summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.in6
-rw-r--r--README.md3
-rw-r--r--SECURITY.md36
-rw-r--r--accessible/html/HTMLTableAccessible.cpp48
-rw-r--r--accessible/html/HTMLTableAccessible.h6
-rwxr-xr-xbuild/autoconf/config.guess20
-rw-r--r--build/autoconf/icu.m417
-rw-r--r--build/autoconf/nspr-build.m434
-rw-r--r--build/defines.sh3
-rw-r--r--build/directive4.py5
-rw-r--r--build/moz.configure/old.configure9
-rw-r--r--build/ppCheck.py72
-rw-r--r--config/Makefile.in3
-rw-r--r--config/external/icu/moz.build22
-rw-r--r--config/external/moz.build12
-rw-r--r--config/external/nss/Makefile.in11
-rw-r--r--config/external/nss/crmf/moz.build19
-rw-r--r--config/external/nss/moz.build8
-rw-r--r--config/external/nss/nss.symbols1
-rw-r--r--config/external/sqlite/moz.build22
-rw-r--r--config/moz.build3
-rw-r--r--config/recurse.mk2
-rw-r--r--config/system-headers28
-rwxr-xr-xconfig/version_win.pl10
-rw-r--r--db/mork/moz.build11
-rw-r--r--db/moz.build11
-rw-r--r--db/sqlite3/src/moz.build35
-rw-r--r--devtools/client/debugger/new/bundle.js2
-rw-r--r--devtools/client/shared/curl.js38
-rw-r--r--devtools/client/themes/webconsole.css1
-rw-r--r--devtools/moz.build16
-rw-r--r--devtools/shared/css/generated/properties-db.js2
-rw-r--r--devtools/shared/heapsnapshot/moz.build66
-rw-r--r--devtools/shared/moz.build1
-rw-r--r--devtools/shared/webconsole/network-helper.js3
-rw-r--r--docs/UXP Coding Style.md264
-rw-r--r--docshell/base/nsAboutRedirector.cpp2
-rw-r--r--docshell/base/nsDocShell.cpp23
-rw-r--r--docshell/build/nsDocShellModule.cpp22
-rw-r--r--dom/base/BlobSet.h3
-rw-r--r--dom/base/CORSMode.h2
-rw-r--r--dom/base/ChromeUtils.cpp1
-rw-r--r--dom/base/ChromeUtils.h1
-rw-r--r--dom/base/CustomElementRegistry.cpp3
-rw-r--r--dom/base/DocGroup.cpp1
-rw-r--r--dom/base/DocGroup.h1
-rw-r--r--dom/base/GroupedSHistory.h2
-rw-r--r--dom/base/ImageTracker.cpp2
-rw-r--r--dom/base/ImageTracker.h1
-rw-r--r--dom/base/MutableBlobStorage.h3
-rw-r--r--dom/base/MutableBlobStreamListener.cpp1
-rw-r--r--dom/base/Navigator.cpp59
-rw-r--r--dom/base/Navigator.h9
-rw-r--r--dom/base/NodeInfo.cpp1
-rw-r--r--dom/base/Pose.h1
-rw-r--r--dom/base/TabGroup.h2
-rw-r--r--dom/base/ThirdPartyUtil.cpp1
-rw-r--r--dom/base/TimeoutHandler.cpp1
-rw-r--r--dom/base/TimeoutHandler.h2
-rwxr-xr-xdom/base/TimerClamping.h2
-rwxr-xr-xdom/base/moz.build4
-rw-r--r--dom/base/nsAttrValue.cpp34
-rw-r--r--dom/base/nsAttrValue.h13
-rw-r--r--dom/base/nsContentUtils.cpp1
-rw-r--r--dom/base/nsContentUtils.h4
-rw-r--r--dom/base/nsDOMMutationObserver.cpp4
-rw-r--r--dom/base/nsDocument.cpp8
-rw-r--r--dom/base/nsFocusManager.cpp9
-rw-r--r--dom/base/nsJSEnvironment.cpp1
-rw-r--r--dom/base/nsJSUtils.cpp1
-rw-r--r--dom/base/nsScriptLoader.cpp2
-rw-r--r--dom/bindings/Bindings.conf13
-rw-r--r--dom/bindings/Codegen.py6
-rw-r--r--dom/bindings/GenerateCSS2PropertiesWebIDL.py1
-rw-r--r--dom/bindings/WebIDLGlobalNameHash.cpp4
-rw-r--r--dom/bindings/WebIDLGlobalNameHash.h1
-rw-r--r--dom/bindings/moz.build2
-rw-r--r--dom/bindings/mozwebidlcodegen/__init__.py1
-rw-r--r--dom/bindings/nsScriptError.h5
-rw-r--r--dom/bindings/nsScriptErrorWithStack.cpp4
-rw-r--r--dom/events/test/test_all_synthetic_events.html4
-rw-r--r--dom/flyweb/FlyWebDiscoveryManager.cpp125
-rw-r--r--dom/flyweb/FlyWebDiscoveryManager.h61
-rw-r--r--dom/flyweb/FlyWebPublishOptionsIPCSerializer.h33
-rw-r--r--dom/flyweb/FlyWebPublishedServer.cpp675
-rw-r--r--dom/flyweb/FlyWebPublishedServer.h109
-rw-r--r--dom/flyweb/FlyWebPublishedServerIPC.h172
-rw-r--r--dom/flyweb/FlyWebServerEvents.cpp141
-rw-r--r--dom/flyweb/FlyWebServerEvents.h88
-rw-r--r--dom/flyweb/FlyWebService.cpp1310
-rw-r--r--dom/flyweb/FlyWebService.h113
-rw-r--r--dom/flyweb/HttpServer.cpp1319
-rw-r--r--dom/flyweb/HttpServer.h193
-rw-r--r--dom/flyweb/PFlyWebPublishedServer.ipdl38
-rw-r--r--dom/flyweb/moz.build42
-rw-r--r--dom/heapsnapshot/.gitattributes (renamed from devtools/shared/heapsnapshot/.gitattributes)0
-rw-r--r--dom/heapsnapshot/AutoMemMap.cpp (renamed from devtools/shared/heapsnapshot/AutoMemMap.cpp)0
-rw-r--r--dom/heapsnapshot/AutoMemMap.h (renamed from devtools/shared/heapsnapshot/AutoMemMap.h)0
-rw-r--r--dom/heapsnapshot/CoreDump.pb.cc (renamed from devtools/shared/heapsnapshot/CoreDump.pb.cc)0
-rw-r--r--dom/heapsnapshot/CoreDump.pb.h (renamed from devtools/shared/heapsnapshot/CoreDump.pb.h)0
-rw-r--r--dom/heapsnapshot/CoreDump.proto (renamed from devtools/shared/heapsnapshot/CoreDump.proto)0
-rw-r--r--dom/heapsnapshot/DeserializedNode.cpp (renamed from devtools/shared/heapsnapshot/DeserializedNode.cpp)0
-rw-r--r--dom/heapsnapshot/DeserializedNode.h (renamed from devtools/shared/heapsnapshot/DeserializedNode.h)0
-rw-r--r--dom/heapsnapshot/DominatorTree.cpp (renamed from devtools/shared/heapsnapshot/DominatorTree.cpp)0
-rw-r--r--dom/heapsnapshot/DominatorTree.h (renamed from devtools/shared/heapsnapshot/DominatorTree.h)0
-rw-r--r--dom/heapsnapshot/FileDescriptorOutputStream.cpp (renamed from devtools/shared/heapsnapshot/FileDescriptorOutputStream.cpp)0
-rw-r--r--dom/heapsnapshot/FileDescriptorOutputStream.h (renamed from devtools/shared/heapsnapshot/FileDescriptorOutputStream.h)0
-rw-r--r--dom/heapsnapshot/HeapSnapshot.cpp (renamed from devtools/shared/heapsnapshot/HeapSnapshot.cpp)0
-rw-r--r--dom/heapsnapshot/HeapSnapshot.h (renamed from devtools/shared/heapsnapshot/HeapSnapshot.h)0
-rw-r--r--dom/heapsnapshot/HeapSnapshotTempFileHelperChild.h (renamed from devtools/shared/heapsnapshot/HeapSnapshotTempFileHelperChild.h)0
-rw-r--r--dom/heapsnapshot/HeapSnapshotTempFileHelperParent.cpp (renamed from devtools/shared/heapsnapshot/HeapSnapshotTempFileHelperParent.cpp)0
-rw-r--r--dom/heapsnapshot/HeapSnapshotTempFileHelperParent.h (renamed from devtools/shared/heapsnapshot/HeapSnapshotTempFileHelperParent.h)0
-rw-r--r--dom/heapsnapshot/PHeapSnapshotTempFileHelper.ipdl (renamed from devtools/shared/heapsnapshot/PHeapSnapshotTempFileHelper.ipdl)0
-rw-r--r--dom/heapsnapshot/ZeroCopyNSIOutputStream.cpp (renamed from devtools/shared/heapsnapshot/ZeroCopyNSIOutputStream.cpp)0
-rw-r--r--dom/heapsnapshot/ZeroCopyNSIOutputStream.h (renamed from devtools/shared/heapsnapshot/ZeroCopyNSIOutputStream.h)0
-rw-r--r--[-rwxr-xr-x]dom/heapsnapshot/generate-core-dump-sources.sh (renamed from devtools/shared/heapsnapshot/generate-core-dump-sources.sh)0
-rw-r--r--dom/heapsnapshot/moz.build52
-rw-r--r--dom/heapsnapshot/tests/gtest/DeserializedNodeUbiNodes.cpp (renamed from devtools/shared/heapsnapshot/tests/gtest/DeserializedNodeUbiNodes.cpp)0
-rw-r--r--dom/heapsnapshot/tests/gtest/DeserializedStackFrameUbiStackFrames.cpp (renamed from devtools/shared/heapsnapshot/tests/gtest/DeserializedStackFrameUbiStackFrames.cpp)0
-rw-r--r--dom/heapsnapshot/tests/gtest/DevTools.h (renamed from devtools/shared/heapsnapshot/tests/gtest/DevTools.h)0
-rw-r--r--dom/heapsnapshot/tests/gtest/DoesCrossCompartmentBoundaries.cpp (renamed from devtools/shared/heapsnapshot/tests/gtest/DoesCrossCompartmentBoundaries.cpp)0
-rw-r--r--dom/heapsnapshot/tests/gtest/DoesntCrossCompartmentBoundaries.cpp (renamed from devtools/shared/heapsnapshot/tests/gtest/DoesntCrossCompartmentBoundaries.cpp)0
-rw-r--r--dom/heapsnapshot/tests/gtest/SerializesEdgeNames.cpp (renamed from devtools/shared/heapsnapshot/tests/gtest/SerializesEdgeNames.cpp)0
-rw-r--r--dom/heapsnapshot/tests/gtest/SerializesEverythingInHeapGraphOnce.cpp (renamed from devtools/shared/heapsnapshot/tests/gtest/SerializesEverythingInHeapGraphOnce.cpp)0
-rw-r--r--dom/heapsnapshot/tests/gtest/SerializesTypeNames.cpp (renamed from devtools/shared/heapsnapshot/tests/gtest/SerializesTypeNames.cpp)0
-rw-r--r--dom/heapsnapshot/tests/gtest/moz.build (renamed from devtools/shared/heapsnapshot/tests/gtest/moz.build)0
-rw-r--r--dom/heapsnapshot/tests/mochitest/chrome.ini (renamed from devtools/shared/heapsnapshot/tests/mochitest/chrome.ini)0
-rw-r--r--dom/heapsnapshot/tests/mochitest/mochitest.ini (renamed from devtools/shared/heapsnapshot/tests/mochitest/mochitest.ini)0
-rw-r--r--dom/heapsnapshot/tests/mochitest/test_DominatorTree_01.html (renamed from devtools/shared/heapsnapshot/tests/mochitest/test_DominatorTree_01.html)0
-rw-r--r--dom/heapsnapshot/tests/mochitest/test_SaveHeapSnapshot.html (renamed from devtools/shared/heapsnapshot/tests/mochitest/test_SaveHeapSnapshot.html)0
-rw-r--r--dom/heapsnapshot/tests/mochitest/test_saveHeapSnapshot_e10s_01.html (renamed from devtools/shared/heapsnapshot/tests/mochitest/test_saveHeapSnapshot_e10s_01.html)0
-rw-r--r--dom/heapsnapshot/tests/unit/.eslintrc.js (renamed from devtools/shared/heapsnapshot/tests/unit/.eslintrc.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/Census.jsm (renamed from devtools/shared/heapsnapshot/tests/unit/Census.jsm)0
-rw-r--r--dom/heapsnapshot/tests/unit/Match.jsm (renamed from devtools/shared/heapsnapshot/tests/unit/Match.jsm)0
-rw-r--r--dom/heapsnapshot/tests/unit/dominator-tree-worker.js (renamed from devtools/shared/heapsnapshot/tests/unit/dominator-tree-worker.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/head_heapsnapshot.js (renamed from devtools/shared/heapsnapshot/tests/unit/head_heapsnapshot.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/heap-snapshot-worker.js (renamed from devtools/shared/heapsnapshot/tests/unit/heap-snapshot-worker.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_02.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_02.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_03.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_03.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_04.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_04.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTreeNode_attachShortestPaths_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_attachShortestPaths_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTreeNode_getNodeByIdAlongPath_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_getNodeByIdAlongPath_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_02.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_02.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_03.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_03.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTreeNode_partialTraversal_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_partialTraversal_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTree_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTree_02.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_02.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTree_03.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_03.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTree_04.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_04.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTree_05.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_05.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_DominatorTree_06.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_06.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_02.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_02.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_02.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_02.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_03.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_03.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_getCensusIndividuals_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCensusIndividuals_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_getCreationTime_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCreationTime_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_02.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_02.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_getImmediatelyDominated_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getImmediatelyDominated_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_readHeapSnapshot_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_readHeapSnapshot_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_02.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_02.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_02.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_02.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_03.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_03.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_05.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_05.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_06.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_06.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_07.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_07.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_02.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_02.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_creationTime_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_creationTime_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_deepStack_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_deepStack_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_describeNode_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_describeNode_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_02.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_02.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_03.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_03.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_04.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_04.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_05.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_05.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_06.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_06.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_07.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_07.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_08.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_08.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_09.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_09.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_10.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_10.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_11.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_11.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_12.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_12.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_ReadHeapSnapshot.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_ReadHeapSnapshot_with_allocations.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot_with_allocations.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_ReadHeapSnapshot_worker.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot_worker.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_SaveHeapSnapshot.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_SaveHeapSnapshot.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census-tree-node-01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census-tree-node-02.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-02.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census-tree-node-03.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-03.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census-tree-node-04.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-04.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census-tree-node-05.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-05.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census-tree-node-06.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-06.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census-tree-node-07.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-07.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census-tree-node-08.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-08.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census-tree-node-09.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-09.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census-tree-node-10.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-10.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census_diff_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census_diff_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census_diff_02.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census_diff_02.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census_diff_03.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census_diff_03.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census_diff_04.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census_diff_04.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census_diff_05.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census_diff_05.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census_diff_06.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census_diff_06.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census_filtering_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census_filtering_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census_filtering_02.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census_filtering_02.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census_filtering_03.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census_filtering_03.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census_filtering_04.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census_filtering_04.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_census_filtering_05.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_census_filtering_05.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_countToBucketBreakdown_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_countToBucketBreakdown_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_deduplicatePaths_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_deduplicatePaths_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_getCensusIndividuals_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_getCensusIndividuals_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_getReportLeaves_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_getReportLeaves_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/test_saveHeapSnapshot_e10s_01.js (renamed from devtools/shared/heapsnapshot/tests/unit/test_saveHeapSnapshot_e10s_01.js)0
-rw-r--r--dom/heapsnapshot/tests/unit/xpcshell.ini (renamed from devtools/shared/heapsnapshot/tests/unit/xpcshell.ini)0
-rw-r--r--dom/html/HTMLLabelElement.h2
-rw-r--r--dom/html/HTMLMediaElement.cpp18
-rw-r--r--dom/html/HTMLObjectElement.h2
-rw-r--r--dom/html/HTMLOptGroupElement.cpp11
-rw-r--r--dom/html/HTMLOptGroupElement.h4
-rw-r--r--dom/html/HTMLOptionElement.h4
-rw-r--r--dom/html/HTMLOutputElement.h2
-rw-r--r--dom/html/HTMLTableCellElement.cpp22
-rw-r--r--dom/html/HTMLTableCellElement.h4
-rw-r--r--dom/html/nsGenericHTMLElement.cpp21
-rw-r--r--dom/html/nsGenericHTMLElement.h6
-rw-r--r--dom/indexedDB/ActorsChild.cpp6
-rw-r--r--dom/inputmethod/moz.build5
-rw-r--r--dom/interfaces/base/nsIDOMWindowUtils.idl2
-rw-r--r--dom/ipc/ContentChild.cpp62
-rw-r--r--dom/ipc/ContentChild.h17
-rw-r--r--dom/ipc/ContentParent.cpp41
-rw-r--r--dom/ipc/ContentParent.h12
-rw-r--r--dom/ipc/PContent.ipdl21
-rw-r--r--dom/mathml/nsMathMLElement.cpp20
-rw-r--r--dom/media/AbstractMediaDecoder.h2
-rw-r--r--dom/media/MediaDecoder.cpp6
-rw-r--r--dom/media/MediaDecoder.h8
-rw-r--r--dom/media/MediaDecoderReader.h4
-rw-r--r--dom/media/MediaDecoderReaderWrapper.h2
-rw-r--r--dom/media/MediaDecoderStateMachine.cpp15
-rw-r--r--dom/media/MediaDecoderStateMachine.h2
-rw-r--r--dom/media/MediaFormatReader.cpp5
-rw-r--r--dom/media/MediaFormatReader.h6
-rw-r--r--dom/media/PeerConnection.js2
-rw-r--r--dom/media/fmp4/MP4Decoder.cpp2
-rw-r--r--dom/media/gmp/GMPChild.cpp6
-rw-r--r--dom/media/gmp/GMPDecryptorParent.cpp29
-rw-r--r--dom/media/gmp/GMPDecryptorProxy.h7
-rw-r--r--dom/media/gmp/GMPParent.cpp11
-rw-r--r--dom/media/gmp/moz.build24
-rw-r--r--dom/media/gtest/MockMediaDecoderOwner.h2
-rw-r--r--dom/media/gtest/moz.build5
-rw-r--r--dom/media/mediasource/TrackBuffersManager.cpp2
-rw-r--r--dom/media/moz.build4
-rw-r--r--dom/media/platforms/PDMFactory.cpp7
-rw-r--r--dom/media/platforms/PDMFactory.h4
-rw-r--r--dom/media/platforms/moz.build4
-rw-r--r--dom/moz.build4
-rw-r--r--dom/performance/Performance.h2
-rw-r--r--dom/performance/PerformanceMainThread.cpp9
-rw-r--r--dom/performance/PerformanceMainThread.h4
-rw-r--r--dom/performance/PerformanceWorker.h2
-rw-r--r--dom/plugins/base/PluginPRLibrary.cpp35
-rw-r--r--dom/plugins/base/android/ANPAudio.cpp390
-rw-r--r--dom/plugins/base/android/ANPBase.h36
-rw-r--r--dom/plugins/base/android/ANPEvent.cpp31
-rw-r--r--dom/plugins/base/android/ANPKeyCodes.h152
-rw-r--r--dom/plugins/base/android/ANPLog.cpp26
-rw-r--r--dom/plugins/base/android/ANPNativeWindow.cpp39
-rw-r--r--dom/plugins/base/android/ANPSurface.cpp266
-rw-r--r--dom/plugins/base/android/ANPSystem.cpp88
-rw-r--r--dom/plugins/base/android/ANPVideo.cpp55
-rw-r--r--dom/plugins/base/android/ANPWindow.cpp152
-rw-r--r--dom/plugins/base/android/android_npapi.h1027
-rw-r--r--dom/plugins/base/android/moz.build35
-rw-r--r--dom/plugins/base/moz.build11
-rw-r--r--dom/plugins/base/npfunctions.h9
-rw-r--r--dom/plugins/base/nsNPAPIPlugin.cpp184
-rw-r--r--dom/plugins/base/nsNPAPIPluginInstance.cpp357
-rw-r--r--dom/plugins/base/nsNPAPIPluginInstance.h127
-rw-r--r--dom/plugins/base/nsPluginHost.cpp70
-rw-r--r--dom/plugins/base/nsPluginInstanceOwner.cpp453
-rw-r--r--dom/plugins/base/nsPluginInstanceOwner.h30
-rw-r--r--dom/plugins/base/nsPluginTags.cpp5
-rw-r--r--dom/plugins/base/nsPluginsDirUnix.cpp10
-rw-r--r--dom/plugins/ipc/NPEventAndroid.h55
-rw-r--r--dom/plugins/ipc/PluginInstanceChild.cpp2
-rw-r--r--dom/plugins/ipc/PluginInstanceParent.cpp3
-rw-r--r--dom/plugins/ipc/PluginMessageUtils.h4
-rw-r--r--dom/plugins/ipc/moz.build1
-rw-r--r--dom/presentation/AvailabilityCollection.cpp99
-rw-r--r--dom/presentation/AvailabilityCollection.h45
-rw-r--r--dom/presentation/ControllerConnectionCollection.cpp116
-rw-r--r--dom/presentation/ControllerConnectionCollection.h49
-rw-r--r--dom/presentation/DCPresentationChannelDescription.cpp46
-rw-r--r--dom/presentation/DCPresentationChannelDescription.h37
-rw-r--r--dom/presentation/Presentation.cpp182
-rw-r--r--dom/presentation/Presentation.h70
-rw-r--r--dom/presentation/PresentationAvailability.cpp206
-rw-r--r--dom/presentation/PresentationAvailability.h74
-rw-r--r--dom/presentation/PresentationCallbacks.cpp282
-rw-r--r--dom/presentation/PresentationCallbacks.h85
-rw-r--r--dom/presentation/PresentationConnection.cpp763
-rw-r--r--dom/presentation/PresentationConnection.h128
-rw-r--r--dom/presentation/PresentationConnectionList.cpp125
-rw-r--r--dom/presentation/PresentationConnectionList.h57
-rw-r--r--dom/presentation/PresentationDataChannelSessionTransport.js378
-rw-r--r--dom/presentation/PresentationDataChannelSessionTransport.manifest6
-rw-r--r--dom/presentation/PresentationDeviceInfoManager.js119
-rw-r--r--dom/presentation/PresentationDeviceInfoManager.jsm104
-rw-r--r--dom/presentation/PresentationDeviceInfoManager.manifest3
-rw-r--r--dom/presentation/PresentationDeviceManager.cpp336
-rw-r--r--dom/presentation/PresentationDeviceManager.h54
-rw-r--r--dom/presentation/PresentationLog.h26
-rw-r--r--dom/presentation/PresentationNetworkHelper.js28
-rw-r--r--dom/presentation/PresentationNetworkHelper.manifest3
-rw-r--r--dom/presentation/PresentationReceiver.cpp179
-rw-r--r--dom/presentation/PresentationReceiver.h71
-rw-r--r--dom/presentation/PresentationRequest.cpp563
-rw-r--r--dom/presentation/PresentationRequest.h84
-rw-r--r--dom/presentation/PresentationService.cpp1188
-rw-r--r--dom/presentation/PresentationService.h68
-rw-r--r--dom/presentation/PresentationServiceBase.h401
-rw-r--r--dom/presentation/PresentationSessionInfo.cpp1617
-rw-r--r--dom/presentation/PresentationSessionInfo.h304
-rw-r--r--dom/presentation/PresentationSessionRequest.cpp72
-rw-r--r--dom/presentation/PresentationSessionRequest.h41
-rw-r--r--dom/presentation/PresentationTCPSessionTransport.cpp589
-rw-r--r--dom/presentation/PresentationTCPSessionTransport.h110
-rw-r--r--dom/presentation/PresentationTerminateRequest.cpp73
-rw-r--r--dom/presentation/PresentationTerminateRequest.h41
-rw-r--r--dom/presentation/PresentationTransportBuilderConstructor.cpp85
-rw-r--r--dom/presentation/PresentationTransportBuilderConstructor.h48
-rw-r--r--dom/presentation/interfaces/moz.build30
-rw-r--r--dom/presentation/interfaces/nsIPresentationControlChannel.idl139
-rw-r--r--dom/presentation/interfaces/nsIPresentationControlService.idl156
-rw-r--r--dom/presentation/interfaces/nsIPresentationDevice.idl43
-rw-r--r--dom/presentation/interfaces/nsIPresentationDeviceManager.idl51
-rw-r--r--dom/presentation/interfaces/nsIPresentationDevicePrompt.idl58
-rw-r--r--dom/presentation/interfaces/nsIPresentationDeviceProvider.idl75
-rw-r--r--dom/presentation/interfaces/nsIPresentationListener.idl50
-rw-r--r--dom/presentation/interfaces/nsIPresentationLocalDevice.idl17
-rw-r--r--dom/presentation/interfaces/nsIPresentationNetworkHelper.idl36
-rw-r--r--dom/presentation/interfaces/nsIPresentationRequestUIGlue.idl29
-rw-r--r--dom/presentation/interfaces/nsIPresentationService.idl275
-rw-r--r--dom/presentation/interfaces/nsIPresentationSessionRequest.idl35
-rw-r--r--dom/presentation/interfaces/nsIPresentationSessionTransport.idl69
-rw-r--r--dom/presentation/interfaces/nsIPresentationSessionTransportBuilder.idl80
-rw-r--r--dom/presentation/interfaces/nsIPresentationTerminateRequest.idl33
-rw-r--r--dom/presentation/ipc/PPresentation.ipdl112
-rw-r--r--dom/presentation/ipc/PPresentationBuilder.ipdl34
-rw-r--r--dom/presentation/ipc/PPresentationRequest.ipdl22
-rw-r--r--dom/presentation/ipc/PresentationBuilderChild.cpp184
-rw-r--r--dom/presentation/ipc/PresentationBuilderChild.h48
-rw-r--r--dom/presentation/ipc/PresentationBuilderParent.cpp267
-rw-r--r--dom/presentation/ipc/PresentationBuilderParent.h52
-rw-r--r--dom/presentation/ipc/PresentationChild.cpp198
-rw-r--r--dom/presentation/ipc/PresentationChild.h101
-rw-r--r--dom/presentation/ipc/PresentationContentSessionInfo.cpp109
-rw-r--r--dom/presentation/ipc/PresentationContentSessionInfo.h62
-rw-r--r--dom/presentation/ipc/PresentationIPCService.cpp538
-rw-r--r--dom/presentation/ipc/PresentationIPCService.h75
-rw-r--r--dom/presentation/ipc/PresentationParent.cpp553
-rw-r--r--dom/presentation/ipc/PresentationParent.h137
-rw-r--r--dom/presentation/moz.build89
-rw-r--r--dom/presentation/provider/AndroidCastDeviceProvider.js461
-rw-r--r--dom/presentation/provider/AndroidCastDeviceProvider.manifest4
-rw-r--r--dom/presentation/provider/BuiltinProviders.manifest2
-rw-r--r--dom/presentation/provider/ControllerStateMachine.jsm240
-rw-r--r--dom/presentation/provider/DeviceProviderHelpers.cpp57
-rw-r--r--dom/presentation/provider/DeviceProviderHelpers.h30
-rw-r--r--dom/presentation/provider/DisplayDeviceProvider.cpp580
-rw-r--r--dom/presentation/provider/DisplayDeviceProvider.h136
-rw-r--r--dom/presentation/provider/LegacyMDNSDeviceProvider.cpp774
-rw-r--r--dom/presentation/provider/LegacyMDNSDeviceProvider.h191
-rw-r--r--dom/presentation/provider/LegacyPresentationControlService.js488
-rw-r--r--dom/presentation/provider/LegacyProviders.manifest2
-rw-r--r--dom/presentation/provider/MulticastDNSDeviceProvider.cpp1249
-rw-r--r--dom/presentation/provider/MulticastDNSDeviceProvider.h225
-rw-r--r--dom/presentation/provider/PresentationControlService.js960
-rw-r--r--dom/presentation/provider/PresentationDeviceProviderModule.cpp87
-rw-r--r--dom/presentation/provider/ReceiverStateMachine.jsm238
-rw-r--r--dom/presentation/provider/StateMachineHelper.jsm39
-rw-r--r--dom/presentation/provider/moz.build40
-rw-r--r--dom/presentation/provider/nsTCPDeviceInfo.h77
-rw-r--r--dom/presentation/tests/mochitest/PresentationDeviceInfoChromeScript.js150
-rw-r--r--dom/presentation/tests/mochitest/PresentationSessionChromeScript.js470
-rw-r--r--dom/presentation/tests/mochitest/PresentationSessionChromeScript1UA.js366
-rw-r--r--dom/presentation/tests/mochitest/PresentationSessionFrameScript.js258
-rw-r--r--dom/presentation/tests/mochitest/chrome.ini14
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_1ua_receiver.html220
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_1ua_wentaway.html95
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_mixed_security_contexts.html159
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_non_receiver.html41
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_non_receiver_inner_iframe.html26
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_receiver.html140
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_receiver_auxiliary_navigation.html60
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_receiver_establish_connection_error.html79
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_receiver_inner_iframe.html26
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_reconnect.html102
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_sandboxed_presentation.html114
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_terminate.html104
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_terminate_establish_connection_error.html114
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_unknown_content_type.test1
-rw-r--r--dom/presentation/tests/mochitest/file_presentation_unknown_content_type.test^headers^1
-rw-r--r--dom/presentation/tests/mochitest/mochitest.ini77
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_1ua_connection_wentaway.js175
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_1ua_connection_wentaway_inproc.html18
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_1ua_connection_wentaway_oop.html18
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_1ua_sender_and_receiver.js370
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_1ua_sender_and_receiver_inproc.html18
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_1ua_sender_and_receiver_oop.html18
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_availability.html236
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_datachannel_sessiontransport.html245
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_dc_receiver.html141
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_dc_receiver_oop.html213
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_dc_sender.html291
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_device_info.html144
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_device_info_permission.html35
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_mixed_security_contexts.html81
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_receiver_auxiliary_navigation.js77
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_receiver_auxiliary_navigation_inproc.html18
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_receiver_auxiliary_navigation_oop.html18
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_reconnect.html379
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_sandboxed_presentation.html75
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html187
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_sender_startWithDevice.html173
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_tcp_receiver.html137
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_error.html110
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_timeout.html81
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_unknown_content_type.js88
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_unknown_content_type_inproc.html16
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_unknown_content_type_oop.html16
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_tcp_receiver_oop.html178
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_tcp_sender.html260
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_tcp_sender_default_request.html151
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_tcp_sender_disconnect.html160
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_tcp_sender_establish_connection_error.html514
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_terminate.js243
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_terminate_establish_connection_error.js197
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_terminate_establish_connection_error_inproc.html18
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_terminate_establish_connection_error_oop.html18
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_terminate_inproc.html18
-rw-r--r--dom/presentation/tests/mochitest/test_presentation_terminate_oop.html18
-rw-r--r--dom/presentation/tests/xpcshell/test_multicast_dns_device_provider.js1318
-rw-r--r--dom/presentation/tests/xpcshell/test_presentation_device_manager.js244
-rw-r--r--dom/presentation/tests/xpcshell/test_presentation_session_transport.js198
-rw-r--r--dom/presentation/tests/xpcshell/test_presentation_state_machine.js236
-rw-r--r--dom/presentation/tests/xpcshell/test_tcp_control_channel.js398
-rw-r--r--dom/presentation/tests/xpcshell/xpcshell.ini9
-rw-r--r--dom/push/PushRecord.jsm16
-rw-r--r--dom/push/PushService.jsm11
-rw-r--r--dom/push/PushServiceWebSocket.jsm1
-rw-r--r--dom/push/moz.build7
-rw-r--r--dom/security/nsCSPUtils.cpp16
-rw-r--r--dom/system/OSFileConstants.cpp15
-rw-r--r--dom/webidl/FlyWebDiscoveryManager.webidl39
-rw-r--r--dom/webidl/FlyWebFetchEvent.webidl13
-rw-r--r--dom/webidl/FlyWebPublish.webidl23
-rw-r--r--dom/webidl/FlyWebWebSocketEvent.webidl16
-rw-r--r--dom/webidl/Navigator.webidl11
-rw-r--r--dom/webidl/Performance.webidl2
-rw-r--r--dom/webidl/Presentation.webidl30
-rw-r--r--dom/webidl/PresentationAvailability.webidl22
-rw-r--r--dom/webidl/PresentationConnection.webidl96
-rw-r--r--dom/webidl/PresentationConnectionAvailableEvent.webidl22
-rw-r--r--dom/webidl/PresentationConnectionCloseEvent.webidl41
-rw-r--r--dom/webidl/PresentationConnectionList.webidl25
-rw-r--r--dom/webidl/PresentationDeviceInfoManager.webidl26
-rw-r--r--dom/webidl/PresentationReceiver.webidl18
-rw-r--r--dom/webidl/PresentationRequest.webidl86
-rw-r--r--dom/webidl/moz.build37
-rw-r--r--editor/libeditor/HTMLEditRules.cpp6
-rw-r--r--editor/libeditor/HTMLEditor.cpp10
-rw-r--r--editor/libeditor/HTMLStyleEditor.cpp3
-rw-r--r--editor/libeditor/HTMLTableEditor.cpp4
-rw-r--r--embedding/components/webbrowserpersist/nsWebBrowserPersist.cpp4
-rw-r--r--embedding/components/windowwatcher/nsWindowWatcher.cpp6
-rw-r--r--gfx/2d/ScaledFontDWrite.cpp2
-rw-r--r--gfx/layers/composite/TextureHost.cpp8
-rw-r--r--gfx/thebes/gfxAndroidPlatform.h5
-rw-r--r--gfx/thebes/gfxPlatform.cpp47
-rw-r--r--gfx/thebes/gfxPlatform.h2
-rw-r--r--gfx/thebes/gfxPlatformGtk.h4
-rw-r--r--gfx/thebes/gfxPlatformMac.cpp6
-rw-r--r--gfx/thebes/gfxPlatformMac.h3
-rw-r--r--gfx/thebes/gfxPrefs.h4
-rw-r--r--gfx/thebes/gfxWindowsPlatform.h3
-rw-r--r--hal/android/AndroidAlarm.cpp48
-rw-r--r--hal/android/AndroidHal.cpp175
-rw-r--r--hal/android/AndroidSensor.cpp25
-rw-r--r--hal/moz.build24
-rw-r--r--image/decoders/icon/android/moz.build13
-rw-r--r--image/decoders/icon/android/nsIconChannel.cpp145
-rw-r--r--image/decoders/icon/android/nsIconChannel.h46
-rw-r--r--image/decoders/icon/moz.build3
-rw-r--r--image/decoders/moz.build2
-rw-r--r--intl/locale/nsLocaleService.cpp5
-rw-r--r--ipc/app/Makefile.in4
-rw-r--r--ipc/app/MozillaRuntimeMainAndroid.cpp35
-rw-r--r--ipc/app/moz.build31
-rw-r--r--ipc/app/pie/moz.build19
-rw-r--r--ipc/chromium/src/build/build_config.h2
-rw-r--r--ipc/contentproc/plugin-container.cpp2
-rw-r--r--ipc/glue/GeckoChildProcessHost.cpp47
-rw-r--r--ipc/glue/ProtocolUtils.cpp4
-rw-r--r--ipc/glue/ProtocolUtils.h4
-rw-r--r--ipc/glue/SharedMemoryBasic.h4
-rw-r--r--ipc/glue/SharedMemoryBasic_android.cpp139
-rw-r--r--ipc/glue/SharedMemoryBasic_android.h72
-rw-r--r--ipc/glue/moz.build10
-rw-r--r--ipc/moz.build4
-rw-r--r--ipc/testshell/XPCShellEnvironment.cpp2
-rw-r--r--js/ductwork/inspector/moz.build (renamed from devtools/shared/jsinspector/moz.build)0
-rw-r--r--js/ductwork/inspector/nsIJSInspector.idl (renamed from devtools/shared/jsinspector/nsIJSInspector.idl)0
-rw-r--r--js/ductwork/inspector/nsJSInspector.cpp (renamed from devtools/shared/jsinspector/nsJSInspector.cpp)0
-rw-r--r--js/ductwork/inspector/nsJSInspector.h (renamed from devtools/shared/jsinspector/nsJSInspector.h)0
-rw-r--r--js/ductwork/moz.build (renamed from toolkit/themes/mobile/moz.build)5
-rw-r--r--js/public/HeapAPI.h2
-rw-r--r--js/src/builtin/ModuleObject.cpp2
-rw-r--r--js/src/builtin/ReflectParse.cpp14
-rw-r--r--js/src/frontend/BytecodeEmitter.cpp74
-rw-r--r--js/src/frontend/BytecodeEmitter.h2
-rw-r--r--js/src/frontend/FoldConstants.cpp7
-rw-r--r--js/src/frontend/NameFunctions.cpp6
-rw-r--r--js/src/frontend/ParseNode.cpp11
-rw-r--r--js/src/frontend/Parser.cpp88
-rw-r--r--js/src/gc/GCRuntime.h2
-rw-r--r--js/src/gc/Marking.cpp48
-rw-r--r--js/src/gc/Memory.cpp6
-rw-r--r--js/src/gc/Nursery.cpp3
-rw-r--r--js/src/gc/Tracer.cpp69
-rw-r--r--js/src/jit-test/tests/basic/unboxed-object-clear-new-script.js49
-rw-r--r--js/src/jit-test/tests/basic/unboxed-object-convert-to-native.js47
-rw-r--r--js/src/jit-test/tests/basic/unboxed-object-getelem.js20
-rw-r--r--js/src/jit-test/tests/basic/unboxed-object-set-property.js31
-rw-r--r--js/src/jit-test/tests/basic/unboxed-property-enumeration.js24
-rw-r--r--js/src/jit-test/tests/ion/unboxed-objects-invalidate.js16
-rw-r--r--js/src/jit/AliasAnalysisShared.cpp6
-rw-r--r--js/src/jit/BaselineCacheIR.cpp68
-rw-r--r--js/src/jit/BaselineCompiler.cpp12
-rw-r--r--js/src/jit/BaselineCompiler.h1
-rw-r--r--js/src/jit/BaselineIC.cpp482
-rw-r--r--js/src/jit/BaselineIC.h78
-rw-r--r--js/src/jit/BaselineInspector.cpp79
-rw-r--r--js/src/jit/BaselineInspector.h11
-rw-r--r--js/src/jit/CacheIR.cpp79
-rw-r--r--js/src/jit/CacheIR.h25
-rw-r--r--js/src/jit/CodeGenerator.cpp474
-rw-r--r--js/src/jit/CodeGenerator.h7
-rw-r--r--js/src/jit/CompileInfo.h2
-rw-r--r--js/src/jit/Ion.cpp8
-rw-r--r--js/src/jit/IonAnalysis.cpp272
-rw-r--r--js/src/jit/IonAnalysis.h3
-rw-r--r--js/src/jit/IonBuilder.cpp654
-rw-r--r--js/src/jit/IonBuilder.h35
-rw-r--r--js/src/jit/IonCaches.cpp471
-rw-r--r--js/src/jit/IonCaches.h12
-rw-r--r--js/src/jit/JitOptions.cpp3
-rw-r--r--js/src/jit/JitOptions.h3
-rw-r--r--js/src/jit/Lowering.cpp83
-rw-r--r--js/src/jit/Lowering.h7
-rw-r--r--js/src/jit/MCallOptimize.cpp90
-rw-r--r--js/src/jit/MIR.cpp245
-rw-r--r--js/src/jit/MIR.h350
-rw-r--r--js/src/jit/MOpcodes.h7
-rw-r--r--js/src/jit/MacroAssembler.cpp309
-rw-r--r--js/src/jit/MacroAssembler.h17
-rw-r--r--js/src/jit/OptimizationTracking.cpp2
-rw-r--r--js/src/jit/Recover.cpp38
-rw-r--r--js/src/jit/ScalarReplacement.cpp150
-rw-r--r--js/src/jit/SharedIC.cpp40
-rw-r--r--js/src/jit/VMFunctions.cpp29
-rw-r--r--js/src/jit/VMFunctions.h6
-rw-r--r--js/src/jit/shared/LIR-shared.h138
-rw-r--r--js/src/jit/shared/LOpcodes-shared.h7
-rw-r--r--js/src/jsapi-tests/testGCAllocator.cpp7
-rw-r--r--js/src/jsapi.cpp3
-rw-r--r--js/src/jsapi.h33
-rw-r--r--js/src/jsarray.cpp521
-rw-r--r--js/src/jsarray.h41
-rw-r--r--js/src/jscompartment.h3
-rw-r--r--js/src/jsfriendapi.cpp4
-rw-r--r--js/src/jsgc.cpp8
-rw-r--r--js/src/jsgc.h2
-rw-r--r--js/src/jsiter.cpp42
-rw-r--r--js/src/jsobj.cpp119
-rw-r--r--js/src/jsobjinlines.h17
-rw-r--r--js/src/jsstr.cpp10
-rw-r--r--js/src/jsstr.h2
-rw-r--r--js/src/moz.build1
-rw-r--r--js/src/old-configure.in16
-rw-r--r--js/src/shell/js.cpp11
-rw-r--r--js/src/tests/js1_8_5/reflect-parse/statements.js11
-rw-r--r--js/src/vm/CommonPropertyNames.h6
-rw-r--r--js/src/vm/ErrorObject.cpp8
-rw-r--r--js/src/vm/Interpreter-inl.h15
-rw-r--r--js/src/vm/Interpreter.cpp28
-rw-r--r--js/src/vm/JSONParser.cpp4
-rw-r--r--js/src/vm/NativeObject-inl.h32
-rw-r--r--js/src/vm/NativeObject.cpp44
-rw-r--r--js/src/vm/NativeObject.h28
-rw-r--r--js/src/vm/ObjectGroup-inl.h14
-rw-r--r--js/src/vm/ObjectGroup.cpp158
-rw-r--r--js/src/vm/ObjectGroup.h72
-rw-r--r--js/src/vm/Opcodes.h12
-rw-r--r--js/src/vm/ReceiverGuard.cpp19
-rw-r--r--js/src/vm/ReceiverGuard.h5
-rw-r--r--js/src/vm/RegExpObject.cpp3
-rw-r--r--js/src/vm/Stack.cpp2
-rw-r--r--js/src/vm/Stack.h2
-rw-r--r--js/src/vm/TypeInference-inl.h5
-rw-r--r--js/src/vm/TypeInference.cpp176
-rw-r--r--js/src/vm/TypeInference.h5
-rw-r--r--js/src/vm/UnboxedObject-inl.h840
-rw-r--r--js/src/vm/UnboxedObject.cpp2132
-rw-r--r--js/src/vm/UnboxedObject.h531
-rw-r--r--js/xpconnect/src/XPCJSContext.cpp4
-rw-r--r--layout/base/crashtests/crashtests.list2
-rw-r--r--layout/base/nsCSSFrameConstructor.cpp2
-rw-r--r--layout/base/nsCaret.cpp5
-rw-r--r--layout/base/nsRefreshDriver.cpp98
-rw-r--r--layout/base/nsRefreshDriver.h5
-rw-r--r--layout/build/nsLayoutModule.cpp42
-rw-r--r--layout/forms/nsComboboxControlFrame.cpp4
-rw-r--r--layout/forms/nsFormControlFrame.cpp6
-rw-r--r--layout/forms/nsGfxButtonControlFrame.cpp5
-rw-r--r--layout/forms/nsImageControlFrame.cpp8
-rw-r--r--layout/forms/nsListControlFrame.cpp11
-rw-r--r--layout/generic/nsContainerFrame.cpp6
-rw-r--r--layout/generic/nsFrame.cpp27
-rw-r--r--layout/generic/nsGridContainerFrame.cpp58
-rw-r--r--layout/generic/nsIFrame.h5
-rw-r--r--layout/generic/nsSelection.cpp24
-rw-r--r--layout/mathml/nsMathMLmtableFrame.cpp61
-rw-r--r--layout/mathml/nsMathMLmtableFrame.h2
-rw-r--r--layout/reftests/css-grid/grid-max-sizing-flex-007-ref.html24
-rw-r--r--layout/reftests/css-grid/grid-max-sizing-flex-007.html24
-rw-r--r--layout/style/nsCSSParser.cpp16
-rw-r--r--layout/style/nsCSSPropList.h14
-rw-r--r--layout/style/nsCSSProps.cpp2
-rw-r--r--layout/style/nsComputedDOMStyle.cpp16
-rw-r--r--layout/style/nsComputedDOMStyle.h1
-rw-r--r--layout/style/nsComputedDOMStylePropertyList.h1
-rw-r--r--layout/style/nsStyleConsts.h2
-rw-r--r--layout/style/nsTransitionManager.cpp1
-rw-r--r--layout/style/res/forms.css1
-rw-r--r--layout/style/test/property_database.js2
-rw-r--r--layout/tables/celldata.h6
-rw-r--r--layout/tables/nsCellMap.cpp8
-rw-r--r--layout/tables/nsITableCellLayout.h10
-rw-r--r--layout/tables/nsTableCellFrame.cpp128
-rw-r--r--layout/tables/nsTableCellFrame.h55
-rw-r--r--layout/tables/nsTableFrame.cpp258
-rw-r--r--layout/tables/nsTableFrame.h33
-rw-r--r--layout/tables/nsTableRowFrame.cpp38
-rw-r--r--layout/tables/nsTableRowFrame.h4
-rw-r--r--layout/tables/nsTableRowGroupFrame.cpp6
-rw-r--r--layout/tools/reftest/reftestcommandline.py3
-rw-r--r--layout/tools/reftest/runreftest.py5
-rw-r--r--mailnews/base/search/content/searchWidgets.xml2
-rw-r--r--mailnews/base/src/moz.build6
-rw-r--r--mailnews/base/src/nsMailNewsCommandLineHandler.js6
-rw-r--r--mailnews/mailnews.mozbuild16
-rw-r--r--media/libaom/generate_sources_mozbuild.py2
-rwxr-xr-xmedia/libaom/generate_sources_mozbuild.sh2
-rw-r--r--media/libaom/moz.build4
-rw-r--r--media/libaom/sources.mozbuild1026
-rw-r--r--media/libaom/src/.clang-format (renamed from third_party/aom/.clang-format)0
-rw-r--r--media/libaom/src/.cmake-format.py (renamed from third_party/aom/.cmake-format.py)0
-rw-r--r--media/libaom/src/.mailmap (renamed from third_party/aom/.mailmap)0
-rw-r--r--media/libaom/src/AUTHORS (renamed from third_party/aom/AUTHORS)0
-rw-r--r--media/libaom/src/CHANGELOG (renamed from third_party/aom/CHANGELOG)0
-rw-r--r--media/libaom/src/CMakeLists.txt (renamed from third_party/aom/CMakeLists.txt)0
-rw-r--r--media/libaom/src/LICENSE (renamed from third_party/aom/LICENSE)0
-rw-r--r--media/libaom/src/PATENTS (renamed from third_party/aom/PATENTS)0
-rw-r--r--media/libaom/src/README.md (renamed from third_party/aom/README.md)0
-rw-r--r--media/libaom/src/aom/aom.h (renamed from third_party/aom/aom/aom.h)0
-rw-r--r--media/libaom/src/aom/aom_codec.h (renamed from third_party/aom/aom/aom_codec.h)0
-rw-r--r--media/libaom/src/aom/aom_decoder.h (renamed from third_party/aom/aom/aom_decoder.h)0
-rw-r--r--media/libaom/src/aom/aom_encoder.h (renamed from third_party/aom/aom/aom_encoder.h)0
-rw-r--r--media/libaom/src/aom/aom_frame_buffer.h (renamed from third_party/aom/aom/aom_frame_buffer.h)0
-rw-r--r--media/libaom/src/aom/aom_image.h (renamed from third_party/aom/aom/aom_image.h)0
-rw-r--r--media/libaom/src/aom/aom_integer.h (renamed from third_party/aom/aom/aom_integer.h)0
-rw-r--r--media/libaom/src/aom/aomcx.h (renamed from third_party/aom/aom/aomcx.h)0
-rw-r--r--media/libaom/src/aom/aomdx.h (renamed from third_party/aom/aom/aomdx.h)0
-rw-r--r--media/libaom/src/aom/exports_com (renamed from third_party/aom/aom/exports_com)0
-rw-r--r--media/libaom/src/aom/exports_dec (renamed from third_party/aom/aom/exports_dec)0
-rw-r--r--media/libaom/src/aom/exports_enc (renamed from third_party/aom/aom/exports_enc)0
-rw-r--r--media/libaom/src/aom/exports_test (renamed from third_party/aom/aom/exports_test)0
-rw-r--r--media/libaom/src/aom/internal/aom_codec_internal.h (renamed from third_party/aom/aom/internal/aom_codec_internal.h)0
-rw-r--r--media/libaom/src/aom/src/aom_codec.c (renamed from third_party/aom/aom/src/aom_codec.c)0
-rw-r--r--media/libaom/src/aom/src/aom_decoder.c (renamed from third_party/aom/aom/src/aom_decoder.c)0
-rw-r--r--media/libaom/src/aom/src/aom_encoder.c (renamed from third_party/aom/aom/src/aom_encoder.c)0
-rw-r--r--media/libaom/src/aom/src/aom_image.c (renamed from third_party/aom/aom/src/aom_image.c)0
-rw-r--r--media/libaom/src/aom/src/aom_integer.c (renamed from third_party/aom/aom/src/aom_integer.c)0
-rw-r--r--media/libaom/src/aom_dsp/add_noise.c (renamed from third_party/aom/aom_dsp/add_noise.c)0
-rw-r--r--media/libaom/src/aom_dsp/aom_convolve.c (renamed from third_party/aom/aom_dsp/aom_convolve.c)0
-rw-r--r--media/libaom/src/aom_dsp/aom_dsp.cmake (renamed from third_party/aom/aom_dsp/aom_dsp.cmake)0
-rw-r--r--media/libaom/src/aom_dsp/aom_dsp_common.h (renamed from third_party/aom/aom_dsp/aom_dsp_common.h)0
-rw-r--r--media/libaom/src/aom_dsp/aom_dsp_rtcd.c (renamed from third_party/aom/aom_dsp/aom_dsp_rtcd.c)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/aom_dsp/aom_dsp_rtcd_defs.pl (renamed from third_party/aom/aom_dsp/aom_dsp_rtcd_defs.pl)0
-rw-r--r--media/libaom/src/aom_dsp/aom_filter.h (renamed from third_party/aom/aom_dsp/aom_filter.h)0
-rw-r--r--media/libaom/src/aom_dsp/aom_simd.h (renamed from third_party/aom/aom_dsp/aom_simd.h)0
-rw-r--r--media/libaom/src/aom_dsp/aom_simd_inline.h (renamed from third_party/aom/aom_dsp/aom_simd_inline.h)0
-rw-r--r--media/libaom/src/aom_dsp/arm/blend_a64_mask_neon.c (renamed from third_party/aom/aom_dsp/arm/blend_a64_mask_neon.c)0
-rw-r--r--media/libaom/src/aom_dsp/arm/fwd_txfm_neon.c (renamed from third_party/aom/aom_dsp/arm/fwd_txfm_neon.c)0
-rw-r--r--media/libaom/src/aom_dsp/arm/intrapred_neon.c (renamed from third_party/aom/aom_dsp/arm/intrapred_neon.c)0
-rw-r--r--media/libaom/src/aom_dsp/arm/loopfilter_neon.c (renamed from third_party/aom/aom_dsp/arm/loopfilter_neon.c)0
-rw-r--r--media/libaom/src/aom_dsp/arm/sad4d_neon.c (renamed from third_party/aom/aom_dsp/arm/sad4d_neon.c)0
-rw-r--r--media/libaom/src/aom_dsp/arm/sad_neon.c (renamed from third_party/aom/aom_dsp/arm/sad_neon.c)0
-rw-r--r--media/libaom/src/aom_dsp/arm/subpel_variance_neon.c (renamed from third_party/aom/aom_dsp/arm/subpel_variance_neon.c)0
-rw-r--r--media/libaom/src/aom_dsp/arm/subtract_neon.c (renamed from third_party/aom/aom_dsp/arm/subtract_neon.c)0
-rw-r--r--media/libaom/src/aom_dsp/arm/variance_neon.c (renamed from third_party/aom/aom_dsp/arm/variance_neon.c)0
-rw-r--r--media/libaom/src/aom_dsp/binary_codes_reader.c (renamed from third_party/aom/aom_dsp/binary_codes_reader.c)0
-rw-r--r--media/libaom/src/aom_dsp/binary_codes_reader.h (renamed from third_party/aom/aom_dsp/binary_codes_reader.h)0
-rw-r--r--media/libaom/src/aom_dsp/binary_codes_writer.c (renamed from third_party/aom/aom_dsp/binary_codes_writer.c)0
-rw-r--r--media/libaom/src/aom_dsp/binary_codes_writer.h (renamed from third_party/aom/aom_dsp/binary_codes_writer.h)0
-rw-r--r--media/libaom/src/aom_dsp/bitreader.h (renamed from third_party/aom/aom_dsp/bitreader.h)0
-rw-r--r--media/libaom/src/aom_dsp/bitreader_buffer.c (renamed from third_party/aom/aom_dsp/bitreader_buffer.c)0
-rw-r--r--media/libaom/src/aom_dsp/bitreader_buffer.h (renamed from third_party/aom/aom_dsp/bitreader_buffer.h)0
-rw-r--r--media/libaom/src/aom_dsp/bitwriter.h (renamed from third_party/aom/aom_dsp/bitwriter.h)0
-rw-r--r--media/libaom/src/aom_dsp/bitwriter_buffer.c (renamed from third_party/aom/aom_dsp/bitwriter_buffer.c)0
-rw-r--r--media/libaom/src/aom_dsp/bitwriter_buffer.h (renamed from third_party/aom/aom_dsp/bitwriter_buffer.h)0
-rw-r--r--media/libaom/src/aom_dsp/blend.h (renamed from third_party/aom/aom_dsp/blend.h)0
-rw-r--r--media/libaom/src/aom_dsp/blend_a64_hmask.c (renamed from third_party/aom/aom_dsp/blend_a64_hmask.c)0
-rw-r--r--media/libaom/src/aom_dsp/blend_a64_mask.c (renamed from third_party/aom/aom_dsp/blend_a64_mask.c)0
-rw-r--r--media/libaom/src/aom_dsp/blend_a64_vmask.c (renamed from third_party/aom/aom_dsp/blend_a64_vmask.c)0
-rw-r--r--media/libaom/src/aom_dsp/buf_ans.c (renamed from third_party/aom/aom_dsp/buf_ans.c)0
-rw-r--r--media/libaom/src/aom_dsp/buf_ans.h (renamed from third_party/aom/aom_dsp/buf_ans.h)0
-rw-r--r--media/libaom/src/aom_dsp/daalaboolreader.c (renamed from third_party/aom/aom_dsp/daalaboolreader.c)0
-rw-r--r--media/libaom/src/aom_dsp/daalaboolreader.h (renamed from third_party/aom/aom_dsp/daalaboolreader.h)0
-rw-r--r--media/libaom/src/aom_dsp/daalaboolwriter.c (renamed from third_party/aom/aom_dsp/daalaboolwriter.c)0
-rw-r--r--media/libaom/src/aom_dsp/daalaboolwriter.h (renamed from third_party/aom/aom_dsp/daalaboolwriter.h)0
-rw-r--r--media/libaom/src/aom_dsp/entcode.c (renamed from third_party/aom/aom_dsp/entcode.c)0
-rw-r--r--media/libaom/src/aom_dsp/entcode.h (renamed from third_party/aom/aom_dsp/entcode.h)0
-rw-r--r--media/libaom/src/aom_dsp/entdec.c (renamed from third_party/aom/aom_dsp/entdec.c)0
-rw-r--r--media/libaom/src/aom_dsp/entdec.h (renamed from third_party/aom/aom_dsp/entdec.h)0
-rw-r--r--media/libaom/src/aom_dsp/entenc.c (renamed from third_party/aom/aom_dsp/entenc.c)0
-rw-r--r--media/libaom/src/aom_dsp/entenc.h (renamed from third_party/aom/aom_dsp/entenc.h)0
-rw-r--r--media/libaom/src/aom_dsp/fastssim.c (renamed from third_party/aom/aom_dsp/fastssim.c)0
-rw-r--r--media/libaom/src/aom_dsp/fft.c (renamed from third_party/aom/aom_dsp/fft.c)0
-rw-r--r--media/libaom/src/aom_dsp/fft_common.h (renamed from third_party/aom/aom_dsp/fft_common.h)0
-rw-r--r--media/libaom/src/aom_dsp/fwd_txfm.c (renamed from third_party/aom/aom_dsp/fwd_txfm.c)0
-rw-r--r--media/libaom/src/aom_dsp/grain_synthesis.c (renamed from third_party/aom/aom_dsp/grain_synthesis.c)0
-rw-r--r--media/libaom/src/aom_dsp/grain_synthesis.h (renamed from third_party/aom/aom_dsp/grain_synthesis.h)0
-rw-r--r--media/libaom/src/aom_dsp/grain_table.c (renamed from third_party/aom/aom_dsp/grain_table.c)0
-rw-r--r--media/libaom/src/aom_dsp/grain_table.h (renamed from third_party/aom/aom_dsp/grain_table.h)0
-rw-r--r--media/libaom/src/aom_dsp/intrapred.c (renamed from third_party/aom/aom_dsp/intrapred.c)0
-rw-r--r--media/libaom/src/aom_dsp/intrapred_common.h (renamed from third_party/aom/aom_dsp/intrapred_common.h)0
-rw-r--r--media/libaom/src/aom_dsp/loopfilter.c (renamed from third_party/aom/aom_dsp/loopfilter.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/add_noise_msa.c (renamed from third_party/aom/aom_dsp/mips/add_noise_msa.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/aom_convolve8_horiz_msa.c (renamed from third_party/aom/aom_dsp/mips/aom_convolve8_horiz_msa.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/aom_convolve8_vert_msa.c (renamed from third_party/aom/aom_dsp/mips/aom_convolve8_vert_msa.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/aom_convolve_copy_msa.c (renamed from third_party/aom/aom_dsp/mips/aom_convolve_copy_msa.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/aom_convolve_msa.h (renamed from third_party/aom/aom_dsp/mips/aom_convolve_msa.h)0
-rw-r--r--media/libaom/src/aom_dsp/mips/common_dspr2.c (renamed from third_party/aom/aom_dsp/mips/common_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/common_dspr2.h (renamed from third_party/aom/aom_dsp/mips/common_dspr2.h)0
-rw-r--r--media/libaom/src/aom_dsp/mips/convolve2_dspr2.c (renamed from third_party/aom/aom_dsp/mips/convolve2_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/convolve2_horiz_dspr2.c (renamed from third_party/aom/aom_dsp/mips/convolve2_horiz_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/convolve2_vert_dspr2.c (renamed from third_party/aom/aom_dsp/mips/convolve2_vert_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/convolve8_dspr2.c (renamed from third_party/aom/aom_dsp/mips/convolve8_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/convolve8_horiz_dspr2.c (renamed from third_party/aom/aom_dsp/mips/convolve8_horiz_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/convolve8_vert_dspr2.c (renamed from third_party/aom/aom_dsp/mips/convolve8_vert_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/convolve_common_dspr2.h (renamed from third_party/aom/aom_dsp/mips/convolve_common_dspr2.h)0
-rw-r--r--media/libaom/src/aom_dsp/mips/intrapred16_dspr2.c (renamed from third_party/aom/aom_dsp/mips/intrapred16_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/intrapred4_dspr2.c (renamed from third_party/aom/aom_dsp/mips/intrapred4_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/intrapred8_dspr2.c (renamed from third_party/aom/aom_dsp/mips/intrapred8_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/intrapred_msa.c (renamed from third_party/aom/aom_dsp/mips/intrapred_msa.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/loopfilter_16_msa.c (renamed from third_party/aom/aom_dsp/mips/loopfilter_16_msa.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/loopfilter_4_msa.c (renamed from third_party/aom/aom_dsp/mips/loopfilter_4_msa.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/loopfilter_8_msa.c (renamed from third_party/aom/aom_dsp/mips/loopfilter_8_msa.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/loopfilter_filters_dspr2.c (renamed from third_party/aom/aom_dsp/mips/loopfilter_filters_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/loopfilter_filters_dspr2.h (renamed from third_party/aom/aom_dsp/mips/loopfilter_filters_dspr2.h)0
-rw-r--r--media/libaom/src/aom_dsp/mips/loopfilter_macros_dspr2.h (renamed from third_party/aom/aom_dsp/mips/loopfilter_macros_dspr2.h)0
-rw-r--r--media/libaom/src/aom_dsp/mips/loopfilter_masks_dspr2.h (renamed from third_party/aom/aom_dsp/mips/loopfilter_masks_dspr2.h)0
-rw-r--r--media/libaom/src/aom_dsp/mips/loopfilter_mb_dspr2.c (renamed from third_party/aom/aom_dsp/mips/loopfilter_mb_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/loopfilter_mb_horiz_dspr2.c (renamed from third_party/aom/aom_dsp/mips/loopfilter_mb_horiz_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/loopfilter_mb_vert_dspr2.c (renamed from third_party/aom/aom_dsp/mips/loopfilter_mb_vert_dspr2.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/loopfilter_msa.h (renamed from third_party/aom/aom_dsp/mips/loopfilter_msa.h)0
-rw-r--r--media/libaom/src/aom_dsp/mips/macros_msa.h (renamed from third_party/aom/aom_dsp/mips/macros_msa.h)0
-rw-r--r--media/libaom/src/aom_dsp/mips/sad_msa.c (renamed from third_party/aom/aom_dsp/mips/sad_msa.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/sub_pixel_variance_msa.c (renamed from third_party/aom/aom_dsp/mips/sub_pixel_variance_msa.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/subtract_msa.c (renamed from third_party/aom/aom_dsp/mips/subtract_msa.c)0
-rw-r--r--media/libaom/src/aom_dsp/mips/variance_msa.c (renamed from third_party/aom/aom_dsp/mips/variance_msa.c)0
-rw-r--r--media/libaom/src/aom_dsp/noise_model.c (renamed from third_party/aom/aom_dsp/noise_model.c)0
-rw-r--r--media/libaom/src/aom_dsp/noise_model.h (renamed from third_party/aom/aom_dsp/noise_model.h)0
-rw-r--r--media/libaom/src/aom_dsp/noise_util.c (renamed from third_party/aom/aom_dsp/noise_util.c)0
-rw-r--r--media/libaom/src/aom_dsp/noise_util.h (renamed from third_party/aom/aom_dsp/noise_util.h)0
-rw-r--r--media/libaom/src/aom_dsp/postproc.h (renamed from third_party/aom/aom_dsp/postproc.h)0
-rw-r--r--media/libaom/src/aom_dsp/prob.h (renamed from third_party/aom/aom_dsp/prob.h)0
-rw-r--r--media/libaom/src/aom_dsp/psnr.c (renamed from third_party/aom/aom_dsp/psnr.c)0
-rw-r--r--media/libaom/src/aom_dsp/psnr.h (renamed from third_party/aom/aom_dsp/psnr.h)0
-rw-r--r--media/libaom/src/aom_dsp/psnrhvs.c (renamed from third_party/aom/aom_dsp/psnrhvs.c)0
-rw-r--r--media/libaom/src/aom_dsp/quantize.c (renamed from third_party/aom/aom_dsp/quantize.c)0
-rw-r--r--media/libaom/src/aom_dsp/quantize.h (renamed from third_party/aom/aom_dsp/quantize.h)0
-rw-r--r--media/libaom/src/aom_dsp/sad.c (renamed from third_party/aom/aom_dsp/sad.c)0
-rw-r--r--media/libaom/src/aom_dsp/sad_av1.c (renamed from third_party/aom/aom_dsp/sad_av1.c)0
-rw-r--r--media/libaom/src/aom_dsp/simd/v128_intrinsics.h (renamed from third_party/aom/aom_dsp/simd/v128_intrinsics.h)0
-rw-r--r--media/libaom/src/aom_dsp/simd/v128_intrinsics_arm.h (renamed from third_party/aom/aom_dsp/simd/v128_intrinsics_arm.h)0
-rw-r--r--media/libaom/src/aom_dsp/simd/v128_intrinsics_c.h (renamed from third_party/aom/aom_dsp/simd/v128_intrinsics_c.h)0
-rw-r--r--media/libaom/src/aom_dsp/simd/v128_intrinsics_x86.h (renamed from third_party/aom/aom_dsp/simd/v128_intrinsics_x86.h)0
-rw-r--r--media/libaom/src/aom_dsp/simd/v256_intrinsics.h (renamed from third_party/aom/aom_dsp/simd/v256_intrinsics.h)0
-rw-r--r--media/libaom/src/aom_dsp/simd/v256_intrinsics_arm.h (renamed from third_party/aom/aom_dsp/simd/v256_intrinsics_arm.h)0
-rw-r--r--media/libaom/src/aom_dsp/simd/v256_intrinsics_c.h (renamed from third_party/aom/aom_dsp/simd/v256_intrinsics_c.h)0
-rw-r--r--media/libaom/src/aom_dsp/simd/v256_intrinsics_v128.h (renamed from third_party/aom/aom_dsp/simd/v256_intrinsics_v128.h)0
-rw-r--r--media/libaom/src/aom_dsp/simd/v256_intrinsics_x86.h (renamed from third_party/aom/aom_dsp/simd/v256_intrinsics_x86.h)0
-rw-r--r--media/libaom/src/aom_dsp/simd/v64_intrinsics.h (renamed from third_party/aom/aom_dsp/simd/v64_intrinsics.h)0
-rw-r--r--media/libaom/src/aom_dsp/simd/v64_intrinsics_arm.h (renamed from third_party/aom/aom_dsp/simd/v64_intrinsics_arm.h)0
-rw-r--r--media/libaom/src/aom_dsp/simd/v64_intrinsics_c.h (renamed from third_party/aom/aom_dsp/simd/v64_intrinsics_c.h)0
-rw-r--r--media/libaom/src/aom_dsp/simd/v64_intrinsics_x86.h (renamed from third_party/aom/aom_dsp/simd/v64_intrinsics_x86.h)0
-rw-r--r--media/libaom/src/aom_dsp/sse.c (renamed from third_party/aom/aom_dsp/sse.c)0
-rw-r--r--media/libaom/src/aom_dsp/ssim.c (renamed from third_party/aom/aom_dsp/ssim.c)0
-rw-r--r--media/libaom/src/aom_dsp/ssim.h (renamed from third_party/aom/aom_dsp/ssim.h)0
-rw-r--r--media/libaom/src/aom_dsp/subtract.c (renamed from third_party/aom/aom_dsp/subtract.c)0
-rw-r--r--media/libaom/src/aom_dsp/sum_squares.c (renamed from third_party/aom/aom_dsp/sum_squares.c)0
-rw-r--r--media/libaom/src/aom_dsp/txfm_common.h (renamed from third_party/aom/aom_dsp/txfm_common.h)0
-rw-r--r--media/libaom/src/aom_dsp/variance.c (renamed from third_party/aom/aom_dsp/variance.c)0
-rw-r--r--media/libaom/src/aom_dsp/variance.h (renamed from third_party/aom/aom_dsp/variance.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/aom_asm_stubs.c (renamed from third_party/aom/aom_dsp/x86/aom_asm_stubs.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/aom_convolve_copy_sse2.asm (renamed from third_party/aom/aom_dsp/x86/aom_convolve_copy_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm (renamed from third_party/aom/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/aom_high_subpixel_bilinear_sse2.asm (renamed from third_party/aom/aom_dsp/x86/aom_high_subpixel_bilinear_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/aom_subpixel_8t_intrin_avx2.c (renamed from third_party/aom/aom_dsp/x86/aom_subpixel_8t_intrin_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c (renamed from third_party/aom/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/aom_subpixel_8t_sse2.asm (renamed from third_party/aom/aom_dsp/x86/aom_subpixel_8t_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/aom_subpixel_8t_ssse3.asm (renamed from third_party/aom/aom_dsp/x86/aom_subpixel_8t_ssse3.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/aom_subpixel_bilinear_sse2.asm (renamed from third_party/aom/aom_dsp/x86/aom_subpixel_bilinear_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/aom_subpixel_bilinear_ssse3.asm (renamed from third_party/aom/aom_dsp/x86/aom_subpixel_bilinear_ssse3.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/blend_a64_hmask_sse4.c (renamed from third_party/aom/aom_dsp/x86/blend_a64_hmask_sse4.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/blend_a64_mask_avx2.c (renamed from third_party/aom/aom_dsp/x86/blend_a64_mask_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/blend_a64_mask_sse4.c (renamed from third_party/aom/aom_dsp/x86/blend_a64_mask_sse4.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/blend_a64_vmask_sse4.c (renamed from third_party/aom/aom_dsp/x86/blend_a64_vmask_sse4.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/blend_mask_sse4.h (renamed from third_party/aom/aom_dsp/x86/blend_mask_sse4.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/blend_sse4.h (renamed from third_party/aom/aom_dsp/x86/blend_sse4.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/common_avx2.h (renamed from third_party/aom/aom_dsp/x86/common_avx2.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/convolve.h (renamed from third_party/aom/aom_dsp/x86/convolve.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/convolve_avx2.h (renamed from third_party/aom/aom_dsp/x86/convolve_avx2.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/convolve_common_intrin.h (renamed from third_party/aom/aom_dsp/x86/convolve_common_intrin.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/convolve_sse2.h (renamed from third_party/aom/aom_dsp/x86/convolve_sse2.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/convolve_sse4_1.h (renamed from third_party/aom/aom_dsp/x86/convolve_sse4_1.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/fft_avx2.c (renamed from third_party/aom/aom_dsp/x86/fft_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/fft_sse2.c (renamed from third_party/aom/aom_dsp/x86/fft_sse2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/fwd_txfm_impl_sse2.h (renamed from third_party/aom/aom_dsp/x86/fwd_txfm_impl_sse2.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/fwd_txfm_sse2.c (renamed from third_party/aom/aom_dsp/x86/fwd_txfm_sse2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/fwd_txfm_sse2.h (renamed from third_party/aom/aom_dsp/x86/fwd_txfm_sse2.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/fwd_txfm_ssse3_x86_64.asm (renamed from third_party/aom/aom_dsp/x86/fwd_txfm_ssse3_x86_64.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_convolve_avx2.c (renamed from third_party/aom/aom_dsp/x86/highbd_convolve_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_convolve_ssse3.c (renamed from third_party/aom/aom_dsp/x86/highbd_convolve_ssse3.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_intrapred_sse2.c (renamed from third_party/aom/aom_dsp/x86/highbd_intrapred_sse2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_intrapred_sse2_asm.asm (renamed from third_party/aom/aom_dsp/x86/highbd_intrapred_sse2_asm.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_loopfilter_avx2.c (renamed from third_party/aom/aom_dsp/x86/highbd_loopfilter_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_loopfilter_sse2.c (renamed from third_party/aom/aom_dsp/x86/highbd_loopfilter_sse2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_quantize_intrin_avx2.c (renamed from third_party/aom/aom_dsp/x86/highbd_quantize_intrin_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_quantize_intrin_sse2.c (renamed from third_party/aom/aom_dsp/x86/highbd_quantize_intrin_sse2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_sad4d_sse2.asm (renamed from third_party/aom/aom_dsp/x86/highbd_sad4d_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_sad_sse2.asm (renamed from third_party/aom/aom_dsp/x86/highbd_sad_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_subpel_variance_impl_sse2.asm (renamed from third_party/aom/aom_dsp/x86/highbd_subpel_variance_impl_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_subtract_sse2.c (renamed from third_party/aom/aom_dsp/x86/highbd_subtract_sse2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_variance_avx2.c (renamed from third_party/aom/aom_dsp/x86/highbd_variance_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_variance_impl_sse2.asm (renamed from third_party/aom/aom_dsp/x86/highbd_variance_impl_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_variance_sse2.c (renamed from third_party/aom/aom_dsp/x86/highbd_variance_sse2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/highbd_variance_sse4.c (renamed from third_party/aom/aom_dsp/x86/highbd_variance_sse4.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/intrapred_avx2.c (renamed from third_party/aom/aom_dsp/x86/intrapred_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/intrapred_sse2.c (renamed from third_party/aom/aom_dsp/x86/intrapred_sse2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/intrapred_sse2_asm.asm (renamed from third_party/aom/aom_dsp/x86/intrapred_sse2_asm.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/intrapred_ssse3.c (renamed from third_party/aom/aom_dsp/x86/intrapred_ssse3.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/inv_wht_sse2.asm (renamed from third_party/aom/aom_dsp/x86/inv_wht_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/jnt_sad_ssse3.c (renamed from third_party/aom/aom_dsp/x86/jnt_sad_ssse3.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/jnt_variance_ssse3.c (renamed from third_party/aom/aom_dsp/x86/jnt_variance_ssse3.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/loopfilter_sse2.c (renamed from third_party/aom/aom_dsp/x86/loopfilter_sse2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/lpf_common_sse2.h (renamed from third_party/aom/aom_dsp/x86/lpf_common_sse2.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/masked_sad_intrin_avx2.c (renamed from third_party/aom/aom_dsp/x86/masked_sad_intrin_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/masked_sad_intrin_ssse3.c (renamed from third_party/aom/aom_dsp/x86/masked_sad_intrin_ssse3.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/masked_sad_intrin_ssse3.h (renamed from third_party/aom/aom_dsp/x86/masked_sad_intrin_ssse3.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/masked_variance_intrin_ssse3.c (renamed from third_party/aom/aom_dsp/x86/masked_variance_intrin_ssse3.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/masked_variance_intrin_ssse3.h (renamed from third_party/aom/aom_dsp/x86/masked_variance_intrin_ssse3.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/mem_sse2.h (renamed from third_party/aom/aom_dsp/x86/mem_sse2.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/obmc_intrinsic_sse4.h (renamed from third_party/aom/aom_dsp/x86/obmc_intrinsic_sse4.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/obmc_intrinsic_ssse3.h (renamed from third_party/aom/aom_dsp/x86/obmc_intrinsic_ssse3.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/obmc_sad_avx2.c (renamed from third_party/aom/aom_dsp/x86/obmc_sad_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/obmc_sad_sse4.c (renamed from third_party/aom/aom_dsp/x86/obmc_sad_sse4.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/obmc_variance_avx2.c (renamed from third_party/aom/aom_dsp/x86/obmc_variance_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/obmc_variance_sse4.c (renamed from third_party/aom/aom_dsp/x86/obmc_variance_sse4.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/quantize_avx_x86_64.asm (renamed from third_party/aom/aom_dsp/x86/quantize_avx_x86_64.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/quantize_sse2.c (renamed from third_party/aom/aom_dsp/x86/quantize_sse2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/quantize_ssse3_x86_64.asm (renamed from third_party/aom/aom_dsp/x86/quantize_ssse3_x86_64.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/quantize_x86.h (renamed from third_party/aom/aom_dsp/x86/quantize_x86.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/sad4d_avx2.c (renamed from third_party/aom/aom_dsp/x86/sad4d_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/sad4d_sse2.asm (renamed from third_party/aom/aom_dsp/x86/sad4d_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/sad_avx2.c (renamed from third_party/aom/aom_dsp/x86/sad_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/sad_highbd_avx2.c (renamed from third_party/aom/aom_dsp/x86/sad_highbd_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/sad_impl_avx2.c (renamed from third_party/aom/aom_dsp/x86/sad_impl_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/sad_sse2.asm (renamed from third_party/aom/aom_dsp/x86/sad_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/sse_avx2.c (renamed from third_party/aom/aom_dsp/x86/sse_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/sse_sse4.c (renamed from third_party/aom/aom_dsp/x86/sse_sse4.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/ssim_opt_x86_64.asm (renamed from third_party/aom/aom_dsp/x86/ssim_opt_x86_64.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/subpel_variance_sse2.asm (renamed from third_party/aom/aom_dsp/x86/subpel_variance_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/subtract_avx2.c (renamed from third_party/aom/aom_dsp/x86/subtract_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/subtract_sse2.asm (renamed from third_party/aom/aom_dsp/x86/subtract_sse2.asm)0
-rw-r--r--media/libaom/src/aom_dsp/x86/sum_squares_avx2.c (renamed from third_party/aom/aom_dsp/x86/sum_squares_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/sum_squares_sse2.c (renamed from third_party/aom/aom_dsp/x86/sum_squares_sse2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/sum_squares_sse2.h (renamed from third_party/aom/aom_dsp/x86/sum_squares_sse2.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/synonyms.h (renamed from third_party/aom/aom_dsp/x86/synonyms.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/synonyms_avx2.h (renamed from third_party/aom/aom_dsp/x86/synonyms_avx2.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/transpose_sse2.h (renamed from third_party/aom/aom_dsp/x86/transpose_sse2.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/txfm_common_avx2.h (renamed from third_party/aom/aom_dsp/x86/txfm_common_avx2.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/txfm_common_sse2.h (renamed from third_party/aom/aom_dsp/x86/txfm_common_sse2.h)0
-rw-r--r--media/libaom/src/aom_dsp/x86/variance_avx2.c (renamed from third_party/aom/aom_dsp/x86/variance_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/variance_impl_avx2.c (renamed from third_party/aom/aom_dsp/x86/variance_impl_avx2.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/variance_impl_ssse3.c (renamed from third_party/aom/aom_dsp/x86/variance_impl_ssse3.c)0
-rw-r--r--media/libaom/src/aom_dsp/x86/variance_sse2.c (renamed from third_party/aom/aom_dsp/x86/variance_sse2.c)0
-rw-r--r--media/libaom/src/aom_mem/aom_mem.c (renamed from third_party/aom/aom_mem/aom_mem.c)0
-rw-r--r--media/libaom/src/aom_mem/aom_mem.cmake (renamed from third_party/aom/aom_mem/aom_mem.cmake)0
-rw-r--r--media/libaom/src/aom_mem/aom_mem.h (renamed from third_party/aom/aom_mem/aom_mem.h)0
-rw-r--r--media/libaom/src/aom_mem/include/aom_mem_intrnl.h (renamed from third_party/aom/aom_mem/include/aom_mem_intrnl.h)0
-rw-r--r--media/libaom/src/aom_ports/aom_once.h (renamed from third_party/aom/aom_ports/aom_once.h)0
-rw-r--r--media/libaom/src/aom_ports/aom_ports.cmake (renamed from third_party/aom/aom_ports/aom_ports.cmake)0
-rw-r--r--media/libaom/src/aom_ports/aom_timer.h (renamed from third_party/aom/aom_ports/aom_timer.h)0
-rw-r--r--media/libaom/src/aom_ports/arm.h (renamed from third_party/aom/aom_ports/arm.h)0
-rw-r--r--media/libaom/src/aom_ports/arm_cpudetect.c (renamed from third_party/aom/aom_ports/arm_cpudetect.c)0
-rw-r--r--media/libaom/src/aom_ports/bitops.h (renamed from third_party/aom/aom_ports/bitops.h)0
-rw-r--r--media/libaom/src/aom_ports/emmintrin_compat.h (renamed from third_party/aom/aom_ports/emmintrin_compat.h)0
-rw-r--r--media/libaom/src/aom_ports/emms.asm (renamed from third_party/aom/aom_ports/emms.asm)0
-rw-r--r--media/libaom/src/aom_ports/mem.h (renamed from third_party/aom/aom_ports/mem.h)0
-rw-r--r--media/libaom/src/aom_ports/mem_ops.h (renamed from third_party/aom/aom_ports/mem_ops.h)0
-rw-r--r--media/libaom/src/aom_ports/mem_ops_aligned.h (renamed from third_party/aom/aom_ports/mem_ops_aligned.h)0
-rw-r--r--media/libaom/src/aom_ports/msvc.h (renamed from third_party/aom/aom_ports/msvc.h)0
-rw-r--r--media/libaom/src/aom_ports/ppc.h (renamed from third_party/aom/aom_ports/ppc.h)0
-rw-r--r--media/libaom/src/aom_ports/ppc_cpudetect.c (renamed from third_party/aom/aom_ports/ppc_cpudetect.c)0
-rw-r--r--media/libaom/src/aom_ports/sanitizer.h (renamed from third_party/aom/aom_ports/sanitizer.h)0
-rw-r--r--media/libaom/src/aom_ports/system_state.h (renamed from third_party/aom/aom_ports/system_state.h)0
-rw-r--r--media/libaom/src/aom_ports/x86.h (renamed from third_party/aom/aom_ports/x86.h)0
-rw-r--r--media/libaom/src/aom_ports/x86_abi_support.asm (renamed from third_party/aom/aom_ports/x86_abi_support.asm)0
-rw-r--r--media/libaom/src/aom_scale/aom_scale.cmake (renamed from third_party/aom/aom_scale/aom_scale.cmake)0
-rw-r--r--media/libaom/src/aom_scale/aom_scale.h (renamed from third_party/aom/aom_scale/aom_scale.h)0
-rw-r--r--media/libaom/src/aom_scale/aom_scale_rtcd.c (renamed from third_party/aom/aom_scale/aom_scale_rtcd.c)0
-rw-r--r--media/libaom/src/aom_scale/aom_scale_rtcd.pl (renamed from third_party/aom/aom_scale/aom_scale_rtcd.pl)0
-rw-r--r--media/libaom/src/aom_scale/generic/aom_scale.c (renamed from third_party/aom/aom_scale/generic/aom_scale.c)0
-rw-r--r--media/libaom/src/aom_scale/generic/gen_scalers.c (renamed from third_party/aom/aom_scale/generic/gen_scalers.c)0
-rw-r--r--media/libaom/src/aom_scale/generic/yv12config.c (renamed from third_party/aom/aom_scale/generic/yv12config.c)0
-rw-r--r--media/libaom/src/aom_scale/generic/yv12extend.c (renamed from third_party/aom/aom_scale/generic/yv12extend.c)0
-rw-r--r--media/libaom/src/aom_scale/mips/dspr2/yv12extend_dspr2.c (renamed from third_party/aom/aom_scale/mips/dspr2/yv12extend_dspr2.c)0
-rw-r--r--media/libaom/src/aom_scale/yv12config.h (renamed from third_party/aom/aom_scale/yv12config.h)0
-rw-r--r--media/libaom/src/aom_util/aom_thread.c (renamed from third_party/aom/aom_util/aom_thread.c)0
-rw-r--r--media/libaom/src/aom_util/aom_thread.h (renamed from third_party/aom/aom_util/aom_thread.h)0
-rw-r--r--media/libaom/src/aom_util/aom_util.cmake (renamed from third_party/aom/aom_util/aom_util.cmake)0
-rw-r--r--media/libaom/src/aom_util/debug_util.c (renamed from third_party/aom/aom_util/debug_util.c)0
-rw-r--r--media/libaom/src/aom_util/debug_util.h (renamed from third_party/aom/aom_util/debug_util.h)0
-rw-r--r--media/libaom/src/aom_util/endian_inl.h (renamed from third_party/aom/aom_util/endian_inl.h)0
-rw-r--r--media/libaom/src/apps/aomdec.c (renamed from third_party/aom/apps/aomdec.c)0
-rw-r--r--media/libaom/src/apps/aomenc.c (renamed from third_party/aom/apps/aomenc.c)0
-rw-r--r--media/libaom/src/apps/aomenc.h (renamed from third_party/aom/apps/aomenc.h)0
-rw-r--r--media/libaom/src/av1/av1.cmake (renamed from third_party/aom/av1/av1.cmake)0
-rw-r--r--media/libaom/src/av1/av1_cx_iface.c (renamed from third_party/aom/av1/av1_cx_iface.c)0
-rw-r--r--media/libaom/src/av1/av1_dx_iface.c (renamed from third_party/aom/av1/av1_dx_iface.c)0
-rw-r--r--media/libaom/src/av1/av1_iface_common.h (renamed from third_party/aom/av1/av1_iface_common.h)0
-rw-r--r--media/libaom/src/av1/common/alloccommon.c (renamed from third_party/aom/av1/common/alloccommon.c)0
-rw-r--r--media/libaom/src/av1/common/alloccommon.h (renamed from third_party/aom/av1/common/alloccommon.h)0
-rw-r--r--media/libaom/src/av1/common/arm/av1_inv_txfm_neon.c (renamed from third_party/aom/av1/common/arm/av1_inv_txfm_neon.c)0
-rw-r--r--media/libaom/src/av1/common/arm/av1_inv_txfm_neon.h (renamed from third_party/aom/av1/common/arm/av1_inv_txfm_neon.h)0
-rw-r--r--media/libaom/src/av1/common/arm/av1_txfm_neon.c (renamed from third_party/aom/av1/common/arm/av1_txfm_neon.c)0
-rw-r--r--media/libaom/src/av1/common/arm/blend_a64_hmask_neon.c (renamed from third_party/aom/av1/common/arm/blend_a64_hmask_neon.c)0
-rw-r--r--media/libaom/src/av1/common/arm/blend_a64_vmask_neon.c (renamed from third_party/aom/av1/common/arm/blend_a64_vmask_neon.c)0
-rw-r--r--media/libaom/src/av1/common/arm/cfl_neon.c (renamed from third_party/aom/av1/common/arm/cfl_neon.c)0
-rw-r--r--media/libaom/src/av1/common/arm/convolve_neon.c (renamed from third_party/aom/av1/common/arm/convolve_neon.c)0
-rw-r--r--media/libaom/src/av1/common/arm/convolve_neon.h (renamed from third_party/aom/av1/common/arm/convolve_neon.h)0
-rw-r--r--media/libaom/src/av1/common/arm/jnt_convolve_neon.c (renamed from third_party/aom/av1/common/arm/jnt_convolve_neon.c)0
-rw-r--r--media/libaom/src/av1/common/arm/mem_neon.h (renamed from third_party/aom/av1/common/arm/mem_neon.h)0
-rw-r--r--media/libaom/src/av1/common/arm/reconinter_neon.c (renamed from third_party/aom/av1/common/arm/reconinter_neon.c)0
-rw-r--r--media/libaom/src/av1/common/arm/selfguided_neon.c (renamed from third_party/aom/av1/common/arm/selfguided_neon.c)0
-rw-r--r--media/libaom/src/av1/common/arm/transpose_neon.h (renamed from third_party/aom/av1/common/arm/transpose_neon.h)0
-rw-r--r--media/libaom/src/av1/common/arm/warp_plane_neon.c (renamed from third_party/aom/av1/common/arm/warp_plane_neon.c)0
-rw-r--r--media/libaom/src/av1/common/arm/wiener_convolve_neon.c (renamed from third_party/aom/av1/common/arm/wiener_convolve_neon.c)0
-rw-r--r--media/libaom/src/av1/common/av1_inv_txfm1d.c (renamed from third_party/aom/av1/common/av1_inv_txfm1d.c)0
-rw-r--r--media/libaom/src/av1/common/av1_inv_txfm1d.h (renamed from third_party/aom/av1/common/av1_inv_txfm1d.h)0
-rw-r--r--media/libaom/src/av1/common/av1_inv_txfm1d_cfg.h (renamed from third_party/aom/av1/common/av1_inv_txfm1d_cfg.h)0
-rw-r--r--media/libaom/src/av1/common/av1_inv_txfm2d.c (renamed from third_party/aom/av1/common/av1_inv_txfm2d.c)0
-rw-r--r--media/libaom/src/av1/common/av1_loopfilter.c (renamed from third_party/aom/av1/common/av1_loopfilter.c)0
-rw-r--r--media/libaom/src/av1/common/av1_loopfilter.h (renamed from third_party/aom/av1/common/av1_loopfilter.h)0
-rw-r--r--media/libaom/src/av1/common/av1_rtcd.c (renamed from third_party/aom/av1/common/av1_rtcd.c)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/av1/common/av1_rtcd_defs.pl (renamed from third_party/aom/av1/common/av1_rtcd_defs.pl)0
-rw-r--r--media/libaom/src/av1/common/av1_txfm.c (renamed from third_party/aom/av1/common/av1_txfm.c)0
-rw-r--r--media/libaom/src/av1/common/av1_txfm.h (renamed from third_party/aom/av1/common/av1_txfm.h)0
-rw-r--r--media/libaom/src/av1/common/blockd.c (renamed from third_party/aom/av1/common/blockd.c)0
-rw-r--r--media/libaom/src/av1/common/blockd.h (renamed from third_party/aom/av1/common/blockd.h)0
-rw-r--r--media/libaom/src/av1/common/cdef.c (renamed from third_party/aom/av1/common/cdef.c)0
-rw-r--r--media/libaom/src/av1/common/cdef.h (renamed from third_party/aom/av1/common/cdef.h)0
-rw-r--r--media/libaom/src/av1/common/cdef_block.c (renamed from third_party/aom/av1/common/cdef_block.c)0
-rw-r--r--media/libaom/src/av1/common/cdef_block.h (renamed from third_party/aom/av1/common/cdef_block.h)0
-rw-r--r--media/libaom/src/av1/common/cdef_block_avx2.c (renamed from third_party/aom/av1/common/cdef_block_avx2.c)0
-rw-r--r--media/libaom/src/av1/common/cdef_block_neon.c (renamed from third_party/aom/av1/common/cdef_block_neon.c)0
-rw-r--r--media/libaom/src/av1/common/cdef_block_simd.h (renamed from third_party/aom/av1/common/cdef_block_simd.h)0
-rw-r--r--media/libaom/src/av1/common/cdef_block_sse2.c (renamed from third_party/aom/av1/common/cdef_block_sse2.c)0
-rw-r--r--media/libaom/src/av1/common/cdef_block_sse4.c (renamed from third_party/aom/av1/common/cdef_block_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/cdef_block_ssse3.c (renamed from third_party/aom/av1/common/cdef_block_ssse3.c)0
-rw-r--r--media/libaom/src/av1/common/cfl.c (renamed from third_party/aom/av1/common/cfl.c)0
-rw-r--r--media/libaom/src/av1/common/cfl.h (renamed from third_party/aom/av1/common/cfl.h)0
-rw-r--r--media/libaom/src/av1/common/common.h (renamed from third_party/aom/av1/common/common.h)0
-rw-r--r--media/libaom/src/av1/common/common_data.h (renamed from third_party/aom/av1/common/common_data.h)0
-rw-r--r--media/libaom/src/av1/common/convolve.c (renamed from third_party/aom/av1/common/convolve.c)0
-rw-r--r--media/libaom/src/av1/common/convolve.h (renamed from third_party/aom/av1/common/convolve.h)0
-rw-r--r--media/libaom/src/av1/common/debugmodes.c (renamed from third_party/aom/av1/common/debugmodes.c)0
-rw-r--r--media/libaom/src/av1/common/entropy.c (renamed from third_party/aom/av1/common/entropy.c)0
-rw-r--r--media/libaom/src/av1/common/entropy.h (renamed from third_party/aom/av1/common/entropy.h)0
-rw-r--r--media/libaom/src/av1/common/entropymode.c (renamed from third_party/aom/av1/common/entropymode.c)0
-rw-r--r--media/libaom/src/av1/common/entropymode.h (renamed from third_party/aom/av1/common/entropymode.h)0
-rw-r--r--media/libaom/src/av1/common/entropymv.c (renamed from third_party/aom/av1/common/entropymv.c)0
-rw-r--r--media/libaom/src/av1/common/entropymv.h (renamed from third_party/aom/av1/common/entropymv.h)0
-rw-r--r--media/libaom/src/av1/common/enums.h (renamed from third_party/aom/av1/common/enums.h)0
-rw-r--r--media/libaom/src/av1/common/filter.h (renamed from third_party/aom/av1/common/filter.h)0
-rw-r--r--media/libaom/src/av1/common/frame_buffers.c (renamed from third_party/aom/av1/common/frame_buffers.c)0
-rw-r--r--media/libaom/src/av1/common/frame_buffers.h (renamed from third_party/aom/av1/common/frame_buffers.h)0
-rw-r--r--media/libaom/src/av1/common/idct.c (renamed from third_party/aom/av1/common/idct.c)0
-rw-r--r--media/libaom/src/av1/common/idct.h (renamed from third_party/aom/av1/common/idct.h)0
-rw-r--r--media/libaom/src/av1/common/mv.h (renamed from third_party/aom/av1/common/mv.h)0
-rw-r--r--media/libaom/src/av1/common/mvref_common.c (renamed from third_party/aom/av1/common/mvref_common.c)0
-rw-r--r--media/libaom/src/av1/common/mvref_common.h (renamed from third_party/aom/av1/common/mvref_common.h)0
-rw-r--r--media/libaom/src/av1/common/obmc.h (renamed from third_party/aom/av1/common/obmc.h)0
-rw-r--r--media/libaom/src/av1/common/obu_util.c (renamed from third_party/aom/av1/common/obu_util.c)0
-rw-r--r--media/libaom/src/av1/common/obu_util.h (renamed from third_party/aom/av1/common/obu_util.h)0
-rw-r--r--media/libaom/src/av1/common/odintrin.c (renamed from third_party/aom/av1/common/odintrin.c)0
-rw-r--r--media/libaom/src/av1/common/odintrin.h (renamed from third_party/aom/av1/common/odintrin.h)0
-rw-r--r--media/libaom/src/av1/common/onyxc_int.h (renamed from third_party/aom/av1/common/onyxc_int.h)0
-rw-r--r--media/libaom/src/av1/common/ppc/cfl_ppc.c (renamed from third_party/aom/av1/common/ppc/cfl_ppc.c)0
-rw-r--r--media/libaom/src/av1/common/pred_common.c (renamed from third_party/aom/av1/common/pred_common.c)0
-rw-r--r--media/libaom/src/av1/common/pred_common.h (renamed from third_party/aom/av1/common/pred_common.h)0
-rw-r--r--media/libaom/src/av1/common/quant_common.c (renamed from third_party/aom/av1/common/quant_common.c)0
-rw-r--r--media/libaom/src/av1/common/quant_common.h (renamed from third_party/aom/av1/common/quant_common.h)0
-rw-r--r--media/libaom/src/av1/common/reconinter.c (renamed from third_party/aom/av1/common/reconinter.c)0
-rw-r--r--media/libaom/src/av1/common/reconinter.h (renamed from third_party/aom/av1/common/reconinter.h)0
-rw-r--r--media/libaom/src/av1/common/reconintra.c (renamed from third_party/aom/av1/common/reconintra.c)0
-rw-r--r--media/libaom/src/av1/common/reconintra.h (renamed from third_party/aom/av1/common/reconintra.h)0
-rw-r--r--media/libaom/src/av1/common/resize.c (renamed from third_party/aom/av1/common/resize.c)0
-rw-r--r--media/libaom/src/av1/common/resize.h (renamed from third_party/aom/av1/common/resize.h)0
-rw-r--r--media/libaom/src/av1/common/restoration.c (renamed from third_party/aom/av1/common/restoration.c)0
-rw-r--r--media/libaom/src/av1/common/restoration.h (renamed from third_party/aom/av1/common/restoration.h)0
-rw-r--r--media/libaom/src/av1/common/scale.c (renamed from third_party/aom/av1/common/scale.c)0
-rw-r--r--media/libaom/src/av1/common/scale.h (renamed from third_party/aom/av1/common/scale.h)0
-rw-r--r--media/libaom/src/av1/common/scan.c (renamed from third_party/aom/av1/common/scan.c)0
-rw-r--r--media/libaom/src/av1/common/scan.h (renamed from third_party/aom/av1/common/scan.h)0
-rw-r--r--media/libaom/src/av1/common/seg_common.c (renamed from third_party/aom/av1/common/seg_common.c)0
-rw-r--r--media/libaom/src/av1/common/seg_common.h (renamed from third_party/aom/av1/common/seg_common.h)0
-rw-r--r--media/libaom/src/av1/common/thread_common.c (renamed from third_party/aom/av1/common/thread_common.c)0
-rw-r--r--media/libaom/src/av1/common/thread_common.h (renamed from third_party/aom/av1/common/thread_common.h)0
-rw-r--r--media/libaom/src/av1/common/tile_common.c (renamed from third_party/aom/av1/common/tile_common.c)0
-rw-r--r--media/libaom/src/av1/common/tile_common.h (renamed from third_party/aom/av1/common/tile_common.h)0
-rw-r--r--media/libaom/src/av1/common/timing.c (renamed from third_party/aom/av1/common/timing.c)0
-rw-r--r--media/libaom/src/av1/common/timing.h (renamed from third_party/aom/av1/common/timing.h)0
-rw-r--r--media/libaom/src/av1/common/token_cdfs.h (renamed from third_party/aom/av1/common/token_cdfs.h)0
-rw-r--r--media/libaom/src/av1/common/txb_common.c (renamed from third_party/aom/av1/common/txb_common.c)0
-rw-r--r--media/libaom/src/av1/common/txb_common.h (renamed from third_party/aom/av1/common/txb_common.h)0
-rw-r--r--media/libaom/src/av1/common/warped_motion.c (renamed from third_party/aom/av1/common/warped_motion.c)0
-rw-r--r--media/libaom/src/av1/common/warped_motion.h (renamed from third_party/aom/av1/common/warped_motion.h)0
-rw-r--r--media/libaom/src/av1/common/x86/av1_convolve_horiz_rs_sse4.c (renamed from third_party/aom/av1/common/x86/av1_convolve_horiz_rs_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/x86/av1_convolve_scale_sse4.c (renamed from third_party/aom/av1/common/x86/av1_convolve_scale_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/x86/av1_highbd_convolve_sse4.c (renamed from third_party/aom/av1/common/x86/av1_highbd_convolve_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/x86/av1_inv_txfm_avx2.c (renamed from third_party/aom/av1/common/x86/av1_inv_txfm_avx2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/av1_inv_txfm_avx2.h (renamed from third_party/aom/av1/common/x86/av1_inv_txfm_avx2.h)0
-rw-r--r--media/libaom/src/av1/common/x86/av1_inv_txfm_ssse3.c (renamed from third_party/aom/av1/common/x86/av1_inv_txfm_ssse3.c)0
-rw-r--r--media/libaom/src/av1/common/x86/av1_inv_txfm_ssse3.h (renamed from third_party/aom/av1/common/x86/av1_inv_txfm_ssse3.h)0
-rw-r--r--media/libaom/src/av1/common/x86/av1_txfm_sse2.h (renamed from third_party/aom/av1/common/x86/av1_txfm_sse2.h)0
-rw-r--r--media/libaom/src/av1/common/x86/av1_txfm_sse4.c (renamed from third_party/aom/av1/common/x86/av1_txfm_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/x86/av1_txfm_sse4.h (renamed from third_party/aom/av1/common/x86/av1_txfm_sse4.h)0
-rw-r--r--media/libaom/src/av1/common/x86/cfl_avx2.c (renamed from third_party/aom/av1/common/x86/cfl_avx2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/cfl_simd.h (renamed from third_party/aom/av1/common/x86/cfl_simd.h)0
-rw-r--r--media/libaom/src/av1/common/x86/cfl_sse2.c (renamed from third_party/aom/av1/common/x86/cfl_sse2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/cfl_ssse3.c (renamed from third_party/aom/av1/common/x86/cfl_ssse3.c)0
-rw-r--r--media/libaom/src/av1/common/x86/convolve_2d_avx2.c (renamed from third_party/aom/av1/common/x86/convolve_2d_avx2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/convolve_2d_sse2.c (renamed from third_party/aom/av1/common/x86/convolve_2d_sse2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/convolve_avx2.c (renamed from third_party/aom/av1/common/x86/convolve_avx2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/convolve_sse2.c (renamed from third_party/aom/av1/common/x86/convolve_sse2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/filterintra_sse4.c (renamed from third_party/aom/av1/common/x86/filterintra_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/x86/highbd_convolve_2d_avx2.c (renamed from third_party/aom/av1/common/x86/highbd_convolve_2d_avx2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/highbd_convolve_2d_sse2.c (renamed from third_party/aom/av1/common/x86/highbd_convolve_2d_sse2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/highbd_convolve_2d_sse4.c (renamed from third_party/aom/av1/common/x86/highbd_convolve_2d_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/x86/highbd_convolve_2d_ssse3.c (renamed from third_party/aom/av1/common/x86/highbd_convolve_2d_ssse3.c)0
-rw-r--r--media/libaom/src/av1/common/x86/highbd_inv_txfm_avx2.c (renamed from third_party/aom/av1/common/x86/highbd_inv_txfm_avx2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/highbd_inv_txfm_sse4.c (renamed from third_party/aom/av1/common/x86/highbd_inv_txfm_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/x86/highbd_jnt_convolve_avx2.c (renamed from third_party/aom/av1/common/x86/highbd_jnt_convolve_avx2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/highbd_jnt_convolve_sse4.c (renamed from third_party/aom/av1/common/x86/highbd_jnt_convolve_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/x86/highbd_txfm_utility_sse4.h (renamed from third_party/aom/av1/common/x86/highbd_txfm_utility_sse4.h)0
-rw-r--r--media/libaom/src/av1/common/x86/highbd_warp_plane_sse4.c (renamed from third_party/aom/av1/common/x86/highbd_warp_plane_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/x86/highbd_wiener_convolve_avx2.c (renamed from third_party/aom/av1/common/x86/highbd_wiener_convolve_avx2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/highbd_wiener_convolve_ssse3.c (renamed from third_party/aom/av1/common/x86/highbd_wiener_convolve_ssse3.c)0
-rw-r--r--media/libaom/src/av1/common/x86/intra_edge_sse4.c (renamed from third_party/aom/av1/common/x86/intra_edge_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/x86/jnt_convolve_avx2.c (renamed from third_party/aom/av1/common/x86/jnt_convolve_avx2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/jnt_convolve_sse2.c (renamed from third_party/aom/av1/common/x86/jnt_convolve_sse2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/jnt_convolve_ssse3.c (renamed from third_party/aom/av1/common/x86/jnt_convolve_ssse3.c)0
-rw-r--r--media/libaom/src/av1/common/x86/reconinter_avx2.c (renamed from third_party/aom/av1/common/x86/reconinter_avx2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/reconinter_sse4.c (renamed from third_party/aom/av1/common/x86/reconinter_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/x86/reconinter_ssse3.c (renamed from third_party/aom/av1/common/x86/reconinter_ssse3.c)0
-rw-r--r--media/libaom/src/av1/common/x86/selfguided_avx2.c (renamed from third_party/aom/av1/common/x86/selfguided_avx2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/selfguided_sse4.c (renamed from third_party/aom/av1/common/x86/selfguided_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/x86/warp_plane_sse4.c (renamed from third_party/aom/av1/common/x86/warp_plane_sse4.c)0
-rw-r--r--media/libaom/src/av1/common/x86/wiener_convolve_avx2.c (renamed from third_party/aom/av1/common/x86/wiener_convolve_avx2.c)0
-rw-r--r--media/libaom/src/av1/common/x86/wiener_convolve_sse2.c (renamed from third_party/aom/av1/common/x86/wiener_convolve_sse2.c)0
-rw-r--r--media/libaom/src/av1/decoder/accounting.c (renamed from third_party/aom/av1/decoder/accounting.c)0
-rw-r--r--media/libaom/src/av1/decoder/accounting.h (renamed from third_party/aom/av1/decoder/accounting.h)0
-rw-r--r--media/libaom/src/av1/decoder/decodeframe.c (renamed from third_party/aom/av1/decoder/decodeframe.c)0
-rw-r--r--media/libaom/src/av1/decoder/decodeframe.h (renamed from third_party/aom/av1/decoder/decodeframe.h)0
-rw-r--r--media/libaom/src/av1/decoder/decodemv.c (renamed from third_party/aom/av1/decoder/decodemv.c)0
-rw-r--r--media/libaom/src/av1/decoder/decodemv.h (renamed from third_party/aom/av1/decoder/decodemv.h)0
-rw-r--r--media/libaom/src/av1/decoder/decoder.c (renamed from third_party/aom/av1/decoder/decoder.c)0
-rw-r--r--media/libaom/src/av1/decoder/decoder.h (renamed from third_party/aom/av1/decoder/decoder.h)0
-rw-r--r--media/libaom/src/av1/decoder/decodetxb.c (renamed from third_party/aom/av1/decoder/decodetxb.c)0
-rw-r--r--media/libaom/src/av1/decoder/decodetxb.h (renamed from third_party/aom/av1/decoder/decodetxb.h)0
-rw-r--r--media/libaom/src/av1/decoder/detokenize.c (renamed from third_party/aom/av1/decoder/detokenize.c)0
-rw-r--r--media/libaom/src/av1/decoder/detokenize.h (renamed from third_party/aom/av1/decoder/detokenize.h)0
-rw-r--r--media/libaom/src/av1/decoder/dthread.c (renamed from third_party/aom/av1/decoder/dthread.c)0
-rw-r--r--media/libaom/src/av1/decoder/dthread.h (renamed from third_party/aom/av1/decoder/dthread.h)0
-rw-r--r--media/libaom/src/av1/decoder/inspection.c (renamed from third_party/aom/av1/decoder/inspection.c)0
-rw-r--r--media/libaom/src/av1/decoder/inspection.h (renamed from third_party/aom/av1/decoder/inspection.h)0
-rw-r--r--media/libaom/src/av1/decoder/obu.c (renamed from third_party/aom/av1/decoder/obu.c)0
-rw-r--r--media/libaom/src/av1/decoder/obu.h (renamed from third_party/aom/av1/decoder/obu.h)0
-rw-r--r--media/libaom/src/av1/encoder/aq_complexity.c (renamed from third_party/aom/av1/encoder/aq_complexity.c)0
-rw-r--r--media/libaom/src/av1/encoder/aq_complexity.h (renamed from third_party/aom/av1/encoder/aq_complexity.h)0
-rw-r--r--media/libaom/src/av1/encoder/aq_cyclicrefresh.c (renamed from third_party/aom/av1/encoder/aq_cyclicrefresh.c)0
-rw-r--r--media/libaom/src/av1/encoder/aq_cyclicrefresh.h (renamed from third_party/aom/av1/encoder/aq_cyclicrefresh.h)0
-rw-r--r--media/libaom/src/av1/encoder/aq_variance.c (renamed from third_party/aom/av1/encoder/aq_variance.c)0
-rw-r--r--media/libaom/src/av1/encoder/aq_variance.h (renamed from third_party/aom/av1/encoder/aq_variance.h)0
-rw-r--r--media/libaom/src/av1/encoder/arm/neon/quantize_neon.c (renamed from third_party/aom/av1/encoder/arm/neon/quantize_neon.c)0
-rw-r--r--media/libaom/src/av1/encoder/av1_fwd_txfm1d.c (renamed from third_party/aom/av1/encoder/av1_fwd_txfm1d.c)0
-rw-r--r--media/libaom/src/av1/encoder/av1_fwd_txfm1d.h (renamed from third_party/aom/av1/encoder/av1_fwd_txfm1d.h)0
-rw-r--r--media/libaom/src/av1/encoder/av1_fwd_txfm1d_cfg.h (renamed from third_party/aom/av1/encoder/av1_fwd_txfm1d_cfg.h)0
-rw-r--r--media/libaom/src/av1/encoder/av1_fwd_txfm2d.c (renamed from third_party/aom/av1/encoder/av1_fwd_txfm2d.c)0
-rw-r--r--media/libaom/src/av1/encoder/av1_quantize.c (renamed from third_party/aom/av1/encoder/av1_quantize.c)0
-rw-r--r--media/libaom/src/av1/encoder/av1_quantize.h (renamed from third_party/aom/av1/encoder/av1_quantize.h)0
-rw-r--r--media/libaom/src/av1/encoder/bitstream.c (renamed from third_party/aom/av1/encoder/bitstream.c)0
-rw-r--r--media/libaom/src/av1/encoder/bitstream.h (renamed from third_party/aom/av1/encoder/bitstream.h)0
-rw-r--r--media/libaom/src/av1/encoder/block.h (renamed from third_party/aom/av1/encoder/block.h)0
-rw-r--r--media/libaom/src/av1/encoder/blockiness.c (renamed from third_party/aom/av1/encoder/blockiness.c)0
-rw-r--r--media/libaom/src/av1/encoder/context_tree.c (renamed from third_party/aom/av1/encoder/context_tree.c)0
-rw-r--r--media/libaom/src/av1/encoder/context_tree.h (renamed from third_party/aom/av1/encoder/context_tree.h)0
-rw-r--r--media/libaom/src/av1/encoder/corner_detect.c (renamed from third_party/aom/av1/encoder/corner_detect.c)0
-rw-r--r--media/libaom/src/av1/encoder/corner_detect.h (renamed from third_party/aom/av1/encoder/corner_detect.h)0
-rw-r--r--media/libaom/src/av1/encoder/corner_match.c (renamed from third_party/aom/av1/encoder/corner_match.c)0
-rw-r--r--media/libaom/src/av1/encoder/corner_match.h (renamed from third_party/aom/av1/encoder/corner_match.h)0
-rw-r--r--media/libaom/src/av1/encoder/cost.c (renamed from third_party/aom/av1/encoder/cost.c)0
-rw-r--r--media/libaom/src/av1/encoder/cost.h (renamed from third_party/aom/av1/encoder/cost.h)0
-rw-r--r--media/libaom/src/av1/encoder/dwt.c (renamed from third_party/aom/av1/encoder/dwt.c)0
-rw-r--r--media/libaom/src/av1/encoder/dwt.h (renamed from third_party/aom/av1/encoder/dwt.h)0
-rw-r--r--media/libaom/src/av1/encoder/encodeframe.c (renamed from third_party/aom/av1/encoder/encodeframe.c)0
-rw-r--r--media/libaom/src/av1/encoder/encodeframe.h (renamed from third_party/aom/av1/encoder/encodeframe.h)0
-rw-r--r--media/libaom/src/av1/encoder/encodemb.c (renamed from third_party/aom/av1/encoder/encodemb.c)0
-rw-r--r--media/libaom/src/av1/encoder/encodemb.h (renamed from third_party/aom/av1/encoder/encodemb.h)0
-rw-r--r--media/libaom/src/av1/encoder/encodemv.c (renamed from third_party/aom/av1/encoder/encodemv.c)0
-rw-r--r--media/libaom/src/av1/encoder/encodemv.h (renamed from third_party/aom/av1/encoder/encodemv.h)0
-rw-r--r--media/libaom/src/av1/encoder/encoder.c (renamed from third_party/aom/av1/encoder/encoder.c)0
-rw-r--r--media/libaom/src/av1/encoder/encoder.h (renamed from third_party/aom/av1/encoder/encoder.h)0
-rw-r--r--media/libaom/src/av1/encoder/encodetxb.c (renamed from third_party/aom/av1/encoder/encodetxb.c)0
-rw-r--r--media/libaom/src/av1/encoder/encodetxb.h (renamed from third_party/aom/av1/encoder/encodetxb.h)0
-rw-r--r--media/libaom/src/av1/encoder/ethread.c (renamed from third_party/aom/av1/encoder/ethread.c)0
-rw-r--r--media/libaom/src/av1/encoder/ethread.h (renamed from third_party/aom/av1/encoder/ethread.h)0
-rw-r--r--media/libaom/src/av1/encoder/extend.c (renamed from third_party/aom/av1/encoder/extend.c)0
-rw-r--r--media/libaom/src/av1/encoder/extend.h (renamed from third_party/aom/av1/encoder/extend.h)0
-rw-r--r--media/libaom/src/av1/encoder/firstpass.c (renamed from third_party/aom/av1/encoder/firstpass.c)0
-rw-r--r--media/libaom/src/av1/encoder/firstpass.h (renamed from third_party/aom/av1/encoder/firstpass.h)0
-rw-r--r--media/libaom/src/av1/encoder/global_motion.c (renamed from third_party/aom/av1/encoder/global_motion.c)0
-rw-r--r--media/libaom/src/av1/encoder/global_motion.h (renamed from third_party/aom/av1/encoder/global_motion.h)0
-rw-r--r--media/libaom/src/av1/encoder/grain_test_vectors.h (renamed from third_party/aom/av1/encoder/grain_test_vectors.h)0
-rw-r--r--media/libaom/src/av1/encoder/hash.c (renamed from third_party/aom/av1/encoder/hash.c)0
-rw-r--r--media/libaom/src/av1/encoder/hash.h (renamed from third_party/aom/av1/encoder/hash.h)0
-rw-r--r--media/libaom/src/av1/encoder/hash_motion.c (renamed from third_party/aom/av1/encoder/hash_motion.c)0
-rw-r--r--media/libaom/src/av1/encoder/hash_motion.h (renamed from third_party/aom/av1/encoder/hash_motion.h)0
-rw-r--r--media/libaom/src/av1/encoder/hybrid_fwd_txfm.c (renamed from third_party/aom/av1/encoder/hybrid_fwd_txfm.c)0
-rw-r--r--media/libaom/src/av1/encoder/hybrid_fwd_txfm.h (renamed from third_party/aom/av1/encoder/hybrid_fwd_txfm.h)0
-rw-r--r--media/libaom/src/av1/encoder/k_means_template.h (renamed from third_party/aom/av1/encoder/k_means_template.h)0
-rw-r--r--media/libaom/src/av1/encoder/lookahead.c (renamed from third_party/aom/av1/encoder/lookahead.c)0
-rw-r--r--media/libaom/src/av1/encoder/lookahead.h (renamed from third_party/aom/av1/encoder/lookahead.h)0
-rw-r--r--media/libaom/src/av1/encoder/mathutils.h (renamed from third_party/aom/av1/encoder/mathutils.h)0
-rw-r--r--media/libaom/src/av1/encoder/mbgraph.c (renamed from third_party/aom/av1/encoder/mbgraph.c)0
-rw-r--r--media/libaom/src/av1/encoder/mbgraph.h (renamed from third_party/aom/av1/encoder/mbgraph.h)0
-rw-r--r--media/libaom/src/av1/encoder/mcomp.c (renamed from third_party/aom/av1/encoder/mcomp.c)0
-rw-r--r--media/libaom/src/av1/encoder/mcomp.h (renamed from third_party/aom/av1/encoder/mcomp.h)0
-rw-r--r--media/libaom/src/av1/encoder/mips/msa/error_msa.c (renamed from third_party/aom/av1/encoder/mips/msa/error_msa.c)0
-rw-r--r--media/libaom/src/av1/encoder/mips/msa/fdct4x4_msa.c (renamed from third_party/aom/av1/encoder/mips/msa/fdct4x4_msa.c)0
-rw-r--r--media/libaom/src/av1/encoder/mips/msa/temporal_filter_msa.c (renamed from third_party/aom/av1/encoder/mips/msa/temporal_filter_msa.c)0
-rw-r--r--media/libaom/src/av1/encoder/ml.c (renamed from third_party/aom/av1/encoder/ml.c)0
-rw-r--r--media/libaom/src/av1/encoder/ml.h (renamed from third_party/aom/av1/encoder/ml.h)0
-rw-r--r--media/libaom/src/av1/encoder/palette.c (renamed from third_party/aom/av1/encoder/palette.c)0
-rw-r--r--media/libaom/src/av1/encoder/palette.h (renamed from third_party/aom/av1/encoder/palette.h)0
-rw-r--r--media/libaom/src/av1/encoder/partition_model_weights.h (renamed from third_party/aom/av1/encoder/partition_model_weights.h)0
-rw-r--r--media/libaom/src/av1/encoder/pickcdef.c (renamed from third_party/aom/av1/encoder/pickcdef.c)0
-rw-r--r--media/libaom/src/av1/encoder/picklpf.c (renamed from third_party/aom/av1/encoder/picklpf.c)0
-rw-r--r--media/libaom/src/av1/encoder/picklpf.h (renamed from third_party/aom/av1/encoder/picklpf.h)0
-rw-r--r--media/libaom/src/av1/encoder/pickrst.c (renamed from third_party/aom/av1/encoder/pickrst.c)0
-rw-r--r--media/libaom/src/av1/encoder/pickrst.h (renamed from third_party/aom/av1/encoder/pickrst.h)0
-rw-r--r--media/libaom/src/av1/encoder/pustats.h (renamed from third_party/aom/av1/encoder/pustats.h)0
-rw-r--r--media/libaom/src/av1/encoder/random.h (renamed from third_party/aom/av1/encoder/random.h)0
-rw-r--r--media/libaom/src/av1/encoder/ransac.c (renamed from third_party/aom/av1/encoder/ransac.c)0
-rw-r--r--media/libaom/src/av1/encoder/ransac.h (renamed from third_party/aom/av1/encoder/ransac.h)0
-rw-r--r--media/libaom/src/av1/encoder/rate_distortion_model_params.h (renamed from third_party/aom/av1/encoder/rate_distortion_model_params.h)0
-rw-r--r--media/libaom/src/av1/encoder/ratectrl.c (renamed from third_party/aom/av1/encoder/ratectrl.c)0
-rw-r--r--media/libaom/src/av1/encoder/ratectrl.h (renamed from third_party/aom/av1/encoder/ratectrl.h)0
-rw-r--r--media/libaom/src/av1/encoder/rd.c (renamed from third_party/aom/av1/encoder/rd.c)0
-rw-r--r--media/libaom/src/av1/encoder/rd.h (renamed from third_party/aom/av1/encoder/rd.h)0
-rw-r--r--media/libaom/src/av1/encoder/rdopt.c (renamed from third_party/aom/av1/encoder/rdopt.c)0
-rw-r--r--media/libaom/src/av1/encoder/rdopt.h (renamed from third_party/aom/av1/encoder/rdopt.h)0
-rw-r--r--media/libaom/src/av1/encoder/reconinter_enc.c (renamed from third_party/aom/av1/encoder/reconinter_enc.c)0
-rw-r--r--media/libaom/src/av1/encoder/reconinter_enc.h (renamed from third_party/aom/av1/encoder/reconinter_enc.h)0
-rw-r--r--media/libaom/src/av1/encoder/segmentation.c (renamed from third_party/aom/av1/encoder/segmentation.c)0
-rw-r--r--media/libaom/src/av1/encoder/segmentation.h (renamed from third_party/aom/av1/encoder/segmentation.h)0
-rw-r--r--media/libaom/src/av1/encoder/speed_features.c (renamed from third_party/aom/av1/encoder/speed_features.c)0
-rw-r--r--media/libaom/src/av1/encoder/speed_features.h (renamed from third_party/aom/av1/encoder/speed_features.h)0
-rw-r--r--media/libaom/src/av1/encoder/temporal_filter.c (renamed from third_party/aom/av1/encoder/temporal_filter.c)0
-rw-r--r--media/libaom/src/av1/encoder/temporal_filter.h (renamed from third_party/aom/av1/encoder/temporal_filter.h)0
-rw-r--r--media/libaom/src/av1/encoder/tokenize.c (renamed from third_party/aom/av1/encoder/tokenize.c)0
-rw-r--r--media/libaom/src/av1/encoder/tokenize.h (renamed from third_party/aom/av1/encoder/tokenize.h)0
-rw-r--r--media/libaom/src/av1/encoder/tx_prune_model_weights.h (renamed from third_party/aom/av1/encoder/tx_prune_model_weights.h)0
-rw-r--r--media/libaom/src/av1/encoder/wedge_utils.c (renamed from third_party/aom/av1/encoder/wedge_utils.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/av1_fwd_txfm1d_sse4.c (renamed from third_party/aom/av1/encoder/x86/av1_fwd_txfm1d_sse4.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/av1_fwd_txfm2d_avx2.c (renamed from third_party/aom/av1/encoder/x86/av1_fwd_txfm2d_avx2.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/av1_fwd_txfm2d_sse4.c (renamed from third_party/aom/av1/encoder/x86/av1_fwd_txfm2d_sse4.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/av1_fwd_txfm_avx2.h (renamed from third_party/aom/av1/encoder/x86/av1_fwd_txfm_avx2.h)0
-rw-r--r--media/libaom/src/av1/encoder/x86/av1_fwd_txfm_sse2.c (renamed from third_party/aom/av1/encoder/x86/av1_fwd_txfm_sse2.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/av1_fwd_txfm_sse2.h (renamed from third_party/aom/av1/encoder/x86/av1_fwd_txfm_sse2.h)0
-rw-r--r--media/libaom/src/av1/encoder/x86/av1_highbd_quantize_avx2.c (renamed from third_party/aom/av1/encoder/x86/av1_highbd_quantize_avx2.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/av1_highbd_quantize_sse4.c (renamed from third_party/aom/av1/encoder/x86/av1_highbd_quantize_sse4.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/av1_quantize_avx2.c (renamed from third_party/aom/av1/encoder/x86/av1_quantize_avx2.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/av1_quantize_sse2.c (renamed from third_party/aom/av1/encoder/x86/av1_quantize_sse2.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/av1_quantize_ssse3_x86_64.asm (renamed from third_party/aom/av1/encoder/x86/av1_quantize_ssse3_x86_64.asm)0
-rw-r--r--media/libaom/src/av1/encoder/x86/av1_ssim_opt_x86_64.asm (renamed from third_party/aom/av1/encoder/x86/av1_ssim_opt_x86_64.asm)0
-rw-r--r--media/libaom/src/av1/encoder/x86/av1_txfm1d_sse4.h (renamed from third_party/aom/av1/encoder/x86/av1_txfm1d_sse4.h)0
-rw-r--r--media/libaom/src/av1/encoder/x86/corner_match_sse4.c (renamed from third_party/aom/av1/encoder/x86/corner_match_sse4.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/dct_sse2.asm (renamed from third_party/aom/av1/encoder/x86/dct_sse2.asm)0
-rw-r--r--media/libaom/src/av1/encoder/x86/encodetxb_avx2.c (renamed from third_party/aom/av1/encoder/x86/encodetxb_avx2.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/encodetxb_sse2.c (renamed from third_party/aom/av1/encoder/x86/encodetxb_sse2.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/encodetxb_sse4.c (renamed from third_party/aom/av1/encoder/x86/encodetxb_sse4.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/error_intrin_avx2.c (renamed from third_party/aom/av1/encoder/x86/error_intrin_avx2.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/error_sse2.asm (renamed from third_party/aom/av1/encoder/x86/error_sse2.asm)0
-rw-r--r--media/libaom/src/av1/encoder/x86/hash_sse42.c (renamed from third_party/aom/av1/encoder/x86/hash_sse42.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/highbd_block_error_intrin_sse2.c (renamed from third_party/aom/av1/encoder/x86/highbd_block_error_intrin_sse2.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/highbd_fwd_txfm_sse4.c (renamed from third_party/aom/av1/encoder/x86/highbd_fwd_txfm_sse4.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/pickrst_avx2.c (renamed from third_party/aom/av1/encoder/x86/pickrst_avx2.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/pickrst_sse4.c (renamed from third_party/aom/av1/encoder/x86/pickrst_sse4.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/temporal_filter_apply_sse2.asm (renamed from third_party/aom/av1/encoder/x86/temporal_filter_apply_sse2.asm)0
-rw-r--r--media/libaom/src/av1/encoder/x86/wedge_utils_avx2.c (renamed from third_party/aom/av1/encoder/x86/wedge_utils_avx2.c)0
-rw-r--r--media/libaom/src/av1/encoder/x86/wedge_utils_sse2.c (renamed from third_party/aom/av1/encoder/x86/wedge_utils_sse2.c)0
-rw-r--r--media/libaom/src/av1/exports_com (renamed from third_party/aom/av1/exports_com)0
-rw-r--r--media/libaom/src/av1/exports_dec (renamed from third_party/aom/av1/exports_dec)0
-rw-r--r--media/libaom/src/av1/exports_enc (renamed from third_party/aom/av1/exports_enc)0
-rw-r--r--media/libaom/src/av1/exports_test (renamed from third_party/aom/av1/exports_test)0
-rw-r--r--media/libaom/src/build/cmake/aom_config.c.template (renamed from third_party/aom/build/cmake/aom_config.c.template)0
-rw-r--r--media/libaom/src/build/cmake/aom_config_defaults.cmake (renamed from third_party/aom/build/cmake/aom_config_defaults.cmake)0
-rw-r--r--media/libaom/src/build/cmake/aom_configure.cmake (renamed from third_party/aom/build/cmake/aom_configure.cmake)0
-rw-r--r--media/libaom/src/build/cmake/aom_experiment_deps.cmake (renamed from third_party/aom/build/cmake/aom_experiment_deps.cmake)0
-rw-r--r--media/libaom/src/build/cmake/aom_optimization.cmake (renamed from third_party/aom/build/cmake/aom_optimization.cmake)0
-rw-r--r--media/libaom/src/build/cmake/compiler_flags.cmake (renamed from third_party/aom/build/cmake/compiler_flags.cmake)0
-rw-r--r--media/libaom/src/build/cmake/compiler_tests.cmake (renamed from third_party/aom/build/cmake/compiler_tests.cmake)0
-rw-r--r--media/libaom/src/build/cmake/cpu.cmake (renamed from third_party/aom/build/cmake/cpu.cmake)0
-rw-r--r--media/libaom/src/build/cmake/dist.cmake (renamed from third_party/aom/build/cmake/dist.cmake)0
-rw-r--r--media/libaom/src/build/cmake/exports.cmake (renamed from third_party/aom/build/cmake/exports.cmake)0
-rw-r--r--media/libaom/src/build/cmake/exports_sources.cmake (renamed from third_party/aom/build/cmake/exports_sources.cmake)0
-rw-r--r--media/libaom/src/build/cmake/generate_aom_config_templates.cmake (renamed from third_party/aom/build/cmake/generate_aom_config_templates.cmake)0
-rw-r--r--media/libaom/src/build/cmake/generate_exports.cmake (renamed from third_party/aom/build/cmake/generate_exports.cmake)0
-rw-r--r--media/libaom/src/build/cmake/ios-Info.plist (renamed from third_party/aom/build/cmake/ios-Info.plist)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/build/cmake/iosbuild.sh (renamed from third_party/aom/build/cmake/iosbuild.sh)0
-rw-r--r--media/libaom/src/build/cmake/msvc_runtime.cmake (renamed from third_party/aom/build/cmake/msvc_runtime.cmake)0
-rw-r--r--media/libaom/src/build/cmake/pkg_config.cmake (renamed from third_party/aom/build/cmake/pkg_config.cmake)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/build/cmake/rtcd.pl (renamed from third_party/aom/build/cmake/rtcd.pl)0
-rw-r--r--media/libaom/src/build/cmake/sanitizers.cmake (renamed from third_party/aom/build/cmake/sanitizers.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/arm-ios-common.cmake (renamed from third_party/aom/build/cmake/toolchains/arm-ios-common.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/arm64-ios.cmake (renamed from third_party/aom/build/cmake/toolchains/arm64-ios.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/arm64-linux-gcc.cmake (renamed from third_party/aom/build/cmake/toolchains/arm64-linux-gcc.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/arm64-mingw-gcc.cmake (renamed from third_party/aom/build/cmake/toolchains/arm64-mingw-gcc.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/armv7-ios.cmake (renamed from third_party/aom/build/cmake/toolchains/armv7-ios.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/armv7-linux-gcc.cmake (renamed from third_party/aom/build/cmake/toolchains/armv7-linux-gcc.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/armv7-mingw-gcc.cmake (renamed from third_party/aom/build/cmake/toolchains/armv7-mingw-gcc.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/armv7s-ios.cmake (renamed from third_party/aom/build/cmake/toolchains/armv7s-ios.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/ios-simulator-common.cmake (renamed from third_party/aom/build/cmake/toolchains/ios-simulator-common.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/mips32-linux-gcc.cmake (renamed from third_party/aom/build/cmake/toolchains/mips32-linux-gcc.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/mips64-linux-gcc.cmake (renamed from third_party/aom/build/cmake/toolchains/mips64-linux-gcc.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/ppc-linux-gcc.cmake (renamed from third_party/aom/build/cmake/toolchains/ppc-linux-gcc.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/x86-ios-simulator.cmake (renamed from third_party/aom/build/cmake/toolchains/x86-ios-simulator.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/x86-linux.cmake (renamed from third_party/aom/build/cmake/toolchains/x86-linux.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/x86-macos.cmake (renamed from third_party/aom/build/cmake/toolchains/x86-macos.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/x86-mingw-gcc.cmake (renamed from third_party/aom/build/cmake/toolchains/x86-mingw-gcc.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/x86_64-ios-simulator.cmake (renamed from third_party/aom/build/cmake/toolchains/x86_64-ios-simulator.cmake)0
-rw-r--r--media/libaom/src/build/cmake/toolchains/x86_64-mingw-gcc.cmake (renamed from third_party/aom/build/cmake/toolchains/x86_64-mingw-gcc.cmake)0
-rw-r--r--media/libaom/src/build/cmake/util.cmake (renamed from third_party/aom/build/cmake/util.cmake)0
-rw-r--r--media/libaom/src/build/cmake/version.cmake (renamed from third_party/aom/build/cmake/version.cmake)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/build/cmake/version.pl (renamed from third_party/aom/build/cmake/version.pl)0
-rw-r--r--media/libaom/src/codereview.settings (renamed from third_party/aom/codereview.settings)0
-rw-r--r--media/libaom/src/common/args.c (renamed from third_party/aom/common/args.c)0
-rw-r--r--media/libaom/src/common/args.h (renamed from third_party/aom/common/args.h)0
-rw-r--r--media/libaom/src/common/av1_config.c (renamed from third_party/aom/common/av1_config.c)0
-rw-r--r--media/libaom/src/common/av1_config.h (renamed from third_party/aom/common/av1_config.h)0
-rw-r--r--media/libaom/src/common/ivfdec.c (renamed from third_party/aom/common/ivfdec.c)0
-rw-r--r--media/libaom/src/common/ivfdec.h (renamed from third_party/aom/common/ivfdec.h)0
-rw-r--r--media/libaom/src/common/ivfenc.c (renamed from third_party/aom/common/ivfenc.c)0
-rw-r--r--media/libaom/src/common/ivfenc.h (renamed from third_party/aom/common/ivfenc.h)0
-rw-r--r--media/libaom/src/common/md5_utils.c (renamed from third_party/aom/common/md5_utils.c)0
-rw-r--r--media/libaom/src/common/md5_utils.h (renamed from third_party/aom/common/md5_utils.h)0
-rw-r--r--media/libaom/src/common/obudec.c (renamed from third_party/aom/common/obudec.c)0
-rw-r--r--media/libaom/src/common/obudec.h (renamed from third_party/aom/common/obudec.h)0
-rw-r--r--media/libaom/src/common/rawenc.c (renamed from third_party/aom/common/rawenc.c)0
-rw-r--r--media/libaom/src/common/rawenc.h (renamed from third_party/aom/common/rawenc.h)0
-rw-r--r--media/libaom/src/common/tools_common.c (renamed from third_party/aom/common/tools_common.c)0
-rw-r--r--media/libaom/src/common/tools_common.h (renamed from third_party/aom/common/tools_common.h)0
-rw-r--r--media/libaom/src/common/video_common.h (renamed from third_party/aom/common/video_common.h)0
-rw-r--r--media/libaom/src/common/video_reader.c (renamed from third_party/aom/common/video_reader.c)0
-rw-r--r--media/libaom/src/common/video_reader.h (renamed from third_party/aom/common/video_reader.h)0
-rw-r--r--media/libaom/src/common/video_writer.c (renamed from third_party/aom/common/video_writer.c)0
-rw-r--r--media/libaom/src/common/video_writer.h (renamed from third_party/aom/common/video_writer.h)0
-rw-r--r--media/libaom/src/common/warnings.c (renamed from third_party/aom/common/warnings.c)0
-rw-r--r--media/libaom/src/common/warnings.h (renamed from third_party/aom/common/warnings.h)0
-rw-r--r--media/libaom/src/common/webmdec.cc (renamed from third_party/aom/common/webmdec.cc)0
-rw-r--r--media/libaom/src/common/webmdec.h (renamed from third_party/aom/common/webmdec.h)0
-rw-r--r--media/libaom/src/common/webmenc.cc (renamed from third_party/aom/common/webmenc.cc)0
-rw-r--r--media/libaom/src/common/webmenc.h (renamed from third_party/aom/common/webmenc.h)0
-rw-r--r--media/libaom/src/common/y4menc.c (renamed from third_party/aom/common/y4menc.c)0
-rw-r--r--media/libaom/src/common/y4menc.h (renamed from third_party/aom/common/y4menc.h)0
-rw-r--r--media/libaom/src/common/y4minput.c (renamed from third_party/aom/common/y4minput.c)0
-rw-r--r--media/libaom/src/common/y4minput.h (renamed from third_party/aom/common/y4minput.h)0
-rw-r--r--media/libaom/src/docs.cmake (renamed from third_party/aom/docs.cmake)0
-rw-r--r--media/libaom/src/examples/analyzer.cc (renamed from third_party/aom/examples/analyzer.cc)0
-rw-r--r--media/libaom/src/examples/aom_cx_set_ref.c (renamed from third_party/aom/examples/aom_cx_set_ref.c)0
-rw-r--r--media/libaom/src/examples/decode_to_md5.c (renamed from third_party/aom/examples/decode_to_md5.c)0
-rw-r--r--media/libaom/src/examples/decode_with_drops.c (renamed from third_party/aom/examples/decode_with_drops.c)0
-rw-r--r--media/libaom/src/examples/encoder_util.c (renamed from third_party/aom/examples/encoder_util.c)0
-rw-r--r--media/libaom/src/examples/encoder_util.h (renamed from third_party/aom/examples/encoder_util.h)0
-rw-r--r--media/libaom/src/examples/inspect.c (renamed from third_party/aom/examples/inspect.c)0
-rw-r--r--media/libaom/src/examples/lightfield_bitstream_parsing.c (renamed from third_party/aom/examples/lightfield_bitstream_parsing.c)0
-rw-r--r--media/libaom/src/examples/lightfield_decoder.c (renamed from third_party/aom/examples/lightfield_decoder.c)0
-rw-r--r--media/libaom/src/examples/lightfield_encoder.c (renamed from third_party/aom/examples/lightfield_encoder.c)0
-rw-r--r--media/libaom/src/examples/lightfield_tile_list_decoder.c (renamed from third_party/aom/examples/lightfield_tile_list_decoder.c)0
-rw-r--r--media/libaom/src/examples/lossless_encoder.c (renamed from third_party/aom/examples/lossless_encoder.c)0
-rw-r--r--media/libaom/src/examples/noise_model.c (renamed from third_party/aom/examples/noise_model.c)0
-rw-r--r--media/libaom/src/examples/resize_util.c (renamed from third_party/aom/examples/resize_util.c)0
-rw-r--r--media/libaom/src/examples/scalable_decoder.c (renamed from third_party/aom/examples/scalable_decoder.c)0
-rw-r--r--media/libaom/src/examples/scalable_encoder.c (renamed from third_party/aom/examples/scalable_encoder.c)0
-rw-r--r--media/libaom/src/examples/set_maps.c (renamed from third_party/aom/examples/set_maps.c)0
-rw-r--r--media/libaom/src/examples/simple_decoder.c (renamed from third_party/aom/examples/simple_decoder.c)0
-rw-r--r--media/libaom/src/examples/simple_encoder.c (renamed from third_party/aom/examples/simple_encoder.c)0
-rw-r--r--media/libaom/src/examples/twopass_encoder.c (renamed from third_party/aom/examples/twopass_encoder.c)0
-rw-r--r--media/libaom/src/keywords.dox (renamed from third_party/aom/keywords.dox)0
-rw-r--r--media/libaom/src/libs.doxy_template (renamed from third_party/aom/libs.doxy_template)0
-rw-r--r--media/libaom/src/mainpage.dox (renamed from third_party/aom/mainpage.dox)0
-rw-r--r--media/libaom/src/stats/aomstats.c (renamed from third_party/aom/stats/aomstats.c)0
-rw-r--r--media/libaom/src/stats/aomstats.h (renamed from third_party/aom/stats/aomstats.h)0
-rw-r--r--media/libaom/src/stats/rate_hist.c (renamed from third_party/aom/stats/rate_hist.c)0
-rw-r--r--media/libaom/src/stats/rate_hist.h (renamed from third_party/aom/stats/rate_hist.h)0
-rw-r--r--media/libaom/src/test/accounting_test.cc (renamed from third_party/aom/test/accounting_test.cc)0
-rw-r--r--media/libaom/src/test/acm_random.h (renamed from third_party/aom/test/acm_random.h)0
-rw-r--r--media/libaom/src/test/active_map_test.cc (renamed from third_party/aom/test/active_map_test.cc)0
-rw-r--r--media/libaom/src/test/altref_test.cc (renamed from third_party/aom/test/altref_test.cc)0
-rw-r--r--media/libaom/src/test/aom_integer_test.cc (renamed from third_party/aom/test/aom_integer_test.cc)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/aomcx_set_ref.sh (renamed from third_party/aom/test/aomcx_set_ref.sh)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/aomdec.sh (renamed from third_party/aom/test/aomdec.sh)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/aomenc.sh (renamed from third_party/aom/test/aomenc.sh)0
-rw-r--r--media/libaom/src/test/aq_segment_test.cc (renamed from third_party/aom/test/aq_segment_test.cc)0
-rw-r--r--media/libaom/src/test/arf_freq_test.cc (renamed from third_party/aom/test/arf_freq_test.cc)0
-rw-r--r--media/libaom/src/test/av1_config_test.cc (renamed from third_party/aom/test/av1_config_test.cc)0
-rw-r--r--media/libaom/src/test/av1_convolve_2d_test.cc (renamed from third_party/aom/test/av1_convolve_2d_test.cc)0
-rw-r--r--media/libaom/src/test/av1_convolve_2d_test_util.cc (renamed from third_party/aom/test/av1_convolve_2d_test_util.cc)0
-rw-r--r--media/libaom/src/test/av1_convolve_2d_test_util.h (renamed from third_party/aom/test/av1_convolve_2d_test_util.h)0
-rw-r--r--media/libaom/src/test/av1_convolve_scale_test.cc (renamed from third_party/aom/test/av1_convolve_scale_test.cc)0
-rw-r--r--media/libaom/src/test/av1_encoder_parms_get_to_decoder.cc (renamed from third_party/aom/test/av1_encoder_parms_get_to_decoder.cc)0
-rw-r--r--media/libaom/src/test/av1_ext_tile_test.cc (renamed from third_party/aom/test/av1_ext_tile_test.cc)0
-rw-r--r--media/libaom/src/test/av1_fwd_txfm1d_test.cc (renamed from third_party/aom/test/av1_fwd_txfm1d_test.cc)0
-rw-r--r--media/libaom/src/test/av1_fwd_txfm2d_test.cc (renamed from third_party/aom/test/av1_fwd_txfm2d_test.cc)0
-rw-r--r--media/libaom/src/test/av1_highbd_iht_test.cc (renamed from third_party/aom/test/av1_highbd_iht_test.cc)0
-rw-r--r--media/libaom/src/test/av1_horz_only_frame_superres_test.cc (renamed from third_party/aom/test/av1_horz_only_frame_superres_test.cc)0
-rw-r--r--media/libaom/src/test/av1_inv_txfm1d_test.cc (renamed from third_party/aom/test/av1_inv_txfm1d_test.cc)0
-rw-r--r--media/libaom/src/test/av1_inv_txfm2d_test.cc (renamed from third_party/aom/test/av1_inv_txfm2d_test.cc)0
-rw-r--r--media/libaom/src/test/av1_quantize_test.cc (renamed from third_party/aom/test/av1_quantize_test.cc)0
-rw-r--r--media/libaom/src/test/av1_round_shift_array_test.cc (renamed from third_party/aom/test/av1_round_shift_array_test.cc)0
-rw-r--r--media/libaom/src/test/av1_txfm_test.cc (renamed from third_party/aom/test/av1_txfm_test.cc)0
-rw-r--r--media/libaom/src/test/av1_txfm_test.h (renamed from third_party/aom/test/av1_txfm_test.h)0
-rw-r--r--media/libaom/src/test/av1_wedge_utils_test.cc (renamed from third_party/aom/test/av1_wedge_utils_test.cc)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/best_encode.sh (renamed from third_party/aom/test/best_encode.sh)0
-rw-r--r--media/libaom/src/test/binary_codes_test.cc (renamed from third_party/aom/test/binary_codes_test.cc)0
-rw-r--r--media/libaom/src/test/blend_a64_mask_1d_test.cc (renamed from third_party/aom/test/blend_a64_mask_1d_test.cc)0
-rw-r--r--media/libaom/src/test/blend_a64_mask_test.cc (renamed from third_party/aom/test/blend_a64_mask_test.cc)0
-rw-r--r--media/libaom/src/test/blockd_test.cc (renamed from third_party/aom/test/blockd_test.cc)0
-rw-r--r--media/libaom/src/test/boolcoder_test.cc (renamed from third_party/aom/test/boolcoder_test.cc)0
-rw-r--r--media/libaom/src/test/borders_test.cc (renamed from third_party/aom/test/borders_test.cc)0
-rw-r--r--media/libaom/src/test/cdef_test.cc (renamed from third_party/aom/test/cdef_test.cc)0
-rw-r--r--media/libaom/src/test/cfl_test.cc (renamed from third_party/aom/test/cfl_test.cc)0
-rw-r--r--media/libaom/src/test/clear_system_state.h (renamed from third_party/aom/test/clear_system_state.h)0
-rw-r--r--media/libaom/src/test/codec_factory.h (renamed from third_party/aom/test/codec_factory.h)0
-rw-r--r--media/libaom/src/test/coding_path_sync.cc (renamed from third_party/aom/test/coding_path_sync.cc)0
-rw-r--r--media/libaom/src/test/comp_avg_pred_test.cc (renamed from third_party/aom/test/comp_avg_pred_test.cc)0
-rw-r--r--media/libaom/src/test/comp_avg_pred_test.h (renamed from third_party/aom/test/comp_avg_pred_test.h)0
-rw-r--r--media/libaom/src/test/comp_mask_variance_test.cc (renamed from third_party/aom/test/comp_mask_variance_test.cc)0
-rw-r--r--media/libaom/src/test/convolve_round_test.cc (renamed from third_party/aom/test/convolve_round_test.cc)0
-rw-r--r--media/libaom/src/test/convolve_test.cc (renamed from third_party/aom/test/convolve_test.cc)0
-rw-r--r--media/libaom/src/test/corner_match_test.cc (renamed from third_party/aom/test/corner_match_test.cc)0
-rw-r--r--media/libaom/src/test/cpu_speed_test.cc (renamed from third_party/aom/test/cpu_speed_test.cc)0
-rw-r--r--media/libaom/src/test/datarate_test.cc (renamed from third_party/aom/test/datarate_test.cc)0
-rw-r--r--media/libaom/src/test/decode_api_test.cc (renamed from third_party/aom/test/decode_api_test.cc)0
-rw-r--r--media/libaom/src/test/decode_multithreaded_test.cc (renamed from third_party/aom/test/decode_multithreaded_test.cc)0
-rw-r--r--media/libaom/src/test/decode_perf_test.cc (renamed from third_party/aom/test/decode_perf_test.cc)0
-rw-r--r--media/libaom/src/test/decode_test_driver.cc (renamed from third_party/aom/test/decode_test_driver.cc)0
-rw-r--r--media/libaom/src/test/decode_test_driver.h (renamed from third_party/aom/test/decode_test_driver.h)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/decode_to_md5.sh (renamed from third_party/aom/test/decode_to_md5.sh)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/decode_with_drops.sh (renamed from third_party/aom/test/decode_with_drops.sh)0
-rw-r--r--media/libaom/src/test/divu_small_test.cc (renamed from third_party/aom/test/divu_small_test.cc)0
-rw-r--r--media/libaom/src/test/dr_prediction_test.cc (renamed from third_party/aom/test/dr_prediction_test.cc)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/dump_obu.sh (renamed from third_party/aom/test/dump_obu.sh)0
-rw-r--r--media/libaom/src/test/ec_test.cc (renamed from third_party/aom/test/ec_test.cc)0
-rw-r--r--media/libaom/src/test/encode_api_test.cc (renamed from third_party/aom/test/encode_api_test.cc)0
-rw-r--r--media/libaom/src/test/encode_perf_test.cc (renamed from third_party/aom/test/encode_perf_test.cc)0
-rw-r--r--media/libaom/src/test/encode_test_driver.cc (renamed from third_party/aom/test/encode_test_driver.cc)0
-rw-r--r--media/libaom/src/test/encode_test_driver.h (renamed from third_party/aom/test/encode_test_driver.h)0
-rw-r--r--media/libaom/src/test/encodetxb_test.cc (renamed from third_party/aom/test/encodetxb_test.cc)0
-rw-r--r--media/libaom/src/test/end_to_end_test.cc (renamed from third_party/aom/test/end_to_end_test.cc)0
-rw-r--r--media/libaom/src/test/error_block_test.cc (renamed from third_party/aom/test/error_block_test.cc)0
-rw-r--r--media/libaom/src/test/error_resilience_test.cc (renamed from third_party/aom/test/error_resilience_test.cc)0
-rw-r--r--media/libaom/src/test/ethread_test.cc (renamed from third_party/aom/test/ethread_test.cc)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/examples.sh (renamed from third_party/aom/test/examples.sh)0
-rw-r--r--media/libaom/src/test/external_frame_buffer_test.cc (renamed from third_party/aom/test/external_frame_buffer_test.cc)0
-rw-r--r--media/libaom/src/test/fft_test.cc (renamed from third_party/aom/test/fft_test.cc)0
-rw-r--r--media/libaom/src/test/film_grain_table_test.cc (renamed from third_party/aom/test/film_grain_table_test.cc)0
-rw-r--r--media/libaom/src/test/filterintra_test.cc (renamed from third_party/aom/test/filterintra_test.cc)0
-rw-r--r--media/libaom/src/test/frame_size_tests.cc (renamed from third_party/aom/test/frame_size_tests.cc)0
-rw-r--r--media/libaom/src/test/function_equivalence_test.h (renamed from third_party/aom/test/function_equivalence_test.h)0
-rw-r--r--media/libaom/src/test/fwht4x4_test.cc (renamed from third_party/aom/test/fwht4x4_test.cc)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/gviz_api.py (renamed from third_party/aom/test/gviz_api.py)0
-rw-r--r--media/libaom/src/test/hash_test.cc (renamed from third_party/aom/test/hash_test.cc)0
-rw-r--r--media/libaom/src/test/hbd_metrics_test.cc (renamed from third_party/aom/test/hbd_metrics_test.cc)0
-rw-r--r--media/libaom/src/test/hiprec_convolve_test.cc (renamed from third_party/aom/test/hiprec_convolve_test.cc)0
-rw-r--r--media/libaom/src/test/hiprec_convolve_test_util.cc (renamed from third_party/aom/test/hiprec_convolve_test_util.cc)0
-rw-r--r--media/libaom/src/test/hiprec_convolve_test_util.h (renamed from third_party/aom/test/hiprec_convolve_test_util.h)0
-rw-r--r--media/libaom/src/test/horz_superres_test.cc (renamed from third_party/aom/test/horz_superres_test.cc)0
-rw-r--r--media/libaom/src/test/i420_video_source.h (renamed from third_party/aom/test/i420_video_source.h)0
-rw-r--r--media/libaom/src/test/intra_edge_test.cc (renamed from third_party/aom/test/intra_edge_test.cc)0
-rw-r--r--media/libaom/src/test/intrabc_test.cc (renamed from third_party/aom/test/intrabc_test.cc)0
-rw-r--r--media/libaom/src/test/intrapred_test.cc (renamed from third_party/aom/test/intrapred_test.cc)0
-rw-r--r--media/libaom/src/test/invalid_file_test.cc (renamed from third_party/aom/test/invalid_file_test.cc)0
-rw-r--r--media/libaom/src/test/ivf_video_source.h (renamed from third_party/aom/test/ivf_video_source.h)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/lightfield_test.sh (renamed from third_party/aom/test/lightfield_test.sh)0
-rw-r--r--media/libaom/src/test/log2_test.cc (renamed from third_party/aom/test/log2_test.cc)0
-rw-r--r--media/libaom/src/test/lossless_test.cc (renamed from third_party/aom/test/lossless_test.cc)0
-rw-r--r--media/libaom/src/test/lpf_test.cc (renamed from third_party/aom/test/lpf_test.cc)0
-rw-r--r--media/libaom/src/test/masked_sad_test.cc (renamed from third_party/aom/test/masked_sad_test.cc)0
-rw-r--r--media/libaom/src/test/masked_variance_test.cc (renamed from third_party/aom/test/masked_variance_test.cc)0
-rw-r--r--media/libaom/src/test/md5_helper.h (renamed from third_party/aom/test/md5_helper.h)0
-rw-r--r--media/libaom/src/test/metrics_template.html (renamed from third_party/aom/test/metrics_template.html)0
-rw-r--r--media/libaom/src/test/monochrome_test.cc (renamed from third_party/aom/test/monochrome_test.cc)0
-rw-r--r--media/libaom/src/test/motion_vector_test.cc (renamed from third_party/aom/test/motion_vector_test.cc)0
-rw-r--r--media/libaom/src/test/noise_model_test.cc (renamed from third_party/aom/test/noise_model_test.cc)0
-rw-r--r--media/libaom/src/test/obmc_sad_test.cc (renamed from third_party/aom/test/obmc_sad_test.cc)0
-rw-r--r--media/libaom/src/test/obmc_variance_test.cc (renamed from third_party/aom/test/obmc_variance_test.cc)0
-rw-r--r--media/libaom/src/test/onyxc_int_test.cc (renamed from third_party/aom/test/onyxc_int_test.cc)0
-rw-r--r--media/libaom/src/test/pickrst_test.cc (renamed from third_party/aom/test/pickrst_test.cc)0
-rw-r--r--media/libaom/src/test/qm_test.cc (renamed from third_party/aom/test/qm_test.cc)0
-rw-r--r--media/libaom/src/test/quantize_func_test.cc (renamed from third_party/aom/test/quantize_func_test.cc)0
-rw-r--r--media/libaom/src/test/reconinter_test.cc (renamed from third_party/aom/test/reconinter_test.cc)0
-rw-r--r--media/libaom/src/test/register_state_check.h (renamed from third_party/aom/test/register_state_check.h)0
-rw-r--r--media/libaom/src/test/resize_test.cc (renamed from third_party/aom/test/resize_test.cc)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/run_encodes.sh (renamed from third_party/aom/test/run_encodes.sh)0
-rw-r--r--media/libaom/src/test/sad_test.cc (renamed from third_party/aom/test/sad_test.cc)0
-rw-r--r--media/libaom/src/test/scalability_test.cc (renamed from third_party/aom/test/scalability_test.cc)0
-rw-r--r--media/libaom/src/test/scan_test.cc (renamed from third_party/aom/test/scan_test.cc)0
-rw-r--r--media/libaom/src/test/segment_binarization_sync.cc (renamed from third_party/aom/test/segment_binarization_sync.cc)0
-rw-r--r--media/libaom/src/test/selfguided_filter_test.cc (renamed from third_party/aom/test/selfguided_filter_test.cc)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/set_maps.sh (renamed from third_party/aom/test/set_maps.sh)0
-rw-r--r--media/libaom/src/test/simd_avx2_test.cc (renamed from third_party/aom/test/simd_avx2_test.cc)0
-rw-r--r--media/libaom/src/test/simd_cmp_avx2.cc (renamed from third_party/aom/test/simd_cmp_avx2.cc)0
-rw-r--r--media/libaom/src/test/simd_cmp_impl.h (renamed from third_party/aom/test/simd_cmp_impl.h)0
-rw-r--r--media/libaom/src/test/simd_cmp_neon.cc (renamed from third_party/aom/test/simd_cmp_neon.cc)0
-rw-r--r--media/libaom/src/test/simd_cmp_sse2.cc (renamed from third_party/aom/test/simd_cmp_sse2.cc)0
-rw-r--r--media/libaom/src/test/simd_cmp_sse4.cc (renamed from third_party/aom/test/simd_cmp_sse4.cc)0
-rw-r--r--media/libaom/src/test/simd_cmp_ssse3.cc (renamed from third_party/aom/test/simd_cmp_ssse3.cc)0
-rw-r--r--media/libaom/src/test/simd_impl.h (renamed from third_party/aom/test/simd_impl.h)0
-rw-r--r--media/libaom/src/test/simd_neon_test.cc (renamed from third_party/aom/test/simd_neon_test.cc)0
-rw-r--r--media/libaom/src/test/simd_sse2_test.cc (renamed from third_party/aom/test/simd_sse2_test.cc)0
-rw-r--r--media/libaom/src/test/simd_sse4_test.cc (renamed from third_party/aom/test/simd_sse4_test.cc)0
-rw-r--r--media/libaom/src/test/simd_ssse3_test.cc (renamed from third_party/aom/test/simd_ssse3_test.cc)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/simple_decoder.sh (renamed from third_party/aom/test/simple_decoder.sh)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/simple_encoder.sh (renamed from third_party/aom/test/simple_encoder.sh)0
-rw-r--r--media/libaom/src/test/subtract_test.cc (renamed from third_party/aom/test/subtract_test.cc)0
-rw-r--r--media/libaom/src/test/sum_squares_test.cc (renamed from third_party/aom/test/sum_squares_test.cc)0
-rw-r--r--media/libaom/src/test/superframe_test.cc (renamed from third_party/aom/test/superframe_test.cc)0
-rw-r--r--media/libaom/src/test/test-data.sha1 (renamed from third_party/aom/test/test-data.sha1)0
-rw-r--r--media/libaom/src/test/test.cmake (renamed from third_party/aom/test/test.cmake)0
-rw-r--r--media/libaom/src/test/test_data_download_worker.cmake (renamed from third_party/aom/test/test_data_download_worker.cmake)0
-rw-r--r--media/libaom/src/test/test_data_util.cmake (renamed from third_party/aom/test/test_data_util.cmake)0
-rw-r--r--media/libaom/src/test/test_intra_pred_speed.cc (renamed from third_party/aom/test/test_intra_pred_speed.cc)0
-rw-r--r--media/libaom/src/test/test_libaom.cc (renamed from third_party/aom/test/test_libaom.cc)0
-rw-r--r--media/libaom/src/test/test_runner.cmake (renamed from third_party/aom/test/test_runner.cmake)0
-rw-r--r--media/libaom/src/test/test_vector_test.cc (renamed from third_party/aom/test/test_vector_test.cc)0
-rw-r--r--media/libaom/src/test/test_vectors.cc (renamed from third_party/aom/test/test_vectors.cc)0
-rw-r--r--media/libaom/src/test/test_vectors.h (renamed from third_party/aom/test/test_vectors.h)0
-rw-r--r--media/libaom/src/test/tile_independence_test.cc (renamed from third_party/aom/test/tile_independence_test.cc)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/tools_common.sh (renamed from third_party/aom/test/tools_common.sh)0
-rw-r--r--media/libaom/src/test/transform_test_base.h (renamed from third_party/aom/test/transform_test_base.h)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/twopass_encoder.sh (renamed from third_party/aom/test/twopass_encoder.sh)0
-rw-r--r--media/libaom/src/test/util.h (renamed from third_party/aom/test/util.h)0
-rw-r--r--media/libaom/src/test/variance_test.cc (renamed from third_party/aom/test/variance_test.cc)0
-rw-r--r--media/libaom/src/test/video_source.h (renamed from third_party/aom/test/video_source.h)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/test/visual_metrics.py (renamed from third_party/aom/test/visual_metrics.py)0
-rw-r--r--media/libaom/src/test/warp_filter_test.cc (renamed from third_party/aom/test/warp_filter_test.cc)0
-rw-r--r--media/libaom/src/test/warp_filter_test_util.cc (renamed from third_party/aom/test/warp_filter_test_util.cc)0
-rw-r--r--media/libaom/src/test/warp_filter_test_util.h (renamed from third_party/aom/test/warp_filter_test_util.h)0
-rw-r--r--media/libaom/src/test/webm_video_source.h (renamed from third_party/aom/test/webm_video_source.h)0
-rw-r--r--media/libaom/src/test/wiener_test.cc (renamed from third_party/aom/test/wiener_test.cc)0
-rw-r--r--media/libaom/src/test/y4m_test.cc (renamed from third_party/aom/test/y4m_test.cc)0
-rw-r--r--media/libaom/src/test/y4m_video_source.h (renamed from third_party/aom/test/y4m_video_source.h)0
-rw-r--r--media/libaom/src/test/yuv_video_source.h (renamed from third_party/aom/test/yuv_video_source.h)0
-rw-r--r--media/libaom/src/third_party/fastfeat/LICENSE (renamed from third_party/aom/third_party/fastfeat/LICENSE)0
-rw-r--r--media/libaom/src/third_party/fastfeat/README.libvpx (renamed from third_party/aom/third_party/fastfeat/README.libvpx)0
-rw-r--r--media/libaom/src/third_party/fastfeat/fast.c (renamed from third_party/aom/third_party/fastfeat/fast.c)0
-rw-r--r--media/libaom/src/third_party/fastfeat/fast.h (renamed from third_party/aom/third_party/fastfeat/fast.h)0
-rw-r--r--media/libaom/src/third_party/fastfeat/fast_9.c (renamed from third_party/aom/third_party/fastfeat/fast_9.c)0
-rw-r--r--media/libaom/src/third_party/fastfeat/nonmax.c (renamed from third_party/aom/third_party/fastfeat/nonmax.c)0
-rw-r--r--media/libaom/src/third_party/googletest/README.libaom (renamed from third_party/aom/third_party/googletest/README.libaom)0
-rw-r--r--media/libaom/src/third_party/googletest/gtest.mk (renamed from third_party/aom/third_party/googletest/gtest.mk)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/CHANGES (renamed from third_party/aom/third_party/googletest/src/googletest/CHANGES)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/CMakeLists.txt (renamed from third_party/aom/third_party/googletest/src/googletest/CMakeLists.txt)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/CONTRIBUTORS (renamed from third_party/aom/third_party/googletest/src/googletest/CONTRIBUTORS)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/LICENSE (renamed from third_party/aom/third_party/googletest/src/googletest/LICENSE)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/README.md (renamed from third_party/aom/third_party/googletest/src/googletest/README.md)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/cmake/internal_utils.cmake (renamed from third_party/aom/third_party/googletest/src/googletest/cmake/internal_utils.cmake)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-death-test.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-death-test.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-message.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-message.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h.pump (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h.pump)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-printers.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-printers.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-spi.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-spi.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-test-part.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-test-part.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-typed-test.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-typed-test.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest_pred_impl.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest_pred_impl.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest_prod.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest_prod.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest-port.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest-port.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest-printers.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest-printers.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-death-test-internal.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-death-test-internal.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-filepath.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-filepath.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-internal.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-internal.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-linked_ptr.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-linked_ptr.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util-generated.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util-generated.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util-generated.h.pump (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util-generated.h.pump)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-port-arch.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port-arch.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-string.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-string.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-tuple.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-tuple.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-tuple.h.pump (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-tuple.h.pump)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h.pump (renamed from third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h.pump)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/src/gtest-all.cc (renamed from third_party/aom/third_party/googletest/src/googletest/src/gtest-all.cc)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/src/gtest-death-test.cc (renamed from third_party/aom/third_party/googletest/src/googletest/src/gtest-death-test.cc)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/src/gtest-filepath.cc (renamed from third_party/aom/third_party/googletest/src/googletest/src/gtest-filepath.cc)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/src/gtest-internal-inl.h (renamed from third_party/aom/third_party/googletest/src/googletest/src/gtest-internal-inl.h)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/src/gtest-port.cc (renamed from third_party/aom/third_party/googletest/src/googletest/src/gtest-port.cc)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/src/gtest-printers.cc (renamed from third_party/aom/third_party/googletest/src/googletest/src/gtest-printers.cc)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/src/gtest-test-part.cc (renamed from third_party/aom/third_party/googletest/src/googletest/src/gtest-test-part.cc)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/src/gtest-typed-test.cc (renamed from third_party/aom/third_party/googletest/src/googletest/src/gtest-typed-test.cc)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/src/gtest.cc (renamed from third_party/aom/third_party/googletest/src/googletest/src/gtest.cc)0
-rw-r--r--media/libaom/src/third_party/googletest/src/googletest/src/gtest_main.cc (renamed from third_party/aom/third_party/googletest/src/googletest/src/gtest_main.cc)0
-rw-r--r--media/libaom/src/third_party/libwebm/AUTHORS.TXT (renamed from third_party/aom/third_party/libwebm/AUTHORS.TXT)0
-rw-r--r--media/libaom/src/third_party/libwebm/Android.mk (renamed from third_party/aom/third_party/libwebm/Android.mk)0
-rw-r--r--media/libaom/src/third_party/libwebm/LICENSE.TXT (renamed from third_party/aom/third_party/libwebm/LICENSE.TXT)0
-rw-r--r--media/libaom/src/third_party/libwebm/PATENTS.TXT (renamed from third_party/aom/third_party/libwebm/PATENTS.TXT)0
-rw-r--r--media/libaom/src/third_party/libwebm/README.libaom (renamed from third_party/aom/third_party/libwebm/README.libaom)0
-rw-r--r--media/libaom/src/third_party/libwebm/common/file_util.cc (renamed from third_party/aom/third_party/libwebm/common/file_util.cc)0
-rw-r--r--media/libaom/src/third_party/libwebm/common/file_util.h (renamed from third_party/aom/third_party/libwebm/common/file_util.h)0
-rw-r--r--media/libaom/src/third_party/libwebm/common/hdr_util.cc (renamed from third_party/aom/third_party/libwebm/common/hdr_util.cc)0
-rw-r--r--media/libaom/src/third_party/libwebm/common/hdr_util.h (renamed from third_party/aom/third_party/libwebm/common/hdr_util.h)0
-rw-r--r--media/libaom/src/third_party/libwebm/common/webmids.h (renamed from third_party/aom/third_party/libwebm/common/webmids.h)0
-rw-r--r--media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxer.cc (renamed from third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxer.cc)0
-rw-r--r--media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxer.h (renamed from third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxer.h)0
-rw-r--r--media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxertypes.h (renamed from third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxertypes.h)0
-rw-r--r--media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc (renamed from third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc)0
-rw-r--r--media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxerutil.h (renamed from third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxerutil.h)0
-rw-r--r--media/libaom/src/third_party/libwebm/mkvmuxer/mkvwriter.cc (renamed from third_party/aom/third_party/libwebm/mkvmuxer/mkvwriter.cc)0
-rw-r--r--media/libaom/src/third_party/libwebm/mkvmuxer/mkvwriter.h (renamed from third_party/aom/third_party/libwebm/mkvmuxer/mkvwriter.h)0
-rw-r--r--media/libaom/src/third_party/libwebm/mkvparser/mkvparser.cc (renamed from third_party/aom/third_party/libwebm/mkvparser/mkvparser.cc)0
-rw-r--r--media/libaom/src/third_party/libwebm/mkvparser/mkvparser.h (renamed from third_party/aom/third_party/libwebm/mkvparser/mkvparser.h)0
-rw-r--r--media/libaom/src/third_party/libwebm/mkvparser/mkvreader.cc (renamed from third_party/aom/third_party/libwebm/mkvparser/mkvreader.cc)0
-rw-r--r--media/libaom/src/third_party/libwebm/mkvparser/mkvreader.h (renamed from third_party/aom/third_party/libwebm/mkvparser/mkvreader.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/README.libaom (renamed from third_party/aom/third_party/libyuv/README.libaom)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/basic_types.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/basic_types.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/compare.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/compare.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/convert.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/convert.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/convert_argb.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/convert_argb.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/convert_from.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/convert_from.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/convert_from_argb.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/convert_from_argb.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/cpu_id.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/cpu_id.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/mjpeg_decoder.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/mjpeg_decoder.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/planar_functions.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/planar_functions.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/rotate.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/rotate.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/rotate_argb.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/rotate_argb.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/rotate_row.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/rotate_row.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/row.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/row.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/scale.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/scale.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/scale_argb.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/scale_argb.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/scale_row.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/scale_row.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/version.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/version.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/include/libyuv/video_common.h (renamed from third_party/aom/third_party/libyuv/include/libyuv/video_common.h)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/compare.cc (renamed from third_party/aom/third_party/libyuv/source/compare.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/compare_common.cc (renamed from third_party/aom/third_party/libyuv/source/compare_common.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/compare_gcc.cc (renamed from third_party/aom/third_party/libyuv/source/compare_gcc.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/compare_neon.cc (renamed from third_party/aom/third_party/libyuv/source/compare_neon.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/compare_neon64.cc (renamed from third_party/aom/third_party/libyuv/source/compare_neon64.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/compare_win.cc (renamed from third_party/aom/third_party/libyuv/source/compare_win.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/convert.cc (renamed from third_party/aom/third_party/libyuv/source/convert.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/convert_argb.cc (renamed from third_party/aom/third_party/libyuv/source/convert_argb.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/convert_from.cc (renamed from third_party/aom/third_party/libyuv/source/convert_from.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/convert_from_argb.cc (renamed from third_party/aom/third_party/libyuv/source/convert_from_argb.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/convert_jpeg.cc (renamed from third_party/aom/third_party/libyuv/source/convert_jpeg.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/convert_to_argb.cc (renamed from third_party/aom/third_party/libyuv/source/convert_to_argb.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/convert_to_i420.cc (renamed from third_party/aom/third_party/libyuv/source/convert_to_i420.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/cpu_id.cc (renamed from third_party/aom/third_party/libyuv/source/cpu_id.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/mjpeg_decoder.cc (renamed from third_party/aom/third_party/libyuv/source/mjpeg_decoder.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/mjpeg_validate.cc (renamed from third_party/aom/third_party/libyuv/source/mjpeg_validate.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/planar_functions.cc (renamed from third_party/aom/third_party/libyuv/source/planar_functions.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/rotate.cc (renamed from third_party/aom/third_party/libyuv/source/rotate.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/rotate_any.cc (renamed from third_party/aom/third_party/libyuv/source/rotate_any.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/rotate_argb.cc (renamed from third_party/aom/third_party/libyuv/source/rotate_argb.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/rotate_common.cc (renamed from third_party/aom/third_party/libyuv/source/rotate_common.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/rotate_gcc.cc (renamed from third_party/aom/third_party/libyuv/source/rotate_gcc.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/rotate_mips.cc (renamed from third_party/aom/third_party/libyuv/source/rotate_mips.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/rotate_neon.cc (renamed from third_party/aom/third_party/libyuv/source/rotate_neon.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/rotate_neon64.cc (renamed from third_party/aom/third_party/libyuv/source/rotate_neon64.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/rotate_win.cc (renamed from third_party/aom/third_party/libyuv/source/rotate_win.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/row_any.cc (renamed from third_party/aom/third_party/libyuv/source/row_any.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/row_common.cc (renamed from third_party/aom/third_party/libyuv/source/row_common.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/row_gcc.cc (renamed from third_party/aom/third_party/libyuv/source/row_gcc.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/row_mips.cc (renamed from third_party/aom/third_party/libyuv/source/row_mips.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/row_neon.cc (renamed from third_party/aom/third_party/libyuv/source/row_neon.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/row_neon64.cc (renamed from third_party/aom/third_party/libyuv/source/row_neon64.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/row_win.cc (renamed from third_party/aom/third_party/libyuv/source/row_win.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/row_x86.asm (renamed from third_party/aom/third_party/libyuv/source/row_x86.asm)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/scale.cc (renamed from third_party/aom/third_party/libyuv/source/scale.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/scale_any.cc (renamed from third_party/aom/third_party/libyuv/source/scale_any.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/scale_argb.cc (renamed from third_party/aom/third_party/libyuv/source/scale_argb.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/scale_common.cc (renamed from third_party/aom/third_party/libyuv/source/scale_common.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/scale_gcc.cc (renamed from third_party/aom/third_party/libyuv/source/scale_gcc.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/scale_mips.cc (renamed from third_party/aom/third_party/libyuv/source/scale_mips.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/scale_neon.cc (renamed from third_party/aom/third_party/libyuv/source/scale_neon.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/scale_neon64.cc (renamed from third_party/aom/third_party/libyuv/source/scale_neon64.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/scale_win.cc (renamed from third_party/aom/third_party/libyuv/source/scale_win.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/video_common.cc (renamed from third_party/aom/third_party/libyuv/source/video_common.cc)0
-rw-r--r--media/libaom/src/third_party/libyuv/source/x86inc.asm (renamed from third_party/aom/third_party/libyuv/source/x86inc.asm)0
-rw-r--r--media/libaom/src/third_party/vector/LICENSE (renamed from third_party/aom/third_party/vector/LICENSE)0
-rw-r--r--media/libaom/src/third_party/vector/README.libaom (renamed from third_party/aom/third_party/vector/README.libaom)0
-rw-r--r--media/libaom/src/third_party/vector/vector.c (renamed from third_party/aom/third_party/vector/vector.c)0
-rw-r--r--media/libaom/src/third_party/vector/vector.h (renamed from third_party/aom/third_party/vector/vector.h)0
-rw-r--r--media/libaom/src/third_party/x86inc/LICENSE (renamed from third_party/aom/third_party/x86inc/LICENSE)0
-rw-r--r--media/libaom/src/third_party/x86inc/README.libaom (renamed from third_party/aom/third_party/x86inc/README.libaom)0
-rw-r--r--media/libaom/src/third_party/x86inc/x86inc.asm (renamed from third_party/aom/third_party/x86inc/x86inc.asm)0
-rw-r--r--media/libaom/src/tools/aggregate_entropy_stats.py (renamed from third_party/aom/tools/aggregate_entropy_stats.py)0
-rw-r--r--media/libaom/src/tools/aom_entropy_optimizer.c (renamed from third_party/aom/tools/aom_entropy_optimizer.c)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/tools/cpplint.py (renamed from third_party/aom/tools/cpplint.py)0
-rw-r--r--media/libaom/src/tools/diff.py (renamed from third_party/aom/tools/diff.py)0
-rw-r--r--media/libaom/src/tools/dump_obu.cc (renamed from third_party/aom/tools/dump_obu.cc)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/tools/gen_authors.sh (renamed from third_party/aom/tools/gen_authors.sh)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/tools/gen_constrained_tokenset.py (renamed from third_party/aom/tools/gen_constrained_tokenset.py)0
-rw-r--r--media/libaom/src/tools/inspect-cli.js (renamed from third_party/aom/tools/inspect-cli.js)0
-rw-r--r--media/libaom/src/tools/inspect-post.js (renamed from third_party/aom/tools/inspect-post.js)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/tools/intersect-diffs.py (renamed from third_party/aom/tools/intersect-diffs.py)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/tools/lint-hunks.py (renamed from third_party/aom/tools/lint-hunks.py)0
-rw-r--r--media/libaom/src/tools/obu_parser.cc (renamed from third_party/aom/tools/obu_parser.cc)0
-rw-r--r--media/libaom/src/tools/obu_parser.h (renamed from third_party/aom/tools/obu_parser.h)0
-rw-r--r--media/libaom/src/tools/txfm_analyzer/txfm_gen_code.cc (renamed from third_party/aom/tools/txfm_analyzer/txfm_gen_code.cc)0
-rw-r--r--media/libaom/src/tools/txfm_analyzer/txfm_graph.cc (renamed from third_party/aom/tools/txfm_analyzer/txfm_graph.cc)0
-rw-r--r--media/libaom/src/tools/txfm_analyzer/txfm_graph.h (renamed from third_party/aom/tools/txfm_analyzer/txfm_graph.h)0
-rw-r--r--[-rwxr-xr-x]media/libaom/src/tools/wrap-commit-msg.py (renamed from third_party/aom/tools/wrap-commit-msg.py)0
-rw-r--r--media/libaom/src/usage.dox (renamed from third_party/aom/usage.dox)0
-rw-r--r--media/libaom/src/usage_cx.dox (renamed from third_party/aom/usage_cx.dox)0
-rw-r--r--media/libaom/src/usage_dx.dox (renamed from third_party/aom/usage_dx.dox)0
-rw-r--r--media/mtransport/nr_socket_prsock.cpp17
-rw-r--r--media/webrtc/signaling/test/common.build3
-rw-r--r--media/webrtc/trunk/build/build_config.h2
-rw-r--r--media/webrtc/trunk/webrtc/typedefs.h2
-rw-r--r--memory/build/moz.build2
-rw-r--r--memory/build/mozmemory_wrap.c54
-rw-r--r--memory/build/mozmemory_wrap.h25
-rw-r--r--memory/build/replace_malloc.c25
-rw-r--r--memory/build/replace_malloc.h2
-rw-r--r--memory/mozalloc/mozalloc.h11
-rw-r--r--memory/mozalloc/mozalloc_abort.cpp37
-rw-r--r--memory/mozjemalloc/jemalloc.c48
-rw-r--r--memory/replace/logalloc/LogAlloc.cpp10
-rw-r--r--memory/replace/logalloc/moz.build18
-rw-r--r--memory/replace/logalloc/replay/Replay.cpp17
-rw-r--r--memory/volatile/VolatileBuffer.h4
-rw-r--r--memory/volatile/VolatileBufferAshmem.cpp139
-rw-r--r--memory/volatile/moz.build22
-rw-r--r--memory/volatile/tests/TestVolatileBuffer.cpp8
-rw-r--r--mfbt/Assertions.h14
-rw-r--r--mfbt/IntegerPrintfMacros.h21
-rw-r--r--mfbt/TaggedAnonymousMemory.cpp105
-rw-r--r--mfbt/TaggedAnonymousMemory.h24
-rw-r--r--mfbt/objs.mozbuild1
-rw-r--r--mfbt/tests/TestTypeTraits.cpp14
-rw-r--r--mfbt/tests/TestTypedEnum.cpp3
-rw-r--r--modules/libpref/init/all.js31
-rw-r--r--moz.build3
-rw-r--r--mozglue/android/APKOpen.cpp465
-rw-r--r--mozglue/android/APKOpen.h39
-rw-r--r--mozglue/android/NSSBridge.cpp285
-rw-r--r--mozglue/android/NSSBridge.h42
-rw-r--r--mozglue/android/NativeCrypto.cpp132
-rw-r--r--mozglue/android/NativeCrypto.h53
-rw-r--r--mozglue/android/SQLiteBridge.cpp413
-rw-r--r--mozglue/android/SQLiteBridge.h34
-rw-r--r--mozglue/android/SharedMemNatives.cpp65
-rw-r--r--mozglue/android/moz.build58
-rw-r--r--mozglue/android/nsGeckoUtils.cpp124
-rw-r--r--mozglue/android/pbkdf2_sha256.c432
-rw-r--r--mozglue/android/pbkdf2_sha256.h70
-rw-r--r--mozglue/build/BionicGlue.cpp140
-rw-r--r--mozglue/build/arm.cpp4
-rw-r--r--mozglue/build/arm.h2
-rw-r--r--mozglue/build/moz.build53
-rw-r--r--mozglue/linker/CustomElf.cpp10
-rw-r--r--mozglue/linker/ElfLoader.cpp164
-rw-r--r--mozglue/linker/ElfLoader.h8
-rw-r--r--mozglue/linker/Elfxx.h8
-rw-r--r--mozglue/linker/Logging.h35
-rw-r--r--mozglue/linker/Mappable.cpp95
-rw-r--r--mozglue/misc/StackWalk.cpp31
-rw-r--r--mozglue/misc/TimeStamp_posix.cpp2
-rw-r--r--mozglue/moz.build3
-rw-r--r--netwerk/base/Tickler.h4
-rw-r--r--netwerk/base/nsIOService.cpp8
-rw-r--r--netwerk/base/nsNetUtil.cpp2
-rw-r--r--netwerk/base/nsSocketTransport2.cpp7
-rw-r--r--netwerk/base/nsSocketTransportService2.cpp15
-rw-r--r--netwerk/base/security-prefs.js21
-rw-r--r--netwerk/build/moz.build5
-rw-r--r--netwerk/build/nsNetModule.cpp9
-rw-r--r--netwerk/cache/nsCacheService.cpp15
-rw-r--r--netwerk/cache/nsDeleteDir.cpp30
-rw-r--r--netwerk/cache2/CacheFileIOManager.cpp70
-rw-r--r--netwerk/cache2/CacheFileIOManager.h10
-rw-r--r--netwerk/cache2/CacheStorageService.cpp13
-rw-r--r--netwerk/dns/mdns/libmdns/MulticastDNSAndroid.jsm244
-rw-r--r--netwerk/dns/mdns/libmdns/moz.build5
-rw-r--r--netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.js10
-rw-r--r--netwerk/protocol/device/AndroidCaptureProvider.cpp301
-rw-r--r--netwerk/protocol/device/AndroidCaptureProvider.h68
-rw-r--r--netwerk/protocol/device/CameraStreamImpl.cpp114
-rw-r--r--netwerk/protocol/device/CameraStreamImpl.h71
-rw-r--r--netwerk/protocol/device/moz.build9
-rw-r--r--netwerk/protocol/device/nsDeviceChannel.cpp13
-rw-r--r--netwerk/protocol/http/UserAgentOverrides.jsm48
-rw-r--r--netwerk/protocol/http/UserAgentUpdates.jsm41
-rw-r--r--netwerk/protocol/http/moz.build7
-rw-r--r--netwerk/protocol/http/nsHttpChannel.cpp13
-rw-r--r--netwerk/protocol/http/nsHttpHandler.cpp203
-rw-r--r--netwerk/protocol/http/nsHttpHandler.h2
-rw-r--r--netwerk/sctp/datachannel/moz.build4
-rw-r--r--netwerk/sctp/src/ifaddrs-android-ext.h62
-rw-r--r--netwerk/sctp/src/ifaddrs_android.cpp189
-rw-r--r--netwerk/sctp/src/moz.build14
-rwxr-xr-xnetwerk/sctp/src/netinet/sctp.h7
-rwxr-xr-xnetwerk/sctp/src/netinet/sctp_auth.c5
-rwxr-xr-xnetwerk/sctp/src/netinet/sctp_bsd_addr.c6
-rwxr-xr-xnetwerk/sctp/src/netinet/sctp_os_userspace.h2
-rwxr-xr-xnetwerk/sctp/src/netinet/sctp_pcb.c7
-rwxr-xr-xnetwerk/sctp/src/netinet/sctp_usrreq.c14
-rw-r--r--netwerk/system/android/moz.build14
-rw-r--r--netwerk/system/android/nsAndroidNetworkLinkService.cpp63
-rw-r--r--netwerk/system/android/nsAndroidNetworkLinkService.h24
-rw-r--r--netwerk/system/moz.build7
-rw-r--r--old-configure.in350
-rw-r--r--other-licenses/7zstub/ReleaseD/7zSD.sfx.exebin155136 -> 155136 bytes
-rw-r--r--other-licenses/7zstub/uxp/7zSD.sfxbin156672 -> 156672 bytes
-rw-r--r--other-licenses/skia-npapi/ANPCanvas.cpp199
-rw-r--r--other-licenses/skia-npapi/ANPPaint.cpp208
-rw-r--r--other-licenses/skia-npapi/ANPTypeface.cpp110
-rw-r--r--other-licenses/skia-npapi/SkANP.cpp107
-rw-r--r--other-licenses/skia-npapi/SkANP.h79
-rw-r--r--other-licenses/skia-npapi/moz.build31
-rw-r--r--parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java4
-rw-r--r--parser/html/nsHtml5TreeBuilder.cpp4
-rw-r--r--python/mozbuild/mozbuild/base.py7
-rw-r--r--python/mozbuild/mozbuild/mach_commands.py32
-rw-r--r--python/mozbuild/mozpack/packager/formats.py1
-rw-r--r--python/mozbuild/mozpack/test/test_packager_formats.py1
-rw-r--r--security/certverifier/NSSCertDBTrustDomain.cpp24
-rw-r--r--security/manager/ssl/PublicKeyPinningService.cpp333
-rw-r--r--security/manager/ssl/PublicKeyPinningService.h64
-rw-r--r--security/manager/ssl/SSLServerCertVerification.cpp23
-rw-r--r--security/manager/ssl/StaticHPKPins.h712
-rw-r--r--security/manager/ssl/moz.build6
-rw-r--r--security/manager/ssl/nsISiteSecurityService.idl58
-rw-r--r--security/manager/ssl/nsNSSComponent.cpp102
-rw-r--r--security/manager/ssl/nsSTSPreloadList.errors32629
-rw-r--r--security/manager/ssl/nsSTSPreloadList.inc59250
-rw-r--r--security/manager/ssl/nsSiteSecurityService.cpp716
-rw-r--r--security/manager/ssl/nsSiteSecurityService.h55
-rw-r--r--security/manager/ssl/tests/unit/test_pinning.js266
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic.js247
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-badca.pem18
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-badca.pem.certspec5
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-pinningroot.pem18
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-pinningroot.pem.certspec4
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-badca.pem18
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-badca.pem.certspec5
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-pinningroot.pem18
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-pinningroot.pem.certspec4
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-badca.pem18
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-badca.pem.certspec5
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-pinningroot.pem18
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-pinningroot.pem.certspec4
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-badca.pem18
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-badca.pem.certspec5
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-pinningroot.pem18
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-pinningroot.pem.certspec4
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/badca.pem17
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/badca.pem.certspec6
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/moz.build26
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/pinningroot.pem18
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/pinningroot.pem.certspec4
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-badca.pem18
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-badca.pem.certspec5
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-pinningroot.pem18
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-pinningroot.pem.certspec4
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-badca.pem18
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-badca.pem.certspec5
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-pinningroot.pem18
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-pinningroot.pem.certspec4
-rw-r--r--security/manager/ssl/tests/unit/test_pinning_header_parsing.js147
-rw-r--r--security/manager/ssl/tests/unit/test_sts_holepunch.js34
-rw-r--r--security/manager/ssl/tests/unit/xpcshell.ini9
-rw-r--r--security/manager/tools/PreloadedHPKPins.json222
-rw-r--r--security/manager/tools/genHPKPStaticPins.js630
-rw-r--r--security/manager/tools/getHSTSPreloadList.js458
-rw-r--r--security/nss/coreconf/SunOS5.mk2
-rw-r--r--services/sync/moz.build5
-rw-r--r--storage/SQLiteMutex.h2
-rw-r--r--storage/moz.build4
-rw-r--r--storage/mozStorageConnection.cpp6
-rw-r--r--testing/gtest/moz.build5
-rw-r--r--testing/marionette/cert.js1
-rw-r--r--testing/mochitest/runtests.py5
-rw-r--r--testing/mozharness/configs/unittests/linux_unittest.py3
-rw-r--r--testing/mozharness/configs/unittests/win_taskcluster_unittest.py2
-rw-r--r--testing/mozharness/configs/unittests/win_unittest.py2
-rw-r--r--testing/talos/talos/test.py4
-rw-r--r--testing/talos/talos/ttest.py2
-rw-r--r--testing/testsuite-targets.mk4
-rw-r--r--testing/web-platform/harness/wptrunner/browsers/firefox.py5
-rw-r--r--testing/web-platform/meta/MANIFEST.json4
-rw-r--r--testing/web-platform/tests/dom/events/event-disabled-dynamic.html21
-rw-r--r--toolkit/components/aboutcheckerboard/moz.build5
-rw-r--r--toolkit/components/aboutmemory/content/aboutMemory.css6
-rw-r--r--toolkit/components/aboutmemory/moz.build5
-rw-r--r--toolkit/components/aboutmemory/tests/.eslintrc.js7
-rw-r--r--toolkit/components/aboutmemory/tests/chrome.ini28
-rw-r--r--toolkit/components/aboutmemory/tests/crash-dump-diff1.json11
-rw-r--r--toolkit/components/aboutmemory/tests/crash-dump-diff2.json11
-rw-r--r--toolkit/components/aboutmemory/tests/crash-dump-good.json14
-rw-r--r--toolkit/components/aboutmemory/tests/memory-reports-bad.json3
-rw-r--r--toolkit/components/aboutmemory/tests/memory-reports-diff1.json45
-rw-r--r--toolkit/components/aboutmemory/tests/memory-reports-diff2.json44
-rw-r--r--toolkit/components/aboutmemory/tests/memory-reports-good.json29
-rw-r--r--toolkit/components/aboutmemory/tests/remote.xul12
-rw-r--r--toolkit/components/aboutmemory/tests/test_aboutmemory.xul602
-rw-r--r--toolkit/components/aboutmemory/tests/test_aboutmemory2.xul423
-rw-r--r--toolkit/components/aboutmemory/tests/test_aboutmemory3.xul515
-rw-r--r--toolkit/components/aboutmemory/tests/test_aboutmemory4.xul179
-rw-r--r--toolkit/components/aboutmemory/tests/test_aboutmemory5.xul167
-rw-r--r--toolkit/components/aboutmemory/tests/test_aboutmemory6.xul88
-rw-r--r--toolkit/components/aboutmemory/tests/test_dumpGCAndCCLogsToFile.xul98
-rw-r--r--toolkit/components/aboutmemory/tests/test_memoryReporters.xul424
-rw-r--r--toolkit/components/aboutmemory/tests/test_memoryReporters2.xul108
-rw-r--r--toolkit/components/aboutmemory/tests/test_sqliteMultiReporter.xul54
-rw-r--r--toolkit/components/aboutperformance/moz.build2
-rw-r--r--toolkit/components/aboutperformance/tests/browser/.eslintrc.js7
-rw-r--r--toolkit/components/aboutperformance/tests/browser/browser.ini8
-rw-r--r--toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js300
-rw-r--r--toolkit/components/aboutperformance/tests/browser/browser_compartments.html20
-rw-r--r--toolkit/components/aboutperformance/tests/browser/browser_compartments_frame.html12
-rw-r--r--toolkit/components/aboutperformance/tests/browser/browser_compartments_script.js29
-rw-r--r--toolkit/components/aboutperformance/tests/browser/head.js52
-rw-r--r--toolkit/components/addoncompat/moz.build2
-rw-r--r--toolkit/components/addoncompat/tests/addon/bootstrap.js653
-rw-r--r--toolkit/components/addoncompat/tests/addon/chrome.manifest1
-rw-r--r--toolkit/components/addoncompat/tests/addon/content/page.html2
-rw-r--r--toolkit/components/addoncompat/tests/addon/install.rdf37
-rw-r--r--toolkit/components/addoncompat/tests/browser/.eslintrc.js7
-rw-r--r--toolkit/components/addoncompat/tests/browser/addon.xpibin10761 -> 0 bytes
-rw-r--r--toolkit/components/addoncompat/tests/browser/browser.ini9
-rw-r--r--toolkit/components/addoncompat/tests/browser/browser_addonShims.js67
-rw-r--r--toolkit/components/addoncompat/tests/browser/browser_addonShims_testpage.html17
-rw-r--r--toolkit/components/addoncompat/tests/browser/browser_addonShims_testpage2.html16
-rw-r--r--toolkit/components/addoncompat/tests/browser/compat-addon.xpibin5692 -> 0 bytes
-rw-r--r--toolkit/components/addoncompat/tests/compat-addon/bootstrap.js99
-rw-r--r--toolkit/components/addoncompat/tests/compat-addon/install.rdf37
-rw-r--r--toolkit/components/addoncompat/tests/moz.build7
-rw-r--r--toolkit/components/alerts/jar.mn2
-rw-r--r--toolkit/components/alerts/moz.build9
-rw-r--r--toolkit/components/alerts/nsAlertsService.cpp8
-rw-r--r--toolkit/components/alerts/nsXULAlerts.cpp3
-rw-r--r--toolkit/components/alerts/resources/content/alert.js12
-rw-r--r--toolkit/components/alerts/test/.eslintrc.js7
-rw-r--r--toolkit/components/alerts/test/image.gifbin60901 -> 0 bytes
-rw-r--r--toolkit/components/alerts/test/image.pngbin2531 -> 0 bytes
-rw-r--r--toolkit/components/alerts/test/image_server.sjs82
-rw-r--r--toolkit/components/alerts/test/mochitest.ini16
-rw-r--r--toolkit/components/alerts/test/test_alerts.html89
-rw-r--r--toolkit/components/alerts/test/test_alerts_noobserve.html96
-rw-r--r--toolkit/components/alerts/test/test_alerts_requireinteraction.html168
-rw-r--r--toolkit/components/alerts/test/test_image.html118
-rw-r--r--toolkit/components/alerts/test/test_multiple_alerts.html103
-rw-r--r--toolkit/components/alerts/test/test_principal.html122
-rw-r--r--toolkit/components/apppicker/content/appPicker.js40
-rw-r--r--toolkit/components/apppicker/jar.mn2
-rw-r--r--toolkit/components/asyncshutdown/moz.build14
-rw-r--r--toolkit/components/asyncshutdown/tests/xpcshell/.eslintrc.js7
-rw-r--r--toolkit/components/asyncshutdown/tests/xpcshell/head.js174
-rw-r--r--toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown.js194
-rw-r--r--toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown_leave_uncaught.js96
-rw-r--r--toolkit/components/asyncshutdown/tests/xpcshell/test_converters.js88
-rw-r--r--toolkit/components/asyncshutdown/tests/xpcshell/xpcshell.ini8
-rw-r--r--toolkit/components/autocomplete/moz.build5
-rw-r--r--toolkit/components/autocomplete/tests/unit/.eslintrc.js7
-rw-r--r--toolkit/components/autocomplete/tests/unit/head_autocomplete.js211
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_330578.js45
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_378079.js285
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_393191.js272
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_440866.js285
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_463023.js12
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_660156.js101
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_autocomplete_multiple.js276
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_autocomplete_userContextId.js45
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_autofillSelectedPopupIndex.js78
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_badDefaultIndex.js96
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_completeDefaultIndex_casing.js63
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_finalCompleteValue.js48
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_finalCompleteValueSelectedIndex.js119
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_defaultIndex.js107
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_forceComplete.js104
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_finalDefaultCompleteValue.js66
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_hiddenResult.js76
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_immediate_search.js157
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_insertMatchAt.js14
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_popupSelectionVsDefaultCompleteValue.js71
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_previousResult.js280
-rw-r--r--toolkit/components/autocomplete/tests/unit/test_stopSearch.js187
-rw-r--r--toolkit/components/autocomplete/tests/unit/xpcshell.ini26
-rw-r--r--toolkit/components/blocklist/nsBlocklistService.js3
-rw-r--r--toolkit/components/build/nsToolkitCompsCID.h4
-rw-r--r--toolkit/components/build/nsToolkitCompsModule.cpp15
-rw-r--r--toolkit/components/captivedetect/moz.build7
-rw-r--r--toolkit/components/captivedetect/test/unit/.eslintrc.js7
-rw-r--r--toolkit/components/captivedetect/test/unit/head_setprefs.js49
-rw-r--r--toolkit/components/captivedetect/test/unit/test_abort.js53
-rw-r--r--toolkit/components/captivedetect/test/unit/test_abort_during_user_login.js66
-rw-r--r--toolkit/components/captivedetect/test/unit/test_abort_ongoing_request.js72
-rw-r--r--toolkit/components/captivedetect/test/unit/test_abort_pending_request.js71
-rw-r--r--toolkit/components/captivedetect/test/unit/test_captive_portal_found.js67
-rw-r--r--toolkit/components/captivedetect/test/unit/test_captive_portal_found_303.js74
-rw-r--r--toolkit/components/captivedetect/test/unit/test_captive_portal_not_found.js52
-rw-r--r--toolkit/components/captivedetect/test/unit/test_captive_portal_not_found_404.js49
-rw-r--r--toolkit/components/captivedetect/test/unit/test_multiple_requests.js83
-rw-r--r--toolkit/components/captivedetect/test/unit/test_user_cancel.js54
-rw-r--r--toolkit/components/captivedetect/test/unit/xpcshell.ini15
-rw-r--r--toolkit/components/commandlines/moz.build14
-rw-r--r--toolkit/components/commandlines/test/unit/.eslintrc.js7
-rw-r--r--toolkit/components/commandlines/test/unit/data/test_bug410156.desktop7
-rw-r--r--toolkit/components/commandlines/test/unit/data/test_bug410156.url9
-rw-r--r--toolkit/components/commandlines/test/unit/test_bug666224.js6
-rw-r--r--toolkit/components/commandlines/test/unit/test_classinfo.js9
-rw-r--r--toolkit/components/commandlines/test/unit/xpcshell.ini10
-rw-r--r--toolkit/components/commandlines/test/unit_unix/.eslintrc.js7
-rw-r--r--toolkit/components/commandlines/test/unit_unix/test_bug410156.js11
-rw-r--r--toolkit/components/commandlines/test/unit_unix/xpcshell.ini9
-rw-r--r--toolkit/components/commandlines/test/unit_win/.eslintrc.js7
-rw-r--r--toolkit/components/commandlines/test/unit_win/test_bug410156.js11
-rw-r--r--toolkit/components/commandlines/test/unit_win/xpcshell.ini8
-rw-r--r--toolkit/components/console/moz.build2
-rw-r--r--toolkit/components/console/tests/chrome.ini3
-rw-r--r--toolkit/components/console/tests/test_hugeURIs.xul64
-rw-r--r--toolkit/components/contentprefs/moz.build12
-rw-r--r--toolkit/components/contentprefs/tests/mochitest/.eslintrc.js7
-rw-r--r--toolkit/components/contentprefs/tests/mochitest/mochitest.ini4
-rw-r--r--toolkit/components/contentprefs/tests/mochitest/test_remoteContentPrefs.html311
-rw-r--r--toolkit/components/contentprefs/tests/unit/.eslintrc.js7
-rw-r--r--toolkit/components/contentprefs/tests/unit/head_contentPrefs.js162
-rw-r--r--toolkit/components/contentprefs/tests/unit/tail_contentPrefs.js6
-rw-r--r--toolkit/components/contentprefs/tests/unit/test_bug248970.js42
-rw-r--r--toolkit/components/contentprefs/tests/unit/test_bug503971.js35
-rw-r--r--toolkit/components/contentprefs/tests/unit/test_bug679784.js103
-rw-r--r--toolkit/components/contentprefs/tests/unit/test_contentPrefs.js463
-rw-r--r--toolkit/components/contentprefs/tests/unit/test_contentPrefsCache.js244
-rw-r--r--toolkit/components/contentprefs/tests/unit/test_getPrefAsync.js34
-rw-r--r--toolkit/components/contentprefs/tests/unit/test_stringGroups.js128
-rw-r--r--toolkit/components/contentprefs/tests/unit/test_unusedGroupsAndSettings.js52
-rw-r--r--toolkit/components/contentprefs/tests/unit/xpcshell.ini12
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/.eslintrc.js7
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/AsyncRunner.jsm69
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/head.js401
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/test_extractDomain.js20
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/test_getCached.js95
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/test_getCachedSubdomains.js186
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/test_getSubdomains.js68
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/test_migrationToSchema4.js82
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/test_observers.js178
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/test_remove.js222
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/test_removeAllDomains.js87
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/test_removeAllDomainsSince.js111
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/test_removeByDomain.js199
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/test_removeByName.js96
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/test_service.js12
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/test_setGet.js206
-rw-r--r--toolkit/components/contentprefs/tests/unit_cps2/xpcshell.ini19
-rw-r--r--toolkit/components/contextualidentity/moz.build6
-rw-r--r--toolkit/components/contextualidentity/tests/unit/test_basic.js67
-rw-r--r--toolkit/components/contextualidentity/tests/unit/xpcshell.ini3
-rw-r--r--toolkit/components/crashes/moz.build5
-rw-r--r--toolkit/components/crashes/tests/xpcshell/.eslintrc.js7
-rw-r--r--toolkit/components/crashes/tests/xpcshell/test_crash_manager.js494
-rw-r--r--toolkit/components/crashes/tests/xpcshell/test_crash_service.js31
-rw-r--r--toolkit/components/crashes/tests/xpcshell/test_crash_store.js587
-rw-r--r--toolkit/components/crashes/tests/xpcshell/xpcshell.ini8
-rw-r--r--toolkit/components/crashmonitor/moz.build2
-rw-r--r--toolkit/components/crashmonitor/test/unit/.eslintrc.js7
-rw-r--r--toolkit/components/crashmonitor/test/unit/head.js22
-rw-r--r--toolkit/components/crashmonitor/test/unit/test_init.js17
-rw-r--r--toolkit/components/crashmonitor/test/unit/test_invalid_file.js22
-rw-r--r--toolkit/components/crashmonitor/test/unit/test_invalid_json.js18
-rw-r--r--toolkit/components/crashmonitor/test/unit/test_missing_file.js13
-rw-r--r--toolkit/components/crashmonitor/test/unit/test_register.js24
-rw-r--r--toolkit/components/crashmonitor/test/unit/test_valid_file.js20
-rw-r--r--toolkit/components/crashmonitor/test/unit/xpcshell.ini11
-rw-r--r--toolkit/components/ctypes/moz.build17
-rw-r--r--toolkit/components/ctypes/tests/chrome/.eslintrc.js7
-rw-r--r--toolkit/components/ctypes/tests/chrome/chrome.ini8
-rw-r--r--toolkit/components/ctypes/tests/chrome/ctypes_worker.js14
-rw-r--r--toolkit/components/ctypes/tests/chrome/test_ctypes.xul106
-rw-r--r--toolkit/components/ctypes/tests/chrome/xpcshellTestHarnessAdaptor.js100
-rw-r--r--toolkit/components/ctypes/tests/jsctypes-test-errno.cpp41
-rw-r--r--toolkit/components/ctypes/tests/jsctypes-test-errno.h21
-rw-r--r--toolkit/components/ctypes/tests/jsctypes-test-finalizer.cpp323
-rw-r--r--toolkit/components/ctypes/tests/jsctypes-test-finalizer.h57
-rw-r--r--toolkit/components/ctypes/tests/jsctypes-test.cpp394
-rw-r--r--toolkit/components/ctypes/tests/jsctypes-test.h197
-rw-r--r--toolkit/components/ctypes/tests/moz.build30
-rw-r--r--toolkit/components/ctypes/tests/unit/.eslintrc.js7
-rw-r--r--toolkit/components/ctypes/tests/unit/head.js128
-rw-r--r--toolkit/components/ctypes/tests/unit/test_errno.js69
-rw-r--r--toolkit/components/ctypes/tests/unit/test_finalizer.js452
-rw-r--r--toolkit/components/ctypes/tests/unit/test_finalizer_shouldaccept.js174
-rw-r--r--toolkit/components/ctypes/tests/unit/test_finalizer_shouldfail.js176
-rw-r--r--toolkit/components/ctypes/tests/unit/test_jsctypes.js2808
-rw-r--r--toolkit/components/ctypes/tests/unit/xpcshell.ini13
-rw-r--r--toolkit/components/downloads/moz.build29
-rw-r--r--toolkit/components/downloads/nsDownloadManager.cpp50
-rw-r--r--toolkit/components/downloads/test/unit/.eslintrc.js7
-rw-r--r--toolkit/components/downloads/test/unit/data/block_digest.chunk2
-rw-r--r--toolkit/components/downloads/test/unit/data/digest.chunk3
-rw-r--r--toolkit/components/downloads/test/unit/data/signed_win.exebin61064 -> 0 bytes
-rw-r--r--toolkit/components/downloads/test/unit/head_download_manager.js26
-rw-r--r--toolkit/components/downloads/test/unit/tail_download_manager.js23
-rw-r--r--toolkit/components/downloads/test/unit/test_app_rep.js342
-rw-r--r--toolkit/components/downloads/test/unit/test_app_rep_maclinux.js303
-rw-r--r--toolkit/components/downloads/test/unit/test_app_rep_windows.js434
-rw-r--r--toolkit/components/downloads/test/unit/xpcshell.ini14
-rw-r--r--toolkit/components/exthelper/moz.build4
-rw-r--r--toolkit/components/feeds/moz.build6
-rw-r--r--toolkit/components/feeds/test/.eslintrc.js8
-rw-r--r--toolkit/components/feeds/test/chrome.ini3
-rw-r--r--toolkit/components/feeds/test/head.js80
-rw-r--r--toolkit/components/feeds/test/test_bug675492.xul31
-rw-r--r--toolkit/components/feeds/test/test_xml.js97
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/author_namespaces.xml16
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_author.xml30
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_content.xml35
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_content_encoded.xml43
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_content_html.xml35
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_content_xhtml.xml39
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_content_xhtml_with_markup.xml39
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_contributor.xml30
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_html_cdata.xml28
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_id.xml35
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_link_2alts.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_link_2alts_allcore.xml28
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_link_2alts_allcore2.xml33
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_link_IANA.xml29
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_link_alt_extension.xml25
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_link_enclosure.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_link_enclosure_populate_enclosures.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_link_otherURI_alt.xml25
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_link_payment_alt.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_link_random.xml28
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_published.xml28
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_rights_normalized.xml17
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_summary.xml40
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_title.xml35
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_title_normalized.xml35
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_updated.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_w_content_encoded.xml43
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_xhtml_baseURI_with_amp.xml37
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_xmlBase.xml21
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/entry_xmlBase_on_link.xml22
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_atom_rights_xhtml.xml18
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_author.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_author2.xml14
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_author_email.xml14
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_author_email_2.xml18
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_author_name.xml13
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_author_surrounded.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_author_uri.xml20
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_comment_rss_extra_att.xml29
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_contributor.xml20
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_entry_count.xml14
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_generator.xml33
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_generator_uri.xml33
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_generator_uri_xmlbase.xml33
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_generator_version.xml33
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_icon.xml11
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_id.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_id_extra_att.xml28
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_logo.xml11
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_random_attributes_on_feed_and_entry.xml30
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_rights_normalized.xml15
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_rights_xhtml.xml15
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_rights_xhtml_nested_divs.xml15
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_subtitle.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_tantek_title.xml46
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_title.xml10
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_title_full_feed.xml936
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_title_xhtml.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_title_xhtml_entities.xml14
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_updated.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_updated_invalid.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_updated_normalized.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_version.xml9
-rw-r--r--toolkit/components/feeds/test/xml/rfc4287/feed_xmlBase.xml23
-rw-r--r--toolkit/components/feeds/test/xml/rss09x/rss090.xml50
-rw-r--r--toolkit/components/feeds/test/xml/rss09x/rss091.xml28
-rw-r--r--toolkit/components/feeds/test/xml/rss09x/rss091_withNS.xml28
-rw-r--r--toolkit/components/feeds/test/xml/rss09x/rss092.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rss09x/rss093.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rss09x/rss094.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rss09x/rssUnknown.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_bogus_title.xml45
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_description.xml17
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_description_normalized.xml17
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_description_with_dc.xml19
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_description_with_dc_only.xml17
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_generator.xml34
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_id.xml25
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_image.xml39
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_items_length_zero.xml17
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_link.xml16
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_link_normalized.xml16
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_textInput.xml40
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_title.xml15
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_title_extra_att.xml16
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_title_normalized.xml15
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_updated.xml26
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_updated_dctermsmodified.xml27
-rw-r--r--toolkit/components/feeds/test/xml/rss1/feed_version.xml14
-rw-r--r--toolkit/components/feeds/test/xml/rss1/full_feed.xml41
-rw-r--r--toolkit/components/feeds/test/xml/rss1/full_feed_not_bozo.xml354
-rw-r--r--toolkit/components/feeds/test/xml/rss1/full_feed_unknown_extension.xml55
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_2_dc_description.xml34
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_2_dc_publisher.xml35
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_2_dc_publisher_extra_att_invalid_rdf.xml36
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_count.xml32
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_dc_creator.xml34
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_dc_description.xml35
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_dc_description_normalized.xml37
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_description.xml31
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_id.xml32
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_link.xml32
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_link_normalized.xml32
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_title.xml31
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_title_normalized.xml32
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_updated_dcterms.xml28
-rw-r--r--toolkit/components/feeds/test/xml/rss1/item_wiki_importance_extra_att.xml34
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_category.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_category_count.xml15
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_cloud.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_copyright.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_copyright_linebreak.xml15
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_data_outside_channel.xml13
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_dc_contributor.xml14
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_dc_creator.xml13
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_description.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_description_html.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_description_html_cdata.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_docs.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_generator.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_image_desc.xml17
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_image_desc_width_height.xml19
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_image_required.xml16
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_language.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_lastBuildDate.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_linebreak_link.xml14
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_link.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_link_cdata.xml14
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_managingEditor.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_managingEditor_extra_att.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_multiple_categories.xml15
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_pubDate.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_pubDate_invalid.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_1.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_2.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_pubDate_timezoneZ.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_pubDate_utc.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_rating.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_single_quote_stylesheet_pi.xml26
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_skipDays.xml15
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_skipHours.xml18
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_subtitle.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_subtitle_html.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_subtitle_markup_stripped.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_textinput.xml17
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_title.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_title_cdata_mixed.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_title_nesting.xml13
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_ttl.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_updated.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_updated_dcdate.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate_priority.xml13
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_webMaster.xml12
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_wfw_commentapi.xml15
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_wfw_commentrss.xml15
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_wiki.xml18
-rw-r--r--toolkit/components/feeds/test/xml/rss2/feed_wiki_unusual_prefix.xml18
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_author.xml15
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_category.xml16
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_comments.xml19
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_content_encoded.xml15
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_count.xml26
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_count2.xml30
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_description.xml18
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_description_2.xml21
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_description_cdata.xml20
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_description_decode_entities.xml21
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_description_normalized.xml18
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_description_normalized_nohtml.xml18
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_enclosure.xml21
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates.xml24
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates2.xml24
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed.xml33
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed2.xml33
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_guid.xml21
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_guid_bogus_url.xml21
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink.xml20
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_default.xml20
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false.xml20
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false_uppercase.xml20
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_true_uppercase.xml20
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_unknown_value.xml20
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_guid_normalized.xml21
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_guid_with_link.xml22
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_link.xml19
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_link_normalized.xml19
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_plain_desc.xml19
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_populated_enclosures.xml21
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_pubDate.xml14
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_published.xml14
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_title.xml14
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_title_normalized.xml14
-rw-r--r--toolkit/components/feeds/test/xml/rss2/item_updated_dcdate.xml14
-rw-r--r--toolkit/components/feeds/test/xml/rss2/items_2_titles.xml17
-rw-r--r--toolkit/components/feeds/test/xml/rss2/mrss_content.xml21
-rw-r--r--toolkit/components/feeds/test/xml/rss2/mrss_content2.xml22
-rw-r--r--toolkit/components/feeds/test/xml/rss2/mrss_content_429049.xml32
-rw-r--r--toolkit/components/feeds/test/xml/rss2/mrss_content_multiple.xml23
-rw-r--r--toolkit/components/feeds/test/xml/rss2/mrss_content_populate_enclosure.xml21
-rw-r--r--toolkit/components/feeds/test/xml/rss2/mrss_group_content.xml26
-rw-r--r--toolkit/components/feeds/test/xml/rss2/mrss_group_content_populate_enclosure.xml26
-rw-r--r--toolkit/components/feeds/test/xpcshell.ini209
-rw-r--r--toolkit/components/filepicker/moz.build24
-rw-r--r--toolkit/components/filepicker/test/unit/.eslintrc.js7
-rw-r--r--toolkit/components/filepicker/test/unit/test_filecomplete.js45
-rw-r--r--toolkit/components/filepicker/test/unit/xpcshell.ini7
-rw-r--r--toolkit/components/filewatcher/moz.build14
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/.eslintrc.js7
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/head.js29
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/test_arguments.js79
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/test_no_error_callback.js69
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/test_remove_non_watched.js39
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/test_shared_callback.js62
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/test_watch_directory_creation_single.js49
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/test_watch_directory_deletion_single.js46
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/test_watch_file_creation_single.js51
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/test_watch_file_deletion_single.js54
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/test_watch_file_modification_single.js54
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/test_watch_many_changes.js73
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/test_watch_multi_paths.js114
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/test_watch_recursively.js55
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/test_watch_resource.js32
-rw-r--r--toolkit/components/filewatcher/tests/xpcshell/xpcshell.ini18
-rw-r--r--toolkit/components/formautofill/moz.build28
-rw-r--r--toolkit/components/formautofill/test/browser/.eslintrc.js7
-rw-r--r--toolkit/components/formautofill/test/browser/browser.ini10
-rw-r--r--toolkit/components/formautofill/test/browser/browser_infrastructure.js48
-rw-r--r--toolkit/components/formautofill/test/browser/browser_ui_requestAutocomplete.js48
-rw-r--r--toolkit/components/formautofill/test/browser/head.js18
-rw-r--r--toolkit/components/formautofill/test/browser/loader.js38
-rw-r--r--toolkit/components/formautofill/test/chrome/.eslintrc.js7
-rw-r--r--toolkit/components/formautofill/test/chrome/chrome.ini17
-rw-r--r--toolkit/components/formautofill/test/chrome/head.js15
-rw-r--r--toolkit/components/formautofill/test/chrome/loader.js116
-rw-r--r--toolkit/components/formautofill/test/chrome/loader_parent.js77
-rw-r--r--toolkit/components/formautofill/test/chrome/test_infrastructure.html8
-rw-r--r--toolkit/components/formautofill/test/chrome/test_infrastructure.js61
-rw-r--r--toolkit/components/formautofill/test/chrome/test_requestAutocomplete_cancel.html9
-rw-r--r--toolkit/components/formautofill/test/chrome/test_requestAutocomplete_cancel.js26
-rw-r--r--toolkit/components/formautofill/test/head_common.js245
-rw-r--r--toolkit/components/formautofill/test/loader_common.js120
-rw-r--r--toolkit/components/formautofill/test/xpcshell/.eslintrc.js7
-rw-r--r--toolkit/components/formautofill/test/xpcshell/head.js23
-rw-r--r--toolkit/components/formautofill/test/xpcshell/loader.js46
-rw-r--r--toolkit/components/formautofill/test/xpcshell/test_infrastructure.js48
-rw-r--r--toolkit/components/formautofill/test/xpcshell/test_integration.js72
-rw-r--r--toolkit/components/formautofill/test/xpcshell/xpcshell.ini12
-rw-r--r--toolkit/components/jsdownloads/moz.build11
-rw-r--r--toolkit/components/jsdownloads/src/DownloadIntegration.jsm38
-rw-r--r--toolkit/components/jsdownloads/src/DownloadPlatform.cpp16
-rw-r--r--toolkit/components/jsdownloads/src/DownloadUIHelper.jsm23
-rw-r--r--toolkit/components/jsdownloads/src/moz.build2
-rw-r--r--toolkit/components/jsdownloads/test/browser/.eslintrc.js7
-rw-r--r--toolkit/components/jsdownloads/test/browser/browser.ini7
-rw-r--r--toolkit/components/jsdownloads/test/browser/browser_DownloadPDFSaver.js97
-rw-r--r--toolkit/components/jsdownloads/test/browser/head.js87
-rw-r--r--toolkit/components/jsdownloads/test/browser/testFile.html9
-rw-r--r--toolkit/components/jsdownloads/test/data/.eslintrc.js7
-rw-r--r--toolkit/components/jsdownloads/test/data/empty.txt0
-rw-r--r--toolkit/components/jsdownloads/test/data/source.txt1
-rw-r--r--toolkit/components/jsdownloads/test/unit/.eslintrc.js7
-rw-r--r--toolkit/components/jsdownloads/test/unit/common_test_Download.js2432
-rw-r--r--toolkit/components/jsdownloads/test/unit/head.js843
-rw-r--r--toolkit/components/jsdownloads/test/unit/test_DownloadCore.js87
-rw-r--r--toolkit/components/jsdownloads/test/unit/test_DownloadImport.js701
-rw-r--r--toolkit/components/jsdownloads/test/unit/test_DownloadIntegration.js432
-rw-r--r--toolkit/components/jsdownloads/test/unit/test_DownloadLegacy.js17
-rw-r--r--toolkit/components/jsdownloads/test/unit/test_DownloadList.js564
-rw-r--r--toolkit/components/jsdownloads/test/unit/test_DownloadStore.js315
-rw-r--r--toolkit/components/jsdownloads/test/unit/test_Downloads.js194
-rw-r--r--toolkit/components/jsdownloads/test/unit/test_PrivateTemp.js24
-rw-r--r--toolkit/components/jsdownloads/test/unit/xpcshell.ini19
-rw-r--r--toolkit/components/lz4/moz.build6
-rw-r--r--toolkit/components/lz4/tests/xpcshell/.eslintrc.js7
-rw-r--r--toolkit/components/lz4/tests/xpcshell/data/chrome.manifest1
-rw-r--r--toolkit/components/lz4/tests/xpcshell/data/compression.lzbin23 -> 0 bytes
-rw-r--r--toolkit/components/lz4/tests/xpcshell/data/worker_lz4.js146
-rw-r--r--toolkit/components/lz4/tests/xpcshell/test_lz4.js43
-rw-r--r--toolkit/components/lz4/tests/xpcshell/test_lz4_sync.js41
-rw-r--r--toolkit/components/lz4/tests/xpcshell/xpcshell.ini11
-rw-r--r--toolkit/components/mediasniffer/moz.build9
-rw-r--r--toolkit/components/mediasniffer/test/unit/.eslintrc.js7
-rw-r--r--toolkit/components/mediasniffer/test/unit/data/bug1079747.mp4bin512 -> 0 bytes
-rw-r--r--toolkit/components/mediasniffer/test/unit/data/detodos.mp3bin512 -> 0 bytes
-rw-r--r--toolkit/components/mediasniffer/test/unit/data/ff-inst.exebin512 -> 0 bytes
-rw-r--r--toolkit/components/mediasniffer/test/unit/data/file.mkvbin512 -> 0 bytes
-rw-r--r--toolkit/components/mediasniffer/test/unit/data/file.webmbin512 -> 0 bytes
-rw-r--r--toolkit/components/mediasniffer/test/unit/data/fl10.mp2bin512 -> 0 bytes
-rw-r--r--toolkit/components/mediasniffer/test/unit/data/he_free.mp3bin512 -> 0 bytes
-rw-r--r--toolkit/components/mediasniffer/test/unit/data/id3tags.mp3bin512 -> 0 bytes
-rw-r--r--toolkit/components/mediasniffer/test/unit/data/notags-bad.mp3bin512 -> 0 bytes
-rw-r--r--toolkit/components/mediasniffer/test/unit/data/notags-scan.mp3bin512 -> 0 bytes
-rw-r--r--toolkit/components/mediasniffer/test/unit/data/notags.mp3bin512 -> 0 bytes
-rw-r--r--toolkit/components/mediasniffer/test/unit/test_mediasniffer.js105
-rw-r--r--toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js122
-rw-r--r--toolkit/components/mediasniffer/test/unit/xpcshell.ini19
-rw-r--r--toolkit/components/microformats/manifest.ini7
-rw-r--r--toolkit/components/microformats/moz.build7
-rw-r--r--toolkit/components/microformats/test/interface-tests/count-test.js107
-rw-r--r--toolkit/components/microformats/test/interface-tests/experimental-test.js37
-rw-r--r--toolkit/components/microformats/test/interface-tests/get-test.js605
-rw-r--r--toolkit/components/microformats/test/interface-tests/getParent-test.js220
-rw-r--r--toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js185
-rw-r--r--toolkit/components/microformats/test/interface-tests/index.html69
-rw-r--r--toolkit/components/microformats/test/interface-tests/isMicroformat-test.js146
-rw-r--r--toolkit/components/microformats/test/lib/dates.js268
-rw-r--r--toolkit/components/microformats/test/lib/domparser.js103
-rw-r--r--toolkit/components/microformats/test/lib/domutils.js611
-rw-r--r--toolkit/components/microformats/test/lib/html.js107
-rw-r--r--toolkit/components/microformats/test/lib/isodate.js481
-rw-r--r--toolkit/components/microformats/test/lib/living-standard.js1
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-adr.js29
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-card.js85
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-entry.js52
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-event.js64
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-feed.js36
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-geo.js22
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-item.js30
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-listing.js41
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-news.js42
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-org.js24
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-product.js49
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-recipe.js47
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-resume.js34
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-review-aggregate.js40
-rw-r--r--toolkit/components/microformats/test/lib/maps/h-review.js46
-rw-r--r--toolkit/components/microformats/test/lib/maps/rel.js47
-rw-r--r--toolkit/components/microformats/test/lib/parser-implied.js439
-rw-r--r--toolkit/components/microformats/test/lib/parser-includes.js150
-rw-r--r--toolkit/components/microformats/test/lib/parser-rels.js200
-rw-r--r--toolkit/components/microformats/test/lib/parser.js1453
-rw-r--r--toolkit/components/microformats/test/lib/text.js151
-rw-r--r--toolkit/components/microformats/test/lib/url.js73
-rw-r--r--toolkit/components/microformats/test/lib/utilities.js206
-rw-r--r--toolkit/components/microformats/test/lib/version.js1
-rw-r--r--toolkit/components/microformats/test/marionette/microformats_tester.py170
-rw-r--r--toolkit/components/microformats/test/marionette/test_interface.py17
-rw-r--r--toolkit/components/microformats/test/marionette/test_modules.py17
-rw-r--r--toolkit/components/microformats/test/marionette/test_standards.py17
-rw-r--r--toolkit/components/microformats/test/module-tests/dates-test.js113
-rw-r--r--toolkit/components/microformats/test/module-tests/domutils-test.js206
-rw-r--r--toolkit/components/microformats/test/module-tests/html-test.js50
-rw-r--r--toolkit/components/microformats/test/module-tests/index.html76
-rw-r--r--toolkit/components/microformats/test/module-tests/isodate-test.js145
-rw-r--r--toolkit/components/microformats/test/module-tests/text-test.js56
-rw-r--r--toolkit/components/microformats/test/module-tests/url-test.js25
-rw-r--r--toolkit/components/microformats/test/module-tests/utilities-test.js93
-rw-r--r--toolkit/components/microformats/test/standards-tests/index.html179
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-mixedpropertries.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-tworoots.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-mixed-h-entry-mixedroots.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-mixed-h-resume-mixedroots.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-adr-simpleproperties.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-geo-abbrpattern.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-geo-hidden.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-geo-simpleproperties.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-geo-valuetitleclass.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-ampm.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-attendees.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-combining.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-concatenate.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-time.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hcard-email.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hcard-format.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hcard-hyperlinkedphoto.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justahyperlink.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justaname.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hcard-multiple.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hcard-name.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hcard-single.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hentry-summarycontent.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hfeed-simple.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hnews-all.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hnews-minimum.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-aggregate.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-simpleproperties.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hresume-affiliation.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hresume-contact.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hresume-education.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hresume-skill.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hresume-work.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-hcard.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-justahyperlink.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-vevent.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hreview-item.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-hreview-vcard.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-includes-hcarditemref.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-includes-heventitemref.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-includes-hyperlink.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-includes-object.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v1-includes-table.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geo.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geourl.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-justaname.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-simpleproperties.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-baseurl.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-childimplied.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-extendeddescription.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hcard.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-horghcard.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hyperlinkedphoto.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedname.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedphoto.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedurl.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justahyperlink.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justaname.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-nested.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-p-property.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-card-relativeurls.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-impliedvalue-nested.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justahyperlink.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justaname.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-summarycontent.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-u-property.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-urlincontent.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-event-ampm.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-event-attendees.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-event-combining.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-event-concatenate.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dates.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dt-property.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justahyperlink.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justaname.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-event-time.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-implied-title.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-simple.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-abbrpattern.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-altitude.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-hidden.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-justaname.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-simpleproperties.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-valuetitleclass.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-news-all.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-news-minimum.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-org-hyperlink.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simple.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simpleproperties.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-product-aggregate.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justahyperlink.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justaname.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-product-simpleproperties.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-all.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-minimum.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-affiliation.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-contact.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-education.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-justaname.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-skill.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-work.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-hevent.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-justahyperlink.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-simpleproperties.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-review-hyperlink.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-review-implieditem.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-review-item.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-review-justaname.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-review-photo.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-h-review-vcard.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-rel-duplicate-rels.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-rel-license.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-rel-nofollow.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-rel-rel-urls.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-rel-varying-text-duplicate-rels.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-all.js27
-rw-r--r--toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-elsewhere.js27
-rw-r--r--toolkit/components/microformats/test/static/count.html84
-rw-r--r--toolkit/components/microformats/test/static/css/mocha-custom.css9
-rw-r--r--toolkit/components/microformats/test/static/css/mocha.css270
-rw-r--r--toolkit/components/microformats/test/static/css/prettify.css65
-rw-r--r--toolkit/components/microformats/test/static/css/testrunner.css367
-rw-r--r--toolkit/components/microformats/test/static/images/logo.gifbin2943 -> 0 bytes
-rw-r--r--toolkit/components/microformats/test/static/images/photo.gifbin2943 -> 0 bytes
-rw-r--r--toolkit/components/microformats/test/static/javascript/DOMParser.js99
-rw-r--r--toolkit/components/microformats/test/static/javascript/beautify.js518
-rw-r--r--toolkit/components/microformats/test/static/javascript/chai.js5351
-rw-r--r--toolkit/components/microformats/test/static/javascript/count.js62
-rw-r--r--toolkit/components/microformats/test/static/javascript/data.js1
-rw-r--r--toolkit/components/microformats/test/static/javascript/deep-diff-0.3.1.min.js5
-rw-r--r--toolkit/components/microformats/test/static/javascript/mocha.js6573
-rw-r--r--toolkit/components/microformats/test/static/javascript/parse.js133
-rw-r--r--toolkit/components/microformats/test/static/javascript/prettify.js1479
-rw-r--r--toolkit/components/microformats/test/static/javascript/testrunner.js179
-rw-r--r--toolkit/components/microformats/test/static/parse-umd.html85
-rw-r--r--toolkit/components/microformats/test/static/parse.html127
-rw-r--r--toolkit/components/microformats/test/static/testrunner.html69
-rw-r--r--toolkit/components/moz.build20
-rw-r--r--toolkit/components/mozintl/moz.build10
-rw-r--r--toolkit/components/mozintl/test/test_mozintl.js46
-rw-r--r--toolkit/components/mozintl/test/xpcshell.ini5
-rw-r--r--toolkit/components/mozprotocol/moz.build4
-rw-r--r--toolkit/components/mozprotocol/mozProtocolHandler.js2
-rw-r--r--toolkit/components/mozprotocol/tests/browser.ini5
-rw-r--r--toolkit/components/mozprotocol/tests/browser_mozprotocol.js14
-rw-r--r--toolkit/components/mozprotocol/tests/mozprotocol.html7
-rw-r--r--toolkit/components/narrate/moz.build2
-rw-r--r--toolkit/components/narrate/test/.eslintrc.js23
-rw-r--r--toolkit/components/narrate/test/NarrateTestUtils.jsm148
-rw-r--r--toolkit/components/narrate/test/browser.ini12
-rw-r--r--toolkit/components/narrate/test/browser_narrate.js137
-rw-r--r--toolkit/components/narrate/test/browser_narrate_disable.js37
-rw-r--r--toolkit/components/narrate/test/browser_narrate_language.js73
-rw-r--r--toolkit/components/narrate/test/browser_voiceselect.js112
-rw-r--r--toolkit/components/narrate/test/browser_word_highlight.js69
-rw-r--r--toolkit/components/narrate/test/head.js87
-rw-r--r--toolkit/components/narrate/test/inferno.html238
-rw-r--r--toolkit/components/narrate/test/moby_dick.html218
-rw-r--r--toolkit/components/osfile/modules/osfile_async_front.jsm33
-rw-r--r--toolkit/components/osfile/modules/osfile_unix_back.jsm8
-rw-r--r--toolkit/components/osfile/modules/osfile_unix_front.jsm21
-rw-r--r--toolkit/components/osfile/moz.build28
-rw-r--r--toolkit/components/osfile/tests/mochi/.eslintrc.js7
-rw-r--r--toolkit/components/osfile/tests/mochi/chrome.ini15
-rw-r--r--toolkit/components/osfile/tests/mochi/main_test_osfile_async.js443
-rw-r--r--toolkit/components/osfile/tests/mochi/test_osfile_async.xul23
-rw-r--r--toolkit/components/osfile/tests/mochi/test_osfile_back.xul46
-rw-r--r--toolkit/components/osfile/tests/mochi/test_osfile_comms.xul84
-rw-r--r--toolkit/components/osfile/tests/mochi/test_osfile_front.xul44
-rw-r--r--toolkit/components/osfile/tests/mochi/worker_handler.js34
-rw-r--r--toolkit/components/osfile/tests/mochi/worker_test_osfile_comms.js145
-rw-r--r--toolkit/components/osfile/tests/mochi/worker_test_osfile_front.js566
-rw-r--r--toolkit/components/osfile/tests/mochi/worker_test_osfile_shared.js32
-rw-r--r--toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js201
-rw-r--r--toolkit/components/osfile/tests/mochi/worker_test_osfile_win.js211
-rw-r--r--toolkit/components/osfile/tests/xpcshell/.eslintrc.js7
-rw-r--r--toolkit/components/osfile/tests/xpcshell/head.js99
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_available_free_space.js38
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_compression.js98
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_constants.js26
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_creationDate.js31
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_duration.js91
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_exception.js89
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_file_URL_conversion.js114
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_loader.js37
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_loader/module_test_loader.js9
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_logging.js74
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_makeDir.js142
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_open.js70
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_async.js16
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_async_append.js122
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_async_bytes.js39
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_async_copy.js113
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_async_flush.js30
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_async_largefiles.js153
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_async_setDates.js211
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPermissions.js103
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_closed.js48
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_error.js63
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_kill.js100
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_win_async_setPermissions.js114
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_writeAtomic_backupTo_option.js143
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_osfile_writeAtomic_zerobytes.js27
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_path.js159
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_path_constants.js83
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_queue.js38
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_read_write.js103
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_remove.js56
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_removeDir.js177
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_removeEmptyDir.js55
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_reset.js95
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_shutdown.js98
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_telemetry.js63
-rw-r--r--toolkit/components/osfile/tests/xpcshell/test_unique.js88
-rw-r--r--toolkit/components/osfile/tests/xpcshell/xpcshell.ini51
-rw-r--r--toolkit/components/parentalcontrols/moz.build20
-rw-r--r--toolkit/components/parentalcontrols/nsParentalControlsServiceAndroid.cpp103
-rw-r--r--toolkit/components/passwordmgr/OSCrypto.jsm11
-rw-r--r--toolkit/components/passwordmgr/content/passwordManager.js9
-rw-r--r--toolkit/components/passwordmgr/moz.build42
-rw-r--r--toolkit/components/passwordmgr/nsLoginManager.js9
-rw-r--r--toolkit/components/passwordmgr/nsLoginManagerPrompter.js3
-rw-r--r--toolkit/components/passwordmgr/passwordmgr.manifest5
-rw-r--r--toolkit/components/passwordmgr/storage-mozStorage.js1262
-rw-r--r--toolkit/components/passwordmgr/test/.eslintrc.js13
-rw-r--r--toolkit/components/passwordmgr/test/LoginTestUtils.jsm295
-rw-r--r--toolkit/components/passwordmgr/test/authenticate.sjs228
-rw-r--r--toolkit/components/passwordmgr/test/blank.html8
-rw-r--r--toolkit/components/passwordmgr/test/browser/.eslintrc.js7
-rw-r--r--toolkit/components/passwordmgr/test/browser/authenticate.sjs110
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser.ini72
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_DOMFormHasPassword.js94
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_DOMInputPasswordAdded.js99
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_autocomplete_insecure_warning.js41
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_capture_doorhanger.js600
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_capture_doorhanger_httpsUpgrade.js123
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_capture_doorhanger_window_open.js144
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_context_menu.js432
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_context_menu_autocomplete_interaction.js99
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_context_menu_iframe.js144
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_exceptions_dialog.js56
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_formless_submit_chrome.js126
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms.js93
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js102
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_http_autofill.js78
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_insecurePasswordConsoleWarning.js94
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_master_password_autocomplete.js59
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_notifications.js81
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_notifications_2.js125
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_notifications_password.js145
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_notifications_username.js119
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_passwordmgr_contextmenu.js100
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_passwordmgr_editing.js126
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_passwordmgr_fields.js65
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_passwordmgr_observers.js129
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js208
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_passwordmgr_switchtab.js42
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js192
-rw-r--r--toolkit/components/passwordmgr/test/browser/browser_username_select_dialog.js144
-rw-r--r--toolkit/components/passwordmgr/test/browser/form_autofocus_js.html10
-rw-r--r--toolkit/components/passwordmgr/test/browser/form_basic.html12
-rw-r--r--toolkit/components/passwordmgr/test/browser/form_basic_iframe.html13
-rw-r--r--toolkit/components/passwordmgr/test/browser/form_cross_origin_insecure_action.html12
-rw-r--r--toolkit/components/passwordmgr/test/browser/form_cross_origin_secure_action.html12
-rw-r--r--toolkit/components/passwordmgr/test/browser/form_same_origin_action.html12
-rw-r--r--toolkit/components/passwordmgr/test/browser/formless_basic.html18
-rw-r--r--toolkit/components/passwordmgr/test/browser/head.js137
-rw-r--r--toolkit/components/passwordmgr/test/browser/insecure_test.html9
-rw-r--r--toolkit/components/passwordmgr/test/browser/insecure_test_subframe.html13
-rw-r--r--toolkit/components/passwordmgr/test/browser/multiple_forms.html129
-rw-r--r--toolkit/components/passwordmgr/test/browser/streamConverter_content.sjs6
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_1.html29
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_10.html27
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_11.html25
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_11_popup.html32
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_2.html30
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_2pw_0un.html27
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_2pw_1un_1text.html31
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_3.html30
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_4.html30
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_5.html26
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_6.html27
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_8.html29
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_9.html29
-rw-r--r--toolkit/components/passwordmgr/test/browser/subtst_notifications_change_p.html32
-rw-r--r--toolkit/components/passwordmgr/test/chrome/chrome.ini13
-rw-r--r--toolkit/components/passwordmgr/test/chrome/notification_common.js111
-rw-r--r--toolkit/components/passwordmgr/test/chrome/privbrowsing_perwindowpb_iframe.html9
-rw-r--r--toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_1.html33
-rw-r--r--toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_2.html33
-rw-r--r--toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_3.html29
-rw-r--r--toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_4.html40
-rw-r--r--toolkit/components/passwordmgr/test/chrome/test_privbrowsing_perwindowpb.html322
-rw-r--r--toolkit/components/passwordmgr/test/chrome_timeout.js11
-rw-r--r--toolkit/components/passwordmgr/test/formsubmit.sjs37
-rw-r--r--toolkit/components/passwordmgr/test/mochitest.ini20
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/auth2/authenticate.sjs220
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/mochitest.ini69
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_autocomplete_https_upgrade.html218
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_autofill_https_upgrade.html117
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_autofill_password-only.html143
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_autofocus_js.html115
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_basic_form.html44
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_basic_form_0pw.html72
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_basic_form_1pw.html167
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_basic_form_1pw_2.html109
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_basic_form_2pw_1.html187
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_basic_form_2pw_2.html105
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_basic_form_3pw_1.html177
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_basic_form_autocomplete.html859
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_basic_form_html5.html164
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_basic_form_pwevent.html55
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_basic_form_pwonly.html213
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html145
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_bug_776171.html56
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_case_differences.html147
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_form_action_1.html137
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_form_action_2.html170
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_form_action_javascript.html52
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_formless_autofill.html147
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_formless_submit.html183
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation.html191
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation_negative.html121
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_input_events.html96
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_input_events_for_identical_values.html51
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_autocomplete.html861
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_no_saved_login.html103
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_maxlength.html137
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html291
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_passwords_in_type_password.html122
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_prompt.html705
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_prompt_http.html362
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_prompt_noWindow.html81
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_prompt_promptAuth.html406
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_prompt_promptAuth_proxy.html264
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_recipe_login_fields.html145
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_username_focus.html263
-rw-r--r--toolkit/components/passwordmgr/test/mochitest/test_xhr_2.html55
-rw-r--r--toolkit/components/passwordmgr/test/prompt_common.js79
-rw-r--r--toolkit/components/passwordmgr/test/pwmgr_common.js509
-rw-r--r--toolkit/components/passwordmgr/test/subtst_master_pass.html12
-rw-r--r--toolkit/components/passwordmgr/test/subtst_prompt_async.html12
-rw-r--r--toolkit/components/passwordmgr/test/test_master_password.html308
-rw-r--r--toolkit/components/passwordmgr/test/test_prompt_async.html540
-rw-r--r--toolkit/components/passwordmgr/test/test_xhr.html201
-rw-r--r--toolkit/components/passwordmgr/test/test_xml_load.html191
-rw-r--r--toolkit/components/passwordmgr/test/unit/.eslintrc.js7
-rw-r--r--toolkit/components/passwordmgr/test/unit/data/corruptDB.sqlitebin32772 -> 0 bytes
-rw-r--r--toolkit/components/passwordmgr/test/unit/data/key3.dbbin16384 -> 0 bytes
-rw-r--r--toolkit/components/passwordmgr/test/unit/data/signons-v1.sqlitebin8192 -> 0 bytes
-rw-r--r--toolkit/components/passwordmgr/test/unit/data/signons-v1v2.sqlitebin10240 -> 0 bytes
-rw-r--r--toolkit/components/passwordmgr/test/unit/data/signons-v2.sqlitebin11264 -> 0 bytes
-rw-r--r--toolkit/components/passwordmgr/test/unit/data/signons-v2v3.sqlitebin12288 -> 0 bytes
-rw-r--r--toolkit/components/passwordmgr/test/unit/data/signons-v3.sqlitebin11264 -> 0 bytes
-rw-r--r--toolkit/components/passwordmgr/test/unit/data/signons-v3v4.sqlitebin11264 -> 0 bytes
-rw-r--r--toolkit/components/passwordmgr/test/unit/data/signons-v4.sqlitebin294912 -> 0 bytes
-rw-r--r--toolkit/components/passwordmgr/test/unit/data/signons-v4v5.sqlitebin327680 -> 0 bytes
-rw-r--r--toolkit/components/passwordmgr/test/unit/data/signons-v5v6.sqlitebin327680 -> 0 bytes
-rw-r--r--toolkit/components/passwordmgr/test/unit/data/signons-v999-2.sqlitebin8192 -> 0 bytes
-rw-r--r--toolkit/components/passwordmgr/test/unit/data/signons-v999.sqlitebin11264 -> 0 bytes
-rw-r--r--toolkit/components/passwordmgr/test/unit/head.js135
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_OSCrypto_win.js75
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_context_menu.js165
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_dedupeLogins.js284
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_disabled_hosts.js196
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_getFormFields.js147
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_getPasswordFields.js156
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_getPasswordOrigin.js28
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_isOriginMatching.js40
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_legacy_empty_formSubmitURL.js107
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_legacy_validation.js76
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_logins_change.js384
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_logins_decrypt_failure.js77
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_logins_metainfo.js284
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_logins_search.js220
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_maybeImportLogin.js169
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_module_LoginImport.js243
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_module_LoginStore.js206
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_notifications.js172
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_recipes_add.js177
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_recipes_content.js39
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_removeLegacySignonFiles.js69
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_search_schemeUpgrades.js184
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_storage.js102
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_storage_mozStorage.js507
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_telemetry.js187
-rw-r--r--toolkit/components/passwordmgr/test/unit/test_user_autocomplete_result.js488
-rw-r--r--toolkit/components/passwordmgr/test/unit/xpcshell.ini46
-rw-r--r--toolkit/components/perf/chrome.ini3
-rw-r--r--toolkit/components/perf/moz.build2
-rw-r--r--toolkit/components/perf/test_pm.xul48
-rw-r--r--toolkit/components/perfmonitoring/moz.build26
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/.eslintrc.js7
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser.ini15
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_AddonWatcher.js151
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample.xpibin7848 -> 0 bytes
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/bootstrap.js105
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/build.sh4
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/chrome.manifest1
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/content/framescript.js23
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/install.rdf30
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_addonPerformanceAlerts.js91
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_addonPerformanceAlerts_2.js25
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_compartments.html20
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_compartments.js312
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_compartments_frame.html12
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_compartments_script.js29
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/browser_webpagePerformanceAlerts.js111
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/head.js287
-rw-r--r--toolkit/components/perfmonitoring/tests/browser/install.rdf30
-rw-r--r--toolkit/components/places/PlacesUtils.jsm7
-rw-r--r--toolkit/components/places/moz.build9
-rw-r--r--toolkit/components/places/tests/.eslintrc.js9
-rw-r--r--toolkit/components/places/tests/PlacesTestUtils.jsm163
-rw-r--r--toolkit/components/places/tests/bookmarks/.eslintrc.js7
-rw-r--r--toolkit/components/places/tests/bookmarks/head_bookmarks.js20
-rw-r--r--toolkit/components/places/tests/bookmarks/test_1016953-renaming-uncompressed.js103
-rw-r--r--toolkit/components/places/tests/bookmarks/test_1017502-bookmarks_foreign_count.js112
-rw-r--r--toolkit/components/places/tests/bookmarks/test_1129529.js76
-rw-r--r--toolkit/components/places/tests/bookmarks/test_384228.js98
-rw-r--r--toolkit/components/places/tests/bookmarks/test_385829.js182
-rw-r--r--toolkit/components/places/tests/bookmarks/test_388695.js52
-rw-r--r--toolkit/components/places/tests/bookmarks/test_393498.js102
-rw-r--r--toolkit/components/places/tests/bookmarks/test_395101.js87
-rw-r--r--toolkit/components/places/tests/bookmarks/test_395593.js69
-rw-r--r--toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js221
-rw-r--r--toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js141
-rw-r--r--toolkit/components/places/tests/bookmarks/test_417228-other-roots.js158
-rw-r--r--toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js91
-rw-r--r--toolkit/components/places/tests/bookmarks/test_448584.js113
-rw-r--r--toolkit/components/places/tests/bookmarks/test_458683.js131
-rw-r--r--toolkit/components/places/tests/bookmarks/test_466303-json-remove-backups.js124
-rw-r--r--toolkit/components/places/tests/bookmarks/test_477583_json-backup-in-future.js56
-rw-r--r--toolkit/components/places/tests/bookmarks/test_675416.js56
-rw-r--r--toolkit/components/places/tests/bookmarks/test_711914.js56
-rw-r--r--toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js59
-rw-r--r--toolkit/components/places/tests/bookmarks/test_818587_compress-bookmarks-backups.js57
-rw-r--r--toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js57
-rw-r--r--toolkit/components/places/tests/bookmarks/test_992901-backup-unsorted-hierarchy.js48
-rw-r--r--toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js37
-rw-r--r--toolkit/components/places/tests/bookmarks/test_async_observers.js177
-rw-r--r--toolkit/components/places/tests/bookmarks/test_bmindex.js124
-rw-r--r--toolkit/components/places/tests/bookmarks/test_bookmarks.js718
-rw-r--r--toolkit/components/places/tests/bookmarks/test_bookmarks_eraseEverything.js116
-rw-r--r--toolkit/components/places/tests/bookmarks/test_bookmarks_fetch.js310
-rw-r--r--toolkit/components/places/tests/bookmarks/test_bookmarks_getRecent.js44
-rw-r--r--toolkit/components/places/tests/bookmarks/test_bookmarks_insert.js264
-rw-r--r--toolkit/components/places/tests/bookmarks/test_bookmarks_notifications.js527
-rw-r--r--toolkit/components/places/tests/bookmarks/test_bookmarks_remove.js204
-rw-r--r--toolkit/components/places/tests/bookmarks/test_bookmarks_reorder.js177
-rw-r--r--toolkit/components/places/tests/bookmarks/test_bookmarks_search.js223
-rw-r--r--toolkit/components/places/tests/bookmarks/test_bookmarks_update.js414
-rw-r--r--toolkit/components/places/tests/bookmarks/test_bookmarkstree_cache.js18
-rw-r--r--toolkit/components/places/tests/bookmarks/test_changeBookmarkURI.js68
-rw-r--r--toolkit/components/places/tests/bookmarks/test_getBookmarkedURIFor.js84
-rw-r--r--toolkit/components/places/tests/bookmarks/test_keywords.js310
-rw-r--r--toolkit/components/places/tests/bookmarks/test_nsINavBookmarkObserver.js640
-rw-r--r--toolkit/components/places/tests/bookmarks/test_protectRoots.js37
-rw-r--r--toolkit/components/places/tests/bookmarks/test_removeFolderTransaction_reinsert.js70
-rw-r--r--toolkit/components/places/tests/bookmarks/test_removeItem.js30
-rw-r--r--toolkit/components/places/tests/bookmarks/test_savedsearches.js209
-rw-r--r--toolkit/components/places/tests/bookmarks/xpcshell.ini50
-rw-r--r--toolkit/components/places/tests/browser/.eslintrc.js8
-rw-r--r--toolkit/components/places/tests/browser/399606-history.go-0.html11
-rw-r--r--toolkit/components/places/tests/browser/399606-httprefresh.html8
-rw-r--r--toolkit/components/places/tests/browser/399606-location.reload.html11
-rw-r--r--toolkit/components/places/tests/browser/399606-location.replace.html11
-rw-r--r--toolkit/components/places/tests/browser/399606-window.location.href.html11
-rw-r--r--toolkit/components/places/tests/browser/399606-window.location.html11
-rw-r--r--toolkit/components/places/tests/browser/461710_iframe.html8
-rw-r--r--toolkit/components/places/tests/browser/461710_link_page-2.html13
-rw-r--r--toolkit/components/places/tests/browser/461710_link_page-3.html13
-rw-r--r--toolkit/components/places/tests/browser/461710_link_page.html13
-rw-r--r--toolkit/components/places/tests/browser/461710_visited_page.html9
-rw-r--r--toolkit/components/places/tests/browser/begin.html10
-rw-r--r--toolkit/components/places/tests/browser/browser.ini26
-rw-r--r--toolkit/components/places/tests/browser/browser_bug248970.js152
-rw-r--r--toolkit/components/places/tests/browser/browser_bug399606.js77
-rw-r--r--toolkit/components/places/tests/browser/browser_bug461710.js82
-rw-r--r--toolkit/components/places/tests/browser/browser_bug646422.js51
-rw-r--r--toolkit/components/places/tests/browser/browser_bug680727.js109
-rw-r--r--toolkit/components/places/tests/browser/browser_colorAnalyzer.js259
-rw-r--r--toolkit/components/places/tests/browser/browser_double_redirect.js63
-rw-r--r--toolkit/components/places/tests/browser/browser_favicon_privatebrowsing_perwindowpb.js43
-rw-r--r--toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage.js152
-rw-r--r--toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage_failures.js261
-rw-r--r--toolkit/components/places/tests/browser/browser_history_post.js23
-rw-r--r--toolkit/components/places/tests/browser/browser_notfound.js46
-rw-r--r--toolkit/components/places/tests/browser/browser_redirect.js61
-rw-r--r--toolkit/components/places/tests/browser/browser_settitle.js76
-rw-r--r--toolkit/components/places/tests/browser/browser_visited_notfound.js51
-rw-r--r--toolkit/components/places/tests/browser/browser_visituri.js84
-rw-r--r--toolkit/components/places/tests/browser/browser_visituri_nohistory.js42
-rw-r--r--toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js73
-rw-r--r--toolkit/components/places/tests/browser/colorAnalyzer/category-discover.pngbin1324 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/browser/colorAnalyzer/dictionaryGeneric-16.pngbin742 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/browser/colorAnalyzer/extensionGeneric-16.pngbin554 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/browser/colorAnalyzer/localeGeneric.pngbin2410 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/browser/favicon-normal16.pngbin286 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/browser/favicon-normal32.pngbin344 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/browser/favicon.html13
-rw-r--r--toolkit/components/places/tests/browser/final.html10
-rw-r--r--toolkit/components/places/tests/browser/head.js319
-rw-r--r--toolkit/components/places/tests/browser/history_post.html12
-rw-r--r--toolkit/components/places/tests/browser/history_post.sjs6
-rw-r--r--toolkit/components/places/tests/browser/redirect-target.html1
-rw-r--r--toolkit/components/places/tests/browser/redirect.sjs14
-rw-r--r--toolkit/components/places/tests/browser/redirect_once.sjs9
-rw-r--r--toolkit/components/places/tests/browser/redirect_twice.sjs9
-rw-r--r--toolkit/components/places/tests/browser/title1.html12
-rw-r--r--toolkit/components/places/tests/browser/title2.html14
-rw-r--r--toolkit/components/places/tests/chrome/.eslintrc.js8
-rw-r--r--toolkit/components/places/tests/chrome/bad_links.atom74
-rw-r--r--toolkit/components/places/tests/chrome/browser_disableglobalhistory.xul44
-rw-r--r--toolkit/components/places/tests/chrome/chrome.ini12
-rw-r--r--toolkit/components/places/tests/chrome/link-less-items-no-site-uri.rss18
-rw-r--r--toolkit/components/places/tests/chrome/link-less-items.rss19
-rw-r--r--toolkit/components/places/tests/chrome/rss_as_html.rss27
-rw-r--r--toolkit/components/places/tests/chrome/rss_as_html.rss^headers^2
-rw-r--r--toolkit/components/places/tests/chrome/sample_feed.atom23
-rw-r--r--toolkit/components/places/tests/chrome/test_303567.xul122
-rw-r--r--toolkit/components/places/tests/chrome/test_341972a.xul87
-rw-r--r--toolkit/components/places/tests/chrome/test_341972b.xul84
-rw-r--r--toolkit/components/places/tests/chrome/test_342484.xul88
-rw-r--r--toolkit/components/places/tests/chrome/test_371798.xul101
-rw-r--r--toolkit/components/places/tests/chrome/test_381357.xul85
-rw-r--r--toolkit/components/places/tests/chrome/test_browser_disableglobalhistory.xul26
-rw-r--r--toolkit/components/places/tests/chrome/test_favicon_annotations.xul168
-rw-r--r--toolkit/components/places/tests/chrome/test_reloadLivemarks.xul155
-rw-r--r--toolkit/components/places/tests/cpp/mock_Link.h229
-rw-r--r--toolkit/components/places/tests/cpp/moz.build14
-rw-r--r--toolkit/components/places/tests/cpp/places_test_harness.h413
-rw-r--r--toolkit/components/places/tests/cpp/places_test_harness_tail.h120
-rw-r--r--toolkit/components/places/tests/cpp/test_IHistory.cpp639
-rw-r--r--toolkit/components/places/tests/expiration/.eslintrc.js7
-rw-r--r--toolkit/components/places/tests/expiration/head_expiration.js124
-rw-r--r--toolkit/components/places/tests/expiration/test_analyze_runs.js118
-rw-r--r--toolkit/components/places/tests/expiration/test_annos_expire_history.js93
-rw-r--r--toolkit/components/places/tests/expiration/test_annos_expire_never.js95
-rw-r--r--toolkit/components/places/tests/expiration/test_annos_expire_policy.js189
-rw-r--r--toolkit/components/places/tests/expiration/test_annos_expire_session.js83
-rw-r--r--toolkit/components/places/tests/expiration/test_clearHistory.js157
-rw-r--r--toolkit/components/places/tests/expiration/test_debug_expiration.js225
-rw-r--r--toolkit/components/places/tests/expiration/test_idle_daily.js21
-rw-r--r--toolkit/components/places/tests/expiration/test_notifications.js38
-rw-r--r--toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js114
-rw-r--r--toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js142
-rw-r--r--toolkit/components/places/tests/expiration/test_outdated_analyze.js72
-rw-r--r--toolkit/components/places/tests/expiration/test_pref_interval.js61
-rw-r--r--toolkit/components/places/tests/expiration/test_pref_maxpages.js124
-rw-r--r--toolkit/components/places/tests/expiration/xpcshell.ini22
-rw-r--r--toolkit/components/places/tests/favicons/.eslintrc.js7
-rw-r--r--toolkit/components/places/tests/favicons/expected-favicon-big32.jpg.pngbin3105 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/expected-favicon-big4.jpg.pngbin563 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/expected-favicon-big48.ico.pngbin1425 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/expected-favicon-big64.png.pngbin3157 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/expected-favicon-scale160x3.jpg.pngbin175 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/expected-favicon-scale3x160.jpg.pngbin169 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/favicon-big16.icobin1406 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/favicon-big32.jpgbin3494 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/favicon-big4.jpgbin4751 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/favicon-big48.icobin56646 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/favicon-big64.pngbin10698 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/favicon-normal16.pngbin286 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/favicon-normal32.pngbin344 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/favicon-scale160x3.jpgbin5095 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/favicon-scale3x160.jpgbin5059 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/favicons/head_favicons.js105
-rw-r--r--toolkit/components/places/tests/favicons/test_expireAllFavicons.js39
-rw-r--r--toolkit/components/places/tests/favicons/test_favicons_conversions.js131
-rw-r--r--toolkit/components/places/tests/favicons/test_getFaviconDataForPage.js57
-rw-r--r--toolkit/components/places/tests/favicons/test_getFaviconURLForPage.js51
-rw-r--r--toolkit/components/places/tests/favicons/test_moz-anno_favicon_mime_type.js90
-rw-r--r--toolkit/components/places/tests/favicons/test_page-icon_protocol.js66
-rw-r--r--toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js74
-rw-r--r--toolkit/components/places/tests/favicons/test_replaceFaviconData.js264
-rw-r--r--toolkit/components/places/tests/favicons/test_replaceFaviconDataFromDataURL.js352
-rw-r--r--toolkit/components/places/tests/favicons/xpcshell.ini32
-rw-r--r--toolkit/components/places/tests/head_common.js869
-rw-r--r--toolkit/components/places/tests/history/.eslintrc.js7
-rw-r--r--toolkit/components/places/tests/history/head_history.js19
-rw-r--r--toolkit/components/places/tests/history/test_insert.js257
-rw-r--r--toolkit/components/places/tests/history/test_remove.js360
-rw-r--r--toolkit/components/places/tests/history/test_removeVisits.js316
-rw-r--r--toolkit/components/places/tests/history/test_removeVisitsByFilter.js345
-rw-r--r--toolkit/components/places/tests/history/test_updatePlaces_sameUri_titleChanged.js52
-rw-r--r--toolkit/components/places/tests/history/xpcshell.ini9
-rw-r--r--toolkit/components/places/tests/migration/.eslintrc.js7
-rw-r--r--toolkit/components/places/tests/migration/head_migration.js46
-rw-r--r--toolkit/components/places/tests/migration/places_v10.sqlitebin172032 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v11.sqlitebin1081344 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v17.sqlitebin1212416 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v19.sqlitebin1179648 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v21.sqlitebin1179648 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v22.sqlitebin1179648 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v23.sqlitebin1179648 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v24.sqlitebin1179648 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v25.sqlitebin1179648 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v26.sqlitebin1179648 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v27.sqlitebin1212416 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v28.sqlitebin1212416 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v29.sqlitebin1245184 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v30.sqlitebin1212416 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v31.sqlitebin1146880 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v32.sqlitebin1146880 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v33.sqlitebin1146880 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v34.sqlitebin1146880 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v35.sqlitebin1146880 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/places_v6.sqlitebin155648 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/migration/test_current_from_downgraded.js19
-rw-r--r--toolkit/components/places/tests/migration/test_current_from_v11.js48
-rw-r--r--toolkit/components/places/tests/migration/test_current_from_v19.js42
-rw-r--r--toolkit/components/places/tests/migration/test_current_from_v24.js36
-rw-r--r--toolkit/components/places/tests/migration/test_current_from_v25.js30
-rw-r--r--toolkit/components/places/tests/migration/test_current_from_v26.js98
-rw-r--r--toolkit/components/places/tests/migration/test_current_from_v27.js77
-rw-r--r--toolkit/components/places/tests/migration/test_current_from_v31.js46
-rw-r--r--toolkit/components/places/tests/migration/test_current_from_v34.js141
-rw-r--r--toolkit/components/places/tests/migration/test_current_from_v34_no_roots.js21
-rw-r--r--toolkit/components/places/tests/migration/test_current_from_v6.js38
-rw-r--r--toolkit/components/places/tests/migration/xpcshell.ini36
-rw-r--r--toolkit/components/places/tests/moz.build67
-rw-r--r--toolkit/components/places/tests/queries/.eslintrc.js7
-rw-r--r--toolkit/components/places/tests/queries/head_queries.js370
-rw-r--r--toolkit/components/places/tests/queries/readme.txt16
-rw-r--r--toolkit/components/places/tests/queries/test_415716.js108
-rw-r--r--toolkit/components/places/tests/queries/test_abstime-annotation-domain.js210
-rw-r--r--toolkit/components/places/tests/queries/test_abstime-annotation-uri.js162
-rw-r--r--toolkit/components/places/tests/queries/test_async.js371
-rw-r--r--toolkit/components/places/tests/queries/test_containersQueries_sorting.js411
-rw-r--r--toolkit/components/places/tests/queries/test_history_queries_tags_liveUpdate.js200
-rw-r--r--toolkit/components/places/tests/queries/test_history_queries_titles_liveUpdate.js210
-rw-r--r--toolkit/components/places/tests/queries/test_onlyBookmarked.js128
-rw-r--r--toolkit/components/places/tests/queries/test_queryMultipleFolder.js65
-rw-r--r--toolkit/components/places/tests/queries/test_querySerialization.js797
-rw-r--r--toolkit/components/places/tests/queries/test_redirects.js311
-rw-r--r--toolkit/components/places/tests/queries/test_results-as-tag-contents-query.js127
-rw-r--r--toolkit/components/places/tests/queries/test_results-as-visit.js119
-rw-r--r--toolkit/components/places/tests/queries/test_searchTerms_includeHidden.js84
-rw-r--r--toolkit/components/places/tests/queries/test_searchterms-bookmarklets.js70
-rw-r--r--toolkit/components/places/tests/queries/test_searchterms-domain.js125
-rw-r--r--toolkit/components/places/tests/queries/test_searchterms-uri.js87
-rw-r--r--toolkit/components/places/tests/queries/test_sort-date-site-grouping.js225
-rw-r--r--toolkit/components/places/tests/queries/test_sorting.js1265
-rw-r--r--toolkit/components/places/tests/queries/test_tags.js743
-rw-r--r--toolkit/components/places/tests/queries/test_transitions.js178
-rw-r--r--toolkit/components/places/tests/queries/xpcshell.ini34
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/.eslintrc.js7
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/data/engine-rel-searchform.xml5
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/data/engine-suggestions.xml14
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js505
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_416211.js22
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_416214.js39
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_417798.js51
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_418257.js67
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_422277.js19
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_autocomplete_functional.js171
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_autocomplete_on_value_removed_479089.js39
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_autofill_default_behavior.js310
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_avoid_middle_complete.js179
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_avoid_stripping_to_empty_tokens.js41
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_casing.js157
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_do_not_trim.js91
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_download_embed_bookmarks.js71
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_dupe_urls.js23
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_empty_search.js98
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_enabled.js68
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_escape_self.js31
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_extension_matches.js384
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_ignore_protocol.js24
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_keyword_search.js73
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_keyword_search_actions.js149
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_keywords.js78
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_match_beginning.js54
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_multi_word_search.js68
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_query_url.js68
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_remote_tab_matches.js203
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_search_engine_alias.js51
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js45
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_search_engine_host.js49
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_search_engine_restyle.js43
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_search_suggestions.js651
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_special_search.js447
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_swap_protocol.js153
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_tab_matches.js125
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_trimming.js313
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_typed.js84
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_visit_url.js186
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_word_boundary_search.js175
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/test_zero_frecency.js35
-rw-r--r--toolkit/components/places/tests/unifiedcomplete/xpcshell.ini49
-rw-r--r--toolkit/components/places/tests/unit/.eslintrc.js7
-rw-r--r--toolkit/components/places/tests/unit/bookmarks.corrupt.html36
-rw-r--r--toolkit/components/places/tests/unit/bookmarks.json1
-rw-r--r--toolkit/components/places/tests/unit/bookmarks.preplaces.html35
-rw-r--r--toolkit/components/places/tests/unit/bookmarks_html_singleframe.html10
-rw-r--r--toolkit/components/places/tests/unit/bug476292.sqlitebin139264 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/unit/corruptDB.sqlitebin32772 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/unit/default.sqlitebin1081344 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/unit/head_bookmarks.js20
-rw-r--r--toolkit/components/places/tests/unit/livemark.xml17
-rw-r--r--toolkit/components/places/tests/unit/mobile_bookmarks_folder_import.json1
-rw-r--r--toolkit/components/places/tests/unit/mobile_bookmarks_folder_merge.json1
-rw-r--r--toolkit/components/places/tests/unit/mobile_bookmarks_multiple_folders.json1
-rw-r--r--toolkit/components/places/tests/unit/mobile_bookmarks_root_import.json1
-rw-r--r--toolkit/components/places/tests/unit/mobile_bookmarks_root_merge.json1
-rw-r--r--toolkit/components/places/tests/unit/nsDummyObserver.js48
-rw-r--r--toolkit/components/places/tests/unit/nsDummyObserver.manifest4
-rw-r--r--toolkit/components/places/tests/unit/places.sparse.sqlitebin221184 -> 0 bytes
-rw-r--r--toolkit/components/places/tests/unit/test_000_frecency.js267
-rw-r--r--toolkit/components/places/tests/unit/test_1085291.js42
-rw-r--r--toolkit/components/places/tests/unit/test_1105208.js24
-rw-r--r--toolkit/components/places/tests/unit/test_1105866.js63
-rw-r--r--toolkit/components/places/tests/unit/test_317472.js65
-rw-r--r--toolkit/components/places/tests/unit/test_331487.js95
-rw-r--r--toolkit/components/places/tests/unit/test_384370.js173
-rw-r--r--toolkit/components/places/tests/unit/test_385397.js142
-rw-r--r--toolkit/components/places/tests/unit/test_399264_query_to_string.js51
-rw-r--r--toolkit/components/places/tests/unit/test_399264_string_to_query.js75
-rw-r--r--toolkit/components/places/tests/unit/test_399266.js78
-rw-r--r--toolkit/components/places/tests/unit/test_402799.js62
-rw-r--r--toolkit/components/places/tests/unit/test_405497.js57
-rw-r--r--toolkit/components/places/tests/unit/test_408221.js165
-rw-r--r--toolkit/components/places/tests/unit/test_412132.js136
-rw-r--r--toolkit/components/places/tests/unit/test_413784.js118
-rw-r--r--toolkit/components/places/tests/unit/test_415460.js43
-rw-r--r--toolkit/components/places/tests/unit/test_415757.js102
-rw-r--r--toolkit/components/places/tests/unit/test_418643_removeFolderChildren.js143
-rw-r--r--toolkit/components/places/tests/unit/test_419731.js96
-rw-r--r--toolkit/components/places/tests/unit/test_419792_node_tags_property.js49
-rw-r--r--toolkit/components/places/tests/unit/test_425563.js74
-rw-r--r--toolkit/components/places/tests/unit/test_429505_remove_shortcuts.js35
-rw-r--r--toolkit/components/places/tests/unit/test_433317_query_title_update.js38
-rw-r--r--toolkit/components/places/tests/unit/test_433525_hasChildren_crash.js56
-rw-r--r--toolkit/components/places/tests/unit/test_452777.js36
-rw-r--r--toolkit/components/places/tests/unit/test_454977.js124
-rw-r--r--toolkit/components/places/tests/unit/test_463863.js60
-rw-r--r--toolkit/components/places/tests/unit/test_485442_crash_bug_nsNavHistoryQuery_GetUri.js21
-rw-r--r--toolkit/components/places/tests/unit/test_486978_sort_by_date_queries.js129
-rw-r--r--toolkit/components/places/tests/unit/test_536081.js56
-rw-r--r--toolkit/components/places/tests/unit/test_PlacesSearchAutocompleteProvider.js133
-rw-r--r--toolkit/components/places/tests/unit/test_PlacesUtils_asyncGetBookmarkIds.js77
-rw-r--r--toolkit/components/places/tests/unit/test_PlacesUtils_invalidateCachedGuidFor.js25
-rw-r--r--toolkit/components/places/tests/unit/test_PlacesUtils_lazyobservers.js47
-rw-r--r--toolkit/components/places/tests/unit/test_adaptive.js406
-rw-r--r--toolkit/components/places/tests/unit/test_adaptive_bug527311.js141
-rw-r--r--toolkit/components/places/tests/unit/test_analyze.js28
-rw-r--r--toolkit/components/places/tests/unit/test_annotations.js363
-rw-r--r--toolkit/components/places/tests/unit/test_asyncExecuteLegacyQueries.js95
-rw-r--r--toolkit/components/places/tests/unit/test_async_history_api.js1118
-rw-r--r--toolkit/components/places/tests/unit/test_async_in_batchmode.js55
-rw-r--r--toolkit/components/places/tests/unit/test_async_transactions.js1739
-rw-r--r--toolkit/components/places/tests/unit/test_autocomplete_stopSearch_no_throw.js39
-rw-r--r--toolkit/components/places/tests/unit/test_bookmark_catobs.js57
-rw-r--r--toolkit/components/places/tests/unit/test_bookmarks_html.js385
-rw-r--r--toolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js143
-rw-r--r--toolkit/components/places/tests/unit/test_bookmarks_html_import_tags.js57
-rw-r--r--toolkit/components/places/tests/unit/test_bookmarks_html_singleframe.js32
-rw-r--r--toolkit/components/places/tests/unit/test_bookmarks_json.js241
-rw-r--r--toolkit/components/places/tests/unit/test_bookmarks_restore_notification.js325
-rw-r--r--toolkit/components/places/tests/unit/test_bookmarks_setNullTitle.js44
-rw-r--r--toolkit/components/places/tests/unit/test_broken_folderShortcut_result.js79
-rw-r--r--toolkit/components/places/tests/unit/test_browserhistory.js129
-rw-r--r--toolkit/components/places/tests/unit/test_bug636917_isLivemark.js35
-rw-r--r--toolkit/components/places/tests/unit/test_childlessTags.js117
-rw-r--r--toolkit/components/places/tests/unit/test_corrupt_telemetry.js31
-rw-r--r--toolkit/components/places/tests/unit/test_crash_476292.js28
-rw-r--r--toolkit/components/places/tests/unit/test_database_replaceOnStartup.js46
-rw-r--r--toolkit/components/places/tests/unit/test_download_history.js283
-rw-r--r--toolkit/components/places/tests/unit/test_frecency.js294
-rw-r--r--toolkit/components/places/tests/unit/test_frecency_observers.js84
-rw-r--r--toolkit/components/places/tests/unit/test_frecency_zero_updated.js30
-rw-r--r--toolkit/components/places/tests/unit/test_getChildIndex.js69
-rw-r--r--toolkit/components/places/tests/unit/test_getPlacesInfo.js112
-rw-r--r--toolkit/components/places/tests/unit/test_history.js184
-rw-r--r--toolkit/components/places/tests/unit/test_history_autocomplete_tags.js185
-rw-r--r--toolkit/components/places/tests/unit/test_history_catobs.js55
-rw-r--r--toolkit/components/places/tests/unit/test_history_clear.js169
-rw-r--r--toolkit/components/places/tests/unit/test_history_notifications.js38
-rw-r--r--toolkit/components/places/tests/unit/test_history_observer.js215
-rw-r--r--toolkit/components/places/tests/unit/test_history_sidebar.js447
-rw-r--r--toolkit/components/places/tests/unit/test_hosts_triggers.js226
-rw-r--r--toolkit/components/places/tests/unit/test_import_mobile_bookmarks.js292
-rw-r--r--toolkit/components/places/tests/unit/test_isPageInDB.js10
-rw-r--r--toolkit/components/places/tests/unit/test_isURIVisited.js84
-rw-r--r--toolkit/components/places/tests/unit/test_isvisited.js75
-rw-r--r--toolkit/components/places/tests/unit/test_keywords.js548
-rw-r--r--toolkit/components/places/tests/unit/test_lastModified.js34
-rw-r--r--toolkit/components/places/tests/unit/test_markpageas.js61
-rw-r--r--toolkit/components/places/tests/unit/test_mozIAsyncLivemarks.js514
-rw-r--r--toolkit/components/places/tests/unit/test_multi_queries.js53
-rw-r--r--toolkit/components/places/tests/unit/test_multi_word_tags.js150
-rw-r--r--toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js256
-rw-r--r--toolkit/components/places/tests/unit/test_null_interfaces.js98
-rw-r--r--toolkit/components/places/tests/unit/test_onItemChanged_tags.js52
-rw-r--r--toolkit/components/places/tests/unit/test_pageGuid_bookmarkGuid.js179
-rw-r--r--toolkit/components/places/tests/unit/test_placeURIs.js42
-rw-r--r--toolkit/components/places/tests/unit/test_placesTxn.js937
-rw-r--r--toolkit/components/places/tests/unit/test_preventive_maintenance.js1356
-rw-r--r--toolkit/components/places/tests/unit/test_preventive_maintenance_checkAndFixDatabase.js50
-rw-r--r--toolkit/components/places/tests/unit/test_preventive_maintenance_runTasks.js46
-rw-r--r--toolkit/components/places/tests/unit/test_promiseBookmarksTree.js256
-rw-r--r--toolkit/components/places/tests/unit/test_resolveNullBookmarkTitles.js49
-rw-r--r--toolkit/components/places/tests/unit/test_result_sort.js139
-rw-r--r--toolkit/components/places/tests/unit/test_resultsAsVisit_details.js85
-rw-r--r--toolkit/components/places/tests/unit/test_sql_guid_functions.js106
-rw-r--r--toolkit/components/places/tests/unit/test_svg_favicon.js31
-rw-r--r--toolkit/components/places/tests/unit/test_sync_utils.js1150
-rw-r--r--toolkit/components/places/tests/unit/test_tag_autocomplete_search.js137
-rw-r--r--toolkit/components/places/tests/unit/test_tagging.js189
-rw-r--r--toolkit/components/places/tests/unit/test_telemetry.js166
-rw-r--r--toolkit/components/places/tests/unit/test_update_frecency_after_delete.js151
-rw-r--r--toolkit/components/places/tests/unit/test_utils_backups_create.js90
-rw-r--r--toolkit/components/places/tests/unit/test_utils_getURLsForContainerNode.js181
-rw-r--r--toolkit/components/places/tests/unit/test_utils_setAnnotationsFor.js79
-rw-r--r--toolkit/components/places/tests/unit/test_visitsInDB.js12
-rw-r--r--toolkit/components/places/tests/unit/xpcshell.ini163
-rw-r--r--toolkit/components/printing/content/printPreviewBindings.xml8
-rw-r--r--toolkit/components/printing/jar.mn2
-rw-r--r--toolkit/components/printing/moz.build7
-rw-r--r--toolkit/components/printing/tests/browser.ini5
-rw-r--r--toolkit/components/printing/tests/browser_page_change_print_original.js60
-rw-r--r--toolkit/components/printing/tests/file_page_change_print_original_1.html8
-rw-r--r--toolkit/components/printing/tests/file_page_change_print_original_2.html1
-rw-r--r--toolkit/components/promiseworker/moz.build13
-rw-r--r--toolkit/components/promiseworker/tests/xpcshell/.eslintrc.js7
-rw-r--r--toolkit/components/promiseworker/tests/xpcshell/data/chrome.manifest1
-rw-r--r--toolkit/components/promiseworker/tests/xpcshell/data/worker.js34
-rw-r--r--toolkit/components/promiseworker/tests/xpcshell/test_Promise.js117
-rw-r--r--toolkit/components/promiseworker/tests/xpcshell/xpcshell.ini9
-rw-r--r--toolkit/components/prompts/moz.build2
-rw-r--r--toolkit/components/prompts/test/.eslintrc.js7
-rw-r--r--toolkit/components/prompts/test/bug619644_inner.html7
-rw-r--r--toolkit/components/prompts/test/bug625187_iframe.html16
-rw-r--r--toolkit/components/prompts/test/chromeScript.js241
-rw-r--r--toolkit/components/prompts/test/mochitest.ini19
-rw-r--r--toolkit/components/prompts/test/prompt_common.js158
-rw-r--r--toolkit/components/prompts/test/test_bug619644.html76
-rw-r--r--toolkit/components/prompts/test/test_bug620145.html105
-rw-r--r--toolkit/components/prompts/test/test_dom_prompts.html208
-rw-r--r--toolkit/components/prompts/test/test_modal_prompts.html1184
-rw-r--r--toolkit/components/prompts/test/test_modal_select.html146
-rw-r--r--toolkit/components/prompts/test/test_subresources_prompts.html202
-rw-r--r--toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h2
-rw-r--r--toolkit/components/reader/moz.build11
-rw-r--r--toolkit/components/reader/test/browser.ini15
-rw-r--r--toolkit/components/reader/test/browser_bug1124271_readerModePinnedTab.js47
-rw-r--r--toolkit/components/reader/test/browser_readerMode.js220
-rw-r--r--toolkit/components/reader/test/browser_readerMode_hidden_nodes.js53
-rw-r--r--toolkit/components/reader/test/browser_readerMode_with_anchor.js21
-rw-r--r--toolkit/components/reader/test/head.js126
-rw-r--r--toolkit/components/reader/test/readerModeArticle.html25
-rw-r--r--toolkit/components/reader/test/readerModeArticleHiddenNodes.html22
-rw-r--r--toolkit/components/remotebrowserutils/moz.build2
-rw-r--r--toolkit/components/remotebrowserutils/tests/browser/.eslintrc.js7
-rw-r--r--toolkit/components/remotebrowserutils/tests/browser/browser.ini6
-rw-r--r--toolkit/components/remotebrowserutils/tests/browser/browser_RemoteWebNavigation.js156
-rw-r--r--toolkit/components/remotebrowserutils/tests/browser/dummy_page.html7
-rw-r--r--toolkit/components/satchel/FormHistory.jsm3
-rw-r--r--toolkit/components/satchel/moz.build12
-rw-r--r--toolkit/components/satchel/nsFormFillController.cpp2
-rw-r--r--toolkit/components/satchel/nsFormHistory.js22
-rw-r--r--toolkit/components/satchel/test/.eslintrc.js7
-rw-r--r--toolkit/components/satchel/test/browser/.eslintrc.js7
-rw-r--r--toolkit/components/satchel/test/browser/browser.ini5
-rw-r--r--toolkit/components/satchel/test/browser/browser_privbrowsing_perwindowpb.js63
-rw-r--r--toolkit/components/satchel/test/mochitest.ini19
-rw-r--r--toolkit/components/satchel/test/parent_utils.js149
-rw-r--r--toolkit/components/satchel/test/satchel_common.js274
-rw-r--r--toolkit/components/satchel/test/subtst_form_submission_1.html38
-rw-r--r--toolkit/components/satchel/test/subtst_privbrowsing.html22
-rw-r--r--toolkit/components/satchel/test/test_bug_511615.html194
-rw-r--r--toolkit/components/satchel/test/test_bug_787624.html88
-rw-r--r--toolkit/components/satchel/test/test_datalist_with_caching.html139
-rw-r--r--toolkit/components/satchel/test/test_form_autocomplete.html1074
-rw-r--r--toolkit/components/satchel/test/test_form_autocomplete_with_list.html506
-rw-r--r--toolkit/components/satchel/test/test_form_submission.html537
-rw-r--r--toolkit/components/satchel/test/test_form_submission_cap.html85
-rw-r--r--toolkit/components/satchel/test/test_form_submission_cap2.html190
-rw-r--r--toolkit/components/satchel/test/test_password_autocomplete.html107
-rw-r--r--toolkit/components/satchel/test/test_popup_direction.html61
-rw-r--r--toolkit/components/satchel/test/test_popup_enter_event.html86
-rw-r--r--toolkit/components/satchel/test/unit/.eslintrc.js7
-rw-r--r--toolkit/components/satchel/test/unit/asyncformhistory_expire.sqlitebin98304 -> 0 bytes
-rw-r--r--toolkit/components/satchel/test/unit/formhistory_1000.sqlitebin164864 -> 0 bytes
-rw-r--r--toolkit/components/satchel/test/unit/formhistory_CORRUPT.sqlite1
-rw-r--r--toolkit/components/satchel/test/unit/formhistory_apitest.sqlitebin5120 -> 0 bytes
-rw-r--r--toolkit/components/satchel/test/unit/formhistory_autocomplete.sqlitebin72704 -> 0 bytes
-rw-r--r--toolkit/components/satchel/test/unit/formhistory_v3.sqlitebin5120 -> 0 bytes
-rw-r--r--toolkit/components/satchel/test/unit/formhistory_v3v4.sqlitebin6144 -> 0 bytes
-rw-r--r--toolkit/components/satchel/test/unit/formhistory_v999a.sqlitebin6144 -> 0 bytes
-rw-r--r--toolkit/components/satchel/test/unit/formhistory_v999b.sqlitebin4096 -> 0 bytes
-rw-r--r--toolkit/components/satchel/test/unit/head_satchel.js102
-rw-r--r--toolkit/components/satchel/test/unit/perf_autocomplete.js140
-rw-r--r--toolkit/components/satchel/test/unit/test_async_expire.js168
-rw-r--r--toolkit/components/satchel/test/unit/test_autocomplete.js266
-rw-r--r--toolkit/components/satchel/test/unit/test_db_corrupt.js89
-rw-r--r--toolkit/components/satchel/test/unit/test_db_update_v4.js60
-rw-r--r--toolkit/components/satchel/test/unit/test_db_update_v4b.js58
-rw-r--r--toolkit/components/satchel/test/unit/test_db_update_v999a.js75
-rw-r--r--toolkit/components/satchel/test/unit/test_db_update_v999b.js92
-rw-r--r--toolkit/components/satchel/test/unit/test_history_api.js457
-rw-r--r--toolkit/components/satchel/test/unit/test_notify.js158
-rw-r--r--toolkit/components/satchel/test/unit/test_previous_result.js25
-rw-r--r--toolkit/components/satchel/test/unit/xpcshell.ini26
-rw-r--r--toolkit/components/search/nsSearchService.js33
-rw-r--r--toolkit/components/social/test/xpcshell/.eslintrc.js7
-rw-r--r--toolkit/components/sqlite/moz.build11
-rw-r--r--toolkit/components/sqlite/sqlite_internal.js323
-rw-r--r--toolkit/components/sqlite/tests/xpcshell/.eslintrc.js7
-rw-r--r--toolkit/components/sqlite/tests/xpcshell/data/chrome.manifest1
-rw-r--r--toolkit/components/sqlite/tests/xpcshell/data/worker_sqlite_internal.js279
-rw-r--r--toolkit/components/sqlite/tests/xpcshell/data/worker_sqlite_shared.js39
-rw-r--r--toolkit/components/sqlite/tests/xpcshell/test_sqlite_internal.js43
-rw-r--r--toolkit/components/sqlite/tests/xpcshell/xpcshell.ini10
-rw-r--r--toolkit/components/startup/moz.build10
-rw-r--r--toolkit/components/startup/tests/browser/.eslintrc.js7
-rw-r--r--toolkit/components/startup/tests/browser/beforeunload.html10
-rw-r--r--toolkit/components/startup/tests/browser/browser.ini8
-rw-r--r--toolkit/components/startup/tests/browser/browser_bug511456.js47
-rw-r--r--toolkit/components/startup/tests/browser/browser_bug537449.js53
-rw-r--r--toolkit/components/startup/tests/browser/browser_crash_detection.js23
-rw-r--r--toolkit/components/startup/tests/browser/head.js29
-rw-r--r--toolkit/components/startup/tests/unit/.eslintrc.js7
-rw-r--r--toolkit/components/startup/tests/unit/head_startup.js30
-rw-r--r--toolkit/components/startup/tests/unit/test_startup_crash.js300
-rw-r--r--toolkit/components/startup/tests/unit/xpcshell.ini6
-rw-r--r--toolkit/components/telemetry/Makefile.in17
-rw-r--r--toolkit/components/telemetry/TelemetryController.jsm2
-rw-r--r--toolkit/components/telemetry/TelemetryEnvironment.jsm2
-rw-r--r--toolkit/components/telemetry/TelemetryReportingPolicy.jsm2
-rw-r--r--toolkit/components/telemetry/moz.build9
-rw-r--r--toolkit/components/telemetry/tests/addons/dictionary/install.rdf25
-rw-r--r--toolkit/components/telemetry/tests/addons/experiment/install.rdf16
-rw-r--r--toolkit/components/telemetry/tests/addons/extension-2/install.rdf16
-rw-r--r--toolkit/components/telemetry/tests/addons/extension/install.rdf16
-rw-r--r--toolkit/components/telemetry/tests/addons/long-fields/install.rdf24
-rw-r--r--toolkit/components/telemetry/tests/addons/restartless/install.rdf24
-rw-r--r--toolkit/components/telemetry/tests/addons/signed/META-INF/manifest.mf7
-rw-r--r--toolkit/components/telemetry/tests/addons/signed/META-INF/mozilla.rsabin4190 -> 0 bytes
-rw-r--r--toolkit/components/telemetry/tests/addons/signed/META-INF/mozilla.sf4
-rw-r--r--toolkit/components/telemetry/tests/addons/signed/install.rdf24
-rw-r--r--toolkit/components/telemetry/tests/addons/system/install.rdf24
-rw-r--r--toolkit/components/telemetry/tests/addons/theme/install.rdf16
-rw-r--r--toolkit/components/telemetry/tests/browser/browser.ini5
-rw-r--r--toolkit/components/telemetry/tests/browser/browser_TelemetryGC.js193
-rw-r--r--toolkit/components/telemetry/tests/search/chrome.manifest3
-rw-r--r--toolkit/components/telemetry/tests/search/searchTest.jarbin867 -> 0 bytes
-rw-r--r--toolkit/components/telemetry/tests/unit/.eslintrc.js7
-rw-r--r--toolkit/components/telemetry/tests/unit/TelemetryArchiveTesting.jsm86
-rw-r--r--toolkit/components/telemetry/tests/unit/engine.xml7
-rw-r--r--toolkit/components/telemetry/tests/unit/head.js319
-rw-r--r--toolkit/components/telemetry/tests/unit/test_ChildHistograms.js107
-rw-r--r--toolkit/components/telemetry/tests/unit/test_PingAPI.js502
-rw-r--r--toolkit/components/telemetry/tests/unit/test_SubsessionChaining.js236
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetryController.js507
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetryControllerBuildID.js70
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetryControllerShutdown.js70
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetryController_idle.js73
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js1522
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetryEvents.js249
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetryFlagClear.js14
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetryLateWrites.js127
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetryLockCount.js53
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetryLog.js51
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetryReportingPolicy.js268
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetryScalars.js574
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetrySend.js427
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetrySendOldPings.js547
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetrySession.js2029
-rw-r--r--toolkit/components/telemetry/tests/unit/test_TelemetryTimestamps.js77
-rw-r--r--toolkit/components/telemetry/tests/unit/test_ThreadHangStats.js102
-rw-r--r--toolkit/components/telemetry/tests/unit/test_nsITelemetry.js883
-rw-r--r--toolkit/components/telemetry/tests/unit/xpcshell.ini61
-rw-r--r--toolkit/components/terminator/moz.build10
-rw-r--r--toolkit/components/terminator/tests/xpcshell/.eslintrc.js7
-rw-r--r--toolkit/components/terminator/tests/xpcshell/test_terminator_record.js108
-rw-r--r--toolkit/components/terminator/tests/xpcshell/test_terminator_reload.js85
-rw-r--r--toolkit/components/terminator/tests/xpcshell/xpcshell.ini8
-rw-r--r--toolkit/components/thumbnails/PageThumbUtils.jsm5
-rw-r--r--toolkit/components/thumbnails/moz.build6
-rw-r--r--toolkit/components/thumbnails/test/.eslintrc.js8
-rw-r--r--toolkit/components/thumbnails/test/authenticate.sjs220
-rw-r--r--toolkit/components/thumbnails/test/background_red.html3
-rw-r--r--toolkit/components/thumbnails/test/background_red_redirect.sjs10
-rw-r--r--toolkit/components/thumbnails/test/background_red_scroll.html3
-rw-r--r--toolkit/components/thumbnails/test/browser.ini38
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_bad_url.js23
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_basic.js20
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_captureIfMissing.js35
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_crash_during_capture.js49
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_crash_while_idle.js38
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_destroy_browser.js33
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_no_alert.js13
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_no_auth_prompt.js21
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_no_cookies_sent.js40
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_no_cookies_stored.js32
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_no_duplicates.js31
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_queueing.js38
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_redirect.js39
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bg_timeout.js24
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bug726727.js19
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bug727765.js29
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_bug818225.js42
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_capture.js20
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_expiration.js97
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_privacy.js74
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_redirect.js30
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_storage.js112
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_storage_migrate3.js102
-rw-r--r--toolkit/components/thumbnails/test/browser_thumbnails_update.js169
-rw-r--r--toolkit/components/thumbnails/test/head.js356
-rw-r--r--toolkit/components/thumbnails/test/privacy_cache_control.sjs16
-rw-r--r--toolkit/components/thumbnails/test/test_thumbnails_interfaces.js25
-rw-r--r--toolkit/components/thumbnails/test/thumbnails_background.sjs79
-rw-r--r--toolkit/components/thumbnails/test/thumbnails_crash_content_helper.js31
-rw-r--r--toolkit/components/thumbnails/test/thumbnails_update.sjs56
-rw-r--r--toolkit/components/thumbnails/test/xpcshell.ini6
-rw-r--r--toolkit/components/timermanager/moz.build9
-rw-r--r--toolkit/components/timermanager/tests/unit/.eslintrc.js7
-rw-r--r--toolkit/components/timermanager/tests/unit/consumerNotifications.js519
-rw-r--r--toolkit/components/timermanager/tests/unit/xpcshell.ini9
-rw-r--r--toolkit/components/tooltiptext/moz.build5
-rw-r--r--toolkit/components/tooltiptext/tests/browser.ini7
-rw-r--r--toolkit/components/tooltiptext/tests/browser_bug329212.js35
-rw-r--r--toolkit/components/tooltiptext/tests/browser_bug331772_xul_tooltiptext_in_html.js19
-rw-r--r--toolkit/components/tooltiptext/tests/browser_bug561623.js24
-rw-r--r--toolkit/components/tooltiptext/tests/browser_bug581947.js87
-rw-r--r--toolkit/components/tooltiptext/tests/browser_input_file_tooltips.js122
-rw-r--r--toolkit/components/tooltiptext/tests/title_test.svg59
-rw-r--r--toolkit/components/tooltiptext/tests/xul_tooltiptext.xhtml14
-rw-r--r--toolkit/components/url-classifier/moz.build2
-rw-r--r--toolkit/components/url-classifier/nsUrlClassifierUtils.cpp4
-rw-r--r--toolkit/components/url-classifier/tests/UrlClassifierTestUtils.jsm98
-rw-r--r--toolkit/components/url-classifier/tests/gtest/Common.cpp78
-rw-r--r--toolkit/components/url-classifier/tests/gtest/Common.h26
-rw-r--r--toolkit/components/url-classifier/tests/gtest/TestChunkSet.cpp279
-rw-r--r--toolkit/components/url-classifier/tests/gtest/TestFailUpdate.cpp97
-rw-r--r--toolkit/components/url-classifier/tests/gtest/TestLookupCacheV4.cpp88
-rw-r--r--toolkit/components/url-classifier/tests/gtest/TestPerProviderDirectory.cpp98
-rw-r--r--toolkit/components/url-classifier/tests/gtest/TestProtocolParser.cpp159
-rw-r--r--toolkit/components/url-classifier/tests/gtest/TestRiceDeltaDecoder.cpp165
-rw-r--r--toolkit/components/url-classifier/tests/gtest/TestSafeBrowsingProtobuf.cpp24
-rw-r--r--toolkit/components/url-classifier/tests/gtest/TestSafebrowsingHash.cpp52
-rw-r--r--toolkit/components/url-classifier/tests/gtest/TestTable.cpp47
-rw-r--r--toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp755
-rw-r--r--toolkit/components/url-classifier/tests/gtest/TestUrlClassifierUtils.cpp276
-rw-r--r--toolkit/components/url-classifier/tests/gtest/TestVariableLengthPrefixSet.cpp559
-rw-r--r--toolkit/components/url-classifier/tests/gtest/moz.build27
-rw-r--r--toolkit/components/url-classifier/tests/jar.mn2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/.eslintrc.js8
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/allowlistAnnotatedFrame.html144
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/bad.css1
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/bad.css^headers^1
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/basic.vtt27
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/basic.vtt^headers^1
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/bug_1281083.html35
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/chrome.ini23
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html213
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html24
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/classifierCommon.js112
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/classifierFrame.html57
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/classifierHelper.js201
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/cleanWorker.js10
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/dnt.html31
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/dnt.sjs9
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/evil.css1
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/evil.css^headers^1
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/evil.js1
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/evil.js^headers^2
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/evilWorker.js3
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/gethash.sjs130
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/gethashFrame.html62
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/good.js1
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/import.css3
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/mochitest.ini39
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/ping.sjs16
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/raptor.jpgbin49629 -> 0 bytes
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/seek.webmbin215529 -> 0 bytes
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_allowlisted_annotations.html56
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html305
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_classified_annotations.html50
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_classifier.html65
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html149
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_classifier_worker.html76
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html121
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_classify_track.html162
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_donottrack.html150
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_gethash.html157
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_lookup_system_principal.html29
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html154
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_safebrowsing_bug1272239.html87
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1157081.html107
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html153
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/track.html7
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/unwantedWorker.js3
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/update.sjs114
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/vp9.webmbin97465 -> 0 bytes
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/whitelistFrame.html15
-rw-r--r--toolkit/components/url-classifier/tests/mochitest/workerFrame.html65
-rw-r--r--toolkit/components/url-classifier/tests/moz.build18
-rw-r--r--toolkit/components/url-classifier/tests/unit/.eslintrc.js7
-rw-r--r--toolkit/components/url-classifier/tests/unit/data/digest1.chunkbin939 -> 0 bytes
-rw-r--r--toolkit/components/url-classifier/tests/unit/data/digest2.chunk2
-rw-r--r--toolkit/components/url-classifier/tests/unit/head_urlclassifier.js429
-rw-r--r--toolkit/components/url-classifier/tests/unit/tail_urlclassifier.js1
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_addsub.js488
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_backoff.js89
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_bug1274685_unowned_list.js32
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_dbservice.js314
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_digest256.js147
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_hashcompleter.js403
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_listmanager.js376
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_partial.js825
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_pref.js14
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_prefixset.js232
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_provider_url.js34
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_safebrowsing_protobuf.js23
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_streamupdater.js288
-rw-r--r--toolkit/components/url-classifier/tests/unit/test_threat_type_conversion.js37
-rw-r--r--toolkit/components/url-classifier/tests/unit/xpcshell.ini24
-rw-r--r--toolkit/components/url-classifier/tests/unittests.xul188
-rw-r--r--toolkit/components/urlformatter/moz.build18
-rw-r--r--toolkit/components/urlformatter/tests/unit/.eslintrc.js7
-rw-r--r--toolkit/components/urlformatter/tests/unit/head_urlformatter.js16
-rw-r--r--toolkit/components/urlformatter/tests/unit/test_urlformatter.js63
-rw-r--r--toolkit/components/urlformatter/tests/unit/xpcshell.ini6
-rw-r--r--toolkit/components/viewsource/moz.build12
-rw-r--r--toolkit/components/viewsource/test/.eslintrc.js7
-rw-r--r--toolkit/components/viewsource/test/browser/.eslintrc.js7
-rw-r--r--toolkit/components/viewsource/test/browser/browser.ini12
-rw-r--r--toolkit/components/viewsource/test/browser/browser_bug464222.js12
-rw-r--r--toolkit/components/viewsource/test/browser/browser_bug699356.js19
-rw-r--r--toolkit/components/viewsource/test/browser/browser_bug713810.js23
-rw-r--r--toolkit/components/viewsource/test/browser/browser_contextmenu.js107
-rw-r--r--toolkit/components/viewsource/test/browser/browser_gotoline.js36
-rw-r--r--toolkit/components/viewsource/test/browser/browser_srcdoc.js30
-rw-r--r--toolkit/components/viewsource/test/browser/browser_viewsourceprefs.js136
-rw-r--r--toolkit/components/viewsource/test/browser/file_bug464222.html1
-rw-r--r--toolkit/components/viewsource/test/browser/head.js200
-rw-r--r--toolkit/components/viewsource/test/chrome.ini4
-rw-r--r--toolkit/components/viewsource/test/file_empty.html1
-rw-r--r--toolkit/components/viewsource/test/test_bug428653.html45
-rw-r--r--toolkit/components/workerloader/moz.build9
-rw-r--r--toolkit/components/workerloader/tests/.eslintrc.js7
-rw-r--r--toolkit/components/workerloader/tests/chrome.ini15
-rw-r--r--toolkit/components/workerloader/tests/moduleA-depends.js14
-rw-r--r--toolkit/components/workerloader/tests/moduleB-dependency.js11
-rw-r--r--toolkit/components/workerloader/tests/moduleC-circular.js18
-rw-r--r--toolkit/components/workerloader/tests/moduleD-circular.js11
-rw-r--r--toolkit/components/workerloader/tests/moduleE-throws-during-require.js10
-rw-r--r--toolkit/components/workerloader/tests/moduleF-syntax-error.js6
-rw-r--r--toolkit/components/workerloader/tests/moduleG-throws-later.js12
-rw-r--r--toolkit/components/workerloader/tests/moduleH-module-dot-exports.js12
-rw-r--r--toolkit/components/workerloader/tests/test_loading.xul41
-rw-r--r--toolkit/components/workerloader/tests/utils_mainthread.js34
-rw-r--r--toolkit/components/workerloader/tests/utils_worker.js32
-rw-r--r--toolkit/components/workerloader/tests/worker_handler.js34
-rw-r--r--toolkit/components/workerloader/tests/worker_test_loading.js121
-rw-r--r--toolkit/components/xulstore/moz.build7
-rw-r--r--toolkit/components/xulstore/tests/chrome/.eslintrc.js7
-rw-r--r--toolkit/components/xulstore/tests/chrome/animals.rdf142
-rw-r--r--toolkit/components/xulstore/tests/chrome/chrome.ini6
-rw-r--r--toolkit/components/xulstore/tests/chrome/test_persistence.xul31
-rw-r--r--toolkit/components/xulstore/tests/chrome/window_persistence.xul98
-rw-r--r--toolkit/components/xulstore/tests/xpcshell/.eslintrc.js7
-rw-r--r--toolkit/components/xulstore/tests/xpcshell/localstore.rdf31
-rw-r--r--toolkit/components/xulstore/tests/xpcshell/test_XULStore.js199
-rw-r--r--toolkit/components/xulstore/tests/xpcshell/xpcshell.ini6
-rw-r--r--toolkit/content/aboutProfiles.js12
-rw-r--r--toolkit/content/aboutSupport.js84
-rw-r--r--toolkit/content/aboutSupport.xhtml8
-rw-r--r--toolkit/content/aboutTelemetry.js17
-rw-r--r--toolkit/content/browser-child.js1
-rw-r--r--toolkit/content/buildconfig.html4
-rw-r--r--toolkit/content/contentAreaUtils.js44
-rw-r--r--toolkit/content/customizeToolbar.js9
-rw-r--r--toolkit/content/globalOverlay.js44
-rw-r--r--toolkit/content/jar.mn10
-rw-r--r--toolkit/content/moz.build21
-rw-r--r--toolkit/content/tests/browser/.eslintrc.js7
-rw-r--r--toolkit/content/tests/browser/audio.oggbin14290 -> 0 bytes
-rw-r--r--toolkit/content/tests/browser/browser.ini76
-rw-r--r--toolkit/content/tests/browser/browser_audioCompeting.js115
-rw-r--r--toolkit/content/tests/browser/browser_audioCompeting_onlyForActiveAgent.js176
-rw-r--r--toolkit/content/tests/browser/browser_autoscroll_disabled.js67
-rw-r--r--toolkit/content/tests/browser/browser_block_autoplay_media.js87
-rw-r--r--toolkit/content/tests/browser/browser_bug1170531.js92
-rw-r--r--toolkit/content/tests/browser/browser_bug1198465.js75
-rw-r--r--toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js214
-rw-r--r--toolkit/content/tests/browser/browser_bug451286.js152
-rw-r--r--toolkit/content/tests/browser/browser_bug594509.js9
-rw-r--r--toolkit/content/tests/browser/browser_bug982298.js70
-rw-r--r--toolkit/content/tests/browser/browser_contentTitle.js16
-rw-r--r--toolkit/content/tests/browser/browser_content_url_annotation.js73
-rw-r--r--toolkit/content/tests/browser/browser_crash_previous_frameloader.js108
-rw-r--r--toolkit/content/tests/browser/browser_datetime_datepicker.js284
-rw-r--r--toolkit/content/tests/browser/browser_default_image_filename.js45
-rw-r--r--toolkit/content/tests/browser/browser_f7_caret_browsing.js227
-rw-r--r--toolkit/content/tests/browser/browser_findbar.js249
-rw-r--r--toolkit/content/tests/browser/browser_isSynthetic.js72
-rw-r--r--toolkit/content/tests/browser/browser_keyevents_during_autoscrolling.js120
-rw-r--r--toolkit/content/tests/browser/browser_label_textlink.js38
-rw-r--r--toolkit/content/tests/browser/browser_mediaPlayback.js30
-rw-r--r--toolkit/content/tests/browser/browser_mediaPlayback_mute.js104
-rw-r--r--toolkit/content/tests/browser/browser_mediaPlayback_suspended.js191
-rw-r--r--toolkit/content/tests/browser/browser_mediaPlayback_suspended_multipleAudio.js311
-rw-r--r--toolkit/content/tests/browser/browser_mute.js16
-rw-r--r--toolkit/content/tests/browser/browser_mute2.js26
-rw-r--r--toolkit/content/tests/browser/browser_quickfind_editable.js47
-rw-r--r--toolkit/content/tests/browser/browser_saveImageURL.js68
-rw-r--r--toolkit/content/tests/browser/browser_save_resend_postdata.js145
-rw-r--r--toolkit/content/tests/browser/common/mockTransfer.js67
-rw-r--r--toolkit/content/tests/browser/data/post_form_inner.sjs31
-rw-r--r--toolkit/content/tests/browser/data/post_form_outer.sjs34
-rw-r--r--toolkit/content/tests/browser/empty.pngbin14528 -> 0 bytes
-rw-r--r--toolkit/content/tests/browser/file_contentTitle.html14
-rw-r--r--toolkit/content/tests/browser/file_mediaPlayback.html9
-rw-r--r--toolkit/content/tests/browser/file_mediaPlayback2.html12
-rw-r--r--toolkit/content/tests/browser/file_mediaPlaybackFrame.html2
-rw-r--r--toolkit/content/tests/browser/file_mediaPlaybackFrame2.html2
-rw-r--r--toolkit/content/tests/browser/file_multipleAudio.html19
-rw-r--r--toolkit/content/tests/browser/file_multiplePlayingAudio.html23
-rw-r--r--toolkit/content/tests/browser/file_redirect.html13
-rw-r--r--toolkit/content/tests/browser/file_redirect_to.html15
-rw-r--r--toolkit/content/tests/browser/head.js123
-rw-r--r--toolkit/content/tests/browser/image.jpgbin24204 -> 0 bytes
-rw-r--r--toolkit/content/tests/browser/image_page.html9
-rw-r--r--toolkit/content/tests/chrome/.eslintrc.js7
-rw-r--r--toolkit/content/tests/chrome/RegisterUnregisterChrome.js161
-rw-r--r--toolkit/content/tests/chrome/bug263683_window.xul210
-rw-r--r--toolkit/content/tests/chrome/bug304188_window.xul94
-rw-r--r--toolkit/content/tests/chrome/bug331215_window.xul102
-rw-r--r--toolkit/content/tests/chrome/bug360437_window.xul120
-rw-r--r--toolkit/content/tests/chrome/bug366992_window.xul57
-rw-r--r--toolkit/content/tests/chrome/bug409624_window.xul98
-rw-r--r--toolkit/content/tests/chrome/bug429723_window.xul84
-rw-r--r--toolkit/content/tests/chrome/bug451540_window.xul248
-rw-r--r--toolkit/content/tests/chrome/bug624329_window.xul22
-rw-r--r--toolkit/content/tests/chrome/chrome.ini199
-rw-r--r--toolkit/content/tests/chrome/dialog_dialogfocus.xul57
-rw-r--r--toolkit/content/tests/chrome/file_about_networking_wsh.py9
-rw-r--r--toolkit/content/tests/chrome/file_autocomplete_with_composition.js540
-rw-r--r--toolkit/content/tests/chrome/findbar_entireword_window.xul275
-rw-r--r--toolkit/content/tests/chrome/findbar_events_window.xul173
-rw-r--r--toolkit/content/tests/chrome/findbar_window.xul756
-rw-r--r--toolkit/content/tests/chrome/frame_popup_anchor.xul82
-rw-r--r--toolkit/content/tests/chrome/frame_popupremoving_frame.xul75
-rw-r--r--toolkit/content/tests/chrome/frame_subframe_origin_subframe1.xul43
-rw-r--r--toolkit/content/tests/chrome/frame_subframe_origin_subframe2.xul39
-rw-r--r--toolkit/content/tests/chrome/popup_childframe_node.xul2
-rw-r--r--toolkit/content/tests/chrome/popup_trigger.js859
-rw-r--r--toolkit/content/tests/chrome/rtlchrome/rtl.css2
-rw-r--r--toolkit/content/tests/chrome/rtlchrome/rtl.dtd1
-rw-r--r--toolkit/content/tests/chrome/rtlchrome/rtl.manifest5
-rw-r--r--toolkit/content/tests/chrome/rtltest/content/dirtest.xul25
-rw-r--r--toolkit/content/tests/chrome/rtltest/righttoleft.manifest3
-rw-r--r--toolkit/content/tests/chrome/sample_entireword_latin1.html11
-rw-r--r--toolkit/content/tests/chrome/test_about_networking.html58
-rw-r--r--toolkit/content/tests/chrome/test_arrowpanel.xul327
-rw-r--r--toolkit/content/tests/chrome/test_autocomplete2.xul197
-rw-r--r--toolkit/content/tests/chrome/test_autocomplete3.xul188
-rw-r--r--toolkit/content/tests/chrome/test_autocomplete4.xul280
-rw-r--r--toolkit/content/tests/chrome/test_autocomplete5.xul152
-rw-r--r--toolkit/content/tests/chrome/test_autocomplete_delayOnPaste.xul128
-rw-r--r--toolkit/content/tests/chrome/test_autocomplete_emphasis.xul175
-rw-r--r--toolkit/content/tests/chrome/test_autocomplete_mac_caret.xul74
-rw-r--r--toolkit/content/tests/chrome/test_autocomplete_placehold_last_complete.xul309
-rw-r--r--toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html64
-rw-r--r--toolkit/content/tests/chrome/test_autocomplete_with_composition_on_textbox.xul124
-rw-r--r--toolkit/content/tests/chrome/test_browser_drop.xul38
-rw-r--r--toolkit/content/tests/chrome/test_bug1048178.xul86
-rw-r--r--toolkit/content/tests/chrome/test_bug253481.xul90
-rw-r--r--toolkit/content/tests/chrome/test_bug263683.xul39
-rw-r--r--toolkit/content/tests/chrome/test_bug304188.xul37
-rw-r--r--toolkit/content/tests/chrome/test_bug331215.xul38
-rw-r--r--toolkit/content/tests/chrome/test_bug360220.xul61
-rw-r--r--toolkit/content/tests/chrome/test_bug360437.xul40
-rw-r--r--toolkit/content/tests/chrome/test_bug365773.xul67
-rw-r--r--toolkit/content/tests/chrome/test_bug366992.xul40
-rw-r--r--toolkit/content/tests/chrome/test_bug382990.xul44
-rw-r--r--toolkit/content/tests/chrome/test_bug409624.xul39
-rw-r--r--toolkit/content/tests/chrome/test_bug418874.xul71
-rw-r--r--toolkit/content/tests/chrome/test_bug429723.xul38
-rw-r--r--toolkit/content/tests/chrome/test_bug437844.xul95
-rw-r--r--toolkit/content/tests/chrome/test_bug451540.xul39
-rw-r--r--toolkit/content/tests/chrome/test_bug457632.xul178
-rw-r--r--toolkit/content/tests/chrome/test_bug460942.xul42
-rw-r--r--toolkit/content/tests/chrome/test_bug471776.xul47
-rw-r--r--toolkit/content/tests/chrome/test_bug509732.xul53
-rw-r--r--toolkit/content/tests/chrome/test_bug554279.xul39
-rw-r--r--toolkit/content/tests/chrome/test_bug557987.xul76
-rw-r--r--toolkit/content/tests/chrome/test_bug562554.xul92
-rw-r--r--toolkit/content/tests/chrome/test_bug570192.xul53
-rw-r--r--toolkit/content/tests/chrome/test_bug585946.xul51
-rw-r--r--toolkit/content/tests/chrome/test_bug624329.xul160
-rw-r--r--toolkit/content/tests/chrome/test_bug792324.xul75
-rw-r--r--toolkit/content/tests/chrome/test_button.xul71
-rw-r--r--toolkit/content/tests/chrome/test_chromemargin.xul36
-rw-r--r--toolkit/content/tests/chrome/test_closemenu_attribute.xul96
-rw-r--r--toolkit/content/tests/chrome/test_colorpicker_popup.xul148
-rw-r--r--toolkit/content/tests/chrome/test_contextmenu_list.xul288
-rw-r--r--toolkit/content/tests/chrome/test_cursorsnap.xul127
-rw-r--r--toolkit/content/tests/chrome/test_datepicker.xul415
-rw-r--r--toolkit/content/tests/chrome/test_deck.xul133
-rw-r--r--toolkit/content/tests/chrome/test_dialogfocus.xul102
-rw-r--r--toolkit/content/tests/chrome/test_findbar.xul47
-rw-r--r--toolkit/content/tests/chrome/test_findbar_entireword.xul41
-rw-r--r--toolkit/content/tests/chrome/test_findbar_events.xul39
-rw-r--r--toolkit/content/tests/chrome/test_focus_anons.xul119
-rw-r--r--toolkit/content/tests/chrome/test_hiddenitems.xul89
-rw-r--r--toolkit/content/tests/chrome/test_hiddenpaging.xul161
-rw-r--r--toolkit/content/tests/chrome/test_keys.xul29
-rw-r--r--toolkit/content/tests/chrome/test_labelcontrol.xul44
-rw-r--r--toolkit/content/tests/chrome/test_largemenu.xul29
-rw-r--r--toolkit/content/tests/chrome/test_menu.xul85
-rw-r--r--toolkit/content/tests/chrome/test_menu_anchored.xul77
-rw-r--r--toolkit/content/tests/chrome/test_menu_hide.xul58
-rw-r--r--toolkit/content/tests/chrome/test_menuchecks.xul147
-rw-r--r--toolkit/content/tests/chrome/test_menuitem_blink.xul106
-rw-r--r--toolkit/content/tests/chrome/test_menuitem_commands.xul104
-rw-r--r--toolkit/content/tests/chrome/test_menulist.xul314
-rw-r--r--toolkit/content/tests/chrome/test_menulist_keynav.xul272
-rw-r--r--toolkit/content/tests/chrome/test_menulist_null_value.xul96
-rw-r--r--toolkit/content/tests/chrome/test_menulist_paging.xul163
-rw-r--r--toolkit/content/tests/chrome/test_menulist_position.xul97
-rw-r--r--toolkit/content/tests/chrome/test_mousescroll.xul274
-rw-r--r--toolkit/content/tests/chrome/test_notificationbox.xul522
-rw-r--r--toolkit/content/tests/chrome/test_panel.xul31
-rw-r--r--toolkit/content/tests/chrome/test_panel_focus.xul38
-rw-r--r--toolkit/content/tests/chrome/test_panelfrommenu.xul118
-rw-r--r--toolkit/content/tests/chrome/test_popup_anchor.xul30
-rw-r--r--toolkit/content/tests/chrome/test_popup_anchoratrect.xul28
-rw-r--r--toolkit/content/tests/chrome/test_popup_attribute.xul28
-rw-r--r--toolkit/content/tests/chrome/test_popup_button.xul28
-rw-r--r--toolkit/content/tests/chrome/test_popup_coords.xul91
-rw-r--r--toolkit/content/tests/chrome/test_popup_keys.xul148
-rw-r--r--toolkit/content/tests/chrome/test_popup_moveToAnchor.xul84
-rw-r--r--toolkit/content/tests/chrome/test_popup_preventdefault.xul76
-rw-r--r--toolkit/content/tests/chrome/test_popup_preventdefault_chrome.xul29
-rw-r--r--toolkit/content/tests/chrome/test_popup_recreate.xul83
-rw-r--r--toolkit/content/tests/chrome/test_popup_scaled.xul105
-rw-r--r--toolkit/content/tests/chrome/test_popup_tree.xul72
-rw-r--r--toolkit/content/tests/chrome/test_popuphidden.xul74
-rw-r--r--toolkit/content/tests/chrome/test_popupincontent.xul131
-rw-r--r--toolkit/content/tests/chrome/test_popupremoving.xul165
-rw-r--r--toolkit/content/tests/chrome/test_popupremoving_frame.xul80
-rw-r--r--toolkit/content/tests/chrome/test_position.xul136
-rw-r--r--toolkit/content/tests/chrome/test_preferences.xul533
-rw-r--r--toolkit/content/tests/chrome/test_preferences_beforeaccept.xul55
-rw-r--r--toolkit/content/tests/chrome/test_preferences_onsyncfrompreference.xul62
-rw-r--r--toolkit/content/tests/chrome/test_progressmeter.xul74
-rw-r--r--toolkit/content/tests/chrome/test_props.xul91
-rw-r--r--toolkit/content/tests/chrome/test_radio.xul66
-rw-r--r--toolkit/content/tests/chrome/test_richlist_direction.xul138
-rw-r--r--toolkit/content/tests/chrome/test_righttoleft.xul126
-rw-r--r--toolkit/content/tests/chrome/test_scale.xul277
-rw-r--r--toolkit/content/tests/chrome/test_scaledrag.xul197
-rw-r--r--toolkit/content/tests/chrome/test_screenPersistence.xul63
-rw-r--r--toolkit/content/tests/chrome/test_scrollbar.xul137
-rw-r--r--toolkit/content/tests/chrome/test_showcaret.xul101
-rw-r--r--toolkit/content/tests/chrome/test_sorttemplate.xul89
-rw-r--r--toolkit/content/tests/chrome/test_statusbar.xul42
-rw-r--r--toolkit/content/tests/chrome/test_subframe_origin.xul37
-rw-r--r--toolkit/content/tests/chrome/test_tabbox.xul224
-rw-r--r--toolkit/content/tests/chrome/test_tabindex.xul120
-rw-r--r--toolkit/content/tests/chrome/test_textbox_dictionary.xul98
-rw-r--r--toolkit/content/tests/chrome/test_textbox_emptytext.xul48
-rw-r--r--toolkit/content/tests/chrome/test_textbox_number.xul353
-rw-r--r--toolkit/content/tests/chrome/test_textbox_search.xul170
-rw-r--r--toolkit/content/tests/chrome/test_timepicker.xul207
-rw-r--r--toolkit/content/tests/chrome/test_titlebar.xul35
-rw-r--r--toolkit/content/tests/chrome/test_toolbar.xul227
-rw-r--r--toolkit/content/tests/chrome/test_tooltip.xul28
-rw-r--r--toolkit/content/tests/chrome/test_tooltip_noautohide.xul57
-rw-r--r--toolkit/content/tests/chrome/test_tree.xul84
-rw-r--r--toolkit/content/tests/chrome/test_tree_hier.xul136
-rw-r--r--toolkit/content/tests/chrome/test_tree_hier_cell.xul136
-rw-r--r--toolkit/content/tests/chrome/test_tree_single.xul110
-rw-r--r--toolkit/content/tests/chrome/test_tree_view.xul118
-rw-r--r--toolkit/content/tests/chrome/window_browser_drop.xul242
-rw-r--r--toolkit/content/tests/chrome/window_chromemargin.xul73
-rw-r--r--toolkit/content/tests/chrome/window_cursorsnap_dialog.xul104
-rw-r--r--toolkit/content/tests/chrome/window_cursorsnap_wizard.xul111
-rw-r--r--toolkit/content/tests/chrome/window_keys.xul202
-rw-r--r--toolkit/content/tests/chrome/window_largemenu.xul425
-rw-r--r--toolkit/content/tests/chrome/window_panel.xul312
-rw-r--r--toolkit/content/tests/chrome/window_panel_focus.xul132
-rw-r--r--toolkit/content/tests/chrome/window_popup_anchor.xul28
-rw-r--r--toolkit/content/tests/chrome/window_popup_anchoratrect.xul117
-rw-r--r--toolkit/content/tests/chrome/window_popup_attribute.xul40
-rw-r--r--toolkit/content/tests/chrome/window_popup_button.xul41
-rw-r--r--toolkit/content/tests/chrome/window_popup_preventdefault_chrome.xul113
-rw-r--r--toolkit/content/tests/chrome/window_preferences.xul73
-rw-r--r--toolkit/content/tests/chrome/window_preferences2.xul25
-rw-r--r--toolkit/content/tests/chrome/window_preferences3.xul74
-rw-r--r--toolkit/content/tests/chrome/window_preferences_beforeaccept.xul45
-rw-r--r--toolkit/content/tests/chrome/window_preferences_commandretarget.xul36
-rw-r--r--toolkit/content/tests/chrome/window_preferences_onsyncfrompreference.xul42
-rw-r--r--toolkit/content/tests/chrome/window_screenPosSize.xul17
-rw-r--r--toolkit/content/tests/chrome/window_showcaret.xul10
-rw-r--r--toolkit/content/tests/chrome/window_subframe_origin.xul42
-rw-r--r--toolkit/content/tests/chrome/window_titlebar.xul223
-rw-r--r--toolkit/content/tests/chrome/window_tooltip.xul311
-rw-r--r--toolkit/content/tests/chrome/xul_selectcontrol.js390
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/application.ini11
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/chrome/chrome.manifest1
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/chrome/content/BrowserView.js694
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/chrome/content/FooScript.js352
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/chrome/content/TileManager.js1018
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/chrome/content/WidgetStack.js1438
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/chrome/content/firefoxOverlay.xul15
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/chrome/content/foo.xul460
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/chrome/content/main.xul7
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/chrome/content/overlay.js15
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/chrome/locale/en-US/tile.dtd1
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/chrome/locale/en-US/tile.properties3
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/chrome/skin/overlay.css5
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/defaults/preferences/prefs.js2
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/install.rdf17
-rw-r--r--toolkit/content/tests/fennec-tile-testapp/logread.py104
-rw-r--r--toolkit/content/tests/mochitest/mochitest.ini5
-rw-r--r--toolkit/content/tests/mochitest/test_autocomplete_change_after_focus.html105
-rw-r--r--toolkit/content/tests/mochitest/test_mousecapture.xhtml340
-rw-r--r--toolkit/content/tests/moz.build19
-rw-r--r--toolkit/content/tests/reftests/bug-442419-progressmeter-max-ref.xul7
-rw-r--r--toolkit/content/tests/reftests/bug-442419-progressmeter-max.xul7
-rw-r--r--toolkit/content/tests/reftests/textbox-multiline-default-value.xul5
-rw-r--r--toolkit/content/tests/reftests/textbox-multiline-empty.xul5
-rw-r--r--toolkit/content/tests/unit/.eslintrc.js7
-rw-r--r--toolkit/content/tests/unit/test_contentAreaUtils.js80
-rw-r--r--toolkit/content/tests/unit/xpcshell.ini5
-rw-r--r--toolkit/content/tests/widgets/.eslintrc.js8
-rw-r--r--toolkit/content/tests/widgets/audio.oggbin14293 -> 0 bytes
-rw-r--r--toolkit/content/tests/widgets/audio.wavbin1422 -> 0 bytes
-rw-r--r--toolkit/content/tests/widgets/chrome.ini20
-rw-r--r--toolkit/content/tests/widgets/head.js23
-rw-r--r--toolkit/content/tests/widgets/mochitest.ini40
-rw-r--r--toolkit/content/tests/widgets/popup_shared.js424
-rw-r--r--toolkit/content/tests/widgets/seek_with_sound.oggbin299507 -> 0 bytes
-rw-r--r--toolkit/content/tests/widgets/test_audiocontrols_dimensions.html38
-rw-r--r--toolkit/content/tests/widgets/test_bug898940.html31
-rw-r--r--toolkit/content/tests/widgets/test_contextmenu_menugroup.xul102
-rw-r--r--toolkit/content/tests/widgets/test_contextmenu_nested.xul138
-rw-r--r--toolkit/content/tests/widgets/test_editor_currentURI.xul39
-rw-r--r--toolkit/content/tests/widgets/test_menubar.xul30
-rw-r--r--toolkit/content/tests/widgets/test_mousecapture_area.html109
-rw-r--r--toolkit/content/tests/widgets/test_popupanchor.xul430
-rw-r--r--toolkit/content/tests/widgets/test_popupreflows.xul111
-rw-r--r--toolkit/content/tests/widgets/test_tree_column_reorder.xul76
-rw-r--r--toolkit/content/tests/widgets/test_videocontrols.html411
-rw-r--r--toolkit/content/tests/widgets/test_videocontrols_audio.html60
-rw-r--r--toolkit/content/tests/widgets/test_videocontrols_audio_direction.html31
-rw-r--r--toolkit/content/tests/widgets/test_videocontrols_iframe_fullscreen.html64
-rw-r--r--toolkit/content/tests/widgets/test_videocontrols_jsdisabled.html70
-rw-r--r--toolkit/content/tests/widgets/test_videocontrols_onclickplay.html74
-rw-r--r--toolkit/content/tests/widgets/test_videocontrols_standalone.html90
-rw-r--r--toolkit/content/tests/widgets/test_videocontrols_video_direction.html31
-rw-r--r--toolkit/content/tests/widgets/test_videocontrols_vtt.html133
-rw-r--r--toolkit/content/tests/widgets/tree_shared.js1405
-rw-r--r--toolkit/content/tests/widgets/video.oggbin285310 -> 0 bytes
-rw-r--r--toolkit/content/tests/widgets/videocontrols_direction-1-ref.html10
-rw-r--r--toolkit/content/tests/widgets/videocontrols_direction-1a.html10
-rw-r--r--toolkit/content/tests/widgets/videocontrols_direction-1b.html10
-rw-r--r--toolkit/content/tests/widgets/videocontrols_direction-1c.html10
-rw-r--r--toolkit/content/tests/widgets/videocontrols_direction-1d.html10
-rw-r--r--toolkit/content/tests/widgets/videocontrols_direction-1e.html10
-rw-r--r--toolkit/content/tests/widgets/videocontrols_direction-2-ref.html10
-rw-r--r--toolkit/content/tests/widgets/videocontrols_direction-2a.html10
-rw-r--r--toolkit/content/tests/widgets/videocontrols_direction-2b.html10
-rw-r--r--toolkit/content/tests/widgets/videocontrols_direction-2c.html10
-rw-r--r--toolkit/content/tests/widgets/videocontrols_direction-2d.html10
-rw-r--r--toolkit/content/tests/widgets/videocontrols_direction-2e.html10
-rw-r--r--toolkit/content/tests/widgets/videocontrols_direction_test.js90
-rw-r--r--toolkit/content/tests/widgets/videomask.css23
-rw-r--r--toolkit/content/tests/widgets/window_menubar.xul820
-rw-r--r--toolkit/forgetaboutsite/ForgetAboutSite.jsm7
-rw-r--r--toolkit/forgetaboutsite/moz.build10
-rw-r--r--toolkit/forgetaboutsite/test/browser/.eslintrc.js7
-rw-r--r--toolkit/forgetaboutsite/test/browser/browser.ini4
-rw-r--r--toolkit/forgetaboutsite/test/browser/browser_clearplugindata.html30
-rw-r--r--toolkit/forgetaboutsite/test/browser/browser_clearplugindata.js86
-rw-r--r--toolkit/forgetaboutsite/test/unit/.eslintrc.js7
-rw-r--r--toolkit/forgetaboutsite/test/unit/head_forgetaboutsite.js31
-rw-r--r--toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js647
-rw-r--r--toolkit/forgetaboutsite/test/unit/xpcshell.ini8
-rw-r--r--toolkit/identity/moz.build11
-rw-r--r--toolkit/identity/tests/chrome/.eslintrc.js7
-rw-r--r--toolkit/identity/tests/chrome/chrome.ini13
-rw-r--r--toolkit/identity/tests/chrome/sandbox_content.html32
-rw-r--r--toolkit/identity/tests/chrome/sandbox_content.sjs36
-rw-r--r--toolkit/identity/tests/chrome/sandbox_content_alert.html20
-rw-r--r--toolkit/identity/tests/chrome/sandbox_content_framed.html17
-rw-r--r--toolkit/identity/tests/chrome/sandbox_content_perms.html64
-rw-r--r--toolkit/identity/tests/chrome/sandbox_content_popup.html25
-rw-r--r--toolkit/identity/tests/chrome/sandbox_content_redirect.html2
-rw-r--r--toolkit/identity/tests/chrome/sandbox_content_redirect.html^headers^2
-rw-r--r--toolkit/identity/tests/chrome/test_sandbox.xul324
-rw-r--r--toolkit/identity/tests/unit/.eslintrc.js7
-rw-r--r--toolkit/identity/tests/unit/data/idp_1/.well-known/browserid5
-rw-r--r--toolkit/identity/tests/unit/data/idp_invalid_1/.well-known/browserid5
-rw-r--r--toolkit/identity/tests/unit/head_identity.js248
-rw-r--r--toolkit/identity/tests/unit/tail_identity.js8
-rw-r--r--toolkit/identity/tests/unit/test_authentication.js159
-rw-r--r--toolkit/identity/tests/unit/test_crypto_service.js122
-rw-r--r--toolkit/identity/tests/unit/test_identity.js114
-rw-r--r--toolkit/identity/tests/unit/test_identity_utils.js46
-rw-r--r--toolkit/identity/tests/unit/test_jwcrypto.js281
-rw-r--r--toolkit/identity/tests/unit/test_load_modules.js20
-rw-r--r--toolkit/identity/tests/unit/test_log_utils.js74
-rw-r--r--toolkit/identity/tests/unit/test_minimalidentity.js223
-rw-r--r--toolkit/identity/tests/unit/test_observer_topics.js114
-rw-r--r--toolkit/identity/tests/unit/test_provisioning.js242
-rw-r--r--toolkit/identity/tests/unit/test_relying_party.js255
-rw-r--r--toolkit/identity/tests/unit/test_store.js64
-rw-r--r--toolkit/identity/tests/unit/test_well-known.js90
-rw-r--r--toolkit/identity/tests/unit/xpcshell.ini23
-rw-r--r--toolkit/library/libxul.mk2
-rw-r--r--toolkit/library/moz.build8
-rw-r--r--toolkit/locales/Makefile.in3
-rw-r--r--toolkit/locales/en-US/chrome/global/aboutSupport.dtd1
-rw-r--r--toolkit/locales/en-US/chrome/global/aboutSupport.properties4
-rw-r--r--toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd3
-rw-r--r--toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties6
-rw-r--r--toolkit/locales/jar.mn2
-rw-r--r--toolkit/locales/update.locale1
-rw-r--r--toolkit/modules/AppConstants.jsm7
-rw-r--r--toolkit/modules/ExtensionStorage.jsm241
-rw-r--r--toolkit/modules/LightweightThemeConsumer.jsm5
-rw-r--r--toolkit/modules/ResetProfile.jsm21
-rw-r--r--toolkit/modules/Services.jsm4
-rw-r--r--toolkit/modules/UpdateUtils.jsm365
-rw-r--r--toolkit/modules/WindowDraggingUtils.jsm21
-rw-r--r--toolkit/modules/addons/.eslintrc.js1
-rw-r--r--toolkit/modules/addons/WebRequest.jsm14
-rw-r--r--toolkit/modules/moz.build41
-rw-r--r--toolkit/modules/secondscreen/PresentationApp.jsm190
-rw-r--r--toolkit/modules/secondscreen/RokuApp.jsm230
-rw-r--r--toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm432
-rw-r--r--toolkit/modules/subprocess/Subprocess.jsm15
-rw-r--r--toolkit/modules/subprocess/moz.build6
-rw-r--r--toolkit/modules/subprocess/subprocess_win.jsm3
-rw-r--r--toolkit/modules/subprocess/test/xpcshell/.eslintrc.js5
-rw-r--r--toolkit/modules/subprocess/test/xpcshell/data_test_script.py55
-rw-r--r--toolkit/modules/subprocess/test/xpcshell/data_text_file.txt0
-rw-r--r--toolkit/modules/subprocess/test/xpcshell/head.js14
-rw-r--r--toolkit/modules/subprocess/test/xpcshell/test_subprocess.js769
-rw-r--r--toolkit/modules/subprocess/test/xpcshell/test_subprocess_getEnvironment.js17
-rw-r--r--toolkit/modules/subprocess/test/xpcshell/test_subprocess_pathSearch.js73
-rw-r--r--toolkit/modules/subprocess/test/xpcshell/xpcshell.ini14
-rw-r--r--toolkit/modules/tests/MockDocument.jsm50
-rw-r--r--toolkit/modules/tests/PromiseTestUtils.jsm241
-rw-r--r--toolkit/modules/tests/browser/.eslintrc.js7
-rw-r--r--toolkit/modules/tests/browser/WebRequest_dynamic.sjs13
-rw-r--r--toolkit/modules/tests/browser/WebRequest_redirection.sjs4
-rw-r--r--toolkit/modules/tests/browser/browser.ini41
-rw-r--r--toolkit/modules/tests/browser/browser_AsyncPrefs.js97
-rw-r--r--toolkit/modules/tests/browser/browser_Battery.js51
-rw-r--r--toolkit/modules/tests/browser/browser_Deprecated.js157
-rw-r--r--toolkit/modules/tests/browser/browser_Finder.js62
-rw-r--r--toolkit/modules/tests/browser/browser_FinderHighlighter.js460
-rw-r--r--toolkit/modules/tests/browser/browser_Finder_hidden_textarea.js52
-rw-r--r--toolkit/modules/tests/browser/browser_Geometry.js111
-rw-r--r--toolkit/modules/tests/browser/browser_InlineSpellChecker.js121
-rw-r--r--toolkit/modules/tests/browser/browser_PageMetadata.js73
-rw-r--r--toolkit/modules/tests/browser/browser_PromiseMessage.js38
-rw-r--r--toolkit/modules/tests/browser/browser_RemotePageManager.js400
-rw-r--r--toolkit/modules/tests/browser/browser_Troubleshoot.js559
-rw-r--r--toolkit/modules/tests/browser/browser_WebNavigation.js140
-rw-r--r--toolkit/modules/tests/browser/browser_WebRequest.js214
-rw-r--r--toolkit/modules/tests/browser/browser_WebRequest_cookies.js89
-rw-r--r--toolkit/modules/tests/browser/browser_WebRequest_filtering.js118
-rw-r--r--toolkit/modules/tests/browser/dummy_page.html7
-rw-r--r--toolkit/modules/tests/browser/file_FinderSample.html824
-rw-r--r--toolkit/modules/tests/browser/file_WebNavigation_page1.html9
-rw-r--r--toolkit/modules/tests/browser/file_WebNavigation_page2.html7
-rw-r--r--toolkit/modules/tests/browser/file_WebNavigation_page3.html9
-rw-r--r--toolkit/modules/tests/browser/file_WebRequest_page1.html29
-rw-r--r--toolkit/modules/tests/browser/file_WebRequest_page2.html25
-rw-r--r--toolkit/modules/tests/browser/file_image_bad.pngbin5401 -> 0 bytes
-rw-r--r--toolkit/modules/tests/browser/file_image_good.pngbin580 -> 0 bytes
-rw-r--r--toolkit/modules/tests/browser/file_image_redirect.pngbin5401 -> 0 bytes
-rw-r--r--toolkit/modules/tests/browser/file_script_bad.js1
-rw-r--r--toolkit/modules/tests/browser/file_script_good.js1
-rw-r--r--toolkit/modules/tests/browser/file_script_redirect.js2
-rw-r--r--toolkit/modules/tests/browser/file_script_xhr.js3
-rw-r--r--toolkit/modules/tests/browser/file_style_bad.css3
-rw-r--r--toolkit/modules/tests/browser/file_style_good.css3
-rw-r--r--toolkit/modules/tests/browser/file_style_redirect.css3
-rw-r--r--toolkit/modules/tests/browser/head.js23
-rw-r--r--toolkit/modules/tests/browser/metadata_simple.html10
-rw-r--r--toolkit/modules/tests/browser/metadata_titles.html11
-rw-r--r--toolkit/modules/tests/browser/metadata_titles_fallback.html10
-rw-r--r--toolkit/modules/tests/browser/testremotepagemanager.html66
-rw-r--r--toolkit/modules/tests/chrome/.eslintrc.js7
-rw-r--r--toolkit/modules/tests/chrome/chrome.ini3
-rw-r--r--toolkit/modules/tests/chrome/test_bug544442_checkCert.xul155
-rw-r--r--toolkit/modules/tests/mochitest/.eslintrc.js7
-rw-r--r--toolkit/modules/tests/mochitest/mochitest.ini3
-rw-r--r--toolkit/modules/tests/mochitest/test_spatial_navigation.html76
-rw-r--r--toolkit/modules/tests/xpcshell/.eslintrc.js7
-rw-r--r--toolkit/modules/tests/xpcshell/TestIntegration.jsm42
-rw-r--r--toolkit/modules/tests/xpcshell/chromeappsstore.sqlitebin262144 -> 0 bytes
-rw-r--r--toolkit/modules/tests/xpcshell/propertyLists/bug710259_propertyListBinary.plistbin3277 -> 0 bytes
-rw-r--r--toolkit/modules/tests/xpcshell/propertyLists/bug710259_propertyListXML.plist28
-rw-r--r--toolkit/modules/tests/xpcshell/test_BinarySearch.js81
-rw-r--r--toolkit/modules/tests/xpcshell/test_CanonicalJSON.js146
-rw-r--r--toolkit/modules/tests/xpcshell/test_Color.js53
-rw-r--r--toolkit/modules/tests/xpcshell/test_DeferredTask.js390
-rw-r--r--toolkit/modules/tests/xpcshell/test_FileUtils.js226
-rw-r--r--toolkit/modules/tests/xpcshell/test_FinderIterator.js265
-rw-r--r--toolkit/modules/tests/xpcshell/test_GMPInstallManager.js794
-rw-r--r--toolkit/modules/tests/xpcshell/test_Http.js257
-rw-r--r--toolkit/modules/tests/xpcshell/test_Integration.js238
-rw-r--r--toolkit/modules/tests/xpcshell/test_JSONFile.js242
-rw-r--r--toolkit/modules/tests/xpcshell/test_Log.js592
-rw-r--r--toolkit/modules/tests/xpcshell/test_Log_stackTrace.js30
-rw-r--r--toolkit/modules/tests/xpcshell/test_MatchGlobs.js58
-rw-r--r--toolkit/modules/tests/xpcshell/test_MatchPattern.js95
-rw-r--r--toolkit/modules/tests/xpcshell/test_MatchURLFilters.js396
-rw-r--r--toolkit/modules/tests/xpcshell/test_NewTabUtils.js378
-rw-r--r--toolkit/modules/tests/xpcshell/test_ObjectUtils.js96
-rw-r--r--toolkit/modules/tests/xpcshell/test_ObjectUtils_strict.js29
-rw-r--r--toolkit/modules/tests/xpcshell/test_PermissionsUtils.js85
-rw-r--r--toolkit/modules/tests/xpcshell/test_Preferences.js378
-rw-r--r--toolkit/modules/tests/xpcshell/test_Promise.js1105
-rw-r--r--toolkit/modules/tests/xpcshell/test_PromiseUtils.js105
-rw-r--r--toolkit/modules/tests/xpcshell/test_Services.js90
-rw-r--r--toolkit/modules/tests/xpcshell/test_UpdateUtils_updatechannel.js38
-rw-r--r--toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js292
-rw-r--r--toolkit/modules/tests/xpcshell/test_ZipUtils.js79
-rw-r--r--toolkit/modules/tests/xpcshell/test_client_id.js95
-rw-r--r--toolkit/modules/tests/xpcshell/test_jsesc.js9
-rw-r--r--toolkit/modules/tests/xpcshell/test_propertyListsUtils.js106
-rw-r--r--toolkit/modules/tests/xpcshell/test_readCertPrefs.js97
-rw-r--r--toolkit/modules/tests/xpcshell/test_servicerequest_xhr.js25
-rw-r--r--toolkit/modules/tests/xpcshell/test_session_recorder.js306
-rw-r--r--toolkit/modules/tests/xpcshell/test_sqlite.js1094
-rw-r--r--toolkit/modules/tests/xpcshell/test_sqlite_shutdown.js122
-rw-r--r--toolkit/modules/tests/xpcshell/test_task.js642
-rw-r--r--toolkit/modules/tests/xpcshell/test_timer.js57
-rw-r--r--toolkit/modules/tests/xpcshell/test_web_channel.js149
-rw-r--r--toolkit/modules/tests/xpcshell/test_web_channel_broker.js88
-rw-r--r--toolkit/modules/tests/xpcshell/xpcshell.ini75
-rw-r--r--toolkit/modules/tests/xpcshell/zips/zen.zipbin1226 -> 0 bytes
-rw-r--r--toolkit/moz.build28
-rw-r--r--toolkit/moz.configure51
-rw-r--r--toolkit/mozapps/downloads/DownloadTaskbarProgress.jsm68
-rw-r--r--toolkit/mozapps/downloads/content/downloads.js30
-rw-r--r--toolkit/mozapps/downloads/jar.mn2
-rw-r--r--toolkit/mozapps/downloads/moz.build13
-rw-r--r--toolkit/mozapps/downloads/nsHelperAppDlg.js238
-rw-r--r--toolkit/mozapps/downloads/tests/chrome/.eslintrc.js7
-rw-r--r--toolkit/mozapps/downloads/tests/chrome/chrome.ini10
-rw-r--r--toolkit/mozapps/downloads/tests/chrome/test_unknownContentType_delayedbutton.xul117
-rw-r--r--toolkit/mozapps/downloads/tests/chrome/test_unknownContentType_dialog_layout.xul108
-rw-r--r--toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.pif1
-rw-r--r--toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.pif^headers^1
-rw-r--r--toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.txt1
-rw-r--r--toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.txt^headers^2
-rw-r--r--toolkit/mozapps/downloads/tests/moz.build8
-rw-r--r--toolkit/mozapps/downloads/tests/unit/.eslintrc.js7
-rw-r--r--toolkit/mozapps/downloads/tests/unit/head_downloads.js5
-rw-r--r--toolkit/mozapps/downloads/tests/unit/test_DownloadPaths.js131
-rw-r--r--toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js237
-rw-r--r--toolkit/mozapps/downloads/tests/unit/test_lowMinutes.js55
-rw-r--r--toolkit/mozapps/downloads/tests/unit/test_syncedDownloadUtils.js26
-rw-r--r--toolkit/mozapps/downloads/tests/unit/test_unspecified_arguments.js25
-rw-r--r--toolkit/mozapps/downloads/tests/unit/xpcshell.ini10
-rw-r--r--toolkit/mozapps/extensions/GMPUtils.jsm17
-rw-r--r--toolkit/mozapps/extensions/content/extensions.css17
-rw-r--r--toolkit/mozapps/extensions/content/extensions.js13
-rw-r--r--toolkit/mozapps/extensions/content/extensions.xml18
-rw-r--r--toolkit/mozapps/extensions/extensions.manifest6
-rw-r--r--toolkit/mozapps/extensions/internal/XPIProvider.jsm19
-rw-r--r--toolkit/mozapps/extensions/internal/moz.build7
-rw-r--r--toolkit/mozapps/extensions/moz.build5
-rw-r--r--toolkit/mozapps/installer/l10n-repack.py1
-rw-r--r--toolkit/mozapps/installer/packager-uxp.mk4
-rw-r--r--toolkit/mozapps/installer/packager.mk1
-rw-r--r--toolkit/mozapps/installer/upload-files.mk20
-rw-r--r--toolkit/mozapps/update/moz.build12
-rw-r--r--toolkit/mozapps/update/nsUpdateService.js292
-rw-r--r--toolkit/mozapps/update/tests/Makefile.in39
-rw-r--r--toolkit/mozapps/update/tests/TestAUSHelper.cpp415
-rw-r--r--toolkit/mozapps/update/tests/TestAUSReadStrings.cpp172
-rw-r--r--toolkit/mozapps/update/tests/TestAUSReadStrings1.ini47
-rw-r--r--toolkit/mozapps/update/tests/TestAUSReadStrings2.ini39
-rw-r--r--toolkit/mozapps/update/tests/TestAUSReadStrings3.ini39
-rw-r--r--toolkit/mozapps/update/tests/chrome/.eslintrc.js7
-rw-r--r--toolkit/mozapps/update/tests/chrome/chrome.ini64
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0010_background_basic.xul50
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0011_check_basic.xul51
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0012_check_basic_staging.xul55
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0013_check_no_updates.xul46
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0014_check_error_xml_malformed.xul46
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0061_check_verifyFailPartial_noComplete.xul52
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0062_check_verifyFailComplete_noPartial.xul52
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0063_check_verifyFailPartialComplete.xul52
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0064_check_verifyFailPartial_successComplete.xul52
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0071_notify_verifyFailPartial_noComplete.xul53
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0072_notify_verifyFailComplete_noPartial.xul52
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0073_notify_verifyFailPartialComplete.xul55
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0074_notify_verifyFailPartial_successComplete.xul55
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0081_error_patchApplyFailure_partial_only.xul53
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0082_error_patchApplyFailure_complete_only.xul52
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0083_error_patchApplyFailure_partial_complete.xul67
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0084_error_patchApplyFailure_verify_failed.xul68
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0085_error_patchApplyFailure_partial_complete_staging.xul94
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0092_finishedBackground.xul55
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0093_restartNotification.xul60
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0094_restartNotification_remote.xul60
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0095_restartNotification_remoteInvalidNumber.xul66
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0096_restartNotification_stagedBackground.xul65
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0097_restartNotification_stagedServiceBackground.xul65
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0101_background_restartNotification.xul46
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0102_background_restartNotification_staging.xul49
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0103_background_restartNotification_stagingService.xul50
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0111_neverButton_basic.xul61
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0113_showNeverForVersionRemovedWithPref.xul58
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0151_notify_backgroundCheckError.xul50
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0152_notify_backgroundCheckOfflineRetry.xul96
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0161_check_unsupported.xul50
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0162_notify_unsupported.xul44
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0171_check_noPerms_manual.xul64
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_0172_notify_noPerms_manual.xul63
-rw-r--r--toolkit/mozapps/update/tests/chrome/test_9999_cleanup.xul112
-rw-r--r--toolkit/mozapps/update/tests/chrome/update.sjs194
-rw-r--r--toolkit/mozapps/update/tests/chrome/utils.js1011
-rw-r--r--toolkit/mozapps/update/tests/data/complete.exebin79872 -> 0 bytes
-rw-r--r--toolkit/mozapps/update/tests/data/complete.marbin97888 -> 0 bytes
-rw-r--r--toolkit/mozapps/update/tests/data/complete.pngbin878 -> 0 bytes
-rw-r--r--toolkit/mozapps/update/tests/data/complete_log_success_mac332
-rw-r--r--toolkit/mozapps/update/tests/data/complete_log_success_win320
-rw-r--r--toolkit/mozapps/update/tests/data/complete_mac.marbin98454 -> 0 bytes
-rw-r--r--toolkit/mozapps/update/tests/data/complete_precomplete18
-rw-r--r--toolkit/mozapps/update/tests/data/complete_precomplete_mac21
-rw-r--r--toolkit/mozapps/update/tests/data/complete_removed-files41
-rw-r--r--toolkit/mozapps/update/tests/data/complete_removed-files_mac41
-rw-r--r--toolkit/mozapps/update/tests/data/complete_update_manifest59
-rw-r--r--toolkit/mozapps/update/tests/data/old_version.marbin421 -> 0 bytes
-rw-r--r--toolkit/mozapps/update/tests/data/partial.exebin79872 -> 0 bytes
-rw-r--r--toolkit/mozapps/update/tests/data/partial.marbin10645 -> 0 bytes
-rw-r--r--toolkit/mozapps/update/tests/data/partial.pngbin776 -> 0 bytes
-rw-r--r--toolkit/mozapps/update/tests/data/partial_log_failure_mac192
-rw-r--r--toolkit/mozapps/update/tests/data/partial_log_failure_win192
-rw-r--r--toolkit/mozapps/update/tests/data/partial_log_success_mac279
-rw-r--r--toolkit/mozapps/update/tests/data/partial_log_success_win279
-rw-r--r--toolkit/mozapps/update/tests/data/partial_mac.marbin11172 -> 0 bytes
-rw-r--r--toolkit/mozapps/update/tests/data/partial_precomplete19
-rw-r--r--toolkit/mozapps/update/tests/data/partial_precomplete_mac22
-rw-r--r--toolkit/mozapps/update/tests/data/partial_removed-files41
-rw-r--r--toolkit/mozapps/update/tests/data/partial_removed-files_mac41
-rw-r--r--toolkit/mozapps/update/tests/data/partial_update_manifest63
-rw-r--r--toolkit/mozapps/update/tests/data/replace_log_success6
-rw-r--r--toolkit/mozapps/update/tests/data/shared.js632
-rw-r--r--toolkit/mozapps/update/tests/data/sharedUpdateXML.js364
-rw-r--r--toolkit/mozapps/update/tests/data/simple.marbin1031 -> 0 bytes
-rw-r--r--toolkit/mozapps/update/tests/data/wrong_product_channel.marbin421 -> 0 bytes
-rw-r--r--toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js53
-rw-r--r--toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js4047
-rw-r--r--toolkit/mozapps/update/tests/moz.build95
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/.eslintrc.js7
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/canCheckForAndCanApplyUpdates.js138
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForDifferentChannel.js46
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForOlderAppVersion.js29
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForSameVersionAndBuildID.js30
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingIncorrectStatus.js35
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/cleanupPendingVersionFileIncorrectStatus.js37
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogMove.js37
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogsFIFO.js45
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/downloadAndHashCheckMar.js161
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/downloadCompleteAfterPartialFailure.js66
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/downloadInterruptedRecovery.js225
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/downloadResumeForSameAppVersion.js37
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/head_update.js8
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/remoteUpdateXML.js285
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/uiAutoPref.js75
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js76
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/uiUnsupportedAlreadyNotified.js74
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/updateManagerXML.js177
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/urlConstruction.js305
-rw-r--r--toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini27
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/.eslintrc.js7
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/head_update.js8
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/invalidArgCallbackFileNotInInstallDirFailure.js37
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/invalidArgCallbackFilePathTooLongFailure.js45
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTooLongFailure.js47
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTraversalFailure.js44
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallWorkingDirPathNotSameFailure_win.js38
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/invalidArgPatchDirPathTraversalFailure.js43
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/invalidArgStageDirNotInInstallDirFailure_win.js38
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathLocalUNCFailure_win.js38
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathRelativeFailure.js37
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marAppApplyDirLockedStageFailure_win.js41
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateAppBinInUseStageSuccess_win.js83
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageOldVersionFailure.js88
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js82
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js65
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js70
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageSuccessComplete_unix.js113
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marAppInUseSuccessComplete.js62
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessComplete_win.js61
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessPartial_win.js61
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppSuccessComplete_win.js48
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppSuccessPartial_win.js48
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marFailurePartial.js47
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailureComplete_win.js67
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailurePartial_win.js67
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessComplete_win.js63
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessPartial_win.js63
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailureComplete_win.js57
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailurePartial_win.js56
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailureComplete_win.js71
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailurePartial_win.js70
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailureComplete_win.js72
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailurePartial_win.js71
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessComplete_win.js63
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessPartial_win.js62
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marStageFailurePartial.js41
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessComplete.js132
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessPartial.js112
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marSuccessComplete.js96
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marSuccessPartial.js79
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marVersionDowngrade.js51
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/marWrongChannel.js51
-rw-r--r--toolkit/mozapps/update/tests/unit_base_updater/xpcshell.ini136
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/.eslintrc.js7
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/bootstrapSvc.js35
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/checkUpdaterSigSvc.js39
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/head_update.js8
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTooLongFailureSvc.js47
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTraversalFailureSvc.js44
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallWorkingDirPathNotSameFailureSvc_win.js38
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/invalidArgPatchDirPathTraversalFailureSvc.js43
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/invalidArgStageDirNotInInstallDirFailureSvc_win.js38
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathLocalUNCFailureSvc_win.js38
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathRelativeFailureSvc.js37
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marAppApplyDirLockedStageFailureSvc_win.js41
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateAppBinInUseStageSuccessSvc_win.js83
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js82
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js65
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marAppInUseStageFailureCompleteSvc_win.js70
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marAppInUseSuccessCompleteSvc.js62
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppStageSuccessCompleteSvc_win.js61
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppStageSuccessPartialSvc_win.js61
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppSuccessCompleteSvc_win.js48
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppSuccessPartialSvc_win.js48
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marFailurePartialSvc.js47
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailureCompleteSvc_win.js67
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailurePartialSvc_win.js67
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessCompleteSvc_win.js63
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessPartialSvc_win.js63
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailureCompleteSvc_win.js57
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailurePartialSvc_win.js56
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailureCompleteSvc_win.js71
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailurePartialSvc_win.js70
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailureCompleteSvc_win.js72
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailurePartialSvc_win.js71
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessCompleteSvc_win.js63
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessPartialSvc_win.js62
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marStageFailurePartialSvc.js41
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessCompleteSvc.js132
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessPartialSvc.js112
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marSuccessCompleteSvc.js96
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/marSuccessPartialSvc.js79
-rw-r--r--toolkit/mozapps/update/tests/unit_service_updater/xpcshell.ini156
-rw-r--r--toolkit/nss.configure16
-rw-r--r--toolkit/profile/content/createProfileWizard.js13
-rw-r--r--toolkit/profile/content/profileSelection.js6
-rw-r--r--toolkit/profile/gtest/TestProfileLock.cpp116
-rw-r--r--toolkit/profile/gtest/moz.build16
-rw-r--r--toolkit/profile/jar.mn4
-rw-r--r--toolkit/profile/moz.build24
-rw-r--r--toolkit/profile/nsToolkitProfileService.cpp4
-rw-r--r--toolkit/profile/test/.eslintrc.js7
-rw-r--r--toolkit/profile/test/chrome.ini3
-rw-r--r--toolkit/profile/test/test_create_profile.xul134
-rw-r--r--toolkit/system/androidproxy/moz.build11
-rw-r--r--toolkit/system/androidproxy/nsAndroidSystemProxySettings.cpp89
-rw-r--r--toolkit/themes/linux/mozapps/extensions/extensions.css7
-rw-r--r--toolkit/themes/linux/mozapps/extensions/stripes-compatibility.pngbin0 -> 1041 bytes
-rw-r--r--toolkit/themes/linux/mozapps/extensions/stripes-error.pngbin0 -> 1979 bytes
-rw-r--r--toolkit/themes/linux/mozapps/extensions/stripes-info-negative.pngbin0 -> 2027 bytes
-rw-r--r--toolkit/themes/linux/mozapps/extensions/stripes-info-positive.pngbin0 -> 1852 bytes
-rw-r--r--toolkit/themes/linux/mozapps/extensions/stripes-warning.pngbin0 -> 2177 bytes
-rw-r--r--toolkit/themes/linux/mozapps/jar.mn5
-rw-r--r--toolkit/themes/mobile/global/empty.css7
-rw-r--r--toolkit/themes/mobile/global/icons/Error.pngbin2148 -> 0 bytes
-rw-r--r--toolkit/themes/mobile/global/media/TopLevelImageDocument.css17
-rw-r--r--toolkit/themes/mobile/global/media/TopLevelVideoDocument.css12
-rw-r--r--toolkit/themes/mobile/global/media/clicktoplay-bgtexture.pngbin1751 -> 0 bytes
-rw-r--r--toolkit/themes/mobile/global/media/error.pngbin433 -> 0 bytes
-rw-r--r--toolkit/themes/mobile/global/media/imagedoc-darknoise.pngbin3050 -> 0 bytes
-rw-r--r--toolkit/themes/mobile/global/media/imagedoc-lightnoise.pngbin4025 -> 0 bytes
-rw-r--r--toolkit/themes/mobile/global/media/throbber.pngbin30718 -> 0 bytes
-rw-r--r--toolkit/themes/mobile/global/media/videoClickToPlayButton.svg30
-rw-r--r--toolkit/themes/mobile/jar.mn55
-rw-r--r--toolkit/themes/mobile/mozapps/plugins/contentPluginActivate.pngbin3043 -> 0 bytes
-rw-r--r--toolkit/themes/mobile/mozapps/plugins/contentPluginBlocked.pngbin1514 -> 0 bytes
-rw-r--r--toolkit/themes/mobile/mozapps/plugins/contentPluginClose.pngbin1370 -> 0 bytes
-rw-r--r--toolkit/themes/mobile/mozapps/plugins/contentPluginCrashed.pngbin1470 -> 0 bytes
-rw-r--r--toolkit/themes/mobile/mozapps/plugins/contentPluginDisabled.pngbin1620 -> 0 bytes
-rw-r--r--toolkit/themes/mobile/mozapps/plugins/contentPluginStripe.pngbin460 -> 0 bytes
-rw-r--r--toolkit/themes/mobile/mozapps/plugins/pluginProblem.css196
-rw-r--r--toolkit/themes/moz.build3
-rw-r--r--toolkit/themes/osx/mozapps/extensions/extensions.css7
-rw-r--r--toolkit/themes/osx/mozapps/extensions/stripes-compatibility.pngbin0 -> 1041 bytes
-rw-r--r--toolkit/themes/shared/mozapps.inc.mn11
-rw-r--r--toolkit/themes/shared/webextensions/alerticon-error.svg6
-rw-r--r--toolkit/themes/shared/webextensions/alerticon-info-negative.svg6
-rw-r--r--toolkit/themes/shared/webextensions/alerticon-info-positive.svg6
-rw-r--r--toolkit/themes/shared/webextensions/alerticon-warning.svg6
-rw-r--r--toolkit/themes/shared/webextensions/extensionGeneric.svg12
-rw-r--r--toolkit/themes/shared/webextensions/extensions.inc.css1082
-rw-r--r--toolkit/themes/shared/webextensions/navigation.pngbin663 -> 0 bytes
-rw-r--r--toolkit/themes/shared/webextensions/newaddon.inc.css114
-rw-r--r--toolkit/themes/shared/webextensions/utilities.svg30
-rw-r--r--toolkit/themes/windows/mozapps/extensions/extensions.css7
-rw-r--r--toolkit/themes/windows/mozapps/extensions/stripes-compatibility.pngbin0 -> 1041 bytes
-rw-r--r--toolkit/themes/windows/mozapps/jar.mn1
-rw-r--r--toolkit/toolkit.mozbuild13
-rw-r--r--toolkit/xre/moz.build58
-rw-r--r--toolkit/xre/nsAndroidStartup.cpp45
-rw-r--r--toolkit/xre/nsAppRunner.cpp114
-rw-r--r--toolkit/xre/nsEmbedFunctions.cpp8
-rw-r--r--toolkit/xre/nsSigHandlers.cpp6
-rw-r--r--toolkit/xre/nsUpdateDriver.cpp2
-rw-r--r--toolkit/xre/nsXREDirProvider.cpp13
-rw-r--r--toolkit/xre/test/.eslintrc.js7
-rw-r--r--toolkit/xre/test/browser.ini4
-rw-r--r--toolkit/xre/test/browser_checkdllblockliststate.js16
-rw-r--r--toolkit/xre/test/mochitest.ini3
-rw-r--r--toolkit/xre/test/test_fpuhandler.html38
-rw-r--r--toolkit/xre/test/win/Makefile.in14
-rw-r--r--toolkit/xre/test/win/TestDllInterceptor.cpp232
-rw-r--r--toolkit/xre/test/win/TestXREMakeCommandLineWin.cpp265
-rw-r--r--toolkit/xre/test/win/TestXREMakeCommandLineWin.ini94
-rw-r--r--toolkit/xre/test/win/moz.build30
-rw-r--r--tools/update-packaging/Makefile.in7
-rw-r--r--uriloader/exthandler/android/nsAndroidHandlerApp.cpp91
-rw-r--r--uriloader/exthandler/android/nsAndroidHandlerApp.h33
-rw-r--r--uriloader/exthandler/android/nsExternalSharingAppService.cpp61
-rw-r--r--uriloader/exthandler/android/nsExternalSharingAppService.h28
-rw-r--r--uriloader/exthandler/android/nsExternalURLHandlerService.cpp27
-rw-r--r--uriloader/exthandler/android/nsExternalURLHandlerService.h27
-rw-r--r--uriloader/exthandler/android/nsMIMEInfoAndroid.cpp427
-rw-r--r--uriloader/exthandler/android/nsMIMEInfoAndroid.h60
-rw-r--r--uriloader/exthandler/android/nsOSHelperAppService.cpp67
-rw-r--r--uriloader/exthandler/android/nsOSHelperAppService.h40
-rw-r--r--uriloader/exthandler/moz.build17
-rw-r--r--uriloader/exthandler/nsExternalHelperAppService.cpp51
-rw-r--r--widget/CompositorWidget.h9
-rw-r--r--widget/EventMessageList.h3
-rw-r--r--widget/GfxDriverInfo.h7
-rw-r--r--widget/GfxInfoBase.cpp6
-rw-r--r--widget/InProcessCompositorWidget.cpp8
-rw-r--r--widget/NativeKeyToDOMCodeName.h169
-rw-r--r--widget/NativeKeyToDOMKeyName.h110
-rw-r--r--widget/android/ANRReporter.cpp89
-rw-r--r--widget/android/ANRReporter.h26
-rw-r--r--widget/android/AndroidAlerts.cpp126
-rw-r--r--widget/android/AndroidAlerts.h44
-rw-r--r--widget/android/AndroidBridge.cpp1126
-rw-r--r--widget/android/AndroidBridge.h419
-rw-r--r--widget/android/AndroidBridgeUtilities.h13
-rw-r--r--widget/android/AndroidCompositorWidget.cpp63
-rw-r--r--widget/android/AndroidCompositorWidget.h44
-rw-r--r--widget/android/AndroidContentController.cpp157
-rw-r--r--widget/android/AndroidContentController.h59
-rw-r--r--widget/android/AndroidDirectTexture.h58
-rw-r--r--widget/android/AndroidGraphicBuffer.h72
-rw-r--r--widget/android/AndroidJNI.cpp47
-rw-r--r--widget/android/AndroidJNIWrapper.cpp140
-rw-r--r--widget/android/AndroidJNIWrapper.h34
-rw-r--r--widget/android/AndroidJavaWrappers.cpp62
-rw-r--r--widget/android/AndroidJavaWrappers.h218
-rw-r--r--widget/android/GeckoBatteryManager.h30
-rw-r--r--widget/android/GeckoNetworkManager.h53
-rw-r--r--widget/android/GeckoScreenOrientation.h55
-rw-r--r--widget/android/GeneratedJNINatives.h526
-rw-r--r--widget/android/GeneratedJNIWrappers.cpp1874
-rw-r--r--widget/android/GeneratedJNIWrappers.h5456
-rw-r--r--widget/android/GfxInfo.cpp605
-rw-r--r--widget/android/GfxInfo.h102
-rw-r--r--widget/android/NativeJSContainer.cpp881
-rw-r--r--widget/android/NativeJSContainer.h22
-rw-r--r--widget/android/PrefsHelper.h324
-rw-r--r--widget/android/bindings/AndroidRect-classes.txt2
-rw-r--r--widget/android/bindings/Bundle-classes.txt1
-rw-r--r--widget/android/bindings/KeyEvent-classes.txt1
-rw-r--r--widget/android/bindings/Makefile.in27
-rw-r--r--widget/android/bindings/MediaCodec-classes.txt5
-rw-r--r--widget/android/bindings/MotionEvent-classes.txt1
-rw-r--r--widget/android/bindings/SurfaceTexture-classes.txt2
-rw-r--r--widget/android/bindings/ViewConfiguration-classes.txt1
-rw-r--r--widget/android/bindings/moz.build41
-rw-r--r--widget/android/fennec/FennecJNINatives.h244
-rw-r--r--widget/android/fennec/FennecJNIWrappers.cpp443
-rw-r--r--widget/android/fennec/FennecJNIWrappers.h1469
-rw-r--r--widget/android/fennec/MemoryMonitor.h27
-rw-r--r--widget/android/fennec/Telemetry.h97
-rw-r--r--widget/android/fennec/ThumbnailHelper.h302
-rw-r--r--widget/android/fennec/moz.build21
-rw-r--r--widget/android/jni/Accessors.h274
-rw-r--r--widget/android/jni/Natives.h707
-rw-r--r--widget/android/jni/Refs.h953
-rw-r--r--widget/android/jni/Types.h140
-rw-r--r--widget/android/jni/Utils.cpp291
-rw-r--r--widget/android/jni/Utils.h147
-rw-r--r--widget/android/jni/moz.build24
-rw-r--r--widget/android/moz.build73
-rw-r--r--widget/android/nsAndroidProtocolHandler.cpp183
-rw-r--r--widget/android/nsAndroidProtocolHandler.h37
-rw-r--r--widget/android/nsAppShell.cpp683
-rw-r--r--widget/android/nsAppShell.h223
-rw-r--r--widget/android/nsClipboard.cpp123
-rw-r--r--widget/android/nsClipboard.h23
-rw-r--r--widget/android/nsDeviceContextAndroid.cpp84
-rw-r--r--widget/android/nsDeviceContextAndroid.h32
-rw-r--r--widget/android/nsIAndroidBridge.idl42
-rw-r--r--widget/android/nsIdleServiceAndroid.cpp23
-rw-r--r--widget/android/nsIdleServiceAndroid.h36
-rw-r--r--widget/android/nsLookAndFeel.cpp500
-rw-r--r--widget/android/nsLookAndFeel.h36
-rw-r--r--widget/android/nsPrintOptionsAndroid.cpp37
-rw-r--r--widget/android/nsPrintOptionsAndroid.h23
-rw-r--r--widget/android/nsScreenManagerAndroid.cpp264
-rw-r--r--widget/android/nsScreenManagerAndroid.h66
-rw-r--r--widget/android/nsWidgetFactory.cpp132
-rw-r--r--widget/android/nsWindow.cpp3638
-rw-r--r--widget/android/nsWindow.h289
-rw-r--r--widget/cocoa/nsCocoaFeatures.h3
-rw-r--r--widget/cocoa/nsCocoaFeatures.mm21
-rw-r--r--widget/cocoa/nsCocoaWindow.mm47
-rw-r--r--widget/moz.build23
-rw-r--r--widget/nsIWidget.h5
-rw-r--r--widget/nsIdleService.cpp111
-rw-r--r--widget/tests/TestAppShellSteadyState.cpp503
-rw-r--r--widget/tests/TestChromeMargin.cpp155
-rw-r--r--widget/tests/bug586713_window.xul50
-rw-r--r--widget/tests/chrome.ini100
-rw-r--r--widget/tests/chrome_context_menus_win.xul101
-rw-r--r--widget/tests/empty_window.xul4
-rw-r--r--widget/tests/mochitest.ini12
-rw-r--r--widget/tests/moz.build15
-rw-r--r--widget/tests/native_menus_window.xul285
-rw-r--r--widget/tests/native_mouse_mac_window.xul773
-rw-r--r--widget/tests/standalone_native_menu_window.xul334
-rw-r--r--widget/tests/taskbar_previews.xul127
-rw-r--r--widget/tests/test_assign_event_data.html748
-rw-r--r--widget/tests/test_bug1123480.xul79
-rw-r--r--widget/tests/test_bug1151186.html43
-rw-r--r--widget/tests/test_bug343416.xul202
-rw-r--r--widget/tests/test_bug413277.html36
-rw-r--r--widget/tests/test_bug428405.xul167
-rw-r--r--widget/tests/test_bug429954.xul44
-rw-r--r--widget/tests/test_bug444800.xul102
-rw-r--r--widget/tests/test_bug466599.xul109
-rw-r--r--widget/tests/test_bug478536.xul34
-rw-r--r--widget/tests/test_bug485118.xul71
-rw-r--r--widget/tests/test_bug517396.xul56
-rw-r--r--widget/tests/test_bug522217.xul36
-rw-r--r--widget/tests/test_bug538242.xul55
-rw-r--r--widget/tests/test_bug565392.html70
-rw-r--r--widget/tests/test_bug586713.xul30
-rw-r--r--widget/tests/test_bug593307.xul46
-rw-r--r--widget/tests/test_bug596600.xul177
-rw-r--r--widget/tests/test_bug673301.xul40
-rw-r--r--widget/tests/test_bug760802.xul91
-rw-r--r--widget/tests/test_chrome_context_menus_win.xul27
-rw-r--r--widget/tests/test_clipboard.xul80
-rw-r--r--widget/tests/test_composition_text_querycontent.xul34
-rw-r--r--widget/tests/test_imestate.html1529
-rw-r--r--widget/tests/test_input_events_on_deactive_window.xul236
-rw-r--r--widget/tests/test_key_event_counts.xul90
-rw-r--r--widget/tests/test_keycodes.xul4361
-rw-r--r--widget/tests/test_mouse_scroll.xul28
-rw-r--r--widget/tests/test_native_key_bindings_mac.html343
-rw-r--r--widget/tests/test_native_menus.xul30
-rw-r--r--widget/tests/test_native_mouse_mac.xul30
-rw-r--r--widget/tests/test_panel_mouse_coords.xul83
-rw-r--r--widget/tests/test_picker_no_crash.html36
-rw-r--r--widget/tests/test_platform_colors.xul107
-rw-r--r--widget/tests/test_plugin_input_event.html74
-rw-r--r--widget/tests/test_plugin_scroll_consistency.html61
-rw-r--r--widget/tests/test_position_on_resize.xul94
-rw-r--r--widget/tests/test_secure_input.html148
-rw-r--r--widget/tests/test_sizemode_events.xul105
-rw-r--r--widget/tests/test_standalone_native_menu.xul30
-rw-r--r--widget/tests/test_system_status_bar.xul57
-rw-r--r--widget/tests/test_taskbar_progress.xul126
-rw-r--r--widget/tests/test_wheeltransaction.xul28
-rw-r--r--widget/tests/unit/test_macwebapputils.js44
-rw-r--r--widget/tests/unit/test_taskbar_jumplistitems.js261
-rw-r--r--widget/tests/unit/xpcshell.ini7
-rw-r--r--widget/tests/utils.js27
-rw-r--r--widget/tests/window_bug429954.xul45
-rw-r--r--widget/tests/window_bug478536.xul215
-rw-r--r--widget/tests/window_bug522217.xul72
-rw-r--r--widget/tests/window_bug538242.xul3
-rw-r--r--widget/tests/window_bug593307_centerscreen.xul27
-rw-r--r--widget/tests/window_bug593307_offscreen.xul34
-rw-r--r--widget/tests/window_composition_text_querycontent.xul6992
-rw-r--r--widget/tests/window_imestate_iframes.html380
-rw-r--r--widget/tests/window_mouse_scroll_win.html1531
-rw-r--r--widget/tests/window_picker_no_crash_child.html10
-rw-r--r--widget/tests/window_state_windows.xul87
-rw-r--r--widget/tests/window_wheeltransaction.xul1560
-rw-r--r--xpcom/base/nsConsoleService.cpp47
-rw-r--r--xpcom/base/nsConsoleService.h3
-rw-r--r--xpcom/base/nsDebugImpl.cpp8
-rw-r--r--xpcom/base/nsDumpUtils.cpp60
-rw-r--r--xpcom/base/nsDumpUtils.h10
-rw-r--r--xpcom/base/nsMemoryImpl.cpp35
-rw-r--r--xpcom/base/nsMemoryInfoDumper.cpp12
-rw-r--r--xpcom/base/nsStatusReporterManager.cpp7
-rw-r--r--xpcom/base/nsSystemInfo.cpp117
-rw-r--r--xpcom/base/nsSystemInfo.h10
-rw-r--r--xpcom/base/nsUUIDGenerator.cpp4
-rw-r--r--xpcom/build/BinaryPath.h16
-rw-r--r--xpcom/build/XPCOMInit.cpp2
-rw-r--r--xpcom/build/XREChildData.h3
-rw-r--r--xpcom/components/ManifestParser.cpp30
-rw-r--r--xpcom/glue/FileUtils.cpp12
-rw-r--r--xpcom/glue/nsCRTGlue.cpp19
-rw-r--r--xpcom/glue/standalone/nsXPCOMGlue.cpp2
-rw-r--r--xpcom/io/SpecialSystemDirectory.cpp5
-rw-r--r--xpcom/io/nsLocalFileUnix.cpp56
-rw-r--r--xpcom/io/nsNativeCharsetUtils.cpp4
-rw-r--r--xpcom/io/nsNativeCharsetUtils.h4
-rw-r--r--xpcom/reflect/xptcall/md/unix/moz.build4
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_arm.cpp2
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_mips.S6
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp2
-rw-r--r--xpcom/reflect/xptcall/md/unix/xptcstubs_asm_mips.S6
-rw-r--r--xpcom/tests/gtest/TestTArray2.cpp3
-rw-r--r--xpcom/tests/gtest/moz.build3
-rw-r--r--xpcom/threads/ThreadStackHelper.cpp13
-rw-r--r--xpcom/threads/nsThread.cpp2
-rw-r--r--xpcom/threads/nsThread.h2
4563 files changed, 12554 insertions, 446252 deletions
diff --git a/Makefile.in b/Makefile.in
index 26cd688d4..6c2327388 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -47,6 +47,12 @@ ifndef MOZ_PROFILE_USE
# We need to explicitly put BUILD_BACKEND_FILES here otherwise the rule in
# rules.mk doesn't run early enough.
$(TIERS) binaries:: CLOBBER $(configure_dir)/configure config.status $(BUILD_BACKEND_FILES)
+
+# While our mozbuild backend has some kind of crazy install_manfests junk to
+# try and make this not have to happen, we actually want dist/bin to be
+# completely removed regardless.
+default alldep all::
+ @$(RM) -r $(DIST)/bin
ifndef JS_STANDALONE
ifdef COMPILE_ENVIRONMENT
$(TIERS) binaries:: $(topsrcdir)/js/src/configure js/src/config.status
diff --git a/README.md b/README.md
index 3867ebaf5..9460e9590 100644
--- a/README.md
+++ b/README.md
@@ -34,3 +34,6 @@ and other community members.
If you fork this repository to perform your own work on it, please consider offering
improvement patches upstream to its origin to mutually improve the platform and build
a future for XUL.
+
+## Looking for Pale Moon and Basilisk?
+As of [`Issue #969`](https://github.com/MoonchildProductions/UXP/issues/969), release versions `28.9.0` and `2020.03.04` respectively, they have been split off into their own dedicated repositories located at [`MoonchildProductions/Pale-Moon`](https://github.com/MoonchildProductions/Pale-Moon) and [`MoonchildProductions/Basilisk`](https://github.com/MoonchildProductions/Basilisk).
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 000000000..af9c916cd
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,36 @@
+# Security Policy
+
+## What is or is not a vulnerability?
+
+In general, vulnerabilities are those bugs that can actually be exploited to perform malicious tasks.
+Most _crashes_ are not security vulnerabilities. Although important to fix, they don't inherently cause a problem for the
+browser's security.
+
+What should be considered vulnerabilities or security hazards by default:
+- Use-after-free crashes, since those can potentially be used for remote code execution;
+- Spoofing issues in the UI;
+- File security issues, like out-of-bounds access to arbitrary files or locations;
+- Type confusion issues;
+- Bypass of security measures like CSP or the various mechanisms around HTTPS.
+
+Generally not security vulnerabilities:
+- Null dereferencing crashes;
+- Malware extensions (but please do report those on the forum in the extensions board!);
+- Denial-of-service (AKA "evil trap sites")
+- Browser hangs
+- Issues with non-standard manual configuration (either at build time or by manipulating about:config directly)
+
+## Reporting a Vulnerability
+
+If you find an issue in UXP or the applications it builds on that could impact the security or safety of users please **do not**
+make an issue on GitHub about it. GitHub does not support restricted viewability for security sensitive bugs.
+
+If you want to report a security-sensitive issue then please go to the [forum](https://forum.palemoon.org) and report the issue
+via a **private message** to **Moonchild** (the founder and prime responsible for security issues).
+The forum's private message system is fully secure since your visits are encrypted and private messages are not available to anyone
+except the recipient (not even moderators!).
+
+You will be informed via private message if the vulnerability report is accepted or declined, with reasoning.
+Security updates occur regularly and are given priority over most other development tasks. In general, they can be solved
+relatively quickly and will be included in the next point release (third digit if not rolled into a more major one).
+
diff --git a/accessible/html/HTMLTableAccessible.cpp b/accessible/html/HTMLTableAccessible.cpp
index b0cdc0932..af7dd561f 100644
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -175,23 +175,17 @@ HTMLTableCellAccessible::Table() const
uint32_t
HTMLTableCellAccessible::ColIdx() const
{
- nsITableCellLayout* cellLayout = GetCellLayout();
- NS_ENSURE_TRUE(cellLayout, 0);
-
- int32_t colIdx = 0;
- cellLayout->GetColIndex(colIdx);
- return colIdx > 0 ? static_cast<uint32_t>(colIdx) : 0;
+ nsTableCellFrame* cellFrame = GetCellFrame();
+ NS_ENSURE_TRUE(cellFrame, 0);
+ return cellFrame->ColIndex();
}
uint32_t
HTMLTableCellAccessible::RowIdx() const
{
- nsITableCellLayout* cellLayout = GetCellLayout();
- NS_ENSURE_TRUE(cellLayout, 0);
-
- int32_t rowIdx = 0;
- cellLayout->GetRowIndex(rowIdx);
- return rowIdx > 0 ? static_cast<uint32_t>(rowIdx) : 0;
+ nsTableCellFrame* cellFrame = GetCellFrame();
+ NS_ENSURE_TRUE(cellFrame, 0);
+ return cellFrame->RowIndex();
}
uint32_t
@@ -285,6 +279,12 @@ HTMLTableCellAccessible::GetCellLayout() const
return do_QueryFrame(mContent->GetPrimaryFrame());
}
+nsTableCellFrame*
+HTMLTableCellAccessible::GetCellFrame() const
+{
+ return do_QueryFrame(mContent->GetPrimaryFrame());
+}
+
nsresult
HTMLTableCellAccessible::GetCellIndexes(int32_t& aRowIdx, int32_t& aColIdx) const
{
@@ -520,11 +520,9 @@ HTMLTableAccessible::SelectedCellCount()
if (!cellFrame || !cellFrame->IsSelected())
continue;
- int32_t startRow = -1, startCol = -1;
- cellFrame->GetRowIndex(startRow);
- cellFrame->GetColIndex(startCol);
- if (startRow >= 0 && (uint32_t)startRow == rowIdx &&
- startCol >= 0 && (uint32_t)startCol == colIdx)
+ uint32_t startRow = cellFrame->RowIndex();
+ uint32_t startCol = cellFrame->ColIndex();
+ if (startRow == rowIdx && startCol == colIdx)
count++;
}
}
@@ -570,11 +568,9 @@ HTMLTableAccessible::SelectedCells(nsTArray<Accessible*>* aCells)
if (!cellFrame || !cellFrame->IsSelected())
continue;
- int32_t startCol = -1, startRow = -1;
- cellFrame->GetRowIndex(startRow);
- cellFrame->GetColIndex(startCol);
- if ((startRow >= 0 && (uint32_t)startRow != rowIdx) ||
- (startCol >= 0 && (uint32_t)startCol != colIdx))
+ uint32_t startRow = cellFrame->RowIndex();
+ uint32_t startCol = cellFrame->ColIndex();
+ if (startRow != rowIdx || startCol != colIdx)
continue;
Accessible* cell = mDoc->GetAccessible(cellFrame->GetContent());
@@ -597,11 +593,9 @@ HTMLTableAccessible::SelectedCellIndices(nsTArray<uint32_t>* aCells)
if (!cellFrame || !cellFrame->IsSelected())
continue;
- int32_t startRow = -1, startCol = -1;
- cellFrame->GetColIndex(startCol);
- cellFrame->GetRowIndex(startRow);
- if (startRow >= 0 && (uint32_t)startRow == rowIdx &&
- startCol >= 0 && (uint32_t)startCol == colIdx)
+ uint32_t startCol = cellFrame->ColIndex();
+ uint32_t startRow = cellFrame->RowIndex();
+ if (startRow == rowIdx && startCol == colIdx)
aCells->AppendElement(CellIndexAt(rowIdx, colIdx));
}
}
diff --git a/accessible/html/HTMLTableAccessible.h b/accessible/html/HTMLTableAccessible.h
index 830d34ae9..c7cfc9ddf 100644
--- a/accessible/html/HTMLTableAccessible.h
+++ b/accessible/html/HTMLTableAccessible.h
@@ -11,6 +11,7 @@
#include "TableCellAccessible.h"
class nsITableCellLayout;
+class nsTableCellFrame;
namespace mozilla {
namespace a11y {
@@ -54,6 +55,11 @@ protected:
nsITableCellLayout* GetCellLayout() const;
/**
+ * Return the table cell frame.
+ */
+ nsTableCellFrame* GetCellFrame() const;
+
+ /**
* Return row and column indices of the cell.
*/
nsresult GetCellIndexes(int32_t& aRowIdx, int32_t& aColIdx) const;
diff --git a/build/autoconf/config.guess b/build/autoconf/config.guess
index d5d667d4a..8fe758339 100755
--- a/build/autoconf/config.guess
+++ b/build/autoconf/config.guess
@@ -381,11 +381,14 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
SUN_ARCH=i386
- # If there is a compiler, see if it is configured for 64-bit objects.
- # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
- # This test works for both compilers.
- if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
- if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+ _ISAINFO=`isainfo -k 2>/dev/null`
+ if [ "$_ISAINFO" = "amd64" ]; then
+ SUN_ARCH=x86_64
+ elif [ "$CC_FOR_BUILD" != no_compiler_found ]; then
+ # If there is a compiler, see if it is configured for 64-bit objects.
+ # Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+ # This test works for both compilers.
+ if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
@@ -842,6 +845,13 @@ EOF
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
+ *:MINGW32_NT*:*)
+ if [ "$PLATFORM" = "X64" ]; then
+ echo x86_64-pc-mingw32
+ else
+ echo ${UNAME_MACHINE}-pc-mingw32
+ fi
+ exit ;;
*:MINGW64*:*)
echo ${UNAME_MACHINE}-pc-mingw64
exit ;;
diff --git a/build/autoconf/icu.m4 b/build/autoconf/icu.m4
index d3cc3113d..b5111598c 100644
--- a/build/autoconf/icu.m4
+++ b/build/autoconf/icu.m4
@@ -8,19 +8,6 @@ dnl ICU library, as well as a few other things.
AC_DEFUN([MOZ_CONFIG_ICU], [
ICU_LIB_NAMES=
-MOZ_SYSTEM_ICU=
-MOZ_ARG_WITH_BOOL(system-icu,
-[ --with-system-icu
- Use system ICU (located with pkgconfig)],
- MOZ_SYSTEM_ICU=1)
-
-if test -n "$MOZ_SYSTEM_ICU"; then
- PKG_CHECK_MODULES(MOZ_ICU, icu-i18n >= 58.1)
- CFLAGS="$CFLAGS $MOZ_ICU_CFLAGS"
- CXXFLAGS="$CXXFLAGS $MOZ_ICU_CFLAGS"
-fi
-
-AC_SUBST(MOZ_SYSTEM_ICU)
dnl We always use ICU.
USE_ICU=1
@@ -51,7 +38,7 @@ if test -n "$USE_ICU"; then
dnl We also don't do it on Windows because sometimes the file goes
dnl missing -- possibly due to overzealous antivirus software? --
dnl which prevents the browser from starting up :(
- if test -z "$JS_STANDALONE" -a -z "$MOZ_SYSTEM_ICU" -a "$OS_TARGET" != WINNT -a "$MOZ_WIDGET_TOOLKIT" != "android"; then
+ if test -z "$JS_STANDALONE" -a "$OS_TARGET" != WINNT -a "$MOZ_WIDGET_TOOLKIT" != "android"; then
MOZ_ICU_DATA_ARCHIVE=1
else
MOZ_ICU_DATA_ARCHIVE=
@@ -64,7 +51,7 @@ AC_SUBST(USE_ICU)
AC_SUBST(ICU_DATA_FILE)
AC_SUBST(MOZ_ICU_DATA_ARCHIVE)
-if test -n "$USE_ICU" -a -z "$MOZ_SYSTEM_ICU"; then
+if test -n "$USE_ICU"; then
if test -z "$YASM" -a -z "$GNU_AS" -a "$COMPILE_ENVIRONMENT"; then
AC_MSG_ERROR([Building ICU requires either yasm or a GNU assembler. If you do not have either of those available for this platform you must use --without-intl-api])
fi
diff --git a/build/autoconf/nspr-build.m4 b/build/autoconf/nspr-build.m4
index b733579c2..b53fb4d37 100644
--- a/build/autoconf/nspr-build.m4
+++ b/build/autoconf/nspr-build.m4
@@ -42,15 +42,6 @@ if test "$MOZ_BUILD_APP" != js || test -n "$JS_STANDALONE"; then
_IS_OUTER_CONFIGURE=1
fi
-MOZ_ARG_WITH_BOOL(system-nspr,
-[ --with-system-nspr Use an NSPR that is already built and installed.
- Use the 'nspr-config' script in the current path,
- or look for the script in the directories given with
- --with-nspr-exec-prefix or --with-nspr-prefix.
- (Those flags are only checked if you specify
- --with-system-nspr.)],
- _USE_SYSTEM_NSPR=1 )
-
JS_POSIX_NSPR=unset
ifdef([CONFIGURING_JS],[
if test -n "$JS_STANDALONE"; then
@@ -71,7 +62,6 @@ ifdef([CONFIGURING_JS],[
])
dnl Pass at most one of
-dnl --with-system-nspr
dnl --with-nspr-cflags/libs
dnl --enable-nspr-build
dnl --enable-posix-nspr-emulation
@@ -79,10 +69,6 @@ dnl --enable-posix-nspr-emulation
AC_MSG_CHECKING([NSPR selection])
nspr_opts=
which_nspr=default
-if test -n "$_USE_SYSTEM_NSPR"; then
- nspr_opts="x$nspr_opts"
- which_nspr="system"
-fi
if test -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then
nspr_opts="x$nspr_opts"
which_nspr="command-line"
@@ -136,11 +122,7 @@ fi
# anything itself.
if test -n "$_IS_OUTER_CONFIGURE"; then
-if test -n "$_USE_SYSTEM_NSPR"; then
- AM_PATH_NSPR($NSPR_MINVER, [MOZ_SYSTEM_NSPR=1], [AC_MSG_ERROR([you do not have NSPR installed or your version is older than $NSPR_MINVER.])])
-fi
-
-if test -n "$MOZ_SYSTEM_NSPR" -o -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then
+if test -n "$NSPR_CFLAGS" -o -n "$NSPR_LIBS"; then
_SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS $NSPR_CFLAGS"
AC_TRY_COMPILE([#include "prtypes.h"],
@@ -178,19 +160,7 @@ AC_SUBST(NSPR_INCLUDE_DIR)
AC_SUBST(NSPR_LIB_DIR)
PKGCONF_REQUIRES_PRIVATE="Requires.private: nspr"
-if test -n "$MOZ_SYSTEM_NSPR"; then
- _SAVE_CFLAGS=$CFLAGS
- CFLAGS="$CFLAGS $NSPR_CFLAGS"
- AC_TRY_COMPILE([#include "prlog.h"],
- [#ifndef PR_STATIC_ASSERT
- #error PR_STATIC_ASSERT not defined
- #endif],
- ,
- AC_MSG_ERROR([system NSPR does not support PR_STATIC_ASSERT]))
- CFLAGS=$_SAVE_CFLAGS
- # piggy back on $MOZ_SYSTEM_NSPR to set a variable for the nspr check for js.pc
- PKGCONF_REQUIRES_PRIVATE="Requires.private: nspr >= $NSPR_MINVER"
-elif test -n "$JS_POSIX_NSPR"; then
+if test -n "$JS_POSIX_NSPR"; then
PKGCONF_REQUIRES_PRIVATE=
fi
AC_SUBST([PKGCONF_REQUIRES_PRIVATE])
diff --git a/build/defines.sh b/build/defines.sh
deleted file mode 100644
index cf98c3d8b..000000000
--- a/build/defines.sh
+++ /dev/null
@@ -1,3 +0,0 @@
-# Define indicating that this build is prior to one of the early betas. To be
-# unset mid-way through the beta cycle.
-EARLY_BETA_OR_EARLIER=
diff --git a/build/directive4.py b/build/directive4.py
index bb832f6b7..650349d68 100644
--- a/build/directive4.py
+++ b/build/directive4.py
@@ -33,14 +33,9 @@ if ('MOZ_OFFICIAL_BRANDING' in listConfig) or (strBrandingDirectory.endswith("br
# Applies to Pale Moon and Basilisk
if ('MC_BASILISK' in listConfig) or ('MC_PALEMOON' in listConfig):
listViolations += [
- 'MOZ_SYSTEM_NSS',
- 'MOZ_SYSTEM_NSPR',
'MOZ_SYSTEM_JPEG',
'MOZ_SYSTEM_ZLIB',
'MOZ_SYSTEM_BZ2',
- 'MOZ_SYSTEM_PNG',
- 'MOZ_SYSTEM_LIBVPX',
- 'MOZ_SYSTEM_SQLITE',
'MOZ_SYSTEM_JEMALLOC'
]
diff --git a/build/moz.configure/old.configure b/build/moz.configure/old.configure
index 65add5cdc..d0f6909b9 100644
--- a/build/moz.configure/old.configure
+++ b/build/moz.configure/old.configure
@@ -166,6 +166,7 @@ def old_configure_options(*options):
'--enable-cookies',
'--enable-cpp-rtti',
'--enable-crashreporter',
+ '--enable-dbm',
'--enable-dbus',
'--enable-debug-js-modules',
'--enable-jetpack',
@@ -222,6 +223,7 @@ def old_configure_options(*options):
'--enable-release',
'--enable-safe-browsing',
'--enable-sandbox',
+ '--enable-security-sqlstore',
'--enable-signmar',
'--enable-simulator',
'--enable-small-chunk-size',
@@ -233,7 +235,6 @@ def old_configure_options(*options):
'--enable-system-cairo',
'--enable-system-extension-dirs',
'--enable-system-pixman',
- '--enable-system-sqlite',
'--enable-tasktracer',
'--enable-tests',
'--enable-thread-sanitizer',
@@ -287,13 +288,7 @@ def old_configure_options(*options):
'--with-sixgill',
'--with-soft-float',
'--with-system-bz2',
- '--with-system-icu',
'--with-system-jpeg',
- '--with-system-libevent',
- '--with-system-libvpx',
- '--with-system-nspr',
- '--with-system-nss',
- '--with-system-png',
'--with-system-zlib',
'--with-thumb',
'--with-thumb-interwork',
diff --git a/build/ppCheck.py b/build/ppCheck.py
new file mode 100644
index 000000000..1e27ca171
--- /dev/null
+++ b/build/ppCheck.py
@@ -0,0 +1,72 @@
+#!/usr/bin/env python
+
+from __future__ import print_function
+import os, sys
+
+if not len(sys.argv) is 2 or not os.path.exists(sys.argv[1]):
+ print("\nYou did not supply a valid path to check.")
+ exit(1)
+else:
+ print("\nChecking for un-preprocessed files...", end = ' ')
+ DIST_PATH = sys.argv[1]
+
+PP_FILE_TYPES = (
+ '.css',
+ '.dtd',
+ '.html',
+ '.js',
+ '.jsm',
+ '.xhtml',
+ '.xml',
+ '.xul',
+ '.manifest',
+ '.properties',
+ '.rdf'
+)
+
+PP_SPECIAL_TYPES = ('.css')
+
+PP_DIRECTIVES = [
+ 'define',
+ 'if',
+ 'ifdef',
+ 'ifndef',
+ 'elif',
+ 'elifdef',
+ 'endif',
+ 'error',
+ 'expand',
+ 'filter',
+ 'include',
+ 'literal',
+ 'undef',
+ 'unfilter'
+]
+
+PP_FILES = []
+PP_BAD_FILES = []
+
+for root, directories, filenames in os.walk(DIST_PATH):
+ for filename in filenames:
+ if filename.endswith(PP_FILE_TYPES):
+ PP_FILES += [ os.path.join(root, filename).replace(os.sep, '/') ]
+
+for file in PP_FILES:
+ with open(file) as fp:
+ marker = '%' if file.endswith(PP_SPECIAL_TYPES) else '#'
+ directives = tuple(marker + directive for directive in PP_DIRECTIVES)
+ for line in fp:
+ if line.startswith(directives):
+ PP_BAD_FILES += [ file.replace(DIST_PATH + '/', '') ]
+ fp.close()
+
+PP_BAD_FILES = list(dict.fromkeys(PP_BAD_FILES))
+
+print('Done!')
+
+if len(PP_BAD_FILES) > 0:
+ print("\nWARNING: The following {0} file(s) in {1} may require preprocessing:\n".format(len(PP_BAD_FILES), DIST_PATH))
+ for file in PP_BAD_FILES:
+ print(file)
+
+exit(0) \ No newline at end of file
diff --git a/config/Makefile.in b/config/Makefile.in
index 1512520e4..c9cc3592c 100644
--- a/config/Makefile.in
+++ b/config/Makefile.in
@@ -44,10 +44,7 @@ export:: $(export-preqs)
-DMOZ_SYSTEM_HUNSPELL=$(MOZ_SYSTEM_HUNSPELL) \
-DMOZ_SYSTEM_BZ2=$(MOZ_SYSTEM_BZ2) \
-DMOZ_SYSTEM_ZLIB=$(MOZ_SYSTEM_ZLIB) \
- -DMOZ_SYSTEM_PNG=$(MOZ_SYSTEM_PNG) \
-DMOZ_SYSTEM_JPEG=$(MOZ_SYSTEM_JPEG) \
- -DMOZ_SYSTEM_LIBVPX=$(MOZ_SYSTEM_LIBVPX) \
- -DMOZ_SYSTEM_ICU=$(MOZ_SYSTEM_ICU) \
$(srcdir)/system-headers $(srcdir)/stl-headers | $(PERL) $(topsrcdir)/nsprpub/config/make-system-wrappers.pl system_wrappers
$(INSTALL) system_wrappers $(DIST)
diff --git a/config/external/icu/moz.build b/config/external/icu/moz.build
index 248652a85..488a02159 100644
--- a/config/external/icu/moz.build
+++ b/config/external/icu/moz.build
@@ -6,16 +6,14 @@
Library('icu')
-if CONFIG['MOZ_SYSTEM_ICU']:
- OS_LIBS += CONFIG['MOZ_ICU_LIBS']
+DIRS += [
+ 'common',
+ 'data',
+ 'i18n',
+]
+
+if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
+ DIRS += ['stubdata']
+ USE_LIBS += ['icustubdata']
else:
- DIRS += [
- 'common',
- 'data',
- 'i18n',
- ]
- if CONFIG['MOZ_ICU_DATA_ARCHIVE']:
- DIRS += ['stubdata']
- USE_LIBS += ['icustubdata']
- else:
- USE_LIBS += ['icudata']
+ USE_LIBS += ['icudata']
diff --git a/config/external/moz.build b/config/external/moz.build
index fbf6da089..f4013c18a 100644
--- a/config/external/moz.build
+++ b/config/external/moz.build
@@ -6,10 +6,8 @@
external_dirs = []
-DIRS += [
- 'lgpllibs',
- 'sqlite',
-]
+DIRS += ['lgpllibs']
+
if not CONFIG['MOZ_SYSTEM_JPEG']:
external_dirs += ['media/libjpeg']
@@ -30,14 +28,12 @@ if CONFIG['MOZ_TREMOR']:
if CONFIG['MOZ_WEBM_ENCODER']:
external_dirs += ['media/libmkv']
-if not CONFIG['MOZ_SYSTEM_LIBVPX']:
- external_dirs += ['media/libvpx']
+external_dirs += ['media/libvpx']
if CONFIG['MOZ_AV1']:
external_dirs += ['media/libaom']
-if not CONFIG['MOZ_SYSTEM_PNG']:
- external_dirs += ['media/libpng']
+external_dirs += ['media/libpng']
external_dirs += ['media/libwebp']
diff --git a/config/external/nss/Makefile.in b/config/external/nss/Makefile.in
index 71954b403..7289e57f4 100644
--- a/config/external/nss/Makefile.in
+++ b/config/external/nss/Makefile.in
@@ -3,8 +3,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-ifndef MOZ_SYSTEM_NSS
-
CC_WRAPPER =
CXX_WRAPPER =
@@ -121,15 +119,9 @@ DEFAULT_GMAKE_FLAGS += NSS_ENABLE_TLS_1_3=1
ifeq ($(OS_ARCH)_$(GNU_CC),WINNT_1)
DEFAULT_GMAKE_FLAGS += OS_DLLFLAGS='-static-libgcc' NSPR31_LIB_PREFIX=lib
endif
-ifndef MOZ_SYSTEM_SQLITE
-ifdef MOZ_FOLD_LIBS
-DEFAULT_GMAKE_FLAGS += SQLITE_LIB_NAME=nss3
-else
DEFAULT_GMAKE_FLAGS += SQLITE_LIB_NAME=mozsqlite3
-DEFAULT_GMAKE_FLAGS += SQLITE_LIB_DIR=$(ABS_DIST)/../config/external/sqlite
-endif # MOZ_FOLD_LIBS
+DEFAULT_GMAKE_FLAGS += SQLITE_LIB_DIR=$(ABS_DIST)/../db/sqlite3/src
DEFAULT_GMAKE_FLAGS += SQLITE_INCLUDE_DIR=$(ABS_DIST)/include
-endif
ifdef NSS_DISABLE_DBM
DEFAULT_GMAKE_FLAGS += NSS_DISABLE_DBM=1
endif
@@ -475,4 +467,3 @@ endif # MOZ_FOLD_LIBS
# security/nss/lib/ckfw/builtins. See bug #836220.
libs-nss/lib$(if $(MOZ_FOLD_LIBS),/ckfw): $(call mkdir_deps,$(DEPTH)/security/nss/lib/ckfw/builtins)
-endif
diff --git a/config/external/nss/crmf/moz.build b/config/external/nss/crmf/moz.build
index 04d985d74..8b5434a49 100644
--- a/config/external/nss/crmf/moz.build
+++ b/config/external/nss/crmf/moz.build
@@ -6,14 +6,11 @@
Library('crmf')
-if CONFIG['MOZ_SYSTEM_NSS']:
- OS_LIBS += [l for l in CONFIG['NSS_LIBS'] if l.startswith('-L')]
-else:
- USE_LIBS += [
- # The dependency on nss is not real, but is required to force the
- # parent directory being built before this one. This has no
- # practical effect on linkage, since the only thing linking crmf
- # will need nss anyways.
- 'nss',
- 'static:/security/nss/lib/crmf/crmf',
- ]
+USE_LIBS += [
+ # The dependency on nss is not real, but is required to force the
+ # parent directory being built before this one. This has no
+ # practical effect on linkage, since the only thing linking crmf
+ # will need nss anyways.
+ 'nss',
+ 'static:/security/nss/lib/crmf/crmf',
+]
diff --git a/config/external/nss/moz.build b/config/external/nss/moz.build
index 1c61b28fd..bf94d7648 100644
--- a/config/external/nss/moz.build
+++ b/config/external/nss/moz.build
@@ -6,10 +6,7 @@
DIRS += ['crmf']
-if CONFIG['MOZ_SYSTEM_NSS']:
- Library('nss')
- OS_LIBS += CONFIG['NSS_LIBS']
-elif CONFIG['MOZ_FOLD_LIBS']:
+if CONFIG['MOZ_FOLD_LIBS']:
GeckoSharedLibrary('nss', linkage=None)
# TODO: The library name can be changed when bug 845217 is fixed.
SHARED_LIBRARY_NAME = 'nss3'
@@ -32,9 +29,10 @@ else:
'/security/nss/lib/smime/smime3',
'/security/nss/lib/ssl/ssl3',
'/security/nss/lib/util/nssutil3',
- 'sqlite',
]
+USE_LIBS += ['sqlite']
+
# XXX: We should fix these warnings.
ALLOW_COMPILER_WARNINGS = True
diff --git a/config/external/nss/nss.symbols b/config/external/nss/nss.symbols
index c46f86dea..705af4a94 100644
--- a/config/external/nss/nss.symbols
+++ b/config/external/nss/nss.symbols
@@ -13,7 +13,6 @@
PR_*
PL_*
#endif
-#include ../../../db/sqlite3/src/sqlite.symbols
ATOB_AsciiToData
ATOB_AsciiToData_Util
ATOB_ConvertAsciiToItem
diff --git a/config/external/sqlite/moz.build b/config/external/sqlite/moz.build
deleted file mode 100644
index 76908d902..000000000
--- a/config/external/sqlite/moz.build
+++ /dev/null
@@ -1,22 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-if CONFIG['MOZ_SYSTEM_SQLITE']:
- Library('sqlite')
- OS_LIBS += CONFIG['SQLITE_LIBS']
-else:
- DIRS += ['../../../db/sqlite3/src']
- if CONFIG['MOZ_FOLD_LIBS']:
- Library('sqlite')
- # When folding libraries, sqlite is actually in the nss library.
- USE_LIBS += [
- 'nss',
- ]
- else:
- SharedLibrary('sqlite')
- SHARED_LIBRARY_NAME = 'mozsqlite3'
-
- SYMBOLS_FILE = '/db/sqlite3/src/sqlite.symbols'
diff --git a/config/moz.build b/config/moz.build
index 7bcac7992..c512bd07d 100644
--- a/config/moz.build
+++ b/config/moz.build
@@ -29,9 +29,6 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT':
# while the program here is in C.
HostProgram('nsinstall_real', c_only=True)
-if CONFIG['MOZ_SYSTEM_ICU']:
- DEFINES['MOZ_SYSTEM_ICU'] = True
-
PYTHON_UNIT_TESTS += [
'tests/test_mozbuild_reading.py',
'tests/unit-expandlibs.py',
diff --git a/config/recurse.mk b/config/recurse.mk
index 0b469c1c3..6bf5670b5 100644
--- a/config/recurse.mk
+++ b/config/recurse.mk
@@ -172,7 +172,7 @@ ifeq ($(MOZ_REPLACE_MALLOC_LINKAGE),dummy library)
mozglue/build/target memory/replace/logalloc/replay/target: memory/replace/dummy/target
endif
endif
-ifeq (,$(MOZ_SYSTEM_NSPR)$(MOZ_SYSTEM_NSS)$(MOZ_FOLD_LIBS))
+ifeq (,$(MOZ_FOLD_LIBS))
config/external/nss/target: config/external/nspr/pr/target config/external/nspr/ds/target config/external/nspr/libc/target
endif
# Most things are built during compile (target/host), but some things happen during export
diff --git a/config/system-headers b/config/system-headers
index 29eef3210..3685d6d1c 100644
--- a/config/system-headers
+++ b/config/system-headers
@@ -1253,9 +1253,6 @@ soundtouch/SoundTouchFactory.h
#if MOZ_LIBAV_FFT==1
libavcodec/avfft.h
#endif
-#if MOZ_SYSTEM_PNG==1
-png.h
-#endif
#if MOZ_SYSTEM_ZLIB==1
zlib.h
#endif
@@ -1291,15 +1288,6 @@ QtSparql/qsparqlresult.h
#if MOZ_TREE_PIXMAN!=1
pixman.h
#endif
-#if MOZ_SYSTEM_LIBVPX==1
-vpx/svc_context.h
-vpx/vpx_codec.h
-vpx/vpx_decoder.h
-vpx/vpx_encoder.h
-vpx/vp8cx.h
-vpx/vp8dx.h
-vpx_mem/vpx_mem.h
-#endif
gst/gst.h
gst/app/gstappsink.h
gst/app/gstappsrc.h
@@ -1312,22 +1300,6 @@ kvm.h
spawn.h
err.h
xlocale.h
-#ifdef MOZ_SYSTEM_ICU
-unicode/locid.h
-unicode/numsys.h
-unicode/timezone.h
-unicode/ucal.h
-unicode/uchar.h
-unicode/uclean.h
-unicode/ucol.h
-unicode/udat.h
-unicode/udatpg.h
-unicode/uenum.h
-unicode/unorm.h
-unicode/unum.h
-unicode/ustring.h
-unicode/utypes.h
-#endif
libutil.h
unwind.h
fenv.h
diff --git a/config/version_win.pl b/config/version_win.pl
index 47c7dfe30..26c3fea9e 100755
--- a/config/version_win.pl
+++ b/config/version_win.pl
@@ -93,7 +93,7 @@ if (!defined($official)) {$official="";}
if (!defined($milestone)) {$milestone="";}
if (!defined($module)) {$module="";}
if (!defined($binary)) {$binary="";}
-if (!defined($displayname)) {$displayname="Mozilla";}
+if (!defined($displayname)) {$displayname="UXP";}
if (!defined($appversion)) {$appversion=$milestone;}
if (!defined($depth)) {$depth=".";}
if (!defined($rcinclude)) {$rcinclude="";}
@@ -234,10 +234,10 @@ for ($j = 1; $j < 4; $j++)
}
my $winappversion = "$appver[0],$appver[1],$appver[2],$appver[3]";
-my $copyright = "License: MPL 2";
-my $company = "Mozilla Foundation";
-my $trademarks = "Mozilla";
-my $productname = $displayname;
+my $copyright = "License: MPL 2.0";
+my $company = "Moonchild Productions";
+my $trademarks = "Moonchild";
+my $productname = "UXP";
if (defined($override_comment)){$override_comment =~ s/\@MOZ_APP_DISPLAYNAME\@/$displayname/g; $comment=$override_comment;}
diff --git a/db/mork/moz.build b/db/mork/moz.build
index a4cc91c19..25d128122 100644
--- a/db/mork/moz.build
+++ b/db/mork/moz.build
@@ -3,9 +3,8 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-if not CONFIG['NSS_DISABLE_DBM'] and CONFIG['MOZ_MORK']:
- DIRS += [
- 'public',
- 'src',
- 'build',
- ]
+DIRS += [
+ 'public',
+ 'src',
+ 'build',
+]
diff --git a/db/moz.build b/db/moz.build
deleted file mode 100644
index 2f360fad6..000000000
--- a/db/moz.build
+++ /dev/null
@@ -1,11 +0,0 @@
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-if not CONFIG['NSS_DISABLE_DBM'] and CONFIG['MOZ_MORK']:
- DIRS += [
- 'mork/public',
- 'mork/src',
- 'mork/build',
- ]
diff --git a/db/sqlite3/src/moz.build b/db/sqlite3/src/moz.build
index 1c26db9c4..eba8633b5 100644
--- a/db/sqlite3/src/moz.build
+++ b/db/sqlite3/src/moz.build
@@ -3,25 +3,18 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-NO_VISIBILITY_FLAGS = True
-EXPORTS += [
- 'sqlite3.h',
-]
+NO_VISIBILITY_FLAGS = True
# We allow warnings for third-party code that can be updated from upstream.
ALLOW_COMPILER_WARNINGS = True
-if CONFIG['MOZ_FOLD_LIBS']:
- # When folding libraries, sqlite is actually in the nss library.
- FINAL_LIBRARY = 'nss'
-else:
- # The final library is in config/external/sqlite
- FINAL_LIBRARY = 'sqlite'
+GeckoSharedLibrary('sqlite', linkage=None, mozglue='library')
+SHARED_LIBRARY_NAME = 'mozsqlite3'
+SYMBOLS_FILE = 'sqlite.symbols'
-SOURCES += [
- 'sqlite3.c',
-]
+EXPORTS += ['sqlite3.h']
+SOURCES += ['sqlite3.c']
# -DSQLITE_SECURE_DELETE=1 will cause SQLITE to 0-fill delete data so we
# don't have to vacuum to make sure the data is not visible in the file.
@@ -34,8 +27,11 @@ SOURCES += [
# hidden preference. If that preference is missing or invalid then this value
# will be used.
# Note: Be sure to update the configure.in checks when these change!
-for var in ('SQLITE_SECURE_DELETE', 'SQLITE_THREADSAFE', 'SQLITE_CORE',
- 'SQLITE_ENABLE_FTS3', 'SQLITE_ENABLE_UNLOCK_NOTIFY',
+for var in ('SQLITE_SECURE_DELETE',
+ 'SQLITE_THREADSAFE',
+ 'SQLITE_CORE',
+ 'SQLITE_ENABLE_FTS3',
+ 'SQLITE_ENABLE_UNLOCK_NOTIFY',
'SQLITE_ENABLE_DBSTAT_VTAB'):
DEFINES[var] = 1
@@ -67,10 +63,6 @@ if CONFIG['MOZ_DEBUG']:
DEFINES['SQLITE_DEBUG'] = 1
DEFINES['SQLITE_ENABLE_API_ARMOR'] = True
-if CONFIG['OS_TARGET'] == 'Android':
- # default to user readable only to fit Android security model
- DEFINES['SQLITE_DEFAULT_FILE_PERMISSIONS'] = '0600'
-
# Force using malloc_usable_size when building with jemalloc because _msize
# causes assertions on Win64. See bug 719579.
if CONFIG['OS_ARCH'] == 'WINNT' and CONFIG['MOZ_MEMORY']:
@@ -86,10 +78,7 @@ DEFINES['SQLITE_OMIT_DECLTYPE'] = True
# performance and doesn't suffer from a full separate tmp partition.
# Exclude 32bit platforms due to address space fragmentation issues.
# System Sqlite is managed through a PRAGMA instead.
-if CONFIG['OS_TARGET'] == 'Android':
- # On Android there's no tmp partition, so always use a MEMORY temp store.
- DEFINES['SQLITE_TEMP_STORE'] = 3
-elif CONFIG['HAVE_64BIT_BUILD']:
+if CONFIG['HAVE_64BIT_BUILD']:
# On 64bit platforms default to a MEMORY temp store for performance.
DEFINES['SQLITE_TEMP_STORE'] = 2
diff --git a/devtools/client/debugger/new/bundle.js b/devtools/client/debugger/new/bundle.js
index cbbd15a44..4200ed275 100644
--- a/devtools/client/debugger/new/bundle.js
+++ b/devtools/client/debugger/new/bundle.js
@@ -9828,7 +9828,7 @@ var Debugger =
var host = httpActivity.hostname;
info.hsts = sss.isSecureHost(sss.HEADER_HSTS, host, flags);
- info.hpkp = sss.isSecureHost(sss.HEADER_HPKP, host, flags);
+ info.hpkp = false;
} else {
DevToolsUtils.reportException("NetworkHelper.parseSecurityInfo", "Could not get HSTS/HPKP status as hostname is not available.");
info.hsts = false;
diff --git a/devtools/client/shared/curl.js b/devtools/client/shared/curl.js
index 967019746..d9abf506a 100644
--- a/devtools/client/shared/curl.js
+++ b/devtools/client/shared/curl.js
@@ -58,9 +58,21 @@ const Curl = {
* A cURL command.
*/
generateCommand: function (data) {
- let utils = CurlUtils;
+ const utils = CurlUtils;
let command = ["curl"];
+
+ // Make sure to use the following helpers to sanitize arguments before execution.
+ const addParam = value => {
+ const safe = /^[a-zA-Z-]+$/.test(value) ? value : escapeString(value);
+ command.push(safe);
+ };
+
+ const addPostData = value => {
+ const safe = /^[a-zA-Z-]+$/.test(value) ? value : escapeString(value);
+ postData.push(safe);
+ };
+
let ignoredHeaders = new Set();
// The cURL command is expected to run on the same platform that Firefox runs
@@ -69,7 +81,7 @@ const Curl = {
utils.escapeStringWin : utils.escapeStringPosix;
// Add URL.
- command.push(escapeString(data.url));
+ addParam(data.url);
let postDataText = null;
let multipartRequest = utils.isMultipartRequest(data);
@@ -79,15 +91,15 @@ const Curl = {
if (utils.isUrlEncodedRequest(data) ||
["PUT", "POST", "PATCH"].includes(data.method)) {
postDataText = data.postDataText;
- postData.push("--data");
- postData.push(escapeString(utils.writePostDataTextParams(postDataText)));
+ addPostData("--data");
+ addPostData(utils.writePostDataTextParams(postDataText));
ignoredHeaders.add("content-length");
} else if (multipartRequest) {
postDataText = data.postDataText;
- postData.push("--data-binary");
+ addPostData("--data-binary");
let boundary = utils.getMultipartBoundary(data);
let text = utils.removeBinaryDataFromMultipartText(postDataText, boundary);
- postData.push(escapeString(text));
+ addPostData(text);
ignoredHeaders.add("content-length");
}
@@ -95,15 +107,15 @@ const Curl = {
// For GET and POST requests this is not necessary as GET is the
// default. If --data or --binary is added POST is the default.
if (!(data.method == "GET" || data.method == "POST")) {
- command.push("-X");
- command.push(data.method);
+ addParam("-X");
+ addParam(data.method);
}
// Add -I (HEAD)
// For servers that supports HEAD.
// This will fetch the header of a document only.
if (data.method == "HEAD") {
- command.push("-I");
+ addParam("-I");
}
// Add http version.
@@ -114,7 +126,7 @@ const Curl = {
// data.httpVersion are HTTP/1.0, HTTP/1.1 and HTTP/2.0
// So in case of HTTP/2.0 (which should ideally be HTTP/2) we are using
// only major version, and full version in other cases
- command.push("--http" + (version == "2.0" ? version.split(".")[0] : version));
+ addParam("--http" + (version == "2.0" ? version.split(".")[0] : version));
}
// Add request headers.
@@ -126,14 +138,14 @@ const Curl = {
for (let i = 0; i < headers.length; i++) {
let header = headers[i];
if (header.name.toLowerCase() === "accept-encoding") {
- command.push("--compressed");
+ addParam("--compressed");
continue;
}
if (ignoredHeaders.has(header.name.toLowerCase())) {
continue;
}
- command.push("-H");
- command.push(escapeString(header.name + ": " + header.value));
+ addParam("-H");
+ addParam(header.name + ": " + header.value);
}
// Add post data.
diff --git a/devtools/client/themes/webconsole.css b/devtools/client/themes/webconsole.css
index 89bb38628..85c73264c 100644
--- a/devtools/client/themes/webconsole.css
+++ b/devtools/client/themes/webconsole.css
@@ -14,7 +14,6 @@
a {
-moz-user-focus: normal;
- -moz-user-input: enabled;
cursor: pointer;
text-decoration: underline;
}
diff --git a/devtools/moz.build b/devtools/moz.build
index e6bcdd00d..e6cb86c37 100644
--- a/devtools/moz.build
+++ b/devtools/moz.build
@@ -4,20 +4,14 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+DIRS += [
+ 'server',
+ 'shared',
+]
+
if CONFIG['MOZ_DEVTOOLS']:
DIRS += ['client']
-if CONFIG['MOZ_DEVTOOLS_SERVER']:
- DIRS += [
- 'server',
- 'shared',
- ]
-else:
- DIRS += [
- 'shared/heapsnapshot',
- 'shared/jsinspector',
- ]
-
# /browser uses DIST_SUBDIR. We opt-in to this treatment when building
# DevTools for the browser to keep the root omni.ja slim for use by external XUL
# apps. Mulet also uses this since it includes /browser.
diff --git a/devtools/shared/css/generated/properties-db.js b/devtools/shared/css/generated/properties-db.js
index 25d9e2d33..eda2c7148 100644
--- a/devtools/shared/css/generated/properties-db.js
+++ b/devtools/shared/css/generated/properties-db.js
@@ -1440,8 +1440,6 @@ exports.CSS_PROPERTIES = {
"supports": [],
"values": [
"auto",
- "disabled",
- "enabled",
"inherit",
"initial",
"none",
diff --git a/devtools/shared/heapsnapshot/moz.build b/devtools/shared/heapsnapshot/moz.build
index fa9ef3915..9a915e426 100644
--- a/devtools/shared/heapsnapshot/moz.build
+++ b/devtools/shared/heapsnapshot/moz.build
@@ -4,60 +4,12 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-with Files('**'):
- BUG_COMPONENT = ('Firefox', 'Developer Tools: Memory')
-
-if CONFIG['ENABLE_TESTS']:
- DIRS += ['tests/gtest']
-
-XPCSHELL_TESTS_MANIFESTS += [ 'tests/unit/xpcshell.ini' ]
-MOCHITEST_MANIFESTS += [ 'tests/mochitest/mochitest.ini' ]
-MOCHITEST_CHROME_MANIFESTS += [ 'tests/mochitest/chrome.ini' ]
-
-EXPORTS.mozilla.devtools += [
- 'AutoMemMap.h',
- 'CoreDump.pb.h',
- 'DeserializedNode.h',
- 'DominatorTree.h',
- 'FileDescriptorOutputStream.h',
- 'HeapSnapshot.h',
- 'HeapSnapshotTempFileHelperChild.h',
- 'HeapSnapshotTempFileHelperParent.h',
- 'ZeroCopyNSIOutputStream.h',
-]
-
-IPDL_SOURCES += [
- 'PHeapSnapshotTempFileHelper.ipdl',
-]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-SOURCES += [
- 'AutoMemMap.cpp',
- 'CoreDump.pb.cc',
- 'DeserializedNode.cpp',
- 'DominatorTree.cpp',
- 'FileDescriptorOutputStream.cpp',
- 'HeapSnapshot.cpp',
- 'HeapSnapshotTempFileHelperParent.cpp',
- 'ZeroCopyNSIOutputStream.cpp',
-]
-
-# Disable RTTI in google protocol buffer
-DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
-
-FINAL_LIBRARY = 'xul'
-
-if CONFIG['MOZ_DEVTOOLS_SERVER']:
- DevToolsModules(
- 'census-tree-node.js',
- 'CensusUtils.js',
- 'DominatorTreeNode.js',
- 'HeapAnalysesClient.js',
- 'HeapAnalysesWorker.js',
- 'HeapSnapshotFileUtils.js',
- 'shortest-paths.js',
- )
-
-if CONFIG['GNU_CXX']:
- CXXFLAGS += ['-Wno-error=shadow']
+DevToolsModules(
+ 'census-tree-node.js',
+ 'CensusUtils.js',
+ 'DominatorTreeNode.js',
+ 'HeapAnalysesClient.js',
+ 'HeapAnalysesWorker.js',
+ 'HeapSnapshotFileUtils.js',
+ 'shortest-paths.js',
+)
diff --git a/devtools/shared/moz.build b/devtools/shared/moz.build
index 6c61206dd..e4de1d84a 100644
--- a/devtools/shared/moz.build
+++ b/devtools/shared/moz.build
@@ -17,7 +17,6 @@ DIRS += [
'heapsnapshot',
'inspector',
'jsbeautify',
- 'jsinspector',
'layout',
'locales',
'node-properties',
diff --git a/devtools/shared/webconsole/network-helper.js b/devtools/shared/webconsole/network-helper.js
index 4e25fac26..71909221e 100644
--- a/devtools/shared/webconsole/network-helper.js
+++ b/devtools/shared/webconsole/network-helper.js
@@ -668,7 +668,8 @@ var NetworkHelper = {
let host = httpActivity.hostname;
info.hsts = sss.isSecureHost(sss.HEADER_HSTS, host, flags);
- info.hpkp = sss.isSecureHost(sss.HEADER_HPKP, host, flags);
+ // HPKP is no longer supported.
+ info.hpkp = false;
} else {
DevToolsUtils.reportException("NetworkHelper.parseSecurityInfo",
"Could not get HSTS/HPKP status as hostname is not available.");
diff --git a/docs/UXP Coding Style.md b/docs/UXP Coding Style.md
index 83f59c8b1..5dc4fd2a5 100644
--- a/docs/UXP Coding Style.md
+++ b/docs/UXP Coding Style.md
@@ -1,4 +1,4 @@
-# UXP Coding Style Guide
+# UXP Coding Style Guide
While our source tree is currently in a number of different Coding Styles and the general rule applies to adhere to style of surrounding code when you are making changes, it is our goal to unify the style of our source tree and making it adhere to a single style.
This document describes the preferred style for new source code files and the preferred style to convert existing files to.
@@ -11,9 +11,9 @@ Our own managed and maintained code should adhere to this guide where possible o
## General formatting rules
The following formatting rules apply to all code:
- Always use spaces for indentation, never use tabs!
-- Put a space between a keyword and parenthesis, e.g. `if (`.
+- Put a space between a keyword and parenthesis, e.g. `if (`. Do _not_ put a space between a function/type-assignment name and its parenthesis, e.g. `function(somevar)` or `int32_t(somevar)`.
- Put a space between variables and operators, e.g. `a == b`.
-- Put a space after a comma or semicolon in variable lists, e.g. `function (a, b, c)` or `for (i = 1; i < 10; i++)`.
+- Put a space after a comma or semicolon in variable lists, e.g. `function(a, b, c)` or `for (i = 1; i < 10; i++)`.
- Indentation of scopes is 2 spaces.
- Indentation of long lines is variable-aligned or expression-aligned (see "long line wrapping")
- Conditional defines are always placed on column 1. This is also true for nested defines.
@@ -225,15 +225,257 @@ somelongvariable = somelongexpression ?
## JavaScript
Applies to `*.js` and `*.jsm`.
+### General formatting guidelines
+- Place function signatures on the same line as js object identifiers, and do not use named function syntax in that case:
+ ```JavaScript
+ var myObject = {
+ myIdentifier: function(var1, var2) {
+ ...
+ },
+ myIdentifier2: function() {
+ ...
+ }
+ }
+ ```
+- Variable initializers should be placed on the variable declaration line if needed.
+ ```JavaScript
+ var fwdCommand = document.getElementById("Browser:Forward");
+ ```
+ ```JavaScript
+ var myObject = {
+ myVariable: null,
+ myString: "Something"
+ }
+ ```
+- Avoid placing executed code on the expression line. Preferably brace executed code.
+
+ WRONG:
+ ```JavaScript
+ if (a == b) do_something();
+ if (a == b) { do_something(); }
+ ```
+ DISCOURAGED:
+ ```JavaScript
+ if (a == b)
+ do_something();
+ ```
+ CORRECT:
+ ```JavaScript
+ if (a == b) {
+ do_something();
+ }
+ ```
+- Format in-lined variable functions as if you would format normal functions with the exception of closure: break with the opening brace, followed by code, and closing brace on its own line, followed immediately by any other variables passed in-line.
+ ```JavaScript
+ appMenuButton.addEventListener("mousedown", function(event) {
+ if (event.button == 0) {
+ appMenuOpening = new Date();
+ }
+ }, false);
+ ```
+- Use a single space between `{` `}` braces in empty js objects.
+
+### Flow control
+Flow control expressions should follow the following guidelines:
+- Scopes have their opening braces on the expression line
+- Scopes have their closing braces on a separate line, indent-aligned with the flow control expression
+- Any alternative flow control paths are generally started with an expression on the closing brace line. The logic behind this is that you should keep the flow control level visually the same for the executed code blocks with no breaks (a closing brace on its own line means "done").
+- Case statements are indented by 2 on a new line with the case expression on its own line.
+- Flow control default scopes are always placed at the bottom.
+
+#### if..else
+`if..else` statements example:
+```JavaScript
+if (something == somethingelse) {
+ true_case_code here;
+} else {
+ false_case_code here;
+}
+
+if (case1) {
+ case1_code here;
+} else if (case2) {
+ case2_code here;
+} else {
+ other_case_code here;
+}
+
+if (case1) {
+ case1_code here;
+} else {
+ if (case2) {
+ case2_code here;
+ }
+ case2_and_other_code here;
+}
+```
+#### for
+`for` loop example:
+```JavaScript
+for (let i = 1; i < max; i++) {
+ loop_code here;
+}
+
+for (let i = 0;; i++) {
+ do_something_with(i);
+ if (i > max) break;
+ ...
+}
+```
+#### while
+`while` loop example:
+```JavaScript
+while (something == true) {
+ loop_code here;
+}
+
+do {
+ execute_me_at_least_once();
+ ...
+} while (something == true);
+```
+#### switch..case
+`switch..case` flow control example:
+```JavaScript
+switch (variable) {
+ case value1:
+ // Comment describing 1
+ code_for_1;
+ code_for_1;
+ break;
+ case value2:
+ code_for_2;
+ code_for_2;
+ // fallthrough
+ case value3:
+ case value4:
+ code_for_3_and_4;
+ break;
+ default:
+ code_for_default;
+ code_for_default;
+}
+```
+Alternatively (braced):
+```JavaScript
+switch (variable) {
+ case value1: {
+ // Comment describing 1
+ code_for_1;
+ code_for_1;
+ break;
+ }
+ case value2: {
+ code_for_2;
+ code_for_2;
+ // fallthrough
+ }
+ case value3:
+ case value4: {
+ code_for_3_and_4;
+ break;
+ }
+ default: {
+ code_for_default;
+ code_for_default;
+ }
+}
+```
+
+#### try..catch
+- When using `try..catch` blocks, the use of optional catch binding is discouraged. Please always include the error variable.
+
+`try..catch` flow control examples:
+```JavaScript
+try {
+ do_something();
+} catch(e) {
+ handle_error(e);
+} finally {
+ always();
+}
+
+try {
+ do_something();
+} catch(e) {
+}
+
+try {
+ do_something();
+} finally {
+ always();
+}
+```
+DISCOURAGED
+```JavaScript
+try {
+ do_something();
+} catch {
+ // No error processing
+ do_something_else();
+}
+
+// No closing brace on its own line
+try {
+ do_something();
+} catch(ex) { }
+```
+
+### Long line wrapping
+If statements on a single line become overly long, they should be split into multiple lines:
+- Binary operators (including ternary) must be left on their original lines if the line break happens around the operator. The second line should start in the same column as the start of the expression in the first line.
+- Lists of variables (e.g. when calling or declaring a function) should be split at the wrapping column.
+- Long OOP calls should be split at the period with the period on the start of the new line, indented to the column of the first object, filling to the wrapping column where possible, including additional terms.
+- When breaking assignments/operations/logic, break right after the operator (`=`, `+`, `&&`, `||`, etc.)
+- **Don't break too rigorously**; short additions should be kept on the same line to keep things legible - use common sense and context for flexibility.
+
+WRONG:
+```JavaScript
+somelongobjectname.somelongfunction(
+ var1, var2, var3, var4, var5);
+
+if (somelongvariable == somelongothervariable
+ || somelongvariable2 == somelongothervariable2) {
+
+somelongvariable = somelongexpression ? somevalue1
+ : somevalue2;
+
+var iShouldntBeUsingThisLongOfAVarName
+ = someValueToAdd + someValueToAdd + someValueToAdd
+ + someValueToAdd;
+
+Cu.import("resource:///modules/DownloadsCommon.jsm", {}).
+ DownloadsCommon.initializeAllDataLinks();
+```
+CORRECT:
+```JavaScript
+somelongobjectname.somelongfunction(var1, var2, var3,
+ var4, var5);
+
+if (somelongvariable == somelongothervariable ||
+ somelongvariable2 == somelongothervariable2) {
+
+somelongvariable = somelongexpression ?
+ somevalue1 :
+ somevalue2;
+
+var iShouldntBeUsingThisLongOfAVarName =
+ someValueToAdd + someValueToAdd + someValueToAdd +
+ someValueToAdd;
+
+Cu.import("resource:///modules/DownloadsCommon.jsm", {})
+ .DownloadsCommon.initializeAllDataLinks();
+
+let sessionStartup = Cc["@mozilla.org/browser/sessionstartup;1"]
+ .getService(Ci.nsISessionStartup);
+```
+
## XUL and other XML-derivatives
Applies to `*.xul`, `*.html`, `*.xhtml`.
+TODO
## IDL
Applies to `*.idl`, `*.xpidl` and `*.webidl`.
-
-<!--stackedit_data:
-eyJoaXN0b3J5IjpbMjUzODYzMzMsMjg5MjUwODIsLTQzMjMzNz
-ExMSw4MzQ2MjYwNDksLTE5MDMyNzE5OTYsLTEwMTIwMjc3ODMs
-LTE4MzgzODM5MDIsODA5MjEzNTEyLC01Mzg0MjM4MDAsMzgyNj
-I3NDYzLDIwODYwMjIwODUsLTE1MjU5MjE2MjIsLTY1OTMzMTA0
-MCwtNzQwOTE5MDQ1LDE4Njc1NTQxNDJdfQ==
---> \ No newline at end of file
+TODO
+## Python-esque
+Applies to `*.py`, `mozbuild` etc.
+TODO
diff --git a/docshell/base/nsAboutRedirector.cpp b/docshell/base/nsAboutRedirector.cpp
index f57d6c002..e1d883532 100644
--- a/docshell/base/nsAboutRedirector.cpp
+++ b/docshell/base/nsAboutRedirector.cpp
@@ -119,12 +119,10 @@ static RedirEntry kRedirMap[] = {
nsIAboutModule::URI_MUST_LOAD_IN_CHILD |
nsIAboutModule::ALLOW_SCRIPT
},
-#ifndef ANDROID
{
"profiles", "chrome://global/content/aboutProfiles.xhtml",
nsIAboutModule::ALLOW_SCRIPT
},
-#endif
// about:srcdoc is unresolvable by specification. It is included here
// because the security manager would disallow srcdoc iframes otherwise.
{
diff --git a/docshell/base/nsDocShell.cpp b/docshell/base/nsDocShell.cpp
index 6104ebfa7..d8d0614d5 100644
--- a/docshell/base/nsDocShell.cpp
+++ b/docshell/base/nsDocShell.cpp
@@ -860,6 +860,12 @@ nsDocShell::~nsDocShell()
shPrivate->SetRootDocShell(nullptr);
}
+ if (mContentViewer) {
+ mContentViewer->Close(nullptr);
+ mContentViewer->Destroy();
+ mContentViewer = nullptr;
+ }
+
if (--gDocShellCount == 0) {
NS_IF_RELEASE(sURIFixup);
}
@@ -4943,13 +4949,11 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
if (errorClass == nsINSSErrorsService::ERROR_CLASS_BAD_CERT) {
error.AssignLiteral("nssBadCert");
- // If this is an HTTP Strict Transport Security host or a pinned host
- // and the certificate is bad, don't allow overrides (RFC 6797 section
- // 12.1, HPKP draft spec section 2.6).
+ // If this is an HTTP Strict Transport Security host, don't allow
+ // overrides (RFC 6797 section 12.1).
uint32_t flags =
UsePrivateBrowsing() ? nsISocketProvider::NO_PERMANENT_STORAGE : 0;
bool isStsHost = false;
- bool isPinnedHost = false;
if (XRE_IsParentProcess()) {
nsCOMPtr<nsISiteSecurityService> sss =
do_GetService(NS_SSSERVICE_CONTRACTID, &rv);
@@ -4957,9 +4961,6 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
rv = sss->IsSecureURI(nsISiteSecurityService::HEADER_HSTS, aURI,
flags, nullptr, &isStsHost);
NS_ENSURE_SUCCESS(rv, rv);
- rv = sss->IsSecureURI(nsISiteSecurityService::HEADER_HPKP, aURI,
- flags, nullptr, &isPinnedHost);
- NS_ENSURE_SUCCESS(rv, rv);
} else {
mozilla::dom::ContentChild* cc =
mozilla::dom::ContentChild::GetSingleton();
@@ -4967,8 +4968,6 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
SerializeURI(aURI, uri);
cc->SendIsSecureURI(nsISiteSecurityService::HEADER_HSTS, uri, flags,
&isStsHost);
- cc->SendIsSecureURI(nsISiteSecurityService::HEADER_HPKP, uri, flags,
- &isPinnedHost);
}
if (Preferences::GetBool(
@@ -4976,11 +4975,9 @@ nsDocShell::DisplayLoadError(nsresult aError, nsIURI* aURI,
cssClass.AssignLiteral("expertBadCert");
}
- // HSTS/pinning takes precedence over the expert bad cert pref. We
+ // HSTS takes precedence over the expert bad cert pref. We
// never want to show the "Add Exception" button for these sites.
- // In the future we should differentiate between an HSTS host and a
- // pinned host and display a more informative message to the user.
- if (isStsHost || isPinnedHost) {
+ if (isStsHost) {
cssClass.AssignLiteral("badStsCert");
}
diff --git a/docshell/build/nsDocShellModule.cpp b/docshell/build/nsDocShellModule.cpp
index 3481bd297..fbf2f1002 100644
--- a/docshell/build/nsDocShellModule.cpp
+++ b/docshell/build/nsDocShellModule.cpp
@@ -25,10 +25,6 @@
#ifdef MOZ_ENABLE_DBUS
#include "nsDBusHandlerApp.h"
#endif
-#if defined(MOZ_WIDGET_ANDROID)
-#include "nsExternalSharingAppService.h"
-#include "nsExternalURLHandlerService.h"
-#endif
// session history
#include "nsSHEntry.h"
@@ -85,10 +81,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(PlatformLocalHandlerApp_t)
#ifdef MOZ_ENABLE_DBUS
NS_GENERIC_FACTORY_CONSTRUCTOR(nsDBusHandlerApp)
#endif
-#if defined(MOZ_WIDGET_ANDROID)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsExternalSharingAppService)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsExternalURLHandlerService)
-#endif
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(ContentHandlerService, Init)
// session history
@@ -114,10 +106,6 @@ NS_DEFINE_NAMED_CID(NS_LOCALHANDLERAPP_CID);
#ifdef MOZ_ENABLE_DBUS
NS_DEFINE_NAMED_CID(NS_DBUSHANDLERAPP_CID);
#endif
-#if defined(MOZ_WIDGET_ANDROID)
-NS_DEFINE_NAMED_CID(NS_EXTERNALSHARINGAPPSERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_EXTERNALURLHANDLERSERVICE_CID);
-#endif
NS_DEFINE_NAMED_CID(NS_SHENTRY_CID);
NS_DEFINE_NAMED_CID(NS_SHTRANSACTION_CID);
NS_DEFINE_NAMED_CID(NS_SHISTORY_CID);
@@ -143,10 +131,6 @@ const mozilla::Module::CIDEntry kDocShellCIDs[] = {
#ifdef MOZ_ENABLE_DBUS
{ &kNS_DBUSHANDLERAPP_CID, false, nullptr, nsDBusHandlerAppConstructor },
#endif
-#if defined(MOZ_WIDGET_ANDROID)
- { &kNS_EXTERNALSHARINGAPPSERVICE_CID, false, nullptr, nsExternalSharingAppServiceConstructor },
- { &kNS_EXTERNALURLHANDLERSERVICE_CID, false, nullptr, nsExternalURLHandlerServiceConstructor },
-#endif
{ &kNS_SHENTRY_CID, false, nullptr, nsSHEntryConstructor },
{ &kNS_SHTRANSACTION_CID, false, nullptr, nsSHTransactionConstructor },
{ &kNS_SHISTORY_CID, false, nullptr, nsSHistoryConstructor },
@@ -183,9 +167,7 @@ const mozilla::Module::ContractIDEntry kDocShellContracts[] = {
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "performance", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "plugins", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "serviceworkers", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
-#ifndef ANDROID
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "profiles", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
-#endif
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "srcdoc", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "support", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
{ NS_ABOUT_MODULE_CONTRACTID_PREFIX "telemetry", &kNS_ABOUT_REDIRECTOR_MODULE_CID },
@@ -206,10 +188,6 @@ const mozilla::Module::ContractIDEntry kDocShellContracts[] = {
#ifdef MOZ_ENABLE_DBUS
{ NS_DBUSHANDLERAPP_CONTRACTID, &kNS_DBUSHANDLERAPP_CID },
#endif
-#if defined(MOZ_WIDGET_ANDROID)
- { NS_EXTERNALSHARINGAPPSERVICE_CONTRACTID, &kNS_EXTERNALSHARINGAPPSERVICE_CID },
- { NS_EXTERNALURLHANDLERSERVICE_CONTRACTID, &kNS_EXTERNALURLHANDLERSERVICE_CID },
-#endif
{ NS_SHENTRY_CONTRACTID, &kNS_SHENTRY_CID },
{ NS_SHTRANSACTION_CONTRACTID, &kNS_SHTRANSACTION_CID },
{ NS_SHISTORY_CONTRACTID, &kNS_SHISTORY_CID },
diff --git a/dom/base/BlobSet.h b/dom/base/BlobSet.h
index 3e22955dd..bf98cb023 100644
--- a/dom/base/BlobSet.h
+++ b/dom/base/BlobSet.h
@@ -8,6 +8,9 @@
#define mozilla_dom_BlobSet_h
#include "mozilla/RefPtr.h"
+#include "jsfriendapi.h"
+#include "nsString.h"
+#include "nsTArray.h"
namespace mozilla {
namespace dom {
diff --git a/dom/base/CORSMode.h b/dom/base/CORSMode.h
index 82f2f570d..577e78725 100644
--- a/dom/base/CORSMode.h
+++ b/dom/base/CORSMode.h
@@ -7,6 +7,8 @@
#ifndef CORSMode_h_
#define CORSMode_h_
+#include <stdint.h>
+
namespace mozilla {
enum CORSMode : uint8_t {
diff --git a/dom/base/ChromeUtils.cpp b/dom/base/ChromeUtils.cpp
index 3cde261f0..b25f0b76b 100644
--- a/dom/base/ChromeUtils.cpp
+++ b/dom/base/ChromeUtils.cpp
@@ -7,6 +7,7 @@
#include "mozilla/Base64.h"
#include "mozilla/BasePrincipal.h"
+#include "jsfriendapi.h"
namespace mozilla {
namespace dom {
diff --git a/dom/base/ChromeUtils.h b/dom/base/ChromeUtils.h
index 051217c84..58a67b4f2 100644
--- a/dom/base/ChromeUtils.h
+++ b/dom/base/ChromeUtils.h
@@ -10,6 +10,7 @@
#include "mozilla/dom/BindingDeclarations.h"
#include "mozilla/dom/ChromeUtilsBinding.h"
#include "mozilla/dom/ThreadSafeChromeUtilsBinding.h"
+#include "mozilla/dom/UnionTypes.h"
#include "mozilla/ErrorResult.h"
namespace mozilla {
diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp
index 3f202d33b..f582d635f 100644
--- a/dom/base/CustomElementRegistry.cpp
+++ b/dom/base/CustomElementRegistry.cpp
@@ -7,8 +7,11 @@
#include "mozilla/dom/CustomElementRegistry.h"
#include "mozilla/dom/CustomElementRegistryBinding.h"
+#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLElementBinding.h"
#include "mozilla/dom/WebComponentsBinding.h"
+#include "mozilla/dom/Promise.h"
+#include "nsContentUtils.h"
#include "nsIParserService.h"
#include "jsapi.h"
diff --git a/dom/base/DocGroup.cpp b/dom/base/DocGroup.cpp
index 226879985..ba9189168 100644
--- a/dom/base/DocGroup.cpp
+++ b/dom/base/DocGroup.cpp
@@ -6,6 +6,7 @@
#include "mozilla/StaticPtr.h"
#include "mozilla/ClearOnShutdown.h"
#include "nsIDocShell.h"
+#include "nsNetCID.h"
namespace mozilla {
namespace dom {
diff --git a/dom/base/DocGroup.h b/dom/base/DocGroup.h
index f4f7ac8ad..6ecd284c1 100644
--- a/dom/base/DocGroup.h
+++ b/dom/base/DocGroup.h
@@ -7,6 +7,7 @@
#ifndef DocGroup_h
#define DocGroup_h
+#include "nsIDocument.h"
#include "nsISupports.h"
#include "nsISupportsImpl.h"
#include "nsIPrincipal.h"
diff --git a/dom/base/GroupedSHistory.h b/dom/base/GroupedSHistory.h
index 8c88a0aaf..c5e75d639 100644
--- a/dom/base/GroupedSHistory.h
+++ b/dom/base/GroupedSHistory.h
@@ -7,6 +7,8 @@
#ifndef GroupedSHistory_h
#define GroupedSHistory_h
+#include "nsCOMArray.h"
+#include "nsCycleCollectionParticipant.h" // NS_DECL_CYCLE_*
#include "nsIFrameLoader.h"
#include "nsIGroupedSHistory.h"
#include "nsIPartialSHistory.h"
diff --git a/dom/base/ImageTracker.cpp b/dom/base/ImageTracker.cpp
index 9fef059bc..d0c231981 100644
--- a/dom/base/ImageTracker.cpp
+++ b/dom/base/ImageTracker.cpp
@@ -8,6 +8,8 @@
* animating */
#include "ImageTracker.h"
+#include "mozilla/Preferences.h"
+#include "nsAppRunner.h" // for XRE_IsContentProcess
namespace mozilla {
namespace dom {
diff --git a/dom/base/ImageTracker.h b/dom/base/ImageTracker.h
index d33dc55f8..f16461192 100644
--- a/dom/base/ImageTracker.h
+++ b/dom/base/ImageTracker.h
@@ -10,6 +10,7 @@
#ifndef mozilla_dom_ImageTracker
#define mozilla_dom_ImageTracker
+#include "imgIRequest.h"
#include "nsDataHashtable.h"
#include "nsHashKeys.h"
diff --git a/dom/base/MutableBlobStorage.h b/dom/base/MutableBlobStorage.h
index fad391b16..ed368e5e6 100644
--- a/dom/base/MutableBlobStorage.h
+++ b/dom/base/MutableBlobStorage.h
@@ -7,6 +7,9 @@
#ifndef mozilla_dom_MutableBlobStorage_h
#define mozilla_dom_MutableBlobStorage_h
+#include "nsCycleCollectionParticipant.h"
+#include "nsThreadUtils.h"
+#include "nsProxyRelease.h"
#include "mozilla/RefPtr.h"
#include "prio.h"
diff --git a/dom/base/MutableBlobStreamListener.cpp b/dom/base/MutableBlobStreamListener.cpp
index 6769ad3e6..afcc04d9f 100644
--- a/dom/base/MutableBlobStreamListener.cpp
+++ b/dom/base/MutableBlobStreamListener.cpp
@@ -5,6 +5,7 @@
#include "MutableBlobStreamListener.h"
#include "MutableBlobStorage.h"
+#include "nsIInputStream.h"
namespace mozilla {
namespace dom {
diff --git a/dom/base/Navigator.cpp b/dom/base/Navigator.cpp
index fdf151b6c..a544f23c1 100644
--- a/dom/base/Navigator.cpp
+++ b/dom/base/Navigator.cpp
@@ -37,10 +37,7 @@
#include "mozilla/dom/PowerManager.h"
#include "mozilla/dom/WakeLock.h"
#include "mozilla/dom/power/PowerManagerService.h"
-#include "mozilla/dom/FlyWebPublishedServer.h"
-#include "mozilla/dom/FlyWebService.h"
#include "mozilla/dom/Permissions.h"
-#include "mozilla/dom/Presentation.h"
#include "mozilla/dom/ServiceWorkerContainer.h"
#include "mozilla/dom/StorageManager.h"
#include "mozilla/dom/TCPSocket.h"
@@ -67,8 +64,6 @@
#include "nsIAppsService.h"
#include "mozIApplication.h"
#include "WidgetUtils.h"
-#include "nsIPresentationService.h"
-
#include "mozilla/dom/MediaDevices.h"
#include "MediaManager.h"
@@ -218,7 +213,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(Navigator)
#ifdef MOZ_EME
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mMediaKeySystemAccessManager)
#endif
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPresentation)
#ifdef MOZ_GAMEPAD
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mGamepadServiceTest)
#endif
@@ -284,10 +278,6 @@ Navigator::Invalidate()
mTimeManager = nullptr;
}
- if (mPresentation) {
- mPresentation = nullptr;
- }
-
mServiceWorkerContainer = nullptr;
#ifdef MOZ_EME
@@ -1364,41 +1354,6 @@ Navigator::GetBattery(ErrorResult& aRv)
return mBatteryPromise;
}
-already_AddRefed<Promise>
-Navigator::PublishServer(const nsAString& aName,
- const FlyWebPublishOptions& aOptions,
- ErrorResult& aRv)
-{
- RefPtr<FlyWebService> service = FlyWebService::GetOrCreate();
- if (!service) {
- aRv.Throw(NS_ERROR_FAILURE);
- return nullptr;
- }
-
- RefPtr<FlyWebPublishPromise> mozPromise =
- service->PublishServer(aName, aOptions, mWindow);
- MOZ_ASSERT(mozPromise);
-
- nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(mWindow);
- ErrorResult result;
- RefPtr<Promise> domPromise = Promise::Create(global, result);
- if (result.Failed()) {
- aRv.Throw(NS_ERROR_FAILURE);
- return nullptr;
- }
-
- mozPromise->Then(AbstractThread::MainThread(),
- __func__,
- [domPromise] (FlyWebPublishedServer* aServer) {
- domPromise->MaybeResolve(aServer);
- },
- [domPromise] (nsresult aStatus) {
- domPromise->MaybeReject(aStatus);
- });
-
- return domPromise.forget();
-}
-
PowerManager*
Navigator::GetMozPower(ErrorResult& aRv)
{
@@ -1931,19 +1886,5 @@ Navigator::RequestMediaKeySystemAccess(const nsAString& aKeySystem,
}
#endif
-Presentation*
-Navigator::GetPresentation(ErrorResult& aRv)
-{
- if (!mPresentation) {
- if (!mWindow) {
- aRv.Throw(NS_ERROR_UNEXPECTED);
- return nullptr;
- }
- mPresentation = Presentation::Create(mWindow);
- }
-
- return mPresentation;
-}
-
} // namespace dom
} // namespace mozilla
diff --git a/dom/base/Navigator.h b/dom/base/Navigator.h
index 91b7fc15c..4ddaaabab 100644
--- a/dom/base/Navigator.h
+++ b/dom/base/Navigator.h
@@ -39,8 +39,6 @@ class WakeLock;
class ArrayBufferViewOrBlobOrStringOrFormData;
class ServiceWorkerContainer;
class DOMRequest;
-struct FlyWebPublishOptions;
-struct FlyWebFilter;
} // namespace dom
} // namespace mozilla
@@ -74,7 +72,6 @@ class Connection;
} // namespace network
class PowerManager;
-class Presentation;
class LegacyMozTCPSocket;
class StorageManager;
@@ -141,9 +138,6 @@ public:
Geolocation* GetGeolocation(ErrorResult& aRv);
Promise* GetBattery(ErrorResult& aRv);
- already_AddRefed<Promise> PublishServer(const nsAString& aName,
- const FlyWebPublishOptions& aOptions,
- ErrorResult& aRv);
static void AppName(nsAString& aAppName, bool aUsePrefOverriddenValue);
static nsresult GetPlatform(nsAString& aPlatform,
@@ -210,8 +204,6 @@ public:
system::AudioChannelManager* GetMozAudioChannelManager(ErrorResult& aRv);
#endif // MOZ_AUDIO_CHANNEL_MANAGER
- Presentation* GetPresentation(ErrorResult& aRv);
-
bool SendBeacon(const nsAString& aUrl,
const Nullable<ArrayBufferViewOrBlobOrStringOrFormData>& aData,
ErrorResult& aRv);
@@ -288,7 +280,6 @@ private:
RefPtr<time::TimeManager> mTimeManager;
RefPtr<ServiceWorkerContainer> mServiceWorkerContainer;
nsCOMPtr<nsPIDOMWindowInner> mWindow;
- RefPtr<Presentation> mPresentation;
#ifdef MOZ_GAMEPAD
RefPtr<GamepadServiceTest> mGamepadServiceTest;
#endif
diff --git a/dom/base/NodeInfo.cpp b/dom/base/NodeInfo.cpp
index d32a00fd3..f055dfc75 100644
--- a/dom/base/NodeInfo.cpp
+++ b/dom/base/NodeInfo.cpp
@@ -15,6 +15,7 @@
#include "mozilla/ArrayUtils.h"
#include "mozilla/Likely.h"
+#include "mozilla/Unused.h"
#include "nsNodeInfoManager.h"
#include "nsCOMPtr.h"
diff --git a/dom/base/Pose.h b/dom/base/Pose.h
index c7ef1b381..0817c8c96 100644
--- a/dom/base/Pose.h
+++ b/dom/base/Pose.h
@@ -8,6 +8,7 @@
#define mozilla_dom_Pose_h
#include "nsWrapperCache.h"
+#include "mozilla/ErrorResult.h"
namespace mozilla {
namespace dom {
diff --git a/dom/base/TabGroup.h b/dom/base/TabGroup.h
index f9fa9eec5..c436ce98d 100644
--- a/dom/base/TabGroup.h
+++ b/dom/base/TabGroup.h
@@ -7,10 +7,12 @@
#ifndef TabGroup_h
#define TabGroup_h
+#include "nsIDocument.h"
#include "nsISupports.h"
#include "nsISupportsImpl.h"
#include "nsIPrincipal.h"
#include "nsTHashtable.h"
+#include "nsHashKeys.h"
#include "nsString.h"
#include "mozilla/RefPtr.h"
diff --git a/dom/base/ThirdPartyUtil.cpp b/dom/base/ThirdPartyUtil.cpp
index 61d97f634..37d326dbc 100644
--- a/dom/base/ThirdPartyUtil.cpp
+++ b/dom/base/ThirdPartyUtil.cpp
@@ -10,6 +10,7 @@
#include "nsIChannel.h"
#include "nsIServiceManager.h"
#include "nsIHttpChannelInternal.h"
+#include "nsPIDOMWindow.h"
#include "nsIDOMWindow.h"
#include "nsILoadContext.h"
#include "nsIPrincipal.h"
diff --git a/dom/base/TimeoutHandler.cpp b/dom/base/TimeoutHandler.cpp
index 78c3f16dd..f34275840 100644
--- a/dom/base/TimeoutHandler.cpp
+++ b/dom/base/TimeoutHandler.cpp
@@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "TimeoutHandler.h"
+#include "nsJSUtils.h"
namespace mozilla {
namespace dom {
diff --git a/dom/base/TimeoutHandler.h b/dom/base/TimeoutHandler.h
index cb0a0ce94..a80dc2995 100644
--- a/dom/base/TimeoutHandler.h
+++ b/dom/base/TimeoutHandler.h
@@ -7,9 +7,11 @@
#ifndef mozilla_dom_timeout_handler_h
#define mozilla_dom_timeout_handler_h
+#include "nsCycleCollectionParticipant.h" // NS_DECL_CYCLE_*
#include "nsCOMPtr.h"
#include "nsISupports.h"
#include "nsITimeoutHandler.h"
+#include "nsString.h"
namespace mozilla {
namespace dom {
diff --git a/dom/base/TimerClamping.h b/dom/base/TimerClamping.h
index 2ffd6add5..2bd1f019c 100755
--- a/dom/base/TimerClamping.h
+++ b/dom/base/TimerClamping.h
@@ -7,6 +7,8 @@
#ifndef TimerClamping_h___
#define TimerClamping_h___
+#include <math.h>
+
namespace mozilla {
class TimerClamping
diff --git a/dom/base/moz.build b/dom/base/moz.build
index 75ddefded..89f1785ca 100755
--- a/dom/base/moz.build
+++ b/dom/base/moz.build
@@ -225,7 +225,7 @@ EXPORTS.mozilla.dom += [
'WindowOrientationObserver.h',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'AnonymousContent.cpp',
'Attr.cpp',
'BarProps.cpp',
@@ -376,7 +376,7 @@ UNIFIED_SOURCES += [
]
if CONFIG['MOZ_WEBRTC']:
- UNIFIED_SOURCES += [
+ SOURCES += [
'nsDOMDataChannel.cpp',
]
diff --git a/dom/base/nsAttrValue.cpp b/dom/base/nsAttrValue.cpp
index ebddcb7ed..2418fb501 100644
--- a/dom/base/nsAttrValue.cpp
+++ b/dom/base/nsAttrValue.cpp
@@ -1526,6 +1526,40 @@ nsAttrValue::ParseIntWithFallback(const nsAString& aString, int32_t aDefault,
SetIntValueAndType(val, eInteger, nonStrict ? &aString : nullptr);
}
+void
+nsAttrValue::ParseClampedNonNegativeInt(const nsAString& aString,
+ int32_t aDefault, int32_t aMin,
+ int32_t aMax)
+{
+ ResetIfSet();
+
+ nsContentUtils::ParseHTMLIntegerResultFlags result;
+ int32_t val = nsContentUtils::ParseHTMLInteger(aString, &result);
+ bool nonStrict = (result & nsContentUtils::eParseHTMLInteger_IsPercent) ||
+ (result & nsContentUtils::eParseHTMLInteger_NonStandard) ||
+ (result & nsContentUtils::eParseHTMLInteger_DidNotConsumeAllInput);
+
+ if (result & nsContentUtils::eParseHTMLInteger_ErrorOverflow) {
+ if (result & nsContentUtils::eParseHTMLInteger_Negative) {
+ val = aDefault;
+ } else {
+ val = aMax;
+ }
+ nonStrict = true;
+ } else if ((result & nsContentUtils::eParseHTMLInteger_Error) || val < 0) {
+ val = aDefault;
+ nonStrict = true;
+ } else if (val < aMin) {
+ val = aMin;
+ nonStrict = true;
+ } else if (val > aMax) {
+ val = aMax;
+ nonStrict = true;
+ }
+
+ SetIntValueAndType(val, eInteger, nonStrict ? &aString : nullptr);
+}
+
bool
nsAttrValue::ParseNonNegativeIntValue(const nsAString& aString)
{
diff --git a/dom/base/nsAttrValue.h b/dom/base/nsAttrValue.h
index 655e4ca61..23f61a614 100644
--- a/dom/base/nsAttrValue.h
+++ b/dom/base/nsAttrValue.h
@@ -362,6 +362,19 @@ public:
*/
bool ParseNonNegativeIntValue(const nsAString& aString);
+ /**
+ * Parse a string value into a clamped non-negative integer.
+ * This method follows the rules for parsing non-negative integer from:
+ * https://html.spec.whatwg.org/multipage/infrastructure.html#clamped-to-the-range
+ *
+ * @param aString the string to parse
+ * @param aDefault value to return for negative or invalid values
+ * @param aMin minimum value
+ * @param aMax maximum value
+ */
+ void ParseClampedNonNegativeInt(const nsAString& aString, int32_t aDefault,
+ int32_t aMin, int32_t aMax);
+
/**
* Parse a string value into a positive integer.
* This method follows the rules for parsing non-negative integer from:
diff --git a/dom/base/nsContentUtils.cpp b/dom/base/nsContentUtils.cpp
index 800f40fa1..6a9904bf9 100644
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -1080,6 +1080,7 @@ nsContentUtils::ParseHTMLInteger(const nsAString& aValue,
int sign = 1;
if (*iter == char16_t('-')) {
sign = -1;
+ result |= eParseHTMLInteger_Negative;
++iter;
} else if (*iter == char16_t('+')) {
result |= eParseHTMLInteger_NonStandard;
diff --git a/dom/base/nsContentUtils.h b/dom/base/nsContentUtils.h
index 606d67de9..ffbd15e78 100644
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -444,7 +444,9 @@ public:
// Set if one or more error flags were set.
eParseHTMLInteger_Error = 1 << 3,
eParseHTMLInteger_ErrorNoValue = 1 << 4,
- eParseHTMLInteger_ErrorOverflow = 1 << 5
+ eParseHTMLInteger_ErrorOverflow = 1 << 5,
+ // Use this flag to detect the difference between overflow and underflow
+ eParseHTMLInteger_Negative = 1 << 6,
};
static int32_t ParseHTMLInteger(const nsAString& aValue,
ParseHTMLIntegerResultFlags *aResult);
diff --git a/dom/base/nsDOMMutationObserver.cpp b/dom/base/nsDOMMutationObserver.cpp
index 858a30ce5..0273b7b94 100644
--- a/dom/base/nsDOMMutationObserver.cpp
+++ b/dom/base/nsDOMMutationObserver.cpp
@@ -7,6 +7,7 @@
#include "nsDOMMutationObserver.h"
#include "mozilla/AnimationTarget.h"
+#include "mozilla/CycleCollectedJSContext.h"
#include "mozilla/Maybe.h"
#include "mozilla/OwningNonNull.h"
@@ -29,6 +30,9 @@ using mozilla::dom::TreeOrderComparator;
using mozilla::dom::Animation;
using mozilla::dom::Element;
+using namespace mozilla;
+using namespace mozilla::dom;
+
AutoTArray<RefPtr<nsDOMMutationObserver>, 4>*
nsDOMMutationObserver::sScheduledMutationObservers = nullptr;
diff --git a/dom/base/nsDocument.cpp b/dom/base/nsDocument.cpp
index afe88a454..380593737 100644
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -166,7 +166,6 @@
#include "mozilla/dom/HTMLIFrameElement.h"
#include "mozilla/dom/HTMLImageElement.h"
#include "mozilla/dom/MediaSource.h"
-#include "mozilla/dom/FlyWebService.h"
#include "mozAutoDocUpdate.h"
#include "nsGlobalWindow.h"
@@ -8369,13 +8368,6 @@ nsDocument::CanSavePresentation(nsIRequest *aNewRequest)
return false;
}
- // Don't save presentation if there are active FlyWeb connections or FlyWeb
- // servers.
- FlyWebService* flyWebService = FlyWebService::GetExisting();
- if (flyWebService && flyWebService->HasConnectionOrServer(win->WindowID())) {
- return false;
- }
-
if (mSubDocuments) {
for (auto iter = mSubDocuments->Iter(); !iter.Done(); iter.Next()) {
auto entry = static_cast<SubDocMapEntry*>(iter.Get());
diff --git a/dom/base/nsFocusManager.cpp b/dom/base/nsFocusManager.cpp
index fb350fa12..01c1944be 100644
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -1261,6 +1261,15 @@ nsFocusManager::SetFocusInner(nsIContent* aNewContent, int32_t aFlags,
isElementInActiveWindow = (mActiveWindow && newRootWindow == mActiveWindow);
}
+ // Exit fullscreen if a website focuses another window
+ if (!isElementInActiveWindow && aFlags & FLAG_RAISE) {
+ if (nsIDocument* doc = mActiveWindow ? mActiveWindow->GetDoc() : nullptr) {
+ if (doc && doc->GetFullscreenElement()) {
+ nsIDocument::AsyncExitFullscreen(doc);
+ }
+ }
+ }
+
// Exit fullscreen if we're focusing a windowed plugin on a non-MacOSX
// system. We don't control event dispatch to windowed plugins on non-MacOSX,
// so we can't display the "Press ESC to leave fullscreen mode" warning on
diff --git a/dom/base/nsJSEnvironment.cpp b/dom/base/nsJSEnvironment.cpp
index dfd380fc2..efea3ee40 100644
--- a/dom/base/nsJSEnvironment.cpp
+++ b/dom/base/nsJSEnvironment.cpp
@@ -57,6 +57,7 @@
#include "mozilla/dom/ErrorEvent.h"
#include "nsAXPCNativeCallContext.h"
#include "mozilla/CycleCollectedJSContext.h"
+#include "mozilla/Telemetry.h"
#include "nsJSPrincipals.h"
diff --git a/dom/base/nsJSUtils.cpp b/dom/base/nsJSUtils.cpp
index 98b367b66..c9cec96db 100644
--- a/dom/base/nsJSUtils.cpp
+++ b/dom/base/nsJSUtils.cpp
@@ -31,6 +31,7 @@
#include "mozilla/dom/Element.h"
#include "mozilla/dom/ScriptSettings.h"
+using namespace mozilla;
using namespace mozilla::dom;
bool
diff --git a/dom/base/nsScriptLoader.cpp b/dom/base/nsScriptLoader.cpp
index 3ac00142d..25482fe7b 100644
--- a/dom/base/nsScriptLoader.cpp
+++ b/dom/base/nsScriptLoader.cpp
@@ -1144,7 +1144,7 @@ nsScriptLoader::InstantiateModuleTree(nsModuleLoadRequest* aRequest)
nsModuleScript* ms = aRequest->mModuleScript;
MOZ_ASSERT(ms);
- if (!ms->ModuleRecord()) {
+ if (!ms || !ms->ModuleRecord()) {
return false;
}
diff --git a/dom/bindings/Bindings.conf b/dom/bindings/Bindings.conf
index b00af2085..941e65eff 100644
--- a/dom/bindings/Bindings.conf
+++ b/dom/bindings/Bindings.conf
@@ -53,11 +53,6 @@ DOMInterfaces = {
'concrete': False
},
-'AddonManagerPermissions': {
- 'wrapperCache': False,
- 'concrete': False
-},
-
'AnimationEffectReadOnly': {
'concrete': False
},
@@ -340,14 +335,6 @@ DOMInterfaces = {
'wrapperCache': False,
},
-'FlyWebFetchEvent': {
- 'headerFile': 'FlyWebServerEvents.h',
-},
-
-'FlyWebWebSocketEvent': {
- 'headerFile': 'FlyWebServerEvents.h',
-},
-
'FontFaceSet': {
'implicitJSContext': [ 'load' ],
},
diff --git a/dom/bindings/Codegen.py b/dom/bindings/Codegen.py
index 6b23e8225..e3cca63b6 100644
--- a/dom/bindings/Codegen.py
+++ b/dom/bindings/Codegen.py
@@ -1109,6 +1109,12 @@ class CGHeaders(CGWrapper):
# Now find all the things we'll need as arguments because we
# need to wrap or unwrap them.
bindingHeaders = set()
+
+ # KeyframeAnimationOptions.webidl is doing something VERY screwy and
+ # Unified Building really sucks so directly include this
+ if prefix == "KeyframeAnimationOptionsBinding":
+ bindingHeaders.add("mozilla/dom/PrimitiveConversions.h")
+
declareIncludes = set(declareIncludes)
def addHeadersForType((t, dictionary)):
diff --git a/dom/bindings/GenerateCSS2PropertiesWebIDL.py b/dom/bindings/GenerateCSS2PropertiesWebIDL.py
index 58ec60c29..57634494f 100644
--- a/dom/bindings/GenerateCSS2PropertiesWebIDL.py
+++ b/dom/bindings/GenerateCSS2PropertiesWebIDL.py
@@ -16,6 +16,7 @@ def generateLine(propName, extendedAttrs):
return " [%s] attribute DOMString %s;\n" % (", ".join(extendedAttrs),
propName)
def generate(output, idlFilename, preprocessorHeader):
+ print(idlFilename)
cpp = list(buildconfig.substs['CPP'])
cpp += shellutil.split(buildconfig.substs['ACDEFINES'])
cpp.append(preprocessorHeader)
diff --git a/dom/bindings/WebIDLGlobalNameHash.cpp b/dom/bindings/WebIDLGlobalNameHash.cpp
index 7477b52e7..981a1a395 100644
--- a/dom/bindings/WebIDLGlobalNameHash.cpp
+++ b/dom/bindings/WebIDLGlobalNameHash.cpp
@@ -4,8 +4,12 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include "jswrapper.h"
#include "WebIDLGlobalNameHash.h"
#include "js/GCAPI.h"
+#include "XrayWrapper.h"
+#include "XPCWrapper.h"
+#include "mozilla/dom/Selection.h"
#include "mozilla/HashFunctions.h"
#include "mozilla/Maybe.h"
#include "mozilla/dom/DOMJSProxyHandler.h"
diff --git a/dom/bindings/WebIDLGlobalNameHash.h b/dom/bindings/WebIDLGlobalNameHash.h
index bbe015395..cd7be2c69 100644
--- a/dom/bindings/WebIDLGlobalNameHash.h
+++ b/dom/bindings/WebIDLGlobalNameHash.h
@@ -8,6 +8,7 @@
#define mozilla_dom_WebIDLGlobalNameHash_h__
#include "js/RootingAPI.h"
+#include "nsString.h"
#include "nsTArray.h"
namespace mozilla {
diff --git a/dom/bindings/moz.build b/dom/bindings/moz.build
index ed8a4d37e..ca82b48a8 100644
--- a/dom/bindings/moz.build
+++ b/dom/bindings/moz.build
@@ -89,7 +89,7 @@ LOCAL_INCLUDES += [
'/media/webrtc/signaling/src/peerconnection',
]
-UNIFIED_SOURCES += [
+SOURCES += [
'BindingUtils.cpp',
'CallbackInterface.cpp',
'CallbackObject.cpp',
diff --git a/dom/bindings/mozwebidlcodegen/__init__.py b/dom/bindings/mozwebidlcodegen/__init__.py
index b6e351e52..69f3f5e25 100644
--- a/dom/bindings/mozwebidlcodegen/__init__.py
+++ b/dom/bindings/mozwebidlcodegen/__init__.py
@@ -269,6 +269,7 @@ class WebIDLCodegenManager(LoggingMixin):
# Generate bindings from .webidl files.
for filename in sorted(changed_inputs):
basename = mozpath.basename(filename)
+ print basename
result.inputs.add(filename)
written, deps = self._generate_build_files_for_webidl(filename)
result.created |= written[0]
diff --git a/dom/bindings/nsScriptError.h b/dom/bindings/nsScriptError.h
index b8049d0a0..ac8099c1c 100644
--- a/dom/bindings/nsScriptError.h
+++ b/dom/bindings/nsScriptError.h
@@ -14,8 +14,13 @@
#include "jsapi.h"
#include "js/RootingAPI.h"
+#include "jswrapper.h"
+#include "nsCOMArray.h"
+#include "nsContentUtils.h"
+#include "nsCycleCollectionParticipant.h"
#include "nsIScriptError.h"
#include "nsString.h"
+#include "nsStringFwd.h"
class nsScriptErrorNote final : public nsIScriptErrorNote {
public:
diff --git a/dom/bindings/nsScriptErrorWithStack.cpp b/dom/bindings/nsScriptErrorWithStack.cpp
index 74c00999f..0a8df38b3 100644
--- a/dom/bindings/nsScriptErrorWithStack.cpp
+++ b/dom/bindings/nsScriptErrorWithStack.cpp
@@ -22,7 +22,7 @@ using namespace mozilla::dom;
namespace {
static nsCString
-FormatStackString(JSContext* cx, HandleObject aStack) {
+FormatStackString(JSContext* cx, JS::HandleObject aStack) {
JS::RootedString formattedStack(cx);
if (!JS::BuildStackString(cx, aStack, &formattedStack)) {
@@ -111,7 +111,7 @@ nsScriptErrorWithStack::ToString(nsACString& /*UTF8*/ aResult)
}
JSContext* cx = jsapi.cx();
- RootedObject stack(cx, mStack);
+ JS::RootedObject stack(cx, mStack);
nsCString stackString = FormatStackString(cx, stack);
nsCString combined = message + NS_LITERAL_CSTRING("\n") + stackString;
aResult.Assign(combined);
diff --git a/dom/events/test/test_all_synthetic_events.html b/dom/events/test/test_all_synthetic_events.html
index 90dbe95ee..58560fdce 100644
--- a/dom/events/test/test_all_synthetic_events.html
+++ b/dom/events/test/test_all_synthetic_events.html
@@ -139,10 +139,6 @@ const kEventConstructors = {
return new ErrorEvent(aName, aProps);
},
},
- FlyWebFetchEvent: { create: null, // Cannot create untrusted event from JS.
- },
- FlyWebWebSocketEvent: { create: null, // Cannot create untrusted event from JS.
- },
FocusEvent: { create: function (aName, aProps) {
return new FocusEvent(aName, aProps);
},
diff --git a/dom/flyweb/FlyWebDiscoveryManager.cpp b/dom/flyweb/FlyWebDiscoveryManager.cpp
deleted file mode 100644
index 5a97eb6d8..000000000
--- a/dom/flyweb/FlyWebDiscoveryManager.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsString.h"
-#include "nsTHashtable.h"
-#include "nsClassHashtable.h"
-#include "nsIUUIDGenerator.h"
-#include "jsapi.h"
-#include "mozilla/StaticPtr.h"
-#include "mozilla/Logging.h"
-#include "nsComponentManagerUtils.h"
-#include "nsServiceManagerUtils.h"
-
-#include "mozilla/dom/FlyWebDiscoveryManager.h"
-#include "mozilla/dom/FlyWebDiscoveryManagerBinding.h"
-
-namespace mozilla {
-namespace dom {
-
-static LazyLogModule gFlyWebDiscoveryManagerLog("FlyWebDiscoveryManager");
-#undef LOG_I
-#define LOG_I(...) MOZ_LOG(mozilla::dom::gFlyWebDiscoveryManagerLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
-#undef LOG_E
-#define LOG_E(...) MOZ_LOG(mozilla::dom::gFlyWebDiscoveryManagerLog, mozilla::LogLevel::Error, (__VA_ARGS__))
-
-
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE_0(FlyWebDiscoveryManager)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(FlyWebDiscoveryManager)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(FlyWebDiscoveryManager)
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(FlyWebDiscoveryManager)
- NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
- NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-FlyWebDiscoveryManager::FlyWebDiscoveryManager(nsISupports* aParent,
- FlyWebService* aService)
- : mParent(aParent)
- , mService(aService)
- , mNextId(0)
-{
-}
-
-FlyWebDiscoveryManager::~FlyWebDiscoveryManager()
-{
- mService->UnregisterDiscoveryManager(this);
-}
-
-JSObject*
-FlyWebDiscoveryManager::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
- return FlyWebDiscoveryManagerBinding::Wrap(aCx, this, aGivenProto);
-}
-
-nsISupports*
-FlyWebDiscoveryManager::GetParentObject() const
-{
- return mParent;
-}
-
-/* static */ already_AddRefed<FlyWebDiscoveryManager>
-FlyWebDiscoveryManager::Constructor(const GlobalObject& aGlobal, ErrorResult& rv)
-{
- RefPtr<FlyWebService> service = FlyWebService::GetOrCreate();
- if (!service) {
- return nullptr;
- }
-
- RefPtr<FlyWebDiscoveryManager> result = new FlyWebDiscoveryManager(
- aGlobal.GetAsSupports(), service);
- return result.forget();
-}
-
-void
-FlyWebDiscoveryManager::ListServices(nsTArray<FlyWebDiscoveredService>& aServices)
-{
- return mService->ListDiscoveredServices(aServices);
-}
-
-uint32_t
-FlyWebDiscoveryManager::StartDiscovery(FlyWebDiscoveryCallback& aCallback)
-{
- uint32_t id = GenerateId();
- mCallbackMap.Put(id, &aCallback);
- mService->RegisterDiscoveryManager(this);
- return id;
-}
-
-void
-FlyWebDiscoveryManager::StopDiscovery(uint32_t aId)
-{
- mCallbackMap.Remove(aId);
- if (mCallbackMap.Count() == 0) {
- mService->UnregisterDiscoveryManager(this);
- }
-}
-
-void
-FlyWebDiscoveryManager::PairWithService(const nsAString& aServiceId,
- FlyWebPairingCallback& aCallback)
-{
- mService->PairWithService(aServiceId, aCallback);
-}
-
-void
-FlyWebDiscoveryManager::NotifyDiscoveredServicesChanged()
-{
- nsTArray<FlyWebDiscoveredService> services;
- ListServices(services);
- Sequence<FlyWebDiscoveredService> servicesSeq;
- servicesSeq.SwapElements(services);
- for (auto iter = mCallbackMap.Iter(); !iter.Done(); iter.Next()) {
- FlyWebDiscoveryCallback *callback = iter.UserData();
- ErrorResult err;
- callback->OnDiscoveredServicesChanged(servicesSeq, err);
- ENSURE_SUCCESS_VOID(err);
- }
-}
-
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/flyweb/FlyWebDiscoveryManager.h b/dom/flyweb/FlyWebDiscoveryManager.h
deleted file mode 100644
index cb5f692f8..000000000
--- a/dom/flyweb/FlyWebDiscoveryManager.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_FlyWebDiscoveryManager_h
-#define mozilla_dom_FlyWebDiscoveryManager_h
-
-#include "nsISupportsImpl.h"
-#include "mozilla/ErrorResult.h"
-#include "nsRefPtrHashtable.h"
-#include "nsWrapperCache.h"
-#include "FlyWebDiscoveryManagerBinding.h"
-#include "FlyWebService.h"
-
-namespace mozilla {
-namespace dom {
-
-class FlyWebDiscoveryManager final : public nsISupports
- , public nsWrapperCache
-{
-public:
- NS_DECL_CYCLE_COLLECTING_ISUPPORTS
- NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(FlyWebDiscoveryManager)
-
- virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
- nsISupports* GetParentObject() const;
-
- static already_AddRefed<FlyWebDiscoveryManager> Constructor(const GlobalObject& aGlobal,
- ErrorResult& rv);
-
- void ListServices(nsTArray<FlyWebDiscoveredService>& aServices);
- uint32_t StartDiscovery(FlyWebDiscoveryCallback& aCallback);
- void StopDiscovery(uint32_t aId);
-
- void PairWithService(const nsAString& aServiceId,
- FlyWebPairingCallback& callback);
-
- void NotifyDiscoveredServicesChanged();
-
-private:
- FlyWebDiscoveryManager(nsISupports* mParent, FlyWebService* aService);
- ~FlyWebDiscoveryManager();
-
- uint32_t GenerateId() {
- return ++mNextId;
- }
-
- nsCOMPtr<nsISupports> mParent;
- RefPtr<FlyWebService> mService;
-
- uint32_t mNextId;
-
- nsRefPtrHashtable<nsUint32HashKey, FlyWebDiscoveryCallback> mCallbackMap;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_FlyWebDiscoveryManager_h
diff --git a/dom/flyweb/FlyWebPublishOptionsIPCSerializer.h b/dom/flyweb/FlyWebPublishOptionsIPCSerializer.h
deleted file mode 100644
index fa1a44113..000000000
--- a/dom/flyweb/FlyWebPublishOptionsIPCSerializer.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_FlyWebPublishOptionsIPCSerialiser_h
-#define mozilla_dom_FlyWebPublishOptionsIPCSerialiser_h
-
-#include "mozilla/dom/FlyWebPublishBinding.h"
-
-namespace IPC {
-
-template <>
-struct ParamTraits<mozilla::dom::FlyWebPublishOptions>
-{
- typedef mozilla::dom::FlyWebPublishOptions paramType;
-
- // Function to serialize a FlyWebPublishOptions
- static void Write(Message *aMsg, const paramType& aParam)
- {
- WriteParam(aMsg, aParam.mUiUrl);
- }
- // Function to de-serialize a FlyWebPublishOptions
- static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
- {
- return ReadParam(aMsg, aIter, &(aResult->mUiUrl));
- }
-};
-
-}
-
-#endif // mozilla_dom_FlyWebPublishOptionsIPCSerialiser_h
diff --git a/dom/flyweb/FlyWebPublishedServer.cpp b/dom/flyweb/FlyWebPublishedServer.cpp
deleted file mode 100644
index 375df332f..000000000
--- a/dom/flyweb/FlyWebPublishedServer.cpp
+++ /dev/null
@@ -1,675 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/FlyWebPublishedServerIPC.h"
-#include "mozilla/dom/FlyWebPublishBinding.h"
-#include "mozilla/dom/FlyWebService.h"
-#include "mozilla/dom/Request.h"
-#include "mozilla/dom/FlyWebServerEvents.h"
-#include "mozilla/dom/ContentChild.h"
-#include "mozilla/dom/ContentParent.h"
-#include "mozilla/dom/InternalResponse.h"
-#include "mozilla/ipc/IPCStreamUtils.h"
-#include "mozilla/net/NeckoParent.h"
-#include "mozilla/net/IPCTransportProvider.h"
-#include "mozilla/ErrorResult.h"
-#include "mozilla/Preferences.h"
-#include "mozilla/Unused.h"
-#include "nsCharSeparatedTokenizer.h"
-#include "nsGlobalWindow.h"
-#include "WebSocketChannel.h"
-
-namespace mozilla {
-namespace dom {
-
-static LazyLogModule gFlyWebPublishedServerLog("FlyWebPublishedServer");
-#undef LOG_I
-#define LOG_I(...) MOZ_LOG(mozilla::dom::gFlyWebPublishedServerLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
-#undef LOG_E
-#define LOG_E(...) MOZ_LOG(mozilla::dom::gFlyWebPublishedServerLog, mozilla::LogLevel::Error, (__VA_ARGS__))
-
-/******** FlyWebPublishedServer ********/
-
-FlyWebPublishedServer::FlyWebPublishedServer(nsPIDOMWindowInner* aOwner,
- const nsAString& aName,
- const FlyWebPublishOptions& aOptions)
- : mozilla::DOMEventTargetHelper(aOwner)
- , mOwnerWindowID(aOwner ? aOwner->WindowID() : 0)
- , mName(aName)
- , mUiUrl(aOptions.mUiUrl)
- , mIsRegistered(true) // Registered by the FlyWebService
-{
-}
-
-void
-FlyWebPublishedServer::LastRelease()
-{
- // Make sure to unregister to avoid dangling pointers. Use the LastRelease
- // hook rather than dtor since calling virtual functions during dtor
- // wouldn't do what we want. Also, LastRelease is called earlier than dtor
- // for CC objects.
- Close();
-}
-
-JSObject*
-FlyWebPublishedServer::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
- return FlyWebPublishedServerBinding::Wrap(aCx, this, aGivenProto);
-}
-
-void
-FlyWebPublishedServer::Close()
-{
- LOG_I("FlyWebPublishedServer::Close(%p)", this);
-
- // Unregister from server.
- if (mIsRegistered) {
- MOZ_ASSERT(FlyWebService::GetExisting());
- FlyWebService::GetExisting()->UnregisterServer(this);
- mIsRegistered = false;
-
- DispatchTrustedEvent(NS_LITERAL_STRING("close"));
- }
-}
-
-void
-FlyWebPublishedServer::FireFetchEvent(InternalRequest* aRequest)
-{
- nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
- RefPtr<FlyWebFetchEvent> e = new FlyWebFetchEvent(this,
- new Request(global, aRequest),
- aRequest);
- e->Init(this);
- e->InitEvent(NS_LITERAL_STRING("fetch"), false, false);
-
- DispatchTrustedEvent(e);
-}
-
-void
-FlyWebPublishedServer::FireWebsocketEvent(InternalRequest* aConnectRequest)
-{
- nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
- RefPtr<FlyWebFetchEvent> e = new FlyWebWebSocketEvent(this,
- new Request(global, aConnectRequest),
- aConnectRequest);
- e->Init(this);
- e->InitEvent(NS_LITERAL_STRING("websocket"), false, false);
-
- DispatchTrustedEvent(e);
-}
-
-void
-FlyWebPublishedServer::PublishedServerStarted(nsresult aStatus)
-{
- LOG_I("FlyWebPublishedServer::PublishedServerStarted(%p)", this);
-
- RefPtr<FlyWebPublishPromise> promise = mPublishPromise.Ensure(__func__);
- if (NS_SUCCEEDED(aStatus)) {
- mPublishPromise.Resolve(this, __func__);
- } else {
- Close();
- mPublishPromise.Reject(aStatus, __func__);
- }
-}
-
-already_AddRefed<WebSocket>
-FlyWebPublishedServer::OnWebSocketAccept(InternalRequest* aConnectRequest,
- const Optional<nsAString>& aProtocol,
- ErrorResult& aRv)
-{
- MOZ_ASSERT(aConnectRequest);
-
- LOG_I("FlyWebPublishedServer::OnWebSocketAccept(%p)", this);
-
- nsCOMPtr<nsITransportProvider> provider =
- OnWebSocketAcceptInternal(aConnectRequest,
- aProtocol,
- aRv);
- if (aRv.Failed()) {
- return nullptr;
- }
- MOZ_ASSERT(provider);
-
- nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(GetOwner());
- AutoJSContext cx;
- GlobalObject global(cx, nsGlobalWindow::Cast(window)->FastGetGlobalJSObject());
-
- nsAutoCString extensions, negotiatedExtensions;
- aConnectRequest->Headers()->
- GetFirst(NS_LITERAL_CSTRING("Sec-WebSocket-Extensions"), extensions, aRv);
- mozilla::net::ProcessServerWebSocketExtensions(extensions,
- negotiatedExtensions);
-
- nsCString url;
- aConnectRequest->GetURL(url);
- Sequence<nsString> protocols;
- if (aProtocol.WasPassed() &&
- !protocols.AppendElement(aProtocol.Value(), fallible)) {
- aRv.Throw(NS_ERROR_OUT_OF_MEMORY);
- return nullptr;
- }
-
- return WebSocket::ConstructorCommon(global,
- NS_ConvertUTF8toUTF16(url),
- protocols,
- provider,
- negotiatedExtensions,
- aRv);
-}
-
-/******** FlyWebPublishedServerImpl ********/
-
-NS_IMPL_ISUPPORTS_INHERITED0(FlyWebPublishedServerImpl, mozilla::DOMEventTargetHelper)
-
-FlyWebPublishedServerImpl::FlyWebPublishedServerImpl(nsPIDOMWindowInner* aOwner,
- const nsAString& aName,
- const FlyWebPublishOptions& aOptions)
- : FlyWebPublishedServer(aOwner, aName, aOptions)
- , mHttpServer(new HttpServer())
-{
- LOG_I("FlyWebPublishedServerImpl::FlyWebPublishedServerImpl(%p)", this);
-}
-
-void
-FlyWebPublishedServerImpl::PermissionGranted(bool aGranted)
-{
- LOG_I("FlyWebPublishedServerImpl::PermissionGranted(%b)", aGranted);
- if (!aGranted) {
- PublishedServerStarted(NS_ERROR_FAILURE);
- return;
- }
-
- mHttpServer->Init(-1, Preferences::GetBool("flyweb.use-tls", false), this);
-}
-
-void
-FlyWebPublishedServerImpl::Close()
-{
- FlyWebPublishedServer::Close();
-
- if (mMDNSCancelRegister) {
- mMDNSCancelRegister->Cancel(NS_BINDING_ABORTED);
- mMDNSCancelRegister = nullptr;
- }
-
- if (mHttpServer) {
- RefPtr<HttpServer> server = mHttpServer.forget();
- server->Close();
- }
-}
-
-void
-FlyWebPublishedServerImpl::OnServerStarted(nsresult aStatus)
-{
- if (NS_SUCCEEDED(aStatus)) {
- FlyWebService::GetOrCreate()->StartDiscoveryOf(this);
- } else {
- PublishedServerStarted(aStatus);
- }
-}
-
-void
-FlyWebPublishedServerImpl::OnFetchResponse(InternalRequest* aRequest,
- InternalResponse* aResponse)
-{
- MOZ_ASSERT(aRequest);
- MOZ_ASSERT(aResponse);
-
- LOG_I("FlyWebPublishedServerImpl::OnFetchResponse(%p)", this);
-
- if (mHttpServer) {
- mHttpServer->SendResponse(aRequest, aResponse);
- }
-}
-
-void
-FlyWebPublishedServerImpl::OnWebSocketResponse(InternalRequest* aConnectRequest,
- InternalResponse* aResponse)
-{
- MOZ_ASSERT(aConnectRequest);
- MOZ_ASSERT(aResponse);
-
- LOG_I("FlyWebPublishedMDNSServer::OnWebSocketResponse(%p)", this);
-
- if (mHttpServer) {
- mHttpServer->SendWebSocketResponse(aConnectRequest, aResponse);
- }
-}
-
-already_AddRefed<nsITransportProvider>
-FlyWebPublishedServerImpl::OnWebSocketAcceptInternal(InternalRequest* aConnectRequest,
- const Optional<nsAString>& aProtocol,
- ErrorResult& aRv)
-{
- LOG_I("FlyWebPublishedServerImpl::OnWebSocketAcceptInternal(%p)", this);
-
- if (!mHttpServer) {
- aRv.Throw(NS_ERROR_UNEXPECTED);
- return nullptr;
- }
-
- return mHttpServer->AcceptWebSocket(aConnectRequest,
- aProtocol,
- aRv);
-}
-
-/******** FlyWebPublishedServerChild ********/
-
-FlyWebPublishedServerChild::FlyWebPublishedServerChild(nsPIDOMWindowInner* aOwner,
- const nsAString& aName,
- const FlyWebPublishOptions& aOptions)
- : FlyWebPublishedServer(aOwner, aName, aOptions)
- , mActorExists(false)
-{
- LOG_I("FlyWebPublishedServerChild::FlyWebPublishedServerChild(%p)", this);
-
- // The matching release happens when the actor is destroyed, in
- // ContentChild::DeallocPFlyWebPublishedServerChild
- NS_ADDREF_THIS();
-}
-
-void
-FlyWebPublishedServerChild::PermissionGranted(bool aGranted)
-{
- if (!aGranted) {
- PublishedServerStarted(NS_ERROR_FAILURE);
- return;
- }
-
- mActorExists = true;
- FlyWebPublishOptions options;
- options.mUiUrl = mUiUrl;
-
- // Proceed with initialization.
- ContentChild::GetSingleton()->
- SendPFlyWebPublishedServerConstructor(this, mName, options);
-}
-
-bool
-FlyWebPublishedServerChild::RecvServerReady(const nsresult& aStatus)
-{
- LOG_I("FlyWebPublishedServerChild::RecvServerReady(%p)", this);
- MOZ_ASSERT(mActorExists);
-
- PublishedServerStarted(aStatus);
- return true;
-}
-
-bool
-FlyWebPublishedServerChild::RecvServerClose()
-{
- LOG_I("FlyWebPublishedServerChild::RecvServerClose(%p)", this);
- MOZ_ASSERT(mActorExists);
-
- Close();
-
- return true;
-}
-
-bool
-FlyWebPublishedServerChild::RecvFetchRequest(const IPCInternalRequest& aRequest,
- const uint64_t& aRequestId)
-{
- LOG_I("FlyWebPublishedServerChild::RecvFetchRequest(%p)", this);
- MOZ_ASSERT(mActorExists);
-
- RefPtr<InternalRequest> request = new InternalRequest(aRequest);
- mPendingRequests.Put(request, aRequestId);
- FireFetchEvent(request);
-
- return true;
-}
-
-bool
-FlyWebPublishedServerChild::RecvWebSocketRequest(const IPCInternalRequest& aRequest,
- const uint64_t& aRequestId,
- PTransportProviderChild* aProvider)
-{
- LOG_I("FlyWebPublishedServerChild::RecvWebSocketRequest(%p)", this);
- MOZ_ASSERT(mActorExists);
-
- RefPtr<InternalRequest> request = new InternalRequest(aRequest);
- mPendingRequests.Put(request, aRequestId);
-
- // Not addreffing here. The addref was already done when the
- // PTransportProvider child constructor original ran.
- mPendingTransportProviders.Put(aRequestId,
- dont_AddRef(static_cast<TransportProviderChild*>(aProvider)));
-
- FireWebsocketEvent(request);
-
- return true;
-}
-
-void
-FlyWebPublishedServerChild::ActorDestroy(ActorDestroyReason aWhy)
-{
- LOG_I("FlyWebPublishedServerChild::ActorDestroy(%p)", this);
-
- mActorExists = false;
-}
-
-void
-FlyWebPublishedServerChild::OnFetchResponse(InternalRequest* aRequest,
- InternalResponse* aResponse)
-{
- LOG_I("FlyWebPublishedServerChild::OnFetchResponse(%p)", this);
-
- if (!mActorExists) {
- LOG_I("FlyWebPublishedServerChild::OnFetchResponse(%p) - No actor!", this);
- return;
- }
-
- uint64_t id = mPendingRequests.Get(aRequest);
- MOZ_ASSERT(id);
- mPendingRequests.Remove(aRequest);
-
- IPCInternalResponse ipcResp;
- UniquePtr<mozilla::ipc::AutoIPCStream> autoStream;
- nsIContentChild* cc = static_cast<ContentChild*>(Manager());
- aResponse->ToIPC(&ipcResp, cc, autoStream);
- Unused << SendFetchResponse(ipcResp, id);
- if (autoStream) {
- autoStream->TakeOptionalValue();
- }
-}
-
-already_AddRefed<nsITransportProvider>
-FlyWebPublishedServerChild::OnWebSocketAcceptInternal(InternalRequest* aRequest,
- const Optional<nsAString>& aProtocol,
- ErrorResult& aRv)
-{
- LOG_I("FlyWebPublishedServerChild::OnWebSocketAcceptInternal(%p)", this);
-
- if (!mActorExists) {
- LOG_I("FlyWebPublishedServerChild::OnWebSocketAcceptInternal(%p) - No actor!", this);
- return nullptr;
- }
-
- uint64_t id = mPendingRequests.Get(aRequest);
- MOZ_ASSERT(id);
- mPendingRequests.Remove(aRequest);
-
- RefPtr<TransportProviderChild> provider;
- mPendingTransportProviders.Remove(id, getter_AddRefs(provider));
-
- nsString protocol;
- if (aProtocol.WasPassed()) {
- protocol = aProtocol.Value();
-
- nsAutoCString reqProtocols;
- aRequest->Headers()->
- GetFirst(NS_LITERAL_CSTRING("Sec-WebSocket-Protocol"), reqProtocols, aRv);
- if (!ContainsToken(reqProtocols, NS_ConvertUTF16toUTF8(protocol))) {
- // Should throw a better error here
- aRv.Throw(NS_ERROR_FAILURE);
- return nullptr;
- }
- } else {
- protocol.SetIsVoid(true);
- }
-
- Unused << SendWebSocketAccept(protocol, id);
-
- return provider.forget();
-}
-
-void
-FlyWebPublishedServerChild::OnWebSocketResponse(InternalRequest* aRequest,
- InternalResponse* aResponse)
-{
- LOG_I("FlyWebPublishedServerChild::OnFetchResponse(%p)", this);
-
- if (!mActorExists) {
- LOG_I("FlyWebPublishedServerChild::OnFetchResponse(%p) - No actor!", this);
- return;
- }
-
- uint64_t id = mPendingRequests.Get(aRequest);
- MOZ_ASSERT(id);
- mPendingRequests.Remove(aRequest);
-
- mPendingTransportProviders.Remove(id);
-
- IPCInternalResponse ipcResp;
- UniquePtr<mozilla::ipc::AutoIPCStream> autoStream;
- nsIContentChild* cc = static_cast<ContentChild*>(Manager());
- aResponse->ToIPC(&ipcResp, cc, autoStream);
-
- Unused << SendWebSocketResponse(ipcResp, id);
- if (autoStream) {
- autoStream->TakeOptionalValue();
- }
-}
-
-void
-FlyWebPublishedServerChild::Close()
-{
- LOG_I("FlyWebPublishedServerChild::Close(%p)", this);
-
- FlyWebPublishedServer::Close();
-
- if (mActorExists) {
- LOG_I("FlyWebPublishedServerChild::Close - sending __delete__ (%p)", this);
-
- Send__delete__(this);
- }
-}
-
-/******** FlyWebPublishedServerParent ********/
-
-NS_IMPL_ISUPPORTS(FlyWebPublishedServerParent, nsIDOMEventListener)
-
-FlyWebPublishedServerParent::FlyWebPublishedServerParent(const nsAString& aName,
- const FlyWebPublishOptions& aOptions)
- : mActorDestroyed(false)
- , mNextRequestId(1)
-{
- LOG_I("FlyWebPublishedServerParent::FlyWebPublishedServerParent(%p)", this);
-
- RefPtr<FlyWebService> service = FlyWebService::GetOrCreate();
- if (!service) {
- Unused << SendServerReady(NS_ERROR_FAILURE);
- return;
- }
-
- RefPtr<FlyWebPublishPromise> mozPromise =
- service->PublishServer(aName, aOptions, nullptr);
- if (!mozPromise) {
- Unused << SendServerReady(NS_ERROR_FAILURE);
- return;
- }
-
- RefPtr<FlyWebPublishedServerParent> self = this;
-
- mozPromise->Then(
- AbstractThread::MainThread(),
- __func__,
- [this, self] (FlyWebPublishedServer* aServer) {
- mPublishedServer = static_cast<FlyWebPublishedServerImpl*>(aServer);
- if (mActorDestroyed) {
- mPublishedServer->Close();
- return;
- }
-
- mPublishedServer->AddEventListener(NS_LITERAL_STRING("fetch"),
- this, false, false, 2);
- mPublishedServer->AddEventListener(NS_LITERAL_STRING("websocket"),
- this, false, false, 2);
- mPublishedServer->AddEventListener(NS_LITERAL_STRING("close"),
- this, false, false, 2);
- Unused << SendServerReady(NS_OK);
- },
- [this, self] (nsresult aStatus) {
- MOZ_ASSERT(NS_FAILED(aStatus));
- if (!mActorDestroyed) {
- Unused << SendServerReady(aStatus);
- }
- });
-}
-
-NS_IMETHODIMP
-FlyWebPublishedServerParent::HandleEvent(nsIDOMEvent* aEvent)
-{
- if (mActorDestroyed) {
- return NS_OK;
- }
-
- nsAutoString type;
- aEvent->GetType(type);
- if (type.EqualsLiteral("close")) {
- Unused << SendServerClose();
- return NS_OK;
- }
-
- if (type.EqualsLiteral("fetch")) {
- RefPtr<InternalRequest> request =
- static_cast<FlyWebFetchEvent*>(aEvent)->Request()->GetInternalRequest();
- uint64_t id = mNextRequestId++;
- mPendingRequests.Put(id, request);
-
- IPCInternalRequest ipcReq;
- request->ToIPC(&ipcReq);
- Unused << SendFetchRequest(ipcReq, id);
- return NS_OK;
- }
-
- if (type.EqualsLiteral("websocket")) {
- RefPtr<InternalRequest> request =
- static_cast<FlyWebWebSocketEvent*>(aEvent)->Request()->GetInternalRequest();
- uint64_t id = mNextRequestId++;
- mPendingRequests.Put(id, request);
-
- nsTArray<PNeckoParent*> neckoParents;
- Manager()->ManagedPNeckoParent(neckoParents);
- if (neckoParents.Length() != 1) {
- MOZ_CRASH("Expected exactly 1 PNeckoParent instance per PNeckoChild");
- }
-
- RefPtr<TransportProviderParent> provider =
- static_cast<TransportProviderParent*>(
- neckoParents[0]->SendPTransportProviderConstructor());
-
- IPCInternalRequest ipcReq;
- request->ToIPC(&ipcReq);
- Unused << SendWebSocketRequest(ipcReq, id, provider);
-
- mPendingTransportProviders.Put(id, provider.forget());
- return NS_OK;
- }
-
- MOZ_CRASH("Unknown event type");
-
- return NS_OK;
-}
-
-bool
-FlyWebPublishedServerParent::RecvFetchResponse(const IPCInternalResponse& aResponse,
- const uint64_t& aRequestId)
-{
- MOZ_ASSERT(!mActorDestroyed);
-
- RefPtr<InternalRequest> request;
- mPendingRequests.Remove(aRequestId, getter_AddRefs(request));
- if (!request) {
- static_cast<ContentParent*>(Manager())->KillHard("unknown request id");
- return false;
- }
-
- RefPtr<InternalResponse> response = InternalResponse::FromIPC(aResponse);
-
- mPublishedServer->OnFetchResponse(request, response);
-
- return true;
-}
-
-bool
-FlyWebPublishedServerParent::RecvWebSocketResponse(const IPCInternalResponse& aResponse,
- const uint64_t& aRequestId)
-{
- MOZ_ASSERT(!mActorDestroyed);
-
- mPendingTransportProviders.Remove(aRequestId);
-
- RefPtr<InternalRequest> request;
- mPendingRequests.Remove(aRequestId, getter_AddRefs(request));
- if (!request) {
- static_cast<ContentParent*>(Manager())->KillHard("unknown websocket request id");
- return false;
- }
-
- RefPtr<InternalResponse> response = InternalResponse::FromIPC(aResponse);
-
- mPublishedServer->OnWebSocketResponse(request, response);
-
- return true;
-}
-
-bool
-FlyWebPublishedServerParent::RecvWebSocketAccept(const nsString& aProtocol,
- const uint64_t& aRequestId)
-{
- MOZ_ASSERT(!mActorDestroyed);
-
- RefPtr<TransportProviderParent> providerIPC;
- mPendingTransportProviders.Remove(aRequestId, getter_AddRefs(providerIPC));
-
- RefPtr<InternalRequest> request;
- mPendingRequests.Remove(aRequestId, getter_AddRefs(request));
-
- if (!request || !providerIPC) {
- static_cast<ContentParent*>(Manager())->KillHard("unknown websocket request id");
- return false;
- }
-
- Optional<nsAString> protocol;
- if (!aProtocol.IsVoid()) {
- protocol = &aProtocol;
- }
-
- ErrorResult result;
- nsCOMPtr<nsITransportProvider> providerServer =
- mPublishedServer->OnWebSocketAcceptInternal(request, protocol, result);
- if (result.Failed()) {
- return false;
- }
-
- providerServer->SetListener(providerIPC);
-
- return true;
-}
-
-void
-FlyWebPublishedServerParent::ActorDestroy(ActorDestroyReason aWhy)
-{
- LOG_I("FlyWebPublishedServerParent::ActorDestroy(%p)", this);
-
- mActorDestroyed = true;
-}
-
-bool
-FlyWebPublishedServerParent::Recv__delete__()
-{
- LOG_I("FlyWebPublishedServerParent::Recv__delete__(%p)", this);
- MOZ_ASSERT(!mActorDestroyed);
-
- if (mPublishedServer) {
- mPublishedServer->RemoveEventListener(NS_LITERAL_STRING("fetch"),
- this, false);
- mPublishedServer->RemoveEventListener(NS_LITERAL_STRING("websocket"),
- this, false);
- mPublishedServer->RemoveEventListener(NS_LITERAL_STRING("close"),
- this, false);
- mPublishedServer->Close();
- mPublishedServer = nullptr;
- }
- return true;
-}
-
-} // namespace dom
-} // namespace mozilla
-
-
diff --git a/dom/flyweb/FlyWebPublishedServer.h b/dom/flyweb/FlyWebPublishedServer.h
deleted file mode 100644
index ec3a685ec..000000000
--- a/dom/flyweb/FlyWebPublishedServer.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_FlyWebPublishedServer_h
-#define mozilla_dom_FlyWebPublishedServer_h
-
-#include "mozilla/DOMEventTargetHelper.h"
-#include "mozilla/MozPromise.h"
-
-class nsPIDOMWindowInner;
-class nsITransportProvider;
-
-namespace mozilla {
-
-class ErrorResult;
-
-namespace dom {
-
-class InternalResponse;
-class InternalRequest;
-class WebSocket;
-struct FlyWebPublishOptions;
-class FlyWebPublishedServer;
-
-typedef MozPromise<RefPtr<FlyWebPublishedServer>, nsresult, false>
- FlyWebPublishPromise;
-
-class FlyWebPublishedServer : public mozilla::DOMEventTargetHelper
-{
-public:
- FlyWebPublishedServer(nsPIDOMWindowInner* aOwner,
- const nsAString& aName,
- const FlyWebPublishOptions& aOptions);
-
- virtual void LastRelease() override;
-
- virtual JSObject* WrapObject(JSContext *cx, JS::Handle<JSObject*> aGivenProto) override;
-
- uint64_t OwnerWindowID() const {
- return mOwnerWindowID;
- }
-
- void GetName(nsAString& aName)
- {
- aName = mName;
- }
- nsAString& Name()
- {
- return mName;
- }
-
- void GetUiUrl(nsAString& aUiUrl)
- {
- aUiUrl = mUiUrl;
- }
-
- virtual void PermissionGranted(bool aGranted) = 0;
-
- virtual void OnFetchResponse(InternalRequest* aRequest,
- InternalResponse* aResponse) = 0;
- already_AddRefed<WebSocket>
- OnWebSocketAccept(InternalRequest* aConnectRequest,
- const Optional<nsAString>& aProtocol,
- ErrorResult& aRv);
- virtual void OnWebSocketResponse(InternalRequest* aConnectRequest,
- InternalResponse* aResponse) = 0;
- virtual already_AddRefed<nsITransportProvider>
- OnWebSocketAcceptInternal(InternalRequest* aConnectRequest,
- const Optional<nsAString>& aProtocol,
- ErrorResult& aRv) = 0;
-
- virtual void Close();
-
- void FireFetchEvent(InternalRequest* aRequest);
- void FireWebsocketEvent(InternalRequest* aConnectRequest);
- void PublishedServerStarted(nsresult aStatus);
-
- IMPL_EVENT_HANDLER(fetch)
- IMPL_EVENT_HANDLER(websocket)
- IMPL_EVENT_HANDLER(close)
-
- already_AddRefed<FlyWebPublishPromise>
- GetPublishPromise()
- {
- return mPublishPromise.Ensure(__func__);
- }
-
-protected:
- virtual ~FlyWebPublishedServer()
- {
- MOZ_ASSERT(!mIsRegistered, "Subclass dtor forgot to call Close()");
- }
-
- uint64_t mOwnerWindowID;
- MozPromiseHolder<FlyWebPublishPromise> mPublishPromise;
-
- nsString mName;
- nsString mUiUrl;
-
- bool mIsRegistered;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_FlyWebPublishedServer_h
diff --git a/dom/flyweb/FlyWebPublishedServerIPC.h b/dom/flyweb/FlyWebPublishedServerIPC.h
deleted file mode 100644
index 942c7847e..000000000
--- a/dom/flyweb/FlyWebPublishedServerIPC.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_FlyWebPublishedServerIPC_h
-#define mozilla_dom_FlyWebPublishedServerIPC_h
-
-#include "HttpServer.h"
-#include "mozilla/dom/FlyWebPublishedServer.h"
-#include "mozilla/dom/PFlyWebPublishedServerParent.h"
-#include "mozilla/dom/PFlyWebPublishedServerChild.h"
-#include "mozilla/MozPromise.h"
-#include "nsICancelable.h"
-#include "nsIDOMEventListener.h"
-#include "nsISupportsImpl.h"
-
-class nsPIDOMWindowInner;
-
-namespace mozilla {
-namespace net {
-class TransportProviderParent;
-class TransportProviderChild;
-}
-
-namespace dom {
-
-class FlyWebPublishedServerParent;
-
-class FlyWebPublishedServerImpl final : public FlyWebPublishedServer
- , public HttpServerListener
-{
-public:
- FlyWebPublishedServerImpl(nsPIDOMWindowInner* aOwner,
- const nsAString& aName,
- const FlyWebPublishOptions& aOptions);
-
- NS_DECL_ISUPPORTS_INHERITED
-
- int32_t Port()
- {
- return mHttpServer ? mHttpServer->GetPort() : 0;
- }
- void GetCertKey(nsACString& aKey) {
- if (mHttpServer) {
- mHttpServer->GetCertKey(aKey);
- } else {
- aKey.Truncate();
- }
- }
-
- virtual void PermissionGranted(bool aGranted) override;
- virtual void OnFetchResponse(InternalRequest* aRequest,
- InternalResponse* aResponse) override;
- virtual void OnWebSocketResponse(InternalRequest* aConnectRequest,
- InternalResponse* aResponse) override;
- virtual already_AddRefed<nsITransportProvider>
- OnWebSocketAcceptInternal(InternalRequest* aConnectRequest,
- const Optional<nsAString>& aProtocol,
- ErrorResult& aRv) override;
-
- void SetCancelRegister(nsICancelable* aCancelRegister)
- {
- mMDNSCancelRegister = aCancelRegister;
- }
-
- virtual void Close() override;
-
- // HttpServerListener
- virtual void OnServerStarted(nsresult aStatus) override;
- virtual void OnRequest(InternalRequest* aRequest) override
- {
- FireFetchEvent(aRequest);
- }
- virtual void OnWebSocket(InternalRequest* aConnectRequest) override
- {
- FireWebsocketEvent(aConnectRequest);
- }
- virtual void OnServerClose() override
- {
- mHttpServer = nullptr;
- Close();
- }
-
-private:
- ~FlyWebPublishedServerImpl() {}
-
- RefPtr<HttpServer> mHttpServer;
- nsCOMPtr<nsICancelable> mMDNSCancelRegister;
- RefPtr<FlyWebPublishedServerParent> mServerParent;
-};
-
-class FlyWebPublishedServerChild final : public FlyWebPublishedServer
- , public PFlyWebPublishedServerChild
-{
-public:
- FlyWebPublishedServerChild(nsPIDOMWindowInner* aOwner,
- const nsAString& aName,
- const FlyWebPublishOptions& aOptions);
-
- virtual void PermissionGranted(bool aGranted) override;
- virtual bool RecvServerReady(const nsresult& aStatus) override;
- virtual bool RecvServerClose() override;
- virtual bool RecvFetchRequest(const IPCInternalRequest& aRequest,
- const uint64_t& aRequestId) override;
- virtual bool RecvWebSocketRequest(const IPCInternalRequest& aRequest,
- const uint64_t& aRequestId,
- PTransportProviderChild* aProvider) override;
-
- virtual void OnFetchResponse(InternalRequest* aRequest,
- InternalResponse* aResponse) override;
- virtual void OnWebSocketResponse(InternalRequest* aConnectRequest,
- InternalResponse* aResponse) override;
- virtual already_AddRefed<nsITransportProvider>
- OnWebSocketAcceptInternal(InternalRequest* aConnectRequest,
- const Optional<nsAString>& aProtocol,
- ErrorResult& aRv) override;
-
- virtual void Close() override;
-
- virtual void ActorDestroy(ActorDestroyReason aWhy) override;
-
-private:
- ~FlyWebPublishedServerChild() {}
-
- nsDataHashtable<nsRefPtrHashKey<InternalRequest>, uint64_t> mPendingRequests;
- nsRefPtrHashtable<nsUint64HashKey, TransportProviderChild>
- mPendingTransportProviders;
- bool mActorExists;
-};
-
-class FlyWebPublishedServerParent final : public PFlyWebPublishedServerParent
- , public nsIDOMEventListener
-{
-public:
- FlyWebPublishedServerParent(const nsAString& aName,
- const FlyWebPublishOptions& aOptions);
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSIDOMEVENTLISTENER
-
-private:
- virtual void
- ActorDestroy(ActorDestroyReason aWhy) override;
-
- virtual bool
- Recv__delete__() override;
- virtual bool
- RecvFetchResponse(const IPCInternalResponse& aResponse,
- const uint64_t& aRequestId) override;
- virtual bool
- RecvWebSocketResponse(const IPCInternalResponse& aResponse,
- const uint64_t& aRequestId) override;
- virtual bool
- RecvWebSocketAccept(const nsString& aProtocol,
- const uint64_t& aRequestId) override;
-
- ~FlyWebPublishedServerParent() {}
-
- bool mActorDestroyed;
- uint64_t mNextRequestId;
- nsRefPtrHashtable<nsUint64HashKey, InternalRequest> mPendingRequests;
- nsRefPtrHashtable<nsUint64HashKey, TransportProviderParent>
- mPendingTransportProviders;
- RefPtr<FlyWebPublishedServerImpl> mPublishedServer;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_FlyWebPublishedServerIPC_h
diff --git a/dom/flyweb/FlyWebServerEvents.cpp b/dom/flyweb/FlyWebServerEvents.cpp
deleted file mode 100644
index fe774ffb0..000000000
--- a/dom/flyweb/FlyWebServerEvents.cpp
+++ /dev/null
@@ -1,141 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/EventBinding.h"
-#include "mozilla/dom/FlyWebFetchEventBinding.h"
-#include "mozilla/dom/FlyWebPublishedServer.h"
-#include "mozilla/dom/FlyWebServerEvents.h"
-#include "mozilla/dom/FlyWebWebSocketEventBinding.h"
-#include "mozilla/dom/Nullable.h"
-#include "mozilla/dom/Promise.h"
-#include "mozilla/dom/Response.h"
-
-#include "js/GCAPI.h"
-
-namespace mozilla {
-namespace dom {
-
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(FlyWebFetchEvent)
-
-NS_IMPL_ADDREF_INHERITED(FlyWebFetchEvent, Event)
-NS_IMPL_RELEASE_INHERITED(FlyWebFetchEvent, Event)
-
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(FlyWebFetchEvent, Event)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mRequest)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(FlyWebFetchEvent, Event)
-NS_IMPL_CYCLE_COLLECTION_TRACE_END
-
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(FlyWebFetchEvent, Event)
- NS_IMPL_CYCLE_COLLECTION_UNLINK(mRequest)
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(FlyWebFetchEvent)
-NS_INTERFACE_MAP_END_INHERITING(Event)
-
-FlyWebFetchEvent::FlyWebFetchEvent(FlyWebPublishedServer* aServer,
- class Request* aRequest,
- InternalRequest* aInternalRequest)
- : Event(aServer, nullptr, nullptr)
- , mRequest(aRequest)
- , mInternalRequest(aInternalRequest)
- , mServer(aServer)
- , mResponded(false)
-{
- MOZ_ASSERT(aServer);
- MOZ_ASSERT(aRequest);
- MOZ_ASSERT(aInternalRequest);
-}
-
-FlyWebFetchEvent::~FlyWebFetchEvent()
-{
-}
-
-JSObject*
-FlyWebFetchEvent::WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
- return FlyWebFetchEventBinding::Wrap(aCx, this, aGivenProto);
-}
-
-void
-FlyWebFetchEvent::RespondWith(Promise& aArg, ErrorResult& aRv)
-{
- if (mResponded) {
- aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
- return;
- }
-
- mResponded = true;
-
- aArg.AppendNativeHandler(this);
-}
-
-void
-FlyWebFetchEvent::ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue)
-{
- RefPtr<Response> response;
- if (aValue.isObject()) {
- UNWRAP_OBJECT(Response, &aValue.toObject(), response);
- }
-
- RefPtr<InternalResponse> intResponse;
- if (response && response->Type() != ResponseType::Opaque) {
- intResponse = response->GetInternalResponse();
- }
-
- if (!intResponse) {
- intResponse = InternalResponse::NetworkError();
- }
-
- NotifyServer(intResponse);
-}
-
-void
-FlyWebFetchEvent::NotifyServer(InternalResponse* aResponse)
-{
- mServer->OnFetchResponse(mInternalRequest, aResponse);
-}
-
-void
-FlyWebFetchEvent::RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue)
-{
- RefPtr<InternalResponse> err = InternalResponse::NetworkError();
-
- NotifyServer(err);
-}
-
-JSObject*
-FlyWebWebSocketEvent::WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
- return FlyWebWebSocketEventBinding::Wrap(aCx, this, aGivenProto);
-}
-
-already_AddRefed<WebSocket>
-FlyWebWebSocketEvent::Accept(const Optional<nsAString>& aProtocol,
- ErrorResult& aRv)
-{
- if (mResponded) {
- aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
- return nullptr;
- }
-
- mResponded = true;
-
- return mServer->OnWebSocketAccept(mInternalRequest, aProtocol, aRv);
-}
-
-
-void
-FlyWebWebSocketEvent::NotifyServer(InternalResponse* aResponse)
-{
- mServer->OnWebSocketResponse(mInternalRequest, aResponse);
-}
-
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/flyweb/FlyWebServerEvents.h b/dom/flyweb/FlyWebServerEvents.h
deleted file mode 100644
index f00e86018..000000000
--- a/dom/flyweb/FlyWebServerEvents.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_FlyWebFetchEvent_h
-#define mozilla_dom_FlyWebFetchEvent_h
-
-#include "mozilla/Attributes.h"
-#include "mozilla/ErrorResult.h"
-#include "mozilla/dom/BindingUtils.h"
-#include "mozilla/dom/Event.h"
-#include "mozilla/dom/FlyWebFetchEventBinding.h"
-#include "mozilla/dom/PromiseNativeHandler.h"
-#include "mozilla/dom/WebSocket.h"
-
-struct JSContext;
-namespace mozilla {
-namespace dom {
-
-class Request;
-class Response;
-class FlyWebPublishedServer;
-class InternalRequest;
-class InternalResponse;
-
-class FlyWebFetchEvent : public Event
- , public PromiseNativeHandler
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_INHERITED(FlyWebFetchEvent, Event)
-
- virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
-
- virtual void
- ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override;
- virtual void
- RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override;
-
- class Request* Request() const
- {
- return mRequest;
- }
-
- void RespondWith(Promise& aArg, ErrorResult& aRv);
-
- FlyWebFetchEvent(FlyWebPublishedServer* aServer,
- class Request* aRequest,
- InternalRequest* aInternalRequest);
-
-protected:
- virtual ~FlyWebFetchEvent();
-
- virtual void NotifyServer(InternalResponse* aResponse);
-
- RefPtr<class Request> mRequest;
- RefPtr<InternalRequest> mInternalRequest;
- RefPtr<FlyWebPublishedServer> mServer;
-
- bool mResponded;
-};
-
-class FlyWebWebSocketEvent final : public FlyWebFetchEvent
-{
-public:
- FlyWebWebSocketEvent(FlyWebPublishedServer* aServer,
- class Request* aRequest,
- InternalRequest* aInternalRequest)
- : FlyWebFetchEvent(aServer, aRequest, aInternalRequest)
- {}
-
- virtual JSObject* WrapObjectInternal(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
-
- already_AddRefed<WebSocket> Accept(const Optional<nsAString>& aProtocol,
- ErrorResult& aRv);
-
-private:
- ~FlyWebWebSocketEvent() {};
-
- virtual void NotifyServer(InternalResponse* aResponse) override;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_FlyWebFetchEvent_h
diff --git a/dom/flyweb/FlyWebService.cpp b/dom/flyweb/FlyWebService.cpp
deleted file mode 100644
index 5f3b0d66f..000000000
--- a/dom/flyweb/FlyWebService.cpp
+++ /dev/null
@@ -1,1310 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/FlyWebService.h"
-#include "mozilla/ClearOnShutdown.h"
-#include "mozilla/StaticPtr.h"
-#include "mozilla/ScopeExit.h"
-#include "mozilla/dom/Promise.h"
-#include "mozilla/dom/FlyWebPublishedServerIPC.h"
-#include "mozilla/AddonPathService.h"
-#include "nsISocketTransportService.h"
-#include "mdns/libmdns/nsDNSServiceInfo.h"
-#include "nsIUUIDGenerator.h"
-#include "nsStandardURL.h"
-#include "mozilla/Services.h"
-#include "nsISupportsPrimitives.h"
-#include "mozilla/dom/FlyWebDiscoveryManagerBinding.h"
-#include "prnetdb.h"
-#include "DNS.h"
-#include "nsContentPermissionHelper.h"
-#include "nsSocketTransportService2.h"
-#include "nsSocketTransport2.h"
-#include "nsHashPropertyBag.h"
-#include "nsNetUtil.h"
-#include "nsISimpleEnumerator.h"
-#include "nsIProperty.h"
-#include "nsICertOverrideService.h"
-
-namespace mozilla {
-namespace dom {
-
-struct FlyWebPublishOptions;
-
-static LazyLogModule gFlyWebServiceLog("FlyWebService");
-#undef LOG_I
-#define LOG_I(...) MOZ_LOG(mozilla::dom::gFlyWebServiceLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
-
-#undef LOG_E
-#define LOG_E(...) MOZ_LOG(mozilla::dom::gFlyWebServiceLog, mozilla::LogLevel::Error, (__VA_ARGS__))
-
-#undef LOG_TEST_I
-#define LOG_TEST_I(...) MOZ_LOG_TEST(mozilla::dom::gFlyWebServiceLog, mozilla::LogLevel::Debug)
-
-class FlyWebPublishServerPermissionCheck final
- : public nsIContentPermissionRequest
- , public nsIRunnable
-{
-public:
- NS_DECL_ISUPPORTS
-
- FlyWebPublishServerPermissionCheck(const nsCString& aServiceName, uint64_t aWindowID,
- FlyWebPublishedServer* aServer)
- : mServiceName(aServiceName)
- , mWindowID(aWindowID)
- , mServer(aServer)
- {}
-
- uint64_t WindowID() const
- {
- return mWindowID;
- }
-
- NS_IMETHOD Run() override
- {
- MOZ_ASSERT(NS_IsMainThread());
-
- nsGlobalWindow* globalWindow = nsGlobalWindow::GetInnerWindowWithId(mWindowID);
- if (!globalWindow) {
- return Cancel();
- }
- mWindow = globalWindow->AsInner();
- if (NS_WARN_IF(!mWindow)) {
- return Cancel();
- }
-
- nsCOMPtr<nsIDocument> doc = mWindow->GetDoc();
- if (NS_WARN_IF(!doc)) {
- return Cancel();
- }
-
- mPrincipal = doc->NodePrincipal();
- MOZ_ASSERT(mPrincipal);
-
- mRequester = new nsContentPermissionRequester(mWindow);
- return nsContentPermissionUtils::AskPermission(this, mWindow);
- }
-
- NS_IMETHOD Cancel() override
- {
- Resolve(false);
- return NS_OK;
- }
-
- NS_IMETHOD Allow(JS::HandleValue aChoices) override
- {
- MOZ_ASSERT(aChoices.isUndefined());
- Resolve(true);
- return NS_OK;
- }
-
- NS_IMETHOD GetTypes(nsIArray** aTypes) override
- {
- nsTArray<nsString> emptyOptions;
- return nsContentPermissionUtils::CreatePermissionArray(NS_LITERAL_CSTRING("flyweb-publish-server"),
- NS_LITERAL_CSTRING("unused"), emptyOptions, aTypes);
- }
-
- NS_IMETHOD GetRequester(nsIContentPermissionRequester** aRequester) override
- {
- NS_ENSURE_ARG_POINTER(aRequester);
- nsCOMPtr<nsIContentPermissionRequester> requester = mRequester;
- requester.forget(aRequester);
- return NS_OK;
- }
-
- NS_IMETHOD GetPrincipal(nsIPrincipal** aRequestingPrincipal) override
- {
- NS_IF_ADDREF(*aRequestingPrincipal = mPrincipal);
- return NS_OK;
- }
-
- NS_IMETHOD GetWindow(mozIDOMWindow** aRequestingWindow) override
- {
- NS_IF_ADDREF(*aRequestingWindow = mWindow);
- return NS_OK;
- }
-
- NS_IMETHOD GetElement(nsIDOMElement** aRequestingElement) override
- {
- *aRequestingElement = nullptr;
- return NS_OK;
- }
-
-private:
- void Resolve(bool aResolve)
- {
- mServer->PermissionGranted(aResolve);
- }
-
- virtual ~FlyWebPublishServerPermissionCheck() = default;
-
- nsCString mServiceName;
- uint64_t mWindowID;
- RefPtr<FlyWebPublishedServer> mServer;
- nsCOMPtr<nsPIDOMWindowInner> mWindow;
- nsCOMPtr<nsIPrincipal> mPrincipal;
- nsCOMPtr<nsIContentPermissionRequester> mRequester;
-};
-
-NS_IMPL_ISUPPORTS(FlyWebPublishServerPermissionCheck,
- nsIContentPermissionRequest,
- nsIRunnable)
-
-class FlyWebMDNSService final
- : public nsIDNSServiceDiscoveryListener
- , public nsIDNSServiceResolveListener
- , public nsIDNSRegistrationListener
- , public nsITimerCallback
-{
- friend class FlyWebService;
-
-private:
- enum DiscoveryState {
- DISCOVERY_IDLE,
- DISCOVERY_STARTING,
- DISCOVERY_RUNNING,
- DISCOVERY_STOPPING
- };
-
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIDNSSERVICEDISCOVERYLISTENER
- NS_DECL_NSIDNSSERVICERESOLVELISTENER
- NS_DECL_NSIDNSREGISTRATIONLISTENER
- NS_DECL_NSITIMERCALLBACK
-
- explicit FlyWebMDNSService(FlyWebService* aService,
- const nsACString& aServiceType);
-
-private:
- virtual ~FlyWebMDNSService() = default;
-
- nsresult Init();
- nsresult StartDiscovery();
- nsresult StopDiscovery();
-
- void ListDiscoveredServices(nsTArray<FlyWebDiscoveredService>& aServices);
- bool HasService(const nsAString& aServiceId);
- nsresult PairWithService(const nsAString& aServiceId,
- UniquePtr<FlyWebService::PairedInfo>& aInfo);
-
- nsresult StartDiscoveryOf(FlyWebPublishedServerImpl* aServer);
-
- void EnsureDiscoveryStarted();
- void EnsureDiscoveryStopped();
-
- // Cycle-breaking link to manager.
- FlyWebService* mService;
- nsCString mServiceType;
-
- // Indicates the desired state of the system. If mDiscoveryActive is true,
- // it indicates that backend discovery "should be happening", and discovery
- // events should be forwarded to listeners.
- // If false, the backend discovery "should be idle", and any discovery events
- // that show up should not be forwarded to listeners.
- bool mDiscoveryActive;
-
- uint32_t mNumConsecutiveStartDiscoveryFailures;
-
- // Represents the internal discovery state as it relates to nsDNSServiceDiscovery.
- // When mDiscoveryActive is true, this state will periodically loop from
- // (IDLE => STARTING => RUNNING => STOPPING => IDLE).
- DiscoveryState mDiscoveryState;
-
- nsCOMPtr<nsITimer> mDiscoveryStartTimer;
- nsCOMPtr<nsITimer> mDiscoveryStopTimer;
- nsCOMPtr<nsIDNSServiceDiscovery> mDNSServiceDiscovery;
- nsCOMPtr<nsICancelable> mCancelDiscovery;
- nsTHashtable<nsStringHashKey> mNewServiceSet;
-
- struct DiscoveredInfo
- {
- explicit DiscoveredInfo(nsIDNSServiceInfo* aDNSServiceInfo);
- FlyWebDiscoveredService mService;
- nsCOMPtr<nsIDNSServiceInfo> mDNSServiceInfo;
- };
- nsClassHashtable<nsStringHashKey, DiscoveredInfo> mServiceMap;
-};
-
-void
-LogDNSInfo(nsIDNSServiceInfo* aServiceInfo, const char* aFunc)
-{
- if (!LOG_TEST_I()) {
- return;
- }
-
- nsCString tmp;
- aServiceInfo->GetServiceName(tmp);
- LOG_I("%s: serviceName=%s", aFunc, tmp.get());
-
- aServiceInfo->GetHost(tmp);
- LOG_I("%s: host=%s", aFunc, tmp.get());
-
- aServiceInfo->GetAddress(tmp);
- LOG_I("%s: address=%s", aFunc, tmp.get());
-
- uint16_t port = -2;
- aServiceInfo->GetPort(&port);
- LOG_I("%s: port=%d", aFunc, (int)port);
-
- nsCOMPtr<nsIPropertyBag2> attributes;
- aServiceInfo->GetAttributes(getter_AddRefs(attributes));
- if (!attributes) {
- LOG_I("%s: no attributes", aFunc);
- } else {
- nsCOMPtr<nsISimpleEnumerator> enumerator;
- attributes->GetEnumerator(getter_AddRefs(enumerator));
- MOZ_ASSERT(enumerator);
-
- LOG_I("%s: attributes start", aFunc);
-
- bool hasMoreElements;
- while (NS_SUCCEEDED(enumerator->HasMoreElements(&hasMoreElements)) &&
- hasMoreElements) {
- nsCOMPtr<nsISupports> element;
- MOZ_ALWAYS_SUCCEEDS(enumerator->GetNext(getter_AddRefs(element)));
- nsCOMPtr<nsIProperty> property = do_QueryInterface(element);
- MOZ_ASSERT(property);
-
- nsAutoString name;
- nsCOMPtr<nsIVariant> value;
- MOZ_ALWAYS_SUCCEEDS(property->GetName(name));
- MOZ_ALWAYS_SUCCEEDS(property->GetValue(getter_AddRefs(value)));
-
- nsAutoCString str;
- nsresult rv = value->GetAsACString(str);
- if (NS_SUCCEEDED(rv)) {
- LOG_I("%s: attribute name=%s value=%s", aFunc,
- NS_ConvertUTF16toUTF8(name).get(), str.get());
- } else {
- uint16_t type;
- MOZ_ALWAYS_SUCCEEDS(value->GetDataType(&type));
- LOG_I("%s: attribute *unstringifiable* name=%s type=%d", aFunc,
- NS_ConvertUTF16toUTF8(name).get(), (int)type);
- }
- }
-
- LOG_I("%s: attributes end", aFunc);
- }
-}
-
-NS_IMPL_ISUPPORTS(FlyWebMDNSService,
- nsIDNSServiceDiscoveryListener,
- nsIDNSServiceResolveListener,
- nsIDNSRegistrationListener,
- nsITimerCallback)
-
-FlyWebMDNSService::FlyWebMDNSService(
- FlyWebService* aService,
- const nsACString& aServiceType)
- : mService(aService)
- , mServiceType(aServiceType)
- , mDiscoveryActive(false)
- , mNumConsecutiveStartDiscoveryFailures(0)
- , mDiscoveryState(DISCOVERY_IDLE)
-{}
-
-nsresult
-FlyWebMDNSService::OnDiscoveryStarted(const nsACString& aServiceType)
-{
- MOZ_ASSERT(mDiscoveryState == DISCOVERY_STARTING);
- mDiscoveryState = DISCOVERY_RUNNING;
- // Reset consecutive start discovery failures.
- mNumConsecutiveStartDiscoveryFailures = 0;
- LOG_I("===========================================");
- LOG_I("MDNSService::OnDiscoveryStarted(%s)", PromiseFlatCString(aServiceType).get());
- LOG_I("===========================================");
-
- // Clear the new service array.
- mNewServiceSet.Clear();
-
- // If service discovery is inactive, then stop network discovery immediately.
- if (!mDiscoveryActive) {
- // Set the stop timer to fire immediately.
- Unused << NS_WARN_IF(NS_FAILED(mDiscoveryStopTimer->InitWithCallback(this, 0, nsITimer::TYPE_ONE_SHOT)));
- return NS_OK;
- }
-
- // Otherwise, set the stop timer to fire in 5 seconds.
- Unused << NS_WARN_IF(NS_FAILED(mDiscoveryStopTimer->InitWithCallback(this, 5 * 1000, nsITimer::TYPE_ONE_SHOT)));
-
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::OnDiscoveryStopped(const nsACString& aServiceType)
-{
- LOG_I("///////////////////////////////////////////");
- LOG_I("MDNSService::OnDiscoveryStopped(%s)", PromiseFlatCString(aServiceType).get());
- LOG_I("///////////////////////////////////////////");
- MOZ_ASSERT(mDiscoveryState == DISCOVERY_STOPPING);
- mDiscoveryState = DISCOVERY_IDLE;
-
- // If service discovery is inactive, then discard all results and do not proceed.
- if (!mDiscoveryActive) {
- mServiceMap.Clear();
- mNewServiceSet.Clear();
- return NS_OK;
- }
-
- // Process the service map, add to the pair map.
- for (auto iter = mServiceMap.Iter(); !iter.Done(); iter.Next()) {
- DiscoveredInfo* service = iter.UserData();
-
- if (!mNewServiceSet.Contains(service->mService.mServiceId)) {
- iter.Remove();
- }
- }
-
- // Notify FlyWebService of changed service list.
- mService->NotifyDiscoveredServicesChanged();
-
- // Start discovery again immediately.
- Unused << NS_WARN_IF(NS_FAILED(mDiscoveryStartTimer->InitWithCallback(this, 0, nsITimer::TYPE_ONE_SHOT)));
-
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::OnServiceFound(nsIDNSServiceInfo* aServiceInfo)
-{
- LogDNSInfo(aServiceInfo, "FlyWebMDNSService::OnServiceFound");
-
- // If discovery is not active, don't do anything with the result.
- // If there is no discovery underway, ignore this.
- if (!mDiscoveryActive || mDiscoveryState != DISCOVERY_RUNNING) {
- return NS_OK;
- }
-
- // Discovery is underway - resolve the service.
- nsresult rv = mDNSServiceDiscovery->ResolveService(aServiceInfo, this);
- NS_ENSURE_SUCCESS(rv, rv);
-
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::OnServiceLost(nsIDNSServiceInfo* aServiceInfo)
-{
- LogDNSInfo(aServiceInfo, "FlyWebMDNSService::OnServiceLost");
-
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::OnStartDiscoveryFailed(const nsACString& aServiceType, int32_t aErrorCode)
-{
- LOG_E("MDNSService::OnStartDiscoveryFailed(%s): %d", PromiseFlatCString(aServiceType).get(), (int) aErrorCode);
-
- MOZ_ASSERT(mDiscoveryState == DISCOVERY_STARTING);
- mDiscoveryState = DISCOVERY_IDLE;
- mNumConsecutiveStartDiscoveryFailures++;
-
- // If discovery is active, and the number of consecutive failures is < 3, try starting again.
- if (mDiscoveryActive && mNumConsecutiveStartDiscoveryFailures < 3) {
- Unused << NS_WARN_IF(NS_FAILED(mDiscoveryStartTimer->InitWithCallback(this, 0, nsITimer::TYPE_ONE_SHOT)));
- }
-
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::OnStopDiscoveryFailed(const nsACString& aServiceType, int32_t aErrorCode)
-{
- LOG_E("MDNSService::OnStopDiscoveryFailed(%s)", PromiseFlatCString(aServiceType).get());
- MOZ_ASSERT(mDiscoveryState == DISCOVERY_STOPPING);
- mDiscoveryState = DISCOVERY_IDLE;
-
- // If discovery is active, start discovery again immediately.
- if (mDiscoveryActive) {
- Unused << NS_WARN_IF(NS_FAILED(mDiscoveryStartTimer->InitWithCallback(this, 0, nsITimer::TYPE_ONE_SHOT)));
- }
-
- return NS_OK;
-}
-
-static bool
-IsAcceptableServiceAddress(const nsCString& addr)
-{
- PRNetAddr prNetAddr;
- PRStatus status = PR_StringToNetAddr(addr.get(), &prNetAddr);
- if (status == PR_FAILURE) {
- return false;
- }
- // Only allow ipv4 addreses for now.
- return prNetAddr.raw.family == PR_AF_INET;
-}
-
-nsresult
-FlyWebMDNSService::OnServiceResolved(nsIDNSServiceInfo* aServiceInfo)
-{
- LogDNSInfo(aServiceInfo, "FlyWebMDNSService::OnServiceResolved");
-
- // If discovery is not active, don't do anything with the result.
- // If there is no discovery underway, ignore this resolve.
- if (!mDiscoveryActive || mDiscoveryState != DISCOVERY_RUNNING) {
- return NS_OK;
- }
-
- nsresult rv;
-
- nsCString address;
- rv = aServiceInfo->GetAddress(address);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- if (!IsAcceptableServiceAddress(address)) {
- return NS_OK;
- }
-
- // Create a new serviceInfo and stuff it in the new service array.
- UniquePtr<DiscoveredInfo> svc(new DiscoveredInfo(aServiceInfo));
- mNewServiceSet.PutEntry(svc->mService.mServiceId);
-
- DiscoveredInfo* existingSvc =
- mServiceMap.Get(svc->mService.mServiceId);
- if (existingSvc) {
- // Update the underlying DNS service info, but leave the old object in place.
- existingSvc->mDNSServiceInfo = aServiceInfo;
- } else {
- DiscoveredInfo* info = svc.release();
- mServiceMap.Put(info->mService.mServiceId, info);
- }
-
- // Notify FlyWebService of changed service list.
- mService->NotifyDiscoveredServicesChanged();
-
- return NS_OK;
-}
-
-FlyWebMDNSService::DiscoveredInfo::DiscoveredInfo(nsIDNSServiceInfo* aDNSServiceInfo)
- : mDNSServiceInfo(aDNSServiceInfo)
-{
- nsCString tmp;
- DebugOnly<nsresult> drv = aDNSServiceInfo->GetServiceName(tmp);
- MOZ_ASSERT(NS_SUCCEEDED(drv));
- CopyUTF8toUTF16(tmp, mService.mDisplayName);
-
- mService.mTransport = NS_LITERAL_STRING("mdns");
-
- drv = aDNSServiceInfo->GetServiceType(tmp);
- MOZ_ASSERT(NS_SUCCEEDED(drv));
- CopyUTF8toUTF16(tmp, mService.mServiceType);
-
- nsCOMPtr<nsIPropertyBag2> attrs;
- drv = aDNSServiceInfo->GetAttributes(getter_AddRefs(attrs));
- MOZ_ASSERT(NS_SUCCEEDED(drv));
- if (attrs) {
- attrs->GetPropertyAsAString(NS_LITERAL_STRING("cert"), mService.mCert);
- attrs->GetPropertyAsAString(NS_LITERAL_STRING("path"), mService.mPath);
- }
-
- // Construct a service id from the name, host, address, and port.
- nsCString cHost;
- drv = aDNSServiceInfo->GetHost(cHost);
- MOZ_ASSERT(NS_SUCCEEDED(drv));
-
- nsCString cAddress;
- drv = aDNSServiceInfo->GetAddress(cAddress);
- MOZ_ASSERT(NS_SUCCEEDED(drv));
-
- uint16_t port;
- drv = aDNSServiceInfo->GetPort(&port);
- MOZ_ASSERT(NS_SUCCEEDED(drv));
- nsAutoString portStr;
- portStr.AppendInt(port, 10);
-
- mService.mServiceId =
- NS_ConvertUTF8toUTF16(cAddress) +
- NS_LITERAL_STRING(":") +
- portStr +
- NS_LITERAL_STRING("|") +
- mService.mServiceType +
- NS_LITERAL_STRING("|") +
- NS_ConvertUTF8toUTF16(cHost) +
- NS_LITERAL_STRING("|") +
- mService.mDisplayName;
-}
-
-
-nsresult
-FlyWebMDNSService::OnResolveFailed(nsIDNSServiceInfo* aServiceInfo, int32_t aErrorCode)
-{
- LogDNSInfo(aServiceInfo, "FlyWebMDNSService::OnResolveFailed");
-
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::OnServiceRegistered(nsIDNSServiceInfo* aServiceInfo)
-{
- LogDNSInfo(aServiceInfo, "FlyWebMDNSService::OnServiceRegistered");
-
- nsCString cName;
- if (NS_WARN_IF(NS_FAILED(aServiceInfo->GetServiceName(cName)))) {
- return NS_ERROR_FAILURE;
- }
-
- nsString name = NS_ConvertUTF8toUTF16(cName);
- RefPtr<FlyWebPublishedServer> existingServer =
- FlyWebService::GetOrCreate()->FindPublishedServerByName(name);
- if (!existingServer) {
- return NS_ERROR_FAILURE;
- }
-
- existingServer->PublishedServerStarted(NS_OK);
-
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::OnServiceUnregistered(nsIDNSServiceInfo* aServiceInfo)
-{
- LogDNSInfo(aServiceInfo, "FlyWebMDNSService::OnServiceUnregistered");
-
- nsCString cName;
- if (NS_WARN_IF(NS_FAILED(aServiceInfo->GetServiceName(cName)))) {
- return NS_ERROR_FAILURE;
- }
-
- nsString name = NS_ConvertUTF8toUTF16(cName);
- RefPtr<FlyWebPublishedServer> existingServer =
- FlyWebService::GetOrCreate()->FindPublishedServerByName(name);
- if (!existingServer) {
- return NS_ERROR_FAILURE;
- }
-
- LOG_I("OnServiceRegistered(MDNS): De-advertised server with name %s.", cName.get());
-
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::OnRegistrationFailed(nsIDNSServiceInfo* aServiceInfo, int32_t errorCode)
-{
- LogDNSInfo(aServiceInfo, "FlyWebMDNSService::OnRegistrationFailed");
-
- nsCString cName;
- if (NS_WARN_IF(NS_FAILED(aServiceInfo->GetServiceName(cName)))) {
- return NS_ERROR_FAILURE;
- }
-
- nsString name = NS_ConvertUTF8toUTF16(cName);
- RefPtr<FlyWebPublishedServer> existingServer =
- FlyWebService::GetOrCreate()->FindPublishedServerByName(name);
- if (!existingServer) {
- return NS_ERROR_FAILURE;
- }
-
- LOG_I("OnServiceRegistered(MDNS): Registration of server with name %s failed.", cName.get());
-
- // Remove the nsICancelable from the published server.
- existingServer->PublishedServerStarted(NS_ERROR_FAILURE);
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::OnUnregistrationFailed(nsIDNSServiceInfo* aServiceInfo, int32_t errorCode)
-{
- LogDNSInfo(aServiceInfo, "FlyWebMDNSService::OnUnregistrationFailed");
-
- nsCString cName;
- if (NS_WARN_IF(NS_FAILED(aServiceInfo->GetServiceName(cName)))) {
- return NS_ERROR_FAILURE;
- }
-
- nsString name = NS_ConvertUTF8toUTF16(cName);
- RefPtr<FlyWebPublishedServer> existingServer =
- FlyWebService::GetOrCreate()->FindPublishedServerByName(name);
- if (!existingServer) {
- return NS_ERROR_FAILURE;
- }
-
- LOG_I("OnServiceRegistered(MDNS): Un-Advertisement of server with name %s failed.", cName.get());
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::Notify(nsITimer* timer)
-{
- if (timer == mDiscoveryStopTimer.get()) {
- LOG_I("MDNSService::Notify() got discovery stop timeout");
- // Internet discovery stop timer has fired.
- nsresult rv = StopDiscovery();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- return NS_OK;
- }
-
- if (timer == mDiscoveryStartTimer.get()) {
- LOG_I("MDNSService::Notify() got discovery start timeout");
- // Internet discovery start timer has fired.
- nsresult rv = StartDiscovery();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- return NS_OK;
- }
-
- LOG_E("MDNSService::Notify got unknown timeout.");
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::Init()
-{
- MOZ_ASSERT(mDiscoveryState == DISCOVERY_IDLE);
-
- mDiscoveryStartTimer = do_CreateInstance("@mozilla.org/timer;1");
- if (!mDiscoveryStartTimer) {
- return NS_ERROR_FAILURE;
- }
-
- mDiscoveryStopTimer = do_CreateInstance("@mozilla.org/timer;1");
- if (!mDiscoveryStopTimer) {
- return NS_ERROR_FAILURE;
- }
-
- nsresult rv;
- mDNSServiceDiscovery = do_GetService(DNSSERVICEDISCOVERY_CONTRACT_ID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::StartDiscovery()
-{
- nsresult rv;
-
- // Always cancel the timer.
- rv = mDiscoveryStartTimer->Cancel();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- LOG_E("FlyWeb failed to cancel DNS service discovery start timer.");
- }
-
- // If discovery is not idle, don't start it.
- if (mDiscoveryState != DISCOVERY_IDLE) {
- return NS_OK;
- }
-
- LOG_I("FlyWeb starting dicovery.");
- mDiscoveryState = DISCOVERY_STARTING;
-
- // start the discovery.
- rv = mDNSServiceDiscovery->StartDiscovery(mServiceType, this,
- getter_AddRefs(mCancelDiscovery));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- LOG_E("FlyWeb failed to start DNS service discovery.");
- return rv;
- }
-
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::StopDiscovery()
-{
- nsresult rv;
-
- // Always cancel the timer.
- rv = mDiscoveryStopTimer->Cancel();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- LOG_E("FlyWeb failed to cancel DNS service discovery stop timer.");
- }
-
- // If discovery is not running, do nothing.
- if (mDiscoveryState != DISCOVERY_RUNNING) {
- return NS_OK;
- }
-
- LOG_I("FlyWeb stopping dicovery.");
-
- // Mark service discovery as stopping.
- mDiscoveryState = DISCOVERY_STOPPING;
-
- if (mCancelDiscovery) {
- LOG_I("MDNSService::StopDiscovery() - mCancelDiscovery exists!");
- nsCOMPtr<nsICancelable> cancelDiscovery = mCancelDiscovery.forget();
- rv = cancelDiscovery->Cancel(NS_ERROR_ABORT);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- LOG_E("FlyWeb failed to cancel DNS stop service discovery.");
- }
- } else {
- LOG_I("MDNSService::StopDiscovery() - mCancelDiscovery does not exist!");
- mDiscoveryState = DISCOVERY_IDLE;
- }
-
- return NS_OK;
-}
-
-void
-FlyWebMDNSService::ListDiscoveredServices(nsTArray<FlyWebDiscoveredService>& aServices)
-{
- for (auto iter = mServiceMap.Iter(); !iter.Done(); iter.Next()) {
- aServices.AppendElement(iter.UserData()->mService);
- }
-}
-
-bool
-FlyWebMDNSService::HasService(const nsAString& aServiceId)
-{
- return mServiceMap.Contains(aServiceId);
-}
-
-nsresult
-FlyWebMDNSService::PairWithService(const nsAString& aServiceId,
- UniquePtr<FlyWebService::PairedInfo>& aInfo)
-{
- MOZ_ASSERT(HasService(aServiceId));
-
- nsresult rv;
- nsCOMPtr<nsIUUIDGenerator> uuidgen =
- do_GetService("@mozilla.org/uuid-generator;1", &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsID id;
- rv = uuidgen->GenerateUUIDInPlace(&id);
- NS_ENSURE_SUCCESS(rv, rv);
-
- aInfo.reset(new FlyWebService::PairedInfo());
-
- char uuidChars[NSID_LENGTH];
- id.ToProvidedString(uuidChars);
- CopyUTF8toUTF16(Substring(uuidChars + 1, uuidChars + NSID_LENGTH - 2),
- aInfo->mService.mHostname);
-
- DiscoveredInfo* discInfo = mServiceMap.Get(aServiceId);
-
- nsAutoString url;
- if (discInfo->mService.mCert.IsEmpty()) {
- url.AssignLiteral("http://");
- } else {
- url.AssignLiteral("https://");
- }
- url.Append(aInfo->mService.mHostname + NS_LITERAL_STRING("/"));
- nsCOMPtr<nsIURI> uiURL;
- NS_NewURI(getter_AddRefs(uiURL), url);
- MOZ_ASSERT(uiURL);
- if (!discInfo->mService.mPath.IsEmpty()) {
- nsCOMPtr<nsIURI> tmp = uiURL.forget();
- NS_NewURI(getter_AddRefs(uiURL), discInfo->mService.mPath, nullptr, tmp);
- }
- if (uiURL) {
- nsAutoCString spec;
- uiURL->GetSpec(spec);
- CopyUTF8toUTF16(spec, aInfo->mService.mUiUrl);
- }
-
- aInfo->mService.mDiscoveredService = discInfo->mService;
- aInfo->mDNSServiceInfo = discInfo->mDNSServiceInfo;
-
- return NS_OK;
-}
-
-nsresult
-FlyWebMDNSService::StartDiscoveryOf(FlyWebPublishedServerImpl* aServer)
-{
-
- RefPtr<FlyWebPublishedServer> existingServer =
- FlyWebService::GetOrCreate()->FindPublishedServerByName(aServer->Name());
- MOZ_ASSERT(existingServer);
-
- // Advertise the service via mdns.
- RefPtr<net::nsDNSServiceInfo> serviceInfo(new net::nsDNSServiceInfo());
-
- serviceInfo->SetPort(aServer->Port());
- serviceInfo->SetServiceType(mServiceType);
-
- nsCString certKey;
- aServer->GetCertKey(certKey);
- nsString uiURL;
- aServer->GetUiUrl(uiURL);
-
- if (!uiURL.IsEmpty() || !certKey.IsEmpty()) {
- RefPtr<nsHashPropertyBag> attrs = new nsHashPropertyBag();
- if (!uiURL.IsEmpty()) {
- attrs->SetPropertyAsAString(NS_LITERAL_STRING("path"), uiURL);
- }
- if (!certKey.IsEmpty()) {
- attrs->SetPropertyAsACString(NS_LITERAL_STRING("cert"), certKey);
- }
- serviceInfo->SetAttributes(attrs);
- }
-
- nsCString cstrName = NS_ConvertUTF16toUTF8(aServer->Name());
- LOG_I("MDNSService::StartDiscoveryOf() advertising service %s", cstrName.get());
- serviceInfo->SetServiceName(cstrName);
-
- LogDNSInfo(serviceInfo, "FlyWebMDNSService::StartDiscoveryOf");
-
- // Advertise the service.
- nsCOMPtr<nsICancelable> cancelRegister;
- nsresult rv = mDNSServiceDiscovery->
- RegisterService(serviceInfo, this, getter_AddRefs(cancelRegister));
- NS_ENSURE_SUCCESS(rv, rv);
-
- // All done.
- aServer->SetCancelRegister(cancelRegister);
-
- return NS_OK;
-}
-
-void
-FlyWebMDNSService::EnsureDiscoveryStarted()
-{
- mDiscoveryActive = true;
- // If state is idle, start discovery immediately.
- if (mDiscoveryState == DISCOVERY_IDLE) {
- StartDiscovery();
- }
-}
-
-void
-FlyWebMDNSService::EnsureDiscoveryStopped()
-{
- // All we need to do is set the flag to false.
- // If current state is IDLE, it's already the correct state.
- // Otherwise, the handlers for the internal state
- // transitions will check this flag and drive the state
- // towards IDLE.
- mDiscoveryActive = false;
-}
-
-static StaticRefPtr<FlyWebService> gFlyWebService;
-
-NS_IMPL_ISUPPORTS(FlyWebService, nsIObserver)
-
-FlyWebService::FlyWebService()
- : mMonitor("FlyWebService::mMonitor")
-{
- MOZ_ASSERT(NS_IsMainThread());
- nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
- if (obs) {
- obs->AddObserver(this, "inner-window-destroyed", false);
- }
-}
-
-FlyWebService::~FlyWebService()
-{
-}
-
-FlyWebService*
-FlyWebService::GetExisting()
-{
- return gFlyWebService;
-}
-
-FlyWebService*
-FlyWebService::GetOrCreate()
-{
- if (!gFlyWebService) {
- gFlyWebService = new FlyWebService();
- ClearOnShutdown(&gFlyWebService);
- ErrorResult rv = gFlyWebService->Init();
- if (rv.Failed()) {
- gFlyWebService = nullptr;
- return nullptr;
- }
- }
- return gFlyWebService;
-}
-
-ErrorResult
-FlyWebService::Init()
-{
- // Most functions of FlyWebService should not be started in the child.
- // Instead FlyWebService in the child is mainly responsible for tracking
- // publishedServer lifetimes. Other functions are handled by the
- // FlyWebService running in the parent.
- if (XRE_GetProcessType() == GeckoProcessType_Content) {
- return ErrorResult(NS_OK);
- }
-
- MOZ_ASSERT(NS_IsMainThread());
- if (!mMDNSHttpService) {
- mMDNSHttpService = new FlyWebMDNSService(this, NS_LITERAL_CSTRING("_http._tcp."));
- ErrorResult rv;
-
- rv = mMDNSHttpService->Init();
- if (rv.Failed()) {
- LOG_E("FlyWebService failed to initialize MDNS _http._tcp.");
- mMDNSHttpService = nullptr;
- rv.SuppressException();
- }
- }
-
- if (!mMDNSFlywebService) {
- mMDNSFlywebService = new FlyWebMDNSService(this, NS_LITERAL_CSTRING("_flyweb._tcp."));
- ErrorResult rv;
-
- rv = mMDNSFlywebService->Init();
- if (rv.Failed()) {
- LOG_E("FlyWebService failed to initialize MDNS _flyweb._tcp.");
- mMDNSFlywebService = nullptr;
- rv.SuppressException();
- }
- }
-
- return ErrorResult(NS_OK);
-}
-
-static already_AddRefed<FlyWebPublishPromise>
-MakeRejectionPromise(const char* name)
-{
- MozPromiseHolder<FlyWebPublishPromise> holder;
- RefPtr<FlyWebPublishPromise> promise = holder.Ensure(name);
- holder.Reject(NS_ERROR_FAILURE, name);
- return promise.forget();
-}
-
-static bool
-CheckForFlyWebAddon(const nsACString& uriString)
-{
- // Before proceeding, ensure that the FlyWeb system addon exists.
- nsresult rv;
- nsCOMPtr<nsIURI> uri;
- rv = NS_NewURI(getter_AddRefs(uri), uriString);
- if (NS_FAILED(rv)) {
- return false;
- }
-
- JSAddonId *addonId = MapURIToAddonID(uri);
- if (!addonId) {
- return false;
- }
-
- JSFlatString* flat = JS_ASSERT_STRING_IS_FLAT(JS::StringOfAddonId(addonId));
- nsAutoString addonIdString;
- AssignJSFlatString(addonIdString, flat);
- if (!addonIdString.EqualsLiteral("flyweb@mozilla.org")) {
- nsCString addonIdCString = NS_ConvertUTF16toUTF8(addonIdString);
- return false;
- }
-
- return true;
-}
-
-already_AddRefed<FlyWebPublishPromise>
-FlyWebService::PublishServer(const nsAString& aName,
- const FlyWebPublishOptions& aOptions,
- nsPIDOMWindowInner* aWindow)
-{
- // Scan uiUrl for illegal characters
-
- RefPtr<FlyWebPublishedServer> existingServer =
- FlyWebService::GetOrCreate()->FindPublishedServerByName(aName);
- if (existingServer) {
- LOG_I("PublishServer: Trying to publish server with already-existing name %s.",
- NS_ConvertUTF16toUTF8(aName).get());
- return MakeRejectionPromise(__func__);
- }
-
- RefPtr<FlyWebPublishedServer> server;
- if (XRE_GetProcessType() == GeckoProcessType_Content) {
- server = new FlyWebPublishedServerChild(aWindow, aName, aOptions);
- } else {
- server = new FlyWebPublishedServerImpl(aWindow, aName, aOptions);
-
- // Before proceeding, ensure that the FlyWeb system addon exists.
- if (!CheckForFlyWebAddon(NS_LITERAL_CSTRING("chrome://flyweb/skin/icon-64.png")) &&
- !CheckForFlyWebAddon(NS_LITERAL_CSTRING("chrome://flyweb/content/icon-64.png")))
- {
- LOG_E("PublishServer: Failed to find FlyWeb system addon.");
- return MakeRejectionPromise(__func__);
- }
- }
-
- if (aWindow) {
- nsresult rv;
-
- MOZ_ASSERT(NS_IsMainThread());
- rv = NS_DispatchToCurrentThread(
- MakeAndAddRef<FlyWebPublishServerPermissionCheck>(
- NS_ConvertUTF16toUTF8(aName), aWindow->WindowID(), server));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- LOG_E("PublishServer: Failed to dispatch permission check runnable for %s",
- NS_ConvertUTF16toUTF8(aName).get());
- return MakeRejectionPromise(__func__);
- }
- } else {
- // If aWindow is null, we're definitely in the e10s parent process.
- // In this case, we know that permission has already been granted
- // by the user because of content-process prompt.
- MOZ_ASSERT(XRE_GetProcessType() == GeckoProcessType_Default);
- server->PermissionGranted(true);
- }
-
- mServers.AppendElement(server);
-
- return server->GetPublishPromise();
-}
-
-already_AddRefed<FlyWebPublishedServer>
-FlyWebService::FindPublishedServerByName(
- const nsAString& aName)
-{
- MOZ_ASSERT(NS_IsMainThread());
- for (FlyWebPublishedServer* publishedServer : mServers) {
- if (publishedServer->Name().Equals(aName)) {
- RefPtr<FlyWebPublishedServer> server = publishedServer;
- return server.forget();
- }
- }
- return nullptr;
-}
-
-void
-FlyWebService::RegisterDiscoveryManager(FlyWebDiscoveryManager* aDiscoveryManager)
-{
- MOZ_ASSERT(NS_IsMainThread());
- mDiscoveryManagerTable.PutEntry(aDiscoveryManager);
- if (mMDNSHttpService) {
- mMDNSHttpService->EnsureDiscoveryStarted();
- }
- if (mMDNSFlywebService) {
- mMDNSFlywebService->EnsureDiscoveryStarted();
- }
-}
-
-void
-FlyWebService::UnregisterDiscoveryManager(FlyWebDiscoveryManager* aDiscoveryManager)
-{
- MOZ_ASSERT(NS_IsMainThread());
- mDiscoveryManagerTable.RemoveEntry(aDiscoveryManager);
- if (mDiscoveryManagerTable.IsEmpty()) {
- if (mMDNSHttpService) {
- mMDNSHttpService->EnsureDiscoveryStopped();
- }
- if (mMDNSFlywebService) {
- mMDNSFlywebService->EnsureDiscoveryStopped();
- }
- }
-}
-
-NS_IMETHODIMP
-FlyWebService::Observe(nsISupports* aSubject, const char* aTopic,
- const char16_t* aData)
-{
- MOZ_ASSERT(NS_IsMainThread());
- if (strcmp(aTopic, "inner-window-destroyed")) {
- return NS_OK;
- }
-
- nsCOMPtr<nsISupportsPRUint64> wrapper = do_QueryInterface(aSubject);
- NS_ENSURE_TRUE(wrapper, NS_ERROR_FAILURE);
-
- uint64_t innerID;
- nsresult rv = wrapper->GetData(&innerID);
- NS_ENSURE_SUCCESS(rv, rv);
-
- for (FlyWebPublishedServer* server : mServers) {
- if (server->OwnerWindowID() == innerID) {
- server->Close();
- }
- }
-
- return NS_OK;
-}
-
-void
-FlyWebService::UnregisterServer(FlyWebPublishedServer* aServer)
-{
- MOZ_ASSERT(NS_IsMainThread());
- DebugOnly<bool> removed = mServers.RemoveElement(aServer);
- MOZ_ASSERT(removed);
-}
-
-bool
-FlyWebService::HasConnectionOrServer(uint64_t aWindowID)
-{
- MOZ_ASSERT(NS_IsMainThread());
- for (FlyWebPublishedServer* server : mServers) {
- nsPIDOMWindowInner* win = server->GetOwner();
- if (win && win->WindowID() == aWindowID) {
- return true;
- }
- }
-
- return false;
-}
-
-void
-FlyWebService::NotifyDiscoveredServicesChanged()
-{
- // Process the service map, add to the pair map.
- for (auto iter = mDiscoveryManagerTable.Iter(); !iter.Done(); iter.Next()) {
- iter.Get()->GetKey()->NotifyDiscoveredServicesChanged();
- }
-}
-
-void
-FlyWebService::ListDiscoveredServices(nsTArray<FlyWebDiscoveredService>& aServices)
-{
- MOZ_ASSERT(NS_IsMainThread());
- if (mMDNSHttpService) {
- mMDNSHttpService->ListDiscoveredServices(aServices);
- }
- if (mMDNSFlywebService) {
- mMDNSFlywebService->ListDiscoveredServices(aServices);
- }
-}
-
-void
-FlyWebService::PairWithService(const nsAString& aServiceId,
- FlyWebPairingCallback& aCallback)
-{
- MOZ_ASSERT(NS_IsMainThread());
- // See if we have already paired with this service. If so, re-use the
- // FlyWebPairedService for that.
- {
- ReentrantMonitorAutoEnter pairedMapLock(mMonitor);
- for (auto iter = mPairedServiceTable.Iter(); !iter.Done(); iter.Next()) {
- PairedInfo* pairInfo = iter.UserData();
- if (pairInfo->mService.mDiscoveredService.mServiceId.Equals(aServiceId)) {
- ErrorResult er;
- ReentrantMonitorAutoExit pairedMapRelease(mMonitor);
- aCallback.PairingSucceeded(pairInfo->mService, er);
- ENSURE_SUCCESS_VOID(er);
- return;
- }
- }
- }
-
- UniquePtr<PairedInfo> pairInfo;
-
- nsresult rv = NS_OK;
- bool notFound = false;
- if (mMDNSHttpService && mMDNSHttpService->HasService(aServiceId)) {
- rv = mMDNSHttpService->PairWithService(aServiceId, pairInfo);
- } else if (mMDNSFlywebService && mMDNSFlywebService->HasService(aServiceId)) {
- rv = mMDNSFlywebService->PairWithService(aServiceId, pairInfo);
- } else {
- notFound = true;
- }
-
- if (NS_FAILED(rv)) {
- ErrorResult result;
- result.Throw(rv);
- const nsAString& reason = NS_LITERAL_STRING("Error pairing.");
- aCallback.PairingFailed(reason, result);
- ENSURE_SUCCESS_VOID(result);
- return;
- }
-
- if (!pairInfo) {
- ErrorResult res;
- const nsAString& reason = notFound ?
- NS_LITERAL_STRING("No such service.") :
- NS_LITERAL_STRING("Error pairing.");
- aCallback.PairingFailed(reason, res);
- ENSURE_SUCCESS_VOID(res);
- return;
- }
-
- // Add fingerprint to certificate override database.
- if (!pairInfo->mService.mDiscoveredService.mCert.IsEmpty()) {
- nsCOMPtr<nsICertOverrideService> override =
- do_GetService("@mozilla.org/security/certoverride;1");
- if (!override ||
- NS_FAILED(override->RememberTemporaryValidityOverrideUsingFingerprint(
- NS_ConvertUTF16toUTF8(pairInfo->mService.mHostname),
- -1,
- NS_ConvertUTF16toUTF8(pairInfo->mService.mDiscoveredService.mCert),
- nsICertOverrideService::ERROR_UNTRUSTED |
- nsICertOverrideService::ERROR_MISMATCH))) {
- ErrorResult res;
- aCallback.PairingFailed(NS_LITERAL_STRING("Error adding certificate override."), res);
- ENSURE_SUCCESS_VOID(res);
- return;
- }
- }
-
- // Grab a weak reference to the PairedInfo so that we can
- // use it even after ownership has been transferred to mPairedServiceTable
- PairedInfo* pairInfoWeak = pairInfo.release();
-
- {
- ReentrantMonitorAutoEnter pairedMapLock(mMonitor);
- mPairedServiceTable.Put(
- NS_ConvertUTF16toUTF8(pairInfoWeak->mService.mHostname), pairInfoWeak);
- }
-
- ErrorResult er;
- aCallback.PairingSucceeded(pairInfoWeak->mService, er);
- ENSURE_SUCCESS_VOID(er);
-}
-
-nsresult
-FlyWebService::CreateTransportForHost(const char **types,
- uint32_t typeCount,
- const nsACString &host,
- int32_t port,
- const nsACString &hostRoute,
- int32_t portRoute,
- nsIProxyInfo *proxyInfo,
- nsISocketTransport **result)
-{
- // This might be called on background threads
-
- *result = nullptr;
-
- nsCString ipAddrString;
- uint16_t discPort;
-
- {
- ReentrantMonitorAutoEnter pairedMapLock(mMonitor);
-
- PairedInfo* info = mPairedServiceTable.Get(host);
-
- if (!info) {
- return NS_OK;
- }
-
- // Get the ip address of the underlying service.
- info->mDNSServiceInfo->GetAddress(ipAddrString);
- info->mDNSServiceInfo->GetPort(&discPort);
- }
-
- // Parse it into an NetAddr.
- PRNetAddr prNetAddr;
- PRStatus status = PR_StringToNetAddr(ipAddrString.get(), &prNetAddr);
- NS_ENSURE_FALSE(status == PR_FAILURE, NS_ERROR_FAILURE);
-
- // Convert PRNetAddr to NetAddr.
- mozilla::net::NetAddr netAddr;
- PRNetAddrToNetAddr(&prNetAddr, &netAddr);
- netAddr.inet.port = htons(discPort);
-
- RefPtr<mozilla::net::nsSocketTransport> trans = new mozilla::net::nsSocketTransport();
- nsresult rv = trans->InitPreResolved(
- types, typeCount, host, port, hostRoute, portRoute, proxyInfo, &netAddr);
- NS_ENSURE_SUCCESS(rv, rv);
-
- trans.forget(result);
- return NS_OK;
-}
-
-void
-FlyWebService::StartDiscoveryOf(FlyWebPublishedServerImpl* aServer)
-{
- MOZ_ASSERT(NS_IsMainThread());
- nsresult rv = mMDNSFlywebService ?
- mMDNSFlywebService->StartDiscoveryOf(aServer) :
- NS_ERROR_FAILURE;
-
- if (NS_FAILED(rv)) {
- aServer->PublishedServerStarted(rv);
- }
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/flyweb/FlyWebService.h b/dom/flyweb/FlyWebService.h
deleted file mode 100644
index f7b983440..000000000
--- a/dom/flyweb/FlyWebService.h
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_FlyWebService_h
-#define mozilla_dom_FlyWebService_h
-
-#include "nsISupportsImpl.h"
-#include "mozilla/ErrorResult.h"
-#include "nsIProtocolHandler.h"
-#include "nsDataHashtable.h"
-#include "nsClassHashtable.h"
-#include "nsIObserver.h"
-#include "mozilla/MozPromise.h"
-#include "mozilla/ReentrantMonitor.h"
-#include "mozilla/dom/FlyWebDiscoveryManagerBinding.h"
-#include "nsITimer.h"
-#include "nsICancelable.h"
-#include "nsIDNSServiceDiscovery.h"
-
-class nsPIDOMWindowInner;
-class nsIProxyInfo;
-class nsISocketTransport;
-
-namespace mozilla {
-namespace dom {
-
-struct FlyWebPublishOptions;
-struct FlyWebFilter;
-class FlyWebPublishedServer;
-class FlyWebPublishedServerImpl;
-class FlyWebPairingCallback;
-class FlyWebDiscoveryManager;
-class FlyWebMDNSService;
-
-typedef MozPromise<RefPtr<FlyWebPublishedServer>, nsresult, false>
- FlyWebPublishPromise;
-
-class FlyWebService final : public nsIObserver
-{
- friend class FlyWebMDNSService;
-public:
- NS_DECL_THREADSAFE_ISUPPORTS
- NS_DECL_NSIOBSERVER
-
- static FlyWebService* GetExisting();
- static FlyWebService* GetOrCreate();
- static already_AddRefed<FlyWebService> GetOrCreateAddRefed()
- {
- return do_AddRef(GetOrCreate());
- }
-
- already_AddRefed<FlyWebPublishPromise>
- PublishServer(const nsAString& aName,
- const FlyWebPublishOptions& aOptions,
- nsPIDOMWindowInner* aWindow);
-
- void UnregisterServer(FlyWebPublishedServer* aServer);
-
- bool HasConnectionOrServer(uint64_t aWindowID);
-
- void ListDiscoveredServices(nsTArray<FlyWebDiscoveredService>& aServices);
- void PairWithService(const nsAString& aServiceId, FlyWebPairingCallback& aCallback);
- nsresult CreateTransportForHost(const char **types,
- uint32_t typeCount,
- const nsACString &host,
- int32_t port,
- const nsACString &hostRoute,
- int32_t portRoute,
- nsIProxyInfo *proxyInfo,
- nsISocketTransport **result);
-
- already_AddRefed<FlyWebPublishedServer> FindPublishedServerByName(
- const nsAString& aName);
-
- void RegisterDiscoveryManager(FlyWebDiscoveryManager* aDiscoveryManager);
- void UnregisterDiscoveryManager(FlyWebDiscoveryManager* aDiscoveryManager);
-
- // Should only be called by FlyWebPublishedServerImpl
- void StartDiscoveryOf(FlyWebPublishedServerImpl* aServer);
-
-private:
- FlyWebService();
- ~FlyWebService();
-
- ErrorResult Init();
-
- void NotifyDiscoveredServicesChanged();
-
- // Might want to make these hashes for perf
- nsTArray<FlyWebPublishedServer*> mServers;
-
- RefPtr<FlyWebMDNSService> mMDNSHttpService;
- RefPtr<FlyWebMDNSService> mMDNSFlywebService;
-
- struct PairedInfo
- {
- FlyWebPairedService mService;
- nsCOMPtr<nsIDNSServiceInfo> mDNSServiceInfo;
- };
- nsClassHashtable<nsCStringHashKey, PairedInfo>
- mPairedServiceTable;
- ReentrantMonitor mMonitor; // Protecting mPairedServiceTable
-
- nsTHashtable<nsPtrHashKey<FlyWebDiscoveryManager>> mDiscoveryManagerTable;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_FlyWebService_h
diff --git a/dom/flyweb/HttpServer.cpp b/dom/flyweb/HttpServer.cpp
deleted file mode 100644
index 26e15d9d5..000000000
--- a/dom/flyweb/HttpServer.cpp
+++ /dev/null
@@ -1,1319 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/HttpServer.h"
-#include "nsISocketTransport.h"
-#include "nsWhitespaceTokenizer.h"
-#include "nsNetUtil.h"
-#include "nsIStreamTransportService.h"
-#include "nsIAsyncStreamCopier2.h"
-#include "nsIPipe.h"
-#include "nsIOService.h"
-#include "nsIHttpChannelInternal.h"
-#include "Base64.h"
-#include "WebSocketChannel.h"
-#include "nsCharSeparatedTokenizer.h"
-#include "nsIX509Cert.h"
-
-static NS_DEFINE_CID(kStreamTransportServiceCID, NS_STREAMTRANSPORTSERVICE_CID);
-
-namespace mozilla {
-namespace dom {
-
-static LazyLogModule gHttpServerLog("HttpServer");
-#undef LOG_I
-#define LOG_I(...) MOZ_LOG(gHttpServerLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
-#undef LOG_V
-#define LOG_V(...) MOZ_LOG(gHttpServerLog, mozilla::LogLevel::Verbose, (__VA_ARGS__))
-#undef LOG_E
-#define LOG_E(...) MOZ_LOG(gHttpServerLog, mozilla::LogLevel::Error, (__VA_ARGS__))
-
-
-NS_IMPL_ISUPPORTS(HttpServer,
- nsIServerSocketListener,
- nsILocalCertGetCallback)
-
-HttpServer::HttpServer()
- : mPort()
- , mHttps()
-{
-}
-
-HttpServer::~HttpServer()
-{
-}
-
-void
-HttpServer::Init(int32_t aPort, bool aHttps, HttpServerListener* aListener)
-{
- mPort = aPort;
- mHttps = aHttps;
- mListener = aListener;
-
- if (mHttps) {
- nsCOMPtr<nsILocalCertService> lcs =
- do_CreateInstance("@mozilla.org/security/local-cert-service;1");
- nsresult rv = lcs->GetOrCreateCert(NS_LITERAL_CSTRING("flyweb"), this);
- if (NS_FAILED(rv)) {
- NotifyStarted(rv);
- }
- } else {
- // Make sure to always have an async step before notifying callbacks
- HandleCert(nullptr, NS_OK);
- }
-}
-
-NS_IMETHODIMP
-HttpServer::HandleCert(nsIX509Cert* aCert, nsresult aResult)
-{
- nsresult rv = aResult;
- if (NS_SUCCEEDED(rv)) {
- rv = StartServerSocket(aCert);
- }
-
- if (NS_FAILED(rv) && mServerSocket) {
- mServerSocket->Close();
- mServerSocket = nullptr;
- }
-
- NotifyStarted(rv);
-
- return NS_OK;
-}
-
-void
-HttpServer::NotifyStarted(nsresult aStatus)
-{
- RefPtr<HttpServerListener> listener = mListener;
- nsCOMPtr<nsIRunnable> event = NS_NewRunnableFunction([listener, aStatus] ()
- {
- listener->OnServerStarted(aStatus);
- });
- NS_DispatchToCurrentThread(event);
-}
-
-nsresult
-HttpServer::StartServerSocket(nsIX509Cert* aCert)
-{
- nsresult rv;
- mServerSocket =
- do_CreateInstance(aCert ? "@mozilla.org/network/tls-server-socket;1"
- : "@mozilla.org/network/server-socket;1", &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = mServerSocket->Init(mPort, false, -1);
- NS_ENSURE_SUCCESS(rv, rv);
-
- if (aCert) {
- nsCOMPtr<nsITLSServerSocket> tls = do_QueryInterface(mServerSocket);
- rv = tls->SetServerCert(aCert);
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = tls->SetSessionTickets(false);
- NS_ENSURE_SUCCESS(rv, rv);
-
- mCert = aCert;
- }
-
- rv = mServerSocket->AsyncListen(this);
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = mServerSocket->GetPort(&mPort);
- NS_ENSURE_SUCCESS(rv, rv);
-
- LOG_I("HttpServer::StartServerSocket(%p)", this);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-HttpServer::OnSocketAccepted(nsIServerSocket* aServ,
- nsISocketTransport* aTransport)
-{
- MOZ_ASSERT(SameCOMIdentity(aServ, mServerSocket));
-
- nsresult rv;
- RefPtr<Connection> conn = new Connection(aTransport, this, rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- LOG_I("HttpServer::OnSocketAccepted(%p) - Socket %p", this, conn.get());
-
- mConnections.AppendElement(conn.forget());
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-HttpServer::OnStopListening(nsIServerSocket* aServ,
- nsresult aStatus)
-{
- MOZ_ASSERT(aServ == mServerSocket || !mServerSocket);
-
- LOG_I("HttpServer::OnStopListening(%p) - status 0x%lx", this, aStatus);
-
- Close();
-
- return NS_OK;
-}
-
-void
-HttpServer::SendResponse(InternalRequest* aRequest, InternalResponse* aResponse)
-{
- for (Connection* conn : mConnections) {
- if (conn->TryHandleResponse(aRequest, aResponse)) {
- return;
- }
- }
-
- MOZ_ASSERT(false, "Unknown request");
-}
-
-already_AddRefed<nsITransportProvider>
-HttpServer::AcceptWebSocket(InternalRequest* aConnectRequest,
- const Optional<nsAString>& aProtocol,
- ErrorResult& aRv)
-{
- for (Connection* conn : mConnections) {
- if (!conn->HasPendingWebSocketRequest(aConnectRequest)) {
- continue;
- }
- nsCOMPtr<nsITransportProvider> provider =
- conn->HandleAcceptWebSocket(aProtocol, aRv);
- if (aRv.Failed()) {
- conn->Close();
- }
- // This connection is now owned by the websocket, or we just closed it
- mConnections.RemoveElement(conn);
- return provider.forget();
- }
-
- aRv.Throw(NS_ERROR_UNEXPECTED);
- MOZ_ASSERT(false, "Unknown request");
-
- return nullptr;
-}
-
-void
-HttpServer::SendWebSocketResponse(InternalRequest* aConnectRequest,
- InternalResponse* aResponse)
-{
- for (Connection* conn : mConnections) {
- if (conn->HasPendingWebSocketRequest(aConnectRequest)) {
- conn->HandleWebSocketResponse(aResponse);
- return;
- }
- }
-
- MOZ_ASSERT(false, "Unknown request");
-}
-
-void
-HttpServer::Close()
-{
- if (mServerSocket) {
- mServerSocket->Close();
- mServerSocket = nullptr;
- }
-
- if (mListener) {
- RefPtr<HttpServerListener> listener = mListener.forget();
- listener->OnServerClose();
- }
-
- for (Connection* conn : mConnections) {
- conn->Close();
- }
- mConnections.Clear();
-}
-
-void
-HttpServer::GetCertKey(nsACString& aKey)
-{
- nsAutoString tmp;
- if (mCert) {
- mCert->GetSha256Fingerprint(tmp);
- }
- LossyCopyUTF16toASCII(tmp, aKey);
-}
-
-NS_IMPL_ISUPPORTS(HttpServer::TransportProvider,
- nsITransportProvider)
-
-HttpServer::TransportProvider::~TransportProvider()
-{
-}
-
-NS_IMETHODIMP
-HttpServer::TransportProvider::SetListener(nsIHttpUpgradeListener* aListener)
-{
- MOZ_ASSERT(!mListener);
- MOZ_ASSERT(aListener);
-
- mListener = aListener;
-
- MaybeNotify();
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-HttpServer::TransportProvider::GetIPCChild(PTransportProviderChild** aChild)
-{
- MOZ_CRASH("Don't call this in parent process");
- *aChild = nullptr;
- return NS_OK;
-}
-
-void
-HttpServer::TransportProvider::SetTransport(nsISocketTransport* aTransport,
- nsIAsyncInputStream* aInput,
- nsIAsyncOutputStream* aOutput)
-{
- MOZ_ASSERT(!mTransport);
- MOZ_ASSERT(aTransport && aInput && aOutput);
-
- mTransport = aTransport;
- mInput = aInput;
- mOutput = aOutput;
-
- MaybeNotify();
-}
-
-void
-HttpServer::TransportProvider::MaybeNotify()
-{
- if (mTransport && mListener) {
- RefPtr<TransportProvider> self = this;
- nsCOMPtr<nsIRunnable> event = NS_NewRunnableFunction([self, this] ()
- {
- mListener->OnTransportAvailable(mTransport, mInput, mOutput);
- });
- NS_DispatchToCurrentThread(event);
- }
-}
-
-NS_IMPL_ISUPPORTS(HttpServer::Connection,
- nsIInputStreamCallback,
- nsIOutputStreamCallback)
-
-HttpServer::Connection::Connection(nsISocketTransport* aTransport,
- HttpServer* aServer,
- nsresult& rv)
- : mServer(aServer)
- , mTransport(aTransport)
- , mState(eRequestLine)
- , mPendingReqVersion()
- , mRemainingBodySize()
- , mCloseAfterRequest(false)
-{
- nsCOMPtr<nsIInputStream> input;
- rv = mTransport->OpenInputStream(0, 0, 0, getter_AddRefs(input));
- NS_ENSURE_SUCCESS_VOID(rv);
-
- mInput = do_QueryInterface(input);
-
- nsCOMPtr<nsIOutputStream> output;
- rv = mTransport->OpenOutputStream(0, 0, 0, getter_AddRefs(output));
- NS_ENSURE_SUCCESS_VOID(rv);
-
- mOutput = do_QueryInterface(output);
-
- if (mServer->mHttps) {
- SetSecurityObserver(true);
- } else {
- mInput->AsyncWait(this, 0, 0, NS_GetCurrentThread());
- }
-}
-
-NS_IMETHODIMP
-HttpServer::Connection::OnHandshakeDone(nsITLSServerSocket* aServer,
- nsITLSClientStatus* aStatus)
-{
- LOG_I("HttpServer::Connection::OnHandshakeDone(%p)", this);
-
- // XXX Verify connection security
-
- SetSecurityObserver(false);
- mInput->AsyncWait(this, 0, 0, NS_GetCurrentThread());
-
- return NS_OK;
-}
-
-void
-HttpServer::Connection::SetSecurityObserver(bool aListen)
-{
- LOG_I("HttpServer::Connection::SetSecurityObserver(%p) - %s", this,
- aListen ? "On" : "Off");
-
- nsCOMPtr<nsISupports> secInfo;
- mTransport->GetSecurityInfo(getter_AddRefs(secInfo));
- nsCOMPtr<nsITLSServerConnectionInfo> tlsConnInfo =
- do_QueryInterface(secInfo);
- MOZ_ASSERT(tlsConnInfo);
- tlsConnInfo->SetSecurityObserver(aListen ? this : nullptr);
-}
-
-HttpServer::Connection::~Connection()
-{
-}
-
-NS_IMETHODIMP
-HttpServer::Connection::OnInputStreamReady(nsIAsyncInputStream* aStream)
-{
- MOZ_ASSERT(!mInput || aStream == mInput);
-
- LOG_I("HttpServer::Connection::OnInputStreamReady(%p)", this);
-
- if (!mInput || mState == ePause) {
- return NS_OK;
- }
-
- uint64_t avail;
- nsresult rv = mInput->Available(&avail);
- if (NS_FAILED(rv)) {
- LOG_I("HttpServer::Connection::OnInputStreamReady(%p) - Connection closed", this);
-
- mServer->mConnections.RemoveElement(this);
- // Connection closed. Handle errors here.
- return NS_OK;
- }
-
- uint32_t numRead;
- rv = mInput->ReadSegments(ReadSegmentsFunc,
- this,
- UINT32_MAX,
- &numRead);
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = mInput->AsyncWait(this, 0, 0, NS_GetCurrentThread());
- NS_ENSURE_SUCCESS(rv, rv);
-
- return NS_OK;
-}
-
-nsresult
-HttpServer::Connection::ReadSegmentsFunc(nsIInputStream* aIn,
- void* aClosure,
- const char* aBuffer,
- uint32_t aToOffset,
- uint32_t aCount,
- uint32_t* aWriteCount)
-{
- const char* buffer = aBuffer;
- nsresult rv = static_cast<HttpServer::Connection*>(aClosure)->
- ConsumeInput(buffer, buffer + aCount);
-
- *aWriteCount = buffer - aBuffer;
- MOZ_ASSERT(*aWriteCount <= aCount);
-
- return rv;
-}
-
-static const char*
-findCRLF(const char* aBuffer, const char* aEnd)
-{
- if (aBuffer + 1 >= aEnd) {
- return nullptr;
- }
-
- const char* pos;
- while ((pos = static_cast<const char*>(memchr(aBuffer,
- '\r',
- aEnd - aBuffer - 1)))) {
- if (*(pos + 1) == '\n') {
- return pos;
- }
- aBuffer = pos + 1;
- }
- return nullptr;
-}
-
-nsresult
-HttpServer::Connection::ConsumeInput(const char*& aBuffer,
- const char* aEnd)
-{
- nsresult rv;
- while (mState == eRequestLine ||
- mState == eHeaders) {
- // Consume line-by-line
-
- // Check if buffer boundry ended up right between the CR and LF
- if (!mInputBuffer.IsEmpty() && mInputBuffer.Last() == '\r' &&
- *aBuffer == '\n') {
- aBuffer++;
- rv = ConsumeLine(mInputBuffer.BeginReading(), mInputBuffer.Length() - 1);
- NS_ENSURE_SUCCESS(rv, rv);
-
- mInputBuffer.Truncate();
- }
-
- // Look for a CRLF
- const char* pos = findCRLF(aBuffer, aEnd);
- if (!pos) {
- mInputBuffer.Append(aBuffer, aEnd - aBuffer);
- aBuffer = aEnd;
- return NS_OK;
- }
-
- if (!mInputBuffer.IsEmpty()) {
- mInputBuffer.Append(aBuffer, pos - aBuffer);
- aBuffer = pos + 2;
- rv = ConsumeLine(mInputBuffer.BeginReading(), mInputBuffer.Length() - 1);
- NS_ENSURE_SUCCESS(rv, rv);
-
- mInputBuffer.Truncate();
- } else {
- rv = ConsumeLine(aBuffer, pos - aBuffer);
- NS_ENSURE_SUCCESS(rv, rv);
-
- aBuffer = pos + 2;
- }
- }
-
- if (mState == eBody) {
- uint32_t size = std::min(mRemainingBodySize,
- static_cast<uint32_t>(aEnd - aBuffer));
- uint32_t written = size;
-
- if (mCurrentRequestBody) {
- rv = mCurrentRequestBody->Write(aBuffer, size, &written);
- // Since we've given the pipe unlimited size, we should never
- // end up needing to block.
- MOZ_ASSERT(rv != NS_BASE_STREAM_WOULD_BLOCK);
- if (NS_FAILED(rv)) {
- written = size;
- mCurrentRequestBody = nullptr;
- }
- }
-
- aBuffer += written;
- mRemainingBodySize -= written;
- if (!mRemainingBodySize) {
- mCurrentRequestBody->Close();
- mCurrentRequestBody = nullptr;
- mState = eRequestLine;
- }
- }
-
- return NS_OK;
-}
-
-bool
-ContainsToken(const nsCString& aList, const nsCString& aToken)
-{
- nsCCharSeparatedTokenizer tokens(aList, ',');
- bool found = false;
- while (!found && tokens.hasMoreTokens()) {
- found = tokens.nextToken().Equals(aToken);
- }
- return found;
-}
-
-static bool
-IsWebSocketRequest(InternalRequest* aRequest, uint32_t aHttpVersion)
-{
- if (aHttpVersion < 1) {
- return false;
- }
-
- nsAutoCString str;
- aRequest->GetMethod(str);
- if (!str.EqualsLiteral("GET")) {
- return false;
- }
-
- InternalHeaders* headers = aRequest->Headers();
- ErrorResult res;
-
- headers->GetFirst(NS_LITERAL_CSTRING("upgrade"), str, res);
- MOZ_ASSERT(!res.Failed());
- if (!str.EqualsLiteral("websocket")) {
- return false;
- }
-
- headers->GetFirst(NS_LITERAL_CSTRING("connection"), str, res);
- MOZ_ASSERT(!res.Failed());
- if (!ContainsToken(str, NS_LITERAL_CSTRING("Upgrade"))) {
- return false;
- }
-
- headers->GetFirst(NS_LITERAL_CSTRING("sec-websocket-key"), str, res);
- MOZ_ASSERT(!res.Failed());
- nsAutoCString binary;
- if (NS_FAILED(Base64Decode(str, binary)) || binary.Length() != 16) {
- return false;
- }
-
- nsresult rv;
- headers->GetFirst(NS_LITERAL_CSTRING("sec-websocket-version"), str, res);
- MOZ_ASSERT(!res.Failed());
- if (str.ToInteger(&rv) != 13 || NS_FAILED(rv)) {
- return false;
- }
-
- return true;
-}
-
-nsresult
-HttpServer::Connection::ConsumeLine(const char* aBuffer,
- size_t aLength)
-{
- MOZ_ASSERT(mState == eRequestLine ||
- mState == eHeaders);
-
- if (MOZ_LOG_TEST(gHttpServerLog, mozilla::LogLevel::Verbose)) {
- nsCString line(aBuffer, aLength);
- LOG_V("HttpServer::Connection::ConsumeLine(%p) - \"%s\"", this, line.get());
- }
-
- if (mState == eRequestLine) {
- LOG_V("HttpServer::Connection::ConsumeLine(%p) - Parsing request line", this);
- NS_ENSURE_FALSE(mCloseAfterRequest, NS_ERROR_UNEXPECTED);
-
- if (aLength == 0) {
- // Ignore empty lines before the request line
- return NS_OK;
- }
- MOZ_ASSERT(!mPendingReq);
-
- // Process request line
- nsCWhitespaceTokenizer tokens(Substring(aBuffer, aLength));
-
- NS_ENSURE_TRUE(tokens.hasMoreTokens(), NS_ERROR_UNEXPECTED);
- nsDependentCSubstring method = tokens.nextToken();
- NS_ENSURE_TRUE(NS_IsValidHTTPToken(method), NS_ERROR_UNEXPECTED);
- NS_ENSURE_TRUE(tokens.hasMoreTokens(), NS_ERROR_UNEXPECTED);
- nsDependentCSubstring url = tokens.nextToken();
- // Seems like it's also allowed to pass full urls with scheme+host+port.
- // May need to support that.
- NS_ENSURE_TRUE(url.First() == '/', NS_ERROR_UNEXPECTED);
- mPendingReq = new InternalRequest(url, /* aURLFragment */ EmptyCString());
- mPendingReq->SetMethod(method);
- NS_ENSURE_TRUE(tokens.hasMoreTokens(), NS_ERROR_UNEXPECTED);
- nsDependentCSubstring version = tokens.nextToken();
- NS_ENSURE_TRUE(StringBeginsWith(version, NS_LITERAL_CSTRING("HTTP/1.")),
- NS_ERROR_UNEXPECTED);
- nsresult rv;
- // This integer parsing is likely not strict enough.
- nsCString reqVersion;
- reqVersion = Substring(version, MOZ_ARRAY_LENGTH("HTTP/1.") - 1);
- mPendingReqVersion = reqVersion.ToInteger(&rv);
- NS_ENSURE_SUCCESS(rv, NS_ERROR_UNEXPECTED);
-
- NS_ENSURE_FALSE(tokens.hasMoreTokens(), NS_ERROR_UNEXPECTED);
-
- LOG_V("HttpServer::Connection::ConsumeLine(%p) - Parsed request line", this);
-
- mState = eHeaders;
-
- return NS_OK;
- }
-
- if (aLength == 0) {
- LOG_V("HttpServer::Connection::ConsumeLine(%p) - Found end of headers", this);
-
- MaybeAddPendingHeader();
-
- ErrorResult res;
- mPendingReq->Headers()->SetGuard(HeadersGuardEnum::Immutable, res);
-
- // Check for WebSocket
- if (IsWebSocketRequest(mPendingReq, mPendingReqVersion)) {
- LOG_V("HttpServer::Connection::ConsumeLine(%p) - Fire OnWebSocket", this);
-
- mState = ePause;
- mPendingWebSocketRequest = mPendingReq.forget();
- mPendingReqVersion = 0;
-
- RefPtr<HttpServerListener> listener = mServer->mListener;
- RefPtr<InternalRequest> request = mPendingWebSocketRequest;
- nsCOMPtr<nsIRunnable> event =
- NS_NewRunnableFunction([listener, request] ()
- {
- listener->OnWebSocket(request);
- });
- NS_DispatchToCurrentThread(event);
-
- return NS_OK;
- }
-
- nsAutoCString header;
- mPendingReq->Headers()->GetFirst(NS_LITERAL_CSTRING("connection"),
- header,
- res);
- MOZ_ASSERT(!res.Failed());
- // 1.0 defaults to closing connections.
- // 1.1 and higher defaults to keep-alive.
- if (ContainsToken(header, NS_LITERAL_CSTRING("close")) ||
- (mPendingReqVersion == 0 &&
- !ContainsToken(header, NS_LITERAL_CSTRING("keep-alive")))) {
- mCloseAfterRequest = true;
- }
-
- mPendingReq->Headers()->GetFirst(NS_LITERAL_CSTRING("content-length"),
- header,
- res);
- MOZ_ASSERT(!res.Failed());
-
- LOG_V("HttpServer::Connection::ConsumeLine(%p) - content-length is \"%s\"",
- this, header.get());
-
- if (!header.IsEmpty()) {
- nsresult rv;
- mRemainingBodySize = header.ToInteger(&rv);
- NS_ENSURE_SUCCESS(rv, rv);
- } else {
- mRemainingBodySize = 0;
- }
-
- if (mRemainingBodySize) {
- LOG_V("HttpServer::Connection::ConsumeLine(%p) - Starting consume body", this);
- mState = eBody;
-
- // We use an unlimited buffer size here to ensure
- // that we get to the next request even if the webpage hangs on
- // to the request indefinitely without consuming the body.
- nsCOMPtr<nsIInputStream> input;
- nsCOMPtr<nsIOutputStream> output;
- nsresult rv = NS_NewPipe(getter_AddRefs(input),
- getter_AddRefs(output),
- 0, // Segment size
- UINT32_MAX, // Unlimited buffer size
- false, // not nonBlockingInput
- true); // nonBlockingOutput
- NS_ENSURE_SUCCESS(rv, rv);
-
- mCurrentRequestBody = do_QueryInterface(output);
- mPendingReq->SetBody(input);
- } else {
- LOG_V("HttpServer::Connection::ConsumeLine(%p) - No body", this);
- mState = eRequestLine;
- }
-
- mPendingRequests.AppendElement(PendingRequest(mPendingReq, nullptr));
-
- LOG_V("HttpServer::Connection::ConsumeLine(%p) - Fire OnRequest", this);
-
- RefPtr<HttpServerListener> listener = mServer->mListener;
- RefPtr<InternalRequest> request = mPendingReq.forget();
- nsCOMPtr<nsIRunnable> event =
- NS_NewRunnableFunction([listener, request] ()
- {
- listener->OnRequest(request);
- });
- NS_DispatchToCurrentThread(event);
-
- mPendingReqVersion = 0;
-
- return NS_OK;
- }
-
- // Parse header line
- if (aBuffer[0] == ' ' || aBuffer[0] == '\t') {
- LOG_V("HttpServer::Connection::ConsumeLine(%p) - Add to header %s",
- this,
- mPendingHeaderName.get());
-
- NS_ENSURE_FALSE(mPendingHeaderName.IsEmpty(),
- NS_ERROR_UNEXPECTED);
-
- // We might need to do whitespace trimming/compression here.
- mPendingHeaderValue.Append(aBuffer, aLength);
- return NS_OK;
- }
-
- MaybeAddPendingHeader();
-
- const char* colon = static_cast<const char*>(memchr(aBuffer, ':', aLength));
- NS_ENSURE_TRUE(colon, NS_ERROR_UNEXPECTED);
-
- ToLowerCase(Substring(aBuffer, colon - aBuffer), mPendingHeaderName);
- mPendingHeaderValue.Assign(colon + 1, aLength - (colon - aBuffer) - 1);
-
- NS_ENSURE_TRUE(NS_IsValidHTTPToken(mPendingHeaderName),
- NS_ERROR_UNEXPECTED);
-
- LOG_V("HttpServer::Connection::ConsumeLine(%p) - Parsed header %s",
- this,
- mPendingHeaderName.get());
-
- return NS_OK;
-}
-
-void
-HttpServer::Connection::MaybeAddPendingHeader()
-{
- if (mPendingHeaderName.IsEmpty()) {
- return;
- }
-
- // We might need to do more whitespace trimming/compression here.
- mPendingHeaderValue.Trim(" \t");
-
- ErrorResult rv;
- mPendingReq->Headers()->Append(mPendingHeaderName, mPendingHeaderValue, rv);
- mPendingHeaderName.Truncate();
-}
-
-bool
-HttpServer::Connection::TryHandleResponse(InternalRequest* aRequest,
- InternalResponse* aResponse)
-{
- bool handledResponse = false;
- for (uint32_t i = 0; i < mPendingRequests.Length(); ++i) {
- PendingRequest& pending = mPendingRequests[i];
- if (pending.first() == aRequest) {
- MOZ_ASSERT(!handledResponse);
- MOZ_ASSERT(!pending.second());
-
- pending.second() = aResponse;
- if (i != 0) {
- return true;
- }
- handledResponse = true;
- }
-
- if (handledResponse && !pending.second()) {
- // Shortcut if we've handled the response, and
- // we don't have more responses to send
- return true;
- }
-
- if (i == 0 && pending.second()) {
- RefPtr<InternalResponse> resp = pending.second().forget();
- mPendingRequests.RemoveElementAt(0);
- QueueResponse(resp);
- --i;
- }
- }
-
- return handledResponse;
-}
-
-already_AddRefed<nsITransportProvider>
-HttpServer::Connection::HandleAcceptWebSocket(const Optional<nsAString>& aProtocol,
- ErrorResult& aRv)
-{
- MOZ_ASSERT(mPendingWebSocketRequest);
-
- RefPtr<InternalResponse> response =
- new InternalResponse(101, NS_LITERAL_CSTRING("Switching Protocols"));
-
- InternalHeaders* headers = response->Headers();
- headers->Set(NS_LITERAL_CSTRING("Upgrade"),
- NS_LITERAL_CSTRING("websocket"),
- aRv);
- headers->Set(NS_LITERAL_CSTRING("Connection"),
- NS_LITERAL_CSTRING("Upgrade"),
- aRv);
- if (aProtocol.WasPassed()) {
- NS_ConvertUTF16toUTF8 protocol(aProtocol.Value());
- nsAutoCString reqProtocols;
- mPendingWebSocketRequest->Headers()->
- GetFirst(NS_LITERAL_CSTRING("Sec-WebSocket-Protocol"), reqProtocols, aRv);
- if (!ContainsToken(reqProtocols, protocol)) {
- // Should throw a better error here
- aRv.Throw(NS_ERROR_FAILURE);
- return nullptr;
- }
-
- headers->Set(NS_LITERAL_CSTRING("Sec-WebSocket-Protocol"),
- protocol, aRv);
- }
-
- nsAutoCString key, hash;
- mPendingWebSocketRequest->Headers()->
- GetFirst(NS_LITERAL_CSTRING("Sec-WebSocket-Key"), key, aRv);
- nsresult rv = mozilla::net::CalculateWebSocketHashedSecret(key, hash);
- if (NS_FAILED(rv)) {
- aRv.Throw(rv);
- return nullptr;
- }
- headers->Set(NS_LITERAL_CSTRING("Sec-WebSocket-Accept"), hash, aRv);
-
- nsAutoCString extensions, negotiatedExtensions;
- mPendingWebSocketRequest->Headers()->
- GetFirst(NS_LITERAL_CSTRING("Sec-WebSocket-Extensions"), extensions, aRv);
- mozilla::net::ProcessServerWebSocketExtensions(extensions,
- negotiatedExtensions);
- if (!negotiatedExtensions.IsEmpty()) {
- headers->Set(NS_LITERAL_CSTRING("Sec-WebSocket-Extensions"),
- negotiatedExtensions, aRv);
- }
-
- RefPtr<TransportProvider> result = new TransportProvider();
- mWebSocketTransportProvider = result;
-
- QueueResponse(response);
-
- return result.forget();
-}
-
-void
-HttpServer::Connection::HandleWebSocketResponse(InternalResponse* aResponse)
-{
- MOZ_ASSERT(mPendingWebSocketRequest);
-
- mState = eRequestLine;
- mPendingWebSocketRequest = nullptr;
- mInput->AsyncWait(this, 0, 0, NS_GetCurrentThread());
-
- QueueResponse(aResponse);
-}
-
-void
-HttpServer::Connection::QueueResponse(InternalResponse* aResponse)
-{
- bool chunked = false;
-
- RefPtr<InternalHeaders> headers = new InternalHeaders(*aResponse->Headers());
- {
- ErrorResult res;
- headers->SetGuard(HeadersGuardEnum::None, res);
- }
- nsCOMPtr<nsIInputStream> body;
- int64_t bodySize;
- aResponse->GetBody(getter_AddRefs(body), &bodySize);
-
- if (body && bodySize >= 0) {
- nsCString sizeStr;
- sizeStr.AppendInt(bodySize);
-
- LOG_V("HttpServer::Connection::QueueResponse(%p) - "
- "Setting content-length to %s",
- this, sizeStr.get());
-
- ErrorResult res;
- headers->Set(NS_LITERAL_CSTRING("content-length"), sizeStr, res);
- } else if (body) {
- // Use chunked transfer encoding
- LOG_V("HttpServer::Connection::QueueResponse(%p) - Chunked transfer-encoding",
- this);
-
- ErrorResult res;
- headers->Set(NS_LITERAL_CSTRING("transfer-encoding"),
- NS_LITERAL_CSTRING("chunked"),
- res);
- headers->Delete(NS_LITERAL_CSTRING("content-length"), res);
- chunked = true;
-
- } else {
- LOG_V("HttpServer::Connection::QueueResponse(%p) - "
- "No body - setting content-length to 0", this);
-
- ErrorResult res;
- headers->Set(NS_LITERAL_CSTRING("content-length"),
- NS_LITERAL_CSTRING("0"), res);
- }
-
- nsCString head(NS_LITERAL_CSTRING("HTTP/1.1 "));
- head.AppendInt(aResponse->GetStatus());
- // XXX is the statustext security checked?
- head.Append(NS_LITERAL_CSTRING(" ") +
- aResponse->GetStatusText() +
- NS_LITERAL_CSTRING("\r\n"));
-
- AutoTArray<InternalHeaders::Entry, 16> entries;
- headers->GetEntries(entries);
-
- for (auto header : entries) {
- head.Append(header.mName +
- NS_LITERAL_CSTRING(": ") +
- header.mValue +
- NS_LITERAL_CSTRING("\r\n"));
- }
-
- head.Append(NS_LITERAL_CSTRING("\r\n"));
-
- mOutputBuffers.AppendElement()->mString = head;
- if (body) {
- OutputBuffer* bodyBuffer = mOutputBuffers.AppendElement();
- bodyBuffer->mStream = body;
- bodyBuffer->mChunked = chunked;
- }
-
- OnOutputStreamReady(mOutput);
-}
-
-namespace {
-
-typedef MozPromise<nsresult, bool, false> StreamCopyPromise;
-
-class StreamCopier final : public nsIOutputStreamCallback
- , public nsIInputStreamCallback
- , public nsIRunnable
-{
-public:
- static RefPtr<StreamCopyPromise>
- Copy(nsIInputStream* aSource, nsIAsyncOutputStream* aSink,
- bool aChunked)
- {
- RefPtr<StreamCopier> copier = new StreamCopier(aSource, aSink, aChunked);
-
- RefPtr<StreamCopyPromise> p = copier->mPromise.Ensure(__func__);
-
- nsresult rv = copier->mTarget->Dispatch(copier, NS_DISPATCH_NORMAL);
- if (NS_FAILED(rv)) {
- copier->mPromise.Resolve(rv, __func__);
- }
-
- return p;
- }
-
- NS_DECL_THREADSAFE_ISUPPORTS
- NS_DECL_NSIINPUTSTREAMCALLBACK
- NS_DECL_NSIOUTPUTSTREAMCALLBACK
- NS_DECL_NSIRUNNABLE
-
-private:
- StreamCopier(nsIInputStream* aSource, nsIAsyncOutputStream* aSink,
- bool aChunked)
- : mSource(aSource)
- , mAsyncSource(do_QueryInterface(aSource))
- , mSink(aSink)
- , mTarget(do_GetService(NS_STREAMTRANSPORTSERVICE_CONTRACTID))
- , mChunkRemaining(0)
- , mChunked(aChunked)
- , mAddedFinalSeparator(false)
- , mFirstChunk(aChunked)
- {
- }
- ~StreamCopier() {}
-
- static nsresult FillOutputBufferHelper(nsIOutputStream* aOutStr,
- void* aClosure,
- char* aBuffer,
- uint32_t aOffset,
- uint32_t aCount,
- uint32_t* aCountRead);
- nsresult FillOutputBuffer(char* aBuffer,
- uint32_t aCount,
- uint32_t* aCountRead);
-
- nsCOMPtr<nsIInputStream> mSource;
- nsCOMPtr<nsIAsyncInputStream> mAsyncSource;
- nsCOMPtr<nsIAsyncOutputStream> mSink;
- MozPromiseHolder<StreamCopyPromise> mPromise;
- nsCOMPtr<nsIEventTarget> mTarget; // XXX we should cache this somewhere
- uint32_t mChunkRemaining;
- nsCString mSeparator;
- bool mChunked;
- bool mAddedFinalSeparator;
- bool mFirstChunk;
-};
-
-NS_IMPL_ISUPPORTS(StreamCopier,
- nsIOutputStreamCallback,
- nsIInputStreamCallback,
- nsIRunnable)
-
-struct WriteState
-{
- StreamCopier* copier;
- nsresult sourceRv;
-};
-
-// This function only exists to enable FillOutputBuffer to be a non-static
-// function where we can use member variables more easily.
-nsresult
-StreamCopier::FillOutputBufferHelper(nsIOutputStream* aOutStr,
- void* aClosure,
- char* aBuffer,
- uint32_t aOffset,
- uint32_t aCount,
- uint32_t* aCountRead)
-{
- WriteState* ws = static_cast<WriteState*>(aClosure);
- ws->sourceRv = ws->copier->FillOutputBuffer(aBuffer, aCount, aCountRead);
- return ws->sourceRv;
-}
-
-nsresult
-CheckForEOF(nsIInputStream* aIn,
- void* aClosure,
- const char* aBuffer,
- uint32_t aToOffset,
- uint32_t aCount,
- uint32_t* aWriteCount)
-{
- *static_cast<bool*>(aClosure) = true;
- *aWriteCount = 0;
- return NS_BINDING_ABORTED;
-}
-
-nsresult
-StreamCopier::FillOutputBuffer(char* aBuffer,
- uint32_t aCount,
- uint32_t* aCountRead)
-{
- nsresult rv = NS_OK;
- while (mChunked && mSeparator.IsEmpty() && !mChunkRemaining &&
- !mAddedFinalSeparator) {
- uint64_t avail;
- rv = mSource->Available(&avail);
- if (rv == NS_BASE_STREAM_CLOSED) {
- avail = 0;
- rv = NS_OK;
- }
- NS_ENSURE_SUCCESS(rv, rv);
-
- mChunkRemaining = avail > UINT32_MAX ? UINT32_MAX :
- static_cast<uint32_t>(avail);
-
- if (!mChunkRemaining) {
- // Either it's an non-blocking stream without any data
- // currently available, or we're at EOF. Sadly there's no way
- // to tell other than to read from the stream.
- bool hadData = false;
- uint32_t numRead;
- rv = mSource->ReadSegments(CheckForEOF, &hadData, 1, &numRead);
- if (rv == NS_BASE_STREAM_CLOSED) {
- avail = 0;
- rv = NS_OK;
- }
- NS_ENSURE_SUCCESS(rv, rv);
- MOZ_ASSERT(numRead == 0);
-
- if (hadData) {
- // The source received data between the call to Available and the
- // call to ReadSegments. Restart with a new call to Available
- continue;
- }
-
- // We're at EOF, write a separator with 0
- mAddedFinalSeparator = true;
- }
-
- if (mFirstChunk) {
- mFirstChunk = false;
- MOZ_ASSERT(mSeparator.IsEmpty());
- } else {
- // For all chunks except the first, add the newline at the end
- // of the previous chunk of data
- mSeparator.AssignLiteral("\r\n");
- }
- mSeparator.AppendInt(mChunkRemaining, 16);
- mSeparator.AppendLiteral("\r\n");
-
- if (mAddedFinalSeparator) {
- mSeparator.AppendLiteral("\r\n");
- }
-
- break;
- }
-
- // If we're doing chunked encoding, we should either have a chunk size,
- // or we should have reached the end of the input stream.
- MOZ_ASSERT_IF(mChunked, mChunkRemaining || mAddedFinalSeparator);
- // We should only have a separator if we're doing chunked encoding
- MOZ_ASSERT_IF(!mSeparator.IsEmpty(), mChunked);
-
- if (!mSeparator.IsEmpty()) {
- *aCountRead = std::min(mSeparator.Length(), aCount);
- memcpy(aBuffer, mSeparator.BeginReading(), *aCountRead);
- mSeparator.Cut(0, *aCountRead);
- rv = NS_OK;
- } else if (mChunked) {
- *aCountRead = 0;
- if (mChunkRemaining) {
- rv = mSource->Read(aBuffer,
- std::min(aCount, mChunkRemaining),
- aCountRead);
- mChunkRemaining -= *aCountRead;
- }
- } else {
- rv = mSource->Read(aBuffer, aCount, aCountRead);
- }
-
- if (NS_SUCCEEDED(rv) && *aCountRead == 0) {
- rv = NS_BASE_STREAM_CLOSED;
- }
-
- return rv;
-}
-
-NS_IMETHODIMP
-StreamCopier::Run()
-{
- nsresult rv;
- while (1) {
- WriteState state = { this, NS_OK };
- uint32_t written;
- rv = mSink->WriteSegments(FillOutputBufferHelper, &state,
- mozilla::net::nsIOService::gDefaultSegmentSize,
- &written);
- MOZ_ASSERT(NS_SUCCEEDED(rv) || NS_SUCCEEDED(state.sourceRv));
- if (rv == NS_BASE_STREAM_WOULD_BLOCK) {
- mSink->AsyncWait(this, 0, 0, mTarget);
- return NS_OK;
- }
- if (NS_FAILED(rv)) {
- mPromise.Resolve(rv, __func__);
- return NS_OK;
- }
-
- if (state.sourceRv == NS_BASE_STREAM_WOULD_BLOCK) {
- MOZ_ASSERT(mAsyncSource);
- mAsyncSource->AsyncWait(this, 0, 0, mTarget);
- mSink->AsyncWait(this, nsIAsyncInputStream::WAIT_CLOSURE_ONLY,
- 0, mTarget);
-
- return NS_OK;
- }
- if (state.sourceRv == NS_BASE_STREAM_CLOSED) {
- // We're done!
- // No longer interested in callbacks about either stream closing
- mSink->AsyncWait(nullptr, 0, 0, nullptr);
- if (mAsyncSource) {
- mAsyncSource->AsyncWait(nullptr, 0, 0, nullptr);
- }
-
- mSource->Close();
- mSource = nullptr;
- mAsyncSource = nullptr;
- mSink = nullptr;
-
- mPromise.Resolve(NS_OK, __func__);
-
- return NS_OK;
- }
-
- if (NS_FAILED(state.sourceRv)) {
- mPromise.Resolve(state.sourceRv, __func__);
- return NS_OK;
- }
- }
-
- MOZ_ASSUME_UNREACHABLE_MARKER();
-}
-
-NS_IMETHODIMP
-StreamCopier::OnInputStreamReady(nsIAsyncInputStream* aStream)
-{
- MOZ_ASSERT(aStream == mAsyncSource ||
- (!mSource && !mAsyncSource && !mSink));
- return mSource ? Run() : NS_OK;
-}
-
-NS_IMETHODIMP
-StreamCopier::OnOutputStreamReady(nsIAsyncOutputStream* aStream)
-{
- MOZ_ASSERT(aStream == mSink ||
- (!mSource && !mAsyncSource && !mSink));
- return mSource ? Run() : NS_OK;
-}
-
-} // namespace
-
-NS_IMETHODIMP
-HttpServer::Connection::OnOutputStreamReady(nsIAsyncOutputStream* aStream)
-{
- MOZ_ASSERT(aStream == mOutput || !mOutput);
- if (!mOutput) {
- return NS_OK;
- }
-
- nsresult rv;
-
- while (!mOutputBuffers.IsEmpty()) {
- if (!mOutputBuffers[0].mStream) {
- nsCString& buffer = mOutputBuffers[0].mString;
- while (!buffer.IsEmpty()) {
- uint32_t written = 0;
- rv = mOutput->Write(buffer.BeginReading(),
- buffer.Length(),
- &written);
-
- buffer.Cut(0, written);
-
- if (rv == NS_BASE_STREAM_WOULD_BLOCK) {
- return mOutput->AsyncWait(this, 0, 0, NS_GetCurrentThread());
- }
-
- if (NS_FAILED(rv)) {
- Close();
- return NS_OK;
- }
- }
- mOutputBuffers.RemoveElementAt(0);
- } else {
- if (mOutputCopy) {
- // we're already copying the stream
- return NS_OK;
- }
-
- mOutputCopy =
- StreamCopier::Copy(mOutputBuffers[0].mStream,
- mOutput,
- mOutputBuffers[0].mChunked);
-
- RefPtr<Connection> self = this;
-
- mOutputCopy->
- Then(AbstractThread::MainThread(),
- __func__,
- [self, this] (nsresult aStatus) {
- MOZ_ASSERT(mOutputBuffers[0].mStream);
- LOG_V("HttpServer::Connection::OnOutputStreamReady(%p) - "
- "Sent body. Status 0x%lx",
- this, aStatus);
-
- mOutputBuffers.RemoveElementAt(0);
- mOutputCopy = nullptr;
- OnOutputStreamReady(mOutput);
- },
- [] (bool) { MOZ_ASSERT_UNREACHABLE("Reject unexpected"); });
- }
- }
-
- if (mPendingRequests.IsEmpty()) {
- if (mCloseAfterRequest) {
- LOG_V("HttpServer::Connection::OnOutputStreamReady(%p) - Closing channel",
- this);
- Close();
- } else if (mWebSocketTransportProvider) {
- mInput->AsyncWait(nullptr, 0, 0, nullptr);
- mOutput->AsyncWait(nullptr, 0, 0, nullptr);
-
- mWebSocketTransportProvider->SetTransport(mTransport, mInput, mOutput);
- mTransport = nullptr;
- mInput = nullptr;
- mOutput = nullptr;
- mWebSocketTransportProvider = nullptr;
- }
- }
-
- return NS_OK;
-}
-
-void
-HttpServer::Connection::Close()
-{
- if (!mTransport) {
- MOZ_ASSERT(!mOutput && !mInput);
- return;
- }
-
- mTransport->Close(NS_BINDING_ABORTED);
- if (mInput) {
- mInput->Close();
- mInput = nullptr;
- }
- if (mOutput) {
- mOutput->Close();
- mOutput = nullptr;
- }
-
- mTransport = nullptr;
-
- mInputBuffer.Truncate();
- mOutputBuffers.Clear();
- mPendingRequests.Clear();
-}
-
-
-} // namespace net
-} // namespace mozilla
diff --git a/dom/flyweb/HttpServer.h b/dom/flyweb/HttpServer.h
deleted file mode 100644
index dab601c24..000000000
--- a/dom/flyweb/HttpServer.h
+++ /dev/null
@@ -1,193 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_HttpServer_h
-#define mozilla_dom_HttpServer_h
-
-#include "nsISupportsImpl.h"
-#include "mozilla/DOMEventTargetHelper.h"
-#include "nsITLSServerSocket.h"
-#include "nsIAsyncInputStream.h"
-#include "nsIAsyncOutputStream.h"
-#include "mozilla/Variant.h"
-#include "nsIRequestObserver.h"
-#include "mozilla/MozPromise.h"
-#include "nsITransportProvider.h"
-#include "nsILocalCertService.h"
-
-class nsIX509Cert;
-
-namespace mozilla {
-namespace dom {
-
-extern bool
-ContainsToken(const nsCString& aList, const nsCString& aToken);
-
-class InternalRequest;
-class InternalResponse;
-
-class HttpServerListener
-{
-public:
- // switch to NS_INLINE_DECL_PURE_VIRTUAL_REFCOUNTING when that lands
- NS_IMETHOD_(MozExternalRefCountType) AddRef(void) = 0;
- NS_IMETHOD_(MozExternalRefCountType) Release(void) = 0;
-
- virtual void OnServerStarted(nsresult aStatus) = 0;
- virtual void OnRequest(InternalRequest* aRequest) = 0;
- virtual void OnWebSocket(InternalRequest* aConnectRequest) = 0;
- virtual void OnServerClose() = 0;
-};
-
-class HttpServer final : public nsIServerSocketListener,
- public nsILocalCertGetCallback
-{
-public:
- HttpServer();
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSISERVERSOCKETLISTENER
- NS_DECL_NSILOCALCERTGETCALLBACK
-
- void Init(int32_t aPort, bool aHttps, HttpServerListener* aListener);
-
- void SendResponse(InternalRequest* aRequest, InternalResponse* aResponse);
- already_AddRefed<nsITransportProvider>
- AcceptWebSocket(InternalRequest* aConnectRequest,
- const Optional<nsAString>& aProtocol,
- ErrorResult& aRv);
- void SendWebSocketResponse(InternalRequest* aConnectRequest,
- InternalResponse* aResponse);
-
- void Close();
-
- void GetCertKey(nsACString& aKey);
-
- int32_t GetPort()
- {
- return mPort;
- }
-
-private:
- ~HttpServer();
-
- nsresult StartServerSocket(nsIX509Cert* aCert);
- void NotifyStarted(nsresult aStatus);
-
- class TransportProvider final : public nsITransportProvider
- {
- public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSITRANSPORTPROVIDER
-
- void SetTransport(nsISocketTransport* aTransport,
- nsIAsyncInputStream* aInput,
- nsIAsyncOutputStream* aOutput);
-
- private:
- virtual ~TransportProvider();
- void MaybeNotify();
-
- nsCOMPtr<nsIHttpUpgradeListener> mListener;
- nsCOMPtr<nsISocketTransport> mTransport;
- nsCOMPtr<nsIAsyncInputStream> mInput;
- nsCOMPtr<nsIAsyncOutputStream> mOutput;
- };
-
- class Connection final : public nsIInputStreamCallback
- , public nsIOutputStreamCallback
- , public nsITLSServerSecurityObserver
- {
- public:
- Connection(nsISocketTransport* aTransport,
- HttpServer* aServer,
- nsresult& rv);
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSIINPUTSTREAMCALLBACK
- NS_DECL_NSIOUTPUTSTREAMCALLBACK
- NS_DECL_NSITLSSERVERSECURITYOBSERVER
-
- bool TryHandleResponse(InternalRequest* aRequest,
- InternalResponse* aResponse);
- already_AddRefed<nsITransportProvider>
- HandleAcceptWebSocket(const Optional<nsAString>& aProtocol,
- ErrorResult& aRv);
- void HandleWebSocketResponse(InternalResponse* aResponse);
- bool HasPendingWebSocketRequest(InternalRequest* aRequest)
- {
- return aRequest == mPendingWebSocketRequest;
- }
-
- void Close();
-
- private:
- ~Connection();
-
- void SetSecurityObserver(bool aListen);
-
- static nsresult ReadSegmentsFunc(nsIInputStream* aIn,
- void* aClosure,
- const char* aBuffer,
- uint32_t aToOffset,
- uint32_t aCount,
- uint32_t* aWriteCount);
- nsresult ConsumeInput(const char*& aBuffer,
- const char* aEnd);
- nsresult ConsumeLine(const char* aBuffer,
- size_t aLength);
- void MaybeAddPendingHeader();
-
- void QueueResponse(InternalResponse* aResponse);
-
- RefPtr<HttpServer> mServer;
- nsCOMPtr<nsISocketTransport> mTransport;
- nsCOMPtr<nsIAsyncInputStream> mInput;
- nsCOMPtr<nsIAsyncOutputStream> mOutput;
-
- enum { eRequestLine, eHeaders, eBody, ePause } mState;
- RefPtr<InternalRequest> mPendingReq;
- uint32_t mPendingReqVersion;
- nsCString mInputBuffer;
- nsCString mPendingHeaderName;
- nsCString mPendingHeaderValue;
- uint32_t mRemainingBodySize;
- nsCOMPtr<nsIAsyncOutputStream> mCurrentRequestBody;
- bool mCloseAfterRequest;
-
- typedef Pair<RefPtr<InternalRequest>,
- RefPtr<InternalResponse>> PendingRequest;
- nsTArray<PendingRequest> mPendingRequests;
- RefPtr<MozPromise<nsresult, bool, false>> mOutputCopy;
-
- RefPtr<InternalRequest> mPendingWebSocketRequest;
- RefPtr<TransportProvider> mWebSocketTransportProvider;
-
- struct OutputBuffer {
- nsCString mString;
- nsCOMPtr<nsIInputStream> mStream;
- bool mChunked;
- };
-
- nsTArray<OutputBuffer> mOutputBuffers;
- };
-
- friend class Connection;
-
- RefPtr<HttpServerListener> mListener;
- nsCOMPtr<nsIServerSocket> mServerSocket;
- nsCOMPtr<nsIX509Cert> mCert;
-
- nsTArray<RefPtr<Connection>> mConnections;
-
- int32_t mPort;
- bool mHttps;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_HttpServer_h
diff --git a/dom/flyweb/PFlyWebPublishedServer.ipdl b/dom/flyweb/PFlyWebPublishedServer.ipdl
deleted file mode 100644
index 4d08a47fc..000000000
--- a/dom/flyweb/PFlyWebPublishedServer.ipdl
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et ft=cpp : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-include protocol PContent;
-include protocol PSendStream;
-include protocol PFileDescriptorSet;
-include protocol PTransportProvider;
-include FetchTypes;
-include ChannelInfo;
-include PBackgroundSharedTypes;
-
-namespace mozilla {
-namespace dom {
-
-async protocol PFlyWebPublishedServer
-{
- manager PContent;
-
-child:
- async ServerReady(nsresult aStatus);
- async FetchRequest(IPCInternalRequest aRequest, uint64_t aRequestId);
- async WebSocketRequest(IPCInternalRequest aRequest, uint64_t aRequestId,
- PTransportProvider aProvider);
- async ServerClose();
-
-parent:
- async __delete__();
-
- async FetchResponse(IPCInternalResponse aResponse, uint64_t aRequestId);
- async WebSocketResponse(IPCInternalResponse aResponse, uint64_t aRequestId);
- async WebSocketAccept(nsString aProtocol, uint64_t aRequestId);
-};
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/flyweb/moz.build b/dom/flyweb/moz.build
deleted file mode 100644
index aa8c034b7..000000000
--- a/dom/flyweb/moz.build
+++ /dev/null
@@ -1,42 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXPORTS.mozilla.dom += [
- 'FlyWebDiscoveryManager.h',
- 'FlyWebPublishedServer.h',
- 'FlyWebPublishedServerIPC.h',
- 'FlyWebPublishOptionsIPCSerializer.h',
- 'FlyWebServerEvents.h',
- 'FlyWebService.h',
- 'HttpServer.h',
-]
-
-UNIFIED_SOURCES += [
- 'FlyWebDiscoveryManager.cpp',
- 'FlyWebPublishedServer.cpp',
- 'FlyWebServerEvents.cpp',
- 'FlyWebService.cpp',
- 'HttpServer.cpp'
-]
-
-IPDL_SOURCES += [
- 'PFlyWebPublishedServer.ipdl',
-]
-
-FINAL_LIBRARY = 'xul'
-
-LOCAL_INCLUDES += [
- '/dom/base',
- '/netwerk/base',
- '/netwerk/dns',
- '/netwerk/protocol/websocket',
- '/xpcom/io'
-]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-if CONFIG['GNU_CXX']:
- CXXFLAGS += ['-Wshadow']
diff --git a/devtools/shared/heapsnapshot/.gitattributes b/dom/heapsnapshot/.gitattributes
index 44e248a8d..44e248a8d 100644
--- a/devtools/shared/heapsnapshot/.gitattributes
+++ b/dom/heapsnapshot/.gitattributes
diff --git a/devtools/shared/heapsnapshot/AutoMemMap.cpp b/dom/heapsnapshot/AutoMemMap.cpp
index e725a99c6..e725a99c6 100644
--- a/devtools/shared/heapsnapshot/AutoMemMap.cpp
+++ b/dom/heapsnapshot/AutoMemMap.cpp
diff --git a/devtools/shared/heapsnapshot/AutoMemMap.h b/dom/heapsnapshot/AutoMemMap.h
index 537d68004..537d68004 100644
--- a/devtools/shared/heapsnapshot/AutoMemMap.h
+++ b/dom/heapsnapshot/AutoMemMap.h
diff --git a/devtools/shared/heapsnapshot/CoreDump.pb.cc b/dom/heapsnapshot/CoreDump.pb.cc
index 6c7c0e8a4..6c7c0e8a4 100644
--- a/devtools/shared/heapsnapshot/CoreDump.pb.cc
+++ b/dom/heapsnapshot/CoreDump.pb.cc
diff --git a/devtools/shared/heapsnapshot/CoreDump.pb.h b/dom/heapsnapshot/CoreDump.pb.h
index 584c2e379..584c2e379 100644
--- a/devtools/shared/heapsnapshot/CoreDump.pb.h
+++ b/dom/heapsnapshot/CoreDump.pb.h
diff --git a/devtools/shared/heapsnapshot/CoreDump.proto b/dom/heapsnapshot/CoreDump.proto
index 24a223e11..24a223e11 100644
--- a/devtools/shared/heapsnapshot/CoreDump.proto
+++ b/dom/heapsnapshot/CoreDump.proto
diff --git a/devtools/shared/heapsnapshot/DeserializedNode.cpp b/dom/heapsnapshot/DeserializedNode.cpp
index fac4cccb9..fac4cccb9 100644
--- a/devtools/shared/heapsnapshot/DeserializedNode.cpp
+++ b/dom/heapsnapshot/DeserializedNode.cpp
diff --git a/devtools/shared/heapsnapshot/DeserializedNode.h b/dom/heapsnapshot/DeserializedNode.h
index 60d1fb408..60d1fb408 100644
--- a/devtools/shared/heapsnapshot/DeserializedNode.h
+++ b/dom/heapsnapshot/DeserializedNode.h
diff --git a/devtools/shared/heapsnapshot/DominatorTree.cpp b/dom/heapsnapshot/DominatorTree.cpp
index e53c196cf..e53c196cf 100644
--- a/devtools/shared/heapsnapshot/DominatorTree.cpp
+++ b/dom/heapsnapshot/DominatorTree.cpp
diff --git a/devtools/shared/heapsnapshot/DominatorTree.h b/dom/heapsnapshot/DominatorTree.h
index f785d4916..f785d4916 100644
--- a/devtools/shared/heapsnapshot/DominatorTree.h
+++ b/dom/heapsnapshot/DominatorTree.h
diff --git a/devtools/shared/heapsnapshot/FileDescriptorOutputStream.cpp b/dom/heapsnapshot/FileDescriptorOutputStream.cpp
index 72a289558..72a289558 100644
--- a/devtools/shared/heapsnapshot/FileDescriptorOutputStream.cpp
+++ b/dom/heapsnapshot/FileDescriptorOutputStream.cpp
diff --git a/devtools/shared/heapsnapshot/FileDescriptorOutputStream.h b/dom/heapsnapshot/FileDescriptorOutputStream.h
index 6990f1fc3..6990f1fc3 100644
--- a/devtools/shared/heapsnapshot/FileDescriptorOutputStream.h
+++ b/dom/heapsnapshot/FileDescriptorOutputStream.h
diff --git a/devtools/shared/heapsnapshot/HeapSnapshot.cpp b/dom/heapsnapshot/HeapSnapshot.cpp
index 299a96a9c..299a96a9c 100644
--- a/devtools/shared/heapsnapshot/HeapSnapshot.cpp
+++ b/dom/heapsnapshot/HeapSnapshot.cpp
diff --git a/devtools/shared/heapsnapshot/HeapSnapshot.h b/dom/heapsnapshot/HeapSnapshot.h
index 12dfa4c2b..12dfa4c2b 100644
--- a/devtools/shared/heapsnapshot/HeapSnapshot.h
+++ b/dom/heapsnapshot/HeapSnapshot.h
diff --git a/devtools/shared/heapsnapshot/HeapSnapshotTempFileHelperChild.h b/dom/heapsnapshot/HeapSnapshotTempFileHelperChild.h
index a1d433a5e..a1d433a5e 100644
--- a/devtools/shared/heapsnapshot/HeapSnapshotTempFileHelperChild.h
+++ b/dom/heapsnapshot/HeapSnapshotTempFileHelperChild.h
diff --git a/devtools/shared/heapsnapshot/HeapSnapshotTempFileHelperParent.cpp b/dom/heapsnapshot/HeapSnapshotTempFileHelperParent.cpp
index 7246a9daa..7246a9daa 100644
--- a/devtools/shared/heapsnapshot/HeapSnapshotTempFileHelperParent.cpp
+++ b/dom/heapsnapshot/HeapSnapshotTempFileHelperParent.cpp
diff --git a/devtools/shared/heapsnapshot/HeapSnapshotTempFileHelperParent.h b/dom/heapsnapshot/HeapSnapshotTempFileHelperParent.h
index 1582279da..1582279da 100644
--- a/devtools/shared/heapsnapshot/HeapSnapshotTempFileHelperParent.h
+++ b/dom/heapsnapshot/HeapSnapshotTempFileHelperParent.h
diff --git a/devtools/shared/heapsnapshot/PHeapSnapshotTempFileHelper.ipdl b/dom/heapsnapshot/PHeapSnapshotTempFileHelper.ipdl
index 2576470e2..2576470e2 100644
--- a/devtools/shared/heapsnapshot/PHeapSnapshotTempFileHelper.ipdl
+++ b/dom/heapsnapshot/PHeapSnapshotTempFileHelper.ipdl
diff --git a/devtools/shared/heapsnapshot/ZeroCopyNSIOutputStream.cpp b/dom/heapsnapshot/ZeroCopyNSIOutputStream.cpp
index 0c29db7f9..0c29db7f9 100644
--- a/devtools/shared/heapsnapshot/ZeroCopyNSIOutputStream.cpp
+++ b/dom/heapsnapshot/ZeroCopyNSIOutputStream.cpp
diff --git a/devtools/shared/heapsnapshot/ZeroCopyNSIOutputStream.h b/dom/heapsnapshot/ZeroCopyNSIOutputStream.h
index 117fc0f87..117fc0f87 100644
--- a/devtools/shared/heapsnapshot/ZeroCopyNSIOutputStream.h
+++ b/dom/heapsnapshot/ZeroCopyNSIOutputStream.h
diff --git a/devtools/shared/heapsnapshot/generate-core-dump-sources.sh b/dom/heapsnapshot/generate-core-dump-sources.sh
index 97e492ff0..97e492ff0 100755..100644
--- a/devtools/shared/heapsnapshot/generate-core-dump-sources.sh
+++ b/dom/heapsnapshot/generate-core-dump-sources.sh
diff --git a/dom/heapsnapshot/moz.build b/dom/heapsnapshot/moz.build
new file mode 100644
index 000000000..3fb6b0552
--- /dev/null
+++ b/dom/heapsnapshot/moz.build
@@ -0,0 +1,52 @@
+# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
+# vim: set filetype=python:
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+with Files('**'):
+ BUG_COMPONENT = ('Firefox', 'Developer Tools: Memory')
+
+if CONFIG['ENABLE_TESTS']:
+ DIRS += ['tests/gtest']
+
+XPCSHELL_TESTS_MANIFESTS += [ 'tests/unit/xpcshell.ini' ]
+MOCHITEST_MANIFESTS += [ 'tests/mochitest/mochitest.ini' ]
+MOCHITEST_CHROME_MANIFESTS += [ 'tests/mochitest/chrome.ini' ]
+
+EXPORTS.mozilla.devtools += [
+ 'AutoMemMap.h',
+ 'CoreDump.pb.h',
+ 'DeserializedNode.h',
+ 'DominatorTree.h',
+ 'FileDescriptorOutputStream.h',
+ 'HeapSnapshot.h',
+ 'HeapSnapshotTempFileHelperChild.h',
+ 'HeapSnapshotTempFileHelperParent.h',
+ 'ZeroCopyNSIOutputStream.h',
+]
+
+IPDL_SOURCES += [
+ 'PHeapSnapshotTempFileHelper.ipdl',
+]
+
+include('/ipc/chromium/chromium-config.mozbuild')
+
+SOURCES += [
+ 'AutoMemMap.cpp',
+ 'CoreDump.pb.cc',
+ 'DeserializedNode.cpp',
+ 'DominatorTree.cpp',
+ 'FileDescriptorOutputStream.cpp',
+ 'HeapSnapshot.cpp',
+ 'HeapSnapshotTempFileHelperParent.cpp',
+ 'ZeroCopyNSIOutputStream.cpp',
+]
+
+# Disable RTTI in google protocol buffer
+DEFINES['GOOGLE_PROTOBUF_NO_RTTI'] = True
+
+FINAL_LIBRARY = 'xul'
+
+if CONFIG['GNU_CXX']:
+ CXXFLAGS += ['-Wno-error=shadow']
diff --git a/devtools/shared/heapsnapshot/tests/gtest/DeserializedNodeUbiNodes.cpp b/dom/heapsnapshot/tests/gtest/DeserializedNodeUbiNodes.cpp
index e236a0acf..e236a0acf 100644
--- a/devtools/shared/heapsnapshot/tests/gtest/DeserializedNodeUbiNodes.cpp
+++ b/dom/heapsnapshot/tests/gtest/DeserializedNodeUbiNodes.cpp
diff --git a/devtools/shared/heapsnapshot/tests/gtest/DeserializedStackFrameUbiStackFrames.cpp b/dom/heapsnapshot/tests/gtest/DeserializedStackFrameUbiStackFrames.cpp
index 72e363934..72e363934 100644
--- a/devtools/shared/heapsnapshot/tests/gtest/DeserializedStackFrameUbiStackFrames.cpp
+++ b/dom/heapsnapshot/tests/gtest/DeserializedStackFrameUbiStackFrames.cpp
diff --git a/devtools/shared/heapsnapshot/tests/gtest/DevTools.h b/dom/heapsnapshot/tests/gtest/DevTools.h
index 6eb5cfe21..6eb5cfe21 100644
--- a/devtools/shared/heapsnapshot/tests/gtest/DevTools.h
+++ b/dom/heapsnapshot/tests/gtest/DevTools.h
diff --git a/devtools/shared/heapsnapshot/tests/gtest/DoesCrossCompartmentBoundaries.cpp b/dom/heapsnapshot/tests/gtest/DoesCrossCompartmentBoundaries.cpp
index bc517d6d9..bc517d6d9 100644
--- a/devtools/shared/heapsnapshot/tests/gtest/DoesCrossCompartmentBoundaries.cpp
+++ b/dom/heapsnapshot/tests/gtest/DoesCrossCompartmentBoundaries.cpp
diff --git a/devtools/shared/heapsnapshot/tests/gtest/DoesntCrossCompartmentBoundaries.cpp b/dom/heapsnapshot/tests/gtest/DoesntCrossCompartmentBoundaries.cpp
index 2fe5e6ace..2fe5e6ace 100644
--- a/devtools/shared/heapsnapshot/tests/gtest/DoesntCrossCompartmentBoundaries.cpp
+++ b/dom/heapsnapshot/tests/gtest/DoesntCrossCompartmentBoundaries.cpp
diff --git a/devtools/shared/heapsnapshot/tests/gtest/SerializesEdgeNames.cpp b/dom/heapsnapshot/tests/gtest/SerializesEdgeNames.cpp
index be135dbb4..be135dbb4 100644
--- a/devtools/shared/heapsnapshot/tests/gtest/SerializesEdgeNames.cpp
+++ b/dom/heapsnapshot/tests/gtest/SerializesEdgeNames.cpp
diff --git a/devtools/shared/heapsnapshot/tests/gtest/SerializesEverythingInHeapGraphOnce.cpp b/dom/heapsnapshot/tests/gtest/SerializesEverythingInHeapGraphOnce.cpp
index 475442df8..475442df8 100644
--- a/devtools/shared/heapsnapshot/tests/gtest/SerializesEverythingInHeapGraphOnce.cpp
+++ b/dom/heapsnapshot/tests/gtest/SerializesEverythingInHeapGraphOnce.cpp
diff --git a/devtools/shared/heapsnapshot/tests/gtest/SerializesTypeNames.cpp b/dom/heapsnapshot/tests/gtest/SerializesTypeNames.cpp
index a259c297b..a259c297b 100644
--- a/devtools/shared/heapsnapshot/tests/gtest/SerializesTypeNames.cpp
+++ b/dom/heapsnapshot/tests/gtest/SerializesTypeNames.cpp
diff --git a/devtools/shared/heapsnapshot/tests/gtest/moz.build b/dom/heapsnapshot/tests/gtest/moz.build
index 08c31e47c..08c31e47c 100644
--- a/devtools/shared/heapsnapshot/tests/gtest/moz.build
+++ b/dom/heapsnapshot/tests/gtest/moz.build
diff --git a/devtools/shared/heapsnapshot/tests/mochitest/chrome.ini b/dom/heapsnapshot/tests/mochitest/chrome.ini
index 497b6fe37..497b6fe37 100644
--- a/devtools/shared/heapsnapshot/tests/mochitest/chrome.ini
+++ b/dom/heapsnapshot/tests/mochitest/chrome.ini
diff --git a/devtools/shared/heapsnapshot/tests/mochitest/mochitest.ini b/dom/heapsnapshot/tests/mochitest/mochitest.ini
index 5e7aa8d10..5e7aa8d10 100644
--- a/devtools/shared/heapsnapshot/tests/mochitest/mochitest.ini
+++ b/dom/heapsnapshot/tests/mochitest/mochitest.ini
diff --git a/devtools/shared/heapsnapshot/tests/mochitest/test_DominatorTree_01.html b/dom/heapsnapshot/tests/mochitest/test_DominatorTree_01.html
index 1f9d8c080..1f9d8c080 100644
--- a/devtools/shared/heapsnapshot/tests/mochitest/test_DominatorTree_01.html
+++ b/dom/heapsnapshot/tests/mochitest/test_DominatorTree_01.html
diff --git a/devtools/shared/heapsnapshot/tests/mochitest/test_SaveHeapSnapshot.html b/dom/heapsnapshot/tests/mochitest/test_SaveHeapSnapshot.html
index f150a99c7..f150a99c7 100644
--- a/devtools/shared/heapsnapshot/tests/mochitest/test_SaveHeapSnapshot.html
+++ b/dom/heapsnapshot/tests/mochitest/test_SaveHeapSnapshot.html
diff --git a/devtools/shared/heapsnapshot/tests/mochitest/test_saveHeapSnapshot_e10s_01.html b/dom/heapsnapshot/tests/mochitest/test_saveHeapSnapshot_e10s_01.html
index 15f88f8e0..15f88f8e0 100644
--- a/devtools/shared/heapsnapshot/tests/mochitest/test_saveHeapSnapshot_e10s_01.html
+++ b/dom/heapsnapshot/tests/mochitest/test_saveHeapSnapshot_e10s_01.html
diff --git a/devtools/shared/heapsnapshot/tests/unit/.eslintrc.js b/dom/heapsnapshot/tests/unit/.eslintrc.js
index 59adf410a..59adf410a 100644
--- a/devtools/shared/heapsnapshot/tests/unit/.eslintrc.js
+++ b/dom/heapsnapshot/tests/unit/.eslintrc.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/Census.jsm b/dom/heapsnapshot/tests/unit/Census.jsm
index f8fb1ce44..f8fb1ce44 100644
--- a/devtools/shared/heapsnapshot/tests/unit/Census.jsm
+++ b/dom/heapsnapshot/tests/unit/Census.jsm
diff --git a/devtools/shared/heapsnapshot/tests/unit/Match.jsm b/dom/heapsnapshot/tests/unit/Match.jsm
index c29e6484e..c29e6484e 100644
--- a/devtools/shared/heapsnapshot/tests/unit/Match.jsm
+++ b/dom/heapsnapshot/tests/unit/Match.jsm
diff --git a/devtools/shared/heapsnapshot/tests/unit/dominator-tree-worker.js b/dom/heapsnapshot/tests/unit/dominator-tree-worker.js
index 1f49ca841..1f49ca841 100644
--- a/devtools/shared/heapsnapshot/tests/unit/dominator-tree-worker.js
+++ b/dom/heapsnapshot/tests/unit/dominator-tree-worker.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/head_heapsnapshot.js b/dom/heapsnapshot/tests/unit/head_heapsnapshot.js
index 3171c8a6f..3171c8a6f 100644
--- a/devtools/shared/heapsnapshot/tests/unit/head_heapsnapshot.js
+++ b/dom/heapsnapshot/tests/unit/head_heapsnapshot.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/heap-snapshot-worker.js b/dom/heapsnapshot/tests/unit/heap-snapshot-worker.js
index 10ee70cec..10ee70cec 100644
--- a/devtools/shared/heapsnapshot/tests/unit/heap-snapshot-worker.js
+++ b/dom/heapsnapshot/tests/unit/heap-snapshot-worker.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_01.js b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_01.js
index 845a0d263..845a0d263 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_01.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_02.js b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_02.js
index e1f32de58..e1f32de58 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_02.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_02.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_03.js b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_03.js
index ad35dcec1..ad35dcec1 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_03.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_03.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_04.js b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_04.js
index 566ad0dab..566ad0dab 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_04.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_LabelAndShallowSize_04.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_attachShortestPaths_01.js b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_attachShortestPaths_01.js
index 24e8e2eb5..24e8e2eb5 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_attachShortestPaths_01.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_attachShortestPaths_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_getNodeByIdAlongPath_01.js b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_getNodeByIdAlongPath_01.js
index de2907809..de2907809 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_getNodeByIdAlongPath_01.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_getNodeByIdAlongPath_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_01.js b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_01.js
index 979232ff4..979232ff4 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_01.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_02.js b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_02.js
index 9a8d11d0b..9a8d11d0b 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_02.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_02.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_03.js b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_03.js
index f8cb5eec3..f8cb5eec3 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_03.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_insert_03.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_partialTraversal_01.js b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_partialTraversal_01.js
index 78ec47b64..78ec47b64 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTreeNode_partialTraversal_01.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTreeNode_partialTraversal_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_01.js b/dom/heapsnapshot/tests/unit/test_DominatorTree_01.js
index e8145f658..e8145f658 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_01.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTree_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_02.js b/dom/heapsnapshot/tests/unit/test_DominatorTree_02.js
index a518f8a27..a518f8a27 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_02.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTree_02.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_03.js b/dom/heapsnapshot/tests/unit/test_DominatorTree_03.js
index 0a14ce53d..0a14ce53d 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_03.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTree_03.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_04.js b/dom/heapsnapshot/tests/unit/test_DominatorTree_04.js
index e5aef3fec..e5aef3fec 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_04.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTree_04.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_05.js b/dom/heapsnapshot/tests/unit/test_DominatorTree_05.js
index c07cee994..c07cee994 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_05.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTree_05.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_06.js b/dom/heapsnapshot/tests/unit/test_DominatorTree_06.js
index 680478623..680478623 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_DominatorTree_06.js
+++ b/dom/heapsnapshot/tests/unit/test_DominatorTree_06.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_01.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_01.js
index 0114e0b69..0114e0b69 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_02.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_02.js
index 6e3f5b257..6e3f5b257 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_02.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_computeDominatorTree_02.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_01.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_01.js
index 7708de93c..7708de93c 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_02.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_02.js
index 3e25ddac4..3e25ddac4 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_02.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_02.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_03.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_03.js
index e648c9407..e648c9407 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_03.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_deleteHeapSnapshot_03.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCensusIndividuals_01.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_getCensusIndividuals_01.js
index b63ad4230..b63ad4230 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCensusIndividuals_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_getCensusIndividuals_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCreationTime_01.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_getCreationTime_01.js
index 5df79de7a..5df79de7a 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getCreationTime_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_getCreationTime_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_01.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_01.js
index cedea5375..cedea5375 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_02.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_02.js
index fd29beece..fd29beece 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_02.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_getDominatorTree_02.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getImmediatelyDominated_01.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_getImmediatelyDominated_01.js
index caf1c2056..caf1c2056 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_getImmediatelyDominated_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_getImmediatelyDominated_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_readHeapSnapshot_01.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_readHeapSnapshot_01.js
index 0d0d58bef..0d0d58bef 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_readHeapSnapshot_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_readHeapSnapshot_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_01.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_01.js
index 6f22cbad3..6f22cbad3 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_02.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_02.js
index f1ba9ce84..f1ba9ce84 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_02.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensusDiff_02.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_01.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_01.js
index e26981db4..e26981db4 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_02.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_02.js
index 34494af70..34494af70 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_02.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_02.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_03.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_03.js
index 486e250b5..486e250b5 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_03.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_03.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js
index 769a2d99d..769a2d99d 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_04.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_05.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_05.js
index 7e16d9f00..7e16d9f00 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_05.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_05.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_06.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_06.js
index 7795a9700..7795a9700 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_06.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_06.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_07.js b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_07.js
index 986b3aaa8..986b3aaa8 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_07.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapAnalyses_takeCensus_07.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_01.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_01.js
index 2ec577bd0..2ec577bd0 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_02.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_02.js
index 04fe58733..04fe58733 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_02.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_computeShortestPaths_02.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_creationTime_01.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_creationTime_01.js
index 0d08fea16..0d08fea16 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_creationTime_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_creationTime_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_deepStack_01.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_deepStack_01.js
index 9eb11d9af..9eb11d9af 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_deepStack_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_deepStack_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_describeNode_01.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_describeNode_01.js
index d79cb5a7b..d79cb5a7b 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_describeNode_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_describeNode_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_01.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_01.js
index f3b3090b0..f3b3090b0 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_01.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_02.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_02.js
index 680ac9b58..680ac9b58 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_02.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_02.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_03.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_03.js
index 25f2c3791..25f2c3791 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_03.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_03.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_04.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_04.js
index 799844cde..799844cde 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_04.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_04.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_05.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_05.js
index da6067624..da6067624 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_05.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_05.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_06.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_06.js
index 0412410c0..0412410c0 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_06.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_06.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_07.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_07.js
index f5c36056f..f5c36056f 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_07.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_07.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_08.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_08.js
index 5934aa919..5934aa919 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_08.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_08.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_09.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_09.js
index bbacccc8d..bbacccc8d 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_09.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_09.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_10.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_10.js
index a7f987f5a..a7f987f5a 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_10.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_10.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_11.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_11.js
index 3d898b2d1..3d898b2d1 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_11.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_11.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_12.js b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_12.js
index f10dd5b03..f10dd5b03 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_12.js
+++ b/dom/heapsnapshot/tests/unit/test_HeapSnapshot_takeCensus_12.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot.js b/dom/heapsnapshot/tests/unit/test_ReadHeapSnapshot.js
index dde139ffd..dde139ffd 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot.js
+++ b/dom/heapsnapshot/tests/unit/test_ReadHeapSnapshot.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot_with_allocations.js b/dom/heapsnapshot/tests/unit/test_ReadHeapSnapshot_with_allocations.js
index d91f36f56..d91f36f56 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot_with_allocations.js
+++ b/dom/heapsnapshot/tests/unit/test_ReadHeapSnapshot_with_allocations.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot_worker.js b/dom/heapsnapshot/tests/unit/test_ReadHeapSnapshot_worker.js
index 76461b694..76461b694 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_ReadHeapSnapshot_worker.js
+++ b/dom/heapsnapshot/tests/unit/test_ReadHeapSnapshot_worker.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_SaveHeapSnapshot.js b/dom/heapsnapshot/tests/unit/test_SaveHeapSnapshot.js
index affd8d1e4..affd8d1e4 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_SaveHeapSnapshot.js
+++ b/dom/heapsnapshot/tests/unit/test_SaveHeapSnapshot.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-01.js b/dom/heapsnapshot/tests/unit/test_census-tree-node-01.js
index 16038c5c4..16038c5c4 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-01.js
+++ b/dom/heapsnapshot/tests/unit/test_census-tree-node-01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-02.js b/dom/heapsnapshot/tests/unit/test_census-tree-node-02.js
index 37d039954..37d039954 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-02.js
+++ b/dom/heapsnapshot/tests/unit/test_census-tree-node-02.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-03.js b/dom/heapsnapshot/tests/unit/test_census-tree-node-03.js
index bdf932099..bdf932099 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-03.js
+++ b/dom/heapsnapshot/tests/unit/test_census-tree-node-03.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-04.js b/dom/heapsnapshot/tests/unit/test_census-tree-node-04.js
index cc0c3bac0..cc0c3bac0 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-04.js
+++ b/dom/heapsnapshot/tests/unit/test_census-tree-node-04.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-05.js b/dom/heapsnapshot/tests/unit/test_census-tree-node-05.js
index 20fb76bd2..20fb76bd2 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-05.js
+++ b/dom/heapsnapshot/tests/unit/test_census-tree-node-05.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-06.js b/dom/heapsnapshot/tests/unit/test_census-tree-node-06.js
index eb1801207..eb1801207 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-06.js
+++ b/dom/heapsnapshot/tests/unit/test_census-tree-node-06.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-07.js b/dom/heapsnapshot/tests/unit/test_census-tree-node-07.js
index 6bc085257..6bc085257 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-07.js
+++ b/dom/heapsnapshot/tests/unit/test_census-tree-node-07.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-08.js b/dom/heapsnapshot/tests/unit/test_census-tree-node-08.js
index 1c686c810..1c686c810 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-08.js
+++ b/dom/heapsnapshot/tests/unit/test_census-tree-node-08.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-09.js b/dom/heapsnapshot/tests/unit/test_census-tree-node-09.js
index 3efed04b0..3efed04b0 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-09.js
+++ b/dom/heapsnapshot/tests/unit/test_census-tree-node-09.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-10.js b/dom/heapsnapshot/tests/unit/test_census-tree-node-10.js
index b7798f23f..b7798f23f 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census-tree-node-10.js
+++ b/dom/heapsnapshot/tests/unit/test_census-tree-node-10.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_01.js b/dom/heapsnapshot/tests/unit/test_census_diff_01.js
index 75977bccb..75977bccb 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_01.js
+++ b/dom/heapsnapshot/tests/unit/test_census_diff_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_02.js b/dom/heapsnapshot/tests/unit/test_census_diff_02.js
index 169e3f036..169e3f036 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_02.js
+++ b/dom/heapsnapshot/tests/unit/test_census_diff_02.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_03.js b/dom/heapsnapshot/tests/unit/test_census_diff_03.js
index 6dbca3e40..6dbca3e40 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_03.js
+++ b/dom/heapsnapshot/tests/unit/test_census_diff_03.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_04.js b/dom/heapsnapshot/tests/unit/test_census_diff_04.js
index a10097945..a10097945 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_04.js
+++ b/dom/heapsnapshot/tests/unit/test_census_diff_04.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_05.js b/dom/heapsnapshot/tests/unit/test_census_diff_05.js
index b6d99f823..b6d99f823 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_05.js
+++ b/dom/heapsnapshot/tests/unit/test_census_diff_05.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_06.js b/dom/heapsnapshot/tests/unit/test_census_diff_06.js
index 430ff8c9c..430ff8c9c 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_diff_06.js
+++ b/dom/heapsnapshot/tests/unit/test_census_diff_06.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_01.js b/dom/heapsnapshot/tests/unit/test_census_filtering_01.js
index 57724d7c1..57724d7c1 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_01.js
+++ b/dom/heapsnapshot/tests/unit/test_census_filtering_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_02.js b/dom/heapsnapshot/tests/unit/test_census_filtering_02.js
index 0a57ce66d..0a57ce66d 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_02.js
+++ b/dom/heapsnapshot/tests/unit/test_census_filtering_02.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_03.js b/dom/heapsnapshot/tests/unit/test_census_filtering_03.js
index 2c69a14b8..2c69a14b8 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_03.js
+++ b/dom/heapsnapshot/tests/unit/test_census_filtering_03.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_04.js b/dom/heapsnapshot/tests/unit/test_census_filtering_04.js
index c9871436b..c9871436b 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_04.js
+++ b/dom/heapsnapshot/tests/unit/test_census_filtering_04.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_05.js b/dom/heapsnapshot/tests/unit/test_census_filtering_05.js
index 1d1f4fa55..1d1f4fa55 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_census_filtering_05.js
+++ b/dom/heapsnapshot/tests/unit/test_census_filtering_05.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_countToBucketBreakdown_01.js b/dom/heapsnapshot/tests/unit/test_countToBucketBreakdown_01.js
index e89048c33..e89048c33 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_countToBucketBreakdown_01.js
+++ b/dom/heapsnapshot/tests/unit/test_countToBucketBreakdown_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_deduplicatePaths_01.js b/dom/heapsnapshot/tests/unit/test_deduplicatePaths_01.js
index 418b49db3..418b49db3 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_deduplicatePaths_01.js
+++ b/dom/heapsnapshot/tests/unit/test_deduplicatePaths_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_getCensusIndividuals_01.js b/dom/heapsnapshot/tests/unit/test_getCensusIndividuals_01.js
index 9c4f60991..9c4f60991 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_getCensusIndividuals_01.js
+++ b/dom/heapsnapshot/tests/unit/test_getCensusIndividuals_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_getReportLeaves_01.js b/dom/heapsnapshot/tests/unit/test_getReportLeaves_01.js
index 4c4298b6a..4c4298b6a 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_getReportLeaves_01.js
+++ b/dom/heapsnapshot/tests/unit/test_getReportLeaves_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/test_saveHeapSnapshot_e10s_01.js b/dom/heapsnapshot/tests/unit/test_saveHeapSnapshot_e10s_01.js
index 067b9effb..067b9effb 100644
--- a/devtools/shared/heapsnapshot/tests/unit/test_saveHeapSnapshot_e10s_01.js
+++ b/dom/heapsnapshot/tests/unit/test_saveHeapSnapshot_e10s_01.js
diff --git a/devtools/shared/heapsnapshot/tests/unit/xpcshell.ini b/dom/heapsnapshot/tests/unit/xpcshell.ini
index f84b282d1..f84b282d1 100644
--- a/devtools/shared/heapsnapshot/tests/unit/xpcshell.ini
+++ b/dom/heapsnapshot/tests/unit/xpcshell.ini
diff --git a/dom/html/HTMLLabelElement.h b/dom/html/HTMLLabelElement.h
index c8385fc53..4057ffef6 100644
--- a/dom/html/HTMLLabelElement.h
+++ b/dom/html/HTMLLabelElement.h
@@ -59,8 +59,6 @@ public:
using nsGenericHTMLElement::Focus;
virtual void Focus(mozilla::ErrorResult& aError) override;
- virtual bool IsDisabled() const override { return false; }
-
// nsIContent
virtual nsresult PostHandleEvent(
EventChainPostVisitor& aVisitor) override;
diff --git a/dom/html/HTMLMediaElement.cpp b/dom/html/HTMLMediaElement.cpp
index f3ef20bfc..bc63eab51 100644
--- a/dom/html/HTMLMediaElement.cpp
+++ b/dom/html/HTMLMediaElement.cpp
@@ -1871,6 +1871,20 @@ nsresult HTMLMediaElement::LoadResource()
// Set the media element's CORS mode only when loading a resource
mCORSMode = AttrValueToCORSMode(GetParsedAttr(nsGkAtoms::crossorigin));
+#ifdef MOZ_EME
+ bool isBlob = false;
+ if (mMediaKeys &&
+ Preferences::GetBool("media.eme.mse-only", true) &&
+ // We only want mediaSource URLs, but they are BlobURL, so we have to
+ // check the schema and abort if they are not MediaStream or real Blob.
+ (NS_FAILED(mLoadingSrc->SchemeIs(BLOBURI_SCHEME, &isBlob)) ||
+ !isBlob ||
+ IsMediaStreamURI(mLoadingSrc) ||
+ IsBlobURI(mLoadingSrc))) {
+ return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
+ }
+#endif
+
HTMLMediaElement* other = LookupMediaElementURITable(mLoadingSrc);
if (other && other->mDecoder) {
// Clone it.
@@ -4000,7 +4014,6 @@ nsresult HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder,
return NS_ERROR_FAILURE;
}
}
-#endif
MediaEventSource<void>* waitingForKeyProducer = mDecoder->WaitingForKeyEvent();
// Not every decoder will produce waitingForKey events, only add ones that can
@@ -4008,6 +4021,7 @@ nsresult HTMLMediaElement::FinishDecoderSetup(MediaDecoder* aDecoder,
mWaitingForKeyListener = waitingForKeyProducer->Connect(
AbstractThread::MainThread(), this, &HTMLMediaElement::CannotDecryptWaitingForKey);
}
+#endif
if (mChannelLoader) {
mChannelLoader->Done();
@@ -6476,7 +6490,6 @@ HTMLMediaElement::GetTopLevelPrincipal()
principal = doc->NodePrincipal();
return principal.forget();
}
-#endif //MOZ_EME
void
HTMLMediaElement::CannotDecryptWaitingForKey()
@@ -6495,6 +6508,7 @@ HTMLMediaElement::CannotDecryptWaitingForKey()
UpdateReadyStateInternal();
}
}
+#endif //MOZ_EME
NS_IMETHODIMP HTMLMediaElement::WindowAudioCaptureChanged(bool aCapture)
{
diff --git a/dom/html/HTMLObjectElement.h b/dom/html/HTMLObjectElement.h
index 4041b78a3..5226154da 100644
--- a/dom/html/HTMLObjectElement.h
+++ b/dom/html/HTMLObjectElement.h
@@ -77,8 +77,6 @@ public:
NS_IMETHOD Reset() override;
NS_IMETHOD SubmitNamesValues(HTMLFormSubmission *aFormSubmission) override;
- virtual bool IsDisabled() const override { return false; }
-
virtual void DoneAddingChildren(bool aHaveNotified) override;
virtual bool IsDoneAddingChildren() override;
diff --git a/dom/html/HTMLOptGroupElement.cpp b/dom/html/HTMLOptGroupElement.cpp
index 8a044fbf3..9e738961d 100644
--- a/dom/html/HTMLOptGroupElement.cpp
+++ b/dom/html/HTMLOptGroupElement.cpp
@@ -53,15 +53,14 @@ HTMLOptGroupElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
aVisitor.mCanHandle = false;
// Do not process any DOM events if the element is disabled
// XXXsmaug This is not the right thing to do. But what is?
- if (HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) {
+ if (IsDisabled()) {
return NS_OK;
}
- nsIFrame* frame = GetPrimaryFrame();
- if (frame) {
- const nsStyleUserInterface* uiStyle = frame->StyleUserInterface();
- if (uiStyle->mUserInput == StyleUserInput::None ||
- uiStyle->mUserInput == StyleUserInput::Disabled) {
+ if (nsIFrame* frame = GetPrimaryFrame()) {
+ // FIXME(emilio): This poking at the style of the frame is broken unless we
+ // flush before every event handling, which we don't really want to.
+ if (frame->StyleUserInterface()->mUserInput == StyleUserInput::None) {
return NS_OK;
}
}
diff --git a/dom/html/HTMLOptGroupElement.h b/dom/html/HTMLOptGroupElement.h
index d53a2e32b..e46a6a953 100644
--- a/dom/html/HTMLOptGroupElement.h
+++ b/dom/html/HTMLOptGroupElement.h
@@ -46,10 +46,6 @@ public:
virtual nsIDOMNode* AsDOMNode() override { return this; }
- virtual bool IsDisabled() const override {
- return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
- }
-
bool Disabled() const
{
return GetBoolAttr(nsGkAtoms::disabled);
diff --git a/dom/html/HTMLOptionElement.h b/dom/html/HTMLOptionElement.h
index e220b84df..4b5e192ff 100644
--- a/dom/html/HTMLOptionElement.h
+++ b/dom/html/HTMLOptionElement.h
@@ -67,10 +67,6 @@ public:
nsresult CopyInnerTo(mozilla::dom::Element* aDest);
- virtual bool IsDisabled() const override {
- return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
- }
-
bool Disabled() const
{
return GetBoolAttr(nsGkAtoms::disabled);
diff --git a/dom/html/HTMLOutputElement.h b/dom/html/HTMLOutputElement.h
index 588262480..6b6c3f66c 100644
--- a/dom/html/HTMLOutputElement.h
+++ b/dom/html/HTMLOutputElement.h
@@ -35,8 +35,6 @@ public:
NS_IMETHOD Reset() override;
NS_IMETHOD SubmitNamesValues(HTMLFormSubmission* aFormSubmission) override;
- virtual bool IsDisabled() const override { return false; }
-
nsresult Clone(mozilla::dom::NodeInfo* aNodeInfo, nsINode** aResult) const override;
bool ParseAttribute(int32_t aNamespaceID, nsIAtom* aAttribute,
diff --git a/dom/html/HTMLTableCellElement.cpp b/dom/html/HTMLTableCellElement.cpp
index d00d60400..1cf413413 100644
--- a/dom/html/HTMLTableCellElement.cpp
+++ b/dom/html/HTMLTableCellElement.cpp
@@ -390,26 +390,16 @@ HTMLTableCellElement::ParseAttribute(int32_t aNamespaceID,
return aResult.ParseIntWithBounds(aValue, 0);
}
if (aAttribute == nsGkAtoms::colspan) {
- bool res = aResult.ParseIntWithBounds(aValue, -1);
- if (res) {
- int32_t val = aResult.GetIntegerValue();
- // reset large colspan values as IE and opera do
- if (val > MAX_COLSPAN || val <= 0) {
- aResult.SetTo(1, &aValue);
- }
- }
- return res;
+ aResult.ParseClampedNonNegativeInt(aValue, 1, 1, MAX_COLSPAN);
+ return true;
}
if (aAttribute == nsGkAtoms::rowspan) {
- bool res = aResult.ParseIntWithBounds(aValue, -1, MAX_ROWSPAN);
- if (res) {
- int32_t val = aResult.GetIntegerValue();
- // quirks mode does not honor the special html 4 value of 0
- if (val < 0 || (0 == val && InNavQuirksMode(OwnerDoc()))) {
+ aResult.ParseClampedNonNegativeInt(aValue, 1, 0, MAX_ROWSPAN);
+ // quirks mode does not honor the special html 4 value of 0
+ if (aResult.GetIntegerValue() == 0 && InNavQuirksMode(OwnerDoc())) {
aResult.SetTo(1, &aValue);
- }
}
- return res;
+ return true;
}
if (aAttribute == nsGkAtoms::height) {
return aResult.ParseSpecialIntValue(aValue);
diff --git a/dom/html/HTMLTableCellElement.h b/dom/html/HTMLTableCellElement.h
index 916333510..ab7a918eb 100644
--- a/dom/html/HTMLTableCellElement.h
+++ b/dom/html/HTMLTableCellElement.h
@@ -37,7 +37,7 @@ public:
}
void SetColSpan(uint32_t aColSpan, ErrorResult& aError)
{
- SetHTMLIntAttr(nsGkAtoms::colspan, aColSpan, aError);
+ SetUnsignedIntAttr(nsGkAtoms::colspan, aColSpan, 1, aError);
}
uint32_t RowSpan() const
{
@@ -45,7 +45,7 @@ public:
}
void SetRowSpan(uint32_t aRowSpan, ErrorResult& aError)
{
- SetHTMLIntAttr(nsGkAtoms::rowspan, aRowSpan, aError);
+ SetUnsignedIntAttr(nsGkAtoms::rowspan, aRowSpan, 1, aError);
}
//already_AddRefed<nsDOMTokenList> Headers() const;
void GetHeaders(DOMString& aHeaders)
diff --git a/dom/html/nsGenericHTMLElement.cpp b/dom/html/nsGenericHTMLElement.cpp
index 2f890325a..0c8bcc9c8 100644
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -2109,14 +2109,6 @@ nsGenericHTMLFormElement::PreHandleEvent(EventChainPreVisitor& aVisitor)
return nsGenericHTMLElement::PreHandleEvent(aVisitor);
}
-/* virtual */
-bool
-nsGenericHTMLFormElement::IsDisabled() const
-{
- return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled) ||
- (mFieldSet && mFieldSet->IsDisabled());
-}
-
void
nsGenericHTMLFormElement::ForgetFieldSet(nsIContent* aFieldset)
{
@@ -2308,14 +2300,13 @@ nsGenericHTMLFormElement::IsElementDisabledForEvents(EventMessage aMessage,
break;
}
- bool disabled = IsDisabled();
- if (!disabled && aFrame) {
- const nsStyleUserInterface* uiStyle = aFrame->StyleUserInterface();
- disabled = uiStyle->mUserInput == StyleUserInput::None ||
- uiStyle->mUserInput == StyleUserInput::Disabled;
-
+ // FIXME(emilio): This poking at the style of the frame is slightly bogus
+ // unless we flush before every event, which we don't really want to do.
+ if (aFrame &&
+ aFrame->StyleUserInterface()->mUserInput == StyleUserInput::None) {
+ return true;
}
- return disabled;
+ return IsDisabled();
}
void
diff --git a/dom/html/nsGenericHTMLElement.h b/dom/html/nsGenericHTMLElement.h
index 72039f266..acbebe087 100644
--- a/dom/html/nsGenericHTMLElement.h
+++ b/dom/html/nsGenericHTMLElement.h
@@ -817,8 +817,8 @@ public:
/**
* Returns the current disabled state of the element.
*/
- virtual bool IsDisabled() const {
- return false;
+ bool IsDisabled() const {
+ return HasAttr(kNameSpaceID_None, nsGkAtoms::disabled);
}
bool IsHidden() const
@@ -1222,8 +1222,6 @@ public:
virtual nsresult PreHandleEvent(
mozilla::EventChainPreVisitor& aVisitor) override;
- virtual bool IsDisabled() const override;
-
/**
* This callback is called by a fieldest on all its elements whenever its
* disabled attribute is changed so the element knows its disabled state
diff --git a/dom/indexedDB/ActorsChild.cpp b/dom/indexedDB/ActorsChild.cpp
index 30dc9b6da..85f876cdc 100644
--- a/dom/indexedDB/ActorsChild.cpp
+++ b/dom/indexedDB/ActorsChild.cpp
@@ -3291,6 +3291,10 @@ BackgroundCursorChild::HandleResponse(
auto& responses =
const_cast<nsTArray<ObjectStoreCursorResponse>&>(aResponses);
+ // If a new cursor is created, we need to keep a reference to it until the
+ // ResultHelper creates a DOM Binding.
+ RefPtr<IDBCursor> newCursor;
+
for (ObjectStoreCursorResponse& response : responses) {
StructuredCloneReadInfo cloneReadInfo(Move(response.cloneInfo()));
cloneReadInfo.mDatabase = mTransaction->Database();
@@ -3300,8 +3304,6 @@ BackgroundCursorChild::HandleResponse(
nullptr,
cloneReadInfo.mFiles);
- RefPtr<IDBCursor> newCursor;
-
if (mCursor) {
mCursor->Reset(Move(response.key()), Move(cloneReadInfo));
} else {
diff --git a/dom/inputmethod/moz.build b/dom/inputmethod/moz.build
index 84b3cb8ab..e6d994565 100644
--- a/dom/inputmethod/moz.build
+++ b/dom/inputmethod/moz.build
@@ -6,11 +6,8 @@
EXTRA_COMPONENTS += [
'InputMethod.manifest',
- 'MozKeyboard.js',
-]
-
-EXTRA_PP_JS_MODULES += [
'Keyboard.jsm',
+ 'MozKeyboard.js',
]
JAR_MANIFESTS += ['jar.mn']
diff --git a/dom/interfaces/base/nsIDOMWindowUtils.idl b/dom/interfaces/base/nsIDOMWindowUtils.idl
index 70ec7e0ae..fcfe407e8 100644
--- a/dom/interfaces/base/nsIDOMWindowUtils.idl
+++ b/dom/interfaces/base/nsIDOMWindowUtils.idl
@@ -1786,7 +1786,7 @@ interface nsIDOMWindowUtils : nsISupports {
/**
* In certain cases the event handling of nodes, form controls in practice,
* may be disabled. Such cases are for example the existence of disabled
- * attribute or -moz-user-input: none/disabled.
+ * attribute or -moz-user-input: none.
*/
boolean isNodeDisabledForEvents(in nsIDOMNode aNode);
diff --git a/dom/ipc/ContentChild.cpp b/dom/ipc/ContentChild.cpp
index fdf0fcf3e..6b914372b 100644
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -29,7 +29,6 @@
#include "mozilla/dom/DataTransfer.h"
#include "mozilla/dom/DOMStorageIPC.h"
#include "mozilla/dom/ExternalHelperAppChild.h"
-#include "mozilla/dom/FlyWebPublishedServerIPC.h"
#include "mozilla/dom/GetFilesHelper.h"
#include "mozilla/dom/ProcessGlobal.h"
#include "mozilla/dom/PushNotifier.h"
@@ -150,8 +149,6 @@
#endif
#include "mozilla/dom/File.h"
-#include "mozilla/dom/PPresentationChild.h"
-#include "mozilla/dom/PresentationIPCService.h"
#include "mozilla/ipc/InputStreamUtils.h"
#ifdef MOZ_WEBSPEECH
@@ -1417,65 +1414,6 @@ ContentChild::SendPBlobConstructor(PBlobChild* aActor,
return PContentChild::SendPBlobConstructor(aActor, aParams);
}
-PPresentationChild*
-ContentChild::AllocPPresentationChild()
-{
- MOZ_CRASH("We should never be manually allocating PPresentationChild actors");
- return nullptr;
-}
-
-bool
-ContentChild::DeallocPPresentationChild(PPresentationChild* aActor)
-{
- delete aActor;
- return true;
-}
-
-PFlyWebPublishedServerChild*
-ContentChild::AllocPFlyWebPublishedServerChild(const nsString& name,
- const FlyWebPublishOptions& params)
-{
- MOZ_CRASH("We should never be manually allocating PFlyWebPublishedServerChild actors");
- return nullptr;
-}
-
-bool
-ContentChild::DeallocPFlyWebPublishedServerChild(PFlyWebPublishedServerChild* aActor)
-{
- RefPtr<FlyWebPublishedServerChild> actor =
- dont_AddRef(static_cast<FlyWebPublishedServerChild*>(aActor));
- return true;
-}
-
-bool
-ContentChild::RecvNotifyPresentationReceiverLaunched(PBrowserChild* aIframe,
- const nsString& aSessionId)
-{
- nsCOMPtr<nsIDocShell> docShell =
- do_GetInterface(static_cast<TabChild*>(aIframe)->WebNavigation());
- NS_WARNING_ASSERTION(docShell, "WebNavigation failed");
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- NS_WARNING_ASSERTION(service, "presentation service is missing");
-
- Unused << NS_WARN_IF(NS_FAILED(static_cast<PresentationIPCService*>(service.get())->MonitorResponderLoading(aSessionId, docShell)));
-
- return true;
-}
-
-bool
-ContentChild::RecvNotifyPresentationReceiverCleanUp(const nsString& aSessionId)
-{
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- NS_WARNING_ASSERTION(service, "presentation service is missing");
-
- Unused << NS_WARN_IF(NS_FAILED(service->UntrackSessionInfo(aSessionId, nsIPresentationService::ROLE_RECEIVER)));
-
- return true;
-}
-
bool
ContentChild::RecvNotifyEmptyHTTPCache()
{
diff --git a/dom/ipc/ContentChild.h b/dom/ipc/ContentChild.h
index 4c8f15cc0..2b36560e2 100644
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -297,23 +297,6 @@ public:
virtual bool DeallocPStorageChild(PStorageChild* aActor) override;
- virtual PPresentationChild* AllocPPresentationChild() override;
-
- virtual bool DeallocPPresentationChild(PPresentationChild* aActor) override;
-
- virtual PFlyWebPublishedServerChild*
- AllocPFlyWebPublishedServerChild(const nsString& name,
- const FlyWebPublishOptions& params) override;
-
- virtual bool DeallocPFlyWebPublishedServerChild(PFlyWebPublishedServerChild* aActor) override;
-
- virtual bool
- RecvNotifyPresentationReceiverLaunched(PBrowserChild* aIframe,
- const nsString& aSessionId) override;
-
- virtual bool
- RecvNotifyPresentationReceiverCleanUp(const nsString& aSessionId) override;
-
virtual bool RecvNotifyEmptyHTTPCache() override;
virtual PSpeechSynthesisChild* AllocPSpeechSynthesisChild() override;
diff --git a/dom/ipc/ContentParent.cpp b/dom/ipc/ContentParent.cpp
index 97e3a4880..0d11fb889 100644
--- a/dom/ipc/ContentParent.cpp
+++ b/dom/ipc/ContentParent.cpp
@@ -51,10 +51,7 @@
#include "mozilla/dom/ServiceWorkerRegistrar.h"
#include "mozilla/dom/power/PowerManagerService.h"
#include "mozilla/dom/Permissions.h"
-#include "mozilla/dom/PresentationParent.h"
-#include "mozilla/dom/PPresentationParent.h"
#include "mozilla/dom/PushNotifier.h"
-#include "mozilla/dom/FlyWebPublishedServerIPC.h"
#include "mozilla/dom/quota/QuotaManagerService.h"
#include "mozilla/dom/time/DateCacheCleaner.h"
#include "mozilla/embedding/printingui/PrintingParent.h"
@@ -3106,44 +3103,6 @@ ContentParent::DeallocPStorageParent(PStorageParent* aActor)
return true;
}
-PPresentationParent*
-ContentParent::AllocPPresentationParent()
-{
- RefPtr<PresentationParent> actor = new PresentationParent();
- return actor.forget().take();
-}
-
-bool
-ContentParent::DeallocPPresentationParent(PPresentationParent* aActor)
-{
- RefPtr<PresentationParent> actor =
- dont_AddRef(static_cast<PresentationParent*>(aActor));
- return true;
-}
-
-bool
-ContentParent::RecvPPresentationConstructor(PPresentationParent* aActor)
-{
- return static_cast<PresentationParent*>(aActor)->Init(mChildID);
-}
-
-PFlyWebPublishedServerParent*
-ContentParent::AllocPFlyWebPublishedServerParent(const nsString& name,
- const FlyWebPublishOptions& params)
-{
- RefPtr<FlyWebPublishedServerParent> actor =
- new FlyWebPublishedServerParent(name, params);
- return actor.forget().take();
-}
-
-bool
-ContentParent::DeallocPFlyWebPublishedServerParent(PFlyWebPublishedServerParent* aActor)
-{
- RefPtr<FlyWebPublishedServerParent> actor =
- dont_AddRef(static_cast<FlyWebPublishedServerParent*>(aActor));
- return true;
-}
-
PSpeechSynthesisParent*
ContentParent::AllocPSpeechSynthesisParent()
{
diff --git a/dom/ipc/ContentParent.h b/dom/ipc/ContentParent.h
index 26b5c44ac..f6f3e64db 100644
--- a/dom/ipc/ContentParent.h
+++ b/dom/ipc/ContentParent.h
@@ -800,18 +800,6 @@ private:
virtual bool DeallocPStorageParent(PStorageParent* aActor) override;
- virtual PPresentationParent* AllocPPresentationParent() override;
-
- virtual bool DeallocPPresentationParent(PPresentationParent* aActor) override;
-
- virtual bool RecvPPresentationConstructor(PPresentationParent* aActor) override;
-
- virtual PFlyWebPublishedServerParent*
- AllocPFlyWebPublishedServerParent(const nsString& name,
- const FlyWebPublishOptions& params) override;
-
- virtual bool DeallocPFlyWebPublishedServerParent(PFlyWebPublishedServerParent* aActor) override;
-
virtual PSpeechSynthesisParent* AllocPSpeechSynthesisParent() override;
virtual bool
diff --git a/dom/ipc/PContent.ipdl b/dom/ipc/PContent.ipdl
index e8fb25aec..5b15433d5 100644
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -43,9 +43,7 @@ include protocol PJavaScript;
include protocol PRemoteSpellcheckEngine;
include protocol PWebBrowserPersistDocument;
include protocol PWebrtcGlobal;
-include protocol PPresentation;
include protocol PVideoDecoderManager;
-include protocol PFlyWebPublishedServer;
include DOMTypes;
include JavaScriptTypes;
include InputStreamParams;
@@ -88,7 +86,6 @@ using class mozilla::dom::ipc::StructuredCloneData from "mozilla/dom/ipc/Structu
using mozilla::DataStorageType from "ipc/DataStorageIPCUtils.h";
using mozilla::DocShellOriginAttributes from "mozilla/ipc/BackgroundUtils.h";
using struct mozilla::layers::TextureFactoryIdentifier from "mozilla/layers/CompositorTypes.h";
-using struct mozilla::dom::FlyWebPublishOptions from "mozilla/dom/FlyWebPublishOptionsIPCSerializer.h";
union ChromeRegistryItem
{
@@ -260,8 +257,6 @@ nested(upto inside_cpow) sync protocol PContent
manages PRemoteSpellcheckEngine;
manages PWebBrowserPersistDocument;
manages PWebrtcGlobal;
- manages PPresentation;
- manages PFlyWebPublishedServer;
both:
// Depending on exactly how the new browser is being created, it might be
@@ -481,18 +476,6 @@ child:
async UpdateWindow(uintptr_t aChildId);
/**
- * Notify the child that presentation receiver has been launched with the
- * correspondent iframe.
- */
- async NotifyPresentationReceiverLaunched(PBrowser aIframe, nsString aSessionId);
-
- /**
- * Notify the child that the info about a presentation receiver needs to be
- * cleaned up.
- */
- async NotifyPresentationReceiverCleanUp(nsString aSessionId);
-
- /**
* Notify the child that cache is emptied.
*/
async NotifyEmptyHTTPCache();
@@ -682,10 +665,6 @@ parent:
async PWebrtcGlobal();
- async PPresentation();
-
- async PFlyWebPublishedServer(nsString name, FlyWebPublishOptions params);
-
// Services remoting
async StartVisitedQuery(URIParams uri);
diff --git a/dom/mathml/nsMathMLElement.cpp b/dom/mathml/nsMathMLElement.cpp
index d6aef876c..2be931682 100644
--- a/dom/mathml/nsMathMLElement.cpp
+++ b/dom/mathml/nsMathMLElement.cpp
@@ -9,6 +9,7 @@
#include "base/compiler_specific.h"
#include "mozilla/ArrayUtils.h"
#include "nsGkAtoms.h"
+#include "nsITableCellLayout.h" // for MAX_COLSPAN / MAX_ROWSPAN
#include "nsCRT.h"
#include "nsLayoutStylesheetCache.h"
#include "nsRuleData.h"
@@ -150,8 +151,9 @@ nsMathMLElement::ParseAttribute(int32_t aNamespaceID,
const nsAString& aValue,
nsAttrValue& aResult)
{
+ MOZ_ASSERT(IsMathMLElement());
if (aNamespaceID == kNameSpaceID_None) {
- if (IsMathMLElement(nsGkAtoms::math) && aAttribute == nsGkAtoms::mode) {
+ if (mNodeInfo->Equals(nsGkAtoms::math) && aAttribute == nsGkAtoms::mode) {
WarnDeprecated(nsGkAtoms::mode->GetUTF16String(),
nsGkAtoms::display->GetUTF16String(), OwnerDoc());
}
@@ -165,6 +167,16 @@ nsMathMLElement::ParseAttribute(int32_t aNamespaceID,
aAttribute == nsGkAtoms::mathbackground_) {
return aResult.ParseColor(aValue);
}
+ if (mNodeInfo->Equals(nsGkAtoms::mtd_)) {
+ if (aAttribute == nsGkAtoms::columnspan_) {
+ aResult.ParseClampedNonNegativeInt(aValue, 1, 1, MAX_COLSPAN);
+ return true;
+ }
+ if (aAttribute == nsGkAtoms::rowspan) {
+ aResult.ParseClampedNonNegativeInt(aValue, 1, 0, MAX_ROWSPAN);
+ return true;
+ }
+ }
}
return nsMathMLElementBase::ParseAttribute(aNamespaceID, aAttribute,
@@ -209,6 +221,8 @@ static Element::MappedAttributeEntry sDirStyles[] = {
bool
nsMathMLElement::IsAttributeMapped(const nsIAtom* aAttribute) const
{
+ MOZ_ASSERT(IsMathMLElement());
+
static const MappedAttributeEntry* const mtableMap[] = {
sMtableStyles,
sCommonPresStyles
@@ -240,10 +254,10 @@ nsMathMLElement::IsAttributeMapped(const nsIAtom* aAttribute) const
if (IsAnyOfMathMLElements(nsGkAtoms::mstyle_, nsGkAtoms::math))
return FindAttributeDependence(aAttribute, mstyleMap);
- if (IsMathMLElement(nsGkAtoms::mtable_))
+ if (mNodeInfo->Equals(nsGkAtoms::mtable_))
return FindAttributeDependence(aAttribute, mtableMap);
- if (IsMathMLElement(nsGkAtoms::mrow_))
+ if (mNodeInfo->Equals(nsGkAtoms::mrow_))
return FindAttributeDependence(aAttribute, mrowMap);
if (IsAnyOfMathMLElements(nsGkAtoms::maction_,
diff --git a/dom/media/AbstractMediaDecoder.h b/dom/media/AbstractMediaDecoder.h
index a0f04ec98..6babcce17 100644
--- a/dom/media/AbstractMediaDecoder.h
+++ b/dom/media/AbstractMediaDecoder.h
@@ -31,7 +31,9 @@ class MediaResource;
class ReentrantMonitor;
class VideoFrameContainer;
class MediaDecoderOwner;
+#ifdef MOZ_EME
class CDMProxy;
+#endif
typedef nsDataHashtable<nsCStringHashKey, nsCString> MetadataTags;
diff --git a/dom/media/MediaDecoder.cpp b/dom/media/MediaDecoder.cpp
index 223c59c3b..0cce91ccb 100644
--- a/dom/media/MediaDecoder.cpp
+++ b/dom/media/MediaDecoder.cpp
@@ -387,7 +387,9 @@ MediaDecoder::MediaDecoder(MediaDecoderOwner* aOwner)
, mLogicalPosition(0.0)
, mDuration(std::numeric_limits<double>::quiet_NaN())
, mResourceCallback(new ResourceCallback())
+#ifdef MOZ_EME
, mCDMProxyPromise(mCDMProxyPromiseHolder.Ensure(__func__))
+#endif
, mIgnoreProgressData(false)
, mInfiniteStream(false)
, mOwner(aOwner)
@@ -472,7 +474,9 @@ MediaDecoder::Shutdown()
mResourceCallback->Disconnect();
+#ifdef MOZ_EME
mCDMProxyPromiseHolder.RejectIfExists(true, __func__);
+#endif
DiscardOngoingSeekIfExists();
@@ -1537,6 +1541,7 @@ MediaDecoder::CanPlayThrough()
return GetStatistics().CanPlayThrough();
}
+#ifdef MOZ_EME
RefPtr<MediaDecoder::CDMProxyPromise>
MediaDecoder::RequestCDMProxy() const
{
@@ -1551,6 +1556,7 @@ MediaDecoder::SetCDMProxy(CDMProxy* aProxy)
mCDMProxyPromiseHolder.ResolveIfExists(aProxy, __func__);
}
+#endif
bool
MediaDecoder::IsOpusEnabled()
diff --git a/dom/media/MediaDecoder.h b/dom/media/MediaDecoder.h
index 05e88db8b..298552433 100644
--- a/dom/media/MediaDecoder.h
+++ b/dom/media/MediaDecoder.h
@@ -8,7 +8,11 @@
#define MediaDecoder_h_
#include "mozilla/Atomics.h"
+
+#ifdef MOZ_EME
#include "mozilla/CDMProxy.h"
+#endif
+
#include "mozilla/MozPromise.h"
#include "mozilla/ReentrantMonitor.h"
#include "mozilla/StateMirroring.h"
@@ -432,6 +436,7 @@ private:
MediaDecoderOwner* GetOwner() const override;
+#ifdef MOZ_EME
typedef MozPromise<RefPtr<CDMProxy>, bool /* aIgnored */, /* IsExclusive = */ true> CDMProxyPromise;
// Resolved when a CDMProxy is available and the capabilities are known or
@@ -439,6 +444,7 @@ private:
RefPtr<CDMProxyPromise> RequestCDMProxy() const;
void SetCDMProxy(CDMProxy* aProxy);
+#endif
static bool IsOggEnabled();
static bool IsOpusEnabled();
@@ -589,8 +595,10 @@ private:
RefPtr<ResourceCallback> mResourceCallback;
+#ifdef MOZ_EME
MozPromiseHolder<CDMProxyPromise> mCDMProxyPromiseHolder;
RefPtr<CDMProxyPromise> mCDMProxyPromise;
+#endif
protected:
// The promise resolving/rejection is queued as a "micro-task" which will be
diff --git a/dom/media/MediaDecoderReader.h b/dom/media/MediaDecoderReader.h
index 8a6997826..f53c74689 100644
--- a/dom/media/MediaDecoderReader.h
+++ b/dom/media/MediaDecoderReader.h
@@ -24,7 +24,9 @@
namespace mozilla {
+#ifdef MOZ_EME
class CDMProxy;
+#endif
class MediaDecoderReader;
struct WaitForDataRejectValue
@@ -186,7 +188,9 @@ public:
// when to call SetIdle().
virtual void SetIdle() {}
+#ifdef MOZ_EME
virtual void SetCDMProxy(CDMProxy* aProxy) {}
+#endif
// Tell the reader that the data decoded are not for direct playback, so it
// can accept more files, in particular those which have more channels than
diff --git a/dom/media/MediaDecoderReaderWrapper.h b/dom/media/MediaDecoderReaderWrapper.h
index 92001ca33..1a8d3a68c 100644
--- a/dom/media/MediaDecoderReaderWrapper.h
+++ b/dom/media/MediaDecoderReaderWrapper.h
@@ -113,7 +113,9 @@ public:
return mReader->CanonicalBuffered();
}
+#ifdef MOZ_EME
void SetCDMProxy(CDMProxy* aProxy) { mReader->SetCDMProxy(aProxy); }
+#endif
void SetVideoBlankDecode(bool aIsBlankDecode);
diff --git a/dom/media/MediaDecoderStateMachine.cpp b/dom/media/MediaDecoderStateMachine.cpp
index 2ed1956c9..63222c22c 100644
--- a/dom/media/MediaDecoderStateMachine.cpp
+++ b/dom/media/MediaDecoderStateMachine.cpp
@@ -1238,7 +1238,12 @@ DecodeMetadataState::OnMetadataRead(MetadataHolder* aMetadata)
// feeding in the CDM, which we need to decode the first frame (and
// thus get the metadata). We could fix this if we could compute the start
// time by demuxing without necessaring decoding.
- bool waitingForCDM = Info().IsEncrypted() && !mMaster->mCDMProxy;
+ bool waitingForCDM =
+#ifdef MOZ_EME
+ mMaster->Info().IsEncrypted() && !mMaster->mCDMProxy;
+#else
+ false;
+#endif
mMaster->mNotifyMetadataBeforeFirstFrame =
mMaster->mDuration.Ref().isSome() || waitingForCDM;
@@ -1262,7 +1267,9 @@ DormantState::HandlePlayStateChanged(MediaDecoder::PlayState aPlayState)
{
if (aPlayState == MediaDecoder::PLAY_STATE_PLAYING) {
// Exit dormant when the user wants to play.
+#ifdef MOZ_EME
MOZ_ASSERT(!Info().IsEncrypted() || mMaster->mCDMProxy);
+#endif
MOZ_ASSERT(mMaster->mSentFirstFrameLoadedEvent);
SetState<SeekingState>(Move(mPendingSeek), EventVisibility::Suppressed);
}
@@ -1575,7 +1582,9 @@ ShutdownState::Enter()
// dispose of the timer.
master->mVideoDecodeSuspendTimer.Reset();
+#ifdef MOZ_EME
master->mCDMProxyPromise.DisconnectIfExists();
+#endif
if (master->IsPlaying()) {
master->StopPlayback();
@@ -2129,10 +2138,12 @@ nsresult MediaDecoderStateMachine::Init(MediaDecoder* aDecoder)
mMediaSink = CreateMediaSink(mAudioCaptured);
+#ifdef MOZ_EME
mCDMProxyPromise.Begin(aDecoder->RequestCDMProxy()->Then(
OwnerThread(), __func__, this,
&MediaDecoderStateMachine::OnCDMProxyReady,
&MediaDecoderStateMachine::OnCDMProxyNotReady));
+#endif
nsresult rv = mReader->Init();
NS_ENSURE_SUCCESS(rv, rv);
@@ -3108,6 +3119,7 @@ void MediaDecoderStateMachine::OnMediaSinkAudioError(nsresult aResult)
DecodeError(MediaResult(NS_ERROR_DOM_MEDIA_MEDIASINK_ERR, __func__));
}
+#ifdef MOZ_EME
void
MediaDecoderStateMachine::OnCDMProxyReady(RefPtr<CDMProxy> aProxy)
{
@@ -3124,6 +3136,7 @@ MediaDecoderStateMachine::OnCDMProxyNotReady()
MOZ_ASSERT(OnTaskQueue());
mCDMProxyPromise.Complete();
}
+#endif
void
MediaDecoderStateMachine::SetAudioCaptured(bool aCaptured)
diff --git a/dom/media/MediaDecoderStateMachine.h b/dom/media/MediaDecoderStateMachine.h
index ff3258ff1..f04f34983 100644
--- a/dom/media/MediaDecoderStateMachine.h
+++ b/dom/media/MediaDecoderStateMachine.h
@@ -768,10 +768,12 @@ private:
// Playback will not start when audio is offloading.
bool mAudioOffloading;
+#ifdef MOZ_EME
void OnCDMProxyReady(RefPtr<CDMProxy> aProxy);
void OnCDMProxyNotReady();
RefPtr<CDMProxy> mCDMProxy;
MozPromiseRequestHolder<MediaDecoder::CDMProxyPromise> mCDMProxyPromise;
+#endif
private:
// The buffered range. Mirrored from the decoder thread.
diff --git a/dom/media/MediaFormatReader.cpp b/dom/media/MediaFormatReader.cpp
index 773434710..396f31e37 100644
--- a/dom/media/MediaFormatReader.cpp
+++ b/dom/media/MediaFormatReader.cpp
@@ -4,7 +4,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#ifdef MOZ_EME
#include "mozilla/CDMProxy.h"
+#endif
+
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/dom/HTMLMediaElement.h"
#include "mozilla/Preferences.h"
@@ -611,7 +614,6 @@ private:
nsTArray<uint8_t> mInitData;
nsString mInitDataType;
};
-#endif
void
MediaFormatReader::SetCDMProxy(CDMProxy* aProxy)
@@ -624,6 +626,7 @@ MediaFormatReader::SetCDMProxy(CDMProxy* aProxy)
});
OwnerThread()->Dispatch(r.forget());
}
+#endif // MOZ_EME
bool
MediaFormatReader::IsWaitingOnCDMResource() {
diff --git a/dom/media/MediaFormatReader.h b/dom/media/MediaFormatReader.h
index 4d05ca201..be0b7cd17 100644
--- a/dom/media/MediaFormatReader.h
+++ b/dom/media/MediaFormatReader.h
@@ -20,7 +20,9 @@
namespace mozilla {
+#ifdef MOZ_EME
class CDMProxy;
+#endif
class MediaFormatReader final : public MediaDecoderReader
{
@@ -91,7 +93,9 @@ public:
return mTrackDemuxersMayBlock;
}
+#ifdef MOZ_EME
void SetCDMProxy(CDMProxy* aProxy) override;
+#endif
// Returns a string describing the state of the decoder data.
// Used for debugging purposes.
@@ -584,7 +588,9 @@ private:
RefPtr<VideoFrameContainer> mVideoFrameContainer;
layers::ImageContainer* GetImageContainer();
+#ifdef MOZ_EME
RefPtr<CDMProxy> mCDMProxy;
+#endif
RefPtr<GMPCrashHelper> mCrashHelper;
diff --git a/dom/media/PeerConnection.js b/dom/media/PeerConnection.js
index 0569b15ae..df36ae83c 100644
--- a/dom/media/PeerConnection.js
+++ b/dom/media/PeerConnection.js
@@ -13,8 +13,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "PeerConnectionIdp",
"resource://gre/modules/media/PeerConnectionIdp.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "convertToRTCStatsReport",
"resource://gre/modules/media/RTCStatsReport.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
const PC_CONTRACT = "@mozilla.org/dom/peerconnection;1";
const PC_OBS_CONTRACT = "@mozilla.org/dom/peerconnectionobserver;1";
diff --git a/dom/media/fmp4/MP4Decoder.cpp b/dom/media/fmp4/MP4Decoder.cpp
index b293c251b..bf937241c 100644
--- a/dom/media/fmp4/MP4Decoder.cpp
+++ b/dom/media/fmp4/MP4Decoder.cpp
@@ -10,7 +10,9 @@
#include "MP4Demuxer.h"
#include "mozilla/Preferences.h"
#include "nsCharSeparatedTokenizer.h"
+#ifdef MOZ_EME
#include "mozilla/CDMProxy.h"
+#endif
#include "mozilla/Logging.h"
#include "mozilla/SharedThreadPool.h"
#include "nsMimeTypes.h"
diff --git a/dom/media/gmp/GMPChild.cpp b/dom/media/gmp/GMPChild.cpp
index 14b06cc72..fa6f2f4c8 100644
--- a/dom/media/gmp/GMPChild.cpp
+++ b/dom/media/gmp/GMPChild.cpp
@@ -22,7 +22,9 @@
#include "GMPUtils.h"
#include "prio.h"
#include "base/task.h"
+#ifdef MOZ_EME
#include "widevine-adapter/WidevineAdapter.h"
+#endif
using namespace mozilla::ipc;
@@ -254,9 +256,13 @@ GMPChild::AnswerStartPlugin(const nsString& aAdapter)
return false;
}
+#ifdef MOZ_EME
bool isWidevine = aAdapter.EqualsLiteral("widevine");
GMPAdapter* adapter = (isWidevine) ? new WidevineAdapter() : nullptr;
+#else
+ GMPAdapter* adapter = nullptr;
+#endif
if (!mGMPLoader->Load(libPath.get(),
libPath.Length(),
mNodeId.BeginWriting(),
diff --git a/dom/media/gmp/GMPDecryptorParent.cpp b/dom/media/gmp/GMPDecryptorParent.cpp
index 1f8b9a7a8..4f5402160 100644
--- a/dom/media/gmp/GMPDecryptorParent.cpp
+++ b/dom/media/gmp/GMPDecryptorParent.cpp
@@ -43,11 +43,13 @@ GMPDecryptorParent::~GMPDecryptorParent()
bool
GMPDecryptorParent::RecvSetDecryptorId(const uint32_t& aId)
{
+#ifdef MOZ_EME
if (!mIsOpen) {
NS_WARNING("Trying to use a dead GMP decrypter!");
return false;
}
mCallback->SetDecryptorId(aId);
+#endif
return true;
}
@@ -202,6 +204,7 @@ bool
GMPDecryptorParent::RecvSetSessionId(const uint32_t& aCreateSessionId,
const nsCString& aSessionId)
{
+#ifdef MOZ_EME
LOGD(("GMPDecryptorParent[%p]::RecvSetSessionId(token=%u, sessionId='%s')",
this, aCreateSessionId, aSessionId.get()));
@@ -210,6 +213,7 @@ GMPDecryptorParent::RecvSetSessionId(const uint32_t& aCreateSessionId,
return false;
}
mCallback->SetSessionId(aCreateSessionId, aSessionId);
+#endif
return true;
}
@@ -217,6 +221,7 @@ bool
GMPDecryptorParent::RecvResolveLoadSessionPromise(const uint32_t& aPromiseId,
const bool& aSuccess)
{
+#ifdef MOZ_EME
LOGD(("GMPDecryptorParent[%p]::RecvResolveLoadSessionPromise(promiseId=%u)",
this, aPromiseId));
@@ -225,12 +230,14 @@ GMPDecryptorParent::RecvResolveLoadSessionPromise(const uint32_t& aPromiseId,
return false;
}
mCallback->ResolveLoadSessionPromise(aPromiseId, aSuccess);
+#endif
return true;
}
bool
GMPDecryptorParent::RecvResolvePromise(const uint32_t& aPromiseId)
{
+#ifdef MOZ_EME
LOGD(("GMPDecryptorParent[%p]::RecvResolvePromise(promiseId=%u)",
this, aPromiseId));
@@ -239,6 +246,7 @@ GMPDecryptorParent::RecvResolvePromise(const uint32_t& aPromiseId)
return false;
}
mCallback->ResolvePromise(aPromiseId);
+#endif
return true;
}
@@ -266,6 +274,7 @@ GMPDecryptorParent::RecvRejectPromise(const uint32_t& aPromiseId,
const GMPDOMException& aException,
const nsCString& aMessage)
{
+#ifdef MOZ_EME
LOGD(("GMPDecryptorParent[%p]::RecvRejectPromise(promiseId=%u, exception=%d, msg='%s')",
this, aPromiseId, aException, aMessage.get()));
@@ -274,10 +283,11 @@ GMPDecryptorParent::RecvRejectPromise(const uint32_t& aPromiseId,
return false;
}
mCallback->RejectPromise(aPromiseId, GMPExToNsresult(aException), aMessage);
+#endif
return true;
}
-
+#ifdef MOZ_EME
static dom::MediaKeyMessageType
ToMediaKeyMessageType(GMPSessionMessageType aMessageType) {
switch (aMessageType) {
@@ -288,12 +298,14 @@ ToMediaKeyMessageType(GMPSessionMessageType aMessageType) {
default: return dom::MediaKeyMessageType::License_request;
};
};
+#endif
bool
GMPDecryptorParent::RecvSessionMessage(const nsCString& aSessionId,
const GMPSessionMessageType& aMessageType,
nsTArray<uint8_t>&& aMessage)
{
+#ifdef MOZ_EME
LOGD(("GMPDecryptorParent[%p]::RecvSessionMessage(sessionId='%s', type=%d, msg='%s')",
this, aSessionId.get(), aMessageType, ToBase64(aMessage).get()));
@@ -302,6 +314,7 @@ GMPDecryptorParent::RecvSessionMessage(const nsCString& aSessionId,
return false;
}
mCallback->SessionMessage(aSessionId, ToMediaKeyMessageType(aMessageType), aMessage);
+#endif
return true;
}
@@ -309,6 +322,7 @@ bool
GMPDecryptorParent::RecvExpirationChange(const nsCString& aSessionId,
const double& aExpiryTime)
{
+#ifdef MOZ_EME
LOGD(("GMPDecryptorParent[%p]::RecvExpirationChange(sessionId='%s', expiry=%lf)",
this, aSessionId.get(), aExpiryTime));
@@ -317,12 +331,14 @@ GMPDecryptorParent::RecvExpirationChange(const nsCString& aSessionId,
return false;
}
mCallback->ExpirationChange(aSessionId, aExpiryTime);
+#endif
return true;
}
bool
GMPDecryptorParent::RecvSessionClosed(const nsCString& aSessionId)
{
+#ifdef MOZ_EME
LOGD(("GMPDecryptorParent[%p]::RecvSessionClosed(sessionId='%s')",
this, aSessionId.get()));
@@ -331,6 +347,7 @@ GMPDecryptorParent::RecvSessionClosed(const nsCString& aSessionId)
return false;
}
mCallback->SessionClosed(aSessionId);
+#endif
return true;
}
@@ -340,6 +357,7 @@ GMPDecryptorParent::RecvSessionError(const nsCString& aSessionId,
const uint32_t& aSystemCode,
const nsCString& aMessage)
{
+#ifdef MOZ_EME
LOGD(("GMPDecryptorParent[%p]::RecvSessionError(sessionId='%s', exception=%d, sysCode=%d, msg='%s')",
this, aSessionId.get(),
aException, aSystemCode, aMessage.get()));
@@ -352,9 +370,11 @@ GMPDecryptorParent::RecvSessionError(const nsCString& aSessionId,
GMPExToNsresult(aException),
aSystemCode,
aMessage);
+#endif
return true;
}
+#ifdef MOZ_EME
static dom::MediaKeyStatus
ToMediaKeyStatus(GMPMediaKeyStatus aStatus) {
switch (aStatus) {
@@ -368,11 +388,13 @@ ToMediaKeyStatus(GMPMediaKeyStatus aStatus) {
default: return dom::MediaKeyStatus::Internal_error;
}
}
+#endif
bool
GMPDecryptorParent::RecvBatchedKeyStatusChanged(const nsCString& aSessionId,
InfallibleTArray<GMPKeyInformation>&& aKeyInfos)
{
+#ifdef MOZ_EME
LOGD(("GMPDecryptorParent[%p]::RecvBatchedKeyStatusChanged(sessionId='%s', KeyInfos len='%d')",
this, aSessionId.get(), aKeyInfos.Length()));
@@ -392,9 +414,11 @@ GMPDecryptorParent::RecvBatchedKeyStatusChanged(const nsCString& aSessionId,
}
mCallback->BatchedKeyStatusChanged(aSessionId, cdmKeyInfos);
}
+#endif
return true;
}
+#ifdef MOZ_EME
DecryptStatus
ToDecryptStatus(GMPErr aError)
{
@@ -405,12 +429,14 @@ ToDecryptStatus(GMPErr aError)
default: return GenericErr;
}
}
+#endif
bool
GMPDecryptorParent::RecvDecrypted(const uint32_t& aId,
const GMPErr& aErr,
InfallibleTArray<uint8_t>&& aBuffer)
{
+#ifdef MOZ_EME
LOGV(("GMPDecryptorParent[%p]::RecvDecrypted(id=%d, err=%d)",
this, aId, aErr));
@@ -419,6 +445,7 @@ GMPDecryptorParent::RecvDecrypted(const uint32_t& aId,
return false;
}
mCallback->Decrypted(aId, ToDecryptStatus(aErr), aBuffer);
+#endif
return true;
}
diff --git a/dom/media/gmp/GMPDecryptorProxy.h b/dom/media/gmp/GMPDecryptorProxy.h
index 0ef31fd92..ed16755f8 100644
--- a/dom/media/gmp/GMPDecryptorProxy.h
+++ b/dom/media/gmp/GMPDecryptorProxy.h
@@ -6,7 +6,9 @@
#ifndef GMPDecryptorProxy_h_
#define GMPDecryptorProxy_h_
+#ifdef MOZ_EME
#include "mozilla/DecryptorProxyCallback.h"
+#endif
#include "GMPCallbackBase.h"
#include "gmp-decryption.h"
#include "nsString.h"
@@ -15,8 +17,13 @@ namespace mozilla {
class CryptoSample;
} // namespace mozilla
+#ifdef MOZ_EME
class GMPDecryptorProxyCallback : public DecryptorProxyCallback,
public GMPCallbackBase {
+#else
+class GMPDecryptorProxyCallback : public GMPCallbackBase {
+#endif
+
public:
virtual ~GMPDecryptorProxyCallback() {}
};
diff --git a/dom/media/gmp/GMPParent.cpp b/dom/media/gmp/GMPParent.cpp
index 234ed5c05..84603e973 100644
--- a/dom/media/gmp/GMPParent.cpp
+++ b/dom/media/gmp/GMPParent.cpp
@@ -30,8 +30,10 @@ using mozilla::ipc::GeckoChildProcessHost;
#include "WMFDecoderModule.h"
#endif
+#ifdef MOZ_EME
#include "mozilla/dom/WidevineCDMManifestBinding.h"
#include "widevine-adapter/WidevineAdapter.h"
+#endif
namespace mozilla {
@@ -654,6 +656,7 @@ GMPParent::ReadGMPMetaData()
return ReadGMPInfoFile(infoFile);
}
+#ifdef MOZ_EME
// Maybe this is the Widevine adapted plugin?
nsCOMPtr<nsIFile> manifestFile;
rv = mDirectory->Clone(getter_AddRefs(manifestFile));
@@ -662,6 +665,9 @@ GMPParent::ReadGMPMetaData()
}
manifestFile->AppendRelativePath(NS_LITERAL_STRING("manifest.json"));
return ReadChromiumManifestFile(manifestFile);
+#else
+ return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
+#endif
}
RefPtr<GenericPromise>
@@ -754,6 +760,7 @@ GMPParent::ReadChromiumManifestFile(nsIFile* aFile)
RefPtr<GenericPromise>
GMPParent::ParseChromiumManifest(nsString aJSON)
{
+#ifdef MOZ_EME
LOGD("%s: for '%s'", __FUNCTION__, NS_LossyConvertUTF16toASCII(aJSON).get());
MOZ_ASSERT(NS_IsMainThread());
@@ -791,6 +798,10 @@ GMPParent::ParseChromiumManifest(nsString aJSON)
#endif
return GenericPromise::CreateAndResolve(true, __func__);
+#else // !MOZ_EME
+ MOZ_ASSERT_UNREACHABLE("don't call me if EME isn't enabled");
+ return GenericPromise::CreateAndReject(NS_ERROR_FAILURE, __func__);
+#endif // !MOZ_EME
}
bool
diff --git a/dom/media/gmp/moz.build b/dom/media/gmp/moz.build
index 3b67fb5c9..79de6e1d9 100644
--- a/dom/media/gmp/moz.build
+++ b/dom/media/gmp/moz.build
@@ -35,8 +35,6 @@ EXPORTS += [
'GMPAudioDecoderProxy.h',
'GMPAudioHost.h',
'GMPCallbackBase.h',
- 'GMPCDMCallbackProxy.h',
- 'GMPCDMProxy.h',
'GMPChild.h',
'GMPContentChild.h',
'GMPContentParent.h',
@@ -73,6 +71,12 @@ EXPORTS += [
'GMPVideoPlaneImpl.h',
]
+if CONFIG['MOZ_EME']:
+ EXPORTS += [
+ 'GMPCDMCallbackProxy.h',
+ 'GMPCDMProxy.h',
+ ]
+
# We link GMPLoader into xul on B2G/Fennec as its code does not need to be
# covered by a DRM vendor's voucher.
if CONFIG['OS_TARGET'] == 'Android':
@@ -87,8 +91,6 @@ UNIFIED_SOURCES += [
'GMPAudioDecoderChild.cpp',
'GMPAudioDecoderParent.cpp',
'GMPAudioHost.cpp',
- 'GMPCDMCallbackProxy.cpp',
- 'GMPCDMProxy.cpp',
'GMPChild.cpp',
'GMPContentChild.cpp',
'GMPContentParent.cpp',
@@ -120,10 +122,16 @@ UNIFIED_SOURCES += [
'GMPVideoPlaneImpl.cpp',
]
-DIRS += [
- 'rlz',
- 'widevine-adapter',
-]
+if CONFIG['MOZ_EME']:
+ UNIFIED_SOURCES += [
+ 'GMPCDMCallbackProxy.cpp',
+ 'GMPCDMProxy.cpp',
+ ]
+
+DIRS += ['rlz']
+
+if CONFIG['MOZ_EME']:
+ DIRS += ['widevine-adapter']
IPDL_SOURCES += [
'GMPTypes.ipdlh',
diff --git a/dom/media/gtest/MockMediaDecoderOwner.h b/dom/media/gtest/MockMediaDecoderOwner.h
index 324f18141..1009ca30a 100644
--- a/dom/media/gtest/MockMediaDecoderOwner.h
+++ b/dom/media/gtest/MockMediaDecoderOwner.h
@@ -34,8 +34,10 @@ public:
void DownloadProgressed() override {}
void UpdateReadyState() override {}
void FirstFrameLoaded() override {}
+#ifdef MOZ_EME
void DispatchEncrypted(const nsTArray<uint8_t>& aInitData,
const nsAString& aInitDataType) override {}
+#endif
bool IsActive() const override { return true; }
bool IsHidden() const override { return false; }
void DownloadSuspended() override {}
diff --git a/dom/media/gtest/moz.build b/dom/media/gtest/moz.build
index a7ea73807..ae059962c 100644
--- a/dom/media/gtest/moz.build
+++ b/dom/media/gtest/moz.build
@@ -28,6 +28,11 @@ UNIFIED_SOURCES += [
'TestWebMBuffered.cpp',
]
+if CONFIG['MOZ_EME']:
+ UNIFIED_SOURCES += [
+ 'TestEME.cpp',
+ ]
+
if CONFIG['MOZ_WEBM_ENCODER']:
UNIFIED_SOURCES += [
'TestVideoTrackEncoder.cpp',
diff --git a/dom/media/mediasource/TrackBuffersManager.cpp b/dom/media/mediasource/TrackBuffersManager.cpp
index 21fb158b5..9a2d00ad8 100644
--- a/dom/media/mediasource/TrackBuffersManager.cpp
+++ b/dom/media/mediasource/TrackBuffersManager.cpp
@@ -84,7 +84,7 @@ private:
nsTArray<uint8_t> mInitData;
nsString mInitDataType;
};
-#endif
+#endif // MOZ_EME
TrackBuffersManager::TrackBuffersManager(MediaSourceDecoder* aParentDecoder,
const nsACString& aType)
diff --git a/dom/media/moz.build b/dom/media/moz.build
index df8cb619d..41267a6ef 100644
--- a/dom/media/moz.build
+++ b/dom/media/moz.build
@@ -20,7 +20,6 @@ with Files('GetUserMedia*'):
BUG_COMPONENT = component_av
DIRS += [
- 'eme',
'encoder',
'flac',
'gmp',
@@ -49,6 +48,9 @@ if CONFIG['MOZ_FMP4']:
if CONFIG['MOZ_WEBRTC']:
DIRS += ['bridge']
+if CONFIG['MOZ_EME']:
+ DIRS += ['eme']
+
TEST_DIRS += [
'gtest',
]
diff --git a/dom/media/platforms/PDMFactory.cpp b/dom/media/platforms/PDMFactory.cpp
index 5bfdcffb7..6e7241c46 100644
--- a/dom/media/platforms/PDMFactory.cpp
+++ b/dom/media/platforms/PDMFactory.cpp
@@ -24,7 +24,6 @@
#endif
#include "GMPDecoderModule.h"
-#include "mozilla/CDMProxy.h"
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/SharedThreadPool.h"
#include "mozilla/StaticPtr.h"
@@ -37,7 +36,11 @@
#include "H264Converter.h"
#include "AgnosticDecoderModule.h"
+
+#ifdef MOZ_EME
+#include "mozilla/CDMProxy.h"
#include "EMEDecoderModule.h"
+#endif
#include "DecoderDoctorDiagnostics.h"
@@ -450,11 +453,13 @@ PDMFactory::GetDecoder(const TrackInfo& aTrackInfo,
return pdm.forget();
}
+#ifdef MOZ_EME
void
PDMFactory::SetCDMProxy(CDMProxy* aProxy)
{
RefPtr<PDMFactory> m = new PDMFactory();
mEMEPDM = new EMEDecoderModule(aProxy, m);
}
+#endif
} // namespace mozilla
diff --git a/dom/media/platforms/PDMFactory.h b/dom/media/platforms/PDMFactory.h
index 94be7e928..2b43fa1ab 100644
--- a/dom/media/platforms/PDMFactory.h
+++ b/dom/media/platforms/PDMFactory.h
@@ -11,7 +11,9 @@
#include "mozilla/Function.h"
#include "mozilla/StaticMutex.h"
+#ifdef MOZ_EME
class CDMProxy;
+#endif
namespace mozilla {
@@ -38,12 +40,14 @@ public:
bool Supports(const TrackInfo& aTrackInfo,
DecoderDoctorDiagnostics* aDiagnostics) const;
+#ifdef MOZ_EME
// Creates a PlatformDecoderModule that uses a CDMProxy to decrypt or
// decrypt-and-decode EME encrypted content. If the CDM only decrypts and
// does not decode, we create a PDM and use that to create MediaDataDecoders
// that we use on on aTaskQueue to decode the decrypted stream.
// This is called on the decode task queue.
void SetCDMProxy(CDMProxy* aProxy);
+#endif
static constexpr int kYUV400 = 0;
static constexpr int kYUV420 = 1;
diff --git a/dom/media/platforms/moz.build b/dom/media/platforms/moz.build
index f5fb72c5d..c46d52e3f 100644
--- a/dom/media/platforms/moz.build
+++ b/dom/media/platforms/moz.build
@@ -30,11 +30,13 @@ UNIFIED_SOURCES += [
]
DIRS += [
- 'agnostic/eme',
'agnostic/gmp',
'omx'
]
+if CONFIG['MOZ_EME']:
+ DIRS += ['agnostic/eme']
+
if CONFIG['MOZ_WMF']:
DIRS += [ 'wmf' ];
diff --git a/dom/moz.build b/dom/moz.build
index 54dc0510e..89c539b4b 100644
--- a/dom/moz.build
+++ b/dom/moz.build
@@ -52,10 +52,10 @@ DIRS += [
'fetch',
'filehandle',
'filesystem',
- 'flyweb',
'gamepad',
'geolocation',
'grid',
+ 'heapsnapshot',
'html',
'json',
'jsurl',
@@ -107,8 +107,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
if CONFIG['MOZ_SECUREELEMENT']:
DIRS += ['secureelement']
-DIRS += ['presentation']
-
TEST_DIRS += [
'tests',
'imptests',
diff --git a/dom/performance/Performance.h b/dom/performance/Performance.h
index 4debecc90..c40dd8aff 100644
--- a/dom/performance/Performance.h
+++ b/dom/performance/Performance.h
@@ -96,8 +96,10 @@ public:
IMPL_EVENT_HANDLER(resourcetimingbufferfull)
+#ifdef MOZ_DEVTOOLS_SERVER
virtual void GetMozMemory(JSContext *aCx,
JS::MutableHandle<JSObject*> aObj) = 0;
+#endif
virtual nsDOMNavigationTiming* GetDOMTiming() const = 0;
diff --git a/dom/performance/PerformanceMainThread.cpp b/dom/performance/PerformanceMainThread.cpp
index 5a84f5fb1..b95a91ea6 100644
--- a/dom/performance/PerformanceMainThread.cpp
+++ b/dom/performance/PerformanceMainThread.cpp
@@ -11,6 +11,7 @@
namespace mozilla {
namespace dom {
+
NS_IMPL_CYCLE_COLLECTION_CLASS(PerformanceMainThread)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(PerformanceMainThread,
@@ -18,8 +19,10 @@ NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(PerformanceMainThread,
NS_IMPL_CYCLE_COLLECTION_UNLINK(mTiming,
mNavigation,
mDocEntry)
+#ifdef MOZ_DEVTOOLS_SERVER
tmp->mMozMemory = nullptr;
mozilla::DropJSObjects(this);
+#endif
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(PerformanceMainThread,
@@ -31,7 +34,9 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
NS_IMPL_CYCLE_COLLECTION_TRACE_BEGIN_INHERITED(PerformanceMainThread,
Performance)
+#ifdef MOZ_DEVTOOLS_SERVER
NS_IMPL_CYCLE_COLLECTION_TRACE_JS_MEMBER_CALLBACK(mMozMemory)
+#endif
NS_IMPL_CYCLE_COLLECTION_TRACE_END
NS_IMPL_ADDREF_INHERITED(PerformanceMainThread, Performance)
@@ -55,9 +60,12 @@ PerformanceMainThread::PerformanceMainThread(nsPIDOMWindowInner* aWindow,
PerformanceMainThread::~PerformanceMainThread()
{
+#ifdef MOZ_DEVTOOLS_SERVER
mozilla::DropJSObjects(this);
+#endif
}
+#ifdef MOZ_DEVTOOLS_SERVER
void
PerformanceMainThread::GetMozMemory(JSContext *aCx,
JS::MutableHandle<JSObject*> aObj)
@@ -71,6 +79,7 @@ PerformanceMainThread::GetMozMemory(JSContext *aCx,
aObj.set(mMozMemory);
}
+#endif
PerformanceTiming*
PerformanceMainThread::Timing()
diff --git a/dom/performance/PerformanceMainThread.h b/dom/performance/PerformanceMainThread.h
index 9f0e185fc..a90a53520 100644
--- a/dom/performance/PerformanceMainThread.h
+++ b/dom/performance/PerformanceMainThread.h
@@ -34,8 +34,10 @@ public:
DOMHighResTimeStamp CreationTime() const override;
+#ifdef MOZ_DEVTOOLS_SERVER
virtual void GetMozMemory(JSContext *aCx,
JS::MutableHandle<JSObject*> aObj) override;
+#endif
virtual nsDOMNavigationTiming* GetDOMTiming() const override
{
@@ -79,7 +81,9 @@ protected:
nsCOMPtr<nsITimedChannel> mChannel;
RefPtr<PerformanceTiming> mTiming;
RefPtr<PerformanceNavigation> mNavigation;
+#ifdef MOZ_DEVTOOLS_SERVER
JS::Heap<JSObject*> mMozMemory;
+#endif
};
} // namespace dom
diff --git a/dom/performance/PerformanceWorker.h b/dom/performance/PerformanceWorker.h
index 346bdd026..ffe2a1998 100644
--- a/dom/performance/PerformanceWorker.h
+++ b/dom/performance/PerformanceWorker.h
@@ -43,11 +43,13 @@ public:
DOMHighResTimeStamp CreationTime() const override;
+#ifdef MOZ_DEVTOOLS_SERVER
virtual void GetMozMemory(JSContext *aCx,
JS::MutableHandle<JSObject*> aObj) override
{
MOZ_CRASH("This should not be called on workers.");
}
+#endif
virtual nsDOMNavigationTiming* GetDOMTiming() const override
{
diff --git a/dom/plugins/base/PluginPRLibrary.cpp b/dom/plugins/base/PluginPRLibrary.cpp
index ecc55d455..57c6c57ab 100644
--- a/dom/plugins/base/PluginPRLibrary.cpp
+++ b/dom/plugins/base/PluginPRLibrary.cpp
@@ -21,43 +21,10 @@ static int gNotOptimized;
#define CALLING_CONVENTION_HACK
#endif
-#ifdef MOZ_WIDGET_ANDROID
-#include "AndroidBridge.h"
-#include "android_npapi.h"
-#include <android/log.h>
-#undef ALOG
-#define ALOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoJavaEnv", ## args)
-#endif
-
using namespace mozilla::layers;
namespace mozilla {
-#ifdef MOZ_WIDGET_ANDROID
-nsresult
-PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs,
- NPPluginFuncs* pFuncs, NPError* error)
-{
- JNIEnv* env = jni::GetEnvForThread();
-
- mozilla::AutoLocalJNIFrame jniFrame(env);
-
- if (mNP_Initialize) {
- *error = mNP_Initialize(bFuncs, pFuncs, env);
- } else {
- NP_InitializeFunc pfNP_Initialize = (NP_InitializeFunc)
- PR_FindFunctionSymbol(mLibrary, "NP_Initialize");
- if (!pfNP_Initialize)
- return NS_ERROR_FAILURE;
- *error = pfNP_Initialize(bFuncs, pFuncs, env);
- }
-
- // Save pointers to functions that get called through PluginLibrary itself.
- mNPP_New = pFuncs->newp;
- mNPP_ClearSiteData = pFuncs->clearsitedata;
- mNPP_GetSitesWithData = pFuncs->getsiteswithdata;
- return NS_OK;
-}
-#elif defined(XP_UNIX) && !defined(XP_MACOSX)
+#if defined(XP_UNIX) && !defined(XP_MACOSX)
nsresult
PluginPRLibrary::NP_Initialize(NPNetscapeFuncs* bFuncs,
NPPluginFuncs* pFuncs, NPError* error)
diff --git a/dom/plugins/base/android/ANPAudio.cpp b/dom/plugins/base/android/ANPAudio.cpp
deleted file mode 100644
index bc47e8999..000000000
--- a/dom/plugins/base/android/ANPAudio.cpp
+++ /dev/null
@@ -1,390 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "base/basictypes.h"
-#include "AndroidBridge.h"
-
-#include <android/log.h>
-#include <stdlib.h>
-#include <time.h>
-
-#include "assert.h"
-#include "ANPBase.h"
-#include "nsIThread.h"
-#include "nsThreadUtils.h"
-#include "mozilla/Mutex.h"
-
-#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPluginsAudio" , ## args)
-#define ASSIGN(obj, name) (obj)->name = anp_audio_##name
-
-/* android.media.AudioTrack */
-struct AudioTrack {
- jclass at_class;
- jmethodID constructor;
- jmethodID flush;
- jmethodID pause;
- jmethodID play;
- jmethodID setvol;
- jmethodID stop;
- jmethodID write;
- jmethodID getpos;
- jmethodID getstate;
- jmethodID release;
-};
-
-enum AudioTrackMode {
- MODE_STATIC = 0,
- MODE_STREAM = 1
-};
-
-/* android.media.AudioManager */
-enum AudioManagerStream {
- STREAM_VOICE_CALL = 0,
- STREAM_SYSTEM = 1,
- STREAM_RING = 2,
- STREAM_MUSIC = 3,
- STREAM_ALARM = 4,
- STREAM_NOTIFICATION = 5,
- STREAM_DTMF = 8
-};
-
-/* android.media.AudioFormat */
-enum AudioFormatChannel {
- CHANNEL_OUT_MONO = 4,
- CHANNEL_OUT_STEREO = 12
-};
-
-enum AudioFormatEncoding {
- ENCODING_PCM_16BIT = 2,
- ENCODING_PCM_8BIT = 3
-};
-
-enum AudioFormatState {
- STATE_UNINITIALIZED = 0,
- STATE_INITIALIZED = 1,
- STATE_NO_STATIC_DATA = 2
-};
-
-static struct AudioTrack at;
-
-static jclass
-init_jni_bindings(JNIEnv *jenv) {
- jclass jc =
- (jclass)jenv->NewGlobalRef(jenv->FindClass("android/media/AudioTrack"));
-
- at.constructor = jenv->GetMethodID(jc, "<init>", "(IIIIII)V");
- at.flush = jenv->GetMethodID(jc, "flush", "()V");
- at.pause = jenv->GetMethodID(jc, "pause", "()V");
- at.play = jenv->GetMethodID(jc, "play", "()V");
- at.setvol = jenv->GetMethodID(jc, "setStereoVolume", "(FF)I");
- at.stop = jenv->GetMethodID(jc, "stop", "()V");
- at.write = jenv->GetMethodID(jc, "write", "([BII)I");
- at.getpos = jenv->GetMethodID(jc, "getPlaybackHeadPosition", "()I");
- at.getstate = jenv->GetMethodID(jc, "getState", "()I");
- at.release = jenv->GetMethodID(jc, "release", "()V");
-
- return jc;
-}
-
-struct ANPAudioTrack {
- jobject output_unit;
- jclass at_class;
-
- unsigned int rate;
- unsigned int channels;
- unsigned int bufferSize;
- unsigned int isStopped;
- unsigned int keepGoing;
-
- mozilla::Mutex lock;
-
- void* user;
- ANPAudioCallbackProc proc;
- ANPSampleFormat format;
-
- ANPAudioTrack() : lock("ANPAudioTrack") { }
-};
-
-class AudioRunnable : public mozilla::Runnable
-{
-public:
- NS_DECL_NSIRUNNABLE
-
- AudioRunnable(ANPAudioTrack* aAudioTrack) {
- mTrack = aAudioTrack;
- }
-
- ANPAudioTrack* mTrack;
-};
-
-NS_IMETHODIMP
-AudioRunnable::Run()
-{
- PR_SetCurrentThreadName("Android Audio");
-
- JNIEnv* const jenv = mozilla::jni::GetEnvForThread();
-
- mozilla::AutoLocalJNIFrame autoFrame(jenv, 2);
-
- jbyteArray bytearray = jenv->NewByteArray(mTrack->bufferSize);
- if (!bytearray) {
- LOG("AudioRunnable:: Run. Could not create bytearray");
- return NS_ERROR_FAILURE;
- }
-
- jbyte *byte = jenv->GetByteArrayElements(bytearray, nullptr);
- if (!byte) {
- LOG("AudioRunnable:: Run. Could not create bytearray");
- return NS_ERROR_FAILURE;
- }
-
- ANPAudioBuffer buffer;
- buffer.channelCount = mTrack->channels;
- buffer.format = mTrack->format;
- buffer.bufferData = (void*) byte;
-
- while (true)
- {
- // reset the buffer size
- buffer.size = mTrack->bufferSize;
-
- {
- mozilla::MutexAutoLock lock(mTrack->lock);
-
- if (!mTrack->keepGoing)
- break;
-
- // Get data from the plugin
- mTrack->proc(kMoreData_ANPAudioEvent, mTrack->user, &buffer);
- }
-
- if (buffer.size == 0) {
- LOG("%p - kMoreData_ANPAudioEvent", mTrack);
- continue;
- }
-
- size_t wroteSoFar = 0;
- jint retval;
- do {
- retval = jenv->CallIntMethod(mTrack->output_unit,
- at.write,
- bytearray,
- wroteSoFar,
- buffer.size - wroteSoFar);
- if (retval < 0) {
- LOG("%p - Write failed %d", mTrack, retval);
- break;
- }
-
- wroteSoFar += retval;
-
- } while(wroteSoFar < buffer.size);
- }
-
- jenv->CallVoidMethod(mTrack->output_unit, at.release);
-
- jenv->DeleteGlobalRef(mTrack->output_unit);
- jenv->DeleteGlobalRef(mTrack->at_class);
-
- delete mTrack;
-
- jenv->ReleaseByteArrayElements(bytearray, byte, 0);
-
- return NS_OK;
-}
-
-ANPAudioTrack*
-anp_audio_newTrack(uint32_t sampleRate, // sampling rate in Hz
- ANPSampleFormat format,
- int channelCount, // MONO=1, STEREO=2
- ANPAudioCallbackProc proc,
- void* user)
-{
- ANPAudioTrack *s = new ANPAudioTrack();
- if (s == nullptr) {
- return nullptr;
- }
-
- JNIEnv* const jenv = mozilla::jni::GetEnvForThread();
-
- s->at_class = init_jni_bindings(jenv);
- s->rate = sampleRate;
- s->channels = channelCount;
- s->bufferSize = s->rate * s->channels;
- s->isStopped = true;
- s->keepGoing = false;
- s->user = user;
- s->proc = proc;
- s->format = format;
-
- int jformat;
- switch (format) {
- case kPCM16Bit_ANPSampleFormat:
- jformat = ENCODING_PCM_16BIT;
- break;
- case kPCM8Bit_ANPSampleFormat:
- jformat = ENCODING_PCM_8BIT;
- break;
- default:
- LOG("Unknown audio format. defaulting to 16bit.");
- jformat = ENCODING_PCM_16BIT;
- break;
- }
-
- int jChannels;
- switch (channelCount) {
- case 1:
- jChannels = CHANNEL_OUT_MONO;
- break;
- case 2:
- jChannels = CHANNEL_OUT_STEREO;
- break;
- default:
- LOG("Unknown channel count. defaulting to mono.");
- jChannels = CHANNEL_OUT_MONO;
- break;
- }
-
- mozilla::AutoLocalJNIFrame autoFrame(jenv);
-
- jobject obj = jenv->NewObject(s->at_class,
- at.constructor,
- STREAM_MUSIC,
- s->rate,
- jChannels,
- jformat,
- s->bufferSize,
- MODE_STREAM);
-
- if (autoFrame.CheckForException() || obj == nullptr) {
- jenv->DeleteGlobalRef(s->at_class);
- delete s;
- return nullptr;
- }
-
- jint state = jenv->CallIntMethod(obj, at.getstate);
-
- if (autoFrame.CheckForException() || state == STATE_UNINITIALIZED) {
- jenv->DeleteGlobalRef(s->at_class);
- delete s;
- return nullptr;
- }
-
- s->output_unit = jenv->NewGlobalRef(obj);
- return s;
-}
-
-void
-anp_audio_deleteTrack(ANPAudioTrack* s)
-{
- if (s == nullptr) {
- return;
- }
-
- mozilla::MutexAutoLock lock(s->lock);
- s->keepGoing = false;
-
- // deallocation happens in the AudioThread. There is a
- // potential leak if anp_audio_start is never called, but
- // we do not see that from flash.
-}
-
-void
-anp_audio_start(ANPAudioTrack* s)
-{
- if (s == nullptr || s->output_unit == nullptr) {
- return;
- }
-
- if (s->keepGoing) {
- // we are already playing. Ignore.
- return;
- }
-
- JNIEnv* const jenv = mozilla::jni::GetEnvForThread();
-
- mozilla::AutoLocalJNIFrame autoFrame(jenv, 0);
- jenv->CallVoidMethod(s->output_unit, at.play);
-
- if (autoFrame.CheckForException()) {
- jenv->DeleteGlobalRef(s->at_class);
- delete s;
- return;
- }
-
- s->isStopped = false;
- s->keepGoing = true;
-
- // AudioRunnable now owns the ANPAudioTrack
- RefPtr<AudioRunnable> runnable = new AudioRunnable(s);
-
- nsCOMPtr<nsIThread> thread;
- NS_NewThread(getter_AddRefs(thread), runnable);
-}
-
-void
-anp_audio_pause(ANPAudioTrack* s)
-{
- if (s == nullptr || s->output_unit == nullptr) {
- return;
- }
-
- JNIEnv* const jenv = mozilla::jni::GetEnvForThread();
-
- mozilla::AutoLocalJNIFrame autoFrame(jenv, 0);
- jenv->CallVoidMethod(s->output_unit, at.pause);
-}
-
-void
-anp_audio_stop(ANPAudioTrack* s)
-{
- if (s == nullptr || s->output_unit == nullptr) {
- return;
- }
-
- s->isStopped = true;
- JNIEnv* const jenv = mozilla::jni::GetEnvForThread();
-
- mozilla::AutoLocalJNIFrame autoFrame(jenv, 0);
- jenv->CallVoidMethod(s->output_unit, at.stop);
-}
-
-bool
-anp_audio_isStopped(ANPAudioTrack* s)
-{
- return s->isStopped;
-}
-
-uint32_t
-anp_audio_trackLatency(ANPAudioTrack* s) {
- // Hardcode an estimate of the system's audio latency. Flash hardcodes
- // similar latency estimates for pre-Honeycomb devices that do not support
- // ANPAudioTrackInterfaceV1's trackLatency(). The Android stock browser
- // calls android::AudioTrack::latency(), an internal Android API that is
- // not available in the public NDK:
- // https://github.com/android/platform_external_webkit/commit/49bf866973cb3b2a6c74c0eab864e9562e4cbab1
- return 100; // milliseconds
-}
-
-void InitAudioTrackInterfaceV0(ANPAudioTrackInterfaceV0 *i) {
- _assert(i->inSize == sizeof(*i));
- ASSIGN(i, newTrack);
- ASSIGN(i, deleteTrack);
- ASSIGN(i, start);
- ASSIGN(i, pause);
- ASSIGN(i, stop);
- ASSIGN(i, isStopped);
-}
-
-void InitAudioTrackInterfaceV1(ANPAudioTrackInterfaceV1 *i) {
- _assert(i->inSize == sizeof(*i));
- ASSIGN(i, newTrack);
- ASSIGN(i, deleteTrack);
- ASSIGN(i, start);
- ASSIGN(i, pause);
- ASSIGN(i, stop);
- ASSIGN(i, isStopped);
- ASSIGN(i, trackLatency);
-}
diff --git a/dom/plugins/base/android/ANPBase.h b/dom/plugins/base/android/ANPBase.h
deleted file mode 100644
index f9712dc79..000000000
--- a/dom/plugins/base/android/ANPBase.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdlib.h>
-#include "android_npapi.h"
-#include "nsISupportsImpl.h"
-
-#define NOT_IMPLEMENTED_FATAL() do { \
- __android_log_print(ANDROID_LOG_ERROR, "GeckoPlugins", \
- "%s not implemented %s, %d", \
- __PRETTY_FUNCTION__, __FILE__, __LINE__); \
- abort(); \
- } while(0)
-
-#define NOT_IMPLEMENTED() \
- __android_log_print(ANDROID_LOG_ERROR, "GeckoPlugins", \
- "!!!!!!!!!!!!!! %s not implemented %s, %d", \
- __PRETTY_FUNCTION__, __FILE__, __LINE__); \
-
-void InitAudioTrackInterfaceV0(ANPAudioTrackInterfaceV0 *i);
-void InitAudioTrackInterfaceV1(ANPAudioTrackInterfaceV1* i);
-void InitCanvasInterface(ANPCanvasInterfaceV0 *i);
-void InitEventInterface(ANPEventInterfaceV0 *i);
-void InitLogInterface(ANPLogInterfaceV0 *i);
-void InitPaintInterface(ANPPaintInterfaceV0 *i);
-void InitSurfaceInterface(ANPSurfaceInterfaceV0 *i);
-void InitSystemInterfaceV1(ANPSystemInterfaceV1 *i);
-void InitSystemInterfaceV2(ANPSystemInterfaceV2 *i);
-void InitTypeFaceInterface(ANPTypefaceInterfaceV0 *i);
-void InitWindowInterface(ANPWindowInterfaceV0 *i);
-void InitWindowInterfaceV2(ANPWindowInterfaceV2 *i);
-void InitVideoInterfaceV1(ANPVideoInterfaceV1 *i);
-void InitOpenGLInterface(ANPOpenGLInterfaceV0 *i);
-void InitNativeWindowInterface(ANPNativeWindowInterfaceV0 *i);
diff --git a/dom/plugins/base/android/ANPEvent.cpp b/dom/plugins/base/android/ANPEvent.cpp
deleted file mode 100644
index cac8c94f0..000000000
--- a/dom/plugins/base/android/ANPEvent.cpp
+++ /dev/null
@@ -1,31 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "assert.h"
-#include "ANPBase.h"
-#include <android/log.h>
-#include "nsThreadUtils.h"
-#include "nsNPAPIPluginInstance.h"
-#include "nsNPAPIPlugin.h"
-
-#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
-#define ASSIGN(obj, name) (obj)->name = anp_event_##name
-
-void
-anp_event_postEvent(NPP instance, const ANPEvent* event)
-{
- LOG("%s", __PRETTY_FUNCTION__);
-
- nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
- pinst->PostEvent((void*) event);
-
- LOG("returning from %s", __PRETTY_FUNCTION__);
-}
-
-
-void InitEventInterface(ANPEventInterfaceV0 *i) {
- _assert(i->inSize == sizeof(*i));
- ASSIGN(i, postEvent);
-}
diff --git a/dom/plugins/base/android/ANPKeyCodes.h b/dom/plugins/base/android/ANPKeyCodes.h
deleted file mode 100644
index edfe2b95c..000000000
--- a/dom/plugins/base/android/ANPKeyCodes.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
- * Copyright 2008, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef ANPKeyCodes_DEFINED
-#define ANPKeyCodes_DEFINED
-
-/* List the key codes that are set to a plugin in the ANPKeyEvent.
-
- These exactly match the values in android/view/KeyEvent.java and the
- corresponding .h file android/keycodes.h.
-*/
-enum ANPKeyCodes {
- kUnknown_ANPKeyCode = 0,
-
- kSoftLeft_ANPKeyCode = 1,
- kSoftRight_ANPKeyCode = 2,
- kHome_ANPKeyCode = 3,
- kBack_ANPKeyCode = 4,
- kCall_ANPKeyCode = 5,
- kEndCall_ANPKeyCode = 6,
- k0_ANPKeyCode = 7,
- k1_ANPKeyCode = 8,
- k2_ANPKeyCode = 9,
- k3_ANPKeyCode = 10,
- k4_ANPKeyCode = 11,
- k5_ANPKeyCode = 12,
- k6_ANPKeyCode = 13,
- k7_ANPKeyCode = 14,
- k8_ANPKeyCode = 15,
- k9_ANPKeyCode = 16,
- kStar_ANPKeyCode = 17,
- kPound_ANPKeyCode = 18,
- kDpadUp_ANPKeyCode = 19,
- kDpadDown_ANPKeyCode = 20,
- kDpadLeft_ANPKeyCode = 21,
- kDpadRight_ANPKeyCode = 22,
- kDpadCenter_ANPKeyCode = 23,
- kVolumeUp_ANPKeyCode = 24,
- kVolumeDown_ANPKeyCode = 25,
- kPower_ANPKeyCode = 26,
- kCamera_ANPKeyCode = 27,
- kClear_ANPKeyCode = 28,
- kA_ANPKeyCode = 29,
- kB_ANPKeyCode = 30,
- kC_ANPKeyCode = 31,
- kD_ANPKeyCode = 32,
- kE_ANPKeyCode = 33,
- kF_ANPKeyCode = 34,
- kG_ANPKeyCode = 35,
- kH_ANPKeyCode = 36,
- kI_ANPKeyCode = 37,
- kJ_ANPKeyCode = 38,
- kK_ANPKeyCode = 39,
- kL_ANPKeyCode = 40,
- kM_ANPKeyCode = 41,
- kN_ANPKeyCode = 42,
- kO_ANPKeyCode = 43,
- kP_ANPKeyCode = 44,
- kQ_ANPKeyCode = 45,
- kR_ANPKeyCode = 46,
- kS_ANPKeyCode = 47,
- kT_ANPKeyCode = 48,
- kU_ANPKeyCode = 49,
- kV_ANPKeyCode = 50,
- kW_ANPKeyCode = 51,
- kX_ANPKeyCode = 52,
- kY_ANPKeyCode = 53,
- kZ_ANPKeyCode = 54,
- kComma_ANPKeyCode = 55,
- kPeriod_ANPKeyCode = 56,
- kAltLeft_ANPKeyCode = 57,
- kAltRight_ANPKeyCode = 58,
- kShiftLeft_ANPKeyCode = 59,
- kShiftRight_ANPKeyCode = 60,
- kTab_ANPKeyCode = 61,
- kSpace_ANPKeyCode = 62,
- kSym_ANPKeyCode = 63,
- kExplorer_ANPKeyCode = 64,
- kEnvelope_ANPKeyCode = 65,
- kNewline_ANPKeyCode = 66,
- kDel_ANPKeyCode = 67,
- kGrave_ANPKeyCode = 68,
- kMinus_ANPKeyCode = 69,
- kEquals_ANPKeyCode = 70,
- kLeftBracket_ANPKeyCode = 71,
- kRightBracket_ANPKeyCode = 72,
- kBackslash_ANPKeyCode = 73,
- kSemicolon_ANPKeyCode = 74,
- kApostrophe_ANPKeyCode = 75,
- kSlash_ANPKeyCode = 76,
- kAt_ANPKeyCode = 77,
- kNum_ANPKeyCode = 78,
- kHeadSetHook_ANPKeyCode = 79,
- kFocus_ANPKeyCode = 80,
- kPlus_ANPKeyCode = 81,
- kMenu_ANPKeyCode = 82,
- kNotification_ANPKeyCode = 83,
- kSearch_ANPKeyCode = 84,
- kMediaPlayPause_ANPKeyCode = 85,
- kMediaStop_ANPKeyCode = 86,
- kMediaNext_ANPKeyCode = 87,
- kMediaPrevious_ANPKeyCode = 88,
- kMediaRewind_ANPKeyCode = 89,
- kMediaFastForward_ANPKeyCode = 90,
- kMute_ANPKeyCode = 91,
- kPageUp_ANPKeyCode = 92,
- kPageDown_ANPKeyCode = 93,
- kPictsymbols_ANPKeyCode = 94,
- kSwitchCharset_ANPKeyCode = 95,
- kButtonA_ANPKeyCode = 96,
- kButtonB_ANPKeyCode = 97,
- kButtonC_ANPKeyCode = 98,
- kButtonX_ANPKeyCode = 99,
- kButtonY_ANPKeyCode = 100,
- kButtonZ_ANPKeyCode = 101,
- kButtonL1_ANPKeyCode = 102,
- kButtonR1_ANPKeyCode = 103,
- kButtonL2_ANPKeyCode = 104,
- kButtonR2_ANPKeyCode = 105,
- kButtonThumbL_ANPKeyCode = 106,
- kButtonThumbR_ANPKeyCode = 107,
- kButtonStart_ANPKeyCode = 108,
- kButtonSelect_ANPKeyCode = 109,
- kButtonMode_ANPKeyCode = 110,
-
- // NOTE: If you add a new keycode here you must also add it to several other files.
- // Refer to frameworks/base/core/java/android/view/KeyEvent.java for the full list.
-};
-
-#endif
diff --git a/dom/plugins/base/android/ANPLog.cpp b/dom/plugins/base/android/ANPLog.cpp
deleted file mode 100644
index 7ce13107b..000000000
--- a/dom/plugins/base/android/ANPLog.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "assert.h"
-#include "ANPBase.h"
-#include <android/log.h>
-
-#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
-#define ASSIGN(obj, name) (obj)->name = anp_log_##name
-
-void
-anp_log_log(ANPLogType type, const char format[], ...) {
-
- va_list argp;
- va_start(argp,format);
- __android_log_vprint(type == kError_ANPLogType ? ANDROID_LOG_ERROR : type == kWarning_ANPLogType ?
- ANDROID_LOG_WARN : ANDROID_LOG_INFO, "GeckoPluginLog", format, argp);
- va_end(argp);
-}
-
-void InitLogInterface(ANPLogInterfaceV0 *i) {
- _assert(i->inSize == sizeof(*i));
- ASSIGN(i, log);
-}
diff --git a/dom/plugins/base/android/ANPNativeWindow.cpp b/dom/plugins/base/android/ANPNativeWindow.cpp
deleted file mode 100644
index 88b43bd4a..000000000
--- a/dom/plugins/base/android/ANPNativeWindow.cpp
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// must include config.h first for webkit to fiddle with new/delete
-#include <android/log.h>
-#include "ANPBase.h"
-#include "nsIPluginInstanceOwner.h"
-#include "nsPluginInstanceOwner.h"
-#include "nsNPAPIPluginInstance.h"
-#include "gfxRect.h"
-
-using namespace mozilla;
-
-#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
-#define ASSIGN(obj, name) (obj)->name = anp_native_window_##name
-
-static ANPNativeWindow anp_native_window_acquireNativeWindow(NPP instance) {
- nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
- return pinst->AcquireContentWindow();
-}
-
-static void anp_native_window_invertPluginContent(NPP instance, bool isContentInverted) {
- // NativeWindow is TopLeft if uninverted.
- gl::OriginPos newOriginPos = gl::OriginPos::TopLeft;
- if (isContentInverted)
- newOriginPos = gl::OriginPos::BottomLeft;
-
- nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
- pinst->SetOriginPos(newOriginPos);
- pinst->RedrawPlugin();
-}
-
-
-void InitNativeWindowInterface(ANPNativeWindowInterfaceV0* i) {
- ASSIGN(i, acquireNativeWindow);
- ASSIGN(i, invertPluginContent);
-}
diff --git a/dom/plugins/base/android/ANPSurface.cpp b/dom/plugins/base/android/ANPSurface.cpp
deleted file mode 100644
index b6a699f28..000000000
--- a/dom/plugins/base/android/ANPSurface.cpp
+++ /dev/null
@@ -1,266 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <dlfcn.h>
-#include <android/log.h>
-#include "ANPBase.h"
-
-#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
-#define ASSIGN(obj, name) (obj)->name = anp_surface_##name
-
-#define CLEAR_EXCEPTION(env) if (env->ExceptionOccurred()) env->ExceptionClear();
-
-#define ANDROID_REGION_SIZE 512
-
-enum {
- PIXEL_FORMAT_RGBA_8888 = 1,
- PIXEL_FORMAT_RGB_565 = 4,
-};
-
-struct SurfaceInfo {
- uint32_t w;
- uint32_t h;
- uint32_t s;
- uint32_t usage;
- uint32_t format;
- unsigned char* bits;
- uint32_t reserved[2];
-};
-
-typedef struct ARect {
- int32_t left;
- int32_t top;
- int32_t right;
- int32_t bottom;
-} ARect;
-
-
-// used to cache JNI method and field IDs for Surface Objects
-static struct ANPSurfaceInterfaceJavaGlue {
- bool initialized;
- jmethodID getSurfaceHolder;
- jmethodID getSurface;
- jfieldID surfacePointer;
-} gSurfaceJavaGlue;
-
-static struct ANPSurfaceFunctions {
- bool initialized;
-
- int (* lock)(void*, SurfaceInfo*, void*);
- int (* unlockAndPost)(void*);
-
- void* (* regionConstructor)(void*);
- void (* setRegion)(void*, ARect const&);
-} gSurfaceFunctions;
-
-
-static inline void* getSurface(JNIEnv* env, jobject view) {
- if (!env || !view) {
- return nullptr;
- }
-
- if (!gSurfaceJavaGlue.initialized) {
-
- jclass surfaceViewClass = env->FindClass("android/view/SurfaceView");
- gSurfaceJavaGlue.getSurfaceHolder = env->GetMethodID(surfaceViewClass, "getHolder", "()Landroid/view/SurfaceHolder;");
-
- jclass surfaceHolderClass = env->FindClass("android/view/SurfaceHolder");
- gSurfaceJavaGlue.getSurface = env->GetMethodID(surfaceHolderClass, "getSurface", "()Landroid/view/Surface;");
-
- jclass surfaceClass = env->FindClass("android/view/Surface");
- gSurfaceJavaGlue.surfacePointer = env->GetFieldID(surfaceClass,
- "mSurfacePointer", "I");
-
- if (!gSurfaceJavaGlue.surfacePointer) {
- CLEAR_EXCEPTION(env);
-
- // It was something else in 2.2.
- gSurfaceJavaGlue.surfacePointer = env->GetFieldID(surfaceClass,
- "mSurface", "I");
-
- if (!gSurfaceJavaGlue.surfacePointer) {
- CLEAR_EXCEPTION(env);
-
- // And something else in 2.3+
- gSurfaceJavaGlue.surfacePointer = env->GetFieldID(surfaceClass,
- "mNativeSurface", "I");
-
- CLEAR_EXCEPTION(env);
- }
- }
-
- if (!gSurfaceJavaGlue.surfacePointer) {
- LOG("Failed to acquire surface pointer");
- return nullptr;
- }
-
- env->DeleteLocalRef(surfaceClass);
- env->DeleteLocalRef(surfaceViewClass);
- env->DeleteLocalRef(surfaceHolderClass);
-
- gSurfaceJavaGlue.initialized = (gSurfaceJavaGlue.surfacePointer != nullptr);
- }
-
- jobject holder = env->CallObjectMethod(view, gSurfaceJavaGlue.getSurfaceHolder);
- jobject surface = env->CallObjectMethod(holder, gSurfaceJavaGlue.getSurface);
- jint surfacePointer = env->GetIntField(surface, gSurfaceJavaGlue.surfacePointer);
-
- env->DeleteLocalRef(holder);
- env->DeleteLocalRef(surface);
-
- return (void*)surfacePointer;
-}
-
-static ANPBitmapFormat convertPixelFormat(int32_t format) {
- switch (format) {
- case PIXEL_FORMAT_RGBA_8888: return kRGBA_8888_ANPBitmapFormat;
- case PIXEL_FORMAT_RGB_565: return kRGB_565_ANPBitmapFormat;
- default: return kUnknown_ANPBitmapFormat;
- }
-}
-
-static int bytesPerPixel(int32_t format) {
- switch (format) {
- case PIXEL_FORMAT_RGBA_8888: return 4;
- case PIXEL_FORMAT_RGB_565: return 2;
- default: return -1;
- }
-}
-
-static bool init() {
- if (gSurfaceFunctions.initialized)
- return true;
-
- void* handle = dlopen("libsurfaceflinger_client.so", RTLD_LAZY);
-
- if (!handle) {
- LOG("Failed to open libsurfaceflinger_client.so");
- return false;
- }
-
- gSurfaceFunctions.lock = (int (*)(void*, SurfaceInfo*, void*))dlsym(handle, "_ZN7android7Surface4lockEPNS0_11SurfaceInfoEPNS_6RegionEb");
- gSurfaceFunctions.unlockAndPost = (int (*)(void*))dlsym(handle, "_ZN7android7Surface13unlockAndPostEv");
-
-
- if (!gSurfaceFunctions.lock) {
- // Stuff changed in 3.0/4.0
- handle = dlopen("libgui.so", RTLD_LAZY);
- gSurfaceFunctions.lock = (int (*)(void*, SurfaceInfo*, void*))dlsym(handle, "_ZN7android7Surface4lockEPNS0_11SurfaceInfoEPNS_6RegionE");
- gSurfaceFunctions.unlockAndPost = (int (*)(void*))dlsym(handle, "_ZN7android7Surface13unlockAndPostEv");
- }
-
- handle = dlopen("libui.so", RTLD_LAZY);
- if (!handle) {
- LOG("Failed to open libui.so");
- return false;
- }
-
- gSurfaceFunctions.regionConstructor = (void* (*)(void*))dlsym(handle, "_ZN7android6RegionC1Ev");
- gSurfaceFunctions.setRegion = (void (*)(void*, ARect const&))dlsym(handle, "_ZN7android6Region3setERKNS_4RectE");
-
- gSurfaceFunctions.initialized = (gSurfaceFunctions.lock && gSurfaceFunctions.unlockAndPost &&
- gSurfaceFunctions.regionConstructor && gSurfaceFunctions.setRegion);
- LOG("Initialized? %d\n", gSurfaceFunctions.initialized);
- return gSurfaceFunctions.initialized;
-}
-
-// FIXME: All of this should be changed to use the equivalent things in AndroidBridge, bug 758612
-static bool anp_surface_lock(JNIEnv* env, jobject surfaceView, ANPBitmap* bitmap, ANPRectI* dirtyRect) {
- if (!bitmap || !surfaceView) {
- return false;
- }
-
- void* surface = getSurface(env, surfaceView);
-
- if (!bitmap || !surface) {
- return false;
- }
-
- if (!init()) {
- return false;
- }
-
- void* region = nullptr;
- if (dirtyRect) {
- region = malloc(ANDROID_REGION_SIZE);
- gSurfaceFunctions.regionConstructor(region);
-
- ARect rect;
- rect.left = dirtyRect->left;
- rect.top = dirtyRect->top;
- rect.right = dirtyRect->right;
- rect.bottom = dirtyRect->bottom;
-
- gSurfaceFunctions.setRegion(region, rect);
- }
-
- SurfaceInfo info;
- int err = gSurfaceFunctions.lock(surface, &info, region);
- if (err < 0) {
- LOG("Failed to lock surface");
- return false;
- }
-
- // the surface may have expanded the dirty region so we must to pass that
- // information back to the plugin.
- if (dirtyRect) {
- ARect* dirtyBounds = (ARect*)region; // The bounds are the first member, so this should work!
-
- dirtyRect->left = dirtyBounds->left;
- dirtyRect->right = dirtyBounds->right;
- dirtyRect->top = dirtyBounds->top;
- dirtyRect->bottom = dirtyBounds->bottom;
- }
-
- if (region)
- free(region);
-
- int bpr = info.s * bytesPerPixel(info.format);
-
- bitmap->format = convertPixelFormat(info.format);
- bitmap->width = info.w;
- bitmap->height = info.h;
- bitmap->rowBytes = bpr;
-
- if (info.w > 0 && info.h > 0) {
- bitmap->baseAddr = info.bits;
- } else {
- bitmap->baseAddr = nullptr;
- return false;
- }
-
- return true;
-}
-
-static void anp_surface_unlock(JNIEnv* env, jobject surfaceView) {
- if (!surfaceView) {
- return;
- }
-
- if (!init()) {
- return;
- }
-
- void* surface = getSurface(env, surfaceView);
-
- if (!surface) {
- return;
- }
-
- gSurfaceFunctions.unlockAndPost(surface);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-void InitSurfaceInterface(ANPSurfaceInterfaceV0* i) {
- ASSIGN(i, lock);
- ASSIGN(i, unlock);
-
- // setup the java glue struct
- gSurfaceJavaGlue.initialized = false;
-
- // setup the function struct
- gSurfaceFunctions.initialized = false;
-}
diff --git a/dom/plugins/base/android/ANPSystem.cpp b/dom/plugins/base/android/ANPSystem.cpp
deleted file mode 100644
index d5b2a7710..000000000
--- a/dom/plugins/base/android/ANPSystem.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "base/basictypes.h"
-
-#include "ANPBase.h"
-#include "GeneratedJNIWrappers.h"
-#include "PluginPRLibrary.h"
-#include "assert.h"
-#include "nsNPAPIPluginInstance.h"
-#include "nsNPAPIPlugin.h"
-
-#include <android/log.h>
-
-#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
-#define ASSIGN(obj, name) (obj)->name = anp_system_##name
-
-const char*
-anp_system_getApplicationDataDirectory(NPP instance)
-{
- static const char *dir = nullptr;
- static const char *privateDir = nullptr;
-
- bool isPrivate = false;
-
- if (!dir) {
- dir = getenv("ANDROID_PLUGIN_DATADIR");
- }
-
- if (!privateDir) {
- privateDir = getenv("ANDROID_PLUGIN_DATADIR_PRIVATE");
- }
-
- if (!instance) {
- return dir;
- }
-
- nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
- if (pinst && NS_SUCCEEDED(pinst->IsPrivateBrowsing(&isPrivate)) && isPrivate) {
- return privateDir;
- }
-
- return dir;
-}
-
-const char*
-anp_system_getApplicationDataDirectory()
-{
- return anp_system_getApplicationDataDirectory(nullptr);
-}
-
-jclass anp_system_loadJavaClass(NPP instance, const char* className)
-{
- LOG("%s", __PRETTY_FUNCTION__);
-
- nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
- mozilla::PluginPRLibrary* lib = static_cast<mozilla::PluginPRLibrary*>(pinst->GetPlugin()->GetLibrary());
-
- nsCString libName;
- lib->GetLibraryPath(libName);
-
- return mozilla::java::GeckoAppShell::LoadPluginClass(className, libName).Forget();
-}
-
-void anp_system_setPowerState(NPP instance, ANPPowerState powerState)
-{
- nsNPAPIPluginInstance* pinst = nsNPAPIPluginInstance::GetFromNPP(instance);
-
- if (pinst) {
- pinst->SetWakeLock(powerState == kScreenOn_ANPPowerState);
- }
-}
-
-void InitSystemInterfaceV1(ANPSystemInterfaceV1 *i) {
- _assert(i->inSize == sizeof(*i));
- ASSIGN(i, getApplicationDataDirectory);
- ASSIGN(i, loadJavaClass);
- ASSIGN(i, setPowerState);
-}
-
-void InitSystemInterfaceV2(ANPSystemInterfaceV2 *i) {
- _assert(i->inSize == sizeof(*i));
- ASSIGN(i, getApplicationDataDirectory);
- ASSIGN(i, loadJavaClass);
- ASSIGN(i, setPowerState);
-}
diff --git a/dom/plugins/base/android/ANPVideo.cpp b/dom/plugins/base/android/ANPVideo.cpp
deleted file mode 100644
index 185ab1194..000000000
--- a/dom/plugins/base/android/ANPVideo.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <android/log.h>
-#include "ANPBase.h"
-#include "nsIPluginInstanceOwner.h"
-#include "nsPluginInstanceOwner.h"
-#include "nsNPAPIPluginInstance.h"
-#include "gfxRect.h"
-
-#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
-#define ASSIGN(obj, name) (obj)->name = anp_video_##name
-
-using namespace mozilla;
-
-typedef nsNPAPIPluginInstance::VideoInfo VideoInfo;
-
-static ANPNativeWindow anp_video_acquireNativeWindow(NPP instance) {
- nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
-
- return pinst->AcquireVideoWindow();
-}
-
-static void anp_video_setWindowDimensions(NPP instance, const ANPNativeWindow window,
- const ANPRectF* dimensions) {
- nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
-
- gfxRect rect(dimensions->left, dimensions->top,
- dimensions->right - dimensions->left,
- dimensions->bottom - dimensions->top);
-
- pinst->SetVideoDimensions(window, rect);
- pinst->RedrawPlugin();
-}
-
-static void anp_video_releaseNativeWindow(NPP instance, ANPNativeWindow window) {
- nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
- pinst->ReleaseVideoWindow(window);
- pinst->RedrawPlugin();
-}
-
-static void anp_video_setFramerateCallback(NPP instance, const ANPNativeWindow window, ANPVideoFrameCallbackProc callback) {
- // Bug 722682
- NOT_IMPLEMENTED();
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-void InitVideoInterfaceV1(ANPVideoInterfaceV1* i) {
- ASSIGN(i, acquireNativeWindow);
- ASSIGN(i, setWindowDimensions);
- ASSIGN(i, releaseNativeWindow);
- ASSIGN(i, setFramerateCallback);
-}
diff --git a/dom/plugins/base/android/ANPWindow.cpp b/dom/plugins/base/android/ANPWindow.cpp
deleted file mode 100644
index e9003aff5..000000000
--- a/dom/plugins/base/android/ANPWindow.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "base/basictypes.h"
-#include "assert.h"
-#include "ANPBase.h"
-#include <android/log.h>
-#include "nsNPAPIPluginInstance.h"
-#include "nsPluginInstanceOwner.h"
-#include "nsWindow.h"
-#include "mozilla/dom/ScreenOrientation.h"
-
-#undef LOG
-#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
-#define ASSIGN(obj, name) (obj)->name = anp_window_##name
-
-using namespace mozilla;
-using namespace mozilla::widget;
-using namespace mozilla::dom;
-
-void
-anp_window_setVisibleRects(NPP instance, const ANPRectI rects[], int32_t count)
-{
- NOT_IMPLEMENTED();
-}
-
-void
-anp_window_clearVisibleRects(NPP instance)
-{
- NOT_IMPLEMENTED();
-}
-
-void
-anp_window_showKeyboard(NPP instance, bool value)
-{
- InputContext context;
- context.mIMEState.mEnabled = value ? IMEState::PLUGIN : IMEState::DISABLED;
- context.mIMEState.mOpen = value ? IMEState::OPEN : IMEState::CLOSED;
- context.mActionHint.Assign(EmptyString());
-
- InputContextAction action;
- action.mCause = InputContextAction::CAUSE_UNKNOWN;
- action.mFocusChange = InputContextAction::FOCUS_NOT_CHANGED;
-
- nsWindow* window = nsWindow::TopWindow();
- if (!window) {
- LOG("Couldn't get top window?");
- return;
- }
-
- window->SetInputContext(context, action);
-}
-
-void
-anp_window_requestFullScreen(NPP instance)
-{
- nsNPAPIPluginInstance* inst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
-
- RefPtr<nsPluginInstanceOwner> owner = inst->GetOwner();
- if (!owner) {
- return;
- }
-
- owner->RequestFullScreen();
-}
-
-void
-anp_window_exitFullScreen(NPP instance)
-{
- nsNPAPIPluginInstance* inst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
-
- RefPtr<nsPluginInstanceOwner> owner = inst->GetOwner();
- if (!owner) {
- return;
- }
-
- owner->ExitFullScreen();
-}
-
-void
-anp_window_requestCenterFitZoom(NPP instance)
-{
- NOT_IMPLEMENTED();
-}
-
-ANPRectI
-anp_window_visibleRect(NPP instance)
-{
- ANPRectI rect = { 0, 0, 0, 0 };
-
- nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
-
- nsIntSize currentSize = pinst->CurrentSize();
- rect.left = rect.top = 0;
- rect.right = currentSize.width;
- rect.bottom = currentSize.height;
-
- return rect;
-}
-
-void anp_window_requestFullScreenOrientation(NPP instance, ANPScreenOrientation orientation)
-{
- short newOrientation;
-
- // Convert to the ActivityInfo equivalent
- switch (orientation) {
- case kFixedLandscape_ANPScreenOrientation:
- newOrientation = eScreenOrientation_LandscapePrimary;
- break;
- case kFixedPortrait_ANPScreenOrientation:
- newOrientation = eScreenOrientation_PortraitPrimary;
- break;
- case kLandscape_ANPScreenOrientation:
- newOrientation = eScreenOrientation_LandscapePrimary |
- eScreenOrientation_LandscapeSecondary;
- break;
- case kPortrait_ANPScreenOrientation:
- newOrientation = eScreenOrientation_PortraitPrimary |
- eScreenOrientation_PortraitSecondary;
- break;
- default:
- newOrientation = eScreenOrientation_None;
- break;
- }
-
- nsNPAPIPluginInstance* pinst = static_cast<nsNPAPIPluginInstance*>(instance->ndata);
- pinst->SetFullScreenOrientation(newOrientation);
-}
-
-void InitWindowInterface(ANPWindowInterfaceV0 *i) {
- _assert(i->inSize == sizeof(*i));
- ASSIGN(i, setVisibleRects);
- ASSIGN(i, clearVisibleRects);
- ASSIGN(i, showKeyboard);
- ASSIGN(i, requestFullScreen);
- ASSIGN(i, exitFullScreen);
- ASSIGN(i, requestCenterFitZoom);
-}
-
-void InitWindowInterfaceV2(ANPWindowInterfaceV2 *i) {
- _assert(i->inSize == sizeof(*i));
- ASSIGN(i, setVisibleRects);
- ASSIGN(i, clearVisibleRects);
- ASSIGN(i, showKeyboard);
- ASSIGN(i, requestFullScreen);
- ASSIGN(i, exitFullScreen);
- ASSIGN(i, requestCenterFitZoom);
- ASSIGN(i, visibleRect);
- ASSIGN(i, requestFullScreenOrientation);
-}
diff --git a/dom/plugins/base/android/android_npapi.h b/dom/plugins/base/android/android_npapi.h
deleted file mode 100644
index 16463d799..000000000
--- a/dom/plugins/base/android/android_npapi.h
+++ /dev/null
@@ -1,1027 +0,0 @@
-/*
- * Copyright 2009, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/* Defines the android-specific types and functions as part of npapi
-
- In particular, defines the window and event types that are passed to
- NPN_GetValue, NPP_SetWindow and NPP_HandleEvent.
-
- To minimize what native libraries the plugin links against, some
- functionality is provided via function-ptrs (e.g. time, sound)
- */
-
-#ifndef android_npapi_H
-#define android_npapi_H
-
-#include <stdint.h>
-#include <jni.h>
-#include "npapi.h"
-#include "GLDefs.h"
-
-///////////////////////////////////////////////////////////////////////////////
-// General types
-
-enum ANPBitmapFormats {
- kUnknown_ANPBitmapFormat = 0,
- kRGBA_8888_ANPBitmapFormat = 1,
- kRGB_565_ANPBitmapFormat = 2
-};
-typedef int32_t ANPBitmapFormat;
-
-struct ANPPixelPacking {
- uint8_t AShift;
- uint8_t ABits;
- uint8_t RShift;
- uint8_t RBits;
- uint8_t GShift;
- uint8_t GBits;
- uint8_t BShift;
- uint8_t BBits;
-};
-
-struct ANPBitmap {
- void* baseAddr;
- ANPBitmapFormat format;
- int32_t width;
- int32_t height;
- int32_t rowBytes;
-};
-
-struct ANPRectF {
- float left;
- float top;
- float right;
- float bottom;
-};
-
-struct ANPRectI {
- int32_t left;
- int32_t top;
- int32_t right;
- int32_t bottom;
-};
-
-struct ANPCanvas;
-struct ANPMatrix;
-struct ANPPaint;
-struct ANPPath;
-struct ANPTypeface;
-
-///////////////////////////////////////////////////////////////////////////////
-// NPN_GetValue
-
-/** queries for a specific ANPInterface.
-
- Maybe called with NULL for the NPP instance
-
- NPN_GetValue(inst, interface_enum, ANPInterface*)
- */
-#define kLogInterfaceV0_ANPGetValue ((NPNVariable)1000)
-#define kAudioTrackInterfaceV0_ANPGetValue ((NPNVariable)1001)
-#define kCanvasInterfaceV0_ANPGetValue ((NPNVariable)1002)
-#define kMatrixInterfaceV0_ANPGetValue ((NPNVariable)1003)
-#define kPaintInterfaceV0_ANPGetValue ((NPNVariable)1004)
-#define kPathInterfaceV0_ANPGetValue ((NPNVariable)1005)
-#define kTypefaceInterfaceV0_ANPGetValue ((NPNVariable)1006)
-#define kWindowInterfaceV0_ANPGetValue ((NPNVariable)1007)
-#define kBitmapInterfaceV0_ANPGetValue ((NPNVariable)1008)
-#define kSurfaceInterfaceV0_ANPGetValue ((NPNVariable)1009)
-#define kSystemInterfaceV0_ANPGetValue ((NPNVariable)1010)
-#define kEventInterfaceV0_ANPGetValue ((NPNVariable)1011)
-
-#define kAudioTrackInterfaceV1_ANPGetValue ((NPNVariable)1012)
-#define kOpenGLInterfaceV0_ANPGetValue ((NPNVariable)1013)
-#define kWindowInterfaceV1_ANPGetValue ((NPNVariable)1014)
-#define kVideoInterfaceV0_ANPGetValue ((NPNVariable)1015)
-#define kSystemInterfaceV1_ANPGetValue ((NPNVariable)1016)
-#define kSystemInterfaceV2_ANPGetValue ((NPNVariable)1017)
-#define kWindowInterfaceV2_ANPGetValue ((NPNVariable)1018)
-#define kNativeWindowInterfaceV0_ANPGetValue ((NPNVariable)1019)
-#define kVideoInterfaceV1_ANPGetValue ((NPNVariable)1020)
-
-/** queries for the drawing models supported on this device.
-
- NPN_GetValue(inst, kSupportedDrawingModel_ANPGetValue, uint32_t* bits)
- */
-#define kSupportedDrawingModel_ANPGetValue ((NPNVariable)2000)
-
-/** queries for the context (android.content.Context) of the plugin. If no
- instance is specified the application's context is returned. If the instance
- is given then the context returned is identical to the context used to
- create the webview in which that instance resides.
-
- NOTE: Holding onto a non-application context after your instance has been
- destroyed will cause a memory leak. Refer to the android documentation to
- determine what context is best suited for your particular scenario.
-
- NPN_GetValue(inst, kJavaContext_ANPGetValue, jobject context)
- */
-#define kJavaContext_ANPGetValue ((NPNVariable)2001)
-
-///////////////////////////////////////////////////////////////////////////////
-// NPN_SetValue
-
-/** Request to set the drawing model. SetValue will return false if the drawing
- model is not supported or has insufficient information for configuration.
-
- NPN_SetValue(inst, kRequestDrawingModel_ANPSetValue, (void*)foo_ANPDrawingModel)
- */
-#define kRequestDrawingModel_ANPSetValue ((NPPVariable)1000)
-
-/** These are used as bitfields in ANPSupportedDrawingModels_EnumValue,
- and as-is in ANPRequestDrawingModel_EnumValue. The drawing model determines
- how to interpret the ANPDrawingContext provided in the Draw event and how
- to interpret the NPWindow->window field.
- */
-enum ANPDrawingModels {
- /** Draw into a bitmap from the browser thread in response to a Draw event.
- NPWindow->window is reserved (ignore)
- */
- kBitmap_ANPDrawingModel = 1 << 0,
- /** Draw into a surface (e.g. raster, openGL, etc.) using the Java surface
- interface. When this model is used the browser will invoke the Java
- class specified in the plugin's apk manifest. From that class the browser
- will invoke the appropriate method to return an an instance of a android
- Java View. The instance is then embedded in the html. The plugin can then
- manipulate the view as it would any normal Java View in android.
-
- Unlike the bitmap model, a surface model is opaque so no html content
- behind the plugin will be visible. Unless the plugin needs to be
- transparent the surface model should be chosen over the bitmap model as
- it will have better performance.
-
- Further, a plugin can manipulate some surfaces in native code using the
- ANPSurfaceInterface. This interface can be used to manipulate Java
- objects that extend Surface.class by allowing them to access the
- surface's underlying bitmap in native code. For instance, if a raster
- surface is used the plugin can lock, draw directly into the bitmap, and
- unlock the surface in native code without making JNI calls to the Java
- surface object.
- */
- kSurface_ANPDrawingModel = 1 << 1,
- kOpenGL_ANPDrawingModel = 1 << 2,
-};
-typedef int32_t ANPDrawingModel;
-
-/** Request to receive/disable events. If the pointer is NULL then all flags will
- be disabled. Otherwise, the event type will be enabled iff its corresponding
- bit in the EventFlags bit field is set.
-
- NPN_SetValue(inst, ANPAcceptEvents, (void*)EventFlags)
- */
-#define kAcceptEvents_ANPSetValue ((NPPVariable)1001)
-
-/** The EventFlags are a set of bits used to determine which types of events the
- plugin wishes to receive. For example, if the value is 0x03 then both key
- and touch events will be provided to the plugin.
- */
-enum ANPEventFlag {
- kKey_ANPEventFlag = 0x01,
- kTouch_ANPEventFlag = 0x02,
-};
-typedef uint32_t ANPEventFlags;
-
-///////////////////////////////////////////////////////////////////////////////
-// NPP_GetValue
-
-/** Requests that the plugin return a java surface to be displayed. This will
- only be used if the plugin has choosen the kSurface_ANPDrawingModel.
-
- NPP_GetValue(inst, kJavaSurface_ANPGetValue, jobject surface)
- */
-#define kJavaSurface_ANPGetValue ((NPPVariable)2000)
-
-
-///////////////////////////////////////////////////////////////////////////////
-// ANDROID INTERFACE DEFINITIONS
-
-/** Interfaces provide additional functionality to the plugin via function ptrs.
- Once an interface is retrieved, it is valid for the lifetime of the plugin
- (just like browserfuncs).
-
- All ANPInterfaces begin with an inSize field, which must be set by the
- caller (plugin) with the number of bytes allocated for the interface.
- e.g. SomeInterface si; si.inSize = sizeof(si); browser->getvalue(..., &si);
- */
-struct ANPInterface {
- uint32_t inSize; // size (in bytes) of this struct
-};
-
-enum ANPLogTypes {
- kError_ANPLogType = 0, // error
- kWarning_ANPLogType = 1, // warning
- kDebug_ANPLogType = 2 // debug only (informational)
-};
-typedef int32_t ANPLogType;
-
-struct ANPLogInterfaceV0 : ANPInterface {
- /** dumps printf messages to the log file
- e.g. interface->log(instance, kWarning_ANPLogType, "value is %d", value);
- */
- void (*log)(ANPLogType, const char format[], ...);
-};
-
-/** ANPColor is always defined to have the same packing on all platforms, and
- it is always unpremultiplied.
-
- This is in contrast to 32bit format(s) in bitmaps, which are premultiplied,
- and their packing may vary depending on the platform, hence the need for
- ANPBitmapInterface::getPixelPacking()
- */
-typedef uint32_t ANPColor;
-#define ANPColor_ASHIFT 24
-#define ANPColor_RSHIFT 16
-#define ANPColor_GSHIFT 8
-#define ANPColor_BSHIFT 0
-#define ANP_MAKE_COLOR(a, r, g, b) \
- (((a) << ANPColor_ASHIFT) | \
- ((r) << ANPColor_RSHIFT) | \
- ((g) << ANPColor_GSHIFT) | \
- ((b) << ANPColor_BSHIFT))
-
-enum ANPPaintFlag {
- kAntiAlias_ANPPaintFlag = 1 << 0,
- kFilterBitmap_ANPPaintFlag = 1 << 1,
- kDither_ANPPaintFlag = 1 << 2,
- kUnderlineText_ANPPaintFlag = 1 << 3,
- kStrikeThruText_ANPPaintFlag = 1 << 4,
- kFakeBoldText_ANPPaintFlag = 1 << 5,
-};
-typedef uint32_t ANPPaintFlags;
-
-enum ANPPaintStyles {
- kFill_ANPPaintStyle = 0,
- kStroke_ANPPaintStyle = 1,
- kFillAndStroke_ANPPaintStyle = 2
-};
-typedef int32_t ANPPaintStyle;
-
-enum ANPPaintCaps {
- kButt_ANPPaintCap = 0,
- kRound_ANPPaintCap = 1,
- kSquare_ANPPaintCap = 2
-};
-typedef int32_t ANPPaintCap;
-
-enum ANPPaintJoins {
- kMiter_ANPPaintJoin = 0,
- kRound_ANPPaintJoin = 1,
- kBevel_ANPPaintJoin = 2
-};
-typedef int32_t ANPPaintJoin;
-
-enum ANPPaintAligns {
- kLeft_ANPPaintAlign = 0,
- kCenter_ANPPaintAlign = 1,
- kRight_ANPPaintAlign = 2
-};
-typedef int32_t ANPPaintAlign;
-
-enum ANPTextEncodings {
- kUTF8_ANPTextEncoding = 0,
- kUTF16_ANPTextEncoding = 1,
-};
-typedef int32_t ANPTextEncoding;
-
-enum ANPTypefaceStyles {
- kBold_ANPTypefaceStyle = 1 << 0,
- kItalic_ANPTypefaceStyle = 1 << 1
-};
-typedef uint32_t ANPTypefaceStyle;
-
-typedef uint32_t ANPFontTableTag;
-
-struct ANPFontMetrics {
- /** The greatest distance above the baseline for any glyph (will be <= 0) */
- float fTop;
- /** The recommended distance above the baseline (will be <= 0) */
- float fAscent;
- /** The recommended distance below the baseline (will be >= 0) */
- float fDescent;
- /** The greatest distance below the baseline for any glyph (will be >= 0) */
- float fBottom;
- /** The recommended distance to add between lines of text (will be >= 0) */
- float fLeading;
-};
-
-struct ANPTypefaceInterfaceV0 : ANPInterface {
- /** Return a new reference to the typeface that most closely matches the
- requested name and style. Pass null as the name to return
- the default font for the requested style. Will never return null
-
- The 5 generic font names "serif", "sans-serif", "monospace", "cursive",
- "fantasy" are recognized, and will be mapped to their logical font
- automatically by this call.
-
- @param name May be NULL. The name of the font family.
- @param style The style (normal, bold, italic) of the typeface.
- @return reference to the closest-matching typeface. Caller must call
- unref() when they are done with the typeface.
- */
- ANPTypeface* (*createFromName)(const char name[], ANPTypefaceStyle);
-
- /** Return a new reference to the typeface that most closely matches the
- requested typeface and specified Style. Use this call if you want to
- pick a new style from the same family of the existing typeface.
- If family is NULL, this selects from the default font's family.
-
- @param family May be NULL. The name of the existing type face.
- @param s The style (normal, bold, italic) of the type face.
- @return reference to the closest-matching typeface. Call must call
- unref() when they are done.
- */
- ANPTypeface* (*createFromTypeface)(const ANPTypeface* family,
- ANPTypefaceStyle);
-
- /** Return the owner count of the typeface. A newly created typeface has an
- owner count of 1. When the owner count is reaches 0, the typeface is
- deleted.
- */
- int32_t (*getRefCount)(const ANPTypeface*);
-
- /** Increment the owner count on the typeface
- */
- void (*ref)(ANPTypeface*);
-
- /** Decrement the owner count on the typeface. When the count goes to 0,
- the typeface is deleted.
- */
- void (*unref)(ANPTypeface*);
-
- /** Return the style bits for the specified typeface
- */
- ANPTypefaceStyle (*getStyle)(const ANPTypeface*);
-
- /** Some fonts are stored in files. If that is true for the fontID, then
- this returns the byte length of the full file path. If path is not null,
- then the full path is copied into path (allocated by the caller), up to
- length bytes. If index is not null, then it is set to the truetype
- collection index for this font, or 0 if the font is not in a collection.
-
- Note: getFontPath does not assume that path is a null-terminated string,
- so when it succeeds, it only copies the bytes of the file name and
- nothing else (i.e. it copies exactly the number of bytes returned by the
- function. If the caller wants to treat path[] as a C string, it must be
- sure that it is allocated at least 1 byte larger than the returned size,
- and it must copy in the terminating 0.
-
- If the fontID does not correspond to a file, then the function returns
- 0, and the path and index parameters are ignored.
-
- @param fontID The font whose file name is being queried
- @param path Either NULL, or storage for receiving up to length bytes
- of the font's file name. Allocated by the caller.
- @param length The maximum space allocated in path (by the caller).
- Ignored if path is NULL.
- @param index Either NULL, or receives the TTC index for this font.
- If the font is not a TTC, then will be set to 0.
- @return The byte length of th font's file name, or 0 if the font is not
- baked by a file.
- */
- int32_t (*getFontPath)(const ANPTypeface*, char path[], int32_t length,
- int32_t* index);
-
- /** Return a UTF8 encoded path name for the font directory, or NULL if not
- supported. If returned, this string address will be valid for the life
- of the plugin instance. It will always end with a '/' character.
- */
- const char* (*getFontDirectoryPath)();
-};
-
-struct ANPPaintInterfaceV0 : ANPInterface {
- /** Return a new paint object, which holds all of the color and style
- attributes that affect how things (geometry, text, bitmaps) are drawn
- in a ANPCanvas.
-
- The paint that is returned is not tied to any particular plugin
- instance, but it must only be accessed from one thread at a time.
- */
- ANPPaint* (*newPaint)();
- void (*deletePaint)(ANPPaint*);
-
- ANPPaintFlags (*getFlags)(const ANPPaint*);
- void (*setFlags)(ANPPaint*, ANPPaintFlags);
-
- ANPColor (*getColor)(const ANPPaint*);
- void (*setColor)(ANPPaint*, ANPColor);
-
- ANPPaintStyle (*getStyle)(const ANPPaint*);
- void (*setStyle)(ANPPaint*, ANPPaintStyle);
-
- float (*getStrokeWidth)(const ANPPaint*);
- float (*getStrokeMiter)(const ANPPaint*);
- ANPPaintCap (*getStrokeCap)(const ANPPaint*);
- ANPPaintJoin (*getStrokeJoin)(const ANPPaint*);
- void (*setStrokeWidth)(ANPPaint*, float);
- void (*setStrokeMiter)(ANPPaint*, float);
- void (*setStrokeCap)(ANPPaint*, ANPPaintCap);
- void (*setStrokeJoin)(ANPPaint*, ANPPaintJoin);
-
- ANPTextEncoding (*getTextEncoding)(const ANPPaint*);
- ANPPaintAlign (*getTextAlign)(const ANPPaint*);
- float (*getTextSize)(const ANPPaint*);
- float (*getTextScaleX)(const ANPPaint*);
- float (*getTextSkewX)(const ANPPaint*);
- void (*setTextEncoding)(ANPPaint*, ANPTextEncoding);
- void (*setTextAlign)(ANPPaint*, ANPPaintAlign);
- void (*setTextSize)(ANPPaint*, float);
- void (*setTextScaleX)(ANPPaint*, float);
- void (*setTextSkewX)(ANPPaint*, float);
-
- /** Return the typeface ine paint, or null if there is none. This does not
- modify the owner count of the returned typeface.
- */
- ANPTypeface* (*getTypeface)(const ANPPaint*);
-
- /** Set the paint's typeface. If the paint already had a non-null typeface,
- its owner count is decremented. If the new typeface is non-null, its
- owner count is incremented.
- */
- void (*setTypeface)(ANPPaint*, ANPTypeface*);
-
- /** Return the width of the text. If bounds is not null, return the bounds
- of the text in that rectangle.
- */
- float (*measureText)(ANPPaint*, const void* text, uint32_t byteLength,
- ANPRectF* bounds);
-
- /** Return the number of unichars specifed by the text.
- If widths is not null, returns the array of advance widths for each
- unichar.
- If bounds is not null, returns the array of bounds for each unichar.
- */
- int (*getTextWidths)(ANPPaint*, const void* text, uint32_t byteLength,
- float widths[], ANPRectF bounds[]);
-
- /** Return in metrics the spacing values for text, respecting the paint's
- typeface and pointsize, and return the spacing between lines
- (descent - ascent + leading). If metrics is NULL, it will be ignored.
- */
- float (*getFontMetrics)(ANPPaint*, ANPFontMetrics* metrics);
-};
-
-struct ANPCanvasInterfaceV0 : ANPInterface {
- /** Return a canvas that will draw into the specified bitmap. Note: the
- canvas copies the fields of the bitmap, so it need not persist after
- this call, but the canvas DOES point to the same pixel memory that the
- bitmap did, so the canvas should not be used after that pixel memory
- goes out of scope. In the case of creating a canvas to draw into the
- pixels provided by kDraw_ANPEventType, those pixels are only while
- handling that event.
-
- The canvas that is returned is not tied to any particular plugin
- instance, but it must only be accessed from one thread at a time.
- */
- ANPCanvas* (*newCanvas)(const ANPBitmap*);
- void (*deleteCanvas)(ANPCanvas*);
-
- void (*save)(ANPCanvas*);
- void (*restore)(ANPCanvas*);
- void (*translate)(ANPCanvas*, float tx, float ty);
- void (*scale)(ANPCanvas*, float sx, float sy);
- void (*rotate)(ANPCanvas*, float degrees);
- void (*skew)(ANPCanvas*, float kx, float ky);
- void (*concat)(ANPCanvas*, const ANPMatrix*);
- void (*clipRect)(ANPCanvas*, const ANPRectF*);
- void (*clipPath)(ANPCanvas*, const ANPPath*);
-
- /** Return the current matrix on the canvas
- */
- void (*getTotalMatrix)(ANPCanvas*, ANPMatrix*);
- /** Return the current clip bounds in local coordinates, expanding it to
- account for antialiasing edge effects if aa is true. If the
- current clip is empty, return false and ignore the bounds argument.
- */
- bool (*getLocalClipBounds)(ANPCanvas*, ANPRectF* bounds, bool aa);
- /** Return the current clip bounds in device coordinates in bounds. If the
- current clip is empty, return false and ignore the bounds argument.
- */
- bool (*getDeviceClipBounds)(ANPCanvas*, ANPRectI* bounds);
-
- void (*drawColor)(ANPCanvas*, ANPColor);
- void (*drawPaint)(ANPCanvas*, const ANPPaint*);
- void (*drawLine)(ANPCanvas*, float x0, float y0, float x1, float y1,
- const ANPPaint*);
- void (*drawRect)(ANPCanvas*, const ANPRectF*, const ANPPaint*);
- void (*drawOval)(ANPCanvas*, const ANPRectF*, const ANPPaint*);
- void (*drawPath)(ANPCanvas*, const ANPPath*, const ANPPaint*);
- void (*drawText)(ANPCanvas*, const void* text, uint32_t byteLength,
- float x, float y, const ANPPaint*);
- void (*drawPosText)(ANPCanvas*, const void* text, uint32_t byteLength,
- const float xy[], const ANPPaint*);
- void (*drawBitmap)(ANPCanvas*, const ANPBitmap*, float x, float y,
- const ANPPaint*);
- void (*drawBitmapRect)(ANPCanvas*, const ANPBitmap*,
- const ANPRectI* src, const ANPRectF* dst,
- const ANPPaint*);
-};
-
-struct ANPWindowInterfaceV0 : ANPInterface {
- /** Registers a set of rectangles that the plugin would like to keep on
- screen. The rectangles are listed in order of priority with the highest
- priority rectangle in location rects[0]. The browser will attempt to keep
- as many of the rectangles on screen as possible and will scroll them into
- view in response to the invocation of this method and other various events.
- The count specifies how many rectangles are in the array. If the count is
- zero it signals the browser that any existing rectangles should be cleared
- and no rectangles will be tracked.
- */
- void (*setVisibleRects)(NPP instance, const ANPRectI rects[], int32_t count);
- /** Clears any rectangles that are being tracked as a result of a call to
- setVisibleRects. This call is equivalent to setVisibleRect(inst, NULL, 0).
- */
- void (*clearVisibleRects)(NPP instance);
- /** Given a boolean value of true the device will be requested to provide
- a keyboard. A value of false will result in a request to hide the
- keyboard. Further, the on-screen keyboard will not be displayed if a
- physical keyboard is active.
- */
- void (*showKeyboard)(NPP instance, bool value);
- /** Called when a plugin wishes to enter into full screen mode. The plugin's
- Java class (defined in the plugin's apk manifest) will be called
- asynchronously to provide a View object to be displayed full screen.
- */
- void (*requestFullScreen)(NPP instance);
- /** Called when a plugin wishes to exit from full screen mode. As a result,
- the plugin's full screen view will be discarded by the view system.
- */
- void (*exitFullScreen)(NPP instance);
- /** Called when a plugin wishes to be zoomed and centered in the current view.
- */
- void (*requestCenterFitZoom)(NPP instance);
-};
-
-enum ANPScreenOrientations {
- /** No preference specified: let the system decide the best orientation.
- */
- kDefault_ANPScreenOrientation = 0,
- /** Would like to have the screen in a landscape orientation, but it will
- not allow for 180 degree rotations.
- */
- kFixedLandscape_ANPScreenOrientation = 1,
- /** Would like to have the screen in a portrait orientation, but it will
- not allow for 180 degree rotations.
- */
- kFixedPortrait_ANPScreenOrientation = 2,
- /** Would like to have the screen in landscape orientation, but can use the
- sensor to change which direction the screen is facing.
- */
- kLandscape_ANPScreenOrientation = 3,
- /** Would like to have the screen in portrait orientation, but can use the
- sensor to change which direction the screen is facing.
- */
- kPortrait_ANPScreenOrientation = 4
-};
-
-typedef int32_t ANPScreenOrientation;
-
-struct ANPWindowInterfaceV2 : ANPWindowInterfaceV0 {
- /** Returns a rectangle representing the visible area of the plugin on
- screen. The coordinates are relative to the size of the plugin in the
- document and therefore will never be negative or exceed the plugin's size.
- */
- ANPRectI (*visibleRect)(NPP instance);
-
- /** Called when the plugin wants to specify a particular screen orientation
- when entering into full screen mode. The orientation must be set prior
- to entering into full screen. After entering full screen any subsequent
- changes will be updated the next time the plugin goes full screen.
- */
- void (*requestFullScreenOrientation)(NPP instance, ANPScreenOrientation orientation);
-};
-
-///////////////////////////////////////////////////////////////////////////////
-
-enum ANPSampleFormats {
- kUnknown_ANPSamleFormat = 0,
- kPCM16Bit_ANPSampleFormat = 1,
- kPCM8Bit_ANPSampleFormat = 2
-};
-typedef int32_t ANPSampleFormat;
-
-/** The audio buffer is passed to the callback proc to request more samples.
- It is owned by the system, and the callback may read it, but should not
- maintain a pointer to it outside of the scope of the callback proc.
- */
-struct ANPAudioBuffer {
- // RO - repeat what was specified in newTrack()
- int32_t channelCount;
- // RO - repeat what was specified in newTrack()
- ANPSampleFormat format;
- /** This buffer is owned by the caller. Inside the callback proc, up to
- "size" bytes of sample data should be written into this buffer. The
- address is only valid for the scope of a single invocation of the
- callback proc.
- */
- void* bufferData;
- /** On input, specifies the maximum number of bytes that can be written
- to "bufferData". On output, specifies the actual number of bytes that
- the callback proc wrote into "bufferData".
- */
- uint32_t size;
-};
-
-enum ANPAudioEvents {
- /** This event is passed to the callback proc when the audio-track needs
- more sample data written to the provided buffer parameter.
- */
- kMoreData_ANPAudioEvent = 0,
- /** This event is passed to the callback proc if the audio system runs out
- of sample data. In this event, no buffer parameter will be specified
- (i.e. NULL will be passed to the 3rd parameter).
- */
- kUnderRun_ANPAudioEvent = 1
-};
-typedef int32_t ANPAudioEvent;
-
-/** Called to feed sample data to the track. This will be called in a separate
- thread. However, you may call trackStop() from the callback (but you
- cannot delete the track).
-
- For example, when you have written the last chunk of sample data, you can
- immediately call trackStop(). This will take effect after the current
- buffer has been played.
-
- The "user" parameter is the same value that was passed to newTrack()
- */
-typedef void (*ANPAudioCallbackProc)(ANPAudioEvent event, void* user,
- ANPAudioBuffer* buffer);
-
-struct ANPAudioTrack; // abstract type for audio tracks
-
-struct ANPAudioTrackInterfaceV0 : ANPInterface {
- /** Create a new audio track, or NULL on failure. The track is initially in
- the stopped state and therefore ANPAudioCallbackProc will not be called
- until the track is started.
- */
- ANPAudioTrack* (*newTrack)(uint32_t sampleRate, // sampling rate in Hz
- ANPSampleFormat,
- int channelCount, // MONO=1, STEREO=2
- ANPAudioCallbackProc,
- void* user);
- /** Deletes a track that was created using newTrack. The track can be
- deleted in any state and it waits for the ANPAudioCallbackProc thread
- to exit before returning.
- */
- void (*deleteTrack)(ANPAudioTrack*);
-
- void (*start)(ANPAudioTrack*);
- void (*pause)(ANPAudioTrack*);
- void (*stop)(ANPAudioTrack*);
- /** Returns true if the track is not playing (e.g. pause or stop was called,
- or start was never called.
- */
- bool (*isStopped)(ANPAudioTrack*);
-};
-
-struct ANPAudioTrackInterfaceV1 : ANPAudioTrackInterfaceV0 {
- /** Returns the track's latency in milliseconds. */
- uint32_t (*trackLatency)(ANPAudioTrack*);
-};
-
-
-///////////////////////////////////////////////////////////////////////////////
-// DEFINITION OF VALUES PASSED THROUGH NPP_HandleEvent
-
-enum ANPEventTypes {
- kNull_ANPEventType = 0,
- kKey_ANPEventType = 1,
- /** Mouse events are triggered by either clicking with the navigational pad
- or by tapping the touchscreen (if the kDown_ANPTouchAction is handled by
- the plugin then no mouse event is generated). The kKey_ANPEventFlag has
- to be set to true in order to receive these events.
- */
- kMouse_ANPEventType = 2,
- /** Touch events are generated when the user touches on the screen. The
- kTouch_ANPEventFlag has to be set to true in order to receive these
- events.
- */
- kTouch_ANPEventType = 3,
- /** Only triggered by a plugin using the kBitmap_ANPDrawingModel. This event
- signals that the plugin needs to redraw itself into the provided bitmap.
- */
- kDraw_ANPEventType = 4,
- kLifecycle_ANPEventType = 5,
-
- /** This event type is completely defined by the plugin.
- When creating an event, the caller must always set the first
- two fields, the remaining data is optional.
- ANPEvent evt;
- evt.inSize = sizeof(ANPEvent);
- evt.eventType = kCustom_ANPEventType
- // other data slots are optional
- evt.other[] = ...;
- To post a copy of the event, call
- eventInterface->postEvent(myNPPInstance, &evt);
- That call makes a copy of the event struct, and post that on the event
- queue for the plugin.
- */
- kCustom_ANPEventType = 6,
-};
-typedef int32_t ANPEventType;
-
-enum ANPKeyActions {
- kDown_ANPKeyAction = 0,
- kUp_ANPKeyAction = 1,
-};
-typedef int32_t ANPKeyAction;
-
-#include "ANPKeyCodes.h"
-typedef int32_t ANPKeyCode;
-
-enum ANPKeyModifiers {
- kAlt_ANPKeyModifier = 1 << 0,
- kShift_ANPKeyModifier = 1 << 1,
-};
-// bit-field containing some number of ANPKeyModifier bits
-typedef uint32_t ANPKeyModifier;
-
-enum ANPMouseActions {
- kDown_ANPMouseAction = 0,
- kUp_ANPMouseAction = 1,
-};
-typedef int32_t ANPMouseAction;
-
-enum ANPTouchActions {
- /** This occurs when the user first touches on the screen. As such, this
- action will always occur prior to any of the other touch actions. If
- the plugin chooses to not handle this action then no other events
- related to that particular touch gesture will be generated.
- */
- kDown_ANPTouchAction = 0,
- kUp_ANPTouchAction = 1,
- kMove_ANPTouchAction = 2,
- kCancel_ANPTouchAction = 3,
- // The web view will ignore the return value from the following actions
- kLongPress_ANPTouchAction = 4,
- kDoubleTap_ANPTouchAction = 5,
-};
-typedef int32_t ANPTouchAction;
-
-enum ANPLifecycleActions {
- /** The web view containing this plugin has been paused. See documentation
- on the android activity lifecycle for more information.
- */
- kPause_ANPLifecycleAction = 0,
- /** The web view containing this plugin has been resumed. See documentation
- on the android activity lifecycle for more information.
- */
- kResume_ANPLifecycleAction = 1,
- /** The plugin has focus and is now the recipient of input events (e.g. key,
- touch, etc.)
- */
- kGainFocus_ANPLifecycleAction = 2,
- /** The plugin has lost focus and will not receive any input events until it
- regains focus. This event is always preceded by a GainFocus action.
- */
- kLoseFocus_ANPLifecycleAction = 3,
- /** The browser is running low on available memory and is requesting that
- the plugin free any unused/inactive resources to prevent a performance
- degradation.
- */
- kFreeMemory_ANPLifecycleAction = 4,
- /** The page has finished loading. This happens when the page's top level
- frame reports that it has completed loading.
- */
- kOnLoad_ANPLifecycleAction = 5,
- /** The browser is honoring the plugin's request to go full screen. Upon
- returning from this event the browser will resize the plugin's java
- surface to full-screen coordinates.
- */
- kEnterFullScreen_ANPLifecycleAction = 6,
- /** The browser has exited from full screen mode. Immediately prior to
- sending this event the browser has resized the plugin's java surface to
- its original coordinates.
- */
- kExitFullScreen_ANPLifecycleAction = 7,
- /** The plugin is visible to the user on the screen. This event will always
- occur after a kOffScreen_ANPLifecycleAction event.
- */
- kOnScreen_ANPLifecycleAction = 8,
- /** The plugin is no longer visible to the user on the screen. This event
- will always occur prior to an kOnScreen_ANPLifecycleAction event.
- */
- kOffScreen_ANPLifecycleAction = 9,
-};
-typedef uint32_t ANPLifecycleAction;
-
-/* This is what is passed to NPP_HandleEvent() */
-struct ANPEvent {
- uint32_t inSize; // size of this struct in bytes
- ANPEventType eventType;
- // use based on the value in eventType
- union {
- struct {
- ANPKeyAction action;
- ANPKeyCode nativeCode;
- int32_t virtualCode; // windows virtual key code
- ANPKeyModifier modifiers;
- int32_t repeatCount; // 0 for initial down (or up)
- int32_t unichar; // 0 if there is no value
- } key;
- struct {
- ANPMouseAction action;
- int32_t x; // relative to your "window" (0...width)
- int32_t y; // relative to your "window" (0...height)
- } mouse;
- struct {
- ANPTouchAction action;
- ANPKeyModifier modifiers;
- int32_t x; // relative to your "window" (0...width)
- int32_t y; // relative to your "window" (0...height)
- } touch;
- struct {
- ANPLifecycleAction action;
- } lifecycle;
- struct {
- ANPDrawingModel model;
- // relative to (0,0) in top-left of your plugin
- ANPRectI clip;
- // use based on the value in model
- union {
- ANPBitmap bitmap;
- struct {
- int32_t width;
- int32_t height;
- } surfaceSize;
- } data;
- } draw;
- } data;
-};
-
-
-struct ANPEventInterfaceV0 : ANPInterface {
- /** Post a copy of the specified event to the plugin. The event will be
- delivered to the plugin in its main thread (the thread that receives
- other ANPEvents). If, after posting before delivery, the NPP instance
- is torn down, the event will be discarded.
- */
- void (*postEvent)(NPP inst, const ANPEvent* event);
-};
-
-struct ANPSurfaceInterfaceV0 : ANPInterface {
- /** Locks the surface from manipulation by other threads and provides a bitmap
- to be written to. The dirtyRect param specifies which portion of the
- bitmap will be written to. If the dirtyRect is NULL then the entire
- surface will be considered dirty. If the lock was successful the function
- will return true and the bitmap will be set to point to a valid bitmap.
- If not the function will return false and the bitmap will be set to NULL.
- */
- bool (*lock)(JNIEnv* env, jobject surface, ANPBitmap* bitmap, ANPRectI* dirtyRect);
- /** Given a locked surface handle (i.e. result of a successful call to lock)
- the surface is unlocked and the contents of the bitmap, specifically
- those inside the dirtyRect are written to the screen.
- */
- void (*unlock)(JNIEnv* env, jobject surface);
-};
-
-/**
- * TODO should we not use EGL and GL data types for ABI safety?
- */
-struct ANPTextureInfo {
- GLuint textureId;
- uint32_t width;
- uint32_t height;
- GLenum internalFormat;
-};
-
-typedef void* ANPEGLContext;
-
-struct ANPOpenGLInterfaceV0 : ANPInterface {
- ANPEGLContext (*acquireContext)(NPP instance);
-
- ANPTextureInfo (*lockTexture)(NPP instance);
-
- void (*releaseTexture)(NPP instance, const ANPTextureInfo*);
-
- /**
- * Invert the contents of the plugin on the y-axis.
- * default is to not be inverted (i.e. use OpenGL coordinates)
- */
- void (*invertPluginContent)(NPP instance, bool isContentInverted);
-};
-
-enum ANPPowerStates {
- kDefault_ANPPowerState = 0,
- kScreenOn_ANPPowerState = 1
-};
-typedef int32_t ANPPowerState;
-
-struct ANPSystemInterfaceV1 : ANPInterface {
- /** Return the path name for the current Application's plugin data directory,
- or NULL if not supported
- */
- const char* (*getApplicationDataDirectory)();
-
- /** A helper function to load java classes from the plugin's apk. The
- function looks for a class given the fully qualified and null terminated
- string representing the className. For example,
-
- const char* className = "com.android.mypackage.MyClass";
-
- If the class cannot be found or there is a problem loading the class
- NULL will be returned.
- */
- jclass (*loadJavaClass)(NPP instance, const char* className);
-
- void (*setPowerState)(NPP instance, ANPPowerState powerState);
-};
-
-struct ANPSystemInterfaceV2 : ANPInterface {
- /** Return the path name for the current Application's plugin data directory,
- or NULL if not supported. This directory will change depending on whether
- or not the plugin is found within an incognito tab.
- */
- const char* (*getApplicationDataDirectory)(NPP instance);
-
- // redeclaration of existing features
- jclass (*loadJavaClass)(NPP instance, const char* className);
- void (*setPowerState)(NPP instance, ANPPowerState powerState);
-};
-
-typedef void* ANPNativeWindow;
-
-/** Called to notify the plugin that a video frame has been composited by the
-* browser for display. This will be called in a separate thread and as such
-* you cannot call releaseNativeWindow from the callback.
-*
-* The timestamp is in nanoseconds, and is monotonically increasing.
-*/
-typedef void (*ANPVideoFrameCallbackProc)(ANPNativeWindow* window, int64_t timestamp);
-
-struct ANPVideoInterfaceV1 : ANPInterface {
-
- /**
- * Constructs a new native window to be used for rendering video content.
- *
- * Subsequent calls will produce new windows, but may also return NULL after
- * n attempts if the browser has reached it's limit. Further, if the browser
- * is unable to acquire the window quickly it may also return NULL in order
- * to not prevent the plugin from executing. A subsequent call will then
- * return the window if it is avaiable.
- *
- * NOTE: The hardware may fail if you try to decode more than the allowable
- * number of videos supported on that device.
- */
- ANPNativeWindow (*acquireNativeWindow)(NPP instance);
-
- /**
- * Sets the rectangle that specifies where the video content is to be drawn.
- * The dimensions are in document space. Further, if the rect is NULL the
- * browser will not attempt to draw the window, therefore do not set the
- * dimensions until you queue the first buffer in the window.
- */
- void (*setWindowDimensions)(NPP instance, const ANPNativeWindow window, const ANPRectF* dimensions);
-
- /**
- */
- void (*releaseNativeWindow)(NPP instance, ANPNativeWindow window);
-
- /** Set a callback to be notified when an ANPNativeWindow is composited by
- * the browser.
- */
- void (*setFramerateCallback)(NPP instance, const ANPNativeWindow window, ANPVideoFrameCallbackProc);
-};
-
-struct ANPNativeWindowInterfaceV0 : ANPInterface {
- /**
- * Constructs a new native window to be used for rendering plugin content.
- *
- * Subsequent calls will return the original constructed window. Further, if
- * the browser is unable to acquire the window quickly it may return NULL in
- * order to not block the plugin indefinitely. A subsequent call will then
- * return the window if it is available.
- */
- ANPNativeWindow (*acquireNativeWindow)(NPP instance);
-
- /**
- * Invert the contents of the plugin on the y-axis.
- * default is to not be inverted (e.g. use OpenGL coordinates)
- */
- void (*invertPluginContent)(NPP instance, bool isContentInverted);
-};
-
-
-#endif
diff --git a/dom/plugins/base/android/moz.build b/dom/plugins/base/android/moz.build
deleted file mode 100644
index d95d20d5b..000000000
--- a/dom/plugins/base/android/moz.build
+++ /dev/null
@@ -1,35 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXPORTS += [
- 'android_npapi.h',
- 'ANPKeyCodes.h',
-]
-
-SOURCES += [
- 'ANPAudio.cpp',
- 'ANPEvent.cpp',
- 'ANPLog.cpp',
- 'ANPNativeWindow.cpp',
- 'ANPSurface.cpp',
- 'ANPSystem.cpp',
- 'ANPVideo.cpp',
- 'ANPWindow.cpp',
-]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
-LOCAL_INCLUDES += [
- '/dom/plugins/base',
- '/gfx/gl',
- '/widget',
- '/widget/android',
-]
-
-DEFINES['MOZ_APP_NAME'] = '"%s"' % CONFIG['MOZ_APP_NAME']
-
-CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
diff --git a/dom/plugins/base/moz.build b/dom/plugins/base/moz.build
index f43f75f79..a159d6fc1 100644
--- a/dom/plugins/base/moz.build
+++ b/dom/plugins/base/moz.build
@@ -4,9 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- DIRS += ['android']
-
XPIDL_SOURCES += [
'nsIHTTPHeaderListener.idl',
'nsIPluginDocument.idl',
@@ -89,16 +86,10 @@ LOCAL_INCLUDES += [
'/layout/xul',
'/netwerk/base',
'/widget',
- '/widget/android',
'/widget/cocoa',
'/xpcom/base',
]
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- LOCAL_INCLUDES += [
- '/dom/plugins/base/android',
- ]
-
if CONFIG['OS_ARCH'] == 'WINNT':
LOCAL_INCLUDES += [
'/xpcom/base',
@@ -106,8 +97,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
include('/ipc/chromium/chromium-config.mozbuild')
-DEFINES['SK_BUILD_FOR_ANDROID_NDK'] = True
-
FINAL_LIBRARY = 'xul'
CXXFLAGS += CONFIG['MOZ_CAIRO_CFLAGS']
diff --git a/dom/plugins/base/npfunctions.h b/dom/plugins/base/npfunctions.h
index 4c9d66ea0..73097d115 100644
--- a/dom/plugins/base/npfunctions.h
+++ b/dom/plugins/base/npfunctions.h
@@ -9,10 +9,6 @@
#include "npapi.h"
#include "npruntime.h"
-#ifdef MOZ_WIDGET_ANDROID
-#include <jni.h>
-#endif
-
typedef NPError (* NPP_NewProcPtr)(NPMIMEType pluginType, NPP instance, uint16_t mode, int16_t argc, char* argn[], char* argv[], NPSavedData* saved);
typedef NPError (* NPP_DestroyProcPtr)(NPP instance, NPSavedData** save);
typedef NPError (* NPP_SetWindowProcPtr)(NPP instance, NPWindow* window);
@@ -261,14 +257,9 @@ NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs);
typedef NPError (*NP_GetEntryPointsFunc)(NPPluginFuncs*);
NP_EXPORT(NPError) NP_GetEntryPoints(NPPluginFuncs* pFuncs);
#else
-#ifdef MOZ_WIDGET_ANDROID
-typedef NPError (*NP_InitializeFunc)(NPNetscapeFuncs*, NPPluginFuncs*, JNIEnv* pEnv);
-NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs, JNIEnv* pEnv);
-#else
typedef NPError (*NP_InitializeFunc)(NPNetscapeFuncs*, NPPluginFuncs*);
NP_EXPORT(NPError) NP_Initialize(NPNetscapeFuncs* bFuncs, NPPluginFuncs* pFuncs);
#endif
-#endif
typedef NPError (*NP_ShutdownFunc)(void);
NP_EXPORT(NPError) NP_Shutdown(void);
typedef NPError (*NP_GetValueFunc)(void *, NPPVariable, void *);
diff --git a/dom/plugins/base/nsNPAPIPlugin.cpp b/dom/plugins/base/nsNPAPIPlugin.cpp
index 697bfacd4..da4f09914 100644
--- a/dom/plugins/base/nsNPAPIPlugin.cpp
+++ b/dom/plugins/base/nsNPAPIPlugin.cpp
@@ -97,15 +97,6 @@ using mozilla::plugins::PluginModuleContentParent;
#endif
#endif
-#ifdef MOZ_WIDGET_ANDROID
-#include <android/log.h>
-#include "android_npapi.h"
-#include "ANPBase.h"
-#include "GeneratedJNIWrappers.h"
-#undef LOG
-#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
-#endif
-
#include "nsIAudioChannelAgent.h"
#include "AudioChannelService.h"
@@ -236,11 +227,7 @@ nsNPAPIPlugin::PluginCrashed(const nsAString& pluginDumpID,
bool
nsNPAPIPlugin::RunPluginOOP(const nsPluginTag *aPluginTag)
{
-#ifdef MOZ_WIDGET_ANDROID
- return false;
-#else
return true;
-#endif
}
inline PluginLibrary*
@@ -282,7 +269,7 @@ nsNPAPIPlugin::CreatePlugin(nsPluginTag *aPluginTag, nsNPAPIPlugin** aResult)
return NS_ERROR_FAILURE;
}
-#if defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID)
+#ifdef XP_MACOSX
if (!pluginLib->HasRequiredFunctions()) {
NS_WARNING("Not all necessary functions exposed by plugin, it will not load.");
delete pluginLib;
@@ -2019,156 +2006,6 @@ _getvalue(NPP npp, NPNVariable variable, void *result)
return NPERR_NO_ERROR;
}
-#ifdef MOZ_WIDGET_ANDROID
- case kLogInterfaceV0_ANPGetValue: {
- LOG("get log interface");
- ANPLogInterfaceV0 *i = (ANPLogInterfaceV0 *) result;
- InitLogInterface(i);
- return NPERR_NO_ERROR;
- }
-
- case kBitmapInterfaceV0_ANPGetValue: {
- LOG("get bitmap interface");
- return NPERR_GENERIC_ERROR;
- }
-
- case kMatrixInterfaceV0_ANPGetValue: {
- LOG("get matrix interface");
- return NPERR_GENERIC_ERROR;
- }
-
- case kPathInterfaceV0_ANPGetValue: {
- LOG("get path interface");
- return NPERR_GENERIC_ERROR;
- }
-
- case kTypefaceInterfaceV0_ANPGetValue: {
- LOG("get typeface interface");
- ANPTypefaceInterfaceV0 *i = (ANPTypefaceInterfaceV0 *) result;
- InitTypeFaceInterface(i);
- return NPERR_NO_ERROR;
- }
-
- case kPaintInterfaceV0_ANPGetValue: {
- LOG("get paint interface");
- ANPPaintInterfaceV0 *i = (ANPPaintInterfaceV0 *) result;
- InitPaintInterface(i);
- return NPERR_NO_ERROR;
- }
-
- case kCanvasInterfaceV0_ANPGetValue: {
- LOG("get canvas interface");
- ANPCanvasInterfaceV0 *i = (ANPCanvasInterfaceV0 *) result;
- InitCanvasInterface(i);
- return NPERR_NO_ERROR;
- }
-
- case kWindowInterfaceV0_ANPGetValue: {
- LOG("get window interface");
- ANPWindowInterfaceV0 *i = (ANPWindowInterfaceV0 *) result;
- InitWindowInterface(i);
- return NPERR_NO_ERROR;
- }
-
- case kAudioTrackInterfaceV0_ANPGetValue: {
- LOG("get audio interface");
- ANPAudioTrackInterfaceV0 *i = (ANPAudioTrackInterfaceV0 *) result;
- InitAudioTrackInterfaceV0(i);
- return NPERR_NO_ERROR;
- }
-
- case kEventInterfaceV0_ANPGetValue: {
- LOG("get event interface");
- ANPEventInterfaceV0 *i = (ANPEventInterfaceV0 *) result;
- InitEventInterface(i);
- return NPERR_NO_ERROR;
- }
-
- case kSystemInterfaceV0_ANPGetValue: {
- LOG("get system interface");
- return NPERR_GENERIC_ERROR;
- }
-
- case kSurfaceInterfaceV0_ANPGetValue: {
- LOG("get surface interface");
- ANPSurfaceInterfaceV0 *i = (ANPSurfaceInterfaceV0 *) result;
- InitSurfaceInterface(i);
- return NPERR_NO_ERROR;
- }
-
- case kSupportedDrawingModel_ANPGetValue: {
- LOG("get supported drawing model");
- return NPERR_GENERIC_ERROR;
- }
-
- case kJavaContext_ANPGetValue: {
- LOG("get java context");
- auto ret = java::GeckoAppShell::GetContext();
- if (!ret)
- return NPERR_GENERIC_ERROR;
-
- *static_cast<jobject*>(result) = ret.Forget();
- return NPERR_NO_ERROR;
- }
-
- case kAudioTrackInterfaceV1_ANPGetValue: {
- LOG("get audio interface v1");
- ANPAudioTrackInterfaceV1 *i = (ANPAudioTrackInterfaceV1 *) result;
- InitAudioTrackInterfaceV1(i);
- return NPERR_NO_ERROR;
- }
-
- case kNativeWindowInterfaceV0_ANPGetValue: {
- LOG("get native window interface v0");
- ANPNativeWindowInterfaceV0* i = (ANPNativeWindowInterfaceV0 *) result;
- InitNativeWindowInterface(i);
- return NPERR_NO_ERROR;
- }
-
- case kOpenGLInterfaceV0_ANPGetValue: {
- LOG("get openGL interface");
- return NPERR_GENERIC_ERROR;
- }
-
- case kWindowInterfaceV1_ANPGetValue: {
- LOG("get Window interface V1");
- return NPERR_GENERIC_ERROR;
- }
-
- case kWindowInterfaceV2_ANPGetValue: {
- LOG("get Window interface V2");
- ANPWindowInterfaceV2 *i = (ANPWindowInterfaceV2 *) result;
- InitWindowInterfaceV2(i);
- return NPERR_NO_ERROR;
- }
-
- case kVideoInterfaceV0_ANPGetValue: {
- LOG("get video interface V0");
- return NPERR_GENERIC_ERROR;
- }
-
- case kVideoInterfaceV1_ANPGetValue: {
- LOG("get video interface V1");
- ANPVideoInterfaceV1 *i = (ANPVideoInterfaceV1*) result;
- InitVideoInterfaceV1(i);
- return NPERR_NO_ERROR;
- }
-
- case kSystemInterfaceV1_ANPGetValue: {
- LOG("get system interface v1");
- ANPSystemInterfaceV1* i = reinterpret_cast<ANPSystemInterfaceV1*>(result);
- InitSystemInterfaceV1(i);
- return NPERR_NO_ERROR;
- }
-
- case kSystemInterfaceV2_ANPGetValue: {
- LOG("get system interface v2");
- ANPSystemInterfaceV2* i = reinterpret_cast<ANPSystemInterfaceV2*>(result);
- InitSystemInterfaceV2(i);
- return NPERR_NO_ERROR;
- }
-#endif
-
// we no longer hand out any XPCOM objects
case NPNVDOMElement:
case NPNVDOMWindow:
@@ -2298,8 +2135,6 @@ _setvalue(NPP npp, NPPVariable variable, void *result)
return NPERR_NO_ERROR;
}
-#ifndef MOZ_WIDGET_ANDROID
- // On android, their 'drawing model' uses the same constant!
case NPPVpluginDrawingModel: {
if (inst) {
inst->SetDrawingModel((NPDrawingModel)NS_PTR_TO_INT32(result));
@@ -2309,7 +2144,6 @@ _setvalue(NPP npp, NPPVariable variable, void *result)
return NPERR_GENERIC_ERROR;
}
}
-#endif
#ifdef XP_MACOSX
case NPPVpluginEventModel: {
@@ -2322,14 +2156,7 @@ _setvalue(NPP npp, NPPVariable variable, void *result)
}
}
#endif
-#ifdef MOZ_WIDGET_ANDROID
- case kRequestDrawingModel_ANPSetValue:
- if (inst)
- inst->SetANPDrawingModel(NS_PTR_TO_INT32(result));
- return NPERR_NO_ERROR;
- case kAcceptEvents_ANPSetValue:
- return NPERR_NO_ERROR;
-#endif
+
default:
return NPERR_GENERIC_ERROR;
}
@@ -2682,13 +2509,8 @@ _unscheduletimer(NPP instance, uint32_t timerID)
return;
}
-#ifdef MOZ_WIDGET_ANDROID
- // Sometimes Flash calls this with a dead NPP instance. Ensure the one we have
- // here is valid and maps to a nsNPAPIPluginInstance.
- nsNPAPIPluginInstance *inst = nsNPAPIPluginInstance::GetFromNPP(instance);
-#else
nsNPAPIPluginInstance *inst = (nsNPAPIPluginInstance *)instance->ndata;
-#endif
+
if (!inst)
return;
diff --git a/dom/plugins/base/nsNPAPIPluginInstance.cpp b/dom/plugins/base/nsNPAPIPluginInstance.cpp
index 4b211ed7e..ce24b6296 100644
--- a/dom/plugins/base/nsNPAPIPluginInstance.cpp
+++ b/dom/plugins/base/nsNPAPIPluginInstance.cpp
@@ -5,11 +5,6 @@
#include "mozilla/DebugOnly.h"
-#ifdef MOZ_WIDGET_ANDROID
-// For ScreenOrientation.h and Hal.h
-#include "base/basictypes.h"
-#endif
-
#include "mozilla/Logging.h"
#include "prmem.h"
#include "nscore.h"
@@ -45,64 +40,6 @@
using namespace mozilla;
using namespace mozilla::dom;
-#ifdef MOZ_WIDGET_ANDROID
-#include "ANPBase.h"
-#include <android/log.h>
-#include "android_npapi.h"
-#include "mozilla/Mutex.h"
-#include "mozilla/CondVar.h"
-#include "mozilla/dom/ScreenOrientation.h"
-#include "mozilla/Hal.h"
-#include "GLContextProvider.h"
-#include "GLContext.h"
-#include "TexturePoolOGL.h"
-#include "SurfaceTypes.h"
-#include "EGLUtils.h"
-
-using namespace mozilla;
-using namespace mozilla::gl;
-
-typedef nsNPAPIPluginInstance::VideoInfo VideoInfo;
-
-class PluginEventRunnable : public Runnable
-{
-public:
- PluginEventRunnable(nsNPAPIPluginInstance* instance, ANPEvent* event)
- : mInstance(instance), mEvent(*event), mCanceled(false) {}
-
- virtual nsresult Run() {
- if (mCanceled)
- return NS_OK;
-
- mInstance->HandleEvent(&mEvent, nullptr);
- mInstance->PopPostedEvent(this);
- return NS_OK;
- }
-
- void Cancel() { mCanceled = true; }
-private:
- nsNPAPIPluginInstance* mInstance;
- ANPEvent mEvent;
- bool mCanceled;
-};
-
-static RefPtr<GLContext> sPluginContext = nullptr;
-
-static bool EnsureGLContext()
-{
- if (!sPluginContext) {
- const auto flags = CreateContextFlags::REQUIRE_COMPAT_PROFILE;
- nsCString discardedFailureId;
- sPluginContext = GLContextProvider::CreateHeadless(flags, &discardedFailureId);
- }
-
- return sPluginContext != nullptr;
-}
-
-static std::map<NPP, nsNPAPIPluginInstance*> sPluginNPPMap;
-
-#endif
-
using namespace mozilla;
using namespace mozilla::plugins::parent;
using namespace mozilla::layers;
@@ -113,13 +50,6 @@ NS_IMPL_ISUPPORTS(nsNPAPIPluginInstance, nsIAudioChannelAgentCallback)
nsNPAPIPluginInstance::nsNPAPIPluginInstance()
: mDrawingModel(kDefaultDrawingModel)
-#ifdef MOZ_WIDGET_ANDROID
- , mANPDrawingModel(0)
- , mFullScreenOrientation(dom::eScreenOrientation_LandscapePrimary)
- , mWakeLocked(false)
- , mFullScreen(false)
- , mOriginPos(gl::OriginPos::TopLeft)
-#endif
, mRunning(NOT_STARTED)
, mWindowless(false)
, mTransparent(false)
@@ -132,9 +62,6 @@ nsNPAPIPluginInstance::nsNPAPIPluginInstance()
#ifdef XP_MACOSX
, mCurrentPluginEvent(nullptr)
#endif
-#ifdef MOZ_WIDGET_ANDROID
- , mOnScreen(true)
-#endif
, mHaveJavaC2PJSObjectQuirk(false)
, mCachedParamLength(0)
, mCachedParamNames(nullptr)
@@ -145,20 +72,12 @@ nsNPAPIPluginInstance::nsNPAPIPluginInstance()
mNPP.ndata = this;
PLUGIN_LOG(PLUGIN_LOG_BASIC, ("nsNPAPIPluginInstance ctor: this=%p\n",this));
-
-#ifdef MOZ_WIDGET_ANDROID
- sPluginNPPMap[&mNPP] = this;
-#endif
}
nsNPAPIPluginInstance::~nsNPAPIPluginInstance()
{
PLUGIN_LOG(PLUGIN_LOG_BASIC, ("nsNPAPIPluginInstance dtor: this=%p\n",this));
-#ifdef MOZ_WIDGET_ANDROID
- sPluginNPPMap.erase(&mNPP);
-#endif
-
if (mMIMEType) {
PR_Free((void *)mMIMEType);
mMIMEType = nullptr;
@@ -195,21 +114,6 @@ nsNPAPIPluginInstance::Destroy()
Stop();
mPlugin = nullptr;
mAudioChannelAgent = nullptr;
-
-#if MOZ_WIDGET_ANDROID
- if (mContentSurface)
- mContentSurface->SetFrameAvailableCallback(nullptr);
-
- mContentSurface = nullptr;
-
- std::map<void*, VideoInfo*>::iterator it;
- for (it = mVideos.begin(); it != mVideos.end(); it++) {
- it->second->mSurfaceTexture->SetFrameAvailableCallback(nullptr);
- delete it->second;
- }
- mVideos.clear();
- SetWakeLock(false);
-#endif
}
TimeStamp
@@ -297,14 +201,6 @@ nsresult nsNPAPIPluginInstance::Stop()
}
mRunning = DESTROYED;
-#if MOZ_WIDGET_ANDROID
- for (uint32_t i = 0; i < mPostedEvents.Length(); i++) {
- mPostedEvents[i]->Cancel();
- }
-
- mPostedEvents.Clear();
-#endif
-
nsJSNPRuntime::OnPluginDestroy(&mNPP);
if (error != NPERR_NO_ERROR)
@@ -404,13 +300,8 @@ nsNPAPIPluginInstance::Start()
mCachedParamValues[i] = ToNewUTF8String(attributes[i].mValue);
}
- // Android expects and empty string instead of null.
mCachedParamNames[attributes.Length()] = ToNewUTF8String(NS_LITERAL_STRING("PARAM"));
- #ifdef MOZ_WIDGET_ANDROID
- mCachedParamValues[attributes.Length()] = ToNewUTF8String(NS_LITERAL_STRING(""));
- #else
- mCachedParamValues[attributes.Length()] = nullptr;
- #endif
+ mCachedParamValues[attributes.Length()] = nullptr;
for (uint32_t i = 0, pos = attributes.Length() + 1; i < params.Length(); i ++) {
mCachedParamNames[pos] = ToNewUTF8String(params[i].mName);
@@ -738,249 +629,6 @@ void nsNPAPIPluginInstance::SetEventModel(NPEventModel aModel)
}
#endif
-#if defined(MOZ_WIDGET_ANDROID)
-
-static void SendLifecycleEvent(nsNPAPIPluginInstance* aInstance, uint32_t aAction)
-{
- ANPEvent event;
- event.inSize = sizeof(ANPEvent);
- event.eventType = kLifecycle_ANPEventType;
- event.data.lifecycle.action = aAction;
- aInstance->HandleEvent(&event, nullptr);
-}
-
-void nsNPAPIPluginInstance::NotifyForeground(bool aForeground)
-{
- PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("nsNPAPIPluginInstance::SetForeground this=%p\n foreground=%d",this, aForeground));
- if (RUNNING != mRunning)
- return;
-
- SendLifecycleEvent(this, aForeground ? kResume_ANPLifecycleAction : kPause_ANPLifecycleAction);
-}
-
-void nsNPAPIPluginInstance::NotifyOnScreen(bool aOnScreen)
-{
- PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("nsNPAPIPluginInstance::SetOnScreen this=%p\n onScreen=%d",this, aOnScreen));
- if (RUNNING != mRunning || mOnScreen == aOnScreen)
- return;
-
- mOnScreen = aOnScreen;
- SendLifecycleEvent(this, aOnScreen ? kOnScreen_ANPLifecycleAction : kOffScreen_ANPLifecycleAction);
-}
-
-void nsNPAPIPluginInstance::MemoryPressure()
-{
- PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("nsNPAPIPluginInstance::MemoryPressure this=%p\n",this));
- if (RUNNING != mRunning)
- return;
-
- SendLifecycleEvent(this, kFreeMemory_ANPLifecycleAction);
-}
-
-void nsNPAPIPluginInstance::NotifyFullScreen(bool aFullScreen)
-{
- PLUGIN_LOG(PLUGIN_LOG_NORMAL, ("nsNPAPIPluginInstance::NotifyFullScreen this=%p\n",this));
-
- if (RUNNING != mRunning || mFullScreen == aFullScreen)
- return;
-
- mFullScreen = aFullScreen;
- SendLifecycleEvent(this, mFullScreen ? kEnterFullScreen_ANPLifecycleAction : kExitFullScreen_ANPLifecycleAction);
-
- if (mFullScreen && mFullScreenOrientation != dom::eScreenOrientation_None) {
- java::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
- }
-}
-
-void nsNPAPIPluginInstance::NotifySize(nsIntSize size)
-{
- if (kOpenGL_ANPDrawingModel != GetANPDrawingModel() ||
- size == mCurrentSize)
- return;
-
- mCurrentSize = size;
-
- ANPEvent event;
- event.inSize = sizeof(ANPEvent);
- event.eventType = kDraw_ANPEventType;
- event.data.draw.model = kOpenGL_ANPDrawingModel;
- event.data.draw.data.surfaceSize.width = size.width;
- event.data.draw.data.surfaceSize.height = size.height;
-
- HandleEvent(&event, nullptr);
-}
-
-void nsNPAPIPluginInstance::SetANPDrawingModel(uint32_t aModel)
-{
- mANPDrawingModel = aModel;
-}
-
-void* nsNPAPIPluginInstance::GetJavaSurface()
-{
- void* surface = nullptr;
- nsresult rv = GetValueFromPlugin(kJavaSurface_ANPGetValue, &surface);
- if (NS_FAILED(rv))
- return nullptr;
-
- return surface;
-}
-
-void nsNPAPIPluginInstance::PostEvent(void* event)
-{
- PluginEventRunnable *r = new PluginEventRunnable(this, (ANPEvent*)event);
- mPostedEvents.AppendElement(RefPtr<PluginEventRunnable>(r));
-
- NS_DispatchToMainThread(r);
-}
-
-void nsNPAPIPluginInstance::SetFullScreenOrientation(uint32_t orientation)
-{
- if (mFullScreenOrientation == orientation)
- return;
-
- uint32_t oldOrientation = mFullScreenOrientation;
- mFullScreenOrientation = orientation;
-
- if (mFullScreen) {
- // We're already fullscreen so immediately apply the orientation change
-
- if (mFullScreenOrientation != dom::eScreenOrientation_None) {
- java::GeckoAppShell::LockScreenOrientation(mFullScreenOrientation);
- } else if (oldOrientation != dom::eScreenOrientation_None) {
- // We applied an orientation when we entered fullscreen, but
- // we don't want it anymore
- java::GeckoAppShell::UnlockScreenOrientation();
- }
- }
-}
-
-void nsNPAPIPluginInstance::PopPostedEvent(PluginEventRunnable* r)
-{
- mPostedEvents.RemoveElement(r);
-}
-
-void nsNPAPIPluginInstance::SetWakeLock(bool aLocked)
-{
- if (aLocked == mWakeLocked)
- return;
-
- mWakeLocked = aLocked;
- hal::ModifyWakeLock(NS_LITERAL_STRING("screen"),
- mWakeLocked ? hal::WAKE_LOCK_ADD_ONE : hal::WAKE_LOCK_REMOVE_ONE,
- hal::WAKE_LOCK_NO_CHANGE);
-}
-
-GLContext* nsNPAPIPluginInstance::GLContext()
-{
- if (!EnsureGLContext())
- return nullptr;
-
- return sPluginContext;
-}
-
-already_AddRefed<AndroidSurfaceTexture> nsNPAPIPluginInstance::CreateSurfaceTexture()
-{
- if (!EnsureGLContext())
- return nullptr;
-
- GLuint texture = TexturePoolOGL::AcquireTexture();
- if (!texture)
- return nullptr;
-
- RefPtr<AndroidSurfaceTexture> surface = AndroidSurfaceTexture::Create(TexturePoolOGL::GetGLContext(),
- texture);
- if (!surface) {
- return nullptr;
- }
-
- nsCOMPtr<nsIRunnable> frameCallback = NewRunnableMethod(this, &nsNPAPIPluginInstance::OnSurfaceTextureFrameAvailable);
- surface->SetFrameAvailableCallback(frameCallback);
- return surface.forget();
-}
-
-void nsNPAPIPluginInstance::OnSurfaceTextureFrameAvailable()
-{
- if (mRunning == RUNNING && mOwner)
- mOwner->Recomposite();
-}
-
-void* nsNPAPIPluginInstance::AcquireContentWindow()
-{
- if (!mContentSurface) {
- mContentSurface = CreateSurfaceTexture();
-
- if (!mContentSurface)
- return nullptr;
- }
-
- return mContentSurface->NativeWindow();
-}
-
-AndroidSurfaceTexture*
-nsNPAPIPluginInstance::AsSurfaceTexture()
-{
- if (!mContentSurface)
- return nullptr;
-
- return mContentSurface;
-}
-
-void* nsNPAPIPluginInstance::AcquireVideoWindow()
-{
- RefPtr<AndroidSurfaceTexture> surface = CreateSurfaceTexture();
- if (!surface) {
- return nullptr;
- }
-
- VideoInfo* info = new VideoInfo(surface);
-
- void* window = info->mSurfaceTexture->NativeWindow();
- mVideos.insert(std::pair<void*, VideoInfo*>(window, info));
-
- return window;
-}
-
-void nsNPAPIPluginInstance::ReleaseVideoWindow(void* window)
-{
- std::map<void*, VideoInfo*>::iterator it = mVideos.find(window);
- if (it == mVideos.end())
- return;
-
- delete it->second;
- mVideos.erase(window);
-}
-
-void nsNPAPIPluginInstance::SetVideoDimensions(void* window, gfxRect aDimensions)
-{
- std::map<void*, VideoInfo*>::iterator it;
-
- it = mVideos.find(window);
- if (it == mVideos.end())
- return;
-
- it->second->mDimensions = aDimensions;
-}
-
-void nsNPAPIPluginInstance::GetVideos(nsTArray<VideoInfo*>& aVideos)
-{
- std::map<void*, VideoInfo*>::iterator it;
- for (it = mVideos.begin(); it != mVideos.end(); it++)
- aVideos.AppendElement(it->second);
-}
-
-nsNPAPIPluginInstance* nsNPAPIPluginInstance::GetFromNPP(NPP npp)
-{
- std::map<NPP, nsNPAPIPluginInstance*>::iterator it;
-
- it = sPluginNPPMap.find(npp);
- if (it == sPluginNPPMap.end())
- return nullptr;
-
- return it->second;
-}
-
-#endif
-
nsresult nsNPAPIPluginInstance::GetDrawingModel(int32_t* aModel)
{
*aModel = (int32_t)mDrawingModel;
@@ -1083,9 +731,8 @@ nsNPAPIPluginInstance::ShouldCache()
nsresult
nsNPAPIPluginInstance::IsWindowless(bool* isWindowless)
{
-#if defined(MOZ_WIDGET_ANDROID) || defined(XP_MACOSX)
+#ifdef XP_MACOSX
// All OS X plugins are windowless.
- // On android, pre-honeycomb, all plugins are treated as windowless.
*isWindowless = true;
#else
*isWindowless = mWindowless;
diff --git a/dom/plugins/base/nsNPAPIPluginInstance.h b/dom/plugins/base/nsNPAPIPluginInstance.h
index 5f0375637..48e62517d 100644
--- a/dom/plugins/base/nsNPAPIPluginInstance.h
+++ b/dom/plugins/base/nsNPAPIPluginInstance.h
@@ -18,15 +18,6 @@
#include <prinrval.h>
#include "js/TypeDecls.h"
#include "nsIAudioChannelAgent.h"
-#ifdef MOZ_WIDGET_ANDROID
-#include "nsIRunnable.h"
-#include "GLContextTypes.h"
-#include "AndroidSurfaceTexture.h"
-#include "AndroidBridge.h"
-#include <map>
-class PluginEventRunnable;
-#endif
-
#include "mozilla/EventForwards.h"
#include "mozilla/TimeStamp.h"
#include "mozilla/PluginLibrary.h"
@@ -163,90 +154,6 @@ public:
}
#endif
-#ifdef MOZ_WIDGET_ANDROID
- void NotifyForeground(bool aForeground);
- void NotifyOnScreen(bool aOnScreen);
- void MemoryPressure();
- void NotifyFullScreen(bool aFullScreen);
- void NotifySize(nsIntSize size);
-
- nsIntSize CurrentSize() { return mCurrentSize; }
-
- bool IsOnScreen() {
- return mOnScreen;
- }
-
- uint32_t GetANPDrawingModel() { return mANPDrawingModel; }
- void SetANPDrawingModel(uint32_t aModel);
-
- void* GetJavaSurface();
-
- void PostEvent(void* event);
-
- // These are really mozilla::dom::ScreenOrientation, but it's
- // difficult to include that here
- uint32_t FullScreenOrientation() { return mFullScreenOrientation; }
- void SetFullScreenOrientation(uint32_t orientation);
-
- void SetWakeLock(bool aLock);
-
- mozilla::gl::GLContext* GLContext();
-
- // For ANPOpenGL
- class TextureInfo {
- public:
- TextureInfo() :
- mTexture(0), mWidth(0), mHeight(0), mInternalFormat(0)
- {
- }
-
- TextureInfo(GLuint aTexture, int32_t aWidth, int32_t aHeight, GLuint aInternalFormat) :
- mTexture(aTexture), mWidth(aWidth), mHeight(aHeight), mInternalFormat(aInternalFormat)
- {
- }
-
- GLuint mTexture;
- int32_t mWidth;
- int32_t mHeight;
- GLuint mInternalFormat;
- };
-
- // For ANPNativeWindow
- void* AcquireContentWindow();
-
- mozilla::gl::AndroidSurfaceTexture* AsSurfaceTexture();
-
- // For ANPVideo
- class VideoInfo {
- public:
- VideoInfo(mozilla::gl::AndroidSurfaceTexture* aSurfaceTexture) :
- mSurfaceTexture(aSurfaceTexture)
- {
- }
-
- ~VideoInfo()
- {
- mSurfaceTexture = nullptr;
- }
-
- RefPtr<mozilla::gl::AndroidSurfaceTexture> mSurfaceTexture;
- gfxRect mDimensions;
- };
-
- void* AcquireVideoWindow();
- void ReleaseVideoWindow(void* aWindow);
- void SetVideoDimensions(void* aWindow, gfxRect aDimensions);
-
- void GetVideos(nsTArray<VideoInfo*>& aVideos);
-
- void SetOriginPos(mozilla::gl::OriginPos aOriginPos) {
- mOriginPos = aOriginPos;
- }
- mozilla::gl::OriginPos OriginPos() const { return mOriginPos; }
-
- static nsNPAPIPluginInstance* GetFromNPP(NPP npp);
-#endif
-
nsresult NewStreamListener(const char* aURL, void* notifyData,
nsNPAPIPluginStreamListener** listener);
@@ -347,23 +254,6 @@ protected:
NPDrawingModel mDrawingModel;
-#ifdef MOZ_WIDGET_ANDROID
- uint32_t mANPDrawingModel;
-
- friend class PluginEventRunnable;
-
- nsTArray<RefPtr<PluginEventRunnable>> mPostedEvents;
- void PopPostedEvent(PluginEventRunnable* r);
- void OnSurfaceTextureFrameAvailable();
-
- uint32_t mFullScreenOrientation;
- bool mWakeLocked;
- bool mFullScreen;
- mozilla::gl::OriginPos mOriginPos;
-
- RefPtr<mozilla::gl::AndroidSurfaceTexture> mContentSurface;
-#endif
-
enum {
NOT_STARTED,
RUNNING,
@@ -410,15 +300,6 @@ private:
// This is only valid when the plugin is actually stopped!
mozilla::TimeStamp mStopTime;
-#ifdef MOZ_WIDGET_ANDROID
- already_AddRefed<mozilla::gl::AndroidSurfaceTexture> CreateSurfaceTexture();
-
- std::map<void*, VideoInfo*> mVideos;
- bool mOnScreen;
-
- nsIntSize mCurrentSize;
-#endif
-
// is this instance Java and affected by bug 750480?
bool mHaveJavaC2PJSObjectQuirk;
@@ -434,13 +315,7 @@ private:
bool mMuted;
};
-// On Android, we need to guard against plugin code leaking entries in the local
-// JNI ref table. See https://bugzilla.mozilla.org/show_bug.cgi?id=780831#c21
-#ifdef MOZ_WIDGET_ANDROID
- #define MAIN_THREAD_JNI_REF_GUARD mozilla::AutoLocalJNIFrame jniFrame
-#else
- #define MAIN_THREAD_JNI_REF_GUARD
-#endif
+#define MAIN_THREAD_JNI_REF_GUARD
void NS_NotifyBeginPluginCall(NSPluginCallReentry aReentryState);
void NS_NotifyPluginCall(NSPluginCallReentry aReentryState);
diff --git a/dom/plugins/base/nsPluginHost.cpp b/dom/plugins/base/nsPluginHost.cpp
index c3de136d0..1b98855d1 100644
--- a/dom/plugins/base/nsPluginHost.cpp
+++ b/dom/plugins/base/nsPluginHost.cpp
@@ -104,11 +104,6 @@
#include "winbase.h"
#endif
-#ifdef ANDROID
-#include <android/log.h>
-#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
-#endif
-
#include "npapi.h"
using namespace mozilla;
@@ -293,10 +288,6 @@ nsPluginHost::nsPluginHost()
if (obsService) {
obsService->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
obsService->AddObserver(this, "blocklist-updated", false);
-#ifdef MOZ_WIDGET_ANDROID
- obsService->AddObserver(this, "application-foreground", false);
- obsService->AddObserver(this, "application-background", false);
-#endif
}
#ifdef PLUGIN_LOGGING
@@ -2306,11 +2297,6 @@ WatchRegKey(uint32_t aRoot, nsCOMPtr<nsIWindowsRegKey>& aKey)
nsresult nsPluginHost::LoadPlugins()
{
-#ifdef ANDROID
- if (XRE_IsContentProcess()) {
- return NS_OK;
- }
-#endif
// do not do anything if it is already done
// use ReloadPlugins() to enforce loading
if (mPluginsLoaded)
@@ -2453,10 +2439,6 @@ nsresult nsPluginHost::FindPlugins(bool aCreatePluginList, bool * aPluginsChange
NS_ITERATIVE_UNREF_LIST(RefPtr<nsInvalidPluginTag>, mInvalidPlugins, mNext);
return NS_OK;
}
- } else {
-#ifdef ANDROID
- LOG("getting plugins dir failed");
-#endif
}
mPluginsLoaded = true; // at this point 'some' plugins have been loaded,
@@ -3069,14 +3051,6 @@ nsPluginHost::ReadPluginInfo()
if (!reader.NextLine())
return rv;
-#if MOZ_WIDGET_ANDROID
- // Flash on Android does not populate the version field, but it is tacked on to the description.
- // For example, "Shockwave Flash 11.1 r115"
- if (PL_strncmp("Shockwave Flash ", description, 16) == 0 && description[16]) {
- version = &description[16];
- }
-#endif
-
const char *name = reader.LinePtr();
if (!reader.NextLine())
return rv;
@@ -3144,31 +3118,6 @@ nsPluginHost::ReadPluginInfo()
mCachedPlugins = tag;
}
-// On Android we always want to try to load a plugin again (Flash). Bug 935676.
-#ifndef MOZ_WIDGET_ANDROID
- if (!ReadSectionHeader(reader, "INVALID")) {
- return rv;
- }
-
- while (reader.NextLine()) {
- const char *fullpath = reader.LinePtr();
- if (!reader.NextLine()) {
- return rv;
- }
-
- const char *lastModifiedTimeStamp = reader.LinePtr();
- int64_t lastmod = nsCRT::atoll(lastModifiedTimeStamp);
-
- RefPtr<nsInvalidPluginTag> invalidTag = new nsInvalidPluginTag(fullpath, lastmod);
-
- invalidTag->mNext = mInvalidPlugins;
- if (mInvalidPlugins) {
- mInvalidPlugins->mPrev = invalidTag;
- }
- mInvalidPlugins = invalidTag;
- }
-#endif
-
return NS_OK;
}
@@ -3491,24 +3440,7 @@ NS_IMETHODIMP nsPluginHost::Observe(nsISupports *aSubject,
plugin = plugin->mNext;
}
}
-#ifdef MOZ_WIDGET_ANDROID
- if (!strcmp("application-background", aTopic)) {
- for(uint32_t i = 0; i < mInstances.Length(); i++) {
- mInstances[i]->NotifyForeground(false);
- }
- }
- if (!strcmp("application-foreground", aTopic)) {
- for(uint32_t i = 0; i < mInstances.Length(); i++) {
- if (mInstances[i]->IsOnScreen())
- mInstances[i]->NotifyForeground(true);
- }
- }
- if (!strcmp("memory-pressure", aTopic)) {
- for(uint32_t i = 0; i < mInstances.Length(); i++) {
- mInstances[i]->MemoryPressure();
- }
- }
-#endif
+
return NS_OK;
}
diff --git a/dom/plugins/base/nsPluginInstanceOwner.cpp b/dom/plugins/base/nsPluginInstanceOwner.cpp
index d5b1eb9ea..22c4783ca 100644
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -87,20 +87,6 @@ static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
#include <gtk/gtk.h>
#endif
-#ifdef MOZ_WIDGET_ANDROID
-#include "ANPBase.h"
-#include "AndroidBridge.h"
-#include "ClientLayerManager.h"
-#include "nsWindow.h"
-
-static nsPluginInstanceOwner* sFullScreenInstance = nullptr;
-
-using namespace mozilla::dom;
-
-#include <android/log.h>
-#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, "GeckoPlugins" , ## args)
-#endif
-
using namespace mozilla;
using namespace mozilla::dom;
using namespace mozilla::layers;
@@ -165,29 +151,6 @@ nsPluginInstanceOwner::NotifyPaintWaiter(nsDisplayListBuilder* aBuilder)
}
}
-#if MOZ_WIDGET_ANDROID
-static void
-AttachToContainerAsSurfaceTexture(ImageContainer* container,
- nsNPAPIPluginInstance* instance,
- const LayoutDeviceRect& rect,
- RefPtr<Image>* out_image)
-{
- MOZ_ASSERT(out_image);
- MOZ_ASSERT(!*out_image);
-
- mozilla::gl::AndroidSurfaceTexture* surfTex = instance->AsSurfaceTexture();
- if (!surfTex) {
- return;
- }
-
- RefPtr<Image> img = new SurfaceTextureImage(
- surfTex,
- gfx::IntSize::Truncate(rect.width, rect.height),
- instance->OriginPos());
- *out_image = img;
-}
-#endif
-
bool
nsPluginInstanceOwner::NeedsScrollImageLayer()
{
@@ -211,27 +174,6 @@ nsPluginInstanceOwner::GetImageContainer()
RefPtr<ImageContainer> container;
-#if MOZ_WIDGET_ANDROID
- LayoutDeviceRect r = GetPluginRect();
-
- // NotifySize() causes Flash to do a bunch of stuff like ask for surfaces to render
- // into, set y-flip flags, etc, so we do this at the beginning.
- float resolution = mPluginFrame->PresContext()->PresShell()->GetCumulativeResolution();
- ScreenSize screenSize = (r * LayoutDeviceToScreenScale(resolution)).Size();
- mInstance->NotifySize(nsIntSize::Truncate(screenSize.width, screenSize.height));
-
- container = LayerManager::CreateImageContainer();
-
- if (r.width && r.height) {
- // Try to get it as an EGLImage first.
- RefPtr<Image> img;
- AttachToContainerAsSurfaceTexture(container, mInstance, r, &img);
-
- if (img) {
- container->SetCurrentImageInTransaction(img);
- }
- }
-#else
if (NeedsScrollImageLayer()) {
// windowed plugin under e10s
#if defined(XP_WIN)
@@ -241,7 +183,6 @@ nsPluginInstanceOwner::GetImageContainer()
// async windowless rendering
mInstance->GetImageContainer(getter_AddRefs(container));
}
-#endif
return container.forget();
}
@@ -358,11 +299,6 @@ nsPluginInstanceOwner::nsPluginInstanceOwner()
mWaitingForPaint = false;
-#ifdef MOZ_WIDGET_ANDROID
- mFullScreen = false;
- mJavaView = nullptr;
-#endif
-
#ifdef XP_WIN
mGotCompositionData = false;
mSentStartComposition = false;
@@ -387,10 +323,6 @@ nsPluginInstanceOwner::~nsPluginInstanceOwner()
PLUG_DeletePluginNativeWindow(mPluginWindow);
mPluginWindow = nullptr;
-#ifdef MOZ_WIDGET_ANDROID
- RemovePluginView();
-#endif
-
if (mInstance) {
mInstance->SetOwner(nullptr);
}
@@ -413,10 +345,6 @@ nsPluginInstanceOwner::SetInstance(nsNPAPIPluginInstance *aInstance)
// from our destructor. This fixes bug 613376.
if (mInstance && !aInstance) {
mInstance->SetOwner(nullptr);
-
-#ifdef MOZ_WIDGET_ANDROID
- RemovePluginView();
-#endif
}
mInstance = aInstance;
@@ -601,7 +529,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(NPRect *invalidRect)
if (!mPluginFrame || !invalidRect || !mWidgetVisible)
return NS_ERROR_FAILURE;
-#if defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID)
+#ifdef XP_MACOSX
// Each time an asynchronously-drawing plugin sends a new surface to display,
// the image in the ImageContainer is updated and InvalidateRect is called.
// There are different side effects for (sync) Android plugins.
@@ -624,6 +552,7 @@ NS_IMETHODIMP nsPluginInstanceOwner::InvalidateRect(NPRect *invalidRect)
}
}
#endif
+
nsIntRect rect(invalidRect->left,
invalidRect->top,
invalidRect->right - invalidRect->left,
@@ -1485,185 +1414,6 @@ nsPluginInstanceOwner::GetEventloopNestingLevel()
return currentLevel;
}
-#ifdef MOZ_WIDGET_ANDROID
-
-// Modified version of nsFrame::GetOffsetToCrossDoc that stops when it
-// hits an element with a displayport (or runs out of frames). This is
-// not really the right thing to do, but it's better than what was here before.
-static nsPoint
-GetOffsetRootContent(nsIFrame* aFrame)
-{
- // offset will hold the final offset
- // docOffset holds the currently accumulated offset at the current APD, it
- // will be converted and added to offset when the current APD changes.
- nsPoint offset(0, 0), docOffset(0, 0);
- const nsIFrame* f = aFrame;
- int32_t currAPD = aFrame->PresContext()->AppUnitsPerDevPixel();
- int32_t apd = currAPD;
- while (f) {
- if (f->GetContent() && nsLayoutUtils::HasDisplayPort(f->GetContent()))
- break;
-
- docOffset += f->GetPosition();
- nsIFrame* parent = f->GetParent();
- if (parent) {
- f = parent;
- } else {
- nsPoint newOffset(0, 0);
- f = nsLayoutUtils::GetCrossDocParentFrame(f, &newOffset);
- int32_t newAPD = f ? f->PresContext()->AppUnitsPerDevPixel() : 0;
- if (!f || newAPD != currAPD) {
- // Convert docOffset to the right APD and add it to offset.
- offset += docOffset.ScaleToOtherAppUnits(currAPD, apd);
- docOffset.x = docOffset.y = 0;
- }
- currAPD = newAPD;
- docOffset += newOffset;
- }
- }
-
- offset += docOffset.ScaleToOtherAppUnits(currAPD, apd);
-
- return offset;
-}
-
-LayoutDeviceRect nsPluginInstanceOwner::GetPluginRect()
-{
- // Get the offset of the content relative to the page
- nsRect bounds = mPluginFrame->GetContentRectRelativeToSelf() + GetOffsetRootContent(mPluginFrame);
- LayoutDeviceIntRect rect = LayoutDeviceIntRect::FromAppUnitsToNearest(bounds, mPluginFrame->PresContext()->AppUnitsPerDevPixel());
- return LayoutDeviceRect(rect);
-}
-
-bool nsPluginInstanceOwner::AddPluginView(const LayoutDeviceRect& aRect /* = LayoutDeviceRect(0, 0, 0, 0) */)
-{
- if (!mJavaView) {
- mJavaView = mInstance->GetJavaSurface();
-
- if (!mJavaView)
- return false;
-
- mJavaView = (void*)jni::GetGeckoThreadEnv()->NewGlobalRef((jobject)mJavaView);
- }
-
- if (mFullScreen) {
- java::GeckoAppShell::AddFullScreenPluginView(jni::Object::Ref::From(jobject(mJavaView)));
- sFullScreenInstance = this;
- }
-
- return true;
-}
-
-void nsPluginInstanceOwner::RemovePluginView()
-{
- if (!mInstance || !mJavaView)
- return;
-
- if (mFullScreen) {
- java::GeckoAppShell::RemoveFullScreenPluginView(jni::Object::Ref::From(jobject(mJavaView)));
- }
- jni::GetGeckoThreadEnv()->DeleteGlobalRef((jobject)mJavaView);
- mJavaView = nullptr;
-
- if (mFullScreen)
- sFullScreenInstance = nullptr;
-}
-
-void
-nsPluginInstanceOwner::GetVideos(nsTArray<nsNPAPIPluginInstance::VideoInfo*>& aVideos)
-{
- if (!mInstance)
- return;
-
- mInstance->GetVideos(aVideos);
-}
-
-already_AddRefed<ImageContainer>
-nsPluginInstanceOwner::GetImageContainerForVideo(nsNPAPIPluginInstance::VideoInfo* aVideoInfo)
-{
- RefPtr<ImageContainer> container = LayerManager::CreateImageContainer();
-
- if (aVideoInfo->mDimensions.width && aVideoInfo->mDimensions.height) {
- RefPtr<Image> img = new SurfaceTextureImage(
- aVideoInfo->mSurfaceTexture,
- gfx::IntSize::Truncate(aVideoInfo->mDimensions.width, aVideoInfo->mDimensions.height),
- gl::OriginPos::BottomLeft);
- container->SetCurrentImageInTransaction(img);
- }
-
- return container.forget();
-}
-
-void nsPluginInstanceOwner::Invalidate() {
- NPRect rect;
- rect.left = rect.top = 0;
- rect.right = mPluginWindow->width;
- rect.bottom = mPluginWindow->height;
- InvalidateRect(&rect);
-}
-
-void nsPluginInstanceOwner::Recomposite() {
- nsIWidget* const widget = mPluginFrame->GetNearestWidget();
- NS_ENSURE_TRUE_VOID(widget);
-
- LayerManager* const lm = widget->GetLayerManager();
- NS_ENSURE_TRUE_VOID(lm);
-
- ClientLayerManager* const clm = lm->AsClientLayerManager();
- NS_ENSURE_TRUE_VOID(clm && clm->GetRoot());
-
- clm->SendInvalidRegion(
- clm->GetRoot()->GetLocalVisibleRegion().ToUnknownRegion().GetBounds());
- clm->Composite();
-}
-
-void nsPluginInstanceOwner::RequestFullScreen() {
- if (mFullScreen)
- return;
-
- // Remove whatever view we currently have (if any, fullscreen or otherwise)
- RemovePluginView();
-
- mFullScreen = true;
- AddPluginView();
-
- mInstance->NotifyFullScreen(mFullScreen);
-}
-
-void nsPluginInstanceOwner::ExitFullScreen() {
- if (!mFullScreen)
- return;
-
- RemovePluginView();
-
- mFullScreen = false;
-
- int32_t model = mInstance->GetANPDrawingModel();
-
- if (model == kSurface_ANPDrawingModel) {
- // We need to do this immediately, otherwise Flash
- // sometimes causes a deadlock (bug 762407)
- AddPluginView(GetPluginRect());
- }
-
- mInstance->NotifyFullScreen(mFullScreen);
-
- // This will cause Paint() to be called, which is where
- // we normally add/update views and layers
- Invalidate();
-}
-
-void nsPluginInstanceOwner::ExitFullScreen(jobject view) {
- JNIEnv* env = jni::GetGeckoThreadEnv();
-
- if (sFullScreenInstance && sFullScreenInstance->mInstance &&
- env->IsSameObject(view, (jobject)sFullScreenInstance->mInstance->GetJavaSurface())) {
- sFullScreenInstance->ExitFullScreen();
- }
-}
-
-#endif
-
void
nsPluginInstanceOwner::NotifyHostAsyncInitFailed()
{
@@ -1705,27 +1455,6 @@ nsPluginInstanceOwner::NotifyDestroyPending()
nsresult nsPluginInstanceOwner::DispatchFocusToPlugin(nsIDOMEvent* aFocusEvent)
{
-#ifdef MOZ_WIDGET_ANDROID
- if (mInstance) {
- ANPEvent event;
- event.inSize = sizeof(ANPEvent);
- event.eventType = kLifecycle_ANPEventType;
-
- nsAutoString eventType;
- aFocusEvent->GetType(eventType);
- if (eventType.EqualsLiteral("focus")) {
- event.data.lifecycle.action = kGainFocus_ANPLifecycleAction;
- }
- else if (eventType.EqualsLiteral("blur")) {
- event.data.lifecycle.action = kLoseFocus_ANPLifecycleAction;
- }
- else {
- NS_ASSERTION(false, "nsPluginInstanceOwner::DispatchFocusToPlugin, wierd eventType");
- }
- mInstance->HandleEvent(&event, nullptr);
- }
-#endif
-
#ifndef XP_MACOSX
if (!mPluginWindow || (mPluginWindow->type == NPWindowTypeWindow)) {
// continue only for cases without child window
@@ -2786,96 +2515,6 @@ nsEventStatus nsPluginInstanceOwner::ProcessEvent(const WidgetGUIEvent& anEvent)
rv = nsEventStatus_eConsumeNoDefault;
#endif
-#ifdef MOZ_WIDGET_ANDROID
- // this code supports windowless plugins
- {
- // The plugin needs focus to receive keyboard and touch events
- nsIFocusManager* fm = nsFocusManager::GetFocusManager();
- if (fm) {
- nsCOMPtr<nsIDOMElement> elem = do_QueryReferent(mContent);
- fm->SetFocus(elem, 0);
- }
- }
- switch(anEvent.mClass) {
- case eMouseEventClass:
- {
- switch (anEvent.mMessage) {
- case eMouseClick:
- case eMouseDoubleClick:
- case eMouseAuxClick:
- // Button up/down events sent instead.
- return rv;
- default:
- break;
- }
-
- // Get reference point relative to plugin origin.
- const nsPresContext* presContext = mPluginFrame->PresContext();
- nsPoint appPoint =
- nsLayoutUtils::GetEventCoordinatesRelativeTo(&anEvent, mPluginFrame) -
- mPluginFrame->GetContentRectRelativeToSelf().TopLeft();
- nsIntPoint pluginPoint(presContext->AppUnitsToDevPixels(appPoint.x),
- presContext->AppUnitsToDevPixels(appPoint.y));
-
- switch (anEvent.mMessage) {
- case eMouseMove:
- {
- // are these going to be touch events?
- // pluginPoint.x;
- // pluginPoint.y;
- }
- break;
- case eMouseDown:
- {
- ANPEvent event;
- event.inSize = sizeof(ANPEvent);
- event.eventType = kMouse_ANPEventType;
- event.data.mouse.action = kDown_ANPMouseAction;
- event.data.mouse.x = pluginPoint.x;
- event.data.mouse.y = pluginPoint.y;
- mInstance->HandleEvent(&event, nullptr, NS_PLUGIN_CALL_SAFE_TO_REENTER_GECKO);
- }
- break;
- case eMouseUp:
- {
- ANPEvent event;
- event.inSize = sizeof(ANPEvent);
- event.eventType = kMouse_ANPEventType;
- event.data.mouse.action = kUp_ANPMouseAction;
- event.data.mouse.x = pluginPoint.x;
- event.data.mouse.y = pluginPoint.y;
- mInstance->HandleEvent(&event, nullptr, NS_PLUGIN_CALL_SAFE_TO_REENTER_GECKO);
- }
- break;
- default:
- break;
- }
- }
- break;
-
- case eKeyboardEventClass:
- {
- const WidgetKeyboardEvent& keyEvent = *anEvent.AsKeyboardEvent();
- LOG("Firing eKeyboardEventClass %d %d\n",
- keyEvent.mKeyCode, keyEvent.mCharCode);
- // pluginEvent is initialized by nsWindow::InitKeyEvent().
- const ANPEvent* pluginEvent = static_cast<const ANPEvent*>(keyEvent.mPluginEvent);
- if (pluginEvent) {
- MOZ_ASSERT(pluginEvent->inSize == sizeof(ANPEvent));
- MOZ_ASSERT(pluginEvent->eventType == kKey_ANPEventType);
- mInstance->HandleEvent(const_cast<ANPEvent*>(pluginEvent),
- nullptr,
- NS_PLUGIN_CALL_SAFE_TO_REENTER_GECKO);
- }
- }
- break;
-
- default:
- break;
- }
- rv = nsEventStatus_eConsumeNoDefault;
-#endif
-
return rv;
}
@@ -2922,10 +2561,6 @@ nsPluginInstanceOwner::Destroy()
this, true);
content->RemoveSystemEventListener(NS_LITERAL_STRING("text"), this, true);
-#if MOZ_WIDGET_ANDROID
- RemovePluginView();
-#endif
-
if (mWidget) {
if (mPluginWindow) {
mPluginWindow->SetPluginWidget(nullptr);
@@ -2995,72 +2630,6 @@ void nsPluginInstanceOwner::Paint(const RECT& aDirty, HDC aDC)
}
#endif
-#ifdef MOZ_WIDGET_ANDROID
-
-void nsPluginInstanceOwner::Paint(gfxContext* aContext,
- const gfxRect& aFrameRect,
- const gfxRect& aDirtyRect)
-{
- if (!mInstance || !mPluginFrame || !mPluginDocumentActiveState || mFullScreen)
- return;
-
- int32_t model = mInstance->GetANPDrawingModel();
-
- if (model == kSurface_ANPDrawingModel) {
- if (!AddPluginView(GetPluginRect())) {
- Invalidate();
- }
- return;
- }
-
- if (model != kBitmap_ANPDrawingModel)
- return;
-
-#ifdef ANP_BITMAP_DRAWING_MODEL
- static RefPtr<gfxImageSurface> pluginSurface;
-
- if (pluginSurface == nullptr ||
- aFrameRect.width != pluginSurface->Width() ||
- aFrameRect.height != pluginSurface->Height()) {
-
- pluginSurface = new gfxImageSurface(gfx::IntSize(aFrameRect.width, aFrameRect.height),
- SurfaceFormat::A8R8G8B8_UINT32);
- if (!pluginSurface)
- return;
- }
-
- // Clears buffer. I think this is needed.
- gfxUtils::ClearThebesSurface(pluginSurface);
-
- ANPEvent event;
- event.inSize = sizeof(ANPEvent);
- event.eventType = 4;
- event.data.draw.model = 1;
-
- event.data.draw.clip.top = 0;
- event.data.draw.clip.left = 0;
- event.data.draw.clip.bottom = aFrameRect.width;
- event.data.draw.clip.right = aFrameRect.height;
-
- event.data.draw.data.bitmap.format = kRGBA_8888_ANPBitmapFormat;
- event.data.draw.data.bitmap.width = aFrameRect.width;
- event.data.draw.data.bitmap.height = aFrameRect.height;
- event.data.draw.data.bitmap.baseAddr = pluginSurface->Data();
- event.data.draw.data.bitmap.rowBytes = aFrameRect.width * 4;
-
- if (!mInstance)
- return;
-
- mInstance->HandleEvent(&event, nullptr);
-
- aContext->SetOp(gfx::CompositionOp::OP_SOURCE);
- aContext->SetSource(pluginSurface, gfxPoint(aFrameRect.x, aFrameRect.y));
- aContext->Clip(aFrameRect);
- aContext->Paint();
-#endif
-}
-#endif
-
#if defined(MOZ_X11)
void nsPluginInstanceOwner::Paint(gfxContext* aContext,
const gfxRect& aFrameRect,
@@ -3663,24 +3232,6 @@ nsPluginInstanceOwner::UpdateDocumentActiveState(bool aIsActive)
#ifndef XP_MACOSX
UpdateWindowPositionAndClipRect(true);
-#ifdef MOZ_WIDGET_ANDROID
- if (mInstance) {
- if (!mPluginDocumentActiveState) {
- RemovePluginView();
- }
-
- mInstance->NotifyOnScreen(mPluginDocumentActiveState);
-
- // This is, perhaps, incorrect. It is supposed to be sent
- // when "the webview has paused or resumed". The side effect
- // is that Flash video players pause or resume (if they were
- // playing before) based on the value here. I personally think
- // we want that on Android when switching to another tab, so
- // that's why we call it here.
- mInstance->NotifyForeground(mPluginDocumentActiveState);
- }
-#endif // #ifdef MOZ_WIDGET_ANDROID
-
// We don't have a connection to PluginWidgetParent in the chrome
// process when dealing with tab visibility changes, so this needs
// to be forwarded over after the active state is updated. If we
diff --git a/dom/plugins/base/nsPluginInstanceOwner.h b/dom/plugins/base/nsPluginInstanceOwner.h
index 589bcb02c..2fa67c86e 100644
--- a/dom/plugins/base/nsPluginInstanceOwner.h
+++ b/dom/plugins/base/nsPluginInstanceOwner.h
@@ -29,7 +29,7 @@ class nsPluginDOMContextMenuListener;
class nsPluginFrame;
class nsDisplayListBuilder;
-#if defined(MOZ_X11) || defined(ANDROID)
+#ifdef MOZ_X11
class gfxContext;
#endif
@@ -108,7 +108,7 @@ public:
void Paint(const gfxRect& aDirtyRect, CGContextRef cgContext);
void RenderCoreAnimation(CGContextRef aCGContext, int aWidth, int aHeight);
void DoCocoaEventDrawRect(const gfxRect& aDrawRect, CGContextRef cgContext);
-#elif defined(MOZ_X11) || defined(ANDROID)
+#elif defined(MOZ_X11)
void Paint(gfxContext* aContext,
const gfxRect& aFrameRect,
const gfxRect& aDirtyRect);
@@ -254,21 +254,6 @@ public:
already_AddRefed<nsIURI> GetBaseURI() const;
-#ifdef MOZ_WIDGET_ANDROID
- // Returns the image container for the specified VideoInfo
- void GetVideos(nsTArray<nsNPAPIPluginInstance::VideoInfo*>& aVideos);
- already_AddRefed<mozilla::layers::ImageContainer> GetImageContainerForVideo(nsNPAPIPluginInstance::VideoInfo* aVideoInfo);
-
- void Invalidate();
- void Recomposite();
-
- void RequestFullScreen();
- void ExitFullScreen();
-
- // Called from nsAppShell when we removed the fullscreen view.
- static void ExitFullScreen(jobject view);
-#endif
-
void NotifyHostAsyncInitFailed();
void NotifyHostCreateWidget();
void NotifyDestroyPending();
@@ -306,16 +291,7 @@ private:
size == nsIntSize(mPluginWindow->width, mPluginWindow->height);
}
-#ifdef MOZ_WIDGET_ANDROID
- mozilla::LayoutDeviceRect GetPluginRect();
- bool AddPluginView(const mozilla::LayoutDeviceRect& aRect = mozilla::LayoutDeviceRect(0, 0, 0, 0));
- void RemovePluginView();
-
- bool mFullScreen;
- void* mJavaView;
-#endif
-
-#if defined(XP_WIN)
+#ifdef XP_WIN
nsIWidget* GetContainingWidgetIfOffset();
already_AddRefed<mozilla::TextComposition> GetTextComposition();
void HandleNoConsumedCompositionMessage(
diff --git a/dom/plugins/base/nsPluginTags.cpp b/dom/plugins/base/nsPluginTags.cpp
index a794c416c..58b413388 100644
--- a/dom/plugins/base/nsPluginTags.cpp
+++ b/dom/plugins/base/nsPluginTags.cpp
@@ -735,10 +735,6 @@ nsPluginTag::GetNiceName(nsACString & aResult)
NS_IMETHODIMP
nsPluginTag::GetBlocklistState(uint32_t *aResult)
{
-#if defined(MOZ_WIDGET_ANDROID)
- *aResult = nsIBlocklistService::STATE_NOT_BLOCKED;
- return NS_OK;
-#else
if (mCachedBlocklistStateValid) {
*aResult = mCachedBlocklistState;
return NS_OK;
@@ -772,7 +768,6 @@ nsPluginTag::GetBlocklistState(uint32_t *aResult)
mCachedBlocklistState = (uint16_t) *aResult;
mCachedBlocklistStateValid = true;
return NS_OK;
-#endif // defined(MOZ_WIDGET_ANDROID)
}
void
diff --git a/dom/plugins/base/nsPluginsDirUnix.cpp b/dom/plugins/base/nsPluginsDirUnix.cpp
index de3b7a2d1..55a4eb0d6 100644
--- a/dom/plugins/base/nsPluginsDirUnix.cpp
+++ b/dom/plugins/base/nsPluginsDirUnix.cpp
@@ -206,16 +206,6 @@ bool nsPluginsDir::IsPluginFile(nsIFile* file)
if (NS_FAILED(file->GetNativeLeafName(filename)))
return false;
-#ifdef ANDROID
- // It appears that if you load
- // 'libstagefright_honeycomb.so' on froyo, or
- // 'libstagefright_froyo.so' on honeycomb, we will abort.
- // Since these are just helper libs, we can ignore.
- const char *cFile = filename.get();
- if (strstr(cFile, "libstagefright") != nullptr)
- return false;
-#endif
-
NS_NAMED_LITERAL_CSTRING(dllSuffix, LOCAL_PLUGIN_DLL_SUFFIX);
if (filename.Length() > dllSuffix.Length() &&
StringEndsWith(filename, dllSuffix))
diff --git a/dom/plugins/ipc/NPEventAndroid.h b/dom/plugins/ipc/NPEventAndroid.h
deleted file mode 100644
index f664af857..000000000
--- a/dom/plugins/ipc/NPEventAndroid.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 8 -*- */
-/* vim: set sw=4 ts=8 et tw=80 ft=cpp : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// This is a NPEventX11.h derived stub for Android
-// Plugins aren't actually supported yet
-
-#ifndef mozilla_dom_plugins_NPEventAndroid_h
-#define mozilla_dom_plugins_NPEventAndroid_h
-
-#include "npapi.h"
-
-namespace mozilla {
-
-namespace plugins {
-
-struct NPRemoteEvent {
- NPEvent event;
-};
-
-}
-
-}
-
-
-namespace IPC {
-
-template <>
-struct ParamTraits<mozilla::plugins::NPRemoteEvent>
-{
- typedef mozilla::plugins::NPRemoteEvent paramType;
-
- static void Write(Message* aMsg, const paramType& aParam)
- {
- aMsg->WriteBytes(&aParam, sizeof(paramType));
- }
-
- static bool Read(const Message* aMsg, PickleIterator* aIter, paramType* aResult)
- {
- return aMsg->ReadBytesInto(aIter, aResult, sizeof(paramType));
- }
-
- static void Log(const paramType& aParam, std::wstring* aLog)
- {
- // TODO
- aLog->append(L"(AndroidEvent)");
- }
-};
-
-} // namespace IPC
-
-
-#endif // mozilla_dom_plugins_NPEventAndroid_h
diff --git a/dom/plugins/ipc/PluginInstanceChild.cpp b/dom/plugins/ipc/PluginInstanceChild.cpp
index 3f2cdbc13..a4f6b6b51 100644
--- a/dom/plugins/ipc/PluginInstanceChild.cpp
+++ b/dom/plugins/ipc/PluginInstanceChild.cpp
@@ -1427,8 +1427,6 @@ PluginInstanceChild::AnswerNPP_SetWindow(const NPRemoteWindow& aWindow)
if (mPluginIface->setwindow)
(void) mPluginIface->setwindow(&mData, &mWindow);
-#elif defined(ANDROID)
- // TODO: Need Android impl
#elif defined(MOZ_WIDGET_UIKIT)
// Don't care
#else
diff --git a/dom/plugins/ipc/PluginInstanceParent.cpp b/dom/plugins/ipc/PluginInstanceParent.cpp
index bdd15ca99..24b1410bc 100644
--- a/dom/plugins/ipc/PluginInstanceParent.cpp
+++ b/dom/plugins/ipc/PluginInstanceParent.cpp
@@ -265,9 +265,6 @@ PluginInstanceParent::AnswerNPN_GetValue_NPNVnetscapeWindow(NativeWindowHandle*
XID id;
#elif defined(XP_DARWIN)
intptr_t id;
-#elif defined(ANDROID)
- // TODO: Need Android impl
- int id;
#else
#warning Implement me
#endif
diff --git a/dom/plugins/ipc/PluginMessageUtils.h b/dom/plugins/ipc/PluginMessageUtils.h
index 4532fac93..a9cd52ae2 100644
--- a/dom/plugins/ipc/PluginMessageUtils.h
+++ b/dom/plugins/ipc/PluginMessageUtils.h
@@ -111,7 +111,7 @@ struct NPAudioDeviceChangeDetailsIPC
typedef HWND NativeWindowHandle;
#elif defined(MOZ_X11)
typedef XID NativeWindowHandle;
-#elif defined(XP_DARWIN) || defined(ANDROID)
+#elif defined(XP_DARWIN)
typedef intptr_t NativeWindowHandle; // never actually used, will always be 0
#else
#error Need NativeWindowHandle for this platform
@@ -736,8 +736,6 @@ struct ParamTraits<mozilla::plugins::NPAudioDeviceChangeDetailsIPC>
# include "mozilla/plugins/NPEventOSX.h"
#elif defined(XP_WIN)
# include "mozilla/plugins/NPEventWindows.h"
-#elif defined(ANDROID)
-# include "mozilla/plugins/NPEventAndroid.h"
#elif defined(XP_UNIX)
# include "mozilla/plugins/NPEventUnix.h"
#else
diff --git a/dom/plugins/ipc/moz.build b/dom/plugins/ipc/moz.build
index 15ed6410d..051d5a3b4 100644
--- a/dom/plugins/ipc/moz.build
+++ b/dom/plugins/ipc/moz.build
@@ -17,7 +17,6 @@ EXPORTS.mozilla.plugins += [
'BrowserStreamParent.h',
'ChildAsyncCall.h',
'ChildTimer.h',
- 'NPEventAndroid.h',
'NPEventOSX.h',
'NPEventUnix.h',
'NPEventWindows.h',
diff --git a/dom/presentation/AvailabilityCollection.cpp b/dom/presentation/AvailabilityCollection.cpp
deleted file mode 100644
index 73752c750..000000000
--- a/dom/presentation/AvailabilityCollection.cpp
+++ /dev/null
@@ -1,99 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "AvailabilityCollection.h"
-
-#include "mozilla/ClearOnShutdown.h"
-#include "PresentationAvailability.h"
-
-namespace mozilla {
-namespace dom {
-
-/* static */
-StaticAutoPtr<AvailabilityCollection>
-AvailabilityCollection::sSingleton;
-static bool gOnceAliveNowDead = false;
-
-/* static */ AvailabilityCollection*
-AvailabilityCollection::GetSingleton()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (!sSingleton && !gOnceAliveNowDead) {
- sSingleton = new AvailabilityCollection();
- ClearOnShutdown(&sSingleton);
- }
-
- return sSingleton;
-}
-
-AvailabilityCollection::AvailabilityCollection()
-{
- MOZ_COUNT_CTOR(AvailabilityCollection);
-}
-
-AvailabilityCollection::~AvailabilityCollection()
-{
- MOZ_COUNT_DTOR(AvailabilityCollection);
- gOnceAliveNowDead = true;
-}
-
-void
-AvailabilityCollection::Add(PresentationAvailability* aAvailability)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (!aAvailability) {
- return;
- }
-
- WeakPtr<PresentationAvailability> availability = aAvailability;
- if (mAvailabilities.Contains(aAvailability)) {
- return;
- }
-
- mAvailabilities.AppendElement(aAvailability);
-}
-
-void
-AvailabilityCollection::Remove(PresentationAvailability* aAvailability)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (!aAvailability) {
- return;
- }
-
- WeakPtr<PresentationAvailability> availability = aAvailability;
- mAvailabilities.RemoveElement(availability);
-}
-
-already_AddRefed<PresentationAvailability>
-AvailabilityCollection::Find(const uint64_t aWindowId, const nsTArray<nsString>& aUrls)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- // Loop backwards to allow removing elements in the loop.
- for (int i = mAvailabilities.Length() - 1; i >= 0; --i) {
- WeakPtr<PresentationAvailability> availability = mAvailabilities[i];
- if (!availability) {
- // The availability object was destroyed. Remove it from the list.
- mAvailabilities.RemoveElementAt(i);
- continue;
- }
-
- if (availability->Equals(aWindowId, aUrls)) {
- RefPtr<PresentationAvailability> matchedAvailability = availability.get();
- return matchedAvailability.forget();
- }
- }
-
-
- return nullptr;
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/AvailabilityCollection.h b/dom/presentation/AvailabilityCollection.h
deleted file mode 100644
index d2faae4c2..000000000
--- a/dom/presentation/AvailabilityCollection.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_AvailabilityCollection_h
-#define mozilla_dom_AvailabilityCollection_h
-
-#include "mozilla/StaticPtr.h"
-#include "mozilla/WeakPtr.h"
-#include "nsString.h"
-#include "nsTArray.h"
-
-namespace mozilla {
-namespace dom {
-
-class PresentationAvailability;
-
-class AvailabilityCollection final
-{
-public:
- static AvailabilityCollection* GetSingleton();
-
- void Add(PresentationAvailability* aAvailability);
-
- void Remove(PresentationAvailability* aAvailability);
-
- already_AddRefed<PresentationAvailability>
- Find(const uint64_t aWindowId, const nsTArray<nsString>& aUrls);
-
-private:
- friend class StaticAutoPtr<AvailabilityCollection>;
-
- AvailabilityCollection();
- virtual ~AvailabilityCollection();
-
- static StaticAutoPtr<AvailabilityCollection> sSingleton;
- nsTArray<WeakPtr<PresentationAvailability>> mAvailabilities;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_AvailabilityCollection_h
diff --git a/dom/presentation/ControllerConnectionCollection.cpp b/dom/presentation/ControllerConnectionCollection.cpp
deleted file mode 100644
index 7d3ffe684..000000000
--- a/dom/presentation/ControllerConnectionCollection.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "ControllerConnectionCollection.h"
-
-#include "mozilla/ClearOnShutdown.h"
-#include "nsIPresentationService.h"
-#include "PresentationConnection.h"
-
-namespace mozilla {
-namespace dom {
-
-/* static */
-StaticAutoPtr<ControllerConnectionCollection>
-ControllerConnectionCollection::sSingleton;
-
-/* static */ ControllerConnectionCollection*
-ControllerConnectionCollection::GetSingleton()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (!sSingleton) {
- sSingleton = new ControllerConnectionCollection();
- ClearOnShutdown(&sSingleton);
- }
-
- return sSingleton;
-}
-
-ControllerConnectionCollection::ControllerConnectionCollection()
-{
- MOZ_COUNT_CTOR(ControllerConnectionCollection);
-}
-
-ControllerConnectionCollection::~ControllerConnectionCollection()
-{
- MOZ_COUNT_DTOR(ControllerConnectionCollection);
-}
-
-void
-ControllerConnectionCollection::AddConnection(
- PresentationConnection* aConnection,
- const uint8_t aRole)
-{
- MOZ_ASSERT(NS_IsMainThread());
- if (aRole != nsIPresentationService::ROLE_CONTROLLER) {
- MOZ_ASSERT(false, "This is allowed only to be called at controller side.");
- return;
- }
-
- if (!aConnection) {
- return;
- }
-
- WeakPtr<PresentationConnection> connection = aConnection;
- if (mConnections.Contains(connection)) {
- return;
- }
-
- mConnections.AppendElement(connection);
-}
-
-void
-ControllerConnectionCollection::RemoveConnection(
- PresentationConnection* aConnection,
- const uint8_t aRole)
-{
- MOZ_ASSERT(NS_IsMainThread());
- if (aRole != nsIPresentationService::ROLE_CONTROLLER) {
- MOZ_ASSERT(false, "This is allowed only to be called at controller side.");
- return;
- }
-
- if (!aConnection) {
- return;
- }
-
- WeakPtr<PresentationConnection> connection = aConnection;
- mConnections.RemoveElement(connection);
-}
-
-already_AddRefed<PresentationConnection>
-ControllerConnectionCollection::FindConnection(
- uint64_t aWindowId,
- const nsAString& aId,
- const uint8_t aRole)
-{
- MOZ_ASSERT(NS_IsMainThread());
- if (aRole != nsIPresentationService::ROLE_CONTROLLER) {
- MOZ_ASSERT(false, "This is allowed only to be called at controller side.");
- return nullptr;
- }
-
- // Loop backwards to allow removing elements in the loop.
- for (int i = mConnections.Length() - 1; i >= 0; --i) {
- WeakPtr<PresentationConnection> connection = mConnections[i];
- if (!connection) {
- // The connection was destroyed. Remove it from the list.
- mConnections.RemoveElementAt(i);
- continue;
- }
-
- if (connection->Equals(aWindowId, aId)) {
- RefPtr<PresentationConnection> matchedConnection = connection.get();
- return matchedConnection.forget();
- }
- }
-
- return nullptr;
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/ControllerConnectionCollection.h b/dom/presentation/ControllerConnectionCollection.h
deleted file mode 100644
index c5300fe30..000000000
--- a/dom/presentation/ControllerConnectionCollection.h
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_ControllerConnectionCollection_h
-#define mozilla_dom_ControllerConnectionCollection_h
-
-#include "mozilla/StaticPtr.h"
-#include "mozilla/WeakPtr.h"
-#include "nsString.h"
-#include "nsTArray.h"
-
-namespace mozilla {
-namespace dom {
-
-class PresentationConnection;
-
-class ControllerConnectionCollection final
-{
-public:
- static ControllerConnectionCollection* GetSingleton();
-
- void AddConnection(PresentationConnection* aConnection,
- const uint8_t aRole);
-
- void RemoveConnection(PresentationConnection* aConnection,
- const uint8_t aRole);
-
- already_AddRefed<PresentationConnection>
- FindConnection(uint64_t aWindowId,
- const nsAString& aId,
- const uint8_t aRole);
-
-private:
- friend class StaticAutoPtr<ControllerConnectionCollection>;
-
- ControllerConnectionCollection();
- virtual ~ControllerConnectionCollection();
-
- static StaticAutoPtr<ControllerConnectionCollection> sSingleton;
- nsTArray<WeakPtr<PresentationConnection>> mConnections;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_ControllerConnectionCollection_h
diff --git a/dom/presentation/DCPresentationChannelDescription.cpp b/dom/presentation/DCPresentationChannelDescription.cpp
deleted file mode 100644
index a904dfe3f..000000000
--- a/dom/presentation/DCPresentationChannelDescription.cpp
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "DCPresentationChannelDescription.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_ISUPPORTS(DCPresentationChannelDescription,
- nsIPresentationChannelDescription)
-
-NS_IMETHODIMP
-DCPresentationChannelDescription::GetType(uint8_t* aRetVal)
-{
- if (NS_WARN_IF(!aRetVal)) {
- return NS_ERROR_INVALID_POINTER;
- }
-
- *aRetVal = nsIPresentationChannelDescription::TYPE_DATACHANNEL;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DCPresentationChannelDescription::GetTcpAddress(nsIArray** aRetVal)
-{
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-DCPresentationChannelDescription::GetTcpPort(uint16_t* aRetVal)
-{
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-DCPresentationChannelDescription::GetDataChannelSDP(nsAString& aDataChannelSDP)
-{
- aDataChannelSDP = mSDP;
- return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/DCPresentationChannelDescription.h b/dom/presentation/DCPresentationChannelDescription.h
deleted file mode 100644
index 63a058f9a..000000000
--- a/dom/presentation/DCPresentationChannelDescription.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_DCPresentationChannelDescription_h
-#define mozilla_dom_DCPresentationChannelDescription_h
-
-#include "nsIPresentationControlChannel.h"
-#include "nsString.h"
-
-namespace mozilla {
-namespace dom {
-
-// PresentationChannelDescription for Data Channel
-class DCPresentationChannelDescription final : public nsIPresentationChannelDescription
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONCHANNELDESCRIPTION
-
- explicit DCPresentationChannelDescription(const nsAString& aSDP)
- : mSDP(aSDP)
- {
- }
-
-private:
- virtual ~DCPresentationChannelDescription() = default;
-
- nsString mSDP;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_DCPresentationChannelDescription_h
diff --git a/dom/presentation/Presentation.cpp b/dom/presentation/Presentation.cpp
deleted file mode 100644
index 07ca12f26..000000000
--- a/dom/presentation/Presentation.cpp
+++ /dev/null
@@ -1,182 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "Presentation.h"
-
-#include <ctype.h>
-
-#include "mozilla/dom/PresentationBinding.h"
-#include "mozilla/dom/Promise.h"
-#include "nsContentUtils.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsIDocShell.h"
-#include "nsIPresentationService.h"
-#include "nsIScriptSecurityManager.h"
-#include "nsJSUtils.h"
-#include "nsNetUtil.h"
-#include "nsPIDOMWindow.h"
-#include "nsSandboxFlags.h"
-#include "nsServiceManagerUtils.h"
-#include "PresentationReceiver.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Presentation,
- mWindow,
- mDefaultRequest, mReceiver)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(Presentation)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(Presentation)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(Presentation)
- NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
- NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-/* static */ already_AddRefed<Presentation>
-Presentation::Create(nsPIDOMWindowInner* aWindow)
-{
- RefPtr<Presentation> presentation = new Presentation(aWindow);
- return presentation.forget();
-}
-
-Presentation::Presentation(nsPIDOMWindowInner* aWindow)
- : mWindow(aWindow)
-{
-}
-
-Presentation::~Presentation()
-{
-}
-
-/* virtual */ JSObject*
-Presentation::WrapObject(JSContext* aCx,
- JS::Handle<JSObject*> aGivenProto)
-{
- return PresentationBinding::Wrap(aCx, this, aGivenProto);
-}
-
-void
-Presentation::SetDefaultRequest(PresentationRequest* aRequest)
-{
- nsCOMPtr<nsIDocument> doc = mWindow ? mWindow->GetExtantDoc() : nullptr;
- if (NS_WARN_IF(!doc)) {
- return;
- }
-
- if (doc->GetSandboxFlags() & SANDBOXED_PRESENTATION) {
- return;
- }
-
- mDefaultRequest = aRequest;
-}
-
-already_AddRefed<PresentationRequest>
-Presentation::GetDefaultRequest() const
-{
- RefPtr<PresentationRequest> request = mDefaultRequest;
- return request.forget();
-}
-
-already_AddRefed<PresentationReceiver>
-Presentation::GetReceiver()
-{
- // return the same receiver if already created
- if (mReceiver) {
- RefPtr<PresentationReceiver> receiver = mReceiver;
- return receiver.forget();
- }
-
- if (!HasReceiverSupport() || !IsInPresentedContent()) {
- return nullptr;
- }
-
- mReceiver = PresentationReceiver::Create(mWindow);
- if (NS_WARN_IF(!mReceiver)) {
- MOZ_ASSERT(mReceiver);
- return nullptr;
- }
-
- RefPtr<PresentationReceiver> receiver = mReceiver;
- return receiver.forget();
-}
-
-void
-Presentation::SetStartSessionUnsettled(bool aIsUnsettled)
-{
- mStartSessionUnsettled = aIsUnsettled;
-}
-
-bool
-Presentation::IsStartSessionUnsettled() const
-{
- return mStartSessionUnsettled;
-}
-
-bool
-Presentation::HasReceiverSupport() const
-{
- if (!mWindow) {
- return false;
- }
-
- // Grant access to browser receiving pages and their same-origin iframes. (App
- // pages should be controlled by "presentation" permission in app manifests.)
- nsCOMPtr<nsIDocShell> docShell = mWindow->GetDocShell();
- if (!docShell) {
- return false;
- }
-
- if (!Preferences::GetBool("dom.presentation.testing.simulate-receiver") &&
- !docShell->GetIsInMozBrowserOrApp() &&
- !docShell->GetIsTopLevelContentDocShell()) {
- return false;
- }
-
- nsAutoString presentationURL;
- nsContentUtils::GetPresentationURL(docShell, presentationURL);
-
- if (presentationURL.IsEmpty()) {
- return false;
- }
-
- nsCOMPtr<nsIScriptSecurityManager> securityManager =
- nsContentUtils::GetSecurityManager();
- if (!securityManager) {
- return false;
- }
-
- nsCOMPtr<nsIURI> presentationURI;
- nsresult rv = NS_NewURI(getter_AddRefs(presentationURI), presentationURL);
- if (NS_FAILED(rv)) {
- return false;
- }
-
- nsCOMPtr<nsIURI> docURI = mWindow->GetDocumentURI();
- return NS_SUCCEEDED(securityManager->CheckSameOriginURI(presentationURI,
- docURI,
- false));
-}
-
-bool
-Presentation::IsInPresentedContent() const
-{
- if (!mWindow) {
- return false;
- }
-
- nsCOMPtr<nsIDocShell> docShell = mWindow->GetDocShell();
- MOZ_ASSERT(docShell);
-
- nsAutoString presentationURL;
- nsContentUtils::GetPresentationURL(docShell, presentationURL);
-
- return !presentationURL.IsEmpty();
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/Presentation.h b/dom/presentation/Presentation.h
deleted file mode 100644
index 08d0003b3..000000000
--- a/dom/presentation/Presentation.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_Presentation_h
-#define mozilla_dom_Presentation_h
-
-#include "nsCOMPtr.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsISupportsImpl.h"
-#include "nsWrapperCache.h"
-
-class nsPIDOMWindowInner;
-
-namespace mozilla {
-namespace dom {
-
-class Promise;
-class PresentationReceiver;
-class PresentationRequest;
-
-class Presentation final : public nsISupports
- , public nsWrapperCache
-{
-public:
- NS_DECL_CYCLE_COLLECTING_ISUPPORTS
- NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(Presentation)
-
- static already_AddRefed<Presentation> Create(nsPIDOMWindowInner* aWindow);
-
- virtual JSObject* WrapObject(JSContext* aCx,
- JS::Handle<JSObject*> aGivenProto) override;
-
- nsPIDOMWindowInner* GetParentObject() const
- {
- return mWindow;
- }
-
- // WebIDL (public APIs)
- void SetDefaultRequest(PresentationRequest* aRequest);
-
- already_AddRefed<PresentationRequest> GetDefaultRequest() const;
-
- already_AddRefed<PresentationReceiver> GetReceiver();
-
- // For bookkeeping unsettled start session request
- void SetStartSessionUnsettled(bool aIsUnsettled);
- bool IsStartSessionUnsettled() const;
-
-private:
- explicit Presentation(nsPIDOMWindowInner* aWindow);
-
- virtual ~Presentation();
-
- bool HasReceiverSupport() const;
-
- bool IsInPresentedContent() const;
-
- RefPtr<PresentationRequest> mDefaultRequest;
- RefPtr<PresentationReceiver> mReceiver;
- nsCOMPtr<nsPIDOMWindowInner> mWindow;
- bool mStartSessionUnsettled = false;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_Presentation_h
diff --git a/dom/presentation/PresentationAvailability.cpp b/dom/presentation/PresentationAvailability.cpp
deleted file mode 100644
index 93f27dfbf..000000000
--- a/dom/presentation/PresentationAvailability.cpp
+++ /dev/null
@@ -1,206 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "PresentationAvailability.h"
-
-#include "mozilla/dom/PresentationAvailabilityBinding.h"
-#include "mozilla/dom/Promise.h"
-#include "mozilla/Unused.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsIPresentationDeviceManager.h"
-#include "nsIPresentationService.h"
-#include "nsServiceManagerUtils.h"
-#include "PresentationLog.h"
-
-using namespace mozilla;
-using namespace mozilla::dom;
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(PresentationAvailability)
-
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(PresentationAvailability, DOMEventTargetHelper)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPromises)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(PresentationAvailability, DOMEventTargetHelper)
- NS_IMPL_CYCLE_COLLECTION_UNLINK(mPromises);
- tmp->Shutdown();
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-
-NS_IMPL_ADDREF_INHERITED(PresentationAvailability, DOMEventTargetHelper)
-NS_IMPL_RELEASE_INHERITED(PresentationAvailability, DOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(PresentationAvailability)
- NS_INTERFACE_MAP_ENTRY(nsIPresentationAvailabilityListener)
-NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
-
-/* static */ already_AddRefed<PresentationAvailability>
-PresentationAvailability::Create(nsPIDOMWindowInner* aWindow,
- const nsTArray<nsString>& aUrls,
- RefPtr<Promise>& aPromise)
-{
- RefPtr<PresentationAvailability> availability =
- new PresentationAvailability(aWindow, aUrls);
- return NS_WARN_IF(!availability->Init(aPromise)) ? nullptr
- : availability.forget();
-}
-
-PresentationAvailability::PresentationAvailability(nsPIDOMWindowInner* aWindow,
- const nsTArray<nsString>& aUrls)
- : DOMEventTargetHelper(aWindow)
- , mIsAvailable(false)
- , mUrls(aUrls)
-{
- for (uint32_t i = 0; i < mUrls.Length(); ++i) {
- mAvailabilityOfUrl.AppendElement(false);
- }
-}
-
-PresentationAvailability::~PresentationAvailability()
-{
- Shutdown();
-}
-
-bool
-PresentationAvailability::Init(RefPtr<Promise>& aPromise)
-{
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return false;
- }
-
- nsresult rv = service->RegisterAvailabilityListener(mUrls, this);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- // If the user agent is unable to monitor available device,
- // Resolve promise with |value| set to false.
- mIsAvailable = false;
- aPromise->MaybeResolve(this);
- return true;
- }
-
- EnqueuePromise(aPromise);
-
- AvailabilityCollection* collection = AvailabilityCollection::GetSingleton();
- if (collection) {
- collection->Add(this);
- }
-
- return true;
-}
-
-void PresentationAvailability::Shutdown()
-{
- AvailabilityCollection* collection = AvailabilityCollection::GetSingleton();
- if (collection ) {
- collection->Remove(this);
- }
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return;
- }
-
- Unused <<
- NS_WARN_IF(NS_FAILED(service->UnregisterAvailabilityListener(mUrls,
- this)));
-}
-
-/* virtual */ void
-PresentationAvailability::DisconnectFromOwner()
-{
- Shutdown();
- DOMEventTargetHelper::DisconnectFromOwner();
-}
-
-/* virtual */ JSObject*
-PresentationAvailability::WrapObject(JSContext* aCx,
- JS::Handle<JSObject*> aGivenProto)
-{
- return PresentationAvailabilityBinding::Wrap(aCx, this, aGivenProto);
-}
-
-bool
-PresentationAvailability::Equals(const uint64_t aWindowID,
- const nsTArray<nsString>& aUrls) const
-{
- if (GetOwner() && GetOwner()->WindowID() == aWindowID &&
- mUrls.Length() == aUrls.Length()) {
- for (const auto& url : aUrls) {
- if (!mUrls.Contains(url)) {
- return false;
- }
- }
- return true;
- }
-
- return false;
-}
-
-bool
-PresentationAvailability::IsCachedValueReady()
-{
- // All pending promises will be solved when cached value is ready and
- // no promise should be enqueued afterward.
- return mPromises.IsEmpty();
-}
-
-void
-PresentationAvailability::EnqueuePromise(RefPtr<Promise>& aPromise)
-{
- mPromises.AppendElement(aPromise);
-}
-
-bool
-PresentationAvailability::Value() const
-{
- return mIsAvailable;
-}
-
-NS_IMETHODIMP
-PresentationAvailability::NotifyAvailableChange(const nsTArray<nsString>& aAvailabilityUrls,
- bool aIsAvailable)
-{
- bool available = false;
- for (uint32_t i = 0; i < mUrls.Length(); ++i) {
- if (aAvailabilityUrls.Contains(mUrls[i])) {
- mAvailabilityOfUrl[i] = aIsAvailable;
- }
- available |= mAvailabilityOfUrl[i];
- }
-
- return NS_DispatchToCurrentThread(NewRunnableMethod
- <bool>(this,
- &PresentationAvailability::UpdateAvailabilityAndDispatchEvent,
- available));
-}
-
-void
-PresentationAvailability::UpdateAvailabilityAndDispatchEvent(bool aIsAvailable)
-{
- PRES_DEBUG("%s\n", __func__);
- bool isChanged = (aIsAvailable != mIsAvailable);
-
- mIsAvailable = aIsAvailable;
-
- if (!mPromises.IsEmpty()) {
- // Use the first availability change notification to resolve promise.
- do {
- nsTArray<RefPtr<Promise>> promises = Move(mPromises);
- for (auto& promise : promises) {
- promise->MaybeResolve(this);
- }
- // more promises may have been added to mPromises, at least in theory
- } while (!mPromises.IsEmpty());
-
- return;
- }
-
- if (isChanged) {
- Unused <<
- NS_WARN_IF(NS_FAILED(DispatchTrustedEvent(NS_LITERAL_STRING("change"))));
- }
-}
diff --git a/dom/presentation/PresentationAvailability.h b/dom/presentation/PresentationAvailability.h
deleted file mode 100644
index edfae2c02..000000000
--- a/dom/presentation/PresentationAvailability.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationAvailability_h
-#define mozilla_dom_PresentationAvailability_h
-
-#include "mozilla/DOMEventTargetHelper.h"
-#include "nsIPresentationListener.h"
-#include "nsTArray.h"
-
-namespace mozilla {
-namespace dom {
-
-class Promise;
-
-class PresentationAvailability final : public DOMEventTargetHelper
- , public nsIPresentationAvailabilityListener
- , public SupportsWeakPtr<PresentationAvailability>
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(PresentationAvailability,
- DOMEventTargetHelper)
- NS_DECL_NSIPRESENTATIONAVAILABILITYLISTENER
- MOZ_DECLARE_WEAKREFERENCE_TYPENAME(PresentationAvailability)
-
- static already_AddRefed<PresentationAvailability>
- Create(nsPIDOMWindowInner* aWindow,
- const nsTArray<nsString>& aUrls,
- RefPtr<Promise>& aPromise);
-
- virtual void DisconnectFromOwner() override;
-
- virtual JSObject* WrapObject(JSContext* aCx,
- JS::Handle<JSObject*> aGivenProto) override;
-
- bool Equals(const uint64_t aWindowID, const nsTArray<nsString>& aUrls) const;
-
- bool IsCachedValueReady();
-
- void EnqueuePromise(RefPtr<Promise>& aPromise);
-
- // WebIDL (public APIs)
- bool Value() const;
-
- IMPL_EVENT_HANDLER(change);
-
-private:
- explicit PresentationAvailability(nsPIDOMWindowInner* aWindow,
- const nsTArray<nsString>& aUrls);
-
- virtual ~PresentationAvailability();
-
- bool Init(RefPtr<Promise>& aPromise);
-
- void Shutdown();
-
- void UpdateAvailabilityAndDispatchEvent(bool aIsAvailable);
-
- bool mIsAvailable;
-
- nsTArray<RefPtr<Promise>> mPromises;
-
- nsTArray<nsString> mUrls;
- nsTArray<bool> mAvailabilityOfUrl;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationAvailability_h
diff --git a/dom/presentation/PresentationCallbacks.cpp b/dom/presentation/PresentationCallbacks.cpp
deleted file mode 100644
index fd0ffee31..000000000
--- a/dom/presentation/PresentationCallbacks.cpp
+++ /dev/null
@@ -1,282 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/Promise.h"
-#include "nsIDocShell.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "nsIPresentationService.h"
-#include "nsIWebProgress.h"
-#include "nsServiceManagerUtils.h"
-#include "nsThreadUtils.h"
-#include "PresentationCallbacks.h"
-#include "PresentationRequest.h"
-#include "PresentationConnection.h"
-#include "PresentationTransportBuilderConstructor.h"
-
-using namespace mozilla;
-using namespace mozilla::dom;
-
-/*
- * Implementation of PresentationRequesterCallback
- */
-
-NS_IMPL_ISUPPORTS(PresentationRequesterCallback, nsIPresentationServiceCallback)
-
-PresentationRequesterCallback::PresentationRequesterCallback(PresentationRequest* aRequest,
- const nsAString& aSessionId,
- Promise* aPromise)
- : mRequest(aRequest)
- , mSessionId(aSessionId)
- , mPromise(aPromise)
-{
- MOZ_ASSERT(mRequest);
- MOZ_ASSERT(mPromise);
- MOZ_ASSERT(!mSessionId.IsEmpty());
-}
-
-PresentationRequesterCallback::~PresentationRequesterCallback()
-{
-}
-
-// nsIPresentationServiceCallback
-NS_IMETHODIMP
-PresentationRequesterCallback::NotifySuccess(const nsAString& aUrl)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (aUrl.IsEmpty()) {
- return NotifyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- RefPtr<PresentationConnection> connection =
- PresentationConnection::Create(mRequest->GetOwner(), mSessionId, aUrl,
- nsIPresentationService::ROLE_CONTROLLER);
- if (NS_WARN_IF(!connection)) {
- return NotifyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- mRequest->NotifyPromiseSettled();
- mPromise->MaybeResolve(connection);
-
- return mRequest->DispatchConnectionAvailableEvent(connection);
-}
-
-NS_IMETHODIMP
-PresentationRequesterCallback::NotifyError(nsresult aError)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- mRequest->NotifyPromiseSettled();
- mPromise->MaybeReject(aError);
- return NS_OK;
-}
-
-/*
- * Implementation of PresentationRequesterCallback
- */
-
-NS_IMPL_ISUPPORTS_INHERITED0(PresentationReconnectCallback,
- PresentationRequesterCallback)
-
-PresentationReconnectCallback::PresentationReconnectCallback(
- PresentationRequest* aRequest,
- const nsAString& aSessionId,
- Promise* aPromise,
- PresentationConnection* aConnection)
- : PresentationRequesterCallback(aRequest, aSessionId, aPromise)
- , mConnection(aConnection)
-{
-}
-
-PresentationReconnectCallback::~PresentationReconnectCallback()
-{
-}
-
-NS_IMETHODIMP
-PresentationReconnectCallback::NotifySuccess(const nsAString& aUrl)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- nsresult rv = NS_OK;
- // We found a matched connection with the same window ID, URL, and
- // the session ID. Resolve the promise with this connection and dispatch
- // the event.
- if (mConnection) {
- mConnection->NotifyStateChange(
- mSessionId,
- nsIPresentationSessionListener::STATE_CONNECTING,
- NS_OK);
- mPromise->MaybeResolve(mConnection);
- rv = mRequest->DispatchConnectionAvailableEvent(mConnection);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- } else {
- // Use |PresentationRequesterCallback::NotifySuccess| to create a new
- // connection since we don't find one that can be reused.
- rv = PresentationRequesterCallback::NotifySuccess(aUrl);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- rv = service->UpdateWindowIdBySessionId(mSessionId,
- nsIPresentationService::ROLE_CONTROLLER,
- mRequest->GetOwner()->WindowID());
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- }
-
- nsString sessionId = nsString(mSessionId);
- return NS_DispatchToMainThread(
- NS_NewRunnableFunction([sessionId, service]() -> void {
- service->BuildTransport(sessionId,
- nsIPresentationService::ROLE_CONTROLLER);
- }));
-}
-
-NS_IMETHODIMP
-PresentationReconnectCallback::NotifyError(nsresult aError)
-{
- if (mConnection) {
- mConnection->NotifyStateChange(
- mSessionId,
- nsIPresentationSessionListener::STATE_CLOSED,
- aError);
- }
- return PresentationRequesterCallback::NotifyError(aError);
-}
-
-NS_IMPL_ISUPPORTS(PresentationResponderLoadingCallback,
- nsIWebProgressListener,
- nsISupportsWeakReference)
-
-PresentationResponderLoadingCallback::PresentationResponderLoadingCallback(const nsAString& aSessionId)
- : mSessionId(aSessionId)
-{
-}
-
-PresentationResponderLoadingCallback::~PresentationResponderLoadingCallback()
-{
- if (mProgress) {
- mProgress->RemoveProgressListener(this);
- mProgress = nullptr;
- }
-}
-
-nsresult
-PresentationResponderLoadingCallback::Init(nsIDocShell* aDocShell)
-{
- mProgress = do_GetInterface(aDocShell);
- if (NS_WARN_IF(!mProgress)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- uint32_t busyFlags = nsIDocShell::BUSY_FLAGS_NONE;
- nsresult rv = aDocShell->GetBusyFlags(&busyFlags);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- if ((busyFlags == nsIDocShell::BUSY_FLAGS_NONE) ||
- (busyFlags & nsIDocShell::BUSY_FLAGS_PAGE_LOADING)) {
- // The docshell has finished loading or is receiving data (|STATE_TRANSFERRING|
- // has already been fired), so the page is ready for presentation use.
- return NotifyReceiverReady(/* isLoading = */ true);
- }
-
- // Start to listen to document state change event |STATE_TRANSFERRING|.
- return mProgress->AddProgressListener(this, nsIWebProgress::NOTIFY_STATE_DOCUMENT);
-}
-
-nsresult
-PresentationResponderLoadingCallback::NotifyReceiverReady(bool aIsLoading)
-{
- nsCOMPtr<nsPIDOMWindowOuter> window = do_GetInterface(mProgress);
- if (NS_WARN_IF(!window || !window->GetCurrentInnerWindow())) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- uint64_t windowId = window->GetCurrentInnerWindow()->WindowID();
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- nsCOMPtr<nsIPresentationTransportBuilderConstructor> constructor =
- PresentationTransportBuilderConstructor::Create();
- return service->NotifyReceiverReady(mSessionId,
- windowId,aIsLoading,
- constructor);
-}
-
-// nsIWebProgressListener
-NS_IMETHODIMP
-PresentationResponderLoadingCallback::OnStateChange(nsIWebProgress* aWebProgress,
- nsIRequest* aRequest,
- uint32_t aStateFlags,
- nsresult aStatus)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (aStateFlags & (nsIWebProgressListener::STATE_TRANSFERRING |
- nsIWebProgressListener::STATE_STOP)) {
- mProgress->RemoveProgressListener(this);
-
- bool isLoading = aStateFlags & nsIWebProgressListener::STATE_TRANSFERRING;
- return NotifyReceiverReady(isLoading);
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationResponderLoadingCallback::OnProgressChange(nsIWebProgress* aWebProgress,
- nsIRequest* aRequest,
- int32_t aCurSelfProgress,
- int32_t aMaxSelfProgress,
- int32_t aCurTotalProgress,
- int32_t aMaxTotalProgress)
-{
- // Do nothing.
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationResponderLoadingCallback::OnLocationChange(nsIWebProgress* aWebProgress,
- nsIRequest* aRequest,
- nsIURI* aURI,
- uint32_t aFlags)
-{
- // Do nothing.
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationResponderLoadingCallback::OnStatusChange(nsIWebProgress* aWebProgress,
- nsIRequest* aRequest,
- nsresult aStatus,
- const char16_t* aMessage)
-{
- // Do nothing.
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationResponderLoadingCallback::OnSecurityChange(nsIWebProgress* aWebProgress,
- nsIRequest* aRequest,
- uint32_t state)
-{
- // Do nothing.
- return NS_OK;
-}
diff --git a/dom/presentation/PresentationCallbacks.h b/dom/presentation/PresentationCallbacks.h
deleted file mode 100644
index e493b0510..000000000
--- a/dom/presentation/PresentationCallbacks.h
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationCallbacks_h
-#define mozilla_dom_PresentationCallbacks_h
-
-#include "mozilla/RefPtr.h"
-#include "nsCOMPtr.h"
-#include "nsIPresentationService.h"
-#include "nsIWebProgressListener.h"
-#include "nsString.h"
-#include "nsWeakReference.h"
-
-class nsIDocShell;
-class nsIWebProgress;
-
-namespace mozilla {
-namespace dom {
-
-class PresentationConnection;
-class PresentationRequest;
-class Promise;
-
-class PresentationRequesterCallback : public nsIPresentationServiceCallback
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONSERVICECALLBACK
-
- PresentationRequesterCallback(PresentationRequest* aRequest,
- const nsAString& aSessionId,
- Promise* aPromise);
-
-protected:
- virtual ~PresentationRequesterCallback();
-
- RefPtr<PresentationRequest> mRequest;
- nsString mSessionId;
- RefPtr<Promise> mPromise;
-};
-
-class PresentationReconnectCallback final : public PresentationRequesterCallback
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_NSIPRESENTATIONSERVICECALLBACK
-
- PresentationReconnectCallback(PresentationRequest* aRequest,
- const nsAString& aSessionId,
- Promise* aPromise,
- PresentationConnection* aConnection);
-
-private:
- virtual ~PresentationReconnectCallback();
-
- RefPtr<PresentationConnection> mConnection;
-};
-
-class PresentationResponderLoadingCallback final : public nsIWebProgressListener
- , public nsSupportsWeakReference
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIWEBPROGRESSLISTENER
-
- explicit PresentationResponderLoadingCallback(const nsAString& aSessionId);
-
- nsresult Init(nsIDocShell* aDocShell);
-
-private:
- ~PresentationResponderLoadingCallback();
-
- nsresult NotifyReceiverReady(bool aIsLoading);
-
- nsString mSessionId;
- nsCOMPtr<nsIWebProgress> mProgress;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationCallbacks_h
diff --git a/dom/presentation/PresentationConnection.cpp b/dom/presentation/PresentationConnection.cpp
deleted file mode 100644
index e9c4a71ca..000000000
--- a/dom/presentation/PresentationConnection.cpp
+++ /dev/null
@@ -1,763 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "PresentationConnection.h"
-
-#include "ControllerConnectionCollection.h"
-#include "mozilla/AsyncEventDispatcher.h"
-#include "mozilla/dom/DOMException.h"
-#include "mozilla/dom/File.h"
-#include "mozilla/dom/MessageEvent.h"
-#include "mozilla/dom/MessageEventBinding.h"
-#include "mozilla/dom/PresentationConnectionCloseEvent.h"
-#include "mozilla/ErrorNames.h"
-#include "mozilla/DebugOnly.h"
-#include "nsContentUtils.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsIPresentationService.h"
-#include "nsServiceManagerUtils.h"
-#include "nsStringStream.h"
-#include "PresentationConnectionList.h"
-#include "PresentationLog.h"
-
-using namespace mozilla;
-using namespace mozilla::dom;
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(PresentationConnection)
-
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN_INHERITED(PresentationConnection, DOMEventTargetHelper)
- NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mOwningConnectionList)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN_INHERITED(PresentationConnection, DOMEventTargetHelper)
- tmp->Shutdown();
- NS_IMPL_CYCLE_COLLECTION_UNLINK(mOwningConnectionList)
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-
-NS_IMPL_ADDREF_INHERITED(PresentationConnection, DOMEventTargetHelper)
-NS_IMPL_RELEASE_INHERITED(PresentationConnection, DOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(PresentationConnection)
- NS_INTERFACE_MAP_ENTRY(nsIPresentationSessionListener)
- NS_INTERFACE_MAP_ENTRY(nsIRequest)
-NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
-
-PresentationConnection::PresentationConnection(nsPIDOMWindowInner* aWindow,
- const nsAString& aId,
- const nsAString& aUrl,
- const uint8_t aRole,
- PresentationConnectionList* aList)
- : DOMEventTargetHelper(aWindow)
- , mId(aId)
- , mUrl(aUrl)
- , mState(PresentationConnectionState::Connecting)
- , mOwningConnectionList(aList)
- , mBinaryType(PresentationConnectionBinaryType::Arraybuffer)
-{
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
- mRole = aRole;
-}
-
-/* virtual */ PresentationConnection::~PresentationConnection()
-{
-}
-
-/* static */ already_AddRefed<PresentationConnection>
-PresentationConnection::Create(nsPIDOMWindowInner* aWindow,
- const nsAString& aId,
- const nsAString& aUrl,
- const uint8_t aRole,
- PresentationConnectionList* aList)
-{
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
- RefPtr<PresentationConnection> connection =
- new PresentationConnection(aWindow, aId, aUrl, aRole, aList);
- if (NS_WARN_IF(!connection->Init())) {
- return nullptr;
- }
-
- if (aRole == nsIPresentationService::ROLE_CONTROLLER) {
- ControllerConnectionCollection::GetSingleton()->AddConnection(connection,
- aRole);
- }
-
- return connection.forget();
-}
-
-bool
-PresentationConnection::Init()
-{
- if (NS_WARN_IF(mId.IsEmpty())) {
- return false;
- }
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if(NS_WARN_IF(!service)) {
- return false;
- }
-
- nsresult rv = service->RegisterSessionListener(mId, mRole, this);
- if(NS_WARN_IF(NS_FAILED(rv))) {
- return false;
- }
-
- rv = AddIntoLoadGroup();
- if(NS_WARN_IF(NS_FAILED(rv))) {
- return false;
- }
-
- return true;
-}
-
-void
-PresentationConnection::Shutdown()
-{
- PRES_DEBUG("connection shutdown:id[%s], role[%d]\n",
- NS_ConvertUTF16toUTF8(mId).get(), mRole);
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return;
- }
-
- DebugOnly<nsresult> rv = service->UnregisterSessionListener(mId, mRole);
- NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "UnregisterSessionListener failed");
-
- DebugOnly<nsresult> rv2 = RemoveFromLoadGroup();
- NS_WARNING_ASSERTION(NS_SUCCEEDED(rv2), "RemoveFromLoadGroup failed");
-
- if (mRole == nsIPresentationService::ROLE_CONTROLLER) {
- ControllerConnectionCollection::GetSingleton()->RemoveConnection(this,
- mRole);
- }
-}
-
-/* virtual */ void
-PresentationConnection::DisconnectFromOwner()
-{
- Unused << NS_WARN_IF(NS_FAILED(ProcessConnectionWentAway()));
- DOMEventTargetHelper::DisconnectFromOwner();
-}
-
-/* virtual */ JSObject*
-PresentationConnection::WrapObject(JSContext* aCx,
- JS::Handle<JSObject*> aGivenProto)
-{
- return PresentationConnectionBinding::Wrap(aCx, this, aGivenProto);
-}
-
-void
-PresentationConnection::GetId(nsAString& aId) const
-{
- aId = mId;
-}
-
-void
-PresentationConnection::GetUrl(nsAString& aUrl) const
-{
- aUrl = mUrl;
-}
-
-PresentationConnectionState
-PresentationConnection::State() const
-{
- return mState;
-}
-
-PresentationConnectionBinaryType
-PresentationConnection::BinaryType() const
-{
- return mBinaryType;
-}
-
-void
-PresentationConnection::SetBinaryType(PresentationConnectionBinaryType aType)
-{
- mBinaryType = aType;
-}
-
-void
-PresentationConnection::Send(const nsAString& aData,
- ErrorResult& aRv)
-{
- // Sending is not allowed if the session is not connected.
- if (NS_WARN_IF(mState != PresentationConnectionState::Connected)) {
- aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
- return;
- }
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if(NS_WARN_IF(!service)) {
- AsyncCloseConnectionWithErrorMsg(
- NS_LITERAL_STRING("Unable to send message due to an internal error."));
- return;
- }
-
- nsresult rv = service->SendSessionMessage(mId, mRole, aData);
- if(NS_WARN_IF(NS_FAILED(rv))) {
- const uint32_t kMaxMessageLength = 256;
- nsAutoString data(Substring(aData, 0, kMaxMessageLength));
-
- AsyncCloseConnectionWithErrorMsg(
- NS_LITERAL_STRING("Unable to send message: \"") + data +
- NS_LITERAL_STRING("\""));
- }
-}
-
-void
-PresentationConnection::Send(Blob& aData,
- ErrorResult& aRv)
-{
- if (NS_WARN_IF(mState != PresentationConnectionState::Connected)) {
- aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
- return;
- }
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if(NS_WARN_IF(!service)) {
- AsyncCloseConnectionWithErrorMsg(
- NS_LITERAL_STRING("Unable to send message due to an internal error."));
- return;
- }
-
- nsresult rv = service->SendSessionBlob(mId, mRole, &aData);
- if(NS_WARN_IF(NS_FAILED(rv))) {
- AsyncCloseConnectionWithErrorMsg(
- NS_LITERAL_STRING("Unable to send binary message for Blob message."));
- }
-}
-
-void
-PresentationConnection::Send(const ArrayBuffer& aData,
- ErrorResult& aRv)
-{
- if (NS_WARN_IF(mState != PresentationConnectionState::Connected)) {
- aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
- return;
- }
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if(NS_WARN_IF(!service)) {
- AsyncCloseConnectionWithErrorMsg(
- NS_LITERAL_STRING("Unable to send message due to an internal error."));
- return;
- }
-
- aData.ComputeLengthAndData();
-
- static_assert(sizeof(*aData.Data()) == 1, "byte-sized data required");
-
- uint32_t length = aData.Length();
- char* data = reinterpret_cast<char*>(aData.Data());
- nsDependentCSubstring msgString(data, length);
-
- nsresult rv = service->SendSessionBinaryMsg(mId, mRole, msgString);
- if(NS_WARN_IF(NS_FAILED(rv))) {
- AsyncCloseConnectionWithErrorMsg(
- NS_LITERAL_STRING("Unable to send binary message for ArrayBuffer message."));
- }
-}
-
-void
-PresentationConnection::Send(const ArrayBufferView& aData,
- ErrorResult& aRv)
-{
- if (NS_WARN_IF(mState != PresentationConnectionState::Connected)) {
- aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
- return;
- }
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if(NS_WARN_IF(!service)) {
- AsyncCloseConnectionWithErrorMsg(
- NS_LITERAL_STRING("Unable to send message due to an internal error."));
- return;
- }
-
- aData.ComputeLengthAndData();
-
- static_assert(sizeof(*aData.Data()) == 1, "byte-sized data required");
-
- uint32_t length = aData.Length();
- char* data = reinterpret_cast<char*>(aData.Data());
- nsDependentCSubstring msgString(data, length);
-
- nsresult rv = service->SendSessionBinaryMsg(mId, mRole, msgString);
- if(NS_WARN_IF(NS_FAILED(rv))) {
- AsyncCloseConnectionWithErrorMsg(
- NS_LITERAL_STRING("Unable to send binary message for ArrayBufferView message."));
- }
-}
-
-void
-PresentationConnection::Close(ErrorResult& aRv)
-{
- // It only works when the state is CONNECTED or CONNECTING.
- if (NS_WARN_IF(mState != PresentationConnectionState::Connected &&
- mState != PresentationConnectionState::Connecting)) {
- return;
- }
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if(NS_WARN_IF(!service)) {
- aRv.Throw(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
-
- Unused << NS_WARN_IF(NS_FAILED(
- service->CloseSession(mId,
- mRole,
- nsIPresentationService::CLOSED_REASON_CLOSED)));
-}
-
-void
-PresentationConnection::Terminate(ErrorResult& aRv)
-{
- // It only works when the state is CONNECTED.
- if (NS_WARN_IF(mState != PresentationConnectionState::Connected)) {
- return;
- }
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if(NS_WARN_IF(!service)) {
- aRv.Throw(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
-
- Unused << NS_WARN_IF(NS_FAILED(service->TerminateSession(mId, mRole)));
-}
-
-bool
-PresentationConnection::Equals(uint64_t aWindowId,
- const nsAString& aId)
-{
- return GetOwner() &&
- aWindowId == GetOwner()->WindowID() &&
- mId.Equals(aId);
-}
-
-NS_IMETHODIMP
-PresentationConnection::NotifyStateChange(const nsAString& aSessionId,
- uint16_t aState,
- nsresult aReason)
-{
- PRES_DEBUG("connection state change:id[%s], state[%x], reason[%x], role[%d]\n",
- NS_ConvertUTF16toUTF8(aSessionId).get(), aState,
- aReason, mRole);
-
- if (!aSessionId.Equals(mId)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- // A terminated connection should always remain in terminated.
- if (mState == PresentationConnectionState::Terminated) {
- return NS_OK;
- }
-
- PresentationConnectionState state;
- switch (aState) {
- case nsIPresentationSessionListener::STATE_CONNECTING:
- state = PresentationConnectionState::Connecting;
- break;
- case nsIPresentationSessionListener::STATE_CONNECTED:
- state = PresentationConnectionState::Connected;
- break;
- case nsIPresentationSessionListener::STATE_CLOSED:
- state = PresentationConnectionState::Closed;
- break;
- case nsIPresentationSessionListener::STATE_TERMINATED:
- state = PresentationConnectionState::Terminated;
- break;
- default:
- NS_WARNING("Unknown presentation session state.");
- return NS_ERROR_INVALID_ARG;
- }
-
- if (mState == state) {
- return NS_OK;
- }
- mState = state;
-
- nsresult rv = ProcessStateChanged(aReason);
- if(NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- if (mOwningConnectionList) {
- mOwningConnectionList->NotifyStateChange(aSessionId, this);
- }
-
- return NS_OK;
-}
-
-nsresult
-PresentationConnection::ProcessStateChanged(nsresult aReason)
-{
- switch (mState) {
- case PresentationConnectionState::Connecting:
- return NS_OK;
- case PresentationConnectionState::Connected: {
- RefPtr<AsyncEventDispatcher> asyncDispatcher =
- new AsyncEventDispatcher(this, NS_LITERAL_STRING("connect"), false);
- return asyncDispatcher->PostDOMEvent();
- }
- case PresentationConnectionState::Closed: {
- PresentationConnectionClosedReason reason =
- PresentationConnectionClosedReason::Closed;
-
- nsString errorMsg;
- if (NS_FAILED(aReason)) {
- reason = PresentationConnectionClosedReason::Error;
- nsCString name, message;
-
- // If aReason is not a DOM error, use error name as message.
- if (NS_FAILED(NS_GetNameAndMessageForDOMNSResult(aReason,
- name,
- message))) {
- mozilla::GetErrorName(aReason, message);
- message.InsertLiteral("Internal error: ", 0);
- }
- CopyUTF8toUTF16(message, errorMsg);
- }
-
- Unused <<
- NS_WARN_IF(NS_FAILED(DispatchConnectionCloseEvent(reason, errorMsg)));
-
- return RemoveFromLoadGroup();
- }
- case PresentationConnectionState::Terminated: {
- // Ensure onterminate event is fired.
- RefPtr<AsyncEventDispatcher> asyncDispatcher =
- new AsyncEventDispatcher(this, NS_LITERAL_STRING("terminate"), false);
- Unused << NS_WARN_IF(NS_FAILED(asyncDispatcher->PostDOMEvent()));
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- nsresult rv = service->UnregisterSessionListener(mId, mRole);
- if(NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return RemoveFromLoadGroup();
- }
- default:
- MOZ_CRASH("Unknown presentation session state.");
- return NS_ERROR_INVALID_ARG;
- }
-}
-
-NS_IMETHODIMP
-PresentationConnection::NotifyMessage(const nsAString& aSessionId,
- const nsACString& aData,
- bool aIsBinary)
-{
- PRES_DEBUG("connection %s:id[%s], data[%s], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(aSessionId).get(),
- nsPromiseFlatCString(aData).get(), mRole);
-
- if (!aSessionId.Equals(mId)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- // No message should be expected when the session is not connected.
- if (NS_WARN_IF(mState != PresentationConnectionState::Connected)) {
- return NS_ERROR_DOM_INVALID_STATE_ERR;
- }
-
- if (NS_WARN_IF(NS_FAILED(DoReceiveMessage(aData, aIsBinary)))) {
- AsyncCloseConnectionWithErrorMsg(
- NS_LITERAL_STRING("Unable to receive a message."));
- return NS_ERROR_FAILURE;
- }
-
- return NS_OK;
-}
-
-nsresult
-PresentationConnection::DoReceiveMessage(const nsACString& aData, bool aIsBinary)
-{
- // Transform the data.
- AutoJSAPI jsapi;
- if (!jsapi.Init(GetOwner())) {
- return NS_ERROR_FAILURE;
- }
- JSContext* cx = jsapi.cx();
- JS::Rooted<JS::Value> jsData(cx);
-
- nsresult rv;
- if (aIsBinary) {
- if (mBinaryType == PresentationConnectionBinaryType::Blob) {
- RefPtr<Blob> blob =
- Blob::CreateStringBlob(GetOwner(), aData, EmptyString());
- MOZ_ASSERT(blob);
-
- if (!ToJSValue(cx, blob, &jsData)) {
- return NS_ERROR_FAILURE;
- }
- } else if (mBinaryType == PresentationConnectionBinaryType::Arraybuffer) {
- JS::Rooted<JSObject*> arrayBuf(cx);
- rv = nsContentUtils::CreateArrayBuffer(cx, aData, arrayBuf.address());
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- jsData.setObject(*arrayBuf);
- } else {
- NS_RUNTIMEABORT("Unknown binary type!");
- return NS_ERROR_UNEXPECTED;
- }
- } else {
- NS_ConvertUTF8toUTF16 utf16Data(aData);
- if(NS_WARN_IF(!ToJSValue(cx, utf16Data, &jsData))) {
- return NS_ERROR_FAILURE;
- }
- }
-
- return DispatchMessageEvent(jsData);
-}
-
-nsresult
-PresentationConnection::DispatchConnectionCloseEvent(
- PresentationConnectionClosedReason aReason,
- const nsAString& aMessage,
- bool aDispatchNow)
-{
- if (mState != PresentationConnectionState::Closed) {
- MOZ_ASSERT(false, "The connection state should be closed.");
- return NS_ERROR_FAILURE;
- }
-
- PresentationConnectionCloseEventInit init;
- init.mReason = aReason;
- init.mMessage = aMessage;
-
- RefPtr<PresentationConnectionCloseEvent> closedEvent =
- PresentationConnectionCloseEvent::Constructor(this,
- NS_LITERAL_STRING("close"),
- init);
- closedEvent->SetTrusted(true);
-
- if (aDispatchNow) {
- bool ignore;
- return DOMEventTargetHelper::DispatchEvent(closedEvent, &ignore);
- }
-
- RefPtr<AsyncEventDispatcher> asyncDispatcher =
- new AsyncEventDispatcher(this, static_cast<Event*>(closedEvent));
- return asyncDispatcher->PostDOMEvent();
-}
-
-nsresult
-PresentationConnection::DispatchMessageEvent(JS::Handle<JS::Value> aData)
-{
- nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
- if (NS_WARN_IF(!global)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- // Get the origin.
- nsAutoString origin;
- nsresult rv = nsContentUtils::GetUTFOrigin(global->PrincipalOrNull(), origin);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- RefPtr<MessageEvent> messageEvent = new MessageEvent(this, nullptr, nullptr);
-
- messageEvent->InitMessageEvent(nullptr,
- NS_LITERAL_STRING("message"),
- false, false, aData, origin,
- EmptyString(), nullptr,
- Sequence<OwningNonNull<MessagePort>>());
- messageEvent->SetTrusted(true);
-
- RefPtr<AsyncEventDispatcher> asyncDispatcher =
- new AsyncEventDispatcher(this, static_cast<Event*>(messageEvent));
- return asyncDispatcher->PostDOMEvent();
-}
-
-nsresult
-PresentationConnection::ProcessConnectionWentAway()
-{
- if (mState != PresentationConnectionState::Connected &&
- mState != PresentationConnectionState::Connecting) {
- // If the state is not connected or connecting, do not need to
- // close the session.
- return NS_OK;
- }
-
- mState = PresentationConnectionState::Terminated;
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return service->CloseSession(
- mId, mRole, nsIPresentationService::CLOSED_REASON_WENTAWAY);
-}
-
-NS_IMETHODIMP
-PresentationConnection::GetName(nsACString &aResult)
-{
- aResult.AssignLiteral("about:presentation-connection");
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationConnection::IsPending(bool* aRetval)
-{
- *aRetval = true;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationConnection::GetStatus(nsresult* aStatus)
-{
- *aStatus = NS_OK;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationConnection::Cancel(nsresult aStatus)
-{
- nsCOMPtr<nsIRunnable> event =
- NewRunnableMethod(this, &PresentationConnection::ProcessConnectionWentAway);
- return NS_DispatchToCurrentThread(event);
-}
-NS_IMETHODIMP
-PresentationConnection::Suspend(void)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-NS_IMETHODIMP
-PresentationConnection::Resume(void)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-PresentationConnection::GetLoadGroup(nsILoadGroup** aLoadGroup)
-{
- *aLoadGroup = nullptr;
-
- nsCOMPtr<nsIDocument> doc = GetOwner() ? GetOwner()->GetExtantDoc() : nullptr;
- if (!doc) {
- return NS_ERROR_FAILURE;
- }
-
- *aLoadGroup = doc->GetDocumentLoadGroup().take();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationConnection::SetLoadGroup(nsILoadGroup * aLoadGroup)
-{
- return NS_ERROR_UNEXPECTED;
-}
-
-NS_IMETHODIMP
-PresentationConnection::GetLoadFlags(nsLoadFlags* aLoadFlags)
-{
- *aLoadFlags = nsIRequest::LOAD_BACKGROUND;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationConnection::SetLoadFlags(nsLoadFlags aLoadFlags)
-{
- return NS_OK;
-}
-
-nsresult
-PresentationConnection::AddIntoLoadGroup()
-{
- // Avoid adding to loadgroup multiple times
- if (mWeakLoadGroup) {
- return NS_OK;
- }
-
- nsCOMPtr<nsILoadGroup> loadGroup;
- nsresult rv = GetLoadGroup(getter_AddRefs(loadGroup));
- if(NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- rv = loadGroup->AddRequest(this, nullptr);
- if(NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mWeakLoadGroup = do_GetWeakReference(loadGroup);
- return NS_OK;
-}
-
-nsresult
-PresentationConnection::RemoveFromLoadGroup()
-{
- if (!mWeakLoadGroup) {
- return NS_OK;
- }
-
- nsCOMPtr<nsILoadGroup> loadGroup = do_QueryReferent(mWeakLoadGroup);
- if (loadGroup) {
- mWeakLoadGroup = nullptr;
- return loadGroup->RemoveRequest(this, nullptr, NS_OK);
- }
-
- return NS_OK;
-}
-
-void
-PresentationConnection::AsyncCloseConnectionWithErrorMsg(const nsAString& aMessage)
-{
- if (mState == PresentationConnectionState::Terminated) {
- return;
- }
-
- nsString message = nsString(aMessage);
- RefPtr<PresentationConnection> self = this;
- nsCOMPtr<nsIRunnable> r =
- NS_NewRunnableFunction([self, message]() -> void {
- // Set |mState| to |PresentationConnectionState::Closed| here to avoid
- // calling |ProcessStateChanged|.
- self->mState = PresentationConnectionState::Closed;
-
- // Make sure dispatching the event and closing the connection are invoked
- // at the same time by setting |aDispatchNow| to true.
- Unused << NS_WARN_IF(NS_FAILED(
- self->DispatchConnectionCloseEvent(PresentationConnectionClosedReason::Error,
- message,
- true)));
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if(NS_WARN_IF(!service)) {
- return;
- }
-
- Unused << NS_WARN_IF(NS_FAILED(
- service->CloseSession(self->mId,
- self->mRole,
- nsIPresentationService::CLOSED_REASON_ERROR)));
- });
-
- Unused << NS_WARN_IF(NS_FAILED(NS_DispatchToMainThread(r)));
-}
diff --git a/dom/presentation/PresentationConnection.h b/dom/presentation/PresentationConnection.h
deleted file mode 100644
index cecf6c346..000000000
--- a/dom/presentation/PresentationConnection.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationConnection_h
-#define mozilla_dom_PresentationConnection_h
-
-#include "mozilla/DOMEventTargetHelper.h"
-#include "mozilla/dom/TypedArray.h"
-#include "mozilla/WeakPtr.h"
-#include "mozilla/dom/PresentationConnectionBinding.h"
-#include "mozilla/dom/PresentationConnectionCloseEventBinding.h"
-#include "nsIPresentationListener.h"
-#include "nsIRequest.h"
-#include "nsWeakReference.h"
-
-namespace mozilla {
-namespace dom {
-
-class Blob;
-class PresentationConnectionList;
-
-class PresentationConnection final : public DOMEventTargetHelper
- , public nsIPresentationSessionListener
- , public nsIRequest
- , public SupportsWeakPtr<PresentationConnection>
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(PresentationConnection,
- DOMEventTargetHelper)
- NS_DECL_NSIPRESENTATIONSESSIONLISTENER
- NS_DECL_NSIREQUEST
- MOZ_DECLARE_WEAKREFERENCE_TYPENAME(PresentationConnection)
-
- static already_AddRefed<PresentationConnection>
- Create(nsPIDOMWindowInner* aWindow,
- const nsAString& aId,
- const nsAString& aUrl,
- const uint8_t aRole,
- PresentationConnectionList* aList = nullptr);
-
- virtual void DisconnectFromOwner() override;
-
- virtual JSObject* WrapObject(JSContext* aCx,
- JS::Handle<JSObject*> aGivenProto) override;
-
- // WebIDL (public APIs)
- void GetId(nsAString& aId) const;
-
- void GetUrl(nsAString& aUrl) const;
-
- PresentationConnectionState State() const;
-
- PresentationConnectionBinaryType BinaryType() const;
-
- void SetBinaryType(PresentationConnectionBinaryType aType);
-
- void Send(const nsAString& aData,
- ErrorResult& aRv);
-
- void Send(Blob& aData,
- ErrorResult& aRv);
-
- void Send(const ArrayBuffer& aData,
- ErrorResult& aRv);
-
- void Send(const ArrayBufferView& aData,
- ErrorResult& aRv);
-
- void Close(ErrorResult& aRv);
-
- void Terminate(ErrorResult& aRv);
-
- bool
- Equals(uint64_t aWindowId, const nsAString& aId);
-
- IMPL_EVENT_HANDLER(connect);
- IMPL_EVENT_HANDLER(close);
- IMPL_EVENT_HANDLER(terminate);
- IMPL_EVENT_HANDLER(message);
-
-private:
- PresentationConnection(nsPIDOMWindowInner* aWindow,
- const nsAString& aId,
- const nsAString& aUrl,
- const uint8_t aRole,
- PresentationConnectionList* aList);
-
- ~PresentationConnection();
-
- bool Init();
-
- void Shutdown();
-
- nsresult ProcessStateChanged(nsresult aReason);
-
- nsresult DispatchConnectionCloseEvent(PresentationConnectionClosedReason aReason,
- const nsAString& aMessage,
- bool aDispatchNow = false);
-
- nsresult DispatchMessageEvent(JS::Handle<JS::Value> aData);
-
- nsresult ProcessConnectionWentAway();
-
- nsresult AddIntoLoadGroup();
-
- nsresult RemoveFromLoadGroup();
-
- void AsyncCloseConnectionWithErrorMsg(const nsAString& aMessage);
-
- nsresult DoReceiveMessage(const nsACString& aData, bool aIsBinary);
-
- nsString mId;
- nsString mUrl;
- uint8_t mRole;
- PresentationConnectionState mState;
- RefPtr<PresentationConnectionList> mOwningConnectionList;
- nsWeakPtr mWeakLoadGroup;
- PresentationConnectionBinaryType mBinaryType;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationConnection_h
diff --git a/dom/presentation/PresentationConnectionList.cpp b/dom/presentation/PresentationConnectionList.cpp
deleted file mode 100644
index 0e0e7696c..000000000
--- a/dom/presentation/PresentationConnectionList.cpp
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "PresentationConnectionList.h"
-
-#include "mozilla/AsyncEventDispatcher.h"
-#include "mozilla/dom/PresentationConnectionAvailableEvent.h"
-#include "mozilla/dom/PresentationConnectionListBinding.h"
-#include "mozilla/dom/Promise.h"
-#include "PresentationConnection.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_INHERITED(PresentationConnectionList, DOMEventTargetHelper,
- mGetConnectionListPromise,
- mConnections)
-
-NS_IMPL_ADDREF_INHERITED(PresentationConnectionList, DOMEventTargetHelper)
-NS_IMPL_RELEASE_INHERITED(PresentationConnectionList, DOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(PresentationConnectionList)
-NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
-
-PresentationConnectionList::PresentationConnectionList(nsPIDOMWindowInner* aWindow,
- Promise* aPromise)
- : DOMEventTargetHelper(aWindow)
- , mGetConnectionListPromise(aPromise)
-{
- MOZ_ASSERT(aWindow);
- MOZ_ASSERT(aPromise);
-}
-
-/* virtual */ JSObject*
-PresentationConnectionList::WrapObject(JSContext* aCx,
- JS::Handle<JSObject*> aGivenProto)
-{
- return PresentationConnectionListBinding::Wrap(aCx, this, aGivenProto);
-}
-
-void
-PresentationConnectionList::GetConnections(
- nsTArray<RefPtr<PresentationConnection>>& aConnections) const
-{
- aConnections = mConnections;
-}
-
-nsresult
-PresentationConnectionList::DispatchConnectionAvailableEvent(
- PresentationConnection* aConnection)
-{
- PresentationConnectionAvailableEventInit init;
- init.mConnection = aConnection;
-
- RefPtr<PresentationConnectionAvailableEvent> event =
- PresentationConnectionAvailableEvent::Constructor(
- this,
- NS_LITERAL_STRING("connectionavailable"),
- init);
-
- if (NS_WARN_IF(!event)) {
- return NS_ERROR_FAILURE;
- }
- event->SetTrusted(true);
-
- RefPtr<AsyncEventDispatcher> asyncDispatcher =
- new AsyncEventDispatcher(this, event);
- return asyncDispatcher->PostDOMEvent();
-}
-
-PresentationConnectionList::ConnectionArrayIndex
-PresentationConnectionList::FindConnectionById(
- const nsAString& aId)
-{
- for (ConnectionArrayIndex i = 0; i < mConnections.Length(); i++) {
- nsAutoString id;
- mConnections[i]->GetId(id);
- if (id == nsAutoString(aId)) {
- return i;
- }
- }
-
- return mConnections.NoIndex;
-}
-
-void
-PresentationConnectionList::NotifyStateChange(const nsAString& aSessionId,
- PresentationConnection* aConnection)
-{
- if (!aConnection) {
- MOZ_ASSERT(false, "PresentationConnection can not be null.");
- return;
- }
-
- bool connectionFound =
- FindConnectionById(aSessionId) != mConnections.NoIndex ? true : false;
-
- PresentationConnectionListBinding::ClearCachedConnectionsValue(this);
- switch (aConnection->State()) {
- case PresentationConnectionState::Connected:
- if (!connectionFound) {
- mConnections.AppendElement(aConnection);
- if (mGetConnectionListPromise) {
- mGetConnectionListPromise->MaybeResolve(this);
- mGetConnectionListPromise = nullptr;
- return;
- }
- }
- DispatchConnectionAvailableEvent(aConnection);
- break;
- case PresentationConnectionState::Terminated:
- if (connectionFound) {
- mConnections.RemoveElement(aConnection);
- }
- break;
- default:
- break;
- }
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/PresentationConnectionList.h b/dom/presentation/PresentationConnectionList.h
deleted file mode 100644
index b430219ce..000000000
--- a/dom/presentation/PresentationConnectionList.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationConnectionList_h
-#define mozilla_dom_PresentationConnectionList_h
-
-#include "mozilla/DOMEventTargetHelper.h"
-#include "nsTArray.h"
-
-namespace mozilla {
-namespace dom {
-
-class PresentationConnection;
-class Promise;
-
-class PresentationConnectionList final : public DOMEventTargetHelper
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(PresentationConnectionList,
- DOMEventTargetHelper)
-
- PresentationConnectionList(nsPIDOMWindowInner* aWindow,
- Promise* aPromise);
-
- virtual JSObject* WrapObject(JSContext* aCx,
- JS::Handle<JSObject*> aGivenProto) override;
-
- void GetConnections(nsTArray<RefPtr<PresentationConnection>>& aConnections) const;
-
- void NotifyStateChange(const nsAString& aSessionId, PresentationConnection* aConnection);
-
- IMPL_EVENT_HANDLER(connectionavailable);
-
-private:
- virtual ~PresentationConnectionList() = default;
-
- nsresult DispatchConnectionAvailableEvent(PresentationConnection* aConnection);
-
- typedef nsTArray<RefPtr<PresentationConnection>> ConnectionArray;
- typedef ConnectionArray::index_type ConnectionArrayIndex;
-
- ConnectionArrayIndex FindConnectionById(const nsAString& aId);
-
- RefPtr<Promise> mGetConnectionListPromise;
-
- // This array stores only non-terminsted connections.
- ConnectionArray mConnections;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationConnectionList_h
diff --git a/dom/presentation/PresentationDataChannelSessionTransport.js b/dom/presentation/PresentationDataChannelSessionTransport.js
deleted file mode 100644
index 9af6213cb..000000000
--- a/dom/presentation/PresentationDataChannelSessionTransport.js
+++ /dev/null
@@ -1,378 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
-* License, v. 2.0. If a copy of the MPL was not distributed with this file,
-* You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-// Bug 1228209 - plan to remove this eventually
-function log(aMsg) {
- //dump("-*- PresentationDataChannelSessionTransport.js : " + aMsg + "\n");
-}
-
-const PRESENTATIONTRANSPORT_CID = Components.ID("{dd2bbf2f-3399-4389-8f5f-d382afb8b2d6}");
-const PRESENTATIONTRANSPORT_CONTRACTID = "mozilla.org/presentation/datachanneltransport;1";
-
-const PRESENTATIONTRANSPORTBUILDER_CID = Components.ID("{215b2f62-46e2-4004-a3d1-6858e56c20f3}");
-const PRESENTATIONTRANSPORTBUILDER_CONTRACTID = "mozilla.org/presentation/datachanneltransportbuilder;1";
-
-function PresentationDataChannelDescription(aDataChannelSDP) {
- this._dataChannelSDP = JSON.stringify(aDataChannelSDP);
-}
-
-PresentationDataChannelDescription.prototype = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationChannelDescription]),
- get type() {
- return Ci.nsIPresentationChannelDescription.TYPE_DATACHANNEL;
- },
- get tcpAddress() {
- return null;
- },
- get tcpPort() {
- return null;
- },
- get dataChannelSDP() {
- return this._dataChannelSDP;
- }
-};
-
-function PresentationTransportBuilder() {
- log("PresentationTransportBuilder construct");
- this._isControlChannelNeeded = true;
-}
-
-PresentationTransportBuilder.prototype = {
- classID: PRESENTATIONTRANSPORTBUILDER_CID,
- contractID: PRESENTATIONTRANSPORTBUILDER_CONTRACTID,
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationSessionTransportBuilder,
- Ci.nsIPresentationDataChannelSessionTransportBuilder,
- Ci.nsITimerCallback]),
-
- buildDataChannelTransport: function(aRole, aWindow, aListener) {
- if (!aRole || !aWindow || !aListener) {
- log("buildDataChannelTransport with illegal parameters");
- throw Cr.NS_ERROR_ILLEGAL_VALUE;
- }
-
- if (this._window) {
- log("buildDataChannelTransport has started.");
- throw Cr.NS_ERROR_UNEXPECTED;
- }
-
- log("buildDataChannelTransport with role " + aRole);
- this._role = aRole;
- this._window = aWindow;
- this._listener = aListener.QueryInterface(Ci.nsIPresentationSessionTransportBuilderListener);
-
- // TODO bug 1227053 set iceServers from |nsIPresentationDevice|
- this._peerConnection = new this._window.RTCPeerConnection();
-
- // |this._listener == null| will throw since the control channel is
- // abnormally closed.
- this._peerConnection.onicecandidate = aEvent => aEvent.candidate &&
- this._listener.sendIceCandidate(JSON.stringify(aEvent.candidate));
-
- this._peerConnection.onnegotiationneeded = () => {
- log("onnegotiationneeded with role " + this._role);
- if (!this._peerConnection) {
- log("ignoring negotiationneeded without PeerConnection");
- return;
- }
- this._peerConnection.createOffer()
- .then(aOffer => this._peerConnection.setLocalDescription(aOffer))
- .then(() => this._listener
- .sendOffer(new PresentationDataChannelDescription(this._peerConnection.localDescription)))
- .catch(e => this._reportError(e));
- }
-
- switch (this._role) {
- case Ci.nsIPresentationService.ROLE_CONTROLLER:
- this._dataChannel = this._peerConnection.createDataChannel("presentationAPI");
- this._setDataChannel();
- break;
-
- case Ci.nsIPresentationService.ROLE_RECEIVER:
- this._peerConnection.ondatachannel = aEvent => {
- this._dataChannel = aEvent.channel;
- // Ensure the binaryType of dataChannel is blob.
- this._dataChannel.binaryType = "blob";
- this._setDataChannel();
- }
- break;
- default:
- throw Cr.NS_ERROR_ILLEGAL_VALUE;
- }
-
- // TODO bug 1228235 we should have a way to let device providers customize
- // the time-out duration.
- let timeout = Services.prefs.getIntPref("presentation.receiver.loading.timeout", 10000);
-
- // The timer is to check if the negotiation finishes on time.
- this._timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
- this._timer.initWithCallback(this, timeout, this._timer.TYPE_ONE_SHOT);
- },
-
- notify: function() {
- if (!this._sessionTransport) {
- this._cleanup(Cr.NS_ERROR_NET_TIMEOUT);
- }
- },
-
- _reportError: function(aError) {
- log("report Error " + aError.name + ":" + aError.message);
- this._cleanup(Cr.NS_ERROR_FAILURE);
- },
-
- _setDataChannel: function() {
- this._dataChannel.onopen = () => {
- log("data channel is open, notify the listener, role " + this._role);
-
- // Handoff the ownership of _peerConnection and _dataChannel to
- // _sessionTransport
- this._sessionTransport = new PresentationTransport();
- this._sessionTransport.init(this._peerConnection, this._dataChannel, this._window);
- this._peerConnection.onicecandidate = null;
- this._peerConnection.onnegotiationneeded = null;
- this._peerConnection = this._dataChannel = null;
-
- this._listener.onSessionTransport(this._sessionTransport);
- this._sessionTransport.callback.notifyTransportReady();
-
- this._cleanup(Cr.NS_OK);
- };
-
- this._dataChannel.onerror = aError => {
- log("data channel onerror " + aError.name + ":" + aError.message);
- this._cleanup(Cr.NS_ERROR_FAILURE);
- }
- },
-
- _cleanup: function(aReason) {
- if (aReason != Cr.NS_OK) {
- this._listener.onError(aReason);
- }
-
- if (this._dataChannel) {
- this._dataChannel.close();
- this._dataChannel = null;
- }
-
- if (this._peerConnection) {
- this._peerConnection.close();
- this._peerConnection = null;
- }
-
- this._role = null;
- this._window = null;
-
- this._listener = null;
- this._sessionTransport = null;
-
- if (this._timer) {
- this._timer.cancel();
- this._timer = null;
- }
- },
-
- // nsIPresentationControlChannelListener
- onOffer: function(aOffer) {
- if (this._role !== Ci.nsIPresentationService.ROLE_RECEIVER ||
- this._sessionTransport) {
- log("onOffer status error");
- this._cleanup(Cr.NS_ERROR_FAILURE);
- }
-
- log("onOffer: " + aOffer.dataChannelSDP + " with role " + this._role);
-
- let offer = new this._window
- .RTCSessionDescription(JSON.parse(aOffer.dataChannelSDP));
-
- this._peerConnection.setRemoteDescription(offer)
- .then(() => this._peerConnection.signalingState == "stable" ||
- this._peerConnection.createAnswer())
- .then(aAnswer => this._peerConnection.setLocalDescription(aAnswer))
- .then(() => {
- this._isControlChannelNeeded = false;
- this._listener
- .sendAnswer(new PresentationDataChannelDescription(this._peerConnection.localDescription))
- }).catch(e => this._reportError(e));
- },
-
- onAnswer: function(aAnswer) {
- if (this._role !== Ci.nsIPresentationService.ROLE_CONTROLLER ||
- this._sessionTransport) {
- log("onAnswer status error");
- this._cleanup(Cr.NS_ERROR_FAILURE);
- }
-
- log("onAnswer: " + aAnswer.dataChannelSDP + " with role " + this._role);
-
- let answer = new this._window
- .RTCSessionDescription(JSON.parse(aAnswer.dataChannelSDP));
-
- this._peerConnection.setRemoteDescription(answer).catch(e => this._reportError(e));
- this._isControlChannelNeeded = false;
- },
-
- onIceCandidate: function(aCandidate) {
- log("onIceCandidate: " + aCandidate + " with role " + this._role);
- if (!this._window || !this._peerConnection) {
- log("ignoring ICE candidate after connection");
- return;
- }
- let candidate = new this._window.RTCIceCandidate(JSON.parse(aCandidate));
- this._peerConnection.addIceCandidate(candidate).catch(e => this._reportError(e));
- },
-
- notifyDisconnected: function(aReason) {
- log("notifyDisconnected reason: " + aReason);
-
- if (aReason != Cr.NS_OK) {
- this._cleanup(aReason);
- } else if (this._isControlChannelNeeded) {
- this._cleanup(Cr.NS_ERROR_FAILURE);
- }
- },
-};
-
-function PresentationTransport() {
- this._messageQueue = [];
- this._closeReason = Cr.NS_OK;
-}
-
-PresentationTransport.prototype = {
- classID: PRESENTATIONTRANSPORT_CID,
- contractID: PRESENTATIONTRANSPORT_CONTRACTID,
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationSessionTransport]),
-
- init: function(aPeerConnection, aDataChannel, aWindow) {
- log("initWithDataChannel");
- this._enableDataNotification = false;
- this._dataChannel = aDataChannel;
- this._peerConnection = aPeerConnection;
- this._window = aWindow;
-
- this._dataChannel.onopen = () => {
- log("data channel reopen. Should never touch here");
- };
-
- this._dataChannel.onclose = () => {
- log("data channel onclose");
- if (this._callback) {
- this._callback.notifyTransportClosed(this._closeReason);
- }
- this._cleanup();
- }
-
- this._dataChannel.onmessage = aEvent => {
- log("data channel onmessage " + aEvent.data);
-
- if (!this._enableDataNotification || !this._callback) {
- log("queue message");
- this._messageQueue.push(aEvent.data);
- return;
- }
- this._doNotifyData(aEvent.data);
- };
-
- this._dataChannel.onerror = aError => {
- log("data channel onerror " + aError.name + ":" + aError.message);
- if (this._callback) {
- this._callback.notifyTransportClosed(Cr.NS_ERROR_FAILURE);
- }
- this._cleanup();
- }
- },
-
- // nsIPresentationTransport
- get selfAddress() {
- throw NS_ERROR_NOT_AVAILABLE;
- },
-
- get callback() {
- return this._callback;
- },
-
- set callback(aCallback) {
- this._callback = aCallback;
- },
-
- send: function(aData) {
- log("send " + aData);
- this._dataChannel.send(aData);
- },
-
- sendBinaryMsg: function(aData) {
- log("sendBinaryMsg");
-
- let array = new Uint8Array(aData.length);
- for (let i = 0; i < aData.length; i++) {
- array[i] = aData.charCodeAt(i);
- }
-
- this._dataChannel.send(array);
- },
-
- sendBlob: function(aBlob) {
- log("sendBlob");
-
- this._dataChannel.send(aBlob);
- },
-
- enableDataNotification: function() {
- log("enableDataNotification");
- if (this._enableDataNotification) {
- return;
- }
-
- if (!this._callback) {
- throw NS_ERROR_NOT_AVAILABLE;
- }
-
- this._enableDataNotification = true;
-
- this._messageQueue.forEach(aData => this._doNotifyData(aData));
- this._messageQueue = [];
- },
-
- close: function(aReason) {
- this._closeReason = aReason;
-
- this._dataChannel.close();
- },
-
- _cleanup: function() {
- this._dataChannel = null;
-
- if (this._peerConnection) {
- this._peerConnection.close();
- this._peerConnection = null;
- }
- this._callback = null;
- this._messageQueue = [];
- this._window = null;
- },
-
- _doNotifyData: function(aData) {
- if (!this._callback) {
- throw NS_ERROR_NOT_AVAILABLE;
- }
-
- if (aData instanceof this._window.Blob) {
- let reader = new this._window.FileReader();
- reader.addEventListener("load", (aEvent) => {
- this._callback.notifyData(aEvent.target.result, true);
- });
- reader.readAsBinaryString(aData);
- } else {
- this._callback.notifyData(aData, false);
- }
- },
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PresentationTransportBuilder,
- PresentationTransport]);
diff --git a/dom/presentation/PresentationDataChannelSessionTransport.manifest b/dom/presentation/PresentationDataChannelSessionTransport.manifest
deleted file mode 100644
index 6838f675f..000000000
--- a/dom/presentation/PresentationDataChannelSessionTransport.manifest
+++ /dev/null
@@ -1,6 +0,0 @@
-# PresentationDataChannelSessionTransport.js
-component {dd2bbf2f-3399-4389-8f5f-d382afb8b2d6} PresentationDataChannelSessionTransport.js
-contract @mozilla.org/presentation/datachanneltransport;1 {dd2bbf2f-3399-4389-8f5f-d382afb8b2d6}
-
-component {215b2f62-46e2-4004-a3d1-6858e56c20f3} PresentationDataChannelSessionTransport.js
-contract @mozilla.org/presentation/datachanneltransportbuilder;1 {215b2f62-46e2-4004-a3d1-6858e56c20f3}
diff --git a/dom/presentation/PresentationDeviceInfoManager.js b/dom/presentation/PresentationDeviceInfoManager.js
deleted file mode 100644
index 29e7d370c..000000000
--- a/dom/presentation/PresentationDeviceInfoManager.js
+++ /dev/null
@@ -1,119 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
-* License, v. 2.0. If a copy of the MPL was not distributed with this file,
-* You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/DOMRequestHelper.jsm");
-
-function log(aMsg) {
- //dump("-*- PresentationDeviceInfoManager.js : " + aMsg + "\n");
-}
-
-const PRESENTATIONDEVICEINFOMANAGER_CID = Components.ID("{1bd66bef-f643-4be3-b690-0c656353eafd}");
-const PRESENTATIONDEVICEINFOMANAGER_CONTRACTID = "@mozilla.org/presentation-device/deviceInfo;1";
-
-XPCOMUtils.defineLazyServiceGetter(this, "cpmm",
- "@mozilla.org/childprocessmessagemanager;1",
- "nsIMessageSender");
-
-function PresentationDeviceInfoManager() {}
-
-PresentationDeviceInfoManager.prototype = {
- __proto__: DOMRequestIpcHelper.prototype,
-
- classID: PRESENTATIONDEVICEINFOMANAGER_CID,
- contractID: PRESENTATIONDEVICEINFOMANAGER_CONTRACTID,
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISupportsWeakReference,
- Ci.nsIObserver,
- Ci.nsIDOMGlobalPropertyInitializer]),
-
- receiveMessage: function(aMsg) {
- if (!aMsg || !aMsg.data) {
- return;
- }
-
- let data = aMsg.data;
-
- log("receive aMsg: " + aMsg.name);
- switch (aMsg.name) {
- case "PresentationDeviceInfoManager:OnDeviceChange": {
- let detail = {
- detail: {
- type: data.type,
- deviceInfo: data.deviceInfo,
- }
- };
- let event = new this._window.CustomEvent("devicechange", Cu.cloneInto(detail, this._window));
- this.__DOM_IMPL__.dispatchEvent(event);
- break;
- }
- case "PresentationDeviceInfoManager:GetAll:Result:Ok": {
- let resolver = this.takePromiseResolver(data.requestId);
-
- if (!resolver) {
- return;
- }
-
- resolver.resolve(Cu.cloneInto(data.devices, this._window));
- break;
- }
- case "PresentationDeviceInfoManager:GetAll:Result:Error": {
- let resolver = this.takePromiseResolver(data.requestId);
-
- if (!resolver) {
- return;
- }
-
- resolver.reject(data.error);
- break;
- }
- }
- },
-
- init: function(aWin) {
- log("init");
- this.initDOMRequestHelper(aWin, [
- {name: "PresentationDeviceInfoManager:OnDeviceChange", weakRef: true},
- {name: "PresentationDeviceInfoManager:GetAll:Result:Ok", weakRef: true},
- {name: "PresentationDeviceInfoManager:GetAll:Result:Error", weakRef: true},
- ]);
- },
-
- uninit: function() {
- log("uninit");
- let self = this;
-
- this.forEachPromiseResolver(function(aKey) {
- self.takePromiseResolver(aKey).reject("PresentationDeviceInfoManager got destroyed");
- });
- },
-
- get ondevicechange() {
- return this.__DOM_IMPL__.getEventHandler("ondevicechange");
- },
-
- set ondevicechange(aHandler) {
- this.__DOM_IMPL__.setEventHandler("ondevicechange", aHandler);
- },
-
- getAll: function() {
- log("getAll");
- let self = this;
- return this.createPromiseWithId(function(aResolverId) {
- cpmm.sendAsyncMessage("PresentationDeviceInfoManager:GetAll", {
- requestId: aResolverId,
- });
- });
- },
-
- forceDiscovery: function() {
- cpmm.sendAsyncMessage("PresentationDeviceInfoManager:ForceDiscovery");
- },
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PresentationDeviceInfoManager]);
diff --git a/dom/presentation/PresentationDeviceInfoManager.jsm b/dom/presentation/PresentationDeviceInfoManager.jsm
deleted file mode 100644
index 205982b9c..000000000
--- a/dom/presentation/PresentationDeviceInfoManager.jsm
+++ /dev/null
@@ -1,104 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- /
-/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-this.EXPORTED_SYMBOLS = ["PresentationDeviceInfoService"];
-
-function log(aMsg) {
- //dump("PresentationDeviceInfoManager.jsm: " + aMsg + "\n");
-}
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "presentationDeviceManager",
- "@mozilla.org/presentation-device/manager;1",
- "nsIPresentationDeviceManager");
-
-XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
- "@mozilla.org/parentprocessmessagemanager;1",
- "nsIMessageBroadcaster");
-
-this.PresentationDeviceInfoService = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIMessageListener,
- Ci.nsIObserver]),
-
- init: function() {
- log("init");
- ppmm.addMessageListener("PresentationDeviceInfoManager:GetAll", this);
- ppmm.addMessageListener("PresentationDeviceInfoManager:ForceDiscovery", this);
- Services.obs.addObserver(this, "presentation-device-change", false);
- },
-
- getAll: function(aData, aMm) {
- log("getAll");
- let deviceArray = presentationDeviceManager.getAvailableDevices().QueryInterface(Ci.nsIArray);
- if (!deviceArray) {
- aData.error = "DataError";
- aMm.sendAsyncMessage("PresentationDeviceInfoManager:GetAll:Result:Error", aData);
- return;
- }
-
- aData.devices = [];
- for (let i = 0; i < deviceArray.length; i++) {
- let device = deviceArray.queryElementAt(i, Ci.nsIPresentationDevice);
- aData.devices.push({
- id: device.id,
- name: device.name,
- type: device.type,
- });
- }
- aMm.sendAsyncMessage("PresentationDeviceInfoManager:GetAll:Result:Ok", aData);
- },
-
- forceDiscovery: function() {
- log("forceDiscovery");
- presentationDeviceManager.forceDiscovery();
- },
-
- observe: function(aSubject, aTopic, aData) {
- log("observe: " + aTopic);
-
- let device = aSubject.QueryInterface(Ci.nsIPresentationDevice);
- let data = {
- type: aData,
- deviceInfo: {
- id: device.id,
- name: device.name,
- type: device.type,
- },
- };
- ppmm.broadcastAsyncMessage("PresentationDeviceInfoManager:OnDeviceChange", data);
- },
-
- receiveMessage: function(aMessage) {
- if (!aMessage.target.assertPermission("presentation-device-manage")) {
- debug("receive message " + aMessage.name +
- " from a content process with no 'presentation-device-manage' privileges.");
- return null;
- }
-
- let msg = aMessage.data || {};
- let mm = aMessage.target;
-
- log("receiveMessage: " + aMessage.name);
- switch (aMessage.name) {
- case "PresentationDeviceInfoManager:GetAll": {
- this.getAll(msg, mm);
- break;
- }
- case "PresentationDeviceInfoManager:ForceDiscovery": {
- this.forceDiscovery();
- break;
- }
- }
- },
-};
-
-this.PresentationDeviceInfoService.init();
diff --git a/dom/presentation/PresentationDeviceInfoManager.manifest b/dom/presentation/PresentationDeviceInfoManager.manifest
deleted file mode 100644
index ae50b8e6a..000000000
--- a/dom/presentation/PresentationDeviceInfoManager.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-# PresentationDeviceInfoManager.js
-component {1bd66bef-f643-4be3-b690-0c656353eafd} PresentationDeviceInfoManager.js
-contract @mozilla.org/presentation-device/deviceInfo;1 {1bd66bef-f643-4be3-b690-0c656353eafd}
diff --git a/dom/presentation/PresentationDeviceManager.cpp b/dom/presentation/PresentationDeviceManager.cpp
deleted file mode 100644
index 7e5a4700c..000000000
--- a/dom/presentation/PresentationDeviceManager.cpp
+++ /dev/null
@@ -1,336 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "PresentationDeviceManager.h"
-
-#include "mozilla/Services.h"
-#include "MainThreadUtils.h"
-#include "nsArrayUtils.h"
-#include "nsCategoryCache.h"
-#include "nsCOMPtr.h"
-#include "nsIMutableArray.h"
-#include "nsIObserverService.h"
-#include "nsXULAppAPI.h"
-#include "PresentationSessionRequest.h"
-#include "PresentationTerminateRequest.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_ISUPPORTS(PresentationDeviceManager,
- nsIPresentationDeviceManager,
- nsIPresentationDeviceListener,
- nsIObserver,
- nsISupportsWeakReference)
-
-PresentationDeviceManager::PresentationDeviceManager()
-{
-}
-
-PresentationDeviceManager::~PresentationDeviceManager()
-{
- UnloadDeviceProviders();
- mDevices.Clear();
-}
-
-void
-PresentationDeviceManager::Init()
-{
- nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
- if (obs) {
- obs->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
- }
-
- LoadDeviceProviders();
-}
-
-void
-PresentationDeviceManager::Shutdown()
-{
- nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
- if (obs) {
- obs->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
- }
-
- UnloadDeviceProviders();
-}
-
-void
-PresentationDeviceManager::LoadDeviceProviders()
-{
- MOZ_ASSERT(mProviders.IsEmpty());
-
- nsCategoryCache<nsIPresentationDeviceProvider> providerCache(PRESENTATION_DEVICE_PROVIDER_CATEGORY);
- providerCache.GetEntries(mProviders);
-
- for (uint32_t i = 0; i < mProviders.Length(); ++i) {
- mProviders[i]->SetListener(this);
- }
-}
-
-void
-PresentationDeviceManager::UnloadDeviceProviders()
-{
- for (uint32_t i = 0; i < mProviders.Length(); ++i) {
- mProviders[i]->SetListener(nullptr);
- }
-
- mProviders.Clear();
-}
-
-void
-PresentationDeviceManager::NotifyDeviceChange(nsIPresentationDevice* aDevice,
- const char16_t* aType)
-{
- nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
- if (obs) {
- obs->NotifyObservers(aDevice,
- PRESENTATION_DEVICE_CHANGE_TOPIC,
- aType);
- }
-}
-
-// nsIPresentationDeviceManager
-NS_IMETHODIMP
-PresentationDeviceManager::ForceDiscovery()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- for (uint32_t i = 0; i < mProviders.Length(); ++i) {
- mProviders[i]->ForceDiscovery();
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationDeviceManager::AddDeviceProvider(nsIPresentationDeviceProvider* aProvider)
-{
- NS_ENSURE_ARG(aProvider);
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(mProviders.Contains(aProvider))) {
- return NS_OK;
- }
-
- mProviders.AppendElement(aProvider);
- aProvider->SetListener(this);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationDeviceManager::RemoveDeviceProvider(nsIPresentationDeviceProvider* aProvider)
-{
- NS_ENSURE_ARG(aProvider);
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!mProviders.RemoveElement(aProvider))) {
- return NS_ERROR_FAILURE;
- }
-
- aProvider->SetListener(nullptr);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationDeviceManager::GetDeviceAvailable(bool* aRetVal)
-{
- NS_ENSURE_ARG_POINTER(aRetVal);
- MOZ_ASSERT(NS_IsMainThread());
-
- *aRetVal = !mDevices.IsEmpty();
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationDeviceManager::GetAvailableDevices(nsIArray* aPresentationUrls, nsIArray** aRetVal)
-{
- NS_ENSURE_ARG_POINTER(aRetVal);
- MOZ_ASSERT(NS_IsMainThread());
-
- // Bug 1194049: some providers may discontinue discovery after timeout.
- // Call |ForceDiscovery()| here to make sure device lists are updated.
- NS_DispatchToMainThread(
- NewRunnableMethod(this, &PresentationDeviceManager::ForceDiscovery));
-
- nsTArray<nsString> presentationUrls;
- if (aPresentationUrls) {
- uint32_t length;
- nsresult rv = aPresentationUrls->GetLength(&length);
- if (NS_SUCCEEDED(rv)) {
- for (uint32_t i = 0; i < length; ++i) {
- nsCOMPtr<nsISupportsString> isupportStr =
- do_QueryElementAt(aPresentationUrls, i);
-
- nsAutoString presentationUrl;
- rv = isupportStr->GetData(presentationUrl);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- continue;
- }
-
- presentationUrls.AppendElement(presentationUrl);
- }
- }
- }
-
- nsCOMPtr<nsIMutableArray> devices = do_CreateInstance(NS_ARRAY_CONTRACTID);
- for (uint32_t i = 0; i < mDevices.Length(); ++i) {
- if (presentationUrls.IsEmpty()) {
- devices->AppendElement(mDevices[i], false);
- continue;
- }
-
- for (uint32_t j = 0; j < presentationUrls.Length(); ++j) {
- bool isSupported;
- if (NS_SUCCEEDED(mDevices[i]->IsRequestedUrlSupported(presentationUrls[j],
- &isSupported)) &&
- isSupported) {
- devices->AppendElement(mDevices[i], false);
- break;
- }
- }
- }
-
- devices.forget(aRetVal);
-
- return NS_OK;
-}
-
-// nsIPresentationDeviceListener
-NS_IMETHODIMP
-PresentationDeviceManager::AddDevice(nsIPresentationDevice* aDevice)
-{
- NS_ENSURE_ARG(aDevice);
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(mDevices.Contains(aDevice))) {
- return NS_ERROR_FAILURE;
- }
-
- mDevices.AppendElement(aDevice);
-
- NotifyDeviceChange(aDevice, u"add");
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationDeviceManager::RemoveDevice(nsIPresentationDevice* aDevice)
-{
- NS_ENSURE_ARG(aDevice);
- MOZ_ASSERT(NS_IsMainThread());
-
- int32_t index = mDevices.IndexOf(aDevice);
- if (NS_WARN_IF(index < 0)) {
- return NS_ERROR_FAILURE;
- }
-
- mDevices.RemoveElementAt(index);
-
- NotifyDeviceChange(aDevice, u"remove");
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationDeviceManager::UpdateDevice(nsIPresentationDevice* aDevice)
-{
- NS_ENSURE_ARG(aDevice);
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!mDevices.Contains(aDevice))) {
- return NS_ERROR_FAILURE;
- }
-
- NotifyDeviceChange(aDevice, u"update");
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationDeviceManager::OnSessionRequest(nsIPresentationDevice* aDevice,
- const nsAString& aUrl,
- const nsAString& aPresentationId,
- nsIPresentationControlChannel* aControlChannel)
-{
- NS_ENSURE_ARG(aDevice);
- NS_ENSURE_ARG(aControlChannel);
-
- nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
- NS_ENSURE_TRUE(obs, NS_ERROR_FAILURE);
-
- RefPtr<PresentationSessionRequest> request =
- new PresentationSessionRequest(aDevice, aUrl, aPresentationId, aControlChannel);
- obs->NotifyObservers(request,
- PRESENTATION_SESSION_REQUEST_TOPIC,
- nullptr);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationDeviceManager::OnTerminateRequest(nsIPresentationDevice* aDevice,
- const nsAString& aPresentationId,
- nsIPresentationControlChannel* aControlChannel,
- bool aIsFromReceiver)
-{
- NS_ENSURE_ARG(aDevice);
- NS_ENSURE_ARG(aControlChannel);
-
- nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
- NS_ENSURE_TRUE(obs, NS_ERROR_FAILURE);
-
- RefPtr<PresentationTerminateRequest> request =
- new PresentationTerminateRequest(aDevice, aPresentationId,
- aControlChannel, aIsFromReceiver);
- obs->NotifyObservers(request,
- PRESENTATION_TERMINATE_REQUEST_TOPIC,
- nullptr);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationDeviceManager::OnReconnectRequest(nsIPresentationDevice* aDevice,
- const nsAString& aUrl,
- const nsAString& aPresentationId,
- nsIPresentationControlChannel* aControlChannel)
-{
- NS_ENSURE_ARG(aDevice);
- NS_ENSURE_ARG(aControlChannel);
-
- nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
- NS_ENSURE_TRUE(obs, NS_ERROR_FAILURE);
-
- RefPtr<PresentationSessionRequest> request =
- new PresentationSessionRequest(aDevice, aUrl, aPresentationId, aControlChannel);
- obs->NotifyObservers(request,
- PRESENTATION_RECONNECT_REQUEST_TOPIC,
- nullptr);
-
- return NS_OK;
-}
-
-// nsIObserver
-NS_IMETHODIMP
-PresentationDeviceManager::Observe(nsISupports *aSubject,
- const char *aTopic,
- const char16_t *aData)
-{
- if (!strcmp(aTopic, "profile-after-change")) {
- Init();
- } else if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
- Shutdown();
- }
-
- return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/PresentationDeviceManager.h b/dom/presentation/PresentationDeviceManager.h
deleted file mode 100644
index f854ee883..000000000
--- a/dom/presentation/PresentationDeviceManager.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationDeviceManager_h__
-#define mozilla_dom_PresentationDeviceManager_h__
-
-#include "nsIObserver.h"
-#include "nsIPresentationDevice.h"
-#include "nsIPresentationDeviceManager.h"
-#include "nsIPresentationDeviceProvider.h"
-#include "nsCOMArray.h"
-#include "nsWeakReference.h"
-
-namespace mozilla {
-namespace dom {
-
-class PresentationDeviceManager final : public nsIPresentationDeviceManager
- , public nsIPresentationDeviceListener
- , public nsIObserver
- , public nsSupportsWeakReference
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONDEVICEMANAGER
- NS_DECL_NSIPRESENTATIONDEVICELISTENER
- NS_DECL_NSIOBSERVER
-
- PresentationDeviceManager();
-
-private:
- virtual ~PresentationDeviceManager();
-
- void Init();
-
- void Shutdown();
-
- void LoadDeviceProviders();
-
- void UnloadDeviceProviders();
-
- void NotifyDeviceChange(nsIPresentationDevice* aDevice,
- const char16_t* aType);
-
- nsCOMArray<nsIPresentationDeviceProvider> mProviders;
- nsCOMArray<nsIPresentationDevice> mDevices;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif /* mozilla_dom_PresentationDeviceManager_h__ */
diff --git a/dom/presentation/PresentationLog.h b/dom/presentation/PresentationLog.h
deleted file mode 100644
index 96af0c124..000000000
--- a/dom/presentation/PresentationLog.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationLog_h
-#define mozilla_dom_PresentationLog_h
-
-/*
- * MOZ_LOG=Presentation:5
- * For detail, see PresentationService.cpp
- */
-namespace mozilla {
-namespace dom {
-extern mozilla::LazyLogModule gPresentationLog;
-}
-}
-
-#undef PRES_ERROR
-#define PRES_ERROR(...) MOZ_LOG(mozilla::dom::gPresentationLog, mozilla::LogLevel::Error, (__VA_ARGS__))
-
-#undef PRES_DEBUG
-#define PRES_DEBUG(...) MOZ_LOG(mozilla::dom::gPresentationLog, mozilla::LogLevel::Debug, (__VA_ARGS__))
-
-#endif // mozilla_dom_PresentationLog_h
diff --git a/dom/presentation/PresentationNetworkHelper.js b/dom/presentation/PresentationNetworkHelper.js
deleted file mode 100644
index 9b6458daf..000000000
--- a/dom/presentation/PresentationNetworkHelper.js
+++ /dev/null
@@ -1,28 +0,0 @@
-// -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/Messaging.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const NETWORKHELPER_CID = Components.ID("{5fb96caa-6d49-4f6b-9a4b-65dd0d51f92d}");
-
-function PresentationNetworkHelper() {}
-
-PresentationNetworkHelper.prototype = {
- classID: NETWORKHELPER_CID,
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationNetworkHelper]),
-
- getWifiIPAddress: function(aListener) {
- Messaging.sendRequestForResult({type: "Wifi:GetIPAddress"})
- .then(result => aListener.onGetWifiIPAddress(result),
- err => aListener.onError(err));
- }
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PresentationNetworkHelper]);
diff --git a/dom/presentation/PresentationNetworkHelper.manifest b/dom/presentation/PresentationNetworkHelper.manifest
deleted file mode 100644
index a061cef08..000000000
--- a/dom/presentation/PresentationNetworkHelper.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-# PresentationNetworkHelper.js
-component {5fb96caa-6d49-4f6b-9a4b-65dd0d51f92d} PresentationNetworkHelper.js
-contract @mozilla.org/presentation-device/networkHelper;1 {5fb96caa-6d49-4f6b-9a4b-65dd0d51f92d}
diff --git a/dom/presentation/PresentationReceiver.cpp b/dom/presentation/PresentationReceiver.cpp
deleted file mode 100644
index bc1776b45..000000000
--- a/dom/presentation/PresentationReceiver.cpp
+++ /dev/null
@@ -1,179 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "PresentationReceiver.h"
-
-#include "mozilla/dom/PresentationReceiverBinding.h"
-#include "mozilla/dom/Promise.h"
-#include "nsContentUtils.h"
-#include "nsIPresentationService.h"
-#include "nsPIDOMWindow.h"
-#include "nsServiceManagerUtils.h"
-#include "nsThreadUtils.h"
-#include "PresentationConnection.h"
-#include "PresentationConnectionList.h"
-#include "PresentationLog.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(PresentationReceiver,
- mOwner,
- mGetConnectionListPromise,
- mConnectionList)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(PresentationReceiver)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(PresentationReceiver)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PresentationReceiver)
- NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
- NS_INTERFACE_MAP_ENTRY(nsIPresentationRespondingListener)
- NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-/* static */ already_AddRefed<PresentationReceiver>
-PresentationReceiver::Create(nsPIDOMWindowInner* aWindow)
-{
- RefPtr<PresentationReceiver> receiver = new PresentationReceiver(aWindow);
- return NS_WARN_IF(!receiver->Init()) ? nullptr : receiver.forget();
-}
-
-PresentationReceiver::PresentationReceiver(nsPIDOMWindowInner* aWindow)
- : mOwner(aWindow)
-{
- MOZ_ASSERT(aWindow);
-}
-
-PresentationReceiver::~PresentationReceiver()
-{
- Shutdown();
-}
-
-bool
-PresentationReceiver::Init()
-{
- if (NS_WARN_IF(!mOwner)) {
- return false;
- }
- mWindowId = mOwner->WindowID();
-
- nsCOMPtr<nsIDocShell> docShell = mOwner->GetDocShell();
- MOZ_ASSERT(docShell);
-
- nsContentUtils::GetPresentationURL(docShell, mUrl);
- return !mUrl.IsEmpty();
-}
-
-void PresentationReceiver::Shutdown()
-{
- PRES_DEBUG("receiver shutdown:windowId[%d]\n", mWindowId);
-
- // Unregister listener for incoming sessions.
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return;
- }
-
- Unused <<
- NS_WARN_IF(NS_FAILED(service->UnregisterRespondingListener(mWindowId)));
-}
-
-/* virtual */ JSObject*
-PresentationReceiver::WrapObject(JSContext* aCx,
- JS::Handle<JSObject*> aGivenProto)
-{
- return PresentationReceiverBinding::Wrap(aCx, this, aGivenProto);
-}
-
-NS_IMETHODIMP
-PresentationReceiver::NotifySessionConnect(uint64_t aWindowId,
- const nsAString& aSessionId)
-{
- PRES_DEBUG("receiver session connect:id[%s], windowId[%x]\n",
- NS_ConvertUTF16toUTF8(aSessionId).get(), aWindowId);
-
- if (NS_WARN_IF(!mOwner)) {
- return NS_ERROR_FAILURE;
- }
-
- if (NS_WARN_IF(aWindowId != mWindowId)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- if (NS_WARN_IF(!mConnectionList)) {
- return NS_ERROR_FAILURE;
- }
-
- RefPtr<PresentationConnection> connection =
- PresentationConnection::Create(mOwner, aSessionId, mUrl,
- nsIPresentationService::ROLE_RECEIVER,
- mConnectionList);
- if (NS_WARN_IF(!connection)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return NS_OK;
-}
-
-already_AddRefed<Promise>
-PresentationReceiver::GetConnectionList(ErrorResult& aRv)
-{
- nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(mOwner);
- if (NS_WARN_IF(!global)) {
- aRv.Throw(NS_ERROR_UNEXPECTED);
- return nullptr;
- }
-
- if (!mGetConnectionListPromise) {
- mGetConnectionListPromise = Promise::Create(global, aRv);
- if (NS_WARN_IF(aRv.Failed())) {
- return nullptr;
- }
-
- RefPtr<PresentationReceiver> self = this;
- nsresult rv =
- NS_DispatchToMainThread(NS_NewRunnableFunction([self] () -> void {
- self->CreateConnectionList();
- }));
- if (NS_FAILED(rv)) {
- aRv.Throw(rv);
- return nullptr;
- }
- }
-
- RefPtr<Promise> promise = mGetConnectionListPromise;
- return promise.forget();
-}
-
-void
-PresentationReceiver::CreateConnectionList()
-{
- MOZ_ASSERT(mGetConnectionListPromise);
-
- if (mConnectionList) {
- return;
- }
-
- mConnectionList = new PresentationConnectionList(mOwner,
- mGetConnectionListPromise);
-
- // Register listener for incoming sessions.
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- mGetConnectionListPromise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
-
- nsresult rv = service->RegisterRespondingListener(mWindowId, this);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- mGetConnectionListPromise->MaybeReject(rv);
- }
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/PresentationReceiver.h b/dom/presentation/PresentationReceiver.h
deleted file mode 100644
index ee72f587b..000000000
--- a/dom/presentation/PresentationReceiver.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationReceiver_h
-#define mozilla_dom_PresentationReceiver_h
-
-#include "mozilla/ErrorResult.h"
-#include "nsCOMPtr.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsIPresentationListener.h"
-#include "nsWrapperCache.h"
-#include "nsString.h"
-
-class nsPIDOMWindowInner;
-
-namespace mozilla {
-namespace dom {
-
-class PresentationConnection;
-class PresentationConnectionList;
-class Promise;
-
-class PresentationReceiver final : public nsIPresentationRespondingListener
- , public nsWrapperCache
-{
-public:
- NS_DECL_CYCLE_COLLECTING_ISUPPORTS
- NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(PresentationReceiver)
- NS_DECL_NSIPRESENTATIONRESPONDINGLISTENER
-
- static already_AddRefed<PresentationReceiver> Create(nsPIDOMWindowInner* aWindow);
-
- virtual JSObject* WrapObject(JSContext* aCx,
- JS::Handle<JSObject*> aGivenProto) override;
-
- nsPIDOMWindowInner* GetParentObject() const
- {
- return mOwner;
- }
-
- // WebIDL (public APIs)
- already_AddRefed<Promise> GetConnectionList(ErrorResult& aRv);
-
-private:
- explicit PresentationReceiver(nsPIDOMWindowInner* aWindow);
-
- virtual ~PresentationReceiver();
-
- MOZ_IS_CLASS_INIT bool Init();
-
- void Shutdown();
-
- void CreateConnectionList();
-
- // Store the inner window ID for |UnregisterRespondingListener| call in
- // |Shutdown| since the inner window may not exist at that moment.
- uint64_t mWindowId;
-
- nsCOMPtr<nsPIDOMWindowInner> mOwner;
- nsString mUrl;
- RefPtr<Promise> mGetConnectionListPromise;
- RefPtr<PresentationConnectionList> mConnectionList;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationReceiver_h
diff --git a/dom/presentation/PresentationRequest.cpp b/dom/presentation/PresentationRequest.cpp
deleted file mode 100644
index 221684e53..000000000
--- a/dom/presentation/PresentationRequest.cpp
+++ /dev/null
@@ -1,563 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "PresentationRequest.h"
-
-#include "AvailabilityCollection.h"
-#include "ControllerConnectionCollection.h"
-#include "mozilla/BasePrincipal.h"
-#include "mozilla/dom/Navigator.h"
-#include "mozilla/dom/PresentationRequestBinding.h"
-#include "mozilla/dom/PresentationConnectionAvailableEvent.h"
-#include "mozilla/dom/Promise.h"
-#include "mozilla/Move.h"
-#include "mozIThirdPartyUtil.h"
-#include "nsContentSecurityManager.h"
-#include "nsCycleCollectionParticipant.h"
-#include "nsGlobalWindow.h"
-#include "nsIDocument.h"
-#include "nsIPresentationService.h"
-#include "nsIURI.h"
-#include "nsIUUIDGenerator.h"
-#include "nsNetUtil.h"
-#include "nsSandboxFlags.h"
-#include "nsServiceManagerUtils.h"
-#include "Presentation.h"
-#include "PresentationAvailability.h"
-#include "PresentationCallbacks.h"
-#include "PresentationLog.h"
-#include "PresentationTransportBuilderConstructor.h"
-
-using namespace mozilla;
-using namespace mozilla::dom;
-
-NS_IMPL_ADDREF_INHERITED(PresentationRequest, DOMEventTargetHelper)
-NS_IMPL_RELEASE_INHERITED(PresentationRequest, DOMEventTargetHelper)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION_INHERITED(PresentationRequest)
-NS_INTERFACE_MAP_END_INHERITING(DOMEventTargetHelper)
-
-static nsresult
-GetAbsoluteURL(const nsAString& aUrl,
- nsIURI* aBaseUri,
- nsIDocument* aDocument,
- nsAString& aAbsoluteUrl)
-{
- nsCOMPtr<nsIURI> uri;
- nsresult rv = NS_NewURI(getter_AddRefs(uri),
- aUrl,
- aDocument ? aDocument->GetDocumentCharacterSet().get()
- : nullptr,
- aBaseUri);
-
- if (NS_FAILED(rv)) {
- return rv;
- }
-
- nsAutoCString spec;
- uri->GetSpec(spec);
-
- aAbsoluteUrl = NS_ConvertUTF8toUTF16(spec);
-
- return NS_OK;
-}
-
-/* static */ already_AddRefed<PresentationRequest>
-PresentationRequest::Constructor(const GlobalObject& aGlobal,
- const nsAString& aUrl,
- ErrorResult& aRv)
-{
- Sequence<nsString> urls;
- urls.AppendElement(aUrl, fallible);
- return Constructor(aGlobal, urls, aRv);
-}
-
-/* static */ already_AddRefed<PresentationRequest>
-PresentationRequest::Constructor(const GlobalObject& aGlobal,
- const Sequence<nsString>& aUrls,
- ErrorResult& aRv)
-{
- nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal.GetAsSupports());
- if (!window) {
- aRv.Throw(NS_ERROR_UNEXPECTED);
- return nullptr;
- }
-
- if (aUrls.IsEmpty()) {
- aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
- return nullptr;
- }
-
- // Resolve relative URL to absolute URL
- nsCOMPtr<nsIURI> baseUri = window->GetDocBaseURI();
- nsTArray<nsString> urls;
- for (const auto& url : aUrls) {
- nsAutoString absoluteUrl;
- nsresult rv =
- GetAbsoluteURL(url, baseUri, window->GetExtantDoc(), absoluteUrl);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- aRv.Throw(NS_ERROR_DOM_SYNTAX_ERR);
- return nullptr;
- }
-
- urls.AppendElement(absoluteUrl);
- }
-
- RefPtr<PresentationRequest> request =
- new PresentationRequest(window, Move(urls));
- return NS_WARN_IF(!request->Init()) ? nullptr : request.forget();
-}
-
-PresentationRequest::PresentationRequest(nsPIDOMWindowInner* aWindow,
- nsTArray<nsString>&& aUrls)
- : DOMEventTargetHelper(aWindow)
- , mUrls(Move(aUrls))
-{
-}
-
-PresentationRequest::~PresentationRequest()
-{
-}
-
-bool
-PresentationRequest::Init()
-{
- return true;
-}
-
-/* virtual */ JSObject*
-PresentationRequest::WrapObject(JSContext* aCx,
- JS::Handle<JSObject*> aGivenProto)
-{
- return PresentationRequestBinding::Wrap(aCx, this, aGivenProto);
-}
-
-already_AddRefed<Promise>
-PresentationRequest::Start(ErrorResult& aRv)
-{
- return StartWithDevice(NullString(), aRv);
-}
-
-already_AddRefed<Promise>
-PresentationRequest::StartWithDevice(const nsAString& aDeviceId,
- ErrorResult& aRv)
-{
- nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
- if (NS_WARN_IF(!global)) {
- aRv.Throw(NS_ERROR_UNEXPECTED);
- return nullptr;
- }
-
- // Get the origin.
- nsAutoString origin;
- nsresult rv = nsContentUtils::GetUTFOrigin(global->PrincipalOrNull(), origin);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- aRv.Throw(rv);
- return nullptr;
- }
-
- nsCOMPtr<nsIDocument> doc = GetOwner()->GetExtantDoc();
- if (NS_WARN_IF(!doc)) {
- aRv.Throw(NS_ERROR_FAILURE);
- return nullptr;
- }
-
- RefPtr<Promise> promise = Promise::Create(global, aRv);
- if (NS_WARN_IF(aRv.Failed())) {
- return nullptr;
- }
-
- if (IsProhibitMixedSecurityContexts(doc) &&
- !IsAllURLAuthenticated()) {
- promise->MaybeReject(NS_ERROR_DOM_SECURITY_ERR);
- return promise.forget();
- }
-
- if (doc->GetSandboxFlags() & SANDBOXED_PRESENTATION) {
- promise->MaybeReject(NS_ERROR_DOM_SECURITY_ERR);
- return promise.forget();
- }
-
- RefPtr<Navigator> navigator =
- nsGlobalWindow::Cast(GetOwner())->GetNavigator(aRv);
- if (NS_WARN_IF(aRv.Failed())) {
- return nullptr;
- }
-
- RefPtr<Presentation> presentation = navigator->GetPresentation(aRv);
- if (NS_WARN_IF(aRv.Failed())) {
- return nullptr;
- }
-
- if (presentation->IsStartSessionUnsettled()) {
- promise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);
- return promise.forget();
- }
-
- // Generate a session ID.
- nsCOMPtr<nsIUUIDGenerator> uuidgen =
- do_GetService("@mozilla.org/uuid-generator;1");
- if(NS_WARN_IF(!uuidgen)) {
- promise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);
- return promise.forget();
- }
-
- nsID uuid;
- uuidgen->GenerateUUIDInPlace(&uuid);
- char buffer[NSID_LENGTH];
- uuid.ToProvidedString(buffer);
- nsAutoString id;
- CopyASCIItoUTF16(buffer, id);
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if(NS_WARN_IF(!service)) {
- promise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);
- return promise.forget();
- }
-
- presentation->SetStartSessionUnsettled(true);
-
- // Get xul:browser element in parent process or nsWindowRoot object in child
- // process. If it's in child process, the corresponding xul:browser element
- // will be obtained at PresentationRequestParent::DoRequest in its parent
- // process.
- nsCOMPtr<nsIDOMEventTarget> handler =
- do_QueryInterface(GetOwner()->GetChromeEventHandler());
- nsCOMPtr<nsIPrincipal> principal = doc->NodePrincipal();
- nsCOMPtr<nsIPresentationServiceCallback> callback =
- new PresentationRequesterCallback(this, id, promise);
- nsCOMPtr<nsIPresentationTransportBuilderConstructor> constructor =
- PresentationTransportBuilderConstructor::Create();
- rv = service->StartSession(mUrls,
- id,
- origin,
- aDeviceId,
- GetOwner()->WindowID(),
- handler,
- principal,
- callback,
- constructor);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- promise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);
- NotifyPromiseSettled();
- }
-
- return promise.forget();
-}
-
-already_AddRefed<Promise>
-PresentationRequest::Reconnect(const nsAString& aPresentationId,
- ErrorResult& aRv)
-{
- nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
- if (NS_WARN_IF(!global)) {
- aRv.Throw(NS_ERROR_UNEXPECTED);
- return nullptr;
- }
-
- nsCOMPtr<nsIDocument> doc = GetOwner()->GetExtantDoc();
- if (NS_WARN_IF(!doc)) {
- aRv.Throw(NS_ERROR_FAILURE);
- return nullptr;
- }
-
- RefPtr<Promise> promise = Promise::Create(global, aRv);
- if (NS_WARN_IF(aRv.Failed())) {
- return nullptr;
- }
-
- if (IsProhibitMixedSecurityContexts(doc) &&
- !IsAllURLAuthenticated()) {
- promise->MaybeReject(NS_ERROR_DOM_SECURITY_ERR);
- return promise.forget();
- }
-
- if (doc->GetSandboxFlags() & SANDBOXED_PRESENTATION) {
- promise->MaybeReject(NS_ERROR_DOM_SECURITY_ERR);
- return promise.forget();
- }
-
- nsString presentationId = nsString(aPresentationId);
- nsCOMPtr<nsIRunnable> r =
- NewRunnableMethod<nsString, RefPtr<Promise>>(
- this,
- &PresentationRequest::FindOrCreatePresentationConnection,
- presentationId,
- promise);
-
- if (NS_WARN_IF(NS_FAILED(NS_DispatchToMainThread(r)))) {
- promise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- return promise.forget();
-}
-
-void
-PresentationRequest::FindOrCreatePresentationConnection(
- const nsAString& aPresentationId,
- Promise* aPromise)
-{
- MOZ_ASSERT(aPromise);
-
- if (NS_WARN_IF(!GetOwner())) {
- aPromise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
-
- RefPtr<PresentationConnection> connection =
- ControllerConnectionCollection::GetSingleton()->FindConnection(
- GetOwner()->WindowID(),
- aPresentationId,
- nsIPresentationService::ROLE_CONTROLLER);
-
- if (connection) {
- nsAutoString url;
- connection->GetUrl(url);
- if (mUrls.Contains(url)) {
- switch (connection->State()) {
- case PresentationConnectionState::Closed:
- // We found the matched connection.
- break;
- case PresentationConnectionState::Connecting:
- case PresentationConnectionState::Connected:
- aPromise->MaybeResolve(connection);
- return;
- case PresentationConnectionState::Terminated:
- // A terminated connection cannot be reused.
- connection = nullptr;
- break;
- default:
- MOZ_CRASH("Unknown presentation session state.");
- return;
- }
- } else {
- connection = nullptr;
- }
- }
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if(NS_WARN_IF(!service)) {
- aPromise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
-
- nsCOMPtr<nsIPresentationServiceCallback> callback =
- new PresentationReconnectCallback(this,
- aPresentationId,
- aPromise,
- connection);
-
- nsresult rv =
- service->ReconnectSession(mUrls,
- aPresentationId,
- nsIPresentationService::ROLE_CONTROLLER,
- callback);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- aPromise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);
- }
-}
-
-already_AddRefed<Promise>
-PresentationRequest::GetAvailability(ErrorResult& aRv)
-{
- PRES_DEBUG("%s\n", __func__);
- nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(GetOwner());
- if (NS_WARN_IF(!global)) {
- aRv.Throw(NS_ERROR_UNEXPECTED);
- return nullptr;
- }
-
- nsCOMPtr<nsIDocument> doc = GetOwner()->GetExtantDoc();
- if (NS_WARN_IF(!doc)) {
- aRv.Throw(NS_ERROR_FAILURE);
- return nullptr;
- }
-
- RefPtr<Promise> promise = Promise::Create(global, aRv);
- if (NS_WARN_IF(aRv.Failed())) {
- return nullptr;
- }
-
- if (IsProhibitMixedSecurityContexts(doc) &&
- !IsAllURLAuthenticated()) {
- promise->MaybeReject(NS_ERROR_DOM_SECURITY_ERR);
- return promise.forget();
- }
-
- if (doc->GetSandboxFlags() & SANDBOXED_PRESENTATION) {
- promise->MaybeReject(NS_ERROR_DOM_SECURITY_ERR);
- return promise.forget();
- }
-
- FindOrCreatePresentationAvailability(promise);
-
- return promise.forget();
-}
-
-void
-PresentationRequest::FindOrCreatePresentationAvailability(RefPtr<Promise>& aPromise)
-{
- MOZ_ASSERT(aPromise);
-
- if (NS_WARN_IF(!GetOwner())) {
- aPromise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
-
- AvailabilityCollection* collection = AvailabilityCollection::GetSingleton();
- if (NS_WARN_IF(!collection)) {
- aPromise->MaybeReject(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
-
- RefPtr<PresentationAvailability> availability =
- collection->Find(GetOwner()->WindowID(), mUrls);
-
- if (!availability) {
- availability = PresentationAvailability::Create(GetOwner(), mUrls, aPromise);
- } else {
- PRES_DEBUG(">resolve with same object\n");
-
- // Fetching cached available devices is asynchronous in our implementation,
- // we need to ensure the promise is resolved in order.
- if (availability->IsCachedValueReady()) {
- aPromise->MaybeResolve(availability);
- return;
- }
-
- availability->EnqueuePromise(aPromise);
- }
-
- if (!availability) {
- aPromise->MaybeReject(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
- return;
- }
-}
-
-nsresult
-PresentationRequest::DispatchConnectionAvailableEvent(PresentationConnection* aConnection)
-{
- PresentationConnectionAvailableEventInit init;
- init.mConnection = aConnection;
-
- RefPtr<PresentationConnectionAvailableEvent> event =
- PresentationConnectionAvailableEvent::Constructor(this,
- NS_LITERAL_STRING("connectionavailable"),
- init);
- if (NS_WARN_IF(!event)) {
- return NS_ERROR_FAILURE;
- }
- event->SetTrusted(true);
-
- RefPtr<AsyncEventDispatcher> asyncDispatcher =
- new AsyncEventDispatcher(this, event);
- return asyncDispatcher->PostDOMEvent();
-}
-
-void
-PresentationRequest::NotifyPromiseSettled()
-{
- PRES_DEBUG("%s\n", __func__);
-
- if (!GetOwner()) {
- return;
- }
-
- ErrorResult rv;
- RefPtr<Navigator> navigator =
- nsGlobalWindow::Cast(GetOwner())->GetNavigator(rv);
- if (!navigator) {
- return;
- }
-
- RefPtr<Presentation> presentation = navigator->GetPresentation(rv);
-
- if (presentation) {
- presentation->SetStartSessionUnsettled(false);
- }
-}
-
-bool
-PresentationRequest::IsProhibitMixedSecurityContexts(nsIDocument* aDocument)
-{
- MOZ_ASSERT(aDocument);
-
- if (nsContentUtils::IsChromeDoc(aDocument)) {
- return true;
- }
-
- nsCOMPtr<nsIDocument> doc = aDocument;
- while (doc && !nsContentUtils::IsChromeDoc(doc)) {
- if (nsContentUtils::HttpsStateIsModern(doc)) {
- return true;
- }
-
- doc = doc->GetParentDocument();
- }
-
- return false;
-}
-
-bool
-PresentationRequest::IsPrioriAuthenticatedURL(const nsAString& aUrl)
-{
- nsCOMPtr<nsIURI> uri;
- if (NS_FAILED(NS_NewURI(getter_AddRefs(uri), aUrl))) {
- return false;
- }
-
- nsAutoCString scheme;
- nsresult rv = uri->GetScheme(scheme);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return false;
- }
-
- if (scheme.EqualsLiteral("data")) {
- return true;
- }
-
- nsAutoCString uriSpec;
- rv = uri->GetSpec(uriSpec);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return false;
- }
-
- if (uriSpec.EqualsLiteral("about:blank") ||
- uriSpec.EqualsLiteral("about:srcdoc")) {
- return true;
- }
-
- PrincipalOriginAttributes attrs;
- nsCOMPtr<nsIPrincipal> principal =
- BasePrincipal::CreateCodebasePrincipal(uri, attrs);
- if (NS_WARN_IF(!principal)) {
- return false;
- }
-
- nsCOMPtr<nsIContentSecurityManager> csm =
- do_GetService(NS_CONTENTSECURITYMANAGER_CONTRACTID);
- if (NS_WARN_IF(!csm)) {
- return false;
- }
-
- bool isTrustworthyOrigin = false;
- csm->IsOriginPotentiallyTrustworthy(principal, &isTrustworthyOrigin);
- return isTrustworthyOrigin;
-}
-
-bool
-PresentationRequest::IsAllURLAuthenticated()
-{
- for (const auto& url : mUrls) {
- if (!IsPrioriAuthenticatedURL(url)) {
- return false;
- }
- }
-
- return true;
-}
diff --git a/dom/presentation/PresentationRequest.h b/dom/presentation/PresentationRequest.h
deleted file mode 100644
index ce82f2b44..000000000
--- a/dom/presentation/PresentationRequest.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationRequest_h
-#define mozilla_dom_PresentationRequest_h
-
-#include "mozilla/dom/BindingDeclarations.h"
-#include "mozilla/DOMEventTargetHelper.h"
-
-class nsIDocument;
-
-namespace mozilla {
-namespace dom {
-
-class Promise;
-class PresentationAvailability;
-class PresentationConnection;
-
-class PresentationRequest final : public DOMEventTargetHelper
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
-
- static already_AddRefed<PresentationRequest> Constructor(
- const GlobalObject& aGlobal,
- const nsAString& aUrl,
- ErrorResult& aRv);
-
- static already_AddRefed<PresentationRequest> Constructor(
- const GlobalObject& aGlobal,
- const Sequence<nsString>& aUrls,
- ErrorResult& aRv);
-
- virtual JSObject* WrapObject(JSContext* aCx,
- JS::Handle<JSObject*> aGivenProto) override;
-
- // WebIDL (public APIs)
- already_AddRefed<Promise> Start(ErrorResult& aRv);
-
- already_AddRefed<Promise> StartWithDevice(const nsAString& aDeviceId,
- ErrorResult& aRv);
-
- already_AddRefed<Promise> Reconnect(const nsAString& aPresentationId,
- ErrorResult& aRv);
-
- already_AddRefed<Promise> GetAvailability(ErrorResult& aRv);
-
- IMPL_EVENT_HANDLER(connectionavailable);
-
- nsresult DispatchConnectionAvailableEvent(PresentationConnection* aConnection);
-
- void NotifyPromiseSettled();
-
-private:
- PresentationRequest(nsPIDOMWindowInner* aWindow,
- nsTArray<nsString>&& aUrls);
-
- ~PresentationRequest();
-
- bool Init();
-
- void FindOrCreatePresentationConnection(const nsAString& aPresentationId,
- Promise* aPromise);
-
- void FindOrCreatePresentationAvailability(RefPtr<Promise>& aPromise);
-
- // Implement https://w3c.github.io/webappsec-mixed-content/#categorize-settings-object
- bool IsProhibitMixedSecurityContexts(nsIDocument* aDocument);
-
- // Implement https://w3c.github.io/webappsec-mixed-content/#a-priori-authenticated-url
- bool IsPrioriAuthenticatedURL(const nsAString& aUrl);
-
- bool IsAllURLAuthenticated();
-
- nsTArray<nsString> mUrls;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationRequest_h
diff --git a/dom/presentation/PresentationService.cpp b/dom/presentation/PresentationService.cpp
deleted file mode 100644
index bc525cdb8..000000000
--- a/dom/presentation/PresentationService.cpp
+++ /dev/null
@@ -1,1188 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "PresentationService.h"
-
-#include "ipc/PresentationIPCService.h"
-#include "mozilla/Services.h"
-#include "nsGlobalWindow.h"
-#include "nsIMutableArray.h"
-#include "nsIObserverService.h"
-#include "nsIPresentationControlChannel.h"
-#include "nsIPresentationDeviceManager.h"
-#include "nsIPresentationDevicePrompt.h"
-#include "nsIPresentationListener.h"
-#include "nsIPresentationRequestUIGlue.h"
-#include "nsIPresentationSessionRequest.h"
-#include "nsIPresentationTerminateRequest.h"
-#include "nsISupportsPrimitives.h"
-#include "nsNetUtil.h"
-#include "nsServiceManagerUtils.h"
-#include "nsThreadUtils.h"
-#include "nsXPCOMCID.h"
-#include "nsXULAppAPI.h"
-#include "PresentationLog.h"
-
-namespace mozilla {
-namespace dom {
-
-static bool
-IsSameDevice(nsIPresentationDevice* aDevice, nsIPresentationDevice* aDeviceAnother) {
- if (!aDevice || !aDeviceAnother) {
- return false;
- }
-
- nsAutoCString deviceId;
- aDevice->GetId(deviceId);
- nsAutoCString anotherId;
- aDeviceAnother->GetId(anotherId);
- if (!deviceId.Equals(anotherId)) {
- return false;
- }
-
- nsAutoCString deviceType;
- aDevice->GetType(deviceType);
- nsAutoCString anotherType;
- aDeviceAnother->GetType(anotherType);
- if (!deviceType.Equals(anotherType)) {
- return false;
- }
-
- return true;
-}
-
-static nsresult
-ConvertURLArrayHelper(const nsTArray<nsString>& aUrls, nsIArray** aResult)
-{
- if (!aResult) {
- return NS_ERROR_INVALID_POINTER;
- }
-
- *aResult = nullptr;
-
- nsresult rv;
- nsCOMPtr<nsIMutableArray> urls =
- do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- for (const auto& url : aUrls) {
- nsCOMPtr<nsISupportsString> isupportsString =
- do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- rv = isupportsString->SetData(url);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- rv = urls->AppendElement(isupportsString, false);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- }
-
- urls.forget(aResult);
- return NS_OK;
-}
-
-/*
- * Implementation of PresentationDeviceRequest
- */
-
-class PresentationDeviceRequest final : public nsIPresentationDeviceRequest
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONDEVICEREQUEST
-
- PresentationDeviceRequest(
- const nsTArray<nsString>& aUrls,
- const nsAString& aId,
- const nsAString& aOrigin,
- uint64_t aWindowId,
- nsIDOMEventTarget* aEventTarget,
- nsIPrincipal* aPrincipal,
- nsIPresentationServiceCallback* aCallback,
- nsIPresentationTransportBuilderConstructor* aBuilderConstructor);
-
-private:
- virtual ~PresentationDeviceRequest() = default;
- nsresult CreateSessionInfo(nsIPresentationDevice* aDevice,
- const nsAString& aSelectedRequestUrl);
-
- nsTArray<nsString> mRequestUrls;
- nsString mId;
- nsString mOrigin;
- uint64_t mWindowId;
- nsWeakPtr mChromeEventHandler;
- nsCOMPtr<nsIPrincipal> mPrincipal;
- nsCOMPtr<nsIPresentationServiceCallback> mCallback;
- nsCOMPtr<nsIPresentationTransportBuilderConstructor> mBuilderConstructor;
-};
-
-LazyLogModule gPresentationLog("Presentation");
-
-NS_IMPL_ISUPPORTS(PresentationDeviceRequest, nsIPresentationDeviceRequest)
-
-PresentationDeviceRequest::PresentationDeviceRequest(
- const nsTArray<nsString>& aUrls,
- const nsAString& aId,
- const nsAString& aOrigin,
- uint64_t aWindowId,
- nsIDOMEventTarget* aEventTarget,
- nsIPrincipal* aPrincipal,
- nsIPresentationServiceCallback* aCallback,
- nsIPresentationTransportBuilderConstructor* aBuilderConstructor)
- : mRequestUrls(aUrls)
- , mId(aId)
- , mOrigin(aOrigin)
- , mWindowId(aWindowId)
- , mChromeEventHandler(do_GetWeakReference(aEventTarget))
- , mPrincipal(aPrincipal)
- , mCallback(aCallback)
- , mBuilderConstructor(aBuilderConstructor)
-{
- MOZ_ASSERT(!mRequestUrls.IsEmpty());
- MOZ_ASSERT(!mId.IsEmpty());
- MOZ_ASSERT(!mOrigin.IsEmpty());
- MOZ_ASSERT(mCallback);
- MOZ_ASSERT(mBuilderConstructor);
-}
-
-NS_IMETHODIMP
-PresentationDeviceRequest::GetOrigin(nsAString& aOrigin)
-{
- aOrigin = mOrigin;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationDeviceRequest::GetRequestURLs(nsIArray** aUrls)
-{
- return ConvertURLArrayHelper(mRequestUrls, aUrls);
-}
-
-NS_IMETHODIMP
-PresentationDeviceRequest::GetChromeEventHandler(nsIDOMEventTarget** aChromeEventHandler)
-{
- nsCOMPtr<nsIDOMEventTarget> handler(do_QueryReferent(mChromeEventHandler));
- handler.forget(aChromeEventHandler);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationDeviceRequest::GetPrincipal(nsIPrincipal** aPrincipal)
-{
- nsCOMPtr<nsIPrincipal> principal(mPrincipal);
- principal.forget(aPrincipal);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationDeviceRequest::Select(nsIPresentationDevice* aDevice)
-{
- MOZ_ASSERT(NS_IsMainThread());
- if (NS_WARN_IF(!aDevice)) {
- MOZ_ASSERT(false, "|aDevice| should noe be null.");
- mCallback->NotifyError(NS_ERROR_DOM_OPERATION_ERR);
- return NS_ERROR_INVALID_ARG;
- }
-
- // Select the most suitable URL for starting the presentation.
- nsAutoString selectedRequestUrl;
- for (const auto& url : mRequestUrls) {
- bool isSupported;
- if (NS_SUCCEEDED(aDevice->IsRequestedUrlSupported(url, &isSupported)) &&
- isSupported) {
- selectedRequestUrl.Assign(url);
- break;
- }
- }
-
- if (selectedRequestUrl.IsEmpty()) {
- return mCallback->NotifyError(NS_ERROR_DOM_NOT_FOUND_ERR);
- }
-
- if (NS_WARN_IF(NS_FAILED(CreateSessionInfo(aDevice, selectedRequestUrl)))) {
- return mCallback->NotifyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- return mCallback->NotifySuccess(selectedRequestUrl);
-}
-
-nsresult
-PresentationDeviceRequest::CreateSessionInfo(
- nsIPresentationDevice* aDevice,
- const nsAString& aSelectedRequestUrl)
-{
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- // Create the controlling session info
- RefPtr<PresentationSessionInfo> info =
- static_cast<PresentationService*>(service.get())->
- CreateControllingSessionInfo(aSelectedRequestUrl, mId, mWindowId);
- if (NS_WARN_IF(!info)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- info->SetDevice(aDevice);
-
- // Establish a control channel. If we failed to do so, the callback is called
- // with an error message.
- nsCOMPtr<nsIPresentationControlChannel> ctrlChannel;
- nsresult rv = aDevice->EstablishControlChannel(getter_AddRefs(ctrlChannel));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return info->ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- // Initialize the session info with the control channel.
- rv = info->Init(ctrlChannel);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return info->ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- info->SetTransportBuilderConstructor(mBuilderConstructor);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationDeviceRequest::Cancel(nsresult aReason)
-{
- return mCallback->NotifyError(aReason);
-}
-
-/*
- * Implementation of PresentationService
- */
-
-NS_IMPL_ISUPPORTS(PresentationService,
- nsIPresentationService,
- nsIObserver)
-
-PresentationService::PresentationService()
-{
-}
-
-PresentationService::~PresentationService()
-{
- HandleShutdown();
-}
-
-bool
-PresentationService::Init()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
- if (NS_WARN_IF(!obs)) {
- return false;
- }
-
- nsresult rv = obs->AddObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID, false);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return false;
- }
- rv = obs->AddObserver(this, PRESENTATION_DEVICE_CHANGE_TOPIC, false);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return false;
- }
- rv = obs->AddObserver(this, PRESENTATION_SESSION_REQUEST_TOPIC, false);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return false;
- }
- rv = obs->AddObserver(this, PRESENTATION_TERMINATE_REQUEST_TOPIC, false);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return false;
- }
- rv = obs->AddObserver(this, PRESENTATION_RECONNECT_REQUEST_TOPIC, false);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return false;
- }
-
- return !NS_WARN_IF(NS_FAILED(rv));
-}
-
-NS_IMETHODIMP
-PresentationService::Observe(nsISupports* aSubject,
- const char* aTopic,
- const char16_t* aData)
-{
- if (!strcmp(aTopic, NS_XPCOM_SHUTDOWN_OBSERVER_ID)) {
- HandleShutdown();
- return NS_OK;
- } else if (!strcmp(aTopic, PRESENTATION_DEVICE_CHANGE_TOPIC)) {
- // Ignore the "update" case here, since we only care about the arrival and
- // removal of the device.
- if (!NS_strcmp(aData, u"add")) {
- nsCOMPtr<nsIPresentationDevice> device = do_QueryInterface(aSubject);
- if (NS_WARN_IF(!device)) {
- return NS_ERROR_FAILURE;
- }
-
- return HandleDeviceAdded(device);
- } else if(!NS_strcmp(aData, u"remove")) {
- return HandleDeviceRemoved();
- }
-
- return NS_OK;
- } else if (!strcmp(aTopic, PRESENTATION_SESSION_REQUEST_TOPIC)) {
- nsCOMPtr<nsIPresentationSessionRequest> request(do_QueryInterface(aSubject));
- if (NS_WARN_IF(!request)) {
- return NS_ERROR_FAILURE;
- }
-
- return HandleSessionRequest(request);
- } else if (!strcmp(aTopic, PRESENTATION_TERMINATE_REQUEST_TOPIC)) {
- nsCOMPtr<nsIPresentationTerminateRequest> request(do_QueryInterface(aSubject));
- if (NS_WARN_IF(!request)) {
- return NS_ERROR_FAILURE;
- }
-
- return HandleTerminateRequest(request);
- } else if (!strcmp(aTopic, PRESENTATION_RECONNECT_REQUEST_TOPIC)) {
- nsCOMPtr<nsIPresentationSessionRequest> request(do_QueryInterface(aSubject));
- if (NS_WARN_IF(!request)) {
- return NS_ERROR_FAILURE;
- }
-
- return HandleReconnectRequest(request);
- } else if (!strcmp(aTopic, "profile-after-change")) {
- // It's expected since we add and entry to |kLayoutCategories| in
- // |nsLayoutModule.cpp| to launch this service earlier.
- return NS_OK;
- }
-
- MOZ_ASSERT(false, "Unexpected topic for PresentationService");
- return NS_ERROR_UNEXPECTED;
-}
-
-void
-PresentationService::HandleShutdown()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- Shutdown();
-
- mAvailabilityManager.Clear();
- mSessionInfoAtController.Clear();
- mSessionInfoAtReceiver.Clear();
-
- nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
- if (obs) {
- obs->RemoveObserver(this, NS_XPCOM_SHUTDOWN_OBSERVER_ID);
- obs->RemoveObserver(this, PRESENTATION_DEVICE_CHANGE_TOPIC);
- obs->RemoveObserver(this, PRESENTATION_SESSION_REQUEST_TOPIC);
- obs->RemoveObserver(this, PRESENTATION_TERMINATE_REQUEST_TOPIC);
- obs->RemoveObserver(this, PRESENTATION_RECONNECT_REQUEST_TOPIC);
- }
-}
-
-nsresult
-PresentationService::HandleDeviceAdded(nsIPresentationDevice* aDevice)
-{
- PRES_DEBUG("%s\n", __func__);
- if (!aDevice) {
- MOZ_ASSERT(false, "aDevice shoud no be null.");
- return NS_ERROR_INVALID_ARG;
- }
-
- // Query for only unavailable URLs while device added.
- nsTArray<nsString> unavailableUrls;
- mAvailabilityManager.GetAvailbilityUrlByAvailability(unavailableUrls, false);
-
- nsTArray<nsString> supportedAvailabilityUrl;
- for (const auto& url : unavailableUrls) {
- bool isSupported;
- if (NS_SUCCEEDED(aDevice->IsRequestedUrlSupported(url, &isSupported)) &&
- isSupported) {
- supportedAvailabilityUrl.AppendElement(url);
- }
- }
-
- if (!supportedAvailabilityUrl.IsEmpty()) {
- return mAvailabilityManager.DoNotifyAvailableChange(supportedAvailabilityUrl,
- true);
- }
-
- return NS_OK;
-}
-
-nsresult
-PresentationService::HandleDeviceRemoved()
-{
- PRES_DEBUG("%s\n", __func__);
-
- // Query for only available URLs while device removed.
- nsTArray<nsString> availabilityUrls;
- mAvailabilityManager.GetAvailbilityUrlByAvailability(availabilityUrls, true);
-
- return UpdateAvailabilityUrlChange(availabilityUrls);
-}
-
-nsresult
-PresentationService::UpdateAvailabilityUrlChange(
- const nsTArray<nsString>& aAvailabilityUrls)
-{
- nsCOMPtr<nsIPresentationDeviceManager> deviceManager =
- do_GetService(PRESENTATION_DEVICE_MANAGER_CONTRACTID);
- if (NS_WARN_IF(!deviceManager)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- nsCOMPtr<nsIArray> devices;
- nsresult rv = deviceManager->GetAvailableDevices(nullptr,
- getter_AddRefs(devices));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- uint32_t numOfDevices;
- devices->GetLength(&numOfDevices);
-
- nsTArray<nsString> supportedAvailabilityUrl;
- for (const auto& url : aAvailabilityUrls) {
- for (uint32_t i = 0; i < numOfDevices; ++i) {
- nsCOMPtr<nsIPresentationDevice> device = do_QueryElementAt(devices, i);
- if (device) {
- bool isSupported;
- if (NS_SUCCEEDED(device->IsRequestedUrlSupported(url, &isSupported)) &&
- isSupported) {
- supportedAvailabilityUrl.AppendElement(url);
- break;
- }
- }
- }
- }
-
- if (supportedAvailabilityUrl.IsEmpty()) {
- return mAvailabilityManager.DoNotifyAvailableChange(aAvailabilityUrls,
- false);
- }
-
- return mAvailabilityManager.DoNotifyAvailableChange(supportedAvailabilityUrl,
- true);
-}
-
-nsresult
-PresentationService::HandleSessionRequest(nsIPresentationSessionRequest* aRequest)
-{
- nsCOMPtr<nsIPresentationControlChannel> ctrlChannel;
- nsresult rv = aRequest->GetControlChannel(getter_AddRefs(ctrlChannel));
- if (NS_WARN_IF(NS_FAILED(rv) || !ctrlChannel)) {
- return rv;
- }
-
- nsAutoString url;
- rv = aRequest->GetUrl(url);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- ctrlChannel->Disconnect(rv);
- return rv;
- }
-
- nsAutoString sessionId;
- rv = aRequest->GetPresentationId(sessionId);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- ctrlChannel->Disconnect(rv);
- return rv;
- }
-
- nsCOMPtr<nsIPresentationDevice> device;
- rv = aRequest->GetDevice(getter_AddRefs(device));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- ctrlChannel->Disconnect(rv);
- return rv;
- }
-
- // Create or reuse session info.
- RefPtr<PresentationSessionInfo> info =
- GetSessionInfo(sessionId, nsIPresentationService::ROLE_RECEIVER);
-
- // This is the case for reconnecting a session.
- // Update the control channel and device of the session info.
- // Call |NotifyResponderReady| to indicate the receiver page is already there.
- if (info) {
- PRES_DEBUG("handle reconnection:id[%s]\n",
- NS_ConvertUTF16toUTF8(sessionId).get());
-
- info->SetControlChannel(ctrlChannel);
- info->SetDevice(device);
- return static_cast<PresentationPresentingInfo*>(
- info.get())->DoReconnect();
- }
-
- // This is the case for a new session.
- PRES_DEBUG("handle new session:url[%d], id[%s]\n",
- NS_ConvertUTF16toUTF8(url).get(),
- NS_ConvertUTF16toUTF8(sessionId).get());
-
- info = new PresentationPresentingInfo(url, sessionId, device);
- rv = info->Init(ctrlChannel);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- ctrlChannel->Disconnect(rv);
- return rv;
- }
-
- mSessionInfoAtReceiver.Put(sessionId, info);
-
- // Notify the receiver to launch.
- nsCOMPtr<nsIPresentationRequestUIGlue> glue =
- do_CreateInstance(PRESENTATION_REQUEST_UI_GLUE_CONTRACTID);
- if (NS_WARN_IF(!glue)) {
- ctrlChannel->Disconnect(NS_ERROR_DOM_OPERATION_ERR);
- return info->ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
- nsCOMPtr<nsISupports> promise;
- rv = glue->SendRequest(url, sessionId, device, getter_AddRefs(promise));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- ctrlChannel->Disconnect(rv);
- return info->ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
- nsCOMPtr<Promise> realPromise = do_QueryInterface(promise);
- static_cast<PresentationPresentingInfo*>(info.get())->SetPromise(realPromise);
-
- return NS_OK;
-}
-
-nsresult
-PresentationService::HandleTerminateRequest(nsIPresentationTerminateRequest* aRequest)
-{
- nsCOMPtr<nsIPresentationControlChannel> ctrlChannel;
- nsresult rv = aRequest->GetControlChannel(getter_AddRefs(ctrlChannel));
- if (NS_WARN_IF(NS_FAILED(rv) || !ctrlChannel)) {
- return rv;
- }
-
- nsAutoString sessionId;
- rv = aRequest->GetPresentationId(sessionId);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- ctrlChannel->Disconnect(rv);
- return rv;
- }
-
- nsCOMPtr<nsIPresentationDevice> device;
- rv = aRequest->GetDevice(getter_AddRefs(device));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- ctrlChannel->Disconnect(rv);
- return rv;
- }
-
- bool isFromReceiver;
- rv = aRequest->GetIsFromReceiver(&isFromReceiver);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- ctrlChannel->Disconnect(rv);
- return rv;
- }
-
- RefPtr<PresentationSessionInfo> info;
- if (!isFromReceiver) {
- info = GetSessionInfo(sessionId, nsIPresentationService::ROLE_RECEIVER);
- } else {
- info = GetSessionInfo(sessionId, nsIPresentationService::ROLE_CONTROLLER);
- }
- if (NS_WARN_IF(!info)) {
- // Cannot terminate non-existed session.
- ctrlChannel->Disconnect(NS_ERROR_DOM_OPERATION_ERR);
- return NS_ERROR_DOM_ABORT_ERR;
- }
-
- // Check if terminate request comes from known device.
- RefPtr<nsIPresentationDevice> knownDevice = info->GetDevice();
- if (NS_WARN_IF(!IsSameDevice(device, knownDevice))) {
- ctrlChannel->Disconnect(NS_ERROR_DOM_OPERATION_ERR);
- return NS_ERROR_DOM_ABORT_ERR;
- }
-
- PRES_DEBUG("handle termination:id[%s], receiver[%d]\n", __func__,
- sessionId.get(), isFromReceiver);
-
- return info->OnTerminate(ctrlChannel);
-}
-
-nsresult
-PresentationService::HandleReconnectRequest(nsIPresentationSessionRequest* aRequest)
-{
- nsCOMPtr<nsIPresentationControlChannel> ctrlChannel;
- nsresult rv = aRequest->GetControlChannel(getter_AddRefs(ctrlChannel));
- if (NS_WARN_IF(NS_FAILED(rv) || !ctrlChannel)) {
- return rv;
- }
-
- nsAutoString sessionId;
- rv = aRequest->GetPresentationId(sessionId);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- ctrlChannel->Disconnect(rv);
- return rv;
- }
-
- uint64_t windowId;
- rv = GetWindowIdBySessionIdInternal(sessionId,
- nsIPresentationService::ROLE_RECEIVER,
- &windowId);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- ctrlChannel->Disconnect(rv);
- return rv;
- }
-
- RefPtr<PresentationSessionInfo> info =
- GetSessionInfo(sessionId, nsIPresentationService::ROLE_RECEIVER);
- if (NS_WARN_IF(!info)) {
- // Cannot reconnect non-existed session
- ctrlChannel->Disconnect(NS_ERROR_DOM_OPERATION_ERR);
- return NS_ERROR_DOM_ABORT_ERR;
- }
-
- nsAutoString url;
- rv = aRequest->GetUrl(url);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- ctrlChannel->Disconnect(rv);
- return rv;
- }
-
- // Make sure the url is the same as the previous one.
- if (NS_WARN_IF(!info->GetUrl().Equals(url))) {
- ctrlChannel->Disconnect(rv);
- return rv;
- }
-
- return HandleSessionRequest(aRequest);
-}
-
-NS_IMETHODIMP
-PresentationService::StartSession(
- const nsTArray<nsString>& aUrls,
- const nsAString& aSessionId,
- const nsAString& aOrigin,
- const nsAString& aDeviceId,
- uint64_t aWindowId,
- nsIDOMEventTarget* aEventTarget,
- nsIPrincipal* aPrincipal,
- nsIPresentationServiceCallback* aCallback,
- nsIPresentationTransportBuilderConstructor* aBuilderConstructor)
-{
- PRES_DEBUG("%s:id[%s]\n", __func__, NS_ConvertUTF16toUTF8(aSessionId).get());
-
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(aCallback);
- MOZ_ASSERT(!aSessionId.IsEmpty());
- MOZ_ASSERT(!aUrls.IsEmpty());
-
- nsCOMPtr<nsIPresentationDeviceRequest> request =
- new PresentationDeviceRequest(aUrls,
- aSessionId,
- aOrigin,
- aWindowId,
- aEventTarget,
- aPrincipal,
- aCallback,
- aBuilderConstructor);
-
- if (aDeviceId.IsVoid()) {
- // Pop up a prompt and ask user to select a device.
- nsCOMPtr<nsIPresentationDevicePrompt> prompt =
- do_GetService(PRESENTATION_DEVICE_PROMPT_CONTRACTID);
- if (NS_WARN_IF(!prompt)) {
- return aCallback->NotifyError(NS_ERROR_DOM_INVALID_ACCESS_ERR);
- }
-
- nsresult rv = prompt->PromptDeviceSelection(request);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return aCallback->NotifyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- return NS_OK;
- }
-
- // Find the designated device from available device list.
- nsCOMPtr<nsIPresentationDeviceManager> deviceManager =
- do_GetService(PRESENTATION_DEVICE_MANAGER_CONTRACTID);
- if (NS_WARN_IF(!deviceManager)) {
- return aCallback->NotifyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- nsCOMPtr<nsIArray> presentationUrls;
- if (NS_WARN_IF(NS_FAILED(
- ConvertURLArrayHelper(aUrls, getter_AddRefs(presentationUrls))))) {
- return aCallback->NotifyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- nsCOMPtr<nsIArray> devices;
- nsresult rv = deviceManager->GetAvailableDevices(presentationUrls, getter_AddRefs(devices));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return aCallback->NotifyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- nsCOMPtr<nsISimpleEnumerator> enumerator;
- rv = devices->Enumerate(getter_AddRefs(enumerator));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return aCallback->NotifyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- NS_ConvertUTF16toUTF8 utf8DeviceId(aDeviceId);
- bool hasMore;
- while (NS_SUCCEEDED(enumerator->HasMoreElements(&hasMore)) && hasMore) {
- nsCOMPtr<nsISupports> isupports;
- rv = enumerator->GetNext(getter_AddRefs(isupports));
-
- nsCOMPtr<nsIPresentationDevice> device(do_QueryInterface(isupports));
- MOZ_ASSERT(device);
-
- nsAutoCString id;
- if (NS_SUCCEEDED(device->GetId(id)) && id.Equals(utf8DeviceId)) {
- request->Select(device);
- return NS_OK;
- }
- }
-
- // Reject if designated device is not available.
- return aCallback->NotifyError(NS_ERROR_DOM_NOT_FOUND_ERR);
-}
-
-already_AddRefed<PresentationSessionInfo>
-PresentationService::CreateControllingSessionInfo(const nsAString& aUrl,
- const nsAString& aSessionId,
- uint64_t aWindowId)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (aSessionId.IsEmpty()) {
- return nullptr;
- }
-
- RefPtr<PresentationSessionInfo> info =
- new PresentationControllingInfo(aUrl, aSessionId);
-
- mSessionInfoAtController.Put(aSessionId, info);
- AddRespondingSessionId(aWindowId,
- aSessionId,
- nsIPresentationService::ROLE_CONTROLLER);
- return info.forget();
-}
-
-NS_IMETHODIMP
-PresentationService::SendSessionMessage(const nsAString& aSessionId,
- uint8_t aRole,
- const nsAString& aData)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(!aData.IsEmpty());
- MOZ_ASSERT(!aSessionId.IsEmpty());
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
-
- RefPtr<PresentationSessionInfo> info = GetSessionInfo(aSessionId, aRole);
- if (NS_WARN_IF(!info)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return info->Send(aData);
-}
-
-NS_IMETHODIMP
-PresentationService::SendSessionBinaryMsg(const nsAString& aSessionId,
- uint8_t aRole,
- const nsACString &aData)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(!aData.IsEmpty());
- MOZ_ASSERT(!aSessionId.IsEmpty());
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
-
- RefPtr<PresentationSessionInfo> info = GetSessionInfo(aSessionId, aRole);
- if (NS_WARN_IF(!info)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return info->SendBinaryMsg(aData);
-}
-
-NS_IMETHODIMP
-PresentationService::SendSessionBlob(const nsAString& aSessionId,
- uint8_t aRole,
- nsIDOMBlob* aBlob)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(!aSessionId.IsEmpty());
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
- MOZ_ASSERT(aBlob);
-
- RefPtr<PresentationSessionInfo> info = GetSessionInfo(aSessionId, aRole);
- if (NS_WARN_IF(!info)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return info->SendBlob(aBlob);
-}
-
-NS_IMETHODIMP
-PresentationService::CloseSession(const nsAString& aSessionId,
- uint8_t aRole,
- uint8_t aClosedReason)
-{
- PRES_DEBUG("%s:id[%s], reason[%x], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(aSessionId).get(), aClosedReason, aRole);
-
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(!aSessionId.IsEmpty());
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
-
- RefPtr<PresentationSessionInfo> info = GetSessionInfo(aSessionId, aRole);
- if (NS_WARN_IF(!info)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- if (aClosedReason == nsIPresentationService::CLOSED_REASON_WENTAWAY) {
- // Remove nsIPresentationSessionListener since we don't want to dispatch
- // PresentationConnectionCloseEvent if the page is went away.
- info->SetListener(nullptr);
- }
-
- return info->Close(NS_OK, nsIPresentationSessionListener::STATE_CLOSED);
-}
-
-NS_IMETHODIMP
-PresentationService::TerminateSession(const nsAString& aSessionId,
- uint8_t aRole)
-{
- PRES_DEBUG("%s:id[%s], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(aSessionId).get(), aRole);
-
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(!aSessionId.IsEmpty());
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
-
- RefPtr<PresentationSessionInfo> info = GetSessionInfo(aSessionId, aRole);
- if (NS_WARN_IF(!info)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return info->Close(NS_OK, nsIPresentationSessionListener::STATE_TERMINATED);
-}
-
-NS_IMETHODIMP
-PresentationService::ReconnectSession(const nsTArray<nsString>& aUrls,
- const nsAString& aSessionId,
- uint8_t aRole,
- nsIPresentationServiceCallback* aCallback)
-{
- PRES_DEBUG("%s:id[%s]\n", __func__, NS_ConvertUTF16toUTF8(aSessionId).get());
-
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(!aSessionId.IsEmpty());
- MOZ_ASSERT(aCallback);
- MOZ_ASSERT(!aUrls.IsEmpty());
-
- if (aRole != nsIPresentationService::ROLE_CONTROLLER) {
- MOZ_ASSERT(false, "Only controller can call ReconnectSession.");
- return NS_ERROR_INVALID_ARG;
- }
-
- if (NS_WARN_IF(!aCallback)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- RefPtr<PresentationSessionInfo> info = GetSessionInfo(aSessionId, aRole);
- if (NS_WARN_IF(!info)) {
- return aCallback->NotifyError(NS_ERROR_DOM_NOT_FOUND_ERR);
- }
-
- if (NS_WARN_IF(!aUrls.Contains(info->GetUrl()))) {
- return aCallback->NotifyError(NS_ERROR_DOM_NOT_FOUND_ERR);
- }
-
- return static_cast<PresentationControllingInfo*>(info.get())->Reconnect(aCallback);
-}
-
-NS_IMETHODIMP
-PresentationService::BuildTransport(const nsAString& aSessionId,
- uint8_t aRole)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(!aSessionId.IsEmpty());
-
- if (aRole != nsIPresentationService::ROLE_CONTROLLER) {
- MOZ_ASSERT(false, "Only controller can call BuildTransport.");
- return NS_ERROR_INVALID_ARG;
- }
-
- RefPtr<PresentationSessionInfo> info = GetSessionInfo(aSessionId, aRole);
- if (NS_WARN_IF(!info)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return static_cast<PresentationControllingInfo*>(info.get())->BuildTransport();
-}
-
-NS_IMETHODIMP
-PresentationService::RegisterAvailabilityListener(
- const nsTArray<nsString>& aAvailabilityUrls,
- nsIPresentationAvailabilityListener* aListener)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(!aAvailabilityUrls.IsEmpty());
- MOZ_ASSERT(aListener);
-
- mAvailabilityManager.AddAvailabilityListener(aAvailabilityUrls, aListener);
- return UpdateAvailabilityUrlChange(aAvailabilityUrls);
-}
-
-NS_IMETHODIMP
-PresentationService::UnregisterAvailabilityListener(
- const nsTArray<nsString>& aAvailabilityUrls,
- nsIPresentationAvailabilityListener* aListener)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- mAvailabilityManager.RemoveAvailabilityListener(aAvailabilityUrls, aListener);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationService::RegisterSessionListener(const nsAString& aSessionId,
- uint8_t aRole,
- nsIPresentationSessionListener* aListener)
-{
- PRES_DEBUG("%s:id[%s], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(aSessionId).get(), aRole);
-
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(aListener);
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
-
- RefPtr<PresentationSessionInfo> info = GetSessionInfo(aSessionId, aRole);
- if (NS_WARN_IF(!info)) {
- // Notify the listener of TERMINATED since no correspondent session info is
- // available possibly due to establishment failure. This would be useful at
- // the receiver side, since a presentation session is created at beginning
- // and here is the place to realize the underlying establishment fails.
- nsresult rv = aListener->NotifyStateChange(aSessionId,
- nsIPresentationSessionListener::STATE_TERMINATED,
- NS_ERROR_NOT_AVAILABLE);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return info->SetListener(aListener);
-}
-
-NS_IMETHODIMP
-PresentationService::UnregisterSessionListener(const nsAString& aSessionId,
- uint8_t aRole)
-{
- PRES_DEBUG("%s:id[%s], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(aSessionId).get(), aRole);
-
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
-
- RefPtr<PresentationSessionInfo> info = GetSessionInfo(aSessionId, aRole);
- if (info) {
- // When content side decide not handling this session anymore, simply
- // close the connection. Session info is kept for reconnection.
- Unused << NS_WARN_IF(NS_FAILED(info->Close(NS_OK, nsIPresentationSessionListener::STATE_CLOSED)));
- return info->SetListener(nullptr);
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationService::RegisterRespondingListener(
- uint64_t aWindowId,
- nsIPresentationRespondingListener* aListener)
-{
- PRES_DEBUG("%s:windowId[%lld]\n", __func__, aWindowId);
-
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(aListener);
-
- nsCOMPtr<nsIPresentationRespondingListener> listener;
- if (mRespondingListeners.Get(aWindowId, getter_AddRefs(listener))) {
- return (listener == aListener) ? NS_OK : NS_ERROR_DOM_INVALID_STATE_ERR;
- }
-
- nsTArray<nsString> sessionIdArray;
- nsresult rv = mReceiverSessionIdManager.GetSessionIds(aWindowId,
- sessionIdArray);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- for (const auto& id : sessionIdArray) {
- aListener->NotifySessionConnect(aWindowId, id);
- }
-
- mRespondingListeners.Put(aWindowId, aListener);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationService::UnregisterRespondingListener(uint64_t aWindowId)
-{
- PRES_DEBUG("%s:windowId[%lld]\n", __func__, aWindowId);
-
- MOZ_ASSERT(NS_IsMainThread());
-
- mRespondingListeners.Remove(aWindowId);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationService::NotifyReceiverReady(
- const nsAString& aSessionId,
- uint64_t aWindowId,
- bool aIsLoading,
- nsIPresentationTransportBuilderConstructor* aBuilderConstructor)
-{
- PRES_DEBUG("%s:id[%s], windowId[%lld], loading[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(aSessionId).get(), aWindowId, aIsLoading);
-
- RefPtr<PresentationSessionInfo> info =
- GetSessionInfo(aSessionId, nsIPresentationService::ROLE_RECEIVER);
- if (NS_WARN_IF(!info)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- AddRespondingSessionId(aWindowId,
- aSessionId,
- nsIPresentationService::ROLE_RECEIVER);
-
- if (!aIsLoading) {
- return static_cast<PresentationPresentingInfo*>(
- info.get())->NotifyResponderFailure();
- }
-
- nsCOMPtr<nsIPresentationRespondingListener> listener;
- if (mRespondingListeners.Get(aWindowId, getter_AddRefs(listener))) {
- nsresult rv = listener->NotifySessionConnect(aWindowId, aSessionId);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- }
-
- info->SetTransportBuilderConstructor(aBuilderConstructor);
- return static_cast<PresentationPresentingInfo*>(info.get())->NotifyResponderReady();
-}
-
-nsresult
-PresentationService::NotifyTransportClosed(const nsAString& aSessionId,
- uint8_t aRole,
- nsresult aReason)
-{
- PRES_DEBUG("%s:id[%s], reason[%x], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(aSessionId).get(), aReason, aRole);
-
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(!aSessionId.IsEmpty());
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
-
- RefPtr<PresentationSessionInfo> info = GetSessionInfo(aSessionId, aRole);
- if (NS_WARN_IF(!info)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return info->NotifyTransportClosed(aReason);
-}
-
-NS_IMETHODIMP
-PresentationService::UntrackSessionInfo(const nsAString& aSessionId,
- uint8_t aRole)
-{
- PRES_DEBUG("%s:id[%s], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(aSessionId).get(), aRole);
-
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
- // Remove the session info.
- if (nsIPresentationService::ROLE_CONTROLLER == aRole) {
- mSessionInfoAtController.Remove(aSessionId);
- } else {
- // Terminate receiver page.
- uint64_t windowId;
- nsresult rv = GetWindowIdBySessionIdInternal(aSessionId, aRole, &windowId);
- if (NS_SUCCEEDED(rv)) {
- NS_DispatchToMainThread(NS_NewRunnableFunction([windowId]() -> void {
- PRES_DEBUG("Attempt to close window[%d]\n", windowId);
-
- if (auto* window = nsGlobalWindow::GetInnerWindowWithId(windowId)) {
- window->Close();
- }
- }));
- }
-
- mSessionInfoAtReceiver.Remove(aSessionId);
- }
-
- // Remove the in-process responding info if there's still any.
- RemoveRespondingSessionId(aSessionId, aRole);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationService::GetWindowIdBySessionId(const nsAString& aSessionId,
- uint8_t aRole,
- uint64_t* aWindowId)
-{
- return GetWindowIdBySessionIdInternal(aSessionId, aRole, aWindowId);
-}
-
-NS_IMETHODIMP
-PresentationService::UpdateWindowIdBySessionId(const nsAString& aSessionId,
- uint8_t aRole,
- const uint64_t aWindowId)
-{
- return UpdateWindowIdBySessionIdInternal(aSessionId, aRole, aWindowId);
-}
-
-bool
-PresentationService::IsSessionAccessible(const nsAString& aSessionId,
- const uint8_t aRole,
- base::ProcessId aProcessId)
-{
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
- RefPtr<PresentationSessionInfo> info = GetSessionInfo(aSessionId, aRole);
- if (NS_WARN_IF(!info)) {
- return false;
- }
- return info->IsAccessible(aProcessId);
-}
-
-} // namespace dom
-} // namespace mozilla
-
-already_AddRefed<nsIPresentationService>
-NS_CreatePresentationService()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- nsCOMPtr<nsIPresentationService> service;
- if (XRE_GetProcessType() == GeckoProcessType_Content) {
- service = new mozilla::dom::PresentationIPCService();
- } else {
- service = new PresentationService();
- if (NS_WARN_IF(!static_cast<PresentationService*>(service.get())->Init())) {
- return nullptr;
- }
- }
-
- return service.forget();
-}
diff --git a/dom/presentation/PresentationService.h b/dom/presentation/PresentationService.h
deleted file mode 100644
index b2d39e691..000000000
--- a/dom/presentation/PresentationService.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationService_h
-#define mozilla_dom_PresentationService_h
-
-#include "nsCOMPtr.h"
-#include "nsIObserver.h"
-#include "PresentationServiceBase.h"
-#include "PresentationSessionInfo.h"
-
-class nsIPresentationSessionRequest;
-class nsIPresentationTerminateRequest;
-class nsIURI;
-class nsIPresentationSessionTransportBuilder;
-
-namespace mozilla {
-namespace dom {
-
-class PresentationDeviceRequest;
-class PresentationRespondingInfo;
-
-class PresentationService final
- : public nsIPresentationService
- , public nsIObserver
- , public PresentationServiceBase<PresentationSessionInfo>
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIOBSERVER
- NS_DECL_NSIPRESENTATIONSERVICE
-
- PresentationService();
- bool Init();
-
- bool IsSessionAccessible(const nsAString& aSessionId,
- const uint8_t aRole,
- base::ProcessId aProcessId);
-
-private:
- friend class PresentationDeviceRequest;
-
- virtual ~PresentationService();
- void HandleShutdown();
- nsresult HandleDeviceAdded(nsIPresentationDevice* aDevice);
- nsresult HandleDeviceRemoved();
- nsresult HandleSessionRequest(nsIPresentationSessionRequest* aRequest);
- nsresult HandleTerminateRequest(nsIPresentationTerminateRequest* aRequest);
- nsresult HandleReconnectRequest(nsIPresentationSessionRequest* aRequest);
-
- // This is meant to be called by PresentationDeviceRequest.
- already_AddRefed<PresentationSessionInfo>
- CreateControllingSessionInfo(const nsAString& aUrl,
- const nsAString& aSessionId,
- uint64_t aWindowId);
-
- // Emumerate all devices to get the availability of each input Urls.
- nsresult UpdateAvailabilityUrlChange(
- const nsTArray<nsString>& aAvailabilityUrls);
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationService_h
diff --git a/dom/presentation/PresentationServiceBase.h b/dom/presentation/PresentationServiceBase.h
deleted file mode 100644
index 227e95430..000000000
--- a/dom/presentation/PresentationServiceBase.h
+++ /dev/null
@@ -1,401 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et ft=cpp : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationServiceBase_h
-#define mozilla_dom_PresentationServiceBase_h
-
-#include "mozilla/Unused.h"
-#include "nsClassHashtable.h"
-#include "nsCOMArray.h"
-#include "nsIPresentationListener.h"
-#include "nsIPresentationService.h"
-#include "nsRefPtrHashtable.h"
-#include "nsString.h"
-#include "nsTArray.h"
-
-namespace mozilla {
-namespace dom {
-
-template<class T>
-class PresentationServiceBase
-{
-public:
- PresentationServiceBase() = default;
-
- already_AddRefed<T>
- GetSessionInfo(const nsAString& aSessionId, const uint8_t aRole)
- {
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
-
- RefPtr<T> info;
- if (aRole == nsIPresentationService::ROLE_CONTROLLER) {
- return mSessionInfoAtController.Get(aSessionId, getter_AddRefs(info)) ?
- info.forget() : nullptr;
- } else {
- return mSessionInfoAtReceiver.Get(aSessionId, getter_AddRefs(info)) ?
- info.forget() : nullptr;
- }
- }
-
-protected:
- class SessionIdManager final
- {
- public:
- explicit SessionIdManager()
- {
- MOZ_COUNT_CTOR(SessionIdManager);
- }
-
- ~SessionIdManager()
- {
- MOZ_COUNT_DTOR(SessionIdManager);
- }
-
- nsresult GetWindowId(const nsAString& aSessionId, uint64_t* aWindowId)
- {
- MOZ_ASSERT(NS_IsMainThread());
-
- if (mRespondingWindowIds.Get(aSessionId, aWindowId)) {
- return NS_OK;
- }
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- nsresult GetSessionIds(uint64_t aWindowId, nsTArray<nsString>& aSessionIds)
- {
- MOZ_ASSERT(NS_IsMainThread());
-
- nsTArray<nsString>* sessionIdArray;
- if (!mRespondingSessionIds.Get(aWindowId, &sessionIdArray)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- aSessionIds.Assign(*sessionIdArray);
- return NS_OK;
- }
-
- void AddSessionId(uint64_t aWindowId, const nsAString& aSessionId)
- {
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(aWindowId == 0)) {
- return;
- }
-
- nsTArray<nsString>* sessionIdArray;
- if (!mRespondingSessionIds.Get(aWindowId, &sessionIdArray)) {
- sessionIdArray = new nsTArray<nsString>();
- mRespondingSessionIds.Put(aWindowId, sessionIdArray);
- }
-
- sessionIdArray->AppendElement(nsString(aSessionId));
- mRespondingWindowIds.Put(aSessionId, aWindowId);
- }
-
- void RemoveSessionId(const nsAString& aSessionId)
- {
- MOZ_ASSERT(NS_IsMainThread());
-
- uint64_t windowId = 0;
- if (mRespondingWindowIds.Get(aSessionId, &windowId)) {
- mRespondingWindowIds.Remove(aSessionId);
- nsTArray<nsString>* sessionIdArray;
- if (mRespondingSessionIds.Get(windowId, &sessionIdArray)) {
- sessionIdArray->RemoveElement(nsString(aSessionId));
- if (sessionIdArray->IsEmpty()) {
- mRespondingSessionIds.Remove(windowId);
- }
- }
- }
- }
-
- nsresult UpdateWindowId(const nsAString& aSessionId, const uint64_t aWindowId)
- {
- MOZ_ASSERT(NS_IsMainThread());
-
- RemoveSessionId(aSessionId);
- AddSessionId(aWindowId, aSessionId);
- return NS_OK;
- }
-
- void Clear()
- {
- mRespondingSessionIds.Clear();
- mRespondingWindowIds.Clear();
- }
-
- private:
- nsClassHashtable<nsUint64HashKey, nsTArray<nsString>> mRespondingSessionIds;
- nsDataHashtable<nsStringHashKey, uint64_t> mRespondingWindowIds;
- };
-
- class AvailabilityManager final
- {
- public:
- explicit AvailabilityManager()
- {
- MOZ_COUNT_CTOR(AvailabilityManager);
- }
-
- ~AvailabilityManager()
- {
- MOZ_COUNT_DTOR(AvailabilityManager);
- }
-
- void AddAvailabilityListener(
- const nsTArray<nsString>& aAvailabilityUrls,
- nsIPresentationAvailabilityListener* aListener)
- {
- nsTArray<nsString> dummy;
- AddAvailabilityListener(aAvailabilityUrls, aListener, dummy);
- }
-
- void AddAvailabilityListener(
- const nsTArray<nsString>& aAvailabilityUrls,
- nsIPresentationAvailabilityListener* aListener,
- nsTArray<nsString>& aAddedUrls)
- {
- if (!aListener) {
- MOZ_ASSERT(false, "aListener should not be null.");
- return;
- }
-
- if (aAvailabilityUrls.IsEmpty()) {
- MOZ_ASSERT(false, "aAvailabilityUrls should not be empty.");
- return;
- }
-
- aAddedUrls.Clear();
- nsTArray<nsString> knownAvailableUrls;
- for (const auto& url : aAvailabilityUrls) {
- AvailabilityEntry* entry;
- if (!mAvailabilityUrlTable.Get(url, &entry)) {
- entry = new AvailabilityEntry();
- mAvailabilityUrlTable.Put(url, entry);
- aAddedUrls.AppendElement(url);
- }
- if (!entry->mListeners.Contains(aListener)) {
- entry->mListeners.AppendElement(aListener);
- }
- if (entry->mAvailable) {
- knownAvailableUrls.AppendElement(url);
- }
- }
-
- if (!knownAvailableUrls.IsEmpty()) {
- Unused <<
- NS_WARN_IF(
- NS_FAILED(aListener->NotifyAvailableChange(knownAvailableUrls,
- true)));
- } else {
- // If we can't find any known available url and there is no newly
- // added url, we still need to notify the listener of the result.
- // So, the promise returned by |getAvailability| can be resolved.
- if (aAddedUrls.IsEmpty()) {
- Unused <<
- NS_WARN_IF(
- NS_FAILED(aListener->NotifyAvailableChange(aAvailabilityUrls,
- false)));
- }
- }
- }
-
- void RemoveAvailabilityListener(
- const nsTArray<nsString>& aAvailabilityUrls,
- nsIPresentationAvailabilityListener* aListener)
- {
- nsTArray<nsString> dummy;
- RemoveAvailabilityListener(aAvailabilityUrls, aListener, dummy);
- }
-
- void RemoveAvailabilityListener(
- const nsTArray<nsString>& aAvailabilityUrls,
- nsIPresentationAvailabilityListener* aListener,
- nsTArray<nsString>& aRemovedUrls)
- {
- if (!aListener) {
- MOZ_ASSERT(false, "aListener should not be null.");
- return;
- }
-
- if (aAvailabilityUrls.IsEmpty()) {
- MOZ_ASSERT(false, "aAvailabilityUrls should not be empty.");
- return;
- }
-
- aRemovedUrls.Clear();
- for (const auto& url : aAvailabilityUrls) {
- AvailabilityEntry* entry;
- if (mAvailabilityUrlTable.Get(url, &entry)) {
- entry->mListeners.RemoveElement(aListener);
- if (entry->mListeners.IsEmpty()) {
- mAvailabilityUrlTable.Remove(url);
- aRemovedUrls.AppendElement(url);
- }
- }
- }
- }
-
- nsresult DoNotifyAvailableChange(const nsTArray<nsString>& aAvailabilityUrls,
- bool aAvailable)
- {
- typedef nsClassHashtable<nsISupportsHashKey,
- nsTArray<nsString>> ListenerToUrlsMap;
- ListenerToUrlsMap availabilityListenerTable;
- // Create a mapping from nsIPresentationAvailabilityListener to
- // availabilityUrls.
- for (auto it = mAvailabilityUrlTable.ConstIter(); !it.Done(); it.Next()) {
- if (aAvailabilityUrls.Contains(it.Key())) {
- AvailabilityEntry* entry = it.UserData();
- entry->mAvailable = aAvailable;
-
- for (uint32_t i = 0; i < entry->mListeners.Length(); ++i) {
- nsIPresentationAvailabilityListener* listener =
- entry->mListeners.ObjectAt(i);
- nsTArray<nsString>* urlArray;
- if (!availabilityListenerTable.Get(listener, &urlArray)) {
- urlArray = new nsTArray<nsString>();
- availabilityListenerTable.Put(listener, urlArray);
- }
- urlArray->AppendElement(it.Key());
- }
- }
- }
-
- for (auto it = availabilityListenerTable.Iter(); !it.Done(); it.Next()) {
- auto listener =
- static_cast<nsIPresentationAvailabilityListener*>(it.Key());
-
- Unused <<
- NS_WARN_IF(NS_FAILED(listener->NotifyAvailableChange(*it.UserData(),
- aAvailable)));
- }
- return NS_OK;
- }
-
- void GetAvailbilityUrlByAvailability(nsTArray<nsString>& aOutArray,
- bool aAvailable)
- {
- aOutArray.Clear();
-
- for (auto it = mAvailabilityUrlTable.ConstIter(); !it.Done(); it.Next()) {
- if (it.UserData()->mAvailable == aAvailable) {
- aOutArray.AppendElement(it.Key());
- }
- }
- }
-
- void Clear()
- {
- mAvailabilityUrlTable.Clear();
- }
-
- private:
- struct AvailabilityEntry
- {
- explicit AvailabilityEntry()
- : mAvailable(false)
- {}
-
- bool mAvailable;
- nsCOMArray<nsIPresentationAvailabilityListener> mListeners;
- };
-
- nsClassHashtable<nsStringHashKey, AvailabilityEntry> mAvailabilityUrlTable;
- };
-
- virtual ~PresentationServiceBase() = default;
-
- void Shutdown()
- {
- mRespondingListeners.Clear();
- mControllerSessionIdManager.Clear();
- mReceiverSessionIdManager.Clear();
- }
-
- nsresult GetWindowIdBySessionIdInternal(const nsAString& aSessionId,
- uint8_t aRole,
- uint64_t* aWindowId)
- {
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
-
- if (NS_WARN_IF(!aWindowId)) {
- return NS_ERROR_INVALID_POINTER;
- }
-
- if (aRole == nsIPresentationService::ROLE_CONTROLLER) {
- return mControllerSessionIdManager.GetWindowId(aSessionId, aWindowId);
- }
-
- return mReceiverSessionIdManager.GetWindowId(aSessionId, aWindowId);
- }
-
- void AddRespondingSessionId(uint64_t aWindowId,
- const nsAString& aSessionId,
- uint8_t aRole)
- {
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
-
- if (aRole == nsIPresentationService::ROLE_CONTROLLER) {
- mControllerSessionIdManager.AddSessionId(aWindowId, aSessionId);
- } else {
- mReceiverSessionIdManager.AddSessionId(aWindowId, aSessionId);
- }
- }
-
- void RemoveRespondingSessionId(const nsAString& aSessionId,
- uint8_t aRole)
- {
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
-
- if (aRole == nsIPresentationService::ROLE_CONTROLLER) {
- mControllerSessionIdManager.RemoveSessionId(aSessionId);
- } else {
- mReceiverSessionIdManager.RemoveSessionId(aSessionId);
- }
- }
-
- nsresult UpdateWindowIdBySessionIdInternal(const nsAString& aSessionId,
- uint8_t aRole,
- const uint64_t aWindowId)
- {
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
-
- if (aRole == nsIPresentationService::ROLE_CONTROLLER) {
- return mControllerSessionIdManager.UpdateWindowId(aSessionId, aWindowId);
- }
-
- return mReceiverSessionIdManager.UpdateWindowId(aSessionId, aWindowId);
- }
-
- // Store the responding listener based on the window ID of the (in-process or
- // OOP) receiver page.
- nsRefPtrHashtable<nsUint64HashKey, nsIPresentationRespondingListener>
- mRespondingListeners;
-
- // Store the mapping between the window ID of the in-process and OOP page and the ID
- // of the responding session. It's used for both controller and receiver page
- // to retrieve the correspondent session ID. Besides, also keep the mapping
- // between the responding session ID and the window ID to help look up the
- // window ID.
- SessionIdManager mControllerSessionIdManager;
- SessionIdManager mReceiverSessionIdManager;
-
- nsRefPtrHashtable<nsStringHashKey, T> mSessionInfoAtController;
- nsRefPtrHashtable<nsStringHashKey, T> mSessionInfoAtReceiver;
-
- AvailabilityManager mAvailabilityManager;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationServiceBase_h
diff --git a/dom/presentation/PresentationSessionInfo.cpp b/dom/presentation/PresentationSessionInfo.cpp
deleted file mode 100644
index 1dd92ab69..000000000
--- a/dom/presentation/PresentationSessionInfo.cpp
+++ /dev/null
@@ -1,1617 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/ContentParent.h"
-#include "mozilla/dom/HTMLIFrameElementBinding.h"
-#include "mozilla/dom/TabParent.h"
-#include "mozilla/Function.h"
-#include "mozilla/Logging.h"
-#include "mozilla/Move.h"
-#include "mozilla/Preferences.h"
-#include "mozilla/Services.h"
-#include "nsContentUtils.h"
-#include "nsGlobalWindow.h"
-#include "nsIDocShell.h"
-#include "nsFrameLoader.h"
-#include "nsIMutableArray.h"
-#include "nsINetAddr.h"
-#include "nsISocketTransport.h"
-#include "nsISupportsPrimitives.h"
-#include "nsNetCID.h"
-#include "nsServiceManagerUtils.h"
-#include "nsThreadUtils.h"
-#include "PresentationLog.h"
-#include "PresentationService.h"
-#include "PresentationSessionInfo.h"
-
-#ifdef MOZ_WIDGET_ANDROID
-#include "nsIPresentationNetworkHelper.h"
-#endif // MOZ_WIDGET_ANDROID
-
-using namespace mozilla;
-using namespace mozilla::dom;
-using namespace mozilla::services;
-
-/*
- * Implementation of PresentationChannelDescription
- */
-
-namespace mozilla {
-namespace dom {
-
-#ifdef MOZ_WIDGET_ANDROID
-
-namespace {
-
-class PresentationNetworkHelper final : public nsIPresentationNetworkHelperListener
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONNETWORKHELPERLISTENER
-
- using Function = nsresult(PresentationControllingInfo::*)(const nsACString&);
-
- explicit PresentationNetworkHelper(PresentationControllingInfo* aInfo,
- const Function& aFunc);
-
- nsresult GetWifiIPAddress();
-
-private:
- ~PresentationNetworkHelper() = default;
-
- RefPtr<PresentationControllingInfo> mInfo;
- Function mFunc;
-};
-
-NS_IMPL_ISUPPORTS(PresentationNetworkHelper,
- nsIPresentationNetworkHelperListener)
-
-PresentationNetworkHelper::PresentationNetworkHelper(PresentationControllingInfo* aInfo,
- const Function& aFunc)
- : mInfo(aInfo)
- , mFunc(aFunc)
-{
- MOZ_ASSERT(aInfo);
- MOZ_ASSERT(aFunc);
-}
-
-nsresult
-PresentationNetworkHelper::GetWifiIPAddress()
-{
- nsresult rv;
-
- nsCOMPtr<nsIPresentationNetworkHelper> networkHelper =
- do_GetService(PRESENTATION_NETWORK_HELPER_CONTRACTID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return networkHelper->GetWifiIPAddress(this);
-}
-
-NS_IMETHODIMP
-PresentationNetworkHelper::OnError(const nsACString & aReason)
-{
- PRES_ERROR("PresentationNetworkHelper::OnError: %s",
- nsPromiseFlatCString(aReason).get());
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationNetworkHelper::OnGetWifiIPAddress(const nsACString& aIPAddress)
-{
- MOZ_ASSERT(mInfo);
- MOZ_ASSERT(mFunc);
-
- NS_DispatchToMainThread(
- NewRunnableMethod<nsCString>(mInfo,
- mFunc,
- aIPAddress));
- return NS_OK;
-}
-
-} // anonymous namespace
-
-#endif // MOZ_WIDGET_ANDROID
-
-class TCPPresentationChannelDescription final : public nsIPresentationChannelDescription
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONCHANNELDESCRIPTION
-
- TCPPresentationChannelDescription(const nsACString& aAddress,
- uint16_t aPort)
- : mAddress(aAddress)
- , mPort(aPort)
- {
- }
-
-private:
- ~TCPPresentationChannelDescription() {}
-
- nsCString mAddress;
- uint16_t mPort;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-NS_IMPL_ISUPPORTS(TCPPresentationChannelDescription, nsIPresentationChannelDescription)
-
-NS_IMETHODIMP
-TCPPresentationChannelDescription::GetType(uint8_t* aRetVal)
-{
- if (NS_WARN_IF(!aRetVal)) {
- return NS_ERROR_INVALID_POINTER;
- }
-
- *aRetVal = nsIPresentationChannelDescription::TYPE_TCP;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-TCPPresentationChannelDescription::GetTcpAddress(nsIArray** aRetVal)
-{
- if (NS_WARN_IF(!aRetVal)) {
- return NS_ERROR_INVALID_POINTER;
- }
-
- nsCOMPtr<nsIMutableArray> array = do_CreateInstance(NS_ARRAY_CONTRACTID);
- if (NS_WARN_IF(!array)) {
- return NS_ERROR_OUT_OF_MEMORY;
- }
-
- // TODO bug 1228504 Take all IP addresses in PresentationChannelDescription
- // into account. And at the first stage Presentation API is only exposed on
- // Firefox OS where the first IP appears enough for most scenarios.
- nsCOMPtr<nsISupportsCString> address = do_CreateInstance(NS_SUPPORTS_CSTRING_CONTRACTID);
- if (NS_WARN_IF(!address)) {
- return NS_ERROR_OUT_OF_MEMORY;
- }
- address->SetData(mAddress);
-
- array->AppendElement(address, false);
- array.forget(aRetVal);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-TCPPresentationChannelDescription::GetTcpPort(uint16_t* aRetVal)
-{
- if (NS_WARN_IF(!aRetVal)) {
- return NS_ERROR_INVALID_POINTER;
- }
-
- *aRetVal = mPort;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-TCPPresentationChannelDescription::GetDataChannelSDP(nsAString& aDataChannelSDP)
-{
- aDataChannelSDP.Truncate();
- return NS_OK;
-}
-
-/*
- * Implementation of PresentationSessionInfo
- */
-
-NS_IMPL_ISUPPORTS(PresentationSessionInfo,
- nsIPresentationSessionTransportCallback,
- nsIPresentationControlChannelListener,
- nsIPresentationSessionTransportBuilderListener);
-
-/* virtual */ nsresult
-PresentationSessionInfo::Init(nsIPresentationControlChannel* aControlChannel)
-{
- SetControlChannel(aControlChannel);
- return NS_OK;
-}
-
-/* virtual */ void
-PresentationSessionInfo::Shutdown(nsresult aReason)
-{
- PRES_DEBUG("%s:id[%s], reason[%x], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), aReason, mRole);
-
- NS_WARNING_ASSERTION(NS_SUCCEEDED(aReason), "bad reason");
-
- // Close the control channel if any.
- if (mControlChannel) {
- Unused << NS_WARN_IF(NS_FAILED(mControlChannel->Disconnect(aReason)));
- }
-
- // Close the data transport channel if any.
- if (mTransport) {
- // |mIsTransportReady| will be unset once |NotifyTransportClosed| is called.
- Unused << NS_WARN_IF(NS_FAILED(mTransport->Close(aReason)));
- }
-
- mIsResponderReady = false;
- mIsOnTerminating = false;
-
- ResetBuilder();
-}
-
-nsresult
-PresentationSessionInfo::SetListener(nsIPresentationSessionListener* aListener)
-{
- mListener = aListener;
-
- if (mListener) {
- // Enable data notification for the transport channel if it's available.
- if (mTransport) {
- nsresult rv = mTransport->EnableDataNotification();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- }
-
- // The transport might become ready, or might become un-ready again, before
- // the listener has registered. So notify the listener of the state change.
- return mListener->NotifyStateChange(mSessionId, mState, mReason);
- }
-
- return NS_OK;
-}
-
-nsresult
-PresentationSessionInfo::Send(const nsAString& aData)
-{
- if (NS_WARN_IF(!IsSessionReady())) {
- return NS_ERROR_DOM_INVALID_STATE_ERR;
- }
-
- if (NS_WARN_IF(!mTransport)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return mTransport->Send(aData);
-}
-
-nsresult
-PresentationSessionInfo::SendBinaryMsg(const nsACString& aData)
-{
- if (NS_WARN_IF(!IsSessionReady())) {
- return NS_ERROR_DOM_INVALID_STATE_ERR;
- }
-
- if (NS_WARN_IF(!mTransport)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return mTransport->SendBinaryMsg(aData);
-}
-
-nsresult
-PresentationSessionInfo::SendBlob(nsIDOMBlob* aBlob)
-{
- if (NS_WARN_IF(!IsSessionReady())) {
- return NS_ERROR_DOM_INVALID_STATE_ERR;
- }
-
- if (NS_WARN_IF(!mTransport)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return mTransport->SendBlob(aBlob);
-}
-
-nsresult
-PresentationSessionInfo::Close(nsresult aReason,
- uint32_t aState)
-{
- // Do nothing if session is already terminated.
- if (nsIPresentationSessionListener::STATE_TERMINATED == mState) {
- return NS_OK;
- }
-
- SetStateWithReason(aState, aReason);
-
- switch (aState) {
- case nsIPresentationSessionListener::STATE_CLOSED: {
- Shutdown(aReason);
- break;
- }
- case nsIPresentationSessionListener::STATE_TERMINATED: {
- if (!mControlChannel) {
- nsCOMPtr<nsIPresentationControlChannel> ctrlChannel;
- nsresult rv = mDevice->EstablishControlChannel(getter_AddRefs(ctrlChannel));
- if (NS_FAILED(rv)) {
- Shutdown(rv);
- return rv;
- }
-
- SetControlChannel(ctrlChannel);
- return rv;
- }
-
- ContinueTermination();
- return NS_OK;
- }
- }
-
- return NS_OK;
-}
-
-nsresult
-PresentationSessionInfo::OnTerminate(nsIPresentationControlChannel* aControlChannel)
-{
- mIsOnTerminating = true; // Mark for terminating transport channel
- SetStateWithReason(nsIPresentationSessionListener::STATE_TERMINATED, NS_OK);
- SetControlChannel(aControlChannel);
-
- return NS_OK;
-}
-
-nsresult
-PresentationSessionInfo::ReplySuccess()
-{
- SetStateWithReason(nsIPresentationSessionListener::STATE_CONNECTED, NS_OK);
- return NS_OK;
-}
-
-nsresult
-PresentationSessionInfo::ReplyError(nsresult aError)
-{
- Shutdown(aError);
-
- // Remove itself since it never succeeds.
- return UntrackFromService();
-}
-
-/* virtual */ nsresult
-PresentationSessionInfo::UntrackFromService()
-{
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- static_cast<PresentationService*>(service.get())->UntrackSessionInfo(mSessionId, mRole);
-
- return NS_OK;
-}
-
-nsPIDOMWindowInner*
-PresentationSessionInfo::GetWindow()
-{
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return nullptr;
- }
- uint64_t windowId = 0;
- if (NS_WARN_IF(NS_FAILED(service->GetWindowIdBySessionId(mSessionId,
- mRole,
- &windowId)))) {
- return nullptr;
- }
-
- auto window = nsGlobalWindow::GetInnerWindowWithId(windowId);
- if (!window) {
- return nullptr;
- }
-
- return window->AsInner();
-}
-
-/* virtual */ bool
-PresentationSessionInfo::IsAccessible(base::ProcessId aProcessId)
-{
- // No restriction by default.
- return true;
-}
-
-void
-PresentationSessionInfo::ContinueTermination()
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mControlChannel);
-
- if (NS_WARN_IF(NS_FAILED(mControlChannel->Terminate(mSessionId)))
- || mIsOnTerminating) {
- Shutdown(NS_OK);
- }
-}
-
-// nsIPresentationSessionTransportCallback
-NS_IMETHODIMP
-PresentationSessionInfo::NotifyTransportReady()
-{
- PRES_DEBUG("%s:id[%s], role[%d], state[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), mRole, mState);
-
- MOZ_ASSERT(NS_IsMainThread());
-
- if (mState != nsIPresentationSessionListener::STATE_CONNECTING &&
- mState != nsIPresentationSessionListener::STATE_CONNECTED) {
- return NS_OK;
- }
-
- mIsTransportReady = true;
-
- // Established RTCDataChannel implies responder is ready.
- if (mTransportType == nsIPresentationChannelDescription::TYPE_DATACHANNEL) {
- mIsResponderReady = true;
- }
-
- // At sender side, session might not be ready at this point (waiting for
- // receiver's answer). Yet at receiver side, session must be ready at this
- // point since the data transport channel is created after the receiver page
- // is ready for presentation use.
- if (IsSessionReady()) {
- return ReplySuccess();
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationSessionInfo::NotifyTransportClosed(nsresult aReason)
-{
- PRES_DEBUG("%s:id[%s], reason[%x], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), aReason, mRole);
-
- MOZ_ASSERT(NS_IsMainThread());
-
- // Nullify |mTransport| here so it won't try to re-close |mTransport| in
- // potential subsequent |Shutdown| calls.
- mTransport = nullptr;
-
- if (NS_WARN_IF(!IsSessionReady() &&
- mState == nsIPresentationSessionListener::STATE_CONNECTING)) {
- // It happens before the session is ready. Reply the callback.
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- // Unset |mIsTransportReady| here so it won't affect |IsSessionReady()| above.
- mIsTransportReady = false;
-
- if (mState == nsIPresentationSessionListener::STATE_CONNECTED) {
- // The transport channel is closed unexpectedly (not caused by a |Close| call).
- SetStateWithReason(nsIPresentationSessionListener::STATE_CLOSED, aReason);
- }
-
- Shutdown(aReason);
-
- if (mState == nsIPresentationSessionListener::STATE_TERMINATED) {
- // Directly untrack the session info from the service.
- return UntrackFromService();
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationSessionInfo::NotifyData(const nsACString& aData, bool aIsBinary)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!IsSessionReady())) {
- return NS_ERROR_DOM_INVALID_STATE_ERR;
- }
-
- if (NS_WARN_IF(!mListener)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return mListener->NotifyMessage(mSessionId, aData, aIsBinary);
-}
-
-// nsIPresentationSessionTransportBuilderListener
-NS_IMETHODIMP
-PresentationSessionInfo::OnSessionTransport(nsIPresentationSessionTransport* aTransport)
-{
- PRES_DEBUG("%s:id[%s], role[%d], state[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), mRole, mState);
-
- ResetBuilder();
-
- if (mState != nsIPresentationSessionListener::STATE_CONNECTING) {
- return NS_ERROR_FAILURE;
- }
-
- if (NS_WARN_IF(!aTransport)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- mTransport = aTransport;
-
- nsresult rv = mTransport->SetCallback(this);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- if (mListener) {
- mTransport->EnableDataNotification();
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationSessionInfo::OnError(nsresult aReason)
-{
- PRES_DEBUG("%s:id[%s], reason[%x], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), aReason, mRole);
-
- ResetBuilder();
- return ReplyError(aReason);
-}
-
-NS_IMETHODIMP
-PresentationSessionInfo::SendOffer(nsIPresentationChannelDescription* aOffer)
-{
- return mControlChannel->SendOffer(aOffer);
-}
-
-NS_IMETHODIMP
-PresentationSessionInfo::SendAnswer(nsIPresentationChannelDescription* aAnswer)
-{
- return mControlChannel->SendAnswer(aAnswer);
-}
-
-NS_IMETHODIMP
-PresentationSessionInfo::SendIceCandidate(const nsAString& candidate)
-{
- return mControlChannel->SendIceCandidate(candidate);
-}
-
-NS_IMETHODIMP
-PresentationSessionInfo::Close(nsresult reason)
-{
- return mControlChannel->Disconnect(reason);
-}
-
-/**
- * Implementation of PresentationControllingInfo
- *
- * During presentation session establishment, the sender expects the following
- * after trying to establish the control channel: (The order between step 3 and
- * 4 is not guaranteed.)
- * 1. |Init| is called to open a socket |mServerSocket| for data transport
- * channel.
- * 2. |NotifyConnected| of |nsIPresentationControlChannelListener| is called to
- * indicate the control channel is ready to use. Then send the offer to the
- * receiver via the control channel.
- * 3.1 |OnSocketAccepted| of |nsIServerSocketListener| is called to indicate the
- * data transport channel is connected. Then initialize |mTransport|.
- * 3.2 |NotifyTransportReady| of |nsIPresentationSessionTransportCallback| is
- * called.
- * 4. |OnAnswer| of |nsIPresentationControlChannelListener| is called to
- * indicate the receiver is ready. Close the control channel since it's no
- * longer needed.
- * 5. Once both step 3 and 4 are done, the presentation session is ready to use.
- * So notify the listener of CONNECTED state.
- */
-
-NS_IMPL_ISUPPORTS_INHERITED(PresentationControllingInfo,
- PresentationSessionInfo,
- nsIServerSocketListener)
-
-nsresult
-PresentationControllingInfo::Init(nsIPresentationControlChannel* aControlChannel)
-{
- PresentationSessionInfo::Init(aControlChannel);
-
- // Initialize |mServerSocket| for bootstrapping the data transport channel and
- // use |this| as the listener.
- mServerSocket = do_CreateInstance(NS_SERVERSOCKET_CONTRACTID);
- if (NS_WARN_IF(!mServerSocket)) {
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- nsresult rv = mServerSocket->Init(-1, false, -1);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- rv = mServerSocket->AsyncListen(this);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- int32_t port;
- rv = mServerSocket->GetPort(&port);
- if (!NS_WARN_IF(NS_FAILED(rv))) {
- PRES_DEBUG("%s:ServerSocket created.port[%d]\n",__func__, port);
- }
-
- return NS_OK;
-}
-
-void
-PresentationControllingInfo::Shutdown(nsresult aReason)
-{
- PresentationSessionInfo::Shutdown(aReason);
-
- // Close the server socket if any.
- if (mServerSocket) {
- Unused << NS_WARN_IF(NS_FAILED(mServerSocket->Close()));
- mServerSocket = nullptr;
- }
-}
-
-nsresult
-PresentationControllingInfo::GetAddress()
-{
-#if defined(MOZ_WIDGET_ANDROID)
- RefPtr<PresentationNetworkHelper> networkHelper =
- new PresentationNetworkHelper(this,
- &PresentationControllingInfo::OnGetAddress);
- nsresult rv = networkHelper->GetWifiIPAddress();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
-#else
- nsCOMPtr<nsINetworkInfoService> networkInfo = do_GetService(NETWORKINFOSERVICE_CONTRACT_ID);
- MOZ_ASSERT(networkInfo);
-
- nsresult rv = networkInfo->ListNetworkAddresses(this);
-
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-#endif
-
- return NS_OK;
-}
-
-nsresult
-PresentationControllingInfo::OnGetAddress(const nsACString& aAddress)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!mServerSocket)) {
- return NS_ERROR_FAILURE;
- }
- if (NS_WARN_IF(!mControlChannel)) {
- return NS_ERROR_FAILURE;
- }
-
- // Prepare and send the offer.
- int32_t port;
- nsresult rv = mServerSocket->GetPort(&port);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- RefPtr<TCPPresentationChannelDescription> description =
- new TCPPresentationChannelDescription(aAddress, static_cast<uint16_t>(port));
- return mControlChannel->SendOffer(description);
-}
-
-// nsIPresentationControlChannelListener
-NS_IMETHODIMP
-PresentationControllingInfo::OnIceCandidate(const nsAString& aCandidate)
-{
- if (mTransportType != nsIPresentationChannelDescription::TYPE_DATACHANNEL) {
- return NS_ERROR_FAILURE;
- }
-
- nsCOMPtr<nsIPresentationDataChannelSessionTransportBuilder>
- builder = do_QueryInterface(mBuilder);
-
- if (NS_WARN_IF(!builder)) {
- return NS_ERROR_FAILURE;
- }
-
- return builder->OnIceCandidate(aCandidate);
-}
-
-NS_IMETHODIMP
-PresentationControllingInfo::OnOffer(nsIPresentationChannelDescription* aDescription)
-{
- MOZ_ASSERT(false, "Sender side should not receive offer.");
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-PresentationControllingInfo::OnAnswer(nsIPresentationChannelDescription* aDescription)
-{
- if (mTransportType == nsIPresentationChannelDescription::TYPE_DATACHANNEL) {
- nsCOMPtr<nsIPresentationDataChannelSessionTransportBuilder>
- builder = do_QueryInterface(mBuilder);
-
- if (NS_WARN_IF(!builder)) {
- return NS_ERROR_FAILURE;
- }
-
- return builder->OnAnswer(aDescription);
- }
-
- mIsResponderReady = true;
-
- // Close the control channel since it's no longer needed.
- nsresult rv = mControlChannel->Disconnect(NS_OK);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- // Session might not be ready at this moment (waiting for the establishment of
- // the data transport channel).
- if (IsSessionReady()){
- return ReplySuccess();
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationControllingInfo::NotifyConnected()
-{
- PRES_DEBUG("%s:id[%s], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), mRole);
-
- MOZ_ASSERT(NS_IsMainThread());
-
- switch (mState) {
- case nsIPresentationSessionListener::STATE_CONNECTING: {
- if (mIsReconnecting) {
- return ContinueReconnect();
- }
-
- nsresult rv = mControlChannel->Launch(GetSessionId(), GetUrl());
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- Unused << NS_WARN_IF(NS_FAILED(BuildTransport()));
- break;
- }
- case nsIPresentationSessionListener::STATE_TERMINATED: {
- ContinueTermination();
- break;
- }
- default:
- break;
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationControllingInfo::NotifyReconnected()
-{
- PRES_DEBUG("%s:id[%s], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), mRole);
-
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(mState != nsIPresentationSessionListener::STATE_CONNECTING)) {
- return NS_ERROR_FAILURE;
- }
-
- return NotifyReconnectResult(NS_OK);
-}
-
-nsresult
-PresentationControllingInfo::BuildTransport()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (mState != nsIPresentationSessionListener::STATE_CONNECTING) {
- return NS_OK;
- }
-
- if (NS_WARN_IF(!mBuilderConstructor)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- if (!Preferences::GetBool("dom.presentation.session_transport.data_channel.enable")) {
- // Build TCP session transport
- return GetAddress();
- }
- /**
- * Generally transport is maintained by the chrome process. However, data
- * channel should be live with the DOM , which implies RTCDataChannel in an OOP
- * page should be establish in the content process.
- *
- * |mBuilderConstructor| is responsible for creating a builder, which is for
- * building a data channel transport.
- *
- * In the OOP case, |mBuilderConstructor| would create a builder which is
- * an object of |PresentationBuilderParent|. So, |BuildDataChannelTransport|
- * triggers an IPC call to make content process establish a RTCDataChannel
- * transport.
- */
-
- mTransportType = nsIPresentationChannelDescription::TYPE_DATACHANNEL;
- if (NS_WARN_IF(NS_FAILED(
- mBuilderConstructor->CreateTransportBuilder(mTransportType,
- getter_AddRefs(mBuilder))))) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- nsCOMPtr<nsIPresentationDataChannelSessionTransportBuilder>
- dataChannelBuilder(do_QueryInterface(mBuilder));
- if (NS_WARN_IF(!dataChannelBuilder)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- // OOP window would be set from content process
- nsPIDOMWindowInner* window = GetWindow();
-
- nsresult rv = dataChannelBuilder->
- BuildDataChannelTransport(nsIPresentationService::ROLE_CONTROLLER,
- window,
- this);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationControllingInfo::NotifyDisconnected(nsresult aReason)
-{
- PRES_DEBUG("%s:id[%s], reason[%x], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), aReason, mRole);
-
- MOZ_ASSERT(NS_IsMainThread());
-
- if (mTransportType == nsIPresentationChannelDescription::TYPE_DATACHANNEL) {
- nsCOMPtr<nsIPresentationDataChannelSessionTransportBuilder>
- builder = do_QueryInterface(mBuilder);
- if (builder) {
- Unused << NS_WARN_IF(NS_FAILED(builder->NotifyDisconnected(aReason)));
- }
- }
-
- // Unset control channel here so it won't try to re-close it in potential
- // subsequent |Shutdown| calls.
- SetControlChannel(nullptr);
-
- if (NS_WARN_IF(NS_FAILED(aReason) || !mIsResponderReady)) {
- // The presentation session instance may already exist.
- // Change the state to CLOSED if it is not terminated.
- if (nsIPresentationSessionListener::STATE_TERMINATED != mState) {
- SetStateWithReason(nsIPresentationSessionListener::STATE_CLOSED, aReason);
- }
-
- // If |aReason| is NS_OK, it implies that the user closes the connection
- // before becomming connected. No need to call |ReplyError| in this case.
- if (NS_FAILED(aReason)) {
- if (mIsReconnecting) {
- NotifyReconnectResult(NS_ERROR_DOM_OPERATION_ERR);
- }
- // Reply error for an abnormal close.
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
- Shutdown(aReason);
- }
-
- // This is the case for reconnecting a connection which is in
- // connecting state and |mTransport| is not ready.
- if (mDoReconnectAfterClose && !mTransport) {
- mDoReconnectAfterClose = false;
- return Reconnect(mReconnectCallback);
- }
-
- return NS_OK;
-}
-
-// nsIServerSocketListener
-NS_IMETHODIMP
-PresentationControllingInfo::OnSocketAccepted(nsIServerSocket* aServerSocket,
- nsISocketTransport* aTransport)
-{
- int32_t port;
- nsresult rv = aTransport->GetPort(&port);
- if (!NS_WARN_IF(NS_FAILED(rv))) {
- PRES_DEBUG("%s:receive from port[%d]\n",__func__, port);
- }
-
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!mBuilderConstructor)) {
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- // Initialize session transport builder and use |this| as the callback.
- nsCOMPtr<nsIPresentationTCPSessionTransportBuilder> builder;
- if (NS_SUCCEEDED(mBuilderConstructor->CreateTransportBuilder(
- nsIPresentationChannelDescription::TYPE_TCP,
- getter_AddRefs(mBuilder)))) {
- builder = do_QueryInterface(mBuilder);
- }
-
- if (NS_WARN_IF(!builder)) {
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- mTransportType = nsIPresentationChannelDescription::TYPE_TCP;
- return builder->BuildTCPSenderTransport(aTransport, this);
-}
-
-NS_IMETHODIMP
-PresentationControllingInfo::OnStopListening(nsIServerSocket* aServerSocket,
- nsresult aStatus)
-{
- PRES_DEBUG("controller %s:status[%x]\n",__func__, aStatus);
-
- MOZ_ASSERT(NS_IsMainThread());
-
- if (aStatus == NS_BINDING_ABORTED) { // The server socket was manually closed.
- return NS_OK;
- }
-
- Shutdown(aStatus);
-
- if (NS_WARN_IF(!IsSessionReady())) {
- // It happens before the session is ready. Reply the callback.
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- // It happens after the session is ready. Change the state to CLOSED.
- SetStateWithReason(nsIPresentationSessionListener::STATE_CLOSED, aStatus);
-
- return NS_OK;
-}
-
-/**
- * The steps to reconnect a session are summarized below:
- * 1. Change |mState| to CONNECTING.
- * 2. Check whether |mControlChannel| is existed or not. Usually we have to
- * create a new control cahnnel.
- * 3.1 |mControlChannel| is null, which means we have to create a new one.
- * |EstablishControlChannel| is called to create a new control channel.
- * At this point, |mControlChannel| is not able to use yet. Set
- * |mIsReconnecting| to true and wait until |NotifyConnected|.
- * 3.2 |mControlChannel| is not null and is avaliable.
- * We can just call |ContinueReconnect| to send reconnect command.
- * 4. |NotifyReconnected| of |nsIPresentationControlChannelListener| is called
- * to indicate the receiver is ready for reconnecting.
- * 5. Once both step 3 and 4 are done, the rest is to build a new data
- * transport channel by following the same steps as starting a
- * new session.
- */
-
-nsresult
-PresentationControllingInfo::Reconnect(nsIPresentationServiceCallback* aCallback)
-{
- PRES_DEBUG("%s:id[%s], role[%d], state[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), mRole, mState);
-
- if (!aCallback) {
- return NS_ERROR_INVALID_ARG;
- }
-
- mReconnectCallback = aCallback;
-
- if (NS_WARN_IF(mState == nsIPresentationSessionListener::STATE_TERMINATED)) {
- return NotifyReconnectResult(NS_ERROR_DOM_INVALID_STATE_ERR);
- }
-
- // If |mState| is not CLOSED, we have to close the connection before
- // reconnecting. The process to reconnect will be continued after
- // |NotifyDisconnected| or |NotifyTransportClosed| is invoked.
- if (mState == nsIPresentationSessionListener::STATE_CONNECTING ||
- mState == nsIPresentationSessionListener::STATE_CONNECTED) {
- mDoReconnectAfterClose = true;
- return Close(NS_OK, nsIPresentationSessionListener::STATE_CLOSED);
- }
-
- // Make sure |mState| is closed at this point.
- MOZ_ASSERT(mState == nsIPresentationSessionListener::STATE_CLOSED);
-
- mState = nsIPresentationSessionListener::STATE_CONNECTING;
- mIsReconnecting = true;
-
- nsresult rv = NS_OK;
- if (!mControlChannel) {
- nsCOMPtr<nsIPresentationControlChannel> ctrlChannel;
- rv = mDevice->EstablishControlChannel(getter_AddRefs(ctrlChannel));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return NotifyReconnectResult(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- rv = Init(ctrlChannel);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return NotifyReconnectResult(NS_ERROR_DOM_OPERATION_ERR);
- }
- } else {
- return ContinueReconnect();
- }
-
- return NS_OK;
-}
-
-nsresult
-PresentationControllingInfo::ContinueReconnect()
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mControlChannel);
-
- mIsReconnecting = false;
- if (NS_WARN_IF(NS_FAILED(mControlChannel->Reconnect(mSessionId, GetUrl())))) {
- return NotifyReconnectResult(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- return NS_OK;
-}
-
-// nsIListNetworkAddressesListener
-NS_IMETHODIMP
-PresentationControllingInfo::OnListedNetworkAddresses(const char** aAddressArray,
- uint32_t aAddressArraySize)
-{
- if (!aAddressArraySize) {
- return OnListNetworkAddressesFailed();
- }
-
- // TODO bug 1228504 Take all IP addresses in PresentationChannelDescription
- // into account. And at the first stage Presentation API is only exposed on
- // Firefox OS where the first IP appears enough for most scenarios.
-
- nsAutoCString ip;
- ip.Assign(aAddressArray[0]);
-
- // On Firefox desktop, the IP address is retrieved from a callback function.
- // To make consistent code sequence, following function call is dispatched
- // into main thread instead of calling it directly.
- NS_DispatchToMainThread(
- NewRunnableMethod<nsCString>(
- this,
- &PresentationControllingInfo::OnGetAddress,
- ip));
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationControllingInfo::OnListNetworkAddressesFailed()
-{
- PRES_ERROR("PresentationControllingInfo:OnListNetworkAddressesFailed");
-
- // In 1-UA case, transport channel can still be established
- // on loopback interface even if no network address available.
- NS_DispatchToMainThread(
- NewRunnableMethod<nsCString>(
- this,
- &PresentationControllingInfo::OnGetAddress,
- "127.0.0.1"));
-
- return NS_OK;
-}
-
-nsresult
-PresentationControllingInfo::NotifyReconnectResult(nsresult aStatus)
-{
- if (!mReconnectCallback) {
- MOZ_ASSERT(false, "mReconnectCallback can not be null here.");
- return NS_ERROR_FAILURE;
- }
-
- mIsReconnecting = false;
- nsCOMPtr<nsIPresentationServiceCallback> callback =
- mReconnectCallback.forget();
- if (NS_FAILED(aStatus)) {
- return callback->NotifyError(aStatus);
- }
-
- return callback->NotifySuccess(GetUrl());
-}
-
-// nsIPresentationSessionTransportCallback
-NS_IMETHODIMP
-PresentationControllingInfo::NotifyTransportReady()
-{
- return PresentationSessionInfo::NotifyTransportReady();
-}
-
-NS_IMETHODIMP
-PresentationControllingInfo::NotifyTransportClosed(nsresult aReason)
-{
- if (!mDoReconnectAfterClose) {
- return PresentationSessionInfo::NotifyTransportClosed(aReason);;
- }
-
- MOZ_ASSERT(mState == nsIPresentationSessionListener::STATE_CLOSED);
-
- mTransport = nullptr;
- mIsTransportReady = false;
- mDoReconnectAfterClose = false;
- return Reconnect(mReconnectCallback);
-}
-
-NS_IMETHODIMP
-PresentationControllingInfo::NotifyData(const nsACString& aData, bool aIsBinary)
-{
- return PresentationSessionInfo::NotifyData(aData, aIsBinary);
-}
-
-/**
- * Implementation of PresentationPresentingInfo
- *
- * During presentation session establishment, the receiver expects the following
- * after trying to launch the app by notifying "presentation-launch-receiver":
- * (The order between step 2 and 3 is not guaranteed.)
- * 1. |Observe| of |nsIObserver| is called with "presentation-receiver-launched".
- * Then start listen to document |STATE_TRANSFERRING| event.
- * 2. |NotifyResponderReady| is called to indicate the receiver page is ready
- * for presentation use.
- * 3. |OnOffer| of |nsIPresentationControlChannelListener| is called.
- * 4. Once both step 2 and 3 are done, establish the data transport channel and
- * send the answer. (The control channel will be closed by the sender once it
- * receives the answer.)
- * 5. |NotifyTransportReady| of |nsIPresentationSessionTransportCallback| is
- * called. The presentation session is ready to use, so notify the listener
- * of CONNECTED state.
- */
-
-NS_IMPL_ISUPPORTS_INHERITED(PresentationPresentingInfo,
- PresentationSessionInfo,
- nsITimerCallback)
-
-nsresult
-PresentationPresentingInfo::Init(nsIPresentationControlChannel* aControlChannel)
-{
- PresentationSessionInfo::Init(aControlChannel);
-
- // Add a timer to prevent waiting indefinitely in case the receiver page fails
- // to become ready.
- nsresult rv;
- int32_t timeout =
- Preferences::GetInt("presentation.receiver.loading.timeout", 10000);
- mTimer = do_CreateInstance(NS_TIMER_CONTRACTID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- rv = mTimer->InitWithCallback(this, timeout, nsITimer::TYPE_ONE_SHOT);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-void
-PresentationPresentingInfo::Shutdown(nsresult aReason)
-{
- PresentationSessionInfo::Shutdown(aReason);
-
- if (mTimer) {
- mTimer->Cancel();
- }
-
- mLoadingCallback = nullptr;
- mRequesterDescription = nullptr;
- mPendingCandidates.Clear();
- mPromise = nullptr;
- mHasFlushPendingEvents = false;
-}
-
-// nsIPresentationSessionTransportBuilderListener
-NS_IMETHODIMP
-PresentationPresentingInfo::OnSessionTransport(nsIPresentationSessionTransport* aTransport)
-{
- nsresult rv = PresentationSessionInfo::OnSessionTransport(aTransport);
-
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- // The session transport is managed by content process
- if (NS_WARN_IF(!aTransport)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- // send answer for TCP session transport
- if (mTransportType == nsIPresentationChannelDescription::TYPE_TCP) {
- // Prepare and send the answer.
- // In the current implementation of |PresentationSessionTransport|,
- // |GetSelfAddress| cannot return the real info when it's initialized via
- // |buildTCPReceiverTransport|. Yet this deficiency only affects the channel
- // description for the answer, which is not actually checked at requester side.
- nsCOMPtr<nsINetAddr> selfAddr;
- rv = mTransport->GetSelfAddress(getter_AddRefs(selfAddr));
- NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "GetSelfAddress failed");
-
- nsCString address;
- uint16_t port = 0;
- if (NS_SUCCEEDED(rv)) {
- selfAddr->GetAddress(address);
- selfAddr->GetPort(&port);
- }
- nsCOMPtr<nsIPresentationChannelDescription> description =
- new TCPPresentationChannelDescription(address, port);
-
- return mControlChannel->SendAnswer(description);
- }
-
- return NS_OK;
-}
-
-// Delegate the pending offer and ICE candidates to builder.
-NS_IMETHODIMP
-PresentationPresentingInfo::FlushPendingEvents(nsIPresentationDataChannelSessionTransportBuilder* builder)
-{
- if (NS_WARN_IF(!builder)) {
- return NS_ERROR_FAILURE;
- }
-
- mHasFlushPendingEvents = true;
-
- if (mRequesterDescription) {
- builder->OnOffer(mRequesterDescription);
- }
- mRequesterDescription = nullptr;
-
- for (size_t i = 0; i < mPendingCandidates.Length(); ++i) {
- builder->OnIceCandidate(mPendingCandidates[i]);
- }
- mPendingCandidates.Clear();
- return NS_OK;
-}
-
-nsresult
-PresentationPresentingInfo::InitTransportAndSendAnswer()
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mState == nsIPresentationSessionListener::STATE_CONNECTING);
-
- uint8_t type = 0;
- nsresult rv = mRequesterDescription->GetType(&type);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- if (NS_WARN_IF(!mBuilderConstructor)) {
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- if (NS_WARN_IF(NS_FAILED(
- mBuilderConstructor->CreateTransportBuilder(type,
- getter_AddRefs(mBuilder))))) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- if (type == nsIPresentationChannelDescription::TYPE_TCP) {
- // Establish a data transport channel |mTransport| to the sender and use
- // |this| as the callback.
- nsCOMPtr<nsIPresentationTCPSessionTransportBuilder> builder =
- do_QueryInterface(mBuilder);
- if (NS_WARN_IF(!builder)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- mTransportType = nsIPresentationChannelDescription::TYPE_TCP;
- return builder->BuildTCPReceiverTransport(mRequesterDescription, this);
- }
-
- if (type == nsIPresentationChannelDescription::TYPE_DATACHANNEL) {
- if (!Preferences::GetBool("dom.presentation.session_transport.data_channel.enable")) {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
- /**
- * Generally transport is maintained by the chrome process. However, data
- * channel should be live with the DOM , which implies RTCDataChannel in an OOP
- * page should be establish in the content process.
- *
- * |mBuilderConstructor| is responsible for creating a builder, which is for
- * building a data channel transport.
- *
- * In the OOP case, |mBuilderConstructor| would create a builder which is
- * an object of |PresentationBuilderParent|. So, |BuildDataChannelTransport|
- * triggers an IPC call to make content process establish a RTCDataChannel
- * transport.
- */
-
- mTransportType = nsIPresentationChannelDescription::TYPE_DATACHANNEL;
-
- nsCOMPtr<nsIPresentationDataChannelSessionTransportBuilder> dataChannelBuilder =
- do_QueryInterface(mBuilder);
- if (NS_WARN_IF(!dataChannelBuilder)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- nsPIDOMWindowInner* window = GetWindow();
-
- rv = dataChannelBuilder->
- BuildDataChannelTransport(nsIPresentationService::ROLE_RECEIVER,
- window,
- this);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- rv = FlushPendingEvents(dataChannelBuilder);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return NS_OK;
- }
-
- MOZ_ASSERT(false, "Unknown nsIPresentationChannelDescription type!");
- return NS_ERROR_UNEXPECTED;
-}
-
-nsresult
-PresentationPresentingInfo::UntrackFromService()
-{
- // Remove the OOP responding info (if it has never been used).
- if (mContentParent) {
- Unused << NS_WARN_IF(!static_cast<ContentParent*>(mContentParent.get())->SendNotifyPresentationReceiverCleanUp(mSessionId));
- }
-
- // Receiver device might need clean up after session termination.
- if (mDevice) {
- mDevice->Disconnect();
- }
- mDevice = nullptr;
-
- // Remove the session info (and the in-process responding info if there's any).
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- static_cast<PresentationService*>(service.get())->UntrackSessionInfo(mSessionId, mRole);
-
- return NS_OK;
-}
-
-bool
-PresentationPresentingInfo::IsAccessible(base::ProcessId aProcessId)
-{
- // Only the specific content process should access the responder info.
- return (mContentParent) ?
- aProcessId == static_cast<ContentParent*>(mContentParent.get())->OtherPid() :
- false;
-}
-
-nsresult
-PresentationPresentingInfo::NotifyResponderReady()
-{
- PRES_DEBUG("%s:id[%s], role[%d], state[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), mRole, mState);
-
- if (mTimer) {
- mTimer->Cancel();
- mTimer = nullptr;
- }
-
- mIsResponderReady = true;
-
- // Initialize |mTransport| and send the answer to the sender if sender's
- // description is already offered.
- if (mRequesterDescription) {
- nsresult rv = InitTransportAndSendAnswer();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
- }
-
- return NS_OK;
-}
-
-nsresult
-PresentationPresentingInfo::NotifyResponderFailure()
-{
- PRES_DEBUG("%s:id[%s], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), mRole);
-
- if (mTimer) {
- mTimer->Cancel();
- mTimer = nullptr;
- }
-
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
-}
-
-nsresult
-PresentationPresentingInfo::DoReconnect()
-{
- PRES_DEBUG("%s:id[%s], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), mRole);
-
- MOZ_ASSERT(mState == nsIPresentationSessionListener::STATE_CLOSED);
-
- SetStateWithReason(nsIPresentationSessionListener::STATE_CONNECTING, NS_OK);
-
- return NotifyResponderReady();
-}
-
-// nsIPresentationControlChannelListener
-NS_IMETHODIMP
-PresentationPresentingInfo::OnOffer(nsIPresentationChannelDescription* aDescription)
-{
- if (NS_WARN_IF(mHasFlushPendingEvents)) {
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- if (NS_WARN_IF(!aDescription)) {
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- mRequesterDescription = aDescription;
-
- // Initialize |mTransport| and send the answer to the sender if the receiver
- // page is ready for presentation use.
- if (mIsResponderReady) {
- nsresult rv = InitTransportAndSendAnswer();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationPresentingInfo::OnAnswer(nsIPresentationChannelDescription* aDescription)
-{
- MOZ_ASSERT(false, "Receiver side should not receive answer.");
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-PresentationPresentingInfo::OnIceCandidate(const nsAString& aCandidate)
-{
- if (!mBuilder && !mHasFlushPendingEvents) {
- mPendingCandidates.AppendElement(nsString(aCandidate));
- return NS_OK;
- }
-
- if (NS_WARN_IF(!mBuilder && mHasFlushPendingEvents)) {
- return NS_ERROR_FAILURE;
- }
-
- nsCOMPtr<nsIPresentationDataChannelSessionTransportBuilder>
- builder = do_QueryInterface(mBuilder);
-
- return builder->OnIceCandidate(aCandidate);
-}
-
-NS_IMETHODIMP
-PresentationPresentingInfo::NotifyConnected()
-{
- PRES_DEBUG("%s:id[%s], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), mRole);
-
- if (nsIPresentationSessionListener::STATE_TERMINATED == mState) {
- ContinueTermination();
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationPresentingInfo::NotifyReconnected()
-{
- MOZ_ASSERT(false, "NotifyReconnected should not be called at receiver side.");
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationPresentingInfo::NotifyDisconnected(nsresult aReason)
-{
- PRES_DEBUG("%s:id[%s], reason[%x], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(mSessionId).get(), aReason, mRole);
-
- MOZ_ASSERT(NS_IsMainThread());
-
- if (mTransportType == nsIPresentationChannelDescription::TYPE_DATACHANNEL) {
- nsCOMPtr<nsIPresentationDataChannelSessionTransportBuilder>
- builder = do_QueryInterface(mBuilder);
- if (builder) {
- Unused << NS_WARN_IF(NS_FAILED(builder->NotifyDisconnected(aReason)));
- }
- }
-
- // Unset control channel here so it won't try to re-close it in potential
- // subsequent |Shutdown| calls.
- SetControlChannel(nullptr);
-
- if (NS_WARN_IF(NS_FAILED(aReason))) {
- // The presentation session instance may already exist.
- // Change the state to TERMINATED since it never succeeds.
- SetStateWithReason(nsIPresentationSessionListener::STATE_TERMINATED, aReason);
-
- // Reply error for an abnormal close.
- return ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- }
-
- return NS_OK;
-}
-
-// nsITimerCallback
-NS_IMETHODIMP
-PresentationPresentingInfo::Notify(nsITimer* aTimer)
-{
- MOZ_ASSERT(NS_IsMainThread());
- NS_WARNING("The receiver page fails to become ready before timeout.");
-
- mTimer = nullptr;
- return ReplyError(NS_ERROR_DOM_TIMEOUT_ERR);
-}
-
-// PromiseNativeHandler
-void
-PresentationPresentingInfo::ResolvedCallback(JSContext* aCx,
- JS::Handle<JS::Value> aValue)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!aValue.isObject())) {
- ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
-
- JS::Rooted<JSObject*> obj(aCx, &aValue.toObject());
- if (NS_WARN_IF(!obj)) {
- ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
-
- // Start to listen to document state change event |STATE_TRANSFERRING|.
- // Use Element to support both HTMLIFrameElement and nsXULElement.
- Element* frame = nullptr;
- nsresult rv = UNWRAP_OBJECT(Element, &obj, frame);
- if (NS_WARN_IF(!frame)) {
- ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
-
- nsCOMPtr<nsIFrameLoaderOwner> owner = do_QueryInterface((nsIFrameLoaderOwner*) frame);
- if (NS_WARN_IF(!owner)) {
- ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
-
- nsCOMPtr<nsIFrameLoader> frameLoader = owner->GetFrameLoader();
- if (NS_WARN_IF(!frameLoader)) {
- ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
-
- RefPtr<TabParent> tabParent = TabParent::GetFrom(frameLoader);
- if (tabParent) {
- // OOP frame
- // Notify the content process that a receiver page has launched, so it can
- // start monitoring the loading progress.
- mContentParent = tabParent->Manager();
- Unused << NS_WARN_IF(!static_cast<ContentParent*>(mContentParent.get())->SendNotifyPresentationReceiverLaunched(tabParent, mSessionId));
- } else {
- // In-process frame
- nsCOMPtr<nsIDocShell> docShell;
- rv = frameLoader->GetDocShell(getter_AddRefs(docShell));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
-
- // Keep an eye on the loading progress of the receiver page.
- mLoadingCallback = new PresentationResponderLoadingCallback(mSessionId);
- rv = mLoadingCallback->Init(docShell);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- ReplyError(NS_ERROR_DOM_OPERATION_ERR);
- return;
- }
- }
-}
-
-void
-PresentationPresentingInfo::RejectedCallback(JSContext* aCx,
- JS::Handle<JS::Value> aValue)
-{
- MOZ_ASSERT(NS_IsMainThread());
- NS_WARNING("Launching the receiver page has been rejected.");
-
- if (mTimer) {
- mTimer->Cancel();
- mTimer = nullptr;
- }
-
- ReplyError(NS_ERROR_DOM_OPERATION_ERR);
-}
diff --git a/dom/presentation/PresentationSessionInfo.h b/dom/presentation/PresentationSessionInfo.h
deleted file mode 100644
index 6338d3c32..000000000
--- a/dom/presentation/PresentationSessionInfo.h
+++ /dev/null
@@ -1,304 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationSessionInfo_h
-#define mozilla_dom_PresentationSessionInfo_h
-
-#include "base/process.h"
-#include "mozilla/dom/nsIContentParent.h"
-#include "mozilla/dom/Promise.h"
-#include "mozilla/dom/PromiseNativeHandler.h"
-#include "mozilla/DebugOnly.h"
-#include "mozilla/RefPtr.h"
-#include "nsCOMPtr.h"
-#include "nsINetworkInfoService.h"
-#include "nsIPresentationControlChannel.h"
-#include "nsIPresentationDevice.h"
-#include "nsIPresentationListener.h"
-#include "nsIPresentationService.h"
-#include "nsIPresentationSessionTransport.h"
-#include "nsIPresentationSessionTransportBuilder.h"
-#include "nsIServerSocket.h"
-#include "nsITimer.h"
-#include "nsString.h"
-#include "PresentationCallbacks.h"
-
-namespace mozilla {
-namespace dom {
-
-class PresentationSessionInfo : public nsIPresentationSessionTransportCallback
- , public nsIPresentationControlChannelListener
- , public nsIPresentationSessionTransportBuilderListener
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONSESSIONTRANSPORTCALLBACK
- NS_DECL_NSIPRESENTATIONSESSIONTRANSPORTBUILDERLISTENER
-
- PresentationSessionInfo(const nsAString& aUrl,
- const nsAString& aSessionId,
- const uint8_t aRole)
- : mUrl(aUrl)
- , mSessionId(aSessionId)
- , mIsResponderReady(false)
- , mIsTransportReady(false)
- , mState(nsIPresentationSessionListener::STATE_CONNECTING)
- , mReason(NS_OK)
- {
- MOZ_ASSERT(!mUrl.IsEmpty());
- MOZ_ASSERT(!mSessionId.IsEmpty());
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
- mRole = aRole;
- }
-
- virtual nsresult Init(nsIPresentationControlChannel* aControlChannel);
-
- const nsAString& GetUrl() const
- {
- return mUrl;
- }
-
- const nsAString& GetSessionId() const
- {
- return mSessionId;
- }
-
- uint8_t GetRole() const
- {
- return mRole;
- }
-
- nsresult SetListener(nsIPresentationSessionListener* aListener);
-
- void SetDevice(nsIPresentationDevice* aDevice)
- {
- mDevice = aDevice;
- }
-
- already_AddRefed<nsIPresentationDevice> GetDevice() const
- {
- nsCOMPtr<nsIPresentationDevice> device = mDevice;
- return device.forget();
- }
-
- void SetControlChannel(nsIPresentationControlChannel* aControlChannel)
- {
- if (mControlChannel) {
- mControlChannel->SetListener(nullptr);
- }
-
- mControlChannel = aControlChannel;
- if (mControlChannel) {
- mControlChannel->SetListener(this);
- }
- }
-
- nsresult Send(const nsAString& aData);
-
- nsresult SendBinaryMsg(const nsACString& aData);
-
- nsresult SendBlob(nsIDOMBlob* aBlob);
-
- nsresult Close(nsresult aReason,
- uint32_t aState);
-
- nsresult OnTerminate(nsIPresentationControlChannel* aControlChannel);
-
- nsresult ReplyError(nsresult aReason);
-
- virtual bool IsAccessible(base::ProcessId aProcessId);
-
- void SetTransportBuilderConstructor(
- nsIPresentationTransportBuilderConstructor* aBuilderConstructor)
- {
- mBuilderConstructor = aBuilderConstructor;
- }
-
-protected:
- virtual ~PresentationSessionInfo()
- {
- Shutdown(NS_OK);
- }
-
- virtual void Shutdown(nsresult aReason);
-
- nsresult ReplySuccess();
-
- bool IsSessionReady()
- {
- return mIsResponderReady && mIsTransportReady;
- }
-
- virtual nsresult UntrackFromService();
-
- void SetStateWithReason(uint32_t aState, nsresult aReason)
- {
- if (mState == aState) {
- return;
- }
-
- mState = aState;
- mReason = aReason;
-
- // Notify session state change.
- if (mListener) {
- DebugOnly<nsresult> rv =
- mListener->NotifyStateChange(mSessionId, mState, aReason);
- NS_WARNING_ASSERTION(NS_SUCCEEDED(rv), "NotifyStateChanged");
- }
- }
-
- void ContinueTermination();
-
- void ResetBuilder()
- {
- mBuilder = nullptr;
- }
-
- // Should be nsIPresentationChannelDescription::TYPE_TCP/TYPE_DATACHANNEL
- uint8_t mTransportType = 0;
-
- nsPIDOMWindowInner* GetWindow();
-
- nsString mUrl;
- nsString mSessionId;
- // mRole should be nsIPresentationService::ROLE_CONTROLLER
- // or nsIPresentationService::ROLE_RECEIVER.
- uint8_t mRole;
- bool mIsResponderReady;
- bool mIsTransportReady;
- bool mIsOnTerminating = false;
- uint32_t mState; // CONNECTED, CLOSED, TERMINATED
- nsresult mReason;
- nsCOMPtr<nsIPresentationSessionListener> mListener;
- nsCOMPtr<nsIPresentationDevice> mDevice;
- nsCOMPtr<nsIPresentationSessionTransport> mTransport;
- nsCOMPtr<nsIPresentationControlChannel> mControlChannel;
- nsCOMPtr<nsIPresentationSessionTransportBuilder> mBuilder;
- nsCOMPtr<nsIPresentationTransportBuilderConstructor> mBuilderConstructor;
-};
-
-// Session info with controlling browsing context (sender side) behaviors.
-class PresentationControllingInfo final : public PresentationSessionInfo
- , public nsIServerSocketListener
- , public nsIListNetworkAddressesListener
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_NSIPRESENTATIONCONTROLCHANNELLISTENER
- NS_DECL_NSISERVERSOCKETLISTENER
- NS_DECL_NSILISTNETWORKADDRESSESLISTENER
- NS_DECL_NSIPRESENTATIONSESSIONTRANSPORTCALLBACK
-
- PresentationControllingInfo(const nsAString& aUrl,
- const nsAString& aSessionId)
- : PresentationSessionInfo(aUrl,
- aSessionId,
- nsIPresentationService::ROLE_CONTROLLER)
- {}
-
- nsresult Init(nsIPresentationControlChannel* aControlChannel) override;
-
- nsresult Reconnect(nsIPresentationServiceCallback* aCallback);
-
- nsresult BuildTransport();
-
-private:
- ~PresentationControllingInfo()
- {
- Shutdown(NS_OK);
- }
-
- void Shutdown(nsresult aReason) override;
-
- nsresult GetAddress();
-
- nsresult OnGetAddress(const nsACString& aAddress);
-
- nsresult ContinueReconnect();
-
- nsresult NotifyReconnectResult(nsresult aStatus);
-
- nsCOMPtr<nsIServerSocket> mServerSocket;
- nsCOMPtr<nsIPresentationServiceCallback> mReconnectCallback;
- bool mIsReconnecting = false;
- bool mDoReconnectAfterClose = false;
-};
-
-// Session info with presenting browsing context (receiver side) behaviors.
-class PresentationPresentingInfo final : public PresentationSessionInfo
- , public PromiseNativeHandler
- , public nsITimerCallback
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_NSIPRESENTATIONCONTROLCHANNELLISTENER
- NS_DECL_NSITIMERCALLBACK
-
- PresentationPresentingInfo(const nsAString& aUrl,
- const nsAString& aSessionId,
- nsIPresentationDevice* aDevice)
- : PresentationSessionInfo(aUrl,
- aSessionId,
- nsIPresentationService::ROLE_RECEIVER)
- {
- MOZ_ASSERT(aDevice);
- SetDevice(aDevice);
- }
-
- nsresult Init(nsIPresentationControlChannel* aControlChannel) override;
-
- nsresult NotifyResponderReady();
- nsresult NotifyResponderFailure();
-
- NS_IMETHODIMP OnSessionTransport(nsIPresentationSessionTransport* transport) override;
-
- void ResolvedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override;
-
- void RejectedCallback(JSContext* aCx, JS::Handle<JS::Value> aValue) override;
-
- void SetPromise(Promise* aPromise)
- {
- mPromise = aPromise;
- mPromise->AppendNativeHandler(this);
- }
-
- bool IsAccessible(base::ProcessId aProcessId) override;
-
- nsresult DoReconnect();
-
-private:
- ~PresentationPresentingInfo()
- {
- Shutdown(NS_OK);
- }
-
- void Shutdown(nsresult aReason) override;
-
- nsresult InitTransportAndSendAnswer();
-
- nsresult UntrackFromService() override;
-
- NS_IMETHODIMP
- FlushPendingEvents(nsIPresentationDataChannelSessionTransportBuilder* builder);
-
- bool mHasFlushPendingEvents = false;
- RefPtr<PresentationResponderLoadingCallback> mLoadingCallback;
- nsCOMPtr<nsITimer> mTimer;
- nsCOMPtr<nsIPresentationChannelDescription> mRequesterDescription;
- nsTArray<nsString> mPendingCandidates;
- RefPtr<Promise> mPromise;
-
- // The content parent communicating with the content process which the OOP
- // receiver page belongs to.
- nsCOMPtr<nsIContentParent> mContentParent;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationSessionInfo_h
diff --git a/dom/presentation/PresentationSessionRequest.cpp b/dom/presentation/PresentationSessionRequest.cpp
deleted file mode 100644
index 219fbd6a4..000000000
--- a/dom/presentation/PresentationSessionRequest.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "PresentationSessionRequest.h"
-#include "nsIPresentationControlChannel.h"
-#include "nsIPresentationDevice.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_ISUPPORTS(PresentationSessionRequest, nsIPresentationSessionRequest)
-
-PresentationSessionRequest::PresentationSessionRequest(nsIPresentationDevice* aDevice,
- const nsAString& aUrl,
- const nsAString& aPresentationId,
- nsIPresentationControlChannel* aControlChannel)
- : mUrl(aUrl)
- , mPresentationId(aPresentationId)
- , mDevice(aDevice)
- , mControlChannel(aControlChannel)
-{
-}
-
-PresentationSessionRequest::~PresentationSessionRequest()
-{
-}
-
-// nsIPresentationSessionRequest
-
-NS_IMETHODIMP
-PresentationSessionRequest::GetDevice(nsIPresentationDevice** aRetVal)
-{
- NS_ENSURE_ARG_POINTER(aRetVal);
-
- nsCOMPtr<nsIPresentationDevice> device = mDevice;
- device.forget(aRetVal);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationSessionRequest::GetUrl(nsAString& aRetVal)
-{
- aRetVal = mUrl;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationSessionRequest::GetPresentationId(nsAString& aRetVal)
-{
- aRetVal = mPresentationId;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationSessionRequest::GetControlChannel(nsIPresentationControlChannel** aRetVal)
-{
- NS_ENSURE_ARG_POINTER(aRetVal);
-
- nsCOMPtr<nsIPresentationControlChannel> controlChannel = mControlChannel;
- controlChannel.forget(aRetVal);
-
- return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/PresentationSessionRequest.h b/dom/presentation/PresentationSessionRequest.h
deleted file mode 100644
index c56502d77..000000000
--- a/dom/presentation/PresentationSessionRequest.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationSessionRequest_h__
-#define mozilla_dom_PresentationSessionRequest_h__
-
-#include "nsIPresentationSessionRequest.h"
-#include "nsCOMPtr.h"
-#include "nsString.h"
-
-namespace mozilla {
-namespace dom {
-
-class PresentationSessionRequest final : public nsIPresentationSessionRequest
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONSESSIONREQUEST
-
- PresentationSessionRequest(nsIPresentationDevice* aDevice,
- const nsAString& aUrl,
- const nsAString& aPresentationId,
- nsIPresentationControlChannel* aControlChannel);
-
-private:
- virtual ~PresentationSessionRequest();
-
- nsString mUrl;
- nsString mPresentationId;
- nsCOMPtr<nsIPresentationDevice> mDevice;
- nsCOMPtr<nsIPresentationControlChannel> mControlChannel;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif /* mozilla_dom_PresentationSessionRequest_h__ */
-
diff --git a/dom/presentation/PresentationTCPSessionTransport.cpp b/dom/presentation/PresentationTCPSessionTransport.cpp
deleted file mode 100644
index 1ccb8b43c..000000000
--- a/dom/presentation/PresentationTCPSessionTransport.cpp
+++ /dev/null
@@ -1,589 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsArrayUtils.h"
-#include "nsIAsyncStreamCopier.h"
-#include "nsIInputStreamPump.h"
-#include "nsIMultiplexInputStream.h"
-#include "nsIMutableArray.h"
-#include "nsIOutputStream.h"
-#include "nsIPresentationControlChannel.h"
-#include "nsIScriptableInputStream.h"
-#include "nsISocketTransport.h"
-#include "nsISocketTransportService.h"
-#include "nsISupportsPrimitives.h"
-#include "nsNetUtil.h"
-#include "nsQueryObject.h"
-#include "nsServiceManagerUtils.h"
-#include "nsStreamUtils.h"
-#include "nsThreadUtils.h"
-#include "PresentationLog.h"
-#include "PresentationTCPSessionTransport.h"
-
-#define BUFFER_SIZE 65536
-
-using namespace mozilla;
-using namespace mozilla::dom;
-
-class CopierCallbacks final : public nsIRequestObserver
-{
-public:
- explicit CopierCallbacks(PresentationTCPSessionTransport* aTransport)
- : mOwner(aTransport)
- {}
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSIREQUESTOBSERVER
-private:
- ~CopierCallbacks() {}
-
- RefPtr<PresentationTCPSessionTransport> mOwner;
-};
-
-NS_IMPL_ISUPPORTS(CopierCallbacks, nsIRequestObserver)
-
-NS_IMETHODIMP
-CopierCallbacks::OnStartRequest(nsIRequest* aRequest, nsISupports* aContext)
-{
- return NS_OK;
-}
-
-NS_IMETHODIMP
-CopierCallbacks::OnStopRequest(nsIRequest* aRequest, nsISupports* aContext, nsresult aStatus)
-{
- mOwner->NotifyCopyComplete(aStatus);
- return NS_OK;
-}
-
-NS_IMPL_CYCLE_COLLECTION(PresentationTCPSessionTransport, mTransport,
- mSocketInputStream, mSocketOutputStream,
- mInputStreamPump, mInputStreamScriptable,
- mMultiplexStream, mMultiplexStreamCopier, mCallback)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(PresentationTCPSessionTransport)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(PresentationTCPSessionTransport)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(PresentationTCPSessionTransport)
- NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIPresentationSessionTransport)
- NS_INTERFACE_MAP_ENTRY(nsIInputStreamCallback)
- NS_INTERFACE_MAP_ENTRY(nsIPresentationSessionTransport)
- NS_INTERFACE_MAP_ENTRY(nsIPresentationSessionTransportBuilder)
- NS_INTERFACE_MAP_ENTRY(nsIPresentationTCPSessionTransportBuilder)
- NS_INTERFACE_MAP_ENTRY(nsIRequestObserver)
- NS_INTERFACE_MAP_ENTRY(nsIStreamListener)
- NS_INTERFACE_MAP_ENTRY(nsITransportEventSink)
-NS_INTERFACE_MAP_END
-
-PresentationTCPSessionTransport::PresentationTCPSessionTransport()
- : mReadyState(ReadyState::CLOSED)
- , mAsyncCopierActive(false)
- , mCloseStatus(NS_OK)
- , mDataNotificationEnabled(false)
-{
-}
-
-PresentationTCPSessionTransport::~PresentationTCPSessionTransport()
-{
-}
-
-NS_IMETHODIMP
-PresentationTCPSessionTransport::BuildTCPSenderTransport(nsISocketTransport* aTransport,
- nsIPresentationSessionTransportBuilderListener* aListener)
-{
- if (NS_WARN_IF(!aTransport)) {
- return NS_ERROR_INVALID_ARG;
- }
- mTransport = aTransport;
-
- if (NS_WARN_IF(!aListener)) {
- return NS_ERROR_INVALID_ARG;
- }
- mListener = aListener;
-
- nsresult rv = CreateStream();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mRole = nsIPresentationService::ROLE_CONTROLLER;
-
- nsCOMPtr<nsIPresentationSessionTransport> sessionTransport = do_QueryObject(this);
- nsCOMPtr<nsIRunnable> onSessionTransportRunnable =
- NewRunnableMethod
- <nsIPresentationSessionTransport*>(mListener,
- &nsIPresentationSessionTransportBuilderListener::OnSessionTransport,
- sessionTransport);
-
- NS_DispatchToCurrentThread(onSessionTransportRunnable.forget());
-
- nsCOMPtr<nsIRunnable> setReadyStateRunnable =
- NewRunnableMethod<ReadyState>(this,
- &PresentationTCPSessionTransport::SetReadyState,
- ReadyState::OPEN);
- return NS_DispatchToCurrentThread(setReadyStateRunnable.forget());
-}
-
-NS_IMETHODIMP
-PresentationTCPSessionTransport::BuildTCPReceiverTransport(nsIPresentationChannelDescription* aDescription,
- nsIPresentationSessionTransportBuilderListener* aListener)
-{
- if (NS_WARN_IF(!aDescription)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- if (NS_WARN_IF(!aListener)) {
- return NS_ERROR_INVALID_ARG;
- }
- mListener = aListener;
-
- uint16_t serverPort;
- nsresult rv = aDescription->GetTcpPort(&serverPort);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- nsCOMPtr<nsIArray> serverHosts;
- rv = aDescription->GetTcpAddress(getter_AddRefs(serverHosts));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- // TODO bug 1228504 Take all IP addresses in PresentationChannelDescription
- // into account. And at the first stage Presentation API is only exposed on
- // Firefox OS where the first IP appears enough for most scenarios.
- nsCOMPtr<nsISupportsCString> supportStr = do_QueryElementAt(serverHosts, 0);
- if (NS_WARN_IF(!supportStr)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- nsAutoCString serverHost;
- supportStr->GetData(serverHost);
- if (serverHost.IsEmpty()) {
- return NS_ERROR_INVALID_ARG;
- }
-
- PRES_DEBUG("%s:ServerHost[%s],ServerPort[%d]\n", __func__, serverHost.get(), serverPort);
-
- SetReadyState(ReadyState::CONNECTING);
-
- nsCOMPtr<nsISocketTransportService> sts =
- do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID);
- if (NS_WARN_IF(!sts)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- rv = sts->CreateTransport(nullptr, 0, serverHost, serverPort, nullptr,
- getter_AddRefs(mTransport));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- nsCOMPtr<nsIThread> mainThread;
- NS_GetMainThread(getter_AddRefs(mainThread));
-
- mTransport->SetEventSink(this, mainThread);
-
- rv = CreateStream();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mRole = nsIPresentationService::ROLE_RECEIVER;
-
- nsCOMPtr<nsIPresentationSessionTransport> sessionTransport = do_QueryObject(this);
- nsCOMPtr<nsIRunnable> runnable =
- NewRunnableMethod
- <nsIPresentationSessionTransport*>(mListener,
- &nsIPresentationSessionTransportBuilderListener::OnSessionTransport,
- sessionTransport);
- return NS_DispatchToCurrentThread(runnable.forget());
-}
-
-nsresult
-PresentationTCPSessionTransport::CreateStream()
-{
- nsresult rv = mTransport->OpenInputStream(0, 0, 0, getter_AddRefs(mSocketInputStream));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- rv = mTransport->OpenOutputStream(nsITransport::OPEN_UNBUFFERED, 0, 0, getter_AddRefs(mSocketOutputStream));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- // If the other side is not listening, we will get an |onInputStreamReady|
- // callback where |available| raises to indicate the connection was refused.
- nsCOMPtr<nsIAsyncInputStream> asyncStream = do_QueryInterface(mSocketInputStream);
- if (NS_WARN_IF(!asyncStream)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- nsCOMPtr<nsIThread> mainThread;
- NS_GetMainThread(getter_AddRefs(mainThread));
-
- rv = asyncStream->AsyncWait(this, nsIAsyncInputStream::WAIT_CLOSURE_ONLY, 0, mainThread);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mInputStreamScriptable = do_CreateInstance("@mozilla.org/scriptableinputstream;1", &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- rv = mInputStreamScriptable->Init(mSocketInputStream);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mMultiplexStream = do_CreateInstance("@mozilla.org/io/multiplex-input-stream;1", &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mMultiplexStreamCopier = do_CreateInstance("@mozilla.org/network/async-stream-copier;1", &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- nsCOMPtr<nsISocketTransportService> sts =
- do_GetService(NS_SOCKETTRANSPORTSERVICE_CONTRACTID);
- if (NS_WARN_IF(!sts)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- nsCOMPtr<nsIEventTarget> target = do_QueryInterface(sts);
- rv = mMultiplexStreamCopier->Init(mMultiplexStream,
- mSocketOutputStream,
- target,
- true, /* source buffered */
- false, /* sink buffered */
- BUFFER_SIZE,
- false, /* close source */
- false); /* close sink */
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-nsresult
-PresentationTCPSessionTransport::CreateInputStreamPump()
-{
- if (NS_WARN_IF(mInputStreamPump)) {
- return NS_OK;
- }
-
- nsresult rv;
- mInputStreamPump = do_CreateInstance(NS_INPUTSTREAMPUMP_CONTRACTID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- rv = mInputStreamPump->Init(mSocketInputStream, -1, -1, 0, 0, false);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- rv = mInputStreamPump->AsyncRead(this, nullptr);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationTCPSessionTransport::EnableDataNotification()
-{
- if (NS_WARN_IF(!mCallback)) {
- return NS_ERROR_DOM_INVALID_STATE_ERR;
- }
-
- if (mDataNotificationEnabled) {
- return NS_OK;
- }
-
- mDataNotificationEnabled = true;
-
- if (IsReadyToNotifyData()) {
- return CreateInputStreamPump();
- }
-
- return NS_OK;
-}
-
-// nsIPresentationSessionTransportBuilderListener
-NS_IMETHODIMP
-PresentationTCPSessionTransport::GetCallback(nsIPresentationSessionTransportCallback** aCallback)
-{
- nsCOMPtr<nsIPresentationSessionTransportCallback> callback = mCallback;
- callback.forget(aCallback);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationTCPSessionTransport::SetCallback(nsIPresentationSessionTransportCallback* aCallback)
-{
- mCallback = aCallback;
-
- if (!!mCallback && ReadyState::OPEN == mReadyState) {
- // Notify the transport channel is ready.
- Unused << NS_WARN_IF(NS_FAILED(mCallback->NotifyTransportReady()));
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationTCPSessionTransport::GetSelfAddress(nsINetAddr** aSelfAddress)
-{
- if (NS_WARN_IF(!mTransport)) {
- return NS_ERROR_DOM_INVALID_STATE_ERR;
- }
-
- return mTransport->GetScriptableSelfAddr(aSelfAddress);
-}
-
-void
-PresentationTCPSessionTransport::EnsureCopying()
-{
- if (mAsyncCopierActive) {
- return;
- }
-
- mAsyncCopierActive = true;
- RefPtr<CopierCallbacks> callbacks = new CopierCallbacks(this);
- Unused << NS_WARN_IF(NS_FAILED(mMultiplexStreamCopier->AsyncCopy(callbacks, nullptr)));
-}
-
-void
-PresentationTCPSessionTransport::NotifyCopyComplete(nsresult aStatus)
-{
- mAsyncCopierActive = false;
- mMultiplexStream->RemoveStream(0);
- if (NS_WARN_IF(NS_FAILED(aStatus))) {
- if (mReadyState != ReadyState::CLOSED) {
- mCloseStatus = aStatus;
- SetReadyState(ReadyState::CLOSED);
- }
- return;
- }
-
- uint32_t count;
- nsresult rv = mMultiplexStream->GetCount(&count);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return;
- }
-
- if (count) {
- EnsureCopying();
- return;
- }
-
- if (mReadyState == ReadyState::CLOSING) {
- mSocketOutputStream->Close();
- mCloseStatus = NS_OK;
- SetReadyState(ReadyState::CLOSED);
- }
-}
-
-NS_IMETHODIMP
-PresentationTCPSessionTransport::Send(const nsAString& aData)
-{
- if (NS_WARN_IF(mReadyState != ReadyState::OPEN)) {
- return NS_ERROR_DOM_INVALID_STATE_ERR;
- }
-
- nsresult rv;
- nsCOMPtr<nsIStringInputStream> stream =
- do_CreateInstance(NS_STRINGINPUTSTREAM_CONTRACTID, &rv);
- if(NS_WARN_IF(NS_FAILED(rv))) {
- return NS_ERROR_DOM_INVALID_STATE_ERR;
- }
-
- NS_ConvertUTF16toUTF8 msgString(aData);
- rv = stream->SetData(msgString.BeginReading(), msgString.Length());
- if(NS_WARN_IF(NS_FAILED(rv))) {
- return NS_ERROR_DOM_INVALID_STATE_ERR;
- }
-
- mMultiplexStream->AppendStream(stream);
-
- EnsureCopying();
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationTCPSessionTransport::SendBinaryMsg(const nsACString& aData)
-{
- return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
-}
-
-NS_IMETHODIMP
-PresentationTCPSessionTransport::SendBlob(nsIDOMBlob* aBlob)
-{
- return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
-}
-
-NS_IMETHODIMP
-PresentationTCPSessionTransport::Close(nsresult aReason)
-{
- PRES_DEBUG("%s:reason[%x]\n", __func__, aReason);
-
- if (mReadyState == ReadyState::CLOSED || mReadyState == ReadyState::CLOSING) {
- return NS_OK;
- }
-
- mCloseStatus = aReason;
- SetReadyState(ReadyState::CLOSING);
-
- uint32_t count = 0;
- mMultiplexStream->GetCount(&count);
- if (!count) {
- mSocketOutputStream->Close();
- }
-
- mSocketInputStream->Close();
- mDataNotificationEnabled = false;
-
- mListener = nullptr;
-
- return NS_OK;
-}
-
-void
-PresentationTCPSessionTransport::SetReadyState(ReadyState aReadyState)
-{
- mReadyState = aReadyState;
-
- if (mReadyState == ReadyState::OPEN) {
- if (IsReadyToNotifyData()) {
- CreateInputStreamPump();
- }
-
- if (NS_WARN_IF(!mCallback)) {
- return;
- }
-
- // Notify the transport channel is ready.
- Unused << NS_WARN_IF(NS_FAILED(mCallback->NotifyTransportReady()));
- } else if (mReadyState == ReadyState::CLOSED && mCallback) {
- if (NS_WARN_IF(!mCallback)) {
- return;
- }
-
- // Notify the transport channel has been shut down.
- Unused <<
- NS_WARN_IF(NS_FAILED(mCallback->NotifyTransportClosed(mCloseStatus)));
- mCallback = nullptr;
- }
-}
-
-// nsITransportEventSink
-NS_IMETHODIMP
-PresentationTCPSessionTransport::OnTransportStatus(nsITransport* aTransport,
- nsresult aStatus,
- int64_t aProgress,
- int64_t aProgressMax)
-{
- PRES_DEBUG("%s:aStatus[%x]\n", __func__, aStatus);
-
- MOZ_ASSERT(NS_IsMainThread());
-
- if (aStatus != NS_NET_STATUS_CONNECTED_TO) {
- return NS_OK;
- }
-
- SetReadyState(ReadyState::OPEN);
-
- return NS_OK;
-}
-
-// nsIInputStreamCallback
-NS_IMETHODIMP
-PresentationTCPSessionTransport::OnInputStreamReady(nsIAsyncInputStream* aStream)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- // Only used for detecting if the connection was refused.
- uint64_t dummy;
- nsresult rv = aStream->Available(&dummy);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- if (mReadyState != ReadyState::CLOSED) {
- mCloseStatus = NS_ERROR_CONNECTION_REFUSED;
- SetReadyState(ReadyState::CLOSED);
- }
- }
-
- return NS_OK;
-}
-
-// nsIRequestObserver
-NS_IMETHODIMP
-PresentationTCPSessionTransport::OnStartRequest(nsIRequest* aRequest,
- nsISupports* aContext)
-{
- // Do nothing.
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationTCPSessionTransport::OnStopRequest(nsIRequest* aRequest,
- nsISupports* aContext,
- nsresult aStatusCode)
-{
- PRES_DEBUG("%s:aStatusCode[%x]\n", __func__, aStatusCode);
-
- MOZ_ASSERT(NS_IsMainThread());
-
- uint32_t count;
- nsresult rv = mMultiplexStream->GetCount(&count);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mInputStreamPump = nullptr;
-
- if (count != 0 && NS_SUCCEEDED(aStatusCode)) {
- // If we have some buffered output still, and status is not an error, the
- // other side has done a half-close, but we don't want to be in the close
- // state until we are done sending everything that was buffered. We also
- // don't want to call |NotifyTransportClosed| yet.
- return NS_OK;
- }
-
- // We call this even if there is no error.
- if (mReadyState != ReadyState::CLOSED) {
- mCloseStatus = aStatusCode;
- SetReadyState(ReadyState::CLOSED);
- }
- return NS_OK;
-}
-
-// nsIStreamListener
-NS_IMETHODIMP
-PresentationTCPSessionTransport::OnDataAvailable(nsIRequest* aRequest,
- nsISupports* aContext,
- nsIInputStream* aStream,
- uint64_t aOffset,
- uint32_t aCount)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!mCallback)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- nsCString data;
- nsresult rv = mInputStreamScriptable->ReadBytes(aCount, data);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- // Pass the incoming data to the listener.
- return mCallback->NotifyData(data, false);
-}
diff --git a/dom/presentation/PresentationTCPSessionTransport.h b/dom/presentation/PresentationTCPSessionTransport.h
deleted file mode 100644
index f36b371a4..000000000
--- a/dom/presentation/PresentationTCPSessionTransport.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationSessionTransport_h
-#define mozilla_dom_PresentationSessionTransport_h
-
-#include "mozilla/RefPtr.h"
-#include "nsCOMPtr.h"
-#include "nsIAsyncInputStream.h"
-#include "nsIPresentationSessionTransport.h"
-#include "nsIPresentationSessionTransportBuilder.h"
-#include "nsIStreamListener.h"
-#include "nsISupportsImpl.h"
-#include "nsITransport.h"
-
-class nsISocketTransport;
-class nsIInputStreamPump;
-class nsIScriptableInputStream;
-class nsIMultiplexInputStream;
-class nsIAsyncStreamCopier;
-class nsIInputStream;
-
-namespace mozilla {
-namespace dom {
-
-/*
- * App-to-App transport channel for the presentation session. It's usually
- * initialized with an |InitWithSocketTransport| call if at the presenting sender
- * side; whereas it's initialized with an |InitWithChannelDescription| if at the
- * presenting receiver side. The lifetime is managed in either
- * |PresentationControllingInfo| (sender side) or |PresentationPresentingInfo|
- * (receiver side) in PresentationSessionInfo.cpp.
- */
-class PresentationTCPSessionTransport final : public nsIPresentationSessionTransport
- , public nsIPresentationTCPSessionTransportBuilder
- , public nsITransportEventSink
- , public nsIInputStreamCallback
- , public nsIStreamListener
-{
-public:
- NS_DECL_CYCLE_COLLECTING_ISUPPORTS
- NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(PresentationTCPSessionTransport,
- nsIPresentationSessionTransport)
-
- NS_DECL_NSIPRESENTATIONSESSIONTRANSPORT
- NS_DECL_NSIPRESENTATIONSESSIONTRANSPORTBUILDER
- NS_DECL_NSIPRESENTATIONTCPSESSIONTRANSPORTBUILDER
- NS_DECL_NSITRANSPORTEVENTSINK
- NS_DECL_NSIINPUTSTREAMCALLBACK
- NS_DECL_NSIREQUESTOBSERVER
- NS_DECL_NSISTREAMLISTENER
-
- PresentationTCPSessionTransport();
-
- void NotifyCopyComplete(nsresult aStatus);
-
-private:
- ~PresentationTCPSessionTransport();
-
- nsresult CreateStream();
-
- nsresult CreateInputStreamPump();
-
- void EnsureCopying();
-
- enum class ReadyState {
- CONNECTING,
- OPEN,
- CLOSING,
- CLOSED
- };
-
- void SetReadyState(ReadyState aReadyState);
-
- bool IsReadyToNotifyData()
- {
- return mDataNotificationEnabled && mReadyState == ReadyState::OPEN;
- }
-
- ReadyState mReadyState;
- bool mAsyncCopierActive;
- nsresult mCloseStatus;
- bool mDataNotificationEnabled;
-
- uint8_t mRole = 0;
-
- // Raw socket streams
- nsCOMPtr<nsISocketTransport> mTransport;
- nsCOMPtr<nsIInputStream> mSocketInputStream;
- nsCOMPtr<nsIOutputStream> mSocketOutputStream;
-
- // Input stream machinery
- nsCOMPtr<nsIInputStreamPump> mInputStreamPump;
- nsCOMPtr<nsIScriptableInputStream> mInputStreamScriptable;
-
- // Output stream machinery
- nsCOMPtr<nsIMultiplexInputStream> mMultiplexStream;
- nsCOMPtr<nsIAsyncStreamCopier> mMultiplexStreamCopier;
-
- nsCOMPtr<nsIPresentationSessionTransportCallback> mCallback;
- nsCOMPtr<nsIPresentationSessionTransportBuilderListener> mListener;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationSessionTransport_h
diff --git a/dom/presentation/PresentationTerminateRequest.cpp b/dom/presentation/PresentationTerminateRequest.cpp
deleted file mode 100644
index 61fd8403f..000000000
--- a/dom/presentation/PresentationTerminateRequest.cpp
+++ /dev/null
@@ -1,73 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "PresentationTerminateRequest.h"
-#include "nsIPresentationControlChannel.h"
-#include "nsIPresentationDevice.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_ISUPPORTS(PresentationTerminateRequest, nsIPresentationTerminateRequest)
-
-PresentationTerminateRequest::PresentationTerminateRequest(
- nsIPresentationDevice* aDevice,
- const nsAString& aPresentationId,
- nsIPresentationControlChannel* aControlChannel,
- bool aIsFromReceiver)
- : mPresentationId(aPresentationId)
- , mDevice(aDevice)
- , mControlChannel(aControlChannel)
- , mIsFromReceiver(aIsFromReceiver)
-{
-}
-
-PresentationTerminateRequest::~PresentationTerminateRequest()
-{
-}
-
-// nsIPresentationTerminateRequest
-NS_IMETHODIMP
-PresentationTerminateRequest::GetDevice(nsIPresentationDevice** aRetVal)
-{
- NS_ENSURE_ARG_POINTER(aRetVal);
-
- nsCOMPtr<nsIPresentationDevice> device = mDevice;
- device.forget(aRetVal);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationTerminateRequest::GetPresentationId(nsAString& aRetVal)
-{
- aRetVal = mPresentationId;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationTerminateRequest::GetControlChannel(
- nsIPresentationControlChannel** aRetVal)
-{
- NS_ENSURE_ARG_POINTER(aRetVal);
-
- nsCOMPtr<nsIPresentationControlChannel> controlChannel = mControlChannel;
- controlChannel.forget(aRetVal);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationTerminateRequest::GetIsFromReceiver(bool* aRetVal)
-{
- *aRetVal = mIsFromReceiver;
-
- return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/PresentationTerminateRequest.h b/dom/presentation/PresentationTerminateRequest.h
deleted file mode 100644
index ca3563f8d..000000000
--- a/dom/presentation/PresentationTerminateRequest.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationTerminateRequest_h__
-#define mozilla_dom_PresentationTerminateRequest_h__
-
-#include "nsIPresentationTerminateRequest.h"
-#include "nsCOMPtr.h"
-#include "nsString.h"
-
-namespace mozilla {
-namespace dom {
-
-class PresentationTerminateRequest final : public nsIPresentationTerminateRequest
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONTERMINATEREQUEST
-
- PresentationTerminateRequest(nsIPresentationDevice* aDevice,
- const nsAString& aPresentationId,
- nsIPresentationControlChannel* aControlChannel,
- bool aIsFromReceiver);
-
-private:
- virtual ~PresentationTerminateRequest();
-
- nsString mPresentationId;
- nsCOMPtr<nsIPresentationDevice> mDevice;
- nsCOMPtr<nsIPresentationControlChannel> mControlChannel;
- bool mIsFromReceiver;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif /* mozilla_dom_PresentationTerminateRequest_h__ */
-
diff --git a/dom/presentation/PresentationTransportBuilderConstructor.cpp b/dom/presentation/PresentationTransportBuilderConstructor.cpp
deleted file mode 100644
index 98177958d..000000000
--- a/dom/presentation/PresentationTransportBuilderConstructor.cpp
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "PresentationTransportBuilderConstructor.h"
-
-#include "nsComponentManagerUtils.h"
-#include "nsIPresentationControlChannel.h"
-#include "nsIPresentationSessionTransport.h"
-#include "nsXULAppAPI.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_ISUPPORTS(DummyPresentationTransportBuilderConstructor,
- nsIPresentationTransportBuilderConstructor)
-
-NS_IMETHODIMP
-DummyPresentationTransportBuilderConstructor::CreateTransportBuilder(
- uint8_t aType,
- nsIPresentationSessionTransportBuilder** aRetval)
-{
- MOZ_ASSERT(false, "Unexpected to be invoked.");
- return NS_OK;
-}
-
-NS_IMPL_ISUPPORTS_INHERITED0(PresentationTransportBuilderConstructor,
- DummyPresentationTransportBuilderConstructor)
-
-/* static */ already_AddRefed<nsIPresentationTransportBuilderConstructor>
-PresentationTransportBuilderConstructor::Create()
-{
- nsCOMPtr<nsIPresentationTransportBuilderConstructor> constructor;
- if (XRE_IsContentProcess()) {
- constructor = new DummyPresentationTransportBuilderConstructor();
- } else {
- constructor = new PresentationTransportBuilderConstructor();
- }
-
- return constructor.forget();
-}
-
-NS_IMETHODIMP
-PresentationTransportBuilderConstructor::CreateTransportBuilder(
- uint8_t aType,
- nsIPresentationSessionTransportBuilder** aRetval)
-{
- if (NS_WARN_IF(!aRetval)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- *aRetval = nullptr;
-
- if (NS_WARN_IF(aType != nsIPresentationChannelDescription::TYPE_TCP &&
- aType != nsIPresentationChannelDescription::TYPE_DATACHANNEL)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- if (XRE_IsContentProcess()) {
- MOZ_ASSERT(false,
- "CreateTransportBuilder can only be invoked in parent process.");
- return NS_ERROR_FAILURE;
- }
-
- nsCOMPtr<nsIPresentationSessionTransportBuilder> builder;
- if (aType == nsIPresentationChannelDescription::TYPE_TCP) {
- builder =
- do_CreateInstance(PRESENTATION_TCP_SESSION_TRANSPORT_CONTRACTID);
- } else {
- builder =
- do_CreateInstance("@mozilla.org/presentation/datachanneltransportbuilder;1");
- }
-
- if (NS_WARN_IF(!builder)) {
- return NS_ERROR_DOM_OPERATION_ERR;
- }
-
- builder.forget(aRetval);
- return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/PresentationTransportBuilderConstructor.h b/dom/presentation/PresentationTransportBuilderConstructor.h
deleted file mode 100644
index 4250d61ba..000000000
--- a/dom/presentation/PresentationTransportBuilderConstructor.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationTransportBuilderConstructor_h
-#define mozilla_dom_PresentationTransportBuilderConstructor_h
-
-#include "nsCOMPtr.h"
-#include "nsIPresentationSessionTransportBuilder.h"
-#include "nsISupportsImpl.h"
-
-namespace mozilla {
-namespace dom {
-
-class DummyPresentationTransportBuilderConstructor :
- public nsIPresentationTransportBuilderConstructor
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONTRANSPORTBUILDERCONSTRUCTOR
-
- DummyPresentationTransportBuilderConstructor() = default;
-
-protected:
- virtual ~DummyPresentationTransportBuilderConstructor() = default;
-};
-
-class PresentationTransportBuilderConstructor final :
- public DummyPresentationTransportBuilderConstructor
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_NSIPRESENTATIONTRANSPORTBUILDERCONSTRUCTOR
-
- static already_AddRefed<nsIPresentationTransportBuilderConstructor>
- Create();
-
-private:
- PresentationTransportBuilderConstructor() = default;
- virtual ~PresentationTransportBuilderConstructor() = default;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationTransportBuilderConstructor_h
diff --git a/dom/presentation/interfaces/moz.build b/dom/presentation/interfaces/moz.build
deleted file mode 100644
index 935e39000..000000000
--- a/dom/presentation/interfaces/moz.build
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPIDL_SOURCES += [
- 'nsIPresentationControlChannel.idl',
- 'nsIPresentationControlService.idl',
- 'nsIPresentationDevice.idl',
- 'nsIPresentationDeviceManager.idl',
- 'nsIPresentationDevicePrompt.idl',
- 'nsIPresentationDeviceProvider.idl',
- 'nsIPresentationListener.idl',
- 'nsIPresentationLocalDevice.idl',
- 'nsIPresentationRequestUIGlue.idl',
- 'nsIPresentationService.idl',
- 'nsIPresentationSessionRequest.idl',
- 'nsIPresentationSessionTransport.idl',
- 'nsIPresentationSessionTransportBuilder.idl',
- 'nsIPresentationTerminateRequest.idl',
-]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- XPIDL_SOURCES += [
- 'nsIPresentationNetworkHelper.idl',
- ]
-
-XPIDL_MODULE = 'dom_presentation'
-
diff --git a/dom/presentation/interfaces/nsIPresentationControlChannel.idl b/dom/presentation/interfaces/nsIPresentationControlChannel.idl
deleted file mode 100644
index 669e4088e..000000000
--- a/dom/presentation/interfaces/nsIPresentationControlChannel.idl
+++ /dev/null
@@ -1,139 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIArray;
-interface nsIInputStream;
-
-[scriptable, uuid(ae318e05-2a4e-4f85-95c0-e8b191ad812c)]
-interface nsIPresentationChannelDescription: nsISupports
-{
- const unsigned short TYPE_TCP = 1;
- const unsigned short TYPE_DATACHANNEL = 2;
-
- // Type of transport channel.
- readonly attribute uint8_t type;
-
- // Addresses for TCP channel (as a list of nsISupportsCString).
- // Should only be used while type == TYPE_TCP.
- readonly attribute nsIArray tcpAddress;
-
- // Port number for TCP channel.
- // Should only be used while type == TYPE_TCP.
- readonly attribute uint16_t tcpPort;
-
- // SDP for Data Channel.
- // Should only be used while type == TYPE_DATACHANNEL.
- readonly attribute DOMString dataChannelSDP;
-};
-
-/*
- * The callbacks for events on control channel.
- */
-[scriptable, uuid(96dd548f-7d0f-43c1-b1ad-28e666cf1e82)]
-interface nsIPresentationControlChannelListener: nsISupports
-{
- /*
- * Callback for receiving offer from remote endpoint.
- * @param offer The received offer.
- */
- void onOffer(in nsIPresentationChannelDescription offer);
-
- /*
- * Callback for receiving answer from remote endpoint.
- * @param answer The received answer.
- */
- void onAnswer(in nsIPresentationChannelDescription answer);
-
- /*
- * Callback for receiving ICE candidate from remote endpoint.
- * @param answer The received answer.
- */
- void onIceCandidate(in DOMString candidate);
-
- /*
- * The callback for notifying channel connected. This should be async called
- * after nsIPresentationDevice::establishControlChannel.
- */
- void notifyConnected();
-
- /*
- * The callback for notifying channel disconnected.
- * @param reason The reason of channel close, NS_OK represents normal close.
- */
- void notifyDisconnected(in nsresult reason);
-
- /*
- * The callback for notifying the reconnect command is acknowledged.
- */
- void notifyReconnected();
-};
-
-/*
- * The control channel for establishing RTCPeerConnection for a presentation
- * session. SDP Offer/Answer will be exchanged through this interface. The
- * control channel should be in-order.
- */
-[scriptable, uuid(e60e208c-a9f5-4bc6-9a3e-47f3e4ae9c57)]
-interface nsIPresentationControlChannel: nsISupports
-{
- // The listener for handling events of this control channel.
- // All the events should be pending until listener is assigned.
- attribute nsIPresentationControlChannelListener listener;
-
- /*
- * Send offer to remote endpoint. |onOffer| should be invoked on remote
- * endpoint.
- * @param offer The offer to send.
- * @throws NS_ERROR_FAILURE on failure
- */
- void sendOffer(in nsIPresentationChannelDescription offer);
-
- /*
- * Send answer to remote endpoint. |onAnswer| should be invoked on remote
- * endpoint.
- * @param answer The answer to send.
- * @throws NS_ERROR_FAILURE on failure
- */
- void sendAnswer(in nsIPresentationChannelDescription answer);
-
- /*
- * Send ICE candidate to remote endpoint. |onIceCandidate| should be invoked
- * on remote endpoint.
- * @param candidate The candidate to send
- * @throws NS_ERROR_FAILURE on failure
- */
- void sendIceCandidate(in DOMString candidate);
-
- /*
- * Launch a presentation on remote endpoint.
- * @param presentationId The Id for representing this session.
- * @param url The URL requested to open by remote device.
- * @throws NS_ERROR_FAILURE on failure
- */
- void launch(in DOMString presentationId, in DOMString url);
-
- /*
- * Terminate a presentation on remote endpoint.
- * @param presentationId The Id for representing this session.
- * @throws NS_ERROR_FAILURE on failure
- */
- void terminate(in DOMString presentationId);
-
- /*
- * Disconnect the control channel.
- * @param reason The reason of disconnecting channel; NS_OK represents normal.
- */
- void disconnect(in nsresult reason);
-
- /*
- * Reconnect a presentation on remote endpoint.
- * Note that only controller is allowed to reconnect a session.
- * @param presentationId The Id for representing this session.
- * @param url The URL requested to open by remote device.
- * @throws NS_ERROR_FAILURE on failure
- */
- void reconnect(in DOMString presentationId, in DOMString url);
-};
diff --git a/dom/presentation/interfaces/nsIPresentationControlService.idl b/dom/presentation/interfaces/nsIPresentationControlService.idl
deleted file mode 100644
index d4b967b00..000000000
--- a/dom/presentation/interfaces/nsIPresentationControlService.idl
+++ /dev/null
@@ -1,156 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIPresentationControlChannel;
-
-%{C++
-#define PRESENTATION_CONTROL_SERVICE_CONTACT_ID \
- "@mozilla.org/presentation/control-service;1"
-%}
-
-/*
- * The device information required for establishing control channel.
- */
-[scriptable, uuid(296fd171-e4d0-4de0-99ff-ad8ed52ddef3)]
-interface nsITCPDeviceInfo: nsISupports
-{
- readonly attribute AUTF8String id;
- readonly attribute AUTF8String address;
- readonly attribute uint16_t port;
- // SHA-256 fingerprint of server certificate. Empty string represents
- // server doesn't support TLS or not available.
- readonly attribute AUTF8String certFingerprint;
-};
-
-[scriptable, uuid(09bddfaf-fcc2-4dc9-b33e-a509a1c2fb6d)]
-interface nsIPresentationControlServerListener: nsISupports
-{
- /**
- * Callback while the server is ready or restarted.
- * @param aPort
- * The port of the server socket.
- * @param aCertFingerprint
- * The SHA-256 fingerprint of TLS server certificate.
- * Empty string represents server started without encryption.
- */
- void onServerReady(in uint16_t aPort, in AUTF8String aCertFingerprint);
-
- /**
- * Callback while the server is stopped or fails to start.
- * @param aResult
- * The error cause of server stopped or the reason of
- * start failure.
- * NS_OK means the server is stopped by close.
- */
- void onServerStopped(in nsresult aResult);
-
- /**
- * Callback while the remote host is requesting to start a presentation session.
- * @param aDeviceInfo The device information related to the remote host.
- * @param aUrl The URL requested to open by remote device.
- * @param aPresentationId The Id for representing this session.
- * @param aControlChannel The control channel for this session.
- */
- void onSessionRequest(in nsITCPDeviceInfo aDeviceInfo,
- in DOMString aUrl,
- in DOMString aPresentationId,
- in nsIPresentationControlChannel aControlChannel);
-
- /**
- * Callback while the remote host is requesting to terminate a presentation session.
- * @param aDeviceInfo The device information related to the remote host.
- * @param aPresentationId The Id for representing this session.
- * @param aControlChannel The control channel for this session.
- * @param aIsFromReceiver true if termination is initiated by receiver.
- */
- void onTerminateRequest(in nsITCPDeviceInfo aDeviceInfo,
- in DOMString aPresentationId,
- in nsIPresentationControlChannel aControlChannel,
- in boolean aIsFromReceiver);
-
- /**
- * Callback while the remote host is requesting to reconnect a presentation session.
- * @param aDeviceInfo The device information related to the remote host.
- * @param aUrl The URL requested to open by remote device.
- * @param aPresentationId The Id for representing this session.
- * @param aControlChannel The control channel for this session.
- */
- void onReconnectRequest(in nsITCPDeviceInfo aDeviceInfo,
- in DOMString url,
- in DOMString aPresentationId,
- in nsIPresentationControlChannel aControlChannel);
-};
-
-/**
- * Presentation control service which can be used for both presentation
- * control client and server.
- */
-[scriptable, uuid(55d6b605-2389-4aae-a8fe-60d4440540ea)]
-interface nsIPresentationControlService: nsISupports
-{
- /**
- * This method initializes server socket. Caller should set listener and
- * monitor onServerReady event to get the correct server info.
- * @param aEncrypted
- * True for using TLS control channel.
- * @param aPort
- * The port of the server socket. Pass 0 or opt-out to indicate no
- * preference, and a port will be selected automatically.
- * @throws NS_ERROR_FAILURE if the server socket has been inited or the
- * server socket can not be inited.
- */
- void startServer(in boolean aEncrypted, [optional] in uint16_t aPort);
-
- /**
- * Request connection to designated remote presentation control receiver.
- * @param aDeviceInfo
- * The remtoe device info for establish connection.
- * @returns The control channel for this session.
- * @throws NS_ERROR_FAILURE if the Id hasn't been inited.
- */
- nsIPresentationControlChannel connect(in nsITCPDeviceInfo aDeviceInfo);
-
- /**
- * Check the compatibility to remote presentation control server.
- * @param aVersion
- * The version of remote server.
- */
- boolean isCompatibleServer(in uint32_t aVersion);
-
- /**
- * Close server socket and call |listener.onClose(NS_OK)|
- */
- void close();
-
- /**
- * Get the listen port of the TCP socket, valid after the server is ready.
- * 0 indicates the server socket is not ready or is closed.
- */
- readonly attribute uint16_t port;
-
- /**
- * The protocol version implemented by this server.
- */
- readonly attribute uint32_t version;
-
- /**
- * The id of the TCP presentation server. |requestSession| won't
- * work until the |id| is set.
- */
- attribute AUTF8String id;
-
- /**
- * The fingerprint of the TLS server certificate.
- * Empty string indicates the server is not ready or not encrypted.
- */
- attribute AUTF8String certFingerprint;
-
- /**
- * The listener for handling events of this presentation control server.
- * Listener must be provided before invoke |startServer| and |close|.
- */
- attribute nsIPresentationControlServerListener listener;
-};
diff --git a/dom/presentation/interfaces/nsIPresentationDevice.idl b/dom/presentation/interfaces/nsIPresentationDevice.idl
deleted file mode 100644
index 63e4a52ef..000000000
--- a/dom/presentation/interfaces/nsIPresentationDevice.idl
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIPresentationControlChannel;
-
-/*
- * Remote device.
- */
-[scriptable, uuid(b1e0a7af-5936-4066-8f2e-f789fb9a7e8f)]
-interface nsIPresentationDevice : nsISupports
-{
- // The unique Id for the device. UUID is recommanded.
- readonly attribute AUTF8String id;
-
- // The human-readable name of this device.
- readonly attribute AUTF8String name;
-
- // TODO expose more info in order to fulfill UX spec
- // The category of this device, could be "wifi", "bluetooth", "hdmi", etc.
- readonly attribute AUTF8String type;
-
- /*
- * Establish a control channel to this device.
- * @returns The control channel for this session.
- * @throws NS_ERROR_FAILURE if the establishment fails
- */
- nsIPresentationControlChannel establishControlChannel();
-
- // Do something when presentation session is disconnected.
- void disconnect();
-
- /*
- * Query if requested presentation URL is supported.
- * @params requestedUrl the designated URL for a presentation request.
- * @returns true if designated URL is supported.
- */
- boolean isRequestedUrlSupported(in DOMString requestedUrl);
-};
-
-
diff --git a/dom/presentation/interfaces/nsIPresentationDeviceManager.idl b/dom/presentation/interfaces/nsIPresentationDeviceManager.idl
deleted file mode 100644
index adff9fc09..000000000
--- a/dom/presentation/interfaces/nsIPresentationDeviceManager.idl
+++ /dev/null
@@ -1,51 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIArray;
-interface nsIPresentationDeviceProvider;
-
-%{C++
-#define PRESENTATION_DEVICE_MANAGER_CONTRACTID "@mozilla.org/presentation-device/manager;1"
-#define PRESENTATION_DEVICE_CHANGE_TOPIC "presentation-device-change"
-%}
-
-/*
- * Manager for the device availability. User can observe "presentation-device-change"
- * for any update of the available devices.
- */
-[scriptable, uuid(beb61db5-3d5f-454f-a15a-dbfa0337c569)]
-interface nsIPresentationDeviceManager : nsISupports
-{
- // true if there is any device available.
- readonly attribute boolean deviceAvailable;
-
- /*
- * Register a device provider manually.
- * @param provider The device provider to add.
- */
- void addDeviceProvider(in nsIPresentationDeviceProvider provider);
-
- /*
- * Unregister a device provider manually.
- * @param provider The device provider to remove.
- */
- void removeDeviceProvider(in nsIPresentationDeviceProvider provider);
-
- /*
- * Force all registered device providers to update device information.
- */
- void forceDiscovery();
-
- /*
- * Retrieve all available devices or all available devices that supports
- * designated presentation URLs, return a list of nsIPresentationDevice.
- * The returned list is a cached device list and could be out-of-date.
- * Observe device change events to get following updates.
- * @param presentationUrls the target presentation URLs for device filtering
- */
- nsIArray getAvailableDevices([optional] in nsIArray presentationUrls);
-};
-
diff --git a/dom/presentation/interfaces/nsIPresentationDevicePrompt.idl b/dom/presentation/interfaces/nsIPresentationDevicePrompt.idl
deleted file mode 100644
index 2900eb59c..000000000
--- a/dom/presentation/interfaces/nsIPresentationDevicePrompt.idl
+++ /dev/null
@@ -1,58 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIArray;
-interface nsIDOMEventTarget;
-interface nsIPresentationDevice;
-interface nsIPrincipal;
-
-%{C++
-#define PRESENTATION_DEVICE_PROMPT_CONTRACTID "@mozilla.org/presentation-device/prompt;1"
-%}
-
-/*
- * The information and callbacks for device selection
- */
-[scriptable, uuid(b2aa7f6a-9448-446a-bba4-9c29638b0ed4)]
-interface nsIPresentationDeviceRequest : nsISupports
-{
- // The origin which initiate the request.
- readonly attribute DOMString origin;
-
- // The array of candidate URLs.
- readonly attribute nsIArray requestURLs;
-
- // The XUL browser element that the request was originated in.
- readonly attribute nsIDOMEventTarget chromeEventHandler;
-
- // The principal of the request.
- readonly attribute nsIPrincipal principal;
-
- /*
- * Callback after selecting a device
- * @param device The selected device.
- */
- void select(in nsIPresentationDevice device);
-
- /*
- * Callback after selection failed or canceled by user.
- * @param reason The error cause for canceling this request.
- */
- void cancel(in nsresult reason);
-};
-
-/*
- * UI prompt for device selection.
- */
-[scriptable, uuid(ac1a7e44-de86-454f-a9f1-276de2539831)]
-interface nsIPresentationDevicePrompt : nsISupports
-{
- /*
- * Request a device selection.
- * @param request The information and callbacks of this selection request.
- */
- void promptDeviceSelection(in nsIPresentationDeviceRequest request);
-};
diff --git a/dom/presentation/interfaces/nsIPresentationDeviceProvider.idl b/dom/presentation/interfaces/nsIPresentationDeviceProvider.idl
deleted file mode 100644
index b2c5e530c..000000000
--- a/dom/presentation/interfaces/nsIPresentationDeviceProvider.idl
+++ /dev/null
@@ -1,75 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIPresentationDevice;
-interface nsIPresentationControlChannel;
-
-%{C++
-#define PRESENTATION_DEVICE_PROVIDER_CATEGORY "presentation-device-provider"
-%}
-
-/*
- * The callbacks for any device updates and session request.
- */
-[scriptable, uuid(46fd372b-2e40-4179-9b36-0478d141e440)]
-interface nsIPresentationDeviceListener: nsISupports
-{
- void addDevice(in nsIPresentationDevice device);
- void removeDevice(in nsIPresentationDevice device);
- void updateDevice(in nsIPresentationDevice device);
-
- /*
- * Callback while the remote device is requesting to start a presentation session.
- * @param device The remote device that sent session request.
- * @param url The URL requested to open by remote device.
- * @param presentationId The Id for representing this session.
- * @param controlChannel The control channel for this session.
- */
- void onSessionRequest(in nsIPresentationDevice device,
- in DOMString url,
- in DOMString presentationId,
- in nsIPresentationControlChannel controlChannel);
-
- /*
- * Callback while the remote device is requesting to terminate a presentation session.
- * @param device The remote device that sent session request.
- * @param presentationId The Id for representing this session.
- * @param controlChannel The control channel for this session.
- * @param aIsFromReceiver true if termination is initiated by receiver.
- */
- void onTerminateRequest(in nsIPresentationDevice device,
- in DOMString presentationId,
- in nsIPresentationControlChannel controlChannel,
- in boolean aIsFromReceiver);
-
- /*
- * Callback while the remote device is requesting to reconnect a presentation session.
- * @param device The remote device that sent session request.
- * @param aUrl The URL requested to open by remote device.
- * @param presentationId The Id for representing this session.
- * @param controlChannel The control channel for this session.
- */
- void onReconnectRequest(in nsIPresentationDevice device,
- in DOMString url,
- in DOMString presentationId,
- in nsIPresentationControlChannel controlChannel);
-};
-
-/*
- * Device provider for any device protocol, can be registered as default
- * providers by adding its contractID to category "presentation-device-provider".
- */
-[scriptable, uuid(3db2578a-0f50-44ad-b01b-28427b71b7bf)]
-interface nsIPresentationDeviceProvider: nsISupports
-{
- // The listener for handling any device update.
- attribute nsIPresentationDeviceListener listener;
-
- /*
- * Force to update device information.
- */
- void forceDiscovery();
-};
diff --git a/dom/presentation/interfaces/nsIPresentationListener.idl b/dom/presentation/interfaces/nsIPresentationListener.idl
deleted file mode 100644
index 546c2fd4b..000000000
--- a/dom/presentation/interfaces/nsIPresentationListener.idl
+++ /dev/null
@@ -1,50 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-[ref] native URLArrayRef(const nsTArray<nsString>);
-
-[uuid(0105f837-4279-4715-9d5b-2dc3f8b65353)]
-interface nsIPresentationAvailabilityListener : nsISupports
-{
- /*
- * Called when device availability changes.
- */
- [noscript] void notifyAvailableChange(in URLArrayRef urls,
- in bool available);
-};
-
-[scriptable, uuid(7dd48df8-8f8c-48c7-ac37-7b9fd1acf2f8)]
-interface nsIPresentationSessionListener : nsISupports
-{
- const unsigned short STATE_CONNECTING = 0;
- const unsigned short STATE_CONNECTED = 1;
- const unsigned short STATE_CLOSED = 2;
- const unsigned short STATE_TERMINATED = 3;
-
- /*
- * Called when session state changes.
- */
- void notifyStateChange(in DOMString sessionId,
- in unsigned short state,
- in nsresult reason);
-
- /*
- * Called when receive messages.
- */
- void notifyMessage(in DOMString sessionId,
- in ACString data,
- in boolean isBinary);
-};
-
-[scriptable, uuid(27f101d7-9ed1-429e-b4f8-43b00e8e111c)]
-interface nsIPresentationRespondingListener : nsISupports
-{
- /*
- * Called when an incoming session connects.
- */
- void notifySessionConnect(in unsigned long long windowId,
- in DOMString sessionId);
-};
diff --git a/dom/presentation/interfaces/nsIPresentationLocalDevice.idl b/dom/presentation/interfaces/nsIPresentationLocalDevice.idl
deleted file mode 100644
index 80e3b4041..000000000
--- a/dom/presentation/interfaces/nsIPresentationLocalDevice.idl
+++ /dev/null
@@ -1,17 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsIPresentationDevice.idl"
-
-/*
- * Local device.
- * This device is used for 1-UA use case. The result for display is rendered by
- * this host device.
- */
-[scriptable, uuid(dd239720-cab6-4fb5-9025-cba23f1bbc2d)]
-interface nsIPresentationLocalDevice : nsIPresentationDevice
-{
- // (1-UA only) The property is used to get the window ID of 1-UA device.
- readonly attribute AUTF8String windowId;
-};
diff --git a/dom/presentation/interfaces/nsIPresentationNetworkHelper.idl b/dom/presentation/interfaces/nsIPresentationNetworkHelper.idl
deleted file mode 100644
index 514075dfa..000000000
--- a/dom/presentation/interfaces/nsIPresentationNetworkHelper.idl
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-%{C++
-#define PRESENTATION_NETWORK_HELPER_CONTRACTID \
- "@mozilla.org/presentation-device/networkHelper;1"
-%}
-
-[scriptable, uuid(0a7e134f-ff80-4e73-91e6-12b3134fe568)]
-interface nsIPresentationNetworkHelperListener : nsISupports
-{
- /**
- * Called when error occurs.
- * @param aReason error message.
- */
- void onError(in AUTF8String aReason);
-
- /**
- * Called when get Wi-Fi IP address.
- * @param aIPAddress the IP address of Wi-Fi interface.
- */
- void onGetWifiIPAddress(in AUTF8String aIPAddress);
-};
-
-[scriptable, uuid(650dc16b-3d9c-49a6-9037-1d6f2d18c90c)]
-interface nsIPresentationNetworkHelper : nsISupports
-{
- /**
- * Get IP address of Wi-Fi interface.
- * @param aListener the callback interface.
- */
- void getWifiIPAddress(in nsIPresentationNetworkHelperListener aListener);
-};
diff --git a/dom/presentation/interfaces/nsIPresentationRequestUIGlue.idl b/dom/presentation/interfaces/nsIPresentationRequestUIGlue.idl
deleted file mode 100644
index dab1991e4..000000000
--- a/dom/presentation/interfaces/nsIPresentationRequestUIGlue.idl
+++ /dev/null
@@ -1,29 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIPresentationDevice;
-
-%{C++
-#define PRESENTATION_REQUEST_UI_GLUE_CONTRACTID \
- "@mozilla.org/presentation/requestuiglue;1"
-%}
-
-[scriptable, uuid(faa45119-6fb5-496c-aa4c-f740177a38b5)]
-interface nsIPresentationRequestUIGlue : nsISupports
-{
- /*
- * This method is called to open the responding app/page when
- * a presentation request comes in at receiver side.
- *
- * @param url The url of the request.
- * @param sessionId The session ID of the request.
- *
- * @return A promise that resolves to the opening frame.
- */
- nsISupports sendRequest(in DOMString url,
- in DOMString sessionId,
- in nsIPresentationDevice device);
-};
diff --git a/dom/presentation/interfaces/nsIPresentationService.idl b/dom/presentation/interfaces/nsIPresentationService.idl
deleted file mode 100644
index c3c15bb9f..000000000
--- a/dom/presentation/interfaces/nsIPresentationService.idl
+++ /dev/null
@@ -1,275 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIDOMBlob;
-interface nsIDOMEventTarget;
-interface nsIInputStream;
-interface nsIPresentationAvailabilityListener;
-interface nsIPresentationRespondingListener;
-interface nsIPresentationSessionListener;
-interface nsIPresentationTransportBuilderConstructor;
-interface nsIPrincipal;
-
-%{C++
-#define PRESENTATION_SERVICE_CID \
- { 0x1d9bb10c, 0xc0ab, 0x4fe8, \
- { 0x9e, 0x4f, 0x40, 0x58, 0xb8, 0x51, 0x98, 0x32 } }
-#define PRESENTATION_SERVICE_CONTRACTID \
- "@mozilla.org/presentation/presentationservice;1"
-
-#include "nsTArray.h"
-
-class nsString;
-%}
-
-[ref] native URLArrayRef(const nsTArray<nsString>);
-
-[scriptable, uuid(12073206-0065-4b10-9488-a6eb9b23e65b)]
-interface nsIPresentationServiceCallback : nsISupports
-{
- /*
- * Called when the operation succeeds.
- *
- * @param url: the selected request url used to start or reconnect a session.
- */
- void notifySuccess(in DOMString url);
-
- /*
- * Called when the operation fails.
- *
- * @param error: error message.
- */
- void notifyError(in nsresult error);
-};
-
-[scriptable, uuid(de42b741-5619-4650-b961-c2cebb572c95)]
-interface nsIPresentationService : nsISupports
-{
- const unsigned short ROLE_CONTROLLER = 0x1;
- const unsigned short ROLE_RECEIVER = 0x2;
-
- const unsigned short CLOSED_REASON_ERROR = 0x1;
- const unsigned short CLOSED_REASON_CLOSED = 0x2;
- const unsigned short CLOSED_REASON_WENTAWAY = 0x3;
-
- /*
- * Start a new presentation session and display a prompt box which asks users
- * to select a device.
- *
- * @param urls: The candidate Urls of presenting page. Only one url would be used.
- * @param sessionId: An ID to identify presentation session.
- * @param origin: The url of requesting page.
- * @param deviceId: The specified device of handling this request, null string
- * for prompt device selection dialog.
- * @param windowId: The inner window ID associated with the presentation
- * session. (0 implies no window ID since no actual window
- * uses 0 as its ID. Generally it's the case the window is
- * located in different process from this service)
- * @param eventTarget: The chrome event handler, in particular XUL browser
- * element in parent process, that the request was
- * originated in.
- * @param principal: The principal that initiated the session.
- * @param callback: Invoke the callback when the operation is completed.
- * NotifySuccess() is called with |id| if a session is
- * established successfully with the selected device.
- * Otherwise, NotifyError() is called with a error message.
- * @param constructor: The constructor for creating a transport builder.
- */
- [noscript] void startSession(in URLArrayRef urls,
- in DOMString sessionId,
- in DOMString origin,
- in DOMString deviceId,
- in unsigned long long windowId,
- in nsIDOMEventTarget eventTarget,
- in nsIPrincipal principal,
- in nsIPresentationServiceCallback callback,
- in nsIPresentationTransportBuilderConstructor constructor);
-
- /*
- * Send the message to the session.
- *
- * @param sessionId: An ID to identify presentation session.
- * @param role: Identify the function called by controller or receiver.
- * @param data: the message being sent out.
- */
- void sendSessionMessage(in DOMString sessionId,
- in uint8_t role,
- in DOMString data);
-
- /*
- * Send the binary message to the session.
- *
- * @param sessionId: An ID to identify presentation session.
- * @param role: Identify the function called by controller or receiver.
- * @param data: the message being sent out.
- */
- void sendSessionBinaryMsg(in DOMString sessionId,
- in uint8_t role,
- in ACString data);
-
- /*
- * Send the blob to the session.
- *
- * @param sessionId: An ID to identify presentation session.
- * @param role: Identify the function called by controller or receiver.
- * @param blob: The input blob to be sent.
- */
- void sendSessionBlob(in DOMString sessionId,
- in uint8_t role,
- in nsIDOMBlob blob);
-
- /*
- * Close the session.
- *
- * @param sessionId: An ID to identify presentation session.
- * @param role: Identify the function called by controller or receiver.
- */
- void closeSession(in DOMString sessionId,
- in uint8_t role,
- in uint8_t closedReason);
-
- /*
- * Terminate the session.
- *
- * @param sessionId: An ID to identify presentation session.
- * @param role: Identify the function called by controller or receiver.
- */
- void terminateSession(in DOMString sessionId,
- in uint8_t role);
-
- /*
- * Reconnect the session.
- *
- * @param url: The request Urls.
- * @param sessionId: An ID to identify presentation session.
- * @param role: Identify the function called by controller or receiver.
- * @param callback: NotifySuccess() is called when a control channel
- * is opened successfully.
- * Otherwise, NotifyError() is called with a error message.
- */
- [noscript] void reconnectSession(in URLArrayRef urls,
- in DOMString sessionId,
- in uint8_t role,
- in nsIPresentationServiceCallback callback);
-
- /*
- * Register an availability listener. Must be called from the main thread.
- *
- * @param availabilityUrls: The Urls that this listener is interested in.
- * @param listener: The listener to register.
- */
- [noscript] void registerAvailabilityListener(
- in URLArrayRef availabilityUrls,
- in nsIPresentationAvailabilityListener listener);
-
- /*
- * Unregister an availability listener. Must be called from the main thread.
- *
- * @param availabilityUrls: The Urls that are registered before.
- * @param listener: The listener to unregister.
- */
- [noscript] void unregisterAvailabilityListener(
- in URLArrayRef availabilityUrls,
- in nsIPresentationAvailabilityListener listener);
-
- /*
- * Register a session listener. Must be called from the main thread.
- *
- * @param sessionId: An ID to identify presentation session.
- * @param role: Identify the function called by controller or receiver.
- * @param listener: The listener to register.
- */
- void registerSessionListener(in DOMString sessionId,
- in uint8_t role,
- in nsIPresentationSessionListener listener);
-
- /*
- * Unregister a session listener. Must be called from the main thread.
- *
- * @param sessionId: An ID to identify presentation session.
- * @param role: Identify the function called by controller or receiver.
- */
- void unregisterSessionListener(in DOMString sessionId,
- in uint8_t role);
-
- /*
- * Register a responding listener. Must be called from the main thread.
- *
- * @param windowId: The window ID associated with the listener.
- * @param listener: The listener to register.
- */
- void registerRespondingListener(in unsigned long long windowId,
- in nsIPresentationRespondingListener listener);
-
- /*
- * Unregister a responding listener. Must be called from the main thread.
- * @param windowId: The window ID associated with the listener.
- */
- void unregisterRespondingListener(in unsigned long long windowId);
-
- /*
- * Notify the receiver page is ready for presentation use.
- *
- * @param sessionId An ID to identify presentation session.
- * @param windowId The inner window ID associated with the presentation
- * session.
- * @param isLoading true if receiver page is loading successfully.
- * @param constructor: The constructor for creating a transport builder.
- */
- void notifyReceiverReady(in DOMString sessionId,
- in unsigned long long windowId,
- in boolean isLoading,
- in nsIPresentationTransportBuilderConstructor constructor);
-
- /*
- * Notify the transport is closed
- *
- * @param sessionId: An ID to identify presentation session.
- * @param role: Identify the function called by controller or receiver.
- * @param reason: the error message. NS_OK indicates it is closed normally.
- */
- void NotifyTransportClosed(in DOMString sessionId,
- in uint8_t role,
- in nsresult reason);
-
- /*
- * Untrack the relevant info about the presentation session if there's any.
- *
- * @param sessionId: An ID to identify presentation session.
- * @param role: Identify the function called by controller or receiver.
- */
- void untrackSessionInfo(in DOMString sessionId, in uint8_t role);
-
- /*
- * The windowId for building RTCDataChannel session transport
- *
- * @param sessionId: An ID to identify presentation session.
- * @param role: Identify the function called by controller or receiver.
- */
- unsigned long long getWindowIdBySessionId(in DOMString sessionId,
- in uint8_t role);
-
- /*
- * Update the mapping of the session ID and window ID.
- *
- * @param sessionId: An ID to identify presentation session.
- * @param role: Identify the function called by controller or receiver.
- * @param windowId: The inner window ID associated with the presentation
- * session.
- */
- void updateWindowIdBySessionId(in DOMString sessionId,
- in uint8_t role,
- in unsigned long long windowId);
-
- /*
- * To build the session transport.
- * NOTE: This function should be only called at controller side.
- *
- * @param sessionId: An ID to identify presentation session.
- * @param role: Identify the function called by controller or receiver.
- */
- void buildTransport(in DOMString sessionId, in uint8_t role);
-};
diff --git a/dom/presentation/interfaces/nsIPresentationSessionRequest.idl b/dom/presentation/interfaces/nsIPresentationSessionRequest.idl
deleted file mode 100644
index 45a0e314c..000000000
--- a/dom/presentation/interfaces/nsIPresentationSessionRequest.idl
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIPresentationDevice;
-interface nsIPresentationControlChannel;
-
-%{C++
-#define PRESENTATION_SESSION_REQUEST_TOPIC "presentation-session-request"
-#define PRESENTATION_RECONNECT_REQUEST_TOPIC "presentation-reconnect-request"
-%}
-
-/*
- * The event of a device requesting for starting or reconnecting
- * a presentation session. User can monitor the session request
- * on every device by observing "presentation-sesion-request" for a
- * new session and "presentation-reconnect-request" for reconnecting.
- */
-[scriptable, uuid(d808a084-d0f8-455a-a8df-5879e05a755b)]
-interface nsIPresentationSessionRequest: nsISupports
-{
- // The device which requesting the presentation session.
- readonly attribute nsIPresentationDevice device;
-
- // The URL requested to open by remote device.
- readonly attribute DOMString url;
-
- // The Id for representing this session.
- readonly attribute DOMString presentationId;
-
- // The control channel for this session.
- readonly attribute nsIPresentationControlChannel controlChannel;
-};
diff --git a/dom/presentation/interfaces/nsIPresentationSessionTransport.idl b/dom/presentation/interfaces/nsIPresentationSessionTransport.idl
deleted file mode 100644
index a0b5617d7..000000000
--- a/dom/presentation/interfaces/nsIPresentationSessionTransport.idl
+++ /dev/null
@@ -1,69 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIDOMBlob;
-interface nsIInputStream;
-interface nsINetAddr;
-
-%{C++
-#define PRESENTATION_TCP_SESSION_TRANSPORT_CONTRACTID \
- "@mozilla.org/presentation/presentationtcpsessiontransport;1"
-%}
-
-/*
- * The callback for session transport events.
- */
-[scriptable, uuid(9f158786-41a6-4a10-b29b-9497f25d4b67)]
-interface nsIPresentationSessionTransportCallback : nsISupports
-{
- void notifyTransportReady();
- void notifyTransportClosed(in nsresult reason);
- void notifyData(in ACString data, in boolean isBinary);
-};
-
-/*
- * App-to-App transport channel for the presentation session.
- */
-[scriptable, uuid(670b7e1b-65be-42b6-a596-be571907fa18)]
-interface nsIPresentationSessionTransport : nsISupports
-{
- // Should be set once the underlying session transport is built
- attribute nsIPresentationSessionTransportCallback callback;
-
- // valid for TCP session transport
- readonly attribute nsINetAddr selfAddress;
-
- /*
- * Enable the notification for incoming data. |notifyData| of
- * |nsIPresentationSessionTransportCallback| can start getting invoked.
- * Should set callback before |enableDataNotification| is called.
- */
- void enableDataNotification();
-
- /*
- * Send message to the remote endpoint.
- * @param data The message to send.
- */
- void send(in DOMString data);
-
- /*
- * Send the binary message to the remote endpoint.
- * @param data: the message being sent out.
- */
- void sendBinaryMsg(in ACString data);
-
- /*
- * Send the blob to the remote endpoint.
- * @param blob: The input blob to be sent.
- */
- void sendBlob(in nsIDOMBlob blob);
-
- /*
- * Close this session transport.
- * @param reason The reason for closing this session transport.
- */
- void close(in nsresult reason);
-};
diff --git a/dom/presentation/interfaces/nsIPresentationSessionTransportBuilder.idl b/dom/presentation/interfaces/nsIPresentationSessionTransportBuilder.idl
deleted file mode 100644
index 969f37d71..000000000
--- a/dom/presentation/interfaces/nsIPresentationSessionTransportBuilder.idl
+++ /dev/null
@@ -1,80 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIPresentationChannelDescription;
-interface nsISocketTransport;
-interface mozIDOMWindow;
-interface nsIPresentationControlChannel;
-interface nsIPresentationSessionTransport;
-
-[scriptable, uuid(673f6de1-e253-41b8-9be8-b7ff161fa8dc)]
-interface nsIPresentationSessionTransportBuilderListener : nsISupports
-{
- // Should set |transport.callback| in |onSessionTransport|.
- void onSessionTransport(in nsIPresentationSessionTransport transport);
- void onError(in nsresult reason);
-
- void sendOffer(in nsIPresentationChannelDescription offer);
- void sendAnswer(in nsIPresentationChannelDescription answer);
- void sendIceCandidate(in DOMString candidate);
- void close(in nsresult reason);
-};
-
-[scriptable, uuid(2fdbe67d-80f9-48dc-8237-5bef8fa19801)]
-interface nsIPresentationSessionTransportBuilder : nsISupports
-{
-};
-
-/**
- * The constructor for creating a transport builder.
- */
-[scriptable, uuid(706482b2-1b51-4bed-a21d-785a9cfcfac7)]
-interface nsIPresentationTransportBuilderConstructor : nsISupports
-{
- nsIPresentationSessionTransportBuilder createTransportBuilder(in uint8_t type);
-};
-
-/**
- * Builder for TCP session transport
- */
-[scriptable, uuid(cde36d6e-f471-4262-a70d-f932a26b21d9)]
-interface nsIPresentationTCPSessionTransportBuilder : nsIPresentationSessionTransportBuilder
-{
- /**
- * The following creation functions will trigger |listener.onSessionTransport|
- * if the session transport is successfully built, |listener.onError| if some
- * error occurs during building session transport.
- */
- void buildTCPSenderTransport(in nsISocketTransport aTransport,
- in nsIPresentationSessionTransportBuilderListener aListener);
-
- void buildTCPReceiverTransport(in nsIPresentationChannelDescription aDescription,
- in nsIPresentationSessionTransportBuilderListener aListener);
-};
-
-/**
- * Builder for WebRTC data channel session transport
- */
-[scriptable, uuid(8131c4e0-3a8c-4bc1-a92a-8431473d2fe8)]
-interface nsIPresentationDataChannelSessionTransportBuilder : nsIPresentationSessionTransportBuilder
-{
- /**
- * The following creation function will trigger |listener.onSessionTransport|
- * if the session transport is successfully built, |listener.onError| if some
- * error occurs during creating session transport. The |notifyConnected| of
- * |aControlChannel| should be called before calling
- * |buildDataChannelTransport|.
- */
- void buildDataChannelTransport(in uint8_t aRole,
- in mozIDOMWindow aWindow,
- in nsIPresentationSessionTransportBuilderListener aListener);
-
- // Bug 1275150 - Merge TCP builder with the following APIs
- void onOffer(in nsIPresentationChannelDescription offer);
- void onAnswer(in nsIPresentationChannelDescription answer);
- void onIceCandidate(in DOMString candidate);
- void notifyDisconnected(in nsresult reason);
-};
diff --git a/dom/presentation/interfaces/nsIPresentationTerminateRequest.idl b/dom/presentation/interfaces/nsIPresentationTerminateRequest.idl
deleted file mode 100644
index a9f86fa0d..000000000
--- a/dom/presentation/interfaces/nsIPresentationTerminateRequest.idl
+++ /dev/null
@@ -1,33 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface nsIPresentationDevice;
-interface nsIPresentationControlChannel;
-
-%{C++
-#define PRESENTATION_TERMINATE_REQUEST_TOPIC "presentation-terminate-request"
-%}
-
-/*
- * The event of a device requesting for terminating a presentation session. User can
- * monitor the terminate request on every device by observing "presentation-terminate-request".
- */
-[scriptable, uuid(3ddbf3a4-53ee-4b70-9bbc-58ac90dce6b5)]
-interface nsIPresentationTerminateRequest: nsISupports
-{
- // The device which requesting to terminate presentation session.
- readonly attribute nsIPresentationDevice device;
-
- // The Id for representing this session.
- readonly attribute DOMString presentationId;
-
- // The control channel for this session.
- // Should only use this channel to complete session termination.
- readonly attribute nsIPresentationControlChannel controlChannel;
-
- // True if termination is initiated by receiver.
- readonly attribute boolean isFromReceiver;
-};
diff --git a/dom/presentation/ipc/PPresentation.ipdl b/dom/presentation/ipc/PPresentation.ipdl
deleted file mode 100644
index e0f4d2888..000000000
--- a/dom/presentation/ipc/PPresentation.ipdl
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et ft=cpp : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-include protocol PContent;
-include protocol PPresentationRequest;
-include protocol PPresentationBuilder;
-
-include InputStreamParams;
-
-using class IPC::Principal from "mozilla/dom/PermissionMessageUtils.h";
-using mozilla::dom::TabId from "mozilla/dom/ipc/IdType.h";
-
-namespace mozilla {
-namespace dom {
-
-struct StartSessionRequest
-{
- nsString[] urls;
- nsString sessionId;
- nsString origin;
- nsString deviceId;
- uint64_t windowId;
- TabId tabId;
- Principal principal;
-};
-
-struct SendSessionMessageRequest
-{
- nsString sessionId;
- uint8_t role;
- nsString data;
-};
-
-struct CloseSessionRequest
-{
- nsString sessionId;
- uint8_t role;
- uint8_t closedReason;
-};
-
-struct TerminateSessionRequest
-{
- nsString sessionId;
- uint8_t role;
-};
-
-struct ReconnectSessionRequest
-{
- nsString[] urls;
- nsString sessionId;
- uint8_t role;
-};
-
-struct BuildTransportRequest
-{
- nsString sessionId;
- uint8_t role;
-};
-
-union PresentationIPCRequest
-{
- StartSessionRequest;
- SendSessionMessageRequest;
- CloseSessionRequest;
- TerminateSessionRequest;
- ReconnectSessionRequest;
- BuildTransportRequest;
-};
-
-sync protocol PPresentation
-{
- manager PContent;
- manages PPresentationBuilder;
- manages PPresentationRequest;
-
-child:
- async NotifyAvailableChange(nsString[] aAvailabilityUrls,
- bool aAvailable);
- async NotifySessionStateChange(nsString aSessionId,
- uint16_t aState,
- nsresult aReason);
- async NotifyMessage(nsString aSessionId, nsCString aData, bool aIsBinary);
- async NotifySessionConnect(uint64_t aWindowId, nsString aSessionId);
- async NotifyCloseSessionTransport(nsString aSessionId,
- uint8_t aRole,
- nsresult aReason);
-
- async PPresentationBuilder(nsString aSessionId, uint8_t aRole);
-
-parent:
- async __delete__();
-
- async RegisterAvailabilityHandler(nsString[] aAvailabilityUrls);
- async UnregisterAvailabilityHandler(nsString[] aAvailabilityUrls);
-
- async RegisterSessionHandler(nsString aSessionId, uint8_t aRole);
- async UnregisterSessionHandler(nsString aSessionId, uint8_t aRole);
-
- async RegisterRespondingHandler(uint64_t aWindowId);
- async UnregisterRespondingHandler(uint64_t aWindowId);
-
- async PPresentationRequest(PresentationIPCRequest aRequest);
-
- async NotifyReceiverReady(nsString aSessionId, uint64_t aWindowId, bool aIsLoading);
- async NotifyTransportClosed(nsString aSessionId, uint8_t aRole, nsresult aReason);
-};
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/ipc/PPresentationBuilder.ipdl b/dom/presentation/ipc/PPresentationBuilder.ipdl
deleted file mode 100644
index e32b02e8f..000000000
--- a/dom/presentation/ipc/PPresentationBuilder.ipdl
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-include protocol PPresentation;
-
-namespace mozilla {
-namespace dom {
-
-async protocol PPresentationBuilder
-{
- manager PPresentation;
-
-parent:
- async SendOffer(nsString aSDP);
- async SendAnswer(nsString aSDP);
- async SendIceCandidate(nsString aCandidate);
- async Close(nsresult aReason);
-
- async OnSessionTransport();
- async OnSessionTransportError(nsresult aReason);
-
-child:
- async OnOffer(nsString aSDP);
- async OnAnswer(nsString aSDP);
- async OnIceCandidate(nsString aCandidate);
-
- async __delete__();
-};
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/ipc/PPresentationRequest.ipdl b/dom/presentation/ipc/PPresentationRequest.ipdl
deleted file mode 100644
index fa99dfcab..000000000
--- a/dom/presentation/ipc/PPresentationRequest.ipdl
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-include protocol PPresentation;
-
-namespace mozilla {
-namespace dom {
-
-sync protocol PPresentationRequest
-{
- manager PPresentation;
-
-child:
- async __delete__(nsresult result);
- async NotifyRequestUrlSelected(nsString aUrl);
-};
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/ipc/PresentationBuilderChild.cpp b/dom/presentation/ipc/PresentationBuilderChild.cpp
deleted file mode 100644
index 387332e9e..000000000
--- a/dom/presentation/ipc/PresentationBuilderChild.cpp
+++ /dev/null
@@ -1,184 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "DCPresentationChannelDescription.h"
-#include "nsComponentManagerUtils.h"
-#include "nsGlobalWindow.h"
-#include "PresentationBuilderChild.h"
-#include "PresentationIPCService.h"
-#include "nsServiceManagerUtils.h"
-#include "mozilla/Unused.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_ISUPPORTS(PresentationBuilderChild,
- nsIPresentationSessionTransportBuilderListener)
-
-PresentationBuilderChild::PresentationBuilderChild(const nsString& aSessionId,
- uint8_t aRole)
- : mSessionId(aSessionId)
- , mRole(aRole)
-{
-}
-
-nsresult PresentationBuilderChild::Init()
-{
- mBuilder = do_CreateInstance("@mozilla.org/presentation/datachanneltransportbuilder;1");
- if (NS_WARN_IF(!mBuilder)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- uint64_t windowId = 0;
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- if (NS_WARN_IF(NS_FAILED(service->GetWindowIdBySessionId(
- mSessionId,
- mRole,
- &windowId)))) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- nsPIDOMWindowInner* window = nsGlobalWindow::GetInnerWindowWithId(windowId)->AsInner();
- if (NS_WARN_IF(!window)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return mBuilder->BuildDataChannelTransport(mRole, window, this);
-}
-
-void
-PresentationBuilderChild::ActorDestroy(ActorDestroyReason aWhy)
-{
- mBuilder = nullptr;
- mActorDestroyed = true;
-}
-
-bool
-PresentationBuilderChild::RecvOnOffer(const nsString& aSDP)
-{
- if (NS_WARN_IF(!mBuilder)) {
- return false;
- }
- RefPtr<DCPresentationChannelDescription> description =
- new DCPresentationChannelDescription(aSDP);
-
- if (NS_WARN_IF(NS_FAILED(mBuilder->OnOffer(description)))) {
- return false;
- }
- return true;
-}
-
-bool
-PresentationBuilderChild::RecvOnAnswer(const nsString& aSDP)
-{
- if (NS_WARN_IF(!mBuilder)) {
- return false;
- }
- RefPtr<DCPresentationChannelDescription> description =
- new DCPresentationChannelDescription(aSDP);
-
- if (NS_WARN_IF(NS_FAILED(mBuilder->OnAnswer(description)))) {
- return false;
- }
- return true;
-}
-
-bool
-PresentationBuilderChild::RecvOnIceCandidate(const nsString& aCandidate)
-{
- if (NS_WARN_IF(mBuilder && NS_FAILED(mBuilder->OnIceCandidate(aCandidate)))) {
- return false;
- }
- return true;
-}
-
-// nsPresentationSessionTransportBuilderListener
-NS_IMETHODIMP
-PresentationBuilderChild::OnSessionTransport(nsIPresentationSessionTransport* aTransport)
-{
- if (NS_WARN_IF(mActorDestroyed || !SendOnSessionTransport())){
- return NS_ERROR_FAILURE;
- }
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- NS_WARNING_ASSERTION(service, "no presentation service");
- if (service) {
- Unused << NS_WARN_IF(NS_FAILED(static_cast<PresentationIPCService*>(service.get())->
- NotifySessionTransport(mSessionId, mRole, aTransport)));
- }
- mBuilder = nullptr;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationBuilderChild::OnError(nsresult reason)
-{
- mBuilder = nullptr;
-
- if (NS_WARN_IF(mActorDestroyed || !SendOnSessionTransportError(reason))){
- return NS_ERROR_FAILURE;
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationBuilderChild::SendOffer(nsIPresentationChannelDescription* aOffer)
-{
- nsAutoString SDP;
- nsresult rv = aOffer->GetDataChannelSDP(SDP);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- if (NS_WARN_IF(mActorDestroyed || !SendSendOffer(SDP))){
- return NS_ERROR_FAILURE;
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationBuilderChild::SendAnswer(nsIPresentationChannelDescription* aAnswer)
-{
- nsAutoString SDP;
- nsresult rv = aAnswer->GetDataChannelSDP(SDP);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- if (NS_WARN_IF(mActorDestroyed || !SendSendAnswer(SDP))){
- return NS_ERROR_FAILURE;
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationBuilderChild::SendIceCandidate(const nsAString& candidate)
-{
- if (NS_WARN_IF(mActorDestroyed || !SendSendIceCandidate(nsString(candidate)))) {
- return NS_ERROR_FAILURE;
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationBuilderChild::Close(nsresult reason)
-{
- if (NS_WARN_IF(mActorDestroyed || !SendClose(reason))) {
- return NS_ERROR_FAILURE;
- }
- return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
-
diff --git a/dom/presentation/ipc/PresentationBuilderChild.h b/dom/presentation/ipc/PresentationBuilderChild.h
deleted file mode 100644
index 5ada53ab7..000000000
--- a/dom/presentation/ipc/PresentationBuilderChild.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationBuilderChild_h
-#define mozilla_dom_PresentationBuilderChild_h
-
-#include "mozilla/dom/PPresentationBuilderChild.h"
-#include "nsIPresentationSessionTransportBuilder.h"
-
-namespace mozilla {
-namespace dom {
-
-class PresentationBuilderChild final: public PPresentationBuilderChild
- , public nsIPresentationSessionTransportBuilderListener
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONSESSIONTRANSPORTBUILDERLISTENER
-
- explicit PresentationBuilderChild(const nsString& aSessionId,
- uint8_t aRole);
-
- nsresult Init();
-
- virtual void ActorDestroy(ActorDestroyReason aWhy) override;
-
- virtual bool RecvOnOffer(const nsString& aSDP) override;
-
- virtual bool RecvOnAnswer(const nsString& aSDP) override;
-
- virtual bool RecvOnIceCandidate(const nsString& aCandidate) override;
-
-private:
- virtual ~PresentationBuilderChild() = default;
-
- nsString mSessionId;
- uint8_t mRole;
- bool mActorDestroyed = false;
- nsCOMPtr<nsIPresentationDataChannelSessionTransportBuilder> mBuilder;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationBuilderChild_h
diff --git a/dom/presentation/ipc/PresentationBuilderParent.cpp b/dom/presentation/ipc/PresentationBuilderParent.cpp
deleted file mode 100644
index dc784b13c..000000000
--- a/dom/presentation/ipc/PresentationBuilderParent.cpp
+++ /dev/null
@@ -1,267 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "DCPresentationChannelDescription.h"
-#include "PresentationBuilderParent.h"
-#include "PresentationSessionInfo.h"
-
-namespace mozilla {
-namespace dom {
-
-namespace {
-
-class PresentationSessionTransportIPC final :
- public nsIPresentationSessionTransport
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONSESSIONTRANSPORT
-
- PresentationSessionTransportIPC(PresentationParent* aParent,
- const nsAString& aSessionId,
- uint8_t aRole)
- : mParent(aParent)
- , mSessionId(aSessionId)
- , mRole(aRole)
- {
- MOZ_ASSERT(mParent);
- }
-
-private:
- virtual ~PresentationSessionTransportIPC() = default;
-
- RefPtr<PresentationParent> mParent;
- nsString mSessionId;
- uint8_t mRole;
-};
-
-NS_IMPL_ISUPPORTS(PresentationSessionTransportIPC,
- nsIPresentationSessionTransport)
-
-NS_IMETHODIMP
-PresentationSessionTransportIPC::GetCallback(
- nsIPresentationSessionTransportCallback** aCallback)
-{
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationSessionTransportIPC::SetCallback(
- nsIPresentationSessionTransportCallback* aCallback)
-{
- if (aCallback) {
- aCallback->NotifyTransportReady();
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationSessionTransportIPC::GetSelfAddress(nsINetAddr** aSelfAddress)
-{
- MOZ_ASSERT(false, "Not expected.");
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-PresentationSessionTransportIPC::EnableDataNotification()
-{
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationSessionTransportIPC::Send(const nsAString& aData)
-{
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationSessionTransportIPC::SendBinaryMsg(const nsACString& aData)
-{
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationSessionTransportIPC::SendBlob(nsIDOMBlob* aBlob)
-{
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationSessionTransportIPC::Close(nsresult aReason)
-{
- if (NS_WARN_IF(!mParent->SendNotifyCloseSessionTransport(mSessionId,
- mRole,
- aReason))) {
- return NS_ERROR_FAILURE;
- }
-
- return NS_OK;
-}
-
-} // anonymous namespace
-
-NS_IMPL_ISUPPORTS(PresentationBuilderParent,
- nsIPresentationSessionTransportBuilder,
- nsIPresentationDataChannelSessionTransportBuilder)
-
-PresentationBuilderParent::PresentationBuilderParent(PresentationParent* aParent)
- : mParent(aParent)
-{
- MOZ_COUNT_CTOR(PresentationBuilderParent);
-}
-
-PresentationBuilderParent::~PresentationBuilderParent()
-{
- MOZ_COUNT_DTOR(PresentationBuilderParent);
-
- if (mNeedDestroyActor) {
- Unused << NS_WARN_IF(!Send__delete__(this));
- }
-}
-
-NS_IMETHODIMP
-PresentationBuilderParent::BuildDataChannelTransport(
- uint8_t aRole,
- mozIDOMWindow* aWindow, /* unused */
- nsIPresentationSessionTransportBuilderListener* aListener)
-{
- mBuilderListener = aListener;
-
- RefPtr<PresentationSessionInfo> info = static_cast<PresentationSessionInfo*>(aListener);
- nsAutoString sessionId(info->GetSessionId());
- if (NS_WARN_IF(!mParent->SendPPresentationBuilderConstructor(this,
- sessionId,
- aRole))) {
- return NS_ERROR_FAILURE;
- }
- mIPCSessionTransport = new PresentationSessionTransportIPC(mParent,
- sessionId,
- aRole);
- mNeedDestroyActor = true;
- mParent = nullptr;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationBuilderParent::OnIceCandidate(const nsAString& aCandidate)
-{
- if (NS_WARN_IF(!SendOnIceCandidate(nsString(aCandidate)))){
- return NS_ERROR_FAILURE;
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationBuilderParent::OnOffer(nsIPresentationChannelDescription* aDescription)
-{
- nsAutoString SDP;
- nsresult rv = aDescription->GetDataChannelSDP(SDP);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- if (NS_WARN_IF(!SendOnOffer(SDP))){
- return NS_ERROR_FAILURE;
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationBuilderParent::OnAnswer(nsIPresentationChannelDescription* aDescription)
-{
- nsAutoString SDP;
- nsresult rv = aDescription->GetDataChannelSDP(SDP);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- if (NS_WARN_IF(!SendOnAnswer(SDP))){
- return NS_ERROR_FAILURE;
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationBuilderParent::NotifyDisconnected(nsresult aReason)
-{
- return NS_OK;
-}
-
-void
-PresentationBuilderParent::ActorDestroy(ActorDestroyReason aWhy)
-{
- mNeedDestroyActor = false;
- mParent = nullptr;
- mBuilderListener = nullptr;
-}
-
-bool
-PresentationBuilderParent::RecvSendOffer(const nsString& aSDP)
-{
- RefPtr<DCPresentationChannelDescription> description =
- new DCPresentationChannelDescription(aSDP);
- if (NS_WARN_IF(!mBuilderListener ||
- NS_FAILED(mBuilderListener->SendOffer(description)))) {
- return false;
- }
- return true;
-}
-
-bool
-PresentationBuilderParent::RecvSendAnswer(const nsString& aSDP)
-{
- RefPtr<DCPresentationChannelDescription> description =
- new DCPresentationChannelDescription(aSDP);
- if (NS_WARN_IF(!mBuilderListener ||
- NS_FAILED(mBuilderListener->SendAnswer(description)))) {
- return false;
- }
- return true;
-}
-
-bool
-PresentationBuilderParent::RecvSendIceCandidate(const nsString& aCandidate)
-{
- if (NS_WARN_IF(!mBuilderListener ||
- NS_FAILED(mBuilderListener->SendIceCandidate(aCandidate)))) {
- return false;
- }
- return true;
-}
-
-bool
-PresentationBuilderParent::RecvClose(const nsresult& aReason)
-{
- if (NS_WARN_IF(!mBuilderListener ||
- NS_FAILED(mBuilderListener->Close(aReason)))) {
- return false;
- }
- return true;
-}
-
-// Delegate to nsIPresentationSessionTransportBuilderListener
-bool
-PresentationBuilderParent::RecvOnSessionTransport()
-{
- RefPtr<PresentationBuilderParent> kungFuDeathGrip = this;
- Unused <<
- NS_WARN_IF(!mBuilderListener ||
- NS_FAILED(mBuilderListener->OnSessionTransport(mIPCSessionTransport)));
- return true;
-}
-
-bool
-PresentationBuilderParent::RecvOnSessionTransportError(const nsresult& aReason)
-{
- if (NS_WARN_IF(!mBuilderListener ||
- NS_FAILED(mBuilderListener->OnError(aReason)))) {
- return false;
- }
- return true;
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/ipc/PresentationBuilderParent.h b/dom/presentation/ipc/PresentationBuilderParent.h
deleted file mode 100644
index 7fd211ce5..000000000
--- a/dom/presentation/ipc/PresentationBuilderParent.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationBuilderParent_h__
-#define mozilla_dom_PresentationBuilderParent_h__
-
-#include "mozilla/dom/PPresentationBuilderParent.h"
-#include "PresentationParent.h"
-#include "nsIPresentationSessionTransportBuilder.h"
-
-namespace mozilla {
-namespace dom {
-
-class PresentationBuilderParent final: public PPresentationBuilderParent
- , public nsIPresentationDataChannelSessionTransportBuilder
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONSESSIONTRANSPORTBUILDER
- NS_DECL_NSIPRESENTATIONDATACHANNELSESSIONTRANSPORTBUILDER
-
- explicit PresentationBuilderParent(PresentationParent* aParent);
-
- virtual bool RecvSendOffer(const nsString& aSDP) override;
-
- virtual bool RecvSendAnswer(const nsString& aSDP) override;
-
- virtual bool RecvSendIceCandidate(const nsString& aCandidate) override;
-
- virtual bool RecvClose(const nsresult& aReason) override;
-
- virtual void ActorDestroy(ActorDestroyReason aWhy) override;
-
- virtual bool RecvOnSessionTransport() override;
-
- virtual bool RecvOnSessionTransportError(const nsresult& aReason) override;
-
-private:
- virtual ~PresentationBuilderParent();
- bool mNeedDestroyActor = false;
- RefPtr<PresentationParent> mParent;
- nsCOMPtr<nsIPresentationSessionTransportBuilderListener> mBuilderListener;
- nsCOMPtr<nsIPresentationSessionTransport> mIPCSessionTransport;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationBuilderParent_h__
diff --git a/dom/presentation/ipc/PresentationChild.cpp b/dom/presentation/ipc/PresentationChild.cpp
deleted file mode 100644
index d24ba9e8c..000000000
--- a/dom/presentation/ipc/PresentationChild.cpp
+++ /dev/null
@@ -1,198 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "DCPresentationChannelDescription.h"
-#include "mozilla/StaticPtr.h"
-#include "PresentationBuilderChild.h"
-#include "PresentationChild.h"
-#include "PresentationIPCService.h"
-#include "nsThreadUtils.h"
-
-using namespace mozilla;
-using namespace mozilla::dom;
-
-/*
- * Implementation of PresentationChild
- */
-
-PresentationChild::PresentationChild(PresentationIPCService* aService)
- : mActorDestroyed(false)
- , mService(aService)
-{
- MOZ_ASSERT(mService);
-
- MOZ_COUNT_CTOR(PresentationChild);
-}
-
-PresentationChild::~PresentationChild()
-{
- MOZ_COUNT_DTOR(PresentationChild);
-
- if (!mActorDestroyed) {
- Send__delete__(this);
- }
- mService = nullptr;
-}
-
-void
-PresentationChild::ActorDestroy(ActorDestroyReason aWhy)
-{
- mActorDestroyed = true;
- mService->NotifyPresentationChildDestroyed();
- mService = nullptr;
-}
-
-PPresentationRequestChild*
-PresentationChild::AllocPPresentationRequestChild(const PresentationIPCRequest& aRequest)
-{
- NS_NOTREACHED("We should never be manually allocating PPresentationRequestChild actors");
- return nullptr;
-}
-
-bool
-PresentationChild::DeallocPPresentationRequestChild(PPresentationRequestChild* aActor)
-{
- delete aActor;
- return true;
-}
-
-bool PresentationChild::RecvPPresentationBuilderConstructor(
- PPresentationBuilderChild* aActor,
- const nsString& aSessionId,
- const uint8_t& aRole)
-{
- // Child will build the session transport
- PresentationBuilderChild* actor = static_cast<PresentationBuilderChild*>(aActor);
- return NS_WARN_IF(NS_FAILED(actor->Init())) ? false : true;
-}
-
-PPresentationBuilderChild*
-PresentationChild::AllocPPresentationBuilderChild(const nsString& aSessionId,
- const uint8_t& aRole)
-{
- RefPtr<PresentationBuilderChild> actor
- = new PresentationBuilderChild(aSessionId, aRole);
-
- return actor.forget().take();
-}
-
-bool
-PresentationChild::DeallocPPresentationBuilderChild(PPresentationBuilderChild* aActor)
-{
- RefPtr<PresentationBuilderChild> actor =
- dont_AddRef(static_cast<PresentationBuilderChild*>(aActor));
- return true;
-}
-
-
-bool
-PresentationChild::RecvNotifyAvailableChange(
- nsTArray<nsString>&& aAvailabilityUrls,
- const bool& aAvailable)
-{
- if (mService) {
- Unused <<
- NS_WARN_IF(NS_FAILED(mService->NotifyAvailableChange(aAvailabilityUrls,
- aAvailable)));
- }
- return true;
-}
-
-bool
-PresentationChild::RecvNotifySessionStateChange(const nsString& aSessionId,
- const uint16_t& aState,
- const nsresult& aReason)
-{
- if (mService) {
- Unused << NS_WARN_IF(NS_FAILED(mService->NotifySessionStateChange(aSessionId,
- aState,
- aReason)));
- }
- return true;
-}
-
-bool
-PresentationChild::RecvNotifyMessage(const nsString& aSessionId,
- const nsCString& aData,
- const bool& aIsBinary)
-{
- if (mService) {
- Unused << NS_WARN_IF(NS_FAILED(mService->NotifyMessage(aSessionId,
- aData,
- aIsBinary)));
- }
- return true;
-}
-
-bool
-PresentationChild::RecvNotifySessionConnect(const uint64_t& aWindowId,
- const nsString& aSessionId)
-{
- if (mService) {
- Unused << NS_WARN_IF(NS_FAILED(mService->NotifySessionConnect(aWindowId, aSessionId)));
- }
- return true;
-}
-
-bool
-PresentationChild::RecvNotifyCloseSessionTransport(const nsString& aSessionId,
- const uint8_t& aRole,
- const nsresult& aReason)
-{
- if (mService) {
- Unused << NS_WARN_IF(NS_FAILED(
- mService->CloseContentSessionTransport(aSessionId, aRole, aReason)));
- }
- return true;
-}
-
-/*
- * Implementation of PresentationRequestChild
- */
-
-PresentationRequestChild::PresentationRequestChild(nsIPresentationServiceCallback* aCallback)
- : mActorDestroyed(false)
- , mCallback(aCallback)
-{
- MOZ_COUNT_CTOR(PresentationRequestChild);
-}
-
-PresentationRequestChild::~PresentationRequestChild()
-{
- MOZ_COUNT_DTOR(PresentationRequestChild);
-
- mCallback = nullptr;
-}
-
-void
-PresentationRequestChild::ActorDestroy(ActorDestroyReason aWhy)
-{
- mActorDestroyed = true;
- mCallback = nullptr;
-}
-
-bool
-PresentationRequestChild::Recv__delete__(const nsresult& aResult)
-{
- if (mActorDestroyed) {
- return true;
- }
-
- if (mCallback) {
- if (NS_FAILED(aResult)) {
- Unused << NS_WARN_IF(NS_FAILED(mCallback->NotifyError(aResult)));
- }
- }
-
- return true;
-}
-
-bool
-PresentationRequestChild::RecvNotifyRequestUrlSelected(const nsString& aUrl)
-{
- Unused << NS_WARN_IF(NS_FAILED(mCallback->NotifySuccess(aUrl)));
- return true;
-}
diff --git a/dom/presentation/ipc/PresentationChild.h b/dom/presentation/ipc/PresentationChild.h
deleted file mode 100644
index 1c625b8ce..000000000
--- a/dom/presentation/ipc/PresentationChild.h
+++ /dev/null
@@ -1,101 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationChild_h
-#define mozilla_dom_PresentationChild_h
-
-#include "mozilla/dom/PPresentationBuilderChild.h"
-#include "mozilla/dom/PPresentationChild.h"
-#include "mozilla/dom/PPresentationRequestChild.h"
-
-class nsIPresentationServiceCallback;
-
-namespace mozilla {
-namespace dom {
-
-class PresentationIPCService;
-
-class PresentationChild final : public PPresentationChild
-{
-public:
- explicit PresentationChild(PresentationIPCService* aService);
-
- virtual void
- ActorDestroy(ActorDestroyReason aWhy) override;
-
- virtual PPresentationRequestChild*
- AllocPPresentationRequestChild(const PresentationIPCRequest& aRequest) override;
-
- virtual bool
- DeallocPPresentationRequestChild(PPresentationRequestChild* aActor) override;
-
- bool RecvPPresentationBuilderConstructor(PPresentationBuilderChild* aActor,
- const nsString& aSessionId,
- const uint8_t& aRole) override;
-
- virtual PPresentationBuilderChild*
- AllocPPresentationBuilderChild(const nsString& aSessionId, const uint8_t& aRole) override;
-
- virtual bool
- DeallocPPresentationBuilderChild(PPresentationBuilderChild* aActor) override;
-
- virtual bool
- RecvNotifyAvailableChange(nsTArray<nsString>&& aAvailabilityUrls,
- const bool& aAvailable) override;
-
- virtual bool
- RecvNotifySessionStateChange(const nsString& aSessionId,
- const uint16_t& aState,
- const nsresult& aReason) override;
-
- virtual bool
- RecvNotifyMessage(const nsString& aSessionId,
- const nsCString& aData,
- const bool& aIsBinary) override;
-
- virtual bool
- RecvNotifySessionConnect(const uint64_t& aWindowId,
- const nsString& aSessionId) override;
-
- virtual bool
- RecvNotifyCloseSessionTransport(const nsString& aSessionId,
- const uint8_t& aRole,
- const nsresult& aReason) override;
-
-private:
- virtual ~PresentationChild();
-
- bool mActorDestroyed = false;
- RefPtr<PresentationIPCService> mService;
-};
-
-class PresentationRequestChild final : public PPresentationRequestChild
-{
- friend class PresentationChild;
-
-public:
- explicit PresentationRequestChild(nsIPresentationServiceCallback* aCallback);
-
- virtual void
- ActorDestroy(ActorDestroyReason aWhy) override;
-
- virtual bool
- Recv__delete__(const nsresult& aResult) override;
-
- virtual bool
- RecvNotifyRequestUrlSelected(const nsString& aUrl) override;
-
-private:
- virtual ~PresentationRequestChild();
-
- bool mActorDestroyed = false;
- nsCOMPtr<nsIPresentationServiceCallback> mCallback;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationChild_h
diff --git a/dom/presentation/ipc/PresentationContentSessionInfo.cpp b/dom/presentation/ipc/PresentationContentSessionInfo.cpp
deleted file mode 100644
index 071ea924f..000000000
--- a/dom/presentation/ipc/PresentationContentSessionInfo.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et cindent: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsServiceManagerUtils.h"
-#include "PresentationContentSessionInfo.h"
-#include "PresentationIPCService.h"
-
-namespace mozilla {
-namespace dom {
-
-NS_IMPL_ISUPPORTS(PresentationContentSessionInfo,
- nsIPresentationSessionTransportCallback);
-
-nsresult
-PresentationContentSessionInfo::Init() {
- if (NS_WARN_IF(NS_FAILED(mTransport->SetCallback(this)))) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- if (NS_WARN_IF(NS_FAILED(mTransport->EnableDataNotification()))) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- return NS_OK;
-}
-
-nsresult
-PresentationContentSessionInfo::Send(const nsAString& aData)
-{
- if (!mTransport) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return mTransport->Send(aData);
-}
-
-nsresult
-PresentationContentSessionInfo::SendBinaryMsg(const nsACString& aData)
-{
- if (NS_WARN_IF(!mTransport)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return mTransport->SendBinaryMsg(aData);
-}
-
-nsresult
-PresentationContentSessionInfo::SendBlob(nsIDOMBlob* aBlob)
-{
- if (NS_WARN_IF(!mTransport)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return mTransport->SendBlob(aBlob);
-}
-
-nsresult
-PresentationContentSessionInfo::Close(nsresult aReason)
-{
- if (!mTransport) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return mTransport->Close(aReason);
-}
-
-// nsIPresentationSessionTransportCallback
-NS_IMETHODIMP
-PresentationContentSessionInfo::NotifyTransportReady()
-{
- // do nothing since |onSessionTransport| implies this
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationContentSessionInfo::NotifyTransportClosed(nsresult aReason)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- // Nullify |mTransport| here so it won't try to re-close |mTransport| in
- // potential subsequent |Shutdown| calls.
- mTransport = nullptr;
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- return static_cast<PresentationIPCService*>(service.get())->
- NotifyTransportClosed(mSessionId, mRole, aReason);
-}
-
-NS_IMETHODIMP
-PresentationContentSessionInfo::NotifyData(const nsACString& aData,
- bool aIsBinary)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- nsCOMPtr<nsIPresentationService> service =
- do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- if (NS_WARN_IF(!service)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- return static_cast<PresentationIPCService*>(service.get())->
- NotifyMessage(mSessionId, aData, aIsBinary);
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/ipc/PresentationContentSessionInfo.h b/dom/presentation/ipc/PresentationContentSessionInfo.h
deleted file mode 100644
index 447485dbd..000000000
--- a/dom/presentation/ipc/PresentationContentSessionInfo.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationContentSessionInfo_h
-#define mozilla_dom_PresentationContentSessionInfo_h
-
-#include "nsCOMPtr.h"
-#include "nsIPresentationSessionTransport.h"
-
-namespace mozilla {
-namespace dom {
-
-/**
- * PresentationContentSessionInfo manages nsIPresentationSessionTransport and
- * delegates the callbacks to PresentationIPCService. Only lives in content
- * process.
- */
-class PresentationContentSessionInfo final : public nsIPresentationSessionTransportCallback
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONSESSIONTRANSPORTCALLBACK
-
- PresentationContentSessionInfo(const nsAString& aSessionId,
- uint8_t aRole,
- nsIPresentationSessionTransport* aTransport)
- : mSessionId(aSessionId)
- , mRole(aRole)
- , mTransport(aTransport)
- {
- MOZ_ASSERT(XRE_IsContentProcess());
- MOZ_ASSERT(!aSessionId.IsEmpty());
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
- MOZ_ASSERT(aTransport);
- }
-
- nsresult Init();
-
- nsresult Send(const nsAString& aData);
-
- nsresult SendBinaryMsg(const nsACString& aData);
-
- nsresult SendBlob(nsIDOMBlob* aBlob);
-
- nsresult Close(nsresult aReason);
-
-private:
- virtual ~PresentationContentSessionInfo() {}
-
- nsString mSessionId;
- uint8_t mRole;
- nsCOMPtr<nsIPresentationSessionTransport> mTransport;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationContentSessionInfo_h
diff --git a/dom/presentation/ipc/PresentationIPCService.cpp b/dom/presentation/ipc/PresentationIPCService.cpp
deleted file mode 100644
index 8c85b239d..000000000
--- a/dom/presentation/ipc/PresentationIPCService.cpp
+++ /dev/null
@@ -1,538 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et ft=cpp : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/ContentChild.h"
-#include "mozilla/dom/PermissionMessageUtils.h"
-#include "mozilla/dom/PPresentation.h"
-#include "mozilla/dom/TabParent.h"
-#include "mozilla/ipc/InputStreamUtils.h"
-#include "mozilla/ipc/URIUtils.h"
-#include "nsGlobalWindow.h"
-#include "nsIPresentationListener.h"
-#include "PresentationCallbacks.h"
-#include "PresentationChild.h"
-#include "PresentationContentSessionInfo.h"
-#include "PresentationIPCService.h"
-#include "PresentationLog.h"
-
-using namespace mozilla;
-using namespace mozilla::dom;
-using namespace mozilla::ipc;
-
-namespace {
-
-PresentationChild* sPresentationChild;
-
-} // anonymous
-
-NS_IMPL_ISUPPORTS(PresentationIPCService,
- nsIPresentationService,
- nsIPresentationAvailabilityListener)
-
-PresentationIPCService::PresentationIPCService()
-{
- ContentChild* contentChild = ContentChild::GetSingleton();
- if (NS_WARN_IF(!contentChild)) {
- return;
- }
- sPresentationChild = new PresentationChild(this);
- Unused <<
- NS_WARN_IF(!contentChild->SendPPresentationConstructor(sPresentationChild));
-}
-
-/* virtual */
-PresentationIPCService::~PresentationIPCService()
-{
- Shutdown();
-
- mSessionListeners.Clear();
- mSessionInfoAtController.Clear();
- mSessionInfoAtReceiver.Clear();
- sPresentationChild = nullptr;
-}
-
-NS_IMETHODIMP
-PresentationIPCService::StartSession(
- const nsTArray<nsString>& aUrls,
- const nsAString& aSessionId,
- const nsAString& aOrigin,
- const nsAString& aDeviceId,
- uint64_t aWindowId,
- nsIDOMEventTarget* aEventTarget,
- nsIPrincipal* aPrincipal,
- nsIPresentationServiceCallback* aCallback,
- nsIPresentationTransportBuilderConstructor* aBuilderConstructor)
-{
- if (aWindowId != 0) {
- AddRespondingSessionId(aWindowId,
- aSessionId,
- nsIPresentationService::ROLE_CONTROLLER);
- }
-
- nsPIDOMWindowInner* window =
- nsGlobalWindow::GetInnerWindowWithId(aWindowId)->AsInner();
- TabId tabId = TabParent::GetTabIdFrom(window->GetDocShell());
-
- return SendRequest(aCallback, StartSessionRequest(aUrls,
- nsString(aSessionId),
- nsString(aOrigin),
- nsString(aDeviceId),
- aWindowId,
- tabId,
- IPC::Principal(aPrincipal)));
-}
-
-NS_IMETHODIMP
-PresentationIPCService::SendSessionMessage(const nsAString& aSessionId,
- uint8_t aRole,
- const nsAString& aData)
-{
- MOZ_ASSERT(!aSessionId.IsEmpty());
- MOZ_ASSERT(!aData.IsEmpty());
-
- RefPtr<PresentationContentSessionInfo> info =
- GetSessionInfo(aSessionId, aRole);
- // data channel session transport is maintained by content process
- if (info) {
- return info->Send(aData);
- }
-
- return SendRequest(nullptr, SendSessionMessageRequest(nsString(aSessionId),
- aRole,
- nsString(aData)));
-}
-
-NS_IMETHODIMP
-PresentationIPCService::SendSessionBinaryMsg(const nsAString& aSessionId,
- uint8_t aRole,
- const nsACString &aData)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(!aData.IsEmpty());
- MOZ_ASSERT(!aSessionId.IsEmpty());
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
-
- RefPtr<PresentationContentSessionInfo> info =
- GetSessionInfo(aSessionId, aRole);
- // data channel session transport is maintained by content process
- if (info) {
- return info->SendBinaryMsg(aData);
- }
-
- return NS_ERROR_NOT_AVAILABLE;
-}
-
-NS_IMETHODIMP
-PresentationIPCService::SendSessionBlob(const nsAString& aSessionId,
- uint8_t aRole,
- nsIDOMBlob* aBlob)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(!aSessionId.IsEmpty());
- MOZ_ASSERT(aRole == nsIPresentationService::ROLE_CONTROLLER ||
- aRole == nsIPresentationService::ROLE_RECEIVER);
- MOZ_ASSERT(aBlob);
-
- RefPtr<PresentationContentSessionInfo> info =
- GetSessionInfo(aSessionId, aRole);
- // data channel session transport is maintained by content process
- if (info) {
- return info->SendBlob(aBlob);
- }
-
- return NS_ERROR_NOT_AVAILABLE;
-}
-
-NS_IMETHODIMP
-PresentationIPCService::CloseSession(const nsAString& aSessionId,
- uint8_t aRole,
- uint8_t aClosedReason)
-{
- MOZ_ASSERT(!aSessionId.IsEmpty());
-
- nsresult rv = SendRequest(nullptr, CloseSessionRequest(nsString(aSessionId),
- aRole,
- aClosedReason));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- RefPtr<PresentationContentSessionInfo> info =
- GetSessionInfo(aSessionId, aRole);
- if (info) {
- return info->Close(NS_OK);
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationIPCService::TerminateSession(const nsAString& aSessionId,
- uint8_t aRole)
-{
- MOZ_ASSERT(!aSessionId.IsEmpty());
-
- nsresult rv = SendRequest(nullptr, TerminateSessionRequest(nsString(aSessionId), aRole));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- RefPtr<PresentationContentSessionInfo> info =
- GetSessionInfo(aSessionId, aRole);
- if (info) {
- return info->Close(NS_OK);
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationIPCService::ReconnectSession(const nsTArray<nsString>& aUrls,
- const nsAString& aSessionId,
- uint8_t aRole,
- nsIPresentationServiceCallback* aCallback)
-{
- MOZ_ASSERT(!aSessionId.IsEmpty());
-
- if (aRole != nsIPresentationService::ROLE_CONTROLLER) {
- MOZ_ASSERT(false, "Only controller can call ReconnectSession.");
- return NS_ERROR_INVALID_ARG;
- }
-
- return SendRequest(aCallback, ReconnectSessionRequest(aUrls,
- nsString(aSessionId),
- aRole));
-}
-
-NS_IMETHODIMP
-PresentationIPCService::BuildTransport(const nsAString& aSessionId,
- uint8_t aRole)
-{
- MOZ_ASSERT(!aSessionId.IsEmpty());
-
- if (aRole != nsIPresentationService::ROLE_CONTROLLER) {
- MOZ_ASSERT(false, "Only controller can call ReconnectSession.");
- return NS_ERROR_INVALID_ARG;
- }
-
- return SendRequest(nullptr, BuildTransportRequest(nsString(aSessionId),
- aRole));
-}
-
-nsresult
-PresentationIPCService::SendRequest(nsIPresentationServiceCallback* aCallback,
- const PresentationIPCRequest& aRequest)
-{
- if (sPresentationChild) {
- PresentationRequestChild* actor = new PresentationRequestChild(aCallback);
- Unused << NS_WARN_IF(!sPresentationChild->SendPPresentationRequestConstructor(actor, aRequest));
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationIPCService::RegisterAvailabilityListener(
- const nsTArray<nsString>& aAvailabilityUrls,
- nsIPresentationAvailabilityListener* aListener)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(!aAvailabilityUrls.IsEmpty());
- MOZ_ASSERT(aListener);
-
- nsTArray<nsString> addedUrls;
- mAvailabilityManager.AddAvailabilityListener(aAvailabilityUrls,
- aListener,
- addedUrls);
-
- if (sPresentationChild && !addedUrls.IsEmpty()) {
- Unused <<
- NS_WARN_IF(
- !sPresentationChild->SendRegisterAvailabilityHandler(addedUrls));
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationIPCService::UnregisterAvailabilityListener(
- const nsTArray<nsString>& aAvailabilityUrls,
- nsIPresentationAvailabilityListener* aListener)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- nsTArray<nsString> removedUrls;
- mAvailabilityManager.RemoveAvailabilityListener(aAvailabilityUrls,
- aListener,
- removedUrls);
-
- if (sPresentationChild && !removedUrls.IsEmpty()) {
- Unused <<
- NS_WARN_IF(
- !sPresentationChild->SendUnregisterAvailabilityHandler(removedUrls));
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationIPCService::RegisterSessionListener(const nsAString& aSessionId,
- uint8_t aRole,
- nsIPresentationSessionListener* aListener)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(aListener);
-
- nsCOMPtr<nsIPresentationSessionListener> listener;
- if (mSessionListeners.Get(aSessionId, getter_AddRefs(listener))) {
- mSessionListeners.Put(aSessionId, aListener);
- return NS_OK;
- }
-
- mSessionListeners.Put(aSessionId, aListener);
- if (sPresentationChild) {
- Unused <<
- NS_WARN_IF(!sPresentationChild->SendRegisterSessionHandler(
- nsString(aSessionId), aRole));
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationIPCService::UnregisterSessionListener(const nsAString& aSessionId,
- uint8_t aRole)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- UntrackSessionInfo(aSessionId, aRole);
-
- mSessionListeners.Remove(aSessionId);
- if (sPresentationChild) {
- Unused <<
- NS_WARN_IF(!sPresentationChild->SendUnregisterSessionHandler(
- nsString(aSessionId), aRole));
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationIPCService::RegisterRespondingListener(uint64_t aWindowId,
- nsIPresentationRespondingListener* aListener)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- mRespondingListeners.Put(aWindowId, aListener);
- if (sPresentationChild) {
- Unused <<
- NS_WARN_IF(!sPresentationChild->SendRegisterRespondingHandler(aWindowId));
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationIPCService::UnregisterRespondingListener(uint64_t aWindowId)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- mRespondingListeners.Remove(aWindowId);
- if (sPresentationChild) {
- Unused <<
- NS_WARN_IF(!sPresentationChild->SendUnregisterRespondingHandler(
- aWindowId));
- }
- return NS_OK;
-}
-
-nsresult
-PresentationIPCService::NotifySessionTransport(const nsString& aSessionId,
- const uint8_t& aRole,
- nsIPresentationSessionTransport* aTransport)
-{
- RefPtr<PresentationContentSessionInfo> info =
- new PresentationContentSessionInfo(aSessionId, aRole, aTransport);
-
- if (NS_WARN_IF(NS_FAILED(info->Init()))) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- if (aRole == nsIPresentationService::ROLE_CONTROLLER) {
- mSessionInfoAtController.Put(aSessionId, info);
- } else {
- mSessionInfoAtReceiver.Put(aSessionId, info);
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationIPCService::GetWindowIdBySessionId(const nsAString& aSessionId,
- uint8_t aRole,
- uint64_t* aWindowId)
-{
- return GetWindowIdBySessionIdInternal(aSessionId, aRole, aWindowId);
-}
-
-NS_IMETHODIMP
-PresentationIPCService::UpdateWindowIdBySessionId(const nsAString& aSessionId,
- uint8_t aRole,
- const uint64_t aWindowId)
-{
- return UpdateWindowIdBySessionIdInternal(aSessionId, aRole, aWindowId);
-}
-
-nsresult
-PresentationIPCService::NotifySessionStateChange(const nsAString& aSessionId,
- uint16_t aState,
- nsresult aReason)
-{
- nsCOMPtr<nsIPresentationSessionListener> listener;
- if (NS_WARN_IF(!mSessionListeners.Get(aSessionId, getter_AddRefs(listener)))) {
- return NS_OK;
- }
-
- return listener->NotifyStateChange(aSessionId, aState, aReason);
-}
-
-// Only used for OOP RTCDataChannel session transport case.
-nsresult
-PresentationIPCService::NotifyMessage(const nsAString& aSessionId,
- const nsACString& aData,
- const bool& aIsBinary)
-{
- nsCOMPtr<nsIPresentationSessionListener> listener;
- if (NS_WARN_IF(!mSessionListeners.Get(aSessionId, getter_AddRefs(listener)))) {
- return NS_OK;
- }
-
- return listener->NotifyMessage(aSessionId, aData, aIsBinary);
-}
-
-// Only used for OOP RTCDataChannel session transport case.
-nsresult
-PresentationIPCService::NotifyTransportClosed(const nsAString& aSessionId,
- uint8_t aRole,
- nsresult aReason)
-{
- RefPtr<PresentationContentSessionInfo> info =
- GetSessionInfo(aSessionId, aRole);
- if (NS_WARN_IF(!info)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- Unused << NS_WARN_IF(!sPresentationChild->SendNotifyTransportClosed(nsString(aSessionId), aRole, aReason));
- return NS_OK;
-}
-
-nsresult
-PresentationIPCService::NotifySessionConnect(uint64_t aWindowId,
- const nsAString& aSessionId)
-{
- nsCOMPtr<nsIPresentationRespondingListener> listener;
- if (NS_WARN_IF(!mRespondingListeners.Get(aWindowId, getter_AddRefs(listener)))) {
- return NS_OK;
- }
-
- return listener->NotifySessionConnect(aWindowId, aSessionId);
-}
-
-NS_IMETHODIMP
-PresentationIPCService::NotifyAvailableChange(
- const nsTArray<nsString>& aAvailabilityUrls,
- bool aAvailable)
-{
- return mAvailabilityManager.DoNotifyAvailableChange(aAvailabilityUrls,
- aAvailable);
-}
-
-NS_IMETHODIMP
-PresentationIPCService::NotifyReceiverReady(
- const nsAString& aSessionId,
- uint64_t aWindowId,
- bool aIsLoading,
- nsIPresentationTransportBuilderConstructor* aBuilderConstructor)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- // No actual window uses 0 as its ID.
- if (NS_WARN_IF(aWindowId == 0)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- // Track the responding info for an OOP receiver page.
- AddRespondingSessionId(aWindowId,
- aSessionId,
- nsIPresentationService::ROLE_RECEIVER);
-
- Unused << NS_WARN_IF(!sPresentationChild->SendNotifyReceiverReady(nsString(aSessionId),
- aWindowId,
- aIsLoading));
-
- // Release mCallback after using aSessionId
- // because aSessionId is held by mCallback.
- mCallback = nullptr;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationIPCService::UntrackSessionInfo(const nsAString& aSessionId,
- uint8_t aRole)
-{
- PRES_DEBUG("content %s:id[%s], role[%d]\n", __func__,
- NS_ConvertUTF16toUTF8(aSessionId).get(), aRole);
-
- if (nsIPresentationService::ROLE_RECEIVER == aRole) {
- // Terminate receiver page.
- uint64_t windowId;
- if (NS_SUCCEEDED(GetWindowIdBySessionIdInternal(aSessionId,
- aRole,
- &windowId))) {
- NS_DispatchToMainThread(NS_NewRunnableFunction([windowId]() -> void {
- PRES_DEBUG("Attempt to close window[%d]\n", windowId);
-
- if (auto* window = nsGlobalWindow::GetInnerWindowWithId(windowId)) {
- window->Close();
- }
- }));
- }
- }
-
- // Remove the OOP responding info (if it has never been used).
- RemoveRespondingSessionId(aSessionId, aRole);
-
- if (nsIPresentationService::ROLE_CONTROLLER == aRole) {
- mSessionInfoAtController.Remove(aSessionId);
- } else {
- mSessionInfoAtReceiver.Remove(aSessionId);
- }
-
- return NS_OK;
-}
-
-void
-PresentationIPCService::NotifyPresentationChildDestroyed()
-{
- sPresentationChild = nullptr;
-}
-
-nsresult
-PresentationIPCService::MonitorResponderLoading(const nsAString& aSessionId,
- nsIDocShell* aDocShell)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- mCallback = new PresentationResponderLoadingCallback(aSessionId);
- return mCallback->Init(aDocShell);
-}
-
-nsresult
-PresentationIPCService::CloseContentSessionTransport(const nsString& aSessionId,
- uint8_t aRole,
- nsresult aReason)
-{
- RefPtr<PresentationContentSessionInfo> info =
- GetSessionInfo(aSessionId, aRole);
- if (NS_WARN_IF(!info)) {
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- return info->Close(aReason);
-}
diff --git a/dom/presentation/ipc/PresentationIPCService.h b/dom/presentation/ipc/PresentationIPCService.h
deleted file mode 100644
index 5eab7e68a..000000000
--- a/dom/presentation/ipc/PresentationIPCService.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=8 et ft=cpp : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationIPCService_h
-#define mozilla_dom_PresentationIPCService_h
-
-#include "mozilla/dom/PresentationServiceBase.h"
-#include "nsIPresentationListener.h"
-#include "nsIPresentationSessionTransport.h"
-#include "nsIPresentationService.h"
-
-class nsIDocShell;
-
-namespace mozilla {
-namespace dom {
-
-class PresentationIPCRequest;
-class PresentationContentSessionInfo;
-class PresentationResponderLoadingCallback;
-
-class PresentationIPCService final
- : public nsIPresentationAvailabilityListener
- , public nsIPresentationService
- , public PresentationServiceBase<PresentationContentSessionInfo>
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONAVAILABILITYLISTENER
- NS_DECL_NSIPRESENTATIONSERVICE
-
- PresentationIPCService();
-
- nsresult NotifySessionStateChange(const nsAString& aSessionId,
- uint16_t aState,
- nsresult aReason);
-
- nsresult NotifyMessage(const nsAString& aSessionId,
- const nsACString& aData,
- const bool& aIsBinary);
-
- nsresult NotifySessionConnect(uint64_t aWindowId,
- const nsAString& aSessionId);
-
- void NotifyPresentationChildDestroyed();
-
- nsresult MonitorResponderLoading(const nsAString& aSessionId,
- nsIDocShell* aDocShell);
-
- nsresult NotifySessionTransport(const nsString& aSessionId,
- const uint8_t& aRole,
- nsIPresentationSessionTransport* transport);
-
- nsresult CloseContentSessionTransport(const nsString& aSessionId,
- uint8_t aRole,
- nsresult aReason);
-
-private:
- virtual ~PresentationIPCService();
- nsresult SendRequest(nsIPresentationServiceCallback* aCallback,
- const PresentationIPCRequest& aRequest);
-
- nsRefPtrHashtable<nsStringHashKey,
- nsIPresentationSessionListener> mSessionListeners;
- nsRefPtrHashtable<nsUint64HashKey,
- nsIPresentationRespondingListener> mRespondingListeners;
- RefPtr<PresentationResponderLoadingCallback> mCallback;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationIPCService_h
diff --git a/dom/presentation/ipc/PresentationParent.cpp b/dom/presentation/ipc/PresentationParent.cpp
deleted file mode 100644
index 02f60500a..000000000
--- a/dom/presentation/ipc/PresentationParent.cpp
+++ /dev/null
@@ -1,553 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "DCPresentationChannelDescription.h"
-#include "mozilla/dom/ContentProcessManager.h"
-#include "mozilla/ipc/InputStreamUtils.h"
-#include "mozilla/Unused.h"
-#include "nsIPresentationDeviceManager.h"
-#include "nsIPresentationSessionTransport.h"
-#include "nsIPresentationSessionTransportBuilder.h"
-#include "nsServiceManagerUtils.h"
-#include "PresentationBuilderParent.h"
-#include "PresentationParent.h"
-#include "PresentationService.h"
-#include "PresentationSessionInfo.h"
-
-namespace mozilla {
-namespace dom {
-
-namespace {
-
-class PresentationTransportBuilderConstructorIPC final :
- public nsIPresentationTransportBuilderConstructor
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONTRANSPORTBUILDERCONSTRUCTOR
-
- explicit PresentationTransportBuilderConstructorIPC(PresentationParent* aParent)
- : mParent(aParent)
- {
- }
-
-private:
- virtual ~PresentationTransportBuilderConstructorIPC() = default;
-
- RefPtr<PresentationParent> mParent;
-};
-
-NS_IMPL_ISUPPORTS(PresentationTransportBuilderConstructorIPC,
- nsIPresentationTransportBuilderConstructor)
-
-NS_IMETHODIMP
-PresentationTransportBuilderConstructorIPC::CreateTransportBuilder(
- uint8_t aType,
- nsIPresentationSessionTransportBuilder** aRetval)
-{
- if (NS_WARN_IF(!aRetval)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- *aRetval = nullptr;
-
- if (NS_WARN_IF(aType != nsIPresentationChannelDescription::TYPE_TCP &&
- aType != nsIPresentationChannelDescription::TYPE_DATACHANNEL)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- if (XRE_IsContentProcess()) {
- MOZ_ASSERT(false,
- "CreateTransportBuilder can only be invoked in parent process.");
- return NS_ERROR_FAILURE;
- }
-
- nsCOMPtr<nsIPresentationSessionTransportBuilder> builder;
- if (aType == nsIPresentationChannelDescription::TYPE_TCP) {
- builder = do_CreateInstance(PRESENTATION_TCP_SESSION_TRANSPORT_CONTRACTID);
- } else {
- builder = new PresentationBuilderParent(mParent);
- }
-
- if (NS_WARN_IF(!builder)) {
- return NS_ERROR_DOM_OPERATION_ERR;
- }
-
- builder.forget(aRetval);
- return NS_OK;
-}
-
-} // anonymous namespace
-
-/*
- * Implementation of PresentationParent
- */
-
-NS_IMPL_ISUPPORTS(PresentationParent,
- nsIPresentationAvailabilityListener,
- nsIPresentationSessionListener,
- nsIPresentationRespondingListener)
-
-PresentationParent::PresentationParent()
-{
- MOZ_COUNT_CTOR(PresentationParent);
-}
-
-/* virtual */ PresentationParent::~PresentationParent()
-{
- MOZ_COUNT_DTOR(PresentationParent);
-}
-
-bool
-PresentationParent::Init(ContentParentId aContentParentId)
-{
- MOZ_ASSERT(!mService);
- mService = do_GetService(PRESENTATION_SERVICE_CONTRACTID);
- mChildId = aContentParentId;
- return NS_WARN_IF(!mService) ? false : true;
-}
-
-void
-PresentationParent::ActorDestroy(ActorDestroyReason aWhy)
-{
- mActorDestroyed = true;
-
- for (uint32_t i = 0; i < mSessionIdsAtController.Length(); i++) {
- Unused << NS_WARN_IF(NS_FAILED(mService->
- UnregisterSessionListener(mSessionIdsAtController[i],
- nsIPresentationService::ROLE_CONTROLLER)));
- }
- mSessionIdsAtController.Clear();
-
- for (uint32_t i = 0; i < mSessionIdsAtReceiver.Length(); i++) {
- Unused << NS_WARN_IF(NS_FAILED(mService->
- UnregisterSessionListener(mSessionIdsAtReceiver[i], nsIPresentationService::ROLE_RECEIVER)));
- }
- mSessionIdsAtReceiver.Clear();
-
- for (uint32_t i = 0; i < mWindowIds.Length(); i++) {
- Unused << NS_WARN_IF(NS_FAILED(mService->
- UnregisterRespondingListener(mWindowIds[i])));
- }
- mWindowIds.Clear();
-
- if (!mContentAvailabilityUrls.IsEmpty()) {
- mService->UnregisterAvailabilityListener(mContentAvailabilityUrls, this);
- }
- mService = nullptr;
-}
-
-bool
-PresentationParent::RecvPPresentationRequestConstructor(
- PPresentationRequestParent* aActor,
- const PresentationIPCRequest& aRequest)
-{
- PresentationRequestParent* actor = static_cast<PresentationRequestParent*>(aActor);
-
- nsresult rv = NS_ERROR_FAILURE;
- switch (aRequest.type()) {
- case PresentationIPCRequest::TStartSessionRequest:
- rv = actor->DoRequest(aRequest.get_StartSessionRequest());
- break;
- case PresentationIPCRequest::TSendSessionMessageRequest:
- rv = actor->DoRequest(aRequest.get_SendSessionMessageRequest());
- break;
- case PresentationIPCRequest::TCloseSessionRequest:
- rv = actor->DoRequest(aRequest.get_CloseSessionRequest());
- break;
- case PresentationIPCRequest::TTerminateSessionRequest:
- rv = actor->DoRequest(aRequest.get_TerminateSessionRequest());
- break;
- case PresentationIPCRequest::TReconnectSessionRequest:
- rv = actor->DoRequest(aRequest.get_ReconnectSessionRequest());
- break;
- case PresentationIPCRequest::TBuildTransportRequest:
- rv = actor->DoRequest(aRequest.get_BuildTransportRequest());
- break;
- default:
- MOZ_CRASH("Unknown PresentationIPCRequest type");
- }
-
- return NS_WARN_IF(NS_FAILED(rv)) ? false : true;
-}
-
-PPresentationRequestParent*
-PresentationParent::AllocPPresentationRequestParent(
- const PresentationIPCRequest& aRequest)
-{
- MOZ_ASSERT(mService);
- RefPtr<PresentationRequestParent> actor = new PresentationRequestParent(mService, mChildId);
- return actor.forget().take();
-}
-
-bool
-PresentationParent::DeallocPPresentationRequestParent(
- PPresentationRequestParent* aActor)
-{
- RefPtr<PresentationRequestParent> actor =
- dont_AddRef(static_cast<PresentationRequestParent*>(aActor));
- return true;
-}
-
-PPresentationBuilderParent*
-PresentationParent::AllocPPresentationBuilderParent(const nsString& aSessionId,
- const uint8_t& aRole)
-{
- NS_NOTREACHED("We should never be manually allocating AllocPPresentationBuilderParent actors");
- return nullptr;
-}
-
-bool
-PresentationParent::DeallocPPresentationBuilderParent(
- PPresentationBuilderParent* aActor)
-{
- return true;
-}
-
-bool
-PresentationParent::Recv__delete__()
-{
- return true;
-}
-
-bool
-PresentationParent::RecvRegisterAvailabilityHandler(
- nsTArray<nsString>&& aAvailabilityUrls)
-{
- MOZ_ASSERT(mService);
-
- Unused << NS_WARN_IF(NS_FAILED(mService->RegisterAvailabilityListener(
- aAvailabilityUrls,
- this)));
- mContentAvailabilityUrls.AppendElements(aAvailabilityUrls);
- return true;
-}
-
-bool
-PresentationParent::RecvUnregisterAvailabilityHandler(
- nsTArray<nsString>&& aAvailabilityUrls)
-{
- MOZ_ASSERT(mService);
-
- Unused << NS_WARN_IF(NS_FAILED(mService->UnregisterAvailabilityListener(
- aAvailabilityUrls,
- this)));
- for (const auto& url : aAvailabilityUrls) {
- mContentAvailabilityUrls.RemoveElement(url);
- }
- return true;
-}
-
-/* virtual */ bool
-PresentationParent::RecvRegisterSessionHandler(const nsString& aSessionId,
- const uint8_t& aRole)
-{
- MOZ_ASSERT(mService);
-
- // Validate the accessibility (primarily for receiver side) so that a
- // compromised child process can't fake the ID.
- if (NS_WARN_IF(!static_cast<PresentationService*>(mService.get())->
- IsSessionAccessible(aSessionId, aRole, OtherPid()))) {
- return true;
- }
-
- if (nsIPresentationService::ROLE_CONTROLLER == aRole) {
- mSessionIdsAtController.AppendElement(aSessionId);
- } else {
- mSessionIdsAtReceiver.AppendElement(aSessionId);
- }
- Unused << NS_WARN_IF(NS_FAILED(mService->RegisterSessionListener(aSessionId, aRole, this)));
- return true;
-}
-
-/* virtual */ bool
-PresentationParent::RecvUnregisterSessionHandler(const nsString& aSessionId,
- const uint8_t& aRole)
-{
- MOZ_ASSERT(mService);
- if (nsIPresentationService::ROLE_CONTROLLER == aRole) {
- mSessionIdsAtController.RemoveElement(aSessionId);
- } else {
- mSessionIdsAtReceiver.RemoveElement(aSessionId);
- }
- Unused << NS_WARN_IF(NS_FAILED(mService->UnregisterSessionListener(aSessionId, aRole)));
- return true;
-}
-
-/* virtual */ bool
-PresentationParent::RecvRegisterRespondingHandler(const uint64_t& aWindowId)
-{
- MOZ_ASSERT(mService);
-
- mWindowIds.AppendElement(aWindowId);
- Unused << NS_WARN_IF(NS_FAILED(mService->RegisterRespondingListener(aWindowId, this)));
- return true;
-}
-
-/* virtual */ bool
-PresentationParent::RecvUnregisterRespondingHandler(const uint64_t& aWindowId)
-{
- MOZ_ASSERT(mService);
- mWindowIds.RemoveElement(aWindowId);
- Unused << NS_WARN_IF(NS_FAILED(mService->UnregisterRespondingListener(aWindowId)));
- return true;
-}
-
-NS_IMETHODIMP
-PresentationParent::NotifyAvailableChange(const nsTArray<nsString>& aAvailabilityUrls,
- bool aAvailable)
-{
- if (NS_WARN_IF(mActorDestroyed ||
- !SendNotifyAvailableChange(aAvailabilityUrls,
- aAvailable))) {
- return NS_ERROR_FAILURE;
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationParent::NotifyStateChange(const nsAString& aSessionId,
- uint16_t aState,
- nsresult aReason)
-{
- if (NS_WARN_IF(mActorDestroyed ||
- !SendNotifySessionStateChange(nsString(aSessionId),
- aState,
- aReason))) {
- return NS_ERROR_FAILURE;
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationParent::NotifyMessage(const nsAString& aSessionId,
- const nsACString& aData,
- bool aIsBinary)
-{
- if (NS_WARN_IF(mActorDestroyed ||
- !SendNotifyMessage(nsString(aSessionId),
- nsCString(aData),
- aIsBinary))) {
- return NS_ERROR_FAILURE;
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-PresentationParent::NotifySessionConnect(uint64_t aWindowId,
- const nsAString& aSessionId)
-{
- if (NS_WARN_IF(mActorDestroyed ||
- !SendNotifySessionConnect(aWindowId, nsString(aSessionId)))) {
- return NS_ERROR_FAILURE;
- }
- return NS_OK;
-}
-
-bool
-PresentationParent::RecvNotifyReceiverReady(const nsString& aSessionId,
- const uint64_t& aWindowId,
- const bool& aIsLoading)
-{
- MOZ_ASSERT(mService);
-
- nsCOMPtr<nsIPresentationTransportBuilderConstructor> constructor =
- new PresentationTransportBuilderConstructorIPC(this);
- Unused << NS_WARN_IF(NS_FAILED(mService->NotifyReceiverReady(aSessionId,
- aWindowId,
- aIsLoading,
- constructor)));
- return true;
-}
-
-bool
-PresentationParent::RecvNotifyTransportClosed(const nsString& aSessionId,
- const uint8_t& aRole,
- const nsresult& aReason)
-{
- MOZ_ASSERT(mService);
-
- Unused << NS_WARN_IF(NS_FAILED(mService->NotifyTransportClosed(aSessionId, aRole, aReason)));
- return true;
-}
-
-/*
- * Implementation of PresentationRequestParent
- */
-
-NS_IMPL_ISUPPORTS(PresentationRequestParent, nsIPresentationServiceCallback)
-
-PresentationRequestParent::PresentationRequestParent(nsIPresentationService* aService,
- ContentParentId aContentParentId)
- : mService(aService)
- , mChildId(aContentParentId)
-{
- MOZ_COUNT_CTOR(PresentationRequestParent);
-}
-
-PresentationRequestParent::~PresentationRequestParent()
-{
- MOZ_COUNT_DTOR(PresentationRequestParent);
-}
-
-void
-PresentationRequestParent::ActorDestroy(ActorDestroyReason aWhy)
-{
- mActorDestroyed = true;
- mService = nullptr;
-}
-
-nsresult
-PresentationRequestParent::DoRequest(const StartSessionRequest& aRequest)
-{
- MOZ_ASSERT(mService);
-
- mSessionId = aRequest.sessionId();
-
- nsCOMPtr<nsIDOMEventTarget> eventTarget;
- ContentProcessManager* cpm = ContentProcessManager::GetSingleton();
- RefPtr<TabParent> tp =
- cpm->GetTopLevelTabParentByProcessAndTabId(mChildId, aRequest.tabId());
- if (tp) {
- eventTarget = do_QueryInterface(tp->GetOwnerElement());
- }
-
- RefPtr<PresentationParent> parent = static_cast<PresentationParent*>(Manager());
- nsCOMPtr<nsIPresentationTransportBuilderConstructor> constructor =
- new PresentationTransportBuilderConstructorIPC(parent);
- return mService->StartSession(aRequest.urls(), aRequest.sessionId(),
- aRequest.origin(), aRequest.deviceId(),
- aRequest.windowId(), eventTarget,
- aRequest.principal(), this, constructor);
-}
-
-nsresult
-PresentationRequestParent::DoRequest(const SendSessionMessageRequest& aRequest)
-{
- MOZ_ASSERT(mService);
-
- // Validate the accessibility (primarily for receiver side) so that a
- // compromised child process can't fake the ID.
- if (NS_WARN_IF(!static_cast<PresentationService*>(mService.get())->
- IsSessionAccessible(aRequest.sessionId(), aRequest.role(), OtherPid()))) {
- return SendResponse(NS_ERROR_DOM_SECURITY_ERR);
- }
-
- nsresult rv = mService->SendSessionMessage(aRequest.sessionId(),
- aRequest.role(),
- aRequest.data());
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return SendResponse(rv);
- }
- return SendResponse(NS_OK);
-}
-
-nsresult
-PresentationRequestParent::DoRequest(const CloseSessionRequest& aRequest)
-{
- MOZ_ASSERT(mService);
-
- // Validate the accessibility (primarily for receiver side) so that a
- // compromised child process can't fake the ID.
- if (NS_WARN_IF(!static_cast<PresentationService*>(mService.get())->
- IsSessionAccessible(aRequest.sessionId(), aRequest.role(), OtherPid()))) {
- return SendResponse(NS_ERROR_DOM_SECURITY_ERR);
- }
-
- nsresult rv = mService->CloseSession(aRequest.sessionId(),
- aRequest.role(),
- aRequest.closedReason());
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return SendResponse(rv);
- }
- return SendResponse(NS_OK);
-}
-
-nsresult
-PresentationRequestParent::DoRequest(const TerminateSessionRequest& aRequest)
-{
- MOZ_ASSERT(mService);
-
- // Validate the accessibility (primarily for receiver side) so that a
- // compromised child process can't fake the ID.
- if (NS_WARN_IF(!static_cast<PresentationService*>(mService.get())->
- IsSessionAccessible(aRequest.sessionId(), aRequest.role(), OtherPid()))) {
- return SendResponse(NS_ERROR_DOM_SECURITY_ERR);
- }
-
- nsresult rv = mService->TerminateSession(aRequest.sessionId(), aRequest.role());
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return SendResponse(rv);
- }
- return SendResponse(NS_OK);
-}
-
-nsresult
-PresentationRequestParent::DoRequest(const ReconnectSessionRequest& aRequest)
-{
- MOZ_ASSERT(mService);
-
- // Validate the accessibility (primarily for receiver side) so that a
- // compromised child process can't fake the ID.
- if (NS_WARN_IF(!static_cast<PresentationService*>(mService.get())->
- IsSessionAccessible(aRequest.sessionId(), aRequest.role(), OtherPid()))) {
-
- // NOTE: Return NS_ERROR_DOM_NOT_FOUND_ERR here to match the spec.
- // https://w3c.github.io/presentation-api/#reconnecting-to-a-presentation
- return SendResponse(NS_ERROR_DOM_NOT_FOUND_ERR);
- }
-
- mSessionId = aRequest.sessionId();
- return mService->ReconnectSession(aRequest.urls(),
- aRequest.sessionId(),
- aRequest.role(),
- this);
-}
-
-nsresult
-PresentationRequestParent::DoRequest(const BuildTransportRequest& aRequest)
-{
- MOZ_ASSERT(mService);
-
- // Validate the accessibility (primarily for receiver side) so that a
- // compromised child process can't fake the ID.
- if (NS_WARN_IF(!static_cast<PresentationService*>(mService.get())->
- IsSessionAccessible(aRequest.sessionId(), aRequest.role(), OtherPid()))) {
- return SendResponse(NS_ERROR_DOM_SECURITY_ERR);
- }
-
- nsresult rv = mService->BuildTransport(aRequest.sessionId(), aRequest.role());
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return SendResponse(rv);
- }
- return SendResponse(NS_OK);
-}
-
-NS_IMETHODIMP
-PresentationRequestParent::NotifySuccess(const nsAString& aUrl)
-{
- Unused << SendNotifyRequestUrlSelected(nsString(aUrl));
- return SendResponse(NS_OK);
-}
-
-NS_IMETHODIMP
-PresentationRequestParent::NotifyError(nsresult aError)
-{
- return SendResponse(aError);
-}
-
-nsresult
-PresentationRequestParent::SendResponse(nsresult aResult)
-{
- if (NS_WARN_IF(mActorDestroyed || !Send__delete__(this, aResult))) {
- return NS_ERROR_FAILURE;
- }
-
- return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/ipc/PresentationParent.h b/dom/presentation/ipc/PresentationParent.h
deleted file mode 100644
index b038aa216..000000000
--- a/dom/presentation/ipc/PresentationParent.h
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 40 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_PresentationParent_h__
-#define mozilla_dom_PresentationParent_h__
-
-#include "mozilla/dom/ipc/IdType.h"
-#include "mozilla/dom/PPresentationBuilderParent.h"
-#include "mozilla/dom/PPresentationParent.h"
-#include "mozilla/dom/PPresentationRequestParent.h"
-#include "nsIPresentationListener.h"
-#include "nsIPresentationService.h"
-#include "nsIPresentationSessionTransportBuilder.h"
-
-namespace mozilla {
-namespace dom {
-
-class PresentationParent final : public PPresentationParent
- , public nsIPresentationAvailabilityListener
- , public nsIPresentationSessionListener
- , public nsIPresentationRespondingListener
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONAVAILABILITYLISTENER
- NS_DECL_NSIPRESENTATIONSESSIONLISTENER
- NS_DECL_NSIPRESENTATIONRESPONDINGLISTENER
-
- PresentationParent();
-
- bool Init(ContentParentId aContentParentId);
-
- bool RegisterTransportBuilder(const nsString& aSessionId, const uint8_t& aRole);
-
- virtual void ActorDestroy(ActorDestroyReason aWhy) override;
-
- virtual bool
- RecvPPresentationRequestConstructor(PPresentationRequestParent* aActor,
- const PresentationIPCRequest& aRequest) override;
-
- virtual PPresentationRequestParent*
- AllocPPresentationRequestParent(const PresentationIPCRequest& aRequest) override;
-
- virtual bool
- DeallocPPresentationRequestParent(PPresentationRequestParent* aActor) override;
-
- virtual PPresentationBuilderParent*
- AllocPPresentationBuilderParent(const nsString& aSessionId,
- const uint8_t& aRole) override;
-
- virtual bool
- DeallocPPresentationBuilderParent(
- PPresentationBuilderParent* aActor) override;
-
- virtual bool Recv__delete__() override;
-
- virtual bool RecvRegisterAvailabilityHandler(
- nsTArray<nsString>&& aAvailabilityUrls) override;
-
- virtual bool RecvUnregisterAvailabilityHandler(
- nsTArray<nsString>&& aAvailabilityUrls) override;
-
- virtual bool RecvRegisterSessionHandler(const nsString& aSessionId,
- const uint8_t& aRole) override;
-
- virtual bool RecvUnregisterSessionHandler(const nsString& aSessionId,
- const uint8_t& aRole) override;
-
- virtual bool RecvRegisterRespondingHandler(const uint64_t& aWindowId) override;
-
- virtual bool RecvUnregisterRespondingHandler(const uint64_t& aWindowId) override;
-
- virtual bool RecvNotifyReceiverReady(const nsString& aSessionId,
- const uint64_t& aWindowId,
- const bool& aIsLoading) override;
-
- virtual bool RecvNotifyTransportClosed(const nsString& aSessionId,
- const uint8_t& aRole,
- const nsresult& aReason) override;
-
-private:
- virtual ~PresentationParent();
-
- bool mActorDestroyed = false;
- nsCOMPtr<nsIPresentationService> mService;
- nsTArray<nsString> mSessionIdsAtController;
- nsTArray<nsString> mSessionIdsAtReceiver;
- nsTArray<uint64_t> mWindowIds;
- ContentParentId mChildId;
- nsTArray<nsString> mContentAvailabilityUrls;
-};
-
-class PresentationRequestParent final : public PPresentationRequestParent
- , public nsIPresentationServiceCallback
-{
- friend class PresentationParent;
-
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONSERVICECALLBACK
-
- explicit PresentationRequestParent(nsIPresentationService* aService,
- ContentParentId aContentParentId);
-
- virtual void ActorDestroy(ActorDestroyReason aWhy) override;
-
-private:
- virtual ~PresentationRequestParent();
-
- nsresult SendResponse(nsresult aResult);
-
- nsresult DoRequest(const StartSessionRequest& aRequest);
-
- nsresult DoRequest(const SendSessionMessageRequest& aRequest);
-
- nsresult DoRequest(const CloseSessionRequest& aRequest);
-
- nsresult DoRequest(const TerminateSessionRequest& aRequest);
-
- nsresult DoRequest(const ReconnectSessionRequest& aRequest);
-
- nsresult DoRequest(const BuildTransportRequest& aRequest);
-
- bool mActorDestroyed = false;
- bool mNeedRegisterBuilder = false;
- nsString mSessionId;
- nsCOMPtr<nsIPresentationService> mService;
- ContentParentId mChildId;
-};
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_PresentationParent_h__
diff --git a/dom/presentation/moz.build b/dom/presentation/moz.build
deleted file mode 100644
index a7058382f..000000000
--- a/dom/presentation/moz.build
+++ /dev/null
@@ -1,89 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DIRS += ['interfaces', 'provider']
-
-XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
-MOCHITEST_MANIFESTS += ['tests/mochitest/mochitest.ini']
-MOCHITEST_CHROME_MANIFESTS += ['tests/mochitest/chrome.ini']
-
-EXPORTS.mozilla.dom += [
- 'DCPresentationChannelDescription.h',
- 'ipc/PresentationBuilderChild.h',
- 'ipc/PresentationBuilderParent.h',
- 'ipc/PresentationChild.h',
- 'ipc/PresentationIPCService.h',
- 'ipc/PresentationParent.h',
- 'Presentation.h',
- 'PresentationAvailability.h',
- 'PresentationCallbacks.h',
- 'PresentationConnection.h',
- 'PresentationConnectionList.h',
- 'PresentationDeviceManager.h',
- 'PresentationReceiver.h',
- 'PresentationRequest.h',
- 'PresentationService.h',
- 'PresentationServiceBase.h',
- 'PresentationSessionInfo.h',
- 'PresentationTCPSessionTransport.h',
-]
-
-UNIFIED_SOURCES += [
- 'AvailabilityCollection.cpp',
- 'ControllerConnectionCollection.cpp',
- 'DCPresentationChannelDescription.cpp',
- 'ipc/PresentationBuilderChild.cpp',
- 'ipc/PresentationBuilderParent.cpp',
- 'ipc/PresentationChild.cpp',
- 'ipc/PresentationContentSessionInfo.cpp',
- 'ipc/PresentationIPCService.cpp',
- 'ipc/PresentationParent.cpp',
- 'Presentation.cpp',
- 'PresentationAvailability.cpp',
- 'PresentationCallbacks.cpp',
- 'PresentationConnection.cpp',
- 'PresentationConnectionList.cpp',
- 'PresentationDeviceManager.cpp',
- 'PresentationReceiver.cpp',
- 'PresentationRequest.cpp',
- 'PresentationService.cpp',
- 'PresentationSessionInfo.cpp',
- 'PresentationSessionRequest.cpp',
- 'PresentationTCPSessionTransport.cpp',
- 'PresentationTerminateRequest.cpp',
- 'PresentationTransportBuilderConstructor.cpp'
-]
-
-EXTRA_COMPONENTS += [
- 'PresentationDataChannelSessionTransport.js',
- 'PresentationDataChannelSessionTransport.manifest',
- 'PresentationDeviceInfoManager.js',
- 'PresentationDeviceInfoManager.manifest',
-]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- EXTRA_COMPONENTS += [
- 'PresentationNetworkHelper.js',
- 'PresentationNetworkHelper.manifest',
- ]
-
-EXTRA_JS_MODULES += [
- 'PresentationDeviceInfoManager.jsm',
-]
-
-IPDL_SOURCES += [
- 'ipc/PPresentation.ipdl',
- 'ipc/PPresentationBuilder.ipdl',
- 'ipc/PPresentationRequest.ipdl'
-]
-
-LOCAL_INCLUDES += [
- '../base'
-]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
diff --git a/dom/presentation/provider/AndroidCastDeviceProvider.js b/dom/presentation/provider/AndroidCastDeviceProvider.js
deleted file mode 100644
index cf555f77b..000000000
--- a/dom/presentation/provider/AndroidCastDeviceProvider.js
+++ /dev/null
@@ -1,461 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-/* jshint esnext:true, globalstrict:true, moz:true, undef:true, unused:true */
-/* globals Components, dump */
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-// globals XPCOMUtils
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-// globals Services
-Cu.import("resource://gre/modules/Services.jsm");
-// globals Messaging
-Cu.import("resource://gre/modules/Messaging.jsm");
-
-function log(str) {
- // dump("-*- AndroidCastDeviceProvider -*-: " + str + "\n");
-}
-
-// Helper function: transfer nsIPresentationChannelDescription to json
-function descriptionToString(aDescription) {
- let json = {};
- json.type = aDescription.type;
- switch(aDescription.type) {
- case Ci.nsIPresentationChannelDescription.TYPE_TCP:
- let addresses = aDescription.tcpAddress.QueryInterface(Ci.nsIArray);
- json.tcpAddress = [];
- for (let idx = 0; idx < addresses.length; idx++) {
- let address = addresses.queryElementAt(idx, Ci.nsISupportsCString);
- json.tcpAddress.push(address.data);
- }
- json.tcpPort = aDescription.tcpPort;
- break;
- case Ci.nsIPresentationChannelDescription.TYPE_DATACHANNEL:
- json.dataChannelSDP = aDescription.dataChannelSDP;
- break;
- }
- return JSON.stringify(json);
-}
-
-const TOPIC_ANDROID_CAST_DEVICE_SYNCDEVICE = "AndroidCastDevice:SyncDevice";
-const TOPIC_ANDROID_CAST_DEVICE_ADDED = "AndroidCastDevice:Added";
-const TOPIC_ANDROID_CAST_DEVICE_REMOVED = "AndroidCastDevice:Removed";
-const TOPIC_ANDROID_CAST_DEVICE_START = "AndroidCastDevice:Start";
-const TOPIC_ANDROID_CAST_DEVICE_STOP = "AndroidCastDevice:Stop";
-const TOPIC_PRESENTATION_VIEW_READY = "presentation-view-ready";
-
-function LocalControlChannel(aProvider, aDeviceId, aRole) {
- log("LocalControlChannel - create new LocalControlChannel for : "
- + aRole);
- this._provider = aProvider;
- this._deviceId = aDeviceId;
- this._role = aRole;
-}
-
-LocalControlChannel.prototype = {
- _listener: null,
- _provider: null,
- _deviceId: null,
- _role: null,
- _isOnTerminating: false,
- _isOnDisconnecting: false,
- _pendingConnected: false,
- _pendingDisconnect: null,
- _pendingOffer: null,
- _pendingCandidate: null,
- /* For the controller, it would be the control channel of the receiver.
- * For the receiver, it would be the control channel of the controller. */
- _correspondingControlChannel: null,
-
- set correspondingControlChannel(aCorrespondingControlChannel) {
- this._correspondingControlChannel = aCorrespondingControlChannel;
- },
-
- get correspondingControlChannel() {
- return this._correspondingControlChannel;
- },
-
- notifyConnected: function LCC_notifyConnected() {
- this._pendingDisconnect = null;
-
- if (!this._listener) {
- this._pendingConnected = true;
- } else {
- this._listener.notifyConnected();
- }
- },
-
- onOffer: function LCC_onOffer(aOffer) {
- if (this._role == Ci.nsIPresentationService.ROLE_CONTROLLER) {
- log("LocalControlChannel - onOffer of controller should not be called.");
- return;
- }
- if (!this._listener) {
- this._pendingOffer = aOffer;
- } else {
- this._listener.onOffer(aOffer);
- }
- },
-
- onAnswer: function LCC_onAnswer(aAnswer) {
- if (this._role == Ci.nsIPresentationService.ROLE_RECEIVER) {
- log("LocalControlChannel - onAnswer of receiver should not be called.");
- return;
- }
- this._listener.onAnswer(aAnswer);
- },
-
- notifyIceCandidate: function LCC_notifyIceCandidate(aCandidate) {
- if (!this._listener) {
- this._pendingCandidate = aCandidate;
- } else {
- this._listener.onIceCandidate(aCandidate);
- }
- },
-
- // nsIPresentationControlChannel
- get listener() {
- return this._listener;
- },
-
- set listener(aListener) {
- this._listener = aListener;
-
- if (!this._listener) {
- return;
- }
-
- if (this._pendingConnected) {
- this.notifyConnected();
- this._pendingConnected = false;
- }
-
- if (this._pendingOffer) {
- this.onOffer(this._pendingOffer);
- this._pendingOffer = null;
- }
-
- if (this._pendingCandidate) {
- this.notifyIceCandidate(this._pendingCandidate);
- this._pendingCandidate = null;
- }
-
- if (this._pendingDisconnect != null) {
- this.disconnect(this._pendingDisconnect);
- this._pendingDisconnect = null;
- }
- },
-
- sendOffer: function LCC_sendOffer(aOffer) {
- if (this._role == Ci.nsIPresentationService.ROLE_RECEIVER) {
- log("LocalControlChannel - sendOffer of receiver should not be called.");
- return;
- }
- log("LocalControlChannel - sendOffer aOffer=" + descriptionToString(aOffer));
- this._correspondingControlChannel.onOffer(aOffer);
- },
-
- sendAnswer: function LCC_sendAnswer(aAnswer) {
- if (this._role == Ci.nsIPresentationService.ROLE_CONTROLLER) {
- log("LocalControlChannel - sendAnswer of controller should not be called.");
- return;
- }
- log("LocalControlChannel - sendAnswer aAnswer=" + descriptionToString(aAnswer));
- this._correspondingControlChannel.onAnswer(aAnswer);
- },
-
- sendIceCandidate: function LCC_sendIceCandidate(aCandidate) {
- log("LocalControlChannel - sendAnswer aCandidate=" + aCandidate);
- this._correspondingControlChannel.notifyIceCandidate(aCandidate);
- },
-
- launch: function LCC_launch(aPresentationId, aUrl) {
- log("LocalControlChannel - launch aPresentationId="
- + aPresentationId + " aUrl=" + aUrl);
- // Create control channel for receiver directly.
- let controlChannel = new LocalControlChannel(this._provider,
- this._deviceId,
- Ci.nsIPresentationService.ROLE_RECEIVER);
-
- // Set up the corresponding control channels for both controller and receiver.
- this._correspondingControlChannel = controlChannel;
- controlChannel._correspondingControlChannel = this;
-
- this._provider.onSessionRequest(this._deviceId,
- aUrl,
- aPresentationId,
- controlChannel);
- controlChannel.notifyConnected();
- },
-
- terminate: function LCC_terminate(aPresentationId) {
- log("LocalControlChannel - terminate aPresentationId="
- + aPresentationId);
-
- if (this._isOnTerminating) {
- return;
- }
-
- // Create control channel for corresponding role directly.
- let correspondingRole = this._role == Ci.nsIPresentationService.ROLE_CONTROLLER
- ? Ci.nsIPresentationService.ROLE_RECEIVER
- : Ci.nsIPresentationService.ROLE_CONTROLLER;
- let controlChannel = new LocalControlChannel(this._provider,
- this._deviceId,
- correspondingRole);
- // Prevent the termination recursion.
- controlChannel._isOnTerminating = true;
-
- // Set up the corresponding control channels for both controller and receiver.
- this._correspondingControlChannel = controlChannel;
- controlChannel._correspondingControlChannel = this;
-
- this._provider.onTerminateRequest(this._deviceId,
- aPresentationId,
- controlChannel,
- this._role == Ci.nsIPresentationService.ROLE_RECEIVER);
- controlChannel.notifyConnected();
- },
-
- disconnect: function LCC_disconnect(aReason) {
- log("LocalControlChannel - disconnect aReason=" + aReason);
-
- if (this._isOnDisconnecting) {
- return;
- }
-
- this._pendingOffer = null;
- this._pendingCandidate = null;
- this._pendingConnected = false;
-
- // this._pendingDisconnect is a nsresult.
- // If it is null, it means no pending disconnect.
- // If it is NS_OK, it means this control channel is disconnected normally.
- // If it is other nsresult value, it means this control channel is
- // disconnected abnormally.
-
- // Remote endpoint closes the control channel with abnormal reason.
- if (aReason == Cr.NS_OK &&
- this._pendingDisconnect != null &&
- this._pendingDisconnect != Cr.NS_OK) {
- aReason = this._pendingDisconnect;
- }
-
- if (!this._listener) {
- this._pendingDisconnect = aReason;
- return;
- }
-
- this._isOnDisconnecting = true;
- this._correspondingControlChannel.disconnect(aReason);
- this._listener.notifyDisconnected(aReason);
- },
-
- reconnect: function LCC_reconnect(aPresentationId, aUrl) {
- log("1-UA on Android doesn't support reconnect.");
- throw Cr.NS_ERROR_FAILURE;
- },
-
- classID: Components.ID("{c9be9450-e5c7-4294-a287-376971b017fd}"),
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannel]),
-};
-
-function ChromecastRemoteDisplayDevice(aProvider, aId, aName, aRole) {
- this._provider = aProvider;
- this._id = aId;
- this._name = aName;
- this._role = aRole;
-}
-
-ChromecastRemoteDisplayDevice.prototype = {
- _id: null,
- _name: null,
- _role: null,
- _provider: null,
- _ctrlChannel: null,
-
- update: function CRDD_update(aName) {
- this._name = aName || this._name;
- },
-
- // nsIPresentationDevice
- get id() { return this._id; },
-
- get name() { return this._name; },
-
- get type() { return "chromecast"; },
-
- establishControlChannel: function CRDD_establishControlChannel() {
- this._ctrlChannel = new LocalControlChannel(this._provider,
- this._id,
- this._role);
-
- if (this._role == Ci.nsIPresentationService.ROLE_CONTROLLER) {
- // Only connect to Chromecast for controller.
- // Monitor the receiver being ready.
- Services.obs.addObserver(this, TOPIC_PRESENTATION_VIEW_READY, true);
-
- // Launch Chromecast service in Android.
- Messaging.sendRequestForResult({
- type: TOPIC_ANDROID_CAST_DEVICE_START,
- id: this.id
- }).then(result => {
- log("Chromecast is connected.");
- }).catch(error => {
- log("Can not connect to Chromecast.");
- // If Chromecast can not be launched, remove the observer.
- Services.obs.removeObserver(this, TOPIC_PRESENTATION_VIEW_READY);
- this._ctrlChannel.disconnect(Cr.NS_ERROR_FAILURE);
- });
- } else {
- // If establishControlChannel called from the receiver, we don't need to
- // wait the 'presentation-view-ready' event.
- this._ctrlChannel.notifyConnected();
- }
-
- return this._ctrlChannel;
- },
-
- disconnect: function CRDD_disconnect() {
- // Disconnect from Chromecast.
- Messaging.sendRequestForResult({
- type: TOPIC_ANDROID_CAST_DEVICE_STOP,
- id: this.id
- });
- },
-
- isRequestedUrlSupported: function CRDD_isRequestedUrlSupported(aUrl) {
- let url = Cc["@mozilla.org/network/io-service;1"]
- .getService(Ci.nsIIOService)
- .newURI(aUrl, null, null);
- return url.scheme == "http" || url.scheme == "https";
- },
-
- // nsIPresentationLocalDevice
- get windowId() { return this._id; },
-
- // nsIObserver
- observe: function CRDD_observe(aSubject, aTopic, aData) {
- if (aTopic == TOPIC_PRESENTATION_VIEW_READY) {
- log("ChromecastRemoteDisplayDevice - observe: aTopic="
- + aTopic + " data=" + aData);
- if (this.windowId === aData) {
- Services.obs.removeObserver(this, TOPIC_PRESENTATION_VIEW_READY);
- this._ctrlChannel.notifyConnected();
- }
- }
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDevice,
- Ci.nsIPresentationLocalDevice,
- Ci.nsISupportsWeakReference,
- Ci.nsIObserver]),
-};
-
-function AndroidCastDeviceProvider() {
-}
-
-AndroidCastDeviceProvider.prototype = {
- _listener: null,
- _deviceList: new Map(),
-
- onSessionRequest: function APDP_onSessionRequest(aDeviceId,
- aUrl,
- aPresentationId,
- aControlChannel) {
- log("AndroidCastDeviceProvider - onSessionRequest"
- + " aDeviceId=" + aDeviceId);
- let device = this._deviceList.get(aDeviceId);
- let receiverDevice = new ChromecastRemoteDisplayDevice(this,
- device.id,
- device.name,
- Ci.nsIPresentationService.ROLE_RECEIVER);
- this._listener.onSessionRequest(receiverDevice,
- aUrl,
- aPresentationId,
- aControlChannel);
- },
-
- onTerminateRequest: function APDP_onTerminateRequest(aDeviceId,
- aPresentationId,
- aControlChannel,
- aIsFromReceiver) {
- log("AndroidCastDeviceProvider - onTerminateRequest"
- + " aDeviceId=" + aDeviceId
- + " aPresentationId=" + aPresentationId
- + " aIsFromReceiver=" + aIsFromReceiver);
- let device = this._deviceList.get(aDeviceId);
- this._listener.onTerminateRequest(device,
- aPresentationId,
- aControlChannel,
- aIsFromReceiver);
- },
-
- // nsIPresentationDeviceProvider
- set listener(aListener) {
- this._listener = aListener;
-
- // When unload this provider.
- if (!this._listener) {
- // remove observer
- Services.obs.removeObserver(this, TOPIC_ANDROID_CAST_DEVICE_ADDED);
- Services.obs.removeObserver(this, TOPIC_ANDROID_CAST_DEVICE_REMOVED);
- return;
- }
-
- // Sync all device already found by Android.
- Services.obs.notifyObservers(null, TOPIC_ANDROID_CAST_DEVICE_SYNCDEVICE, "");
- // Observer registration
- Services.obs.addObserver(this, TOPIC_ANDROID_CAST_DEVICE_ADDED, false);
- Services.obs.addObserver(this, TOPIC_ANDROID_CAST_DEVICE_REMOVED, false);
- },
-
- get listener() {
- return this._listener;
- },
-
- forceDiscovery: function APDP_forceDiscovery() {
- // There is no API to do force discovery in Android SDK.
- },
-
- // nsIObserver
- observe: function APDP_observe(aSubject, aTopic, aData) {
- switch (aTopic) {
- case TOPIC_ANDROID_CAST_DEVICE_ADDED: {
- let deviceInfo = JSON.parse(aData);
- let deviceId = deviceInfo.uuid;
-
- if (!this._deviceList.has(deviceId)) {
- let device = new ChromecastRemoteDisplayDevice(this,
- deviceInfo.uuid,
- deviceInfo.friendlyName,
- Ci.nsIPresentationService.ROLE_CONTROLLER);
- this._deviceList.set(device.id, device);
- this._listener.addDevice(device);
- } else {
- let device = this._deviceList.get(deviceId);
- device.update(deviceInfo.friendlyName);
- this._listener.updateDevice(device);
- }
- break;
- }
- case TOPIC_ANDROID_CAST_DEVICE_REMOVED: {
- let deviceId = aData;
- let device = this._deviceList.get(deviceId);
- this._listener.removeDevice(device);
- this._deviceList.delete(deviceId);
- break;
- }
- }
- },
-
- classID: Components.ID("{7394f24c-dbc3-48c8-8a47-cd10169b7c6b}"),
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
- Ci.nsIPresentationDeviceProvider]),
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([AndroidCastDeviceProvider]);
diff --git a/dom/presentation/provider/AndroidCastDeviceProvider.manifest b/dom/presentation/provider/AndroidCastDeviceProvider.manifest
deleted file mode 100644
index db2aa101b..000000000
--- a/dom/presentation/provider/AndroidCastDeviceProvider.manifest
+++ /dev/null
@@ -1,4 +0,0 @@
-# AndroidCastDeviceProvider.js
-component {7394f24c-dbc3-48c8-8a47-cd10169b7c6b} AndroidCastDeviceProvider.js
-contract @mozilla.org/presentation-device/android-cast-device-provider;1 {7394f24c-dbc3-48c8-8a47-cd10169b7c6b}
-category presentation-device-provider AndroidCastDeviceProvider @mozilla.org/presentation-device/android-cast-device-provider;1
diff --git a/dom/presentation/provider/BuiltinProviders.manifest b/dom/presentation/provider/BuiltinProviders.manifest
deleted file mode 100644
index 0ba7bcaa7..000000000
--- a/dom/presentation/provider/BuiltinProviders.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {f4079b8b-ede5-4b90-a112-5b415a931deb} PresentationControlService.js
-contract @mozilla.org/presentation/control-service;1 {f4079b8b-ede5-4b90-a112-5b415a931deb}
diff --git a/dom/presentation/provider/ControllerStateMachine.jsm b/dom/presentation/provider/ControllerStateMachine.jsm
deleted file mode 100644
index b568a8e9a..000000000
--- a/dom/presentation/provider/ControllerStateMachine.jsm
+++ /dev/null
@@ -1,240 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-/* jshint esnext:true, globalstrict:true, moz:true, undef:true, unused:true */
-/* globals Components, dump */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["ControllerStateMachine"]; // jshint ignore:line
-
-const { utils: Cu } = Components;
-
-/* globals State, CommandType */
-Cu.import("resource://gre/modules/presentation/StateMachineHelper.jsm");
-
-const DEBUG = false;
-function debug(str) {
- dump("-*- ControllerStateMachine: " + str + "\n");
-}
-
-var handlers = [
- function _initHandler(stateMachine, command) {
- // shouldn't receive any command at init state.
- DEBUG && debug("unexpected command: " + JSON.stringify(command)); // jshint ignore:line
- },
- function _connectingHandler(stateMachine, command) {
- switch (command.type) {
- case CommandType.CONNECT_ACK:
- stateMachine.state = State.CONNECTED;
- stateMachine._notifyDeviceConnected();
- break;
- case CommandType.DISCONNECT:
- stateMachine.state = State.CLOSED;
- stateMachine._notifyDisconnected(command.reason);
- break;
- default:
- debug("unexpected command: " + JSON.stringify(command));
- // ignore unexpected command.
- break;
- }
- },
- function _connectedHandler(stateMachine, command) {
- switch (command.type) {
- case CommandType.DISCONNECT:
- stateMachine.state = State.CLOSED;
- stateMachine._notifyDisconnected(command.reason);
- break;
- case CommandType.LAUNCH_ACK:
- stateMachine._notifyLaunch(command.presentationId);
- break;
- case CommandType.TERMINATE:
- stateMachine._notifyTerminate(command.presentationId);
- break;
- case CommandType.TERMINATE_ACK:
- stateMachine._notifyTerminate(command.presentationId);
- break;
- case CommandType.ANSWER:
- case CommandType.ICE_CANDIDATE:
- stateMachine._notifyChannelDescriptor(command);
- break;
- case CommandType.RECONNECT_ACK:
- stateMachine._notifyReconnect(command.presentationId);
- break;
- default:
- debug("unexpected command: " + JSON.stringify(command));
- // ignore unexpected command.
- break;
- }
- },
- function _closingHandler(stateMachine, command) {
- switch (command.type) {
- case CommandType.DISCONNECT:
- stateMachine.state = State.CLOSED;
- stateMachine._notifyDisconnected(command.reason);
- break;
- default:
- debug("unexpected command: " + JSON.stringify(command));
- // ignore unexpected command.
- break;
- }
- },
- function _closedHandler(stateMachine, command) {
- // ignore every command in closed state.
- DEBUG && debug("unexpected command: " + JSON.stringify(command)); // jshint ignore:line
- },
-];
-
-function ControllerStateMachine(channel, deviceId) {
- this.state = State.INIT;
- this._channel = channel;
- this._deviceId = deviceId;
-}
-
-ControllerStateMachine.prototype = {
- launch: function _launch(presentationId, url) {
- if (this.state === State.CONNECTED) {
- this._sendCommand({
- type: CommandType.LAUNCH,
- presentationId: presentationId,
- url: url,
- });
- }
- },
-
- terminate: function _terminate(presentationId) {
- if (this.state === State.CONNECTED) {
- this._sendCommand({
- type: CommandType.TERMINATE,
- presentationId: presentationId,
- });
- }
- },
-
- terminateAck: function _terminateAck(presentationId) {
- if (this.state === State.CONNECTED) {
- this._sendCommand({
- type: CommandType.TERMINATE_ACK,
- presentationId: presentationId,
- });
- }
- },
-
- reconnect: function _reconnect(presentationId, url) {
- if (this.state === State.CONNECTED) {
- this._sendCommand({
- type: CommandType.RECONNECT,
- presentationId: presentationId,
- url: url,
- });
- }
- },
-
- sendOffer: function _sendOffer(offer) {
- if (this.state === State.CONNECTED) {
- this._sendCommand({
- type: CommandType.OFFER,
- offer: offer,
- });
- }
- },
-
- sendAnswer: function _sendAnswer() {
- // answer can only be sent by presenting UA.
- debug("controller shouldn't generate answer");
- },
-
- updateIceCandidate: function _updateIceCandidate(candidate) {
- if (this.state === State.CONNECTED) {
- this._sendCommand({
- type: CommandType.ICE_CANDIDATE,
- candidate: candidate,
- });
- }
- },
-
- onCommand: function _onCommand(command) {
- handlers[this.state](this, command);
- },
-
- onChannelReady: function _onChannelReady() {
- if (this.state === State.INIT) {
- this._sendCommand({
- type: CommandType.CONNECT,
- deviceId: this._deviceId
- });
- this.state = State.CONNECTING;
- }
- },
-
- onChannelClosed: function _onChannelClose(reason, isByRemote) {
- switch (this.state) {
- case State.CONNECTED:
- if (isByRemote) {
- this.state = State.CLOSED;
- this._notifyDisconnected(reason);
- } else {
- this._sendCommand({
- type: CommandType.DISCONNECT,
- reason: reason
- });
- this.state = State.CLOSING;
- this._closeReason = reason;
- }
- break;
- case State.CLOSING:
- if (isByRemote) {
- this.state = State.CLOSED;
- if (this._closeReason) {
- reason = this._closeReason;
- delete this._closeReason;
- }
- this._notifyDisconnected(reason);
- }
- break;
- default:
- DEBUG && debug("unexpected channel close: " + reason + ", " + isByRemote); // jshint ignore:line
- break;
- }
- },
-
- _sendCommand: function _sendCommand(command) {
- this._channel.sendCommand(command);
- },
-
- _notifyDeviceConnected: function _notifyDeviceConnected() {
- //XXX trigger following command
- this._channel.notifyDeviceConnected();
- },
-
- _notifyDisconnected: function _notifyDisconnected(reason) {
- this._channel.notifyDisconnected(reason);
- },
-
- _notifyLaunch: function _notifyLaunch(presentationId) {
- this._channel.notifyLaunch(presentationId);
- },
-
- _notifyTerminate: function _notifyTerminate(presentationId) {
- this._channel.notifyTerminate(presentationId);
- },
-
- _notifyReconnect: function _notifyReconnect(presentationId) {
- this._channel.notifyReconnect(presentationId);
- },
-
- _notifyChannelDescriptor: function _notifyChannelDescriptor(command) {
- switch (command.type) {
- case CommandType.ANSWER:
- this._channel.notifyAnswer(command.answer);
- break;
- case CommandType.ICE_CANDIDATE:
- this._channel.notifyIceCandidate(command.candidate);
- break;
- }
- },
-};
-
-this.ControllerStateMachine = ControllerStateMachine; // jshint ignore:line
diff --git a/dom/presentation/provider/DeviceProviderHelpers.cpp b/dom/presentation/provider/DeviceProviderHelpers.cpp
deleted file mode 100644
index 00b2c12f1..000000000
--- a/dom/presentation/provider/DeviceProviderHelpers.cpp
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "DeviceProviderHelpers.h"
-
-#include "nsCOMPtr.h"
-#include "nsIURI.h"
-#include "nsNetUtil.h"
-
-namespace mozilla {
-namespace dom {
-namespace presentation {
-
-static const char* const kFxTVPresentationAppUrls[] = {
- "app://fling-player.gaiamobile.org/index.html",
- "app://notification-receiver.gaiamobile.org/index.html",
- nullptr
-};
-
-/* static */ bool
-DeviceProviderHelpers::IsCommonlySupportedScheme(const nsAString& aUrl)
-{
- nsCOMPtr<nsIURI> uri;
- nsresult rv = NS_NewURI(getter_AddRefs(uri), aUrl);
- if (NS_FAILED(rv) || !uri) {
- return false;
- }
-
- nsAutoCString scheme;
- uri->GetScheme(scheme);
- if (scheme.LowerCaseEqualsLiteral("http") ||
- scheme.LowerCaseEqualsLiteral("https")) {
- return true;
- }
-
- return false;
-}
-
-/* static */ bool
-DeviceProviderHelpers::IsFxTVSupportedAppUrl(const nsAString& aUrl)
-{
- // Check if matched with any presentation Apps on TV.
- for (uint32_t i = 0; kFxTVPresentationAppUrls[i]; i++) {
- if (aUrl.EqualsASCII(kFxTVPresentationAppUrls[i])) {
- return true;
- }
- }
-
- return false;
-}
-
-} // namespace presentation
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/provider/DeviceProviderHelpers.h b/dom/presentation/provider/DeviceProviderHelpers.h
deleted file mode 100644
index 4bde09bed..000000000
--- a/dom/presentation/provider/DeviceProviderHelpers.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_presentation_DeviceProviderHelpers_h
-#define mozilla_dom_presentation_DeviceProviderHelpers_h
-
-#include "nsString.h"
-
-namespace mozilla {
-namespace dom {
-namespace presentation {
-
-class DeviceProviderHelpers final
-{
-public:
- static bool IsCommonlySupportedScheme(const nsAString& aUrl);
- static bool IsFxTVSupportedAppUrl(const nsAString& aUrl);
-
-private:
- DeviceProviderHelpers() = delete;
-};
-
-} // namespace presentation
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_presentation_DeviceProviderHelpers_h
diff --git a/dom/presentation/provider/DisplayDeviceProvider.cpp b/dom/presentation/provider/DisplayDeviceProvider.cpp
deleted file mode 100644
index 3f88aba5e..000000000
--- a/dom/presentation/provider/DisplayDeviceProvider.cpp
+++ /dev/null
@@ -1,580 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "DisplayDeviceProvider.h"
-
-#include "DeviceProviderHelpers.h"
-#include "mozilla/Logging.h"
-#include "mozilla/Preferences.h"
-#include "mozilla/Services.h"
-#include "mozilla/Unused.h"
-#include "nsIObserverService.h"
-#include "nsIServiceManager.h"
-#include "nsIWindowWatcher.h"
-#include "nsNetUtil.h"
-#include "nsPIDOMWindow.h"
-#include "nsSimpleURI.h"
-#include "nsTCPDeviceInfo.h"
-#include "nsThreadUtils.h"
-
-static mozilla::LazyLogModule gDisplayDeviceProviderLog("DisplayDeviceProvider");
-
-#define LOG(format) MOZ_LOG(gDisplayDeviceProviderLog, mozilla::LogLevel::Debug, format)
-
-#define DISPLAY_CHANGED_NOTIFICATION "display-changed"
-#define DEFAULT_CHROME_FEATURES_PREF "toolkit.defaultChromeFeatures"
-#define CHROME_REMOTE_URL_PREF "b2g.multiscreen.chrome_remote_url"
-#define PREF_PRESENTATION_DISCOVERABLE_RETRY_MS "dom.presentation.discoverable.retry_ms"
-
-namespace mozilla {
-namespace dom {
-namespace presentation {
-
-/**
- * This wrapper is used to break circular-reference problem.
- */
-class DisplayDeviceProviderWrappedListener final
- : public nsIPresentationControlServerListener
-{
-public:
- NS_DECL_ISUPPORTS
- NS_FORWARD_SAFE_NSIPRESENTATIONCONTROLSERVERLISTENER(mListener)
-
- explicit DisplayDeviceProviderWrappedListener() = default;
-
- nsresult SetListener(DisplayDeviceProvider* aListener)
- {
- mListener = aListener;
- return NS_OK;
- }
-
-private:
- virtual ~DisplayDeviceProviderWrappedListener() = default;
-
- DisplayDeviceProvider* mListener = nullptr;
-};
-
-NS_IMPL_ISUPPORTS(DisplayDeviceProviderWrappedListener,
- nsIPresentationControlServerListener)
-
-NS_IMPL_ISUPPORTS(DisplayDeviceProvider::HDMIDisplayDevice,
- nsIPresentationDevice,
- nsIPresentationLocalDevice)
-
-// nsIPresentationDevice
-NS_IMETHODIMP
-DisplayDeviceProvider::HDMIDisplayDevice::GetId(nsACString& aId)
-{
- aId = mWindowId;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DisplayDeviceProvider::HDMIDisplayDevice::GetName(nsACString& aName)
-{
- aName = mName;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DisplayDeviceProvider::HDMIDisplayDevice::GetType(nsACString& aType)
-{
- aType = mType;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DisplayDeviceProvider::HDMIDisplayDevice::GetWindowId(nsACString& aWindowId)
-{
- aWindowId = mWindowId;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DisplayDeviceProvider::HDMIDisplayDevice
- ::EstablishControlChannel(nsIPresentationControlChannel** aControlChannel)
-{
- nsresult rv = OpenTopLevelWindow();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- RefPtr<DisplayDeviceProvider> provider = mProvider.get();
- if (NS_WARN_IF(!provider)) {
- return NS_ERROR_FAILURE;
- }
- return provider->Connect(this, aControlChannel);
-}
-
-NS_IMETHODIMP
-DisplayDeviceProvider::HDMIDisplayDevice::Disconnect()
-{
- nsresult rv = CloseTopLevelWindow();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- return NS_OK;;
-}
-
-NS_IMETHODIMP
-DisplayDeviceProvider::HDMIDisplayDevice::IsRequestedUrlSupported(
- const nsAString& aRequestedUrl,
- bool* aRetVal)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (!aRetVal) {
- return NS_ERROR_INVALID_POINTER;
- }
-
- // 1-UA device only supports HTTP/HTTPS hosted receiver page.
- *aRetVal = DeviceProviderHelpers::IsCommonlySupportedScheme(aRequestedUrl);
-
- return NS_OK;
-}
-
-nsresult
-DisplayDeviceProvider::HDMIDisplayDevice::OpenTopLevelWindow()
-{
- MOZ_ASSERT(!mWindow);
-
- nsresult rv;
- nsAutoCString flags(Preferences::GetCString(DEFAULT_CHROME_FEATURES_PREF));
- if (flags.IsEmpty()) {
- return NS_ERROR_NOT_AVAILABLE;
- }
- flags.AppendLiteral(",mozDisplayId=");
- flags.AppendInt(mScreenId);
-
- nsAutoCString remoteShellURLString(Preferences::GetCString(CHROME_REMOTE_URL_PREF));
- remoteShellURLString.AppendLiteral("#");
- remoteShellURLString.Append(mWindowId);
-
- // URI validation
- nsCOMPtr<nsIURI> remoteShellURL;
- rv = NS_NewURI(getter_AddRefs(remoteShellURL), remoteShellURLString);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- rv = remoteShellURL->GetSpec(remoteShellURLString);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- nsCOMPtr<nsIWindowWatcher> ww = do_GetService(NS_WINDOWWATCHER_CONTRACTID);
- MOZ_ASSERT(ww);
-
- rv = ww->OpenWindow(nullptr,
- remoteShellURLString.get(),
- "_blank",
- flags.get(),
- nullptr,
- getter_AddRefs(mWindow));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-nsresult
-DisplayDeviceProvider::HDMIDisplayDevice::CloseTopLevelWindow()
-{
- MOZ_ASSERT(mWindow);
-
- nsCOMPtr<nsPIDOMWindowOuter> piWindow = nsPIDOMWindowOuter::From(mWindow);
- nsresult rv = piWindow->Close();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-NS_IMPL_ISUPPORTS(DisplayDeviceProvider,
- nsIObserver,
- nsIPresentationDeviceProvider,
- nsIPresentationControlServerListener)
-
-DisplayDeviceProvider::~DisplayDeviceProvider()
-{
- Uninit();
-}
-
-nsresult
-DisplayDeviceProvider::Init()
-{
- // Provider must be initialized only once.
- if (mInitialized) {
- return NS_OK;
- }
-
- nsresult rv;
-
- mServerRetryMs = Preferences::GetUint(PREF_PRESENTATION_DISCOVERABLE_RETRY_MS);
- mServerRetryTimer = do_CreateInstance(NS_TIMER_CONTRACTID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
- MOZ_ASSERT(obs);
-
- obs->AddObserver(this, DISPLAY_CHANGED_NOTIFICATION, false);
-
- mDevice = new HDMIDisplayDevice(this);
-
- mWrappedListener = new DisplayDeviceProviderWrappedListener();
- rv = mWrappedListener->SetListener(this);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mPresentationService = do_CreateInstance(PRESENTATION_CONTROL_SERVICE_CONTACT_ID,
- &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- rv = StartTCPService();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mInitialized = true;
- return NS_OK;
-}
-
-nsresult
-DisplayDeviceProvider::Uninit()
-{
- // Provider must be deleted only once.
- if (!mInitialized) {
- return NS_OK;
- }
-
- nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
- if (obs) {
- obs->RemoveObserver(this, DISPLAY_CHANGED_NOTIFICATION);
- }
-
- // Remove device from device manager when the provider is uninit
- RemoveExternalScreen();
-
- AbortServerRetry();
-
- mInitialized = false;
- mWrappedListener->SetListener(nullptr);
- return NS_OK;
-}
-
-nsresult
-DisplayDeviceProvider::StartTCPService()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- nsresult rv;
- rv = mPresentationService->SetId(NS_LITERAL_CSTRING("DisplayDeviceProvider"));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- uint16_t servicePort;
- rv = mPresentationService->GetPort(&servicePort);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- /*
- * If |servicePort| is non-zero, it means PresentationServer is running.
- * Otherwise, we should make it start serving.
- */
- if (servicePort) {
- mPort = servicePort;
- return NS_OK;
- }
-
- rv = mPresentationService->SetListener(mWrappedListener);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- AbortServerRetry();
-
- // 1-UA doesn't need encryption.
- rv = mPresentationService->StartServer(/* aEncrypted = */ false,
- /* aPort = */ 0);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-void
-DisplayDeviceProvider::AbortServerRetry()
-{
- if (mIsServerRetrying) {
- mIsServerRetrying = false;
- mServerRetryTimer->Cancel();
- }
-}
-
-nsresult
-DisplayDeviceProvider::AddExternalScreen()
-{
- MOZ_ASSERT(mDeviceListener);
-
- nsresult rv;
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- rv = GetListener(getter_AddRefs(listener));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- rv = listener->AddDevice(mDevice);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-nsresult
-DisplayDeviceProvider::RemoveExternalScreen()
-{
- MOZ_ASSERT(mDeviceListener);
-
- nsresult rv;
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- rv = GetListener(getter_AddRefs(listener));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- rv = listener->RemoveDevice(mDevice);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mDevice->Disconnect();
- return NS_OK;
-}
-
-// nsIPresentationDeviceProvider
-NS_IMETHODIMP
-DisplayDeviceProvider::GetListener(nsIPresentationDeviceListener** aListener)
-{
- if (NS_WARN_IF(!aListener)) {
- return NS_ERROR_INVALID_POINTER;
- }
-
- nsresult rv;
- nsCOMPtr<nsIPresentationDeviceListener> listener =
- do_QueryReferent(mDeviceListener, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- listener.forget(aListener);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DisplayDeviceProvider::SetListener(nsIPresentationDeviceListener* aListener)
-{
- mDeviceListener = do_GetWeakReference(aListener);
- nsresult rv = mDeviceListener ? Init() : Uninit();
- if(NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DisplayDeviceProvider::ForceDiscovery()
-{
- return NS_OK;
-}
-
-// nsIPresentationControlServerListener
-NS_IMETHODIMP
-DisplayDeviceProvider::OnServerReady(uint16_t aPort,
- const nsACString& aCertFingerprint)
-{
- MOZ_ASSERT(NS_IsMainThread());
- mPort = aPort;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DisplayDeviceProvider::OnServerStopped(nsresult aResult)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- // Try restart server if it is stopped abnormally.
- if (NS_FAILED(aResult)) {
- mIsServerRetrying = true;
- mServerRetryTimer->Init(this, mServerRetryMs, nsITimer::TYPE_ONE_SHOT);
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DisplayDeviceProvider::OnSessionRequest(nsITCPDeviceInfo* aDeviceInfo,
- const nsAString& aUrl,
- const nsAString& aPresentationId,
- nsIPresentationControlChannel* aControlChannel)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(aDeviceInfo);
- MOZ_ASSERT(aControlChannel);
-
- nsresult rv;
-
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- rv = GetListener(getter_AddRefs(listener));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- MOZ_ASSERT(!listener);
-
- rv = listener->OnSessionRequest(mDevice,
- aUrl,
- aPresentationId,
- aControlChannel);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DisplayDeviceProvider::OnTerminateRequest(nsITCPDeviceInfo* aDeviceInfo,
- const nsAString& aPresentationId,
- nsIPresentationControlChannel* aControlChannel,
- bool aIsFromReceiver)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(aDeviceInfo);
- MOZ_ASSERT(aControlChannel);
-
- nsresult rv;
-
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- rv = GetListener(getter_AddRefs(listener));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- MOZ_ASSERT(!listener);
-
- rv = listener->OnTerminateRequest(mDevice,
- aPresentationId,
- aControlChannel,
- aIsFromReceiver);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-DisplayDeviceProvider::OnReconnectRequest(nsITCPDeviceInfo* aDeviceInfo,
- const nsAString& aUrl,
- const nsAString& aPresentationId,
- nsIPresentationControlChannel* aControlChannel)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(aDeviceInfo);
- MOZ_ASSERT(aControlChannel);
-
- nsresult rv;
-
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- rv = GetListener(getter_AddRefs(listener));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- MOZ_ASSERT(!listener);
-
- rv = listener->OnReconnectRequest(mDevice,
- aUrl,
- aPresentationId,
- aControlChannel);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-// nsIObserver
-NS_IMETHODIMP
-DisplayDeviceProvider::Observe(nsISupports* aSubject,
- const char* aTopic,
- const char16_t* aData)
-{
- if (!strcmp(aTopic, DISPLAY_CHANGED_NOTIFICATION)) {
- nsCOMPtr<nsIDisplayInfo> displayInfo = do_QueryInterface(aSubject);
- MOZ_ASSERT(displayInfo);
-
- int32_t type;
- bool isConnected;
- displayInfo->GetConnected(&isConnected);
- // XXX The ID is as same as the type of display.
- // See Bug 1138287 and nsScreenManagerGonk::AddScreen() for more detail.
- displayInfo->GetId(&type);
-
- if (type == DisplayType::DISPLAY_EXTERNAL) {
- nsresult rv = isConnected ? AddExternalScreen() : RemoveExternalScreen();
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- }
- } else if (!strcmp(aTopic, NS_TIMER_CALLBACK_TOPIC)) {
- nsCOMPtr<nsITimer> timer = do_QueryInterface(aSubject);
- if (!timer) {
- return NS_ERROR_UNEXPECTED;
- }
-
- if (timer == mServerRetryTimer) {
- mIsServerRetrying = false;
- StartTCPService();
- }
- }
-
- return NS_OK;
-}
-
-nsresult
-DisplayDeviceProvider::Connect(HDMIDisplayDevice* aDevice,
- nsIPresentationControlChannel** aControlChannel)
-{
- MOZ_ASSERT(aDevice);
- MOZ_ASSERT(mPresentationService);
- NS_ENSURE_ARG_POINTER(aControlChannel);
- *aControlChannel = nullptr;
-
- nsCOMPtr<nsITCPDeviceInfo> deviceInfo = new TCPDeviceInfo(aDevice->Id(),
- aDevice->Address(),
- mPort,
- EmptyCString());
-
- return mPresentationService->Connect(deviceInfo, aControlChannel);
-}
-
-} // namespace presentation
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/provider/DisplayDeviceProvider.h b/dom/presentation/provider/DisplayDeviceProvider.h
deleted file mode 100644
index ebd5db394..000000000
--- a/dom/presentation/provider/DisplayDeviceProvider.h
+++ /dev/null
@@ -1,136 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_presentation_provider_DisplayDeviceProvider_h
-#define mozilla_dom_presentation_provider_DisplayDeviceProvider_h
-
-#include "mozilla/RefPtr.h"
-#include "mozilla/WeakPtr.h"
-#include "nsCOMPtr.h"
-#include "nsIDOMWindow.h"
-#include "nsIDisplayInfo.h"
-#include "nsIObserver.h"
-#include "nsIPresentationDeviceProvider.h"
-#include "nsIPresentationLocalDevice.h"
-#include "nsIPresentationControlService.h"
-#include "nsITimer.h"
-#include "nsIWindowWatcher.h"
-#include "nsString.h"
-#include "nsTArray.h"
-#include "nsWeakReference.h"
-
-namespace mozilla {
-namespace dom {
-namespace presentation {
-
-// Consistent definition with the definition in
-// widget/gonk/libdisplay/GonkDisplay.h.
-enum DisplayType {
- DISPLAY_PRIMARY,
- DISPLAY_EXTERNAL,
- DISPLAY_VIRTUAL,
- NUM_DISPLAY_TYPES
-};
-
-class DisplayDeviceProviderWrappedListener;
-
-class DisplayDeviceProvider final : public nsIObserver
- , public nsIPresentationDeviceProvider
- , public nsIPresentationControlServerListener
- , public SupportsWeakPtr<DisplayDeviceProvider>
-{
-private:
- class HDMIDisplayDevice final : public nsIPresentationLocalDevice
- {
- public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONDEVICE
- NS_DECL_NSIPRESENTATIONLOCALDEVICE
-
- // mScreenId is as same as the definition of display type.
- explicit HDMIDisplayDevice(DisplayDeviceProvider* aProvider)
- : mScreenId(DisplayType::DISPLAY_EXTERNAL)
- , mName("HDMI")
- , mType("external")
- , mWindowId("hdmi")
- , mAddress("127.0.0.1")
- , mProvider(aProvider)
- {}
-
- nsresult OpenTopLevelWindow();
- nsresult CloseTopLevelWindow();
-
- const nsCString& Id() const { return mWindowId; }
- const nsCString& Address() const { return mAddress; }
-
- private:
- virtual ~HDMIDisplayDevice() = default;
-
- // Due to the limitation of nsWinodw, mScreenId must be an integer.
- // And mScreenId is also align to the display type defined in
- // widget/gonk/libdisplay/GonkDisplay.h.
- // HDMI display is DisplayType::DISPLAY_EXTERNAL.
- uint32_t mScreenId;
- nsCString mName;
- nsCString mType;
- nsCString mWindowId;
- nsCString mAddress;
-
- nsCOMPtr<mozIDOMWindowProxy> mWindow;
- // weak pointer
- // Provider hold a strong pointer to the device. Use weak pointer to prevent
- // the reference cycle.
- WeakPtr<DisplayDeviceProvider> mProvider;
- };
-
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIOBSERVER
- NS_DECL_NSIPRESENTATIONDEVICEPROVIDER
- NS_DECL_NSIPRESENTATIONCONTROLSERVERLISTENER
- // For using WeakPtr when MOZ_REFCOUNTED_LEAK_CHECKING defined
- MOZ_DECLARE_WEAKREFERENCE_TYPENAME(DisplayDeviceProvider)
-
- nsresult Connect(HDMIDisplayDevice* aDevice,
- nsIPresentationControlChannel** aControlChannel);
-private:
- virtual ~DisplayDeviceProvider();
-
- nsresult Init();
- nsresult Uninit();
-
- nsresult AddExternalScreen();
- nsresult RemoveExternalScreen();
-
- nsresult StartTCPService();
-
- void AbortServerRetry();
-
- // Now support HDMI display only and there should be only one HDMI display.
- nsCOMPtr<nsIPresentationLocalDevice> mDevice = nullptr;
- // weak pointer
- // PresentationDeviceManager (mDeviceListener) hold strong pointer to
- // DisplayDeviceProvider. Use nsWeakPtr to avoid reference cycle.
- nsWeakPtr mDeviceListener = nullptr;
- nsCOMPtr<nsIPresentationControlService> mPresentationService;
- // Used to prevent reference cycle between DisplayDeviceProvider and
- // TCPPresentationServer.
- RefPtr<DisplayDeviceProviderWrappedListener> mWrappedListener;
-
- bool mInitialized = false;
- uint16_t mPort;
-
- bool mIsServerRetrying = false;
- uint32_t mServerRetryMs;
- nsCOMPtr<nsITimer> mServerRetryTimer;
-};
-
-} // mozilla
-} // dom
-} // presentation
-
-#endif // mozilla_dom_presentation_provider_DisplayDeviceProvider_h
-
diff --git a/dom/presentation/provider/LegacyMDNSDeviceProvider.cpp b/dom/presentation/provider/LegacyMDNSDeviceProvider.cpp
deleted file mode 100644
index 54849c9e3..000000000
--- a/dom/presentation/provider/LegacyMDNSDeviceProvider.cpp
+++ /dev/null
@@ -1,774 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "LegacyMDNSDeviceProvider.h"
-
-#include "DeviceProviderHelpers.h"
-#include "MainThreadUtils.h"
-#include "mozilla/Logging.h"
-#include "mozilla/Preferences.h"
-#include "mozilla/Services.h"
-#include "mozilla/Unused.h"
-#include "nsComponentManagerUtils.h"
-#include "nsIObserverService.h"
-#include "nsIWritablePropertyBag2.h"
-#include "nsServiceManagerUtils.h"
-#include "nsTCPDeviceInfo.h"
-#include "nsThreadUtils.h"
-#include "nsIPropertyBag2.h"
-
-#define PREF_PRESENTATION_DISCOVERY_LEGACY "dom.presentation.discovery.legacy.enabled"
-#define PREF_PRESENTATION_DISCOVERY_TIMEOUT_MS "dom.presentation.discovery.timeout_ms"
-#define PREF_PRESENTATION_DEVICE_NAME "dom.presentation.device.name"
-
-#define LEGACY_SERVICE_TYPE "_mozilla_papi._tcp"
-
-#define LEGACY_PRESENTATION_CONTROL_SERVICE_CONTACT_ID "@mozilla.org/presentation/legacy-control-service;1"
-
-static mozilla::LazyLogModule sLegacyMDNSProviderLogModule("LegacyMDNSDeviceProvider");
-
-#undef LOG_I
-#define LOG_I(...) MOZ_LOG(sLegacyMDNSProviderLogModule, mozilla::LogLevel::Debug, (__VA_ARGS__))
-#undef LOG_E
-#define LOG_E(...) MOZ_LOG(sLegacyMDNSProviderLogModule, mozilla::LogLevel::Error, (__VA_ARGS__))
-
-namespace mozilla {
-namespace dom {
-namespace presentation {
-namespace legacy {
-
-static const char* kObservedPrefs[] = {
- PREF_PRESENTATION_DISCOVERY_LEGACY,
- PREF_PRESENTATION_DISCOVERY_TIMEOUT_MS,
- PREF_PRESENTATION_DEVICE_NAME,
- nullptr
-};
-
-namespace {
-
-static void
-GetAndroidDeviceName(nsACString& aRetVal)
-{
- nsCOMPtr<nsIPropertyBag2> infoService = do_GetService("@mozilla.org/system-info;1");
- MOZ_ASSERT(infoService, "Could not find a system info service");
-
- Unused << NS_WARN_IF(NS_FAILED(infoService->GetPropertyAsACString(
- NS_LITERAL_STRING("device"), aRetVal)));
-}
-
-} //anonymous namespace
-
-/**
- * This wrapper is used to break circular-reference problem.
- */
-class DNSServiceWrappedListener final
- : public nsIDNSServiceDiscoveryListener
- , public nsIDNSServiceResolveListener
-{
-public:
- NS_DECL_ISUPPORTS
- NS_FORWARD_SAFE_NSIDNSSERVICEDISCOVERYLISTENER(mListener)
- NS_FORWARD_SAFE_NSIDNSSERVICERESOLVELISTENER(mListener)
-
- explicit DNSServiceWrappedListener() = default;
-
- nsresult SetListener(LegacyMDNSDeviceProvider* aListener)
- {
- mListener = aListener;
- return NS_OK;
- }
-
-private:
- virtual ~DNSServiceWrappedListener() = default;
-
- LegacyMDNSDeviceProvider* mListener = nullptr;
-};
-
-NS_IMPL_ISUPPORTS(DNSServiceWrappedListener,
- nsIDNSServiceDiscoveryListener,
- nsIDNSServiceResolveListener)
-
-NS_IMPL_ISUPPORTS(LegacyMDNSDeviceProvider,
- nsIPresentationDeviceProvider,
- nsIDNSServiceDiscoveryListener,
- nsIDNSServiceResolveListener,
- nsIObserver)
-
-LegacyMDNSDeviceProvider::~LegacyMDNSDeviceProvider()
-{
- Uninit();
-}
-
-nsresult
-LegacyMDNSDeviceProvider::Init()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (mInitialized) {
- return NS_OK;
- }
-
- nsresult rv;
-
- mMulticastDNS = do_GetService(DNSSERVICEDISCOVERY_CONTRACT_ID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mWrappedListener = new DNSServiceWrappedListener();
- if (NS_WARN_IF(NS_FAILED(rv = mWrappedListener->SetListener(this)))) {
- return rv;
- }
-
- mPresentationService = do_CreateInstance(LEGACY_PRESENTATION_CONTROL_SERVICE_CONTACT_ID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mDiscoveryTimer = do_CreateInstance(NS_TIMER_CONTRACTID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- Preferences::AddStrongObservers(this, kObservedPrefs);
-
- mDiscoveryEnabled = Preferences::GetBool(PREF_PRESENTATION_DISCOVERY_LEGACY);
- mDiscoveryTimeoutMs = Preferences::GetUint(PREF_PRESENTATION_DISCOVERY_TIMEOUT_MS);
- mServiceName = Preferences::GetCString(PREF_PRESENTATION_DEVICE_NAME);
-
- // FIXME: Bug 1185806 - Provide a common device name setting.
- if (mServiceName.IsEmpty()) {
- GetAndroidDeviceName(mServiceName);
- Unused << Preferences::SetCString(PREF_PRESENTATION_DEVICE_NAME, mServiceName);
- }
-
- Unused << mPresentationService->SetId(mServiceName);
-
- if (mDiscoveryEnabled && NS_WARN_IF(NS_FAILED(rv = ForceDiscovery()))) {
- return rv;
- }
-
- mInitialized = true;
- return NS_OK;
-}
-
-nsresult
-LegacyMDNSDeviceProvider::Uninit()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (!mInitialized) {
- return NS_OK;
- }
-
- ClearDevices();
-
- Preferences::RemoveObservers(this, kObservedPrefs);
-
- StopDiscovery(NS_OK);
-
- mMulticastDNS = nullptr;
-
- if (mWrappedListener) {
- mWrappedListener->SetListener(nullptr);
- mWrappedListener = nullptr;
- }
-
- mInitialized = false;
- return NS_OK;
-}
-
-nsresult
-LegacyMDNSDeviceProvider::StopDiscovery(nsresult aReason)
-{
- LOG_I("StopDiscovery (0x%08x)", aReason);
-
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mDiscoveryTimer);
-
- Unused << mDiscoveryTimer->Cancel();
-
- if (mDiscoveryRequest) {
- mDiscoveryRequest->Cancel(aReason);
- mDiscoveryRequest = nullptr;
- }
-
- return NS_OK;
-}
-
-nsresult
-LegacyMDNSDeviceProvider::Connect(Device* aDevice,
- nsIPresentationControlChannel** aRetVal)
-{
- MOZ_ASSERT(aDevice);
- MOZ_ASSERT(mPresentationService);
-
- RefPtr<TCPDeviceInfo> deviceInfo = new TCPDeviceInfo(aDevice->Id(),
- aDevice->Address(),
- aDevice->Port(),
- EmptyCString());
-
- return mPresentationService->Connect(deviceInfo, aRetVal);
-}
-
-nsresult
-LegacyMDNSDeviceProvider::AddDevice(const nsACString& aId,
- const nsACString& aServiceName,
- const nsACString& aServiceType,
- const nsACString& aAddress,
- const uint16_t aPort)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mPresentationService);
-
- RefPtr<Device> device = new Device(aId, /* ID */
- aServiceName,
- aServiceType,
- aAddress,
- aPort,
- DeviceState::eActive,
- this);
-
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- if (NS_SUCCEEDED(GetListener(getter_AddRefs(listener))) && listener) {
- Unused << listener->AddDevice(device);
- }
-
- mDevices.AppendElement(device);
-
- return NS_OK;
-}
-
-nsresult
-LegacyMDNSDeviceProvider::UpdateDevice(const uint32_t aIndex,
- const nsACString& aServiceName,
- const nsACString& aServiceType,
- const nsACString& aAddress,
- const uint16_t aPort)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mPresentationService);
-
- if (NS_WARN_IF(aIndex >= mDevices.Length())) {
- return NS_ERROR_INVALID_ARG;
- }
-
- RefPtr<Device> device = mDevices[aIndex];
- device->Update(aServiceName, aServiceType, aAddress, aPort);
- device->ChangeState(DeviceState::eActive);
-
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- if (NS_SUCCEEDED(GetListener(getter_AddRefs(listener))) && listener) {
- Unused << listener->UpdateDevice(device);
- }
-
- return NS_OK;
-}
-
-nsresult
-LegacyMDNSDeviceProvider::RemoveDevice(const uint32_t aIndex)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mPresentationService);
-
- if (NS_WARN_IF(aIndex >= mDevices.Length())) {
- return NS_ERROR_INVALID_ARG;
- }
-
- RefPtr<Device> device = mDevices[aIndex];
-
- LOG_I("RemoveDevice: %s", device->Id().get());
- mDevices.RemoveElementAt(aIndex);
-
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- if (NS_SUCCEEDED(GetListener(getter_AddRefs(listener))) && listener) {
- Unused << listener->RemoveDevice(device);
- }
-
- return NS_OK;
-}
-
-bool
-LegacyMDNSDeviceProvider::FindDeviceById(const nsACString& aId,
- uint32_t& aIndex)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- RefPtr<Device> device = new Device(aId,
- /* aName = */ EmptyCString(),
- /* aType = */ EmptyCString(),
- /* aHost = */ EmptyCString(),
- /* aPort = */ 0,
- /* aState = */ DeviceState::eUnknown,
- /* aProvider = */ nullptr);
- size_t index = mDevices.IndexOf(device, 0, DeviceIdComparator());
-
- if (index == mDevices.NoIndex) {
- return false;
- }
-
- aIndex = index;
- return true;
-}
-
-bool
-LegacyMDNSDeviceProvider::FindDeviceByAddress(const nsACString& aAddress,
- uint32_t& aIndex)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- RefPtr<Device> device = new Device(/* aId = */ EmptyCString(),
- /* aName = */ EmptyCString(),
- /* aType = */ EmptyCString(),
- aAddress,
- /* aPort = */ 0,
- /* aState = */ DeviceState::eUnknown,
- /* aProvider = */ nullptr);
- size_t index = mDevices.IndexOf(device, 0, DeviceAddressComparator());
-
- if (index == mDevices.NoIndex) {
- return false;
- }
-
- aIndex = index;
- return true;
-}
-
-void
-LegacyMDNSDeviceProvider::MarkAllDevicesUnknown()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- for (auto& device : mDevices) {
- device->ChangeState(DeviceState::eUnknown);
- }
-}
-
-void
-LegacyMDNSDeviceProvider::ClearUnknownDevices()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- size_t i = mDevices.Length();
- while (i > 0) {
- --i;
- if (mDevices[i]->State() == DeviceState::eUnknown) {
- Unused << NS_WARN_IF(NS_FAILED(RemoveDevice(i)));
- }
- }
-}
-
-void
-LegacyMDNSDeviceProvider::ClearDevices()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- size_t i = mDevices.Length();
- while (i > 0) {
- --i;
- Unused << NS_WARN_IF(NS_FAILED(RemoveDevice(i)));
- }
-}
-
-// nsIPresentationDeviceProvider
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::GetListener(nsIPresentationDeviceListener** aListener)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!aListener)) {
- return NS_ERROR_INVALID_POINTER;
- }
-
- nsresult rv;
- nsCOMPtr<nsIPresentationDeviceListener> listener =
- do_QueryReferent(mDeviceListener, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- listener.forget(aListener);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::SetListener(nsIPresentationDeviceListener* aListener)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- mDeviceListener = do_GetWeakReference(aListener);
-
- nsresult rv;
- if (mDeviceListener) {
- if (NS_WARN_IF(NS_FAILED(rv = Init()))) {
- return rv;
- }
- } else {
- if (NS_WARN_IF(NS_FAILED(rv = Uninit()))) {
- return rv;
- }
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::ForceDiscovery()
-{
- LOG_I("ForceDiscovery (%d)", mDiscoveryEnabled);
- MOZ_ASSERT(NS_IsMainThread());
-
- if (!mDiscoveryEnabled) {
- return NS_OK;
- }
-
- MOZ_ASSERT(mDiscoveryTimer);
- MOZ_ASSERT(mMulticastDNS);
-
- // if it's already discovering, extend existing discovery timeout.
- nsresult rv;
- if (mIsDiscovering) {
- Unused << mDiscoveryTimer->Cancel();
-
- if (NS_WARN_IF(NS_FAILED( rv = mDiscoveryTimer->Init(this,
- mDiscoveryTimeoutMs,
- nsITimer::TYPE_ONE_SHOT)))) {
- return rv;
- }
- return NS_OK;
- }
-
- StopDiscovery(NS_OK);
-
- if (NS_WARN_IF(NS_FAILED(rv = mMulticastDNS->StartDiscovery(
- NS_LITERAL_CSTRING(LEGACY_SERVICE_TYPE),
- mWrappedListener,
- getter_AddRefs(mDiscoveryRequest))))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-// nsIDNSServiceDiscoveryListener
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::OnDiscoveryStarted(const nsACString& aServiceType)
-{
- LOG_I("OnDiscoveryStarted");
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mDiscoveryTimer);
-
- MarkAllDevicesUnknown();
-
- nsresult rv;
- if (NS_WARN_IF(NS_FAILED(rv = mDiscoveryTimer->Init(this,
- mDiscoveryTimeoutMs,
- nsITimer::TYPE_ONE_SHOT)))) {
- return rv;
- }
-
- mIsDiscovering = true;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::OnDiscoveryStopped(const nsACString& aServiceType)
-{
- LOG_I("OnDiscoveryStopped");
- MOZ_ASSERT(NS_IsMainThread());
-
- ClearUnknownDevices();
-
- mIsDiscovering = false;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::OnServiceFound(nsIDNSServiceInfo* aServiceInfo)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!aServiceInfo)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- nsresult rv ;
-
- nsAutoCString serviceName;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetServiceName(serviceName)))) {
- return rv;
- }
-
- LOG_I("OnServiceFound: %s", serviceName.get());
-
- if (mMulticastDNS) {
- if (NS_WARN_IF(NS_FAILED(rv = mMulticastDNS->ResolveService(
- aServiceInfo, mWrappedListener)))) {
- return rv;
- }
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::OnServiceLost(nsIDNSServiceInfo* aServiceInfo)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!aServiceInfo)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- nsresult rv;
-
- nsAutoCString serviceName;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetServiceName(serviceName)))) {
- return rv;
- }
-
- LOG_I("OnServiceLost: %s", serviceName.get());
-
- nsAutoCString host;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetHost(host)))) {
- return rv;
- }
-
- uint32_t index;
- if (!FindDeviceById(host, index)) {
- // given device was not found
- return NS_OK;
- }
-
- if (NS_WARN_IF(NS_FAILED(rv = RemoveDevice(index)))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::OnStartDiscoveryFailed(const nsACString& aServiceType,
- int32_t aErrorCode)
-{
- LOG_E("OnStartDiscoveryFailed: %d", aErrorCode);
- MOZ_ASSERT(NS_IsMainThread());
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::OnStopDiscoveryFailed(const nsACString& aServiceType,
- int32_t aErrorCode)
-{
- LOG_E("OnStopDiscoveryFailed: %d", aErrorCode);
- MOZ_ASSERT(NS_IsMainThread());
-
- return NS_OK;
-}
-
-// nsIDNSServiceResolveListener
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::OnServiceResolved(nsIDNSServiceInfo* aServiceInfo)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!aServiceInfo)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- nsresult rv;
-
- nsAutoCString serviceName;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetServiceName(serviceName)))) {
- return rv;
- }
-
- LOG_I("OnServiceResolved: %s", serviceName.get());
-
- nsAutoCString host;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetHost(host)))) {
- return rv;
- }
-
- nsAutoCString address;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetAddress(address)))) {
- return rv;
- }
-
- uint16_t port;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetPort(&port)))) {
- return rv;
- }
-
- nsAutoCString serviceType;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetServiceType(serviceType)))) {
- return rv;
- }
-
- uint32_t index;
- if (FindDeviceById(host, index)) {
- return UpdateDevice(index,
- serviceName,
- serviceType,
- address,
- port);
- } else {
- return AddDevice(host,
- serviceName,
- serviceType,
- address,
- port);
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::OnResolveFailed(nsIDNSServiceInfo* aServiceInfo,
- int32_t aErrorCode)
-{
- LOG_E("OnResolveFailed: %d", aErrorCode);
- MOZ_ASSERT(NS_IsMainThread());
-
- return NS_OK;
-}
-
-// nsIObserver
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::Observe(nsISupports* aSubject,
- const char* aTopic,
- const char16_t* aData)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- NS_ConvertUTF16toUTF8 data(aData);
- LOG_I("Observe: topic = %s, data = %s", aTopic, data.get());
-
- if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
- if (data.EqualsLiteral(PREF_PRESENTATION_DISCOVERY_LEGACY)) {
- OnDiscoveryChanged(Preferences::GetBool(PREF_PRESENTATION_DISCOVERY_LEGACY));
- } else if (data.EqualsLiteral(PREF_PRESENTATION_DISCOVERY_TIMEOUT_MS)) {
- OnDiscoveryTimeoutChanged(Preferences::GetUint(PREF_PRESENTATION_DISCOVERY_TIMEOUT_MS));
- } else if (data.EqualsLiteral(PREF_PRESENTATION_DEVICE_NAME)) {
- nsAdoptingCString newServiceName = Preferences::GetCString(PREF_PRESENTATION_DEVICE_NAME);
- if (!mServiceName.Equals(newServiceName)) {
- OnServiceNameChanged(newServiceName);
- }
- }
- } else if (!strcmp(aTopic, NS_TIMER_CALLBACK_TOPIC)) {
- StopDiscovery(NS_OK);
- }
-
- return NS_OK;
-}
-
-nsresult
-LegacyMDNSDeviceProvider::OnDiscoveryChanged(bool aEnabled)
-{
- LOG_I("DiscoveryEnabled = %d\n", aEnabled);
- MOZ_ASSERT(NS_IsMainThread());
-
- mDiscoveryEnabled = aEnabled;
-
- if (mDiscoveryEnabled) {
- return ForceDiscovery();
- }
-
- return StopDiscovery(NS_OK);
-}
-
-nsresult
-LegacyMDNSDeviceProvider::OnDiscoveryTimeoutChanged(uint32_t aTimeoutMs)
-{
- LOG_I("OnDiscoveryTimeoutChanged = %d\n", aTimeoutMs);
- MOZ_ASSERT(NS_IsMainThread());
-
- mDiscoveryTimeoutMs = aTimeoutMs;
-
- return NS_OK;
-}
-
-nsresult
-LegacyMDNSDeviceProvider::OnServiceNameChanged(const nsACString& aServiceName)
-{
- LOG_I("serviceName = %s\n", PromiseFlatCString(aServiceName).get());
- MOZ_ASSERT(NS_IsMainThread());
-
- mServiceName = aServiceName;
- mPresentationService->SetId(mServiceName);
-
- return NS_OK;
-}
-
-// LegacyMDNSDeviceProvider::Device
-NS_IMPL_ISUPPORTS(LegacyMDNSDeviceProvider::Device,
- nsIPresentationDevice)
-
-// nsIPresentationDevice
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::Device::GetId(nsACString& aId)
-{
- aId = mId;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::Device::GetName(nsACString& aName)
-{
- aName = mName;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::Device::GetType(nsACString& aType)
-{
- aType = mType;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::Device::EstablishControlChannel(
- nsIPresentationControlChannel** aRetVal)
-{
- if (!mProvider) {
- return NS_ERROR_FAILURE;
- }
-
- return mProvider->Connect(this, aRetVal);
-}
-
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::Device::Disconnect()
-{
- // No need to do anything when disconnect.
- return NS_OK;
-}
-
-NS_IMETHODIMP
-LegacyMDNSDeviceProvider::Device::IsRequestedUrlSupported(
- const nsAString& aRequestedUrl,
- bool* aRetVal)
-{
- if (!aRetVal) {
- return NS_ERROR_INVALID_POINTER;
- }
-
- // Legacy TV 2.5 device only support a fixed set of presentation Apps.
- *aRetVal = DeviceProviderHelpers::IsFxTVSupportedAppUrl(aRequestedUrl);
-
- return NS_OK;
-}
-
-} // namespace legacy
-} // namespace presentation
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/provider/LegacyMDNSDeviceProvider.h b/dom/presentation/provider/LegacyMDNSDeviceProvider.h
deleted file mode 100644
index 33ba877d3..000000000
--- a/dom/presentation/provider/LegacyMDNSDeviceProvider.h
+++ /dev/null
@@ -1,191 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_presentation_provider_LegacyMDNSDeviceProvider_h
-#define mozilla_dom_presentation_provider_LegacyMDNSDeviceProvider_h
-
-#include "mozilla/RefPtr.h"
-#include "nsCOMPtr.h"
-#include "nsICancelable.h"
-#include "nsIDNSServiceDiscovery.h"
-#include "nsIObserver.h"
-#include "nsIPresentationDevice.h"
-#include "nsIPresentationDeviceProvider.h"
-#include "nsIPresentationControlService.h"
-#include "nsITimer.h"
-#include "nsString.h"
-#include "nsTArray.h"
-#include "nsWeakPtr.h"
-
-namespace mozilla {
-namespace dom {
-namespace presentation {
-namespace legacy {
-
-class DNSServiceWrappedListener;
-class MulticastDNSService;
-
-class LegacyMDNSDeviceProvider final
- : public nsIPresentationDeviceProvider
- , public nsIDNSServiceDiscoveryListener
- , public nsIDNSServiceResolveListener
- , public nsIObserver
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONDEVICEPROVIDER
- NS_DECL_NSIDNSSERVICEDISCOVERYLISTENER
- NS_DECL_NSIDNSSERVICERESOLVELISTENER
- NS_DECL_NSIOBSERVER
-
- explicit LegacyMDNSDeviceProvider() = default;
- nsresult Init();
- nsresult Uninit();
-
-private:
- enum class DeviceState : uint32_t {
- eUnknown,
- eActive
- };
-
- class Device final : public nsIPresentationDevice
- {
- public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONDEVICE
-
- explicit Device(const nsACString& aId,
- const nsACString& aName,
- const nsACString& aType,
- const nsACString& aAddress,
- const uint16_t aPort,
- DeviceState aState,
- LegacyMDNSDeviceProvider* aProvider)
- : mId(aId)
- , mName(aName)
- , mType(aType)
- , mAddress(aAddress)
- , mPort(aPort)
- , mState(aState)
- , mProvider(aProvider)
- {
- }
-
- const nsCString& Id() const
- {
- return mId;
- }
-
- const nsCString& Address() const
- {
- return mAddress;
- }
-
- uint16_t Port() const
- {
- return mPort;
- }
-
- DeviceState State() const
- {
- return mState;
- }
-
- void ChangeState(DeviceState aState)
- {
- mState = aState;
- }
-
- void Update(const nsACString& aName,
- const nsACString& aType,
- const nsACString& aAddress,
- const uint16_t aPort)
- {
- mName = aName;
- mType = aType;
- mAddress = aAddress;
- mPort = aPort;
- }
-
- private:
- virtual ~Device() = default;
-
- nsCString mId;
- nsCString mName;
- nsCString mType;
- nsCString mAddress;
- uint16_t mPort;
- DeviceState mState;
- LegacyMDNSDeviceProvider* mProvider;
- };
-
- struct DeviceIdComparator {
- bool Equals(const RefPtr<Device>& aA, const RefPtr<Device>& aB) const {
- return aA->Id() == aB->Id();
- }
- };
-
- struct DeviceAddressComparator {
- bool Equals(const RefPtr<Device>& aA, const RefPtr<Device>& aB) const {
- return aA->Address() == aB->Address();
- }
- };
-
- virtual ~LegacyMDNSDeviceProvider();
- nsresult StopDiscovery(nsresult aReason);
- nsresult Connect(Device* aDevice,
- nsIPresentationControlChannel** aRetVal);
-
- // device manipulation
- nsresult AddDevice(const nsACString& aId,
- const nsACString& aServiceName,
- const nsACString& aServiceType,
- const nsACString& aAddress,
- const uint16_t aPort);
- nsresult UpdateDevice(const uint32_t aIndex,
- const nsACString& aServiceName,
- const nsACString& aServiceType,
- const nsACString& aAddress,
- const uint16_t aPort);
- nsresult RemoveDevice(const uint32_t aIndex);
- bool FindDeviceById(const nsACString& aId,
- uint32_t& aIndex);
-
- bool FindDeviceByAddress(const nsACString& aAddress,
- uint32_t& aIndex);
-
- void MarkAllDevicesUnknown();
- void ClearUnknownDevices();
- void ClearDevices();
-
- // preferences
- nsresult OnDiscoveryChanged(bool aEnabled);
- nsresult OnDiscoveryTimeoutChanged(uint32_t aTimeoutMs);
- nsresult OnServiceNameChanged(const nsACString& aServiceName);
-
- bool mInitialized = false;
- nsWeakPtr mDeviceListener;
- nsCOMPtr<nsIPresentationControlService> mPresentationService;
- nsCOMPtr<nsIDNSServiceDiscovery> mMulticastDNS;
- RefPtr<DNSServiceWrappedListener> mWrappedListener;
-
- nsCOMPtr<nsICancelable> mDiscoveryRequest;
-
- nsTArray<RefPtr<Device>> mDevices;
-
- bool mDiscoveryEnabled = false;
- bool mIsDiscovering = false;
- uint32_t mDiscoveryTimeoutMs;
- nsCOMPtr<nsITimer> mDiscoveryTimer;
-
- nsCString mServiceName;
-};
-
-} // namespace legacy
-} // namespace presentation
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_presentation_provider_LegacyMDNSDeviceProvider_h
diff --git a/dom/presentation/provider/LegacyPresentationControlService.js b/dom/presentation/provider/LegacyPresentationControlService.js
deleted file mode 100644
index b27177b63..000000000
--- a/dom/presentation/provider/LegacyPresentationControlService.js
+++ /dev/null
@@ -1,488 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-/* jshint esnext:true, globalstrict:true, moz:true, undef:true, unused:true */
-/* globals Components, dump */
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-/* globals XPCOMUtils */
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-/* globals Services */
-Cu.import("resource://gre/modules/Services.jsm");
-/* globals NetUtil */
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-const DEBUG = Services.prefs.getBoolPref("dom.presentation.tcp_server.debug");
-function log(aMsg) {
- dump("-*- LegacyPresentationControlService.js: " + aMsg + "\n");
-}
-
-function LegacyPresentationControlService() {
- DEBUG && log("LegacyPresentationControlService - ctor"); //jshint ignore:line
- this._id = null;
-}
-
-LegacyPresentationControlService.prototype = {
- startServer: function() {
- DEBUG && log("LegacyPresentationControlService - doesn't support receiver mode"); //jshint ignore:line
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
-
- get id() {
- return this._id;
- },
-
- set id(aId) {
- this._id = aId;
- },
-
- get port() {
- return 0;
- },
-
- get version() {
- return 0;
- },
-
- set listener(aListener) { //jshint ignore:line
- DEBUG && log("LegacyPresentationControlService - doesn't support receiver mode"); //jshint ignore:line
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
-
- get listener() {
- return null;
- },
-
- connect: function(aDeviceInfo) {
- if (!this.id) {
- DEBUG && log("LegacyPresentationControlService - Id has not initialized; requestSession fails"); //jshint ignore:line
- return null;
- }
- DEBUG && log("LegacyPresentationControlService - requestSession to " + aDeviceInfo.id); //jshint ignore:line
-
- let sts = Cc["@mozilla.org/network/socket-transport-service;1"]
- .getService(Ci.nsISocketTransportService);
-
- let socketTransport;
- try {
- socketTransport = sts.createTransport(null,
- 0,
- aDeviceInfo.address,
- aDeviceInfo.port,
- null);
- } catch (e) {
- DEBUG && log("LegacyPresentationControlService - createTransport throws: " + e); //jshint ignore:line
- // Pop the exception to |TCPDevice.establishControlChannel|
- throw Cr.NS_ERROR_FAILURE;
- }
- return new LegacyTCPControlChannel(this.id,
- socketTransport,
- aDeviceInfo);
- },
-
- close: function() {
- DEBUG && log("LegacyPresentationControlService - close"); //jshint ignore:line
- },
-
- classID: Components.ID("{b21816fe-8aff-4811-86d2-85a7444c557e}"),
- QueryInterface : XPCOMUtils.generateQI([Ci.nsIPresentationControlService]),
-};
-
-function ChannelDescription(aInit) {
- this._type = aInit.type;
- switch (this._type) {
- case Ci.nsIPresentationChannelDescription.TYPE_TCP:
- this._tcpAddresses = Cc["@mozilla.org/array;1"]
- .createInstance(Ci.nsIMutableArray);
- for (let address of aInit.tcpAddress) {
- let wrapper = Cc["@mozilla.org/supports-cstring;1"]
- .createInstance(Ci.nsISupportsCString);
- wrapper.data = address;
- this._tcpAddresses.appendElement(wrapper, false);
- }
-
- this._tcpPort = aInit.tcpPort;
- break;
- case Ci.nsIPresentationChannelDescription.TYPE_DATACHANNEL:
- this._dataChannelSDP = aInit.dataChannelSDP;
- break;
- }
-}
-
-ChannelDescription.prototype = {
- _type: 0,
- _tcpAddresses: null,
- _tcpPort: 0,
- _dataChannelSDP: "",
-
- get type() {
- return this._type;
- },
-
- get tcpAddress() {
- return this._tcpAddresses;
- },
-
- get tcpPort() {
- return this._tcpPort;
- },
-
- get dataChannelSDP() {
- return this._dataChannelSDP;
- },
-
- classID: Components.ID("{d69fc81c-4f40-47a3-97e6-b4cf5db2294e}"),
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationChannelDescription]),
-};
-
-// Helper function: transfer nsIPresentationChannelDescription to json
-function discriptionAsJson(aDescription) {
- let json = {};
- json.type = aDescription.type;
- switch(aDescription.type) {
- case Ci.nsIPresentationChannelDescription.TYPE_TCP:
- let addresses = aDescription.tcpAddress.QueryInterface(Ci.nsIArray);
- json.tcpAddress = [];
- for (let idx = 0; idx < addresses.length; idx++) {
- let address = addresses.queryElementAt(idx, Ci.nsISupportsCString);
- json.tcpAddress.push(address.data);
- }
- json.tcpPort = aDescription.tcpPort;
- break;
- case Ci.nsIPresentationChannelDescription.TYPE_DATACHANNEL:
- json.dataChannelSDP = aDescription.dataChannelSDP;
- break;
- }
- return json;
-}
-
-function LegacyTCPControlChannel(id,
- transport,
- deviceInfo) {
- DEBUG && log("create LegacyTCPControlChannel"); //jshint ignore:line
- this._deviceInfo = deviceInfo;
- this._transport = transport;
-
- this._id = id;
-
- let currentThread = Services.tm.currentThread;
- transport.setEventSink(this, currentThread);
-
- this._input = this._transport.openInputStream(0, 0, 0)
- .QueryInterface(Ci.nsIAsyncInputStream);
- this._input.asyncWait(this.QueryInterface(Ci.nsIStreamListener),
- Ci.nsIAsyncInputStream.WAIT_CLOSURE_ONLY,
- 0,
- currentThread);
-
- this._output = this._transport
- .openOutputStream(Ci.nsITransport.OPEN_UNBUFFERED, 0, 0);
-}
-
-LegacyTCPControlChannel.prototype = {
- _connected: false,
- _pendingOpen: false,
- _pendingAnswer: null,
- _pendingClose: null,
- _pendingCloseReason: null,
-
- _sendMessage: function(aJSONData, aOnThrow) {
- if (!aOnThrow) {
- aOnThrow = function(e) {throw e.result;};
- }
-
- if (!aJSONData) {
- aOnThrow();
- return;
- }
-
- if (!this._connected) {
- DEBUG && log("LegacyTCPControlChannel - send" + aJSONData.type + " fails"); //jshint ignore:line
- throw Cr.NS_ERROR_FAILURE;
- }
-
- try {
- this._send(aJSONData);
- } catch (e) {
- aOnThrow(e);
- }
- },
-
- _sendInit: function() {
- let msg = {
- type: "requestSession:Init",
- presentationId: this._presentationId,
- url: this._url,
- id: this._id,
- };
-
- this._sendMessage(msg, function(e) {
- this.disconnect();
- this._notifyDisconnected(e.result);
- });
- },
-
- launch: function(aPresentationId, aUrl) {
- this._presentationId = aPresentationId;
- this._url = aUrl;
-
- this._sendInit();
- },
-
- terminate: function() {
- // Legacy protocol doesn't support extra terminate protocol.
- // Trigger error handling for browser to shutdown all the resource locally.
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
-
- sendOffer: function(aOffer) {
- let msg = {
- type: "requestSession:Offer",
- presentationId: this._presentationId,
- offer: discriptionAsJson(aOffer),
- };
- this._sendMessage(msg);
- },
-
- sendAnswer: function(aAnswer) { //jshint ignore:line
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
-
- sendIceCandidate: function(aCandidate) {
- let msg = {
- type: "requestSession:IceCandidate",
- presentationId: this._presentationId,
- iceCandidate: aCandidate,
- };
- this._sendMessage(msg);
- },
- // may throw an exception
- _send: function(aMsg) {
- DEBUG && log("LegacyTCPControlChannel - Send: " + JSON.stringify(aMsg, null, 2)); //jshint ignore:line
-
- /**
- * XXX In TCP streaming, it is possible that more than one message in one
- * TCP packet. We use line delimited JSON to identify where one JSON encoded
- * object ends and the next begins. Therefore, we do not allow newline
- * characters whithin the whole message, and add a newline at the end.
- * Please see the parser code in |onDataAvailable|.
- */
- let message = JSON.stringify(aMsg).replace(["\n"], "") + "\n";
- try {
- this._output.write(message, message.length);
- } catch(e) {
- DEBUG && log("LegacyTCPControlChannel - Failed to send message: " + e.name); //jshint ignore:line
- throw e;
- }
- },
-
- // nsIAsyncInputStream (Triggered by nsIInputStream.asyncWait)
- // Only used for detecting connection refused
- onInputStreamReady: function(aStream) {
- try {
- aStream.available();
- } catch (e) {
- DEBUG && log("LegacyTCPControlChannel - onInputStreamReady error: " + e.name); //jshint ignore:line
- // NS_ERROR_CONNECTION_REFUSED
- this._listener.notifyDisconnected(e.result);
- }
- },
-
- // nsITransportEventSink (Triggered by nsISocketTransport.setEventSink)
- onTransportStatus: function(aTransport, aStatus, aProg, aProgMax) { //jshint ignore:line
- DEBUG && log("LegacyTCPControlChannel - onTransportStatus: "
- + aStatus.toString(16)); //jshint ignore:line
- if (aStatus === Ci.nsISocketTransport.STATUS_CONNECTED_TO) {
- this._connected = true;
-
- if (!this._pump) {
- this._createInputStreamPump();
- }
-
- this._notifyConnected();
- }
- },
-
- // nsIRequestObserver (Triggered by nsIInputStreamPump.asyncRead)
- onStartRequest: function() {
- DEBUG && log("LegacyTCPControlChannel - onStartRequest"); //jshint ignore:line
- },
-
- // nsIRequestObserver (Triggered by nsIInputStreamPump.asyncRead)
- onStopRequest: function(aRequest, aContext, aStatus) {
- DEBUG && log("LegacyTCPControlChannel - onStopRequest: " + aStatus); //jshint ignore:line
- this.disconnect(aStatus);
- this._notifyDisconnected(aStatus);
- },
-
- // nsIStreamListener (Triggered by nsIInputStreamPump.asyncRead)
- onDataAvailable: function(aRequest, aContext, aInputStream, aOffset, aCount) { //jshint ignore:line
- let data = NetUtil.readInputStreamToString(aInputStream,
- aInputStream.available());
- DEBUG && log("LegacyTCPControlChannel - onDataAvailable: " + data); //jshint ignore:line
-
- // Parser of line delimited JSON. Please see |_send| for more informaiton.
- let jsonArray = data.split("\n");
- jsonArray.pop();
- for (let json of jsonArray) {
- let msg;
- try {
- msg = JSON.parse(json);
- } catch (e) {
- DEBUG && log("LegacyTCPSignalingChannel - error in parsing json: " + e); //jshint ignore:line
- }
-
- this._handleMessage(msg);
- }
- },
-
- _createInputStreamPump: function() {
- DEBUG && log("LegacyTCPControlChannel - create pump"); //jshint ignore:line
- this._pump = Cc["@mozilla.org/network/input-stream-pump;1"].
- createInstance(Ci.nsIInputStreamPump);
- this._pump.init(this._input, -1, -1, 0, 0, false);
- this._pump.asyncRead(this, null);
- },
-
- // Handle command from remote side
- _handleMessage: function(aMsg) {
- DEBUG && log("LegacyTCPControlChannel - handleMessage from "
- + JSON.stringify(this._deviceInfo) + ": " + JSON.stringify(aMsg)); //jshint ignore:line
- switch (aMsg.type) {
- case "requestSession:Answer": {
- this._onAnswer(aMsg.answer);
- break;
- }
- case "requestSession:IceCandidate": {
- this._listener.onIceCandidate(aMsg.iceCandidate);
- break;
- }
- case "requestSession:CloseReason": {
- this._pendingCloseReason = aMsg.reason;
- break;
- }
- }
- },
-
- get listener() {
- return this._listener;
- },
-
- set listener(aListener) {
- DEBUG && log("LegacyTCPControlChannel - set listener: " + aListener); //jshint ignore:line
- if (!aListener) {
- this._listener = null;
- return;
- }
-
- this._listener = aListener;
- if (this._pendingOpen) {
- this._pendingOpen = false;
- DEBUG && log("LegacyTCPControlChannel - notify pending opened"); //jshint ignore:line
- this._listener.notifyConnected();
- }
-
- if (this._pendingAnswer) {
- let answer = this._pendingAnswer;
- DEBUG && log("LegacyTCPControlChannel - notify pending answer: " +
- JSON.stringify(answer)); // jshint ignore:line
- this._listener.onAnswer(new ChannelDescription(answer));
- this._pendingAnswer = null;
- }
-
- if (this._pendingClose) {
- DEBUG && log("LegacyTCPControlChannel - notify pending closed"); //jshint ignore:line
- this._notifyDisconnected(this._pendingCloseReason);
- this._pendingClose = null;
- }
- },
-
- /**
- * These functions are designed to handle the interaction with listener
- * appropriately. |_FUNC| is to handle |this._listener.FUNC|.
- */
- _onAnswer: function(aAnswer) {
- if (!this._connected) {
- return;
- }
- if (!this._listener) {
- this._pendingAnswer = aAnswer;
- return;
- }
- DEBUG && log("LegacyTCPControlChannel - notify answer: " + JSON.stringify(aAnswer)); //jshint ignore:line
- this._listener.onAnswer(new ChannelDescription(aAnswer));
- },
-
- _notifyConnected: function() {
- this._connected = true;
- this._pendingClose = false;
- this._pendingCloseReason = Cr.NS_OK;
-
- if (!this._listener) {
- this._pendingOpen = true;
- return;
- }
-
- DEBUG && log("LegacyTCPControlChannel - notify opened"); //jshint ignore:line
- this._listener.notifyConnected();
- },
-
- _notifyDisconnected: function(aReason) {
- this._connected = false;
- this._pendingOpen = false;
- this._pendingAnswer = null;
-
- // Remote endpoint closes the control channel with abnormal reason.
- if (aReason == Cr.NS_OK && this._pendingCloseReason != Cr.NS_OK) {
- aReason = this._pendingCloseReason;
- }
-
- if (!this._listener) {
- this._pendingClose = true;
- this._pendingCloseReason = aReason;
- return;
- }
-
- DEBUG && log("LegacyTCPControlChannel - notify closed"); //jshint ignore:line
- this._listener.notifyDisconnected(aReason);
- },
-
- disconnect: function(aReason) {
- DEBUG && log("LegacyTCPControlChannel - close with reason: " + aReason); //jshint ignore:line
-
- if (this._connected) {
- // default reason is NS_OK
- if (typeof aReason !== "undefined" && aReason !== Cr.NS_OK) {
- let msg = {
- type: "requestSession:CloseReason",
- presentationId: this._presentationId,
- reason: aReason,
- };
- this._sendMessage(msg);
- this._pendingCloseReason = aReason;
- }
-
- this._transport.setEventSink(null, null);
- this._pump = null;
-
- this._input.close();
- this._output.close();
-
- this._connected = false;
- }
- },
-
- reconnect: function() {
- // Legacy protocol doesn't support extra reconnect protocol.
- // Trigger error handling for browser to shutdown all the resource locally.
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
-
- classID: Components.ID("{4027ce3d-06e3-4d06-a235-df329cb0d411}"),
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannel,
- Ci.nsIStreamListener]),
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([LegacyPresentationControlService]); //jshint ignore:line
diff --git a/dom/presentation/provider/LegacyProviders.manifest b/dom/presentation/provider/LegacyProviders.manifest
deleted file mode 100644
index 9408da063..000000000
--- a/dom/presentation/provider/LegacyProviders.manifest
+++ /dev/null
@@ -1,2 +0,0 @@
-component {b21816fe-8aff-4811-86d2-85a7444c557e} LegacyPresentationControlService.js
-contract @mozilla.org/presentation/legacy-control-service;1 {b21816fe-8aff-4811-86d2-85a7444c557e}
diff --git a/dom/presentation/provider/MulticastDNSDeviceProvider.cpp b/dom/presentation/provider/MulticastDNSDeviceProvider.cpp
deleted file mode 100644
index 0cab915ac..000000000
--- a/dom/presentation/provider/MulticastDNSDeviceProvider.cpp
+++ /dev/null
@@ -1,1249 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "MulticastDNSDeviceProvider.h"
-
-#include "DeviceProviderHelpers.h"
-#include "MainThreadUtils.h"
-#include "mozilla/Logging.h"
-#include "mozilla/Preferences.h"
-#include "mozilla/Services.h"
-#include "mozilla/Unused.h"
-#include "nsComponentManagerUtils.h"
-#include "nsIObserverService.h"
-#include "nsIWritablePropertyBag2.h"
-#include "nsServiceManagerUtils.h"
-#include "nsTCPDeviceInfo.h"
-#include "nsThreadUtils.h"
-
-#ifdef MOZ_WIDGET_ANDROID
-#include "nsIPropertyBag2.h"
-#endif // MOZ_WIDGET_ANDROID
-
-#define PREF_PRESENTATION_DISCOVERY "dom.presentation.discovery.enabled"
-#define PREF_PRESENTATION_DISCOVERY_TIMEOUT_MS "dom.presentation.discovery.timeout_ms"
-#define PREF_PRESENTATION_DISCOVERABLE "dom.presentation.discoverable"
-#define PREF_PRESENTATION_DISCOVERABLE_ENCRYPTED "dom.presentation.discoverable.encrypted"
-#define PREF_PRESENTATION_DISCOVERABLE_RETRY_MS "dom.presentation.discoverable.retry_ms"
-#define PREF_PRESENTATION_DEVICE_NAME "dom.presentation.device.name"
-
-#define SERVICE_TYPE "_presentation-ctrl._tcp"
-#define PROTOCOL_VERSION_TAG "version"
-#define CERT_FINGERPRINT_TAG "certFingerprint"
-
-static mozilla::LazyLogModule sMulticastDNSProviderLogModule("MulticastDNSDeviceProvider");
-
-#undef LOG_I
-#define LOG_I(...) MOZ_LOG(sMulticastDNSProviderLogModule, mozilla::LogLevel::Debug, (__VA_ARGS__))
-#undef LOG_E
-#define LOG_E(...) MOZ_LOG(sMulticastDNSProviderLogModule, mozilla::LogLevel::Error, (__VA_ARGS__))
-
-namespace mozilla {
-namespace dom {
-namespace presentation {
-
-static const char* kObservedPrefs[] = {
- PREF_PRESENTATION_DISCOVERY,
- PREF_PRESENTATION_DISCOVERY_TIMEOUT_MS,
- PREF_PRESENTATION_DISCOVERABLE,
- PREF_PRESENTATION_DEVICE_NAME,
- nullptr
-};
-
-namespace {
-
-#ifdef MOZ_WIDGET_ANDROID
-static void
-GetAndroidDeviceName(nsACString& aRetVal)
-{
- nsCOMPtr<nsIPropertyBag2> infoService = do_GetService("@mozilla.org/system-info;1");
- MOZ_ASSERT(infoService, "Could not find a system info service");
-
- Unused << NS_WARN_IF(NS_FAILED(infoService->GetPropertyAsACString(
- NS_LITERAL_STRING("device"), aRetVal)));
-}
-#endif // MOZ_WIDGET_ANDROID
-
-} //anonymous namespace
-
-/**
- * This wrapper is used to break circular-reference problem.
- */
-class DNSServiceWrappedListener final
- : public nsIDNSServiceDiscoveryListener
- , public nsIDNSRegistrationListener
- , public nsIDNSServiceResolveListener
- , public nsIPresentationControlServerListener
-{
-public:
- NS_DECL_ISUPPORTS
- NS_FORWARD_SAFE_NSIDNSSERVICEDISCOVERYLISTENER(mListener)
- NS_FORWARD_SAFE_NSIDNSREGISTRATIONLISTENER(mListener)
- NS_FORWARD_SAFE_NSIDNSSERVICERESOLVELISTENER(mListener)
- NS_FORWARD_SAFE_NSIPRESENTATIONCONTROLSERVERLISTENER(mListener)
-
- explicit DNSServiceWrappedListener() = default;
-
- nsresult SetListener(MulticastDNSDeviceProvider* aListener)
- {
- mListener = aListener;
- return NS_OK;
- }
-
-private:
- virtual ~DNSServiceWrappedListener() = default;
-
- MulticastDNSDeviceProvider* mListener = nullptr;
-};
-
-NS_IMPL_ISUPPORTS(DNSServiceWrappedListener,
- nsIDNSServiceDiscoveryListener,
- nsIDNSRegistrationListener,
- nsIDNSServiceResolveListener,
- nsIPresentationControlServerListener)
-
-NS_IMPL_ISUPPORTS(MulticastDNSDeviceProvider,
- nsIPresentationDeviceProvider,
- nsIDNSServiceDiscoveryListener,
- nsIDNSRegistrationListener,
- nsIDNSServiceResolveListener,
- nsIPresentationControlServerListener,
- nsIObserver)
-
-MulticastDNSDeviceProvider::~MulticastDNSDeviceProvider()
-{
- Uninit();
-}
-
-nsresult
-MulticastDNSDeviceProvider::Init()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (mInitialized) {
- return NS_OK;
- }
-
- nsresult rv;
-
- mMulticastDNS = do_GetService(DNSSERVICEDISCOVERY_CONTRACT_ID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mWrappedListener = new DNSServiceWrappedListener();
- if (NS_WARN_IF(NS_FAILED(rv = mWrappedListener->SetListener(this)))) {
- return rv;
- }
-
- mPresentationService = do_CreateInstance(PRESENTATION_CONTROL_SERVICE_CONTACT_ID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mDiscoveryTimer = do_CreateInstance(NS_TIMER_CONTRACTID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- mServerRetryTimer = do_CreateInstance(NS_TIMER_CONTRACTID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- Preferences::AddStrongObservers(this, kObservedPrefs);
-
- mDiscoveryEnabled = Preferences::GetBool(PREF_PRESENTATION_DISCOVERY);
- mDiscoveryTimeoutMs = Preferences::GetUint(PREF_PRESENTATION_DISCOVERY_TIMEOUT_MS);
- mDiscoverable = Preferences::GetBool(PREF_PRESENTATION_DISCOVERABLE);
- mDiscoverableEncrypted = Preferences::GetBool(PREF_PRESENTATION_DISCOVERABLE_ENCRYPTED);
- mServerRetryMs = Preferences::GetUint(PREF_PRESENTATION_DISCOVERABLE_RETRY_MS);
- mServiceName = Preferences::GetCString(PREF_PRESENTATION_DEVICE_NAME);
-
-#ifdef MOZ_WIDGET_ANDROID
- // FIXME: Bug 1185806 - Provide a common device name setting.
- if (mServiceName.IsEmpty()) {
- GetAndroidDeviceName(mServiceName);
- Unused << Preferences::SetCString(PREF_PRESENTATION_DEVICE_NAME, mServiceName);
- }
-#endif // MOZ_WIDGET_ANDROID
-
- Unused << mPresentationService->SetId(mServiceName);
-
- if (mDiscoveryEnabled && NS_WARN_IF(NS_FAILED(rv = ForceDiscovery()))) {
- return rv;
- }
-
- if (mDiscoverable && NS_WARN_IF(NS_FAILED(rv = StartServer()))) {
- return rv;
- }
-
- mInitialized = true;
- return NS_OK;
-}
-
-nsresult
-MulticastDNSDeviceProvider::Uninit()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (!mInitialized) {
- return NS_OK;
- }
-
- ClearDevices();
-
- Preferences::RemoveObservers(this, kObservedPrefs);
-
- StopDiscovery(NS_OK);
- StopServer();
-
- mMulticastDNS = nullptr;
-
- if (mWrappedListener) {
- mWrappedListener->SetListener(nullptr);
- mWrappedListener = nullptr;
- }
-
- mInitialized = false;
- return NS_OK;
-}
-
-nsresult
-MulticastDNSDeviceProvider::StartServer()
-{
- LOG_I("StartServer: %s (%d)", mServiceName.get(), mDiscoverable);
- MOZ_ASSERT(NS_IsMainThread());
-
- if (!mDiscoverable) {
- return NS_OK;
- }
-
- nsresult rv;
-
- uint16_t servicePort;
- if (NS_WARN_IF(NS_FAILED(rv = mPresentationService->GetPort(&servicePort)))) {
- return rv;
- }
-
- /**
- * If |servicePort| is non-zero, it means PresentationControlService is running.
- * Otherwise, we should make it start serving.
- */
- if (servicePort) {
- return RegisterMDNSService();
- }
-
- if (NS_WARN_IF(NS_FAILED(rv = mPresentationService->SetListener(mWrappedListener)))) {
- return rv;
- }
-
- AbortServerRetry();
-
- if (NS_WARN_IF(NS_FAILED(rv = mPresentationService->StartServer(mDiscoverableEncrypted, 0)))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-nsresult
-MulticastDNSDeviceProvider::StopServer()
-{
- LOG_I("StopServer: %s", mServiceName.get());
- MOZ_ASSERT(NS_IsMainThread());
-
- UnregisterMDNSService(NS_OK);
-
- AbortServerRetry();
-
- if (mPresentationService) {
- mPresentationService->SetListener(nullptr);
- mPresentationService->Close();
- }
-
- return NS_OK;
-}
-
-void
-MulticastDNSDeviceProvider::AbortServerRetry()
-{
- if (mIsServerRetrying) {
- mIsServerRetrying = false;
- mServerRetryTimer->Cancel();
- }
-}
-
-nsresult
-MulticastDNSDeviceProvider::RegisterMDNSService()
-{
- LOG_I("RegisterMDNSService: %s", mServiceName.get());
-
- if (!mDiscoverable) {
- return NS_OK;
- }
-
- // Cancel on going service registration.
- UnregisterMDNSService(NS_OK);
-
- nsresult rv;
-
- uint16_t servicePort;
- if (NS_FAILED(rv = mPresentationService->GetPort(&servicePort)) ||
- !servicePort) {
- // Abort service registration if server port is not available.
- return rv;
- }
-
- /**
- * Register the presentation control channel server as an mDNS service.
- */
- nsCOMPtr<nsIDNSServiceInfo> serviceInfo =
- do_CreateInstance(DNSSERVICEINFO_CONTRACT_ID, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- if (NS_WARN_IF(NS_FAILED(rv = serviceInfo->SetServiceType(
- NS_LITERAL_CSTRING(SERVICE_TYPE))))) {
- return rv;
- }
- if (NS_WARN_IF(NS_FAILED(rv = serviceInfo->SetServiceName(mServiceName)))) {
- return rv;
- }
- if (NS_WARN_IF(NS_FAILED(rv = serviceInfo->SetPort(servicePort)))) {
- return rv;
- }
-
- nsCOMPtr<nsIWritablePropertyBag2> propBag =
- do_CreateInstance("@mozilla.org/hash-property-bag;1");
- MOZ_ASSERT(propBag);
-
- uint32_t version;
- rv = mPresentationService->GetVersion(&version);
- MOZ_ASSERT(NS_SUCCEEDED(rv));
-
- rv = propBag->SetPropertyAsUint32(NS_LITERAL_STRING(PROTOCOL_VERSION_TAG),
- version);
- MOZ_ASSERT(NS_SUCCEEDED(rv));
-
- if (mDiscoverableEncrypted) {
- nsAutoCString certFingerprint;
- rv = mPresentationService->GetCertFingerprint(certFingerprint);
- MOZ_ASSERT(NS_SUCCEEDED(rv));
-
- rv = propBag->SetPropertyAsACString(NS_LITERAL_STRING(CERT_FINGERPRINT_TAG),
- certFingerprint);
- MOZ_ASSERT(NS_SUCCEEDED(rv));
- }
-
- if (NS_WARN_IF(NS_FAILED(rv = serviceInfo->SetAttributes(propBag)))) {
- return rv;
- }
-
- return mMulticastDNS->RegisterService(serviceInfo,
- mWrappedListener,
- getter_AddRefs(mRegisterRequest));
-}
-
-nsresult
-MulticastDNSDeviceProvider::UnregisterMDNSService(nsresult aReason)
-{
- LOG_I("UnregisterMDNSService: %s (0x%08x)", mServiceName.get(), aReason);
- MOZ_ASSERT(NS_IsMainThread());
-
- if (mRegisterRequest) {
- mRegisterRequest->Cancel(aReason);
- mRegisterRequest = nullptr;
- }
-
- return NS_OK;
-}
-
-nsresult
-MulticastDNSDeviceProvider::StopDiscovery(nsresult aReason)
-{
- LOG_I("StopDiscovery (0x%08x)", aReason);
-
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mDiscoveryTimer);
-
- Unused << mDiscoveryTimer->Cancel();
-
- if (mDiscoveryRequest) {
- mDiscoveryRequest->Cancel(aReason);
- mDiscoveryRequest = nullptr;
- }
-
- return NS_OK;
-}
-
-nsresult
-MulticastDNSDeviceProvider::Connect(Device* aDevice,
- nsIPresentationControlChannel** aRetVal)
-{
- MOZ_ASSERT(aDevice);
- MOZ_ASSERT(mPresentationService);
-
- RefPtr<TCPDeviceInfo> deviceInfo = new TCPDeviceInfo(aDevice->Id(),
- aDevice->Address(),
- aDevice->Port(),
- aDevice->CertFingerprint());
-
- return mPresentationService->Connect(deviceInfo, aRetVal);
-}
-
-bool
-MulticastDNSDeviceProvider::IsCompatibleServer(nsIDNSServiceInfo* aServiceInfo)
-{
- MOZ_ASSERT(aServiceInfo);
-
- nsCOMPtr<nsIPropertyBag2> propBag;
- if (NS_WARN_IF(NS_FAILED(
- aServiceInfo->GetAttributes(getter_AddRefs(propBag)))) || !propBag) {
- return false;
- }
-
- uint32_t remoteVersion;
- if (NS_WARN_IF(NS_FAILED(
- propBag->GetPropertyAsUint32(NS_LITERAL_STRING(PROTOCOL_VERSION_TAG),
- &remoteVersion)))) {
- return false;
- }
-
- bool isCompatible = false;
- Unused << NS_WARN_IF(NS_FAILED(
- mPresentationService->IsCompatibleServer(remoteVersion,
- &isCompatible)));
-
- return isCompatible;
-}
-
-nsresult
-MulticastDNSDeviceProvider::AddDevice(const nsACString& aId,
- const nsACString& aServiceName,
- const nsACString& aServiceType,
- const nsACString& aAddress,
- const uint16_t aPort,
- const nsACString& aCertFingerprint)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mPresentationService);
-
- RefPtr<Device> device = new Device(aId, /* ID */
- aServiceName,
- aServiceType,
- aAddress,
- aPort,
- aCertFingerprint,
- DeviceState::eActive,
- this);
-
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- if (NS_SUCCEEDED(GetListener(getter_AddRefs(listener))) && listener) {
- Unused << listener->AddDevice(device);
- }
-
- mDevices.AppendElement(device);
-
- return NS_OK;
-}
-
-nsresult
-MulticastDNSDeviceProvider::UpdateDevice(const uint32_t aIndex,
- const nsACString& aServiceName,
- const nsACString& aServiceType,
- const nsACString& aAddress,
- const uint16_t aPort,
- const nsACString& aCertFingerprint)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mPresentationService);
-
- if (NS_WARN_IF(aIndex >= mDevices.Length())) {
- return NS_ERROR_INVALID_ARG;
- }
-
- RefPtr<Device> device = mDevices[aIndex];
- device->Update(aServiceName, aServiceType, aAddress, aPort, aCertFingerprint);
- device->ChangeState(DeviceState::eActive);
-
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- if (NS_SUCCEEDED(GetListener(getter_AddRefs(listener))) && listener) {
- Unused << listener->UpdateDevice(device);
- }
-
- return NS_OK;
-}
-
-nsresult
-MulticastDNSDeviceProvider::RemoveDevice(const uint32_t aIndex)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mPresentationService);
-
- if (NS_WARN_IF(aIndex >= mDevices.Length())) {
- return NS_ERROR_INVALID_ARG;
- }
-
- RefPtr<Device> device = mDevices[aIndex];
-
- LOG_I("RemoveDevice: %s", device->Id().get());
- mDevices.RemoveElementAt(aIndex);
-
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- if (NS_SUCCEEDED(GetListener(getter_AddRefs(listener))) && listener) {
- Unused << listener->RemoveDevice(device);
- }
-
- return NS_OK;
-}
-
-bool
-MulticastDNSDeviceProvider::FindDeviceById(const nsACString& aId,
- uint32_t& aIndex)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- RefPtr<Device> device = new Device(aId,
- /* aName = */ EmptyCString(),
- /* aType = */ EmptyCString(),
- /* aHost = */ EmptyCString(),
- /* aPort = */ 0,
- /* aCertFingerprint */ EmptyCString(),
- /* aState = */ DeviceState::eUnknown,
- /* aProvider = */ nullptr);
- size_t index = mDevices.IndexOf(device, 0, DeviceIdComparator());
-
- if (index == mDevices.NoIndex) {
- return false;
- }
-
- aIndex = index;
- return true;
-}
-
-bool
-MulticastDNSDeviceProvider::FindDeviceByAddress(const nsACString& aAddress,
- uint32_t& aIndex)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- RefPtr<Device> device = new Device(/* aId = */ EmptyCString(),
- /* aName = */ EmptyCString(),
- /* aType = */ EmptyCString(),
- aAddress,
- /* aPort = */ 0,
- /* aCertFingerprint */ EmptyCString(),
- /* aState = */ DeviceState::eUnknown,
- /* aProvider = */ nullptr);
- size_t index = mDevices.IndexOf(device, 0, DeviceAddressComparator());
-
- if (index == mDevices.NoIndex) {
- return false;
- }
-
- aIndex = index;
- return true;
-}
-
-void
-MulticastDNSDeviceProvider::MarkAllDevicesUnknown()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- for (auto& device : mDevices) {
- device->ChangeState(DeviceState::eUnknown);
- }
-}
-
-void
-MulticastDNSDeviceProvider::ClearUnknownDevices()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- size_t i = mDevices.Length();
- while (i > 0) {
- --i;
- if (mDevices[i]->State() == DeviceState::eUnknown) {
- Unused << NS_WARN_IF(NS_FAILED(RemoveDevice(i)));
- }
- }
-}
-
-void
-MulticastDNSDeviceProvider::ClearDevices()
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- size_t i = mDevices.Length();
- while (i > 0) {
- --i;
- Unused << NS_WARN_IF(NS_FAILED(RemoveDevice(i)));
- }
-}
-
-// nsIPresentationDeviceProvider
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::GetListener(nsIPresentationDeviceListener** aListener)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!aListener)) {
- return NS_ERROR_INVALID_POINTER;
- }
-
- nsresult rv;
- nsCOMPtr<nsIPresentationDeviceListener> listener =
- do_QueryReferent(mDeviceListener, &rv);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- listener.forget(aListener);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::SetListener(nsIPresentationDeviceListener* aListener)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- mDeviceListener = do_GetWeakReference(aListener);
-
- nsresult rv;
- if (mDeviceListener) {
- if (NS_WARN_IF(NS_FAILED(rv = Init()))) {
- return rv;
- }
- } else {
- if (NS_WARN_IF(NS_FAILED(rv = Uninit()))) {
- return rv;
- }
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::ForceDiscovery()
-{
- LOG_I("ForceDiscovery (%d)", mDiscoveryEnabled);
- MOZ_ASSERT(NS_IsMainThread());
-
- if (!mDiscoveryEnabled) {
- return NS_OK;
- }
-
- MOZ_ASSERT(mDiscoveryTimer);
- MOZ_ASSERT(mMulticastDNS);
-
- // if it's already discovering, extend existing discovery timeout.
- nsresult rv;
- if (mIsDiscovering) {
- Unused << mDiscoveryTimer->Cancel();
-
- if (NS_WARN_IF(NS_FAILED( rv = mDiscoveryTimer->Init(this,
- mDiscoveryTimeoutMs,
- nsITimer::TYPE_ONE_SHOT)))) {
- return rv;
- }
- return NS_OK;
- }
-
- StopDiscovery(NS_OK);
-
- if (NS_WARN_IF(NS_FAILED(rv = mMulticastDNS->StartDiscovery(
- NS_LITERAL_CSTRING(SERVICE_TYPE),
- mWrappedListener,
- getter_AddRefs(mDiscoveryRequest))))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-// nsIDNSServiceDiscoveryListener
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnDiscoveryStarted(const nsACString& aServiceType)
-{
- LOG_I("OnDiscoveryStarted");
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mDiscoveryTimer);
-
- MarkAllDevicesUnknown();
-
- nsresult rv;
- if (NS_WARN_IF(NS_FAILED(rv = mDiscoveryTimer->Init(this,
- mDiscoveryTimeoutMs,
- nsITimer::TYPE_ONE_SHOT)))) {
- return rv;
- }
-
- mIsDiscovering = true;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnDiscoveryStopped(const nsACString& aServiceType)
-{
- LOG_I("OnDiscoveryStopped");
- MOZ_ASSERT(NS_IsMainThread());
-
- ClearUnknownDevices();
-
- mIsDiscovering = false;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnServiceFound(nsIDNSServiceInfo* aServiceInfo)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!aServiceInfo)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- nsresult rv ;
-
- nsAutoCString serviceName;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetServiceName(serviceName)))) {
- return rv;
- }
-
- LOG_I("OnServiceFound: %s", serviceName.get());
-
- if (mMulticastDNS) {
- if (NS_WARN_IF(NS_FAILED(rv = mMulticastDNS->ResolveService(
- aServiceInfo, mWrappedListener)))) {
- return rv;
- }
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnServiceLost(nsIDNSServiceInfo* aServiceInfo)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!aServiceInfo)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- nsresult rv;
-
- nsAutoCString serviceName;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetServiceName(serviceName)))) {
- return rv;
- }
-
- LOG_I("OnServiceLost: %s", serviceName.get());
-
- nsAutoCString host;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetHost(host)))) {
- return rv;
- }
-
- uint32_t index;
- if (!FindDeviceById(host, index)) {
- // given device was not found
- return NS_OK;
- }
-
- if (NS_WARN_IF(NS_FAILED(rv = RemoveDevice(index)))) {
- return rv;
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnStartDiscoveryFailed(const nsACString& aServiceType,
- int32_t aErrorCode)
-{
- LOG_E("OnStartDiscoveryFailed: %d", aErrorCode);
- MOZ_ASSERT(NS_IsMainThread());
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnStopDiscoveryFailed(const nsACString& aServiceType,
- int32_t aErrorCode)
-{
- LOG_E("OnStopDiscoveryFailed: %d", aErrorCode);
- MOZ_ASSERT(NS_IsMainThread());
-
- return NS_OK;
-}
-
-// nsIDNSRegistrationListener
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnServiceRegistered(nsIDNSServiceInfo* aServiceInfo)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!aServiceInfo)) {
- return NS_ERROR_INVALID_ARG;
- }
- nsresult rv;
-
- nsAutoCString name;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetServiceName(name)))) {
- return rv;
- }
-
- LOG_I("OnServiceRegistered (%s)", name.get());
- mRegisteredName = name;
-
- if (mMulticastDNS) {
- if (NS_WARN_IF(NS_FAILED(rv = mMulticastDNS->ResolveService(
- aServiceInfo, mWrappedListener)))) {
- return rv;
- }
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnServiceUnregistered(nsIDNSServiceInfo* aServiceInfo)
-{
- LOG_I("OnServiceUnregistered");
- MOZ_ASSERT(NS_IsMainThread());
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnRegistrationFailed(nsIDNSServiceInfo* aServiceInfo,
- int32_t aErrorCode)
-{
- LOG_E("OnRegistrationFailed: %d", aErrorCode);
- MOZ_ASSERT(NS_IsMainThread());
-
- mRegisterRequest = nullptr;
-
- if (aErrorCode == nsIDNSRegistrationListener::ERROR_SERVICE_NOT_RUNNING) {
- return NS_DispatchToMainThread(
- NewRunnableMethod(this, &MulticastDNSDeviceProvider::RegisterMDNSService));
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnUnregistrationFailed(nsIDNSServiceInfo* aServiceInfo,
- int32_t aErrorCode)
-{
- LOG_E("OnUnregistrationFailed: %d", aErrorCode);
- MOZ_ASSERT(NS_IsMainThread());
-
- return NS_OK;
-}
-
-// nsIDNSServiceResolveListener
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnServiceResolved(nsIDNSServiceInfo* aServiceInfo)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (NS_WARN_IF(!aServiceInfo)) {
- return NS_ERROR_INVALID_ARG;
- }
-
- nsresult rv;
-
- nsAutoCString serviceName;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetServiceName(serviceName)))) {
- return rv;
- }
-
- LOG_I("OnServiceResolved: %s", serviceName.get());
-
- nsAutoCString host;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetHost(host)))) {
- return rv;
- }
-
- if (mRegisteredName == serviceName) {
- LOG_I("ignore self");
-
- if (NS_WARN_IF(NS_FAILED(rv = mPresentationService->SetId(host)))) {
- return rv;
- }
-
- return NS_OK;
- }
-
- if (!IsCompatibleServer(aServiceInfo)) {
- LOG_I("ignore incompatible service: %s", serviceName.get());
- return NS_OK;
- }
-
- nsAutoCString address;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetAddress(address)))) {
- return rv;
- }
-
- uint16_t port;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetPort(&port)))) {
- return rv;
- }
-
- nsAutoCString serviceType;
- if (NS_WARN_IF(NS_FAILED(rv = aServiceInfo->GetServiceType(serviceType)))) {
- return rv;
- }
-
- nsCOMPtr<nsIPropertyBag2> propBag;
- if (NS_WARN_IF(NS_FAILED(
- aServiceInfo->GetAttributes(getter_AddRefs(propBag)))) || !propBag) {
- return rv;
- }
-
- nsAutoCString certFingerprint;
- Unused << propBag->GetPropertyAsACString(NS_LITERAL_STRING(CERT_FINGERPRINT_TAG),
- certFingerprint);
-
- uint32_t index;
- if (FindDeviceById(host, index)) {
- return UpdateDevice(index,
- serviceName,
- serviceType,
- address,
- port,
- certFingerprint);
- } else {
- return AddDevice(host,
- serviceName,
- serviceType,
- address,
- port,
- certFingerprint);
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnResolveFailed(nsIDNSServiceInfo* aServiceInfo,
- int32_t aErrorCode)
-{
- LOG_E("OnResolveFailed: %d", aErrorCode);
- MOZ_ASSERT(NS_IsMainThread());
-
- return NS_OK;
-}
-
-// nsIPresentationControlServerListener
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnServerReady(uint16_t aPort,
- const nsACString& aCertFingerprint)
-{
- LOG_I("OnServerReady: %d, %s", aPort, PromiseFlatCString(aCertFingerprint).get());
- MOZ_ASSERT(NS_IsMainThread());
-
- if (mDiscoverable) {
- RegisterMDNSService();
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnServerStopped(nsresult aResult)
-{
- LOG_I("OnServerStopped: (0x%08x)", aResult);
-
- UnregisterMDNSService(aResult);
-
- // Try restart server if it is stopped abnormally.
- if (NS_FAILED(aResult) && mDiscoverable) {
- mIsServerRetrying = true;
- mServerRetryTimer->Init(this, mServerRetryMs, nsITimer::TYPE_ONE_SHOT);
- }
-
- return NS_OK;
-}
-
-// Create a new device if we were unable to find one with the address.
-already_AddRefed<MulticastDNSDeviceProvider::Device>
-MulticastDNSDeviceProvider::GetOrCreateDevice(nsITCPDeviceInfo* aDeviceInfo)
-{
- nsAutoCString address;
- Unused << aDeviceInfo->GetAddress(address);
-
- RefPtr<Device> device;
- uint32_t index;
- if (FindDeviceByAddress(address, index)) {
- device = mDevices[index];
- } else {
- // Create a one-time device object for non-discoverable controller.
- // This device will not be in the list of available devices and cannot
- // be used for requesting session.
- nsAutoCString id;
- Unused << aDeviceInfo->GetId(id);
- uint16_t port;
- Unused << aDeviceInfo->GetPort(&port);
-
- device = new Device(id,
- /* aName = */ id,
- /* aType = */ EmptyCString(),
- address,
- port,
- /* aCertFingerprint */ EmptyCString(),
- DeviceState::eActive,
- /* aProvider = */ nullptr);
- }
-
- return device.forget();
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnSessionRequest(nsITCPDeviceInfo* aDeviceInfo,
- const nsAString& aUrl,
- const nsAString& aPresentationId,
- nsIPresentationControlChannel* aControlChannel)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- nsAutoCString address;
- Unused << aDeviceInfo->GetAddress(address);
-
- LOG_I("OnSessionRequest: %s", address.get());
-
- RefPtr<Device> device = GetOrCreateDevice(aDeviceInfo);
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- if (NS_SUCCEEDED(GetListener(getter_AddRefs(listener))) && listener) {
- Unused << listener->OnSessionRequest(device, aUrl, aPresentationId,
- aControlChannel);
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnTerminateRequest(nsITCPDeviceInfo* aDeviceInfo,
- const nsAString& aPresentationId,
- nsIPresentationControlChannel* aControlChannel,
- bool aIsFromReceiver)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- nsAutoCString address;
- Unused << aDeviceInfo->GetAddress(address);
-
- LOG_I("OnTerminateRequest: %s", address.get());
-
- RefPtr<Device> device = GetOrCreateDevice(aDeviceInfo);
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- if (NS_SUCCEEDED(GetListener(getter_AddRefs(listener))) && listener) {
- Unused << listener->OnTerminateRequest(device, aPresentationId,
- aControlChannel, aIsFromReceiver);
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::OnReconnectRequest(nsITCPDeviceInfo* aDeviceInfo,
- const nsAString& aUrl,
- const nsAString& aPresentationId,
- nsIPresentationControlChannel* aControlChannel)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- nsAutoCString address;
- Unused << aDeviceInfo->GetAddress(address);
-
- LOG_I("OnReconnectRequest: %s", address.get());
-
- RefPtr<Device> device = GetOrCreateDevice(aDeviceInfo);
- nsCOMPtr<nsIPresentationDeviceListener> listener;
- if (NS_SUCCEEDED(GetListener(getter_AddRefs(listener))) && listener) {
- Unused << listener->OnReconnectRequest(device, aUrl, aPresentationId,
- aControlChannel);
- }
-
- return NS_OK;
-}
-
-// nsIObserver
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::Observe(nsISupports* aSubject,
- const char* aTopic,
- const char16_t* aData)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- NS_ConvertUTF16toUTF8 data(aData);
- LOG_I("Observe: topic = %s, data = %s", aTopic, data.get());
-
- if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
- if (data.EqualsLiteral(PREF_PRESENTATION_DISCOVERY)) {
- OnDiscoveryChanged(Preferences::GetBool(PREF_PRESENTATION_DISCOVERY));
- } else if (data.EqualsLiteral(PREF_PRESENTATION_DISCOVERY_TIMEOUT_MS)) {
- OnDiscoveryTimeoutChanged(Preferences::GetUint(PREF_PRESENTATION_DISCOVERY_TIMEOUT_MS));
- } else if (data.EqualsLiteral(PREF_PRESENTATION_DISCOVERABLE)) {
- OnDiscoverableChanged(Preferences::GetBool(PREF_PRESENTATION_DISCOVERABLE));
- } else if (data.EqualsLiteral(PREF_PRESENTATION_DEVICE_NAME)) {
- nsAdoptingCString newServiceName = Preferences::GetCString(PREF_PRESENTATION_DEVICE_NAME);
- if (!mServiceName.Equals(newServiceName)) {
- OnServiceNameChanged(newServiceName);
- }
- }
- } else if (!strcmp(aTopic, NS_TIMER_CALLBACK_TOPIC)) {
- nsCOMPtr<nsITimer> timer = do_QueryInterface(aSubject);
- if (!timer) {
- return NS_ERROR_UNEXPECTED;
- }
-
- if (timer == mDiscoveryTimer) {
- StopDiscovery(NS_OK);
- } else if (timer == mServerRetryTimer) {
- mIsServerRetrying = false;
- StartServer();
- }
- }
-
- return NS_OK;
-}
-
-nsresult
-MulticastDNSDeviceProvider::OnDiscoveryChanged(bool aEnabled)
-{
- LOG_I("DiscoveryEnabled = %d\n", aEnabled);
- MOZ_ASSERT(NS_IsMainThread());
-
- mDiscoveryEnabled = aEnabled;
-
- if (mDiscoveryEnabled) {
- return ForceDiscovery();
- }
-
- return StopDiscovery(NS_OK);
-}
-
-nsresult
-MulticastDNSDeviceProvider::OnDiscoveryTimeoutChanged(uint32_t aTimeoutMs)
-{
- LOG_I("OnDiscoveryTimeoutChanged = %d\n", aTimeoutMs);
- MOZ_ASSERT(NS_IsMainThread());
-
- mDiscoveryTimeoutMs = aTimeoutMs;
-
- return NS_OK;
-}
-
-nsresult
-MulticastDNSDeviceProvider::OnDiscoverableChanged(bool aEnabled)
-{
- LOG_I("Discoverable = %d\n", aEnabled);
- MOZ_ASSERT(NS_IsMainThread());
-
- mDiscoverable = aEnabled;
-
- if (mDiscoverable) {
- return StartServer();
- }
-
- return StopServer();
-}
-
-nsresult
-MulticastDNSDeviceProvider::OnServiceNameChanged(const nsACString& aServiceName)
-{
- LOG_I("serviceName = %s\n", PromiseFlatCString(aServiceName).get());
- MOZ_ASSERT(NS_IsMainThread());
-
- mServiceName = aServiceName;
-
- nsresult rv;
- if (NS_WARN_IF(NS_FAILED(rv = UnregisterMDNSService(NS_OK)))) {
- return rv;
- }
-
- if (mDiscoverable) {
- return RegisterMDNSService();
- }
-
- return NS_OK;
-}
-
-// MulticastDNSDeviceProvider::Device
-NS_IMPL_ISUPPORTS(MulticastDNSDeviceProvider::Device,
- nsIPresentationDevice)
-
-// nsIPresentationDevice
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::Device::GetId(nsACString& aId)
-{
- aId = mId;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::Device::GetName(nsACString& aName)
-{
- aName = mName;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::Device::GetType(nsACString& aType)
-{
- aType = mType;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::Device::EstablishControlChannel(
- nsIPresentationControlChannel** aRetVal)
-{
- if (!mProvider) {
- return NS_ERROR_FAILURE;
- }
-
- return mProvider->Connect(this, aRetVal);
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::Device::Disconnect()
-{
- // No need to do anything when disconnect.
- return NS_OK;
-}
-
-NS_IMETHODIMP
-MulticastDNSDeviceProvider::Device::IsRequestedUrlSupported(
- const nsAString& aRequestedUrl,
- bool* aRetVal)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- if (!aRetVal) {
- return NS_ERROR_INVALID_POINTER;
- }
-
- // TV 2.6 also supports presentation Apps and HTTP/HTTPS hosted receiver page.
- if (DeviceProviderHelpers::IsFxTVSupportedAppUrl(aRequestedUrl) ||
- DeviceProviderHelpers::IsCommonlySupportedScheme(aRequestedUrl)) {
- *aRetVal = true;
- }
-
- return NS_OK;
-}
-
-} // namespace presentation
-} // namespace dom
-} // namespace mozilla
diff --git a/dom/presentation/provider/MulticastDNSDeviceProvider.h b/dom/presentation/provider/MulticastDNSDeviceProvider.h
deleted file mode 100644
index c6a91b3d8..000000000
--- a/dom/presentation/provider/MulticastDNSDeviceProvider.h
+++ /dev/null
@@ -1,225 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_dom_presentation_provider_MulticastDNSDeviceProvider_h
-#define mozilla_dom_presentation_provider_MulticastDNSDeviceProvider_h
-
-#include "mozilla/RefPtr.h"
-#include "nsCOMPtr.h"
-#include "nsICancelable.h"
-#include "nsIDNSServiceDiscovery.h"
-#include "nsIObserver.h"
-#include "nsIPresentationDevice.h"
-#include "nsIPresentationDeviceProvider.h"
-#include "nsIPresentationControlService.h"
-#include "nsITimer.h"
-#include "nsString.h"
-#include "nsTArray.h"
-#include "nsWeakPtr.h"
-
-class nsITCPDeviceInfo;
-
-namespace mozilla {
-namespace dom {
-namespace presentation {
-
-class DNSServiceWrappedListener;
-class MulticastDNSService;
-
-class MulticastDNSDeviceProvider final
- : public nsIPresentationDeviceProvider
- , public nsIDNSServiceDiscoveryListener
- , public nsIDNSRegistrationListener
- , public nsIDNSServiceResolveListener
- , public nsIPresentationControlServerListener
- , public nsIObserver
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONDEVICEPROVIDER
- NS_DECL_NSIDNSSERVICEDISCOVERYLISTENER
- NS_DECL_NSIDNSREGISTRATIONLISTENER
- NS_DECL_NSIDNSSERVICERESOLVELISTENER
- NS_DECL_NSIPRESENTATIONCONTROLSERVERLISTENER
- NS_DECL_NSIOBSERVER
-
- explicit MulticastDNSDeviceProvider() = default;
- nsresult Init();
- nsresult Uninit();
-
-private:
- enum class DeviceState : uint32_t {
- eUnknown,
- eActive
- };
-
- class Device final : public nsIPresentationDevice
- {
- public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIPRESENTATIONDEVICE
-
- explicit Device(const nsACString& aId,
- const nsACString& aName,
- const nsACString& aType,
- const nsACString& aAddress,
- const uint16_t aPort,
- const nsACString& aCertFingerprint,
- DeviceState aState,
- MulticastDNSDeviceProvider* aProvider)
- : mId(aId)
- , mName(aName)
- , mType(aType)
- , mAddress(aAddress)
- , mPort(aPort)
- , mCertFingerprint(aCertFingerprint)
- , mState(aState)
- , mProvider(aProvider)
- {
- }
-
- const nsCString& Id() const
- {
- return mId;
- }
-
- const nsCString& Address() const
- {
- return mAddress;
- }
-
- uint16_t Port() const
- {
- return mPort;
- }
-
- const nsCString& CertFingerprint() const
- {
- return mCertFingerprint;
- }
-
- DeviceState State() const
- {
- return mState;
- }
-
- void ChangeState(DeviceState aState)
- {
- mState = aState;
- }
-
- void Update(const nsACString& aName,
- const nsACString& aType,
- const nsACString& aAddress,
- const uint16_t aPort,
- const nsACString& aCertFingerprint)
- {
- mName = aName;
- mType = aType;
- mAddress = aAddress;
- mPort = aPort;
- mCertFingerprint = aCertFingerprint;
- }
-
- private:
- virtual ~Device() = default;
-
- nsCString mId;
- nsCString mName;
- nsCString mType;
- nsCString mAddress;
- uint16_t mPort;
- nsCString mCertFingerprint;
- DeviceState mState;
- MulticastDNSDeviceProvider* mProvider;
- };
-
- struct DeviceIdComparator {
- bool Equals(const RefPtr<Device>& aA, const RefPtr<Device>& aB) const {
- return aA->Id() == aB->Id();
- }
- };
-
- struct DeviceAddressComparator {
- bool Equals(const RefPtr<Device>& aA, const RefPtr<Device>& aB) const {
- return aA->Address() == aB->Address();
- }
- };
-
- virtual ~MulticastDNSDeviceProvider();
- nsresult StartServer();
- nsresult StopServer();
- void AbortServerRetry();
- nsresult RegisterMDNSService();
- nsresult UnregisterMDNSService(nsresult aReason);
- nsresult StopDiscovery(nsresult aReason);
- nsresult Connect(Device* aDevice,
- nsIPresentationControlChannel** aRetVal);
- bool IsCompatibleServer(nsIDNSServiceInfo* aServiceInfo);
-
- // device manipulation
- nsresult AddDevice(const nsACString& aId,
- const nsACString& aServiceName,
- const nsACString& aServiceType,
- const nsACString& aAddress,
- const uint16_t aPort,
- const nsACString& aCertFingerprint);
- nsresult UpdateDevice(const uint32_t aIndex,
- const nsACString& aServiceName,
- const nsACString& aServiceType,
- const nsACString& aAddress,
- const uint16_t aPort,
- const nsACString& aCertFingerprint);
- nsresult RemoveDevice(const uint32_t aIndex);
- bool FindDeviceById(const nsACString& aId,
- uint32_t& aIndex);
-
- bool FindDeviceByAddress(const nsACString& aAddress,
- uint32_t& aIndex);
-
- already_AddRefed<Device>
- GetOrCreateDevice(nsITCPDeviceInfo* aDeviceInfo);
-
- void MarkAllDevicesUnknown();
- void ClearUnknownDevices();
- void ClearDevices();
-
- // preferences
- nsresult OnDiscoveryChanged(bool aEnabled);
- nsresult OnDiscoveryTimeoutChanged(uint32_t aTimeoutMs);
- nsresult OnDiscoverableChanged(bool aEnabled);
- nsresult OnServiceNameChanged(const nsACString& aServiceName);
-
- bool mInitialized = false;
- nsWeakPtr mDeviceListener;
- nsCOMPtr<nsIPresentationControlService> mPresentationService;
- nsCOMPtr<nsIDNSServiceDiscovery> mMulticastDNS;
- RefPtr<DNSServiceWrappedListener> mWrappedListener;
-
- nsCOMPtr<nsICancelable> mDiscoveryRequest;
- nsCOMPtr<nsICancelable> mRegisterRequest;
-
- nsTArray<RefPtr<Device>> mDevices;
-
- bool mDiscoveryEnabled = false;
- bool mIsDiscovering = false;
- uint32_t mDiscoveryTimeoutMs;
- nsCOMPtr<nsITimer> mDiscoveryTimer;
-
- bool mDiscoverable = false;
- bool mDiscoverableEncrypted = false;
- bool mIsServerRetrying = false;
- uint32_t mServerRetryMs;
- nsCOMPtr<nsITimer> mServerRetryTimer;
-
- nsCString mServiceName;
- nsCString mRegisteredName;
-};
-
-} // namespace presentation
-} // namespace dom
-} // namespace mozilla
-
-#endif // mozilla_dom_presentation_provider_MulticastDNSDeviceProvider_h
diff --git a/dom/presentation/provider/PresentationControlService.js b/dom/presentation/provider/PresentationControlService.js
deleted file mode 100644
index e9f92247f..000000000
--- a/dom/presentation/provider/PresentationControlService.js
+++ /dev/null
@@ -1,960 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-/* jshint esnext:true, globalstrict:true, moz:true, undef:true, unused:true */
-/* globals Components, dump */
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-/* globals XPCOMUtils */
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-/* globals Services */
-Cu.import("resource://gre/modules/Services.jsm");
-/* globals NetUtil */
-Cu.import("resource://gre/modules/NetUtil.jsm");
-/* globals setTimeout, clearTimeout */
-Cu.import("resource://gre/modules/Timer.jsm");
-
-/* globals ControllerStateMachine */
-XPCOMUtils.defineLazyModuleGetter(this, "ControllerStateMachine", // jshint ignore:line
- "resource://gre/modules/presentation/ControllerStateMachine.jsm");
-/* global ReceiverStateMachine */
-XPCOMUtils.defineLazyModuleGetter(this, "ReceiverStateMachine", // jshint ignore:line
- "resource://gre/modules/presentation/ReceiverStateMachine.jsm");
-
-const kProtocolVersion = 1; // need to review isCompatibleServer while fiddling the version number.
-const kLocalCertName = "presentation";
-
-const DEBUG = Services.prefs.getBoolPref("dom.presentation.tcp_server.debug");
-function log(aMsg) {
- dump("-*- PresentationControlService.js: " + aMsg + "\n");
-}
-
-function TCPDeviceInfo(aAddress, aPort, aId, aCertFingerprint) {
- this.address = aAddress;
- this.port = aPort;
- this.id = aId;
- this.certFingerprint = aCertFingerprint || "";
-}
-
-function PresentationControlService() {
- this._id = null;
- this._port = 0;
- this._serverSocket = null;
-}
-
-PresentationControlService.prototype = {
- /**
- * If a user agent connects to this server, we create a control channel but
- * hand it to |TCPDevice.listener| when the initial information exchange
- * finishes. Therefore, we hold the control channels in this period.
- */
- _controlChannels: [],
-
- startServer: function(aEncrypted, aPort) {
- if (this._isServiceInit()) {
- DEBUG && log("PresentationControlService - server socket has been initialized"); // jshint ignore:line
- throw Cr.NS_ERROR_FAILURE;
- }
-
- /**
- * 0 or undefined indicates opt-out parameter, and a port will be selected
- * automatically.
- */
- let serverSocketPort = (typeof aPort !== "undefined" && aPort !== 0) ? aPort : -1;
-
- if (aEncrypted) {
- let self = this;
- let localCertService = Cc["@mozilla.org/security/local-cert-service;1"]
- .getService(Ci.nsILocalCertService);
- localCertService.getOrCreateCert(kLocalCertName, {
- handleCert: function(aCert, aRv) {
- DEBUG && log("PresentationControlService - handleCert"); // jshint ignore:line
- if (aRv) {
- self._notifyServerStopped(aRv);
- } else {
- self._serverSocket = Cc["@mozilla.org/network/tls-server-socket;1"]
- .createInstance(Ci.nsITLSServerSocket);
-
- self._serverSocketInit(serverSocketPort, aCert);
- }
- }
- });
- } else {
- this._serverSocket = Cc["@mozilla.org/network/server-socket;1"]
- .createInstance(Ci.nsIServerSocket);
-
- this._serverSocketInit(serverSocketPort, null);
- }
- },
-
- _serverSocketInit: function(aPort, aCert) {
- if (!this._serverSocket) {
- DEBUG && log("PresentationControlService - create server socket fail."); // jshint ignore:line
- throw Cr.NS_ERROR_FAILURE;
- }
-
- try {
- this._serverSocket.init(aPort, false, -1);
-
- if (aCert) {
- this._serverSocket.serverCert = aCert;
- this._serverSocket.setSessionTickets(false);
- let requestCert = Ci.nsITLSServerSocket.REQUEST_NEVER;
- this._serverSocket.setRequestClientCertificate(requestCert);
- }
-
- this._serverSocket.asyncListen(this);
- } catch (e) {
- // NS_ERROR_SOCKET_ADDRESS_IN_USE
- DEBUG && log("PresentationControlService - init server socket fail: " + e); // jshint ignore:line
- throw Cr.NS_ERROR_FAILURE;
- }
-
- this._port = this._serverSocket.port;
-
- DEBUG && log("PresentationControlService - service start on port: " + this._port); // jshint ignore:line
-
- // Monitor network interface change to restart server socket.
- Services.obs.addObserver(this, "network:offline-status-changed", false);
-
- this._notifyServerReady();
- },
-
- _notifyServerReady: function() {
- Services.tm.mainThread.dispatch(() => {
- if (this._listener) {
- this._listener.onServerReady(this._port, this.certFingerprint);
- }
- }, Ci.nsIThread.DISPATCH_NORMAL);
- },
-
- _notifyServerStopped: function(aRv) {
- Services.tm.mainThread.dispatch(() => {
- if (this._listener) {
- this._listener.onServerStopped(aRv);
- }
- }, Ci.nsIThread.DISPATCH_NORMAL);
- },
-
- isCompatibleServer: function(aVersion) {
- // No compatibility issue for the first version of control protocol
- return this.version === aVersion;
- },
-
- get id() {
- return this._id;
- },
-
- set id(aId) {
- this._id = aId;
- },
-
- get port() {
- return this._port;
- },
-
- get version() {
- return kProtocolVersion;
- },
-
- get certFingerprint() {
- if (!this._serverSocket.serverCert) {
- return null;
- }
-
- return this._serverSocket.serverCert.sha256Fingerprint;
- },
-
- set listener(aListener) {
- this._listener = aListener;
- },
-
- get listener() {
- return this._listener;
- },
-
- _isServiceInit: function() {
- return this._serverSocket !== null;
- },
-
- connect: function(aDeviceInfo) {
- if (!this.id) {
- DEBUG && log("PresentationControlService - Id has not initialized; connect fails"); // jshint ignore:line
- return null;
- }
- DEBUG && log("PresentationControlService - connect to " + aDeviceInfo.id); // jshint ignore:line
-
- let socketTransport = this._attemptConnect(aDeviceInfo);
- return new TCPControlChannel(this,
- socketTransport,
- aDeviceInfo,
- "sender");
- },
-
- _attemptConnect: function(aDeviceInfo) {
- let sts = Cc["@mozilla.org/network/socket-transport-service;1"]
- .getService(Ci.nsISocketTransportService);
-
- let socketTransport;
- try {
- if (aDeviceInfo.certFingerprint) {
- let overrideService = Cc["@mozilla.org/security/certoverride;1"]
- .getService(Ci.nsICertOverrideService);
- overrideService.rememberTemporaryValidityOverrideUsingFingerprint(
- aDeviceInfo.address,
- aDeviceInfo.port,
- aDeviceInfo.certFingerprint,
- Ci.nsICertOverrideService.ERROR_UNTRUSTED | Ci.nsICertOverrideService.ERROR_MISMATCH);
-
- socketTransport = sts.createTransport(["ssl"],
- 1,
- aDeviceInfo.address,
- aDeviceInfo.port,
- null);
- } else {
- socketTransport = sts.createTransport(null,
- 0,
- aDeviceInfo.address,
- aDeviceInfo.port,
- null);
- }
- // Shorten the connection failure procedure.
- socketTransport.setTimeout(Ci.nsISocketTransport.TIMEOUT_CONNECT, 2);
- } catch (e) {
- DEBUG && log("PresentationControlService - createTransport throws: " + e); // jshint ignore:line
- // Pop the exception to |TCPDevice.establishControlChannel|
- throw Cr.NS_ERROR_FAILURE;
- }
- return socketTransport;
- },
-
- responseSession: function(aDeviceInfo, aSocketTransport) {
- if (!this._isServiceInit()) {
- DEBUG && log("PresentationControlService - should never receive remote " +
- "session request before server socket initialization"); // jshint ignore:line
- return null;
- }
- DEBUG && log("PresentationControlService - responseSession to " +
- JSON.stringify(aDeviceInfo)); // jshint ignore:line
- return new TCPControlChannel(this,
- aSocketTransport,
- aDeviceInfo,
- "receiver");
- },
-
- // Triggered by TCPControlChannel
- onSessionRequest: function(aDeviceInfo, aUrl, aPresentationId, aControlChannel) {
- DEBUG && log("PresentationControlService - onSessionRequest: " +
- aDeviceInfo.address + ":" + aDeviceInfo.port); // jshint ignore:line
- if (!this.listener) {
- this.releaseControlChannel(aControlChannel);
- return;
- }
-
- this.listener.onSessionRequest(aDeviceInfo,
- aUrl,
- aPresentationId,
- aControlChannel);
- this.releaseControlChannel(aControlChannel);
- },
-
- onSessionTerminate: function(aDeviceInfo, aPresentationId, aControlChannel, aIsFromReceiver) {
- DEBUG && log("TCPPresentationServer - onSessionTerminate: " +
- aDeviceInfo.address + ":" + aDeviceInfo.port); // jshint ignore:line
- if (!this.listener) {
- this.releaseControlChannel(aControlChannel);
- return;
- }
-
- this.listener.onTerminateRequest(aDeviceInfo,
- aPresentationId,
- aControlChannel,
- aIsFromReceiver);
- this.releaseControlChannel(aControlChannel);
- },
-
- onSessionReconnect: function(aDeviceInfo, aUrl, aPresentationId, aControlChannel) {
- DEBUG && log("TCPPresentationServer - onSessionReconnect: " +
- aDeviceInfo.address + ":" + aDeviceInfo.port); // jshint ignore:line
- if (!this.listener) {
- this.releaseControlChannel(aControlChannel);
- return;
- }
-
- this.listener.onReconnectRequest(aDeviceInfo,
- aUrl,
- aPresentationId,
- aControlChannel);
- this.releaseControlChannel(aControlChannel);
- },
-
- // nsIServerSocketListener (Triggered by nsIServerSocket.init)
- onSocketAccepted: function(aServerSocket, aClientSocket) {
- DEBUG && log("PresentationControlService - onSocketAccepted: " +
- aClientSocket.host + ":" + aClientSocket.port); // jshint ignore:line
- let deviceInfo = new TCPDeviceInfo(aClientSocket.host, aClientSocket.port);
- this.holdControlChannel(this.responseSession(deviceInfo, aClientSocket));
- },
-
- holdControlChannel: function(aControlChannel) {
- this._controlChannels.push(aControlChannel);
- },
-
- releaseControlChannel: function(aControlChannel) {
- let index = this._controlChannels.indexOf(aControlChannel);
- if (index !== -1) {
- delete this._controlChannels[index];
- }
- },
-
- // nsIServerSocketListener (Triggered by nsIServerSocket.init)
- onStopListening: function(aServerSocket, aStatus) {
- DEBUG && log("PresentationControlService - onStopListening: " + aStatus); // jshint ignore:line
- },
-
- close: function() {
- DEBUG && log("PresentationControlService - close"); // jshint ignore:line
- if (this._isServiceInit()) {
- DEBUG && log("PresentationControlService - close server socket"); // jshint ignore:line
- this._serverSocket.close();
- this._serverSocket = null;
-
- Services.obs.removeObserver(this, "network:offline-status-changed");
-
- this._notifyServerStopped(Cr.NS_OK);
- }
- this._port = 0;
- },
-
- // nsIObserver
- observe: function(aSubject, aTopic, aData) {
- DEBUG && log("PresentationControlService - observe: " + aTopic); // jshint ignore:line
- switch (aTopic) {
- case "network:offline-status-changed": {
- if (aData == "offline") {
- DEBUG && log("network offline"); // jshint ignore:line
- return;
- }
- this._restartServer();
- break;
- }
- }
- },
-
- _restartServer: function() {
- DEBUG && log("PresentationControlService - restart service"); // jshint ignore:line
-
- // restart server socket
- if (this._isServiceInit()) {
- this.close();
-
- try {
- this.startServer();
- } catch (e) {
- DEBUG && log("PresentationControlService - restart service fail: " + e); // jshint ignore:line
- }
- }
- },
-
- classID: Components.ID("{f4079b8b-ede5-4b90-a112-5b415a931deb}"),
- QueryInterface : XPCOMUtils.generateQI([Ci.nsIServerSocketListener,
- Ci.nsIPresentationControlService,
- Ci.nsIObserver]),
-};
-
-function ChannelDescription(aInit) {
- this._type = aInit.type;
- switch (this._type) {
- case Ci.nsIPresentationChannelDescription.TYPE_TCP:
- this._tcpAddresses = Cc["@mozilla.org/array;1"]
- .createInstance(Ci.nsIMutableArray);
- for (let address of aInit.tcpAddress) {
- let wrapper = Cc["@mozilla.org/supports-cstring;1"]
- .createInstance(Ci.nsISupportsCString);
- wrapper.data = address;
- this._tcpAddresses.appendElement(wrapper, false);
- }
-
- this._tcpPort = aInit.tcpPort;
- break;
- case Ci.nsIPresentationChannelDescription.TYPE_DATACHANNEL:
- this._dataChannelSDP = aInit.dataChannelSDP;
- break;
- }
-}
-
-ChannelDescription.prototype = {
- _type: 0,
- _tcpAddresses: null,
- _tcpPort: 0,
- _dataChannelSDP: "",
-
- get type() {
- return this._type;
- },
-
- get tcpAddress() {
- return this._tcpAddresses;
- },
-
- get tcpPort() {
- return this._tcpPort;
- },
-
- get dataChannelSDP() {
- return this._dataChannelSDP;
- },
-
- classID: Components.ID("{82507aea-78a2-487e-904a-858a6c5bf4e1}"),
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationChannelDescription]),
-};
-
-// Helper function: transfer nsIPresentationChannelDescription to json
-function discriptionAsJson(aDescription) {
- let json = {};
- json.type = aDescription.type;
- switch(aDescription.type) {
- case Ci.nsIPresentationChannelDescription.TYPE_TCP:
- let addresses = aDescription.tcpAddress.QueryInterface(Ci.nsIArray);
- json.tcpAddress = [];
- for (let idx = 0; idx < addresses.length; idx++) {
- let address = addresses.queryElementAt(idx, Ci.nsISupportsCString);
- json.tcpAddress.push(address.data);
- }
- json.tcpPort = aDescription.tcpPort;
- break;
- case Ci.nsIPresentationChannelDescription.TYPE_DATACHANNEL:
- json.dataChannelSDP = aDescription.dataChannelSDP;
- break;
- }
- return json;
-}
-
-const kDisconnectTimeout = 5000;
-const kTerminateTimeout = 5000;
-
-function TCPControlChannel(presentationService,
- transport,
- deviceInfo,
- direction) {
- DEBUG && log("create TCPControlChannel for : " + direction); // jshint ignore:line
- this._deviceInfo = deviceInfo;
- this._direction = direction;
- this._transport = transport;
-
- this._presentationService = presentationService;
-
- if (direction === "receiver") {
- // Need to set security observer before I/O stream operation.
- this._setSecurityObserver(this);
- }
-
- let currentThread = Services.tm.currentThread;
- transport.setEventSink(this, currentThread);
-
- this._input = this._transport.openInputStream(0, 0, 0)
- .QueryInterface(Ci.nsIAsyncInputStream);
- this._input.asyncWait(this.QueryInterface(Ci.nsIStreamListener),
- Ci.nsIAsyncInputStream.WAIT_CLOSURE_ONLY,
- 0,
- currentThread);
-
- this._output = this._transport
- .openOutputStream(Ci.nsITransport.OPEN_UNBUFFERED, 0, 0)
- .QueryInterface(Ci.nsIAsyncOutputStream);
-
- this._outgoingMsgs = [];
-
-
- this._stateMachine =
- (direction === "sender") ? new ControllerStateMachine(this, presentationService.id)
- : new ReceiverStateMachine(this);
-
- if (direction === "receiver" && !transport.securityInfo) {
- // Since the transport created by server socket is already CONNECTED_TO.
- this._outgoingEnabled = true;
- this._createInputStreamPump();
- }
-}
-
-TCPControlChannel.prototype = {
- _outgoingEnabled: false,
- _incomingEnabled: false,
- _pendingOpen: false,
- _pendingOffer: null,
- _pendingAnswer: null,
- _pendingClose: null,
- _pendingCloseReason: null,
- _pendingReconnect: false,
-
- sendOffer: function(aOffer) {
- this._stateMachine.sendOffer(discriptionAsJson(aOffer));
- },
-
- sendAnswer: function(aAnswer) {
- this._stateMachine.sendAnswer(discriptionAsJson(aAnswer));
- },
-
- sendIceCandidate: function(aCandidate) {
- this._stateMachine.updateIceCandidate(aCandidate);
- },
-
- launch: function(aPresentationId, aUrl) {
- this._stateMachine.launch(aPresentationId, aUrl);
- },
-
- terminate: function(aPresentationId) {
- if (!this._terminatingId) {
- this._terminatingId = aPresentationId;
- this._stateMachine.terminate(aPresentationId);
-
- // Start a guard timer to ensure terminateAck is processed.
- this._terminateTimer = setTimeout(() => {
- DEBUG && log("TCPControlChannel - terminate timeout: " + aPresentationId); // jshint ignore:line
- delete this._terminateTimer;
- if (this._pendingDisconnect) {
- this._pendingDisconnect();
- } else {
- this.disconnect(Cr.NS_OK);
- }
- }, kTerminateTimeout);
- } else {
- this._stateMachine.terminateAck(aPresentationId);
- delete this._terminatingId;
- }
- },
-
- _flushOutgoing: function() {
- if (!this._outgoingEnabled || this._outgoingMsgs.length === 0) {
- return;
- }
-
- this._output.asyncWait(this, 0, 0, Services.tm.currentThread);
- },
-
- // may throw an exception
- _send: function(aMsg) {
- DEBUG && log("TCPControlChannel - Send: " + JSON.stringify(aMsg, null, 2)); // jshint ignore:line
-
- /**
- * XXX In TCP streaming, it is possible that more than one message in one
- * TCP packet. We use line delimited JSON to identify where one JSON encoded
- * object ends and the next begins. Therefore, we do not allow newline
- * characters whithin the whole message, and add a newline at the end.
- * Please see the parser code in |onDataAvailable|.
- */
- let message = JSON.stringify(aMsg).replace(["\n"], "") + "\n";
- try {
- this._output.write(message, message.length);
- } catch(e) {
- DEBUG && log("TCPControlChannel - Failed to send message: " + e.name); // jshint ignore:line
- throw e;
- }
- },
-
- _setSecurityObserver: function(observer) {
- if (this._transport && this._transport.securityInfo) {
- DEBUG && log("TCPControlChannel - setSecurityObserver: " + observer); // jshint ignore:line
- let connectionInfo = this._transport.securityInfo
- .QueryInterface(Ci.nsITLSServerConnectionInfo);
- connectionInfo.setSecurityObserver(observer);
- }
- },
-
- // nsITLSServerSecurityObserver
- onHandshakeDone: function(socket, clientStatus) {
- log("TCPControlChannel - onHandshakeDone: TLS version: " + clientStatus.tlsVersionUsed.toString(16));
- this._setSecurityObserver(null);
-
- // Process input/output after TLS handshake is complete.
- this._outgoingEnabled = true;
- this._createInputStreamPump();
- },
-
- // nsIAsyncOutputStream
- onOutputStreamReady: function() {
- DEBUG && log("TCPControlChannel - onOutputStreamReady"); // jshint ignore:line
- if (this._outgoingMsgs.length === 0) {
- return;
- }
-
- try {
- this._send(this._outgoingMsgs[0]);
- } catch (e) {
- if (e.result === Cr.NS_BASE_STREAM_WOULD_BLOCK) {
- this._output.asyncWait(this, 0, 0, Services.tm.currentThread);
- return;
- }
-
- this._closeTransport();
- return;
- }
- this._outgoingMsgs.shift();
- this._flushOutgoing();
- },
-
- // nsIAsyncInputStream (Triggered by nsIInputStream.asyncWait)
- // Only used for detecting connection refused
- onInputStreamReady: function(aStream) {
- DEBUG && log("TCPControlChannel - onInputStreamReady"); // jshint ignore:line
- try {
- aStream.available();
- } catch (e) {
- DEBUG && log("TCPControlChannel - onInputStreamReady error: " + e.name); // jshint ignore:line
- // NS_ERROR_CONNECTION_REFUSED
- this._notifyDisconnected(e.result);
- }
- },
-
- // nsITransportEventSink (Triggered by nsISocketTransport.setEventSink)
- onTransportStatus: function(aTransport, aStatus) {
- DEBUG && log("TCPControlChannel - onTransportStatus: " + aStatus.toString(16) +
- " with role: " + this._direction); // jshint ignore:line
- if (aStatus === Ci.nsISocketTransport.STATUS_CONNECTED_TO) {
- this._outgoingEnabled = true;
- this._createInputStreamPump();
- }
- },
-
- // nsIRequestObserver (Triggered by nsIInputStreamPump.asyncRead)
- onStartRequest: function() {
- DEBUG && log("TCPControlChannel - onStartRequest with role: " +
- this._direction); // jshint ignore:line
- this._incomingEnabled = true;
- },
-
- // nsIRequestObserver (Triggered by nsIInputStreamPump.asyncRead)
- onStopRequest: function(aRequest, aContext, aStatus) {
- DEBUG && log("TCPControlChannel - onStopRequest: " + aStatus +
- " with role: " + this._direction); // jshint ignore:line
- this._stateMachine.onChannelClosed(aStatus, true);
- },
-
- // nsIStreamListener (Triggered by nsIInputStreamPump.asyncRead)
- onDataAvailable: function(aRequest, aContext, aInputStream) {
- let data = NetUtil.readInputStreamToString(aInputStream,
- aInputStream.available());
- DEBUG && log("TCPControlChannel - onDataAvailable: " + data); // jshint ignore:line
-
- // Parser of line delimited JSON. Please see |_send| for more informaiton.
- let jsonArray = data.split("\n");
- jsonArray.pop();
- for (let json of jsonArray) {
- let msg;
- try {
- msg = JSON.parse(json);
- } catch (e) {
- DEBUG && log("TCPSignalingChannel - error in parsing json: " + e); // jshint ignore:line
- }
-
- this._handleMessage(msg);
- }
- },
-
- _createInputStreamPump: function() {
- if (this._pump) {
- return;
- }
-
- DEBUG && log("TCPControlChannel - create pump with role: " +
- this._direction); // jshint ignore:line
- this._pump = Cc["@mozilla.org/network/input-stream-pump;1"].
- createInstance(Ci.nsIInputStreamPump);
- this._pump.init(this._input, -1, -1, 0, 0, false);
- this._pump.asyncRead(this, null);
- this._stateMachine.onChannelReady();
- },
-
- // Handle command from remote side
- _handleMessage: function(aMsg) {
- DEBUG && log("TCPControlChannel - handleMessage from " +
- JSON.stringify(this._deviceInfo) + ": " + JSON.stringify(aMsg)); // jshint ignore:line
- this._stateMachine.onCommand(aMsg);
- },
-
- get listener() {
- return this._listener;
- },
-
- set listener(aListener) {
- DEBUG && log("TCPControlChannel - set listener: " + aListener); // jshint ignore:line
- if (!aListener) {
- this._listener = null;
- return;
- }
-
- this._listener = aListener;
- if (this._pendingOpen) {
- this._pendingOpen = false;
- DEBUG && log("TCPControlChannel - notify pending opened"); // jshint ignore:line
- this._listener.notifyConnected();
- }
-
- if (this._pendingOffer) {
- let offer = this._pendingOffer;
- DEBUG && log("TCPControlChannel - notify pending offer: " +
- JSON.stringify(offer)); // jshint ignore:line
- this._listener.onOffer(new ChannelDescription(offer));
- this._pendingOffer = null;
- }
-
- if (this._pendingAnswer) {
- let answer = this._pendingAnswer;
- DEBUG && log("TCPControlChannel - notify pending answer: " +
- JSON.stringify(answer)); // jshint ignore:line
- this._listener.onAnswer(new ChannelDescription(answer));
- this._pendingAnswer = null;
- }
-
- if (this._pendingClose) {
- DEBUG && log("TCPControlChannel - notify pending closed"); // jshint ignore:line
- this._notifyDisconnected(this._pendingCloseReason);
- this._pendingClose = null;
- }
-
- if (this._pendingReconnect) {
- DEBUG && log("TCPControlChannel - notify pending reconnected"); // jshint ignore:line
- this._notifyReconnected();
- this._pendingReconnect = false;
- }
- },
-
- /**
- * These functions are designed to handle the interaction with listener
- * appropriately. |_FUNC| is to handle |this._listener.FUNC|.
- */
- _onOffer: function(aOffer) {
- if (!this._incomingEnabled) {
- return;
- }
- if (!this._listener) {
- this._pendingOffer = aOffer;
- return;
- }
- DEBUG && log("TCPControlChannel - notify offer: " +
- JSON.stringify(aOffer)); // jshint ignore:line
- this._listener.onOffer(new ChannelDescription(aOffer));
- },
-
- _onAnswer: function(aAnswer) {
- if (!this._incomingEnabled) {
- return;
- }
- if (!this._listener) {
- this._pendingAnswer = aAnswer;
- return;
- }
- DEBUG && log("TCPControlChannel - notify answer: " +
- JSON.stringify(aAnswer)); // jshint ignore:line
- this._listener.onAnswer(new ChannelDescription(aAnswer));
- },
-
- _notifyConnected: function() {
- this._pendingClose = false;
- this._pendingCloseReason = Cr.NS_OK;
-
- if (!this._listener) {
- this._pendingOpen = true;
- return;
- }
-
- DEBUG && log("TCPControlChannel - notify opened with role: " +
- this._direction); // jshint ignore:line
- this._listener.notifyConnected();
- },
-
- _notifyDisconnected: function(aReason) {
- this._pendingOpen = false;
- this._pendingOffer = null;
- this._pendingAnswer = null;
-
- // Remote endpoint closes the control channel with abnormal reason.
- if (aReason == Cr.NS_OK && this._pendingCloseReason != Cr.NS_OK) {
- aReason = this._pendingCloseReason;
- }
-
- if (!this._listener) {
- this._pendingClose = true;
- this._pendingCloseReason = aReason;
- return;
- }
-
- DEBUG && log("TCPControlChannel - notify closed with role: " +
- this._direction); // jshint ignore:line
- this._listener.notifyDisconnected(aReason);
- },
-
- _notifyReconnected: function() {
- if (!this._listener) {
- this._pendingReconnect = true;
- return;
- }
-
- DEBUG && log("TCPControlChannel - notify reconnected with role: " +
- this._direction); // jshint ignore:line
- this._listener.notifyReconnected();
- },
-
- _closeOutgoing: function() {
- if (this._outgoingEnabled) {
- this._output.close();
- this._outgoingEnabled = false;
- }
- },
- _closeIncoming: function() {
- if (this._incomingEnabled) {
- this._pump = null;
- this._input.close();
- this._incomingEnabled = false;
- }
- },
- _closeTransport: function() {
- if (this._disconnectTimer) {
- clearTimeout(this._disconnectTimer);
- delete this._disconnectTimer;
- }
-
- if (this._terminateTimer) {
- clearTimeout(this._terminateTimer);
- delete this._terminateTimer;
- }
-
- delete this._pendingDisconnect;
-
- this._transport.setEventSink(null, null);
-
- this._closeIncoming();
- this._closeOutgoing();
- this._presentationService.releaseControlChannel(this);
- },
-
- disconnect: function(aReason) {
- DEBUG && log("TCPControlChannel - disconnect with reason: " + aReason); // jshint ignore:line
-
- // Pending disconnect during termination procedure.
- if (this._terminateTimer) {
- // Store only the first disconnect action.
- if (!this._pendingDisconnect) {
- this._pendingDisconnect = this.disconnect.bind(this, aReason);
- }
- return;
- }
-
- if (this._outgoingEnabled && !this._disconnectTimer) {
- // default reason is NS_OK
- aReason = !aReason ? Cr.NS_OK : aReason;
-
- this._stateMachine.onChannelClosed(aReason, false);
-
- // Start a guard timer to ensure the transport will be closed.
- this._disconnectTimer = setTimeout(() => {
- DEBUG && log("TCPControlChannel - disconnect timeout"); // jshint ignore:line
- this._closeTransport();
- }, kDisconnectTimeout);
- }
- },
-
- reconnect: function(aPresentationId, aUrl) {
- DEBUG && log("TCPControlChannel - reconnect with role: " +
- this._direction); // jshint ignore:line
- if (this._direction != "sender") {
- return Cr.NS_ERROR_FAILURE;
- }
-
- this._stateMachine.reconnect(aPresentationId, aUrl);
- },
-
- // callback from state machine
- sendCommand: function(command) {
- this._outgoingMsgs.push(command);
- this._flushOutgoing();
- },
-
- notifyDeviceConnected: function(deviceId) {
- switch (this._direction) {
- case "receiver":
- this._deviceInfo.id = deviceId;
- break;
- }
- this._notifyConnected();
- },
-
- notifyDisconnected: function(reason) {
- this._closeTransport();
- this._notifyDisconnected(reason);
- },
-
- notifyLaunch: function(presentationId, url) {
- switch (this._direction) {
- case "receiver":
- this._presentationService.onSessionRequest(this._deviceInfo,
- url,
- presentationId,
- this);
- break;
- }
- },
-
- notifyTerminate: function(presentationId) {
- if (!this._terminatingId) {
- this._terminatingId = presentationId;
- this._presentationService.onSessionTerminate(this._deviceInfo,
- presentationId,
- this,
- this._direction === "sender");
- return;
- }
-
- // Cancel terminate guard timer after receiving terminate-ack.
- if (this._terminateTimer) {
- clearTimeout(this._terminateTimer);
- delete this._terminateTimer;
- }
-
- if (this._terminatingId !== presentationId) {
- // Requested presentation Id doesn't matched with the one in ACK.
- // Disconnect the control channel with error.
- DEBUG && log("TCPControlChannel - unmatched terminatingId: " + presentationId); // jshint ignore:line
- this.disconnect(Cr.NS_ERROR_FAILURE);
- }
-
- delete this._terminatingId;
- if (this._pendingDisconnect) {
- this._pendingDisconnect();
- }
- },
-
- notifyReconnect: function(presentationId, url) {
- switch (this._direction) {
- case "receiver":
- this._presentationService.onSessionReconnect(this._deviceInfo,
- url,
- presentationId,
- this);
- break;
- case "sender":
- this._notifyReconnected();
- break;
- }
- },
-
- notifyOffer: function(offer) {
- this._onOffer(offer);
- },
-
- notifyAnswer: function(answer) {
- this._onAnswer(answer);
- },
-
- notifyIceCandidate: function(candidate) {
- this._listener.onIceCandidate(candidate);
- },
-
- classID: Components.ID("{fefb8286-0bdc-488b-98bf-0c11b485c955}"),
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannel,
- Ci.nsIStreamListener]),
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([PresentationControlService]); // jshint ignore:line
diff --git a/dom/presentation/provider/PresentationDeviceProviderModule.cpp b/dom/presentation/provider/PresentationDeviceProviderModule.cpp
deleted file mode 100644
index 9c084e7db..000000000
--- a/dom/presentation/provider/PresentationDeviceProviderModule.cpp
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "DisplayDeviceProvider.h"
-#include "MulticastDNSDeviceProvider.h"
-#include "mozilla/ModuleUtils.h"
-
-#ifdef MOZ_WIDGET_ANDROID
-#include "LegacyMDNSDeviceProvider.h"
-#endif //MOZ_WIDGET_ANDROID
-
-#define MULTICAST_DNS_PROVIDER_CID \
- {0x814f947a, 0x52f7, 0x41c9, \
- { 0x94, 0xa1, 0x36, 0x84, 0x79, 0x72, 0x84, 0xac }}
-#define DISPLAY_DEVICE_PROVIDER_CID \
- { 0x515d9879, 0xfe0b, 0x4d9f, \
- { 0x89, 0x49, 0x7f, 0xa7, 0x65, 0x6c, 0x01, 0x0e } }
-
-#ifdef MOZ_WIDGET_ANDROID
-#define LEGACY_MDNS_PROVIDER_CID \
- { 0x6885ff39, 0xd98c, 0x4356, \
- { 0x9e, 0xb3, 0x56, 0x56, 0x31, 0x63, 0x0a, 0xf6 } }
-#endif //MOZ_WIDGET_ANDROID
-
-#define DISPLAY_DEVICE_PROVIDER_CONTRACT_ID "@mozilla.org/presentation-device/displaydevice-provider;1"
-#define MULTICAST_DNS_PROVIDER_CONTRACT_ID "@mozilla.org/presentation-device/multicastdns-provider;1"
-
-#ifdef MOZ_WIDGET_ANDROID
-#define LEGACY_MDNS_PROVIDER_CONTRACT_ID "@mozilla.org/presentation-device/legacy-mdns-provider;1"
-#endif //MOZ_WIDGET_ANDROID
-
-using mozilla::dom::presentation::MulticastDNSDeviceProvider;
-using mozilla::dom::presentation::DisplayDeviceProvider;
-
-#ifdef MOZ_WIDGET_ANDROID
-using mozilla::dom::presentation::legacy::LegacyMDNSDeviceProvider;
-#endif //MOZ_WIDGET_ANDROID
-
-NS_GENERIC_FACTORY_CONSTRUCTOR(MulticastDNSDeviceProvider)
-NS_DEFINE_NAMED_CID(MULTICAST_DNS_PROVIDER_CID);
-
-NS_GENERIC_FACTORY_CONSTRUCTOR(DisplayDeviceProvider)
-NS_DEFINE_NAMED_CID(DISPLAY_DEVICE_PROVIDER_CID);
-
-#ifdef MOZ_WIDGET_ANDROID
-NS_GENERIC_FACTORY_CONSTRUCTOR(LegacyMDNSDeviceProvider)
-NS_DEFINE_NAMED_CID(LEGACY_MDNS_PROVIDER_CID);
-#endif //MOZ_WIDGET_ANDROID
-
-static const mozilla::Module::CIDEntry kPresentationDeviceProviderCIDs[] = {
- { &kMULTICAST_DNS_PROVIDER_CID, false, nullptr, MulticastDNSDeviceProviderConstructor },
- { &kDISPLAY_DEVICE_PROVIDER_CID, false, nullptr, DisplayDeviceProviderConstructor },
-#ifdef MOZ_WIDGET_ANDROID
- { &kLEGACY_MDNS_PROVIDER_CID, false, nullptr, LegacyMDNSDeviceProviderConstructor },
-#endif //MOZ_WIDGET_ANDROID
- { nullptr }
-};
-
-static const mozilla::Module::ContractIDEntry kPresentationDeviceProviderContracts[] = {
- { MULTICAST_DNS_PROVIDER_CONTRACT_ID, &kMULTICAST_DNS_PROVIDER_CID },
- { DISPLAY_DEVICE_PROVIDER_CONTRACT_ID, &kDISPLAY_DEVICE_PROVIDER_CID },
-#ifdef MOZ_WIDGET_ANDROID
- { LEGACY_MDNS_PROVIDER_CONTRACT_ID, &kLEGACY_MDNS_PROVIDER_CID },
-#endif //MOZ_WIDGET_ANDROID
- { nullptr }
-};
-
-static const mozilla::Module::CategoryEntry kPresentationDeviceProviderCategories[] = {
-#if defined(MOZ_WIDGET_COCOA) || defined(MOZ_WIDGET_ANDROID)
- { PRESENTATION_DEVICE_PROVIDER_CATEGORY, "MulticastDNSDeviceProvider", MULTICAST_DNS_PROVIDER_CONTRACT_ID },
-#endif
-#ifdef MOZ_WIDGET_ANDROID
- { PRESENTATION_DEVICE_PROVIDER_CATEGORY, "LegacyMDNSDeviceProvider", LEGACY_MDNS_PROVIDER_CONTRACT_ID },
-#endif //MOZ_WIDGET_ANDROID
- { nullptr }
-};
-
-static const mozilla::Module kPresentationDeviceProviderModule = {
- mozilla::Module::kVersion,
- kPresentationDeviceProviderCIDs,
- kPresentationDeviceProviderContracts,
- kPresentationDeviceProviderCategories
-};
-
-NSMODULE_DEFN(PresentationDeviceProviderModule) = &kPresentationDeviceProviderModule;
diff --git a/dom/presentation/provider/ReceiverStateMachine.jsm b/dom/presentation/provider/ReceiverStateMachine.jsm
deleted file mode 100644
index 23ebb5a4e..000000000
--- a/dom/presentation/provider/ReceiverStateMachine.jsm
+++ /dev/null
@@ -1,238 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-/* jshint esnext:true, globalstrict:true, moz:true, undef:true, unused:true */
-/* globals Components, dump */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["ReceiverStateMachine"]; // jshint ignore:line
-
-const { utils: Cu } = Components;
-
-/* globals State, CommandType */
-Cu.import("resource://gre/modules/presentation/StateMachineHelper.jsm");
-
-const DEBUG = false;
-function debug(str) {
- dump("-*- ReceiverStateMachine: " + str + "\n");
-}
-
-var handlers = [
- function _initHandler(stateMachine, command) {
- // shouldn't receive any command at init state
- DEBUG && debug("unexpected command: " + JSON.stringify(command)); // jshint ignore:line
- },
- function _connectingHandler(stateMachine, command) {
- switch (command.type) {
- case CommandType.CONNECT:
- stateMachine._sendCommand({
- type: CommandType.CONNECT_ACK
- });
- stateMachine.state = State.CONNECTED;
- stateMachine._notifyDeviceConnected(command.deviceId);
- break;
- case CommandType.DISCONNECT:
- stateMachine.state = State.CLOSED;
- stateMachine._notifyDisconnected(command.reason);
- break;
- default:
- debug("unexpected command: " + JSON.stringify(command));
- // ignore unexpected command
- break;
- }
- },
- function _connectedHandler(stateMachine, command) {
- switch (command.type) {
- case CommandType.DISCONNECT:
- stateMachine.state = State.CLOSED;
- stateMachine._notifyDisconnected(command.reason);
- break;
- case CommandType.LAUNCH:
- stateMachine._notifyLaunch(command.presentationId,
- command.url);
- stateMachine._sendCommand({
- type: CommandType.LAUNCH_ACK,
- presentationId: command.presentationId
- });
- break;
- case CommandType.TERMINATE:
- stateMachine._notifyTerminate(command.presentationId);
- break;
- case CommandType.TERMINATE_ACK:
- stateMachine._notifyTerminate(command.presentationId);
- break;
- case CommandType.OFFER:
- case CommandType.ICE_CANDIDATE:
- stateMachine._notifyChannelDescriptor(command);
- break;
- case CommandType.RECONNECT:
- stateMachine._notifyReconnect(command.presentationId,
- command.url);
- stateMachine._sendCommand({
- type: CommandType.RECONNECT_ACK,
- presentationId: command.presentationId
- });
- break;
- default:
- debug("unexpected command: " + JSON.stringify(command));
- // ignore unexpected command
- break;
- }
- },
- function _closingHandler(stateMachine, command) {
- switch (command.type) {
- case CommandType.DISCONNECT:
- stateMachine.state = State.CLOSED;
- stateMachine._notifyDisconnected(command.reason);
- break;
- default:
- debug("unexpected command: " + JSON.stringify(command));
- // ignore unexpected command
- break;
- }
- },
- function _closedHandler(stateMachine, command) {
- // ignore every command in closed state.
- DEBUG && debug("unexpected command: " + JSON.stringify(command)); // jshint ignore:line
- },
-];
-
-function ReceiverStateMachine(channel) {
- this.state = State.INIT;
- this._channel = channel;
-}
-
-ReceiverStateMachine.prototype = {
- launch: function _launch() {
- // presentation session can only be launched by controlling UA.
- debug("receiver shouldn't trigger launch");
- },
-
- terminate: function _terminate(presentationId) {
- if (this.state === State.CONNECTED) {
- this._sendCommand({
- type: CommandType.TERMINATE,
- presentationId: presentationId,
- });
- }
- },
-
- terminateAck: function _terminateAck(presentationId) {
- if (this.state === State.CONNECTED) {
- this._sendCommand({
- type: CommandType.TERMINATE_ACK,
- presentationId: presentationId,
- });
- }
- },
-
- reconnect: function _reconnect() {
- debug("receiver shouldn't trigger reconnect");
- },
-
- sendOffer: function _sendOffer() {
- // offer can only be sent by controlling UA.
- debug("receiver shouldn't generate offer");
- },
-
- sendAnswer: function _sendAnswer(answer) {
- if (this.state === State.CONNECTED) {
- this._sendCommand({
- type: CommandType.ANSWER,
- answer: answer,
- });
- }
- },
-
- updateIceCandidate: function _updateIceCandidate(candidate) {
- if (this.state === State.CONNECTED) {
- this._sendCommand({
- type: CommandType.ICE_CANDIDATE,
- candidate: candidate,
- });
- }
- },
-
- onCommand: function _onCommand(command) {
- handlers[this.state](this, command);
- },
-
- onChannelReady: function _onChannelReady() {
- if (this.state === State.INIT) {
- this.state = State.CONNECTING;
- }
- },
-
- onChannelClosed: function _onChannelClose(reason, isByRemote) {
- switch (this.state) {
- case State.CONNECTED:
- if (isByRemote) {
- this.state = State.CLOSED;
- this._notifyDisconnected(reason);
- } else {
- this._sendCommand({
- type: CommandType.DISCONNECT,
- reason: reason
- });
- this.state = State.CLOSING;
- this._closeReason = reason;
- }
- break;
- case State.CLOSING:
- if (isByRemote) {
- this.state = State.CLOSED;
- if (this._closeReason) {
- reason = this._closeReason;
- delete this._closeReason;
- }
- this._notifyDisconnected(reason);
- } else {
- // do nothing and wait for remote channel closed.
- }
- break;
- default:
- DEBUG && debug("unexpected channel close: " + reason + ", " + isByRemote); // jshint ignore:line
- break;
- }
- },
-
- _sendCommand: function _sendCommand(command) {
- this._channel.sendCommand(command);
- },
-
- _notifyDeviceConnected: function _notifyDeviceConnected(deviceName) {
- this._channel.notifyDeviceConnected(deviceName);
- },
-
- _notifyDisconnected: function _notifyDisconnected(reason) {
- this._channel.notifyDisconnected(reason);
- },
-
- _notifyLaunch: function _notifyLaunch(presentationId, url) {
- this._channel.notifyLaunch(presentationId, url);
- },
-
- _notifyTerminate: function _notifyTerminate(presentationId) {
- this._channel.notifyTerminate(presentationId);
- },
-
- _notifyReconnect: function _notifyReconnect(presentationId, url) {
- this._channel.notifyReconnect(presentationId, url);
- },
-
- _notifyChannelDescriptor: function _notifyChannelDescriptor(command) {
- switch (command.type) {
- case CommandType.OFFER:
- this._channel.notifyOffer(command.offer);
- break;
- case CommandType.ICE_CANDIDATE:
- this._channel.notifyIceCandidate(command.candidate);
- break;
- }
- },
-};
-
-this.ReceiverStateMachine = ReceiverStateMachine; // jshint ignore:line
diff --git a/dom/presentation/provider/StateMachineHelper.jsm b/dom/presentation/provider/StateMachineHelper.jsm
deleted file mode 100644
index 6e07863d4..000000000
--- a/dom/presentation/provider/StateMachineHelper.jsm
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-/* jshint esnext:true, globalstrict:true, moz:true, undef:true, unused:true */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["State", "CommandType"]; // jshint ignore:line
-
-const State = Object.freeze({
- INIT: 0,
- CONNECTING: 1,
- CONNECTED: 2,
- CLOSING: 3,
- CLOSED: 4,
-});
-
-const CommandType = Object.freeze({
- // control channel life cycle
- CONNECT: "connect", // { deviceId: <string> }
- CONNECT_ACK: "connect-ack", // { presentationId: <string> }
- DISCONNECT: "disconnect", // { reason: <int> }
- // presentation session life cycle
- LAUNCH: "launch", // { presentationId: <string>, url: <string> }
- LAUNCH_ACK: "launch-ack", // { presentationId: <string> }
- TERMINATE: "terminate", // { presentationId: <string> }
- TERMINATE_ACK: "terminate-ack", // { presentationId: <string> }
- RECONNECT: "reconnect", // { presentationId: <string> }
- RECONNECT_ACK: "reconnect-ack", // { presentationId: <string> }
- // session transport establishment
- OFFER: "offer", // { offer: <json> }
- ANSWER: "answer", // { answer: <json> }
- ICE_CANDIDATE: "ice-candidate", // { candidate: <string> }
-});
-
-this.State = State; // jshint ignore:line
-this.CommandType = CommandType; // jshint ignore:line
diff --git a/dom/presentation/provider/moz.build b/dom/presentation/provider/moz.build
deleted file mode 100644
index 18428b50e..000000000
--- a/dom/presentation/provider/moz.build
+++ /dev/null
@@ -1,40 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXTRA_COMPONENTS += [
- 'BuiltinProviders.manifest',
- 'PresentationControlService.js'
-]
-
-UNIFIED_SOURCES += [
- 'DeviceProviderHelpers.cpp',
- 'DisplayDeviceProvider.cpp',
- 'MulticastDNSDeviceProvider.cpp',
- 'PresentationDeviceProviderModule.cpp',
-]
-
-EXTRA_JS_MODULES.presentation += [
- 'ControllerStateMachine.jsm',
- 'ReceiverStateMachine.jsm',
- 'StateMachineHelper.jsm',
-]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- EXTRA_COMPONENTS += [
- # For android presentation device
- 'AndroidCastDeviceProvider.js',
- 'AndroidCastDeviceProvider.manifest',
- # for TV 2.5 device backward capability
- 'LegacyPresentationControlService.js',
- 'LegacyProviders.manifest',
- ]
-
- UNIFIED_SOURCES += [
- 'LegacyMDNSDeviceProvider.cpp',
- ]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-FINAL_LIBRARY = 'xul'
diff --git a/dom/presentation/provider/nsTCPDeviceInfo.h b/dom/presentation/provider/nsTCPDeviceInfo.h
deleted file mode 100644
index 118f6c8ac..000000000
--- a/dom/presentation/provider/nsTCPDeviceInfo.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef __TCPDeviceInfo_h__
-#define __TCPDeviceInfo_h__
-
-namespace mozilla {
-namespace dom {
-namespace presentation {
-
-class TCPDeviceInfo final : public nsITCPDeviceInfo
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSITCPDEVICEINFO
-
- explicit TCPDeviceInfo(const nsACString& aId,
- const nsACString& aAddress,
- const uint16_t aPort,
- const nsACString& aCertFingerprint)
- : mId(aId)
- , mAddress(aAddress)
- , mPort(aPort)
- , mCertFingerprint(aCertFingerprint)
- {
- }
-
-private:
- virtual ~TCPDeviceInfo() {}
-
- nsCString mId;
- nsCString mAddress;
- uint16_t mPort;
- nsCString mCertFingerprint;
-};
-
-NS_IMPL_ISUPPORTS(TCPDeviceInfo,
- nsITCPDeviceInfo)
-
-// nsITCPDeviceInfo
-NS_IMETHODIMP
-TCPDeviceInfo::GetId(nsACString& aId)
-{
- aId = mId;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-TCPDeviceInfo::GetAddress(nsACString& aAddress)
-{
- aAddress = mAddress;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-TCPDeviceInfo::GetPort(uint16_t* aPort)
-{
- *aPort = mPort;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-TCPDeviceInfo::GetCertFingerprint(nsACString& aCertFingerprint)
-{
- aCertFingerprint = mCertFingerprint;
- return NS_OK;
-}
-
-} // namespace presentation
-} // namespace dom
-} // namespace mozilla
-
-#endif /* !__TCPDeviceInfo_h__ */
-
diff --git a/dom/presentation/tests/mochitest/PresentationDeviceInfoChromeScript.js b/dom/presentation/tests/mochitest/PresentationDeviceInfoChromeScript.js
deleted file mode 100644
index 2bc069f6b..000000000
--- a/dom/presentation/tests/mochitest/PresentationDeviceInfoChromeScript.js
+++ /dev/null
@@ -1,150 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-'use strict';
-
-const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
-
-Cu.import('resource://gre/modules/PresentationDeviceInfoManager.jsm');
-
-const { XPCOMUtils } = Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-
-const manager = Cc['@mozilla.org/presentation-device/manager;1']
- .getService(Ci.nsIPresentationDeviceManager);
-
-var testProvider = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceProvider]),
- forceDiscovery: function() {
- sendAsyncMessage('force-discovery');
- },
- listener: null,
-};
-
-var testDevice = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDevice]),
- establishControlChannel: function() {
- return null;
- },
- disconnect: function() {},
- isRequestedUrlSupported: function(requestedUrl) {
- return true;
- },
- id: null,
- name: null,
- type: null,
- listener: null,
-};
-
-var testDevice1 = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDevice]),
- id: 'dummyid',
- name: 'dummyName',
- type: 'dummyType',
- establishControlChannel: function(url, presentationId) {
- return null;
- },
- disconnect: function() {},
- isRequestedUrlSupported: function(requestedUrl) {
- return true;
- },
-};
-
-var testDevice2 = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDevice]),
- id: 'dummyid',
- name: 'dummyName',
- type: 'dummyType',
- establishControlChannel: function(url, presentationId) {
- return null;
- },
- disconnect: function() {},
- isRequestedUrlSupported: function(requestedUrl) {
- return true;
- },
-};
-
-var mockedDeviceWithoutSupportedURL = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDevice]),
- id: 'dummyid',
- name: 'dummyName',
- type: 'dummyType',
- establishControlChannel: function(url, presentationId) {
- return null;
- },
- disconnect: function() {},
- isRequestedUrlSupported: function(requestedUrl) {
- return false;
- },
-};
-
-var mockedDeviceSupportHttpsURL = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDevice]),
- id: 'dummyid',
- name: 'dummyName',
- type: 'dummyType',
- establishControlChannel: function(url, presentationId) {
- return null;
- },
- disconnect: function() {},
- isRequestedUrlSupported: function(requestedUrl) {
- if (requestedUrl.indexOf("https://") != -1) {
- return true;
- }
- return false;
- },
-};
-
-addMessageListener('setup', function() {
- manager.addDeviceProvider(testProvider);
-
- sendAsyncMessage('setup-complete');
-});
-
-addMessageListener('trigger-device-add', function(device) {
- testDevice.id = device.id;
- testDevice.name = device.name;
- testDevice.type = device.type;
- manager.addDevice(testDevice);
-});
-
-addMessageListener('trigger-add-unsupport-url-device', function() {
- manager.addDevice(mockedDeviceWithoutSupportedURL);
-});
-
-addMessageListener('trigger-add-multiple-devices', function() {
- manager.addDevice(testDevice1);
- manager.addDevice(testDevice2);
-});
-
-addMessageListener('trigger-add-https-devices', function() {
- manager.addDevice(mockedDeviceSupportHttpsURL);
-});
-
-
-addMessageListener('trigger-device-update', function(device) {
- testDevice.id = device.id;
- testDevice.name = device.name;
- testDevice.type = device.type;
- manager.updateDevice(testDevice);
-});
-
-addMessageListener('trigger-device-remove', function() {
- manager.removeDevice(testDevice);
-});
-
-addMessageListener('trigger-remove-unsupported-device', function() {
- manager.removeDevice(mockedDeviceWithoutSupportedURL);
-});
-
-addMessageListener('trigger-remove-multiple-devices', function() {
- manager.removeDevice(testDevice1);
- manager.removeDevice(testDevice2);
-});
-
-addMessageListener('trigger-remove-https-devices', function() {
- manager.removeDevice(mockedDeviceSupportHttpsURL);
-});
-
-addMessageListener('teardown', function() {
- manager.removeDeviceProvider(testProvider);
-});
diff --git a/dom/presentation/tests/mochitest/PresentationSessionChromeScript.js b/dom/presentation/tests/mochitest/PresentationSessionChromeScript.js
deleted file mode 100644
index 3052bdcb1..000000000
--- a/dom/presentation/tests/mochitest/PresentationSessionChromeScript.js
+++ /dev/null
@@ -1,470 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-'use strict';
-
-const { classes: Cc, interfaces: Ci, manager: Cm, utils: Cu, results: Cr } = Components;
-
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/Services.jsm');
-Cu.import('resource://gre/modules/Timer.jsm');
-
-const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"]
- .getService(Ci.nsIUUIDGenerator);
-
-function registerMockedFactory(contractId, mockedClassId, mockedFactory) {
- var originalClassId, originalFactory;
-
- var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
- if (!registrar.isCIDRegistered(mockedClassId)) {
- try {
- originalClassId = registrar.contractIDToCID(contractId);
- originalFactory = Cm.getClassObject(Cc[contractId], Ci.nsIFactory);
- } catch (ex) {
- originalClassId = "";
- originalFactory = null;
- }
- if (originalFactory) {
- registrar.unregisterFactory(originalClassId, originalFactory);
- }
- registrar.registerFactory(mockedClassId, "", contractId, mockedFactory);
- }
-
- return { contractId: contractId,
- mockedClassId: mockedClassId,
- mockedFactory: mockedFactory,
- originalClassId: originalClassId,
- originalFactory: originalFactory };
-}
-
-function registerOriginalFactory(contractId, mockedClassId, mockedFactory, originalClassId, originalFactory) {
- if (originalFactory) {
- var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
- registrar.unregisterFactory(mockedClassId, mockedFactory);
- registrar.registerFactory(originalClassId, "", contractId, originalFactory);
- }
-}
-
-var sessionId = 'test-session-id-' + uuidGenerator.generateUUID().toString();
-
-const address = Cc["@mozilla.org/supports-cstring;1"]
- .createInstance(Ci.nsISupportsCString);
-address.data = "127.0.0.1";
-const addresses = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
-addresses.appendElement(address, false);
-
-const mockedChannelDescription = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationChannelDescription]),
- get type() {
- if (Services.prefs.getBoolPref("dom.presentation.session_transport.data_channel.enable")) {
- return Ci.nsIPresentationChannelDescription.TYPE_DATACHANNEL;
- }
- return Ci.nsIPresentationChannelDescription.TYPE_TCP;
- },
- tcpAddress: addresses,
- tcpPort: 1234,
-};
-
-const mockedServerSocket = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIServerSocket,
- Ci.nsIFactory]),
- createInstance: function(aOuter, aIID) {
- if (aOuter) {
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- }
- return this.QueryInterface(aIID);
- },
- get port() {
- return this._port;
- },
- set listener(listener) {
- this._listener = listener;
- },
- init: function(port, loopbackOnly, backLog) {
- if (port != -1) {
- this._port = port;
- } else {
- this._port = 5678;
- }
- },
- asyncListen: function(listener) {
- this._listener = listener;
- },
- close: function() {
- this._listener.onStopListening(this, Cr.NS_BINDING_ABORTED);
- },
- simulateOnSocketAccepted: function(serverSocket, socketTransport) {
- this._listener.onSocketAccepted(serverSocket, socketTransport);
- }
-};
-
-const mockedSocketTransport = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISocketTransport]),
-};
-
-const mockedControlChannel = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannel]),
- set listener(listener) {
- this._listener = listener;
- },
- get listener() {
- return this._listener;
- },
- sendOffer: function(offer) {
- sendAsyncMessage('offer-sent', this._isValidSDP(offer));
- },
- sendAnswer: function(answer) {
- sendAsyncMessage('answer-sent', this._isValidSDP(answer));
-
- if (answer.type == Ci.nsIPresentationChannelDescription.TYPE_TCP) {
- this._listener.QueryInterface(Ci.nsIPresentationSessionTransportCallback).notifyTransportReady();
- }
- },
- _isValidSDP: function(aSDP) {
- var isValid = false;
- if (aSDP.type == Ci.nsIPresentationChannelDescription.TYPE_TCP) {
- try {
- var addresses = aSDP.tcpAddress;
- if (addresses.length > 0) {
- for (var i = 0; i < addresses.length; i++) {
- // Ensure CString addresses are used. Otherwise, an error will be thrown.
- addresses.queryElementAt(i, Ci.nsISupportsCString);
- }
-
- isValid = true;
- }
- } catch (e) {
- isValid = false;
- }
- } else if (aSDP.type == Ci.nsIPresentationChannelDescription.TYPE_DATACHANNEL) {
- isValid = (aSDP.dataChannelSDP == "test-sdp");
- }
- return isValid;
- },
- launch: function(presentationId, url) {
- sessionId = presentationId;
- },
- terminate: function(presentationId) {
- sendAsyncMessage('sender-terminate', presentationId);
- },
- reconnect: function(presentationId, url) {
- sendAsyncMessage('start-reconnect', url);
- },
- notifyReconnected: function() {
- this._listener
- .QueryInterface(Ci.nsIPresentationControlChannelListener)
- .notifyReconnected();
- },
- disconnect: function(reason) {
- sendAsyncMessage('control-channel-closed', reason);
- this._listener.QueryInterface(Ci.nsIPresentationControlChannelListener).notifyDisconnected(reason);
- },
- simulateReceiverReady: function() {
- this._listener.QueryInterface(Ci.nsIPresentationControlChannelListener).notifyReceiverReady();
- },
- simulateOnOffer: function() {
- sendAsyncMessage('offer-received');
- this._listener.QueryInterface(Ci.nsIPresentationControlChannelListener).onOffer(mockedChannelDescription);
- },
- simulateOnAnswer: function() {
- sendAsyncMessage('answer-received');
- this._listener.QueryInterface(Ci.nsIPresentationControlChannelListener).onAnswer(mockedChannelDescription);
- },
- simulateNotifyConnected: function() {
- sendAsyncMessage('control-channel-opened');
- this._listener.QueryInterface(Ci.nsIPresentationControlChannelListener).notifyConnected();
- },
-};
-
-const mockedDevice = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDevice]),
- id: 'id',
- name: 'name',
- type: 'type',
- establishControlChannel: function(url, presentationId) {
- sendAsyncMessage('control-channel-established');
- return mockedControlChannel;
- },
- disconnect: function() {},
- isRequestedUrlSupported: function(requestedUrl) {
- return true;
- },
-};
-
-const mockedDevicePrompt = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDevicePrompt,
- Ci.nsIFactory]),
- createInstance: function(aOuter, aIID) {
- if (aOuter) {
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- }
- return this.QueryInterface(aIID);
- },
- set request(request) {
- this._request = request;
- },
- get request() {
- return this._request;
- },
- promptDeviceSelection: function(request) {
- this._request = request;
- sendAsyncMessage('device-prompt');
- },
- simulateSelect: function() {
- this._request.select(mockedDevice);
- },
- simulateCancel: function(result) {
- this._request.cancel(result);
- }
-};
-
-const mockedSessionTransport = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationSessionTransport,
- Ci.nsIPresentationSessionTransportBuilder,
- Ci.nsIPresentationTCPSessionTransportBuilder,
- Ci.nsIPresentationDataChannelSessionTransportBuilder,
- Ci.nsIPresentationControlChannelListener,
- Ci.nsIFactory]),
- createInstance: function(aOuter, aIID) {
- if (aOuter) {
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- }
- return this.QueryInterface(aIID);
- },
- set callback(callback) {
- this._callback = callback;
- },
- get callback() {
- return this._callback;
- },
- get selfAddress() {
- return this._selfAddress;
- },
- buildTCPSenderTransport: function(transport, listener) {
- this._listener = listener;
- this._role = Ci.nsIPresentationService.ROLE_CONTROLLER;
- this._listener.onSessionTransport(this);
- this._listener = null;
- sendAsyncMessage('data-transport-initialized');
-
- setTimeout(()=>{
- this.simulateTransportReady();
- }, 0);
- },
- buildTCPReceiverTransport: function(description, listener) {
- this._listener = listener;
- this._role = Ci.nsIPresentationService.ROLE_RECEIVER;
-
- var addresses = description.QueryInterface(Ci.nsIPresentationChannelDescription).tcpAddress;
- this._selfAddress = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINetAddr]),
- address: (addresses.length > 0) ?
- addresses.queryElementAt(0, Ci.nsISupportsCString).data : "",
- port: description.QueryInterface(Ci.nsIPresentationChannelDescription).tcpPort,
- };
-
- setTimeout(()=>{
- this._listener.onSessionTransport(this);
- this._listener = null;
- }, 0);
- },
- // in-process case
- buildDataChannelTransport: function(role, window, listener) {
- this._listener = listener;
- this._role = role;
-
- var hasNavigator = window ? (typeof window.navigator != "undefined") : false;
- sendAsyncMessage('check-navigator', hasNavigator);
-
- setTimeout(()=>{
- this._listener.onSessionTransport(this);
- this._listener = null;
- this.simulateTransportReady();
- }, 0);
- },
- enableDataNotification: function() {
- sendAsyncMessage('data-transport-notification-enabled');
- },
- send: function(data) {
- sendAsyncMessage('message-sent', data);
- },
- close: function(reason) {
- sendAsyncMessage('data-transport-closed', reason);
- this._callback.QueryInterface(Ci.nsIPresentationSessionTransportCallback).notifyTransportClosed(reason);
- },
- simulateTransportReady: function() {
- this._callback.QueryInterface(Ci.nsIPresentationSessionTransportCallback).notifyTransportReady();
- },
- simulateIncomingMessage: function(message) {
- this._callback.QueryInterface(Ci.nsIPresentationSessionTransportCallback).notifyData(message, false);
- },
- onOffer: function(aOffer) {
- },
- onAnswer: function(aAnswer) {
- }
-};
-
-const mockedNetworkInfo = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINetworkInfo]),
- getAddresses: function(ips, prefixLengths) {
- ips.value = ["127.0.0.1"];
- prefixLengths.value = [0];
- return 1;
- },
-};
-
-const mockedNetworkManager = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINetworkManager,
- Ci.nsIFactory]),
- createInstance: function(aOuter, aIID) {
- if (aOuter) {
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- }
- return this.QueryInterface(aIID);
- },
- get activeNetworkInfo() {
- return mockedNetworkInfo;
- },
-};
-
-var requestPromise = null;
-
-const mockedRequestUIGlue = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationRequestUIGlue,
- Ci.nsIFactory]),
- createInstance: function(aOuter, aIID) {
- if (aOuter) {
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- }
- return this.QueryInterface(aIID);
- },
- sendRequest: function(aUrl, aSessionId) {
- sendAsyncMessage('receiver-launching', aSessionId);
- return requestPromise;
- },
-};
-
-// Register mocked factories.
-const originalFactoryData = [];
-originalFactoryData.push(registerMockedFactory("@mozilla.org/presentation-device/prompt;1",
- uuidGenerator.generateUUID(),
- mockedDevicePrompt));
-originalFactoryData.push(registerMockedFactory("@mozilla.org/network/server-socket;1",
- uuidGenerator.generateUUID(),
- mockedServerSocket));
-originalFactoryData.push(registerMockedFactory("@mozilla.org/presentation/presentationtcpsessiontransport;1",
- uuidGenerator.generateUUID(),
- mockedSessionTransport));
-originalFactoryData.push(registerMockedFactory("@mozilla.org/presentation/datachanneltransportbuilder;1",
- uuidGenerator.generateUUID(),
- mockedSessionTransport));
-originalFactoryData.push(registerMockedFactory("@mozilla.org/network/manager;1",
- uuidGenerator.generateUUID(),
- mockedNetworkManager));
-originalFactoryData.push(registerMockedFactory("@mozilla.org/presentation/requestuiglue;1",
- uuidGenerator.generateUUID(),
- mockedRequestUIGlue));
-
-function tearDown() {
- requestPromise = null;
- mockedServerSocket.listener = null;
- mockedControlChannel.listener = null;
- mockedDevice.listener = null;
- mockedDevicePrompt.request = null;
- mockedSessionTransport.callback = null;
-
- var deviceManager = Cc['@mozilla.org/presentation-device/manager;1']
- .getService(Ci.nsIPresentationDeviceManager);
- deviceManager.QueryInterface(Ci.nsIPresentationDeviceListener).removeDevice(mockedDevice);
-
- // Register original factories.
- for (var data of originalFactoryData) {
- registerOriginalFactory(data.contractId, data.mockedClassId,
- data.mockedFactory, data.originalClassId,
- data.originalFactory);
- }
-
- sendAsyncMessage('teardown-complete');
-}
-
-addMessageListener('trigger-device-add', function() {
- var deviceManager = Cc['@mozilla.org/presentation-device/manager;1']
- .getService(Ci.nsIPresentationDeviceManager);
- deviceManager.QueryInterface(Ci.nsIPresentationDeviceListener).addDevice(mockedDevice);
-});
-
-addMessageListener('trigger-device-prompt-select', function() {
- mockedDevicePrompt.simulateSelect();
-});
-
-addMessageListener('trigger-device-prompt-cancel', function(result) {
- mockedDevicePrompt.simulateCancel(result);
-});
-
-addMessageListener('trigger-incoming-session-request', function(url) {
- var deviceManager = Cc['@mozilla.org/presentation-device/manager;1']
- .getService(Ci.nsIPresentationDeviceManager);
- deviceManager.QueryInterface(Ci.nsIPresentationDeviceListener)
- .onSessionRequest(mockedDevice, url, sessionId, mockedControlChannel);
-});
-
-addMessageListener('trigger-incoming-terminate-request', function() {
- var deviceManager = Cc['@mozilla.org/presentation-device/manager;1']
- .getService(Ci.nsIPresentationDeviceManager);
- deviceManager.QueryInterface(Ci.nsIPresentationDeviceListener)
- .onTerminateRequest(mockedDevice, sessionId, mockedControlChannel, true);
-});
-
-addMessageListener('trigger-reconnected-acked', function(url) {
- mockedControlChannel.notifyReconnected();
-});
-
-addMessageListener('trigger-incoming-offer', function() {
- mockedControlChannel.simulateOnOffer();
-});
-
-addMessageListener('trigger-incoming-answer', function() {
- mockedControlChannel.simulateOnAnswer();
-});
-
-addMessageListener('trigger-incoming-transport', function() {
- mockedServerSocket.simulateOnSocketAccepted(mockedServerSocket, mockedSocketTransport);
-});
-
-addMessageListener('trigger-control-channel-open', function(reason) {
- mockedControlChannel.simulateNotifyConnected();
-});
-
-addMessageListener('trigger-control-channel-close', function(reason) {
- mockedControlChannel.disconnect(reason);
-});
-
-addMessageListener('trigger-data-transport-close', function(reason) {
- mockedSessionTransport.close(reason);
-});
-
-addMessageListener('trigger-incoming-message', function(message) {
- mockedSessionTransport.simulateIncomingMessage(message);
-});
-
-addMessageListener('teardown', function() {
- tearDown();
-});
-
-var controlChannelListener;
-addMessageListener('save-control-channel-listener', function() {
- controlChannelListener = mockedControlChannel.listener;
-});
-
-addMessageListener('restore-control-channel-listener', function(message) {
- mockedControlChannel.listener = controlChannelListener;
- controlChannelListener = null;
-});
-
-var obs = Cc["@mozilla.org/observer-service;1"]
- .getService(Ci.nsIObserverService);
-obs.addObserver(function observer(aSubject, aTopic, aData) {
- obs.removeObserver(observer, aTopic);
-
- requestPromise = aSubject;
-}, 'setup-request-promise', false);
diff --git a/dom/presentation/tests/mochitest/PresentationSessionChromeScript1UA.js b/dom/presentation/tests/mochitest/PresentationSessionChromeScript1UA.js
deleted file mode 100644
index 82d7362b2..000000000
--- a/dom/presentation/tests/mochitest/PresentationSessionChromeScript1UA.js
+++ /dev/null
@@ -1,366 +0,0 @@
-/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
-* You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-'use strict';
-
-const { classes: Cc, interfaces: Ci, manager: Cm, utils: Cu, results: Cr } = Components;
-
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/Services.jsm');
-
-const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"]
- .getService(Ci.nsIUUIDGenerator);
-
-function debug(str) {
- // dump('DEBUG -*- PresentationSessionChromeScript1UA -*-: ' + str + '\n');
-}
-
-const originalFactoryData = [];
-var sessionId; // Store the uuid generated by PresentationRequest.
-var triggerControlChannelError = false; // For simulating error during control channel establishment.
-
-// control channel of sender
-const mockControlChannelOfSender = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannel]),
- set listener(listener) {
- // PresentationControllingInfo::SetControlChannel
- if (listener) {
- debug('set listener for mockControlChannelOfSender without null');
- } else {
- debug('set listener for mockControlChannelOfSender with null');
- }
- this._listener = listener;
- },
- get listener() {
- return this._listener;
- },
- notifyConnected: function() {
- // send offer after notifyConnected immediately
- this._listener
- .QueryInterface(Ci.nsIPresentationControlChannelListener)
- .notifyConnected();
- },
- notifyReconnected: function() {
- // send offer after notifyOpened immediately
- this._listener
- .QueryInterface(Ci.nsIPresentationControlChannelListener)
- .notifyReconnected();
- },
- sendOffer: function(offer) {
- Services.tm.mainThread.dispatch(() => {
- mockControlChannelOfReceiver.onOffer(offer);
- }, Ci.nsIThread.DISPATCH_NORMAL);
- },
- onAnswer: function(answer) {
- this._listener
- .QueryInterface(Ci.nsIPresentationControlChannelListener)
- .onAnswer(answer);
- },
- launch: function(presentationId, url) {
- sessionId = presentationId;
- sendAsyncMessage('sender-launch', url);
- },
- disconnect: function(reason) {
- if (!this._listener) {
- return;
- }
- this._listener
- .QueryInterface(Ci.nsIPresentationControlChannelListener)
- .notifyDisconnected(reason);
- mockControlChannelOfReceiver.disconnect();
- },
- terminate: function(presentationId) {
- sendAsyncMessage('sender-terminate');
- },
- reconnect: function(presentationId, url) {
- sendAsyncMessage('start-reconnect', url);
- },
- sendIceCandidate: function(candidate) {
- mockControlChannelOfReceiver.notifyIceCandidate(candidate);
- },
- notifyIceCandidate: function(candidate) {
- if (!this._listener) {
- return;
- }
-
- this._listener
- .QueryInterface(Ci.nsIPresentationControlChannelListener)
- .onIceCandidate(candidate);
- },
-};
-
-// control channel of receiver
-const mockControlChannelOfReceiver = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannel]),
- set listener(listener) {
- // PresentationPresentingInfo::SetControlChannel
- if (listener) {
- debug('set listener for mockControlChannelOfReceiver without null');
- } else {
- debug('set listener for mockControlChannelOfReceiver with null');
- }
- this._listener = listener;
-
- if (this._pendingOpened) {
- this._pendingOpened = false;
- this.notifyConnected();
- }
- },
- get listener() {
- return this._listener;
- },
- notifyConnected: function() {
- // do nothing
- if (!this._listener) {
- this._pendingOpened = true;
- return;
- }
- this._listener
- .QueryInterface(Ci.nsIPresentationControlChannelListener)
- .notifyConnected();
- },
- onOffer: function(offer) {
- this._listener
- .QueryInterface(Ci.nsIPresentationControlChannelListener)
- .onOffer(offer);
- },
- sendAnswer: function(answer) {
- Services.tm.mainThread.dispatch(() => {
- mockControlChannelOfSender.onAnswer(answer);
- }, Ci.nsIThread.DISPATCH_NORMAL);
- },
- disconnect: function(reason) {
- if (!this._listener) {
- return;
- }
-
- this._listener
- .QueryInterface(Ci.nsIPresentationControlChannelListener)
- .notifyDisconnected(reason);
- sendAsyncMessage('control-channel-receiver-closed', reason);
- },
- terminate: function(presentaionId) {
- },
- sendIceCandidate: function(candidate) {
- mockControlChannelOfReceiver.notifyIceCandidate(candidate);
- },
- notifyIceCandidate: function(candidate) {
- if (!this._listener) {
- return;
- }
-
- this._listener
- .QueryInterface(Ci.nsIPresentationControlChannelListener)
- .onIceCandidate(candidate);
- },
-};
-
-const mockDevice = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDevice]),
- id: 'id',
- name: 'name',
- type: 'type',
- establishControlChannel: function(url, presentationId) {
- if (triggerControlChannelError) {
- throw Cr.NS_ERROR_FAILURE;
- }
- sendAsyncMessage('control-channel-established');
- return mockControlChannelOfSender;
- },
- disconnect: function() {
- sendAsyncMessage('device-disconnected');
- },
- isRequestedUrlSupported: function(requestedUrl) {
- return true;
- },
-};
-
-const mockDevicePrompt = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDevicePrompt,
- Ci.nsIFactory]),
- createInstance: function(aOuter, aIID) {
- if (aOuter) {
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- }
- return this.QueryInterface(aIID);
- },
- set request(request) {
- this._request = request;
- },
- get request() {
- return this._request;
- },
- promptDeviceSelection: function(request) {
- this._request = request;
- sendAsyncMessage('device-prompt');
- },
- simulateSelect: function() {
- this._request.select(mockDevice);
- },
- simulateCancel: function() {
- this._request.cancel();
- }
-};
-
-const mockRequestUIGlue = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationRequestUIGlue,
- Ci.nsIFactory]),
- set promise(aPromise) {
- this._promise = aPromise
- },
- get promise() {
- return this._promise;
- },
- createInstance: function(aOuter, aIID) {
- if (aOuter) {
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- }
- return this.QueryInterface(aIID);
- },
- sendRequest: function(aUrl, aSessionId) {
- return this.promise;
- },
-};
-
-function initMockAndListener() {
-
- function registerMockFactory(contractId, mockClassId, mockFactory) {
- var originalClassId, originalFactory;
-
- var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
- if (!registrar.isCIDRegistered(mockClassId)) {
- try {
- originalClassId = registrar.contractIDToCID(contractId);
- originalFactory = Cm.getClassObject(Cc[contractId], Ci.nsIFactory);
- } catch (ex) {
- originalClassId = "";
- originalFactory = null;
- }
- if (originalFactory) {
- registrar.unregisterFactory(originalClassId, originalFactory);
- }
- registrar.registerFactory(mockClassId, "", contractId, mockFactory);
- }
-
- return { contractId: contractId,
- mockClassId: mockClassId,
- mockFactory: mockFactory,
- originalClassId: originalClassId,
- originalFactory: originalFactory };
- }
- // Register mock factories.
- const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"]
- .getService(Ci.nsIUUIDGenerator);
- originalFactoryData.push(registerMockFactory("@mozilla.org/presentation-device/prompt;1",
- uuidGenerator.generateUUID(),
- mockDevicePrompt));
- originalFactoryData.push(registerMockFactory("@mozilla.org/presentation/requestuiglue;1",
- uuidGenerator.generateUUID(),
- mockRequestUIGlue));
-
- addMessageListener('trigger-device-add', function() {
- debug('Got message: trigger-device-add');
- var deviceManager = Cc['@mozilla.org/presentation-device/manager;1']
- .getService(Ci.nsIPresentationDeviceManager);
- deviceManager.QueryInterface(Ci.nsIPresentationDeviceListener)
- .addDevice(mockDevice);
- });
-
- addMessageListener('trigger-device-prompt-select', function() {
- debug('Got message: trigger-device-prompt-select');
- mockDevicePrompt.simulateSelect();
- });
-
- addMessageListener('trigger-on-session-request', function(url) {
- debug('Got message: trigger-on-session-request');
- var deviceManager = Cc['@mozilla.org/presentation-device/manager;1']
- .getService(Ci.nsIPresentationDeviceManager);
- deviceManager.QueryInterface(Ci.nsIPresentationDeviceListener)
- .onSessionRequest(mockDevice,
- url,
- sessionId,
- mockControlChannelOfReceiver);
- });
-
- addMessageListener('trigger-on-terminate-request', function() {
- debug('Got message: trigger-on-terminate-request');
- var deviceManager = Cc['@mozilla.org/presentation-device/manager;1']
- .getService(Ci.nsIPresentationDeviceManager);
- deviceManager.QueryInterface(Ci.nsIPresentationDeviceListener)
- .onTerminateRequest(mockDevice,
- sessionId,
- mockControlChannelOfReceiver,
- false);
- });
-
- addMessageListener('trigger-control-channel-open', function(reason) {
- debug('Got message: trigger-control-channel-open');
- mockControlChannelOfSender.notifyConnected();
- mockControlChannelOfReceiver.notifyConnected();
- });
-
- addMessageListener('trigger-control-channel-error', function(reason) {
- debug('Got message: trigger-control-channel-open');
- triggerControlChannelError = true;
- });
-
- addMessageListener('trigger-reconnected-acked', function(url) {
- debug('Got message: trigger-reconnected-acked');
- mockControlChannelOfSender.notifyReconnected();
- var deviceManager = Cc['@mozilla.org/presentation-device/manager;1']
- .getService(Ci.nsIPresentationDeviceManager);
- deviceManager.QueryInterface(Ci.nsIPresentationDeviceListener)
- .onReconnectRequest(mockDevice,
- url,
- sessionId,
- mockControlChannelOfReceiver);
- });
-
- // Used to call sendAsyncMessage in chrome script from receiver.
- addMessageListener('forward-command', function(command_data) {
- let command = JSON.parse(command_data);
- sendAsyncMessage(command.name, command.data);
- });
-
- addMessageListener('teardown', teardown);
-
- var obs = Cc["@mozilla.org/observer-service;1"].getService(Ci.nsIObserverService);
- obs.addObserver(function setupRequestPromiseHandler(aSubject, aTopic, aData) {
- debug('Got observer: setup-request-promise');
- obs.removeObserver(setupRequestPromiseHandler, aTopic);
- mockRequestUIGlue.promise = aSubject;
- sendAsyncMessage('promise-setup-ready');
- }, 'setup-request-promise', false);
-}
-
-function teardown() {
-
- function registerOriginalFactory(contractId, mockedClassId, mockedFactory, originalClassId, originalFactory) {
- if (originalFactory) {
- var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
- registrar.unregisterFactory(mockedClassId, mockedFactory);
- registrar.registerFactory(originalClassId, "", contractId, originalFactory);
- }
- }
-
- mockRequestUIGlue.promise = null;
- mockControlChannelOfSender.listener = null;
- mockControlChannelOfReceiver.listener = null;
- mockDevicePrompt.request = null;
-
- var deviceManager = Cc['@mozilla.org/presentation-device/manager;1']
- .getService(Ci.nsIPresentationDeviceManager);
- deviceManager.QueryInterface(Ci.nsIPresentationDeviceListener)
- .removeDevice(mockDevice);
- // Register original factories.
- for (var data of originalFactoryData) {
- registerOriginalFactory(data.contractId, data.mockClassId,
- data.mockFactory, data.originalClassId,
- data.originalFactory);
- }
- sendAsyncMessage('teardown-complete');
-}
-
-initMockAndListener();
diff --git a/dom/presentation/tests/mochitest/PresentationSessionFrameScript.js b/dom/presentation/tests/mochitest/PresentationSessionFrameScript.js
deleted file mode 100644
index 77240ab5f..000000000
--- a/dom/presentation/tests/mochitest/PresentationSessionFrameScript.js
+++ /dev/null
@@ -1,258 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function loadPrivilegedScriptTest() {
- /**
- * The script is loaded as
- * (a) a privileged script in content process for dc_sender.html
- * (b) a frame script in the remote iframe process for dc_receiver_oop.html
- * |type port == "undefined"| indicates the script is load by
- * |loadPrivilegedScript| which is the first case.
- */
- function sendMessage(type, data) {
- if (typeof port == "undefined") {
- sendAsyncMessage(type, {'data': data});
- } else {
- port.postMessage({'type': type,
- 'data': data
- });
- }
- }
-
- if (typeof port != "undefined") {
- /**
- * When the script is loaded by |loadPrivilegedScript|, these APIs
- * are exposed to this script.
- */
- port.onmessage = (e) => {
- var type = e.data['type'];
- if (!handlers.hasOwnProperty(type)) {
- return;
- }
- var args = [e];
- handlers[type].forEach(handler => handler.apply(null, args));
- };
- var handlers = {};
- addMessageListener = function(message, handler) {
- if (handlers.hasOwnProperty(message)) {
- handlers[message].push(handler);
- } else {
- handlers[message] = [handler];
- }
- };
- removeMessageListener = function(message, handler) {
- if (!handler || !handlers.hasOwnProperty(message)) {
- return;
- }
- var index = handlers[message].indexOf(handler);
- if (index != -1) {
- handlers[message].splice(index, 1);
- }
- };
- }
-
- const { classes: Cc, interfaces: Ci, manager: Cm, utils: Cu, results: Cr } = Components;
-
- const mockedChannelDescription = {
- QueryInterface : function (iid) {
- const interfaces = [Ci.nsIPresentationChannelDescription];
-
- if (!interfaces.some(v => iid.equals(v))) {
- throw Cr.NS_ERROR_NO_INTERFACE;
- }
- return this;
- },
- get type() {
- if (Services.prefs.getBoolPref("dom.presentation.session_transport.data_channel.enable")) {
- return Ci.nsIPresentationChannelDescription.TYPE_DATACHANNEL;
- }
- return Ci.nsIPresentationChannelDescription.TYPE_TCP;
- },
- get dataChannelSDP() {
- return "test-sdp";
- }
- };
-
- function setTimeout(callback, delay) {
- let timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
- timer.initWithCallback({ notify: callback },
- delay,
- Ci.nsITimer.TYPE_ONE_SHOT);
- return timer;
- }
-
- const mockedSessionTransport = {
- QueryInterface : function (iid) {
- const interfaces = [Ci.nsIPresentationSessionTransport,
- Ci.nsIPresentationDataChannelSessionTransportBuilder,
- Ci.nsIFactory];
-
- if (!interfaces.some(v => iid.equals(v))) {
- throw Cr.NS_ERROR_NO_INTERFACE;
- }
- return this;
- },
- createInstance: function(aOuter, aIID) {
- if (aOuter) {
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- }
- return this.QueryInterface(aIID);
- },
- set callback(callback) {
- this._callback = callback;
- },
- get callback() {
- return this._callback;
- },
- /* OOP case */
- buildDataChannelTransport: function(role, window, listener) {
- dump("PresentationSessionFrameScript: build data channel transport\n");
- this._listener = listener;
- this._role = role;
-
- var hasNavigator = window ? (typeof window.navigator != "undefined") : false;
- sendMessage('check-navigator', hasNavigator);
-
- if (this._role == Ci.nsIPresentationService.ROLE_CONTROLLER) {
- this._listener.sendOffer(mockedChannelDescription);
- }
- },
-
- enableDataNotification: function() {
- sendMessage('data-transport-notification-enabled');
- },
- send: function(data) {
- sendMessage('message-sent', data);
- },
- close: function(reason) {
- sendMessage('data-transport-closed', reason);
- this._callback.QueryInterface(Ci.nsIPresentationSessionTransportCallback).notifyTransportClosed(reason);
- this._callback = null;
- },
- simulateTransportReady: function() {
- this._callback.QueryInterface(Ci.nsIPresentationSessionTransportCallback).notifyTransportReady();
- },
- simulateIncomingMessage: function(message) {
- this._callback.QueryInterface(Ci.nsIPresentationSessionTransportCallback).notifyData(message, false);
- },
- onOffer: function(aOffer) {
- this._listener.sendAnswer(mockedChannelDescription);
- this._onSessionTransport();
- },
- onAnswer: function(aAnswer) {
- this._onSessionTransport();
- },
- _onSessionTransport: function() {
- setTimeout(()=>{
- this._listener.onSessionTransport(this);
- this.simulateTransportReady();
- this._listener = null;
- }, 0);
- }
- };
-
-
- function tearDown() {
- mockedSessionTransport.callback = null;
-
- /* Register original factories. */
- for (var data of originalFactoryData) {
- registerOriginalFactory(data.contractId, data.mockedClassId,
- data.mockedFactory, data.originalClassId,
- data.originalFactory);
- }
- sendMessage("teardown-complete");
- }
-
-
- function registerMockedFactory(contractId, mockedClassId, mockedFactory) {
- var originalClassId, originalFactory;
- var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
-
- if (!registrar.isCIDRegistered(mockedClassId)) {
- try {
- originalClassId = registrar.contractIDToCID(contractId);
- originalFactory = Cm.getClassObject(Cc[contractId], Ci.nsIFactory);
- } catch (ex) {
- originalClassId = "";
- originalFactory = null;
- }
- if (originalFactory) {
- registrar.unregisterFactory(originalClassId, originalFactory);
- }
- registrar.registerFactory(mockedClassId, "", contractId, mockedFactory);
- }
-
- return { contractId: contractId,
- mockedClassId: mockedClassId,
- mockedFactory: mockedFactory,
- originalClassId: originalClassId,
- originalFactory: originalFactory };
- }
-
- function registerOriginalFactory(contractId, mockedClassId, mockedFactory, originalClassId, originalFactory) {
- if (originalFactory) {
- var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
- registrar.unregisterFactory(mockedClassId, mockedFactory);
- registrar.registerFactory(originalClassId, "", contractId, originalFactory);
- }
- }
-
- /* Register mocked factories. */
- const originalFactoryData = [];
- const uuidGenerator = Cc["@mozilla.org/uuid-generator;1"]
- .getService(Ci.nsIUUIDGenerator);
- originalFactoryData.push(registerMockedFactory("@mozilla.org/presentation/datachanneltransportbuilder;1",
- uuidGenerator.generateUUID(),
- mockedSessionTransport));
-
- addMessageListener('trigger-incoming-message', function(event) {
- mockedSessionTransport.simulateIncomingMessage(event.data.data);
- });
- addMessageListener('teardown', ()=>tearDown());
-}
-
-// Exposed to the caller of |loadPrivilegedScript|
-var contentScript = {
- handlers: {},
- addMessageListener: function(message, handler) {
- if (this.handlers.hasOwnProperty(message)) {
- this.handlers[message].push(handler);
- } else {
- this.handlers[message] = [handler];
- }
- },
- removeMessageListener: function(message, handler) {
- if (!handler || !this.handlers.hasOwnProperty(message)) {
- return;
- }
- var index = this.handlers[message].indexOf(handler);
- if (index != -1) {
- this.handlers[message].splice(index, 1);
- }
- },
- sendAsyncMessage: function(message, data) {
- port.postMessage({'type': message,
- 'data': data
- });
- }
-}
-
-if (!SpecialPowers.isMainProcess()) {
- var port;
- try {
- port = SpecialPowers.loadPrivilegedScript(loadPrivilegedScriptTest.toSource());
- } catch (e) {
- ok(false, "loadPrivilegedScript shoulde not throw" + e);
- }
-
- port.onmessage = (e) => {
- var type = e.data['type'];
- if (!contentScript.handlers.hasOwnProperty(type)) {
- return;
- }
- var args = [e.data['data']];
- contentScript.handlers[type].forEach(handler => handler.apply(null, args));
- };
-}
diff --git a/dom/presentation/tests/mochitest/chrome.ini b/dom/presentation/tests/mochitest/chrome.ini
deleted file mode 100644
index 83841f4f8..000000000
--- a/dom/presentation/tests/mochitest/chrome.ini
+++ /dev/null
@@ -1,14 +0,0 @@
-[DEFAULT]
-support-files =
- PresentationDeviceInfoChromeScript.js
- PresentationSessionChromeScript.js
-
-[test_presentation_datachannel_sessiontransport.html]
-skip-if = os == 'android'
-[test_presentation_device_info.html]
-[test_presentation_sender_startWithDevice.html]
-skip-if = toolkit == 'android' # Bug 1129785
-[test_presentation_tcp_sender.html]
-skip-if = toolkit == 'android' # Bug 1129785
-[test_presentation_tcp_sender_default_request.html]
-skip-if = toolkit == 'android' # Bug 1129785
diff --git a/dom/presentation/tests/mochitest/file_presentation_1ua_receiver.html b/dom/presentation/tests/mochitest/file_presentation_1ua_receiver.html
deleted file mode 100644
index cf02d2b2c..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_1ua_receiver.html
+++ /dev/null
@@ -1,220 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
- <head>
- <meta charset="utf-8">
- <title>Test for B2G PresentationReceiver at receiver side</title>
- </head>
- <body>
- <div id="content"></div>
-<script type="application/javascript;version=1.7">
-
-"use strict";
-
-function is(a, b, msg) {
- if (a === b) {
- alert('OK ' + msg);
- } else {
- alert('KO ' + msg + ' | reason: ' + a + ' != ' + b);
- }
-}
-
-function ok(a, msg) {
- alert((a ? 'OK ' : 'KO ') + msg);
-}
-
-function info(msg) {
- alert('INFO ' + msg);
-}
-
-function command(name, data) {
- alert('COMMAND ' + JSON.stringify({name: name, data: data}));
-}
-
-function finish() {
- alert('DONE');
-}
-
-var connection;
-const DATA_ARRAY = [0, 255, 254, 0, 1, 2, 3, 0, 255, 255, 254, 0];
-const DATA_ARRAY_BUFFER = new ArrayBuffer(DATA_ARRAY.length);
-const TYPED_DATA_ARRAY = new Uint8Array(DATA_ARRAY_BUFFER);
-TYPED_DATA_ARRAY.set(DATA_ARRAY);
-
-function is_same_buffer(recv_data, expect_data) {
- let recv_dataview = new Uint8Array(recv_data);
- let expected_dataview = new Uint8Array(expect_data);
-
- if (recv_dataview.length !== expected_dataview.length) {
- return false;
- }
-
- for (let i = 0; i < recv_dataview.length; i++) {
- if (recv_dataview[i] != expected_dataview[i]) {
- info('discover byte differenct at ' + i);
- return false;
- }
- }
- return true;
-}
-
-function testConnectionAvailable() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testConnectionAvailable ---');
- ok(navigator.presentation, "Receiver: navigator.presentation should be available.");
- ok(navigator.presentation.receiver, "Receiver: navigator.presentation.receiver should be available.");
- is(navigator.presentation.defaultRequest, null, "Receiver: navigator.presentation.defaultRequest should be null.");
-
- navigator.presentation.receiver.connectionList
- .then((aList) => {
- is(aList.connections.length, 1, "Should get one conncetion.");
- connection = aList.connections[0];
- ok(connection.id, "Connection ID should be set: " + connection.id);
- is(connection.state, "connected", "Connection state at receiver side should be connected.");
- aResolve();
- })
- .catch((aError) => {
- ok(false, "Receiver: Error occurred when getting the connection: " + aError);
- finish();
- aReject();
- });
- });
-}
-
-function testConnectionReady() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testConnectionReady ---');
- connection.onconnect = function() {
- connection.onconnect = null;
- ok(false, "Should not get |onconnect| event.")
- aReject();
- };
- if (connection.state === "connected") {
- connection.onconnect = null;
- is(connection.state, "connected", "Receiver: Connection state should become connected.");
- aResolve();
- }
- });
-}
-
-function testIncomingMessage() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testIncomingMessage ---');
- connection.addEventListener('message', function messageHandler(evt) {
- connection.removeEventListener('message', messageHandler);
- let msg = evt.data;
- is(msg, 'msg-sender-to-receiver', 'Receiver: Receiver should receive message from sender.');
- command('forward-command', JSON.stringify({ name: 'message-from-sender-received' }));
- aResolve();
- });
- command('forward-command', JSON.stringify({ name: 'trigger-message-from-sender' }));
- });
-}
-
-function testSendMessage() {
- return new Promise(function(aResolve, aReject) {
- window.addEventListener('hashchange', function hashchangeHandler(evt) {
- var message = JSON.parse(decodeURIComponent(window.location.hash.substring(1)));
- if (message.type === 'trigger-message-from-receiver') {
- info('Receiver: --- testSendMessage ---');
- connection.send('msg-receiver-to-sender');
- }
- if (message.type === 'message-from-receiver-received') {
- window.removeEventListener('hashchange', hashchangeHandler);
- aResolve();
- }
- });
- });
-}
-
-function testIncomingBlobMessage() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testIncomingBlobMessage ---');
- connection.send('testIncomingBlobMessage');
- connection.addEventListener('message', function messageHandler(evt) {
- connection.removeEventListener('message', messageHandler);
- let recvData= String.fromCharCode.apply(null, new Uint8Array(evt.data));
- is(recvData, "Hello World", 'expected same string data');
- aResolve();
- });
- });
-}
-
-function testConnectionClosed() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testConnectionClosed ---');
- connection.onclose = function() {
- connection.onclose = null;
- is(connection.state, "closed", "Receiver: Connection should be closed.");
- command('forward-command', JSON.stringify({ name: 'receiver-closed' }));
- aResolve();
- };
- command('forward-command', JSON.stringify({ name: 'ready-to-close' }));
- });
-}
-
-function testReconnectConnection() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testReconnectConnection ---');
- window.addEventListener('hashchange', function hashchangeHandler(evt) {
- var message = JSON.parse(decodeURIComponent(window.location.hash.substring(1)));
- if (message.type === 'prepare-for-reconnect') {
- command('forward-command', JSON.stringify({ name: 'ready-to-reconnect' }));
- }
- });
- connection.onconnect = function() {
- connection.onconnect = null;
- ok(true, "The connection is reconnected.")
- aResolve();
- };
- });
-}
-
-function testIncomingArrayBuffer() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testIncomingArrayBuffer ---');
- connection.binaryType = "blob";
- connection.send('testIncomingArrayBuffer');
- connection.addEventListener('message', function messageHandler(evt) {
- connection.removeEventListener('message', messageHandler);
- var fileReader = new FileReader();
- fileReader.onload = function() {
- ok(is_same_buffer(DATA_ARRAY_BUFFER, this.result), "expected same buffer data");
- aResolve();
- };
- fileReader.readAsArrayBuffer(evt.data);
- });
- });
-}
-
-function testIncomingArrayBufferView() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testIncomingArrayBufferView ---');
- connection.binaryType = "arraybuffer";
- connection.send('testIncomingArrayBufferView');
- connection.addEventListener('message', function messageHandler(evt) {
- connection.removeEventListener('message', messageHandler);
- ok(is_same_buffer(evt.data, TYPED_DATA_ARRAY), "expected same buffer data");
- aResolve();
- });
- });
-}
-
-function runTests() {
- testConnectionAvailable()
- .then(testConnectionReady)
- .then(testIncomingMessage)
- .then(testSendMessage)
- .then(testIncomingBlobMessage)
- .then(testConnectionClosed)
- .then(testReconnectConnection)
- .then(testIncomingArrayBuffer)
- .then(testIncomingArrayBufferView)
- .then(testConnectionClosed);
-}
-
-runTests();
-
-</script>
- </body>
-</html>
diff --git a/dom/presentation/tests/mochitest/file_presentation_1ua_wentaway.html b/dom/presentation/tests/mochitest/file_presentation_1ua_wentaway.html
deleted file mode 100644
index 370cb92e1..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_1ua_wentaway.html
+++ /dev/null
@@ -1,95 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
- <head>
- <meta charset="utf-8">
- <title>Test for B2G PresentationReceiver at receiver side</title>
- </head>
- <body>
- <div id="content"></div>
-<script type="application/javascript;version=1.7">
-
-"use strict";
-
-function is(a, b, msg) {
- if (a === b) {
- alert('OK ' + msg);
- } else {
- alert('KO ' + msg + ' | reason: ' + a + ' != ' + b);
- }
-}
-
-function ok(a, msg) {
- alert((a ? 'OK ' : 'KO ') + msg);
-}
-
-function info(msg) {
- alert('INFO ' + msg);
-}
-
-function command(name, data) {
- alert('COMMAND ' + JSON.stringify({name: name, data: data}));
-}
-
-function finish() {
- alert('DONE');
-}
-
-var connection;
-
-function testConnectionAvailable() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testConnectionAvailable ---');
- ok(navigator.presentation, "Receiver: navigator.presentation should be available.");
- ok(navigator.presentation.receiver, "Receiver: navigator.presentation.receiver should be available.");
-
- navigator.presentation.receiver.connectionList
- .then((aList) => {
- is(aList.connections.length, 1, "Should get one conncetion.");
- connection = aList.connections[0];
- ok(connection.id, "Connection ID should be set: " + connection.id);
- is(connection.state, "connected", "Connection state at receiver side should be connected.");
- aResolve();
- })
- .catch((aError) => {
- ok(false, "Receiver: Error occurred when getting the connection: " + aError);
- finish();
- aReject();
- });
- });
-}
-
-function testConnectionReady() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testConnectionReady ---');
- connection.onconnect = function() {
- connection.onconnect = null;
- ok(false, "Should not get |onconnect| event.")
- aReject();
- };
- if (connection.state === "connected") {
- connection.onconnect = null;
- is(connection.state, "connected", "Receiver: Connection state should become connected.");
- aResolve();
- }
- });
-}
-
-function testConnectionWentaway() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testConnectionWentaway ---\n');
- command('forward-command', JSON.stringify({ name: 'ready-to-remove-receiverFrame' }));
- });
-}
-
-function runTests() {
- testConnectionAvailable()
- .then(testConnectionReady)
- .then(testConnectionWentaway);
-}
-
-runTests();
-
-</script>
- </body>
-</html>
diff --git a/dom/presentation/tests/mochitest/file_presentation_mixed_security_contexts.html b/dom/presentation/tests/mochitest/file_presentation_mixed_security_contexts.html
deleted file mode 100644
index f042d2994..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_mixed_security_contexts.html
+++ /dev/null
@@ -1,159 +0,0 @@
-
-<!DOCTYPE HTML>
-<html>
-<head>
-<meta charset="utf-8">
-<title>Test allow-presentation sandboxing flag</title>
-<script type="application/javascript;version=1.8">
-
-"use strict";
-
-function is(a, b, msg) {
- window.parent.postMessage((a === b ? "OK " : "KO ") + msg, "*");
-}
-
-function ok(a, msg) {
- window.parent.postMessage((a ? "OK " : "KO ") + msg, "*");
-}
-
-function info(msg) {
- window.parent.postMessage("INFO " + msg, "*");
-}
-
-function command(msg) {
- window.parent.postMessage("COMMAND " + JSON.stringify(msg), "*");
-}
-
-function finish() {
- window.parent.postMessage("DONE", "*");
-}
-
-function testGetAvailability() {
- return new Promise(function(aResolve, aReject) {
- ok(navigator.presentation, "navigator.presentation should be available.");
- var request = new PresentationRequest("http://example.com");
-
- request.getAvailability().then(
- function(aAvailability) {
- ok(false, "Unexpected success, should get a security error.");
- aReject();
- },
- function(aError) {
- is(aError.name, "SecurityError", "Should get a security error.");
- aResolve();
- }
- );
- });
-}
-
-function testStartRequest() {
- return new Promise(function(aResolve, aReject) {
- var request = new PresentationRequest("http://example.com");
-
- request.start().then(
- function(aAvailability) {
- ok(false, "Unexpected success, should get a security error.");
- aReject();
- },
- function(aError) {
- is(aError.name, "SecurityError", "Should get a security error.");
- aResolve();
- }
- );
- });
-}
-
-function testReconnectRequest() {
- return new Promise(function(aResolve, aReject) {
- var request = new PresentationRequest("http://example.com");
-
- request.reconnect("dummyId").then(
- function(aConnection) {
- ok(false, "Unexpected success, should get a security error.");
- aReject();
- },
- function(aError) {
- is(aError.name, "SecurityError", "Should get a security error.");
- aResolve();
- }
- );
- });
-}
-
-function testGetAvailabilityForAboutBlank() {
- return new Promise(function(aResolve, aReject) {
- var request = new PresentationRequest("about:blank");
-
- request.getAvailability().then(
- function(aAvailability) {
- ok(true, "Success due to a priori authenticated URL.");
- aResolve();
- },
- function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- aReject();
- }
- );
- });
-}
-
-function testGetAvailabilityForAboutSrcdoc() {
- return new Promise(function(aResolve, aReject) {
- var request = new PresentationRequest("about:srcdoc");
-
- request.getAvailability().then(
- function(aAvailability) {
- ok(true, "Success due to a priori authenticated URL.");
- aResolve();
- },
- function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- aReject();
- }
- );
- });
-}
-
-function testGetAvailabilityForDataURL() {
- return new Promise(function(aResolve, aReject) {
- var request = new PresentationRequest("data:text/html,1");
-
- request.getAvailability().then(
- function(aAvailability) {
- ok(true, "Success due to a priori authenticated URL.");
- aResolve();
- },
- function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- aReject();
- }
- );
- });
-}
-
-function runTest() {
- testGetAvailability()
- .then(testStartRequest)
- .then(testReconnectRequest)
- .then(testGetAvailabilityForAboutBlank)
- .then(testGetAvailabilityForAboutSrcdoc)
- .then(testGetAvailabilityForDataURL)
- .then(finish);
-}
-
-window.addEventListener("message", function onMessage(evt) {
- window.removeEventListener("message", onMessage);
- if (evt.data === "start") {
- runTest();
- }
-}, false);
-
-window.setTimeout(function() {
- command("ready-to-start");
-}, 3000);
-
-</script>
-</head>
-<body>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/file_presentation_non_receiver.html b/dom/presentation/tests/mochitest/file_presentation_non_receiver.html
deleted file mode 100644
index 1203523ac..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_non_receiver.html
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for B2G PresentationReceiver on a non-receiver page at receiver side</title>
-</head>
-<body>
-<div id="content"></div>
-<script type="application/javascript;version=1.7">
-
-"use strict";
-
-function is(a, b, msg) {
- alert((a === b ? 'OK ' : 'KO ') + msg);
-}
-
-function ok(a, msg) {
- alert((a ? 'OK ' : 'KO ') + msg);
-}
-
-function info(msg) {
- alert('INFO ' + msg);
-}
-
-function finish() {
- alert('DONE');
-}
-
-function testConnectionAvailable() {
- return new Promise(function(aResolve, aReject) {
- is(navigator.presentation.receiver, null, "navigator.presentation.receiver shouldn't be available in non-receiving pages.");
- aResolve();
- });
-}
-
-testConnectionAvailable().
-then(finish);
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/file_presentation_non_receiver_inner_iframe.html b/dom/presentation/tests/mochitest/file_presentation_non_receiver_inner_iframe.html
deleted file mode 100644
index c95eddf57..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_non_receiver_inner_iframe.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for B2G PresentationReceiver on a non-receiver inner iframe of the receiver page at receiver side</title>
-</head>
-<body onload="testConnectionAvailable()">
-<div id="content"></div>
-<script type="application/javascript;version=1.7">
-
-"use strict";
-
-function ok(a, msg) {
- alert((a ? 'OK ' : 'KO ') + msg);
-}
-
-function testConnectionAvailable() {
- return new Promise(function(aResolve, aReject) {
- is(navigator.presentation.receiver, null, "navigator.presentation.receiver shouldn't be available in inner iframes with different origins from receiving pages.");
- aResolve();
- });
-}
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/file_presentation_receiver.html b/dom/presentation/tests/mochitest/file_presentation_receiver.html
deleted file mode 100644
index 46a330b5f..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_receiver.html
+++ /dev/null
@@ -1,140 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for B2G PresentationReceiver at receiver side</title>
-</head>
-<body>
-<div id="content"></div>
-<script type="application/javascript;version=1.7">
-
-"use strict";
-
-function is(a, b, msg) {
- alert((a === b ? 'OK ' : 'KO ') + msg);
-}
-
-function ok(a, msg) {
- alert((a ? 'OK ' : 'KO ') + msg);
-}
-
-function info(msg) {
- alert('INFO ' + msg);
-}
-
-function command(msg) {
- alert('COMMAND ' + JSON.stringify(msg));
-}
-
-function finish() {
- alert('DONE');
-}
-
-var connection;
-
-function testConnectionAvailable() {
- return new Promise(function(aResolve, aReject) {
- ok(navigator.presentation, "navigator.presentation should be available in receiving pages.");
- ok(navigator.presentation.receiver, "navigator.presentation.receiver should be available in receiving pages.");
-
- navigator.presentation.receiver.connectionList.then(
- function(aList) {
- is(aList.connections.length, 1, "Should get one conncetion.");
- connection = aList.connections[0];
- ok(connection.id, "Connection ID should be set: " + connection.id);
- is(connection.state, "connected", "Connection state at receiver side should be connected.");
- aResolve();
- },
- function(aError) {
- ok(false, "Error occurred when getting the connection list: " + aError);
- finish();
- aReject();
- }
- );
- command({ name: 'trigger-incoming-offer' });
- });
-}
-
-function testDefaultRequestIsUndefined() {
- return new Promise(function(aResolve, aReject) {
- is(navigator.presentation.defaultRequest, undefined, "navigator.presentation.defaultRequest should not be available in receiving UA");
- aResolve();
- });
-}
-
-function testConnectionAvailableSameOriginInnerIframe() {
- return new Promise(function(aResolve, aReject) {
- var iframe = document.createElement('iframe');
- iframe.setAttribute('src', './file_presentation_receiver_inner_iframe.html');
- document.body.appendChild(iframe);
-
- aResolve();
- });
-}
-
-function testConnectionUnavailableDiffOriginInnerIframe() {
- return new Promise(function(aResolve, aReject) {
- var iframe = document.createElement('iframe');
- iframe.setAttribute('src', 'http://example.com/tests/dom/presentation/tests/mochitest/file_presentation_non_receiver_inner_iframe.html');
- document.body.appendChild(iframe);
-
- aResolve();
- });
-}
-
-function testConnectionListSameObject() {
- return new Promise(function(aResolve, aReject) {
- is(navigator.presentation.receiver.connectionList, navigator.presentation.receiver.connectionList, "The promise should be the same object.");
- var promise = navigator.presentation.receiver.connectionList.then(
- function(aList) {
- is(connection, aList.connections[0], "The connection from list and the one from |connectionavailable| event should be the same.");
- aResolve();
- },
- function(aError) {
- ok(false, "Error occurred when getting the connection list: " + aError);
- finish();
- aReject();
- }
- );
- });
-}
-
-function testIncomingMessage() {
- return new Promise(function(aResolve, aReject) {
- const incomingMessage = "test incoming message";
-
- connection.addEventListener('message', function messageHandler(aEvent) {
- connection.removeEventListener('message', messageHandler);
- is(aEvent.data, incomingMessage, "An incoming message should be received.");
- aResolve();
- });
-
- command({ name: 'trigger-incoming-message',
- data: incomingMessage });
- });
-}
-
-function testCloseConnection() {
- return new Promise(function(aResolve, aReject) {
- connection.onclose = function() {
- connection.onclose = null;
- is(connection.state, "closed", "Connection should be closed.");
- aResolve();
- };
-
- connection.close();
- });
-}
-
-testConnectionAvailable().
-then(testDefaultRequestIsUndefined).
-then(testConnectionAvailableSameOriginInnerIframe).
-then(testConnectionUnavailableDiffOriginInnerIframe).
-then(testConnectionListSameObject).
-then(testIncomingMessage).
-then(testCloseConnection).
-then(finish);
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/file_presentation_receiver_auxiliary_navigation.html b/dom/presentation/tests/mochitest/file_presentation_receiver_auxiliary_navigation.html
deleted file mode 100644
index 3a6060310..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_receiver_auxiliary_navigation.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for sandboxed auxiliary navigation flag in receiver page</title>
-</head>
-<body>
-<div id="content"></div>
-<script type="application/javascript;version=1.7">
-
-"use strict";
-
-function is(a, b, msg) {
- alert((a === b ? 'OK ' : 'KO ') + msg);
-}
-
-function ok(a, msg) {
- alert((a ? 'OK ' : 'KO ') + msg);
-}
-
-function info(msg) {
- alert('INFO ' + msg);
-}
-
-function command(msg) {
- alert('COMMAND ' + JSON.stringify(msg));
-}
-
-function finish() {
- alert('DONE');
-}
-
-function testConnectionAvailable() {
- return new Promise(function(aResolve, aReject) {
- ok(navigator.presentation, "navigator.presentation should be available in OOP receiving pages.");
- ok(navigator.presentation.receiver, "navigator.presentation.receiver should be available in receiving pages.");
-
- aResolve();
- });
-}
-
-function testOpenWindow() {
- return new Promise(function(aResolve, aReject) {
- try {
- window.open("http://example.com");
- ok(false, "receiver page should not be able to open a new window.");
- } catch(e) {
- ok(true, "receiver page should not be able to open a new window.");
- aResolve();
- }
- });
-}
-
-testConnectionAvailable().
-then(testOpenWindow).
-then(finish);
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/file_presentation_receiver_establish_connection_error.html b/dom/presentation/tests/mochitest/file_presentation_receiver_establish_connection_error.html
deleted file mode 100644
index 6b1f2152f..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_receiver_establish_connection_error.html
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for connection establishing errors of B2G Presentation API at receiver side</title>
-</head>
-<body>
-<div id="content"></div>
-<script type="application/javascript;version=1.7">
-
-"use strict";
-
-function is(a, b, msg) {
- if (a === b) {
- alert('OK ' + msg);
- } else {
- alert('KO ' + msg + ' | reason: ' + a + ' != ' + b);
- }
-}
-
-function ok(a, msg) {
- alert((a ? 'OK ' : 'KO ') + msg);
-}
-
-function info(msg) {
- alert('INFO ' + msg);
-}
-
-function command(name, data) {
- alert('COMMAND ' + JSON.stringify({name: name, data: data}));
-}
-
-function finish() {
- alert('DONE');
-}
-
-function testConnectionAvailable() {
- return new Promise(function(aResolve, aReject) {
- ok(navigator.presentation, "navigator.presentation should be available.");
- ok(navigator.presentation.receiver, "navigator.presentation.receiver should be available.");
- aResolve();
- });
-}
-
-function testUnexpectedControlChannelClose() {
- // Trigger the control channel to be closed with error code.
- command({ name: 'trigger-control-channel-close', data: 0x80004004 /* NS_ERROR_ABORT */ });
-
- return new Promise(function(aResolve, aReject) {
- return Promise.race([
- navigator.presentation.receiver.connectionList.then(
- (aList) => {
- ok(false, "Should not get a connection list.")
- aReject();
- },
- (aError) => {
- ok(false, "Error occurred when getting the connection list: " + aError);
- aReject();
- }
- ),
- new Promise(
- () => {
- setTimeout(() => {
- ok(true, "Not getting a conenction list.");
- aResolve();
- }, 3000);
- }
- ),
- ]);
- });
-}
-
-testConnectionAvailable().
-then(testUnexpectedControlChannelClose).
-then(finish);
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/file_presentation_receiver_inner_iframe.html b/dom/presentation/tests/mochitest/file_presentation_receiver_inner_iframe.html
deleted file mode 100644
index 3bd5ac4b1..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_receiver_inner_iframe.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for B2G PresentationReceiver in an inner iframe of the receiver page at receiver side</title>
-</head>
-<body onload="testConnectionAvailable()">
-<div id="content"></div>
-<script type="application/javascript;version=1.7">
-
-"use strict";
-
-function ok(a, msg) {
- alert((a ? 'OK ' : 'KO ') + msg);
-}
-
-function testConnectionAvailable() {
- return new Promise(function(aResolve, aReject) {
- ok(navigator.presentation.receiver, "navigator.presentation.receiver should be available in same-origin inner iframes of receiving pages.");
- aResolve();
- });
-}
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/file_presentation_reconnect.html b/dom/presentation/tests/mochitest/file_presentation_reconnect.html
deleted file mode 100644
index 174ccd3f3..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_reconnect.html
+++ /dev/null
@@ -1,102 +0,0 @@
-
-<!DOCTYPE HTML>
-<html>
-<head>
-<meta charset="utf-8">
-<title>Test allow-presentation sandboxing flag</title>
-<script type="application/javascript;version=1.8">
-
-"use strict";
-
-function is(a, b, msg) {
- window.parent.postMessage((a === b ? "OK " : "KO ") + msg, "*");
-}
-
-function ok(a, msg) {
- window.parent.postMessage((a ? "OK " : "KO ") + msg, "*");
-}
-
-function info(msg) {
- window.parent.postMessage("INFO " + msg, "*");
-}
-
-function command(msg) {
- window.parent.postMessage("COMMAND " + JSON.stringify(msg), "*");
-}
-
-function finish() {
- window.parent.postMessage("DONE", "*");
-}
-
-var request;
-var connection;
-
-function testStartRequest() {
- return new Promise(function(aResolve, aReject) {
- ok(navigator.presentation, "navigator.presentation should be available.");
- request = new PresentationRequest("http://example1.com");
-
- request.start().then(
- function(aConnection) {
- connection = aConnection;
- ok(connection, "Connection should be available.");
- ok(connection.id, "Connection ID should be set.");
- is(connection.state, "connecting", "The initial state should be connecting.");
-
- connection.onclose = function() {
- connection.onclose = null;
- command({ name: "notify-connection-closed", id: connection.id });
- };
- connection.onconnect = function() {
- connection.onconnect = null;
- is(connection.state, "connected", "Connection should be connected.");
- aResolve();
- };
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testCloseConnection() {
- return new Promise(function(aResolve, aReject) {
- if (connection.state === "closed") {
- aResolve();
- return;
- }
- connection.onclose = function() {
- connection.onclose = null;
- is(connection.state, "closed", "The connection should be closed.");
- aResolve();
- };
-
- connection.close();
- });
-}
-
-window.addEventListener("message", function onMessage(evt) {
- if (evt.data === "startConnection") {
- testStartRequest().then(
- function () {
- command({ name: "connection-connected", id: connection.id });
- }
- );
- }
- else if (evt.data === "closeConnection") {
- testCloseConnection().then(
- function () {
- command({ name: "connection-closed", id: connection.id });
- }
- );
- }
-}, false);
-
-</script>
-</head>
-<body>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/file_presentation_sandboxed_presentation.html b/dom/presentation/tests/mochitest/file_presentation_sandboxed_presentation.html
deleted file mode 100644
index 369621cee..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_sandboxed_presentation.html
+++ /dev/null
@@ -1,114 +0,0 @@
-
-<!DOCTYPE HTML>
-<html>
-<head>
-<meta charset="utf-8">
-<title>Test allow-presentation sandboxing flag</title>
-<script type="application/javascript;version=1.8">
-
-"use strict";
-
-function is(a, b, msg) {
- window.parent.postMessage((a === b ? "OK " : "KO ") + msg, "*");
-}
-
-function ok(a, msg) {
- window.parent.postMessage((a ? "OK " : "KO ") + msg, "*");
-}
-
-function info(msg) {
- window.parent.postMessage("INFO " + msg, "*");
-}
-
-function command(msg) {
- window.parent.postMessage("COMMAND " + JSON.stringify(msg), "*");
-}
-
-function finish() {
- window.parent.postMessage("DONE", "*");
-}
-
-function testGetAvailability() {
- return new Promise(function(aResolve, aReject) {
- ok(navigator.presentation, "navigator.presentation should be available.");
- var request = new PresentationRequest("http://example.com");
-
- request.getAvailability().then(
- function(aAvailability) {
- ok(false, "Unexpected success, should get a security error.");
- aReject();
- },
- function(aError) {
- is(aError.name, "SecurityError", "Should get a security error.");
- aResolve();
- }
- );
- });
-}
-
-function testStartRequest() {
- return new Promise(function(aResolve, aReject) {
- var request = new PresentationRequest("http://example.com");
-
- request.start().then(
- function(aAvailability) {
- ok(false, "Unexpected success, should get a security error.");
- aReject();
- },
- function(aError) {
- is(aError.name, "SecurityError", "Should get a security error.");
- aResolve();
- }
- );
- });
-}
-
-function testDefaultRequest() {
- return new Promise(function(aResolve, aReject) {
- navigator.presentation.defaultRequest = new PresentationRequest("http://example.com");
- is(navigator.presentation.defaultRequest, null, "DefaultRequest shoud be null.");
- aResolve();
- });
-}
-
-function testReconnectRequest() {
- return new Promise(function(aResolve, aReject) {
- var request = new PresentationRequest("http://example.com");
-
- request.reconnect("dummyId").then(
- function(aConnection) {
- ok(false, "Unexpected success, should get a security error.");
- aReject();
- },
- function(aError) {
- is(aError.name, "SecurityError", "Should get a security error.");
- aResolve();
- }
- );
- });
-}
-
-function runTest() {
- testGetAvailability()
- .then(testStartRequest)
- .then(testDefaultRequest)
- .then(testReconnectRequest)
- .then(finish);
-}
-
-window.addEventListener("message", function onMessage(evt) {
- window.removeEventListener("message", onMessage);
- if (evt.data === "start") {
- runTest();
- }
-}, false);
-
-window.setTimeout(function() {
- command("ready-to-start");
-}, 3000);
-
-</script>
-</head>
-<body>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/file_presentation_terminate.html b/dom/presentation/tests/mochitest/file_presentation_terminate.html
deleted file mode 100644
index a26a44b90..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_terminate.html
+++ /dev/null
@@ -1,104 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
- <head>
- <meta charset='utf-8'>
- <title>Test for B2G PresentationReceiver at receiver side</title>
- </head>
- <body>
- <div id='content'></div>
-<script type='application/javascript;version=1.7'>
-
-'use strict';
-
-function is(a, b, msg) {
- if (a === b) {
- alert('OK ' + msg);
- } else {
- alert('KO ' + msg + ' | reason: ' + a + ' != ' + b);
- }
-}
-
-function ok(a, msg) {
- alert((a ? 'OK ' : 'KO ') + msg);
-}
-
-function info(msg) {
- alert('INFO ' + msg);
-}
-
-function command(name, data) {
- alert('COMMAND ' + JSON.stringify({name: name, data: data}));
-}
-
-function finish() {
- alert('DONE');
-}
-
-var connection;
-
-function testConnectionAvailable() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testConnectionAvailable ---');
- ok(navigator.presentation, 'Receiver: navigator.presentation should be available.');
- ok(navigator.presentation.receiver, 'Receiver: navigator.presentation.receiver should be available.');
-
- navigator.presentation.receiver.connectionList
- .then((aList) => {
- is(aList.connections.length, 1, 'Should get one conncetion.');
- connection = aList.connections[0];
- ok(connection.id, 'Connection ID should be set: ' + connection.id);
- is(connection.state, 'connected', 'Connection state at receiver side should be connected.');
- aResolve();
- })
- .catch((aError) => {
- ok(false, 'Receiver: Error occurred when getting the connection: ' + aError);
- finish();
- aReject();
- });
- });
-}
-
-function testConnectionReady() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testConnectionReady ---');
- connection.onconnect = function() {
- connection.onconnect = null;
- ok(false, 'Should not get |onconnect| event.')
- aReject();
- };
- if (connection.state === 'connected') {
- connection.onconnect = null;
- is(connection.state, 'connected', 'Receiver: Connection state should become connected.');
- aResolve();
- }
- });
-}
-
-function testConnectionTerminate() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testConnectionTerminate ---');
- connection.onterminate = function() {
- connection.onterminate = null;
- // Using window.alert at this stage will cause window.close() fail.
- // Only trigger it if verdict fail.
- if (connection.state !== 'terminated') {
- is(connection.state, 'terminated', 'Receiver: Connection should be terminated.');
- }
- aResolve();
- };
- command('forward-command', JSON.stringify({ name: 'ready-to-terminate' }));
- });
-}
-
-function runTests() {
- testConnectionAvailable()
- .then(testConnectionReady)
- .then(testConnectionTerminate)
-}
-
-runTests();
-
-</script>
- </body>
-</html>
diff --git a/dom/presentation/tests/mochitest/file_presentation_terminate_establish_connection_error.html b/dom/presentation/tests/mochitest/file_presentation_terminate_establish_connection_error.html
deleted file mode 100644
index d8df8a1a6..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_terminate_establish_connection_error.html
+++ /dev/null
@@ -1,114 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
- <head>
- <meta charset='utf-8'>
- <title>Test for B2G PresentationReceiver at receiver side</title>
- </head>
- <body>
- <div id='content'></div>
-<script type='application/javascript;version=1.7'>
-
-'use strict';
-
-function is(a, b, msg) {
- if (a === b) {
- alert('OK ' + msg);
- } else {
- alert('KO ' + msg + ' | reason: ' + a + ' != ' + b);
- }
-}
-
-function ok(a, msg) {
- alert((a ? 'OK ' : 'KO ') + msg);
-}
-
-function info(msg) {
- alert('INFO ' + msg);
-}
-
-function command(name, data) {
- alert('COMMAND ' + JSON.stringify({name: name, data: data}));
-}
-
-function finish() {
- alert('DONE');
-}
-
-var connection;
-
-function testConnectionAvailable() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testConnectionAvailable ---');
- ok(navigator.presentation, 'Receiver: navigator.presentation should be available.');
- ok(navigator.presentation.receiver, 'Receiver: navigator.presentation.receiver should be available.');
-
- navigator.presentation.receiver.connectionList
- .then((aList) => {
- is(aList.connections.length, 1, 'Should get one connection.');
- connection = aList.connections[0];
- ok(connection.id, 'Connection ID should be set: ' + connection.id);
- is(connection.state, 'connected', 'Connection state at receiver side should be connected.');
- aResolve();
- })
- .catch((aError) => {
- ok(false, 'Receiver: Error occurred when getting the connection: ' + aError);
- finish();
- aReject();
- });
- });
-}
-
-function testConnectionReady() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testConnectionReady ---');
- connection.onconnect = function() {
- connection.onconnect = null;
- ok(false, 'Should not get |onconnect| event.')
- aReject();
- };
- if (connection.state === 'connected') {
- connection.onconnect = null;
- is(connection.state, 'connected', 'Receiver: Connection state should become connected.');
- aResolve();
- }
- });
-}
-
-function testConnectionTerminate() {
- return new Promise(function(aResolve, aReject) {
- info('Receiver: --- testConnectionTerminate ---');
- connection.onterminate = function() {
- connection.onterminate = null;
- // Using window.alert at this stage will cause window.close() fail.
- // Only trigger it if verdict fail.
- if (connection.state !== 'terminated') {
- is(connection.state, 'terminated', 'Receiver: Connection should be terminated.');
- }
- aResolve();
- };
-
- window.addEventListener('hashchange', function hashchangeHandler(evt) {
- var message = JSON.parse(decodeURIComponent(window.location.hash.substring(1)));
- if (message.type === 'ready-to-terminate') {
- info('Receiver: --- ready-to-terminate ---');
- connection.terminate();
- }
- });
-
-
- command('forward-command', JSON.stringify({ name: 'prepare-for-terminate' }));
- });
-}
-
-function runTests() {
- testConnectionAvailable()
- .then(testConnectionReady)
- .then(testConnectionTerminate)
-}
-
-runTests();
-
-</script>
- </body>
-</html>
diff --git a/dom/presentation/tests/mochitest/file_presentation_unknown_content_type.test b/dom/presentation/tests/mochitest/file_presentation_unknown_content_type.test
deleted file mode 100644
index 8b1378917..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_unknown_content_type.test
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/dom/presentation/tests/mochitest/file_presentation_unknown_content_type.test^headers^ b/dom/presentation/tests/mochitest/file_presentation_unknown_content_type.test^headers^
deleted file mode 100644
index fc044e3c4..000000000
--- a/dom/presentation/tests/mochitest/file_presentation_unknown_content_type.test^headers^
+++ /dev/null
@@ -1 +0,0 @@
-Content-Type: application/unknown
diff --git a/dom/presentation/tests/mochitest/mochitest.ini b/dom/presentation/tests/mochitest/mochitest.ini
deleted file mode 100644
index f96e07f1e..000000000
--- a/dom/presentation/tests/mochitest/mochitest.ini
+++ /dev/null
@@ -1,77 +0,0 @@
-[DEFAULT]
-support-files =
- PresentationDeviceInfoChromeScript.js
- PresentationSessionChromeScript.js
- PresentationSessionFrameScript.js
- PresentationSessionChromeScript1UA.js
- file_presentation_1ua_receiver.html
- test_presentation_1ua_sender_and_receiver.js
- file_presentation_non_receiver_inner_iframe.html
- file_presentation_non_receiver.html
- file_presentation_receiver.html
- file_presentation_receiver_establish_connection_error.html
- file_presentation_receiver_inner_iframe.html
- file_presentation_1ua_wentaway.html
- test_presentation_1ua_connection_wentaway.js
- file_presentation_receiver_auxiliary_navigation.html
- test_presentation_receiver_auxiliary_navigation.js
- file_presentation_sandboxed_presentation.html
- file_presentation_terminate.html
- test_presentation_terminate.js
- file_presentation_terminate_establish_connection_error.html
- test_presentation_terminate_establish_connection_error.js
- file_presentation_reconnect.html
- file_presentation_unknown_content_type.test
- file_presentation_unknown_content_type.test^headers^
- test_presentation_tcp_receiver_establish_connection_unknown_content_type.js
- file_presentation_mixed_security_contexts.html
-
-[test_presentation_dc_sender.html]
-[test_presentation_dc_receiver.html]
-skip-if = (e10s || toolkit == 'android') # Bug 1129785
-[test_presentation_dc_receiver_oop.html]
-skip-if = (e10s || toolkit == 'android') # Bug 1129785
-[test_presentation_1ua_sender_and_receiver_inproc.html]
-skip-if = (e10s || toolkit == 'android') # Bug 1129785
-[test_presentation_1ua_sender_and_receiver_oop.html]
-skip-if = (e10s || toolkit == 'android') # Bug 1129785
-[test_presentation_1ua_connection_wentaway_inproc.html]
-skip-if = (e10s || toolkit == 'android') # Bug 1129785
-[test_presentation_1ua_connection_wentaway_oop.html]
-skip-if = (e10s || toolkit == 'android') # Bug 1129785
-[test_presentation_device_info_permission.html]
-[test_presentation_tcp_sender_disconnect.html]
-skip-if = toolkit == 'android' # Bug 1129785
-[test_presentation_tcp_sender_establish_connection_error.html]
-skip-if = toolkit == 'android' # Bug 1129785
-[test_presentation_tcp_receiver_establish_connection_error.html]
-skip-if = (e10s || toolkit == 'android' || os == 'mac' || os == 'win') # Bug 1129785, Bug 1204709
-[test_presentation_tcp_receiver_establish_connection_timeout.html]
-skip-if = (e10s || toolkit == 'android') # Bug 1129785
-[test_presentation_tcp_receiver_establish_connection_unknown_content_type_inproc.html]
-skip-if = (e10s || toolkit == 'android')
-[test_presentation_tcp_receiver_establish_connection_unknown_content_type_oop.html]
-skip-if = (e10s || toolkit == 'android')
-[test_presentation_tcp_receiver.html]
-skip-if = (e10s || toolkit == 'android') # Bug 1129785
-[test_presentation_tcp_receiver_oop.html]
-skip-if = (e10s || toolkit == 'android') # Bug 1129785
-[test_presentation_receiver_auxiliary_navigation_inproc.html]
-skip-if = e10s
-[test_presentation_receiver_auxiliary_navigation_oop.html]
-skip-if = e10s
-[test_presentation_terminate_inproc.html]
-skip-if = (e10s || toolkit == 'android')
-[test_presentation_terminate_oop.html]
-skip-if = (e10s || toolkit == 'android')
-[test_presentation_terminate_establish_connection_error_inproc.html]
-skip-if = (e10s || toolkit == 'android')
-[test_presentation_terminate_establish_connection_error_oop.html]
-skip-if = (e10s || toolkit == 'android')
-[test_presentation_sender_on_terminate_request.html]
-skip-if = toolkit == 'android'
-[test_presentation_sandboxed_presentation.html]
-skip-if = true # bug 1315867
-[test_presentation_reconnect.html]
-[test_presentation_mixed_security_contexts.html]
-[test_presentation_availability.html]
diff --git a/dom/presentation/tests/mochitest/test_presentation_1ua_connection_wentaway.js b/dom/presentation/tests/mochitest/test_presentation_1ua_connection_wentaway.js
deleted file mode 100644
index dbeb4ffcc..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_1ua_connection_wentaway.js
+++ /dev/null
@@ -1,175 +0,0 @@
-'use strict';
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestFlakyTimeout('Test for guarantee not firing async event');
-
-function debug(str) {
- // info(str);
-}
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript1UA.js'));
-var receiverUrl = SimpleTest.getTestFileURL('file_presentation_1ua_wentaway.html');
-var request;
-var connection;
-var receiverIframe;
-
-function setup() {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- debug('Got message: device-prompt');
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- });
-
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established',
- controlChannelEstablishedHandler);
- gScript.sendAsyncMessage("trigger-control-channel-open");
- });
-
- gScript.addMessageListener('sender-launch', function senderLaunchHandler(url) {
- debug('Got message: sender-launch');
- gScript.removeMessageListener('sender-launch', senderLaunchHandler);
- is(url, receiverUrl, 'Receiver: should receive the same url');
- receiverIframe = document.createElement('iframe');
- receiverIframe.setAttribute("mozbrowser", "true");
- receiverIframe.setAttribute("mozpresentation", receiverUrl);
- var oop = location.pathname.indexOf('_inproc') == -1;
- receiverIframe.setAttribute("remote", oop);
-
- receiverIframe.setAttribute('src', receiverUrl);
- receiverIframe.addEventListener("mozbrowserloadend", function mozbrowserloadendHander() {
- receiverIframe.removeEventListener("mozbrowserloadend", mozbrowserloadendHander);
- info("Receiver loaded.");
- });
-
- // This event is triggered when the iframe calls "alert".
- receiverIframe.addEventListener("mozbrowsershowmodalprompt", function receiverListener(evt) {
- var message = evt.detail.message;
- if (/^OK /.exec(message)) {
- ok(true, message.replace(/^OK /, ""));
- } else if (/^KO /.exec(message)) {
- ok(false, message.replace(/^KO /, ""));
- } else if (/^INFO /.exec(message)) {
- info(message.replace(/^INFO /, ""));
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ""));
- gScript.sendAsyncMessage(command.name, command.data);
- } else if (/^DONE$/.exec(message)) {
- receiverIframe.removeEventListener("mozbrowsershowmodalprompt",
- receiverListener);
- teardown();
- }
- }, false);
-
- var promise = new Promise(function(aResolve, aReject) {
- document.body.appendChild(receiverIframe);
- aResolve(receiverIframe);
- });
-
- var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
- .getService(SpecialPowers.Ci.nsIObserverService);
- obs.notifyObservers(promise, 'setup-request-promise', null);
- });
-
- gScript.addMessageListener('promise-setup-ready', function promiseSetupReadyHandler() {
- debug('Got message: promise-setup-ready');
- gScript.removeMessageListener('promise-setup-ready',
- promiseSetupReadyHandler);
- gScript.sendAsyncMessage('trigger-on-session-request', receiverUrl);
- });
-
- return Promise.resolve();
-}
-
-function testCreateRequest() {
- return new Promise(function(aResolve, aReject) {
- info('Sender: --- testCreateRequest ---');
- request = new PresentationRequest(receiverUrl);
- request.getAvailability().then((aAvailability) => {
- is(aAvailability.value, false, "Sender: should have no available device after setup");
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(aAvailability.value, "Sender: Device should be available.");
- aResolve();
- }
-
- gScript.sendAsyncMessage('trigger-device-add');
- }).catch((aError) => {
- ok(false, "Sender: Error occurred when getting availability: " + aError);
- teardown();
- aReject();
- });
- });
-}
-
-function testStartConnection() {
- return new Promise(function(aResolve, aReject) {
- request.start().then((aConnection) => {
- connection = aConnection;
- ok(connection, "Sender: Connection should be available.");
- ok(connection.id, "Sender: Connection ID should be set.");
- is(connection.state, "connecting", "Sender: The initial state should be connecting.");
- connection.onconnect = function() {
- connection.onconnect = null;
- is(connection.state, "connected", "Connection should be connected.");
- aResolve();
- };
- }).catch((aError) => {
- ok(false, "Sender: Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- });
- });
-}
-
-function testConnectionWentaway() {
- return new Promise(function(aResolve, aReject) {
- info('Sender: --- testConnectionWentaway ---');
- connection.onclose = function() {
- connection.onclose = null;
- is(connection.state, "closed", "Sender: Connection should be closed.");
- receiverIframe.addEventListener('mozbrowserclose', function closeHandler() {
- ok(false, 'wentaway should not trigger receiver close');
- aResolve();
- });
- setTimeout(aResolve, 3000);
- };
- gScript.addMessageListener('ready-to-remove-receiverFrame', function onReadyToRemove() {
- gScript.removeMessageListener('ready-to-remove-receiverFrame', onReadyToRemove);
- receiverIframe.src = "http://example.com";
- });
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- debug('Got message: teardown-complete');
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- setup().then(testCreateRequest)
- .then(testStartConnection)
- .then(testConnectionWentaway)
- .then(teardown);
-}
-
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
- {type: "browser", allow: true, context: document},
-], () => {
- SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.receiver.enabled", true],
- ["dom.presentation.test.enabled", true],
- ["dom.mozBrowserFramesEnabled", true],
- ["dom.ipc.tabs.disabled", false],
- ["network.disable.ipc.security", true],
- ["dom.presentation.test.stage", 0]]},
- runTests);
-});
diff --git a/dom/presentation/tests/mochitest/test_presentation_1ua_connection_wentaway_inproc.html b/dom/presentation/tests/mochitest/test_presentation_1ua_connection_wentaway_inproc.html
deleted file mode 100644
index 68491d81b..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_1ua_connection_wentaway_inproc.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
- <!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
- <head>
- <meta charset="utf-8">
- <title>Test for B2G Presentation API when sender and receiver at the same side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- </head>
- <body>
- <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1258600">
- Test for PresentationConnectionCloseEvent with wentaway reason</a>
- <script type="application/javascript;version=1.8" src="test_presentation_1ua_connection_wentaway.js">
- </script>
- </body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_1ua_connection_wentaway_oop.html b/dom/presentation/tests/mochitest/test_presentation_1ua_connection_wentaway_oop.html
deleted file mode 100644
index 68491d81b..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_1ua_connection_wentaway_oop.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
- <!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
- <head>
- <meta charset="utf-8">
- <title>Test for B2G Presentation API when sender and receiver at the same side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- </head>
- <body>
- <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1258600">
- Test for PresentationConnectionCloseEvent with wentaway reason</a>
- <script type="application/javascript;version=1.8" src="test_presentation_1ua_connection_wentaway.js">
- </script>
- </body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_1ua_sender_and_receiver.js b/dom/presentation/tests/mochitest/test_presentation_1ua_sender_and_receiver.js
deleted file mode 100644
index 8a7787b40..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_1ua_sender_and_receiver.js
+++ /dev/null
@@ -1,370 +0,0 @@
-/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
-* You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-'use strict';
-
-function debug(str) {
- // info(str);
-}
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript1UA.js'));
-var receiverUrl = SimpleTest.getTestFileURL('file_presentation_1ua_receiver.html');
-var request;
-var connection;
-var receiverIframe;
-var presentationId;
-const DATA_ARRAY = [0, 255, 254, 0, 1, 2, 3, 0, 255, 255, 254, 0];
-const DATA_ARRAY_BUFFER = new ArrayBuffer(DATA_ARRAY.length);
-const TYPED_DATA_ARRAY = new Uint8Array(DATA_ARRAY_BUFFER);
-TYPED_DATA_ARRAY.set(DATA_ARRAY);
-
-function postMessageToIframe(aType) {
- receiverIframe.src = receiverUrl + "#" +
- encodeURIComponent(JSON.stringify({ type: aType }));
-}
-
-function setup() {
-
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- debug('Got message: device-prompt');
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- });
-
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established',
- controlChannelEstablishedHandler);
- gScript.sendAsyncMessage("trigger-control-channel-open");
- });
-
- gScript.addMessageListener('sender-launch', function senderLaunchHandler(url) {
- debug('Got message: sender-launch');
- gScript.removeMessageListener('sender-launch', senderLaunchHandler);
- is(url, receiverUrl, 'Receiver: should receive the same url');
- receiverIframe = document.createElement('iframe');
- receiverIframe.setAttribute('src', receiverUrl);
- receiverIframe.setAttribute("mozbrowser", "true");
- receiverIframe.setAttribute("mozpresentation", receiverUrl);
- var oop = location.pathname.indexOf('_inproc') == -1;
- receiverIframe.setAttribute("remote", oop);
-
- // This event is triggered when the iframe calls "alert".
- receiverIframe.addEventListener("mozbrowsershowmodalprompt", function receiverListener(evt) {
- var message = evt.detail.message;
- debug('Got iframe message: ' + message);
- if (/^OK /.exec(message)) {
- ok(true, message.replace(/^OK /, ""));
- } else if (/^KO /.exec(message)) {
- ok(false, message.replace(/^KO /, ""));
- } else if (/^INFO /.exec(message)) {
- info(message.replace(/^INFO /, ""));
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ""));
- gScript.sendAsyncMessage(command.name, command.data);
- } else if (/^DONE$/.exec(message)) {
- receiverIframe.removeEventListener("mozbrowsershowmodalprompt",
- receiverListener);
- }
- }, false);
-
- var promise = new Promise(function(aResolve, aReject) {
- document.body.appendChild(receiverIframe);
- aResolve(receiverIframe);
- });
-
- var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
- .getService(SpecialPowers.Ci.nsIObserverService);
- obs.notifyObservers(promise, 'setup-request-promise', null);
- });
-
- gScript.addMessageListener('promise-setup-ready', function promiseSetupReadyHandler() {
- debug('Got message: promise-setup-ready');
- gScript.removeMessageListener('promise-setup-ready', promiseSetupReadyHandler);
- gScript.sendAsyncMessage('trigger-on-session-request', receiverUrl);
- });
-
- return Promise.resolve();
-}
-
-function testCreateRequest() {
- return new Promise(function(aResolve, aReject) {
- info('Sender: --- testCreateRequest ---');
- request = new PresentationRequest("file_presentation_1ua_receiver.html");
- request.getAvailability().then((aAvailability) => {
- is(aAvailability.value, false, "Sender: should have no available device after setup");
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(aAvailability.value, "Sender: Device should be available.");
- aResolve();
- }
-
- gScript.sendAsyncMessage('trigger-device-add');
- }).catch((aError) => {
- ok(false, "Sender: Error occurred when getting availability: " + aError);
- teardown();
- aReject();
- });
- });
-}
-
-function testStartConnection() {
- return new Promise(function(aResolve, aReject) {
- request.start().then((aConnection) => {
- connection = aConnection;
- ok(connection, "Sender: Connection should be available.");
- ok(connection.id, "Sender: Connection ID should be set.");
- is(connection.state, "connecting", "The initial state should be connecting.");
- is(connection.url, receiverUrl, "request URL should be expanded to absolute URL");
- connection.onconnect = function() {
- connection.onconnect = null;
- is(connection.state, "connected", "Connection should be connected.");
- presentationId = connection.id;
- aResolve();
- };
- }).catch((aError) => {
- ok(false, "Sender: Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- });
-
- let request2 = new PresentationRequest("/");
- request2.start().then(() => {
- ok(false, "Sender: session start should fail while there is an unsettled promise.");
- }).catch((aError) => {
- is(aError.name, "OperationError", "Expect to get OperationError.");
- });
- });
-}
-
-function testSendMessage() {
- return new Promise(function(aResolve, aReject) {
- info('Sender: --- testSendMessage ---');
- gScript.addMessageListener('trigger-message-from-sender', function triggerMessageFromSenderHandler() {
- debug('Got message: trigger-message-from-sender');
- gScript.removeMessageListener('trigger-message-from-sender', triggerMessageFromSenderHandler);
- info('Send message to receiver');
- connection.send('msg-sender-to-receiver');
- });
-
- gScript.addMessageListener('message-from-sender-received', function messageFromSenderReceivedHandler() {
- debug('Got message: message-from-sender-received');
- gScript.removeMessageListener('message-from-sender-received', messageFromSenderReceivedHandler);
- aResolve();
- });
- });
-}
-
-function testIncomingMessage() {
- return new Promise(function(aResolve, aReject) {
- info('Sender: --- testIncomingMessage ---');
- connection.addEventListener('message', function messageHandler(evt) {
- connection.removeEventListener('message', messageHandler);
- let msg = evt.data;
- is(msg, "msg-receiver-to-sender", "Sender: Sender should receive message from Receiver");
- postMessageToIframe('message-from-receiver-received');
- aResolve();
- });
- postMessageToIframe('trigger-message-from-receiver');
- });
-}
-
-function testSendBlobMessage() {
- return new Promise(function(aResolve, aReject) {
- info('Sender: --- testSendBlobMessage ---');
- connection.addEventListener('message', function messageHandler(evt) {
- connection.removeEventListener('message', messageHandler);
- let msg = evt.data;
- is(msg, "testIncomingBlobMessage", "Sender: Sender should receive message from Receiver");
- let blob = new Blob(["Hello World"], {type : 'text/plain'});
- connection.send(blob);
- aResolve();
- });
- });
-}
-
-function testSendArrayBuffer() {
- return new Promise(function(aResolve, aReject) {
- info('Sender: --- testSendArrayBuffer ---');
- connection.addEventListener('message', function messageHandler(evt) {
- connection.removeEventListener('message', messageHandler);
- let msg = evt.data;
- is(msg, "testIncomingArrayBuffer", "Sender: Sender should receive message from Receiver");
- connection.send(DATA_ARRAY_BUFFER);
- aResolve();
- });
- });
-}
-
-function testSendArrayBufferView() {
- return new Promise(function(aResolve, aReject) {
- info('Sender: --- testSendArrayBufferView ---');
- connection.addEventListener('message', function messageHandler(evt) {
- connection.removeEventListener('message', messageHandler);
- let msg = evt.data;
- is(msg, "testIncomingArrayBufferView", "Sender: Sender should receive message from Receiver");
- connection.send(TYPED_DATA_ARRAY);
- aResolve();
- });
- });
-}
-
-function testCloseConnection() {
- info('Sender: --- testCloseConnection ---');
- // Test terminate immediate after close.
- function controlChannelEstablishedHandler()
- {
- gScript.removeMessageListener('control-channel-established',
- controlChannelEstablishedHandler);
- ok(false, "terminate after close should do nothing");
- }
- gScript.addMessageListener('ready-to-close', function onReadyToClose() {
- gScript.removeMessageListener('ready-to-close', onReadyToClose);
- connection.close();
-
- gScript.addMessageListener('control-channel-established', controlChannelEstablishedHandler);
- connection.terminate();
- });
-
- return Promise.all([
- new Promise(function(aResolve, aReject) {
- connection.onclose = function() {
- connection.onclose = null;
- is(connection.state, 'closed', 'Sender: Connection should be closed.');
- gScript.removeMessageListener('control-channel-established',
- controlChannelEstablishedHandler);
- aResolve();
- };
- }),
- new Promise(function(aResolve, aReject) {
- let timeout = setTimeout(function() {
- gScript.removeMessageListener('device-disconnected',
- deviceDisconnectedHandler);
- ok(true, "terminate after close should not trigger device.disconnect");
- aResolve();
- }, 3000);
-
- function deviceDisconnectedHandler() {
- gScript.removeMessageListener('device-disconnected',
- deviceDisconnectedHandler);
- ok(false, "terminate after close should not trigger device.disconnect");
- clearTimeout(timeout);
- aResolve();
- }
-
- gScript.addMessageListener('device-disconnected', deviceDisconnectedHandler);
- }),
- new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('receiver-closed', function onReceiverClosed() {
- gScript.removeMessageListener('receiver-closed', onReceiverClosed);
- gScript.removeMessageListener('control-channel-established',
- controlChannelEstablishedHandler);
- aResolve();
- });
- }),
- ]);
-}
-
-function testTerminateAfterClose() {
- info('Sender: --- testTerminateAfterClose ---');
- return Promise.race([
- new Promise(function(aResolve, aReject) {
- connection.onterminate = function() {
- connection.onterminate = null;
- ok(false, 'terminate after close should do nothing');
- aResolve();
- };
- connection.terminate();
- }),
- new Promise(function(aResolve, aReject) {
- setTimeout(function() {
- is(connection.state, 'closed', 'Sender: Connection should be closed.');
- aResolve();
- }, 3000);
- }),
- ]);
-}
-
-function testReconnect() {
- return new Promise(function(aResolve, aReject) {
- info('Sender: --- testReconnect ---');
- gScript.addMessageListener('control-channel-established', function controlChannelEstablished() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablished);
- gScript.sendAsyncMessage("trigger-control-channel-open");
- });
-
- gScript.addMessageListener('start-reconnect', function startReconnectHandler(url) {
- debug('Got message: start-reconnect');
- gScript.removeMessageListener('start-reconnect', startReconnectHandler);
- is(url, receiverUrl, "URLs should be the same.")
- gScript.sendAsyncMessage('trigger-reconnected-acked', url);
- });
-
- gScript.addMessageListener('ready-to-reconnect', function onReadyToReconnect() {
- gScript.removeMessageListener('ready-to-reconnect', onReadyToReconnect);
- request.reconnect(presentationId).then((aConnection) => {
- connection = aConnection;
- ok(connection, "Sender: Connection should be available.");
- is(connection.id, presentationId, "The presentationId should be the same.");
- is(connection.state, "connecting", "The initial state should be connecting.");
- connection.onconnect = function() {
- connection.onconnect = null;
- is(connection.state, "connected", "Connection should be connected.");
- aResolve();
- };
- }).catch((aError) => {
- ok(false, "Sender: Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- });
- });
-
- postMessageToIframe('prepare-for-reconnect');
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- debug('Got message: teardown-complete');
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- setup().then(testCreateRequest)
- .then(testStartConnection)
- .then(testSendMessage)
- .then(testIncomingMessage)
- .then(testSendBlobMessage)
- .then(testCloseConnection)
- .then(testReconnect)
- .then(testSendArrayBuffer)
- .then(testSendArrayBufferView)
- .then(testCloseConnection)
- .then(testTerminateAfterClose)
- .then(teardown);
-}
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestFlakyTimeout('Test for guarantee not firing async event');
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
- {type: "browser", allow: true, context: document},
-], () => {
- SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- /* Mocked TCP session transport builder in the test */
- ["dom.presentation.session_transport.data_channel.enable", true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.receiver.enabled", true],
- ["dom.presentation.test.enabled", true],
- ["dom.presentation.test.stage", 0],
- ["dom.mozBrowserFramesEnabled", true],
- ["network.disable.ipc.security", true],
- ["media.navigator.permission.disabled", true]]},
- runTests);
-});
diff --git a/dom/presentation/tests/mochitest/test_presentation_1ua_sender_and_receiver_inproc.html b/dom/presentation/tests/mochitest/test_presentation_1ua_sender_and_receiver_inproc.html
deleted file mode 100644
index 520b1a98c..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_1ua_sender_and_receiver_inproc.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
- <!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
- <head>
- <meta charset="utf-8">
- <title>Test for B2G Presentation API when sender and receiver at the same side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- </head>
- <body>
- <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1234492">
- Test for B2G Presentation API when sender and receiver at the same side</a>
- <script type="application/javascript;version=1.8" src="test_presentation_1ua_sender_and_receiver.js">
- </script>
- </body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_1ua_sender_and_receiver_oop.html b/dom/presentation/tests/mochitest/test_presentation_1ua_sender_and_receiver_oop.html
deleted file mode 100644
index e744e6802..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_1ua_sender_and_receiver_oop.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
- <head>
- <meta charset="utf-8">
- <title>Test for B2G Presentation API when sender and receiver at the same side (OOP ver.)</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- </head>
- <body>
- <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1234492">
- Test for B2G Presentation API when sender and receiver at the same side (OOP ver.)</a>
- <script type="application/javascript;version=1.8" src="test_presentation_1ua_sender_and_receiver.js">
- </script>
- </body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_availability.html b/dom/presentation/tests/mochitest/test_presentation_availability.html
deleted file mode 100644
index 89f1ad1b7..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_availability.html
+++ /dev/null
@@ -1,236 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for PresentationAvailability</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1228508">Test PresentationAvailability</a>
-<script type="application/javascript;version=1.8">
-
-"use strict";
-
-var testDevice = {
- id: 'id',
- name: 'name',
- type: 'type',
-};
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationDeviceInfoChromeScript.js'));
-var request;
-var availability;
-
-function testSetup() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('setup-complete', function() {
- aResolve();
- });
- gScript.sendAsyncMessage('setup');
- });
-}
-
-function testInitialUnavailable() {
- request = new PresentationRequest("https://example.com");
-
- return request.getAvailability().then(function(aAvailability) {
- is(aAvailability.value, false, "Should have no available device after setup");
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(aAvailability.value, "Device should be available.");
- }
- availability = aAvailability;
- gScript.sendAsyncMessage('trigger-device-add', testDevice);
- }).catch(function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- teardown();
- });
-}
-
-function testInitialAvailable() {
- let anotherRequest = new PresentationRequest("https://example.net");
- return anotherRequest.getAvailability().then(function(aAvailability) {
- is(aAvailability.value, true, "Should have available device initially");
- isnot(aAvailability, availability, "Should get different availability object for different request URL");
- }).catch(function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- teardown();
- });
-}
-
-function testSameObject() {
- let sameUrlRequest = new PresentationRequest("https://example.com");
- return sameUrlRequest.getAvailability().then(function(aAvailability) {
- is(aAvailability, availability, "Should get same availability object for same request URL");
- }).catch(function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- teardown();
- });
-}
-
-function testOnChangeEvent() {
- return new Promise(function(aResolve, aReject) {
- availability.onchange = function() {
- availability.onchange = null;
- is(availability.value, false, "Should have no available device after device removed");
- aResolve();
- }
- gScript.sendAsyncMessage('trigger-device-remove');
- });
-}
-
-function testConsecutiveGetAvailability() {
- let request = new PresentationRequest("https://example.org");
- let firstAvailabilityResolved = false;
- return Promise.all([
- request.getAvailability().then(function() {
- firstAvailabilityResolved = true;
- }),
- request.getAvailability().then(function() {
- ok(firstAvailabilityResolved, "getAvailability() should be resolved in sequence");
- })
- ]).catch(function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- teardown();
- });
-}
-
-function testUnsupportedDeviceAvailability() {
- return Promise.race([
- new Promise(function(aResolve, aReject) {
- let request = new PresentationRequest("https://test.com");
- request.getAvailability().then(function(aAvailability) {
- availability = aAvailability;
- aAvailability.onchange = function() {
- availability.onchange = null;
- ok(false, "Should not get onchange event.");
- teardown();
- }
- });
- gScript.sendAsyncMessage('trigger-add-unsupport-url-device');
- }),
- new Promise(function(aResolve, aReject) {
- setTimeout(function() {
- ok(true, "Should not get onchange event.");
- availability.onchange = null;
- gScript.sendAsyncMessage('trigger-remove-unsupported-device');
- aResolve();
- }, 3000);
- }),
- ]);
-}
-
-function testMultipleAvailabilityURLs() {
- let request1 = new PresentationRequest(["https://example.com",
- "https://example1.com"]);
- let request2 = new PresentationRequest(["https://example1.com",
- "https://example2.com"]);
- return Promise.all([
- request1.getAvailability().then(function(aAvailability) {
- return new Promise(function(aResolve) {
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(true, "Should get onchange event.");
- aResolve();
- };
- });
- }),
- request2.getAvailability().then(function(aAvailability) {
- return new Promise(function(aResolve) {
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(true, "Should get onchange event.");
- aResolve();
- };
- });
- }),
- new Promise(function(aResolve) {
- gScript.sendAsyncMessage('trigger-add-multiple-devices');
- aResolve();
- }),
- ]).then(new Promise(function(aResolve) {
- gScript.sendAsyncMessage('trigger-remove-multiple-devices');
- aResolve();
- }));
-}
-
-function testPartialSupportedDeviceAvailability() {
- let request1 = new PresentationRequest(["https://supportedUrl.com"]);
- let request2 = new PresentationRequest(["http://notSupportedUrl.com"]);
-
- return Promise.all([
- request1.getAvailability().then(function(aAvailability) {
- return new Promise(function(aResolve) {
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(true, "Should get onchange event.");
- aResolve();
- };
- });
- }),
- Promise.race([
- request2.getAvailability().then(function(aAvailability) {
- return new Promise(function(aResolve) {
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(false, "Should get onchange event.");
- aResolve();
- };
- });
- }),
- new Promise(function(aResolve) {
- setTimeout(function() {
- ok(true, "Should not get onchange event.");
- availability.onchange = null;
- aResolve();
- }, 3000);
- }),
- ]),
- new Promise(function(aResolve) {
- gScript.sendAsyncMessage('trigger-add-https-devices');
- aResolve();
- }),
- ]).then(new Promise(function(aResolve) {
- gScript.sendAsyncMessage('trigger-remove-https-devices');
- aResolve();
- }));
-}
-
-function teardown() {
- request = null;
- availability = null;
- gScript.sendAsyncMessage('teardown');
- gScript.destroy();
- SimpleTest.finish();
-}
-
-function runTests() {
- ok(navigator.presentation, "navigator.presentation should be available.");
- testSetup().then(testInitialUnavailable)
- .then(testInitialAvailable)
- .then(testSameObject)
- .then(testOnChangeEvent)
- .then(testConsecutiveGetAvailability)
- .then(testMultipleAvailabilityURLs)
- .then(testUnsupportedDeviceAvailability)
- .then(testPartialSupportedDeviceAvailability)
- .then(teardown);
-}
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestFlakyTimeout('Test for guarantee not firing async event');
-SpecialPowers.pushPermissions([
- {type: "presentation-device-manage", allow: false, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ "set": [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.session_transport.data_channel.enable", false]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_datachannel_sessiontransport.html b/dom/presentation/tests/mochitest/test_presentation_datachannel_sessiontransport.html
deleted file mode 100644
index 89a51afb7..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_datachannel_sessiontransport.html
+++ /dev/null
@@ -1,245 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for data channel as session transport in Presentation API</title>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1148307">Test for data channel as session transport in Presentation API</a>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-"use strict";
-
-SimpleTest.waitForExplicitFinish();
-
-const loadingTimeoutPref = "presentation.receiver.loading.timeout";
-
-var clientBuilder;
-var serverBuilder;
-var clientTransport;
-var serverTransport;
-
-const clientMessage = "Client Message";
-const serverMessage = "Server Message";
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-const { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-const { Services } = Cu.import("resource://gre/modules/Services.jsm");
-
-var isClientReady = false;
-var isServerReady = false;
-var isClientClosed = false;
-var isServerClosed = false;
-
-var gResolve;
-var gReject;
-
-const clientCallback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationSessionTransportCallback]),
- notifyTransportReady: function () {
- info("Client transport ready.");
-
- isClientReady = true;
- if (isClientReady && isServerReady) {
- gResolve();
- }
- },
- notifyTransportClosed: function (aReason) {
- info("Client transport is closed.");
-
- isClientClosed = true;
- if (isClientClosed && isServerClosed) {
- gResolve();
- }
- },
- notifyData: function(aData) {
- is(aData, serverMessage, "Client transport receives data.");
- gResolve();
- },
-};
-
-const serverCallback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationSessionTransportCallback]),
- notifyTransportReady: function () {
- info("Server transport ready.");
-
- isServerReady = true;
- if (isClientReady && isServerReady) {
- gResolve();
- }
- },
- notifyTransportClosed: function (aReason) {
- info("Server transport is closed.");
-
- isServerClosed = true;
- if (isClientClosed && isServerClosed) {
- gResolve();
- }
- },
- notifyData: function(aData) {
- is(aData, clientMessage, "Server transport receives data.");
- gResolve()
- },
-};
-
-const clientListener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationSessionTransportBuilderListener]),
- onSessionTransport: function(aTransport) {
- info("Client Transport is built.");
- clientTransport = aTransport;
- clientTransport.callback = clientCallback;
- },
- onError: function(aError) {
- ok(false, "client's builder reports error " + aError);
- },
- sendOffer: function(aOffer) {
- setTimeout(()=>this._remoteBuilder.onOffer(aOffer), 0);
- },
- sendAnswer: function(aAnswer) {
- setTimeout(()=>this._remoteBuilder.onAnswer(aAnswer), 0);
- },
- sendIceCandidate: function(aCandidate) {
- setTimeout(()=>this._remoteBuilder.onIceCandidate(aCandidate), 0);
- },
- disconnect: function(aReason) {
- setTimeout(()=>this._localBuilder.notifyDisconnected(aReason), 0);
- setTimeout(()=>this._remoteBuilder.notifyDisconnected(aReason), 0);
- },
- set remoteBuilder(aRemoteBuilder) {
- this._remoteBuilder = aRemoteBuilder;
- },
- set localBuilder(aLocalBuilder) {
- this._localBuilder = aLocalBuilder;
- },
-}
-
-const serverListener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationSessionTransportBuilderListener]),
- onSessionTransport: function(aTransport) {
- info("Server Transport is built.");
- serverTransport = aTransport;
- serverTransport.callback = serverCallback;
- serverTransport.enableDataNotification();
- },
- onError: function(aError) {
- ok(false, "server's builder reports error " + aError);
- },
- sendOffer: function(aOffer) {
- setTimeout(()=>this._remoteBuilder.onOffer(aOffer), 0);
- },
- sendAnswer: function(aAnswer) {
- setTimeout(()=>this._remoteBuilder.onAnswer(aAnswer), 0);
- },
- sendIceCandidate: function(aCandidate) {
- setTimeout(()=>this._remoteBuilder.onIceCandidate(aCandidate), 0);
- },
- disconnect: function(aReason) {
- setTimeout(()=>this._localBuilder.notifyDisconnected(aReason), 0);
- setTimeout(()=>this._remoteBuilder.notifyDisconnected(aReason), 0);
- },
- set remoteBuilder(aRemoteBuilder) {
- this._remoteBuilder = aRemoteBuilder;
- },
- set localBuilder(aLocalBuilder) {
- this._localBuilder = aLocalBuilder;
- },
-}
-
-function testBuilder() {
- return new Promise(function(aResolve, aReject) {
- gResolve = aResolve;
- gReject = aReject;
-
- clientBuilder = Cc["@mozilla.org/presentation/datachanneltransportbuilder;1"]
- .createInstance(Ci.nsIPresentationDataChannelSessionTransportBuilder);
- serverBuilder = Cc["@mozilla.org/presentation/datachanneltransportbuilder;1"]
- .createInstance(Ci.nsIPresentationDataChannelSessionTransportBuilder);
-
- clientListener.localBuilder = clientBuilder;
- clientListener.remoteBuilder = serverBuilder;
- serverListener.localBuilder = serverBuilder;
- serverListener.remoteBuilder = clientBuilder;
-
- clientBuilder
- .buildDataChannelTransport(Ci.nsIPresentationService.ROLE_CONTROLLER,
- window,
- clientListener);
-
- serverBuilder
- .buildDataChannelTransport(Ci.nsIPresentationService.ROLE_RECEIVER,
- window,
- serverListener);
- });
-}
-
-function testClientSendMessage() {
- return new Promise(function(aResolve, aReject) {
- info("client sends message");
- gResolve = aResolve;
- gReject = aReject;
-
- clientTransport.send(clientMessage);
- });
-}
-
-function testServerSendMessage() {
- return new Promise(function(aResolve, aReject) {
- info("server sends message");
- gResolve = aResolve;
- gReject = aReject;
-
- serverTransport.send(serverMessage);
- setTimeout(()=>clientTransport.enableDataNotification(), 0);
- });
-}
-
-function testCloseSessionTransport() {
- return new Promise(function(aResolve, aReject) {
- info("close session transport");
- gResolve = aResolve;
- gReject = aReject;
-
- serverTransport.close(Cr.NS_OK);
- });
-}
-
-function finish() {
- info("test finished, teardown");
- Services.prefs.clearUserPref(loadingTimeoutPref);
-
- SimpleTest.finish();
-}
-
-function error(aError) {
- ok(false, "report Error " + aError.name + ":" + aError.message);
- gReject();
-}
-
-function runTests() {
- Services.prefs.setIntPref(loadingTimeoutPref, 30000);
-
- testBuilder()
- .then(testClientSendMessage)
- .then(testServerSendMessage)
- .then(testCloseSessionTransport)
- .then(finish)
- .catch(error);
-
-}
-
-window.addEventListener("load", function() {
- runTests();
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_dc_receiver.html b/dom/presentation/tests/mochitest/test_presentation_dc_receiver.html
deleted file mode 100644
index a42489bdb..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_dc_receiver.html
+++ /dev/null
@@ -1,141 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for B2G PresentationConnection API at receiver side</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1148307">Test for B2G PresentationConnection API at receiver side</a>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test"></pre>
-<script type="application/javascript">
-
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var receiverUrl = SimpleTest.getTestFileURL('file_presentation_receiver.html');
-
-var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
- .getService(SpecialPowers.Ci.nsIObserverService);
-
-function setup() {
- return new Promise(function(aResolve, aReject) {
- gScript.sendAsyncMessage('trigger-device-add');
-
- var iframe = document.createElement('iframe');
- iframe.setAttribute('src', receiverUrl);
- iframe.setAttribute("mozbrowser", "true");
- iframe.setAttribute("mozpresentation", receiverUrl);
-
- // This event is triggered when the iframe calls "alert".
- iframe.addEventListener("mozbrowsershowmodalprompt", function receiverListener(evt) {
- var message = evt.detail.message;
- if (/^OK /.exec(message)) {
- ok(true, message.replace(/^OK /, ""));
- } else if (/^KO /.exec(message)) {
- ok(false, message.replace(/^KO /, ""));
- } else if (/^INFO /.exec(message)) {
- info(message.replace(/^INFO /, ""));
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ""));
- gScript.sendAsyncMessage(command.name, command.data);
- } else if (/^DONE$/.exec(message)) {
- iframe.removeEventListener("mozbrowsershowmodalprompt",
- receiverListener);
- teardown();
- }
- }, false);
-
- var promise = new Promise(function(aResolve, aReject) {
- document.body.appendChild(iframe);
-
- aResolve(iframe);
- });
- obs.notifyObservers(promise, 'setup-request-promise', null);
-
- gScript.addMessageListener('offer-received', function offerReceivedHandler() {
- gScript.removeMessageListener('offer-received', offerReceivedHandler);
- info("An offer is received.");
- });
-
- gScript.addMessageListener('answer-sent', function answerSentHandler(aIsValid) {
- gScript.removeMessageListener('answer-sent', answerSentHandler);
- ok(aIsValid, "A valid answer is sent.");
- });
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- is(aReason, SpecialPowers.Cr.NS_OK, "The control channel is closed normally.");
- });
-
- gScript.addMessageListener('check-navigator', function checknavigatorHandler(aSuccess) {
- gScript.removeMessageListener('check-navigator', checknavigatorHandler);
- ok(aSuccess, "buildDataChannel get correct window object");
- });
-
- gScript.addMessageListener('data-transport-notification-enabled', function dataTransportNotificationEnabledHandler() {
- gScript.removeMessageListener('data-transport-notification-enabled', dataTransportNotificationEnabledHandler);
- info("Data notification is enabled for data transport channel.");
- });
-
- gScript.addMessageListener('data-transport-closed', function dataTransportClosedHandler(aReason) {
- gScript.removeMessageListener('data-transport-closed', dataTransportClosedHandler);
- is(aReason, SpecialPowers.Cr.NS_OK, "The data transport should be closed normally.");
- });
-
- aResolve();
- });
-}
-
-function testIncomingSessionRequest() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('receiver-launching', function launchReceiverHandler(aSessionId) {
- gScript.removeMessageListener('receiver-launching', launchReceiverHandler);
- info("Trying to launch receiver page.");
-
- ok(navigator.presentation, "navigator.presentation should be available in in-process pages.");
- is(navigator.presentation.receiver, null, "Non-receiving in-process pages shouldn't get a presentation receiver instance.");
- aResolve();
- });
-
- gScript.sendAsyncMessage('trigger-incoming-session-request', receiverUrl);
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- setup().
- then(testIncomingSessionRequest);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
- {type: "browser", allow: true, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", false],
- ["dom.presentation.receiver.enabled", true],
- ["dom.presentation.session_transport.data_channel.enable", true],
- ["dom.mozBrowserFramesEnabled", true],
- ["network.disable.ipc.security", true]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_dc_receiver_oop.html b/dom/presentation/tests/mochitest/test_presentation_dc_receiver_oop.html
deleted file mode 100644
index b289b0be6..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_dc_receiver_oop.html
+++ /dev/null
@@ -1,213 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for B2G PresentationConnection API at receiver side (OOP)</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="PresentationSessionFrameScript.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1148307">Test B2G PresentationConnection API at receiver side (OOP)</a>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test"></pre>
-<script type="application/javascript">
-
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var receiverUrl = SimpleTest.getTestFileURL('file_presentation_receiver.html');
-var nonReceiverUrl = SimpleTest.getTestFileURL('file_presentation_non_receiver.html');
-
-var isReceiverFinished = false;
-var isNonReceiverFinished = false;
-
-var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
- .getService(SpecialPowers.Ci.nsIObserverService);
-var receiverIframe;
-
-function setup() {
- return new Promise(function(aResolve, aReject) {
- gScript.sendAsyncMessage('trigger-device-add');
-
- // Create a receiver OOP iframe.
- receiverIframe = document.createElement('iframe');
- receiverIframe.setAttribute('remote', 'true');
- receiverIframe.setAttribute('mozbrowser', 'true');
- receiverIframe.setAttribute('mozpresentation', receiverUrl);
- receiverIframe.setAttribute('src', receiverUrl);
-
- // This event is triggered when the iframe calls "alert".
- receiverIframe.addEventListener('mozbrowsershowmodalprompt', function receiverListener(aEvent) {
- var message = aEvent.detail.message;
- if (/^OK /.exec(message)) {
- ok(true, "Message from iframe: " + message);
- } else if (/^KO /.exec(message)) {
- ok(false, "Message from iframe: " + message);
- } else if (/^INFO /.exec(message)) {
- info("Message from iframe: " + message);
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ''));
- if (command.name == "trigger-incoming-message") {
- var mm = SpecialPowers.getBrowserFrameMessageManager(receiverIframe);
- mm.sendAsyncMessage('trigger-incoming-message', {"data": command.data});
- } else {
- gScript.sendAsyncMessage(command.name, command.data);
- }
- } else if (/^DONE$/.exec(message)) {
- ok(true, "Messaging from iframe complete.");
- receiverIframe.removeEventListener('mozbrowsershowmodalprompt', receiverListener);
-
- isReceiverFinished = true;
-
- if (isNonReceiverFinished) {
- teardown();
- }
- }
- }, false);
-
- var promise = new Promise(function(aResolve, aReject) {
- document.body.appendChild(receiverIframe);
- receiverIframe.addEventListener("mozbrowserloadstart", function onLoadEnd() {
- receiverIframe.removeEventListener("mozbrowserloadstart", onLoadEnd);
- var mm = SpecialPowers.getBrowserFrameMessageManager(receiverIframe);
- mm.loadFrameScript("data:,(" + loadPrivilegedScriptTest.toString() + ")();", false);
- });
-
- aResolve(receiverIframe);
- });
- obs.notifyObservers(promise, 'setup-request-promise', null);
-
- // Create a non-receiver OOP iframe.
- var nonReceiverIframe = document.createElement('iframe');
- nonReceiverIframe.setAttribute('remote', 'true');
- nonReceiverIframe.setAttribute('mozbrowser', 'true');
- nonReceiverIframe.setAttribute('src', nonReceiverUrl);
-
- // This event is triggered when the iframe calls "alert".
- nonReceiverIframe.addEventListener('mozbrowsershowmodalprompt', function nonReceiverListener(aEvent) {
- var message = aEvent.detail.message;
- if (/^OK /.exec(message)) {
- ok(true, "Message from iframe: " + message);
- } else if (/^KO /.exec(message)) {
- ok(false, "Message from iframe: " + message);
- } else if (/^INFO /.exec(message)) {
- info("Message from iframe: " + message);
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ''));
- gScript.sendAsyncMessage(command.name, command.data);
- } else if (/^DONE$/.exec(message)) {
- ok(true, "Messaging from iframe complete.");
- nonReceiverIframe.removeEventListener('mozbrowsershowmodalprompt', nonReceiverListener);
-
- isNonReceiverFinished = true;
-
- if (isReceiverFinished) {
- teardown();
- }
- }
- }, false);
-
- document.body.appendChild(nonReceiverIframe);
-
- gScript.addMessageListener('offer-received', function offerReceivedHandler() {
- gScript.removeMessageListener('offer-received', offerReceivedHandler);
- info("An offer is received.");
- });
-
- gScript.addMessageListener('answer-sent', function answerSentHandler(aIsValid) {
- gScript.removeMessageListener('answer-sent', answerSentHandler);
- ok(aIsValid, "A valid answer is sent.");
- });
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- is(aReason, SpecialPowers.Cr.NS_OK, "The control channel is closed normally.");
- });
-
- var mm = SpecialPowers.getBrowserFrameMessageManager(receiverIframe);
- mm.addMessageListener('check-navigator', function checknavigatorHandler(aSuccess) {
- mm.removeMessageListener('check-navigator', checknavigatorHandler);
- ok(aSuccess.data.data, "buildDataChannel get correct window object");
- });
-
- mm.addMessageListener('data-transport-notification-enabled', function dataTransportNotificationEnabledHandler() {
- mm.removeMessageListener('data-transport-notification-enabled', dataTransportNotificationEnabledHandler);
- info("Data notification is enabled for data transport channel.");
- });
-
- mm.addMessageListener('data-transport-closed', function dataTransportClosedHandler(aReason) {
- mm.removeMessageListener('data-transport-closed', dataTransportClosedHandler);
- is(aReason.data.data, SpecialPowers.Cr.NS_OK, "The data transport should be closed normally.");
- });
-
- aResolve();
- });
-}
-
-function testIncomingSessionRequest() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('receiver-launching', function launchReceiverHandler(aSessionId) {
- gScript.removeMessageListener('receiver-launching', launchReceiverHandler);
- info("Trying to launch receiver page.");
-
- aResolve();
- });
-
- gScript.sendAsyncMessage('trigger-incoming-session-request', receiverUrl);
- });
-}
-
-var mmTeardownComplete = false;
-var gScriptTeardownComplete = false;
-function teardown() {
- var mm = SpecialPowers.getBrowserFrameMessageManager(receiverIframe);
- mm.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- mm.removeMessageListener('teardown-complete', teardownCompleteHandler);
- mmTeardownComplete = true;
- if (gScriptTeardownComplete) {
- SimpleTest.finish();
- }
- });
-
- mm.sendAsyncMessage('teardown');
-
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- gScriptTeardownComplete = true;
- if (mmTeardownComplete) {
- SimpleTest.finish();
- }
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- setup().
- then(testIncomingSessionRequest);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
- {type: 'browser', allow: true, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", false],
- ["dom.presentation.receiver.enabled", true],
- ["dom.presentation.session_transport.data_channel.enable", true],
- ["dom.mozBrowserFramesEnabled", true],
- ["network.disable.ipc.security", true],
- ["dom.ipc.browser_frames.oop_by_default", true],
- ["presentation.receiver.loading.timeout", 5000000]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_dc_sender.html b/dom/presentation/tests/mochitest/test_presentation_dc_sender.html
deleted file mode 100644
index 97e252e84..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_dc_sender.html
+++ /dev/null
@@ -1,291 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for B2G Presentation API at sender side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="PresentationSessionFrameScript.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1148307">Test for B2G Presentation API at sender side</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var frameScript = SpecialPowers.isMainProcess() ? gScript : contentScript;
-var request;
-var connection;
-
-function testSetup() {
- return new Promise(function(aResolve, aReject) {
- request = new PresentationRequest("http://example.com/");
-
- request.getAvailability().then(
- function(aAvailability) {
- is(aAvailability.value, false, "Sender: should have no available device after setup");
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(aAvailability.value, "Device should be available.");
- aResolve();
- }
-
- gScript.sendAsyncMessage('trigger-device-add');
- },
- function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testStartConnection() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- info("Device prompt is triggered.");
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- });
-
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
- info("A control channel is established.");
- gScript.sendAsyncMessage('trigger-control-channel-open');
- });
-
- gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler(aReason) {
- gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
- info("The control channel is opened.");
- });
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- info("The control channel is closed. " + aReason);
- });
-
- frameScript.addMessageListener('check-navigator', function checknavigatorHandler(aSuccess) {
- frameScript.removeMessageListener('check-navigator', checknavigatorHandler);
- ok(aSuccess, "buildDataChannel get correct window object");
- });
-
- gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
- gScript.removeMessageListener('offer-sent', offerSentHandler);
- ok(aIsValid, "A valid offer is sent out.");
- gScript.sendAsyncMessage('trigger-incoming-answer');
- });
-
- gScript.addMessageListener('answer-received', function answerReceivedHandler() {
- gScript.removeMessageListener('answer-received', answerReceivedHandler);
- info("An answer is received.");
- });
-
- frameScript.addMessageListener('data-transport-initialized', function dataTransportInitializedHandler() {
- frameScript.removeMessageListener('data-transport-initialized', dataTransportInitializedHandler);
- info("Data transport channel is initialized.");
- });
-
- frameScript.addMessageListener('data-transport-notification-enabled', function dataTransportNotificationEnabledHandler() {
- frameScript.removeMessageListener('data-transport-notification-enabled', dataTransportNotificationEnabledHandler);
- info("Data notification is enabled for data transport channel.");
- });
-
- var connectionFromEvent;
- request.onconnectionavailable = function(aEvent) {
- request.onconnectionavailable = null;
- connectionFromEvent = aEvent.connection;
- ok(connectionFromEvent, "|connectionavailable| event is fired with a connection.");
-
- if (connection) {
- is(connection, connectionFromEvent, "The connection from promise and the one from |connectionavailable| event should be the same.");
- }
- };
-
- request.start().then(
- function(aConnection) {
- connection = aConnection;
- ok(connection, "Connection should be available.");
- ok(connection.id, "Connection ID should be set.");
- is(connection.state, "connecting", "The initial state should be connecting.");
-
- if (connectionFromEvent) {
- is(connection, connectionFromEvent, "The connection from promise and the one from |connectionavailable| event should be the same.");
- }
- connection.onconnect = function() {
- connection.onconnect = null;
- is(connection.state, "connected", "Connection should be connected.");
- aResolve();
- };
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testSend() {
- return new Promise(function(aResolve, aReject) {
- const outgoingMessage = "test outgoing message";
-
- frameScript.addMessageListener('message-sent', function messageSentHandler(aMessage) {
- frameScript.removeMessageListener('message-sent', messageSentHandler);
- is(aMessage, outgoingMessage, "The message is sent out.");
- aResolve();
- });
-
- connection.send(outgoingMessage);
- });
-}
-
-function testIncomingMessage() {
- return new Promise(function(aResolve, aReject) {
- const incomingMessage = "test incoming message";
-
- connection.addEventListener('message', function messageHandler(aEvent) {
- connection.removeEventListener('message', messageHandler);
- is(aEvent.data, incomingMessage, "An incoming message should be received.");
- aResolve();
- });
-
- frameScript.sendAsyncMessage('trigger-incoming-message', incomingMessage);
- });
-}
-
-function testCloseConnection() {
- return new Promise(function(aResolve, aReject) {
- frameScript.addMessageListener('data-transport-closed', function dataTransportClosedHandler(aReason) {
- frameScript.removeMessageListener('data-transport-closed', dataTransportClosedHandler);
- info("The data transport is closed. " + aReason);
- });
-
- connection.onclose = function() {
- connection.onclose = null;
- is(connection.state, "closed", "Connection should be closed.");
- aResolve();
- };
-
- connection.close();
- });
-}
-
-function testReconnect() {
- return new Promise(function(aResolve, aReject) {
- info('--- testReconnect ---');
- gScript.addMessageListener('control-channel-established', function controlChannelEstablished() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablished);
- gScript.sendAsyncMessage("trigger-control-channel-open");
- });
-
- gScript.addMessageListener('start-reconnect', function startReconnectHandler(url) {
- gScript.removeMessageListener('start-reconnect', startReconnectHandler);
- is(url, "http://example.com/", "URLs should be the same.")
- gScript.sendAsyncMessage('trigger-reconnected-acked', url);
- });
-
- gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
- gScript.removeMessageListener('offer-sent', offerSentHandler);
- ok(aIsValid, "A valid offer is sent out.");
- gScript.sendAsyncMessage('trigger-incoming-answer');
- });
-
- gScript.addMessageListener('answer-received', function answerReceivedHandler() {
- gScript.removeMessageListener('answer-received', answerReceivedHandler);
- info("An answer is received.");
- });
-
- frameScript.addMessageListener('check-navigator', function checknavigatorHandler(aSuccess) {
- frameScript.removeMessageListener('check-navigator', checknavigatorHandler);
- ok(aSuccess, "buildDataChannel get correct window object");
- });
-
- request.reconnect(connection.id).then(
- function(aConnection) {
- ok(aConnection, "Connection should be available.");
- ok(aConnection.id, "Connection ID should be set.");
- is(aConnection.state, "connecting", "The initial state should be connecting.");
- is(aConnection, connection, "The reconnected connection should be the same.");
-
- aConnection.onconnect = function() {
- aConnection.onconnect = null;
- is(aConnection.state, "connected", "Connection should be connected.");
- aResolve();
- };
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- info('teardown-complete');
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function testConstructRequestError() {
- return Promise.all([
- // XXX: Bug 1305204 - uncomment when bug 1275746 is fixed again.
- // new Promise(function(aResolve, aReject) {
- // try {
- // request = new PresentationRequest("\\\\\\");
- // }
- // catch(e) {
- // is(e.name, "SyntaxError", "Expect to get SyntaxError.");
- // aResolve();
- // }
- // }),
- new Promise(function(aResolve, aReject) {
- try {
- request = new PresentationRequest([]);
- }
- catch(e) {
- is(e.name, "NotSupportedError", "Expect to get NotSupportedError.");
- aResolve();
- }
- }),
- ]);
-}
-
-function runTests() {
- ok(window.PresentationRequest, "PresentationRequest should be available.");
-
- testSetup().
- then(testStartConnection).
- then(testSend).
- then(testIncomingMessage).
- then(testCloseConnection).
- then(testReconnect).
- then(testCloseConnection).
- then(testConstructRequestError).
- then(teardown);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.session_transport.data_channel.enable", true]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_device_info.html b/dom/presentation/tests/mochitest/test_presentation_device_info.html
deleted file mode 100644
index 77253e41d..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_device_info.html
+++ /dev/null
@@ -1,144 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for B2G Presentation Device Info API</title>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1080474">Test for B2G Presentation Device Info API</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-SimpleTest.waitForExplicitFinish();
-
-var testDevice = {
- id: 'id',
- name: 'name',
- type: 'type',
-};
-
-var gUrl = SimpleTest.getTestFileURL('PresentationDeviceInfoChromeScript.js');
-var gScript = SpecialPowers.loadChromeScript(gUrl);
-
-function testSetup() {
- return new Promise(function(resolve, reject) {
- gScript.addMessageListener('setup-complete', function() {
- resolve();
- });
- gScript.sendAsyncMessage('setup');
- });
-}
-
-function testForceDiscovery() {
- info('test force discovery');
- return new Promise(function(resolve, reject) {
- gScript.addMessageListener('force-discovery', function() {
- ok(true, 'nsIPresentationDeviceProvider.forceDiscovery is invoked');
- resolve();
- });
- navigator.mozPresentationDeviceInfo.forceDiscovery();
- });
-}
-
-function testDeviceAdd() {
- info('test device add');
- return new Promise(function(resolve, reject) {
- navigator.mozPresentationDeviceInfo.addEventListener('devicechange', function deviceChangeHandler(e) {
- navigator.mozPresentationDeviceInfo.removeEventListener('devicechange', deviceChangeHandler);
- let detail = e.detail;
- is(detail.type, 'add', 'expected update type');
- is(detail.deviceInfo.id, testDevice.id, 'expected device id');
- is(detail.deviceInfo.name, testDevice.name, 'expected device name');
- is(detail.deviceInfo.type, testDevice.type, 'expected device type');
-
- navigator.mozPresentationDeviceInfo.getAll()
- .then(function(devices) {
- is(devices.length, 1, 'expected 1 available device');
- is(devices[0].id, testDevice.id, 'expected device id');
- is(devices[0].name, testDevice.name, 'expected device name');
- is(devices[0].type, testDevice.type, 'expected device type');
- resolve();
- });
- });
- gScript.sendAsyncMessage('trigger-device-add', testDevice);
- });
-}
-
-function testDeviceUpdate() {
- info('test device update');
- return new Promise(function(resolve, reject) {
- testDevice.name = 'name-update';
-
- navigator.mozPresentationDeviceInfo.addEventListener('devicechange', function deviceChangeHandler(e) {
- navigator.mozPresentationDeviceInfo.removeEventListener('devicechange', deviceChangeHandler);
- let detail = e.detail;
- is(detail.type, 'update', 'expected update type');
- is(detail.deviceInfo.id, testDevice.id, 'expected device id');
- is(detail.deviceInfo.name, testDevice.name, 'expected device name');
- is(detail.deviceInfo.type, testDevice.type, 'expected device type');
-
- navigator.mozPresentationDeviceInfo.getAll()
- .then(function(devices) {
- is(devices.length, 1, 'expected 1 available device');
- is(devices[0].id, testDevice.id, 'expected device id');
- is(devices[0].name, testDevice.name, 'expected device name');
- is(devices[0].type, testDevice.type, 'expected device type');
- resolve();
- });
- });
- gScript.sendAsyncMessage('trigger-device-update', testDevice);
- });
-}
-
-function testDeviceRemove() {
- info('test device remove');
- return new Promise(function(resolve, reject) {
- navigator.mozPresentationDeviceInfo.addEventListener('devicechange', function deviceChangeHandler(e) {
- navigator.mozPresentationDeviceInfo.removeEventListener('devicechange', deviceChangeHandler);
- let detail = e.detail;
- is(detail.type, 'remove', 'expected update type');
- is(detail.deviceInfo.id, testDevice.id, 'expected device id');
- is(detail.deviceInfo.name, testDevice.name, 'expected device name');
- is(detail.deviceInfo.type, testDevice.type, 'expected device type');
-
- navigator.mozPresentationDeviceInfo.getAll()
- .then(function(devices) {
- is(devices.length, 0, 'expected 0 available device');
- resolve();
- });
- });
- gScript.sendAsyncMessage('trigger-device-remove');
- });
-}
-
-function runTests() {
- testSetup()
- .then(testForceDiscovery)
- .then(testDeviceAdd)
- .then(testDeviceUpdate)
- .then(testDeviceRemove)
- .then(function() {
- info('test finished, teardown');
- gScript.sendAsyncMessage('teardown', '');
- gScript.destroy();
- SimpleTest.finish();
- });
-}
-
-window.addEventListener('load', function() {
- SpecialPowers.pushPrefEnv({
- 'set': [
- ['dom.presentation.enabled', true],
- ]
- }, runTests);
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_device_info_permission.html b/dom/presentation/tests/mochitest/test_presentation_device_info_permission.html
deleted file mode 100644
index c7f7ac96d..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_device_info_permission.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for B2G Presentation Device Info API Permission</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1080474">Test for B2G Presentation Device Info API Permission</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-SimpleTest.waitForExplicitFinish();
-
-function runTests() {
- is(navigator.mozPresentationDeviceInfo, undefined, 'navigator.mozPresentationDeviceInfo is undefined');
- SimpleTest.finish();
-}
-
-window.addEventListener('load', function() {
- SpecialPowers.pushPrefEnv({
- 'set': [
- ['dom.presentation.enabled', true],
- ]
- }, runTests);
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_mixed_security_contexts.html b/dom/presentation/tests/mochitest/test_presentation_mixed_security_contexts.html
deleted file mode 100644
index 31918a2c4..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_mixed_security_contexts.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test default request for B2G Presentation API at sender side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1268758">Test allow-presentation sandboxing flag</a>
-<iframe id="iframe" src="https://example.com/tests/dom/presentation/tests/mochitest/file_presentation_mixed_security_contexts.html"></iframe>
-<script type="application/javascript;version=1.8">
-
-"use strict";
-
-var iframe = document.getElementById("iframe");
-var readyToStart = false;
-var testSetuped = false;
-
-function setup() {
- SpecialPowers.addPermission("presentation",
- true, { url: "https://example.com/tests/dom/presentation/tests/mochitest/file_presentation_mixed_security_contexts.html",
- originAttributes: {
- appId: SpecialPowers.Ci.nsIScriptSecurityManager.NO_APP_ID,
- inIsolatedMozBrowser: false }});
-
- return new Promise(function(aResolve, aReject) {
- addEventListener("message", function listener(event) {
- var message = event.data;
- if (/^OK /.exec(message)) {
- ok(true, message.replace(/^OK /, ""));
- } else if (/^KO /.exec(message)) {
- ok(false, message.replace(/^KO /, ""));
- } else if (/^INFO /.exec(message)) {
- info(message.replace(/^INFO /, ""));
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ""));
- if (command === "ready-to-start") {
- readyToStart = true;
- startTest();
- }
- } else if (/^DONE$/.exec(message)) {
- window.removeEventListener('message', listener);
- SimpleTest.finish();
- }
- }, false);
-
- testSetuped = true;
- aResolve();
- });
-}
-
-iframe.onload = startTest();
-
-function startTest() {
- if (!(testSetuped && readyToStart)) {
- return;
- }
- iframe.contentWindow.postMessage("start", "*");
-}
-
-function runTests() {
- ok(navigator.presentation, "navigator.presentation should be available.");
- setup().then(startTest);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: "presentation-device-manage", allow: false, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ "set": [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.session_transport.data_channel.enable", false]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_receiver_auxiliary_navigation.js b/dom/presentation/tests/mochitest/test_presentation_receiver_auxiliary_navigation.js
deleted file mode 100644
index 0647bff3a..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_receiver_auxiliary_navigation.js
+++ /dev/null
@@ -1,77 +0,0 @@
-"use strict";
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL("PresentationSessionChromeScript.js"));
-var receiverUrl = SimpleTest.getTestFileURL("file_presentation_receiver_auxiliary_navigation.html");
-
-var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
- .getService(SpecialPowers.Ci.nsIObserverService);
-
-function setup() {
- return new Promise(function(aResolve, aReject) {
- gScript.sendAsyncMessage("trigger-device-add");
-
- var iframe = document.createElement("iframe");
- iframe.setAttribute("mozbrowser", "true");
- iframe.setAttribute("mozpresentation", receiverUrl);
- var oop = location.pathname.indexOf('_inproc') == -1;
- iframe.setAttribute("remote", oop);
- iframe.setAttribute("src", receiverUrl);
-
- // This event is triggered when the iframe calls "postMessage".
- iframe.addEventListener("mozbrowsershowmodalprompt", function listener(aEvent) {
- var message = aEvent.detail.message;
- if (/^OK /.exec(message)) {
- ok(true, "Message from iframe: " + message);
- } else if (/^KO /.exec(message)) {
- ok(false, "Message from iframe: " + message);
- } else if (/^INFO /.exec(message)) {
- info("Message from iframe: " + message);
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ""));
- gScript.sendAsyncMessage(command.name, command.data);
- } else if (/^DONE$/.exec(message)) {
- ok(true, "Messaging from iframe complete.");
- iframe.removeEventListener("mozbrowsershowmodalprompt", listener);
-
- teardown();
- }
- }, false);
-
- var promise = new Promise(function(aResolve, aReject) {
- document.body.appendChild(iframe);
-
- aResolve(iframe);
- });
- obs.notifyObservers(promise, "setup-request-promise", null);
-
- aResolve();
- });
-}
-
-function teardown() {
- gScript.addMessageListener("teardown-complete", function teardownCompleteHandler() {
- gScript.removeMessageListener("teardown-complete", teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage("teardown");
-}
-
-function runTests() {
- setup().then();
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: "presentation-device-manage", allow: false, context: document},
- {type: "browser", allow: true, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ "set": [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.receiver.enabled", true],
- ["dom.mozBrowserFramesEnabled", true],
- ["network.disable.ipc.security", true],
- ["dom.presentation.session_transport.data_channel.enable", false]]},
- runTests);
-});
diff --git a/dom/presentation/tests/mochitest/test_presentation_receiver_auxiliary_navigation_inproc.html b/dom/presentation/tests/mochitest/test_presentation_receiver_auxiliary_navigation_inproc.html
deleted file mode 100644
index f873fa3da..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_receiver_auxiliary_navigation_inproc.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
- <!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
- <head>
- <meta charset="utf-8">
- <title>Test for B2G Presentation API when sender and receiver at the same side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- </head>
- <body>
- <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1268810">
- Test for receiver page with sandboxed auxiliary navigation browsing context flag.</a>
- <script type="application/javascript;version=1.8" src="test_presentation_receiver_auxiliary_navigation.js">
- </script>
- </body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_receiver_auxiliary_navigation_oop.html b/dom/presentation/tests/mochitest/test_presentation_receiver_auxiliary_navigation_oop.html
deleted file mode 100644
index f873fa3da..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_receiver_auxiliary_navigation_oop.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
- <!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
- <head>
- <meta charset="utf-8">
- <title>Test for B2G Presentation API when sender and receiver at the same side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- </head>
- <body>
- <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1268810">
- Test for receiver page with sandboxed auxiliary navigation browsing context flag.</a>
- <script type="application/javascript;version=1.8" src="test_presentation_receiver_auxiliary_navigation.js">
- </script>
- </body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_reconnect.html b/dom/presentation/tests/mochitest/test_presentation_reconnect.html
deleted file mode 100644
index 079b7f5c5..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_reconnect.html
+++ /dev/null
@@ -1,379 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for B2G Presentation API at sender side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="PresentationSessionFrameScript.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1197690">Test for Presentation API at sender side</a>
-<iframe id="iframe" src="file_presentation_reconnect.html"></iframe>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-var iframe = document.getElementById("iframe");
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var frameScript = SpecialPowers.isMainProcess() ? gScript : contentScript;
-var request;
-var connection;
-var commandHandler = {};
-
-function testSetup() {
- return new Promise(function(aResolve, aReject) {
- addEventListener("message", function listener(event) {
- var message = event.data;
- if (/^OK /.exec(message)) {
- ok(true, message.replace(/^OK /, ""));
- } else if (/^KO /.exec(message)) {
- ok(false, message.replace(/^KO /, ""));
- } else if (/^INFO /.exec(message)) {
- info(message.replace(/^INFO /, ""));
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ""));
- if (command.name in commandHandler) {
- commandHandler[command.name](command);
- }
- } else if (/^DONE$/.exec(message)) {
- window.removeEventListener('message', listener);
- SimpleTest.finish();
- }
- }, false);
-
- request = new PresentationRequest("http://example.com/");
-
- request.getAvailability().then(
- function(aAvailability) {
- is(aAvailability.value, false, "Sender: should have no available device after setup");
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(aAvailability.value, "Device should be available.");
- aResolve();
- }
-
- gScript.sendAsyncMessage('trigger-device-add');
- },
- function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testStartConnection() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- info("Device prompt is triggered.");
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- });
-
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- info("A control channel is established.");
- gScript.sendAsyncMessage('trigger-control-channel-open');
- });
-
- gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler(aReason) {
- info("The control channel is opened.");
- });
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- info("The control channel is closed. " + aReason);
- });
-
- frameScript.addMessageListener('check-navigator', function checknavigatorHandler(aSuccess) {
- ok(aSuccess, "buildDataChannel get correct window object");
- });
-
- gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
- ok(aIsValid, "A valid offer is sent out.");
- gScript.sendAsyncMessage('trigger-incoming-answer');
- });
-
- gScript.addMessageListener('answer-received', function answerReceivedHandler() {
- info("An answer is received.");
- });
-
- frameScript.addMessageListener('data-transport-initialized', function dataTransportInitializedHandler() {
- info("Data transport channel is initialized.");
- });
-
- frameScript.addMessageListener('data-transport-notification-enabled', function dataTransportNotificationEnabledHandler() {
- info("Data notification is enabled for data transport channel.");
- });
-
- var connectionFromEvent;
- request.onconnectionavailable = function(aEvent) {
- request.onconnectionavailable = null;
- connectionFromEvent = aEvent.connection;
- ok(connectionFromEvent, "|connectionavailable| event is fired with a connection.");
-
- if (connection) {
- is(connection, connectionFromEvent, "The connection from promise and the one from |connectionavailable| event should be the same.");
- }
- };
-
- request.start().then(
- function(aConnection) {
- connection = aConnection;
- ok(connection, "Connection should be available.");
- ok(connection.id, "Connection ID should be set.");
- is(connection.state, "connecting", "The initial state should be connecting.");
-
- if (connectionFromEvent) {
- is(connection, connectionFromEvent, "The connection from promise and the one from |connectionavailable| event should be the same.");
- }
- connection.onconnect = function() {
- connection.onconnect = null;
- is(connection.state, "connected", "Connection should be connected.");
- aResolve();
- };
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testCloseConnection() {
- return new Promise(function(aResolve, aReject) {
- frameScript.addMessageListener('data-transport-closed', function dataTransportClosedHandler(aReason) {
- frameScript.removeMessageListener('data-transport-closed', dataTransportClosedHandler);
- info("The data transport is closed. " + aReason);
- });
-
- connection.onclose = function() {
- connection.onclose = null;
- is(connection.state, "closed", "Connection should be closed.");
- aResolve();
- };
-
- connection.close();
- });
-}
-
-function testReconnectAConnectedConnection() {
- return new Promise(function(aResolve, aReject) {
- info('--- testReconnectAConnectedConnection ---');
- ok(connection.state, "connected", "Make sure the state is connected.");
-
- request.reconnect(connection.id).then(
- function(aConnection) {
- ok(aConnection, "Connection should be available.");
- is(aConnection.id, connection.id, "Connection ID should be the same.");
- is(aConnection.state, "connected", "The state should be connected.");
- is(aConnection, connection, "The connection should be the same.");
-
- aResolve();
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testReconnectInvalidID() {
- return new Promise(function(aResolve, aReject) {
- info('--- testReconnectInvalidID ---');
-
- request.reconnect("dummyID").then(
- function(aConnection) {
- ok(false, "Unexpected success.");
- teardown();
- aReject();
- },
- function(aError) {
- is(aError.name, "NotFoundError", "Should get NotFoundError.");
- aResolve();
- }
- );
- });
-}
-
-function testReconnectInvalidURL() {
- return new Promise(function(aResolve, aReject) {
- info('--- testReconnectInvalidURL ---');
-
- var request1 = new PresentationRequest("http://invalidURL");
- request1.reconnect(connection.id).then(
- function(aConnection) {
- ok(false, "Unexpected success.");
- teardown();
- aReject();
- },
- function(aError) {
- is(aError.name, "NotFoundError", "Should get NotFoundError.");
- aResolve();
- }
- );
- });
-}
-
-function testReconnectIframeConnectedConnection() {
- info('--- testReconnectIframeConnectedConnection ---');
- gScript.sendAsyncMessage('save-control-channel-listener');
- return Promise.all([
- new Promise(function(aResolve, aReject) {
- commandHandler["connection-connected"] = function(command) {
- gScript.addMessageListener('start-reconnect', function startReconnectHandler(url) {
- gScript.removeMessageListener('start-reconnect', startReconnectHandler);
- gScript.sendAsyncMessage('trigger-reconnected-acked', url);
- });
-
- var request1 = new PresentationRequest("http://example1.com");
- request1.reconnect(command.id).then(
- function(aConnection) {
- is(aConnection.state, "connecting", "The state should be connecting.");
- aConnection.onclose = function() {
- delete commandHandler["connection-connected"];
- gScript.sendAsyncMessage('restore-control-channel-listener');
- aResolve();
- };
- aConnection.close();
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- }
- );
- };
- iframe.contentWindow.postMessage("startConnection", "*");
- }),
- new Promise(function(aResolve, aReject) {
- commandHandler["notify-connection-closed"] = function(command) {
- delete commandHandler["notify-connection-closed"];
- aResolve();
- };
- }),
- ]);
-}
-
-function testReconnectIframeClosedConnection() {
- return new Promise(function(aResolve, aReject) {
- info('--- testReconnectIframeClosedConnection ---');
- gScript.sendAsyncMessage('save-control-channel-listener');
- commandHandler["connection-closed"] = function(command) {
- gScript.addMessageListener('start-reconnect', function startReconnectHandler(url) {
- gScript.removeMessageListener('start-reconnect', startReconnectHandler);
- gScript.sendAsyncMessage('trigger-reconnected-acked', url);
- });
-
- var request1 = new PresentationRequest("http://example1.com");
- request1.reconnect(command.id).then(
- function(aConnection) {
- aConnection.onconnect = function() {
- aConnection.onconnect = null;
- is(aConnection.state, "connected", "The connection should be connected.");
- aConnection.onclose = function() {
- aConnection.onclose = null;
- ok(true, "The connection is closed.");
- delete commandHandler["connection-closed"];
- aResolve();
- };
- aConnection.close();
- gScript.sendAsyncMessage('restore-control-channel-listener');
- };
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- }
- );
- };
- iframe.contentWindow.postMessage("closeConnection", "*");
- });
-}
-
-function testReconnect() {
- return new Promise(function(aResolve, aReject) {
- info('--- testReconnect ---');
- gScript.addMessageListener('start-reconnect', function startReconnectHandler(url) {
- gScript.removeMessageListener('start-reconnect', startReconnectHandler);
- is(url, "http://example.com/", "URLs should be the same.");
- gScript.sendAsyncMessage('trigger-reconnected-acked', url);
- });
-
- request.reconnect(connection.id).then(
- function(aConnection) {
- ok(aConnection, "Connection should be available.");
- ok(aConnection.id, "Connection ID should be set.");
- is(aConnection.state, "connecting", "The initial state should be connecting.");
- is(aConnection, connection, "The reconnected connection should be the same.");
-
- aConnection.onconnect = function() {
- aConnection.onconnect = null;
- is(aConnection.state, "connected", "Connection should be connected.");
-
- const incomingMessage = "test incoming message";
- aConnection.addEventListener('message', function messageHandler(aEvent) {
- aConnection.removeEventListener('message', messageHandler);
- is(aEvent.data, incomingMessage, "An incoming message should be received.");
- aResolve();
- });
-
- frameScript.sendAsyncMessage('trigger-incoming-message', incomingMessage);
- };
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- info('teardown-complete');
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- ok(window.PresentationRequest, "PresentationRequest should be available.");
-
- testSetup().
- then(testStartConnection).
- then(testReconnectInvalidID).
- then(testReconnectInvalidURL).
- then(testReconnectAConnectedConnection).
- then(testReconnectIframeConnectedConnection).
- then(testReconnectIframeClosedConnection).
- then(testCloseConnection).
- then(testReconnect).
- then(testCloseConnection).
- then(teardown);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.receiver.enabled", true],
- ["dom.presentation.session_transport.data_channel.enable", true]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_sandboxed_presentation.html b/dom/presentation/tests/mochitest/test_presentation_sandboxed_presentation.html
deleted file mode 100644
index dc17209c5..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_sandboxed_presentation.html
+++ /dev/null
@@ -1,75 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test default request for B2G Presentation API at sender side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1268758">Test allow-presentation sandboxing flag</a>
-<iframe sandbox="allow-popups allow-scripts allow-same-origin" id="iframe" src="file_presentation_sandboxed_presentation.html"></iframe>
-<script type="application/javascript;version=1.8">
-
-"use strict";
-
-var iframe = document.getElementById("iframe");
-var readyToStart = false;
-var testSetuped = false;
-function setup() {
- return new Promise(function(aResolve, aReject) {
- addEventListener("message", function listener(event) {
- var message = event.data;
- if (/^OK /.exec(message)) {
- ok(true, message.replace(/^OK /, ""));
- } else if (/^KO /.exec(message)) {
- ok(false, message.replace(/^KO /, ""));
- } else if (/^INFO /.exec(message)) {
- info(message.replace(/^INFO /, ""));
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ""));
- if (command === "ready-to-start") {
- readyToStart = true;
- startTest();
- }
- } else if (/^DONE$/.exec(message)) {
- window.removeEventListener('message', listener);
- SimpleTest.finish();
- }
- }, false);
-
- testSetuped = true;
- aResolve();
- });
-}
-
-iframe.onload = startTest();
-
-function startTest() {
- if (!(testSetuped && readyToStart)) {
- return;
- }
- iframe.contentWindow.postMessage("start", "*");
-}
-
-function runTests() {
- ok(navigator.presentation, "navigator.presentation should be available.");
- setup().then(startTest);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: "presentation-device-manage", allow: false, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ "set": [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.receiver.enabled", false],
- ["dom.presentation.session_transport.data_channel.enable", false]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html b/dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html
deleted file mode 100644
index d0c8af0ad..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_sender_on_terminate_request.html
+++ /dev/null
@@ -1,187 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test onTerminateRequest at sender side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1276378">Test onTerminateRequest at sender side</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var request;
-var connection;
-
-function testSetup() {
- return new Promise(function(aResolve, aReject) {
- request = new PresentationRequest("http://example.com");
-
- request.getAvailability().then(
- function(aAvailability) {
- is(aAvailability.value, false, "Sender: should have no available device after setup");
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(aAvailability.value, "Device should be available.");
- aResolve();
- }
-
- gScript.sendAsyncMessage('trigger-device-add');
- },
- function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testStartConnection() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- info("Device prompt is triggered.");
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- });
-
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
- info("A control channel is established.");
- gScript.sendAsyncMessage('trigger-control-channel-open');
- });
-
- gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler(aReason) {
- gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
- info("The control channel is opened.");
- });
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- info("The control channel is closed. " + aReason);
- });
-
- gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
- gScript.removeMessageListener('offer-sent', offerSentHandler);
- ok(aIsValid, "A valid offer is sent out.");
- gScript.sendAsyncMessage('trigger-incoming-transport');
- });
-
- gScript.addMessageListener('answer-received', function answerReceivedHandler() {
- gScript.removeMessageListener('answer-received', answerReceivedHandler);
- info("An answer is received.");
- });
-
- gScript.addMessageListener('data-transport-initialized', function dataTransportInitializedHandler() {
- gScript.removeMessageListener('data-transport-initialized', dataTransportInitializedHandler);
- info("Data transport channel is initialized.");
- gScript.sendAsyncMessage('trigger-incoming-answer');
- });
-
- gScript.addMessageListener('data-transport-notification-enabled', function dataTransportNotificationEnabledHandler() {
- gScript.removeMessageListener('data-transport-notification-enabled', dataTransportNotificationEnabledHandler);
- info("Data notification is enabled for data transport channel.");
- });
-
- var connectionFromEvent;
- request.onconnectionavailable = function(aEvent) {
- request.onconnectionavailable = null;
- connectionFromEvent = aEvent.connection;
- ok(connectionFromEvent, "|connectionavailable| event is fired with a connection.");
-
- if (connection) {
- is(connection, connectionFromEvent, "The connection from promise and the one from |connectionavailable| event should be the same.");
- }
- };
-
- request.start().then(
- function(aConnection) {
- connection = aConnection;
- ok(connection, "Connection should be available.");
- ok(connection.id, "Connection ID should be set.");
- is(connection.state, "connecting", "The initial state should be connecting.");
-
- if (connectionFromEvent) {
- is(connection, connectionFromEvent, "The connection from promise and the one from |connectionavailable| event should be the same.");
- }
- connection.onconnect = function() {
- connection.onconnect = null;
- is(connection.state, "connected", "Connection should be connected.");
- aResolve();
- };
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testOnTerminateRequest() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler(aReason) {
- gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
- info("The control channel is opened.");
- });
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- info("The control channel is closed. " + aReason);
- });
-
- gScript.addMessageListener('data-transport-closed', function dataTransportClosedHandler(aReason) {
- gScript.removeMessageListener('data-transport-closed', dataTransportClosedHandler);
- info("The data transport is closed. " + aReason);
- });
-
- connection.onterminate = function() {
- connection.onterminate = null;
- is(connection.state, "terminated", "Connection should be closed.");
- aResolve();
- };
-
- gScript.sendAsyncMessage('trigger-incoming-terminate-request');
- gScript.sendAsyncMessage('trigger-control-channel-open');
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- ok(window.PresentationRequest, "PresentationRequest should be available.");
-
- testSetup().
- then(testStartConnection).
- then(testOnTerminateRequest).
- then(teardown);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.receiver.enabled", false],
- ["dom.presentation.session_transport.data_channel.enable", false]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_sender_startWithDevice.html b/dom/presentation/tests/mochitest/test_presentation_sender_startWithDevice.html
deleted file mode 100644
index 27b17bb32..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_sender_startWithDevice.html
+++ /dev/null
@@ -1,173 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test startWithDevice for B2G Presentation API at sender side</title>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1239242">Test startWithDevice for B2G Presentation API at sender side</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var request;
-var connection;
-
-function testSetup() {
- return new Promise(function(aResolve, aReject) {
- request = new PresentationRequest("https://example.com");
-
- request.getAvailability().then(
- function(aAvailability) {
- is(aAvailability.value, false, "Sender: should have no available device after setup");
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(aAvailability.value, "Device should be available.");
- aResolve();
- }
-
- gScript.sendAsyncMessage('trigger-device-add');
- },
- function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testStartConnectionWithDevice() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- ok(false, "Device prompt should not be triggered.");
- teardown();
- aReject();
- });
-
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
- info("A control channel is established.");
- gScript.sendAsyncMessage('trigger-control-channel-open');
- });
-
- gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler(aReason) {
- gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
- info("The control channel is opened.");
- });
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- info("The control channel is closed. " + aReason);
- });
-
- gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
- gScript.removeMessageListener('offer-sent', offerSentHandler);
- ok(aIsValid, "A valid offer is sent out.");
- gScript.sendAsyncMessage('trigger-incoming-transport');
- });
-
- gScript.addMessageListener('answer-received', function answerReceivedHandler() {
- gScript.removeMessageListener('answer-received', answerReceivedHandler);
- info("An answer is received.");
- });
-
- gScript.addMessageListener('data-transport-initialized', function dataTransportInitializedHandler() {
- gScript.removeMessageListener('data-transport-initialized', dataTransportInitializedHandler);
- info("Data transport channel is initialized.");
- gScript.sendAsyncMessage('trigger-incoming-answer');
- });
-
- gScript.addMessageListener('data-transport-notification-enabled', function dataTransportNotificationEnabledHandler() {
- gScript.removeMessageListener('data-transport-notification-enabled', dataTransportNotificationEnabledHandler);
- info("Data notification is enabled for data transport channel.");
- });
-
- var connectionFromEvent;
- request.onconnectionavailable = function(aEvent) {
- request.onconnectionavailable = null;
- connectionFromEvent = aEvent.connection;
- ok(connectionFromEvent, "|connectionavailable| event is fired with a connection.");
-
- if (connection) {
- is(connection, connectionFromEvent, "The connection from promise and the one from |connectionavailable| event should be the same.");
- }
- };
-
- request.startWithDevice('id').then(
- function(aConnection) {
- connection = aConnection;
- ok(connection, "Connection should be available.");
- ok(connection.id, "Connection ID should be set.");
- is(connection.state, "connecting", "The initial state should be connecting.");
-
- if (connectionFromEvent) {
- is(connection, connectionFromEvent, "The connection from promise and the one from |connectionavailable| event should be the same.");
- }
- connection.onconnect = function() {
- connection.onconnect = null;
- is(connection.state, "connected", "Connection should be connected.");
- aResolve();
- };
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testStartConnectionWithDeviceNotFoundError() {
- return new Promise(function(aResolve, aReject) {
- request.startWithDevice('').then(
- function(aConnection) {
- ok(false, "Should not establish connection to an unknown device");
- teardown();
- aReject();
- },
- function(aError) {
- is(aError.name, 'NotFoundError', "Expect NotFoundError occurred when establishing a connection");
- aResolve();
- }
- );
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- ok(window.PresentationRequest, "PresentationRequest should be available.");
-
- testSetup().
- then(testStartConnectionWithDevice).
- then(testStartConnectionWithDeviceNotFoundError).
- then(teardown);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.session_transport.data_channel.enable", false],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.test.enabled", true],
- ["dom.presentation.test.stage", 0]]},
- runTests);
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver.html b/dom/presentation/tests/mochitest/test_presentation_tcp_receiver.html
deleted file mode 100644
index f26184f0b..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver.html
+++ /dev/null
@@ -1,137 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for B2G PresentationConnection API at receiver side</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1069230">Test for B2G PresentationConnection API at receiver side</a>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test"></pre>
-<script type="application/javascript">
-
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var receiverUrl = SimpleTest.getTestFileURL('file_presentation_receiver.html');
-
-var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
- .getService(SpecialPowers.Ci.nsIObserverService);
-
-function setup() {
- return new Promise(function(aResolve, aReject) {
- gScript.sendAsyncMessage('trigger-device-add');
-
- var iframe = document.createElement('iframe');
- iframe.setAttribute('mozbrowser', 'true');
- iframe.setAttribute('mozpresentation', receiverUrl);
- iframe.setAttribute('src', receiverUrl);
-
- // This event is triggered when the iframe calls "postMessage".
- iframe.addEventListener('mozbrowsershowmodalprompt', function listener(aEvent) {
- var message = aEvent.detail.message;
- if (/^OK /.exec(message)) {
- ok(true, "Message from iframe: " + message);
- } else if (/^KO /.exec(message)) {
- ok(false, "Message from iframe: " + message);
- } else if (/^INFO /.exec(message)) {
- info("Message from iframe: " + message);
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ''));
- gScript.sendAsyncMessage(command.name, command.data);
- } else if (/^DONE$/.exec(message)) {
- ok(true, "Messaging from iframe complete.");
- iframe.removeEventListener('mozbrowsershowmodalprompt', listener);
-
- teardown();
- }
- }, false);
-
- var promise = new Promise(function(aResolve, aReject) {
- document.body.appendChild(iframe);
-
- aResolve(iframe);
- });
- obs.notifyObservers(promise, 'setup-request-promise', null);
-
- gScript.addMessageListener('offer-received', function offerReceivedHandler() {
- gScript.removeMessageListener('offer-received', offerReceivedHandler);
- info("An offer is received.");
- });
-
- gScript.addMessageListener('answer-sent', function answerSentHandler(aIsValid) {
- gScript.removeMessageListener('answer-sent', answerSentHandler);
- ok(aIsValid, "A valid answer is sent.");
- });
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- is(aReason, SpecialPowers.Cr.NS_OK, "The control channel is closed normally.");
- });
-
- gScript.addMessageListener('data-transport-notification-enabled', function dataTransportNotificationEnabledHandler() {
- gScript.removeMessageListener('data-transport-notification-enabled', dataTransportNotificationEnabledHandler);
- info("Data notification is enabled for data transport channel.");
- });
-
- gScript.addMessageListener('data-transport-closed', function dataTransportClosedHandler(aReason) {
- gScript.removeMessageListener('data-transport-closed', dataTransportClosedHandler);
- is(aReason, SpecialPowers.Cr.NS_OK, "The data transport should be closed normally.");
- });
-
- aResolve();
- });
-}
-
-function testIncomingSessionRequest() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('receiver-launching', function launchReceiverHandler(aSessionId) {
- gScript.removeMessageListener('receiver-launching', launchReceiverHandler);
- info("Trying to launch receiver page.");
-
- ok(navigator.presentation, "navigator.presentation should be available in in-process pages.");
- is(navigator.presentation.receiver, null, "Non-receiving in-process pages shouldn't get a presentation receiver instance.");
- aResolve();
- });
-
- gScript.sendAsyncMessage('trigger-incoming-session-request', receiverUrl);
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- setup().
- then(testIncomingSessionRequest);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
- {type: 'browser', allow: true, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", false],
- ["dom.presentation.receiver.enabled", true],
- ["dom.mozBrowserFramesEnabled", true],
- ["network.disable.ipc.security", true],
- ["dom.presentation.session_transport.data_channel.enable", false]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_error.html b/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_error.html
deleted file mode 100644
index 0935aaaf9..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_error.html
+++ /dev/null
@@ -1,110 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for connection establishing errors of B2G Presentation API at receiver side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1069230">Test for connection establishing errors of B2G Presentation API at receiver side</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var receiverUrl = SimpleTest.getTestFileURL('file_presentation_receiver_establish_connection_error.html');
-
-var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
- .getService(SpecialPowers.Ci.nsIObserverService);
-
-function setup() {
- return new Promise(function(aResolve, aReject) {
- gScript.sendAsyncMessage('trigger-device-add');
-
- var iframe = document.createElement('iframe');
- iframe.setAttribute('src', receiverUrl);
- iframe.setAttribute("mozbrowser", "true");
- iframe.setAttribute("mozpresentation", receiverUrl);
-
- // This event is triggered when the iframe calls "alert".
- iframe.addEventListener("mozbrowsershowmodalprompt", function receiverListener(evt) {
- var message = evt.detail.message;
- if (/^OK /.exec(message)) {
- ok(true, message.replace(/^OK /, ""));
- } else if (/^KO /.exec(message)) {
- ok(false, message.replace(/^KO /, ""));
- } else if (/^INFO /.exec(message)) {
- info(message.replace(/^INFO /, ""));
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ""));
- gScript.sendAsyncMessage(command.name, command.data);
- } else if (/^DONE$/.exec(message)) {
- iframe.removeEventListener("mozbrowsershowmodalprompt",
- receiverListener);
- teardown();
- }
- }, false);
-
- var promise = new Promise(function(aResolve, aReject) {
- document.body.appendChild(iframe);
-
- aResolve(iframe);
- });
- obs.notifyObservers(promise, 'setup-request-promise', null);
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- is(aReason, 0x80004004 /* NS_ERROR_ABORT */, "The control channel is closed abnormally.");
- });
-
- aResolve();
- });
-}
-
-function testIncomingSessionRequest() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('receiver-launching', function launchReceiverHandler(aSessionId) {
- gScript.removeMessageListener('receiver-launching', launchReceiverHandler);
- info("Trying to launch receiver page.");
-
- aResolve();
- });
-
- gScript.sendAsyncMessage('trigger-incoming-session-request', receiverUrl);
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- setup().
- then(testIncomingSessionRequest);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
- {type: "browser", allow: true, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.receiver.enabled", true],
- ["dom.presentation.session_transport.data_channel.enable", false],
- ["dom.mozBrowserFramesEnabled", true],
- ["network.disable.ipc.security", true]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_timeout.html b/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_timeout.html
deleted file mode 100644
index 1dc002644..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_timeout.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for connection establishing timeout of B2G Presentation API at receiver side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1069230">Test for connection establishing timeout of B2G Presentation API at receiver side</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-
-var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
- .getService(SpecialPowers.Ci.nsIObserverService);
-
-function setup() {
- return new Promise(function(aResolve, aReject) {
- gScript.sendAsyncMessage('trigger-device-add');
-
- var promise = new Promise(function(aResolve, aReject) {
- // In order to trigger timeout, do not resolve the promise.
- });
- obs.notifyObservers(promise, 'setup-request-promise', null);
-
- aResolve();
- });
-}
-
-function testIncomingSessionRequestReceiverLaunchTimeout() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('receiver-launching', function launchReceiverHandler(aSessionId) {
- gScript.removeMessageListener('receiver-launching', launchReceiverHandler);
- info("Trying to launch receiver page.");
- });
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- is(aReason, 0x80530017 /* NS_ERROR_DOM_TIMEOUT_ERR */, "The control channel is closed due to timeout.");
- aResolve();
- });
-
- gScript.sendAsyncMessage('trigger-incoming-session-request', 'http://example.com');
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- setup().
- then(testIncomingSessionRequestReceiverLaunchTimeout).
- then(teardown);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.receiver.enabled", true],
- ["dom.presentation.session_transport.data_channel.enable", false],
- ["presentation.receiver.loading.timeout", 10]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_unknown_content_type.js b/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_unknown_content_type.js
deleted file mode 100644
index d73f84cf8..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_unknown_content_type.js
+++ /dev/null
@@ -1,88 +0,0 @@
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var receiverUrl = SimpleTest.getTestFileURL('file_presentation_unknown_content_type.test');
-
-var obs = SpecialPowers.Cc['@mozilla.org/observer-service;1']
- .getService(SpecialPowers.Ci.nsIObserverService);
-
-var receiverIframe;
-
-function setup() {
- return new Promise(function(aResolve, aReject) {
- gScript.sendAsyncMessage('trigger-device-add');
-
- receiverIframe = document.createElement('iframe');
- receiverIframe.setAttribute('mozbrowser', 'true');
- receiverIframe.setAttribute('mozpresentation', receiverUrl);
- receiverIframe.setAttribute('src', receiverUrl);
- var oop = location.pathname.indexOf('_inproc') == -1;
- receiverIframe.setAttribute("remote", oop);
-
- var promise = new Promise(function(aResolve, aReject) {
- document.body.appendChild(receiverIframe);
-
- aResolve(receiverIframe);
- });
- obs.notifyObservers(promise, 'setup-request-promise', null);
-
- aResolve();
- });
-}
-
-function testIncomingSessionRequestReceiverLaunchUnknownContentType() {
- let promise = Promise.all([
- new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('receiver-launching', function launchReceiverHandler(aSessionId) {
- gScript.removeMessageListener('receiver-launching', launchReceiverHandler);
- info('Trying to launch receiver page.');
-
- receiverIframe.addEventListener('mozbrowserclose', function() {
- ok(true, 'observe receiver window closed');
- aResolve();
- });
- });
- }),
- new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- is(aReason, 0x80530020 /* NS_ERROR_DOM_OPERATION_ERR */, 'The control channel is closed due to load failure.');
- aResolve();
- });
- })
- ]);
-
- gScript.sendAsyncMessage('trigger-incoming-session-request', receiverUrl);
- return promise;
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- setup().
- then(testIncomingSessionRequestReceiverLaunchUnknownContentType).
- then(teardown);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
- {type: 'browser', allow: true, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ 'set': [['dom.presentation.enabled', true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.receiver.enabled", true],
- ['dom.presentation.session_transport.data_channel.enable', false],
- ['dom.mozBrowserFramesEnabled', true],
- ["network.disable.ipc.security", true],
- ['dom.ipc.tabs.disabled', false]]},
- runTests);
-});
diff --git a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_unknown_content_type_inproc.html b/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_unknown_content_type_inproc.html
deleted file mode 100644
index 8ade1d72d..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_unknown_content_type_inproc.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for unknown content type of B2G Presentation API at receiver side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1287717">Test for unknown content type of B2G Presentation API at receiver side</a>
- <script type="application/javascript;version=1.8" src="test_presentation_tcp_receiver_establish_connection_unknown_content_type.js">
- </script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_unknown_content_type_oop.html b/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_unknown_content_type_oop.html
deleted file mode 100644
index b2d2d3c6e..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_establish_connection_unknown_content_type_oop.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for unknown content type of B2G Presentation API at receiver side (OOP)</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1287717">Test for unknown content type of B2G Presentation API at receiver side (OOP)</a>
- <script type="application/javascript;version=1.8" src="test_presentation_tcp_receiver_establish_connection_unknown_content_type.js">
- </script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_oop.html b/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_oop.html
deleted file mode 100644
index bfbc7947a..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_tcp_receiver_oop.html
+++ /dev/null
@@ -1,178 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for B2G PresentationConnection API at receiver side (OOP)</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1069230">Test B2G PresentationConnection API at receiver side (OOP)</a>
-<p id="display"></p>
-<div id="content" style="display: none"></div>
-<pre id="test"></pre>
-<script type="application/javascript">
-
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var receiverUrl = SimpleTest.getTestFileURL('file_presentation_receiver.html');
-var nonReceiverUrl = SimpleTest.getTestFileURL('file_presentation_non_receiver.html');
-
-var isReceiverFinished = false;
-var isNonReceiverFinished = false;
-
-var obs = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
- .getService(SpecialPowers.Ci.nsIObserverService);
-
-function setup() {
- return new Promise(function(aResolve, aReject) {
- gScript.sendAsyncMessage('trigger-device-add');
-
- // Create a receiver OOP iframe.
- var receiverIframe = document.createElement('iframe');
- receiverIframe.setAttribute('remote', 'true');
- receiverIframe.setAttribute('mozbrowser', 'true');
- receiverIframe.setAttribute('mozpresentation', receiverUrl);
- receiverIframe.setAttribute('src', receiverUrl);
-
- // This event is triggered when the iframe calls "alert".
- receiverIframe.addEventListener('mozbrowsershowmodalprompt', function receiverListener(aEvent) {
- var message = aEvent.detail.message;
- if (/^OK /.exec(message)) {
- ok(true, "Message from iframe: " + message);
- } else if (/^KO /.exec(message)) {
- ok(false, "Message from iframe: " + message);
- } else if (/^INFO /.exec(message)) {
- info("Message from iframe: " + message);
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ''));
- gScript.sendAsyncMessage(command.name, command.data);
- } else if (/^DONE$/.exec(message)) {
- ok(true, "Messaging from iframe complete.");
- receiverIframe.removeEventListener('mozbrowsershowmodalprompt', receiverListener);
-
- isReceiverFinished = true;
-
- if (isNonReceiverFinished) {
- teardown();
- }
- }
- }, false);
-
- var promise = new Promise(function(aResolve, aReject) {
- document.body.appendChild(receiverIframe);
-
- aResolve(receiverIframe);
- });
- obs.notifyObservers(promise, 'setup-request-promise', null);
-
- // Create a non-receiver OOP iframe.
- var nonReceiverIframe = document.createElement('iframe');
- nonReceiverIframe.setAttribute('remote', 'true');
- nonReceiverIframe.setAttribute('mozbrowser', 'true');
- nonReceiverIframe.setAttribute('src', nonReceiverUrl);
-
- // This event is triggered when the iframe calls "alert".
- nonReceiverIframe.addEventListener('mozbrowsershowmodalprompt', function nonReceiverListener(aEvent) {
- var message = aEvent.detail.message;
- if (/^OK /.exec(message)) {
- ok(true, "Message from iframe: " + message);
- } else if (/^KO /.exec(message)) {
- ok(false, "Message from iframe: " + message);
- } else if (/^INFO /.exec(message)) {
- info("Message from iframe: " + message);
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ''));
- gScript.sendAsyncMessage(command.name, command.data);
- } else if (/^DONE$/.exec(message)) {
- ok(true, "Messaging from iframe complete.");
- nonReceiverIframe.removeEventListener('mozbrowsershowmodalprompt', nonReceiverListener);
-
- isNonReceiverFinished = true;
-
- if (isReceiverFinished) {
- teardown();
- }
- }
- }, false);
-
- document.body.appendChild(nonReceiverIframe);
-
- gScript.addMessageListener('offer-received', function offerReceivedHandler() {
- gScript.removeMessageListener('offer-received', offerReceivedHandler);
- info("An offer is received.");
- });
-
- gScript.addMessageListener('answer-sent', function answerSentHandler(aIsValid) {
- gScript.removeMessageListener('answer-sent', answerSentHandler);
- ok(aIsValid, "A valid answer is sent.");
- });
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- is(aReason, SpecialPowers.Cr.NS_OK, "The control channel is closed normally.");
- });
-
- gScript.addMessageListener('data-transport-notification-enabled', function dataTransportNotificationEnabledHandler() {
- gScript.removeMessageListener('data-transport-notification-enabled', dataTransportNotificationEnabledHandler);
- info("Data notification is enabled for data transport channel.");
- });
-
- gScript.addMessageListener('data-transport-closed', function dataTransportClosedHandler(aReason) {
- gScript.removeMessageListener('data-transport-closed', dataTransportClosedHandler);
- is(aReason, SpecialPowers.Cr.NS_OK, "The data transport should be closed normally.");
- });
-
- aResolve();
- });
-}
-
-function testIncomingSessionRequest() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('receiver-launching', function launchReceiverHandler(aSessionId) {
- gScript.removeMessageListener('receiver-launching', launchReceiverHandler);
- info("Trying to launch receiver page.");
-
- aResolve();
- });
-
- gScript.sendAsyncMessage('trigger-incoming-session-request', receiverUrl);
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- setup().
- then(testIncomingSessionRequest);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
- {type: 'browser', allow: true, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", false],
- ["dom.presentation.receiver.enabled", true],
- ["dom.presentation.session_transport.data_channel.enable", false],
- ["dom.mozBrowserFramesEnabled", true],
- ["network.disable.ipc.security", true],
- ["dom.ipc.browser_frames.oop_by_default", true]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_tcp_sender.html b/dom/presentation/tests/mochitest/test_presentation_tcp_sender.html
deleted file mode 100644
index 8df34c884..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_tcp_sender.html
+++ /dev/null
@@ -1,260 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for B2G Presentation API at sender side</title>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1069230">Test for B2G Presentation API at sender side</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var request;
-var connection;
-
-function testSetup() {
- return new Promise(function(aResolve, aReject) {
- request = new PresentationRequest("https://example.com");
-
- request.getAvailability().then(
- function(aAvailability) {
- is(aAvailability.value, false, "Sender: should have no available device after setup");
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(aAvailability.value, "Device should be available.");
- aResolve();
- }
- gScript.sendAsyncMessage('trigger-device-add');
- },
- function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- teardown();
- aReject();
- }
- );
-
- });
-}
-
-function testStartConnection() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- info("Device prompt is triggered.");
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- });
-
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
- info("A control channel is established.");
- gScript.sendAsyncMessage('trigger-control-channel-open');
- });
-
- gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler(aReason) {
- gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
- info("The control channel is opened.");
- });
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- info("The control channel is closed. " + aReason);
- });
-
- gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
- gScript.removeMessageListener('offer-sent', offerSentHandler);
- ok(aIsValid, "A valid offer is sent out.");
- gScript.sendAsyncMessage('trigger-incoming-transport');
- });
-
- gScript.addMessageListener('answer-received', function answerReceivedHandler() {
- gScript.removeMessageListener('answer-received', answerReceivedHandler);
- info("An answer is received.");
- });
-
- gScript.addMessageListener('data-transport-initialized', function dataTransportInitializedHandler() {
- gScript.removeMessageListener('data-transport-initialized', dataTransportInitializedHandler);
- info("Data transport channel is initialized.");
- gScript.sendAsyncMessage('trigger-incoming-answer');
- });
-
- gScript.addMessageListener('data-transport-notification-enabled', function dataTransportNotificationEnabledHandler() {
- gScript.removeMessageListener('data-transport-notification-enabled', dataTransportNotificationEnabledHandler);
- info("Data notification is enabled for data transport channel.");
- });
-
- var connectionFromEvent;
- request.onconnectionavailable = function(aEvent) {
- request.onconnectionavailable = null;
- connectionFromEvent = aEvent.connection;
- ok(connectionFromEvent, "|connectionavailable| event is fired with a connection.");
-
- if (connection) {
- is(connection, connectionFromEvent, "The connection from promise and the one from |connectionavailable| event should be the same.");
- }
- };
-
- request.start().then(
- function(aConnection) {
- connection = aConnection;
- ok(connection, "Connection should be available.");
- ok(connection.id, "Connection ID should be set.");
- is(connection.state, "connecting", "The initial state should be connecting.");
-
- if (connectionFromEvent) {
- is(connection, connectionFromEvent, "The connection from promise and the one from |connectionavailable| event should be the same.");
- }
- connection.onconnect = function() {
- connection.onconnect = null;
- is(connection.state, "connected", "Connection should be connected.");
- aResolve();
- };
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testSend() {
- return new Promise(function(aResolve, aReject) {
- const outgoingMessage = "test outgoing message";
-
- gScript.addMessageListener('message-sent', function messageSentHandler(aMessage) {
- gScript.removeMessageListener('message-sent', messageSentHandler);
- is(aMessage, outgoingMessage, "The message is sent out.");
- aResolve();
- });
-
- connection.send(outgoingMessage);
- });
-}
-
-function testIncomingMessage() {
- return new Promise(function(aResolve, aReject) {
- const incomingMessage = "test incoming message";
-
- connection.addEventListener('message', function messageHandler(aEvent) {
- connection.removeEventListener('message', messageHandler);
- is(aEvent.data, incomingMessage, "An incoming message should be received.");
- aResolve();
- });
-
- gScript.sendAsyncMessage('trigger-incoming-message', incomingMessage);
- });
-}
-
-function testCloseConnection() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('data-transport-closed', function dataTransportClosedHandler(aReason) {
- gScript.removeMessageListener('data-transport-closed', dataTransportClosedHandler);
- info("The data transport is closed. " + aReason);
- });
-
- connection.onclose = function() {
- connection.onclose = null;
- is(connection.state, "closed", "Connection should be closed.");
- aResolve();
- };
-
- connection.close();
- });
-}
-
-function testReconnect() {
- return new Promise(function(aResolve, aReject) {
- info('--- testReconnect ---');
- gScript.addMessageListener('control-channel-established', function controlChannelEstablished() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablished);
- gScript.sendAsyncMessage("trigger-control-channel-open");
- });
-
- gScript.addMessageListener('start-reconnect', function startReconnectHandler(url) {
- gScript.removeMessageListener('start-reconnect', startReconnectHandler);
- is(url, "https://example.com/", "URLs should be the same.")
- gScript.sendAsyncMessage('trigger-reconnected-acked', url);
- });
-
- gScript.addMessageListener('offer-sent', function offerSentHandler() {
- gScript.removeMessageListener('offer-sent', offerSentHandler);
- gScript.sendAsyncMessage('trigger-incoming-transport');
- });
-
- gScript.addMessageListener('answer-received', function answerReceivedHandler() {
- gScript.removeMessageListener('answer-received', answerReceivedHandler);
- info("An answer is received.");
- });
-
- gScript.addMessageListener('data-transport-initialized', function dataTransportInitializedHandler() {
- gScript.removeMessageListener('data-transport-initialized', dataTransportInitializedHandler);
- info("Data transport channel is initialized.");
- gScript.sendAsyncMessage('trigger-incoming-answer');
- });
-
- gScript.addMessageListener('data-transport-notification-enabled', function dataTransportNotificationEnabledHandler() {
- gScript.removeMessageListener('data-transport-notification-enabled', dataTransportNotificationEnabledHandler);
- info("Data notification is enabled for data transport channel.");
- });
-
- request.reconnect(connection.id).then(
- function(aConnection) {
- ok(aConnection, "Connection should be available.");
- ok(aConnection.id, "Connection ID should be set.");
- is(aConnection.state, "connecting", "The initial state should be connecting.");
- is(aConnection, connection, "The reconnected connection should be the same.");
-
- aConnection.onconnect = function() {
- aConnection.onconnect = null;
- is(aConnection.state, "connected", "Connection should be connected.");
- aResolve();
- };
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- ok(window.PresentationRequest, "PresentationRequest should be available.");
-
- testSetup().
- then(testStartConnection).
- then(testSend).
- then(testIncomingMessage).
- then(testCloseConnection).
- then(testReconnect).
- then(testCloseConnection).
- then(teardown);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.session_transport.data_channel.enable", false]]},
- runTests);
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_tcp_sender_default_request.html b/dom/presentation/tests/mochitest/test_presentation_tcp_sender_default_request.html
deleted file mode 100644
index 60247ec98..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_tcp_sender_default_request.html
+++ /dev/null
@@ -1,151 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test default request for B2G Presentation API at sender side</title>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1069230">Test default request for B2G Presentation API at sender side</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var connection;
-
-function testSetup() {
- return new Promise(function(aResolve, aReject) {
- navigator.presentation.defaultRequest = new PresentationRequest("https://example.com");
-
- navigator.presentation.defaultRequest.getAvailability().then(
- function(aAvailability) {
- is(aAvailability.value, false, "Sender: should have no available device after setup");
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(aAvailability.value, "Device should be available.");
- aResolve();
- }
-
- gScript.sendAsyncMessage('trigger-device-add');
- },
- function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testStartConnection() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- info("Device prompt is triggered.");
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- });
-
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
- info("A control channel is established.");
- gScript.sendAsyncMessage('trigger-control-channel-open');
- });
-
- gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler(aReason) {
- gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
- info("The control channel is opened.");
- });
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- info("The control channel is closed. " + aReason);
- });
-
- gScript.addMessageListener('offer-sent', function offerSentHandler() {
- gScript.removeMessageListener('offer-sent', offerSentHandler);
- info("An offer is sent out.");
- gScript.sendAsyncMessage('trigger-incoming-transport');
- });
-
- gScript.addMessageListener('answer-received', function answerReceivedHandler() {
- gScript.removeMessageListener('answer-received', answerReceivedHandler);
- info("An answer is received.");
- });
-
- gScript.addMessageListener('data-transport-initialized', function dataTransportInitializedHandler() {
- gScript.removeMessageListener('data-transport-initialized', dataTransportInitializedHandler);
- info("Data transport channel is initialized.");
- gScript.sendAsyncMessage('trigger-incoming-answer');
- });
-
- is(navigator.presentation.receiver, undefined, "Sender shouldn't get a presentation receiver instance.");
-
- navigator.presentation.defaultRequest.onconnectionavailable = function(aEvent) {
- navigator.presentation.defaultRequest.onconnectionavailable = null;
- connection = aEvent.connection;
- ok(connection, "|connectionavailable| event is fired with a connection.");
- ok(connection.id, "Connection ID should be set.");
- is(connection.state, "connecting", "The initial state should be connecting.");
- connection.onconnect = function() {
- connection.onconnect = null;
- is(connection.state, "connected", "Connection should be connected.");
- aResolve();
- };
- };
-
- // Simulate the UA triggers |start()| of the default request.
- navigator.presentation.defaultRequest.start();
- });
-}
-
-function testCloseConnection() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('data-transport-closed', function dataTransportClosedHandler(aReason) {
- gScript.removeMessageListener('data-transport-closed', dataTransportClosedHandler);
- info("The data transport is closed. " + aReason);
- });
-
- connection.onclose = function() {
- connection.onclose = null;
- is(connection.state, "closed", "Connection should be closed.");
- aResolve();
- };
-
- connection.close();
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- ok(window.PresentationRequest, "PresentationRequest should be available.");
- ok(navigator.presentation, "navigator.presentation should be available.");
-
- testSetup().
- then(testStartConnection).
- then(testCloseConnection).
- then(teardown);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.receiver.enabled", false],
- ["dom.presentation.session_transport.data_channel.enable", false]]},
- runTests);
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_tcp_sender_disconnect.html b/dom/presentation/tests/mochitest/test_presentation_tcp_sender_disconnect.html
deleted file mode 100644
index a95da104f..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_tcp_sender_disconnect.html
+++ /dev/null
@@ -1,160 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for disconnection of B2G Presentation API at sender side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1069230">Test for disconnection of B2G Presentation API at sender side</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var request;
-var connection;
-
-function testSetup() {
- return new Promise(function(aResolve, aReject) {
- request = new PresentationRequest("http://example.com");
-
- request.getAvailability().then(
- function(aAvailability) {
- is(aAvailability.value, false, "Sender: should have no available device after setup");
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(aAvailability.value, "Device should be available.");
- aResolve();
- }
-
- gScript.sendAsyncMessage('trigger-device-add');
- },
- function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testStartConnection() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- info("Device prompt is triggered.");
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- });
-
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
- info("A control channel is established.");
- gScript.sendAsyncMessage('trigger-control-channel-open');
- });
-
- gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler(aReason) {
- gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
- info("The control channel is opened.");
- });
-
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- info("The control channel is closed. " + aReason);
- });
-
- gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
- gScript.removeMessageListener('offer-sent', offerSentHandler);
- ok(aIsValid, "A valid offer is sent out.");
- gScript.sendAsyncMessage('trigger-incoming-answer');
- });
-
- gScript.addMessageListener('answer-received', function answerReceivedHandler() {
- gScript.removeMessageListener('answer-received', answerReceivedHandler);
- info("An answer is received.");
- gScript.sendAsyncMessage('trigger-incoming-transport');
- });
-
- gScript.addMessageListener('data-transport-initialized', function dataTransportInitializedHandler() {
- gScript.removeMessageListener('data-transport-initialized', dataTransportInitializedHandler);
- info("Data transport channel is initialized.");
- });
-
- gScript.addMessageListener('data-transport-notification-enabled', function dataTransportNotificationEnabledHandler() {
- gScript.removeMessageListener('data-transport-notification-enabled', dataTransportNotificationEnabledHandler);
- info("Data notification is enabled for data transport channel.");
- });
-
- request.start().then(
- function(aConnection) {
- connection = aConnection;
- ok(connection, "Connection should be available.");
- ok(connection.id, "Connection ID should be set.");
- is(connection.state, "connecting", "The initial state should be connecting.");
- connection.onconnect = function() {
- connection.onconnect = null;
- is(connection.state, "connected", "Connection should be connected.");
- aResolve();
- };
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testDisconnection() {
- return new Promise(function(aResolve, aReject) {
- gScript.addMessageListener('data-transport-closed', function dataTransportClosedHandler(aReason) {
- gScript.removeMessageListener('data-transport-closed', dataTransportClosedHandler);
- info("The data transport is closed. " + aReason);
- });
-
- connection.onclose = function() {
- connection.onclose = null;
- is(connection.state, "closed", "Connection should be closed.");
- aResolve();
- };
-
- gScript.sendAsyncMessage('trigger-data-transport-close', SpecialPowers.Cr.NS_ERROR_FAILURE);
- });
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- ok(window.PresentationRequest, "PresentationRequest should be available.");
-
- testSetup().
- then(testStartConnection).
- then(testDisconnection).
- then(teardown);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.session_transport.data_channel.enable", false]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_tcp_sender_establish_connection_error.html b/dom/presentation/tests/mochitest/test_presentation_tcp_sender_establish_connection_error.html
deleted file mode 100644
index 557ae71a6..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_tcp_sender_establish_connection_error.html
+++ /dev/null
@@ -1,514 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
- <meta charset="utf-8">
- <title>Test for connection establishing errors of B2G Presentation API at sender side</title>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1069230">Test for connection establishing errors of B2G Presentation API at sender side</a>
-<script type="application/javascript;version=1.8">
-
-'use strict';
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript.js'));
-var request;
-
-function setup() {
- return new Promise(function(aResolve, aReject) {
- request = new PresentationRequest("http://example.com");
-
- request.getAvailability().then(
- function(aAvailability) {
- is(aAvailability.value, false, "Sender: should have no available device after setup");
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(aAvailability.value, "Device should be available.");
- aResolve();
- }
-
- gScript.sendAsyncMessage('trigger-device-add');
- },
- function(aError) {
- ok(false, "Error occurred when getting availability: " + aError);
- teardown();
- aReject();
- }
- );
- });
-}
-
-function testStartConnectionCancelPrompt() {
- info('--- testStartConnectionCancelPrompt ---');
- return Promise.all([
- new Promise((resolve) => {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- info("Device prompt is triggered.");
- gScript.sendAsyncMessage('trigger-device-prompt-cancel', SpecialPowers.Cr.NS_ERROR_DOM_NOT_ALLOWED_ERR);
- resolve();
- });
- }),
- request.start().then(
- function(aConnection) {
- ok(false, "|start| shouldn't succeed in this case.");
- },
- function(aError) {
- is(aError.name, "NotAllowedError", "NotAllowedError is expected when the prompt is canceled.");
- }
- ),
- ]);
-}
-
-function testStartConnectionNoDevice() {
- info('--- testStartConnectionNoDevice ---');
- return Promise.all([
- new Promise((resolve) => {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- info("Device prompt is triggered.");
- gScript.sendAsyncMessage('trigger-device-prompt-cancel', SpecialPowers.Cr.NS_ERROR_DOM_NOT_FOUND_ERR);
- resolve();
- });
- }),
- request.start().then(
- function(aConnection) {
- ok(false, "|start| shouldn't succeed in this case.");
- },
- function(aError) {
- is(aError.name, "NotFoundError", "NotFoundError is expected when no available device.");
- }
- ),
- ]);
-}
-
-function testStartConnectionUnexpectedControlChannelCloseBeforeDataTransportInit() {
- info('--- testStartConnectionUnexpectedControlChannelCloseBeforeDataTransportInit ---');
- return Promise.all([
-
- new Promise((resolve) => {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- info("Device prompt is triggered.");
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
- info("A control channel is established.");
- gScript.sendAsyncMessage('trigger-control-channel-open');
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler() {
- gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
- info("The control channel is opened.");
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- info("The control channel is closed. " + aReason);
- is(aReason, SpecialPowers.Cr.NS_ERROR_FAILURE, "The control channel is closed with NS_ERROR_FAILURE");
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
- gScript.removeMessageListener('offer-sent', offerSentHandler);
- ok(aIsValid, "A valid offer is sent out.");
- gScript.sendAsyncMessage('trigger-control-channel-close', SpecialPowers.Cr.NS_ERROR_FAILURE);
- resolve();
- });
- }),
-
- request.start().then(
- function(aConnection) {
- is(aConnection.state, "connecting", "The initial state should be connecting.");
- return new Promise((resolve) => {
- aConnection.onclose = function() {
- aConnection.onclose = null;
- is(aConnection.state, "closed", "Connection should be closed.");
- resolve();
- };
- });
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- }
- ),
-
- ]);
-}
-
-function testStartConnectionUnexpectedControlChannelCloseNoReasonBeforeDataTransportInit() {
- info('--- testStartConnectionUnexpectedControlChannelCloseNoReasonBeforeDataTransportInit ---');
- return Promise.all([
-
- new Promise((resolve) => {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- info("Device prompt is triggered.");
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
- info("A control channel is established.");
- gScript.sendAsyncMessage('trigger-control-channel-open');
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler() {
- gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
- info("The control channel is opened.");
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- info("The control channel is closed. " + aReason);
- is(aReason, SpecialPowers.Cr.NS_OK, "The control channel is closed with NS_OK");
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
- gScript.removeMessageListener('offer-sent', offerSentHandler);
- ok(aIsValid, "A valid offer is sent out.");
- gScript.sendAsyncMessage('trigger-control-channel-close', SpecialPowers.Cr.NS_OK);
- resolve();
- });
- }),
-
- request.start().then(
- function(aConnection) {
- is(aConnection.state, "connecting", "The initial state should be connecting.");
- return new Promise((resolve) => {
- aConnection.onclose = function() {
- aConnection.onclose = null;
- is(aConnection.state, "closed", "Connection should be closed.");
- resolve();
- };
- });
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- }
- ),
-
- ]);
-}
-
-function testStartConnectionUnexpectedControlChannelCloseBeforeDataTransportReady() {
- info('--- testStartConnectionUnexpectedControlChannelCloseBeforeDataTransportReady ---');
- return Promise.all([
-
- new Promise((resolve) => {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- info("Device prompt is triggered.");
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
- info("A control channel is established.");
- gScript.sendAsyncMessage('trigger-control-channel-open');
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler() {
- gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
- info("The control channel is opened.");
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- is(aReason, SpecialPowers.Cr.NS_ERROR_ABORT, "The control channel is closed with NS_ERROR_ABORT");
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
- gScript.removeMessageListener('offer-sent', offerSentHandler);
- ok(aIsValid, "A valid offer is sent out.");
- gScript.sendAsyncMessage('trigger-incoming-transport');
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('data-transport-initialized', function dataTransportInitializedHandler() {
- gScript.removeMessageListener('data-transport-initialized', dataTransportInitializedHandler);
- info("Data transport channel is initialized.");
- gScript.sendAsyncMessage('trigger-control-channel-close', SpecialPowers.Cr.NS_ERROR_ABORT);
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('data-transport-closed', function dataTransportClosedHandler(aReason) {
- gScript.removeMessageListener('data-transport-closed', dataTransportClosedHandler);
- info("The data transport is closed. " + aReason);
- resolve();
- });
- }),
-
- request.start().then(
- function(aConnection) {
- is(aConnection.state, "connecting", "The initial state should be connecting.");
- return new Promise((resolve) => {
- aConnection.onclose = function() {
- aConnection.onclose = null;
- is(aConnection.state, "closed", "Connection should be closed.");
- resolve();
- };
- });
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- }
- ),
-
- ]);
-}
-
-function testStartConnectionUnexpectedControlChannelCloseNoReasonBeforeDataTransportReady() {
- info('--- testStartConnectionUnexpectedControlChannelCloseNoReasonBeforeDataTransportReady -- ');
- return Promise.all([
-
- new Promise((resolve) => {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- info("Device prompt is triggered.");
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
- info("A control channel is established.");
- gScript.sendAsyncMessage('trigger-control-channel-open');
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler() {
- gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
- info("The control channel is opened.");
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- info("The control channel is closed. " + aReason);
- is(aReason, SpecialPowers.Cr.NS_OK, "The control channel is closed with NS_OK");
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
- gScript.removeMessageListener('offer-sent', offerSentHandler);
- ok(aIsValid, "A valid offer is sent out.");
- gScript.sendAsyncMessage('trigger-incoming-transport');
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('data-transport-initialized', function dataTransportInitializedHandler() {
- gScript.removeMessageListener('data-transport-initialized', dataTransportInitializedHandler);
- info("Data transport channel is initialized.");
- gScript.sendAsyncMessage('trigger-control-channel-close', SpecialPowers.Cr.NS_OK);
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('data-transport-closed', function dataTransportClosedHandler(aReason) {
- gScript.removeMessageListener('data-transport-closed', dataTransportClosedHandler);
- info("The data transport is closed. " + aReason);
- resolve();
- });
- }),
-
- request.start().then(
- function(aConnection) {
- is(aConnection.state, "connecting", "The initial state should be connecting.");
- return new Promise((resolve) => {
- aConnection.onclose = function() {
- aConnection.onclose = null;
- is(aConnection.state, "closed", "Connection should be closed.");
- resolve();
- };
- });
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- }
- ),
-
- ]);
-}
-
-function testStartConnectionUnexpectedDataTransportClose() {
- info('--- testStartConnectionUnexpectedDataTransportClose ---');
- return Promise.all([
-
- new Promise((resolve) => {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- info("Device prompt is triggered.");
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established', controlChannelEstablishedHandler);
- info("A control channel is established.");
- gScript.sendAsyncMessage('trigger-control-channel-open');
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-opened', function controlChannelOpenedHandler() {
- gScript.removeMessageListener('control-channel-opened', controlChannelOpenedHandler);
- info("The control channel is opened.");
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('control-channel-closed', function controlChannelClosedHandler(aReason) {
- gScript.removeMessageListener('control-channel-closed', controlChannelClosedHandler);
- info("The control channel is closed. " + aReason);
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('offer-sent', function offerSentHandler(aIsValid) {
- gScript.removeMessageListener('offer-sent', offerSentHandler);
- ok(aIsValid, "A valid offer is sent out.");
- info("recv offer-sent.");
- gScript.sendAsyncMessage('trigger-incoming-transport');
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('data-transport-initialized', function dataTransportInitializedHandler() {
- gScript.removeMessageListener('data-transport-initialized', dataTransportInitializedHandler);
- info("Data transport channel is initialized.");
- gScript.sendAsyncMessage('trigger-data-transport-close', SpecialPowers.Cr.NS_ERROR_UNEXPECTED);
- resolve();
- });
- }),
-
- new Promise((resolve) => {
- gScript.addMessageListener('data-transport-closed', function dataTransportClosedHandler(aReason) {
- gScript.removeMessageListener('data-transport-closed', dataTransportClosedHandler);
- info("The data transport is closed. " + aReason);
- resolve();
- });
- }),
-
- request.start().then(
- function(aConnection) {
- is(aConnection.state, "connecting", "The initial state should be connecting.");
- return new Promise((resolve) => {
- aConnection.onclose = function() {
- aConnection.onclose = null;
- is(aConnection.state, "closed", "Connection should be closed.");
- resolve();
- };
- });
- },
- function(aError) {
- ok(false, "Error occurred when establishing a connection: " + aError);
- teardown();
- }
- ),
-
- ]);
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
-
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- ok(window.PresentationRequest, "PresentationRequest should be available.");
-
- setup().
- then(testStartConnectionCancelPrompt).
- then(testStartConnectionNoDevice).
- then(testStartConnectionUnexpectedControlChannelCloseBeforeDataTransportInit).
- then(testStartConnectionUnexpectedControlChannelCloseNoReasonBeforeDataTransportInit).
- then(testStartConnectionUnexpectedControlChannelCloseBeforeDataTransportReady).
- then(testStartConnectionUnexpectedControlChannelCloseNoReasonBeforeDataTransportReady).
- then(testStartConnectionUnexpectedDataTransportClose).
- then(teardown);
-}
-
-SimpleTest.waitForExplicitFinish();
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
-], function() {
- SpecialPowers.pushPrefEnv({ 'set': [["dom.presentation.enabled", true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.session_transport.data_channel.enable", false]]},
- runTests);
-});
-
-</script>
-</body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_terminate.js b/dom/presentation/tests/mochitest/test_presentation_terminate.js
deleted file mode 100644
index 8ebfd9d64..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_terminate.js
+++ /dev/null
@@ -1,243 +0,0 @@
-'use strict';
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestFlakyTimeout('Test for guarantee not firing async event');
-
-function debug(str) {
- // info(str);
-}
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript1UA.js'));
-var receiverUrl = SimpleTest.getTestFileURL('file_presentation_terminate.html');
-var request;
-var connection;
-var receiverIframe;
-
-function setup() {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- debug('Got message: device-prompt');
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- });
-
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established',
- controlChannelEstablishedHandler);
- gScript.sendAsyncMessage('trigger-control-channel-open');
- });
-
- gScript.addMessageListener('sender-launch', function senderLaunchHandler(url) {
- debug('Got message: sender-launch');
- gScript.removeMessageListener('sender-launch', senderLaunchHandler);
- is(url, receiverUrl, 'Receiver: should receive the same url');
- receiverIframe = document.createElement('iframe');
- receiverIframe.setAttribute('mozbrowser', 'true');
- receiverIframe.setAttribute('mozpresentation', receiverUrl);
- var oop = location.pathname.indexOf('_inproc') == -1;
- receiverIframe.setAttribute('remote', oop);
-
- receiverIframe.setAttribute('src', receiverUrl);
- receiverIframe.addEventListener('mozbrowserloadend', function mozbrowserloadendHander() {
- receiverIframe.removeEventListener('mozbrowserloadend', mozbrowserloadendHander);
- info('Receiver loaded.');
- });
-
- // This event is triggered when the iframe calls 'alert'.
- receiverIframe.addEventListener('mozbrowsershowmodalprompt', function receiverListener(evt) {
- var message = evt.detail.message;
- if (/^OK /.exec(message)) {
- ok(true, message.replace(/^OK /, ''));
- } else if (/^KO /.exec(message)) {
- ok(false, message.replace(/^KO /, ''));
- } else if (/^INFO /.exec(message)) {
- info(message.replace(/^INFO /, ''));
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ''));
- gScript.sendAsyncMessage(command.name, command.data);
- } else if (/^DONE$/.exec(message)) {
- ok(true, 'Messaging from iframe complete.');
- receiverIframe.removeEventListener('mozbrowsershowmodalprompt',
- receiverListener);
- }
- }, false);
-
- var promise = new Promise(function(aResolve, aReject) {
- document.body.appendChild(receiverIframe);
- aResolve(receiverIframe);
- });
-
- var obs = SpecialPowers.Cc['@mozilla.org/observer-service;1']
- .getService(SpecialPowers.Ci.nsIObserverService);
- obs.notifyObservers(promise, 'setup-request-promise', null);
- });
-
- gScript.addMessageListener('promise-setup-ready', function promiseSetupReadyHandler() {
- debug('Got message: promise-setup-ready');
- gScript.removeMessageListener('promise-setup-ready',
- promiseSetupReadyHandler);
- gScript.sendAsyncMessage('trigger-on-session-request', receiverUrl);
- });
-
- return Promise.resolve();
-}
-
-function testCreateRequest() {
- return new Promise(function(aResolve, aReject) {
- info('Sender: --- testCreateRequest ---');
- request = new PresentationRequest(receiverUrl);
- request.getAvailability().then((aAvailability) => {
- is(aAvailability.value, false, "Sender: should have no available device after setup");
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(aAvailability.value, 'Sender: Device should be available.');
- aResolve();
- }
-
- gScript.sendAsyncMessage('trigger-device-add');
- }).catch((aError) => {
- ok(false, 'Sender: Error occurred when getting availability: ' + aError);
- teardown();
- aReject();
- });
- });
-}
-
-function testStartConnection() {
- return new Promise(function(aResolve, aReject) {
- request.start().then((aConnection) => {
- connection = aConnection;
- ok(connection, 'Sender: Connection should be available.');
- ok(connection.id, 'Sender: Connection ID should be set.');
- is(connection.state, 'connecting', 'Sender: The initial state should be connecting.');
- connection.onconnect = function() {
- connection.onconnect = null;
- is(connection.state, 'connected', 'Connection should be connected.');
- aResolve();
- };
-
- info('Sender: test terminate at connecting state');
- connection.onterminate = function() {
- connection.onterminate = null;
- ok(false, 'Should not be able to terminate at connecting state');
- aReject();
- }
- connection.terminate();
- }).catch((aError) => {
- ok(false, 'Sender: Error occurred when establishing a connection: ' + aError);
- teardown();
- aReject();
- });
- });
-}
-
-function testConnectionTerminate() {
- return new Promise(function(aResolve, aReject) {
- info('Sender: --- testConnectionTerminate---');
- connection.onterminate = function() {
- connection.onterminate = null;
- is(connection.state, 'terminated', 'Sender: Connection should be terminated.');
- };
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established',
- controlChannelEstablishedHandler);
- gScript.sendAsyncMessage('trigger-control-channel-open');
- });
- gScript.addMessageListener('sender-terminate', function senderTerminateHandler() {
- gScript.removeMessageListener('sender-terminate',
- senderTerminateHandler);
-
- Promise.all([
- new Promise((resolve) => {
- gScript.addMessageListener('device-disconnected', function deviceDisconnectedHandler() {
- gScript.removeMessageListener('device-disconnected', deviceDisconnectedHandler);
- ok(true, 'observe device disconnect');
- resolve();
- });
- }),
- new Promise((resolve) => {
- receiverIframe.addEventListener('mozbrowserclose', function() {
- ok(true, 'observe receiver page closing');
- resolve();
- });
- }),
- ]).then(aResolve);
-
- gScript.sendAsyncMessage('trigger-on-terminate-request');
- });
- gScript.addMessageListener('ready-to-terminate', function onReadyToTerminate() {
- gScript.removeMessageListener('ready-to-terminate', onReadyToTerminate);
- connection.terminate();
-
- // test unexpected close right after terminate
- connection.onclose = function() {
- ok(false, 'close after terminate should do nothing');
- };
- connection.close();
- });
- });
-}
-
-function testSendAfterTerminate() {
- return new Promise(function(aResolve, aReject) {
- try {
- connection.send('something');
- ok(false, 'PresentationConnection.send should be failed');
- } catch (e) {
- is(e.name, 'InvalidStateError', 'Must throw InvalidStateError');
- }
- aResolve();
- });
-}
-
-function testCloseAfterTerminate() {
- return Promise.race([
- new Promise(function(aResolve, aReject) {
- connection.onclose = function() {
- connection.onclose = null;
- ok(false, 'close at terminated state should do nothing');
- aResolve();
- };
- connection.close();
- }),
- new Promise(function(aResolve, aReject) {
- setTimeout(function() {
- is(connection.state, 'terminated', 'Sender: Connection should be terminated.');
- aResolve();
- }, 3000);
- }),
- ]);
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- debug('Got message: teardown-complete');
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- setup().then(testCreateRequest)
- .then(testStartConnection)
- .then(testConnectionTerminate)
- .then(testSendAfterTerminate)
- .then(testCloseAfterTerminate)
- .then(teardown);
-}
-
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
- {type: 'browser', allow: true, context: document},
-], () => {
- SpecialPowers.pushPrefEnv({ 'set': [['dom.presentation.enabled', true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.receiver.enabled", true],
- ['dom.presentation.test.enabled', true],
- ['dom.mozBrowserFramesEnabled', true],
- ["network.disable.ipc.security", true],
- ['dom.ipc.tabs.disabled', false],
- ['dom.presentation.test.stage', 0]]},
- runTests);
-});
diff --git a/dom/presentation/tests/mochitest/test_presentation_terminate_establish_connection_error.js b/dom/presentation/tests/mochitest/test_presentation_terminate_establish_connection_error.js
deleted file mode 100644
index a1d477aab..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_terminate_establish_connection_error.js
+++ /dev/null
@@ -1,197 +0,0 @@
-'use strict';
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestFlakyTimeout('Test for guarantee not firing async event');
-
-function debug(str) {
- // info(str);
-}
-
-var gScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL('PresentationSessionChromeScript1UA.js'));
-var receiverUrl = SimpleTest.getTestFileURL('file_presentation_terminate_establish_connection_error.html');
-var request;
-var connection;
-var receiverIframe;
-
-function postMessageToIframe(aType) {
- receiverIframe.src = receiverUrl + "#" +
- encodeURIComponent(JSON.stringify({ type: aType }));
-}
-
-function setup() {
- gScript.addMessageListener('device-prompt', function devicePromptHandler() {
- debug('Got message: device-prompt');
- gScript.removeMessageListener('device-prompt', devicePromptHandler);
- gScript.sendAsyncMessage('trigger-device-prompt-select');
- });
-
- gScript.addMessageListener('control-channel-established', function controlChannelEstablishedHandler() {
- gScript.removeMessageListener('control-channel-established',
- controlChannelEstablishedHandler);
- gScript.sendAsyncMessage('trigger-control-channel-open');
- });
-
- gScript.addMessageListener('sender-launch', function senderLaunchHandler(url) {
- debug('Got message: sender-launch');
- gScript.removeMessageListener('sender-launch', senderLaunchHandler);
- is(url, receiverUrl, 'Receiver: should receive the same url');
- receiverIframe = document.createElement('iframe');
- receiverIframe.setAttribute('mozbrowser', 'true');
- receiverIframe.setAttribute('mozpresentation', receiverUrl);
- var oop = location.pathname.indexOf('_inproc') == -1;
- receiverIframe.setAttribute('remote', oop);
-
- receiverIframe.setAttribute('src', receiverUrl);
- receiverIframe.addEventListener('mozbrowserloadend', function mozbrowserloadendHander() {
- receiverIframe.removeEventListener('mozbrowserloadend', mozbrowserloadendHander);
- info('Receiver loaded.');
- });
-
- // This event is triggered when the iframe calls 'alert'.
- receiverIframe.addEventListener('mozbrowsershowmodalprompt', function receiverListener(evt) {
- var message = evt.detail.message;
- if (/^OK /.exec(message)) {
- ok(true, message.replace(/^OK /, ''));
- } else if (/^KO /.exec(message)) {
- ok(false, message.replace(/^KO /, ''));
- } else if (/^INFO /.exec(message)) {
- info(message.replace(/^INFO /, ''));
- } else if (/^COMMAND /.exec(message)) {
- var command = JSON.parse(message.replace(/^COMMAND /, ''));
- gScript.sendAsyncMessage(command.name, command.data);
- } else if (/^DONE$/.exec(message)) {
- ok(true, 'Messaging from iframe complete.');
- receiverIframe.removeEventListener('mozbrowsershowmodalprompt',
- receiverListener);
- }
- }, false);
-
- var promise = new Promise(function(aResolve, aReject) {
- document.body.appendChild(receiverIframe);
- aResolve(receiverIframe);
- });
-
- var obs = SpecialPowers.Cc['@mozilla.org/observer-service;1']
- .getService(SpecialPowers.Ci.nsIObserverService);
- obs.notifyObservers(promise, 'setup-request-promise', null);
- });
-
- gScript.addMessageListener('promise-setup-ready', function promiseSetupReadyHandler() {
- debug('Got message: promise-setup-ready');
- gScript.removeMessageListener('promise-setup-ready',
- promiseSetupReadyHandler);
- gScript.sendAsyncMessage('trigger-on-session-request', receiverUrl);
- });
-
- return Promise.resolve();
-}
-
-function testCreateRequest() {
- return new Promise(function(aResolve, aReject) {
- info('Sender: --- testCreateRequest ---');
- request = new PresentationRequest(receiverUrl);
- request.getAvailability().then((aAvailability) => {
- is(aAvailability.value, false, "Sender: should have no available device after setup");
- aAvailability.onchange = function() {
- aAvailability.onchange = null;
- ok(aAvailability.value, 'Sender: Device should be available.');
- aResolve();
- }
-
- gScript.sendAsyncMessage('trigger-device-add');
- }).catch((aError) => {
- ok(false, 'Sender: Error occurred when getting availability: ' + aError);
- teardown();
- aReject();
- });
- });
-}
-
-function testStartConnection() {
- return new Promise(function(aResolve, aReject) {
- request.start().then((aConnection) => {
- connection = aConnection;
- ok(connection, 'Sender: Connection should be available.');
- ok(connection.id, 'Sender: Connection ID should be set.');
- is(connection.state, 'connecting', 'Sender: The initial state should be connecting.');
- connection.onconnect = function() {
- connection.onconnect = null;
- is(connection.state, 'connected', 'Connection should be connected.');
- aResolve();
- };
- }).catch((aError) => {
- ok(false, 'Sender: Error occurred when establishing a connection: ' + aError);
- teardown();
- aReject();
- });
- });
-}
-
-function testConnectionTerminate() {
- info('Sender: --- testConnectionTerminate---');
- let promise = Promise.all([
- new Promise(function(aResolve, aReject) {
- connection.onclose = function() {
- connection.onclose = null;
- is(connection.state, 'closed', 'Sender: Connection should be closed.');
- aResolve();
- };
- }),
- new Promise(function(aResolve, aReject) {
- function deviceDisconnectedHandler() {
- gScript.removeMessageListener('device-disconnected', deviceDisconnectedHandler);
- ok(true, 'should not receive device disconnect');
- aResolve();
- }
-
- gScript.addMessageListener('device-disconnected', deviceDisconnectedHandler);
- }),
- new Promise(function(aResolve, aReject) {
- receiverIframe.addEventListener('mozbrowserclose', function() {
- ok(true, 'observe receiver page closing');
- aResolve();
- });
- })
- ]);
-
- gScript.addMessageListener('prepare-for-terminate', function prepareForTerminateHandler() {
- debug('Got message: prepare-for-terminate');
- gScript.removeMessageListener('prepare-for-terminate', prepareForTerminateHandler);
- gScript.sendAsyncMessage('trigger-control-channel-error');
- postMessageToIframe('ready-to-terminate');
- });
-
- return promise;
-}
-
-function teardown() {
- gScript.addMessageListener('teardown-complete', function teardownCompleteHandler() {
- debug('Got message: teardown-complete');
- gScript.removeMessageListener('teardown-complete', teardownCompleteHandler);
- gScript.destroy();
- SimpleTest.finish();
- });
- gScript.sendAsyncMessage('teardown');
-}
-
-function runTests() {
- setup().then(testCreateRequest)
- .then(testStartConnection)
- .then(testConnectionTerminate)
- .then(teardown);
-}
-
-SpecialPowers.pushPermissions([
- {type: 'presentation-device-manage', allow: false, context: document},
- {type: 'browser', allow: true, context: document},
-], () => {
- SpecialPowers.pushPrefEnv({ 'set': [['dom.presentation.enabled', true],
- ["dom.presentation.controller.enabled", true],
- ["dom.presentation.receiver.enabled", true],
- ['dom.presentation.test.enabled', true],
- ['dom.mozBrowserFramesEnabled', true],
- ["network.disable.ipc.security", true],
- ['dom.ipc.tabs.disabled', false],
- ['dom.presentation.test.stage', 0]]},
- runTests);
-});
diff --git a/dom/presentation/tests/mochitest/test_presentation_terminate_establish_connection_error_inproc.html b/dom/presentation/tests/mochitest/test_presentation_terminate_establish_connection_error_inproc.html
deleted file mode 100644
index ccf0767f1..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_terminate_establish_connection_error_inproc.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
- <!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
- <head>
- <meta charset='utf-8'>
- <title>Test for control channel establish error during PresentationConnection.terminate()</title>
- <link rel='stylesheet' type='text/css' href='/tests/SimpleTest/test.css'/>
- <script type='application/javascript' src='/tests/SimpleTest/SimpleTest.js'></script>
- </head>
- <body>
- <a target='_blank' href='https://bugzilla.mozilla.org/show_bug.cgi?id=1289292'>
- Test for constrol channel establish error during PresentationConnection.terminate()</a>
- <script type='application/javascript;version=1.8' src='test_presentation_terminate_establish_connection_error.js'>
- </script>
- </body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_terminate_establish_connection_error_oop.html b/dom/presentation/tests/mochitest/test_presentation_terminate_establish_connection_error_oop.html
deleted file mode 100644
index ccf0767f1..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_terminate_establish_connection_error_oop.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
- <!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
- <head>
- <meta charset='utf-8'>
- <title>Test for control channel establish error during PresentationConnection.terminate()</title>
- <link rel='stylesheet' type='text/css' href='/tests/SimpleTest/test.css'/>
- <script type='application/javascript' src='/tests/SimpleTest/SimpleTest.js'></script>
- </head>
- <body>
- <a target='_blank' href='https://bugzilla.mozilla.org/show_bug.cgi?id=1289292'>
- Test for constrol channel establish error during PresentationConnection.terminate()</a>
- <script type='application/javascript;version=1.8' src='test_presentation_terminate_establish_connection_error.js'>
- </script>
- </body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_terminate_inproc.html b/dom/presentation/tests/mochitest/test_presentation_terminate_inproc.html
deleted file mode 100644
index 33bbcda57..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_terminate_inproc.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
- <!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
- <head>
- <meta charset='utf-8'>
- <title>Test for PresentationConnection.terminate()</title>
- <link rel='stylesheet' type='text/css' href='/tests/SimpleTest/test.css'/>
- <script type='application/javascript' src='/tests/SimpleTest/SimpleTest.js'></script>
- </head>
- <body>
- <a target='_blank' href='https://bugzilla.mozilla.org/show_bug.cgi?id=1276378'>
- Test for PresentationConnection.terminate()</a>
- <script type='application/javascript;version=1.8' src='test_presentation_terminate.js'>
- </script>
- </body>
-</html>
diff --git a/dom/presentation/tests/mochitest/test_presentation_terminate_oop.html b/dom/presentation/tests/mochitest/test_presentation_terminate_oop.html
deleted file mode 100644
index 33bbcda57..000000000
--- a/dom/presentation/tests/mochitest/test_presentation_terminate_oop.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE HTML>
-<!-- vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: -->
-<html>
- <!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
- <head>
- <meta charset='utf-8'>
- <title>Test for PresentationConnection.terminate()</title>
- <link rel='stylesheet' type='text/css' href='/tests/SimpleTest/test.css'/>
- <script type='application/javascript' src='/tests/SimpleTest/SimpleTest.js'></script>
- </head>
- <body>
- <a target='_blank' href='https://bugzilla.mozilla.org/show_bug.cgi?id=1276378'>
- Test for PresentationConnection.terminate()</a>
- <script type='application/javascript;version=1.8' src='test_presentation_terminate.js'>
- </script>
- </body>
-</html>
diff --git a/dom/presentation/tests/xpcshell/test_multicast_dns_device_provider.js b/dom/presentation/tests/xpcshell/test_multicast_dns_device_provider.js
deleted file mode 100644
index 137a5609a..000000000
--- a/dom/presentation/tests/xpcshell/test_multicast_dns_device_provider.js
+++ /dev/null
@@ -1,1318 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-/* global Services, do_register_cleanup, do_test_pending */
-
-"use strict";
-
-const { classes: Cc, interfaces: Ci, manager: Cm, results: Cr, utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const INFO_CONTRACT_ID = "@mozilla.org/toolkit/components/mdnsresponder/dns-info;1";
-const PROVIDER_CONTRACT_ID = "@mozilla.org/presentation-device/multicastdns-provider;1";
-const SD_CONTRACT_ID = "@mozilla.org/toolkit/components/mdnsresponder/dns-sd;1";
-const UUID_CONTRACT_ID = "@mozilla.org/uuid-generator;1";
-const SERVER_CONTRACT_ID = "@mozilla.org/presentation/control-service;1";
-
-const PREF_DISCOVERY = "dom.presentation.discovery.enabled";
-const PREF_DISCOVERABLE = "dom.presentation.discoverable";
-const PREF_DEVICENAME= "dom.presentation.device.name";
-
-const LATEST_VERSION = 1;
-const SERVICE_TYPE = "_presentation-ctrl._tcp";
-const versionAttr = Cc["@mozilla.org/hash-property-bag;1"]
- .createInstance(Ci.nsIWritablePropertyBag2);
-versionAttr.setPropertyAsUint32("version", LATEST_VERSION);
-
-var registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
-
-function sleep(aMs) {
- let deferred = Promise.defer();
-
- let timer = Cc["@mozilla.org/timer;1"]
- .createInstance(Ci.nsITimer);
-
- timer.initWithCallback({
- notify: function () {
- deferred.resolve();
- },
- }, aMs, timer.TYPE_ONE_SHOT);
-
- return deferred.promise;
-}
-
-function MockFactory(aClass) {
- this._cls = aClass;
-}
-MockFactory.prototype = {
- createInstance: function(aOuter, aIID) {
- if (aOuter) {
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
- switch(typeof(this._cls)) {
- case "function":
- return new this._cls().QueryInterface(aIID);
- case "object":
- return this._cls.QueryInterface(aIID);
- default:
- return null;
- }
- },
- lockFactory: function(aLock) {
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory])
-};
-
-function ContractHook(aContractID, aClass) {
- this._contractID = aContractID;
- this.classID = Cc[UUID_CONTRACT_ID].getService(Ci.nsIUUIDGenerator).generateUUID();
- this._newFactory = new MockFactory(aClass);
-
- if (!this.hookedMap.has(this._contractID)) {
- this.hookedMap.set(this._contractID, []);
- }
-
- this.init();
-}
-
-ContractHook.prototype = {
- hookedMap: new Map(), // remember only the most original factory.
-
- init: function() {
- this.reset();
-
- let oldContract = this.unregister();
- this.hookedMap.get(this._contractID).push(oldContract);
- registrar.registerFactory(this.classID,
- "",
- this._contractID,
- this._newFactory);
-
- do_register_cleanup(() => { this.cleanup.apply(this); });
- },
-
- reset: function() {},
-
- cleanup: function() {
- this.reset();
-
- this.unregister();
- let prevContract = this.hookedMap.get(this._contractID).pop();
-
- if (prevContract.factory) {
- registrar.registerFactory(prevContract.classID,
- "",
- this._contractID,
- prevContract.factory);
- }
- },
-
- unregister: function() {
- var classID, factory;
-
- try {
- classID = registrar.contractIDToCID(this._contractID);
- factory = Cm.getClassObject(Cc[this._contractID], Ci.nsIFactory);
- } catch (ex) {
- classID = "";
- factory = null;
- }
-
- if (factory) {
- registrar.unregisterFactory(classID, factory);
- }
-
- return { classID: classID, factory: factory };
- }
-};
-
-function MockDNSServiceInfo() {}
-MockDNSServiceInfo.prototype = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceInfo]),
-
- set host(aHost) {
- this._host = aHost;
- },
-
- get host() {
- return this._host;
- },
-
- set address(aAddress) {
- this._address = aAddress;
- },
-
- get address() {
- return this._address;
- },
-
- set port(aPort) {
- this._port = aPort;
- },
-
- get port() {
- return this._port;
- },
-
- set serviceName(aServiceName) {
- this._serviceName = aServiceName;
- },
-
- get serviceName() {
- return this._serviceName;
- },
-
- set serviceType(aServiceType) {
- this._serviceType = aServiceType;
- },
-
- get serviceType() {
- return this._serviceType;
- },
-
- set domainName(aDomainName) {
- this._domainName = aDomainName;
- },
-
- get domainName() {
- return this._domainName;
- },
-
- set attributes(aAttributes) {
- this._attributes = aAttributes;
- },
-
- get attributes() {
- return this._attributes;
- }
-};
-
-function TestPresentationDeviceListener() {
- this.devices = {};
-}
-TestPresentationDeviceListener.prototype = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceListener,
- Ci.nsISupportsWeakReference]),
-
- addDevice: function(device) { this.devices[device.id] = device; },
- removeDevice: function(device) { delete this.devices[device.id]; },
- updateDevice: function(device) { this.devices[device.id] = device; },
- onSessionRequest: function(device, url, presentationId, controlChannel) {},
-
- count: function() {
- var size = 0, key;
- for (key in this.devices) {
- if (this.devices.hasOwnProperty(key)) {
- ++size;
- }
- }
- return size;
- }
-};
-
-function createDevice(host, port, serviceName, serviceType, domainName, attributes) {
- let device = new MockDNSServiceInfo();
- device.host = host || "";
- device.port = port || 0;
- device.address = host || "";
- device.serviceName = serviceName || "";
- device.serviceType = serviceType || "";
- device.domainName = domainName || "";
- device.attributes = attributes || versionAttr;
- return device;
-}
-
-function registerService() {
- Services.prefs.setBoolPref(PREF_DISCOVERABLE, true);
-
- let deferred = Promise.defer();
-
- let mockObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {},
- registerService: function(serviceInfo, listener) {
- deferred.resolve();
- this.serviceRegistered++;
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {
- this.serviceUnregistered++;
- }.bind(this)
- };
- },
- resolveService: function(serviceInfo, listener) {},
- serviceRegistered: 0,
- serviceUnregistered: 0
- };
- let contractHook = new ContractHook(SD_CONTRACT_ID, mockObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
-
- Assert.equal(mockObj.serviceRegistered, 0);
- Assert.equal(mockObj.serviceUnregistered, 0);
-
- // Register
- provider.listener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceListener,
- Ci.nsISupportsWeakReference]),
- addDevice: function(device) {},
- removeDevice: function(device) {},
- updateDevice: function(device) {},
- };
-
- deferred.promise.then(function() {
- Assert.equal(mockObj.serviceRegistered, 1);
- Assert.equal(mockObj.serviceUnregistered, 0);
-
- // Unregister
- provider.listener = null;
- Assert.equal(mockObj.serviceRegistered, 1);
- Assert.equal(mockObj.serviceUnregistered, 1);
-
- run_next_test();
- });
-}
-
-function noRegisterService() {
- Services.prefs.setBoolPref(PREF_DISCOVERABLE, false);
-
- let deferred = Promise.defer();
-
- let mockObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {},
- registerService: function(serviceInfo, listener) {
- deferred.resolve();
- Assert.ok(false, "should not register service if not discoverable");
- },
- resolveService: function(serviceInfo, listener) {},
- };
-
- let contractHook = new ContractHook(SD_CONTRACT_ID, mockObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
-
- // Try register
- provider.listener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceListener,
- Ci.nsISupportsWeakReference]),
- addDevice: function(device) {},
- removeDevice: function(device) {},
- updateDevice: function(device) {},
- };
-
- let race = Promise.race([
- deferred.promise,
- sleep(1000),
- ]);
-
- race.then(() => {
- provider.listener = null;
-
- run_next_test();
- });
-}
-
-function registerServiceDynamically() {
- Services.prefs.setBoolPref(PREF_DISCOVERABLE, false);
-
- let deferred = Promise.defer();
-
- let mockObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {},
- registerService: function(serviceInfo, listener) {
- deferred.resolve();
- this.serviceRegistered++;
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {
- this.serviceUnregistered++;
- }.bind(this)
- };
- },
- resolveService: function(serviceInfo, listener) {},
- serviceRegistered: 0,
- serviceUnregistered: 0
- };
- let contractHook = new ContractHook(SD_CONTRACT_ID, mockObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
-
- Assert.equal(mockObj.serviceRegistered, 0);
- Assert.equal(mockObj.serviceRegistered, 0);
-
- // Try Register
- provider.listener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceListener,
- Ci.nsISupportsWeakReference]),
- addDevice: function(device) {},
- removeDevice: function(device) {},
- updateDevice: function(device) {},
- };
-
- Assert.equal(mockObj.serviceRegistered, 0);
- Assert.equal(mockObj.serviceUnregistered, 0);
-
- // Enable registration
- Services.prefs.setBoolPref(PREF_DISCOVERABLE, true);
-
- deferred.promise.then(function() {
- Assert.equal(mockObj.serviceRegistered, 1);
- Assert.equal(mockObj.serviceUnregistered, 0);
-
- // Disable registration
- Services.prefs.setBoolPref(PREF_DISCOVERABLE, false);
- Assert.equal(mockObj.serviceRegistered, 1);
- Assert.equal(mockObj.serviceUnregistered, 1);
-
- // Try unregister
- provider.listener = null;
- Assert.equal(mockObj.serviceRegistered, 1);
- Assert.equal(mockObj.serviceUnregistered, 1);
-
- run_next_test();
- });
-}
-
-function addDevice() {
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
-
- let mockDevice = createDevice("device.local",
- 12345,
- "service.name",
- SERVICE_TYPE);
- let mockObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {
- listener.onDiscoveryStarted(serviceType);
- listener.onServiceFound(createDevice("",
- 0,
- mockDevice.serviceName,
- mockDevice.serviceType));
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {}
- };
- },
- registerService: function(serviceInfo, listener) {},
- resolveService: function(serviceInfo, listener) {
- Assert.equal(serviceInfo.serviceName, mockDevice.serviceName);
- Assert.equal(serviceInfo.serviceType, mockDevice.serviceType);
- listener.onServiceResolved(createDevice(mockDevice.host,
- mockDevice.port,
- mockDevice.serviceName,
- mockDevice.serviceType));
- }
- };
-
- let contractHook = new ContractHook(SD_CONTRACT_ID, mockObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
- let listener = new TestPresentationDeviceListener();
- Assert.equal(listener.count(), 0);
-
- // Start discovery
- provider.listener = listener;
- Assert.equal(listener.count(), 1);
-
- // Force discovery again
- provider.forceDiscovery();
- Assert.equal(listener.count(), 1);
-
- provider.listener = null;
- Assert.equal(listener.count(), 1);
-
- run_next_test();
-}
-
-function filterDevice() {
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
-
- let mockDevice = createDevice("device.local",
- 12345,
- "service.name",
- SERVICE_TYPE);
- let mockObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {
- listener.onDiscoveryStarted(serviceType);
- listener.onServiceFound(createDevice("",
- 0,
- mockDevice.serviceName,
- mockDevice.serviceType));
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {}
- };
- },
- registerService: function(serviceInfo, listener) {},
- resolveService: function(serviceInfo, listener) {
- Assert.equal(serviceInfo.serviceName, mockDevice.serviceName);
- Assert.equal(serviceInfo.serviceType, mockDevice.serviceType);
- listener.onServiceResolved(createDevice(mockDevice.host,
- mockDevice.port,
- mockDevice.serviceName,
- mockDevice.serviceType));
- }
- };
-
- let contractHook = new ContractHook(SD_CONTRACT_ID, mockObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
- let listener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceListener,
- Ci.nsISupportsWeakReference]),
- addDevice: function(device) {
- let tests = [
- { requestedUrl: "app://fling-player.gaiamobile.org/index.html", supported: true },
- { requestedUrl: "app://notification-receiver.gaiamobile.org/index.html", supported: true },
- { requestedUrl: "http://example.com", supported: true },
- { requestedUrl: "https://example.com", supported: true },
- { requestedUrl: "ftp://example.com", supported: false },
- { requestedUrl: "app://unknown-app-id", supported: false },
- { requestedUrl: "unknowSchem://example.com", supported: false },
- ];
-
- for (let test of tests) {
- Assert.equal(device.isRequestedUrlSupported(test.requestedUrl), test.supported);
- }
-
- provider.listener = null;
- run_next_test();
- },
- updateDevice: function() {},
- removeDevice: function() {},
- onSessionRequest: function() {},
- };
-
- provider.listener = listener;
-}
-
-function handleSessionRequest() {
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
- Services.prefs.setBoolPref(PREF_DISCOVERABLE, false);
-
- const testUrl = "http://example.com";
- const testPresentationId = "test-presentation-id";
- const testDeviceName = "test-device-name";
-
- Services.prefs.setCharPref(PREF_DEVICENAME, testDeviceName);
-
- let mockDevice = createDevice("device.local",
- 12345,
- "service.name",
- SERVICE_TYPE);
- let mockSDObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {
- listener.onDiscoveryStarted(serviceType);
- listener.onServiceFound(createDevice("",
- 0,
- mockDevice.serviceName,
- mockDevice.serviceType));
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {}
- };
- },
- registerService: function(serviceInfo, listener) {},
- resolveService: function(serviceInfo, listener) {
- listener.onServiceResolved(createDevice(mockDevice.host,
- mockDevice.port,
- mockDevice.serviceName,
- mockDevice.serviceType));
- }
- };
-
- let mockServerObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlService]),
- connect: function(deviceInfo) {
- this.request = {
- deviceInfo: deviceInfo,
- };
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannel]),
- };
- },
- id: "",
- version: LATEST_VERSION,
- isCompatibleServer: function(version) {
- return this.version === version;
- }
- };
-
- let contractHookSD = new ContractHook(SD_CONTRACT_ID, mockSDObj);
- let contractHookServer = new ContractHook(SERVER_CONTRACT_ID, mockServerObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
- let listener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceListener,
- Ci.nsISupportsWeakReference]),
- addDevice: function(device) {
- this.device = device;
- },
- };
-
- provider.listener = listener;
-
- let controlChannel = listener.device.establishControlChannel();
-
- Assert.equal(mockServerObj.request.deviceInfo.id, mockDevice.host);
- Assert.equal(mockServerObj.request.deviceInfo.address, mockDevice.host);
- Assert.equal(mockServerObj.request.deviceInfo.port, mockDevice.port);
- Assert.equal(mockServerObj.id, testDeviceName);
-
- provider.listener = null;
-
- run_next_test();
-}
-
-function handleOnSessionRequest() {
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
- Services.prefs.setBoolPref(PREF_DISCOVERABLE, true);
-
- let mockDevice = createDevice("device.local",
- 12345,
- "service.name",
- SERVICE_TYPE);
- let mockSDObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {
- listener.onDiscoveryStarted(serviceType);
- listener.onServiceFound(createDevice("",
- 0,
- mockDevice.serviceName,
- mockDevice.serviceType));
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {}
- };
- },
- registerService: function(serviceInfo, listener) {},
- resolveService: function(serviceInfo, listener) {
- listener.onServiceResolved(createDevice(mockDevice.host,
- mockDevice.port,
- mockDevice.serviceName,
- mockDevice.serviceType));
- }
- };
-
- let mockServerObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlService]),
- startServer: function() {},
- sessionRequest: function() {},
- close: function() {},
- id: '',
- version: LATEST_VERSION,
- port: 0,
- listener: null,
- };
-
- let contractHookSD = new ContractHook(SD_CONTRACT_ID, mockSDObj);
- let contractHookServer = new ContractHook(SERVER_CONTRACT_ID, mockServerObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
- let listener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceListener,
- Ci.nsISupportsWeakReference]),
- addDevice: function(device) {},
- removeDevice: function(device) {},
- updateDevice: function(device) {},
- onSessionRequest: function(device, url, presentationId, controlChannel) {
- Assert.ok(true, "receive onSessionRequest event");
- this.request = {
- deviceId: device.id,
- url: url,
- presentationId: presentationId,
- };
- }
- };
-
- provider.listener = listener;
-
- const deviceInfo = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITCPDeviceInfo]),
- id: mockDevice.host,
- address: mockDevice.host,
- port: 54321,
- };
-
- const testUrl = "http://example.com";
- const testPresentationId = "test-presentation-id";
- const testControlChannel = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannel]),
- };
- provider.QueryInterface(Ci.nsIPresentationControlServerListener)
- .onSessionRequest(deviceInfo, testUrl, testPresentationId, testControlChannel);
-
- Assert.equal(listener.request.deviceId, deviceInfo.id);
- Assert.equal(listener.request.url, testUrl);
- Assert.equal(listener.request.presentationId, testPresentationId);
-
- provider.listener = null;
-
- run_next_test();
-}
-
-function handleOnSessionRequestFromUnknownDevice() {
- Services.prefs.setBoolPref(PREF_DISCOVERY, false);
- Services.prefs.setBoolPref(PREF_DISCOVERABLE, true);
-
- let mockSDObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {},
- registerService: function(serviceInfo, listener) {},
- resolveService: function(serviceInfo, listener) {}
- };
-
- let mockServerObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlService]),
- startServer: function() {},
- sessionRequest: function() {},
- close: function() {},
- id: '',
- version: LATEST_VERSION,
- port: 0,
- listener: null,
- };
-
- let contractHookSD = new ContractHook(SD_CONTRACT_ID, mockSDObj);
- let contractHookServer = new ContractHook(SERVER_CONTRACT_ID, mockServerObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
- let listener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceListener,
- Ci.nsISupportsWeakReference]),
- addDevice: function(device) {
- Assert.ok(false, "shouldn't create any new device");
- },
- removeDevice: function(device) {
- Assert.ok(false, "shouldn't remote any device");
- },
- updateDevice: function(device) {
- Assert.ok(false, "shouldn't update any device");
- },
- onSessionRequest: function(device, url, presentationId, controlChannel) {
- Assert.ok(true, "receive onSessionRequest event");
- this.request = {
- deviceId: device.id,
- url: url,
- presentationId: presentationId,
- };
- }
- };
-
- provider.listener = listener;
-
- const deviceInfo = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITCPDeviceInfo]),
- id: "unknown-device.local",
- address: "unknown-device.local",
- port: 12345,
- };
-
- const testUrl = "http://example.com";
- const testPresentationId = "test-presentation-id";
- const testControlChannel = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannel]),
- };
- provider.QueryInterface(Ci.nsIPresentationControlServerListener)
- .onSessionRequest(deviceInfo, testUrl, testPresentationId, testControlChannel);
-
- Assert.equal(listener.request.deviceId, deviceInfo.id);
- Assert.equal(listener.request.url, testUrl);
- Assert.equal(listener.request.presentationId, testPresentationId);
-
- provider.listener = null;
-
- run_next_test();
-}
-
-function noAddDevice() {
- Services.prefs.setBoolPref(PREF_DISCOVERY, false);
-
- let mockDevice = createDevice("device.local", 12345, "service.name", SERVICE_TYPE);
- let mockObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {
- Assert.ok(false, "shouldn't perform any device discovery");
- },
- registerService: function(serviceInfo, listener) {},
- resolveService: function(serviceInfo, listener) {
- }
- };
- let contractHook = new ContractHook(SD_CONTRACT_ID, mockObj);
-
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
- let listener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceListener,
- Ci.nsISupportsWeakReference]),
- addDevice: function(device) {},
- removeDevice: function(device) {},
- updateDevice: function(device) {},
- };
- provider.listener = listener;
- provider.forceDiscovery();
- provider.listener = null;
-
- run_next_test();
-}
-
-function ignoreIncompatibleDevice() {
- Services.prefs.setBoolPref(PREF_DISCOVERY, false);
- Services.prefs.setBoolPref(PREF_DISCOVERABLE, true);
-
- let mockDevice = createDevice("device.local",
- 12345,
- "service.name",
- SERVICE_TYPE);
-
- let deferred = Promise.defer();
-
- let mockSDObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {
- listener.onDiscoveryStarted(serviceType);
- listener.onServiceFound(createDevice("",
- 0,
- mockDevice.serviceName,
- mockDevice.serviceType));
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {}
- };
- },
- registerService: function(serviceInfo, listener) {
- deferred.resolve();
- listener.onServiceRegistered(createDevice("",
- 54321,
- mockDevice.serviceName,
- mockDevice.serviceType));
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {}
- };
- },
- resolveService: function(serviceInfo, listener) {
- Assert.equal(serviceInfo.serviceName, mockDevice.serviceName);
- Assert.equal(serviceInfo.serviceType, mockDevice.serviceType);
- listener.onServiceResolved(createDevice(mockDevice.host,
- mockDevice.port,
- mockDevice.serviceName,
- mockDevice.serviceType));
- }
- };
-
- let mockServerObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlService]),
- startServer: function() {
- Services.tm.currentThread.dispatch(() => {
- this.listener.onServerReady(this.port, this.certFingerprint);
- }, Ci.nsIThread.DISPATCH_NORMAL);
- },
- sessionRequest: function() {},
- close: function() {},
- id: '',
- version: LATEST_VERSION,
- isCompatibleServer: function(version) {
- return false;
- },
- port: 54321,
- certFingerprint: 'mock-cert-fingerprint',
- listener: null,
- };
-
- let contractHookSD = new ContractHook(SD_CONTRACT_ID, mockSDObj);
- let contractHookServer = new ContractHook(SERVER_CONTRACT_ID, mockServerObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
- let listener = new TestPresentationDeviceListener();
-
- // Register service
- provider.listener = listener;
-
- deferred.promise.then(function() {
- Assert.equal(mockServerObj.id, mockDevice.host);
-
- // Start discovery
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
- Assert.equal(listener.count(), 0);
-
- provider.listener = null;
-
- run_next_test();
- });
-}
-
-function ignoreSelfDevice() {
- Services.prefs.setBoolPref(PREF_DISCOVERY, false);
- Services.prefs.setBoolPref(PREF_DISCOVERABLE, true);
-
- let mockDevice = createDevice("device.local",
- 12345,
- "service.name",
- SERVICE_TYPE);
-
- let deferred = Promise.defer();
- let mockSDObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {
- listener.onDiscoveryStarted(serviceType);
- listener.onServiceFound(createDevice("",
- 0,
- mockDevice.serviceName,
- mockDevice.serviceType));
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {}
- };
- },
- registerService: function(serviceInfo, listener) {
- deferred.resolve();
- listener.onServiceRegistered(createDevice("",
- 0,
- mockDevice.serviceName,
- mockDevice.serviceType));
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {}
- };
- },
- resolveService: function(serviceInfo, listener) {
- Assert.equal(serviceInfo.serviceName, mockDevice.serviceName);
- Assert.equal(serviceInfo.serviceType, mockDevice.serviceType);
- listener.onServiceResolved(createDevice(mockDevice.host,
- mockDevice.port,
- mockDevice.serviceName,
- mockDevice.serviceType));
- }
- };
-
- let mockServerObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlService]),
- startServer: function() {
- Services.tm.currentThread.dispatch(() => {
- this.listener.onServerReady(this.port, this.certFingerprint);
- }, Ci.nsIThread.DISPATCH_NORMAL);
- },
- sessionRequest: function() {},
- close: function() {},
- id: '',
- version: LATEST_VERSION,
- isCompatibleServer: function(version) {
- return this.version === version;
- },
- port: 54321,
- certFingerprint: 'mock-cert-fingerprint',
- listener: null,
- };
-
- let contractHookSD = new ContractHook(SD_CONTRACT_ID, mockSDObj);
- let contractHookServer = new ContractHook(SERVER_CONTRACT_ID, mockServerObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
- let listener = new TestPresentationDeviceListener();
-
- // Register service
- provider.listener = listener;
- deferred.promise.then(() => {
- Assert.equal(mockServerObj.id, mockDevice.host);
-
- // Start discovery
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
- Assert.equal(listener.count(), 0);
-
- provider.listener = null;
-
- run_next_test();
- });
-}
-
-function addDeviceDynamically() {
- Services.prefs.setBoolPref(PREF_DISCOVERY, false);
-
- let mockDevice = createDevice("device.local",
- 12345,
- "service.name",
- SERVICE_TYPE);
- let mockObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {
- listener.onDiscoveryStarted(serviceType);
- listener.onServiceFound(createDevice("",
- 0,
- mockDevice.serviceName,
- mockDevice.serviceType));
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {}
- };
- },
- registerService: function(serviceInfo, listener) {},
- resolveService: function(serviceInfo, listener) {
- Assert.equal(serviceInfo.serviceName, mockDevice.serviceName);
- Assert.equal(serviceInfo.serviceType, mockDevice.serviceType);
- listener.onServiceResolved(createDevice(mockDevice.host,
- mockDevice.port,
- mockDevice.serviceName,
- mockDevice.serviceType));
- }
- };
-
- let contractHook = new ContractHook(SD_CONTRACT_ID, mockObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
- let listener = new TestPresentationDeviceListener();
- provider.listener = listener;
- Assert.equal(listener.count(), 0);
-
- // Enable discovery
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
- Assert.equal(listener.count(), 1);
-
- // Try discovery again
- provider.forceDiscovery();
- Assert.equal(listener.count(), 1);
-
- // Try discovery once more
- Services.prefs.setBoolPref(PREF_DISCOVERY, false);
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
- provider.forceDiscovery();
- Assert.equal(listener.count(), 1);
-
- provider.listener = null;
-
- run_next_test();
-}
-
-function updateDevice() {
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
-
- let mockDevice1 = createDevice("A.local", 12345, "N1", SERVICE_TYPE);
- let mockDevice2 = createDevice("A.local", 23456, "N2", SERVICE_TYPE);
-
- let mockObj = {
- discovered: false,
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {
- listener.onDiscoveryStarted(serviceType);
-
- if (!this.discovered) {
- listener.onServiceFound(mockDevice1);
- } else {
- listener.onServiceFound(mockDevice2);
- }
- this.discovered = true;
-
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {
- listener.onDiscoveryStopped(serviceType);
- }
- };
- },
- registerService: function(serviceInfo, listener) {},
- resolveService: function(serviceInfo, listener) {
- Assert.equal(serviceInfo.serviceType, SERVICE_TYPE);
- if (serviceInfo.serviceName == "N1") {
- listener.onServiceResolved(mockDevice1);
- } else if (serviceInfo.serviceName == "N2") {
- listener.onServiceResolved(mockDevice2);
- } else {
- Assert.ok(false);
- }
- }
- };
-
- let contractHook = new ContractHook(SD_CONTRACT_ID, mockObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
- let listener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceListener,
- Ci.nsISupportsWeakReference]),
-
- addDevice: function(device) {
- Assert.ok(!this.isDeviceAdded);
- Assert.equal(device.id, mockDevice1.host);
- Assert.equal(device.name, mockDevice1.serviceName);
- this.isDeviceAdded = true;
- },
- removeDevice: function(device) { Assert.ok(false); },
- updateDevice: function(device) {
- Assert.ok(!this.isDeviceUpdated);
- Assert.equal(device.id, mockDevice2.host);
- Assert.equal(device.name, mockDevice2.serviceName);
- this.isDeviceUpdated = true;
- },
-
- isDeviceAdded: false,
- isDeviceUpdated: false
- };
- Assert.equal(listener.isDeviceAdded, false);
- Assert.equal(listener.isDeviceUpdated, false);
-
- // Start discovery
- provider.listener = listener; // discover: N1
-
- Assert.equal(listener.isDeviceAdded, true);
- Assert.equal(listener.isDeviceUpdated, false);
-
- // temporarily disable to stop discovery and re-enable
- Services.prefs.setBoolPref(PREF_DISCOVERY, false);
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
-
- provider.forceDiscovery(); // discover: N2
-
- Assert.equal(listener.isDeviceAdded, true);
- Assert.equal(listener.isDeviceUpdated, true);
-
- provider.listener = null;
-
- run_next_test();
-}
-
-function diffDiscovery() {
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
-
- let mockDevice1 = createDevice("A.local", 12345, "N1", SERVICE_TYPE);
- let mockDevice2 = createDevice("B.local", 23456, "N2", SERVICE_TYPE);
- let mockDevice3 = createDevice("C.local", 45678, "N3", SERVICE_TYPE);
-
- let mockObj = {
- discovered: false,
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {
- listener.onDiscoveryStarted(serviceType);
-
- if (!this.discovered) {
- listener.onServiceFound(mockDevice1);
- listener.onServiceFound(mockDevice2);
- } else {
- listener.onServiceFound(mockDevice1);
- listener.onServiceFound(mockDevice3);
- }
- this.discovered = true;
-
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {
- listener.onDiscoveryStopped(serviceType);
- }
- };
- },
- registerService: function(serviceInfo, listener) {},
- resolveService: function(serviceInfo, listener) {
- Assert.equal(serviceInfo.serviceType, SERVICE_TYPE);
- if (serviceInfo.serviceName == "N1") {
- listener.onServiceResolved(mockDevice1);
- } else if (serviceInfo.serviceName == "N2") {
- listener.onServiceResolved(mockDevice2);
- } else if (serviceInfo.serviceName == "N3") {
- listener.onServiceResolved(mockDevice3);
- } else {
- Assert.ok(false);
- }
- }
- };
-
- let contractHook = new ContractHook(SD_CONTRACT_ID, mockObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
- let listener = new TestPresentationDeviceListener();
- Assert.equal(listener.count(), 0);
-
- // Start discovery
- provider.listener = listener; // discover: N1, N2
- Assert.equal(listener.count(), 2);
- Assert.equal(listener.devices['A.local'].name, mockDevice1.serviceName);
- Assert.equal(listener.devices['B.local'].name, mockDevice2.serviceName);
- Assert.ok(!listener.devices['C.local']);
-
- // temporarily disable to stop discovery and re-enable
- Services.prefs.setBoolPref(PREF_DISCOVERY, false);
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
-
- provider.forceDiscovery(); // discover: N1, N3, going to remove: N2
- Assert.equal(listener.count(), 3);
- Assert.equal(listener.devices['A.local'].name, mockDevice1.serviceName);
- Assert.equal(listener.devices['B.local'].name, mockDevice2.serviceName);
- Assert.equal(listener.devices['C.local'].name, mockDevice3.serviceName);
-
- // temporarily disable to stop discovery and re-enable
- Services.prefs.setBoolPref(PREF_DISCOVERY, false);
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
-
- provider.forceDiscovery(); // discover: N1, N3, remove: N2
- Assert.equal(listener.count(), 2);
- Assert.equal(listener.devices['A.local'].name, mockDevice1.serviceName);
- Assert.ok(!listener.devices['B.local']);
- Assert.equal(listener.devices['C.local'].name, mockDevice3.serviceName);
-
- provider.listener = null;
-
- run_next_test();
-}
-
-function serverClosed() {
- Services.prefs.setBoolPref(PREF_DISCOVERABLE, true);
- Services.prefs.setBoolPref(PREF_DISCOVERY, true);
-
- let mockDevice = createDevice("device.local",
- 12345,
- "service.name",
- SERVICE_TYPE);
-
- let mockObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {
- listener.onDiscoveryStarted(serviceType);
- listener.onServiceFound(createDevice("",
- 0,
- mockDevice.serviceName,
- mockDevice.serviceType));
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {}
- };
- },
- registerService: function(serviceInfo, listener) {
- this.serviceRegistered++;
- return {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICancelable]),
- cancel: function() {
- this.serviceUnregistered++;
- }.bind(this)
- };
- },
- resolveService: function(serviceInfo, listener) {
- Assert.equal(serviceInfo.serviceName, mockDevice.serviceName);
- Assert.equal(serviceInfo.serviceType, mockDevice.serviceType);
- listener.onServiceResolved(createDevice(mockDevice.host,
- mockDevice.port,
- mockDevice.serviceName,
- mockDevice.serviceType));
- },
- serviceRegistered: 0,
- serviceUnregistered: 0
- };
- let contractHook = new ContractHook(SD_CONTRACT_ID, mockObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
-
- Assert.equal(mockObj.serviceRegistered, 0);
- Assert.equal(mockObj.serviceUnregistered, 0);
-
- // Register
- let listener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceListener,
- Ci.nsISupportsWeakReference]),
- addDevice: function(device) { this.devices.push(device); },
- removeDevice: function(device) {},
- updateDevice: function(device) {},
- devices: []
- };
- Assert.equal(listener.devices.length, 0);
-
- provider.listener = listener;
- Assert.equal(mockObj.serviceRegistered, 1);
- Assert.equal(mockObj.serviceUnregistered, 0);
- Assert.equal(listener.devices.length, 1);
-
- let serverListener = provider.QueryInterface(Ci.nsIPresentationControlServerListener);
- let randomPort = 9527;
- serverListener.onServerReady(randomPort, '');
-
- Assert.equal(mockObj.serviceRegistered, 2);
- Assert.equal(mockObj.serviceUnregistered, 1);
- Assert.equal(listener.devices.length, 1);
-
- // Unregister
- provider.listener = null;
- Assert.equal(mockObj.serviceRegistered, 2);
- Assert.equal(mockObj.serviceUnregistered, 2);
- Assert.equal(listener.devices.length, 1);
-
- run_next_test();
-}
-
-function serverRetry() {
- Services.prefs.setBoolPref(PREF_DISCOVERY, false);
- Services.prefs.setBoolPref(PREF_DISCOVERABLE, true);
-
- let isRetrying = false;
-
- let mockSDObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDNSServiceDiscovery]),
- startDiscovery: function(serviceType, listener) {},
- registerService: function(serviceInfo, listener) {
- Assert.ok(isRetrying, "register service after retrying startServer");
- provider.listener = null;
- run_next_test();
- },
- resolveService: function(serviceInfo, listener) {}
- };
-
- let mockServerObj = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlService]),
- startServer: function(encrypted, port) {
- if (!isRetrying) {
- isRetrying = true;
- Services.tm.currentThread.dispatch(() => {
- this.listener.onServerStopped(Cr.NS_ERROR_FAILURE);
- }, Ci.nsIThread.DISPATCH_NORMAL);
- } else {
- this.port = 54321;
- Services.tm.currentThread.dispatch(() => {
- this.listener.onServerReady(this.port, this.certFingerprint);
- }, Ci.nsIThread.DISPATCH_NORMAL);
- }
- },
- sessionRequest: function() {},
- close: function() {},
- id: '',
- version: LATEST_VERSION,
- port: 0,
- certFingerprint: 'mock-cert-fingerprint',
- listener: null,
- };
-
- let contractHookSD = new ContractHook(SD_CONTRACT_ID, mockSDObj);
- let contractHookServer = new ContractHook(SERVER_CONTRACT_ID, mockServerObj);
- let provider = Cc[PROVIDER_CONTRACT_ID].createInstance(Ci.nsIPresentationDeviceProvider);
- let listener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceListener,
- Ci.nsISupportsWeakReference]),
- addDevice: function(device) {},
- removeDevice: function(device) {},
- updateDevice: function(device) {},
- onSessionRequest: function(device, url, presentationId, controlChannel) {}
- };
-
- provider.listener = listener;
-}
-
-function run_test() {
- // Need profile dir to store the key / cert
- do_get_profile();
- // Ensure PSM is initialized
- Cc["@mozilla.org/psm;1"].getService(Ci.nsISupports);
-
- let infoHook = new ContractHook(INFO_CONTRACT_ID, MockDNSServiceInfo);
-
- do_register_cleanup(() => {
- Services.prefs.clearUserPref(PREF_DISCOVERY);
- Services.prefs.clearUserPref(PREF_DISCOVERABLE);
- });
-
- add_test(registerService);
- add_test(noRegisterService);
- add_test(registerServiceDynamically);
- add_test(addDevice);
- add_test(filterDevice);
- add_test(handleSessionRequest);
- add_test(handleOnSessionRequest);
- add_test(handleOnSessionRequestFromUnknownDevice);
- add_test(noAddDevice);
- add_test(ignoreIncompatibleDevice);
- add_test(ignoreSelfDevice);
- add_test(addDeviceDynamically);
- add_test(updateDevice);
- add_test(diffDiscovery);
- add_test(serverClosed);
- add_test(serverRetry);
-
- run_next_test();
-}
diff --git a/dom/presentation/tests/xpcshell/test_presentation_device_manager.js b/dom/presentation/tests/xpcshell/test_presentation_device_manager.js
deleted file mode 100644
index 68f07df65..000000000
--- a/dom/presentation/tests/xpcshell/test_presentation_device_manager.js
+++ /dev/null
@@ -1,244 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-'use strict';
-
-const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
-
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/Services.jsm');
-
-const manager = Cc['@mozilla.org/presentation-device/manager;1']
- .getService(Ci.nsIPresentationDeviceManager);
-
-function TestPresentationDevice() {}
-
-
-function TestPresentationControlChannel() {}
-
-TestPresentationControlChannel.prototype = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannel]),
- sendOffer: function(offer) {},
- sendAnswer: function(answer) {},
- disconnect: function() {},
- launch: function() {},
- terminate: function() {},
- reconnect: function() {},
- set listener(listener) {},
- get listener() {},
-};
-
-var testProvider = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDeviceProvider]),
-
- forceDiscovery: function() {
- },
- set listener(listener) {
- },
- get listener() {
- },
-};
-
-const forbiddenRequestedUrl = 'http://example.com';
-var testDevice = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationDevice]),
- id: 'id',
- name: 'name',
- type: 'type',
- establishControlChannel: function(url, presentationId) {
- return null;
- },
- disconnect: function() {},
- isRequestedUrlSupported: function(requestedUrl) {
- return forbiddenRequestedUrl !== requestedUrl;
- },
-};
-
-function addProvider() {
- Object.defineProperty(testProvider, 'listener', {
- configurable: true,
- set: function(listener) {
- Assert.strictEqual(listener, manager, 'listener setter is invoked by PresentationDeviceManager');
- delete testProvider.listener;
- run_next_test();
- },
- });
- manager.addDeviceProvider(testProvider);
-}
-
-function forceDiscovery() {
- testProvider.forceDiscovery = function() {
- testProvider.forceDiscovery = function() {};
- Assert.ok(true, 'forceDiscovery is invoked by PresentationDeviceManager');
- run_next_test();
- };
- manager.forceDiscovery();
-}
-
-function addDevice() {
- Services.obs.addObserver(function observer(subject, topic, data) {
- Services.obs.removeObserver(observer, topic);
-
- let updatedDevice = subject.QueryInterface(Ci.nsIPresentationDevice);
- Assert.equal(updatedDevice.id, testDevice.id, 'expected device id');
- Assert.equal(updatedDevice.name, testDevice.name, 'expected device name');
- Assert.equal(updatedDevice.type, testDevice.type, 'expected device type');
- Assert.equal(data, 'add', 'expected update type');
-
- Assert.ok(manager.deviceAvailable, 'device is available');
-
- let devices = manager.getAvailableDevices();
- Assert.equal(devices.length, 1, 'expect 1 available device');
-
- let device = devices.queryElementAt(0, Ci.nsIPresentationDevice);
- Assert.equal(device.id, testDevice.id, 'expected device id');
- Assert.equal(device.name, testDevice.name, 'expected device name');
- Assert.equal(device.type, testDevice.type, 'expected device type');
-
- run_next_test();
- }, 'presentation-device-change', false);
- manager.QueryInterface(Ci.nsIPresentationDeviceListener).addDevice(testDevice);
-}
-
-function updateDevice() {
- Services.obs.addObserver(function observer(subject, topic, data) {
- Services.obs.removeObserver(observer, topic);
-
- let updatedDevice = subject.QueryInterface(Ci.nsIPresentationDevice);
- Assert.equal(updatedDevice.id, testDevice.id, 'expected device id');
- Assert.equal(updatedDevice.name, testDevice.name, 'expected device name');
- Assert.equal(updatedDevice.type, testDevice.type, 'expected device type');
- Assert.equal(data, 'update', 'expected update type');
-
- Assert.ok(manager.deviceAvailable, 'device is available');
-
- let devices = manager.getAvailableDevices();
- Assert.equal(devices.length, 1, 'expect 1 available device');
-
- let device = devices.queryElementAt(0, Ci.nsIPresentationDevice);
- Assert.equal(device.id, testDevice.id, 'expected device id');
- Assert.equal(device.name, testDevice.name, 'expected name after device update');
- Assert.equal(device.type, testDevice.type, 'expected device type');
-
- run_next_test();
- }, 'presentation-device-change', false);
- testDevice.name = 'updated-name';
- manager.QueryInterface(Ci.nsIPresentationDeviceListener).updateDevice(testDevice);
-}
-
-function filterDevice() {
- let presentationUrls = Cc['@mozilla.org/array;1'].createInstance(Ci.nsIMutableArray);
- let url = Cc['@mozilla.org/supports-string;1'].createInstance(Ci.nsISupportsString);
- url.data = forbiddenRequestedUrl;
- presentationUrls.appendElement(url, false);
- let devices = manager.getAvailableDevices(presentationUrls);
- Assert.equal(devices.length, 0, 'expect 0 available device for example.com');
- run_next_test();
-}
-
-function sessionRequest() {
- let testUrl = 'http://www.example.org/';
- let testPresentationId = 'test-presentation-id';
- let testControlChannel = new TestPresentationControlChannel();
- Services.obs.addObserver(function observer(subject, topic, data) {
- Services.obs.removeObserver(observer, topic);
-
- let request = subject.QueryInterface(Ci.nsIPresentationSessionRequest);
-
- Assert.equal(request.device.id, testDevice.id, 'expected device');
- Assert.equal(request.url, testUrl, 'expected requesting URL');
- Assert.equal(request.presentationId, testPresentationId, 'expected presentation Id');
-
- run_next_test();
- }, 'presentation-session-request', false);
- manager.QueryInterface(Ci.nsIPresentationDeviceListener)
- .onSessionRequest(testDevice, testUrl, testPresentationId, testControlChannel);
-}
-
-function terminateRequest() {
- let testUrl = 'http://www.example.org/';
- let testPresentationId = 'test-presentation-id';
- let testControlChannel = new TestPresentationControlChannel();
- let testIsFromReceiver = true;
- Services.obs.addObserver(function observer(subject, topic, data) {
- Services.obs.removeObserver(observer, topic);
-
- let request = subject.QueryInterface(Ci.nsIPresentationTerminateRequest);
-
- Assert.equal(request.device.id, testDevice.id, 'expected device');
- Assert.equal(request.presentationId, testPresentationId, 'expected presentation Id');
- Assert.equal(request.isFromReceiver, testIsFromReceiver, 'expected isFromReceiver');
-
- run_next_test();
- }, 'presentation-terminate-request', false);
- manager.QueryInterface(Ci.nsIPresentationDeviceListener)
- .onTerminateRequest(testDevice, testPresentationId,
- testControlChannel, testIsFromReceiver);
-}
-
-function reconnectRequest() {
- let testUrl = 'http://www.example.org/';
- let testPresentationId = 'test-presentation-id';
- let testControlChannel = new TestPresentationControlChannel();
- Services.obs.addObserver(function observer(subject, topic, data) {
- Services.obs.removeObserver(observer, topic);
-
- let request = subject.QueryInterface(Ci.nsIPresentationSessionRequest);
-
- Assert.equal(request.device.id, testDevice.id, 'expected device');
- Assert.equal(request.url, testUrl, 'expected requesting URL');
- Assert.equal(request.presentationId, testPresentationId, 'expected presentation Id');
-
- run_next_test();
- }, 'presentation-reconnect-request', false);
- manager.QueryInterface(Ci.nsIPresentationDeviceListener)
- .onReconnectRequest(testDevice, testUrl, testPresentationId, testControlChannel);
-}
-
-function removeDevice() {
- Services.obs.addObserver(function observer(subject, topic, data) {
- Services.obs.removeObserver(observer, topic);
-
- let updatedDevice = subject.QueryInterface(Ci.nsIPresentationDevice);
- Assert.equal(updatedDevice.id, testDevice.id, 'expected device id');
- Assert.equal(updatedDevice.name, testDevice.name, 'expected device name');
- Assert.equal(updatedDevice.type, testDevice.type, 'expected device type');
- Assert.equal(data, 'remove', 'expected update type');
-
- Assert.ok(!manager.deviceAvailable, 'device is not available');
-
- let devices = manager.getAvailableDevices();
- Assert.equal(devices.length, 0, 'expect 0 available device');
-
- run_next_test();
- }, 'presentation-device-change', false);
- manager.QueryInterface(Ci.nsIPresentationDeviceListener).removeDevice(testDevice);
-}
-
-function removeProvider() {
- Object.defineProperty(testProvider, 'listener', {
- configurable: true,
- set: function(listener) {
- Assert.strictEqual(listener, null, 'unsetListener is invoked by PresentationDeviceManager');
- delete testProvider.listener;
- run_next_test();
- },
- });
- manager.removeDeviceProvider(testProvider);
-}
-
-add_test(addProvider);
-add_test(forceDiscovery);
-add_test(addDevice);
-add_test(updateDevice);
-add_test(filterDevice);
-add_test(sessionRequest);
-add_test(terminateRequest);
-add_test(reconnectRequest);
-add_test(removeDevice);
-add_test(removeProvider);
-
-function run_test() {
- run_next_test();
-}
diff --git a/dom/presentation/tests/xpcshell/test_presentation_session_transport.js b/dom/presentation/tests/xpcshell/test_presentation_session_transport.js
deleted file mode 100644
index 8e207bc22..000000000
--- a/dom/presentation/tests/xpcshell/test_presentation_session_transport.js
+++ /dev/null
@@ -1,198 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-'use strict';
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr, Constructor: CC } = Components;
-const ServerSocket = CC("@mozilla.org/network/server-socket;1",
- "nsIServerSocket",
- "init");
-
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/Services.jsm');
-
-var testServer = null;
-var clientTransport = null;
-var serverTransport = null;
-
-var clientBuilder = null;
-var serverBuilder = null;
-
-const clientMessage = "Client Message";
-const serverMessage = "Server Message";
-
-const address = Cc["@mozilla.org/supports-cstring;1"]
- .createInstance(Ci.nsISupportsCString);
-address.data = "127.0.0.1";
-const addresses = Cc["@mozilla.org/array;1"].createInstance(Ci.nsIMutableArray);
-addresses.appendElement(address, false);
-
-const serverChannelDescription = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationChannelDescription]),
- type: 1,
- tcpAddress: addresses,
-};
-
-var isClientReady = false;
-var isServerReady = false;
-var isClientClosed = false;
-var isServerClosed = false;
-
-const clientCallback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationSessionTransportCallback]),
- notifyTransportReady: function () {
- Assert.ok(true, "Client transport ready.");
-
- isClientReady = true;
- if (isClientReady && isServerReady) {
- run_next_test();
- }
- },
- notifyTransportClosed: function (aReason) {
- Assert.ok(true, "Client transport is closed.");
-
- isClientClosed = true;
- if (isClientClosed && isServerClosed) {
- run_next_test();
- }
- },
- notifyData: function(aData) {
- Assert.equal(aData, serverMessage, "Client transport receives data.");
- run_next_test();
- },
-};
-
-const serverCallback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationSessionTransportCallback]),
- notifyTransportReady: function () {
- Assert.ok(true, "Server transport ready.");
-
- isServerReady = true;
- if (isClientReady && isServerReady) {
- run_next_test();
- }
- },
- notifyTransportClosed: function (aReason) {
- Assert.ok(true, "Server transport is closed.");
-
- isServerClosed = true;
- if (isClientClosed && isServerClosed) {
- run_next_test();
- }
- },
- notifyData: function(aData) {
- Assert.equal(aData, clientMessage, "Server transport receives data.");
- run_next_test();
- },
-};
-
-const clientListener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationSessionTransportBuilderListener]),
- onSessionTransport(aTransport) {
- Assert.ok(true, "Client Transport is built.");
- clientTransport = aTransport;
- clientTransport.callback = clientCallback;
-
- if (serverTransport) {
- run_next_test();
- }
- }
-}
-
-const serverListener = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationSessionTransportBuilderListener]),
- onSessionTransport(aTransport) {
- Assert.ok(true, "Server Transport is built.");
- serverTransport = aTransport;
- serverTransport.callback = serverCallback;
- serverTransport.enableDataNotification();
-
- if (clientTransport) {
- run_next_test();
- }
- }
-}
-
-function TestServer() {
- this.serverSocket = ServerSocket(-1, true, -1);
- this.serverSocket.asyncListen(this)
-}
-
-TestServer.prototype = {
- onSocketAccepted: function(aSocket, aTransport) {
- print("Test server gets a client connection.");
- serverBuilder = Cc["@mozilla.org/presentation/presentationtcpsessiontransport;1"]
- .createInstance(Ci.nsIPresentationTCPSessionTransportBuilder);
- serverBuilder.buildTCPSenderTransport(aTransport, serverListener);
- },
- onStopListening: function(aSocket) {
- print("Test server stops listening.");
- },
- close: function() {
- if (this.serverSocket) {
- this.serverSocket.close();
- this.serverSocket = null;
- }
- }
-};
-
-// Set up the transport connection and ensure |notifyTransportReady| triggered
-// at both sides.
-function setup() {
- clientBuilder = Cc["@mozilla.org/presentation/presentationtcpsessiontransport;1"]
- .createInstance(Ci.nsIPresentationTCPSessionTransportBuilder);
- clientBuilder.buildTCPReceiverTransport(serverChannelDescription, clientListener);
-}
-
-// Test |selfAddress| attribute of |nsIPresentationSessionTransport|.
-function selfAddress() {
- var serverSelfAddress = serverTransport.selfAddress;
- Assert.equal(serverSelfAddress.address, address.data, "The self address of server transport should be set.");
- Assert.equal(serverSelfAddress.port, testServer.serverSocket.port, "The port of server transport should be set.");
-
- var clientSelfAddress = clientTransport.selfAddress;
- Assert.ok(clientSelfAddress.address, "The self address of client transport should be set.");
- Assert.ok(clientSelfAddress.port, "The port of client transport should be set.");
-
- run_next_test();
-}
-
-// Test the client sends a message and then a corresponding notification gets
-// triggered at the server side.
-function clientSendMessage() {
- clientTransport.send(clientMessage);
-}
-
-// Test the server sends a message an then a corresponding notification gets
-// triggered at the client side.
-function serverSendMessage() {
- serverTransport.send(serverMessage);
- // The client enables data notification even after the incoming message has
- // been sent, and should still be able to consume it.
- clientTransport.enableDataNotification();
-}
-
-function transportClose() {
- clientTransport.close(Cr.NS_OK);
-}
-
-function shutdown() {
- testServer.close();
- run_next_test();
-}
-
-add_test(setup);
-add_test(selfAddress);
-add_test(clientSendMessage);
-add_test(serverSendMessage);
-add_test(transportClose);
-add_test(shutdown);
-
-function run_test() {
- testServer = new TestServer();
- // Get the port of the test server.
- serverChannelDescription.tcpPort = testServer.serverSocket.port;
-
- run_next_test();
-}
diff --git a/dom/presentation/tests/xpcshell/test_presentation_state_machine.js b/dom/presentation/tests/xpcshell/test_presentation_state_machine.js
deleted file mode 100644
index fcaf34da6..000000000
--- a/dom/presentation/tests/xpcshell/test_presentation_state_machine.js
+++ /dev/null
@@ -1,236 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-/* jshint esnext:true, globalstrict:true, moz:true, undef:true, unused:true */
-/* globals Components,Assert,run_next_test,add_test,do_execute_soon */
-
-'use strict';
-
-const { utils: Cu, results: Cr } = Components;
-
-/* globals ControllerStateMachine */
-Cu.import('resource://gre/modules/presentation/ControllerStateMachine.jsm');
-/* globals ReceiverStateMachine */
-Cu.import('resource://gre/modules/presentation/ReceiverStateMachine.jsm');
-/* globals State */
-Cu.import('resource://gre/modules/presentation/StateMachineHelper.jsm');
-
-const testControllerId = 'test-controller-id';
-const testPresentationId = 'test-presentation-id';
-const testUrl = 'http://example.org';
-
-let mockControllerChannel = {};
-let mockReceiverChannel = {};
-
-let controllerState = new ControllerStateMachine(mockControllerChannel, testControllerId);
-let receiverState = new ReceiverStateMachine(mockReceiverChannel);
-
-mockControllerChannel.sendCommand = function(command) {
- do_execute_soon(function() {
- receiverState.onCommand(command);
- });
-};
-
-mockReceiverChannel.sendCommand = function(command) {
- do_execute_soon(function() {
- controllerState.onCommand(command);
- });
-};
-
-function connect() {
- Assert.equal(controllerState.state, State.INIT, 'controller in init state');
- Assert.equal(receiverState.state, State.INIT, 'receiver in init state');
- // step 1: underlying connection is ready
- controllerState.onChannelReady();
- Assert.equal(controllerState.state, State.CONNECTING, 'controller in connecting state');
- receiverState.onChannelReady();
- Assert.equal(receiverState.state, State.CONNECTING, 'receiver in connecting state');
-
- // step 2: receiver reply to connect command
- mockReceiverChannel.notifyDeviceConnected = function(deviceId) {
- Assert.equal(deviceId, testControllerId, 'receiver connect to mock controller');
- Assert.equal(receiverState.state, State.CONNECTED, 'receiver in connected state');
-
- // step 3: controller receive connect-ack command
- mockControllerChannel.notifyDeviceConnected = function() {
- Assert.equal(controllerState.state, State.CONNECTED, 'controller in connected state');
- run_next_test();
- };
- };
-}
-
-function launch() {
- Assert.equal(controllerState.state, State.CONNECTED, 'controller in connected state');
- Assert.equal(receiverState.state, State.CONNECTED, 'receiver in connected state');
-
- controllerState.launch(testPresentationId, testUrl);
- mockReceiverChannel.notifyLaunch = function(presentationId, url) {
- Assert.equal(receiverState.state, State.CONNECTED, 'receiver in connected state');
- Assert.equal(presentationId, testPresentationId, 'expected presentationId received');
- Assert.equal(url, testUrl, 'expected url received');
-
- mockControllerChannel.notifyLaunch = function(presentationId) {
- Assert.equal(controllerState.state, State.CONNECTED, 'controller in connected state');
- Assert.equal(presentationId, testPresentationId, 'expected presentationId received from ack');
-
- run_next_test();
- };
- };
-}
-
-function terminateByController() {
- Assert.equal(controllerState.state, State.CONNECTED, 'controller in connected state');
- Assert.equal(receiverState.state, State.CONNECTED, 'receiver in connected state');
-
- controllerState.terminate(testPresentationId);
- mockReceiverChannel.notifyTerminate = function(presentationId) {
- Assert.equal(receiverState.state, State.CONNECTED, 'receiver in connected state');
- Assert.equal(presentationId, testPresentationId, 'expected presentationId received');
-
- mockControllerChannel.notifyTerminate = function(presentationId) {
- Assert.equal(controllerState.state, State.CONNECTED, 'controller in connected state');
- Assert.equal(presentationId, testPresentationId, 'expected presentationId received from ack');
-
- run_next_test();
- };
-
- receiverState.terminateAck(presentationId);
- };
-}
-
-function terminateByReceiver() {
- Assert.equal(controllerState.state, State.CONNECTED, 'controller in connected state');
- Assert.equal(receiverState.state, State.CONNECTED, 'receiver in connected state');
-
- receiverState.terminate(testPresentationId);
- mockControllerChannel.notifyTerminate = function(presentationId) {
- Assert.equal(controllerState.state, State.CONNECTED, 'controller in connected state');
- Assert.equal(presentationId, testPresentationId, 'expected presentationId received');
-
- mockReceiverChannel.notifyTerminate = function(presentationId) {
- Assert.equal(receiverState.state, State.CONNECTED, 'receiver in connected state');
- Assert.equal(presentationId, testPresentationId, 'expected presentationId received from ack');
- run_next_test();
- };
-
- controllerState.terminateAck(presentationId);
- };
-}
-
-function exchangeSDP() {
- Assert.equal(controllerState.state, State.CONNECTED, 'controller in connected state');
- Assert.equal(receiverState.state, State.CONNECTED, 'receiver in connected state');
-
- const testOffer = 'test-offer';
- const testAnswer = 'test-answer';
- const testIceCandidate = 'test-ice-candidate';
- controllerState.sendOffer(testOffer);
- mockReceiverChannel.notifyOffer = function(offer) {
- Assert.equal(offer, testOffer, 'expected offer received');
-
- receiverState.sendAnswer(testAnswer);
- mockControllerChannel.notifyAnswer = function(answer) {
- Assert.equal(answer, testAnswer, 'expected answer received');
-
- controllerState.updateIceCandidate(testIceCandidate);
- mockReceiverChannel.notifyIceCandidate = function(candidate) {
- Assert.equal(candidate, testIceCandidate, 'expected ice candidate received in receiver');
-
- receiverState.updateIceCandidate(testIceCandidate);
- mockControllerChannel.notifyIceCandidate = function(candidate) {
- Assert.equal(candidate, testIceCandidate, 'expected ice candidate received in controller');
-
- run_next_test();
- };
- };
- };
- };
-}
-
-function disconnect() {
- // step 1: controller send disconnect command
- controllerState.onChannelClosed(Cr.NS_OK, false);
- Assert.equal(controllerState.state, State.CLOSING, 'controller in closing state');
-
- mockReceiverChannel.notifyDisconnected = function(reason) {
- Assert.equal(reason, Cr.NS_OK, 'receive close reason');
- Assert.equal(receiverState.state, State.CLOSED, 'receiver in closed state');
-
- receiverState.onChannelClosed(Cr.NS_OK, true);
- Assert.equal(receiverState.state, State.CLOSED, 'receiver in closed state');
-
- mockControllerChannel.notifyDisconnected = function(reason) {
- Assert.equal(reason, Cr.NS_OK, 'receive close reason');
- Assert.equal(controllerState.state, State.CLOSED, 'controller in closed state');
-
- run_next_test();
- };
- controllerState.onChannelClosed(Cr.NS_OK, true);
- };
-}
-
-function receiverDisconnect() {
- // initial state: controller and receiver are connected
- controllerState.state = State.CONNECTED;
- receiverState.state = State.CONNECTED;
-
- // step 1: controller send disconnect command
- receiverState.onChannelClosed(Cr.NS_OK, false);
- Assert.equal(receiverState.state, State.CLOSING, 'receiver in closing state');
-
- mockControllerChannel.notifyDisconnected = function(reason) {
- Assert.equal(reason, Cr.NS_OK, 'receive close reason');
- Assert.equal(controllerState.state, State.CLOSED, 'controller in closed state');
-
- controllerState.onChannelClosed(Cr.NS_OK, true);
- Assert.equal(controllerState.state, State.CLOSED, 'controller in closed state');
-
- mockReceiverChannel.notifyDisconnected = function(reason) {
- Assert.equal(reason, Cr.NS_OK, 'receive close reason');
- Assert.equal(receiverState.state, State.CLOSED, 'receiver in closed state');
-
- run_next_test();
- };
- receiverState.onChannelClosed(Cr.NS_OK, true);
- };
-}
-
-function abnormalDisconnect() {
- // initial state: controller and receiver are connected
- controllerState.state = State.CONNECTED;
- receiverState.state = State.CONNECTED;
-
- const testErrorReason = Cr.NS_ERROR_FAILURE;
- // step 1: controller send disconnect command
- controllerState.onChannelClosed(testErrorReason, false);
- Assert.equal(controllerState.state, State.CLOSING, 'controller in closing state');
-
- mockReceiverChannel.notifyDisconnected = function(reason) {
- Assert.equal(reason, testErrorReason, 'receive abnormal close reason');
- Assert.equal(receiverState.state, State.CLOSED, 'receiver in closed state');
-
- receiverState.onChannelClosed(Cr.NS_OK, true);
- Assert.equal(receiverState.state, State.CLOSED, 'receiver in closed state');
-
- mockControllerChannel.notifyDisconnected = function(reason) {
- Assert.equal(reason, testErrorReason, 'receive abnormal close reason');
- Assert.equal(controllerState.state, State.CLOSED, 'controller in closed state');
-
- run_next_test();
- };
- controllerState.onChannelClosed(Cr.NS_OK, true);
- };
-}
-
-add_test(connect);
-add_test(launch);
-add_test(terminateByController);
-add_test(terminateByReceiver);
-add_test(exchangeSDP);
-add_test(disconnect);
-add_test(receiverDisconnect);
-add_test(abnormalDisconnect);
-
-function run_test() { // jshint ignore:line
- run_next_test();
-}
diff --git a/dom/presentation/tests/xpcshell/test_tcp_control_channel.js b/dom/presentation/tests/xpcshell/test_tcp_control_channel.js
deleted file mode 100644
index 5f3df584d..000000000
--- a/dom/presentation/tests/xpcshell/test_tcp_control_channel.js
+++ /dev/null
@@ -1,398 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-'use strict';
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/Services.jsm');
-
-var pcs;
-
-// Call |run_next_test| if all functions in |names| are called
-function makeJointSuccess(names) {
- let funcs = {}, successCount = 0;
- names.forEach(function(name) {
- funcs[name] = function() {
- do_print('got expected: ' + name);
- if (++successCount === names.length)
- run_next_test();
- };
- });
- return funcs;
-}
-
-function TestDescription(aType, aTcpAddress, aTcpPort) {
- this.type = aType;
- this.tcpAddress = Cc["@mozilla.org/array;1"]
- .createInstance(Ci.nsIMutableArray);
- for (let address of aTcpAddress) {
- let wrapper = Cc["@mozilla.org/supports-cstring;1"]
- .createInstance(Ci.nsISupportsCString);
- wrapper.data = address;
- this.tcpAddress.appendElement(wrapper, false);
- }
- this.tcpPort = aTcpPort;
-}
-
-TestDescription.prototype = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationChannelDescription]),
-}
-
-const CONTROLLER_CONTROL_CHANNEL_PORT = 36777;
-const PRESENTER_CONTROL_CHANNEL_PORT = 36888;
-
-var CLOSE_CONTROL_CHANNEL_REASON = Cr.NS_OK;
-var candidate;
-
-// presenter's presentation channel description
-const OFFER_ADDRESS = '192.168.123.123';
-const OFFER_PORT = 123;
-
-// controller's presentation channel description
-const ANSWER_ADDRESS = '192.168.321.321';
-const ANSWER_PORT = 321;
-
-function loopOfferAnser() {
- pcs = Cc["@mozilla.org/presentation/control-service;1"]
- .createInstance(Ci.nsIPresentationControlService);
- pcs.id = 'controllerID';
- pcs.listener = {
- onServerReady: function() {
- testPresentationServer();
- }
- };
-
- // First run with TLS enabled.
- pcs.startServer(true, PRESENTER_CONTROL_CHANNEL_PORT);
-}
-
-
-function testPresentationServer() {
- let yayFuncs = makeJointSuccess(['controllerControlChannelClose',
- 'presenterControlChannelClose',
- 'controllerControlChannelReconnect',
- 'presenterControlChannelReconnect']);
- let presenterControlChannel;
-
- pcs.listener = {
-
- onSessionRequest: function(deviceInfo, url, presentationId, controlChannel) {
- presenterControlChannel = controlChannel;
- Assert.equal(deviceInfo.id, pcs.id, 'expected device id');
- Assert.equal(deviceInfo.address, '127.0.0.1', 'expected device address');
- Assert.equal(url, 'http://example.com', 'expected url');
- Assert.equal(presentationId, 'testPresentationId', 'expected presentation id');
-
- presenterControlChannel.listener = {
- status: 'created',
- onOffer: function(aOffer) {
- Assert.equal(this.status, 'opened', '1. presenterControlChannel: get offer, send answer');
- this.status = 'onOffer';
-
- let offer = aOffer.QueryInterface(Ci.nsIPresentationChannelDescription);
- Assert.strictEqual(offer.tcpAddress.queryElementAt(0,Ci.nsISupportsCString).data,
- OFFER_ADDRESS,
- 'expected offer address array');
- Assert.equal(offer.tcpPort, OFFER_PORT, 'expected offer port');
- try {
- let tcpType = Ci.nsIPresentationChannelDescription.TYPE_TCP;
- let answer = new TestDescription(tcpType, [ANSWER_ADDRESS], ANSWER_PORT);
- presenterControlChannel.sendAnswer(answer);
- } catch (e) {
- Assert.ok(false, 'sending answer fails' + e);
- }
- },
- onAnswer: function(aAnswer) {
- Assert.ok(false, 'get answer');
- },
- onIceCandidate: function(aCandidate) {
- Assert.ok(true, '3. presenterControlChannel: get ice candidate, close channel');
- let recvCandidate = JSON.parse(aCandidate);
- for (let key in recvCandidate) {
- if (typeof(recvCandidate[key]) !== "function") {
- Assert.equal(recvCandidate[key], candidate[key], "key " + key + " should match.");
- }
- }
- presenterControlChannel.disconnect(CLOSE_CONTROL_CHANNEL_REASON);
- },
- notifyConnected: function() {
- Assert.equal(this.status, 'created', '0. presenterControlChannel: opened');
- this.status = 'opened';
- },
- notifyDisconnected: function(aReason) {
- Assert.equal(this.status, 'onOffer', '4. presenterControlChannel: closed');
- Assert.equal(aReason, CLOSE_CONTROL_CHANNEL_REASON, 'presenterControlChannel notify closed');
- this.status = 'closed';
- yayFuncs.controllerControlChannelClose();
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannelListener]),
- };
- },
- onReconnectRequest: function(deviceInfo, url, presentationId, controlChannel) {
- Assert.equal(url, 'http://example.com', 'expected url');
- Assert.equal(presentationId, 'testPresentationId', 'expected presentation id');
- yayFuncs.presenterControlChannelReconnect();
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlServerListener]),
- };
-
- let presenterDeviceInfo = {
- id: 'presentatorID',
- address: '127.0.0.1',
- port: PRESENTER_CONTROL_CHANNEL_PORT,
- certFingerprint: pcs.certFingerprint,
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITCPDeviceInfo]),
- };
-
- let controllerControlChannel = pcs.connect(presenterDeviceInfo);
-
- controllerControlChannel.listener = {
- status: 'created',
- onOffer: function(offer) {
- Assert.ok(false, 'get offer');
- },
- onAnswer: function(aAnswer) {
- Assert.equal(this.status, 'opened', '2. controllerControlChannel: get answer, send ICE candidate');
-
- let answer = aAnswer.QueryInterface(Ci.nsIPresentationChannelDescription);
- Assert.strictEqual(answer.tcpAddress.queryElementAt(0,Ci.nsISupportsCString).data,
- ANSWER_ADDRESS,
- 'expected answer address array');
- Assert.equal(answer.tcpPort, ANSWER_PORT, 'expected answer port');
- candidate = {
- candidate: "1 1 UDP 1 127.0.0.1 34567 type host",
- sdpMid: "helloworld",
- sdpMLineIndex: 1
- };
- controllerControlChannel.sendIceCandidate(JSON.stringify(candidate));
- },
- onIceCandidate: function(aCandidate) {
- Assert.ok(false, 'get ICE candidate');
- },
- notifyConnected: function() {
- Assert.equal(this.status, 'created', '0. controllerControlChannel: opened, send offer');
- controllerControlChannel.launch('testPresentationId', 'http://example.com');
- this.status = 'opened';
- try {
- let tcpType = Ci.nsIPresentationChannelDescription.TYPE_TCP;
- let offer = new TestDescription(tcpType, [OFFER_ADDRESS], OFFER_PORT)
- controllerControlChannel.sendOffer(offer);
- } catch (e) {
- Assert.ok(false, 'sending offer fails:' + e);
- }
- },
- notifyDisconnected: function(aReason) {
- this.status = 'closed';
- Assert.equal(aReason, CLOSE_CONTROL_CHANNEL_REASON, '4. controllerControlChannel notify closed');
- yayFuncs.presenterControlChannelClose();
-
- let reconnectControllerControlChannel = pcs.connect(presenterDeviceInfo);
- reconnectControllerControlChannel.listener = {
- notifyConnected: function() {
- reconnectControllerControlChannel.reconnect('testPresentationId', 'http://example.com');
- },
- notifyReconnected: function() {
- yayFuncs.controllerControlChannelReconnect();
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannelListener]),
- };
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannelListener]),
- };
-}
-
-function terminateRequest() {
- let yayFuncs = makeJointSuccess(['controllerControlChannelConnected',
- 'controllerControlChannelDisconnected',
- 'presenterControlChannelDisconnected',
- 'terminatedByController',
- 'terminatedByReceiver']);
- let controllerControlChannel;
- let terminatePhase = 'controller';
-
- pcs.listener = {
- onTerminateRequest: function(deviceInfo, presentationId, controlChannel, isFromReceiver) {
- Assert.equal(deviceInfo.address, '127.0.0.1', 'expected device address');
- Assert.equal(presentationId, 'testPresentationId', 'expected presentation id');
- controlChannel.terminate(presentationId); // Reply terminate ack.
-
- if (terminatePhase === 'controller') {
- controllerControlChannel = controlChannel;
- Assert.equal(deviceInfo.id, pcs.id, 'expected controller device id');
- Assert.equal(isFromReceiver, false, 'expected request from controller');
- yayFuncs.terminatedByController();
-
- controllerControlChannel.listener = {
- notifyConnected: function() {
- Assert.ok(true, 'control channel notify connected');
- yayFuncs.controllerControlChannelConnected();
-
- terminatePhase = 'receiver';
- controllerControlChannel.terminate('testPresentationId');
- },
- notifyDisconnected: function(aReason) {
- Assert.equal(aReason, CLOSE_CONTROL_CHANNEL_REASON, 'controllerControlChannel notify disconncted');
- yayFuncs.controllerControlChannelDisconnected();
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannelListener]),
- };
- } else {
- Assert.equal(deviceInfo.id, presenterDeviceInfo.id, 'expected presenter device id');
- Assert.equal(isFromReceiver, true, 'expected request from receiver');
- yayFuncs.terminatedByReceiver();
- presenterControlChannel.disconnect(CLOSE_CONTROL_CHANNEL_REASON);
- }
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITCPPresentationServerListener]),
- };
-
- let presenterDeviceInfo = {
- id: 'presentatorID',
- address: '127.0.0.1',
- port: PRESENTER_CONTROL_CHANNEL_PORT,
- certFingerprint: pcs.certFingerprint,
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITCPDeviceInfo]),
- };
-
- let presenterControlChannel = pcs.connect(presenterDeviceInfo);
-
- presenterControlChannel.listener = {
- notifyConnected: function() {
- presenterControlChannel.terminate('testPresentationId');
- },
- notifyDisconnected: function(aReason) {
- Assert.equal(aReason, CLOSE_CONTROL_CHANNEL_REASON, '4. presenterControlChannel notify disconnected');
- yayFuncs.presenterControlChannelDisconnected();
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannelListener]),
- };
-}
-
-function terminateRequestAbnormal() {
- let yayFuncs = makeJointSuccess(['controllerControlChannelConnected',
- 'controllerControlChannelDisconnected',
- 'presenterControlChannelDisconnected']);
- let controllerControlChannel;
-
- pcs.listener = {
- onTerminateRequest: function(deviceInfo, presentationId, controlChannel, isFromReceiver) {
- Assert.equal(deviceInfo.id, pcs.id, 'expected controller device id');
- Assert.equal(deviceInfo.address, '127.0.0.1', 'expected device address');
- Assert.equal(presentationId, 'testPresentationId', 'expected presentation id');
- Assert.equal(isFromReceiver, false, 'expected request from controller');
- controlChannel.terminate('unmatched-presentationId'); // Reply abnormal terminate ack.
-
- controllerControlChannel = controlChannel;
-
- controllerControlChannel.listener = {
- notifyConnected: function() {
- Assert.ok(true, 'control channel notify connected');
- yayFuncs.controllerControlChannelConnected();
- },
- notifyDisconnected: function(aReason) {
- Assert.equal(aReason, Cr.NS_ERROR_FAILURE, 'controllerControlChannel notify disconncted with error');
- yayFuncs.controllerControlChannelDisconnected();
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannelListener]),
- };
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITCPPresentationServerListener]),
- };
-
- let presenterDeviceInfo = {
- id: 'presentatorID',
- address: '127.0.0.1',
- port: PRESENTER_CONTROL_CHANNEL_PORT,
- certFingerprint: pcs.certFingerprint,
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITCPDeviceInfo]),
- };
-
- let presenterControlChannel = pcs.connect(presenterDeviceInfo);
-
- presenterControlChannel.listener = {
- notifyConnected: function() {
- presenterControlChannel.terminate('testPresentationId');
- },
- notifyDisconnected: function(aReason) {
- Assert.equal(aReason, Cr.NS_ERROR_FAILURE, '4. presenterControlChannel notify disconnected with error');
- yayFuncs.presenterControlChannelDisconnected();
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIPresentationControlChannelListener]),
- };
-}
-
-function setOffline() {
- pcs.listener = {
- onServerReady: function(aPort, aCertFingerprint) {
- Assert.notEqual(aPort, 0, 'TCPPresentationServer port changed and the port should be valid');
- pcs.close();
- run_next_test();
- },
- };
-
- // Let the server socket restart automatically.
- Services.io.offline = true;
- Services.io.offline = false;
-}
-
-function oneMoreLoop() {
- try {
- pcs.listener = {
- onServerReady: function() {
- testPresentationServer();
- }
- };
-
- // Second run with TLS disabled.
- pcs.startServer(false, PRESENTER_CONTROL_CHANNEL_PORT);
- } catch (e) {
- Assert.ok(false, 'TCP presentation init fail:' + e);
- run_next_test();
- }
-}
-
-
-function shutdown()
-{
- pcs.listener = {
- onServerReady: function(aPort, aCertFingerprint) {
- Assert.ok(false, 'TCPPresentationServer port changed');
- },
- };
- pcs.close();
- Assert.equal(pcs.port, 0, "TCPPresentationServer closed");
- run_next_test();
-}
-
-// Test manually close control channel with NS_ERROR_FAILURE
-function changeCloseReason() {
- CLOSE_CONTROL_CHANNEL_REASON = Cr.NS_ERROR_FAILURE;
- run_next_test();
-}
-
-add_test(loopOfferAnser);
-add_test(terminateRequest);
-add_test(terminateRequestAbnormal);
-add_test(setOffline);
-add_test(changeCloseReason);
-add_test(oneMoreLoop);
-add_test(shutdown);
-
-function run_test() {
- // Need profile dir to store the key / cert
- do_get_profile();
- // Ensure PSM is initialized
- Cc["@mozilla.org/psm;1"].getService(Ci.nsISupports);
-
- Services.prefs.setBoolPref("dom.presentation.tcp_server.debug", true);
-
- do_register_cleanup(() => {
- Services.prefs.clearUserPref("dom.presentation.tcp_server.debug");
- });
-
- run_next_test();
-}
diff --git a/dom/presentation/tests/xpcshell/xpcshell.ini b/dom/presentation/tests/xpcshell/xpcshell.ini
deleted file mode 100644
index 8a9c305a0..000000000
--- a/dom/presentation/tests/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[DEFAULT]
-head =
-tail =
-
-[test_multicast_dns_device_provider.js]
-[test_presentation_device_manager.js]
-[test_presentation_session_transport.js]
-[test_tcp_control_channel.js]
-[test_presentation_state_machine.js]
diff --git a/dom/push/PushRecord.jsm b/dom/push/PushRecord.jsm
index 08a7678e0..58f808e6c 100644
--- a/dom/push/PushRecord.jsm
+++ b/dom/push/PushRecord.jsm
@@ -9,7 +9,6 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@@ -145,13 +144,14 @@ PushRecord.prototype = {
return Date.now();
}
- if (AppConstants.MOZ_ANDROID_HISTORY) {
- let result = yield Messaging.sendRequestForResult({
- type: "History:GetPrePathLastVisitedTimeMilliseconds",
- prePath: this.uri.prePath,
- });
- return result == 0 ? -Infinity : result;
- }
+#ifdef MOZ_ANDROID_HISTORY
+ let result = yield Messaging.sendRequestForResult({
+ type: "History:GetPrePathLastVisitedTimeMilliseconds",
+ prePath: this.uri.prePath,
+ });
+
+ return result == 0 ? -Infinity : result;
+#endif
// Places History transition types that can fire a
// `pushsubscriptionchange` event when the user visits a site with expired push
diff --git a/dom/push/PushService.jsm b/dom/push/PushService.jsm
index 373807024..07cf70d21 100644
--- a/dom/push/PushService.jsm
+++ b/dom/push/PushService.jsm
@@ -10,7 +10,6 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Timer.jsm");
@@ -24,14 +23,14 @@ const {
const {PushDB} = Cu.import("resource://gre/modules/PushDB.jsm");
const CONNECTION_PROTOCOLS = (function() {
- if ('android' != AppConstants.MOZ_WIDGET_TOOLKIT) {
+#ifdef MOZ_WIDGET_ANDROID
+ const {PushServiceAndroidGCM} = Cu.import("resource://gre/modules/PushServiceAndroidGCM.jsm");
+ return [PushServiceAndroidGCM];
+#else
const {PushServiceWebSocket} = Cu.import("resource://gre/modules/PushServiceWebSocket.jsm");
const {PushServiceHttp2} = Cu.import("resource://gre/modules/PushServiceHttp2.jsm");
return [PushServiceWebSocket, PushServiceHttp2];
- } else {
- const {PushServiceAndroidGCM} = Cu.import("resource://gre/modules/PushServiceAndroidGCM.jsm");
- return [PushServiceAndroidGCM];
- }
+#endif
})();
XPCOMUtils.defineLazyServiceGetter(this, "gPushNotifier",
diff --git a/dom/push/PushServiceWebSocket.jsm b/dom/push/PushServiceWebSocket.jsm
index 46b12b8f0..54348e71c 100644
--- a/dom/push/PushServiceWebSocket.jsm
+++ b/dom/push/PushServiceWebSocket.jsm
@@ -10,7 +10,6 @@ const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Promise.jsm");
Cu.import("resource://gre/modules/Services.jsm");
diff --git a/dom/push/moz.build b/dom/push/moz.build
index 7eee8896f..d138b270c 100644
--- a/dom/push/moz.build
+++ b/dom/push/moz.build
@@ -12,12 +12,15 @@ EXTRA_COMPONENTS += [
EXTRA_JS_MODULES += [
'PushCrypto.jsm',
'PushDB.jsm',
- 'PushRecord.jsm',
- 'PushService.jsm',
'PushServiceHttp2.jsm',
'PushServiceWebSocket.jsm',
]
+EXTRA_PP_JS_MODULES += [
+ 'PushRecord.jsm',
+ 'PushService.jsm',
+]
+
MOCHITEST_MANIFESTS += [
'test/mochitest.ini',
]
diff --git a/dom/security/nsCSPUtils.cpp b/dom/security/nsCSPUtils.cpp
index d07ad7945..6d4f297d6 100644
--- a/dom/security/nsCSPUtils.cpp
+++ b/dom/security/nsCSPUtils.cpp
@@ -555,7 +555,21 @@ permitsPort(const nsAString& aEnforcementScheme,
int32_t resourcePort;
nsresult rv = aResourceURI->GetPort(&resourcePort);
- NS_ENSURE_SUCCESS(rv, false);
+ if (NS_FAILED(rv) && aEnforcementPort.IsEmpty()) {
+ // If we cannot get a Port (e.g. because of an Custom Protocol handler)
+ // we need to check if a default port is associated with the Scheme
+ if (aEnforcementScheme.IsEmpty()) {
+ return false;
+ }
+ int defaultPortforScheme =
+ NS_GetDefaultPort(NS_ConvertUTF16toUTF8(aEnforcementScheme).get());
+
+ // If there is no default port associated with the Scheme (
+ // defaultPortforScheme == -1) or it is an externally handled protocol (
+ // defaultPortforScheme == 0 ) and the csp does not enforce a port - we can
+ // allow not having a port
+ return (defaultPortforScheme == -1 || defaultPortforScheme == 0);
+ }
// Avoid unnecessary string creation/manipulation and don't block the
// load if the resource to be loaded uses the default port for that
diff --git a/dom/system/OSFileConstants.cpp b/dom/system/OSFileConstants.cpp
index 86377e75a..ec84d784b 100644
--- a/dom/system/OSFileConstants.cpp
+++ b/dom/system/OSFileConstants.cpp
@@ -1048,22 +1048,11 @@ bool DefineOSFileConstants(JSContext *cx, JS::Handle<JSObject*> global)
}
#endif // defined(XP_MACOSX)
- // sqlite3 is linked from different places depending on the platform
+ // sqlite3 is always a shared lib
nsAutoString libsqlite3;
-#if defined(ANDROID)
- // On Android, we use the system's libsqlite3
- libsqlite3.AppendLiteral(DLL_PREFIX);
- libsqlite3.AppendLiteral("sqlite3");
- libsqlite3.AppendLiteral(DLL_SUFFIX);
-#elif defined(XP_WIN)
- // On Windows, for some reason, this is part of nss3.dll
libsqlite3.AppendLiteral(DLL_PREFIX);
- libsqlite3.AppendLiteral("nss3");
+ libsqlite3.AppendLiteral("mozsqlite3");
libsqlite3.AppendLiteral(DLL_SUFFIX);
-#else
- // On other platforms, we link sqlite3 into libxul
- libsqlite3 = libxul;
-#endif // defined(ANDROID) || defined(XP_WIN)
if (!SetStringProperty(cx, objPath, "libsqlite3", libsqlite3)) {
return false;
diff --git a/dom/webidl/FlyWebDiscoveryManager.webidl b/dom/webidl/FlyWebDiscoveryManager.webidl
deleted file mode 100644
index 963cebf20..000000000
--- a/dom/webidl/FlyWebDiscoveryManager.webidl
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-dictionary FlyWebDiscoveredService {
- DOMString serviceId = "";
- DOMString displayName = "";
- DOMString transport = "";
- DOMString serviceType = "";
- DOMString cert = "";
- DOMString path = "";
-};
-
-dictionary FlyWebPairedService {
- FlyWebDiscoveredService discoveredService;
- DOMString hostname = "";
- DOMString uiUrl = "";
-};
-
-callback interface FlyWebPairingCallback {
- void pairingSucceeded(optional FlyWebPairedService service);
- void pairingFailed(DOMString error);
-};
-
-callback interface FlyWebDiscoveryCallback {
- void onDiscoveredServicesChanged(sequence<FlyWebDiscoveredService> serviceList);
-};
-
-[ChromeOnly, ChromeConstructor, Exposed=(Window,System)]
-interface FlyWebDiscoveryManager {
- sequence<FlyWebDiscoveredService> listServices();
-
- unsigned long startDiscovery(FlyWebDiscoveryCallback aCallback);
- void stopDiscovery(unsigned long aId);
-
- void pairWithService(DOMString serviceId, FlyWebPairingCallback callback);
-};
diff --git a/dom/webidl/FlyWebFetchEvent.webidl b/dom/webidl/FlyWebFetchEvent.webidl
deleted file mode 100644
index 4bee424e5..000000000
--- a/dom/webidl/FlyWebFetchEvent.webidl
+++ /dev/null
@@ -1,13 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-[Pref="dom.flyweb.enabled"]
-interface FlyWebFetchEvent : Event {
- [SameObject] readonly attribute Request request;
-
- [Throws]
- void respondWith(Promise<Response> r);
-};
diff --git a/dom/webidl/FlyWebPublish.webidl b/dom/webidl/FlyWebPublish.webidl
deleted file mode 100644
index 0c8714a2a..000000000
--- a/dom/webidl/FlyWebPublish.webidl
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-[Pref="dom.flyweb.enabled"]
-interface FlyWebPublishedServer : EventTarget {
- readonly attribute DOMString name;
- readonly attribute DOMString? uiUrl;
-
- void close();
-
- attribute EventHandler onclose;
- attribute EventHandler onfetch;
- attribute EventHandler onwebsocket;
-};
-
-dictionary FlyWebPublishOptions {
- DOMString? uiUrl = null; // URL to user interface. Can be different server. Makes
- // endpoint show up in browser's "local services" UI.
- // If relative, resolves against the root of the server.
-};
diff --git a/dom/webidl/FlyWebWebSocketEvent.webidl b/dom/webidl/FlyWebWebSocketEvent.webidl
deleted file mode 100644
index 9a47c6dec..000000000
--- a/dom/webidl/FlyWebWebSocketEvent.webidl
+++ /dev/null
@@ -1,16 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-[Pref="dom.flyweb.enabled"]
-interface FlyWebWebSocketEvent : Event {
- [SameObject] readonly attribute Request request;
-
- [Throws]
- WebSocket accept(optional DOMString protocol);
-
- [Throws]
- void respondWith(Promise<Response> r);
-};
diff --git a/dom/webidl/Navigator.webidl b/dom/webidl/Navigator.webidl
index c353e8be7..4536d7d25 100644
--- a/dom/webidl/Navigator.webidl
+++ b/dom/webidl/Navigator.webidl
@@ -132,12 +132,6 @@ partial interface Navigator {
Promise<BatteryManager> getBattery();
};
-partial interface Navigator {
- [NewObject, Pref="dom.flyweb.enabled"]
- Promise<FlyWebPublishedServer> publishServer(DOMString name,
- optional FlyWebPublishOptions options);
-};
-
// http://www.w3.org/TR/vibration/#vibration-interface
partial interface Navigator {
// We don't support sequences in unions yet
@@ -331,11 +325,6 @@ partial interface Navigator {
};
partial interface Navigator {
- [Throws, Pref="dom.presentation.enabled", SameObject]
- readonly attribute Presentation? presentation;
-};
-
-partial interface Navigator {
[NewObject, Func="mozilla::dom::TCPSocket::ShouldTCPSocketExist"]
readonly attribute LegacyMozTCPSocket mozTCPSocket;
};
diff --git a/dom/webidl/Performance.webidl b/dom/webidl/Performance.webidl
index 0bd2677df..e811e1cee 100644
--- a/dom/webidl/Performance.webidl
+++ b/dom/webidl/Performance.webidl
@@ -55,12 +55,14 @@ partial interface Performance {
attribute EventHandler onresourcetimingbufferfull;
};
+#ifdef MOZ_DEVTOOLS_SERVER
// GC microbenchmarks, pref-guarded, not for general use (bug 1125412)
[Exposed=Window]
partial interface Performance {
[Pref="dom.enable_memory_stats"]
readonly attribute object mozMemory;
};
+#endif
// http://www.w3.org/TR/user-timing/
[Exposed=(Window,Worker)]
diff --git a/dom/webidl/Presentation.webidl b/dom/webidl/Presentation.webidl
deleted file mode 100644
index d5b331616..000000000
--- a/dom/webidl/Presentation.webidl
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * https://w3c.github.io/presentation-api/#interface-presentation
- */
-
-[Pref="dom.presentation.enabled"]
-interface Presentation {
- /*
- * This should be used by the UA as the default presentation request for the
- * controller. When the UA wishes to initiate a PresentationConnection on the
- * controller's behalf, it MUST start a presentation connection using the default
- * presentation request (as if the controller had called |defaultRequest.start()|).
- *
- * Only used by controlling browsing context (senders).
- */
- [Pref="dom.presentation.controller.enabled"]
- attribute PresentationRequest? defaultRequest;
-
- /*
- * This should be available on the receiving browsing context in order to
- * access the controlling browsing context and communicate with them.
- */
- [SameObject,
- Pref="dom.presentation.receiver.enabled"]
- readonly attribute PresentationReceiver? receiver;
-};
diff --git a/dom/webidl/PresentationAvailability.webidl b/dom/webidl/PresentationAvailability.webidl
deleted file mode 100644
index f72b88565..000000000
--- a/dom/webidl/PresentationAvailability.webidl
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * https://w3c.github.io/presentation-api/#interface-presentationavailability
- */
-
-[Pref="dom.presentation.controller.enabled"]
-interface PresentationAvailability : EventTarget {
- /*
- * If there is at least one device discovered by UA, the value is |true|.
- * Otherwise, its value should be |false|.
- */
- readonly attribute boolean value;
-
- /*
- * It is called when device availability changes.
- */
- attribute EventHandler onchange;
-};
diff --git a/dom/webidl/PresentationConnection.webidl b/dom/webidl/PresentationConnection.webidl
deleted file mode 100644
index 9676d2069..000000000
--- a/dom/webidl/PresentationConnection.webidl
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * https://w3c.github.io/presentation-api/#interface-presentationconnection
- */
-
-enum PresentationConnectionState
-{
- // The initial state when a PresentationConnection is ceated.
- "connecting",
-
- // Existing presentation, and the communication channel is active.
- "connected",
-
- // Existing presentation, but the communication channel is inactive.
- "closed",
-
- // The presentation is nonexistent anymore. It could be terminated manually,
- // or either controlling or receiving browsing context is no longer available.
- "terminated"
-};
-
-enum PresentationConnectionBinaryType
-{
- "blob",
- "arraybuffer"
-};
-
-[Pref="dom.presentation.enabled"]
-interface PresentationConnection : EventTarget {
- /*
- * Unique id for all existing connections.
- */
- [Constant]
- readonly attribute DOMString id;
-
- /*
- * Specifies the connection's presentation URL.
- */
- readonly attribute DOMString url;
-
- /*
- * @value "connected", "closed", or "terminated".
- */
- readonly attribute PresentationConnectionState state;
-
- attribute EventHandler onconnect;
- attribute EventHandler onclose;
- attribute EventHandler onterminate;
- attribute PresentationConnectionBinaryType binaryType;
-
- /*
- * After a communication channel has been established between the controlling
- * and receiving context, this function is called to send message out, and the
- * event handler "onmessage" will be invoked at the remote side.
- *
- * This function only works when the state is "connected".
- */
- [Throws]
- void send(DOMString data);
-
- [Throws]
- void send(Blob data);
-
- [Throws]
- void send(ArrayBuffer data);
-
- [Throws]
- void send(ArrayBufferView data);
-
- /*
- * It is triggered when receiving messages.
- */
- attribute EventHandler onmessage;
-
- /*
- * Both the controlling and receiving browsing context can close the
- * connection. Then the connection state should turn into "closed".
- *
- * This function only works when the state is "connected" or "connecting".
- */
- [Throws]
- void close();
-
- /*
- * Both the controlling and receiving browsing context can terminate the
- * connection. Then the connection state should turn into "terminated".
- *
- * This function only works when the state is not "connected".
- */
- [Throws]
- void terminate();
-};
diff --git a/dom/webidl/PresentationConnectionAvailableEvent.webidl b/dom/webidl/PresentationConnectionAvailableEvent.webidl
deleted file mode 100644
index 9efecb7d6..000000000
--- a/dom/webidl/PresentationConnectionAvailableEvent.webidl
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * https://w3c.github.io/presentation-api/#interface-presentationconnectionavailableevent
- */
-
-[Constructor(DOMString type,
- PresentationConnectionAvailableEventInit eventInitDict),
- Pref="dom.presentation.enabled"]
-interface PresentationConnectionAvailableEvent : Event
-{
- [SameObject]
- readonly attribute PresentationConnection connection;
-};
-
-dictionary PresentationConnectionAvailableEventInit : EventInit
-{
- required PresentationConnection connection;
-};
diff --git a/dom/webidl/PresentationConnectionCloseEvent.webidl b/dom/webidl/PresentationConnectionCloseEvent.webidl
deleted file mode 100644
index da6c25545..000000000
--- a/dom/webidl/PresentationConnectionCloseEvent.webidl
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * https://w3c.github.io/presentation-api/#interface-presentationconnectioncloseevent
- */
-
-enum PresentationConnectionClosedReason
-{
- // The communication encountered an unrecoverable error.
- "error",
-
- // |PresentationConnection.close()| is called by controlling browsing context
- // or the receiving browsing context.
- "closed",
-
- // The connection is closed because the destination browsing context
- // that owned the connection navigated or was discarded.
- "wentaway"
-};
-
-[Constructor(DOMString type,
- PresentationConnectionCloseEventInit eventInitDict),
- Pref="dom.presentation.enabled"]
-interface PresentationConnectionCloseEvent : Event
-{
- readonly attribute PresentationConnectionClosedReason reason;
-
- // The message is a human readable description of
- // how the communication channel encountered an error.
- // It is empty when the closed reason is closed or wentaway.
- readonly attribute DOMString message;
-};
-
-dictionary PresentationConnectionCloseEventInit : EventInit
-{
- required PresentationConnectionClosedReason reason;
- DOMString message = "";
-};
diff --git a/dom/webidl/PresentationConnectionList.webidl b/dom/webidl/PresentationConnectionList.webidl
deleted file mode 100644
index 2c90ce9de..000000000
--- a/dom/webidl/PresentationConnectionList.webidl
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * https://w3c.github.io/presentation-api/#interface-presentationconnectionlist
- */
-
-[Pref="dom.presentation.receiver.enabled"]
-interface PresentationConnectionList : EventTarget {
- /*
- * Return the non-terminated set of presentation connections in the
- * set of presentation controllers.
- * TODO: Use FrozenArray once available. (Bug 1236777)
- * readonly attribute FrozenArray<PresentationConnection> connections;
- */
- [Frozen, Cached, Pure]
- readonly attribute sequence<PresentationConnection> connections;
-
- /*
- * It is called when an incoming connection is connected.
- */
- attribute EventHandler onconnectionavailable;
-};
diff --git a/dom/webidl/PresentationDeviceInfoManager.webidl b/dom/webidl/PresentationDeviceInfoManager.webidl
deleted file mode 100644
index 6ccace324..000000000
--- a/dom/webidl/PresentationDeviceInfoManager.webidl
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-dictionary PresentationDeviceInfo {
- DOMString id;
- DOMString name;
- DOMString type;
-};
-
-[NavigatorProperty="mozPresentationDeviceInfo",
- JSImplementation="@mozilla.org/presentation-device/deviceInfo;1",
- Pref="dom.presentation.enabled",
- ChromeOnly]
-interface PresentationDeviceInfoManager : EventTarget {
- // notify if any device updated.
- attribute EventHandler ondevicechange;
-
- // retrieve all available device infos
- Promise<sequence<PresentationDeviceInfo>> getAll();
-
- // Force all registered device provider to update device information.
- void forceDiscovery();
-};
diff --git a/dom/webidl/PresentationReceiver.webidl b/dom/webidl/PresentationReceiver.webidl
deleted file mode 100644
index 4acb37cf3..000000000
--- a/dom/webidl/PresentationReceiver.webidl
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * https://w3c.github.io/presentation-api/#interface-presentationreceiver
- */
-
-[Pref="dom.presentation.receiver.enabled"]
-interface PresentationReceiver {
- /*
- * Get a list which contains all connected presentation connections
- * in a receiving browsing context.
- */
- [SameObject, Throws]
- readonly attribute Promise<PresentationConnectionList> connectionList;
-};
diff --git a/dom/webidl/PresentationRequest.webidl b/dom/webidl/PresentationRequest.webidl
deleted file mode 100644
index c0c5fb8a6..000000000
--- a/dom/webidl/PresentationRequest.webidl
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * The origin of this IDL file is
- * https://w3c.github.io/presentation-api/#interface-presentationrequest
- */
-
-[Constructor(DOMString url),
- Constructor(sequence<DOMString> urls),
- Pref="dom.presentation.controller.enabled"]
-interface PresentationRequest : EventTarget {
- /*
- * A requesting page use start() to start a new connection, and it will be
- * returned with the promise. UA may show a prompt box with a list of
- * available devices and ask the user to grant permission, choose a device, or
- * cancel the operation.
- *
- * The promise is resolved when the presenting page is successfully loaded and
- * the communication channel is established, i.e., the connection state is
- * "connected".
- *
- * The promise may be rejected duo to one of the following reasons:
- * - "OperationError": Unexpected error occurs.
- * - "NotFoundError": No available device.
- * - "AbortError": User dismiss/cancel the device prompt box.
- * - "NetworkError": Failed to establish the control channel or data channel.
- * - "TimeoutError": Presenting page takes too long to load.
- * - "SecurityError": This operation is insecure.
- */
- [Throws]
- Promise<PresentationConnection> start();
-
- /*
- * A requesting page can use reconnect(presentationId) to reopen a
- * non-terminated presentation connection.
- *
- * The promise is resolved when a new presentation connection is created.
- * The connection state is "connecting".
- *
- * The promise may be rejected duo to one of the following reasons:
- * - "OperationError": Unexpected error occurs.
- * - "NotFoundError": Can not find a presentation connection with the presentationId.
- * - "SecurityError": This operation is insecure.
- */
- [Throws]
- Promise<PresentationConnection> reconnect(DOMString presentationId);
-
- /*
- * UA triggers device discovery mechanism periodically and monitor device
- * availability.
- *
- * The promise may be rejected duo to one of the following reasons:
- * - "NotSupportedError": Unable to continuously monitor the availability.
- * - "SecurityError": This operation is insecure.
- */
- [Throws]
- Promise<PresentationAvailability> getAvailability();
-
- /*
- * It is called when a connection associated with a PresentationRequest is created.
- * The event is fired for all connections that are created for the controller.
- */
- attribute EventHandler onconnectionavailable;
-
- /*
- * A chrome page, or page which has presentation-device-manage permissiongs,
- * uses startWithDevice() to start a new connection with specified device,
- * and it will be returned with the promise. UA may show a prompt box with a
- * list of available devices and ask the user to grant permission, choose a
- * device, or cancel the operation.
- *
- * The promise is resolved when the presenting page is successfully loaded and
- * the communication channel is established, i.e., the connection state is
- * "connected".
- *
- * The promise may be rejected duo to one of the following reasons:
- * - "OperationError": Unexpected error occurs.
- * - "NotFoundError": No available device.
- * - "NetworkError": Failed to establish the control channel or data channel.
- * - "TimeoutError": Presenting page takes too long to load.
- */
- [ChromeOnly, Throws]
- Promise<PresentationConnection> startWithDevice(DOMString deviceId);
-};
diff --git a/dom/webidl/moz.build b/dom/webidl/moz.build
index 4e3b8f655..156da302d 100644
--- a/dom/webidl/moz.build
+++ b/dom/webidl/moz.build
@@ -12,6 +12,7 @@ PREPROCESSED_WEBIDL_FILES = [
'HTMLMediaElement.webidl',
'Navigator.webidl',
'Node.webidl',
+ 'Performance.webidl',
'Window.webidl',
]
@@ -151,10 +152,6 @@ WEBIDL_FILES = [
'FileSystemDirectoryReader.webidl',
'FileSystemEntry.webidl',
'FileSystemFileEntry.webidl',
- 'FlyWebDiscoveryManager.webidl',
- 'FlyWebFetchEvent.webidl',
- 'FlyWebPublish.webidl',
- 'FlyWebWebSocketEvent.webidl',
'FocusEvent.webidl',
'FontFace.webidl',
'FontFaceSet.webidl',
@@ -285,15 +282,7 @@ WEBIDL_FILES = [
'MediaDeviceInfo.webidl',
'MediaDevices.webidl',
'MediaElementAudioSourceNode.webidl',
- 'MediaEncryptedEvent.webidl',
'MediaError.webidl',
- 'MediaKeyError.webidl',
- 'MediaKeyMessageEvent.webidl',
- 'MediaKeys.webidl',
- 'MediaKeySession.webidl',
- 'MediaKeysRequestStatus.webidl',
- 'MediaKeyStatusMap.webidl',
- 'MediaKeySystemAccess.webidl',
'MediaList.webidl',
'MediaQueryList.webidl',
'MediaRecorder.webidl',
@@ -341,7 +330,6 @@ WEBIDL_FILES = [
'PaintRequestList.webidl',
'PannerNode.webidl',
'ParentNode.webidl',
- 'Performance.webidl',
'PerformanceEntry.webidl',
'PerformanceMark.webidl',
'PerformanceMeasure.webidl',
@@ -361,13 +349,6 @@ WEBIDL_FILES = [
'PopupBoxObject.webidl',
'Position.webidl',
'PositionError.webidl',
- 'Presentation.webidl',
- 'PresentationAvailability.webidl',
- 'PresentationConnection.webidl',
- 'PresentationConnectionList.webidl',
- 'PresentationDeviceInfoManager.webidl',
- 'PresentationReceiver.webidl',
- 'PresentationRequest.webidl',
'ProcessingInstruction.webidl',
'ProfileTimelineMarker.webidl',
'Promise.webidl',
@@ -565,7 +546,6 @@ WEBIDL_FILES = [
'WebKitCSSMatrix.webidl',
'WebSocket.webidl',
'WheelEvent.webidl',
- 'WidevineCDMManifest.webidl',
'WifiOptions.webidl',
'WindowOrWorkerGlobalScope.webidl',
'WindowRoot.webidl',
@@ -592,6 +572,19 @@ WEBIDL_FILES = [
'XULElement.webidl',
]
+if CONFIG['MOZ_EME']:
+ WEBIDL_FILES += [
+ 'MediaEncryptedEvent.webidl',
+ 'MediaKeyError.webidl',
+ 'MediaKeyMessageEvent.webidl',
+ 'MediaKeys.webidl',
+ 'MediaKeySession.webidl',
+ 'MediaKeysRequestStatus.webidl',
+ 'MediaKeyStatusMap.webidl',
+ 'MediaKeySystemAccess.webidl',
+ 'WidevineCDMManifest.webidl',
+ ]
+
if CONFIG['MOZ_AUDIO_CHANNEL_MANAGER']:
WEBIDL_FILES += [
'AudioChannelManager.webidl',
@@ -702,8 +695,6 @@ GENERATED_EVENTS_WEBIDL_FILES = [
'PluginCrashedEvent.webidl',
'PopStateEvent.webidl',
'PopupBlockedEvent.webidl',
- 'PresentationConnectionAvailableEvent.webidl',
- 'PresentationConnectionCloseEvent.webidl',
'ProgressEvent.webidl',
'RecordErrorEvent.webidl',
'ScrollViewChangeEvent.webidl',
diff --git a/editor/libeditor/HTMLEditRules.cpp b/editor/libeditor/HTMLEditRules.cpp
index c2d61f767..545e22f70 100644
--- a/editor/libeditor/HTMLEditRules.cpp
+++ b/editor/libeditor/HTMLEditRules.cpp
@@ -4641,7 +4641,11 @@ HTMLEditRules::WillAlign(Selection& aSelection,
}
nsCOMPtr<nsINode> curParent = curNode->GetParentNode();
- int32_t offset = curParent ? curParent->IndexOf(curNode) : -1;
+ if (!curParent) {
+ continue;
+ }
+
+ int32_t offset = curParent->IndexOf(curNode);
// Skip insignificant formatting text nodes to prevent unnecessary
// structure splitting!
diff --git a/editor/libeditor/HTMLEditor.cpp b/editor/libeditor/HTMLEditor.cpp
index 368f7a3e9..532da7a15 100644
--- a/editor/libeditor/HTMLEditor.cpp
+++ b/editor/libeditor/HTMLEditor.cpp
@@ -3344,12 +3344,18 @@ HTMLEditor::GetIsSelectionEditable(bool* aIsSelectionEditable)
RefPtr<Selection> selection = GetSelection();
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
+ nsINode* anchorNode = selection->GetAnchorNode();
+ nsINode* focusNode = selection->GetFocusNode();
+ if (!anchorNode || !focusNode) {
+ return NS_ERROR_FAILURE;
+ }
+
// Per the editing spec as of June 2012: we have to have a selection whose
// start and end nodes are editable, and which share an ancestor editing
// host. (Bug 766387.)
*aIsSelectionEditable = selection->RangeCount() &&
- selection->GetAnchorNode()->IsEditable() &&
- selection->GetFocusNode()->IsEditable();
+ anchorNode->IsEditable() &&
+ focusNode->IsEditable();
if (*aIsSelectionEditable) {
nsINode* commonAncestor =
diff --git a/editor/libeditor/HTMLStyleEditor.cpp b/editor/libeditor/HTMLStyleEditor.cpp
index bc7141ad3..6a1ffe8b4 100644
--- a/editor/libeditor/HTMLStyleEditor.cpp
+++ b/editor/libeditor/HTMLStyleEditor.cpp
@@ -333,8 +333,9 @@ HTMLEditor::SetInlinePropertyOnTextNode(Text& aText,
RefPtr<Text> text = &aText;
if (uint32_t(aEndOffset) != aText.Length()) {
// We need to split off back of text node
- text = SplitNode(aText, aEndOffset, rv)->GetAsText();
+ nsIContent* textNode = SplitNode(aText, aEndOffset, rv);
NS_ENSURE_TRUE(!rv.Failed(), rv.StealNSResult());
+ text = textNode->GetAsText();
}
if (aStartOffset) {
diff --git a/editor/libeditor/HTMLTableEditor.cpp b/editor/libeditor/HTMLTableEditor.cpp
index 3da0cfe0c..778bf1d2d 100644
--- a/editor/libeditor/HTMLTableEditor.cpp
+++ b/editor/libeditor/HTMLTableEditor.cpp
@@ -2730,8 +2730,8 @@ HTMLEditor::GetCellDataAt(nsIDOMElement* aTable,
}
*aIsSelected = cellFrame->IsSelected();
- cellFrame->GetRowIndex(*aStartRowIndex);
- cellFrame->GetColIndex(*aStartColIndex);
+ *aStartRowIndex = cellFrame->RowIndex();
+ *aStartColIndex = cellFrame->ColIndex();
*aRowSpan = cellFrame->GetRowSpan();
*aColSpan = cellFrame->GetColSpan();
*aActualRowSpan = tableFrame->GetEffectiveRowSpanAt(aRowIndex, aColIndex);
diff --git a/embedding/components/webbrowserpersist/nsWebBrowserPersist.cpp b/embedding/components/webbrowserpersist/nsWebBrowserPersist.cpp
index a31414e7f..437d21997 100644
--- a/embedding/components/webbrowserpersist/nsWebBrowserPersist.cpp
+++ b/embedding/components/webbrowserpersist/nsWebBrowserPersist.cpp
@@ -2351,18 +2351,16 @@ nsWebBrowserPersist::EndDownload(nsresult aResult)
{
mPersistResult = aResult;
}
+
// mCompleted needs to be set before issuing the stop notification.
// (Bug 1224437)
mCompleted = true;
-
-#ifdef MOZ_JSDOWNLOADS
// State stop notification
if (mProgressListener) {
mProgressListener->OnStateChange(nullptr, nullptr,
nsIWebProgressListener::STATE_STOP
| nsIWebProgressListener::STATE_IS_NETWORK, mPersistResult);
}
-#endif
// Do file cleanup if required
if (NS_FAILED(aResult) && (mPersistFlags & PERSIST_FLAGS_CLEANUP_ON_FAILURE))
diff --git a/embedding/components/windowwatcher/nsWindowWatcher.cpp b/embedding/components/windowwatcher/nsWindowWatcher.cpp
index 3732ea66d..fa23e285b 100644
--- a/embedding/components/windowwatcher/nsWindowWatcher.cpp
+++ b/embedding/components/windowwatcher/nsWindowWatcher.cpp
@@ -1297,6 +1297,12 @@ nsWindowWatcher::OpenWindowInternal(mozIDOMWindowProxy* aParent,
}
}
+ // If a website opens a popup exit DOM fullscreen
+ if (windowIsNew && aCalledFromJS && !hasChromeParent && !isCallerChrome &&
+ parentWindow) {
+ nsIDocument::AsyncExitFullscreen(parentWindow->GetDoc());
+ }
+
if (aForceNoOpener && windowIsNew) {
NS_RELEASE(*aResult);
}
diff --git a/gfx/2d/ScaledFontDWrite.cpp b/gfx/2d/ScaledFontDWrite.cpp
index dc8e586f5..cf173f849 100644
--- a/gfx/2d/ScaledFontDWrite.cpp
+++ b/gfx/2d/ScaledFontDWrite.cpp
@@ -110,10 +110,12 @@ ScaledFontDWrite::ScaledFontDWrite(IDWriteFontFace *aFontFace, Float aSize,
, mUseEmbeddedBitmap(aUseEmbeddedBitmap)
, mForceGDIMode(aForceGDIMode)
{
+#ifdef USE_SKIA
mStyle = SkFontStyle(aStyle->weight,
DWriteFontStretchFromStretch(aStyle->stretch),
aStyle->style == NS_FONT_STYLE_NORMAL ?
SkFontStyle::kUpright_Slant : SkFontStyle::kItalic_Slant);
+#endif
}
already_AddRefed<Path>
diff --git a/gfx/layers/composite/TextureHost.cpp b/gfx/layers/composite/TextureHost.cpp
index b342f1d18..8df7af4a8 100644
--- a/gfx/layers/composite/TextureHost.cpp
+++ b/gfx/layers/composite/TextureHost.cpp
@@ -555,6 +555,14 @@ void
BufferTextureHost::DeallocateDeviceData()
{
if (mFirstSource && mFirstSource->NumCompositableRefs() > 0) {
+ // WrappingTextureSourceYCbCrBasic wraps YUV format BufferTextureHost.
+ // When BufferTextureHost is destroyed, data of
+ // WrappingTextureSourceYCbCrBasic becomes invalid.
+ if (mFirstSource->AsWrappingTextureSourceYCbCrBasic() &&
+ mFirstSource->IsOwnedBy(this)) {
+ mFirstSource->SetOwner(nullptr);
+ mFirstSource->DeallocateDeviceData();
+ }
return;
}
diff --git a/gfx/thebes/gfxAndroidPlatform.h b/gfx/thebes/gfxAndroidPlatform.h
index 30e7c89ba..8975d0ab9 100644
--- a/gfx/thebes/gfxAndroidPlatform.h
+++ b/gfx/thebes/gfxAndroidPlatform.h
@@ -72,11 +72,6 @@ public:
return true;
}
-protected:
- bool AccelerateLayersByDefault() override {
- return true;
- }
-
private:
gfxImageFormat mOffscreenFormat;
};
diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
index 50d1fcb46..ae4336060 100644
--- a/gfx/thebes/gfxPlatform.cpp
+++ b/gfx/thebes/gfxPlatform.cpp
@@ -571,40 +571,6 @@ gfxPlatform::Init()
}
}
- // Drop a note in the crash report if we end up forcing an option that could
- // destabilize things. New items should be appended at the end (of an existing
- // or in a new section), so that we don't have to know the version to interpret
- // these cryptic strings.
- {
- nsAutoCString forcedPrefs;
- // D2D prefs
- forcedPrefs.AppendPrintf("FP(D%d%d",
- gfxPrefs::Direct2DDisabled(),
- gfxPrefs::Direct2DForceEnabled());
- // Layers prefs
- forcedPrefs.AppendPrintf("-L%d%d%d%d",
- gfxPrefs::LayersAMDSwitchableGfxEnabled(),
- gfxPrefs::LayersAccelerationDisabledDoNotUseDirectly(),
- gfxPrefs::LayersAccelerationForceEnabledDoNotUseDirectly(),
- gfxPrefs::LayersD3D11ForceWARP());
- // WebGL prefs
- forcedPrefs.AppendPrintf("-W%d%d%d%d%d%d%d%d",
- gfxPrefs::WebGLANGLEForceD3D11(),
- gfxPrefs::WebGLANGLEForceWARP(),
- gfxPrefs::WebGLDisabled(),
- gfxPrefs::WebGLDisableANGLE(),
- gfxPrefs::WebGLDXGLEnabled(),
- gfxPrefs::WebGLForceEnabled(),
- gfxPrefs::WebGLForceLayersReadback(),
- gfxPrefs::WebGLForceMSAA());
- // Prefs that don't fit into any of the other sections
- forcedPrefs.AppendPrintf("-T%d%d%d%d) ",
- gfxPrefs::AndroidRGB16Force(),
- gfxPrefs::CanvasAzureAccelerated(),
- gfxPrefs::DisableGralloc(),
- gfxPrefs::ForceShmemTiles());
- }
-
InitMoz2DLogging();
gGfxPlatformPrefsLock = new Mutex("gfxPlatform::gGfxPlatformPrefsLock");
@@ -2171,7 +2137,7 @@ gfxPlatform::InitCompositorAccelerationPrefs()
FeatureStatus::Blocked,
"Acceleration blocked by platform"))
{
- if (gfxPrefs::LayersAccelerationDisabledDoNotUseDirectly()) {
+ if (!gfxPrefs::LayersAccelerationEnabledDoNotUseDirectly()) {
feature.UserDisable("Disabled by pref",
NS_LITERAL_CSTRING("FEATURE_FAILURE_COMP_PREF"));
} else if (acceleratedEnv && *acceleratedEnv == '0') {
@@ -2185,8 +2151,9 @@ gfxPlatform::InitCompositorAccelerationPrefs()
}
// This has specific meaning elsewhere, so we always record it.
- if (gfxPrefs::LayersAccelerationForceEnabledDoNotUseDirectly()) {
- feature.UserForceEnable("Force-enabled by pref");
+ if (gfxPrefs::LayersAccelerationEnabledDoNotUseDirectly() &&
+ gfxPrefs::LayersAccelerationForceEnabledDoNotUseDirectly()) {
+ feature.UserForceEnable("Force-enabled by prefs");
}
// Safe mode trumps everything.
@@ -2208,7 +2175,11 @@ gfxPlatform::CanUseHardwareVideoDecoding()
bool
gfxPlatform::AccelerateLayersByDefault()
{
-#if defined(MOZ_GL_PROVIDER) || defined(MOZ_WIDGET_UIKIT)
+ // Note: add any new platform defines here that should get HWA by default.
+#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_UIKIT)
+ return true;
+#elif defined(MOZ_GL_PROVIDER)
+ // GL provider manually declared
return true;
#else
return false;
diff --git a/gfx/thebes/gfxPlatform.h b/gfx/thebes/gfxPlatform.h
index 68bb99ea4..642cf909f 100644
--- a/gfx/thebes/gfxPlatform.h
+++ b/gfx/thebes/gfxPlatform.h
@@ -698,7 +698,7 @@ protected:
virtual already_AddRefed<mozilla::gfx::VsyncSource> CreateHardwareVsyncSource();
// Returns whether or not layers should be accelerated by default on this platform.
- virtual bool AccelerateLayersByDefault();
+ bool AccelerateLayersByDefault();
// Returns a prioritized list of available compositor backends for acceleration.
virtual void GetAcceleratedCompositorBackends(nsTArray<mozilla::layers::LayersBackend>& aBackends);
diff --git a/gfx/thebes/gfxPlatformGtk.h b/gfx/thebes/gfxPlatformGtk.h
index 9959c0e13..22ed4b08f 100644
--- a/gfx/thebes/gfxPlatformGtk.h
+++ b/gfx/thebes/gfxPlatformGtk.h
@@ -132,10 +132,6 @@ public:
return true;
}
- bool AccelerateLayersByDefault() override {
- return true;
- }
-
#ifdef GL_PROVIDER_GLX
already_AddRefed<mozilla::gfx::VsyncSource> CreateHardwareVsyncSource() override;
#endif
diff --git a/gfx/thebes/gfxPlatformMac.cpp b/gfx/thebes/gfxPlatformMac.cpp
index 79684dd19..75c5236a8 100644
--- a/gfx/thebes/gfxPlatformMac.cpp
+++ b/gfx/thebes/gfxPlatformMac.cpp
@@ -372,12 +372,6 @@ gfxPlatformMac::ReadAntiAliasingThreshold()
return threshold;
}
-bool
-gfxPlatformMac::AccelerateLayersByDefault()
-{
- return true;
-}
-
// This is the renderer output callback function, called on the vsync thread
static CVReturn VsyncCallback(CVDisplayLinkRef aDisplayLink,
const CVTimeStamp* aNow,
diff --git a/gfx/thebes/gfxPlatformMac.h b/gfx/thebes/gfxPlatformMac.h
index 0807614f6..ea4c1a101 100644
--- a/gfx/thebes/gfxPlatformMac.h
+++ b/gfx/thebes/gfxPlatformMac.h
@@ -81,9 +81,6 @@ public:
// lower threshold on font anti-aliasing
uint32_t GetAntiAliasingThreshold() { return mFontAntiAliasingThreshold; }
-protected:
- bool AccelerateLayersByDefault() override;
-
private:
virtual void GetPlatformCMSOutputProfile(void* &mem, size_t &size) override;
diff --git a/gfx/thebes/gfxPrefs.h b/gfx/thebes/gfxPrefs.h
index 1253fdb48..d02f15699 100644
--- a/gfx/thebes/gfxPrefs.h
+++ b/gfx/thebes/gfxPrefs.h
@@ -448,11 +448,11 @@ private:
DECL_GFX_PREF(Once, "image.multithreaded_decoding.limit", ImageMTDecodingLimit, int32_t, -1);
DECL_GFX_PREF(Live, "image.webp.enabled", ImageWebPEnabled, bool, true);
- DECL_GFX_PREF(Once, "layers.acceleration.disabled", LayersAccelerationDisabledDoNotUseDirectly, bool, false);
+ DECL_GFX_PREF(Once, "layers.acceleration.enabled", LayersAccelerationEnabledDoNotUseDirectly, bool, true);
DECL_GFX_PREF(Live, "layers.acceleration.draw-fps", LayersDrawFPS, bool, false);
DECL_GFX_PREF(Live, "layers.acceleration.draw-fps.print-histogram", FPSPrintHistogram, bool, false);
DECL_GFX_PREF(Live, "layers.acceleration.draw-fps.write-to-file", WriteFPSToFile, bool, false);
- DECL_GFX_PREF(Once, "layers.acceleration.force-enabled", LayersAccelerationForceEnabledDoNotUseDirectly, bool, false);
+ DECL_GFX_PREF(Once, "layers.acceleration.force", LayersAccelerationForceEnabledDoNotUseDirectly, bool, false);
DECL_GFX_PREF(Once, "layers.allow-d3d9-fallback", LayersAllowD3D9Fallback, bool, false);
DECL_GFX_PREF(Once, "layers.amd-switchable-gfx.enabled", LayersAMDSwitchableGfxEnabled, bool, false);
DECL_GFX_PREF(Once, "layers.async-pan-zoom.enabled", AsyncPanZoomEnabledDoNotUseDirectly, bool, true);
diff --git a/gfx/thebes/gfxWindowsPlatform.h b/gfx/thebes/gfxWindowsPlatform.h
index 129365f82..b56dab338 100644
--- a/gfx/thebes/gfxWindowsPlatform.h
+++ b/gfx/thebes/gfxWindowsPlatform.h
@@ -226,9 +226,6 @@ public:
bool SupportsPluginDirectDXGIDrawing();
protected:
- bool AccelerateLayersByDefault() override {
- return true;
- }
void GetAcceleratedCompositorBackends(nsTArray<mozilla::layers::LayersBackend>& aBackends) override;
virtual void GetPlatformCMSOutputProfile(void* &mem, size_t &size) override;
diff --git a/hal/android/AndroidAlarm.cpp b/hal/android/AndroidAlarm.cpp
deleted file mode 100644
index 3b2613be8..000000000
--- a/hal/android/AndroidAlarm.cpp
+++ /dev/null
@@ -1,48 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "Hal.h"
-
-#include "GeneratedJNINatives.h"
-#include "GeneratedJNIWrappers.h"
-
-using namespace mozilla::hal;
-
-namespace mozilla {
-
-class AlarmReceiver : public java::AlarmReceiver::Natives<AlarmReceiver>
-{
-private:
- AlarmReceiver();
-
-public:
- static void NotifyAlarmFired() {
- hal::NotifyAlarmFired();
- }
-};
-
-namespace hal_impl {
-
-bool
-EnableAlarm()
-{
- AlarmReceiver::Init();
- return true;
-}
-
-void
-DisableAlarm()
-{
- java::GeckoAppShell::DisableAlarm();
-}
-
-bool
-SetAlarm(int32_t aSeconds, int32_t aNanoseconds)
-{
- return java::GeckoAppShell::SetAlarm(aSeconds, aNanoseconds);
-}
-
-} // hal_impl
-} // mozilla
diff --git a/hal/android/AndroidHal.cpp b/hal/android/AndroidHal.cpp
deleted file mode 100644
index 495b623ef..000000000
--- a/hal/android/AndroidHal.cpp
+++ /dev/null
@@ -1,175 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "Hal.h"
-#include "HalImpl.h"
-#include "WindowIdentifier.h"
-#include "AndroidBridge.h"
-#include "mozilla/dom/network/Constants.h"
-#include "mozilla/dom/ScreenOrientation.h"
-#include "nsIScreenManager.h"
-#include "nsServiceManagerUtils.h"
-
-using namespace mozilla::dom;
-using namespace mozilla::hal;
-
-namespace java = mozilla::java;
-
-namespace mozilla {
-namespace hal_impl {
-
-void
-Vibrate(const nsTArray<uint32_t> &pattern, const WindowIdentifier &)
-{
- // Ignore the WindowIdentifier parameter; it's here only because hal::Vibrate,
- // hal_sandbox::Vibrate, and hal_impl::Vibrate all must have the same
- // signature.
-
- // Strangely enough, the Android Java API seems to treat vibrate([0]) as a
- // nop. But we want to treat vibrate([0]) like CancelVibrate! (Note that we
- // also need to treat vibrate([]) as a call to CancelVibrate.)
- bool allZero = true;
- for (uint32_t i = 0; i < pattern.Length(); i++) {
- if (pattern[i] != 0) {
- allZero = false;
- break;
- }
- }
-
- if (allZero) {
- hal_impl::CancelVibrate(WindowIdentifier());
- return;
- }
-
- AndroidBridge* b = AndroidBridge::Bridge();
- if (!b) {
- return;
- }
-
- b->Vibrate(pattern);
-}
-
-void
-CancelVibrate(const WindowIdentifier &)
-{
- // Ignore WindowIdentifier parameter.
-
- java::GeckoAppShell::CancelVibrate();
-}
-
-void
-EnableBatteryNotifications()
-{
- java::GeckoAppShell::EnableBatteryNotifications();
-}
-
-void
-DisableBatteryNotifications()
-{
- java::GeckoAppShell::DisableBatteryNotifications();
-}
-
-void
-GetCurrentBatteryInformation(hal::BatteryInformation* aBatteryInfo)
-{
- AndroidBridge::Bridge()->GetCurrentBatteryInformation(aBatteryInfo);
-}
-
-void
-EnableNetworkNotifications()
-{
- java::GeckoAppShell::EnableNetworkNotifications();
-}
-
-void
-DisableNetworkNotifications()
-{
- java::GeckoAppShell::DisableNetworkNotifications();
-}
-
-void
-GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInfo)
-{
- AndroidBridge::Bridge()->GetCurrentNetworkInformation(aNetworkInfo);
-}
-
-void
-EnableScreenConfigurationNotifications()
-{
- java::GeckoAppShell::EnableScreenOrientationNotifications();
-}
-
-void
-DisableScreenConfigurationNotifications()
-{
- java::GeckoAppShell::DisableScreenOrientationNotifications();
-}
-
-void
-GetCurrentScreenConfiguration(ScreenConfiguration* aScreenConfiguration)
-{
- AndroidBridge* bridge = AndroidBridge::Bridge();
- if (!bridge) {
- return;
- }
-
- nsresult rv;
- nsCOMPtr<nsIScreenManager> screenMgr =
- do_GetService("@mozilla.org/gfx/screenmanager;1", &rv);
- if (NS_FAILED(rv)) {
- NS_ERROR("Can't find nsIScreenManager!");
- return;
- }
-
- nsIntRect rect;
- int32_t colorDepth, pixelDepth;
- int16_t angle;
- ScreenOrientationInternal orientation;
- nsCOMPtr<nsIScreen> screen;
-
- screenMgr->GetPrimaryScreen(getter_AddRefs(screen));
- screen->GetRect(&rect.x, &rect.y, &rect.width, &rect.height);
- screen->GetColorDepth(&colorDepth);
- screen->GetPixelDepth(&pixelDepth);
- orientation = static_cast<ScreenOrientationInternal>(bridge->GetScreenOrientation());
- angle = bridge->GetScreenAngle();
-
- *aScreenConfiguration =
- hal::ScreenConfiguration(rect, orientation, angle, colorDepth, pixelDepth);
-}
-
-bool
-LockScreenOrientation(const ScreenOrientationInternal& aOrientation)
-{
- // Force the default orientation to be portrait-primary.
- ScreenOrientationInternal orientation =
- aOrientation == eScreenOrientation_Default ? eScreenOrientation_PortraitPrimary
- : aOrientation;
-
- switch (orientation) {
- // The Android backend only supports these orientations.
- case eScreenOrientation_PortraitPrimary:
- case eScreenOrientation_PortraitSecondary:
- case eScreenOrientation_PortraitPrimary | eScreenOrientation_PortraitSecondary:
- case eScreenOrientation_LandscapePrimary:
- case eScreenOrientation_LandscapeSecondary:
- case eScreenOrientation_LandscapePrimary | eScreenOrientation_LandscapeSecondary:
- case eScreenOrientation_Default:
- java::GeckoAppShell::LockScreenOrientation(orientation);
- return true;
- default:
- return false;
- }
-}
-
-void
-UnlockScreenOrientation()
-{
- java::GeckoAppShell::UnlockScreenOrientation();
-}
-
-} // hal_impl
-} // mozilla
-
diff --git a/hal/android/AndroidSensor.cpp b/hal/android/AndroidSensor.cpp
deleted file mode 100644
index cb1060342..000000000
--- a/hal/android/AndroidSensor.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "Hal.h"
-#include "GeneratedJNIWrappers.h"
-
-using namespace mozilla::hal;
-
-namespace mozilla {
-namespace hal_impl {
-
-void
-EnableSensorNotifications(SensorType aSensor) {
- java::GeckoAppShell::EnableSensor(aSensor);
-}
-
-void
-DisableSensorNotifications(SensorType aSensor) {
- java::GeckoAppShell::DisableSensor(aSensor);
-}
-
-} // hal_impl
-} // mozilla
diff --git a/hal/moz.build b/hal/moz.build
index 8d2950ac0..a1acfa320 100644
--- a/hal/moz.build
+++ b/hal/moz.build
@@ -25,21 +25,7 @@ SOURCES += [
'Hal.cpp',
]
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- LOCAL_INCLUDES += [
- '/widget/android',
- ]
- UNIFIED_SOURCES += [
- 'android/AndroidAlarm.cpp',
- 'android/AndroidSensor.cpp',
- 'fallback/FallbackPower.cpp',
- 'linux/LinuxMemory.cpp',
- ]
- # AndroidHal.cpp cannot be built in unified mode because it relies on HalImpl.h.
- SOURCES += [
- 'android/AndroidHal.cpp',
- ]
-elif CONFIG['OS_TARGET'] == 'Linux':
+if CONFIG['OS_TARGET'] == 'Linux':
UNIFIED_SOURCES += [
'fallback/FallbackAlarm.cpp',
'fallback/FallbackScreenConfiguration.cpp',
@@ -117,11 +103,9 @@ UNIFIED_SOURCES += [
'fallback/FallbackWakeLocks.cpp',
]
-# Fallbacks for backends implemented on Android only.
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
- UNIFIED_SOURCES += [
- 'fallback/FallbackNetwork.cpp',
- ]
+UNIFIED_SOURCES += [
+ 'fallback/FallbackNetwork.cpp',
+]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
UNIFIED_SOURCES += [
diff --git a/image/decoders/icon/android/moz.build b/image/decoders/icon/android/moz.build
deleted file mode 100644
index 5e58ff0b6..000000000
--- a/image/decoders/icon/android/moz.build
+++ /dev/null
@@ -1,13 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SOURCES += [
- 'nsIconChannel.cpp',
-]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
diff --git a/image/decoders/icon/android/nsIconChannel.cpp b/image/decoders/icon/android/nsIconChannel.cpp
deleted file mode 100644
index 5670bf2f9..000000000
--- a/image/decoders/icon/android/nsIconChannel.cpp
+++ /dev/null
@@ -1,145 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdlib.h>
-#include "mozilla/dom/ContentChild.h"
-#include "nsMimeTypes.h"
-#include "nsIURL.h"
-#include "nsXULAppAPI.h"
-#include "AndroidBridge.h"
-#include "nsIconChannel.h"
-#include "nsIStringStream.h"
-#include "nsNetUtil.h"
-#include "nsComponentManagerUtils.h"
-#include "nsNullPrincipal.h"
-
-NS_IMPL_ISUPPORTS(nsIconChannel,
- nsIRequest,
- nsIChannel)
-
-using namespace mozilla;
-using mozilla::dom::ContentChild;
-
-static nsresult
-GetIconForExtension(const nsACString& aFileExt, uint32_t aIconSize,
- uint8_t* const aBuf)
-{
- if (!AndroidBridge::Bridge()) {
- return NS_ERROR_FAILURE;
- }
-
- AndroidBridge::Bridge()->GetIconForExtension(aFileExt, aIconSize, aBuf);
-
- return NS_OK;
-}
-
-static nsresult
-CallRemoteGetIconForExtension(const nsACString& aFileExt, uint32_t aIconSize,
- uint8_t* const aBuf)
-{
- NS_ENSURE_TRUE(aBuf != nullptr, NS_ERROR_NULL_POINTER);
-
- // An array has to be used to get data from remote process
- InfallibleTArray<uint8_t> bits;
- uint32_t bufSize = aIconSize * aIconSize * 4;
-
- if (!ContentChild::GetSingleton()->SendGetIconForExtension(
- PromiseFlatCString(aFileExt), aIconSize, &bits)) {
- return NS_ERROR_FAILURE;
- }
-
- NS_ASSERTION(bits.Length() == bufSize, "Pixels array is incomplete");
- if (bits.Length() != bufSize) {
- return NS_ERROR_FAILURE;
- }
-
- memcpy(aBuf, bits.Elements(), bufSize);
-
- return NS_OK;
-}
-
-static nsresult
-moz_icon_to_channel(nsIURI* aURI, const nsACString& aFileExt,
- uint32_t aIconSize, nsIChannel** aChannel)
-{
- NS_ENSURE_TRUE(aIconSize < 256 && aIconSize > 0, NS_ERROR_UNEXPECTED);
-
- int width = aIconSize;
- int height = aIconSize;
-
- // moz-icon data should have two bytes for the size,
- // then the ARGB pixel values with pre-multiplied Alpha
- const int channels = 4;
- long int buf_size = 2 + channels * height * width;
- uint8_t* const buf = (uint8_t*)moz_xmalloc(buf_size);
- NS_ENSURE_TRUE(buf, NS_ERROR_OUT_OF_MEMORY);
- uint8_t* out = buf;
-
- *(out++) = width;
- *(out++) = height;
-
- nsresult rv;
- if (XRE_IsParentProcess()) {
- rv = GetIconForExtension(aFileExt, aIconSize, out);
- } else {
- rv = CallRemoteGetIconForExtension(aFileExt, aIconSize, out);
- }
- NS_ENSURE_SUCCESS(rv, rv);
-
- // Encode the RGBA data
- const uint8_t* in = out;
- for (int y = 0; y < height; ++y) {
- for (int x = 0; x < width; ++x) {
- uint8_t r = *(in++);
- uint8_t g = *(in++);
- uint8_t b = *(in++);
- uint8_t a = *(in++);
-#define DO_PREMULTIPLY(c_) uint8_t(uint16_t(c_) * uint16_t(a) / uint16_t(255))
- *(out++) = DO_PREMULTIPLY(b);
- *(out++) = DO_PREMULTIPLY(g);
- *(out++) = DO_PREMULTIPLY(r);
- *(out++) = a;
-#undef DO_PREMULTIPLY
- }
- }
-
- nsCOMPtr<nsIStringInputStream> stream =
- do_CreateInstance("@mozilla.org/io/string-input-stream;1", &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = stream->AdoptData((char*)buf, buf_size);
- NS_ENSURE_SUCCESS(rv, rv);
-
- // nsIconProtocolHandler::NewChannel2 will provide the correct loadInfo for
- // this iconChannel. Use the most restrictive security settings for the
- // temporary loadInfo to make sure the channel can not be openend.
- nsCOMPtr<nsIPrincipal> nullPrincipal = nsNullPrincipal::Create();
- return NS_NewInputStreamChannel(aChannel,
- aURI,
- stream,
- nullPrincipal,
- nsILoadInfo::SEC_REQUIRE_SAME_ORIGIN_DATA_IS_BLOCKED,
- nsIContentPolicy::TYPE_INTERNAL_IMAGE,
- NS_LITERAL_CSTRING(IMAGE_ICON_MS));
-}
-
-nsresult
-nsIconChannel::Init(nsIURI* aURI)
-{
- nsCOMPtr<nsIMozIconURI> iconURI = do_QueryInterface(aURI);
- NS_ASSERTION(iconURI, "URI is not an nsIMozIconURI");
-
- nsAutoCString stockIcon;
- iconURI->GetStockIcon(stockIcon);
-
- uint32_t desiredImageSize;
- iconURI->GetImageSize(&desiredImageSize);
-
- nsAutoCString iconFileExt;
- iconURI->GetFileExtension(iconFileExt);
-
- return moz_icon_to_channel(iconURI, iconFileExt, desiredImageSize,
- getter_AddRefs(mRealChannel));
-}
diff --git a/image/decoders/icon/android/nsIconChannel.h b/image/decoders/icon/android/nsIconChannel.h
deleted file mode 100644
index be5542998..000000000
--- a/image/decoders/icon/android/nsIconChannel.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_image_decoders_icon_android_nsIconChannel_h
-#define mozilla_image_decoders_icon_android_nsIconChannel_h
-
-#include "mozilla/Attributes.h"
-
-#include "nsIChannel.h"
-#include "nsIURI.h"
-#include "nsIIconURI.h"
-#include "nsCOMPtr.h"
-
-/**
- * This class is the Android implementation of nsIconChannel.
- * It asks Android for an icon, and creates a new channel for
- * that file to which all calls will be proxied.
- */
-class nsIconChannel final : public nsIChannel {
- public:
- NS_DECL_ISUPPORTS
- NS_FORWARD_NSIREQUEST(mRealChannel->)
- NS_FORWARD_NSICHANNEL(mRealChannel->)
-
- nsIconChannel() { }
-
- /**
- * Called by nsIconProtocolHandler after it creates this channel.
- * Must be called before calling any other function on this object.
- * If this method fails, no other function must be called on this object.
- */
- nsresult Init(nsIURI* aURI);
-
- private:
- ~nsIconChannel() { }
-
- /**
- * The channel to the temp icon file (e.g. to /tmp/2qy9wjqw.html).
- * Will always be non-null after a successful Init.
- */
- nsCOMPtr<nsIChannel> mRealChannel;
-};
-
-#endif // mozilla_image_decoders_icon_android_nsIconChannel_h
diff --git a/image/decoders/icon/moz.build b/image/decoders/icon/moz.build
index 9c6106fa7..d06d6aa6f 100644
--- a/image/decoders/icon/moz.build
+++ b/image/decoders/icon/moz.build
@@ -25,8 +25,5 @@ if CONFIG['OS_ARCH'] == 'WINNT':
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
platform = 'mac'
-if CONFIG['OS_TARGET'] == 'Android':
- platform = 'android'
-
if platform:
LOCAL_INCLUDES += [platform]
diff --git a/image/decoders/moz.build b/image/decoders/moz.build
index 30c026f99..de7aa7ae8 100644
--- a/image/decoders/moz.build
+++ b/image/decoders/moz.build
@@ -16,8 +16,6 @@ if CONFIG['OS_ARCH'] == 'WINNT':
if toolkit == 'cocoa':
DIRS += ['icon/mac', 'icon']
-elif toolkit == 'android':
- DIRS += ['icon/android', 'icon']
UNIFIED_SOURCES += [
'EXIF.cpp',
diff --git a/intl/locale/nsLocaleService.cpp b/intl/locale/nsLocaleService.cpp
index 6d45ec9af..d81fb50c2 100644
--- a/intl/locale/nsLocaleService.cpp
+++ b/intl/locale/nsLocaleService.cpp
@@ -134,11 +134,6 @@ nsLocaleService::nsLocaleService(void)
bool lc_temp_valid = lc_temp != nullptr;
-#if defined(MOZ_WIDGET_ANDROID)
- // Treat the "C" env as nothing useful. See Bug 1095298.
- lc_temp_valid = lc_temp_valid && strcmp(lc_temp, "C") != 0;
-#endif
-
if (lc_temp_valid) {
result = nsPosixLocale::GetXPLocale(lc_temp, xpLocale);
CopyASCIItoUTF16(lc_temp, platformLocale);
diff --git a/ipc/app/Makefile.in b/ipc/app/Makefile.in
index d5593724c..c25119ac3 100644
--- a/ipc/app/Makefile.in
+++ b/ipc/app/Makefile.in
@@ -18,10 +18,6 @@ include $(topsrcdir)/config/config.mk
include $(topsrcdir)/config/rules.mk
-ifneq ($(MOZ_WIDGET_TOOLKIT),android)
-#LIBS += ../contentproc/$(LIB_PREFIX)plugin-container.$(LIB_SUFFIX)
-endif
-
ifeq ($(OS_ARCH),WINNT) #{
# Note the manifest file exists in the tree, so we use the explicit filename
# here.
diff --git a/ipc/app/MozillaRuntimeMainAndroid.cpp b/ipc/app/MozillaRuntimeMainAndroid.cpp
deleted file mode 100644
index 81b89eef5..000000000
--- a/ipc/app/MozillaRuntimeMainAndroid.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: sw=4 ts=4 et :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <dlfcn.h>
-#include <android/log.h>
-
-int
-main(int argc, char* argv[])
-{
- // Check for the absolute minimum number of args we need to move
- // forward here. We expect the last arg to be the child process type.
- if (argc < 2)
- return 1;
-
- void *mozloader_handle = dlopen("libmozglue.so", RTLD_LAZY);
- if (!mozloader_handle) {
- __android_log_print(ANDROID_LOG_ERROR, "GeckoChildLoad",
- "Couldn't load mozloader because %s", dlerror());
- return 1;
- }
-
- typedef int (*ChildProcessInit_t)(int, char**);
- ChildProcessInit_t fChildProcessInit =
- (ChildProcessInit_t)dlsym(mozloader_handle, "ChildProcessInit");
- if (!fChildProcessInit) {
- __android_log_print(ANDROID_LOG_ERROR, "GeckoChildLoad",
- "Couldn't load cpi_t because %s", dlerror());
- return 1;
- }
-
- return fChildProcessInit(argc, argv);
-}
diff --git a/ipc/app/moz.build b/ipc/app/moz.build
index 3e6461584..306446a86 100644
--- a/ipc/app/moz.build
+++ b/ipc/app/moz.build
@@ -4,21 +4,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-# Any changes that affect Android need to be made in pie/moz.build as well.
+GeckoProgram(CONFIG['MOZ_CHILD_PROCESS_NAME'], linkage='dependent')
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- Program(CONFIG['MOZ_CHILD_PROCESS_NAME'])
- SOURCES += [
- 'MozillaRuntimeMainAndroid.cpp',
- ]
-
- DIRS += ['pie']
-else:
- GeckoProgram(CONFIG['MOZ_CHILD_PROCESS_NAME'], linkage='dependent')
-
- SOURCES += [
- 'MozillaRuntimeMain.cpp',
- ]
+SOURCES += [
+ 'MozillaRuntimeMain.cpp',
+]
include('/ipc/chromium/chromium-config.mozbuild')
@@ -29,13 +19,12 @@ LOCAL_INCLUDES += [
# We link GMPLoader into plugin-container on desktop so that its code is
# covered by the desktop DRM vendor's voucher.
-if CONFIG['OS_TARGET'] != 'Android':
- SOURCES += [
- '../../dom/media/gmp/GMPLoader.cpp',
- ]
- USE_LIBS += [
- 'rlz',
- ]
+SOURCES += [
+ '../../dom/media/gmp/GMPLoader.cpp',
+]
+USE_LIBS += [
+ 'rlz',
+]
# DELAYLOAD_DLLS in this block ensures that the DLL blocklist is functional
if CONFIG['OS_ARCH'] == 'WINNT':
diff --git a/ipc/app/pie/moz.build b/ipc/app/pie/moz.build
deleted file mode 100644
index 6924199b5..000000000
--- a/ipc/app/pie/moz.build
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-Program(CONFIG['MOZ_CHILD_PROCESS_NAME_PIE'])
-SOURCES += [
- '../MozillaRuntimeMainAndroid.cpp',
-]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-LOCAL_INCLUDES += [
- '/toolkit/xre',
- '/xpcom/base',
-]
-
-LDFLAGS += ['-pie']
diff --git a/ipc/chromium/src/build/build_config.h b/ipc/chromium/src/build/build_config.h
index 7e6beb37a..7a41701c2 100644
--- a/ipc/chromium/src/build/build_config.h
+++ b/ipc/chromium/src/build/build_config.h
@@ -85,7 +85,7 @@
#elif defined(__ppc__) || defined(__powerpc__)
#define ARCH_CPU_PPC 1
#define ARCH_CPU_32_BITS 1
-#elif defined(__sparc64__)
+#elif defined(__sparc__) && defined(__arch64__)
#define ARCH_CPU_SPARC 1
#define ARCH_CPU_64_BITS 1
#elif defined(__sparc__)
diff --git a/ipc/contentproc/plugin-container.cpp b/ipc/contentproc/plugin-container.cpp
index 2fb9bd4f5..0e59e9d7a 100644
--- a/ipc/contentproc/plugin-container.cpp
+++ b/ipc/contentproc/plugin-container.cpp
@@ -50,7 +50,7 @@ content_process_main(int argc, char* argv[])
SetDllDirectoryW(L"");
}
#endif
-#if !defined(MOZ_WIDGET_ANDROID) && defined(MOZ_PLUGIN_CONTAINER)
+#ifdef MOZ_PLUGIN_CONTAINER
// On desktop, the GMPLoader lives in plugin-container, so that its
// code can be covered by an EME/GMP vendor's voucher.
nsAutoPtr<mozilla::gmp::SandboxStarter> starter(MakeSandboxStarter());
diff --git a/ipc/glue/GeckoChildProcessHost.cpp b/ipc/glue/GeckoChildProcessHost.cpp
index ea76f85f0..a14be5693 100644
--- a/ipc/glue/GeckoChildProcessHost.cpp
+++ b/ipc/glue/GeckoChildProcessHost.cpp
@@ -47,17 +47,6 @@
using mozilla::MonitorAutoLock;
using mozilla::ipc::GeckoChildProcessHost;
-#ifdef ANDROID
-// Like its predecessor in nsExceptionHandler.cpp, this is
-// the magic number of a file descriptor remapping we must
-// preserve for the child process.
-static const int kMagicAndroidSystemPropFd = 5;
-#endif
-
-#ifdef MOZ_WIDGET_ANDROID
-#include "AndroidBridge.h"
-#endif
-
static const bool kLowRightsSubprocesses =
// We only attempted to drop privileges on gonk, because it
// had no plugins or extensions to worry about breaking.
@@ -170,17 +159,7 @@ GeckoChildProcessHost::GetPathToBinary(FilePath& exePath, GeckoProcessType proce
exePath = exePath.DirName();
}
-#ifdef MOZ_WIDGET_ANDROID
- exePath = exePath.AppendASCII("lib");
-
- // We must use the PIE binary on 5.0 and higher
- const char* processName = mozilla::AndroidBridge::Bridge()->GetAPIVersion() >= 21 ?
- MOZ_CHILD_PROCESS_NAME_PIE : MOZ_CHILD_PROCESS_NAME;
-
- exePath = exePath.AppendASCII(processName);
-#else
exePath = exePath.AppendASCII(MOZ_CHILD_PROCESS_NAME);
-#endif
return BinaryPathType::PluginContainer;
}
@@ -622,9 +601,6 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt
nsCString path;
NS_CopyUnicodeToNative(nsDependentString(gGREBinPath), path);
# if defined(OS_LINUX) || defined(OS_BSD)
-# if defined(MOZ_WIDGET_ANDROID)
- path += "/lib";
-# endif // MOZ_WIDGET_ANDROID
const char *ld_library_path = PR_GetEnv("LD_LIBRARY_PATH");
nsCString new_ld_lib_path(path.get());
@@ -668,28 +644,6 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt
FilePath exePath;
BinaryPathType pathType = GetPathToBinary(exePath, mProcessType);
-#ifdef MOZ_WIDGET_ANDROID
- // The java wrapper unpacks this for us but can't make it executable
- chmod(exePath.value().c_str(), 0700);
-#endif // MOZ_WIDGET_ANDROID
-
-#ifdef ANDROID
- // Remap the Android property workspace to a well-known int,
- // and update the environment to reflect the new value for the
- // child process.
- const char *apws = getenv("ANDROID_PROPERTY_WORKSPACE");
- if (apws) {
- int fd = atoi(apws);
- mFileMap.push_back(std::pair<int, int>(fd, kMagicAndroidSystemPropFd));
-
- char buf[32];
- char *szptr = strchr(apws, ',');
-
- snprintf(buf, sizeof(buf), "%d%s", kMagicAndroidSystemPropFd, szptr);
- newEnvVars["ANDROID_PROPERTY_WORKSPACE"] = buf;
- }
-#endif // ANDROID
-
// remap the IPC socket fd to a well-known int, as the OS does for
// STDOUT_FILENO, for example
int srcChannelFd, dstChannelFd;
@@ -712,6 +666,7 @@ GeckoChildProcessHost::PerformAsyncLaunchInternal(std::vector<std::string>& aExt
if (Omnijar::IsInitialized()) {
// Make sure that child processes can find the omnijar
// See XRE_InitCommandLine in nsAppRunner.cpp
+ newEnvVars["UXP_CUSTOM_OMNI"] = 1;
nsAutoCString path;
nsCOMPtr<nsIFile> file = Omnijar::GetPath(Omnijar::GRE);
if (file && NS_SUCCEEDED(file->GetNativePath(path))) {
diff --git a/ipc/glue/ProtocolUtils.cpp b/ipc/glue/ProtocolUtils.cpp
index 7d8a1153c..eb18bb987 100644
--- a/ipc/glue/ProtocolUtils.cpp
+++ b/ipc/glue/ProtocolUtils.cpp
@@ -183,9 +183,7 @@ LogMessageForProtocol(const char* aTopLevelProtocol, base::ProcessId aOtherPid,
aOtherPid, aTopLevelProtocol,
aContextDescription,
StringFromIPCMessageType(aMessageId));
-#ifdef ANDROID
- __android_log_write(ANDROID_LOG_INFO, "GeckoIPC", logMessage.get());
-#endif
+
fputs(logMessage.get(), stderr);
}
diff --git a/ipc/glue/ProtocolUtils.h b/ipc/glue/ProtocolUtils.h
index 83860d93a..e22f16c1c 100644
--- a/ipc/glue/ProtocolUtils.h
+++ b/ipc/glue/ProtocolUtils.h
@@ -27,10 +27,6 @@
#include "mozilla/UniquePtr.h"
#include "MainThreadUtils.h"
-#if defined(ANDROID) && defined(DEBUG)
-#include <android/log.h>
-#endif
-
template<typename T> class nsTHashtable;
template<typename T> class nsPtrHashKey;
diff --git a/ipc/glue/SharedMemoryBasic.h b/ipc/glue/SharedMemoryBasic.h
index d8720271f..2bf4a93a0 100644
--- a/ipc/glue/SharedMemoryBasic.h
+++ b/ipc/glue/SharedMemoryBasic.h
@@ -7,9 +7,7 @@
#ifndef mozilla_ipc_SharedMemoryBasic_h
#define mozilla_ipc_SharedMemoryBasic_h
-#ifdef ANDROID
-# include "mozilla/ipc/SharedMemoryBasic_android.h"
-#elif defined(XP_DARWIN)
+#ifdef XP_DARWIN
# include "mozilla/ipc/SharedMemoryBasic_mach.h"
#else
# include "mozilla/ipc/SharedMemoryBasic_chromium.h"
diff --git a/ipc/glue/SharedMemoryBasic_android.cpp b/ipc/glue/SharedMemoryBasic_android.cpp
deleted file mode 100644
index 05c9ca9ad..000000000
--- a/ipc/glue/SharedMemoryBasic_android.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <android/log.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <string.h>
-#include <sys/ioctl.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "base/process_util.h"
-
-#include "SharedMemoryBasic.h"
-
-//
-// Temporarily go directly to the kernel interface until we can
-// interact better with libcutils.
-//
-#include <linux/ashmem.h>
-
-namespace mozilla {
-namespace ipc {
-
-static void
-LogError(const char* what)
-{
- __android_log_print(ANDROID_LOG_ERROR, "Gecko",
- "%s: %s (%d)", what, strerror(errno), errno);
-}
-
-SharedMemoryBasic::SharedMemoryBasic()
- : mShmFd(-1)
- , mMemory(nullptr)
-{ }
-
-SharedMemoryBasic::~SharedMemoryBasic()
-{
- Unmap();
- CloseHandle();
-}
-
-bool
-SharedMemoryBasic::SetHandle(const Handle& aHandle)
-{
- MOZ_ASSERT(-1 == mShmFd, "Already Create()d");
- mShmFd = aHandle.fd;
- return true;
-}
-
-bool
-SharedMemoryBasic::Create(size_t aNbytes)
-{
- MOZ_ASSERT(-1 == mShmFd, "Already Create()d");
-
- // Carve a new instance off of /dev/ashmem
- int shmfd = open("/" ASHMEM_NAME_DEF, O_RDWR, 0600);
- if (-1 == shmfd) {
- LogError("ShmemAndroid::Create():open");
- return false;
- }
-
- if (ioctl(shmfd, ASHMEM_SET_SIZE, aNbytes)) {
- LogError("ShmemAndroid::Unmap():ioctl(SET_SIZE)");
- close(shmfd);
- return false;
- }
-
- mShmFd = shmfd;
- Created(aNbytes);
- return true;
-}
-
-bool
-SharedMemoryBasic::Map(size_t nBytes)
-{
- MOZ_ASSERT(nullptr == mMemory, "Already Map()d");
-
- mMemory = mmap(nullptr, nBytes,
- PROT_READ | PROT_WRITE,
- MAP_SHARED,
- mShmFd,
- 0);
- if (MAP_FAILED == mMemory) {
- LogError("ShmemAndroid::Map()");
- mMemory = nullptr;
- return false;
- }
-
- Mapped(nBytes);
- return true;
-}
-
-bool
-SharedMemoryBasic::ShareToProcess(base::ProcessId/*unused*/,
- Handle* aNewHandle)
-{
- MOZ_ASSERT(mShmFd >= 0, "Should have been Create()d by now");
-
- int shmfdDup = dup(mShmFd);
- if (-1 == shmfdDup) {
- LogError("ShmemAndroid::ShareToProcess()");
- return false;
- }
-
- aNewHandle->fd = shmfdDup;
- aNewHandle->auto_close = true;
- return true;
-}
-
-void
-SharedMemoryBasic::Unmap()
-{
- if (!mMemory) {
- return;
- }
-
- if (munmap(mMemory, Size())) {
- LogError("ShmemAndroid::Unmap()");
- }
- mMemory = nullptr;
-}
-
-void
-SharedMemoryBasic::CloseHandle()
-{
- if (mShmFd != -1) {
- close(mShmFd);
- mShmFd = -1;
- }
-}
-
-} // namespace ipc
-} // namespace mozilla
diff --git a/ipc/glue/SharedMemoryBasic_android.h b/ipc/glue/SharedMemoryBasic_android.h
deleted file mode 100644
index 488390d9f..000000000
--- a/ipc/glue/SharedMemoryBasic_android.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_ipc_SharedMemoryBasic_android_h
-#define mozilla_ipc_SharedMemoryBasic_android_h
-
-#include "base/file_descriptor_posix.h"
-
-#include "SharedMemory.h"
-
-//
-// This is a low-level wrapper around platform shared memory. Don't
-// use it directly; use Shmem allocated through IPDL interfaces.
-//
-
-namespace mozilla {
-namespace ipc {
-
-class SharedMemoryBasic final : public SharedMemoryCommon<base::FileDescriptor>
-{
-public:
- SharedMemoryBasic();
-
- virtual bool SetHandle(const Handle& aHandle) override;
-
- virtual bool Create(size_t aNbytes) override;
-
- virtual bool Map(size_t nBytes) override;
-
- virtual void CloseHandle() override;
-
- virtual void* memory() const override
- {
- return mMemory;
- }
-
- virtual SharedMemoryType Type() const override
- {
- return TYPE_BASIC;
- }
-
- static Handle NULLHandle()
- {
- return Handle();
- }
-
- virtual bool IsHandleValid(const Handle &aHandle) const override
- {
- return aHandle.fd >= 0;
- }
-
- virtual bool ShareToProcess(base::ProcessId aProcessId,
- Handle* aNewHandle) override;
-
-private:
- ~SharedMemoryBasic();
-
- void Unmap();
-
- // The /dev/ashmem fd we allocate.
- int mShmFd;
- // Pointer to mapped region, null if unmapped.
- void *mMemory;
-};
-
-} // namespace ipc
-} // namespace mozilla
-
-#endif // ifndef mozilla_ipc_SharedMemoryBasic_android_h
diff --git a/ipc/glue/moz.build b/ipc/glue/moz.build
index 85d7f8fa0..51e6538ff 100644
--- a/ipc/glue/moz.build
+++ b/ipc/glue/moz.build
@@ -78,15 +78,7 @@ else:
'CrossProcessMutex_unimplemented.cpp',
]
-# Android has its own,
-# almost-but-not-quite-compatible-with-POSIX-or-/dev/shm shared memory
-# impl.
-if CONFIG['OS_TARGET'] == 'Android':
- EXPORTS.mozilla.ipc += ['SharedMemoryBasic_android.h']
- UNIFIED_SOURCES += [
- 'SharedMemoryBasic_android.cpp',
- ]
-elif CONFIG['OS_ARCH'] == 'Darwin':
+if CONFIG['OS_ARCH'] == 'Darwin':
EXPORTS.mozilla.ipc += ['SharedMemoryBasic_mach.h']
SOURCES += [
'SharedMemoryBasic_mach.mm',
diff --git a/ipc/moz.build b/ipc/moz.build
index 320d8c5f0..4c9fb6b38 100644
--- a/ipc/moz.build
+++ b/ipc/moz.build
@@ -6,6 +6,7 @@
DIRS += [
'chromium',
+ 'contentproc',
'glue',
'ipdl',
'testshell',
@@ -14,9 +15,6 @@ DIRS += [
if CONFIG['MOZ_ENABLE_DBUS']:
DIRS += ['dbus']
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
- DIRS += ['contentproc']
-
if CONFIG['OS_ARCH'] == 'WINNT':
DIRS += ['mscom']
diff --git a/ipc/testshell/XPCShellEnvironment.cpp b/ipc/testshell/XPCShellEnvironment.cpp
index 455a14610..beb9667b2 100644
--- a/ipc/testshell/XPCShellEnvironment.cpp
+++ b/ipc/testshell/XPCShellEnvironment.cpp
@@ -55,7 +55,7 @@ namespace {
static const char kDefaultRuntimeScriptFilename[] = "xpcshell.js";
inline XPCShellEnvironment*
-Environment(Handle<JSObject*> global)
+Environment(JS::Handle<JSObject*> global)
{
AutoJSAPI jsapi;
if (!jsapi.Init(global)) {
diff --git a/devtools/shared/jsinspector/moz.build b/js/ductwork/inspector/moz.build
index fc81f7e1e..fc81f7e1e 100644
--- a/devtools/shared/jsinspector/moz.build
+++ b/js/ductwork/inspector/moz.build
diff --git a/devtools/shared/jsinspector/nsIJSInspector.idl b/js/ductwork/inspector/nsIJSInspector.idl
index 40ad49523..40ad49523 100644
--- a/devtools/shared/jsinspector/nsIJSInspector.idl
+++ b/js/ductwork/inspector/nsIJSInspector.idl
diff --git a/devtools/shared/jsinspector/nsJSInspector.cpp b/js/ductwork/inspector/nsJSInspector.cpp
index 457e64c08..457e64c08 100644
--- a/devtools/shared/jsinspector/nsJSInspector.cpp
+++ b/js/ductwork/inspector/nsJSInspector.cpp
diff --git a/devtools/shared/jsinspector/nsJSInspector.h b/js/ductwork/inspector/nsJSInspector.h
index 4e60b0428..4e60b0428 100644
--- a/devtools/shared/jsinspector/nsJSInspector.h
+++ b/js/ductwork/inspector/nsJSInspector.h
diff --git a/toolkit/themes/mobile/moz.build b/js/ductwork/moz.build
index aac3a838c..fcf79a4cd 100644
--- a/toolkit/themes/mobile/moz.build
+++ b/js/ductwork/moz.build
@@ -4,4 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-JAR_MANIFESTS += ['jar.mn']
+DIRS += [
+ 'debugger',
+ 'inspector',
+]
diff --git a/js/public/HeapAPI.h b/js/public/HeapAPI.h
index e37d13e93..fef6c0c78 100644
--- a/js/public/HeapAPI.h
+++ b/js/public/HeapAPI.h
@@ -392,6 +392,7 @@ IsIncrementalBarrierNeededOnTenuredGCThing(JS::shadow::Runtime* rt, const JS::GC
return JS::shadow::Zone::asShadowZone(zone)->needsIncrementalBarrier();
}
+#ifdef MOZ_DEVTOOLS_SERVER
/**
* Create an object providing access to the garbage collector's internal notion
* of the current state of memory (both GC heap memory and GCthing-controlled
@@ -399,6 +400,7 @@ IsIncrementalBarrierNeededOnTenuredGCThing(JS::shadow::Runtime* rt, const JS::GC
*/
extern JS_PUBLIC_API(JSObject*)
NewMemoryInfoObject(JSContext* cx);
+#endif
} /* namespace gc */
} /* namespace js */
diff --git a/js/src/builtin/ModuleObject.cpp b/js/src/builtin/ModuleObject.cpp
index 575bab0b0..b275cb968 100644
--- a/js/src/builtin/ModuleObject.cpp
+++ b/js/src/builtin/ModuleObject.cpp
@@ -927,7 +927,7 @@ ModuleObject::evaluate(JSContext* cx, HandleModuleObject self, MutableHandleValu
ModuleObject::createNamespace(JSContext* cx, HandleModuleObject self, HandleObject exports)
{
MOZ_ASSERT(!self->namespace_());
- MOZ_ASSERT(exports->is<ArrayObject>());
+ MOZ_ASSERT(exports->is<ArrayObject>() || exports->is<UnboxedArrayObject>());
RootedModuleNamespaceObject ns(cx, ModuleNamespaceObject::create(cx, self));
if (!ns)
diff --git a/js/src/builtin/ReflectParse.cpp b/js/src/builtin/ReflectParse.cpp
index 22c958d4c..a8065d6d1 100644
--- a/js/src/builtin/ReflectParse.cpp
+++ b/js/src/builtin/ReflectParse.cpp
@@ -1547,7 +1547,7 @@ NodeBuilder::catchClause(HandleValue var, HandleValue guard, HandleValue body, T
{
RootedValue cb(cx, callbacks[AST_CATCH]);
if (!cb.isNull())
- return callback(cb, var, opt(guard), body, pos, dst);
+ return callback(cb, opt(var), opt(guard), body, pos, dst);
return newNode(AST_CATCH, pos,
"param", var,
@@ -1803,6 +1803,14 @@ class ASTSerializer
bool identifier(ParseNode* pn, MutableHandleValue dst);
bool literal(ParseNode* pn, MutableHandleValue dst);
+ bool optPattern(ParseNode* pn, MutableHandleValue dst) {
+ if (!pn) {
+ dst.setMagic(JS_SERIALIZE_NO_NODE);
+ return true;
+ }
+ return pattern(pn, dst);
+ }
+
bool pattern(ParseNode* pn, MutableHandleValue dst);
bool arrayPattern(ParseNode* pn, MutableHandleValue dst);
bool objectPattern(ParseNode* pn, MutableHandleValue dst);
@@ -2265,13 +2273,13 @@ ASTSerializer::switchStatement(ParseNode* pn, MutableHandleValue dst)
bool
ASTSerializer::catchClause(ParseNode* pn, bool* isGuarded, MutableHandleValue dst)
{
- MOZ_ASSERT(pn->pn_pos.encloses(pn->pn_kid1->pn_pos));
+ MOZ_ASSERT_IF(pn->pn_kid1, pn->pn_pos.encloses(pn->pn_kid1->pn_pos));
MOZ_ASSERT_IF(pn->pn_kid2, pn->pn_pos.encloses(pn->pn_kid2->pn_pos));
MOZ_ASSERT(pn->pn_pos.encloses(pn->pn_kid3->pn_pos));
RootedValue var(cx), guard(cx), body(cx);
- if (!pattern(pn->pn_kid1, &var) ||
+ if (!optPattern(pn->pn_kid1, &var) ||
!optExpression(pn->pn_kid2, &guard)) {
return false;
}
diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp
index f4574b248..18cc7d954 100644
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -3459,10 +3459,12 @@ BytecodeEmitter::checkSideEffects(ParseNode* pn, bool* answer)
case PNK_CATCH:
MOZ_ASSERT(pn->isArity(PN_TERNARY));
- if (!checkSideEffects(pn->pn_kid1, answer))
- return false;
- if (*answer)
- return true;
+ if (ParseNode* name = pn->pn_kid1) {
+ if (!checkSideEffects(name, answer))
+ return false;
+ if (*answer)
+ return true;
+ }
if (ParseNode* cond = pn->pn_kid2) {
if (!checkSideEffects(cond, answer))
return false;
@@ -6495,8 +6497,8 @@ ParseNode::getConstantValue(ExclusiveContext* cx, AllowConstantObjects allowObje
}
MOZ_ASSERT(idx == count);
- ArrayObject* obj = ObjectGroup::newArrayObject(cx, values.begin(), values.length(),
- newKind, arrayKind);
+ JSObject* obj = ObjectGroup::newArrayObject(cx, values.begin(), values.length(),
+ newKind, arrayKind);
if (!obj)
return false;
@@ -6638,24 +6640,31 @@ BytecodeEmitter::emitCatch(ParseNode* pn)
return false;
ParseNode* pn2 = pn->pn_kid1;
- switch (pn2->getKind()) {
- case PNK_ARRAY:
- case PNK_OBJECT:
- if (!emitDestructuringOps(pn2, DestructuringDeclaration))
- return false;
- if (!emit1(JSOP_POP))
- return false;
- break;
-
- case PNK_NAME:
- if (!emitLexicalInitialization(pn2))
- return false;
- if (!emit1(JSOP_POP))
- return false;
- break;
-
- default:
- MOZ_ASSERT(0);
+ if (!pn2) {
+ // See ES2019 13.15.7 Runtime Semantics: CatchClauseEvaluation
+ // Catch variable was omitted: discard the exception.
+ if (!emit1(JSOP_POP))
+ return false;
+ } else {
+ switch (pn2->getKind()) {
+ case PNK_ARRAY:
+ case PNK_OBJECT:
+ if (!emitDestructuringOps(pn2, DestructuringDeclaration))
+ return false;
+ if (!emit1(JSOP_POP))
+ return false;
+ break;
+
+ case PNK_NAME:
+ if (!emitLexicalInitialization(pn2))
+ return false;
+ if (!emit1(JSOP_POP))
+ return false;
+ break;
+
+ default:
+ MOZ_ASSERT(0);
+ }
}
// If there is a guard expression, emit it and arrange to jump to the next
@@ -6899,7 +6908,9 @@ BytecodeEmitter::emitLexicalScope(ParseNode* pn)
EmitterScope emitterScope(this);
ScopeKind kind;
if (body->isKind(PNK_CATCH))
- kind = body->pn_kid1->isKind(PNK_NAME) ? ScopeKind::SimpleCatch : ScopeKind::Catch;
+ kind = (!body->pn_kid1 || body->pn_kid1->isKind(PNK_NAME)) ?
+ ScopeKind::SimpleCatch :
+ ScopeKind::Catch;
else
kind = ScopeKind::Lexical;
@@ -9623,7 +9634,7 @@ BytecodeEmitter::emitCallOrNew(ParseNode* pn, ValueUsage valueUsage /* = ValueUs
return false;
}
- if (!emitArray(args, argc))
+ if (!emitArray(args, argc, JSOP_SPREADCALLARRAY))
return false;
if (optCodeEmitted) {
@@ -10138,11 +10149,11 @@ BytecodeEmitter::emitArrayLiteral(ParseNode* pn)
}
}
- return emitArray(pn->pn_head, pn->pn_count);
+ return emitArray(pn->pn_head, pn->pn_count, JSOP_NEWARRAY);
}
bool
-BytecodeEmitter::emitArray(ParseNode* pn, uint32_t count)
+BytecodeEmitter::emitArray(ParseNode* pn, uint32_t count, JSOp op)
{
/*
@@ -10153,6 +10164,7 @@ BytecodeEmitter::emitArray(ParseNode* pn, uint32_t count)
* to avoid dup'ing and popping the array as each element is added, as
* JSOP_SETELEM/JSOP_SETPROP would do.
*/
+ MOZ_ASSERT(op == JSOP_NEWARRAY || op == JSOP_SPREADCALLARRAY);
uint32_t nspread = 0;
for (ParseNode* elt = pn; elt; elt = elt->pn_next) {
@@ -10173,7 +10185,7 @@ BytecodeEmitter::emitArray(ParseNode* pn, uint32_t count)
// For arrays with spread, this is a very pessimistic allocation, the
// minimum possible final size.
- if (!emitUint32Operand(JSOP_NEWARRAY, count - nspread)) // ARRAY
+ if (!emitUint32Operand(op, count - nspread)) // ARRAY
return false;
ParseNode* pn2 = pn;
@@ -11314,8 +11326,8 @@ BytecodeEmitter::setSrcNoteOffset(unsigned index, unsigned which, ptrdiff_t offs
/* Maybe this offset was already set to a four-byte value. */
if (!(*sn & SN_4BYTE_OFFSET_FLAG)) {
/* Insert three dummy bytes that will be overwritten shortly. */
- if (MOZ_UNLIKELY(notes.length() + 3 > MaxSrcNotesLength)) {
- ReportAllocationOverflow(cx);
+ if (MOZ_UNLIKELY(notes.length() + 3 > MaxSrcNotesLength)) {
+ ReportAllocationOverflow(cx);
return false;
}
jssrcnote dummy = 0;
diff --git a/js/src/frontend/BytecodeEmitter.h b/js/src/frontend/BytecodeEmitter.h
index 8ad409c11..77f77599c 100644
--- a/js/src/frontend/BytecodeEmitter.h
+++ b/js/src/frontend/BytecodeEmitter.h
@@ -543,7 +543,7 @@ struct MOZ_STACK_CLASS BytecodeEmitter
MOZ_MUST_USE bool emitAtomOp(ParseNode* pn, JSOp op);
MOZ_MUST_USE bool emitArrayLiteral(ParseNode* pn);
- MOZ_MUST_USE bool emitArray(ParseNode* pn, uint32_t count);
+ MOZ_MUST_USE bool emitArray(ParseNode* pn, uint32_t count, JSOp op);
MOZ_MUST_USE bool emitArrayComp(ParseNode* pn);
MOZ_MUST_USE bool emitInternedScopeOp(uint32_t index, JSOp op);
diff --git a/js/src/frontend/FoldConstants.cpp b/js/src/frontend/FoldConstants.cpp
index 16294c4a8..b460b92b6 100644
--- a/js/src/frontend/FoldConstants.cpp
+++ b/js/src/frontend/FoldConstants.cpp
@@ -1260,9 +1260,10 @@ FoldCatch(ExclusiveContext* cx, ParseNode* node, Parser<FullParseHandler>& parse
MOZ_ASSERT(node->isKind(PNK_CATCH));
MOZ_ASSERT(node->isArity(PN_TERNARY));
- ParseNode*& declPattern = node->pn_kid1;
- if (!Fold(cx, &declPattern, parser, inGenexpLambda))
- return false;
+ if (ParseNode*& declPattern = node->pn_kid1) {
+ if (!Fold(cx, &declPattern, parser, inGenexpLambda))
+ return false;
+ }
if (ParseNode*& cond = node->pn_kid2) {
if (!FoldCondition(cx, &cond, parser, inGenexpLambda))
diff --git a/js/src/frontend/NameFunctions.cpp b/js/src/frontend/NameFunctions.cpp
index 376be7624..db70bb5b4 100644
--- a/js/src/frontend/NameFunctions.cpp
+++ b/js/src/frontend/NameFunctions.cpp
@@ -651,8 +651,10 @@ class NameResolver
// contain arbitrary expressions.
case PNK_CATCH:
MOZ_ASSERT(cur->isArity(PN_TERNARY));
- if (!resolve(cur->pn_kid1, prefix))
- return false;
+ if (cur->pn_kid1) {
+ if (!resolve(cur->pn_kid1, prefix))
+ return false;
+ }
if (cur->pn_kid2) {
if (!resolve(cur->pn_kid2, prefix))
return false;
diff --git a/js/src/frontend/ParseNode.cpp b/js/src/frontend/ParseNode.cpp
index 42ae9451a..e01a41067 100644
--- a/js/src/frontend/ParseNode.cpp
+++ b/js/src/frontend/ParseNode.cpp
@@ -409,13 +409,14 @@ PushNodeChildren(ParseNode* pn, NodeStack* stack)
return PushResult::Recyclable;
}
- // A catch node has first kid as catch-variable pattern, the second kid
- // as catch condition (which, if non-null, records the |<cond>| in
- // SpiderMonkey's |catch (e if <cond>)| extension), and third kid as the
- // statements in the catch block.
+ // A catch node has an (optional) first kid as catch-variable pattern,
+ // the second kid as (optional) catch condition (which, records the
+ // |<cond>| in SpiderMonkey's |catch (e if <cond>)| extension), and
+ // third kid as the statements in the catch block.
case PNK_CATCH: {
MOZ_ASSERT(pn->isArity(PN_TERNARY));
- stack->push(pn->pn_kid1);
+ if (pn->pn_kid1)
+ stack->push(pn->pn_kid1);
if (pn->pn_kid2)
stack->push(pn->pn_kid2);
stack->push(pn->pn_kid3);
diff --git a/js/src/frontend/Parser.cpp b/js/src/frontend/Parser.cpp
index cf9f1e27c..810d589be 100644
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -6901,57 +6901,67 @@ Parser<ParseHandler>::tryStatement(YieldHandling yieldHandling)
/*
* Legal catch forms are:
* catch (lhs)
- * catch (lhs if <boolean_expression>)
+ * catch (lhs if <boolean_expression>) ** non-standard **
+ * catch ** ES2019 **
* where lhs is a name or a destructuring left-hand side.
- * (the latter is legal only #ifdef JS_HAS_CATCH_GUARD)
+ * The second is legal only #ifdef JS_HAS_CATCH_GUARD
*/
- MUST_MATCH_TOKEN(TOK_LP, JSMSG_PAREN_BEFORE_CATCH);
-
- if (!tokenStream.getToken(&tt))
+ bool omittedBinding;
+ if (!tokenStream.matchToken(&omittedBinding, TOK_LC))
return null();
+
Node catchName;
- switch (tt) {
- case TOK_LB:
- case TOK_LC:
- catchName = destructuringDeclaration(DeclarationKind::CatchParameter,
- yieldHandling, tt);
- if (!catchName)
- return null();
- break;
+ Node catchGuard = null();
- default: {
- if (!TokenKindIsPossibleIdentifierName(tt)) {
- error(JSMSG_CATCH_IDENTIFIER);
- return null();
- }
+ if (omittedBinding) {
+ catchName = null();
+ } else {
+ MUST_MATCH_TOKEN(TOK_LP, JSMSG_PAREN_BEFORE_CATCH);
- catchName = bindingIdentifier(DeclarationKind::SimpleCatchParameter,
- yieldHandling);
- if (!catchName)
+ if (!tokenStream.getToken(&tt))
return null();
- break;
- }
- }
+ switch (tt) {
+ case TOK_LB:
+ case TOK_LC:
+ catchName = destructuringDeclaration(DeclarationKind::CatchParameter,
+ yieldHandling, tt);
+ if (!catchName)
+ return null();
+ break;
+
+ default: {
+ if (!TokenKindIsPossibleIdentifierName(tt)) {
+ error(JSMSG_CATCH_IDENTIFIER);
+ return null();
+ }
+
+ catchName = bindingIdentifier(DeclarationKind::SimpleCatchParameter,
+ yieldHandling);
+ if (!catchName)
+ return null();
+ break;
+ }
+ }
- Node catchGuard = null();
#if JS_HAS_CATCH_GUARD
- /*
- * We use 'catch (x if x === 5)' (not 'catch (x : x === 5)')
- * to avoid conflicting with the JS2/ECMAv4 type annotation
- * catchguard syntax.
- */
- bool matched;
- if (!tokenStream.matchToken(&matched, TOK_IF))
- return null();
- if (matched) {
- catchGuard = expr(InAllowed, yieldHandling, TripledotProhibited);
- if (!catchGuard)
+ /*
+ * We use 'catch (x if x === 5)' (not 'catch (x : x === 5)')
+ * to avoid conflicting with the JS2/ECMAv4 type annotation
+ * catchguard syntax.
+ */
+ bool matched;
+ if (!tokenStream.matchToken(&matched, TOK_IF))
return null();
- }
+ if (matched) {
+ catchGuard = expr(InAllowed, yieldHandling, TripledotProhibited);
+ if (!catchGuard)
+ return null();
+ }
#endif
- MUST_MATCH_TOKEN(TOK_RP, JSMSG_PAREN_AFTER_CATCH);
+ MUST_MATCH_TOKEN(TOK_RP, JSMSG_PAREN_AFTER_CATCH);
- MUST_MATCH_TOKEN(TOK_LC, JSMSG_CURLY_BEFORE_CATCH);
+ MUST_MATCH_TOKEN(TOK_LC, JSMSG_CURLY_BEFORE_CATCH);
+ }
Node catchBody = catchBlockStatement(yieldHandling, scope);
if (!catchBody)
diff --git a/js/src/gc/GCRuntime.h b/js/src/gc/GCRuntime.h
index f102e9ef0..f43dcd351 100644
--- a/js/src/gc/GCRuntime.h
+++ b/js/src/gc/GCRuntime.h
@@ -741,7 +741,9 @@ class GCRuntime
void removeBlackRootsTracer(JSTraceDataOp traceOp, void* data);
void setMaxMallocBytes(size_t value);
+#ifdef MOZ_DEVTOOLS_SERVER
int32_t getMallocBytes() const { return mallocBytesUntilGC; }
+#endif
void resetMallocBytes();
bool isTooMuchMalloc() const { return mallocBytesUntilGC <= 0; }
void updateMallocCounter(JS::Zone* zone, size_t nbytes);
diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp
index 262fc8cbc..43e325394 100644
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -18,7 +18,6 @@
#include "builtin/ModuleObject.h"
#include "gc/GCInternals.h"
#include "gc/Policy.h"
-#include "gc/StoreBuffer-inl.h"
#include "jit/IonCode.h"
#include "js/SliceBudget.h"
#include "vm/ArgumentsObject.h"
@@ -29,6 +28,7 @@
#include "vm/Shape.h"
#include "vm/Symbol.h"
#include "vm/TypedArrayObject.h"
+#include "vm/UnboxedObject.h"
#include "wasm/WasmJS.h"
#include "jscompartmentinlines.h"
@@ -37,6 +37,7 @@
#include "gc/Nursery-inl.h"
#include "vm/String-inl.h"
+#include "vm/UnboxedObject-inl.h"
using namespace js;
using namespace js::gc;
@@ -1394,6 +1395,14 @@ js::ObjectGroup::traceChildren(JSTracer* trc)
if (maybePreliminaryObjects())
maybePreliminaryObjects()->trace(trc);
+ if (maybeUnboxedLayout())
+ unboxedLayout().trace(trc);
+
+ if (ObjectGroup* unboxedGroup = maybeOriginalUnboxedGroup()) {
+ TraceManuallyBarrieredEdge(trc, &unboxedGroup, "group_original_unboxed_group");
+ setOriginalUnboxedGroup(unboxedGroup);
+ }
+
if (JSObject* descr = maybeTypeDescr()) {
TraceManuallyBarrieredEdge(trc, &descr, "group_type_descr");
setTypeDescr(&descr->as<TypeDescr>());
@@ -1427,6 +1436,12 @@ js::GCMarker::lazilyMarkChildren(ObjectGroup* group)
if (group->maybePreliminaryObjects())
group->maybePreliminaryObjects()->trace(this);
+ if (group->maybeUnboxedLayout())
+ group->unboxedLayout().trace(this);
+
+ if (ObjectGroup* unboxedGroup = group->maybeOriginalUnboxedGroup())
+ traverseEdge(group, unboxedGroup);
+
if (TypeDescr* descr = group->maybeTypeDescr())
traverseEdge(group, static_cast<JSObject*>(descr));
@@ -1469,6 +1484,23 @@ CallTraceHook(Functor f, JSTracer* trc, JSObject* obj, CheckGeneration check, Ar
return nullptr;
}
+ if (clasp == &UnboxedPlainObject::class_) {
+ JSObject** pexpando = obj->as<UnboxedPlainObject>().addressOfExpando();
+ if (*pexpando)
+ f(pexpando, mozilla::Forward<Args>(args)...);
+
+ UnboxedPlainObject& unboxed = obj->as<UnboxedPlainObject>();
+ const UnboxedLayout& layout = check == CheckGeneration::DoChecks
+ ? unboxed.layout()
+ : unboxed.layoutDontCheckGeneration();
+ if (layout.traceList()) {
+ VisitTraceList(f, layout.traceList(), unboxed.data(),
+ mozilla::Forward<Args>(args)...);
+ }
+
+ return nullptr;
+ }
+
clasp->doTrace(trc, obj);
if (!clasp->isNative())
@@ -2261,6 +2293,18 @@ static inline void
TraceWholeCell(TenuringTracer& mover, JSObject* object)
{
mover.traceObject(object);
+
+ // Additionally trace the expando object attached to any unboxed plain
+ // objects. Baseline and Ion can write properties to the expando while
+ // only adding a post barrier to the owning unboxed object. Note that
+ // it isn't possible for a nursery unboxed object to have a tenured
+ // expando, so that adding a post barrier on the original object will
+ // capture any tenured->nursery edges in the expando as well.
+
+ if (object->is<UnboxedPlainObject>()) {
+ if (UnboxedExpandoObject* expando = object->as<UnboxedPlainObject>().maybeExpando())
+ expando->traceChildren(&mover);
+ }
}
static inline void
@@ -2504,6 +2548,8 @@ js::TenuringTracer::moveObjectToTenured(JSObject* dst, JSObject* src, AllocKind
InlineTypedObject::objectMovedDuringMinorGC(this, dst, src);
} else if (src->is<TypedArrayObject>()) {
tenuredSize += TypedArrayObject::objectMovedDuringMinorGC(this, dst, src, dstKind);
+ } else if (src->is<UnboxedArrayObject>()) {
+ tenuredSize += UnboxedArrayObject::objectMovedDuringMinorGC(this, dst, src, dstKind);
} else if (src->is<ArgumentsObject>()) {
tenuredSize += ArgumentsObject::objectMovedDuringMinorGC(this, dst, src);
} else if (src->is<ProxyObject>()) {
diff --git a/js/src/gc/Memory.cpp b/js/src/gc/Memory.cpp
index 418984057..17c964da0 100644
--- a/js/src/gc/Memory.cpp
+++ b/js/src/gc/Memory.cpp
@@ -423,7 +423,7 @@ MapMemoryAt(void* desired, size_t length, int prot = PROT_READ | PROT_WRITE,
// possibly be correct on AMD64, but for Solaris/illumos it is.
{
-#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || defined(__aarch64__) || (defined(__sun) && defined(__x86_64__))
+#if defined(__ia64__) || defined(__aarch64__) || (defined(__sun) && defined(__x86_64__)) || (defined(__sparc__) && defined(__arch64__) && (defined(__NetBSD__) || defined(__linux__)))
MOZ_ASSERT((0xffff800000000000ULL & (uintptr_t(desired) + length - 1)) == 0);
#endif
void* region = mmap(desired, length, prot, flags, fd, offset);
@@ -446,7 +446,7 @@ static inline void*
MapMemory(size_t length, int prot = PROT_READ | PROT_WRITE,
int flags = MAP_PRIVATE | MAP_ANON, int fd = -1, off_t offset = 0)
{
-#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__))
+#if defined(__ia64__) || (defined(__sparc__) && defined(__arch64__) && defined(__NetBSD__))
/*
* The JS engine assumes that all allocated pointers have their high 17 bits clear,
* which ia64's mmap doesn't support directly. However, we can emulate it by passing
@@ -473,7 +473,7 @@ MapMemory(size_t length, int prot = PROT_READ | PROT_WRITE,
return nullptr;
}
return region;
-#elif defined(__aarch64__) || (defined(__sun) && defined(__x86_64__))
+#elif defined(__aarch64__) || (defined(__sun) && defined(__x86_64__)) || (defined(__sparc__) && defined(__arch64__) && defined(__linux__))
/*
* There might be similar virtual address issue on arm64 which depends on
* hardware and kernel configurations. But the work around is slightly
diff --git a/js/src/gc/Nursery.cpp b/js/src/gc/Nursery.cpp
index 93a0eb6a8..737d68bd0 100644
--- a/js/src/gc/Nursery.cpp
+++ b/js/src/gc/Nursery.cpp
@@ -505,7 +505,10 @@ js::Nursery::collect(JSRuntime* rt, JS::gcreason::Reason reason)
if (!isEnabled())
return;
+#ifdef MOZ_DEVTOOLS_SERVER
+ // No need to obsessively track this without devtools
rt->gc.incMinorGcNumber();
+#endif
rt->gc.stats.beginNurseryCollection(reason);
TraceMinorGCStart();
diff --git a/js/src/gc/Tracer.cpp b/js/src/gc/Tracer.cpp
index 3416464dd..63cd9b08a 100644
--- a/js/src/gc/Tracer.cpp
+++ b/js/src/gc/Tracer.cpp
@@ -201,15 +201,80 @@ gc::TraceCycleCollectorChildren(JS::CallbackTracer* trc, Shape* shape)
} while (shape);
}
+// Object groups can point to other object groups via an UnboxedLayout or the
+// the original unboxed group link. There can potentially be deep or cyclic
+// chains of such groups to trace through without going through a thing that
+// participates in cycle collection. These need to be handled iteratively to
+// avoid blowing the stack when running the cycle collector's callback tracer.
+struct ObjectGroupCycleCollectorTracer : public JS::CallbackTracer
+{
+ explicit ObjectGroupCycleCollectorTracer(JS::CallbackTracer* innerTracer)
+ : JS::CallbackTracer(innerTracer->runtime(), DoNotTraceWeakMaps),
+ innerTracer(innerTracer)
+ {}
+
+ void onChild(const JS::GCCellPtr& thing) override;
+
+ JS::CallbackTracer* innerTracer;
+ Vector<ObjectGroup*, 4, SystemAllocPolicy> seen, worklist;
+};
+
+void
+ObjectGroupCycleCollectorTracer::onChild(const JS::GCCellPtr& thing)
+{
+ if (thing.is<BaseShape>()) {
+ // The CC does not care about BaseShapes, and no additional GC things
+ // will be reached by following this edge.
+ return;
+ }
+
+ if (thing.is<JSObject>() || thing.is<JSScript>()) {
+ // Invoke the inner cycle collector callback on this child. It will not
+ // recurse back into TraceChildren.
+ innerTracer->onChild(thing);
+ return;
+ }
+
+ if (thing.is<ObjectGroup>()) {
+ // If this group is required to be in an ObjectGroup chain, trace it
+ // via the provided worklist rather than continuing to recurse.
+ ObjectGroup& group = thing.as<ObjectGroup>();
+ if (group.maybeUnboxedLayout()) {
+ for (size_t i = 0; i < seen.length(); i++) {
+ if (seen[i] == &group)
+ return;
+ }
+ if (seen.append(&group) && worklist.append(&group)) {
+ return;
+ } else {
+ // If append fails, keep tracing normally. The worst that will
+ // happen is we end up overrecursing.
+ }
+ }
+ }
+
+ TraceChildren(this, thing.asCell(), thing.kind());
+}
+
void
gc::TraceCycleCollectorChildren(JS::CallbackTracer* trc, ObjectGroup* group)
{
MOZ_ASSERT(trc->isCallbackTracer());
- group->traceChildren(trc);
-}
+ // Early return if this group is not required to be in an ObjectGroup chain.
+ if (!group->maybeUnboxedLayout())
+ return group->traceChildren(trc);
+
+ ObjectGroupCycleCollectorTracer groupTracer(trc->asCallbackTracer());
+ group->traceChildren(&groupTracer);
+ while (!groupTracer.worklist.empty()) {
+ ObjectGroup* innerGroup = groupTracer.worklist.popCopy();
+ innerGroup->traceChildren(&groupTracer);
+ }
+}
+
/*** Traced Edge Printer *************************************************************************/
static size_t
diff --git a/js/src/jit-test/tests/basic/unboxed-object-clear-new-script.js b/js/src/jit-test/tests/basic/unboxed-object-clear-new-script.js
new file mode 100644
index 000000000..f55456222
--- /dev/null
+++ b/js/src/jit-test/tests/basic/unboxed-object-clear-new-script.js
@@ -0,0 +1,49 @@
+
+function Foo(a, b) {
+ this.a = a;
+ this.b = b;
+}
+
+function invalidate_foo() {
+ var a = [];
+ var counter = 0;
+ for (var i = 0; i < 50; i++)
+ a.push(new Foo(i, i + 1));
+ Object.defineProperty(Foo.prototype, "a", {configurable: true, set: function() { counter++; }});
+ for (var i = 0; i < 50; i++)
+ a.push(new Foo(i, i + 1));
+ delete Foo.prototype.a;
+ var total = 0;
+ for (var i = 0; i < a.length; i++) {
+ assertEq('a' in a[i], i < 50);
+ total += a[i].b;
+ }
+ assertEq(total, 2550);
+ assertEq(counter, 50);
+}
+invalidate_foo();
+
+function Bar(a, b, fn) {
+ this.a = a;
+ if (b == 30)
+ Object.defineProperty(Bar.prototype, "b", {configurable: true, set: fn});
+ this.b = b;
+}
+
+function invalidate_bar() {
+ var a = [];
+ var counter = 0;
+ function fn() { counter++; }
+ for (var i = 0; i < 50; i++)
+ a.push(new Bar(i, i + 1, fn));
+ delete Bar.prototype.b;
+ var total = 0;
+ for (var i = 0; i < a.length; i++) {
+ assertEq('a' in a[i], true);
+ assertEq('b' in a[i], i < 29);
+ total += a[i].a;
+ }
+ assertEq(total, 1225);
+ assertEq(counter, 21);
+}
+invalidate_bar();
diff --git a/js/src/jit-test/tests/basic/unboxed-object-convert-to-native.js b/js/src/jit-test/tests/basic/unboxed-object-convert-to-native.js
new file mode 100644
index 000000000..691fe166c
--- /dev/null
+++ b/js/src/jit-test/tests/basic/unboxed-object-convert-to-native.js
@@ -0,0 +1,47 @@
+
+// Test various ways of converting an unboxed object to native.
+
+function Foo(a, b) {
+ this.a = a;
+ this.b = b;
+}
+
+var proxyObj = {
+ get: function(recipient, name) {
+ return recipient[name] + 2;
+ }
+};
+
+function f() {
+ var a = [];
+ for (var i = 0; i < 50; i++)
+ a.push(new Foo(i, i + 1));
+
+ var prop = "a";
+
+ i = 0;
+ for (; i < 5; i++)
+ a[i].c = i;
+ for (; i < 10; i++)
+ Object.defineProperty(a[i], 'c', {value: i});
+ for (; i < 15; i++)
+ a[i] = new Proxy(a[i], proxyObj);
+ for (; i < 20; i++)
+ a[i].a = 3.5;
+ for (; i < 25; i++)
+ delete a[i].b;
+ for (; i < 30; i++)
+ a[prop] = 4;
+
+ var total = 0;
+ for (i = 0; i < a.length; i++) {
+ if ('a' in a[i])
+ total += a[i].a;
+ if ('b' in a[i])
+ total += a[i].b;
+ if ('c' in a[i])
+ total += a[i].c;
+ }
+ assertEq(total, 2382.5);
+}
+f();
diff --git a/js/src/jit-test/tests/basic/unboxed-object-getelem.js b/js/src/jit-test/tests/basic/unboxed-object-getelem.js
new file mode 100644
index 000000000..b30b8325a
--- /dev/null
+++ b/js/src/jit-test/tests/basic/unboxed-object-getelem.js
@@ -0,0 +1,20 @@
+
+function f() {
+ var propNames = ["a","b","c","d","e","f","g","h","i","j","x","y"];
+ var arr = [];
+ for (var i=0; i<64; i++)
+ arr.push({x:1, y:2});
+ for (var i=0; i<64; i++) {
+ // Make sure there are expandos with dynamic slots for each object.
+ for (var j = 0; j < propNames.length; j++)
+ arr[i][propNames[j]] = j;
+ }
+ var res = 0;
+ for (var i=0; i<100000; i++) {
+ var o = arr[i % 64];
+ var p = propNames[i % propNames.length];
+ res += o[p];
+ }
+ assertEq(res, 549984);
+}
+f();
diff --git a/js/src/jit-test/tests/basic/unboxed-object-set-property.js b/js/src/jit-test/tests/basic/unboxed-object-set-property.js
new file mode 100644
index 000000000..fdcfcf6b2
--- /dev/null
+++ b/js/src/jit-test/tests/basic/unboxed-object-set-property.js
@@ -0,0 +1,31 @@
+
+// Use the correct receiver when non-native objects are prototypes of other objects.
+
+function Thing(a, b) {
+ this.a = a;
+ this.b = b;
+}
+
+function foo() {
+ var array = [];
+ for (var i = 0; i < 10000; i++)
+ array.push(new Thing(i, i + 1));
+
+ var proto = new Thing(1, 2);
+ var obj = Object.create(proto);
+
+ Object.defineProperty(Thing.prototype, "c", {set:function() { this.d = 0; }});
+ obj.c = 3;
+ assertEq(obj.c, undefined);
+ assertEq(obj.d, 0);
+ assertEq(obj.hasOwnProperty("d"), true);
+ assertEq(proto.d, undefined);
+ assertEq(proto.hasOwnProperty("d"), false);
+
+ obj.a = 3;
+ assertEq(obj.a, 3);
+ assertEq(proto.a, 1);
+ assertEq(obj.hasOwnProperty("a"), true);
+}
+
+foo();
diff --git a/js/src/jit-test/tests/basic/unboxed-property-enumeration.js b/js/src/jit-test/tests/basic/unboxed-property-enumeration.js
new file mode 100644
index 000000000..142d932dd
--- /dev/null
+++ b/js/src/jit-test/tests/basic/unboxed-property-enumeration.js
@@ -0,0 +1,24 @@
+function O() {
+ this.x = 1;
+ this.y = 2;
+}
+function testUnboxed() {
+ var arr = [];
+ for (var i=0; i<100; i++)
+ arr.push(new O);
+
+ var o = arr[arr.length-1];
+ o[0] = 0;
+ o[2] = 2;
+ var sym = Symbol();
+ o[sym] = 1;
+ o.z = 3;
+ Object.defineProperty(o, '3', {value:1,enumerable:false,configurable:false,writable:false});
+ o[4] = 4;
+
+ var props = Reflect.ownKeys(o);
+ assertEq(props[props.length-1], sym);
+
+ assertEq(Object.getOwnPropertyNames(o).join(""), "0234xyz");
+}
+testUnboxed();
diff --git a/js/src/jit-test/tests/ion/unboxed-objects-invalidate.js b/js/src/jit-test/tests/ion/unboxed-objects-invalidate.js
new file mode 100644
index 000000000..02e27614f
--- /dev/null
+++ b/js/src/jit-test/tests/ion/unboxed-objects-invalidate.js
@@ -0,0 +1,16 @@
+
+var a = [];
+for (var i = 0; i < 2000; i++)
+ a.push({f:i});
+
+function f() {
+ var total = 0;
+ for (var i = 0; i < a.length; i++)
+ total += a[i].f;
+ return total;
+}
+assertEq(f(), 1999000);
+
+var sub = Object.create(a[0]);
+
+assertEq(f(), 1999000);
diff --git a/js/src/jit/AliasAnalysisShared.cpp b/js/src/jit/AliasAnalysisShared.cpp
index 400626b33..99c23d2a3 100644
--- a/js/src/jit/AliasAnalysisShared.cpp
+++ b/js/src/jit/AliasAnalysisShared.cpp
@@ -91,6 +91,10 @@ GetObject(const MDefinition* ins)
case MDefinition::Op_Elements:
case MDefinition::Op_MaybeCopyElementsForWrite:
case MDefinition::Op_MaybeToDoubleElement:
+ case MDefinition::Op_UnboxedArrayLength:
+ case MDefinition::Op_UnboxedArrayInitializedLength:
+ case MDefinition::Op_IncrementUnboxedArrayInitializedLength:
+ case MDefinition::Op_SetUnboxedArrayInitializedLength:
case MDefinition::Op_TypedArrayLength:
case MDefinition::Op_SetTypedObjectOffset:
case MDefinition::Op_SetDisjointTypedElements:
@@ -108,6 +112,8 @@ GetObject(const MDefinition* ins)
case MDefinition::Op_GuardObjectGroup:
case MDefinition::Op_GuardObjectIdentity:
case MDefinition::Op_GuardClass:
+ case MDefinition::Op_GuardUnboxedExpando:
+ case MDefinition::Op_LoadUnboxedExpando:
case MDefinition::Op_LoadSlot:
case MDefinition::Op_StoreSlot:
case MDefinition::Op_InArray:
diff --git a/js/src/jit/BaselineCacheIR.cpp b/js/src/jit/BaselineCacheIR.cpp
index 67c80473b..bf96932d1 100644
--- a/js/src/jit/BaselineCacheIR.cpp
+++ b/js/src/jit/BaselineCacheIR.cpp
@@ -16,7 +16,7 @@ using namespace js;
using namespace js::jit;
// OperandLocation represents the location of an OperandId. The operand is
-// either in a register or on the stack.
+// either in a register or on the stack, and is either boxed or unboxed.
class OperandLocation
{
public:
@@ -787,6 +787,9 @@ BaselineCacheIRCompiler::emitGuardClass()
case GuardClassKind::Array:
clasp = &ArrayObject::class_;
break;
+ case GuardClassKind::UnboxedArray:
+ clasp = &UnboxedArrayObject::class_;
+ break;
case GuardClassKind::MappedArguments:
clasp = &MappedArgumentsObject::class_;
break;
@@ -815,6 +818,36 @@ BaselineCacheIRCompiler::emitGuardSpecificObject()
}
bool
+BaselineCacheIRCompiler::emitGuardNoUnboxedExpando()
+{
+ Register obj = allocator.useRegister(masm, reader.objOperandId());
+
+ FailurePath* failure;
+ if (!addFailurePath(&failure))
+ return false;
+
+ Address expandoAddr(obj, UnboxedPlainObject::offsetOfExpando());
+ masm.branchPtr(Assembler::NotEqual, expandoAddr, ImmWord(0), failure->label());
+ return true;
+}
+
+bool
+BaselineCacheIRCompiler::emitGuardAndLoadUnboxedExpando()
+{
+ Register obj = allocator.useRegister(masm, reader.objOperandId());
+ Register output = allocator.defineRegister(masm, reader.objOperandId());
+
+ FailurePath* failure;
+ if (!addFailurePath(&failure))
+ return false;
+
+ Address expandoAddr(obj, UnboxedPlainObject::offsetOfExpando());
+ masm.loadPtr(expandoAddr, output);
+ masm.branchTestPtr(Assembler::Zero, output, output, failure->label());
+ return true;
+}
+
+bool
BaselineCacheIRCompiler::emitLoadFixedSlotResult()
{
Register obj = allocator.useRegister(masm, reader.objOperandId());
@@ -841,6 +874,26 @@ BaselineCacheIRCompiler::emitLoadDynamicSlotResult()
}
bool
+BaselineCacheIRCompiler::emitLoadUnboxedPropertyResult()
+{
+ Register obj = allocator.useRegister(masm, reader.objOperandId());
+ AutoScratchRegister scratch(allocator, masm);
+
+ JSValueType fieldType = reader.valueType();
+
+ Address fieldOffset(stubAddress(reader.stubOffset()));
+ masm.load32(fieldOffset, scratch);
+ masm.loadUnboxedProperty(BaseIndex(obj, scratch, TimesOne), fieldType, R0);
+
+ if (fieldType == JSVAL_TYPE_OBJECT)
+ emitEnterTypeMonitorIC();
+ else
+ emitReturnFromIC();
+
+ return true;
+}
+
+bool
BaselineCacheIRCompiler::emitGuardNoDetachedTypedObjects()
{
FailurePath* failure;
@@ -951,6 +1004,19 @@ BaselineCacheIRCompiler::emitLoadInt32ArrayLengthResult()
}
bool
+BaselineCacheIRCompiler::emitLoadUnboxedArrayLengthResult()
+{
+ Register obj = allocator.useRegister(masm, reader.objOperandId());
+ masm.load32(Address(obj, UnboxedArrayObject::offsetOfLength()), R0.scratchReg());
+ masm.tagValue(JSVAL_TYPE_INT32, R0.scratchReg(), R0);
+
+ // The int32 type was monitored when attaching the stub, so we can
+ // just return.
+ emitReturnFromIC();
+ return true;
+}
+
+bool
BaselineCacheIRCompiler::emitLoadArgumentsObjectLengthResult()
{
Register obj = allocator.useRegister(masm, reader.objOperandId());
diff --git a/js/src/jit/BaselineCompiler.cpp b/js/src/jit/BaselineCompiler.cpp
index d254b9826..ae5a2e666 100644
--- a/js/src/jit/BaselineCompiler.cpp
+++ b/js/src/jit/BaselineCompiler.cpp
@@ -2050,7 +2050,13 @@ BaselineCompiler::emit_JSOP_NEWARRAY()
return true;
}
-typedef ArrayObject* (*NewArrayCopyOnWriteFn)(JSContext*, HandleArrayObject, gc::InitialHeap);
+bool
+BaselineCompiler::emit_JSOP_SPREADCALLARRAY()
+{
+ return emit_JSOP_NEWARRAY();
+}
+
+typedef JSObject* (*NewArrayCopyOnWriteFn)(JSContext*, HandleArrayObject, gc::InitialHeap);
const VMFunction jit::NewArrayCopyOnWriteInfo =
FunctionInfo<NewArrayCopyOnWriteFn>(js::NewDenseCopyOnWriteArray, "NewDenseCopyOnWriteArray");
@@ -4181,14 +4187,14 @@ BaselineCompiler::emit_JSOP_REST()
{
frame.syncStack(0);
- ArrayObject* templateObject =
+ JSObject* templateObject =
ObjectGroup::newArrayObject(cx, nullptr, 0, TenuredObject,
ObjectGroup::NewArrayKind::UnknownIndex);
if (!templateObject)
return false;
// Call IC.
- ICRest_Fallback::Compiler compiler(cx, templateObject);
+ ICRest_Fallback::Compiler compiler(cx, &templateObject->as<ArrayObject>());
if (!emitOpIC(compiler.getStub(&stubSpace_)))
return false;
diff --git a/js/src/jit/BaselineCompiler.h b/js/src/jit/BaselineCompiler.h
index a200f7ab9..7b1af092a 100644
--- a/js/src/jit/BaselineCompiler.h
+++ b/js/src/jit/BaselineCompiler.h
@@ -100,6 +100,7 @@ namespace jit {
_(JSOP_BITNOT) \
_(JSOP_NEG) \
_(JSOP_NEWARRAY) \
+ _(JSOP_SPREADCALLARRAY) \
_(JSOP_NEWARRAY_COPYONWRITE) \
_(JSOP_INITELEM_ARRAY) \
_(JSOP_NEWOBJECT) \
diff --git a/js/src/jit/BaselineIC.cpp b/js/src/jit/BaselineIC.cpp
index e65f10aac..9c8cd9835 100644
--- a/js/src/jit/BaselineIC.cpp
+++ b/js/src/jit/BaselineIC.cpp
@@ -44,8 +44,8 @@
#include "jit/shared/Lowering-shared-inl.h"
#include "vm/EnvironmentObject-inl.h"
#include "vm/Interpreter-inl.h"
-#include "vm/NativeObject-inl.h"
#include "vm/StringObject-inl.h"
+#include "vm/UnboxedObject-inl.h"
using mozilla::DebugOnly;
@@ -741,6 +741,11 @@ LastPropertyForSetProp(JSObject* obj)
if (obj->isNative())
return obj->as<NativeObject>().lastProperty();
+ if (obj->is<UnboxedPlainObject>()) {
+ UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando();
+ return expando ? expando->lastProperty() : nullptr;
+ }
+
return nullptr;
}
@@ -1157,6 +1162,56 @@ TryAttachNativeOrUnboxedGetValueElemStub(JSContext* cx, HandleScript script, jsb
ICStub* monitorStub = stub->fallbackMonitorStub()->firstMonitorStub();
+ if (obj->is<UnboxedPlainObject>() && holder == obj) {
+ const UnboxedLayout::Property* property = obj->as<UnboxedPlainObject>().layout().lookup(id);
+
+ // Once unboxed objects support symbol-keys, we need to change the following accordingly
+ MOZ_ASSERT_IF(!keyVal.isString(), !property);
+
+ if (property) {
+ if (!cx->runtime()->jitSupportsFloatingPoint)
+ return true;
+
+ RootedPropertyName name(cx, JSID_TO_ATOM(id)->asPropertyName());
+ ICGetElemNativeCompiler<PropertyName*> compiler(cx, ICStub::GetElem_UnboxedPropertyName,
+ monitorStub, obj, holder,
+ name,
+ ICGetElemNativeStub::UnboxedProperty,
+ needsAtomize, property->offset +
+ UnboxedPlainObject::offsetOfData(),
+ property->type);
+ ICStub* newStub = compiler.getStub(compiler.getStubSpace(script));
+ if (!newStub)
+ return false;
+
+ stub->addNewStub(newStub);
+ *attached = true;
+ return true;
+ }
+
+ Shape* shape = obj->as<UnboxedPlainObject>().maybeExpando()->lookup(cx, id);
+ if (!shape->hasDefaultGetter() || !shape->hasSlot())
+ return true;
+
+ bool isFixedSlot;
+ uint32_t offset;
+ GetFixedOrDynamicSlotOffset(shape, &isFixedSlot, &offset);
+
+ ICGetElemNativeStub::AccessType acctype =
+ isFixedSlot ? ICGetElemNativeStub::FixedSlot
+ : ICGetElemNativeStub::DynamicSlot;
+ ICGetElemNativeCompiler<T> compiler(cx, getGetElemStubKind<T>(ICStub::GetElem_NativeSlotName),
+ monitorStub, obj, holder, key,
+ acctype, needsAtomize, offset);
+ ICStub* newStub = compiler.getStub(compiler.getStubSpace(script));
+ if (!newStub)
+ return false;
+
+ stub->addNewStub(newStub);
+ *attached = true;
+ return true;
+ }
+
if (!holder->isNative())
return true;
@@ -1320,7 +1375,7 @@ IsNativeDenseElementAccess(HandleObject obj, HandleValue key)
static bool
IsNativeOrUnboxedDenseElementAccess(HandleObject obj, HandleValue key)
{
- if (!obj->isNative())
+ if (!obj->isNative() && !obj->is<UnboxedArrayObject>())
return false;
if (key.isInt32() && key.toInt32() >= 0 && !obj->is<TypedArrayObject>())
return true;
@@ -1404,7 +1459,7 @@ TryAttachGetElemStub(JSContext* cx, JSScript* script, jsbytecode* pc, ICGetElem_
}
// Check for NativeObject[id] and UnboxedPlainObject[id] shape-optimizable accesses.
- if (obj->isNative()) {
+ if (obj->isNative() || obj->is<UnboxedPlainObject>()) {
RootedScript rootedScript(cx, script);
if (rhs.isString()) {
if (!TryAttachNativeOrUnboxedGetValueElemStub<PropertyName*>(cx, rootedScript, pc, stub,
@@ -1424,6 +1479,20 @@ TryAttachGetElemStub(JSContext* cx, JSScript* script, jsbytecode* pc, ICGetElem_
script = rootedScript;
}
+ // Check for UnboxedArray[int] accesses.
+ if (obj->is<UnboxedArrayObject>() && rhs.isInt32() && rhs.toInt32() >= 0) {
+ JitSpew(JitSpew_BaselineIC, " Generating GetElem(UnboxedArray[Int32]) stub");
+ ICGetElem_UnboxedArray::Compiler compiler(cx, stub->fallbackMonitorStub()->firstMonitorStub(),
+ obj->group());
+ ICStub* unboxedStub = compiler.getStub(compiler.getStubSpace(script));
+ if (!unboxedStub)
+ return false;
+
+ stub->addNewStub(unboxedStub);
+ *attached = true;
+ return true;
+ }
+
// Check for TypedArray[int] => Number and TypedObject[int] => Number accesses.
if ((obj->is<TypedArrayObject>() || IsPrimitiveArrayTypedObject(obj)) &&
rhs.isNumber() &&
@@ -1816,6 +1885,14 @@ ICGetElemNativeCompiler<T>::generateStubCode(MacroAssembler& masm)
Register holderReg;
if (obj_ == holder_) {
holderReg = objReg;
+
+ if (obj_->is<UnboxedPlainObject>() && acctype_ != ICGetElemNativeStub::UnboxedProperty) {
+ // The property will be loaded off the unboxed expando.
+ masm.push(R1.scratchReg());
+ popR1 = true;
+ holderReg = R1.scratchReg();
+ masm.loadPtr(Address(objReg, UnboxedPlainObject::offsetOfExpando()), holderReg);
+ }
} else {
// Shape guard holder.
if (regs.empty()) {
@@ -1866,6 +1943,13 @@ ICGetElemNativeCompiler<T>::generateStubCode(MacroAssembler& masm)
if (popR1)
masm.addToStackPtr(ImmWord(sizeof(size_t)));
+ } else if (acctype_ == ICGetElemNativeStub::UnboxedProperty) {
+ masm.load32(Address(ICStubReg, ICGetElemNativeSlotStub<T>::offsetOfOffset()),
+ scratchReg);
+ masm.loadUnboxedProperty(BaseIndex(objReg, scratchReg, TimesOne), unboxedType_,
+ TypedOrValueRegister(R0));
+ if (popR1)
+ masm.addToStackPtr(ImmWord(sizeof(size_t)));
} else {
MOZ_ASSERT(acctype_ == ICGetElemNativeStub::NativeGetter ||
acctype_ == ICGetElemNativeStub::ScriptedGetter);
@@ -2015,6 +2099,56 @@ ICGetElem_Dense::Compiler::generateStubCode(MacroAssembler& masm)
}
//
+// GetElem_UnboxedArray
+//
+
+bool
+ICGetElem_UnboxedArray::Compiler::generateStubCode(MacroAssembler& masm)
+{
+ MOZ_ASSERT(engine_ == Engine::Baseline);
+
+ Label failure;
+ masm.branchTestObject(Assembler::NotEqual, R0, &failure);
+ masm.branchTestInt32(Assembler::NotEqual, R1, &failure);
+
+ AllocatableGeneralRegisterSet regs(availableGeneralRegs(2));
+ Register scratchReg = regs.takeAny();
+
+ // Unbox R0 and group guard.
+ Register obj = masm.extractObject(R0, ExtractTemp0);
+ masm.loadPtr(Address(ICStubReg, ICGetElem_UnboxedArray::offsetOfGroup()), scratchReg);
+ masm.branchTestObjGroup(Assembler::NotEqual, obj, scratchReg, &failure);
+
+ // Unbox key.
+ Register key = masm.extractInt32(R1, ExtractTemp1);
+
+ // Bounds check.
+ masm.load32(Address(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength()),
+ scratchReg);
+ masm.and32(Imm32(UnboxedArrayObject::InitializedLengthMask), scratchReg);
+ masm.branch32(Assembler::BelowOrEqual, scratchReg, key, &failure);
+
+ // Load obj->elements.
+ masm.loadPtr(Address(obj, UnboxedArrayObject::offsetOfElements()), scratchReg);
+
+ // Load value.
+ size_t width = UnboxedTypeSize(elementType_);
+ BaseIndex addr(scratchReg, key, ScaleFromElemWidth(width));
+ masm.loadUnboxedProperty(addr, elementType_, R0);
+
+ // Only monitor the result if its type might change.
+ if (elementType_ == JSVAL_TYPE_OBJECT)
+ EmitEnterTypeMonitorIC(masm);
+ else
+ EmitReturnFromIC(masm);
+
+ // Failure case - jump to next stub
+ masm.bind(&failure);
+ EmitStubGuardFailure(masm);
+ return true;
+}
+
+//
// GetElem_TypedArray
//
@@ -2318,8 +2452,8 @@ CanOptimizeDenseOrUnboxedArraySetElem(JSObject* obj, uint32_t index,
Shape* oldShape, uint32_t oldCapacity, uint32_t oldInitLength,
bool* isAddingCaseOut, size_t* protoDepthOut)
{
- uint32_t initLength = obj->as<NativeObject>().getDenseInitializedLength();
- uint32_t capacity = obj->as<NativeObject>().getDenseCapacity();
+ uint32_t initLength = GetAnyBoxedOrUnboxedInitializedLength(obj);
+ uint32_t capacity = GetAnyBoxedOrUnboxedCapacity(obj);
*isAddingCaseOut = false;
*protoDepthOut = 0;
@@ -2328,6 +2462,10 @@ CanOptimizeDenseOrUnboxedArraySetElem(JSObject* obj, uint32_t index,
if (initLength < oldInitLength || capacity < oldCapacity)
return false;
+ // Unboxed arrays need to be able to emit floating point code.
+ if (obj->is<UnboxedArrayObject>() && !obj->runtimeFromMainThread()->jitSupportsFloatingPoint)
+ return false;
+
Shape* shape = obj->maybeShape();
// Cannot optimize if the shape changed.
@@ -2409,8 +2547,8 @@ DoSetElemFallback(JSContext* cx, BaselineFrame* frame, ICSetElem_Fallback* stub_
uint32_t oldCapacity = 0;
uint32_t oldInitLength = 0;
if (index.isInt32() && index.toInt32() >= 0) {
- oldCapacity = obj->as<NativeObject>().getDenseCapacity();
- oldInitLength = obj->as<NativeObject>().getDenseInitializedLength();
+ oldCapacity = GetAnyBoxedOrUnboxedCapacity(obj);
+ oldInitLength = GetAnyBoxedOrUnboxedInitializedLength(obj);
}
if (op == JSOP_INITELEM || op == JSOP_INITHIDDENELEM) {
@@ -2618,6 +2756,18 @@ BaselineScript::noteArrayWriteHole(uint32_t pcOffset)
// SetElem_DenseOrUnboxedArray
//
+template <typename T>
+void
+EmitUnboxedPreBarrierForBaseline(MacroAssembler &masm, T address, JSValueType type)
+{
+ if (type == JSVAL_TYPE_OBJECT)
+ EmitPreBarrier(masm, address, MIRType::Object);
+ else if (type == JSVAL_TYPE_STRING)
+ EmitPreBarrier(masm, address, MIRType::String);
+ else
+ MOZ_ASSERT(!UnboxedTypeNeedsPreBarrier(type));
+}
+
bool
ICSetElem_DenseOrUnboxedArray::Compiler::generateStubCode(MacroAssembler& masm)
{
@@ -2736,6 +2886,29 @@ ICSetElem_DenseOrUnboxedArray::Compiler::generateStubCode(MacroAssembler& masm)
masm.loadValue(valueAddr, tmpVal);
EmitPreBarrier(masm, element, MIRType::Value);
masm.storeValue(tmpVal, element);
+ } else {
+ // Set element on an unboxed array.
+
+ // Bounds check.
+ Address initLength(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength());
+ masm.load32(initLength, scratchReg);
+ masm.and32(Imm32(UnboxedArrayObject::InitializedLengthMask), scratchReg);
+ masm.branch32(Assembler::BelowOrEqual, scratchReg, key, &failure);
+
+ // Load obj->elements.
+ masm.loadPtr(Address(obj, UnboxedArrayObject::offsetOfElements()), scratchReg);
+
+ // Compute the address being written to.
+ BaseIndex address(scratchReg, key, ScaleFromElemWidth(UnboxedTypeSize(unboxedType_)));
+
+ EmitUnboxedPreBarrierForBaseline(masm, address, unboxedType_);
+
+ Address valueAddr(masm.getStackPointer(), ICStackValueOffset + sizeof(Value));
+ masm.Push(R0);
+ masm.loadValue(valueAddr, R0);
+ masm.storeUnboxedProperty(address, unboxedType_,
+ ConstantOrRegister(TypedOrValueRegister(R0)), &failurePopR0);
+ masm.Pop(R0);
}
EmitReturnFromIC(masm);
@@ -2929,6 +3102,40 @@ ICSetElemDenseOrUnboxedArrayAddCompiler::generateStubCode(MacroAssembler& masm)
BaseIndex element(scratchReg, key, TimesEight);
masm.loadValue(valueAddr, tmpVal);
masm.storeValue(tmpVal, element);
+ } else {
+ // Adding element to an unboxed array.
+
+ // Bounds check (key == initLength)
+ Address initLengthAddr(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength());
+ masm.load32(initLengthAddr, scratchReg);
+ masm.and32(Imm32(UnboxedArrayObject::InitializedLengthMask), scratchReg);
+ masm.branch32(Assembler::NotEqual, scratchReg, key, &failure);
+
+ // Capacity check.
+ masm.checkUnboxedArrayCapacity(obj, RegisterOrInt32Constant(key), scratchReg, &failure);
+
+ // Load obj->elements.
+ masm.loadPtr(Address(obj, UnboxedArrayObject::offsetOfElements()), scratchReg);
+
+ // Write the value first, since this can fail. No need for pre-barrier
+ // since we're not overwriting an old value.
+ masm.Push(R0);
+ Address valueAddr(masm.getStackPointer(), ICStackValueOffset + sizeof(Value));
+ masm.loadValue(valueAddr, R0);
+ BaseIndex address(scratchReg, key, ScaleFromElemWidth(UnboxedTypeSize(unboxedType_)));
+ masm.storeUnboxedProperty(address, unboxedType_,
+ ConstantOrRegister(TypedOrValueRegister(R0)), &failurePopR0);
+ masm.Pop(R0);
+
+ // Increment initialized length.
+ masm.add32(Imm32(1), initLengthAddr);
+
+ // If length is now <= key, increment length.
+ Address lengthAddr(obj, UnboxedArrayObject::offsetOfLength());
+ Label skipIncrementLength;
+ masm.branch32(Assembler::Above, lengthAddr, key, &skipIncrementLength);
+ masm.add32(Imm32(1), lengthAddr);
+ masm.bind(&skipIncrementLength);
}
EmitReturnFromIC(masm);
@@ -4061,7 +4268,18 @@ TryAttachSetValuePropStub(JSContext* cx, HandleScript script, jsbytecode* pc, IC
return true;
if (!obj->isNative()) {
- return true;
+ if (obj->is<UnboxedPlainObject>()) {
+ UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando();
+ if (expando) {
+ shape = expando->lookup(cx, name);
+ if (!shape)
+ return true;
+ } else {
+ return true;
+ }
+ } else {
+ return true;
+ }
}
size_t chainDepth;
@@ -4209,6 +4427,40 @@ TryAttachSetAccessorPropStub(JSContext* cx, HandleScript script, jsbytecode* pc,
}
static bool
+TryAttachUnboxedSetPropStub(JSContext* cx, HandleScript script,
+ ICSetProp_Fallback* stub, HandleId id,
+ HandleObject obj, HandleValue rhs, bool* attached)
+{
+ MOZ_ASSERT(!*attached);
+
+ if (!cx->runtime()->jitSupportsFloatingPoint)
+ return true;
+
+ if (!obj->is<UnboxedPlainObject>())
+ return true;
+
+ const UnboxedLayout::Property* property = obj->as<UnboxedPlainObject>().layout().lookup(id);
+ if (!property)
+ return true;
+
+ ICSetProp_Unboxed::Compiler compiler(cx, obj->group(),
+ property->offset + UnboxedPlainObject::offsetOfData(),
+ property->type);
+ ICUpdatedStub* newStub = compiler.getStub(compiler.getStubSpace(script));
+ if (!newStub)
+ return false;
+ if (compiler.needsUpdateStubs() && !newStub->addUpdateStubForValue(cx, script, obj, id, rhs))
+ return false;
+
+ stub->addNewStub(newStub);
+
+ StripPreliminaryObjectStubs(cx, stub);
+
+ *attached = true;
+ return true;
+}
+
+static bool
TryAttachTypedObjectSetPropStub(JSContext* cx, HandleScript script,
ICSetProp_Fallback* stub, HandleId id,
HandleObject obj, HandleValue rhs, bool* attached)
@@ -4291,6 +4543,12 @@ DoSetPropFallback(JSContext* cx, BaselineFrame* frame, ICSetProp_Fallback* stub_
return false;
RootedReceiverGuard oldGuard(cx, ReceiverGuard(obj));
+ if (obj->is<UnboxedPlainObject>()) {
+ MOZ_ASSERT(!oldShape);
+ if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando())
+ oldShape = expando->lastProperty();
+ }
+
bool attached = false;
// There are some reasons we can fail to attach a stub that are temporary.
// We want to avoid calling noteUnoptimizableAccess() if the reason we
@@ -4363,6 +4621,15 @@ DoSetPropFallback(JSContext* cx, BaselineFrame* frame, ICSetProp_Fallback* stub_
if (!attached &&
lhs.isObject() &&
+ !TryAttachUnboxedSetPropStub(cx, script, stub, id, obj, rhs, &attached))
+ {
+ return false;
+ }
+ if (attached)
+ return true;
+
+ if (!attached &&
+ lhs.isObject() &&
!TryAttachTypedObjectSetPropStub(cx, script, stub, id, obj, rhs, &attached))
{
return false;
@@ -4445,7 +4712,20 @@ GuardGroupAndShapeMaybeUnboxedExpando(MacroAssembler& masm, JSObject* obj,
// Guard against shape or expando shape.
masm.loadPtr(Address(ICStubReg, offsetOfShape), scratch);
- masm.branchTestObjShape(Assembler::NotEqual, object, scratch, failure);
+ if (obj->is<UnboxedPlainObject>()) {
+ Address expandoAddress(object, UnboxedPlainObject::offsetOfExpando());
+ masm.branchPtr(Assembler::Equal, expandoAddress, ImmWord(0), failure);
+ Label done;
+ masm.push(object);
+ masm.loadPtr(expandoAddress, object);
+ masm.branchTestObjShape(Assembler::Equal, object, scratch, &done);
+ masm.pop(object);
+ masm.jump(failure);
+ masm.bind(&done);
+ masm.pop(object);
+ } else {
+ masm.branchTestObjShape(Assembler::NotEqual, object, scratch, failure);
+ }
}
bool
@@ -4484,7 +4764,13 @@ ICSetProp_Native::Compiler::generateStubCode(MacroAssembler& masm)
regs.takeUnchecked(objReg);
Register holderReg;
- if (isFixedSlot_) {
+ if (obj_->is<UnboxedPlainObject>()) {
+ // We are loading off the expando object, so use that for the holder.
+ holderReg = regs.takeAny();
+ masm.loadPtr(Address(objReg, UnboxedPlainObject::offsetOfExpando()), holderReg);
+ if (!isFixedSlot_)
+ masm.loadPtr(Address(holderReg, NativeObject::offsetOfSlots()), holderReg);
+ } else if (isFixedSlot_) {
holderReg = objReg;
} else {
holderReg = regs.takeAny();
@@ -4621,17 +4907,31 @@ ICSetPropNativeAddCompiler::generateStubCode(MacroAssembler& masm)
regs.add(R0);
regs.takeUnchecked(objReg);
- // Write the object's new shape.
- Address shapeAddr(objReg, ShapedObject::offsetOfShape());
- EmitPreBarrier(masm, shapeAddr, MIRType::Shape);
- masm.loadPtr(Address(ICStubReg, ICSetProp_NativeAdd::offsetOfNewShape()), scratch);
- masm.storePtr(scratch, shapeAddr);
+ if (obj_->is<UnboxedPlainObject>()) {
+ holderReg = regs.takeAny();
+ masm.loadPtr(Address(objReg, UnboxedPlainObject::offsetOfExpando()), holderReg);
+
+ // Write the expando object's new shape.
+ Address shapeAddr(holderReg, ShapedObject::offsetOfShape());
+ EmitPreBarrier(masm, shapeAddr, MIRType::Shape);
+ masm.loadPtr(Address(ICStubReg, ICSetProp_NativeAdd::offsetOfNewShape()), scratch);
+ masm.storePtr(scratch, shapeAddr);
- if (isFixedSlot_) {
- holderReg = objReg;
+ if (!isFixedSlot_)
+ masm.loadPtr(Address(holderReg, NativeObject::offsetOfSlots()), holderReg);
} else {
- holderReg = regs.takeAny();
- masm.loadPtr(Address(objReg, NativeObject::offsetOfSlots()), holderReg);
+ // Write the object's new shape.
+ Address shapeAddr(objReg, ShapedObject::offsetOfShape());
+ EmitPreBarrier(masm, shapeAddr, MIRType::Shape);
+ masm.loadPtr(Address(ICStubReg, ICSetProp_NativeAdd::offsetOfNewShape()), scratch);
+ masm.storePtr(scratch, shapeAddr);
+
+ if (isFixedSlot_) {
+ holderReg = objReg;
+ } else {
+ holderReg = regs.takeAny();
+ masm.loadPtr(Address(objReg, NativeObject::offsetOfSlots()), holderReg);
+ }
}
// Perform the store. No write barrier required since this is a new
@@ -4663,6 +4963,70 @@ ICSetPropNativeAddCompiler::generateStubCode(MacroAssembler& masm)
}
bool
+ICSetProp_Unboxed::Compiler::generateStubCode(MacroAssembler& masm)
+{
+ MOZ_ASSERT(engine_ == Engine::Baseline);
+
+ Label failure;
+
+ // Guard input is an object.
+ masm.branchTestObject(Assembler::NotEqual, R0, &failure);
+
+ AllocatableGeneralRegisterSet regs(availableGeneralRegs(2));
+ Register scratch = regs.takeAny();
+
+ // Unbox and group guard.
+ Register object = masm.extractObject(R0, ExtractTemp0);
+ masm.loadPtr(Address(ICStubReg, ICSetProp_Unboxed::offsetOfGroup()), scratch);
+ masm.branchPtr(Assembler::NotEqual, Address(object, JSObject::offsetOfGroup()), scratch,
+ &failure);
+
+ if (needsUpdateStubs()) {
+ // Stow both R0 and R1 (object and value).
+ EmitStowICValues(masm, 2);
+
+ // Move RHS into R0 for TypeUpdate check.
+ masm.moveValue(R1, R0);
+
+ // Call the type update stub.
+ if (!callTypeUpdateIC(masm, sizeof(Value)))
+ return false;
+
+ // Unstow R0 and R1 (object and key)
+ EmitUnstowICValues(masm, 2);
+
+ // The TypeUpdate IC may have smashed object. Rederive it.
+ masm.unboxObject(R0, object);
+
+ // Trigger post barriers here on the values being written. Fields which
+ // objects can be written to also need update stubs.
+ LiveGeneralRegisterSet saveRegs;
+ saveRegs.add(R0);
+ saveRegs.add(R1);
+ saveRegs.addUnchecked(object);
+ saveRegs.add(ICStubReg);
+ emitPostWriteBarrierSlot(masm, object, R1, scratch, saveRegs);
+ }
+
+ // Compute the address being written to.
+ masm.load32(Address(ICStubReg, ICSetProp_Unboxed::offsetOfFieldOffset()), scratch);
+ BaseIndex address(object, scratch, TimesOne);
+
+ EmitUnboxedPreBarrierForBaseline(masm, address, fieldType_);
+ masm.storeUnboxedProperty(address, fieldType_,
+ ConstantOrRegister(TypedOrValueRegister(R1)), &failure);
+
+ // The RHS has to be in R0.
+ masm.moveValue(R1, R0);
+
+ EmitReturnFromIC(masm);
+
+ masm.bind(&failure);
+ EmitStubGuardFailure(masm);
+ return true;
+}
+
+bool
ICSetProp_TypedObject::Compiler::generateStubCode(MacroAssembler& masm)
{
MOZ_ASSERT(engine_ == Engine::Baseline);
@@ -5135,6 +5499,13 @@ GetTemplateObjectForSimd(JSContext* cx, JSFunction* target, MutableHandleObject
return true;
}
+static void
+EnsureArrayGroupAnalyzed(JSContext* cx, JSObject* obj)
+{
+ if (PreliminaryObjectArrayWithTemplate* objects = obj->group()->maybePreliminaryObjects())
+ objects->maybeAnalyze(cx, obj->group(), /* forceAnalyze = */ true);
+}
+
static bool
GetTemplateObjectForNative(JSContext* cx, HandleFunction target, const CallArgs& args,
MutableHandleObject res, bool* skipAttach)
@@ -5166,7 +5537,10 @@ GetTemplateObjectForNative(JSContext* cx, HandleFunction target, const CallArgs&
// With this and other array templates, analyze the group so that
// we don't end up with a template whose structure might change later.
res.set(NewFullyAllocatedArrayForCallingAllocationSite(cx, count, TenuredObject));
- return !!res;
+ if (!res)
+ return false;
+ EnsureArrayGroupAnalyzed(cx, res);
+ return true;
}
}
@@ -5191,7 +5565,10 @@ GetTemplateObjectForNative(JSContext* cx, HandleFunction target, const CallArgs&
return true;
}
res.set(NewFullyAllocatedArrayTryReuseGroup(cx, obj, 0, TenuredObject));
- return !!res;
+ if (!res)
+ return false;
+ EnsureArrayGroupAnalyzed(cx, res);
+ return true;
}
}
}
@@ -5208,7 +5585,10 @@ GetTemplateObjectForNative(JSContext* cx, HandleFunction target, const CallArgs&
}
res.set(NewFullyAllocatedArrayForCallingAllocationSite(cx, 0, TenuredObject));
- return !!res;
+ if (!res)
+ return false;
+ EnsureArrayGroupAnalyzed(cx, res);
+ return true;
}
if (native == StringConstructor) {
@@ -5421,7 +5801,7 @@ TryAttachCallStub(JSContext* cx, ICCall_Fallback* stub, HandleScript script, jsb
if (!thisObject)
return false;
- if (thisObject->is<PlainObject>())
+ if (thisObject->is<PlainObject>() || thisObject->is<UnboxedPlainObject>())
templateObject = thisObject;
}
@@ -5521,24 +5901,15 @@ TryAttachCallStub(JSContext* cx, ICCall_Fallback* stub, HandleScript script, jsb
}
static bool
-CopyArray(JSContext* cx, HandleArrayObject arr, MutableHandleValue result)
+CopyArray(JSContext* cx, HandleObject obj, MutableHandleValue result)
{
- uint32_t length = arr->length();
- ArrayObject* nobj = NewFullyAllocatedArrayTryReuseGroup(cx, arr, length, TenuredObject);
+ uint32_t length = GetAnyBoxedOrUnboxedArrayLength(obj);
+ JSObject* nobj = NewFullyAllocatedArrayTryReuseGroup(cx, obj, length, TenuredObject);
if (!nobj)
return false;
-
- MOZ_ASSERT(arr->isNative());
- MOZ_ASSERT(nobj->isNative());
- MOZ_ASSERT(nobj->as<NativeObject>().getDenseInitializedLength() == 0);
- MOZ_ASSERT(arr->as<NativeObject>().getDenseInitializedLength() >= length);
- MOZ_ASSERT(nobj->as<NativeObject>().getDenseCapacity() >= length);
-
- nobj->as<NativeObject>().setDenseInitializedLength(length);
-
- const Value* vp = arr->as<NativeObject>().getDenseElements();
- nobj->as<NativeObject>().initDenseElements(0, vp, length);
-
+ EnsureArrayGroupAnalyzed(cx, nobj);
+ CopyAnyBoxedOrUnboxedDenseElements(cx, nobj, obj, 0, 0, length);
+
result.setObject(*nobj);
return true;
}
@@ -5569,22 +5940,26 @@ TryAttachStringSplit(JSContext* cx, ICCall_Fallback* stub, HandleScript script,
RootedValue arr(cx);
// Copy the array before storing in stub.
- if (!CopyArray(cx, obj.as<ArrayObject>(), &arr))
+ if (!CopyArray(cx, obj, &arr))
return false;
// Atomize all elements of the array.
- RootedArrayObject arrObj(cx, &arr.toObject().as<ArrayObject>());
- uint32_t initLength = arrObj->length();
+ RootedObject arrObj(cx, &arr.toObject());
+ uint32_t initLength = GetAnyBoxedOrUnboxedArrayLength(arrObj);
for (uint32_t i = 0; i < initLength; i++) {
- JSAtom* str = js::AtomizeString(cx, arrObj->getDenseElement(i).toString());
+ JSAtom* str = js::AtomizeString(cx, GetAnyBoxedOrUnboxedDenseElement(arrObj, i).toString());
if (!str)
return false;
- arrObj->setDenseElementWithType(cx, i, StringValue(str));
+ if (!SetAnyBoxedOrUnboxedDenseElement(cx, arrObj, i, StringValue(str))) {
+ // The value could not be stored to an unboxed dense element.
+ return true;
+ }
}
ICCall_StringSplit::Compiler compiler(cx, stub->fallbackMonitorStub()->firstMonitorStub(),
- script->pcToOffset(pc), str, sep, arrObj);
+ script->pcToOffset(pc), str, sep,
+ arr);
ICStub* newStub = compiler.getStub(compiler.getStubSpace(script));
if (!newStub)
return false;
@@ -6472,7 +6847,7 @@ ICCallScriptedCompiler::generateStubCode(MacroAssembler& masm)
return true;
}
-typedef bool (*CopyArrayFn)(JSContext*, HandleArrayObject, MutableHandleValue);
+typedef bool (*CopyArrayFn)(JSContext*, HandleObject, MutableHandleValue);
static const VMFunction CopyArrayInfo = FunctionInfo<CopyArrayFn>(CopyArray, "CopyArray");
bool
@@ -7949,6 +8324,19 @@ ICGetElem_Dense::Clone(JSContext* cx, ICStubSpace* space, ICStub* firstMonitorSt
return New<ICGetElem_Dense>(cx, space, other.jitCode(), firstMonitorStub, other.shape_);
}
+ICGetElem_UnboxedArray::ICGetElem_UnboxedArray(JitCode* stubCode, ICStub* firstMonitorStub,
+ ObjectGroup *group)
+ : ICMonitoredStub(GetElem_UnboxedArray, stubCode, firstMonitorStub),
+ group_(group)
+{ }
+
+/* static */ ICGetElem_UnboxedArray*
+ICGetElem_UnboxedArray::Clone(JSContext* cx, ICStubSpace* space, ICStub* firstMonitorStub,
+ ICGetElem_UnboxedArray& other)
+{
+ return New<ICGetElem_UnboxedArray>(cx, space, other.jitCode(), firstMonitorStub, other.group_);
+}
+
ICGetElem_TypedArray::ICGetElem_TypedArray(JitCode* stubCode, Shape* shape, Scalar::Type type)
: ICStub(GetElem_TypedArray, stubCode),
shape_(shape)
@@ -8324,8 +8712,8 @@ static bool DoRestFallback(JSContext* cx, BaselineFrame* frame, ICRest_Fallback*
unsigned numRest = numActuals > numFormals ? numActuals - numFormals : 0;
Value* rest = frame->argv() + numFormals;
- ArrayObject* obj = ObjectGroup::newArrayObject(cx, rest, numRest, GenericObject,
- ObjectGroup::NewArrayKind::UnknownIndex);
+ JSObject* obj = ObjectGroup::newArrayObject(cx, rest, numRest, GenericObject,
+ ObjectGroup::NewArrayKind::UnknownIndex);
if (!obj)
return false;
res.setObject(*obj);
diff --git a/js/src/jit/BaselineIC.h b/js/src/jit/BaselineIC.h
index e1ad12559..5600f816a 100644
--- a/js/src/jit/BaselineIC.h
+++ b/js/src/jit/BaselineIC.h
@@ -22,6 +22,7 @@
#include "jit/SharedICRegisters.h"
#include "js/GCVector.h"
#include "vm/ArrayObject.h"
+#include "vm/UnboxedObject.h"
namespace js {
namespace jit {
@@ -891,6 +892,54 @@ class ICGetElem_Dense : public ICMonitoredStub
};
};
+class ICGetElem_UnboxedArray : public ICMonitoredStub
+{
+ friend class ICStubSpace;
+
+ GCPtrObjectGroup group_;
+
+ ICGetElem_UnboxedArray(JitCode* stubCode, ICStub* firstMonitorStub, ObjectGroup* group);
+
+ public:
+ static ICGetElem_UnboxedArray* Clone(JSContext* cx, ICStubSpace* space,
+ ICStub* firstMonitorStub, ICGetElem_UnboxedArray& other);
+
+ static size_t offsetOfGroup() {
+ return offsetof(ICGetElem_UnboxedArray, group_);
+ }
+
+ GCPtrObjectGroup& group() {
+ return group_;
+ }
+
+ class Compiler : public ICStubCompiler {
+ ICStub* firstMonitorStub_;
+ RootedObjectGroup group_;
+ JSValueType elementType_;
+
+ protected:
+ MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
+
+ virtual int32_t getKey() const {
+ return static_cast<int32_t>(engine_) |
+ (static_cast<int32_t>(kind) << 1) |
+ (static_cast<int32_t>(elementType_) << 17);
+ }
+
+ public:
+ Compiler(JSContext* cx, ICStub* firstMonitorStub, ObjectGroup* group)
+ : ICStubCompiler(cx, ICStub::GetElem_UnboxedArray, Engine::Baseline),
+ firstMonitorStub_(firstMonitorStub),
+ group_(cx, group),
+ elementType_(group->unboxedLayoutDontCheckGeneration().elementType())
+ {}
+
+ ICStub* getStub(ICStubSpace* space) {
+ return newStub<ICGetElem_UnboxedArray>(space, getStubCode(), firstMonitorStub_, group_);
+ }
+ };
+};
+
// Accesses scalar elements of a typed array or typed object.
class ICGetElem_TypedArray : public ICStub
{
@@ -1066,7 +1115,9 @@ class ICSetElem_DenseOrUnboxedArray : public ICUpdatedStub
: ICStubCompiler(cx, ICStub::SetElem_DenseOrUnboxedArray, Engine::Baseline),
shape_(cx, shape),
group_(cx, group),
- unboxedType_(JSVAL_TYPE_MAGIC)
+ unboxedType_(shape
+ ? JSVAL_TYPE_MAGIC
+ : group->unboxedLayoutDontCheckGeneration().elementType())
{}
ICUpdatedStub* getStub(ICStubSpace* space) {
@@ -1174,7 +1225,9 @@ class ICSetElemDenseOrUnboxedArrayAddCompiler : public ICStubCompiler {
: ICStubCompiler(cx, ICStub::SetElem_DenseOrUnboxedArrayAdd, Engine::Baseline),
obj_(cx, obj),
protoChainDepth_(protoChainDepth),
- unboxedType_(JSVAL_TYPE_MAGIC)
+ unboxedType_(obj->is<UnboxedArrayObject>()
+ ? obj->as<UnboxedArrayObject>().elementType()
+ : JSVAL_TYPE_MAGIC)
{}
template <size_t ProtoChainDepth>
@@ -1822,7 +1875,8 @@ class ICSetProp_Native : public ICUpdatedStub
virtual int32_t getKey() const {
return static_cast<int32_t>(engine_) |
(static_cast<int32_t>(kind) << 1) |
- (static_cast<int32_t>(isFixedSlot_) << 17);
+ (static_cast<int32_t>(isFixedSlot_) << 17) |
+ (static_cast<int32_t>(obj_->is<UnboxedPlainObject>()) << 18);
}
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
@@ -1927,6 +1981,7 @@ class ICSetPropNativeAddCompiler : public ICStubCompiler
return static_cast<int32_t>(engine_) |
(static_cast<int32_t>(kind) << 1) |
(static_cast<int32_t>(isFixedSlot_) << 17) |
+ (static_cast<int32_t>(obj_->is<UnboxedPlainObject>()) << 18) |
(static_cast<int32_t>(protoChainDepth_) << 19);
}
@@ -1951,7 +2006,10 @@ class ICSetPropNativeAddCompiler : public ICStubCompiler
newGroup = nullptr;
RootedShape newShape(cx);
- newShape = obj_->as<NativeObject>().lastProperty();
+ if (obj_->isNative())
+ newShape = obj_->as<NativeObject>().lastProperty();
+ else
+ newShape = obj_->as<UnboxedPlainObject>().maybeExpando()->lastProperty();
return newStub<ICSetProp_NativeAddImpl<ProtoChainDepth>>(
space, getStubCode(), oldGroup_, shapes, newShape, newGroup, offset_);
@@ -2816,10 +2874,10 @@ class ICCall_StringSplit : public ICMonitoredStub
uint32_t pcOffset_;
GCPtrString expectedStr_;
GCPtrString expectedSep_;
- GCPtrArrayObject templateObject_;
+ GCPtrObject templateObject_;
ICCall_StringSplit(JitCode* stubCode, ICStub* firstMonitorStub, uint32_t pcOffset, JSString* str,
- JSString* sep, ArrayObject* templateObject)
+ JSString* sep, JSObject* templateObject)
: ICMonitoredStub(ICStub::Call_StringSplit, stubCode, firstMonitorStub),
pcOffset_(pcOffset), expectedStr_(str), expectedSep_(sep),
templateObject_(templateObject)
@@ -2846,7 +2904,7 @@ class ICCall_StringSplit : public ICMonitoredStub
return expectedSep_;
}
- GCPtrArrayObject& templateObject() {
+ GCPtrObject& templateObject() {
return templateObject_;
}
@@ -2856,7 +2914,7 @@ class ICCall_StringSplit : public ICMonitoredStub
uint32_t pcOffset_;
RootedString expectedStr_;
RootedString expectedSep_;
- RootedArrayObject templateObject_;
+ RootedObject templateObject_;
MOZ_MUST_USE bool generateStubCode(MacroAssembler& masm);
@@ -2867,13 +2925,13 @@ class ICCall_StringSplit : public ICMonitoredStub
public:
Compiler(JSContext* cx, ICStub* firstMonitorStub, uint32_t pcOffset, HandleString str,
- HandleString sep, HandleArrayObject templateObject)
+ HandleString sep, HandleValue templateObject)
: ICCallStubCompiler(cx, ICStub::Call_StringSplit),
firstMonitorStub_(firstMonitorStub),
pcOffset_(pcOffset),
expectedStr_(cx, str),
expectedSep_(cx, sep),
- templateObject_(cx, templateObject)
+ templateObject_(cx, &templateObject.toObject())
{ }
ICStub* getStub(ICStubSpace* space) {
diff --git a/js/src/jit/BaselineInspector.cpp b/js/src/jit/BaselineInspector.cpp
index 3b852debf..c9e09bed7 100644
--- a/js/src/jit/BaselineInspector.cpp
+++ b/js/src/jit/BaselineInspector.cpp
@@ -96,19 +96,32 @@ VectorAppendNoDuplicate(S& list, T value)
static bool
AddReceiver(const ReceiverGuard& receiver,
- BaselineInspector::ReceiverVector& receivers)
+ BaselineInspector::ReceiverVector& receivers,
+ BaselineInspector::ObjectGroupVector& convertUnboxedGroups)
{
+ if (receiver.group && receiver.group->maybeUnboxedLayout()) {
+ if (receiver.group->unboxedLayout().nativeGroup())
+ return VectorAppendNoDuplicate(convertUnboxedGroups, receiver.group);
+ }
return VectorAppendNoDuplicate(receivers, receiver);
}
static bool
GetCacheIRReceiverForNativeReadSlot(ICCacheIR_Monitored* stub, ReceiverGuard* receiver)
{
- // We match:
+ // We match either:
//
// GuardIsObject 0
// GuardShape 0
// LoadFixedSlotResult 0 or LoadDynamicSlotResult 0
+ //
+ // or
+ //
+ // GuardIsObject 0
+ // GuardGroup 0
+ // 1: GuardAndLoadUnboxedExpando 0
+ // GuardShape 1
+ // LoadFixedSlotResult 1 or LoadDynamicSlotResult 1
*receiver = ReceiverGuard();
CacheIRReader reader(stub->stubInfo());
@@ -117,6 +130,14 @@ GetCacheIRReceiverForNativeReadSlot(ICCacheIR_Monitored* stub, ReceiverGuard* re
if (!reader.matchOp(CacheOp::GuardIsObject, objId))
return false;
+ if (reader.matchOp(CacheOp::GuardGroup, objId)) {
+ receiver->group = stub->stubInfo()->getStubField<ObjectGroup*>(stub, reader.stubOffset());
+
+ if (!reader.matchOp(CacheOp::GuardAndLoadUnboxedExpando, objId))
+ return false;
+ objId = reader.objOperandId();
+ }
+
if (reader.matchOp(CacheOp::GuardShape, objId)) {
receiver->shape = stub->stubInfo()->getStubField<Shape*>(stub, reader.stubOffset());
return reader.matchOpEither(CacheOp::LoadFixedSlotResult, CacheOp::LoadDynamicSlotResult);
@@ -125,13 +146,40 @@ GetCacheIRReceiverForNativeReadSlot(ICCacheIR_Monitored* stub, ReceiverGuard* re
return false;
}
+static bool
+GetCacheIRReceiverForUnboxedProperty(ICCacheIR_Monitored* stub, ReceiverGuard* receiver)
+{
+ // We match:
+ //
+ // GuardIsObject 0
+ // GuardGroup 0
+ // LoadUnboxedPropertyResult 0 ..
+
+ *receiver = ReceiverGuard();
+ CacheIRReader reader(stub->stubInfo());
+
+ ObjOperandId objId = ObjOperandId(0);
+ if (!reader.matchOp(CacheOp::GuardIsObject, objId))
+ return false;
+
+ if (!reader.matchOp(CacheOp::GuardGroup, objId))
+ return false;
+ receiver->group = stub->stubInfo()->getStubField<ObjectGroup*>(stub, reader.stubOffset());
+
+ return reader.matchOp(CacheOp::LoadUnboxedPropertyResult, objId);
+}
+
bool
-BaselineInspector::maybeInfoForPropertyOp(jsbytecode* pc, ReceiverVector& receivers)
+BaselineInspector::maybeInfoForPropertyOp(jsbytecode* pc, ReceiverVector& receivers,
+ ObjectGroupVector& convertUnboxedGroups)
{
// Return a list of the receivers seen by the baseline IC for the current
// op. Empty lists indicate no receivers are known, or there was an
- // uncacheable access.
+ // uncacheable access. convertUnboxedGroups is used for unboxed object
+ // groups which have been seen, but have had instances converted to native
+ // objects and should be eagerly converted by Ion.
MOZ_ASSERT(receivers.empty());
+ MOZ_ASSERT(convertUnboxedGroups.empty());
if (!hasBaselineScript())
return true;
@@ -143,7 +191,8 @@ BaselineInspector::maybeInfoForPropertyOp(jsbytecode* pc, ReceiverVector& receiv
while (stub->next()) {
ReceiverGuard receiver;
if (stub->isCacheIR_Monitored()) {
- if (!GetCacheIRReceiverForNativeReadSlot(stub->toCacheIR_Monitored(), &receiver))
+ if (!GetCacheIRReceiverForNativeReadSlot(stub->toCacheIR_Monitored(), &receiver) &&
+ !GetCacheIRReceiverForUnboxedProperty(stub->toCacheIR_Monitored(), &receiver))
{
receivers.clear();
return true;
@@ -151,12 +200,14 @@ BaselineInspector::maybeInfoForPropertyOp(jsbytecode* pc, ReceiverVector& receiv
} else if (stub->isSetProp_Native()) {
receiver = ReceiverGuard(stub->toSetProp_Native()->group(),
stub->toSetProp_Native()->shape());
+ } else if (stub->isSetProp_Unboxed()) {
+ receiver = ReceiverGuard(stub->toSetProp_Unboxed()->group(), nullptr);
} else {
receivers.clear();
return true;
}
- if (!AddReceiver(receiver, receivers))
+ if (!AddReceiver(receiver, receivers, convertUnboxedGroups))
return false;
stub = stub->next();
@@ -538,7 +589,7 @@ BaselineInspector::getTemplateObjectForNative(jsbytecode* pc, Native native)
bool
BaselineInspector::isOptimizableCallStringSplit(jsbytecode* pc, JSString** strOut, JSString** sepOut,
- ArrayObject** objOut)
+ JSObject** objOut)
{
if (!hasBaselineScript())
return false;
@@ -649,12 +700,14 @@ bool
BaselineInspector::commonGetPropFunction(jsbytecode* pc, JSObject** holder, Shape** holderShape,
JSFunction** commonGetter, Shape** globalShape,
bool* isOwnProperty,
- ReceiverVector& receivers)
+ ReceiverVector& receivers,
+ ObjectGroupVector& convertUnboxedGroups)
{
if (!hasBaselineScript())
return false;
MOZ_ASSERT(receivers.empty());
+ MOZ_ASSERT(convertUnboxedGroups.empty());
*holder = nullptr;
const ICEntry& entry = icEntryFromPC(pc);
@@ -666,7 +719,7 @@ BaselineInspector::commonGetPropFunction(jsbytecode* pc, JSObject** holder, Shap
{
ICGetPropCallGetter* nstub = static_cast<ICGetPropCallGetter*>(stub);
bool isOwn = nstub->isOwnGetter();
- if (!isOwn && !AddReceiver(nstub->receiverGuard(), receivers))
+ if (!isOwn && !AddReceiver(nstub->receiverGuard(), receivers, convertUnboxedGroups))
return false;
if (!*holder) {
@@ -698,19 +751,21 @@ BaselineInspector::commonGetPropFunction(jsbytecode* pc, JSObject** holder, Shap
if (!*holder)
return false;
- MOZ_ASSERT(*isOwnProperty == (receivers.empty()));
+ MOZ_ASSERT(*isOwnProperty == (receivers.empty() && convertUnboxedGroups.empty()));
return true;
}
bool
BaselineInspector::commonSetPropFunction(jsbytecode* pc, JSObject** holder, Shape** holderShape,
JSFunction** commonSetter, bool* isOwnProperty,
- ReceiverVector& receivers)
+ ReceiverVector& receivers,
+ ObjectGroupVector& convertUnboxedGroups)
{
if (!hasBaselineScript())
return false;
MOZ_ASSERT(receivers.empty());
+ MOZ_ASSERT(convertUnboxedGroups.empty());
*holder = nullptr;
const ICEntry& entry = icEntryFromPC(pc);
@@ -719,7 +774,7 @@ BaselineInspector::commonSetPropFunction(jsbytecode* pc, JSObject** holder, Shap
if (stub->isSetProp_CallScripted() || stub->isSetProp_CallNative()) {
ICSetPropCallSetter* nstub = static_cast<ICSetPropCallSetter*>(stub);
bool isOwn = nstub->isOwnSetter();
- if (!isOwn && !AddReceiver(nstub->receiverGuard(), receivers))
+ if (!isOwn && !AddReceiver(nstub->receiverGuard(), receivers, convertUnboxedGroups))
return false;
if (!*holder) {
diff --git a/js/src/jit/BaselineInspector.h b/js/src/jit/BaselineInspector.h
index 1ed4b5547..961df18aa 100644
--- a/js/src/jit/BaselineInspector.h
+++ b/js/src/jit/BaselineInspector.h
@@ -95,7 +95,8 @@ class BaselineInspector
public:
typedef Vector<ReceiverGuard, 4, JitAllocPolicy> ReceiverVector;
typedef Vector<ObjectGroup*, 4, JitAllocPolicy> ObjectGroupVector;
- MOZ_MUST_USE bool maybeInfoForPropertyOp(jsbytecode* pc, ReceiverVector& receivers);
+ MOZ_MUST_USE bool maybeInfoForPropertyOp(jsbytecode* pc, ReceiverVector& receivers,
+ ObjectGroupVector& convertUnboxedGroups);
SetElemICInspector setElemICInspector(jsbytecode* pc) {
return makeICInspector<SetElemICInspector>(pc, ICStub::SetElem_Fallback);
@@ -113,7 +114,7 @@ class BaselineInspector
bool hasSeenNonStringIterMore(jsbytecode* pc);
MOZ_MUST_USE bool isOptimizableCallStringSplit(jsbytecode* pc, JSString** strOut,
- JSString** sepOut, ArrayObject** objOut);
+ JSString** sepOut, JSObject** objOut);
JSObject* getTemplateObject(jsbytecode* pc);
JSObject* getTemplateObjectForNative(jsbytecode* pc, Native native);
JSObject* getTemplateObjectForClassHook(jsbytecode* pc, const Class* clasp);
@@ -130,10 +131,12 @@ class BaselineInspector
MOZ_MUST_USE bool commonGetPropFunction(jsbytecode* pc, JSObject** holder, Shape** holderShape,
JSFunction** commonGetter, Shape** globalShape,
- bool* isOwnProperty, ReceiverVector& receivers);
+ bool* isOwnProperty, ReceiverVector& receivers,
+ ObjectGroupVector& convertUnboxedGroups);
MOZ_MUST_USE bool commonSetPropFunction(jsbytecode* pc, JSObject** holder, Shape** holderShape,
JSFunction** commonSetter, bool* isOwnProperty,
- ReceiverVector& receivers);
+ ReceiverVector& receivers,
+ ObjectGroupVector& convertUnboxedGroups);
MOZ_MUST_USE bool instanceOfData(jsbytecode* pc, Shape** shape, uint32_t* slot,
JSObject** prototypeObject);
diff --git a/js/src/jit/CacheIR.cpp b/js/src/jit/CacheIR.cpp
index d184ea40c..f1061af70 100644
--- a/js/src/jit/CacheIR.cpp
+++ b/js/src/jit/CacheIR.cpp
@@ -10,7 +10,8 @@
#include "jit/IonCaches.h"
#include "jsobjinlines.h"
-#include "vm/NativeObject-inl.h"
+
+#include "vm/UnboxedObject-inl.h"
using namespace js;
using namespace js::jit;
@@ -59,6 +60,10 @@ GetPropIRGenerator::tryAttachStub(Maybe<CacheIRWriter>& writer)
return false;
if (!emitted_ && !tryAttachNative(*writer, obj, objId))
return false;
+ if (!emitted_ && !tryAttachUnboxed(*writer, obj, objId))
+ return false;
+ if (!emitted_ && !tryAttachUnboxedExpando(*writer, obj, objId))
+ return false;
if (!emitted_ && !tryAttachTypedObject(*writer, obj, objId))
return false;
if (!emitted_ && !tryAttachModuleNamespace(*writer, obj, objId))
@@ -158,9 +163,19 @@ GeneratePrototypeGuards(CacheIRWriter& writer, JSObject* obj, JSObject* holder,
}
static void
-TestMatchingReceiver(CacheIRWriter& writer, JSObject* obj, Shape* shape, ObjOperandId objId)
+TestMatchingReceiver(CacheIRWriter& writer, JSObject* obj, Shape* shape, ObjOperandId objId,
+ Maybe<ObjOperandId>* expandoId)
{
- if (obj->is<TypedObject>()) {
+ if (obj->is<UnboxedPlainObject>()) {
+ writer.guardGroup(objId, obj->group());
+
+ if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando()) {
+ expandoId->emplace(writer.guardAndLoadUnboxedExpando(objId));
+ writer.guardShape(expandoId->ref(), expando->lastProperty());
+ } else {
+ writer.guardNoUnboxedExpando(objId);
+ }
+ } else if (obj->is<UnboxedArrayObject>() || obj->is<TypedObject>()) {
writer.guardGroup(objId, obj->group());
} else {
Shape* shape = obj->maybeShape();
@@ -173,7 +188,8 @@ static void
EmitReadSlotResult(CacheIRWriter& writer, JSObject* obj, JSObject* holder,
Shape* shape, ObjOperandId objId)
{
- TestMatchingReceiver(writer, obj, shape, objId);
+ Maybe<ObjOperandId> expandoId;
+ TestMatchingReceiver(writer, obj, shape, objId, &expandoId);
ObjOperandId holderId;
if (obj != holder) {
@@ -196,6 +212,9 @@ EmitReadSlotResult(CacheIRWriter& writer, JSObject* obj, JSObject* holder,
lastObjId = protoId;
}
}
+ } else if (obj->is<UnboxedPlainObject>()) {
+ holder = obj->as<UnboxedPlainObject>().maybeExpando();
+ holderId = *expandoId;
} else {
holderId = objId;
}
@@ -247,6 +266,51 @@ GetPropIRGenerator::tryAttachNative(CacheIRWriter& writer, HandleObject obj, Obj
}
bool
+GetPropIRGenerator::tryAttachUnboxed(CacheIRWriter& writer, HandleObject obj, ObjOperandId objId)
+{
+ MOZ_ASSERT(!emitted_);
+
+ if (!obj->is<UnboxedPlainObject>())
+ return true;
+
+ const UnboxedLayout::Property* property = obj->as<UnboxedPlainObject>().layout().lookup(name_);
+ if (!property)
+ return true;
+
+ if (!cx_->runtime()->jitSupportsFloatingPoint)
+ return true;
+
+ writer.guardGroup(objId, obj->group());
+ writer.loadUnboxedPropertyResult(objId, property->type,
+ UnboxedPlainObject::offsetOfData() + property->offset);
+ emitted_ = true;
+ preliminaryObjectAction_ = PreliminaryObjectAction::Unlink;
+ return true;
+}
+
+bool
+GetPropIRGenerator::tryAttachUnboxedExpando(CacheIRWriter& writer, HandleObject obj, ObjOperandId objId)
+{
+ MOZ_ASSERT(!emitted_);
+
+ if (!obj->is<UnboxedPlainObject>())
+ return true;
+
+ UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando();
+ if (!expando)
+ return true;
+
+ Shape* shape = expando->lookup(cx_, NameToId(name_));
+ if (!shape || !shape->hasDefaultGetter() || !shape->hasSlot())
+ return true;
+
+ emitted_ = true;
+
+ EmitReadSlotResult(writer, obj, obj, shape, objId);
+ return true;
+}
+
+bool
GetPropIRGenerator::tryAttachTypedObject(CacheIRWriter& writer, HandleObject obj, ObjOperandId objId)
{
MOZ_ASSERT(!emitted_);
@@ -304,6 +368,13 @@ GetPropIRGenerator::tryAttachObjectLength(CacheIRWriter& writer, HandleObject ob
return true;
}
+ if (obj->is<UnboxedArrayObject>()) {
+ writer.guardClass(objId, GuardClassKind::UnboxedArray);
+ writer.loadUnboxedArrayLengthResult(objId);
+ emitted_ = true;
+ return true;
+ }
+
if (obj->is<ArgumentsObject>() && !obj->as<ArgumentsObject>().hasOverriddenLength()) {
if (obj->is<MappedArgumentsObject>()) {
writer.guardClass(objId, GuardClassKind::MappedArguments);
diff --git a/js/src/jit/CacheIR.h b/js/src/jit/CacheIR.h
index ae55cfebb..51e55f48b 100644
--- a/js/src/jit/CacheIR.h
+++ b/js/src/jit/CacheIR.h
@@ -87,12 +87,16 @@ class ObjOperandId : public OperandId
_(GuardClass) \
_(GuardSpecificObject) \
_(GuardNoDetachedTypedObjects) \
+ _(GuardNoUnboxedExpando) \
+ _(GuardAndLoadUnboxedExpando) \
_(LoadObject) \
_(LoadProto) \
_(LoadFixedSlotResult) \
_(LoadDynamicSlotResult) \
+ _(LoadUnboxedPropertyResult) \
_(LoadTypedObjectResult) \
_(LoadInt32ArrayLengthResult) \
+ _(LoadUnboxedArrayLengthResult) \
_(LoadArgumentsObjectLengthResult) \
_(LoadUndefinedResult)
@@ -124,6 +128,7 @@ struct StubField {
enum class GuardClassKind
{
Array,
+ UnboxedArray,
MappedArguments,
UnmappedArguments,
};
@@ -271,6 +276,15 @@ class MOZ_RAII CacheIRWriter
void guardNoDetachedTypedObjects() {
writeOp(CacheOp::GuardNoDetachedTypedObjects);
}
+ void guardNoUnboxedExpando(ObjOperandId obj) {
+ writeOpWithOperandId(CacheOp::GuardNoUnboxedExpando, obj);
+ }
+ ObjOperandId guardAndLoadUnboxedExpando(ObjOperandId obj) {
+ ObjOperandId res(nextOperandId_++);
+ writeOpWithOperandId(CacheOp::GuardAndLoadUnboxedExpando, obj);
+ writeOperandId(res);
+ return res;
+ }
ObjOperandId loadObject(JSObject* obj) {
ObjOperandId res(nextOperandId_++);
@@ -296,6 +310,11 @@ class MOZ_RAII CacheIRWriter
writeOpWithOperandId(CacheOp::LoadDynamicSlotResult, obj);
addStubWord(offset, StubField::GCType::NoGCThing);
}
+ void loadUnboxedPropertyResult(ObjOperandId obj, JSValueType type, size_t offset) {
+ writeOpWithOperandId(CacheOp::LoadUnboxedPropertyResult, obj);
+ buffer_.writeByte(uint32_t(type));
+ addStubWord(offset, StubField::GCType::NoGCThing);
+ }
void loadTypedObjectResult(ObjOperandId obj, uint32_t offset, TypedThingLayout layout,
uint32_t typeDescr) {
MOZ_ASSERT(uint32_t(layout) <= UINT8_MAX);
@@ -308,6 +327,9 @@ class MOZ_RAII CacheIRWriter
void loadInt32ArrayLengthResult(ObjOperandId obj) {
writeOpWithOperandId(CacheOp::LoadInt32ArrayLengthResult, obj);
}
+ void loadUnboxedArrayLengthResult(ObjOperandId obj) {
+ writeOpWithOperandId(CacheOp::LoadUnboxedArrayLengthResult, obj);
+ }
void loadArgumentsObjectLengthResult(ObjOperandId obj) {
writeOpWithOperandId(CacheOp::LoadArgumentsObjectLengthResult, obj);
}
@@ -389,6 +411,9 @@ class MOZ_RAII GetPropIRGenerator
PreliminaryObjectAction preliminaryObjectAction_;
MOZ_MUST_USE bool tryAttachNative(CacheIRWriter& writer, HandleObject obj, ObjOperandId objId);
+ MOZ_MUST_USE bool tryAttachUnboxed(CacheIRWriter& writer, HandleObject obj, ObjOperandId objId);
+ MOZ_MUST_USE bool tryAttachUnboxedExpando(CacheIRWriter& writer, HandleObject obj,
+ ObjOperandId objId);
MOZ_MUST_USE bool tryAttachTypedObject(CacheIRWriter& writer, HandleObject obj,
ObjOperandId objId);
MOZ_MUST_USE bool tryAttachObjectLength(CacheIRWriter& writer, HandleObject obj,
diff --git a/js/src/jit/CodeGenerator.cpp b/js/src/jit/CodeGenerator.cpp
index 2b1c671d1..bb12b09c8 100644
--- a/js/src/jit/CodeGenerator.cpp
+++ b/js/src/jit/CodeGenerator.cpp
@@ -25,7 +25,6 @@
#include "builtin/Eval.h"
#include "builtin/TypedObject.h"
#include "gc/Nursery.h"
-#include "gc/StoreBuffer-inl.h"
#include "irregexp/NativeRegExpMacroAssembler.h"
#include "jit/AtomicOperations.h"
#include "jit/BaselineCompiler.h"
@@ -3029,10 +3028,19 @@ CodeGenerator::visitStoreSlotV(LStoreSlotV* lir)
static void
GuardReceiver(MacroAssembler& masm, const ReceiverGuard& guard,
- Register obj, Register scratch, Label* miss)
+ Register obj, Register scratch, Label* miss, bool checkNullExpando)
{
if (guard.group) {
masm.branchTestObjGroup(Assembler::NotEqual, obj, guard.group, miss);
+
+ Address expandoAddress(obj, UnboxedPlainObject::offsetOfExpando());
+ if (guard.shape) {
+ masm.loadPtr(expandoAddress, scratch);
+ masm.branchPtr(Assembler::Equal, scratch, ImmWord(0), miss);
+ masm.branchTestObjShape(Assembler::NotEqual, scratch, guard.shape, miss);
+ } else if (checkNullExpando) {
+ masm.branchPtr(Assembler::NotEqual, expandoAddress, ImmWord(0), miss);
+ }
} else {
masm.branchTestObjShape(Assembler::NotEqual, obj, guard.shape, miss);
}
@@ -3051,11 +3059,13 @@ CodeGenerator::emitGetPropertyPolymorphic(LInstruction* ins, Register obj, Regis
Label next;
masm.comment("GuardReceiver");
- GuardReceiver(masm, receiver, obj, scratch, &next);
+ GuardReceiver(masm, receiver, obj, scratch, &next, /* checkNullExpando = */ false);
if (receiver.shape) {
masm.comment("loadTypedOrValue");
- Register target = obj;
+ // If this is an unboxed expando access, GuardReceiver loaded the
+ // expando object into scratch.
+ Register target = receiver.group ? scratch : obj;
Shape* shape = mir->shape(i);
if (shape->slot() < shape->numFixedSlots()) {
@@ -3068,6 +3078,13 @@ CodeGenerator::emitGetPropertyPolymorphic(LInstruction* ins, Register obj, Regis
masm.loadPtr(Address(target, NativeObject::offsetOfSlots()), scratch);
masm.loadTypedOrValue(Address(scratch, offset), output);
}
+ } else {
+ masm.comment("loadUnboxedProperty");
+ const UnboxedLayout::Property* property =
+ receiver.group->unboxedLayout().lookup(mir->name());
+ Address propertyAddr(obj, UnboxedPlainObject::offsetOfData() + property->offset);
+
+ masm.loadUnboxedProperty(propertyAddr, property->type, output);
}
if (i == mir->numReceivers() - 1) {
@@ -3108,6 +3125,8 @@ EmitUnboxedPreBarrier(MacroAssembler &masm, T address, JSValueType type)
masm.patchableCallPreBarrier(address, MIRType::Object);
else if (type == JSVAL_TYPE_STRING)
masm.patchableCallPreBarrier(address, MIRType::String);
+ else
+ MOZ_ASSERT(!UnboxedTypeNeedsPreBarrier(type));
}
void
@@ -3121,10 +3140,12 @@ CodeGenerator::emitSetPropertyPolymorphic(LInstruction* ins, Register obj, Regis
ReceiverGuard receiver = mir->receiver(i);
Label next;
- GuardReceiver(masm, receiver, obj, scratch, &next);
+ GuardReceiver(masm, receiver, obj, scratch, &next, /* checkNullExpando = */ false);
if (receiver.shape) {
- Register target = obj;
+ // If this is an unboxed expando access, GuardReceiver loaded the
+ // expando object into scratch.
+ Register target = receiver.group ? scratch : obj;
Shape* shape = mir->shape(i);
if (shape->slot() < shape->numFixedSlots()) {
@@ -3141,6 +3162,13 @@ CodeGenerator::emitSetPropertyPolymorphic(LInstruction* ins, Register obj, Regis
emitPreBarrier(addr);
masm.storeConstantOrRegister(value, addr);
}
+ } else {
+ const UnboxedLayout::Property* property =
+ receiver.group->unboxedLayout().lookup(mir->name());
+ Address propertyAddr(obj, UnboxedPlainObject::offsetOfData() + property->offset);
+
+ EmitUnboxedPreBarrier(masm, propertyAddr, property->type);
+ masm.storeUnboxedProperty(propertyAddr, property->type, value, nullptr);
}
if (i == mir->numReceivers() - 1) {
@@ -3181,7 +3209,9 @@ CodeGenerator::visitSetPropertyPolymorphicT(LSetPropertyPolymorphicT* ins)
void
CodeGenerator::visitElements(LElements* lir)
{
- Address elements(ToRegister(lir->object()), NativeObject::offsetOfElements());
+ Address elements(ToRegister(lir->object()),
+ lir->mir()->unboxed() ? UnboxedArrayObject::offsetOfElements()
+ : NativeObject::offsetOfElements());
masm.loadPtr(elements, ToRegister(lir->output()));
}
@@ -3290,7 +3320,7 @@ CodeGenerator::visitGuardReceiverPolymorphic(LGuardReceiverPolymorphic* lir)
const ReceiverGuard& receiver = mir->receiver(i);
Label next;
- GuardReceiver(masm, receiver, obj, temp, &next);
+ GuardReceiver(masm, receiver, obj, temp, &next, /* checkNullExpando = */ true);
if (i == mir->numReceivers() - 1) {
bailoutFrom(&next, lir->snapshot());
@@ -3304,6 +3334,27 @@ CodeGenerator::visitGuardReceiverPolymorphic(LGuardReceiverPolymorphic* lir)
}
void
+CodeGenerator::visitGuardUnboxedExpando(LGuardUnboxedExpando* lir)
+{
+ Label miss;
+
+ Register obj = ToRegister(lir->object());
+ masm.branchPtr(lir->mir()->requireExpando() ? Assembler::Equal : Assembler::NotEqual,
+ Address(obj, UnboxedPlainObject::offsetOfExpando()), ImmWord(0), &miss);
+
+ bailoutFrom(&miss, lir->snapshot());
+}
+
+void
+CodeGenerator::visitLoadUnboxedExpando(LLoadUnboxedExpando* lir)
+{
+ Register obj = ToRegister(lir->object());
+ Register result = ToRegister(lir->getDef(0));
+
+ masm.loadPtr(Address(obj, UnboxedPlainObject::offsetOfExpando()), result);
+}
+
+void
CodeGenerator::visitTypeBarrierV(LTypeBarrierV* lir)
{
ValueOperand operand = ToValue(lir, LTypeBarrierV::Input);
@@ -5166,11 +5217,11 @@ static JSObject*
NewArrayWithGroup(JSContext* cx, uint32_t length, HandleObjectGroup group,
bool convertDoubleElements)
{
- ArrayObject* res = NewFullyAllocatedArrayTryUseGroup(cx, group, length);
+ JSObject* res = NewFullyAllocatedArrayTryUseGroup(cx, group, length);
if (!res)
return nullptr;
if (convertDoubleElements)
- res->setShouldConvertDoubleElements();
+ res->as<ArrayObject>().setShouldConvertDoubleElements();
return res;
}
@@ -5316,7 +5367,7 @@ CodeGenerator::visitNewArrayCopyOnWrite(LNewArrayCopyOnWrite* lir)
masm.bind(ool->rejoin());
}
-typedef ArrayObject* (*ArrayConstructorOneArgFn)(JSContext*, HandleObjectGroup, int32_t length);
+typedef JSObject* (*ArrayConstructorOneArgFn)(JSContext*, HandleObjectGroup, int32_t length);
static const VMFunction ArrayConstructorOneArgInfo =
FunctionInfo<ArrayConstructorOneArgFn>(ArrayConstructorOneArg, "ArrayConstructorOneArg");
@@ -5336,11 +5387,21 @@ CodeGenerator::visitNewArrayDynamicLength(LNewArrayDynamicLength* lir)
bool canInline = true;
size_t inlineLength = 0;
- if (templateObject->as<ArrayObject>().hasFixedElements()) {
- size_t numSlots = gc::GetGCKindSlots(templateObject->asTenured().getAllocKind());
- inlineLength = numSlots - ObjectElements::VALUES_PER_HEADER;
+ if (templateObject->is<ArrayObject>()) {
+ if (templateObject->as<ArrayObject>().hasFixedElements()) {
+ size_t numSlots = gc::GetGCKindSlots(templateObject->asTenured().getAllocKind());
+ inlineLength = numSlots - ObjectElements::VALUES_PER_HEADER;
+ } else {
+ canInline = false;
+ }
} else {
- canInline = false;
+ if (templateObject->as<UnboxedArrayObject>().hasInlineElements()) {
+ size_t nbytes =
+ templateObject->tenuredSizeOfThis() - UnboxedArrayObject::offsetOfInlineElements();
+ inlineLength = nbytes / templateObject->as<UnboxedArrayObject>().elementSize();
+ } else {
+ canInline = false;
+ }
}
if (canInline) {
@@ -7762,7 +7823,7 @@ CodeGenerator::visitSinCos(LSinCos *lir)
masm.freeStack(sizeof(double) * 2);
}
-typedef ArrayObject* (*StringSplitFn)(JSContext*, HandleObjectGroup, HandleString, HandleString, uint32_t);
+typedef JSObject* (*StringSplitFn)(JSContext*, HandleObjectGroup, HandleString, HandleString, uint32_t);
static const VMFunction StringSplitInfo =
FunctionInfo<StringSplitFn>(js::str_split_string, "str_split_string");
@@ -7797,6 +7858,49 @@ CodeGenerator::visitSetInitializedLength(LSetInitializedLength* lir)
}
void
+CodeGenerator::visitUnboxedArrayLength(LUnboxedArrayLength* lir)
+{
+ Register obj = ToRegister(lir->object());
+ Register result = ToRegister(lir->output());
+ masm.load32(Address(obj, UnboxedArrayObject::offsetOfLength()), result);
+}
+
+void
+CodeGenerator::visitUnboxedArrayInitializedLength(LUnboxedArrayInitializedLength* lir)
+{
+ Register obj = ToRegister(lir->object());
+ Register result = ToRegister(lir->output());
+ masm.load32(Address(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength()), result);
+ masm.and32(Imm32(UnboxedArrayObject::InitializedLengthMask), result);
+}
+
+void
+CodeGenerator::visitIncrementUnboxedArrayInitializedLength(LIncrementUnboxedArrayInitializedLength* lir)
+{
+ Register obj = ToRegister(lir->object());
+ masm.add32(Imm32(1), Address(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength()));
+}
+
+void
+CodeGenerator::visitSetUnboxedArrayInitializedLength(LSetUnboxedArrayInitializedLength* lir)
+{
+ Register obj = ToRegister(lir->object());
+ RegisterOrInt32Constant key = ToRegisterOrInt32Constant(lir->length());
+ Register temp = ToRegister(lir->temp());
+
+ Address initLengthAddr(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength());
+ masm.load32(initLengthAddr, temp);
+ masm.and32(Imm32(UnboxedArrayObject::CapacityMask), temp);
+
+ if (key.isRegister())
+ masm.or32(key.reg(), temp);
+ else
+ masm.or32(Imm32(key.constant()), temp);
+
+ masm.store32(temp, initLengthAddr);
+}
+
+void
CodeGenerator::visitNotO(LNotO* lir)
{
MOZ_ASSERT(lir->mir()->operandMightEmulateUndefined(),
@@ -8092,19 +8196,46 @@ CodeGenerator::emitStoreElementHoleT(T* lir)
OutOfLineStoreElementHole* ool = new(alloc()) OutOfLineStoreElementHole(lir);
addOutOfLineCode(ool, lir->mir());
+ Register obj = ToRegister(lir->object());
Register elements = ToRegister(lir->elements());
const LAllocation* index = lir->index();
RegisterOrInt32Constant key = ToRegisterOrInt32Constant(index);
- Address initLength(elements, ObjectElements::offsetOfInitializedLength());
- masm.branch32(Assembler::BelowOrEqual, initLength, key, ool->entry());
+ JSValueType unboxedType = lir->mir()->unboxedType();
+ if (unboxedType == JSVAL_TYPE_MAGIC) {
+ Address initLength(elements, ObjectElements::offsetOfInitializedLength());
+ masm.branch32(Assembler::BelowOrEqual, initLength, key, ool->entry());
- if (lir->mir()->needsBarrier())
- emitPreBarrier(elements, index, 0);
+ if (lir->mir()->needsBarrier())
+ emitPreBarrier(elements, index, 0);
+
+ masm.bind(ool->rejoinStore());
+ emitStoreElementTyped(lir->value(), lir->mir()->value()->type(), lir->mir()->elementType(),
+ elements, index, 0);
+ } else {
+ Register temp = ToRegister(lir->getTemp(0));
+ Address initLength(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength());
+ masm.load32(initLength, temp);
+ masm.and32(Imm32(UnboxedArrayObject::InitializedLengthMask), temp);
+ masm.branch32(Assembler::BelowOrEqual, temp, key, ool->entry());
+
+ ConstantOrRegister v = ToConstantOrRegister(lir->value(), lir->mir()->value()->type());
+
+ if (index->isConstant()) {
+ Address address(elements, ToInt32(index) * UnboxedTypeSize(unboxedType));
+ EmitUnboxedPreBarrier(masm, address, unboxedType);
+
+ masm.bind(ool->rejoinStore());
+ masm.storeUnboxedProperty(address, unboxedType, v, nullptr);
+ } else {
+ BaseIndex address(elements, ToRegister(index),
+ ScaleFromElemWidth(UnboxedTypeSize(unboxedType)));
+ EmitUnboxedPreBarrier(masm, address, unboxedType);
- masm.bind(ool->rejoinStore());
- emitStoreElementTyped(lir->value(), lir->mir()->value()->type(), lir->mir()->elementType(),
- elements, index, 0);
+ masm.bind(ool->rejoinStore());
+ masm.storeUnboxedProperty(address, unboxedType, v, nullptr);
+ }
+ }
masm.bind(ool->rejoin());
}
@@ -8124,22 +8255,47 @@ CodeGenerator::emitStoreElementHoleV(T* lir)
OutOfLineStoreElementHole* ool = new(alloc()) OutOfLineStoreElementHole(lir);
addOutOfLineCode(ool, lir->mir());
+ Register obj = ToRegister(lir->object());
Register elements = ToRegister(lir->elements());
const LAllocation* index = lir->index();
const ValueOperand value = ToValue(lir, T::Value);
RegisterOrInt32Constant key = ToRegisterOrInt32Constant(index);
- Address initLength(elements, ObjectElements::offsetOfInitializedLength());
- masm.branch32(Assembler::BelowOrEqual, initLength, key, ool->entry());
+ JSValueType unboxedType = lir->mir()->unboxedType();
+ if (unboxedType == JSVAL_TYPE_MAGIC) {
+ Address initLength(elements, ObjectElements::offsetOfInitializedLength());
+ masm.branch32(Assembler::BelowOrEqual, initLength, key, ool->entry());
- if (lir->mir()->needsBarrier())
- emitPreBarrier(elements, index, 0);
+ if (lir->mir()->needsBarrier())
+ emitPreBarrier(elements, index, 0);
- masm.bind(ool->rejoinStore());
- if (index->isConstant())
- masm.storeValue(value, Address(elements, ToInt32(index) * sizeof(js::Value)));
- else
- masm.storeValue(value, BaseIndex(elements, ToRegister(index), TimesEight));
+ masm.bind(ool->rejoinStore());
+ if (index->isConstant())
+ masm.storeValue(value, Address(elements, ToInt32(index) * sizeof(js::Value)));
+ else
+ masm.storeValue(value, BaseIndex(elements, ToRegister(index), TimesEight));
+ } else {
+ Register temp = ToRegister(lir->getTemp(0));
+ Address initLength(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength());
+ masm.load32(initLength, temp);
+ masm.and32(Imm32(UnboxedArrayObject::InitializedLengthMask), temp);
+ masm.branch32(Assembler::BelowOrEqual, temp, key, ool->entry());
+
+ if (index->isConstant()) {
+ Address address(elements, ToInt32(index) * UnboxedTypeSize(unboxedType));
+ EmitUnboxedPreBarrier(masm, address, unboxedType);
+
+ masm.bind(ool->rejoinStore());
+ masm.storeUnboxedProperty(address, unboxedType, ConstantOrRegister(value), nullptr);
+ } else {
+ BaseIndex address(elements, ToRegister(index),
+ ScaleFromElemWidth(UnboxedTypeSize(unboxedType)));
+ EmitUnboxedPreBarrier(masm, address, unboxedType);
+
+ masm.bind(ool->rejoinStore());
+ masm.storeUnboxedProperty(address, unboxedType, ConstantOrRegister(value), nullptr);
+ }
+ }
masm.bind(ool->rejoin());
}
@@ -8210,10 +8366,11 @@ CodeGenerator::visitFallibleStoreElementV(LFallibleStoreElementV* lir)
masm.bind(&isFrozen);
}
-typedef bool (*SetDenseElementFn)(JSContext*, HandleNativeObject, int32_t, HandleValue,
- bool strict);
-static const VMFunction SetDenseElementInfo =
- FunctionInfo<SetDenseElementFn>(jit::SetDenseElement, "SetDenseElement");
+typedef bool (*SetDenseOrUnboxedArrayElementFn)(JSContext*, HandleObject, int32_t,
+ HandleValue, bool strict);
+static const VMFunction SetDenseOrUnboxedArrayElementInfo =
+ FunctionInfo<SetDenseOrUnboxedArrayElementFn>(SetDenseOrUnboxedArrayElement,
+ "SetDenseOrUnboxedArrayElement");
void
CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool)
@@ -8223,6 +8380,8 @@ CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool)
const LAllocation* index;
MIRType valueType;
ConstantOrRegister value;
+ JSValueType unboxedType;
+ LDefinition *temp = nullptr;
if (ins->isStoreElementHoleV()) {
LStoreElementHoleV* store = ins->toStoreElementHoleV();
@@ -8231,6 +8390,8 @@ CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool)
index = store->index();
valueType = store->mir()->value()->type();
value = TypedOrValueRegister(ToValue(store, LStoreElementHoleV::Value));
+ unboxedType = store->mir()->unboxedType();
+ temp = store->getTemp(0);
} else if (ins->isFallibleStoreElementV()) {
LFallibleStoreElementV* store = ins->toFallibleStoreElementV();
object = ToRegister(store->object());
@@ -8238,6 +8399,8 @@ CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool)
index = store->index();
valueType = store->mir()->value()->type();
value = TypedOrValueRegister(ToValue(store, LFallibleStoreElementV::Value));
+ unboxedType = store->mir()->unboxedType();
+ temp = store->getTemp(0);
} else if (ins->isStoreElementHoleT()) {
LStoreElementHoleT* store = ins->toStoreElementHoleT();
object = ToRegister(store->object());
@@ -8248,6 +8411,8 @@ CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool)
value = ConstantOrRegister(store->value()->toConstant()->toJSValue());
else
value = TypedOrValueRegister(valueType, ToAnyRegister(store->value()));
+ unboxedType = store->mir()->unboxedType();
+ temp = store->getTemp(0);
} else { // ins->isFallibleStoreElementT()
LFallibleStoreElementT* store = ins->toFallibleStoreElementT();
object = ToRegister(store->object());
@@ -8258,6 +8423,8 @@ CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool)
value = ConstantOrRegister(store->value()->toConstant()->toJSValue());
else
value = TypedOrValueRegister(valueType, ToAnyRegister(store->value()));
+ unboxedType = store->mir()->unboxedType();
+ temp = store->getTemp(0);
}
RegisterOrInt32Constant key = ToRegisterOrInt32Constant(index);
@@ -8268,32 +8435,54 @@ CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool)
Label callStub;
#if defined(JS_CODEGEN_MIPS32) || defined(JS_CODEGEN_MIPS64)
// Had to reimplement for MIPS because there are no flags.
- Address initLength(elements, ObjectElements::offsetOfInitializedLength());
- masm.branch32(Assembler::NotEqual, initLength, key, &callStub);
+ if (unboxedType == JSVAL_TYPE_MAGIC) {
+ Address initLength(elements, ObjectElements::offsetOfInitializedLength());
+ masm.branch32(Assembler::NotEqual, initLength, key, &callStub);
+ } else {
+ Address initLength(object, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength());
+ masm.load32(initLength, ToRegister(temp));
+ masm.and32(Imm32(UnboxedArrayObject::InitializedLengthMask), ToRegister(temp));
+ masm.branch32(Assembler::NotEqual, ToRegister(temp), key, &callStub);
+ }
#else
masm.j(Assembler::NotEqual, &callStub);
#endif
- // Check array capacity.
- masm.branch32(Assembler::BelowOrEqual, Address(elements, ObjectElements::offsetOfCapacity()),
- key, &callStub);
+ if (unboxedType == JSVAL_TYPE_MAGIC) {
+ // Check array capacity.
+ masm.branch32(Assembler::BelowOrEqual, Address(elements, ObjectElements::offsetOfCapacity()),
+ key, &callStub);
- // Update initialized length. The capacity guard above ensures this won't overflow,
- // due to MAX_DENSE_ELEMENTS_COUNT.
- masm.inc32(&key);
- masm.store32(key, Address(elements, ObjectElements::offsetOfInitializedLength()));
+ // Update initialized length. The capacity guard above ensures this won't overflow,
+ // due to MAX_DENSE_ELEMENTS_COUNT.
+ masm.inc32(&key);
+ masm.store32(key, Address(elements, ObjectElements::offsetOfInitializedLength()));
- // Update length if length < initializedLength.
- Label dontUpdate;
- masm.branch32(Assembler::AboveOrEqual, Address(elements, ObjectElements::offsetOfLength()),
- key, &dontUpdate);
- masm.store32(key, Address(elements, ObjectElements::offsetOfLength()));
- masm.bind(&dontUpdate);
+ // Update length if length < initializedLength.
+ Label dontUpdate;
+ masm.branch32(Assembler::AboveOrEqual, Address(elements, ObjectElements::offsetOfLength()),
+ key, &dontUpdate);
+ masm.store32(key, Address(elements, ObjectElements::offsetOfLength()));
+ masm.bind(&dontUpdate);
- masm.dec32(&key);
+ masm.dec32(&key);
+ } else {
+ // Check array capacity.
+ masm.checkUnboxedArrayCapacity(object, key, ToRegister(temp), &callStub);
+
+ // Update initialized length.
+ masm.add32(Imm32(1), Address(object, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength()));
+
+ // Update length if length < initializedLength.
+ Address lengthAddr(object, UnboxedArrayObject::offsetOfLength());
+ Label dontUpdate;
+ masm.branch32(Assembler::Above, lengthAddr, key, &dontUpdate);
+ masm.add32(Imm32(1), lengthAddr);
+ masm.bind(&dontUpdate);
+ }
if ((ins->isStoreElementHoleT() || ins->isFallibleStoreElementT()) &&
- valueType != MIRType::Double)
+ unboxedType == JSVAL_TYPE_MAGIC && valueType != MIRType::Double)
{
// The inline path for StoreElementHoleT and FallibleStoreElementT does not always store
// the type tag, so we do the store on the OOL path. We use MIRType::None for the element
@@ -8322,7 +8511,7 @@ CodeGenerator::visitOutOfLineStoreElementHole(OutOfLineStoreElementHole* ool)
else
pushArg(ToRegister(index));
pushArg(object);
- callVM(SetDenseElementInfo, ins);
+ callVM(SetDenseOrUnboxedArrayElementInfo, ins);
restoreLive(ins);
masm.jump(ool->rejoin());
@@ -8379,6 +8568,29 @@ CodeGenerator::visitStoreUnboxedPointer(LStoreUnboxedPointer* lir)
}
}
+typedef bool (*ConvertUnboxedObjectToNativeFn)(JSContext*, JSObject*);
+static const VMFunction ConvertUnboxedPlainObjectToNativeInfo =
+ FunctionInfo<ConvertUnboxedObjectToNativeFn>(UnboxedPlainObject::convertToNative,
+ "UnboxedPlainObject::convertToNative");
+static const VMFunction ConvertUnboxedArrayObjectToNativeInfo =
+ FunctionInfo<ConvertUnboxedObjectToNativeFn>(UnboxedArrayObject::convertToNative,
+ "UnboxedArrayObject::convertToNative");
+
+void
+CodeGenerator::visitConvertUnboxedObjectToNative(LConvertUnboxedObjectToNative* lir)
+{
+ Register object = ToRegister(lir->getOperand(0));
+
+ OutOfLineCode* ool = oolCallVM(lir->mir()->group()->unboxedLayoutDontCheckGeneration().isArray()
+ ? ConvertUnboxedArrayObjectToNativeInfo
+ : ConvertUnboxedPlainObjectToNativeInfo,
+ lir, ArgList(object), StoreNothing());
+
+ masm.branchPtr(Assembler::Equal, Address(object, JSObject::offsetOfGroup()),
+ ImmGCPtr(lir->mir()->group()), ool->entry());
+ masm.bind(ool->rejoin());
+}
+
typedef bool (*ArrayPopShiftFn)(JSContext*, HandleObject, MutableHandleValue);
static const VMFunction ArrayPopDenseInfo =
FunctionInfo<ArrayPopShiftFn>(jit::ArrayPopDense, "ArrayPopDense");
@@ -8403,11 +8615,20 @@ CodeGenerator::emitArrayPopShift(LInstruction* lir, const MArrayPopShift* mir, R
// Load elements and length, and VM call if length != initializedLength.
RegisterOrInt32Constant key = RegisterOrInt32Constant(lengthTemp);
- masm.loadPtr(Address(obj, NativeObject::offsetOfElements()), elementsTemp);
- masm.load32(Address(elementsTemp, ObjectElements::offsetOfLength()), lengthTemp);
+ if (mir->unboxedType() == JSVAL_TYPE_MAGIC) {
+ masm.loadPtr(Address(obj, NativeObject::offsetOfElements()), elementsTemp);
+ masm.load32(Address(elementsTemp, ObjectElements::offsetOfLength()), lengthTemp);
- Address initLength(elementsTemp, ObjectElements::offsetOfInitializedLength());
- masm.branch32(Assembler::NotEqual, initLength, key, ool->entry());
+ Address initLength(elementsTemp, ObjectElements::offsetOfInitializedLength());
+ masm.branch32(Assembler::NotEqual, initLength, key, ool->entry());
+ } else {
+ masm.loadPtr(Address(obj, UnboxedArrayObject::offsetOfElements()), elementsTemp);
+ masm.load32(Address(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength()), lengthTemp);
+ masm.and32(Imm32(UnboxedArrayObject::InitializedLengthMask), lengthTemp);
+
+ Address lengthAddr(obj, UnboxedArrayObject::offsetOfLength());
+ masm.branch32(Assembler::NotEqual, lengthAddr, key, ool->entry());
+ }
// Test for length != 0. On zero length either take a VM call or generate
// an undefined value, depending on whether the call is known to produce
@@ -8419,10 +8640,13 @@ CodeGenerator::emitArrayPopShift(LInstruction* lir, const MArrayPopShift* mir, R
// According to the spec we need to set the length 0 (which is already 0).
// This is observable when the array length is made non-writable.
- // Handle this case in the OOL.
- Address elementFlags(elementsTemp, ObjectElements::offsetOfFlags());
- Imm32 bit(ObjectElements::NONWRITABLE_ARRAY_LENGTH);
- masm.branchTest32(Assembler::NonZero, elementFlags, bit, ool->entry());
+ // Handle this case in the OOL. When freezing an unboxed array it is converted
+ // to an normal array.
+ if (mir->unboxedType() == JSVAL_TYPE_MAGIC) {
+ Address elementFlags(elementsTemp, ObjectElements::offsetOfFlags());
+ Imm32 bit(ObjectElements::NONWRITABLE_ARRAY_LENGTH);
+ masm.branchTest32(Assembler::NonZero, elementFlags, bit, ool->entry());
+ }
masm.moveValue(UndefinedValue(), out.valueReg());
masm.jump(&done);
@@ -8434,25 +8658,41 @@ CodeGenerator::emitArrayPopShift(LInstruction* lir, const MArrayPopShift* mir, R
masm.dec32(&key);
if (mir->mode() == MArrayPopShift::Pop) {
- BaseIndex addr(elementsTemp, lengthTemp, TimesEight);
- masm.loadElementTypedOrValue(addr, out, mir->needsHoleCheck(), ool->entry());
+ if (mir->unboxedType() == JSVAL_TYPE_MAGIC) {
+ BaseIndex addr(elementsTemp, lengthTemp, TimesEight);
+ masm.loadElementTypedOrValue(addr, out, mir->needsHoleCheck(), ool->entry());
+ } else {
+ size_t elemSize = UnboxedTypeSize(mir->unboxedType());
+ BaseIndex addr(elementsTemp, lengthTemp, ScaleFromElemWidth(elemSize));
+ masm.loadUnboxedProperty(addr, mir->unboxedType(), out);
+ }
} else {
MOZ_ASSERT(mir->mode() == MArrayPopShift::Shift);
Address addr(elementsTemp, 0);
- masm.loadElementTypedOrValue(addr, out, mir->needsHoleCheck(), ool->entry());
+ if (mir->unboxedType() == JSVAL_TYPE_MAGIC)
+ masm.loadElementTypedOrValue(addr, out, mir->needsHoleCheck(), ool->entry());
+ else
+ masm.loadUnboxedProperty(addr, mir->unboxedType(), out);
}
- // Handle the failure case when the array length is non-writable in the
- // OOL path. (Unlike in the adding-an-element cases, we can't rely on the
- // capacity <= length invariant for such arrays to avoid an explicit
- // check.)
- Address elementFlags(elementsTemp, ObjectElements::offsetOfFlags());
- Imm32 bit(ObjectElements::NONWRITABLE_ARRAY_LENGTH);
- masm.branchTest32(Assembler::NonZero, elementFlags, bit, ool->entry());
+ if (mir->unboxedType() == JSVAL_TYPE_MAGIC) {
+ // Handle the failure case when the array length is non-writable in the
+ // OOL path. (Unlike in the adding-an-element cases, we can't rely on the
+ // capacity <= length invariant for such arrays to avoid an explicit
+ // check.)
+ Address elementFlags(elementsTemp, ObjectElements::offsetOfFlags());
+ Imm32 bit(ObjectElements::NONWRITABLE_ARRAY_LENGTH);
+ masm.branchTest32(Assembler::NonZero, elementFlags, bit, ool->entry());
- // Now adjust length and initializedLength.
- masm.store32(lengthTemp, Address(elementsTemp, ObjectElements::offsetOfLength()));
- masm.store32(lengthTemp, Address(elementsTemp, ObjectElements::offsetOfInitializedLength()));
+ // Now adjust length and initializedLength.
+ masm.store32(lengthTemp, Address(elementsTemp, ObjectElements::offsetOfLength()));
+ masm.store32(lengthTemp, Address(elementsTemp, ObjectElements::offsetOfInitializedLength()));
+ } else {
+ // Unboxed arrays always have writable lengths. Adjust length and
+ // initializedLength.
+ masm.store32(lengthTemp, Address(obj, UnboxedArrayObject::offsetOfLength()));
+ masm.add32(Imm32(-1), Address(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength()));
+ }
if (mir->mode() == MArrayPopShift::Shift) {
// Don't save the temp registers.
@@ -8491,7 +8731,7 @@ CodeGenerator::visitArrayPopShiftT(LArrayPopShiftT* lir)
emitArrayPopShift(lir, lir->mir(), obj, elements, length, out);
}
-typedef bool (*ArrayPushDenseFn)(JSContext*, HandleArrayObject, HandleValue, uint32_t*);
+typedef bool (*ArrayPushDenseFn)(JSContext*, HandleObject, HandleValue, uint32_t*);
static const VMFunction ArrayPushDenseInfo =
FunctionInfo<ArrayPushDenseFn>(jit::ArrayPushDense, "ArrayPushDense");
@@ -8502,27 +8742,50 @@ CodeGenerator::emitArrayPush(LInstruction* lir, const MArrayPush* mir, Register
OutOfLineCode* ool = oolCallVM(ArrayPushDenseInfo, lir, ArgList(obj, value), StoreRegisterTo(length));
RegisterOrInt32Constant key = RegisterOrInt32Constant(length);
+ if (mir->unboxedType() == JSVAL_TYPE_MAGIC) {
+ // Load elements and length.
+ masm.loadPtr(Address(obj, NativeObject::offsetOfElements()), elementsTemp);
+ masm.load32(Address(elementsTemp, ObjectElements::offsetOfLength()), length);
- // Load elements and length.
- masm.loadPtr(Address(obj, NativeObject::offsetOfElements()), elementsTemp);
- masm.load32(Address(elementsTemp, ObjectElements::offsetOfLength()), length);
+ // Guard length == initializedLength.
+ Address initLength(elementsTemp, ObjectElements::offsetOfInitializedLength());
+ masm.branch32(Assembler::NotEqual, initLength, key, ool->entry());
- // Guard length == initializedLength.
- Address initLength(elementsTemp, ObjectElements::offsetOfInitializedLength());
- masm.branch32(Assembler::NotEqual, initLength, key, ool->entry());
+ // Guard length < capacity.
+ Address capacity(elementsTemp, ObjectElements::offsetOfCapacity());
+ masm.branch32(Assembler::BelowOrEqual, capacity, key, ool->entry());
- // Guard length < capacity.
- Address capacity(elementsTemp, ObjectElements::offsetOfCapacity());
- masm.branch32(Assembler::BelowOrEqual, capacity, key, ool->entry());
+ // Do the store.
+ masm.storeConstantOrRegister(value, BaseIndex(elementsTemp, length, TimesEight));
+ } else {
+ // Load initialized length.
+ masm.load32(Address(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength()), length);
+ masm.and32(Imm32(UnboxedArrayObject::InitializedLengthMask), length);
- // Do the store.
- masm.storeConstantOrRegister(value, BaseIndex(elementsTemp, length, TimesEight));
+ // Guard length == initializedLength.
+ Address lengthAddr(obj, UnboxedArrayObject::offsetOfLength());
+ masm.branch32(Assembler::NotEqual, lengthAddr, key, ool->entry());
+
+ // Guard length < capacity.
+ masm.checkUnboxedArrayCapacity(obj, key, elementsTemp, ool->entry());
+
+ // Load elements and do the store.
+ masm.loadPtr(Address(obj, UnboxedArrayObject::offsetOfElements()), elementsTemp);
+ size_t elemSize = UnboxedTypeSize(mir->unboxedType());
+ BaseIndex addr(elementsTemp, length, ScaleFromElemWidth(elemSize));
+ masm.storeUnboxedProperty(addr, mir->unboxedType(), value, nullptr);
+ }
masm.inc32(&key);
// Update length and initialized length.
- masm.store32(length, Address(elementsTemp, ObjectElements::offsetOfLength()));
- masm.store32(length, Address(elementsTemp, ObjectElements::offsetOfInitializedLength()));
+ if (mir->unboxedType() == JSVAL_TYPE_MAGIC) {
+ masm.store32(length, Address(elementsTemp, ObjectElements::offsetOfLength()));
+ masm.store32(length, Address(elementsTemp, ObjectElements::offsetOfInitializedLength()));
+ } else {
+ masm.store32(length, Address(obj, UnboxedArrayObject::offsetOfLength()));
+ masm.add32(Imm32(1), Address(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength()));
+ }
masm.bind(ool->rejoin());
}
@@ -8671,11 +8934,11 @@ CodeGenerator::visitIteratorStartO(LIteratorStartO* lir)
masm.loadPtr(Address(niTemp, offsetof(NativeIterator, guard_array)), temp2);
// Compare object with the first receiver guard. The last iterator can only
- // match for native objects.
+ // match for native objects and unboxed objects.
{
Address groupAddr(temp2, offsetof(ReceiverGuard, group));
Address shapeAddr(temp2, offsetof(ReceiverGuard, shape));
- Label guardDone, shapeMismatch;
+ Label guardDone, shapeMismatch, noExpando;
masm.loadObjShape(obj, temp1);
masm.branchPtr(Assembler::NotEqual, shapeAddr, temp1, &shapeMismatch);
@@ -8687,6 +8950,12 @@ CodeGenerator::visitIteratorStartO(LIteratorStartO* lir)
masm.bind(&shapeMismatch);
masm.loadObjGroup(obj, temp1);
masm.branchPtr(Assembler::NotEqual, groupAddr, temp1, ool->entry());
+ masm.loadPtr(Address(obj, UnboxedPlainObject::offsetOfExpando()), temp1);
+ masm.branchTestPtr(Assembler::Zero, temp1, temp1, &noExpando);
+ branchIfNotEmptyObjectElements(temp1, ool->entry());
+ masm.loadObjShape(temp1, temp1);
+ masm.bind(&noExpando);
+ masm.branchPtr(Assembler::NotEqual, shapeAddr, temp1, ool->entry());
masm.bind(&guardDone);
}
@@ -10343,11 +10612,22 @@ CodeGenerator::visitLoadElementHole(LLoadElementHole* lir)
else
masm.branch32(Assembler::BelowOrEqual, initLength, ToRegister(lir->index()), &undefined);
- if (lir->index()->isConstant()) {
- NativeObject::elementsSizeMustNotOverflow();
- masm.loadValue(Address(elements, ToInt32(lir->index()) * sizeof(Value)), out);
+ if (mir->unboxedType() != JSVAL_TYPE_MAGIC) {
+ size_t width = UnboxedTypeSize(mir->unboxedType());
+ if (lir->index()->isConstant()) {
+ Address addr(elements, ToInt32(lir->index()) * width);
+ masm.loadUnboxedProperty(addr, mir->unboxedType(), out);
+ } else {
+ BaseIndex addr(elements, ToRegister(lir->index()), ScaleFromElemWidth(width));
+ masm.loadUnboxedProperty(addr, mir->unboxedType(), out);
+ }
} else {
- masm.loadValue(BaseObjectElementIndex(elements, ToRegister(lir->index())), out);
+ if (lir->index()->isConstant()) {
+ NativeObject::elementsSizeMustNotOverflow();
+ masm.loadValue(Address(elements, ToInt32(lir->index()) * sizeof(Value)), out);
+ } else {
+ masm.loadValue(BaseObjectElementIndex(elements, ToRegister(lir->index())), out);
+ }
}
// If a hole check is needed, and the value wasn't a hole, we're done.
@@ -10725,7 +11005,7 @@ CodeGenerator::visitInArray(LInArray* lir)
}
masm.branch32(Assembler::BelowOrEqual, initLength, Imm32(index), failedInitLength);
- if (mir->needsHoleCheck()) {
+ if (mir->needsHoleCheck() && mir->unboxedType() == JSVAL_TYPE_MAGIC) {
NativeObject::elementsSizeMustNotOverflow();
Address address = Address(elements, index * sizeof(Value));
masm.branchTestMagic(Assembler::Equal, address, &falseBranch);
@@ -10738,7 +11018,7 @@ CodeGenerator::visitInArray(LInArray* lir)
failedInitLength = &negativeIntCheck;
masm.branch32(Assembler::BelowOrEqual, initLength, index, failedInitLength);
- if (mir->needsHoleCheck()) {
+ if (mir->needsHoleCheck() && mir->unboxedType() == JSVAL_TYPE_MAGIC) {
BaseIndex address = BaseIndex(elements, ToRegister(lir->index()), TimesEight);
masm.branchTestMagic(Assembler::Equal, address, &falseBranch);
}
diff --git a/js/src/jit/CodeGenerator.h b/js/src/jit/CodeGenerator.h
index 65acfe274..6a5c7f34f 100644
--- a/js/src/jit/CodeGenerator.h
+++ b/js/src/jit/CodeGenerator.h
@@ -148,6 +148,8 @@ class CodeGenerator final : public CodeGeneratorSpecific
void visitMaybeCopyElementsForWrite(LMaybeCopyElementsForWrite* lir);
void visitGuardObjectIdentity(LGuardObjectIdentity* guard);
void visitGuardReceiverPolymorphic(LGuardReceiverPolymorphic* lir);
+ void visitGuardUnboxedExpando(LGuardUnboxedExpando* lir);
+ void visitLoadUnboxedExpando(LLoadUnboxedExpando* lir);
void visitTypeBarrierV(LTypeBarrierV* lir);
void visitTypeBarrierO(LTypeBarrierO* lir);
void visitMonitorTypes(LMonitorTypes* lir);
@@ -234,6 +236,10 @@ class CodeGenerator final : public CodeGeneratorSpecific
void visitSubstr(LSubstr* lir);
void visitInitializedLength(LInitializedLength* lir);
void visitSetInitializedLength(LSetInitializedLength* lir);
+ void visitUnboxedArrayLength(LUnboxedArrayLength* lir);
+ void visitUnboxedArrayInitializedLength(LUnboxedArrayInitializedLength* lir);
+ void visitIncrementUnboxedArrayInitializedLength(LIncrementUnboxedArrayInitializedLength* lir);
+ void visitSetUnboxedArrayInitializedLength(LSetUnboxedArrayInitializedLength* lir);
void visitNotO(LNotO* ins);
void visitNotV(LNotV* ins);
void visitBoundsCheck(LBoundsCheck* lir);
@@ -305,6 +311,7 @@ class CodeGenerator final : public CodeGeneratorSpecific
void visitFallibleStoreElementV(LFallibleStoreElementV* lir);
void visitFallibleStoreElementT(LFallibleStoreElementT* lir);
void visitStoreUnboxedPointer(LStoreUnboxedPointer* lir);
+ void visitConvertUnboxedObjectToNative(LConvertUnboxedObjectToNative* lir);
void emitArrayPopShift(LInstruction* lir, const MArrayPopShift* mir, Register obj,
Register elementsTemp, Register lengthTemp, TypedOrValueRegister out);
void visitArrayPopShiftV(LArrayPopShiftV* lir);
diff --git a/js/src/jit/CompileInfo.h b/js/src/jit/CompileInfo.h
index 44848890c..f7f8c70bb 100644
--- a/js/src/jit/CompileInfo.h
+++ b/js/src/jit/CompileInfo.h
@@ -487,7 +487,7 @@ class CompileInfo
// Function.arguments can be used to access all arguments in non-strict
// scripts, so we can't optimize out any arguments.
- if ((hasArguments() || !script()->strict()) &&
+ if ((mayReadFrameArgsDirectly_ || !script()->strict()) &&
firstArgSlot() <= slot && slot - firstArgSlot() < nargs())
{
return true;
diff --git a/js/src/jit/Ion.cpp b/js/src/jit/Ion.cpp
index 9337f6150..aa0ba8e3d 100644
--- a/js/src/jit/Ion.cpp
+++ b/js/src/jit/Ion.cpp
@@ -1497,14 +1497,6 @@ OptimizeMIR(MIRGenerator* mir)
if (mir->shouldCancel("Start"))
return false;
- if (!mir->compilingWasm()) {
- if (!MakeMRegExpHoistable(mir, graph))
- return false;
-
- if (mir->shouldCancel("Make MRegExp Hoistable"))
- return false;
- }
-
gs.spewPass("BuildSSA");
AssertBasicGraphCoherency(graph);
diff --git a/js/src/jit/IonAnalysis.cpp b/js/src/jit/IonAnalysis.cpp
index a4724bca4..1e3cb0ad4 100644
--- a/js/src/jit/IonAnalysis.cpp
+++ b/js/src/jit/IonAnalysis.cpp
@@ -1975,274 +1975,6 @@ jit::ApplyTypeInformation(MIRGenerator* mir, MIRGraph& graph)
return true;
}
-// Check if `def` is only the N-th operand of `useDef`.
-static inline size_t
-IsExclusiveNthOperand(MDefinition* useDef, size_t n, MDefinition* def)
-{
- uint32_t num = useDef->numOperands();
- if (n >= num || useDef->getOperand(n) != def)
- return false;
-
- for (uint32_t i = 0; i < num; i++) {
- if (i == n)
- continue;
- if (useDef->getOperand(i) == def)
- return false;
- }
-
- return true;
-}
-
-static size_t
-IsExclusiveThisArg(MCall* call, MDefinition* def)
-{
- return IsExclusiveNthOperand(call, MCall::IndexOfThis(), def);
-}
-
-static size_t
-IsExclusiveFirstArg(MCall* call, MDefinition* def)
-{
- return IsExclusiveNthOperand(call, MCall::IndexOfArgument(0), def);
-}
-
-static bool
-IsRegExpHoistableCall(MCall* call, MDefinition* def)
-{
- if (call->isConstructing())
- return false;
-
- JSAtom* name;
- if (WrappedFunction* fun = call->getSingleTarget()) {
- if (!fun->isSelfHostedBuiltin())
- return false;
- name = GetSelfHostedFunctionName(fun->rawJSFunction());
- } else {
- MDefinition* funDef = call->getFunction();
- if (funDef->isDebugCheckSelfHosted())
- funDef = funDef->toDebugCheckSelfHosted()->input();
- if (funDef->isTypeBarrier())
- funDef = funDef->toTypeBarrier()->input();
-
- if (!funDef->isCallGetIntrinsicValue())
- return false;
- name = funDef->toCallGetIntrinsicValue()->name();
- }
-
- // Hoistable only if the RegExp is the first argument of RegExpBuiltinExec.
- CompileRuntime* runtime = GetJitContext()->runtime;
- if (name == runtime->names().RegExpBuiltinExec ||
- name == runtime->names().UnwrapAndCallRegExpBuiltinExec ||
- name == runtime->names().RegExpMatcher ||
- name == runtime->names().RegExpTester ||
- name == runtime->names().RegExpSearcher)
- {
- return IsExclusiveFirstArg(call, def);
- }
-
- if (name == runtime->names().RegExp_prototype_Exec)
- return IsExclusiveThisArg(call, def);
-
- return false;
-}
-
-static bool
-CanCompareRegExp(MCompare* compare, MDefinition* def)
-{
- MDefinition* value;
- if (compare->lhs() == def) {
- value = compare->rhs();
- } else {
- MOZ_ASSERT(compare->rhs() == def);
- value = compare->lhs();
- }
-
- // Comparing two regexp that weren't cloned will give different result
- // than if they were cloned.
- if (value->mightBeType(MIRType::Object))
- return false;
-
- // Make sure @@toPrimitive is not called which could notice
- // the difference between a not cloned/cloned regexp.
-
- JSOp op = compare->jsop();
- // Strict equality comparison won't invoke @@toPrimitive.
- if (op == JSOP_STRICTEQ || op == JSOP_STRICTNE)
- return true;
-
- if (op != JSOP_EQ && op != JSOP_NE) {
- // Relational comparison always invoke @@toPrimitive.
- MOZ_ASSERT(op == JSOP_GT || op == JSOP_GE || op == JSOP_LT || op == JSOP_LE);
- return false;
- }
-
- // Loose equality comparison can invoke @@toPrimitive.
- if (value->mightBeType(MIRType::Boolean) || value->mightBeType(MIRType::String) ||
- value->mightBeType(MIRType::Int32) ||
- value->mightBeType(MIRType::Double) || value->mightBeType(MIRType::Float32) ||
- value->mightBeType(MIRType::Symbol))
- {
- return false;
- }
-
- return true;
-}
-
-static inline void
-SetNotInWorklist(MDefinitionVector& worklist)
-{
- for (size_t i = 0; i < worklist.length(); i++)
- worklist[i]->setNotInWorklist();
-}
-
-static bool
-IsRegExpHoistable(MIRGenerator* mir, MDefinition* regexp, MDefinitionVector& worklist,
- bool* hoistable)
-{
- MOZ_ASSERT(worklist.length() == 0);
-
- if (!worklist.append(regexp))
- return false;
- regexp->setInWorklist();
-
- for (size_t i = 0; i < worklist.length(); i++) {
- MDefinition* def = worklist[i];
- if (mir->shouldCancel("IsRegExpHoistable outer loop"))
- return false;
-
- for (MUseIterator use = def->usesBegin(); use != def->usesEnd(); use++) {
- if (mir->shouldCancel("IsRegExpHoistable inner loop"))
- return false;
-
- // Ignore resume points. At this point all uses are listed.
- // No DCE or GVN or something has happened.
- if (use->consumer()->isResumePoint())
- continue;
-
- MDefinition* useDef = use->consumer()->toDefinition();
-
- // Step through a few white-listed ops.
- if (useDef->isPhi() || useDef->isFilterTypeSet() || useDef->isGuardShape()) {
- if (useDef->isInWorklist())
- continue;
-
- if (!worklist.append(useDef))
- return false;
- useDef->setInWorklist();
- continue;
- }
-
- // Instructions that doesn't invoke unknown code that may modify
- // RegExp instance or pass it to elsewhere.
- if (useDef->isRegExpMatcher() || useDef->isRegExpTester() ||
- useDef->isRegExpSearcher())
- {
- if (IsExclusiveNthOperand(useDef, 0, def))
- continue;
- } else if (useDef->isLoadFixedSlot() || useDef->isTypeOf()) {
- continue;
- } else if (useDef->isCompare()) {
- if (CanCompareRegExp(useDef->toCompare(), def))
- continue;
- }
- // Instructions that modifies `lastIndex` property.
- else if (useDef->isStoreFixedSlot()) {
- if (IsExclusiveNthOperand(useDef, 0, def)) {
- MStoreFixedSlot* store = useDef->toStoreFixedSlot();
- if (store->slot() == RegExpObject::lastIndexSlot())
- continue;
- }
- } else if (useDef->isSetPropertyCache()) {
- if (IsExclusiveNthOperand(useDef, 0, def)) {
- MSetPropertyCache* setProp = useDef->toSetPropertyCache();
- if (setProp->idval()->isConstant()) {
- Value propIdVal = setProp->idval()->toConstant()->toJSValue();
- if (propIdVal.isString()) {
- CompileRuntime* runtime = GetJitContext()->runtime;
- if (propIdVal.toString() == runtime->names().lastIndex)
- continue;
- }
- }
- }
- }
- // MCall is safe only for some known safe functions.
- else if (useDef->isCall()) {
- if (IsRegExpHoistableCall(useDef->toCall(), def))
- continue;
- }
-
- // Everything else is unsafe.
- SetNotInWorklist(worklist);
- worklist.clear();
- *hoistable = false;
-
- return true;
- }
- }
-
- SetNotInWorklist(worklist);
- worklist.clear();
- *hoistable = true;
- return true;
-}
-
-bool
-jit::MakeMRegExpHoistable(MIRGenerator* mir, MIRGraph& graph)
-{
- // If we are compiling try blocks, regular expressions may be observable
- // from catch blocks (which Ion does not compile). For now just disable the
- // pass in this case.
- if (graph.hasTryBlock())
- return true;
-
- MDefinitionVector worklist(graph.alloc());
-
- for (ReversePostorderIterator block(graph.rpoBegin()); block != graph.rpoEnd(); block++) {
- if (mir->shouldCancel("MakeMRegExpHoistable outer loop"))
- return false;
-
- for (MDefinitionIterator iter(*block); iter; iter++) {
- if (!*iter)
- MOZ_CRASH("confirm bug 1263794.");
-
- if (mir->shouldCancel("MakeMRegExpHoistable inner loop"))
- return false;
-
- if (!iter->isRegExp())
- continue;
-
- MRegExp* regexp = iter->toRegExp();
-
- bool hoistable = false;
- if (!IsRegExpHoistable(mir, regexp, worklist, &hoistable))
- return false;
-
- if (!hoistable)
- continue;
-
- // Make MRegExp hoistable
- regexp->setMovable();
- regexp->setDoNotClone();
-
- // That would be incorrect for global/sticky, because lastIndex
- // could be wrong. Therefore setting the lastIndex to 0. That is
- // faster than a not movable regexp.
- RegExpObject* source = regexp->source();
- if (source->sticky() || source->global()) {
- if (!graph.alloc().ensureBallast())
- return false;
- MConstant* zero = MConstant::New(graph.alloc(), Int32Value(0));
- regexp->block()->insertAfter(regexp, zero);
-
- MStoreFixedSlot* lastIndex =
- MStoreFixedSlot::New(graph.alloc(), regexp, RegExpObject::lastIndexSlot(), zero);
- regexp->block()->insertAfter(zero, lastIndex);
- }
- }
- }
-
- return true;
-}
-
void
jit::RenumberBlocks(MIRGraph& graph)
{
@@ -3515,6 +3247,8 @@ PassthroughOperand(MDefinition* def)
return def->toConvertElementsToDoubles()->elements();
if (def->isMaybeCopyElementsForWrite())
return def->toMaybeCopyElementsForWrite()->object();
+ if (def->isConvertUnboxedObjectToNative())
+ return def->toConvertUnboxedObjectToNative()->object();
return nullptr;
}
@@ -4060,7 +3794,7 @@ AnalyzePoppedThis(JSContext* cx, DPAConstraintInfo& constraintInfo, ObjectGroup*
// Add the property to the object, being careful not to update type information.
DebugOnly<unsigned> slotSpan = baseobj->slotSpan();
MOZ_ASSERT(!baseobj->containsPure(id));
- if (!NativeObject::addDataProperty(cx, baseobj, id, baseobj->slotSpan(), JSPROP_ENUMERATE))
+ if (!baseobj->addDataProperty(cx, id, baseobj->slotSpan(), JSPROP_ENUMERATE))
return false;
MOZ_ASSERT(baseobj->slotSpan() != slotSpan);
MOZ_ASSERT(!baseobj->inDictionaryMode());
diff --git a/js/src/jit/IonAnalysis.h b/js/src/jit/IonAnalysis.h
index 49bc0b591..673c797bd 100644
--- a/js/src/jit/IonAnalysis.h
+++ b/js/src/jit/IonAnalysis.h
@@ -56,9 +56,6 @@ EliminateDeadCode(MIRGenerator* mir, MIRGraph& graph);
MOZ_MUST_USE bool
ApplyTypeInformation(MIRGenerator* mir, MIRGraph& graph);
-MOZ_MUST_USE bool
-MakeMRegExpHoistable(MIRGenerator* mir, MIRGraph& graph);
-
void
RenumberBlocks(MIRGraph& graph);
diff --git a/js/src/jit/IonBuilder.cpp b/js/src/jit/IonBuilder.cpp
index 1e12f5dbe..f08baf865 100644
--- a/js/src/jit/IonBuilder.cpp
+++ b/js/src/jit/IonBuilder.cpp
@@ -32,6 +32,7 @@
#include "vm/EnvironmentObject-inl.h"
#include "vm/NativeObject-inl.h"
#include "vm/ObjectGroup-inl.h"
+#include "vm/UnboxedObject-inl.h"
using namespace js;
using namespace js::jit;
@@ -2227,8 +2228,6 @@ IonBuilder::inspectOpcode(JSOp op)
// update that stale value.
#endif
default:
- // Any unused opcodes and JSOP_LIMIT will end up here without having
- // to explicitly specify
break;
}
@@ -6402,7 +6401,7 @@ IonBuilder::createThisScriptedSingleton(JSFunction* target, MDefinition* callee)
JSObject* templateObject = inspector->getTemplateObject(pc);
if (!templateObject)
return nullptr;
- if (!templateObject->is<PlainObject>())
+ if (!templateObject->is<PlainObject>() && !templateObject->is<UnboxedPlainObject>())
return nullptr;
if (templateObject->staticPrototype() != proto)
return nullptr;
@@ -6439,7 +6438,7 @@ IonBuilder::createThisScriptedBaseline(MDefinition* callee)
JSObject* templateObject = inspector->getTemplateObject(pc);
if (!templateObject)
return nullptr;
- if (!templateObject->is<PlainObject>())
+ if (!templateObject->is<PlainObject>() && !templateObject->is<UnboxedPlainObject>())
return nullptr;
Shape* shape = target->lookupPure(compartment->runtime()->names().prototype);
@@ -7355,6 +7354,12 @@ IonBuilder::newArrayTryTemplateObject(bool* emitted, JSObject* templateObject, u
if (!templateObject)
return true;
+ if (templateObject->is<UnboxedArrayObject>()) {
+ MOZ_ASSERT(templateObject->as<UnboxedArrayObject>().capacity() >= length);
+ if (!templateObject->as<UnboxedArrayObject>().hasInlineElements())
+ return true;
+ }
+
MOZ_ASSERT(length <= NativeObject::MAX_DENSE_ELEMENTS_COUNT);
size_t arraySlots =
@@ -7610,6 +7615,7 @@ IonBuilder::jsop_initelem_array()
// intializer, and that arrays are marked as non-packed when writing holes
// to them during initialization.
bool needStub = false;
+ JSValueType unboxedType = JSVAL_TYPE_MAGIC;
if (shouldAbortOnPreliminaryGroups(obj)) {
needStub = true;
} else if (!obj->resultTypeSet() ||
@@ -7620,6 +7626,12 @@ IonBuilder::jsop_initelem_array()
} else {
MOZ_ASSERT(obj->resultTypeSet()->getObjectCount() == 1);
TypeSet::ObjectKey* initializer = obj->resultTypeSet()->getObject(0);
+ if (initializer->clasp() == &UnboxedArrayObject::class_) {
+ if (initializer->group()->unboxedLayout().nativeGroup())
+ needStub = true;
+ else
+ unboxedType = initializer->group()->unboxedLayout().elementType();
+ }
if (value->type() == MIRType::MagicHole) {
if (!initializer->hasFlags(constraints(), OBJECT_FLAG_NON_PACKED))
needStub = true;
@@ -7639,46 +7651,60 @@ IonBuilder::jsop_initelem_array()
return resumeAfter(store);
}
- return initializeArrayElement(obj, index, value, /* addResumePoint = */ true);
+ return initializeArrayElement(obj, index, value, unboxedType, /* addResumePoint = */ true);
}
bool
IonBuilder::initializeArrayElement(MDefinition* obj, size_t index, MDefinition* value,
+ JSValueType unboxedType,
bool addResumePointAndIncrementInitializedLength)
{
MConstant* id = MConstant::New(alloc(), Int32Value(index));
current->add(id);
// Get the elements vector.
- MElements* elements = MElements::New(alloc(), obj);
+ MElements* elements = MElements::New(alloc(), obj, unboxedType != JSVAL_TYPE_MAGIC);
current->add(elements);
- if (NeedsPostBarrier(value))
- current->add(MPostWriteBarrier::New(alloc(), obj, value));
+ if (unboxedType != JSVAL_TYPE_MAGIC) {
+ // Note: storeUnboxedValue takes care of any post barriers on the value.
+ storeUnboxedValue(obj, elements, 0, id, unboxedType, value, /* preBarrier = */ false);
- if ((obj->isNewArray() && obj->toNewArray()->convertDoubleElements()) ||
- (obj->isNullarySharedStub() &&
- obj->resultTypeSet()->convertDoubleElements(constraints()) == TemporaryTypeSet::AlwaysConvertToDoubles))
- {
- MInstruction* valueDouble = MToDouble::New(alloc(), value);
- current->add(valueDouble);
- value = valueDouble;
- }
+ if (addResumePointAndIncrementInitializedLength) {
+ MInstruction* increment = MIncrementUnboxedArrayInitializedLength::New(alloc(), obj);
+ current->add(increment);
- // Store the value.
- MStoreElement* store = MStoreElement::New(alloc(), elements, id, value,
+ if (!resumeAfter(increment))
+ return false;
+ }
+ } else {
+ if (NeedsPostBarrier(value))
+ current->add(MPostWriteBarrier::New(alloc(), obj, value));
+
+ if ((obj->isNewArray() && obj->toNewArray()->convertDoubleElements()) ||
+ (obj->isNullarySharedStub() &&
+ obj->resultTypeSet()->convertDoubleElements(constraints()) == TemporaryTypeSet::AlwaysConvertToDoubles))
+ {
+ MInstruction* valueDouble = MToDouble::New(alloc(), value);
+ current->add(valueDouble);
+ value = valueDouble;
+ }
+
+ // Store the value.
+ MStoreElement* store = MStoreElement::New(alloc(), elements, id, value,
/* needsHoleCheck = */ false);
- current->add(store);
+ current->add(store);
- if (addResumePointAndIncrementInitializedLength) {
- // Update the initialized length. (The template object for this
- // array has the array's ultimate length, so the length field is
- // already correct: no updating needed.)
- MSetInitializedLength* initLength = MSetInitializedLength::New(alloc(), elements, id);
- current->add(initLength);
+ if (addResumePointAndIncrementInitializedLength) {
+ // Update the initialized length. (The template object for this
+ // array has the array's ultimate length, so the length field is
+ // already correct: no updating needed.)
+ MSetInitializedLength* initLength = MSetInitializedLength::New(alloc(), elements, id);
+ current->add(initLength);
- if (!resumeAfter(initLength))
- return false;
+ if (!resumeAfter(initLength))
+ return false;
+ }
}
return true;
@@ -7709,6 +7735,8 @@ IonBuilder::jsop_initprop(PropertyName* name)
if (templateObject->is<PlainObject>()) {
if (!templateObject->as<PlainObject>().containsPure(name))
useSlowPath = true;
+ } else {
+ MOZ_ASSERT(templateObject->as<UnboxedPlainObject>().layout().lookup(name));
}
} else {
useSlowPath = true;
@@ -8167,7 +8195,9 @@ IonBuilder::maybeMarkEmpty(MDefinition* ins)
static bool
ClassHasEffectlessLookup(const Class* clasp)
{
- return IsTypedObjectClass(clasp) ||
+ return (clasp == &UnboxedPlainObject::class_) ||
+ (clasp == &UnboxedArrayObject::class_) ||
+ IsTypedObjectClass(clasp) ||
(clasp->isNative() && !clasp->getOpsLookupProperty());
}
@@ -8997,6 +9027,8 @@ IonBuilder::jsop_getelem()
}
obj = maybeUnboxForPropertyAccess(obj);
+ if (obj->type() == MIRType::Object)
+ obj = convertUnboxedObjects(obj);
bool emitted = false;
@@ -9441,9 +9473,12 @@ IonBuilder::getElemTryDense(bool* emitted, MDefinition* obj, MDefinition* index)
{
MOZ_ASSERT(*emitted == false);
- if (!ElementAccessIsDenseNative(constraints(), obj, index)) {
- trackOptimizationOutcome(TrackedOutcome::AccessNotDense);
- return true;
+ JSValueType unboxedType = UnboxedArrayElementType(constraints(), obj, index);
+ if (unboxedType == JSVAL_TYPE_MAGIC) {
+ if (!ElementAccessIsDenseNative(constraints(), obj, index)) {
+ trackOptimizationOutcome(TrackedOutcome::AccessNotDense);
+ return true;
+ }
}
// Don't generate a fast path if there have been bounds check failures
@@ -9460,7 +9495,7 @@ IonBuilder::getElemTryDense(bool* emitted, MDefinition* obj, MDefinition* index)
return true;
}
- if (!jsop_getelem_dense(obj, index))
+ if (!jsop_getelem_dense(obj, index, unboxedType))
return false;
trackOptimizationSuccess();
@@ -9812,7 +9847,7 @@ IonBuilder::computeHeapType(const TemporaryTypeSet* objTypes, const jsid id)
}
bool
-IonBuilder::jsop_getelem_dense(MDefinition* obj, MDefinition* index)
+IonBuilder::jsop_getelem_dense(MDefinition* obj, MDefinition* index, JSValueType unboxedType)
{
TemporaryTypeSet* types = bytecodeTypes(pc);
@@ -9836,7 +9871,7 @@ IonBuilder::jsop_getelem_dense(MDefinition* obj, MDefinition* index)
!ElementAccessHasExtraIndexedProperty(this, obj);
MIRType knownType = MIRType::Value;
- if (barrier == BarrierKind::NoBarrier)
+ if (unboxedType == JSVAL_TYPE_MAGIC && barrier == BarrierKind::NoBarrier)
knownType = GetElemKnownType(needsHoleCheck, types);
// Ensure index is an integer.
@@ -9845,13 +9880,13 @@ IonBuilder::jsop_getelem_dense(MDefinition* obj, MDefinition* index)
index = idInt32;
// Get the elements vector.
- MInstruction* elements = MElements::New(alloc(), obj);
+ MInstruction* elements = MElements::New(alloc(), obj, unboxedType != JSVAL_TYPE_MAGIC);
current->add(elements);
// Note: to help GVN, use the original MElements instruction and not
// MConvertElementsToDoubles as operand. This is fine because converting
// elements to double does not change the initialized length.
- MInstruction* initLength = initializedLength(obj, elements);
+ MInstruction* initLength = initializedLength(obj, elements, unboxedType);
// If we can load the element as a definite double, make sure to check that
// the array has been converted to homogenous doubles first.
@@ -9867,6 +9902,7 @@ IonBuilder::jsop_getelem_dense(MDefinition* obj, MDefinition* index)
}
bool loadDouble =
+ unboxedType == JSVAL_TYPE_MAGIC &&
barrier == BarrierKind::NoBarrier &&
loopDepth_ &&
inBounds &&
@@ -9885,13 +9921,18 @@ IonBuilder::jsop_getelem_dense(MDefinition* obj, MDefinition* index)
// hoisting.
index = addBoundsCheck(index, initLength);
- load = MLoadElement::New(alloc(), elements, index, needsHoleCheck, loadDouble);
- current->add(load);
+ if (unboxedType != JSVAL_TYPE_MAGIC) {
+ load = loadUnboxedValue(elements, 0, index, unboxedType, barrier, types);
+ } else {
+ load = MLoadElement::New(alloc(), elements, index, needsHoleCheck, loadDouble);
+ current->add(load);
+ }
} else {
// This load may return undefined, so assume that we *can* read holes,
// or that we can read out-of-bounds accesses. In this case, the bounds
// check is part of the opcode.
- load = MLoadElementHole::New(alloc(), elements, index, initLength, needsHoleCheck);
+ load = MLoadElementHole::New(alloc(), elements, index, initLength,
+ unboxedType, needsHoleCheck);
current->add(load);
// If maybeUndefined was true, the typeset must have undefined, and
@@ -9901,7 +9942,8 @@ IonBuilder::jsop_getelem_dense(MDefinition* obj, MDefinition* index)
}
if (knownType != MIRType::Value) {
- load->setResultType(knownType);
+ if (unboxedType == JSVAL_TYPE_MAGIC)
+ load->setResultType(knownType);
load->setResultTypeSet(types);
}
@@ -10110,7 +10152,7 @@ IonBuilder::jsop_setelem()
MDefinition* value = current->pop();
MDefinition* index = current->pop();
- MDefinition* object = current->pop();
+ MDefinition* object = convertUnboxedObjects(current->pop());
trackTypeInfo(TrackedTypeSite::Receiver, object->type(), object->resultTypeSet());
trackTypeInfo(TrackedTypeSite::Index, index->type(), index->resultTypeSet());
@@ -10348,9 +10390,12 @@ IonBuilder::setElemTryDense(bool* emitted, MDefinition* object,
{
MOZ_ASSERT(*emitted == false);
- if (!ElementAccessIsDenseNative(constraints(), object, index)) {
- trackOptimizationOutcome(TrackedOutcome::AccessNotDense);
- return true;
+ JSValueType unboxedType = UnboxedArrayElementType(constraints(), object, index);
+ if (unboxedType == JSVAL_TYPE_MAGIC) {
+ if (!ElementAccessIsDenseNative(constraints(), object, index)) {
+ trackOptimizationOutcome(TrackedOutcome::AccessNotDense);
+ return true;
+ }
}
if (PropertyWriteNeedsTypeBarrier(alloc(), constraints(), current,
@@ -10384,7 +10429,7 @@ IonBuilder::setElemTryDense(bool* emitted, MDefinition* object,
}
// Emit dense setelem variant.
- if (!jsop_setelem_dense(conversion, object, index, value, writeHole, emitted))
+ if (!jsop_setelem_dense(conversion, object, index, value, unboxedType, writeHole, emitted))
return false;
if (!*emitted) {
@@ -10474,11 +10519,13 @@ IonBuilder::setElemTryCache(bool* emitted, MDefinition* object,
bool
IonBuilder::jsop_setelem_dense(TemporaryTypeSet::DoubleConversion conversion,
MDefinition* obj, MDefinition* id, MDefinition* value,
- bool writeHole, bool* emitted)
+ JSValueType unboxedType, bool writeHole, bool* emitted)
{
MOZ_ASSERT(*emitted == false);
- MIRType elementType = DenseNativeElementType(constraints(), obj);
+ MIRType elementType = MIRType::None;
+ if (unboxedType == JSVAL_TYPE_MAGIC)
+ elementType = DenseNativeElementType(constraints(), obj);
bool packed = ElementAccessIsPacked(constraints(), obj);
// Writes which are on holes in the object do not have to bail out if they
@@ -10508,7 +10555,7 @@ IonBuilder::jsop_setelem_dense(TemporaryTypeSet::DoubleConversion conversion,
obj = addMaybeCopyElementsForWrite(obj, /* checkNative = */ false);
// Get the elements vector.
- MElements* elements = MElements::New(alloc(), obj);
+ MElements* elements = MElements::New(alloc(), obj, unboxedType != JSVAL_TYPE_MAGIC);
current->add(elements);
// Ensure the value is a double, if double conversion might be needed.
@@ -10545,7 +10592,7 @@ IonBuilder::jsop_setelem_dense(TemporaryTypeSet::DoubleConversion conversion,
MInstruction* store;
MStoreElementCommon* common = nullptr;
if (writeHole && hasNoExtraIndexedProperty && !mayBeFrozen) {
- MStoreElementHole* ins = MStoreElementHole::New(alloc(), obj, elements, id, newValue);
+ MStoreElementHole* ins = MStoreElementHole::New(alloc(), obj, elements, id, newValue, unboxedType);
store = ins;
common = ins;
@@ -10557,23 +10604,27 @@ IonBuilder::jsop_setelem_dense(TemporaryTypeSet::DoubleConversion conversion,
bool strict = IsStrictSetPC(pc);
MFallibleStoreElement* ins = MFallibleStoreElement::New(alloc(), obj, elements, id,
- newValue, strict);
+ newValue, unboxedType, strict);
store = ins;
common = ins;
current->add(ins);
current->push(value);
} else {
- MInstruction* initLength = initializedLength(obj, elements);
+ MInstruction* initLength = initializedLength(obj, elements, unboxedType);
id = addBoundsCheck(id, initLength);
bool needsHoleCheck = !packed && !hasNoExtraIndexedProperty;
- MStoreElement* ins = MStoreElement::New(alloc(), elements, id, newValue, needsHoleCheck);
- store = ins;
- common = ins;
+ if (unboxedType != JSVAL_TYPE_MAGIC) {
+ store = storeUnboxedValue(obj, elements, 0, id, unboxedType, newValue);
+ } else {
+ MStoreElement* ins = MStoreElement::New(alloc(), elements, id, newValue, needsHoleCheck);
+ store = ins;
+ common = ins;
- current->add(store);
+ current->add(store);
+ }
current->push(value);
}
@@ -10691,6 +10742,18 @@ IonBuilder::jsop_length_fastPath()
return true;
}
+ // Compute the length for unboxed array objects.
+ if (UnboxedArrayElementType(constraints(), obj, nullptr) != JSVAL_TYPE_MAGIC &&
+ !objTypes->hasObjectFlags(constraints(), OBJECT_FLAG_LENGTH_OVERFLOW))
+ {
+ current->pop();
+
+ MUnboxedArrayLength* length = MUnboxedArrayLength::New(alloc(), obj);
+ current->add(length);
+ current->push(length);
+ return true;
+ }
+
// Compute the length for array typed objects.
TypedObjectPrediction prediction = typedObjectPrediction(obj);
if (!prediction.isUseless()) {
@@ -10924,8 +10987,11 @@ IonBuilder::getDefiniteSlot(TemporaryTypeSet* types, PropertyName* name, uint32_
}
// Definite slots will always be fixed slots when they are in the
- // allowable range for fixed slots.
+ // allowable range for fixed slots, except for objects which were
+ // converted from unboxed objects and have a smaller allocation size.
size_t nfixed = NativeObject::MAX_FIXED_SLOTS;
+ if (ObjectGroup* group = key->group()->maybeOriginalUnboxedGroup())
+ nfixed = gc::GetGCKindSlots(group->unboxedLayout().getAllocKind());
uint32_t propertySlot = property.maybeTypes()->definiteSlot();
if (slot == UINT32_MAX) {
@@ -10940,6 +11006,65 @@ IonBuilder::getDefiniteSlot(TemporaryTypeSet* types, PropertyName* name, uint32_
return slot;
}
+uint32_t
+IonBuilder::getUnboxedOffset(TemporaryTypeSet* types, PropertyName* name, JSValueType* punboxedType)
+{
+ if (!types || types->unknownObject() || !types->objectOrSentinel()) {
+ trackOptimizationOutcome(TrackedOutcome::NoTypeInfo);
+ return UINT32_MAX;
+ }
+
+ uint32_t offset = UINT32_MAX;
+
+ for (size_t i = 0; i < types->getObjectCount(); i++) {
+ TypeSet::ObjectKey* key = types->getObject(i);
+ if (!key)
+ continue;
+
+ if (key->unknownProperties()) {
+ trackOptimizationOutcome(TrackedOutcome::UnknownProperties);
+ return UINT32_MAX;
+ }
+
+ if (key->isSingleton()) {
+ trackOptimizationOutcome(TrackedOutcome::Singleton);
+ return UINT32_MAX;
+ }
+
+ UnboxedLayout* layout = key->group()->maybeUnboxedLayout();
+ if (!layout) {
+ trackOptimizationOutcome(TrackedOutcome::NotUnboxed);
+ return UINT32_MAX;
+ }
+
+ const UnboxedLayout::Property* property = layout->lookup(name);
+ if (!property) {
+ trackOptimizationOutcome(TrackedOutcome::StructNoField);
+ return UINT32_MAX;
+ }
+
+ if (layout->nativeGroup()) {
+ trackOptimizationOutcome(TrackedOutcome::UnboxedConvertedToNative);
+ return UINT32_MAX;
+ }
+
+ key->watchStateChangeForUnboxedConvertedToNative(constraints());
+
+ if (offset == UINT32_MAX) {
+ offset = property->offset;
+ *punboxedType = property->type;
+ } else if (offset != property->offset) {
+ trackOptimizationOutcome(TrackedOutcome::InconsistentFieldOffset);
+ return UINT32_MAX;
+ } else if (*punboxedType != property->type) {
+ trackOptimizationOutcome(TrackedOutcome::InconsistentFieldType);
+ return UINT32_MAX;
+ }
+ }
+
+ return offset;
+}
+
bool
IonBuilder::jsop_runonce()
{
@@ -11386,6 +11511,8 @@ IonBuilder::jsop_getprop(PropertyName* name)
}
obj = maybeUnboxForPropertyAccess(obj);
+ if (obj->type() == MIRType::Object)
+ obj = convertUnboxedObjects(obj);
BarrierKind barrier = PropertyReadNeedsTypeBarrier(analysisContext, constraints(),
obj, name, types);
@@ -11457,6 +11584,11 @@ IonBuilder::jsop_getprop(PropertyName* name)
if (!getPropTryDefiniteSlot(&emitted, obj, name, barrier, types) || emitted)
return emitted;
+ // Try to emit loads from unboxed objects.
+ trackOptimizationAttempt(TrackedStrategy::GetProp_Unboxed);
+ if (!getPropTryUnboxed(&emitted, obj, name, barrier, types) || emitted)
+ return emitted;
+
// Try to inline a common property getter, or make a call.
trackOptimizationAttempt(TrackedStrategy::GetProp_CommonGetter);
if (!getPropTryCommonGetter(&emitted, obj, name, types) || emitted)
@@ -11822,6 +11954,49 @@ IonBuilder::getPropTryComplexPropOfTypedObject(bool* emitted,
fieldPrediction, fieldTypeObj);
}
+MDefinition*
+IonBuilder::convertUnboxedObjects(MDefinition* obj)
+{
+ // If obj might be in any particular unboxed group which should be
+ // converted to a native representation, perform that conversion. This does
+ // not guarantee the object will not have such a group afterwards, if the
+ // object's possible groups are not precisely known.
+ TemporaryTypeSet* types = obj->resultTypeSet();
+ if (!types || types->unknownObject() || !types->objectOrSentinel())
+ return obj;
+
+ BaselineInspector::ObjectGroupVector list(alloc());
+ for (size_t i = 0; i < types->getObjectCount(); i++) {
+ TypeSet::ObjectKey* key = obj->resultTypeSet()->getObject(i);
+ if (!key || !key->isGroup())
+ continue;
+
+ if (UnboxedLayout* layout = key->group()->maybeUnboxedLayout()) {
+ AutoEnterOOMUnsafeRegion oomUnsafe;
+ if (layout->nativeGroup() && !list.append(key->group()))
+ oomUnsafe.crash("IonBuilder::convertUnboxedObjects");
+ }
+ }
+
+ return convertUnboxedObjects(obj, list);
+}
+
+MDefinition*
+IonBuilder::convertUnboxedObjects(MDefinition* obj,
+ const BaselineInspector::ObjectGroupVector& list)
+{
+ for (size_t i = 0; i < list.length(); i++) {
+ ObjectGroup* group = list[i];
+ if (TemporaryTypeSet* types = obj->resultTypeSet()) {
+ if (!types->hasType(TypeSet::ObjectType(group)))
+ continue;
+ }
+ obj = MConvertUnboxedObjectToNative::New(alloc(), obj, group);
+ current->add(obj->toInstruction());
+ }
+ return obj;
+}
+
bool
IonBuilder::getPropTryDefiniteSlot(bool* emitted, MDefinition* obj, PropertyName* name,
BarrierKind barrier, TemporaryTypeSet* types)
@@ -11906,14 +12081,111 @@ IonBuilder::getPropTryModuleNamespace(bool* emitted, MDefinition* obj, PropertyN
return true;
}
+MInstruction*
+IonBuilder::loadUnboxedProperty(MDefinition* obj, size_t offset, JSValueType unboxedType,
+ BarrierKind barrier, TemporaryTypeSet* types)
+{
+ // loadUnboxedValue is designed to load any value as if it were contained in
+ // an array. Thus a property offset is converted to an index, when the
+ // object is reinterpreted as an array of properties of the same size.
+ size_t index = offset / UnboxedTypeSize(unboxedType);
+ MInstruction* indexConstant = MConstant::New(alloc(), Int32Value(index));
+ current->add(indexConstant);
+
+ return loadUnboxedValue(obj, UnboxedPlainObject::offsetOfData(),
+ indexConstant, unboxedType, barrier, types);
+}
+
+MInstruction*
+IonBuilder::loadUnboxedValue(MDefinition* elements, size_t elementsOffset,
+ MDefinition* index, JSValueType unboxedType,
+ BarrierKind barrier, TemporaryTypeSet* types)
+{
+ MInstruction* load;
+ switch (unboxedType) {
+ case JSVAL_TYPE_BOOLEAN:
+ load = MLoadUnboxedScalar::New(alloc(), elements, index, Scalar::Uint8,
+ DoesNotRequireMemoryBarrier, elementsOffset);
+ load->setResultType(MIRType::Boolean);
+ break;
+
+ case JSVAL_TYPE_INT32:
+ load = MLoadUnboxedScalar::New(alloc(), elements, index, Scalar::Int32,
+ DoesNotRequireMemoryBarrier, elementsOffset);
+ load->setResultType(MIRType::Int32);
+ break;
+
+ case JSVAL_TYPE_DOUBLE:
+ load = MLoadUnboxedScalar::New(alloc(), elements, index, Scalar::Float64,
+ DoesNotRequireMemoryBarrier, elementsOffset,
+ /* canonicalizeDoubles = */ false);
+ load->setResultType(MIRType::Double);
+ break;
+
+ case JSVAL_TYPE_STRING:
+ load = MLoadUnboxedString::New(alloc(), elements, index, elementsOffset);
+ break;
+
+ case JSVAL_TYPE_OBJECT: {
+ MLoadUnboxedObjectOrNull::NullBehavior nullBehavior;
+ if (types->hasType(TypeSet::NullType()))
+ nullBehavior = MLoadUnboxedObjectOrNull::HandleNull;
+ else if (barrier != BarrierKind::NoBarrier)
+ nullBehavior = MLoadUnboxedObjectOrNull::BailOnNull;
+ else
+ nullBehavior = MLoadUnboxedObjectOrNull::NullNotPossible;
+ load = MLoadUnboxedObjectOrNull::New(alloc(), elements, index, nullBehavior,
+ elementsOffset);
+ break;
+ }
+
+ default:
+ MOZ_CRASH();
+ }
+
+ current->add(load);
+ return load;
+}
+
+bool
+IonBuilder::getPropTryUnboxed(bool* emitted, MDefinition* obj, PropertyName* name,
+ BarrierKind barrier, TemporaryTypeSet* types)
+{
+ MOZ_ASSERT(*emitted == false);
+
+ JSValueType unboxedType;
+ uint32_t offset = getUnboxedOffset(obj->resultTypeSet(), name, &unboxedType);
+ if (offset == UINT32_MAX)
+ return true;
+
+ if (obj->type() != MIRType::Object) {
+ MGuardObject* guard = MGuardObject::New(alloc(), obj);
+ current->add(guard);
+ obj = guard;
+ }
+
+ MInstruction* load = loadUnboxedProperty(obj, offset, unboxedType, barrier, types);
+ current->push(load);
+
+ if (!pushTypeBarrier(load, types, barrier))
+ return false;
+
+ trackOptimizationSuccess();
+ *emitted = true;
+ return true;
+}
+
MDefinition*
IonBuilder::addShapeGuardsForGetterSetter(MDefinition* obj, JSObject* holder, Shape* holderShape,
const BaselineInspector::ReceiverVector& receivers,
+ const BaselineInspector::ObjectGroupVector& convertUnboxedGroups,
bool isOwnProperty)
{
MOZ_ASSERT(holder);
MOZ_ASSERT(holderShape);
+ obj = convertUnboxedObjects(obj, convertUnboxedGroups);
+
if (isOwnProperty) {
MOZ_ASSERT(receivers.empty());
return addShapeGuard(obj, holderShape, Bailout_ShapeGuard);
@@ -11937,8 +12209,10 @@ IonBuilder::getPropTryCommonGetter(bool* emitted, MDefinition* obj, PropertyName
JSObject* foundProto = nullptr;
bool isOwnProperty = false;
BaselineInspector::ReceiverVector receivers(alloc());
+ BaselineInspector::ObjectGroupVector convertUnboxedGroups(alloc());
if (!inspector->commonGetPropFunction(pc, &foundProto, &lastProperty, &commonGetter,
- &globalShape, &isOwnProperty, receivers))
+ &globalShape, &isOwnProperty,
+ receivers, convertUnboxedGroups))
{
return true;
}
@@ -11954,7 +12228,8 @@ IonBuilder::getPropTryCommonGetter(bool* emitted, MDefinition* obj, PropertyName
// If type information is bad, we can still optimize the getter if we
// shape guard.
obj = addShapeGuardsForGetterSetter(obj, foundProto, lastProperty,
- receivers, isOwnProperty);
+ receivers, convertUnboxedGroups,
+ isOwnProperty);
if (!obj)
return false;
}
@@ -12122,12 +12397,15 @@ IonBuilder::getPropTryInlineAccess(bool* emitted, MDefinition* obj, PropertyName
MOZ_ASSERT(*emitted == false);
BaselineInspector::ReceiverVector receivers(alloc());
- if (!inspector->maybeInfoForPropertyOp(pc, receivers))
+ BaselineInspector::ObjectGroupVector convertUnboxedGroups(alloc());
+ if (!inspector->maybeInfoForPropertyOp(pc, receivers, convertUnboxedGroups))
return false;
if (!canInlinePropertyOpShapes(receivers))
return true;
+ obj = convertUnboxedObjects(obj, convertUnboxedGroups);
+
MIRType rvalType = types->getKnownMIRType();
if (barrier != BarrierKind::NoBarrier || IsNullOrUndefined(rvalType))
rvalType = MIRType::Value;
@@ -12150,6 +12428,45 @@ IonBuilder::getPropTryInlineAccess(bool* emitted, MDefinition* obj, PropertyName
return true;
}
+ if (receivers[0].shape) {
+ // Monomorphic load from an unboxed object expando.
+ spew("Inlining monomorphic unboxed expando GETPROP");
+
+ obj = addGroupGuard(obj, receivers[0].group, Bailout_ShapeGuard);
+ obj = addUnboxedExpandoGuard(obj, /* hasExpando = */ true, Bailout_ShapeGuard);
+
+ MInstruction* expando = MLoadUnboxedExpando::New(alloc(), obj);
+ current->add(expando);
+
+ expando = addShapeGuard(expando, receivers[0].shape, Bailout_ShapeGuard);
+
+ Shape* shape = receivers[0].shape->searchLinear(NameToId(name));
+ MOZ_ASSERT(shape);
+
+ if (!loadSlot(expando, shape, rvalType, barrier, types))
+ return false;
+
+ trackOptimizationOutcome(TrackedOutcome::Monomorphic);
+ *emitted = true;
+ return true;
+ }
+
+ // Monomorphic load from an unboxed object.
+ ObjectGroup* group = receivers[0].group;
+ if (obj->resultTypeSet() && !obj->resultTypeSet()->hasType(TypeSet::ObjectType(group)))
+ return true;
+
+ obj = addGroupGuard(obj, group, Bailout_ShapeGuard);
+
+ const UnboxedLayout::Property* property = group->unboxedLayout().lookup(name);
+ MInstruction* load = loadUnboxedProperty(obj, property->offset, property->type, barrier, types);
+ current->push(load);
+
+ if (!pushTypeBarrier(load, types, barrier))
+ return false;
+
+ trackOptimizationOutcome(TrackedOutcome::Monomorphic);
+ *emitted = true;
return true;
}
@@ -12391,7 +12708,7 @@ bool
IonBuilder::jsop_setprop(PropertyName* name)
{
MDefinition* value = current->pop();
- MDefinition* obj = current->pop();
+ MDefinition* obj = convertUnboxedObjects(current->pop());
bool emitted = false;
startTrackingOptimizations();
@@ -12424,6 +12741,13 @@ IonBuilder::jsop_setprop(PropertyName* name)
bool barrier = PropertyWriteNeedsTypeBarrier(alloc(), constraints(), current, &obj, name, &value,
/* canModify = */ true);
+ if (!forceInlineCaches()) {
+ // Try to emit stores to unboxed objects.
+ trackOptimizationAttempt(TrackedStrategy::SetProp_Unboxed);
+ if (!setPropTryUnboxed(&emitted, obj, name, value, barrier, objTypes) || emitted)
+ return emitted;
+ }
+
// Add post barrier if needed. The instructions above manage any post
// barriers they need directly.
if (NeedsPostBarrier(value))
@@ -12457,8 +12781,10 @@ IonBuilder::setPropTryCommonSetter(bool* emitted, MDefinition* obj,
JSObject* foundProto = nullptr;
bool isOwnProperty;
BaselineInspector::ReceiverVector receivers(alloc());
+ BaselineInspector::ObjectGroupVector convertUnboxedGroups(alloc());
if (!inspector->commonSetPropFunction(pc, &foundProto, &lastProperty, &commonSetter,
- &isOwnProperty, receivers))
+ &isOwnProperty,
+ receivers, convertUnboxedGroups))
{
trackOptimizationOutcome(TrackedOutcome::NoProtoFound);
return true;
@@ -12473,7 +12799,8 @@ IonBuilder::setPropTryCommonSetter(bool* emitted, MDefinition* obj,
// If type information is bad, we can still optimize the setter if we
// shape guard.
obj = addShapeGuardsForGetterSetter(obj, foundProto, lastProperty,
- receivers, isOwnProperty);
+ receivers, convertUnboxedGroups,
+ isOwnProperty);
if (!obj)
return false;
}
@@ -12729,6 +13056,100 @@ IonBuilder::setPropTryDefiniteSlot(bool* emitted, MDefinition* obj,
return true;
}
+MInstruction*
+IonBuilder::storeUnboxedProperty(MDefinition* obj, size_t offset, JSValueType unboxedType,
+ MDefinition* value)
+{
+ size_t scaledOffsetConstant = offset / UnboxedTypeSize(unboxedType);
+ MInstruction* scaledOffset = MConstant::New(alloc(), Int32Value(scaledOffsetConstant));
+ current->add(scaledOffset);
+
+ return storeUnboxedValue(obj, obj, UnboxedPlainObject::offsetOfData(),
+ scaledOffset, unboxedType, value);
+}
+
+MInstruction*
+IonBuilder::storeUnboxedValue(MDefinition* obj, MDefinition* elements, int32_t elementsOffset,
+ MDefinition* scaledOffset, JSValueType unboxedType,
+ MDefinition* value, bool preBarrier /* = true */)
+{
+ MInstruction* store;
+ switch (unboxedType) {
+ case JSVAL_TYPE_BOOLEAN:
+ store = MStoreUnboxedScalar::New(alloc(), elements, scaledOffset, value, Scalar::Uint8,
+ MStoreUnboxedScalar::DontTruncateInput,
+ DoesNotRequireMemoryBarrier, elementsOffset);
+ break;
+
+ case JSVAL_TYPE_INT32:
+ store = MStoreUnboxedScalar::New(alloc(), elements, scaledOffset, value, Scalar::Int32,
+ MStoreUnboxedScalar::DontTruncateInput,
+ DoesNotRequireMemoryBarrier, elementsOffset);
+ break;
+
+ case JSVAL_TYPE_DOUBLE:
+ store = MStoreUnboxedScalar::New(alloc(), elements, scaledOffset, value, Scalar::Float64,
+ MStoreUnboxedScalar::DontTruncateInput,
+ DoesNotRequireMemoryBarrier, elementsOffset);
+ break;
+
+ case JSVAL_TYPE_STRING:
+ store = MStoreUnboxedString::New(alloc(), elements, scaledOffset, value,
+ elementsOffset, preBarrier);
+ break;
+
+ case JSVAL_TYPE_OBJECT:
+ MOZ_ASSERT(value->type() == MIRType::Object ||
+ value->type() == MIRType::Null ||
+ value->type() == MIRType::Value);
+ MOZ_ASSERT(!value->mightBeType(MIRType::Undefined),
+ "MToObjectOrNull slow path is invalid for unboxed objects");
+ store = MStoreUnboxedObjectOrNull::New(alloc(), elements, scaledOffset, value, obj,
+ elementsOffset, preBarrier);
+ break;
+
+ default:
+ MOZ_CRASH();
+ }
+
+ current->add(store);
+ return store;
+}
+
+bool
+IonBuilder::setPropTryUnboxed(bool* emitted, MDefinition* obj,
+ PropertyName* name, MDefinition* value,
+ bool barrier, TemporaryTypeSet* objTypes)
+{
+ MOZ_ASSERT(*emitted == false);
+
+ if (barrier) {
+ trackOptimizationOutcome(TrackedOutcome::NeedsTypeBarrier);
+ return true;
+ }
+
+ JSValueType unboxedType;
+ uint32_t offset = getUnboxedOffset(obj->resultTypeSet(), name, &unboxedType);
+ if (offset == UINT32_MAX)
+ return true;
+
+ if (obj->type() != MIRType::Object) {
+ MGuardObject* guard = MGuardObject::New(alloc(), obj);
+ current->add(guard);
+ obj = guard;
+ }
+
+ MInstruction* store = storeUnboxedProperty(obj, offset, unboxedType, value);
+
+ current->push(value);
+
+ if (!resumeAfter(store))
+ return false;
+
+ *emitted = true;
+ return true;
+}
+
bool
IonBuilder::setPropTryInlineAccess(bool* emitted, MDefinition* obj,
PropertyName* name, MDefinition* value,
@@ -12742,12 +13163,15 @@ IonBuilder::setPropTryInlineAccess(bool* emitted, MDefinition* obj,
}
BaselineInspector::ReceiverVector receivers(alloc());
- if (!inspector->maybeInfoForPropertyOp(pc, receivers))
+ BaselineInspector::ObjectGroupVector convertUnboxedGroups(alloc());
+ if (!inspector->maybeInfoForPropertyOp(pc, receivers, convertUnboxedGroups))
return false;
if (!canInlinePropertyOpShapes(receivers))
return true;
+ obj = convertUnboxedObjects(obj, convertUnboxedGroups);
+
if (receivers.length() == 1) {
if (!receivers[0].group) {
// Monomorphic store to a native object.
@@ -12767,6 +13191,46 @@ IonBuilder::setPropTryInlineAccess(bool* emitted, MDefinition* obj,
return true;
}
+ if (receivers[0].shape) {
+ // Monomorphic store to an unboxed object expando.
+ spew("Inlining monomorphic unboxed expando SETPROP");
+
+ obj = addGroupGuard(obj, receivers[0].group, Bailout_ShapeGuard);
+ obj = addUnboxedExpandoGuard(obj, /* hasExpando = */ true, Bailout_ShapeGuard);
+
+ MInstruction* expando = MLoadUnboxedExpando::New(alloc(), obj);
+ current->add(expando);
+
+ expando = addShapeGuard(expando, receivers[0].shape, Bailout_ShapeGuard);
+
+ Shape* shape = receivers[0].shape->searchLinear(NameToId(name));
+ MOZ_ASSERT(shape);
+
+ bool needsBarrier = objTypes->propertyNeedsBarrier(constraints(), NameToId(name));
+ if (!storeSlot(expando, shape, value, needsBarrier))
+ return false;
+
+ trackOptimizationOutcome(TrackedOutcome::Monomorphic);
+ *emitted = true;
+ return true;
+ }
+
+ // Monomorphic store to an unboxed object.
+ spew("Inlining monomorphic unboxed SETPROP");
+
+ ObjectGroup* group = receivers[0].group;
+ if (!objTypes->hasType(TypeSet::ObjectType(group)))
+ return true;
+
+ obj = addGroupGuard(obj, group, Bailout_ShapeGuard);
+
+ const UnboxedLayout::Property* property = group->unboxedLayout().lookup(name);
+ storeUnboxedProperty(obj, property->offset, property->type, value);
+
+ current->push(value);
+
+ trackOptimizationOutcome(TrackedOutcome::Monomorphic);
+ *emitted = true;
return true;
}
@@ -13465,7 +13929,7 @@ IonBuilder::jsop_setaliasedvar(EnvironmentCoordinate ec)
bool
IonBuilder::jsop_in()
{
- MDefinition* obj = current->pop();
+ MDefinition* obj = convertUnboxedObjects(current->pop());
MDefinition* id = current->pop();
bool emitted = false;
@@ -13492,8 +13956,11 @@ IonBuilder::inTryDense(bool* emitted, MDefinition* obj, MDefinition* id)
if (shouldAbortOnPreliminaryGroups(obj))
return true;
- if (!ElementAccessIsDenseNative(constraints(), obj, id))
- return true;
+ JSValueType unboxedType = UnboxedArrayElementType(constraints(), obj, id);
+ if (unboxedType == JSVAL_TYPE_MAGIC) {
+ if (!ElementAccessIsDenseNative(constraints(), obj, id))
+ return true;
+ }
if (ElementAccessHasExtraIndexedProperty(this, obj))
return true;
@@ -13508,10 +13975,10 @@ IonBuilder::inTryDense(bool* emitted, MDefinition* obj, MDefinition* id)
id = idInt32;
// Get the elements vector.
- MElements* elements = MElements::New(alloc(), obj);
+ MElements* elements = MElements::New(alloc(), obj, unboxedType != JSVAL_TYPE_MAGIC);
current->add(elements);
- MInstruction* initLength = initializedLength(obj, elements);
+ MInstruction* initLength = initializedLength(obj, elements, unboxedType);
// If there are no holes, speculate the InArray check will not fail.
if (!needsHoleCheck && !failedBoundsCheck_) {
@@ -13521,7 +13988,8 @@ IonBuilder::inTryDense(bool* emitted, MDefinition* obj, MDefinition* id)
}
// Check if id < initLength and elem[id] not a hole.
- MInArray* ins = MInArray::New(alloc(), elements, id, initLength, obj, needsHoleCheck);
+ MInArray* ins = MInArray::New(alloc(), elements, id, initLength, obj, needsHoleCheck,
+ unboxedType);
current->add(ins);
current->push(ins);
@@ -13818,6 +14286,19 @@ IonBuilder::addGroupGuard(MDefinition* obj, ObjectGroup* group, BailoutKind bail
}
MInstruction*
+IonBuilder::addUnboxedExpandoGuard(MDefinition* obj, bool hasExpando, BailoutKind bailoutKind)
+{
+ MGuardUnboxedExpando* guard = MGuardUnboxedExpando::New(alloc(), obj, hasExpando, bailoutKind);
+ current->add(guard);
+
+ // If a shape guard failed in the past, don't optimize group guards.
+ if (failedShapeGuard_)
+ guard->setNotMovable();
+
+ return guard;
+}
+
+MInstruction*
IonBuilder::addGuardReceiverPolymorphic(MDefinition* obj,
const BaselineInspector::ReceiverVector& receivers)
{
@@ -13826,6 +14307,15 @@ IonBuilder::addGuardReceiverPolymorphic(MDefinition* obj,
// Monomorphic guard on a native object.
return addShapeGuard(obj, receivers[0].shape, Bailout_ShapeGuard);
}
+
+ if (!receivers[0].shape) {
+ // Guard on an unboxed object that does not have an expando.
+ obj = addGroupGuard(obj, receivers[0].group, Bailout_ShapeGuard);
+ return addUnboxedExpandoGuard(obj, /* hasExpando = */ false, Bailout_ShapeGuard);
+ }
+
+ // Monomorphic receiver guards are not yet supported when the receiver
+ // is an unboxed object with an expando.
}
MGuardReceiverPolymorphic* guard = MGuardReceiverPolymorphic::New(alloc(), obj);
@@ -14199,24 +14689,32 @@ IonBuilder::constantInt(int32_t i)
}
MInstruction*
-IonBuilder::initializedLength(MDefinition* obj, MDefinition* elements)
+IonBuilder::initializedLength(MDefinition* obj, MDefinition* elements, JSValueType unboxedType)
{
- MInstruction* res = MInitializedLength::New(alloc(), elements);
+ MInstruction* res;
+ if (unboxedType != JSVAL_TYPE_MAGIC)
+ res = MUnboxedArrayInitializedLength::New(alloc(), obj);
+ else
+ res = MInitializedLength::New(alloc(), elements);
current->add(res);
return res;
}
MInstruction*
-IonBuilder::setInitializedLength(MDefinition* obj, size_t count)
+IonBuilder::setInitializedLength(MDefinition* obj, JSValueType unboxedType, size_t count)
{
MOZ_ASSERT(count);
- // MSetInitializedLength takes the index of the last element, rather
- // than the count itself.
- MInstruction* elements = MElements::New(alloc(), obj, /* unboxed = */ false);
- current->add(elements);
- MInstruction* res =
- MSetInitializedLength::New(alloc(), elements, constant(Int32Value(count - 1)));
+ MInstruction* res;
+ if (unboxedType != JSVAL_TYPE_MAGIC) {
+ res = MSetUnboxedArrayInitializedLength::New(alloc(), obj, constant(Int32Value(count)));
+ } else {
+ // MSetInitializedLength takes the index of the last element, rather
+ // than the count itself.
+ MInstruction* elements = MElements::New(alloc(), obj, /* unboxed = */ false);
+ current->add(elements);
+ res = MSetInitializedLength::New(alloc(), elements, constant(Int32Value(count - 1)));
+ }
current->add(res);
return res;
}
diff --git a/js/src/jit/IonBuilder.h b/js/src/jit/IonBuilder.h
index 6a3b61232..f359c764f 100644
--- a/js/src/jit/IonBuilder.h
+++ b/js/src/jit/IonBuilder.h
@@ -346,8 +346,9 @@ class IonBuilder
MConstant* constant(const Value& v);
MConstant* constantInt(int32_t i);
- MInstruction* initializedLength(MDefinition* obj, MDefinition* elements);
- MInstruction* setInitializedLength(MDefinition* obj, size_t count);
+ MInstruction* initializedLength(MDefinition* obj, MDefinition* elements,
+ JSValueType unboxedType);
+ MInstruction* setInitializedLength(MDefinition* obj, JSValueType unboxedType, size_t count);
// Improve the type information at tests
MOZ_MUST_USE bool improveTypesAtTest(MDefinition* ins, bool trueBranch, MTest* test);
@@ -400,6 +401,7 @@ class IonBuilder
MInstruction* addBoundsCheck(MDefinition* index, MDefinition* length);
MInstruction* addShapeGuard(MDefinition* obj, Shape* const shape, BailoutKind bailoutKind);
MInstruction* addGroupGuard(MDefinition* obj, ObjectGroup* group, BailoutKind bailoutKind);
+ MInstruction* addUnboxedExpandoGuard(MDefinition* obj, bool hasExpando, BailoutKind bailoutKind);
MInstruction* addSharedTypedArrayGuard(MDefinition* obj);
MInstruction*
@@ -439,6 +441,8 @@ class IonBuilder
BarrierKind barrier, TemporaryTypeSet* types);
MOZ_MUST_USE bool getPropTryModuleNamespace(bool* emitted, MDefinition* obj, PropertyName* name,
BarrierKind barrier, TemporaryTypeSet* types);
+ MOZ_MUST_USE bool getPropTryUnboxed(bool* emitted, MDefinition* obj, PropertyName* name,
+ BarrierKind barrier, TemporaryTypeSet* types);
MOZ_MUST_USE bool getPropTryCommonGetter(bool* emitted, MDefinition* obj, PropertyName* name,
TemporaryTypeSet* types);
MOZ_MUST_USE bool getPropTryInlineAccess(bool* emitted, MDefinition* obj, PropertyName* name,
@@ -471,6 +475,9 @@ class IonBuilder
MOZ_MUST_USE bool setPropTryDefiniteSlot(bool* emitted, MDefinition* obj,
PropertyName* name, MDefinition* value,
bool barrier, TemporaryTypeSet* objTypes);
+ MOZ_MUST_USE bool setPropTryUnboxed(bool* emitted, MDefinition* obj,
+ PropertyName* name, MDefinition* value,
+ bool barrier, TemporaryTypeSet* objTypes);
MOZ_MUST_USE bool setPropTryInlineAccess(bool* emitted, MDefinition* obj,
PropertyName* name, MDefinition* value,
bool barrier, TemporaryTypeSet* objTypes);
@@ -610,6 +617,7 @@ class IonBuilder
TypedObjectPrediction elemTypeReprs,
uint32_t elemSize);
MOZ_MUST_USE bool initializeArrayElement(MDefinition* obj, size_t index, MDefinition* value,
+ JSValueType unboxedType,
bool addResumePointAndIncrementInitializedLength);
// jsop_getelem() helpers.
@@ -722,13 +730,15 @@ class IonBuilder
MOZ_MUST_USE bool jsop_bindname(PropertyName* name);
MOZ_MUST_USE bool jsop_bindvar();
MOZ_MUST_USE bool jsop_getelem();
- MOZ_MUST_USE bool jsop_getelem_dense(MDefinition* obj, MDefinition* index);
+ MOZ_MUST_USE bool jsop_getelem_dense(MDefinition* obj, MDefinition* index,
+ JSValueType unboxedType);
MOZ_MUST_USE bool jsop_getelem_typed(MDefinition* obj, MDefinition* index,
ScalarTypeDescr::Type arrayType);
MOZ_MUST_USE bool jsop_setelem();
MOZ_MUST_USE bool jsop_setelem_dense(TemporaryTypeSet::DoubleConversion conversion,
MDefinition* object, MDefinition* index,
- MDefinition* value, bool writeHole, bool* emitted);
+ MDefinition* value, JSValueType unboxedType,
+ bool writeHole, bool* emitted);
MOZ_MUST_USE bool jsop_setelem_typed(ScalarTypeDescr::Type arrayType,
MDefinition* object, MDefinition* index,
MDefinition* value);
@@ -1033,6 +1043,7 @@ class IonBuilder
MDefinition*
addShapeGuardsForGetterSetter(MDefinition* obj, JSObject* holder, Shape* holderShape,
const BaselineInspector::ReceiverVector& receivers,
+ const BaselineInspector::ObjectGroupVector& convertUnboxedGroups,
bool isOwnProperty);
MOZ_MUST_USE bool annotateGetPropertyCache(MDefinition* obj, PropertyName* name,
@@ -1050,6 +1061,22 @@ class IonBuilder
ResultWithOOM<bool> testNotDefinedProperty(MDefinition* obj, jsid id);
uint32_t getDefiniteSlot(TemporaryTypeSet* types, PropertyName* name, uint32_t* pnfixed);
+ MDefinition* convertUnboxedObjects(MDefinition* obj);
+ MDefinition* convertUnboxedObjects(MDefinition* obj,
+ const BaselineInspector::ObjectGroupVector& list);
+ uint32_t getUnboxedOffset(TemporaryTypeSet* types, PropertyName* name,
+ JSValueType* punboxedType);
+ MInstruction* loadUnboxedProperty(MDefinition* obj, size_t offset, JSValueType unboxedType,
+ BarrierKind barrier, TemporaryTypeSet* types);
+ MInstruction* loadUnboxedValue(MDefinition* elements, size_t elementsOffset,
+ MDefinition* scaledOffset, JSValueType unboxedType,
+ BarrierKind barrier, TemporaryTypeSet* types);
+ MInstruction* storeUnboxedProperty(MDefinition* obj, size_t offset, JSValueType unboxedType,
+ MDefinition* value);
+ MInstruction* storeUnboxedValue(MDefinition* obj,
+ MDefinition* elements, int32_t elementsOffset,
+ MDefinition* scaledOffset, JSValueType unboxedType,
+ MDefinition* value, bool preBarrier = true);
MOZ_MUST_USE bool checkPreliminaryGroups(MDefinition *obj);
MOZ_MUST_USE bool freezePropTypeSets(TemporaryTypeSet* types,
JSObject* foundProto, PropertyName* name);
diff --git a/js/src/jit/IonCaches.cpp b/js/src/jit/IonCaches.cpp
index fb4291188..c2dc57373 100644
--- a/js/src/jit/IonCaches.cpp
+++ b/js/src/jit/IonCaches.cpp
@@ -31,6 +31,7 @@
#include "jit/shared/Lowering-shared-inl.h"
#include "vm/Interpreter-inl.h"
#include "vm/Shape-inl.h"
+#include "vm/UnboxedObject-inl.h"
using namespace js;
using namespace js::jit;
@@ -619,7 +620,29 @@ TestMatchingReceiver(MacroAssembler& masm, IonCache::StubAttacher& attacher,
Register object, JSObject* obj, Label* failure,
bool alwaysCheckGroup = false)
{
- if (obj->is<TypedObject>()) {
+ if (obj->is<UnboxedPlainObject>()) {
+ MOZ_ASSERT(failure);
+
+ masm.branchTestObjGroup(Assembler::NotEqual, object, obj->group(), failure);
+ Address expandoAddress(object, UnboxedPlainObject::offsetOfExpando());
+ if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando()) {
+ masm.branchPtr(Assembler::Equal, expandoAddress, ImmWord(0), failure);
+ Label success;
+ masm.push(object);
+ masm.loadPtr(expandoAddress, object);
+ masm.branchTestObjShape(Assembler::Equal, object, expando->lastProperty(),
+ &success);
+ masm.pop(object);
+ masm.jump(failure);
+ masm.bind(&success);
+ masm.pop(object);
+ } else {
+ masm.branchPtr(Assembler::NotEqual, expandoAddress, ImmWord(0), failure);
+ }
+ } else if (obj->is<UnboxedArrayObject>()) {
+ MOZ_ASSERT(failure);
+ masm.branchTestObjGroup(Assembler::NotEqual, object, obj->group(), failure);
+ } else if (obj->is<TypedObject>()) {
attacher.branchNextStubOrLabel(masm, Assembler::NotEqual,
Address(object, JSObject::offsetOfGroup()),
ImmGCPtr(obj->group()), failure);
@@ -736,6 +759,7 @@ GenerateReadSlot(JSContext* cx, IonScript* ion, MacroAssembler& masm,
// jump directly. Otherwise, jump to the end of the stub, so there's a
// common point to patch.
bool multipleFailureJumps = (obj != holder)
+ || obj->is<UnboxedPlainObject>()
|| (checkTDZ && output.hasValue())
|| (failures != nullptr && failures->used());
@@ -754,6 +778,7 @@ GenerateReadSlot(JSContext* cx, IonScript* ion, MacroAssembler& masm,
Register scratchReg = Register::FromCode(0); // Quell compiler warning.
if (obj != holder ||
+ obj->is<UnboxedPlainObject>() ||
!holder->as<NativeObject>().isFixedSlot(shape->slot()))
{
if (output.hasValue()) {
@@ -814,6 +839,10 @@ GenerateReadSlot(JSContext* cx, IonScript* ion, MacroAssembler& masm,
holderReg = InvalidReg;
}
+ } else if (obj->is<UnboxedPlainObject>()) {
+ holder = obj->as<UnboxedPlainObject>().maybeExpando();
+ holderReg = scratchReg;
+ masm.loadPtr(Address(object, UnboxedPlainObject::offsetOfExpando()), holderReg);
} else {
holderReg = object;
}
@@ -841,6 +870,30 @@ GenerateReadSlot(JSContext* cx, IonScript* ion, MacroAssembler& masm,
attacher.jumpNextStub(masm);
}
+static void
+GenerateReadUnboxed(JSContext* cx, IonScript* ion, MacroAssembler& masm,
+ IonCache::StubAttacher& attacher, JSObject* obj,
+ const UnboxedLayout::Property* property,
+ Register object, TypedOrValueRegister output,
+ Label* failures = nullptr)
+{
+ // Guard on the group of the object.
+ attacher.branchNextStubOrLabel(masm, Assembler::NotEqual,
+ Address(object, JSObject::offsetOfGroup()),
+ ImmGCPtr(obj->group()), failures);
+
+ Address address(object, UnboxedPlainObject::offsetOfData() + property->offset);
+
+ masm.loadUnboxedProperty(address, property->type, output);
+
+ attacher.jumpRejoin(masm);
+
+ if (failures) {
+ masm.bind(failures);
+ attacher.jumpNextStub(masm);
+ }
+}
+
static bool
EmitGetterCall(JSContext* cx, MacroAssembler& masm,
IonCache::StubAttacher& attacher, JSObject* obj,
@@ -1135,6 +1188,39 @@ GenerateArrayLength(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher&
return true;
}
+static void
+GenerateUnboxedArrayLength(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& attacher,
+ JSObject* array, Register object, TypedOrValueRegister output,
+ Label* failures)
+{
+ Register outReg;
+ if (output.hasValue()) {
+ outReg = output.valueReg().scratchReg();
+ } else {
+ MOZ_ASSERT(output.type() == MIRType::Int32);
+ outReg = output.typedReg().gpr();
+ }
+ MOZ_ASSERT(object != outReg);
+
+ TestMatchingReceiver(masm, attacher, object, array, failures);
+
+ // Load length.
+ masm.load32(Address(object, UnboxedArrayObject::offsetOfLength()), outReg);
+
+ // Check for a length that fits in an int32.
+ masm.branchTest32(Assembler::Signed, outReg, outReg, failures);
+
+ if (output.hasValue())
+ masm.tagValue(JSVAL_TYPE_INT32, outReg, output.valueReg());
+
+ // Success.
+ attacher.jumpRejoin(masm);
+
+ // Failure.
+ masm.bind(failures);
+ attacher.jumpNextStub(masm);
+}
+
// In this case, the code for TypedArray and SharedTypedArray is not the same,
// because the code embeds pointers to the respective class arrays. Code that
// caches the stub code must distinguish between the two cases.
@@ -1448,6 +1534,101 @@ GetPropertyIC::tryAttachNative(JSContext* cx, HandleScript outerScript, IonScrip
}
bool
+GetPropertyIC::tryAttachUnboxed(JSContext* cx, HandleScript outerScript, IonScript* ion,
+ HandleObject obj, HandleId id, void* returnAddr, bool* emitted)
+{
+ MOZ_ASSERT(canAttachStub());
+ MOZ_ASSERT(!*emitted);
+ MOZ_ASSERT(outerScript->ionScript() == ion);
+
+ if (!obj->is<UnboxedPlainObject>())
+ return true;
+ const UnboxedLayout::Property* property = obj->as<UnboxedPlainObject>().layout().lookup(id);
+ if (!property)
+ return true;
+
+ *emitted = true;
+
+ MacroAssembler masm(cx, ion, outerScript, profilerLeavePc_);
+
+ Label failures;
+ emitIdGuard(masm, id, &failures);
+ Label* maybeFailures = failures.used() ? &failures : nullptr;
+
+ StubAttacher attacher(*this);
+ GenerateReadUnboxed(cx, ion, masm, attacher, obj, property, object(), output(), maybeFailures);
+ return linkAndAttachStub(cx, masm, attacher, ion, "read unboxed",
+ JS::TrackedOutcome::ICGetPropStub_UnboxedRead);
+}
+
+bool
+GetPropertyIC::tryAttachUnboxedExpando(JSContext* cx, HandleScript outerScript, IonScript* ion,
+ HandleObject obj, HandleId id, void* returnAddr, bool* emitted)
+{
+ MOZ_ASSERT(canAttachStub());
+ MOZ_ASSERT(!*emitted);
+ MOZ_ASSERT(outerScript->ionScript() == ion);
+
+ if (!obj->is<UnboxedPlainObject>())
+ return true;
+ Rooted<UnboxedExpandoObject*> expando(cx, obj->as<UnboxedPlainObject>().maybeExpando());
+ if (!expando)
+ return true;
+
+ Shape* shape = expando->lookup(cx, id);
+ if (!shape || !shape->hasDefaultGetter() || !shape->hasSlot())
+ return true;
+
+ *emitted = true;
+
+ MacroAssembler masm(cx, ion, outerScript, profilerLeavePc_);
+
+ Label failures;
+ emitIdGuard(masm, id, &failures);
+ Label* maybeFailures = failures.used() ? &failures : nullptr;
+
+ StubAttacher attacher(*this);
+ GenerateReadSlot(cx, ion, masm, attacher, DontCheckTDZ, obj, obj,
+ shape, object(), output(), maybeFailures);
+ return linkAndAttachStub(cx, masm, attacher, ion, "read unboxed expando",
+ JS::TrackedOutcome::ICGetPropStub_UnboxedReadExpando);
+}
+
+bool
+GetPropertyIC::tryAttachUnboxedArrayLength(JSContext* cx, HandleScript outerScript, IonScript* ion,
+ HandleObject obj, HandleId id, void* returnAddr,
+ bool* emitted)
+{
+ MOZ_ASSERT(canAttachStub());
+ MOZ_ASSERT(!*emitted);
+ MOZ_ASSERT(outerScript->ionScript() == ion);
+
+ if (!obj->is<UnboxedArrayObject>())
+ return true;
+
+ if (!JSID_IS_ATOM(id, cx->names().length))
+ return true;
+
+ if (obj->as<UnboxedArrayObject>().length() > INT32_MAX)
+ return true;
+
+ if (!allowArrayLength(cx))
+ return true;
+
+ *emitted = true;
+
+ MacroAssembler masm(cx, ion, outerScript, profilerLeavePc_);
+
+ Label failures;
+ emitIdGuard(masm, id, &failures);
+
+ StubAttacher attacher(*this);
+ GenerateUnboxedArrayLength(cx, masm, attacher, obj, object(), output(), &failures);
+ return linkAndAttachStub(cx, masm, attacher, ion, "unboxed array length",
+ JS::TrackedOutcome::ICGetPropStub_UnboxedArrayLength);
+}
+
+bool
GetPropertyIC::tryAttachTypedArrayLength(JSContext* cx, HandleScript outerScript, IonScript* ion,
HandleObject obj, HandleId id, bool* emitted)
{
@@ -2016,6 +2197,15 @@ GetPropertyIC::tryAttachStub(JSContext* cx, HandleScript outerScript, IonScript*
if (!*emitted && !tryAttachNative(cx, outerScript, ion, obj, id, returnAddr, emitted))
return false;
+ if (!*emitted && !tryAttachUnboxed(cx, outerScript, ion, obj, id, returnAddr, emitted))
+ return false;
+
+ if (!*emitted && !tryAttachUnboxedExpando(cx, outerScript, ion, obj, id, returnAddr, emitted))
+ return false;
+
+ if (!*emitted && !tryAttachUnboxedArrayLength(cx, outerScript, ion, obj, id, returnAddr, emitted))
+ return false;
+
if (!*emitted && !tryAttachTypedArrayLength(cx, outerScript, ion, obj, id, emitted))
return false;
}
@@ -2194,6 +2384,12 @@ GenerateSetSlot(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& att
NativeObject::slotsSizeMustNotOverflow();
+ if (obj->is<UnboxedPlainObject>()) {
+ obj = obj->as<UnboxedPlainObject>().maybeExpando();
+ masm.loadPtr(Address(object, UnboxedPlainObject::offsetOfExpando()), tempReg);
+ object = tempReg;
+ }
+
if (obj->as<NativeObject>().isFixedSlot(shape->slot())) {
Address addr(object, NativeObject::getFixedSlotOffset(shape->slot()));
@@ -2831,13 +3027,23 @@ GenerateAddSlot(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& att
masm.branchTestObjGroup(Assembler::NotEqual, object, oldGroup, failures);
if (obj->maybeShape()) {
masm.branchTestObjShape(Assembler::NotEqual, object, oldShape, failures);
+ } else {
+ MOZ_ASSERT(obj->is<UnboxedPlainObject>());
+
+ Address expandoAddress(object, UnboxedPlainObject::offsetOfExpando());
+ masm.branchPtr(Assembler::Equal, expandoAddress, ImmWord(0), failures);
+
+ masm.loadPtr(expandoAddress, tempReg);
+ masm.branchTestObjShape(Assembler::NotEqual, tempReg, oldShape, failures);
}
Shape* newShape = obj->maybeShape();
+ if (!newShape)
+ newShape = obj->as<UnboxedPlainObject>().maybeExpando()->lastProperty();
// Guard that the incoming value is in the type set for the property
// if a type barrier is required.
- if (newShape && checkTypeset)
+ if (checkTypeset)
CheckTypeSetForWrite(masm, obj, newShape->propid(), tempReg, value, failures);
// Guard shapes along prototype chain.
@@ -2858,7 +3064,9 @@ GenerateAddSlot(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& att
}
// Call a stub to (re)allocate dynamic slots, if necessary.
- uint32_t newNumDynamicSlots = obj->as<NativeObject>().numDynamicSlots();
+ uint32_t newNumDynamicSlots = obj->is<UnboxedPlainObject>()
+ ? obj->as<UnboxedPlainObject>().maybeExpando()->numDynamicSlots()
+ : obj->as<NativeObject>().numDynamicSlots();
if (NativeObject::dynamicSlotsCount(oldShape) != newNumDynamicSlots) {
AllocatableRegisterSet regs(RegisterSet::Volatile());
LiveRegisterSet save(regs.asLiveSet());
@@ -2869,6 +3077,12 @@ GenerateAddSlot(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& att
Register temp1 = regs.takeAnyGeneral();
Register temp2 = regs.takeAnyGeneral();
+ if (obj->is<UnboxedPlainObject>()) {
+ // Pass the expando object to the stub.
+ masm.Push(object);
+ masm.loadPtr(Address(object, UnboxedPlainObject::offsetOfExpando()), object);
+ }
+
masm.setupUnalignedABICall(temp1);
masm.loadJSContext(temp1);
masm.passABIArg(temp1);
@@ -2885,16 +3099,27 @@ GenerateAddSlot(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& att
masm.jump(&allocDone);
masm.bind(&allocFailed);
+ if (obj->is<UnboxedPlainObject>())
+ masm.Pop(object);
masm.PopRegsInMask(save);
masm.jump(failures);
masm.bind(&allocDone);
masm.setFramePushed(framePushedAfterCall);
+ if (obj->is<UnboxedPlainObject>())
+ masm.Pop(object);
masm.PopRegsInMask(save);
}
bool popObject = false;
+ if (obj->is<UnboxedPlainObject>()) {
+ masm.push(object);
+ popObject = true;
+ obj = obj->as<UnboxedPlainObject>().maybeExpando();
+ masm.loadPtr(Address(object, UnboxedPlainObject::offsetOfExpando()), object);
+ }
+
// Write the object or expando object's new shape.
Address shapeAddr(object, ShapedObject::offsetOfShape());
if (cx->zone()->needsIncrementalBarrier())
@@ -2902,6 +3127,8 @@ GenerateAddSlot(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& att
masm.storePtr(ImmGCPtr(newShape), shapeAddr);
if (oldGroup != obj->group()) {
+ MOZ_ASSERT(!obj->is<UnboxedPlainObject>());
+
// Changing object's group from a partially to fully initialized group,
// per the acquired properties analysis. Only change the group if the
// old group still has a newScript.
@@ -3144,6 +3371,141 @@ CanAttachNativeSetProp(JSContext* cx, HandleObject obj, HandleId id, const Const
return SetPropertyIC::CanAttachNone;
}
+static void
+GenerateSetUnboxed(JSContext* cx, MacroAssembler& masm, IonCache::StubAttacher& attacher,
+ JSObject* obj, jsid id, uint32_t unboxedOffset, JSValueType unboxedType,
+ Register object, Register tempReg, const ConstantOrRegister& value,
+ bool checkTypeset, Label* failures)
+{
+ // Guard on the type of the object.
+ masm.branchPtr(Assembler::NotEqual,
+ Address(object, JSObject::offsetOfGroup()),
+ ImmGCPtr(obj->group()), failures);
+
+ if (checkTypeset)
+ CheckTypeSetForWrite(masm, obj, id, tempReg, value, failures);
+
+ Address address(object, UnboxedPlainObject::offsetOfData() + unboxedOffset);
+
+ if (cx->zone()->needsIncrementalBarrier()) {
+ if (unboxedType == JSVAL_TYPE_OBJECT)
+ masm.callPreBarrier(address, MIRType::Object);
+ else if (unboxedType == JSVAL_TYPE_STRING)
+ masm.callPreBarrier(address, MIRType::String);
+ else
+ MOZ_ASSERT(!UnboxedTypeNeedsPreBarrier(unboxedType));
+ }
+
+ masm.storeUnboxedProperty(address, unboxedType, value, failures);
+
+ attacher.jumpRejoin(masm);
+
+ masm.bind(failures);
+ attacher.jumpNextStub(masm);
+}
+
+static bool
+CanAttachSetUnboxed(JSContext* cx, HandleObject obj, HandleId id, const ConstantOrRegister& val,
+ bool needsTypeBarrier, bool* checkTypeset,
+ uint32_t* unboxedOffset, JSValueType* unboxedType)
+{
+ if (!obj->is<UnboxedPlainObject>())
+ return false;
+
+ const UnboxedLayout::Property* property = obj->as<UnboxedPlainObject>().layout().lookup(id);
+ if (property) {
+ *checkTypeset = false;
+ if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, id, val, checkTypeset))
+ return false;
+ *unboxedOffset = property->offset;
+ *unboxedType = property->type;
+ return true;
+ }
+
+ return false;
+}
+
+static bool
+CanAttachSetUnboxedExpando(JSContext* cx, HandleObject obj, HandleId id,
+ const ConstantOrRegister& val,
+ bool needsTypeBarrier, bool* checkTypeset, Shape** pshape)
+{
+ if (!obj->is<UnboxedPlainObject>())
+ return false;
+
+ Rooted<UnboxedExpandoObject*> expando(cx, obj->as<UnboxedPlainObject>().maybeExpando());
+ if (!expando)
+ return false;
+
+ Shape* shape = expando->lookupPure(id);
+ if (!shape || !shape->hasDefaultSetter() || !shape->hasSlot() || !shape->writable())
+ return false;
+
+ *checkTypeset = false;
+ if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, id, val, checkTypeset))
+ return false;
+
+ *pshape = shape;
+ return true;
+}
+
+static bool
+CanAttachAddUnboxedExpando(JSContext* cx, HandleObject obj, HandleShape oldShape,
+ HandleId id, const ConstantOrRegister& val,
+ bool needsTypeBarrier, bool* checkTypeset)
+{
+ if (!obj->is<UnboxedPlainObject>())
+ return false;
+
+ Rooted<UnboxedExpandoObject*> expando(cx, obj->as<UnboxedPlainObject>().maybeExpando());
+ if (!expando || expando->inDictionaryMode())
+ return false;
+
+ Shape* newShape = expando->lastProperty();
+ if (newShape->isEmptyShape() || newShape->propid() != id || newShape->previous() != oldShape)
+ return false;
+
+ MOZ_ASSERT(newShape->hasDefaultSetter() && newShape->hasSlot() && newShape->writable());
+
+ if (PrototypeChainShadowsPropertyAdd(cx, obj, id))
+ return false;
+
+ *checkTypeset = false;
+ if (needsTypeBarrier && !CanInlineSetPropTypeCheck(obj, id, val, checkTypeset))
+ return false;
+
+ return true;
+}
+
+bool
+SetPropertyIC::tryAttachUnboxed(JSContext* cx, HandleScript outerScript, IonScript* ion,
+ HandleObject obj, HandleId id, bool* emitted)
+{
+ MOZ_ASSERT(!*emitted);
+
+ bool checkTypeset = false;
+ uint32_t unboxedOffset;
+ JSValueType unboxedType;
+ if (!CanAttachSetUnboxed(cx, obj, id, value(), needsTypeBarrier(), &checkTypeset,
+ &unboxedOffset, &unboxedType))
+ {
+ return true;
+ }
+
+ *emitted = true;
+
+ MacroAssembler masm(cx, ion, outerScript, profilerLeavePc_);
+ StubAttacher attacher(*this);
+
+ Label failures;
+ emitIdGuard(masm, id, &failures);
+
+ GenerateSetUnboxed(cx, masm, attacher, obj, id, unboxedOffset, unboxedType,
+ object(), temp(), value(), checkTypeset, &failures);
+ return linkAndAttachStub(cx, masm, attacher, ion, "set_unboxed",
+ JS::TrackedOutcome::ICSetPropStub_SetUnboxed);
+}
+
bool
SetPropertyIC::tryAttachProxy(JSContext* cx, HandleScript outerScript, IonScript* ion,
HandleObject obj, HandleId id, bool* emitted)
@@ -3225,6 +3587,26 @@ SetPropertyIC::tryAttachNative(JSContext* cx, HandleScript outerScript, IonScrip
}
bool
+SetPropertyIC::tryAttachUnboxedExpando(JSContext* cx, HandleScript outerScript, IonScript* ion,
+ HandleObject obj, HandleId id, bool* emitted)
+{
+ MOZ_ASSERT(!*emitted);
+
+ RootedShape shape(cx);
+ bool checkTypeset = false;
+ if (!CanAttachSetUnboxedExpando(cx, obj, id, value(), needsTypeBarrier(),
+ &checkTypeset, shape.address()))
+ {
+ return true;
+ }
+
+ if (!attachSetSlot(cx, outerScript, ion, obj, shape, checkTypeset))
+ return false;
+ *emitted = true;
+ return true;
+}
+
+bool
SetPropertyIC::tryAttachStub(JSContext* cx, HandleScript outerScript, IonScript* ion,
HandleObject obj, HandleValue idval, HandleValue value,
MutableHandleId id, bool* emitted, bool* tryNativeAddSlot)
@@ -3249,6 +3631,12 @@ SetPropertyIC::tryAttachStub(JSContext* cx, HandleScript outerScript, IonScript*
if (!*emitted && !tryAttachNative(cx, outerScript, ion, obj, id, emitted, tryNativeAddSlot))
return false;
+
+ if (!*emitted && !tryAttachUnboxed(cx, outerScript, ion, obj, id, emitted))
+ return false;
+
+ if (!*emitted && !tryAttachUnboxedExpando(cx, outerScript, ion, obj, id, emitted))
+ return false;
}
if (idval.isInt32()) {
@@ -3300,6 +3688,16 @@ SetPropertyIC::tryAttachAddSlot(JSContext* cx, HandleScript outerScript, IonScri
return true;
}
+ checkTypeset = false;
+ if (CanAttachAddUnboxedExpando(cx, obj, oldShape, id, value(), needsTypeBarrier(),
+ &checkTypeset))
+ {
+ if (!attachAddSlot(cx, outerScript, ion, obj, id, oldShape, oldGroup, checkTypeset))
+ return false;
+ *emitted = true;
+ return true;
+ }
+
return true;
}
@@ -3321,6 +3719,11 @@ SetPropertyIC::update(JSContext* cx, HandleScript outerScript, size_t cacheIndex
return false;
oldShape = obj->maybeShape();
+ if (obj->is<UnboxedPlainObject>()) {
+ MOZ_ASSERT(!oldShape);
+ if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando())
+ oldShape = expando->lastProperty();
+ }
}
RootedId id(cx);
@@ -3623,7 +4026,7 @@ GetPropertyIC::tryAttachDenseElementHole(JSContext* cx, HandleScript outerScript
GetPropertyIC::canAttachTypedOrUnboxedArrayElement(JSObject* obj, const Value& idval,
TypedOrValueRegister output)
{
- if (!obj->is<TypedArrayObject>())
+ if (!obj->is<TypedArrayObject>() && !obj->is<UnboxedArrayObject>())
return false;
MOZ_ASSERT(idval.isInt32() || idval.isString());
@@ -3654,6 +4057,13 @@ GetPropertyIC::canAttachTypedOrUnboxedArrayElement(JSObject* obj, const Value& i
return output.hasValue() || !output.typedReg().isFloat();
}
+ if (index >= obj->as<UnboxedArrayObject>().initializedLength())
+ return false;
+
+ JSValueType elementType = obj->as<UnboxedArrayObject>().elementType();
+ if (elementType == JSVAL_TYPE_DOUBLE)
+ return output.hasValue();
+
return output.hasValue() || !output.typedReg().isFloat();
}
@@ -3730,27 +4140,46 @@ GenerateGetTypedOrUnboxedArrayElement(JSContext* cx, MacroAssembler& masm,
Label popObjectAndFail;
- // Guard on the initialized length.
- Address length(object, TypedArrayObject::lengthOffset());
- masm.branch32(Assembler::BelowOrEqual, length, indexReg, &failures);
+ if (array->is<TypedArrayObject>()) {
+ // Guard on the initialized length.
+ Address length(object, TypedArrayObject::lengthOffset());
+ masm.branch32(Assembler::BelowOrEqual, length, indexReg, &failures);
- // Save the object register on the stack in case of failure.
- Register elementReg = object;
- masm.push(object);
+ // Save the object register on the stack in case of failure.
+ Register elementReg = object;
+ masm.push(object);
- // Load elements vector.
- masm.loadPtr(Address(object, TypedArrayObject::dataOffset()), elementReg);
+ // Load elements vector.
+ masm.loadPtr(Address(object, TypedArrayObject::dataOffset()), elementReg);
- // Load the value. We use an invalid register because the destination
- // register is necessary a non double register.
- Scalar::Type arrayType = array->as<TypedArrayObject>().type();
- int width = Scalar::byteSize(arrayType);
- BaseIndex source(elementReg, indexReg, ScaleFromElemWidth(width));
- if (output.hasValue()) {
- masm.loadFromTypedArray(arrayType, source, output.valueReg(), allowDoubleResult,
- elementReg, &popObjectAndFail);
+ // Load the value. We use an invalid register because the destination
+ // register is necessary a non double register.
+ Scalar::Type arrayType = array->as<TypedArrayObject>().type();
+ int width = Scalar::byteSize(arrayType);
+ BaseIndex source(elementReg, indexReg, ScaleFromElemWidth(width));
+ if (output.hasValue()) {
+ masm.loadFromTypedArray(arrayType, source, output.valueReg(), allowDoubleResult,
+ elementReg, &popObjectAndFail);
+ } else {
+ masm.loadFromTypedArray(arrayType, source, output.typedReg(), elementReg, &popObjectAndFail);
+ }
} else {
- masm.loadFromTypedArray(arrayType, source, output.typedReg(), elementReg, &popObjectAndFail);
+ // Save the object register on the stack in case of failure.
+ masm.push(object);
+
+ // Guard on the initialized length.
+ masm.load32(Address(object, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength()), object);
+ masm.and32(Imm32(UnboxedArrayObject::InitializedLengthMask), object);
+ masm.branch32(Assembler::BelowOrEqual, object, indexReg, &popObjectAndFail);
+
+ // Load elements vector.
+ Register elementReg = object;
+ masm.loadPtr(Address(masm.getStackPointer(), 0), object);
+ masm.loadPtr(Address(object, UnboxedArrayObject::offsetOfElements()), elementReg);
+
+ JSValueType elementType = array->as<UnboxedArrayObject>().elementType();
+ BaseIndex source(elementReg, indexReg, ScaleFromElemWidth(UnboxedTypeSize(elementType)));
+ masm.loadUnboxedProperty(source, elementType, output);
}
masm.pop(object);
diff --git a/js/src/jit/IonCaches.h b/js/src/jit/IonCaches.h
index b00646538..173e06c6b 100644
--- a/js/src/jit/IonCaches.h
+++ b/js/src/jit/IonCaches.h
@@ -529,6 +529,18 @@ class GetPropertyIC : public IonCache
HandleObject obj, HandleId id, void* returnAddr,
bool* emitted);
+ MOZ_MUST_USE bool tryAttachUnboxed(JSContext* cx, HandleScript outerScript, IonScript* ion,
+ HandleObject obj, HandleId id, void* returnAddr,
+ bool* emitted);
+
+ MOZ_MUST_USE bool tryAttachUnboxedExpando(JSContext* cx, HandleScript outerScript,
+ IonScript* ion, HandleObject obj, HandleId id,
+ void* returnAddr, bool* emitted);
+
+ MOZ_MUST_USE bool tryAttachUnboxedArrayLength(JSContext* cx, HandleScript outerScript,
+ IonScript* ion, HandleObject obj, HandleId id,
+ void* returnAddr, bool* emitted);
+
MOZ_MUST_USE bool tryAttachTypedArrayLength(JSContext* cx, HandleScript outerScript,
IonScript* ion, HandleObject obj, HandleId id,
bool* emitted);
diff --git a/js/src/jit/JitOptions.cpp b/js/src/jit/JitOptions.cpp
index 3f9d9db88..b9a7c7b27 100644
--- a/js/src/jit/JitOptions.cpp
+++ b/js/src/jit/JitOptions.cpp
@@ -221,6 +221,9 @@ DefaultJitOptions::DefaultJitOptions()
Warn(forcedRegisterAllocatorEnv, env);
}
+ // Toggles whether unboxed plain objects can be created by the VM.
+ SET_DEFAULT(disableUnboxedObjects, true);
+
// Test whether Atomics are allowed in asm.js code.
SET_DEFAULT(asmJSAtomicsEnable, false);
diff --git a/js/src/jit/JitOptions.h b/js/src/jit/JitOptions.h
index 719ee14d9..076980b4e 100644
--- a/js/src/jit/JitOptions.h
+++ b/js/src/jit/JitOptions.h
@@ -91,6 +91,9 @@ struct DefaultJitOptions
mozilla::Maybe<uint32_t> forcedDefaultIonSmallFunctionWarmUpThreshold;
mozilla::Maybe<IonRegisterAllocator> forcedRegisterAllocator;
+ // The options below affect the rest of the VM, and not just the JIT.
+ bool disableUnboxedObjects;
+
DefaultJitOptions();
bool isSmallFunction(JSScript* script) const;
void setEagerCompilation();
diff --git a/js/src/jit/Lowering.cpp b/js/src/jit/Lowering.cpp
index 108450983..f9b0b2157 100644
--- a/js/src/jit/Lowering.cpp
+++ b/js/src/jit/Lowering.cpp
@@ -2297,14 +2297,9 @@ LIRGenerator::visitToObjectOrNull(MToObjectOrNull* ins)
void
LIRGenerator::visitRegExp(MRegExp* ins)
{
- if (ins->mustClone()) {
- LRegExp* lir = new(alloc()) LRegExp();
- defineReturn(lir, ins);
- assignSafepoint(lir, ins);
- } else {
- RegExpObject* source = ins->source();
- define(new(alloc()) LPointer(source), ins);
- }
+ LRegExp* lir = new(alloc()) LRegExp();
+ defineReturn(lir, ins);
+ assignSafepoint(lir, ins);
}
void
@@ -2895,6 +2890,32 @@ LIRGenerator::visitSetInitializedLength(MSetInitializedLength* ins)
}
void
+LIRGenerator::visitUnboxedArrayLength(MUnboxedArrayLength* ins)
+{
+ define(new(alloc()) LUnboxedArrayLength(useRegisterAtStart(ins->object())), ins);
+}
+
+void
+LIRGenerator::visitUnboxedArrayInitializedLength(MUnboxedArrayInitializedLength* ins)
+{
+ define(new(alloc()) LUnboxedArrayInitializedLength(useRegisterAtStart(ins->object())), ins);
+}
+
+void
+LIRGenerator::visitIncrementUnboxedArrayInitializedLength(MIncrementUnboxedArrayInitializedLength* ins)
+{
+ add(new(alloc()) LIncrementUnboxedArrayInitializedLength(useRegister(ins->object())), ins);
+}
+
+void
+LIRGenerator::visitSetUnboxedArrayInitializedLength(MSetUnboxedArrayInitializedLength* ins)
+{
+ add(new(alloc()) LSetUnboxedArrayInitializedLength(useRegister(ins->object()),
+ useRegisterOrConstant(ins->length()),
+ temp()), ins);
+}
+
+void
LIRGenerator::visitNot(MNot* ins)
{
MDefinition* op = ins->input();
@@ -3143,16 +3164,22 @@ LIRGenerator::visitStoreElementHole(MStoreElementHole* ins)
const LUse elements = useRegister(ins->elements());
const LAllocation index = useRegisterOrConstant(ins->index());
+ // Use a temp register when adding new elements to unboxed arrays.
+ LDefinition tempDef = LDefinition::BogusTemp();
+ if (ins->unboxedType() != JSVAL_TYPE_MAGIC)
+ tempDef = temp();
+
LInstruction* lir;
switch (ins->value()->type()) {
case MIRType::Value:
- lir = new(alloc()) LStoreElementHoleV(object, elements, index, useBox(ins->value()));
+ lir = new(alloc()) LStoreElementHoleV(object, elements, index, useBox(ins->value()),
+ tempDef);
break;
default:
{
const LAllocation value = useRegisterOrNonDoubleConstant(ins->value());
- lir = new(alloc()) LStoreElementHoleT(object, elements, index, value);
+ lir = new(alloc()) LStoreElementHoleT(object, elements, index, value, tempDef);
break;
}
}
@@ -3171,14 +3198,20 @@ LIRGenerator::visitFallibleStoreElement(MFallibleStoreElement* ins)
const LUse elements = useRegister(ins->elements());
const LAllocation index = useRegisterOrConstant(ins->index());
+ // Use a temp register when adding new elements to unboxed arrays.
+ LDefinition tempDef = LDefinition::BogusTemp();
+ if (ins->unboxedType() != JSVAL_TYPE_MAGIC)
+ tempDef = temp();
+
LInstruction* lir;
switch (ins->value()->type()) {
case MIRType::Value:
- lir = new(alloc()) LFallibleStoreElementV(object, elements, index, useBox(ins->value()));
+ lir = new(alloc()) LFallibleStoreElementV(object, elements, index, useBox(ins->value()),
+ tempDef);
break;
default:
const LAllocation value = useRegisterOrNonDoubleConstant(ins->value());
- lir = new(alloc()) LFallibleStoreElementT(object, elements, index, value);
+ lir = new(alloc()) LFallibleStoreElementT(object, elements, index, value, tempDef);
break;
}
@@ -3220,6 +3253,14 @@ LIRGenerator::visitStoreUnboxedString(MStoreUnboxedString* ins)
}
void
+LIRGenerator::visitConvertUnboxedObjectToNative(MConvertUnboxedObjectToNative* ins)
+{
+ LInstruction* check = new(alloc()) LConvertUnboxedObjectToNative(useRegister(ins->object()));
+ add(check, ins);
+ assignSafepoint(check, ins);
+}
+
+void
LIRGenerator::visitEffectiveAddress(MEffectiveAddress* ins)
{
define(new(alloc()) LEffectiveAddress(useRegister(ins->base()), useRegister(ins->index())), ins);
@@ -3737,6 +3778,24 @@ LIRGenerator::visitGuardReceiverPolymorphic(MGuardReceiverPolymorphic* ins)
}
void
+LIRGenerator::visitGuardUnboxedExpando(MGuardUnboxedExpando* ins)
+{
+ LGuardUnboxedExpando* guard =
+ new(alloc()) LGuardUnboxedExpando(useRegister(ins->object()));
+ assignSnapshot(guard, ins->bailoutKind());
+ add(guard, ins);
+ redefine(ins, ins->object());
+}
+
+void
+LIRGenerator::visitLoadUnboxedExpando(MLoadUnboxedExpando* ins)
+{
+ LLoadUnboxedExpando* lir =
+ new(alloc()) LLoadUnboxedExpando(useRegisterAtStart(ins->object()));
+ define(lir, ins);
+}
+
+void
LIRGenerator::visitAssertRange(MAssertRange* ins)
{
MDefinition* input = ins->input();
diff --git a/js/src/jit/Lowering.h b/js/src/jit/Lowering.h
index 81e6abbbb..de66f175b 100644
--- a/js/src/jit/Lowering.h
+++ b/js/src/jit/Lowering.h
@@ -217,6 +217,10 @@ class LIRGenerator : public LIRGeneratorSpecific
void visitTypedObjectDescr(MTypedObjectDescr* ins);
void visitInitializedLength(MInitializedLength* ins);
void visitSetInitializedLength(MSetInitializedLength* ins);
+ void visitUnboxedArrayLength(MUnboxedArrayLength* ins);
+ void visitUnboxedArrayInitializedLength(MUnboxedArrayInitializedLength* ins);
+ void visitIncrementUnboxedArrayInitializedLength(MIncrementUnboxedArrayInitializedLength* ins);
+ void visitSetUnboxedArrayInitializedLength(MSetUnboxedArrayInitializedLength* ins);
void visitNot(MNot* ins);
void visitBoundsCheck(MBoundsCheck* ins);
void visitBoundsCheckLower(MBoundsCheckLower* ins);
@@ -229,6 +233,7 @@ class LIRGenerator : public LIRGeneratorSpecific
void visitFallibleStoreElement(MFallibleStoreElement* ins);
void visitStoreUnboxedObjectOrNull(MStoreUnboxedObjectOrNull* ins);
void visitStoreUnboxedString(MStoreUnboxedString* ins);
+ void visitConvertUnboxedObjectToNative(MConvertUnboxedObjectToNative* ins);
void visitEffectiveAddress(MEffectiveAddress* ins);
void visitArrayPopShift(MArrayPopShift* ins);
void visitArrayPush(MArrayPush* ins);
@@ -252,6 +257,8 @@ class LIRGenerator : public LIRGeneratorSpecific
void visitGuardObject(MGuardObject* ins);
void visitGuardString(MGuardString* ins);
void visitGuardReceiverPolymorphic(MGuardReceiverPolymorphic* ins);
+ void visitGuardUnboxedExpando(MGuardUnboxedExpando* ins);
+ void visitLoadUnboxedExpando(MLoadUnboxedExpando* ins);
void visitPolyInlineGuard(MPolyInlineGuard* ins);
void visitAssertRange(MAssertRange* ins);
void visitCallGetProperty(MCallGetProperty* ins);
diff --git a/js/src/jit/MCallOptimize.cpp b/js/src/jit/MCallOptimize.cpp
index 236354530..f2071dc6a 100644
--- a/js/src/jit/MCallOptimize.cpp
+++ b/js/src/jit/MCallOptimize.cpp
@@ -30,6 +30,7 @@
#include "jit/shared/Lowering-shared-inl.h"
#include "vm/NativeObject-inl.h"
#include "vm/StringObject-inl.h"
+#include "vm/UnboxedObject-inl.h"
using mozilla::ArrayLength;
using mozilla::AssertedCast;
@@ -470,6 +471,11 @@ IonBuilder::inlineArray(CallInfo& callInfo)
return InliningStatus_NotInlined;
}
+ if (templateObject->is<UnboxedArrayObject>()) {
+ if (templateObject->group()->unboxedLayout().nativeGroup())
+ return InliningStatus_NotInlined;
+ }
+
// Multiple arguments imply array initialization, not just construction.
if (callInfo.argc() >= 2) {
initLength = callInfo.argc();
@@ -517,7 +523,7 @@ IonBuilder::inlineArray(CallInfo& callInfo)
// Make sure initLength matches the template object's length. This is
// not guaranteed to be the case, for instance if we're inlining the
// MConstant may come from an outer script.
- if (initLength != templateObject->as<ArrayObject>().length())
+ if (initLength != GetAnyBoxedOrUnboxedArrayLength(templateObject))
return InliningStatus_NotInlined;
// Don't inline large allocations.
@@ -532,15 +538,16 @@ IonBuilder::inlineArray(CallInfo& callInfo)
MDefinition* array = current->peek(-1);
if (callInfo.argc() >= 2) {
+ JSValueType unboxedType = GetBoxedOrUnboxedType(templateObject);
for (uint32_t i = 0; i < initLength; i++) {
if (!alloc().ensureBallast())
return InliningStatus_Error;
MDefinition* value = callInfo.getArg(i);
- if (!initializeArrayElement(array, i, value, /* addResumePoint = */ false))
+ if (!initializeArrayElement(array, i, value, unboxedType, /* addResumePoint = */ false))
return InliningStatus_Error;
}
- MInstruction* setLength = setInitializedLength(array, initLength);
+ MInstruction* setLength = setInitializedLength(array, unboxedType, initLength);
if (!resumeAfter(setLength))
return InliningStatus_Error;
}
@@ -573,7 +580,7 @@ IonBuilder::inlineArrayIsArray(CallInfo& callInfo)
if (!clasp || clasp->isProxy())
return InliningStatus_NotInlined;
- isArray = (clasp == &ArrayObject::class_);
+ isArray = (clasp == &ArrayObject::class_ || clasp == &UnboxedArrayObject::class_);
}
pushConstant(BooleanValue(isArray));
@@ -604,12 +611,12 @@ IonBuilder::inlineArrayPopShift(CallInfo& callInfo, MArrayPopShift::Mode mode)
OBJECT_FLAG_LENGTH_OVERFLOW |
OBJECT_FLAG_ITERATED;
- MDefinition* obj = callInfo.thisArg();
+ MDefinition* obj = convertUnboxedObjects(callInfo.thisArg());
TemporaryTypeSet* thisTypes = obj->resultTypeSet();
if (!thisTypes)
return InliningStatus_NotInlined;
const Class* clasp = thisTypes->getKnownClass(constraints());
- if (clasp != &ArrayObject::class_)
+ if (clasp != &ArrayObject::class_ && clasp != &UnboxedArrayObject::class_)
return InliningStatus_NotInlined;
if (thisTypes->hasObjectFlags(constraints(), unhandledFlags)) {
trackOptimizationOutcome(TrackedOutcome::ArrayBadFlags);
@@ -622,9 +629,17 @@ IonBuilder::inlineArrayPopShift(CallInfo& callInfo, MArrayPopShift::Mode mode)
return InliningStatus_NotInlined;
}
+ JSValueType unboxedType = JSVAL_TYPE_MAGIC;
+ if (clasp == &UnboxedArrayObject::class_) {
+ unboxedType = UnboxedArrayElementType(constraints(), obj, nullptr);
+ if (unboxedType == JSVAL_TYPE_MAGIC)
+ return InliningStatus_NotInlined;
+ }
+
callInfo.setImplicitlyUsedUnchecked();
- obj = addMaybeCopyElementsForWrite(obj, /* checkNative = */ false);
+ if (clasp == &ArrayObject::class_)
+ obj = addMaybeCopyElementsForWrite(obj, /* checkNative = */ false);
TemporaryTypeSet* returnTypes = getInlineReturnTypeSet();
bool needsHoleCheck = thisTypes->hasObjectFlags(constraints(), OBJECT_FLAG_NON_PACKED);
@@ -635,7 +650,8 @@ IonBuilder::inlineArrayPopShift(CallInfo& callInfo, MArrayPopShift::Mode mode)
if (barrier != BarrierKind::NoBarrier)
returnType = MIRType::Value;
- MArrayPopShift* ins = MArrayPopShift::New(alloc(), obj, mode, needsHoleCheck, maybeUndefined);
+ MArrayPopShift* ins = MArrayPopShift::New(alloc(), obj, mode,
+ unboxedType, needsHoleCheck, maybeUndefined);
current->add(ins);
current->push(ins);
ins->setResultType(returnType);
@@ -684,7 +700,7 @@ IonBuilder::inlineArrayPush(CallInfo& callInfo)
return InliningStatus_NotInlined;
}
- MDefinition* obj = callInfo.thisArg();
+ MDefinition* obj = convertUnboxedObjects(callInfo.thisArg());
MDefinition* value = callInfo.getArg(0);
if (PropertyWriteNeedsTypeBarrier(alloc(), constraints(), current,
&obj, nullptr, &value, /* canModify = */ false))
@@ -717,6 +733,13 @@ IonBuilder::inlineArrayPush(CallInfo& callInfo)
return InliningStatus_NotInlined;
}
+ JSValueType unboxedType = JSVAL_TYPE_MAGIC;
+ if (clasp == &UnboxedArrayObject::class_) {
+ unboxedType = UnboxedArrayElementType(constraints(), obj, nullptr);
+ if (unboxedType == JSVAL_TYPE_MAGIC)
+ return InliningStatus_NotInlined;
+ }
+
callInfo.setImplicitlyUsedUnchecked();
if (conversion == TemporaryTypeSet::AlwaysConvertToDoubles ||
@@ -727,12 +750,13 @@ IonBuilder::inlineArrayPush(CallInfo& callInfo)
value = valueDouble;
}
- obj = addMaybeCopyElementsForWrite(obj, /* checkNative = */ false);
+ if (unboxedType == JSVAL_TYPE_MAGIC)
+ obj = addMaybeCopyElementsForWrite(obj, /* checkNative = */ false);
if (NeedsPostBarrier(value))
current->add(MPostWriteBarrier::New(alloc(), obj, value));
- MArrayPush* ins = MArrayPush::New(alloc(), obj, value);
+ MArrayPush* ins = MArrayPush::New(alloc(), obj, value, unboxedType);
current->add(ins);
current->push(ins);
@@ -749,7 +773,7 @@ IonBuilder::inlineArraySlice(CallInfo& callInfo)
return InliningStatus_NotInlined;
}
- MDefinition* obj = callInfo.thisArg();
+ MDefinition* obj = convertUnboxedObjects(callInfo.thisArg());
// Ensure |this| and result are objects.
if (getInlineReturnType() != MIRType::Object)
@@ -773,9 +797,16 @@ IonBuilder::inlineArraySlice(CallInfo& callInfo)
return InliningStatus_NotInlined;
const Class* clasp = thisTypes->getKnownClass(constraints());
- if (clasp != &ArrayObject::class_)
+ if (clasp != &ArrayObject::class_ && clasp != &UnboxedArrayObject::class_)
return InliningStatus_NotInlined;
+ JSValueType unboxedType = JSVAL_TYPE_MAGIC;
+ if (clasp == &UnboxedArrayObject::class_) {
+ unboxedType = UnboxedArrayElementType(constraints(), obj, nullptr);
+ if (unboxedType == JSVAL_TYPE_MAGIC)
+ return InliningStatus_NotInlined;
+ }
+
// Watch out for indexed properties on the object or its prototype.
if (ElementAccessHasExtraIndexedProperty(this, obj)) {
trackOptimizationOutcome(TrackedOutcome::ProtoIndexedProps);
@@ -796,8 +827,15 @@ IonBuilder::inlineArraySlice(CallInfo& callInfo)
if (!templateObj)
return InliningStatus_NotInlined;
- if (!templateObj->is<ArrayObject>())
- return InliningStatus_NotInlined;
+ if (unboxedType == JSVAL_TYPE_MAGIC) {
+ if (!templateObj->is<ArrayObject>())
+ return InliningStatus_NotInlined;
+ } else {
+ if (!templateObj->is<UnboxedArrayObject>())
+ return InliningStatus_NotInlined;
+ if (templateObj->as<UnboxedArrayObject>().elementType() != unboxedType)
+ return InliningStatus_NotInlined;
+ }
callInfo.setImplicitlyUsedUnchecked();
@@ -816,12 +854,16 @@ IonBuilder::inlineArraySlice(CallInfo& callInfo)
end = MArrayLength::New(alloc(), elements);
current->add(end->toInstruction());
+ } else {
+ end = MUnboxedArrayLength::New(alloc(), obj);
+ current->add(end->toInstruction());
}
MArraySlice* ins = MArraySlice::New(alloc(), constraints(),
obj, begin, end,
templateObj,
- templateObj->group()->initialHeap(constraints()));
+ templateObj->group()->initialHeap(constraints()),
+ unboxedType);
current->add(ins);
current->push(ins);
@@ -1340,7 +1382,7 @@ IonBuilder::inlineConstantStringSplitString(CallInfo& callInfo)
// Check if exist a template object in stub.
JSString* stringStr = nullptr;
JSString* stringSep = nullptr;
- ArrayObject* templateObject = nullptr;
+ JSObject* templateObject = nullptr;
if (!inspector->isOptimizableCallStringSplit(pc, &stringStr, &stringSep, &templateObject))
return InliningStatus_NotInlined;
@@ -1366,13 +1408,13 @@ IonBuilder::inlineConstantStringSplitString(CallInfo& callInfo)
if (!key.maybeTypes()->hasType(TypeSet::StringType()))
return InliningStatus_NotInlined;
- uint32_t initLength = templateObject->length();
- if (templateObject->getDenseInitializedLength() != initLength)
+ uint32_t initLength = GetAnyBoxedOrUnboxedArrayLength(templateObject);
+ if (GetAnyBoxedOrUnboxedInitializedLength(templateObject) != initLength)
return InliningStatus_NotInlined;
Vector<MConstant*, 0, SystemAllocPolicy> arrayValues;
for (uint32_t i = 0; i < initLength; i++) {
- Value str = templateObject->getDenseElement(i);
+ Value str = GetAnyBoxedOrUnboxedDenseElement(templateObject, i);
MOZ_ASSERT(str.toString()->isAtom());
MConstant* value = MConstant::New(alloc().fallible(), str, constraints());
if (!value)
@@ -1403,6 +1445,8 @@ IonBuilder::inlineConstantStringSplitString(CallInfo& callInfo)
return InliningStatus_Inlined;
}
+ JSValueType unboxedType = GetBoxedOrUnboxedType(templateObject);
+
// Store all values, no need to initialize the length after each as
// jsop_initelem_array is doing because we do not expect to bailout
// because the memory is supposed to be allocated by now.
@@ -1413,11 +1457,11 @@ IonBuilder::inlineConstantStringSplitString(CallInfo& callInfo)
MConstant* value = arrayValues[i];
current->add(value);
- if (!initializeArrayElement(array, i, value, /* addResumePoint = */ false))
+ if (!initializeArrayElement(array, i, value, unboxedType, /* addResumePoint = */ false))
return InliningStatus_Error;
}
- MInstruction* setLength = setInitializedLength(array, initLength);
+ MInstruction* setLength = setInitializedLength(array, unboxedType, initLength);
if (!resumeAfter(setLength))
return InliningStatus_Error;
@@ -2053,7 +2097,7 @@ IonBuilder::inlineDefineDataProperty(CallInfo& callInfo)
if (callInfo.argc() != 3)
return InliningStatus_NotInlined;
- MDefinition* obj = callInfo.getArg(0);
+ MDefinition* obj = convertUnboxedObjects(callInfo.getArg(0));
MDefinition* id = callInfo.getArg(1);
MDefinition* value = callInfo.getArg(2);
diff --git a/js/src/jit/MIR.cpp b/js/src/jit/MIR.cpp
index 0cf31adb3..b9e5e8d61 100644
--- a/js/src/jit/MIR.cpp
+++ b/js/src/jit/MIR.cpp
@@ -2630,6 +2630,40 @@ jit::EqualTypes(MIRType type1, TemporaryTypeSet* typeset1,
return typeset1->equals(typeset2);
}
+// Tests whether input/inputTypes can always be stored to an unboxed
+// object/array property with the given unboxed type.
+bool
+jit::CanStoreUnboxedType(TempAllocator& alloc,
+ JSValueType unboxedType, MIRType input, TypeSet* inputTypes)
+{
+ TemporaryTypeSet types;
+
+ switch (unboxedType) {
+ case JSVAL_TYPE_BOOLEAN:
+ case JSVAL_TYPE_INT32:
+ case JSVAL_TYPE_DOUBLE:
+ case JSVAL_TYPE_STRING:
+ types.addType(TypeSet::PrimitiveType(unboxedType), alloc.lifoAlloc());
+ break;
+
+ case JSVAL_TYPE_OBJECT:
+ types.addType(TypeSet::AnyObjectType(), alloc.lifoAlloc());
+ types.addType(TypeSet::NullType(), alloc.lifoAlloc());
+ break;
+
+ default:
+ MOZ_CRASH("Bad unboxed type");
+ }
+
+ return TypeSetIncludes(&types, input, inputTypes);
+}
+
+static bool
+CanStoreUnboxedType(TempAllocator& alloc, JSValueType unboxedType, MDefinition* value)
+{
+ return CanStoreUnboxedType(alloc, unboxedType, value->type(), value->resultTypeSet());
+}
+
bool
MPhi::specializeType(TempAllocator& alloc)
{
@@ -4776,31 +4810,67 @@ MBeta::printOpcode(GenericPrinter& out) const
bool
MCreateThisWithTemplate::canRecoverOnBailout() const
{
- MOZ_ASSERT(templateObject()->is<PlainObject>());
- MOZ_ASSERT(!templateObject()->as<PlainObject>().denseElementsAreCopyOnWrite());
+ MOZ_ASSERT(templateObject()->is<PlainObject>() || templateObject()->is<UnboxedPlainObject>());
+ MOZ_ASSERT_IF(templateObject()->is<PlainObject>(),
+ !templateObject()->as<PlainObject>().denseElementsAreCopyOnWrite());
+ return true;
+}
+
+bool
+OperandIndexMap::init(TempAllocator& alloc, JSObject* templateObject)
+{
+ const UnboxedLayout& layout =
+ templateObject->as<UnboxedPlainObject>().layoutDontCheckGeneration();
+
+ const UnboxedLayout::PropertyVector& properties = layout.properties();
+ MOZ_ASSERT(properties.length() < 255);
+
+ // Allocate an array of indexes, where the top of each field correspond to
+ // the index of the operand in the MObjectState instance.
+ if (!map.init(alloc, layout.size()))
+ return false;
+
+ // Reset all indexes to 0, which is an error code.
+ for (size_t i = 0; i < map.length(); i++)
+ map[i] = 0;
+
+ // Map the property offsets to the indexes of MObjectState operands.
+ uint8_t index = 1;
+ for (size_t i = 0; i < properties.length(); i++, index++)
+ map[properties[i].offset] = index;
+
return true;
}
MObjectState::MObjectState(MObjectState* state)
: numSlots_(state->numSlots_),
- numFixedSlots_(state->numFixedSlots_)
+ numFixedSlots_(state->numFixedSlots_),
+ operandIndex_(state->operandIndex_)
{
// This instruction is only used as a summary for bailout paths.
setResultType(MIRType::Object);
setRecoveredOnBailout();
}
-MObjectState::MObjectState(JSObject* templateObject)
+MObjectState::MObjectState(JSObject *templateObject, OperandIndexMap* operandIndex)
{
// This instruction is only used as a summary for bailout paths.
setResultType(MIRType::Object);
setRecoveredOnBailout();
- MOZ_ASSERT(templateObject->is<NativeObject>());
+ if (templateObject->is<NativeObject>()) {
+ NativeObject* nativeObject = &templateObject->as<NativeObject>();
+ numSlots_ = nativeObject->slotSpan();
+ numFixedSlots_ = nativeObject->numFixedSlots();
+ } else {
+ const UnboxedLayout& layout =
+ templateObject->as<UnboxedPlainObject>().layoutDontCheckGeneration();
+ // Same as UnboxedLayout::makeNativeGroup
+ numSlots_ = layout.properties().length();
+ numFixedSlots_ = gc::GetGCKindSlots(layout.getAllocKind());
+ }
- NativeObject* nativeObject = &templateObject->as<NativeObject>();
- numSlots_ = nativeObject->slotSpan();
- numFixedSlots_ = nativeObject->numFixedSlots();
+ operandIndex_ = operandIndex;
}
JSObject*
@@ -4835,21 +4905,39 @@ MObjectState::initFromTemplateObject(TempAllocator& alloc, MDefinition* undefine
// the template object. This is needed to account values which are baked in
// the template objects and not visible in IonMonkey, such as the
// uninitialized-lexical magic value of call objects.
- NativeObject& nativeObject = templateObject->as<NativeObject>();
- MOZ_ASSERT(nativeObject.slotSpan() == numSlots());
-
- MOZ_ASSERT(templateObject->is<NativeObject>());
- for (size_t i = 0; i < numSlots(); i++) {
- Value val = nativeObject.getSlot(i);
- MDefinition *def = undefinedVal;
- if (!val.isUndefined()) {
- MConstant* ins = val.isObject() ?
- MConstant::NewConstraintlessObject(alloc, &val.toObject()) :
- MConstant::New(alloc, val);
- block()->insertBefore(this, ins);
- def = ins;
+ if (templateObject->is<UnboxedPlainObject>()) {
+ UnboxedPlainObject& unboxedObject = templateObject->as<UnboxedPlainObject>();
+ const UnboxedLayout& layout = unboxedObject.layoutDontCheckGeneration();
+ const UnboxedLayout::PropertyVector& properties = layout.properties();
+
+ for (size_t i = 0; i < properties.length(); i++) {
+ Value val = unboxedObject.getValue(properties[i], /* maybeUninitialized = */ true);
+ MDefinition *def = undefinedVal;
+ if (!val.isUndefined()) {
+ MConstant* ins = val.isObject() ?
+ MConstant::NewConstraintlessObject(alloc, &val.toObject()) :
+ MConstant::New(alloc, val);
+ block()->insertBefore(this, ins);
+ def = ins;
+ }
+ initSlot(i, def);
+ }
+ } else {
+ NativeObject& nativeObject = templateObject->as<NativeObject>();
+ MOZ_ASSERT(nativeObject.slotSpan() == numSlots());
+
+ for (size_t i = 0; i < numSlots(); i++) {
+ Value val = nativeObject.getSlot(i);
+ MDefinition *def = undefinedVal;
+ if (!val.isUndefined()) {
+ MConstant* ins = val.isObject() ?
+ MConstant::NewConstraintlessObject(alloc, &val.toObject()) :
+ MConstant::New(alloc, val);
+ block()->insertBefore(this, ins);
+ def = ins;
+ }
+ initSlot(i, def);
}
- initSlot(i, def);
}
return true;
}
@@ -4860,7 +4948,14 @@ MObjectState::New(TempAllocator& alloc, MDefinition* obj)
JSObject* templateObject = templateObjectOf(obj);
MOZ_ASSERT(templateObject, "Unexpected object creation.");
- MObjectState* res = new(alloc) MObjectState(templateObject);
+ OperandIndexMap* operandIndex = nullptr;
+ if (templateObject->is<UnboxedPlainObject>()) {
+ operandIndex = new(alloc) OperandIndexMap;
+ if (!operandIndex || !operandIndex->init(alloc, templateObject))
+ return nullptr;
+ }
+
+ MObjectState* res = new(alloc) MObjectState(templateObject, operandIndex);
if (!res || !res->init(alloc, obj))
return nullptr;
return res;
@@ -5767,6 +5862,35 @@ MGetFirstDollarIndex::foldsTo(TempAllocator& alloc)
return MConstant::New(alloc, Int32Value(index));
}
+MConvertUnboxedObjectToNative*
+MConvertUnboxedObjectToNative::New(TempAllocator& alloc, MDefinition* obj, ObjectGroup* group)
+{
+ MConvertUnboxedObjectToNative* res = new(alloc) MConvertUnboxedObjectToNative(obj, group);
+
+ ObjectGroup* nativeGroup = group->unboxedLayout().nativeGroup();
+
+ // Make a new type set for the result of this instruction which replaces
+ // the input group with the native group we will convert it to.
+ TemporaryTypeSet* types = obj->resultTypeSet();
+ if (types && !types->unknownObject()) {
+ TemporaryTypeSet* newTypes = types->cloneWithoutObjects(alloc.lifoAlloc());
+ if (newTypes) {
+ for (size_t i = 0; i < types->getObjectCount(); i++) {
+ TypeSet::ObjectKey* key = types->getObject(i);
+ if (!key)
+ continue;
+ if (key->unknownProperties() || !key->isGroup() || key->group() != group)
+ newTypes->addType(TypeSet::ObjectType(key), alloc.lifoAlloc());
+ else
+ newTypes->addType(TypeSet::ObjectType(nativeGroup), alloc.lifoAlloc());
+ }
+ res->setResultTypeSet(newTypes);
+ }
+ }
+
+ return res;
+}
+
bool
jit::ElementAccessIsDenseNative(CompilerConstraintList* constraints,
MDefinition* obj, MDefinition* id)
@@ -5786,6 +5910,48 @@ jit::ElementAccessIsDenseNative(CompilerConstraintList* constraints,
return clasp && clasp->isNative() && !IsTypedArrayClass(clasp);
}
+JSValueType
+jit::UnboxedArrayElementType(CompilerConstraintList* constraints, MDefinition* obj,
+ MDefinition* id)
+{
+ if (obj->mightBeType(MIRType::String))
+ return JSVAL_TYPE_MAGIC;
+
+ if (id && id->type() != MIRType::Int32 && id->type() != MIRType::Double)
+ return JSVAL_TYPE_MAGIC;
+
+ TemporaryTypeSet* types = obj->resultTypeSet();
+ if (!types || types->unknownObject())
+ return JSVAL_TYPE_MAGIC;
+
+ JSValueType elementType = JSVAL_TYPE_MAGIC;
+ for (unsigned i = 0; i < types->getObjectCount(); i++) {
+ TypeSet::ObjectKey* key = types->getObject(i);
+ if (!key)
+ continue;
+
+ if (key->unknownProperties() || !key->isGroup())
+ return JSVAL_TYPE_MAGIC;
+
+ if (key->clasp() != &UnboxedArrayObject::class_)
+ return JSVAL_TYPE_MAGIC;
+
+ const UnboxedLayout &layout = key->group()->unboxedLayout();
+
+ if (layout.nativeGroup())
+ return JSVAL_TYPE_MAGIC;
+
+ if (elementType == layout.elementType() || elementType == JSVAL_TYPE_MAGIC)
+ elementType = layout.elementType();
+ else
+ return JSVAL_TYPE_MAGIC;
+
+ key->watchStateChangeForUnboxedConvertedToNative(constraints);
+ }
+
+ return elementType;
+}
+
bool
jit::ElementAccessIsTypedArray(CompilerConstraintList* constraints,
MDefinition* obj, MDefinition* id,
@@ -5945,6 +6111,11 @@ ObjectSubsumes(TypeSet::ObjectKey* first, TypeSet::ObjectKey* second)
firstElements.maybeTypes()->equals(secondElements.maybeTypes());
}
+ if (first->clasp() == &UnboxedArrayObject::class_) {
+ return first->group()->unboxedLayout().elementType() ==
+ second->group()->unboxedLayout().elementType();
+ }
+
return false;
}
@@ -6399,6 +6570,23 @@ jit::PropertyWriteNeedsTypeBarrier(TempAllocator& alloc, CompilerConstraintList*
}
}
+ // Perform additional filtering to make sure that any unboxed property
+ // being written can accommodate the value.
+ for (size_t i = 0; i < types->getObjectCount(); i++) {
+ TypeSet::ObjectKey* key = types->getObject(i);
+ if (key && key->isGroup() && key->group()->maybeUnboxedLayout()) {
+ const UnboxedLayout& layout = key->group()->unboxedLayout();
+ if (name) {
+ const UnboxedLayout::Property* property = layout.lookup(name);
+ if (property && !CanStoreUnboxedType(alloc, property->type, *pvalue))
+ return true;
+ } else {
+ if (layout.isArray() && !CanStoreUnboxedType(alloc, layout.elementType(), *pvalue))
+ return true;
+ }
+ }
+ }
+
if (success)
return false;
@@ -6429,6 +6617,17 @@ jit::PropertyWriteNeedsTypeBarrier(TempAllocator& alloc, CompilerConstraintList*
MOZ_ASSERT(excluded);
+ // If the excluded object is a group with an unboxed layout, make sure it
+ // does not have a corresponding native group. Objects with the native
+ // group might appear even though they are not in the type set.
+ if (excluded->isGroup()) {
+ if (UnboxedLayout* layout = excluded->group()->maybeUnboxedLayout()) {
+ if (layout->nativeGroup())
+ return true;
+ excluded->watchStateChangeForUnboxedConvertedToNative(constraints);
+ }
+ }
+
*pobj = AddGroupGuard(alloc, current, *pobj, excluded, /* bailOnEquality = */ true);
return false;
}
diff --git a/js/src/jit/MIR.h b/js/src/jit/MIR.h
index 0c1e77f80..81662a9be 100644
--- a/js/src/jit/MIR.h
+++ b/js/src/jit/MIR.h
@@ -30,6 +30,7 @@
#include "vm/EnvironmentObject.h"
#include "vm/SharedMem.h"
#include "vm/TypedArrayCommon.h"
+#include "vm/UnboxedObject.h"
// Undo windows.h damage on Win64
#undef MemoryBarrier
@@ -375,7 +376,8 @@ class AliasSet {
Element = 1 << 1, // A Value member of obj->elements or
// a typed object.
UnboxedElement = 1 << 2, // An unboxed scalar or reference member of
- // typed object.
+ // a typed array, typed object, or unboxed
+ // object.
DynamicSlot = 1 << 3, // A Value member of obj->slots.
FixedSlot = 1 << 4, // A Value member of obj->fixedSlots().
DOMProperty = 1 << 5, // A DOM property
@@ -432,6 +434,9 @@ class AliasSet {
MOZ_ASSERT(flags && !(flags & Store_));
return AliasSet(flags | Store_);
}
+ static uint32_t BoxedOrUnboxedElements(JSValueType type) {
+ return (type == JSVAL_TYPE_MAGIC) ? Element : UnboxedElement;
+ }
};
typedef Vector<MDefinition*, 6, JitAllocPolicy> MDefinitionVector;
@@ -3758,9 +3763,14 @@ class MObjectState
{
private:
uint32_t numSlots_;
- uint32_t numFixedSlots_;
+ uint32_t numFixedSlots_; // valid if isUnboxed() == false.
+ OperandIndexMap* operandIndex_; // valid if isUnboxed() == true.
+
+ bool isUnboxed() const {
+ return operandIndex_ != nullptr;
+ }
- MObjectState(JSObject *templateObject);
+ MObjectState(JSObject *templateObject, OperandIndexMap* operandIndex);
explicit MObjectState(MObjectState* state);
MOZ_MUST_USE bool init(TempAllocator& alloc, MDefinition* obj);
@@ -3820,6 +3830,18 @@ class MObjectState
setSlot(slot + numFixedSlots(), def);
}
+ // Interface reserved for unboxed objects.
+ bool hasOffset(uint32_t offset) const {
+ MOZ_ASSERT(isUnboxed());
+ return offset < operandIndex_->map.length() && operandIndex_->map[offset] != 0;
+ }
+ MDefinition* getOffset(uint32_t offset) const {
+ return getOperand(operandIndex_->map[offset]);
+ }
+ void setOffset(uint32_t offset, MDefinition* def) {
+ replaceOperand(operandIndex_->map[offset], def);
+ }
+
MOZ_MUST_USE bool writeRecoverData(CompactBufferWriter& writer) const override;
bool canRecoverOnBailout() const override {
return true;
@@ -8080,11 +8102,9 @@ class MDefFun
class MRegExp : public MNullaryInstruction
{
CompilerGCPointer<RegExpObject*> source_;
- bool mustClone_;
MRegExp(CompilerConstraintList* constraints, RegExpObject* source)
- : source_(source),
- mustClone_(true)
+ : source_(source)
{
setResultType(MIRType::Object);
setResultTypeSet(MakeSingletonTypeSet(constraints, source));
@@ -8094,12 +8114,6 @@ class MRegExp : public MNullaryInstruction
INSTRUCTION_HEADER(RegExp)
TRIVIAL_NEW_WRAPPERS
- void setDoNotClone() {
- mustClone_ = false;
- }
- bool mustClone() const {
- return mustClone_;
- }
RegExpObject* source() const {
return source_;
}
@@ -8741,6 +8755,102 @@ class MSetInitializedLength
ALLOW_CLONE(MSetInitializedLength)
};
+// Load the length from an unboxed array.
+class MUnboxedArrayLength
+ : public MUnaryInstruction,
+ public SingleObjectPolicy::Data
+{
+ explicit MUnboxedArrayLength(MDefinition* object)
+ : MUnaryInstruction(object)
+ {
+ setResultType(MIRType::Int32);
+ setMovable();
+ }
+
+ public:
+ INSTRUCTION_HEADER(UnboxedArrayLength)
+ TRIVIAL_NEW_WRAPPERS
+ NAMED_OPERANDS((0, object))
+
+ bool congruentTo(const MDefinition* ins) const override {
+ return congruentIfOperandsEqual(ins);
+ }
+ AliasSet getAliasSet() const override {
+ return AliasSet::Load(AliasSet::ObjectFields);
+ }
+
+ ALLOW_CLONE(MUnboxedArrayLength)
+};
+
+// Load the initialized length from an unboxed array.
+class MUnboxedArrayInitializedLength
+ : public MUnaryInstruction,
+ public SingleObjectPolicy::Data
+{
+ explicit MUnboxedArrayInitializedLength(MDefinition* object)
+ : MUnaryInstruction(object)
+ {
+ setResultType(MIRType::Int32);
+ setMovable();
+ }
+
+ public:
+ INSTRUCTION_HEADER(UnboxedArrayInitializedLength)
+ TRIVIAL_NEW_WRAPPERS
+ NAMED_OPERANDS((0, object))
+
+ bool congruentTo(const MDefinition* ins) const override {
+ return congruentIfOperandsEqual(ins);
+ }
+ AliasSet getAliasSet() const override {
+ return AliasSet::Load(AliasSet::ObjectFields);
+ }
+
+ ALLOW_CLONE(MUnboxedArrayInitializedLength)
+};
+
+// Increment the initialized length of an unboxed array object.
+class MIncrementUnboxedArrayInitializedLength
+ : public MUnaryInstruction,
+ public SingleObjectPolicy::Data
+{
+ explicit MIncrementUnboxedArrayInitializedLength(MDefinition* obj)
+ : MUnaryInstruction(obj)
+ {}
+
+ public:
+ INSTRUCTION_HEADER(IncrementUnboxedArrayInitializedLength)
+ TRIVIAL_NEW_WRAPPERS
+ NAMED_OPERANDS((0, object))
+
+ AliasSet getAliasSet() const override {
+ return AliasSet::Store(AliasSet::ObjectFields);
+ }
+
+ ALLOW_CLONE(MIncrementUnboxedArrayInitializedLength)
+};
+
+// Set the initialized length of an unboxed array object.
+class MSetUnboxedArrayInitializedLength
+ : public MBinaryInstruction,
+ public SingleObjectPolicy::Data
+{
+ explicit MSetUnboxedArrayInitializedLength(MDefinition* obj, MDefinition* length)
+ : MBinaryInstruction(obj, length)
+ {}
+
+ public:
+ INSTRUCTION_HEADER(SetUnboxedArrayInitializedLength)
+ TRIVIAL_NEW_WRAPPERS
+ NAMED_OPERANDS((0, object), (1, length))
+
+ AliasSet getAliasSet() const override {
+ return AliasSet::Store(AliasSet::ObjectFields);
+ }
+
+ ALLOW_CLONE(MSetUnboxedArrayInitializedLength)
+};
+
// Load the array length from an elements header.
class MArrayLength
: public MUnaryInstruction,
@@ -9234,19 +9344,23 @@ class MLoadElement
ALLOW_CLONE(MLoadElement)
};
-// Load a value from the elements vector of a native object.
+// Load a value from the elements vector for a dense native or unboxed array.
// If the index is out-of-bounds, or the indexed slot has a hole, undefined is
// returned instead.
class MLoadElementHole
: public MTernaryInstruction,
public SingleObjectPolicy::Data
{
+ // Unboxed element type, JSVAL_TYPE_MAGIC for dense native elements.
+ JSValueType unboxedType_;
+
bool needsNegativeIntCheck_;
bool needsHoleCheck_;
MLoadElementHole(MDefinition* elements, MDefinition* index, MDefinition* initLength,
- bool needsHoleCheck)
+ JSValueType unboxedType, bool needsHoleCheck)
: MTernaryInstruction(elements, index, initLength),
+ unboxedType_(unboxedType),
needsNegativeIntCheck_(true),
needsHoleCheck_(needsHoleCheck)
{
@@ -9268,6 +9382,9 @@ class MLoadElementHole
TRIVIAL_NEW_WRAPPERS
NAMED_OPERANDS((0, elements), (1, index), (2, initLength))
+ JSValueType unboxedType() const {
+ return unboxedType_;
+ }
bool needsNegativeIntCheck() const {
return needsNegativeIntCheck_;
}
@@ -9278,6 +9395,8 @@ class MLoadElementHole
if (!ins->isLoadElementHole())
return false;
const MLoadElementHole* other = ins->toLoadElementHole();
+ if (unboxedType() != other->unboxedType())
+ return false;
if (needsHoleCheck() != other->needsHoleCheck())
return false;
if (needsNegativeIntCheck() != other->needsNegativeIntCheck())
@@ -9285,7 +9404,7 @@ class MLoadElementHole
return congruentIfOperandsEqual(other);
}
AliasSet getAliasSet() const override {
- return AliasSet::Load(AliasSet::Element);
+ return AliasSet::Load(AliasSet::BoxedOrUnboxedElements(unboxedType()));
}
void collectRangeInfoPreTrunc() override;
@@ -9465,17 +9584,20 @@ class MStoreElement
ALLOW_CLONE(MStoreElement)
};
-// Like MStoreElement, but supports indexes >= initialized length. The downside
-// is that we cannot hoist the elements vector and bounds check, since this
-// instruction may update the (initialized) length and reallocate the elements
-// vector.
+// Like MStoreElement, but supports indexes >= initialized length, and can
+// handle unboxed arrays. The downside is that we cannot hoist the elements
+// vector and bounds check, since this instruction may update the (initialized)
+// length and reallocate the elements vector.
class MStoreElementHole
: public MAryInstruction<4>,
public MStoreElementCommon,
public MixPolicy<SingleObjectPolicy, NoFloatPolicy<3> >::Data
{
+ JSValueType unboxedType_;
+
MStoreElementHole(MDefinition* object, MDefinition* elements,
- MDefinition* index, MDefinition* value)
+ MDefinition* index, MDefinition* value, JSValueType unboxedType)
+ : unboxedType_(unboxedType)
{
initOperand(0, object);
initOperand(1, elements);
@@ -9490,6 +9612,10 @@ class MStoreElementHole
TRIVIAL_NEW_WRAPPERS
NAMED_OPERANDS((0, object), (1, elements), (2, index), (3, value))
+ JSValueType unboxedType() const {
+ return unboxedType_;
+ }
+
ALLOW_CLONE(MStoreElementHole)
};
@@ -9500,11 +9626,13 @@ class MFallibleStoreElement
public MStoreElementCommon,
public MixPolicy<SingleObjectPolicy, NoFloatPolicy<3> >::Data
{
+ JSValueType unboxedType_;
bool strict_;
MFallibleStoreElement(MDefinition* object, MDefinition* elements,
MDefinition* index, MDefinition* value,
- bool strict)
+ JSValueType unboxedType, bool strict)
+ : unboxedType_(unboxedType)
{
initOperand(0, object);
initOperand(1, elements);
@@ -9520,6 +9648,10 @@ class MFallibleStoreElement
TRIVIAL_NEW_WRAPPERS
NAMED_OPERANDS((0, object), (1, elements), (2, index), (3, value))
+ JSValueType unboxedType() const {
+ return unboxedType_;
+ }
+
bool strict() const {
return strict_;
}
@@ -9610,6 +9742,59 @@ class MStoreUnboxedString
ALLOW_CLONE(MStoreUnboxedString)
};
+// Passes through an object, after ensuring it is converted from an unboxed
+// object to a native representation.
+class MConvertUnboxedObjectToNative
+ : public MUnaryInstruction,
+ public SingleObjectPolicy::Data
+{
+ CompilerObjectGroup group_;
+
+ explicit MConvertUnboxedObjectToNative(MDefinition* obj, ObjectGroup* group)
+ : MUnaryInstruction(obj),
+ group_(group)
+ {
+ setGuard();
+ setMovable();
+ setResultType(MIRType::Object);
+ }
+
+ public:
+ INSTRUCTION_HEADER(ConvertUnboxedObjectToNative)
+ NAMED_OPERANDS((0, object))
+
+ static MConvertUnboxedObjectToNative* New(TempAllocator& alloc, MDefinition* obj,
+ ObjectGroup* group);
+
+ ObjectGroup* group() const {
+ return group_;
+ }
+ bool congruentTo(const MDefinition* ins) const override {
+ if (!congruentIfOperandsEqual(ins))
+ return false;
+ return ins->toConvertUnboxedObjectToNative()->group() == group();
+ }
+ AliasSet getAliasSet() const override {
+ // This instruction can read and write to all parts of the object, but
+ // is marked as non-effectful so it can be consolidated by LICM and GVN
+ // and avoid inhibiting other optimizations.
+ //
+ // This is valid to do because when unboxed objects might have a native
+ // group they can be converted to, we do not optimize accesses to the
+ // unboxed objects and do not guard on their group or shape (other than
+ // in this opcode).
+ //
+ // Later accesses can assume the object has a native representation
+ // and optimize accordingly. Those accesses cannot be reordered before
+ // this instruction, however. This is prevented by chaining this
+ // instruction with the object itself, in the same way as MBoundsCheck.
+ return AliasSet::None();
+ }
+ bool appendRoots(MRootList& roots) const override {
+ return roots.append(group_);
+ }
+};
+
// Array.prototype.pop or Array.prototype.shift on a dense array.
class MArrayPopShift
: public MUnaryInstruction,
@@ -9623,12 +9808,13 @@ class MArrayPopShift
private:
Mode mode_;
+ JSValueType unboxedType_;
bool needsHoleCheck_;
bool maybeUndefined_;
- MArrayPopShift(MDefinition* object, Mode mode,
+ MArrayPopShift(MDefinition* object, Mode mode, JSValueType unboxedType,
bool needsHoleCheck, bool maybeUndefined)
- : MUnaryInstruction(object), mode_(mode),
+ : MUnaryInstruction(object), mode_(mode), unboxedType_(unboxedType),
needsHoleCheck_(needsHoleCheck), maybeUndefined_(maybeUndefined)
{ }
@@ -9646,8 +9832,12 @@ class MArrayPopShift
bool mode() const {
return mode_;
}
+ JSValueType unboxedType() const {
+ return unboxedType_;
+ }
AliasSet getAliasSet() const override {
- return AliasSet::Store(AliasSet::ObjectFields | AliasSet::Element);
+ return AliasSet::Store(AliasSet::ObjectFields |
+ AliasSet::BoxedOrUnboxedElements(unboxedType()));
}
ALLOW_CLONE(MArrayPopShift)
@@ -9658,8 +9848,10 @@ class MArrayPush
: public MBinaryInstruction,
public MixPolicy<SingleObjectPolicy, NoFloatPolicy<1> >::Data
{
- MArrayPush(MDefinition* object, MDefinition* value)
- : MBinaryInstruction(object, value)
+ JSValueType unboxedType_;
+
+ MArrayPush(MDefinition* object, MDefinition* value, JSValueType unboxedType)
+ : MBinaryInstruction(object, value), unboxedType_(unboxedType)
{
setResultType(MIRType::Int32);
}
@@ -9669,8 +9861,12 @@ class MArrayPush
TRIVIAL_NEW_WRAPPERS
NAMED_OPERANDS((0, object), (1, value))
+ JSValueType unboxedType() const {
+ return unboxedType_;
+ }
AliasSet getAliasSet() const override {
- return AliasSet::Store(AliasSet::ObjectFields | AliasSet::Element);
+ return AliasSet::Store(AliasSet::ObjectFields |
+ AliasSet::BoxedOrUnboxedElements(unboxedType()));
}
void computeRange(TempAllocator& alloc) override;
@@ -9684,13 +9880,15 @@ class MArraySlice
{
CompilerObject templateObj_;
gc::InitialHeap initialHeap_;
+ JSValueType unboxedType_;
MArraySlice(CompilerConstraintList* constraints, MDefinition* obj,
MDefinition* begin, MDefinition* end,
- JSObject* templateObj, gc::InitialHeap initialHeap)
+ JSObject* templateObj, gc::InitialHeap initialHeap, JSValueType unboxedType)
: MTernaryInstruction(obj, begin, end),
templateObj_(templateObj),
- initialHeap_(initialHeap)
+ initialHeap_(initialHeap),
+ unboxedType_(unboxedType)
{
setResultType(MIRType::Object);
}
@@ -9708,6 +9906,10 @@ class MArraySlice
return initialHeap_;
}
+ JSValueType unboxedType() const {
+ return unboxedType_;
+ }
+
bool possiblyCalls() const override {
return true;
}
@@ -10972,6 +11174,11 @@ class MGuardShape
setMovable();
setResultType(MIRType::Object);
setResultTypeSet(obj->resultTypeSet());
+
+ // Disallow guarding on unboxed object shapes. The group is better to
+ // guard on, and guarding on the shape can interact badly with
+ // MConvertUnboxedObjectToNative.
+ MOZ_ASSERT(shape->getObjectClass() != &UnboxedPlainObject::class_);
}
public:
@@ -11066,6 +11273,11 @@ class MGuardObjectGroup
setGuard();
setMovable();
setResultType(MIRType::Object);
+
+ // Unboxed groups which might be converted to natives can't be guarded
+ // on, due to MConvertUnboxedObjectToNative.
+ MOZ_ASSERT_IF(group->maybeUnboxedLayoutDontCheckGeneration(),
+ !group->unboxedLayoutDontCheckGeneration().nativeGroup());
}
public:
@@ -11174,6 +11386,73 @@ class MGuardClass
ALLOW_CLONE(MGuardClass)
};
+// Guard on the presence or absence of an unboxed object's expando.
+class MGuardUnboxedExpando
+ : public MUnaryInstruction,
+ public SingleObjectPolicy::Data
+{
+ bool requireExpando_;
+ BailoutKind bailoutKind_;
+
+ MGuardUnboxedExpando(MDefinition* obj, bool requireExpando, BailoutKind bailoutKind)
+ : MUnaryInstruction(obj),
+ requireExpando_(requireExpando),
+ bailoutKind_(bailoutKind)
+ {
+ setGuard();
+ setMovable();
+ setResultType(MIRType::Object);
+ }
+
+ public:
+ INSTRUCTION_HEADER(GuardUnboxedExpando)
+ TRIVIAL_NEW_WRAPPERS
+ NAMED_OPERANDS((0, object))
+
+ bool requireExpando() const {
+ return requireExpando_;
+ }
+ BailoutKind bailoutKind() const {
+ return bailoutKind_;
+ }
+ bool congruentTo(const MDefinition* ins) const override {
+ if (!congruentIfOperandsEqual(ins))
+ return false;
+ if (requireExpando() != ins->toGuardUnboxedExpando()->requireExpando())
+ return false;
+ return true;
+ }
+ AliasSet getAliasSet() const override {
+ return AliasSet::Load(AliasSet::ObjectFields);
+ }
+};
+
+// Load an unboxed plain object's expando.
+class MLoadUnboxedExpando
+ : public MUnaryInstruction,
+ public SingleObjectPolicy::Data
+{
+ private:
+ explicit MLoadUnboxedExpando(MDefinition* object)
+ : MUnaryInstruction(object)
+ {
+ setResultType(MIRType::Object);
+ setMovable();
+ }
+
+ public:
+ INSTRUCTION_HEADER(LoadUnboxedExpando)
+ TRIVIAL_NEW_WRAPPERS
+ NAMED_OPERANDS((0, object))
+
+ bool congruentTo(const MDefinition* ins) const override {
+ return congruentIfOperandsEqual(ins);
+ }
+ AliasSet getAliasSet() const override {
+ return AliasSet::Load(AliasSet::ObjectFields);
+ }
+};
+
// Load from vp[slot] (slots that are not inline in an object).
class MLoadSlot
: public MUnaryInstruction,
@@ -12076,13 +12355,15 @@ class MInArray
{
bool needsHoleCheck_;
bool needsNegativeIntCheck_;
+ JSValueType unboxedType_;
MInArray(MDefinition* elements, MDefinition* index,
MDefinition* initLength, MDefinition* object,
- bool needsHoleCheck)
+ bool needsHoleCheck, JSValueType unboxedType)
: MQuaternaryInstruction(elements, index, initLength, object),
needsHoleCheck_(needsHoleCheck),
- needsNegativeIntCheck_(true)
+ needsNegativeIntCheck_(true),
+ unboxedType_(unboxedType)
{
setResultType(MIRType::Boolean);
setMovable();
@@ -12102,6 +12383,9 @@ class MInArray
bool needsNegativeIntCheck() const {
return needsNegativeIntCheck_;
}
+ JSValueType unboxedType() const {
+ return unboxedType_;
+ }
void collectRangeInfoPreTrunc() override;
AliasSet getAliasSet() const override {
return AliasSet::Load(AliasSet::Element);
@@ -12114,6 +12398,8 @@ class MInArray
return false;
if (needsNegativeIntCheck() != other->needsNegativeIntCheck())
return false;
+ if (unboxedType() != other->unboxedType())
+ return false;
return congruentIfOperandsEqual(other);
}
};
@@ -14014,6 +14300,8 @@ MDefinition::maybeConstantValue()
bool ElementAccessIsDenseNative(CompilerConstraintList* constraints,
MDefinition* obj, MDefinition* id);
+JSValueType UnboxedArrayElementType(CompilerConstraintList* constraints, MDefinition* obj,
+ MDefinition* id);
bool ElementAccessIsTypedArray(CompilerConstraintList* constraints,
MDefinition* obj, MDefinition* id,
Scalar::Type* arrayType);
diff --git a/js/src/jit/MOpcodes.h b/js/src/jit/MOpcodes.h
index 589dde077..2f67f8039 100644
--- a/js/src/jit/MOpcodes.h
+++ b/js/src/jit/MOpcodes.h
@@ -188,6 +188,8 @@ namespace jit {
_(GuardObjectGroup) \
_(GuardObjectIdentity) \
_(GuardClass) \
+ _(GuardUnboxedExpando) \
+ _(LoadUnboxedExpando) \
_(ArrayLength) \
_(SetArrayLength) \
_(GetNextEntryForIterator) \
@@ -199,6 +201,10 @@ namespace jit {
_(SetTypedObjectOffset) \
_(InitializedLength) \
_(SetInitializedLength) \
+ _(UnboxedArrayLength) \
+ _(UnboxedArrayInitializedLength) \
+ _(IncrementUnboxedArrayInitializedLength) \
+ _(SetUnboxedArrayInitializedLength) \
_(Not) \
_(BoundsCheck) \
_(BoundsCheckLower) \
@@ -214,6 +220,7 @@ namespace jit {
_(StoreUnboxedScalar) \
_(StoreUnboxedObjectOrNull) \
_(StoreUnboxedString) \
+ _(ConvertUnboxedObjectToNative) \
_(ArrayPopShift) \
_(ArrayPush) \
_(ArraySlice) \
diff --git a/js/src/jit/MacroAssembler.cpp b/js/src/jit/MacroAssembler.cpp
index a739b9325..f633b9b7b 100644
--- a/js/src/jit/MacroAssembler.cpp
+++ b/js/src/jit/MacroAssembler.cpp
@@ -126,14 +126,20 @@ MacroAssembler::guardTypeSetMightBeIncomplete(TypeSet* types, Register obj, Regi
{
// Type set guards might miss when an object's group changes. In this case
// either its old group's properties will become unknown, or it will change
- // to a native object. Jump to label if this might have happened for the
- // input object.
+ // to a native object with an original unboxed group. Jump to label if this
+ // might have happened for the input object.
if (types->unknownObject()) {
jump(label);
return;
}
+ loadPtr(Address(obj, JSObject::offsetOfGroup()), scratch);
+ load32(Address(scratch, ObjectGroup::offsetOfFlags()), scratch);
+ and32(Imm32(OBJECT_FLAG_ADDENDUM_MASK), scratch);
+ branch32(Assembler::Equal,
+ scratch, Imm32(ObjectGroup::addendumOriginalUnboxedGroupValue()), label);
+
for (size_t i = 0; i < types->getObjectCount(); i++) {
if (JSObject* singleton = types->getSingletonNoBarrier(i)) {
movePtr(ImmGCPtr(singleton), scratch);
@@ -462,6 +468,268 @@ template void MacroAssembler::loadFromTypedArray(Scalar::Type arrayType, const A
template void MacroAssembler::loadFromTypedArray(Scalar::Type arrayType, const BaseIndex& src, const ValueOperand& dest,
bool allowDouble, Register temp, Label* fail);
+template <typename T>
+void
+MacroAssembler::loadUnboxedProperty(T address, JSValueType type, TypedOrValueRegister output)
+{
+ switch (type) {
+ case JSVAL_TYPE_INT32: {
+ // Handle loading an int32 into a double reg.
+ if (output.type() == MIRType::Double) {
+ convertInt32ToDouble(address, output.typedReg().fpu());
+ break;
+ }
+ MOZ_FALLTHROUGH;
+ }
+
+ case JSVAL_TYPE_BOOLEAN:
+ case JSVAL_TYPE_STRING: {
+ Register outReg;
+ if (output.hasValue()) {
+ outReg = output.valueReg().scratchReg();
+ } else {
+ MOZ_ASSERT(output.type() == MIRTypeFromValueType(type));
+ outReg = output.typedReg().gpr();
+ }
+
+ switch (type) {
+ case JSVAL_TYPE_BOOLEAN:
+ load8ZeroExtend(address, outReg);
+ break;
+ case JSVAL_TYPE_INT32:
+ load32(address, outReg);
+ break;
+ case JSVAL_TYPE_STRING:
+ loadPtr(address, outReg);
+ break;
+ default:
+ MOZ_CRASH();
+ }
+
+ if (output.hasValue())
+ tagValue(type, outReg, output.valueReg());
+ break;
+ }
+
+ case JSVAL_TYPE_OBJECT:
+ if (output.hasValue()) {
+ Register scratch = output.valueReg().scratchReg();
+ loadPtr(address, scratch);
+
+ Label notNull, done;
+ branchPtr(Assembler::NotEqual, scratch, ImmWord(0), &notNull);
+
+ moveValue(NullValue(), output.valueReg());
+ jump(&done);
+
+ bind(&notNull);
+ tagValue(JSVAL_TYPE_OBJECT, scratch, output.valueReg());
+
+ bind(&done);
+ } else {
+ // Reading null can't be possible here, as otherwise the result
+ // would be a value (either because null has been read before or
+ // because there is a barrier).
+ Register reg = output.typedReg().gpr();
+ loadPtr(address, reg);
+#ifdef DEBUG
+ Label ok;
+ branchTestPtr(Assembler::NonZero, reg, reg, &ok);
+ assumeUnreachable("Null not possible");
+ bind(&ok);
+#endif
+ }
+ break;
+
+ case JSVAL_TYPE_DOUBLE:
+ // Note: doubles in unboxed objects are not accessed through other
+ // views and do not need canonicalization.
+ if (output.hasValue())
+ loadValue(address, output.valueReg());
+ else
+ loadDouble(address, output.typedReg().fpu());
+ break;
+
+ default:
+ MOZ_CRASH();
+ }
+}
+
+template void
+MacroAssembler::loadUnboxedProperty(Address address, JSValueType type,
+ TypedOrValueRegister output);
+
+template void
+MacroAssembler::loadUnboxedProperty(BaseIndex address, JSValueType type,
+ TypedOrValueRegister output);
+
+static void
+StoreUnboxedFailure(MacroAssembler& masm, Label* failure)
+{
+ // Storing a value to an unboxed property is a fallible operation and
+ // the caller must provide a failure label if a particular unboxed store
+ // might fail. Sometimes, however, a store that cannot succeed (such as
+ // storing a string to an int32 property) will be marked as infallible.
+ // This can only happen if the code involved is unreachable.
+ if (failure)
+ masm.jump(failure);
+ else
+ masm.assumeUnreachable("Incompatible write to unboxed property");
+}
+
+template <typename T>
+void
+MacroAssembler::storeUnboxedProperty(T address, JSValueType type,
+ const ConstantOrRegister& value, Label* failure)
+{
+ switch (type) {
+ case JSVAL_TYPE_BOOLEAN:
+ if (value.constant()) {
+ if (value.value().isBoolean())
+ store8(Imm32(value.value().toBoolean()), address);
+ else
+ StoreUnboxedFailure(*this, failure);
+ } else if (value.reg().hasTyped()) {
+ if (value.reg().type() == MIRType::Boolean)
+ store8(value.reg().typedReg().gpr(), address);
+ else
+ StoreUnboxedFailure(*this, failure);
+ } else {
+ if (failure)
+ branchTestBoolean(Assembler::NotEqual, value.reg().valueReg(), failure);
+ storeUnboxedPayload(value.reg().valueReg(), address, /* width = */ 1);
+ }
+ break;
+
+ case JSVAL_TYPE_INT32:
+ if (value.constant()) {
+ if (value.value().isInt32())
+ store32(Imm32(value.value().toInt32()), address);
+ else
+ StoreUnboxedFailure(*this, failure);
+ } else if (value.reg().hasTyped()) {
+ if (value.reg().type() == MIRType::Int32)
+ store32(value.reg().typedReg().gpr(), address);
+ else
+ StoreUnboxedFailure(*this, failure);
+ } else {
+ if (failure)
+ branchTestInt32(Assembler::NotEqual, value.reg().valueReg(), failure);
+ storeUnboxedPayload(value.reg().valueReg(), address, /* width = */ 4);
+ }
+ break;
+
+ case JSVAL_TYPE_DOUBLE:
+ if (value.constant()) {
+ if (value.value().isNumber()) {
+ loadConstantDouble(value.value().toNumber(), ScratchDoubleReg);
+ storeDouble(ScratchDoubleReg, address);
+ } else {
+ StoreUnboxedFailure(*this, failure);
+ }
+ } else if (value.reg().hasTyped()) {
+ if (value.reg().type() == MIRType::Int32) {
+ convertInt32ToDouble(value.reg().typedReg().gpr(), ScratchDoubleReg);
+ storeDouble(ScratchDoubleReg, address);
+ } else if (value.reg().type() == MIRType::Double) {
+ storeDouble(value.reg().typedReg().fpu(), address);
+ } else {
+ StoreUnboxedFailure(*this, failure);
+ }
+ } else {
+ ValueOperand reg = value.reg().valueReg();
+ Label notInt32, end;
+ branchTestInt32(Assembler::NotEqual, reg, &notInt32);
+ int32ValueToDouble(reg, ScratchDoubleReg);
+ storeDouble(ScratchDoubleReg, address);
+ jump(&end);
+ bind(&notInt32);
+ if (failure)
+ branchTestDouble(Assembler::NotEqual, reg, failure);
+ storeValue(reg, address);
+ bind(&end);
+ }
+ break;
+
+ case JSVAL_TYPE_OBJECT:
+ if (value.constant()) {
+ if (value.value().isObjectOrNull())
+ storePtr(ImmGCPtr(value.value().toObjectOrNull()), address);
+ else
+ StoreUnboxedFailure(*this, failure);
+ } else if (value.reg().hasTyped()) {
+ MOZ_ASSERT(value.reg().type() != MIRType::Null);
+ if (value.reg().type() == MIRType::Object)
+ storePtr(value.reg().typedReg().gpr(), address);
+ else
+ StoreUnboxedFailure(*this, failure);
+ } else {
+ if (failure) {
+ Label ok;
+ branchTestNull(Assembler::Equal, value.reg().valueReg(), &ok);
+ branchTestObject(Assembler::NotEqual, value.reg().valueReg(), failure);
+ bind(&ok);
+ }
+ storeUnboxedPayload(value.reg().valueReg(), address, /* width = */ sizeof(uintptr_t));
+ }
+ break;
+
+ case JSVAL_TYPE_STRING:
+ if (value.constant()) {
+ if (value.value().isString())
+ storePtr(ImmGCPtr(value.value().toString()), address);
+ else
+ StoreUnboxedFailure(*this, failure);
+ } else if (value.reg().hasTyped()) {
+ if (value.reg().type() == MIRType::String)
+ storePtr(value.reg().typedReg().gpr(), address);
+ else
+ StoreUnboxedFailure(*this, failure);
+ } else {
+ if (failure)
+ branchTestString(Assembler::NotEqual, value.reg().valueReg(), failure);
+ storeUnboxedPayload(value.reg().valueReg(), address, /* width = */ sizeof(uintptr_t));
+ }
+ break;
+
+ default:
+ MOZ_CRASH();
+ }
+}
+
+template void
+MacroAssembler::storeUnboxedProperty(Address address, JSValueType type,
+ const ConstantOrRegister& value, Label* failure);
+
+template void
+MacroAssembler::storeUnboxedProperty(BaseIndex address, JSValueType type,
+ const ConstantOrRegister& value, Label* failure);
+
+void
+MacroAssembler::checkUnboxedArrayCapacity(Register obj, const RegisterOrInt32Constant& index,
+ Register temp, Label* failure)
+{
+ Address initLengthAddr(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength());
+ Address lengthAddr(obj, UnboxedArrayObject::offsetOfLength());
+
+ Label capacityIsIndex, done;
+ load32(initLengthAddr, temp);
+ branchTest32(Assembler::NonZero, temp, Imm32(UnboxedArrayObject::CapacityMask), &capacityIsIndex);
+ branch32(Assembler::BelowOrEqual, lengthAddr, index, failure);
+ jump(&done);
+ bind(&capacityIsIndex);
+
+ // Do a partial shift so that we can get an absolute offset from the base
+ // of CapacityArray to use.
+ JS_STATIC_ASSERT(sizeof(UnboxedArrayObject::CapacityArray[0]) == 4);
+ rshiftPtr(Imm32(UnboxedArrayObject::CapacityShift - 2), temp);
+ and32(Imm32(~0x3), temp);
+
+ addPtr(ImmPtr(&UnboxedArrayObject::CapacityArray), temp);
+ branch32(Assembler::BelowOrEqual, Address(temp, 0), index, failure);
+ bind(&done);
+}
+
// Inlined version of gc::CheckAllocatorState that checks the bare essentials
// and bails for anything that cannot be handled with our jit allocators.
void
@@ -1009,6 +1277,20 @@ MacroAssembler::initGCThing(Register obj, Register temp, JSObject* templateObj,
nbytes = (nbytes < sizeof(uintptr_t)) ? 0 : nbytes - sizeof(uintptr_t);
offset += sizeof(uintptr_t);
}
+ } else if (templateObj->is<UnboxedPlainObject>()) {
+ storePtr(ImmWord(0), Address(obj, UnboxedPlainObject::offsetOfExpando()));
+ if (initContents)
+ initUnboxedObjectContents(obj, &templateObj->as<UnboxedPlainObject>());
+ } else if (templateObj->is<UnboxedArrayObject>()) {
+ MOZ_ASSERT(templateObj->as<UnboxedArrayObject>().hasInlineElements());
+ int elementsOffset = UnboxedArrayObject::offsetOfInlineElements();
+ computeEffectiveAddress(Address(obj, elementsOffset), temp);
+ storePtr(temp, Address(obj, UnboxedArrayObject::offsetOfElements()));
+ store32(Imm32(templateObj->as<UnboxedArrayObject>().length()),
+ Address(obj, UnboxedArrayObject::offsetOfLength()));
+ uint32_t capacityIndex = templateObj->as<UnboxedArrayObject>().capacityIndex();
+ store32(Imm32(capacityIndex << UnboxedArrayObject::CapacityShift),
+ Address(obj, UnboxedArrayObject::offsetOfCapacityIndexAndInitializedLength()));
} else {
MOZ_CRASH("Unknown object");
}
@@ -1030,6 +1312,29 @@ MacroAssembler::initGCThing(Register obj, Register temp, JSObject* templateObj,
}
void
+MacroAssembler::initUnboxedObjectContents(Register object, UnboxedPlainObject* templateObject)
+{
+ const UnboxedLayout& layout = templateObject->layoutDontCheckGeneration();
+
+ // Initialize reference fields of the object, per UnboxedPlainObject::create.
+ if (const int32_t* list = layout.traceList()) {
+ while (*list != -1) {
+ storePtr(ImmGCPtr(GetJitContext()->runtime->names().empty),
+ Address(object, UnboxedPlainObject::offsetOfData() + *list));
+ list++;
+ }
+ list++;
+ while (*list != -1) {
+ storePtr(ImmWord(0),
+ Address(object, UnboxedPlainObject::offsetOfData() + *list));
+ list++;
+ }
+ // Unboxed objects don't have Values to initialize.
+ MOZ_ASSERT(*(list + 1) == -1);
+ }
+}
+
+void
MacroAssembler::compareStrings(JSOp op, Register left, Register right, Register result,
Label* fail)
{
diff --git a/js/src/jit/MacroAssembler.h b/js/src/jit/MacroAssembler.h
index d5cc95839..b6616321c 100644
--- a/js/src/jit/MacroAssembler.h
+++ b/js/src/jit/MacroAssembler.h
@@ -36,6 +36,7 @@
#include "vm/ProxyObject.h"
#include "vm/Shape.h"
#include "vm/TypedArrayObject.h"
+#include "vm/UnboxedObject.h"
using mozilla::FloatingPoint;
@@ -1625,6 +1626,20 @@ class MacroAssembler : public MacroAssemblerSpecific
void storeToTypedFloatArray(Scalar::Type arrayType, FloatRegister value, const Address& dest,
unsigned numElems = 0);
+ // Load a property from an UnboxedPlainObject or UnboxedArrayObject.
+ template <typename T>
+ void loadUnboxedProperty(T address, JSValueType type, TypedOrValueRegister output);
+
+ // Store a property to an UnboxedPlainObject, without triggering barriers.
+ // If failure is null, the value definitely has a type suitable for storing
+ // in the property.
+ template <typename T>
+ void storeUnboxedProperty(T address, JSValueType type,
+ const ConstantOrRegister& value, Label* failure);
+
+ void checkUnboxedArrayCapacity(Register obj, const RegisterOrInt32Constant& index,
+ Register temp, Label* failure);
+
Register extractString(const Address& address, Register scratch) {
return extractObject(address, scratch);
}
@@ -1701,6 +1716,8 @@ class MacroAssembler : public MacroAssemblerSpecific
LiveRegisterSet liveRegs, Label* fail,
TypedArrayObject* templateObj, TypedArrayLength lengthKind);
+ void initUnboxedObjectContents(Register object, UnboxedPlainObject* templateObject);
+
void newGCString(Register result, Register temp, Label* fail);
void newGCFatInlineString(Register result, Register temp, Label* fail);
diff --git a/js/src/jit/OptimizationTracking.cpp b/js/src/jit/OptimizationTracking.cpp
index 7d72795a0..308def041 100644
--- a/js/src/jit/OptimizationTracking.cpp
+++ b/js/src/jit/OptimizationTracking.cpp
@@ -844,6 +844,8 @@ MaybeConstructorFromType(TypeSet::Type ty)
return nullptr;
ObjectGroup* obj = ty.group();
TypeNewScript* newScript = obj->newScript();
+ if (!newScript && obj->maybeUnboxedLayout())
+ newScript = obj->unboxedLayout().newScript();
return newScript ? newScript->function() : nullptr;
}
diff --git a/js/src/jit/Recover.cpp b/js/src/jit/Recover.cpp
index 793b631df..6fd71f377 100644
--- a/js/src/jit/Recover.cpp
+++ b/js/src/jit/Recover.cpp
@@ -30,6 +30,7 @@
#include "vm/Interpreter-inl.h"
#include "vm/NativeObject-inl.h"
+#include "vm/UnboxedObject-inl.h"
using namespace js;
using namespace js::jit;
@@ -1354,7 +1355,7 @@ RNewArray::recover(JSContext* cx, SnapshotIterator& iter) const
RootedValue result(cx);
RootedObjectGroup group(cx, templateObject->group());
- ArrayObject* resultObject = NewFullyAllocatedArrayTryUseGroup(cx, group, count_);
+ JSObject* resultObject = NewFullyAllocatedArrayTryUseGroup(cx, group, count_);
if (!resultObject)
return false;
@@ -1539,12 +1540,37 @@ RObjectState::recover(JSContext* cx, SnapshotIterator& iter) const
RootedObject object(cx, &iter.read().toObject());
RootedValue val(cx);
- RootedNativeObject nativeObject(cx, &object->as<NativeObject>());
- MOZ_ASSERT(nativeObject->slotSpan() == numSlots());
+ if (object->is<UnboxedPlainObject>()) {
+ const UnboxedLayout& layout = object->as<UnboxedPlainObject>().layout();
- for (size_t i = 0; i < numSlots(); i++) {
- val = iter.read();
- nativeObject->setSlot(i, val);
+ RootedId id(cx);
+ RootedValue receiver(cx, ObjectValue(*object));
+ const UnboxedLayout::PropertyVector& properties = layout.properties();
+ for (size_t i = 0; i < properties.length(); i++) {
+ val = iter.read();
+
+ // This is the default placeholder value of MObjectState, when no
+ // properties are defined yet.
+ if (val.isUndefined())
+ continue;
+
+ id = NameToId(properties[i].name);
+ ObjectOpResult result;
+
+ // SetProperty can only fail due to OOM.
+ if (!SetProperty(cx, object, id, val, receiver, result))
+ return false;
+ if (!result)
+ return result.reportError(cx, object, id);
+ }
+ } else {
+ RootedNativeObject nativeObject(cx, &object->as<NativeObject>());
+ MOZ_ASSERT(nativeObject->slotSpan() == numSlots());
+
+ for (size_t i = 0; i < numSlots(); i++) {
+ val = iter.read();
+ nativeObject->setSlot(i, val);
+ }
}
val.setObject(*object);
diff --git a/js/src/jit/ScalarReplacement.cpp b/js/src/jit/ScalarReplacement.cpp
index 97ba52349..4614b2162 100644
--- a/js/src/jit/ScalarReplacement.cpp
+++ b/js/src/jit/ScalarReplacement.cpp
@@ -13,6 +13,7 @@
#include "jit/MIR.h"
#include "jit/MIRGenerator.h"
#include "jit/MIRGraph.h"
+#include "vm/UnboxedObject.h"
#include "jsobjinlines.h"
@@ -182,6 +183,25 @@ IsObjectEscaped(MInstruction* ins, JSObject* objDefault)
JitSpewDef(JitSpew_Escape, "is escaped by\n", def);
return true;
+ case MDefinition::Op_LoadUnboxedScalar:
+ case MDefinition::Op_StoreUnboxedScalar:
+ case MDefinition::Op_LoadUnboxedObjectOrNull:
+ case MDefinition::Op_StoreUnboxedObjectOrNull:
+ case MDefinition::Op_LoadUnboxedString:
+ case MDefinition::Op_StoreUnboxedString:
+ // Not escaped if it is the first argument.
+ if (def->indexOf(*i) != 0) {
+ JitSpewDef(JitSpew_Escape, "is escaped by\n", def);
+ return true;
+ }
+
+ if (!def->getOperand(1)->isConstant()) {
+ JitSpewDef(JitSpew_Escape, "is addressed with unknown index\n", def);
+ return true;
+ }
+
+ break;
+
case MDefinition::Op_PostWriteBarrier:
break;
@@ -285,6 +305,16 @@ class ObjectMemoryView : public MDefinitionVisitorDefaultNoop
void visitGuardShape(MGuardShape* ins);
void visitFunctionEnvironment(MFunctionEnvironment* ins);
void visitLambda(MLambda* ins);
+ void visitStoreUnboxedScalar(MStoreUnboxedScalar* ins);
+ void visitLoadUnboxedScalar(MLoadUnboxedScalar* ins);
+ void visitStoreUnboxedObjectOrNull(MStoreUnboxedObjectOrNull* ins);
+ void visitLoadUnboxedObjectOrNull(MLoadUnboxedObjectOrNull* ins);
+ void visitStoreUnboxedString(MStoreUnboxedString* ins);
+ void visitLoadUnboxedString(MLoadUnboxedString* ins);
+
+ private:
+ void storeOffset(MInstruction* ins, size_t offset, MDefinition* value);
+ void loadOffset(MInstruction* ins, size_t offset);
};
const char* ObjectMemoryView::phaseName = "Scalar Replacement of Object";
@@ -626,6 +656,121 @@ ObjectMemoryView::visitLambda(MLambda* ins)
ins->setIncompleteObject();
}
+static size_t
+GetOffsetOf(MDefinition* index, size_t width, int32_t baseOffset)
+{
+ int32_t idx = index->toConstant()->toInt32();
+ MOZ_ASSERT(idx >= 0);
+ MOZ_ASSERT(baseOffset >= 0 && size_t(baseOffset) >= UnboxedPlainObject::offsetOfData());
+ return idx * width + baseOffset - UnboxedPlainObject::offsetOfData();
+}
+
+static size_t
+GetOffsetOf(MDefinition* index, Scalar::Type type, int32_t baseOffset)
+{
+ return GetOffsetOf(index, Scalar::byteSize(type), baseOffset);
+}
+
+void
+ObjectMemoryView::storeOffset(MInstruction* ins, size_t offset, MDefinition* value)
+{
+ // Clone the state and update the slot value.
+ MOZ_ASSERT(state_->hasOffset(offset));
+ state_ = BlockState::Copy(alloc_, state_);
+ if (!state_) {
+ oom_ = true;
+ return;
+ }
+
+ state_->setOffset(offset, value);
+ ins->block()->insertBefore(ins, state_);
+
+ // Remove original instruction.
+ ins->block()->discard(ins);
+}
+
+void
+ObjectMemoryView::loadOffset(MInstruction* ins, size_t offset)
+{
+ // Replace load by the slot value.
+ MOZ_ASSERT(state_->hasOffset(offset));
+ ins->replaceAllUsesWith(state_->getOffset(offset));
+
+ // Remove original instruction.
+ ins->block()->discard(ins);
+}
+
+void
+ObjectMemoryView::visitStoreUnboxedScalar(MStoreUnboxedScalar* ins)
+{
+ // Skip stores made on other objects.
+ if (ins->elements() != obj_)
+ return;
+
+ size_t offset = GetOffsetOf(ins->index(), ins->storageType(), ins->offsetAdjustment());
+ storeOffset(ins, offset, ins->value());
+}
+
+void
+ObjectMemoryView::visitLoadUnboxedScalar(MLoadUnboxedScalar* ins)
+{
+ // Skip loads made on other objects.
+ if (ins->elements() != obj_)
+ return;
+
+ // Replace load by the slot value.
+ size_t offset = GetOffsetOf(ins->index(), ins->storageType(), ins->offsetAdjustment());
+ loadOffset(ins, offset);
+}
+
+void
+ObjectMemoryView::visitStoreUnboxedObjectOrNull(MStoreUnboxedObjectOrNull* ins)
+{
+ // Skip stores made on other objects.
+ if (ins->elements() != obj_)
+ return;
+
+ // Clone the state and update the slot value.
+ size_t offset = GetOffsetOf(ins->index(), sizeof(uintptr_t), ins->offsetAdjustment());
+ storeOffset(ins, offset, ins->value());
+}
+
+void
+ObjectMemoryView::visitLoadUnboxedObjectOrNull(MLoadUnboxedObjectOrNull* ins)
+{
+ // Skip loads made on other objects.
+ if (ins->elements() != obj_)
+ return;
+
+ // Replace load by the slot value.
+ size_t offset = GetOffsetOf(ins->index(), sizeof(uintptr_t), ins->offsetAdjustment());
+ loadOffset(ins, offset);
+}
+
+void
+ObjectMemoryView::visitStoreUnboxedString(MStoreUnboxedString* ins)
+{
+ // Skip stores made on other objects.
+ if (ins->elements() != obj_)
+ return;
+
+ // Clone the state and update the slot value.
+ size_t offset = GetOffsetOf(ins->index(), sizeof(uintptr_t), ins->offsetAdjustment());
+ storeOffset(ins, offset, ins->value());
+}
+
+void
+ObjectMemoryView::visitLoadUnboxedString(MLoadUnboxedString* ins)
+{
+ // Skip loads made on other objects.
+ if (ins->elements() != obj_)
+ return;
+
+ // Replace load by the slot value.
+ size_t offset = GetOffsetOf(ins->index(), sizeof(uintptr_t), ins->offsetAdjustment());
+ loadOffset(ins, offset);
+}
+
static bool
IndexOf(MDefinition* ins, int32_t* res)
{
@@ -762,6 +907,11 @@ IsArrayEscaped(MInstruction* ins)
return true;
}
+ if (obj->is<UnboxedArrayObject>()) {
+ JitSpew(JitSpew_Escape, "Template object is an unboxed plain object.");
+ return true;
+ }
+
if (length >= 16) {
JitSpew(JitSpew_Escape, "Array has too many elements");
return true;
diff --git a/js/src/jit/SharedIC.cpp b/js/src/jit/SharedIC.cpp
index 05a95824f..767cff661 100644
--- a/js/src/jit/SharedIC.cpp
+++ b/js/src/jit/SharedIC.cpp
@@ -27,7 +27,6 @@
#endif
#include "jit/VMFunctions.h"
#include "vm/Interpreter.h"
-#include "vm/NativeObject-inl.h"
#include "jit/MacroAssembler-inl.h"
#include "vm/Interpreter-inl.h"
@@ -286,6 +285,11 @@ ICStub::trace(JSTracer* trc)
TraceEdge(trc, &getElemStub->shape(), "baseline-getelem-dense-shape");
break;
}
+ case ICStub::GetElem_UnboxedArray: {
+ ICGetElem_UnboxedArray* getElemStub = toGetElem_UnboxedArray();
+ TraceEdge(trc, &getElemStub->group(), "baseline-getelem-unboxed-array-group");
+ break;
+ }
case ICStub::GetElem_TypedArray: {
ICGetElem_TypedArray* getElemStub = toGetElem_TypedArray();
TraceEdge(trc, &getElemStub->shape(), "baseline-getelem-typedarray-shape");
@@ -2244,7 +2248,9 @@ IsCacheableProtoChain(JSObject* obj, JSObject* holder, bool isDOMProxy)
if (!isDOMProxy && !obj->isNative()) {
if (obj == holder)
return false;
- if (!obj->is<TypedObject>())
+ if (!obj->is<UnboxedPlainObject>() &&
+ !obj->is<UnboxedArrayObject>() &&
+ !obj->is<TypedObject>())
{
return false;
}
@@ -2572,6 +2578,12 @@ CheckHasNoSuchProperty(JSContext* cx, JSObject* obj, PropertyName* name,
} else if (curObj != obj) {
// Non-native objects are only handled as the original receiver.
return false;
+ } else if (curObj->is<UnboxedPlainObject>()) {
+ if (curObj->as<UnboxedPlainObject>().containsUnboxedOrExpandoProperty(cx, NameToId(name)))
+ return false;
+ } else if (curObj->is<UnboxedArrayObject>()) {
+ if (name == cx->names().length)
+ return false;
} else if (curObj->is<TypedObject>()) {
if (curObj->as<TypedObject>().typeDescr().hasProperty(cx->names(), NameToId(name)))
return false;
@@ -2836,15 +2848,34 @@ GuardReceiverObject(MacroAssembler& masm, ReceiverGuard guard,
{
Address groupAddress(ICStubReg, receiverGuardOffset + HeapReceiverGuard::offsetOfGroup());
Address shapeAddress(ICStubReg, receiverGuardOffset + HeapReceiverGuard::offsetOfShape());
+ Address expandoAddress(object, UnboxedPlainObject::offsetOfExpando());
if (guard.group) {
masm.loadPtr(groupAddress, scratch);
masm.branchTestObjGroup(Assembler::NotEqual, object, scratch, failure);
+
+ if (guard.group->clasp() == &UnboxedPlainObject::class_ && !guard.shape) {
+ // Guard the unboxed object has no expando object.
+ masm.branchPtr(Assembler::NotEqual, expandoAddress, ImmWord(0), failure);
+ }
}
if (guard.shape) {
masm.loadPtr(shapeAddress, scratch);
- masm.branchTestObjShape(Assembler::NotEqual, object, scratch, failure);
+ if (guard.group && guard.group->clasp() == &UnboxedPlainObject::class_) {
+ // Guard the unboxed object has a matching expando object.
+ masm.branchPtr(Assembler::Equal, expandoAddress, ImmWord(0), failure);
+ Label done;
+ masm.push(object);
+ masm.loadPtr(expandoAddress, object);
+ masm.branchTestObjShape(Assembler::Equal, object, scratch, &done);
+ masm.pop(object);
+ masm.jump(failure);
+ masm.bind(&done);
+ masm.pop(object);
+ } else {
+ masm.branchTestObjShape(Assembler::NotEqual, object, scratch, failure);
+ }
}
}
@@ -4228,7 +4259,8 @@ DoNewObject(JSContext* cx, void* payload, ICNewObject_Fallback* stub, MutableHan
return false;
if (!stub->invalid() &&
- !templateObject->as<PlainObject>().hasDynamicSlots())
+ (templateObject->is<UnboxedPlainObject>() ||
+ !templateObject->as<PlainObject>().hasDynamicSlots()))
{
JitCode* code = GenerateNewObjectWithTemplateCode(cx, templateObject);
if (!code)
diff --git a/js/src/jit/VMFunctions.cpp b/js/src/jit/VMFunctions.cpp
index 652c23bf1..10be2836b 100644
--- a/js/src/jit/VMFunctions.cpp
+++ b/js/src/jit/VMFunctions.cpp
@@ -28,7 +28,7 @@
#include "vm/NativeObject-inl.h"
#include "vm/StringObject-inl.h"
#include "vm/TypeInference-inl.h"
-#include "gc/StoreBuffer-inl.h"
+#include "vm/UnboxedObject-inl.h"
using namespace js;
using namespace js::jit;
@@ -306,7 +306,7 @@ template bool StringsEqual<false>(JSContext* cx, HandleString lhs, HandleString
bool
ArrayPopDense(JSContext* cx, HandleObject obj, MutableHandleValue rval)
{
- MOZ_ASSERT(obj->is<ArrayObject>());
+ MOZ_ASSERT(obj->is<ArrayObject>() || obj->is<UnboxedArrayObject>());
AutoDetectInvalidation adi(cx, rval);
@@ -325,11 +325,12 @@ ArrayPopDense(JSContext* cx, HandleObject obj, MutableHandleValue rval)
}
bool
-ArrayPushDense(JSContext* cx, HandleArrayObject arr, HandleValue v, uint32_t* length)
+ArrayPushDense(JSContext* cx, HandleObject obj, HandleValue v, uint32_t* length)
{
- *length = arr->length();
- DenseElementResult result = arr->setOrExtendDenseElements(cx, *length, v.address(), 1,
- ShouldUpdateTypes::DontUpdate);
+ *length = GetAnyBoxedOrUnboxedArrayLength(obj);
+ DenseElementResult result =
+ SetOrExtendAnyBoxedOrUnboxedDenseElements(cx, obj, *length, v.address(), 1,
+ ShouldUpdateTypes::DontUpdate);
if (result != DenseElementResult::Incomplete) {
(*length)++;
return result == DenseElementResult::Success;
@@ -337,7 +338,7 @@ ArrayPushDense(JSContext* cx, HandleArrayObject arr, HandleValue v, uint32_t* le
JS::AutoValueArray<3> argv(cx);
argv[0].setUndefined();
- argv[1].setObject(*arr);
+ argv[1].setObject(*obj);
argv[2].set(v);
if (!js::array_push(cx, 1, argv.begin()))
return false;
@@ -349,7 +350,7 @@ ArrayPushDense(JSContext* cx, HandleArrayObject arr, HandleValue v, uint32_t* le
bool
ArrayShiftDense(JSContext* cx, HandleObject obj, MutableHandleValue rval)
{
- MOZ_ASSERT(obj->is<ArrayObject>());
+ MOZ_ASSERT(obj->is<ArrayObject>() || obj->is<UnboxedArrayObject>());
AutoDetectInvalidation adi(cx, rval);
@@ -1130,14 +1131,16 @@ Recompile(JSContext* cx)
}
bool
-SetDenseElement(JSContext* cx, HandleNativeObject obj, int32_t index, HandleValue value, bool strict)
+SetDenseOrUnboxedArrayElement(JSContext* cx, HandleObject obj, int32_t index,
+ HandleValue value, bool strict)
{
// This function is called from Ion code for StoreElementHole's OOL path.
- // In this case we know the object is native and that no type changes are
- // needed.
+ // In this case we know the object is native or an unboxed array and that
+ // no type changes are needed.
- DenseElementResult result = obj->setOrExtendDenseElements(cx, index, value.address(), 1,
- ShouldUpdateTypes::DontUpdate);
+ DenseElementResult result =
+ SetOrExtendAnyBoxedOrUnboxedDenseElements(cx, obj, index, value.address(), 1,
+ ShouldUpdateTypes::DontUpdate);
if (result != DenseElementResult::Incomplete)
return result == DenseElementResult::Success;
diff --git a/js/src/jit/VMFunctions.h b/js/src/jit/VMFunctions.h
index 94f741397..7f225c293 100644
--- a/js/src/jit/VMFunctions.h
+++ b/js/src/jit/VMFunctions.h
@@ -622,7 +622,7 @@ template<bool Equal>
bool StringsEqual(JSContext* cx, HandleString left, HandleString right, bool* res);
MOZ_MUST_USE bool ArrayPopDense(JSContext* cx, HandleObject obj, MutableHandleValue rval);
-MOZ_MUST_USE bool ArrayPushDense(JSContext* cx, HandleArrayObject obj, HandleValue v, uint32_t* length);
+MOZ_MUST_USE bool ArrayPushDense(JSContext* cx, HandleObject obj, HandleValue v, uint32_t* length);
MOZ_MUST_USE bool ArrayShiftDense(JSContext* cx, HandleObject obj, MutableHandleValue rval);
JSString* ArrayJoin(JSContext* cx, HandleObject array, HandleString sep);
@@ -745,8 +745,8 @@ ForcedRecompile(JSContext* cx);
JSString* StringReplace(JSContext* cx, HandleString string, HandleString pattern,
HandleString repl);
-MOZ_MUST_USE bool SetDenseElement(JSContext* cx, HandleNativeObject obj, int32_t index,
- HandleValue value, bool strict);
+MOZ_MUST_USE bool SetDenseOrUnboxedArrayElement(JSContext* cx, HandleObject obj, int32_t index,
+ HandleValue value, bool strict);
void AssertValidObjectPtr(JSContext* cx, JSObject* obj);
void AssertValidObjectOrNullPtr(JSContext* cx, JSObject* obj);
diff --git a/js/src/jit/shared/LIR-shared.h b/js/src/jit/shared/LIR-shared.h
index ff4915d1a..e6aab6ba3 100644
--- a/js/src/jit/shared/LIR-shared.h
+++ b/js/src/jit/shared/LIR-shared.h
@@ -5166,6 +5166,72 @@ class LSetInitializedLength : public LInstructionHelper<0, 2, 0>
}
};
+class LUnboxedArrayLength : public LInstructionHelper<1, 1, 0>
+{
+ public:
+ LIR_HEADER(UnboxedArrayLength)
+
+ explicit LUnboxedArrayLength(const LAllocation& object) {
+ setOperand(0, object);
+ }
+
+ const LAllocation* object() {
+ return getOperand(0);
+ }
+};
+
+class LUnboxedArrayInitializedLength : public LInstructionHelper<1, 1, 0>
+{
+ public:
+ LIR_HEADER(UnboxedArrayInitializedLength)
+
+ explicit LUnboxedArrayInitializedLength(const LAllocation& object) {
+ setOperand(0, object);
+ }
+
+ const LAllocation* object() {
+ return getOperand(0);
+ }
+};
+
+class LIncrementUnboxedArrayInitializedLength : public LInstructionHelper<0, 1, 0>
+{
+ public:
+ LIR_HEADER(IncrementUnboxedArrayInitializedLength)
+
+ explicit LIncrementUnboxedArrayInitializedLength(const LAllocation& object) {
+ setOperand(0, object);
+ }
+
+ const LAllocation* object() {
+ return getOperand(0);
+ }
+};
+
+class LSetUnboxedArrayInitializedLength : public LInstructionHelper<0, 2, 1>
+{
+ public:
+ LIR_HEADER(SetUnboxedArrayInitializedLength)
+
+ explicit LSetUnboxedArrayInitializedLength(const LAllocation& object,
+ const LAllocation& length,
+ const LDefinition& temp) {
+ setOperand(0, object);
+ setOperand(1, length);
+ setTemp(0, temp);
+ }
+
+ const LAllocation* object() {
+ return getOperand(0);
+ }
+ const LAllocation* length() {
+ return getOperand(1);
+ }
+ const LDefinition* temp() {
+ return getTemp(0);
+ }
+};
+
// Load the length from an elements header.
class LArrayLength : public LInstructionHelper<1, 1, 0>
{
@@ -5670,17 +5736,19 @@ class LStoreElementT : public LInstructionHelper<0, 3, 0>
};
// Like LStoreElementV, but supports indexes >= initialized length.
-class LStoreElementHoleV : public LInstructionHelper<0, 3 + BOX_PIECES, 0>
+class LStoreElementHoleV : public LInstructionHelper<0, 3 + BOX_PIECES, 1>
{
public:
LIR_HEADER(StoreElementHoleV)
LStoreElementHoleV(const LAllocation& object, const LAllocation& elements,
- const LAllocation& index, const LBoxAllocation& value) {
+ const LAllocation& index, const LBoxAllocation& value,
+ const LDefinition& temp) {
setOperand(0, object);
setOperand(1, elements);
setOperand(2, index);
setBoxOperand(Value, value);
+ setTemp(0, temp);
}
static const size_t Value = 3;
@@ -5700,17 +5768,19 @@ class LStoreElementHoleV : public LInstructionHelper<0, 3 + BOX_PIECES, 0>
};
// Like LStoreElementT, but supports indexes >= initialized length.
-class LStoreElementHoleT : public LInstructionHelper<0, 4, 0>
+class LStoreElementHoleT : public LInstructionHelper<0, 4, 1>
{
public:
LIR_HEADER(StoreElementHoleT)
LStoreElementHoleT(const LAllocation& object, const LAllocation& elements,
- const LAllocation& index, const LAllocation& value) {
+ const LAllocation& index, const LAllocation& value,
+ const LDefinition& temp) {
setOperand(0, object);
setOperand(1, elements);
setOperand(2, index);
setOperand(3, value);
+ setTemp(0, temp);
}
const MStoreElementHole* mir() const {
@@ -5731,17 +5801,19 @@ class LStoreElementHoleT : public LInstructionHelper<0, 4, 0>
};
// Like LStoreElementV, but can just ignore assignment (for eg. frozen objects)
-class LFallibleStoreElementV : public LInstructionHelper<0, 3 + BOX_PIECES, 0>
+class LFallibleStoreElementV : public LInstructionHelper<0, 3 + BOX_PIECES, 1>
{
public:
LIR_HEADER(FallibleStoreElementV)
LFallibleStoreElementV(const LAllocation& object, const LAllocation& elements,
- const LAllocation& index, const LBoxAllocation& value) {
+ const LAllocation& index, const LBoxAllocation& value,
+ const LDefinition& temp) {
setOperand(0, object);
setOperand(1, elements);
setOperand(2, index);
setBoxOperand(Value, value);
+ setTemp(0, temp);
}
static const size_t Value = 3;
@@ -5761,17 +5833,19 @@ class LFallibleStoreElementV : public LInstructionHelper<0, 3 + BOX_PIECES, 0>
};
// Like LStoreElementT, but can just ignore assignment (for eg. frozen objects)
-class LFallibleStoreElementT : public LInstructionHelper<0, 4, 0>
+class LFallibleStoreElementT : public LInstructionHelper<0, 4, 1>
{
public:
LIR_HEADER(FallibleStoreElementT)
LFallibleStoreElementT(const LAllocation& object, const LAllocation& elements,
- const LAllocation& index, const LAllocation& value) {
+ const LAllocation& index, const LAllocation& value,
+ const LDefinition& temp) {
setOperand(0, object);
setOperand(1, elements);
setOperand(2, index);
setOperand(3, value);
+ setTemp(0, temp);
}
const MFallibleStoreElement* mir() const {
@@ -5818,6 +5892,22 @@ class LStoreUnboxedPointer : public LInstructionHelper<0, 3, 0>
}
};
+// If necessary, convert an unboxed object in a particular group to its native
+// representation.
+class LConvertUnboxedObjectToNative : public LInstructionHelper<0, 1, 0>
+{
+ public:
+ LIR_HEADER(ConvertUnboxedObjectToNative)
+
+ explicit LConvertUnboxedObjectToNative(const LAllocation& object) {
+ setOperand(0, object);
+ }
+
+ MConvertUnboxedObjectToNative* mir() {
+ return mir_->toConvertUnboxedObjectToNative();
+ }
+};
+
class LArrayPopShiftV : public LInstructionHelper<BOX_PIECES, 1, 2>
{
public:
@@ -7340,6 +7430,38 @@ class LGuardReceiverPolymorphic : public LInstructionHelper<0, 1, 1>
}
};
+class LGuardUnboxedExpando : public LInstructionHelper<0, 1, 0>
+{
+ public:
+ LIR_HEADER(GuardUnboxedExpando)
+
+ explicit LGuardUnboxedExpando(const LAllocation& in) {
+ setOperand(0, in);
+ }
+ const LAllocation* object() {
+ return getOperand(0);
+ }
+ const MGuardUnboxedExpando* mir() const {
+ return mir_->toGuardUnboxedExpando();
+ }
+};
+
+class LLoadUnboxedExpando : public LInstructionHelper<1, 1, 0>
+{
+ public:
+ LIR_HEADER(LoadUnboxedExpando)
+
+ explicit LLoadUnboxedExpando(const LAllocation& in) {
+ setOperand(0, in);
+ }
+ const LAllocation* object() {
+ return getOperand(0);
+ }
+ const MLoadUnboxedExpando* mir() const {
+ return mir_->toLoadUnboxedExpando();
+ }
+};
+
// Guard that a value is in a TypeSet.
class LTypeBarrierV : public LInstructionHelper<0, BOX_PIECES, 1>
{
diff --git a/js/src/jit/shared/LOpcodes-shared.h b/js/src/jit/shared/LOpcodes-shared.h
index 56b98940a..ea185e1b8 100644
--- a/js/src/jit/shared/LOpcodes-shared.h
+++ b/js/src/jit/shared/LOpcodes-shared.h
@@ -257,6 +257,8 @@
_(GuardObjectGroup) \
_(GuardObjectIdentity) \
_(GuardClass) \
+ _(GuardUnboxedExpando) \
+ _(LoadUnboxedExpando) \
_(TypeBarrierV) \
_(TypeBarrierO) \
_(MonitorTypes) \
@@ -266,6 +268,10 @@
_(PostWriteElementBarrierV) \
_(InitializedLength) \
_(SetInitializedLength) \
+ _(UnboxedArrayLength) \
+ _(UnboxedArrayInitializedLength) \
+ _(IncrementUnboxedArrayInitializedLength) \
+ _(SetUnboxedArrayInitializedLength) \
_(BoundsCheck) \
_(BoundsCheckRange) \
_(BoundsCheckLower) \
@@ -280,6 +286,7 @@
_(StoreElementT) \
_(StoreUnboxedScalar) \
_(StoreUnboxedPointer) \
+ _(ConvertUnboxedObjectToNative) \
_(ArrayPopShiftV) \
_(ArrayPopShiftT) \
_(ArrayPushV) \
diff --git a/js/src/jsapi-tests/testGCAllocator.cpp b/js/src/jsapi-tests/testGCAllocator.cpp
index d203019ec..c7f430cb0 100644
--- a/js/src/jsapi-tests/testGCAllocator.cpp
+++ b/js/src/jsapi-tests/testGCAllocator.cpp
@@ -302,7 +302,8 @@ void unmapPages(void* p, size_t size) { }
void*
mapMemoryAt(void* desired, size_t length)
{
-#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__)) || defined(__aarch64__)
+#if defined(__ia64__) || defined(__aarch64__) || \
+ (defined(__sparc__) && defined(__arch64__) && (defined(__NetBSD__) || defined(__linux__)))
MOZ_RELEASE_ASSERT(0xffff800000000000ULL & (uintptr_t(desired) + length - 1) == 0);
#endif
void* region = mmap(desired, length, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
@@ -324,7 +325,7 @@ mapMemory(size_t length)
int fd = -1;
off_t offset = 0;
// The test code must be aligned with the implementation in gc/Memory.cpp.
-#if defined(__ia64__) || (defined(__sparc64__) && defined(__NetBSD__))
+#if defined(__ia64__) || (defined(__sparc__) && defined(__arch64__) && defined(__NetBSD__))
void* region = mmap((void*)0x0000070000000000, length, prot, flags, fd, offset);
if (region == MAP_FAILED)
return nullptr;
@@ -334,7 +335,7 @@ mapMemory(size_t length)
return nullptr;
}
return region;
-#elif defined(__aarch64__)
+#elif defined(__aarch64__) || (defined(__sparc__) && defined(__arch64__) && defined(__linux__))
const uintptr_t start = UINT64_C(0x0000070000000000);
const uintptr_t end = UINT64_C(0x0000800000000000);
const uintptr_t step = js::gc::ChunkSize;
diff --git a/js/src/jsapi.cpp b/js/src/jsapi.cpp
index 6483641f3..cb3945152 100644
--- a/js/src/jsapi.cpp
+++ b/js/src/jsapi.cpp
@@ -6588,6 +6588,9 @@ JS_SetGlobalJitCompilerOption(JSContext* cx, JSJitCompilerOption opt, uint32_t v
}
jit::JitOptions.jumpThreshold = value;
break;
+ case JSJITCOMPILER_UNBOXED_OBJECTS:
+ jit::JitOptions.disableUnboxedObjects = !value;
+ break;
case JSJITCOMPILER_ASMJS_ATOMICS_ENABLE:
jit::JitOptions.asmJSAtomicsEnable = !!value;
break;
diff --git a/js/src/jsapi.h b/js/src/jsapi.h
index 7795c5e4c..9138a4a92 100644
--- a/js/src/jsapi.h
+++ b/js/src/jsapi.h
@@ -1096,6 +1096,7 @@ class JS_PUBLIC_API(ContextOptions) {
wasmAlwaysBaseline_(false),
throwOnAsmJSValidationFailure_(false),
nativeRegExp_(true),
+ unboxedArrays_(false),
asyncStack_(true),
throwOnDebuggeeWouldRun_(true),
dumpStackOnDebuggeeWouldRun_(false),
@@ -1172,6 +1173,12 @@ class JS_PUBLIC_API(ContextOptions) {
return *this;
}
+ bool unboxedArrays() const { return unboxedArrays_; }
+ ContextOptions& setUnboxedArrays(bool flag) {
+ unboxedArrays_ = flag;
+ return *this;
+ }
+
bool asyncStack() const { return asyncStack_; }
ContextOptions& setAsyncStack(bool flag) {
asyncStack_ = flag;
@@ -1234,6 +1241,7 @@ class JS_PUBLIC_API(ContextOptions) {
bool wasmAlwaysBaseline_ : 1;
bool throwOnAsmJSValidationFailure_ : 1;
bool nativeRegExp_ : 1;
+ bool unboxedArrays_ : 1;
bool asyncStack_ : 1;
bool throwOnDebuggeeWouldRun_ : 1;
bool dumpStackOnDebuggeeWouldRun_ : 1;
@@ -5888,19 +5896,20 @@ JS_SetParallelParsingEnabled(JSContext* cx, bool enabled);
extern JS_PUBLIC_API(void)
JS_SetOffthreadIonCompilationEnabled(JSContext* cx, bool enabled);
-#define JIT_COMPILER_OPTIONS(Register) \
- Register(BASELINE_WARMUP_TRIGGER, "baseline.warmup.trigger") \
- Register(ION_WARMUP_TRIGGER, "ion.warmup.trigger") \
- Register(ION_GVN_ENABLE, "ion.gvn.enable") \
- Register(ION_FORCE_IC, "ion.forceinlineCaches") \
- Register(ION_ENABLE, "ion.enable") \
+#define JIT_COMPILER_OPTIONS(Register) \
+ Register(BASELINE_WARMUP_TRIGGER, "baseline.warmup.trigger") \
+ Register(ION_WARMUP_TRIGGER, "ion.warmup.trigger") \
+ Register(ION_GVN_ENABLE, "ion.gvn.enable") \
+ Register(ION_FORCE_IC, "ion.forceinlineCaches") \
+ Register(ION_ENABLE, "ion.enable") \
Register(ION_INTERRUPT_WITHOUT_SIGNAL, "ion.interrupt-without-signals") \
- Register(ION_CHECK_RANGE_ANALYSIS, "ion.check-range-analysis") \
- Register(BASELINE_ENABLE, "baseline.enable") \
- Register(OFFTHREAD_COMPILATION_ENABLE, "offthread-compilation.enable") \
- Register(JUMP_THRESHOLD, "jump-threshold") \
- Register(ASMJS_ATOMICS_ENABLE, "asmjs.atomics.enable") \
- Register(WASM_TEST_MODE, "wasm.test-mode") \
+ Register(ION_CHECK_RANGE_ANALYSIS, "ion.check-range-analysis") \
+ Register(BASELINE_ENABLE, "baseline.enable") \
+ Register(OFFTHREAD_COMPILATION_ENABLE, "offthread-compilation.enable") \
+ Register(JUMP_THRESHOLD, "jump-threshold") \
+ Register(UNBOXED_OBJECTS, "unboxed_objects") \
+ Register(ASMJS_ATOMICS_ENABLE, "asmjs.atomics.enable") \
+ Register(WASM_TEST_MODE, "wasm.test-mode") \
Register(WASM_FOLD_OFFSETS, "wasm.fold-offsets")
typedef enum JSJitCompilerOption {
diff --git a/js/src/jsarray.cpp b/js/src/jsarray.cpp
index e618c319f..1724a0a66 100644
--- a/js/src/jsarray.cpp
+++ b/js/src/jsarray.cpp
@@ -45,6 +45,7 @@
#include "vm/Caches-inl.h"
#include "vm/Interpreter-inl.h"
#include "vm/NativeObject-inl.h"
+#include "vm/UnboxedObject-inl.h"
using namespace js;
using namespace js::gc;
@@ -63,7 +64,7 @@ using JS::ToUint32;
bool
JS::IsArray(JSContext* cx, HandleObject obj, IsArrayAnswer* answer)
{
- if (obj->is<ArrayObject>()) {
+ if (obj->is<ArrayObject>() || obj->is<UnboxedArrayObject>()) {
*answer = IsArrayAnswer::Array;
return true;
}
@@ -99,6 +100,11 @@ js::GetLengthProperty(JSContext* cx, HandleObject obj, uint32_t* lengthp)
return true;
}
+ if (obj->is<UnboxedArrayObject>()) {
+ *lengthp = obj->as<UnboxedArrayObject>().length();
+ return true;
+ }
+
if (obj->is<ArgumentsObject>()) {
ArgumentsObject& argsobj = obj->as<ArgumentsObject>();
if (!argsobj.hasOverriddenLength()) {
@@ -247,20 +253,18 @@ static bool
GetElement(JSContext* cx, HandleObject obj, HandleObject receiver,
uint32_t index, bool* hole, MutableHandleValue vp)
{
- if (obj->isNative()) {
- NativeObject* nobj = &obj->as<NativeObject>();
- if (index < nobj->getDenseInitializedLength()) {
- vp.set(nobj->getDenseElement(size_t(index)));
- if (!vp.isMagic(JS_ELEMENTS_HOLE)) {
- *hole = false;
- return true;
- }
+ AssertGreaterThanZero(index);
+ if (index < GetAnyBoxedOrUnboxedInitializedLength(obj)) {
+ vp.set(GetAnyBoxedOrUnboxedDenseElement(obj, uint32_t(index)));
+ if (!vp.isMagic(JS_ELEMENTS_HOLE)) {
+ *hole = false;
+ return true;
}
- if (nobj->is<ArgumentsObject>() && index <= UINT32_MAX) {
- if (nobj->as<ArgumentsObject>().maybeGetElement(uint32_t(index), vp)) {
- *hole = false;
- return true;
- }
+ }
+ if (obj->is<ArgumentsObject>()) {
+ if (obj->as<ArgumentsObject>().maybeGetElement(uint32_t(index), vp)) {
+ *hole = false;
+ return true;
}
}
@@ -279,8 +283,8 @@ ElementAdder::append(JSContext* cx, HandleValue v)
{
MOZ_ASSERT(index_ < length_);
if (resObj_) {
- NativeObject* resObj = &resObj_->as<NativeObject>();
- DenseElementResult result = resObj->setOrExtendDenseElements(cx, index_, v.address(), 1);
+ DenseElementResult result =
+ SetOrExtendAnyBoxedOrUnboxedDenseElements(cx, resObj_, index_, v.address(), 1);
if (result == DenseElementResult::Failure)
return false;
if (result == DenseElementResult::Incomplete) {
@@ -332,31 +336,37 @@ js::GetElementsWithAdder(JSContext* cx, HandleObject obj, HandleObject receiver,
return true;
}
-static bool
-GetDenseElements(NativeObject* aobj, uint32_t length, Value* vp)
+template <JSValueType Type>
+DenseElementResult
+GetBoxedOrUnboxedDenseElements(JSObject* aobj, uint32_t length, Value* vp)
{
MOZ_ASSERT(!ObjectMayHaveExtraIndexedProperties(aobj));
- if (length > aobj->getDenseInitializedLength())
- return false;
+ if (length > GetBoxedOrUnboxedInitializedLength<Type>(aobj))
+ return DenseElementResult::Incomplete;
for (size_t i = 0; i < length; i++) {
- vp[i] = aobj->getDenseElement(i);
+ vp[i] = GetBoxedOrUnboxedDenseElement<Type>(aobj, i);
// No other indexed properties so hole => undefined.
if (vp[i].isMagic(JS_ELEMENTS_HOLE))
vp[i] = UndefinedValue();
}
- return true;
+ return DenseElementResult::Success;
}
+DefineBoxedOrUnboxedFunctor3(GetBoxedOrUnboxedDenseElements,
+ JSObject*, uint32_t, Value*);
+
bool
js::GetElements(JSContext* cx, HandleObject aobj, uint32_t length, Value* vp)
{
if (!ObjectMayHaveExtraIndexedProperties(aobj)) {
- if (GetDenseElements(&aobj->as<NativeObject>(), length, vp))
- return true;
+ GetBoxedOrUnboxedDenseElementsFunctor functor(aobj, length, vp);
+ DenseElementResult result = CallBoxedOrUnboxedSpecialization(functor, aobj);
+ if (result != DenseElementResult::Incomplete)
+ return result == DenseElementResult::Success;
}
if (aobj->is<ArgumentsObject>()) {
@@ -388,9 +398,9 @@ SetArrayElement(JSContext* cx, HandleObject obj, double index, HandleValue v)
{
MOZ_ASSERT(index >= 0);
- if (obj->is<ArrayObject>() && !obj->isIndexed() && index <= UINT32_MAX) {
- NativeObject* nobj = &obj->as<NativeObject>();
- DenseElementResult result = nobj->setOrExtendDenseElements(cx, uint32_t(index), v.address(), 1);
+ if ((obj->is<ArrayObject>() || obj->is<UnboxedArrayObject>()) && !obj->isIndexed() && index <= UINT32_MAX) {
+ DenseElementResult result =
+ SetOrExtendAnyBoxedOrUnboxedDenseElements(cx, obj, uint32_t(index), v.address(), 1);
if (result != DenseElementResult::Incomplete)
return result == DenseElementResult::Success;
}
@@ -510,6 +520,24 @@ struct ReverseIndexComparator
}
};
+bool
+js::CanonicalizeArrayLengthValue(JSContext* cx, HandleValue v, uint32_t* newLen)
+{
+ double d;
+
+ if (!ToUint32(cx, v, newLen))
+ return false;
+
+ if (!ToNumber(cx, v, &d))
+ return false;
+
+ if (d == *newLen)
+ return true;
+
+ JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_BAD_ARRAY_LENGTH);
+ return false;
+}
+
/* ES6 draft rev 34 (2015 Feb 20) 9.4.2.4 ArraySetLength */
bool
js::ArraySetLength(JSContext* cx, Handle<ArrayObject*> arr, HandleId id,
@@ -531,22 +559,12 @@ js::ArraySetLength(JSContext* cx, Handle<ArrayObject*> arr, HandleId id,
} else {
// Step 2 is irrelevant in our implementation.
- // Step 3.
- if (!ToUint32(cx, value, &newLen))
- return false;
-
- // Step 4.
- double d;
- if (!ToNumber(cx, value, &d))
+ // Steps 3-7.
+ MOZ_ASSERT_IF(attrs & JSPROP_IGNORE_VALUE, value.isUndefined());
+ if (!CanonicalizeArrayLengthValue(cx, value, &newLen))
return false;
- // Step 5.
- if (d != newLen) {
- JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_BAD_ARRAY_LENGTH);
- return false;
- }
-
- // Steps 6-8 are irrelevant in our implementation.
+ // Step 8 is irrelevant in our implementation.
}
// Steps 9-11.
@@ -805,7 +823,7 @@ array_addProperty(JSContext* cx, HandleObject obj, HandleId id, HandleValue v)
static inline bool
ObjectMayHaveExtraIndexedOwnProperties(JSObject* obj)
{
- return !obj->isNative() ||
+ return (!obj->isNative() && !obj->is<UnboxedArrayObject>()) ||
obj->isIndexed() ||
obj->is<TypedArrayObject>() ||
ClassMayResolveId(*obj->runtimeFromAnyThread()->commonNames,
@@ -836,7 +854,7 @@ js::ObjectMayHaveExtraIndexedProperties(JSObject* obj)
if (ObjectMayHaveExtraIndexedOwnProperties(obj))
return true;
- if (obj->as<NativeObject>().getDenseInitializedLength() != 0)
+ if (GetAnyBoxedOrUnboxedInitializedLength(obj) != 0)
return true;
} while (true);
}
@@ -1046,32 +1064,32 @@ struct StringSeparatorOp
}
};
-template <typename SeparatorOp>
-static bool
-ArrayJoinDenseKernel(JSContext* cx, SeparatorOp sepOp, HandleNativeObject obj, uint32_t length,
+template <typename SeparatorOp, JSValueType Type>
+static DenseElementResult
+ArrayJoinDenseKernel(JSContext* cx, SeparatorOp sepOp, HandleObject obj, uint32_t length,
StringBuffer& sb, uint32_t* numProcessed)
{
// This loop handles all elements up to initializedLength. If
// length > initLength we rely on the second loop to add the
// other elements.
MOZ_ASSERT(*numProcessed == 0);
- uint32_t initLength = Min<uint32_t>(obj->getDenseInitializedLength(),
+ uint32_t initLength = Min<uint32_t>(GetBoxedOrUnboxedInitializedLength<Type>(obj),
length);
while (*numProcessed < initLength) {
if (!CheckForInterrupt(cx))
- return false;
+ return DenseElementResult::Failure;
Value elem = obj->as<NativeObject>().getDenseElement(*numProcessed);
if (elem.isString()) {
if (!sb.append(elem.toString()))
- return false;
+ return DenseElementResult::Failure;
} else if (elem.isNumber()) {
if (!NumberValueToStringBuffer(cx, elem, sb))
- return false;
+ return DenseElementResult::Failure;
} else if (elem.isBoolean()) {
if (!BooleanToStringBuffer(elem.toBoolean(), sb))
- return false;
+ return DenseElementResult::Failure;
} else if (elem.isObject() || elem.isSymbol()) {
/*
* Object stringifying could modify the initialized length or make
@@ -1087,13 +1105,33 @@ ArrayJoinDenseKernel(JSContext* cx, SeparatorOp sepOp, HandleNativeObject obj, u
}
if (++(*numProcessed) != length && !sepOp(cx, sb))
- return false;
+ return DenseElementResult::Failure;
}
- return true;
+ return DenseElementResult::Incomplete;
}
template <typename SeparatorOp>
+struct ArrayJoinDenseKernelFunctor {
+ JSContext* cx;
+ SeparatorOp sepOp;
+ HandleObject obj;
+ uint32_t length;
+ StringBuffer& sb;
+ uint32_t* numProcessed;
+
+ ArrayJoinDenseKernelFunctor(JSContext* cx, SeparatorOp sepOp, HandleObject obj,
+ uint32_t length, StringBuffer& sb, uint32_t* numProcessed)
+ : cx(cx), sepOp(sepOp), obj(obj), length(length), sb(sb), numProcessed(numProcessed)
+ {}
+
+ template <JSValueType Type>
+ DenseElementResult operator()() {
+ return ArrayJoinDenseKernel<SeparatorOp, Type>(cx, sepOp, obj, length, sb, numProcessed);
+ }
+};
+
+template <typename SeparatorOp>
static bool
ArrayJoinKernel(JSContext* cx, SeparatorOp sepOp, HandleObject obj, uint32_t length,
StringBuffer& sb)
@@ -1101,10 +1139,10 @@ ArrayJoinKernel(JSContext* cx, SeparatorOp sepOp, HandleObject obj, uint32_t len
uint32_t i = 0;
if (!ObjectMayHaveExtraIndexedProperties(obj)) {
- if (!ArrayJoinDenseKernel<SeparatorOp>(cx, sepOp, obj.as<NativeObject>(), length, sb, &i))
- {
+ ArrayJoinDenseKernelFunctor<SeparatorOp> functor(cx, sepOp, obj, length, sb, &i);
+ DenseElementResult result = CallBoxedOrUnboxedSpecialization(functor, obj);
+ if (result == DenseElementResult::Failure)
return false;
- }
}
if (i != length) {
@@ -1175,14 +1213,11 @@ js::array_join(JSContext* cx, unsigned argc, Value* vp)
// An optimized version of a special case of steps 7-11: when length==1 and
// the 0th element is a string, ToString() of that element is a no-op and
// so it can be immediately returned as the result.
- if (length == 1 && obj->isNative()) {
- NativeObject* nobj = &obj->as<NativeObject>();
- if (nobj->getDenseInitializedLength() == 1) {
- Value elem0 = nobj->getDenseElement(0);
- if (elem0.isString()) {
- args.rval().set(elem0);
- return true;
- }
+ if (length == 1 && GetAnyBoxedOrUnboxedInitializedLength(obj) == 1) {
+ Value elem0 = GetAnyBoxedOrUnboxedDenseElement(obj, 0);
+ if (elem0.isString()) {
+ args.rval().set(elem0);
+ return true;
}
}
@@ -1225,7 +1260,7 @@ js::array_join(JSContext* cx, unsigned argc, Value* vp)
}
// Step 11
- JSString* str = sb.finishString();
+ JSString *str = sb.finishString();
if (!str)
return false;
@@ -1254,6 +1289,10 @@ array_toLocaleString(JSContext* cx, unsigned argc, Value* vp)
args.rval().setString(cx->names().empty);
return true;
}
+ if (obj->is<UnboxedArrayObject>() && obj->as<UnboxedArrayObject>().length() == 0) {
+ args.rval().setString(cx->names().empty);
+ return true;
+ }
AutoCycleDetector detector(cx, obj);
if (!detector.init())
@@ -1290,9 +1329,8 @@ InitArrayElements(JSContext* cx, HandleObject obj, uint32_t start,
return false;
if (!ObjectMayHaveExtraIndexedProperties(obj)) {
- NativeObject* nobj = &obj->as<NativeObject>();
- DenseElementResult result = nobj->setOrExtendDenseElements(cx, uint32_t(start), vector,
- count, updateTypes);
+ DenseElementResult result =
+ SetOrExtendAnyBoxedOrUnboxedDenseElements(cx, obj, start, vector, count, updateTypes);
if (result != DenseElementResult::Incomplete)
return result == DenseElementResult::Success;
}
@@ -1326,45 +1364,54 @@ InitArrayElements(JSContext* cx, HandleObject obj, uint32_t start,
return true;
}
-static DenseElementResult
-ArrayReverseDenseKernel(JSContext* cx, HandleNativeObject obj, uint32_t length)
+template <JSValueType Type>
+DenseElementResult
+ArrayReverseDenseKernel(JSContext* cx, HandleObject obj, uint32_t length)
{
/* An empty array or an array with no elements is already reversed. */
- if (length == 0 || obj->getDenseInitializedLength() == 0)
+ if (length == 0 || GetBoxedOrUnboxedInitializedLength<Type>(obj) == 0)
return DenseElementResult::Success;
- if (obj->denseElementsAreFrozen())
- return DenseElementResult::Incomplete;
+ if (Type == JSVAL_TYPE_MAGIC) {
+ if (obj->as<NativeObject>().denseElementsAreFrozen())
+ return DenseElementResult::Incomplete;
- /*
- * It's actually surprisingly complicated to reverse an array due to the
- * orthogonality of array length and array capacity while handling
- * leading and trailing holes correctly. Reversing seems less likely to
- * be a common operation than other array mass-mutation methods, so for
- * now just take a probably-small memory hit (in the absence of too many
- * holes in the array at its start) and ensure that the capacity is
- * sufficient to hold all the elements in the array if it were full.
- */
- DenseElementResult result = obj->ensureDenseElements(cx, length, 0);
- if (result != DenseElementResult::Success)
- return result;
+ /*
+ * It's actually surprisingly complicated to reverse an array due to the
+ * orthogonality of array length and array capacity while handling
+ * leading and trailing holes correctly. Reversing seems less likely to
+ * be a common operation than other array mass-mutation methods, so for
+ * now just take a probably-small memory hit (in the absence of too many
+ * holes in the array at its start) and ensure that the capacity is
+ * sufficient to hold all the elements in the array if it were full.
+ */
+ DenseElementResult result = obj->as<NativeObject>().ensureDenseElements(cx, length, 0);
+ if (result != DenseElementResult::Success)
+ return result;
- /* Fill out the array's initialized length to its proper length. */
- obj->ensureDenseInitializedLength(cx, length, 0);
+ /* Fill out the array's initialized length to its proper length. */
+ obj->as<NativeObject>().ensureDenseInitializedLength(cx, length, 0);
+ } else {
+ // Unboxed arrays can only be reversed here if their initialized length
+ // matches their actual length. Otherwise the reversal will place holes
+ // at the beginning of the array, which we don't support.
+ if (length != obj->as<UnboxedArrayObject>().initializedLength())
+ return DenseElementResult::Incomplete;
+ }
RootedValue origlo(cx), orighi(cx);
uint32_t lo = 0, hi = length - 1;
for (; lo < hi; lo++, hi--) {
- origlo = obj->getDenseElement(lo);
- orighi = obj->getDenseElement(hi);
- obj->setDenseElement(lo, orighi);
+ origlo = GetBoxedOrUnboxedDenseElement<Type>(obj, lo);
+ orighi = GetBoxedOrUnboxedDenseElement<Type>(obj, hi);
+ SetBoxedOrUnboxedDenseElementNoTypeChange<Type>(obj, lo, orighi);
if (orighi.isMagic(JS_ELEMENTS_HOLE) &&
!SuppressDeletedProperty(cx, obj, INT_TO_JSID(lo)))
{
return DenseElementResult::Failure;
}
- obj->setDenseElement(hi, origlo);
+ SetBoxedOrUnboxedDenseElementNoTypeChange<Type>(obj, hi, origlo);
if (origlo.isMagic(JS_ELEMENTS_HOLE) &&
!SuppressDeletedProperty(cx, obj, INT_TO_JSID(hi)))
{
@@ -1375,6 +1422,9 @@ ArrayReverseDenseKernel(JSContext* cx, HandleNativeObject obj, uint32_t length)
return DenseElementResult::Success;
}
+DefineBoxedOrUnboxedFunctor3(ArrayReverseDenseKernel,
+ JSContext*, HandleObject, uint32_t);
+
bool
js::array_reverse(JSContext* cx, unsigned argc, Value* vp)
{
@@ -1389,8 +1439,8 @@ js::array_reverse(JSContext* cx, unsigned argc, Value* vp)
return false;
if (!ObjectMayHaveExtraIndexedProperties(obj)) {
- DenseElementResult result =
- ArrayReverseDenseKernel(cx, obj.as<NativeObject>(), uint32_t(len));
+ ArrayReverseDenseKernelFunctor functor(cx, obj, len);
+ DenseElementResult result = CallBoxedOrUnboxedSpecialization(functor, obj);
if (result != DenseElementResult::Incomplete) {
/*
* Per ECMA-262, don't update the length of the array, even if the new
@@ -2033,8 +2083,8 @@ js::array_push(JSContext* cx, unsigned argc, Value* vp)
if (!ObjectMayHaveExtraIndexedProperties(obj)) {
DenseElementResult result =
- obj->as<NativeObject>().setOrExtendDenseElements(cx, uint32_t(length),
- args.array(), args.length());
+ SetOrExtendAnyBoxedOrUnboxedDenseElements(cx, obj, length,
+ args.array(), args.length());
if (result != DenseElementResult::Incomplete) {
if (result == DenseElementResult::Failure)
return false;
@@ -2042,8 +2092,14 @@ js::array_push(JSContext* cx, unsigned argc, Value* vp)
uint32_t newlength = length + args.length();
args.rval().setNumber(newlength);
- // Handle updates to the length of non-arrays here.
- if (!obj->is<ArrayObject>())
+ // SetOrExtendAnyBoxedOrUnboxedDenseElements takes care of updating the
+ // length for boxed and unboxed arrays. Handle updates to the length of
+ // non-arrays here.
+ bool isArray;
+ if (!IsArray(cx, obj, &isArray))
+ return false;
+
+ if (!isArray)
return SetLengthProperty(cx, obj, newlength);
return true;
@@ -2099,46 +2155,42 @@ js::array_pop(JSContext* cx, unsigned argc, Value* vp)
return SetLengthProperty(cx, obj, index);
}
-void
-js::ArrayShiftMoveElements(NativeObject* obj)
+template <JSValueType Type>
+static inline DenseElementResult
+ShiftMoveBoxedOrUnboxedDenseElements(JSObject* obj)
{
- MOZ_ASSERT_IF(obj->is<ArrayObject>(), obj->as<ArrayObject>().lengthIsWritable());
-
- size_t initlen = obj->getDenseInitializedLength();
- MOZ_ASSERT(initlen > 0);
+ MOZ_ASSERT(HasBoxedOrUnboxedDenseElements<Type>(obj));
/*
* At this point the length and initialized length have already been
* decremented and the result fetched, so just shift the array elements
* themselves.
*/
- obj->moveDenseElementsNoPreBarrier(0, 1, initlen);
-}
+ size_t initlen = GetBoxedOrUnboxedInitializedLength<Type>(obj);
+ if (Type == JSVAL_TYPE_MAGIC) {
+ obj->as<NativeObject>().moveDenseElementsNoPreBarrier(0, 1, initlen);
+ } else {
+ uint8_t* data = obj->as<UnboxedArrayObject>().elements();
+ size_t elementSize = UnboxedTypeSize(Type);
+ memmove(data, data + elementSize, initlen * elementSize);
+ }
-static inline void
-SetInitializedLength(JSContext* cx, NativeObject* obj, size_t initlen)
-{
- size_t oldInitlen = obj->getDenseInitializedLength();
- obj->setDenseInitializedLength(initlen);
- if (initlen < oldInitlen)
- obj->shrinkElements(cx, initlen);
+ return DenseElementResult::Success;
}
-static DenseElementResult
-MoveDenseElements(JSContext* cx, NativeObject* obj, uint32_t dstStart, uint32_t srcStart,
- uint32_t length)
-{
- if (obj->denseElementsAreFrozen())
- return DenseElementResult::Incomplete;
+DefineBoxedOrUnboxedFunctor1(ShiftMoveBoxedOrUnboxedDenseElements, JSObject*);
- if (!obj->maybeCopyElementsForWrite(cx))
- return DenseElementResult::Failure;
- obj->moveDenseElements(dstStart, srcStart, length);
+void
+js::ArrayShiftMoveElements(JSObject* obj)
+{
+ MOZ_ASSERT_IF(obj->is<ArrayObject>(), obj->as<ArrayObject>().lengthIsWritable());
- return DenseElementResult::Success;
+ ShiftMoveBoxedOrUnboxedDenseElementsFunctor functor(obj);
+ JS_ALWAYS_TRUE(CallBoxedOrUnboxedSpecialization(functor, obj) == DenseElementResult::Success);
}
-static DenseElementResult
+template <JSValueType Type>
+DenseElementResult
ArrayShiftDenseKernel(JSContext* cx, HandleObject obj, MutableHandleValue rval)
{
if (ObjectMayHaveExtraIndexedProperties(obj))
@@ -2151,22 +2203,25 @@ ArrayShiftDenseKernel(JSContext* cx, HandleObject obj, MutableHandleValue rval)
if (MOZ_UNLIKELY(group->hasAllFlags(OBJECT_FLAG_ITERATED)))
return DenseElementResult::Incomplete;
- size_t initlen = obj->as<NativeObject>().getDenseInitializedLength();
+ size_t initlen = GetBoxedOrUnboxedInitializedLength<Type>(obj);
if (initlen == 0)
return DenseElementResult::Incomplete;
- rval.set(obj->as<NativeObject>().getDenseElement(0));
+ rval.set(GetBoxedOrUnboxedDenseElement<Type>(obj, 0));
if (rval.isMagic(JS_ELEMENTS_HOLE))
rval.setUndefined();
- DenseElementResult result = MoveDenseElements(cx, &obj->as<NativeObject>(), 0, 1, initlen - 1);
+ DenseElementResult result = MoveBoxedOrUnboxedDenseElements<Type>(cx, obj, 0, 1, initlen - 1);
if (result != DenseElementResult::Success)
return result;
- SetInitializedLength(cx, obj.as<NativeObject>(), initlen - 1);
+ SetBoxedOrUnboxedInitializedLength<Type>(cx, obj, initlen - 1);
return DenseElementResult::Success;
}
+DefineBoxedOrUnboxedFunctor3(ArrayShiftDenseKernel,
+ JSContext*, HandleObject, MutableHandleValue);
+
/* ES5 15.4.4.9 */
bool
js::array_shift(JSContext* cx, unsigned argc, Value* vp)
@@ -2198,7 +2253,8 @@ js::array_shift(JSContext* cx, unsigned argc, Value* vp)
uint32_t newlen = len - 1;
/* Fast paths. */
- DenseElementResult result = ArrayShiftDenseKernel(cx, obj, args.rval());
+ ArrayShiftDenseKernelFunctor functor(cx, obj, args.rval());
+ DenseElementResult result = CallBoxedOrUnboxedSpecialization(functor, obj);
if (result != DenseElementResult::Incomplete) {
if (result == DenseElementResult::Failure)
return false;
@@ -2252,6 +2308,9 @@ js::array_unshift(JSContext* cx, unsigned argc, Value* vp)
if (args.length() > 0) {
/* Slide up the array to make room for all args at the bottom. */
if (length > 0) {
+ // Only include a fast path for boxed arrays. Unboxed arrays can'nt
+ // be optimized here because unshifting temporarily places holes at
+ // the start of the array.
bool optimized = false;
do {
if (!obj->is<ArrayObject>())
@@ -2311,10 +2370,10 @@ js::array_unshift(JSContext* cx, unsigned argc, Value* vp)
}
/*
- * Returns true if this is a dense array whose properties ending at |endIndex|
- * (exclusive) may be accessed (get, set, delete) directly through its
- * contiguous vector of elements without fear of getters, setters, etc. along
- * the prototype chain, or of enumerators requiring notification of
+ * Returns true if this is a dense or unboxed array whose |count| properties
+ * starting from |startingIndex| may be accessed (get, set, delete) directly
+ * through its contiguous vector of elements without fear of getters, setters,
+ * etc. along the prototype chain, or of enumerators requiring notification of
* modifications.
*/
static inline bool
@@ -2325,11 +2384,11 @@ CanOptimizeForDenseStorage(HandleObject arr, uint32_t startingIndex, uint32_t co
return false;
/* There's no optimizing possible if it's not an array. */
- if (!arr->is<ArrayObject>())
+ if (!arr->is<ArrayObject>() && !arr->is<UnboxedArrayObject>())
return false;
/* If it's a frozen array, always pick the slow path */
- if (arr->as<ArrayObject>().denseElementsAreFrozen())
+ if (arr->is<ArrayObject>() && arr->as<ArrayObject>().denseElementsAreFrozen())
return false;
/*
@@ -2361,23 +2420,7 @@ CanOptimizeForDenseStorage(HandleObject arr, uint32_t startingIndex, uint32_t co
* is subsumed by the initializedLength comparison.)
*/
return !ObjectMayHaveExtraIndexedProperties(arr) &&
- startingIndex + count <= arr->as<NativeObject>().getDenseInitializedLength();
-}
-
-static inline DenseElementResult
-CopyDenseElements(JSContext* cx, NativeObject* dst, NativeObject* src,
- uint32_t dstStart, uint32_t srcStart, uint32_t length)
-{
- MOZ_ASSERT(dst->getDenseInitializedLength() == dstStart);
- MOZ_ASSERT(src->getDenseInitializedLength() >= srcStart + length);
- MOZ_ASSERT(dst->getDenseCapacity() >= dstStart + length);
-
- dst->setDenseInitializedLength(dstStart + length);
-
- const Value* vp = src->getDenseElements() + srcStart;
- dst->initDenseElements(dstStart, vp, length);
-
- return DenseElementResult::Success;
+ startingIndex + count <= GetAnyBoxedOrUnboxedInitializedLength(arr);
}
static inline bool
@@ -2471,9 +2514,7 @@ array_splice_impl(JSContext* cx, unsigned argc, Value* vp, bool returnValueIsUse
/* Steps 10-11. */
DebugOnly<DenseElementResult> result =
- CopyDenseElements(cx, &arr->as<NativeObject>(),
- &obj->as<NativeObject>(), 0,
- actualStart, actualDeleteCount);
+ CopyAnyBoxedOrUnboxedDenseElements(cx, arr, obj, 0, actualStart, actualDeleteCount);
MOZ_ASSERT(result.value == DenseElementResult::Success);
/* Step 12 (implicit). */
@@ -2510,13 +2551,14 @@ array_splice_impl(JSContext* cx, unsigned argc, Value* vp, bool returnValueIsUse
if (CanOptimizeForDenseStorage(obj, 0, len, cx)) {
/* Steps 15.a-b. */
DenseElementResult result =
- MoveDenseElements(cx, &obj->as<NativeObject>(), targetIndex, sourceIndex, len - sourceIndex);
+ MoveAnyBoxedOrUnboxedDenseElements(cx, obj, targetIndex, sourceIndex,
+ len - sourceIndex);
MOZ_ASSERT(result != DenseElementResult::Incomplete);
if (result == DenseElementResult::Failure)
return false;
/* Steps 15.c-d. */
- SetInitializedLength(cx, obj.as<NativeObject>(), finalLength);
+ SetAnyBoxedOrUnboxedInitializedLength(cx, obj, finalLength);
} else {
/*
* This is all very slow if the length is very large. We don't yet
@@ -2596,15 +2638,15 @@ array_splice_impl(JSContext* cx, unsigned argc, Value* vp, bool returnValueIsUse
if (CanOptimizeForDenseStorage(obj, len, itemCount - actualDeleteCount, cx)) {
DenseElementResult result =
- MoveDenseElements(cx, &obj->as<NativeObject>(), actualStart + itemCount,
- actualStart + actualDeleteCount,
- len - (actualStart + actualDeleteCount));
+ MoveAnyBoxedOrUnboxedDenseElements(cx, obj, actualStart + itemCount,
+ actualStart + actualDeleteCount,
+ len - (actualStart + actualDeleteCount));
MOZ_ASSERT(result != DenseElementResult::Incomplete);
if (result == DenseElementResult::Failure)
return false;
/* Steps 16.a-b. */
- SetInitializedLength(cx, obj.as<NativeObject>(), len + itemCount - actualDeleteCount);
+ SetAnyBoxedOrUnboxedInitializedLength(cx, obj, len + itemCount - actualDeleteCount);
} else {
RootedValue fromValue(cx);
for (double k = len - actualDeleteCount; k > actualStart; k--) {
@@ -2789,7 +2831,7 @@ SliceSlowly(JSContext* cx, HandleObject obj, HandleObject receiver,
}
static bool
-SliceSparse(JSContext* cx, HandleObject obj, uint32_t begin, uint32_t end, HandleArrayObject result)
+SliceSparse(JSContext* cx, HandleObject obj, uint32_t begin, uint32_t end, HandleObject result)
{
MOZ_ASSERT(begin <= end);
@@ -2839,28 +2881,26 @@ ArraySliceOrdinary(JSContext* cx, HandleObject obj, uint32_t length, uint32_t be
begin = end;
if (!ObjectMayHaveExtraIndexedProperties(obj)) {
- size_t initlen = obj->as<NativeObject>().getDenseInitializedLength();
+ size_t initlen = GetAnyBoxedOrUnboxedInitializedLength(obj);
size_t count = 0;
if (initlen > begin)
count = Min<size_t>(initlen - begin, end - begin);
- RootedArrayObject narr(cx, NewFullyAllocatedArrayTryReuseGroup(cx, obj, count));
+ RootedObject narr(cx, NewFullyAllocatedArrayTryReuseGroup(cx, obj, count));
if (!narr)
return false;
-
- MOZ_ASSERT(count >= narr->as<ArrayObject>().length());
- narr->as<ArrayObject>().setLength(cx, count);
+ SetAnyBoxedOrUnboxedArrayLength(cx, narr, end - begin);
if (count) {
DebugOnly<DenseElementResult> result =
- CopyDenseElements(cx, &narr->as<NativeObject>(), &obj->as<NativeObject>(), 0, begin, count);
+ CopyAnyBoxedOrUnboxedDenseElements(cx, narr, obj, 0, begin, count);
MOZ_ASSERT(result.value == DenseElementResult::Success);
}
arr.set(narr);
return true;
}
- RootedArrayObject narr(cx, NewPartlyAllocatedArrayTryReuseGroup(cx, obj, end - begin));
+ RootedObject narr(cx, NewPartlyAllocatedArrayTryReuseGroup(cx, obj, end - begin));
if (!narr)
return false;
@@ -2977,10 +3017,11 @@ js::array_slice(JSContext* cx, unsigned argc, Value* vp)
return true;
}
-static bool
-ArraySliceDenseKernel(JSContext* cx, ArrayObject* arr, int32_t beginArg, int32_t endArg, ArrayObject* result)
+template <JSValueType Type>
+DenseElementResult
+ArraySliceDenseKernel(JSContext* cx, JSObject* obj, int32_t beginArg, int32_t endArg, JSObject* result)
{
- int32_t length = arr->length();
+ int32_t length = GetAnyBoxedOrUnboxedArrayLength(obj);
uint32_t begin = NormalizeSliceTerm(beginArg, length);
uint32_t end = NormalizeSliceTerm(endArg, length);
@@ -2988,33 +3029,33 @@ ArraySliceDenseKernel(JSContext* cx, ArrayObject* arr, int32_t beginArg, int32_t
if (begin > end)
begin = end;
- size_t initlen = arr->getDenseInitializedLength();
- size_t count = Min<size_t>(initlen - begin, end - begin);
+ size_t initlen = GetBoxedOrUnboxedInitializedLength<Type>(obj);
if (initlen > begin) {
+ size_t count = Min<size_t>(initlen - begin, end - begin);
if (count) {
- if (!result->ensureElements(cx, count))
- return false;
- CopyDenseElements(cx, &result->as<NativeObject>(), &arr->as<NativeObject>(), 0, begin, count);
+ DenseElementResult rv = EnsureBoxedOrUnboxedDenseElements<Type>(cx, result, count);
+ if (rv != DenseElementResult::Success)
+ return rv;
+ CopyBoxedOrUnboxedDenseElements<Type, Type>(cx, result, obj, 0, begin, count);
}
}
- MOZ_ASSERT(count >= result->length());
- result->setLength(cx, count);
-
- return true;
+ SetAnyBoxedOrUnboxedArrayLength(cx, result, end - begin);
+ return DenseElementResult::Success;
}
+DefineBoxedOrUnboxedFunctor5(ArraySliceDenseKernel,
+ JSContext*, JSObject*, int32_t, int32_t, JSObject*);
+
JSObject*
js::array_slice_dense(JSContext* cx, HandleObject obj, int32_t begin, int32_t end,
HandleObject result)
{
if (result && IsArraySpecies(cx, obj)) {
- if (!ArraySliceDenseKernel(cx, &obj->as<ArrayObject>(), begin, end,
- &result->as<ArrayObject>()))
- {
- return nullptr;
- }
- return result;
+ ArraySliceDenseKernelFunctor functor(cx, obj, begin, end, result);
+ DenseElementResult rv = CallBoxedOrUnboxedSpecialization(functor, result);
+ MOZ_ASSERT(rv != DenseElementResult::Incomplete);
+ return rv == DenseElementResult::Success ? result : nullptr;
}
// Slower path if the JIT wasn't able to allocate an object inline.
@@ -3045,7 +3086,7 @@ array_isArray(JSContext* cx, unsigned argc, Value* vp)
static bool
ArrayFromCallArgs(JSContext* cx, CallArgs& args, HandleObject proto = nullptr)
{
- ArrayObject* obj = NewCopiedArrayForCallingAllocationSite(cx, args.array(), args.length(), proto);
+ JSObject* obj = NewCopiedArrayForCallingAllocationSite(cx, args.array(), args.length(), proto);
if (!obj)
return false;
@@ -3219,7 +3260,7 @@ ArrayConstructorImpl(JSContext* cx, CallArgs& args, bool isConstructor)
}
}
- ArrayObject* obj = NewPartlyAllocatedArrayForCallingAllocationSite(cx, length, proto);
+ JSObject* obj = NewPartlyAllocatedArrayForCallingAllocationSite(cx, length, proto);
if (!obj)
return false;
@@ -3245,7 +3286,7 @@ js::array_construct(JSContext* cx, unsigned argc, Value* vp)
return ArrayConstructorImpl(cx, args, /* isConstructor = */ false);
}
-ArrayObject*
+JSObject*
js::ArrayConstructorOneArg(JSContext* cx, HandleObjectGroup group, int32_t lengthInt)
{
if (lengthInt < 0) {
@@ -3540,7 +3581,7 @@ js::NewDenseFullyAllocatedArrayWithTemplate(JSContext* cx, uint32_t length, JSOb
return arr;
}
-ArrayObject*
+JSObject*
js::NewDenseCopyOnWriteArray(JSContext* cx, HandleArrayObject templateObject, gc::InitialHeap heap)
{
MOZ_ASSERT(!gc::IsInsideNursery(templateObject));
@@ -3553,21 +3594,30 @@ js::NewDenseCopyOnWriteArray(JSContext* cx, HandleArrayObject templateObject, gc
return arr;
}
-// Return a new array with the specified length and allocated capacity (up to
-// maxLength), using the specified group if possible. If the specified group
-// cannot be used, ensure that the created array at least has the given
-// [[Prototype]].
+// Return a new boxed or unboxed array with the specified length and allocated
+// capacity (up to maxLength), using the specified group if possible. If the
+// specified group cannot be used, ensure that the created array at least has
+// the given [[Prototype]].
template <uint32_t maxLength>
-static inline ArrayObject*
+static inline JSObject*
NewArrayTryUseGroup(ExclusiveContext* cx, HandleObjectGroup group, size_t length,
NewObjectKind newKind = GenericObject)
{
MOZ_ASSERT(newKind != SingletonObject);
- if (group->shouldPreTenure())
+ if (group->maybePreliminaryObjects())
+ group->maybePreliminaryObjects()->maybeAnalyze(cx, group);
+
+ if (group->shouldPreTenure() || group->maybePreliminaryObjects())
newKind = TenuredObject;
RootedObject proto(cx, group->proto().toObject());
+ if (group->maybeUnboxedLayout()) {
+ if (length > UnboxedArrayObject::MaximumCapacity)
+ return NewArray<maxLength>(cx, length, proto, newKind);
+ return UnboxedArrayObject::create(cx, group, length, newKind, maxLength);
+ }
+
ArrayObject* res = NewArray<maxLength>(cx, length, proto, newKind);
if (!res)
return nullptr;
@@ -3579,17 +3629,20 @@ NewArrayTryUseGroup(ExclusiveContext* cx, HandleObjectGroup group, size_t length
if (res->length() > INT32_MAX)
res->setLength(cx, res->length());
+ if (PreliminaryObjectArray* preliminaryObjects = group->maybePreliminaryObjects())
+ preliminaryObjects->registerNewObject(res);
+
return res;
}
-ArrayObject*
+JSObject*
js::NewFullyAllocatedArrayTryUseGroup(ExclusiveContext* cx, HandleObjectGroup group, size_t length,
NewObjectKind newKind)
{
return NewArrayTryUseGroup<UINT32_MAX>(cx, group, length, newKind);
}
-ArrayObject*
+JSObject*
js::NewPartlyAllocatedArrayTryUseGroup(ExclusiveContext* cx, HandleObjectGroup group, size_t length)
{
return NewArrayTryUseGroup<ArrayObject::EagerAllocationMaxLength>(cx, group, length);
@@ -3598,13 +3651,16 @@ js::NewPartlyAllocatedArrayTryUseGroup(ExclusiveContext* cx, HandleObjectGroup g
// Return a new array with the default prototype and specified allocated
// capacity and length. If possible, try to reuse the group of the input
// object. The resulting array will either reuse the input object's group or
-// will have unknown property types.
+// will have unknown property types. Additionally, the result will have the
+// same boxed/unboxed elements representation as the input object, unless
+// |length| is larger than the input object's initialized length (in which case
+// UnboxedArrayObject::MaximumCapacity might be exceeded).
template <uint32_t maxLength>
-static inline ArrayObject*
+static inline JSObject*
NewArrayTryReuseGroup(JSContext* cx, HandleObject obj, size_t length,
NewObjectKind newKind = GenericObject)
{
- if (!obj->is<ArrayObject>())
+ if (!obj->is<ArrayObject>() && !obj->is<UnboxedArrayObject>())
return NewArray<maxLength>(cx, length, nullptr, newKind);
if (obj->staticPrototype() != cx->global()->maybeGetArrayPrototype())
@@ -3617,20 +3673,20 @@ NewArrayTryReuseGroup(JSContext* cx, HandleObject obj, size_t length,
return NewArrayTryUseGroup<maxLength>(cx, group, length, newKind);
}
-ArrayObject*
+JSObject*
js::NewFullyAllocatedArrayTryReuseGroup(JSContext* cx, HandleObject obj, size_t length,
NewObjectKind newKind)
{
return NewArrayTryReuseGroup<UINT32_MAX>(cx, obj, length, newKind);
}
-ArrayObject*
+JSObject*
js::NewPartlyAllocatedArrayTryReuseGroup(JSContext* cx, HandleObject obj, size_t length)
{
return NewArrayTryReuseGroup<ArrayObject::EagerAllocationMaxLength>(cx, obj, length);
}
-ArrayObject*
+JSObject*
js::NewFullyAllocatedArrayForCallingAllocationSite(JSContext* cx, size_t length,
NewObjectKind newKind)
{
@@ -3640,7 +3696,7 @@ js::NewFullyAllocatedArrayForCallingAllocationSite(JSContext* cx, size_t length,
return NewArrayTryUseGroup<UINT32_MAX>(cx, group, length, newKind);
}
-ArrayObject*
+JSObject*
js::NewPartlyAllocatedArrayForCallingAllocationSite(JSContext* cx, size_t length, HandleObject proto)
{
RootedObjectGroup group(cx, ObjectGroup::callingAllocationSiteGroup(cx, JSProto_Array, proto));
@@ -3649,23 +3705,68 @@ js::NewPartlyAllocatedArrayForCallingAllocationSite(JSContext* cx, size_t length
return NewArrayTryUseGroup<ArrayObject::EagerAllocationMaxLength>(cx, group, length);
}
-ArrayObject*
+bool
+js::MaybeAnalyzeBeforeCreatingLargeArray(ExclusiveContext* cx, HandleObjectGroup group,
+ const Value* vp, size_t length)
+{
+ static const size_t EagerPreliminaryObjectAnalysisThreshold = 800;
+
+ // Force analysis to see if an unboxed array can be used when making a
+ // sufficiently large array, to avoid excessive analysis and copying later
+ // on. If this is the first array of its group that is being created, first
+ // make a dummy array with the initial elements of the array we are about
+ // to make, so there is some basis for the unboxed array analysis.
+ if (length > EagerPreliminaryObjectAnalysisThreshold) {
+ if (PreliminaryObjectArrayWithTemplate* objects = group->maybePreliminaryObjects()) {
+ if (objects->empty()) {
+ size_t nlength = Min<size_t>(length, 100);
+ JSObject* obj = NewFullyAllocatedArrayTryUseGroup(cx, group, nlength);
+ if (!obj)
+ return false;
+ DebugOnly<DenseElementResult> result =
+ SetOrExtendAnyBoxedOrUnboxedDenseElements(cx, obj, 0, vp, nlength,
+ ShouldUpdateTypes::Update);
+ MOZ_ASSERT(result.value == DenseElementResult::Success);
+ }
+ objects->maybeAnalyze(cx, group, /* forceAnalyze = */ true);
+ }
+ }
+ return true;
+}
+
+JSObject*
js::NewCopiedArrayTryUseGroup(ExclusiveContext* cx, HandleObjectGroup group,
const Value* vp, size_t length, NewObjectKind newKind,
ShouldUpdateTypes updateTypes)
{
- ArrayObject* obj = NewFullyAllocatedArrayTryUseGroup(cx, group, length, newKind);
+ if (!MaybeAnalyzeBeforeCreatingLargeArray(cx, group, vp, length))
+ return nullptr;
+
+ JSObject* obj = NewFullyAllocatedArrayTryUseGroup(cx, group, length, newKind);
if (!obj)
return nullptr;
- DenseElementResult result = obj->setOrExtendDenseElements(cx, 0, vp, length, updateTypes);
+ DenseElementResult result =
+ SetOrExtendAnyBoxedOrUnboxedDenseElements(cx, obj, 0, vp, length, updateTypes);
+ if (result == DenseElementResult::Failure)
+ return nullptr;
+ if (result == DenseElementResult::Success)
+ return obj;
+
+ MOZ_ASSERT(obj->is<UnboxedArrayObject>());
+ if (!UnboxedArrayObject::convertToNative(cx->asJSContext(), obj))
+ return nullptr;
+
+ result = SetOrExtendBoxedOrUnboxedDenseElements<JSVAL_TYPE_MAGIC>(cx, obj, 0, vp, length,
+ updateTypes);
+ MOZ_ASSERT(result != DenseElementResult::Incomplete);
if (result == DenseElementResult::Failure)
return nullptr;
- MOZ_ASSERT(result == DenseElementResult::Success);
+
return obj;
}
-ArrayObject*
+JSObject*
js::NewCopiedArrayForCallingAllocationSite(JSContext* cx, const Value* vp, size_t length,
HandleObject proto /* = nullptr */)
{
diff --git a/js/src/jsarray.h b/js/src/jsarray.h
index d0084731f..0ca580ba7 100644
--- a/js/src/jsarray.h
+++ b/js/src/jsarray.h
@@ -72,37 +72,49 @@ extern ArrayObject*
NewDenseFullyAllocatedArrayWithTemplate(JSContext* cx, uint32_t length, JSObject* templateObject);
/* Create a dense array with the same copy-on-write elements as another object. */
-extern ArrayObject*
+extern JSObject*
NewDenseCopyOnWriteArray(JSContext* cx, HandleArrayObject templateObject, gc::InitialHeap heap);
-extern ArrayObject*
+// The methods below can create either boxed or unboxed arrays.
+
+extern JSObject*
NewFullyAllocatedArrayTryUseGroup(ExclusiveContext* cx, HandleObjectGroup group, size_t length,
NewObjectKind newKind = GenericObject);
-extern ArrayObject*
+extern JSObject*
NewPartlyAllocatedArrayTryUseGroup(ExclusiveContext* cx, HandleObjectGroup group, size_t length);
-extern ArrayObject*
+extern JSObject*
NewFullyAllocatedArrayTryReuseGroup(JSContext* cx, HandleObject obj, size_t length,
NewObjectKind newKind = GenericObject);
-extern ArrayObject*
+extern JSObject*
NewPartlyAllocatedArrayTryReuseGroup(JSContext* cx, HandleObject obj, size_t length);
-extern ArrayObject*
+extern JSObject*
NewFullyAllocatedArrayForCallingAllocationSite(JSContext* cx, size_t length,
NewObjectKind newKind = GenericObject);
-extern ArrayObject*
+extern JSObject*
NewPartlyAllocatedArrayForCallingAllocationSite(JSContext* cx, size_t length, HandleObject proto);
-extern ArrayObject*
+enum class ShouldUpdateTypes
+{
+ Update,
+ DontUpdate
+};
+
+extern bool
+MaybeAnalyzeBeforeCreatingLargeArray(ExclusiveContext* cx, HandleObjectGroup group,
+ const Value* vp, size_t length);
+
+extern JSObject*
NewCopiedArrayTryUseGroup(ExclusiveContext* cx, HandleObjectGroup group,
const Value* vp, size_t length,
NewObjectKind newKind = GenericObject,
ShouldUpdateTypes updateTypes = ShouldUpdateTypes::Update);
-extern ArrayObject*
+extern JSObject*
NewCopiedArrayForCallingAllocationSite(JSContext* cx, const Value* vp, size_t length,
HandleObject proto = nullptr);
@@ -117,6 +129,13 @@ NewValuePair(JSContext* cx, const Value& val1, const Value& val2, MutableHandleV
extern bool
WouldDefinePastNonwritableLength(HandleNativeObject obj, uint32_t index);
+/*
+ * Canonicalize |vp| to a uint32_t value potentially suitable for use as an
+ * array length.
+ */
+extern bool
+CanonicalizeArrayLengthValue(JSContext* cx, HandleValue v, uint32_t* canonicalized);
+
extern bool
GetLengthProperty(JSContext* cx, HandleObject obj, uint32_t* lengthp);
@@ -150,7 +169,7 @@ extern bool
array_join(JSContext* cx, unsigned argc, js::Value* vp);
extern void
-ArrayShiftMoveElements(NativeObject* obj);
+ArrayShiftMoveElements(JSObject* obj);
extern bool
array_shift(JSContext* cx, unsigned argc, js::Value* vp);
@@ -182,7 +201,7 @@ extern const JSJitInfo array_splice_info;
extern bool
NewbornArrayPush(JSContext* cx, HandleObject obj, const Value& v);
-extern ArrayObject*
+extern JSObject*
ArrayConstructorOneArg(JSContext* cx, HandleObjectGroup group, int32_t lengthInt);
#ifdef DEBUG
diff --git a/js/src/jscompartment.h b/js/src/jscompartment.h
index 05ff40b43..d7c6765ff 100644
--- a/js/src/jscompartment.h
+++ b/js/src/jscompartment.h
@@ -528,6 +528,9 @@ struct JSCompartment
// table manages references from such typed objects to their buffers.
js::ObjectWeakMap* lazyArrayBuffers;
+ // All unboxed layouts in the compartment.
+ mozilla::LinkedList<js::UnboxedLayout> unboxedLayouts;
+
// WebAssembly state for the compartment.
js::wasm::Compartment wasm;
diff --git a/js/src/jsfriendapi.cpp b/js/src/jsfriendapi.cpp
index bdb3c0a4d..515f62213 100644
--- a/js/src/jsfriendapi.cpp
+++ b/js/src/jsfriendapi.cpp
@@ -268,9 +268,9 @@ js::GetBuiltinClass(JSContext* cx, HandleObject obj, ESClass* cls)
if (MOZ_UNLIKELY(obj->is<ProxyObject>()))
return Proxy::getBuiltinClass(cx, obj, cls);
- if (obj->is<PlainObject>())
+ if (obj->is<PlainObject>() || obj->is<UnboxedPlainObject>())
*cls = ESClass::Object;
- else if (obj->is<ArrayObject>())
+ else if (obj->is<ArrayObject>() || obj->is<UnboxedArrayObject>())
*cls = ESClass::Array;
else if (obj->is<NumberObject>())
*cls = ESClass::Number;
diff --git a/js/src/jsgc.cpp b/js/src/jsgc.cpp
index 5a9d732b6..64573b55a 100644
--- a/js/src/jsgc.cpp
+++ b/js/src/jsgc.cpp
@@ -6176,6 +6176,12 @@ gc::MergeCompartments(JSCompartment* source, JSCompartment* target)
for (auto group = source->zone()->cellIter<ObjectGroup>(); !group.done(); group.next()) {
group->setGeneration(target->zone()->types.generation);
group->compartment_ = target;
+
+ // Remove any unboxed layouts from the list in the off thread
+ // compartment. These do not need to be reinserted in the target
+ // compartment's list, as the list is not required to be complete.
+ if (UnboxedLayout* layout = group->maybeUnboxedLayoutDontCheckGeneration())
+ layout->detachFromCompartment();
}
// Fixup zone pointers in source's zone to refer to target's zone.
@@ -6778,6 +6784,7 @@ js::gc::NextCellUniqueId(JSRuntime* rt)
namespace js {
namespace gc {
+#ifdef MOZ_DEVTOOLS_SERVER
namespace MemInfo {
static bool
@@ -6993,6 +7000,7 @@ NewMemoryInfoObject(JSContext* cx)
return obj;
}
+#endif // MOZ_DEVTOOLS_SERVER
const char*
StateName(State state)
diff --git a/js/src/jsgc.h b/js/src/jsgc.h
index 952fd6bae..601f63daa 100644
--- a/js/src/jsgc.h
+++ b/js/src/jsgc.h
@@ -1357,8 +1357,10 @@ class ZoneList
ZoneList& operator=(const ZoneList& other) = delete;
};
+#ifdef MOZ_DEVTOOLS_SERVER
JSObject*
NewMemoryStatisticsObject(JSContext* cx);
+#endif
struct MOZ_RAII AutoAssertNoNurseryAlloc
{
diff --git a/js/src/jsiter.cpp b/js/src/jsiter.cpp
index c58f32382..8b1436b68 100644
--- a/js/src/jsiter.cpp
+++ b/js/src/jsiter.cpp
@@ -158,11 +158,8 @@ SortComparatorIntegerIds(jsid a, jsid b, bool* lessOrEqualp)
}
static bool
-EnumerateNativeProperties(JSContext* cx,
- HandleNativeObject pobj,
- unsigned flags,
- Maybe<IdSet>& ht,
- AutoIdVector* props)
+EnumerateNativeProperties(JSContext* cx, HandleNativeObject pobj, unsigned flags, Maybe<IdSet>& ht,
+ AutoIdVector* props, Handle<UnboxedPlainObject*> unboxed = nullptr)
{
bool enumerateSymbols;
if (flags & JSITER_SYMBOLSONLY) {
@@ -224,6 +221,16 @@ EnumerateNativeProperties(JSContext* cx,
return false;
}
+ if (unboxed) {
+ // If |unboxed| is set then |pobj| is the expando for an unboxed
+ // plain object we are enumerating. Add the unboxed properties
+ // themselves here since they are all property names that were
+ // given to the object before any of the expando's properties.
+ MOZ_ASSERT(pobj->is<UnboxedExpandoObject>());
+ if (!EnumerateExtraProperties(cx, unboxed, flags, ht, props))
+ return false;
+ }
+
size_t initialLength = props->length();
/* Collect all unique property names from this object's shape. */
@@ -349,12 +356,22 @@ Snapshot(JSContext* cx, HandleObject pobj_, unsigned flags, AutoIdVector* props)
do {
if (pobj->getOpsEnumerate()) {
- if (!EnumerateExtraProperties(cx, pobj, flags, ht, props))
- return false;
-
- if (pobj->isNative()) {
- if (!EnumerateNativeProperties(cx, pobj.as<NativeObject>(), flags, ht, props))
+ if (pobj->is<UnboxedPlainObject>() && pobj->as<UnboxedPlainObject>().maybeExpando()) {
+ // Special case unboxed objects with an expando object.
+ RootedNativeObject expando(cx, pobj->as<UnboxedPlainObject>().maybeExpando());
+ if (!EnumerateNativeProperties(cx, expando, flags, ht, props,
+ pobj.as<UnboxedPlainObject>()))
+ {
+ return false;
+ }
+ } else {
+ if (!EnumerateExtraProperties(cx, pobj, flags, ht, props))
return false;
+
+ if (pobj->isNative()) {
+ if (!EnumerateNativeProperties(cx, pobj.as<NativeObject>(), flags, ht, props))
+ return false;
+ }
}
} else if (pobj->isNative()) {
// Give the object a chance to resolve all lazy properties
@@ -769,6 +786,11 @@ CanCompareIterableObjectToCache(JSObject* obj)
{
if (obj->isNative())
return obj->as<NativeObject>().hasEmptyElements();
+ if (obj->is<UnboxedPlainObject>()) {
+ if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando())
+ return expando->hasEmptyElements();
+ return true;
+ }
return false;
}
diff --git a/js/src/jsobj.cpp b/js/src/jsobj.cpp
index ef1291079..d4379bd7d 100644
--- a/js/src/jsobj.cpp
+++ b/js/src/jsobj.cpp
@@ -42,7 +42,6 @@
#include "frontend/BytecodeCompiler.h"
#include "gc/Marking.h"
#include "gc/Policy.h"
-#include "gc/StoreBuffer-inl.h"
#include "jit/BaselineJIT.h"
#include "js/MemoryMetrics.h"
#include "js/Proxy.h"
@@ -869,6 +868,9 @@ static inline JSObject*
CreateThisForFunctionWithGroup(JSContext* cx, HandleObjectGroup group,
NewObjectKind newKind)
{
+ if (group->maybeUnboxedLayout() && newKind != SingletonObject)
+ return UnboxedPlainObject::create(cx, group, newKind);
+
if (TypeNewScript* newScript = group->newScript()) {
if (newScript->analyzed()) {
// The definite properties analysis has been performed for this
@@ -1136,18 +1138,19 @@ js::CloneObject(JSContext* cx, HandleObject obj, Handle<js::TaggedProto> proto)
}
static bool
-GetScriptArrayObjectElements(JSContext* cx, HandleArrayObject arr, MutableHandle<GCVector<Value>> values)
+GetScriptArrayObjectElements(JSContext* cx, HandleObject obj, MutableHandle<GCVector<Value>> values)
{
- MOZ_ASSERT(!arr->isSingleton());
- MOZ_ASSERT(!arr->isIndexed());
+ MOZ_ASSERT(!obj->isSingleton());
+ MOZ_ASSERT(obj->is<ArrayObject>() || obj->is<UnboxedArrayObject>());
+ MOZ_ASSERT(!obj->isIndexed());
- size_t length = arr->length();
+ size_t length = GetAnyBoxedOrUnboxedArrayLength(obj);
if (!values.appendN(MagicValue(JS_ELEMENTS_HOLE), length))
return false;
- size_t initlen = arr->getDenseInitializedLength();
+ size_t initlen = GetAnyBoxedOrUnboxedInitializedLength(obj);
for (size_t i = 0; i < initlen; i++)
- values[i].set(arr->getDenseElement(i));
+ values[i].set(GetAnyBoxedOrUnboxedDenseElement(obj, i));
return true;
}
@@ -1156,27 +1159,46 @@ static bool
GetScriptPlainObjectProperties(JSContext* cx, HandleObject obj,
MutableHandle<IdValueVector> properties)
{
- MOZ_ASSERT(obj->is<PlainObject>());
- PlainObject* nobj = &obj->as<PlainObject>();
+ if (obj->is<PlainObject>()) {
+ PlainObject* nobj = &obj->as<PlainObject>();
- if (!properties.appendN(IdValuePair(), nobj->slotSpan()))
- return false;
+ if (!properties.appendN(IdValuePair(), nobj->slotSpan()))
+ return false;
+
+ for (Shape::Range<NoGC> r(nobj->lastProperty()); !r.empty(); r.popFront()) {
+ Shape& shape = r.front();
+ MOZ_ASSERT(shape.isDataDescriptor());
+ uint32_t slot = shape.slot();
+ properties[slot].get().id = shape.propid();
+ properties[slot].get().value = nobj->getSlot(slot);
+ }
+
+ for (size_t i = 0; i < nobj->getDenseInitializedLength(); i++) {
+ Value v = nobj->getDenseElement(i);
+ if (!v.isMagic(JS_ELEMENTS_HOLE) && !properties.append(IdValuePair(INT_TO_JSID(i), v)))
+ return false;
+ }
- for (Shape::Range<NoGC> r(nobj->lastProperty()); !r.empty(); r.popFront()) {
- Shape& shape = r.front();
- MOZ_ASSERT(shape.isDataDescriptor());
- uint32_t slot = shape.slot();
- properties[slot].get().id = shape.propid();
- properties[slot].get().value = nobj->getSlot(slot);
+ return true;
}
- for (size_t i = 0; i < nobj->getDenseInitializedLength(); i++) {
- Value v = nobj->getDenseElement(i);
- if (!v.isMagic(JS_ELEMENTS_HOLE) && !properties.append(IdValuePair(INT_TO_JSID(i), v)))
+ if (obj->is<UnboxedPlainObject>()) {
+ UnboxedPlainObject* nobj = &obj->as<UnboxedPlainObject>();
+
+ const UnboxedLayout& layout = nobj->layout();
+ if (!properties.appendN(IdValuePair(), layout.properties().length()))
return false;
+
+ for (size_t i = 0; i < layout.properties().length(); i++) {
+ const UnboxedLayout::Property& property = layout.properties()[i];
+ properties[i].get().id = NameToId(property.name);
+ properties[i].get().value = nobj->getValue(property);
+ }
+
+ return true;
}
- return true;
+ MOZ_CRASH("Bad object kind");
}
static bool
@@ -1198,13 +1220,13 @@ js::DeepCloneObjectLiteral(JSContext* cx, HandleObject obj, NewObjectKind newKin
/* NB: Keep this in sync with XDRObjectLiteral. */
MOZ_ASSERT_IF(obj->isSingleton(),
cx->compartment()->behaviors().getSingletonsAsTemplates());
- MOZ_ASSERT(obj->is<PlainObject>() ||
- obj->is<ArrayObject>());
+ MOZ_ASSERT(obj->is<PlainObject>() || obj->is<UnboxedPlainObject>() ||
+ obj->is<ArrayObject>() || obj->is<UnboxedArrayObject>());
MOZ_ASSERT(newKind != SingletonObject);
- if (obj->is<ArrayObject>()) {
+ if (obj->is<ArrayObject>() || obj->is<UnboxedArrayObject>()) {
Rooted<GCVector<Value>> values(cx, GCVector<Value>(cx));
- if (!GetScriptArrayObjectElements(cx, obj.as<ArrayObject>(), &values))
+ if (!GetScriptArrayObjectElements(cx, obj, &values))
return nullptr;
// Deep clone any elements.
@@ -1318,8 +1340,10 @@ js::XDRObjectLiteral(XDRState<mode>* xdr, MutableHandleObject obj)
{
if (mode == XDR_ENCODE) {
MOZ_ASSERT(obj->is<PlainObject>() ||
- obj->is<ArrayObject>());
- isArray = obj->is<ArrayObject>() ? 1 : 0;
+ obj->is<UnboxedPlainObject>() ||
+ obj->is<ArrayObject>() ||
+ obj->is<UnboxedArrayObject>());
+ isArray = (obj->is<ArrayObject>() || obj->is<UnboxedArrayObject>()) ? 1 : 0;
}
if (!xdr->codeUint32(&isArray))
@@ -1331,11 +1355,8 @@ js::XDRObjectLiteral(XDRState<mode>* xdr, MutableHandleObject obj)
if (isArray) {
Rooted<GCVector<Value>> values(cx, GCVector<Value>(cx));
- if (mode == XDR_ENCODE) {
- RootedArrayObject arr(cx, &obj->as<ArrayObject>());
- if (!GetScriptArrayObjectElements(cx, arr, &values))
- return false;
- }
+ if (mode == XDR_ENCODE && !GetScriptArrayObjectElements(cx, obj, &values))
+ return false;
uint32_t initialized;
if (mode == XDR_ENCODE)
@@ -2315,6 +2336,16 @@ js::LookupOwnPropertyPure(ExclusiveContext* cx, JSObject* obj, jsid id, Shape**
// us the resolve hook won't define a property with this id.
if (ClassMayResolveId(cx->names(), obj->getClass(), id, obj))
return false;
+ } else if (obj->is<UnboxedPlainObject>()) {
+ if (obj->as<UnboxedPlainObject>().containsUnboxedOrExpandoProperty(cx, id)) {
+ MarkNonNativePropertyFound<NoGC>(propp);
+ return true;
+ }
+ } else if (obj->is<UnboxedArrayObject>()) {
+ if (obj->as<UnboxedArrayObject>().containsProperty(cx, id)) {
+ MarkNonNativePropertyFound<NoGC>(propp);
+ return true;
+ }
} else if (obj->is<TypedObject>()) {
if (obj->as<TypedObject>().typeDescr().hasProperty(cx->names(), id)) {
MarkNonNativePropertyFound<NoGC>(propp);
@@ -2571,6 +2602,11 @@ js::SetPrototype(JSContext* cx, HandleObject obj, HandleObject proto, JS::Object
break;
}
+ // Convert unboxed objects to their native representations before changing
+ // their prototype/group, as they depend on the group for their layout.
+ if (!MaybeConvertUnboxedObjectToNative(cx, obj))
+ return false;
+
Rooted<TaggedProto> taggedProto(cx, TaggedProto(proto));
if (!SetClassAndProto(cx, obj, obj->getClass(), taggedProto))
return false;
@@ -2594,6 +2630,9 @@ js::PreventExtensions(JSContext* cx, HandleObject obj, ObjectOpResult& result, I
if (!obj->nonProxyIsExtensible())
return result.succeed();
+ if (!MaybeConvertUnboxedObjectToNative(cx, obj))
+ return false;
+
// Force lazy properties to be resolved.
AutoIdVector props(cx);
if (!js::GetPropertyKeys(cx, obj, JSITER_HIDDEN | JSITER_OWNONLY, &props))
@@ -3606,6 +3645,22 @@ JSObject::allocKindForTenure(const js::Nursery& nursery) const
if (IsProxy(this))
return as<ProxyObject>().allocKindForTenure();
+ // Unboxed plain objects are sized according to the data they store.
+ if (is<UnboxedPlainObject>()) {
+ size_t nbytes = as<UnboxedPlainObject>().layoutDontCheckGeneration().size();
+ return GetGCObjectKindForBytes(UnboxedPlainObject::offsetOfData() + nbytes);
+ }
+
+ // Unboxed arrays use inline data if their size is small enough.
+ if (is<UnboxedArrayObject>()) {
+ const UnboxedArrayObject* nobj = &as<UnboxedArrayObject>();
+ size_t nbytes = UnboxedArrayObject::offsetOfInlineElements() +
+ nobj->capacity() * nobj->elementSize();
+ if (nbytes <= JSObject::MAX_BYTE_SIZE)
+ return GetGCObjectKindForBytes(nbytes);
+ return AllocKind::OBJECT0;
+ }
+
// Inlined typed objects are followed by their data, so make sure we copy
// it all over to the new object.
if (is<InlineTypedObject>()) {
diff --git a/js/src/jsobjinlines.h b/js/src/jsobjinlines.h
index 98e740142..a82725ee8 100644
--- a/js/src/jsobjinlines.h
+++ b/js/src/jsobjinlines.h
@@ -32,6 +32,21 @@
#include "vm/ShapedObject-inl.h"
#include "vm/TypeInference-inl.h"
+namespace js {
+
+// This is needed here for ensureShape() below.
+inline bool
+MaybeConvertUnboxedObjectToNative(ExclusiveContext* cx, JSObject* obj)
+{
+ if (obj->is<UnboxedPlainObject>())
+ return UnboxedPlainObject::convertToNative(cx->asJSContext(), obj);
+ if (obj->is<UnboxedArrayObject>())
+ return UnboxedArrayObject::convertToNative(cx->asJSContext(), obj);
+ return true;
+}
+
+} // namespace js
+
inline js::Shape*
JSObject::maybeShape() const
{
@@ -44,6 +59,8 @@ JSObject::maybeShape() const
inline js::Shape*
JSObject::ensureShape(js::ExclusiveContext* cx)
{
+ if (!js::MaybeConvertUnboxedObjectToNative(cx, this))
+ return nullptr;
js::Shape* shape = maybeShape();
MOZ_ASSERT(shape);
return shape;
diff --git a/js/src/jsstr.cpp b/js/src/jsstr.cpp
index 3964ab84e..5e593846e 100644
--- a/js/src/jsstr.cpp
+++ b/js/src/jsstr.cpp
@@ -2373,7 +2373,7 @@ js::str_replace_string_raw(JSContext* cx, HandleString string, HandleString patt
}
// ES 2016 draft Mar 25, 2016 21.1.3.17 steps 4, 8, 12-18.
-static ArrayObject*
+static JSObject*
SplitHelper(JSContext* cx, HandleLinearString str, uint32_t limit, HandleLinearString sep,
HandleObjectGroup group)
{
@@ -2470,7 +2470,7 @@ SplitHelper(JSContext* cx, HandleLinearString str, uint32_t limit, HandleLinearS
}
// Fast-path for splitting a string into a character array via split("").
-static ArrayObject*
+static JSObject*
CharSplitHelper(JSContext* cx, HandleLinearString str, uint32_t limit, HandleObjectGroup group)
{
size_t strLength = str->length();
@@ -2495,7 +2495,7 @@ CharSplitHelper(JSContext* cx, HandleLinearString str, uint32_t limit, HandleObj
}
// ES 2016 draft Mar 25, 2016 21.1.3.17 steps 4, 8, 12-18.
-ArrayObject*
+JSObject*
js::str_split_string(JSContext* cx, HandleObjectGroup group, HandleString str, HandleString sep, uint32_t limit)
{
@@ -2906,8 +2906,8 @@ StringObject::assignInitialShape(ExclusiveContext* cx, Handle<StringObject*> obj
{
MOZ_ASSERT(obj->empty());
- return NativeObject::addDataProperty(cx, obj, cx->names().length, LENGTH_SLOT,
- JSPROP_PERMANENT | JSPROP_READONLY);
+ return obj->addDataProperty(cx, cx->names().length, LENGTH_SLOT,
+ JSPROP_PERMANENT | JSPROP_READONLY);
}
JSObject*
diff --git a/js/src/jsstr.h b/js/src/jsstr.h
index 68175c826..38fbfa85e 100644
--- a/js/src/jsstr.h
+++ b/js/src/jsstr.h
@@ -465,7 +465,7 @@ FileEscapedString(FILE* fp, const char* chars, size_t length, uint32_t quote)
return res;
}
-ArrayObject*
+JSObject*
str_split_string(JSContext* cx, HandleObjectGroup group, HandleString str, HandleString sep,
uint32_t limit);
diff --git a/js/src/moz.build b/js/src/moz.build
index 5287aef00..c0cef9929 100644
--- a/js/src/moz.build
+++ b/js/src/moz.build
@@ -355,6 +355,7 @@ UNIFIED_SOURCES += [
'vm/UbiNode.cpp',
'vm/UbiNodeCensus.cpp',
'vm/UbiNodeShortestPaths.cpp',
+ 'vm/UnboxedObject.cpp',
'vm/Unicode.cpp',
'vm/Value.cpp',
'vm/WeakMapPtr.cpp',
diff --git a/js/src/old-configure.in b/js/src/old-configure.in
index 6566ce05e..dc3d7da04 100644
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -435,6 +435,7 @@ LIB_SUFFIX=a
IMPORT_LIB_SUFFIX=
DIRENT_INO=d_ino
MOZ_USER_DIR=".mozilla"
+MOZ_DEVTOOLS_SERVER=1
MOZ_FIX_LINK_PATHS="-Wl,-rpath-link,${DIST}/bin -Wl,-rpath-link,${prefix}/lib"
@@ -1905,6 +1906,20 @@ dnl =
dnl ========================================================
MOZ_ARG_HEADER(Misc. Options)
+dnl ========================================================
+dnl = Disable Mozilla Developer Tools (server)
+dnl ========================================================
+MOZ_ARG_DISABLE_BOOL(devtools-server,
+[ --disable-devtools-server Disable Mozilla Developer Tools (server)],
+ MOZ_DEVTOOLS_SERVER=,
+ MOZ_DEVTOOLS_SERVER=1)
+
+if test -n "$MOZ_DEVTOOLS_SERVER"; then
+ AC_DEFINE(MOZ_DEVTOOLS_SERVER)
+fi
+
+AC_SUBST(MOZ_DEVTOOLS_SERVER)
+
if test -z "$SKIP_COMPILER_CHECKS"; then
dnl ========================================================
dnl =
@@ -2157,7 +2172,6 @@ HOST_CXXFLAGS=`echo \
$HOST_CXXFLAGS`
AC_SUBST(_DEPEND_CFLAGS)
-AC_SUBST(MOZ_SYSTEM_NSPR)
OS_CFLAGS="$CFLAGS"
OS_CXXFLAGS="$CXXFLAGS"
diff --git a/js/src/shell/js.cpp b/js/src/shell/js.cpp
index 36558a694..8cd821b31 100644
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -317,6 +317,7 @@ static bool enableIon = false;
static bool enableAsmJS = false;
static bool enableWasm = false;
static bool enableNativeRegExp = false;
+static bool enableUnboxedArrays = false;
static bool enableSharedMemory = SHARED_MEMORY_DEFAULT;
static bool enableWasmAlwaysBaseline = false;
static bool enableArrayProtoValues = true;
@@ -7090,6 +7091,7 @@ NewGlobalObject(JSContext* cx, JS::CompartmentOptions& options,
if (!DefineOS(cx, glob, fuzzingSafe, &gOutFile, &gErrFile))
return nullptr;
+#ifdef MOZ_DEVTOOLS_SERVER
RootedObject performanceObj(cx, JS_NewObject(cx, nullptr));
if (!performanceObj)
return nullptr;
@@ -7105,6 +7107,7 @@ NewGlobalObject(JSContext* cx, JS::CompartmentOptions& options,
return nullptr;
if (!JS_DefineProperty(cx, mozMemoryObj, "gc", gcObj, JSPROP_ENUMERATE))
return nullptr;
+#endif
/* Initialize FakeDOMObject. */
static const js::DOMCallbacks DOMcallbacks = {
@@ -7260,6 +7263,7 @@ SetContextOptions(JSContext* cx, const OptionParser& op)
enableAsmJS = !op.getBoolOption("no-asmjs");
enableWasm = !op.getBoolOption("no-wasm");
enableNativeRegExp = !op.getBoolOption("no-native-regexp");
+ enableUnboxedArrays = op.getBoolOption("unboxed-arrays");
enableWasmAlwaysBaseline = op.getBoolOption("wasm-always-baseline");
enableArrayProtoValues = !op.getBoolOption("no-array-proto-values");
@@ -7269,11 +7273,15 @@ SetContextOptions(JSContext* cx, const OptionParser& op)
.setWasm(enableWasm)
.setWasmAlwaysBaseline(enableWasmAlwaysBaseline)
.setNativeRegExp(enableNativeRegExp)
+ .setUnboxedArrays(enableUnboxedArrays)
.setArrayProtoValues(enableArrayProtoValues);
if (op.getBoolOption("wasm-check-bce"))
jit::JitOptions.wasmAlwaysCheckBounds = true;
+ if (op.getBoolOption("no-unboxed-objects"))
+ jit::JitOptions.disableUnboxedObjects = true;
+
if (const char* str = op.getStringOption("cache-ir-stubs")) {
if (strcmp(str, "on") == 0)
jit::JitOptions.disableCacheIR = false;
@@ -7537,6 +7545,7 @@ SetWorkerContextOptions(JSContext* cx)
.setWasm(enableWasm)
.setWasmAlwaysBaseline(enableWasmAlwaysBaseline)
.setNativeRegExp(enableNativeRegExp)
+ .setUnboxedArrays(enableUnboxedArrays)
.setArrayProtoValues(enableArrayProtoValues);
cx->setOffthreadIonCompilationEnabled(offthreadCompilation);
cx->profilingScripts = enableCodeCoverage || enableDisassemblyDumps;
@@ -7706,6 +7715,8 @@ main(int argc, char** argv, char** envp)
|| !op.addBoolOption('\0', "no-asmjs", "Disable asm.js compilation")
|| !op.addBoolOption('\0', "no-wasm", "Disable WebAssembly compilation")
|| !op.addBoolOption('\0', "no-native-regexp", "Disable native regexp compilation")
+ || !op.addBoolOption('\0', "no-unboxed-objects", "Disable creating unboxed plain objects")
+ || !op.addBoolOption('\0', "unboxed-arrays", "Allow creating unboxed arrays")
|| !op.addBoolOption('\0', "wasm-always-baseline", "Enable wasm baseline compiler when possible")
|| !op.addBoolOption('\0', "wasm-check-bce", "Always generate wasm bounds check, even redundant ones.")
|| !op.addBoolOption('\0', "no-array-proto-values", "Remove Array.prototype.values")
diff --git a/js/src/tests/js1_8_5/reflect-parse/statements.js b/js/src/tests/js1_8_5/reflect-parse/statements.js
index 1df86508b..11c1b88b4 100644
--- a/js/src/tests/js1_8_5/reflect-parse/statements.js
+++ b/js/src/tests/js1_8_5/reflect-parse/statements.js
@@ -77,7 +77,16 @@ assertStmt("try { } catch (e if foo) { } catch (e if bar) { } catch (e) { } fina
catchClause(ident("e"), ident("bar"), blockStmt([])) ],
catchClause(ident("e"), null, blockStmt([])),
blockStmt([])));
-
+assertStmt("try { } catch { }",
+ tryStmt(blockStmt([]),
+ [],
+ catchClause(null, null, blockStmt([])),
+ null));
+assertStmt("try { } catch { } finally { }",
+ tryStmt(blockStmt([]),
+ [],
+ catchClause(null, null, blockStmt([])),
+ blockStmt([])));
// Bug 632028: yield outside of a function should throw
(function() {
diff --git a/js/src/vm/CommonPropertyNames.h b/js/src/vm/CommonPropertyNames.h
index 6a8afb56b..420ee7535 100644
--- a/js/src/vm/CommonPropertyNames.h
+++ b/js/src/vm/CommonPropertyNames.h
@@ -281,13 +281,8 @@
macro(proxy, proxy, "proxy") \
macro(raw, raw, "raw") \
macro(reason, reason, "reason") \
- macro(RegExpBuiltinExec, RegExpBuiltinExec, "RegExpBuiltinExec") \
macro(RegExpFlagsGetter, RegExpFlagsGetter, "RegExpFlagsGetter") \
- macro(RegExpMatcher, RegExpMatcher, "RegExpMatcher") \
- macro(RegExpSearcher, RegExpSearcher, "RegExpSearcher") \
macro(RegExpStringIterator, RegExpStringIterator, "RegExp String Iterator") \
- macro(RegExpTester, RegExpTester, "RegExpTester") \
- macro(RegExp_prototype_Exec, RegExp_prototype_Exec, "RegExp_prototype_Exec") \
macro(Reify, Reify, "Reify") \
macro(reject, reject, "reject") \
macro(rejected, rejected, "rejected") \
@@ -360,7 +355,6 @@
macro(uninitialized, uninitialized, "uninitialized") \
macro(unsized, unsized, "unsized") \
macro(unwatch, unwatch, "unwatch") \
- macro(UnwrapAndCallRegExpBuiltinExec, UnwrapAndCallRegExpBuiltinExec, "UnwrapAndCallRegExpBuiltinExec") \
macro(url, url, "url") \
macro(usage, usage, "usage") \
macro(useAsm, useAsm, "use asm") \
diff --git a/js/src/vm/ErrorObject.cpp b/js/src/vm/ErrorObject.cpp
index 271132801..d8d29830b 100644
--- a/js/src/vm/ErrorObject.cpp
+++ b/js/src/vm/ErrorObject.cpp
@@ -29,11 +29,11 @@ js::ErrorObject::assignInitialShape(ExclusiveContext* cx, Handle<ErrorObject*> o
{
MOZ_ASSERT(obj->empty());
- if (!NativeObject::addDataProperty(cx, obj, cx->names().fileName, FILENAME_SLOT, 0))
+ if (!obj->addDataProperty(cx, cx->names().fileName, FILENAME_SLOT, 0))
return nullptr;
- if (!NativeObject::addDataProperty(cx, obj, cx->names().lineNumber, LINENUMBER_SLOT, 0))
+ if (!obj->addDataProperty(cx, cx->names().lineNumber, LINENUMBER_SLOT, 0))
return nullptr;
- return NativeObject::addDataProperty(cx, obj, cx->names().columnNumber, COLUMNNUMBER_SLOT, 0);
+ return obj->addDataProperty(cx, cx->names().columnNumber, COLUMNNUMBER_SLOT, 0);
}
/* static */ bool
@@ -57,7 +57,7 @@ js::ErrorObject::init(JSContext* cx, Handle<ErrorObject*> obj, JSExnType type,
// |new Error()|.
RootedShape messageShape(cx);
if (message) {
- messageShape = NativeObject::addDataProperty(cx, obj, cx->names().message, MESSAGE_SLOT, 0);
+ messageShape = obj->addDataProperty(cx, cx->names().message, MESSAGE_SLOT, 0);
if (!messageShape)
return false;
MOZ_ASSERT(messageShape->slot() == MESSAGE_SLOT);
diff --git a/js/src/vm/Interpreter-inl.h b/js/src/vm/Interpreter-inl.h
index acfa8f74b..0e81dfef4 100644
--- a/js/src/vm/Interpreter-inl.h
+++ b/js/src/vm/Interpreter-inl.h
@@ -22,6 +22,7 @@
#include "vm/EnvironmentObject-inl.h"
#include "vm/Stack-inl.h"
#include "vm/String-inl.h"
+#include "vm/UnboxedObject-inl.h"
namespace js {
@@ -336,10 +337,14 @@ InitGlobalLexicalOperation(JSContext* cx, LexicalEnvironmentObject* lexicalEnvAr
inline bool
InitPropertyOperation(JSContext* cx, JSOp op, HandleObject obj, HandleId id, HandleValue rhs)
{
- MOZ_ASSERT(obj->is<PlainObject>() || obj->is<JSFunction>());
- unsigned propAttrs = GetInitDataPropAttrs(op);
- return NativeDefineProperty(cx, obj.as<NativeObject>(), id, rhs,
- nullptr, nullptr, propAttrs);
+ if (obj->is<PlainObject>() || obj->is<JSFunction>()) {
+ unsigned propAttrs = GetInitDataPropAttrs(op);
+ return NativeDefineProperty(cx, obj.as<NativeObject>(), id, rhs, nullptr, nullptr,
+ propAttrs);
+ }
+
+ MOZ_ASSERT(obj->as<UnboxedPlainObject>().layout().lookup(id));
+ return PutProperty(cx, obj, id, rhs, false);
}
inline bool
@@ -593,7 +598,7 @@ InitArrayElemOperation(JSContext* cx, jsbytecode* pc, HandleObject obj, uint32_t
JSOp op = JSOp(*pc);
MOZ_ASSERT(op == JSOP_INITELEM_ARRAY || op == JSOP_INITELEM_INC);
- MOZ_ASSERT(obj->is<ArrayObject>());
+ MOZ_ASSERT(obj->is<ArrayObject>() || obj->is<UnboxedArrayObject>());
if (op == JSOP_INITELEM_INC && index == INT32_MAX) {
JS_ReportErrorNumberASCII(cx, GetErrorMessage, nullptr, JSMSG_SPREAD_TOO_LARGE);
diff --git a/js/src/vm/Interpreter.cpp b/js/src/vm/Interpreter.cpp
index 3cf9b57f6..274392335 100644
--- a/js/src/vm/Interpreter.cpp
+++ b/js/src/vm/Interpreter.cpp
@@ -1939,7 +1939,6 @@ CASE(EnableInterruptsPseudoOpcode)
/* Various 1-byte no-ops. */
CASE(JSOP_NOP)
CASE(JSOP_NOP_DESTRUCTURING)
-CASE(JSOP_UNUSED126)
CASE(JSOP_UNUSED211)
CASE(JSOP_TRY_DESTRUCTURING_ITERCLOSE)
CASE(JSOP_UNUSED221)
@@ -3682,6 +3681,7 @@ CASE(JSOP_NEWINIT)
END_CASE(JSOP_NEWINIT)
CASE(JSOP_NEWARRAY)
+CASE(JSOP_SPREADCALLARRAY)
{
uint32_t length = GET_UINT32(REGS.pc);
JSObject* obj = NewArrayOperation(cx, script, REGS.pc, length);
@@ -4157,7 +4157,7 @@ CASE(JSOP_INITHOMEOBJECT)
/* Load the home object */
ReservedRooted<JSObject*> obj(&rootObject0);
obj = &REGS.sp[int(-2 - skipOver)].toObject();
- MOZ_ASSERT(obj->is<PlainObject>() || obj->is<JSFunction>());
+ MOZ_ASSERT(obj->is<PlainObject>() || obj->is<UnboxedPlainObject>() || obj->is<JSFunction>());
func->setExtendedSlot(FunctionExtended::METHOD_HOMEOBJECT_SLOT, ObjectValue(*obj));
}
@@ -4973,13 +4973,18 @@ js::NewObjectOperation(JSContext* cx, HandleScript script, jsbytecode* pc,
return nullptr;
if (group->maybePreliminaryObjects()) {
group->maybePreliminaryObjects()->maybeAnalyze(cx, group);
+ if (group->maybeUnboxedLayout())
+ group->maybeUnboxedLayout()->setAllocationSite(script, pc);
}
if (group->shouldPreTenure() || group->maybePreliminaryObjects())
newKind = TenuredObject;
+
+ if (group->maybeUnboxedLayout())
+ return UnboxedPlainObject::create(cx, group, newKind);
}
- RootedPlainObject obj(cx);
+ RootedObject obj(cx);
if (*pc == JSOP_NEWOBJECT) {
RootedPlainObject baseObject(cx, &script->getObject(pc)->as<PlainObject>());
@@ -5016,6 +5021,11 @@ js::NewObjectOperationWithTemplate(JSContext* cx, HandleObject templateObject)
NewObjectKind newKind = templateObject->group()->shouldPreTenure() ? TenuredObject : GenericObject;
+ if (templateObject->group()->maybeUnboxedLayout()) {
+ RootedObjectGroup group(cx, templateObject->group());
+ return UnboxedPlainObject::create(cx, group, newKind);
+ }
+
JSObject* obj = CopyInitializerObject(cx, templateObject.as<PlainObject>(), newKind);
if (!obj)
return nullptr;
@@ -5042,6 +5052,9 @@ js::NewArrayOperation(JSContext* cx, HandleScript script, jsbytecode* pc, uint32
if (group->shouldPreTenure() || group->maybePreliminaryObjects())
newKind = TenuredObject;
+
+ if (group->maybeUnboxedLayout())
+ return UnboxedArrayObject::create(cx, group, length, newKind);
}
ArrayObject* obj = NewDenseFullyAllocatedArray(cx, length, nullptr, newKind);
@@ -5052,6 +5065,9 @@ js::NewArrayOperation(JSContext* cx, HandleScript script, jsbytecode* pc, uint32
MOZ_ASSERT(obj->isSingleton());
} else {
obj->setGroup(group);
+
+ if (PreliminaryObjectArray* preliminaryObjects = group->maybePreliminaryObjects())
+ preliminaryObjects->registerNewObject(obj);
}
return obj;
@@ -5064,6 +5080,12 @@ js::NewArrayOperationWithTemplate(JSContext* cx, HandleObject templateObject)
NewObjectKind newKind = templateObject->group()->shouldPreTenure() ? TenuredObject : GenericObject;
+ if (templateObject->is<UnboxedArrayObject>()) {
+ uint32_t length = templateObject->as<UnboxedArrayObject>().length();
+ RootedObjectGroup group(cx, templateObject->group());
+ return UnboxedArrayObject::create(cx, group, length, newKind);
+ }
+
ArrayObject* obj = NewDenseFullyAllocatedArray(cx, templateObject->as<ArrayObject>().length(),
nullptr, newKind);
if (!obj)
diff --git a/js/src/vm/JSONParser.cpp b/js/src/vm/JSONParser.cpp
index e50da3bc4..01883bb15 100644
--- a/js/src/vm/JSONParser.cpp
+++ b/js/src/vm/JSONParser.cpp
@@ -606,8 +606,8 @@ JSONParserBase::finishArray(MutableHandleValue vp, ElementVector& elements)
{
MOZ_ASSERT(&elements == &stack.back().elements());
- ArrayObject* obj = ObjectGroup::newArrayObject(cx, elements.begin(), elements.length(),
- GenericObject);
+ JSObject* obj = ObjectGroup::newArrayObject(cx, elements.begin(), elements.length(),
+ GenericObject);
if (!obj)
return false;
diff --git a/js/src/vm/NativeObject-inl.h b/js/src/vm/NativeObject-inl.h
index 030d92c12..205d99aa2 100644
--- a/js/src/vm/NativeObject-inl.h
+++ b/js/src/vm/NativeObject-inl.h
@@ -235,38 +235,6 @@ NativeObject::ensureDenseElements(ExclusiveContext* cx, uint32_t index, uint32_t
return DenseElementResult::Success;
}
-inline DenseElementResult
-NativeObject::setOrExtendDenseElements(ExclusiveContext* cx, uint32_t start, const Value* vp,
- uint32_t count,
- ShouldUpdateTypes updateTypes)
-{
- if (denseElementsAreFrozen())
- return DenseElementResult::Incomplete;
-
- if (is<ArrayObject>() &&
- !as<ArrayObject>().lengthIsWritable() &&
- start + count >= as<ArrayObject>().length())
- {
- return DenseElementResult::Incomplete;
- }
-
- DenseElementResult result = ensureDenseElements(cx, start, count);
- if (result != DenseElementResult::Success)
- return result;
-
- if (is<ArrayObject>() && start + count >= as<ArrayObject>().length())
- as<ArrayObject>().setLengthInt32(start + count);
-
- if (updateTypes == ShouldUpdateTypes::DontUpdate && !shouldConvertDoubleElements()) {
- copyDenseElements(start, vp, count);
- } else {
- for (size_t i = 0; i < count; i++)
- setDenseElementWithType(cx, start + i, vp[i]);
- }
-
- return DenseElementResult::Success;
-}
-
inline Value
NativeObject::getDenseOrTypedArrayElement(uint32_t idx)
{
diff --git a/js/src/vm/NativeObject.cpp b/js/src/vm/NativeObject.cpp
index d801fad06..8b7543d12 100644
--- a/js/src/vm/NativeObject.cpp
+++ b/js/src/vm/NativeObject.cpp
@@ -388,6 +388,33 @@ NativeObject::setLastPropertyMakeNonNative(Shape* shape)
shape_ = shape;
}
+void
+NativeObject::setLastPropertyMakeNative(ExclusiveContext* cx, Shape* shape)
+{
+ MOZ_ASSERT(getClass()->isNative());
+ MOZ_ASSERT(shape->getObjectClass()->isNative());
+ MOZ_ASSERT(!shape->inDictionary());
+
+ // This method is used to convert unboxed objects into native objects. In
+ // this case, the shape_ field was previously used to store other data and
+ // this should be treated as an initialization.
+ shape_.init(shape);
+
+ slots_ = nullptr;
+ elements_ = emptyObjectElements;
+
+ size_t oldSpan = shape->numFixedSlots();
+ size_t newSpan = shape->slotSpan();
+
+ initializeSlotRange(0, oldSpan);
+
+ // A failure at this point will leave the object as a mutant, and we
+ // can't recover.
+ AutoEnterOOMUnsafeRegion oomUnsafe;
+ if (oldSpan != newSpan && !updateSlotsForSpan(cx, oldSpan, newSpan))
+ oomUnsafe.crash("NativeObject::setLastPropertyMakeNative");
+}
+
bool
NativeObject::setSlotSpan(ExclusiveContext* cx, uint32_t span)
{
@@ -994,22 +1021,23 @@ NativeObject::freeSlot(ExclusiveContext* cx, uint32_t slot)
setSlot(slot, UndefinedValue());
}
-/* static */ Shape*
-NativeObject::addDataProperty(ExclusiveContext* cx, HandleNativeObject obj,
- jsid idArg, uint32_t slot, unsigned attrs)
+Shape*
+NativeObject::addDataProperty(ExclusiveContext* cx, jsid idArg, uint32_t slot, unsigned attrs)
{
MOZ_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
+ RootedNativeObject self(cx, this);
RootedId id(cx, idArg);
- return addProperty(cx, obj, id, nullptr, nullptr, slot, attrs, 0);
+ return addProperty(cx, self, id, nullptr, nullptr, slot, attrs, 0);
}
-/* static */ Shape*
-NativeObject::addDataProperty(ExclusiveContext* cx, HandleNativeObject obj,
- HandlePropertyName name, uint32_t slot, unsigned attrs)
+Shape*
+NativeObject::addDataProperty(ExclusiveContext* cx, HandlePropertyName name,
+ uint32_t slot, unsigned attrs)
{
MOZ_ASSERT(!(attrs & (JSPROP_GETTER | JSPROP_SETTER)));
+ RootedNativeObject self(cx, this);
RootedId id(cx, NameToId(name));
- return addProperty(cx, obj, id, nullptr, nullptr, slot, attrs, 0);
+ return addProperty(cx, self, id, nullptr, nullptr, slot, attrs, 0);
}
template <AllowGC allowGC>
diff --git a/js/src/vm/NativeObject.h b/js/src/vm/NativeObject.h
index 9cc6d5436..3a3e50244 100644
--- a/js/src/vm/NativeObject.h
+++ b/js/src/vm/NativeObject.h
@@ -339,19 +339,16 @@ IsObjectValueInCompartment(const Value& v, JSCompartment* comp);
#endif
// Operations which change an object's dense elements can either succeed, fail,
-// or be unable to complete. The latter is used when the object's elements must
-// become sparse instead. The enum below is used for such operations.
+// or be unable to complete. For native objects, the latter is used when the
+// object's elements must become sparse instead. The enum below is used for
+// such operations, and for similar operations on unboxed arrays and methods
+// that work on both kinds of objects.
enum class DenseElementResult {
Failure,
Success,
Incomplete
};
-enum class ShouldUpdateTypes {
- Update,
- DontUpdate
-};
-
/*
* NativeObject specifies the internal implementation of a native object.
*
@@ -470,6 +467,11 @@ class NativeObject : public ShapedObject
// that are (temporarily) inconsistent.
void setLastPropertyMakeNonNative(Shape* shape);
+ // As for setLastProperty(), but changes the class associated with the
+ // object to a native one. The object's type has already been changed, and
+ // this brings the shape into sync with it.
+ void setLastPropertyMakeNative(ExclusiveContext* cx, Shape* shape);
+
// Newly-created TypedArrays that map a SharedArrayBuffer are
// marked as shared by giving them an ObjectElements that has the
// ObjectElements::SHARED_MEMORY flag set.
@@ -744,10 +746,10 @@ class NativeObject : public ShapedObject
bool allowDictionary = true);
/* Add a data property whose id is not yet in this scope. */
- static Shape* addDataProperty(ExclusiveContext* cx, HandleNativeObject obj,
- jsid id_, uint32_t slot, unsigned attrs);
- static Shape* addDataProperty(ExclusiveContext* cx, HandleNativeObject obj,
- HandlePropertyName name, uint32_t slot, unsigned attrs);
+ Shape* addDataProperty(ExclusiveContext* cx,
+ jsid id_, uint32_t slot, unsigned attrs);
+ Shape* addDataProperty(ExclusiveContext* cx, HandlePropertyName name,
+ uint32_t slot, unsigned attrs);
/* Add or overwrite a property for id in this scope. */
static Shape*
@@ -1149,10 +1151,6 @@ class NativeObject : public ShapedObject
elementsRangeWriteBarrierPost(dstStart, count);
}
- inline DenseElementResult
- setOrExtendDenseElements(ExclusiveContext* cx, uint32_t start, const Value* vp, uint32_t count,
- ShouldUpdateTypes updateTypes = ShouldUpdateTypes::Update);
-
bool shouldConvertDoubleElements() {
return getElementsHeader()->shouldConvertDoubleElements();
}
diff --git a/js/src/vm/ObjectGroup-inl.h b/js/src/vm/ObjectGroup-inl.h
index d41343be6..9074f4d97 100644
--- a/js/src/vm/ObjectGroup-inl.h
+++ b/js/src/vm/ObjectGroup-inl.h
@@ -108,6 +108,20 @@ ObjectGroup::maybePreliminaryObjects()
return maybePreliminaryObjectsDontCheckGeneration();
}
+inline UnboxedLayout*
+ObjectGroup::maybeUnboxedLayout()
+{
+ maybeSweep(nullptr);
+ return maybeUnboxedLayoutDontCheckGeneration();
+}
+
+inline UnboxedLayout&
+ObjectGroup::unboxedLayout()
+{
+ maybeSweep(nullptr);
+ return unboxedLayoutDontCheckGeneration();
+}
+
} // namespace js
#endif /* vm_ObjectGroup_inl_h */
diff --git a/js/src/vm/ObjectGroup.cpp b/js/src/vm/ObjectGroup.cpp
index 91070b3f6..d05a48646 100644
--- a/js/src/vm/ObjectGroup.cpp
+++ b/js/src/vm/ObjectGroup.cpp
@@ -18,10 +18,11 @@
#include "vm/ArrayObject.h"
#include "vm/Shape.h"
#include "vm/TaggedProto.h"
+#include "vm/UnboxedObject.h"
#include "jsobjinlines.h"
-#include "vm/NativeObject-inl.h"
+#include "vm/UnboxedObject-inl.h"
using namespace js;
@@ -55,6 +56,7 @@ ObjectGroup::finalize(FreeOp* fop)
if (newScriptDontCheckGeneration())
newScriptDontCheckGeneration()->clear();
fop->delete_(newScriptDontCheckGeneration());
+ fop->delete_(maybeUnboxedLayoutDontCheckGeneration());
if (maybePreliminaryObjectsDontCheckGeneration())
maybePreliminaryObjectsDontCheckGeneration()->clear();
fop->delete_(maybePreliminaryObjectsDontCheckGeneration());
@@ -81,6 +83,8 @@ ObjectGroup::sizeOfExcludingThis(mozilla::MallocSizeOf mallocSizeOf) const
size_t n = 0;
if (TypeNewScript* newScript = newScriptDontCheckGeneration())
n += newScript->sizeOfIncludingThis(mallocSizeOf);
+ if (UnboxedLayout* layout = maybeUnboxedLayoutDontCheckGeneration())
+ n += layout->sizeOfIncludingThis(mallocSizeOf);
return n;
}
@@ -529,7 +533,8 @@ ObjectGroup::defaultNewGroup(ExclusiveContext* cx, const Class* clasp,
if (p) {
ObjectGroup* group = p->group;
MOZ_ASSERT_IF(clasp, group->clasp() == clasp);
- MOZ_ASSERT_IF(!clasp, group->clasp() == &PlainObject::class_);
+ MOZ_ASSERT_IF(!clasp, group->clasp() == &PlainObject::class_ ||
+ group->clasp() == &UnboxedPlainObject::class_);
MOZ_ASSERT(group->proto() == proto);
return group;
}
@@ -772,7 +777,7 @@ GetValueTypeForTable(const Value& v)
return type;
}
-/* static */ ArrayObject*
+/* static */ JSObject*
ObjectGroup::newArrayObject(ExclusiveContext* cx,
const Value* vp, size_t length,
NewObjectKind newKind, NewArrayKind arrayKind)
@@ -836,13 +841,56 @@ ObjectGroup::newArrayObject(ExclusiveContext* cx,
AddTypePropertyId(cx, group, nullptr, JSID_VOID, elementType);
+ if (elementType != TypeSet::UnknownType()) {
+ // Keep track of the initial objects we create with this type.
+ // If the initial ones have a consistent shape and property types, we
+ // will try to use an unboxed layout for the group.
+ PreliminaryObjectArrayWithTemplate* preliminaryObjects =
+ cx->new_<PreliminaryObjectArrayWithTemplate>(nullptr);
+ if (!preliminaryObjects)
+ return nullptr;
+ group->setPreliminaryObjects(preliminaryObjects);
+ }
+
if (!p.add(cx, *table, ObjectGroupCompartment::ArrayObjectKey(elementType), group))
return nullptr;
}
// The type of the elements being added will already be reflected in type
- // information.
+ // information, but make sure when creating an unboxed array that the
+ // common element type is suitable for the unboxed representation.
ShouldUpdateTypes updateTypes = ShouldUpdateTypes::DontUpdate;
+ if (!MaybeAnalyzeBeforeCreatingLargeArray(cx, group, vp, length))
+ return nullptr;
+ if (group->maybePreliminaryObjects())
+ group->maybePreliminaryObjects()->maybeAnalyze(cx, group);
+ if (group->maybeUnboxedLayout()) {
+ switch (group->unboxedLayout().elementType()) {
+ case JSVAL_TYPE_BOOLEAN:
+ if (elementType != TypeSet::BooleanType())
+ updateTypes = ShouldUpdateTypes::Update;
+ break;
+ case JSVAL_TYPE_INT32:
+ if (elementType != TypeSet::Int32Type())
+ updateTypes = ShouldUpdateTypes::Update;
+ break;
+ case JSVAL_TYPE_DOUBLE:
+ if (elementType != TypeSet::Int32Type() && elementType != TypeSet::DoubleType())
+ updateTypes = ShouldUpdateTypes::Update;
+ break;
+ case JSVAL_TYPE_STRING:
+ if (elementType != TypeSet::StringType())
+ updateTypes = ShouldUpdateTypes::Update;
+ break;
+ case JSVAL_TYPE_OBJECT:
+ if (elementType != TypeSet::NullType() && !elementType.get().isObjectUnchecked())
+ updateTypes = ShouldUpdateTypes::Update;
+ break;
+ default:
+ MOZ_CRASH();
+ }
+ }
+
return NewCopiedArrayTryUseGroup(cx, group, vp, length, newKind, updateTypes);
}
@@ -852,15 +900,49 @@ GiveObjectGroup(ExclusiveContext* cx, JSObject* source, JSObject* target)
{
MOZ_ASSERT(source->group() != target->group());
- if (!target->is<ArrayObject>() || !source->is<ArrayObject>()) {
+ if (!target->is<ArrayObject>() && !target->is<UnboxedArrayObject>())
+ return true;
+
+ if (target->group()->maybePreliminaryObjects()) {
+ bool force = IsInsideNursery(source);
+ target->group()->maybePreliminaryObjects()->maybeAnalyze(cx, target->group(), force);
+ }
+
+ if (target->is<ArrayObject>()) {
+ ObjectGroup* sourceGroup = source->group();
+
+ if (source->is<UnboxedArrayObject>()) {
+ Shape* shape = target->as<ArrayObject>().lastProperty();
+ if (!UnboxedArrayObject::convertToNativeWithGroup(cx, source, target->group(), shape))
+ return false;
+ } else if (source->is<ArrayObject>()) {
+ source->setGroup(target->group());
+ } else {
+ return true;
+ }
+
+ if (sourceGroup->maybePreliminaryObjects())
+ sourceGroup->maybePreliminaryObjects()->unregisterObject(source);
+ if (target->group()->maybePreliminaryObjects())
+ target->group()->maybePreliminaryObjects()->registerNewObject(source);
+
+ for (size_t i = 0; i < source->as<ArrayObject>().getDenseInitializedLength(); i++) {
+ Value v = source->as<ArrayObject>().getDenseElement(i);
+ AddTypePropertyId(cx, source->group(), source, JSID_VOID, v);
+ }
+
return true;
}
- source->setGroup(target->group());
+ if (target->is<UnboxedArrayObject>()) {
+ if (!source->is<UnboxedArrayObject>())
+ return true;
+ if (source->as<UnboxedArrayObject>().elementType() != JSVAL_TYPE_INT32)
+ return true;
+ if (target->as<UnboxedArrayObject>().elementType() != JSVAL_TYPE_DOUBLE)
+ return true;
- for (size_t i = 0; i < source->as<ArrayObject>().getDenseInitializedLength(); i++) {
- Value v = source->as<ArrayObject>().getDenseElement(i);
- AddTypePropertyId(cx, source->group(), source, JSID_VOID, v);
+ return source->as<UnboxedArrayObject>().convertInt32ToDouble(cx, target->group());
}
return true;
@@ -969,6 +1051,46 @@ js::CombinePlainObjectPropertyTypes(ExclusiveContext* cx, JSObject* newObj,
}
}
}
+ } else if (newObj->is<UnboxedPlainObject>()) {
+ const UnboxedLayout& layout = newObj->as<UnboxedPlainObject>().layout();
+ const int32_t* traceList = layout.traceList();
+ if (!traceList)
+ return true;
+
+ uint8_t* newData = newObj->as<UnboxedPlainObject>().data();
+ uint8_t* oldData = oldObj->as<UnboxedPlainObject>().data();
+
+ for (; *traceList != -1; traceList++) {}
+ traceList++;
+ for (; *traceList != -1; traceList++) {
+ JSObject* newInnerObj = *reinterpret_cast<JSObject**>(newData + *traceList);
+ JSObject* oldInnerObj = *reinterpret_cast<JSObject**>(oldData + *traceList);
+
+ if (!newInnerObj || !oldInnerObj || SameGroup(oldInnerObj, newInnerObj))
+ continue;
+
+ if (!GiveObjectGroup(cx, newInnerObj, oldInnerObj))
+ return false;
+
+ if (SameGroup(oldInnerObj, newInnerObj))
+ continue;
+
+ if (!GiveObjectGroup(cx, oldInnerObj, newInnerObj))
+ return false;
+
+ if (SameGroup(oldInnerObj, newInnerObj)) {
+ for (size_t i = 1; i < ncompare; i++) {
+ if (compare[i].isObject() && SameGroup(&compare[i].toObject(), newObj)) {
+ uint8_t* otherData = compare[i].toObject().as<UnboxedPlainObject>().data();
+ JSObject* otherInnerObj = *reinterpret_cast<JSObject**>(otherData + *traceList);
+ if (otherInnerObj && !SameGroup(otherInnerObj, newInnerObj)) {
+ if (!GiveObjectGroup(cx, otherInnerObj, newInnerObj))
+ return false;
+ }
+ }
+ }
+ }
+ }
}
return true;
@@ -1192,6 +1314,12 @@ ObjectGroup::newPlainObject(ExclusiveContext* cx, IdValuePair* properties, size_
RootedObjectGroup group(cx, p->value().group);
+ // Watch for existing groups which now use an unboxed layout.
+ if (group->maybeUnboxedLayout()) {
+ MOZ_ASSERT(group->unboxedLayout().properties().length() == nproperties);
+ return UnboxedPlainObject::createWithProperties(cx, group, newKind, properties);
+ }
+
// Update property types according to the properties we are about to add.
// Do this before we do anything which can GC, which might move or remove
// this table entry.
@@ -1378,6 +1506,18 @@ ObjectGroup::allocationSiteGroup(JSContext* cx, JSScript* scriptArg, jsbytecode*
}
}
+ if (kind == JSProto_Array &&
+ (JSOp(*pc) == JSOP_NEWARRAY || IsCallPC(pc)) &&
+ cx->options().unboxedArrays())
+ {
+ PreliminaryObjectArrayWithTemplate* preliminaryObjects =
+ cx->new_<PreliminaryObjectArrayWithTemplate>(nullptr);
+ if (preliminaryObjects)
+ res->setPreliminaryObjects(preliminaryObjects);
+ else
+ cx->recoverFromOutOfMemory();
+ }
+
if (!table->add(p, key, res)) {
ReportOutOfMemory(cx);
return nullptr;
diff --git a/js/src/vm/ObjectGroup.h b/js/src/vm/ObjectGroup.h
index 0b6eaee51..4e24de9f1 100644
--- a/js/src/vm/ObjectGroup.h
+++ b/js/src/vm/ObjectGroup.h
@@ -20,6 +20,7 @@
namespace js {
class TypeDescr;
+class UnboxedLayout;
class PreliminaryObjectArrayWithTemplate;
class TypeNewScript;
@@ -153,6 +154,16 @@ class ObjectGroup : public gc::TenuredCell
// For some plain objects, the addendum stores a PreliminaryObjectArrayWithTemplate.
Addendum_PreliminaryObjects,
+ // When objects in this group have an unboxed representation, the
+ // addendum stores an UnboxedLayout (which might have a TypeNewScript
+ // as well, if the group is also constructed using 'new').
+ Addendum_UnboxedLayout,
+
+ // If this group is used by objects that have been converted from an
+ // unboxed representation and/or have the same allocation kind as such
+ // objects, the addendum points to that unboxed group.
+ Addendum_OriginalUnboxedGroup,
+
// When used by typed objects, the addendum stores a TypeDescr.
Addendum_TypeDescr
};
@@ -174,6 +185,7 @@ class ObjectGroup : public gc::TenuredCell
return nullptr;
}
+ TypeNewScript* anyNewScript();
void detachNewScript(bool writeBarrier, ObjectGroup* replacement);
ObjectGroupFlags flagsDontCheckGeneration() const {
@@ -213,6 +225,34 @@ class ObjectGroup : public gc::TenuredCell
maybePreliminaryObjectsDontCheckGeneration();
}
+ inline UnboxedLayout* maybeUnboxedLayout();
+ inline UnboxedLayout& unboxedLayout();
+
+ UnboxedLayout* maybeUnboxedLayoutDontCheckGeneration() const {
+ if (addendumKind() == Addendum_UnboxedLayout)
+ return reinterpret_cast<UnboxedLayout*>(addendum_);
+ return nullptr;
+ }
+
+ UnboxedLayout& unboxedLayoutDontCheckGeneration() const {
+ MOZ_ASSERT(addendumKind() == Addendum_UnboxedLayout);
+ return *maybeUnboxedLayoutDontCheckGeneration();
+ }
+
+ void setUnboxedLayout(UnboxedLayout* layout) {
+ setAddendum(Addendum_UnboxedLayout, layout);
+ }
+
+ ObjectGroup* maybeOriginalUnboxedGroup() const {
+ if (addendumKind() == Addendum_OriginalUnboxedGroup)
+ return reinterpret_cast<ObjectGroup*>(addendum_);
+ return nullptr;
+ }
+
+ void setOriginalUnboxedGroup(ObjectGroup* group) {
+ setAddendum(Addendum_OriginalUnboxedGroup, group);
+ }
+
TypeDescr* maybeTypeDescr() {
// Note: there is no need to sweep when accessing the type descriptor
// of an object, as it is strongly held and immutable.
@@ -273,8 +313,9 @@ class ObjectGroup : public gc::TenuredCell
* that can be read out of that property in actual JS objects. In native
* objects, property types account for plain data properties (those with a
* slot and no getter or setter hook) and dense elements. In typed objects
- * property types account for object and value properties and elements in
- * the object.
+ * and unboxed objects, property types account for object and value
+ * properties and elements in the object, and expando properties in unboxed
+ * objects.
*
* For accesses on these properties, the correspondence is as follows:
*
@@ -297,9 +338,10 @@ class ObjectGroup : public gc::TenuredCell
* 2. Array lengths are special cased by the compiler and VM and are not
* reflected in property types.
*
- * 3. In typed objects, the initial values of properties (null pointers and
- * undefined values) are not reflected in the property types. These
- * values are always possible when reading the property.
+ * 3. In typed objects (but not unboxed objects), the initial values of
+ * properties (null pointers and undefined values) are not reflected in
+ * the property types. These values are always possible when reading the
+ * property.
*
* We establish these by using write barriers on calls to setProperty and
* defineProperty which are on native properties, and on any jitcode which
@@ -413,6 +455,12 @@ class ObjectGroup : public gc::TenuredCell
return &flags_;
}
+ // Get the bit pattern stored in an object's addendum when it has an
+ // original unboxed group.
+ static inline int32_t addendumOriginalUnboxedGroupValue() {
+ return Addendum_OriginalUnboxedGroup << OBJECT_FLAG_ADDENDUM_SHIFT;
+ }
+
inline uint32_t basePropertyCount();
private:
@@ -457,14 +505,14 @@ class ObjectGroup : public gc::TenuredCell
UnknownIndex // Make an array with an unknown element type.
};
- // Create an ArrayObject with the specified elements and a group specialized
- // for the elements.
- static ArrayObject* newArrayObject(ExclusiveContext* cx, const Value* vp, size_t length,
- NewObjectKind newKind,
- NewArrayKind arrayKind = NewArrayKind::Normal);
+ // Create an ArrayObject or UnboxedArrayObject with the specified elements
+ // and a group specialized for the elements.
+ static JSObject* newArrayObject(ExclusiveContext* cx, const Value* vp, size_t length,
+ NewObjectKind newKind,
+ NewArrayKind arrayKind = NewArrayKind::Normal);
- // Create a PlainObject with the specified properties and a group specialized
- // for those properties.
+ // Create a PlainObject or UnboxedPlainObject with the specified properties
+ // and a group specialized for those properties.
static JSObject* newPlainObject(ExclusiveContext* cx,
IdValuePair* properties, size_t nproperties,
NewObjectKind newKind);
diff --git a/js/src/vm/Opcodes.h b/js/src/vm/Opcodes.h
index e13cd6221..b26336815 100644
--- a/js/src/vm/Opcodes.h
+++ b/js/src/vm/Opcodes.h
@@ -1281,7 +1281,17 @@
* Stack: receiver, obj, propval => obj[propval]
*/ \
macro(JSOP_GETELEM_SUPER, 125, "getelem-super", NULL, 1, 3, 1, JOF_BYTE |JOF_ELEM|JOF_LEFTASSOC) \
- macro(JSOP_UNUSED126, 126, "unused126", NULL, 5, 0, 1, JOF_UINT32) \
+ /*
+ * Pushes newly created array for a spread call onto the stack. This has
+ * the same semantics as JSOP_NEWARRAY, but is distinguished to avoid
+ * using unboxed arrays in spread calls, which would make compiling spread
+ * calls in baseline more complex.
+ * Category: Literals
+ * Type: Array
+ * Operands: uint32_t length
+ * Stack: => obj
+ */ \
+ macro(JSOP_SPREADCALLARRAY, 126, "spreadcallarray", NULL, 5, 0, 1, JOF_UINT32) \
\
/*
* Defines the given function on the current scope.
diff --git a/js/src/vm/ReceiverGuard.cpp b/js/src/vm/ReceiverGuard.cpp
index e95e8a208..97df908c3 100644
--- a/js/src/vm/ReceiverGuard.cpp
+++ b/js/src/vm/ReceiverGuard.cpp
@@ -7,6 +7,7 @@
#include "vm/ReceiverGuard.h"
#include "builtin/TypedObject.h"
+#include "vm/UnboxedObject.h"
#include "jsobjinlines.h"
using namespace js;
@@ -15,7 +16,11 @@ ReceiverGuard::ReceiverGuard(JSObject* obj)
: group(nullptr), shape(nullptr)
{
if (obj) {
- if (obj->is<TypedObject>()) {
+ if (obj->is<UnboxedPlainObject>()) {
+ group = obj->group();
+ if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando())
+ shape = expando->lastProperty();
+ } else if (obj->is<UnboxedArrayObject>() || obj->is<TypedObject>()) {
group = obj->group();
} else {
shape = obj->maybeShape();
@@ -28,7 +33,9 @@ ReceiverGuard::ReceiverGuard(ObjectGroup* group, Shape* shape)
{
if (group) {
const Class* clasp = group->clasp();
- if (IsTypedObjectClass(clasp)) {
+ if (clasp == &UnboxedPlainObject::class_) {
+ // Keep both group and shape.
+ } else if (clasp == &UnboxedArrayObject::class_ || IsTypedObjectClass(clasp)) {
this->shape = nullptr;
} else {
this->group = nullptr;
@@ -39,8 +46,12 @@ ReceiverGuard::ReceiverGuard(ObjectGroup* group, Shape* shape)
/* static */ int32_t
HeapReceiverGuard::keyBits(JSObject* obj)
{
- if (obj->is<TypedObject>()) {
- // Only the group needs to be guarded for typed objects.
+ if (obj->is<UnboxedPlainObject>()) {
+ // Both the group and shape need to be guarded for unboxed plain objects.
+ return obj->as<UnboxedPlainObject>().maybeExpando() ? 0 : 1;
+ }
+ if (obj->is<UnboxedArrayObject>() || obj->is<TypedObject>()) {
+ // Only the group needs to be guarded for unboxed arrays and typed objects.
return 2;
}
// Other objects only need the shape to be guarded.
diff --git a/js/src/vm/ReceiverGuard.h b/js/src/vm/ReceiverGuard.h
index c14f0d83b..459cc0012 100644
--- a/js/src/vm/ReceiverGuard.h
+++ b/js/src/vm/ReceiverGuard.h
@@ -28,6 +28,11 @@ namespace js {
// TypedObject: The structure of a typed object is determined by its group.
// All typed objects with the same group have the same class, prototype, and
// own properties.
+//
+// UnboxedPlainObject: The structure of an unboxed plain object is determined
+// by its group and its expando object's shape, if there is one. All unboxed
+// plain objects with the same group and expando shape have the same
+// properties except those stored in the expando's dense elements.
class HeapReceiverGuard;
class RootedReceiverGuard;
diff --git a/js/src/vm/RegExpObject.cpp b/js/src/vm/RegExpObject.cpp
index cd0b54c9d..6223fc10d 100644
--- a/js/src/vm/RegExpObject.cpp
+++ b/js/src/vm/RegExpObject.cpp
@@ -299,8 +299,7 @@ RegExpObject::assignInitialShape(ExclusiveContext* cx, Handle<RegExpObject*> sel
JS_STATIC_ASSERT(LAST_INDEX_SLOT == 0);
/* The lastIndex property alone is writable but non-configurable. */
- return NativeObject::addDataProperty(cx, self, cx->names().lastIndex, LAST_INDEX_SLOT,
- JSPROP_PERMANENT);
+ return self->addDataProperty(cx, cx->names().lastIndex, LAST_INDEX_SLOT, JSPROP_PERMANENT);
}
void
diff --git a/js/src/vm/Stack.cpp b/js/src/vm/Stack.cpp
index 95940eeaf..7eb8f4ab8 100644
--- a/js/src/vm/Stack.cpp
+++ b/js/src/vm/Stack.cpp
@@ -82,7 +82,7 @@ InterpreterFrame::isNonGlobalEvalFrame() const
return isEvalFrame() && script()->bodyScope()->as<EvalScope>().isNonGlobal();
}
-ArrayObject*
+JSObject*
InterpreterFrame::createRestParameter(JSContext* cx)
{
MOZ_ASSERT(script()->hasRest());
diff --git a/js/src/vm/Stack.h b/js/src/vm/Stack.h
index fe04a00f2..d08544213 100644
--- a/js/src/vm/Stack.h
+++ b/js/src/vm/Stack.h
@@ -523,7 +523,7 @@ class InterpreterFrame
ArgumentsObject& argsObj() const;
void initArgsObj(ArgumentsObject& argsobj);
- ArrayObject* createRestParameter(JSContext* cx);
+ JSObject* createRestParameter(JSContext* cx);
/*
* Environment chain
diff --git a/js/src/vm/TypeInference-inl.h b/js/src/vm/TypeInference-inl.h
index 2af252cea..da47fa898 100644
--- a/js/src/vm/TypeInference-inl.h
+++ b/js/src/vm/TypeInference-inl.h
@@ -23,6 +23,7 @@
#include "vm/SharedArrayObject.h"
#include "vm/StringObject.h"
#include "vm/TypedArrayObject.h"
+#include "vm/UnboxedObject.h"
#include "jscntxtinlines.h"
@@ -284,6 +285,10 @@ TypeIdString(jsid id)
*/
struct AutoEnterAnalysis
{
+ // For use when initializing an UnboxedLayout. The UniquePtr's destructor
+ // must run when GC is not suppressed.
+ UniquePtr<UnboxedLayout> unboxedLayoutToCleanUp;
+
// Prevent GC activity in the middle of analysis.
gc::AutoSuppressGC suppressGC;
diff --git a/js/src/vm/TypeInference.cpp b/js/src/vm/TypeInference.cpp
index 2b1fa0e3b..438188a36 100644
--- a/js/src/vm/TypeInference.cpp
+++ b/js/src/vm/TypeInference.cpp
@@ -35,6 +35,7 @@
#include "vm/Opcodes.h"
#include "vm/Shape.h"
#include "vm/Time.h"
+#include "vm/UnboxedObject.h"
#include "jsatominlines.h"
#include "jsscriptinlines.h"
@@ -296,6 +297,9 @@ js::ObjectGroupHasProperty(JSContext* cx, ObjectGroup* group, jsid id, const Val
return true;
}
}
+ JSObject* obj = &value.toObject();
+ if (!obj->hasLazyGroup() && obj->group()->maybeOriginalUnboxedGroup())
+ return true;
}
if (!types->hasType(type)) {
@@ -1944,6 +1948,33 @@ class ConstraintDataFreezeObjectForTypedArrayData
}
};
+// Constraint which triggers recompilation if an unboxed object in some group
+// is converted to a native object.
+class ConstraintDataFreezeObjectForUnboxedConvertedToNative
+{
+ public:
+ ConstraintDataFreezeObjectForUnboxedConvertedToNative()
+ {}
+
+ const char* kind() { return "freezeObjectForUnboxedConvertedToNative"; }
+
+ bool invalidateOnNewType(TypeSet::Type type) { return false; }
+ bool invalidateOnNewPropertyState(TypeSet* property) { return false; }
+ bool invalidateOnNewObjectState(ObjectGroup* group) {
+ return group->unboxedLayout().nativeGroup() != nullptr;
+ }
+
+ bool constraintHolds(JSContext* cx,
+ const HeapTypeSetKey& property, TemporaryTypeSet* expected)
+ {
+ return !invalidateOnNewObjectState(property.object()->maybeGroup());
+ }
+
+ bool shouldSweep() { return false; }
+
+ JSCompartment* maybeCompartment() { return nullptr; }
+};
+
} /* anonymous namespace */
void
@@ -1968,6 +1999,17 @@ TypeSet::ObjectKey::watchStateChangeForTypedArrayData(CompilerConstraintList* co
ConstraintDataFreezeObjectForTypedArrayData(tarray)));
}
+void
+TypeSet::ObjectKey::watchStateChangeForUnboxedConvertedToNative(CompilerConstraintList* constraints)
+{
+ HeapTypeSetKey objectProperty = property(JSID_EMPTY);
+ LifoAlloc* alloc = constraints->alloc();
+
+ typedef CompilerConstraintInstance<ConstraintDataFreezeObjectForUnboxedConvertedToNative> T;
+ constraints->add(alloc->new_<T>(alloc, objectProperty,
+ ConstraintDataFreezeObjectForUnboxedConvertedToNative()));
+}
+
static void
ObjectStateChange(ExclusiveContext* cxArg, ObjectGroup* group, bool markingUnknown)
{
@@ -2478,6 +2520,8 @@ TemporaryTypeSet::propertyNeedsBarrier(CompilerConstraintList* constraints, jsid
bool
js::ClassCanHaveExtraProperties(const Class* clasp)
{
+ if (clasp == &UnboxedPlainObject::class_ || clasp == &UnboxedArrayObject::class_)
+ return false;
return clasp->getResolve()
|| clasp->getOpsLookupProperty()
|| clasp->getOpsGetProperty()
@@ -2768,6 +2812,15 @@ js::AddTypePropertyId(ExclusiveContext* cx, ObjectGroup* group, JSObject* obj, j
// from acquiring the fully initialized group.
if (group->newScript() && group->newScript()->initializedGroup())
AddTypePropertyId(cx, group->newScript()->initializedGroup(), nullptr, id, type);
+
+ // Maintain equivalent type information for unboxed object groups and their
+ // corresponding native group. Since type sets might contain the unboxed
+ // group but not the native group, this ensures optimizations based on the
+ // unboxed group are valid for the native group.
+ if (group->maybeUnboxedLayout() && group->maybeUnboxedLayout()->nativeGroup())
+ AddTypePropertyId(cx, group->maybeUnboxedLayout()->nativeGroup(), nullptr, id, type);
+ if (ObjectGroup* unboxedGroup = group->maybeOriginalUnboxedGroup())
+ AddTypePropertyId(cx, unboxedGroup, nullptr, id, type);
}
void
@@ -2839,6 +2892,12 @@ ObjectGroup::setFlags(ExclusiveContext* cx, ObjectGroupFlags flags)
// acquired properties analysis.
if (newScript() && newScript()->initializedGroup())
newScript()->initializedGroup()->setFlags(cx, flags);
+
+ // Propagate flag changes between unboxed and corresponding native groups.
+ if (maybeUnboxedLayout() && maybeUnboxedLayout()->nativeGroup())
+ maybeUnboxedLayout()->nativeGroup()->setFlags(cx, flags);
+ if (ObjectGroup* unboxedGroup = maybeOriginalUnboxedGroup())
+ unboxedGroup->setFlags(cx, flags);
}
void
@@ -2871,6 +2930,23 @@ ObjectGroup::markUnknown(ExclusiveContext* cx)
prop->types.setNonDataProperty(cx);
}
}
+
+ if (ObjectGroup* unboxedGroup = maybeOriginalUnboxedGroup())
+ MarkObjectGroupUnknownProperties(cx, unboxedGroup);
+ if (maybeUnboxedLayout() && maybeUnboxedLayout()->nativeGroup())
+ MarkObjectGroupUnknownProperties(cx, maybeUnboxedLayout()->nativeGroup());
+ if (ObjectGroup* unboxedGroup = maybeOriginalUnboxedGroup())
+ MarkObjectGroupUnknownProperties(cx, unboxedGroup);
+}
+
+TypeNewScript*
+ObjectGroup::anyNewScript()
+{
+ if (newScript())
+ return newScript();
+ if (maybeUnboxedLayout())
+ return unboxedLayout().newScript();
+ return nullptr;
}
void
@@ -2880,7 +2956,7 @@ ObjectGroup::detachNewScript(bool writeBarrier, ObjectGroup* replacement)
// analyzed, remove it from the newObjectGroups table so that it will not be
// produced by calling 'new' on the associated function anymore.
// The TypeNewScript is not actually destroyed.
- TypeNewScript* newScript = this->newScript();
+ TypeNewScript* newScript = anyNewScript();
MOZ_ASSERT(newScript);
if (newScript->analyzed()) {
@@ -2899,7 +2975,10 @@ ObjectGroup::detachNewScript(bool writeBarrier, ObjectGroup* replacement)
MOZ_ASSERT(!replacement);
}
- setAddendum(Addendum_None, nullptr, writeBarrier);
+ if (this->newScript())
+ setAddendum(Addendum_None, nullptr, writeBarrier);
+ else
+ unboxedLayout().setNewScript(nullptr, writeBarrier);
}
void
@@ -2910,7 +2989,7 @@ ObjectGroup::maybeClearNewScriptOnOOM()
if (!isMarked())
return;
- TypeNewScript* newScript = this->newScript();
+ TypeNewScript* newScript = anyNewScript();
if (!newScript)
return;
@@ -2925,7 +3004,7 @@ ObjectGroup::maybeClearNewScriptOnOOM()
void
ObjectGroup::clearNewScript(ExclusiveContext* cx, ObjectGroup* replacement /* = nullptr*/)
{
- TypeNewScript* newScript = this->newScript();
+ TypeNewScript* newScript = anyNewScript();
if (!newScript)
return;
@@ -3332,7 +3411,7 @@ JSFunction::setTypeForScriptedFunction(ExclusiveContext* cx, HandleFunction fun,
/////////////////////////////////////////////////////////////////////
void
-PreliminaryObjectArray::registerNewObject(PlainObject* res)
+PreliminaryObjectArray::registerNewObject(JSObject* res)
{
// The preliminary object pointers are weak, and won't be swept properly
// during nursery collections, so the preliminary objects need to be
@@ -3350,7 +3429,7 @@ PreliminaryObjectArray::registerNewObject(PlainObject* res)
}
void
-PreliminaryObjectArray::unregisterObject(PlainObject* obj)
+PreliminaryObjectArray::unregisterObject(JSObject* obj)
{
for (size_t i = 0; i < COUNT; i++) {
if (objects[i] == obj) {
@@ -3390,6 +3469,22 @@ PreliminaryObjectArray::sweep()
for (size_t i = 0; i < COUNT; i++) {
JSObject** ptr = &objects[i];
if (*ptr && IsAboutToBeFinalizedUnbarriered(ptr)) {
+ // Before we clear this reference, change the object's group to the
+ // Object.prototype group. This is done to ensure JSObject::finalize
+ // sees a NativeObject Class even if we change the current group's
+ // Class to one of the unboxed object classes in the meantime. If
+ // the compartment's global is dead, we don't do anything as the
+ // group's Class is not going to change in that case.
+ JSObject* obj = *ptr;
+ GlobalObject* global = obj->compartment()->unsafeUnbarrieredMaybeGlobal();
+ if (global && !obj->isSingleton()) {
+ JSObject* objectProto = GetBuiltinPrototypePure(global, JSProto_Object);
+ obj->setGroup(objectProto->groupRaw());
+ MOZ_ASSERT(obj->is<NativeObject>());
+ MOZ_ASSERT(obj->getClass() == objectProto->getClass());
+ MOZ_ASSERT(!obj->getClass()->hasFinalize());
+ }
+
*ptr = nullptr;
}
}
@@ -3489,11 +3584,17 @@ PreliminaryObjectArrayWithTemplate::maybeAnalyze(ExclusiveContext* cx, ObjectGro
}
}
- // Since the preliminary objects still reflect the template object's
- // properties, and all objects in the future will be created with those
- // properties, the properties can be marked as definitive for objects in
- // the group.
- group->addDefiniteProperties(cx, shape());
+ TryConvertToUnboxedLayout(cx, enter, shape(), group, preliminaryObjects);
+ if (group->maybeUnboxedLayout())
+ return;
+
+ if (shape()) {
+ // We weren't able to use an unboxed layout, but since the preliminary
+ // objects still reflect the template object's properties, and all
+ // objects in the future will be created with those properties, the
+ // properties can be marked as definite for objects in the group.
+ group->addDefiniteProperties(cx, shape());
+ }
}
/////////////////////////////////////////////////////////////////////
@@ -3507,6 +3608,7 @@ TypeNewScript::make(JSContext* cx, ObjectGroup* group, JSFunction* fun)
{
MOZ_ASSERT(cx->zone()->types.activeAnalysis);
MOZ_ASSERT(!group->newScript());
+ MOZ_ASSERT(!group->maybeUnboxedLayout());
// rollbackPartiallyInitializedObjects expects function_ to be
// canonicalized.
@@ -3811,9 +3913,34 @@ TypeNewScript::maybeAnalyze(JSContext* cx, ObjectGroup* group, bool* regenerate,
PodCopy(initializerList, initializerVector.begin(), initializerVector.length());
}
+ // Try to use an unboxed representation for the group.
+ if (!TryConvertToUnboxedLayout(cx, enter, templateObject()->lastProperty(), group, preliminaryObjects))
+ return false;
+
js_delete(preliminaryObjects);
preliminaryObjects = nullptr;
+ if (group->maybeUnboxedLayout()) {
+ // An unboxed layout was constructed for the group, and this has already
+ // been hooked into it.
+ MOZ_ASSERT(group->unboxedLayout().newScript() == this);
+ destroyNewScript.group = nullptr;
+
+ // Clear out the template object, which is not used for TypeNewScripts
+ // with an unboxed layout. Currently it is a mutant object with a
+ // non-native group and native shape, so make it safe for GC by changing
+ // its group to the default for its prototype.
+ AutoEnterOOMUnsafeRegion oomUnsafe;
+ ObjectGroup* plainGroup = ObjectGroup::defaultNewGroup(cx, &PlainObject::class_,
+ group->proto());
+ if (!plainGroup)
+ oomUnsafe.crash("TypeNewScript::maybeAnalyze");
+ templateObject_->setGroup(plainGroup);
+ templateObject_ = nullptr;
+
+ return true;
+ }
+
if (prefixShape->slotSpan() == templateObject()->slotSpan()) {
// The definite properties analysis found exactly the properties that
// are held in common by the preliminary objects. No further analysis
@@ -3927,6 +4054,12 @@ TypeNewScript::rollbackPartiallyInitializedObjects(JSContext* cx, ObjectGroup* g
continue;
}
+ if (thisv.toObject().is<UnboxedPlainObject>()) {
+ AutoEnterOOMUnsafeRegion oomUnsafe;
+ if (!UnboxedPlainObject::convertToNative(cx, &thisv.toObject()))
+ oomUnsafe.crash("rollbackPartiallyInitializedObjects");
+ }
+
// Found a matching frame.
RootedPlainObject obj(cx, &thisv.toObject().as<PlainObject>());
@@ -4120,6 +4253,12 @@ ConstraintTypeSet::sweep(Zone* zone, AutoClearTypeInferenceStateOnOOM& oom)
// Object sets containing objects with unknown properties might
// not be complete. Mark the type set as unknown, which it will
// be treated as during Ion compilation.
+ //
+ // Note that we don't have to do this when the type set might
+ // be missing the native group corresponding to an unboxed
+ // object group. In this case, the native group points to the
+ // unboxed object group via its addendum, so as long as objects
+ // with either group exist, neither group will be finalized.
flags |= TYPE_FLAG_ANYOBJECT;
clearObjects();
objectCount = 0;
@@ -4203,6 +4342,21 @@ ObjectGroup::sweep(AutoClearTypeInferenceStateOnOOM* oom)
Maybe<AutoClearTypeInferenceStateOnOOM> fallbackOOM;
EnsureHasAutoClearTypeInferenceStateOnOOM(oom, zone(), fallbackOOM);
+ if (maybeUnboxedLayout()) {
+ // Remove unboxed layouts that are about to be finalized from the
+ // compartment wide list while we are still on the main thread.
+ ObjectGroup* group = this;
+ if (IsAboutToBeFinalizedUnbarriered(&group))
+ unboxedLayout().detachFromCompartment();
+
+ if (unboxedLayout().newScript())
+ unboxedLayout().newScript()->sweep();
+
+ // Discard constructor code to avoid holding onto ExecutablePools.
+ if (zone()->isGCCompacting())
+ unboxedLayout().setConstructorCode(nullptr);
+ }
+
if (maybePreliminaryObjects())
maybePreliminaryObjects()->sweep();
diff --git a/js/src/vm/TypeInference.h b/js/src/vm/TypeInference.h
index fd021fc96..9ec1bf927 100644
--- a/js/src/vm/TypeInference.h
+++ b/js/src/vm/TypeInference.h
@@ -262,6 +262,7 @@ class TypeSet
bool hasStableClassAndProto(CompilerConstraintList* constraints);
void watchStateChangeForInlinedCall(CompilerConstraintList* constraints);
void watchStateChangeForTypedArrayData(CompilerConstraintList* constraints);
+ void watchStateChangeForUnboxedConvertedToNative(CompilerConstraintList* constraints);
HeapTypeSetKey property(jsid id);
void ensureTrackedProperty(JSContext* cx, jsid id);
@@ -871,8 +872,8 @@ class PreliminaryObjectArray
public:
PreliminaryObjectArray() = default;
- void registerNewObject(PlainObject* res);
- void unregisterObject(PlainObject* obj);
+ void registerNewObject(JSObject* res);
+ void unregisterObject(JSObject* obj);
JSObject* get(size_t i) const {
MOZ_ASSERT(i < COUNT);
diff --git a/js/src/vm/UnboxedObject-inl.h b/js/src/vm/UnboxedObject-inl.h
new file mode 100644
index 000000000..93ad7bf28
--- /dev/null
+++ b/js/src/vm/UnboxedObject-inl.h
@@ -0,0 +1,840 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sts=4 et sw=4 tw=99:
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef vm_UnboxedObject_inl_h
+#define vm_UnboxedObject_inl_h
+
+#include "vm/UnboxedObject.h"
+
+#include "gc/StoreBuffer-inl.h"
+#include "vm/ArrayObject-inl.h"
+#include "vm/NativeObject-inl.h"
+
+namespace js {
+
+static inline Value
+GetUnboxedValue(uint8_t* p, JSValueType type, bool maybeUninitialized)
+{
+ switch (type) {
+ case JSVAL_TYPE_BOOLEAN:
+ return BooleanValue(*p != 0);
+
+ case JSVAL_TYPE_INT32:
+ return Int32Value(*reinterpret_cast<int32_t*>(p));
+
+ case JSVAL_TYPE_DOUBLE: {
+ // During unboxed plain object creation, non-GC thing properties are
+ // left uninitialized. This is normally fine, since the properties will
+ // be filled in shortly, but if they are read before that happens we
+ // need to make sure that doubles are canonical.
+ double d = *reinterpret_cast<double*>(p);
+ if (maybeUninitialized)
+ return DoubleValue(JS::CanonicalizeNaN(d));
+ return DoubleValue(d);
+ }
+
+ case JSVAL_TYPE_STRING:
+ return StringValue(*reinterpret_cast<JSString**>(p));
+
+ case JSVAL_TYPE_OBJECT:
+ return ObjectOrNullValue(*reinterpret_cast<JSObject**>(p));
+
+ default:
+ MOZ_CRASH("Invalid type for unboxed value");
+ }
+}
+
+static inline void
+SetUnboxedValueNoTypeChange(JSObject* unboxedObject,
+ uint8_t* p, JSValueType type, const Value& v,
+ bool preBarrier)
+{
+ switch (type) {
+ case JSVAL_TYPE_BOOLEAN:
+ *p = v.toBoolean();
+ return;
+
+ case JSVAL_TYPE_INT32:
+ *reinterpret_cast<int32_t*>(p) = v.toInt32();
+ return;
+
+ case JSVAL_TYPE_DOUBLE:
+ *reinterpret_cast<double*>(p) = v.toNumber();
+ return;
+
+ case JSVAL_TYPE_STRING: {
+ MOZ_ASSERT(!IsInsideNursery(v.toString()));
+ JSString** np = reinterpret_cast<JSString**>(p);
+ if (preBarrier)
+ JSString::writeBarrierPre(*np);
+ *np = v.toString();
+ return;
+ }
+
+ case JSVAL_TYPE_OBJECT: {
+ JSObject** np = reinterpret_cast<JSObject**>(p);
+
+ // Manually trigger post barriers on the whole object. If we treat
+ // the pointer as a HeapPtrObject we will get confused later if the
+ // object is converted to its native representation.
+ JSObject* obj = v.toObjectOrNull();
+ if (IsInsideNursery(obj) && !IsInsideNursery(unboxedObject)) {
+ JSRuntime* rt = unboxedObject->runtimeFromMainThread();
+ rt->gc.storeBuffer.putWholeCell(unboxedObject);
+ }
+
+ if (preBarrier)
+ JSObject::writeBarrierPre(*np);
+ *np = obj;
+ return;
+ }
+
+ default:
+ MOZ_CRASH("Invalid type for unboxed value");
+ }
+}
+
+static inline bool
+SetUnboxedValue(ExclusiveContext* cx, JSObject* unboxedObject, jsid id,
+ uint8_t* p, JSValueType type, const Value& v, bool preBarrier)
+{
+ switch (type) {
+ case JSVAL_TYPE_BOOLEAN:
+ if (v.isBoolean()) {
+ *p = v.toBoolean();
+ return true;
+ }
+ return false;
+
+ case JSVAL_TYPE_INT32:
+ if (v.isInt32()) {
+ *reinterpret_cast<int32_t*>(p) = v.toInt32();
+ return true;
+ }
+ return false;
+
+ case JSVAL_TYPE_DOUBLE:
+ if (v.isNumber()) {
+ *reinterpret_cast<double*>(p) = v.toNumber();
+ return true;
+ }
+ return false;
+
+ case JSVAL_TYPE_STRING:
+ if (v.isString()) {
+ MOZ_ASSERT(!IsInsideNursery(v.toString()));
+ JSString** np = reinterpret_cast<JSString**>(p);
+ if (preBarrier)
+ JSString::writeBarrierPre(*np);
+ *np = v.toString();
+ return true;
+ }
+ return false;
+
+ case JSVAL_TYPE_OBJECT:
+ if (v.isObjectOrNull()) {
+ JSObject** np = reinterpret_cast<JSObject**>(p);
+
+ // Update property types when writing object properties. Types for
+ // other properties were captured when the unboxed layout was
+ // created.
+ AddTypePropertyId(cx, unboxedObject, id, v);
+
+ // As above, trigger post barriers on the whole object.
+ JSObject* obj = v.toObjectOrNull();
+ if (IsInsideNursery(v.toObjectOrNull()) && !IsInsideNursery(unboxedObject)) {
+ JSRuntime* rt = unboxedObject->runtimeFromMainThread();
+ rt->gc.storeBuffer.putWholeCell(unboxedObject);
+ }
+
+ if (preBarrier)
+ JSObject::writeBarrierPre(*np);
+ *np = obj;
+ return true;
+ }
+ return false;
+
+ default:
+ MOZ_CRASH("Invalid type for unboxed value");
+ }
+}
+
+/////////////////////////////////////////////////////////////////////
+// UnboxedPlainObject
+/////////////////////////////////////////////////////////////////////
+
+inline const UnboxedLayout&
+UnboxedPlainObject::layout() const
+{
+ return group()->unboxedLayout();
+}
+
+/////////////////////////////////////////////////////////////////////
+// UnboxedArrayObject
+/////////////////////////////////////////////////////////////////////
+
+inline const UnboxedLayout&
+UnboxedArrayObject::layout() const
+{
+ return group()->unboxedLayout();
+}
+
+inline void
+UnboxedArrayObject::setLength(ExclusiveContext* cx, uint32_t length)
+{
+ if (length > INT32_MAX) {
+ // Track objects with overflowing lengths in type information.
+ MarkObjectGroupFlags(cx, this, OBJECT_FLAG_LENGTH_OVERFLOW);
+ }
+
+ length_ = length;
+}
+
+inline void
+UnboxedArrayObject::setInitializedLength(uint32_t initlen)
+{
+ if (initlen < initializedLength()) {
+ switch (elementType()) {
+ case JSVAL_TYPE_STRING:
+ for (size_t i = initlen; i < initializedLength(); i++)
+ triggerPreBarrier<JSVAL_TYPE_STRING>(i);
+ break;
+ case JSVAL_TYPE_OBJECT:
+ for (size_t i = initlen; i < initializedLength(); i++)
+ triggerPreBarrier<JSVAL_TYPE_OBJECT>(i);
+ break;
+ default:
+ MOZ_ASSERT(!UnboxedTypeNeedsPreBarrier(elementType()));
+ }
+ }
+ setInitializedLengthNoBarrier(initlen);
+}
+
+template <JSValueType Type>
+inline bool
+UnboxedArrayObject::setElementSpecific(ExclusiveContext* cx, size_t index, const Value& v)
+{
+ MOZ_ASSERT(index < initializedLength());
+ MOZ_ASSERT(Type == elementType());
+ uint8_t* p = elements() + index * UnboxedTypeSize(Type);
+ return SetUnboxedValue(cx, this, JSID_VOID, p, elementType(), v, /* preBarrier = */ true);
+}
+
+template <JSValueType Type>
+inline void
+UnboxedArrayObject::setElementNoTypeChangeSpecific(size_t index, const Value& v)
+{
+ MOZ_ASSERT(index < initializedLength());
+ MOZ_ASSERT(Type == elementType());
+ uint8_t* p = elements() + index * UnboxedTypeSize(Type);
+ return SetUnboxedValueNoTypeChange(this, p, elementType(), v, /* preBarrier = */ true);
+}
+
+template <JSValueType Type>
+inline bool
+UnboxedArrayObject::initElementSpecific(ExclusiveContext* cx, size_t index, const Value& v)
+{
+ MOZ_ASSERT(index < initializedLength());
+ MOZ_ASSERT(Type == elementType());
+ uint8_t* p = elements() + index * UnboxedTypeSize(Type);
+ return SetUnboxedValue(cx, this, JSID_VOID, p, elementType(), v, /* preBarrier = */ false);
+}
+
+template <JSValueType Type>
+inline void
+UnboxedArrayObject::initElementNoTypeChangeSpecific(size_t index, const Value& v)
+{
+ MOZ_ASSERT(index < initializedLength());
+ MOZ_ASSERT(Type == elementType());
+ uint8_t* p = elements() + index * UnboxedTypeSize(Type);
+ return SetUnboxedValueNoTypeChange(this, p, elementType(), v, /* preBarrier = */ false);
+}
+
+template <JSValueType Type>
+inline Value
+UnboxedArrayObject::getElementSpecific(size_t index)
+{
+ MOZ_ASSERT(index < initializedLength());
+ MOZ_ASSERT(Type == elementType());
+ uint8_t* p = elements() + index * UnboxedTypeSize(Type);
+ return GetUnboxedValue(p, Type, /* maybeUninitialized = */ false);
+}
+
+template <JSValueType Type>
+inline void
+UnboxedArrayObject::triggerPreBarrier(size_t index)
+{
+ MOZ_ASSERT(UnboxedTypeNeedsPreBarrier(Type));
+
+ uint8_t* p = elements() + index * UnboxedTypeSize(Type);
+
+ switch (Type) {
+ case JSVAL_TYPE_STRING: {
+ JSString** np = reinterpret_cast<JSString**>(p);
+ JSString::writeBarrierPre(*np);
+ break;
+ }
+
+ case JSVAL_TYPE_OBJECT: {
+ JSObject** np = reinterpret_cast<JSObject**>(p);
+ JSObject::writeBarrierPre(*np);
+ break;
+ }
+
+ default:
+ MOZ_CRASH("Bad type");
+ }
+}
+
+/////////////////////////////////////////////////////////////////////
+// Combined methods for NativeObject and UnboxedArrayObject accesses.
+/////////////////////////////////////////////////////////////////////
+
+static inline bool
+HasAnyBoxedOrUnboxedDenseElements(JSObject* obj)
+{
+ return obj->isNative() || obj->is<UnboxedArrayObject>();
+}
+
+static inline size_t
+GetAnyBoxedOrUnboxedInitializedLength(JSObject* obj)
+{
+ if (obj->isNative())
+ return obj->as<NativeObject>().getDenseInitializedLength();
+ if (obj->is<UnboxedArrayObject>())
+ return obj->as<UnboxedArrayObject>().initializedLength();
+ return 0;
+}
+
+static inline size_t
+GetAnyBoxedOrUnboxedCapacity(JSObject* obj)
+{
+ if (obj->isNative())
+ return obj->as<NativeObject>().getDenseCapacity();
+ if (obj->is<UnboxedArrayObject>())
+ return obj->as<UnboxedArrayObject>().capacity();
+ return 0;
+}
+
+static inline Value
+GetAnyBoxedOrUnboxedDenseElement(JSObject* obj, size_t index)
+{
+ if (obj->isNative())
+ return obj->as<NativeObject>().getDenseElement(index);
+ return obj->as<UnboxedArrayObject>().getElement(index);
+}
+
+static inline size_t
+GetAnyBoxedOrUnboxedArrayLength(JSObject* obj)
+{
+ if (obj->is<ArrayObject>())
+ return obj->as<ArrayObject>().length();
+ return obj->as<UnboxedArrayObject>().length();
+}
+
+static inline void
+SetAnyBoxedOrUnboxedArrayLength(JSContext* cx, JSObject* obj, size_t length)
+{
+ if (obj->is<ArrayObject>()) {
+ MOZ_ASSERT(length >= obj->as<ArrayObject>().length());
+ obj->as<ArrayObject>().setLength(cx, length);
+ } else {
+ MOZ_ASSERT(length >= obj->as<UnboxedArrayObject>().length());
+ obj->as<UnboxedArrayObject>().setLength(cx, length);
+ }
+}
+
+static inline bool
+SetAnyBoxedOrUnboxedDenseElement(JSContext* cx, JSObject* obj, size_t index, const Value& value)
+{
+ if (obj->isNative()) {
+ obj->as<NativeObject>().setDenseElementWithType(cx, index, value);
+ return true;
+ }
+ return obj->as<UnboxedArrayObject>().setElement(cx, index, value);
+}
+
+static inline bool
+InitAnyBoxedOrUnboxedDenseElement(JSContext* cx, JSObject* obj, size_t index, const Value& value)
+{
+ if (obj->isNative()) {
+ obj->as<NativeObject>().initDenseElementWithType(cx, index, value);
+ return true;
+ }
+ return obj->as<UnboxedArrayObject>().initElement(cx, index, value);
+}
+
+/////////////////////////////////////////////////////////////////////
+// Template methods for NativeObject and UnboxedArrayObject accesses.
+/////////////////////////////////////////////////////////////////////
+
+static inline JSValueType
+GetBoxedOrUnboxedType(JSObject* obj)
+{
+ if (obj->isNative())
+ return JSVAL_TYPE_MAGIC;
+ return obj->as<UnboxedArrayObject>().elementType();
+}
+
+template <JSValueType Type>
+static inline bool
+HasBoxedOrUnboxedDenseElements(JSObject* obj)
+{
+ if (Type == JSVAL_TYPE_MAGIC)
+ return obj->isNative();
+ return obj->is<UnboxedArrayObject>() && obj->as<UnboxedArrayObject>().elementType() == Type;
+}
+
+template <JSValueType Type>
+static inline size_t
+GetBoxedOrUnboxedInitializedLength(JSObject* obj)
+{
+ if (Type == JSVAL_TYPE_MAGIC)
+ return obj->as<NativeObject>().getDenseInitializedLength();
+ return obj->as<UnboxedArrayObject>().initializedLength();
+}
+
+template <JSValueType Type>
+static inline DenseElementResult
+SetBoxedOrUnboxedInitializedLength(JSContext* cx, JSObject* obj, size_t initlen)
+{
+ size_t oldInitlen = GetBoxedOrUnboxedInitializedLength<Type>(obj);
+ if (Type == JSVAL_TYPE_MAGIC) {
+ obj->as<NativeObject>().setDenseInitializedLength(initlen);
+ if (initlen < oldInitlen)
+ obj->as<NativeObject>().shrinkElements(cx, initlen);
+ } else {
+ obj->as<UnboxedArrayObject>().setInitializedLength(initlen);
+ if (initlen < oldInitlen)
+ obj->as<UnboxedArrayObject>().shrinkElements(cx, initlen);
+ }
+ return DenseElementResult::Success;
+}
+
+template <JSValueType Type>
+static inline size_t
+GetBoxedOrUnboxedCapacity(JSObject* obj)
+{
+ if (Type == JSVAL_TYPE_MAGIC)
+ return obj->as<NativeObject>().getDenseCapacity();
+ return obj->as<UnboxedArrayObject>().capacity();
+}
+
+template <JSValueType Type>
+static inline Value
+GetBoxedOrUnboxedDenseElement(JSObject* obj, size_t index)
+{
+ if (Type == JSVAL_TYPE_MAGIC)
+ return obj->as<NativeObject>().getDenseElement(index);
+ return obj->as<UnboxedArrayObject>().getElementSpecific<Type>(index);
+}
+
+template <JSValueType Type>
+static inline void
+SetBoxedOrUnboxedDenseElementNoTypeChange(JSObject* obj, size_t index, const Value& value)
+{
+ if (Type == JSVAL_TYPE_MAGIC)
+ obj->as<NativeObject>().setDenseElement(index, value);
+ else
+ obj->as<UnboxedArrayObject>().setElementNoTypeChangeSpecific<Type>(index, value);
+}
+
+template <JSValueType Type>
+static inline bool
+SetBoxedOrUnboxedDenseElement(JSContext* cx, JSObject* obj, size_t index, const Value& value)
+{
+ if (Type == JSVAL_TYPE_MAGIC) {
+ obj->as<NativeObject>().setDenseElementWithType(cx, index, value);
+ return true;
+ }
+ return obj->as<UnboxedArrayObject>().setElementSpecific<Type>(cx, index, value);
+}
+
+template <JSValueType Type>
+static inline DenseElementResult
+EnsureBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* obj, size_t count)
+{
+ if (Type == JSVAL_TYPE_MAGIC) {
+ if (!obj->as<ArrayObject>().ensureElements(cx, count))
+ return DenseElementResult::Failure;
+ } else {
+ if (obj->as<UnboxedArrayObject>().capacity() < count) {
+ if (!obj->as<UnboxedArrayObject>().growElements(cx, count))
+ return DenseElementResult::Failure;
+ }
+ }
+ return DenseElementResult::Success;
+}
+
+template <JSValueType Type>
+static inline DenseElementResult
+SetOrExtendBoxedOrUnboxedDenseElements(ExclusiveContext* cx, JSObject* obj,
+ uint32_t start, const Value* vp, uint32_t count,
+ ShouldUpdateTypes updateTypes = ShouldUpdateTypes::Update)
+{
+ if (Type == JSVAL_TYPE_MAGIC) {
+ NativeObject* nobj = &obj->as<NativeObject>();
+
+ if (nobj->denseElementsAreFrozen())
+ return DenseElementResult::Incomplete;
+
+ if (obj->is<ArrayObject>() &&
+ !obj->as<ArrayObject>().lengthIsWritable() &&
+ start + count >= obj->as<ArrayObject>().length())
+ {
+ return DenseElementResult::Incomplete;
+ }
+
+ DenseElementResult result = nobj->ensureDenseElements(cx, start, count);
+ if (result != DenseElementResult::Success)
+ return result;
+
+ if (obj->is<ArrayObject>() && start + count >= obj->as<ArrayObject>().length())
+ obj->as<ArrayObject>().setLengthInt32(start + count);
+
+ if (updateTypes == ShouldUpdateTypes::DontUpdate && !nobj->shouldConvertDoubleElements()) {
+ nobj->copyDenseElements(start, vp, count);
+ } else {
+ for (size_t i = 0; i < count; i++)
+ nobj->setDenseElementWithType(cx, start + i, vp[i]);
+ }
+
+ return DenseElementResult::Success;
+ }
+
+ UnboxedArrayObject* nobj = &obj->as<UnboxedArrayObject>();
+
+ if (start > nobj->initializedLength())
+ return DenseElementResult::Incomplete;
+
+ if (start + count >= UnboxedArrayObject::MaximumCapacity)
+ return DenseElementResult::Incomplete;
+
+ if (start + count > nobj->capacity() && !nobj->growElements(cx, start + count))
+ return DenseElementResult::Failure;
+
+ size_t oldInitlen = nobj->initializedLength();
+
+ // Overwrite any existing elements covered by the new range. If we fail
+ // after this point due to some incompatible type being written to the
+ // object's elements, afterwards the contents will be different from when
+ // we started. The caller must retry the operation using a generic path,
+ // which will overwrite the already-modified elements as well as the ones
+ // that were left alone.
+ size_t i = 0;
+ if (updateTypes == ShouldUpdateTypes::DontUpdate) {
+ for (size_t j = start; i < count && j < oldInitlen; i++, j++)
+ nobj->setElementNoTypeChangeSpecific<Type>(j, vp[i]);
+ } else {
+ for (size_t j = start; i < count && j < oldInitlen; i++, j++) {
+ if (!nobj->setElementSpecific<Type>(cx, j, vp[i]))
+ return DenseElementResult::Incomplete;
+ }
+ }
+
+ if (i != count) {
+ obj->as<UnboxedArrayObject>().setInitializedLength(start + count);
+ if (updateTypes == ShouldUpdateTypes::DontUpdate) {
+ for (; i < count; i++)
+ nobj->initElementNoTypeChangeSpecific<Type>(start + i, vp[i]);
+ } else {
+ for (; i < count; i++) {
+ if (!nobj->initElementSpecific<Type>(cx, start + i, vp[i])) {
+ nobj->setInitializedLengthNoBarrier(oldInitlen);
+ return DenseElementResult::Incomplete;
+ }
+ }
+ }
+ }
+
+ if (start + count >= nobj->length())
+ nobj->setLength(cx, start + count);
+
+ return DenseElementResult::Success;
+}
+
+template <JSValueType Type>
+static inline DenseElementResult
+MoveBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* obj, uint32_t dstStart, uint32_t srcStart,
+ uint32_t length)
+{
+ MOZ_ASSERT(HasBoxedOrUnboxedDenseElements<Type>(obj));
+
+ if (Type == JSVAL_TYPE_MAGIC) {
+ if (obj->as<NativeObject>().denseElementsAreFrozen())
+ return DenseElementResult::Incomplete;
+
+ if (!obj->as<NativeObject>().maybeCopyElementsForWrite(cx))
+ return DenseElementResult::Failure;
+ obj->as<NativeObject>().moveDenseElements(dstStart, srcStart, length);
+ } else {
+ uint8_t* data = obj->as<UnboxedArrayObject>().elements();
+ size_t elementSize = UnboxedTypeSize(Type);
+
+ if (UnboxedTypeNeedsPreBarrier(Type) &&
+ JS::shadow::Zone::asShadowZone(obj->zone())->needsIncrementalBarrier())
+ {
+ // Trigger pre barriers on any elements we are overwriting. See
+ // NativeObject::moveDenseElements. No post barrier is needed as
+ // only whole cell post barriers are used with unboxed objects.
+ for (size_t i = 0; i < length; i++)
+ obj->as<UnboxedArrayObject>().triggerPreBarrier<Type>(dstStart + i);
+ }
+
+ memmove(data + dstStart * elementSize,
+ data + srcStart * elementSize,
+ length * elementSize);
+ }
+
+ return DenseElementResult::Success;
+}
+
+template <JSValueType DstType, JSValueType SrcType>
+static inline DenseElementResult
+CopyBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* dst, JSObject* src,
+ uint32_t dstStart, uint32_t srcStart, uint32_t length)
+{
+ MOZ_ASSERT(HasBoxedOrUnboxedDenseElements<SrcType>(src));
+ MOZ_ASSERT(HasBoxedOrUnboxedDenseElements<DstType>(dst));
+ MOZ_ASSERT(GetBoxedOrUnboxedInitializedLength<DstType>(dst) == dstStart);
+ MOZ_ASSERT(GetBoxedOrUnboxedInitializedLength<SrcType>(src) >= srcStart + length);
+ MOZ_ASSERT(GetBoxedOrUnboxedCapacity<DstType>(dst) >= dstStart + length);
+
+ SetBoxedOrUnboxedInitializedLength<DstType>(cx, dst, dstStart + length);
+
+ if (DstType == JSVAL_TYPE_MAGIC) {
+ if (SrcType == JSVAL_TYPE_MAGIC) {
+ const Value* vp = src->as<NativeObject>().getDenseElements() + srcStart;
+ dst->as<NativeObject>().initDenseElements(dstStart, vp, length);
+ } else {
+ for (size_t i = 0; i < length; i++) {
+ Value v = GetBoxedOrUnboxedDenseElement<SrcType>(src, srcStart + i);
+ dst->as<NativeObject>().initDenseElement(dstStart + i, v);
+ }
+ }
+ } else if (DstType == SrcType) {
+ uint8_t* dstData = dst->as<UnboxedArrayObject>().elements();
+ uint8_t* srcData = src->as<UnboxedArrayObject>().elements();
+ size_t elementSize = UnboxedTypeSize(DstType);
+
+ memcpy(dstData + dstStart * elementSize,
+ srcData + srcStart * elementSize,
+ length * elementSize);
+
+ // Add a store buffer entry if we might have copied a nursery pointer to dst.
+ if (UnboxedTypeNeedsPostBarrier(DstType) && !IsInsideNursery(dst))
+ dst->runtimeFromMainThread()->gc.storeBuffer.putWholeCell(dst);
+ } else if (DstType == JSVAL_TYPE_DOUBLE && SrcType == JSVAL_TYPE_INT32) {
+ uint8_t* dstData = dst->as<UnboxedArrayObject>().elements();
+ uint8_t* srcData = src->as<UnboxedArrayObject>().elements();
+
+ for (size_t i = 0; i < length; i++) {
+ int32_t v = *reinterpret_cast<int32_t*>(srcData + (srcStart + i) * sizeof(int32_t));
+ *reinterpret_cast<double*>(dstData + (dstStart + i) * sizeof(double)) = v;
+ }
+ } else {
+ for (size_t i = 0; i < length; i++) {
+ Value v = GetBoxedOrUnboxedDenseElement<SrcType>(src, srcStart + i);
+ dst->as<UnboxedArrayObject>().initElementNoTypeChangeSpecific<DstType>(dstStart + i, v);
+ }
+ }
+
+ return DenseElementResult::Success;
+}
+
+/////////////////////////////////////////////////////////////////////
+// Dispatch to specialized methods based on the type of an object.
+/////////////////////////////////////////////////////////////////////
+
+// Goop to fix MSVC. See DispatchTraceKindTyped in TraceKind.h.
+// The clang-cl front end defines _MSC_VER, but still requires the explicit
+// template declaration, so we must test for __clang__ here as well.
+#if defined(_MSC_VER) && !defined(__clang__)
+# define DEPENDENT_TEMPLATE_HINT
+#else
+# define DEPENDENT_TEMPLATE_HINT template
+#endif
+
+// Function to dispatch a method specialized to whatever boxed or unboxed dense
+// elements which an input object has.
+template <typename F>
+DenseElementResult
+CallBoxedOrUnboxedSpecialization(F f, JSObject* obj)
+{
+ if (!HasAnyBoxedOrUnboxedDenseElements(obj))
+ return DenseElementResult::Incomplete;
+ switch (GetBoxedOrUnboxedType(obj)) {
+ case JSVAL_TYPE_MAGIC:
+ return f. DEPENDENT_TEMPLATE_HINT operator()<JSVAL_TYPE_MAGIC>();
+ case JSVAL_TYPE_BOOLEAN:
+ return f. DEPENDENT_TEMPLATE_HINT operator()<JSVAL_TYPE_BOOLEAN>();
+ case JSVAL_TYPE_INT32:
+ return f. DEPENDENT_TEMPLATE_HINT operator()<JSVAL_TYPE_INT32>();
+ case JSVAL_TYPE_DOUBLE:
+ return f. DEPENDENT_TEMPLATE_HINT operator()<JSVAL_TYPE_DOUBLE>();
+ case JSVAL_TYPE_STRING:
+ return f. DEPENDENT_TEMPLATE_HINT operator()<JSVAL_TYPE_STRING>();
+ case JSVAL_TYPE_OBJECT:
+ return f. DEPENDENT_TEMPLATE_HINT operator()<JSVAL_TYPE_OBJECT>();
+ default:
+ MOZ_CRASH();
+ }
+}
+
+// As above, except the specialization can reflect the unboxed type of two objects.
+template <typename F>
+DenseElementResult
+CallBoxedOrUnboxedSpecialization(F f, JSObject* obj1, JSObject* obj2)
+{
+ if (!HasAnyBoxedOrUnboxedDenseElements(obj1) || !HasAnyBoxedOrUnboxedDenseElements(obj2))
+ return DenseElementResult::Incomplete;
+
+#define SPECIALIZE_OBJ2(TYPE) \
+ switch (GetBoxedOrUnboxedType(obj2)) { \
+ case JSVAL_TYPE_MAGIC: \
+ return f. DEPENDENT_TEMPLATE_HINT operator()<TYPE, JSVAL_TYPE_MAGIC>(); \
+ case JSVAL_TYPE_BOOLEAN: \
+ return f. DEPENDENT_TEMPLATE_HINT operator()<TYPE, JSVAL_TYPE_BOOLEAN>(); \
+ case JSVAL_TYPE_INT32: \
+ return f. DEPENDENT_TEMPLATE_HINT operator()<TYPE, JSVAL_TYPE_INT32>(); \
+ case JSVAL_TYPE_DOUBLE: \
+ return f. DEPENDENT_TEMPLATE_HINT operator()<TYPE, JSVAL_TYPE_DOUBLE>(); \
+ case JSVAL_TYPE_STRING: \
+ return f. DEPENDENT_TEMPLATE_HINT operator()<TYPE, JSVAL_TYPE_STRING>(); \
+ case JSVAL_TYPE_OBJECT: \
+ return f. DEPENDENT_TEMPLATE_HINT operator()<TYPE, JSVAL_TYPE_OBJECT>(); \
+ default: \
+ MOZ_CRASH(); \
+ }
+
+ switch (GetBoxedOrUnboxedType(obj1)) {
+ case JSVAL_TYPE_MAGIC:
+ SPECIALIZE_OBJ2(JSVAL_TYPE_MAGIC)
+ case JSVAL_TYPE_BOOLEAN:
+ SPECIALIZE_OBJ2(JSVAL_TYPE_BOOLEAN)
+ case JSVAL_TYPE_INT32:
+ SPECIALIZE_OBJ2(JSVAL_TYPE_INT32)
+ case JSVAL_TYPE_DOUBLE:
+ SPECIALIZE_OBJ2(JSVAL_TYPE_DOUBLE)
+ case JSVAL_TYPE_STRING:
+ SPECIALIZE_OBJ2(JSVAL_TYPE_STRING)
+ case JSVAL_TYPE_OBJECT:
+ SPECIALIZE_OBJ2(JSVAL_TYPE_OBJECT)
+ default:
+ MOZ_CRASH();
+ }
+
+#undef SPECIALIZE_OBJ2
+}
+
+#undef DEPENDENT_TEMPLATE_HINT
+
+#define DefineBoxedOrUnboxedFunctor1(Signature, A) \
+struct Signature ## Functor { \
+ A a; \
+ explicit Signature ## Functor(A a) \
+ : a(a) \
+ {} \
+ template <JSValueType Type> \
+ DenseElementResult operator()() { \
+ return Signature<Type>(a); \
+ } \
+}
+
+#define DefineBoxedOrUnboxedFunctor3(Signature, A, B, C) \
+struct Signature ## Functor { \
+ A a; B b; C c; \
+ Signature ## Functor(A a, B b, C c) \
+ : a(a), b(b), c(c) \
+ {} \
+ template <JSValueType Type> \
+ DenseElementResult operator()() { \
+ return Signature<Type>(a, b, c); \
+ } \
+}
+
+#define DefineBoxedOrUnboxedFunctor4(Signature, A, B, C, D) \
+struct Signature ## Functor { \
+ A a; B b; C c; D d; \
+ Signature ## Functor(A a, B b, C c, D d) \
+ : a(a), b(b), c(c), d(d) \
+ {} \
+ template <JSValueType Type> \
+ DenseElementResult operator()() { \
+ return Signature<Type>(a, b, c, d); \
+ } \
+}
+
+#define DefineBoxedOrUnboxedFunctorPair4(Signature, A, B, C, D) \
+struct Signature ## Functor { \
+ A a; B b; C c; D d; \
+ Signature ## Functor(A a, B b, C c, D d) \
+ : a(a), b(b), c(c), d(d) \
+ {} \
+ template <JSValueType TypeOne, JSValueType TypeTwo> \
+ DenseElementResult operator()() { \
+ return Signature<TypeOne, TypeTwo>(a, b, c, d); \
+ } \
+}
+
+#define DefineBoxedOrUnboxedFunctor5(Signature, A, B, C, D, E) \
+struct Signature ## Functor { \
+ A a; B b; C c; D d; E e; \
+ Signature ## Functor(A a, B b, C c, D d, E e) \
+ : a(a), b(b), c(c), d(d), e(e) \
+ {} \
+ template <JSValueType Type> \
+ DenseElementResult operator()() { \
+ return Signature<Type>(a, b, c, d, e); \
+ } \
+}
+
+#define DefineBoxedOrUnboxedFunctor6(Signature, A, B, C, D, E, F) \
+struct Signature ## Functor { \
+ A a; B b; C c; D d; E e; F f; \
+ Signature ## Functor(A a, B b, C c, D d, E e, F f) \
+ : a(a), b(b), c(c), d(d), e(e), f(f) \
+ {} \
+ template <JSValueType Type> \
+ DenseElementResult operator()() { \
+ return Signature<Type>(a, b, c, d, e, f); \
+ } \
+}
+
+#define DefineBoxedOrUnboxedFunctorPair6(Signature, A, B, C, D, E, F) \
+struct Signature ## Functor { \
+ A a; B b; C c; D d; E e; F f; \
+ Signature ## Functor(A a, B b, C c, D d, E e, F f) \
+ : a(a), b(b), c(c), d(d), e(e), f(f) \
+ {} \
+ template <JSValueType TypeOne, JSValueType TypeTwo> \
+ DenseElementResult operator()() { \
+ return Signature<TypeOne, TypeTwo>(a, b, c, d, e, f); \
+ } \
+}
+
+DenseElementResult
+SetOrExtendAnyBoxedOrUnboxedDenseElements(ExclusiveContext* cx, JSObject* obj,
+ uint32_t start, const Value* vp, uint32_t count,
+ ShouldUpdateTypes updateTypes = ShouldUpdateTypes::Update);
+
+DenseElementResult
+MoveAnyBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* obj,
+ uint32_t dstStart, uint32_t srcStart, uint32_t length);
+
+DenseElementResult
+CopyAnyBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* dst, JSObject* src,
+ uint32_t dstStart, uint32_t srcStart, uint32_t length);
+
+void
+SetAnyBoxedOrUnboxedInitializedLength(JSContext* cx, JSObject* obj, size_t initlen);
+
+DenseElementResult
+EnsureAnyBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* obj, size_t count);
+
+} // namespace js
+
+#endif // vm_UnboxedObject_inl_h
diff --git a/js/src/vm/UnboxedObject.cpp b/js/src/vm/UnboxedObject.cpp
new file mode 100644
index 000000000..d8c9c774a
--- /dev/null
+++ b/js/src/vm/UnboxedObject.cpp
@@ -0,0 +1,2132 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sts=4 et sw=4 tw=99:
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#include "vm/UnboxedObject-inl.h"
+
+#include "jit/BaselineIC.h"
+#include "jit/ExecutableAllocator.h"
+#include "jit/JitCommon.h"
+#include "jit/Linker.h"
+
+#include "jsobjinlines.h"
+
+#include "gc/Nursery-inl.h"
+#include "jit/MacroAssembler-inl.h"
+#include "vm/Shape-inl.h"
+
+using mozilla::ArrayLength;
+using mozilla::DebugOnly;
+using mozilla::PodCopy;
+
+using namespace js;
+
+/////////////////////////////////////////////////////////////////////
+// UnboxedLayout
+/////////////////////////////////////////////////////////////////////
+
+void
+UnboxedLayout::trace(JSTracer* trc)
+{
+ for (size_t i = 0; i < properties_.length(); i++)
+ TraceManuallyBarrieredEdge(trc, &properties_[i].name, "unboxed_layout_name");
+
+ if (newScript())
+ newScript()->trace(trc);
+
+ TraceNullableEdge(trc, &nativeGroup_, "unboxed_layout_nativeGroup");
+ TraceNullableEdge(trc, &nativeShape_, "unboxed_layout_nativeShape");
+ TraceNullableEdge(trc, &allocationScript_, "unboxed_layout_allocationScript");
+ TraceNullableEdge(trc, &replacementGroup_, "unboxed_layout_replacementGroup");
+ TraceNullableEdge(trc, &constructorCode_, "unboxed_layout_constructorCode");
+}
+
+size_t
+UnboxedLayout::sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf)
+{
+ return mallocSizeOf(this)
+ + properties_.sizeOfExcludingThis(mallocSizeOf)
+ + (newScript() ? newScript()->sizeOfIncludingThis(mallocSizeOf) : 0)
+ + mallocSizeOf(traceList());
+}
+
+void
+UnboxedLayout::setNewScript(TypeNewScript* newScript, bool writeBarrier /* = true */)
+{
+ if (newScript_ && writeBarrier)
+ TypeNewScript::writeBarrierPre(newScript_);
+ newScript_ = newScript;
+}
+
+// Constructor code returns a 0x1 value to indicate the constructor code should
+// be cleared.
+static const uintptr_t CLEAR_CONSTRUCTOR_CODE_TOKEN = 0x1;
+
+/* static */ bool
+UnboxedLayout::makeConstructorCode(JSContext* cx, HandleObjectGroup group)
+{
+ gc::AutoSuppressGC suppress(cx);
+
+ using namespace jit;
+
+ if (!cx->compartment()->ensureJitCompartmentExists(cx))
+ return false;
+
+ UnboxedLayout& layout = group->unboxedLayout();
+ MOZ_ASSERT(!layout.constructorCode());
+
+ UnboxedPlainObject* templateObject = UnboxedPlainObject::create(cx, group, TenuredObject);
+ if (!templateObject)
+ return false;
+
+ JitContext jitContext(cx, nullptr);
+
+ MacroAssembler masm;
+
+ Register propertiesReg, newKindReg;
+#ifdef JS_CODEGEN_X86
+ propertiesReg = eax;
+ newKindReg = ecx;
+ masm.loadPtr(Address(masm.getStackPointer(), sizeof(void*)), propertiesReg);
+ masm.loadPtr(Address(masm.getStackPointer(), 2 * sizeof(void*)), newKindReg);
+#else
+ propertiesReg = IntArgReg0;
+ newKindReg = IntArgReg1;
+#endif
+
+#ifdef JS_CODEGEN_ARM64
+ // ARM64 communicates stack address via sp, but uses a pseudo-sp for addressing.
+ masm.initStackPtr();
+#endif
+
+ MOZ_ASSERT(propertiesReg.volatile_());
+ MOZ_ASSERT(newKindReg.volatile_());
+
+ AllocatableGeneralRegisterSet regs(GeneralRegisterSet::All());
+ regs.take(propertiesReg);
+ regs.take(newKindReg);
+ Register object = regs.takeAny(), scratch1 = regs.takeAny(), scratch2 = regs.takeAny();
+
+ LiveGeneralRegisterSet savedNonVolatileRegisters = SavedNonVolatileRegisters(regs);
+ masm.PushRegsInMask(savedNonVolatileRegisters);
+
+ // The scratch double register might be used by MacroAssembler methods.
+ if (ScratchDoubleReg.volatile_())
+ masm.push(ScratchDoubleReg);
+
+ Label failure, tenuredObject, allocated;
+ masm.branch32(Assembler::NotEqual, newKindReg, Imm32(GenericObject), &tenuredObject);
+ masm.branchTest32(Assembler::NonZero, AbsoluteAddress(group->addressOfFlags()),
+ Imm32(OBJECT_FLAG_PRE_TENURE), &tenuredObject);
+
+ // Allocate an object in the nursery
+ masm.createGCObject(object, scratch1, templateObject, gc::DefaultHeap, &failure,
+ /* initFixedSlots = */ false);
+
+ masm.jump(&allocated);
+ masm.bind(&tenuredObject);
+
+ // Allocate an object in the tenured heap.
+ masm.createGCObject(object, scratch1, templateObject, gc::TenuredHeap, &failure,
+ /* initFixedSlots = */ false);
+
+ // If any of the properties being stored are in the nursery, add a store
+ // buffer entry for the new object.
+ Label postBarrier;
+ for (size_t i = 0; i < layout.properties().length(); i++) {
+ const UnboxedLayout::Property& property = layout.properties()[i];
+ if (property.type == JSVAL_TYPE_OBJECT) {
+ Address valueAddress(propertiesReg, i * sizeof(IdValuePair) + offsetof(IdValuePair, value));
+ Label notObject;
+ masm.branchTestObject(Assembler::NotEqual, valueAddress, &notObject);
+ Register valueObject = masm.extractObject(valueAddress, scratch1);
+ masm.branchPtrInNurseryChunk(Assembler::Equal, valueObject, scratch2, &postBarrier);
+ masm.bind(&notObject);
+ }
+ }
+
+ masm.jump(&allocated);
+ masm.bind(&postBarrier);
+
+ LiveGeneralRegisterSet liveVolatileRegisters;
+ liveVolatileRegisters.add(propertiesReg);
+ if (object.volatile_())
+ liveVolatileRegisters.add(object);
+ masm.PushRegsInMask(liveVolatileRegisters);
+
+ masm.mov(ImmPtr(cx->runtime()), scratch1);
+ masm.setupUnalignedABICall(scratch2);
+ masm.passABIArg(scratch1);
+ masm.passABIArg(object);
+ masm.callWithABI(JS_FUNC_TO_DATA_PTR(void*, PostWriteBarrier));
+
+ masm.PopRegsInMask(liveVolatileRegisters);
+
+ masm.bind(&allocated);
+
+ ValueOperand valueOperand;
+#ifdef JS_NUNBOX32
+ valueOperand = ValueOperand(scratch1, scratch2);
+#else
+ valueOperand = ValueOperand(scratch1);
+#endif
+
+ Label failureStoreOther, failureStoreObject;
+
+ for (size_t i = 0; i < layout.properties().length(); i++) {
+ const UnboxedLayout::Property& property = layout.properties()[i];
+ Address valueAddress(propertiesReg, i * sizeof(IdValuePair) + offsetof(IdValuePair, value));
+ Address targetAddress(object, UnboxedPlainObject::offsetOfData() + property.offset);
+
+ masm.loadValue(valueAddress, valueOperand);
+
+ if (property.type == JSVAL_TYPE_OBJECT) {
+ HeapTypeSet* types = group->maybeGetProperty(IdToTypeId(NameToId(property.name)));
+
+ Label notObject;
+ masm.branchTestObject(Assembler::NotEqual, valueOperand,
+ types->mightBeMIRType(MIRType::Null) ? &notObject : &failureStoreObject);
+
+ Register payloadReg = masm.extractObject(valueOperand, scratch1);
+
+ if (!types->hasType(TypeSet::AnyObjectType())) {
+ Register scratch = (payloadReg == scratch1) ? scratch2 : scratch1;
+ masm.guardObjectType(payloadReg, types, scratch, &failureStoreObject);
+ }
+
+ masm.storeUnboxedProperty(targetAddress, JSVAL_TYPE_OBJECT,
+ TypedOrValueRegister(MIRType::Object,
+ AnyRegister(payloadReg)), nullptr);
+
+ if (notObject.used()) {
+ Label done;
+ masm.jump(&done);
+ masm.bind(&notObject);
+ masm.branchTestNull(Assembler::NotEqual, valueOperand, &failureStoreOther);
+ masm.storeUnboxedProperty(targetAddress, JSVAL_TYPE_OBJECT, NullValue(), nullptr);
+ masm.bind(&done);
+ }
+ } else {
+ masm.storeUnboxedProperty(targetAddress, property.type,
+ ConstantOrRegister(valueOperand), &failureStoreOther);
+ }
+ }
+
+ Label done;
+ masm.bind(&done);
+
+ if (object != ReturnReg)
+ masm.movePtr(object, ReturnReg);
+
+ // Restore non-volatile registers which were saved on entry.
+ if (ScratchDoubleReg.volatile_())
+ masm.pop(ScratchDoubleReg);
+ masm.PopRegsInMask(savedNonVolatileRegisters);
+
+ masm.abiret();
+
+ masm.bind(&failureStoreOther);
+
+ // There was a failure while storing a value which cannot be stored at all
+ // in the unboxed object. Initialize the object so it is safe for GC and
+ // return null.
+ masm.initUnboxedObjectContents(object, templateObject);
+
+ masm.bind(&failure);
+
+ masm.movePtr(ImmWord(0), object);
+ masm.jump(&done);
+
+ masm.bind(&failureStoreObject);
+
+ // There was a failure while storing a value to an object slot of the
+ // unboxed object. If the value is storable, the failure occurred due to
+ // incomplete type information in the object, so return a token to trigger
+ // regeneration of the jitcode after a new object is created in the VM.
+ {
+ Label isObject;
+ masm.branchTestObject(Assembler::Equal, valueOperand, &isObject);
+ masm.branchTestNull(Assembler::NotEqual, valueOperand, &failureStoreOther);
+ masm.bind(&isObject);
+ }
+
+ // Initialize the object so it is safe for GC.
+ masm.initUnboxedObjectContents(object, templateObject);
+
+ masm.movePtr(ImmWord(CLEAR_CONSTRUCTOR_CODE_TOKEN), object);
+ masm.jump(&done);
+
+ Linker linker(masm);
+ AutoFlushICache afc("UnboxedObject");
+ JitCode* code = linker.newCode<NoGC>(cx, OTHER_CODE);
+ if (!code)
+ return false;
+
+ layout.setConstructorCode(code);
+ return true;
+}
+
+void
+UnboxedLayout::detachFromCompartment()
+{
+ if (isInList())
+ remove();
+}
+
+/////////////////////////////////////////////////////////////////////
+// UnboxedPlainObject
+/////////////////////////////////////////////////////////////////////
+
+bool
+UnboxedPlainObject::setValue(ExclusiveContext* cx, const UnboxedLayout::Property& property,
+ const Value& v)
+{
+ uint8_t* p = &data_[property.offset];
+ return SetUnboxedValue(cx, this, NameToId(property.name), p, property.type, v,
+ /* preBarrier = */ true);
+}
+
+Value
+UnboxedPlainObject::getValue(const UnboxedLayout::Property& property,
+ bool maybeUninitialized /* = false */)
+{
+ uint8_t* p = &data_[property.offset];
+ return GetUnboxedValue(p, property.type, maybeUninitialized);
+}
+
+void
+UnboxedPlainObject::trace(JSTracer* trc, JSObject* obj)
+{
+ if (obj->as<UnboxedPlainObject>().expando_) {
+ TraceManuallyBarrieredEdge(trc,
+ reinterpret_cast<NativeObject**>(&obj->as<UnboxedPlainObject>().expando_),
+ "unboxed_expando");
+ }
+
+ const UnboxedLayout& layout = obj->as<UnboxedPlainObject>().layoutDontCheckGeneration();
+ const int32_t* list = layout.traceList();
+ if (!list)
+ return;
+
+ uint8_t* data = obj->as<UnboxedPlainObject>().data();
+ while (*list != -1) {
+ GCPtrString* heap = reinterpret_cast<GCPtrString*>(data + *list);
+ TraceEdge(trc, heap, "unboxed_string");
+ list++;
+ }
+ list++;
+ while (*list != -1) {
+ GCPtrObject* heap = reinterpret_cast<GCPtrObject*>(data + *list);
+ TraceNullableEdge(trc, heap, "unboxed_object");
+ list++;
+ }
+
+ // Unboxed objects don't have Values to trace.
+ MOZ_ASSERT(*(list + 1) == -1);
+}
+
+/* static */ UnboxedExpandoObject*
+UnboxedPlainObject::ensureExpando(JSContext* cx, Handle<UnboxedPlainObject*> obj)
+{
+ if (obj->expando_)
+ return obj->expando_;
+
+ UnboxedExpandoObject* expando =
+ NewObjectWithGivenProto<UnboxedExpandoObject>(cx, nullptr, gc::AllocKind::OBJECT4);
+ if (!expando)
+ return nullptr;
+
+ // Don't track property types for expando objects. This allows Baseline
+ // and Ion AddSlot ICs to guard on the unboxed group without guarding on
+ // the expando group.
+ MarkObjectGroupUnknownProperties(cx, expando->group());
+
+ // If the expando is tenured then the original object must also be tenured.
+ // Otherwise barriers triggered on the original object for writes to the
+ // expando (as can happen in the JIT) won't see the tenured->nursery edge.
+ // See WholeCellEdges::mark.
+ MOZ_ASSERT_IF(!IsInsideNursery(expando), !IsInsideNursery(obj));
+
+ // As with setValue(), we need to manually trigger post barriers on the
+ // whole object. If we treat the field as a GCPtrObject and later
+ // convert the object to its native representation, we will end up with a
+ // corrupted store buffer entry.
+ if (IsInsideNursery(expando) && !IsInsideNursery(obj))
+ cx->runtime()->gc.storeBuffer.putWholeCell(obj);
+
+ obj->expando_ = expando;
+ return expando;
+}
+
+bool
+UnboxedPlainObject::containsUnboxedOrExpandoProperty(ExclusiveContext* cx, jsid id) const
+{
+ if (layout().lookup(id))
+ return true;
+
+ if (maybeExpando() && maybeExpando()->containsShapeOrElement(cx, id))
+ return true;
+
+ return false;
+}
+
+static bool
+PropagatePropertyTypes(JSContext* cx, jsid id, ObjectGroup* oldGroup, ObjectGroup* newGroup)
+{
+ HeapTypeSet* typeProperty = oldGroup->maybeGetProperty(id);
+ TypeSet::TypeList types;
+ if (!typeProperty->enumerateTypes(&types)) {
+ ReportOutOfMemory(cx);
+ return false;
+ }
+ for (size_t j = 0; j < types.length(); j++)
+ AddTypePropertyId(cx, newGroup, nullptr, id, types[j]);
+ return true;
+}
+
+static PlainObject*
+MakeReplacementTemplateObject(JSContext* cx, HandleObjectGroup group, const UnboxedLayout &layout)
+{
+ PlainObject* obj = NewObjectWithGroup<PlainObject>(cx, group, layout.getAllocKind(),
+ TenuredObject);
+ if (!obj)
+ return nullptr;
+
+ for (size_t i = 0; i < layout.properties().length(); i++) {
+ const UnboxedLayout::Property& property = layout.properties()[i];
+ if (!obj->addDataProperty(cx, NameToId(property.name), i, JSPROP_ENUMERATE))
+ return nullptr;
+ MOZ_ASSERT(obj->slotSpan() == i + 1);
+ MOZ_ASSERT(!obj->inDictionaryMode());
+ }
+
+ return obj;
+}
+
+/* static */ bool
+UnboxedLayout::makeNativeGroup(JSContext* cx, ObjectGroup* group)
+{
+ AutoEnterAnalysis enter(cx);
+
+ UnboxedLayout& layout = group->unboxedLayout();
+ Rooted<TaggedProto> proto(cx, group->proto());
+
+ MOZ_ASSERT(!layout.nativeGroup());
+
+ RootedObjectGroup replacementGroup(cx);
+
+ const Class* clasp = layout.isArray() ? &ArrayObject::class_ : &PlainObject::class_;
+
+ // Immediately clear any new script on the group. This is done by replacing
+ // the existing new script with one for a replacement default new group.
+ // This is done so that the size of the replacment group's objects is the
+ // same as that for the unboxed group, so that we do not see polymorphic
+ // slot accesses later on for sites that see converted objects from this
+ // group and objects that were allocated using the replacement new group.
+ if (layout.newScript()) {
+ MOZ_ASSERT(!layout.isArray());
+
+ replacementGroup = ObjectGroupCompartment::makeGroup(cx, &PlainObject::class_, proto);
+ if (!replacementGroup)
+ return false;
+
+ PlainObject* templateObject = MakeReplacementTemplateObject(cx, replacementGroup, layout);
+ if (!templateObject)
+ return false;
+
+ TypeNewScript* replacementNewScript =
+ TypeNewScript::makeNativeVersion(cx, layout.newScript(), templateObject);
+ if (!replacementNewScript)
+ return false;
+
+ replacementGroup->setNewScript(replacementNewScript);
+ gc::TraceTypeNewScript(replacementGroup);
+
+ group->clearNewScript(cx, replacementGroup);
+ }
+
+ // Similarly, if this group is keyed to an allocation site, replace its
+ // entry with a new group that has no unboxed layout.
+ if (layout.allocationScript()) {
+ RootedScript script(cx, layout.allocationScript());
+ jsbytecode* pc = layout.allocationPc();
+
+ replacementGroup = ObjectGroupCompartment::makeGroup(cx, clasp, proto);
+ if (!replacementGroup)
+ return false;
+
+ PlainObject* templateObject = &script->getObject(pc)->as<PlainObject>();
+ replacementGroup->addDefiniteProperties(cx, templateObject->lastProperty());
+
+ JSProtoKey key = layout.isArray() ? JSProto_Array : JSProto_Object;
+ cx->compartment()->objectGroups.replaceAllocationSiteGroup(script, pc, key,
+ replacementGroup);
+
+ // Clear any baseline information at this opcode which might use the old group.
+ if (script->hasBaselineScript()) {
+ jit::ICEntry& entry = script->baselineScript()->icEntryFromPCOffset(script->pcToOffset(pc));
+ jit::ICFallbackStub* fallback = entry.fallbackStub();
+ for (jit::ICStubIterator iter = fallback->beginChain(); !iter.atEnd(); iter++)
+ iter.unlink(cx);
+ if (fallback->isNewObject_Fallback())
+ fallback->toNewObject_Fallback()->setTemplateObject(nullptr);
+ else if (fallback->isNewArray_Fallback())
+ fallback->toNewArray_Fallback()->setTemplateGroup(replacementGroup);
+ }
+ }
+
+ size_t nfixed = layout.isArray() ? 0 : gc::GetGCKindSlots(layout.getAllocKind());
+
+ if (layout.isArray()) {
+ // The length shape to use for arrays is cached via a modified initial
+ // shape for array objects. Create an array now to make sure this entry
+ // is instantiated.
+ if (!NewDenseEmptyArray(cx))
+ return false;
+ }
+
+ RootedShape shape(cx, EmptyShape::getInitialShape(cx, clasp, proto, nfixed, 0));
+ if (!shape)
+ return false;
+
+ MOZ_ASSERT_IF(layout.isArray(), !shape->isEmptyShape() && shape->slotSpan() == 0);
+
+ // Add shapes for each property, if this is for a plain object.
+ for (size_t i = 0; i < layout.properties().length(); i++) {
+ const UnboxedLayout::Property& property = layout.properties()[i];
+
+ Rooted<StackShape> child(cx, StackShape(shape->base()->unowned(), NameToId(property.name),
+ i, JSPROP_ENUMERATE, 0));
+ shape = cx->zone()->propertyTree.getChild(cx, shape, child);
+ if (!shape)
+ return false;
+ }
+
+ ObjectGroup* nativeGroup =
+ ObjectGroupCompartment::makeGroup(cx, clasp, proto,
+ group->flags() & OBJECT_FLAG_DYNAMIC_MASK);
+ if (!nativeGroup)
+ return false;
+
+ // No sense propagating if we don't know what we started with.
+ if (!group->unknownProperties()) {
+ // Propagate all property types from the old group to the new group.
+ if (layout.isArray()) {
+ if (!PropagatePropertyTypes(cx, JSID_VOID, group, nativeGroup))
+ return false;
+ } else {
+ for (size_t i = 0; i < layout.properties().length(); i++) {
+ const UnboxedLayout::Property& property = layout.properties()[i];
+ jsid id = NameToId(property.name);
+ if (!PropagatePropertyTypes(cx, id, group, nativeGroup))
+ return false;
+
+ // If we are OOM we may not be able to propagate properties.
+ if (nativeGroup->unknownProperties())
+ break;
+
+ HeapTypeSet* nativeProperty = nativeGroup->maybeGetProperty(id);
+ if (nativeProperty && nativeProperty->canSetDefinite(i))
+ nativeProperty->setDefinite(i);
+ }
+ }
+ } else {
+ // If we skip, though, the new group had better agree.
+ MOZ_ASSERT(nativeGroup->unknownProperties());
+ }
+
+ layout.nativeGroup_ = nativeGroup;
+ layout.nativeShape_ = shape;
+ layout.replacementGroup_ = replacementGroup;
+
+ nativeGroup->setOriginalUnboxedGroup(group);
+
+ group->markStateChange(cx);
+
+ return true;
+}
+
+/* static */ bool
+UnboxedPlainObject::convertToNative(JSContext* cx, JSObject* obj)
+{
+ const UnboxedLayout& layout = obj->as<UnboxedPlainObject>().layout();
+ UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando();
+
+ if (!layout.nativeGroup()) {
+ if (!UnboxedLayout::makeNativeGroup(cx, obj->group()))
+ return false;
+
+ // makeNativeGroup can reentrantly invoke this method.
+ if (obj->is<PlainObject>())
+ return true;
+ }
+
+ AutoValueVector values(cx);
+ for (size_t i = 0; i < layout.properties().length(); i++) {
+ // We might be reading properties off the object which have not been
+ // initialized yet. Make sure any double values we read here are
+ // canonicalized.
+ if (!values.append(obj->as<UnboxedPlainObject>().getValue(layout.properties()[i], true)))
+ return false;
+ }
+
+ // We are eliminating the expando edge with the conversion, so trigger a
+ // pre barrier.
+ JSObject::writeBarrierPre(expando);
+
+ // Additionally trigger a post barrier on the expando itself. Whole cell
+ // store buffer entries can be added on the original unboxed object for
+ // writes to the expando (see WholeCellEdges::trace), so after conversion
+ // we need to make sure the expando itself will still be traced.
+ if (expando && !IsInsideNursery(expando))
+ cx->runtime()->gc.storeBuffer.putWholeCell(expando);
+
+ obj->setGroup(layout.nativeGroup());
+ obj->as<PlainObject>().setLastPropertyMakeNative(cx, layout.nativeShape());
+
+ for (size_t i = 0; i < values.length(); i++)
+ obj->as<PlainObject>().initSlotUnchecked(i, values[i]);
+
+ if (expando) {
+ // Add properties from the expando object to the object, in order.
+ // Suppress GC here, so that callers don't need to worry about this
+ // method collecting. The stuff below can only fail due to OOM, in
+ // which case the object will not have been completely filled back in.
+ gc::AutoSuppressGC suppress(cx);
+
+ Vector<jsid> ids(cx);
+ for (Shape::Range<NoGC> r(expando->lastProperty()); !r.empty(); r.popFront()) {
+ if (!ids.append(r.front().propid()))
+ return false;
+ }
+ for (size_t i = 0; i < expando->getDenseInitializedLength(); i++) {
+ if (!expando->getDenseElement(i).isMagic(JS_ELEMENTS_HOLE)) {
+ if (!ids.append(INT_TO_JSID(i)))
+ return false;
+ }
+ }
+ ::Reverse(ids.begin(), ids.end());
+
+ RootedPlainObject nobj(cx, &obj->as<PlainObject>());
+ Rooted<UnboxedExpandoObject*> nexpando(cx, expando);
+ RootedId id(cx);
+ Rooted<PropertyDescriptor> desc(cx);
+ for (size_t i = 0; i < ids.length(); i++) {
+ id = ids[i];
+ if (!GetOwnPropertyDescriptor(cx, nexpando, id, &desc))
+ return false;
+ ObjectOpResult result;
+ if (!DefineProperty(cx, nobj, id, desc, result))
+ return false;
+ MOZ_ASSERT(result.ok());
+ }
+ }
+
+ return true;
+}
+
+/* static */
+UnboxedPlainObject*
+UnboxedPlainObject::create(ExclusiveContext* cx, HandleObjectGroup group, NewObjectKind newKind)
+{
+ AutoSetNewObjectMetadata metadata(cx);
+
+ MOZ_ASSERT(group->clasp() == &class_);
+ gc::AllocKind allocKind = group->unboxedLayout().getAllocKind();
+
+ UnboxedPlainObject* res =
+ NewObjectWithGroup<UnboxedPlainObject>(cx, group, allocKind, newKind);
+ if (!res)
+ return nullptr;
+
+ // Overwrite the dummy shape which was written to the object's expando field.
+ res->initExpando();
+
+ // Initialize reference fields of the object. All fields in the object will
+ // be overwritten shortly, but references need to be safe for the GC.
+ const int32_t* list = res->layout().traceList();
+ if (list) {
+ uint8_t* data = res->data();
+ while (*list != -1) {
+ GCPtrString* heap = reinterpret_cast<GCPtrString*>(data + *list);
+ heap->init(cx->names().empty);
+ list++;
+ }
+ list++;
+ while (*list != -1) {
+ GCPtrObject* heap = reinterpret_cast<GCPtrObject*>(data + *list);
+ heap->init(nullptr);
+ list++;
+ }
+ // Unboxed objects don't have Values to initialize.
+ MOZ_ASSERT(*(list + 1) == -1);
+ }
+
+ return res;
+}
+
+/* static */ JSObject*
+UnboxedPlainObject::createWithProperties(ExclusiveContext* cx, HandleObjectGroup group,
+ NewObjectKind newKind, IdValuePair* properties)
+{
+ MOZ_ASSERT(newKind == GenericObject || newKind == TenuredObject);
+
+ UnboxedLayout& layout = group->unboxedLayout();
+
+ if (layout.constructorCode()) {
+ MOZ_ASSERT(cx->isJSContext());
+
+ typedef JSObject* (*ConstructorCodeSignature)(IdValuePair*, NewObjectKind);
+ ConstructorCodeSignature function =
+ reinterpret_cast<ConstructorCodeSignature>(layout.constructorCode()->raw());
+
+ JSObject* obj;
+ {
+ JS::AutoSuppressGCAnalysis nogc;
+ obj = reinterpret_cast<JSObject*>(CALL_GENERATED_2(function, properties, newKind));
+ }
+ if (obj > reinterpret_cast<JSObject*>(CLEAR_CONSTRUCTOR_CODE_TOKEN))
+ return obj;
+
+ if (obj == reinterpret_cast<JSObject*>(CLEAR_CONSTRUCTOR_CODE_TOKEN))
+ layout.setConstructorCode(nullptr);
+ }
+
+ UnboxedPlainObject* obj = UnboxedPlainObject::create(cx, group, newKind);
+ if (!obj)
+ return nullptr;
+
+ for (size_t i = 0; i < layout.properties().length(); i++) {
+ if (!obj->setValue(cx, layout.properties()[i], properties[i].value))
+ return NewPlainObjectWithProperties(cx, properties, layout.properties().length(), newKind);
+ }
+
+#ifndef JS_CODEGEN_NONE
+ if (cx->isJSContext() &&
+ !group->unknownProperties() &&
+ !layout.constructorCode() &&
+ cx->asJSContext()->runtime()->jitSupportsFloatingPoint &&
+ jit::CanLikelyAllocateMoreExecutableMemory())
+ {
+ if (!UnboxedLayout::makeConstructorCode(cx->asJSContext(), group))
+ return nullptr;
+ }
+#endif
+
+ return obj;
+}
+
+/* static */ bool
+UnboxedPlainObject::obj_lookupProperty(JSContext* cx, HandleObject obj,
+ HandleId id, MutableHandleObject objp,
+ MutableHandleShape propp)
+{
+ if (obj->as<UnboxedPlainObject>().containsUnboxedOrExpandoProperty(cx, id)) {
+ MarkNonNativePropertyFound<CanGC>(propp);
+ objp.set(obj);
+ return true;
+ }
+
+ RootedObject proto(cx, obj->staticPrototype());
+ if (!proto) {
+ objp.set(nullptr);
+ propp.set(nullptr);
+ return true;
+ }
+
+ return LookupProperty(cx, proto, id, objp, propp);
+}
+
+/* static */ bool
+UnboxedPlainObject::obj_defineProperty(JSContext* cx, HandleObject obj, HandleId id,
+ Handle<PropertyDescriptor> desc,
+ ObjectOpResult& result)
+{
+ const UnboxedLayout& layout = obj->as<UnboxedPlainObject>().layout();
+
+ if (const UnboxedLayout::Property* property = layout.lookup(id)) {
+ if (!desc.getter() && !desc.setter() && desc.attributes() == JSPROP_ENUMERATE) {
+ // This define is equivalent to setting an existing property.
+ if (obj->as<UnboxedPlainObject>().setValue(cx, *property, desc.value()))
+ return result.succeed();
+ }
+
+ // Trying to incompatibly redefine an existing property requires the
+ // object to be converted to a native object.
+ if (!convertToNative(cx, obj))
+ return false;
+
+ return DefineProperty(cx, obj, id, desc, result);
+ }
+
+ // Define the property on the expando object.
+ Rooted<UnboxedExpandoObject*> expando(cx, ensureExpando(cx, obj.as<UnboxedPlainObject>()));
+ if (!expando)
+ return false;
+
+ // Update property types on the unboxed object as well.
+ AddTypePropertyId(cx, obj, id, desc.value());
+
+ return DefineProperty(cx, expando, id, desc, result);
+}
+
+/* static */ bool
+UnboxedPlainObject::obj_hasProperty(JSContext* cx, HandleObject obj, HandleId id, bool* foundp)
+{
+ if (obj->as<UnboxedPlainObject>().containsUnboxedOrExpandoProperty(cx, id)) {
+ *foundp = true;
+ return true;
+ }
+
+ RootedObject proto(cx, obj->staticPrototype());
+ if (!proto) {
+ *foundp = false;
+ return true;
+ }
+
+ return HasProperty(cx, proto, id, foundp);
+}
+
+/* static */ bool
+UnboxedPlainObject::obj_getProperty(JSContext* cx, HandleObject obj, HandleValue receiver,
+ HandleId id, MutableHandleValue vp)
+{
+ const UnboxedLayout& layout = obj->as<UnboxedPlainObject>().layout();
+
+ if (const UnboxedLayout::Property* property = layout.lookup(id)) {
+ vp.set(obj->as<UnboxedPlainObject>().getValue(*property));
+ return true;
+ }
+
+ if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando()) {
+ if (expando->containsShapeOrElement(cx, id)) {
+ RootedObject nexpando(cx, expando);
+ return GetProperty(cx, nexpando, receiver, id, vp);
+ }
+ }
+
+ RootedObject proto(cx, obj->staticPrototype());
+ if (!proto) {
+ vp.setUndefined();
+ return true;
+ }
+
+ return GetProperty(cx, proto, receiver, id, vp);
+}
+
+/* static */ bool
+UnboxedPlainObject::obj_setProperty(JSContext* cx, HandleObject obj, HandleId id, HandleValue v,
+ HandleValue receiver, ObjectOpResult& result)
+{
+ const UnboxedLayout& layout = obj->as<UnboxedPlainObject>().layout();
+
+ if (const UnboxedLayout::Property* property = layout.lookup(id)) {
+ if (receiver.isObject() && obj == &receiver.toObject()) {
+ if (obj->as<UnboxedPlainObject>().setValue(cx, *property, v))
+ return result.succeed();
+
+ if (!convertToNative(cx, obj))
+ return false;
+ return SetProperty(cx, obj, id, v, receiver, result);
+ }
+
+ return SetPropertyByDefining(cx, id, v, receiver, result);
+ }
+
+ if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando()) {
+ if (expando->containsShapeOrElement(cx, id)) {
+ // Update property types on the unboxed object as well.
+ AddTypePropertyId(cx, obj, id, v);
+
+ RootedObject nexpando(cx, expando);
+ return SetProperty(cx, nexpando, id, v, receiver, result);
+ }
+ }
+
+ return SetPropertyOnProto(cx, obj, id, v, receiver, result);
+}
+
+/* static */ bool
+UnboxedPlainObject::obj_getOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
+ MutableHandle<PropertyDescriptor> desc)
+{
+ const UnboxedLayout& layout = obj->as<UnboxedPlainObject>().layout();
+
+ if (const UnboxedLayout::Property* property = layout.lookup(id)) {
+ desc.value().set(obj->as<UnboxedPlainObject>().getValue(*property));
+ desc.setAttributes(JSPROP_ENUMERATE);
+ desc.object().set(obj);
+ return true;
+ }
+
+ if (UnboxedExpandoObject* expando = obj->as<UnboxedPlainObject>().maybeExpando()) {
+ if (expando->containsShapeOrElement(cx, id)) {
+ RootedObject nexpando(cx, expando);
+ if (!GetOwnPropertyDescriptor(cx, nexpando, id, desc))
+ return false;
+ if (desc.object() == nexpando)
+ desc.object().set(obj);
+ return true;
+ }
+ }
+
+ desc.object().set(nullptr);
+ return true;
+}
+
+/* static */ bool
+UnboxedPlainObject::obj_deleteProperty(JSContext* cx, HandleObject obj, HandleId id,
+ ObjectOpResult& result)
+{
+ if (!convertToNative(cx, obj))
+ return false;
+ return DeleteProperty(cx, obj, id, result);
+}
+
+/* static */ bool
+UnboxedPlainObject::obj_enumerate(JSContext* cx, HandleObject obj, AutoIdVector& properties,
+ bool enumerableOnly)
+{
+ // Ignore expando properties here, they are special-cased by the property
+ // enumeration code.
+
+ const UnboxedLayout::PropertyVector& unboxed = obj->as<UnboxedPlainObject>().layout().properties();
+ for (size_t i = 0; i < unboxed.length(); i++) {
+ if (!properties.append(NameToId(unboxed[i].name)))
+ return false;
+ }
+
+ return true;
+}
+
+const Class UnboxedExpandoObject::class_ = {
+ "UnboxedExpandoObject",
+ 0
+};
+
+static const ClassOps UnboxedPlainObjectClassOps = {
+ nullptr, /* addProperty */
+ nullptr, /* delProperty */
+ nullptr, /* getProperty */
+ nullptr, /* setProperty */
+ nullptr, /* enumerate */
+ nullptr, /* resolve */
+ nullptr, /* mayResolve */
+ nullptr, /* finalize */
+ nullptr, /* call */
+ nullptr, /* hasInstance */
+ nullptr, /* construct */
+ UnboxedPlainObject::trace,
+};
+
+static const ObjectOps UnboxedPlainObjectObjectOps = {
+ UnboxedPlainObject::obj_lookupProperty,
+ UnboxedPlainObject::obj_defineProperty,
+ UnboxedPlainObject::obj_hasProperty,
+ UnboxedPlainObject::obj_getProperty,
+ UnboxedPlainObject::obj_setProperty,
+ UnboxedPlainObject::obj_getOwnPropertyDescriptor,
+ UnboxedPlainObject::obj_deleteProperty,
+ nullptr, /* getElements */
+ UnboxedPlainObject::obj_enumerate,
+ nullptr /* funToString */
+};
+
+const Class UnboxedPlainObject::class_ = {
+ js_Object_str,
+ Class::NON_NATIVE |
+ JSCLASS_HAS_CACHED_PROTO(JSProto_Object) |
+ JSCLASS_DELAY_METADATA_BUILDER,
+ &UnboxedPlainObjectClassOps,
+ JS_NULL_CLASS_SPEC,
+ JS_NULL_CLASS_EXT,
+ &UnboxedPlainObjectObjectOps
+};
+
+/////////////////////////////////////////////////////////////////////
+// UnboxedArrayObject
+/////////////////////////////////////////////////////////////////////
+
+template <JSValueType Type>
+DenseElementResult
+AppendUnboxedDenseElements(UnboxedArrayObject* obj, uint32_t initlen,
+ MutableHandle<GCVector<Value>> values)
+{
+ for (size_t i = 0; i < initlen; i++)
+ values.infallibleAppend(obj->getElementSpecific<Type>(i));
+ return DenseElementResult::Success;
+}
+
+DefineBoxedOrUnboxedFunctor3(AppendUnboxedDenseElements,
+ UnboxedArrayObject*, uint32_t, MutableHandle<GCVector<Value>>);
+
+/* static */ bool
+UnboxedArrayObject::convertToNativeWithGroup(ExclusiveContext* cx, JSObject* obj,
+ ObjectGroup* group, Shape* shape)
+{
+ size_t length = obj->as<UnboxedArrayObject>().length();
+ size_t initlen = obj->as<UnboxedArrayObject>().initializedLength();
+
+ Rooted<GCVector<Value>> values(cx, GCVector<Value>(cx));
+ if (!values.reserve(initlen))
+ return false;
+
+ AppendUnboxedDenseElementsFunctor functor(&obj->as<UnboxedArrayObject>(), initlen, &values);
+ DebugOnly<DenseElementResult> result = CallBoxedOrUnboxedSpecialization(functor, obj);
+ MOZ_ASSERT(result.value == DenseElementResult::Success);
+
+ obj->setGroup(group);
+
+ ArrayObject* aobj = &obj->as<ArrayObject>();
+ aobj->setLastPropertyMakeNative(cx, shape);
+
+ // Make sure there is at least one element, so that this array does not
+ // use emptyObjectElements / emptyObjectElementsShared.
+ if (!aobj->ensureElements(cx, Max<size_t>(initlen, 1)))
+ return false;
+
+ MOZ_ASSERT(!aobj->getDenseInitializedLength());
+ aobj->setDenseInitializedLength(initlen);
+ aobj->initDenseElements(0, values.begin(), initlen);
+ aobj->setLengthInt32(length);
+
+ return true;
+}
+
+/* static */ bool
+UnboxedArrayObject::convertToNative(JSContext* cx, JSObject* obj)
+{
+ const UnboxedLayout& layout = obj->as<UnboxedArrayObject>().layout();
+
+ if (!layout.nativeGroup()) {
+ if (!UnboxedLayout::makeNativeGroup(cx, obj->group()))
+ return false;
+ }
+
+ return convertToNativeWithGroup(cx, obj, layout.nativeGroup(), layout.nativeShape());
+}
+
+bool
+UnboxedArrayObject::convertInt32ToDouble(ExclusiveContext* cx, ObjectGroup* group)
+{
+ MOZ_ASSERT(elementType() == JSVAL_TYPE_INT32);
+ MOZ_ASSERT(group->unboxedLayout().elementType() == JSVAL_TYPE_DOUBLE);
+
+ Vector<int32_t> values(cx);
+ if (!values.reserve(initializedLength()))
+ return false;
+ for (size_t i = 0; i < initializedLength(); i++)
+ values.infallibleAppend(getElementSpecific<JSVAL_TYPE_INT32>(i).toInt32());
+
+ uint8_t* newElements;
+ if (hasInlineElements()) {
+ newElements = AllocateObjectBuffer<uint8_t>(cx, this, capacity() * sizeof(double));
+ } else {
+ newElements = ReallocateObjectBuffer<uint8_t>(cx, this, elements(),
+ capacity() * sizeof(int32_t),
+ capacity() * sizeof(double));
+ }
+ if (!newElements)
+ return false;
+
+ setGroup(group);
+ elements_ = newElements;
+
+ for (size_t i = 0; i < initializedLength(); i++)
+ setElementNoTypeChangeSpecific<JSVAL_TYPE_DOUBLE>(i, DoubleValue(values[i]));
+
+ return true;
+}
+
+/* static */ UnboxedArrayObject*
+UnboxedArrayObject::create(ExclusiveContext* cx, HandleObjectGroup group, uint32_t length,
+ NewObjectKind newKind, uint32_t maxLength)
+{
+ MOZ_ASSERT(length <= MaximumCapacity);
+
+ MOZ_ASSERT(group->clasp() == &class_);
+ uint32_t elementSize = UnboxedTypeSize(group->unboxedLayout().elementType());
+ uint32_t capacity = Min(length, maxLength);
+ uint32_t nbytes = offsetOfInlineElements() + elementSize * capacity;
+
+ UnboxedArrayObject* res;
+ if (nbytes <= JSObject::MAX_BYTE_SIZE) {
+ gc::AllocKind allocKind = gc::GetGCObjectKindForBytes(nbytes);
+
+ // If there was no provided length information, pick an allocation kind
+ // to accommodate small arrays (as is done for normal native arrays).
+ if (capacity == 0)
+ allocKind = gc::AllocKind::OBJECT8;
+
+ res = NewObjectWithGroup<UnboxedArrayObject>(cx, group, allocKind, newKind);
+ if (!res)
+ return nullptr;
+ res->setInitializedLengthNoBarrier(0);
+ res->setInlineElements();
+
+ size_t actualCapacity = (GetGCKindBytes(allocKind) - offsetOfInlineElements()) / elementSize;
+ MOZ_ASSERT(actualCapacity >= capacity);
+ res->setCapacityIndex(exactCapacityIndex(actualCapacity));
+ } else {
+ res = NewObjectWithGroup<UnboxedArrayObject>(cx, group, gc::AllocKind::OBJECT0, newKind);
+ if (!res)
+ return nullptr;
+ res->setInitializedLengthNoBarrier(0);
+
+ uint32_t capacityIndex = (capacity == length)
+ ? CapacityMatchesLengthIndex
+ : chooseCapacityIndex(capacity, length);
+ uint32_t actualCapacity = computeCapacity(capacityIndex, length);
+
+ res->elements_ = AllocateObjectBuffer<uint8_t>(cx, res, actualCapacity * elementSize);
+ if (!res->elements_) {
+ // Make the object safe for GC.
+ res->setInlineElements();
+ return nullptr;
+ }
+
+ res->setCapacityIndex(capacityIndex);
+ }
+
+ res->setLength(cx, length);
+ return res;
+}
+
+bool
+UnboxedArrayObject::setElement(ExclusiveContext* cx, size_t index, const Value& v)
+{
+ MOZ_ASSERT(index < initializedLength());
+ uint8_t* p = elements() + index * elementSize();
+ return SetUnboxedValue(cx, this, JSID_VOID, p, elementType(), v, /* preBarrier = */ true);
+}
+
+bool
+UnboxedArrayObject::initElement(ExclusiveContext* cx, size_t index, const Value& v)
+{
+ MOZ_ASSERT(index < initializedLength());
+ uint8_t* p = elements() + index * elementSize();
+ return SetUnboxedValue(cx, this, JSID_VOID, p, elementType(), v, /* preBarrier = */ false);
+}
+
+void
+UnboxedArrayObject::initElementNoTypeChange(size_t index, const Value& v)
+{
+ MOZ_ASSERT(index < initializedLength());
+ uint8_t* p = elements() + index * elementSize();
+ if (UnboxedTypeNeedsPreBarrier(elementType()))
+ *reinterpret_cast<void**>(p) = nullptr;
+ SetUnboxedValueNoTypeChange(this, p, elementType(), v, /* preBarrier = */ false);
+}
+
+Value
+UnboxedArrayObject::getElement(size_t index)
+{
+ MOZ_ASSERT(index < initializedLength());
+ uint8_t* p = elements() + index * elementSize();
+ return GetUnboxedValue(p, elementType(), /* maybeUninitialized = */ false);
+}
+
+/* static */ void
+UnboxedArrayObject::trace(JSTracer* trc, JSObject* obj)
+{
+ JSValueType type = obj->as<UnboxedArrayObject>().elementType();
+ if (!UnboxedTypeNeedsPreBarrier(type))
+ return;
+
+ MOZ_ASSERT(obj->as<UnboxedArrayObject>().elementSize() == sizeof(uintptr_t));
+ size_t initlen = obj->as<UnboxedArrayObject>().initializedLength();
+ void** elements = reinterpret_cast<void**>(obj->as<UnboxedArrayObject>().elements());
+
+ switch (type) {
+ case JSVAL_TYPE_OBJECT:
+ for (size_t i = 0; i < initlen; i++) {
+ GCPtrObject* heap = reinterpret_cast<GCPtrObject*>(elements + i);
+ TraceNullableEdge(trc, heap, "unboxed_object");
+ }
+ break;
+
+ case JSVAL_TYPE_STRING:
+ for (size_t i = 0; i < initlen; i++) {
+ GCPtrString* heap = reinterpret_cast<GCPtrString*>(elements + i);
+ TraceEdge(trc, heap, "unboxed_string");
+ }
+ break;
+
+ default:
+ MOZ_CRASH();
+ }
+}
+
+/* static */ void
+UnboxedArrayObject::objectMoved(JSObject* obj, const JSObject* old)
+{
+ UnboxedArrayObject& dst = obj->as<UnboxedArrayObject>();
+ const UnboxedArrayObject& src = old->as<UnboxedArrayObject>();
+
+ // Fix up possible inline data pointer.
+ if (src.hasInlineElements())
+ dst.setInlineElements();
+}
+
+/* static */ void
+UnboxedArrayObject::finalize(FreeOp* fop, JSObject* obj)
+{
+ MOZ_ASSERT(!IsInsideNursery(obj));
+ if (!obj->as<UnboxedArrayObject>().hasInlineElements())
+ js_free(obj->as<UnboxedArrayObject>().elements());
+}
+
+/* static */ size_t
+UnboxedArrayObject::objectMovedDuringMinorGC(JSTracer* trc, JSObject* dst, JSObject* src,
+ gc::AllocKind allocKind)
+{
+ UnboxedArrayObject* ndst = &dst->as<UnboxedArrayObject>();
+ UnboxedArrayObject* nsrc = &src->as<UnboxedArrayObject>();
+ MOZ_ASSERT(ndst->elements() == nsrc->elements());
+
+ Nursery& nursery = trc->runtime()->gc.nursery;
+
+ if (!nursery.isInside(nsrc->elements())) {
+ nursery.removeMallocedBuffer(nsrc->elements());
+ return 0;
+ }
+
+ // Determine if we can use inline data for the target array. If this is
+ // possible, the nursery will have picked an allocation size that is large
+ // enough.
+ size_t nbytes = nsrc->capacity() * nsrc->elementSize();
+ if (offsetOfInlineElements() + nbytes <= GetGCKindBytes(allocKind)) {
+ ndst->setInlineElements();
+ } else {
+ MOZ_ASSERT(allocKind == gc::AllocKind::OBJECT0);
+
+ AutoEnterOOMUnsafeRegion oomUnsafe;
+ uint8_t* data = nsrc->zone()->pod_malloc<uint8_t>(nbytes);
+ if (!data)
+ oomUnsafe.crash("Failed to allocate unboxed array elements while tenuring.");
+ ndst->elements_ = data;
+ }
+
+ PodCopy(ndst->elements(), nsrc->elements(), nsrc->initializedLength() * nsrc->elementSize());
+
+ // Set a forwarding pointer for the element buffers in case they were
+ // preserved on the stack by Ion.
+ bool direct = nsrc->capacity() * nsrc->elementSize() >= sizeof(uintptr_t);
+ nursery.maybeSetForwardingPointer(trc, nsrc->elements(), ndst->elements(), direct);
+
+ return ndst->hasInlineElements() ? 0 : nbytes;
+}
+
+// Possible capacities for unboxed arrays. Some of these capacities might seem
+// a little weird, but were chosen to allow the inline data of objects of each
+// size to be fully utilized for arrays of the various types on both 32 bit and
+// 64 bit platforms.
+//
+// To find the possible inline capacities, the following script was used:
+//
+// var fixedSlotCapacities = [0, 2, 4, 8, 12, 16];
+// var dataSizes = [1, 4, 8];
+// var header32 = 4 * 2 + 4 * 2;
+// var header64 = 8 * 2 + 4 * 2;
+//
+// for (var i = 0; i < fixedSlotCapacities.length; i++) {
+// var nfixed = fixedSlotCapacities[i];
+// var size32 = 4 * 4 + 8 * nfixed - header32;
+// var size64 = 8 * 4 + 8 * nfixed - header64;
+// for (var j = 0; j < dataSizes.length; j++) {
+// print(size32 / dataSizes[j]);
+// print(size64 / dataSizes[j]);
+// }
+// }
+//
+/* static */ const uint32_t
+UnboxedArrayObject::CapacityArray[] = {
+ UINT32_MAX, // For CapacityMatchesLengthIndex.
+ 0, 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 13, 16, 17, 18, 24, 26, 32, 34, 40, 64, 72, 96, 104, 128, 136,
+ 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072, 262144, 524288,
+ 1048576, 2097152, 3145728, 4194304, 5242880, 6291456, 7340032, 8388608, 9437184, 11534336,
+ 13631488, 15728640, 17825792, 20971520, 24117248, 27262976, 31457280, 35651584, 40894464,
+ 46137344, 52428800, 59768832, MaximumCapacity
+};
+
+static const uint32_t
+Pow2CapacityIndexes[] = {
+ 2, // 1
+ 3, // 2
+ 5, // 4
+ 8, // 8
+ 13, // 16
+ 18, // 32
+ 21, // 64
+ 25, // 128
+ 27, // 256
+ 28, // 512
+ 29, // 1024
+ 30, // 2048
+ 31, // 4096
+ 32, // 8192
+ 33, // 16384
+ 34, // 32768
+ 35, // 65536
+ 36, // 131072
+ 37, // 262144
+ 38, // 524288
+ 39 // 1048576
+};
+
+static const uint32_t MebiCapacityIndex = 39;
+
+/* static */ uint32_t
+UnboxedArrayObject::chooseCapacityIndex(uint32_t capacity, uint32_t length)
+{
+ // Note: the structure and behavior of this method follow along with
+ // NativeObject::goodAllocated. Changes to the allocation strategy in one
+ // should generally be matched by the other.
+
+ // Make sure we have enough space to store all possible values for the capacity index.
+ // This ought to be a static_assert, but MSVC doesn't like that.
+ MOZ_ASSERT(mozilla::ArrayLength(CapacityArray) - 1 <= (CapacityMask >> CapacityShift));
+
+ // The caller should have ensured the capacity is possible for an unboxed array.
+ MOZ_ASSERT(capacity <= MaximumCapacity);
+
+ static const uint32_t Mebi = 1024 * 1024;
+
+ if (capacity <= Mebi) {
+ capacity = mozilla::RoundUpPow2(capacity);
+
+ // When the required capacity is close to the array length, then round
+ // up to the array length itself, as for NativeObject.
+ if (length >= capacity && capacity > (length / 3) * 2)
+ return CapacityMatchesLengthIndex;
+
+ if (capacity < MinimumDynamicCapacity)
+ capacity = MinimumDynamicCapacity;
+
+ uint32_t bit = mozilla::FloorLog2Size(capacity);
+ MOZ_ASSERT(capacity == uint32_t(1 << bit));
+ MOZ_ASSERT(bit <= 20);
+ MOZ_ASSERT(mozilla::ArrayLength(Pow2CapacityIndexes) == 21);
+
+ uint32_t index = Pow2CapacityIndexes[bit];
+ MOZ_ASSERT(CapacityArray[index] == capacity);
+
+ return index;
+ }
+
+ MOZ_ASSERT(CapacityArray[MebiCapacityIndex] == Mebi);
+
+ for (uint32_t i = MebiCapacityIndex + 1;; i++) {
+ if (CapacityArray[i] >= capacity)
+ return i;
+ }
+
+ MOZ_CRASH("Invalid capacity");
+}
+
+/* static */ uint32_t
+UnboxedArrayObject::exactCapacityIndex(uint32_t capacity)
+{
+ for (size_t i = CapacityMatchesLengthIndex + 1; i < ArrayLength(CapacityArray); i++) {
+ if (CapacityArray[i] == capacity)
+ return i;
+ }
+ MOZ_CRASH();
+}
+
+bool
+UnboxedArrayObject::growElements(ExclusiveContext* cx, size_t cap)
+{
+ // The caller should have checked if this capacity is possible for an
+ // unboxed array, so the only way this call can fail is from OOM.
+ MOZ_ASSERT(cap <= MaximumCapacity);
+
+ uint32_t oldCapacity = capacity();
+ uint32_t newCapacityIndex = chooseCapacityIndex(cap, length());
+ uint32_t newCapacity = computeCapacity(newCapacityIndex, length());
+
+ MOZ_ASSERT(oldCapacity < cap);
+ MOZ_ASSERT(cap <= newCapacity);
+
+ // The allocation size computation below cannot have integer overflows.
+ JS_STATIC_ASSERT(MaximumCapacity < UINT32_MAX / sizeof(double));
+
+ uint8_t* newElements;
+ if (hasInlineElements()) {
+ newElements = AllocateObjectBuffer<uint8_t>(cx, this, newCapacity * elementSize());
+ if (!newElements)
+ return false;
+ js_memcpy(newElements, elements(), initializedLength() * elementSize());
+ } else {
+ newElements = ReallocateObjectBuffer<uint8_t>(cx, this, elements(),
+ oldCapacity * elementSize(),
+ newCapacity * elementSize());
+ if (!newElements)
+ return false;
+ }
+
+ elements_ = newElements;
+ setCapacityIndex(newCapacityIndex);
+
+ return true;
+}
+
+void
+UnboxedArrayObject::shrinkElements(ExclusiveContext* cx, size_t cap)
+{
+ if (hasInlineElements())
+ return;
+
+ uint32_t oldCapacity = capacity();
+ uint32_t newCapacityIndex = chooseCapacityIndex(cap, 0);
+ uint32_t newCapacity = computeCapacity(newCapacityIndex, 0);
+
+ MOZ_ASSERT(cap < oldCapacity);
+ MOZ_ASSERT(cap <= newCapacity);
+
+ if (newCapacity >= oldCapacity)
+ return;
+
+ uint8_t* newElements = ReallocateObjectBuffer<uint8_t>(cx, this, elements(),
+ oldCapacity * elementSize(),
+ newCapacity * elementSize());
+ if (!newElements)
+ return;
+
+ elements_ = newElements;
+ setCapacityIndex(newCapacityIndex);
+}
+
+bool
+UnboxedArrayObject::containsProperty(ExclusiveContext* cx, jsid id)
+{
+ if (JSID_IS_INT(id) && uint32_t(JSID_TO_INT(id)) < initializedLength())
+ return true;
+ if (JSID_IS_ATOM(id) && JSID_TO_ATOM(id) == cx->names().length)
+ return true;
+ return false;
+}
+
+/* static */ bool
+UnboxedArrayObject::obj_lookupProperty(JSContext* cx, HandleObject obj,
+ HandleId id, MutableHandleObject objp,
+ MutableHandleShape propp)
+{
+ if (obj->as<UnboxedArrayObject>().containsProperty(cx, id)) {
+ MarkNonNativePropertyFound<CanGC>(propp);
+ objp.set(obj);
+ return true;
+ }
+
+ RootedObject proto(cx, obj->staticPrototype());
+ if (!proto) {
+ objp.set(nullptr);
+ propp.set(nullptr);
+ return true;
+ }
+
+ return LookupProperty(cx, proto, id, objp, propp);
+}
+
+/* static */ bool
+UnboxedArrayObject::obj_defineProperty(JSContext* cx, HandleObject obj, HandleId id,
+ Handle<PropertyDescriptor> desc,
+ ObjectOpResult& result)
+{
+ if (JSID_IS_INT(id) && !desc.getter() && !desc.setter() && desc.attributes() == JSPROP_ENUMERATE) {
+ UnboxedArrayObject* nobj = &obj->as<UnboxedArrayObject>();
+
+ uint32_t index = JSID_TO_INT(id);
+ if (index < nobj->initializedLength()) {
+ if (nobj->setElement(cx, index, desc.value()))
+ return result.succeed();
+ } else if (index == nobj->initializedLength() && index < MaximumCapacity) {
+ if (nobj->initializedLength() == nobj->capacity()) {
+ if (!nobj->growElements(cx, index + 1))
+ return false;
+ }
+ nobj->setInitializedLength(index + 1);
+ if (nobj->initElement(cx, index, desc.value())) {
+ if (nobj->length() <= index)
+ nobj->setLengthInt32(index + 1);
+ return result.succeed();
+ }
+ nobj->setInitializedLengthNoBarrier(index);
+ }
+ }
+
+ if (!convertToNative(cx, obj))
+ return false;
+
+ return DefineProperty(cx, obj, id, desc, result);
+}
+
+/* static */ bool
+UnboxedArrayObject::obj_hasProperty(JSContext* cx, HandleObject obj, HandleId id, bool* foundp)
+{
+ if (obj->as<UnboxedArrayObject>().containsProperty(cx, id)) {
+ *foundp = true;
+ return true;
+ }
+
+ RootedObject proto(cx, obj->staticPrototype());
+ if (!proto) {
+ *foundp = false;
+ return true;
+ }
+
+ return HasProperty(cx, proto, id, foundp);
+}
+
+/* static */ bool
+UnboxedArrayObject::obj_getProperty(JSContext* cx, HandleObject obj, HandleValue receiver,
+ HandleId id, MutableHandleValue vp)
+{
+ if (obj->as<UnboxedArrayObject>().containsProperty(cx, id)) {
+ if (JSID_IS_INT(id))
+ vp.set(obj->as<UnboxedArrayObject>().getElement(JSID_TO_INT(id)));
+ else
+ vp.set(Int32Value(obj->as<UnboxedArrayObject>().length()));
+ return true;
+ }
+
+ RootedObject proto(cx, obj->staticPrototype());
+ if (!proto) {
+ vp.setUndefined();
+ return true;
+ }
+
+ return GetProperty(cx, proto, receiver, id, vp);
+}
+
+/* static */ bool
+UnboxedArrayObject::obj_setProperty(JSContext* cx, HandleObject obj, HandleId id, HandleValue v,
+ HandleValue receiver, ObjectOpResult& result)
+{
+ if (obj->as<UnboxedArrayObject>().containsProperty(cx, id)) {
+ if (receiver.isObject() && obj == &receiver.toObject()) {
+ if (JSID_IS_INT(id)) {
+ if (obj->as<UnboxedArrayObject>().setElement(cx, JSID_TO_INT(id), v))
+ return result.succeed();
+ } else {
+ uint32_t len;
+ if (!CanonicalizeArrayLengthValue(cx, v, &len))
+ return false;
+ UnboxedArrayObject* nobj = &obj->as<UnboxedArrayObject>();
+ if (len < nobj->initializedLength()) {
+ nobj->setInitializedLength(len);
+ nobj->shrinkElements(cx, len);
+ }
+ nobj->setLength(cx, len);
+ return result.succeed();
+ }
+
+ if (!convertToNative(cx, obj))
+ return false;
+ return SetProperty(cx, obj, id, v, receiver, result);
+ }
+
+ return SetPropertyByDefining(cx, id, v, receiver, result);
+ }
+
+ return SetPropertyOnProto(cx, obj, id, v, receiver, result);
+}
+
+/* static */ bool
+UnboxedArrayObject::obj_getOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
+ MutableHandle<PropertyDescriptor> desc)
+{
+ if (obj->as<UnboxedArrayObject>().containsProperty(cx, id)) {
+ if (JSID_IS_INT(id)) {
+ desc.value().set(obj->as<UnboxedArrayObject>().getElement(JSID_TO_INT(id)));
+ desc.setAttributes(JSPROP_ENUMERATE);
+ } else {
+ desc.value().set(Int32Value(obj->as<UnboxedArrayObject>().length()));
+ desc.setAttributes(JSPROP_PERMANENT);
+ }
+ desc.object().set(obj);
+ return true;
+ }
+
+ desc.object().set(nullptr);
+ return true;
+}
+
+/* static */ bool
+UnboxedArrayObject::obj_deleteProperty(JSContext* cx, HandleObject obj, HandleId id,
+ ObjectOpResult& result)
+{
+ if (obj->as<UnboxedArrayObject>().containsProperty(cx, id)) {
+ size_t initlen = obj->as<UnboxedArrayObject>().initializedLength();
+ if (JSID_IS_INT(id) && JSID_TO_INT(id) == int32_t(initlen - 1)) {
+ obj->as<UnboxedArrayObject>().setInitializedLength(initlen - 1);
+ obj->as<UnboxedArrayObject>().shrinkElements(cx, initlen - 1);
+ return result.succeed();
+ }
+ }
+
+ if (!convertToNative(cx, obj))
+ return false;
+ return DeleteProperty(cx, obj, id, result);
+}
+
+/* static */ bool
+UnboxedArrayObject::obj_enumerate(JSContext* cx, HandleObject obj, AutoIdVector& properties,
+ bool enumerableOnly)
+{
+ for (size_t i = 0; i < obj->as<UnboxedArrayObject>().initializedLength(); i++) {
+ if (!properties.append(INT_TO_JSID(i)))
+ return false;
+ }
+
+ if (!enumerableOnly && !properties.append(NameToId(cx->names().length)))
+ return false;
+
+ return true;
+}
+
+static const ClassOps UnboxedArrayObjectClassOps = {
+ nullptr, /* addProperty */
+ nullptr, /* delProperty */
+ nullptr, /* getProperty */
+ nullptr, /* setProperty */
+ nullptr, /* enumerate */
+ nullptr, /* resolve */
+ nullptr, /* mayResolve */
+ UnboxedArrayObject::finalize,
+ nullptr, /* call */
+ nullptr, /* hasInstance */
+ nullptr, /* construct */
+ UnboxedArrayObject::trace,
+};
+
+static const ClassExtension UnboxedArrayObjectClassExtension = {
+ nullptr, /* weakmapKeyDelegateOp */
+ UnboxedArrayObject::objectMoved
+};
+
+static const ObjectOps UnboxedArrayObjectObjectOps = {
+ UnboxedArrayObject::obj_lookupProperty,
+ UnboxedArrayObject::obj_defineProperty,
+ UnboxedArrayObject::obj_hasProperty,
+ UnboxedArrayObject::obj_getProperty,
+ UnboxedArrayObject::obj_setProperty,
+ UnboxedArrayObject::obj_getOwnPropertyDescriptor,
+ UnboxedArrayObject::obj_deleteProperty,
+ nullptr, /* getElements */
+ UnboxedArrayObject::obj_enumerate,
+ nullptr /* funToString */
+};
+
+const Class UnboxedArrayObject::class_ = {
+ "Array",
+ Class::NON_NATIVE |
+ JSCLASS_SKIP_NURSERY_FINALIZE |
+ JSCLASS_BACKGROUND_FINALIZE,
+ &UnboxedArrayObjectClassOps,
+ JS_NULL_CLASS_SPEC,
+ &UnboxedArrayObjectClassExtension,
+ &UnboxedArrayObjectObjectOps
+};
+
+/////////////////////////////////////////////////////////////////////
+// API
+/////////////////////////////////////////////////////////////////////
+
+static bool
+UnboxedTypeIncludes(JSValueType supertype, JSValueType subtype)
+{
+ if (supertype == JSVAL_TYPE_DOUBLE && subtype == JSVAL_TYPE_INT32)
+ return true;
+ if (supertype == JSVAL_TYPE_OBJECT && subtype == JSVAL_TYPE_NULL)
+ return true;
+ return false;
+}
+
+static bool
+CombineUnboxedTypes(const Value& value, JSValueType* existing)
+{
+ JSValueType type = value.isDouble() ? JSVAL_TYPE_DOUBLE : value.extractNonDoubleType();
+
+ if (*existing == JSVAL_TYPE_MAGIC || *existing == type || UnboxedTypeIncludes(type, *existing)) {
+ *existing = type;
+ return true;
+ }
+ if (UnboxedTypeIncludes(*existing, type))
+ return true;
+ return false;
+}
+
+// Return whether the property names and types in layout are a subset of the
+// specified vector.
+static bool
+PropertiesAreSuperset(const UnboxedLayout::PropertyVector& properties, UnboxedLayout* layout)
+{
+ for (size_t i = 0; i < layout->properties().length(); i++) {
+ const UnboxedLayout::Property& layoutProperty = layout->properties()[i];
+ bool found = false;
+ for (size_t j = 0; j < properties.length(); j++) {
+ if (layoutProperty.name == properties[j].name) {
+ found = (layoutProperty.type == properties[j].type);
+ break;
+ }
+ }
+ if (!found)
+ return false;
+ }
+ return true;
+}
+
+static bool
+CombinePlainObjectProperties(PlainObject* obj, Shape* templateShape,
+ UnboxedLayout::PropertyVector& properties)
+{
+ // All preliminary objects must have been created with enough space to
+ // fill in their unboxed data inline. This is ensured either by using
+ // the largest allocation kind (which limits the maximum size of an
+ // unboxed object), or by using an allocation kind that covers all
+ // properties in the template, as the space used by unboxed properties
+ // is less than or equal to that used by boxed properties.
+ MOZ_ASSERT(gc::GetGCKindSlots(obj->asTenured().getAllocKind()) >=
+ Min(NativeObject::MAX_FIXED_SLOTS, templateShape->slotSpan()));
+
+ if (obj->lastProperty() != templateShape || obj->hasDynamicElements()) {
+ // Only use an unboxed representation if all created objects match
+ // the template shape exactly.
+ return false;
+ }
+
+ for (size_t i = 0; i < templateShape->slotSpan(); i++) {
+ Value val = obj->getSlot(i);
+
+ JSValueType& existing = properties[i].type;
+ if (!CombineUnboxedTypes(val, &existing))
+ return false;
+ }
+
+ return true;
+}
+
+static bool
+CombineArrayObjectElements(ExclusiveContext* cx, ArrayObject* obj, JSValueType* elementType)
+{
+ if (obj->inDictionaryMode() ||
+ obj->lastProperty()->propid() != AtomToId(cx->names().length) ||
+ !obj->lastProperty()->previous()->isEmptyShape())
+ {
+ // Only use an unboxed representation if the object has no properties.
+ return false;
+ }
+
+ for (size_t i = 0; i < obj->getDenseInitializedLength(); i++) {
+ Value val = obj->getDenseElement(i);
+
+ // For now, unboxed arrays cannot have holes.
+ if (val.isMagic(JS_ELEMENTS_HOLE))
+ return false;
+
+ if (!CombineUnboxedTypes(val, elementType))
+ return false;
+ }
+
+ return true;
+}
+
+static size_t
+ComputePlainObjectLayout(ExclusiveContext* cx, Shape* templateShape,
+ UnboxedLayout::PropertyVector& properties)
+{
+ // Fill in the names for all the object's properties.
+ for (Shape::Range<NoGC> r(templateShape); !r.empty(); r.popFront()) {
+ size_t slot = r.front().slot();
+ MOZ_ASSERT(!properties[slot].name);
+ properties[slot].name = JSID_TO_ATOM(r.front().propid())->asPropertyName();
+ }
+
+ // Fill in all the unboxed object's property offsets.
+ uint32_t offset = 0;
+
+ // Search for an existing unboxed layout which is a subset of this one.
+ // If there are multiple such layouts, use the largest one. If we're able
+ // to find such a layout, use the same property offsets for the shared
+ // properties, which will allow us to generate better code if the objects
+ // have a subtype/supertype relation and are accessed at common sites.
+ UnboxedLayout* bestExisting = nullptr;
+ for (UnboxedLayout* existing : cx->compartment()->unboxedLayouts) {
+ if (PropertiesAreSuperset(properties, existing)) {
+ if (!bestExisting ||
+ existing->properties().length() > bestExisting->properties().length())
+ {
+ bestExisting = existing;
+ }
+ }
+ }
+ if (bestExisting) {
+ for (size_t i = 0; i < bestExisting->properties().length(); i++) {
+ const UnboxedLayout::Property& existingProperty = bestExisting->properties()[i];
+ for (size_t j = 0; j < templateShape->slotSpan(); j++) {
+ if (existingProperty.name == properties[j].name) {
+ MOZ_ASSERT(existingProperty.type == properties[j].type);
+ properties[j].offset = existingProperty.offset;
+ }
+ }
+ }
+ offset = bestExisting->size();
+ }
+
+ // Order remaining properties from the largest down for the best space
+ // utilization.
+ static const size_t typeSizes[] = { 8, 4, 1 };
+
+ for (size_t i = 0; i < ArrayLength(typeSizes); i++) {
+ size_t size = typeSizes[i];
+ for (size_t j = 0; j < templateShape->slotSpan(); j++) {
+ if (properties[j].offset != UINT32_MAX)
+ continue;
+ JSValueType type = properties[j].type;
+ if (UnboxedTypeSize(type) == size) {
+ offset = JS_ROUNDUP(offset, size);
+ properties[j].offset = offset;
+ offset += size;
+ }
+ }
+ }
+
+ // The final offset is the amount of data needed by the object.
+ return offset;
+}
+
+static bool
+SetLayoutTraceList(ExclusiveContext* cx, UnboxedLayout* layout)
+{
+ // Figure out the offsets of any objects or string properties.
+ Vector<int32_t, 8, SystemAllocPolicy> objectOffsets, stringOffsets;
+ for (size_t i = 0; i < layout->properties().length(); i++) {
+ const UnboxedLayout::Property& property = layout->properties()[i];
+ MOZ_ASSERT(property.offset != UINT32_MAX);
+ if (property.type == JSVAL_TYPE_OBJECT) {
+ if (!objectOffsets.append(property.offset))
+ return false;
+ } else if (property.type == JSVAL_TYPE_STRING) {
+ if (!stringOffsets.append(property.offset))
+ return false;
+ }
+ }
+
+ // Construct the layout's trace list.
+ if (!objectOffsets.empty() || !stringOffsets.empty()) {
+ Vector<int32_t, 8, SystemAllocPolicy> entries;
+ if (!entries.appendAll(stringOffsets) ||
+ !entries.append(-1) ||
+ !entries.appendAll(objectOffsets) ||
+ !entries.append(-1) ||
+ !entries.append(-1))
+ {
+ return false;
+ }
+ int32_t* traceList = cx->zone()->pod_malloc<int32_t>(entries.length());
+ if (!traceList)
+ return false;
+ PodCopy(traceList, entries.begin(), entries.length());
+ layout->setTraceList(traceList);
+ }
+
+ return true;
+}
+
+static inline Value
+NextValue(Handle<GCVector<Value>> values, size_t* valueCursor)
+{
+ return values[(*valueCursor)++];
+}
+
+static bool
+GetValuesFromPreliminaryArrayObject(ArrayObject* obj, MutableHandle<GCVector<Value>> values)
+{
+ if (!values.append(Int32Value(obj->length())))
+ return false;
+ if (!values.append(Int32Value(obj->getDenseInitializedLength())))
+ return false;
+ for (size_t i = 0; i < obj->getDenseInitializedLength(); i++) {
+ if (!values.append(obj->getDenseElement(i)))
+ return false;
+ }
+ return true;
+}
+
+void
+UnboxedArrayObject::fillAfterConvert(ExclusiveContext* cx,
+ Handle<GCVector<Value>> values, size_t* valueCursor)
+{
+ MOZ_ASSERT(CapacityArray[1] == 0);
+ setCapacityIndex(1);
+ setInitializedLengthNoBarrier(0);
+ setInlineElements();
+
+ setLength(cx, NextValue(values, valueCursor).toInt32());
+
+ int32_t initlen = NextValue(values, valueCursor).toInt32();
+ if (!initlen)
+ return;
+
+ AutoEnterOOMUnsafeRegion oomUnsafe;
+ if (!growElements(cx, initlen))
+ oomUnsafe.crash("UnboxedArrayObject::fillAfterConvert");
+
+ setInitializedLength(initlen);
+
+ for (size_t i = 0; i < size_t(initlen); i++)
+ JS_ALWAYS_TRUE(initElement(cx, i, NextValue(values, valueCursor)));
+}
+
+static bool
+GetValuesFromPreliminaryPlainObject(PlainObject* obj, MutableHandle<GCVector<Value>> values)
+{
+ for (size_t i = 0; i < obj->slotSpan(); i++) {
+ if (!values.append(obj->getSlot(i)))
+ return false;
+ }
+ return true;
+}
+
+void
+UnboxedPlainObject::fillAfterConvert(ExclusiveContext* cx,
+ Handle<GCVector<Value>> values, size_t* valueCursor)
+{
+ initExpando();
+ memset(data(), 0, layout().size());
+ for (size_t i = 0; i < layout().properties().length(); i++)
+ JS_ALWAYS_TRUE(setValue(cx, layout().properties()[i], NextValue(values, valueCursor)));
+}
+
+bool
+js::TryConvertToUnboxedLayout(ExclusiveContext* cx, AutoEnterAnalysis& enter, Shape* templateShape,
+ ObjectGroup* group, PreliminaryObjectArray* objects)
+{
+ bool isArray = !templateShape;
+
+ // Unboxed arrays are nightly only for now. The getenv() call will be
+ // removed when they are on by default. See bug 1153266.
+ if (isArray) {
+#ifdef NIGHTLY_BUILD
+ if (!getenv("JS_OPTION_USE_UNBOXED_ARRAYS")) {
+ if (!cx->options().unboxedArrays())
+ return true;
+ }
+#else
+ return true;
+#endif
+ } else {
+ if (jit::JitOptions.disableUnboxedObjects)
+ return true;
+ }
+
+ MOZ_ASSERT_IF(templateShape, !templateShape->getObjectFlags());
+
+ if (group->runtimeFromAnyThread()->isSelfHostingGlobal(cx->global()))
+ return true;
+
+ if (!isArray && templateShape->slotSpan() == 0)
+ return true;
+
+ UnboxedLayout::PropertyVector properties;
+ if (!isArray) {
+ if (!properties.appendN(UnboxedLayout::Property(), templateShape->slotSpan()))
+ return false;
+ }
+ JSValueType elementType = JSVAL_TYPE_MAGIC;
+
+ size_t objectCount = 0;
+ for (size_t i = 0; i < PreliminaryObjectArray::COUNT; i++) {
+ JSObject* obj = objects->get(i);
+ if (!obj)
+ continue;
+
+ if (obj->isSingleton() || obj->group() != group)
+ return true;
+
+ objectCount++;
+
+ if (isArray) {
+ if (!CombineArrayObjectElements(cx, &obj->as<ArrayObject>(), &elementType))
+ return true;
+ } else {
+ if (!CombinePlainObjectProperties(&obj->as<PlainObject>(), templateShape, properties))
+ return true;
+ }
+ }
+
+ size_t layoutSize = 0;
+ if (isArray) {
+ // Don't use an unboxed representation if we couldn't determine an
+ // element type for the objects.
+ if (UnboxedTypeSize(elementType) == 0)
+ return true;
+ } else {
+ if (objectCount <= 1) {
+ // If only one of the objects has been created, it is more likely
+ // to have new properties added later. This heuristic is not used
+ // for array objects, where we might want an unboxed representation
+ // even if there is only one large array.
+ return true;
+ }
+
+ for (size_t i = 0; i < templateShape->slotSpan(); i++) {
+ // We can't use an unboxed representation if e.g. all the objects have
+ // a null value for one of the properties, as we can't decide what type
+ // it is supposed to have.
+ if (UnboxedTypeSize(properties[i].type) == 0)
+ return true;
+ }
+
+ // Make sure that all properties on the template shape are property
+ // names, and not indexes.
+ for (Shape::Range<NoGC> r(templateShape); !r.empty(); r.popFront()) {
+ jsid id = r.front().propid();
+ uint32_t dummy;
+ if (!JSID_IS_ATOM(id) || JSID_TO_ATOM(id)->isIndex(&dummy))
+ return true;
+ }
+
+ layoutSize = ComputePlainObjectLayout(cx, templateShape, properties);
+
+ // The entire object must be allocatable inline.
+ if (UnboxedPlainObject::offsetOfData() + layoutSize > JSObject::MAX_BYTE_SIZE)
+ return true;
+ }
+
+ UniquePtr<UnboxedLayout>& layout = enter.unboxedLayoutToCleanUp;
+ MOZ_ASSERT(!layout);
+ layout = group->zone()->make_unique<UnboxedLayout>();
+ if (!layout)
+ return false;
+
+ if (isArray) {
+ layout->initArray(elementType);
+ } else {
+ if (!layout->initProperties(properties, layoutSize))
+ return false;
+
+ // The unboxedLayouts list only tracks layouts for plain objects.
+ cx->compartment()->unboxedLayouts.insertFront(layout.get());
+
+ if (!SetLayoutTraceList(cx, layout.get()))
+ return false;
+ }
+
+ // We've determined that all the preliminary objects can use the new layout
+ // just constructed, so convert the existing group to use the unboxed class,
+ // and update the preliminary objects to use the new layout. Do the
+ // fallible stuff first before modifying any objects.
+
+ // Get an empty shape which we can use for the preliminary objects.
+ const Class* clasp = isArray ? &UnboxedArrayObject::class_ : &UnboxedPlainObject::class_;
+ Shape* newShape = EmptyShape::getInitialShape(cx, clasp, group->proto(), 0);
+ if (!newShape) {
+ cx->recoverFromOutOfMemory();
+ return false;
+ }
+
+ // Accumulate a list of all the values in each preliminary object, and
+ // update their shapes.
+ Rooted<GCVector<Value>> values(cx, GCVector<Value>(cx));
+ for (size_t i = 0; i < PreliminaryObjectArray::COUNT; i++) {
+ JSObject* obj = objects->get(i);
+ if (!obj)
+ continue;
+
+ bool ok;
+ if (isArray)
+ ok = GetValuesFromPreliminaryArrayObject(&obj->as<ArrayObject>(), &values);
+ else
+ ok = GetValuesFromPreliminaryPlainObject(&obj->as<PlainObject>(), &values);
+
+ if (!ok) {
+ cx->recoverFromOutOfMemory();
+ return false;
+ }
+ }
+
+ if (TypeNewScript* newScript = group->newScript())
+ layout->setNewScript(newScript);
+
+ for (size_t i = 0; i < PreliminaryObjectArray::COUNT; i++) {
+ if (JSObject* obj = objects->get(i))
+ obj->as<NativeObject>().setLastPropertyMakeNonNative(newShape);
+ }
+
+ group->setClasp(clasp);
+ group->setUnboxedLayout(layout.release());
+
+ size_t valueCursor = 0;
+ for (size_t i = 0; i < PreliminaryObjectArray::COUNT; i++) {
+ JSObject* obj = objects->get(i);
+ if (!obj)
+ continue;
+
+ if (isArray)
+ obj->as<UnboxedArrayObject>().fillAfterConvert(cx, values, &valueCursor);
+ else
+ obj->as<UnboxedPlainObject>().fillAfterConvert(cx, values, &valueCursor);
+ }
+
+ MOZ_ASSERT(valueCursor == values.length());
+ return true;
+}
+
+DefineBoxedOrUnboxedFunctor6(SetOrExtendBoxedOrUnboxedDenseElements,
+ ExclusiveContext*, JSObject*, uint32_t, const Value*, uint32_t,
+ ShouldUpdateTypes);
+
+DenseElementResult
+js::SetOrExtendAnyBoxedOrUnboxedDenseElements(ExclusiveContext* cx, JSObject* obj,
+ uint32_t start, const Value* vp, uint32_t count,
+ ShouldUpdateTypes updateTypes)
+{
+ SetOrExtendBoxedOrUnboxedDenseElementsFunctor functor(cx, obj, start, vp, count, updateTypes);
+ return CallBoxedOrUnboxedSpecialization(functor, obj);
+};
+
+DefineBoxedOrUnboxedFunctor5(MoveBoxedOrUnboxedDenseElements,
+ JSContext*, JSObject*, uint32_t, uint32_t, uint32_t);
+
+DenseElementResult
+js::MoveAnyBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* obj,
+ uint32_t dstStart, uint32_t srcStart, uint32_t length)
+{
+ MoveBoxedOrUnboxedDenseElementsFunctor functor(cx, obj, dstStart, srcStart, length);
+ return CallBoxedOrUnboxedSpecialization(functor, obj);
+}
+
+DefineBoxedOrUnboxedFunctorPair6(CopyBoxedOrUnboxedDenseElements,
+ JSContext*, JSObject*, JSObject*, uint32_t, uint32_t, uint32_t);
+
+DenseElementResult
+js::CopyAnyBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* dst, JSObject* src,
+ uint32_t dstStart, uint32_t srcStart, uint32_t length)
+{
+ CopyBoxedOrUnboxedDenseElementsFunctor functor(cx, dst, src, dstStart, srcStart, length);
+ return CallBoxedOrUnboxedSpecialization(functor, dst, src);
+}
+
+DefineBoxedOrUnboxedFunctor3(SetBoxedOrUnboxedInitializedLength,
+ JSContext*, JSObject*, size_t);
+
+void
+js::SetAnyBoxedOrUnboxedInitializedLength(JSContext* cx, JSObject* obj, size_t initlen)
+{
+ SetBoxedOrUnboxedInitializedLengthFunctor functor(cx, obj, initlen);
+ JS_ALWAYS_TRUE(CallBoxedOrUnboxedSpecialization(functor, obj) == DenseElementResult::Success);
+}
+
+DefineBoxedOrUnboxedFunctor3(EnsureBoxedOrUnboxedDenseElements,
+ JSContext*, JSObject*, size_t);
+
+DenseElementResult
+js::EnsureAnyBoxedOrUnboxedDenseElements(JSContext* cx, JSObject* obj, size_t initlen)
+{
+ EnsureBoxedOrUnboxedDenseElementsFunctor functor(cx, obj, initlen);
+ return CallBoxedOrUnboxedSpecialization(functor, obj);
+}
diff --git a/js/src/vm/UnboxedObject.h b/js/src/vm/UnboxedObject.h
new file mode 100644
index 000000000..ecff8be5b
--- /dev/null
+++ b/js/src/vm/UnboxedObject.h
@@ -0,0 +1,531 @@
+/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+ * vim: set ts=8 sts=4 et sw=4 tw=99:
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+#ifndef vm_UnboxedObject_h
+#define vm_UnboxedObject_h
+
+#include "jsgc.h"
+#include "jsobj.h"
+
+#include "vm/Runtime.h"
+#include "vm/TypeInference.h"
+
+namespace js {
+
+// Memory required for an unboxed value of a given type. Returns zero for types
+// which can't be used for unboxed objects.
+static inline size_t
+UnboxedTypeSize(JSValueType type)
+{
+ switch (type) {
+ case JSVAL_TYPE_BOOLEAN: return 1;
+ case JSVAL_TYPE_INT32: return 4;
+ case JSVAL_TYPE_DOUBLE: return 8;
+ case JSVAL_TYPE_STRING: return sizeof(void*);
+ case JSVAL_TYPE_OBJECT: return sizeof(void*);
+ default: return 0;
+ }
+}
+
+static inline bool
+UnboxedTypeNeedsPreBarrier(JSValueType type)
+{
+ return type == JSVAL_TYPE_STRING || type == JSVAL_TYPE_OBJECT;
+}
+
+static inline bool
+UnboxedTypeNeedsPostBarrier(JSValueType type)
+{
+ return type == JSVAL_TYPE_OBJECT;
+}
+
+// Class tracking information specific to unboxed objects.
+class UnboxedLayout : public mozilla::LinkedListElement<UnboxedLayout>
+{
+ public:
+ struct Property {
+ PropertyName* name;
+ uint32_t offset;
+ JSValueType type;
+
+ Property()
+ : name(nullptr), offset(UINT32_MAX), type(JSVAL_TYPE_MAGIC)
+ {}
+ };
+
+ typedef Vector<Property, 0, SystemAllocPolicy> PropertyVector;
+
+ private:
+ // If objects in this group have ever been converted to native objects,
+ // these store the corresponding native group and initial shape for such
+ // objects. Type information for this object is reflected in nativeGroup.
+ GCPtrObjectGroup nativeGroup_;
+ GCPtrShape nativeShape_;
+
+ // Any script/pc which the associated group is created for.
+ GCPtrScript allocationScript_;
+ jsbytecode* allocationPc_;
+
+ // If nativeGroup is set and this object originally had a TypeNewScript or
+ // was keyed to an allocation site, this points to the group which replaced
+ // this one. This link is only needed to keep the replacement group from
+ // being GC'ed. If it were GC'ed and a new one regenerated later, that new
+ // group might have a different allocation kind from this group.
+ GCPtrObjectGroup replacementGroup_;
+
+ // The following members are only used for unboxed plain objects.
+
+ // All properties on objects with this layout, in enumeration order.
+ PropertyVector properties_;
+
+ // Byte size of the data for objects with this layout.
+ size_t size_;
+
+ // Any 'new' script information associated with this layout.
+ TypeNewScript* newScript_;
+
+ // List for use in tracing objects with this layout. This has the same
+ // structure as the trace list on a TypeDescr.
+ int32_t* traceList_;
+
+ // If this layout has been used to construct script or JSON constant
+ // objects, this code might be filled in to more quickly fill in objects
+ // from an array of values.
+ GCPtrJitCode constructorCode_;
+
+ // The following members are only used for unboxed arrays.
+
+ // The type of array elements.
+ JSValueType elementType_;
+
+ public:
+ UnboxedLayout()
+ : nativeGroup_(nullptr), nativeShape_(nullptr),
+ allocationScript_(nullptr), allocationPc_(nullptr), replacementGroup_(nullptr),
+ size_(0), newScript_(nullptr), traceList_(nullptr), constructorCode_(nullptr),
+ elementType_(JSVAL_TYPE_MAGIC)
+ {}
+
+ bool initProperties(const PropertyVector& properties, size_t size) {
+ size_ = size;
+ return properties_.appendAll(properties);
+ }
+
+ void initArray(JSValueType elementType) {
+ elementType_ = elementType;
+ }
+
+ ~UnboxedLayout() {
+ if (newScript_)
+ newScript_->clear();
+ js_delete(newScript_);
+ js_free(traceList_);
+
+ nativeGroup_.init(nullptr);
+ nativeShape_.init(nullptr);
+ replacementGroup_.init(nullptr);
+ constructorCode_.init(nullptr);
+ }
+
+ bool isArray() const {
+ return elementType_ != JSVAL_TYPE_MAGIC;
+ }
+
+ void detachFromCompartment();
+
+ const PropertyVector& properties() const {
+ return properties_;
+ }
+
+ TypeNewScript* newScript() const {
+ return newScript_;
+ }
+
+ void setNewScript(TypeNewScript* newScript, bool writeBarrier = true);
+
+ JSScript* allocationScript() const {
+ return allocationScript_;
+ }
+
+ jsbytecode* allocationPc() const {
+ return allocationPc_;
+ }
+
+ void setAllocationSite(JSScript* script, jsbytecode* pc) {
+ allocationScript_ = script;
+ allocationPc_ = pc;
+ }
+
+ const int32_t* traceList() const {
+ return traceList_;
+ }
+
+ void setTraceList(int32_t* traceList) {
+ traceList_ = traceList;
+ }
+
+ const Property* lookup(JSAtom* atom) const {
+ for (size_t i = 0; i < properties_.length(); i++) {
+ if (properties_[i].name == atom)
+ return &properties_[i];
+ }
+ return nullptr;
+ }
+
+ const Property* lookup(jsid id) const {
+ if (JSID_IS_STRING(id))
+ return lookup(JSID_TO_ATOM(id));
+ return nullptr;
+ }
+
+ size_t size() const {
+ return size_;
+ }
+
+ ObjectGroup* nativeGroup() const {
+ return nativeGroup_;
+ }
+
+ Shape* nativeShape() const {
+ return nativeShape_;
+ }
+
+ jit::JitCode* constructorCode() const {
+ return constructorCode_;
+ }
+
+ void setConstructorCode(jit::JitCode* code) {
+ constructorCode_ = code;
+ }
+
+ JSValueType elementType() const {
+ return elementType_;
+ }
+
+ inline gc::AllocKind getAllocKind() const;
+
+ void trace(JSTracer* trc);
+
+ size_t sizeOfIncludingThis(mozilla::MallocSizeOf mallocSizeOf);
+
+ static bool makeNativeGroup(JSContext* cx, ObjectGroup* group);
+ static bool makeConstructorCode(JSContext* cx, HandleObjectGroup group);
+};
+
+// Class for expando objects holding extra properties given to an unboxed plain
+// object. These objects behave identically to normal native plain objects, and
+// have a separate Class to distinguish them for memory usage reporting.
+class UnboxedExpandoObject : public NativeObject
+{
+ public:
+ static const Class class_;
+};
+
+// Class for a plain object using an unboxed representation. The physical
+// layout of these objects is identical to that of an InlineTypedObject, though
+// these objects use an UnboxedLayout instead of a TypeDescr to keep track of
+// how their properties are stored.
+class UnboxedPlainObject : public JSObject
+{
+ // Optional object which stores extra properties on this object. This is
+ // not automatically barriered to avoid problems if the object is converted
+ // to a native. See ensureExpando().
+ UnboxedExpandoObject* expando_;
+
+ // Start of the inline data, which immediately follows the group and extra properties.
+ uint8_t data_[1];
+
+ public:
+ static const Class class_;
+
+ static bool obj_lookupProperty(JSContext* cx, HandleObject obj,
+ HandleId id, MutableHandleObject objp,
+ MutableHandleShape propp);
+
+ static bool obj_defineProperty(JSContext* cx, HandleObject obj, HandleId id,
+ Handle<PropertyDescriptor> desc,
+ ObjectOpResult& result);
+
+ static bool obj_hasProperty(JSContext* cx, HandleObject obj, HandleId id, bool* foundp);
+
+ static bool obj_getProperty(JSContext* cx, HandleObject obj, HandleValue receiver,
+ HandleId id, MutableHandleValue vp);
+
+ static bool obj_setProperty(JSContext* cx, HandleObject obj, HandleId id, HandleValue v,
+ HandleValue receiver, ObjectOpResult& result);
+
+ static bool obj_getOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
+ MutableHandle<PropertyDescriptor> desc);
+
+ static bool obj_deleteProperty(JSContext* cx, HandleObject obj, HandleId id,
+ ObjectOpResult& result);
+
+ static bool obj_enumerate(JSContext* cx, HandleObject obj, AutoIdVector& properties,
+ bool enumerableOnly);
+ static bool obj_watch(JSContext* cx, HandleObject obj, HandleId id, HandleObject callable);
+
+ inline const UnboxedLayout& layout() const;
+
+ const UnboxedLayout& layoutDontCheckGeneration() const {
+ return group()->unboxedLayoutDontCheckGeneration();
+ }
+
+ uint8_t* data() {
+ return &data_[0];
+ }
+
+ UnboxedExpandoObject* maybeExpando() const {
+ return expando_;
+ }
+
+ void initExpando() {
+ expando_ = nullptr;
+ }
+
+ // For use during GC.
+ JSObject** addressOfExpando() {
+ return reinterpret_cast<JSObject**>(&expando_);
+ }
+
+ bool containsUnboxedOrExpandoProperty(ExclusiveContext* cx, jsid id) const;
+
+ static UnboxedExpandoObject* ensureExpando(JSContext* cx, Handle<UnboxedPlainObject*> obj);
+
+ bool setValue(ExclusiveContext* cx, const UnboxedLayout::Property& property, const Value& v);
+ Value getValue(const UnboxedLayout::Property& property, bool maybeUninitialized = false);
+
+ static bool convertToNative(JSContext* cx, JSObject* obj);
+ static UnboxedPlainObject* create(ExclusiveContext* cx, HandleObjectGroup group,
+ NewObjectKind newKind);
+ static JSObject* createWithProperties(ExclusiveContext* cx, HandleObjectGroup group,
+ NewObjectKind newKind, IdValuePair* properties);
+
+ void fillAfterConvert(ExclusiveContext* cx,
+ Handle<GCVector<Value>> values, size_t* valueCursor);
+
+ static void trace(JSTracer* trc, JSObject* object);
+
+ static size_t offsetOfExpando() {
+ return offsetof(UnboxedPlainObject, expando_);
+ }
+
+ static size_t offsetOfData() {
+ return offsetof(UnboxedPlainObject, data_[0]);
+ }
+};
+
+// Try to construct an UnboxedLayout for each of the preliminary objects,
+// provided they all match the template shape. If successful, converts the
+// preliminary objects and their group to the new unboxed representation.
+bool
+TryConvertToUnboxedLayout(ExclusiveContext* cx, AutoEnterAnalysis& enter, Shape* templateShape,
+ ObjectGroup* group, PreliminaryObjectArray* objects);
+
+inline gc::AllocKind
+UnboxedLayout::getAllocKind() const
+{
+ MOZ_ASSERT(size());
+ return gc::GetGCObjectKindForBytes(UnboxedPlainObject::offsetOfData() + size());
+}
+
+// Class for an array object using an unboxed representation.
+class UnboxedArrayObject : public JSObject
+{
+ // Elements pointer for the object.
+ uint8_t* elements_;
+
+ // The nominal array length. This always fits in an int32_t.
+ uint32_t length_;
+
+ // Value indicating the allocated capacity and initialized length of the
+ // array. The top CapacityBits bits are an index into CapacityArray, which
+ // indicates the elements capacity. The low InitializedLengthBits store the
+ // initialized length of the array.
+ uint32_t capacityIndexAndInitializedLength_;
+
+ // If the elements are inline, they will point here.
+ uint8_t inlineElements_[1];
+
+ public:
+ static const uint32_t CapacityBits = 6;
+ static const uint32_t CapacityShift = 26;
+
+ static const uint32_t CapacityMask = uint32_t(-1) << CapacityShift;
+ static const uint32_t InitializedLengthMask = (1 << CapacityShift) - 1;
+
+ static const uint32_t MaximumCapacity = InitializedLengthMask;
+ static const uint32_t MinimumDynamicCapacity = 8;
+
+ static const uint32_t CapacityArray[];
+
+ // Capacity index which indicates the array's length is also its capacity.
+ static const uint32_t CapacityMatchesLengthIndex = 0;
+
+ private:
+ static inline uint32_t computeCapacity(uint32_t index, uint32_t length) {
+ if (index == CapacityMatchesLengthIndex)
+ return length;
+ return CapacityArray[index];
+ }
+
+ static uint32_t chooseCapacityIndex(uint32_t capacity, uint32_t length);
+ static uint32_t exactCapacityIndex(uint32_t capacity);
+
+ public:
+ static const Class class_;
+
+ static bool obj_lookupProperty(JSContext* cx, HandleObject obj,
+ HandleId id, MutableHandleObject objp,
+ MutableHandleShape propp);
+
+ static bool obj_defineProperty(JSContext* cx, HandleObject obj, HandleId id,
+ Handle<PropertyDescriptor> desc,
+ ObjectOpResult& result);
+
+ static bool obj_hasProperty(JSContext* cx, HandleObject obj, HandleId id, bool* foundp);
+
+ static bool obj_getProperty(JSContext* cx, HandleObject obj, HandleValue receiver,
+ HandleId id, MutableHandleValue vp);
+
+ static bool obj_setProperty(JSContext* cx, HandleObject obj, HandleId id, HandleValue v,
+ HandleValue receiver, ObjectOpResult& result);
+
+ static bool obj_getOwnPropertyDescriptor(JSContext* cx, HandleObject obj, HandleId id,
+ MutableHandle<PropertyDescriptor> desc);
+
+ static bool obj_deleteProperty(JSContext* cx, HandleObject obj, HandleId id,
+ ObjectOpResult& result);
+
+ static bool obj_enumerate(JSContext* cx, HandleObject obj, AutoIdVector& properties,
+ bool enumerableOnly);
+ static bool obj_watch(JSContext* cx, HandleObject obj, HandleId id, HandleObject callable);
+
+ inline const UnboxedLayout& layout() const;
+
+ const UnboxedLayout& layoutDontCheckGeneration() const {
+ return group()->unboxedLayoutDontCheckGeneration();
+ }
+
+ JSValueType elementType() const {
+ return layoutDontCheckGeneration().elementType();
+ }
+
+ uint32_t elementSize() const {
+ return UnboxedTypeSize(elementType());
+ }
+
+ static bool convertToNative(JSContext* cx, JSObject* obj);
+ static UnboxedArrayObject* create(ExclusiveContext* cx, HandleObjectGroup group,
+ uint32_t length, NewObjectKind newKind,
+ uint32_t maxLength = MaximumCapacity);
+
+ static bool convertToNativeWithGroup(ExclusiveContext* cx, JSObject* obj,
+ ObjectGroup* group, Shape* shape);
+ bool convertInt32ToDouble(ExclusiveContext* cx, ObjectGroup* group);
+
+ void fillAfterConvert(ExclusiveContext* cx,
+ Handle<GCVector<Value>> values, size_t* valueCursor);
+
+ static void trace(JSTracer* trc, JSObject* object);
+ static void objectMoved(JSObject* obj, const JSObject* old);
+ static void finalize(FreeOp* fop, JSObject* obj);
+
+ static size_t objectMovedDuringMinorGC(JSTracer* trc, JSObject* dst, JSObject* src,
+ gc::AllocKind allocKind);
+
+ uint8_t* elements() {
+ return elements_;
+ }
+
+ bool hasInlineElements() const {
+ return elements_ == &inlineElements_[0];
+ }
+
+ uint32_t length() const {
+ return length_;
+ }
+
+ uint32_t initializedLength() const {
+ return capacityIndexAndInitializedLength_ & InitializedLengthMask;
+ }
+
+ uint32_t capacityIndex() const {
+ return (capacityIndexAndInitializedLength_ & CapacityMask) >> CapacityShift;
+ }
+
+ uint32_t capacity() const {
+ return computeCapacity(capacityIndex(), length());
+ }
+
+ bool containsProperty(ExclusiveContext* cx, jsid id);
+
+ bool setElement(ExclusiveContext* cx, size_t index, const Value& v);
+ bool initElement(ExclusiveContext* cx, size_t index, const Value& v);
+ void initElementNoTypeChange(size_t index, const Value& v);
+ Value getElement(size_t index);
+
+ template <JSValueType Type> inline bool setElementSpecific(ExclusiveContext* cx, size_t index,
+ const Value& v);
+ template <JSValueType Type> inline void setElementNoTypeChangeSpecific(size_t index, const Value& v);
+ template <JSValueType Type> inline bool initElementSpecific(ExclusiveContext* cx, size_t index,
+ const Value& v);
+ template <JSValueType Type> inline void initElementNoTypeChangeSpecific(size_t index, const Value& v);
+ template <JSValueType Type> inline Value getElementSpecific(size_t index);
+ template <JSValueType Type> inline void triggerPreBarrier(size_t index);
+
+ bool growElements(ExclusiveContext* cx, size_t cap);
+ void shrinkElements(ExclusiveContext* cx, size_t cap);
+
+ static uint32_t offsetOfElements() {
+ return offsetof(UnboxedArrayObject, elements_);
+ }
+ static uint32_t offsetOfLength() {
+ return offsetof(UnboxedArrayObject, length_);
+ }
+ static uint32_t offsetOfCapacityIndexAndInitializedLength() {
+ return offsetof(UnboxedArrayObject, capacityIndexAndInitializedLength_);
+ }
+ static uint32_t offsetOfInlineElements() {
+ return offsetof(UnboxedArrayObject, inlineElements_);
+ }
+
+ void setLengthInt32(uint32_t length) {
+ MOZ_ASSERT(length <= INT32_MAX);
+ length_ = length;
+ }
+
+ inline void setLength(ExclusiveContext* cx, uint32_t len);
+ inline void setInitializedLength(uint32_t initlen);
+
+ inline void setInitializedLengthNoBarrier(uint32_t initlen) {
+ MOZ_ASSERT(initlen <= InitializedLengthMask);
+ capacityIndexAndInitializedLength_ =
+ (capacityIndexAndInitializedLength_ & CapacityMask) | initlen;
+ }
+
+ private:
+ void setInlineElements() {
+ elements_ = &inlineElements_[0];
+ }
+
+ void setCapacityIndex(uint32_t index) {
+ MOZ_ASSERT(index <= (CapacityMask >> CapacityShift));
+ capacityIndexAndInitializedLength_ =
+ (index << CapacityShift) | initializedLength();
+ }
+};
+
+} // namespace js
+
+namespace JS {
+
+template <>
+struct DeletePolicy<js::UnboxedLayout> : public js::GCManagedDeletePolicy<js::UnboxedLayout>
+{};
+
+} /* namespace JS */
+
+#endif /* vm_UnboxedObject_h */
diff --git a/js/xpconnect/src/XPCJSContext.cpp b/js/xpconnect/src/XPCJSContext.cpp
index 0243d80e3..bde949a96 100644
--- a/js/xpconnect/src/XPCJSContext.cpp
+++ b/js/xpconnect/src/XPCJSContext.cpp
@@ -1427,6 +1427,8 @@ ReloadPrefsCallback(const char* pref, void* data)
bool extraWarnings = Preferences::GetBool(JS_OPTIONS_DOT_STR "strict");
+ bool unboxedObjects = Preferences::GetBool(JS_OPTIONS_DOT_STR "unboxed_objects");
+
sSharedMemoryEnabled = Preferences::GetBool(JS_OPTIONS_DOT_STR "shared_memory");
#ifdef DEBUG
@@ -1455,6 +1457,8 @@ ReloadPrefsCallback(const char* pref, void* data)
useBaselineEager ? 0 : -1);
JS_SetGlobalJitCompilerOption(cx, JSJITCOMPILER_ION_WARMUP_TRIGGER,
useIonEager ? 0 : -1);
+ JS_SetGlobalJitCompilerOption(cx, JSJITCOMPILER_UNBOXED_OBJECTS,
+ unboxedObjects);
}
XPCJSContext::~XPCJSContext()
diff --git a/layout/base/crashtests/crashtests.list b/layout/base/crashtests/crashtests.list
index e2cb99e04..6ded4ff3f 100644
--- a/layout/base/crashtests/crashtests.list
+++ b/layout/base/crashtests/crashtests.list
@@ -448,7 +448,7 @@ load 876092.html
load 876221.html
load 897852.html
asserts(4-6) asserts-if(Android&&!asyncPan,2) load 898913.html # bug 847368
-pref(layers.acceleration.disabled,true) pref(layers.force-active,true) load 919434.html
+pref(layers.acceleration.enabled,false) pref(layers.force-active,true) load 919434.html
load 926728.html
load 930381.html
load 931450.html
diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp
index ec676ca92..6642a090d 100644
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -10886,6 +10886,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState,
// no? And if we cared we could look through the item list
// instead of groveling through the framelist here..
nsStyleContext *frameStyleContext = aFrame->StyleContext();
+#ifdef DEBUG
// Report a warning for non-GC frames, for chrome:
if (!aFrame->IsGeneratedContentFrame() &&
mPresShell->GetPresContext()->IsChrome()) {
@@ -10904,6 +10905,7 @@ nsCSSFrameConstructor::ProcessChildren(nsFrameConstructorState& aState,
message,
params, ArrayLength(params));
}
+#endif
RefPtr<nsStyleContext> blockSC = mPresShell->StyleSet()->
ResolveAnonymousBoxStyle(nsCSSAnonBoxes::mozXULAnonymousBlock,
diff --git a/layout/base/nsCaret.cpp b/layout/base/nsCaret.cpp
index eca22f3ba..8396726c6 100644
--- a/layout/base/nsCaret.cpp
+++ b/layout/base/nsCaret.cpp
@@ -511,7 +511,7 @@ nsCaret::GetPaintGeometry(nsRect* aRect)
CheckSelectionLanguageChange();
int32_t frameOffset;
- nsIFrame *frame = GetFrameAndOffset(GetSelectionInternal(),
+ nsIFrame* frame = GetFrameAndOffset(GetSelectionInternal(),
mOverrideContent, mOverrideOffset, &frameOffset);
if (!frame) {
return nullptr;
@@ -521,8 +521,7 @@ nsCaret::GetPaintGeometry(nsRect* aRect)
const nsStyleUserInterface* userinterface = frame->StyleUserInterface();
if ((!mIgnoreUserModify &&
userinterface->mUserModify == StyleUserModify::ReadOnly) ||
- userinterface->mUserInput == StyleUserInput::None ||
- userinterface->mUserInput == StyleUserInput::Disabled) {
+ frame->IsContentDisabled()){
return nullptr;
}
diff --git a/layout/base/nsRefreshDriver.cpp b/layout/base/nsRefreshDriver.cpp
index 5ea7a0188..c0d09d2a0 100644
--- a/layout/base/nsRefreshDriver.cpp
+++ b/layout/base/nsRefreshDriver.cpp
@@ -851,12 +851,6 @@ NS_IMPL_ISUPPORTS(VsyncChildCreateCallback, nsIIPCBackgroundChildCreateCallback)
static StaticRefPtr<RefreshDriverTimer> sRegularRateTimer;
static StaticRefPtr<InactiveRefreshDriverTimer> sThrottledRateTimer;
-#ifdef XP_WIN
-static int32_t sHighPrecisionTimerRequests = 0;
-// a bare pointer to avoid introducing a static constructor
-static nsITimer *sDisableHighPrecisionTimersTimer = nullptr;
-#endif
-
static void
CreateContentVsyncRefreshTimer(void*)
{
@@ -934,16 +928,6 @@ nsRefreshDriver::Shutdown()
sRegularRateTimer = nullptr;
sThrottledRateTimer = nullptr;
-
-#ifdef XP_WIN
- if (sDisableHighPrecisionTimersTimer) {
- sDisableHighPrecisionTimersTimer->Cancel();
- NS_RELEASE(sDisableHighPrecisionTimersTimer);
- timeEndPeriod(1);
- } else if (sHighPrecisionTimerRequests) {
- timeEndPeriod(1);
- }
-#endif
}
/* static */ int32_t
@@ -1062,7 +1046,6 @@ nsRefreshDriver::nsRefreshDriver(nsPresContext* aPresContext)
mNeedToRecomputeVisibility(false),
mTestControllingRefreshes(false),
mViewManagerFlushIsPending(false),
- mRequestedHighPrecision(false),
mInRefresh(false),
mWaitingForTransaction(false),
mSkippedPaints(false),
@@ -1300,83 +1283,6 @@ nsRefreshDriver::StopTimer()
mActiveTimer->RemoveRefreshDriver(this);
mActiveTimer = nullptr;
-
- if (mRequestedHighPrecision) {
- SetHighPrecisionTimersEnabled(false);
- }
-}
-
-#ifdef XP_WIN
-static void
-DisableHighPrecisionTimersCallback(nsITimer *aTimer, void *aClosure)
-{
- timeEndPeriod(1);
- NS_RELEASE(sDisableHighPrecisionTimersTimer);
-}
-#endif
-
-void
-nsRefreshDriver::ConfigureHighPrecision()
-{
- bool haveUnthrottledFrameRequestCallbacks =
- mFrameRequestCallbackDocs.Length() > 0;
-
- // if the only change that's needed is that we need high precision,
- // then just set that
- if (!mThrottled && !mRequestedHighPrecision &&
- haveUnthrottledFrameRequestCallbacks) {
- SetHighPrecisionTimersEnabled(true);
- } else if (mRequestedHighPrecision && !haveUnthrottledFrameRequestCallbacks) {
- SetHighPrecisionTimersEnabled(false);
- }
-}
-
-void
-nsRefreshDriver::SetHighPrecisionTimersEnabled(bool aEnable)
-{
- LOG("[%p] SetHighPrecisionTimersEnabled (%s)", this, aEnable ? "true" : "false");
-
- if (aEnable) {
- NS_ASSERTION(!mRequestedHighPrecision, "SetHighPrecisionTimersEnabled(true) called when already requested!");
-#ifdef XP_WIN
- if (++sHighPrecisionTimerRequests == 1) {
- // If we had a timer scheduled to disable it, that means that it's already
- // enabled; just cancel the timer. Otherwise, really enable it.
- if (sDisableHighPrecisionTimersTimer) {
- sDisableHighPrecisionTimersTimer->Cancel();
- NS_RELEASE(sDisableHighPrecisionTimersTimer);
- } else {
- timeBeginPeriod(1);
- }
- }
-#endif
- mRequestedHighPrecision = true;
- } else {
- NS_ASSERTION(mRequestedHighPrecision, "SetHighPrecisionTimersEnabled(false) called when not requested!");
-#ifdef XP_WIN
- if (--sHighPrecisionTimerRequests == 0) {
- // Don't jerk us around between high precision and low precision
- // timers; instead, only allow leaving high precision timers
- // after 90 seconds. This is arbitrary, but hopefully good
- // enough.
- NS_ASSERTION(!sDisableHighPrecisionTimersTimer, "We shouldn't have an outstanding disable-high-precision timer !");
-
- nsCOMPtr<nsITimer> timer = do_CreateInstance(NS_TIMER_CONTRACTID);
- if (timer) {
- timer.forget(&sDisableHighPrecisionTimersTimer);
- sDisableHighPrecisionTimersTimer->InitWithFuncCallback(DisableHighPrecisionTimersCallback,
- nullptr,
- 90 * 1000,
- nsITimer::TYPE_ONE_SHOT);
- } else {
- // might happen if we're shutting down XPCOM; just drop the time period down
- // immediately
- timeEndPeriod(1);
- }
- }
-#endif
- mRequestedHighPrecision = false;
- }
}
uint32_t
@@ -1993,8 +1899,6 @@ nsRefreshDriver::Tick(int64_t aNowEpoch, TimeStamp aNowTime)
observer->DidRefresh();
}
- ConfigureHighPrecision();
-
NS_ASSERTION(mInRefresh, "Still in refresh");
if (mPresContext->IsRoot() && XRE_IsContentProcess() && gfxPrefs::AlwaysPaint()) {
@@ -2247,7 +2151,6 @@ nsRefreshDriver::ScheduleFrameRequestCallbacks(nsIDocument* aDocument)
}
// make sure that the timer is running
- ConfigureHighPrecision();
EnsureTimerStarted();
}
@@ -2256,7 +2159,6 @@ nsRefreshDriver::RevokeFrameRequestCallbacks(nsIDocument* aDocument)
{
mFrameRequestCallbackDocs.RemoveElement(aDocument);
mThrottledFrameRequestCallbackDocs.RemoveElement(aDocument);
- ConfigureHighPrecision();
// No need to worry about restarting our timer in slack mode if it's already
// running; that will happen automatically when it fires.
}
diff --git a/layout/base/nsRefreshDriver.h b/layout/base/nsRefreshDriver.h
index b2dd9be4b..4e839e764 100644
--- a/layout/base/nsRefreshDriver.h
+++ b/layout/base/nsRefreshDriver.h
@@ -450,7 +450,6 @@ private:
bool mNeedToRecomputeVisibility;
bool mTestControllingRefreshes;
bool mViewManagerFlushIsPending;
- bool mRequestedHighPrecision;
bool mInRefresh;
// True if the refresh driver is suspended waiting for transaction
@@ -502,10 +501,6 @@ private:
friend class mozilla::RefreshDriverTimer;
- // turn on or turn off high precision based on various factors
- void ConfigureHighPrecision();
- void SetHighPrecisionTimersEnabled(bool aEnable);
-
static void Shutdown();
// `true` if we are currently in jank-critical mode.
diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp
index 9313b8e45..4455da122 100644
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -178,21 +178,14 @@ static void Shutdown();
#include "AudioChannelService.h"
#include "mozilla/net/WebSocketEventService.h"
-#include "mozilla/dom/FlyWebService.h"
-
#include "mozilla/dom/power/PowerManagerService.h"
#include "mozilla/dom/time/TimeService.h"
#include "StreamingProtocolService.h"
-#include "nsIPresentationService.h"
-
#include "MediaManager.h"
#include "GMPService.h"
-#include "mozilla/dom/PresentationDeviceManager.h"
-#include "mozilla/dom/PresentationTCPSessionTransport.h"
-
#include "nsScriptError.h"
#include "mozilla/TextInputProcessor.h"
@@ -236,16 +229,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(HTMLEditor)
#define TRANSFORMIIX_NODESET_CONTRACTID \
"@mozilla.org/transformiix-nodeset;1"
-// PresentationDeviceManager
-/* e1e79dec-4085-4994-ac5b-744b016697e6 */
-#define PRESENTATION_DEVICE_MANAGER_CID \
-{ 0xe1e79dec, 0x4085, 0x4994, { 0xac, 0x5b, 0x74, 0x4b, 0x01, 0x66, 0x97, 0xe6 } }
-
-#define PRESENTATION_TCP_SESSION_TRANSPORT_CID \
-{ 0xc9d023f4, 0x6228, 0x4c07, { 0x8b, 0x1d, 0x9c, 0x19, 0x57, 0x3f, 0xaa, 0x27 } }
-
-already_AddRefed<nsIPresentationService> NS_CreatePresentationService();
-
// Factory Constructor
NS_GENERIC_FACTORY_CONSTRUCTOR(txMozillaXSLTProcessor)
NS_GENERIC_FACTORY_CONSTRUCTOR(XPathEvaluator)
@@ -289,11 +272,7 @@ NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIStreamingProtocolControllerService,
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIMediaManagerService,
MediaManager::GetInstance)
-NS_GENERIC_FACTORY_CONSTRUCTOR(PresentationDeviceManager)
NS_GENERIC_FACTORY_CONSTRUCTOR(TextInputProcessor)
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIPresentationService,
- NS_CreatePresentationService)
-NS_GENERIC_FACTORY_CONSTRUCTOR(PresentationTCPSessionTransport)
NS_GENERIC_FACTORY_CONSTRUCTOR(PushNotifier)
//-----------------------------------------------------------------------------
@@ -529,17 +508,12 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(Geolocation, Init)
#define NS_WEBSOCKETEVENT_SERVICE_CID \
{ 0x31689828, 0xda66, 0x49a6, { 0x87, 0x0c, 0xdf, 0x62, 0xb8, 0x3f, 0xe7, 0x89 }}
-#define NS_FLYWEB_SERVICE_CID \
- { 0x5de19ef0, 0x895e, 0x4c0c, { 0xa6, 0xe0, 0xea, 0xe0, 0x23, 0x2b, 0x84, 0x5a } }
-
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsGeolocationService, nsGeolocationService::GetGeolocationService)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(AudioChannelService, AudioChannelService::GetOrCreate)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(WebSocketEventService, WebSocketEventService::GetOrCreate)
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(FlyWebService, FlyWebService::GetOrCreateAddRefed)
-
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
NS_GENERIC_FACTORY_CONSTRUCTOR(FakeSpeechRecognitionService)
#endif
@@ -676,7 +650,6 @@ NS_DEFINE_NAMED_CID(NS_GEOLOCATION_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_GEOLOCATION_CID);
NS_DEFINE_NAMED_CID(NS_AUDIOCHANNEL_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_WEBSOCKETEVENT_SERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_FLYWEB_SERVICE_CID);
NS_DEFINE_NAMED_CID(NS_FOCUSMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_CONTENTSECURITYMANAGER_CID);
NS_DEFINE_NAMED_CID(CSPSERVICE_CID);
@@ -719,10 +692,6 @@ NS_DEFINE_NAMED_CID(NS_ACCESSIBILITY_SERVICE_CID);
NS_DEFINE_NAMED_CID(GECKO_MEDIA_PLUGIN_SERVICE_CID);
-NS_DEFINE_NAMED_CID(PRESENTATION_SERVICE_CID);
-NS_DEFINE_NAMED_CID(PRESENTATION_DEVICE_MANAGER_CID);
-NS_DEFINE_NAMED_CID(PRESENTATION_TCP_SESSION_TRANSPORT_CID);
-
NS_DEFINE_NAMED_CID(TEXT_INPUT_PROCESSOR_CID);
NS_DEFINE_NAMED_CID(NS_SCRIPTERROR_CID);
@@ -942,7 +911,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kNS_GEOLOCATION_CID, false, nullptr, GeolocationConstructor },
{ &kNS_AUDIOCHANNEL_SERVICE_CID, false, nullptr, AudioChannelServiceConstructor },
{ &kNS_WEBSOCKETEVENT_SERVICE_CID, false, nullptr, WebSocketEventServiceConstructor },
- { &kNS_FLYWEB_SERVICE_CID, false, nullptr, FlyWebServiceConstructor },
{ &kNS_FOCUSMANAGER_CID, false, nullptr, CreateFocusManager },
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
{ &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID, false, nullptr, FakeSpeechRecognitionServiceConstructor },
@@ -981,9 +949,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
#ifdef ACCESSIBILITY
{ &kNS_ACCESSIBILITY_SERVICE_CID, false, nullptr, CreateA11yService },
#endif
- { &kPRESENTATION_SERVICE_CID, false, nullptr, nsIPresentationServiceConstructor },
- { &kPRESENTATION_DEVICE_MANAGER_CID, false, nullptr, PresentationDeviceManagerConstructor },
- { &kPRESENTATION_TCP_SESSION_TRANSPORT_CID, false, nullptr, PresentationTCPSessionTransportConstructor },
{ &kTEXT_INPUT_PROCESSOR_CID, false, nullptr, TextInputProcessorConstructor },
{ &kNS_SCRIPTERROR_CID, false, nullptr, nsScriptErrorConstructor },
{ nullptr }
@@ -1072,8 +1037,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ "@mozilla.org/geolocation;1", &kNS_GEOLOCATION_CID },
{ "@mozilla.org/audiochannel/service;1", &kNS_AUDIOCHANNEL_SERVICE_CID },
{ "@mozilla.org/websocketevent/service;1", &kNS_WEBSOCKETEVENT_SERVICE_CID },
- { "@mozilla.org/flyweb-service;1", &kNS_FLYWEB_SERVICE_CID },
- { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "flyweb", &kNS_FLYWEB_SERVICE_CID },
{ "@mozilla.org/focus-manager;1", &kNS_FOCUSMANAGER_CID },
#ifdef MOZ_WEBSPEECH_TEST_BACKEND
{ NS_SPEECH_RECOGNITION_SERVICE_CONTRACTID_PREFIX "fake", &kNS_FAKE_SPEECH_RECOGNITION_SERVICE_CID },
@@ -1113,9 +1076,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ "@mozilla.org/accessibleRetrieval;1", &kNS_ACCESSIBILITY_SERVICE_CID },
#endif
{ "@mozilla.org/gecko-media-plugin-service;1", &kGECKO_MEDIA_PLUGIN_SERVICE_CID },
- { PRESENTATION_SERVICE_CONTRACTID, &kPRESENTATION_SERVICE_CID },
- { PRESENTATION_DEVICE_MANAGER_CONTRACTID, &kPRESENTATION_DEVICE_MANAGER_CID },
- { PRESENTATION_TCP_SESSION_TRANSPORT_CONTRACTID, &kPRESENTATION_TCP_SESSION_TRANSPORT_CID },
{ "@mozilla.org/text-input-processor;1", &kTEXT_INPUT_PROCESSOR_CID },
{ NS_SCRIPTERROR_CONTRACTID, &kNS_SCRIPTERROR_CID },
{ nullptr }
@@ -1134,8 +1094,6 @@ static const mozilla::Module::CategoryEntry kLayoutCategories[] = {
{ "clear-origin-attributes-data", "QuotaManagerService", "service," QUOTAMANAGER_SERVICE_CONTRACTID },
{ OBSERVER_TOPIC_IDLE_DAILY, "QuotaManagerService", QUOTAMANAGER_SERVICE_CONTRACTID },
CONTENTDLF_CATEGORIES
- { "profile-after-change", "PresentationDeviceManager", PRESENTATION_DEVICE_MANAGER_CONTRACTID },
- { "profile-after-change", "PresentationService", PRESENTATION_SERVICE_CONTRACTID },
{ nullptr }
};
diff --git a/layout/forms/nsComboboxControlFrame.cpp b/layout/forms/nsComboboxControlFrame.cpp
index 5a9438939..78185616f 100644
--- a/layout/forms/nsComboboxControlFrame.cpp
+++ b/layout/forms/nsComboboxControlFrame.cpp
@@ -1165,9 +1165,7 @@ nsComboboxControlFrame::HandleEvent(nsPresContext* aPresContext,
// If we have style that affects how we are selected, feed event down to
// nsFrame::HandleEvent so that selection takes place when appropriate.
- const nsStyleUserInterface* uiStyle = StyleUserInterface();
- if (uiStyle->mUserInput == StyleUserInput::None ||
- uiStyle->mUserInput == StyleUserInput::Disabled) {
+ if (IsContentDisabled()) {
return nsBlockFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
return NS_OK;
diff --git a/layout/forms/nsFormControlFrame.cpp b/layout/forms/nsFormControlFrame.cpp
index 4ee62acbf..8dbe564dd 100644
--- a/layout/forms/nsFormControlFrame.cpp
+++ b/layout/forms/nsFormControlFrame.cpp
@@ -183,10 +183,8 @@ nsFormControlFrame::HandleEvent(nsPresContext* aPresContext,
WidgetGUIEvent* aEvent,
nsEventStatus* aEventStatus)
{
- // Check for user-input:none style
- const nsStyleUserInterface* uiStyle = StyleUserInterface();
- if (uiStyle->mUserInput == StyleUserInput::None ||
- uiStyle->mUserInput == StyleUserInput::Disabled) {
+ // Check for disabled content so that selection works properly (?).
+ if (IsContentDisabled()) {
return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
return NS_OK;
diff --git a/layout/forms/nsGfxButtonControlFrame.cpp b/layout/forms/nsGfxButtonControlFrame.cpp
index 90da437f7..393145e0b 100644
--- a/layout/forms/nsGfxButtonControlFrame.cpp
+++ b/layout/forms/nsGfxButtonControlFrame.cpp
@@ -227,10 +227,7 @@ nsGfxButtonControlFrame::HandleEvent(nsPresContext* aPresContext,
// from being called. The nsFrame::HandleEvent causes the button label
// to be selected (Drawn with an XOR rectangle over the label)
- // do we have user-input style?
- const nsStyleUserInterface* uiStyle = StyleUserInterface();
- if (uiStyle->mUserInput == StyleUserInput::None ||
- uiStyle->mUserInput == StyleUserInput::Disabled) {
+ if (IsContentDisabled()) {
return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
return NS_OK;
diff --git a/layout/forms/nsImageControlFrame.cpp b/layout/forms/nsImageControlFrame.cpp
index 212fa9356..8aef41538 100644
--- a/layout/forms/nsImageControlFrame.cpp
+++ b/layout/forms/nsImageControlFrame.cpp
@@ -150,15 +150,9 @@ nsImageControlFrame::HandleEvent(nsPresContext* aPresContext,
return NS_OK;
}
- // do we have user-input style?
- const nsStyleUserInterface* uiStyle = StyleUserInterface();
- if (uiStyle->mUserInput == StyleUserInput::None ||
- uiStyle->mUserInput == StyleUserInput::Disabled) {
+ if (IsContentDisabled()) {
return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
- if (mContent->HasAttr(kNameSpaceID_None, nsGkAtoms::disabled)) { // XXX cache disabled
- return NS_OK;
- }
*aEventStatus = nsEventStatus_eIgnore;
diff --git a/layout/forms/nsListControlFrame.cpp b/layout/forms/nsListControlFrame.cpp
index cc5f37f9a..58e81039f 100644
--- a/layout/forms/nsListControlFrame.cpp
+++ b/layout/forms/nsListControlFrame.cpp
@@ -920,16 +920,11 @@ nsListControlFrame::HandleEvent(nsPresContext* aPresContext,
if (nsEventStatus_eConsumeNoDefault == *aEventStatus)
return NS_OK;
- // do we have style that affects how we are selected?
- // do we have user-input style?
- const nsStyleUserInterface* uiStyle = StyleUserInterface();
- if (uiStyle->mUserInput == StyleUserInput::None ||
- uiStyle->mUserInput == StyleUserInput::Disabled) {
+ // disabled state affects how we're selected, but we don't want to go through
+ // nsHTMLScrollFrame if we're disabled.
+ if (IsContentDisabled()) {
return nsFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
- EventStates eventStates = mContent->AsElement()->State();
- if (eventStates.HasState(NS_EVENT_STATE_DISABLED))
- return NS_OK;
return nsHTMLScrollFrame::HandleEvent(aPresContext, aEvent, aEventStatus);
}
diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp
index abf687c9b..3ff6c9bf1 100644
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -1031,6 +1031,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
PositionFrameView(aKidFrame);
+ PositionChildViews(aKidFrame);
}
// Reflow the child frame
@@ -1074,6 +1075,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
if (0 == (aFlags & NS_FRAME_NO_MOVE_VIEW)) {
PositionFrameView(aKidFrame);
+ PositionChildViews(aKidFrame);
}
// Reflow the child frame
@@ -1925,6 +1927,10 @@ nsContainerFrame::RenumberFrameAndDescendants(int32_t* aOrdinal,
nsIFrame *f = bullet;
do {
nsIFrame *parent = f->GetParent();
+ if (!parent) {
+ // We may have an orphan situation in some corner cases.
+ break;
+ }
parent->ChildIsDirty(f);
f = parent;
} while (f != listItem);
diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp
index bbbb5c332..0d0c7108c 100644
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -5557,6 +5557,19 @@ nsFrame::Reflow(nsPresContext* aPresContext,
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aDesiredSize);
}
+bool
+nsIFrame::IsContentDisabled() const
+{
+ // FIXME(emilio): Doing this via CSS means callers must ensure the style is up
+ // to date, and they don't!
+ if (StyleUserInterface()->mUserInput == StyleUserInput::None) {
+ return true;
+ }
+
+ auto* element = nsGenericHTMLElement::FromContentOrNull(GetContent());
+ return element && element->IsDisabled();
+}
+
nsresult
nsFrame::CharacterDataChanged(CharacterDataChangeInfo* aInfo)
{
@@ -8434,9 +8447,13 @@ UnionBorderBoxes(nsIFrame* aFrame, bool aApplyTransform,
Maybe<nsRect> clipPropClipRect =
aFrame->GetClipPropClipRect(disp, effects, bounds.Size());
- // Iterate over all children except pop-ups.
+ // Iterate over all children except pop-ups, absolutely positioned children,
+ // fixed-positioned children and floats.
const nsIFrame::ChildListIDs skip(nsIFrame::kPopupList |
- nsIFrame::kSelectPopupList);
+ nsIFrame::kSelectPopupList |
+ nsIFrame::kAbsoluteList |
+ nsIFrame::kFixedList |
+ nsIFrame::kFloatList);
for (nsIFrame::ChildListIterator childLists(aFrame);
!childLists.IsDone(); childLists.Next()) {
if (skip.Contains(childLists.CurrentID())) {
@@ -8446,6 +8463,12 @@ UnionBorderBoxes(nsIFrame* aFrame, bool aApplyTransform,
nsFrameList children = childLists.CurrentList();
for (nsFrameList::Enumerator e(children); !e.AtEnd(); e.Next()) {
nsIFrame* child = e.get();
+
+ if (child->GetType() == nsGkAtoms::placeholderFrame) {
+ // Skip placeholders too.
+ continue;
+ }
+
// Note that passing |true| for aApplyTransform when
// child->Combines3DTransformWithAncestors() is incorrect if our
// aApplyTransform is false... but the opposite would be as
diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp
index 959061e33..f771c9d7c 100644
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -4822,14 +4822,14 @@ nsGridContainerFrame::Tracks::StretchFlexibleTracks(
: ri->ComputedMaxISize();
}
Maybe<nsTArray<TrackSize>> origSizes;
+ bool applyMinMax = (minSize != 0 || maxSize != NS_UNCONSTRAINEDSIZE) &&
+ aAvailableSize == NS_UNCONSTRAINEDSIZE;
// We iterate twice at most. The 2nd time if the grid size changed after
// applying a min/max-size (can only occur if aAvailableSize is indefinite).
while (true) {
float fr = FindUsedFlexFraction(aState, aGridItems, flexTracks,
aFunctions, aAvailableSize);
if (fr != 0.0f) {
- bool applyMinMax = (minSize != 0 || maxSize != NS_UNCONSTRAINEDSIZE) &&
- aAvailableSize == NS_UNCONSTRAINEDSIZE;
for (uint32_t i : flexTracks) {
float flexFactor = aFunctions.MaxSizingFor(i).GetFlexFractionValue();
nscoord flexLength = NSToCoordRound(flexFactor * fr);
@@ -4841,36 +4841,36 @@ nsGridContainerFrame::Tracks::StretchFlexibleTracks(
base = flexLength;
}
}
- if (applyMinMax && origSizes.isSome()) {
- // https://drafts.csswg.org/css-grid/#algo-flex-tracks
- // "If using this flex fraction would cause the grid to be smaller than
- // the grid container’s min-width/height (or larger than the grid
- // container’s max-width/height), then redo this step, treating the free
- // space as definite [...]"
- nscoord newSize = 0;
- for (auto& sz : mSizes) {
- newSize += sz.mBase;
- }
- const auto sumOfGridGaps = SumOfGridGaps();
- newSize += sumOfGridGaps;
- if (newSize > maxSize) {
- aAvailableSize = maxSize;
- } else if (newSize < minSize) {
- aAvailableSize = minSize;
- }
- if (aAvailableSize != NS_UNCONSTRAINEDSIZE) {
- // Reset min/max-size to ensure 'applyMinMax' becomes false next time.
- minSize = 0;
- maxSize = NS_UNCONSTRAINEDSIZE;
- aAvailableSize = std::max(0, aAvailableSize - sumOfGridGaps);
- // Restart with the original track sizes and definite aAvailableSize.
+ }
+ if (applyMinMax) {
+ applyMinMax = false;
+ // https://drafts.csswg.org/css-grid/#algo-flex-tracks
+ // "If using this flex fraction would cause the grid to be smaller than
+ // the grid container’s min-width/height (or larger than the grid
+ // container’s max-width/height), then redo this step, treating the free
+ // space as definite [...]"
+ nscoord newSize = 0;
+ for (auto& sz : mSizes) {
+ newSize += sz.mBase;
+ }
+ const auto sumOfGridGaps = SumOfGridGaps();
+ newSize += sumOfGridGaps;
+ if (newSize > maxSize) {
+ aAvailableSize = maxSize;
+ } else if (newSize < minSize) {
+ aAvailableSize = minSize;
+ }
+ if (aAvailableSize != NS_UNCONSTRAINEDSIZE) {
+ aAvailableSize = std::max(0, aAvailableSize - sumOfGridGaps);
+ // Restart with the original track sizes and definite aAvailableSize.
+ if (origSizes.isSome()) {
mSizes = Move(*origSizes);
origSizes.reset();
- if (aAvailableSize == 0) {
- break; // zero available size wouldn't change any sizes though...
- }
- continue;
+ } // else, no mSizes[].mBase were changed above so it's still correct
+ if (aAvailableSize == 0) {
+ break; // zero available size wouldn't change any sizes though...
}
+ continue;
}
}
break;
diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h
index 57f5c460c..93eb95099 100644
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -2436,6 +2436,11 @@ public:
nsIWidget* GetNearestWidget(nsPoint& aOffset) const;
/**
+ * Whether the content for this frame is disabled, used for event handling.
+ */
+ bool IsContentDisabled() const;
+
+ /**
* Get the "type" of the frame. May return nullptr.
*
* @see nsGkAtoms
diff --git a/layout/generic/nsSelection.cpp b/layout/generic/nsSelection.cpp
index ff75ab85d..5ccb2d8bf 100644
--- a/layout/generic/nsSelection.cpp
+++ b/layout/generic/nsSelection.cpp
@@ -2882,16 +2882,15 @@ nsFrameSelection::UnselectCells(nsIContent *aTableContent,
nsTableCellFrame* cellFrame =
tableFrame->GetCellFrameAt(curRowIndex, curColIndex);
- int32_t origRowIndex, origColIndex;
- cellFrame->GetRowIndex(origRowIndex);
- cellFrame->GetColIndex(origColIndex);
+ uint32_t origRowIndex = cellFrame->RowIndex();
+ uint32_t origColIndex = cellFrame->ColIndex();
uint32_t actualRowSpan =
tableFrame->GetEffectiveRowSpanAt(origRowIndex, origColIndex);
uint32_t actualColSpan =
tableFrame->GetEffectiveColSpanAt(curRowIndex, curColIndex);
- if (origRowIndex <= maxRowIndex && maxRowIndex >= 0 &&
+ if (origRowIndex <= static_cast<uint32_t>(maxRowIndex) && maxRowIndex >= 0 &&
origRowIndex + actualRowSpan - 1 >= static_cast<uint32_t>(minRowIndex) &&
- origColIndex <= maxColIndex && maxColIndex >= 0 &&
+ origColIndex <= static_cast<uint32_t>(maxColIndex) && maxColIndex >= 0 &&
origColIndex + actualColSpan - 1 >= static_cast<uint32_t>(minColIndex)) {
mDomSelections[index]->RemoveRange(range);
@@ -2925,33 +2924,32 @@ nsFrameSelection::AddCellsToSelection(nsIContent *aTableContent,
return NS_ERROR_FAILURE;
nsresult result = NS_OK;
- int32_t row = aStartRowIndex;
+ uint32_t row = aStartRowIndex;
while(true)
{
- int32_t col = aStartColumnIndex;
+ uint32_t col = aStartColumnIndex;
while(true)
{
nsTableCellFrame* cellFrame = tableFrame->GetCellFrameAt(row, col);
// Skip cells that are spanned from previous locations or are already selected
if (cellFrame) {
- int32_t origRow, origCol;
- cellFrame->GetRowIndex(origRow);
- cellFrame->GetColIndex(origCol);
+ uint32_t origRow = cellFrame->RowIndex();
+ uint32_t origCol = cellFrame->ColIndex();
if (origRow == row && origCol == col && !cellFrame->IsSelected()) {
result = SelectCellElement(cellFrame->GetContent());
if (NS_FAILED(result)) return result;
}
}
// Done when we reach end column
- if (col == aEndColumnIndex) break;
+ if (col == static_cast<uint32_t>(aEndColumnIndex)) break;
if (aStartColumnIndex < aEndColumnIndex)
col ++;
else
col--;
}
- if (row == aEndRowIndex) break;
+ if (row == static_cast<uint32_t>(aEndRowIndex)) break;
if (aStartRowIndex < aEndRowIndex)
row++;
@@ -3846,7 +3844,7 @@ Selection::AddItem(nsRange* aItem, int32_t* aOutIndex, bool aNoStartSelect)
if (mUserInitiated) {
AutoTArray<RefPtr<nsRange>, 4> rangesToAdd;
- *aOutIndex = -1;
+ *aOutIndex = int32_t(mRanges.Length()) - 1;
nsIDocument* doc = GetParentObject();
bool selectEventsEnabled =
diff --git a/layout/mathml/nsMathMLmtableFrame.cpp b/layout/mathml/nsMathMLmtableFrame.cpp
index fd184e637..4bd7d4395 100644
--- a/layout/mathml/nsMathMLmtableFrame.cpp
+++ b/layout/mathml/nsMathMLmtableFrame.cpp
@@ -183,10 +183,8 @@ static void
ApplyBorderToStyle(const nsMathMLmtdFrame* aFrame,
nsStyleBorder& aStyleBorder)
{
- int32_t rowIndex;
- int32_t columnIndex;
- aFrame->GetRowIndex(rowIndex);
- aFrame->GetColIndex(columnIndex);
+ uint32_t rowIndex = aFrame->RowIndex();
+ uint32_t columnIndex = aFrame->ColIndex();
nscoord borderWidth =
aFrame->PresContext()->GetBorderWidthTable()[NS_STYLE_BORDER_WIDTH_THIN];
@@ -201,7 +199,7 @@ ApplyBorderToStyle(const nsMathMLmtdFrame* aFrame,
if (rowIndex > 0 && rowLinesList) {
// If the row number is greater than the number of provided rowline
// values, we simply repeat the last value.
- int32_t listLength = rowLinesList->Length();
+ uint32_t listLength = rowLinesList->Length();
if (rowIndex < listLength) {
aStyleBorder.SetBorderStyle(NS_SIDE_TOP,
rowLinesList->ElementAt(rowIndex - 1));
@@ -216,7 +214,7 @@ ApplyBorderToStyle(const nsMathMLmtdFrame* aFrame,
if (columnIndex > 0 && columnLinesList) {
// If the column number is greater than the number of provided columline
// values, we simply repeat the last value.
- int32_t listLength = columnLinesList->Length();
+ uint32_t listLength = columnLinesList->Length();
if (columnIndex < listLength) {
aStyleBorder.SetBorderStyle(NS_SIDE_LEFT,
columnLinesList->ElementAt(columnIndex - 1));
@@ -1160,47 +1158,6 @@ nsMathMLmtdFrame::Init(nsIContent* aContent,
RemoveStateBits(NS_FRAME_FONT_INFLATION_FLOW_ROOT);
}
-int32_t
-nsMathMLmtdFrame::GetRowSpan()
-{
- int32_t rowspan = 1;
-
- // Don't look at the content's rowspan if we're not an mtd or a pseudo cell.
- if (mContent->IsMathMLElement(nsGkAtoms::mtd_) &&
- !StyleContext()->GetPseudo()) {
- nsAutoString value;
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::rowspan, value);
- if (!value.IsEmpty()) {
- nsresult error;
- rowspan = value.ToInteger(&error);
- if (NS_FAILED(error) || rowspan < 0)
- rowspan = 1;
- rowspan = std::min(rowspan, MAX_ROWSPAN);
- }
- }
- return rowspan;
-}
-
-int32_t
-nsMathMLmtdFrame::GetColSpan()
-{
- int32_t colspan = 1;
-
- // Don't look at the content's colspan if we're not an mtd or a pseudo cell.
- if (mContent->IsMathMLElement(nsGkAtoms::mtd_) &&
- !StyleContext()->GetPseudo()) {
- nsAutoString value;
- mContent->GetAttr(kNameSpaceID_None, nsGkAtoms::columnspan_, value);
- if (!value.IsEmpty()) {
- nsresult error;
- colspan = value.ToInteger(&error);
- if (NS_FAILED(error) || colspan <= 0 || colspan > MAX_COLSPAN)
- colspan = 1;
- }
- }
- return colspan;
-}
-
nsresult
nsMathMLmtdFrame::AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
@@ -1243,12 +1200,11 @@ nsMathMLmtdFrame::GetVerticalAlign() const
nsTArray<int8_t>* alignmentList = FindCellProperty(this, RowAlignProperty());
if (alignmentList) {
- int32_t rowIndex;
- GetRowIndex(rowIndex);
+ uint32_t rowIndex = RowIndex();
// If the row number is greater than the number of provided rowalign values,
// we simply repeat the last value.
- if (rowIndex < (int32_t)alignmentList->Length())
+ if (rowIndex < alignmentList->Length())
alignment = alignmentList->ElementAt(rowIndex);
else
alignment = alignmentList->ElementAt(alignmentList->Length() - 1);
@@ -1335,12 +1291,11 @@ nsStyleText* nsMathMLmtdInnerFrame::StyleTextForLineLayout()
if (alignmentList) {
nsMathMLmtdFrame* cellFrame = (nsMathMLmtdFrame*)GetParent();
- int32_t columnIndex;
- cellFrame->GetColIndex(columnIndex);
+ uint32_t columnIndex = cellFrame->ColIndex();
// If the column number is greater than the number of provided columalign
// values, we simply repeat the last value.
- if (columnIndex < (int32_t)alignmentList->Length())
+ if (columnIndex < alignmentList->Length())
alignment = alignmentList->ElementAt(columnIndex);
else
alignment = alignmentList->ElementAt(alignmentList->Length() - 1);
diff --git a/layout/mathml/nsMathMLmtableFrame.h b/layout/mathml/nsMathMLmtableFrame.h
index 5cb4fc4a2..725991c17 100644
--- a/layout/mathml/nsMathMLmtableFrame.h
+++ b/layout/mathml/nsMathMLmtableFrame.h
@@ -257,8 +257,6 @@ public:
nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists) override;
- virtual int32_t GetRowSpan() override;
- virtual int32_t GetColSpan() override;
virtual bool IsFrameOfType(uint32_t aFlags) const override
{
return nsTableCellFrame::IsFrameOfType(aFlags & ~(nsIFrame::eMathML));
diff --git a/layout/reftests/css-grid/grid-max-sizing-flex-007-ref.html b/layout/reftests/css-grid/grid-max-sizing-flex-007-ref.html
index c5392d32c..b17a1cc02 100644
--- a/layout/reftests/css-grid/grid-max-sizing-flex-007-ref.html
+++ b/layout/reftests/css-grid/grid-max-sizing-flex-007-ref.html
@@ -107,4 +107,28 @@
<div class="item"></div>
</div>
+<pre>The first 6 grids should look the same:</pre>
+<div class="grid rows" style="grid: 1fr / 30px; height:83px">
+ <div class="item"></div>
+</div>
+<div class="grid rows" style="grid: 10px 1fr / 30px; height:83px">
+ <div class="item" style="grid-row:span 2"></div>
+</div>
+<div class="grid rows" style="grid: 1fr / 30px; height:83px">
+ <div class="item"></div>
+</div>
+<div class="grid rows" style="grid: 1fr 1fr / 30px; height:83px">
+ <div class="item" style="grid-row:span 2"><div style="height:90px"></div></div>
+</div>
+<div class="grid rows" style="grid: 1fr auto / 30px; height:83px">
+ <div class="item" style="grid-row:span 2"><div style="height:90px"></div></div>
+</div>
+<div class="grid rows" style="grid: 10px 1fr / 30px; height:83px">
+ <div class="item" style="grid-row:span 2"><div style="height:90px"></div></div>
+</div>
+<div class="grid rows" style="grid: 1fr 1fr / 30px; grid-row-gap:10px; height:83px">
+ <div class="item" style="grid-row:span 2"><div style="height:40px"></div></div>
+ <div class="item"><div style="height:40px"></div></div>
+</div>
+
</body></html>
diff --git a/layout/reftests/css-grid/grid-max-sizing-flex-007.html b/layout/reftests/css-grid/grid-max-sizing-flex-007.html
index ac9dcc77c..a2f39e95b 100644
--- a/layout/reftests/css-grid/grid-max-sizing-flex-007.html
+++ b/layout/reftests/css-grid/grid-max-sizing-flex-007.html
@@ -105,4 +105,28 @@
<div class="item"></div>
</div>
+<pre>The first 6 grids should look the same:</pre>
+<div class="grid rows" style="grid: 1fr / 30px; min-height:83px">
+ <div class="item"></div>
+</div>
+<div class="grid rows" style="grid: 10px 1fr / 30px; min-height:83px">
+ <div class="item" style="grid-row:span 2"></div>
+</div>
+<div class="grid rows" style="grid: 1fr / 30px; max-height:30px; min-height:83px">
+ <div class="item"></div>
+</div>
+<div class="grid rows" style="grid: 1fr 1fr / 30px; max-height:83px">
+ <div class="item" style="grid-row:span 2"><div style="height:90px"></div></div>
+</div>
+<div class="grid rows" style="grid: 1fr auto / 30px; max-height:83px">
+ <div class="item" style="grid-row:span 2"><div style="height:90px"></div></div>
+</div>
+<div class="grid rows" style="grid: 10px 1fr / 30px; max-height:83px">
+ <div class="item" style="grid-row:span 2"><div style="height:90px"></div></div>
+</div>
+<div class="grid rows" style="grid: 1fr 1fr / 30px; grid-row-gap:10px; max-height:83px">
+ <div class="item" style="grid-row:span 2"><div style="height:40px"></div></div>
+ <div class="item"><div style="height:40px"></div></div>
+</div>
+
</body></html>
diff --git a/layout/style/nsCSSParser.cpp b/layout/style/nsCSSParser.cpp
index a8309314f..556e35406 100644
--- a/layout/style/nsCSSParser.cpp
+++ b/layout/style/nsCSSParser.cpp
@@ -1056,6 +1056,7 @@ protected:
bool ParseOneFamily(nsAString& aFamily, bool& aOneKeyword, bool& aQuoted);
bool ParseFamily(nsCSSValue& aValue);
bool ParseFontFeatureSettings(nsCSSValue& aValue);
+ bool ParseFontVariationSettings(nsCSSValue& aValue);
bool ParseFontSrc(nsCSSValue& aValue);
bool ParseFontSrcFormat(InfallibleTArray<nsCSSValue>& values);
bool ParseFontRanges(nsCSSValue& aValue);
@@ -12092,6 +12093,8 @@ CSSParserImpl::ParseSingleValuePropertyByFunction(nsCSSValue& aValue,
return ParseFontVariantNumeric(aValue);
case eCSSProperty_font_feature_settings:
return ParseFontFeatureSettings(aValue);
+ case eCSSProperty_font_variation_settings:
+ return ParseFontVariationSettings(aValue);
case eCSSProperty_font_weight:
return ParseFontWeight(aValue);
case eCSSProperty_image_orientation:
@@ -15315,6 +15318,19 @@ CSSParserImpl::ParseFontFeatureSettings(nsCSSValue& aValue)
return true;
}
+bool
+CSSParserImpl::ParseFontVariationSettings(nsCSSValue& aValue)
+{
+ // TODO: Actually implement this.
+
+ // This stub is here because websites insist on considering this
+ // very hardware-dependent and O.S.-variable low-level font-control
+ // as a "critical feature" which it isn't as there is 0 guarantee
+ // that font variation settings are supported or honored by any
+ // operating system used by the client.
+ return true;
+}
+
bool
CSSParserImpl::ParseListStyle()
{
diff --git a/layout/style/nsCSSPropList.h b/layout/style/nsCSSPropList.h
index 07db6d3dd..411f982a4 100644
--- a/layout/style/nsCSSPropList.h
+++ b/layout/style/nsCSSPropList.h
@@ -2037,6 +2037,20 @@ CSS_PROP_FONT(
CSS_PROP_NO_OFFSET,
eStyleAnimType_Discrete)
CSS_PROP_FONT(
+ font-variation-settings,
+ font_variation_settings,
+ FontVariationSettings,
+ CSS_PROPERTY_PARSE_VALUE |
+ CSS_PROPERTY_VALUE_PARSER_FUNCTION |
+ CSS_PROPERTY_VALUE_LIST_USES_COMMAS |
+ CSS_PROPERTY_APPLIES_TO_FIRST_LETTER_AND_FIRST_LINE |
+ CSS_PROPERTY_APPLIES_TO_PLACEHOLDER,
+ "layout.css.font-variations.stub",
+ 0,
+ nullptr,
+ CSS_PROP_NO_OFFSET,
+ eStyleAnimType_Discrete)
+CSS_PROP_FONT(
font-weight,
font_weight,
FontWeight,
diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp
index ac2978c27..289a16ecd 100644
--- a/layout/style/nsCSSProps.cpp
+++ b/layout/style/nsCSSProps.cpp
@@ -2189,8 +2189,6 @@ const KTableEntry nsCSSProps::kUserFocusKTable[] = {
const KTableEntry nsCSSProps::kUserInputKTable[] = {
{ eCSSKeyword_none, StyleUserInput::None },
- { eCSSKeyword_enabled, StyleUserInput::Enabled },
- { eCSSKeyword_disabled, StyleUserInput::Disabled },
{ eCSSKeyword_auto, StyleUserInput::Auto },
{ eCSSKeyword_UNKNOWN, -1 }
};
diff --git a/layout/style/nsComputedDOMStyle.cpp b/layout/style/nsComputedDOMStyle.cpp
index 647f7f6dc..910c1de8a 100644
--- a/layout/style/nsComputedDOMStyle.cpp
+++ b/layout/style/nsComputedDOMStyle.cpp
@@ -674,9 +674,9 @@ nsComputedDOMStyle::UpdateCurrentStyleSources(bool aNeedsLayoutFlush)
mPresShell->GetPresContext()->GetRestyleGeneration();
if (mStyleContext) {
- // We can't rely on the undisplayed restyle generation if mElement is
- // out-of-document, since that generation is not incremented for DOM changes
- // on out-of-document elements.
+ // We can't rely on the undisplayed restyle generation if mElement is
+ // out-of-document, since that generation is not incremented for DOM changes
+ // on out-of-document elements.
if (mStyleContextGeneration == currentGeneration &&
mElement->IsInComposedDoc()) {
// Our cached style context is still valid.
@@ -1620,6 +1620,16 @@ nsComputedDOMStyle::DoGetFontFeatureSettings()
}
already_AddRefed<CSSValue>
+nsComputedDOMStyle::DoGetFontVariationSettings()
+{
+ // TODO: This is still a stub, always returning "normal"
+ RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
+
+ val->SetIdent(eCSSKeyword_normal);
+ return val.forget();
+}
+
+already_AddRefed<CSSValue>
nsComputedDOMStyle::DoGetFontKerning()
{
RefPtr<nsROCSSPrimitiveValue> val = new nsROCSSPrimitiveValue;
diff --git a/layout/style/nsComputedDOMStyle.h b/layout/style/nsComputedDOMStyle.h
index 7fbf49afe..e94d8dbf6 100644
--- a/layout/style/nsComputedDOMStyle.h
+++ b/layout/style/nsComputedDOMStyle.h
@@ -251,6 +251,7 @@ private:
already_AddRefed<CSSValue> DoGetColor();
already_AddRefed<CSSValue> DoGetFontFamily();
already_AddRefed<CSSValue> DoGetFontFeatureSettings();
+ already_AddRefed<CSSValue> DoGetFontVariationSettings();
already_AddRefed<CSSValue> DoGetFontKerning();
already_AddRefed<CSSValue> DoGetFontLanguageOverride();
already_AddRefed<CSSValue> DoGetFontSize();
diff --git a/layout/style/nsComputedDOMStylePropertyList.h b/layout/style/nsComputedDOMStylePropertyList.h
index 825976b58..557281810 100644
--- a/layout/style/nsComputedDOMStylePropertyList.h
+++ b/layout/style/nsComputedDOMStylePropertyList.h
@@ -144,6 +144,7 @@ COMPUTED_STYLE_PROP(font_variant_east_asian, FontVariantEastAsian)
COMPUTED_STYLE_PROP(font_variant_ligatures, FontVariantLigatures)
COMPUTED_STYLE_PROP(font_variant_numeric, FontVariantNumeric)
COMPUTED_STYLE_PROP(font_variant_position, FontVariantPosition)
+COMPUTED_STYLE_PROP(font_variation_settings, FontVariationSettings)
COMPUTED_STYLE_PROP(font_weight, FontWeight)
COMPUTED_STYLE_PROP(grid_auto_columns, GridAutoColumns)
COMPUTED_STYLE_PROP(grid_auto_flow, GridAutoFlow)
diff --git a/layout/style/nsStyleConsts.h b/layout/style/nsStyleConsts.h
index 6d207aec9..5412eed26 100644
--- a/layout/style/nsStyleConsts.h
+++ b/layout/style/nsStyleConsts.h
@@ -241,8 +241,6 @@ enum class StyleUserSelect : uint8_t {
// user-input
enum class StyleUserInput : uint8_t {
None,
- Enabled,
- Disabled,
Auto,
};
diff --git a/layout/style/nsTransitionManager.cpp b/layout/style/nsTransitionManager.cpp
index 118702e8f..a317f9943 100644
--- a/layout/style/nsTransitionManager.cpp
+++ b/layout/style/nsTransitionManager.cpp
@@ -44,6 +44,7 @@ using mozilla::dom::CSSTransition;
using mozilla::dom::KeyframeEffectReadOnly;
using namespace mozilla;
+using namespace mozilla::dom;
using namespace mozilla::css;
namespace {
diff --git a/layout/style/res/forms.css b/layout/style/res/forms.css
index e7566e183..95025221d 100644
--- a/layout/style/res/forms.css
+++ b/layout/style/res/forms.css
@@ -425,7 +425,6 @@ optgroup:disabled,
select:disabled:disabled /* Need the pseudo-class twice to have the specificity
be at least the same as select[size][multiple] above */
{
- -moz-user-input: disabled;
color: GrayText;
background-color: ThreeDLightShadow;
cursor: inherit;
diff --git a/layout/style/test/property_database.js b/layout/style/test/property_database.js
index c75f7b498..3486d15d0 100644
--- a/layout/style/test/property_database.js
+++ b/layout/style/test/property_database.js
@@ -2203,7 +2203,7 @@ var gCSSProperties = {
inherited: true,
type: CSS_TYPE_LONGHAND,
initial_values: [ "auto" ],
- other_values: [ "none", "enabled", "disabled" ],
+ other_values: [ "none" ],
invalid_values: []
},
"-moz-user-modify": {
diff --git a/layout/tables/celldata.h b/layout/tables/celldata.h
index b744b5175..ac7be58d7 100644
--- a/layout/tables/celldata.h
+++ b/layout/tables/celldata.h
@@ -6,6 +6,7 @@
#define CellData_h__
#include "nsISupports.h"
+#include "nsITableCellLayout.h" // for MAX_COLSPAN / MAX_ROWSPAN
#include "nsCoord.h"
#include "mozilla/gfx/Types.h"
#include "mozilla/WritingModes.h"
@@ -15,11 +16,6 @@ class nsTableCellFrame;
class nsCellMap;
class BCCellData;
-
-#define MAX_ROWSPAN 65534 // the cellmap can not handle more.
-#define MAX_COLSPAN 1000 // limit as IE and opera do. If this ever changes,
- // change COL_SPAN_OFFSET/COL_SPAN_SHIFT accordingly.
-
/**
* Data stored by nsCellMap to rationalize rowspan and colspan cells.
*/
diff --git a/layout/tables/nsCellMap.cpp b/layout/tables/nsCellMap.cpp
index bdd12cf70..4852a4bdd 100644
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -2431,9 +2431,8 @@ void nsCellMap::Dump(bool aIsBorderCollapse) const
if (cd) {
if (cd->IsOrig()) {
nsTableCellFrame* cellFrame = cd->GetCellFrame();
- int32_t cellFrameColIndex;
- cellFrame->GetColIndex(cellFrameColIndex);
- printf("C%d,%d=%p(%d) ", rIndex, colIndex, (void*)cellFrame,
+ uint32_t cellFrameColIndex = cellFrame->ColIndex();
+ printf("C%d,%d=%p(%u) ", rIndex, colIndex, (void*)cellFrame,
cellFrameColIndex);
cellCount++;
}
@@ -2520,8 +2519,7 @@ nsCellMap::GetCellInfoAt(const nsTableCellMap& aMap,
cellFrame = GetCellFrame(aRowX, aColX, *data, true);
}
if (cellFrame && aColSpan) {
- int32_t initialColIndex;
- cellFrame->GetColIndex(initialColIndex);
+ uint32_t initialColIndex = cellFrame->ColIndex();
*aColSpan = GetEffectiveColSpan(aMap, aRowX, initialColIndex);
}
}
diff --git a/layout/tables/nsITableCellLayout.h b/layout/tables/nsITableCellLayout.h
index e761d76be..fdf693b06 100644
--- a/layout/tables/nsITableCellLayout.h
+++ b/layout/tables/nsITableCellLayout.h
@@ -7,9 +7,14 @@
#include "nsQueryFrame.h"
+#define MAX_ROWSPAN 65534 // the cellmap can not handle more.
+#define MAX_COLSPAN 1000 // limit as IE and opera do. If this ever changes,
+// change COL_SPAN_OFFSET/COL_SPAN_SHIFT accordingly.
+
/**
* nsITableCellLayout
* interface for layout objects that act like table cells.
+ * XXX: This interface should really go away...
*
* @author sclark
*/
@@ -22,11 +27,6 @@ public:
/** return the mapped cell's row and column indexes (starting at 0 for each) */
NS_IMETHOD GetCellIndexes(int32_t &aRowIndex, int32_t &aColIndex)=0;
- /** return the mapped cell's row index (starting at 0 for the first row) */
- virtual nsresult GetRowIndex(int32_t &aRowIndex) const = 0;
-
- /** return the mapped cell's column index (starting at 0 for the first column) */
- virtual nsresult GetColIndex(int32_t &aColIndex) const = 0;
};
#endif
diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp
index ec9458f76..8b811df1e 100644
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -59,20 +59,6 @@ nsTableCellFrame::~nsTableCellFrame()
NS_IMPL_FRAMEARENA_HELPERS(nsTableCellFrame)
-nsTableCellFrame*
-nsTableCellFrame::GetNextCell() const
-{
- nsIFrame* childFrame = GetNextSibling();
- while (childFrame) {
- nsTableCellFrame *cellFrame = do_QueryFrame(childFrame);
- if (cellFrame) {
- return cellFrame;
- }
- childFrame = childFrame->GetNextSibling();
- }
- return nullptr;
-}
-
void
nsTableCellFrame::Init(nsIContent* aContent,
nsContainerFrame* aParent,
@@ -88,8 +74,7 @@ nsTableCellFrame::Init(nsIContent* aContent,
if (aPrevInFlow) {
// Set the column index
nsTableCellFrame* cellFrame = (nsTableCellFrame*)aPrevInFlow;
- int32_t colIndex;
- cellFrame->GetColIndex(colIndex);
+ uint32_t colIndex = cellFrame->ColIndex();
SetColIndex(colIndex);
}
}
@@ -183,34 +168,6 @@ nsTableCellFrame::NeedsToObserve(const ReflowInput& aReflowInput)
}
nsresult
-nsTableCellFrame::GetRowIndex(int32_t &aRowIndex) const
-{
- nsresult result;
- nsTableRowFrame* row = static_cast<nsTableRowFrame*>(GetParent());
- if (row) {
- aRowIndex = row->GetRowIndex();
- result = NS_OK;
- }
- else {
- aRowIndex = 0;
- result = NS_ERROR_NOT_INITIALIZED;
- }
- return result;
-}
-
-nsresult
-nsTableCellFrame::GetColIndex(int32_t &aColIndex) const
-{
- if (GetPrevInFlow()) {
- return static_cast<nsTableCellFrame*>(FirstInFlow())->GetColIndex(aColIndex);
- }
- else {
- aColIndex = mColIndex;
- return NS_OK;
- }
-}
-
-nsresult
nsTableCellFrame::AttributeChanged(int32_t aNameSpaceID,
nsIAtom* aAttribute,
int32_t aModType)
@@ -238,13 +195,13 @@ nsTableCellFrame::DidSetStyleContext(nsStyleContext* aOldStyleContext)
nsTableFrame* tableFrame = GetTableFrame();
if (tableFrame->IsBorderCollapse() &&
tableFrame->BCRecalcNeeded(aOldStyleContext, StyleContext())) {
- int32_t colIndex, rowIndex;
- GetColIndex(colIndex);
- GetRowIndex(rowIndex);
+ uint32_t colIndex = ColIndex();
+ uint32_t rowIndex = RowIndex();
// row span needs to be clamped as we do not create rows in the cellmap
// which do not have cells originating in them
TableArea damageArea(colIndex, rowIndex, GetColSpan(),
- std::min(GetRowSpan(), tableFrame->GetRowCount() - rowIndex));
+ std::min(static_cast<uint32_t>(GetRowSpan()),
+ tableFrame->GetRowCount() - rowIndex));
tableFrame->AddBCDamageArea(damageArea);
}
}
@@ -464,19 +421,40 @@ PaintTableCellSelection(nsIFrame* aFrame, DrawTarget* aDrawTarget,
aPt);
}
+bool
+nsTableCellFrame::ShouldPaintBordersAndBackgrounds() const
+{
+ // If we're not visible, we don't paint.
+ if (!StyleVisibility()->IsVisible()) {
+ return false;
+ }
+
+ // Consider 'empty-cells', but only in separated borders mode.
+ if (!GetContentEmpty()) {
+ return true;
+ }
+
+ nsTableFrame* tableFrame = GetTableFrame();
+ if (tableFrame->IsBorderCollapse()) {
+ return true;
+ }
+
+ return StyleTableBorder()->mEmptyCells == NS_STYLE_TABLE_EMPTY_CELLS_SHOW;
+}
+
+bool
+nsTableCellFrame::ShouldPaintBackground(nsDisplayListBuilder* aBuilder)
+{
+ return ShouldPaintBordersAndBackgrounds() && IsVisibleInSelection(aBuilder);
+}
+
void
nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
DO_GLOBAL_REFLOW_COUNT_DSP("nsTableCellFrame");
- nsTableFrame* tableFrame = GetTableFrame();
- int32_t emptyCellStyle = GetContentEmpty() && !tableFrame->IsBorderCollapse() ?
- StyleTableBorder()->mEmptyCells
- : NS_STYLE_TABLE_EMPTY_CELLS_SHOW;
- // take account of 'empty-cells'
- if (StyleVisibility()->IsVisible() &&
- (NS_STYLE_TABLE_EMPTY_CELLS_HIDE != emptyCellStyle)) {
+ if (ShouldPaintBordersAndBackgrounds()) {
// display outset box-shadows if we need to.
bool hasBoxShadow = !!StyleEffects()->mBoxShadow;
if (hasBoxShadow) {
@@ -501,7 +479,7 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
// display borders if we need to
- ProcessBorders(tableFrame, aBuilder, aLists);
+ ProcessBorders(GetTableFrame(), aBuilder, aLists);
// and display the selection border if we need to
if (IsSelected()) {
@@ -704,16 +682,18 @@ nsTableCellFrame::GetCellBaseline() const
borderPadding;
}
-int32_t nsTableCellFrame::GetRowSpan()
+int32_t
+nsTableCellFrame::GetRowSpan()
{
int32_t rowSpan=1;
- nsGenericHTMLElement *hc = nsGenericHTMLElement::FromContent(mContent);
// Don't look at the content's rowspan if we're a pseudo cell
- if (hc && !StyleContext()->GetPseudo()) {
- const nsAttrValue* attr = hc->GetParsedAttr(nsGkAtoms::rowspan);
+ if (!StyleContext()->GetPseudo()) {
+ dom::Element* elem = mContent->AsElement();
+ const nsAttrValue* attr = elem->GetParsedAttr(nsGkAtoms::rowspan);
// Note that we don't need to check the tag name, because only table cells
- // and table headers parse the "rowspan" attribute into an integer.
+ // (including MathML <mtd>) and table headers parse the "rowspan" attribute
+ // into an integer.
if (attr && attr->Type() == nsAttrValue::eInteger) {
rowSpan = attr->GetIntegerValue();
}
@@ -721,16 +701,20 @@ int32_t nsTableCellFrame::GetRowSpan()
return rowSpan;
}
-int32_t nsTableCellFrame::GetColSpan()
+int32_t
+nsTableCellFrame::GetColSpan()
{
int32_t colSpan=1;
- nsGenericHTMLElement *hc = nsGenericHTMLElement::FromContent(mContent);
// Don't look at the content's colspan if we're a pseudo cell
- if (hc && !StyleContext()->GetPseudo()) {
- const nsAttrValue* attr = hc->GetParsedAttr(nsGkAtoms::colspan);
+ if (!StyleContext()->GetPseudo()) {
+ dom::Element* elem = mContent->AsElement();
+ const nsAttrValue* attr = elem->GetParsedAttr(
+ MOZ_UNLIKELY(elem->IsMathMLElement()) ? nsGkAtoms::columnspan_
+ : nsGkAtoms::colspan);
// Note that we don't need to check the tag name, because only table cells
- // and table headers parse the "colspan" attribute into an integer.
+ // (including MathML <mtd>) and table headers parse the "colspan" attribute
+ // into an integer.
if (attr && attr->Type() == nsAttrValue::eInteger) {
colSpan = attr->GetIntegerValue();
}
@@ -807,14 +791,13 @@ CalcUnpaginatedBSize(nsTableCellFrame& aCellFrame,
nsTableRowGroupFrame* firstRGInFlow =
static_cast<nsTableRowGroupFrame*>(row->GetParent());
- int32_t rowIndex;
- firstCellInFlow->GetRowIndex(rowIndex);
+ uint32_t rowIndex = firstCellInFlow->RowIndex();
int32_t rowSpan = aTableFrame.GetEffectiveRowSpan(*firstCellInFlow);
nscoord computedBSize = firstTableInFlow->GetRowSpacing(rowIndex,
rowIndex + rowSpan - 1);
computedBSize -= aBlockDirBorderPadding;
- int32_t rowX;
+ uint32_t rowX;
for (row = firstRGInFlow->GetFirstRow(), rowX = 0; row; row = row->GetNextRow(), rowX++) {
if (rowX > rowIndex + rowSpan - 1) {
break;
@@ -1029,12 +1012,7 @@ nsTableCellFrame::AccessibleType()
NS_IMETHODIMP
nsTableCellFrame::GetCellIndexes(int32_t &aRowIndex, int32_t &aColIndex)
{
- nsresult res = GetRowIndex(aRowIndex);
- if (NS_FAILED(res))
- {
- aColIndex = 0;
- return res;
- }
+ aRowIndex = RowIndex();
aColIndex = mColIndex;
return NS_OK;
}
diff --git a/layout/tables/nsTableCellFrame.h b/layout/tables/nsTableCellFrame.h
index 5f87c5f6d..f626a45b0 100644
--- a/layout/tables/nsTableCellFrame.h
+++ b/layout/tables/nsTableCellFrame.h
@@ -165,11 +165,11 @@ public:
/**
* return the cell's specified row span. this is what was specified in the
- * content model or in the style info, and is always >= 1.
+ * content model or in the style info, and is always >= 0.
* to get the effective row span (the actual value that applies), use GetEffectiveRowSpan()
* @see nsTableFrame::GetEffectiveRowSpan()
*/
- virtual int32_t GetRowSpan();
+ int32_t GetRowSpan();
// there is no set row index because row index depends on the cell's parent row only
@@ -183,7 +183,10 @@ public:
NS_IMETHOD GetCellIndexes(int32_t &aRowIndex, int32_t &aColIndex) override;
/** return the mapped cell's row index (starting at 0 for the first row) */
- virtual nsresult GetRowIndex(int32_t &aRowIndex) const override;
+ uint32_t RowIndex() const
+ {
+ return static_cast<nsTableRowFrame*>(GetParent())->GetRowIndex();
+ }
/**
* return the cell's specified col span. this is what was specified in the
@@ -191,10 +194,19 @@ public:
* to get the effective col span (the actual value that applies), use GetEffectiveColSpan()
* @see nsTableFrame::GetEffectiveColSpan()
*/
- virtual int32_t GetColSpan();
+ int32_t GetColSpan();
/** return the cell's column index (starting at 0 for the first column) */
- virtual nsresult GetColIndex(int32_t &aColIndex) const override;
+ uint32_t ColIndex() const
+ {
+ // NOTE: We copy this from previous continuations, and we don't ever have
+ // dynamic updates when tables split, so our mColIndex always matches our
+ // first continuation's.
+ MOZ_ASSERT(static_cast<nsTableCellFrame*>(FirstContinuation())->mColIndex ==
+ mColIndex,
+ "mColIndex out of sync with first continuation");
+ return mColIndex;
+ }
void SetColIndex(int32_t aColIndex);
/** return the available isize given to this frame during its last reflow */
@@ -209,13 +221,23 @@ public:
/** set the desired size returned by this frame during its last reflow */
inline void SetDesiredSize(const ReflowOutput & aDesiredSize);
- bool GetContentEmpty();
+ bool GetContentEmpty() const;
void SetContentEmpty(bool aContentEmpty);
bool HasPctOverBSize();
void SetHasPctOverBSize(bool aValue);
- nsTableCellFrame* GetNextCell() const;
+ nsTableCellFrame* GetNextCell() const
+ {
+ nsIFrame* sibling = GetNextSibling();
+#ifdef DEBUG
+ if (sibling) {
+ nsTableCellFrame* cellFrame = do_QueryFrame(sibling);
+ MOZ_ASSERT(cellFrame, "How do we have a non-cell sibling?");
+ }
+#endif // DEBUG
+ return static_cast<nsTableCellFrame*>(sibling);
+ }
virtual LogicalMargin GetBorderWidth(WritingMode aWM) const;
@@ -237,6 +259,10 @@ public:
virtual void InvalidateFrameWithRect(const nsRect& aRect, uint32_t aDisplayItemKey = 0) override;
virtual void InvalidateFrameForRemoval() override { InvalidateFrameSubtree(); }
+ bool ShouldPaintBordersAndBackgrounds() const;
+
+ bool ShouldPaintBackground(nsDisplayListBuilder* aBuilder);
+
protected:
virtual LogicalSides
GetLogicalSkipSides(const ReflowInput* aReflowInput = nullptr) const override;
@@ -273,7 +299,7 @@ inline void nsTableCellFrame::SetDesiredSize(const ReflowOutput & aDesiredSize)
mDesiredSize = aDesiredSize.Size(wm).ConvertTo(GetWritingMode(), wm);
}
-inline bool nsTableCellFrame::GetContentEmpty()
+inline bool nsTableCellFrame::GetContentEmpty() const
{
return HasAnyStateBits(NS_TABLE_CELL_CONTENT_EMPTY);
}
@@ -350,4 +376,17 @@ private:
BCPixelSize mIStartBorder;
};
+// Implemented here because that's a sane-ish way to make the includes work out.
+inline nsTableCellFrame* nsTableRowFrame::GetFirstCell() const
+{
+ nsIFrame* firstChild = mFrames.FirstChild();
+#ifdef DEBUG
+ if (firstChild) {
+ nsTableCellFrame* cellFrame = do_QueryFrame(firstChild);
+ MOZ_ASSERT(cellFrame, "How do we have a non-cell sibling?");
+ }
+#endif // DEBUG
+ return static_cast<nsTableCellFrame*>(firstChild);
+}
+
#endif
diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp
index 890d050fd..e5a48139a 100644
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -368,9 +368,8 @@ nsTableFrame::AttributeChangedFor(nsIFrame* aFrame,
nsTableCellMap* cellMap = GetCellMap();
if (cellMap) {
// for now just remove the cell from the map and reinsert it
- int32_t rowIndex, colIndex;
- cellFrame->GetRowIndex(rowIndex);
- cellFrame->GetColIndex(colIndex);
+ uint32_t rowIndex = cellFrame->RowIndex();
+ uint32_t colIndex = cellFrame->ColIndex();
RemoveCell(cellFrame, rowIndex);
AutoTArray<nsTableCellFrame*, 1> cells;
cells.AppendElement(cellFrame);
@@ -447,9 +446,7 @@ nsTableFrame::GetEffectiveRowSpan(int32_t aRowIndex,
nsTableCellMap* cellMap = GetCellMap();
NS_PRECONDITION (nullptr != cellMap, "bad call, cellMap not yet allocated.");
- int32_t colIndex;
- aCell.GetColIndex(colIndex);
- return cellMap->GetEffectiveRowSpan(aRowIndex, colIndex);
+ return cellMap->GetEffectiveRowSpan(aRowIndex, aCell.ColIndex());
}
int32_t
@@ -458,9 +455,8 @@ nsTableFrame::GetEffectiveRowSpan(const nsTableCellFrame& aCell,
{
nsTableCellMap* tableCellMap = GetCellMap(); if (!tableCellMap) ABORT1(1);
- int32_t colIndex, rowIndex;
- aCell.GetColIndex(colIndex);
- aCell.GetRowIndex(rowIndex);
+ uint32_t colIndex = aCell.ColIndex();
+ uint32_t rowIndex = aCell.RowIndex();
if (aCellMap)
return aCellMap->GetRowSpan(rowIndex, colIndex, true);
@@ -474,9 +470,8 @@ nsTableFrame::GetEffectiveColSpan(const nsTableCellFrame& aCell,
{
nsTableCellMap* tableCellMap = GetCellMap(); if (!tableCellMap) ABORT1(1);
- int32_t colIndex, rowIndex;
- aCell.GetColIndex(colIndex);
- aCell.GetRowIndex(rowIndex);
+ uint32_t colIndex = aCell.ColIndex();
+ uint32_t rowIndex = aCell.RowIndex();
if (aCellMap)
return aCellMap->GetEffectiveColSpan(*tableCellMap, rowIndex, colIndex);
@@ -1192,11 +1187,19 @@ PaintRowBackground(nsTableRowFrame* aRow,
nsIFrame* aFrame,
nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists,
+ const nsRect& aDirtyRect,
const nsPoint& aOffset = nsPoint())
{
// Compute background rect by iterating over all cell frames.
for (nsTableCellFrame* cell = aRow->GetFirstCell(); cell; cell = cell->GetNextCell()) {
+ if (!cell->ShouldPaintBackground(aBuilder)) {
+ continue;
+ }
+
auto cellRect = cell->GetRectRelativeToSelf() + cell->GetNormalPosition() + aOffset;
+ if (!aDirtyRect.Intersects(cellRect)) {
+ continue;
+ }
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, aFrame, cellRect,
aLists.BorderBackground(),
true, nullptr,
@@ -1209,10 +1212,14 @@ static void
PaintRowGroupBackground(nsTableRowGroupFrame* aRowGroup,
nsIFrame* aFrame,
nsDisplayListBuilder* aBuilder,
- const nsDisplayListSet& aLists)
+ const nsDisplayListSet& aLists,
+ const nsRect& aDirtyRect)
{
for (nsTableRowFrame* row = aRowGroup->GetFirstRow(); row; row = row->GetNextRow()) {
- PaintRowBackground(row, aFrame, aBuilder, aLists, row->GetNormalPosition());
+ if (!aDirtyRect.Intersects(nsRect(row->GetNormalPosition(), row->GetSize()))) {
+ continue;
+ }
+ PaintRowBackground(row, aFrame, aBuilder, aLists, aDirtyRect, row->GetNormalPosition());
}
}
@@ -1221,23 +1228,112 @@ PaintRowGroupBackgroundByColIdx(nsTableRowGroupFrame* aRowGroup,
nsIFrame* aFrame,
nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists,
- const nsTArray<int32_t>& aColIdx,
+ const nsRect& aDirtyRect,
+ const nsTArray<uint32_t>& aColIdx,
const nsPoint& aOffset)
{
+ MOZ_DIAGNOSTIC_ASSERT(!aColIdx.IsEmpty(),
+ "Must be painting backgrounds for something");
for (nsTableRowFrame* row = aRowGroup->GetFirstRow(); row; row = row->GetNextRow()) {
+ auto rowPos = row->GetNormalPosition() + aOffset;
+ if (!aDirtyRect.Intersects(nsRect(rowPos, row->GetSize()))) {
+ continue;
+ }
for (nsTableCellFrame* cell = row->GetFirstCell(); cell; cell = cell->GetNextCell()) {
- int32_t curColIdx;
- cell->GetColIndex(curColIdx);
- if (aColIdx.Contains(curColIdx)) {
- auto cellRect = cell->GetRectRelativeToSelf() + cell->GetNormalPosition() + row->GetNormalPosition() + aOffset;
+
+ uint32_t curColIdx = cell->ColIndex();
+ if (!aColIdx.Contains(curColIdx)) {
+ if (curColIdx > aColIdx.LastElement()) {
+ // We can just stop looking at this row.
+ break;
+ }
+ continue;
+ }
+
+ if (!cell->ShouldPaintBackground(aBuilder)) {
+ continue;
+ }
+
+ auto cellPos = cell->GetNormalPosition() + rowPos;
+ auto cellRect = nsRect(cellPos, cell->GetSize());
+ if (!aDirtyRect.Intersects(cellRect)) {
+ continue;
+ }
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, aFrame, cellRect,
aLists.BorderBackground(),
true, nullptr,
aFrame->GetRectRelativeToSelf(),
cell);
+ }
+ }
+}
+
+static inline bool FrameHasBorder(nsIFrame* f)
+{
+ if (!f->StyleVisibility()->IsVisible()) {
+ return false;
+ }
+
+ if (f->StyleBorder()->HasBorder()) {
+ return true;
+ }
+
+ return false;
+}
+
+void nsTableFrame::CalcHasBCBorders()
+{
+ if (!IsBorderCollapse()) {
+ SetHasBCBorders(false);
+ return;
+ }
+
+ if (FrameHasBorder(this)) {
+ SetHasBCBorders(true);
+ return;
+ }
+
+ // Check col and col group has borders.
+ for (nsIFrame* f : this->GetChildList(kColGroupList)) {
+ if (FrameHasBorder(f)) {
+ SetHasBCBorders(true);
+ return;
+ }
+
+ nsTableColGroupFrame *colGroup = static_cast<nsTableColGroupFrame*>(f);
+ for (nsTableColFrame* col = colGroup->GetFirstColumn(); col; col = col->GetNextCol()) {
+ if (FrameHasBorder(col)) {
+ SetHasBCBorders(true);
+ return;
}
}
}
+
+ // check row group, row and cell has borders.
+ RowGroupArray rowGroups;
+ OrderRowGroups(rowGroups);
+ for (nsTableRowGroupFrame* rowGroup : rowGroups) {
+ if (FrameHasBorder(rowGroup)) {
+ SetHasBCBorders(true);
+ return;
+ }
+
+ for (nsTableRowFrame* row = rowGroup->GetFirstRow(); row; row = row->GetNextRow()) {
+ if (FrameHasBorder(row)) {
+ SetHasBCBorders(true);
+ return;
+ }
+
+ for (nsTableCellFrame* cell = row->GetFirstCell(); cell; cell = cell->GetNextCell()) {
+ if (FrameHasBorder(cell)) {
+ SetHasBCBorders(true);
+ return;
+ }
+ }
+ }
+ }
+
+ SetHasBCBorders(false);
}
/* static */ void
@@ -1247,66 +1343,94 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists,
DisplayGenericTablePartTraversal aTraversal)
{
- if (aFrame->IsVisibleForPainting(aBuilder)) {
+ bool isVisible = aFrame->IsVisibleForPainting(aBuilder);
+ bool isTable = (aFrame->GetType() == nsGkAtoms::tableFrame);
+
+ if (isVisible || !isTable) {
nsDisplayTableItem* currentItem = aBuilder->GetCurrentTableItem();
// currentItem may be null, when none of the table parts have a
// background or border
if (currentItem) {
currentItem->UpdateForFrameBackground(aFrame);
}
+ }
+
+ if (isVisible) {
+ // XXX: should box-shadow for rows/rowgroups/columns/colgroups get painted
+ // just because we're visible? Or should it depend on the cell visibility
+ // when we're not the whole table?
// Paint the outset box-shadows for the table frames
- bool hasBoxShadow = aFrame->StyleEffects()->mBoxShadow != nullptr;
- if (hasBoxShadow) {
+ if (aFrame->StyleEffects()->mBoxShadow) {
aLists.BorderBackground()->AppendNewToTop(
new (aBuilder) nsDisplayBoxShadowOuter(aBuilder, aFrame));
}
+ }
- if (aFrame->GetType() == nsGkAtoms::tableRowGroupFrame) {
- nsTableRowGroupFrame* rowGroup = static_cast<nsTableRowGroupFrame*>(aFrame);
- PaintRowGroupBackground(rowGroup, aFrame, aBuilder, aLists);
- } else if (aFrame->GetType() == nsGkAtoms::tableRowFrame) {
- nsTableRowFrame* row = static_cast<nsTableRowFrame*>(aFrame);
- PaintRowBackground(row, aFrame, aBuilder, aLists);
- } else if (aFrame->GetType() == nsGkAtoms::tableColGroupFrame) {
- // Compute background rect by iterating all cell frame.
- nsTableColGroupFrame* colGroup = static_cast<nsTableColGroupFrame*>(aFrame);
- // Collecting column index.
- AutoTArray<int32_t, 1> colIdx;
- for (nsTableColFrame* col = colGroup->GetFirstColumn(); col; col = col->GetNextCol()) {
- colIdx.AppendElement(col->GetColIndex());
- }
+ // Background visibility for rows, rowgroups, columns, colgroups depends on
+ // the visibility of the _cell_, not of the row/col(group).
+ // See spec at https://drafts.csswg.org/css-tables-3/#drawing-cell-backgrounds
+ if (aFrame->GetType() == nsGkAtoms::tableRowGroupFrame) {
+ nsTableRowGroupFrame* rowGroup = static_cast<nsTableRowGroupFrame*>(aFrame);
+ PaintRowGroupBackground(rowGroup, aFrame, aBuilder, aLists, aDirtyRect);
+ } else if (aFrame->GetType() == nsGkAtoms::tableRowFrame) {
+ nsTableRowFrame* row = static_cast<nsTableRowFrame*>(aFrame);
+ PaintRowBackground(row, aFrame, aBuilder, aLists, aDirtyRect);
+ } else if (aFrame->GetType() == nsGkAtoms::tableColGroupFrame) {
+ // Compute background rect by iterating all cell frame.
+ nsTableColGroupFrame* colGroup = static_cast<nsTableColGroupFrame*>(aFrame);
+ // Collecting column index.
+ AutoTArray<uint32_t, 1> colIdx;
+ for (nsTableColFrame* col = colGroup->GetFirstColumn(); col; col = col->GetNextCol()) {
+ MOZ_ASSERT(colIdx.IsEmpty() ||
+ static_cast<uint32_t>(col->GetColIndex()) > colIdx.LastElement());
+ colIdx.AppendElement(col->GetColIndex());
+ }
+ if (!colIdx.IsEmpty()) {
+ // We have some actual cells that live inside this rowgroup.
nsTableFrame* table = colGroup->GetTableFrame();
RowGroupArray rowGroups;
table->OrderRowGroups(rowGroups);
for (nsTableRowGroupFrame* rowGroup : rowGroups) {
auto offset = rowGroup->GetNormalPosition() - colGroup->GetNormalPosition();
- PaintRowGroupBackgroundByColIdx(rowGroup, aFrame, aBuilder, aLists, colIdx, offset);
+ if (!aDirtyRect.Intersects(nsRect(offset, rowGroup->GetSize()))) {
+ continue;
+ }
+ PaintRowGroupBackgroundByColIdx(rowGroup, aFrame, aBuilder, aLists, aDirtyRect, colIdx, offset);
}
- } else if (aFrame->GetType() == nsGkAtoms::tableColFrame) {
- // Compute background rect by iterating all cell frame.
- nsTableColFrame* col = static_cast<nsTableColFrame*>(aFrame);
- AutoTArray<int32_t, 1> colIdx;
- colIdx.AppendElement(col->GetColIndex());
+ }
+ } else if (aFrame->GetType() == nsGkAtoms::tableColFrame) {
+ // Compute background rect by iterating all cell frame.
+ nsTableColFrame* col = static_cast<nsTableColFrame*>(aFrame);
+ AutoTArray<uint32_t, 1> colIdx;
+ colIdx.AppendElement(col->GetColIndex());
- nsTableFrame* table = col->GetTableFrame();
- RowGroupArray rowGroups;
- table->OrderRowGroups(rowGroups);
- for (nsTableRowGroupFrame* rowGroup : rowGroups) {
- auto offset = rowGroup->GetNormalPosition() -
- col->GetNormalPosition() -
- col->GetTableColGroupFrame()->GetNormalPosition();
- PaintRowGroupBackgroundByColIdx(rowGroup, aFrame, aBuilder, aLists, colIdx, offset);
+ nsTableFrame* table = col->GetTableFrame();
+ RowGroupArray rowGroups;
+ table->OrderRowGroups(rowGroups);
+ for (nsTableRowGroupFrame* rowGroup : rowGroups) {
+ auto offset = rowGroup->GetNormalPosition() -
+ col->GetNormalPosition() -
+ col->GetTableColGroupFrame()->GetNormalPosition();
+ if (!aDirtyRect.Intersects(nsRect(offset, rowGroup->GetSize()))) {
+ continue;
}
- } else {
- nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, aFrame,
- aFrame->GetRectRelativeToSelf(),
- aLists.BorderBackground());
+ PaintRowGroupBackgroundByColIdx(rowGroup, aFrame, aBuilder, aLists, aDirtyRect, colIdx, offset);
}
+ } else if (isVisible) {
+ nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder, aFrame,
+ aFrame->GetRectRelativeToSelf(),
+ aLists.BorderBackground());
+ }
+
+ if (isVisible) {
+ // XXX: should box-shadow for rows/rowgroups/columns/colgroups get painted
+ // just because we're visible? Or should it depend on the cell visibility
+ // when we're not the whole table?
// Paint the inset box-shadows for the table frames
- if (hasBoxShadow) {
+ if (aFrame->StyleEffects()->mBoxShadow) {
aLists.BorderBackground()->AppendNewToTop(
new (aBuilder) nsDisplayBoxShadowInner(aBuilder, aFrame));
}
@@ -1314,16 +1438,21 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
aTraversal(aBuilder, aFrame, aDirtyRect, aLists);
- if (aFrame->IsVisibleForPainting(aBuilder)) {
- if (aFrame->GetType() == nsGkAtoms::tableFrame) {
+ if (isVisible) {
+ if (isTable) {
nsTableFrame* table = static_cast<nsTableFrame*>(aFrame);
// In the collapsed border model, overlay all collapsed borders.
if (table->IsBorderCollapse()) {
- aLists.BorderBackground()->AppendNewToTop(
- new (aBuilder) nsDisplayTableBorderCollapse(aBuilder, table));
+ if (table->HasBCBorders()) {
+ aLists.BorderBackground()->AppendNewToTop(
+ new (aBuilder) nsDisplayTableBorderCollapse(aBuilder, table));
+ }
} else {
- aLists.BorderBackground()->AppendNewToTop(
- new (aBuilder) nsDisplayBorder(aBuilder, table));
+ const nsStyleBorder* borderStyle = aFrame->StyleBorder();
+ if (borderStyle->HasBorder()) {
+ aLists.BorderBackground()->AppendNewToTop(
+ new (aBuilder) nsDisplayBorder(aBuilder, table));
+ }
}
}
}
@@ -3911,9 +4040,8 @@ nsTableFrame::DumpRowGroup(nsIFrame* aKidFrame)
for (nsIFrame* childFrame : cFrame->PrincipalChildList()) {
nsTableCellFrame *cellFrame = do_QueryFrame(childFrame);
if (cellFrame) {
- int32_t colIndex;
- cellFrame->GetColIndex(colIndex);
- printf("cell(%d)=%p ", colIndex, static_cast<void*>(childFrame));
+ uint32_t colIndex = cellFrame->ColIndex();
+ printf("cell(%u)=%p ", colIndex, static_cast<void*>(childFrame));
}
}
printf("\n");
@@ -4046,6 +4174,7 @@ nsTableFrame::AddBCDamageArea(const TableArea& aValue)
#endif
SetNeedToCalcBCBorders(true);
+ SetNeedToCalcHasBCBorders(true);
// Get the property
BCPropertyData* value = GetOrCreateBCProperty();
if (value) {
@@ -4086,6 +4215,7 @@ nsTableFrame::SetFullBCDamageArea()
NS_ASSERTION(IsBorderCollapse(), "invalid SetFullBCDamageArea call");
SetNeedToCalcBCBorders(true);
+ SetNeedToCalcHasBCBorders(true);
BCPropertyData* value = GetOrCreateBCProperty();
if (value) {
diff --git a/layout/tables/nsTableFrame.h b/layout/tables/nsTableFrame.h
index a6b786402..d739faa72 100644
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -761,6 +761,13 @@ public:
bool NeedToCollapse() const;
void SetNeedToCollapse(bool aValue);
+ bool NeedToCalcHasBCBorders() const;
+ void SetNeedToCalcHasBCBorders(bool aValue);
+
+ void CalcHasBCBorders();
+ bool HasBCBorders();
+ void SetHasBCBorders(bool aValue);
+
/** The GeometryDirty bit is similar to the NS_FRAME_IS_DIRTY frame
* state bit, which implies that all descendants are dirty. The
* GeometryDirty still implies that all the parts of the table are
@@ -870,6 +877,8 @@ protected:
uint32_t mIStartContBCBorder:8;
uint32_t mNeedToCollapse:1; // rows, cols that have visibility:collapse need to be collapsed
uint32_t mResizedColumns:1; // have we resized columns since last reflow?
+ uint32_t mNeedToCalcHasBCBorders:1;
+ uint32_t mHasBCBorders:1;
} mBits;
nsTableCellMap* mCellMap; // maintains the relationships between rows, cols, and cells
@@ -965,6 +974,30 @@ inline void nsTableFrame::SetNeedToCalcBCBorders(bool aValue)
mBits.mNeedToCalcBCBorders = (unsigned)aValue;
}
+inline bool nsTableFrame::NeedToCalcHasBCBorders() const
+{
+ return (bool)mBits.mNeedToCalcHasBCBorders;
+}
+
+inline void nsTableFrame::SetNeedToCalcHasBCBorders(bool aValue)
+{
+ mBits.mNeedToCalcHasBCBorders = (unsigned)aValue;
+}
+
+inline bool nsTableFrame::HasBCBorders()
+{
+ if (NeedToCalcHasBCBorders()) {
+ CalcHasBCBorders();
+ SetNeedToCalcHasBCBorders(false);
+ }
+ return (bool)mBits.mHasBCBorders;
+}
+
+inline void nsTableFrame::SetHasBCBorders(bool aValue)
+{
+ mBits.mHasBCBorders = (unsigned)aValue;
+}
+
inline nscoord
nsTableFrame::GetContinuousIStartBCBorderWidth() const
{
diff --git a/layout/tables/nsTableRowFrame.cpp b/layout/tables/nsTableRowFrame.cpp
index ea2477b73..02b85a141 100644
--- a/layout/tables/nsTableRowFrame.cpp
+++ b/layout/tables/nsTableRowFrame.cpp
@@ -235,7 +235,7 @@ nsTableRowFrame::InsertFrames(ChildListID aListID,
// insert the cells into the cell map
int32_t colIndex = -1;
if (prevCellFrame) {
- prevCellFrame->GetColIndex(colIndex);
+ colIndex = prevCellFrame->ColIndex();
}
tableFrame->InsertCells(cellChildren, GetRowIndex(), colIndex);
@@ -304,18 +304,6 @@ GetBSizeOfRowsSpannedBelowFirst(nsTableCellFrame& aTableCellFrame,
return bsize;
}
-nsTableCellFrame*
-nsTableRowFrame::GetFirstCell()
-{
- for (nsIFrame* childFrame : mFrames) {
- nsTableCellFrame *cellFrame = do_QueryFrame(childFrame);
- if (cellFrame) {
- return cellFrame;
- }
- }
- return nullptr;
-}
-
/**
* Post-reflow hook. This is where the table row does its post-processing
*/
@@ -659,8 +647,7 @@ CalcAvailISize(nsTableFrame& aTableFrame,
nsTableCellFrame& aCellFrame)
{
nscoord cellAvailISize = 0;
- int32_t colIndex;
- aCellFrame.GetColIndex(colIndex);
+ uint32_t colIndex = aCellFrame.ColIndex();
int32_t colspan = aTableFrame.GetEffectiveColSpan(aCellFrame);
NS_ASSERTION(colspan > 0, "effective colspan should be positive");
nsTableFrame* fifTable =
@@ -799,12 +786,12 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
}
}
- int32_t cellColIndex;
- cellFrame->GetColIndex(cellColIndex);
+ uint32_t cellColIndex = cellFrame->ColIndex();
cellColSpan = aTableFrame.GetEffectiveColSpan(*cellFrame);
// If the adjacent cell is in a prior row (because of a rowspan) add in the space
- if (prevColIndex != (cellColIndex - 1)) {
+ // NOTE: prevColIndex can be -1 here.
+ if (prevColIndex != (static_cast<int32_t>(cellColIndex) - 1)) {
iCoord += GetSpaceBetween(prevColIndex, cellColIndex, cellColSpan, aTableFrame,
false);
}
@@ -1172,8 +1159,7 @@ nsTableRowFrame::CollapseRowIfNecessary(nscoord aRowOffset,
shift = rowRect.BSize(wm);
nsTableCellFrame* cellFrame = GetFirstCell();
if (cellFrame) {
- int32_t rowIndex;
- cellFrame->GetRowIndex(rowIndex);
+ uint32_t rowIndex = cellFrame->RowIndex();
shift += tableFrame->GetRowSpacing(rowIndex);
while (cellFrame) {
LogicalRect cRect = cellFrame->GetLogicalRect(wm, containerSize);
@@ -1204,13 +1190,13 @@ nsTableRowFrame::CollapseRowIfNecessary(nscoord aRowOffset,
for (nsIFrame* kidFrame : mFrames) {
nsTableCellFrame *cellFrame = do_QueryFrame(kidFrame);
if (cellFrame) {
- int32_t cellColIndex;
- cellFrame->GetColIndex(cellColIndex);
+ uint32_t cellColIndex = cellFrame->ColIndex();
int32_t cellColSpan = tableFrame->GetEffectiveColSpan(*cellFrame);
// If the adjacent cell is in a prior row (because of a rowspan) add in
// the space
- if (prevColIndex != (cellColIndex - 1)) {
+ // NOTE: prevColIndex can be -1 here.
+ if (prevColIndex != (static_cast<int32_t>(cellColIndex) - 1)) {
iPos += GetSpaceBetween(prevColIndex, cellColIndex, cellColSpan,
*tableFrame, true);
}
@@ -1323,9 +1309,9 @@ nsTableRowFrame::InsertCellFrame(nsTableCellFrame* aFrame,
for (nsIFrame* child : mFrames) {
nsTableCellFrame *cellFrame = do_QueryFrame(child);
if (cellFrame) {
- int32_t colIndex;
- cellFrame->GetColIndex(colIndex);
- if (colIndex < aColIndex) {
+ uint32_t colIndex = cellFrame->ColIndex();
+ // Can aColIndex be -1 here? Let's assume it can for now.
+ if (static_cast<int32_t>(colIndex) < aColIndex) {
priorCell = cellFrame;
}
else break;
diff --git a/layout/tables/nsTableRowFrame.h b/layout/tables/nsTableRowFrame.h
index 9e15d851f..c53c81ff1 100644
--- a/layout/tables/nsTableRowFrame.h
+++ b/layout/tables/nsTableRowFrame.h
@@ -82,7 +82,9 @@ public:
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
- nsTableCellFrame* GetFirstCell() ;
+ // Implemented in nsTableCellFrame.h, because it needs to know about the
+ // nsTableCellFrame class, but we can't include nsTableCellFrame.h here.
+ inline nsTableCellFrame* GetFirstCell() const;
/** calls Reflow for all of its child cells.
* Cells with rowspan=1 are all set to the same height and stacked horizontally.
diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp
index f613c8b79..37f577f5c 100644
--- a/layout/tables/nsTableRowGroupFrame.cpp
+++ b/layout/tables/nsTableRowGroupFrame.cpp
@@ -137,8 +137,7 @@ nsTableRowGroupFrame::InitRepeatedFrame(nsTableRowGroupFrame* aHeaderFooterFrame
while (copyCellFrame && originalCellFrame) {
NS_ASSERTION(originalCellFrame->GetContent() == copyCellFrame->GetContent(),
"cell frames have different content");
- int32_t colIndex;
- originalCellFrame->GetColIndex(colIndex);
+ uint32_t colIndex = originalCellFrame->ColIndex();
copyCellFrame->SetColIndex(colIndex);
// Move to the next cell frame
@@ -998,8 +997,7 @@ nsTableRowGroupFrame::SplitSpanningCells(nsPresContext& aPresContext,
nsTableCellFrame* contCell = static_cast<nsTableCellFrame*>(
aPresContext.PresShell()->FrameConstructor()->
CreateContinuingFrame(&aPresContext, cell, &aLastRow));
- int32_t colIndex;
- cell->GetColIndex(colIndex);
+ uint32_t colIndex = cell->ColIndex();
aContRow->InsertCellFrame(contCell, colIndex);
}
}
diff --git a/layout/tools/reftest/reftestcommandline.py b/layout/tools/reftest/reftestcommandline.py
index da76fbd9a..f983be528 100644
--- a/layout/tools/reftest/reftestcommandline.py
+++ b/layout/tools/reftest/reftestcommandline.py
@@ -323,7 +323,8 @@ class DesktopArgumentsParser(ReftestArgumentsParser):
def _prefs_gpu(self):
if mozinfo.os != "win":
- return ["layers.acceleration.force-enabled=true"]
+ return ["layers.acceleration.enabled=true",
+ "layers.acceleration.force=true"]
return []
def validate(self, options, reftest):
diff --git a/layout/tools/reftest/runreftest.py b/layout/tools/reftest/runreftest.py
index 7845903bd..7061b16ca 100644
--- a/layout/tools/reftest/runreftest.py
+++ b/layout/tools/reftest/runreftest.py
@@ -287,11 +287,6 @@ class RefTest(object):
prefs['browser.tabs.remote.autostart'] = True
prefs['extensions.e10sBlocksEnabling'] = False
- # Bug 1262954: For winXP + e10s disable acceleration
- if platform.system() in ("Windows", "Microsoft") and \
- '5.1' in platform.version() and options.e10s:
- prefs['layers.acceleration.disabled'] = True
-
# Bug 1300355: Disable canvas cache for win7 as it uses
# too much memory and causes OOMs.
if platform.system() in ("Windows", "Microsoft") and \
diff --git a/mailnews/base/search/content/searchWidgets.xml b/mailnews/base/search/content/searchWidgets.xml
index 69f3b2ae2..1f3960442 100644
--- a/mailnews/base/search/content/searchWidgets.xml
+++ b/mailnews/base/search/content/searchWidgets.xml
@@ -224,7 +224,7 @@
let identitiesRaw = MailServices.accounts
.getIdentitiesForServer(gFilterList.folder.server);
let identities = Array.from(this.fixIterator(identitiesRaw,
- Ci.nsIMsgIdentity));
+ Components.interfaces.nsIMsgIdentity));
if (identities.length == 0) { // typically if this is Local Folders
if (MailServices.accounts.defaultAccount)
diff --git a/mailnews/base/src/moz.build b/mailnews/base/src/moz.build
index 55dbab154..034d2e9bb 100644
--- a/mailnews/base/src/moz.build
+++ b/mailnews/base/src/moz.build
@@ -69,13 +69,15 @@ EXTRA_COMPONENTS += [
'folderLookupService.js',
'msgAsyncPrompter.js',
'newMailNotificationService.js',
- 'nsMailNewsCommandLineHandler.js',
]
if CONFIG['MOZ_MAILNEWS_OAUTH2']:
EXTRA_COMPONENTS += ['msgOAuth2Module.js']
-EXTRA_PP_COMPONENTS += ['msgBase.manifest']
+EXTRA_PP_COMPONENTS += [
+ 'msgBase.manifest',
+ 'nsMailNewsCommandLineHandler.js',
+]
EXTRA_JS_MODULES += [
'virtualFolderWrapper.js',
diff --git a/mailnews/base/src/nsMailNewsCommandLineHandler.js b/mailnews/base/src/nsMailNewsCommandLineHandler.js
index 3a85ec336..5dda7f7dc 100644
--- a/mailnews/base/src/nsMailNewsCommandLineHandler.js
+++ b/mailnews/base/src/nsMailNewsCommandLineHandler.js
@@ -8,7 +8,6 @@ var Cr = Components.results;
Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
var MAPI_STARTUP_ARG = "MapiStartup";
var MESSAGE_ID_PARAM = "?messageid=";
@@ -88,8 +87,8 @@ var nsMailNewsCommandLineHandler =
aCommandLine.preventDefault = true;
MailUtils.displayMessage(msgHdr);
}
- else if (AppConstants.MOZ_APP_NAME == "seamonkey" &&
- /\.(eml|msg)$/i.test(mailURL)) {
+#ifdef MOZ_SUITE
+ else if (/\.(eml|msg)$/i.test(mailURL)) {
try {
let file = aCommandLine.resolveFile(mailURL);
// No point in trying to open a file if it doesn't exist or is empty
@@ -109,6 +108,7 @@ var nsMailNewsCommandLineHandler =
catch (e) {
}
}
+#endif
else {
dump("Unrecognized URL: " + mailURL + "\n");
Services.console.logStringMessage("Unrecognized URL: " + mailURL);
diff --git a/mailnews/mailnews.mozbuild b/mailnews/mailnews.mozbuild
deleted file mode 100644
index 12ae6cd2e..000000000
--- a/mailnews/mailnews.mozbuild
+++ /dev/null
@@ -1,16 +0,0 @@
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-if CONFIG['MOZ_LDAP_XPCOM']:
- DIRS += [
- '/ldap',
- '/ldap/xpcom',
- ]
-
-if CONFIG['MOZ_MORK']:
- DIRS += ['/db']
-
-DIRS += ['/mailnews']
-
diff --git a/media/libaom/generate_sources_mozbuild.py b/media/libaom/generate_sources_mozbuild.py
index a5a75d8be..2f89c9948 100644
--- a/media/libaom/generate_sources_mozbuild.py
+++ b/media/libaom/generate_sources_mozbuild.py
@@ -9,7 +9,7 @@ import os
import re
import subprocess
-AOM_DIR = '../../third_party/aom'
+AOM_DIR = '/media/libaom/src'
def write_aom_config(system, arch, variables, cache_variables):
# read template cmake file
diff --git a/media/libaom/generate_sources_mozbuild.sh b/media/libaom/generate_sources_mozbuild.sh
index fc12b7230..d712d145d 100755
--- a/media/libaom/generate_sources_mozbuild.sh
+++ b/media/libaom/generate_sources_mozbuild.sh
@@ -15,7 +15,7 @@
export LC_ALL=C
BASE_DIR=$(pwd)
-LIBAOM_SRC_DIR="../../third_party/aom"
+LIBAOM_SRC_DIR="/media/libaom/src"
LIBAOM_CONFIG_DIR="config"
# Print license header.
diff --git a/media/libaom/moz.build b/media/libaom/moz.build
index e376878cc..f2d122d76 100644
--- a/media/libaom/moz.build
+++ b/media/libaom/moz.build
@@ -134,10 +134,10 @@ if CONFIG['CLANG_CXX'] or CONFIG['CLANG_CL']:
ASFLAGS += CONFIG['VPX_ASFLAGS']
ASFLAGS += [
'-I.',
- '-I%s/third_party/aom' % TOPSRCDIR,
+ '-I%s/media/libaom/src' % TOPSRCDIR,
]
LOCAL_INCLUDES += [
'/media/libaom/config', # aom_version.h
- '/third_party/aom',
+ '/media/libaom/src',
]
diff --git a/media/libaom/sources.mozbuild b/media/libaom/sources.mozbuild
index 9aff837c4..939637637 100644
--- a/media/libaom/sources.mozbuild
+++ b/media/libaom/sources.mozbuild
@@ -2,532 +2,532 @@
files = {
'ARM_EXPORTS': [
- '../../third_party/aom/aom/aom.h',
- '../../third_party/aom/aom/aom_codec.h',
- '../../third_party/aom/aom/aom_decoder.h',
- '../../third_party/aom/aom/aom_encoder.h',
- '../../third_party/aom/aom/aom_frame_buffer.h',
- '../../third_party/aom/aom/aom_image.h',
- '../../third_party/aom/aom/aom_integer.h',
- '../../third_party/aom/aom/aomcx.h',
- '../../third_party/aom/aom/aomdx.h',
- '../../third_party/aom/aom_mem/aom_mem.h',
- '../../third_party/aom/aom_ports/aom_timer.h',
- '../../third_party/aom/aom_ports/arm.h',
- '../../third_party/aom/aom_ports/bitops.h',
- '../../third_party/aom/aom_ports/mem.h',
- '../../third_party/aom/aom_ports/sanitizer.h',
- '../../third_party/aom/aom_ports/system_state.h',
- '../../third_party/aom/aom_scale/aom_scale.h',
- '../../third_party/aom/aom_scale/yv12config.h',
+ '/media/libaom/src/aom/aom.h',
+ '/media/libaom/src/aom/aom_codec.h',
+ '/media/libaom/src/aom/aom_decoder.h',
+ '/media/libaom/src/aom/aom_encoder.h',
+ '/media/libaom/src/aom/aom_frame_buffer.h',
+ '/media/libaom/src/aom/aom_image.h',
+ '/media/libaom/src/aom/aom_integer.h',
+ '/media/libaom/src/aom/aomcx.h',
+ '/media/libaom/src/aom/aomdx.h',
+ '/media/libaom/src/aom_mem/aom_mem.h',
+ '/media/libaom/src/aom_ports/aom_timer.h',
+ '/media/libaom/src/aom_ports/arm.h',
+ '/media/libaom/src/aom_ports/bitops.h',
+ '/media/libaom/src/aom_ports/mem.h',
+ '/media/libaom/src/aom_ports/sanitizer.h',
+ '/media/libaom/src/aom_ports/system_state.h',
+ '/media/libaom/src/aom_scale/aom_scale.h',
+ '/media/libaom/src/aom_scale/yv12config.h',
],
'ARM_SOURCES': [
- '../../third_party/aom/aom/src/aom_codec.c',
- '../../third_party/aom/aom/src/aom_decoder.c',
- '../../third_party/aom/aom/src/aom_encoder.c',
- '../../third_party/aom/aom/src/aom_image.c',
- '../../third_party/aom/aom/src/aom_integer.c',
- '../../third_party/aom/aom_dsp/aom_convolve.c',
- '../../third_party/aom/aom_dsp/aom_dsp_rtcd.c',
- '../../third_party/aom/aom_dsp/arm/blend_a64_mask_neon.c',
- '../../third_party/aom/aom_dsp/arm/fwd_txfm_neon.c',
- '../../third_party/aom/aom_dsp/arm/intrapred_neon.c',
- '../../third_party/aom/aom_dsp/arm/loopfilter_neon.c',
- '../../third_party/aom/aom_dsp/arm/subtract_neon.c',
- '../../third_party/aom/aom_dsp/binary_codes_reader.c',
- '../../third_party/aom/aom_dsp/bitreader_buffer.c',
- '../../third_party/aom/aom_dsp/bitwriter_buffer.c',
- '../../third_party/aom/aom_dsp/blend_a64_hmask.c',
- '../../third_party/aom/aom_dsp/blend_a64_mask.c',
- '../../third_party/aom/aom_dsp/blend_a64_vmask.c',
- '../../third_party/aom/aom_dsp/daalaboolreader.c',
- '../../third_party/aom/aom_dsp/entcode.c',
- '../../third_party/aom/aom_dsp/entdec.c',
- '../../third_party/aom/aom_dsp/fft.c',
- '../../third_party/aom/aom_dsp/grain_synthesis.c',
- '../../third_party/aom/aom_dsp/intrapred.c',
- '../../third_party/aom/aom_dsp/loopfilter.c',
- '../../third_party/aom/aom_dsp/subtract.c',
- '../../third_party/aom/aom_mem/aom_mem.c',
- '../../third_party/aom/aom_ports/arm_cpudetect.c',
- '../../third_party/aom/aom_scale/aom_scale_rtcd.c',
- '../../third_party/aom/aom_scale/generic/aom_scale.c',
- '../../third_party/aom/aom_scale/generic/gen_scalers.c',
- '../../third_party/aom/aom_scale/generic/yv12config.c',
- '../../third_party/aom/aom_scale/generic/yv12extend.c',
- '../../third_party/aom/aom_util/aom_thread.c',
- '../../third_party/aom/aom_util/debug_util.c',
- '../../third_party/aom/av1/av1_dx_iface.c',
- '../../third_party/aom/av1/common/alloccommon.c',
- '../../third_party/aom/av1/common/arm/av1_inv_txfm_neon.c',
- '../../third_party/aom/av1/common/arm/av1_txfm_neon.c',
- '../../third_party/aom/av1/common/arm/blend_a64_hmask_neon.c',
- '../../third_party/aom/av1/common/arm/blend_a64_vmask_neon.c',
- '../../third_party/aom/av1/common/arm/cfl_neon.c',
- '../../third_party/aom/av1/common/arm/convolve_neon.c',
- '../../third_party/aom/av1/common/arm/jnt_convolve_neon.c',
- '../../third_party/aom/av1/common/arm/reconinter_neon.c',
- '../../third_party/aom/av1/common/arm/selfguided_neon.c',
- '../../third_party/aom/av1/common/arm/warp_plane_neon.c',
- '../../third_party/aom/av1/common/arm/wiener_convolve_neon.c',
- '../../third_party/aom/av1/common/av1_inv_txfm1d.c',
- '../../third_party/aom/av1/common/av1_inv_txfm2d.c',
- '../../third_party/aom/av1/common/av1_loopfilter.c',
- '../../third_party/aom/av1/common/av1_rtcd.c',
- '../../third_party/aom/av1/common/av1_txfm.c',
- '../../third_party/aom/av1/common/blockd.c',
- '../../third_party/aom/av1/common/cdef.c',
- '../../third_party/aom/av1/common/cdef_block.c',
- '../../third_party/aom/av1/common/cdef_block_neon.c',
- '../../third_party/aom/av1/common/cfl.c',
- '../../third_party/aom/av1/common/convolve.c',
- '../../third_party/aom/av1/common/debugmodes.c',
- '../../third_party/aom/av1/common/entropy.c',
- '../../third_party/aom/av1/common/entropymode.c',
- '../../third_party/aom/av1/common/entropymv.c',
- '../../third_party/aom/av1/common/frame_buffers.c',
- '../../third_party/aom/av1/common/idct.c',
- '../../third_party/aom/av1/common/mvref_common.c',
- '../../third_party/aom/av1/common/obu_util.c',
- '../../third_party/aom/av1/common/odintrin.c',
- '../../third_party/aom/av1/common/pred_common.c',
- '../../third_party/aom/av1/common/quant_common.c',
- '../../third_party/aom/av1/common/reconinter.c',
- '../../third_party/aom/av1/common/reconintra.c',
- '../../third_party/aom/av1/common/resize.c',
- '../../third_party/aom/av1/common/restoration.c',
- '../../third_party/aom/av1/common/scale.c',
- '../../third_party/aom/av1/common/scan.c',
- '../../third_party/aom/av1/common/seg_common.c',
- '../../third_party/aom/av1/common/thread_common.c',
- '../../third_party/aom/av1/common/tile_common.c',
- '../../third_party/aom/av1/common/timing.c',
- '../../third_party/aom/av1/common/txb_common.c',
- '../../third_party/aom/av1/common/warped_motion.c',
- '../../third_party/aom/av1/decoder/decodeframe.c',
- '../../third_party/aom/av1/decoder/decodemv.c',
- '../../third_party/aom/av1/decoder/decoder.c',
- '../../third_party/aom/av1/decoder/decodetxb.c',
- '../../third_party/aom/av1/decoder/detokenize.c',
- '../../third_party/aom/av1/decoder/dthread.c',
- '../../third_party/aom/av1/decoder/obu.c',
- '../../third_party/aom/av1/encoder/arm/neon/quantize_neon.c',
+ '/media/libaom/src/aom/src/aom_codec.c',
+ '/media/libaom/src/aom/src/aom_decoder.c',
+ '/media/libaom/src/aom/src/aom_encoder.c',
+ '/media/libaom/src/aom/src/aom_image.c',
+ '/media/libaom/src/aom/src/aom_integer.c',
+ '/media/libaom/src/aom_dsp/aom_convolve.c',
+ '/media/libaom/src/aom_dsp/aom_dsp_rtcd.c',
+ '/media/libaom/src/aom_dsp/arm/blend_a64_mask_neon.c',
+ '/media/libaom/src/aom_dsp/arm/fwd_txfm_neon.c',
+ '/media/libaom/src/aom_dsp/arm/intrapred_neon.c',
+ '/media/libaom/src/aom_dsp/arm/loopfilter_neon.c',
+ '/media/libaom/src/aom_dsp/arm/subtract_neon.c',
+ '/media/libaom/src/aom_dsp/binary_codes_reader.c',
+ '/media/libaom/src/aom_dsp/bitreader_buffer.c',
+ '/media/libaom/src/aom_dsp/bitwriter_buffer.c',
+ '/media/libaom/src/aom_dsp/blend_a64_hmask.c',
+ '/media/libaom/src/aom_dsp/blend_a64_mask.c',
+ '/media/libaom/src/aom_dsp/blend_a64_vmask.c',
+ '/media/libaom/src/aom_dsp/daalaboolreader.c',
+ '/media/libaom/src/aom_dsp/entcode.c',
+ '/media/libaom/src/aom_dsp/entdec.c',
+ '/media/libaom/src/aom_dsp/fft.c',
+ '/media/libaom/src/aom_dsp/grain_synthesis.c',
+ '/media/libaom/src/aom_dsp/intrapred.c',
+ '/media/libaom/src/aom_dsp/loopfilter.c',
+ '/media/libaom/src/aom_dsp/subtract.c',
+ '/media/libaom/src/aom_mem/aom_mem.c',
+ '/media/libaom/src/aom_ports/arm_cpudetect.c',
+ '/media/libaom/src/aom_scale/aom_scale_rtcd.c',
+ '/media/libaom/src/aom_scale/generic/aom_scale.c',
+ '/media/libaom/src/aom_scale/generic/gen_scalers.c',
+ '/media/libaom/src/aom_scale/generic/yv12config.c',
+ '/media/libaom/src/aom_scale/generic/yv12extend.c',
+ '/media/libaom/src/aom_util/aom_thread.c',
+ '/media/libaom/src/aom_util/debug_util.c',
+ '/media/libaom/src/av1/av1_dx_iface.c',
+ '/media/libaom/src/av1/common/alloccommon.c',
+ '/media/libaom/src/av1/common/arm/av1_inv_txfm_neon.c',
+ '/media/libaom/src/av1/common/arm/av1_txfm_neon.c',
+ '/media/libaom/src/av1/common/arm/blend_a64_hmask_neon.c',
+ '/media/libaom/src/av1/common/arm/blend_a64_vmask_neon.c',
+ '/media/libaom/src/av1/common/arm/cfl_neon.c',
+ '/media/libaom/src/av1/common/arm/convolve_neon.c',
+ '/media/libaom/src/av1/common/arm/jnt_convolve_neon.c',
+ '/media/libaom/src/av1/common/arm/reconinter_neon.c',
+ '/media/libaom/src/av1/common/arm/selfguided_neon.c',
+ '/media/libaom/src/av1/common/arm/warp_plane_neon.c',
+ '/media/libaom/src/av1/common/arm/wiener_convolve_neon.c',
+ '/media/libaom/src/av1/common/av1_inv_txfm1d.c',
+ '/media/libaom/src/av1/common/av1_inv_txfm2d.c',
+ '/media/libaom/src/av1/common/av1_loopfilter.c',
+ '/media/libaom/src/av1/common/av1_rtcd.c',
+ '/media/libaom/src/av1/common/av1_txfm.c',
+ '/media/libaom/src/av1/common/blockd.c',
+ '/media/libaom/src/av1/common/cdef.c',
+ '/media/libaom/src/av1/common/cdef_block.c',
+ '/media/libaom/src/av1/common/cdef_block_neon.c',
+ '/media/libaom/src/av1/common/cfl.c',
+ '/media/libaom/src/av1/common/convolve.c',
+ '/media/libaom/src/av1/common/debugmodes.c',
+ '/media/libaom/src/av1/common/entropy.c',
+ '/media/libaom/src/av1/common/entropymode.c',
+ '/media/libaom/src/av1/common/entropymv.c',
+ '/media/libaom/src/av1/common/frame_buffers.c',
+ '/media/libaom/src/av1/common/idct.c',
+ '/media/libaom/src/av1/common/mvref_common.c',
+ '/media/libaom/src/av1/common/obu_util.c',
+ '/media/libaom/src/av1/common/odintrin.c',
+ '/media/libaom/src/av1/common/pred_common.c',
+ '/media/libaom/src/av1/common/quant_common.c',
+ '/media/libaom/src/av1/common/reconinter.c',
+ '/media/libaom/src/av1/common/reconintra.c',
+ '/media/libaom/src/av1/common/resize.c',
+ '/media/libaom/src/av1/common/restoration.c',
+ '/media/libaom/src/av1/common/scale.c',
+ '/media/libaom/src/av1/common/scan.c',
+ '/media/libaom/src/av1/common/seg_common.c',
+ '/media/libaom/src/av1/common/thread_common.c',
+ '/media/libaom/src/av1/common/tile_common.c',
+ '/media/libaom/src/av1/common/timing.c',
+ '/media/libaom/src/av1/common/txb_common.c',
+ '/media/libaom/src/av1/common/warped_motion.c',
+ '/media/libaom/src/av1/decoder/decodeframe.c',
+ '/media/libaom/src/av1/decoder/decodemv.c',
+ '/media/libaom/src/av1/decoder/decoder.c',
+ '/media/libaom/src/av1/decoder/decodetxb.c',
+ '/media/libaom/src/av1/decoder/detokenize.c',
+ '/media/libaom/src/av1/decoder/dthread.c',
+ '/media/libaom/src/av1/decoder/obu.c',
+ '/media/libaom/src/av1/encoder/arm/neon/quantize_neon.c',
],
'GENERIC_EXPORTS': [
- '../../third_party/aom/aom/aom.h',
- '../../third_party/aom/aom/aom_codec.h',
- '../../third_party/aom/aom/aom_decoder.h',
- '../../third_party/aom/aom/aom_encoder.h',
- '../../third_party/aom/aom/aom_frame_buffer.h',
- '../../third_party/aom/aom/aom_image.h',
- '../../third_party/aom/aom/aom_integer.h',
- '../../third_party/aom/aom/aomcx.h',
- '../../third_party/aom/aom/aomdx.h',
- '../../third_party/aom/aom_mem/aom_mem.h',
- '../../third_party/aom/aom_ports/aom_timer.h',
- '../../third_party/aom/aom_ports/bitops.h',
- '../../third_party/aom/aom_ports/mem.h',
- '../../third_party/aom/aom_ports/sanitizer.h',
- '../../third_party/aom/aom_ports/system_state.h',
- '../../third_party/aom/aom_scale/aom_scale.h',
- '../../third_party/aom/aom_scale/yv12config.h',
+ '/media/libaom/src/aom/aom.h',
+ '/media/libaom/src/aom/aom_codec.h',
+ '/media/libaom/src/aom/aom_decoder.h',
+ '/media/libaom/src/aom/aom_encoder.h',
+ '/media/libaom/src/aom/aom_frame_buffer.h',
+ '/media/libaom/src/aom/aom_image.h',
+ '/media/libaom/src/aom/aom_integer.h',
+ '/media/libaom/src/aom/aomcx.h',
+ '/media/libaom/src/aom/aomdx.h',
+ '/media/libaom/src/aom_mem/aom_mem.h',
+ '/media/libaom/src/aom_ports/aom_timer.h',
+ '/media/libaom/src/aom_ports/bitops.h',
+ '/media/libaom/src/aom_ports/mem.h',
+ '/media/libaom/src/aom_ports/sanitizer.h',
+ '/media/libaom/src/aom_ports/system_state.h',
+ '/media/libaom/src/aom_scale/aom_scale.h',
+ '/media/libaom/src/aom_scale/yv12config.h',
],
'GENERIC_SOURCES': [
- '../../third_party/aom/aom/src/aom_codec.c',
- '../../third_party/aom/aom/src/aom_decoder.c',
- '../../third_party/aom/aom/src/aom_encoder.c',
- '../../third_party/aom/aom/src/aom_image.c',
- '../../third_party/aom/aom/src/aom_integer.c',
- '../../third_party/aom/aom_dsp/aom_convolve.c',
- '../../third_party/aom/aom_dsp/aom_dsp_rtcd.c',
- '../../third_party/aom/aom_dsp/binary_codes_reader.c',
- '../../third_party/aom/aom_dsp/bitreader_buffer.c',
- '../../third_party/aom/aom_dsp/bitwriter_buffer.c',
- '../../third_party/aom/aom_dsp/blend_a64_hmask.c',
- '../../third_party/aom/aom_dsp/blend_a64_mask.c',
- '../../third_party/aom/aom_dsp/blend_a64_vmask.c',
- '../../third_party/aom/aom_dsp/daalaboolreader.c',
- '../../third_party/aom/aom_dsp/entcode.c',
- '../../third_party/aom/aom_dsp/entdec.c',
- '../../third_party/aom/aom_dsp/fft.c',
- '../../third_party/aom/aom_dsp/grain_synthesis.c',
- '../../third_party/aom/aom_dsp/intrapred.c',
- '../../third_party/aom/aom_dsp/loopfilter.c',
- '../../third_party/aom/aom_dsp/subtract.c',
- '../../third_party/aom/aom_mem/aom_mem.c',
- '../../third_party/aom/aom_scale/aom_scale_rtcd.c',
- '../../third_party/aom/aom_scale/generic/aom_scale.c',
- '../../third_party/aom/aom_scale/generic/gen_scalers.c',
- '../../third_party/aom/aom_scale/generic/yv12config.c',
- '../../third_party/aom/aom_scale/generic/yv12extend.c',
- '../../third_party/aom/aom_util/aom_thread.c',
- '../../third_party/aom/aom_util/debug_util.c',
- '../../third_party/aom/av1/av1_dx_iface.c',
- '../../third_party/aom/av1/common/alloccommon.c',
- '../../third_party/aom/av1/common/av1_inv_txfm1d.c',
- '../../third_party/aom/av1/common/av1_inv_txfm2d.c',
- '../../third_party/aom/av1/common/av1_loopfilter.c',
- '../../third_party/aom/av1/common/av1_rtcd.c',
- '../../third_party/aom/av1/common/av1_txfm.c',
- '../../third_party/aom/av1/common/blockd.c',
- '../../third_party/aom/av1/common/cdef.c',
- '../../third_party/aom/av1/common/cdef_block.c',
- '../../third_party/aom/av1/common/cfl.c',
- '../../third_party/aom/av1/common/convolve.c',
- '../../third_party/aom/av1/common/debugmodes.c',
- '../../third_party/aom/av1/common/entropy.c',
- '../../third_party/aom/av1/common/entropymode.c',
- '../../third_party/aom/av1/common/entropymv.c',
- '../../third_party/aom/av1/common/frame_buffers.c',
- '../../third_party/aom/av1/common/idct.c',
- '../../third_party/aom/av1/common/mvref_common.c',
- '../../third_party/aom/av1/common/obu_util.c',
- '../../third_party/aom/av1/common/odintrin.c',
- '../../third_party/aom/av1/common/pred_common.c',
- '../../third_party/aom/av1/common/quant_common.c',
- '../../third_party/aom/av1/common/reconinter.c',
- '../../third_party/aom/av1/common/reconintra.c',
- '../../third_party/aom/av1/common/resize.c',
- '../../third_party/aom/av1/common/restoration.c',
- '../../third_party/aom/av1/common/scale.c',
- '../../third_party/aom/av1/common/scan.c',
- '../../third_party/aom/av1/common/seg_common.c',
- '../../third_party/aom/av1/common/thread_common.c',
- '../../third_party/aom/av1/common/tile_common.c',
- '../../third_party/aom/av1/common/timing.c',
- '../../third_party/aom/av1/common/txb_common.c',
- '../../third_party/aom/av1/common/warped_motion.c',
- '../../third_party/aom/av1/decoder/decodeframe.c',
- '../../third_party/aom/av1/decoder/decodemv.c',
- '../../third_party/aom/av1/decoder/decoder.c',
- '../../third_party/aom/av1/decoder/decodetxb.c',
- '../../third_party/aom/av1/decoder/detokenize.c',
- '../../third_party/aom/av1/decoder/dthread.c',
- '../../third_party/aom/av1/decoder/obu.c',
+ '/media/libaom/src/aom/src/aom_codec.c',
+ '/media/libaom/src/aom/src/aom_decoder.c',
+ '/media/libaom/src/aom/src/aom_encoder.c',
+ '/media/libaom/src/aom/src/aom_image.c',
+ '/media/libaom/src/aom/src/aom_integer.c',
+ '/media/libaom/src/aom_dsp/aom_convolve.c',
+ '/media/libaom/src/aom_dsp/aom_dsp_rtcd.c',
+ '/media/libaom/src/aom_dsp/binary_codes_reader.c',
+ '/media/libaom/src/aom_dsp/bitreader_buffer.c',
+ '/media/libaom/src/aom_dsp/bitwriter_buffer.c',
+ '/media/libaom/src/aom_dsp/blend_a64_hmask.c',
+ '/media/libaom/src/aom_dsp/blend_a64_mask.c',
+ '/media/libaom/src/aom_dsp/blend_a64_vmask.c',
+ '/media/libaom/src/aom_dsp/daalaboolreader.c',
+ '/media/libaom/src/aom_dsp/entcode.c',
+ '/media/libaom/src/aom_dsp/entdec.c',
+ '/media/libaom/src/aom_dsp/fft.c',
+ '/media/libaom/src/aom_dsp/grain_synthesis.c',
+ '/media/libaom/src/aom_dsp/intrapred.c',
+ '/media/libaom/src/aom_dsp/loopfilter.c',
+ '/media/libaom/src/aom_dsp/subtract.c',
+ '/media/libaom/src/aom_mem/aom_mem.c',
+ '/media/libaom/src/aom_scale/aom_scale_rtcd.c',
+ '/media/libaom/src/aom_scale/generic/aom_scale.c',
+ '/media/libaom/src/aom_scale/generic/gen_scalers.c',
+ '/media/libaom/src/aom_scale/generic/yv12config.c',
+ '/media/libaom/src/aom_scale/generic/yv12extend.c',
+ '/media/libaom/src/aom_util/aom_thread.c',
+ '/media/libaom/src/aom_util/debug_util.c',
+ '/media/libaom/src/av1/av1_dx_iface.c',
+ '/media/libaom/src/av1/common/alloccommon.c',
+ '/media/libaom/src/av1/common/av1_inv_txfm1d.c',
+ '/media/libaom/src/av1/common/av1_inv_txfm2d.c',
+ '/media/libaom/src/av1/common/av1_loopfilter.c',
+ '/media/libaom/src/av1/common/av1_rtcd.c',
+ '/media/libaom/src/av1/common/av1_txfm.c',
+ '/media/libaom/src/av1/common/blockd.c',
+ '/media/libaom/src/av1/common/cdef.c',
+ '/media/libaom/src/av1/common/cdef_block.c',
+ '/media/libaom/src/av1/common/cfl.c',
+ '/media/libaom/src/av1/common/convolve.c',
+ '/media/libaom/src/av1/common/debugmodes.c',
+ '/media/libaom/src/av1/common/entropy.c',
+ '/media/libaom/src/av1/common/entropymode.c',
+ '/media/libaom/src/av1/common/entropymv.c',
+ '/media/libaom/src/av1/common/frame_buffers.c',
+ '/media/libaom/src/av1/common/idct.c',
+ '/media/libaom/src/av1/common/mvref_common.c',
+ '/media/libaom/src/av1/common/obu_util.c',
+ '/media/libaom/src/av1/common/odintrin.c',
+ '/media/libaom/src/av1/common/pred_common.c',
+ '/media/libaom/src/av1/common/quant_common.c',
+ '/media/libaom/src/av1/common/reconinter.c',
+ '/media/libaom/src/av1/common/reconintra.c',
+ '/media/libaom/src/av1/common/resize.c',
+ '/media/libaom/src/av1/common/restoration.c',
+ '/media/libaom/src/av1/common/scale.c',
+ '/media/libaom/src/av1/common/scan.c',
+ '/media/libaom/src/av1/common/seg_common.c',
+ '/media/libaom/src/av1/common/thread_common.c',
+ '/media/libaom/src/av1/common/tile_common.c',
+ '/media/libaom/src/av1/common/timing.c',
+ '/media/libaom/src/av1/common/txb_common.c',
+ '/media/libaom/src/av1/common/warped_motion.c',
+ '/media/libaom/src/av1/decoder/decodeframe.c',
+ '/media/libaom/src/av1/decoder/decodemv.c',
+ '/media/libaom/src/av1/decoder/decoder.c',
+ '/media/libaom/src/av1/decoder/decodetxb.c',
+ '/media/libaom/src/av1/decoder/detokenize.c',
+ '/media/libaom/src/av1/decoder/dthread.c',
+ '/media/libaom/src/av1/decoder/obu.c',
],
'IA32_EXPORTS': [
- '../../third_party/aom/aom/aom.h',
- '../../third_party/aom/aom/aom_codec.h',
- '../../third_party/aom/aom/aom_decoder.h',
- '../../third_party/aom/aom/aom_encoder.h',
- '../../third_party/aom/aom/aom_frame_buffer.h',
- '../../third_party/aom/aom/aom_image.h',
- '../../third_party/aom/aom/aom_integer.h',
- '../../third_party/aom/aom/aomcx.h',
- '../../third_party/aom/aom/aomdx.h',
- '../../third_party/aom/aom_mem/aom_mem.h',
- '../../third_party/aom/aom_ports/aom_timer.h',
- '../../third_party/aom/aom_ports/bitops.h',
- '../../third_party/aom/aom_ports/mem.h',
- '../../third_party/aom/aom_ports/sanitizer.h',
- '../../third_party/aom/aom_ports/system_state.h',
- '../../third_party/aom/aom_scale/aom_scale.h',
- '../../third_party/aom/aom_scale/yv12config.h',
+ '/media/libaom/src/aom/aom.h',
+ '/media/libaom/src/aom/aom_codec.h',
+ '/media/libaom/src/aom/aom_decoder.h',
+ '/media/libaom/src/aom/aom_encoder.h',
+ '/media/libaom/src/aom/aom_frame_buffer.h',
+ '/media/libaom/src/aom/aom_image.h',
+ '/media/libaom/src/aom/aom_integer.h',
+ '/media/libaom/src/aom/aomcx.h',
+ '/media/libaom/src/aom/aomdx.h',
+ '/media/libaom/src/aom_mem/aom_mem.h',
+ '/media/libaom/src/aom_ports/aom_timer.h',
+ '/media/libaom/src/aom_ports/bitops.h',
+ '/media/libaom/src/aom_ports/mem.h',
+ '/media/libaom/src/aom_ports/sanitizer.h',
+ '/media/libaom/src/aom_ports/system_state.h',
+ '/media/libaom/src/aom_scale/aom_scale.h',
+ '/media/libaom/src/aom_scale/yv12config.h',
],
'IA32_SOURCES': [
- '../../third_party/aom/aom/src/aom_codec.c',
- '../../third_party/aom/aom/src/aom_decoder.c',
- '../../third_party/aom/aom/src/aom_encoder.c',
- '../../third_party/aom/aom/src/aom_image.c',
- '../../third_party/aom/aom/src/aom_integer.c',
- '../../third_party/aom/aom_dsp/aom_convolve.c',
- '../../third_party/aom/aom_dsp/aom_dsp_rtcd.c',
- '../../third_party/aom/aom_dsp/binary_codes_reader.c',
- '../../third_party/aom/aom_dsp/bitreader_buffer.c',
- '../../third_party/aom/aom_dsp/bitwriter_buffer.c',
- '../../third_party/aom/aom_dsp/blend_a64_hmask.c',
- '../../third_party/aom/aom_dsp/blend_a64_mask.c',
- '../../third_party/aom/aom_dsp/blend_a64_vmask.c',
- '../../third_party/aom/aom_dsp/daalaboolreader.c',
- '../../third_party/aom/aom_dsp/entcode.c',
- '../../third_party/aom/aom_dsp/entdec.c',
- '../../third_party/aom/aom_dsp/fft.c',
- '../../third_party/aom/aom_dsp/grain_synthesis.c',
- '../../third_party/aom/aom_dsp/intrapred.c',
- '../../third_party/aom/aom_dsp/loopfilter.c',
- '../../third_party/aom/aom_dsp/subtract.c',
- '../../third_party/aom/aom_dsp/x86/aom_asm_stubs.c',
- '../../third_party/aom/aom_dsp/x86/aom_convolve_copy_sse2.asm',
- '../../third_party/aom/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm',
- '../../third_party/aom/aom_dsp/x86/aom_high_subpixel_bilinear_sse2.asm',
- '../../third_party/aom/aom_dsp/x86/aom_subpixel_8t_intrin_avx2.c',
- '../../third_party/aom/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c',
- '../../third_party/aom/aom_dsp/x86/aom_subpixel_8t_sse2.asm',
- '../../third_party/aom/aom_dsp/x86/aom_subpixel_8t_ssse3.asm',
- '../../third_party/aom/aom_dsp/x86/aom_subpixel_bilinear_sse2.asm',
- '../../third_party/aom/aom_dsp/x86/aom_subpixel_bilinear_ssse3.asm',
- '../../third_party/aom/aom_dsp/x86/blend_a64_hmask_sse4.c',
- '../../third_party/aom/aom_dsp/x86/blend_a64_mask_avx2.c',
- '../../third_party/aom/aom_dsp/x86/blend_a64_mask_sse4.c',
- '../../third_party/aom/aom_dsp/x86/blend_a64_vmask_sse4.c',
- '../../third_party/aom/aom_dsp/x86/fft_avx2.c',
- '../../third_party/aom/aom_dsp/x86/fft_sse2.c',
- '../../third_party/aom/aom_dsp/x86/highbd_convolve_avx2.c',
- '../../third_party/aom/aom_dsp/x86/highbd_convolve_ssse3.c',
- '../../third_party/aom/aom_dsp/x86/highbd_intrapred_sse2.c',
- '../../third_party/aom/aom_dsp/x86/highbd_intrapred_sse2_asm.asm',
- '../../third_party/aom/aom_dsp/x86/highbd_loopfilter_avx2.c',
- '../../third_party/aom/aom_dsp/x86/highbd_loopfilter_sse2.c',
- '../../third_party/aom/aom_dsp/x86/intrapred_avx2.c',
- '../../third_party/aom/aom_dsp/x86/intrapred_sse2.c',
- '../../third_party/aom/aom_dsp/x86/intrapred_sse2_asm.asm',
- '../../third_party/aom/aom_dsp/x86/intrapred_ssse3.c',
- '../../third_party/aom/aom_dsp/x86/inv_wht_sse2.asm',
- '../../third_party/aom/aom_dsp/x86/loopfilter_sse2.c',
- '../../third_party/aom/aom_mem/aom_mem.c',
- '../../third_party/aom/aom_ports/emms.asm',
- '../../third_party/aom/aom_ports/x86_abi_support.asm',
- '../../third_party/aom/aom_scale/aom_scale_rtcd.c',
- '../../third_party/aom/aom_scale/generic/aom_scale.c',
- '../../third_party/aom/aom_scale/generic/gen_scalers.c',
- '../../third_party/aom/aom_scale/generic/yv12config.c',
- '../../third_party/aom/aom_scale/generic/yv12extend.c',
- '../../third_party/aom/aom_util/aom_thread.c',
- '../../third_party/aom/aom_util/debug_util.c',
- '../../third_party/aom/av1/av1_dx_iface.c',
- '../../third_party/aom/av1/common/alloccommon.c',
- '../../third_party/aom/av1/common/av1_inv_txfm1d.c',
- '../../third_party/aom/av1/common/av1_inv_txfm2d.c',
- '../../third_party/aom/av1/common/av1_loopfilter.c',
- '../../third_party/aom/av1/common/av1_rtcd.c',
- '../../third_party/aom/av1/common/av1_txfm.c',
- '../../third_party/aom/av1/common/blockd.c',
- '../../third_party/aom/av1/common/cdef.c',
- '../../third_party/aom/av1/common/cdef_block.c',
- '../../third_party/aom/av1/common/cdef_block_avx2.c',
- '../../third_party/aom/av1/common/cdef_block_sse2.c',
- '../../third_party/aom/av1/common/cdef_block_sse4.c',
- '../../third_party/aom/av1/common/cdef_block_ssse3.c',
- '../../third_party/aom/av1/common/cfl.c',
- '../../third_party/aom/av1/common/convolve.c',
- '../../third_party/aom/av1/common/debugmodes.c',
- '../../third_party/aom/av1/common/entropy.c',
- '../../third_party/aom/av1/common/entropymode.c',
- '../../third_party/aom/av1/common/entropymv.c',
- '../../third_party/aom/av1/common/frame_buffers.c',
- '../../third_party/aom/av1/common/idct.c',
- '../../third_party/aom/av1/common/mvref_common.c',
- '../../third_party/aom/av1/common/obu_util.c',
- '../../third_party/aom/av1/common/odintrin.c',
- '../../third_party/aom/av1/common/pred_common.c',
- '../../third_party/aom/av1/common/quant_common.c',
- '../../third_party/aom/av1/common/reconinter.c',
- '../../third_party/aom/av1/common/reconintra.c',
- '../../third_party/aom/av1/common/resize.c',
- '../../third_party/aom/av1/common/restoration.c',
- '../../third_party/aom/av1/common/scale.c',
- '../../third_party/aom/av1/common/scan.c',
- '../../third_party/aom/av1/common/seg_common.c',
- '../../third_party/aom/av1/common/thread_common.c',
- '../../third_party/aom/av1/common/tile_common.c',
- '../../third_party/aom/av1/common/timing.c',
- '../../third_party/aom/av1/common/txb_common.c',
- '../../third_party/aom/av1/common/warped_motion.c',
- '../../third_party/aom/av1/common/x86/av1_convolve_horiz_rs_sse4.c',
- '../../third_party/aom/av1/common/x86/av1_convolve_scale_sse4.c',
- '../../third_party/aom/av1/common/x86/av1_highbd_convolve_sse4.c',
- '../../third_party/aom/av1/common/x86/av1_inv_txfm_avx2.c',
- '../../third_party/aom/av1/common/x86/av1_inv_txfm_ssse3.c',
- '../../third_party/aom/av1/common/x86/av1_txfm_sse4.c',
- '../../third_party/aom/av1/common/x86/cfl_avx2.c',
- '../../third_party/aom/av1/common/x86/cfl_sse2.c',
- '../../third_party/aom/av1/common/x86/cfl_ssse3.c',
- '../../third_party/aom/av1/common/x86/convolve_2d_avx2.c',
- '../../third_party/aom/av1/common/x86/convolve_2d_sse2.c',
- '../../third_party/aom/av1/common/x86/convolve_avx2.c',
- '../../third_party/aom/av1/common/x86/convolve_sse2.c',
- '../../third_party/aom/av1/common/x86/filterintra_sse4.c',
- '../../third_party/aom/av1/common/x86/highbd_convolve_2d_avx2.c',
- '../../third_party/aom/av1/common/x86/highbd_convolve_2d_sse2.c',
- '../../third_party/aom/av1/common/x86/highbd_convolve_2d_sse4.c',
- '../../third_party/aom/av1/common/x86/highbd_convolve_2d_ssse3.c',
- '../../third_party/aom/av1/common/x86/highbd_inv_txfm_avx2.c',
- '../../third_party/aom/av1/common/x86/highbd_inv_txfm_sse4.c',
- '../../third_party/aom/av1/common/x86/highbd_jnt_convolve_avx2.c',
- '../../third_party/aom/av1/common/x86/highbd_jnt_convolve_sse4.c',
- '../../third_party/aom/av1/common/x86/highbd_warp_plane_sse4.c',
- '../../third_party/aom/av1/common/x86/highbd_wiener_convolve_avx2.c',
- '../../third_party/aom/av1/common/x86/highbd_wiener_convolve_ssse3.c',
- '../../third_party/aom/av1/common/x86/intra_edge_sse4.c',
- '../../third_party/aom/av1/common/x86/jnt_convolve_avx2.c',
- '../../third_party/aom/av1/common/x86/jnt_convolve_sse2.c',
- '../../third_party/aom/av1/common/x86/jnt_convolve_ssse3.c',
- '../../third_party/aom/av1/common/x86/reconinter_avx2.c',
- '../../third_party/aom/av1/common/x86/reconinter_sse4.c',
- '../../third_party/aom/av1/common/x86/reconinter_ssse3.c',
- '../../third_party/aom/av1/common/x86/selfguided_avx2.c',
- '../../third_party/aom/av1/common/x86/selfguided_sse4.c',
- '../../third_party/aom/av1/common/x86/warp_plane_sse4.c',
- '../../third_party/aom/av1/common/x86/wiener_convolve_avx2.c',
- '../../third_party/aom/av1/common/x86/wiener_convolve_sse2.c',
- '../../third_party/aom/av1/decoder/decodeframe.c',
- '../../third_party/aom/av1/decoder/decodemv.c',
- '../../third_party/aom/av1/decoder/decoder.c',
- '../../third_party/aom/av1/decoder/decodetxb.c',
- '../../third_party/aom/av1/decoder/detokenize.c',
- '../../third_party/aom/av1/decoder/dthread.c',
- '../../third_party/aom/av1/decoder/obu.c',
+ '/media/libaom/src/aom/src/aom_codec.c',
+ '/media/libaom/src/aom/src/aom_decoder.c',
+ '/media/libaom/src/aom/src/aom_encoder.c',
+ '/media/libaom/src/aom/src/aom_image.c',
+ '/media/libaom/src/aom/src/aom_integer.c',
+ '/media/libaom/src/aom_dsp/aom_convolve.c',
+ '/media/libaom/src/aom_dsp/aom_dsp_rtcd.c',
+ '/media/libaom/src/aom_dsp/binary_codes_reader.c',
+ '/media/libaom/src/aom_dsp/bitreader_buffer.c',
+ '/media/libaom/src/aom_dsp/bitwriter_buffer.c',
+ '/media/libaom/src/aom_dsp/blend_a64_hmask.c',
+ '/media/libaom/src/aom_dsp/blend_a64_mask.c',
+ '/media/libaom/src/aom_dsp/blend_a64_vmask.c',
+ '/media/libaom/src/aom_dsp/daalaboolreader.c',
+ '/media/libaom/src/aom_dsp/entcode.c',
+ '/media/libaom/src/aom_dsp/entdec.c',
+ '/media/libaom/src/aom_dsp/fft.c',
+ '/media/libaom/src/aom_dsp/grain_synthesis.c',
+ '/media/libaom/src/aom_dsp/intrapred.c',
+ '/media/libaom/src/aom_dsp/loopfilter.c',
+ '/media/libaom/src/aom_dsp/subtract.c',
+ '/media/libaom/src/aom_dsp/x86/aom_asm_stubs.c',
+ '/media/libaom/src/aom_dsp/x86/aom_convolve_copy_sse2.asm',
+ '/media/libaom/src/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm',
+ '/media/libaom/src/aom_dsp/x86/aom_high_subpixel_bilinear_sse2.asm',
+ '/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_intrin_avx2.c',
+ '/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c',
+ '/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_sse2.asm',
+ '/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_ssse3.asm',
+ '/media/libaom/src/aom_dsp/x86/aom_subpixel_bilinear_sse2.asm',
+ '/media/libaom/src/aom_dsp/x86/aom_subpixel_bilinear_ssse3.asm',
+ '/media/libaom/src/aom_dsp/x86/blend_a64_hmask_sse4.c',
+ '/media/libaom/src/aom_dsp/x86/blend_a64_mask_avx2.c',
+ '/media/libaom/src/aom_dsp/x86/blend_a64_mask_sse4.c',
+ '/media/libaom/src/aom_dsp/x86/blend_a64_vmask_sse4.c',
+ '/media/libaom/src/aom_dsp/x86/fft_avx2.c',
+ '/media/libaom/src/aom_dsp/x86/fft_sse2.c',
+ '/media/libaom/src/aom_dsp/x86/highbd_convolve_avx2.c',
+ '/media/libaom/src/aom_dsp/x86/highbd_convolve_ssse3.c',
+ '/media/libaom/src/aom_dsp/x86/highbd_intrapred_sse2.c',
+ '/media/libaom/src/aom_dsp/x86/highbd_intrapred_sse2_asm.asm',
+ '/media/libaom/src/aom_dsp/x86/highbd_loopfilter_avx2.c',
+ '/media/libaom/src/aom_dsp/x86/highbd_loopfilter_sse2.c',
+ '/media/libaom/src/aom_dsp/x86/intrapred_avx2.c',
+ '/media/libaom/src/aom_dsp/x86/intrapred_sse2.c',
+ '/media/libaom/src/aom_dsp/x86/intrapred_sse2_asm.asm',
+ '/media/libaom/src/aom_dsp/x86/intrapred_ssse3.c',
+ '/media/libaom/src/aom_dsp/x86/inv_wht_sse2.asm',
+ '/media/libaom/src/aom_dsp/x86/loopfilter_sse2.c',
+ '/media/libaom/src/aom_mem/aom_mem.c',
+ '/media/libaom/src/aom_ports/emms.asm',
+ '/media/libaom/src/aom_ports/x86_abi_support.asm',
+ '/media/libaom/src/aom_scale/aom_scale_rtcd.c',
+ '/media/libaom/src/aom_scale/generic/aom_scale.c',
+ '/media/libaom/src/aom_scale/generic/gen_scalers.c',
+ '/media/libaom/src/aom_scale/generic/yv12config.c',
+ '/media/libaom/src/aom_scale/generic/yv12extend.c',
+ '/media/libaom/src/aom_util/aom_thread.c',
+ '/media/libaom/src/aom_util/debug_util.c',
+ '/media/libaom/src/av1/av1_dx_iface.c',
+ '/media/libaom/src/av1/common/alloccommon.c',
+ '/media/libaom/src/av1/common/av1_inv_txfm1d.c',
+ '/media/libaom/src/av1/common/av1_inv_txfm2d.c',
+ '/media/libaom/src/av1/common/av1_loopfilter.c',
+ '/media/libaom/src/av1/common/av1_rtcd.c',
+ '/media/libaom/src/av1/common/av1_txfm.c',
+ '/media/libaom/src/av1/common/blockd.c',
+ '/media/libaom/src/av1/common/cdef.c',
+ '/media/libaom/src/av1/common/cdef_block.c',
+ '/media/libaom/src/av1/common/cdef_block_avx2.c',
+ '/media/libaom/src/av1/common/cdef_block_sse2.c',
+ '/media/libaom/src/av1/common/cdef_block_sse4.c',
+ '/media/libaom/src/av1/common/cdef_block_ssse3.c',
+ '/media/libaom/src/av1/common/cfl.c',
+ '/media/libaom/src/av1/common/convolve.c',
+ '/media/libaom/src/av1/common/debugmodes.c',
+ '/media/libaom/src/av1/common/entropy.c',
+ '/media/libaom/src/av1/common/entropymode.c',
+ '/media/libaom/src/av1/common/entropymv.c',
+ '/media/libaom/src/av1/common/frame_buffers.c',
+ '/media/libaom/src/av1/common/idct.c',
+ '/media/libaom/src/av1/common/mvref_common.c',
+ '/media/libaom/src/av1/common/obu_util.c',
+ '/media/libaom/src/av1/common/odintrin.c',
+ '/media/libaom/src/av1/common/pred_common.c',
+ '/media/libaom/src/av1/common/quant_common.c',
+ '/media/libaom/src/av1/common/reconinter.c',
+ '/media/libaom/src/av1/common/reconintra.c',
+ '/media/libaom/src/av1/common/resize.c',
+ '/media/libaom/src/av1/common/restoration.c',
+ '/media/libaom/src/av1/common/scale.c',
+ '/media/libaom/src/av1/common/scan.c',
+ '/media/libaom/src/av1/common/seg_common.c',
+ '/media/libaom/src/av1/common/thread_common.c',
+ '/media/libaom/src/av1/common/tile_common.c',
+ '/media/libaom/src/av1/common/timing.c',
+ '/media/libaom/src/av1/common/txb_common.c',
+ '/media/libaom/src/av1/common/warped_motion.c',
+ '/media/libaom/src/av1/common/x86/av1_convolve_horiz_rs_sse4.c',
+ '/media/libaom/src/av1/common/x86/av1_convolve_scale_sse4.c',
+ '/media/libaom/src/av1/common/x86/av1_highbd_convolve_sse4.c',
+ '/media/libaom/src/av1/common/x86/av1_inv_txfm_avx2.c',
+ '/media/libaom/src/av1/common/x86/av1_inv_txfm_ssse3.c',
+ '/media/libaom/src/av1/common/x86/av1_txfm_sse4.c',
+ '/media/libaom/src/av1/common/x86/cfl_avx2.c',
+ '/media/libaom/src/av1/common/x86/cfl_sse2.c',
+ '/media/libaom/src/av1/common/x86/cfl_ssse3.c',
+ '/media/libaom/src/av1/common/x86/convolve_2d_avx2.c',
+ '/media/libaom/src/av1/common/x86/convolve_2d_sse2.c',
+ '/media/libaom/src/av1/common/x86/convolve_avx2.c',
+ '/media/libaom/src/av1/common/x86/convolve_sse2.c',
+ '/media/libaom/src/av1/common/x86/filterintra_sse4.c',
+ '/media/libaom/src/av1/common/x86/highbd_convolve_2d_avx2.c',
+ '/media/libaom/src/av1/common/x86/highbd_convolve_2d_sse2.c',
+ '/media/libaom/src/av1/common/x86/highbd_convolve_2d_sse4.c',
+ '/media/libaom/src/av1/common/x86/highbd_convolve_2d_ssse3.c',
+ '/media/libaom/src/av1/common/x86/highbd_inv_txfm_avx2.c',
+ '/media/libaom/src/av1/common/x86/highbd_inv_txfm_sse4.c',
+ '/media/libaom/src/av1/common/x86/highbd_jnt_convolve_avx2.c',
+ '/media/libaom/src/av1/common/x86/highbd_jnt_convolve_sse4.c',
+ '/media/libaom/src/av1/common/x86/highbd_warp_plane_sse4.c',
+ '/media/libaom/src/av1/common/x86/highbd_wiener_convolve_avx2.c',
+ '/media/libaom/src/av1/common/x86/highbd_wiener_convolve_ssse3.c',
+ '/media/libaom/src/av1/common/x86/intra_edge_sse4.c',
+ '/media/libaom/src/av1/common/x86/jnt_convolve_avx2.c',
+ '/media/libaom/src/av1/common/x86/jnt_convolve_sse2.c',
+ '/media/libaom/src/av1/common/x86/jnt_convolve_ssse3.c',
+ '/media/libaom/src/av1/common/x86/reconinter_avx2.c',
+ '/media/libaom/src/av1/common/x86/reconinter_sse4.c',
+ '/media/libaom/src/av1/common/x86/reconinter_ssse3.c',
+ '/media/libaom/src/av1/common/x86/selfguided_avx2.c',
+ '/media/libaom/src/av1/common/x86/selfguided_sse4.c',
+ '/media/libaom/src/av1/common/x86/warp_plane_sse4.c',
+ '/media/libaom/src/av1/common/x86/wiener_convolve_avx2.c',
+ '/media/libaom/src/av1/common/x86/wiener_convolve_sse2.c',
+ '/media/libaom/src/av1/decoder/decodeframe.c',
+ '/media/libaom/src/av1/decoder/decodemv.c',
+ '/media/libaom/src/av1/decoder/decoder.c',
+ '/media/libaom/src/av1/decoder/decodetxb.c',
+ '/media/libaom/src/av1/decoder/detokenize.c',
+ '/media/libaom/src/av1/decoder/dthread.c',
+ '/media/libaom/src/av1/decoder/obu.c',
],
'X64_EXPORTS': [
- '../../third_party/aom/aom/aom.h',
- '../../third_party/aom/aom/aom_codec.h',
- '../../third_party/aom/aom/aom_decoder.h',
- '../../third_party/aom/aom/aom_encoder.h',
- '../../third_party/aom/aom/aom_frame_buffer.h',
- '../../third_party/aom/aom/aom_image.h',
- '../../third_party/aom/aom/aom_integer.h',
- '../../third_party/aom/aom/aomcx.h',
- '../../third_party/aom/aom/aomdx.h',
- '../../third_party/aom/aom_mem/aom_mem.h',
- '../../third_party/aom/aom_ports/aom_timer.h',
- '../../third_party/aom/aom_ports/bitops.h',
- '../../third_party/aom/aom_ports/mem.h',
- '../../third_party/aom/aom_ports/sanitizer.h',
- '../../third_party/aom/aom_ports/system_state.h',
- '../../third_party/aom/aom_scale/aom_scale.h',
- '../../third_party/aom/aom_scale/yv12config.h',
+ '/media/libaom/src/aom/aom.h',
+ '/media/libaom/src/aom/aom_codec.h',
+ '/media/libaom/src/aom/aom_decoder.h',
+ '/media/libaom/src/aom/aom_encoder.h',
+ '/media/libaom/src/aom/aom_frame_buffer.h',
+ '/media/libaom/src/aom/aom_image.h',
+ '/media/libaom/src/aom/aom_integer.h',
+ '/media/libaom/src/aom/aomcx.h',
+ '/media/libaom/src/aom/aomdx.h',
+ '/media/libaom/src/aom_mem/aom_mem.h',
+ '/media/libaom/src/aom_ports/aom_timer.h',
+ '/media/libaom/src/aom_ports/bitops.h',
+ '/media/libaom/src/aom_ports/mem.h',
+ '/media/libaom/src/aom_ports/sanitizer.h',
+ '/media/libaom/src/aom_ports/system_state.h',
+ '/media/libaom/src/aom_scale/aom_scale.h',
+ '/media/libaom/src/aom_scale/yv12config.h',
],
'X64_SOURCES': [
- '../../third_party/aom/aom/src/aom_codec.c',
- '../../third_party/aom/aom/src/aom_decoder.c',
- '../../third_party/aom/aom/src/aom_encoder.c',
- '../../third_party/aom/aom/src/aom_image.c',
- '../../third_party/aom/aom/src/aom_integer.c',
- '../../third_party/aom/aom_dsp/aom_convolve.c',
- '../../third_party/aom/aom_dsp/aom_dsp_rtcd.c',
- '../../third_party/aom/aom_dsp/binary_codes_reader.c',
- '../../third_party/aom/aom_dsp/bitreader_buffer.c',
- '../../third_party/aom/aom_dsp/bitwriter_buffer.c',
- '../../third_party/aom/aom_dsp/blend_a64_hmask.c',
- '../../third_party/aom/aom_dsp/blend_a64_mask.c',
- '../../third_party/aom/aom_dsp/blend_a64_vmask.c',
- '../../third_party/aom/aom_dsp/daalaboolreader.c',
- '../../third_party/aom/aom_dsp/entcode.c',
- '../../third_party/aom/aom_dsp/entdec.c',
- '../../third_party/aom/aom_dsp/fft.c',
- '../../third_party/aom/aom_dsp/grain_synthesis.c',
- '../../third_party/aom/aom_dsp/intrapred.c',
- '../../third_party/aom/aom_dsp/loopfilter.c',
- '../../third_party/aom/aom_dsp/subtract.c',
- '../../third_party/aom/aom_dsp/x86/aom_asm_stubs.c',
- '../../third_party/aom/aom_dsp/x86/aom_convolve_copy_sse2.asm',
- '../../third_party/aom/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm',
- '../../third_party/aom/aom_dsp/x86/aom_high_subpixel_bilinear_sse2.asm',
- '../../third_party/aom/aom_dsp/x86/aom_subpixel_8t_intrin_avx2.c',
- '../../third_party/aom/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c',
- '../../third_party/aom/aom_dsp/x86/aom_subpixel_8t_sse2.asm',
- '../../third_party/aom/aom_dsp/x86/aom_subpixel_8t_ssse3.asm',
- '../../third_party/aom/aom_dsp/x86/aom_subpixel_bilinear_sse2.asm',
- '../../third_party/aom/aom_dsp/x86/aom_subpixel_bilinear_ssse3.asm',
- '../../third_party/aom/aom_dsp/x86/blend_a64_hmask_sse4.c',
- '../../third_party/aom/aom_dsp/x86/blend_a64_mask_avx2.c',
- '../../third_party/aom/aom_dsp/x86/blend_a64_mask_sse4.c',
- '../../third_party/aom/aom_dsp/x86/blend_a64_vmask_sse4.c',
- '../../third_party/aom/aom_dsp/x86/fft_avx2.c',
- '../../third_party/aom/aom_dsp/x86/fft_sse2.c',
- '../../third_party/aom/aom_dsp/x86/highbd_convolve_avx2.c',
- '../../third_party/aom/aom_dsp/x86/highbd_convolve_ssse3.c',
- '../../third_party/aom/aom_dsp/x86/highbd_intrapred_sse2.c',
- '../../third_party/aom/aom_dsp/x86/highbd_intrapred_sse2_asm.asm',
- '../../third_party/aom/aom_dsp/x86/highbd_loopfilter_avx2.c',
- '../../third_party/aom/aom_dsp/x86/highbd_loopfilter_sse2.c',
- '../../third_party/aom/aom_dsp/x86/intrapred_avx2.c',
- '../../third_party/aom/aom_dsp/x86/intrapred_sse2.c',
- '../../third_party/aom/aom_dsp/x86/intrapred_sse2_asm.asm',
- '../../third_party/aom/aom_dsp/x86/intrapred_ssse3.c',
- '../../third_party/aom/aom_dsp/x86/inv_wht_sse2.asm',
- '../../third_party/aom/aom_dsp/x86/loopfilter_sse2.c',
- '../../third_party/aom/aom_mem/aom_mem.c',
- '../../third_party/aom/aom_ports/emms.asm',
- '../../third_party/aom/aom_scale/aom_scale_rtcd.c',
- '../../third_party/aom/aom_scale/generic/aom_scale.c',
- '../../third_party/aom/aom_scale/generic/gen_scalers.c',
- '../../third_party/aom/aom_scale/generic/yv12config.c',
- '../../third_party/aom/aom_scale/generic/yv12extend.c',
- '../../third_party/aom/aom_util/aom_thread.c',
- '../../third_party/aom/aom_util/debug_util.c',
- '../../third_party/aom/av1/av1_dx_iface.c',
- '../../third_party/aom/av1/common/alloccommon.c',
- '../../third_party/aom/av1/common/av1_inv_txfm1d.c',
- '../../third_party/aom/av1/common/av1_inv_txfm2d.c',
- '../../third_party/aom/av1/common/av1_loopfilter.c',
- '../../third_party/aom/av1/common/av1_rtcd.c',
- '../../third_party/aom/av1/common/av1_txfm.c',
- '../../third_party/aom/av1/common/blockd.c',
- '../../third_party/aom/av1/common/cdef.c',
- '../../third_party/aom/av1/common/cdef_block.c',
- '../../third_party/aom/av1/common/cdef_block_avx2.c',
- '../../third_party/aom/av1/common/cdef_block_sse2.c',
- '../../third_party/aom/av1/common/cdef_block_sse4.c',
- '../../third_party/aom/av1/common/cdef_block_ssse3.c',
- '../../third_party/aom/av1/common/cfl.c',
- '../../third_party/aom/av1/common/convolve.c',
- '../../third_party/aom/av1/common/debugmodes.c',
- '../../third_party/aom/av1/common/entropy.c',
- '../../third_party/aom/av1/common/entropymode.c',
- '../../third_party/aom/av1/common/entropymv.c',
- '../../third_party/aom/av1/common/frame_buffers.c',
- '../../third_party/aom/av1/common/idct.c',
- '../../third_party/aom/av1/common/mvref_common.c',
- '../../third_party/aom/av1/common/obu_util.c',
- '../../third_party/aom/av1/common/odintrin.c',
- '../../third_party/aom/av1/common/pred_common.c',
- '../../third_party/aom/av1/common/quant_common.c',
- '../../third_party/aom/av1/common/reconinter.c',
- '../../third_party/aom/av1/common/reconintra.c',
- '../../third_party/aom/av1/common/resize.c',
- '../../third_party/aom/av1/common/restoration.c',
- '../../third_party/aom/av1/common/scale.c',
- '../../third_party/aom/av1/common/scan.c',
- '../../third_party/aom/av1/common/seg_common.c',
- '../../third_party/aom/av1/common/thread_common.c',
- '../../third_party/aom/av1/common/tile_common.c',
- '../../third_party/aom/av1/common/timing.c',
- '../../third_party/aom/av1/common/txb_common.c',
- '../../third_party/aom/av1/common/warped_motion.c',
- '../../third_party/aom/av1/common/x86/av1_convolve_horiz_rs_sse4.c',
- '../../third_party/aom/av1/common/x86/av1_convolve_scale_sse4.c',
- '../../third_party/aom/av1/common/x86/av1_highbd_convolve_sse4.c',
- '../../third_party/aom/av1/common/x86/av1_inv_txfm_avx2.c',
- '../../third_party/aom/av1/common/x86/av1_inv_txfm_ssse3.c',
- '../../third_party/aom/av1/common/x86/av1_txfm_sse4.c',
- '../../third_party/aom/av1/common/x86/cfl_avx2.c',
- '../../third_party/aom/av1/common/x86/cfl_sse2.c',
- '../../third_party/aom/av1/common/x86/cfl_ssse3.c',
- '../../third_party/aom/av1/common/x86/convolve_2d_avx2.c',
- '../../third_party/aom/av1/common/x86/convolve_2d_sse2.c',
- '../../third_party/aom/av1/common/x86/convolve_avx2.c',
- '../../third_party/aom/av1/common/x86/convolve_sse2.c',
- '../../third_party/aom/av1/common/x86/filterintra_sse4.c',
- '../../third_party/aom/av1/common/x86/highbd_convolve_2d_avx2.c',
- '../../third_party/aom/av1/common/x86/highbd_convolve_2d_sse2.c',
- '../../third_party/aom/av1/common/x86/highbd_convolve_2d_sse4.c',
- '../../third_party/aom/av1/common/x86/highbd_convolve_2d_ssse3.c',
- '../../third_party/aom/av1/common/x86/highbd_inv_txfm_avx2.c',
- '../../third_party/aom/av1/common/x86/highbd_inv_txfm_sse4.c',
- '../../third_party/aom/av1/common/x86/highbd_jnt_convolve_avx2.c',
- '../../third_party/aom/av1/common/x86/highbd_jnt_convolve_sse4.c',
- '../../third_party/aom/av1/common/x86/highbd_warp_plane_sse4.c',
- '../../third_party/aom/av1/common/x86/highbd_wiener_convolve_avx2.c',
- '../../third_party/aom/av1/common/x86/highbd_wiener_convolve_ssse3.c',
- '../../third_party/aom/av1/common/x86/intra_edge_sse4.c',
- '../../third_party/aom/av1/common/x86/jnt_convolve_avx2.c',
- '../../third_party/aom/av1/common/x86/jnt_convolve_sse2.c',
- '../../third_party/aom/av1/common/x86/jnt_convolve_ssse3.c',
- '../../third_party/aom/av1/common/x86/reconinter_avx2.c',
- '../../third_party/aom/av1/common/x86/reconinter_sse4.c',
- '../../third_party/aom/av1/common/x86/reconinter_ssse3.c',
- '../../third_party/aom/av1/common/x86/selfguided_avx2.c',
- '../../third_party/aom/av1/common/x86/selfguided_sse4.c',
- '../../third_party/aom/av1/common/x86/warp_plane_sse4.c',
- '../../third_party/aom/av1/common/x86/wiener_convolve_avx2.c',
- '../../third_party/aom/av1/common/x86/wiener_convolve_sse2.c',
- '../../third_party/aom/av1/decoder/decodeframe.c',
- '../../third_party/aom/av1/decoder/decodemv.c',
- '../../third_party/aom/av1/decoder/decoder.c',
- '../../third_party/aom/av1/decoder/decodetxb.c',
- '../../third_party/aom/av1/decoder/detokenize.c',
- '../../third_party/aom/av1/decoder/dthread.c',
- '../../third_party/aom/av1/decoder/obu.c',
+ '/media/libaom/src/aom/src/aom_codec.c',
+ '/media/libaom/src/aom/src/aom_decoder.c',
+ '/media/libaom/src/aom/src/aom_encoder.c',
+ '/media/libaom/src/aom/src/aom_image.c',
+ '/media/libaom/src/aom/src/aom_integer.c',
+ '/media/libaom/src/aom_dsp/aom_convolve.c',
+ '/media/libaom/src/aom_dsp/aom_dsp_rtcd.c',
+ '/media/libaom/src/aom_dsp/binary_codes_reader.c',
+ '/media/libaom/src/aom_dsp/bitreader_buffer.c',
+ '/media/libaom/src/aom_dsp/bitwriter_buffer.c',
+ '/media/libaom/src/aom_dsp/blend_a64_hmask.c',
+ '/media/libaom/src/aom_dsp/blend_a64_mask.c',
+ '/media/libaom/src/aom_dsp/blend_a64_vmask.c',
+ '/media/libaom/src/aom_dsp/daalaboolreader.c',
+ '/media/libaom/src/aom_dsp/entcode.c',
+ '/media/libaom/src/aom_dsp/entdec.c',
+ '/media/libaom/src/aom_dsp/fft.c',
+ '/media/libaom/src/aom_dsp/grain_synthesis.c',
+ '/media/libaom/src/aom_dsp/intrapred.c',
+ '/media/libaom/src/aom_dsp/loopfilter.c',
+ '/media/libaom/src/aom_dsp/subtract.c',
+ '/media/libaom/src/aom_dsp/x86/aom_asm_stubs.c',
+ '/media/libaom/src/aom_dsp/x86/aom_convolve_copy_sse2.asm',
+ '/media/libaom/src/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm',
+ '/media/libaom/src/aom_dsp/x86/aom_high_subpixel_bilinear_sse2.asm',
+ '/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_intrin_avx2.c',
+ '/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c',
+ '/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_sse2.asm',
+ '/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_ssse3.asm',
+ '/media/libaom/src/aom_dsp/x86/aom_subpixel_bilinear_sse2.asm',
+ '/media/libaom/src/aom_dsp/x86/aom_subpixel_bilinear_ssse3.asm',
+ '/media/libaom/src/aom_dsp/x86/blend_a64_hmask_sse4.c',
+ '/media/libaom/src/aom_dsp/x86/blend_a64_mask_avx2.c',
+ '/media/libaom/src/aom_dsp/x86/blend_a64_mask_sse4.c',
+ '/media/libaom/src/aom_dsp/x86/blend_a64_vmask_sse4.c',
+ '/media/libaom/src/aom_dsp/x86/fft_avx2.c',
+ '/media/libaom/src/aom_dsp/x86/fft_sse2.c',
+ '/media/libaom/src/aom_dsp/x86/highbd_convolve_avx2.c',
+ '/media/libaom/src/aom_dsp/x86/highbd_convolve_ssse3.c',
+ '/media/libaom/src/aom_dsp/x86/highbd_intrapred_sse2.c',
+ '/media/libaom/src/aom_dsp/x86/highbd_intrapred_sse2_asm.asm',
+ '/media/libaom/src/aom_dsp/x86/highbd_loopfilter_avx2.c',
+ '/media/libaom/src/aom_dsp/x86/highbd_loopfilter_sse2.c',
+ '/media/libaom/src/aom_dsp/x86/intrapred_avx2.c',
+ '/media/libaom/src/aom_dsp/x86/intrapred_sse2.c',
+ '/media/libaom/src/aom_dsp/x86/intrapred_sse2_asm.asm',
+ '/media/libaom/src/aom_dsp/x86/intrapred_ssse3.c',
+ '/media/libaom/src/aom_dsp/x86/inv_wht_sse2.asm',
+ '/media/libaom/src/aom_dsp/x86/loopfilter_sse2.c',
+ '/media/libaom/src/aom_mem/aom_mem.c',
+ '/media/libaom/src/aom_ports/emms.asm',
+ '/media/libaom/src/aom_scale/aom_scale_rtcd.c',
+ '/media/libaom/src/aom_scale/generic/aom_scale.c',
+ '/media/libaom/src/aom_scale/generic/gen_scalers.c',
+ '/media/libaom/src/aom_scale/generic/yv12config.c',
+ '/media/libaom/src/aom_scale/generic/yv12extend.c',
+ '/media/libaom/src/aom_util/aom_thread.c',
+ '/media/libaom/src/aom_util/debug_util.c',
+ '/media/libaom/src/av1/av1_dx_iface.c',
+ '/media/libaom/src/av1/common/alloccommon.c',
+ '/media/libaom/src/av1/common/av1_inv_txfm1d.c',
+ '/media/libaom/src/av1/common/av1_inv_txfm2d.c',
+ '/media/libaom/src/av1/common/av1_loopfilter.c',
+ '/media/libaom/src/av1/common/av1_rtcd.c',
+ '/media/libaom/src/av1/common/av1_txfm.c',
+ '/media/libaom/src/av1/common/blockd.c',
+ '/media/libaom/src/av1/common/cdef.c',
+ '/media/libaom/src/av1/common/cdef_block.c',
+ '/media/libaom/src/av1/common/cdef_block_avx2.c',
+ '/media/libaom/src/av1/common/cdef_block_sse2.c',
+ '/media/libaom/src/av1/common/cdef_block_sse4.c',
+ '/media/libaom/src/av1/common/cdef_block_ssse3.c',
+ '/media/libaom/src/av1/common/cfl.c',
+ '/media/libaom/src/av1/common/convolve.c',
+ '/media/libaom/src/av1/common/debugmodes.c',
+ '/media/libaom/src/av1/common/entropy.c',
+ '/media/libaom/src/av1/common/entropymode.c',
+ '/media/libaom/src/av1/common/entropymv.c',
+ '/media/libaom/src/av1/common/frame_buffers.c',
+ '/media/libaom/src/av1/common/idct.c',
+ '/media/libaom/src/av1/common/mvref_common.c',
+ '/media/libaom/src/av1/common/obu_util.c',
+ '/media/libaom/src/av1/common/odintrin.c',
+ '/media/libaom/src/av1/common/pred_common.c',
+ '/media/libaom/src/av1/common/quant_common.c',
+ '/media/libaom/src/av1/common/reconinter.c',
+ '/media/libaom/src/av1/common/reconintra.c',
+ '/media/libaom/src/av1/common/resize.c',
+ '/media/libaom/src/av1/common/restoration.c',
+ '/media/libaom/src/av1/common/scale.c',
+ '/media/libaom/src/av1/common/scan.c',
+ '/media/libaom/src/av1/common/seg_common.c',
+ '/media/libaom/src/av1/common/thread_common.c',
+ '/media/libaom/src/av1/common/tile_common.c',
+ '/media/libaom/src/av1/common/timing.c',
+ '/media/libaom/src/av1/common/txb_common.c',
+ '/media/libaom/src/av1/common/warped_motion.c',
+ '/media/libaom/src/av1/common/x86/av1_convolve_horiz_rs_sse4.c',
+ '/media/libaom/src/av1/common/x86/av1_convolve_scale_sse4.c',
+ '/media/libaom/src/av1/common/x86/av1_highbd_convolve_sse4.c',
+ '/media/libaom/src/av1/common/x86/av1_inv_txfm_avx2.c',
+ '/media/libaom/src/av1/common/x86/av1_inv_txfm_ssse3.c',
+ '/media/libaom/src/av1/common/x86/av1_txfm_sse4.c',
+ '/media/libaom/src/av1/common/x86/cfl_avx2.c',
+ '/media/libaom/src/av1/common/x86/cfl_sse2.c',
+ '/media/libaom/src/av1/common/x86/cfl_ssse3.c',
+ '/media/libaom/src/av1/common/x86/convolve_2d_avx2.c',
+ '/media/libaom/src/av1/common/x86/convolve_2d_sse2.c',
+ '/media/libaom/src/av1/common/x86/convolve_avx2.c',
+ '/media/libaom/src/av1/common/x86/convolve_sse2.c',
+ '/media/libaom/src/av1/common/x86/filterintra_sse4.c',
+ '/media/libaom/src/av1/common/x86/highbd_convolve_2d_avx2.c',
+ '/media/libaom/src/av1/common/x86/highbd_convolve_2d_sse2.c',
+ '/media/libaom/src/av1/common/x86/highbd_convolve_2d_sse4.c',
+ '/media/libaom/src/av1/common/x86/highbd_convolve_2d_ssse3.c',
+ '/media/libaom/src/av1/common/x86/highbd_inv_txfm_avx2.c',
+ '/media/libaom/src/av1/common/x86/highbd_inv_txfm_sse4.c',
+ '/media/libaom/src/av1/common/x86/highbd_jnt_convolve_avx2.c',
+ '/media/libaom/src/av1/common/x86/highbd_jnt_convolve_sse4.c',
+ '/media/libaom/src/av1/common/x86/highbd_warp_plane_sse4.c',
+ '/media/libaom/src/av1/common/x86/highbd_wiener_convolve_avx2.c',
+ '/media/libaom/src/av1/common/x86/highbd_wiener_convolve_ssse3.c',
+ '/media/libaom/src/av1/common/x86/intra_edge_sse4.c',
+ '/media/libaom/src/av1/common/x86/jnt_convolve_avx2.c',
+ '/media/libaom/src/av1/common/x86/jnt_convolve_sse2.c',
+ '/media/libaom/src/av1/common/x86/jnt_convolve_ssse3.c',
+ '/media/libaom/src/av1/common/x86/reconinter_avx2.c',
+ '/media/libaom/src/av1/common/x86/reconinter_sse4.c',
+ '/media/libaom/src/av1/common/x86/reconinter_ssse3.c',
+ '/media/libaom/src/av1/common/x86/selfguided_avx2.c',
+ '/media/libaom/src/av1/common/x86/selfguided_sse4.c',
+ '/media/libaom/src/av1/common/x86/warp_plane_sse4.c',
+ '/media/libaom/src/av1/common/x86/wiener_convolve_avx2.c',
+ '/media/libaom/src/av1/common/x86/wiener_convolve_sse2.c',
+ '/media/libaom/src/av1/decoder/decodeframe.c',
+ '/media/libaom/src/av1/decoder/decodemv.c',
+ '/media/libaom/src/av1/decoder/decoder.c',
+ '/media/libaom/src/av1/decoder/decodetxb.c',
+ '/media/libaom/src/av1/decoder/detokenize.c',
+ '/media/libaom/src/av1/decoder/dthread.c',
+ '/media/libaom/src/av1/decoder/obu.c',
],
}
diff --git a/third_party/aom/.clang-format b/media/libaom/src/.clang-format
index e76a526e4..e76a526e4 100644
--- a/third_party/aom/.clang-format
+++ b/media/libaom/src/.clang-format
diff --git a/third_party/aom/.cmake-format.py b/media/libaom/src/.cmake-format.py
index aa7354c2a..aa7354c2a 100644
--- a/third_party/aom/.cmake-format.py
+++ b/media/libaom/src/.cmake-format.py
diff --git a/third_party/aom/.mailmap b/media/libaom/src/.mailmap
index bbe4525b1..bbe4525b1 100644
--- a/third_party/aom/.mailmap
+++ b/media/libaom/src/.mailmap
diff --git a/third_party/aom/AUTHORS b/media/libaom/src/AUTHORS
index 95c3c8bf2..95c3c8bf2 100644
--- a/third_party/aom/AUTHORS
+++ b/media/libaom/src/AUTHORS
diff --git a/third_party/aom/CHANGELOG b/media/libaom/src/CHANGELOG
index d84aa0249..d84aa0249 100644
--- a/third_party/aom/CHANGELOG
+++ b/media/libaom/src/CHANGELOG
diff --git a/third_party/aom/CMakeLists.txt b/media/libaom/src/CMakeLists.txt
index a58e54f40..a58e54f40 100644
--- a/third_party/aom/CMakeLists.txt
+++ b/media/libaom/src/CMakeLists.txt
diff --git a/third_party/aom/LICENSE b/media/libaom/src/LICENSE
index fc340c376..fc340c376 100644
--- a/third_party/aom/LICENSE
+++ b/media/libaom/src/LICENSE
diff --git a/third_party/aom/PATENTS b/media/libaom/src/PATENTS
index 97842e02f..97842e02f 100644
--- a/third_party/aom/PATENTS
+++ b/media/libaom/src/PATENTS
diff --git a/third_party/aom/README.md b/media/libaom/src/README.md
index cab3f9993..cab3f9993 100644
--- a/third_party/aom/README.md
+++ b/media/libaom/src/README.md
diff --git a/third_party/aom/aom/aom.h b/media/libaom/src/aom/aom.h
index b1cc1ecce..b1cc1ecce 100644
--- a/third_party/aom/aom/aom.h
+++ b/media/libaom/src/aom/aom.h
diff --git a/third_party/aom/aom/aom_codec.h b/media/libaom/src/aom/aom_codec.h
index fc0df5b9e..fc0df5b9e 100644
--- a/third_party/aom/aom/aom_codec.h
+++ b/media/libaom/src/aom/aom_codec.h
diff --git a/third_party/aom/aom/aom_decoder.h b/media/libaom/src/aom/aom_decoder.h
index 06c2dc5f7..06c2dc5f7 100644
--- a/third_party/aom/aom/aom_decoder.h
+++ b/media/libaom/src/aom/aom_decoder.h
diff --git a/third_party/aom/aom/aom_encoder.h b/media/libaom/src/aom/aom_encoder.h
index 0894ca9e3..0894ca9e3 100644
--- a/third_party/aom/aom/aom_encoder.h
+++ b/media/libaom/src/aom/aom_encoder.h
diff --git a/third_party/aom/aom/aom_frame_buffer.h b/media/libaom/src/aom/aom_frame_buffer.h
index fba4322f8..fba4322f8 100644
--- a/third_party/aom/aom/aom_frame_buffer.h
+++ b/media/libaom/src/aom/aom_frame_buffer.h
diff --git a/third_party/aom/aom/aom_image.h b/media/libaom/src/aom/aom_image.h
index a960127f1..a960127f1 100644
--- a/third_party/aom/aom/aom_image.h
+++ b/media/libaom/src/aom/aom_image.h
diff --git a/third_party/aom/aom/aom_integer.h b/media/libaom/src/aom/aom_integer.h
index 90263bd4f..90263bd4f 100644
--- a/third_party/aom/aom/aom_integer.h
+++ b/media/libaom/src/aom/aom_integer.h
diff --git a/third_party/aom/aom/aomcx.h b/media/libaom/src/aom/aomcx.h
index 013ddf57e..013ddf57e 100644
--- a/third_party/aom/aom/aomcx.h
+++ b/media/libaom/src/aom/aomcx.h
diff --git a/third_party/aom/aom/aomdx.h b/media/libaom/src/aom/aomdx.h
index 765856a1b..765856a1b 100644
--- a/third_party/aom/aom/aomdx.h
+++ b/media/libaom/src/aom/aomdx.h
diff --git a/third_party/aom/aom/exports_com b/media/libaom/src/aom/exports_com
index 2798bd51a..2798bd51a 100644
--- a/third_party/aom/aom/exports_com
+++ b/media/libaom/src/aom/exports_com
diff --git a/third_party/aom/aom/exports_dec b/media/libaom/src/aom/exports_dec
index d7d1c4f7d..d7d1c4f7d 100644
--- a/third_party/aom/aom/exports_dec
+++ b/media/libaom/src/aom/exports_dec
diff --git a/third_party/aom/aom/exports_enc b/media/libaom/src/aom/exports_enc
index 918d742f0..918d742f0 100644
--- a/third_party/aom/aom/exports_enc
+++ b/media/libaom/src/aom/exports_enc
diff --git a/third_party/aom/aom/exports_test b/media/libaom/src/aom/exports_test
index 01b864bae..01b864bae 100644
--- a/third_party/aom/aom/exports_test
+++ b/media/libaom/src/aom/exports_test
diff --git a/third_party/aom/aom/internal/aom_codec_internal.h b/media/libaom/src/aom/internal/aom_codec_internal.h
index 21c0dc69c..21c0dc69c 100644
--- a/third_party/aom/aom/internal/aom_codec_internal.h
+++ b/media/libaom/src/aom/internal/aom_codec_internal.h
diff --git a/third_party/aom/aom/src/aom_codec.c b/media/libaom/src/aom/src/aom_codec.c
index 733bffb25..733bffb25 100644
--- a/third_party/aom/aom/src/aom_codec.c
+++ b/media/libaom/src/aom/src/aom_codec.c
diff --git a/third_party/aom/aom/src/aom_decoder.c b/media/libaom/src/aom/src/aom_decoder.c
index 8c9111faf..8c9111faf 100644
--- a/third_party/aom/aom/src/aom_decoder.c
+++ b/media/libaom/src/aom/src/aom_decoder.c
diff --git a/third_party/aom/aom/src/aom_encoder.c b/media/libaom/src/aom/src/aom_encoder.c
index 523f40bbe..523f40bbe 100644
--- a/third_party/aom/aom/src/aom_encoder.c
+++ b/media/libaom/src/aom/src/aom_encoder.c
diff --git a/third_party/aom/aom/src/aom_image.c b/media/libaom/src/aom/src/aom_image.c
index 437f0241e..437f0241e 100644
--- a/third_party/aom/aom/src/aom_image.c
+++ b/media/libaom/src/aom/src/aom_image.c
diff --git a/third_party/aom/aom/src/aom_integer.c b/media/libaom/src/aom/src/aom_integer.c
index 7edfd0de8..7edfd0de8 100644
--- a/third_party/aom/aom/src/aom_integer.c
+++ b/media/libaom/src/aom/src/aom_integer.c
diff --git a/third_party/aom/aom_dsp/add_noise.c b/media/libaom/src/aom_dsp/add_noise.c
index bfb3e7e00..bfb3e7e00 100644
--- a/third_party/aom/aom_dsp/add_noise.c
+++ b/media/libaom/src/aom_dsp/add_noise.c
diff --git a/third_party/aom/aom_dsp/aom_convolve.c b/media/libaom/src/aom_dsp/aom_convolve.c
index 4791826da..4791826da 100644
--- a/third_party/aom/aom_dsp/aom_convolve.c
+++ b/media/libaom/src/aom_dsp/aom_convolve.c
diff --git a/third_party/aom/aom_dsp/aom_dsp.cmake b/media/libaom/src/aom_dsp/aom_dsp.cmake
index 11ff73756..11ff73756 100644
--- a/third_party/aom/aom_dsp/aom_dsp.cmake
+++ b/media/libaom/src/aom_dsp/aom_dsp.cmake
diff --git a/third_party/aom/aom_dsp/aom_dsp_common.h b/media/libaom/src/aom_dsp/aom_dsp_common.h
index a185b23c8..a185b23c8 100644
--- a/third_party/aom/aom_dsp/aom_dsp_common.h
+++ b/media/libaom/src/aom_dsp/aom_dsp_common.h
diff --git a/third_party/aom/aom_dsp/aom_dsp_rtcd.c b/media/libaom/src/aom_dsp/aom_dsp_rtcd.c
index 1514bd64e..1514bd64e 100644
--- a/third_party/aom/aom_dsp/aom_dsp_rtcd.c
+++ b/media/libaom/src/aom_dsp/aom_dsp_rtcd.c
diff --git a/third_party/aom/aom_dsp/aom_dsp_rtcd_defs.pl b/media/libaom/src/aom_dsp/aom_dsp_rtcd_defs.pl
index 8e8a480fe..8e8a480fe 100755..100644
--- a/third_party/aom/aom_dsp/aom_dsp_rtcd_defs.pl
+++ b/media/libaom/src/aom_dsp/aom_dsp_rtcd_defs.pl
diff --git a/third_party/aom/aom_dsp/aom_filter.h b/media/libaom/src/aom_dsp/aom_filter.h
index 00686ac38..00686ac38 100644
--- a/third_party/aom/aom_dsp/aom_filter.h
+++ b/media/libaom/src/aom_dsp/aom_filter.h
diff --git a/third_party/aom/aom_dsp/aom_simd.h b/media/libaom/src/aom_dsp/aom_simd.h
index ab950ca55..ab950ca55 100644
--- a/third_party/aom/aom_dsp/aom_simd.h
+++ b/media/libaom/src/aom_dsp/aom_simd.h
diff --git a/third_party/aom/aom_dsp/aom_simd_inline.h b/media/libaom/src/aom_dsp/aom_simd_inline.h
index eb333f6f6..eb333f6f6 100644
--- a/third_party/aom/aom_dsp/aom_simd_inline.h
+++ b/media/libaom/src/aom_dsp/aom_simd_inline.h
diff --git a/third_party/aom/aom_dsp/arm/blend_a64_mask_neon.c b/media/libaom/src/aom_dsp/arm/blend_a64_mask_neon.c
index e7f08a5fd..e7f08a5fd 100644
--- a/third_party/aom/aom_dsp/arm/blend_a64_mask_neon.c
+++ b/media/libaom/src/aom_dsp/arm/blend_a64_mask_neon.c
diff --git a/third_party/aom/aom_dsp/arm/fwd_txfm_neon.c b/media/libaom/src/aom_dsp/arm/fwd_txfm_neon.c
index e4300c992..e4300c992 100644
--- a/third_party/aom/aom_dsp/arm/fwd_txfm_neon.c
+++ b/media/libaom/src/aom_dsp/arm/fwd_txfm_neon.c
diff --git a/third_party/aom/aom_dsp/arm/intrapred_neon.c b/media/libaom/src/aom_dsp/arm/intrapred_neon.c
index c85b1e910..c85b1e910 100644
--- a/third_party/aom/aom_dsp/arm/intrapred_neon.c
+++ b/media/libaom/src/aom_dsp/arm/intrapred_neon.c
diff --git a/third_party/aom/aom_dsp/arm/loopfilter_neon.c b/media/libaom/src/aom_dsp/arm/loopfilter_neon.c
index bdc67626d..bdc67626d 100644
--- a/third_party/aom/aom_dsp/arm/loopfilter_neon.c
+++ b/media/libaom/src/aom_dsp/arm/loopfilter_neon.c
diff --git a/third_party/aom/aom_dsp/arm/sad4d_neon.c b/media/libaom/src/aom_dsp/arm/sad4d_neon.c
index 606950ab2..606950ab2 100644
--- a/third_party/aom/aom_dsp/arm/sad4d_neon.c
+++ b/media/libaom/src/aom_dsp/arm/sad4d_neon.c
diff --git a/third_party/aom/aom_dsp/arm/sad_neon.c b/media/libaom/src/aom_dsp/arm/sad_neon.c
index a39de91d6..a39de91d6 100644
--- a/third_party/aom/aom_dsp/arm/sad_neon.c
+++ b/media/libaom/src/aom_dsp/arm/sad_neon.c
diff --git a/third_party/aom/aom_dsp/arm/subpel_variance_neon.c b/media/libaom/src/aom_dsp/arm/subpel_variance_neon.c
index cf618eee7..cf618eee7 100644
--- a/third_party/aom/aom_dsp/arm/subpel_variance_neon.c
+++ b/media/libaom/src/aom_dsp/arm/subpel_variance_neon.c
diff --git a/third_party/aom/aom_dsp/arm/subtract_neon.c b/media/libaom/src/aom_dsp/arm/subtract_neon.c
index 28f5ace8e..28f5ace8e 100644
--- a/third_party/aom/aom_dsp/arm/subtract_neon.c
+++ b/media/libaom/src/aom_dsp/arm/subtract_neon.c
diff --git a/third_party/aom/aom_dsp/arm/variance_neon.c b/media/libaom/src/aom_dsp/arm/variance_neon.c
index 74385a601..74385a601 100644
--- a/third_party/aom/aom_dsp/arm/variance_neon.c
+++ b/media/libaom/src/aom_dsp/arm/variance_neon.c
diff --git a/third_party/aom/aom_dsp/binary_codes_reader.c b/media/libaom/src/aom_dsp/binary_codes_reader.c
index 01088010a..01088010a 100644
--- a/third_party/aom/aom_dsp/binary_codes_reader.c
+++ b/media/libaom/src/aom_dsp/binary_codes_reader.c
diff --git a/third_party/aom/aom_dsp/binary_codes_reader.h b/media/libaom/src/aom_dsp/binary_codes_reader.h
index 364a67469..364a67469 100644
--- a/third_party/aom/aom_dsp/binary_codes_reader.h
+++ b/media/libaom/src/aom_dsp/binary_codes_reader.h
diff --git a/third_party/aom/aom_dsp/binary_codes_writer.c b/media/libaom/src/aom_dsp/binary_codes_writer.c
index ee7a9f567..ee7a9f567 100644
--- a/third_party/aom/aom_dsp/binary_codes_writer.c
+++ b/media/libaom/src/aom_dsp/binary_codes_writer.c
diff --git a/third_party/aom/aom_dsp/binary_codes_writer.h b/media/libaom/src/aom_dsp/binary_codes_writer.h
index c360e0e29..c360e0e29 100644
--- a/third_party/aom/aom_dsp/binary_codes_writer.h
+++ b/media/libaom/src/aom_dsp/binary_codes_writer.h
diff --git a/third_party/aom/aom_dsp/bitreader.h b/media/libaom/src/aom_dsp/bitreader.h
index 7c0efcc78..7c0efcc78 100644
--- a/third_party/aom/aom_dsp/bitreader.h
+++ b/media/libaom/src/aom_dsp/bitreader.h
diff --git a/third_party/aom/aom_dsp/bitreader_buffer.c b/media/libaom/src/aom_dsp/bitreader_buffer.c
index b53211784..b53211784 100644
--- a/third_party/aom/aom_dsp/bitreader_buffer.c
+++ b/media/libaom/src/aom_dsp/bitreader_buffer.c
diff --git a/third_party/aom/aom_dsp/bitreader_buffer.h b/media/libaom/src/aom_dsp/bitreader_buffer.h
index 725ca1ea2..725ca1ea2 100644
--- a/third_party/aom/aom_dsp/bitreader_buffer.h
+++ b/media/libaom/src/aom_dsp/bitreader_buffer.h
diff --git a/third_party/aom/aom_dsp/bitwriter.h b/media/libaom/src/aom_dsp/bitwriter.h
index b5ecc2382..b5ecc2382 100644
--- a/third_party/aom/aom_dsp/bitwriter.h
+++ b/media/libaom/src/aom_dsp/bitwriter.h
diff --git a/third_party/aom/aom_dsp/bitwriter_buffer.c b/media/libaom/src/aom_dsp/bitwriter_buffer.c
index 596246deb..596246deb 100644
--- a/third_party/aom/aom_dsp/bitwriter_buffer.c
+++ b/media/libaom/src/aom_dsp/bitwriter_buffer.c
diff --git a/third_party/aom/aom_dsp/bitwriter_buffer.h b/media/libaom/src/aom_dsp/bitwriter_buffer.h
index d0311284f..d0311284f 100644
--- a/third_party/aom/aom_dsp/bitwriter_buffer.h
+++ b/media/libaom/src/aom_dsp/bitwriter_buffer.h
diff --git a/third_party/aom/aom_dsp/blend.h b/media/libaom/src/aom_dsp/blend.h
index fd87dc181..fd87dc181 100644
--- a/third_party/aom/aom_dsp/blend.h
+++ b/media/libaom/src/aom_dsp/blend.h
diff --git a/third_party/aom/aom_dsp/blend_a64_hmask.c b/media/libaom/src/aom_dsp/blend_a64_hmask.c
index 0554b43d1..0554b43d1 100644
--- a/third_party/aom/aom_dsp/blend_a64_hmask.c
+++ b/media/libaom/src/aom_dsp/blend_a64_hmask.c
diff --git a/third_party/aom/aom_dsp/blend_a64_mask.c b/media/libaom/src/aom_dsp/blend_a64_mask.c
index 992cc5c0c..992cc5c0c 100644
--- a/third_party/aom/aom_dsp/blend_a64_mask.c
+++ b/media/libaom/src/aom_dsp/blend_a64_mask.c
diff --git a/third_party/aom/aom_dsp/blend_a64_vmask.c b/media/libaom/src/aom_dsp/blend_a64_vmask.c
index 4f222e17f..4f222e17f 100644
--- a/third_party/aom/aom_dsp/blend_a64_vmask.c
+++ b/media/libaom/src/aom_dsp/blend_a64_vmask.c
diff --git a/third_party/aom/aom_dsp/buf_ans.c b/media/libaom/src/aom_dsp/buf_ans.c
index f7703dffc..f7703dffc 100644
--- a/third_party/aom/aom_dsp/buf_ans.c
+++ b/media/libaom/src/aom_dsp/buf_ans.c
diff --git a/third_party/aom/aom_dsp/buf_ans.h b/media/libaom/src/aom_dsp/buf_ans.h
index 985fcdf9e..985fcdf9e 100644
--- a/third_party/aom/aom_dsp/buf_ans.h
+++ b/media/libaom/src/aom_dsp/buf_ans.h
diff --git a/third_party/aom/aom_dsp/daalaboolreader.c b/media/libaom/src/aom_dsp/daalaboolreader.c
index 6c2259f23..6c2259f23 100644
--- a/third_party/aom/aom_dsp/daalaboolreader.c
+++ b/media/libaom/src/aom_dsp/daalaboolreader.c
diff --git a/third_party/aom/aom_dsp/daalaboolreader.h b/media/libaom/src/aom_dsp/daalaboolreader.h
index ba78f916d..ba78f916d 100644
--- a/third_party/aom/aom_dsp/daalaboolreader.h
+++ b/media/libaom/src/aom_dsp/daalaboolreader.h
diff --git a/third_party/aom/aom_dsp/daalaboolwriter.c b/media/libaom/src/aom_dsp/daalaboolwriter.c
index b24ffbf3f..b24ffbf3f 100644
--- a/third_party/aom/aom_dsp/daalaboolwriter.c
+++ b/media/libaom/src/aom_dsp/daalaboolwriter.c
diff --git a/third_party/aom/aom_dsp/daalaboolwriter.h b/media/libaom/src/aom_dsp/daalaboolwriter.h
index 3848877ce..3848877ce 100644
--- a/third_party/aom/aom_dsp/daalaboolwriter.h
+++ b/media/libaom/src/aom_dsp/daalaboolwriter.h
diff --git a/third_party/aom/aom_dsp/entcode.c b/media/libaom/src/aom_dsp/entcode.c
index aad96c6fc..aad96c6fc 100644
--- a/third_party/aom/aom_dsp/entcode.c
+++ b/media/libaom/src/aom_dsp/entcode.c
diff --git a/third_party/aom/aom_dsp/entcode.h b/media/libaom/src/aom_dsp/entcode.h
index 7ba2b1c39..7ba2b1c39 100644
--- a/third_party/aom/aom_dsp/entcode.h
+++ b/media/libaom/src/aom_dsp/entcode.h
diff --git a/third_party/aom/aom_dsp/entdec.c b/media/libaom/src/aom_dsp/entdec.c
index d1764c47b..d1764c47b 100644
--- a/third_party/aom/aom_dsp/entdec.c
+++ b/media/libaom/src/aom_dsp/entdec.c
diff --git a/third_party/aom/aom_dsp/entdec.h b/media/libaom/src/aom_dsp/entdec.h
index 283bf1831..283bf1831 100644
--- a/third_party/aom/aom_dsp/entdec.h
+++ b/media/libaom/src/aom_dsp/entdec.h
diff --git a/third_party/aom/aom_dsp/entenc.c b/media/libaom/src/aom_dsp/entenc.c
index a61da263c..a61da263c 100644
--- a/third_party/aom/aom_dsp/entenc.c
+++ b/media/libaom/src/aom_dsp/entenc.c
diff --git a/third_party/aom/aom_dsp/entenc.h b/media/libaom/src/aom_dsp/entenc.h
index 3551d4250..3551d4250 100644
--- a/third_party/aom/aom_dsp/entenc.h
+++ b/media/libaom/src/aom_dsp/entenc.h
diff --git a/third_party/aom/aom_dsp/fastssim.c b/media/libaom/src/aom_dsp/fastssim.c
index 3804519b3..3804519b3 100644
--- a/third_party/aom/aom_dsp/fastssim.c
+++ b/media/libaom/src/aom_dsp/fastssim.c
diff --git a/third_party/aom/aom_dsp/fft.c b/media/libaom/src/aom_dsp/fft.c
index 0ba71cfb3..0ba71cfb3 100644
--- a/third_party/aom/aom_dsp/fft.c
+++ b/media/libaom/src/aom_dsp/fft.c
diff --git a/third_party/aom/aom_dsp/fft_common.h b/media/libaom/src/aom_dsp/fft_common.h
index 5137331ae..5137331ae 100644
--- a/third_party/aom/aom_dsp/fft_common.h
+++ b/media/libaom/src/aom_dsp/fft_common.h
diff --git a/third_party/aom/aom_dsp/fwd_txfm.c b/media/libaom/src/aom_dsp/fwd_txfm.c
index e50f951c1..e50f951c1 100644
--- a/third_party/aom/aom_dsp/fwd_txfm.c
+++ b/media/libaom/src/aom_dsp/fwd_txfm.c
diff --git a/third_party/aom/aom_dsp/grain_synthesis.c b/media/libaom/src/aom_dsp/grain_synthesis.c
index b96e1c319..b96e1c319 100644
--- a/third_party/aom/aom_dsp/grain_synthesis.c
+++ b/media/libaom/src/aom_dsp/grain_synthesis.c
diff --git a/third_party/aom/aom_dsp/grain_synthesis.h b/media/libaom/src/aom_dsp/grain_synthesis.h
index 7aee6f6f4..7aee6f6f4 100644
--- a/third_party/aom/aom_dsp/grain_synthesis.h
+++ b/media/libaom/src/aom_dsp/grain_synthesis.h
diff --git a/third_party/aom/aom_dsp/grain_table.c b/media/libaom/src/aom_dsp/grain_table.c
index 0d6a73f55..0d6a73f55 100644
--- a/third_party/aom/aom_dsp/grain_table.c
+++ b/media/libaom/src/aom_dsp/grain_table.c
diff --git a/third_party/aom/aom_dsp/grain_table.h b/media/libaom/src/aom_dsp/grain_table.h
index a8ac50730..a8ac50730 100644
--- a/third_party/aom/aom_dsp/grain_table.h
+++ b/media/libaom/src/aom_dsp/grain_table.h
diff --git a/third_party/aom/aom_dsp/intrapred.c b/media/libaom/src/aom_dsp/intrapred.c
index c6aa6b207..c6aa6b207 100644
--- a/third_party/aom/aom_dsp/intrapred.c
+++ b/media/libaom/src/aom_dsp/intrapred.c
diff --git a/third_party/aom/aom_dsp/intrapred_common.h b/media/libaom/src/aom_dsp/intrapred_common.h
index 3ec62a86e..3ec62a86e 100644
--- a/third_party/aom/aom_dsp/intrapred_common.h
+++ b/media/libaom/src/aom_dsp/intrapred_common.h
diff --git a/third_party/aom/aom_dsp/loopfilter.c b/media/libaom/src/aom_dsp/loopfilter.c
index a3f261824..a3f261824 100644
--- a/third_party/aom/aom_dsp/loopfilter.c
+++ b/media/libaom/src/aom_dsp/loopfilter.c
diff --git a/third_party/aom/aom_dsp/mips/add_noise_msa.c b/media/libaom/src/aom_dsp/mips/add_noise_msa.c
index 96d04cff0..96d04cff0 100644
--- a/third_party/aom/aom_dsp/mips/add_noise_msa.c
+++ b/media/libaom/src/aom_dsp/mips/add_noise_msa.c
diff --git a/third_party/aom/aom_dsp/mips/aom_convolve8_horiz_msa.c b/media/libaom/src/aom_dsp/mips/aom_convolve8_horiz_msa.c
index 363fad308..363fad308 100644
--- a/third_party/aom/aom_dsp/mips/aom_convolve8_horiz_msa.c
+++ b/media/libaom/src/aom_dsp/mips/aom_convolve8_horiz_msa.c
diff --git a/third_party/aom/aom_dsp/mips/aom_convolve8_vert_msa.c b/media/libaom/src/aom_dsp/mips/aom_convolve8_vert_msa.c
index aa962b41f..aa962b41f 100644
--- a/third_party/aom/aom_dsp/mips/aom_convolve8_vert_msa.c
+++ b/media/libaom/src/aom_dsp/mips/aom_convolve8_vert_msa.c
diff --git a/third_party/aom/aom_dsp/mips/aom_convolve_copy_msa.c b/media/libaom/src/aom_dsp/mips/aom_convolve_copy_msa.c
index f7f116f4d..f7f116f4d 100644
--- a/third_party/aom/aom_dsp/mips/aom_convolve_copy_msa.c
+++ b/media/libaom/src/aom_dsp/mips/aom_convolve_copy_msa.c
diff --git a/third_party/aom/aom_dsp/mips/aom_convolve_msa.h b/media/libaom/src/aom_dsp/mips/aom_convolve_msa.h
index 852415c20..852415c20 100644
--- a/third_party/aom/aom_dsp/mips/aom_convolve_msa.h
+++ b/media/libaom/src/aom_dsp/mips/aom_convolve_msa.h
diff --git a/third_party/aom/aom_dsp/mips/common_dspr2.c b/media/libaom/src/aom_dsp/mips/common_dspr2.c
index 00ab75dc3..00ab75dc3 100644
--- a/third_party/aom/aom_dsp/mips/common_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/common_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/common_dspr2.h b/media/libaom/src/aom_dsp/mips/common_dspr2.h
index c42188d62..c42188d62 100644
--- a/third_party/aom/aom_dsp/mips/common_dspr2.h
+++ b/media/libaom/src/aom_dsp/mips/common_dspr2.h
diff --git a/third_party/aom/aom_dsp/mips/convolve2_dspr2.c b/media/libaom/src/aom_dsp/mips/convolve2_dspr2.c
index 08bf1ab30..08bf1ab30 100644
--- a/third_party/aom/aom_dsp/mips/convolve2_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/convolve2_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/convolve2_horiz_dspr2.c b/media/libaom/src/aom_dsp/mips/convolve2_horiz_dspr2.c
index 097da73ca..097da73ca 100644
--- a/third_party/aom/aom_dsp/mips/convolve2_horiz_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/convolve2_horiz_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/convolve2_vert_dspr2.c b/media/libaom/src/aom_dsp/mips/convolve2_vert_dspr2.c
index 40abfd89e..40abfd89e 100644
--- a/third_party/aom/aom_dsp/mips/convolve2_vert_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/convolve2_vert_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/convolve8_dspr2.c b/media/libaom/src/aom_dsp/mips/convolve8_dspr2.c
index af54b4264..af54b4264 100644
--- a/third_party/aom/aom_dsp/mips/convolve8_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/convolve8_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/convolve8_horiz_dspr2.c b/media/libaom/src/aom_dsp/mips/convolve8_horiz_dspr2.c
index f9c6879ab..f9c6879ab 100644
--- a/third_party/aom/aom_dsp/mips/convolve8_horiz_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/convolve8_horiz_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/convolve8_vert_dspr2.c b/media/libaom/src/aom_dsp/mips/convolve8_vert_dspr2.c
index 201e66427..201e66427 100644
--- a/third_party/aom/aom_dsp/mips/convolve8_vert_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/convolve8_vert_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/convolve_common_dspr2.h b/media/libaom/src/aom_dsp/mips/convolve_common_dspr2.h
index e5d48a884..e5d48a884 100644
--- a/third_party/aom/aom_dsp/mips/convolve_common_dspr2.h
+++ b/media/libaom/src/aom_dsp/mips/convolve_common_dspr2.h
diff --git a/third_party/aom/aom_dsp/mips/intrapred16_dspr2.c b/media/libaom/src/aom_dsp/mips/intrapred16_dspr2.c
index 7c221ae89..7c221ae89 100644
--- a/third_party/aom/aom_dsp/mips/intrapred16_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/intrapred16_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/intrapred4_dspr2.c b/media/libaom/src/aom_dsp/mips/intrapred4_dspr2.c
index 0a21979c7..0a21979c7 100644
--- a/third_party/aom/aom_dsp/mips/intrapred4_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/intrapred4_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/intrapred8_dspr2.c b/media/libaom/src/aom_dsp/mips/intrapred8_dspr2.c
index d42a77c80..d42a77c80 100644
--- a/third_party/aom/aom_dsp/mips/intrapred8_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/intrapred8_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/intrapred_msa.c b/media/libaom/src/aom_dsp/mips/intrapred_msa.c
index 9f25cc1ca..9f25cc1ca 100644
--- a/third_party/aom/aom_dsp/mips/intrapred_msa.c
+++ b/media/libaom/src/aom_dsp/mips/intrapred_msa.c
diff --git a/third_party/aom/aom_dsp/mips/loopfilter_16_msa.c b/media/libaom/src/aom_dsp/mips/loopfilter_16_msa.c
index 38a10e9b2..38a10e9b2 100644
--- a/third_party/aom/aom_dsp/mips/loopfilter_16_msa.c
+++ b/media/libaom/src/aom_dsp/mips/loopfilter_16_msa.c
diff --git a/third_party/aom/aom_dsp/mips/loopfilter_4_msa.c b/media/libaom/src/aom_dsp/mips/loopfilter_4_msa.c
index dc0a97764..dc0a97764 100644
--- a/third_party/aom/aom_dsp/mips/loopfilter_4_msa.c
+++ b/media/libaom/src/aom_dsp/mips/loopfilter_4_msa.c
diff --git a/third_party/aom/aom_dsp/mips/loopfilter_8_msa.c b/media/libaom/src/aom_dsp/mips/loopfilter_8_msa.c
index dc203e79c..dc203e79c 100644
--- a/third_party/aom/aom_dsp/mips/loopfilter_8_msa.c
+++ b/media/libaom/src/aom_dsp/mips/loopfilter_8_msa.c
diff --git a/third_party/aom/aom_dsp/mips/loopfilter_filters_dspr2.c b/media/libaom/src/aom_dsp/mips/loopfilter_filters_dspr2.c
index 8c41278be..8c41278be 100644
--- a/third_party/aom/aom_dsp/mips/loopfilter_filters_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/loopfilter_filters_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/loopfilter_filters_dspr2.h b/media/libaom/src/aom_dsp/mips/loopfilter_filters_dspr2.h
index 28f0dc35a..28f0dc35a 100644
--- a/third_party/aom/aom_dsp/mips/loopfilter_filters_dspr2.h
+++ b/media/libaom/src/aom_dsp/mips/loopfilter_filters_dspr2.h
diff --git a/third_party/aom/aom_dsp/mips/loopfilter_macros_dspr2.h b/media/libaom/src/aom_dsp/mips/loopfilter_macros_dspr2.h
index 62295d69d..62295d69d 100644
--- a/third_party/aom/aom_dsp/mips/loopfilter_macros_dspr2.h
+++ b/media/libaom/src/aom_dsp/mips/loopfilter_macros_dspr2.h
diff --git a/third_party/aom/aom_dsp/mips/loopfilter_masks_dspr2.h b/media/libaom/src/aom_dsp/mips/loopfilter_masks_dspr2.h
index a0f57f386..a0f57f386 100644
--- a/third_party/aom/aom_dsp/mips/loopfilter_masks_dspr2.h
+++ b/media/libaom/src/aom_dsp/mips/loopfilter_masks_dspr2.h
diff --git a/third_party/aom/aom_dsp/mips/loopfilter_mb_dspr2.c b/media/libaom/src/aom_dsp/mips/loopfilter_mb_dspr2.c
index b67ccfe9d..b67ccfe9d 100644
--- a/third_party/aom/aom_dsp/mips/loopfilter_mb_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/loopfilter_mb_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/loopfilter_mb_horiz_dspr2.c b/media/libaom/src/aom_dsp/mips/loopfilter_mb_horiz_dspr2.c
index 34733e42e..34733e42e 100644
--- a/third_party/aom/aom_dsp/mips/loopfilter_mb_horiz_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/loopfilter_mb_horiz_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/loopfilter_mb_vert_dspr2.c b/media/libaom/src/aom_dsp/mips/loopfilter_mb_vert_dspr2.c
index 3d3f1ec97..3d3f1ec97 100644
--- a/third_party/aom/aom_dsp/mips/loopfilter_mb_vert_dspr2.c
+++ b/media/libaom/src/aom_dsp/mips/loopfilter_mb_vert_dspr2.c
diff --git a/third_party/aom/aom_dsp/mips/loopfilter_msa.h b/media/libaom/src/aom_dsp/mips/loopfilter_msa.h
index 54b0bb4bd..54b0bb4bd 100644
--- a/third_party/aom/aom_dsp/mips/loopfilter_msa.h
+++ b/media/libaom/src/aom_dsp/mips/loopfilter_msa.h
diff --git a/third_party/aom/aom_dsp/mips/macros_msa.h b/media/libaom/src/aom_dsp/mips/macros_msa.h
index 9bfc27147..9bfc27147 100644
--- a/third_party/aom/aom_dsp/mips/macros_msa.h
+++ b/media/libaom/src/aom_dsp/mips/macros_msa.h
diff --git a/third_party/aom/aom_dsp/mips/sad_msa.c b/media/libaom/src/aom_dsp/mips/sad_msa.c
index 58cdd80d9..58cdd80d9 100644
--- a/third_party/aom/aom_dsp/mips/sad_msa.c
+++ b/media/libaom/src/aom_dsp/mips/sad_msa.c
diff --git a/third_party/aom/aom_dsp/mips/sub_pixel_variance_msa.c b/media/libaom/src/aom_dsp/mips/sub_pixel_variance_msa.c
index 810b6efaa..810b6efaa 100644
--- a/third_party/aom/aom_dsp/mips/sub_pixel_variance_msa.c
+++ b/media/libaom/src/aom_dsp/mips/sub_pixel_variance_msa.c
diff --git a/third_party/aom/aom_dsp/mips/subtract_msa.c b/media/libaom/src/aom_dsp/mips/subtract_msa.c
index bfed773ac..bfed773ac 100644
--- a/third_party/aom/aom_dsp/mips/subtract_msa.c
+++ b/media/libaom/src/aom_dsp/mips/subtract_msa.c
diff --git a/third_party/aom/aom_dsp/mips/variance_msa.c b/media/libaom/src/aom_dsp/mips/variance_msa.c
index 065c09ac5..065c09ac5 100644
--- a/third_party/aom/aom_dsp/mips/variance_msa.c
+++ b/media/libaom/src/aom_dsp/mips/variance_msa.c
diff --git a/third_party/aom/aom_dsp/noise_model.c b/media/libaom/src/aom_dsp/noise_model.c
index 2faee8506..2faee8506 100644
--- a/third_party/aom/aom_dsp/noise_model.c
+++ b/media/libaom/src/aom_dsp/noise_model.c
diff --git a/third_party/aom/aom_dsp/noise_model.h b/media/libaom/src/aom_dsp/noise_model.h
index 049d5be15..049d5be15 100644
--- a/third_party/aom/aom_dsp/noise_model.h
+++ b/media/libaom/src/aom_dsp/noise_model.h
diff --git a/third_party/aom/aom_dsp/noise_util.c b/media/libaom/src/aom_dsp/noise_util.c
index 87e8e9fec..87e8e9fec 100644
--- a/third_party/aom/aom_dsp/noise_util.c
+++ b/media/libaom/src/aom_dsp/noise_util.c
diff --git a/third_party/aom/aom_dsp/noise_util.h b/media/libaom/src/aom_dsp/noise_util.h
index 2284a171a..2284a171a 100644
--- a/third_party/aom/aom_dsp/noise_util.h
+++ b/media/libaom/src/aom_dsp/noise_util.h
diff --git a/third_party/aom/aom_dsp/postproc.h b/media/libaom/src/aom_dsp/postproc.h
index f3d87f264..f3d87f264 100644
--- a/third_party/aom/aom_dsp/postproc.h
+++ b/media/libaom/src/aom_dsp/postproc.h
diff --git a/third_party/aom/aom_dsp/prob.h b/media/libaom/src/aom_dsp/prob.h
index d003a986e..d003a986e 100644
--- a/third_party/aom/aom_dsp/prob.h
+++ b/media/libaom/src/aom_dsp/prob.h
diff --git a/third_party/aom/aom_dsp/psnr.c b/media/libaom/src/aom_dsp/psnr.c
index 50f376a4a..50f376a4a 100644
--- a/third_party/aom/aom_dsp/psnr.c
+++ b/media/libaom/src/aom_dsp/psnr.c
diff --git a/third_party/aom/aom_dsp/psnr.h b/media/libaom/src/aom_dsp/psnr.h
index 58e4e71ee..58e4e71ee 100644
--- a/third_party/aom/aom_dsp/psnr.h
+++ b/media/libaom/src/aom_dsp/psnr.h
diff --git a/third_party/aom/aom_dsp/psnrhvs.c b/media/libaom/src/aom_dsp/psnrhvs.c
index 30fe21d9c..30fe21d9c 100644
--- a/third_party/aom/aom_dsp/psnrhvs.c
+++ b/media/libaom/src/aom_dsp/psnrhvs.c
diff --git a/third_party/aom/aom_dsp/quantize.c b/media/libaom/src/aom_dsp/quantize.c
index 62dbd86a9..62dbd86a9 100644
--- a/third_party/aom/aom_dsp/quantize.c
+++ b/media/libaom/src/aom_dsp/quantize.c
diff --git a/third_party/aom/aom_dsp/quantize.h b/media/libaom/src/aom_dsp/quantize.h
index c55ab234e..c55ab234e 100644
--- a/third_party/aom/aom_dsp/quantize.h
+++ b/media/libaom/src/aom_dsp/quantize.h
diff --git a/third_party/aom/aom_dsp/sad.c b/media/libaom/src/aom_dsp/sad.c
index 1e24df4a5..1e24df4a5 100644
--- a/third_party/aom/aom_dsp/sad.c
+++ b/media/libaom/src/aom_dsp/sad.c
diff --git a/third_party/aom/aom_dsp/sad_av1.c b/media/libaom/src/aom_dsp/sad_av1.c
index c176001d6..c176001d6 100644
--- a/third_party/aom/aom_dsp/sad_av1.c
+++ b/media/libaom/src/aom_dsp/sad_av1.c
diff --git a/third_party/aom/aom_dsp/simd/v128_intrinsics.h b/media/libaom/src/aom_dsp/simd/v128_intrinsics.h
index 01dbb8fd2..01dbb8fd2 100644
--- a/third_party/aom/aom_dsp/simd/v128_intrinsics.h
+++ b/media/libaom/src/aom_dsp/simd/v128_intrinsics.h
diff --git a/third_party/aom/aom_dsp/simd/v128_intrinsics_arm.h b/media/libaom/src/aom_dsp/simd/v128_intrinsics_arm.h
index 3c669d579..3c669d579 100644
--- a/third_party/aom/aom_dsp/simd/v128_intrinsics_arm.h
+++ b/media/libaom/src/aom_dsp/simd/v128_intrinsics_arm.h
diff --git a/third_party/aom/aom_dsp/simd/v128_intrinsics_c.h b/media/libaom/src/aom_dsp/simd/v128_intrinsics_c.h
index bbe9a9d28..bbe9a9d28 100644
--- a/third_party/aom/aom_dsp/simd/v128_intrinsics_c.h
+++ b/media/libaom/src/aom_dsp/simd/v128_intrinsics_c.h
diff --git a/third_party/aom/aom_dsp/simd/v128_intrinsics_x86.h b/media/libaom/src/aom_dsp/simd/v128_intrinsics_x86.h
index 6c7241ff4..6c7241ff4 100644
--- a/third_party/aom/aom_dsp/simd/v128_intrinsics_x86.h
+++ b/media/libaom/src/aom_dsp/simd/v128_intrinsics_x86.h
diff --git a/third_party/aom/aom_dsp/simd/v256_intrinsics.h b/media/libaom/src/aom_dsp/simd/v256_intrinsics.h
index cb99d35b7..cb99d35b7 100644
--- a/third_party/aom/aom_dsp/simd/v256_intrinsics.h
+++ b/media/libaom/src/aom_dsp/simd/v256_intrinsics.h
diff --git a/third_party/aom/aom_dsp/simd/v256_intrinsics_arm.h b/media/libaom/src/aom_dsp/simd/v256_intrinsics_arm.h
index bd86ea172..bd86ea172 100644
--- a/third_party/aom/aom_dsp/simd/v256_intrinsics_arm.h
+++ b/media/libaom/src/aom_dsp/simd/v256_intrinsics_arm.h
diff --git a/third_party/aom/aom_dsp/simd/v256_intrinsics_c.h b/media/libaom/src/aom_dsp/simd/v256_intrinsics_c.h
index a1c08e95a..a1c08e95a 100644
--- a/third_party/aom/aom_dsp/simd/v256_intrinsics_c.h
+++ b/media/libaom/src/aom_dsp/simd/v256_intrinsics_c.h
diff --git a/third_party/aom/aom_dsp/simd/v256_intrinsics_v128.h b/media/libaom/src/aom_dsp/simd/v256_intrinsics_v128.h
index d5b7905ef..d5b7905ef 100644
--- a/third_party/aom/aom_dsp/simd/v256_intrinsics_v128.h
+++ b/media/libaom/src/aom_dsp/simd/v256_intrinsics_v128.h
diff --git a/third_party/aom/aom_dsp/simd/v256_intrinsics_x86.h b/media/libaom/src/aom_dsp/simd/v256_intrinsics_x86.h
index 44594bc41..44594bc41 100644
--- a/third_party/aom/aom_dsp/simd/v256_intrinsics_x86.h
+++ b/media/libaom/src/aom_dsp/simd/v256_intrinsics_x86.h
diff --git a/third_party/aom/aom_dsp/simd/v64_intrinsics.h b/media/libaom/src/aom_dsp/simd/v64_intrinsics.h
index afc55428d..afc55428d 100644
--- a/third_party/aom/aom_dsp/simd/v64_intrinsics.h
+++ b/media/libaom/src/aom_dsp/simd/v64_intrinsics.h
diff --git a/third_party/aom/aom_dsp/simd/v64_intrinsics_arm.h b/media/libaom/src/aom_dsp/simd/v64_intrinsics_arm.h
index 8f39ad6e8..8f39ad6e8 100644
--- a/third_party/aom/aom_dsp/simd/v64_intrinsics_arm.h
+++ b/media/libaom/src/aom_dsp/simd/v64_intrinsics_arm.h
diff --git a/third_party/aom/aom_dsp/simd/v64_intrinsics_c.h b/media/libaom/src/aom_dsp/simd/v64_intrinsics_c.h
index 028d68c4f..028d68c4f 100644
--- a/third_party/aom/aom_dsp/simd/v64_intrinsics_c.h
+++ b/media/libaom/src/aom_dsp/simd/v64_intrinsics_c.h
diff --git a/third_party/aom/aom_dsp/simd/v64_intrinsics_x86.h b/media/libaom/src/aom_dsp/simd/v64_intrinsics_x86.h
index 5f9a57b37..5f9a57b37 100644
--- a/third_party/aom/aom_dsp/simd/v64_intrinsics_x86.h
+++ b/media/libaom/src/aom_dsp/simd/v64_intrinsics_x86.h
diff --git a/third_party/aom/aom_dsp/sse.c b/media/libaom/src/aom_dsp/sse.c
index 249394807..249394807 100644
--- a/third_party/aom/aom_dsp/sse.c
+++ b/media/libaom/src/aom_dsp/sse.c
diff --git a/third_party/aom/aom_dsp/ssim.c b/media/libaom/src/aom_dsp/ssim.c
index 681770ba9..681770ba9 100644
--- a/third_party/aom/aom_dsp/ssim.c
+++ b/media/libaom/src/aom_dsp/ssim.c
diff --git a/third_party/aom/aom_dsp/ssim.h b/media/libaom/src/aom_dsp/ssim.h
index 55038f4c2..55038f4c2 100644
--- a/third_party/aom/aom_dsp/ssim.h
+++ b/media/libaom/src/aom_dsp/ssim.h
diff --git a/third_party/aom/aom_dsp/subtract.c b/media/libaom/src/aom_dsp/subtract.c
index 2f6da96e5..2f6da96e5 100644
--- a/third_party/aom/aom_dsp/subtract.c
+++ b/media/libaom/src/aom_dsp/subtract.c
diff --git a/third_party/aom/aom_dsp/sum_squares.c b/media/libaom/src/aom_dsp/sum_squares.c
index 44ec41f2e..44ec41f2e 100644
--- a/third_party/aom/aom_dsp/sum_squares.c
+++ b/media/libaom/src/aom_dsp/sum_squares.c
diff --git a/third_party/aom/aom_dsp/txfm_common.h b/media/libaom/src/aom_dsp/txfm_common.h
index f98242840..f98242840 100644
--- a/third_party/aom/aom_dsp/txfm_common.h
+++ b/media/libaom/src/aom_dsp/txfm_common.h
diff --git a/third_party/aom/aom_dsp/variance.c b/media/libaom/src/aom_dsp/variance.c
index 23b715309..23b715309 100644
--- a/third_party/aom/aom_dsp/variance.c
+++ b/media/libaom/src/aom_dsp/variance.c
diff --git a/third_party/aom/aom_dsp/variance.h b/media/libaom/src/aom_dsp/variance.h
index 362da29d3..362da29d3 100644
--- a/third_party/aom/aom_dsp/variance.h
+++ b/media/libaom/src/aom_dsp/variance.h
diff --git a/third_party/aom/aom_dsp/x86/aom_asm_stubs.c b/media/libaom/src/aom_dsp/x86/aom_asm_stubs.c
index 5f5bf5f14..5f5bf5f14 100644
--- a/third_party/aom/aom_dsp/x86/aom_asm_stubs.c
+++ b/media/libaom/src/aom_dsp/x86/aom_asm_stubs.c
diff --git a/third_party/aom/aom_dsp/x86/aom_convolve_copy_sse2.asm b/media/libaom/src/aom_dsp/x86/aom_convolve_copy_sse2.asm
index 7283c32b8..7283c32b8 100644
--- a/third_party/aom/aom_dsp/x86/aom_convolve_copy_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/aom_convolve_copy_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm b/media/libaom/src/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm
index b6f040791..b6f040791 100644
--- a/third_party/aom/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/aom_high_subpixel_8t_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/aom_high_subpixel_bilinear_sse2.asm b/media/libaom/src/aom_dsp/x86/aom_high_subpixel_bilinear_sse2.asm
index 7b3fe6419..7b3fe6419 100644
--- a/third_party/aom/aom_dsp/x86/aom_high_subpixel_bilinear_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/aom_high_subpixel_bilinear_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/aom_subpixel_8t_intrin_avx2.c b/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_intrin_avx2.c
index 94b5da171..94b5da171 100644
--- a/third_party/aom/aom_dsp/x86/aom_subpixel_8t_intrin_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_intrin_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c b/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c
index 325a21b76..325a21b76 100644
--- a/third_party/aom/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c
+++ b/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_intrin_ssse3.c
diff --git a/third_party/aom/aom_dsp/x86/aom_subpixel_8t_sse2.asm b/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_sse2.asm
index c88fc9ffb..c88fc9ffb 100644
--- a/third_party/aom/aom_dsp/x86/aom_subpixel_8t_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/aom_subpixel_8t_ssse3.asm b/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_ssse3.asm
index 3ca7921b6..3ca7921b6 100644
--- a/third_party/aom/aom_dsp/x86/aom_subpixel_8t_ssse3.asm
+++ b/media/libaom/src/aom_dsp/x86/aom_subpixel_8t_ssse3.asm
diff --git a/third_party/aom/aom_dsp/x86/aom_subpixel_bilinear_sse2.asm b/media/libaom/src/aom_dsp/x86/aom_subpixel_bilinear_sse2.asm
index d0b4b2839..d0b4b2839 100644
--- a/third_party/aom/aom_dsp/x86/aom_subpixel_bilinear_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/aom_subpixel_bilinear_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/aom_subpixel_bilinear_ssse3.asm b/media/libaom/src/aom_dsp/x86/aom_subpixel_bilinear_ssse3.asm
index 59edc49a9..59edc49a9 100644
--- a/third_party/aom/aom_dsp/x86/aom_subpixel_bilinear_ssse3.asm
+++ b/media/libaom/src/aom_dsp/x86/aom_subpixel_bilinear_ssse3.asm
diff --git a/third_party/aom/aom_dsp/x86/blend_a64_hmask_sse4.c b/media/libaom/src/aom_dsp/x86/blend_a64_hmask_sse4.c
index 4f5e3f8c1..4f5e3f8c1 100644
--- a/third_party/aom/aom_dsp/x86/blend_a64_hmask_sse4.c
+++ b/media/libaom/src/aom_dsp/x86/blend_a64_hmask_sse4.c
diff --git a/third_party/aom/aom_dsp/x86/blend_a64_mask_avx2.c b/media/libaom/src/aom_dsp/x86/blend_a64_mask_avx2.c
index 67fb4d32b..67fb4d32b 100644
--- a/third_party/aom/aom_dsp/x86/blend_a64_mask_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/blend_a64_mask_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/blend_a64_mask_sse4.c b/media/libaom/src/aom_dsp/x86/blend_a64_mask_sse4.c
index 9d6b4c2f7..9d6b4c2f7 100644
--- a/third_party/aom/aom_dsp/x86/blend_a64_mask_sse4.c
+++ b/media/libaom/src/aom_dsp/x86/blend_a64_mask_sse4.c
diff --git a/third_party/aom/aom_dsp/x86/blend_a64_vmask_sse4.c b/media/libaom/src/aom_dsp/x86/blend_a64_vmask_sse4.c
index 064910232..064910232 100644
--- a/third_party/aom/aom_dsp/x86/blend_a64_vmask_sse4.c
+++ b/media/libaom/src/aom_dsp/x86/blend_a64_vmask_sse4.c
diff --git a/third_party/aom/aom_dsp/x86/blend_mask_sse4.h b/media/libaom/src/aom_dsp/x86/blend_mask_sse4.h
index c071fdcfc..c071fdcfc 100644
--- a/third_party/aom/aom_dsp/x86/blend_mask_sse4.h
+++ b/media/libaom/src/aom_dsp/x86/blend_mask_sse4.h
diff --git a/third_party/aom/aom_dsp/x86/blend_sse4.h b/media/libaom/src/aom_dsp/x86/blend_sse4.h
index 8d9b32510..8d9b32510 100644
--- a/third_party/aom/aom_dsp/x86/blend_sse4.h
+++ b/media/libaom/src/aom_dsp/x86/blend_sse4.h
diff --git a/third_party/aom/aom_dsp/x86/common_avx2.h b/media/libaom/src/aom_dsp/x86/common_avx2.h
index 96fe4ebb6..96fe4ebb6 100644
--- a/third_party/aom/aom_dsp/x86/common_avx2.h
+++ b/media/libaom/src/aom_dsp/x86/common_avx2.h
diff --git a/third_party/aom/aom_dsp/x86/convolve.h b/media/libaom/src/aom_dsp/x86/convolve.h
index 3e19682cd..3e19682cd 100644
--- a/third_party/aom/aom_dsp/x86/convolve.h
+++ b/media/libaom/src/aom_dsp/x86/convolve.h
diff --git a/third_party/aom/aom_dsp/x86/convolve_avx2.h b/media/libaom/src/aom_dsp/x86/convolve_avx2.h
index 30253f65c..30253f65c 100644
--- a/third_party/aom/aom_dsp/x86/convolve_avx2.h
+++ b/media/libaom/src/aom_dsp/x86/convolve_avx2.h
diff --git a/third_party/aom/aom_dsp/x86/convolve_common_intrin.h b/media/libaom/src/aom_dsp/x86/convolve_common_intrin.h
index 707bd2d78..707bd2d78 100644
--- a/third_party/aom/aom_dsp/x86/convolve_common_intrin.h
+++ b/media/libaom/src/aom_dsp/x86/convolve_common_intrin.h
diff --git a/third_party/aom/aom_dsp/x86/convolve_sse2.h b/media/libaom/src/aom_dsp/x86/convolve_sse2.h
index 445d04b10..445d04b10 100644
--- a/third_party/aom/aom_dsp/x86/convolve_sse2.h
+++ b/media/libaom/src/aom_dsp/x86/convolve_sse2.h
diff --git a/third_party/aom/aom_dsp/x86/convolve_sse4_1.h b/media/libaom/src/aom_dsp/x86/convolve_sse4_1.h
index 6b8388d84..6b8388d84 100644
--- a/third_party/aom/aom_dsp/x86/convolve_sse4_1.h
+++ b/media/libaom/src/aom_dsp/x86/convolve_sse4_1.h
diff --git a/third_party/aom/aom_dsp/x86/fft_avx2.c b/media/libaom/src/aom_dsp/x86/fft_avx2.c
index 54da02253..54da02253 100644
--- a/third_party/aom/aom_dsp/x86/fft_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/fft_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/fft_sse2.c b/media/libaom/src/aom_dsp/x86/fft_sse2.c
index 12bdc3e18..12bdc3e18 100644
--- a/third_party/aom/aom_dsp/x86/fft_sse2.c
+++ b/media/libaom/src/aom_dsp/x86/fft_sse2.c
diff --git a/third_party/aom/aom_dsp/x86/fwd_txfm_impl_sse2.h b/media/libaom/src/aom_dsp/x86/fwd_txfm_impl_sse2.h
index 1e3d13ec8..1e3d13ec8 100644
--- a/third_party/aom/aom_dsp/x86/fwd_txfm_impl_sse2.h
+++ b/media/libaom/src/aom_dsp/x86/fwd_txfm_impl_sse2.h
diff --git a/third_party/aom/aom_dsp/x86/fwd_txfm_sse2.c b/media/libaom/src/aom_dsp/x86/fwd_txfm_sse2.c
index 2d8f8f71e..2d8f8f71e 100644
--- a/third_party/aom/aom_dsp/x86/fwd_txfm_sse2.c
+++ b/media/libaom/src/aom_dsp/x86/fwd_txfm_sse2.c
diff --git a/third_party/aom/aom_dsp/x86/fwd_txfm_sse2.h b/media/libaom/src/aom_dsp/x86/fwd_txfm_sse2.h
index 260d8dd58..260d8dd58 100644
--- a/third_party/aom/aom_dsp/x86/fwd_txfm_sse2.h
+++ b/media/libaom/src/aom_dsp/x86/fwd_txfm_sse2.h
diff --git a/third_party/aom/aom_dsp/x86/fwd_txfm_ssse3_x86_64.asm b/media/libaom/src/aom_dsp/x86/fwd_txfm_ssse3_x86_64.asm
index c1fb259a1..c1fb259a1 100644
--- a/third_party/aom/aom_dsp/x86/fwd_txfm_ssse3_x86_64.asm
+++ b/media/libaom/src/aom_dsp/x86/fwd_txfm_ssse3_x86_64.asm
diff --git a/third_party/aom/aom_dsp/x86/highbd_convolve_avx2.c b/media/libaom/src/aom_dsp/x86/highbd_convolve_avx2.c
index 099fcf7fc..099fcf7fc 100644
--- a/third_party/aom/aom_dsp/x86/highbd_convolve_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/highbd_convolve_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/highbd_convolve_ssse3.c b/media/libaom/src/aom_dsp/x86/highbd_convolve_ssse3.c
index e7b33d1c4..e7b33d1c4 100644
--- a/third_party/aom/aom_dsp/x86/highbd_convolve_ssse3.c
+++ b/media/libaom/src/aom_dsp/x86/highbd_convolve_ssse3.c
diff --git a/third_party/aom/aom_dsp/x86/highbd_intrapred_sse2.c b/media/libaom/src/aom_dsp/x86/highbd_intrapred_sse2.c
index 5a55736c4..5a55736c4 100644
--- a/third_party/aom/aom_dsp/x86/highbd_intrapred_sse2.c
+++ b/media/libaom/src/aom_dsp/x86/highbd_intrapred_sse2.c
diff --git a/third_party/aom/aom_dsp/x86/highbd_intrapred_sse2_asm.asm b/media/libaom/src/aom_dsp/x86/highbd_intrapred_sse2_asm.asm
index 91b3d126c..91b3d126c 100644
--- a/third_party/aom/aom_dsp/x86/highbd_intrapred_sse2_asm.asm
+++ b/media/libaom/src/aom_dsp/x86/highbd_intrapred_sse2_asm.asm
diff --git a/third_party/aom/aom_dsp/x86/highbd_loopfilter_avx2.c b/media/libaom/src/aom_dsp/x86/highbd_loopfilter_avx2.c
index c954da94e..c954da94e 100644
--- a/third_party/aom/aom_dsp/x86/highbd_loopfilter_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/highbd_loopfilter_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/highbd_loopfilter_sse2.c b/media/libaom/src/aom_dsp/x86/highbd_loopfilter_sse2.c
index 097e0778f..097e0778f 100644
--- a/third_party/aom/aom_dsp/x86/highbd_loopfilter_sse2.c
+++ b/media/libaom/src/aom_dsp/x86/highbd_loopfilter_sse2.c
diff --git a/third_party/aom/aom_dsp/x86/highbd_quantize_intrin_avx2.c b/media/libaom/src/aom_dsp/x86/highbd_quantize_intrin_avx2.c
index b9689202a..b9689202a 100644
--- a/third_party/aom/aom_dsp/x86/highbd_quantize_intrin_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/highbd_quantize_intrin_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/highbd_quantize_intrin_sse2.c b/media/libaom/src/aom_dsp/x86/highbd_quantize_intrin_sse2.c
index 58e5f98e5..58e5f98e5 100644
--- a/third_party/aom/aom_dsp/x86/highbd_quantize_intrin_sse2.c
+++ b/media/libaom/src/aom_dsp/x86/highbd_quantize_intrin_sse2.c
diff --git a/third_party/aom/aom_dsp/x86/highbd_sad4d_sse2.asm b/media/libaom/src/aom_dsp/x86/highbd_sad4d_sse2.asm
index e0d22522d..e0d22522d 100644
--- a/third_party/aom/aom_dsp/x86/highbd_sad4d_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/highbd_sad4d_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/highbd_sad_sse2.asm b/media/libaom/src/aom_dsp/x86/highbd_sad_sse2.asm
index 3398d8a2a..3398d8a2a 100644
--- a/third_party/aom/aom_dsp/x86/highbd_sad_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/highbd_sad_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/highbd_subpel_variance_impl_sse2.asm b/media/libaom/src/aom_dsp/x86/highbd_subpel_variance_impl_sse2.asm
index 61f5b8e86..61f5b8e86 100644
--- a/third_party/aom/aom_dsp/x86/highbd_subpel_variance_impl_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/highbd_subpel_variance_impl_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/highbd_subtract_sse2.c b/media/libaom/src/aom_dsp/x86/highbd_subtract_sse2.c
index 18eb03d12..18eb03d12 100644
--- a/third_party/aom/aom_dsp/x86/highbd_subtract_sse2.c
+++ b/media/libaom/src/aom_dsp/x86/highbd_subtract_sse2.c
diff --git a/third_party/aom/aom_dsp/x86/highbd_variance_avx2.c b/media/libaom/src/aom_dsp/x86/highbd_variance_avx2.c
index 9b1b4c9de..9b1b4c9de 100644
--- a/third_party/aom/aom_dsp/x86/highbd_variance_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/highbd_variance_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/highbd_variance_impl_sse2.asm b/media/libaom/src/aom_dsp/x86/highbd_variance_impl_sse2.asm
index 0d954e178..0d954e178 100644
--- a/third_party/aom/aom_dsp/x86/highbd_variance_impl_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/highbd_variance_impl_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/highbd_variance_sse2.c b/media/libaom/src/aom_dsp/x86/highbd_variance_sse2.c
index 47b052abc..47b052abc 100644
--- a/third_party/aom/aom_dsp/x86/highbd_variance_sse2.c
+++ b/media/libaom/src/aom_dsp/x86/highbd_variance_sse2.c
diff --git a/third_party/aom/aom_dsp/x86/highbd_variance_sse4.c b/media/libaom/src/aom_dsp/x86/highbd_variance_sse4.c
index df5449a9d..df5449a9d 100644
--- a/third_party/aom/aom_dsp/x86/highbd_variance_sse4.c
+++ b/media/libaom/src/aom_dsp/x86/highbd_variance_sse4.c
diff --git a/third_party/aom/aom_dsp/x86/intrapred_avx2.c b/media/libaom/src/aom_dsp/x86/intrapred_avx2.c
index 1e67d392e..1e67d392e 100644
--- a/third_party/aom/aom_dsp/x86/intrapred_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/intrapred_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/intrapred_sse2.c b/media/libaom/src/aom_dsp/x86/intrapred_sse2.c
index 5b2452c8e..5b2452c8e 100644
--- a/third_party/aom/aom_dsp/x86/intrapred_sse2.c
+++ b/media/libaom/src/aom_dsp/x86/intrapred_sse2.c
diff --git a/third_party/aom/aom_dsp/x86/intrapred_sse2_asm.asm b/media/libaom/src/aom_dsp/x86/intrapred_sse2_asm.asm
index 9aece27be..9aece27be 100644
--- a/third_party/aom/aom_dsp/x86/intrapred_sse2_asm.asm
+++ b/media/libaom/src/aom_dsp/x86/intrapred_sse2_asm.asm
diff --git a/third_party/aom/aom_dsp/x86/intrapred_ssse3.c b/media/libaom/src/aom_dsp/x86/intrapred_ssse3.c
index 807ed1770..807ed1770 100644
--- a/third_party/aom/aom_dsp/x86/intrapred_ssse3.c
+++ b/media/libaom/src/aom_dsp/x86/intrapred_ssse3.c
diff --git a/third_party/aom/aom_dsp/x86/inv_wht_sse2.asm b/media/libaom/src/aom_dsp/x86/inv_wht_sse2.asm
index 0bc841a7a..0bc841a7a 100644
--- a/third_party/aom/aom_dsp/x86/inv_wht_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/inv_wht_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/jnt_sad_ssse3.c b/media/libaom/src/aom_dsp/x86/jnt_sad_ssse3.c
index c3c88245a..c3c88245a 100644
--- a/third_party/aom/aom_dsp/x86/jnt_sad_ssse3.c
+++ b/media/libaom/src/aom_dsp/x86/jnt_sad_ssse3.c
diff --git a/third_party/aom/aom_dsp/x86/jnt_variance_ssse3.c b/media/libaom/src/aom_dsp/x86/jnt_variance_ssse3.c
index f9a41a210..f9a41a210 100644
--- a/third_party/aom/aom_dsp/x86/jnt_variance_ssse3.c
+++ b/media/libaom/src/aom_dsp/x86/jnt_variance_ssse3.c
diff --git a/third_party/aom/aom_dsp/x86/loopfilter_sse2.c b/media/libaom/src/aom_dsp/x86/loopfilter_sse2.c
index 9d88b5e49..9d88b5e49 100644
--- a/third_party/aom/aom_dsp/x86/loopfilter_sse2.c
+++ b/media/libaom/src/aom_dsp/x86/loopfilter_sse2.c
diff --git a/third_party/aom/aom_dsp/x86/lpf_common_sse2.h b/media/libaom/src/aom_dsp/x86/lpf_common_sse2.h
index 8970fe7dd..8970fe7dd 100644
--- a/third_party/aom/aom_dsp/x86/lpf_common_sse2.h
+++ b/media/libaom/src/aom_dsp/x86/lpf_common_sse2.h
diff --git a/third_party/aom/aom_dsp/x86/masked_sad_intrin_avx2.c b/media/libaom/src/aom_dsp/x86/masked_sad_intrin_avx2.c
index 584b5e7e3..584b5e7e3 100644
--- a/third_party/aom/aom_dsp/x86/masked_sad_intrin_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/masked_sad_intrin_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/masked_sad_intrin_ssse3.c b/media/libaom/src/aom_dsp/x86/masked_sad_intrin_ssse3.c
index 493f9bd8f..493f9bd8f 100644
--- a/third_party/aom/aom_dsp/x86/masked_sad_intrin_ssse3.c
+++ b/media/libaom/src/aom_dsp/x86/masked_sad_intrin_ssse3.c
diff --git a/third_party/aom/aom_dsp/x86/masked_sad_intrin_ssse3.h b/media/libaom/src/aom_dsp/x86/masked_sad_intrin_ssse3.h
index cffbd9672..cffbd9672 100644
--- a/third_party/aom/aom_dsp/x86/masked_sad_intrin_ssse3.h
+++ b/media/libaom/src/aom_dsp/x86/masked_sad_intrin_ssse3.h
diff --git a/third_party/aom/aom_dsp/x86/masked_variance_intrin_ssse3.c b/media/libaom/src/aom_dsp/x86/masked_variance_intrin_ssse3.c
index d7dbefd7d..d7dbefd7d 100644
--- a/third_party/aom/aom_dsp/x86/masked_variance_intrin_ssse3.c
+++ b/media/libaom/src/aom_dsp/x86/masked_variance_intrin_ssse3.c
diff --git a/third_party/aom/aom_dsp/x86/masked_variance_intrin_ssse3.h b/media/libaom/src/aom_dsp/x86/masked_variance_intrin_ssse3.h
index 4faa098ac..4faa098ac 100644
--- a/third_party/aom/aom_dsp/x86/masked_variance_intrin_ssse3.h
+++ b/media/libaom/src/aom_dsp/x86/masked_variance_intrin_ssse3.h
diff --git a/third_party/aom/aom_dsp/x86/mem_sse2.h b/media/libaom/src/aom_dsp/x86/mem_sse2.h
index 6c821673e..6c821673e 100644
--- a/third_party/aom/aom_dsp/x86/mem_sse2.h
+++ b/media/libaom/src/aom_dsp/x86/mem_sse2.h
diff --git a/third_party/aom/aom_dsp/x86/obmc_intrinsic_sse4.h b/media/libaom/src/aom_dsp/x86/obmc_intrinsic_sse4.h
index 5181e444c..5181e444c 100644
--- a/third_party/aom/aom_dsp/x86/obmc_intrinsic_sse4.h
+++ b/media/libaom/src/aom_dsp/x86/obmc_intrinsic_sse4.h
diff --git a/third_party/aom/aom_dsp/x86/obmc_intrinsic_ssse3.h b/media/libaom/src/aom_dsp/x86/obmc_intrinsic_ssse3.h
index 48486c6c4..48486c6c4 100644
--- a/third_party/aom/aom_dsp/x86/obmc_intrinsic_ssse3.h
+++ b/media/libaom/src/aom_dsp/x86/obmc_intrinsic_ssse3.h
diff --git a/third_party/aom/aom_dsp/x86/obmc_sad_avx2.c b/media/libaom/src/aom_dsp/x86/obmc_sad_avx2.c
index 2aa2a0555..2aa2a0555 100644
--- a/third_party/aom/aom_dsp/x86/obmc_sad_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/obmc_sad_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/obmc_sad_sse4.c b/media/libaom/src/aom_dsp/x86/obmc_sad_sse4.c
index 0338a8c77..0338a8c77 100644
--- a/third_party/aom/aom_dsp/x86/obmc_sad_sse4.c
+++ b/media/libaom/src/aom_dsp/x86/obmc_sad_sse4.c
diff --git a/third_party/aom/aom_dsp/x86/obmc_variance_avx2.c b/media/libaom/src/aom_dsp/x86/obmc_variance_avx2.c
index bfec0e8a8..bfec0e8a8 100644
--- a/third_party/aom/aom_dsp/x86/obmc_variance_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/obmc_variance_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/obmc_variance_sse4.c b/media/libaom/src/aom_dsp/x86/obmc_variance_sse4.c
index 72eda0e57..72eda0e57 100644
--- a/third_party/aom/aom_dsp/x86/obmc_variance_sse4.c
+++ b/media/libaom/src/aom_dsp/x86/obmc_variance_sse4.c
diff --git a/third_party/aom/aom_dsp/x86/quantize_avx_x86_64.asm b/media/libaom/src/aom_dsp/x86/quantize_avx_x86_64.asm
index 216a0bd8f..216a0bd8f 100644
--- a/third_party/aom/aom_dsp/x86/quantize_avx_x86_64.asm
+++ b/media/libaom/src/aom_dsp/x86/quantize_avx_x86_64.asm
diff --git a/third_party/aom/aom_dsp/x86/quantize_sse2.c b/media/libaom/src/aom_dsp/x86/quantize_sse2.c
index d3de6e24d..d3de6e24d 100644
--- a/third_party/aom/aom_dsp/x86/quantize_sse2.c
+++ b/media/libaom/src/aom_dsp/x86/quantize_sse2.c
diff --git a/third_party/aom/aom_dsp/x86/quantize_ssse3_x86_64.asm b/media/libaom/src/aom_dsp/x86/quantize_ssse3_x86_64.asm
index 39d4ca674..39d4ca674 100644
--- a/third_party/aom/aom_dsp/x86/quantize_ssse3_x86_64.asm
+++ b/media/libaom/src/aom_dsp/x86/quantize_ssse3_x86_64.asm
diff --git a/third_party/aom/aom_dsp/x86/quantize_x86.h b/media/libaom/src/aom_dsp/x86/quantize_x86.h
index 4eed7dd29..4eed7dd29 100644
--- a/third_party/aom/aom_dsp/x86/quantize_x86.h
+++ b/media/libaom/src/aom_dsp/x86/quantize_x86.h
diff --git a/third_party/aom/aom_dsp/x86/sad4d_avx2.c b/media/libaom/src/aom_dsp/x86/sad4d_avx2.c
index f662b62b1..f662b62b1 100644
--- a/third_party/aom/aom_dsp/x86/sad4d_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/sad4d_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/sad4d_sse2.asm b/media/libaom/src/aom_dsp/x86/sad4d_sse2.asm
index 55a856985..55a856985 100644
--- a/third_party/aom/aom_dsp/x86/sad4d_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/sad4d_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/sad_avx2.c b/media/libaom/src/aom_dsp/x86/sad_avx2.c
index a50dba64a..a50dba64a 100644
--- a/third_party/aom/aom_dsp/x86/sad_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/sad_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/sad_highbd_avx2.c b/media/libaom/src/aom_dsp/x86/sad_highbd_avx2.c
index b506d4663..b506d4663 100644
--- a/third_party/aom/aom_dsp/x86/sad_highbd_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/sad_highbd_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/sad_impl_avx2.c b/media/libaom/src/aom_dsp/x86/sad_impl_avx2.c
index c6fd62c9e..c6fd62c9e 100644
--- a/third_party/aom/aom_dsp/x86/sad_impl_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/sad_impl_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/sad_sse2.asm b/media/libaom/src/aom_dsp/x86/sad_sse2.asm
index 3251b7655..3251b7655 100644
--- a/third_party/aom/aom_dsp/x86/sad_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/sad_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/sse_avx2.c b/media/libaom/src/aom_dsp/x86/sse_avx2.c
index 305dde5c0..305dde5c0 100644
--- a/third_party/aom/aom_dsp/x86/sse_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/sse_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/sse_sse4.c b/media/libaom/src/aom_dsp/x86/sse_sse4.c
index 8b5af8469..8b5af8469 100644
--- a/third_party/aom/aom_dsp/x86/sse_sse4.c
+++ b/media/libaom/src/aom_dsp/x86/sse_sse4.c
diff --git a/third_party/aom/aom_dsp/x86/ssim_opt_x86_64.asm b/media/libaom/src/aom_dsp/x86/ssim_opt_x86_64.asm
index 6d9b5a12f..6d9b5a12f 100644
--- a/third_party/aom/aom_dsp/x86/ssim_opt_x86_64.asm
+++ b/media/libaom/src/aom_dsp/x86/ssim_opt_x86_64.asm
diff --git a/third_party/aom/aom_dsp/x86/subpel_variance_sse2.asm b/media/libaom/src/aom_dsp/x86/subpel_variance_sse2.asm
index 45bf6ec3c..45bf6ec3c 100644
--- a/third_party/aom/aom_dsp/x86/subpel_variance_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/subpel_variance_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/subtract_avx2.c b/media/libaom/src/aom_dsp/x86/subtract_avx2.c
index 4389d123d..4389d123d 100644
--- a/third_party/aom/aom_dsp/x86/subtract_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/subtract_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/subtract_sse2.asm b/media/libaom/src/aom_dsp/x86/subtract_sse2.asm
index 1a75a234f..1a75a234f 100644
--- a/third_party/aom/aom_dsp/x86/subtract_sse2.asm
+++ b/media/libaom/src/aom_dsp/x86/subtract_sse2.asm
diff --git a/third_party/aom/aom_dsp/x86/sum_squares_avx2.c b/media/libaom/src/aom_dsp/x86/sum_squares_avx2.c
index 0af44e3a4..0af44e3a4 100644
--- a/third_party/aom/aom_dsp/x86/sum_squares_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/sum_squares_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/sum_squares_sse2.c b/media/libaom/src/aom_dsp/x86/sum_squares_sse2.c
index 22d7739ec..22d7739ec 100644
--- a/third_party/aom/aom_dsp/x86/sum_squares_sse2.c
+++ b/media/libaom/src/aom_dsp/x86/sum_squares_sse2.c
diff --git a/third_party/aom/aom_dsp/x86/sum_squares_sse2.h b/media/libaom/src/aom_dsp/x86/sum_squares_sse2.h
index 491e31cc5..491e31cc5 100644
--- a/third_party/aom/aom_dsp/x86/sum_squares_sse2.h
+++ b/media/libaom/src/aom_dsp/x86/sum_squares_sse2.h
diff --git a/third_party/aom/aom_dsp/x86/synonyms.h b/media/libaom/src/aom_dsp/x86/synonyms.h
index 1e9f1e27b..1e9f1e27b 100644
--- a/third_party/aom/aom_dsp/x86/synonyms.h
+++ b/media/libaom/src/aom_dsp/x86/synonyms.h
diff --git a/third_party/aom/aom_dsp/x86/synonyms_avx2.h b/media/libaom/src/aom_dsp/x86/synonyms_avx2.h
index 3f69b120e..3f69b120e 100644
--- a/third_party/aom/aom_dsp/x86/synonyms_avx2.h
+++ b/media/libaom/src/aom_dsp/x86/synonyms_avx2.h
diff --git a/third_party/aom/aom_dsp/x86/transpose_sse2.h b/media/libaom/src/aom_dsp/x86/transpose_sse2.h
index d0d1ee684..d0d1ee684 100644
--- a/third_party/aom/aom_dsp/x86/transpose_sse2.h
+++ b/media/libaom/src/aom_dsp/x86/transpose_sse2.h
diff --git a/third_party/aom/aom_dsp/x86/txfm_common_avx2.h b/media/libaom/src/aom_dsp/x86/txfm_common_avx2.h
index b1611ba87..b1611ba87 100644
--- a/third_party/aom/aom_dsp/x86/txfm_common_avx2.h
+++ b/media/libaom/src/aom_dsp/x86/txfm_common_avx2.h
diff --git a/third_party/aom/aom_dsp/x86/txfm_common_sse2.h b/media/libaom/src/aom_dsp/x86/txfm_common_sse2.h
index ed82eee96..ed82eee96 100644
--- a/third_party/aom/aom_dsp/x86/txfm_common_sse2.h
+++ b/media/libaom/src/aom_dsp/x86/txfm_common_sse2.h
diff --git a/third_party/aom/aom_dsp/x86/variance_avx2.c b/media/libaom/src/aom_dsp/x86/variance_avx2.c
index 800aef126..800aef126 100644
--- a/third_party/aom/aom_dsp/x86/variance_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/variance_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/variance_impl_avx2.c b/media/libaom/src/aom_dsp/x86/variance_impl_avx2.c
index 88e27aef3..88e27aef3 100644
--- a/third_party/aom/aom_dsp/x86/variance_impl_avx2.c
+++ b/media/libaom/src/aom_dsp/x86/variance_impl_avx2.c
diff --git a/third_party/aom/aom_dsp/x86/variance_impl_ssse3.c b/media/libaom/src/aom_dsp/x86/variance_impl_ssse3.c
index 66b0d7d84..66b0d7d84 100644
--- a/third_party/aom/aom_dsp/x86/variance_impl_ssse3.c
+++ b/media/libaom/src/aom_dsp/x86/variance_impl_ssse3.c
diff --git a/third_party/aom/aom_dsp/x86/variance_sse2.c b/media/libaom/src/aom_dsp/x86/variance_sse2.c
index 3c37e77c0..3c37e77c0 100644
--- a/third_party/aom/aom_dsp/x86/variance_sse2.c
+++ b/media/libaom/src/aom_dsp/x86/variance_sse2.c
diff --git a/third_party/aom/aom_mem/aom_mem.c b/media/libaom/src/aom_mem/aom_mem.c
index e603fc5bf..e603fc5bf 100644
--- a/third_party/aom/aom_mem/aom_mem.c
+++ b/media/libaom/src/aom_mem/aom_mem.c
diff --git a/third_party/aom/aom_mem/aom_mem.cmake b/media/libaom/src/aom_mem/aom_mem.cmake
index eaee8440b..eaee8440b 100644
--- a/third_party/aom/aom_mem/aom_mem.cmake
+++ b/media/libaom/src/aom_mem/aom_mem.cmake
diff --git a/third_party/aom/aom_mem/aom_mem.h b/media/libaom/src/aom_mem/aom_mem.h
index 4b1fa45f1..4b1fa45f1 100644
--- a/third_party/aom/aom_mem/aom_mem.h
+++ b/media/libaom/src/aom_mem/aom_mem.h
diff --git a/third_party/aom/aom_mem/include/aom_mem_intrnl.h b/media/libaom/src/aom_mem/include/aom_mem_intrnl.h
index cbc30a9bb..cbc30a9bb 100644
--- a/third_party/aom/aom_mem/include/aom_mem_intrnl.h
+++ b/media/libaom/src/aom_mem/include/aom_mem_intrnl.h
diff --git a/third_party/aom/aom_ports/aom_once.h b/media/libaom/src/aom_ports/aom_once.h
index 4d77aac5a..4d77aac5a 100644
--- a/third_party/aom/aom_ports/aom_once.h
+++ b/media/libaom/src/aom_ports/aom_once.h
diff --git a/third_party/aom/aom_ports/aom_ports.cmake b/media/libaom/src/aom_ports/aom_ports.cmake
index 6272fc0e3..6272fc0e3 100644
--- a/third_party/aom/aom_ports/aom_ports.cmake
+++ b/media/libaom/src/aom_ports/aom_ports.cmake
diff --git a/third_party/aom/aom_ports/aom_timer.h b/media/libaom/src/aom_ports/aom_timer.h
index 9b17b8983..9b17b8983 100644
--- a/third_party/aom/aom_ports/aom_timer.h
+++ b/media/libaom/src/aom_ports/aom_timer.h
diff --git a/third_party/aom/aom_ports/arm.h b/media/libaom/src/aom_ports/arm.h
index cb1fb9bec..cb1fb9bec 100644
--- a/third_party/aom/aom_ports/arm.h
+++ b/media/libaom/src/aom_ports/arm.h
diff --git a/third_party/aom/aom_ports/arm_cpudetect.c b/media/libaom/src/aom_ports/arm_cpudetect.c
index 5a75bb348..5a75bb348 100644
--- a/third_party/aom/aom_ports/arm_cpudetect.c
+++ b/media/libaom/src/aom_ports/arm_cpudetect.c
diff --git a/third_party/aom/aom_ports/bitops.h b/media/libaom/src/aom_ports/bitops.h
index 44df17307..44df17307 100644
--- a/third_party/aom/aom_ports/bitops.h
+++ b/media/libaom/src/aom_ports/bitops.h
diff --git a/third_party/aom/aom_ports/emmintrin_compat.h b/media/libaom/src/aom_ports/emmintrin_compat.h
index 85d218a3d..85d218a3d 100644
--- a/third_party/aom/aom_ports/emmintrin_compat.h
+++ b/media/libaom/src/aom_ports/emmintrin_compat.h
diff --git a/third_party/aom/aom_ports/emms.asm b/media/libaom/src/aom_ports/emms.asm
index 90776bacb..90776bacb 100644
--- a/third_party/aom/aom_ports/emms.asm
+++ b/media/libaom/src/aom_ports/emms.asm
diff --git a/third_party/aom/aom_ports/mem.h b/media/libaom/src/aom_ports/mem.h
index 3ffea3cd6..3ffea3cd6 100644
--- a/third_party/aom/aom_ports/mem.h
+++ b/media/libaom/src/aom_ports/mem.h
diff --git a/third_party/aom/aom_ports/mem_ops.h b/media/libaom/src/aom_ports/mem_ops.h
index 2b5bc0f0f..2b5bc0f0f 100644
--- a/third_party/aom/aom_ports/mem_ops.h
+++ b/media/libaom/src/aom_ports/mem_ops.h
diff --git a/third_party/aom/aom_ports/mem_ops_aligned.h b/media/libaom/src/aom_ports/mem_ops_aligned.h
index 37c367531..37c367531 100644
--- a/third_party/aom/aom_ports/mem_ops_aligned.h
+++ b/media/libaom/src/aom_ports/mem_ops_aligned.h
diff --git a/third_party/aom/aom_ports/msvc.h b/media/libaom/src/aom_ports/msvc.h
index e78e605f2..e78e605f2 100644
--- a/third_party/aom/aom_ports/msvc.h
+++ b/media/libaom/src/aom_ports/msvc.h
diff --git a/third_party/aom/aom_ports/ppc.h b/media/libaom/src/aom_ports/ppc.h
index 3159bda68..3159bda68 100644
--- a/third_party/aom/aom_ports/ppc.h
+++ b/media/libaom/src/aom_ports/ppc.h
diff --git a/third_party/aom/aom_ports/ppc_cpudetect.c b/media/libaom/src/aom_ports/ppc_cpudetect.c
index 82b4f58cc..82b4f58cc 100644
--- a/third_party/aom/aom_ports/ppc_cpudetect.c
+++ b/media/libaom/src/aom_ports/ppc_cpudetect.c
diff --git a/third_party/aom/aom_ports/sanitizer.h b/media/libaom/src/aom_ports/sanitizer.h
index 1dd8eb4cf..1dd8eb4cf 100644
--- a/third_party/aom/aom_ports/sanitizer.h
+++ b/media/libaom/src/aom_ports/sanitizer.h
diff --git a/third_party/aom/aom_ports/system_state.h b/media/libaom/src/aom_ports/system_state.h
index 6640839d8..6640839d8 100644
--- a/third_party/aom/aom_ports/system_state.h
+++ b/media/libaom/src/aom_ports/system_state.h
diff --git a/third_party/aom/aom_ports/x86.h b/media/libaom/src/aom_ports/x86.h
index 52ee49cb3..52ee49cb3 100644
--- a/third_party/aom/aom_ports/x86.h
+++ b/media/libaom/src/aom_ports/x86.h
diff --git a/third_party/aom/aom_ports/x86_abi_support.asm b/media/libaom/src/aom_ports/x86_abi_support.asm
index 0e7c26287..0e7c26287 100644
--- a/third_party/aom/aom_ports/x86_abi_support.asm
+++ b/media/libaom/src/aom_ports/x86_abi_support.asm
diff --git a/third_party/aom/aom_scale/aom_scale.cmake b/media/libaom/src/aom_scale/aom_scale.cmake
index 197dea6bd..197dea6bd 100644
--- a/third_party/aom/aom_scale/aom_scale.cmake
+++ b/media/libaom/src/aom_scale/aom_scale.cmake
diff --git a/third_party/aom/aom_scale/aom_scale.h b/media/libaom/src/aom_scale/aom_scale.h
index 11812a145..11812a145 100644
--- a/third_party/aom/aom_scale/aom_scale.h
+++ b/media/libaom/src/aom_scale/aom_scale.h
diff --git a/third_party/aom/aom_scale/aom_scale_rtcd.c b/media/libaom/src/aom_scale/aom_scale_rtcd.c
index a04e053b0..a04e053b0 100644
--- a/third_party/aom/aom_scale/aom_scale_rtcd.c
+++ b/media/libaom/src/aom_scale/aom_scale_rtcd.c
diff --git a/third_party/aom/aom_scale/aom_scale_rtcd.pl b/media/libaom/src/aom_scale/aom_scale_rtcd.pl
index c5990b1bb..c5990b1bb 100644
--- a/third_party/aom/aom_scale/aom_scale_rtcd.pl
+++ b/media/libaom/src/aom_scale/aom_scale_rtcd.pl
diff --git a/third_party/aom/aom_scale/generic/aom_scale.c b/media/libaom/src/aom_scale/generic/aom_scale.c
index 206c42c9f..206c42c9f 100644
--- a/third_party/aom/aom_scale/generic/aom_scale.c
+++ b/media/libaom/src/aom_scale/generic/aom_scale.c
diff --git a/third_party/aom/aom_scale/generic/gen_scalers.c b/media/libaom/src/aom_scale/generic/gen_scalers.c
index 549e2aa69..549e2aa69 100644
--- a/third_party/aom/aom_scale/generic/gen_scalers.c
+++ b/media/libaom/src/aom_scale/generic/gen_scalers.c
diff --git a/third_party/aom/aom_scale/generic/yv12config.c b/media/libaom/src/aom_scale/generic/yv12config.c
index 84705e2d8..84705e2d8 100644
--- a/third_party/aom/aom_scale/generic/yv12config.c
+++ b/media/libaom/src/aom_scale/generic/yv12config.c
diff --git a/third_party/aom/aom_scale/generic/yv12extend.c b/media/libaom/src/aom_scale/generic/yv12extend.c
index ba183520a..ba183520a 100644
--- a/third_party/aom/aom_scale/generic/yv12extend.c
+++ b/media/libaom/src/aom_scale/generic/yv12extend.c
diff --git a/third_party/aom/aom_scale/mips/dspr2/yv12extend_dspr2.c b/media/libaom/src/aom_scale/mips/dspr2/yv12extend_dspr2.c
index 869e594d7..869e594d7 100644
--- a/third_party/aom/aom_scale/mips/dspr2/yv12extend_dspr2.c
+++ b/media/libaom/src/aom_scale/mips/dspr2/yv12extend_dspr2.c
diff --git a/third_party/aom/aom_scale/yv12config.h b/media/libaom/src/aom_scale/yv12config.h
index 2fb81acd7..2fb81acd7 100644
--- a/third_party/aom/aom_scale/yv12config.h
+++ b/media/libaom/src/aom_scale/yv12config.h
diff --git a/third_party/aom/aom_util/aom_thread.c b/media/libaom/src/aom_util/aom_thread.c
index cae9f5e25..cae9f5e25 100644
--- a/third_party/aom/aom_util/aom_thread.c
+++ b/media/libaom/src/aom_util/aom_thread.c
diff --git a/third_party/aom/aom_util/aom_thread.h b/media/libaom/src/aom_util/aom_thread.h
index f14c1ac18..f14c1ac18 100644
--- a/third_party/aom/aom_util/aom_thread.h
+++ b/media/libaom/src/aom_util/aom_thread.h
diff --git a/third_party/aom/aom_util/aom_util.cmake b/media/libaom/src/aom_util/aom_util.cmake
index d4f3bce74..d4f3bce74 100644
--- a/third_party/aom/aom_util/aom_util.cmake
+++ b/media/libaom/src/aom_util/aom_util.cmake
diff --git a/third_party/aom/aom_util/debug_util.c b/media/libaom/src/aom_util/debug_util.c
index 468c47ed1..468c47ed1 100644
--- a/third_party/aom/aom_util/debug_util.c
+++ b/media/libaom/src/aom_util/debug_util.c
diff --git a/third_party/aom/aom_util/debug_util.h b/media/libaom/src/aom_util/debug_util.h
index 127a8b468..127a8b468 100644
--- a/third_party/aom/aom_util/debug_util.h
+++ b/media/libaom/src/aom_util/debug_util.h
diff --git a/third_party/aom/aom_util/endian_inl.h b/media/libaom/src/aom_util/endian_inl.h
index f536ec5b8..f536ec5b8 100644
--- a/third_party/aom/aom_util/endian_inl.h
+++ b/media/libaom/src/aom_util/endian_inl.h
diff --git a/third_party/aom/apps/aomdec.c b/media/libaom/src/apps/aomdec.c
index ff13b6f50..ff13b6f50 100644
--- a/third_party/aom/apps/aomdec.c
+++ b/media/libaom/src/apps/aomdec.c
diff --git a/third_party/aom/apps/aomenc.c b/media/libaom/src/apps/aomenc.c
index 2e5d35cfe..2e5d35cfe 100644
--- a/third_party/aom/apps/aomenc.c
+++ b/media/libaom/src/apps/aomenc.c
diff --git a/third_party/aom/apps/aomenc.h b/media/libaom/src/apps/aomenc.h
index 7c23df006..7c23df006 100644
--- a/third_party/aom/apps/aomenc.h
+++ b/media/libaom/src/apps/aomenc.h
diff --git a/third_party/aom/av1/av1.cmake b/media/libaom/src/av1/av1.cmake
index 3a7cd7ee1..3a7cd7ee1 100644
--- a/third_party/aom/av1/av1.cmake
+++ b/media/libaom/src/av1/av1.cmake
diff --git a/third_party/aom/av1/av1_cx_iface.c b/media/libaom/src/av1/av1_cx_iface.c
index 3295f618a..3295f618a 100644
--- a/third_party/aom/av1/av1_cx_iface.c
+++ b/media/libaom/src/av1/av1_cx_iface.c
diff --git a/third_party/aom/av1/av1_dx_iface.c b/media/libaom/src/av1/av1_dx_iface.c
index 4a6631047..4a6631047 100644
--- a/third_party/aom/av1/av1_dx_iface.c
+++ b/media/libaom/src/av1/av1_dx_iface.c
diff --git a/third_party/aom/av1/av1_iface_common.h b/media/libaom/src/av1/av1_iface_common.h
index 4a7af580b..4a7af580b 100644
--- a/third_party/aom/av1/av1_iface_common.h
+++ b/media/libaom/src/av1/av1_iface_common.h
diff --git a/third_party/aom/av1/common/alloccommon.c b/media/libaom/src/av1/common/alloccommon.c
index 1bf81c91d..1bf81c91d 100644
--- a/third_party/aom/av1/common/alloccommon.c
+++ b/media/libaom/src/av1/common/alloccommon.c
diff --git a/third_party/aom/av1/common/alloccommon.h b/media/libaom/src/av1/common/alloccommon.h
index 8e5896981..8e5896981 100644
--- a/third_party/aom/av1/common/alloccommon.h
+++ b/media/libaom/src/av1/common/alloccommon.h
diff --git a/third_party/aom/av1/common/arm/av1_inv_txfm_neon.c b/media/libaom/src/av1/common/arm/av1_inv_txfm_neon.c
index bad411743..bad411743 100644
--- a/third_party/aom/av1/common/arm/av1_inv_txfm_neon.c
+++ b/media/libaom/src/av1/common/arm/av1_inv_txfm_neon.c
diff --git a/third_party/aom/av1/common/arm/av1_inv_txfm_neon.h b/media/libaom/src/av1/common/arm/av1_inv_txfm_neon.h
index 9ec658291..9ec658291 100644
--- a/third_party/aom/av1/common/arm/av1_inv_txfm_neon.h
+++ b/media/libaom/src/av1/common/arm/av1_inv_txfm_neon.h
diff --git a/third_party/aom/av1/common/arm/av1_txfm_neon.c b/media/libaom/src/av1/common/arm/av1_txfm_neon.c
index de3c54724..de3c54724 100644
--- a/third_party/aom/av1/common/arm/av1_txfm_neon.c
+++ b/media/libaom/src/av1/common/arm/av1_txfm_neon.c
diff --git a/third_party/aom/av1/common/arm/blend_a64_hmask_neon.c b/media/libaom/src/av1/common/arm/blend_a64_hmask_neon.c
index 7134f183e..7134f183e 100644
--- a/third_party/aom/av1/common/arm/blend_a64_hmask_neon.c
+++ b/media/libaom/src/av1/common/arm/blend_a64_hmask_neon.c
diff --git a/third_party/aom/av1/common/arm/blend_a64_vmask_neon.c b/media/libaom/src/av1/common/arm/blend_a64_vmask_neon.c
index 194e94c8c..194e94c8c 100644
--- a/third_party/aom/av1/common/arm/blend_a64_vmask_neon.c
+++ b/media/libaom/src/av1/common/arm/blend_a64_vmask_neon.c
diff --git a/third_party/aom/av1/common/arm/cfl_neon.c b/media/libaom/src/av1/common/arm/cfl_neon.c
index 39025b5e5..39025b5e5 100644
--- a/third_party/aom/av1/common/arm/cfl_neon.c
+++ b/media/libaom/src/av1/common/arm/cfl_neon.c
diff --git a/third_party/aom/av1/common/arm/convolve_neon.c b/media/libaom/src/av1/common/arm/convolve_neon.c
index d0c4f8ff6..d0c4f8ff6 100644
--- a/third_party/aom/av1/common/arm/convolve_neon.c
+++ b/media/libaom/src/av1/common/arm/convolve_neon.c
diff --git a/third_party/aom/av1/common/arm/convolve_neon.h b/media/libaom/src/av1/common/arm/convolve_neon.h
index f382984f2..f382984f2 100644
--- a/third_party/aom/av1/common/arm/convolve_neon.h
+++ b/media/libaom/src/av1/common/arm/convolve_neon.h
diff --git a/third_party/aom/av1/common/arm/jnt_convolve_neon.c b/media/libaom/src/av1/common/arm/jnt_convolve_neon.c
index e5674ef7c..e5674ef7c 100644
--- a/third_party/aom/av1/common/arm/jnt_convolve_neon.c
+++ b/media/libaom/src/av1/common/arm/jnt_convolve_neon.c
diff --git a/third_party/aom/av1/common/arm/mem_neon.h b/media/libaom/src/av1/common/arm/mem_neon.h
index c4ae2e784..c4ae2e784 100644
--- a/third_party/aom/av1/common/arm/mem_neon.h
+++ b/media/libaom/src/av1/common/arm/mem_neon.h
diff --git a/third_party/aom/av1/common/arm/reconinter_neon.c b/media/libaom/src/av1/common/arm/reconinter_neon.c
index 44e064195..44e064195 100644
--- a/third_party/aom/av1/common/arm/reconinter_neon.c
+++ b/media/libaom/src/av1/common/arm/reconinter_neon.c
diff --git a/third_party/aom/av1/common/arm/selfguided_neon.c b/media/libaom/src/av1/common/arm/selfguided_neon.c
index b3a37c4cb..b3a37c4cb 100644
--- a/third_party/aom/av1/common/arm/selfguided_neon.c
+++ b/media/libaom/src/av1/common/arm/selfguided_neon.c
diff --git a/third_party/aom/av1/common/arm/transpose_neon.h b/media/libaom/src/av1/common/arm/transpose_neon.h
index 8a3d9f07f..8a3d9f07f 100644
--- a/third_party/aom/av1/common/arm/transpose_neon.h
+++ b/media/libaom/src/av1/common/arm/transpose_neon.h
diff --git a/third_party/aom/av1/common/arm/warp_plane_neon.c b/media/libaom/src/av1/common/arm/warp_plane_neon.c
index 7f02d42a7..7f02d42a7 100644
--- a/third_party/aom/av1/common/arm/warp_plane_neon.c
+++ b/media/libaom/src/av1/common/arm/warp_plane_neon.c
diff --git a/third_party/aom/av1/common/arm/wiener_convolve_neon.c b/media/libaom/src/av1/common/arm/wiener_convolve_neon.c
index a9bb5bcf0..a9bb5bcf0 100644
--- a/third_party/aom/av1/common/arm/wiener_convolve_neon.c
+++ b/media/libaom/src/av1/common/arm/wiener_convolve_neon.c
diff --git a/third_party/aom/av1/common/av1_inv_txfm1d.c b/media/libaom/src/av1/common/av1_inv_txfm1d.c
index 7ef2d6d7f..7ef2d6d7f 100644
--- a/third_party/aom/av1/common/av1_inv_txfm1d.c
+++ b/media/libaom/src/av1/common/av1_inv_txfm1d.c
diff --git a/third_party/aom/av1/common/av1_inv_txfm1d.h b/media/libaom/src/av1/common/av1_inv_txfm1d.h
index c31c019aa..c31c019aa 100644
--- a/third_party/aom/av1/common/av1_inv_txfm1d.h
+++ b/media/libaom/src/av1/common/av1_inv_txfm1d.h
diff --git a/third_party/aom/av1/common/av1_inv_txfm1d_cfg.h b/media/libaom/src/av1/common/av1_inv_txfm1d_cfg.h
index 7d80a0099..7d80a0099 100644
--- a/third_party/aom/av1/common/av1_inv_txfm1d_cfg.h
+++ b/media/libaom/src/av1/common/av1_inv_txfm1d_cfg.h
diff --git a/third_party/aom/av1/common/av1_inv_txfm2d.c b/media/libaom/src/av1/common/av1_inv_txfm2d.c
index 4e6944314..4e6944314 100644
--- a/third_party/aom/av1/common/av1_inv_txfm2d.c
+++ b/media/libaom/src/av1/common/av1_inv_txfm2d.c
diff --git a/third_party/aom/av1/common/av1_loopfilter.c b/media/libaom/src/av1/common/av1_loopfilter.c
index 537d8dfe9..537d8dfe9 100644
--- a/third_party/aom/av1/common/av1_loopfilter.c
+++ b/media/libaom/src/av1/common/av1_loopfilter.c
diff --git a/third_party/aom/av1/common/av1_loopfilter.h b/media/libaom/src/av1/common/av1_loopfilter.h
index 80ac61178..80ac61178 100644
--- a/third_party/aom/av1/common/av1_loopfilter.h
+++ b/media/libaom/src/av1/common/av1_loopfilter.h
diff --git a/third_party/aom/av1/common/av1_rtcd.c b/media/libaom/src/av1/common/av1_rtcd.c
index a77a4d254..a77a4d254 100644
--- a/third_party/aom/av1/common/av1_rtcd.c
+++ b/media/libaom/src/av1/common/av1_rtcd.c
diff --git a/third_party/aom/av1/common/av1_rtcd_defs.pl b/media/libaom/src/av1/common/av1_rtcd_defs.pl
index dee1f1c79..dee1f1c79 100755..100644
--- a/third_party/aom/av1/common/av1_rtcd_defs.pl
+++ b/media/libaom/src/av1/common/av1_rtcd_defs.pl
diff --git a/third_party/aom/av1/common/av1_txfm.c b/media/libaom/src/av1/common/av1_txfm.c
index bb70eab70..bb70eab70 100644
--- a/third_party/aom/av1/common/av1_txfm.c
+++ b/media/libaom/src/av1/common/av1_txfm.c
diff --git a/third_party/aom/av1/common/av1_txfm.h b/media/libaom/src/av1/common/av1_txfm.h
index 59d64ca4a..59d64ca4a 100644
--- a/third_party/aom/av1/common/av1_txfm.h
+++ b/media/libaom/src/av1/common/av1_txfm.h
diff --git a/third_party/aom/av1/common/blockd.c b/media/libaom/src/av1/common/blockd.c
index 2e796b656..2e796b656 100644
--- a/third_party/aom/av1/common/blockd.c
+++ b/media/libaom/src/av1/common/blockd.c
diff --git a/third_party/aom/av1/common/blockd.h b/media/libaom/src/av1/common/blockd.h
index a2311c1b0..a2311c1b0 100644
--- a/third_party/aom/av1/common/blockd.h
+++ b/media/libaom/src/av1/common/blockd.h
diff --git a/third_party/aom/av1/common/cdef.c b/media/libaom/src/av1/common/cdef.c
index e9e2b0e42..e9e2b0e42 100644
--- a/third_party/aom/av1/common/cdef.c
+++ b/media/libaom/src/av1/common/cdef.c
diff --git a/third_party/aom/av1/common/cdef.h b/media/libaom/src/av1/common/cdef.h
index 3b2eac8a5..3b2eac8a5 100644
--- a/third_party/aom/av1/common/cdef.h
+++ b/media/libaom/src/av1/common/cdef.h
diff --git a/third_party/aom/av1/common/cdef_block.c b/media/libaom/src/av1/common/cdef_block.c
index df1de89be..df1de89be 100644
--- a/third_party/aom/av1/common/cdef_block.c
+++ b/media/libaom/src/av1/common/cdef_block.c
diff --git a/third_party/aom/av1/common/cdef_block.h b/media/libaom/src/av1/common/cdef_block.h
index 6b4452cd6..6b4452cd6 100644
--- a/third_party/aom/av1/common/cdef_block.h
+++ b/media/libaom/src/av1/common/cdef_block.h
diff --git a/third_party/aom/av1/common/cdef_block_avx2.c b/media/libaom/src/av1/common/cdef_block_avx2.c
index e2b85b3e2..e2b85b3e2 100644
--- a/third_party/aom/av1/common/cdef_block_avx2.c
+++ b/media/libaom/src/av1/common/cdef_block_avx2.c
diff --git a/third_party/aom/av1/common/cdef_block_neon.c b/media/libaom/src/av1/common/cdef_block_neon.c
index 2d6bc65e3..2d6bc65e3 100644
--- a/third_party/aom/av1/common/cdef_block_neon.c
+++ b/media/libaom/src/av1/common/cdef_block_neon.c
diff --git a/third_party/aom/av1/common/cdef_block_simd.h b/media/libaom/src/av1/common/cdef_block_simd.h
index 14587a023..14587a023 100644
--- a/third_party/aom/av1/common/cdef_block_simd.h
+++ b/media/libaom/src/av1/common/cdef_block_simd.h
diff --git a/third_party/aom/av1/common/cdef_block_sse2.c b/media/libaom/src/av1/common/cdef_block_sse2.c
index 73f115d17..73f115d17 100644
--- a/third_party/aom/av1/common/cdef_block_sse2.c
+++ b/media/libaom/src/av1/common/cdef_block_sse2.c
diff --git a/third_party/aom/av1/common/cdef_block_sse4.c b/media/libaom/src/av1/common/cdef_block_sse4.c
index 349329af6..349329af6 100644
--- a/third_party/aom/av1/common/cdef_block_sse4.c
+++ b/media/libaom/src/av1/common/cdef_block_sse4.c
diff --git a/third_party/aom/av1/common/cdef_block_ssse3.c b/media/libaom/src/av1/common/cdef_block_ssse3.c
index 3a93b150f..3a93b150f 100644
--- a/third_party/aom/av1/common/cdef_block_ssse3.c
+++ b/media/libaom/src/av1/common/cdef_block_ssse3.c
diff --git a/third_party/aom/av1/common/cfl.c b/media/libaom/src/av1/common/cfl.c
index ccc59b4eb..ccc59b4eb 100644
--- a/third_party/aom/av1/common/cfl.c
+++ b/media/libaom/src/av1/common/cfl.c
diff --git a/third_party/aom/av1/common/cfl.h b/media/libaom/src/av1/common/cfl.h
index d627891bf..d627891bf 100644
--- a/third_party/aom/av1/common/cfl.h
+++ b/media/libaom/src/av1/common/cfl.h
diff --git a/third_party/aom/av1/common/common.h b/media/libaom/src/av1/common/common.h
index bed6083db..bed6083db 100644
--- a/third_party/aom/av1/common/common.h
+++ b/media/libaom/src/av1/common/common.h
diff --git a/third_party/aom/av1/common/common_data.h b/media/libaom/src/av1/common/common_data.h
index 46e455fdb..46e455fdb 100644
--- a/third_party/aom/av1/common/common_data.h
+++ b/media/libaom/src/av1/common/common_data.h
diff --git a/third_party/aom/av1/common/convolve.c b/media/libaom/src/av1/common/convolve.c
index 1f11126fc..1f11126fc 100644
--- a/third_party/aom/av1/common/convolve.c
+++ b/media/libaom/src/av1/common/convolve.c
diff --git a/third_party/aom/av1/common/convolve.h b/media/libaom/src/av1/common/convolve.h
index 4109dd843..4109dd843 100644
--- a/third_party/aom/av1/common/convolve.h
+++ b/media/libaom/src/av1/common/convolve.h
diff --git a/third_party/aom/av1/common/debugmodes.c b/media/libaom/src/av1/common/debugmodes.c
index 868f341b5..868f341b5 100644
--- a/third_party/aom/av1/common/debugmodes.c
+++ b/media/libaom/src/av1/common/debugmodes.c
diff --git a/third_party/aom/av1/common/entropy.c b/media/libaom/src/av1/common/entropy.c
index 4f95ef69b..4f95ef69b 100644
--- a/third_party/aom/av1/common/entropy.c
+++ b/media/libaom/src/av1/common/entropy.c
diff --git a/third_party/aom/av1/common/entropy.h b/media/libaom/src/av1/common/entropy.h
index 991692c2f..991692c2f 100644
--- a/third_party/aom/av1/common/entropy.h
+++ b/media/libaom/src/av1/common/entropy.h
diff --git a/third_party/aom/av1/common/entropymode.c b/media/libaom/src/av1/common/entropymode.c
index 41dc30ddb..41dc30ddb 100644
--- a/third_party/aom/av1/common/entropymode.c
+++ b/media/libaom/src/av1/common/entropymode.c
diff --git a/third_party/aom/av1/common/entropymode.h b/media/libaom/src/av1/common/entropymode.h
index 7047f34d2..7047f34d2 100644
--- a/third_party/aom/av1/common/entropymode.h
+++ b/media/libaom/src/av1/common/entropymode.h
diff --git a/third_party/aom/av1/common/entropymv.c b/media/libaom/src/av1/common/entropymv.c
index 491337387..491337387 100644
--- a/third_party/aom/av1/common/entropymv.c
+++ b/media/libaom/src/av1/common/entropymv.c
diff --git a/third_party/aom/av1/common/entropymv.h b/media/libaom/src/av1/common/entropymv.h
index fa818a2c1..fa818a2c1 100644
--- a/third_party/aom/av1/common/entropymv.h
+++ b/media/libaom/src/av1/common/entropymv.h
diff --git a/third_party/aom/av1/common/enums.h b/media/libaom/src/av1/common/enums.h
index 869c06ef2..869c06ef2 100644
--- a/third_party/aom/av1/common/enums.h
+++ b/media/libaom/src/av1/common/enums.h
diff --git a/third_party/aom/av1/common/filter.h b/media/libaom/src/av1/common/filter.h
index 571422d11..571422d11 100644
--- a/third_party/aom/av1/common/filter.h
+++ b/media/libaom/src/av1/common/filter.h
diff --git a/third_party/aom/av1/common/frame_buffers.c b/media/libaom/src/av1/common/frame_buffers.c
index fd6c4bc79..fd6c4bc79 100644
--- a/third_party/aom/av1/common/frame_buffers.c
+++ b/media/libaom/src/av1/common/frame_buffers.c
diff --git a/third_party/aom/av1/common/frame_buffers.h b/media/libaom/src/av1/common/frame_buffers.h
index 16188e51c..16188e51c 100644
--- a/third_party/aom/av1/common/frame_buffers.h
+++ b/media/libaom/src/av1/common/frame_buffers.h
diff --git a/third_party/aom/av1/common/idct.c b/media/libaom/src/av1/common/idct.c
index 2c1cb9827..2c1cb9827 100644
--- a/third_party/aom/av1/common/idct.c
+++ b/media/libaom/src/av1/common/idct.c
diff --git a/third_party/aom/av1/common/idct.h b/media/libaom/src/av1/common/idct.h
index d9454e73f..d9454e73f 100644
--- a/third_party/aom/av1/common/idct.h
+++ b/media/libaom/src/av1/common/idct.h
diff --git a/third_party/aom/av1/common/mv.h b/media/libaom/src/av1/common/mv.h
index 5b0225192..5b0225192 100644
--- a/third_party/aom/av1/common/mv.h
+++ b/media/libaom/src/av1/common/mv.h
diff --git a/third_party/aom/av1/common/mvref_common.c b/media/libaom/src/av1/common/mvref_common.c
index 7f24ab4e6..7f24ab4e6 100644
--- a/third_party/aom/av1/common/mvref_common.c
+++ b/media/libaom/src/av1/common/mvref_common.c
diff --git a/third_party/aom/av1/common/mvref_common.h b/media/libaom/src/av1/common/mvref_common.h
index 83f7a1ac0..83f7a1ac0 100644
--- a/third_party/aom/av1/common/mvref_common.h
+++ b/media/libaom/src/av1/common/mvref_common.h
diff --git a/third_party/aom/av1/common/obmc.h b/media/libaom/src/av1/common/obmc.h
index 1c90cd93f..1c90cd93f 100644
--- a/third_party/aom/av1/common/obmc.h
+++ b/media/libaom/src/av1/common/obmc.h
diff --git a/third_party/aom/av1/common/obu_util.c b/media/libaom/src/av1/common/obu_util.c
index 823b700b1..823b700b1 100644
--- a/third_party/aom/av1/common/obu_util.c
+++ b/media/libaom/src/av1/common/obu_util.c
diff --git a/third_party/aom/av1/common/obu_util.h b/media/libaom/src/av1/common/obu_util.h
index 7c56904c8..7c56904c8 100644
--- a/third_party/aom/av1/common/obu_util.h
+++ b/media/libaom/src/av1/common/obu_util.h
diff --git a/third_party/aom/av1/common/odintrin.c b/media/libaom/src/av1/common/odintrin.c
index 7584b2e52..7584b2e52 100644
--- a/third_party/aom/av1/common/odintrin.c
+++ b/media/libaom/src/av1/common/odintrin.c
diff --git a/third_party/aom/av1/common/odintrin.h b/media/libaom/src/av1/common/odintrin.h
index e1db0f44d..e1db0f44d 100644
--- a/third_party/aom/av1/common/odintrin.h
+++ b/media/libaom/src/av1/common/odintrin.h
diff --git a/third_party/aom/av1/common/onyxc_int.h b/media/libaom/src/av1/common/onyxc_int.h
index ff011c89e..ff011c89e 100644
--- a/third_party/aom/av1/common/onyxc_int.h
+++ b/media/libaom/src/av1/common/onyxc_int.h
diff --git a/third_party/aom/av1/common/ppc/cfl_ppc.c b/media/libaom/src/av1/common/ppc/cfl_ppc.c
index 026a07809..026a07809 100644
--- a/third_party/aom/av1/common/ppc/cfl_ppc.c
+++ b/media/libaom/src/av1/common/ppc/cfl_ppc.c
diff --git a/third_party/aom/av1/common/pred_common.c b/media/libaom/src/av1/common/pred_common.c
index 5952441d1..5952441d1 100644
--- a/third_party/aom/av1/common/pred_common.c
+++ b/media/libaom/src/av1/common/pred_common.c
diff --git a/third_party/aom/av1/common/pred_common.h b/media/libaom/src/av1/common/pred_common.h
index 6dba2322d..6dba2322d 100644
--- a/third_party/aom/av1/common/pred_common.h
+++ b/media/libaom/src/av1/common/pred_common.h
diff --git a/third_party/aom/av1/common/quant_common.c b/media/libaom/src/av1/common/quant_common.c
index 0e14da7a3..0e14da7a3 100644
--- a/third_party/aom/av1/common/quant_common.c
+++ b/media/libaom/src/av1/common/quant_common.c
diff --git a/third_party/aom/av1/common/quant_common.h b/media/libaom/src/av1/common/quant_common.h
index d1f52a660..d1f52a660 100644
--- a/third_party/aom/av1/common/quant_common.h
+++ b/media/libaom/src/av1/common/quant_common.h
diff --git a/third_party/aom/av1/common/reconinter.c b/media/libaom/src/av1/common/reconinter.c
index 3203efce4..3203efce4 100644
--- a/third_party/aom/av1/common/reconinter.c
+++ b/media/libaom/src/av1/common/reconinter.c
diff --git a/third_party/aom/av1/common/reconinter.h b/media/libaom/src/av1/common/reconinter.h
index db86c777e..db86c777e 100644
--- a/third_party/aom/av1/common/reconinter.h
+++ b/media/libaom/src/av1/common/reconinter.h
diff --git a/third_party/aom/av1/common/reconintra.c b/media/libaom/src/av1/common/reconintra.c
index 71a52e73e..71a52e73e 100644
--- a/third_party/aom/av1/common/reconintra.c
+++ b/media/libaom/src/av1/common/reconintra.c
diff --git a/third_party/aom/av1/common/reconintra.h b/media/libaom/src/av1/common/reconintra.h
index 07853aba0..07853aba0 100644
--- a/third_party/aom/av1/common/reconintra.h
+++ b/media/libaom/src/av1/common/reconintra.h
diff --git a/third_party/aom/av1/common/resize.c b/media/libaom/src/av1/common/resize.c
index d61a20aa2..d61a20aa2 100644
--- a/third_party/aom/av1/common/resize.c
+++ b/media/libaom/src/av1/common/resize.c
diff --git a/third_party/aom/av1/common/resize.h b/media/libaom/src/av1/common/resize.h
index 9a59a8d63..9a59a8d63 100644
--- a/third_party/aom/av1/common/resize.h
+++ b/media/libaom/src/av1/common/resize.h
diff --git a/third_party/aom/av1/common/restoration.c b/media/libaom/src/av1/common/restoration.c
index d276a915b..d276a915b 100644
--- a/third_party/aom/av1/common/restoration.c
+++ b/media/libaom/src/av1/common/restoration.c
diff --git a/third_party/aom/av1/common/restoration.h b/media/libaom/src/av1/common/restoration.h
index d834f9270..d834f9270 100644
--- a/third_party/aom/av1/common/restoration.h
+++ b/media/libaom/src/av1/common/restoration.h
diff --git a/third_party/aom/av1/common/scale.c b/media/libaom/src/av1/common/scale.c
index c525fe229..c525fe229 100644
--- a/third_party/aom/av1/common/scale.c
+++ b/media/libaom/src/av1/common/scale.c
diff --git a/third_party/aom/av1/common/scale.h b/media/libaom/src/av1/common/scale.h
index 748e958c3..748e958c3 100644
--- a/third_party/aom/av1/common/scale.h
+++ b/media/libaom/src/av1/common/scale.h
diff --git a/third_party/aom/av1/common/scan.c b/media/libaom/src/av1/common/scan.c
index 31a787b53..31a787b53 100644
--- a/third_party/aom/av1/common/scan.c
+++ b/media/libaom/src/av1/common/scan.c
diff --git a/third_party/aom/av1/common/scan.h b/media/libaom/src/av1/common/scan.h
index 233dc0efa..233dc0efa 100644
--- a/third_party/aom/av1/common/scan.h
+++ b/media/libaom/src/av1/common/scan.h
diff --git a/third_party/aom/av1/common/seg_common.c b/media/libaom/src/av1/common/seg_common.c
index cd189ad76..cd189ad76 100644
--- a/third_party/aom/av1/common/seg_common.c
+++ b/media/libaom/src/av1/common/seg_common.c
diff --git a/third_party/aom/av1/common/seg_common.h b/media/libaom/src/av1/common/seg_common.h
index 8c35bba86..8c35bba86 100644
--- a/third_party/aom/av1/common/seg_common.h
+++ b/media/libaom/src/av1/common/seg_common.h
diff --git a/third_party/aom/av1/common/thread_common.c b/media/libaom/src/av1/common/thread_common.c
index 8df4c9a09..8df4c9a09 100644
--- a/third_party/aom/av1/common/thread_common.c
+++ b/media/libaom/src/av1/common/thread_common.c
diff --git a/third_party/aom/av1/common/thread_common.h b/media/libaom/src/av1/common/thread_common.h
index 23d61d72a..23d61d72a 100644
--- a/third_party/aom/av1/common/thread_common.h
+++ b/media/libaom/src/av1/common/thread_common.h
diff --git a/third_party/aom/av1/common/tile_common.c b/media/libaom/src/av1/common/tile_common.c
index 1b413487f..1b413487f 100644
--- a/third_party/aom/av1/common/tile_common.c
+++ b/media/libaom/src/av1/common/tile_common.c
diff --git a/third_party/aom/av1/common/tile_common.h b/media/libaom/src/av1/common/tile_common.h
index c03553dc6..c03553dc6 100644
--- a/third_party/aom/av1/common/tile_common.h
+++ b/media/libaom/src/av1/common/tile_common.h
diff --git a/third_party/aom/av1/common/timing.c b/media/libaom/src/av1/common/timing.c
index 49dbde78f..49dbde78f 100644
--- a/third_party/aom/av1/common/timing.c
+++ b/media/libaom/src/av1/common/timing.c
diff --git a/third_party/aom/av1/common/timing.h b/media/libaom/src/av1/common/timing.h
index 06939ae43..06939ae43 100644
--- a/third_party/aom/av1/common/timing.h
+++ b/media/libaom/src/av1/common/timing.h
diff --git a/third_party/aom/av1/common/token_cdfs.h b/media/libaom/src/av1/common/token_cdfs.h
index 53e956450..53e956450 100644
--- a/third_party/aom/av1/common/token_cdfs.h
+++ b/media/libaom/src/av1/common/token_cdfs.h
diff --git a/third_party/aom/av1/common/txb_common.c b/media/libaom/src/av1/common/txb_common.c
index c96d37cca..c96d37cca 100644
--- a/third_party/aom/av1/common/txb_common.c
+++ b/media/libaom/src/av1/common/txb_common.c
diff --git a/third_party/aom/av1/common/txb_common.h b/media/libaom/src/av1/common/txb_common.h
index 1dda51f8b..1dda51f8b 100644
--- a/third_party/aom/av1/common/txb_common.h
+++ b/media/libaom/src/av1/common/txb_common.h
diff --git a/third_party/aom/av1/common/warped_motion.c b/media/libaom/src/av1/common/warped_motion.c
index 4144c4389..4144c4389 100644
--- a/third_party/aom/av1/common/warped_motion.c
+++ b/media/libaom/src/av1/common/warped_motion.c
diff --git a/third_party/aom/av1/common/warped_motion.h b/media/libaom/src/av1/common/warped_motion.h
index a1a4f067d..a1a4f067d 100644
--- a/third_party/aom/av1/common/warped_motion.h
+++ b/media/libaom/src/av1/common/warped_motion.h
diff --git a/third_party/aom/av1/common/x86/av1_convolve_horiz_rs_sse4.c b/media/libaom/src/av1/common/x86/av1_convolve_horiz_rs_sse4.c
index 8aa14696f..8aa14696f 100644
--- a/third_party/aom/av1/common/x86/av1_convolve_horiz_rs_sse4.c
+++ b/media/libaom/src/av1/common/x86/av1_convolve_horiz_rs_sse4.c
diff --git a/third_party/aom/av1/common/x86/av1_convolve_scale_sse4.c b/media/libaom/src/av1/common/x86/av1_convolve_scale_sse4.c
index d9fb53785..d9fb53785 100644
--- a/third_party/aom/av1/common/x86/av1_convolve_scale_sse4.c
+++ b/media/libaom/src/av1/common/x86/av1_convolve_scale_sse4.c
diff --git a/third_party/aom/av1/common/x86/av1_highbd_convolve_sse4.c b/media/libaom/src/av1/common/x86/av1_highbd_convolve_sse4.c
index 212d3bd72..212d3bd72 100644
--- a/third_party/aom/av1/common/x86/av1_highbd_convolve_sse4.c
+++ b/media/libaom/src/av1/common/x86/av1_highbd_convolve_sse4.c
diff --git a/third_party/aom/av1/common/x86/av1_inv_txfm_avx2.c b/media/libaom/src/av1/common/x86/av1_inv_txfm_avx2.c
index 5db2ccf6c..5db2ccf6c 100644
--- a/third_party/aom/av1/common/x86/av1_inv_txfm_avx2.c
+++ b/media/libaom/src/av1/common/x86/av1_inv_txfm_avx2.c
diff --git a/third_party/aom/av1/common/x86/av1_inv_txfm_avx2.h b/media/libaom/src/av1/common/x86/av1_inv_txfm_avx2.h
index f74cbaeaa..f74cbaeaa 100644
--- a/third_party/aom/av1/common/x86/av1_inv_txfm_avx2.h
+++ b/media/libaom/src/av1/common/x86/av1_inv_txfm_avx2.h
diff --git a/third_party/aom/av1/common/x86/av1_inv_txfm_ssse3.c b/media/libaom/src/av1/common/x86/av1_inv_txfm_ssse3.c
index 995bc3da4..995bc3da4 100644
--- a/third_party/aom/av1/common/x86/av1_inv_txfm_ssse3.c
+++ b/media/libaom/src/av1/common/x86/av1_inv_txfm_ssse3.c
diff --git a/third_party/aom/av1/common/x86/av1_inv_txfm_ssse3.h b/media/libaom/src/av1/common/x86/av1_inv_txfm_ssse3.h
index 66bd339d1..66bd339d1 100644
--- a/third_party/aom/av1/common/x86/av1_inv_txfm_ssse3.h
+++ b/media/libaom/src/av1/common/x86/av1_inv_txfm_ssse3.h
diff --git a/third_party/aom/av1/common/x86/av1_txfm_sse2.h b/media/libaom/src/av1/common/x86/av1_txfm_sse2.h
index 77aeb6eb1..77aeb6eb1 100644
--- a/third_party/aom/av1/common/x86/av1_txfm_sse2.h
+++ b/media/libaom/src/av1/common/x86/av1_txfm_sse2.h
diff --git a/third_party/aom/av1/common/x86/av1_txfm_sse4.c b/media/libaom/src/av1/common/x86/av1_txfm_sse4.c
index 90b9879cc..90b9879cc 100644
--- a/third_party/aom/av1/common/x86/av1_txfm_sse4.c
+++ b/media/libaom/src/av1/common/x86/av1_txfm_sse4.c
diff --git a/third_party/aom/av1/common/x86/av1_txfm_sse4.h b/media/libaom/src/av1/common/x86/av1_txfm_sse4.h
index 6cad821b1..6cad821b1 100644
--- a/third_party/aom/av1/common/x86/av1_txfm_sse4.h
+++ b/media/libaom/src/av1/common/x86/av1_txfm_sse4.h
diff --git a/third_party/aom/av1/common/x86/cfl_avx2.c b/media/libaom/src/av1/common/x86/cfl_avx2.c
index a8bfdcce6..a8bfdcce6 100644
--- a/third_party/aom/av1/common/x86/cfl_avx2.c
+++ b/media/libaom/src/av1/common/x86/cfl_avx2.c
diff --git a/third_party/aom/av1/common/x86/cfl_simd.h b/media/libaom/src/av1/common/x86/cfl_simd.h
index 3b342cd4e..3b342cd4e 100644
--- a/third_party/aom/av1/common/x86/cfl_simd.h
+++ b/media/libaom/src/av1/common/x86/cfl_simd.h
diff --git a/third_party/aom/av1/common/x86/cfl_sse2.c b/media/libaom/src/av1/common/x86/cfl_sse2.c
index 4783fe098..4783fe098 100644
--- a/third_party/aom/av1/common/x86/cfl_sse2.c
+++ b/media/libaom/src/av1/common/x86/cfl_sse2.c
diff --git a/third_party/aom/av1/common/x86/cfl_ssse3.c b/media/libaom/src/av1/common/x86/cfl_ssse3.c
index bbf007295..bbf007295 100644
--- a/third_party/aom/av1/common/x86/cfl_ssse3.c
+++ b/media/libaom/src/av1/common/x86/cfl_ssse3.c
diff --git a/third_party/aom/av1/common/x86/convolve_2d_avx2.c b/media/libaom/src/av1/common/x86/convolve_2d_avx2.c
index 0acafd044..0acafd044 100644
--- a/third_party/aom/av1/common/x86/convolve_2d_avx2.c
+++ b/media/libaom/src/av1/common/x86/convolve_2d_avx2.c
diff --git a/third_party/aom/av1/common/x86/convolve_2d_sse2.c b/media/libaom/src/av1/common/x86/convolve_2d_sse2.c
index b1a62a4f6..b1a62a4f6 100644
--- a/third_party/aom/av1/common/x86/convolve_2d_sse2.c
+++ b/media/libaom/src/av1/common/x86/convolve_2d_sse2.c
diff --git a/third_party/aom/av1/common/x86/convolve_avx2.c b/media/libaom/src/av1/common/x86/convolve_avx2.c
index 0e91ea947..0e91ea947 100644
--- a/third_party/aom/av1/common/x86/convolve_avx2.c
+++ b/media/libaom/src/av1/common/x86/convolve_avx2.c
diff --git a/third_party/aom/av1/common/x86/convolve_sse2.c b/media/libaom/src/av1/common/x86/convolve_sse2.c
index 5016642de..5016642de 100644
--- a/third_party/aom/av1/common/x86/convolve_sse2.c
+++ b/media/libaom/src/av1/common/x86/convolve_sse2.c
diff --git a/third_party/aom/av1/common/x86/filterintra_sse4.c b/media/libaom/src/av1/common/x86/filterintra_sse4.c
index c11edc1d4..c11edc1d4 100644
--- a/third_party/aom/av1/common/x86/filterintra_sse4.c
+++ b/media/libaom/src/av1/common/x86/filterintra_sse4.c
diff --git a/third_party/aom/av1/common/x86/highbd_convolve_2d_avx2.c b/media/libaom/src/av1/common/x86/highbd_convolve_2d_avx2.c
index ae68f0bbb..ae68f0bbb 100644
--- a/third_party/aom/av1/common/x86/highbd_convolve_2d_avx2.c
+++ b/media/libaom/src/av1/common/x86/highbd_convolve_2d_avx2.c
diff --git a/third_party/aom/av1/common/x86/highbd_convolve_2d_sse2.c b/media/libaom/src/av1/common/x86/highbd_convolve_2d_sse2.c
index 15f8872c1..15f8872c1 100644
--- a/third_party/aom/av1/common/x86/highbd_convolve_2d_sse2.c
+++ b/media/libaom/src/av1/common/x86/highbd_convolve_2d_sse2.c
diff --git a/third_party/aom/av1/common/x86/highbd_convolve_2d_sse4.c b/media/libaom/src/av1/common/x86/highbd_convolve_2d_sse4.c
index 3f8dafb4b..3f8dafb4b 100644
--- a/third_party/aom/av1/common/x86/highbd_convolve_2d_sse4.c
+++ b/media/libaom/src/av1/common/x86/highbd_convolve_2d_sse4.c
diff --git a/third_party/aom/av1/common/x86/highbd_convolve_2d_ssse3.c b/media/libaom/src/av1/common/x86/highbd_convolve_2d_ssse3.c
index 1d029db39..1d029db39 100644
--- a/third_party/aom/av1/common/x86/highbd_convolve_2d_ssse3.c
+++ b/media/libaom/src/av1/common/x86/highbd_convolve_2d_ssse3.c
diff --git a/third_party/aom/av1/common/x86/highbd_inv_txfm_avx2.c b/media/libaom/src/av1/common/x86/highbd_inv_txfm_avx2.c
index ade2af03e..ade2af03e 100644
--- a/third_party/aom/av1/common/x86/highbd_inv_txfm_avx2.c
+++ b/media/libaom/src/av1/common/x86/highbd_inv_txfm_avx2.c
diff --git a/third_party/aom/av1/common/x86/highbd_inv_txfm_sse4.c b/media/libaom/src/av1/common/x86/highbd_inv_txfm_sse4.c
index e29e0baf5..e29e0baf5 100644
--- a/third_party/aom/av1/common/x86/highbd_inv_txfm_sse4.c
+++ b/media/libaom/src/av1/common/x86/highbd_inv_txfm_sse4.c
diff --git a/third_party/aom/av1/common/x86/highbd_jnt_convolve_avx2.c b/media/libaom/src/av1/common/x86/highbd_jnt_convolve_avx2.c
index e298cf653..e298cf653 100644
--- a/third_party/aom/av1/common/x86/highbd_jnt_convolve_avx2.c
+++ b/media/libaom/src/av1/common/x86/highbd_jnt_convolve_avx2.c
diff --git a/third_party/aom/av1/common/x86/highbd_jnt_convolve_sse4.c b/media/libaom/src/av1/common/x86/highbd_jnt_convolve_sse4.c
index 1a29985b5..1a29985b5 100644
--- a/third_party/aom/av1/common/x86/highbd_jnt_convolve_sse4.c
+++ b/media/libaom/src/av1/common/x86/highbd_jnt_convolve_sse4.c
diff --git a/third_party/aom/av1/common/x86/highbd_txfm_utility_sse4.h b/media/libaom/src/av1/common/x86/highbd_txfm_utility_sse4.h
index 6f24e5948..6f24e5948 100644
--- a/third_party/aom/av1/common/x86/highbd_txfm_utility_sse4.h
+++ b/media/libaom/src/av1/common/x86/highbd_txfm_utility_sse4.h
diff --git a/third_party/aom/av1/common/x86/highbd_warp_plane_sse4.c b/media/libaom/src/av1/common/x86/highbd_warp_plane_sse4.c
index 4bcab0564..4bcab0564 100644
--- a/third_party/aom/av1/common/x86/highbd_warp_plane_sse4.c
+++ b/media/libaom/src/av1/common/x86/highbd_warp_plane_sse4.c
diff --git a/third_party/aom/av1/common/x86/highbd_wiener_convolve_avx2.c b/media/libaom/src/av1/common/x86/highbd_wiener_convolve_avx2.c
index 0c8a8505b..0c8a8505b 100644
--- a/third_party/aom/av1/common/x86/highbd_wiener_convolve_avx2.c
+++ b/media/libaom/src/av1/common/x86/highbd_wiener_convolve_avx2.c
diff --git a/third_party/aom/av1/common/x86/highbd_wiener_convolve_ssse3.c b/media/libaom/src/av1/common/x86/highbd_wiener_convolve_ssse3.c
index 818b1099c..818b1099c 100644
--- a/third_party/aom/av1/common/x86/highbd_wiener_convolve_ssse3.c
+++ b/media/libaom/src/av1/common/x86/highbd_wiener_convolve_ssse3.c
diff --git a/third_party/aom/av1/common/x86/intra_edge_sse4.c b/media/libaom/src/av1/common/x86/intra_edge_sse4.c
index 0c857b583..0c857b583 100644
--- a/third_party/aom/av1/common/x86/intra_edge_sse4.c
+++ b/media/libaom/src/av1/common/x86/intra_edge_sse4.c
diff --git a/third_party/aom/av1/common/x86/jnt_convolve_avx2.c b/media/libaom/src/av1/common/x86/jnt_convolve_avx2.c
index 9f2e2b457..9f2e2b457 100644
--- a/third_party/aom/av1/common/x86/jnt_convolve_avx2.c
+++ b/media/libaom/src/av1/common/x86/jnt_convolve_avx2.c
diff --git a/third_party/aom/av1/common/x86/jnt_convolve_sse2.c b/media/libaom/src/av1/common/x86/jnt_convolve_sse2.c
index 87dc3242e..87dc3242e 100644
--- a/third_party/aom/av1/common/x86/jnt_convolve_sse2.c
+++ b/media/libaom/src/av1/common/x86/jnt_convolve_sse2.c
diff --git a/third_party/aom/av1/common/x86/jnt_convolve_ssse3.c b/media/libaom/src/av1/common/x86/jnt_convolve_ssse3.c
index 822772782..822772782 100644
--- a/third_party/aom/av1/common/x86/jnt_convolve_ssse3.c
+++ b/media/libaom/src/av1/common/x86/jnt_convolve_ssse3.c
diff --git a/third_party/aom/av1/common/x86/reconinter_avx2.c b/media/libaom/src/av1/common/x86/reconinter_avx2.c
index f645e0454..f645e0454 100644
--- a/third_party/aom/av1/common/x86/reconinter_avx2.c
+++ b/media/libaom/src/av1/common/x86/reconinter_avx2.c
diff --git a/third_party/aom/av1/common/x86/reconinter_sse4.c b/media/libaom/src/av1/common/x86/reconinter_sse4.c
index 5171ca493..5171ca493 100644
--- a/third_party/aom/av1/common/x86/reconinter_sse4.c
+++ b/media/libaom/src/av1/common/x86/reconinter_sse4.c
diff --git a/third_party/aom/av1/common/x86/reconinter_ssse3.c b/media/libaom/src/av1/common/x86/reconinter_ssse3.c
index cf684447c..cf684447c 100644
--- a/third_party/aom/av1/common/x86/reconinter_ssse3.c
+++ b/media/libaom/src/av1/common/x86/reconinter_ssse3.c
diff --git a/third_party/aom/av1/common/x86/selfguided_avx2.c b/media/libaom/src/av1/common/x86/selfguided_avx2.c
index 0aaf1f454..0aaf1f454 100644
--- a/third_party/aom/av1/common/x86/selfguided_avx2.c
+++ b/media/libaom/src/av1/common/x86/selfguided_avx2.c
diff --git a/third_party/aom/av1/common/x86/selfguided_sse4.c b/media/libaom/src/av1/common/x86/selfguided_sse4.c
index ea3f6d942..ea3f6d942 100644
--- a/third_party/aom/av1/common/x86/selfguided_sse4.c
+++ b/media/libaom/src/av1/common/x86/selfguided_sse4.c
diff --git a/third_party/aom/av1/common/x86/warp_plane_sse4.c b/media/libaom/src/av1/common/x86/warp_plane_sse4.c
index b810cea2e..b810cea2e 100644
--- a/third_party/aom/av1/common/x86/warp_plane_sse4.c
+++ b/media/libaom/src/av1/common/x86/warp_plane_sse4.c
diff --git a/third_party/aom/av1/common/x86/wiener_convolve_avx2.c b/media/libaom/src/av1/common/x86/wiener_convolve_avx2.c
index 87a6e1239..87a6e1239 100644
--- a/third_party/aom/av1/common/x86/wiener_convolve_avx2.c
+++ b/media/libaom/src/av1/common/x86/wiener_convolve_avx2.c
diff --git a/third_party/aom/av1/common/x86/wiener_convolve_sse2.c b/media/libaom/src/av1/common/x86/wiener_convolve_sse2.c
index f9d00b733..f9d00b733 100644
--- a/third_party/aom/av1/common/x86/wiener_convolve_sse2.c
+++ b/media/libaom/src/av1/common/x86/wiener_convolve_sse2.c
diff --git a/third_party/aom/av1/decoder/accounting.c b/media/libaom/src/av1/decoder/accounting.c
index 8d8f3dfdb..8d8f3dfdb 100644
--- a/third_party/aom/av1/decoder/accounting.c
+++ b/media/libaom/src/av1/decoder/accounting.c
diff --git a/third_party/aom/av1/decoder/accounting.h b/media/libaom/src/av1/decoder/accounting.h
index 288e5e63e..288e5e63e 100644
--- a/third_party/aom/av1/decoder/accounting.h
+++ b/media/libaom/src/av1/decoder/accounting.h
diff --git a/third_party/aom/av1/decoder/decodeframe.c b/media/libaom/src/av1/decoder/decodeframe.c
index 31f14b531..31f14b531 100644
--- a/third_party/aom/av1/decoder/decodeframe.c
+++ b/media/libaom/src/av1/decoder/decodeframe.c
diff --git a/third_party/aom/av1/decoder/decodeframe.h b/media/libaom/src/av1/decoder/decodeframe.h
index ddad273f1..ddad273f1 100644
--- a/third_party/aom/av1/decoder/decodeframe.h
+++ b/media/libaom/src/av1/decoder/decodeframe.h
diff --git a/third_party/aom/av1/decoder/decodemv.c b/media/libaom/src/av1/decoder/decodemv.c
index 551e4d543..551e4d543 100644
--- a/third_party/aom/av1/decoder/decodemv.c
+++ b/media/libaom/src/av1/decoder/decodemv.c
diff --git a/third_party/aom/av1/decoder/decodemv.h b/media/libaom/src/av1/decoder/decodemv.h
index 1625e5bd2..1625e5bd2 100644
--- a/third_party/aom/av1/decoder/decodemv.h
+++ b/media/libaom/src/av1/decoder/decodemv.h
diff --git a/third_party/aom/av1/decoder/decoder.c b/media/libaom/src/av1/decoder/decoder.c
index a5f4fd67f..a5f4fd67f 100644
--- a/third_party/aom/av1/decoder/decoder.c
+++ b/media/libaom/src/av1/decoder/decoder.c
diff --git a/third_party/aom/av1/decoder/decoder.h b/media/libaom/src/av1/decoder/decoder.h
index 5ca939c24..5ca939c24 100644
--- a/third_party/aom/av1/decoder/decoder.h
+++ b/media/libaom/src/av1/decoder/decoder.h
diff --git a/third_party/aom/av1/decoder/decodetxb.c b/media/libaom/src/av1/decoder/decodetxb.c
index f3ef2d55e..f3ef2d55e 100644
--- a/third_party/aom/av1/decoder/decodetxb.c
+++ b/media/libaom/src/av1/decoder/decodetxb.c
diff --git a/third_party/aom/av1/decoder/decodetxb.h b/media/libaom/src/av1/decoder/decodetxb.h
index fe04f6abd..fe04f6abd 100644
--- a/third_party/aom/av1/decoder/decodetxb.h
+++ b/media/libaom/src/av1/decoder/decodetxb.h
diff --git a/third_party/aom/av1/decoder/detokenize.c b/media/libaom/src/av1/decoder/detokenize.c
index 9d54bd13d..9d54bd13d 100644
--- a/third_party/aom/av1/decoder/detokenize.c
+++ b/media/libaom/src/av1/decoder/detokenize.c
diff --git a/third_party/aom/av1/decoder/detokenize.h b/media/libaom/src/av1/decoder/detokenize.h
index 173b437a9..173b437a9 100644
--- a/third_party/aom/av1/decoder/detokenize.h
+++ b/media/libaom/src/av1/decoder/detokenize.h
diff --git a/third_party/aom/av1/decoder/dthread.c b/media/libaom/src/av1/decoder/dthread.c
index 3946c787a..3946c787a 100644
--- a/third_party/aom/av1/decoder/dthread.c
+++ b/media/libaom/src/av1/decoder/dthread.c
diff --git a/third_party/aom/av1/decoder/dthread.h b/media/libaom/src/av1/decoder/dthread.h
index 1d264b07e..1d264b07e 100644
--- a/third_party/aom/av1/decoder/dthread.h
+++ b/media/libaom/src/av1/decoder/dthread.h
diff --git a/third_party/aom/av1/decoder/inspection.c b/media/libaom/src/av1/decoder/inspection.c
index e6c89298a..e6c89298a 100644
--- a/third_party/aom/av1/decoder/inspection.c
+++ b/media/libaom/src/av1/decoder/inspection.c
diff --git a/third_party/aom/av1/decoder/inspection.h b/media/libaom/src/av1/decoder/inspection.h
index 7214a9bed..7214a9bed 100644
--- a/third_party/aom/av1/decoder/inspection.h
+++ b/media/libaom/src/av1/decoder/inspection.h
diff --git a/third_party/aom/av1/decoder/obu.c b/media/libaom/src/av1/decoder/obu.c
index 44ecf818e..44ecf818e 100644
--- a/third_party/aom/av1/decoder/obu.c
+++ b/media/libaom/src/av1/decoder/obu.c
diff --git a/third_party/aom/av1/decoder/obu.h b/media/libaom/src/av1/decoder/obu.h
index 5ab243fc9..5ab243fc9 100644
--- a/third_party/aom/av1/decoder/obu.h
+++ b/media/libaom/src/av1/decoder/obu.h
diff --git a/third_party/aom/av1/encoder/aq_complexity.c b/media/libaom/src/av1/encoder/aq_complexity.c
index 80f8e2e66..80f8e2e66 100644
--- a/third_party/aom/av1/encoder/aq_complexity.c
+++ b/media/libaom/src/av1/encoder/aq_complexity.c
diff --git a/third_party/aom/av1/encoder/aq_complexity.h b/media/libaom/src/av1/encoder/aq_complexity.h
index 3421d74c9..3421d74c9 100644
--- a/third_party/aom/av1/encoder/aq_complexity.h
+++ b/media/libaom/src/av1/encoder/aq_complexity.h
diff --git a/third_party/aom/av1/encoder/aq_cyclicrefresh.c b/media/libaom/src/av1/encoder/aq_cyclicrefresh.c
index f532d48da..f532d48da 100644
--- a/third_party/aom/av1/encoder/aq_cyclicrefresh.c
+++ b/media/libaom/src/av1/encoder/aq_cyclicrefresh.c
diff --git a/third_party/aom/av1/encoder/aq_cyclicrefresh.h b/media/libaom/src/av1/encoder/aq_cyclicrefresh.h
index b45781983..b45781983 100644
--- a/third_party/aom/av1/encoder/aq_cyclicrefresh.h
+++ b/media/libaom/src/av1/encoder/aq_cyclicrefresh.h
diff --git a/third_party/aom/av1/encoder/aq_variance.c b/media/libaom/src/av1/encoder/aq_variance.c
index 58f906bdc..58f906bdc 100644
--- a/third_party/aom/av1/encoder/aq_variance.c
+++ b/media/libaom/src/av1/encoder/aq_variance.c
diff --git a/third_party/aom/av1/encoder/aq_variance.h b/media/libaom/src/av1/encoder/aq_variance.h
index 2d22b663e..2d22b663e 100644
--- a/third_party/aom/av1/encoder/aq_variance.h
+++ b/media/libaom/src/av1/encoder/aq_variance.h
diff --git a/third_party/aom/av1/encoder/arm/neon/quantize_neon.c b/media/libaom/src/av1/encoder/arm/neon/quantize_neon.c
index 36e7d3370..36e7d3370 100644
--- a/third_party/aom/av1/encoder/arm/neon/quantize_neon.c
+++ b/media/libaom/src/av1/encoder/arm/neon/quantize_neon.c
diff --git a/third_party/aom/av1/encoder/av1_fwd_txfm1d.c b/media/libaom/src/av1/encoder/av1_fwd_txfm1d.c
index 98505e0b1..98505e0b1 100644
--- a/third_party/aom/av1/encoder/av1_fwd_txfm1d.c
+++ b/media/libaom/src/av1/encoder/av1_fwd_txfm1d.c
diff --git a/third_party/aom/av1/encoder/av1_fwd_txfm1d.h b/media/libaom/src/av1/encoder/av1_fwd_txfm1d.h
index 9dcf16552..9dcf16552 100644
--- a/third_party/aom/av1/encoder/av1_fwd_txfm1d.h
+++ b/media/libaom/src/av1/encoder/av1_fwd_txfm1d.h
diff --git a/third_party/aom/av1/encoder/av1_fwd_txfm1d_cfg.h b/media/libaom/src/av1/encoder/av1_fwd_txfm1d_cfg.h
index 98b6530db..98b6530db 100644
--- a/third_party/aom/av1/encoder/av1_fwd_txfm1d_cfg.h
+++ b/media/libaom/src/av1/encoder/av1_fwd_txfm1d_cfg.h
diff --git a/third_party/aom/av1/encoder/av1_fwd_txfm2d.c b/media/libaom/src/av1/encoder/av1_fwd_txfm2d.c
index f25a667cf..f25a667cf 100644
--- a/third_party/aom/av1/encoder/av1_fwd_txfm2d.c
+++ b/media/libaom/src/av1/encoder/av1_fwd_txfm2d.c
diff --git a/third_party/aom/av1/encoder/av1_quantize.c b/media/libaom/src/av1/encoder/av1_quantize.c
index a0a926005..a0a926005 100644
--- a/third_party/aom/av1/encoder/av1_quantize.c
+++ b/media/libaom/src/av1/encoder/av1_quantize.c
diff --git a/third_party/aom/av1/encoder/av1_quantize.h b/media/libaom/src/av1/encoder/av1_quantize.h
index 35af9a67a..35af9a67a 100644
--- a/third_party/aom/av1/encoder/av1_quantize.h
+++ b/media/libaom/src/av1/encoder/av1_quantize.h
diff --git a/third_party/aom/av1/encoder/bitstream.c b/media/libaom/src/av1/encoder/bitstream.c
index 2c4acdb02..2c4acdb02 100644
--- a/third_party/aom/av1/encoder/bitstream.c
+++ b/media/libaom/src/av1/encoder/bitstream.c
diff --git a/third_party/aom/av1/encoder/bitstream.h b/media/libaom/src/av1/encoder/bitstream.h
index 465ccaed5..465ccaed5 100644
--- a/third_party/aom/av1/encoder/bitstream.h
+++ b/media/libaom/src/av1/encoder/bitstream.h
diff --git a/third_party/aom/av1/encoder/block.h b/media/libaom/src/av1/encoder/block.h
index 0bc5dea82..0bc5dea82 100644
--- a/third_party/aom/av1/encoder/block.h
+++ b/media/libaom/src/av1/encoder/block.h
diff --git a/third_party/aom/av1/encoder/blockiness.c b/media/libaom/src/av1/encoder/blockiness.c
index f7cff9e53..f7cff9e53 100644
--- a/third_party/aom/av1/encoder/blockiness.c
+++ b/media/libaom/src/av1/encoder/blockiness.c
diff --git a/third_party/aom/av1/encoder/context_tree.c b/media/libaom/src/av1/encoder/context_tree.c
index 57f59f304..57f59f304 100644
--- a/third_party/aom/av1/encoder/context_tree.c
+++ b/media/libaom/src/av1/encoder/context_tree.c
diff --git a/third_party/aom/av1/encoder/context_tree.h b/media/libaom/src/av1/encoder/context_tree.h
index 4efc34985..4efc34985 100644
--- a/third_party/aom/av1/encoder/context_tree.h
+++ b/media/libaom/src/av1/encoder/context_tree.h
diff --git a/third_party/aom/av1/encoder/corner_detect.c b/media/libaom/src/av1/encoder/corner_detect.c
index e4c59dd9c..e4c59dd9c 100644
--- a/third_party/aom/av1/encoder/corner_detect.c
+++ b/media/libaom/src/av1/encoder/corner_detect.c
diff --git a/third_party/aom/av1/encoder/corner_detect.h b/media/libaom/src/av1/encoder/corner_detect.h
index cab59a774..cab59a774 100644
--- a/third_party/aom/av1/encoder/corner_detect.h
+++ b/media/libaom/src/av1/encoder/corner_detect.h
diff --git a/third_party/aom/av1/encoder/corner_match.c b/media/libaom/src/av1/encoder/corner_match.c
index 29e934deb..29e934deb 100644
--- a/third_party/aom/av1/encoder/corner_match.c
+++ b/media/libaom/src/av1/encoder/corner_match.c
diff --git a/third_party/aom/av1/encoder/corner_match.h b/media/libaom/src/av1/encoder/corner_match.h
index 535d2faed..535d2faed 100644
--- a/third_party/aom/av1/encoder/corner_match.h
+++ b/media/libaom/src/av1/encoder/corner_match.h
diff --git a/third_party/aom/av1/encoder/cost.c b/media/libaom/src/av1/encoder/cost.c
index 323e2aed5..323e2aed5 100644
--- a/third_party/aom/av1/encoder/cost.c
+++ b/media/libaom/src/av1/encoder/cost.c
diff --git a/third_party/aom/av1/encoder/cost.h b/media/libaom/src/av1/encoder/cost.h
index af5b09837..af5b09837 100644
--- a/third_party/aom/av1/encoder/cost.h
+++ b/media/libaom/src/av1/encoder/cost.h
diff --git a/third_party/aom/av1/encoder/dwt.c b/media/libaom/src/av1/encoder/dwt.c
index 04088b25f..04088b25f 100644
--- a/third_party/aom/av1/encoder/dwt.c
+++ b/media/libaom/src/av1/encoder/dwt.c
diff --git a/third_party/aom/av1/encoder/dwt.h b/media/libaom/src/av1/encoder/dwt.h
index 37306c6a5..37306c6a5 100644
--- a/third_party/aom/av1/encoder/dwt.h
+++ b/media/libaom/src/av1/encoder/dwt.h
diff --git a/third_party/aom/av1/encoder/encodeframe.c b/media/libaom/src/av1/encoder/encodeframe.c
index cb226c59e..cb226c59e 100644
--- a/third_party/aom/av1/encoder/encodeframe.c
+++ b/media/libaom/src/av1/encoder/encodeframe.c
diff --git a/third_party/aom/av1/encoder/encodeframe.h b/media/libaom/src/av1/encoder/encodeframe.h
index e8cf9b468..e8cf9b468 100644
--- a/third_party/aom/av1/encoder/encodeframe.h
+++ b/media/libaom/src/av1/encoder/encodeframe.h
diff --git a/third_party/aom/av1/encoder/encodemb.c b/media/libaom/src/av1/encoder/encodemb.c
index ad12577e6..ad12577e6 100644
--- a/third_party/aom/av1/encoder/encodemb.c
+++ b/media/libaom/src/av1/encoder/encodemb.c
diff --git a/third_party/aom/av1/encoder/encodemb.h b/media/libaom/src/av1/encoder/encodemb.h
index 39080de59..39080de59 100644
--- a/third_party/aom/av1/encoder/encodemb.h
+++ b/media/libaom/src/av1/encoder/encodemb.h
diff --git a/third_party/aom/av1/encoder/encodemv.c b/media/libaom/src/av1/encoder/encodemv.c
index 42eb5abf6..42eb5abf6 100644
--- a/third_party/aom/av1/encoder/encodemv.c
+++ b/media/libaom/src/av1/encoder/encodemv.c
diff --git a/third_party/aom/av1/encoder/encodemv.h b/media/libaom/src/av1/encoder/encodemv.h
index 37ff547c8..37ff547c8 100644
--- a/third_party/aom/av1/encoder/encodemv.h
+++ b/media/libaom/src/av1/encoder/encodemv.h
diff --git a/third_party/aom/av1/encoder/encoder.c b/media/libaom/src/av1/encoder/encoder.c
index a2da2df89..a2da2df89 100644
--- a/third_party/aom/av1/encoder/encoder.c
+++ b/media/libaom/src/av1/encoder/encoder.c
diff --git a/third_party/aom/av1/encoder/encoder.h b/media/libaom/src/av1/encoder/encoder.h
index ee7fc4637..ee7fc4637 100644
--- a/third_party/aom/av1/encoder/encoder.h
+++ b/media/libaom/src/av1/encoder/encoder.h
diff --git a/third_party/aom/av1/encoder/encodetxb.c b/media/libaom/src/av1/encoder/encodetxb.c
index 5a31d93d7..5a31d93d7 100644
--- a/third_party/aom/av1/encoder/encodetxb.c
+++ b/media/libaom/src/av1/encoder/encodetxb.c
diff --git a/third_party/aom/av1/encoder/encodetxb.h b/media/libaom/src/av1/encoder/encodetxb.h
index 40ae343b0..40ae343b0 100644
--- a/third_party/aom/av1/encoder/encodetxb.h
+++ b/media/libaom/src/av1/encoder/encodetxb.h
diff --git a/third_party/aom/av1/encoder/ethread.c b/media/libaom/src/av1/encoder/ethread.c
index e8ac30bb5..e8ac30bb5 100644
--- a/third_party/aom/av1/encoder/ethread.c
+++ b/media/libaom/src/av1/encoder/ethread.c
diff --git a/third_party/aom/av1/encoder/ethread.h b/media/libaom/src/av1/encoder/ethread.h
index 5de4b4803..5de4b4803 100644
--- a/third_party/aom/av1/encoder/ethread.h
+++ b/media/libaom/src/av1/encoder/ethread.h
diff --git a/third_party/aom/av1/encoder/extend.c b/media/libaom/src/av1/encoder/extend.c
index e9621a574..e9621a574 100644
--- a/third_party/aom/av1/encoder/extend.c
+++ b/media/libaom/src/av1/encoder/extend.c
diff --git a/third_party/aom/av1/encoder/extend.h b/media/libaom/src/av1/encoder/extend.h
index e0432cc97..e0432cc97 100644
--- a/third_party/aom/av1/encoder/extend.h
+++ b/media/libaom/src/av1/encoder/extend.h
diff --git a/third_party/aom/av1/encoder/firstpass.c b/media/libaom/src/av1/encoder/firstpass.c
index 69dd20c52..69dd20c52 100644
--- a/third_party/aom/av1/encoder/firstpass.c
+++ b/media/libaom/src/av1/encoder/firstpass.c
diff --git a/third_party/aom/av1/encoder/firstpass.h b/media/libaom/src/av1/encoder/firstpass.h
index 4b7325ae2..4b7325ae2 100644
--- a/third_party/aom/av1/encoder/firstpass.h
+++ b/media/libaom/src/av1/encoder/firstpass.h
diff --git a/third_party/aom/av1/encoder/global_motion.c b/media/libaom/src/av1/encoder/global_motion.c
index e9f8b0bb4..e9f8b0bb4 100644
--- a/third_party/aom/av1/encoder/global_motion.c
+++ b/media/libaom/src/av1/encoder/global_motion.c
diff --git a/third_party/aom/av1/encoder/global_motion.h b/media/libaom/src/av1/encoder/global_motion.h
index c7c016c43..c7c016c43 100644
--- a/third_party/aom/av1/encoder/global_motion.h
+++ b/media/libaom/src/av1/encoder/global_motion.h
diff --git a/third_party/aom/av1/encoder/grain_test_vectors.h b/media/libaom/src/av1/encoder/grain_test_vectors.h
index 945dc3733..945dc3733 100644
--- a/third_party/aom/av1/encoder/grain_test_vectors.h
+++ b/media/libaom/src/av1/encoder/grain_test_vectors.h
diff --git a/third_party/aom/av1/encoder/hash.c b/media/libaom/src/av1/encoder/hash.c
index 180115d9f..180115d9f 100644
--- a/third_party/aom/av1/encoder/hash.c
+++ b/media/libaom/src/av1/encoder/hash.c
diff --git a/third_party/aom/av1/encoder/hash.h b/media/libaom/src/av1/encoder/hash.h
index 826c004d6..826c004d6 100644
--- a/third_party/aom/av1/encoder/hash.h
+++ b/media/libaom/src/av1/encoder/hash.h
diff --git a/third_party/aom/av1/encoder/hash_motion.c b/media/libaom/src/av1/encoder/hash_motion.c
index e85a516e8..e85a516e8 100644
--- a/third_party/aom/av1/encoder/hash_motion.c
+++ b/media/libaom/src/av1/encoder/hash_motion.c
diff --git a/third_party/aom/av1/encoder/hash_motion.h b/media/libaom/src/av1/encoder/hash_motion.h
index df3ec3215..df3ec3215 100644
--- a/third_party/aom/av1/encoder/hash_motion.h
+++ b/media/libaom/src/av1/encoder/hash_motion.h
diff --git a/third_party/aom/av1/encoder/hybrid_fwd_txfm.c b/media/libaom/src/av1/encoder/hybrid_fwd_txfm.c
index 67898fd18..67898fd18 100644
--- a/third_party/aom/av1/encoder/hybrid_fwd_txfm.c
+++ b/media/libaom/src/av1/encoder/hybrid_fwd_txfm.c
diff --git a/third_party/aom/av1/encoder/hybrid_fwd_txfm.h b/media/libaom/src/av1/encoder/hybrid_fwd_txfm.h
index daabc7119..daabc7119 100644
--- a/third_party/aom/av1/encoder/hybrid_fwd_txfm.h
+++ b/media/libaom/src/av1/encoder/hybrid_fwd_txfm.h
diff --git a/third_party/aom/av1/encoder/k_means_template.h b/media/libaom/src/av1/encoder/k_means_template.h
index 9e526b88b..9e526b88b 100644
--- a/third_party/aom/av1/encoder/k_means_template.h
+++ b/media/libaom/src/av1/encoder/k_means_template.h
diff --git a/third_party/aom/av1/encoder/lookahead.c b/media/libaom/src/av1/encoder/lookahead.c
index 1bf8ecbac..1bf8ecbac 100644
--- a/third_party/aom/av1/encoder/lookahead.c
+++ b/media/libaom/src/av1/encoder/lookahead.c
diff --git a/third_party/aom/av1/encoder/lookahead.h b/media/libaom/src/av1/encoder/lookahead.h
index e55224cf7..e55224cf7 100644
--- a/third_party/aom/av1/encoder/lookahead.h
+++ b/media/libaom/src/av1/encoder/lookahead.h
diff --git a/third_party/aom/av1/encoder/mathutils.h b/media/libaom/src/av1/encoder/mathutils.h
index 64f936176..64f936176 100644
--- a/third_party/aom/av1/encoder/mathutils.h
+++ b/media/libaom/src/av1/encoder/mathutils.h
diff --git a/third_party/aom/av1/encoder/mbgraph.c b/media/libaom/src/av1/encoder/mbgraph.c
index 1a35ff77c..1a35ff77c 100644
--- a/third_party/aom/av1/encoder/mbgraph.c
+++ b/media/libaom/src/av1/encoder/mbgraph.c
diff --git a/third_party/aom/av1/encoder/mbgraph.h b/media/libaom/src/av1/encoder/mbgraph.h
index ba08476f7..ba08476f7 100644
--- a/third_party/aom/av1/encoder/mbgraph.h
+++ b/media/libaom/src/av1/encoder/mbgraph.h
diff --git a/third_party/aom/av1/encoder/mcomp.c b/media/libaom/src/av1/encoder/mcomp.c
index 8f6de9b53..8f6de9b53 100644
--- a/third_party/aom/av1/encoder/mcomp.c
+++ b/media/libaom/src/av1/encoder/mcomp.c
diff --git a/third_party/aom/av1/encoder/mcomp.h b/media/libaom/src/av1/encoder/mcomp.h
index a975218b0..a975218b0 100644
--- a/third_party/aom/av1/encoder/mcomp.h
+++ b/media/libaom/src/av1/encoder/mcomp.h
diff --git a/third_party/aom/av1/encoder/mips/msa/error_msa.c b/media/libaom/src/av1/encoder/mips/msa/error_msa.c
index 2e86dee43..2e86dee43 100644
--- a/third_party/aom/av1/encoder/mips/msa/error_msa.c
+++ b/media/libaom/src/av1/encoder/mips/msa/error_msa.c
diff --git a/third_party/aom/av1/encoder/mips/msa/fdct4x4_msa.c b/media/libaom/src/av1/encoder/mips/msa/fdct4x4_msa.c
index 085c08bfb..085c08bfb 100644
--- a/third_party/aom/av1/encoder/mips/msa/fdct4x4_msa.c
+++ b/media/libaom/src/av1/encoder/mips/msa/fdct4x4_msa.c
diff --git a/third_party/aom/av1/encoder/mips/msa/temporal_filter_msa.c b/media/libaom/src/av1/encoder/mips/msa/temporal_filter_msa.c
index 531ae090a..531ae090a 100644
--- a/third_party/aom/av1/encoder/mips/msa/temporal_filter_msa.c
+++ b/media/libaom/src/av1/encoder/mips/msa/temporal_filter_msa.c
diff --git a/third_party/aom/av1/encoder/ml.c b/media/libaom/src/av1/encoder/ml.c
index d21def43a..d21def43a 100644
--- a/third_party/aom/av1/encoder/ml.c
+++ b/media/libaom/src/av1/encoder/ml.c
diff --git a/third_party/aom/av1/encoder/ml.h b/media/libaom/src/av1/encoder/ml.h
index cb8ef2871..cb8ef2871 100644
--- a/third_party/aom/av1/encoder/ml.h
+++ b/media/libaom/src/av1/encoder/ml.h
diff --git a/third_party/aom/av1/encoder/palette.c b/media/libaom/src/av1/encoder/palette.c
index e61cd02ce..e61cd02ce 100644
--- a/third_party/aom/av1/encoder/palette.c
+++ b/media/libaom/src/av1/encoder/palette.c
diff --git a/third_party/aom/av1/encoder/palette.h b/media/libaom/src/av1/encoder/palette.h
index 8b88c4755..8b88c4755 100644
--- a/third_party/aom/av1/encoder/palette.h
+++ b/media/libaom/src/av1/encoder/palette.h
diff --git a/third_party/aom/av1/encoder/partition_model_weights.h b/media/libaom/src/av1/encoder/partition_model_weights.h
index 437ea43f9..437ea43f9 100644
--- a/third_party/aom/av1/encoder/partition_model_weights.h
+++ b/media/libaom/src/av1/encoder/partition_model_weights.h
diff --git a/third_party/aom/av1/encoder/pickcdef.c b/media/libaom/src/av1/encoder/pickcdef.c
index 6d154a7d2..6d154a7d2 100644
--- a/third_party/aom/av1/encoder/pickcdef.c
+++ b/media/libaom/src/av1/encoder/pickcdef.c
diff --git a/third_party/aom/av1/encoder/picklpf.c b/media/libaom/src/av1/encoder/picklpf.c
index c5508e25c..c5508e25c 100644
--- a/third_party/aom/av1/encoder/picklpf.c
+++ b/media/libaom/src/av1/encoder/picklpf.c
diff --git a/third_party/aom/av1/encoder/picklpf.h b/media/libaom/src/av1/encoder/picklpf.h
index 357097ae1..357097ae1 100644
--- a/third_party/aom/av1/encoder/picklpf.h
+++ b/media/libaom/src/av1/encoder/picklpf.h
diff --git a/third_party/aom/av1/encoder/pickrst.c b/media/libaom/src/av1/encoder/pickrst.c
index e7804f6b4..e7804f6b4 100644
--- a/third_party/aom/av1/encoder/pickrst.c
+++ b/media/libaom/src/av1/encoder/pickrst.c
diff --git a/third_party/aom/av1/encoder/pickrst.h b/media/libaom/src/av1/encoder/pickrst.h
index 3fec0c34b..3fec0c34b 100644
--- a/third_party/aom/av1/encoder/pickrst.h
+++ b/media/libaom/src/av1/encoder/pickrst.h
diff --git a/third_party/aom/av1/encoder/pustats.h b/media/libaom/src/av1/encoder/pustats.h
index 40dd46768..40dd46768 100644
--- a/third_party/aom/av1/encoder/pustats.h
+++ b/media/libaom/src/av1/encoder/pustats.h
diff --git a/third_party/aom/av1/encoder/random.h b/media/libaom/src/av1/encoder/random.h
index 0bca39102..0bca39102 100644
--- a/third_party/aom/av1/encoder/random.h
+++ b/media/libaom/src/av1/encoder/random.h
diff --git a/third_party/aom/av1/encoder/ransac.c b/media/libaom/src/av1/encoder/ransac.c
index 781f528eb..781f528eb 100644
--- a/third_party/aom/av1/encoder/ransac.c
+++ b/media/libaom/src/av1/encoder/ransac.c
diff --git a/third_party/aom/av1/encoder/ransac.h b/media/libaom/src/av1/encoder/ransac.h
index c429f2ce5..c429f2ce5 100644
--- a/third_party/aom/av1/encoder/ransac.h
+++ b/media/libaom/src/av1/encoder/ransac.h
diff --git a/third_party/aom/av1/encoder/rate_distortion_model_params.h b/media/libaom/src/av1/encoder/rate_distortion_model_params.h
index 7cd0962c5..7cd0962c5 100644
--- a/third_party/aom/av1/encoder/rate_distortion_model_params.h
+++ b/media/libaom/src/av1/encoder/rate_distortion_model_params.h
diff --git a/third_party/aom/av1/encoder/ratectrl.c b/media/libaom/src/av1/encoder/ratectrl.c
index 2597fb990..2597fb990 100644
--- a/third_party/aom/av1/encoder/ratectrl.c
+++ b/media/libaom/src/av1/encoder/ratectrl.c
diff --git a/third_party/aom/av1/encoder/ratectrl.h b/media/libaom/src/av1/encoder/ratectrl.h
index 198ecab97..198ecab97 100644
--- a/third_party/aom/av1/encoder/ratectrl.h
+++ b/media/libaom/src/av1/encoder/ratectrl.h
diff --git a/third_party/aom/av1/encoder/rd.c b/media/libaom/src/av1/encoder/rd.c
index b87d89e50..b87d89e50 100644
--- a/third_party/aom/av1/encoder/rd.c
+++ b/media/libaom/src/av1/encoder/rd.c
diff --git a/third_party/aom/av1/encoder/rd.h b/media/libaom/src/av1/encoder/rd.h
index 755b61df5..755b61df5 100644
--- a/third_party/aom/av1/encoder/rd.h
+++ b/media/libaom/src/av1/encoder/rd.h
diff --git a/third_party/aom/av1/encoder/rdopt.c b/media/libaom/src/av1/encoder/rdopt.c
index c2d15534f..c2d15534f 100644
--- a/third_party/aom/av1/encoder/rdopt.c
+++ b/media/libaom/src/av1/encoder/rdopt.c
diff --git a/third_party/aom/av1/encoder/rdopt.h b/media/libaom/src/av1/encoder/rdopt.h
index 4c11f90b8..4c11f90b8 100644
--- a/third_party/aom/av1/encoder/rdopt.h
+++ b/media/libaom/src/av1/encoder/rdopt.h
diff --git a/third_party/aom/av1/encoder/reconinter_enc.c b/media/libaom/src/av1/encoder/reconinter_enc.c
index 23d920fc3..23d920fc3 100644
--- a/third_party/aom/av1/encoder/reconinter_enc.c
+++ b/media/libaom/src/av1/encoder/reconinter_enc.c
diff --git a/third_party/aom/av1/encoder/reconinter_enc.h b/media/libaom/src/av1/encoder/reconinter_enc.h
index 10d5e8c28..10d5e8c28 100644
--- a/third_party/aom/av1/encoder/reconinter_enc.h
+++ b/media/libaom/src/av1/encoder/reconinter_enc.h
diff --git a/third_party/aom/av1/encoder/segmentation.c b/media/libaom/src/av1/encoder/segmentation.c
index 2e9102745..2e9102745 100644
--- a/third_party/aom/av1/encoder/segmentation.c
+++ b/media/libaom/src/av1/encoder/segmentation.c
diff --git a/third_party/aom/av1/encoder/segmentation.h b/media/libaom/src/av1/encoder/segmentation.h
index 1ad13d66a..1ad13d66a 100644
--- a/third_party/aom/av1/encoder/segmentation.h
+++ b/media/libaom/src/av1/encoder/segmentation.h
diff --git a/third_party/aom/av1/encoder/speed_features.c b/media/libaom/src/av1/encoder/speed_features.c
index 4c35baae0..4c35baae0 100644
--- a/third_party/aom/av1/encoder/speed_features.c
+++ b/media/libaom/src/av1/encoder/speed_features.c
diff --git a/third_party/aom/av1/encoder/speed_features.h b/media/libaom/src/av1/encoder/speed_features.h
index 41013b2e7..41013b2e7 100644
--- a/third_party/aom/av1/encoder/speed_features.h
+++ b/media/libaom/src/av1/encoder/speed_features.h
diff --git a/third_party/aom/av1/encoder/temporal_filter.c b/media/libaom/src/av1/encoder/temporal_filter.c
index 75fdf02a5..75fdf02a5 100644
--- a/third_party/aom/av1/encoder/temporal_filter.c
+++ b/media/libaom/src/av1/encoder/temporal_filter.c
diff --git a/third_party/aom/av1/encoder/temporal_filter.h b/media/libaom/src/av1/encoder/temporal_filter.h
index 2ddc68b2c..2ddc68b2c 100644
--- a/third_party/aom/av1/encoder/temporal_filter.h
+++ b/media/libaom/src/av1/encoder/temporal_filter.h
diff --git a/third_party/aom/av1/encoder/tokenize.c b/media/libaom/src/av1/encoder/tokenize.c
index 16a6a9a35..16a6a9a35 100644
--- a/third_party/aom/av1/encoder/tokenize.c
+++ b/media/libaom/src/av1/encoder/tokenize.c
diff --git a/third_party/aom/av1/encoder/tokenize.h b/media/libaom/src/av1/encoder/tokenize.h
index 63b505f36..63b505f36 100644
--- a/third_party/aom/av1/encoder/tokenize.h
+++ b/media/libaom/src/av1/encoder/tokenize.h
diff --git a/third_party/aom/av1/encoder/tx_prune_model_weights.h b/media/libaom/src/av1/encoder/tx_prune_model_weights.h
index 405bc9e6e..405bc9e6e 100644
--- a/third_party/aom/av1/encoder/tx_prune_model_weights.h
+++ b/media/libaom/src/av1/encoder/tx_prune_model_weights.h
diff --git a/third_party/aom/av1/encoder/wedge_utils.c b/media/libaom/src/av1/encoder/wedge_utils.c
index e6edbb6af..e6edbb6af 100644
--- a/third_party/aom/av1/encoder/wedge_utils.c
+++ b/media/libaom/src/av1/encoder/wedge_utils.c
diff --git a/third_party/aom/av1/encoder/x86/av1_fwd_txfm1d_sse4.c b/media/libaom/src/av1/encoder/x86/av1_fwd_txfm1d_sse4.c
index 07615543c..07615543c 100644
--- a/third_party/aom/av1/encoder/x86/av1_fwd_txfm1d_sse4.c
+++ b/media/libaom/src/av1/encoder/x86/av1_fwd_txfm1d_sse4.c
diff --git a/third_party/aom/av1/encoder/x86/av1_fwd_txfm2d_avx2.c b/media/libaom/src/av1/encoder/x86/av1_fwd_txfm2d_avx2.c
index 592462e20..592462e20 100644
--- a/third_party/aom/av1/encoder/x86/av1_fwd_txfm2d_avx2.c
+++ b/media/libaom/src/av1/encoder/x86/av1_fwd_txfm2d_avx2.c
diff --git a/third_party/aom/av1/encoder/x86/av1_fwd_txfm2d_sse4.c b/media/libaom/src/av1/encoder/x86/av1_fwd_txfm2d_sse4.c
index 8ec0256eb..8ec0256eb 100644
--- a/third_party/aom/av1/encoder/x86/av1_fwd_txfm2d_sse4.c
+++ b/media/libaom/src/av1/encoder/x86/av1_fwd_txfm2d_sse4.c
diff --git a/third_party/aom/av1/encoder/x86/av1_fwd_txfm_avx2.h b/media/libaom/src/av1/encoder/x86/av1_fwd_txfm_avx2.h
index 38707137c..38707137c 100644
--- a/third_party/aom/av1/encoder/x86/av1_fwd_txfm_avx2.h
+++ b/media/libaom/src/av1/encoder/x86/av1_fwd_txfm_avx2.h
diff --git a/third_party/aom/av1/encoder/x86/av1_fwd_txfm_sse2.c b/media/libaom/src/av1/encoder/x86/av1_fwd_txfm_sse2.c
index 6aae7ce1e..6aae7ce1e 100644
--- a/third_party/aom/av1/encoder/x86/av1_fwd_txfm_sse2.c
+++ b/media/libaom/src/av1/encoder/x86/av1_fwd_txfm_sse2.c
diff --git a/third_party/aom/av1/encoder/x86/av1_fwd_txfm_sse2.h b/media/libaom/src/av1/encoder/x86/av1_fwd_txfm_sse2.h
index 99a6b9082..99a6b9082 100644
--- a/third_party/aom/av1/encoder/x86/av1_fwd_txfm_sse2.h
+++ b/media/libaom/src/av1/encoder/x86/av1_fwd_txfm_sse2.h
diff --git a/third_party/aom/av1/encoder/x86/av1_highbd_quantize_avx2.c b/media/libaom/src/av1/encoder/x86/av1_highbd_quantize_avx2.c
index b58911fcb..b58911fcb 100644
--- a/third_party/aom/av1/encoder/x86/av1_highbd_quantize_avx2.c
+++ b/media/libaom/src/av1/encoder/x86/av1_highbd_quantize_avx2.c
diff --git a/third_party/aom/av1/encoder/x86/av1_highbd_quantize_sse4.c b/media/libaom/src/av1/encoder/x86/av1_highbd_quantize_sse4.c
index 40b3b460b..40b3b460b 100644
--- a/third_party/aom/av1/encoder/x86/av1_highbd_quantize_sse4.c
+++ b/media/libaom/src/av1/encoder/x86/av1_highbd_quantize_sse4.c
diff --git a/third_party/aom/av1/encoder/x86/av1_quantize_avx2.c b/media/libaom/src/av1/encoder/x86/av1_quantize_avx2.c
index df22aaba7..df22aaba7 100644
--- a/third_party/aom/av1/encoder/x86/av1_quantize_avx2.c
+++ b/media/libaom/src/av1/encoder/x86/av1_quantize_avx2.c
diff --git a/third_party/aom/av1/encoder/x86/av1_quantize_sse2.c b/media/libaom/src/av1/encoder/x86/av1_quantize_sse2.c
index b07e7717f..b07e7717f 100644
--- a/third_party/aom/av1/encoder/x86/av1_quantize_sse2.c
+++ b/media/libaom/src/av1/encoder/x86/av1_quantize_sse2.c
diff --git a/third_party/aom/av1/encoder/x86/av1_quantize_ssse3_x86_64.asm b/media/libaom/src/av1/encoder/x86/av1_quantize_ssse3_x86_64.asm
index ad4ae274e..ad4ae274e 100644
--- a/third_party/aom/av1/encoder/x86/av1_quantize_ssse3_x86_64.asm
+++ b/media/libaom/src/av1/encoder/x86/av1_quantize_ssse3_x86_64.asm
diff --git a/third_party/aom/av1/encoder/x86/av1_ssim_opt_x86_64.asm b/media/libaom/src/av1/encoder/x86/av1_ssim_opt_x86_64.asm
index faa2a232a..faa2a232a 100644
--- a/third_party/aom/av1/encoder/x86/av1_ssim_opt_x86_64.asm
+++ b/media/libaom/src/av1/encoder/x86/av1_ssim_opt_x86_64.asm
diff --git a/third_party/aom/av1/encoder/x86/av1_txfm1d_sse4.h b/media/libaom/src/av1/encoder/x86/av1_txfm1d_sse4.h
index 6df2a8bdb..6df2a8bdb 100644
--- a/third_party/aom/av1/encoder/x86/av1_txfm1d_sse4.h
+++ b/media/libaom/src/av1/encoder/x86/av1_txfm1d_sse4.h
diff --git a/third_party/aom/av1/encoder/x86/corner_match_sse4.c b/media/libaom/src/av1/encoder/x86/corner_match_sse4.c
index 93f37b71d..93f37b71d 100644
--- a/third_party/aom/av1/encoder/x86/corner_match_sse4.c
+++ b/media/libaom/src/av1/encoder/x86/corner_match_sse4.c
diff --git a/third_party/aom/av1/encoder/x86/dct_sse2.asm b/media/libaom/src/av1/encoder/x86/dct_sse2.asm
index b18554818..b18554818 100644
--- a/third_party/aom/av1/encoder/x86/dct_sse2.asm
+++ b/media/libaom/src/av1/encoder/x86/dct_sse2.asm
diff --git a/third_party/aom/av1/encoder/x86/encodetxb_avx2.c b/media/libaom/src/av1/encoder/x86/encodetxb_avx2.c
index 7642f57d1..7642f57d1 100644
--- a/third_party/aom/av1/encoder/x86/encodetxb_avx2.c
+++ b/media/libaom/src/av1/encoder/x86/encodetxb_avx2.c
diff --git a/third_party/aom/av1/encoder/x86/encodetxb_sse2.c b/media/libaom/src/av1/encoder/x86/encodetxb_sse2.c
index dedb4d02f..dedb4d02f 100644
--- a/third_party/aom/av1/encoder/x86/encodetxb_sse2.c
+++ b/media/libaom/src/av1/encoder/x86/encodetxb_sse2.c
diff --git a/third_party/aom/av1/encoder/x86/encodetxb_sse4.c b/media/libaom/src/av1/encoder/x86/encodetxb_sse4.c
index 5e0687cd3..5e0687cd3 100644
--- a/third_party/aom/av1/encoder/x86/encodetxb_sse4.c
+++ b/media/libaom/src/av1/encoder/x86/encodetxb_sse4.c
diff --git a/third_party/aom/av1/encoder/x86/error_intrin_avx2.c b/media/libaom/src/av1/encoder/x86/error_intrin_avx2.c
index 7d4f69585..7d4f69585 100644
--- a/third_party/aom/av1/encoder/x86/error_intrin_avx2.c
+++ b/media/libaom/src/av1/encoder/x86/error_intrin_avx2.c
diff --git a/third_party/aom/av1/encoder/x86/error_sse2.asm b/media/libaom/src/av1/encoder/x86/error_sse2.asm
index 72e9e22b1..72e9e22b1 100644
--- a/third_party/aom/av1/encoder/x86/error_sse2.asm
+++ b/media/libaom/src/av1/encoder/x86/error_sse2.asm
diff --git a/third_party/aom/av1/encoder/x86/hash_sse42.c b/media/libaom/src/av1/encoder/x86/hash_sse42.c
index 65fa46311..65fa46311 100644
--- a/third_party/aom/av1/encoder/x86/hash_sse42.c
+++ b/media/libaom/src/av1/encoder/x86/hash_sse42.c
diff --git a/third_party/aom/av1/encoder/x86/highbd_block_error_intrin_sse2.c b/media/libaom/src/av1/encoder/x86/highbd_block_error_intrin_sse2.c
index 777304ace..777304ace 100644
--- a/third_party/aom/av1/encoder/x86/highbd_block_error_intrin_sse2.c
+++ b/media/libaom/src/av1/encoder/x86/highbd_block_error_intrin_sse2.c
diff --git a/third_party/aom/av1/encoder/x86/highbd_fwd_txfm_sse4.c b/media/libaom/src/av1/encoder/x86/highbd_fwd_txfm_sse4.c
index 535485ae8..535485ae8 100644
--- a/third_party/aom/av1/encoder/x86/highbd_fwd_txfm_sse4.c
+++ b/media/libaom/src/av1/encoder/x86/highbd_fwd_txfm_sse4.c
diff --git a/third_party/aom/av1/encoder/x86/pickrst_avx2.c b/media/libaom/src/av1/encoder/x86/pickrst_avx2.c
index 06aaaa7ee..06aaaa7ee 100644
--- a/third_party/aom/av1/encoder/x86/pickrst_avx2.c
+++ b/media/libaom/src/av1/encoder/x86/pickrst_avx2.c
diff --git a/third_party/aom/av1/encoder/x86/pickrst_sse4.c b/media/libaom/src/av1/encoder/x86/pickrst_sse4.c
index 04e4d1afc..04e4d1afc 100644
--- a/third_party/aom/av1/encoder/x86/pickrst_sse4.c
+++ b/media/libaom/src/av1/encoder/x86/pickrst_sse4.c
diff --git a/third_party/aom/av1/encoder/x86/temporal_filter_apply_sse2.asm b/media/libaom/src/av1/encoder/x86/temporal_filter_apply_sse2.asm
index 30983d1c1..30983d1c1 100644
--- a/third_party/aom/av1/encoder/x86/temporal_filter_apply_sse2.asm
+++ b/media/libaom/src/av1/encoder/x86/temporal_filter_apply_sse2.asm
diff --git a/third_party/aom/av1/encoder/x86/wedge_utils_avx2.c b/media/libaom/src/av1/encoder/x86/wedge_utils_avx2.c
index 2a792f14e..2a792f14e 100644
--- a/third_party/aom/av1/encoder/x86/wedge_utils_avx2.c
+++ b/media/libaom/src/av1/encoder/x86/wedge_utils_avx2.c
diff --git a/third_party/aom/av1/encoder/x86/wedge_utils_sse2.c b/media/libaom/src/av1/encoder/x86/wedge_utils_sse2.c
index 4d2e99f25..4d2e99f25 100644
--- a/third_party/aom/av1/encoder/x86/wedge_utils_sse2.c
+++ b/media/libaom/src/av1/encoder/x86/wedge_utils_sse2.c
diff --git a/third_party/aom/av1/exports_com b/media/libaom/src/av1/exports_com
index 5c8e0e09d..5c8e0e09d 100644
--- a/third_party/aom/av1/exports_com
+++ b/media/libaom/src/av1/exports_com
diff --git a/third_party/aom/av1/exports_dec b/media/libaom/src/av1/exports_dec
index daabf6766..daabf6766 100644
--- a/third_party/aom/av1/exports_dec
+++ b/media/libaom/src/av1/exports_dec
diff --git a/third_party/aom/av1/exports_enc b/media/libaom/src/av1/exports_enc
index dc4a9eae7..dc4a9eae7 100644
--- a/third_party/aom/av1/exports_enc
+++ b/media/libaom/src/av1/exports_enc
diff --git a/third_party/aom/av1/exports_test b/media/libaom/src/av1/exports_test
index dab377575..dab377575 100644
--- a/third_party/aom/av1/exports_test
+++ b/media/libaom/src/av1/exports_test
diff --git a/third_party/aom/build/cmake/aom_config.c.template b/media/libaom/src/build/cmake/aom_config.c.template
index 62f0a10ab..62f0a10ab 100644
--- a/third_party/aom/build/cmake/aom_config.c.template
+++ b/media/libaom/src/build/cmake/aom_config.c.template
diff --git a/third_party/aom/build/cmake/aom_config_defaults.cmake b/media/libaom/src/build/cmake/aom_config_defaults.cmake
index a07438cfe..a07438cfe 100644
--- a/third_party/aom/build/cmake/aom_config_defaults.cmake
+++ b/media/libaom/src/build/cmake/aom_config_defaults.cmake
diff --git a/third_party/aom/build/cmake/aom_configure.cmake b/media/libaom/src/build/cmake/aom_configure.cmake
index c0c7381e8..c0c7381e8 100644
--- a/third_party/aom/build/cmake/aom_configure.cmake
+++ b/media/libaom/src/build/cmake/aom_configure.cmake
diff --git a/third_party/aom/build/cmake/aom_experiment_deps.cmake b/media/libaom/src/build/cmake/aom_experiment_deps.cmake
index 0688704e5..0688704e5 100644
--- a/third_party/aom/build/cmake/aom_experiment_deps.cmake
+++ b/media/libaom/src/build/cmake/aom_experiment_deps.cmake
diff --git a/third_party/aom/build/cmake/aom_optimization.cmake b/media/libaom/src/build/cmake/aom_optimization.cmake
index be32a3212..be32a3212 100644
--- a/third_party/aom/build/cmake/aom_optimization.cmake
+++ b/media/libaom/src/build/cmake/aom_optimization.cmake
diff --git a/third_party/aom/build/cmake/compiler_flags.cmake b/media/libaom/src/build/cmake/compiler_flags.cmake
index 79192c1fa..79192c1fa 100644
--- a/third_party/aom/build/cmake/compiler_flags.cmake
+++ b/media/libaom/src/build/cmake/compiler_flags.cmake
diff --git a/third_party/aom/build/cmake/compiler_tests.cmake b/media/libaom/src/build/cmake/compiler_tests.cmake
index f115610ba..f115610ba 100644
--- a/third_party/aom/build/cmake/compiler_tests.cmake
+++ b/media/libaom/src/build/cmake/compiler_tests.cmake
diff --git a/third_party/aom/build/cmake/cpu.cmake b/media/libaom/src/build/cmake/cpu.cmake
index 6e8089e63..6e8089e63 100644
--- a/third_party/aom/build/cmake/cpu.cmake
+++ b/media/libaom/src/build/cmake/cpu.cmake
diff --git a/third_party/aom/build/cmake/dist.cmake b/media/libaom/src/build/cmake/dist.cmake
index 6f81736f0..6f81736f0 100644
--- a/third_party/aom/build/cmake/dist.cmake
+++ b/media/libaom/src/build/cmake/dist.cmake
diff --git a/third_party/aom/build/cmake/exports.cmake b/media/libaom/src/build/cmake/exports.cmake
index e0813dc0f..e0813dc0f 100644
--- a/third_party/aom/build/cmake/exports.cmake
+++ b/media/libaom/src/build/cmake/exports.cmake
diff --git a/third_party/aom/build/cmake/exports_sources.cmake b/media/libaom/src/build/cmake/exports_sources.cmake
index 576920e36..576920e36 100644
--- a/third_party/aom/build/cmake/exports_sources.cmake
+++ b/media/libaom/src/build/cmake/exports_sources.cmake
diff --git a/third_party/aom/build/cmake/generate_aom_config_templates.cmake b/media/libaom/src/build/cmake/generate_aom_config_templates.cmake
index b91c036de..b91c036de 100644
--- a/third_party/aom/build/cmake/generate_aom_config_templates.cmake
+++ b/media/libaom/src/build/cmake/generate_aom_config_templates.cmake
diff --git a/third_party/aom/build/cmake/generate_exports.cmake b/media/libaom/src/build/cmake/generate_exports.cmake
index 7ab5aaef8..7ab5aaef8 100644
--- a/third_party/aom/build/cmake/generate_exports.cmake
+++ b/media/libaom/src/build/cmake/generate_exports.cmake
diff --git a/third_party/aom/build/cmake/ios-Info.plist b/media/libaom/src/build/cmake/ios-Info.plist
index 300e3e310..300e3e310 100644
--- a/third_party/aom/build/cmake/ios-Info.plist
+++ b/media/libaom/src/build/cmake/ios-Info.plist
diff --git a/third_party/aom/build/cmake/iosbuild.sh b/media/libaom/src/build/cmake/iosbuild.sh
index 167ece200..167ece200 100755..100644
--- a/third_party/aom/build/cmake/iosbuild.sh
+++ b/media/libaom/src/build/cmake/iosbuild.sh
diff --git a/third_party/aom/build/cmake/msvc_runtime.cmake b/media/libaom/src/build/cmake/msvc_runtime.cmake
index 9e4cbea43..9e4cbea43 100644
--- a/third_party/aom/build/cmake/msvc_runtime.cmake
+++ b/media/libaom/src/build/cmake/msvc_runtime.cmake
diff --git a/third_party/aom/build/cmake/pkg_config.cmake b/media/libaom/src/build/cmake/pkg_config.cmake
index 64e20214e..64e20214e 100644
--- a/third_party/aom/build/cmake/pkg_config.cmake
+++ b/media/libaom/src/build/cmake/pkg_config.cmake
diff --git a/third_party/aom/build/cmake/rtcd.pl b/media/libaom/src/build/cmake/rtcd.pl
index 46e06907c..46e06907c 100755..100644
--- a/third_party/aom/build/cmake/rtcd.pl
+++ b/media/libaom/src/build/cmake/rtcd.pl
diff --git a/third_party/aom/build/cmake/sanitizers.cmake b/media/libaom/src/build/cmake/sanitizers.cmake
index 77708e101..77708e101 100644
--- a/third_party/aom/build/cmake/sanitizers.cmake
+++ b/media/libaom/src/build/cmake/sanitizers.cmake
diff --git a/third_party/aom/build/cmake/toolchains/arm-ios-common.cmake b/media/libaom/src/build/cmake/toolchains/arm-ios-common.cmake
index 8f4095145..8f4095145 100644
--- a/third_party/aom/build/cmake/toolchains/arm-ios-common.cmake
+++ b/media/libaom/src/build/cmake/toolchains/arm-ios-common.cmake
diff --git a/third_party/aom/build/cmake/toolchains/arm64-ios.cmake b/media/libaom/src/build/cmake/toolchains/arm64-ios.cmake
index 6feb1090f..6feb1090f 100644
--- a/third_party/aom/build/cmake/toolchains/arm64-ios.cmake
+++ b/media/libaom/src/build/cmake/toolchains/arm64-ios.cmake
diff --git a/third_party/aom/build/cmake/toolchains/arm64-linux-gcc.cmake b/media/libaom/src/build/cmake/toolchains/arm64-linux-gcc.cmake
index 590a97a8e..590a97a8e 100644
--- a/third_party/aom/build/cmake/toolchains/arm64-linux-gcc.cmake
+++ b/media/libaom/src/build/cmake/toolchains/arm64-linux-gcc.cmake
diff --git a/third_party/aom/build/cmake/toolchains/arm64-mingw-gcc.cmake b/media/libaom/src/build/cmake/toolchains/arm64-mingw-gcc.cmake
index b5b2ff1cd..b5b2ff1cd 100644
--- a/third_party/aom/build/cmake/toolchains/arm64-mingw-gcc.cmake
+++ b/media/libaom/src/build/cmake/toolchains/arm64-mingw-gcc.cmake
diff --git a/third_party/aom/build/cmake/toolchains/armv7-ios.cmake b/media/libaom/src/build/cmake/toolchains/armv7-ios.cmake
index 32a1b534a..32a1b534a 100644
--- a/third_party/aom/build/cmake/toolchains/armv7-ios.cmake
+++ b/media/libaom/src/build/cmake/toolchains/armv7-ios.cmake
diff --git a/third_party/aom/build/cmake/toolchains/armv7-linux-gcc.cmake b/media/libaom/src/build/cmake/toolchains/armv7-linux-gcc.cmake
index 7d3d63085..7d3d63085 100644
--- a/third_party/aom/build/cmake/toolchains/armv7-linux-gcc.cmake
+++ b/media/libaom/src/build/cmake/toolchains/armv7-linux-gcc.cmake
diff --git a/third_party/aom/build/cmake/toolchains/armv7-mingw-gcc.cmake b/media/libaom/src/build/cmake/toolchains/armv7-mingw-gcc.cmake
index cf06a11b3..cf06a11b3 100644
--- a/third_party/aom/build/cmake/toolchains/armv7-mingw-gcc.cmake
+++ b/media/libaom/src/build/cmake/toolchains/armv7-mingw-gcc.cmake
diff --git a/third_party/aom/build/cmake/toolchains/armv7s-ios.cmake b/media/libaom/src/build/cmake/toolchains/armv7s-ios.cmake
index 0940a6ee8..0940a6ee8 100644
--- a/third_party/aom/build/cmake/toolchains/armv7s-ios.cmake
+++ b/media/libaom/src/build/cmake/toolchains/armv7s-ios.cmake
diff --git a/third_party/aom/build/cmake/toolchains/ios-simulator-common.cmake b/media/libaom/src/build/cmake/toolchains/ios-simulator-common.cmake
index 76e0bd140..76e0bd140 100644
--- a/third_party/aom/build/cmake/toolchains/ios-simulator-common.cmake
+++ b/media/libaom/src/build/cmake/toolchains/ios-simulator-common.cmake
diff --git a/third_party/aom/build/cmake/toolchains/mips32-linux-gcc.cmake b/media/libaom/src/build/cmake/toolchains/mips32-linux-gcc.cmake
index 0f93490b1..0f93490b1 100644
--- a/third_party/aom/build/cmake/toolchains/mips32-linux-gcc.cmake
+++ b/media/libaom/src/build/cmake/toolchains/mips32-linux-gcc.cmake
diff --git a/third_party/aom/build/cmake/toolchains/mips64-linux-gcc.cmake b/media/libaom/src/build/cmake/toolchains/mips64-linux-gcc.cmake
index ad9aab09d..ad9aab09d 100644
--- a/third_party/aom/build/cmake/toolchains/mips64-linux-gcc.cmake
+++ b/media/libaom/src/build/cmake/toolchains/mips64-linux-gcc.cmake
diff --git a/third_party/aom/build/cmake/toolchains/ppc-linux-gcc.cmake b/media/libaom/src/build/cmake/toolchains/ppc-linux-gcc.cmake
index c86cc27e3..c86cc27e3 100644
--- a/third_party/aom/build/cmake/toolchains/ppc-linux-gcc.cmake
+++ b/media/libaom/src/build/cmake/toolchains/ppc-linux-gcc.cmake
diff --git a/third_party/aom/build/cmake/toolchains/x86-ios-simulator.cmake b/media/libaom/src/build/cmake/toolchains/x86-ios-simulator.cmake
index 6b6f52cac..6b6f52cac 100644
--- a/third_party/aom/build/cmake/toolchains/x86-ios-simulator.cmake
+++ b/media/libaom/src/build/cmake/toolchains/x86-ios-simulator.cmake
diff --git a/third_party/aom/build/cmake/toolchains/x86-linux.cmake b/media/libaom/src/build/cmake/toolchains/x86-linux.cmake
index c2a700bfe..c2a700bfe 100644
--- a/third_party/aom/build/cmake/toolchains/x86-linux.cmake
+++ b/media/libaom/src/build/cmake/toolchains/x86-linux.cmake
diff --git a/third_party/aom/build/cmake/toolchains/x86-macos.cmake b/media/libaom/src/build/cmake/toolchains/x86-macos.cmake
index 7a46e06a9..7a46e06a9 100644
--- a/third_party/aom/build/cmake/toolchains/x86-macos.cmake
+++ b/media/libaom/src/build/cmake/toolchains/x86-macos.cmake
diff --git a/third_party/aom/build/cmake/toolchains/x86-mingw-gcc.cmake b/media/libaom/src/build/cmake/toolchains/x86-mingw-gcc.cmake
index c986c4ee3..c986c4ee3 100644
--- a/third_party/aom/build/cmake/toolchains/x86-mingw-gcc.cmake
+++ b/media/libaom/src/build/cmake/toolchains/x86-mingw-gcc.cmake
diff --git a/third_party/aom/build/cmake/toolchains/x86_64-ios-simulator.cmake b/media/libaom/src/build/cmake/toolchains/x86_64-ios-simulator.cmake
index d4b40ed09..d4b40ed09 100644
--- a/third_party/aom/build/cmake/toolchains/x86_64-ios-simulator.cmake
+++ b/media/libaom/src/build/cmake/toolchains/x86_64-ios-simulator.cmake
diff --git a/third_party/aom/build/cmake/toolchains/x86_64-mingw-gcc.cmake b/media/libaom/src/build/cmake/toolchains/x86_64-mingw-gcc.cmake
index 00d94d5f1..00d94d5f1 100644
--- a/third_party/aom/build/cmake/toolchains/x86_64-mingw-gcc.cmake
+++ b/media/libaom/src/build/cmake/toolchains/x86_64-mingw-gcc.cmake
diff --git a/third_party/aom/build/cmake/util.cmake b/media/libaom/src/build/cmake/util.cmake
index b70ec4013..b70ec4013 100644
--- a/third_party/aom/build/cmake/util.cmake
+++ b/media/libaom/src/build/cmake/util.cmake
diff --git a/third_party/aom/build/cmake/version.cmake b/media/libaom/src/build/cmake/version.cmake
index d169b12ac..d169b12ac 100644
--- a/third_party/aom/build/cmake/version.cmake
+++ b/media/libaom/src/build/cmake/version.cmake
diff --git a/third_party/aom/build/cmake/version.pl b/media/libaom/src/build/cmake/version.pl
index 7d23f2b27..7d23f2b27 100755..100644
--- a/third_party/aom/build/cmake/version.pl
+++ b/media/libaom/src/build/cmake/version.pl
diff --git a/third_party/aom/codereview.settings b/media/libaom/src/codereview.settings
index 185e9344c..185e9344c 100644
--- a/third_party/aom/codereview.settings
+++ b/media/libaom/src/codereview.settings
diff --git a/third_party/aom/common/args.c b/media/libaom/src/common/args.c
index 7131e24de..7131e24de 100644
--- a/third_party/aom/common/args.c
+++ b/media/libaom/src/common/args.c
diff --git a/third_party/aom/common/args.h b/media/libaom/src/common/args.h
index 6a2664269..6a2664269 100644
--- a/third_party/aom/common/args.h
+++ b/media/libaom/src/common/args.h
diff --git a/third_party/aom/common/av1_config.c b/media/libaom/src/common/av1_config.c
index e8decf76f..e8decf76f 100644
--- a/third_party/aom/common/av1_config.c
+++ b/media/libaom/src/common/av1_config.c
diff --git a/third_party/aom/common/av1_config.h b/media/libaom/src/common/av1_config.h
index a15bedb30..a15bedb30 100644
--- a/third_party/aom/common/av1_config.h
+++ b/media/libaom/src/common/av1_config.h
diff --git a/third_party/aom/common/ivfdec.c b/media/libaom/src/common/ivfdec.c
index 80d73b04c..80d73b04c 100644
--- a/third_party/aom/common/ivfdec.c
+++ b/media/libaom/src/common/ivfdec.c
diff --git a/third_party/aom/common/ivfdec.h b/media/libaom/src/common/ivfdec.h
index ea294faa1..ea294faa1 100644
--- a/third_party/aom/common/ivfdec.h
+++ b/media/libaom/src/common/ivfdec.h
diff --git a/third_party/aom/common/ivfenc.c b/media/libaom/src/common/ivfenc.c
index 64715f4d7..64715f4d7 100644
--- a/third_party/aom/common/ivfenc.c
+++ b/media/libaom/src/common/ivfenc.c
diff --git a/third_party/aom/common/ivfenc.h b/media/libaom/src/common/ivfenc.h
index 8f6d947d4..8f6d947d4 100644
--- a/third_party/aom/common/ivfenc.h
+++ b/media/libaom/src/common/ivfenc.h
diff --git a/third_party/aom/common/md5_utils.c b/media/libaom/src/common/md5_utils.c
index b69e1cc72..b69e1cc72 100644
--- a/third_party/aom/common/md5_utils.c
+++ b/media/libaom/src/common/md5_utils.c
diff --git a/third_party/aom/common/md5_utils.h b/media/libaom/src/common/md5_utils.h
index 144fa3ad2..144fa3ad2 100644
--- a/third_party/aom/common/md5_utils.h
+++ b/media/libaom/src/common/md5_utils.h
diff --git a/third_party/aom/common/obudec.c b/media/libaom/src/common/obudec.c
index acbd12e0c..acbd12e0c 100644
--- a/third_party/aom/common/obudec.c
+++ b/media/libaom/src/common/obudec.c
diff --git a/third_party/aom/common/obudec.h b/media/libaom/src/common/obudec.h
index b2adb1e3d..b2adb1e3d 100644
--- a/third_party/aom/common/obudec.h
+++ b/media/libaom/src/common/obudec.h
diff --git a/third_party/aom/common/rawenc.c b/media/libaom/src/common/rawenc.c
index 5a2731d3a..5a2731d3a 100644
--- a/third_party/aom/common/rawenc.c
+++ b/media/libaom/src/common/rawenc.c
diff --git a/third_party/aom/common/rawenc.h b/media/libaom/src/common/rawenc.h
index cf5e00e6f..cf5e00e6f 100644
--- a/third_party/aom/common/rawenc.h
+++ b/media/libaom/src/common/rawenc.h
diff --git a/third_party/aom/common/tools_common.c b/media/libaom/src/common/tools_common.c
index 21cd80026..21cd80026 100644
--- a/third_party/aom/common/tools_common.c
+++ b/media/libaom/src/common/tools_common.c
diff --git a/third_party/aom/common/tools_common.h b/media/libaom/src/common/tools_common.h
index 4e1d12f4a..4e1d12f4a 100644
--- a/third_party/aom/common/tools_common.h
+++ b/media/libaom/src/common/tools_common.h
diff --git a/third_party/aom/common/video_common.h b/media/libaom/src/common/video_common.h
index bf95031be..bf95031be 100644
--- a/third_party/aom/common/video_common.h
+++ b/media/libaom/src/common/video_common.h
diff --git a/third_party/aom/common/video_reader.c b/media/libaom/src/common/video_reader.c
index 47ad6e189..47ad6e189 100644
--- a/third_party/aom/common/video_reader.c
+++ b/media/libaom/src/common/video_reader.c
diff --git a/third_party/aom/common/video_reader.h b/media/libaom/src/common/video_reader.h
index 903deae84..903deae84 100644
--- a/third_party/aom/common/video_reader.h
+++ b/media/libaom/src/common/video_reader.h
diff --git a/third_party/aom/common/video_writer.c b/media/libaom/src/common/video_writer.c
index a7ec309fc..a7ec309fc 100644
--- a/third_party/aom/common/video_writer.c
+++ b/media/libaom/src/common/video_writer.c
diff --git a/third_party/aom/common/video_writer.h b/media/libaom/src/common/video_writer.h
index 3e2b6554b..3e2b6554b 100644
--- a/third_party/aom/common/video_writer.h
+++ b/media/libaom/src/common/video_writer.h
diff --git a/third_party/aom/common/warnings.c b/media/libaom/src/common/warnings.c
index 2facee252..2facee252 100644
--- a/third_party/aom/common/warnings.c
+++ b/media/libaom/src/common/warnings.c
diff --git a/third_party/aom/common/warnings.h b/media/libaom/src/common/warnings.h
index 36f1fe070..36f1fe070 100644
--- a/third_party/aom/common/warnings.h
+++ b/media/libaom/src/common/warnings.h
diff --git a/third_party/aom/common/webmdec.cc b/media/libaom/src/common/webmdec.cc
index 17ac53c93..17ac53c93 100644
--- a/third_party/aom/common/webmdec.cc
+++ b/media/libaom/src/common/webmdec.cc
diff --git a/third_party/aom/common/webmdec.h b/media/libaom/src/common/webmdec.h
index 5ac75cb30..5ac75cb30 100644
--- a/third_party/aom/common/webmdec.h
+++ b/media/libaom/src/common/webmdec.h
diff --git a/third_party/aom/common/webmenc.cc b/media/libaom/src/common/webmenc.cc
index 58ab33670..58ab33670 100644
--- a/third_party/aom/common/webmenc.cc
+++ b/media/libaom/src/common/webmenc.cc
diff --git a/third_party/aom/common/webmenc.h b/media/libaom/src/common/webmenc.h
index aa9832fba..aa9832fba 100644
--- a/third_party/aom/common/webmenc.h
+++ b/media/libaom/src/common/webmenc.h
diff --git a/third_party/aom/common/y4menc.c b/media/libaom/src/common/y4menc.c
index 585d22197..585d22197 100644
--- a/third_party/aom/common/y4menc.c
+++ b/media/libaom/src/common/y4menc.c
diff --git a/third_party/aom/common/y4menc.h b/media/libaom/src/common/y4menc.h
index f6d5fd86b..f6d5fd86b 100644
--- a/third_party/aom/common/y4menc.h
+++ b/media/libaom/src/common/y4menc.h
diff --git a/third_party/aom/common/y4minput.c b/media/libaom/src/common/y4minput.c
index eca8b1bba..eca8b1bba 100644
--- a/third_party/aom/common/y4minput.c
+++ b/media/libaom/src/common/y4minput.c
diff --git a/third_party/aom/common/y4minput.h b/media/libaom/src/common/y4minput.h
index 01b9ce972..01b9ce972 100644
--- a/third_party/aom/common/y4minput.h
+++ b/media/libaom/src/common/y4minput.h
diff --git a/third_party/aom/docs.cmake b/media/libaom/src/docs.cmake
index b5bfa9b56..b5bfa9b56 100644
--- a/third_party/aom/docs.cmake
+++ b/media/libaom/src/docs.cmake
diff --git a/third_party/aom/examples/analyzer.cc b/media/libaom/src/examples/analyzer.cc
index 6a42eca24..6a42eca24 100644
--- a/third_party/aom/examples/analyzer.cc
+++ b/media/libaom/src/examples/analyzer.cc
diff --git a/third_party/aom/examples/aom_cx_set_ref.c b/media/libaom/src/examples/aom_cx_set_ref.c
index 8e3d216fe..8e3d216fe 100644
--- a/third_party/aom/examples/aom_cx_set_ref.c
+++ b/media/libaom/src/examples/aom_cx_set_ref.c
diff --git a/third_party/aom/examples/decode_to_md5.c b/media/libaom/src/examples/decode_to_md5.c
index bc127b78d..bc127b78d 100644
--- a/third_party/aom/examples/decode_to_md5.c
+++ b/media/libaom/src/examples/decode_to_md5.c
diff --git a/third_party/aom/examples/decode_with_drops.c b/media/libaom/src/examples/decode_with_drops.c
index 214401958..214401958 100644
--- a/third_party/aom/examples/decode_with_drops.c
+++ b/media/libaom/src/examples/decode_with_drops.c
diff --git a/third_party/aom/examples/encoder_util.c b/media/libaom/src/examples/encoder_util.c
index e43b37250..e43b37250 100644
--- a/third_party/aom/examples/encoder_util.c
+++ b/media/libaom/src/examples/encoder_util.c
diff --git a/third_party/aom/examples/encoder_util.h b/media/libaom/src/examples/encoder_util.h
index a6bb3fb48..a6bb3fb48 100644
--- a/third_party/aom/examples/encoder_util.h
+++ b/media/libaom/src/examples/encoder_util.h
diff --git a/third_party/aom/examples/inspect.c b/media/libaom/src/examples/inspect.c
index 9d5f0dcfc..9d5f0dcfc 100644
--- a/third_party/aom/examples/inspect.c
+++ b/media/libaom/src/examples/inspect.c
diff --git a/third_party/aom/examples/lightfield_bitstream_parsing.c b/media/libaom/src/examples/lightfield_bitstream_parsing.c
index 159f1617a..159f1617a 100644
--- a/third_party/aom/examples/lightfield_bitstream_parsing.c
+++ b/media/libaom/src/examples/lightfield_bitstream_parsing.c
diff --git a/third_party/aom/examples/lightfield_decoder.c b/media/libaom/src/examples/lightfield_decoder.c
index f5e54db7f..f5e54db7f 100644
--- a/third_party/aom/examples/lightfield_decoder.c
+++ b/media/libaom/src/examples/lightfield_decoder.c
diff --git a/third_party/aom/examples/lightfield_encoder.c b/media/libaom/src/examples/lightfield_encoder.c
index e55cd5ce3..e55cd5ce3 100644
--- a/third_party/aom/examples/lightfield_encoder.c
+++ b/media/libaom/src/examples/lightfield_encoder.c
diff --git a/third_party/aom/examples/lightfield_tile_list_decoder.c b/media/libaom/src/examples/lightfield_tile_list_decoder.c
index 5556bf0e7..5556bf0e7 100644
--- a/third_party/aom/examples/lightfield_tile_list_decoder.c
+++ b/media/libaom/src/examples/lightfield_tile_list_decoder.c
diff --git a/third_party/aom/examples/lossless_encoder.c b/media/libaom/src/examples/lossless_encoder.c
index 438ff21c6..438ff21c6 100644
--- a/third_party/aom/examples/lossless_encoder.c
+++ b/media/libaom/src/examples/lossless_encoder.c
diff --git a/third_party/aom/examples/noise_model.c b/media/libaom/src/examples/noise_model.c
index 5cc6003b6..5cc6003b6 100644
--- a/third_party/aom/examples/noise_model.c
+++ b/media/libaom/src/examples/noise_model.c
diff --git a/third_party/aom/examples/resize_util.c b/media/libaom/src/examples/resize_util.c
index 6a84d5740..6a84d5740 100644
--- a/third_party/aom/examples/resize_util.c
+++ b/media/libaom/src/examples/resize_util.c
diff --git a/third_party/aom/examples/scalable_decoder.c b/media/libaom/src/examples/scalable_decoder.c
index c22924223..c22924223 100644
--- a/third_party/aom/examples/scalable_decoder.c
+++ b/media/libaom/src/examples/scalable_decoder.c
diff --git a/third_party/aom/examples/scalable_encoder.c b/media/libaom/src/examples/scalable_encoder.c
index 7af03e29f..7af03e29f 100644
--- a/third_party/aom/examples/scalable_encoder.c
+++ b/media/libaom/src/examples/scalable_encoder.c
diff --git a/third_party/aom/examples/set_maps.c b/media/libaom/src/examples/set_maps.c
index 9aeb96e43..9aeb96e43 100644
--- a/third_party/aom/examples/set_maps.c
+++ b/media/libaom/src/examples/set_maps.c
diff --git a/third_party/aom/examples/simple_decoder.c b/media/libaom/src/examples/simple_decoder.c
index d098d1e0b..d098d1e0b 100644
--- a/third_party/aom/examples/simple_decoder.c
+++ b/media/libaom/src/examples/simple_decoder.c
diff --git a/third_party/aom/examples/simple_encoder.c b/media/libaom/src/examples/simple_encoder.c
index 01a37cf0c..01a37cf0c 100644
--- a/third_party/aom/examples/simple_encoder.c
+++ b/media/libaom/src/examples/simple_encoder.c
diff --git a/third_party/aom/examples/twopass_encoder.c b/media/libaom/src/examples/twopass_encoder.c
index a03bc6cc2..a03bc6cc2 100644
--- a/third_party/aom/examples/twopass_encoder.c
+++ b/media/libaom/src/examples/twopass_encoder.c
diff --git a/third_party/aom/keywords.dox b/media/libaom/src/keywords.dox
index 56f536890..56f536890 100644
--- a/third_party/aom/keywords.dox
+++ b/media/libaom/src/keywords.dox
diff --git a/third_party/aom/libs.doxy_template b/media/libaom/src/libs.doxy_template
index c522e21d3..c522e21d3 100644
--- a/third_party/aom/libs.doxy_template
+++ b/media/libaom/src/libs.doxy_template
diff --git a/third_party/aom/mainpage.dox b/media/libaom/src/mainpage.dox
index 03a299ae1..03a299ae1 100644
--- a/third_party/aom/mainpage.dox
+++ b/media/libaom/src/mainpage.dox
diff --git a/third_party/aom/stats/aomstats.c b/media/libaom/src/stats/aomstats.c
index 4a15adf02..4a15adf02 100644
--- a/third_party/aom/stats/aomstats.c
+++ b/media/libaom/src/stats/aomstats.c
diff --git a/third_party/aom/stats/aomstats.h b/media/libaom/src/stats/aomstats.h
index b9c71871a..b9c71871a 100644
--- a/third_party/aom/stats/aomstats.h
+++ b/media/libaom/src/stats/aomstats.h
diff --git a/third_party/aom/stats/rate_hist.c b/media/libaom/src/stats/rate_hist.c
index 71eb78b72..71eb78b72 100644
--- a/third_party/aom/stats/rate_hist.c
+++ b/media/libaom/src/stats/rate_hist.c
diff --git a/third_party/aom/stats/rate_hist.h b/media/libaom/src/stats/rate_hist.h
index 55b8c5d43..55b8c5d43 100644
--- a/third_party/aom/stats/rate_hist.h
+++ b/media/libaom/src/stats/rate_hist.h
diff --git a/third_party/aom/test/accounting_test.cc b/media/libaom/src/test/accounting_test.cc
index 8b5c8af13..8b5c8af13 100644
--- a/third_party/aom/test/accounting_test.cc
+++ b/media/libaom/src/test/accounting_test.cc
diff --git a/third_party/aom/test/acm_random.h b/media/libaom/src/test/acm_random.h
index 0a8317fd5..0a8317fd5 100644
--- a/third_party/aom/test/acm_random.h
+++ b/media/libaom/src/test/acm_random.h
diff --git a/third_party/aom/test/active_map_test.cc b/media/libaom/src/test/active_map_test.cc
index a2b0546ed..a2b0546ed 100644
--- a/third_party/aom/test/active_map_test.cc
+++ b/media/libaom/src/test/active_map_test.cc
diff --git a/third_party/aom/test/altref_test.cc b/media/libaom/src/test/altref_test.cc
index dabb1475a..dabb1475a 100644
--- a/third_party/aom/test/altref_test.cc
+++ b/media/libaom/src/test/altref_test.cc
diff --git a/third_party/aom/test/aom_integer_test.cc b/media/libaom/src/test/aom_integer_test.cc
index fe88a54e9..fe88a54e9 100644
--- a/third_party/aom/test/aom_integer_test.cc
+++ b/media/libaom/src/test/aom_integer_test.cc
diff --git a/third_party/aom/test/aomcx_set_ref.sh b/media/libaom/src/test/aomcx_set_ref.sh
index f51b73c58..f51b73c58 100755..100644
--- a/third_party/aom/test/aomcx_set_ref.sh
+++ b/media/libaom/src/test/aomcx_set_ref.sh
diff --git a/third_party/aom/test/aomdec.sh b/media/libaom/src/test/aomdec.sh
index 927142287..927142287 100755..100644
--- a/third_party/aom/test/aomdec.sh
+++ b/media/libaom/src/test/aomdec.sh
diff --git a/third_party/aom/test/aomenc.sh b/media/libaom/src/test/aomenc.sh
index b030397a3..b030397a3 100755..100644
--- a/third_party/aom/test/aomenc.sh
+++ b/media/libaom/src/test/aomenc.sh
diff --git a/third_party/aom/test/aq_segment_test.cc b/media/libaom/src/test/aq_segment_test.cc
index bbb5027d4..bbb5027d4 100644
--- a/third_party/aom/test/aq_segment_test.cc
+++ b/media/libaom/src/test/aq_segment_test.cc
diff --git a/third_party/aom/test/arf_freq_test.cc b/media/libaom/src/test/arf_freq_test.cc
index 083f4022f..083f4022f 100644
--- a/third_party/aom/test/arf_freq_test.cc
+++ b/media/libaom/src/test/arf_freq_test.cc
diff --git a/third_party/aom/test/av1_config_test.cc b/media/libaom/src/test/av1_config_test.cc
index e2f2c5390..e2f2c5390 100644
--- a/third_party/aom/test/av1_config_test.cc
+++ b/media/libaom/src/test/av1_config_test.cc
diff --git a/third_party/aom/test/av1_convolve_2d_test.cc b/media/libaom/src/test/av1_convolve_2d_test.cc
index 03286260e..03286260e 100644
--- a/third_party/aom/test/av1_convolve_2d_test.cc
+++ b/media/libaom/src/test/av1_convolve_2d_test.cc
diff --git a/third_party/aom/test/av1_convolve_2d_test_util.cc b/media/libaom/src/test/av1_convolve_2d_test_util.cc
index 409fd23e1..409fd23e1 100644
--- a/third_party/aom/test/av1_convolve_2d_test_util.cc
+++ b/media/libaom/src/test/av1_convolve_2d_test_util.cc
diff --git a/third_party/aom/test/av1_convolve_2d_test_util.h b/media/libaom/src/test/av1_convolve_2d_test_util.h
index e0eb58410..e0eb58410 100644
--- a/third_party/aom/test/av1_convolve_2d_test_util.h
+++ b/media/libaom/src/test/av1_convolve_2d_test_util.h
diff --git a/third_party/aom/test/av1_convolve_scale_test.cc b/media/libaom/src/test/av1_convolve_scale_test.cc
index 3b1698eeb..3b1698eeb 100644
--- a/third_party/aom/test/av1_convolve_scale_test.cc
+++ b/media/libaom/src/test/av1_convolve_scale_test.cc
diff --git a/third_party/aom/test/av1_encoder_parms_get_to_decoder.cc b/media/libaom/src/test/av1_encoder_parms_get_to_decoder.cc
index e8470e5d5..e8470e5d5 100644
--- a/third_party/aom/test/av1_encoder_parms_get_to_decoder.cc
+++ b/media/libaom/src/test/av1_encoder_parms_get_to_decoder.cc
diff --git a/third_party/aom/test/av1_ext_tile_test.cc b/media/libaom/src/test/av1_ext_tile_test.cc
index 424d2f065..424d2f065 100644
--- a/third_party/aom/test/av1_ext_tile_test.cc
+++ b/media/libaom/src/test/av1_ext_tile_test.cc
diff --git a/third_party/aom/test/av1_fwd_txfm1d_test.cc b/media/libaom/src/test/av1_fwd_txfm1d_test.cc
index 49a666879..49a666879 100644
--- a/third_party/aom/test/av1_fwd_txfm1d_test.cc
+++ b/media/libaom/src/test/av1_fwd_txfm1d_test.cc
diff --git a/third_party/aom/test/av1_fwd_txfm2d_test.cc b/media/libaom/src/test/av1_fwd_txfm2d_test.cc
index 75f20536b..75f20536b 100644
--- a/third_party/aom/test/av1_fwd_txfm2d_test.cc
+++ b/media/libaom/src/test/av1_fwd_txfm2d_test.cc
diff --git a/third_party/aom/test/av1_highbd_iht_test.cc b/media/libaom/src/test/av1_highbd_iht_test.cc
index 2d6490c2a..2d6490c2a 100644
--- a/third_party/aom/test/av1_highbd_iht_test.cc
+++ b/media/libaom/src/test/av1_highbd_iht_test.cc
diff --git a/third_party/aom/test/av1_horz_only_frame_superres_test.cc b/media/libaom/src/test/av1_horz_only_frame_superres_test.cc
index fd77ef35d..fd77ef35d 100644
--- a/third_party/aom/test/av1_horz_only_frame_superres_test.cc
+++ b/media/libaom/src/test/av1_horz_only_frame_superres_test.cc
diff --git a/third_party/aom/test/av1_inv_txfm1d_test.cc b/media/libaom/src/test/av1_inv_txfm1d_test.cc
index bf3a44ed1..bf3a44ed1 100644
--- a/third_party/aom/test/av1_inv_txfm1d_test.cc
+++ b/media/libaom/src/test/av1_inv_txfm1d_test.cc
diff --git a/third_party/aom/test/av1_inv_txfm2d_test.cc b/media/libaom/src/test/av1_inv_txfm2d_test.cc
index 11e231ba6..11e231ba6 100644
--- a/third_party/aom/test/av1_inv_txfm2d_test.cc
+++ b/media/libaom/src/test/av1_inv_txfm2d_test.cc
diff --git a/third_party/aom/test/av1_quantize_test.cc b/media/libaom/src/test/av1_quantize_test.cc
index aaf093918..aaf093918 100644
--- a/third_party/aom/test/av1_quantize_test.cc
+++ b/media/libaom/src/test/av1_quantize_test.cc
diff --git a/third_party/aom/test/av1_round_shift_array_test.cc b/media/libaom/src/test/av1_round_shift_array_test.cc
index 181a39460..181a39460 100644
--- a/third_party/aom/test/av1_round_shift_array_test.cc
+++ b/media/libaom/src/test/av1_round_shift_array_test.cc
diff --git a/third_party/aom/test/av1_txfm_test.cc b/media/libaom/src/test/av1_txfm_test.cc
index d5b0ce325..d5b0ce325 100644
--- a/third_party/aom/test/av1_txfm_test.cc
+++ b/media/libaom/src/test/av1_txfm_test.cc
diff --git a/third_party/aom/test/av1_txfm_test.h b/media/libaom/src/test/av1_txfm_test.h
index a18164741..a18164741 100644
--- a/third_party/aom/test/av1_txfm_test.h
+++ b/media/libaom/src/test/av1_txfm_test.h
diff --git a/third_party/aom/test/av1_wedge_utils_test.cc b/media/libaom/src/test/av1_wedge_utils_test.cc
index e8fbe69a4..e8fbe69a4 100644
--- a/third_party/aom/test/av1_wedge_utils_test.cc
+++ b/media/libaom/src/test/av1_wedge_utils_test.cc
diff --git a/third_party/aom/test/best_encode.sh b/media/libaom/src/test/best_encode.sh
index fe31a01cb..fe31a01cb 100755..100644
--- a/third_party/aom/test/best_encode.sh
+++ b/media/libaom/src/test/best_encode.sh
diff --git a/third_party/aom/test/binary_codes_test.cc b/media/libaom/src/test/binary_codes_test.cc
index 45660cf85..45660cf85 100644
--- a/third_party/aom/test/binary_codes_test.cc
+++ b/media/libaom/src/test/binary_codes_test.cc
diff --git a/third_party/aom/test/blend_a64_mask_1d_test.cc b/media/libaom/src/test/blend_a64_mask_1d_test.cc
index f8844eef8..f8844eef8 100644
--- a/third_party/aom/test/blend_a64_mask_1d_test.cc
+++ b/media/libaom/src/test/blend_a64_mask_1d_test.cc
diff --git a/third_party/aom/test/blend_a64_mask_test.cc b/media/libaom/src/test/blend_a64_mask_test.cc
index 66ca6fc5f..66ca6fc5f 100644
--- a/third_party/aom/test/blend_a64_mask_test.cc
+++ b/media/libaom/src/test/blend_a64_mask_test.cc
diff --git a/third_party/aom/test/blockd_test.cc b/media/libaom/src/test/blockd_test.cc
index ab624007c..ab624007c 100644
--- a/third_party/aom/test/blockd_test.cc
+++ b/media/libaom/src/test/blockd_test.cc
diff --git a/third_party/aom/test/boolcoder_test.cc b/media/libaom/src/test/boolcoder_test.cc
index 680ec1877..680ec1877 100644
--- a/third_party/aom/test/boolcoder_test.cc
+++ b/media/libaom/src/test/boolcoder_test.cc
diff --git a/third_party/aom/test/borders_test.cc b/media/libaom/src/test/borders_test.cc
index 893237ef3..893237ef3 100644
--- a/third_party/aom/test/borders_test.cc
+++ b/media/libaom/src/test/borders_test.cc
diff --git a/third_party/aom/test/cdef_test.cc b/media/libaom/src/test/cdef_test.cc
index becc07291..becc07291 100644
--- a/third_party/aom/test/cdef_test.cc
+++ b/media/libaom/src/test/cdef_test.cc
diff --git a/third_party/aom/test/cfl_test.cc b/media/libaom/src/test/cfl_test.cc
index e4d438d6a..e4d438d6a 100644
--- a/third_party/aom/test/cfl_test.cc
+++ b/media/libaom/src/test/cfl_test.cc
diff --git a/third_party/aom/test/clear_system_state.h b/media/libaom/src/test/clear_system_state.h
index d38ff5dd5..d38ff5dd5 100644
--- a/third_party/aom/test/clear_system_state.h
+++ b/media/libaom/src/test/clear_system_state.h
diff --git a/third_party/aom/test/codec_factory.h b/media/libaom/src/test/codec_factory.h
index dd99110ee..dd99110ee 100644
--- a/third_party/aom/test/codec_factory.h
+++ b/media/libaom/src/test/codec_factory.h
diff --git a/third_party/aom/test/coding_path_sync.cc b/media/libaom/src/test/coding_path_sync.cc
index 6735236cc..6735236cc 100644
--- a/third_party/aom/test/coding_path_sync.cc
+++ b/media/libaom/src/test/coding_path_sync.cc
diff --git a/third_party/aom/test/comp_avg_pred_test.cc b/media/libaom/src/test/comp_avg_pred_test.cc
index 9ad8973f0..9ad8973f0 100644
--- a/third_party/aom/test/comp_avg_pred_test.cc
+++ b/media/libaom/src/test/comp_avg_pred_test.cc
diff --git a/third_party/aom/test/comp_avg_pred_test.h b/media/libaom/src/test/comp_avg_pred_test.h
index 9661dd9f5..9661dd9f5 100644
--- a/third_party/aom/test/comp_avg_pred_test.h
+++ b/media/libaom/src/test/comp_avg_pred_test.h
diff --git a/third_party/aom/test/comp_mask_variance_test.cc b/media/libaom/src/test/comp_mask_variance_test.cc
index 34be2aa6d..34be2aa6d 100644
--- a/third_party/aom/test/comp_mask_variance_test.cc
+++ b/media/libaom/src/test/comp_mask_variance_test.cc
diff --git a/third_party/aom/test/convolve_round_test.cc b/media/libaom/src/test/convolve_round_test.cc
index 2f801e7d4..2f801e7d4 100644
--- a/third_party/aom/test/convolve_round_test.cc
+++ b/media/libaom/src/test/convolve_round_test.cc
diff --git a/third_party/aom/test/convolve_test.cc b/media/libaom/src/test/convolve_test.cc
index de3f47628..de3f47628 100644
--- a/third_party/aom/test/convolve_test.cc
+++ b/media/libaom/src/test/convolve_test.cc
diff --git a/third_party/aom/test/corner_match_test.cc b/media/libaom/src/test/corner_match_test.cc
index 58e3139c5..58e3139c5 100644
--- a/third_party/aom/test/corner_match_test.cc
+++ b/media/libaom/src/test/corner_match_test.cc
diff --git a/third_party/aom/test/cpu_speed_test.cc b/media/libaom/src/test/cpu_speed_test.cc
index 8ea3e6965..8ea3e6965 100644
--- a/third_party/aom/test/cpu_speed_test.cc
+++ b/media/libaom/src/test/cpu_speed_test.cc
diff --git a/third_party/aom/test/datarate_test.cc b/media/libaom/src/test/datarate_test.cc
index 1588d3cc1..1588d3cc1 100644
--- a/third_party/aom/test/datarate_test.cc
+++ b/media/libaom/src/test/datarate_test.cc
diff --git a/third_party/aom/test/decode_api_test.cc b/media/libaom/src/test/decode_api_test.cc
index c1beacee1..c1beacee1 100644
--- a/third_party/aom/test/decode_api_test.cc
+++ b/media/libaom/src/test/decode_api_test.cc
diff --git a/third_party/aom/test/decode_multithreaded_test.cc b/media/libaom/src/test/decode_multithreaded_test.cc
index cea1d144f..cea1d144f 100644
--- a/third_party/aom/test/decode_multithreaded_test.cc
+++ b/media/libaom/src/test/decode_multithreaded_test.cc
diff --git a/third_party/aom/test/decode_perf_test.cc b/media/libaom/src/test/decode_perf_test.cc
index bb7b00032..bb7b00032 100644
--- a/third_party/aom/test/decode_perf_test.cc
+++ b/media/libaom/src/test/decode_perf_test.cc
diff --git a/third_party/aom/test/decode_test_driver.cc b/media/libaom/src/test/decode_test_driver.cc
index 70de0cff6..70de0cff6 100644
--- a/third_party/aom/test/decode_test_driver.cc
+++ b/media/libaom/src/test/decode_test_driver.cc
diff --git a/third_party/aom/test/decode_test_driver.h b/media/libaom/src/test/decode_test_driver.h
index d13e13ea1..d13e13ea1 100644
--- a/third_party/aom/test/decode_test_driver.h
+++ b/media/libaom/src/test/decode_test_driver.h
diff --git a/third_party/aom/test/decode_to_md5.sh b/media/libaom/src/test/decode_to_md5.sh
index 2edd1cb52..2edd1cb52 100755..100644
--- a/third_party/aom/test/decode_to_md5.sh
+++ b/media/libaom/src/test/decode_to_md5.sh
diff --git a/third_party/aom/test/decode_with_drops.sh b/media/libaom/src/test/decode_with_drops.sh
index 155ee9207..155ee9207 100755..100644
--- a/third_party/aom/test/decode_with_drops.sh
+++ b/media/libaom/src/test/decode_with_drops.sh
diff --git a/third_party/aom/test/divu_small_test.cc b/media/libaom/src/test/divu_small_test.cc
index 064f8ee45..064f8ee45 100644
--- a/third_party/aom/test/divu_small_test.cc
+++ b/media/libaom/src/test/divu_small_test.cc
diff --git a/third_party/aom/test/dr_prediction_test.cc b/media/libaom/src/test/dr_prediction_test.cc
index ff2c1de4e..ff2c1de4e 100644
--- a/third_party/aom/test/dr_prediction_test.cc
+++ b/media/libaom/src/test/dr_prediction_test.cc
diff --git a/third_party/aom/test/dump_obu.sh b/media/libaom/src/test/dump_obu.sh
index da44dd7e6..da44dd7e6 100755..100644
--- a/third_party/aom/test/dump_obu.sh
+++ b/media/libaom/src/test/dump_obu.sh
diff --git a/third_party/aom/test/ec_test.cc b/media/libaom/src/test/ec_test.cc
index e6a5ea63b..e6a5ea63b 100644
--- a/third_party/aom/test/ec_test.cc
+++ b/media/libaom/src/test/ec_test.cc
diff --git a/third_party/aom/test/encode_api_test.cc b/media/libaom/src/test/encode_api_test.cc
index c26f5720f..c26f5720f 100644
--- a/third_party/aom/test/encode_api_test.cc
+++ b/media/libaom/src/test/encode_api_test.cc
diff --git a/third_party/aom/test/encode_perf_test.cc b/media/libaom/src/test/encode_perf_test.cc
index fe649b153..fe649b153 100644
--- a/third_party/aom/test/encode_perf_test.cc
+++ b/media/libaom/src/test/encode_perf_test.cc
diff --git a/third_party/aom/test/encode_test_driver.cc b/media/libaom/src/test/encode_test_driver.cc
index f3d61dc36..f3d61dc36 100644
--- a/third_party/aom/test/encode_test_driver.cc
+++ b/media/libaom/src/test/encode_test_driver.cc
diff --git a/third_party/aom/test/encode_test_driver.h b/media/libaom/src/test/encode_test_driver.h
index 4f3f855cf..4f3f855cf 100644
--- a/third_party/aom/test/encode_test_driver.h
+++ b/media/libaom/src/test/encode_test_driver.h
diff --git a/third_party/aom/test/encodetxb_test.cc b/media/libaom/src/test/encodetxb_test.cc
index 11cc07368..11cc07368 100644
--- a/third_party/aom/test/encodetxb_test.cc
+++ b/media/libaom/src/test/encodetxb_test.cc
diff --git a/third_party/aom/test/end_to_end_test.cc b/media/libaom/src/test/end_to_end_test.cc
index 1ac0ae931..1ac0ae931 100644
--- a/third_party/aom/test/end_to_end_test.cc
+++ b/media/libaom/src/test/end_to_end_test.cc
diff --git a/third_party/aom/test/error_block_test.cc b/media/libaom/src/test/error_block_test.cc
index 353947c3d..353947c3d 100644
--- a/third_party/aom/test/error_block_test.cc
+++ b/media/libaom/src/test/error_block_test.cc
diff --git a/third_party/aom/test/error_resilience_test.cc b/media/libaom/src/test/error_resilience_test.cc
index 13ac0bf93..13ac0bf93 100644
--- a/third_party/aom/test/error_resilience_test.cc
+++ b/media/libaom/src/test/error_resilience_test.cc
diff --git a/third_party/aom/test/ethread_test.cc b/media/libaom/src/test/ethread_test.cc
index d9ac78282..d9ac78282 100644
--- a/third_party/aom/test/ethread_test.cc
+++ b/media/libaom/src/test/ethread_test.cc
diff --git a/third_party/aom/test/examples.sh b/media/libaom/src/test/examples.sh
index 2cdb89dd0..2cdb89dd0 100755..100644
--- a/third_party/aom/test/examples.sh
+++ b/media/libaom/src/test/examples.sh
diff --git a/third_party/aom/test/external_frame_buffer_test.cc b/media/libaom/src/test/external_frame_buffer_test.cc
index c2af059a4..c2af059a4 100644
--- a/third_party/aom/test/external_frame_buffer_test.cc
+++ b/media/libaom/src/test/external_frame_buffer_test.cc
diff --git a/third_party/aom/test/fft_test.cc b/media/libaom/src/test/fft_test.cc
index e24e451a3..e24e451a3 100644
--- a/third_party/aom/test/fft_test.cc
+++ b/media/libaom/src/test/fft_test.cc
diff --git a/third_party/aom/test/film_grain_table_test.cc b/media/libaom/src/test/film_grain_table_test.cc
index 524d67d7b..524d67d7b 100644
--- a/third_party/aom/test/film_grain_table_test.cc
+++ b/media/libaom/src/test/film_grain_table_test.cc
diff --git a/third_party/aom/test/filterintra_test.cc b/media/libaom/src/test/filterintra_test.cc
index 597134940..597134940 100644
--- a/third_party/aom/test/filterintra_test.cc
+++ b/media/libaom/src/test/filterintra_test.cc
diff --git a/third_party/aom/test/frame_size_tests.cc b/media/libaom/src/test/frame_size_tests.cc
index eaf0b8370..eaf0b8370 100644
--- a/third_party/aom/test/frame_size_tests.cc
+++ b/media/libaom/src/test/frame_size_tests.cc
diff --git a/third_party/aom/test/function_equivalence_test.h b/media/libaom/src/test/function_equivalence_test.h
index f27068902..f27068902 100644
--- a/third_party/aom/test/function_equivalence_test.h
+++ b/media/libaom/src/test/function_equivalence_test.h
diff --git a/third_party/aom/test/fwht4x4_test.cc b/media/libaom/src/test/fwht4x4_test.cc
index c8d98c519..c8d98c519 100644
--- a/third_party/aom/test/fwht4x4_test.cc
+++ b/media/libaom/src/test/fwht4x4_test.cc
diff --git a/third_party/aom/test/gviz_api.py b/media/libaom/src/test/gviz_api.py
index d3a443dab..d3a443dab 100755..100644
--- a/third_party/aom/test/gviz_api.py
+++ b/media/libaom/src/test/gviz_api.py
diff --git a/third_party/aom/test/hash_test.cc b/media/libaom/src/test/hash_test.cc
index e9f7f63c9..e9f7f63c9 100644
--- a/third_party/aom/test/hash_test.cc
+++ b/media/libaom/src/test/hash_test.cc
diff --git a/third_party/aom/test/hbd_metrics_test.cc b/media/libaom/src/test/hbd_metrics_test.cc
index 09df9bde4..09df9bde4 100644
--- a/third_party/aom/test/hbd_metrics_test.cc
+++ b/media/libaom/src/test/hbd_metrics_test.cc
diff --git a/third_party/aom/test/hiprec_convolve_test.cc b/media/libaom/src/test/hiprec_convolve_test.cc
index f94a0730c..f94a0730c 100644
--- a/third_party/aom/test/hiprec_convolve_test.cc
+++ b/media/libaom/src/test/hiprec_convolve_test.cc
diff --git a/third_party/aom/test/hiprec_convolve_test_util.cc b/media/libaom/src/test/hiprec_convolve_test_util.cc
index 2672bcec3..2672bcec3 100644
--- a/third_party/aom/test/hiprec_convolve_test_util.cc
+++ b/media/libaom/src/test/hiprec_convolve_test_util.cc
diff --git a/third_party/aom/test/hiprec_convolve_test_util.h b/media/libaom/src/test/hiprec_convolve_test_util.h
index 2abe24b57..2abe24b57 100644
--- a/third_party/aom/test/hiprec_convolve_test_util.h
+++ b/media/libaom/src/test/hiprec_convolve_test_util.h
diff --git a/third_party/aom/test/horz_superres_test.cc b/media/libaom/src/test/horz_superres_test.cc
index 973f55b66..973f55b66 100644
--- a/third_party/aom/test/horz_superres_test.cc
+++ b/media/libaom/src/test/horz_superres_test.cc
diff --git a/third_party/aom/test/i420_video_source.h b/media/libaom/src/test/i420_video_source.h
index 233e7152b..233e7152b 100644
--- a/third_party/aom/test/i420_video_source.h
+++ b/media/libaom/src/test/i420_video_source.h
diff --git a/third_party/aom/test/intra_edge_test.cc b/media/libaom/src/test/intra_edge_test.cc
index ce61402ac..ce61402ac 100644
--- a/third_party/aom/test/intra_edge_test.cc
+++ b/media/libaom/src/test/intra_edge_test.cc
diff --git a/third_party/aom/test/intrabc_test.cc b/media/libaom/src/test/intrabc_test.cc
index 3ea421708..3ea421708 100644
--- a/third_party/aom/test/intrabc_test.cc
+++ b/media/libaom/src/test/intrabc_test.cc
diff --git a/third_party/aom/test/intrapred_test.cc b/media/libaom/src/test/intrapred_test.cc
index 1a1c0fc42..1a1c0fc42 100644
--- a/third_party/aom/test/intrapred_test.cc
+++ b/media/libaom/src/test/intrapred_test.cc
diff --git a/third_party/aom/test/invalid_file_test.cc b/media/libaom/src/test/invalid_file_test.cc
index 5b4f5a6c3..5b4f5a6c3 100644
--- a/third_party/aom/test/invalid_file_test.cc
+++ b/media/libaom/src/test/invalid_file_test.cc
diff --git a/third_party/aom/test/ivf_video_source.h b/media/libaom/src/test/ivf_video_source.h
index ff2841445..ff2841445 100644
--- a/third_party/aom/test/ivf_video_source.h
+++ b/media/libaom/src/test/ivf_video_source.h
diff --git a/third_party/aom/test/lightfield_test.sh b/media/libaom/src/test/lightfield_test.sh
index b957a6b79..b957a6b79 100755..100644
--- a/third_party/aom/test/lightfield_test.sh
+++ b/media/libaom/src/test/lightfield_test.sh
diff --git a/third_party/aom/test/log2_test.cc b/media/libaom/src/test/log2_test.cc
index d7840c68b..d7840c68b 100644
--- a/third_party/aom/test/log2_test.cc
+++ b/media/libaom/src/test/log2_test.cc
diff --git a/third_party/aom/test/lossless_test.cc b/media/libaom/src/test/lossless_test.cc
index 3f8e89c81..3f8e89c81 100644
--- a/third_party/aom/test/lossless_test.cc
+++ b/media/libaom/src/test/lossless_test.cc
diff --git a/third_party/aom/test/lpf_test.cc b/media/libaom/src/test/lpf_test.cc
index 451bffd2a..451bffd2a 100644
--- a/third_party/aom/test/lpf_test.cc
+++ b/media/libaom/src/test/lpf_test.cc
diff --git a/third_party/aom/test/masked_sad_test.cc b/media/libaom/src/test/masked_sad_test.cc
index 311f1877d..311f1877d 100644
--- a/third_party/aom/test/masked_sad_test.cc
+++ b/media/libaom/src/test/masked_sad_test.cc
diff --git a/third_party/aom/test/masked_variance_test.cc b/media/libaom/src/test/masked_variance_test.cc
index 275b9feb6..275b9feb6 100644
--- a/third_party/aom/test/masked_variance_test.cc
+++ b/media/libaom/src/test/masked_variance_test.cc
diff --git a/third_party/aom/test/md5_helper.h b/media/libaom/src/test/md5_helper.h
index 9443cb262..9443cb262 100644
--- a/third_party/aom/test/md5_helper.h
+++ b/media/libaom/src/test/md5_helper.h
diff --git a/third_party/aom/test/metrics_template.html b/media/libaom/src/test/metrics_template.html
index b57c62314..b57c62314 100644
--- a/third_party/aom/test/metrics_template.html
+++ b/media/libaom/src/test/metrics_template.html
diff --git a/third_party/aom/test/monochrome_test.cc b/media/libaom/src/test/monochrome_test.cc
index ebccba584..ebccba584 100644
--- a/third_party/aom/test/monochrome_test.cc
+++ b/media/libaom/src/test/monochrome_test.cc
diff --git a/third_party/aom/test/motion_vector_test.cc b/media/libaom/src/test/motion_vector_test.cc
index 27eb93893..27eb93893 100644
--- a/third_party/aom/test/motion_vector_test.cc
+++ b/media/libaom/src/test/motion_vector_test.cc
diff --git a/third_party/aom/test/noise_model_test.cc b/media/libaom/src/test/noise_model_test.cc
index b5b387e31..b5b387e31 100644
--- a/third_party/aom/test/noise_model_test.cc
+++ b/media/libaom/src/test/noise_model_test.cc
diff --git a/third_party/aom/test/obmc_sad_test.cc b/media/libaom/src/test/obmc_sad_test.cc
index 6cef86961..6cef86961 100644
--- a/third_party/aom/test/obmc_sad_test.cc
+++ b/media/libaom/src/test/obmc_sad_test.cc
diff --git a/third_party/aom/test/obmc_variance_test.cc b/media/libaom/src/test/obmc_variance_test.cc
index 4563b964a..4563b964a 100644
--- a/third_party/aom/test/obmc_variance_test.cc
+++ b/media/libaom/src/test/obmc_variance_test.cc
diff --git a/third_party/aom/test/onyxc_int_test.cc b/media/libaom/src/test/onyxc_int_test.cc
index 388959518..388959518 100644
--- a/third_party/aom/test/onyxc_int_test.cc
+++ b/media/libaom/src/test/onyxc_int_test.cc
diff --git a/third_party/aom/test/pickrst_test.cc b/media/libaom/src/test/pickrst_test.cc
index 040e8e8b7..040e8e8b7 100644
--- a/third_party/aom/test/pickrst_test.cc
+++ b/media/libaom/src/test/pickrst_test.cc
diff --git a/third_party/aom/test/qm_test.cc b/media/libaom/src/test/qm_test.cc
index c87506b41..c87506b41 100644
--- a/third_party/aom/test/qm_test.cc
+++ b/media/libaom/src/test/qm_test.cc
diff --git a/third_party/aom/test/quantize_func_test.cc b/media/libaom/src/test/quantize_func_test.cc
index 554d0c721..554d0c721 100644
--- a/third_party/aom/test/quantize_func_test.cc
+++ b/media/libaom/src/test/quantize_func_test.cc
diff --git a/third_party/aom/test/reconinter_test.cc b/media/libaom/src/test/reconinter_test.cc
index a8536e517..a8536e517 100644
--- a/third_party/aom/test/reconinter_test.cc
+++ b/media/libaom/src/test/reconinter_test.cc
diff --git a/third_party/aom/test/register_state_check.h b/media/libaom/src/test/register_state_check.h
index d404621dd..d404621dd 100644
--- a/third_party/aom/test/register_state_check.h
+++ b/media/libaom/src/test/register_state_check.h
diff --git a/third_party/aom/test/resize_test.cc b/media/libaom/src/test/resize_test.cc
index b270b8362..b270b8362 100644
--- a/third_party/aom/test/resize_test.cc
+++ b/media/libaom/src/test/resize_test.cc
diff --git a/third_party/aom/test/run_encodes.sh b/media/libaom/src/test/run_encodes.sh
index 2096d8b15..2096d8b15 100755..100644
--- a/third_party/aom/test/run_encodes.sh
+++ b/media/libaom/src/test/run_encodes.sh
diff --git a/third_party/aom/test/sad_test.cc b/media/libaom/src/test/sad_test.cc
index 845fe79da..845fe79da 100644
--- a/third_party/aom/test/sad_test.cc
+++ b/media/libaom/src/test/sad_test.cc
diff --git a/third_party/aom/test/scalability_test.cc b/media/libaom/src/test/scalability_test.cc
index b39918861..b39918861 100644
--- a/third_party/aom/test/scalability_test.cc
+++ b/media/libaom/src/test/scalability_test.cc
diff --git a/third_party/aom/test/scan_test.cc b/media/libaom/src/test/scan_test.cc
index dee2ab5a6..dee2ab5a6 100644
--- a/third_party/aom/test/scan_test.cc
+++ b/media/libaom/src/test/scan_test.cc
diff --git a/third_party/aom/test/segment_binarization_sync.cc b/media/libaom/src/test/segment_binarization_sync.cc
index bd8cf1141..bd8cf1141 100644
--- a/third_party/aom/test/segment_binarization_sync.cc
+++ b/media/libaom/src/test/segment_binarization_sync.cc
diff --git a/third_party/aom/test/selfguided_filter_test.cc b/media/libaom/src/test/selfguided_filter_test.cc
index d2d5c6105..d2d5c6105 100644
--- a/third_party/aom/test/selfguided_filter_test.cc
+++ b/media/libaom/src/test/selfguided_filter_test.cc
diff --git a/third_party/aom/test/set_maps.sh b/media/libaom/src/test/set_maps.sh
index 4f59b06d6..4f59b06d6 100755..100644
--- a/third_party/aom/test/set_maps.sh
+++ b/media/libaom/src/test/set_maps.sh
diff --git a/third_party/aom/test/simd_avx2_test.cc b/media/libaom/src/test/simd_avx2_test.cc
index 8a012bff8..8a012bff8 100644
--- a/third_party/aom/test/simd_avx2_test.cc
+++ b/media/libaom/src/test/simd_avx2_test.cc
diff --git a/third_party/aom/test/simd_cmp_avx2.cc b/media/libaom/src/test/simd_cmp_avx2.cc
index cda632bcd..cda632bcd 100644
--- a/third_party/aom/test/simd_cmp_avx2.cc
+++ b/media/libaom/src/test/simd_cmp_avx2.cc
diff --git a/third_party/aom/test/simd_cmp_impl.h b/media/libaom/src/test/simd_cmp_impl.h
index b98af9aad..b98af9aad 100644
--- a/third_party/aom/test/simd_cmp_impl.h
+++ b/media/libaom/src/test/simd_cmp_impl.h
diff --git a/third_party/aom/test/simd_cmp_neon.cc b/media/libaom/src/test/simd_cmp_neon.cc
index 53c1e2a07..53c1e2a07 100644
--- a/third_party/aom/test/simd_cmp_neon.cc
+++ b/media/libaom/src/test/simd_cmp_neon.cc
diff --git a/third_party/aom/test/simd_cmp_sse2.cc b/media/libaom/src/test/simd_cmp_sse2.cc
index f7827a7fa..f7827a7fa 100644
--- a/third_party/aom/test/simd_cmp_sse2.cc
+++ b/media/libaom/src/test/simd_cmp_sse2.cc
diff --git a/third_party/aom/test/simd_cmp_sse4.cc b/media/libaom/src/test/simd_cmp_sse4.cc
index 3566764b6..3566764b6 100644
--- a/third_party/aom/test/simd_cmp_sse4.cc
+++ b/media/libaom/src/test/simd_cmp_sse4.cc
diff --git a/third_party/aom/test/simd_cmp_ssse3.cc b/media/libaom/src/test/simd_cmp_ssse3.cc
index 57bf135dd..57bf135dd 100644
--- a/third_party/aom/test/simd_cmp_ssse3.cc
+++ b/media/libaom/src/test/simd_cmp_ssse3.cc
diff --git a/third_party/aom/test/simd_impl.h b/media/libaom/src/test/simd_impl.h
index fd06f67fd..fd06f67fd 100644
--- a/third_party/aom/test/simd_impl.h
+++ b/media/libaom/src/test/simd_impl.h
diff --git a/third_party/aom/test/simd_neon_test.cc b/media/libaom/src/test/simd_neon_test.cc
index b67b18895..b67b18895 100644
--- a/third_party/aom/test/simd_neon_test.cc
+++ b/media/libaom/src/test/simd_neon_test.cc
diff --git a/third_party/aom/test/simd_sse2_test.cc b/media/libaom/src/test/simd_sse2_test.cc
index b37a931b3..b37a931b3 100644
--- a/third_party/aom/test/simd_sse2_test.cc
+++ b/media/libaom/src/test/simd_sse2_test.cc
diff --git a/third_party/aom/test/simd_sse4_test.cc b/media/libaom/src/test/simd_sse4_test.cc
index b1c9d5cd8..b1c9d5cd8 100644
--- a/third_party/aom/test/simd_sse4_test.cc
+++ b/media/libaom/src/test/simd_sse4_test.cc
diff --git a/third_party/aom/test/simd_ssse3_test.cc b/media/libaom/src/test/simd_ssse3_test.cc
index d95c26fb5..d95c26fb5 100644
--- a/third_party/aom/test/simd_ssse3_test.cc
+++ b/media/libaom/src/test/simd_ssse3_test.cc
diff --git a/third_party/aom/test/simple_decoder.sh b/media/libaom/src/test/simple_decoder.sh
index 5f39ad206..5f39ad206 100755..100644
--- a/third_party/aom/test/simple_decoder.sh
+++ b/media/libaom/src/test/simple_decoder.sh
diff --git a/third_party/aom/test/simple_encoder.sh b/media/libaom/src/test/simple_encoder.sh
index 5cd6b46a1..5cd6b46a1 100755..100644
--- a/third_party/aom/test/simple_encoder.sh
+++ b/media/libaom/src/test/simple_encoder.sh
diff --git a/third_party/aom/test/subtract_test.cc b/media/libaom/src/test/subtract_test.cc
index 7dcedf56d..7dcedf56d 100644
--- a/third_party/aom/test/subtract_test.cc
+++ b/media/libaom/src/test/subtract_test.cc
diff --git a/third_party/aom/test/sum_squares_test.cc b/media/libaom/src/test/sum_squares_test.cc
index f10998498..f10998498 100644
--- a/third_party/aom/test/sum_squares_test.cc
+++ b/media/libaom/src/test/sum_squares_test.cc
diff --git a/third_party/aom/test/superframe_test.cc b/media/libaom/src/test/superframe_test.cc
index 7be18f72a..7be18f72a 100644
--- a/third_party/aom/test/superframe_test.cc
+++ b/media/libaom/src/test/superframe_test.cc
diff --git a/third_party/aom/test/test-data.sha1 b/media/libaom/src/test/test-data.sha1
index b6ee34701..b6ee34701 100644
--- a/third_party/aom/test/test-data.sha1
+++ b/media/libaom/src/test/test-data.sha1
diff --git a/third_party/aom/test/test.cmake b/media/libaom/src/test/test.cmake
index b16ae14c3..b16ae14c3 100644
--- a/third_party/aom/test/test.cmake
+++ b/media/libaom/src/test/test.cmake
diff --git a/third_party/aom/test/test_data_download_worker.cmake b/media/libaom/src/test/test_data_download_worker.cmake
index dc803497d..dc803497d 100644
--- a/third_party/aom/test/test_data_download_worker.cmake
+++ b/media/libaom/src/test/test_data_download_worker.cmake
diff --git a/third_party/aom/test/test_data_util.cmake b/media/libaom/src/test/test_data_util.cmake
index 45c951478..45c951478 100644
--- a/third_party/aom/test/test_data_util.cmake
+++ b/media/libaom/src/test/test_data_util.cmake
diff --git a/third_party/aom/test/test_intra_pred_speed.cc b/media/libaom/src/test/test_intra_pred_speed.cc
index b72ac1167..b72ac1167 100644
--- a/third_party/aom/test/test_intra_pred_speed.cc
+++ b/media/libaom/src/test/test_intra_pred_speed.cc
diff --git a/third_party/aom/test/test_libaom.cc b/media/libaom/src/test/test_libaom.cc
index b55d76237..b55d76237 100644
--- a/third_party/aom/test/test_libaom.cc
+++ b/media/libaom/src/test/test_libaom.cc
diff --git a/third_party/aom/test/test_runner.cmake b/media/libaom/src/test/test_runner.cmake
index d3747b1e3..d3747b1e3 100644
--- a/third_party/aom/test/test_runner.cmake
+++ b/media/libaom/src/test/test_runner.cmake
diff --git a/third_party/aom/test/test_vector_test.cc b/media/libaom/src/test/test_vector_test.cc
index 286988b17..286988b17 100644
--- a/third_party/aom/test/test_vector_test.cc
+++ b/media/libaom/src/test/test_vector_test.cc
diff --git a/third_party/aom/test/test_vectors.cc b/media/libaom/src/test/test_vectors.cc
index 71e431e18..71e431e18 100644
--- a/third_party/aom/test/test_vectors.cc
+++ b/media/libaom/src/test/test_vectors.cc
diff --git a/third_party/aom/test/test_vectors.h b/media/libaom/src/test/test_vectors.h
index be37f6e37..be37f6e37 100644
--- a/third_party/aom/test/test_vectors.h
+++ b/media/libaom/src/test/test_vectors.h
diff --git a/third_party/aom/test/tile_independence_test.cc b/media/libaom/src/test/tile_independence_test.cc
index cf534c0c5..cf534c0c5 100644
--- a/third_party/aom/test/tile_independence_test.cc
+++ b/media/libaom/src/test/tile_independence_test.cc
diff --git a/third_party/aom/test/tools_common.sh b/media/libaom/src/test/tools_common.sh
index c08710606..c08710606 100755..100644
--- a/third_party/aom/test/tools_common.sh
+++ b/media/libaom/src/test/tools_common.sh
diff --git a/third_party/aom/test/transform_test_base.h b/media/libaom/src/test/transform_test_base.h
index 8ebcf5ff7..8ebcf5ff7 100644
--- a/third_party/aom/test/transform_test_base.h
+++ b/media/libaom/src/test/transform_test_base.h
diff --git a/third_party/aom/test/twopass_encoder.sh b/media/libaom/src/test/twopass_encoder.sh
index cca44ced8..cca44ced8 100755..100644
--- a/third_party/aom/test/twopass_encoder.sh
+++ b/media/libaom/src/test/twopass_encoder.sh
diff --git a/third_party/aom/test/util.h b/media/libaom/src/test/util.h
index c3f4e4442..c3f4e4442 100644
--- a/third_party/aom/test/util.h
+++ b/media/libaom/src/test/util.h
diff --git a/third_party/aom/test/variance_test.cc b/media/libaom/src/test/variance_test.cc
index 0df314b0f..0df314b0f 100644
--- a/third_party/aom/test/variance_test.cc
+++ b/media/libaom/src/test/variance_test.cc
diff --git a/third_party/aom/test/video_source.h b/media/libaom/src/test/video_source.h
index 3c1c5e559..3c1c5e559 100644
--- a/third_party/aom/test/video_source.h
+++ b/media/libaom/src/test/video_source.h
diff --git a/third_party/aom/test/visual_metrics.py b/media/libaom/src/test/visual_metrics.py
index 9055feb33..9055feb33 100755..100644
--- a/third_party/aom/test/visual_metrics.py
+++ b/media/libaom/src/test/visual_metrics.py
diff --git a/third_party/aom/test/warp_filter_test.cc b/media/libaom/src/test/warp_filter_test.cc
index 19a4e8b6a..19a4e8b6a 100644
--- a/third_party/aom/test/warp_filter_test.cc
+++ b/media/libaom/src/test/warp_filter_test.cc
diff --git a/third_party/aom/test/warp_filter_test_util.cc b/media/libaom/src/test/warp_filter_test_util.cc
index 69b2ed4af..69b2ed4af 100644
--- a/third_party/aom/test/warp_filter_test_util.cc
+++ b/media/libaom/src/test/warp_filter_test_util.cc
diff --git a/third_party/aom/test/warp_filter_test_util.h b/media/libaom/src/test/warp_filter_test_util.h
index b8998e5c8..b8998e5c8 100644
--- a/third_party/aom/test/warp_filter_test_util.h
+++ b/media/libaom/src/test/warp_filter_test_util.h
diff --git a/third_party/aom/test/webm_video_source.h b/media/libaom/src/test/webm_video_source.h
index bb3d11735..bb3d11735 100644
--- a/third_party/aom/test/webm_video_source.h
+++ b/media/libaom/src/test/webm_video_source.h
diff --git a/third_party/aom/test/wiener_test.cc b/media/libaom/src/test/wiener_test.cc
index dfec09119..dfec09119 100644
--- a/third_party/aom/test/wiener_test.cc
+++ b/media/libaom/src/test/wiener_test.cc
diff --git a/third_party/aom/test/y4m_test.cc b/media/libaom/src/test/y4m_test.cc
index 6cc75ef5b..6cc75ef5b 100644
--- a/third_party/aom/test/y4m_test.cc
+++ b/media/libaom/src/test/y4m_test.cc
diff --git a/third_party/aom/test/y4m_video_source.h b/media/libaom/src/test/y4m_video_source.h
index 3dea901e6..3dea901e6 100644
--- a/third_party/aom/test/y4m_video_source.h
+++ b/media/libaom/src/test/y4m_video_source.h
diff --git a/third_party/aom/test/yuv_video_source.h b/media/libaom/src/test/yuv_video_source.h
index 774ecc008..774ecc008 100644
--- a/third_party/aom/test/yuv_video_source.h
+++ b/media/libaom/src/test/yuv_video_source.h
diff --git a/third_party/aom/third_party/fastfeat/LICENSE b/media/libaom/src/third_party/fastfeat/LICENSE
index f347008d6..f347008d6 100644
--- a/third_party/aom/third_party/fastfeat/LICENSE
+++ b/media/libaom/src/third_party/fastfeat/LICENSE
diff --git a/third_party/aom/third_party/fastfeat/README.libvpx b/media/libaom/src/third_party/fastfeat/README.libvpx
index 1e58a303b..1e58a303b 100644
--- a/third_party/aom/third_party/fastfeat/README.libvpx
+++ b/media/libaom/src/third_party/fastfeat/README.libvpx
diff --git a/third_party/aom/third_party/fastfeat/fast.c b/media/libaom/src/third_party/fastfeat/fast.c
index 0d7efc154..0d7efc154 100644
--- a/third_party/aom/third_party/fastfeat/fast.c
+++ b/media/libaom/src/third_party/fastfeat/fast.c
diff --git a/third_party/aom/third_party/fastfeat/fast.h b/media/libaom/src/third_party/fastfeat/fast.h
index a00730e3d..a00730e3d 100644
--- a/third_party/aom/third_party/fastfeat/fast.h
+++ b/media/libaom/src/third_party/fastfeat/fast.h
diff --git a/third_party/aom/third_party/fastfeat/fast_9.c b/media/libaom/src/third_party/fastfeat/fast_9.c
index ec167a953..ec167a953 100644
--- a/third_party/aom/third_party/fastfeat/fast_9.c
+++ b/media/libaom/src/third_party/fastfeat/fast_9.c
diff --git a/third_party/aom/third_party/fastfeat/nonmax.c b/media/libaom/src/third_party/fastfeat/nonmax.c
index 0438c4dc1..0438c4dc1 100644
--- a/third_party/aom/third_party/fastfeat/nonmax.c
+++ b/media/libaom/src/third_party/fastfeat/nonmax.c
diff --git a/third_party/aom/third_party/googletest/README.libaom b/media/libaom/src/third_party/googletest/README.libaom
index 9784dd51b..9784dd51b 100644
--- a/third_party/aom/third_party/googletest/README.libaom
+++ b/media/libaom/src/third_party/googletest/README.libaom
diff --git a/third_party/aom/third_party/googletest/gtest.mk b/media/libaom/src/third_party/googletest/gtest.mk
index fc4dbdc24..fc4dbdc24 100644
--- a/third_party/aom/third_party/googletest/gtest.mk
+++ b/media/libaom/src/third_party/googletest/gtest.mk
diff --git a/third_party/aom/third_party/googletest/src/googletest/CHANGES b/media/libaom/src/third_party/googletest/src/googletest/CHANGES
index 055213242..055213242 100644
--- a/third_party/aom/third_party/googletest/src/googletest/CHANGES
+++ b/media/libaom/src/third_party/googletest/src/googletest/CHANGES
diff --git a/third_party/aom/third_party/googletest/src/googletest/CMakeLists.txt b/media/libaom/src/third_party/googletest/src/googletest/CMakeLists.txt
index 621d0f042..621d0f042 100644
--- a/third_party/aom/third_party/googletest/src/googletest/CMakeLists.txt
+++ b/media/libaom/src/third_party/googletest/src/googletest/CMakeLists.txt
diff --git a/third_party/aom/third_party/googletest/src/googletest/CONTRIBUTORS b/media/libaom/src/third_party/googletest/src/googletest/CONTRIBUTORS
index feae2fc04..feae2fc04 100644
--- a/third_party/aom/third_party/googletest/src/googletest/CONTRIBUTORS
+++ b/media/libaom/src/third_party/googletest/src/googletest/CONTRIBUTORS
diff --git a/third_party/aom/third_party/googletest/src/googletest/LICENSE b/media/libaom/src/third_party/googletest/src/googletest/LICENSE
index 1941a11f8..1941a11f8 100644
--- a/third_party/aom/third_party/googletest/src/googletest/LICENSE
+++ b/media/libaom/src/third_party/googletest/src/googletest/LICENSE
diff --git a/third_party/aom/third_party/googletest/src/googletest/README.md b/media/libaom/src/third_party/googletest/src/googletest/README.md
index edd440805..edd440805 100644
--- a/third_party/aom/third_party/googletest/src/googletest/README.md
+++ b/media/libaom/src/third_party/googletest/src/googletest/README.md
diff --git a/third_party/aom/third_party/googletest/src/googletest/cmake/internal_utils.cmake b/media/libaom/src/third_party/googletest/src/googletest/cmake/internal_utils.cmake
index 777b91ed4..777b91ed4 100644
--- a/third_party/aom/third_party/googletest/src/googletest/cmake/internal_utils.cmake
+++ b/media/libaom/src/third_party/googletest/src/googletest/cmake/internal_utils.cmake
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-death-test.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-death-test.h
index 957a69c6a..957a69c6a 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-death-test.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-death-test.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-message.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-message.h
index fe879bca7..fe879bca7 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-message.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-message.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h
index 038f9ba79..038f9ba79 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h.pump b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h.pump
index 3078d6d2a..3078d6d2a 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h.pump
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-param-test.h.pump
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-printers.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-printers.h
index 8a33164cb..8a33164cb 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-printers.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-printers.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-spi.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-spi.h
index f63fa9a1b..f63fa9a1b 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-spi.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-spi.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-test-part.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-test-part.h
index 77eb84483..77eb84483 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-test-part.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-test-part.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-typed-test.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-typed-test.h
index 5f69d5678..5f69d5678 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest-typed-test.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest-typed-test.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest.h
index f846c5bd6..f846c5bd6 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest_pred_impl.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest_pred_impl.h
index 30ae712f5..30ae712f5 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest_pred_impl.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest_pred_impl.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest_prod.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest_prod.h
index da80ddc6c..da80ddc6c 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/gtest_prod.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/gtest_prod.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest-port.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest-port.h
index 7e744bd3b..7e744bd3b 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest-port.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest-port.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest-printers.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest-printers.h
index 60c1ea050..60c1ea050 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest-printers.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest-printers.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest.h
index c27412a89..c27412a89 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/custom/gtest.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-death-test-internal.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-death-test-internal.h
index 2b3a78f5b..2b3a78f5b 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-death-test-internal.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-death-test-internal.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-filepath.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-filepath.h
index 7a13b4b0d..7a13b4b0d 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-filepath.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-filepath.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-internal.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-internal.h
index ebd1cf615..ebd1cf615 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-internal.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-internal.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-linked_ptr.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-linked_ptr.h
index 360294221..360294221 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-linked_ptr.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-linked_ptr.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util-generated.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util-generated.h
index 4d1d81d20..4d1d81d20 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util-generated.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util-generated.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util-generated.h.pump b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util-generated.h.pump
index 5c7c47af0..5c7c47af0 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util-generated.h.pump
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util-generated.h.pump
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util.h
index 82cab9b02..82cab9b02 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-param-util.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port-arch.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-port-arch.h
index 74ab94905..74ab94905 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port-arch.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-port-arch.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h
index da57e65d3..da57e65d3 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-port.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-string.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-string.h
index 97f1a7fdd..97f1a7fdd 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-string.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-string.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-tuple.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-tuple.h
index e9b405340..e9b405340 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-tuple.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-tuple.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-tuple.h.pump b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-tuple.h.pump
index 429ddfeec..429ddfeec 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-tuple.h.pump
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-tuple.h.pump
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h
index e46f7cfcb..e46f7cfcb 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h.pump b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h.pump
index 251fdf025..251fdf025 100644
--- a/third_party/aom/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h.pump
+++ b/media/libaom/src/third_party/googletest/src/googletest/include/gtest/internal/gtest-type-util.h.pump
diff --git a/third_party/aom/third_party/googletest/src/googletest/src/gtest-all.cc b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-all.cc
index 0a9cee522..0a9cee522 100644
--- a/third_party/aom/third_party/googletest/src/googletest/src/gtest-all.cc
+++ b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-all.cc
diff --git a/third_party/aom/third_party/googletest/src/googletest/src/gtest-death-test.cc b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-death-test.cc
index a01a36983..a01a36983 100644
--- a/third_party/aom/third_party/googletest/src/googletest/src/gtest-death-test.cc
+++ b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-death-test.cc
diff --git a/third_party/aom/third_party/googletest/src/googletest/src/gtest-filepath.cc b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-filepath.cc
index 0292dc119..0292dc119 100644
--- a/third_party/aom/third_party/googletest/src/googletest/src/gtest-filepath.cc
+++ b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-filepath.cc
diff --git a/third_party/aom/third_party/googletest/src/googletest/src/gtest-internal-inl.h b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-internal-inl.h
index ed8a682a9..ed8a682a9 100644
--- a/third_party/aom/third_party/googletest/src/googletest/src/gtest-internal-inl.h
+++ b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-internal-inl.h
diff --git a/third_party/aom/third_party/googletest/src/googletest/src/gtest-port.cc b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-port.cc
index e5bf3dd2b..e5bf3dd2b 100644
--- a/third_party/aom/third_party/googletest/src/googletest/src/gtest-port.cc
+++ b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-port.cc
diff --git a/third_party/aom/third_party/googletest/src/googletest/src/gtest-printers.cc b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-printers.cc
index a2df412f8..a2df412f8 100644
--- a/third_party/aom/third_party/googletest/src/googletest/src/gtest-printers.cc
+++ b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-printers.cc
diff --git a/third_party/aom/third_party/googletest/src/googletest/src/gtest-test-part.cc b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-test-part.cc
index fb0e35425..fb0e35425 100644
--- a/third_party/aom/third_party/googletest/src/googletest/src/gtest-test-part.cc
+++ b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-test-part.cc
diff --git a/third_party/aom/third_party/googletest/src/googletest/src/gtest-typed-test.cc b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-typed-test.cc
index df1eef475..df1eef475 100644
--- a/third_party/aom/third_party/googletest/src/googletest/src/gtest-typed-test.cc
+++ b/media/libaom/src/third_party/googletest/src/googletest/src/gtest-typed-test.cc
diff --git a/third_party/aom/third_party/googletest/src/googletest/src/gtest.cc b/media/libaom/src/third_party/googletest/src/googletest/src/gtest.cc
index 5a8932c73..5a8932c73 100644
--- a/third_party/aom/third_party/googletest/src/googletest/src/gtest.cc
+++ b/media/libaom/src/third_party/googletest/src/googletest/src/gtest.cc
diff --git a/third_party/aom/third_party/googletest/src/googletest/src/gtest_main.cc b/media/libaom/src/third_party/googletest/src/googletest/src/gtest_main.cc
index f30282255..f30282255 100644
--- a/third_party/aom/third_party/googletest/src/googletest/src/gtest_main.cc
+++ b/media/libaom/src/third_party/googletest/src/googletest/src/gtest_main.cc
diff --git a/third_party/aom/third_party/libwebm/AUTHORS.TXT b/media/libaom/src/third_party/libwebm/AUTHORS.TXT
index 9686ac13e..9686ac13e 100644
--- a/third_party/aom/third_party/libwebm/AUTHORS.TXT
+++ b/media/libaom/src/third_party/libwebm/AUTHORS.TXT
diff --git a/third_party/aom/third_party/libwebm/Android.mk b/media/libaom/src/third_party/libwebm/Android.mk
index b46ba101d..b46ba101d 100644
--- a/third_party/aom/third_party/libwebm/Android.mk
+++ b/media/libaom/src/third_party/libwebm/Android.mk
diff --git a/third_party/aom/third_party/libwebm/LICENSE.TXT b/media/libaom/src/third_party/libwebm/LICENSE.TXT
index 7a6f99547..7a6f99547 100644
--- a/third_party/aom/third_party/libwebm/LICENSE.TXT
+++ b/media/libaom/src/third_party/libwebm/LICENSE.TXT
diff --git a/third_party/aom/third_party/libwebm/PATENTS.TXT b/media/libaom/src/third_party/libwebm/PATENTS.TXT
index caedf607e..caedf607e 100644
--- a/third_party/aom/third_party/libwebm/PATENTS.TXT
+++ b/media/libaom/src/third_party/libwebm/PATENTS.TXT
diff --git a/third_party/aom/third_party/libwebm/README.libaom b/media/libaom/src/third_party/libwebm/README.libaom
index bd288d201..bd288d201 100644
--- a/third_party/aom/third_party/libwebm/README.libaom
+++ b/media/libaom/src/third_party/libwebm/README.libaom
diff --git a/third_party/aom/third_party/libwebm/common/file_util.cc b/media/libaom/src/third_party/libwebm/common/file_util.cc
index 618ffc087..618ffc087 100644
--- a/third_party/aom/third_party/libwebm/common/file_util.cc
+++ b/media/libaom/src/third_party/libwebm/common/file_util.cc
diff --git a/third_party/aom/third_party/libwebm/common/file_util.h b/media/libaom/src/third_party/libwebm/common/file_util.h
index a87373464..a87373464 100644
--- a/third_party/aom/third_party/libwebm/common/file_util.h
+++ b/media/libaom/src/third_party/libwebm/common/file_util.h
diff --git a/third_party/aom/third_party/libwebm/common/hdr_util.cc b/media/libaom/src/third_party/libwebm/common/hdr_util.cc
index 916f7170b..916f7170b 100644
--- a/third_party/aom/third_party/libwebm/common/hdr_util.cc
+++ b/media/libaom/src/third_party/libwebm/common/hdr_util.cc
diff --git a/third_party/aom/third_party/libwebm/common/hdr_util.h b/media/libaom/src/third_party/libwebm/common/hdr_util.h
index 78e2eeb70..78e2eeb70 100644
--- a/third_party/aom/third_party/libwebm/common/hdr_util.h
+++ b/media/libaom/src/third_party/libwebm/common/hdr_util.h
diff --git a/third_party/aom/third_party/libwebm/common/webmids.h b/media/libaom/src/third_party/libwebm/common/webmids.h
index 89d722a71..89d722a71 100644
--- a/third_party/aom/third_party/libwebm/common/webmids.h
+++ b/media/libaom/src/third_party/libwebm/common/webmids.h
diff --git a/third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxer.cc b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxer.cc
index bae2c99b8..bae2c99b8 100644
--- a/third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxer.cc
+++ b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxer.cc
diff --git a/third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxer.h b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxer.h
index 9e817bced..9e817bced 100644
--- a/third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxer.h
+++ b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxer.h
diff --git a/third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxertypes.h b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxertypes.h
index e5db12160..e5db12160 100644
--- a/third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxertypes.h
+++ b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxertypes.h
diff --git a/third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc
index 355d4e22b..355d4e22b 100644
--- a/third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc
+++ b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxerutil.cc
diff --git a/third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxerutil.h b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxerutil.h
index 132388da5..132388da5 100644
--- a/third_party/aom/third_party/libwebm/mkvmuxer/mkvmuxerutil.h
+++ b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvmuxerutil.h
diff --git a/third_party/aom/third_party/libwebm/mkvmuxer/mkvwriter.cc b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvwriter.cc
index 84655d802..84655d802 100644
--- a/third_party/aom/third_party/libwebm/mkvmuxer/mkvwriter.cc
+++ b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvwriter.cc
diff --git a/third_party/aom/third_party/libwebm/mkvmuxer/mkvwriter.h b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvwriter.h
index 4227c6374..4227c6374 100644
--- a/third_party/aom/third_party/libwebm/mkvmuxer/mkvwriter.h
+++ b/media/libaom/src/third_party/libwebm/mkvmuxer/mkvwriter.h
diff --git a/third_party/aom/third_party/libwebm/mkvparser/mkvparser.cc b/media/libaom/src/third_party/libwebm/mkvparser/mkvparser.cc
index e7b76f7da..e7b76f7da 100644
--- a/third_party/aom/third_party/libwebm/mkvparser/mkvparser.cc
+++ b/media/libaom/src/third_party/libwebm/mkvparser/mkvparser.cc
diff --git a/third_party/aom/third_party/libwebm/mkvparser/mkvparser.h b/media/libaom/src/third_party/libwebm/mkvparser/mkvparser.h
index 26c2b7e5e..26c2b7e5e 100644
--- a/third_party/aom/third_party/libwebm/mkvparser/mkvparser.h
+++ b/media/libaom/src/third_party/libwebm/mkvparser/mkvparser.h
diff --git a/third_party/aom/third_party/libwebm/mkvparser/mkvreader.cc b/media/libaom/src/third_party/libwebm/mkvparser/mkvreader.cc
index 23d68f508..23d68f508 100644
--- a/third_party/aom/third_party/libwebm/mkvparser/mkvreader.cc
+++ b/media/libaom/src/third_party/libwebm/mkvparser/mkvreader.cc
diff --git a/third_party/aom/third_party/libwebm/mkvparser/mkvreader.h b/media/libaom/src/third_party/libwebm/mkvparser/mkvreader.h
index 9831ecf64..9831ecf64 100644
--- a/third_party/aom/third_party/libwebm/mkvparser/mkvreader.h
+++ b/media/libaom/src/third_party/libwebm/mkvparser/mkvreader.h
diff --git a/third_party/aom/third_party/libyuv/README.libaom b/media/libaom/src/third_party/libyuv/README.libaom
index 09693c1f2..09693c1f2 100644
--- a/third_party/aom/third_party/libyuv/README.libaom
+++ b/media/libaom/src/third_party/libyuv/README.libaom
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/basic_types.h b/media/libaom/src/third_party/libyuv/include/libyuv/basic_types.h
index 66e68536c..66e68536c 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/basic_types.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/basic_types.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/compare.h b/media/libaom/src/third_party/libyuv/include/libyuv/compare.h
index 2a9f1560c..2a9f1560c 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/compare.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/compare.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/convert.h b/media/libaom/src/third_party/libyuv/include/libyuv/convert.h
index d6f206c10..d6f206c10 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/convert.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/convert.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/convert_argb.h b/media/libaom/src/third_party/libyuv/include/libyuv/convert_argb.h
index ea75c0b26..ea75c0b26 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/convert_argb.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/convert_argb.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/convert_from.h b/media/libaom/src/third_party/libyuv/include/libyuv/convert_from.h
index 3591b4fd6..3591b4fd6 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/convert_from.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/convert_from.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/convert_from_argb.h b/media/libaom/src/third_party/libyuv/include/libyuv/convert_from_argb.h
index 4a6226813..4a6226813 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/convert_from_argb.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/convert_from_argb.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/cpu_id.h b/media/libaom/src/third_party/libyuv/include/libyuv/cpu_id.h
index 870e94e8c..870e94e8c 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/cpu_id.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/cpu_id.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/mjpeg_decoder.h b/media/libaom/src/third_party/libyuv/include/libyuv/mjpeg_decoder.h
index fa1e51f9a..fa1e51f9a 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/mjpeg_decoder.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/mjpeg_decoder.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/planar_functions.h b/media/libaom/src/third_party/libyuv/include/libyuv/planar_functions.h
index 7fe4d8eed..7fe4d8eed 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/planar_functions.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/planar_functions.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/rotate.h b/media/libaom/src/third_party/libyuv/include/libyuv/rotate.h
index 8a9673f28..8a9673f28 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/rotate.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/rotate.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/rotate_argb.h b/media/libaom/src/third_party/libyuv/include/libyuv/rotate_argb.h
index 2bdc8ec6b..2bdc8ec6b 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/rotate_argb.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/rotate_argb.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/rotate_row.h b/media/libaom/src/third_party/libyuv/include/libyuv/rotate_row.h
index d0bfbdd2b..d0bfbdd2b 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/rotate_row.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/rotate_row.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/row.h b/media/libaom/src/third_party/libyuv/include/libyuv/row.h
index 5c3187ef7..5c3187ef7 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/row.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/row.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/scale.h b/media/libaom/src/third_party/libyuv/include/libyuv/scale.h
index 3974aba34..3974aba34 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/scale.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/scale.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/scale_argb.h b/media/libaom/src/third_party/libyuv/include/libyuv/scale_argb.h
index 22563837d..22563837d 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/scale_argb.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/scale_argb.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/scale_row.h b/media/libaom/src/third_party/libyuv/include/libyuv/scale_row.h
index a46b5ce69..a46b5ce69 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/scale_row.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/scale_row.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/version.h b/media/libaom/src/third_party/libyuv/include/libyuv/version.h
index 287b98ebf..287b98ebf 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/version.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/version.h
diff --git a/third_party/aom/third_party/libyuv/include/libyuv/video_common.h b/media/libaom/src/third_party/libyuv/include/libyuv/video_common.h
index 7b0a19cc9..7b0a19cc9 100644
--- a/third_party/aom/third_party/libyuv/include/libyuv/video_common.h
+++ b/media/libaom/src/third_party/libyuv/include/libyuv/video_common.h
diff --git a/third_party/aom/third_party/libyuv/source/compare.cc b/media/libaom/src/third_party/libyuv/source/compare.cc
index 46aa8473d..46aa8473d 100644
--- a/third_party/aom/third_party/libyuv/source/compare.cc
+++ b/media/libaom/src/third_party/libyuv/source/compare.cc
diff --git a/third_party/aom/third_party/libyuv/source/compare_common.cc b/media/libaom/src/third_party/libyuv/source/compare_common.cc
index c546b5182..c546b5182 100644
--- a/third_party/aom/third_party/libyuv/source/compare_common.cc
+++ b/media/libaom/src/third_party/libyuv/source/compare_common.cc
diff --git a/third_party/aom/third_party/libyuv/source/compare_gcc.cc b/media/libaom/src/third_party/libyuv/source/compare_gcc.cc
index 247cb33bb..247cb33bb 100644
--- a/third_party/aom/third_party/libyuv/source/compare_gcc.cc
+++ b/media/libaom/src/third_party/libyuv/source/compare_gcc.cc
diff --git a/third_party/aom/third_party/libyuv/source/compare_neon.cc b/media/libaom/src/third_party/libyuv/source/compare_neon.cc
index ef006ec41..ef006ec41 100644
--- a/third_party/aom/third_party/libyuv/source/compare_neon.cc
+++ b/media/libaom/src/third_party/libyuv/source/compare_neon.cc
diff --git a/third_party/aom/third_party/libyuv/source/compare_neon64.cc b/media/libaom/src/third_party/libyuv/source/compare_neon64.cc
index 6d1e5e1bc..6d1e5e1bc 100644
--- a/third_party/aom/third_party/libyuv/source/compare_neon64.cc
+++ b/media/libaom/src/third_party/libyuv/source/compare_neon64.cc
diff --git a/third_party/aom/third_party/libyuv/source/compare_win.cc b/media/libaom/src/third_party/libyuv/source/compare_win.cc
index 19806f275..19806f275 100644
--- a/third_party/aom/third_party/libyuv/source/compare_win.cc
+++ b/media/libaom/src/third_party/libyuv/source/compare_win.cc
diff --git a/third_party/aom/third_party/libyuv/source/convert.cc b/media/libaom/src/third_party/libyuv/source/convert.cc
index 3ad6bd7a4..3ad6bd7a4 100644
--- a/third_party/aom/third_party/libyuv/source/convert.cc
+++ b/media/libaom/src/third_party/libyuv/source/convert.cc
diff --git a/third_party/aom/third_party/libyuv/source/convert_argb.cc b/media/libaom/src/third_party/libyuv/source/convert_argb.cc
index 44756bc41..44756bc41 100644
--- a/third_party/aom/third_party/libyuv/source/convert_argb.cc
+++ b/media/libaom/src/third_party/libyuv/source/convert_argb.cc
diff --git a/third_party/aom/third_party/libyuv/source/convert_from.cc b/media/libaom/src/third_party/libyuv/source/convert_from.cc
index 31f1ac992..31f1ac992 100644
--- a/third_party/aom/third_party/libyuv/source/convert_from.cc
+++ b/media/libaom/src/third_party/libyuv/source/convert_from.cc
diff --git a/third_party/aom/third_party/libyuv/source/convert_from_argb.cc b/media/libaom/src/third_party/libyuv/source/convert_from_argb.cc
index 8d1e97aec..8d1e97aec 100644
--- a/third_party/aom/third_party/libyuv/source/convert_from_argb.cc
+++ b/media/libaom/src/third_party/libyuv/source/convert_from_argb.cc
diff --git a/third_party/aom/third_party/libyuv/source/convert_jpeg.cc b/media/libaom/src/third_party/libyuv/source/convert_jpeg.cc
index bcb980f7f..bcb980f7f 100644
--- a/third_party/aom/third_party/libyuv/source/convert_jpeg.cc
+++ b/media/libaom/src/third_party/libyuv/source/convert_jpeg.cc
diff --git a/third_party/aom/third_party/libyuv/source/convert_to_argb.cc b/media/libaom/src/third_party/libyuv/source/convert_to_argb.cc
index af829fbd3..af829fbd3 100644
--- a/third_party/aom/third_party/libyuv/source/convert_to_argb.cc
+++ b/media/libaom/src/third_party/libyuv/source/convert_to_argb.cc
diff --git a/third_party/aom/third_party/libyuv/source/convert_to_i420.cc b/media/libaom/src/third_party/libyuv/source/convert_to_i420.cc
index 5e75369b5..5e75369b5 100644
--- a/third_party/aom/third_party/libyuv/source/convert_to_i420.cc
+++ b/media/libaom/src/third_party/libyuv/source/convert_to_i420.cc
diff --git a/third_party/aom/third_party/libyuv/source/cpu_id.cc b/media/libaom/src/third_party/libyuv/source/cpu_id.cc
index 72f686e3b..72f686e3b 100644
--- a/third_party/aom/third_party/libyuv/source/cpu_id.cc
+++ b/media/libaom/src/third_party/libyuv/source/cpu_id.cc
diff --git a/third_party/aom/third_party/libyuv/source/mjpeg_decoder.cc b/media/libaom/src/third_party/libyuv/source/mjpeg_decoder.cc
index 75f8a610e..75f8a610e 100644
--- a/third_party/aom/third_party/libyuv/source/mjpeg_decoder.cc
+++ b/media/libaom/src/third_party/libyuv/source/mjpeg_decoder.cc
diff --git a/third_party/aom/third_party/libyuv/source/mjpeg_validate.cc b/media/libaom/src/third_party/libyuv/source/mjpeg_validate.cc
index 8edfbe1e7..8edfbe1e7 100644
--- a/third_party/aom/third_party/libyuv/source/mjpeg_validate.cc
+++ b/media/libaom/src/third_party/libyuv/source/mjpeg_validate.cc
diff --git a/third_party/aom/third_party/libyuv/source/planar_functions.cc b/media/libaom/src/third_party/libyuv/source/planar_functions.cc
index b96bd5020..b96bd5020 100644
--- a/third_party/aom/third_party/libyuv/source/planar_functions.cc
+++ b/media/libaom/src/third_party/libyuv/source/planar_functions.cc
diff --git a/third_party/aom/third_party/libyuv/source/rotate.cc b/media/libaom/src/third_party/libyuv/source/rotate.cc
index be3d58920..be3d58920 100644
--- a/third_party/aom/third_party/libyuv/source/rotate.cc
+++ b/media/libaom/src/third_party/libyuv/source/rotate.cc
diff --git a/third_party/aom/third_party/libyuv/source/rotate_any.cc b/media/libaom/src/third_party/libyuv/source/rotate_any.cc
index 4d6eb34e1..4d6eb34e1 100644
--- a/third_party/aom/third_party/libyuv/source/rotate_any.cc
+++ b/media/libaom/src/third_party/libyuv/source/rotate_any.cc
diff --git a/third_party/aom/third_party/libyuv/source/rotate_argb.cc b/media/libaom/src/third_party/libyuv/source/rotate_argb.cc
index 787c0ad1b..787c0ad1b 100644
--- a/third_party/aom/third_party/libyuv/source/rotate_argb.cc
+++ b/media/libaom/src/third_party/libyuv/source/rotate_argb.cc
diff --git a/third_party/aom/third_party/libyuv/source/rotate_common.cc b/media/libaom/src/third_party/libyuv/source/rotate_common.cc
index b33a9a0c6..b33a9a0c6 100644
--- a/third_party/aom/third_party/libyuv/source/rotate_common.cc
+++ b/media/libaom/src/third_party/libyuv/source/rotate_common.cc
diff --git a/third_party/aom/third_party/libyuv/source/rotate_gcc.cc b/media/libaom/src/third_party/libyuv/source/rotate_gcc.cc
index fd385bcd3..fd385bcd3 100644
--- a/third_party/aom/third_party/libyuv/source/rotate_gcc.cc
+++ b/media/libaom/src/third_party/libyuv/source/rotate_gcc.cc
diff --git a/third_party/aom/third_party/libyuv/source/rotate_mips.cc b/media/libaom/src/third_party/libyuv/source/rotate_mips.cc
index efe6bd909..efe6bd909 100644
--- a/third_party/aom/third_party/libyuv/source/rotate_mips.cc
+++ b/media/libaom/src/third_party/libyuv/source/rotate_mips.cc
diff --git a/third_party/aom/third_party/libyuv/source/rotate_neon.cc b/media/libaom/src/third_party/libyuv/source/rotate_neon.cc
index 76043b3b3..76043b3b3 100644
--- a/third_party/aom/third_party/libyuv/source/rotate_neon.cc
+++ b/media/libaom/src/third_party/libyuv/source/rotate_neon.cc
diff --git a/third_party/aom/third_party/libyuv/source/rotate_neon64.cc b/media/libaom/src/third_party/libyuv/source/rotate_neon64.cc
index f52c082b3..f52c082b3 100644
--- a/third_party/aom/third_party/libyuv/source/rotate_neon64.cc
+++ b/media/libaom/src/third_party/libyuv/source/rotate_neon64.cc
diff --git a/third_party/aom/third_party/libyuv/source/rotate_win.cc b/media/libaom/src/third_party/libyuv/source/rotate_win.cc
index 2760066df..2760066df 100644
--- a/third_party/aom/third_party/libyuv/source/rotate_win.cc
+++ b/media/libaom/src/third_party/libyuv/source/rotate_win.cc
diff --git a/third_party/aom/third_party/libyuv/source/row_any.cc b/media/libaom/src/third_party/libyuv/source/row_any.cc
index 1cb1f6b93..1cb1f6b93 100644
--- a/third_party/aom/third_party/libyuv/source/row_any.cc
+++ b/media/libaom/src/third_party/libyuv/source/row_any.cc
diff --git a/third_party/aom/third_party/libyuv/source/row_common.cc b/media/libaom/src/third_party/libyuv/source/row_common.cc
index 49875894f..49875894f 100644
--- a/third_party/aom/third_party/libyuv/source/row_common.cc
+++ b/media/libaom/src/third_party/libyuv/source/row_common.cc
diff --git a/third_party/aom/third_party/libyuv/source/row_gcc.cc b/media/libaom/src/third_party/libyuv/source/row_gcc.cc
index 820de0a1c..820de0a1c 100644
--- a/third_party/aom/third_party/libyuv/source/row_gcc.cc
+++ b/media/libaom/src/third_party/libyuv/source/row_gcc.cc
diff --git a/third_party/aom/third_party/libyuv/source/row_mips.cc b/media/libaom/src/third_party/libyuv/source/row_mips.cc
index cfc9ffe03..cfc9ffe03 100644
--- a/third_party/aom/third_party/libyuv/source/row_mips.cc
+++ b/media/libaom/src/third_party/libyuv/source/row_mips.cc
diff --git a/third_party/aom/third_party/libyuv/source/row_neon.cc b/media/libaom/src/third_party/libyuv/source/row_neon.cc
index 1a72eb903..1a72eb903 100644
--- a/third_party/aom/third_party/libyuv/source/row_neon.cc
+++ b/media/libaom/src/third_party/libyuv/source/row_neon.cc
diff --git a/third_party/aom/third_party/libyuv/source/row_neon64.cc b/media/libaom/src/third_party/libyuv/source/row_neon64.cc
index 5d015454b..5d015454b 100644
--- a/third_party/aom/third_party/libyuv/source/row_neon64.cc
+++ b/media/libaom/src/third_party/libyuv/source/row_neon64.cc
diff --git a/third_party/aom/third_party/libyuv/source/row_win.cc b/media/libaom/src/third_party/libyuv/source/row_win.cc
index 71be268b4..71be268b4 100644
--- a/third_party/aom/third_party/libyuv/source/row_win.cc
+++ b/media/libaom/src/third_party/libyuv/source/row_win.cc
diff --git a/third_party/aom/third_party/libyuv/source/row_x86.asm b/media/libaom/src/third_party/libyuv/source/row_x86.asm
index 0cb326f8e..0cb326f8e 100644
--- a/third_party/aom/third_party/libyuv/source/row_x86.asm
+++ b/media/libaom/src/third_party/libyuv/source/row_x86.asm
diff --git a/third_party/aom/third_party/libyuv/source/scale.cc b/media/libaom/src/third_party/libyuv/source/scale.cc
index 0a01304c4..0a01304c4 100644
--- a/third_party/aom/third_party/libyuv/source/scale.cc
+++ b/media/libaom/src/third_party/libyuv/source/scale.cc
diff --git a/third_party/aom/third_party/libyuv/source/scale_any.cc b/media/libaom/src/third_party/libyuv/source/scale_any.cc
index 2f6a2c8ba..2f6a2c8ba 100644
--- a/third_party/aom/third_party/libyuv/source/scale_any.cc
+++ b/media/libaom/src/third_party/libyuv/source/scale_any.cc
diff --git a/third_party/aom/third_party/libyuv/source/scale_argb.cc b/media/libaom/src/third_party/libyuv/source/scale_argb.cc
index 40a2d1ab2..40a2d1ab2 100644
--- a/third_party/aom/third_party/libyuv/source/scale_argb.cc
+++ b/media/libaom/src/third_party/libyuv/source/scale_argb.cc
diff --git a/third_party/aom/third_party/libyuv/source/scale_common.cc b/media/libaom/src/third_party/libyuv/source/scale_common.cc
index 1711f3d54..1711f3d54 100644
--- a/third_party/aom/third_party/libyuv/source/scale_common.cc
+++ b/media/libaom/src/third_party/libyuv/source/scale_common.cc
diff --git a/third_party/aom/third_party/libyuv/source/scale_gcc.cc b/media/libaom/src/third_party/libyuv/source/scale_gcc.cc
index 8a6ac5459..8a6ac5459 100644
--- a/third_party/aom/third_party/libyuv/source/scale_gcc.cc
+++ b/media/libaom/src/third_party/libyuv/source/scale_gcc.cc
diff --git a/third_party/aom/third_party/libyuv/source/scale_mips.cc b/media/libaom/src/third_party/libyuv/source/scale_mips.cc
index 3eb4f27c4..3eb4f27c4 100644
--- a/third_party/aom/third_party/libyuv/source/scale_mips.cc
+++ b/media/libaom/src/third_party/libyuv/source/scale_mips.cc
diff --git a/third_party/aom/third_party/libyuv/source/scale_neon.cc b/media/libaom/src/third_party/libyuv/source/scale_neon.cc
index 7825878e9..7825878e9 100644
--- a/third_party/aom/third_party/libyuv/source/scale_neon.cc
+++ b/media/libaom/src/third_party/libyuv/source/scale_neon.cc
diff --git a/third_party/aom/third_party/libyuv/source/scale_neon64.cc b/media/libaom/src/third_party/libyuv/source/scale_neon64.cc
index 1d5519357..1d5519357 100644
--- a/third_party/aom/third_party/libyuv/source/scale_neon64.cc
+++ b/media/libaom/src/third_party/libyuv/source/scale_neon64.cc
diff --git a/third_party/aom/third_party/libyuv/source/scale_win.cc b/media/libaom/src/third_party/libyuv/source/scale_win.cc
index c3896ebad..c3896ebad 100644
--- a/third_party/aom/third_party/libyuv/source/scale_win.cc
+++ b/media/libaom/src/third_party/libyuv/source/scale_win.cc
diff --git a/third_party/aom/third_party/libyuv/source/video_common.cc b/media/libaom/src/third_party/libyuv/source/video_common.cc
index 379a0669a..379a0669a 100644
--- a/third_party/aom/third_party/libyuv/source/video_common.cc
+++ b/media/libaom/src/third_party/libyuv/source/video_common.cc
diff --git a/third_party/aom/third_party/libyuv/source/x86inc.asm b/media/libaom/src/third_party/libyuv/source/x86inc.asm
index cb5c32df3..cb5c32df3 100644
--- a/third_party/aom/third_party/libyuv/source/x86inc.asm
+++ b/media/libaom/src/third_party/libyuv/source/x86inc.asm
diff --git a/third_party/aom/third_party/vector/LICENSE b/media/libaom/src/third_party/vector/LICENSE
index afcb9f00a..afcb9f00a 100644
--- a/third_party/aom/third_party/vector/LICENSE
+++ b/media/libaom/src/third_party/vector/LICENSE
diff --git a/third_party/aom/third_party/vector/README.libaom b/media/libaom/src/third_party/vector/README.libaom
index 2bb8b2d5d..2bb8b2d5d 100644
--- a/third_party/aom/third_party/vector/README.libaom
+++ b/media/libaom/src/third_party/vector/README.libaom
diff --git a/third_party/aom/third_party/vector/vector.c b/media/libaom/src/third_party/vector/vector.c
index fe46246a1..fe46246a1 100644
--- a/third_party/aom/third_party/vector/vector.c
+++ b/media/libaom/src/third_party/vector/vector.c
diff --git a/third_party/aom/third_party/vector/vector.h b/media/libaom/src/third_party/vector/vector.h
index 02743f5f1..02743f5f1 100644
--- a/third_party/aom/third_party/vector/vector.h
+++ b/media/libaom/src/third_party/vector/vector.h
diff --git a/third_party/aom/third_party/x86inc/LICENSE b/media/libaom/src/third_party/x86inc/LICENSE
index 7d07645a1..7d07645a1 100644
--- a/third_party/aom/third_party/x86inc/LICENSE
+++ b/media/libaom/src/third_party/x86inc/LICENSE
diff --git a/third_party/aom/third_party/x86inc/README.libaom b/media/libaom/src/third_party/x86inc/README.libaom
index 07c4dad20..07c4dad20 100644
--- a/third_party/aom/third_party/x86inc/README.libaom
+++ b/media/libaom/src/third_party/x86inc/README.libaom
diff --git a/third_party/aom/third_party/x86inc/x86inc.asm b/media/libaom/src/third_party/x86inc/x86inc.asm
index adaf2d99e..adaf2d99e 100644
--- a/third_party/aom/third_party/x86inc/x86inc.asm
+++ b/media/libaom/src/third_party/x86inc/x86inc.asm
diff --git a/third_party/aom/tools/aggregate_entropy_stats.py b/media/libaom/src/tools/aggregate_entropy_stats.py
index 7cb4d18e1..7cb4d18e1 100644
--- a/third_party/aom/tools/aggregate_entropy_stats.py
+++ b/media/libaom/src/tools/aggregate_entropy_stats.py
diff --git a/third_party/aom/tools/aom_entropy_optimizer.c b/media/libaom/src/tools/aom_entropy_optimizer.c
index 551adf4f2..551adf4f2 100644
--- a/third_party/aom/tools/aom_entropy_optimizer.c
+++ b/media/libaom/src/tools/aom_entropy_optimizer.c
diff --git a/third_party/aom/tools/cpplint.py b/media/libaom/src/tools/cpplint.py
index 25fbef73d..25fbef73d 100755..100644
--- a/third_party/aom/tools/cpplint.py
+++ b/media/libaom/src/tools/cpplint.py
diff --git a/third_party/aom/tools/diff.py b/media/libaom/src/tools/diff.py
index bac6aabdc..bac6aabdc 100644
--- a/third_party/aom/tools/diff.py
+++ b/media/libaom/src/tools/diff.py
diff --git a/third_party/aom/tools/dump_obu.cc b/media/libaom/src/tools/dump_obu.cc
index 30ee5e7a1..30ee5e7a1 100644
--- a/third_party/aom/tools/dump_obu.cc
+++ b/media/libaom/src/tools/dump_obu.cc
diff --git a/third_party/aom/tools/gen_authors.sh b/media/libaom/src/tools/gen_authors.sh
index 5def8bc89..5def8bc89 100755..100644
--- a/third_party/aom/tools/gen_authors.sh
+++ b/media/libaom/src/tools/gen_authors.sh
diff --git a/third_party/aom/tools/gen_constrained_tokenset.py b/media/libaom/src/tools/gen_constrained_tokenset.py
index 5d12ee1ef..5d12ee1ef 100755..100644
--- a/third_party/aom/tools/gen_constrained_tokenset.py
+++ b/media/libaom/src/tools/gen_constrained_tokenset.py
diff --git a/third_party/aom/tools/inspect-cli.js b/media/libaom/src/tools/inspect-cli.js
index a14c08111..a14c08111 100644
--- a/third_party/aom/tools/inspect-cli.js
+++ b/media/libaom/src/tools/inspect-cli.js
diff --git a/third_party/aom/tools/inspect-post.js b/media/libaom/src/tools/inspect-post.js
index 31c40bb82..31c40bb82 100644
--- a/third_party/aom/tools/inspect-post.js
+++ b/media/libaom/src/tools/inspect-post.js
diff --git a/third_party/aom/tools/intersect-diffs.py b/media/libaom/src/tools/intersect-diffs.py
index df13c4ef7..df13c4ef7 100755..100644
--- a/third_party/aom/tools/intersect-diffs.py
+++ b/media/libaom/src/tools/intersect-diffs.py
diff --git a/third_party/aom/tools/lint-hunks.py b/media/libaom/src/tools/lint-hunks.py
index d02bee16c..d02bee16c 100755..100644
--- a/third_party/aom/tools/lint-hunks.py
+++ b/media/libaom/src/tools/lint-hunks.py
diff --git a/third_party/aom/tools/obu_parser.cc b/media/libaom/src/tools/obu_parser.cc
index 7d71386ce..7d71386ce 100644
--- a/third_party/aom/tools/obu_parser.cc
+++ b/media/libaom/src/tools/obu_parser.cc
diff --git a/third_party/aom/tools/obu_parser.h b/media/libaom/src/tools/obu_parser.h
index 1d7d2d794..1d7d2d794 100644
--- a/third_party/aom/tools/obu_parser.h
+++ b/media/libaom/src/tools/obu_parser.h
diff --git a/third_party/aom/tools/txfm_analyzer/txfm_gen_code.cc b/media/libaom/src/tools/txfm_analyzer/txfm_gen_code.cc
index 7c5400b91..7c5400b91 100644
--- a/third_party/aom/tools/txfm_analyzer/txfm_gen_code.cc
+++ b/media/libaom/src/tools/txfm_analyzer/txfm_gen_code.cc
diff --git a/third_party/aom/tools/txfm_analyzer/txfm_graph.cc b/media/libaom/src/tools/txfm_analyzer/txfm_graph.cc
index a24906100..a24906100 100644
--- a/third_party/aom/tools/txfm_analyzer/txfm_graph.cc
+++ b/media/libaom/src/tools/txfm_analyzer/txfm_graph.cc
diff --git a/third_party/aom/tools/txfm_analyzer/txfm_graph.h b/media/libaom/src/tools/txfm_analyzer/txfm_graph.h
index 2e3c9551e..2e3c9551e 100644
--- a/third_party/aom/tools/txfm_analyzer/txfm_graph.h
+++ b/media/libaom/src/tools/txfm_analyzer/txfm_graph.h
diff --git a/third_party/aom/tools/wrap-commit-msg.py b/media/libaom/src/tools/wrap-commit-msg.py
index 1c7882443..1c7882443 100755..100644
--- a/third_party/aom/tools/wrap-commit-msg.py
+++ b/media/libaom/src/tools/wrap-commit-msg.py
diff --git a/third_party/aom/usage.dox b/media/libaom/src/usage.dox
index 062d35a83..062d35a83 100644
--- a/third_party/aom/usage.dox
+++ b/media/libaom/src/usage.dox
diff --git a/third_party/aom/usage_cx.dox b/media/libaom/src/usage_cx.dox
index 51b4e8e3e..51b4e8e3e 100644
--- a/third_party/aom/usage_cx.dox
+++ b/media/libaom/src/usage_cx.dox
diff --git a/third_party/aom/usage_dx.dox b/media/libaom/src/usage_dx.dox
index eef78376f..eef78376f 100644
--- a/third_party/aom/usage_dx.dox
+++ b/media/libaom/src/usage_dx.dox
diff --git a/media/mtransport/nr_socket_prsock.cpp b/media/mtransport/nr_socket_prsock.cpp
index f22229df8..a95ef1029 100644
--- a/media/mtransport/nr_socket_prsock.cpp
+++ b/media/mtransport/nr_socket_prsock.cpp
@@ -760,15 +760,7 @@ static int ShouldDrop(size_t len) {
nr_socket_short_term_violation_time = TimeStamp::Now();
#endif
-// Bug 1013007
-#if !EARLY_BETA_OR_EARLIER
return R_WOULDBLOCK;
-#else
- MOZ_ASSERT(false,
- "Short term global rate limit for STUN requests exceeded. Go "
- "bug bcampen@mozilla.com if you weren't intentionally "
- "spamming ICE candidates, or don't know what that means.");
-#endif
}
if (sustained.getTokens(UINT32_MAX) < len) {
@@ -777,15 +769,8 @@ static int ShouldDrop(size_t len) {
#ifdef MOZILLA_INTERNAL_API
nr_socket_long_term_violation_time = TimeStamp::Now();
#endif
-// Bug 1013007
-#if !EARLY_BETA_OR_EARLIER
+
return R_WOULDBLOCK;
-#else
- MOZ_ASSERT(false,
- "Long term global rate limit for STUN requests exceeded. Go "
- "bug bcampen@mozilla.com if you weren't intentionally "
- "spamming ICE candidates, or don't know what that means.");
-#endif
}
// Take len tokens from both buckets.
diff --git a/media/webrtc/signaling/test/common.build b/media/webrtc/signaling/test/common.build
index 3e5450f5d..2d9a57139 100644
--- a/media/webrtc/signaling/test/common.build
+++ b/media/webrtc/signaling/test/common.build
@@ -105,9 +105,6 @@ if CONFIG['MOZ_ALSA']:
if CONFIG['MOZ_SYSTEM_JPEG']:
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
-if CONFIG['MOZ_SYSTEM_LIBVPX']:
- OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
-
if not CONFIG['MOZ_TREE_PIXMAN']:
OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
diff --git a/media/webrtc/trunk/build/build_config.h b/media/webrtc/trunk/build/build_config.h
index 55ed38c2c..8966586a7 100644
--- a/media/webrtc/trunk/build/build_config.h
+++ b/media/webrtc/trunk/build/build_config.h
@@ -129,7 +129,7 @@
#define ARCH_CPU_PPC 1
#define ARCH_CPU_32_BITS 1
#define ARCH_CPU_BIG_ENDIAN 1
-#elif defined(__sparc64__)
+#elif defined(__sparc__) && defined(__arch64__)
#define ARCH_CPU_SPARC_FAMILY 1
#define ARCH_CPU_SPARC 1
#define ARCH_CPU_64_BITS 1
diff --git a/media/webrtc/trunk/webrtc/typedefs.h b/media/webrtc/trunk/webrtc/typedefs.h
index 99ea82a99..fa669b886 100644
--- a/media/webrtc/trunk/webrtc/typedefs.h
+++ b/media/webrtc/trunk/webrtc/typedefs.h
@@ -61,7 +61,7 @@
#define WEBRTC_ARCH_BIG_ENDIAN
#define WEBRTC_BIG_ENDIAN
#endif
-#elif defined(__sparc64__)
+#elif defined(__sparc__) && defined(__arch64__)
#define WEBRTC_ARCH_SPARC 1
#define WEBRTC_ARCH_64_BITS 1
#define WEBRTC_ARCH_BIG_ENDIAN
diff --git a/memory/build/moz.build b/memory/build/moz.build
index f4fd82878..c43e85192 100644
--- a/memory/build/moz.build
+++ b/memory/build/moz.build
@@ -36,6 +36,6 @@ if CONFIG['MOZ_GLUE_IN_PROGRAM']:
DIST_INSTALL = True
# Keep jemalloc separated when mozglue is statically linked
-if CONFIG['MOZ_MEMORY'] and CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'):
+if CONFIG['MOZ_MEMORY'] and CONFIG['OS_TARGET'] in ('WINNT', 'Darwin'):
FINAL_LIBRARY = 'mozglue'
diff --git a/memory/build/mozmemory_wrap.c b/memory/build/mozmemory_wrap.c
index dba3ace56..fdb8447d3 100644
--- a/memory/build/mozmemory_wrap.c
+++ b/memory/build/mozmemory_wrap.c
@@ -88,60 +88,6 @@ strdup_impl(const char *src)
}
#endif /* XP_DARWIN */
-#ifdef ANDROID
-#include <stdarg.h>
-#include <stdio.h>
-
-MOZ_MEMORY_API int
-vasprintf_impl(char **str, const char *fmt, va_list ap)
-{
- char* ptr, *_ptr;
- int ret;
-
- if (str == NULL || fmt == NULL) {
- return -1;
- }
-
- ptr = (char*)malloc_impl(128);
- if (ptr == NULL) {
- *str = NULL;
- return -1;
- }
-
- ret = vsnprintf(ptr, 128, fmt, ap);
- if (ret < 0) {
- free_impl(ptr);
- *str = NULL;
- return -1;
- }
-
- _ptr = realloc_impl(ptr, ret + 1);
- if (_ptr == NULL) {
- free_impl(ptr);
- *str = NULL;
- return -1;
- }
-
- *str = _ptr;
-
- return ret;
-}
-
-MOZ_MEMORY_API int
-asprintf_impl(char **str, const char *fmt, ...)
-{
- int ret;
- va_list ap;
- va_start(ap, fmt);
-
- ret = vasprintf_impl(str, fmt, ap);
-
- va_end(ap);
-
- return ret;
-}
-#endif
-
#ifdef XP_WIN
/*
* There's a fun allocator mismatch in (at least) the VS 2010 CRT
diff --git a/memory/build/mozmemory_wrap.h b/memory/build/mozmemory_wrap.h
index bb1d339ba..da4fd27bb 100644
--- a/memory/build/mozmemory_wrap.h
+++ b/memory/build/mozmemory_wrap.h
@@ -58,13 +58,8 @@
* zone allocator anyways. Jemalloc-specific functions are also left
* unprefixed.
*
- * - On Android and Gonk, all functions are left unprefixed. Additionally,
- * C++ allocation functions (operator new/delete) are also exported and
- * unprefixed.
- *
* - On other systems (mostly Linux), all functions are left unprefixed.
*
- * Only Android and Gonk add C++ allocation functions.
*
* Proper exporting of the various functions is done with the MOZ_MEMORY_API
* and MOZ_JEMALLOC_API macros. MOZ_MEMORY_API is meant to be used for malloc
@@ -72,14 +67,6 @@
* dedicated to jemalloc specific functions.
*
*
- * All these functions are meant to be called with no prefix from Gecko code.
- * In most cases, this is because that's how they are available at runtime.
- * However, on Android, this relies on faulty.lib (the custom dynamic linker)
- * resolving mozglue symbols before libc symbols, which is guaranteed by the
- * way faulty.lib works (it respects the DT_NEEDED order, and libc always
- * appears after mozglue ; which we double check when building anyways)
- *
- *
* Within libmozglue (when MOZ_MEMORY_IMPL is defined), all the functions
* should be suffixed with "_impl" both for declarations and use.
* That is, the implementation declaration for e.g. strdup would look like:
@@ -133,9 +120,6 @@
# endif
# else
# define MOZ_MEMORY_API MFBT_API
-# if defined(MOZ_WIDGET_ANDROID)
-# define MOZ_WRAP_NEW_DELETE
-# endif
# endif
# endif
# ifdef XP_WIN
@@ -184,15 +168,6 @@
# define wcsdup_impl mozmem_dup_impl(wcsdup)
#endif
-/* String functions */
-#ifdef ANDROID
-/* Bug 801571 and Bug 879668, libstagefright uses vasprintf, causing malloc()/
- * free() to be mismatched between bionic and mozglue implementation.
- */
-#define vasprintf_impl mozmem_dup_impl(vasprintf)
-#define asprintf_impl mozmem_dup_impl(asprintf)
-#endif
-
/* Jemalloc specific function */
#define jemalloc_stats_impl mozmem_jemalloc_impl(jemalloc_stats)
#define jemalloc_purge_freed_pages_impl mozmem_jemalloc_impl(jemalloc_purge_freed_pages)
diff --git a/memory/build/replace_malloc.c b/memory/build/replace_malloc.c
index f4c7eb878..91f86497c 100644
--- a/memory/build/replace_malloc.c
+++ b/memory/build/replace_malloc.c
@@ -24,14 +24,11 @@
* LD_PRELOAD or DYLD_INSERT_LIBRARIES on Linux/OSX. On this platform,
* the replacement functions are defined as variable pointers to the
* function resolved with GetProcAddress() instead of weak definitions
- * of functions. On Android, the same needs to happen as well, because
- * the Android linker doesn't handle weak linking with non LD_PRELOADed
- * libraries, but LD_PRELOADing is not very convenient on Android, with
- * the zygote.
+ * of functions.
*/
#ifdef XP_DARWIN
# define MOZ_REPLACE_WEAK __attribute__((weak_import))
-#elif defined(XP_WIN) || defined(MOZ_WIDGET_ANDROID)
+#elif defined(XP_WIN)
# define MOZ_NO_REPLACE_FUNC_DECL
#elif defined(__GNUC__)
# define MOZ_REPLACE_WEAK __attribute__((weak))
@@ -71,24 +68,6 @@ replace_malloc_init_funcs()
}
}
}
-# elif defined(MOZ_WIDGET_ANDROID)
-# include <dlfcn.h>
-# include <stdlib.h>
-static void
-replace_malloc_init_funcs()
-{
- const char *replace_malloc_lib = getenv("MOZ_REPLACE_MALLOC_LIB");
- if (replace_malloc_lib && *replace_malloc_lib) {
- void *handle = dlopen(replace_malloc_lib, RTLD_LAZY);
- if (handle) {
-#define MALLOC_DECL(name, ...) \
- replace_ ## name = (replace_ ## name ## _impl_t *) dlsym(handle, "replace_" # name);
-
-# define MALLOC_FUNCS MALLOC_FUNCS_ALL
-#include "malloc_decls.h"
- }
- }
-}
# else
# error No implementation for replace_malloc_init_funcs()
# endif
diff --git a/memory/build/replace_malloc.h b/memory/build/replace_malloc.h
index a61744f60..3e592749a 100644
--- a/memory/build/replace_malloc.h
+++ b/memory/build/replace_malloc.h
@@ -13,7 +13,7 @@
* environment variables to the library path:
* - LD_PRELOAD on Linux,
* - DYLD_INSERT_LIBRARIES on OSX,
- * - MOZ_REPLACE_MALLOC_LIB on Windows and Android.
+ * - MOZ_REPLACE_MALLOC_LIB on Windows.
*
* An initialization function is called before any malloc replacement
* function, and has the following declaration:
diff --git a/memory/mozalloc/mozalloc.h b/memory/mozalloc/mozalloc.h
index 18752a798..f42c7b04a 100644
--- a/memory/mozalloc/mozalloc.h
+++ b/memory/mozalloc/mozalloc.h
@@ -160,16 +160,7 @@ MFBT_API void* moz_xvalloc(size_t size)
# define MOZALLOC_EXPORT_NEW
#endif
-#if defined(ANDROID)
-/*
- * It's important to always specify 'throw()' in GCC because it's used to tell
- * GCC that 'new' may return null. That makes GCC null-check the result before
- * potentially initializing the memory to zero.
- * Also, the Android minimalistic headers don't include std::bad_alloc.
- */
-#define MOZALLOC_THROW_IF_HAS_EXCEPTIONS throw()
-#define MOZALLOC_THROW_BAD_ALLOC_IF_HAS_EXCEPTIONS
-#elif defined(_MSC_VER)
+#if defined(_MSC_VER)
/*
* Suppress build warning spam (bug 578546).
*/
diff --git a/memory/mozalloc/mozalloc_abort.cpp b/memory/mozalloc/mozalloc_abort.cpp
index 85e566db0..40fce125c 100644
--- a/memory/mozalloc/mozalloc_abort.cpp
+++ b/memory/mozalloc/mozalloc_abort.cpp
@@ -7,9 +7,6 @@
#include "mozilla/mozalloc_abort.h"
-#ifdef ANDROID
-# include <android/log.h>
-#endif
#ifdef MOZ_WIDGET_ANDROID
# include "APKOpen.h"
# include "dlfcn.h"
@@ -21,40 +18,11 @@
void
mozalloc_abort(const char* const msg)
{
-#ifndef ANDROID
fputs(msg, stderr);
fputs("\n", stderr);
-#else
- __android_log_print(ANDROID_LOG_ERROR, "Gecko", "mozalloc_abort: %s", msg);
-#endif
-#ifdef MOZ_WIDGET_ANDROID
- abortThroughJava(msg);
-#endif
MOZ_CRASH();
}
-#ifdef MOZ_WIDGET_ANDROID
-template <size_t N>
-void fillAbortMessage(char (&msg)[N], uintptr_t retAddress) {
- /*
- * On Android, we often don't have reliable backtrace when crashing inside
- * abort(). Therefore, we try to find out who is calling abort() and add
- * that to the message.
- */
- Dl_info info = {};
- dladdr(reinterpret_cast<void*>(retAddress), &info);
-
- const char* const module = info.dli_fname ? info.dli_fname : "";
- const char* const base_module = strrchr(module, '/');
- const void* const module_offset =
- reinterpret_cast<void*>(retAddress - uintptr_t(info.dli_fbase));
- const char* const sym = info.dli_sname ? info.dli_sname : "";
-
- snprintf(msg, sizeof(msg), "abort() called from %s:%p (%s)",
- base_module ? base_module + 1 : module, module_offset, sym);
-}
-#endif
-
#if defined(XP_UNIX) && !defined(MOZ_ASAN)
// Define abort() here, so that it is used instead of the system abort(). This
// lets us control the behavior when aborting, in order to get better results
@@ -70,12 +38,7 @@ void fillAbortMessage(char (&msg)[N], uintptr_t retAddress) {
// result, ASan will just exit(1) instead of aborting.
extern "C" void abort(void)
{
-#ifdef MOZ_WIDGET_ANDROID
- char msg[64] = {};
- fillAbortMessage(msg, uintptr_t(__builtin_return_address(0)));
-#else
const char* const msg = "Redirecting call to abort() to mozalloc_abort\n";
-#endif
mozalloc_abort(msg);
diff --git a/memory/mozjemalloc/jemalloc.c b/memory/mozjemalloc/jemalloc.c
index ecc9d2985..47a5a9f5c 100644
--- a/memory/mozjemalloc/jemalloc.c
+++ b/memory/mozjemalloc/jemalloc.c
@@ -100,11 +100,6 @@
*******************************************************************************
*/
-#ifdef MOZ_MEMORY_ANDROID
-#define NO_TLS
-#define _pthread_self() pthread_self()
-#endif
-
/*
* On Linux, we use madvise(MADV_DONTNEED) to release memory back to the
* operating system. If we release 1MB of live pages with MADV_DONTNEED, our
@@ -174,7 +169,7 @@
# define MALLOC_SYSV
#endif
-#if defined(MOZ_MEMORY_LINUX) && !defined(MOZ_MEMORY_ANDROID)
+#ifdef MOZ_MEMORY_LINUX
#define _GNU_SOURCE /* For mremap(2). */
#endif
@@ -498,7 +493,7 @@ static bool malloc_initialized = false;
/* No init lock for Windows. */
#elif defined(MOZ_MEMORY_DARWIN)
static malloc_mutex_t init_lock = {OS_SPINLOCK_INIT};
-#elif defined(MOZ_MEMORY_LINUX) && !defined(MOZ_MEMORY_ANDROID)
+#elif defined(MOZ_MEMORY_LINUX)
static malloc_mutex_t init_lock = PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP;
#else
static malloc_mutex_t init_lock = PTHREAD_MUTEX_INITIALIZER;
@@ -1374,12 +1369,6 @@ void (*_malloc_message)(const char *p1, const char *p2, const char *p3,
# define assert(e)
#endif
-#ifdef MOZ_MEMORY_ANDROID
-// Android's pthread.h does not declare pthread_atfork() until SDK 21.
-extern MOZ_EXPORT
-int pthread_atfork(void (*)(void), void (*)(void), void(*)(void));
-#endif
-
#if defined(MOZ_JEMALLOC_HARD_ASSERTS)
# define RELEASE_ASSERT(assertion) do { \
if (!(assertion)) { \
@@ -1404,7 +1393,7 @@ malloc_mutex_init(malloc_mutex_t *mutex)
InitializeSRWLock(mutex);
#elif defined(MOZ_MEMORY_DARWIN)
mutex->lock = OS_SPINLOCK_INIT;
-#elif defined(MOZ_MEMORY_LINUX) && !defined(MOZ_MEMORY_ANDROID)
+#elif defined(MOZ_MEMORY_LINUX)
pthread_mutexattr_t attr;
if (pthread_mutexattr_init(&attr) != 0)
return (true);
@@ -1457,7 +1446,7 @@ malloc_spin_init(malloc_spinlock_t *lock)
InitializeSRWLock(lock);
#elif defined(MOZ_MEMORY_DARWIN)
lock->lock = OS_SPINLOCK_INIT;
-#elif defined(MOZ_MEMORY_LINUX) && !defined(MOZ_MEMORY_ANDROID)
+#elif defined(MOZ_MEMORY_LINUX)
pthread_mutexattr_t attr;
if (pthread_mutexattr_init(&attr) != 0)
return (true);
@@ -1977,7 +1966,7 @@ static void *
pages_map(void *addr, size_t size)
{
void *ret;
-#if defined(__ia64__)
+#if defined(__ia64__) || (defined(__sparc__) && defined(__arch64__) && defined(__linux__))
/*
* The JS engine assumes that all allocated pointers have their high 17 bits clear,
* which ia64's mmap doesn't support directly. However, we can emulate it by passing
@@ -1998,6 +1987,28 @@ pages_map(void *addr, size_t size)
}
#endif
+#if defined(__sparc__) && defined(__arch64__) && defined(__linux__)
+ const uintptr_t start = 0x0000070000000000ULL;
+ const uintptr_t end = 0x0000800000000000ULL;
+
+ /* Copied from js/src/gc/Memory.cpp and adapted for this source */
+
+ uintptr_t hint;
+ void* region = MAP_FAILED;
+ for (hint = start; region == MAP_FAILED && hint + size <= end; hint += chunksize) {
+ region = mmap((void*)hint, size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON, -1, 0);
+ if (region != MAP_FAILED) {
+ if (((size_t) region + (size - 1)) & 0xffff800000000000) {
+ if (munmap(region, size)) {
+ MOZ_ASSERT(errno == ENOMEM);
+ }
+ region = MAP_FAILED;
+ }
+ }
+ }
+ ret = region;
+#else
+
/*
* We don't use MAP_FIXED here, because it can cause the *replacement*
* of existing mappings, and we only want to create new mappings.
@@ -2006,10 +2017,11 @@ pages_map(void *addr, size_t size)
MAP_PRIVATE | MAP_ANON, -1, 0);
assert(ret != NULL);
+#endif
if (ret == MAP_FAILED) {
ret = NULL;
}
-#if defined(__ia64__)
+#if defined(__ia64__) || (defined(__sparc__) && defined(__arch64__) && defined(__linux__))
/*
* If the allocated memory doesn't have its upper 17 bits clear, consider it
* as out of memory.
@@ -2042,7 +2054,7 @@ pages_map(void *addr, size_t size)
MozTagAnonymousMemory(ret, size, "jemalloc");
}
-#if defined(__ia64__)
+#if defined(__ia64__) || (defined(__sparc__) && defined(__arch64__) && defined(__linux__))
assert(ret == NULL || (!check_placement && ret != NULL)
|| (check_placement && ret == addr));
#else
diff --git a/memory/replace/logalloc/LogAlloc.cpp b/memory/replace/logalloc/LogAlloc.cpp
index f9b375048..6491dba99 100644
--- a/memory/replace/logalloc/LogAlloc.cpp
+++ b/memory/replace/logalloc/LogAlloc.cpp
@@ -54,16 +54,6 @@ GetTid()
#endif
}
-#ifdef ANDROID
-/* See mozglue/android/APKOpen.cpp */
-extern "C" MOZ_EXPORT __attribute__((weak))
-void* __dso_handle;
-
-/* Android doesn't have pthread_atfork defined in pthread.h */
-extern "C" MOZ_EXPORT
-int pthread_atfork(void (*)(void), void (*)(void), void (*)(void));
-#endif
-
class LogAllocBridge : public ReplaceMallocBridge
{
virtual void InitDebugFd(mozilla::DebugFdRegistry& aRegistry) override {
diff --git a/memory/replace/logalloc/moz.build b/memory/replace/logalloc/moz.build
index e549dca76..7a60a8afa 100644
--- a/memory/replace/logalloc/moz.build
+++ b/memory/replace/logalloc/moz.build
@@ -20,22 +20,10 @@ DEFINES['DEBUG'] = False
# Use locking code from the chromium stack.
if CONFIG['OS_TARGET'] == 'WINNT':
- SOURCES += [
- '../../../ipc/chromium/src/base/lock_impl_win.cc',
- ]
+ SOURCES += ['../../../ipc/chromium/src/base/lock_impl_win.cc']
else:
- SOURCES += [
- '../../../ipc/chromium/src/base/lock_impl_posix.cc',
- ]
+ SOURCES += ['../../../ipc/chromium/src/base/lock_impl_posix.cc']
include('/ipc/chromium/chromium-config.mozbuild')
-# Android doesn't have pthread_atfork, but we have our own in mozglue.
-if CONFIG['OS_TARGET'] == 'Android':
- USE_LIBS += [
- 'mozglue',
- ]
-
-DIRS += [
- 'replay',
-]
+DIRS += ['replay']
diff --git a/memory/replace/logalloc/replay/Replay.cpp b/memory/replace/logalloc/replay/Replay.cpp
index 0ae20de2c..de352189c 100644
--- a/memory/replace/logalloc/replay/Replay.cpp
+++ b/memory/replace/logalloc/replay/Replay.cpp
@@ -290,23 +290,6 @@ MOZ_BEGIN_EXTERN_C
void malloc_init_hard(void);
#endif
-#ifdef ANDROID
-/* mozjemalloc uses MozTagAnonymousMemory, which doesn't have an inline
- * implementation on Android */
-void
-MozTagAnonymousMemory(const void* aPtr, size_t aLength, const char* aTag) {}
-
-/* mozjemalloc and jemalloc use pthread_atfork, which Android doesn't have.
- * While gecko has one in libmozglue, the replay program can't use that.
- * Since we're not going to fork anyways, make it a dummy function. */
-int
-pthread_atfork(void (*aPrepare)(void), void (*aParent)(void),
- void (*aChild)(void))
-{
- return 0;
-}
-#endif
-
MOZ_END_EXTERN_C
size_t parseNumber(Buffer aBuf)
diff --git a/memory/volatile/VolatileBuffer.h b/memory/volatile/VolatileBuffer.h
index ebb471332..b6bcdfcb7 100644
--- a/memory/volatile/VolatileBuffer.h
+++ b/memory/volatile/VolatileBuffer.h
@@ -76,9 +76,7 @@ private:
void* mBuf;
size_t mSize;
int mLockCount;
-#if defined(ANDROID)
- int mFd;
-#elif defined(XP_DARWIN)
+#ifdef XP_DARWIN
bool mHeap;
#elif defined(XP_WIN)
bool mHeap;
diff --git a/memory/volatile/VolatileBufferAshmem.cpp b/memory/volatile/VolatileBufferAshmem.cpp
deleted file mode 100644
index 09904d6ef..000000000
--- a/memory/volatile/VolatileBufferAshmem.cpp
+++ /dev/null
@@ -1,139 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "VolatileBuffer.h"
-#include "mozilla/Assertions.h"
-#include "mozilla/mozalloc.h"
-
-#include <fcntl.h>
-#include <linux/ashmem.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#ifdef MOZ_MEMORY
-extern "C" int posix_memalign(void** memptr, size_t alignment, size_t size);
-#endif
-
-#define MIN_VOLATILE_ALLOC_SIZE 8192
-
-namespace mozilla {
-
-VolatileBuffer::VolatileBuffer()
- : mMutex("VolatileBuffer")
- , mBuf(nullptr)
- , mSize(0)
- , mLockCount(0)
- , mFd(-1)
-{
-}
-
-bool
-VolatileBuffer::Init(size_t aSize, size_t aAlignment)
-{
- MOZ_ASSERT(!mSize && !mBuf, "Init called twice");
- MOZ_ASSERT(!(aAlignment % sizeof(void *)),
- "Alignment must be multiple of pointer size");
-
- mSize = aSize;
- if (aSize < MIN_VOLATILE_ALLOC_SIZE) {
- goto heap_alloc;
- }
-
- mFd = open("/" ASHMEM_NAME_DEF, O_RDWR);
- if (mFd < 0) {
- goto heap_alloc;
- }
-
- if (ioctl(mFd, ASHMEM_SET_SIZE, mSize) < 0) {
- goto heap_alloc;
- }
-
- mBuf = mmap(nullptr, mSize, PROT_READ | PROT_WRITE, MAP_SHARED, mFd, 0);
- if (mBuf != MAP_FAILED) {
- return true;
- }
-
-heap_alloc:
- mBuf = nullptr;
- if (mFd >= 0) {
- close(mFd);
- mFd = -1;
- }
-
-#ifdef MOZ_MEMORY
- posix_memalign(&mBuf, aAlignment, aSize);
-#else
- mBuf = memalign(aAlignment, aSize);
-#endif
- return !!mBuf;
-}
-
-VolatileBuffer::~VolatileBuffer()
-{
- MOZ_ASSERT(mLockCount == 0, "Being destroyed with non-zero lock count?");
-
- if (OnHeap()) {
- free(mBuf);
- } else {
- munmap(mBuf, mSize);
- close(mFd);
- }
-}
-
-bool
-VolatileBuffer::Lock(void** aBuf)
-{
- MutexAutoLock lock(mMutex);
-
- MOZ_ASSERT(mBuf, "Attempting to lock an uninitialized VolatileBuffer");
-
- *aBuf = mBuf;
- if (++mLockCount > 1 || OnHeap()) {
- return true;
- }
-
- // Zero offset and zero length means we want to pin/unpin the entire thing.
- struct ashmem_pin pin = { 0, 0 };
- return ioctl(mFd, ASHMEM_PIN, &pin) == ASHMEM_NOT_PURGED;
-}
-
-void
-VolatileBuffer::Unlock()
-{
- MutexAutoLock lock(mMutex);
-
- MOZ_ASSERT(mLockCount > 0, "VolatileBuffer unlocked too many times!");
- if (--mLockCount || OnHeap()) {
- return;
- }
-
- struct ashmem_pin pin = { 0, 0 };
- ioctl(mFd, ASHMEM_UNPIN, &pin);
-}
-
-bool
-VolatileBuffer::OnHeap() const
-{
- return mFd < 0;
-}
-
-size_t
-VolatileBuffer::HeapSizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
-{
- return OnHeap() ? aMallocSizeOf(mBuf) : 0;
-}
-
-size_t
-VolatileBuffer::NonHeapSizeOfExcludingThis() const
-{
- if (OnHeap()) {
- return 0;
- }
-
- return (mSize + (PAGE_SIZE - 1)) & PAGE_MASK;
-}
-
-} // namespace mozilla
diff --git a/memory/volatile/moz.build b/memory/volatile/moz.build
index deacdf433..5132237a2 100644
--- a/memory/volatile/moz.build
+++ b/memory/volatile/moz.build
@@ -5,26 +5,14 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
NO_VISIBILITY_FLAGS = True
-EXPORTS.mozilla += [
- 'VolatileBuffer.h',
-]
+EXPORTS.mozilla += ['VolatileBuffer.h']
-if CONFIG['OS_TARGET'] == 'Android':
- UNIFIED_SOURCES += [
- 'VolatileBufferAshmem.cpp',
- ]
-elif CONFIG['OS_TARGET'] == 'Darwin':
- UNIFIED_SOURCES += [
- 'VolatileBufferOSX.cpp',
- ]
+if CONFIG['OS_TARGET'] == 'Darwin':
+ UNIFIED_SOURCES += ['VolatileBufferOSX.cpp']
elif CONFIG['OS_TARGET'] == 'WINNT':
- UNIFIED_SOURCES += [
- 'VolatileBufferWindows.cpp',
- ]
+ UNIFIED_SOURCES += ['VolatileBufferWindows.cpp']
else:
- UNIFIED_SOURCES += [
- 'VolatileBufferFallback.cpp',
- ]
+ UNIFIED_SOURCES += ['VolatileBufferFallback.cpp']
FINAL_LIBRARY = 'xul'
diff --git a/memory/volatile/tests/TestVolatileBuffer.cpp b/memory/volatile/tests/TestVolatileBuffer.cpp
index dff8e794a..7d21236a4 100644
--- a/memory/volatile/tests/TestVolatileBuffer.cpp
+++ b/memory/volatile/tests/TestVolatileBuffer.cpp
@@ -6,13 +6,7 @@
#include "mozilla/VolatileBuffer.h"
#include <string.h>
-#if defined(ANDROID)
-#include <fcntl.h>
-#include <linux/ashmem.h>
-#include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#elif defined(XP_DARWIN)
+#ifdef XP_DARWIN
#include <mach/mach.h>
#endif
diff --git a/mfbt/Assertions.h b/mfbt/Assertions.h
index e7b010b7f..94dcfb8a5 100644
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -66,9 +66,6 @@ __declspec(dllimport) void* __stdcall GetCurrentProcess(void);
#else
# include <signal.h>
#endif
-#ifdef ANDROID
-# include <android/log.h>
-#endif
/*
* MOZ_STATIC_ASSERT may be used to assert a condition *at compile time* in C.
@@ -158,33 +155,22 @@ static MOZ_COLD MOZ_ALWAYS_INLINE void
MOZ_ReportAssertionFailure(const char* aStr, const char* aFilename, int aLine)
MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS
{
-#ifdef ANDROID
- __android_log_print(ANDROID_LOG_FATAL, "MOZ_Assert",
- "Assertion failure: %s, at %s:%d\n",
- aStr, aFilename, aLine);
-#else
fprintf(stderr, "Assertion failure: %s, at %s:%d\n", aStr, aFilename, aLine);
#if defined (MOZ_DUMP_ASSERTION_STACK)
nsTraceRefcnt::WalkTheStack(stderr);
#endif
fflush(stderr);
-#endif
}
static MOZ_COLD MOZ_ALWAYS_INLINE void
MOZ_ReportCrash(const char* aStr, const char* aFilename, int aLine)
MOZ_PRETEND_NORETURN_FOR_STATIC_ANALYSIS
{
-#ifdef ANDROID
- __android_log_print(ANDROID_LOG_FATAL, "MOZ_CRASH",
- "Hit MOZ_CRASH(%s) at %s:%d\n", aStr, aFilename, aLine);
-#else
fprintf(stderr, "Hit MOZ_CRASH(%s) at %s:%d\n", aStr, aFilename, aLine);
#if defined(MOZ_DUMP_ASSERTION_STACK)
nsTraceRefcnt::WalkTheStack(stderr);
#endif
fflush(stderr);
-#endif
}
/**
diff --git a/mfbt/IntegerPrintfMacros.h b/mfbt/IntegerPrintfMacros.h
index c534a0ba2..14872a242 100644
--- a/mfbt/IntegerPrintfMacros.h
+++ b/mfbt/IntegerPrintfMacros.h
@@ -28,25 +28,4 @@
#include <inttypes.h>
-/*
- * Fix up Android's broken [u]intptr_t inttype macros. Android's PRI*PTR
- * macros are defined as "ld", but sizeof(long) is 8 and sizeof(intptr_t)
- * is 4 on 32-bit Android. TestTypeTraits.cpp asserts that these new macro
- * definitions match the actual type sizes seen at compile time.
- */
-#if defined(ANDROID) && !defined(__LP64__)
-# undef PRIdPTR /* intptr_t */
-# define PRIdPTR "d" /* intptr_t */
-# undef PRIiPTR /* intptr_t */
-# define PRIiPTR "i" /* intptr_t */
-# undef PRIoPTR /* uintptr_t */
-# define PRIoPTR "o" /* uintptr_t */
-# undef PRIuPTR /* uintptr_t */
-# define PRIuPTR "u" /* uintptr_t */
-# undef PRIxPTR /* uintptr_t */
-# define PRIxPTR "x" /* uintptr_t */
-# undef PRIXPTR /* uintptr_t */
-# define PRIXPTR "X" /* uintptr_t */
-#endif
-
#endif /* mozilla_IntegerPrintfMacros_h_ */
diff --git a/mfbt/TaggedAnonymousMemory.cpp b/mfbt/TaggedAnonymousMemory.cpp
deleted file mode 100644
index a2ba9ee4b..000000000
--- a/mfbt/TaggedAnonymousMemory.cpp
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=8 sts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifdef ANDROID
-
-#include "mozilla/TaggedAnonymousMemory.h"
-
-#include <sys/types.h>
-#include <sys/mman.h>
-#include <sys/prctl.h>
-#include <sys/syscall.h>
-#include <unistd.h>
-
-#include "mozilla/Assertions.h"
-
-// These constants are copied from <sys/prctl.h>, because the headers
-// used for building may not have them even though the running kernel
-// supports them.
-#ifndef PR_SET_VMA
-#define PR_SET_VMA 0x53564d41
-#endif
-#ifndef PR_SET_VMA_ANON_NAME
-#define PR_SET_VMA_ANON_NAME 0
-#endif
-
-namespace mozilla {
-
-// Returns 0 for success and -1 (with errno) for error.
-static int
-TagAnonymousMemoryAligned(const void* aPtr, size_t aLength, const char* aTag)
-{
- return prctl(PR_SET_VMA,
- PR_SET_VMA_ANON_NAME,
- reinterpret_cast<unsigned long>(aPtr),
- aLength,
- reinterpret_cast<unsigned long>(aTag));
-}
-
-// On some architectures, it's possible for the page size to be larger
-// than the PAGE_SIZE we were compiled with. This computes the
-// equivalent of PAGE_MASK.
-static uintptr_t
-GetPageMask()
-{
- static uintptr_t mask = 0;
-
- if (mask == 0) {
- uintptr_t pageSize = sysconf(_SC_PAGESIZE);
- mask = ~(pageSize - 1);
- MOZ_ASSERT((pageSize & (pageSize - 1)) == 0,
- "Page size must be a power of 2!");
- }
- return mask;
-}
-
-} // namespace mozilla
-
-int
-MozTaggedMemoryIsSupported(void)
-{
- static int supported = -1;
-
- if (supported == -1) {
- // Tagging an empty range always "succeeds" if the feature is supported,
- // regardless of the start pointer.
- supported = mozilla::TagAnonymousMemoryAligned(nullptr, 0, nullptr) == 0;
- }
- return supported;
-}
-
-void
-MozTagAnonymousMemory(const void* aPtr, size_t aLength, const char* aTag)
-{
- if (MozTaggedMemoryIsSupported()) {
- // The kernel will round up the end of the range to the next page
- // boundary if it's not aligned (comments indicate this behavior
- // is based on that of madvise), but it will reject the request if
- // the start is not aligned. We therefore round down the start
- // address and adjust the length accordingly.
- uintptr_t addr = reinterpret_cast<uintptr_t>(aPtr);
- uintptr_t end = addr + aLength;
- uintptr_t addrRounded = addr & mozilla::GetPageMask();
- const void* ptrRounded = reinterpret_cast<const void*>(addrRounded);
-
- mozilla::TagAnonymousMemoryAligned(ptrRounded, end - addrRounded, aTag);
- }
-}
-
-void*
-MozTaggedAnonymousMmap(void* aAddr, size_t aLength, int aProt, int aFlags,
- int aFd, off_t aOffset, const char* aTag)
-{
- void* mapped = mmap(aAddr, aLength, aProt, aFlags, aFd, aOffset);
- if (MozTaggedMemoryIsSupported() &&
- (aFlags & MAP_ANONYMOUS) == MAP_ANONYMOUS &&
- mapped != MAP_FAILED) {
- mozilla::TagAnonymousMemoryAligned(mapped, aLength, aTag);
- }
- return mapped;
-}
-
-#endif // ANDROID
diff --git a/mfbt/TaggedAnonymousMemory.h b/mfbt/TaggedAnonymousMemory.h
index d26b06dfb..545928471 100644
--- a/mfbt/TaggedAnonymousMemory.h
+++ b/mfbt/TaggedAnonymousMemory.h
@@ -39,28 +39,6 @@
#include "mozilla/Types.h"
-#ifdef ANDROID
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-MFBT_API void
-MozTagAnonymousMemory(const void* aPtr, size_t aLength, const char* aTag);
-
-MFBT_API void*
-MozTaggedAnonymousMmap(void* aAddr, size_t aLength, int aProt, int aFlags,
- int aFd, off_t aOffset, const char* aTag);
-
-MFBT_API int
-MozTaggedMemoryIsSupported(void);
-
-#ifdef __cplusplus
-} // extern "C"
-#endif
-
-#else // ANDROID
-
static inline void
MozTagAnonymousMemory(const void* aPtr, size_t aLength, const char* aTag)
{
@@ -79,8 +57,6 @@ MozTaggedMemoryIsSupported(void)
return 0;
}
-#endif // ANDROID
-
#endif // !XP_WIN
#endif // mozilla_TaggedAnonymousMemory_h
diff --git a/mfbt/objs.mozbuild b/mfbt/objs.mozbuild
index 37b2240c4..06bdca677 100644
--- a/mfbt/objs.mozbuild
+++ b/mfbt/objs.mozbuild
@@ -20,7 +20,6 @@ mfbt_src_lcppsrcs = [
'JSONWriter.cpp',
'Poison.cpp',
'SHA1.cpp',
- 'TaggedAnonymousMemory.cpp',
'Unused.cpp',
]
diff --git a/mfbt/tests/TestTypeTraits.cpp b/mfbt/tests/TestTypeTraits.cpp
index eb412bc54..cd42f1e44 100644
--- a/mfbt/tests/TestTypeTraits.cpp
+++ b/mfbt/tests/TestTypeTraits.cpp
@@ -636,20 +636,6 @@ static_assert(IsSame<Decay<int[1]>::Type, int*>::value,
static_assert(IsSame<Decay<void(int)>::Type, void(*)(int)>::value,
"decaying void(int) must return void(*)(int)");
-/*
- * Android's broken [u]intptr_t inttype macros are broken because its PRI*PTR
- * macros are defined as "ld", but sizeof(long) is 8 and sizeof(intptr_t)
- * is 4 on 32-bit Android. We redefine Android's PRI*PTR macros in
- * IntegerPrintfMacros.h and assert here that our new definitions match the
- * actual type sizes seen at compile time.
- */
-#if defined(ANDROID) && !defined(__LP64__)
-static_assert(mozilla::IsSame<int, intptr_t>::value,
- "emulated PRI[di]PTR definitions will be wrong");
-static_assert(mozilla::IsSame<unsigned int, uintptr_t>::value,
- "emulated PRI[ouxX]PTR definitions will be wrong");
-#endif
-
int
main()
{
diff --git a/mfbt/tests/TestTypedEnum.cpp b/mfbt/tests/TestTypedEnum.cpp
index 43c36f2b8..1c8db754b 100644
--- a/mfbt/tests/TestTypedEnum.cpp
+++ b/mfbt/tests/TestTypedEnum.cpp
@@ -12,8 +12,7 @@
// A rough feature check for is_literal_type. Not very carefully checked.
// Feel free to amend as needed.
-// We leave ANDROID out because it's using stlport which doesn't have std::is_literal_type.
-#if __cplusplus >= 201103L && !defined(ANDROID)
+#if __cplusplus >= 201103L
# if defined(__clang__)
/*
* Per Clang documentation, "Note that marketing version numbers should not
diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js
index c5daf9213..172278d2e 100644
--- a/modules/libpref/init/all.js
+++ b/modules/libpref/init/all.js
@@ -1260,6 +1260,7 @@ pref("javascript.options.strict", false);
#ifdef DEBUG
pref("javascript.options.strict.debug", false);
#endif
+pref("javascript.options.unboxed_objects", false);
pref("javascript.options.baselinejit", true);
pref("javascript.options.ion", true);
pref("javascript.options.asmjs", true);
@@ -2036,8 +2037,6 @@ pref("network.proxy.autoconfig_retry_interval_max", 300); // 5 minutes
// Master switch for HSTS usage (security <-> privacy tradeoff)
pref("network.stricttransportsecurity.enabled", true);
-// Use the HSTS preload list by default
-pref("network.stricttransportsecurity.preloadlist", true);
// Use JS mDNS as a fallback
pref("network.mdns.use_js_fallback", false);
@@ -2528,6 +2527,9 @@ pref("layout.css.image-orientation.enabled", true);
// Is support for the font-display @font-face descriptor enabled?
pref("layout.css.font-display.enabled", false);
+// Enable the font variation stub code?
+pref("layout.css.font-variations.stub", true);
+
// Are sets of prefixed properties supported?
pref("layout.css.prefixes.border-image", true);
pref("layout.css.prefixes.transforms", true);
@@ -4497,7 +4499,16 @@ pref("network.tcp.keepalive.probe_count", 4);
#endif
// Whether to disable acceleration for all widgets.
-pref("layers.acceleration.disabled", false);
+#if defined(XP_UNIX) && !defined(XP_MACOSX)
+// On Linux this is disabled by default for known issues with "free" drivers
+pref("layers.acceleration.enabled", false);
+#else
+pref("layers.acceleration.enabled", true);
+#endif
+// Whether to force acceleration on, ignoring blacklists.
+// This requires layers.acceleration.enabled to be set to true
+pref("layers.acceleration.force", false);
+
// Preference that when switched at runtime will run a series of benchmarks
// and output the result to stderr.
pref("layers.bench.enabled", false);
@@ -4506,18 +4517,6 @@ pref("layers.bench.enabled", false);
pref("layers.gpu-process.dev.enabled", true);
#endif
-// Whether to force acceleration on, ignoring blacklists.
-#ifdef ANDROID
-// bug 838603 -- on Android, accidentally blacklisting OpenGL layers
-// means a startup crash for everyone.
-// Temporarily force-enable GL compositing. This is default-disabled
-// deep within the bowels of the widgetry system. Remove me when GL
-// compositing isn't default disabled in widget/android.
-pref("layers.acceleration.force-enabled", true);
-#else
-pref("layers.acceleration.force-enabled", false);
-#endif
-
pref("layers.acceleration.draw-fps", false);
// Enable DEAA antialiasing for transformed layers in the compositor
@@ -4967,8 +4966,6 @@ pref("dom.forms.inputmode", true);
// InputMethods for soft keyboards in B2G
pref("dom.mozInputMethod.enabled", false);
-pref("dom.flyweb.enabled", false);
-
// Enable mapped array buffer by default.
pref("dom.mapped_arraybuffer.enabled", true);
diff --git a/moz.build b/moz.build
index 401f938e2..21c2d5641 100644
--- a/moz.build
+++ b/moz.build
@@ -69,6 +69,9 @@ if not CONFIG['MOZ_DISABLE_PLATFORM']:
if CONFIG['COMPILE_ENVIRONMENT']:
if not CONFIG['JS_STANDALONE']:
+ # Hopefully build sqlite before nss
+ DIRS += ['db/sqlite3/src']
+
DIRS += [
'config/external',
'config/external/nss',
diff --git a/mozglue/android/APKOpen.cpp b/mozglue/android/APKOpen.cpp
deleted file mode 100644
index 1aabc155e..000000000
--- a/mozglue/android/APKOpen.cpp
+++ /dev/null
@@ -1,465 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * This custom library loading code is only meant to be called
- * during initialization. As a result, it takes no special
- * precautions to be threadsafe. Any of the library loading functions
- * like mozload should not be available to other code.
- */
-
-#include <jni.h>
-#include <android/log.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#include <sys/limits.h>
-#include <errno.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <zlib.h>
-#include "dlfcn.h"
-#include "APKOpen.h"
-#include <sys/time.h>
-#include <sys/resource.h>
-#include <sys/prctl.h>
-#include "sqlite3.h"
-#include "SQLiteBridge.h"
-#include "NSSBridge.h"
-#include "ElfLoader.h"
-#include "application.ini.h"
-
-#include "mozilla/TimeStamp.h"
-#include "mozilla/UniquePtr.h"
-#include "XREChildData.h"
-
-/* Android headers don't define RUSAGE_THREAD */
-#ifndef RUSAGE_THREAD
-#define RUSAGE_THREAD 1
-#endif
-
-#ifndef RELEASE_OR_BETA
-/* Official builds have the debuggable flag set to false, which disables
- * the backtrace dumper from bionic. However, as it is useful for native
- * crashes happening before the crash reporter is registered, re-enable
- * it on non release builds (i.e. nightly and aurora).
- * Using a constructor so that it is re-enabled as soon as libmozglue.so
- * is loaded.
- */
-__attribute__((constructor))
-void make_dumpable() {
- prctl(PR_SET_DUMPABLE, 1);
-}
-#endif
-
-extern "C" {
-/*
- * To work around http://code.google.com/p/android/issues/detail?id=23203
- * we don't link with the crt objects. In some configurations, this means
- * a lack of the __dso_handle symbol because it is defined there, and
- * depending on the android platform and ndk versions used, it may or may
- * not be defined in libc.so. In the latter case, we fail to link. Defining
- * it here as weak makes us provide the symbol when it's not provided by
- * the crt objects, making the change transparent for future NDKs that
- * would fix the original problem. On older NDKs, it is not a problem
- * either because the way __dso_handle was used was already broken (and
- * the custom linker works around it).
- */
- NS_EXPORT __attribute__((weak)) void *__dso_handle;
-}
-
-typedef int mozglueresult;
-
-enum StartupEvent {
-#define mozilla_StartupTimeline_Event(ev, z) ev,
-#include "StartupTimeline.h"
-#undef mozilla_StartupTimeline_Event
- MAX_STARTUP_EVENT_ID
-};
-
-using namespace mozilla;
-
-static const int MAX_MAPPING_INFO = 32;
-static mapping_info lib_mapping[MAX_MAPPING_INFO];
-
-NS_EXPORT const struct mapping_info *
-getLibraryMapping()
-{
- return lib_mapping;
-}
-
-void
-JNI_Throw(JNIEnv* jenv, const char* classname, const char* msg)
-{
- __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Throw\n");
- jclass cls = jenv->FindClass(classname);
- if (cls == nullptr) {
- __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't find exception class (or exception pending) %s\n", classname);
- exit(FAILURE);
- }
- int rc = jenv->ThrowNew(cls, msg);
- if (rc < 0) {
- __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Error throwing exception %s\n", msg);
- exit(FAILURE);
- }
- jenv->DeleteLocalRef(cls);
-}
-
-namespace {
- JavaVM* sJavaVM;
- pthread_t sJavaUiThread;
-}
-
-void
-abortThroughJava(const char* msg)
-{
- struct sigaction sigact = {};
- if (SEGVHandler::__wrap_sigaction(SIGSEGV, nullptr, &sigact)) {
- return; // sigaction call failed.
- }
-
- Dl_info info = {};
- if ((sigact.sa_flags & SA_SIGINFO) &&
- __wrap_dladdr(reinterpret_cast<void*>(sigact.sa_sigaction), &info) &&
- info.dli_fname && strstr(info.dli_fname, "libxul.so")) {
-
- return; // Existing signal handler is in libxul (i.e. we have crash reporter).
- }
-
- JNIEnv* env = nullptr;
- if (!sJavaVM || sJavaVM->AttachCurrentThreadAsDaemon(&env, nullptr) != JNI_OK) {
- return;
- }
-
- if (!env || env->PushLocalFrame(2) != JNI_OK) {
- return;
- }
-
- jclass loader = env->FindClass("org/mozilla/gecko/mozglue/GeckoLoader");
- if (!loader) {
- return;
- }
-
- jmethodID method = env->GetStaticMethodID(loader, "abort", "(Ljava/lang/String;)V");
- jstring str = env->NewStringUTF(msg);
-
- if (method && str) {
- env->CallStaticVoidMethod(loader, method, str);
- }
-
- env->PopLocalFrame(nullptr);
-}
-
-NS_EXPORT pthread_t
-getJavaUiThread()
-{
- return sJavaUiThread;
-}
-
-extern "C" NS_EXPORT void MOZ_JNICALL
-Java_org_mozilla_gecko_GeckoThread_registerUiThread(JNIEnv*, jclass)
-{
- sJavaUiThread = pthread_self();
-}
-
-static void * xul_handle = nullptr;
-#ifndef MOZ_FOLD_LIBS
-static void * sqlite_handle = nullptr;
-static void * nspr_handle = nullptr;
-static void * plc_handle = nullptr;
-#else
-#define sqlite_handle nss_handle
-#define nspr_handle nss_handle
-#define plc_handle nss_handle
-#endif
-static void * nss_handle = nullptr;
-
-template <typename T> inline void
-xul_dlsym(const char *symbolName, T *value)
-{
- *value = (T) (uintptr_t) __wrap_dlsym(xul_handle, symbolName);
-}
-
-static int mapping_count = 0;
-
-extern "C" void
-report_mapping(char *name, void *base, uint32_t len, uint32_t offset)
-{
- if (mapping_count >= MAX_MAPPING_INFO)
- return;
-
- struct mapping_info *info = &lib_mapping[mapping_count++];
- info->name = strdup(name);
- info->base = (uintptr_t)base;
- info->len = len;
- info->offset = offset;
-}
-
-extern "C" void
-delete_mapping(const char *name)
-{
- for (int pos = 0; pos < mapping_count; ++pos) {
- struct mapping_info *info = &lib_mapping[pos];
- if (!strcmp(info->name, name)) {
- struct mapping_info *last = &lib_mapping[mapping_count - 1];
- free(info->name);
- *info = *last;
- --mapping_count;
- break;
- }
- }
-}
-
-static void*
-dlopenAPKLibrary(const char* apkName, const char* libraryName)
-{
-#define APK_ASSETS_PATH "!/assets/" ANDROID_CPU_ARCH "/"
- size_t filenameLength = strlen(apkName) +
- sizeof(APK_ASSETS_PATH) + // includes \0 terminator
- strlen(libraryName);
- auto file = MakeUnique<char[]>(filenameLength);
- snprintf(file.get(), filenameLength, "%s" APK_ASSETS_PATH "%s",
- apkName, libraryName);
- return __wrap_dlopen(file.get(), RTLD_GLOBAL | RTLD_LAZY);
-#undef APK_ASSETS_PATH
-}
-static mozglueresult
-loadGeckoLibs(const char *apkName)
-{
- TimeStamp t0 = TimeStamp::Now();
- struct rusage usage1_thread, usage1;
- getrusage(RUSAGE_THREAD, &usage1_thread);
- getrusage(RUSAGE_SELF, &usage1);
-
- xul_handle = dlopenAPKLibrary(apkName, "libxul.so");
- if (!xul_handle) {
- __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get a handle to libxul!");
- return FAILURE;
- }
-
- void (*XRE_StartupTimelineRecord)(int, TimeStamp);
- xul_dlsym("XRE_StartupTimelineRecord", &XRE_StartupTimelineRecord);
-
- TimeStamp t1 = TimeStamp::Now();
- struct rusage usage2_thread, usage2;
- getrusage(RUSAGE_THREAD, &usage2_thread);
- getrusage(RUSAGE_SELF, &usage2);
-
-#define RUSAGE_TIMEDIFF(u1, u2, field) \
- ((u2.ru_ ## field.tv_sec - u1.ru_ ## field.tv_sec) * 1000 + \
- (u2.ru_ ## field.tv_usec - u1.ru_ ## field.tv_usec) / 1000)
-
- __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Loaded libs in %fms total, %ldms(%ldms) user, %ldms(%ldms) system, %ld(%ld) faults",
- (t1 - t0).ToMilliseconds(),
- RUSAGE_TIMEDIFF(usage1_thread, usage2_thread, utime),
- RUSAGE_TIMEDIFF(usage1, usage2, utime),
- RUSAGE_TIMEDIFF(usage1_thread, usage2_thread, stime),
- RUSAGE_TIMEDIFF(usage1, usage2, stime),
- usage2_thread.ru_majflt - usage1_thread.ru_majflt,
- usage2.ru_majflt - usage1.ru_majflt);
-
- XRE_StartupTimelineRecord(LINKER_INITIALIZED, t0);
- XRE_StartupTimelineRecord(LIBRARIES_LOADED, t1);
- return SUCCESS;
-}
-
-static mozglueresult loadNSSLibs(const char *apkName);
-
-static mozglueresult
-loadSQLiteLibs(const char *apkName)
-{
- if (sqlite_handle)
- return SUCCESS;
-
-#ifdef MOZ_FOLD_LIBS
- if (loadNSSLibs(apkName) != SUCCESS)
- return FAILURE;
-#else
-
- sqlite_handle = dlopenAPKLibrary(apkName, "libmozsqlite3.so");
- if (!sqlite_handle) {
- __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get a handle to libmozsqlite3!");
- return FAILURE;
- }
-#endif
-
- setup_sqlite_functions(sqlite_handle);
- return SUCCESS;
-}
-
-static mozglueresult
-loadNSSLibs(const char *apkName)
-{
- if (nss_handle && nspr_handle && plc_handle)
- return SUCCESS;
-
- nss_handle = dlopenAPKLibrary(apkName, "libnss3.so");
-
-#ifndef MOZ_FOLD_LIBS
- nspr_handle = dlopenAPKLibrary(apkName, "libnspr4.so");
-
- plc_handle = dlopenAPKLibrary(apkName, "libplc4.so");
-#endif
-
- if (!nss_handle) {
- __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get a handle to libnss3!");
- return FAILURE;
- }
-
-#ifndef MOZ_FOLD_LIBS
- if (!nspr_handle) {
- __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get a handle to libnspr4!");
- return FAILURE;
- }
-
- if (!plc_handle) {
- __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't get a handle to libplc4!");
- return FAILURE;
- }
-#endif
-
- return setup_nss_functions(nss_handle, nspr_handle, plc_handle);
-}
-
-extern "C" NS_EXPORT void MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_GeckoLoader_extractGeckoLibsNative(
- JNIEnv *jenv, jclass jGeckoAppShellClass, jstring jApkName)
-{
- MOZ_ALWAYS_TRUE(!jenv->GetJavaVM(&sJavaVM));
-
- const char* apkName = jenv->GetStringUTFChars(jApkName, nullptr);
- if (apkName == nullptr) {
- return;
- }
-
- // Extract and cache native lib to allow for efficient startup from cache.
- void* handle = dlopenAPKLibrary(apkName, "libxul.so");
- if (handle) {
- __android_log_print(ANDROID_LOG_INFO, "GeckoLibLoad",
- "Extracted and cached libxul.so.");
- // We have extracted and cached the lib, we can close it now.
- __wrap_dlclose(handle);
- } else {
- JNI_Throw(jenv, "java/lang/Exception", "Error extracting gecko libraries");
- }
-
- jenv->ReleaseStringUTFChars(jApkName, apkName);
-}
-
-extern "C" NS_EXPORT void MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_GeckoLoader_loadGeckoLibsNative(JNIEnv *jenv, jclass jGeckoAppShellClass, jstring jApkName)
-{
- jenv->GetJavaVM(&sJavaVM);
-
- const char* str;
- // XXX: java doesn't give us true UTF8, we should figure out something
- // better to do here
- str = jenv->GetStringUTFChars(jApkName, nullptr);
- if (str == nullptr)
- return;
-
- int res = loadGeckoLibs(str);
- if (res != SUCCESS) {
- JNI_Throw(jenv, "java/lang/Exception", "Error loading gecko libraries");
- }
- jenv->ReleaseStringUTFChars(jApkName, str);
-}
-
-extern "C" NS_EXPORT void MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_GeckoLoader_loadSQLiteLibsNative(JNIEnv *jenv, jclass jGeckoAppShellClass, jstring jApkName) {
- const char* str;
- // XXX: java doesn't give us true UTF8, we should figure out something
- // better to do here
- str = jenv->GetStringUTFChars(jApkName, nullptr);
- if (str == nullptr)
- return;
-
- __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Load sqlite start\n");
- mozglueresult rv = loadSQLiteLibs(str);
- if (rv != SUCCESS) {
- JNI_Throw(jenv, "java/lang/Exception", "Error loading sqlite libraries");
- }
- __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Load sqlite done\n");
- jenv->ReleaseStringUTFChars(jApkName, str);
-}
-
-extern "C" NS_EXPORT void MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_GeckoLoader_loadNSSLibsNative(JNIEnv *jenv, jclass jGeckoAppShellClass, jstring jApkName) {
- const char* str;
- // XXX: java doesn't give us true UTF8, we should figure out something
- // better to do here
- str = jenv->GetStringUTFChars(jApkName, nullptr);
- if (str == nullptr)
- return;
-
- __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Load nss start\n");
- mozglueresult rv = loadNSSLibs(str);
- if (rv != SUCCESS) {
- JNI_Throw(jenv, "java/lang/Exception", "Error loading nss libraries");
- }
- __android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Load nss done\n");
- jenv->ReleaseStringUTFChars(jApkName, str);
-}
-
-typedef void (*GeckoStart_t)(JNIEnv*, char*, const nsXREAppData*);
-
-extern "C" NS_EXPORT void MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_GeckoLoader_nativeRun(JNIEnv *jenv, jclass jc, jstring jargs)
-{
- GeckoStart_t GeckoStart;
- xul_dlsym("GeckoStart", &GeckoStart);
- if (GeckoStart == nullptr)
- return;
- // XXX: java doesn't give us true UTF8, we should figure out something
- // better to do here
- int len = jenv->GetStringUTFLength(jargs);
- // GeckoStart needs to write in the args buffer, so we need a copy.
- char *args = (char *) malloc(len + 1);
- jenv->GetStringUTFRegion(jargs, 0, len, args);
- args[len] = '\0';
- ElfLoader::Singleton.ExpectShutdown(false);
- GeckoStart(jenv, args, &sAppData);
- ElfLoader::Singleton.ExpectShutdown(true);
- free(args);
-}
-
-typedef int GeckoProcessType;
-
-extern "C" NS_EXPORT mozglueresult
-ChildProcessInit(int argc, char* argv[])
-{
- int i;
- for (i = 0; i < (argc - 1); i++) {
- if (strcmp(argv[i], "-greomni"))
- continue;
-
- i = i + 1;
- break;
- }
-
- if (loadNSSLibs(argv[i]) != SUCCESS) {
- return FAILURE;
- }
- if (loadSQLiteLibs(argv[i]) != SUCCESS) {
- return FAILURE;
- }
- if (loadGeckoLibs(argv[i]) != SUCCESS) {
- return FAILURE;
- }
-
- void (*fXRE_SetProcessType)(char*);
- xul_dlsym("XRE_SetProcessType", &fXRE_SetProcessType);
-
- mozglueresult (*fXRE_InitChildProcess)(int, char**, void*);
- xul_dlsym("XRE_InitChildProcess", &fXRE_InitChildProcess);
-
- fXRE_SetProcessType(argv[--argc]);
-
- XREChildData childData;
- return fXRE_InitChildProcess(argc, argv, &childData);
-}
-
diff --git a/mozglue/android/APKOpen.h b/mozglue/android/APKOpen.h
deleted file mode 100644
index f28458feb..000000000
--- a/mozglue/android/APKOpen.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef APKOpen_h
-#define APKOpen_h
-
-#include <jni.h>
-#include <pthread.h>
-
-#ifndef NS_EXPORT
-#define NS_EXPORT __attribute__ ((visibility("default")))
-#endif
-
-struct mapping_info {
- char * name;
- uintptr_t base;
- size_t len;
- size_t offset;
-};
-
-NS_EXPORT const struct mapping_info * getLibraryMapping();
-NS_EXPORT void abortThroughJava(const char* msg);
-NS_EXPORT pthread_t getJavaUiThread();
-
-static const int SUCCESS = 0;
-static const int FAILURE = 1;
-void JNI_Throw(JNIEnv* jenv, const char* classname, const char* msg);
-
-// Bug 1207642 - Work around Dalvik bug by realigning stack on JNI entry
-#ifndef MOZ_JNICALL
-# ifdef __i386__
-# define MOZ_JNICALL JNICALL __attribute__((force_align_arg_pointer))
-# else
-# define MOZ_JNICALL JNICALL
-# endif
-#endif
-
-#endif /* APKOpen_h */
diff --git a/mozglue/android/NSSBridge.cpp b/mozglue/android/NSSBridge.cpp
deleted file mode 100644
index 3343ad1b2..000000000
--- a/mozglue/android/NSSBridge.cpp
+++ /dev/null
@@ -1,285 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdlib.h>
-#include "dlfcn.h"
-#include "NSSBridge.h"
-#include "APKOpen.h"
-#ifdef ANDROID
-#include <jni.h>
-#include <android/log.h>
-#endif
-
-#include "ElfLoader.h"
-
-#ifdef DEBUG
-#define LOG(x...) __android_log_print(ANDROID_LOG_INFO, "GeckoJNI", x)
-#else
-#define LOG(x...)
-#endif
-
-static bool initialized = false;
-
-#define NSS_WRAPPER_INT(name) name ## _t f_ ## name;
-NSS_WRAPPER_INT(NSS_Initialize)
-NSS_WRAPPER_INT(NSS_Shutdown)
-NSS_WRAPPER_INT(SECITEM_ZfreeItem)
-NSS_WRAPPER_INT(PK11SDR_Encrypt)
-NSS_WRAPPER_INT(PK11SDR_Decrypt)
-NSS_WRAPPER_INT(PK11_GetInternalKeySlot)
-NSS_WRAPPER_INT(PK11_NeedUserInit)
-NSS_WRAPPER_INT(PK11_InitPin)
-NSS_WRAPPER_INT(PR_ErrorToString)
-NSS_WRAPPER_INT(PR_GetError)
-NSS_WRAPPER_INT(PR_Free)
-NSS_WRAPPER_INT(PL_Base64Encode)
-NSS_WRAPPER_INT(PL_Base64Decode)
-NSS_WRAPPER_INT(PL_strfree)
-
-SECStatus doCrypto(JNIEnv* jenv, const char *path, const char *value, char** result, bool doEncrypt);
-SECStatus encode(const uint8_t* data, uint32_t srclen, char** result);
-SECStatus decode(const char* data, uint8_t** result, uint32_t* length);
-
-int
-setup_nss_functions(void *nss_handle,
- void *nspr_handle,
- void *plc_handle)
-{
- if (nss_handle == nullptr || nspr_handle == nullptr || plc_handle == nullptr) {
- LOG("Missing handle\n");
- return FAILURE;
- }
-#define GETFUNC(name) f_ ## name = (name ## _t) (uintptr_t) __wrap_dlsym(nss_handle, #name); \
- if (!f_ ##name) { __android_log_print(ANDROID_LOG_ERROR, "GeckoJNI", "missing %s", #name); return FAILURE; }
- GETFUNC(NSS_Initialize);
- GETFUNC(NSS_Shutdown);
- GETFUNC(PK11SDR_Encrypt);
- GETFUNC(PK11SDR_Decrypt);
- GETFUNC(PK11_GetInternalKeySlot);
- GETFUNC(PK11_NeedUserInit);
- GETFUNC(PK11_InitPin);
- GETFUNC(SECITEM_ZfreeItem);
-#undef GETFUNC
-#define NSPRFUNC(name) f_ ## name = (name ## _t) (uintptr_t) __wrap_dlsym(nspr_handle, #name); \
- if (!f_ ##name) { __android_log_print(ANDROID_LOG_ERROR, "GeckoJNI", "missing %s", #name); return FAILURE; }
- NSPRFUNC(PR_ErrorToString);
- NSPRFUNC(PR_GetError);
- NSPRFUNC(PR_Free);
-#undef NSPRFUNC
-#define PLCFUNC(name) f_ ## name = (name ## _t) (uintptr_t) __wrap_dlsym(plc_handle, #name); \
- if (!f_ ##name) { __android_log_print(ANDROID_LOG_ERROR, "GeckoJNI", "missing %s", #name); return FAILURE; }
- PLCFUNC(PL_Base64Encode);
- PLCFUNC(PL_Base64Decode);
- PLCFUNC(PL_strfree);
-#undef PLCFUNC
-
- return SUCCESS;
-}
-
-/* Throws the current NSS error. */
-static void
-throwError(JNIEnv* jenv, const char * funcString) {
- char *msg;
-
- PRErrorCode perr = f_PR_GetError();
- char * errString = f_PR_ErrorToString(perr, 0);
- asprintf(&msg, "%s returned error %d: %s\n", funcString, perr, errString);
- LOG("Throwing error: %s\n", msg);
-
- JNI_Throw(jenv, "java/lang/Exception", msg);
- free(msg);
- LOG("Error thrown\n");
-}
-
-extern "C" NS_EXPORT jstring MOZ_JNICALL
-Java_org_mozilla_gecko_NSSBridge_nativeEncrypt(JNIEnv* jenv, jclass,
- jstring jPath,
- jstring jValue)
-{
- jstring ret = jenv->NewStringUTF("");
-
- const char* path;
- path = jenv->GetStringUTFChars(jPath, nullptr);
-
- const char* value;
- value = jenv->GetStringUTFChars(jValue, nullptr);
-
- char* result;
- SECStatus rv = doCrypto(jenv, path, value, &result, true);
- if (rv == SECSuccess) {
- ret = jenv->NewStringUTF(result);
- free(result);
- }
-
- jenv->ReleaseStringUTFChars(jValue, value);
- jenv->ReleaseStringUTFChars(jPath, path);
-
- return ret;
-}
-
-extern "C" NS_EXPORT jstring MOZ_JNICALL
-Java_org_mozilla_gecko_NSSBridge_nativeDecrypt(JNIEnv* jenv, jclass,
- jstring jPath,
- jstring jValue)
-{
- jstring ret = jenv->NewStringUTF("");
-
- const char* path;
- path = jenv->GetStringUTFChars(jPath, nullptr);
-
- const char* value;
- value = jenv->GetStringUTFChars(jValue, nullptr);
-
- char* result;
- SECStatus rv = doCrypto(jenv, path, value, &result, false);
- if (rv == SECSuccess) {
- ret = jenv->NewStringUTF(result);
- free(result);
- }
-
- jenv->ReleaseStringUTFChars(jValue, value);
- jenv->ReleaseStringUTFChars(jPath, path);
-
- return ret;
-}
-
-
-/* Encrypts or decrypts a string. result should be freed with free() when done */
-SECStatus
-doCrypto(JNIEnv* jenv, const char *path, const char *value, char** result, bool encrypt)
-{
- SECStatus rv;
- PK11SlotInfo *slot;
- if (!initialized) {
- LOG("Initialize crypto in %s\n", path);
- rv = f_NSS_Initialize(path, "", "", "secmod.db", NSS_INIT_NOROOTINIT);
- if (rv != SECSuccess) {
- throwError(jenv, "NSS_Initialize");
- return rv;
- }
- initialized = true;
- }
-
- slot = f_PK11_GetInternalKeySlot();
- if (!slot) {
- throwError(jenv, "PK11_GetInternalKeySlot");
- return SECFailure;
- }
-
- if (f_PK11_NeedUserInit(slot)) {
- LOG("Initializing key3.db with default blank password.\n");
- rv = f_PK11_InitPin(slot, nullptr, nullptr);
- if (rv != SECSuccess) {
- throwError(jenv, "PK11_InitPin");
- return rv;
- }
- }
-
- SECItem request;
- SECItem reply;
-
- reply.data = 0;
- reply.len = 0;
-
- if (encrypt) {
- // This can print sensitive data. Uncomment if you need it.
- // LOG("Encrypting: %s\n", value);
- request.data = (unsigned char*)value;
- request.len = strlen(value);
-
- SECItem keyid;
- keyid.data = 0;
- keyid.len = 0;
- rv = f_PK11SDR_Encrypt(&keyid, &request, &reply, nullptr);
-
- if (rv == SECSuccess) {
- rv = encode(reply.data, reply.len, result);
- if (rv == SECSuccess) {
- LOG("Encrypted: %s\n", *result);
- } else {
- throwError(jenv, "encode");
- }
- } else {
- throwError(jenv, "PK11SDR_Encrypt");
- }
-
- } else {
- LOG("Decoding: %s\n", value);
- rv = decode(value, &request.data, &request.len);
- if (rv != SECSuccess) {
- throwError(jenv, "decode");
- return rv;
- }
-
- rv = f_PK11SDR_Decrypt(&request, &reply, nullptr);
-
- if (rv == SECSuccess) {
- *result = static_cast<char*>(malloc(reply.len + 1));
- strncpy(*result, reinterpret_cast<char*>(reply.data), reply.len);
- (*result)[reply.len] = '\0';
-
- // This can print sensitive data. Uncomment if you need it.
- // LOG("Decoded %i letters: %s\n", reply.len, *result);
- } else {
- throwError(jenv, "PK11SDR_Decrypt");
- }
- free(request.data);
- }
-
- f_SECITEM_ZfreeItem(&reply, false);
- return rv;
-}
-
-/*
- * Base64 encodes the data passed in. The caller must deallocate _retval using free();
- */
-SECStatus
-encode(const uint8_t* data, uint32_t srclen, char** result)
-{
- if (srclen > (PR_UINT32_MAX / 4) * 3) {
- return SECFailure;
- }
-
- const uint32_t dstlen = ((srclen + 2) / 3) * 4;
- char* const buffer = static_cast<char*>(malloc(dstlen + 1));
-
- if (!buffer || !f_PL_Base64Encode(reinterpret_cast<const char*>(data), srclen, buffer)) {
- free(buffer);
- *result = nullptr;
- return SECFailure;
- }
-
- buffer[dstlen] = '\0';
- *result = buffer;
- return SECSuccess;
-}
-
-/*
- * Base64 decodes the data passed in. The caller must deallocate result using free();
- */
-SECStatus
-decode(const char* data, uint8_t** result, uint32_t* length)
-{
- uint32_t srclen = strlen(data);
- while (srclen && data[srclen - 1] == '=') {
- srclen--;
- }
-
- // Avoid overflow when calculating result length.
- const uint32_t dstlen = (srclen / 4) * 3 + ((srclen % 4) * 3) / 4;
- // At most 2 extra bytes due to padding in input.
- uint8_t* const buffer = static_cast<uint8_t*>(malloc(dstlen + 2));
-
- if (!buffer || !f_PL_Base64Decode(data, srclen, reinterpret_cast<char*>(buffer))) {
- free(buffer);
- *result = nullptr;
- *length = 0;
- return SECFailure;
- }
-
- buffer[dstlen] = '\0';
- *result = buffer;
- *length = dstlen;
- return SECSuccess;
-}
diff --git a/mozglue/android/NSSBridge.h b/mozglue/android/NSSBridge.h
deleted file mode 100644
index 83ec8d749..000000000
--- a/mozglue/android/NSSBridge.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef NSSBridge_h
-#define NSSBridge_h
-
-#include "nss.h"
-#include "pk11func.h"
-#include "pk11sdr.h"
-#include "seccomon.h"
-#include "secitem.h"
-#include "secmodt.h"
-
-#include "prerror.h"
-#include "plstr.h"
-#include "prmem.h"
-
-#include <jni.h>
-
-int setup_nss_functions(void *nss_handle, void *nssutil_handle, void *plc_handle);
-
-#define NSS_WRAPPER(name, return_type, args...) \
-typedef return_type (*name ## _t)(args); \
-extern name ## _t f_ ## name;
-
-NSS_WRAPPER(NSS_Initialize, SECStatus, const char*, const char*, const char*, const char*, uint32_t)
-NSS_WRAPPER(NSS_Shutdown, void, void)
-NSS_WRAPPER(PK11SDR_Encrypt, SECStatus, SECItem *, SECItem *, SECItem *, void *)
-NSS_WRAPPER(PK11SDR_Decrypt, SECStatus, SECItem *, SECItem *, void *)
-NSS_WRAPPER(SECITEM_ZfreeItem, void, SECItem*, PRBool)
-NSS_WRAPPER(PR_ErrorToString, char *, PRErrorCode, PRLanguageCode)
-NSS_WRAPPER(PR_GetError, PRErrorCode, void)
-NSS_WRAPPER(PR_Free, PRErrorCode, char *)
-NSS_WRAPPER(PL_Base64Encode, char*, const char*, uint32_t, char*)
-NSS_WRAPPER(PL_Base64Decode, char*, const char*, uint32_t, char*)
-NSS_WRAPPER(PL_strfree, void, char*)
-NSS_WRAPPER(PK11_GetInternalKeySlot, PK11SlotInfo *, void)
-NSS_WRAPPER(PK11_NeedUserInit, PRBool, PK11SlotInfo *)
-NSS_WRAPPER(PK11_InitPin, SECStatus, PK11SlotInfo*, const char*, const char*)
-
-#endif /* NSS_h */
diff --git a/mozglue/android/NativeCrypto.cpp b/mozglue/android/NativeCrypto.cpp
deleted file mode 100644
index 9a3632e8d..000000000
--- a/mozglue/android/NativeCrypto.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "NativeCrypto.h"
-#include "APKOpen.h"
-
-#include <jni.h>
-
-#include <errno.h>
-#include <stdlib.h>
-#include <inttypes.h>
-
-#include "mozilla/SHA1.h"
-#include "pbkdf2_sha256.h"
-
-/**
- * Helper function to invoke native PBKDF2 function with JNI
- * arguments.
- */
-extern "C" JNIEXPORT jbyteArray MOZ_JNICALL Java_org_mozilla_gecko_background_nativecode_NativeCrypto_pbkdf2SHA256
- (JNIEnv *env, jclass jc, jbyteArray jpassword, jbyteArray jsalt, jint c, jint dkLen) {
- if (dkLen < 0) {
- env->ThrowNew(env->FindClass("java/lang/IllegalArgumentException"),
- "dkLen should not be less than 0");
- return nullptr;
- }
-
- jbyte *password = env->GetByteArrayElements(jpassword, nullptr);
- size_t passwordLen = env->GetArrayLength(jpassword);
-
- jbyte *salt = env->GetByteArrayElements(jsalt, nullptr);
- size_t saltLen = env->GetArrayLength(jsalt);
-
- uint8_t hashResult[dkLen];
- PBKDF2_SHA256((uint8_t *) password, passwordLen, (uint8_t *) salt, saltLen,
- (uint64_t) c, hashResult, (size_t) dkLen);
-
- env->ReleaseByteArrayElements(jpassword, password, JNI_ABORT);
- env->ReleaseByteArrayElements(jsalt, salt, JNI_ABORT);
-
- jbyteArray out = env->NewByteArray(dkLen);
- if (out == nullptr) {
- return nullptr;
- }
- env->SetByteArrayRegion(out, 0, dkLen, (jbyte *) hashResult);
-
- return out;
-}
-
-using namespace mozilla;
-
-/**
- * Helper function to invoke native SHA-1 function with JNI arguments.
- */
-extern "C" JNIEXPORT jbyteArray MOZ_JNICALL Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha1
- (JNIEnv *env, jclass jc, jbyteArray jstr) {
- jbyte *str = env->GetByteArrayElements(jstr, nullptr);
- size_t strLen = env->GetArrayLength(jstr);
-
- SHA1Sum sha1;
- SHA1Sum::Hash hashResult;
- sha1.update((void *) str, (uint32_t) strLen);
- sha1.finish(hashResult);
-
- env->ReleaseByteArrayElements(jstr, str, JNI_ABORT);
-
- jbyteArray out = env->NewByteArray(SHA1Sum::kHashSize);
- if (out == nullptr) {
- return nullptr;
- }
- env->SetByteArrayRegion(out, 0, SHA1Sum::kHashSize, (jbyte *) hashResult);
-
- return out;
-}
-
-/**
- * Helper function to invoke native SHA-256 init with JNI arguments.
- */
-extern "C" JNIEXPORT jbyteArray MOZ_JNICALL Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256init
- (JNIEnv *env, jclass jc) {
- jbyteArray out = env->NewByteArray(sizeof(SHA256_CTX));
- if (nullptr == out) {
- return nullptr;
- }
-
- SHA256_CTX *shaContext = (SHA256_CTX*)env->GetByteArrayElements(out, nullptr);
- SHA256_Init(shaContext);
-
- env->ReleaseByteArrayElements(out, (jbyte*)shaContext, 0);
-
- return out;
-}
-
-/**
- * Helper function to invoke native SHA-256 update with JNI arguments.
- */
-extern "C" JNIEXPORT void MOZ_JNICALL Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256update
- (JNIEnv *env, jclass jc, jbyteArray jctx, jbyteArray jstr, jint len) {
- jbyte *str = env->GetByteArrayElements(jstr, nullptr);
-
- SHA256_CTX *shaContext = (SHA256_CTX*)env->GetByteArrayElements(jctx, nullptr);
-
- SHA256_Update(shaContext, (void*)str, (size_t) len);
-
- env->ReleaseByteArrayElements(jstr, str, JNI_ABORT);
- env->ReleaseByteArrayElements(jctx, (jbyte*)shaContext, 0);
-
- return;
-}
-
-/**
- * Helper function to invoke native SHA-256 finalize with JNI arguments.
- */
-extern "C" JNIEXPORT jbyteArray MOZ_JNICALL Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256finalize
- (JNIEnv *env, jclass jc, jbyteArray jctx) {
- SHA256_CTX *shaContext = (SHA256_CTX*)env->GetByteArrayElements(jctx, nullptr);
-
- unsigned char* digest = new unsigned char[32];
- SHA256_Final(digest, shaContext);
-
- env->ReleaseByteArrayElements(jctx, (jbyte*)shaContext, JNI_ABORT);
-
- jbyteArray out = env->NewByteArray(32);
- if (nullptr != out) {
- env->SetByteArrayRegion(out, 0, 32, (jbyte*)digest);
- }
-
- delete[] digest;
-
- return out;
-}
diff --git a/mozglue/android/NativeCrypto.h b/mozglue/android/NativeCrypto.h
deleted file mode 100644
index 2850e2bb7..000000000
--- a/mozglue/android/NativeCrypto.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* DO NOT EDIT THIS FILE - it is machine generated */
-#include <jni.h>
-/* Header for class org_mozilla_gecko_background_nativecode_NativeCrypto */
-
-#ifndef _Included_org_mozilla_gecko_background_nativecode_NativeCrypto
-#define _Included_org_mozilla_gecko_background_nativecode_NativeCrypto
-#ifdef __cplusplus
-extern "C" {
-#endif
-/*
- * Class: org_mozilla_gecko_background_nativecode_NativeCrypto
- * Method: pbkdf2SHA256
- * Signature: ([B[BII)[B
- */
-JNIEXPORT jbyteArray JNICALL Java_org_mozilla_gecko_background_nativecode_NativeCrypto_pbkdf2SHA256
- (JNIEnv *, jclass, jbyteArray, jbyteArray, jint, jint);
-
-/*
- * Class: org_mozilla_gecko_background_nativecode_NativeCrypto
- * Method: sha1
- * Signature: ([B)[B
- */
-JNIEXPORT jbyteArray JNICALL Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha1
- (JNIEnv *, jclass, jbyteArray);
-
-/*
- * Class: org_mozilla_gecko_background_nativecode_NativeCrypto
- * Method: sha256init
- * Signature: ()[B
- */
-JNIEXPORT jbyteArray JNICALL Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256init
- (JNIEnv *, jclass);
-
-/*
- * Class: org_mozilla_gecko_background_nativecode_NativeCrypto
- * Method: sha256update
- * Signature: ([B[B)V
- */
-JNIEXPORT void JNICALL Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256update
- (JNIEnv *, jclass, jbyteArray, jbyteArray, jint);
-
-/*
- * Class: org_mozilla_gecko_background_nativecode_NativeCrypto
- * Method: sha256finalize
- * Signature: ([B)[B
- */
-JNIEXPORT jbyteArray JNICALL Java_org_mozilla_gecko_background_nativecode_NativeCrypto_sha256finalize
- (JNIEnv *, jclass, jbyteArray);
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/mozglue/android/SQLiteBridge.cpp b/mozglue/android/SQLiteBridge.cpp
deleted file mode 100644
index 187900bad..000000000
--- a/mozglue/android/SQLiteBridge.cpp
+++ /dev/null
@@ -1,413 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <jni.h>
-#include <android/log.h>
-#include "dlfcn.h"
-#include "APKOpen.h"
-#include "ElfLoader.h"
-#include "SQLiteBridge.h"
-
-#ifdef DEBUG
-#define LOG(x...) __android_log_print(ANDROID_LOG_INFO, "GeckoJNI", x)
-#else
-#define LOG(x...)
-#endif
-
-#define SQLITE_WRAPPER_INT(name) name ## _t f_ ## name;
-
-SQLITE_WRAPPER_INT(sqlite3_open)
-SQLITE_WRAPPER_INT(sqlite3_errmsg)
-SQLITE_WRAPPER_INT(sqlite3_prepare_v2)
-SQLITE_WRAPPER_INT(sqlite3_bind_parameter_count)
-SQLITE_WRAPPER_INT(sqlite3_bind_null)
-SQLITE_WRAPPER_INT(sqlite3_bind_text)
-SQLITE_WRAPPER_INT(sqlite3_step)
-SQLITE_WRAPPER_INT(sqlite3_column_count)
-SQLITE_WRAPPER_INT(sqlite3_finalize)
-SQLITE_WRAPPER_INT(sqlite3_close)
-SQLITE_WRAPPER_INT(sqlite3_column_name)
-SQLITE_WRAPPER_INT(sqlite3_column_type)
-SQLITE_WRAPPER_INT(sqlite3_column_blob)
-SQLITE_WRAPPER_INT(sqlite3_column_bytes)
-SQLITE_WRAPPER_INT(sqlite3_column_text)
-SQLITE_WRAPPER_INT(sqlite3_changes)
-SQLITE_WRAPPER_INT(sqlite3_last_insert_rowid)
-
-void setup_sqlite_functions(void *sqlite_handle)
-{
-#define GETFUNC(name) f_ ## name = (name ## _t) (uintptr_t) __wrap_dlsym(sqlite_handle, #name)
- GETFUNC(sqlite3_open);
- GETFUNC(sqlite3_errmsg);
- GETFUNC(sqlite3_prepare_v2);
- GETFUNC(sqlite3_bind_parameter_count);
- GETFUNC(sqlite3_bind_null);
- GETFUNC(sqlite3_bind_text);
- GETFUNC(sqlite3_step);
- GETFUNC(sqlite3_column_count);
- GETFUNC(sqlite3_finalize);
- GETFUNC(sqlite3_close);
- GETFUNC(sqlite3_column_name);
- GETFUNC(sqlite3_column_type);
- GETFUNC(sqlite3_column_blob);
- GETFUNC(sqlite3_column_bytes);
- GETFUNC(sqlite3_column_text);
- GETFUNC(sqlite3_changes);
- GETFUNC(sqlite3_last_insert_rowid);
-#undef GETFUNC
-}
-
-static bool initialized = false;
-static jclass stringClass;
-static jclass objectClass;
-static jclass byteBufferClass;
-static jclass cursorClass;
-static jmethodID jByteBufferAllocateDirect;
-static jmethodID jCursorConstructor;
-static jmethodID jCursorAddRow;
-
-static jobject sqliteInternalCall(JNIEnv* jenv, sqlite3 *db, jstring jQuery,
- jobjectArray jParams, jlongArray jQueryRes);
-
-static void throwSqliteException(JNIEnv* jenv, const char* aFormat, ...)
-{
- va_list ap;
- va_start(ap, aFormat);
- char* msg = nullptr;
- vasprintf(&msg, aFormat, ap);
- LOG("Error in SQLiteBridge: %s\n", msg);
- JNI_Throw(jenv, "org/mozilla/gecko/sqlite/SQLiteBridgeException", msg);
- free(msg);
- va_end(ap);
-}
-
-static void
-JNI_Setup(JNIEnv* jenv)
-{
- if (initialized) return;
-
- jclass lObjectClass = jenv->FindClass("java/lang/Object");
- jclass lStringClass = jenv->FindClass("java/lang/String");
- jclass lByteBufferClass = jenv->FindClass("java/nio/ByteBuffer");
- jclass lCursorClass = jenv->FindClass("org/mozilla/gecko/sqlite/MatrixBlobCursor");
-
- if (lStringClass == nullptr
- || lObjectClass == nullptr
- || lByteBufferClass == nullptr
- || lCursorClass == nullptr) {
- throwSqliteException(jenv, "FindClass error");
- return;
- }
-
- // Those are only local references. Make them global so they work
- // across calls and threads.
- objectClass = (jclass)jenv->NewGlobalRef(lObjectClass);
- stringClass = (jclass)jenv->NewGlobalRef(lStringClass);
- byteBufferClass = (jclass)jenv->NewGlobalRef(lByteBufferClass);
- cursorClass = (jclass)jenv->NewGlobalRef(lCursorClass);
-
- if (stringClass == nullptr || objectClass == nullptr
- || byteBufferClass == nullptr
- || cursorClass == nullptr) {
- throwSqliteException(jenv, "NewGlobalRef error");
- return;
- }
-
- // public static ByteBuffer allocateDirect(int capacity)
- jByteBufferAllocateDirect =
- jenv->GetStaticMethodID(byteBufferClass, "allocateDirect", "(I)Ljava/nio/ByteBuffer;");
- // new MatrixBlobCursor(String [])
- jCursorConstructor =
- jenv->GetMethodID(cursorClass, "<init>", "([Ljava/lang/String;)V");
- // public void addRow (Object[] columnValues)
- jCursorAddRow =
- jenv->GetMethodID(cursorClass, "addRow", "([Ljava/lang/Object;)V");
-
- if (jByteBufferAllocateDirect == nullptr
- || jCursorConstructor == nullptr
- || jCursorAddRow == nullptr) {
- throwSqliteException(jenv, "GetMethodId error");
- return;
- }
-
- initialized = true;
-}
-
-extern "C" NS_EXPORT jobject MOZ_JNICALL
-Java_org_mozilla_gecko_sqlite_SQLiteBridge_sqliteCall(JNIEnv* jenv, jclass,
- jstring jDb,
- jstring jQuery,
- jobjectArray jParams,
- jlongArray jQueryRes)
-{
- JNI_Setup(jenv);
-
- int rc;
- jobject jCursor = nullptr;
- const char* dbPath;
- sqlite3 *db;
-
- dbPath = jenv->GetStringUTFChars(jDb, nullptr);
- rc = f_sqlite3_open(dbPath, &db);
- jenv->ReleaseStringUTFChars(jDb, dbPath);
- if (rc != SQLITE_OK) {
- throwSqliteException(jenv,
- "Can't open database: %s", f_sqlite3_errmsg(db));
- f_sqlite3_close(db); // close db even if open failed
- return nullptr;
- }
- jCursor = sqliteInternalCall(jenv, db, jQuery, jParams, jQueryRes);
- f_sqlite3_close(db);
- return jCursor;
-}
-
-extern "C" NS_EXPORT jobject MOZ_JNICALL
-Java_org_mozilla_gecko_sqlite_SQLiteBridge_sqliteCallWithDb(JNIEnv* jenv, jclass,
- jlong jDb,
- jstring jQuery,
- jobjectArray jParams,
- jlongArray jQueryRes)
-{
- JNI_Setup(jenv);
-
- jobject jCursor = nullptr;
- sqlite3 *db = (sqlite3*)jDb;
- jCursor = sqliteInternalCall(jenv, db, jQuery, jParams, jQueryRes);
- return jCursor;
-}
-
-extern "C" NS_EXPORT jlong MOZ_JNICALL
-Java_org_mozilla_gecko_sqlite_SQLiteBridge_openDatabase(JNIEnv* jenv, jclass,
- jstring jDb)
-{
- JNI_Setup(jenv);
-
- int rc;
- const char* dbPath;
- sqlite3 *db;
-
- dbPath = jenv->GetStringUTFChars(jDb, nullptr);
- rc = f_sqlite3_open(dbPath, &db);
- jenv->ReleaseStringUTFChars(jDb, dbPath);
- if (rc != SQLITE_OK) {
- throwSqliteException(jenv,
- "Can't open database: %s", f_sqlite3_errmsg(db));
- f_sqlite3_close(db); // close db even if open failed
- return 0;
- }
- return (jlong)db;
-}
-
-extern "C" NS_EXPORT void MOZ_JNICALL
-Java_org_mozilla_gecko_sqlite_SQLiteBridge_closeDatabase(JNIEnv* jenv, jclass,
- jlong jDb)
-{
- JNI_Setup(jenv);
-
- sqlite3 *db = (sqlite3*)jDb;
- f_sqlite3_close(db);
-}
-
-static jobject
-sqliteInternalCall(JNIEnv* jenv,
- sqlite3 *db,
- jstring jQuery,
- jobjectArray jParams,
- jlongArray jQueryRes)
-{
- JNI_Setup(jenv);
-
- jobject jCursor = nullptr;
- jsize numPars = 0;
-
- const char *pzTail;
- sqlite3_stmt *ppStmt;
- int rc;
-
- const char* queryStr;
- queryStr = jenv->GetStringUTFChars(jQuery, nullptr);
-
- rc = f_sqlite3_prepare_v2(db, queryStr, -1, &ppStmt, &pzTail);
- if (rc != SQLITE_OK || ppStmt == nullptr) {
- throwSqliteException(jenv,
- "Can't prepare statement: %s", f_sqlite3_errmsg(db));
- return nullptr;
- }
- jenv->ReleaseStringUTFChars(jQuery, queryStr);
-
- // Check if number of parameters matches
- if (jParams != nullptr) {
- numPars = jenv->GetArrayLength(jParams);
- }
- int sqlNumPars;
- sqlNumPars = f_sqlite3_bind_parameter_count(ppStmt);
- if (numPars != sqlNumPars) {
- throwSqliteException(jenv,
- "Passed parameter count (%d) "
- "doesn't match SQL parameter count (%d)",
- numPars, sqlNumPars);
- return nullptr;
- }
-
- if (jParams != nullptr) {
- // Bind parameters, if any
- if (numPars > 0) {
- for (int i = 0; i < numPars; i++) {
- jobject jObjectParam = jenv->GetObjectArrayElement(jParams, i);
- // IsInstanceOf or isAssignableFrom? String is final, so IsInstanceOf
- // should be OK.
- jboolean isString = jenv->IsInstanceOf(jObjectParam, stringClass);
- if (isString != JNI_TRUE) {
- throwSqliteException(jenv,
- "Parameter is not of String type");
- return nullptr;
- }
-
- // SQLite parameters index from 1.
- if (jObjectParam == nullptr) {
- rc = f_sqlite3_bind_null(ppStmt, i + 1);
- } else {
- jstring jStringParam = (jstring) jObjectParam;
- const char* paramStr = jenv->GetStringUTFChars(jStringParam, nullptr);
- rc = f_sqlite3_bind_text(ppStmt, i + 1, paramStr, -1, SQLITE_TRANSIENT);
- jenv->ReleaseStringUTFChars(jStringParam, paramStr);
- }
-
- if (rc != SQLITE_OK) {
- throwSqliteException(jenv, "Error binding query parameter");
- return nullptr;
- }
- }
- }
- }
-
- // Execute the query and step through the results
- rc = f_sqlite3_step(ppStmt);
- if (rc != SQLITE_ROW && rc != SQLITE_DONE) {
- throwSqliteException(jenv,
- "Can't step statement: (%d) %s", rc, f_sqlite3_errmsg(db));
- return nullptr;
- }
-
- // Get the column count and names
- int cols;
- cols = f_sqlite3_column_count(ppStmt);
-
- {
- // Allocate a String[cols]
- jobjectArray jStringArray = jenv->NewObjectArray(cols,
- stringClass,
- nullptr);
- if (jStringArray == nullptr) {
- throwSqliteException(jenv, "Can't allocate String[]");
- return nullptr;
- }
-
- // Assign column names to the String[]
- for (int i = 0; i < cols; i++) {
- const char* colName = f_sqlite3_column_name(ppStmt, i);
- jstring jStr = jenv->NewStringUTF(colName);
- jenv->SetObjectArrayElement(jStringArray, i, jStr);
- }
-
- // Construct the MatrixCursor(String[]) with given column names
- jCursor = jenv->NewObject(cursorClass,
- jCursorConstructor,
- jStringArray);
- if (jCursor == nullptr) {
- throwSqliteException(jenv, "Can't allocate MatrixBlobCursor");
- return nullptr;
- }
- }
-
- // Return the id and number of changed rows in jQueryRes
- {
- jlong id = f_sqlite3_last_insert_rowid(db);
- jenv->SetLongArrayRegion(jQueryRes, 0, 1, &id);
-
- jlong changed = f_sqlite3_changes(db);
- jenv->SetLongArrayRegion(jQueryRes, 1, 1, &changed);
- }
-
- // For each row, add an Object[] to the passed ArrayList,
- // with that containing either String or ByteArray objects
- // containing the columns
- while (rc != SQLITE_DONE) {
- // Process row
- // Construct Object[]
- jobjectArray jRow = jenv->NewObjectArray(cols,
- objectClass,
- nullptr);
- if (jRow == nullptr) {
- throwSqliteException(jenv, "Can't allocate jRow Object[]");
- return nullptr;
- }
-
- for (int i = 0; i < cols; i++) {
- int colType = f_sqlite3_column_type(ppStmt, i);
- if (colType == SQLITE_BLOB) {
- // Treat as blob
- const void* blob = f_sqlite3_column_blob(ppStmt, i);
- int colLen = f_sqlite3_column_bytes(ppStmt, i);
-
- // Construct ByteBuffer of correct size
- jobject jByteBuffer =
- jenv->CallStaticObjectMethod(byteBufferClass,
- jByteBufferAllocateDirect,
- colLen);
- if (jByteBuffer == nullptr) {
- throwSqliteException(jenv,
- "Failure calling ByteBuffer.allocateDirect");
- return nullptr;
- }
-
- // Get its backing array
- void* bufferArray = jenv->GetDirectBufferAddress(jByteBuffer);
- if (bufferArray == nullptr) {
- throwSqliteException(jenv,
- "Failure calling GetDirectBufferAddress");
- return nullptr;
- }
- memcpy(bufferArray, blob, colLen);
-
- jenv->SetObjectArrayElement(jRow, i, jByteBuffer);
- jenv->DeleteLocalRef(jByteBuffer);
- } else if (colType == SQLITE_NULL) {
- jenv->SetObjectArrayElement(jRow, i, nullptr);
- } else {
- // Treat everything else as text
- const char* txt = (const char*)f_sqlite3_column_text(ppStmt, i);
- jstring jStr = jenv->NewStringUTF(txt);
- jenv->SetObjectArrayElement(jRow, i, jStr);
- jenv->DeleteLocalRef(jStr);
- }
- }
-
- // Append Object[] to Cursor
- jenv->CallVoidMethod(jCursor, jCursorAddRow, jRow);
-
- // Clean up
- jenv->DeleteLocalRef(jRow);
-
- // Get next row
- rc = f_sqlite3_step(ppStmt);
- // Real error?
- if (rc != SQLITE_ROW && rc != SQLITE_DONE) {
- throwSqliteException(jenv,
- "Can't re-step statement:(%d) %s", rc, f_sqlite3_errmsg(db));
- return nullptr;
- }
- }
-
- rc = f_sqlite3_finalize(ppStmt);
- if (rc != SQLITE_OK) {
- throwSqliteException(jenv,
- "Can't finalize statement: %s", f_sqlite3_errmsg(db));
- return nullptr;
- }
-
- return jCursor;
-}
diff --git a/mozglue/android/SQLiteBridge.h b/mozglue/android/SQLiteBridge.h
deleted file mode 100644
index f2ede820f..000000000
--- a/mozglue/android/SQLiteBridge.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef SQLiteBridge_h
-#define SQLiteBridge_h
-
-#include "sqlite3.h"
-
-void setup_sqlite_functions(void *sqlite_handle);
-
-#define SQLITE_WRAPPER(name, return_type, args...) \
-typedef return_type (*name ## _t)(args); \
-extern name ## _t f_ ## name;
-
-SQLITE_WRAPPER(sqlite3_open, int, const char*, sqlite3**)
-SQLITE_WRAPPER(sqlite3_errmsg, const char*, sqlite3*)
-SQLITE_WRAPPER(sqlite3_prepare_v2, int, sqlite3*, const char*, int, sqlite3_stmt**, const char**)
-SQLITE_WRAPPER(sqlite3_bind_parameter_count, int, sqlite3_stmt*)
-SQLITE_WRAPPER(sqlite3_bind_text, int, sqlite3_stmt*, int, const char*, int, void(*)(void*))
-SQLITE_WRAPPER(sqlite3_bind_null, int, sqlite3_stmt*, int)
-SQLITE_WRAPPER(sqlite3_step, int, sqlite3_stmt*)
-SQLITE_WRAPPER(sqlite3_column_count, int, sqlite3_stmt*)
-SQLITE_WRAPPER(sqlite3_finalize, int, sqlite3_stmt*)
-SQLITE_WRAPPER(sqlite3_close, int, sqlite3*)
-SQLITE_WRAPPER(sqlite3_column_name, const char*, sqlite3_stmt*, int)
-SQLITE_WRAPPER(sqlite3_column_type, int, sqlite3_stmt*, int)
-SQLITE_WRAPPER(sqlite3_column_blob, const void*, sqlite3_stmt*, int)
-SQLITE_WRAPPER(sqlite3_column_bytes, int, sqlite3_stmt*, int)
-SQLITE_WRAPPER(sqlite3_column_text, const unsigned char*, sqlite3_stmt*, int)
-SQLITE_WRAPPER(sqlite3_changes, int, sqlite3*)
-SQLITE_WRAPPER(sqlite3_last_insert_rowid, sqlite3_int64, sqlite3*)
-
-#endif /* SQLiteBridge_h */
diff --git a/mozglue/android/SharedMemNatives.cpp b/mozglue/android/SharedMemNatives.cpp
deleted file mode 100644
index d186d6e21..000000000
--- a/mozglue/android/SharedMemNatives.cpp
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <jni.h>
-#include <string.h>
-#include <sys/mman.h>
-
-extern "C" {
-
-JNIEXPORT
-void JNICALL
-Java_org_mozilla_gecko_mozglue_SharedMemBuffer_nativeReadFromDirectBuffer(JNIEnv* jenv, jclass, jobject src, jlong dest, jint offset, jint size)
-{
- uint8_t* from = static_cast<uint8_t*>(jenv->GetDirectBufferAddress(src));
- if (from == nullptr) {
- jenv->ThrowNew(jenv->FindClass("java/lang/NullPointerException"), "Null direct buffer");
- return;
- }
-
- void* to = reinterpret_cast<void*>(dest);
- if (to == nullptr) {
- jenv->ThrowNew(jenv->FindClass("java/lang/NullPointerException"), "Null shared memory buffer");
- return;
- }
-
- memcpy(to, from + offset, size);
-}
-
-JNIEXPORT
-void JNICALL
-Java_org_mozilla_gecko_mozglue_SharedMemBuffer_nativeWriteToDirectBuffer(JNIEnv* jenv, jclass, jlong src, jobject dest, jint offset, jint size)
-{
- uint8_t* from = reinterpret_cast<uint8_t*>(src);
- if (from == nullptr) {
- jenv->ThrowNew(jenv->FindClass("java/lang/NullPointerException"), "Null shared memory buffer");
- return;
- }
-
- void* to = jenv->GetDirectBufferAddress(dest);
- if (to == nullptr) {
- jenv->ThrowNew(jenv->FindClass("java/lang/NullPointerException"), "Null direct buffer");
- return;
- }
-
- memcpy(to, from + offset, size);
-}
-
-JNIEXPORT
-jlong JNICALL
-Java_org_mozilla_gecko_mozglue_SharedMemory_map(JNIEnv *env, jobject jobj, jint fd, jint length)
-{
- void* address = mmap(NULL, length, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- return jlong(address);
-}
-
-JNIEXPORT
-void JNICALL
-Java_org_mozilla_gecko_mozglue_SharedMemory_unmap(JNIEnv *env, jobject jobj, jlong address, jint size)
-{
- munmap((void*)address, (size_t)size);
-}
-
-} \ No newline at end of file
diff --git a/mozglue/android/moz.build b/mozglue/android/moz.build
deleted file mode 100644
index cdc5ffb3c..000000000
--- a/mozglue/android/moz.build
+++ /dev/null
@@ -1,58 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXPORTS += [
- 'APKOpen.h',
-]
-
-SOURCES += [
- 'APKOpen.cpp',
- 'NativeCrypto.cpp',
- 'nsGeckoUtils.cpp',
- 'NSSBridge.cpp',
- 'pbkdf2_sha256.c',
- 'SharedMemNatives.cpp',
- 'SQLiteBridge.cpp',
-]
-
-FINAL_LIBRARY = 'mozglue'
-
-for var in ('ANDROID_PACKAGE_NAME',
- 'ANDROID_CPU_ARCH'):
- DEFINES[var] = '"%s"' % CONFIG[var]
-
-if CONFIG['MOZ_FOLD_LIBS']:
- DEFINES['MOZ_FOLD_LIBS'] = True
-
-LOCAL_INCLUDES += [
- '!/build',
- '../linker',
- '/db/sqlite3/src',
- '/ipc/chromium/src',
- '/nsprpub/lib/ds',
- '/nsprpub/lib/libc/include',
- '/nsprpub/pr/include',
- '/security/nss/lib/base',
- '/security/nss/lib/certdb',
- '/security/nss/lib/cryptohi',
- '/security/nss/lib/dev',
- '/security/nss/lib/freebl',
- '/security/nss/lib/nss',
- '/security/nss/lib/pk11wrap',
- '/security/nss/lib/pkcs7',
- '/security/nss/lib/pki',
- '/security/nss/lib/smime',
- '/security/nss/lib/softoken',
- '/security/nss/lib/ssl',
- '/security/nss/lib/util',
- '/toolkit/components/startup',
- '/xpcom/build',
-]
-
-DISABLE_STL_WRAPPING = True
-
-if CONFIG['GNU_CXX']:
- CXXFLAGS += ['-Wno-error=shadow']
diff --git a/mozglue/android/nsGeckoUtils.cpp b/mozglue/android/nsGeckoUtils.cpp
deleted file mode 100644
index 22818a746..000000000
--- a/mozglue/android/nsGeckoUtils.cpp
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <jni.h>
-
-#include <stdlib.h>
-#include <fcntl.h>
-#include "APKOpen.h"
-#include "Zip.h"
-#include "mozilla/RefPtr.h"
-
-extern "C"
-__attribute__ ((visibility("default")))
-void MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_GeckoLoader_putenv(JNIEnv *jenv, jclass, jstring map)
-{
- const char* str;
- // XXX: java doesn't give us true UTF8, we should figure out something
- // better to do here
- str = jenv->GetStringUTFChars(map, nullptr);
- if (str == nullptr)
- return;
- putenv(strdup(str));
- jenv->ReleaseStringUTFChars(map, str);
-}
-
-extern "C"
-__attribute__ ((visibility("default")))
-jobject MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_DirectBufferAllocator_nativeAllocateDirectBuffer(JNIEnv *jenv, jclass, jlong size)
-{
- jobject buffer = nullptr;
- void* mem = malloc(size);
- if (mem) {
- buffer = jenv->NewDirectByteBuffer(mem, size);
- if (!buffer)
- free(mem);
- }
- return buffer;
-}
-
-extern "C"
-__attribute__ ((visibility("default")))
-void MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_DirectBufferAllocator_nativeFreeDirectBuffer(JNIEnv *jenv, jclass, jobject buf)
-{
- free(jenv->GetDirectBufferAddress(buf));
-}
-
-extern "C"
-__attribute__ ((visibility("default")))
-jlong MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_NativeZip_getZip(JNIEnv *jenv, jclass, jstring path)
-{
- const char* str;
- str = jenv->GetStringUTFChars(path, nullptr);
- if (!str || !*str) {
- if (str)
- jenv->ReleaseStringUTFChars(path, str);
- JNI_Throw(jenv, "java/lang/IllegalArgumentException", "Invalid path");
- return 0;
- }
- RefPtr<Zip> zip = ZipCollection::GetZip(str);
- jenv->ReleaseStringUTFChars(path, str);
- if (!zip) {
- JNI_Throw(jenv, "java/lang/IllegalArgumentException", "Invalid path or invalid zip");
- return 0;
- }
- return reinterpret_cast<jlong>(zip.forget().take());
-}
-
-extern "C"
-__attribute__ ((visibility("default")))
-jlong MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_NativeZip_getZipFromByteBuffer(JNIEnv *jenv, jclass, jobject buffer)
-{
- void *buf = jenv->GetDirectBufferAddress(buffer);
- size_t size = jenv->GetDirectBufferCapacity(buffer);
- RefPtr<Zip> zip = Zip::Create(buf, size);
- if (!zip) {
- JNI_Throw(jenv, "java/lang/IllegalArgumentException", "Invalid zip");
- return 0;
- }
- return reinterpret_cast<jlong>(zip.forget().take());
-}
-
- extern "C"
-__attribute__ ((visibility("default")))
-void MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_NativeZip__1release(JNIEnv *jenv, jclass, jlong obj)
-{
- Zip *zip = (Zip *)obj;
- zip->Release();
-}
-
-extern "C"
-__attribute__ ((visibility("default")))
-jobject MOZ_JNICALL
-Java_org_mozilla_gecko_mozglue_NativeZip__1getInputStream(JNIEnv *jenv, jobject jzip, jlong obj, jstring path)
-{
- Zip *zip = (Zip *)obj;
- const char* str;
- str = jenv->GetStringUTFChars(path, nullptr);
-
- Zip::Stream stream;
- bool res = zip->GetStream(str, &stream);
- jenv->ReleaseStringUTFChars(path, str);
- if (!res) {
- return nullptr;
- }
- jobject buf = jenv->NewDirectByteBuffer(const_cast<void *>(stream.GetBuffer()), stream.GetSize());
- if (!buf) {
- JNI_Throw(jenv, "java/lang/RuntimeException", "Failed to create ByteBuffer");
- return nullptr;
- }
- jclass nativeZip = jenv->GetObjectClass(jzip);
- jmethodID method = jenv->GetMethodID(nativeZip, "createInputStream", "(Ljava/nio/ByteBuffer;I)Ljava/io/InputStream;");
- // Since this function is only expected to be called from Java, it is safe
- // to skip exception checking for the method call below, as long as no
- // other Native -> Java call doesn't happen before returning to Java.
- return jenv->CallObjectMethod(jzip, method, buf, (jint) stream.GetType());
-}
diff --git a/mozglue/android/pbkdf2_sha256.c b/mozglue/android/pbkdf2_sha256.c
deleted file mode 100644
index 8e90f386a..000000000
--- a/mozglue/android/pbkdf2_sha256.c
+++ /dev/null
@@ -1,432 +0,0 @@
-/*-
- * Copyright 2005,2007,2009 Colin Percival
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-#include <sys/types.h>
-
-#include <stdint.h>
-#include <string.h>
-
-#include <sys/endian.h>
-
-#include "pbkdf2_sha256.h"
-
-static inline uint32_t
-be32dec(const void *pp)
-{
- const uint8_t *p = (uint8_t const *)pp;
-
- return ((uint32_t)(p[3]) +
- ((uint32_t)(p[2]) << 8) +
- ((uint32_t)(p[1]) << 16) +
- ((uint32_t)(p[0]) << 24));
-}
-
-static inline void
-be32enc(void *pp, uint32_t x)
-{
- uint8_t * p = (uint8_t *)pp;
-
- p[3] = x & 0xff;
- p[2] = (x >> 8) & 0xff;
- p[1] = (x >> 16) & 0xff;
- p[0] = (x >> 24) & 0xff;
-}
-
-/*
- * Encode a length len/4 vector of (uint32_t) into a length len vector of
- * (unsigned char) in big-endian form. Assumes len is a multiple of 4.
- */
-static void
-be32enc_vect(unsigned char *dst, const uint32_t *src, size_t len)
-{
- size_t i;
-
- for (i = 0; i < len / 4; i++)
- be32enc(dst + i * 4, src[i]);
-}
-
-/*
- * Decode a big-endian length len vector of (unsigned char) into a length
- * len/4 vector of (uint32_t). Assumes len is a multiple of 4.
- */
-static void
-be32dec_vect(uint32_t *dst, const unsigned char *src, size_t len)
-{
- size_t i;
-
- for (i = 0; i < len / 4; i++)
- dst[i] = be32dec(src + i * 4);
-}
-
-/* Elementary functions used by SHA256 */
-#define Ch(x, y, z) ((x & (y ^ z)) ^ z)
-#define Maj(x, y, z) ((x & (y | z)) | (y & z))
-#define SHR(x, n) (x >> n)
-#define ROTR(x, n) ((x >> n) | (x << (32 - n)))
-#define S0(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22))
-#define S1(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25))
-#define s0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3))
-#define s1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10))
-
-/* SHA256 round function */
-#define RND(a, b, c, d, e, f, g, h, k) \
- t0 = h + S1(e) + Ch(e, f, g) + k; \
- t1 = S0(a) + Maj(a, b, c); \
- d += t0; \
- h = t0 + t1;
-
-/* Adjusted round function for rotating state */
-#define RNDr(S, W, i, k) \
- RND(S[(64 - i) % 8], S[(65 - i) % 8], \
- S[(66 - i) % 8], S[(67 - i) % 8], \
- S[(68 - i) % 8], S[(69 - i) % 8], \
- S[(70 - i) % 8], S[(71 - i) % 8], \
- W[i] + k)
-
-/*
- * SHA256 block compression function. The 256-bit state is transformed via
- * the 512-bit input block to produce a new state.
- */
-static void
-SHA256_Transform(uint32_t * state, const unsigned char block[64])
-{
- uint32_t W[64];
- uint32_t S[8];
- uint32_t t0, t1;
- int i;
-
- /* 1. Prepare message schedule W. */
- be32dec_vect(W, block, 64);
- for (i = 16; i < 64; i++)
- W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16];
-
- /* 2. Initialize working variables. */
- memcpy(S, state, 32);
-
- /* 3. Mix. */
- RNDr(S, W, 0, 0x428a2f98);
- RNDr(S, W, 1, 0x71374491);
- RNDr(S, W, 2, 0xb5c0fbcf);
- RNDr(S, W, 3, 0xe9b5dba5);
- RNDr(S, W, 4, 0x3956c25b);
- RNDr(S, W, 5, 0x59f111f1);
- RNDr(S, W, 6, 0x923f82a4);
- RNDr(S, W, 7, 0xab1c5ed5);
- RNDr(S, W, 8, 0xd807aa98);
- RNDr(S, W, 9, 0x12835b01);
- RNDr(S, W, 10, 0x243185be);
- RNDr(S, W, 11, 0x550c7dc3);
- RNDr(S, W, 12, 0x72be5d74);
- RNDr(S, W, 13, 0x80deb1fe);
- RNDr(S, W, 14, 0x9bdc06a7);
- RNDr(S, W, 15, 0xc19bf174);
- RNDr(S, W, 16, 0xe49b69c1);
- RNDr(S, W, 17, 0xefbe4786);
- RNDr(S, W, 18, 0x0fc19dc6);
- RNDr(S, W, 19, 0x240ca1cc);
- RNDr(S, W, 20, 0x2de92c6f);
- RNDr(S, W, 21, 0x4a7484aa);
- RNDr(S, W, 22, 0x5cb0a9dc);
- RNDr(S, W, 23, 0x76f988da);
- RNDr(S, W, 24, 0x983e5152);
- RNDr(S, W, 25, 0xa831c66d);
- RNDr(S, W, 26, 0xb00327c8);
- RNDr(S, W, 27, 0xbf597fc7);
- RNDr(S, W, 28, 0xc6e00bf3);
- RNDr(S, W, 29, 0xd5a79147);
- RNDr(S, W, 30, 0x06ca6351);
- RNDr(S, W, 31, 0x14292967);
- RNDr(S, W, 32, 0x27b70a85);
- RNDr(S, W, 33, 0x2e1b2138);
- RNDr(S, W, 34, 0x4d2c6dfc);
- RNDr(S, W, 35, 0x53380d13);
- RNDr(S, W, 36, 0x650a7354);
- RNDr(S, W, 37, 0x766a0abb);
- RNDr(S, W, 38, 0x81c2c92e);
- RNDr(S, W, 39, 0x92722c85);
- RNDr(S, W, 40, 0xa2bfe8a1);
- RNDr(S, W, 41, 0xa81a664b);
- RNDr(S, W, 42, 0xc24b8b70);
- RNDr(S, W, 43, 0xc76c51a3);
- RNDr(S, W, 44, 0xd192e819);
- RNDr(S, W, 45, 0xd6990624);
- RNDr(S, W, 46, 0xf40e3585);
- RNDr(S, W, 47, 0x106aa070);
- RNDr(S, W, 48, 0x19a4c116);
- RNDr(S, W, 49, 0x1e376c08);
- RNDr(S, W, 50, 0x2748774c);
- RNDr(S, W, 51, 0x34b0bcb5);
- RNDr(S, W, 52, 0x391c0cb3);
- RNDr(S, W, 53, 0x4ed8aa4a);
- RNDr(S, W, 54, 0x5b9cca4f);
- RNDr(S, W, 55, 0x682e6ff3);
- RNDr(S, W, 56, 0x748f82ee);
- RNDr(S, W, 57, 0x78a5636f);
- RNDr(S, W, 58, 0x84c87814);
- RNDr(S, W, 59, 0x8cc70208);
- RNDr(S, W, 60, 0x90befffa);
- RNDr(S, W, 61, 0xa4506ceb);
- RNDr(S, W, 62, 0xbef9a3f7);
- RNDr(S, W, 63, 0xc67178f2);
-
- /* 4. Mix local working variables into global state. */
- for (i = 0; i < 8; i++)
- state[i] += S[i];
-
- /* Clean the stack. */
- memset(W, 0, 256);
- memset(S, 0, 32);
- t0 = t1 = 0;
-}
-
-static unsigned char PAD[64] = {
- 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
-};
-
-/* Add padding and terminating bit-count. */
-static void
-SHA256_Pad(SHA256_CTX * ctx)
-{
- unsigned char len[8];
- uint32_t r, plen;
-
- /*
- * Convert length to a vector of bytes -- we do this now rather
- * than later because the length will change after we pad.
- */
- be32enc_vect(len, ctx->count, 8);
-
- /* Add 1--64 bytes so that the resulting length is 56 mod 64. */
- r = (ctx->count[1] >> 3) & 0x3f;
- plen = (r < 56) ? (56 - r) : (120 - r);
- SHA256_Update(ctx, PAD, (size_t)plen);
-
- /* Add the terminating bit-count. */
- SHA256_Update(ctx, len, 8);
-}
-
-/* SHA-256 initialization. Begins a SHA-256 operation. */
-void
-SHA256_Init(SHA256_CTX * ctx)
-{
-
- /* Zero bits processed so far. */
- ctx->count[0] = ctx->count[1] = 0;
-
- /* Magic initialization constants. */
- ctx->state[0] = 0x6A09E667;
- ctx->state[1] = 0xBB67AE85;
- ctx->state[2] = 0x3C6EF372;
- ctx->state[3] = 0xA54FF53A;
- ctx->state[4] = 0x510E527F;
- ctx->state[5] = 0x9B05688C;
- ctx->state[6] = 0x1F83D9AB;
- ctx->state[7] = 0x5BE0CD19;
-}
-
-/* Add bytes into the hash. */
-void
-SHA256_Update(SHA256_CTX * ctx, const void *in, size_t len)
-{
- uint32_t bitlen[2];
- uint32_t r;
- const unsigned char *src = in;
-
- /* Number of bytes left in the buffer from previous updates. */
- r = (ctx->count[1] >> 3) & 0x3f;
-
- /* Convert the length into a number of bits. */
- bitlen[1] = ((uint32_t)len) << 3;
- bitlen[0] = (uint32_t)(len >> 29);
-
- /* Update number of bits. */
- if ((ctx->count[1] += bitlen[1]) < bitlen[1])
- ctx->count[0]++;
- ctx->count[0] += bitlen[0];
-
- /* Handle the case where we don't need to perform any transforms. */
- if (len < 64 - r) {
- memcpy(&ctx->buf[r], src, len);
- return;
- }
-
- /* Finish the current block. */
- memcpy(&ctx->buf[r], src, 64 - r);
- SHA256_Transform(ctx->state, ctx->buf);
- src += 64 - r;
- len -= 64 - r;
-
- /* Perform complete blocks. */
- while (len >= 64) {
- SHA256_Transform(ctx->state, src);
- src += 64;
- len -= 64;
- }
-
- /* Copy left over data into buffer. */
- memcpy(ctx->buf, src, len);
-}
-
-/*
- * SHA-256 finalization. Pads the input data, exports the hash value,
- * and clears the context state.
- */
-void
-SHA256_Final(unsigned char digest[32], SHA256_CTX * ctx)
-{
-
- /* Add padding. */
- SHA256_Pad(ctx);
-
- /* Write the hash. */
- be32enc_vect(digest, ctx->state, 32);
-
- /* Clear the context state. */
- memset((void *)ctx, 0, sizeof(*ctx));
-}
-
-/* Initialize an HMAC-SHA256 operation with the given key. */
-void
-HMAC_SHA256_Init(HMAC_SHA256_CTX * ctx, const void * _K, size_t Klen)
-{
- unsigned char pad[64];
- unsigned char khash[32];
- const unsigned char * K = _K;
- size_t i;
-
- /* If Klen > 64, the key is really SHA256(K). */
- if (Klen > 64) {
- SHA256_Init(&ctx->ictx);
- SHA256_Update(&ctx->ictx, K, Klen);
- SHA256_Final(khash, &ctx->ictx);
- K = khash;
- Klen = 32;
- }
-
- /* Inner SHA256 operation is SHA256(K xor [block of 0x36] || data). */
- SHA256_Init(&ctx->ictx);
- memset(pad, 0x36, 64);
- for (i = 0; i < Klen; i++)
- pad[i] ^= K[i];
- SHA256_Update(&ctx->ictx, pad, 64);
-
- /* Outer SHA256 operation is SHA256(K xor [block of 0x5c] || hash). */
- SHA256_Init(&ctx->octx);
- memset(pad, 0x5c, 64);
- for (i = 0; i < Klen; i++)
- pad[i] ^= K[i];
- SHA256_Update(&ctx->octx, pad, 64);
-
- /* Clean the stack. */
- memset(khash, 0, 32);
-}
-
-/* Add bytes to the HMAC-SHA256 operation. */
-void
-HMAC_SHA256_Update(HMAC_SHA256_CTX * ctx, const void *in, size_t len)
-{
-
- /* Feed data to the inner SHA256 operation. */
- SHA256_Update(&ctx->ictx, in, len);
-}
-
-/* Finish an HMAC-SHA256 operation. */
-void
-HMAC_SHA256_Final(unsigned char digest[32], HMAC_SHA256_CTX * ctx)
-{
- unsigned char ihash[32];
-
- /* Finish the inner SHA256 operation. */
- SHA256_Final(ihash, &ctx->ictx);
-
- /* Feed the inner hash to the outer SHA256 operation. */
- SHA256_Update(&ctx->octx, ihash, 32);
-
- /* Finish the outer SHA256 operation. */
- SHA256_Final(digest, &ctx->octx);
-
- /* Clean the stack. */
- memset(ihash, 0, 32);
-}
-
-/**
- * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen):
- * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and
- * write the output to buf. The value dkLen must be at most 32 * (2^32 - 1).
- */
-void
-PBKDF2_SHA256(const uint8_t * passwd, size_t passwdlen, const uint8_t * salt,
- size_t saltlen, uint64_t c, uint8_t * buf, size_t dkLen)
-{
- HMAC_SHA256_CTX PShctx, hctx;
- size_t i;
- uint8_t ivec[4];
- uint8_t U[32];
- uint8_t T[32];
- uint64_t j;
- int k;
- size_t clen;
-
- /* Compute HMAC state after processing P and S. */
- HMAC_SHA256_Init(&PShctx, passwd, passwdlen);
- HMAC_SHA256_Update(&PShctx, salt, saltlen);
-
- /* Iterate through the blocks. */
- for (i = 0; i * 32 < dkLen; i++) {
- /* Generate INT(i + 1). */
- be32enc(ivec, (uint32_t)(i + 1));
-
- /* Compute U_1 = PRF(P, S || INT(i)). */
- memcpy(&hctx, &PShctx, sizeof(HMAC_SHA256_CTX));
- HMAC_SHA256_Update(&hctx, ivec, 4);
- HMAC_SHA256_Final(U, &hctx);
-
- /* T_i = U_1 ... */
- memcpy(T, U, 32);
-
- for (j = 2; j <= c; j++) {
- /* Compute U_j. */
- HMAC_SHA256_Init(&hctx, passwd, passwdlen);
- HMAC_SHA256_Update(&hctx, U, 32);
- HMAC_SHA256_Final(U, &hctx);
-
- /* ... xor U_j ... */
- for (k = 0; k < 32; k++)
- T[k] ^= U[k];
- }
-
- /* Copy as many bytes as necessary into buf. */
- clen = dkLen - i * 32;
- if (clen > 32)
- clen = 32;
- memcpy(&buf[i * 32], T, clen);
- }
-
- /* Clean PShctx, since we never called _Final on it. */
- memset(&PShctx, 0, sizeof(HMAC_SHA256_CTX));
-}
diff --git a/mozglue/android/pbkdf2_sha256.h b/mozglue/android/pbkdf2_sha256.h
deleted file mode 100644
index ca2af7a8f..000000000
--- a/mozglue/android/pbkdf2_sha256.h
+++ /dev/null
@@ -1,70 +0,0 @@
-/*-
- * Copyright 2005,2007,2009 Colin Percival
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * $FreeBSD: src/lib/libmd/sha256.h,v 1.2 2006/01/17 15:35:56 phk Exp $
- */
-
-#ifndef _SHA256_H_
-#define _SHA256_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#include <sys/types.h>
-
-#include <stdint.h>
-
-typedef struct SHA256Context {
- uint32_t state[8];
- uint32_t count[2];
- unsigned char buf[64];
-} SHA256_CTX;
-
-typedef struct HMAC_SHA256Context {
- SHA256_CTX ictx;
- SHA256_CTX octx;
-} HMAC_SHA256_CTX;
-
-void SHA256_Init(SHA256_CTX *);
-void SHA256_Update(SHA256_CTX *, const void *, size_t);
-void SHA256_Final(unsigned char [32], SHA256_CTX *);
-void HMAC_SHA256_Init(HMAC_SHA256_CTX *, const void *, size_t);
-void HMAC_SHA256_Update(HMAC_SHA256_CTX *, const void *, size_t);
-void HMAC_SHA256_Final(unsigned char [32], HMAC_SHA256_CTX *);
-
-/**
- * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen):
- * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and
- * write the output to buf. The value dkLen must be at most 32 * (2^32 - 1).
- */
-void PBKDF2_SHA256(const uint8_t *, size_t, const uint8_t *, size_t,
- uint64_t, uint8_t *, size_t);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* !_SHA256_H_ */
diff --git a/mozglue/build/BionicGlue.cpp b/mozglue/build/BionicGlue.cpp
deleted file mode 100644
index 9277f1e76..000000000
--- a/mozglue/build/BionicGlue.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <pthread.h>
-#include <string.h>
-#include <stdlib.h>
-#include <time.h>
-#include <unistd.h>
-#include <android/log.h>
-#include <sys/syscall.h>
-
-#include "mozilla/Alignment.h"
-
-#include <vector>
-
-#define NS_EXPORT __attribute__ ((visibility("default")))
-
-#if ANDROID_VERSION < 17 || defined(MOZ_WIDGET_ANDROID)
-/* Android doesn't have pthread_atfork(), so we need to use our own. */
-struct AtForkFuncs {
- void (*prepare)(void);
- void (*parent)(void);
- void (*child)(void);
-};
-
-/* jemalloc's initialization calls pthread_atfork. When pthread_atfork (see
- * further below) stores the corresponding data, it's going to allocate memory,
- * which will loop back to jemalloc's initialization, leading to a dead-lock.
- * So, for that specific vector, we use a special allocator that returns a
- * static buffer for small sizes, and force the initial vector capacity to
- * a size enough to store one atfork function table. */
-template <typename T>
-struct SpecialAllocator: public std::allocator<T>
-{
- SpecialAllocator(): bufUsed(false) {}
-
- inline typename std::allocator<T>::pointer allocate(typename std::allocator<T>::size_type n, const void * = 0) {
- if (!bufUsed && n == 1) {
- bufUsed = true;
- return buf.addr();
- }
- return reinterpret_cast<T *>(::operator new(sizeof(T) * n));
- }
-
- inline void deallocate(typename std::allocator<T>::pointer p, typename std::allocator<T>::size_type n) {
- if (p == buf.addr())
- bufUsed = false;
- else
- ::operator delete(p);
- }
-
- template<typename U>
- struct rebind {
- typedef SpecialAllocator<U> other;
- };
-
-private:
- mozilla::AlignedStorage2<T> buf;
- bool bufUsed;
-};
-
-static std::vector<AtForkFuncs, SpecialAllocator<AtForkFuncs> > atfork;
-#endif
-
-#define cpuacct_add(x)
-
-#if ANDROID_VERSION < 17 || defined(MOZ_WIDGET_ANDROID)
-extern "C" NS_EXPORT int
-pthread_atfork(void (*prepare)(void), void (*parent)(void), void (*child)(void))
-{
- AtForkFuncs funcs;
- funcs.prepare = prepare;
- funcs.parent = parent;
- funcs.child = child;
- if (!atfork.capacity())
- atfork.reserve(1);
- atfork.push_back(funcs);
- return 0;
-}
-
-extern "C" NS_EXPORT pid_t __fork(void);
-
-extern "C" NS_EXPORT pid_t
-fork(void)
-{
- pid_t pid;
- for (auto it = atfork.rbegin();
- it < atfork.rend(); ++it)
- if (it->prepare)
- it->prepare();
-
- switch ((pid = syscall(__NR_clone, SIGCHLD, NULL, NULL, NULL, NULL))) {
- case 0:
- cpuacct_add(getuid());
- for (auto it = atfork.begin();
- it < atfork.end(); ++it)
- if (it->child)
- it->child();
- break;
- default:
- for (auto it = atfork.begin();
- it < atfork.end(); ++it)
- if (it->parent)
- it->parent();
- }
- return pid;
-}
-#endif
-
-extern "C" NS_EXPORT int
-raise(int sig)
-{
- // Bug 741272: Bionic incorrectly uses kill(), which signals the
- // process, and thus could signal another thread (and let this one
- // return "successfully" from raising a fatal signal).
- //
- // Bug 943170: POSIX specifies pthread_kill(pthread_self(), sig) as
- // equivalent to raise(sig), but Bionic also has a bug with these
- // functions, where a forked child will kill its parent instead.
-
- extern pid_t gettid(void);
- return syscall(__NR_tgkill, getpid(), gettid(), sig);
-}
-
-/* Flash plugin uses symbols that are not present in Android >= 4.4 */
-namespace android {
- namespace VectorImpl {
- NS_EXPORT void reservedVectorImpl1(void) { }
- NS_EXPORT void reservedVectorImpl2(void) { }
- NS_EXPORT void reservedVectorImpl3(void) { }
- NS_EXPORT void reservedVectorImpl4(void) { }
- NS_EXPORT void reservedVectorImpl5(void) { }
- NS_EXPORT void reservedVectorImpl6(void) { }
- NS_EXPORT void reservedVectorImpl7(void) { }
- NS_EXPORT void reservedVectorImpl8(void) { }
- }
-}
-
diff --git a/mozglue/build/arm.cpp b/mozglue/build/arm.cpp
index 74b856a8f..e11985e4d 100644
--- a/mozglue/build/arm.cpp
+++ b/mozglue/build/arm.cpp
@@ -13,7 +13,7 @@
// we don't compile one of these detection methods. The detection code here is
// based on the CPU detection in libtheora.
-# if defined(__linux__) || defined(ANDROID)
+# if defined(__linux__)
# include <stdio.h>
# include <stdlib.h>
# include <string.h>
@@ -125,7 +125,7 @@ check_neon(void)
}
# endif
-# endif // defined(__linux__) || defined(ANDROID)
+# endif // defined(__linux__)
namespace mozilla {
namespace arm_private {
diff --git a/mozglue/build/arm.h b/mozglue/build/arm.h
index e3379f67b..4ab03d6ec 100644
--- a/mozglue/build/arm.h
+++ b/mozglue/build/arm.h
@@ -76,7 +76,7 @@
# endif
// Currently we only have CPU detection for Linux via /proc/cpuinfo
-# if defined(__linux__) || defined(ANDROID)
+# if defined(__linux__)
# define MOZILLA_ARM_HAVE_CPUID_DETECTION 1
# endif
diff --git a/mozglue/build/moz.build b/mozglue/build/moz.build
index b97bddcdc..5632bc06e 100644
--- a/mozglue/build/moz.build
+++ b/mozglue/build/moz.build
@@ -4,31 +4,22 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-# Build mozglue as a shared lib on Windows, OSX and Android.
+# Build mozglue as a shared lib on Windows, OSX.
# If this is ever changed, update MOZ_SHARED_MOZGLUE in browser/installer/Makefile.in
-if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'):
+if CONFIG['OS_TARGET'] in ('WINNT', 'Darwin'):
SharedLibrary('mozglue')
else:
Library('mozglue')
SDK_LIBRARY = True
-if CONFIG['OS_TARGET'] == 'Android':
- SOURCES += [
- 'BionicGlue.cpp',
- ]
-
if CONFIG['MOZ_ASAN']:
- SOURCES += [
- 'AsanOptions.cpp',
- ]
+ SOURCES += ['AsanOptions.cpp']
if CONFIG['OS_TARGET'] == 'WINNT':
DEFFILE = 'mozglue.def'
# We'll break the DLL blocklist if we immediately load user32.dll
- DELAYLOAD_DLLS += [
- 'user32.dll',
- ]
+ DELAYLOAD_DLLS += ['user32.dll']
if not CONFIG['JS_STANDALONE']:
@@ -38,21 +29,13 @@ if not CONFIG['JS_STANDALONE']:
else:
# Temporary, until bug 662814 lands
NO_VISIBILITY_FLAGS = True
- SOURCES += [
- 'dummy.cpp',
- ]
+ SOURCES += ['dummy.cpp']
if CONFIG['OS_TARGET'] == 'WINNT':
- LOCAL_INCLUDES += [
- '/memory/build',
- ]
- SOURCES += [
- 'WindowsDllBlocklist.cpp',
- ]
+ LOCAL_INCLUDES += ['/memory/build']
+ SOURCES += ['WindowsDllBlocklist.cpp']
DISABLE_STL_WRAPPING = True
- OS_LIBS += [
- 'version',
- ]
+ OS_LIBS += ['version']
EXPORTS.mozilla += [
'arm.h',
@@ -62,28 +45,18 @@ if not CONFIG['JS_STANDALONE']:
]
if CONFIG['CPU_ARCH'].startswith('x86'):
- SOURCES += [
- 'SSE.cpp',
- ]
+ SOURCES += ['SSE.cpp']
if CONFIG['CPU_ARCH'] == 'arm':
- SOURCES += [
- 'arm.cpp',
- ]
+ SOURCES += ['arm.cpp']
if CONFIG['CPU_ARCH'].startswith('mips'):
- SOURCES += [
- 'mips.cpp',
- ]
+ SOURCES += ['mips.cpp']
if CONFIG['MOZ_LINKER']:
- USE_LIBS += [
- 'zlib',
- ]
+ USE_LIBS += ['zlib']
-USE_LIBS += [
- 'mfbt',
-]
+USE_LIBS += ['mfbt']
DEFINES['IMPL_MFBT'] = True
LIBRARY_DEFINES['MOZ_HAS_MOZGLUE'] = True
diff --git a/mozglue/linker/CustomElf.cpp b/mozglue/linker/CustomElf.cpp
index dbab0cf0d..98d94fa8f 100644
--- a/mozglue/linker/CustomElf.cpp
+++ b/mozglue/linker/CustomElf.cpp
@@ -20,15 +20,8 @@ using namespace mozilla;
/* Function used to report library mappings from the custom linker to Gecko
* crash reporter */
-#ifdef ANDROID
-extern "C" {
- void report_mapping(char *name, void *base, uint32_t len, uint32_t offset);
- void delete_mapping(const char *name);
-}
-#else
#define report_mapping(...)
#define delete_mapping(...)
-#endif
const Ehdr *Ehdr::validate(const void *buf)
{
@@ -162,13 +155,10 @@ CustomElf::Load(Mappable *mappable, const char *path, int flags)
break;
case PT_GNU_STACK:
debug_phdr("PT_GNU_STACK", phdr);
-// Skip on Android until bug 706116 is fixed
-#ifndef ANDROID
if (phdr->p_flags & PF_X) {
ERROR("%s: Executable stack is not supported", elf->GetPath());
return nullptr;
}
-#endif
break;
#ifdef __ARM_EABI__
case PT_ARM_EXIDX:
diff --git a/mozglue/linker/ElfLoader.cpp b/mozglue/linker/ElfLoader.cpp
index 76225d1e7..dd3d7daa8 100644
--- a/mozglue/linker/ElfLoader.cpp
+++ b/mozglue/linker/ElfLoader.cpp
@@ -18,23 +18,6 @@
#include "Logging.h"
#include <inttypes.h>
-#if defined(ANDROID)
-#include <sys/syscall.h>
-
-#include <android/api-level.h>
-#if __ANDROID_API__ < 8
-/* Android API < 8 doesn't provide sigaltstack */
-
-extern "C" {
-
-inline int sigaltstack(const stack_t *ss, stack_t *oss) {
- return syscall(__NR_sigaltstack, ss, oss);
-}
-
-} /* extern "C" */
-#endif /* __ANDROID_API__ */
-#endif /* ANDROID */
-
#ifdef __ARM_EABI__
extern "C" MOZ_EXPORT const void *
__gnu_Unwind_Find_exidx(void *pc, int *pcount) __attribute__((weak));
@@ -348,16 +331,6 @@ SystemElf::GetMappable() const
const char *path = GetPath();
if (!path)
return nullptr;
-#ifdef ANDROID
- /* On Android, if we don't have the full path, try in /system/lib */
- const char *name = LeafName(path);
- std::string systemPath;
- if (name == path) {
- systemPath = "/system/lib/";
- systemPath += path;
- path = systemPath.c_str();
- }
-#endif
return MappableFile::Create(path);
}
@@ -550,17 +523,9 @@ void
ElfLoader::Init()
{
Dl_info info;
- /* On Android < 4.1 can't reenter dl* functions. So when the library
- * containing this code is dlopen()ed, it can't call dladdr from a
- * static initializer. */
if (dladdr(_DYNAMIC, &info) != 0) {
self_elf = LoadedElf::Create(info.dli_fname, info.dli_fbase);
}
-#if defined(ANDROID)
- if (dladdr(FunctionPtr(syscall), &info) != 0) {
- libc = LoadedElf::Create(info.dli_fname, info.dli_fbase);
- }
-#endif
}
ElfLoader::~ElfLoader()
@@ -573,9 +538,6 @@ ElfLoader::~ElfLoader()
/* Release self_elf and libc */
self_elf = nullptr;
-#if defined(ANDROID)
- libc = nullptr;
-#endif
/* Build up a list of all library handles with direct (external) references.
* We actually skip system library handles because we want to keep at least
@@ -962,88 +924,6 @@ ElfLoader::DebuggerHelper::Remove(ElfLoader::link_map *map)
dbg->r_brk();
}
-#if defined(ANDROID)
-/* As some system libraries may be calling signal() or sigaction() to
- * set a SIGSEGV handler, effectively breaking MappableSeekableZStream,
- * or worse, restore our SIGSEGV handler with wrong flags (which using
- * signal() will do), we want to hook into the system's sigaction() to
- * replace it with our own wrapper instead, so that our handler is never
- * replaced. We used to only do that with libraries this linker loads,
- * but it turns out at least one system library does call signal() and
- * breaks us (libsc-a3xx.so on the Samsung Galaxy S4).
- * As libc's signal (bsd_signal/sysv_signal, really) calls sigaction
- * under the hood, instead of calling the signal system call directly,
- * we only need to hook sigaction. This is true for both bionic and
- * glibc.
- */
-
-/* libc's sigaction */
-extern "C" int
-sigaction(int signum, const struct sigaction *act,
- struct sigaction *oldact);
-
-/* Simple reimplementation of sigaction. This is roughly equivalent
- * to the assembly that comes in bionic, but not quite equivalent to
- * glibc's implementation, so we only use this on Android. */
-int
-sys_sigaction(int signum, const struct sigaction *act,
- struct sigaction *oldact)
-{
- return syscall(__NR_sigaction, signum, act, oldact);
-}
-
-/* Replace the first instructions of the given function with a jump
- * to the given new function. */
-template <typename T>
-static bool
-Divert(T func, T new_func)
-{
- void *ptr = FunctionPtr(func);
- uintptr_t addr = reinterpret_cast<uintptr_t>(ptr);
-
-#if defined(__i386__)
- // A 32-bit jump is a 5 bytes instruction.
- EnsureWritable w(ptr, 5);
- *reinterpret_cast<unsigned char *>(addr) = 0xe9; // jmp
- *reinterpret_cast<intptr_t *>(addr + 1) =
- reinterpret_cast<uintptr_t>(new_func) - addr - 5; // target displacement
- return true;
-#elif defined(__arm__)
- const unsigned char trampoline[] = {
- // .thumb
- 0x46, 0x04, // nop
- 0x78, 0x47, // bx pc
- 0x46, 0x04, // nop
- // .arm
- 0x04, 0xf0, 0x1f, 0xe5, // ldr pc, [pc, #-4]
- // .word <new_func>
- };
- const unsigned char *start;
- if (addr & 0x01) {
- /* Function is thumb, the actual address of the code is without the
- * least significant bit. */
- addr--;
- /* The arm part of the trampoline needs to be 32-bit aligned */
- if (addr & 0x02)
- start = trampoline;
- else
- start = trampoline + 2;
- } else {
- /* Function is arm, we only need the arm part of the trampoline */
- start = trampoline + 6;
- }
-
- size_t len = sizeof(trampoline) - (start - trampoline);
- EnsureWritable w(reinterpret_cast<void *>(addr), len + sizeof(void *));
- memcpy(reinterpret_cast<void *>(addr), start, len);
- *reinterpret_cast<void **>(addr + len) = FunctionPtr(new_func);
- cacheflush(addr, addr + len + sizeof(void *), 0);
- return true;
-#else
- return false;
-#endif
-}
-#else
#define sys_sigaction sigaction
template <typename T>
static bool
@@ -1051,7 +931,7 @@ Divert(T func, T new_func)
{
return false;
}
-#endif
+
namespace {
@@ -1144,48 +1024,6 @@ SEGVHandler::FinishInitialization()
sigaction_func libc_sigaction;
-#if defined(ANDROID)
- /* Android > 4.4 comes with a sigaction wrapper in a LD_PRELOADed library
- * (libsigchain) for ART. That wrapper kind of does the same trick as we
- * do, so we need extra care in handling it.
- * - Divert the libc's sigaction, assuming the LD_PRELOADed library uses
- * it under the hood (which is more or less true according to the source
- * of that library, since it's doing a lookup in RTLD_NEXT)
- * - With the LD_PRELOADed library in place, all calls to sigaction from
- * from system libraries will go to the LD_PRELOADed library.
- * - The LD_PRELOADed library calls to sigaction go to our __wrap_sigaction.
- * - The calls to sigaction from libraries faulty.lib loads are sent to
- * the LD_PRELOADed library.
- * In practice, for signal handling, this means:
- * - The signal handler registered to the kernel is ours.
- * - Our handler redispatches to the LD_PRELOADed library's if there's a
- * segfault we don't handle.
- * - The LD_PRELOADed library redispatches according to whatever system
- * library or faulty.lib-loaded library set with sigaction.
- *
- * When there is no sigaction wrapper in place:
- * - Divert the libc's sigaction.
- * - Calls to sigaction from system library and faulty.lib-loaded libraries
- * all go to the libc's sigaction, which end up in our __wrap_sigaction.
- * - The signal handler registered to the kernel is ours.
- * - Our handler redispatches according to whatever system library or
- * faulty.lib-loaded library set with sigaction.
- */
- void *libc = dlopen("libc.so", RTLD_GLOBAL | RTLD_LAZY);
- if (libc) {
- /*
- * Lollipop bionic only has a small trampoline in sigaction, with the real
- * work happening in __sigaction. Divert there instead of sigaction if it exists.
- * Bug 1154803
- */
- libc_sigaction = reinterpret_cast<sigaction_func>(dlsym(libc, "__sigaction"));
-
- if (!libc_sigaction) {
- libc_sigaction =
- reinterpret_cast<sigaction_func>(dlsym(libc, "sigaction"));
- }
- } else
-#endif
{
libc_sigaction = sigaction;
}
diff --git a/mozglue/linker/ElfLoader.h b/mozglue/linker/ElfLoader.h
index 0d26a011e..033805460 100644
--- a/mozglue/linker/ElfLoader.h
+++ b/mozglue/linker/ElfLoader.h
@@ -471,14 +471,6 @@ private:
* is used to resolve wrapped functions. */
RefPtr<LibHandle> self_elf;
-#if defined(ANDROID)
- /* System loader handle for the libc. This is used to resolve weak symbols
- * that some libcs contain that the Android linker won't dlsym(). Normally,
- * we wouldn't treat non-Android differently, but glibc uses versioned
- * symbols which this linker doesn't support. */
- RefPtr<LibHandle> libc;
-#endif
-
/* Bookkeeping */
typedef std::vector<LibHandle *> LibHandleList;
LibHandleList handles;
diff --git a/mozglue/linker/Elfxx.h b/mozglue/linker/Elfxx.h
index b21a89336..33aa14ca4 100644
--- a/mozglue/linker/Elfxx.h
+++ b/mozglue/linker/Elfxx.h
@@ -5,15 +5,7 @@
#ifndef Elfxx_h
#define Elfxx_h
-/**
- * Android system headers have two different elf.h file. The one under linux/
- * is the most complete on older android API versions.
- */
-#if defined(ANDROID) && __ANDROID_API__ < 21
-#include <linux/elf.h>
-#else
#include <elf.h>
-#endif
#include <endian.h>
#if defined(__ARM_EABI__) && !defined(PT_ARM_EXIDX)
diff --git a/mozglue/linker/Logging.h b/mozglue/linker/Logging.h
index 046d918f4..ec0a2b32b 100644
--- a/mozglue/linker/Logging.h
+++ b/mozglue/linker/Logging.h
@@ -7,41 +7,6 @@
#include "mozilla/Likely.h"
-#ifdef ANDROID
-#include <android/log.h>
-#define LOG(...) __android_log_print(ANDROID_LOG_INFO, "GeckoLinker", __VA_ARGS__)
-#define WARN(...) __android_log_print(ANDROID_LOG_WARN, "GeckoLinker", __VA_ARGS__)
-#define ERROR(...) __android_log_print(ANDROID_LOG_ERROR, "GeckoLinker", __VA_ARGS__)
-#else
-#include <cstdio>
-
-/* Expand to 1 or m depending on whether there is one argument or more
- * given. */
-#define MOZ_ONE_OR_MORE_ARGS_IMPL2(_1, _2, _3, _4, _5, _6, _7, _8, _9, N, ...) \
- N
-#define MOZ_ONE_OR_MORE_ARGS_IMPL(args) MOZ_ONE_OR_MORE_ARGS_IMPL2 args
-#define MOZ_ONE_OR_MORE_ARGS(...) \
- MOZ_ONE_OR_MORE_ARGS_IMPL((__VA_ARGS__, m, m, m, m, m, m, m, m, 1, 0))
-
-#define MOZ_MACRO_GLUE(a, b) a b
-#define MOZ_CONCAT2(a, b) a ## b
-#define MOZ_CONCAT1(a, b) MOZ_CONCAT2(a, b)
-#define MOZ_CONCAT(a, b) MOZ_CONCAT1(a, b)
-
-/* Some magic to choose between LOG1 and LOGm depending on the number of
- * arguments */
-#define MOZ_CHOOSE_LOG(...) \
- MOZ_MACRO_GLUE(MOZ_CONCAT(LOG, MOZ_ONE_OR_MORE_ARGS(__VA_ARGS__)), \
- (__VA_ARGS__))
-
-#define LOG1(format) fprintf(stderr, format "\n")
-#define LOGm(format, ...) fprintf(stderr, format "\n", __VA_ARGS__)
-#define LOG(...) MOZ_CHOOSE_LOG(__VA_ARGS__)
-#define WARN(...) MOZ_CHOOSE_LOG("Warning: " __VA_ARGS__)
-#define ERROR(...) MOZ_CHOOSE_LOG("Error: " __VA_ARGS__)
-
-#endif
-
class Logging
{
public:
diff --git a/mozglue/linker/Mappable.cpp b/mozglue/linker/Mappable.cpp
index 47b883d2d..1243a9e6e 100644
--- a/mozglue/linker/Mappable.cpp
+++ b/mozglue/linker/Mappable.cpp
@@ -15,9 +15,6 @@
#include "mozilla/UniquePtr.h"
-#ifdef ANDROID
-#include <linux/ashmem.h>
-#endif
#include <sys/stat.h>
#include <errno.h>
#include "ElfLoader.h"
@@ -263,7 +260,6 @@ MappableExtractFile::Create(const char *name, Zip *zip, Zip::Stream *stream)
* _MappableBuffer is a buffer which content can be mapped at different
* locations in the virtual address space.
* On Linux, uses a (deleted) temporary file on a tmpfs for sharable content.
- * On Android, uses ashmem.
*/
class _MappableBuffer: public MappedPtr
{
@@ -275,57 +271,7 @@ public:
static _MappableBuffer *Create(const char *name, size_t length)
{
AutoCloseFD fd;
-#ifdef ANDROID
- /* On Android, initialize an ashmem region with the given length */
- fd = open("/" ASHMEM_NAME_DEF, O_RDWR, 0600);
- if (fd == -1)
- return nullptr;
- char str[ASHMEM_NAME_LEN];
- strlcpy(str, name, sizeof(str));
- ioctl(fd, ASHMEM_SET_NAME, str);
- if (ioctl(fd, ASHMEM_SET_SIZE, length))
- return nullptr;
- /* The Gecko crash reporter is confused by adjacent memory mappings of
- * the same file and chances are we're going to map from the same file
- * descriptor right away. To avoid problems with the crash reporter,
- * create an empty anonymous page before or after the ashmem mapping,
- * depending on how mappings grow in the address space.
- */
-#if defined(__arm__)
- void *buf = ::mmap(nullptr, length + PAGE_SIZE, PROT_READ | PROT_WRITE,
- MAP_SHARED, fd, 0);
- if (buf != MAP_FAILED) {
- ::mmap(AlignedEndPtr(reinterpret_cast<char *>(buf) + length, PAGE_SIZE),
- PAGE_SIZE, PROT_NONE, MAP_FIXED | MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- DEBUG_LOG("Decompression buffer of size 0x%x in ashmem \"%s\", mapped @%p",
- length, str, buf);
- return new _MappableBuffer(fd.forget(), buf, length);
- }
-#elif defined(__i386__)
- size_t anon_mapping_length = length + PAGE_SIZE;
- void *buf = ::mmap(nullptr, anon_mapping_length, PROT_NONE,
- MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
- if (buf != MAP_FAILED) {
- char *first_page = reinterpret_cast<char *>(buf);
- char *map_page = first_page + PAGE_SIZE;
-
- void *actual_buf = ::mmap(map_page, length, PROT_READ | PROT_WRITE,
- MAP_FIXED | MAP_SHARED, fd, 0);
- if (actual_buf == MAP_FAILED) {
- ::munmap(buf, anon_mapping_length);
- DEBUG_LOG("Fixed allocation of decompression buffer at %p failed", map_page);
- return nullptr;
- }
-
- DEBUG_LOG("Decompression buffer of size 0x%x in ashmem \"%s\", mapped @%p",
- length, str, actual_buf);
- return new _MappableBuffer(fd.forget(), actual_buf, length);
- }
-#else
-#error need to add a case for your CPU
-#endif
-#else
/* On Linux, use /dev/shm as base directory for temporary files, assuming
* it's on tmpfs */
/* TODO: check that /dev/shm is tmpfs */
@@ -344,37 +290,16 @@ public:
length, path, buf);
return new _MappableBuffer(fd.forget(), buf, length);
}
-#endif
+
return nullptr;
}
void *mmap(const void *addr, size_t length, int prot, int flags, off_t offset)
{
MOZ_ASSERT(fd != -1);
-#ifdef ANDROID
- /* Mapping ashmem MAP_PRIVATE is like mapping anonymous memory, even when
- * there is content in the ashmem */
- if (flags & MAP_PRIVATE) {
- flags &= ~MAP_PRIVATE;
- flags |= MAP_SHARED;
- }
-#endif
return ::mmap(const_cast<void *>(addr), length, prot, flags, fd, offset);
}
-#ifdef ANDROID
- ~_MappableBuffer() {
- /* Free the additional page we allocated. See _MappableBuffer::Create */
-#if defined(__arm__)
- ::munmap(AlignedEndPtr(*this + GetLength(), PAGE_SIZE), PAGE_SIZE);
-#elif defined(__i386__)
- ::munmap(*this - PAGE_SIZE, GetLength() + PAGE_SIZE);
-#else
-#error need to add a case for your CPU
-#endif
- }
-#endif
-
private:
_MappableBuffer(int fd, void *buf, size_t length)
: MappedPtr(buf, length), fd(fd) { }
@@ -440,15 +365,6 @@ MappableDeflate::mmap(const void *addr, size_t length, int prot, int flags, off_
}
}
}
-#if defined(ANDROID) && defined(__arm__)
- if (prot & PROT_EXEC) {
- /* We just extracted data that may be executed in the future.
- * We thus need to ensure Instruction and Data cache coherency. */
- DEBUG_LOG("cacheflush(%p, %p)", *buffer + offset, *buffer + (offset + length));
- cacheflush(reinterpret_cast<uintptr_t>(*buffer + offset),
- reinterpret_cast<uintptr_t>(*buffer + (offset + length)), 0);
- }
-#endif
return MemoryRange(buffer->mmap(addr, length, prot, flags, offset), length);
}
@@ -611,15 +527,6 @@ MappableSeekableZStream::ensure(const void *addr)
if (!zStream.DecompressChunk(*buffer + chunkStart, chunk, length))
return false;
-#if defined(ANDROID) && defined(__arm__)
- if (map->prot & PROT_EXEC) {
- /* We just extracted data that may be executed in the future.
- * We thus need to ensure Instruction and Data cache coherency. */
- DEBUG_LOG("cacheflush(%p, %p)", *buffer + chunkStart, *buffer + (chunkStart + length));
- cacheflush(reinterpret_cast<uintptr_t>(*buffer + chunkStart),
- reinterpret_cast<uintptr_t>(*buffer + (chunkStart + length)), 0);
- }
-#endif
/* Only count if we haven't already decompressed parts of the chunk */
if (chunkAvail[chunk] == 0)
chunkAvailNum++;
diff --git a/mozglue/misc/StackWalk.cpp b/mozglue/misc/StackWalk.cpp
index bb23b922a..9d0df08f2 100644
--- a/mozglue/misc/StackWalk.cpp
+++ b/mozglue/misc/StackWalk.cpp
@@ -59,12 +59,6 @@ static CriticalAddress gCriticalAddress;
extern MOZ_EXPORT void* __libc_stack_end; // from ld-linux.so
#endif
-#ifdef ANDROID
-#include <algorithm>
-#include <unistd.h>
-#include <pthread.h>
-#endif
-
#if MOZ_STACKWALK_SUPPORTS_MACOSX
#include <pthread.h>
#include <sys/errno.h>
@@ -931,31 +925,6 @@ MozStackWalk(MozWalkStackCallback aCallback, uint32_t aSkipFrames,
stackEnd = __libc_stack_end;
#elif defined(XP_DARWIN)
stackEnd = pthread_get_stackaddr_np(pthread_self());
-#elif defined(ANDROID)
- pthread_attr_t sattr;
- pthread_attr_init(&sattr);
- pthread_getattr_np(pthread_self(), &sattr);
- void* stackBase = stackEnd = nullptr;
- size_t stackSize = 0;
- if (gettid() != getpid()) {
- // bionic's pthread_attr_getstack doesn't tell the truth for the main
- // thread (see bug 846670). So don't use it for the main thread.
- if (!pthread_attr_getstack(&sattr, &stackBase, &stackSize)) {
- stackEnd = static_cast<char*>(stackBase) + stackSize;
- } else {
- stackEnd = nullptr;
- }
- }
- if (!stackEnd) {
- // So consider the current frame pointer + an arbitrary size of 8MB
- // (modulo overflow ; not really arbitrary as it's the default stack
- // size for the main thread) if pthread_attr_getstack failed for
- // some reason (or was skipped).
- static const uintptr_t kMaxStackSize = 8 * 1024 * 1024;
- uintptr_t maxStackStart = uintptr_t(-1) - kMaxStackSize;
- uintptr_t stackStart = std::max(maxStackStart, uintptr_t(bp));
- stackEnd = reinterpret_cast<void*>(stackStart + kMaxStackSize);
- }
#else
# error Unsupported configuration
#endif
diff --git a/mozglue/misc/TimeStamp_posix.cpp b/mozglue/misc/TimeStamp_posix.cpp
index 05deddea4..d6dfb4053 100644
--- a/mozglue/misc/TimeStamp_posix.cpp
+++ b/mozglue/misc/TimeStamp_posix.cpp
@@ -206,7 +206,7 @@ TimeStamp::Now(bool aHighResolution)
return TimeStamp(ClockTimeNs());
}
-#if defined(XP_LINUX) || defined(ANDROID)
+#ifdef XP_LINUX
// Calculates the amount of jiffies that have elapsed since boot and up to the
// starttime value of a specific process as found in its /proc/*/stat file.
diff --git a/mozglue/moz.build b/mozglue/moz.build
index a951d6427..6ad49f4df 100644
--- a/mozglue/moz.build
+++ b/mozglue/moz.build
@@ -7,9 +7,6 @@
if CONFIG['MOZ_LINKER']:
DIRS += ['linker']
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- DIRS += ['android']
-
DIRS += [
'build',
'misc',
diff --git a/netwerk/base/Tickler.h b/netwerk/base/Tickler.h
index 63353a924..e38f0d99c 100644
--- a/netwerk/base/Tickler.h
+++ b/netwerk/base/Tickler.h
@@ -27,10 +27,6 @@
// The tickler only applies to wifi on mobile right now. Hopefully it
// can also be restricted to particular handset models in the future.
-#if defined(ANDROID)
-#define MOZ_USE_WIFI_TICKLER
-#endif
-
#include "mozilla/Attributes.h"
#include "nsISupports.h"
#include <stdint.h>
diff --git a/netwerk/base/nsIOService.cpp b/netwerk/base/nsIOService.cpp
index bd9a4a96f..314f2aeff 100644
--- a/netwerk/base/nsIOService.cpp
+++ b/netwerk/base/nsIOService.cpp
@@ -79,6 +79,7 @@ namespace net {
nsIOService* gIOService = nullptr;
static bool gHasWarnedUploadChannel2;
+static bool gCaptivePortalEnabled = false;
static LazyLogModule gIOServiceLog("nsIOService");
#undef LOG
#define LOG(args) MOZ_LOG(gIOServiceLog, LogLevel::Debug, args)
@@ -1142,7 +1143,7 @@ nsIOService::SetConnectivityInternal(bool aConnectivity)
mConnectivity = aConnectivity;
if (mCaptivePortalService) {
- if (aConnectivity && !xpc::AreNonLocalConnectionsDisabled()) {
+ if (aConnectivity && !xpc::AreNonLocalConnectionsDisabled() && gCaptivePortalEnabled) {
// This will also trigger a captive portal check for the new network
static_cast<CaptivePortalService*>(mCaptivePortalService.get())->Start();
} else {
@@ -1285,10 +1286,9 @@ nsIOService::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
}
if (!pref || strcmp(pref, NETWORK_CAPTIVE_PORTAL_PREF) == 0) {
- bool captivePortalEnabled;
- nsresult rv = prefs->GetBoolPref(NETWORK_CAPTIVE_PORTAL_PREF, &captivePortalEnabled);
+ nsresult rv = prefs->GetBoolPref(NETWORK_CAPTIVE_PORTAL_PREF, &gCaptivePortalEnabled);
if (NS_SUCCEEDED(rv) && mCaptivePortalService) {
- if (captivePortalEnabled && !xpc::AreNonLocalConnectionsDisabled()) {
+ if (gCaptivePortalEnabled && !xpc::AreNonLocalConnectionsDisabled()) {
static_cast<CaptivePortalService*>(mCaptivePortalService.get())->Start();
} else {
static_cast<CaptivePortalService*>(mCaptivePortalService.get())->Stop();
diff --git a/netwerk/base/nsNetUtil.cpp b/netwerk/base/nsNetUtil.cpp
index 2974e26b0..ce0e2d4ef 100644
--- a/netwerk/base/nsNetUtil.cpp
+++ b/netwerk/base/nsNetUtil.cpp
@@ -1814,9 +1814,7 @@ NS_RelaxStrictFileOriginPolicy(nsIURI *aTargetURI,
NS_FAILED(sourceFileURL->GetFile(getter_AddRefs(sourceFile))) ||
!targetFile || !sourceFile ||
NS_FAILED(targetFile->Normalize()) ||
-#ifndef MOZ_WIDGET_ANDROID
NS_FAILED(sourceFile->Normalize()) ||
-#endif
(!aAllowDirectoryTarget &&
(NS_FAILED(targetFile->IsDirectory(&targetIsDir)) || targetIsDir))) {
return false;
diff --git a/netwerk/base/nsSocketTransport2.cpp b/netwerk/base/nsSocketTransport2.cpp
index 0c8434813..76a357aa3 100644
--- a/netwerk/base/nsSocketTransport2.cpp
+++ b/netwerk/base/nsSocketTransport2.cpp
@@ -3048,9 +3048,8 @@ nsSocketTransport::PRFileDescAutoLock::SetKeepaliveVals(bool aEnabled,
#elif defined(XP_UNIX)
// Not all *nix OSes support the following setsockopt() options
- // ... but we assume they are supported in the Android kernel;
// build errors will tell us if they are not.
-#if defined(ANDROID) || defined(TCP_KEEPIDLE)
+#ifdef TCP_KEEPIDLE
// Idle time until first keepalive probe; interval between ack'd probes; seconds.
int err = setsockopt(sock, IPPROTO_TCP, TCP_KEEPIDLE,
&aIdleTime, sizeof(aIdleTime));
@@ -3061,7 +3060,7 @@ nsSocketTransport::PRFileDescAutoLock::SetKeepaliveVals(bool aEnabled,
}
#endif
-#if defined(ANDROID) || defined(TCP_KEEPINTVL)
+#ifdef TCP_KEEPINTVL
// Interval between unack'd keepalive probes; seconds.
err = setsockopt(sock, IPPROTO_TCP, TCP_KEEPINTVL,
&aRetryInterval, sizeof(aRetryInterval));
@@ -3072,7 +3071,7 @@ nsSocketTransport::PRFileDescAutoLock::SetKeepaliveVals(bool aEnabled,
}
#endif
-#if defined(ANDROID) || defined(TCP_KEEPCNT)
+#ifdef TCP_KEEPCNT
// Number of unack'd keepalive probes before connection times out.
err = setsockopt(sock, IPPROTO_TCP, TCP_KEEPCNT,
&aProbeCount, sizeof(aProbeCount));
diff --git a/netwerk/base/nsSocketTransportService2.cpp b/netwerk/base/nsSocketTransportService2.cpp
index af5742564..4a8d80eed 100644
--- a/netwerk/base/nsSocketTransportService2.cpp
+++ b/netwerk/base/nsSocketTransportService2.cpp
@@ -25,7 +25,6 @@
#include "nsThreadUtils.h"
#include "nsIFile.h"
#include "nsIWidget.h"
-#include "mozilla/dom/FlyWebService.h"
namespace mozilla {
namespace net {
@@ -681,20 +680,6 @@ nsSocketTransportService::CreateRoutedTransport(const char **types,
nsIProxyInfo *proxyInfo,
nsISocketTransport **result)
{
- // Check FlyWeb table for host mappings. If one exists, then use that.
- RefPtr<mozilla::dom::FlyWebService> fws =
- mozilla::dom::FlyWebService::GetExisting();
- if (fws) {
- nsresult rv = fws->CreateTransportForHost(types, typeCount, host, port,
- hostRoute, portRoute,
- proxyInfo, result);
- NS_ENSURE_SUCCESS(rv, rv);
-
- if (*result) {
- return NS_OK;
- }
- }
-
NS_ENSURE_TRUE(mInitialized, NS_ERROR_NOT_INITIALIZED);
NS_ENSURE_TRUE(port >= 0 && port <= 0xFFFF, NS_ERROR_ILLEGAL_VALUE);
diff --git a/netwerk/base/security-prefs.js b/netwerk/base/security-prefs.js
index 702315d43..973c73123 100644
--- a/netwerk/base/security-prefs.js
+++ b/netwerk/base/security-prefs.js
@@ -120,27 +120,6 @@ pref("security.webauth.u2f_enable_usbtoken", false);
// OCSP must-staple
pref("security.ssl.enable_ocsp_must_staple", true);
-// HPKP settings
-
-// Enable pinning checks by default.
-pref("security.cert_pinning.enforcement_level", 2);
-// Do not process hpkp headers rooted by not built in roots by default.
-// This is to prevent accidental pinning from MITM devices and is used
-// for tests.
-pref("security.cert_pinning.process_headers_from_non_builtin_roots", false);
-// Impose a maximum age on HPKP headers, to avoid sites getting permanently
-// blacking themselves out by setting a bad pin. (60 days by default)
-// https://tools.ietf.org/html/rfc7469#section-4.1
-pref("security.cert_pinning.max_max_age_seconds", 5184000);
-// Controls whether or not HPKP (the HTTP Public Key Pinning header) is enabled.
-// If true, the header is processed and collected HPKP information is consulted
-// when looking for pinning information.
-// If false, the header is not processed and collected HPKP information is not
-// consulted when looking for pinning information. Preloaded pins are not
-// affected by this preference.
-// Default: false
-pref("security.cert_pinning.hpkp.enabled", false);
-
// If a request is mixed-content, send an HSTS priming request to attempt to
// see if it is available over HTTPS.
pref("security.mixed_content.send_hsts_priming", true);
diff --git a/netwerk/build/moz.build b/netwerk/build/moz.build
index 6cb47f99e..db2c4cada 100644
--- a/netwerk/build/moz.build
+++ b/netwerk/build/moz.build
@@ -42,11 +42,6 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
'/netwerk/system/mac',
]
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- LOCAL_INCLUDES += [
- '/netwerk/system/android',
- ]
-
elif CONFIG['OS_ARCH'] == 'Linux':
LOCAL_INCLUDES += [
'/netwerk/system/linux',
diff --git a/netwerk/build/nsNetModule.cpp b/netwerk/build/nsNetModule.cpp
index d244a14f1..88bdff548 100644
--- a/netwerk/build/nsNetModule.cpp
+++ b/netwerk/build/nsNetModule.cpp
@@ -418,9 +418,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNotifyAddrListener, Init)
#elif defined(MOZ_WIDGET_COCOA)
#include "nsNetworkLinkService.h"
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNetworkLinkService, Init)
-#elif defined(MOZ_WIDGET_ANDROID)
-#include "nsAndroidNetworkLinkService.h"
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsAndroidNetworkLinkService)
#elif defined(XP_LINUX)
#include "nsNotifyAddrListener_Linux.h"
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsNotifyAddrListener, Init)
@@ -852,8 +849,6 @@ NS_DEFINE_NAMED_CID(NS_RTSPPROTOCOLHANDLER_CID);
NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
#elif defined(MOZ_WIDGET_COCOA)
NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
-#elif defined(MOZ_WIDGET_ANDROID)
-NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
#elif defined(XP_LINUX)
NS_DEFINE_NAMED_CID(NS_NETWORK_LINK_SERVICE_CID);
#endif
@@ -1003,8 +998,6 @@ static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
{ &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNotifyAddrListenerConstructor },
#elif defined(MOZ_WIDGET_COCOA)
{ &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNetworkLinkServiceConstructor },
-#elif defined(MOZ_WIDGET_ANDROID)
- { &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsAndroidNetworkLinkServiceConstructor },
#elif defined(XP_LINUX)
{ &kNS_NETWORK_LINK_SERVICE_CID, false, nullptr, nsNotifyAddrListenerConstructor },
#endif
@@ -1158,8 +1151,6 @@ static const mozilla::Module::ContractIDEntry kNeckoContracts[] = {
{ NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
#elif defined(MOZ_WIDGET_COCOA)
{ NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
-#elif defined(MOZ_WIDGET_ANDROID)
- { NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
#elif defined(XP_LINUX)
{ NS_NETWORK_LINK_SERVICE_CONTRACTID, &kNS_NETWORK_LINK_SERVICE_CID },
#endif
diff --git a/netwerk/cache/nsCacheService.cpp b/netwerk/cache/nsCacheService.cpp
index 4b08614b8..b2d488ea6 100644
--- a/netwerk/cache/nsCacheService.cpp
+++ b/netwerk/cache/nsCacheService.cpp
@@ -107,13 +107,9 @@ static const char * prefList[] = {
// Cache sizes, in KB
const int32_t DEFAULT_CACHE_SIZE = 250 * 1024; // 250 MB
-#ifdef ANDROID
-const int32_t MAX_CACHE_SIZE = 200 * 1024; // 200 MB
-const int32_t OLD_MAX_CACHE_SIZE = 200 * 1024; // 200 MB
-#else
const int32_t MAX_CACHE_SIZE = 350 * 1024; // 350 MB
const int32_t OLD_MAX_CACHE_SIZE = 1024 * 1024; // 1 GB
-#endif
+
// Default cache size was 50 MB for many years until FF 4:
const int32_t PRE_GECKO_2_0_DEFAULT_CACHE_SIZE = 50 * 1024;
@@ -593,17 +589,8 @@ SmartCacheSize(const uint32_t availKB, bool shouldUseOldMaxSmartSize)
avail10MBs = 50;
}
-#ifdef ANDROID
- // On Android, smaller/older devices may have very little storage and
- // device owners may be sensitive to storage footprint: Use a smaller
- // percentage of available space and a smaller minimum.
-
- // 20% of space up to 500 MB (10 MB min)
- sz10MBs += std::max<uint32_t>(1, static_cast<uint32_t>(avail10MBs * .2));
-#else
// 40% of space up to 500 MB (50 MB min)
sz10MBs += std::max<uint32_t>(5, static_cast<uint32_t>(avail10MBs * .4));
-#endif
return std::min<uint32_t>(maxSize, sz10MBs * 10 * 1024);
}
diff --git a/netwerk/cache/nsDeleteDir.cpp b/netwerk/cache/nsDeleteDir.cpp
index 8c4edf812..b081a12eb 100644
--- a/netwerk/cache/nsDeleteDir.cpp
+++ b/netwerk/cache/nsDeleteDir.cpp
@@ -235,18 +235,11 @@ nsDeleteDir::DeleteDir(nsIFile *dirIn, bool moveToTrash, uint32_t delay)
if (!leaf.Length())
return NS_ERROR_FAILURE;
-#if defined(MOZ_WIDGET_ANDROID)
- nsCOMPtr<nsIFile> parent;
- rv = trash->GetParent(getter_AddRefs(parent));
- if (NS_FAILED(rv))
- return rv;
- rv = dir->MoveToNative(parent, leaf);
-#else
// Important: must rename directory w/o changing parent directory: else on
// NTFS we'll wait (with cache lock) while nsIFile's ACL reset walks file
// tree: was hanging GUI for *minutes* on large cache dirs.
rv = dir->MoveToNative(nullptr, leaf);
-#endif
+
if (NS_FAILED(rv))
return rv;
} else {
@@ -269,21 +262,6 @@ nsresult
nsDeleteDir::GetTrashDir(nsIFile *target, nsCOMPtr<nsIFile> *result)
{
nsresult rv;
-#if defined(MOZ_WIDGET_ANDROID)
- // Try to use the app cache folder for cache trash on Android
- char* cachePath = getenv("CACHE_DIRECTORY");
- if (cachePath) {
- rv = NS_NewNativeLocalFile(nsDependentCString(cachePath),
- true, getter_AddRefs(*result));
- if (NS_FAILED(rv))
- return rv;
-
- // Add a sub folder with the cache folder name
- nsAutoCString leaf;
- rv = target->GetNativeLeafName(leaf);
- (*result)->AppendNative(leaf);
- } else
-#endif
{
rv = target->Clone(getter_AddRefs(*result));
}
@@ -318,11 +296,9 @@ nsDeleteDir::RemoveOldTrashes(nsIFile *cacheDir)
return rv;
nsCOMPtr<nsIFile> parent;
-#if defined(MOZ_WIDGET_ANDROID)
- rv = trash->GetParent(getter_AddRefs(parent));
-#else
+
rv = cacheDir->GetParent(getter_AddRefs(parent));
-#endif
+
if (NS_FAILED(rv))
return rv;
diff --git a/netwerk/cache2/CacheFileIOManager.cpp b/netwerk/cache2/CacheFileIOManager.cpp
index 25e621d12..845ad7314 100644
--- a/netwerk/cache2/CacheFileIOManager.cpp
+++ b/netwerk/cache2/CacheFileIOManager.cpp
@@ -49,11 +49,7 @@ namespace net {
#define kRemoveTrashStartDelay 60000 // in milliseconds
#define kSmartSizeUpdateInterval 60000 // in milliseconds
-#ifdef ANDROID
-const uint32_t kMaxCacheSizeKB = 200*1024; // 200 MB
-#else
const uint32_t kMaxCacheSizeKB = 350*1024; // 350 MB
-#endif
bool
CacheFileHandle::DispatchRelease()
@@ -1280,37 +1276,6 @@ CacheFileIOManager::OnProfile()
CacheObserver::ParentDirOverride(getter_AddRefs(directory));
-#if defined(MOZ_WIDGET_ANDROID)
- nsCOMPtr<nsIFile> profilelessDirectory;
- char* cachePath = getenv("CACHE_DIRECTORY");
- if (!directory && cachePath && *cachePath) {
- rv = NS_NewNativeLocalFile(nsDependentCString(cachePath),
- true, getter_AddRefs(directory));
- if (NS_SUCCEEDED(rv)) {
- // Save this directory as the profileless path.
- rv = directory->Clone(getter_AddRefs(profilelessDirectory));
- NS_ENSURE_SUCCESS(rv, rv);
-
- // Add profile leaf name to the directory name to distinguish
- // multiple profiles Fennec supports.
- nsCOMPtr<nsIFile> profD;
- rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
- getter_AddRefs(profD));
-
- nsAutoCString leafName;
- if (NS_SUCCEEDED(rv)) {
- rv = profD->GetNativeLeafName(leafName);
- }
- if (NS_SUCCEEDED(rv)) {
- rv = directory->AppendNative(leafName);
- }
- if (NS_FAILED(rv)) {
- directory = nullptr;
- }
- }
- }
-#endif
-
if (!directory) {
rv = NS_GetSpecialDirectory(NS_APP_CACHE_PARENT_DIR,
getter_AddRefs(directory));
@@ -1329,15 +1294,6 @@ CacheFileIOManager::OnProfile()
// All functions return a clone.
ioMan->mCacheDirectory.swap(directory);
-#if defined(MOZ_WIDGET_ANDROID)
- if (profilelessDirectory) {
- rv = profilelessDirectory->Append(NS_LITERAL_STRING("cache2"));
- NS_ENSURE_SUCCESS(rv, rv);
- }
-
- ioMan->mCacheProfilelessDirectory.swap(profilelessDirectory);
-#endif
-
if (ioMan->mCacheDirectory) {
CacheIndex::Init(ioMan->mCacheDirectory);
}
@@ -2391,23 +2347,6 @@ void CacheFileIOManager::GetCacheDirectory(nsIFile** result)
ioMan->mCacheDirectory->Clone(result);
}
-#if defined(MOZ_WIDGET_ANDROID)
-
-// static
-void CacheFileIOManager::GetProfilelessCacheDirectory(nsIFile** result)
-{
- *result = nullptr;
-
- RefPtr<CacheFileIOManager> ioMan = gInstance;
- if (!ioMan || !ioMan->mCacheProfilelessDirectory) {
- return;
- }
-
- ioMan->mCacheProfilelessDirectory->Clone(result);
-}
-
-#endif
-
// static
nsresult
CacheFileIOManager::GetEntryInfo(const SHA1Sum::Hash *aHash,
@@ -4019,17 +3958,8 @@ SmartCacheSize(const uint32_t availKB)
avail10MBs = 50;
}
-#ifdef ANDROID
- // On Android, smaller/older devices may have very little storage and
- // device owners may be sensitive to storage footprint: Use a smaller
- // percentage of available space and a smaller minimum.
-
- // 20% of space up to 500 MB (10 MB min)
- sz10MBs += std::max<uint32_t>(1, static_cast<uint32_t>(avail10MBs * .2));
-#else
// 40% of space up to 500 MB (50 MB min)
sz10MBs += std::max<uint32_t>(5, static_cast<uint32_t>(avail10MBs * .4));
-#endif
return std::min<uint32_t>(maxSize, sz10MBs * 10 * 1024);
}
diff --git a/netwerk/cache2/CacheFileIOManager.h b/netwerk/cache2/CacheFileIOManager.h
index 5ac812da5..8a51b5a0e 100644
--- a/netwerk/cache2/CacheFileIOManager.h
+++ b/netwerk/cache2/CacheFileIOManager.h
@@ -346,9 +346,6 @@ public:
};
static void GetCacheDirectory(nsIFile** result);
-#if defined(MOZ_WIDGET_ANDROID)
- static void GetProfilelessCacheDirectory(nsIFile** result);
-#endif
// Calls synchronously OnEntryInfo for an entry with the given hash.
// Tries to find an existing entry in the service hashtables first, if not
@@ -459,13 +456,6 @@ private:
bool mShuttingDown;
RefPtr<CacheIOThread> mIOThread;
nsCOMPtr<nsIFile> mCacheDirectory;
-#if defined(MOZ_WIDGET_ANDROID)
- // On Android we add the active profile directory name between the path
- // and the 'cache2' leaf name. However, to delete any leftover data from
- // times before we were doing it, we still need to access the directory
- // w/o the profile name in the path. Here it is stored.
- nsCOMPtr<nsIFile> mCacheProfilelessDirectory;
-#endif
bool mTreeCreated;
bool mTreeCreationFailed;
CacheFileHandles mHandles;
diff --git a/netwerk/cache2/CacheStorageService.cpp b/netwerk/cache2/CacheStorageService.cpp
index 3ee1e15cd..a27b082c4 100644
--- a/netwerk/cache2/CacheStorageService.cpp
+++ b/netwerk/cache2/CacheStorageService.cpp
@@ -569,17 +569,11 @@ private:
{
nsCacheService::GetDiskCacheDirectory(getter_AddRefs(mCache1Dir));
CacheFileIOManager::GetCacheDirectory(getter_AddRefs(mCache2Dir));
-#if defined(MOZ_WIDGET_ANDROID)
- CacheFileIOManager::GetProfilelessCacheDirectory(getter_AddRefs(mCache2Profileless));
-#endif
}
virtual ~CleaupCacheDirectoriesRunnable() {}
uint32_t mVersion, mActive;
nsCOMPtr<nsIFile> mCache1Dir, mCache2Dir;
-#if defined(MOZ_WIDGET_ANDROID)
- nsCOMPtr<nsIFile> mCache2Profileless;
-#endif
};
// static
@@ -613,13 +607,6 @@ NS_IMETHODIMP CleaupCacheDirectoriesRunnable::Run()
if (mCache2Dir) {
nsDeleteDir::RemoveOldTrashes(mCache2Dir);
}
-#if defined(MOZ_WIDGET_ANDROID)
- if (mCache2Profileless) {
- nsDeleteDir::RemoveOldTrashes(mCache2Profileless);
- // Always delete the profileless cache on Android
- nsDeleteDir::DeleteDir(mCache2Profileless, true, 30000);
- }
-#endif
// Delete the non-active version cache data right now
if (mVersion == mActive) {
diff --git a/netwerk/dns/mdns/libmdns/MulticastDNSAndroid.jsm b/netwerk/dns/mdns/libmdns/MulticastDNSAndroid.jsm
deleted file mode 100644
index 771f9a794..000000000
--- a/netwerk/dns/mdns/libmdns/MulticastDNSAndroid.jsm
+++ /dev/null
@@ -1,244 +0,0 @@
-// -*- Mode: js2; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["MulticastDNS"];
-
-const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/Messaging.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-var log = Cu.import("resource://gre/modules/AndroidLog.jsm", {}).AndroidLog.d.bind(null, "MulticastDNS");
-
-const FAILURE_INTERNAL_ERROR = -65537;
-
-// Helper function for sending commands to Java.
-function send(type, data, callback) {
- let msg = {
- type: type
- };
-
- for (let i in data) {
- try {
- msg[i] = data[i];
- } catch (e) {
- }
- }
-
- Messaging.sendRequestForResult(msg)
- .then(result => callback(result, null),
- err => callback(null, typeof err === "number" ? err : FAILURE_INTERNAL_ERROR));
-}
-
-// Receives service found/lost event from NsdManager
-function ServiceManager() {
-}
-
-ServiceManager.prototype = {
- listeners: {},
- numListeners: 0,
-
- registerEvent: function() {
- log("registerEvent");
- Messaging.addListener(this.onServiceFound.bind(this), "NsdManager:ServiceFound");
- Messaging.addListener(this.onServiceLost.bind(this), "NsdManager:ServiceLost");
- },
-
- unregisterEvent: function() {
- log("unregisterEvent");
- Messaging.removeListener("NsdManager:ServiceFound");
- Messaging.removeListener("NsdManager:ServiceLost");
- },
-
- addListener: function(aServiceType, aListener) {
- log("addListener: " + aServiceType + ", " + aListener);
-
- if (!this.listeners[aServiceType]) {
- this.listeners[aServiceType] = [];
- }
- if (this.listeners[aServiceType].includes(aListener)) {
- log("listener already exists");
- return;
- }
-
- this.listeners[aServiceType].push(aListener);
- ++this.numListeners;
-
- if (this.numListeners === 1) {
- this.registerEvent();
- }
-
- log("listener added: " + this);
- },
-
- removeListener: function(aServiceType, aListener) {
- log("removeListener: " + aServiceType + ", " + aListener);
-
- if (!this.listeners[aServiceType]) {
- log("listener doesn't exist");
- return;
- }
- let index = this.listeners[aServiceType].indexOf(aListener);
- if (index < 0) {
- log("listener doesn't exist");
- return;
- }
-
- this.listeners[aServiceType].splice(index, 1);
- --this.numListeners;
-
- if (this.numListeners === 0) {
- this.unregisterEvent();
- }
-
- log("listener removed" + this);
- },
-
- onServiceFound: function(aServiceInfo) {
- let listeners = this.listeners[aServiceInfo.serviceType];
- if (listeners) {
- for (let listener of listeners) {
- listener.onServiceFound(aServiceInfo);
- }
- } else {
- log("no listener");
- }
- return {};
- },
-
- onServiceLost: function(aServiceInfo) {
- let listeners = this.listeners[aServiceInfo.serviceType];
- if (listeners) {
- for (let listener of listeners) {
- listener.onServiceLost(aServiceInfo);
- }
- } else {
- log("no listener");
- }
- return {};
- }
-};
-
-// make an object from nsIPropertyBag2
-function parsePropertyBag2(bag) {
- if (!bag || !(bag instanceof Ci.nsIPropertyBag2)) {
- throw new TypeError("Not a property bag");
- }
-
- let attributes = [];
- let enumerator = bag.enumerator;
- while (enumerator.hasMoreElements()) {
- let name = enumerator.getNext().QueryInterface(Ci.nsIProperty).name;
- let value = bag.getPropertyAsACString(name);
- attributes.push({
- "name": name,
- "value": value
- });
- }
-
- return attributes;
-}
-
-function MulticastDNS() {
- this.serviceManager = new ServiceManager();
-}
-
-MulticastDNS.prototype = {
- startDiscovery: function(aServiceType, aListener) {
- this.serviceManager.addListener(aServiceType, aListener);
-
- let serviceInfo = {
- serviceType: aServiceType,
- uniqueId: aListener.uuid
- };
-
- send("NsdManager:DiscoverServices", serviceInfo, (result, err) => {
- if (err) {
- log("onStartDiscoveryFailed: " + aServiceType + " (" + err + ")");
- this.serviceManager.removeListener(aServiceType, aListener);
- aListener.onStartDiscoveryFailed(aServiceType, err);
- } else {
- aListener.onDiscoveryStarted(result);
- }
- });
- },
-
- stopDiscovery: function(aServiceType, aListener) {
- this.serviceManager.removeListener(aServiceType, aListener);
-
- let serviceInfo = {
- uniqueId: aListener.uuid
- };
-
- send("NsdManager:StopServiceDiscovery", serviceInfo, (result, err) => {
- if (err) {
- log("onStopDiscoveryFailed: " + aServiceType + " (" + err + ")");
- aListener.onStopDiscoveryFailed(aServiceType, err);
- } else {
- aListener.onDiscoveryStopped(aServiceType);
- }
- });
- },
-
- registerService: function(aServiceInfo, aListener) {
- let serviceInfo = {
- port: aServiceInfo.port,
- serviceType: aServiceInfo.serviceType,
- uniqueId: aListener.uuid
- };
-
- try {
- serviceInfo.host = aServiceInfo.host;
- } catch(e) {
- // host unspecified
- }
- try {
- serviceInfo.serviceName = aServiceInfo.serviceName;
- } catch(e) {
- // serviceName unspecified
- }
- try {
- serviceInfo.attributes = parsePropertyBag2(aServiceInfo.attributes);
- } catch(e) {
- // attributes unspecified
- }
-
- send("NsdManager:RegisterService", serviceInfo, (result, err) => {
- if (err) {
- log("onRegistrationFailed: (" + err + ")");
- aListener.onRegistrationFailed(aServiceInfo, err);
- } else {
- aListener.onServiceRegistered(result);
- }
- });
- },
-
- unregisterService: function(aServiceInfo, aListener) {
- let serviceInfo = {
- uniqueId: aListener.uuid
- };
-
- send("NsdManager:UnregisterService", serviceInfo, (result, err) => {
- if (err) {
- log("onUnregistrationFailed: (" + err + ")");
- aListener.onUnregistrationFailed(aServiceInfo, err);
- } else {
- aListener.onServiceUnregistered(aServiceInfo);
- }
- });
- },
-
- resolveService: function(aServiceInfo, aListener) {
- send("NsdManager:ResolveService", aServiceInfo, (result, err) => {
- if (err) {
- log("onResolveFailed: (" + err + ")");
- aListener.onResolveFailed(aServiceInfo, err);
- } else {
- aListener.onServiceResolved(result);
- }
- });
- }
-};
diff --git a/netwerk/dns/mdns/libmdns/moz.build b/netwerk/dns/mdns/libmdns/moz.build
index efad64d64..b7d376fc3 100644
--- a/netwerk/dns/mdns/libmdns/moz.build
+++ b/netwerk/dns/mdns/libmdns/moz.build
@@ -31,11 +31,6 @@ else:
'fallback/MulticastDNS.jsm',
]
- if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- EXTRA_JS_MODULES += [
- 'MulticastDNSAndroid.jsm',
- ]
-
UNIFIED_SOURCES += [
'nsDNSServiceInfo.cpp',
'nsMulticastDNSModule.cpp',
diff --git a/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.js b/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.js
index b94f67297..af9196135 100644
--- a/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.js
+++ b/netwerk/dns/mdns/libmdns/nsDNSServiceDiscovery.js
@@ -5,17 +5,9 @@
const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
-Cu.import("resource://gre/modules/ExtensionUtils.jsm");
Cu.import('resource://gre/modules/Services.jsm');
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-let { PlatformInfo } = ExtensionUtils;
-
-if (PlatformInfo.os == "android" && !Services.prefs.getBoolPref("network.mdns.use_js_fallback")) {
- Cu.import("resource://gre/modules/MulticastDNSAndroid.jsm");
-} else {
- Cu.import("resource://gre/modules/MulticastDNS.jsm");
-}
+Cu.import("resource://gre/modules/MulticastDNS.jsm");
const DNSSERVICEDISCOVERY_CID = Components.ID("{f9346d98-f27a-4e89-b744-493843416480}");
const DNSSERVICEDISCOVERY_CONTRACT_ID = "@mozilla.org/toolkit/components/mdnsresponder/dns-sd;1";
diff --git a/netwerk/protocol/device/AndroidCaptureProvider.cpp b/netwerk/protocol/device/AndroidCaptureProvider.cpp
deleted file mode 100644
index e69766085..000000000
--- a/netwerk/protocol/device/AndroidCaptureProvider.cpp
+++ /dev/null
@@ -1,301 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "base/basictypes.h"
-#include "AndroidCaptureProvider.h"
-#include "nsXULAppAPI.h"
-#include "nsStreamUtils.h"
-#include "nsThreadUtils.h"
-#include "nsMemory.h"
-#include "RawStructs.h"
-
-// The maximum number of frames we keep in our queue. Don't live in the past.
-#define MAX_FRAMES_QUEUED 10
-
-using namespace mozilla::net;
-
-NS_IMPL_ISUPPORTS(AndroidCameraInputStream, nsIInputStream, nsIAsyncInputStream)
-
-AndroidCameraInputStream::AndroidCameraInputStream() :
- mWidth(0), mHeight(0), mCamera(0), mHeaderSent(false), mClosed(true), mFrameSize(0),
- mMonitor("AndroidCamera.Monitor")
-{
- mAvailable = sizeof(RawVideoHeader);
- mFrameQueue = new nsDeque();
-}
-
-AndroidCameraInputStream::~AndroidCameraInputStream() {
- // clear the frame queue
- while (mFrameQueue->GetSize() > 0) {
- free(mFrameQueue->PopFront());
- }
- delete mFrameQueue;
-}
-
-NS_IMETHODIMP
-AndroidCameraInputStream::Init(nsACString& aContentType, nsCaptureParams* aParams)
-{
- if (!XRE_IsParentProcess())
- return NS_ERROR_NOT_IMPLEMENTED;
-
- mContentType = aContentType;
- mWidth = aParams->width;
- mHeight = aParams->height;
- mCamera = aParams->camera;
-
- CameraStreamImpl *impl = CameraStreamImpl::GetInstance(0);
- if (!impl)
- return NS_ERROR_OUT_OF_MEMORY;
- if (impl->Init(mContentType, mCamera, mWidth, mHeight, this)) {
- mWidth = impl->GetWidth();
- mHeight = impl->GetHeight();
- mClosed = false;
- }
- return NS_OK;
-}
-
-void AndroidCameraInputStream::ReceiveFrame(char* frame, uint32_t length) {
- {
- mozilla::ReentrantMonitorAutoEnter autoMonitor(mMonitor);
- if (mFrameQueue->GetSize() > MAX_FRAMES_QUEUED) {
- free(mFrameQueue->PopFront());
- mAvailable -= mFrameSize;
- }
- }
-
- mFrameSize = sizeof(RawPacketHeader) + length;
-
- char* fullFrame = (char*)moz_xmalloc(mFrameSize);
-
- if (!fullFrame)
- return;
-
- RawPacketHeader* header = (RawPacketHeader*) fullFrame;
- header->packetID = 0xFF;
- header->codecID = 0x595556; // "YUV"
-
- // we copy the Y plane, and de-interlace the CrCb
-
- uint32_t yFrameSize = mWidth * mHeight;
- uint32_t uvFrameSize = yFrameSize / 4;
-
- memcpy(fullFrame + sizeof(RawPacketHeader), frame, yFrameSize);
-
- char* uFrame = fullFrame + yFrameSize;
- char* vFrame = fullFrame + yFrameSize + uvFrameSize;
- char* yFrame = frame + yFrameSize;
- for (uint32_t i = 0; i < uvFrameSize; i++) {
- uFrame[i] = yFrame[2 * i + 1];
- vFrame[i] = yFrame[2 * i];
- }
-
- {
- mozilla::ReentrantMonitorAutoEnter autoMonitor(mMonitor);
- mAvailable += mFrameSize;
- mFrameQueue->Push((void*)fullFrame);
- }
-
- NotifyListeners();
-}
-
-NS_IMETHODIMP
-AndroidCameraInputStream::Available(uint64_t *aAvailable)
-{
- mozilla::ReentrantMonitorAutoEnter autoMonitor(mMonitor);
-
- *aAvailable = mAvailable;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP AndroidCameraInputStream::IsNonBlocking(bool *aNonBlock) {
- *aNonBlock = true;
- return NS_OK;
-}
-
-NS_IMETHODIMP AndroidCameraInputStream::Read(char *aBuffer, uint32_t aCount, uint32_t *aRead) {
- return ReadSegments(NS_CopySegmentToBuffer, aBuffer, aCount, aRead);
-}
-
-NS_IMETHODIMP AndroidCameraInputStream::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount, uint32_t *aRead) {
- *aRead = 0;
-
- nsresult rv;
-
- if (mAvailable == 0)
- return NS_BASE_STREAM_WOULD_BLOCK;
-
- if (aCount > mAvailable)
- aCount = mAvailable;
-
- if (!mHeaderSent) {
- CameraStreamImpl *impl = CameraStreamImpl::GetInstance(0);
- RawVideoHeader header;
- header.headerPacketID = 0;
- header.codecID = 0x595556; // "YUV"
- header.majorVersion = 0;
- header.minorVersion = 1;
- header.options = 1 | 1 << 1; // color, 4:2:2
-
- header.alphaChannelBpp = 0;
- header.lumaChannelBpp = 8;
- header.chromaChannelBpp = 4;
- header.colorspace = 1;
-
- header.frameWidth = mWidth;
- header.frameHeight = mHeight;
- header.aspectNumerator = 1;
- header.aspectDenominator = 1;
-
- header.framerateNumerator = impl->GetFps();
- header.framerateDenominator = 1;
-
- rv = aWriter(this, aClosure, (const char*)&header, 0, sizeof(RawVideoHeader), aRead);
-
- if (NS_FAILED(rv))
- return NS_OK;
-
- mHeaderSent = true;
- aCount -= sizeof(RawVideoHeader);
- mAvailable -= sizeof(RawVideoHeader);
- }
-
- {
- mozilla::ReentrantMonitorAutoEnter autoMonitor(mMonitor);
- while ((mAvailable > 0) && (aCount >= mFrameSize)) {
- uint32_t readThisTime = 0;
-
- char* frame = (char*)mFrameQueue->PopFront();
- rv = aWriter(this, aClosure, (const char*)frame, *aRead, mFrameSize, &readThisTime);
-
- if (readThisTime != mFrameSize) {
- mFrameQueue->PushFront((void*)frame);
- return NS_OK;
- }
-
- // RawReader does a copy when calling VideoData::Create()
- free(frame);
-
- if (NS_FAILED(rv))
- return NS_OK;
-
- aCount -= readThisTime;
- mAvailable -= readThisTime;
- *aRead += readThisTime;
- }
- }
- return NS_OK;
-}
-
-NS_IMETHODIMP AndroidCameraInputStream::Close() {
- return CloseWithStatus(NS_OK);
-}
-
-
-/**
- * must be called on the main (java) thread
- */
-void AndroidCameraInputStream::doClose() {
- NS_ASSERTION(!mClosed, "Camera is already closed");
-
- CameraStreamImpl *impl = CameraStreamImpl::GetInstance(0);
- impl->Close();
- mClosed = true;
-}
-
-
-void AndroidCameraInputStream::NotifyListeners() {
- mozilla::ReentrantMonitorAutoEnter autoMonitor(mMonitor);
-
- if (mCallback && (mAvailable > sizeof(RawVideoHeader))) {
- nsCOMPtr<nsIInputStreamCallback> callback;
- if (mCallbackTarget) {
- callback = NS_NewInputStreamReadyEvent(mCallback, mCallbackTarget);
- } else {
- callback = mCallback;
- }
-
- NS_ASSERTION(callback, "Shouldn't fail to make the callback!");
-
- // Null the callback first because OnInputStreamReady may reenter AsyncWait
- mCallback = nullptr;
- mCallbackTarget = nullptr;
-
- callback->OnInputStreamReady(this);
- }
-}
-
-NS_IMETHODIMP AndroidCameraInputStream::AsyncWait(nsIInputStreamCallback *aCallback, uint32_t aFlags, uint32_t aRequestedCount, nsIEventTarget *aTarget)
-{
- if (aFlags != 0)
- return NS_ERROR_NOT_IMPLEMENTED;
-
- if (mCallback || mCallbackTarget)
- return NS_ERROR_UNEXPECTED;
-
- mCallbackTarget = aTarget;
- mCallback = aCallback;
-
- // What we are being asked for may be present already
- NotifyListeners();
- return NS_OK;
-}
-
-
-NS_IMETHODIMP AndroidCameraInputStream::CloseWithStatus(nsresult status)
-{
- AndroidCameraInputStream::doClose();
- return NS_OK;
-}
-
-/**
- * AndroidCaptureProvider implementation
- */
-
-NS_IMPL_ISUPPORTS0(AndroidCaptureProvider)
-
-AndroidCaptureProvider* AndroidCaptureProvider::sInstance = nullptr;
-
-AndroidCaptureProvider::AndroidCaptureProvider() {
-}
-
-AndroidCaptureProvider::~AndroidCaptureProvider() {
- AndroidCaptureProvider::sInstance = nullptr;
-}
-
-nsresult AndroidCaptureProvider::Init(nsACString& aContentType,
- nsCaptureParams* aParams,
- nsIInputStream** aStream) {
-
- NS_ENSURE_ARG_POINTER(aParams);
-
- NS_ASSERTION(aParams->frameLimit == 0 || aParams->timeLimit == 0,
- "Cannot set both a frame limit and a time limit!");
-
- RefPtr<AndroidCameraInputStream> stream;
-
- if (aContentType.EqualsLiteral("video/x-raw-yuv")) {
- stream = new AndroidCameraInputStream();
- if (stream) {
- nsresult rv = stream->Init(aContentType, aParams);
- if (NS_FAILED(rv))
- return rv;
- }
- else
- return NS_ERROR_OUT_OF_MEMORY;
- } else {
- NS_NOTREACHED("Should not have asked Android for this type!");
- }
- stream.forget(aStream);
- return NS_OK;
-}
-
-already_AddRefed<AndroidCaptureProvider> GetAndroidCaptureProvider() {
- if (!AndroidCaptureProvider::sInstance) {
- AndroidCaptureProvider::sInstance = new AndroidCaptureProvider();
- }
- RefPtr<AndroidCaptureProvider> ret = AndroidCaptureProvider::sInstance;
- return ret.forget();
-}
diff --git a/netwerk/protocol/device/AndroidCaptureProvider.h b/netwerk/protocol/device/AndroidCaptureProvider.h
deleted file mode 100644
index dd99ea541..000000000
--- a/netwerk/protocol/device/AndroidCaptureProvider.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef AndroidDeviceCaptureProvide_h_
-#define AndroidDeviceCaptureProvide_h_
-
-#include "nsDeviceCaptureProvider.h"
-#include "nsIAsyncInputStream.h"
-#include "nsCOMPtr.h"
-#include "nsAutoPtr.h"
-#include "nsString.h"
-#include "mozilla/net/CameraStreamImpl.h"
-#include "nsIEventTarget.h"
-#include "nsDeque.h"
-#include "mozilla/ReentrantMonitor.h"
-
-class AndroidCaptureProvider final : public nsDeviceCaptureProvider {
- private:
- ~AndroidCaptureProvider();
-
- public:
- AndroidCaptureProvider();
-
- NS_DECL_THREADSAFE_ISUPPORTS
-
- MOZ_MUST_USE nsresult Init(nsACString& aContentType, nsCaptureParams* aParams, nsIInputStream** aStream) override;
- static AndroidCaptureProvider* sInstance;
-};
-
-class AndroidCameraInputStream final : public nsIAsyncInputStream, mozilla::net::CameraStreamImpl::FrameCallback {
- private:
- ~AndroidCameraInputStream();
-
- public:
- AndroidCameraInputStream();
-
- NS_IMETHODIMP Init(nsACString& aContentType, nsCaptureParams* aParams);
-
- NS_DECL_THREADSAFE_ISUPPORTS
- NS_DECL_NSIINPUTSTREAM
- NS_DECL_NSIASYNCINPUTSTREAM
-
- void ReceiveFrame(char* frame, uint32_t length) override;
-
- protected:
- void NotifyListeners();
- void doClose();
-
- uint32_t mAvailable;
- nsCString mContentType;
- uint32_t mWidth;
- uint32_t mHeight;
- uint32_t mCamera;
- bool mHeaderSent;
- bool mClosed;
- nsDeque *mFrameQueue;
- uint32_t mFrameSize;
- mozilla::ReentrantMonitor mMonitor;
-
- nsCOMPtr<nsIInputStreamCallback> mCallback;
- nsCOMPtr<nsIEventTarget> mCallbackTarget;
-};
-
-already_AddRefed<AndroidCaptureProvider> GetAndroidCaptureProvider();
-
-#endif
diff --git a/netwerk/protocol/device/CameraStreamImpl.cpp b/netwerk/protocol/device/CameraStreamImpl.cpp
deleted file mode 100644
index f4a2cf4a4..000000000
--- a/netwerk/protocol/device/CameraStreamImpl.cpp
+++ /dev/null
@@ -1,114 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "CameraStreamImpl.h"
-#include "GeneratedJNINatives.h"
-#include "nsCRTGlue.h"
-#include "nsThreadUtils.h"
-#include "nsXULAppAPI.h"
-#include "mozilla/Monitor.h"
-
-using namespace mozilla;
-
-namespace mozilla {
-namespace net {
-
-static CameraStreamImpl* mCamera0 = nullptr;
-static CameraStreamImpl* mCamera1 = nullptr;
-
-class CameraStreamImpl::Callback
- : public java::GeckoAppShell::CameraCallback::Natives<Callback>
-{
-public:
- static void OnFrameData(int32_t aCamera, jni::ByteArray::Param aData)
- {
- MOZ_ASSERT(NS_IsMainThread());
-
- CameraStreamImpl* impl = GetInstance(uint32_t(aCamera));
- if (impl) {
- impl->TransmitFrame(aData);
- }
- }
-};
-
-/**
- * CameraStreamImpl
- */
-
-void CameraStreamImpl::TransmitFrame(jni::ByteArray::Param aData) {
- if (!mCallback) {
- return;
- }
-
- JNIEnv* const env = jni::GetGeckoThreadEnv();
- const size_t length = size_t(env->GetArrayLength(aData.Get()));
-
- if (!length) {
- return;
- }
-
- jbyte* const data = env->GetByteArrayElements(aData.Get(), nullptr);
- mCallback->ReceiveFrame(reinterpret_cast<char*>(data), length);
- env->ReleaseByteArrayElements(aData.Get(), data, JNI_ABORT);
-}
-
-CameraStreamImpl* CameraStreamImpl::GetInstance(uint32_t aCamera) {
- CameraStreamImpl* res = nullptr;
- switch(aCamera) {
- case 0:
- if (mCamera0)
- res = mCamera0;
- else
- res = mCamera0 = new CameraStreamImpl(aCamera);
- break;
- case 1:
- if (mCamera1)
- res = mCamera1;
- else
- res = mCamera1 = new CameraStreamImpl(aCamera);
- break;
- }
- return res;
-}
-
-
-CameraStreamImpl::CameraStreamImpl(uint32_t aCamera) :
- mInit(false), mCamera(aCamera)
-{
- NS_WARNING("CameraStreamImpl::CameraStreamImpl()");
- mWidth = 0;
- mHeight = 0;
- mFps = 0;
-}
-
-CameraStreamImpl::~CameraStreamImpl()
-{
- NS_WARNING("CameraStreamImpl::~CameraStreamImpl()");
-}
-
-bool CameraStreamImpl::Init(const nsCString& contentType, const uint32_t& camera, const uint32_t& width, const uint32_t& height, FrameCallback* aCallback)
-{
- mCallback = aCallback;
- mWidth = width;
- mHeight = height;
-
- Callback::Init();
- jni::IntArray::LocalRef retArray = java::GeckoAppShell::InitCamera(
- contentType, int32_t(camera), int32_t(width), int32_t(height));
- nsTArray<int32_t> ret = retArray->GetElements();
-
- mWidth = uint32_t(ret[1]);
- mHeight = uint32_t(ret[2]);
- mFps = uint32_t(ret[3]);
-
- return !!ret[0];
-}
-
-void CameraStreamImpl::Close() {
- java::GeckoAppShell::CloseCamera();
- mCallback = nullptr;
-}
-
-} // namespace net
-} // namespace mozilla
diff --git a/netwerk/protocol/device/CameraStreamImpl.h b/netwerk/protocol/device/CameraStreamImpl.h
deleted file mode 100644
index 93037caf6..000000000
--- a/netwerk/protocol/device/CameraStreamImpl.h
+++ /dev/null
@@ -1,71 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef __CAMERASTREAMIMPL_H__
-#define __CAMERASTREAMIMPL_H__
-
-#include "mozilla/jni/Refs.h"
-
-#include "nsString.h"
-
-/**
- * This singleton class handles communication with the Android camera
- * through JNI. It is used by the IPDL parent or directly from the chrome process
- */
-
-namespace mozilla {
-namespace net {
-
-class CameraStreamImpl {
-public:
- class FrameCallback {
- public:
- virtual void ReceiveFrame(char* frame, uint32_t length) = 0;
- };
-
- /**
- * instance bound to a given camera
- */
- static CameraStreamImpl* GetInstance(uint32_t aCamera);
-
- bool initNeeded() {
- return !mInit;
- }
-
- FrameCallback* GetFrameCallback() {
- return mCallback;
- }
-
- MOZ_MUST_USE bool Init(const nsCString& contentType, const uint32_t& camera, const uint32_t& width, const uint32_t& height, FrameCallback* callback);
- void Close();
-
- uint32_t GetWidth() { return mWidth; }
- uint32_t GetHeight() { return mHeight; }
- uint32_t GetFps() { return mFps; }
-
- void takePicture(const nsAString& aFileName);
-
-private:
- class Callback;
-
- CameraStreamImpl(uint32_t aCamera);
- CameraStreamImpl(const CameraStreamImpl&);
- CameraStreamImpl& operator=(const CameraStreamImpl&);
-
- ~CameraStreamImpl();
-
- void TransmitFrame(jni::ByteArray::Param aData);
-
- bool mInit;
- uint32_t mCamera;
- uint32_t mWidth;
- uint32_t mHeight;
- uint32_t mFps;
- FrameCallback* mCallback;
-};
-
-} // namespace net
-} // namespace mozilla
-
-#endif
diff --git a/netwerk/protocol/device/moz.build b/netwerk/protocol/device/moz.build
index a18672220..3bb95930e 100644
--- a/netwerk/protocol/device/moz.build
+++ b/netwerk/protocol/device/moz.build
@@ -4,15 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- EXPORTS.mozilla.net += [
- 'CameraStreamImpl.h',
- ]
- UNIFIED_SOURCES += [
- 'AndroidCaptureProvider.cpp',
- 'CameraStreamImpl.cpp',
- ]
-
UNIFIED_SOURCES += [
'nsDeviceChannel.cpp',
'nsDeviceProtocolHandler.cpp',
diff --git a/netwerk/protocol/device/nsDeviceChannel.cpp b/netwerk/protocol/device/nsDeviceChannel.cpp
index 6c5788a56..d8b6900e8 100644
--- a/netwerk/protocol/device/nsDeviceChannel.cpp
+++ b/netwerk/protocol/device/nsDeviceChannel.cpp
@@ -7,11 +7,6 @@
#include "nsDeviceChannel.h"
#include "nsDeviceCaptureProvider.h"
-#ifdef MOZ_WIDGET_ANDROID
-#include "mozilla/Preferences.h"
-#include "AndroidCaptureProvider.h"
-#endif
-
using namespace mozilla;
// Copied from image/decoders/icon/nsIconURI.cpp
@@ -112,9 +107,6 @@ nsDeviceChannel::OpenContentStream(bool aAsync,
extractAttributeValue(spec.get(), "camera=", buffer);
captureParams.camera = buffer.ToInteger(&err);
captureParams.bpp = 32;
-#ifdef MOZ_WIDGET_ANDROID
- capture = GetAndroidCaptureProvider();
-#endif
} else if (kNotFound != spec.Find(NS_LITERAL_CSTRING("type=video/x-raw-yuv"),
true,
0,
@@ -138,11 +130,6 @@ nsDeviceChannel::OpenContentStream(bool aAsync,
captureParams.bpp = 32;
captureParams.timeLimit = 0;
captureParams.frameLimit = 60000;
-#ifdef MOZ_WIDGET_ANDROID
- // only enable if "device.camera.enabled" is true.
- if (Preferences::GetBool("device.camera.enabled", false) == true)
- capture = GetAndroidCaptureProvider();
-#endif
} else {
return NS_ERROR_NOT_IMPLEMENTED;
}
diff --git a/netwerk/protocol/http/UserAgentOverrides.jsm b/netwerk/protocol/http/UserAgentOverrides.jsm
index 037aa575b..e106f817a 100644
--- a/netwerk/protocol/http/UserAgentOverrides.jsm
+++ b/netwerk/protocol/http/UserAgentOverrides.jsm
@@ -2,6 +2,10 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#ifdef XP_WIN
+#define UA_SPARE_PLATFORM
+#endif
+
"use strict";
this.EXPORTED_SYMBOLS = [ "UserAgentOverrides" ];
@@ -18,6 +22,14 @@ const PREF_OVERRIDES_ENABLED = "general.useragent.site_specific_overrides";
const DEFAULT_UA = Cc["@mozilla.org/network/protocol;1?name=http"]
.getService(Ci.nsIHttpProtocolHandler)
.userAgent;
+const OSCPU = Cc["@mozilla.org/network/protocol;1?name=http"]
+ .getService(Ci.nsIHttpProtocolHandler)
+ .oscpu;
+#ifndef UA_SPARE_PLATFORM
+const PLATFORM = Cc["@mozilla.org/network/protocol;1?name=http"]
+ .getService(Ci.nsIHttpProtocolHandler)
+ .platform;
+#endif
const MAX_OVERRIDE_FOR_HOST_CACHE_SIZE = 250;
XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
@@ -27,18 +39,27 @@ XPCOMUtils.defineLazyServiceGetter(this, "ppmm",
var gPrefBranch;
var gOverrides = new Map;
var gUpdatedOverrides;
+var gOldDynOverrides;
var gOverrideForHostCache = new Map;
var gInitialized = false;
var gOverrideFunctions = [
function (aHttpChannel) { return UserAgentOverrides.getOverrideForURI(aHttpChannel.URI); }
];
var gBuiltUAs = new Map;
+var gOSSlice;
this.UserAgentOverrides = {
init: function uao_init() {
if (gInitialized)
return;
+ gOSSlice = OSCPU + ";";
+#ifndef UA_SPARE_PLATFORM
+ if (PLATFORM != "") {
+ gOSSlice = PLATFORM + "; " + gOSSlice;
+ }
+#endif
+
gPrefBranch = Services.prefs.getBranch("general.useragent.override.");
gPrefBranch.addObserver("", buildOverrides, false);
@@ -52,7 +73,10 @@ this.UserAgentOverrides = {
}
UserAgentUpdates.init(function(overrides) {
- gOverrideForHostCache.clear();
+ if (overrides == gOldDynOverrides) {
+ return;
+ }
+ gOldDynOverrides = overrides;
if (overrides) {
for (let domain in overrides) {
overrides[domain] = getUserAgentFromOverride(overrides[domain]);
@@ -60,6 +84,7 @@ this.UserAgentOverrides = {
overrides.get = function(key) { return this[key]; };
}
gUpdatedOverrides = overrides;
+ buildOverrides();
});
buildOverrides();
@@ -143,7 +168,7 @@ function getUserAgentFromOverride(override)
if (search && replace) {
userAgent = DEFAULT_UA.replace(new RegExp(search, "g"), replace);
} else {
- userAgent = override;
+ userAgent = override.replace(/%OS_SLICE%/g, gOSSlice);
}
gBuiltUAs.set(override, userAgent);
return userAgent;
@@ -156,15 +181,22 @@ function buildOverrides() {
if (!Services.prefs.getBoolPref(PREF_OVERRIDES_ENABLED))
return;
- let builtUAs = new Map;
let domains = gPrefBranch.getChildList("");
+ // Since the static override map has the highest priority, we build it so
+ // that it includes only domains with user-set overrides and domains with
+ // default pre-set overrides that are not overridden by dynamic updates.
for (let domain of domains) {
- let override = gPrefBranch.getCharPref(domain);
- let userAgent = getUserAgentFromOverride(override);
-
- if (userAgent != DEFAULT_UA) {
- gOverrides.set(domain, userAgent);
+ if (!(gUpdatedOverrides && gUpdatedOverrides.get(domain)) ||
+ gPrefBranch.prefHasUserValue(domain)) {
+ // Here we selected domains that are not dynamically overridden
+ // or have a user-set override.
+ let override = gPrefBranch.getCharPref(domain);
+ let userAgent = getUserAgentFromOverride(override);
+
+ if (userAgent != DEFAULT_UA) {
+ gOverrides.set(domain, userAgent);
+ }
}
}
}
diff --git a/netwerk/protocol/http/UserAgentUpdates.jsm b/netwerk/protocol/http/UserAgentUpdates.jsm
index 602705ebe..cd21b78b3 100644
--- a/netwerk/protocol/http/UserAgentUpdates.jsm
+++ b/netwerk/protocol/http/UserAgentUpdates.jsm
@@ -10,7 +10,6 @@ const Ci = Components.interfaces;
const Cc = Components.classes;
const Cu = Components.utils;
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
@@ -18,15 +17,9 @@ XPCOMUtils.defineLazyModuleGetter(
this, "FileUtils", "resource://gre/modules/FileUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(
- this, "NetUtil", "resource://gre/modules/NetUtil.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(
this, "OS", "resource://gre/modules/osfile.jsm");
XPCOMUtils.defineLazyModuleGetter(
- this, "Promise", "resource://gre/modules/Promise.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(
this, "UpdateUtils", "resource://gre/modules/UpdateUtils.jsm");
XPCOMUtils.defineLazyServiceGetter(
@@ -65,30 +58,6 @@ const PREF_APP_DISTRIBUTION_VERSION = "distribution.version";
var gInitialized = false;
-function readChannel(url) {
- return new Promise((resolve, reject) => {
- try {
- let channel = NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true});
- channel.contentType = "application/json";
-
- NetUtil.asyncFetch(channel, (inputStream, status) => {
- if (!Components.isSuccessCode(status)) {
- reject();
- return;
- }
-
- let data = JSON.parse(
- NetUtil.readInputStreamToString(inputStream, inputStream.available())
- );
- resolve(data);
- });
- } catch (ex) {
- reject(new Error("UserAgentUpdates: Could not fetch " + url + " " +
- ex + "\n" + ex.stack));
- }
- });
-}
-
this.UserAgentUpdates = {
init: function(callback) {
if (gInitialized) {
@@ -144,13 +113,9 @@ this.UserAgentUpdates = {
// try to load next one if the previous load failed
return prevLoad ? prevLoad.then(null, tryNext) : tryNext();
}, null).then(null, (ex) => {
- if (AppConstants.platform !== "android") {
- // All previous (non-Android) load attempts have failed, so we bail.
- throw new Error("UserAgentUpdates: Failed to load " + FILE_UPDATES +
- ex + "\n" + ex.stack);
- }
- // Make one last attempt to read from the Fennec APK root.
- return readChannel("resource://android/" + FILE_UPDATES);
+ // All previous load attempts have failed, so we bail.
+ throw new Error("UserAgentUpdates: Failed to load " + FILE_UPDATES +
+ ex + "\n" + ex.stack);
}).then((update) => {
// Apply update if loading was successful
this._applyUpdate(update);
diff --git a/netwerk/protocol/http/moz.build b/netwerk/protocol/http/moz.build
index 1368ee707..a1b57876b 100644
--- a/netwerk/protocol/http/moz.build
+++ b/netwerk/protocol/http/moz.build
@@ -99,10 +99,9 @@ IPDL_SOURCES += [
'PHttpChannel.ipdl',
]
-EXTRA_JS_MODULES += [
- 'UserAgentOverrides.jsm',
- 'UserAgentUpdates.jsm',
-]
+EXTRA_JS_MODULES += ['UserAgentUpdates.jsm']
+
+EXTRA_PP_JS_MODULES += ['UserAgentOverrides.jsm']
include('/ipc/chromium/chromium-config.mozbuild')
diff --git a/netwerk/protocol/http/nsHttpChannel.cpp b/netwerk/protocol/http/nsHttpChannel.cpp
index 05383916f..950b1a7ab 100644
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -1530,7 +1530,7 @@ GetPKPConsoleErrorTag(uint32_t failureResult, nsAString& consoleErrorTag)
}
/**
- * Process a single security header. Only two types are supported: HSTS and HPKP.
+ * Process a single security header. Only one type is supported: HSTS.
*/
nsresult
nsHttpChannel::ProcessSingleSecurityHeader(uint32_t aType,
@@ -1542,9 +1542,6 @@ nsHttpChannel::ProcessSingleSecurityHeader(uint32_t aType,
case nsISiteSecurityService::HEADER_HSTS:
atom = nsHttp::ResolveAtom("Strict-Transport-Security");
break;
- case nsISiteSecurityService::HEADER_HPKP:
- atom = nsHttp::ResolveAtom("Public-Key-Pins");
- break;
default:
NS_NOTREACHED("Invalid security header type");
return NS_ERROR_FAILURE;
@@ -1568,10 +1565,6 @@ nsHttpChannel::ProcessSingleSecurityHeader(uint32_t aType,
GetSTSConsoleErrorTag(failureResult, consoleErrorTag);
consoleErrorCategory = NS_LITERAL_STRING("Invalid HSTS Headers");
break;
- case nsISiteSecurityService::HEADER_HPKP:
- GetPKPConsoleErrorTag(failureResult, consoleErrorTag);
- consoleErrorCategory = NS_LITERAL_STRING("Invalid HPKP Headers");
- break;
default:
return NS_ERROR_FAILURE;
}
@@ -1641,10 +1634,6 @@ nsHttpChannel::ProcessSecurityHeaders()
sslStatus, flags);
NS_ENSURE_SUCCESS(rv, rv);
- rv = ProcessSingleSecurityHeader(nsISiteSecurityService::HEADER_HPKP,
- sslStatus, flags);
- NS_ENSURE_SUCCESS(rv, rv);
-
return NS_OK;
}
diff --git a/netwerk/protocol/http/nsHttpHandler.cpp b/netwerk/protocol/http/nsHttpHandler.cpp
index 0f4c94202..7a29e041b 100644
--- a/netwerk/protocol/http/nsHttpHandler.cpp
+++ b/netwerk/protocol/http/nsHttpHandler.cpp
@@ -127,30 +127,6 @@ NewURI(const nsACString &aSpec,
return NS_OK;
}
-#ifdef ANDROID
-static nsCString
-GetDeviceModelId() {
- // Assumed to be running on the main thread
- // We need the device property in either case
- nsAutoCString deviceModelId;
- nsCOMPtr<nsIPropertyBag2> infoService = do_GetService("@mozilla.org/system-info;1");
- MOZ_ASSERT(infoService, "Could not find a system info service");
- nsAutoString androidDevice;
- nsresult rv = infoService->GetPropertyAsAString(NS_LITERAL_STRING("device"), androidDevice);
- if (NS_SUCCEEDED(rv)) {
- deviceModelId = NS_LossyConvertUTF16toASCII(androidDevice);
- }
- nsAutoCString deviceString;
- rv = Preferences::GetCString(UA_PREF("device_string"), &deviceString);
- if (NS_SUCCEEDED(rv)) {
- deviceString.Trim(" ", true, true);
- deviceString.ReplaceSubstring(NS_LITERAL_CSTRING("%DEVICEID%"), deviceModelId);
- return deviceString;
- }
- return deviceModelId;
-}
-#endif
-
//-----------------------------------------------------------------------------
// nsHttpHandler <public>
//-----------------------------------------------------------------------------
@@ -198,8 +174,10 @@ nsHttpHandler::nsHttpHandler()
, mLegacyAppName("Mozilla")
, mLegacyAppVersion("5.0")
, mProduct("Goanna")
+ , mCompatGeckoEnabled(false)
+ , mAppBuildID("20200101")
, mCompatFirefoxEnabled(false)
- , mCompatFirefoxVersion("52.9")
+ , mCompatFirefoxVersion("68.9")
, mUserAgentIsDirty(true)
, mAcceptLanguagesIsDirty(true)
, mPromptTempRedirect(true)
@@ -315,8 +293,13 @@ nsHttpHandler::Init()
nsHttpChannelAuthProvider::InitializePrefs();
// rv: should have the Firefox/Gecko compatversion for web compatibility
+ // when in either compatmodes
mMisc.AssignLiteral("rv:");
- mMisc += mCompatFirefoxVersion;
+ if (mCompatGeckoEnabled) {
+ mMisc += mCompatFirefoxVersion;
+ } else {
+ mMisc += MOZILLA_UAVERSION;
+ }
mCompatGecko.AssignLiteral("Gecko/20100101");
mCompatFirefox.AssignLiteral("Firefox/");
@@ -325,6 +308,14 @@ nsHttpHandler::Init()
nsCOMPtr<nsIXULAppInfo> appInfo =
do_GetService("@mozilla.org/xre/app-info;1");
+ nsCString dynamicBuildID;
+ if (appInfo) {
+ appInfo->GetPlatformBuildID(dynamicBuildID);
+ if (dynamicBuildID.Length() > 8 )
+ dynamicBuildID.Left(dynamicBuildID, 8);
+ }
+ mAppBuildID.Assign(dynamicBuildID);
+
mAppName.AssignLiteral(MOZ_APP_UA_NAME);
if (mAppName.Length() == 0 && appInfo) {
// Try to get the UA name from appInfo, falling back to the name
@@ -334,28 +325,9 @@ nsHttpHandler::Init()
}
mAppName.StripChars(R"( ()<>@,;:\"/[]?={})");
}
-
- nsCString dynamicBuildID;
- if (appInfo) {
- appInfo->GetPlatformBuildID(dynamicBuildID);
- if (dynamicBuildID.Length() > 8 )
- dynamicBuildID.Left(dynamicBuildID, 8);
- }
- if (mAppVersionIsBuildID) {
- // Override BuildID
- mAppVersion.AssignLiteral(MOZ_UA_BUILDID);
- } else if (appInfo) {
- appInfo->GetVersion(mAppVersion);
- } else {
- // Fall back to platform if appInfo is unavailable
- mAppVersion.AssignLiteral(MOZILLA_UAVERSION);
- }
+ BuildAppVersion();
- // If there's no override set, set it to the dynamic BuildID
- if (mAppVersion.IsEmpty())
- mAppVersion.Assign(dynamicBuildID);
-
mSessionStartTime = NowInSeconds();
mHandlerActive = true;
@@ -372,10 +344,15 @@ nsHttpHandler::Init()
do_GetService("@mozilla.org/network/request-context-service;1");
// Goanna slice version
- mProductSub.AssignLiteral(MOZILLA_UAVERSION);
-
- if (mProductSub.IsEmpty())
- mProductSub.Assign(dynamicBuildID);
+ if (mCompatGeckoEnabled) {
+ mProductSub.AssignLiteral(MOZILLA_UAVERSION);
+ } else {
+ mProductSub.Assign(mAppBuildID);
+ }
+ // In case MOZILLA_UAVERSION is empty for some odd reason...
+ if (mProductSub.IsEmpty()) {
+ mProductSub.Assign(mAppBuildID);
+ }
#if DEBUG
// dump user agent prefs
@@ -681,6 +658,30 @@ nsHttpHandler::GenerateHostPort(const nsCString& host, int32_t port,
// nsHttpHandler <private>
//-----------------------------------------------------------------------------
+void
+nsHttpHandler::BuildAppVersion()
+{
+ nsCOMPtr<nsIXULAppInfo> appInfo = do_GetService("@mozilla.org/xre/app-info;1");
+
+ if (mAppVersionIsBuildID) {
+ // Override with BuildID
+ mAppVersion.Assign(mAppBuildID);
+ } else if (appInfo) {
+ appInfo->GetVersion(mAppVersion);
+ } else {
+ // Fall back to platform if appInfo is unavailable
+ mAppVersion.AssignLiteral(MOZILLA_UAVERSION);
+ }
+
+ // If there's still no version set, set it to a fixed BuildID
+ if (mAppVersion.IsEmpty()) {
+ mAppVersion.AssignLiteral(MOZ_UA_BUILDID);
+ }
+ if (mAppVersion.IsEmpty()) {
+ mAppVersion.AssignLiteral("20200101");
+ }
+}
+
const nsAFlatCString &
nsHttpHandler::UserAgent()
{
@@ -792,9 +793,7 @@ nsHttpHandler::InitUserAgentComponents()
#ifndef MOZ_UA_OS_AGNOSTIC
// Gather platform.
mPlatform.AssignLiteral(
-#if defined(ANDROID)
- "Android"
-#elif defined(XP_WIN)
+#if defined(XP_WIN)
"Windows"
#elif defined(XP_MACOSX)
"Macintosh"
@@ -808,64 +807,6 @@ nsHttpHandler::InitUserAgentComponents()
);
#endif
-
-#ifdef ANDROID
- nsCOMPtr<nsIPropertyBag2> infoService = do_GetService("@mozilla.org/system-info;1");
- MOZ_ASSERT(infoService, "Could not find a system info service");
- nsresult rv;
- // Add the Android version number to the Fennec platform identifier.
-#if defined MOZ_WIDGET_ANDROID
-#ifndef MOZ_UA_OS_AGNOSTIC // Don't add anything to mPlatform since it's empty.
- nsAutoString androidVersion;
- rv = infoService->GetPropertyAsAString(
- NS_LITERAL_STRING("release_version"), androidVersion);
- if (NS_SUCCEEDED(rv)) {
- mPlatform += " ";
- // If the 2nd character is a ".", we know the major version is a single
- // digit. If we're running on a version below 4 we pretend to be on
- // Android KitKat (4.4) to work around scripts sniffing for low versions.
- if (androidVersion[1] == 46 && androidVersion[0] < 52) {
- mPlatform += "4.4";
- } else {
- mPlatform += NS_LossyConvertUTF16toASCII(androidVersion);
- }
- }
-#endif
-#endif
- // Add the `Mobile` or `Tablet` or `TV` token when running on device.
- bool isTablet;
- rv = infoService->GetPropertyAsBool(NS_LITERAL_STRING("tablet"), &isTablet);
- if (NS_SUCCEEDED(rv) && isTablet) {
- mCompatDevice.AssignLiteral("Tablet");
- } else {
- bool isTV;
- rv = infoService->GetPropertyAsBool(NS_LITERAL_STRING("tv"), &isTV);
- if (NS_SUCCEEDED(rv) && isTV) {
- mCompatDevice.AssignLiteral("TV");
- } else {
- mCompatDevice.AssignLiteral("Mobile");
- }
- }
-
- if (Preferences::GetBool(UA_PREF("use_device"), false)) {
- mDeviceModelId = mozilla::net::GetDeviceModelId();
- }
-#endif // ANDROID
-
-#ifdef MOZ_MULET
- {
- // Add the `Mobile` or `Tablet` or `TV` token when running in the b2g
- // desktop simulator via preference.
- nsCString deviceType;
- nsresult rv = Preferences::GetCString("devtools.useragent.device_type", &deviceType);
- if (NS_SUCCEEDED(rv)) {
- mCompatDevice.Assign(deviceType);
- } else {
- mCompatDevice.AssignLiteral("Mobile");
- }
- }
-#endif // MOZ_MULET
-
#ifndef MOZ_UA_OS_AGNOSTIC
// Gather OS/CPU.
#if defined(XP_WIN)
@@ -993,12 +934,34 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
if (PREF_CHANGED(UA_PREF("appVersionIsBuildID"))) {
rv = prefs->GetBoolPref(UA_PREF("appVersionIsBuildID"), &cVar);
mAppVersionIsBuildID = (NS_SUCCEEDED(rv) && cVar);
+
+ // Rebuild application version string.
+ BuildAppVersion();
+
mUserAgentIsDirty = true;
}
if (PREF_CHANGED(UA_PREF("compatMode.gecko"))) {
rv = prefs->GetBoolPref(UA_PREF("compatMode.gecko"), &cVar);
mCompatGeckoEnabled = (NS_SUCCEEDED(rv) && cVar);
+
+ // Rebuild rv: and Goanna slice version
+ mMisc.AssignLiteral("rv:");
+ if (mCompatGeckoEnabled) {
+ mMisc += mCompatFirefoxVersion;
+ } else {
+ mMisc += MOZILLA_UAVERSION;
+ }
+
+ if (mCompatGeckoEnabled) {
+ mProductSub.AssignLiteral(MOZILLA_UAVERSION);
+ } else {
+ mProductSub.Assign(mAppBuildID);
+ }
+ // In case MOZILLA_UAVERSION is empty for some odd reason...
+ if (mProductSub.IsEmpty()) {
+ mProductSub.Assign(mAppBuildID);
+ }
mUserAgentIsDirty = true;
}
@@ -1017,7 +980,11 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
// rebuild mMisc and compatMode slice
mMisc.AssignLiteral("rv:");
- mMisc += mCompatFirefoxVersion;
+ if (mCompatGeckoEnabled) {
+ mMisc += mCompatFirefoxVersion;
+ } else {
+ mMisc += MOZILLA_UAVERSION;
+ }
mCompatFirefox.AssignLiteral("Firefox/");
mCompatFirefox += mCompatFirefoxVersion;
@@ -1031,18 +998,6 @@ nsHttpHandler::PrefsChanged(nsIPrefBranch *prefs, const char *pref)
mUserAgentIsDirty = true;
}
-#ifdef ANDROID
- // general.useragent.use_device
- if (PREF_CHANGED(UA_PREF("use_device"))) {
- if (Preferences::GetBool(UA_PREF("use_device"), false)) {
- mDeviceModelId = mozilla::net::GetDeviceModelId();
- } else {
- mDeviceModelId = EmptyCString();
- }
- mUserAgentIsDirty = true;
- }
-#endif
-
//
// HTTP options
//
diff --git a/netwerk/protocol/http/nsHttpHandler.h b/netwerk/protocol/http/nsHttpHandler.h
index 402147577..4f632e078 100644
--- a/netwerk/protocol/http/nsHttpHandler.h
+++ b/netwerk/protocol/http/nsHttpHandler.h
@@ -391,6 +391,7 @@ private:
//
// Useragent/prefs helper methods
//
+ void BuildAppVersion();
void BuildUserAgent();
void InitUserAgentComponents();
void PrefsChanged(nsIPrefBranch *prefs, const char *pref);
@@ -500,6 +501,7 @@ private:
nsCString mCompatFirefox;
bool mCompatFirefoxEnabled;
nsCString mCompatFirefoxVersion;
+ nsCString mAppBuildID;
nsXPIDLCString mCompatDevice;
nsCString mDeviceModelId;
diff --git a/netwerk/sctp/datachannel/moz.build b/netwerk/sctp/datachannel/moz.build
index fc59da229..18bb8533a 100644
--- a/netwerk/sctp/datachannel/moz.build
+++ b/netwerk/sctp/datachannel/moz.build
@@ -25,9 +25,7 @@ LOCAL_INCLUDES += [
DEFINES['INET'] = 1
DEFINES['SCTP_DEBUG'] = 1
-
-if CONFIG['OS_TARGET'] != 'Android':
- DEFINES['INET6'] = 1
+DEFINES['INET6'] = 1
if CONFIG['OS_TARGET'] == 'WINNT':
DEFINES['__Userspace_os_Windows'] = 1
diff --git a/netwerk/sctp/src/ifaddrs-android-ext.h b/netwerk/sctp/src/ifaddrs-android-ext.h
deleted file mode 100644
index abddae735..000000000
--- a/netwerk/sctp/src/ifaddrs-android-ext.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef IFADDRS_ANDROID_EXT_H_included
-#define IFADDRS_ANDROID_EXT_H_included
-
-#include <arpa/inet.h>
-#include <errno.h>
-#include <net/if.h>
-#include <netinet/in.h>
-#include <sys/ioctl.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <stdio.h>
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
-
-// Android (bionic) doesn't have getifaddrs(3)/freeifaddrs(3).
-// We fake it here, so java_net_NetworkInterface.cpp can use that API
-// with all the non-portable code being in this file.
-
-// Source-compatible subset of the BSD struct.
-typedef struct ifaddrs {
- // Pointer to next struct in list, or NULL at end.
- struct ifaddrs* ifa_next;
-
- // Interface name.
- char* ifa_name;
-
- // Interface flags.
- unsigned int ifa_flags;
-
- // Interface network address.
- struct sockaddr* ifa_addr;
-
- // Interface netmask.
- struct sockaddr* ifa_netmask;
-} ifaddrs;
-
-#ifdef __cplusplus
-extern "C" {
-#endif
- int getifaddrs(ifaddrs** result);
- void freeifaddrs(ifaddrs* addresses);
-#ifdef __cplusplus
-}
-#endif
-
-#endif // IFADDRS_ANDROID_H_included
diff --git a/netwerk/sctp/src/ifaddrs_android.cpp b/netwerk/sctp/src/ifaddrs_android.cpp
deleted file mode 100644
index 78eb90a1a..000000000
--- a/netwerk/sctp/src/ifaddrs_android.cpp
+++ /dev/null
@@ -1,189 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/*
- * Copyright (C) 2009 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include "ifaddrs-android-ext.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include "ScopedFd.h"
-#include "LocalArray.h"
-
-// Returns a pointer to the first byte in the address data (which is
-// stored in network byte order).
-uint8_t* sockaddrBytes(int family, sockaddr_storage* ss) {
- if (family == AF_INET) {
- sockaddr_in* ss4 = reinterpret_cast<sockaddr_in*>(ss);
- return reinterpret_cast<uint8_t*>(&ss4->sin_addr);
- } else if (family == AF_INET6) {
- sockaddr_in6* ss6 = reinterpret_cast<sockaddr_in6*>(ss);
- return reinterpret_cast<uint8_t*>(&ss6->sin6_addr);
- }
- return NULL;
-}
-
-// Sadly, we can't keep the interface index for portability with BSD.
-// We'll have to keep the name instead, and re-query the index when
-// we need it later.
-bool ifa_setNameAndFlagsByIndex(ifaddrs *self, int interfaceIndex) {
- // Get the name.
- char buf[IFNAMSIZ];
- char* name = if_indextoname(interfaceIndex, buf);
- if (name == NULL) {
- return false;
- }
- self->ifa_name = new char[strlen(name) + 1];
- strcpy(self->ifa_name, name);
-
- // Get the flags.
- ScopedFd fd(socket(AF_INET, SOCK_DGRAM, 0));
- if (fd.get() == -1) {
- return false;
- }
- ifreq ifr;
- memset(&ifr, 0, sizeof(ifr));
- strcpy(ifr.ifr_name, name);
- int rc = ioctl(fd.get(), SIOCGIFFLAGS, &ifr);
- if (rc == -1) {
- return false;
- }
- self->ifa_flags = ifr.ifr_flags;
- return true;
-}
-
-// Netlink gives us the address family in the header, and the
-// sockaddr_in or sockaddr_in6 bytes as the payload. We need to
-// stitch the two bits together into the sockaddr that's part of
-// our portable interface.
-void ifa_setAddress(ifaddrs *self, int family, void* data, size_t byteCount) {
- // Set the address proper...
- sockaddr_storage* ss = new sockaddr_storage;
- memset(ss, 0, sizeof(*ss));
- self->ifa_addr = reinterpret_cast<sockaddr*>(ss);
- ss->ss_family = family;
- uint8_t* dst = sockaddrBytes(family, ss);
- memcpy(dst, data, byteCount);
-}
-
-// Netlink gives us the prefix length as a bit count. We need to turn
-// that into a BSD-compatible netmask represented by a sockaddr*.
-void ifa_setNetmask(ifaddrs *self, int family, size_t prefixLength) {
- // ...and work out the netmask from the prefix length.
- sockaddr_storage* ss = new sockaddr_storage;
- memset(ss, 0, sizeof(*ss));
- self->ifa_netmask = reinterpret_cast<sockaddr*>(ss);
- ss->ss_family = family;
- uint8_t* dst = sockaddrBytes(family, ss);
- memset(dst, 0xff, prefixLength / 8);
- if ((prefixLength % 8) != 0) {
- dst[prefixLength/8] = (0xff << (8 - (prefixLength % 8)));
- }
-}
-
-// FIXME: use iovec instead.
-struct addrReq_struct {
- nlmsghdr netlinkHeader;
- ifaddrmsg msg;
-};
-
-inline bool sendNetlinkMessage(int fd, const void* data, size_t byteCount) {
- ssize_t sentByteCount = TEMP_FAILURE_RETRY(send(fd, data, byteCount, 0));
- return (sentByteCount == static_cast<ssize_t>(byteCount));
-}
-
-inline ssize_t recvNetlinkMessage(int fd, char* buf, size_t byteCount) {
- return TEMP_FAILURE_RETRY(recv(fd, buf, byteCount, 0));
-}
-
-// Source-compatible with the BSD function.
-int getifaddrs(ifaddrs** result)
-{
- // Simplify cleanup for callers.
- *result = NULL;
-
- // Create a netlink socket.
- ScopedFd fd(socket(AF_NETLINK, SOCK_DGRAM, NETLINK_ROUTE));
- if (fd.get() < 0) {
- return -1;
- }
-
- // Ask for the address information.
- addrReq_struct addrRequest;
- memset(&addrRequest, 0, sizeof(addrRequest));
- addrRequest.netlinkHeader.nlmsg_flags = NLM_F_REQUEST | NLM_F_MATCH;
- addrRequest.netlinkHeader.nlmsg_type = RTM_GETADDR;
- addrRequest.netlinkHeader.nlmsg_len = NLMSG_ALIGN(NLMSG_LENGTH(sizeof(addrRequest)));
- addrRequest.msg.ifa_family = AF_UNSPEC; // All families.
- addrRequest.msg.ifa_index = 0; // All interfaces.
- if (!sendNetlinkMessage(fd.get(), &addrRequest, addrRequest.netlinkHeader.nlmsg_len)) {
- return -1;
- }
-
- // Read the responses.
- LocalArray<0> buf(65536); // We don't necessarily have std::vector.
- ssize_t bytesRead;
- while ((bytesRead = recvNetlinkMessage(fd.get(), &buf[0], buf.size())) > 0) {
- nlmsghdr* hdr = reinterpret_cast<nlmsghdr*>(&buf[0]);
- for (; NLMSG_OK(hdr, (size_t)bytesRead); hdr = NLMSG_NEXT(hdr, bytesRead)) {
- switch (hdr->nlmsg_type) {
- case NLMSG_DONE:
- return 0;
- case NLMSG_ERROR:
- return -1;
- case RTM_NEWADDR:
- {
- ifaddrmsg* address = reinterpret_cast<ifaddrmsg*>(NLMSG_DATA(hdr));
- rtattr* rta = IFA_RTA(address);
- size_t ifaPayloadLength = IFA_PAYLOAD(hdr);
- while (RTA_OK(rta, ifaPayloadLength)) {
- if (rta->rta_type == IFA_LOCAL) {
- int family = address->ifa_family;
- if (family == AF_INET || family == AF_INET6) {
- ifaddrs *next = *result;
- *result = new ifaddrs;
- memset(*result, 0, sizeof(ifaddrs));
- (*result)->ifa_next = next;
- if (!ifa_setNameAndFlagsByIndex(*result, address->ifa_index)) {
- return -1;
- }
- ifa_setAddress(*result, family, RTA_DATA(rta), RTA_PAYLOAD(rta));
- ifa_setNetmask(*result, family, address->ifa_prefixlen);
- }
- }
- rta = RTA_NEXT(rta, ifaPayloadLength);
- }
- }
- break;
- }
- }
- }
- // We only get here if recv fails before we see a NLMSG_DONE.
- return -1;
-}
-
-// Source-compatible with the BSD function.
-void freeifaddrs(ifaddrs* addresses) {
- ifaddrs* self = addresses;
- while (self != NULL) {
- delete[] self->ifa_name;
- delete self->ifa_addr;
- delete self->ifa_netmask;
- ifaddrs* next = self->ifa_next;
- delete self;
- self = next;
- }
-}
diff --git a/netwerk/sctp/src/moz.build b/netwerk/sctp/src/moz.build
index f24702fee..40a91eec1 100644
--- a/netwerk/sctp/src/moz.build
+++ b/netwerk/sctp/src/moz.build
@@ -34,11 +34,6 @@ SOURCES += [
'user_socket.c',
]
-if CONFIG['OS_TARGET'] == 'Android':
- SOURCES += [
- 'ifaddrs_android.cpp',
- ]
-
Library('nksctp_s')
include('/ipc/chromium/chromium-config.mozbuild')
@@ -58,16 +53,11 @@ for var in ('SCTP_SIMPLE_ALLOCATOR',
'CALLBACK_API', 'SCTP_DEBUG'):
DEFINES[var] = 1
-# Android NDK r5c, used on the builders at the time of this writing, doesn't
-# have the headers we need for IPv6
-if CONFIG['OS_TARGET'] != 'Android':
- DEFINES['INET6'] = 1
+DEFINES['INET6'] = 1
if CONFIG['OS_TARGET'] == 'WINNT':
DEFINES['__Userspace_os_Windows'] = 1
DEFINES['_LIB'] = 1
-elif CONFIG['OS_TARGET'] == 'Android':
- DEFINES['__Userspace_os_Linux'] = 1
else:
DEFINES['__Userspace_os_%s' % CONFIG['OS_TARGET']] = 1
@@ -75,7 +65,7 @@ if CONFIG['OS_TARGET'] == 'Darwin':
DEFINES['__APPLE_USE_RFC_2292'] = 1
DEFINES['__APPLE__'] = False
-if CONFIG['OS_TARGET'] in ('Linux', 'Android'):
+if CONFIG['OS_TARGET'] == 'Linux':
# to make sure that in6_pktinfo gets defined on all distros
DEFINES['_GNU_SOURCE'] = True
diff --git a/netwerk/sctp/src/netinet/sctp.h b/netwerk/sctp/src/netinet/sctp.h
index a5ff4eb0b..962ce1140 100755
--- a/netwerk/sctp/src/netinet/sctp.h
+++ b/netwerk/sctp/src/netinet/sctp.h
@@ -32,7 +32,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp.h 279859 2015-03-10 19:49:25Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp.h 356270 2020-01-02 13:55:10Z tuexen $");
#endif
#ifndef _NETINET_SCTP_H_
@@ -598,7 +598,10 @@ struct sctp_error_no_user_data {
#define SCTP_MOBILITY_PRIM_DELETED 0x00000004
-#define SCTP_SMALLEST_PMTU 512 /* smallest pmtu allowed when disabling PMTU discovery */
+/* Smallest PMTU allowed when disabling PMTU discovery */
+#define SCTP_SMALLEST_PMTU 512
+/* Largest PMTU allowed when disabling PMTU discovery */
+#define SCTP_LARGEST_PMTU 65536
#if defined(__Userspace_os_Windows)
#pragma pack()
diff --git a/netwerk/sctp/src/netinet/sctp_auth.c b/netwerk/sctp/src/netinet/sctp_auth.c
index ee5ca36ce..4e9f7e4cd 100755
--- a/netwerk/sctp/src/netinet/sctp_auth.c
+++ b/netwerk/sctp/src/netinet/sctp_auth.c
@@ -32,7 +32,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.c 271673 2014-09-16 14:20:33Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_auth.c 355931 2019-12-20 15:25:08Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -1450,7 +1450,8 @@ sctp_auth_get_cookie_params(struct sctp_tcb *stcb, struct mbuf *m,
ptype = ntohs(phdr->param_type);
plen = ntohs(phdr->param_length);
- if ((plen == 0) || (offset + plen > length))
+ if ((plen < sizeof(struct sctp_paramhdr)) ||
+ (offset + plen > length))
break;
if (ptype == SCTP_RANDOM) {
diff --git a/netwerk/sctp/src/netinet/sctp_bsd_addr.c b/netwerk/sctp/src/netinet/sctp_bsd_addr.c
index 292941b53..f79b9ebb1 100755
--- a/netwerk/sctp/src/netinet/sctp_bsd_addr.c
+++ b/netwerk/sctp/src/netinet/sctp_bsd_addr.c
@@ -48,14 +48,10 @@ __FBSDID("$FreeBSD: head/sys/netinet/sctp_bsd_addr.c 276914 2015-01-10 20:49:57Z
#include <netinet/sctp_asconf.h>
#include <netinet/sctp_sysctl.h>
#include <netinet/sctp_indata.h>
-#if defined(ANDROID)
-#include <unistd.h>
-#include <ifaddrs-android-ext.h>
-#else
+
#if defined(__FreeBSD__)
#include <sys/unistd.h>
#endif
-#endif
/* Declare all of our malloc named types */
#ifndef __Panda__
diff --git a/netwerk/sctp/src/netinet/sctp_os_userspace.h b/netwerk/sctp/src/netinet/sctp_os_userspace.h
index bf4a3b519..13df42423 100755
--- a/netwerk/sctp/src/netinet/sctp_os_userspace.h
+++ b/netwerk/sctp/src/netinet/sctp_os_userspace.h
@@ -495,7 +495,7 @@ struct sx {int dummy;};
/* for getifaddrs */
#include <sys/types.h>
#if !defined(__Userspace_os_Windows)
-#if !defined(ANDROID) && (defined(INET) || defined(INET6))
+#if defined(INET) || defined(INET6)
#include <ifaddrs.h>
#endif
diff --git a/netwerk/sctp/src/netinet/sctp_pcb.c b/netwerk/sctp/src/netinet/sctp_pcb.c
index 58c164f50..ea5725c85 100755
--- a/netwerk/sctp/src/netinet/sctp_pcb.c
+++ b/netwerk/sctp/src/netinet/sctp_pcb.c
@@ -32,7 +32,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 280459 2015-03-24 21:12:45Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_pcb.c 355931 2019-12-20 15:25:08Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -7213,7 +7213,7 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
if (offset + plen > limit) {
break;
}
- if (plen == 0) {
+ if (plen < sizeof(struct sctp_paramhdr)) {
break;
}
#ifdef INET
@@ -7413,6 +7413,9 @@ sctp_load_addresses_from_init(struct sctp_tcb *stcb, struct mbuf *m,
if (plen > sizeof(lstore)) {
return (-23);
}
+ if (plen < sizeof(struct sctp_asconf_addrv4_param)) {
+ return (-101);
+ }
phdr = sctp_get_next_param(m, offset,
(struct sctp_paramhdr *)&lstore,
min(plen,sizeof(lstore)));
diff --git a/netwerk/sctp/src/netinet/sctp_usrreq.c b/netwerk/sctp/src/netinet/sctp_usrreq.c
index d24a21815..7ffd8e8c8 100755
--- a/netwerk/sctp/src/netinet/sctp_usrreq.c
+++ b/netwerk/sctp/src/netinet/sctp_usrreq.c
@@ -32,7 +32,7 @@
#ifdef __FreeBSD__
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 280459 2015-03-24 21:12:45Z tuexen $");
+__FBSDID("$FreeBSD: head/sys/netinet/sctp_usrreq.c 356270 2020-01-02 13:55:10Z tuexen $");
#endif
#include <netinet/sctp_os.h>
@@ -5995,6 +5995,14 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
return (EINVAL);
}
+ if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) &&
+ ((paddrp->spp_pathmtu < SCTP_SMALLEST_PMTU) ||
+ (paddrp->spp_pathmtu > SCTP_LARGEST_PMTU))) {
+ if (stcb)
+ SCTP_TCB_UNLOCK(stcb);
+ SCTP_LTRACE_ERR_RET(inp, NULL, NULL, SCTP_FROM_SCTP_USRREQ, EINVAL);
+ return (EINVAL);
+ }
if (stcb != NULL) {
/************************TCB SPECIFIC SET ******************/
@@ -6038,7 +6046,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
sctp_chunk_output(inp, stcb, SCTP_OUTPUT_FROM_SOCKOPT, SCTP_SO_LOCKED);
sctp_timer_start(SCTP_TIMER_TYPE_HEARTBEAT, inp, stcb, net);
}
- if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) {
+ if (paddrp->spp_flags & SPP_PMTUD_DISABLE) {
if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) {
sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net,
SCTP_FROM_SCTP_USRREQ+SCTP_LOC_10);
@@ -6160,7 +6168,7 @@ sctp_setopt(struct socket *so, int optname, void *optval, size_t optsize,
}
sctp_stcb_feature_on(inp, stcb, SCTP_PCB_FLAGS_DONOT_HEARTBEAT);
}
- if ((paddrp->spp_flags & SPP_PMTUD_DISABLE) && (paddrp->spp_pathmtu >= SCTP_SMALLEST_PMTU)) {
+ if (paddrp->spp_flags & SPP_PMTUD_DISABLE) {
TAILQ_FOREACH(net, &stcb->asoc.nets, sctp_next) {
if (SCTP_OS_TIMER_PENDING(&net->pmtu_timer.timer)) {
sctp_timer_stop(SCTP_TIMER_TYPE_PATHMTURAISE, inp, stcb, net,
diff --git a/netwerk/system/android/moz.build b/netwerk/system/android/moz.build
deleted file mode 100644
index 68288ad10..000000000
--- a/netwerk/system/android/moz.build
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SOURCES += [
- 'nsAndroidNetworkLinkService.cpp',
-]
-
-FINAL_LIBRARY = 'xul'
-LOCAL_INCLUDES += [
- '/netwerk/base',
-]
diff --git a/netwerk/system/android/nsAndroidNetworkLinkService.cpp b/netwerk/system/android/nsAndroidNetworkLinkService.cpp
deleted file mode 100644
index 692b69a7e..000000000
--- a/netwerk/system/android/nsAndroidNetworkLinkService.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsAndroidNetworkLinkService.h"
-#include "nsServiceManagerUtils.h"
-#include "mozilla/Services.h"
-
-#include "AndroidBridge.h"
-
-namespace java = mozilla::java;
-
-NS_IMPL_ISUPPORTS(nsAndroidNetworkLinkService,
- nsINetworkLinkService)
-
-nsAndroidNetworkLinkService::nsAndroidNetworkLinkService()
-{
-}
-
-nsAndroidNetworkLinkService::~nsAndroidNetworkLinkService()
-{
-}
-
-NS_IMETHODIMP
-nsAndroidNetworkLinkService::GetIsLinkUp(bool *aIsUp)
-{
- if (!mozilla::AndroidBridge::Bridge()) {
- // Fail soft here and assume a connection exists
- NS_WARNING("GetIsLinkUp is not supported without a bridge connection");
- *aIsUp = true;
- return NS_OK;
- }
-
- *aIsUp = java::GeckoAppShell::IsNetworkLinkUp();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAndroidNetworkLinkService::GetLinkStatusKnown(bool *aIsKnown)
-{
- NS_ENSURE_TRUE(mozilla::AndroidBridge::Bridge(), NS_ERROR_NOT_IMPLEMENTED);
-
- *aIsKnown = java::GeckoAppShell::IsNetworkLinkKnown();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAndroidNetworkLinkService::GetLinkType(uint32_t *aLinkType)
-{
- NS_ENSURE_ARG_POINTER(aLinkType);
-
- if (!mozilla::AndroidBridge::Bridge()) {
- // Fail soft here and assume a connection exists
- NS_WARNING("GetLinkType is not supported without a bridge connection");
- *aLinkType = nsINetworkLinkService::LINK_TYPE_UNKNOWN;
- return NS_OK;
- }
-
- *aLinkType = java::GeckoAppShell::GetNetworkLinkType();
- return NS_OK;
-}
diff --git a/netwerk/system/android/nsAndroidNetworkLinkService.h b/netwerk/system/android/nsAndroidNetworkLinkService.h
deleted file mode 100644
index 9fdda7cae..000000000
--- a/netwerk/system/android/nsAndroidNetworkLinkService.h
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef NSANDROIDNETWORKLINKSERVICE_H_
-#define NSANDROIDNETWORKLINKSERVICE_H_
-
-#include "nsINetworkLinkService.h"
-
-class nsAndroidNetworkLinkService: public nsINetworkLinkService
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSINETWORKLINKSERVICE
-
- nsAndroidNetworkLinkService();
-
-private:
- virtual ~nsAndroidNetworkLinkService();
-};
-
-#endif /* NSANDROIDNETWORKLINKSERVICE_H_ */
diff --git a/netwerk/system/moz.build b/netwerk/system/moz.build
index 08c41342b..66360bb63 100644
--- a/netwerk/system/moz.build
+++ b/netwerk/system/moz.build
@@ -6,12 +6,7 @@
if CONFIG['OS_ARCH'] == 'WINNT':
DIRS += ['win32']
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
DIRS += ['mac']
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- DIRS += ['android']
-
elif CONFIG['OS_ARCH'] == 'Linux':
DIRS += ['linux']
diff --git a/old-configure.in b/old-configure.in
index a98951937..86cf2ae18 100644
--- a/old-configure.in
+++ b/old-configure.in
@@ -2005,26 +2005,9 @@ esac
MOZ_CONFIG_NSPR()
-dnl ========================================================
-dnl = If NSS was not detected in the system,
-dnl = use the one in the source tree (mozilla/security/nss)
-dnl ========================================================
-
-MOZ_ARG_WITH_BOOL(system-nss,
-[ --with-system-nss Use system installed NSS],
- _USE_SYSTEM_NSS=1 )
-
-if test -n "$_USE_SYSTEM_NSS"; then
- AC_MSG_ERROR([Building with system NSS is currently not supported.])
-fi
-
-if test -n "$_USE_SYSTEM_NSS"; then
- AM_PATH_NSS(3.41, [MOZ_SYSTEM_NSS=1], [AC_MSG_ERROR([you don't have NSS installed or your version is too old])])
-fi
-
-if test -z "$MOZ_SYSTEM_NSS"; then
- NSS_CFLAGS="-I${DIST}/include/nss"
-fi
+# TODO: We need to find a better place to define this include
+NSS_CFLAGS="-I${DIST}/include/nss"
+AC_SUBST(NSS_CFLAGS)
if test -z "$SKIP_LIBRARY_CHECKS"; then
dnl system JPEG support
@@ -2109,51 +2092,6 @@ if test "${BZ2_DIR}" -a -d "${BZ2_DIR}" -a "$MOZ_SYSTEM_BZ2" = 1; then
MOZ_BZ2_LIBS="-L${BZ2_DIR}/lib ${MOZ_BZ2_LIBS}"
fi
-dnl ========================================================
-dnl system PNG Support
-dnl ========================================================
-MOZ_ARG_WITH_STRING(system-png,
-[ --with-system-png[=PFX]
- Use system libpng [installed at prefix PFX]],
- PNG_DIR=$withval)
-
-_SAVE_CFLAGS=$CFLAGS
-_SAVE_LDFLAGS=$LDFLAGS
-_SAVE_LIBS=$LIBS
-if test -n "${PNG_DIR}" -a "${PNG_DIR}" != "yes"; then
- CFLAGS="-I${PNG_DIR}/include $CFLAGS"
- LDFLAGS="-L${PNG_DIR}/lib $LDFLAGS"
-fi
-if test -z "$PNG_DIR" -o "$PNG_DIR" = no; then
- MOZ_SYSTEM_PNG=
-else
- AC_CHECK_LIB(png, png_get_valid, [MOZ_SYSTEM_PNG=1 MOZ_PNG_LIBS="-lpng"],
- AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
- AC_CHECK_LIB(png, png_get_acTL, ,
- AC_MSG_ERROR([--with-system-png won't work because the system's libpng doesn't have APNG support]))
-fi
-if test "$MOZ_SYSTEM_PNG" = 1; then
- AC_TRY_COMPILE([ #include <stdio.h>
- #include <sys/types.h>
- #include <png.h> ],
- [ #if PNG_LIBPNG_VER < $MOZPNG
- #error "Insufficient libpng version ($MOZPNG required)."
- #endif
- #ifndef PNG_UINT_31_MAX
- #error "Insufficient libpng version."
- #endif ],
- MOZ_SYSTEM_PNG=1,
- AC_MSG_ERROR([--with-system-png requested but no working libpng found]))
-fi
-CFLAGS=$_SAVE_CFLAGS
-LDFLAGS=$_SAVE_LDFLAGS
-LIBS=$_SAVE_LIBS
-
-if test "${PNG_DIR}" -a -d "${PNG_DIR}" -a "$MOZ_SYSTEM_PNG" = 1; then
- MOZ_PNG_CFLAGS="-I${PNG_DIR}/include"
- MOZ_PNG_LIBS="-L${PNG_DIR}/lib ${MOZ_PNG_LIBS}"
-fi
-
fi # SKIP_LIBRARY_CHECKS
dnl ========================================================
@@ -2218,9 +2156,11 @@ MOZ_JETPACK=1
MOZ_DEVTOOLS_SERVER=1
MOZ_DEVTOOLS=
MOZ_PLACES=1
+MOZ_SECURITY_SQLSTORE=
MOZ_SERVICES_HEALTHREPORT=1
MOZ_SERVICES_SYNC=1
MOZ_USERINFO=1
+NSS_DISABLE_DBM=
MOZ_MAILNEWS=
MOZ_MAILNEWS_OAUTH2=
MOZ_LDAP_XPCOM=
@@ -2289,19 +2229,6 @@ else
AC_MSG_RESULT([no])
fi
-# Allow influencing configure with a defines.sh script.
-. "${srcdir}/build/defines.sh"
-
-# If we're not building a release build, define EARLY_BETA_OR_EARLIER if it is
-# set in defines.sh
-if test "$BUILDING_RELEASE"; then
- # Override value in defines.sh, if any
- EARLY_BETA_OR_EARLIER=
-elif test "$EARLY_BETA_OR_EARLIER"; then
- AC_DEFINE(EARLY_BETA_OR_EARLIER)
-fi
-AC_SUBST(EARLY_BETA_OR_EARLIER)
-
# Allow someone to change MOZ_APP_NAME and MOZ_APP_BASENAME in mozconfig
MOZ_ARG_WITH_STRING(app-name,
[--with-app-name=APPNAME sets MOZ_APP_NAME to APPNAME],
@@ -2775,6 +2702,40 @@ x86_64 | arm | aarch64 | x86 | ppc* | ia64)
esac
dnl =========================================================
+dnl = NSS DBM (BerkeleyDB) Support
+dnl = NOTE: Because we don't expressly control the name of
+dnl = this var --disable-dbm means NSS_DISABLE_DBM=1
+dnl =========================================================
+MOZ_ARG_DISABLE_BOOL(dbm,
+[ --disable-dbm Disable DBM support in nss],
+ NSS_DISABLE_DBM=1,
+ NSS_DISABLE_DBM=)
+
+if test -n "$NSS_DISABLE_DBM"; then
+ AC_DEFINE(NSS_DISABLE_DBM)
+fi
+
+AC_SUBST(NSS_DISABLE_DBM)
+
+dnl =========================================================
+dnl = NSS SQL storage format
+dnl =========================================================
+MOZ_ARG_ENABLE_BOOL(security-sqlstore,
+[ --enable-security-sqlstore Enable the use of SQL storage for NSS],
+ MOZ_SECURITY_SQLSTORE=1,
+ MOZ_SECURITY_SQLSTORE=)
+
+if test -n "$NSS_DISABLE_DBM" -a -z "$MOZ_SECURITY_SQLSTORE"; then
+ AC_MSG_ERROR([DBM storage support is required if not using NSS SQL storage])
+fi
+
+if test -n "$MOZ_SECURITY_SQLSTORE"; then
+ AC_DEFINE(MOZ_SECURITY_SQLSTORE)
+fi
+
+AC_SUBST(MOZ_SECURITY_SQLSTORE)
+
+dnl =========================================================
dnl = Don't fold mailnews related comps into libXUL
dnl =========================================================
MOZ_ARG_ENABLE_BOOL(incomplete-external-linkage,
@@ -2954,25 +2915,12 @@ dnl ========================================================
dnl = EME support
dnl ========================================================
-MOZ_ARG_ENABLE_STRING(eme,
-[ --enable-eme[=widevine] Enable support for Encrypted Media Extensions ],
- MOZ_EME_ARGS=$enableval)
+MOZ_ARG_ENABLE_BOOL(eme,
+[ --enable-eme Enable support for Encrypted Media Extensions ],
+ MOZ_EME=1,
+ MOZ_EME=)
-if test "$MOZ_EME_ARGS"; then
- if test "$MOZ_EME_ARGS" = "no"; then
- dnl EME explicitly disabled with --disable-eme
- MOZ_EME=
- elif test "$MOZ_EME_ARGS" = "yes"; then
- dnl EME explicitly enabled with --enable-eme
- MOZ_EME=1
- else
- dnl EME explicitly enabled with --enable-eme=<args>
- MOZ_EME=1
- MOZ_EME_MODULES=`echo $MOZ_EME_ARGS | sed -e 's/,/ /g'`
- fi
-fi
-AC_SUBST_SET(MOZ_EME_MODULES)
if test -n "$MOZ_EME"; then
if test -z "$MOZ_FMP4"; then
AC_MSG_ERROR([Encrypted Media Extension support requires Fragmented MP4 support])
@@ -2980,12 +2928,7 @@ if test -n "$MOZ_EME"; then
AC_DEFINE(MOZ_EME)
fi
-dnl ========================================================
-dnl system libvpx Support
-dnl ========================================================
-MOZ_ARG_WITH_BOOL(system-libvpx,
-[ --with-system-libvpx Use system libvpx (located with pkgconfig)],
- MOZ_SYSTEM_LIBVPX=1)
+AC_SUBST(MOZ_EME)
MOZ_LIBVPX_CFLAGS=
MOZ_LIBVPX_LIBS=
@@ -2994,35 +2937,6 @@ if test -n "$MOZ_VPX_ERROR_CONCEALMENT" ; then
AC_DEFINE(MOZ_VPX_ERROR_CONCEALMENT)
fi
-_SAVE_CFLAGS=$CFLAGS
-_SAVE_LIBS=$LIBS
-if test -n "$MOZ_SYSTEM_LIBVPX"; then
- dnl ============================
- dnl === libvpx Version check ===
- dnl ============================
- dnl Check to see if we have a system libvpx package.
- PKG_CHECK_MODULES(MOZ_LIBVPX, vpx >= 1.5.0)
-
- CFLAGS="$CFLAGS $MOZ_LIBVPX_CFLAGS"
- LIBS="$LIBS $MOZ_LIBVPX_LIBS"
-
- MOZ_CHECK_HEADER([vpx/vpx_decoder.h], [],
- [AC_MSG_ERROR([Couldn't find vpx/vpx_decoder.h which is required for build with system libvpx. Use --without-system-libvpx to build with in-tree libvpx.])])
-
- AC_CHECK_LIB(vpx, vpx_codec_dec_init_ver, [],
- [AC_MSG_ERROR([--with-system-libvpx requested but symbol vpx_codec_dec_init_ver not found])])
-
- MOZ_CHECK_HEADER([vpx_mem/vpx_mem.h],
- [AC_CHECK_FUNC(vpx_mem_set_functions)])
- if test "$ac_cv_header_vpx_mem_vpx_mem_h" = no -o \
- "$ac_cv_func_vpx_mem_set_functions" = no; then
- AC_DEFINE(MOZ_VPX_NO_MEM_REPORTING)
- fi
-fi
-CFLAGS=$_SAVE_CFLAGS
-LIBS=$_SAVE_LIBS
-
-AC_SUBST(MOZ_SYSTEM_LIBVPX)
AC_SUBST_LIST(MOZ_LIBVPX_CFLAGS)
AC_SUBST_LIST(MOZ_LIBVPX_LIBS)
@@ -3778,175 +3692,6 @@ else
fi
dnl ========================================================
-dnl Check for sqlite
-dnl ========================================================
-
-MOZ_SYSTEM_SQLITE=
-MOZ_ARG_ENABLE_BOOL(system-sqlite,
-[ --enable-system-sqlite Use system sqlite (located with pkgconfig)],
-MOZ_SYSTEM_SQLITE=1,
-MOZ_SYSTEM_SQLITE= )
-
-if test -n "$MOZ_SYSTEM_SQLITE"
-then
- dnl ============================
- dnl === SQLite Version check ===
- dnl ============================
- dnl Check to see if the system SQLite package is new enough.
- PKG_CHECK_MODULES(SQLITE, sqlite3 >= $SQLITE_VERSION)
-
- dnl ==================================
- dnl === SQLITE_SECURE_DELETE check ===
- dnl ==================================
- dnl Check to see if the system SQLite package is compiled with
- dnl SQLITE_SECURE_DELETE enabled.
- AC_MSG_CHECKING(for SQLITE_SECURE_DELETE support in system SQLite)
- _SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $SQLITE_CFLAGS"
- _SAVE_LIBS="$LIBS"
- LIBS="$LIBS $SQLITE_LIBS"
- AC_CACHE_VAL(ac_cv_sqlite_secure_delete,[
- AC_TRY_RUN([
- #include "sqlite3.h"
-
- int main(int argc, char **argv){
- return !sqlite3_compileoption_used("SQLITE_SECURE_DELETE");
- }],
- ac_cv_sqlite_secure_delete=yes,
- ac_cv_sqlite_secure_delete=no,
- ac_cv_sqlite_secure_delete=no
- )
- ])
- AC_MSG_RESULT($ac_cv_sqlite_secure_delete)
- CFLAGS="$_SAVE_CFLAGS"
- LIBS="$_SAVE_LIBS"
- if test "x$ac_cv_sqlite_secure_delete" = "xno"; then
- AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_SECURE_DELETE.])
- fi
-
- dnl ===============================
- dnl === SQLITE_THREADSAFE check ===
- dnl ===============================
- dnl Check to see if the system SQLite package is compiled with
- dnl SQLITE_THREADSAFE enabled.
- AC_MSG_CHECKING(for SQLITE_THREADSAFE support in system SQLite)
- _SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $SQLITE_CFLAGS"
- _SAVE_LIBS="$LIBS"
- LIBS="$LIBS $SQLITE_LIBS"
- AC_CACHE_VAL(ac_cv_sqlite_threadsafe,[
- AC_TRY_RUN([
- #include "sqlite3.h"
-
- int main(int argc, char **argv){
- return !sqlite3_compileoption_used("SQLITE_THREADSAFE=1");
- }],
- ac_cv_sqlite_threadsafe=yes,
- ac_cv_sqlite_threadsafe=no,
- ac_cv_sqlite_threadsafe=no
- )
- ])
- AC_MSG_RESULT($ac_cv_sqlite_threadsafe)
- CFLAGS="$_SAVE_CFLAGS"
- LIBS="$_SAVE_LIBS"
- if test "x$ac_cv_sqlite_threadsafe" = "xno"; then
- AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_THREADSAFE.])
- fi
-
- dnl ================================
- dnl === SQLITE_ENABLE_FTS3 check ===
- dnl ================================
- dnl check to see if the system SQLite package is compiled with
- dnl SQLITE_ENABLE_FTS3 enabled.
- AC_MSG_CHECKING(for SQLITE_ENABLE_FTS3 support in system SQLite)
- _SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $SQLITE_CFLAGS"
- _SAVE_LIBS="$LIBS"
- LIBS="$LIBS $SQLITE_LIBS"
- AC_CACHE_VAL(ac_cv_sqlite_enable_fts3,[
- AC_TRY_RUN([
- #include "sqlite3.h"
-
- int main(int argc, char **argv){
- return !sqlite3_compileoption_used("SQLITE_ENABLE_FTS3");
- }],
- ac_cv_sqlite_enable_fts3=yes,
- ac_cv_sqlite_enable_fts3=no,
- ac_cv_sqlite_enable_fts3=no
- )
- ])
- AC_MSG_RESULT($ac_cv_sqlite_enable_fts3)
- CFLAGS="$_SAVE_CFLAGS"
- LIBS="$_SAVE_LIBS"
- if test "x$ac_cv_sqlite_enable_fts3" = "xno"; then
- AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_FTS3.])
- fi
-
- dnl =========================================
- dnl === SQLITE_ENABLE_UNLOCK_NOTIFY check ===
- dnl =========================================
- dnl check to see if the system SQLite package is compiled with
- dnl SQLITE_ENABLE_UNLOCK_NOTIFY enabled.
- AC_MSG_CHECKING(for SQLITE_ENABLE_UNLOCK_NOTIFY support in system SQLite)
- _SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $SQLITE_CFLAGS"
- _SAVE_LIBS="$LIBS"
- LIBS="$LIBS $SQLITE_LIBS"
- AC_CACHE_VAL(ac_cv_sqlite_enable_unlock_notify,[
- AC_TRY_RUN([
- #include "sqlite3.h"
-
- int main(int argc, char **argv){
- return !sqlite3_compileoption_used("SQLITE_ENABLE_UNLOCK_NOTIFY");
- }],
- ac_cv_sqlite_enable_unlock_notify=yes,
- ac_cv_sqlite_enable_unlock_notify=no,
- ac_cv_sqlite_enable_unlock_notify=no
- )
- ])
- AC_MSG_RESULT($ac_cv_sqlite_enable_unlock_notify)
- CFLAGS="$_SAVE_CFLAGS"
- LIBS="$_SAVE_LIBS"
- if test "x$ac_cv_sqlite_enable_unlock_notify" = "xno"; then
- AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_UNLOCK_NOTIFY.])
- fi
-
- dnl =========================================
- dnl === SQLITE_ENABLE_DBSTAT_VTAB check ===
- dnl =========================================
- dnl check to see if the system SQLite package is compiled with
- dnl SQLITE_ENABLE_DBSTAT_VTAB.
- AC_MSG_CHECKING(for SQLITE_ENABLE_DBSTAT_VTAB support in system SQLite)
- _SAVE_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $SQLITE_CFLAGS"
- _SAVE_LIBS="$LIBS"
- LIBS="$LIBS $SQLITE_LIBS"
- AC_CACHE_VAL(ac_cv_sqlite_dbstat_vtab,[
- AC_TRY_RUN([
- #include "sqlite3.h"
-
- int main(int argc, char **argv){
- return !sqlite3_compileoption_used("SQLITE_ENABLE_DBSTAT_VTAB");
- }],
- ac_cv_sqlite_dbstat_vtab=yes,
- ac_cv_sqlite_dbstat_vtab=no,
- ac_cv_sqlite_dbstat_vtab=no
- )
- ])
- AC_MSG_RESULT($ac_cv_sqlite_dbstat_vtab)
- CFLAGS="$_SAVE_CFLAGS"
- LIBS="$_SAVE_LIBS"
- if test "x$ac_cv_sqlite_dbstat_vtab" = "xno"; then
- AC_MSG_ERROR([System SQLite library is not compiled with SQLITE_ENABLE_DBSTAT_VTAB.])
- fi
-fi
-
-if test -n "$MOZ_SYSTEM_SQLITE"; then
- AC_DEFINE(MOZ_SYSTEM_SQLITE)
-fi
-AC_SUBST(MOZ_SYSTEM_SQLITE)
-
-dnl ========================================================
dnl = Enable Google safe browsing (anti-phishing)
dnl ========================================================
MOZ_ARG_ENABLE_BOOL(safe-browsing,
@@ -5403,10 +5148,6 @@ AC_SUBST_LIST(MOZ_BZ2_LIBS)
AC_SUBST_LIST(MOZ_PNG_CFLAGS)
AC_SUBST_LIST(MOZ_PNG_LIBS)
-AC_SUBST(MOZ_SYSTEM_NSPR)
-
-AC_SUBST(MOZ_SYSTEM_NSS)
-
HOST_CMFLAGS=-fobjc-exceptions
HOST_CMMFLAGS=-fobjc-exceptions
OS_COMPILE_CMFLAGS=-fobjc-exceptions
@@ -5479,7 +5220,6 @@ AC_SUBST(MOZ_VORBIS)
AC_SUBST(MOZ_TREMOR)
AC_SUBST(MOZ_FFVPX)
AC_SUBST_LIST(FFVPX_ASFLAGS)
-AC_SUBST(MOZ_EME)
AC_SUBST(MOZ_VPX_ERROR_CONCEALMENT)
AC_SUBST(VPX_USE_YASM)
AC_SUBST_LIST(VPX_ASFLAGS)
@@ -5586,8 +5326,6 @@ MC_BASILISK=$MC_BASILISK
MC_PALEMOON=$MC_PALEMOON
MOZ_EME=$MOZ_EME
MOZ_WEBRTC=$MOZ_WEBRTC
-MOZ_SYSTEM_NSS=$MOZ_SYSTEM_NSS
-MOZ_SYSTEM_NSPR=$MOZ_SYSTEM_NSPR
MOZ_SYSTEM_JPEG=$MOZ_SYSTEM_JPEG
MOZ_SYSTEM_ZLIB=$MOZ_SYSTEM_ZLIB
MOZ_SYSTEM_BZ2=$MOZ_SYSTEM_BZ2
diff --git a/other-licenses/7zstub/ReleaseD/7zSD.sfx.exe b/other-licenses/7zstub/ReleaseD/7zSD.sfx.exe
index e1e37cf2e..e5a8b0bbc 100644
--- a/other-licenses/7zstub/ReleaseD/7zSD.sfx.exe
+++ b/other-licenses/7zstub/ReleaseD/7zSD.sfx.exe
Binary files differ
diff --git a/other-licenses/7zstub/uxp/7zSD.sfx b/other-licenses/7zstub/uxp/7zSD.sfx
index bcc8ba606..4dab45978 100644
--- a/other-licenses/7zstub/uxp/7zSD.sfx
+++ b/other-licenses/7zstub/uxp/7zSD.sfx
Binary files differ
diff --git a/other-licenses/skia-npapi/ANPCanvas.cpp b/other-licenses/skia-npapi/ANPCanvas.cpp
deleted file mode 100644
index dd227eca8..000000000
--- a/other-licenses/skia-npapi/ANPCanvas.cpp
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * Copyright 2008, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// must include config.h first for webkit to fiddle with new/delete
-#include "SkANP.h"
-#include "SkRect.h"
-
-static ANPCanvas* anp_newCanvas(const ANPBitmap* bitmap) {
- SkBitmap bm;
- return new ANPCanvas(*SkANP::SetBitmap(&bm, *bitmap));
-}
-
-static void anp_deleteCanvas(ANPCanvas* canvas) {
- delete canvas;
-}
-
-static void anp_save(ANPCanvas* canvas) {
- canvas->skcanvas->save();
-}
-
-static void anp_restore(ANPCanvas* canvas) {
- canvas->skcanvas->restore();
-}
-
-static void anp_translate(ANPCanvas* canvas, float tx, float ty) {
- canvas->skcanvas->translate(SkFloatToScalar(tx), SkFloatToScalar(ty));
-}
-
-static void anp_scale(ANPCanvas* canvas, float sx, float sy) {
- canvas->skcanvas->scale(SkFloatToScalar(sx), SkFloatToScalar(sy));
-}
-
-static void anp_rotate(ANPCanvas* canvas, float degrees) {
- canvas->skcanvas->rotate(SkFloatToScalar(degrees));
-}
-
-static void anp_skew(ANPCanvas* canvas, float kx, float ky) {
- canvas->skcanvas->skew(SkFloatToScalar(kx), SkFloatToScalar(ky));
-}
-
-static void anp_clipRect(ANPCanvas* canvas, const ANPRectF* rect) {
- SkRect r;
- canvas->skcanvas->clipRect(*SkANP::SetRect(&r, *rect));
-}
-
-static void anp_clipPath(ANPCanvas* canvas, const ANPPath* path) {
- canvas->skcanvas->clipPath(*path);
-}
-static void anp_concat(ANPCanvas* canvas, const ANPMatrix* matrix) {
- canvas->skcanvas->concat(*matrix);
-}
-
-static void anp_getTotalMatrix(ANPCanvas* canvas, ANPMatrix* matrix) {
- const SkMatrix& src = canvas->skcanvas->getTotalMatrix();
- *matrix = *reinterpret_cast<const ANPMatrix*>(&src);
-}
-
-static bool anp_getLocalClipBounds(ANPCanvas* canvas, ANPRectF* r,
- bool antialias) {
- SkRect bounds;
- if (canvas->skcanvas->getClipBounds(&bounds)) {
- SkANP::SetRect(r, bounds);
- return true;
- }
- return false;
-}
-
-static bool anp_getDeviceClipBounds(ANPCanvas* canvas, ANPRectI* r) {
- SkIRect bounds;
- if (canvas->skcanvas->getClipDeviceBounds(&bounds)) {
- SkANP::SetRect(r, bounds);
- return true;
- }
- return false;
-}
-
-static void anp_drawColor(ANPCanvas* canvas, ANPColor color) {
- canvas->skcanvas->drawColor(color);
-}
-
-static void anp_drawPaint(ANPCanvas* canvas, const ANPPaint* paint) {
- canvas->skcanvas->drawPaint(*paint);
-}
-
-static void anp_drawLine(ANPCanvas* canvas, float x0, float y0,
- float x1, float y1, const ANPPaint* paint) {
- canvas->skcanvas->drawLine(SkFloatToScalar(x0), SkFloatToScalar(y0),
- SkFloatToScalar(x1), SkFloatToScalar(y1), *paint);
-}
-
-static void anp_drawRect(ANPCanvas* canvas, const ANPRectF* rect,
- const ANPPaint* paint) {
- SkRect r;
- canvas->skcanvas->drawRect(*SkANP::SetRect(&r, *rect), *paint);
-}
-
-static void anp_drawOval(ANPCanvas* canvas, const ANPRectF* rect,
- const ANPPaint* paint) {
- SkRect r;
- canvas->skcanvas->drawOval(*SkANP::SetRect(&r, *rect), *paint);
-}
-
-static void anp_drawPath(ANPCanvas* canvas, const ANPPath* path,
- const ANPPaint* paint) {
- canvas->skcanvas->drawPath(*path, *paint);
-}
-
-static void anp_drawText(ANPCanvas* canvas, const void* text, uint32_t length,
- float x, float y, const ANPPaint* paint) {
- canvas->skcanvas->drawText(text, length,
- SkFloatToScalar(x), SkFloatToScalar(y),
- *paint);
-}
-
-static void anp_drawPosText(ANPCanvas* canvas, const void* text,
- uint32_t byteLength, const float xy[], const ANPPaint* paint) {
- canvas->skcanvas->drawPosText(text, byteLength,
- reinterpret_cast<const SkPoint*>(xy), *paint);
-}
-
-static void anp_drawBitmap(ANPCanvas* canvas, const ANPBitmap* bitmap,
- float x, float y, const ANPPaint* paint) {
- SkBitmap bm;
- canvas->skcanvas->drawBitmap(*SkANP::SetBitmap(&bm, *bitmap),
- SkFloatToScalar(x), SkFloatToScalar(y),
- paint);
-}
-
-static void anp_drawBitmapRect(ANPCanvas* canvas, const ANPBitmap* bitmap,
- const ANPRectI* src, const ANPRectF* dst,
- const ANPPaint* paint) {
- SkBitmap bm;
- SkRect dstR;
- SkIRect srcR;
-
- if (src) {
- canvas->skcanvas->drawBitmapRect(*SkANP::SetBitmap(&bm, *bitmap),
- *SkANP::SetRect(&srcR, *src),
- *SkANP::SetRect(&dstR, *dst),
- paint);
- } else {
- canvas->skcanvas->drawBitmapRect(*SkANP::SetBitmap(&bm, *bitmap),
- *SkANP::SetRect(&dstR, *dst),
- paint);
- }
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-#define ASSIGN(obj, name) (obj)->name = anp_##name
-
-void InitCanvasInterface(ANPCanvasInterfaceV0* i) {
- ASSIGN(i, newCanvas);
- ASSIGN(i, deleteCanvas);
- ASSIGN(i, save);
- ASSIGN(i, restore);
- ASSIGN(i, translate);
- ASSIGN(i, scale);
- ASSIGN(i, rotate);
- ASSIGN(i, skew);
- ASSIGN(i, clipRect);
- ASSIGN(i, clipPath);
- ASSIGN(i, concat);
- ASSIGN(i, getTotalMatrix);
- ASSIGN(i, getLocalClipBounds);
- ASSIGN(i, getDeviceClipBounds);
- ASSIGN(i, drawColor);
- ASSIGN(i, drawPaint);
- ASSIGN(i, drawLine);
- ASSIGN(i, drawRect);
- ASSIGN(i, drawOval);
- ASSIGN(i, drawPath);
- ASSIGN(i, drawText);
- ASSIGN(i, drawPosText);
- ASSIGN(i, drawBitmap);
- ASSIGN(i, drawBitmapRect);
-}
diff --git a/other-licenses/skia-npapi/ANPPaint.cpp b/other-licenses/skia-npapi/ANPPaint.cpp
deleted file mode 100644
index cc67e1dd8..000000000
--- a/other-licenses/skia-npapi/ANPPaint.cpp
+++ /dev/null
@@ -1,208 +0,0 @@
-/*
- * Copyright 2008, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// must include config.h first for webkit to fiddle with new/delete
-#include "SkANP.h"
-
-static ANPPaint* anp_newPaint() {
- return new ANPPaint;
-}
-
-static void anp_deletePaint(ANPPaint* paint) {
- delete paint;
-}
-
-static ANPPaintFlags anp_getFlags(const ANPPaint* paint) {
- return paint->getFlags();
-}
-
-static void anp_setFlags(ANPPaint* paint, ANPPaintFlags flags) {
- paint->setFlags(flags);
-}
-
-static ANPColor anp_getColor(const ANPPaint* paint) {
- return paint->getColor();
-}
-
-static void anp_setColor(ANPPaint* paint, ANPColor color) {
- paint->setColor(color);
-}
-
-static ANPPaintStyle anp_getStyle(const ANPPaint* paint) {
- return paint->getStyle();
-}
-
-static void anp_setStyle(ANPPaint* paint, ANPPaintStyle style) {
- paint->setStyle(static_cast<SkPaint::Style>(style));
-}
-
-static float anp_getStrokeWidth(const ANPPaint* paint) {
- return SkScalarToFloat(paint->getStrokeWidth());
-}
-
-static float anp_getStrokeMiter(const ANPPaint* paint) {
- return SkScalarToFloat(paint->getStrokeMiter());
-}
-
-static ANPPaintCap anp_getStrokeCap(const ANPPaint* paint) {
- return paint->getStrokeCap();
-}
-
-static ANPPaintJoin anp_getStrokeJoin(const ANPPaint* paint) {
- return paint->getStrokeJoin();
-}
-
-static void anp_setStrokeWidth(ANPPaint* paint, float width) {
- paint->setStrokeWidth(SkFloatToScalar(width));
-}
-
-static void anp_setStrokeMiter(ANPPaint* paint, float miter) {
- paint->setStrokeMiter(SkFloatToScalar(miter));
-}
-
-static void anp_setStrokeCap(ANPPaint* paint, ANPPaintCap cap) {
- paint->setStrokeCap(static_cast<SkPaint::Cap>(cap));
-}
-
-static void anp_setStrokeJoin(ANPPaint* paint, ANPPaintJoin join) {
- paint->setStrokeJoin(static_cast<SkPaint::Join>(join));
-}
-
-static ANPTextEncoding anp_getTextEncoding(const ANPPaint* paint) {
- return paint->getTextEncoding();
-}
-
-static ANPPaintAlign anp_getTextAlign(const ANPPaint* paint) {
- return paint->getTextAlign();
-}
-
-static float anp_getTextSize(const ANPPaint* paint) {
- return SkScalarToFloat(paint->getTextSize());
-}
-
-static float anp_getTextScaleX(const ANPPaint* paint) {
- return SkScalarToFloat(paint->getTextScaleX());
-}
-
-static float anp_getTextSkewX(const ANPPaint* paint) {
- return SkScalarToFloat(paint->getTextSkewX());
-}
-
-static ANPTypeface* anp_getTypeface(const ANPPaint* paint) {
- return reinterpret_cast<ANPTypeface*>(paint->getTypeface());
-}
-
-static void anp_setTextEncoding(ANPPaint* paint, ANPTextEncoding encoding) {
- paint->setTextEncoding(static_cast<SkPaint::TextEncoding>(encoding));
-}
-
-static void anp_setTextAlign(ANPPaint* paint, ANPPaintAlign align) {
- paint->setTextAlign(static_cast<SkPaint::Align>(align));
-}
-
-static void anp_setTextSize(ANPPaint* paint, float textSize) {
- paint->setTextSize(SkFloatToScalar(textSize));
-}
-
-static void anp_setTextScaleX(ANPPaint* paint, float scaleX) {
- paint->setTextScaleX(SkFloatToScalar(scaleX));
-}
-
-static void anp_setTextSkewX(ANPPaint* paint, float skewX) {
- paint->setTextSkewX(SkFloatToScalar(skewX));
-}
-
-static void anp_setTypeface(ANPPaint* paint, ANPTypeface* tf) {
- paint->setTypeface(sk_ref_sp(tf));
-}
-
-static float anp_measureText(ANPPaint* paint, const void* text,
- uint32_t byteLength, ANPRectF* bounds) {
- SkScalar w = paint->measureText(text, byteLength,
- reinterpret_cast<SkRect*>(bounds));
- return SkScalarToFloat(w);
-}
-
-/** Return the number of unichars specifed by the text.
- If widths is not null, returns the array of advance widths for each
- unichar.
- If bounds is not null, returns the array of bounds for each unichar.
- */
-static int anp_getTextWidths(ANPPaint* paint, const void* text,
- uint32_t byteLength, float widths[], ANPRectF bounds[]) {
- return paint->getTextWidths(text, byteLength, widths,
- reinterpret_cast<SkRect*>(bounds));
-}
-
-static float anp_getFontMetrics(ANPPaint* paint, ANPFontMetrics* metrics) {
- SkPaint::FontMetrics fm;
- SkScalar spacing = paint->getFontMetrics(&fm);
- if (metrics) {
- metrics->fTop = SkScalarToFloat(fm.fTop);
- metrics->fAscent = SkScalarToFloat(fm.fAscent);
- metrics->fDescent = SkScalarToFloat(fm.fDescent);
- metrics->fBottom = SkScalarToFloat(fm.fBottom);
- metrics->fLeading = SkScalarToFloat(fm.fLeading);
- }
- return SkScalarToFloat(spacing);
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-#define ASSIGN(obj, name) (obj)->name = anp_##name
-
-void InitPaintInterface(ANPPaintInterfaceV0* i) {
- ASSIGN(i, newPaint);
- ASSIGN(i, deletePaint);
- ASSIGN(i, getFlags);
- ASSIGN(i, setFlags);
- ASSIGN(i, getColor);
- ASSIGN(i, setColor);
- ASSIGN(i, getStyle);
- ASSIGN(i, setStyle);
- ASSIGN(i, getStrokeWidth);
- ASSIGN(i, getStrokeMiter);
- ASSIGN(i, getStrokeCap);
- ASSIGN(i, getStrokeJoin);
- ASSIGN(i, setStrokeWidth);
- ASSIGN(i, setStrokeMiter);
- ASSIGN(i, setStrokeCap);
- ASSIGN(i, setStrokeJoin);
- ASSIGN(i, getTextEncoding);
- ASSIGN(i, getTextAlign);
- ASSIGN(i, getTextSize);
- ASSIGN(i, getTextScaleX);
- ASSIGN(i, getTextSkewX);
- ASSIGN(i, getTypeface);
- ASSIGN(i, setTextEncoding);
- ASSIGN(i, setTextAlign);
- ASSIGN(i, setTextSize);
- ASSIGN(i, setTextScaleX);
- ASSIGN(i, setTextSkewX);
- ASSIGN(i, setTypeface);
- ASSIGN(i, measureText);
- ASSIGN(i, getTextWidths);
- ASSIGN(i, getFontMetrics);
-}
diff --git a/other-licenses/skia-npapi/ANPTypeface.cpp b/other-licenses/skia-npapi/ANPTypeface.cpp
deleted file mode 100644
index 48e3f898d..000000000
--- a/other-licenses/skia-npapi/ANPTypeface.cpp
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright 2008, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// must include config.h first for webkit to fiddle with new/delete
-#include "SkANP.h"
-#include "SkStream.h"
-#include <stdlib.h>
-
-static ANPTypeface* anp_createFromName(const char name[], ANPTypefaceStyle s) {
- sk_sp<SkTypeface> tf = SkTypeface::MakeFromName(name,
- SkFontStyle::FromOldStyle(s));
- return reinterpret_cast<ANPTypeface*>(tf.release());
-}
-
-static ANPTypeface* anp_createFromTypeface(const ANPTypeface* family,
- ANPTypefaceStyle s) {
- sk_sp<SkTypeface> tf = SkTypeface::MakeFromTypeface(const_cast<ANPTypeface*>(family),
- static_cast<SkTypeface::Style>(s));
- return reinterpret_cast<ANPTypeface*>(tf.release());
-}
-
-static int32_t anp_getRefCount(const ANPTypeface* tf) {
- return tf ? tf->getRefCnt() : 0;
-}
-
-static void anp_ref(ANPTypeface* tf) {
- SkSafeRef(tf);
-}
-
-static void anp_unref(ANPTypeface* tf) {
- SkSafeUnref(tf);
-}
-
-static ANPTypefaceStyle anp_getStyle(const ANPTypeface* tf) {
- SkTypeface::Style s = tf ? tf->style() : SkTypeface::kNormal;
- return static_cast<ANPTypefaceStyle>(s);
-}
-
-static int32_t anp_getFontPath(const ANPTypeface* tf, char fileName[],
- int32_t length, int32_t* index) {
- return 0;
- /*
- SkStream* stream = tf->openStream(index);
- if (stream->getFileName()) {
- strcpy(fileName, stream->getFileName());
- } else {
- return 0;
- }
-
- return strlen(fileName);
- */
-}
-
-static const char* gFontDir;
-#define FONT_DIR_SUFFIX "/fonts/"
-
-static const char* anp_getFontDirectoryPath() {
- if (NULL == gFontDir) {
- const char* root = getenv("ANDROID_ROOT");
- size_t len = strlen(root);
- char* storage = (char*)malloc(len + sizeof(FONT_DIR_SUFFIX));
- if (NULL == storage) {
- return NULL;
- }
- memcpy(storage, root, len);
- memcpy(storage + len, FONT_DIR_SUFFIX, sizeof(FONT_DIR_SUFFIX));
- // save this assignment for last, so that if multiple threads call us
- // (which should never happen), we never return an incomplete global.
- // At worst, we would allocate storage for the path twice.
- gFontDir = storage;
- }
- return gFontDir;
-}
-
-///////////////////////////////////////////////////////////////////////////////
-
-#define ASSIGN(obj, name) (obj)->name = anp_##name
-
-void InitTypeFaceInterface(ANPTypefaceInterfaceV0* i) {
- ASSIGN(i, createFromName);
- ASSIGN(i, createFromTypeface);
- ASSIGN(i, getRefCount);
- ASSIGN(i, ref);
- ASSIGN(i, unref);
- ASSIGN(i, getStyle);
- ASSIGN(i, getFontPath);
- ASSIGN(i, getFontDirectoryPath);
-}
diff --git a/other-licenses/skia-npapi/SkANP.cpp b/other-licenses/skia-npapi/SkANP.cpp
deleted file mode 100644
index db9302bcd..000000000
--- a/other-licenses/skia-npapi/SkANP.cpp
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- * Copyright 2008, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-// must include config.h first for webkit to fiddle with new/delete
-#include "SkANP.h"
-
-SkRect* SkANP::SetRect(SkRect* dst, const ANPRectF& src) {
- dst->set(SkFloatToScalar(src.left),
- SkFloatToScalar(src.top),
- SkFloatToScalar(src.right),
- SkFloatToScalar(src.bottom));
- return dst;
-}
-
-SkIRect* SkANP::SetRect(SkIRect* dst, const ANPRectI& src) {
- dst->set(src.left, src.top, src.right, src.bottom);
- return dst;
-}
-
-ANPRectI* SkANP::SetRect(ANPRectI* dst, const SkIRect& src) {
- dst->left = src.fLeft;
- dst->top = src.fTop;
- dst->right = src.fRight;
- dst->bottom = src.fBottom;
- return dst;
-}
-
-ANPRectF* SkANP::SetRect(ANPRectF* dst, const SkRect& src) {
- dst->left = SkScalarToFloat(src.fLeft);
- dst->top = SkScalarToFloat(src.fTop);
- dst->right = SkScalarToFloat(src.fRight);
- dst->bottom = SkScalarToFloat(src.fBottom);
- return dst;
-}
-
-SkBitmap* SkANP::SetBitmap(SkBitmap* dst, const ANPBitmap& src) {
- SkColorType colorType = kUnknown_SkColorType;
-
- switch (src.format) {
- case kRGBA_8888_ANPBitmapFormat:
- // Let Skia choose the correct colour type for us based on its
- // endianness. This should be correct.
- colorType = kN32_SkColorType;
- break;
- case kRGB_565_ANPBitmapFormat:
- colorType = kRGB_565_SkColorType;
- break;
- default:
- break;
- }
-
- SkImageInfo info = SkImageInfo::Make(src.width, src.height, colorType, kPremul_SkAlphaType);
- dst->setInfo(info, src.rowBytes);
- dst->setPixels(src.baseAddr);
- return dst;
-}
-
-bool SkANP::SetBitmap(ANPBitmap* dst, const SkBitmap& src) {
- if (!(dst->baseAddr = src.getPixels())) {
- SkDebugf("SkANP::SetBitmap - getPixels() returned null\n");
- return false;
- }
-
- switch (src.colorType()) {
- case SkColorType::kRGBA_8888_SkColorType:
- dst->format = kRGBA_8888_ANPBitmapFormat;
- break;
- case SkColorType::kRGB_565_SkColorType:
- dst->format = kRGB_565_ANPBitmapFormat;
- break;
- default:
- SkDebugf("SkANP::SetBitmap - unsupported src.colorType %d\n", src.colorType());
- return false;
- }
-
- dst->width = src.width();
- dst->height = src.height();
- dst->rowBytes = src.rowBytes();
- return true;
-}
-
-void SkANP::InitEvent(ANPEvent* event, ANPEventType et) {
- event->inSize = sizeof(ANPEvent);
- event->eventType = et;
-}
diff --git a/other-licenses/skia-npapi/SkANP.h b/other-licenses/skia-npapi/SkANP.h
deleted file mode 100644
index 5c2a93650..000000000
--- a/other-licenses/skia-npapi/SkANP.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Copyright 2008, The Android Open Source Project
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SkANP_DEFINED
-#define SkANP_DEFINED
-
-#include "android_npapi.h"
-#include "SkCanvas.h"
-#include "SkMatrix.h"
-#include "SkPaint.h"
-#include "SkPath.h"
-#include "SkTypeface.h"
-
-struct ANPMatrix : SkMatrix {
-};
-
-struct ANPPath : SkPath {
-};
-
-struct ANPPaint : SkPaint {
-};
-
-struct ANPTypeface : SkTypeface {
-};
-
-struct ANPCanvas {
- SkCanvas* skcanvas;
-
- // draw into the specified bitmap
- explicit ANPCanvas(const SkBitmap& bm) {
- skcanvas = new SkCanvas(bm);
- }
-
- // redirect all drawing to the specific SkCanvas
- explicit ANPCanvas(SkCanvas* other) {
- skcanvas = other;
- skcanvas->ref();
- }
-
- ~ANPCanvas() {
- skcanvas->unref();
- }
-};
-
-class SkANP {
-public:
- static SkRect* SetRect(SkRect* dst, const ANPRectF& src);
- static SkIRect* SetRect(SkIRect* dst, const ANPRectI& src);
- static ANPRectI* SetRect(ANPRectI* dst, const SkIRect& src);
- static ANPRectF* SetRect(ANPRectF* dst, const SkRect& src);
- static SkBitmap* SetBitmap(SkBitmap* dst, const ANPBitmap& src);
- static bool SetBitmap(ANPBitmap* dst, const SkBitmap& src);
-
- static void InitEvent(ANPEvent* event, ANPEventType et);
-};
-
-#endif
diff --git a/other-licenses/skia-npapi/moz.build b/other-licenses/skia-npapi/moz.build
deleted file mode 100644
index e53c2ef22..000000000
--- a/other-licenses/skia-npapi/moz.build
+++ /dev/null
@@ -1,31 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXPORTS += [
- 'SkANP.h',
-]
-
-UNIFIED_SOURCES += [
- 'ANPCanvas.cpp',
- 'ANPPaint.cpp',
- 'ANPTypeface.cpp',
- 'SkANP.cpp',
-]
-
-# We allow warnings for third-party code that can be updated from upstream.
-ALLOW_COMPILER_WARNINGS = True
-
-FINAL_LIBRARY = 'xul'
-
-DEFINES['SK_BUILD_FOR_ANDROID_NDK'] = True
-
-LOCAL_INCLUDES += [
- '/dom/plugins/base',
- '/dom/plugins/base/android',
- '/gfx/gl',
- '/gfx/skia/skia/include/config',
- '/gfx/skia/skia/include/core',
-]
diff --git a/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java b/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java
index de7d8478d..c8fd9ee9b 100644
--- a/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java
+++ b/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/TreeBuilder.java
@@ -705,8 +705,6 @@ public abstract class TreeBuilder<T> implements TokenHandler,
tokenizer.setState(Tokenizer.DATA);
}
}
- contextName = null;
- contextNode = null;
} else {
mode = INITIAL;
// If we are viewing XML source, put a foreign element permanently
@@ -1614,6 +1612,8 @@ public abstract class TreeBuilder<T> implements TokenHandler,
public final void endTokenization() throws SAXException {
formPointer = null;
headPointer = null;
+ contextName = null;
+ contextNode = null;
deepTreeSurrogateParent = null;
templateModeStack = null;
if (stack != null) {
diff --git a/parser/html/nsHtml5TreeBuilder.cpp b/parser/html/nsHtml5TreeBuilder.cpp
index cea78839c..995e7f5e6 100644
--- a/parser/html/nsHtml5TreeBuilder.cpp
+++ b/parser/html/nsHtml5TreeBuilder.cpp
@@ -142,8 +142,6 @@ nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
tokenizer->setState(NS_HTML5TOKENIZER_DATA);
}
}
- contextName = nullptr;
- contextNode = nullptr;
} else {
mode = NS_HTML5TREE_BUILDER_INITIAL;
if (tokenizer->isViewingXmlSource()) {
@@ -579,6 +577,8 @@ nsHtml5TreeBuilder::endTokenization()
{
formPointer = nullptr;
headPointer = nullptr;
+ contextName = nullptr;
+ contextNode = nullptr;
deepTreeSurrogateParent = nullptr;
templateModeStack = nullptr;
if (stack) {
diff --git a/python/mozbuild/mozbuild/base.py b/python/mozbuild/mozbuild/base.py
index 9d5897a34..9db1005d1 100644
--- a/python/mozbuild/mozbuild/base.py
+++ b/python/mozbuild/mozbuild/base.py
@@ -352,6 +352,13 @@ class MozbuildObject(ProcessExecutionMixin):
return _config_guess_output[0]
p = os.path.join(self.topsrcdir, 'build', 'autoconf', 'config.guess')
+
+ # Try looking for mozilla, for comm-central
+ if not os.path.isfile(p):
+ p = os.path.join(self.topsrcdir, 'mozilla', 'build', 'autoconf', 'config.guess')
+
+ if not os.path.isfile(p):
+ p = os.path.join(self.topsrcdir, 'platform', 'build', 'autoconf', 'config.guess')
# This is a little kludgy. We need access to the normalize_command
# function. However, that's a method of a mach mixin, so we need a
diff --git a/python/mozbuild/mozbuild/mach_commands.py b/python/mozbuild/mozbuild/mach_commands.py
index 5933a5aa9..bd3fbe921 100644
--- a/python/mozbuild/mozbuild/mach_commands.py
+++ b/python/mozbuild/mozbuild/mach_commands.py
@@ -541,20 +541,24 @@ class Build(MachCommandBase):
# as when doing OSX Universal builds)
pass
- # Check if there are any unpreprocessed files in '@MOZ_OBJDIR@/dist/bin'
- # See python/mozbuild/mozbuild/preprocessor.py#L293-L309 for the list of directives
- # We skip if, ifdef, ifndef, else, elif, elifdef and elifndef, because they are never used alone
- #
- # The original version of this script only worked with GNU grep because of the --include flag.
- # Not a problem in and of itself, except that it didn't take TOOLCHAIN_PREFIX and simply assumed
- # all operating systems use GNU grep as the system grep (often it's called ggrep or something).
- # This script is a bit slower, but should do the same thing on all Unix platforms.
-
- grepcmd = 'find ' + self.topobjdir + '/dist/bin' + ' -name \'\*.{css,dtd,html,js,jsm,xhtml,xml,xul,manifest,properties,rdf}\' ' + '| xargs grep -E "^(#|%)(define|endif|error|expand|filter|include|literal|undef|unfilter)" '\
- + '| awk "/\.css:%/ || (!/\.css/ && /:#/)"'
- grepresult = subprocess.Popen(grepcmd, stdout=subprocess.PIPE, shell=True).communicate()[0]
- if grepresult:
- print('\nERROR: preprocessor was not applied to the following files:\n\n' + grepresult)
+ # Check for un-preprocessed files.. In case something goes wrong it will be noted
+ ppcheck_script = mozpath.join(self.topsrcdir, "build", "ppCheck.py")
+ ppcheck_path = mozpath.join(self.topobjdir, "dist", "bin")
+ if not os.path.exists(ppcheck_script):
+ ppcheck_script = mozpath.join(self.topsrcdir, "mozilla", "build", "ppCheck.py")
+
+ if not os.path.exists(ppcheck_script):
+ ppcheck_script = mozpath.join(self.topsrcdir, "platform", "build", "ppCheck.py")
+ else:
+ ppcheck_script = None
+
+ if ppcheck_script:
+ ppcheck_cmd = [which.which("python2.7"), ppcheck_script, ppcheck_path]
+ ppcheck_result = subprocess.call(ppcheck_cmd, cwd=self.topsrcdir)
+
+ if not ppcheck_script or ppcheck_result:
+ print("\nWARNING: Something has gone wrong with the check for un-preprocessed files. " +
+ "Please manually verify that files are properly preprocessed.")
return status
diff --git a/python/mozbuild/mozpack/packager/formats.py b/python/mozbuild/mozpack/packager/formats.py
index cedd1998b..235fc3e90 100644
--- a/python/mozbuild/mozpack/packager/formats.py
+++ b/python/mozbuild/mozpack/packager/formats.py
@@ -320,5 +320,4 @@ class OmniJarSubFormatter(PiecemealFormatter):
'modules',
'goanna.js',
'hyphenation',
- 'update.locale',
] or path[0] in STARTUP_CACHE_PATHS
diff --git a/python/mozbuild/mozpack/test/test_packager_formats.py b/python/mozbuild/mozpack/test/test_packager_formats.py
index 66a7cc8e6..4ba61e880 100644
--- a/python/mozbuild/mozpack/test/test_packager_formats.py
+++ b/python/mozbuild/mozpack/test/test_packager_formats.py
@@ -407,7 +407,6 @@ class TestFormatters(unittest.TestCase):
self.assertTrue(is_resource(base, 'modules/foo.jsm'))
self.assertTrue(is_resource(base, 'goanna.js'))
self.assertTrue(is_resource(base, 'hyphenation/foo'))
- self.assertTrue(is_resource(base, 'update.locale'))
self.assertTrue(
is_resource(base, 'jsloader/resource/gre/modules/foo.jsm'))
self.assertFalse(is_resource(base, 'foo'))
diff --git a/security/certverifier/NSSCertDBTrustDomain.cpp b/security/certverifier/NSSCertDBTrustDomain.cpp
index 5e89c2484..fff75ee88 100644
--- a/security/certverifier/NSSCertDBTrustDomain.cpp
+++ b/security/certverifier/NSSCertDBTrustDomain.cpp
@@ -12,7 +12,6 @@
#include "NSSErrorsService.h"
#include "OCSPRequestor.h"
#include "OCSPVerificationTrustDomain.h"
-#include "PublicKeyPinningService.h"
#include "cert.h"
#include "certdb.h"
#include "mozilla/Assertions.h"
@@ -862,24 +861,6 @@ NSSCertDBTrustDomain::IsChainValid(const DERArray& certArray, Time time)
if (rv != Success) {
return rv;
}
- bool skipPinningChecksBecauseOfMITMMode =
- (!isBuiltInRoot && mPinningMode == CertVerifier::pinningAllowUserCAMITM);
- // If mHostname isn't set, we're not verifying in the context of a TLS
- // handshake, so don't verify HPKP in those cases.
- if (mHostname && (mPinningMode != CertVerifier::pinningDisabled) &&
- !skipPinningChecksBecauseOfMITMMode) {
- bool enforceTestMode =
- (mPinningMode == CertVerifier::pinningEnforceTestMode);
- bool chainHasValidPins;
- nsresult nsrv = PublicKeyPinningService::ChainHasValidPins(
- certList, mHostname, time, enforceTestMode, chainHasValidPins);
- if (NS_FAILED(nsrv)) {
- return Result::FATAL_ERROR_LIBRARY_FAILURE;
- }
- if (!chainHasValidPins) {
- return Result::ERROR_KEY_PINNING_FAILURE;
- }
- }
mBuiltChain = Move(certList);
@@ -1102,7 +1083,12 @@ InitializeNSS(const nsACString& dir, bool readOnly, bool loadPKCS11Modules)
flags |= NSS_INIT_NOMODDB;
}
nsAutoCString dbTypeAndDirectory;
+#ifdef MOZ_SECURITY_SQLSTORE
+ // Not strictly necessary with current NSS versions, but can't hurt to be explicit.
+ dbTypeAndDirectory.Append("sql:");
+#else
dbTypeAndDirectory.Append("dbm:");
+#endif
dbTypeAndDirectory.Append(dir);
return ::NSS_Initialize(dbTypeAndDirectory.get(), "", "", SECMOD_DB, flags);
}
diff --git a/security/manager/ssl/PublicKeyPinningService.cpp b/security/manager/ssl/PublicKeyPinningService.cpp
deleted file mode 100644
index ffee8ba48..000000000
--- a/security/manager/ssl/PublicKeyPinningService.cpp
+++ /dev/null
@@ -1,333 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "PublicKeyPinningService.h"
-
-#include "mozilla/Base64.h"
-#include "mozilla/Casting.h"
-#include "mozilla/Logging.h"
-#include "nsISiteSecurityService.h"
-#include "nsServiceManagerUtils.h"
-#include "nsSiteSecurityService.h"
-#include "nssb64.h"
-#include "pkix/pkixtypes.h"
-#include "seccomon.h"
-#include "sechash.h"
-
-#include "StaticHPKPins.h" // autogenerated by genHPKPStaticpins.js
-
-using namespace mozilla;
-using namespace mozilla::pkix;
-using namespace mozilla::psm;
-
-LazyLogModule gPublicKeyPinningLog("PublicKeyPinningService");
-
-/**
- Computes in the location specified by base64Out the SHA256 digest
- of the DER Encoded subject Public Key Info for the given cert
-*/
-static nsresult
-GetBase64HashSPKI(const CERTCertificate* cert, nsACString& hashSPKIDigest)
-{
- hashSPKIDigest.Truncate();
- Digest digest;
- nsresult rv = digest.DigestBuf(SEC_OID_SHA256, cert->derPublicKey.data,
- cert->derPublicKey.len);
- if (NS_FAILED(rv)) {
- return rv;
- }
- return Base64Encode(nsDependentCSubstring(
- BitwiseCast<char*, unsigned char*>(digest.get().data),
- digest.get().len),
- hashSPKIDigest);
-}
-
-/*
- * Sets certMatchesPinset to true if a given cert matches any fingerprints from
- * the given pinset or the dynamicFingerprints array, or to false otherwise.
- */
-static nsresult
-EvalCert(const CERTCertificate* cert, const StaticFingerprints* fingerprints,
- const nsTArray<nsCString>* dynamicFingerprints,
- /*out*/ bool& certMatchesPinset)
-{
- certMatchesPinset = false;
- if (!fingerprints && !dynamicFingerprints) {
- MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug,
- ("pkpin: No hashes found\n"));
- return NS_ERROR_INVALID_ARG;
- }
-
- nsAutoCString base64Out;
- nsresult rv = GetBase64HashSPKI(cert, base64Out);
- if (NS_FAILED(rv)) {
- MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug,
- ("pkpin: GetBase64HashSPKI failed!\n"));
- return rv;
- }
-
- if (fingerprints) {
- for (size_t i = 0; i < fingerprints->size; i++) {
- if (base64Out.Equals(fingerprints->data[i])) {
- MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug,
- ("pkpin: found pin base_64 ='%s'\n", base64Out.get()));
- certMatchesPinset = true;
- return NS_OK;
- }
- }
- }
- if (dynamicFingerprints) {
- for (size_t i = 0; i < dynamicFingerprints->Length(); i++) {
- if (base64Out.Equals((*dynamicFingerprints)[i])) {
- MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug,
- ("pkpin: found pin base_64 ='%s'\n", base64Out.get()));
- certMatchesPinset = true;
- return NS_OK;
- }
- }
- }
- return NS_OK;
-}
-
-/*
- * Sets certListIntersectsPinset to true if a given chain matches any
- * fingerprints from the given static fingerprints or the
- * dynamicFingerprints array, or to false otherwise.
- */
-static nsresult
-EvalChain(const UniqueCERTCertList& certList,
- const StaticFingerprints* fingerprints,
- const nsTArray<nsCString>* dynamicFingerprints,
- /*out*/ bool& certListIntersectsPinset)
-{
- certListIntersectsPinset = false;
- CERTCertificate* currentCert;
-
- if (!fingerprints && !dynamicFingerprints) {
- MOZ_ASSERT(false, "Must pass in at least one type of pinset");
- return NS_ERROR_FAILURE;
- }
-
- CERTCertListNode* node;
- for (node = CERT_LIST_HEAD(certList); !CERT_LIST_END(node, certList);
- node = CERT_LIST_NEXT(node)) {
- currentCert = node->cert;
- MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug,
- ("pkpin: certArray subject: '%s'\n", currentCert->subjectName));
- MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug,
- ("pkpin: certArray issuer: '%s'\n", currentCert->issuerName));
- nsresult rv = EvalCert(currentCert, fingerprints, dynamicFingerprints,
- certListIntersectsPinset);
- if (NS_FAILED(rv)) {
- return rv;
- }
- if (certListIntersectsPinset) {
- return NS_OK;
- }
- }
- MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug, ("pkpin: no matches found\n"));
- return NS_OK;
-}
-
-/**
- Comparator for the is public key pinned host.
-*/
-static int
-TransportSecurityPreloadCompare(const void* key, const void* entry) {
- auto keyStr = static_cast<const char*>(key);
- auto preloadEntry = static_cast<const TransportSecurityPreload*>(entry);
-
- return strcmp(keyStr, preloadEntry->mHost);
-}
-
-nsresult
-PublicKeyPinningService::ChainMatchesPinset(const UniqueCERTCertList& certList,
- const nsTArray<nsCString>& aSHA256keys,
- /*out*/ bool& chainMatchesPinset)
-{
- return EvalChain(certList, nullptr, &aSHA256keys, chainMatchesPinset);
-}
-
-// Returns via one of the output parameters the most relevant pinning
-// information that is valid for the given host at the given time.
-// Dynamic pins are prioritized over static pins.
-static nsresult
-FindPinningInformation(const char* hostname, mozilla::pkix::Time time,
- /*out*/ nsTArray<nsCString>& dynamicFingerprints,
- /*out*/ TransportSecurityPreload*& staticFingerprints)
-{
- if (!hostname || hostname[0] == 0) {
- return NS_ERROR_INVALID_ARG;
- }
- staticFingerprints = nullptr;
- dynamicFingerprints.Clear();
- nsCOMPtr<nsISiteSecurityService> sssService =
- do_GetService(NS_SSSERVICE_CONTRACTID);
- if (!sssService) {
- return NS_ERROR_FAILURE;
- }
- TransportSecurityPreload* foundEntry = nullptr;
- char* evalHost = const_cast<char*>(hostname);
- char* evalPart;
- // Notice how the (xx = strchr) prevents pins for unqualified domain names.
- while (!foundEntry && (evalPart = strchr(evalHost, '.'))) {
- MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug,
- ("pkpin: Querying pinsets for host: '%s'\n", evalHost));
- // Attempt dynamic pins first
- nsresult rv;
- bool found;
- bool includeSubdomains;
- nsTArray<nsCString> pinArray;
- rv = sssService->GetKeyPinsForHostname(evalHost, time, pinArray,
- &includeSubdomains, &found);
- if (NS_FAILED(rv)) {
- return rv;
- }
- if (found && (evalHost == hostname || includeSubdomains)) {
- MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug,
- ("pkpin: Found dyn match for host: '%s'\n", evalHost));
- dynamicFingerprints = pinArray;
- return NS_OK;
- }
-
- foundEntry = (TransportSecurityPreload *)bsearch(evalHost,
- kPublicKeyPinningPreloadList,
- sizeof(kPublicKeyPinningPreloadList) / sizeof(TransportSecurityPreload),
- sizeof(TransportSecurityPreload),
- TransportSecurityPreloadCompare);
- if (foundEntry) {
- MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug,
- ("pkpin: Found pinset for host: '%s'\n", evalHost));
- if (evalHost != hostname) {
- if (!foundEntry->mIncludeSubdomains) {
- // Does not apply to this host, continue iterating
- foundEntry = nullptr;
- }
- }
- } else {
- MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug,
- ("pkpin: Didn't find pinset for host: '%s'\n", evalHost));
- }
- // Add one for '.'
- evalHost = evalPart + 1;
- }
-
- if (foundEntry && foundEntry->pinset) {
- if (time > TimeFromEpochInSeconds(kPreloadPKPinsExpirationTime /
- PR_USEC_PER_SEC)) {
- return NS_OK;
- }
- staticFingerprints = foundEntry;
- }
- return NS_OK;
-}
-
-// Returns true via the output parameter if the given certificate list meets
-// pinning requirements for the given host at the given time. It must be the
-// case that either there is an intersection between the set of hashes of
-// subject public key info data in the list and the most relevant non-expired
-// pinset for the host or there is no pinning information for the host.
-static nsresult
-CheckPinsForHostname(const UniqueCERTCertList& certList, const char* hostname,
- bool enforceTestMode, mozilla::pkix::Time time,
- /*out*/ bool& chainHasValidPins)
-{
- chainHasValidPins = false;
- if (!certList) {
- return NS_ERROR_INVALID_ARG;
- }
- if (!hostname || hostname[0] == 0) {
- return NS_ERROR_INVALID_ARG;
- }
-
- nsTArray<nsCString> dynamicFingerprints;
- TransportSecurityPreload* staticFingerprints = nullptr;
- nsresult rv = FindPinningInformation(hostname, time, dynamicFingerprints,
- staticFingerprints);
- // If we have no pinning information, the certificate chain trivially
- // validates with respect to pinning.
- if (dynamicFingerprints.Length() == 0 && !staticFingerprints) {
- chainHasValidPins = true;
- return NS_OK;
- }
- if (dynamicFingerprints.Length() > 0) {
- return EvalChain(certList, nullptr, &dynamicFingerprints, chainHasValidPins);
- }
- if (staticFingerprints) {
- bool enforceTestModeResult;
- rv = EvalChain(certList, staticFingerprints->pinset, nullptr,
- enforceTestModeResult);
- if (NS_FAILED(rv)) {
- return rv;
- }
- chainHasValidPins = enforceTestModeResult;
- if (staticFingerprints->mTestMode) {
- if (!enforceTestMode) {
- chainHasValidPins = true;
- }
- }
-
- MOZ_LOG(gPublicKeyPinningLog, LogLevel::Debug,
- ("pkpin: Pin check %s for %s host '%s' (mode=%s)\n",
- enforceTestModeResult ? "passed" : "failed",
- staticFingerprints->mIsMoz ? "mozilla" : "non-mozilla",
- hostname, staticFingerprints->mTestMode ? "test" : "production"));
- }
-
- return NS_OK;
-}
-
-nsresult
-PublicKeyPinningService::ChainHasValidPins(const UniqueCERTCertList& certList,
- const char* hostname,
- mozilla::pkix::Time time,
- bool enforceTestMode,
- /*out*/ bool& chainHasValidPins)
-{
- chainHasValidPins = false;
- if (!certList) {
- return NS_ERROR_INVALID_ARG;
- }
- if (!hostname || hostname[0] == 0) {
- return NS_ERROR_INVALID_ARG;
- }
- nsAutoCString canonicalizedHostname(CanonicalizeHostname(hostname));
- return CheckPinsForHostname(certList, canonicalizedHostname.get(),
- enforceTestMode, time, chainHasValidPins);
-}
-
-nsresult
-PublicKeyPinningService::HostHasPins(const char* hostname,
- mozilla::pkix::Time time,
- bool enforceTestMode,
- /*out*/ bool& hostHasPins)
-{
- hostHasPins = false;
- nsAutoCString canonicalizedHostname(CanonicalizeHostname(hostname));
- nsTArray<nsCString> dynamicFingerprints;
- TransportSecurityPreload* staticFingerprints = nullptr;
- nsresult rv = FindPinningInformation(canonicalizedHostname.get(), time,
- dynamicFingerprints, staticFingerprints);
- if (NS_FAILED(rv)) {
- return rv;
- }
- if (dynamicFingerprints.Length() > 0) {
- hostHasPins = true;
- } else if (staticFingerprints) {
- hostHasPins = !staticFingerprints->mTestMode || enforceTestMode;
- }
- return NS_OK;
-}
-
-nsAutoCString
-PublicKeyPinningService::CanonicalizeHostname(const char* hostname)
-{
- nsAutoCString canonicalizedHostname(hostname);
- ToLowerCase(canonicalizedHostname);
- while (canonicalizedHostname.Length() > 0 &&
- canonicalizedHostname.Last() == '.') {
- canonicalizedHostname.Truncate(canonicalizedHostname.Length() - 1);
- }
- return canonicalizedHostname;
-}
diff --git a/security/manager/ssl/PublicKeyPinningService.h b/security/manager/ssl/PublicKeyPinningService.h
deleted file mode 100644
index 09fdd8474..000000000
--- a/security/manager/ssl/PublicKeyPinningService.h
+++ /dev/null
@@ -1,64 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef PublicKeyPinningService_h
-#define PublicKeyPinningService_h
-
-#include "CertVerifier.h"
-#include "ScopedNSSTypes.h"
-#include "cert.h"
-#include "nsString.h"
-#include "nsTArray.h"
-#include "pkix/Time.h"
-
-namespace mozilla {
-namespace psm {
-
-class PublicKeyPinningService
-{
-public:
- /**
- * Sets chainHasValidPins to true if the given (host, certList) passes pinning
- * checks, or to false otherwise. If the host is pinned, returns true via
- * chainHasValidPins if one of the keys in the given certificate chain matches
- * the pin set specified by the hostname. The certList's head is the EE cert
- * and the tail is the trust anchor.
- * Note: if an alt name is a wildcard, it won't necessarily find a pinset
- * that would otherwise be valid for it
- */
- static nsresult ChainHasValidPins(const UniqueCERTCertList& certList,
- const char* hostname,
- mozilla::pkix::Time time,
- bool enforceTestMode,
- /*out*/ bool& chainHasValidPins);
- /**
- * Sets chainMatchesPinset to true if there is any intersection between the
- * certificate list and the pins specified in the aSHA256keys array.
- * Values passed in are assumed to be in base64 encoded form.
- */
- static nsresult ChainMatchesPinset(const UniqueCERTCertList& certList,
- const nsTArray<nsCString>& aSHA256keys,
- /*out*/ bool& chainMatchesPinset);
-
- /**
- * Returns true via the output parameter hostHasPins if there is pinning
- * information for the given host that is valid at the given time, and false
- * otherwise.
- */
- static nsresult HostHasPins(const char* hostname,
- mozilla::pkix::Time time,
- bool enforceTestMode,
- /*out*/ bool& hostHasPins);
-
- /**
- * Given a hostname of potentially mixed case with potentially multiple
- * trailing '.' (see bug 1118522), canonicalizes it to lowercase with no
- * trailing '.'.
- */
- static nsAutoCString CanonicalizeHostname(const char* hostname);
-};
-
-}} // namespace mozilla::psm
-
-#endif // PublicKeyPinningService_h
diff --git a/security/manager/ssl/SSLServerCertVerification.cpp b/security/manager/ssl/SSLServerCertVerification.cpp
index af985eb92..37a3b809f 100644
--- a/security/manager/ssl/SSLServerCertVerification.cpp
+++ b/security/manager/ssl/SSLServerCertVerification.cpp
@@ -425,11 +425,9 @@ CertErrorRunnable::CheckCertOverrides()
uint32_t remaining_display_errors = mCollectedErrors;
- // If this is an HTTP Strict Transport Security host or a pinned host and the
- // certificate is bad, don't allow overrides (RFC 6797 section 12.1,
- // HPKP draft spec section 2.6).
+ // If this is an HTTP Strict Transport Security host, don't allow overrides
+ // RFC 6797 section 12.1.
bool strictTransportSecurityEnabled = false;
- bool hasPinningInformation = false;
nsCOMPtr<nsISiteSecurityService> sss(do_GetService(NS_SSSERVICE_CONTRACTID));
if (!sss) {
MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
@@ -449,21 +447,10 @@ CertErrorRunnable::CheckCertOverrides()
return new SSLServerCertVerificationResult(mInfoObject,
mDefaultErrorCodeToReport);
}
- nsrv = sss->IsSecureHost(nsISiteSecurityService::HEADER_HPKP,
- mInfoObject->GetHostNameRaw(),
- mProviderFlags,
- nullptr,
- &hasPinningInformation);
- if (NS_FAILED(nsrv)) {
- MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
- ("[%p][%p] checking for HPKP failed\n", mFdForLogging, this));
- return new SSLServerCertVerificationResult(mInfoObject,
- mDefaultErrorCodeToReport);
- }
- if (!strictTransportSecurityEnabled && !hasPinningInformation) {
+ if (!strictTransportSecurityEnabled) {
MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
- ("[%p][%p] no HSTS or HPKP - overrides allowed\n",
+ ("[%p][%p] no HSTS - overrides allowed\n",
mFdForLogging, this));
nsCOMPtr<nsICertOverrideService> overrideService =
do_GetService(NS_CERTOVERRIDE_CONTRACTID);
@@ -497,7 +484,7 @@ CertErrorRunnable::CheckCertOverrides()
}
} else {
MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
- ("[%p][%p] HSTS or HPKP - no overrides allowed\n",
+ ("[%p][%p] HSTS - no overrides allowed\n",
mFdForLogging, this));
}
diff --git a/security/manager/ssl/StaticHPKPins.h b/security/manager/ssl/StaticHPKPins.h
deleted file mode 100644
index a2313ea72..000000000
--- a/security/manager/ssl/StaticHPKPins.h
+++ /dev/null
@@ -1,712 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*****************************************************************************/
-/* This is an automatically generated file. If you're not */
-/* PublicKeyPinningService.cpp, you shouldn't be #including it. */
-/*****************************************************************************/
-#include <stdint.h>
-/* AddTrust External Root */
-static const char kAddTrust_External_RootFingerprint[] =
- "lCppFqbkrlJ3EcVFAkeip0+44VaoJUymbnOaEUk7tEU=";
-
-/* AddTrust Low-Value Services Root */
-static const char kAddTrust_Low_Value_Services_RootFingerprint[] =
- "BStocQfshOhzA4JFLsKidFF0XXSFpX1vRk4Np6G2ryo=";
-
-/* AddTrust Public Services Root */
-static const char kAddTrust_Public_Services_RootFingerprint[] =
- "OGHXtpYfzbISBFb/b8LrdwSxp0G0vZM6g3b14ZFcppg=";
-
-/* AddTrust Qualified Certificates Root */
-static const char kAddTrust_Qualified_Certificates_RootFingerprint[] =
- "xzr8Lrp3DQy8HuQfJStS6Kk9ErctzOwDHY2DnL+Bink=";
-
-/* AffirmTrust Commercial */
-static const char kAffirmTrust_CommercialFingerprint[] =
- "bEZLmlsjOl6HTadlwm8EUBDS3c/0V5TwtMfkqvpQFJU=";
-
-/* AffirmTrust Networking */
-static const char kAffirmTrust_NetworkingFingerprint[] =
- "lAcq0/WPcPkwmOWl9sBMlscQvYSdgxhJGa6Q64kK5AA=";
-
-/* AffirmTrust Premium */
-static const char kAffirmTrust_PremiumFingerprint[] =
- "x/Q7TPW3FWgpT4IrU3YmBfbd0Vyt7Oc56eLDy6YenWc=";
-
-/* AffirmTrust Premium ECC */
-static const char kAffirmTrust_Premium_ECCFingerprint[] =
- "MhmwkRT/SVo+tusAwu/qs0ACrl8KVsdnnqCHo/oDfk8=";
-
-/* Baltimore CyberTrust Root */
-static const char kBaltimore_CyberTrust_RootFingerprint[] =
- "Y9mvm0exBk1JoQ57f9Vm28jKo5lFm/woKcVxrYxu80o=";
-
-/* COMODO Certification Authority */
-static const char kCOMODO_Certification_AuthorityFingerprint[] =
- "AG1751Vd2CAmRCxPGieoDomhmJy4ezREjtIZTBgZbV4=";
-
-/* COMODO ECC Certification Authority */
-static const char kCOMODO_ECC_Certification_AuthorityFingerprint[] =
- "58qRu/uxh4gFezqAcERupSkRYBlBAvfcw7mEjGPLnNU=";
-
-/* COMODO RSA Certification Authority */
-static const char kCOMODO_RSA_Certification_AuthorityFingerprint[] =
- "grX4Ta9HpZx6tSHkmCrvpApTQGo67CYDnvprLg5yRME=";
-
-/* Comodo AAA Services root */
-static const char kComodo_AAA_Services_rootFingerprint[] =
- "vRU+17BDT2iGsXvOi76E7TQMcTLXAqj0+jGPdW7L1vM=";
-
-/* Comodo Secure Services root */
-static const char kComodo_Secure_Services_rootFingerprint[] =
- "RpHL/ehKa2BS3b4VK7DCFq4lqG5XR4E9vA8UfzOFcL4=";
-
-/* Comodo Trusted Services root */
-static const char kComodo_Trusted_Services_rootFingerprint[] =
- "4tiR77c4ZpEF1TDeXtcuKyrD9KZweLU0mz/ayklvXrg=";
-
-/* Cybertrust Global Root */
-static const char kCybertrust_Global_RootFingerprint[] =
- "foeCwVDOOVL4AuY2AjpdPpW7XWjjPoWtsroXgSXOvxU=";
-
-/* DST Root CA X3 */
-static const char kDST_Root_CA_X3Fingerprint[] =
- "Vjs8r4z+80wjNcr1YKepWQboSIRi63WsWXhIMN+eWys=";
-
-/* DigiCert Assured ID Root CA */
-static const char kDigiCert_Assured_ID_Root_CAFingerprint[] =
- "I/Lt/z7ekCWanjD0Cvj5EqXls2lOaThEA0H2Bg4BT/o=";
-
-/* DigiCert Assured ID Root G2 */
-static const char kDigiCert_Assured_ID_Root_G2Fingerprint[] =
- "8ca6Zwz8iOTfUpc8rkIPCgid1HQUT+WAbEIAZOFZEik=";
-
-/* DigiCert Assured ID Root G3 */
-static const char kDigiCert_Assured_ID_Root_G3Fingerprint[] =
- "Fe7TOVlLME+M+Ee0dzcdjW/sYfTbKwGvWJ58U7Ncrkw=";
-
-/* DigiCert Global Root CA */
-static const char kDigiCert_Global_Root_CAFingerprint[] =
- "r/mIkG3eEpVdm+u/ko/cwxzOMo1bk4TyHIlByibiA5E=";
-
-/* DigiCert Global Root G2 */
-static const char kDigiCert_Global_Root_G2Fingerprint[] =
- "i7WTqTvh0OioIruIfFR4kMPnBqrS2rdiVPl/s2uC/CY=";
-
-/* DigiCert Global Root G3 */
-static const char kDigiCert_Global_Root_G3Fingerprint[] =
- "uUwZgwDOxcBXrQcntwu+kYFpkiVkOaezL0WYEZ3anJc=";
-
-/* DigiCert High Assurance EV Root CA */
-static const char kDigiCert_High_Assurance_EV_Root_CAFingerprint[] =
- "WoiWRyIOVNa9ihaBciRSC7XHjliYS9VwUGOIud4PB18=";
-
-/* DigiCert Trusted Root G4 */
-static const char kDigiCert_Trusted_Root_G4Fingerprint[] =
- "Wd8xe/qfTwq3ylFNd3IpaqLHZbh2ZNCLluVzmeNkcpw=";
-
-/* End Entity Test Cert */
-static const char kEnd_Entity_Test_CertFingerprint[] =
- "VCIlmPM9NkgFQtrs4Oa5TeFcDu6MWRTKSNdePEhOgD8=";
-
-/* Entrust Root Certification Authority */
-static const char kEntrust_Root_Certification_AuthorityFingerprint[] =
- "bb+uANN7nNc/j7R95lkXrwDg3d9C286sIMF8AnXuIJU=";
-
-/* Entrust Root Certification Authority - EC1 */
-static const char kEntrust_Root_Certification_Authority___EC1Fingerprint[] =
- "/qK31kX7pz11PB7Jp4cMQOH3sMVh6Se5hb9xGGbjbyI=";
-
-/* Entrust Root Certification Authority - G2 */
-static const char kEntrust_Root_Certification_Authority___G2Fingerprint[] =
- "du6FkDdMcVQ3u8prumAo6t3i3G27uMP2EOhR8R0at/U=";
-
-/* Entrust.net Premium 2048 Secure Server CA */
-static const char kEntrust_net_Premium_2048_Secure_Server_CAFingerprint[] =
- "HqPF5D7WbC2imDpCpKebHpBnhs6fG1hiFBmgBGOofTg=";
-
-/* FacebookBackup */
-static const char kFacebookBackupFingerprint[] =
- "q4PO2G2cbkZhZ82+JgmRUyGMoAeozA+BSXVXQWB8XWQ=";
-
-/* GOOGLE_PIN_COMODORSADomainValidationSecureServerCA */
-static const char kGOOGLE_PIN_COMODORSADomainValidationSecureServerCAFingerprint[] =
- "klO23nT2ehFDXCfx3eHTDRESMz3asj1muO+4aIdjiuY=";
-
-/* GOOGLE_PIN_DigiCertECCSecureServerCA */
-static const char kGOOGLE_PIN_DigiCertECCSecureServerCAFingerprint[] =
- "PZXN3lRAy+8tBKk2Ox6F7jIlnzr2Yzmwqc3JnyfXoCw=";
-
-/* GOOGLE_PIN_DigiCertSHA2HighAssuranceServerCA */
-static const char kGOOGLE_PIN_DigiCertSHA2HighAssuranceServerCAFingerprint[] =
- "k2v657xBsOVe1PQRwOsHsw3bsGT2VzIqz5K+59sNQws=";
-
-/* GOOGLE_PIN_Entrust_SSL */
-static const char kGOOGLE_PIN_Entrust_SSLFingerprint[] =
- "nsxRNo6G40YPZsKV5JQt1TCA8nseQQr/LRqp1Oa8fnw=";
-
-/* GOOGLE_PIN_GTECyberTrustGlobalRoot */
-static const char kGOOGLE_PIN_GTECyberTrustGlobalRootFingerprint[] =
- "EGn6R6CqT4z3ERscrqNl7q7RC//zJmDe9uBhS/rnCHU=";
-
-/* GOOGLE_PIN_GoDaddySecure */
-static const char kGOOGLE_PIN_GoDaddySecureFingerprint[] =
- "MrZLZnJ6IGPkBm87lYywqu5Xal7O/ZUzmbuIdHMdlYc=";
-
-/* GOOGLE_PIN_GoogleG2 */
-static const char kGOOGLE_PIN_GoogleG2Fingerprint[] =
- "7HIpactkIAq2Y49orFOOQKurWxmmSFZhBCoQYcRhJ3Y=";
-
-/* GOOGLE_PIN_LetsEncryptAuthorityBackup_X2_X4 */
-static const char kGOOGLE_PIN_LetsEncryptAuthorityBackup_X2_X4Fingerprint[] =
- "sRHdihwgkaib1P1gxX8HFszlD+7/gTfNvuAybgLPNis=";
-
-/* GOOGLE_PIN_LetsEncryptAuthorityPrimary_X1_X3 */
-static const char kGOOGLE_PIN_LetsEncryptAuthorityPrimary_X1_X3Fingerprint[] =
- "YLh1dUR9y6Kja30RrAn7JKnbQG/uEtLMkBgFF2Fuihg=";
-
-/* GOOGLE_PIN_RapidSSL */
-static const char kGOOGLE_PIN_RapidSSLFingerprint[] =
- "lT09gPUeQfbYrlxRtpsHrjDblj9Rpz+u7ajfCrg4qDM=";
-
-/* GOOGLE_PIN_SymantecClass3EVG3 */
-static const char kGOOGLE_PIN_SymantecClass3EVG3Fingerprint[] =
- "gMxWOrX4PMQesK9qFNbYBxjBfjUvlkn/vN1n+L9lE5E=";
-
-/* GOOGLE_PIN_UTNDATACorpSGC */
-static const char kGOOGLE_PIN_UTNDATACorpSGCFingerprint[] =
- "QAL80xHQczFWfnG82XHkYEjI3OjRZZcRdTs9qiommvo=";
-
-/* GOOGLE_PIN_VeriSignClass1 */
-static const char kGOOGLE_PIN_VeriSignClass1Fingerprint[] =
- "LclHC+Y+9KzxvYKGCUArt7h72ZY4pkOTTohoLRvowwg=";
-
-/* GOOGLE_PIN_VeriSignClass2_G2 */
-static const char kGOOGLE_PIN_VeriSignClass2_G2Fingerprint[] =
- "2oALgLKofTmeZvoZ1y/fSZg7R9jPMix8eVA6DH4o/q8=";
-
-/* GOOGLE_PIN_VeriSignClass3_G2 */
-static const char kGOOGLE_PIN_VeriSignClass3_G2Fingerprint[] =
- "AjyBzOjnxk+pQtPBUEhwfTXZu1uH9PVExb8bxWQ68vo=";
-
-/* GOOGLE_PIN_VeriSignClass4_G3 */
-static const char kGOOGLE_PIN_VeriSignClass4_G3Fingerprint[] =
- "VnuCEf0g09KD7gzXzgZyy52ZvFtIeljJ1U7Gf3fUqPU=";
-
-/* GeoTrust Global CA */
-static const char kGeoTrust_Global_CAFingerprint[] =
- "h6801m+z8v3zbgkRHpq6L29Esgfzhj89C1SyUCOQmqU=";
-
-/* GeoTrust Global CA 2 */
-static const char kGeoTrust_Global_CA_2Fingerprint[] =
- "F3VaXClfPS1y5vAxofB/QAxYi55YKyLxfq4xoVkNEYU=";
-
-/* GeoTrust Primary Certification Authority */
-static const char kGeoTrust_Primary_Certification_AuthorityFingerprint[] =
- "SQVGZiOrQXi+kqxcvWWE96HhfydlLVqFr4lQTqI5qqo=";
-
-/* GeoTrust Primary Certification Authority - G2 */
-static const char kGeoTrust_Primary_Certification_Authority___G2Fingerprint[] =
- "vPtEqrmtAhAVcGtBIep2HIHJ6IlnWQ9vlK50TciLePs=";
-
-/* GeoTrust Primary Certification Authority - G3 */
-static const char kGeoTrust_Primary_Certification_Authority___G3Fingerprint[] =
- "q5hJUnat8eyv8o81xTBIeB5cFxjaucjmelBPT2pRMo8=";
-
-/* GeoTrust Universal CA */
-static const char kGeoTrust_Universal_CAFingerprint[] =
- "lpkiXF3lLlbN0y3y6W0c/qWqPKC7Us2JM8I7XCdEOCA=";
-
-/* GeoTrust Universal CA 2 */
-static const char kGeoTrust_Universal_CA_2Fingerprint[] =
- "fKoDRlEkWQxgHlZ+UhSOlSwM/+iQAFMP4NlbbVDqrkE=";
-
-/* GlobalSign ECC Root CA - R4 */
-static const char kGlobalSign_ECC_Root_CA___R4Fingerprint[] =
- "CLOmM1/OXvSPjw5UOYbAf9GKOxImEp9hhku9W90fHMk=";
-
-/* GlobalSign ECC Root CA - R5 */
-static const char kGlobalSign_ECC_Root_CA___R5Fingerprint[] =
- "fg6tdrtoGdwvVFEahDVPboswe53YIFjqbABPAdndpd8=";
-
-/* GlobalSign Root CA */
-static const char kGlobalSign_Root_CAFingerprint[] =
- "K87oWBWM9UZfyddvDfoxL+8lpNyoUB2ptGtn0fv6G2Q=";
-
-/* GlobalSign Root CA - R2 */
-static const char kGlobalSign_Root_CA___R2Fingerprint[] =
- "iie1VXtL7HzAMF+/PVPR9xzT80kQxdZeJ+zduCB3uj0=";
-
-/* GlobalSign Root CA - R3 */
-static const char kGlobalSign_Root_CA___R3Fingerprint[] =
- "cGuxAXyFXFkWm61cF4HPWX8S0srS9j0aSqN0k4AP+4A=";
-
-/* Go Daddy Class 2 CA */
-static const char kGo_Daddy_Class_2_CAFingerprint[] =
- "VjLZe/p3W/PJnd6lL8JVNBCGQBZynFLdZSTIqcO0SJ8=";
-
-/* Go Daddy Root Certificate Authority - G2 */
-static const char kGo_Daddy_Root_Certificate_Authority___G2Fingerprint[] =
- "Ko8tivDrEjiY90yGasP6ZpBU4jwXvHqVvQI0GS3GNdA=";
-
-/* GoogleBackup2048 */
-static const char kGoogleBackup2048Fingerprint[] =
- "IPMbDAjLVSGntGO3WP53X/zilCVndez5YJ2+vJvhJsA=";
-
-/* SpiderOak2 */
-static const char kSpiderOak2Fingerprint[] =
- "7Y3UnxbffL8aFPXsOJBpGasgpDmngpIhAxGKdQRklQQ=";
-
-/* SpiderOak3 */
-static const char kSpiderOak3Fingerprint[] =
- "LkER54vOdlygpTsbYvlpMq1CE/lDAG1AP9xmdtwvV2A=";
-
-/* Starfield Class 2 CA */
-static const char kStarfield_Class_2_CAFingerprint[] =
- "FfFKxFycfaIz00eRZOgTf+Ne4POK6FgYPwhBDqgqxLQ=";
-
-/* Starfield Root Certificate Authority - G2 */
-static const char kStarfield_Root_Certificate_Authority___G2Fingerprint[] =
- "gI1os/q0iEpflxrOfRBVDXqVoWN3Tz7Dav/7IT++THQ=";
-
-/* Swehack */
-static const char kSwehackFingerprint[] =
- "FdaffE799rVb3oyAuhJ2mBW/XJwD07Uajb2G6YwSAEw=";
-
-/* SwehackBackup */
-static const char kSwehackBackupFingerprint[] =
- "z6cuswA6E1vgFkCjUsbEYo0Lf3aP8M8YOvwkoiGzDCo=";
-
-/* TestSPKI */
-static const char kTestSPKIFingerprint[] =
- "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
-
-/* Tor1 */
-static const char kTor1Fingerprint[] =
- "bYz9JTDk89X3qu3fgswG+lBQso5vI0N1f0Rx4go4nLo=";
-
-/* Tor2 */
-static const char kTor2Fingerprint[] =
- "xXCxhTdn7uxXneJSbQCqoAvuW3ZtQl2pDVTf2sewS8w=";
-
-/* Tor3 */
-static const char kTor3Fingerprint[] =
- "CleC1qwUR8JPgH1nXvSe2VHxDe5/KfNs96EusbfSOfo=";
-
-/* TumblrBackup */
-static const char kTumblrBackupFingerprint[] =
- "avlD96PLERV78IN1fD+ab5cupkUDD9wTZWJjHX6VC9w=";
-
-/* Twitter1 */
-static const char kTwitter1Fingerprint[] =
- "vU9M48LzD/CF34wE5PPf4nBwRyosy06X21J0ap8yS5s=";
-
-/* USERTrust ECC Certification Authority */
-static const char kUSERTrust_ECC_Certification_AuthorityFingerprint[] =
- "ICGRfpgmOUXIWcQ/HXPLQTkFPEFPoDyjvH7ohhQpjzs=";
-
-/* USERTrust RSA Certification Authority */
-static const char kUSERTrust_RSA_Certification_AuthorityFingerprint[] =
- "x4QzPSC810K5/cMjb05Qm4k3Bw5zBn4lTdO/nEW/Td4=";
-
-/* UTN USERFirst Email Root CA */
-static const char kUTN_USERFirst_Email_Root_CAFingerprint[] =
- "Laj56jRU0hFGRko/nQKNxMf7tXscUsc8KwVyovWZotM=";
-
-/* UTN USERFirst Hardware Root CA */
-static const char kUTN_USERFirst_Hardware_Root_CAFingerprint[] =
- "TUDnr0MEoJ3of7+YliBMBVFB4/gJsv5zO7IxD9+YoWI=";
-
-/* UTN USERFirst Object Root CA */
-static const char kUTN_USERFirst_Object_Root_CAFingerprint[] =
- "D+FMJksXu28NZT56cOs2Pb9UvhWAOe3a5cJXEd9IwQM=";
-
-/* VeriSign Class 3 Public Primary Certification Authority - G4 */
-static const char kVeriSign_Class_3_Public_Primary_Certification_Authority___G4Fingerprint[] =
- "UZJDjsNp1+4M5x9cbbdflB779y5YRBcV6Z6rBMLIrO4=";
-
-/* VeriSign Class 3 Public Primary Certification Authority - G5 */
-static const char kVeriSign_Class_3_Public_Primary_Certification_Authority___G5Fingerprint[] =
- "JbQbUG5JMJUoI6brnx0x3vZF6jilxsapbXGVfjhN8Fg=";
-
-/* VeriSign Universal Root Certification Authority */
-static const char kVeriSign_Universal_Root_Certification_AuthorityFingerprint[] =
- "lnsM2T/O9/J84sJFdnrpsFp3awZJ+ZZbYpCWhGloaHI=";
-
-/* Verisign Class 1 Public Primary Certification Authority - G3 */
-static const char kVerisign_Class_1_Public_Primary_Certification_Authority___G3Fingerprint[] =
- "IgduWu9Eu5pBaii30cRDItcFn2D+/6XK9sW+hEeJEwM=";
-
-/* Verisign Class 2 Public Primary Certification Authority - G3 */
-static const char kVerisign_Class_2_Public_Primary_Certification_Authority___G3Fingerprint[] =
- "cAajgxHlj7GTSEIzIYIQxmEloOSoJq7VOaxWHfv72QM=";
-
-/* Verisign Class 3 Public Primary Certification Authority - G3 */
-static const char kVerisign_Class_3_Public_Primary_Certification_Authority___G3Fingerprint[] =
- "SVqWumuteCQHvVIaALrOZXuzVVVeS7f4FGxxu6V+es4=";
-
-/* YahooBackup1 */
-static const char kYahooBackup1Fingerprint[] =
- "2fRAUXyxl4A1/XHrKNBmc8bTkzA7y4FB/GLJuNAzCqY=";
-
-/* YahooBackup2 */
-static const char kYahooBackup2Fingerprint[] =
- "dolnbtzEBnELx/9lOEQ22e6OZO/QNb6VSSX2XHA3E7A=";
-
-/* thawte Primary Root CA */
-static const char kthawte_Primary_Root_CAFingerprint[] =
- "HXXQgxueCIU5TTLHob/bPbwcKOKw6DkfsTWYHbxbqTY=";
-
-/* thawte Primary Root CA - G2 */
-static const char kthawte_Primary_Root_CA___G2Fingerprint[] =
- "Z9xPMvoQ59AaeaBzqgyeAhLsL/w9d54Kp/nA8OHCyJM=";
-
-/* thawte Primary Root CA - G3 */
-static const char kthawte_Primary_Root_CA___G3Fingerprint[] =
- "GQbGEk27Q4V40A4GbVBUxsN/D6YCjAVUXgmU7drshik=";
-
-/* Pinsets are each an ordered list by the actual value of the fingerprint */
-struct StaticFingerprints {
- const size_t size;
- const char* const* data;
-};
-
-/* PreloadedHPKPins.json pinsets */
-static const char* const kPinset_google_root_pems_Data[] = {
- kEntrust_Root_Certification_Authority___EC1Fingerprint,
- kComodo_Trusted_Services_rootFingerprint,
- kCOMODO_ECC_Certification_AuthorityFingerprint,
- kDigiCert_Assured_ID_Root_G2Fingerprint,
- kCOMODO_Certification_AuthorityFingerprint,
- kAddTrust_Low_Value_Services_RootFingerprint,
- kGlobalSign_ECC_Root_CA___R4Fingerprint,
- kGeoTrust_Global_CA_2Fingerprint,
- kDigiCert_Assured_ID_Root_G3Fingerprint,
- kStarfield_Class_2_CAFingerprint,
- kthawte_Primary_Root_CA___G3Fingerprint,
- kthawte_Primary_Root_CAFingerprint,
- kEntrust_net_Premium_2048_Secure_Server_CAFingerprint,
- kDigiCert_Assured_ID_Root_CAFingerprint,
- kUSERTrust_ECC_Certification_AuthorityFingerprint,
- kVeriSign_Class_3_Public_Primary_Certification_Authority___G5Fingerprint,
- kGlobalSign_Root_CAFingerprint,
- kGo_Daddy_Root_Certificate_Authority___G2Fingerprint,
- kAffirmTrust_Premium_ECCFingerprint,
- kAddTrust_Public_Services_RootFingerprint,
- kComodo_Secure_Services_rootFingerprint,
- kGeoTrust_Primary_Certification_AuthorityFingerprint,
- kVerisign_Class_3_Public_Primary_Certification_Authority___G3Fingerprint,
- kUTN_USERFirst_Hardware_Root_CAFingerprint,
- kVeriSign_Class_3_Public_Primary_Certification_Authority___G4Fingerprint,
- kGo_Daddy_Class_2_CAFingerprint,
- kDigiCert_Trusted_Root_G4Fingerprint,
- kDigiCert_High_Assurance_EV_Root_CAFingerprint,
- kBaltimore_CyberTrust_RootFingerprint,
- kthawte_Primary_Root_CA___G2Fingerprint,
- kAffirmTrust_CommercialFingerprint,
- kEntrust_Root_Certification_AuthorityFingerprint,
- kGlobalSign_Root_CA___R3Fingerprint,
- kEntrust_Root_Certification_Authority___G2Fingerprint,
- kGeoTrust_Universal_CA_2Fingerprint,
- kGlobalSign_ECC_Root_CA___R5Fingerprint,
- kCybertrust_Global_RootFingerprint,
- kStarfield_Root_Certificate_Authority___G2Fingerprint,
- kCOMODO_RSA_Certification_AuthorityFingerprint,
- kGeoTrust_Global_CAFingerprint,
- kDigiCert_Global_Root_G2Fingerprint,
- kGlobalSign_Root_CA___R2Fingerprint,
- kAffirmTrust_NetworkingFingerprint,
- kAddTrust_External_RootFingerprint,
- kVeriSign_Universal_Root_Certification_AuthorityFingerprint,
- kGeoTrust_Universal_CAFingerprint,
- kGeoTrust_Primary_Certification_Authority___G3Fingerprint,
- kDigiCert_Global_Root_CAFingerprint,
- kDigiCert_Global_Root_G3Fingerprint,
- kGeoTrust_Primary_Certification_Authority___G2Fingerprint,
- kComodo_AAA_Services_rootFingerprint,
- kAffirmTrust_PremiumFingerprint,
- kUSERTrust_RSA_Certification_AuthorityFingerprint,
- kAddTrust_Qualified_Certificates_RootFingerprint,
-};
-static const StaticFingerprints kPinset_google_root_pems = {
- sizeof(kPinset_google_root_pems_Data) / sizeof(const char*),
- kPinset_google_root_pems_Data
-};
-
-static const char* const kPinset_mozilla_Data[] = {
- kGeoTrust_Global_CA_2Fingerprint,
- kthawte_Primary_Root_CA___G3Fingerprint,
- kthawte_Primary_Root_CAFingerprint,
- kDigiCert_Assured_ID_Root_CAFingerprint,
- kVerisign_Class_1_Public_Primary_Certification_Authority___G3Fingerprint,
- kVeriSign_Class_3_Public_Primary_Certification_Authority___G5Fingerprint,
- kGeoTrust_Primary_Certification_AuthorityFingerprint,
- kVerisign_Class_3_Public_Primary_Certification_Authority___G3Fingerprint,
- kVeriSign_Class_3_Public_Primary_Certification_Authority___G4Fingerprint,
- kDigiCert_High_Assurance_EV_Root_CAFingerprint,
- kBaltimore_CyberTrust_RootFingerprint,
- kthawte_Primary_Root_CA___G2Fingerprint,
- kVerisign_Class_2_Public_Primary_Certification_Authority___G3Fingerprint,
- kGeoTrust_Universal_CA_2Fingerprint,
- kGeoTrust_Global_CAFingerprint,
- kVeriSign_Universal_Root_Certification_AuthorityFingerprint,
- kGeoTrust_Universal_CAFingerprint,
- kGeoTrust_Primary_Certification_Authority___G3Fingerprint,
- kDigiCert_Global_Root_CAFingerprint,
- kGeoTrust_Primary_Certification_Authority___G2Fingerprint,
-};
-static const StaticFingerprints kPinset_mozilla = {
- sizeof(kPinset_mozilla_Data) / sizeof(const char*),
- kPinset_mozilla_Data
-};
-
-static const char* const kPinset_mozilla_services_Data[] = {
- kDigiCert_Global_Root_CAFingerprint,
-};
-static const StaticFingerprints kPinset_mozilla_services = {
- sizeof(kPinset_mozilla_services_Data) / sizeof(const char*),
- kPinset_mozilla_services_Data
-};
-
-static const char* const kPinset_mozilla_test_Data[] = {
- kEnd_Entity_Test_CertFingerprint,
-};
-static const StaticFingerprints kPinset_mozilla_test = {
- sizeof(kPinset_mozilla_test_Data) / sizeof(const char*),
- kPinset_mozilla_test_Data
-};
-
-/* Chrome static pinsets */
-static const char* const kPinset_test_Data[] = {
- kTestSPKIFingerprint,
-};
-static const StaticFingerprints kPinset_test = {
- sizeof(kPinset_test_Data) / sizeof(const char*),
- kPinset_test_Data
-};
-
-static const char* const kPinset_google_Data[] = {
- kGOOGLE_PIN_GoogleG2Fingerprint,
- kGoogleBackup2048Fingerprint,
- kGeoTrust_Global_CAFingerprint,
- kGlobalSign_Root_CA___R2Fingerprint,
-};
-static const StaticFingerprints kPinset_google = {
- sizeof(kPinset_google_Data) / sizeof(const char*),
- kPinset_google_Data
-};
-
-static const char* const kPinset_tor_Data[] = {
- kTor3Fingerprint,
- kDigiCert_High_Assurance_EV_Root_CAFingerprint,
- kGOOGLE_PIN_LetsEncryptAuthorityPrimary_X1_X3Fingerprint,
- kTor1Fingerprint,
- kGOOGLE_PIN_RapidSSLFingerprint,
- kGOOGLE_PIN_LetsEncryptAuthorityBackup_X2_X4Fingerprint,
- kTor2Fingerprint,
-};
-static const StaticFingerprints kPinset_tor = {
- sizeof(kPinset_tor_Data) / sizeof(const char*),
- kPinset_tor_Data
-};
-
-static const char* const kPinset_twitterCom_Data[] = {
- kGOOGLE_PIN_VeriSignClass2_G2Fingerprint,
- kGOOGLE_PIN_VeriSignClass3_G2Fingerprint,
- kGeoTrust_Global_CA_2Fingerprint,
- kDigiCert_Assured_ID_Root_CAFingerprint,
- kVerisign_Class_1_Public_Primary_Certification_Authority___G3Fingerprint,
- kVeriSign_Class_3_Public_Primary_Certification_Authority___G5Fingerprint,
- kGOOGLE_PIN_VeriSignClass1Fingerprint,
- kGeoTrust_Primary_Certification_AuthorityFingerprint,
- kVerisign_Class_3_Public_Primary_Certification_Authority___G3Fingerprint,
- kVeriSign_Class_3_Public_Primary_Certification_Authority___G4Fingerprint,
- kGOOGLE_PIN_VeriSignClass4_G3Fingerprint,
- kDigiCert_High_Assurance_EV_Root_CAFingerprint,
- kVerisign_Class_2_Public_Primary_Certification_Authority___G3Fingerprint,
- kGeoTrust_Universal_CA_2Fingerprint,
- kGeoTrust_Global_CAFingerprint,
- kVeriSign_Universal_Root_Certification_AuthorityFingerprint,
- kGeoTrust_Universal_CAFingerprint,
- kGeoTrust_Primary_Certification_Authority___G3Fingerprint,
- kDigiCert_Global_Root_CAFingerprint,
- kGeoTrust_Primary_Certification_Authority___G2Fingerprint,
- kTwitter1Fingerprint,
-};
-static const StaticFingerprints kPinset_twitterCom = {
- sizeof(kPinset_twitterCom_Data) / sizeof(const char*),
- kPinset_twitterCom_Data
-};
-
-static const char* const kPinset_twitterCDN_Data[] = {
- kGOOGLE_PIN_VeriSignClass2_G2Fingerprint,
- kComodo_Trusted_Services_rootFingerprint,
- kCOMODO_Certification_AuthorityFingerprint,
- kGOOGLE_PIN_VeriSignClass3_G2Fingerprint,
- kAddTrust_Low_Value_Services_RootFingerprint,
- kUTN_USERFirst_Object_Root_CAFingerprint,
- kGOOGLE_PIN_GTECyberTrustGlobalRootFingerprint,
- kGeoTrust_Global_CA_2Fingerprint,
- kEntrust_net_Premium_2048_Secure_Server_CAFingerprint,
- kDigiCert_Assured_ID_Root_CAFingerprint,
- kVerisign_Class_1_Public_Primary_Certification_Authority___G3Fingerprint,
- kVeriSign_Class_3_Public_Primary_Certification_Authority___G5Fingerprint,
- kGlobalSign_Root_CAFingerprint,
- kUTN_USERFirst_Email_Root_CAFingerprint,
- kGOOGLE_PIN_VeriSignClass1Fingerprint,
- kAddTrust_Public_Services_RootFingerprint,
- kGOOGLE_PIN_UTNDATACorpSGCFingerprint,
- kComodo_Secure_Services_rootFingerprint,
- kGeoTrust_Primary_Certification_AuthorityFingerprint,
- kVerisign_Class_3_Public_Primary_Certification_Authority___G3Fingerprint,
- kUTN_USERFirst_Hardware_Root_CAFingerprint,
- kVeriSign_Class_3_Public_Primary_Certification_Authority___G4Fingerprint,
- kGOOGLE_PIN_VeriSignClass4_G3Fingerprint,
- kDigiCert_High_Assurance_EV_Root_CAFingerprint,
- kBaltimore_CyberTrust_RootFingerprint,
- kEntrust_Root_Certification_AuthorityFingerprint,
- kVerisign_Class_2_Public_Primary_Certification_Authority___G3Fingerprint,
- kGlobalSign_Root_CA___R3Fingerprint,
- kEntrust_Root_Certification_Authority___G2Fingerprint,
- kGeoTrust_Universal_CA_2Fingerprint,
- kGeoTrust_Global_CAFingerprint,
- kGlobalSign_Root_CA___R2Fingerprint,
- kAddTrust_External_RootFingerprint,
- kVeriSign_Universal_Root_Certification_AuthorityFingerprint,
- kGeoTrust_Universal_CAFingerprint,
- kGOOGLE_PIN_Entrust_SSLFingerprint,
- kGeoTrust_Primary_Certification_Authority___G3Fingerprint,
- kDigiCert_Global_Root_CAFingerprint,
- kGeoTrust_Primary_Certification_Authority___G2Fingerprint,
- kComodo_AAA_Services_rootFingerprint,
- kTwitter1Fingerprint,
- kAddTrust_Qualified_Certificates_RootFingerprint,
-};
-static const StaticFingerprints kPinset_twitterCDN = {
- sizeof(kPinset_twitterCDN_Data) / sizeof(const char*),
- kPinset_twitterCDN_Data
-};
-
-static const char* const kPinset_dropbox_Data[] = {
- kEntrust_Root_Certification_Authority___EC1Fingerprint,
- kEntrust_net_Premium_2048_Secure_Server_CAFingerprint,
- kDigiCert_Assured_ID_Root_CAFingerprint,
- kGo_Daddy_Root_Certificate_Authority___G2Fingerprint,
- kGOOGLE_PIN_GoDaddySecureFingerprint,
- kGo_Daddy_Class_2_CAFingerprint,
- kDigiCert_High_Assurance_EV_Root_CAFingerprint,
- kEntrust_Root_Certification_AuthorityFingerprint,
- kEntrust_Root_Certification_Authority___G2Fingerprint,
- kDigiCert_Global_Root_CAFingerprint,
-};
-static const StaticFingerprints kPinset_dropbox = {
- sizeof(kPinset_dropbox_Data) / sizeof(const char*),
- kPinset_dropbox_Data
-};
-
-static const char* const kPinset_facebook_Data[] = {
- kGOOGLE_PIN_DigiCertECCSecureServerCAFingerprint,
- kDigiCert_High_Assurance_EV_Root_CAFingerprint,
- kGOOGLE_PIN_SymantecClass3EVG3Fingerprint,
- kFacebookBackupFingerprint,
-};
-static const StaticFingerprints kPinset_facebook = {
- sizeof(kPinset_facebook_Data) / sizeof(const char*),
- kPinset_facebook_Data
-};
-
-static const char* const kPinset_spideroak_Data[] = {
- kSpiderOak2Fingerprint,
- kSpiderOak3Fingerprint,
- kDigiCert_High_Assurance_EV_Root_CAFingerprint,
- kGeoTrust_Global_CAFingerprint,
-};
-static const StaticFingerprints kPinset_spideroak = {
- sizeof(kPinset_spideroak_Data) / sizeof(const char*),
- kPinset_spideroak_Data
-};
-
-static const char* const kPinset_yahoo_Data[] = {
- kYahooBackup1Fingerprint,
- kGOOGLE_PIN_VeriSignClass2_G2Fingerprint,
- kDigiCert_Assured_ID_Root_CAFingerprint,
- kVeriSign_Class_3_Public_Primary_Certification_Authority___G5Fingerprint,
- kVerisign_Class_3_Public_Primary_Certification_Authority___G3Fingerprint,
- kVeriSign_Class_3_Public_Primary_Certification_Authority___G4Fingerprint,
- kDigiCert_Trusted_Root_G4Fingerprint,
- kDigiCert_High_Assurance_EV_Root_CAFingerprint,
- kVerisign_Class_2_Public_Primary_Certification_Authority___G3Fingerprint,
- kYahooBackup2Fingerprint,
- kDigiCert_Global_Root_G2Fingerprint,
- kVeriSign_Universal_Root_Certification_AuthorityFingerprint,
- kDigiCert_Global_Root_CAFingerprint,
- kDigiCert_Global_Root_G3Fingerprint,
-};
-static const StaticFingerprints kPinset_yahoo = {
- sizeof(kPinset_yahoo_Data) / sizeof(const char*),
- kPinset_yahoo_Data
-};
-
-static const char* const kPinset_swehackCom_Data[] = {
- kSwehackFingerprint,
- kDST_Root_CA_X3Fingerprint,
- kGOOGLE_PIN_LetsEncryptAuthorityPrimary_X1_X3Fingerprint,
- kGOOGLE_PIN_COMODORSADomainValidationSecureServerCAFingerprint,
- kGOOGLE_PIN_LetsEncryptAuthorityBackup_X2_X4Fingerprint,
- kSwehackBackupFingerprint,
-};
-static const StaticFingerprints kPinset_swehackCom = {
- sizeof(kPinset_swehackCom_Data) / sizeof(const char*),
- kPinset_swehackCom_Data
-};
-
-static const char* const kPinset_ncsccs_Data[] = {
- kCOMODO_ECC_Certification_AuthorityFingerprint,
- kDigiCert_Assured_ID_Root_CAFingerprint,
- kDigiCert_High_Assurance_EV_Root_CAFingerprint,
- kBaltimore_CyberTrust_RootFingerprint,
- kGOOGLE_PIN_LetsEncryptAuthorityPrimary_X1_X3Fingerprint,
- kCOMODO_RSA_Certification_AuthorityFingerprint,
- kAddTrust_External_RootFingerprint,
- kDigiCert_Global_Root_CAFingerprint,
- kGOOGLE_PIN_LetsEncryptAuthorityBackup_X2_X4Fingerprint,
-};
-static const StaticFingerprints kPinset_ncsccs = {
- sizeof(kPinset_ncsccs_Data) / sizeof(const char*),
- kPinset_ncsccs_Data
-};
-
-static const char* const kPinset_tumblr_Data[] = {
- kDigiCert_High_Assurance_EV_Root_CAFingerprint,
- kTumblrBackupFingerprint,
- kGOOGLE_PIN_DigiCertSHA2HighAssuranceServerCAFingerprint,
-};
-static const StaticFingerprints kPinset_tumblr = {
- sizeof(kPinset_tumblr_Data) / sizeof(const char*),
- kPinset_tumblr_Data
-};
-
-/* Domainlist */
-struct TransportSecurityPreload {
- const char* mHost;
- const bool mIncludeSubdomains;
- const bool mTestMode;
- const bool mIsMoz;
- const int32_t mId;
- const StaticFingerprints* pinset;
-};
-
-/* Sort hostnames for binary search. */
-static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
- { "exclude-subdomains.pinning.example.com", false, false, false, 0, &kPinset_mozilla_test },
- { "include-subdomains.pinning.example.com", true, false, false, -1, &kPinset_mozilla_test },
- { "test-mode.pinning.example.com", true, true, false, -1, &kPinset_mozilla_test },
-};
-
-// Pinning Preload List Length = 3;
-
-static const int32_t kUnknownId = -1;
-
-static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1609459199000000);
diff --git a/security/manager/ssl/moz.build b/security/manager/ssl/moz.build
index 94d766a0b..151c5b88a 100644
--- a/security/manager/ssl/moz.build
+++ b/security/manager/ssl/moz.build
@@ -127,13 +127,11 @@ UNIFIED_SOURCES += [
'nsSecureBrowserUIImpl.cpp',
'nsSecurityHeaderParser.cpp',
'NSSErrorsService.cpp',
- 'nsSiteSecurityService.cpp',
'nsSSLSocketProvider.cpp',
'nsSSLStatus.cpp',
'nsTLSSocketProvider.cpp',
'PSMContentListener.cpp',
'PSMRunnable.cpp',
- 'PublicKeyPinningService.cpp',
'SecretDecoderRing.cpp',
'SharedSSLState.cpp',
'SSLServerCertVerification.cpp',
@@ -141,6 +139,10 @@ UNIFIED_SOURCES += [
'WeakCryptoOverride.cpp',
]
+# nsSiteSecurityService exceeded the obj file sections limit because of the
+# HSTS preload list so it cannot be built in UNIFIED mode.
+SOURCES += ['nsSiteSecurityService.cpp']
+
IPDL_SOURCES += [
'PPSMContentDownloader.ipdl',
]
diff --git a/security/manager/ssl/nsISiteSecurityService.idl b/security/manager/ssl/nsISiteSecurityService.idl
index b61577152..d0e5f61ed 100644
--- a/security/manager/ssl/nsISiteSecurityService.idl
+++ b/security/manager/ssl/nsISiteSecurityService.idl
@@ -23,11 +23,11 @@ namespace mozilla
[ref] native nsCStringTArrayRef(nsTArray<nsCString>);
[ref] native mozillaPkixTime(mozilla::pkix::Time);
-[scriptable, uuid(233908bd-6741-4474-a6e1-f298c6ce9eaf)]
+[scriptable, uuid(91ea3803-9c79-45d9-97bf-88bc80269236)]
interface nsISiteSecurityService : nsISupports
{
const uint32_t HEADER_HSTS = 0;
- const uint32_t HEADER_HPKP = 1;
+ const uint32_t HEADER_HPKP = 1; /* no longer used */
const uint32_t HEADER_OMS = 2;
const uint32_t Success = 0;
@@ -39,10 +39,10 @@ interface nsISiteSecurityService : nsISupports
const uint32_t ERROR_INVALID_MAX_AGE = 6;
const uint32_t ERROR_MULTIPLE_INCLUDE_SUBDOMAINS = 7;
const uint32_t ERROR_INVALID_INCLUDE_SUBDOMAINS = 8;
- const uint32_t ERROR_INVALID_PIN = 9;
- const uint32_t ERROR_MULTIPLE_REPORT_URIS = 10;
- const uint32_t ERROR_PINSET_DOES_NOT_MATCH_CHAIN = 11;
- const uint32_t ERROR_NO_BACKUP_PIN = 12;
+ const uint32_t ERROR_INVALID_PIN = 9; /* no longer used */
+ const uint32_t ERROR_MULTIPLE_REPORT_URIS = 10; /* no longer used */
+ const uint32_t ERROR_PINSET_DOES_NOT_MATCH_CHAIN = 11; /* no longer used */
+ const uint32_t ERROR_NO_BACKUP_PIN = 12; /* no longer used */
const uint32_t ERROR_COULD_NOT_SAVE_STATE = 13;
const uint32_t ERROR_ROOT_NOT_BUILT_IN = 14;
@@ -106,13 +106,10 @@ interface nsISiteSecurityService : nsISupports
* @param aURI the URI of the target host
* @param aFlags options for this request as defined in nsISocketProvider:
* NO_PERMANENT_STORAGE
- * @param force if set, forces no-HSTS state by writing a knockout value,
- * overriding any preload list state
*/
void removeState(in uint32_t aType,
in nsIURI aURI,
- in uint32_t aFlags,
- [optional] in boolean force);
+ in uint32_t aFlags);
/**
* See isSecureURI
@@ -153,47 +150,6 @@ interface nsISiteSecurityService : nsISupports
* settings.
*/
void clearAll();
-
- /**
- * Removes all preloaded security state.
- */
- void clearPreloads();
-
- /**
- * Returns an array of sha256-hashed key pins for the given domain, if any.
- * If these pins also apply to subdomains of the given domain,
- * aIncludeSubdomains will be true. Pins returned are only for non-built-in
- * pin entries.
- *
- * @param aHostname the hosname (punycode) to be queried about
- * @param the time at which the pins should be valid. This is in
- mozilla::pkix::Time which uses internally seconds since 0 AD.
- * @param aPinArray the set of sha256-hashed key pins for the given domain
- * @param aIncludeSubdomains true if the pins apply to subdomains of the
- * given domain
- */
- [noscript] boolean getKeyPinsForHostname(in string aHostname,
- in mozillaPkixTime evalTime,
- out nsCStringTArrayRef aPinArray,
- out boolean aIncludeSubdomains);
-
- /**
- * Set public-key pins for a host. The resulting pins will be permanent
- * and visible from private and non-private contexts. These pins replace
- * any already set by this mechanism or those built-in to Gecko.
- *
- * @param aHost the hostname (punycode) that pins will apply to
- * @param aIncludeSubdomains whether these pins also apply to subdomains
- * @param aExpires the time this pin should expire (millis since epoch)
- * @param aPinCount number of keys being pinnned
- * @param aSha256Pins array of hashed key fingerprints (SHA-256, base64)
- * @param aIsPreload are these key pins for a preload entry? (false by
- * default)
- */
- boolean setKeyPins(in string aHost, in boolean aIncludeSubdomains,
- in int64_t aExpires, in unsigned long aPinCount,
- [array, size_is(aPinCount)] in string aSha256Pins,
- [optional] in boolean aIsPreload);
};
%{C++
diff --git a/security/manager/ssl/nsNSSComponent.cpp b/security/manager/ssl/nsNSSComponent.cpp
index 4d6c3963f..897b5743c 100644
--- a/security/manager/ssl/nsNSSComponent.cpp
+++ b/security/manager/ssl/nsNSSComponent.cpp
@@ -12,6 +12,9 @@
#include "SharedSSLState.h"
#include "cert.h"
#include "certdb.h"
+#ifdef MOZ_SECURITY_SQLSTORE
+#include "mozStorageCID.h"
+#endif
#include "mozilla/ArrayUtils.h"
#include "mozilla/Casting.h"
#include "mozilla/Preferences.h"
@@ -1267,26 +1270,19 @@ nsNSSComponent::InitializePIPNSSBundle()
nsresult rv;
nsCOMPtr<nsIStringBundleService> bundleService(do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv));
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
- MOZ_RELEASE_ASSERT(bundleService);
-#endif
+
if (NS_FAILED(rv) || !bundleService)
return NS_ERROR_FAILURE;
bundleService->CreateBundle("chrome://pipnss/locale/pipnss.properties",
getter_AddRefs(mPIPNSSBundle));
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(mPIPNSSBundle);
-#endif
+
if (!mPIPNSSBundle)
rv = NS_ERROR_FAILURE;
bundleService->CreateBundle("chrome://pipnss/locale/nsserrors.properties",
getter_AddRefs(mNSSErrorsBundle));
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(mNSSErrorsBundle);
-#endif
+
if (!mNSSErrorsBundle)
rv = NS_ERROR_FAILURE;
@@ -1488,9 +1484,7 @@ CipherSuiteChangeObserver::StartObserve()
if (!sObserver) {
RefPtr<CipherSuiteChangeObserver> observer = new CipherSuiteChangeObserver();
nsresult rv = Preferences::AddStrongObserver(observer.get(), "security.");
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
-#endif
+
if (NS_FAILED(rv)) {
sObserver = nullptr;
return rv;
@@ -1712,21 +1706,28 @@ GetNSSProfilePath(nsAutoCString& aProfilePath)
}
#if defined(XP_WIN)
- // Native path will drop Unicode characters that cannot be mapped to system's
- // codepage, using short (canonical) path as workaround.
nsCOMPtr<nsILocalFileWin> profileFileWin(do_QueryInterface(profileFile));
if (!profileFileWin) {
MOZ_LOG(gPIPNSSLog, LogLevel::Error,
("Could not get nsILocalFileWin for profile directory.\n"));
return NS_ERROR_FAILURE;
}
+#ifdef MOZ_SECURITY_SQLSTORE
+ // SQLite always takes UTF-8 file paths regardless of the current system
+ // code page.
+ nsAutoString u16ProfilePath;
+ rv = profileFileWin->GetCanonicalPath(u16ProfilePath);
+ CopyUTF16toUTF8(u16ProfilePath, aProfilePath);
+#else
+ // Native path will drop Unicode characters that cannot be mapped to system's
+ // codepage, using short (canonical) path as workaround.
rv = profileFileWin->GetNativeCanonicalPath(aProfilePath);
+#endif
#else
+ // On non-Windows, just get the native profile path.
rv = profileFile->GetNativePath(aProfilePath);
#endif
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
-#endif
+
if (NS_FAILED(rv)) {
MOZ_LOG(gPIPNSSLog, LogLevel::Error,
("Could not get native path for profile directory.\n"));
@@ -1754,9 +1755,6 @@ nsNSSComponent::InitializeNSS()
MutexAutoLock lock(mutex);
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(!mNSSInitialized);
-#endif
if (mNSSInitialized) {
// We should never try to initialize NSS more than once in a process.
MOZ_ASSERT_UNREACHABLE("Trying to initialize NSS twice");
@@ -1775,9 +1773,7 @@ nsNSSComponent::InitializeNSS()
nsAutoCString profileStr;
nsresult rv = GetNSSProfilePath(profileStr);
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
-#endif
+
if (NS_FAILED(rv)) {
return NS_ERROR_NOT_AVAILABLE;
}
@@ -1791,9 +1787,7 @@ nsNSSComponent::InitializeNSS()
// modules will be loaded).
if (runtime) {
rv = runtime->GetInSafeMode(&inSafeMode);
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
-#endif
+
if (NS_FAILED(rv)) {
return rv;
}
@@ -1818,14 +1812,9 @@ nsNSSComponent::InitializeNSS()
// pref has been set to "true", attempt to initialize with no DB.
if (nocertdb || init_rv != SECSuccess) {
init_rv = NSS_NoDB_Init(nullptr);
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(init_rv == SECSuccess);
-#endif
}
+
if (init_rv != SECSuccess) {
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(false);
-#endif
MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("could not initialize NSS - panicking\n"));
return NS_ERROR_NOT_AVAILABLE;
}
@@ -1847,9 +1836,7 @@ nsNSSComponent::InitializeNSS()
SSL_OptionSetDefault(SSL_V2_COMPATIBLE_HELLO, false);
rv = setEnabledTLSVersions();
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
-#endif
+
if (NS_FAILED(rv)) {
return NS_ERROR_UNEXPECTED;
}
@@ -1858,9 +1845,7 @@ nsNSSComponent::InitializeNSS()
LoadLoadableRoots();
rv = LoadExtendedValidationInfo();
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
-#endif
+
if (NS_FAILED(rv)) {
MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("failed to load EV info"));
return rv;
@@ -1900,18 +1885,14 @@ nsNSSComponent::InitializeNSS()
ENABLED_0RTT_DATA_DEFAULT));
if (NS_FAILED(InitializeCipherSuite())) {
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(false);
-#endif
+
MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("Unable to initialize cipher suite settings\n"));
return NS_ERROR_FAILURE;
}
// ensure the CertBlocklist is initialised
nsCOMPtr<nsICertBlocklist> certList = do_GetService(NS_CERTBLOCKLIST_CONTRACTID);
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(certList);
-#endif
+
if (!certList) {
return NS_ERROR_FAILURE;
}
@@ -1928,9 +1909,7 @@ nsNSSComponent::InitializeNSS()
// Initialize the site security service
nsCOMPtr<nsISiteSecurityService> sssService =
do_GetService(NS_SSSERVICE_CONTRACTID);
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(sssService);
-#endif
+
if (!sssService) {
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Cannot initialize site security service\n"));
return NS_ERROR_FAILURE;
@@ -1939,9 +1918,7 @@ nsNSSComponent::InitializeNSS()
// Initialize the cert override service
nsCOMPtr<nsICertOverrideService> coService =
do_GetService(NS_CERTOVERRIDE_CONTRACTID);
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(coService);
-#endif
+
if (!coService) {
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Cannot initialize cert override service\n"));
return NS_ERROR_FAILURE;
@@ -2005,14 +1982,20 @@ nsNSSComponent::Init()
return NS_ERROR_NOT_SAME_THREAD;
}
+#ifdef MOZ_SECURITY_SQLSTORE
+ // To avoid an sqlite3_config race in NSS init, we require the storage service to get initialized first.
+ nsCOMPtr<nsISupports> storageService = do_GetService(MOZ_STORAGE_SERVICE_CONTRACTID);
+ if (!storageService) {
+ return NS_ERROR_NOT_AVAILABLE;
+ }
+#endif
+
nsresult rv = NS_OK;
MOZ_LOG(gPIPNSSLog, LogLevel::Debug, ("Beginning NSS initialization\n"));
rv = InitializePIPNSSBundle();
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
-#endif
+
if (NS_FAILED(rv)) {
MOZ_LOG(gPIPNSSLog, LogLevel::Error, ("Unable to create pipnss bundle.\n"));
return rv;
@@ -2033,9 +2016,7 @@ nsNSSComponent::Init()
rv = InitializeNSS();
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(NS_SUCCEEDED(rv));
-#endif
+
if (NS_FAILED(rv)) {
MOZ_LOG(gPIPNSSLog, LogLevel::Error,
("nsNSSComponent::InitializeNSS() failed\n"));
@@ -2197,9 +2178,7 @@ nsNSSComponent::RegisterObservers()
nsCOMPtr<nsIObserverService> observerService(
do_GetService("@mozilla.org/observer-service;1"));
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(observerService);
-#endif
+
if (!observerService) {
MOZ_LOG(gPIPNSSLog, LogLevel::Debug,
("nsNSSComponent: couldn't get observer service\n"));
@@ -2421,9 +2400,6 @@ InitializeCipherSuite()
NS_ASSERTION(NS_IsMainThread(), "InitializeCipherSuite() can only be accessed in main thread");
if (NSS_SetDomesticPolicy() != SECSuccess) {
-#ifdef ANDROID
- MOZ_RELEASE_ASSERT(false);
-#endif
return NS_ERROR_FAILURE;
}
diff --git a/security/manager/ssl/nsSTSPreloadList.errors b/security/manager/ssl/nsSTSPreloadList.errors
deleted file mode 100644
index dc161dc7a..000000000
--- a/security/manager/ssl/nsSTSPreloadList.errors
+++ /dev/null
@@ -1,32629 +0,0 @@
-0-1.party: could not connect to host
-0005.com: could not connect to host
-0005aa.com: could not connect to host
-0005pay.com: could not connect to host
-000a1.com: did not receive HSTS header
-000a2.com: did not receive HSTS header
-000a3.com: did not receive HSTS header
-000a5.com: did not receive HSTS header
-000a6.com: did not receive HSTS header
-000a7.com: did not receive HSTS header
-000a8.com: did not receive HSTS header
-000a9.com: did not receive HSTS header
-000books.net: did not receive HSTS header
-000x2.com: did not receive HSTS header
-000x3.com: did not receive HSTS header
-0010100.net: could not connect to host
-00220022.net: could not connect to host
-00228555.com: did not receive HSTS header
-00228999.com: did not receive HSTS header
-00228aa.com: did not receive HSTS header
-00228b.com: could not connect to host
-00228bb.com: could not connect to host
-00228c.com: could not connect to host
-00228cc.com: did not receive HSTS header
-00228d.com: did not receive HSTS header
-00228dd.com: did not receive HSTS header
-00228e.com: could not connect to host
-00228ee.com: could not connect to host
-00228f.com: did not receive HSTS header
-00228g.com: could not connect to host
-00228gg.com: did not receive HSTS header
-00228h.com: did not receive HSTS header
-00228hh.com: did not receive HSTS header
-00228jj.com: did not receive HSTS header
-00228k.com: did not receive HSTS header
-00228kk.com: did not receive HSTS header
-00228m.com: could not connect to host
-00228mm.com: did not receive HSTS header
-00228nn.com: could not connect to host
-00228p.com: did not receive HSTS header
-00228pp.com: did not receive HSTS header
-00228q.com: could not connect to host
-00228r.com: could not connect to host
-00228rr.com: could not connect to host
-00228s.com: did not receive HSTS header
-00228ss.com: did not receive HSTS header
-00228t.com: could not connect to host
-00228tt.com: could not connect to host
-00228u.com: could not connect to host
-00228v.com: could not connect to host
-00228vip1.com: could not connect to host
-00228vip3.com: could not connect to host
-00228vip5.com: could not connect to host
-00228vip6.com: could not connect to host
-00228vip8.com: could not connect to host
-00228vv.com: could not connect to host
-00228w.com: could not connect to host
-00228y.com: could not connect to host
-00321365.com: could not connect to host
-00330033.net: did not receive HSTS header
-00334.vip: could not connect to host
-00370038.com: max-age too low: 0
-0038088.com: max-age too low: 0
-003zl.com: could not connect to host
-005555.xyz: did not receive HSTS header
-00660066.net: could not connect to host
-007-preisvergleich.de: did not receive HSTS header
-00778899.com: could not connect to host
-007kf.com: could not connect to host
-007sascha.de: did not receive HSTS header
-0086286.com: did not receive HSTS header
-00880088.net: could not connect to host
-008yingshi.com: could not connect to host
-009p.com: could not connect to host
-009zl.com: could not connect to host
-00b58.com: could not connect to host
-00rfb.com: did not receive HSTS header
-00wbf.com: could not connect to host
-01-edu.org: did not receive HSTS header
-0100dev.com: did not receive HSTS header
-0100dev.nl: did not receive HSTS header
-010777a.com: could not connect to host
-010888a.com: could not connect to host
-01100010011001010111001101110100.com: could not connect to host
-011zl.com: could not connect to host
-012zl.com: could not connect to host
-013028.com: did not receive HSTS header
-0138365.com: could not connect to host
-0139365.com: could not connect to host
-016028.com: did not receive HSTS header
-016098.com: did not receive HSTS header
-016298.com: did not receive HSTS header
-016328.com: did not receive HSTS header
-018663.com: could not connect to host
-018zl.com: could not connect to host
-019328.com: could not connect to host
-019398.com: did not receive HSTS header
-01electronica.com.ar: did not receive HSTS header
-01media.fr: did not receive HSTS header
-01seguridad.com.ar: did not receive HSTS header
-01smh.com: could not connect to host
-0205wc.com: max-age too low: 0
-020wifi.nl: could not connect to host
-021002.com: could not connect to host
-0222.mg: could not connect to host
-0222aa.com: could not connect to host
-022561.com: could not connect to host
-023838.com: could not connect to host
-023sec.com: could not connect to host
-025ks.com: could not connect to host
-02607.com: could not connect to host
-028718.com: did not receive HSTS header
-029978.com: could not connect to host
-029inno.com: did not receive HSTS header
-02dl.net: could not connect to host
-02smh.com: could not connect to host
-03-09-2016.wedding: could not connect to host
-0311buy.cn: could not connect to host
-031373.com: could not connect to host
-035711630.xyz: could not connect to host
-0380l.com: max-age too low: 0
-038663.com: could not connect to host
-0391315.com: could not connect to host
-0393ee.com: could not connect to host
-03region.ga: could not connect to host
-040fit.nl: did not receive HSTS header
-040fitvitality.nl: did not receive HSTS header
-048.ag: could not connect to host
-04dco.tk: could not connect to host
-04sun.com: could not connect to host
-050.ca: could not connect to host
-050.tv: did not receive HSTS header
-050508.com: could not connect to host
-050a1.com: did not receive HSTS header
-050a2.com: did not receive HSTS header
-050a3.com: did not receive HSTS header
-050a4.com: did not receive HSTS header
-050a5.com: did not receive HSTS header
-050a6.com: did not receive HSTS header
-0513c.com: did not receive HSTS header
-0531009.com: max-age too low: 0
-055268.com: did not receive HSTS header
-056657.com: could not connect to host
-056679.com: could not connect to host
-0571z6.com: did not receive HSTS header
-059957.com: could not connect to host
-060258.com: could not connect to host
-060579.com: could not connect to host
-060757.com: could not connect to host
-060796.com: could not connect to host
-060798.com: could not connect to host
-066318.com: did not receive HSTS header
-066538.com: did not receive HSTS header
-066718.com: did not receive HSTS header
-066928.com: did not receive HSTS header
-066938.com: could not connect to host
-0681a.com: could not connect to host
-0681h.com: could not connect to host
-0681k.com: could not connect to host
-0681n.com: could not connect to host
-069657.com: did not receive HSTS header
-069676.com: did not receive HSTS header
-070709.net: could not connect to host
-07733.win: could not connect to host
-077768.net: could not connect to host
-078663.com: could not connect to host
-078805.com: did not receive HSTS header
-078810.com: did not receive HSTS header
-078820.com: did not receive HSTS header
-078860.com: did not receive HSTS header
-078890.com: could not connect to host
-0788yh.com: could not connect to host
-07stars.com: did not receive HSTS header
-080261.com: did not receive HSTS header
-0809yh.com: could not connect to host
-081638.com: did not receive HSTS header
-085806.com: could not connect to host
-086628.com: could not connect to host
-086807.com: did not receive HSTS header
-086907.com: could not connect to host
-087010.com: could not connect to host
-087059.com: did not receive HSTS header
-089818.com: could not connect to host
-08am8.com: could not connect to host
-08detaxe.fr: could not connect to host
-09115.com: did not receive HSTS header
-0916app.com: did not receive HSTS header
-098955.com: could not connect to host
-0999sfce.com: max-age too low: 0
-09elektrik.com: could not connect to host
-0akarma.me: could not connect to host
-0c.eu: did not receive HSTS header
-0cd.xyz: did not receive HSTS header
-0cdn.ga: could not connect to host
-0d111.com: could not connect to host
-0d222.com: did not receive HSTS header
-0d333.com: could not connect to host
-0d444.com: could not connect to host
-0d555.com: did not receive HSTS header
-0d666.com: did not receive HSTS header
-0d777.com: did not receive HSTS header
-0d888.com: did not receive HSTS header
-0d999.com: did not receive HSTS header
-0day.su: could not connect to host
-0f.io: could not connect to host
-0fl.com: did not receive HSTS header
-0g.org.uk: could not connect to host
-0i0.nl: could not connect to host
-0o0.edu.pl: could not connect to host
-0o0.ooo: could not connect to host
-0p.no: did not receive HSTS header
-0vi.org: could not connect to host
-0vo.moe: could not connect to host
-0w0.vc: could not connect to host
-0x0.cloud: could not connect to host
-0x0a.net: could not connect to host
-0x1337.eu: could not connect to host
-0x3bb.net: could not connect to host
-0x44.net: did not receive HSTS header
-0x48.pw: did not receive HSTS header
-0x4b0c131e.pub: could not connect to host
-0x52.org: could not connect to host
-0x539.be: did not receive HSTS header
-0x539.pw: could not connect to host
-0x5f3759df.cf: could not connect to host
-0x65.net: did not receive HSTS header
-0x90.fi: could not connect to host
-0xa.in: could not connect to host
-0xaa55.me: could not connect to host
-0xacab.org: did not receive HSTS header
-0xb612.org: could not connect to host
-0xcafec0.de: did not receive HSTS header
-0xee.eu: could not connect to host
-0yen.org: could not connect to host
-1.0.0.1: max-age too low: 0
-100086ll.com: max-age too low: 0
-1000hats.com: did not receive HSTS header
-1000serien.com: could not connect to host
-1001.best: could not connect to host
-1001carats.fr: could not connect to host
-1001firms.com: could not connect to host
-1001mv.com: could not connect to host
-1002712.com: did not receive HSTS header
-10086.nl: could not connect to host
-100and1.jp: did not receive HSTS header
-100onrainkajino.com: could not connect to host
-100pudov.tk: could not connect to host
-100rembourse.be: did not receive HSTS header
-1017scribes.com: could not connect to host
-1018hosting.nl: did not receive HSTS header
-1022996493.rsc.cdn77.org: could not connect to host
-10365001.com: could not connect to host
-10365002.com: could not connect to host
-10365003.com: could not connect to host
-10365005.com: could not connect to host
-10365006.com: could not connect to host
-10365007.com: could not connect to host
-10365008.com: could not connect to host
-10365009.com: could not connect to host
-103656666.com: could not connect to host
-103658888.com: could not connect to host
-10365a.com: could not connect to host
-10365app.com: could not connect to host
-10365c.com: could not connect to host
-10365e.com: could not connect to host
-10365f.com: could not connect to host
-10365g.com: could not connect to host
-10365h.com: could not connect to host
-10414.org: could not connect to host
-1049578.com: max-age too low: 0
-1066.io: did not receive HSTS header
-1068511.com: could not connect to host
-1080.com: did not receive HSTS header
-1091.jp: could not connect to host
-10gb.io: could not connect to host
-10giant.com: could not connect to host
-10n13.com: could not connect to host
-10og.de: could not connect to host
-10seos.com: did not receive HSTS header
-10tacle.io: could not connect to host
-10v2.com: did not receive HSTS header
-10x.ooo: could not connect to host
-10xiuxiu.com: could not connect to host
-1100.so: could not connect to host
-11018vip.com: could not connect to host
-110692.com: could not connect to host
-1116pay.com: did not receive HSTS header
-1119968.com: did not receive HSTS header
-1120313.com: could not connect to host
-1120327.com: could not connect to host
-1120328.com: could not connect to host
-1120330.com: could not connect to host
-1120331.com: could not connect to host
-1120332.com: could not connect to host
-1120334.com: could not connect to host
-1120335.com: could not connect to host
-1120336.com: could not connect to host
-1120337.com: could not connect to host
-1120338.com: could not connect to host
-1120339.com: could not connect to host
-1120341.com: could not connect to host
-1120342.com: could not connect to host
-1120343.com: could not connect to host
-1120344.com: could not connect to host
-1120345.com: could not connect to host
-1120346.com: could not connect to host
-1120347.com: could not connect to host
-1120348.com: could not connect to host
-1120349.com: could not connect to host
-1120350.com: could not connect to host
-11221jz.com: could not connect to host
-1126p.com: could not connect to host
-1130p.com: could not connect to host
-11321365.com: could not connect to host
-1177107.com: could not connect to host
-11b58.com: could not connect to host
-11bt.cc: did not receive HSTS header
-11dzon.com: could not connect to host
-11recruitment.com.au: max-age too low: 0
-11scc.com: could not connect to host
-120dayweightloss.com: could not connect to host
-1220301.com: could not connect to host
-1220302.com: could not connect to host
-1220303.com: could not connect to host
-1220304.com: could not connect to host
-1220305.com: could not connect to host
-1220306.com: could not connect to host
-1220307.com: could not connect to host
-1220308.com: could not connect to host
-1220309.com: could not connect to host
-1220310.com: could not connect to host
-1220311.com: could not connect to host
-1220312.com: could not connect to host
-1220313.com: could not connect to host
-1220314.com: could not connect to host
-1220315.com: could not connect to host
-1220316.com: could not connect to host
-1220317.com: could not connect to host
-1220318.com: could not connect to host
-1220319.com: could not connect to host
-1220320.com: could not connect to host
-1220321.com: could not connect to host
-1220322.com: could not connect to host
-1220323.com: could not connect to host
-1220324.com: could not connect to host
-1220325.com: could not connect to host
-1220326.com: could not connect to host
-1220327.com: could not connect to host
-1220328.com: could not connect to host
-1220329.com: could not connect to host
-1220330.com: could not connect to host
-1220331.com: could not connect to host
-1220332.com: could not connect to host
-1220334.com: could not connect to host
-1220335.com: could not connect to host
-1220336.com: could not connect to host
-1220337.com: could not connect to host
-1220338.com: could not connect to host
-1220339.com: could not connect to host
-1220340.com: could not connect to host
-1220342.com: could not connect to host
-1220343.com: could not connect to host
-1220344.com: could not connect to host
-1220345.com: could not connect to host
-1220346.com: could not connect to host
-1220347.com: could not connect to host
-1220348.com: could not connect to host
-1220349.com: could not connect to host
-1220350.com: could not connect to host
-123.gg: could not connect to host
-123110.com: could not connect to host
-1231212.com: could not connect to host
-123123q.com: could not connect to host
-123123qq.com: could not connect to host
-123666365.com: did not receive HSTS header
-123derivatives.com: did not receive HSTS header
-123djdrop.com: did not receive HSTS header
-123movies.fyi: could not connect to host
-123pay.ir: did not receive HSTS header
-123plons.nl: could not connect to host
-123share.org: could not connect to host
-123test.com: did not receive HSTS header
-123test.de: did not receive HSTS header
-123test.es: did not receive HSTS header
-123test.fr: did not receive HSTS header
-123test.nl: did not receive HSTS header
-1265353.com: max-age too low: 0
-126ium.moe: could not connect to host
-127011-networks.ch: could not connect to host
-1288366.com: could not connect to host
-1288fc.com: could not connect to host
-12gotovo.com: did not receive HSTS header
-12n13.com: could not connect to host
-12photos.eu: could not connect to host
-12vpn.org: could not connect to host
-12vpnchina.com: could not connect to host
-130497.xyz: did not receive HSTS header
-130978.com: did not receive HSTS header
-131365qq.com: could not connect to host
-1325390854.com: max-age too low: 0
-13318522.com: could not connect to host
-133846.xyz: did not receive HSTS header
-135vv.com: could not connect to host
-136774.com: could not connect to host
-13826145000.com: could not connect to host
-13866670.com: max-age too low: 0
-1396.cc: could not connect to host
-1396.net: did not receive HSTS header
-13982407454.com: max-age too low: 0
-1406304513.com: max-age too low: 0
-1441805971.com: max-age too low: 0
-1481486.net: could not connect to host
-148663.com: could not connect to host
-1520301.com: could not connect to host
-1520302.com: could not connect to host
-1520303.com: could not connect to host
-1520304.com: could not connect to host
-1520305.com: could not connect to host
-1520306.com: could not connect to host
-1520310.com: could not connect to host
-1520316.com: could not connect to host
-1520318.com: could not connect to host
-1520319.com: could not connect to host
-1520320.com: could not connect to host
-1520322.com: could not connect to host
-1520323.com: could not connect to host
-1520324.com: could not connect to host
-1520325.com: could not connect to host
-1520326.com: could not connect to host
-1520327.com: could not connect to host
-1520328.com: could not connect to host
-1527web.com: could not connect to host
-1536.cf: could not connect to host
-158306.com: did not receive HSTS header
-16164f.com: could not connect to host
-162632.com: could not connect to host
-163pwd.com: could not connect to host
-166166.com: could not connect to host
-1683657.com: could not connect to host
-1689886.com: did not receive HSTS header
-168bet9.com: could not connect to host
-168esb.com: could not connect to host
-168wcw.com: max-age too low: 0
-169xpj.com: could not connect to host
-16book.org: could not connect to host
-16deza.com: did not receive HSTS header
-16qw.tk: could not connect to host
-16region.tk: could not connect to host
-17187q.com: could not connect to host
-1720303.com: could not connect to host
-1720336.com: could not connect to host
-173vpn.cn: could not connect to host
-173vpns.com: could not connect to host
-173vpnv.com: could not connect to host
-174.net.nz: could not connect to host
-174343.com: could not connect to host
-17hats.com: did not receive HSTS header
-1820317.com: could not connect to host
-1820325.com: could not connect to host
-1820326.com: could not connect to host
-1820327.com: could not connect to host
-1820328.com: could not connect to host
-1820329.com: could not connect to host
-1820330.com: could not connect to host
-1820331.com: could not connect to host
-1820332.com: could not connect to host
-1820333.com: could not connect to host
-1820334.com: could not connect to host
-1820335.com: could not connect to host
-1820336.com: could not connect to host
-1820337.com: could not connect to host
-1820338.com: could not connect to host
-1820340.com: could not connect to host
-1820341.com: could not connect to host
-1820342.com: could not connect to host
-1820343.com: could not connect to host
-1820344.com: could not connect to host
-1820345.com: could not connect to host
-1820346.com: could not connect to host
-1820347.com: could not connect to host
-1820348.com: could not connect to host
-182wh.com: could not connect to host
-1834202695.com: max-age too low: 0
-18680288.com: max-age too low: 0
-188198.net: could not connect to host
-188522.com: did not receive HSTS header
-18858586888.com: max-age too low: 0
-18888msc.com: could not connect to host
-1888zr.com: did not receive HSTS header
-1889p.com: could not connect to host
-188betwarriors.co.uk: could not connect to host
-188trafalgar.ca: could not connect to host
-1890p.com: did not receive HSTS header
-1895media.com: did not receive HSTS header
-189dv.com: could not connect to host
-189fc.com: could not connect to host
-18celebration.com: did not receive HSTS header
-18celebration.org: did not receive HSTS header
-191090.com: could not connect to host
-1912x.com: could not connect to host
-1918173197.com: max-age too low: 0
-192.io: could not connect to host
-192080.com: could not connect to host
-19216811.online: could not connect to host
-192168ll.repair: could not connect to host
-1921958389.rsc.cdn77.org: could not connect to host
-192569.com: did not receive HSTS header
-195gm.com: could not connect to host
-197jjj.com: did not receive HSTS header
-198752qq.com: max-age too low: 0
-198jjj.com: did not receive HSTS header
-19990ff.com: could not connect to host
-19990ii.com: could not connect to host
-19990kk.com: could not connect to host
-19990uu.com: could not connect to host
-19990xx.com: could not connect to host
-19area.cn: could not connect to host
-1a-jva.de: could not connect to host
-1a-vermessung.at: did not receive HSTS header
-1aim.com: did not receive HSTS header
-1atic.com: could not connect to host
-1co-jp.net: did not receive HSTS header
-1cover.com: did not receive HSTS header
-1cswd.com: did not receive HSTS header
-1day1ac.red: could not connect to host
-1db77.cn: did not receive HSTS header
-1er-secours.ch: could not connect to host
-1f412.space: did not receive HSTS header
-1gsoft.com: did not receive HSTS header
-1hfree.tk: could not connect to host
-1item.co.il: did not receive HSTS header
-1k8b.com: could not connect to host
-1lc00.com: did not receive HSTS header
-1lc11.com: did not receive HSTS header
-1lc22.com: did not receive HSTS header
-1lc33.com: did not receive HSTS header
-1lc44.com: did not receive HSTS header
-1lc55.com: did not receive HSTS header
-1m.duckdns.org: could not connect to host
-1nian.vip: could not connect to host
-1para.net: could not connect to host
-1plus-agency.com: did not receive HSTS header
-1px.tv: did not receive HSTS header
-1q2w.nl: could not connect to host
-1q365a.com: could not connect to host
-1s.tn: could not connect to host
-1salland.nl: could not connect to host
-1scope.com: could not connect to host
-1st4abounce.co.uk: could not connect to host
-1stchoicefun.co.uk: could not connect to host
-1ststop.co.uk: did not receive HSTS header
-1three1.net: did not receive HSTS header
-1u0m.com: could not connect to host
-1upinternet.com: could not connect to host
-1volcano.ru: could not connect to host
-1xcess.com: did not receive HSTS header
-1years.cc: could not connect to host
-2-cpu.de: could not connect to host
-2000.is: could not connect to host
-20000615.com: max-age too low: 0
-2001617.com: max-age too low: 0
-200201.xyz: could not connect to host
-2002712.com: did not receive HSTS header
-200fcw.com: could not connect to host
-2017c.com: could not connect to host
-2018.wales: could not connect to host
-20188088.com: could not connect to host
-2018j95.com: could not connect to host
-20190204.com: max-age too low: 0
-20190508.com: max-age too low: 0
-20191r.com: could not connect to host
-2019318.com: max-age too low: 0
-2019j95.com: could not connect to host
-2020j95.com: could not connect to host
-2021j95.com: could not connect to host
-2022j95.com: could not connect to host
-2023j95.com: could not connect to host
-2024j95.com: could not connect to host
-2025j95.com: could not connect to host
-2030404.com: could not connect to host
-2030411.com: could not connect to host
-2033002.com: did not receive HSTS header
-2033003.com: did not receive HSTS header
-2033004.com: did not receive HSTS header
-2033005.com: did not receive HSTS header
-2033006.com: did not receive HSTS header
-2033007.com: did not receive HSTS header
-2033008.com: did not receive HSTS header
-2033009.com: did not receive HSTS header
-2033010.com: did not receive HSTS header
-2033011.com: did not receive HSTS header
-2033a.com: could not connect to host
-2033b.com: did not receive HSTS header
-2033c.com: did not receive HSTS header
-2033d.com: did not receive HSTS header
-2033e.com: did not receive HSTS header
-2033f.com: did not receive HSTS header
-2033g.com: did not receive HSTS header
-2033h.com: did not receive HSTS header
-2033i.com: did not receive HSTS header
-2033j.com: did not receive HSTS header
-2033l.com: did not receive HSTS header
-2033m.com: did not receive HSTS header
-2033n.com: did not receive HSTS header
-2033o.com: did not receive HSTS header
-2033p.com: did not receive HSTS header
-2033q.com: did not receive HSTS header
-2033r.com: did not receive HSTS header
-2033s.com: did not receive HSTS header
-2033t.com: did not receive HSTS header
-2033u.com: did not receive HSTS header
-2033v.com: did not receive HSTS header
-2033w.com: did not receive HSTS header
-2033x.com: did not receive HSTS header
-2033y.com: did not receive HSTS header
-2033z.com: could not connect to host
-2048-spiel.de: could not connect to host
-2048game.co.uk: could not connect to host
-206rc.net: max-age too low: 2592000
-208.es: did not receive HSTS header
-2083236893.com: could not connect to host
-20hs.cn: could not connect to host
-20n13.com: could not connect to host
-20zq.com: could not connect to host
-21.co.uk: did not receive HSTS header
-2112323.com: max-age too low: 0
-219k8.com: did not receive HSTS header
-21lg.co: could not connect to host
-21stnc.com: did not receive HSTS header
-220control.ru: could not connect to host
-222001.com: could not connect to host
-222111.cc: could not connect to host
-2222yh.com: did not receive HSTS header
-222321365.com: could not connect to host
-2226321.com: could not connect to host
-22321365.com: could not connect to host
-22884c.com: could not connect to host
-22884d.com: could not connect to host
-22884f.com: could not connect to host
-2299411.com: could not connect to host
-2299422.com: could not connect to host
-2299477.com: could not connect to host
-2299488.com: could not connect to host
-22b58.com: could not connect to host
-22bt.cc: did not receive HSTS header
-22d.io: could not connect to host
-22digital.agency: could not connect to host
-22scc.com: could not connect to host
-22txc.com: could not connect to host
-22vetter.st: could not connect to host
-230110.com: could not connect to host
-232192.com: could not connect to host
-2324275338.com: max-age too low: 0
-2333.press: could not connect to host
-2333666.xyz: could not connect to host
-233abc.com: could not connect to host
-233bwg.com: could not connect to host
-233hugo.com: could not connect to host
-23454048.com: could not connect to host
-234666365.com: could not connect to host
-235998.com: could not connect to host
-23lhb.com: did not receive HSTS header
-242712.com: could not connect to host
-246773.com: could not connect to host
-2468lhc.com: could not connect to host
-24796559.com: max-age too low: 0
-247a.co.uk: could not connect to host
-247exchange.com: did not receive HSTS header
-247healthshop.com: could not connect to host
-247quickbooks.com: did not receive HSTS header
-2484811.com: could not connect to host
-248663.com: could not connect to host
-2488.ch: did not receive HSTS header
-2495dentalimplants.com: could not connect to host
-249cq.com: could not connect to host
-24hourpaint.com: could not connect to host
-24hrs.shopping: could not connect to host
-24items.com: did not receive HSTS header
-24kbet.com: could not connect to host
-24pcr.com: could not connect to host
-24sihu.com: could not connect to host
-2566335.xyz: did not receive HSTS header
-2569abc.com: max-age too low: 0
-256k.me: could not connect to host
-258da.com: did not receive HSTS header
-25daysof.io: could not connect to host
-25percent.me: could not connect to host
-26004.cc: could not connect to host
-260842907.com: max-age too low: 0
-2686288.com: max-age too low: 0
-2692646200.com: max-age too low: 0
-2712aa.com: did not receive HSTS header
-276771.com: could not connect to host
-27728522.com: could not connect to host
-2859cc.com: could not connect to host
-286.com: did not receive HSTS header
-288da.com: did not receive HSTS header
-29227.com: could not connect to host
-2941798824.com: max-age too low: 0
-297computers.com: could not connect to host
-298da.com: did not receive HSTS header
-2acbi-asso.fr: did not receive HSTS header
-2b3b.com: could not connect to host
-2bad2c0.de: did not receive HSTS header
-2bitout.com: could not connect to host
-2bizi.ru: could not connect to host
-2bougie.com: could not connect to host
-2bouncy.com: could not connect to host
-2brokegirls.org: could not connect to host
-2carpros.com: did not receive HSTS header
-2fl.me: did not receive HSTS header
-2g1s.net: could not connect to host
-2intermediate.co.uk: could not connect to host
-2kvn.cf: could not connect to host
-2mir.com: could not connect to host
-2or3.tk: could not connect to host
-2smart4food.com: could not connect to host
-2ss.jp: could not connect to host
-2tuu.com: could not connect to host
-3-800.com: could not connect to host
-3002712.com: did not receive HSTS header
-300651.ru: did not receive HSTS header
-300mbmovie24.com: could not connect to host
-300mbmovies4u.cc: could not connect to host
-301.website: did not receive HSTS header
-302.nyc: could not connect to host
-30365.vip: did not receive HSTS header
-30375500.com: could not connect to host
-30375522.com: could not connect to host
-30375533.com: could not connect to host
-30375555.com: did not receive HSTS header
-30375577.com: did not receive HSTS header
-30375588.com: could not connect to host
-30375599.com: could not connect to host
-304squadron.org: did not receive HSTS header
-3054056550.com: max-age too low: 0
-308xsj.com: max-age too low: 0
-30hzcollective.com: could not connect to host
-30n13.com: could not connect to host
-30yearmortgagerates.net: did not receive HSTS header
-3133780x.com: did not receive HSTS header
-314166.com: could not connect to host
-314553.com: could not connect to host
-315422.com: could not connect to host
-3178aaa.com: could not connect to host
-3178eee.com: could not connect to host
-3178fff.com: could not connect to host
-319k3.com: could not connect to host
-31tv.ru: did not receive HSTS header
-321666365.com: could not connect to host
-32ph.com: did not receive HSTS header
-33-km.ru: could not connect to host
-330.net: did not receive HSTS header
-3311.com.cn: could not connect to host
-33321365.com: could not connect to host
-3333yh.com: did not receive HSTS header
-33445.com: could not connect to host
-33445111.com: could not connect to host
-33445222.com: could not connect to host
-33445333.com: could not connect to host
-33445444.com: could not connect to host
-3351p.com: could not connect to host
-3361p.com: could not connect to host
-336yh.com: could not connect to host
-33836.com: could not connect to host
-338da.com: could not connect to host
-33drugstore.com: could not connect to host
-33n13.com: could not connect to host
-33scc.com: could not connect to host
-341.mg: could not connect to host
-345666365.com: could not connect to host
-347552.com: could not connect to host
-348663.com: could not connect to host
-34oztonic.eu: did not receive HSTS header
-351079.com: could not connect to host
-351365.com: could not connect to host
-354133.com: could not connect to host
-3555500.com: could not connect to host
-3555aa.com: could not connect to host
-357601.com: could not connect to host
-35792.de: could not connect to host
-35898a.com: could not connect to host
-35898b.com: did not receive HSTS header
-35898c.com: did not receive HSTS header
-35898d.com: did not receive HSTS header
-35898e.com: could not connect to host
-35898f.com: did not receive HSTS header
-35898g.com: did not receive HSTS header
-35898h.com: did not receive HSTS header
-35898j.com: did not receive HSTS header
-35898k.com: did not receive HSTS header
-35898m.com: did not receive HSTS header
-35898s.com: did not receive HSTS header
-35898w.com: did not receive HSTS header
-35898x.com: did not receive HSTS header
-35898y.com: did not receive HSTS header
-35898z.com: did not receive HSTS header
-35d88.com: could not connect to host
-360008888.com: max-age too low: 0
-360gradus.com: did not receive HSTS header
-360videoshare.com: could not connect to host
-360woodworking.com: could not connect to host
-3615jacky.fr: could not connect to host
-364553.com: could not connect to host
-365.or.jp: could not connect to host
-36506000.com: could not connect to host
-36506011.com: could not connect to host
-36506022.com: could not connect to host
-36506033.com: could not connect to host
-36506055.com: could not connect to host
-36506066.com: could not connect to host
-36506077.com: could not connect to host
-36506088.com: could not connect to host
-36506099.com: could not connect to host
-36506111.com: could not connect to host
-36506222.com: could not connect to host
-36506333.com: could not connect to host
-36506555.com: could not connect to host
-36506777.com: could not connect to host
-36506999.com: could not connect to host
-3655612.com: did not receive HSTS header
-3655623.com: did not receive HSTS header
-3655634.com: did not receive HSTS header
-3655645.com: did not receive HSTS header
-36565123.com: could not connect to host
-36565234.com: could not connect to host
-36565345.com: could not connect to host
-36565456.com: could not connect to host
-36565567.com: could not connect to host
-36565678.com: could not connect to host
-36565789.com: could not connect to host
-36565b.com: could not connect to host
-3656701.com: did not receive HSTS header
-3656712.com: did not receive HSTS header
-3656723.com: did not receive HSTS header
-3656734.com: did not receive HSTS header
-3656745.com: did not receive HSTS header
-3656778.com: did not receive HSTS header
-36587654321.com: could not connect to host
-3658880000.com: did not receive HSTS header
-365888001.com: did not receive HSTS header
-365888002.com: did not receive HSTS header
-365888003.com: did not receive HSTS header
-365888004.com: did not receive HSTS header
-365888005.com: did not receive HSTS header
-365888006.com: did not receive HSTS header
-365888007.com: did not receive HSTS header
-365888008.com: did not receive HSTS header
-365888009.com: did not receive HSTS header
-36588801.com: did not receive HSTS header
-365888012.com: did not receive HSTS header
-3658880123.com: did not receive HSTS header
-3658881111.com: could not connect to host
-36588812.com: did not receive HSTS header
-365888123.com: did not receive HSTS header
-3658881234.com: could not connect to host
-3658882222.com: could not connect to host
-36588823.com: did not receive HSTS header
-365888234.com: did not receive HSTS header
-3658882345.com: did not receive HSTS header
-3658883333.com: did not receive HSTS header
-36588834.com: did not receive HSTS header
-365888345.com: did not receive HSTS header
-3658883456.com: did not receive HSTS header
-3658884444.com: did not receive HSTS header
-36588845.com: did not receive HSTS header
-365888456.com: did not receive HSTS header
-3658884567.com: did not receive HSTS header
-3658885555.com: did not receive HSTS header
-36588856.com: did not receive HSTS header
-365888567.com: did not receive HSTS header
-3658885678.com: did not receive HSTS header
-3658886666.com: did not receive HSTS header
-36588867.com: did not receive HSTS header
-365888678.com: did not receive HSTS header
-3658886789.com: could not connect to host
-36588878.com: did not receive HSTS header
-365888789.com: did not receive HSTS header
-3658888888.com: did not receive HSTS header
-36588889.com: did not receive HSTS header
-365888890.com: did not receive HSTS header
-36588890.com: could not connect to host
-3658889999.com: did not receive HSTS header
-365888dd.com: did not receive HSTS header
-365888ddd.com: did not receive HSTS header
-365888dddd.com: did not receive HSTS header
-36594.com: did not receive HSTS header
-3659867.com: did not receive HSTS header
-3659980.com: could not connect to host
-365beautyworld.com: could not connect to host
-365healthworld.com: could not connect to host
-365maya.com: did not receive HSTS header
-365q01.com: did not receive HSTS header
-365q02.com: did not receive HSTS header
-365q03.com: did not receive HSTS header
-365q04.com: did not receive HSTS header
-365q05.com: did not receive HSTS header
-365q06.com: did not receive HSTS header
-365q07.com: did not receive HSTS header
-365q08.com: did not receive HSTS header
-365q10.com: did not receive HSTS header
-365q11.com: did not receive HSTS header
-365q12.com: did not receive HSTS header
-365q13.com: did not receive HSTS header
-365q14.com: did not receive HSTS header
-365q15.com: did not receive HSTS header
-365zg.vip: did not receive HSTS header
-3666ks.com: could not connect to host
-368mibn.com: did not receive HSTS header
-369-7.com: could not connect to host
-369018.com: did not receive HSTS header
-369028.com: did not receive HSTS header
-377817.com: could not connect to host
-3778vip.com: did not receive HSTS header
-3778xl.com: could not connect to host
-37879.com: max-age too low: 0
-37987a.com: could not connect to host
-380021868.com: max-age too low: 0
-380111000.com: could not connect to host
-380111111.com: did not receive HSTS header
-380111222.com: did not receive HSTS header
-380111555.com: did not receive HSTS header
-380111777.com: could not connect to host
-380111888.com: did not receive HSTS header
-380138000.com: max-age too low: 0
-3801808.com: max-age too low: 0
-3801988.com: max-age too low: 0
-380201314.com: max-age too low: 0
-3802024.com: max-age too low: 0
-3802025.com: max-age too low: 0
-380222111.com: did not receive HSTS header
-380222333.com: did not receive HSTS header
-3802288.com: max-age too low: 0
-3804488.com: max-age too low: 0
-3805201314.com: max-age too low: 0
-3805355.com: max-age too low: 0
-3805500.com: max-age too low: 0
-3805511abc.com: max-age too low: 0
-3806677.com: max-age too low: 0
-3806789.com: max-age too low: 0
-3807344.com: max-age too low: 0
-3807711.com: max-age too low: 0
-3807733.com: max-age too low: 0
-3807755.com: max-age too low: 0
-3808822.com: max-age too low: 0
-3808844.com: could not connect to host
-3808855.com: max-age too low: 0
-3808866.com: max-age too low: 0
-3809900.com: max-age too low: 0
-3809911.com: max-age too low: 0
-3809922.com: max-age too low: 0
-3809933.com: max-age too low: 0
-3809944.com: max-age too low: 0
-380zz8989.com: max-age too low: 0
-38138938.com: could not connect to host
-3837b.com: could not connect to host
-3837c.com: could not connect to host
-3837d.com: could not connect to host
-3837e.com: could not connect to host
-3837g.com: could not connect to host
-3837h.com: could not connect to host
-3837i.com: could not connect to host
-3837j.com: could not connect to host
-3837k.com: could not connect to host
-3837l.com: could not connect to host
-3837m.com: could not connect to host
-3837n.com: could not connect to host
-3837o.com: could not connect to host
-3837p.com: could not connect to host
-3837q.com: could not connect to host
-3837r.com: could not connect to host
-3837s.com: could not connect to host
-3837t.com: could not connect to host
-3837u.com: could not connect to host
-3837v.com: could not connect to host
-3837w.com: could not connect to host
-3837x.com: could not connect to host
-3837y.com: could not connect to host
-3837z.com: could not connect to host
-3838onndo.tk: could not connect to host
-3839.ca: could not connect to host
-3880p.com: could not connect to host
-38888msc.com: could not connect to host
-388da.com: could not connect to host
-38blog.com: did not receive HSTS header
-393335.ml: did not receive HSTS header
-394553.com: could not connect to host
-3957b.com: could not connect to host
-3957c.com: could not connect to host
-3957d.com: could not connect to host
-3957f.com: could not connect to host
-3957g.com: could not connect to host
-3963aa.com: could not connect to host
-39661463.com: max-age too low: 0
-3970100.com: could not connect to host
-3970200.com: could not connect to host
-3970300.com: could not connect to host
-3970400.com: could not connect to host
-3970500.com: could not connect to host
-3970600.com: could not connect to host
-3970700.com: could not connect to host
-3970800.com: could not connect to host
-39708888.com: could not connect to host
-3970900.com: could not connect to host
-3970go.com: could not connect to host
-39news.tk: could not connect to host
-39sihu.com: could not connect to host
-3amtoolbox.se: could not connect to host
-3candy.com: could not connect to host
-3chit.cf: could not connect to host
-3circlefunding.ch: did not receive HSTS header
-3click-loan.com: could not connect to host
-3cs.ch: could not connect to host
-3d-bastler.de: could not connect to host
-3dcart.com: max-age too low: 2592000
-3delivered.com: could not connect to host
-3djava.ml: could not connect to host
-3dlab.team: could not connect to host
-3dm.audio: could not connect to host
-3dmedium.de: could not connect to host
-3dnovedades.com: did not receive HSTS header
-3dprintsondemand.eu: could not connect to host
-3dproteinimaging.com: did not receive HSTS header
-3drenaline.com: could not connect to host
-3dtootmine.ee: did not receive HSTS header
-3fl.com: did not receive HSTS header
-3hl0.net: could not connect to host
-3ik.us: did not receive HSTS header
-3lot.ru: could not connect to host
-3niu168.com: did not receive HSTS header
-3niu178.com: did not receive HSTS header
-3niu66.com: did not receive HSTS header
-3niu666.com: did not receive HSTS header
-3niu8.com: did not receive HSTS header
-3niu88.com: did not receive HSTS header
-3niu8888.com: did not receive HSTS header
-3os.ooo: could not connect to host
-3phase.pw: could not connect to host
-3sreporting.com: did not receive HSTS header
-3timegear.com: did not receive HSTS header
-3trees.tk: could not connect to host
-3wecommerce.com.br: could not connect to host
-3weekdietworks.com: did not receive HSTS header
-3xm.at: did not receive HSTS header
-3xx.link: could not connect to host
-4-1-where.com: could not connect to host
-4001365.com: could not connect to host
-4002365.com: could not connect to host
-4025360.com: could not connect to host
-4025361.com: could not connect to host
-4025362.com: could not connect to host
-4025363.com: could not connect to host
-4025364.com: could not connect to host
-4025365.com: could not connect to host
-4025366.com: could not connect to host
-4025367.com: could not connect to host
-4025368.com: could not connect to host
-4025369.com: could not connect to host
-4036aa.com: did not receive HSTS header
-4036bb.com: did not receive HSTS header
-4036cc.com: did not receive HSTS header
-4036dd.com: did not receive HSTS header
-404.guide: could not connect to host
-404.sh: could not connect to host
-404404.info: could not connect to host
-4048kkk.com: could not connect to host
-4048l.com: could not connect to host
-4048v.com: could not connect to host
-404forest.com: could not connect to host
-408663.com: could not connect to host
-4096bit.de: could not connect to host
-40n13.com: could not connect to host
-41-where.com: could not connect to host
-4111pk.com: could not connect to host
-411416.com: could not connect to host
-4138hd.com: could not connect to host
-414553.com: could not connect to host
-41844.de: could not connect to host
-418663.com: could not connect to host
-41where.com: could not connect to host
-420dongstorm.com: could not connect to host
-4237.com: could not connect to host
-426773.com: could not connect to host
-427552.com: could not connect to host
-42ms.org: could not connect to host
-42t.ru: could not connect to host
-432666365.com: did not receive HSTS header
-4345.me: did not receive HSTS header
-436773.com: could not connect to host
-438663.com: could not connect to host
-439191.com: could not connect to host
-440hz-radio.de: did not receive HSTS header
-440hz.radio: did not receive HSTS header
-44321365.com: could not connect to host
-444321365.com: could not connect to host
-4444yh.com: did not receive HSTS header
-4455software.com: did not receive HSTS header
-448da.com: did not receive HSTS header
-44957.com: could not connect to host
-44scc.com: could not connect to host
-44sec.com: did not receive HSTS header
-4500.co.il: did not receive HSTS header
-451.ooo: could not connect to host
-4553.com: did not receive HSTS header
-455327.com: could not connect to host
-455328.com: could not connect to host
-4553s.com: could not connect to host
-4553vip.com: could not connect to host
-456-3.com: could not connect to host
-45636565.com: could not connect to host
-456666365.com: did not receive HSTS header
-457552.com: could not connect to host
-458663.com: could not connect to host
-4679.space: did not receive HSTS header
-46fa.com: could not connect to host
-4736666.com: could not connect to host
-476773.com: could not connect to host
-47788a.com: did not receive HSTS header
-47788b.com: did not receive HSTS header
-47788c.com: did not receive HSTS header
-47788d.com: did not receive HSTS header
-47788e.com: did not receive HSTS header
-47788f.com: did not receive HSTS header
-47788g.com: did not receive HSTS header
-47788h.com: did not receive HSTS header
-47788i.com: did not receive HSTS header
-47788j.com: did not receive HSTS header
-47788l.com: did not receive HSTS header
-47788m.com: did not receive HSTS header
-47788n.com: did not receive HSTS header
-47788o.com: did not receive HSTS header
-47788p.com: did not receive HSTS header
-47788q.com: did not receive HSTS header
-47788r.com: did not receive HSTS header
-47788s.com: did not receive HSTS header
-47788u.com: did not receive HSTS header
-47788v.com: did not receive HSTS header
-47788w.com: did not receive HSTS header
-47788x.com: did not receive HSTS header
-47788y.com: did not receive HSTS header
-47788z.com: did not receive HSTS header
-478933.com: could not connect to host
-47essays.com: could not connect to host
-47tech.com: could not connect to host
-486773.com: could not connect to host
-487552.com: could not connect to host
-494k.com: could not connect to host
-498663.com: could not connect to host
-4997777.com: could not connect to host
-4999016.com: max-age too low: 0
-4azino777.ru: did not receive HSTS header
-4baby.com.br: could not connect to host
-4bike.eu: did not receive HSTS header
-4cclothing.com: could not connect to host
-4d2.xyz: could not connect to host
-4decor.org: max-age too low: 0
-4flex.info: could not connect to host
-4freepress.com: could not connect to host
-4hvac.com: did not receive HSTS header
-4iners.com: could not connect to host
-4kprojektory.cz: could not connect to host
-4loc.us: could not connect to host
-4miners.net: could not connect to host
-4mybaby.ch: did not receive HSTS header
-4ourty2.org: could not connect to host
-4share.tv: could not connect to host
-4sics.se: could not connect to host
-4smart.house: could not connect to host
-4sqsu.eu: could not connect to host
-4tgw34.tk: could not connect to host
-4u.am: did not receive HSTS header
-4w-performers.link: could not connect to host
-4web-hosting.com: could not connect to host
-4winds.pt: did not receive HSTS header
-4x4tt.com: could not connect to host
-4y4a-arts.space: could not connect to host
-5-600.com: could not connect to host
-50.pe: could not connect to host
-5000yz.com: could not connect to host
-500103.com: did not receive HSTS header
-500108.com: did not receive HSTS header
-5002888.com: could not connect to host
-5007999.com: could not connect to host
-500a500.com: could not connect to host
-500b500.com: could not connect to host
-500c500.com: could not connect to host
-500d500.com: could not connect to host
-500e500.com: could not connect to host
-500f500.com: could not connect to host
-500fcw.com: could not connect to host
-500g500.com: could not connect to host
-500h500.com: could not connect to host
-500i500.com: could not connect to host
-500j500.com: could not connect to host
-500k.nl: could not connect to host
-500k500.com: could not connect to host
-500l500.com: could not connect to host
-500m500.com: could not connect to host
-500n500.com: could not connect to host
-500o500.com: could not connect to host
-500p.xyz: could not connect to host
-500p500.com: could not connect to host
-500pingtai.com: could not connect to host
-500q500.com: could not connect to host
-500r500.com: could not connect to host
-500s500.com: could not connect to host
-500t500.com: could not connect to host
-500u500.com: could not connect to host
-500wordessay.gq: could not connect to host
-500y500.com: could not connect to host
-500z500.com: could not connect to host
-5017501.com: could not connect to host
-5017502.com: could not connect to host
-5017503.com: could not connect to host
-5017504.com: could not connect to host
-5017505.com: could not connect to host
-504737.com: max-age too low: 0
-5060711.com: could not connect to host
-5060715.com: could not connect to host
-506pay.com: could not connect to host
-508088.com: could not connect to host
-50ma.xyz: could not connect to host
-50millionablaze.org: could not connect to host
-50plusnet.nl: could not connect to host
-513vpn.net: could not connect to host
-514622.com: could not connect to host
-517jjj.com: did not receive HSTS header
-517vpn.cn: could not connect to host
-518558.net: max-age too low: 0
-518maicai.com: could not connect to host
-5197a.co: did not receive HSTS header
-5197aa.co: could not connect to host
-5197b.co: did not receive HSTS header
-5197bb.co: could not connect to host
-5197c.co: did not receive HSTS header
-5197cc.co: could not connect to host
-5197d.co: did not receive HSTS header
-5197dd.co: could not connect to host
-5197e.co: did not receive HSTS header
-5197ee.co: could not connect to host
-5197f.co: did not receive HSTS header
-5197ff.co: could not connect to host
-5197g.co: did not receive HSTS header
-5197gg.co: could not connect to host
-5197h.co: did not receive HSTS header
-5197hd.co: could not connect to host
-5197hh.co: could not connect to host
-5197i.co: did not receive HSTS header
-5197ii.co: could not connect to host
-5197j.co: did not receive HSTS header
-5197jj.co: could not connect to host
-5197k.co: did not receive HSTS header
-5197kk.co: could not connect to host
-5197l.co: did not receive HSTS header
-5197ll.co: could not connect to host
-5197m.co: could not connect to host
-5197mm.co: could not connect to host
-5197n.co: could not connect to host
-5197nn.co: could not connect to host
-5197o.co: could not connect to host
-5197oo.co: could not connect to host
-5197p.co: could not connect to host
-5197pp.co: could not connect to host
-5197q.co: could not connect to host
-5197qq.co: could not connect to host
-5197r.co: could not connect to host
-5197rr.co: could not connect to host
-5197s.co: could not connect to host
-5197ss.co: could not connect to host
-5197t.co: could not connect to host
-5197tt.co: could not connect to host
-5197u.co: could not connect to host
-5197uu.co: could not connect to host
-5197v.co: could not connect to host
-5197vv.co: could not connect to host
-5197w.co: could not connect to host
-5197ww.co: could not connect to host
-5197x.co: could not connect to host
-5197xx.co: could not connect to host
-5197y.co: could not connect to host
-5197yy.co: could not connect to host
-5197z.co: could not connect to host
-5197zz.co: could not connect to host
-51aifuli.com: could not connect to host
-51chiyu.com: did not receive HSTS header
-52002c.com: could not connect to host
-52051a.com: could not connect to host
-52051b.com: did not receive HSTS header
-52051c.com: did not receive HSTS header
-52051d.com: did not receive HSTS header
-52051e.com: did not receive HSTS header
-52051f.com: did not receive HSTS header
-52051g.com: did not receive HSTS header
-52051h.com: did not receive HSTS header
-52051i.com: did not receive HSTS header
-52051j.com: did not receive HSTS header
-52051k.com: did not receive HSTS header
-52051l.com: did not receive HSTS header
-52051m.com: did not receive HSTS header
-52051n.com: did not receive HSTS header
-52051o.com: did not receive HSTS header
-52051p.com: did not receive HSTS header
-52051q.com: did not receive HSTS header
-52051r.com: did not receive HSTS header
-52051s.com: did not receive HSTS header
-52062a.com: did not receive HSTS header
-52062b.com: did not receive HSTS header
-52062c.com: did not receive HSTS header
-52062d.com: did not receive HSTS header
-52062f.com: did not receive HSTS header
-52062h.com: did not receive HSTS header
-52062i.com: did not receive HSTS header
-52062l.com: did not receive HSTS header
-52062m.com: did not receive HSTS header
-52062n.com: did not receive HSTS header
-52062o.com: did not receive HSTS header
-52062q.com: did not receive HSTS header
-52062r.com: did not receive HSTS header
-52062s.com: did not receive HSTS header
-52062t.com: did not receive HSTS header
-52062v.com: did not receive HSTS header
-52062w.com: did not receive HSTS header
-52062x.com: did not receive HSTS header
-52062z.com: did not receive HSTS header
-52067.com: did not receive HSTS header
-52067.vip: did not receive HSTS header
-52067a.com: did not receive HSTS header
-52067b.com: did not receive HSTS header
-52067c.com: did not receive HSTS header
-52067d.com: did not receive HSTS header
-52067e.com: did not receive HSTS header
-52067f.com: did not receive HSTS header
-52067g.com: did not receive HSTS header
-52067h.com: did not receive HSTS header
-52067i.com: did not receive HSTS header
-52067j.com: did not receive HSTS header
-52067k.com: did not receive HSTS header
-52067l.com: did not receive HSTS header
-52067m.com: did not receive HSTS header
-52067n.com: did not receive HSTS header
-52067o.com: did not receive HSTS header
-52067p.com: did not receive HSTS header
-52067q.com: did not receive HSTS header
-52067r.com: did not receive HSTS header
-52067s.com: did not receive HSTS header
-52067t.com: did not receive HSTS header
-52067u.com: did not receive HSTS header
-52067v.com: did not receive HSTS header
-52067w.com: did not receive HSTS header
-52067x.com: did not receive HSTS header
-52067y.com: did not receive HSTS header
-52067z.com: did not receive HSTS header
-5219.ml: could not connect to host
-5225sf.com: could not connect to host
-52b9.com: could not connect to host
-52b9.net: could not connect to host
-52hentai.ml: could not connect to host
-52hentai.us: could not connect to host
-52kb.net: did not receive HSTS header
-52kb1.com: could not connect to host
-52neptune.com: did not receive HSTS header
-5356699.com: max-age too low: 0
-54.sb: could not connect to host
-540.co: did not receive HSTS header
-5432.cc: could not connect to host
-543666365.com: could not connect to host
-545755.com: could not connect to host
-54bf.com: could not connect to host
-5518k3.com: could not connect to host
-55321365.com: could not connect to host
-5533445.com: could not connect to host
-5536z.com: could not connect to host
-555321365.com: could not connect to host
-55558744.com: could not connect to host
-5555k8.com: did not receive HSTS header
-5555k8.net: did not receive HSTS header
-5555yh.com: did not receive HSTS header
-555k8.com: did not receive HSTS header
-555k8.net: did not receive HSTS header
-555w.org: could not connect to host
-555xl.com: could not connect to host
-556185.com: could not connect to host
-55639.com: could not connect to host
-55797.com: did not receive HSTS header
-558da.com: did not receive HSTS header
-55bt.cc: did not receive HSTS header
-55n13.com: did not receive HSTS header
-55scc.com: could not connect to host
-56564a.com: did not receive HSTS header
-56564b.com: did not receive HSTS header
-56564c.com: did not receive HSTS header
-56564d.com: did not receive HSTS header
-56564e.com: could not connect to host
-56564f.com: did not receive HSTS header
-56564g.com: did not receive HSTS header
-56564h.com: did not receive HSTS header
-56564i.com: did not receive HSTS header
-56564j.com: did not receive HSTS header
-56564k.com: did not receive HSTS header
-56564l.com: did not receive HSTS header
-56564m.com: did not receive HSTS header
-56564n.com: did not receive HSTS header
-56564o.com: did not receive HSTS header
-56564p.com: did not receive HSTS header
-56564q.com: did not receive HSTS header
-56564r.com: did not receive HSTS header
-56564s.com: did not receive HSTS header
-56564t.com: did not receive HSTS header
-56564u.com: did not receive HSTS header
-56564v.com: did not receive HSTS header
-56564w.com: did not receive HSTS header
-56564x.com: did not receive HSTS header
-56564y.com: did not receive HSTS header
-56564z.com: did not receive HSTS header
-566380.com: could not connect to host
-567666365.com: could not connect to host
-56877.com: could not connect to host
-56ct.com: could not connect to host
-575380.com: could not connect to host
-57574a.com: did not receive HSTS header
-57574b.com: did not receive HSTS header
-57574c.com: did not receive HSTS header
-57574d.com: did not receive HSTS header
-57574e.com: did not receive HSTS header
-57574f.com: did not receive HSTS header
-57574g.com: did not receive HSTS header
-57574h.com: did not receive HSTS header
-57574i.com: did not receive HSTS header
-57574j.com: did not receive HSTS header
-57574k.com: did not receive HSTS header
-57574l.com: did not receive HSTS header
-57574m.com: did not receive HSTS header
-57574n.com: did not receive HSTS header
-57574o.com: did not receive HSTS header
-57574p.com: did not receive HSTS header
-57574q.com: did not receive HSTS header
-57574r.com: did not receive HSTS header
-57574s.com: did not receive HSTS header
-57574t.com: did not receive HSTS header
-57574u.com: did not receive HSTS header
-57574v.com: did not receive HSTS header
-57574w.com: did not receive HSTS header
-57574x.com: did not receive HSTS header
-57574y.com: did not receive HSTS header
-57574z.com: did not receive HSTS header
-57771399.com: max-age too low: 0
-578380.com: could not connect to host
-5795333.com: did not receive HSTS header
-57aromas.com: did not receive HSTS header
-57he.com: did not receive HSTS header
-57wilkie.net: could not connect to host
-585380.com: could not connect to host
-58586668.com: max-age too low: 0
-588007008.com: max-age too low: 0
-588da.com: did not receive HSTS header
-588e.com: could not connect to host
-588l.com: could not connect to host
-58nav.com: could not connect to host
-591380.com: could not connect to host
-592380.com: could not connect to host
-593380.com: could not connect to host
-595380.com: could not connect to host
-5981844.com: could not connect to host
-5981h.com: could not connect to host
-5981m.com: could not connect to host
-598380.com: could not connect to host
-5986fc.com: could not connect to host
-5beanskit.com: did not receive HSTS header
-5conejos.com: did not receive HSTS header
-5crowd.com: did not receive HSTS header
-5dwin.com: did not receive HSTS header
-5dwin.net: did not receive HSTS header
-5ece.de: could not connect to host
-5piecesofadvice.com: could not connect to host
-5starbouncycastlehire.co.uk: could not connect to host
-5w5.la: could not connect to host
-6-600.com: could not connect to host
-60068vb.com: max-age too low: 0
-605508.cc: could not connect to host
-605508.com: could not connect to host
-609avenue.com: did not receive HSTS header
-60n13.com: could not connect to host
-60ych.net: did not receive HSTS header
-6120.eu: did not receive HSTS header
-6133feng.com: max-age too low: 0
-616675.com: could not connect to host
-6166p.com: did not receive HSTS header
-617020.com: could not connect to host
-618media.com: did not receive HSTS header
-620881.com: could not connect to host
-621162.com: could not connect to host
-62314.cc: could not connect to host
-626380.com: could not connect to host
-62755.com: could not connect to host
-638566.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-6396000.com: did not receive HSTS header
-63960000.com: did not receive HSTS header
-63961111.com: did not receive HSTS header
-639611111.com: could not connect to host
-6396222.com: could not connect to host
-63962222.com: did not receive HSTS header
-639622222.com: did not receive HSTS header
-6396333.com: could not connect to host
-63963333.com: did not receive HSTS header
-639633333.com: did not receive HSTS header
-6396444.com: did not receive HSTS header
-63964444.com: could not connect to host
-639644444.com: did not receive HSTS header
-63965555.com: did not receive HSTS header
-639655555.com: did not receive HSTS header
-639666666.com: did not receive HSTS header
-63967777.com: did not receive HSTS header
-639677777.com: did not receive HSTS header
-63968888.com: did not receive HSTS header
-639688888.com: could not connect to host
-63969999.com: could not connect to host
-639699999.com: did not receive HSTS header
-6396aaa.com: could not connect to host
-6396bbb.com: could not connect to host
-6396ccc.com: could not connect to host
-6396ddd.com: could not connect to host
-6396eee.com: could not connect to host
-6396fff.com: could not connect to host
-6396ggg.com: did not receive HSTS header
-6396hhh.com: could not connect to host
-6396iii.com: did not receive HSTS header
-6396jjj.com: did not receive HSTS header
-6396ooo.com: did not receive HSTS header
-6396qqq.com: did not receive HSTS header
-6396rrr.com: did not receive HSTS header
-6396sss.com: could not connect to host
-6396ttt.com: did not receive HSTS header
-6396vvv.com: could not connect to host
-6396www.com: did not receive HSTS header
-6396xxx.com: could not connect to host
-6396yyy.com: could not connect to host
-6396zzz.com: did not receive HSTS header
-645ds.cn: could not connect to host
-645ds.com: could not connect to host
-64616e.xyz: could not connect to host
-64970.com: could not connect to host
-64bitgaming.de: could not connect to host
-64bitservers.net: could not connect to host
-6541166.com: could not connect to host
-654666365.com: did not receive HSTS header
-6556hd.com: could not connect to host
-6556pk.com: could not connect to host
-656088.com: could not connect to host
-657660.com: could not connect to host
-657990.com: could not connect to host
-660011.com: could not connect to host
-6602p.com: could not connect to host
-6603p.com: could not connect to host
-660887.com: max-age too low: 2592000
-6616fc.com: could not connect to host
-66205.net: could not connect to host
-66321365.com: could not connect to host
-66321aa.com: did not receive HSTS header
-66321bb.com: did not receive HSTS header
-66321cc.com: did not receive HSTS header
-66321dd.com: did not receive HSTS header
-66321e.com: did not receive HSTS header
-66321f.com: did not receive HSTS header
-66321g.com: did not receive HSTS header
-66321h.com: did not receive HSTS header
-66321i.com: did not receive HSTS header
-66321j.com: did not receive HSTS header
-66321k.com: did not receive HSTS header
-66321l.com: did not receive HSTS header
-66321m.com: did not receive HSTS header
-66321n.com: did not receive HSTS header
-66321o.com: did not receive HSTS header
-66321p.com: did not receive HSTS header
-66321q.com: did not receive HSTS header
-66321r.com: did not receive HSTS header
-66321s.com: did not receive HSTS header
-66321t.com: did not receive HSTS header
-66321u.com: did not receive HSTS header
-66321v.com: did not receive HSTS header
-66321w.com: did not receive HSTS header
-66321x.com: did not receive HSTS header
-66321y.com: could not connect to host
-66321z.com: could not connect to host
-6633445.com: could not connect to host
-6638s.com: max-age too low: 0
-6639s.com: could not connect to host
-6660111.ru: could not connect to host
-666321365.com: could not connect to host
-666365app.com: could not connect to host
-666365ios.com: could not connect to host
-666365iosapp.com: did not receive HSTS header
-6664553.com: could not connect to host
-666618.cc: could not connect to host
-6666365q.com: did not receive HSTS header
-6666sb.com: could not connect to host
-6666yh.com: did not receive HSTS header
-666777bet.com: could not connect to host
-6677.us: could not connect to host
-668825.vip: could not connect to host
-668da.com: did not receive HSTS header
-66b.com: did not receive HSTS header
-66bwf.com: could not connect to host
-671660.com: could not connect to host
-671990.com: could not connect to host
-672990.com: could not connect to host
-6729a.co: could not connect to host
-6729a.com: did not receive HSTS header
-6729aa.co: could not connect to host
-6729aa.com: did not receive HSTS header
-6729apk.com: could not connect to host
-6729app.com: could not connect to host
-6729b.co: could not connect to host
-6729b.com: did not receive HSTS header
-6729bb.co: could not connect to host
-6729bb.com: did not receive HSTS header
-6729c.co: could not connect to host
-6729c.com: did not receive HSTS header
-6729cc.co: could not connect to host
-6729cc.com: did not receive HSTS header
-6729d.co: could not connect to host
-6729d.com: could not connect to host
-6729dd.co: could not connect to host
-6729dd.com: could not connect to host
-6729dh.co: could not connect to host
-6729dns.com: could not connect to host
-6729dz.com: could not connect to host
-6729e.co: could not connect to host
-6729e.com: could not connect to host
-6729ee.co: could not connect to host
-6729ee.com: could not connect to host
-6729f.co: could not connect to host
-6729f.com: could not connect to host
-6729ff.co: could not connect to host
-6729ff.com: could not connect to host
-6729g.co: could not connect to host
-6729g.com: could not connect to host
-6729gg.co: could not connect to host
-6729gg.com: could not connect to host
-6729h.co: could not connect to host
-6729h.com: could not connect to host
-6729hh.co: could not connect to host
-6729hh.com: did not receive HSTS header
-6729i.co: could not connect to host
-6729i.com: could not connect to host
-6729ii.co: could not connect to host
-6729ii.com: could not connect to host
-6729ipa.com: could not connect to host
-6729j.co: could not connect to host
-6729j.com: could not connect to host
-6729jj.co: could not connect to host
-6729jj.com: could not connect to host
-6729k.co: could not connect to host
-6729k.com: could not connect to host
-6729kk.co: could not connect to host
-6729kk.com: did not receive HSTS header
-6729l.co: could not connect to host
-6729l.com: could not connect to host
-6729ll.co: could not connect to host
-6729ll.com: could not connect to host
-6729m.co: could not connect to host
-6729m.com: could not connect to host
-6729mm.co: could not connect to host
-6729mm.com: did not receive HSTS header
-6729n.co: could not connect to host
-6729n.com: did not receive HSTS header
-6729nn.co: could not connect to host
-6729nn.com: could not connect to host
-6729o.co: could not connect to host
-6729o.com: could not connect to host
-6729oo.co: could not connect to host
-6729oo.com: could not connect to host
-6729p.co: could not connect to host
-6729p.com: did not receive HSTS header
-6729pp.co: could not connect to host
-6729pp.com: could not connect to host
-6729q.co: could not connect to host
-6729q.com: could not connect to host
-6729qq.co: could not connect to host
-6729qq.com: could not connect to host
-6729r.co: could not connect to host
-6729r.com: could not connect to host
-6729rr.co: could not connect to host
-6729rr.com: could not connect to host
-6729s.co: could not connect to host
-6729s.com: could not connect to host
-6729ss.co: could not connect to host
-6729ss.com: could not connect to host
-6729t.co: could not connect to host
-6729t.com: could not connect to host
-6729tt.co: could not connect to host
-6729tt.com: could not connect to host
-6729u.co: could not connect to host
-6729u.com: could not connect to host
-6729uu.co: could not connect to host
-6729uu.com: could not connect to host
-6729v.co: could not connect to host
-6729v.com: could not connect to host
-6729vv.co: could not connect to host
-6729vv.com: could not connect to host
-6729w.co: could not connect to host
-6729w.com: could not connect to host
-6729ww.co: could not connect to host
-6729ww.com: could not connect to host
-6729x.co: could not connect to host
-6729x.com: could not connect to host
-6729xx.co: could not connect to host
-6729xx.com: could not connect to host
-6729y.co: could not connect to host
-6729y.com: could not connect to host
-6729yy.co: could not connect to host
-6729yy.com: did not receive HSTS header
-6729z.co: could not connect to host
-6729z.com: could not connect to host
-6729zz.co: could not connect to host
-6729zz.com: could not connect to host
-673660.com: could not connect to host
-673990.com: could not connect to host
-675660.com: could not connect to host
-675990.com: could not connect to host
-677314.com: could not connect to host
-677340.com: could not connect to host
-677341.com: could not connect to host
-677346.com: could not connect to host
-677347.com: could not connect to host
-677354.com: could not connect to host
-677364.com: could not connect to host
-677384.com: could not connect to host
-678678365.com: could not connect to host
-67899876.com: could not connect to host
-679660.com: could not connect to host
-680226.com: could not connect to host
-68277.me: could not connect to host
-6859551.com: max-age too low: 0
-688da.com: could not connect to host
-690918.com: did not receive HSTS header
-690938.com: did not receive HSTS header
-692660.com: could not connect to host
-692990.com: could not connect to host
-692b8c32.de: could not connect to host
-695660.com: could not connect to host
-6957a.co: could not connect to host
-6957aa.co: could not connect to host
-6957apk.com: could not connect to host
-6957app.com: could not connect to host
-6957b.co: could not connect to host
-6957bb.co: could not connect to host
-6957c.co: could not connect to host
-6957cc.co: could not connect to host
-6957d.co: could not connect to host
-6957dd.co: could not connect to host
-6957dh.co: could not connect to host
-6957e.co: could not connect to host
-6957ee.co: could not connect to host
-6957f.co: could not connect to host
-6957f.com: could not connect to host
-6957ff.co: could not connect to host
-6957g.co: could not connect to host
-6957g.com: could not connect to host
-6957gg.co: could not connect to host
-6957h.co: could not connect to host
-6957h.com: could not connect to host
-6957hh.co: could not connect to host
-6957i.co: could not connect to host
-6957i.com: could not connect to host
-6957ii.co: could not connect to host
-6957ipa.com: could not connect to host
-6957j.co: could not connect to host
-6957j.com: could not connect to host
-6957jj.co: could not connect to host
-6957k.co: could not connect to host
-6957k.com: did not receive HSTS header
-6957kk.co: could not connect to host
-6957l.co: could not connect to host
-6957l.com: did not receive HSTS header
-6957ll.co: could not connect to host
-6957m.co: could not connect to host
-6957m.com: did not receive HSTS header
-6957mm.co: could not connect to host
-6957n.co: could not connect to host
-6957n.com: did not receive HSTS header
-6957nn.co: could not connect to host
-6957nn.com: did not receive HSTS header
-6957o.co: could not connect to host
-6957oo.co: could not connect to host
-6957p.co: could not connect to host
-6957pp.co: could not connect to host
-6957q.co: could not connect to host
-6957qq.co: could not connect to host
-6957r.co: could not connect to host
-6957rr.co: could not connect to host
-6957rr.com: did not receive HSTS header
-6957s.co: could not connect to host
-6957ss.co: could not connect to host
-6957t.co: could not connect to host
-6957tt.co: could not connect to host
-6957u.co: could not connect to host
-6957uu.co: could not connect to host
-6957v.co: could not connect to host
-6957v.com: did not receive HSTS header
-6957vv.co: could not connect to host
-6957vv.com: did not receive HSTS header
-6957w.co: could not connect to host
-6957w.com: did not receive HSTS header
-6957ww.co: could not connect to host
-6957x.co: could not connect to host
-6957x.com: did not receive HSTS header
-6957xx.co: could not connect to host
-6957y.co: could not connect to host
-6957yy.co: could not connect to host
-6957z.co: could not connect to host
-6957z.com: did not receive HSTS header
-6957zz.co: could not connect to host
-695990.com: could not connect to host
-6969.us: could not connect to host
-69759.com: could not connect to host
-698da.com: did not receive HSTS header
-69928.com: could not connect to host
-69mentor.com: could not connect to host
-69square.com: could not connect to host
-6boy.net: could not connect to host
-6bwcp.com: could not connect to host
-6hzx.com: could not connect to host
-6ird.com: did not receive HSTS header
-6pm.com: did not receive HSTS header
-6t-montjoye.org: could not connect to host
-6u55ooxpo38mnikkxqvbmwfwauiiv35bsmm-2yj.com: did not receive HSTS header
-6w6.la: could not connect to host
-6z0.cn: did not receive HSTS header
-6z3.net: could not connect to host
-701135.com: could not connect to host
-701605.com: could not connect to host
-7045.com: could not connect to host
-705994.com: could not connect to host
-70n13.com: could not connect to host
-70nb.com: could not connect to host
-713kb.com: could not connect to host
-715805617.com: max-age too low: 0
-7177p.com: did not receive HSTS header
-71787777.com: could not connect to host
-71787m.com: could not connect to host
-71787n.com: could not connect to host
-71787o.com: could not connect to host
-71787p.com: could not connect to host
-71787q.com: could not connect to host
-71787r.com: could not connect to host
-71787s.com: could not connect to host
-71787t.com: could not connect to host
-71787u.com: could not connect to host
-71787v.com: could not connect to host
-71787w.com: could not connect to host
-71787x.com: could not connect to host
-71787y.com: could not connect to host
-71787z.com: could not connect to host
-7183.org: could not connect to host
-721av.com: max-age too low: 2592000
-724go.com: could not connect to host
-7261696e626f77.net: could not connect to host
-72ty.com: could not connect to host
-72ty.net: could not connect to host
-731783.com: could not connect to host
-73223.com: did not receive HSTS header
-733575.com: could not connect to host
-74365365.com: could not connect to host
-74th.jp: could not connect to host
-755243.com: could not connect to host
-755k3.com: could not connect to host
-7570.com: could not connect to host
-758global.com: could not connect to host
-765666365.com: did not receive HSTS header
-771122.tv: did not receive HSTS header
-7717411.com: max-age too low: 0
-7717a.com: did not receive HSTS header
-7717p.com: could not connect to host
-772244.net: could not connect to host
-77321365.com: could not connect to host
-7733445.com: could not connect to host
-776573.net: did not receive HSTS header
-7770t.com: could not connect to host
-7771p.com: did not receive HSTS header
-7777365q.com: did not receive HSTS header
-77778744.com: could not connect to host
-7777av.co: could not connect to host
-7777k8.com: did not receive HSTS header
-7777k8.net: did not receive HSTS header
-7777yh.com: did not receive HSTS header
-7782001.com: did not receive HSTS header
-7787p.com: did not receive HSTS header
-7788bet.vip: could not connect to host
-77890k.com: could not connect to host
-778da.com: could not connect to host
-77b58.com: could not connect to host
-77book.cn: did not receive HSTS header
-77dostavkaroz.ru: could not connect to host
-780aa.com: could not connect to host
-781371.com: could not connect to host
-781376.com: could not connect to host
-781713.com: could not connect to host
-78365aa.com: could not connect to host
-787k3.com: could not connect to host
-788da.com: did not receive HSTS header
-7898666.com: did not receive HSTS header
-789zr.com: did not receive HSTS header
-7f-wgg.cf: could not connect to host
-7f.is: could not connect to host
-7ferfer.com.br: did not receive HSTS header
-7ka.co: did not receive HSTS header
-7links.com.br: did not receive HSTS header
-7nw.eu: could not connect to host
-7pb.ru: did not receive HSTS header
-7qly.com: could not connect to host
-7thheavenrestaurant.com: could not connect to host
-7trade8.com: did not receive HSTS header
-8.net.co: could not connect to host
-800139.com: could not connect to host
-80036.com: could not connect to host
-8003pay.com: could not connect to host
-803001.com: could not connect to host
-80780780.com: could not connect to host
-808.lv: did not receive HSTS header
-8086.cf: could not connect to host
-808phone.net: could not connect to host
-80n13.com: could not connect to host
-81000906.com: max-age too low: 0
-81818d.com: did not receive HSTS header
-818bwf.com: could not connect to host
-818da.com: did not receive HSTS header
-81uc.com: could not connect to host
-8206688.com: did not receive HSTS header
-8208d88.com: could not connect to host
-826468.com: could not connect to host
-826498.com: could not connect to host
-8278eee.com: could not connect to host
-8278jjj.com: could not connect to host
-82ty.com: could not connect to host
-83365365.com: could not connect to host
-8349822.com: could not connect to host
-8363p.com: could not connect to host
-8367p.com: could not connect to host
-8368p.com: could not connect to host
-8369p.com: could not connect to host
-8379p.com: could not connect to host
-8391p.com: could not connect to host
-83969789.com: max-age too low: 0
-83i.net: could not connect to host
-846773.com: could not connect to host
-848663.com: could not connect to host
-850226.com: could not connect to host
-8521.co: did not receive HSTS header
-8521.me: did not receive HSTS header
-8522.com: did not receive HSTS header
-8522cn.com: could not connect to host
-8522hk.com: could not connect to host
-8522top.com: could not connect to host
-8560.be: could not connect to host
-861365.vip: did not receive HSTS header
-86286286.com: did not receive HSTS header
-86499.com: max-age too low: 172800
-8649955.com: could not connect to host
-8649966.com: could not connect to host
-8649977.com: could not connect to host
-866304.com: could not connect to host
-866314.com: could not connect to host
-866341.com: could not connect to host
-866346.com: could not connect to host
-866349.com: could not connect to host
-866374.com: could not connect to host
-866394.com: could not connect to host
-8666213.com: max-age too low: 0
-8688fc.com: could not connect to host
-8722.am: did not receive HSTS header
-8722.com: did not receive HSTS header
-8744b.com: did not receive HSTS header
-8744c.com: did not receive HSTS header
-8744d.com: did not receive HSTS header
-8744e.com: did not receive HSTS header
-8744f.com: did not receive HSTS header
-8744g.com: did not receive HSTS header
-8744h.com: did not receive HSTS header
-8744i.com: did not receive HSTS header
-8744j.com: did not receive HSTS header
-8744k.com: did not receive HSTS header
-8744l.com: did not receive HSTS header
-8744m.com: did not receive HSTS header
-8744n.com: did not receive HSTS header
-8744o.com: did not receive HSTS header
-8744p.com: did not receive HSTS header
-8744q.com: did not receive HSTS header
-8744r.com: did not receive HSTS header
-8744s.com: did not receive HSTS header
-8744t.com: did not receive HSTS header
-8744u.com: did not receive HSTS header
-8744v.com: did not receive HSTS header
-8744w.com: could not connect to host
-8744x.com: could not connect to host
-8744y.com: did not receive HSTS header
-8744z.com: did not receive HSTS header
-87577.com: could not connect to host
-876666365.com: could not connect to host
-877027.com: could not connect to host
-88.to: did not receive HSTS header
-8818k3.com: could not connect to host
-88321365.com: could not connect to host
-8833445.com: could not connect to host
-8852ks.com: could not connect to host
-8855950.com: could not connect to host
-8866012.com: could not connect to host
-88740b.com: could not connect to host
-88740n.com: could not connect to host
-8876007.com: did not receive HSTS header
-8876008.com: could not connect to host
-8876009.com: did not receive HSTS header
-8876138.com: did not receive HSTS header
-8876205.com: could not connect to host
-8876278.com: did not receive HSTS header
-8876289.com: could not connect to host
-8876290.com: did not receive HSTS header
-8876353.com: did not receive HSTS header
-8876389.com: did not receive HSTS header
-8876520.com: did not receive HSTS header
-8876578.com: could not connect to host
-8876598.com: could not connect to host
-8876655.com: could not connect to host
-8876660.com: could not connect to host
-8876687.com: did not receive HSTS header
-8876764.com: did not receive HSTS header
-8876770.com: did not receive HSTS header
-8876775.com: could not connect to host
-8876776.com: did not receive HSTS header
-8876779.com: could not connect to host
-8876808.com: did not receive HSTS header
-8876818.com: could not connect to host
-8876822.com: could not connect to host
-8876832.com: did not receive HSTS header
-8876835.com: did not receive HSTS header
-8876838.com: could not connect to host
-8876858.com: could not connect to host
-8876859.com: did not receive HSTS header
-8876866.com: could not connect to host
-8876878.com: did not receive HSTS header
-8876879.com: could not connect to host
-8876881.com: could not connect to host
-8876882.com: could not connect to host
-8876883.com: could not connect to host
-8876898.com: could not connect to host
-8876900.com: could not connect to host
-8876955.com: did not receive HSTS header
-8876979.com: did not receive HSTS header
-8876987.com: could not connect to host
-8876989.com: did not receive HSTS header
-8876991.com: could not connect to host
-8876992.com: could not connect to host
-8876996.com: did not receive HSTS header
-8880005555.com: max-age too low: 0
-8880013.com: did not receive HSTS header
-8880021.com: did not receive HSTS header
-8880023.com: did not receive HSTS header
-8880025.com: did not receive HSTS header
-8880057.com: could not connect to host
-8880059.com: did not receive HSTS header
-8880067.com: did not receive HSTS header
-8880083.com: did not receive HSTS header
-8880100.com: did not receive HSTS header
-8882345j.com: did not receive HSTS header
-888321365.com: could not connect to host
-8884553.com: could not connect to host
-888666pj.com: could not connect to host
-8886737.com: did not receive HSTS header
-8886739.com: did not receive HSTS header
-8886793.com: did not receive HSTS header
-8886806.com: did not receive HSTS header
-8886860.com: did not receive HSTS header
-888789j.com: could not connect to host
-8887999.com: did not receive HSTS header
-88881.pw: could not connect to host
-8888365q.com: did not receive HSTS header
-8888av.co: could not connect to host
-8888yh.com: did not receive HSTS header
-8889457.com: could not connect to host
-8889458.com: did not receive HSTS header
-8889466.com: did not receive HSTS header
-8889563.com: did not receive HSTS header
-8889709.com: did not receive HSTS header
-8889729.com: did not receive HSTS header
-8889792.com: did not receive HSTS header
-8889807.com: did not receive HSTS header
-8889809.com: did not receive HSTS header
-8889819.com: did not receive HSTS header
-8889870.com: did not receive HSTS header
-8889881.com: did not receive HSTS header
-8889890.com: did not receive HSTS header
-8889893.com: did not receive HSTS header
-8889903.com: did not receive HSTS header
-8889910.com: did not receive HSTS header
-888azino.com: did not receive HSTS header
-888bwf.com: could not connect to host
-888lu.co: could not connect to host
-888msc.vip: could not connect to host
-88bwf.com: could not connect to host
-88d.com: could not connect to host
-88laohu.cc: could not connect to host
-88laohu.com: could not connect to host
-88n13.com: could not connect to host
-890238.com: could not connect to host
-8951889.com: could not connect to host
-8989k3.com: could not connect to host
-89955.com: could not connect to host
-899699.com: did not receive HSTS header
-89he.com: could not connect to host
-8ack.de: could not connect to host
-8ackprotect.com: did not receive HSTS header
-8azino777.ru: did not receive HSTS header
-8b8888.com: could not connect to host
-8ballbombom.uk: could not connect to host
-8da188.com: did not receive HSTS header
-8da2017.com: could not connect to host
-8da2018.com: could not connect to host
-8da222.com: did not receive HSTS header
-8da88.com: did not receive HSTS header
-8da999.com: did not receive HSTS header
-8dabet.com: could not connect to host
-8hrs.net: could not connect to host
-8mpay.com: could not connect to host
-8pc.ru: did not receive HSTS header
-8pecxstudios.com: could not connect to host
-8shequapp.com: could not connect to host
-8svn.com: did not receive HSTS header
-8t88.biz: could not connect to host
-8ung.online: could not connect to host
-8xx.bet: could not connect to host
-8xx.io: could not connect to host
-8y.network: could not connect to host
-8yun.cf: could not connect to host
-908.la: could not connect to host
-90n13.com: could not connect to host
-90smthng.com: could not connect to host
-91-freedom.com: could not connect to host
-910kj.com: could not connect to host
-9118.la: did not receive HSTS header
-9118b.com: could not connect to host
-9118inc.com: could not connect to host
-911911.pw: could not connect to host
-914cq.com: could not connect to host
-917jjj.com: did not receive HSTS header
-918116.com: could not connect to host
-9181181.com: could not connect to host
-9181182.com: could not connect to host
-9181183.com: could not connect to host
-9181184.com: could not connect to host
-9181185.com: could not connect to host
-9181186.com: could not connect to host
-9181187.com: could not connect to host
-9181189.com: could not connect to host
-9182289.com: could not connect to host
-918ddk.com: could not connect to host
-918dp.com: could not connect to host
-918ma.com: could not connect to host
-918nn.com: could not connect to host
-918sa.com: could not connect to host
-918ui.com: could not connect to host
-918yy.com: did not receive HSTS header
-919093590.com: max-age too low: 0
-91966.com: max-age too low: 172800
-919945.com: could not connect to host
-91d71.com: could not connect to host
-91d72.com: could not connect to host
-91d73.com: could not connect to host
-91d75.com: could not connect to host
-91d76.com: could not connect to host
-91d77.com: could not connect to host
-91d78.com: could not connect to host
-91d79.com: could not connect to host
-91d90.com: could not connect to host
-91d91.com: could not connect to host
-91d92.com: could not connect to host
-91d93.com: could not connect to host
-91d95.com: could not connect to host
-91d96.com: could not connect to host
-91d97.com: could not connect to host
-91dh.cc: could not connect to host
-91lt.info: could not connect to host
-91milk.net: did not receive HSTS header
-922.be: could not connect to host
-929349.com: could not connect to host
-9297.com: did not receive HSTS header
-9297a.co: could not connect to host
-9297aa.co: could not connect to host
-9297b.co: could not connect to host
-9297bb.co: could not connect to host
-9297c.co: could not connect to host
-9297cc.co: could not connect to host
-9297d.co: could not connect to host
-9297dd.co: could not connect to host
-9297dh.co: could not connect to host
-9297e.co: could not connect to host
-9297e.com: could not connect to host
-9297ee.co: could not connect to host
-9297f.co: could not connect to host
-9297ff.co: could not connect to host
-9297g.co: could not connect to host
-9297gg.co: could not connect to host
-9297h.co: could not connect to host
-9297hd.co: could not connect to host
-9297hh.co: could not connect to host
-9297i.co: could not connect to host
-9297ii.co: could not connect to host
-9297j.co: could not connect to host
-9297jj.co: could not connect to host
-9297k.co: could not connect to host
-9297kk.co: could not connect to host
-9297l.co: could not connect to host
-9297ll.co: could not connect to host
-9297m.co: could not connect to host
-9297mm.co: could not connect to host
-9297n.co: could not connect to host
-9297nn.co: could not connect to host
-9297o.co: could not connect to host
-9297oo.co: could not connect to host
-9297p.co: could not connect to host
-9297p.com: could not connect to host
-9297pp.co: could not connect to host
-9297q.co: could not connect to host
-9297qq.co: could not connect to host
-9297r.co: could not connect to host
-9297rr.co: could not connect to host
-9297s.co: could not connect to host
-9297ss.co: could not connect to host
-9297t.co: could not connect to host
-9297tt.co: could not connect to host
-9297u.co: could not connect to host
-9297uu.co: could not connect to host
-9297v.co: could not connect to host
-9297vv.co: could not connect to host
-9297w.co: could not connect to host
-9297ww.co: could not connect to host
-9297x.co: could not connect to host
-9297xx.co: could not connect to host
-9297y.co: could not connect to host
-9297yy.co: could not connect to host
-9297z.co: could not connect to host
-9297zz.co: could not connect to host
-92bmh.com: did not receive HSTS header
-9397.com: could not connect to host
-9397a.com: could not connect to host
-9397aa.com: could not connect to host
-9397b.com: could not connect to host
-9397bb.com: could not connect to host
-9397c.com: could not connect to host
-9397cc.com: could not connect to host
-9397dd.com: could not connect to host
-9397dh.com: could not connect to host
-9397e.com: could not connect to host
-9397ee.com: could not connect to host
-9397f.com: could not connect to host
-9397ff.com: could not connect to host
-9397g.com: could not connect to host
-9397gg.com: could not connect to host
-9397h.com: could not connect to host
-9397hb.com: could not connect to host
-9397hd.com: could not connect to host
-9397hh.com: could not connect to host
-9397i.com: could not connect to host
-9397ii.com: could not connect to host
-9397j.com: could not connect to host
-9397jj.com: could not connect to host
-9397kk.com: could not connect to host
-9397l.com: could not connect to host
-9397ll.com: could not connect to host
-9397m.com: could not connect to host
-9397mm.com: could not connect to host
-9397n.com: could not connect to host
-9397nn.com: could not connect to host
-9397o.com: could not connect to host
-9397oo.com: could not connect to host
-9397p.com: could not connect to host
-9397pp.com: could not connect to host
-9397q.com: could not connect to host
-9397qq.com: could not connect to host
-9397r.com: could not connect to host
-9397rr.com: could not connect to host
-9397s.com: could not connect to host
-9397ss.com: could not connect to host
-9397t.com: could not connect to host
-9397tt.com: could not connect to host
-9397u.com: could not connect to host
-9397uu.com: could not connect to host
-9397v.com: could not connect to host
-9397vv.com: could not connect to host
-9397w.com: could not connect to host
-9397ww.com: could not connect to host
-9397x.com: could not connect to host
-9397xx.com: could not connect to host
-9397y.com: could not connect to host
-9397yy.com: could not connect to host
-9397z.com: could not connect to host
-9397zz.com: could not connect to host
-93cq.com: could not connect to host
-944cq.com: did not receive HSTS header
-9454.com: could not connect to host
-946773.com: could not connect to host
-947cq.com: did not receive HSTS header
-9499588.com: could not connect to host
-94cs.cn: could not connect to host
-9500years.com: max-age too low: 0
-95778.com: did not receive HSTS header
-960news.ca: could not connect to host
-961621.com: did not receive HSTS header
-9617818.com: could not connect to host
-9617818.net: could not connect to host
-961cq.com: could not connect to host
-963cq.com: did not receive HSTS header
-9651678.ru: could not connect to host
-967606.com: could not connect to host
-9721.com: could not connect to host
-9721a.com: could not connect to host
-9721aa.com: could not connect to host
-9721b.com: could not connect to host
-9721bb.com: could not connect to host
-9721c.com: could not connect to host
-9721cc.com: could not connect to host
-9721d.com: could not connect to host
-9721dd.com: could not connect to host
-9721dh.com: could not connect to host
-9721e.com: could not connect to host
-9721ee.com: could not connect to host
-9721f.com: could not connect to host
-9721ff.com: could not connect to host
-9721g.com: could not connect to host
-9721gg.com: could not connect to host
-9721h.com: could not connect to host
-9721hd.com: could not connect to host
-9721hh.com: could not connect to host
-9721i.com: could not connect to host
-9721j.com: could not connect to host
-9721jj.com: could not connect to host
-9721k.com: could not connect to host
-9721kk.com: could not connect to host
-9721l.com: could not connect to host
-9721ll.com: could not connect to host
-9721m.com: could not connect to host
-9721mm.com: could not connect to host
-9721n.com: could not connect to host
-9721nn.com: could not connect to host
-9721o.com: could not connect to host
-9721oo.com: could not connect to host
-9721p.com: could not connect to host
-9721pp.com: could not connect to host
-9721q.com: could not connect to host
-9721qq.com: could not connect to host
-9721r.com: could not connect to host
-9721rr.com: could not connect to host
-9721s.com: could not connect to host
-9721ss.com: could not connect to host
-9721t.com: could not connect to host
-9721tt.com: could not connect to host
-9721u.com: could not connect to host
-9721uu.com: could not connect to host
-9721v.com: could not connect to host
-9721vv.com: could not connect to host
-9721w.com: could not connect to host
-9721ww.com: could not connect to host
-9721x.com: could not connect to host
-9721xx.com: could not connect to host
-9721y.com: could not connect to host
-9721yy.com: could not connect to host
-9721z.com: could not connect to host
-9721zz.com: could not connect to host
-9728.com: could not connect to host
-9728a.co: could not connect to host
-9728aa.co: could not connect to host
-9728b.co: could not connect to host
-9728c.co: could not connect to host
-9728cc.co: could not connect to host
-9728d.co: could not connect to host
-9728dd.co: could not connect to host
-9728dh.co: did not receive HSTS header
-9728e.co: could not connect to host
-9728ee.co: could not connect to host
-9728f.co: could not connect to host
-9728ff.co: could not connect to host
-9728g.co: could not connect to host
-9728gg.co: could not connect to host
-9728h.co: could not connect to host
-9728hd.co: could not connect to host
-9728hh.co: could not connect to host
-9728i.co: could not connect to host
-9728ii.co: could not connect to host
-9728j.co: could not connect to host
-9728jj.co: could not connect to host
-9728k.co: could not connect to host
-9728kk.co: could not connect to host
-9728l.co: could not connect to host
-9728ll.co: could not connect to host
-9728m.co: could not connect to host
-9728mm.co: could not connect to host
-9728n.co: could not connect to host
-9728nn.co: could not connect to host
-9728o.co: could not connect to host
-9728oo.co: could not connect to host
-9728p.co: could not connect to host
-9728pp.co: could not connect to host
-9728q.co: could not connect to host
-9728qq.co: could not connect to host
-9728r.co: could not connect to host
-9728rr.co: could not connect to host
-9728s.co: could not connect to host
-9728ss.co: could not connect to host
-9728t.co: could not connect to host
-9728tt.co: could not connect to host
-9728u.co: could not connect to host
-9728uu.co: could not connect to host
-9728v.co: could not connect to host
-9728vv.co: could not connect to host
-9728w.co: could not connect to host
-9728ww.co: could not connect to host
-9728x.co: could not connect to host
-9728xx.co: could not connect to host
-9728y.co: could not connect to host
-9728yy.co: could not connect to host
-9728z.co: could not connect to host
-9728zz.co: could not connect to host
-9796k8.com: did not receive HSTS header
-9796k8.net: did not receive HSTS header
-97bros.com: did not receive HSTS header
-98198823.com: max-age too low: 0
-9822.bz: could not connect to host
-9822.com: did not receive HSTS header
-9822.info: could not connect to host
-9867666.com: did not receive HSTS header
-987666365.com: could not connect to host
-987987.com: did not receive HSTS header
-989868888.com: max-age too low: 0
-98laba.com: could not connect to host
-98laba.net: could not connect to host
-9906753.net: could not connect to host
-99321365.com: could not connect to host
-9933445.com: could not connect to host
-99511.fi: did not receive HSTS header
-9968.ag: did not receive HSTS header
-9968.love: did not receive HSTS header
-9968131.com: did not receive HSTS header
-9968166.com: did not receive HSTS header
-9968282.com: did not receive HSTS header
-9968363.com: did not receive HSTS header
-9968389.com: did not receive HSTS header
-9968393.com: did not receive HSTS header
-9968404.com: could not connect to host
-9968505.com: could not connect to host
-9968508.com: could not connect to host
-9968535.com: could not connect to host
-9968595.com: could not connect to host
-9968600.com: did not receive HSTS header
-9968656.com: did not receive HSTS header
-9968707.com: could not connect to host
-9968717.com: could not connect to host
-9968838.com: could not connect to host
-9968959.com: could not connect to host
-9968969.com: could not connect to host
-9968aa.com: did not receive HSTS header
-9968aaa.com: could not connect to host
-9968ab.com: did not receive HSTS header
-9968abc.com: did not receive HSTS header
-9968app.com: did not receive HSTS header
-9968bbb.com: could not connect to host
-9968caipiao.com: did not receive HSTS header
-9968cc.com: could not connect to host
-9968ccc.com: could not connect to host
-9968com.com: could not connect to host
-9968dd.com: could not connect to host
-9968ddd.com: could not connect to host
-9968ee.com: did not receive HSTS header
-9968eee.com: could not connect to host
-9968ff.com: could not connect to host
-9968fff.com: could not connect to host
-9968gg.com: could not connect to host
-9968ggg.com: could not connect to host
-9968go.com: did not receive HSTS header
-9968hh.com: did not receive HSTS header
-9968hhh.com: could not connect to host
-9968ii.com: could not connect to host
-9968iii.com: could not connect to host
-9968jj.com: did not receive HSTS header
-9968jjj.com: could not connect to host
-9968ll.com: did not receive HSTS header
-9968lll.com: could not connect to host
-9968mm.com: did not receive HSTS header
-9968mmm.com: did not receive HSTS header
-9968nn.com: could not connect to host
-9968nnn.com: could not connect to host
-9968ok.com: could not connect to host
-9968oo.com: could not connect to host
-9968ooo.com: could not connect to host
-9968pp.com: did not receive HSTS header
-9968ppp.com: could not connect to host
-9968qq.com: could not connect to host
-9968qqq.com: could not connect to host
-9968rr.com: did not receive HSTS header
-9968rrr.com: could not connect to host
-9968ss.com: could not connect to host
-9968sss.com: could not connect to host
-9968ttt.com: could not connect to host
-9968uu.com: could not connect to host
-9968uuu.com: did not receive HSTS header
-9968vv.com: did not receive HSTS header
-9968vvv.com: could not connect to host
-9968ww.com: could not connect to host
-9968www.com: could not connect to host
-9968xl.com: could not connect to host
-9968xx.com: could not connect to host
-9968xxx.com: did not receive HSTS header
-9968yy.com: did not receive HSTS header
-9968yyy.com: did not receive HSTS header
-9968zz.com: could not connect to host
-9968zzz.com: could not connect to host
-99818adc.com: max-age too low: 0
-999321365.com: could not connect to host
-9994553.com: could not connect to host
-9998722.com: could not connect to host
-99989796.com: did not receive HSTS header
-99989796.net: did not receive HSTS header
-9999365q.com: did not receive HSTS header
-99998522.com: could not connect to host
-99998744.com: could not connect to host
-9999k8.com: did not receive HSTS header
-9999k8.net: did not receive HSTS header
-99buffets.com: could not connect to host
-99n13.com: could not connect to host
-99wxt.com: could not connect to host
-9allery.com: could not connect to host
-9hosts.net: could not connect to host
-9jajuice.com: could not connect to host
-9jaxtreme.com.ng: could not connect to host
-9k262.com: could not connect to host
-9k323.com: could not connect to host
-9k326.com: could not connect to host
-9k329.com: could not connect to host
-9k337.com: could not connect to host
-9k339.com: could not connect to host
-9k367.com: could not connect to host
-9k377.com: could not connect to host
-9k379.com: could not connect to host
-9k382.com: could not connect to host
-9k387.com: could not connect to host
-9k389.com: could not connect to host
-9k392.com: could not connect to host
-9k393.com: could not connect to host
-9k395.com: could not connect to host
-9k396.com: could not connect to host
-9k397.com: could not connect to host
-9k399.com: could not connect to host
-9k562.com: could not connect to host
-9k563.com: could not connect to host
-9k565.com: could not connect to host
-9k568.com: could not connect to host
-9k569.com: could not connect to host
-9k572.com: could not connect to host
-9k576.com: could not connect to host
-9k626.com: could not connect to host
-9k628.com: could not connect to host
-9k636.com: could not connect to host
-9k653.com: could not connect to host
-9k658.com: could not connect to host
-9k662.com: could not connect to host
-9k663.com: could not connect to host
-9k665.com: could not connect to host
-9k667.com: could not connect to host
-9k668.com: could not connect to host
-9k669.com: could not connect to host
-9k682.com: could not connect to host
-9k686.com: could not connect to host
-9k689.com: could not connect to host
-9k692.com: could not connect to host
-9k698.com: did not receive HSTS header
-9k823.com: could not connect to host
-9k826.com: could not connect to host
-9k827.com: could not connect to host
-9k833.com: could not connect to host
-9k835.com: could not connect to host
-9k836.com: could not connect to host
-9k839.com: could not connect to host
-9k855.com: could not connect to host
-9k856.com: could not connect to host
-9k859.com: could not connect to host
-9k863.com: could not connect to host
-9k865.com: could not connect to host
-9k872.com: could not connect to host
-9k875.com: could not connect to host
-9k876.com: could not connect to host
-9k877.com: could not connect to host
-9k878.com: could not connect to host
-9k879.com: could not connect to host
-9k883.com: could not connect to host
-9k885.com: could not connect to host
-9k889.com: could not connect to host
-9k892.com: could not connect to host
-9k893.com: could not connect to host
-9k896.com: could not connect to host
-9k899.com: could not connect to host
-9n1shop.com: did not receive HSTS header
-9point6.com: could not connect to host
-9ss6.com: could not connect to host
-9thwonder.com: did not receive HSTS header
-9won.kr: could not connect to host
-9y.at: did not receive HSTS header
-a-bm.de: did not receive HSTS header
-a-intel.com: did not receive HSTS header
-a-ix.net: could not connect to host
-a-little-linux-box.at: did not receive HSTS header
-a-players.team: could not connect to host
-a-plus.space: could not connect to host
-a-pro-pos.info: did not receive HSTS header
-a-rickroll-n.pw: could not connect to host
-a-shafaat.ir: did not receive HSTS header
-a-starbouncycastles.co.uk: could not connect to host
-a-theme.com: could not connect to host
-a04webapp.com: could not connect to host
-a1-autopartsglasgow.com: did not receive HSTS header
-a122.cc: could not connect to host
-a1798.com: could not connect to host
-a1972894570.com: max-age too low: 0
-a19840925.com: max-age too low: 0
-a1autotransport.com: did not receive HSTS header
-a1moldsolutions.com: could not connect to host
-a1scubastore.com: did not receive HSTS header
-a200k.xyz: did not receive HSTS header
-a2c-co.net: could not connect to host
-a2it.gr: did not receive HSTS header
-a3.pm: did not receive HSTS header
-a30365.com: did not receive HSTS header
-a365vip7.com: could not connect to host
-a3workshop.swiss: could not connect to host
-a5197.co: could not connect to host
-a632079.me: did not receive HSTS header
-a6632.com: could not connect to host
-a666l.com: max-age too low: 0
-a6729.co: could not connect to host
-a6729.com: did not receive HSTS header
-a6957.co: could not connect to host
-a6957.com: did not receive HSTS header
-a7la-chat.com: did not receive HSTS header
-a899365.com: could not connect to host
-a8q.org: could not connect to host
-a9297.co: could not connect to host
-a9397.com: could not connect to host
-a9721.com: could not connect to host
-a9728.co: could not connect to host
-a9c.co: did not receive HSTS header
-aa1718.net: could not connect to host
-aa43d.cn: could not connect to host
-aa5197.co: could not connect to host
-aa6688.net: could not connect to host
-aa6729.co: could not connect to host
-aa6729.com: did not receive HSTS header
-aa6957.co: could not connect to host
-aa753159.com: max-age too low: 0
-aa7733.com: could not connect to host
-aa9297.co: could not connect to host
-aa9397.com: could not connect to host
-aa9721.com: could not connect to host
-aa9728.co: could not connect to host
-aacfree.com: could not connect to host
-aaeblog.com: did not receive HSTS header
-aaeblog.net: did not receive HSTS header
-aaeblog.org: did not receive HSTS header
-aaex.cloud: did not receive HSTS header
-aagetransport.no: could not connect to host
-aanbieders.ga: could not connect to host
-aandeautobody.com: could not connect to host
-aaoo.net: could not connect to host
-aapp.space: could not connect to host
-aardvarksolutions.co.za: did not receive HSTS header
-aariefhaafiz.com: could not connect to host
-aaron-gustafson.com: did not receive HSTS header
-aaron-schaal.de: could not connect to host
-aaron.cm: could not connect to host
-aaron.xin: could not connect to host
-aaronburt.co.uk: could not connect to host
-aaronhorler.com: could not connect to host
-aaronhorler.com.au: could not connect to host
-aaronmcguire.me: did not receive HSTS header
-aarvinproperties.com: could not connect to host
-ab-bauservice-berlin.de: did not receive HSTS header
-abacus-events.co.uk: did not receive HSTS header
-abanilla.tk: could not connect to host
-abareplace.com: did not receive HSTS header
-abasalehngo.com: could not connect to host
-abasky.net: could not connect to host
-abbas.ch: could not connect to host
-abborsjo.fi: did not receive HSTS header
-abbotsparties.co.uk: could not connect to host
-abbradar.net: did not receive HSTS header
-abc-solutions.cf: could not connect to host
-abc001.ga: could not connect to host
-abc8081.net: could not connect to host
-abc9981.com: max-age too low: 0
-abcdentalcare.com: did not receive HSTS header
-abcdzgx.com: max-age too low: 0
-abchelp.net: could not connect to host
-abdullah.pw: could not connect to host
-abearofsoap.com: could not connect to host
-abecodes.net: could not connect to host
-abeestrada.com: did not receive HSTS header
-aberdeenalmeras.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-abhibhat.com: did not receive HSTS header
-abi-2017.tk: could not connect to host
-abi-fvs.de: could not connect to host
-abigailstark.com: could not connect to host
-abilitylist.org: did not receive HSTS header
-abilitynet.org.uk: did not receive HSTS header
-abimelec.com: could not connect to host
-abinferis.com: could not connect to host
-abioniere.de: could not connect to host
-abitaspringsla.gov: could not connect to host
-abitur97ag.de: did not receive HSTS header
-ablak-nyilaszaro.info: did not receive HSTS header
-ablogagency.net: could not connect to host
-abmahnhelfer.de: did not receive HSTS header
-abnarnro.com: could not connect to host
-aboderenovation.co.uk: could not connect to host
-abolition.co: could not connect to host
-abosav.com: did not receive HSTS header
-abou.to: could not connect to host
-about.ge: did not receive HSTS header
-aboutmyip.info: did not receive HSTS header
-aboutyou-deals.de: could not connect to host
-abraxan.pro: could not connect to host
-abrilect.com: could not connect to host
-abruzzobeautybar.com: did not receive HSTS header
-absimple.ca: did not receive HSTS header
-absinthium.ch: could not connect to host
-absolutehaitian.com: did not receive HSTS header
-absolutehosting.co.za: did not receive HSTS header
-absolutewaterproofingsolutions.com: did not receive HSTS header
-abstractbarista.com: could not connect to host
-abstudio.de: did not receive HSTS header
-abt.de: did not receive HSTS header
-abtom.de: did not receive HSTS header
-abublog.com: could not connect to host
-abury.fr: could not connect to host
-abury.me: did not receive HSTS header
-abyssgaming.eu: could not connect to host
-ac-town.com: could not connect to host
-acabadosboston.com: could not connect to host
-academialowcost.com.br: did not receive HSTS header
-academicenterprise.org: did not receive HSTS header
-academicexperts.us: did not receive HSTS header
-academy4.net: did not receive HSTS header
-acadianapatios.com: did not receive HSTS header
-acaeum.com: did not receive HSTS header
-acai51.net: could not connect to host
-acandroid.top: could not connect to host
-acaonegocios.com.br: could not connect to host
-acapadena.co: could not connect to host
-acbc.ie: max-age too low: 0
-accadoro.it: did not receive HSTS header
-accbay.com: could not connect to host
-accelerate.network: could not connect to host
-accelerator.net: did not receive HSTS header
-accelight.co.jp: did not receive HSTS header
-accelight.jp: did not receive HSTS header
-access-sofia.org: did not receive HSTS header
-accessmy.net: did not receive HSTS header
-acchikocchi.org: did not receive HSTS header
-acclivity.pro: could not connect to host
-accolade.com.br: could not connect to host
-accordable.gq: could not connect to host
-accoun.technology: could not connect to host
-accounts-p.com: did not receive HSTS header
-accountsuspended.club: could not connect to host
-accuritconsulting.com: did not receive HSTS header
-accuritpresence.com: did not receive HSTS header
-accwing.com: could not connect to host
-ace-aegon.cloud: could not connect to host
-ace.media: did not receive HSTS header
-aceadvisory.biz: did not receive HSTS header
-acefreightco.com: could not connect to host
-acen.eu: could not connect to host
-acevik.de: did not receive HSTS header
-acfo.org: did not receive HSTS header
-acg.mn: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-acg.sb: could not connect to host
-acg1080.com: did not receive HSTS header
-acg18.us: could not connect to host
-acgaudio.com: could not connect to host
-acgmoon.com: could not connect to host
-acgmoon.org: could not connect to host
-acgpiano.club: could not connect to host
-acheconcursos.com.br: did not receive HSTS header
-acheirj.com.br: could not connect to host
-acheritage.co.uk: did not receive HSTS header
-achinsk.tk: could not connect to host
-achmadfamily.com: could not connect to host
-achow101.com: did not receive HSTS header
-achterhoekseveiligheidsbeurs.nl: could not connect to host
-acicj.org: did not receive HSTS header
-acid.ninja: could not connect to host
-acidbin.co: did not receive HSTS header
-aciety.com: did not receive HSTS header
-acisonline.net: did not receive HSTS header
-ackis.duckdns.org: could not connect to host
-acklandstainless.com.au: did not receive HSTS header
-acksoft.fr: did not receive HSTS header
-acksoftdemo.fr: did not receive HSTS header
-acl.ink: could not connect to host
-acmexyz123.info: could not connect to host
-acoffeeshops.com: could not connect to host
-acorns.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-acorntreecare.com: could not connect to host
-acoshift.com: could not connect to host
-acoshift.me: did not receive HSTS header
-acp-integrative.fr: did not receive HSTS header
-acpcoils.com: did not receive HSTS header
-acpinformatique.fr: could not connect to host
-acr.im: could not connect to host
-acraft.org: could not connect to host
-acrealux.lu: did not receive HSTS header
-acrepairdrippingsprings.com: could not connect to host
-acritelli.com: did not receive HSTS header
-acrobatic.tk: could not connect to host
-acrolife.cz: did not receive HSTS header
-acroso.me: did not receive HSTS header
-across.ml: could not connect to host
-acrossgw.com: could not connect to host
-acs-chantal.com: did not receive HSTS header
-acsihostingsolutions.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-acslimited.co.uk: did not receive HSTS header
-actc81.fr: could not connect to host
-actilove.ch: could not connect to host
-actingcxo.com: did not receive HSTS header
-actiontowingroundrock.com: did not receive HSTS header
-activateplay.com: did not receive HSTS header
-active-escape.com: could not connect to host
-activeclearweb.com: could not connect to host
-activescreenshots.com: could not connect to host
-activeweb.top: could not connect to host
-activistasconstructivos.org: did not receive HSTS header
-activiteithardenberg.nl: could not connect to host
-activitesaintnicaise.org: could not connect to host
-activiti.alfresco.com: did not receive HSTS header
-actorshop.co.uk: could not connect to host
-actorsroom.com: could not connect to host
-actserv.co.ke: could not connect to host
-actu-film.com: max-age too low: 0
-actu-medias.com: did not receive HSTS header
-actualite-videos.com: could not connect to host
-actuatemedia.com: did not receive HSTS header
-acuaticos.top: could not connect to host
-acupofsalt.tv: could not connect to host
-acupunturamadrid.xyz: could not connect to host
-acuve.jp: could not connect to host
-acyclovir-cream.cf: could not connect to host
-ad-disruptio.fr: could not connect to host
-ad13.in: could not connect to host
-ada.eco: could not connect to host
-ada.is: max-age too low: 2592000
-adajwells.me: could not connect to host
-adam-wilson.me: did not receive HSTS header
-adambalogh.net: could not connect to host
-adamcoffee.net: could not connect to host
-adamjoycegames.co.uk: could not connect to host
-adamkaminski.com: did not receive HSTS header
-adamradocz.com: could not connect to host
-adamsbouncycastles.co.uk: could not connect to host
-adamsfoundationrepair.com: did not receive HSTS header
-adamtatusko.com: max-age too low: 0
-adamwallington.co.uk: could not connect to host
-adamwilcox.org: did not receive HSTS header
-adamwk.com: did not receive HSTS header
-adarshcloud.in: could not connect to host
-adarshthapa.in: did not receive HSTS header
-adastra.re: could not connect to host
-adblock.ovh: could not connect to host
-adboos.com: could not connect to host
-addaxpetroleum.com: could not connect to host
-addeekt.com: could not connect to host
-addistribution.it: could not connect to host
-addones.net: could not connect to host
-addvocate.com: could not connect to host
-addydari.us: could not connect to host
-addyourlink.tk: could not connect to host
-adec-emsa.ae: could not connect to host
-adelaides.com: did not receive HSTS header
-adelevie.com: could not connect to host
-adelgace.top: could not connect to host
-adelianz.com: did not receive HSTS header
-adelinlydia-coach.com: did not receive HSTS header
-adeon.ml: could not connect to host
-adequatetechnology.com: could not connect to host
-aderal.io: could not connect to host
-adesa-asesoria.com: did not receive HSTS header
-adfa-1.com: could not connect to host
-adhigamindia.com: could not connect to host
-adhoc.is: could not connect to host
-adhosting.nl: did not receive HSTS header
-adhs-chaoten.net: could not connect to host
-adigitali.biz: did not receive HSTS header
-adinariversloveschool.com: could not connect to host
-adindexr.com: could not connect to host
-adint.net: did not receive HSTS header
-adiponectinsupplement.info: did not receive HSTS header
-adiponectinsupplement.net: did not receive HSTS header
-adlerweb.info: did not receive HSTS header
-adm-sarov.ru: could not connect to host
-admin-forms.co.uk: did not receive HSTS header
-admin-numerique.com: did not receive HSTS header
-admin.google.com: did not receive HSTS header (error ignored - included regardless)
-admins.tech: did not receive HSTS header
-adminwerk.com: did not receive HSTS header
-adminwerk.net: did not receive HSTS header
-adminwiki.fr: did not receive HSTS header
-admirable.pro: could not connect to host
-admitcard.co.in: could not connect to host
-admsel.ec: could not connect to host
-adnanoktar.com: did not receive HSTS header
-adnanotoyedekparca.com: could not connect to host
-adnmb1.com: could not connect to host
-adnot.am: did not receive HSTS header
-adnseguros.es: could not connect to host
-adoal.net: could not connect to host
-adoge.me: could not connect to host
-adohanyzasjovoje.hu: did not receive HSTS header
-adonairelogios.com.br: could not connect to host
-adonizer.science: could not connect to host
-adonnante.com: could not connect to host
-adopteunsiteflash.com: could not connect to host
-adorai.tk: could not connect to host
-adoriasoft.com: did not receive HSTS header
-adprospb.com: did not receive HSTS header
-adquisitio.de: did not receive HSTS header
-adquisitio.in: could not connect to host
-adrenaline-gaming.ru: could not connect to host
-adresults.com: did not receive HSTS header
-adresults.nl: did not receive HSTS header
-adrian-riemer.tk: could not connect to host
-adrian2023.com: did not receive HSTS header
-adrianajewelry.my: could not connect to host
-adriancohea.ninja: could not connect to host
-adrianjensen.com: could not connect to host
-adrianseo.ro: could not connect to host
-adrien.vin: did not receive HSTS header
-adrinet.tk: could not connect to host
-adrino.ml: could not connect to host
-adrl.ca: could not connect to host
-adsfund.org: could not connect to host
-aduedu.de: did not receive HSTS header
-adult.properties: could not connect to host
-adultbizz.eu: could not connect to host
-adunanza.net: did not receive HSTS header
-advaithnikhi.ml: could not connect to host
-advaithnikhi.tk: could not connect to host
-advanced-online.eu: could not connect to host
-advanceddisposables.co.uk: did not receive HSTS header
-advancedplasticsurgerycenter.com: did not receive HSTS header
-advancedstudio.ro: could not connect to host
-advancedweb.hu: did not receive HSTS header
-advancyte.com: did not receive HSTS header
-advelty.cz: did not receive HSTS header
-advenapay.com: could not connect to host
-advengers.net: did not receive HSTS header
-adventistdeploy.org: could not connect to host
-adventureally.com: could not connect to host
-adventureforest.de: did not receive HSTS header
-adventureworldtour.com: could not connect to host
-adver.top: did not receive HSTS header
-advertisemant.com: could not connect to host
-advicepro.org.uk: did not receive HSTS header
-adviespuntklokkenluiders.nl: could not connect to host
-adviserplus.com: could not connect to host
-advocaten-avocats.be: did not receive HSTS header
-advocatenalkmaar.org: could not connect to host
-advocator.ca: could not connect to host
-advokaty-onlajn.gq: could not connect to host
-adws.io: could not connect to host
-adzie.xyz: could not connect to host
-adzuna.co.uk: did not receive HSTS header
-ae8601.com: could not connect to host
-ae86sb.com: could not connect to host
-ae86x.com: could not connect to host
-aegee-utrecht.nl: did not receive HSTS header
-aegialis.com: did not receive HSTS header
-aegisinsight.com: did not receive HSTS header
-aei-asc.edu.my: did not receive HSTS header
-aemoria.com: could not connect to host
-aeon.wiki: could not connect to host
-aep-digital.com: did not receive HSTS header
-aerapass.io: did not receive HSTS header
-aereco.com: did not receive HSTS header
-aerialmediapro.net: could not connect to host
-aerolog.co: did not receive HSTS header
-aeroparking.es: did not receive HSTS header
-aerotheque.fr: could not connect to host
-aes256.ru: could not connect to host
-aestheticdr.org: did not receive HSTS header
-aesthetics-blog.com: did not receive HSTS header
-aestore.by: could not connect to host
-aesym.de: could not connect to host
-aether.pw: could not connect to host
-aethonan.pro: could not connect to host
-aetoscg.com: could not connect to host
-aetoscg.com.au: did not receive HSTS header
-aevpn.net: could not connect to host
-aevpn.org: could not connect to host
-aeyoun.com: did not receive HSTS header
-af-fotografie.net: did not receive HSTS header
-af-internet.nl: did not receive HSTS header
-af-tech.cz: could not connect to host
-afb24.de: did not receive HSTS header
-afbeelding.im: could not connect to host
-afbeeldinguploaden.nl: could not connect to host
-afdkompakt.de: max-age too low: 86400
-afeefzarapackages.com: did not receive HSTS header
-aff.moe: did not receive HSTS header
-affiliateroyale.com: did not receive HSTS header
-affily.io: could not connect to host
-affloc.com: did not receive HSTS header
-affordableblindsexpress.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-affordablebouncycastle.co.uk: did not receive HSTS header
-affordableenergyadvocates.com: could not connect to host
-affordablekilimanjaro.com: could not connect to host
-affvps.net: could not connect to host
-afganistan.cf: could not connect to host
-afghan.gq: could not connect to host
-aficotroceni.ro: did not receive HSTS header
-afinterio.com: did not receive HSTS header
-afiru.net: could not connect to host
-aflamtorrent.com: did not receive HSTS header
-aflfreebets.com: could not connect to host
-aflowershop.ca: could not connect to host
-afmchandler.com: did not receive HSTS header
-afmt.fr: did not receive HSTS header
-afonso.io: did not receive HSTS header
-afp548.tk: could not connect to host
-african-bay.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-africanexponent.com: did not receive HSTS header
-africankitchen.gallery: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-africatravel.de: did not receive HSTS header
-afscheidsportret.nl: could not connect to host
-aftab-alam.de: could not connect to host
-after.im: did not receive HSTS header
-afterskool.eu: could not connect to host
-afterstack.net: could not connect to host
-afuh.de: could not connect to host
-afvallendoeje.nu: could not connect to host
-afyou.co.kr: could not connect to host
-afzco.asia: did not receive HSTS header
-ag-websolutions.de: did not receive HSTS header
-ag775.com: could not connect to host
-ag88.com: could not connect to host
-ag8891.com: could not connect to host
-ag9999.co: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-agalaxyfarfaraway.co.uk: could not connect to host
-agarioforum.ga: could not connect to host
-agatheetraphael.fr: could not connect to host
-agbremen.de: could not connect to host
-agdalieso.com.ba: could not connect to host
-age.hk: did not receive HSTS header
-agelesscitizen.com: could not connect to host
-agelesscitizens.com: could not connect to host
-agenbettingasia.com: did not receive HSTS header
-agenceactiv.immo: did not receive HSTS header
-agenceklic.com: did not receive HSTS header
-agencewebstreet.com: did not receive HSTS header
-agenciafiscal.pe: could not connect to host
-agenciagriff.com: did not receive HSTS header
-agenciamdg.com.br: did not receive HSTS header
-agencymanager.be: could not connect to host
-agendazilei.com: did not receive HSTS header
-agendo.com.ar: did not receive HSTS header
-agent6.com.au: did not receive HSTS header
-agentseeker.ca: could not connect to host
-agenziapubblicitaria.milano.it: could not connect to host
-agenziapubblicitaria.roma.it: could not connect to host
-agevio.com: could not connect to host
-agglo-sion.ch: could not connect to host
-aggr.pw: did not receive HSTS header
-agia.ad: did not receive HSTS header
-agiairini.cz: could not connect to host
-agic.io: did not receive HSTS header
-agilebits.net: could not connect to host
-agileecommerce.com.br: did not receive HSTS header
-agingstop.net: could not connect to host
-agiosthomas.tk: could not connect to host
-agiserv.fr: could not connect to host
-agks131.com: could not connect to host
-agoravm.tk: could not connect to host
-agostinhoenascimento.com.br: could not connect to host
-agotnes.com: could not connect to host
-agowa.eu: did not receive HSTS header
-agracan.com: could not connect to host
-agrafix.design: did not receive HSTS header
-agrajag.nl: did not receive HSTS header
-agrargruppe.tk: could not connect to host
-agreor.com: could not connect to host
-agrias.com.br: did not receive HSTS header
-agrikulturchic.com: could not connect to host
-agrilinks.org: did not receive HSTS header
-agrimap.com: did not receive HSTS header
-agro-forestry.net: could not connect to host
-agro-id.gov.ua: did not receive HSTS header
-agro.rip: could not connect to host
-agroglass.com.br: did not receive HSTS header
-agrolab.dk: did not receive HSTS header
-agtv.com.br: did not receive HSTS header
-agul.tk: did not receive HSTS header
-ahabingo.com: did not receive HSTS header
-ahd1234.com: max-age too low: 0
-ahelos.tk: could not connect to host
-aheng.me: did not receive HSTS header
-ahero4all.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-ahidta.gov: could not connect to host
-ahiru3.com: did not receive HSTS header
-ahmadly.com: max-age too low: 2592000
-ahmd.io: did not receive HSTS header
-aholic.co: did not receive HSTS header
-ahoynetwork.com: could not connect to host
-ahri.ovh: could not connect to host
-ahsin.online: could not connect to host
-ahwah.net: could not connect to host
-ahwatukeefoothillsmontessori.com: did not receive HSTS header
-ai.je: did not receive HSTS header
-ai00.vip: could not connect to host
-ai1989.com: could not connect to host
-aia.de: did not receive HSTS header
-aibaoyou.com: could not connect to host
-aibiying.com: could not connect to host
-aibsoftware.mx: could not connect to host
-aicial.co.uk: could not connect to host
-aicial.com: could not connect to host
-aicial.com.au: could not connect to host
-aicv.club: could not connect to host
-aidanwoods.com: did not receive HSTS header
-aide-admin.com: did not receive HSTS header
-aide-valais.ch: could not connect to host
-aidhan.net: could not connect to host
-aidikofflaw.com: could not connect to host
-aido.gq: could not connect to host
-aiesecarad.ro: could not connect to host
-aiforsocialmedia.com: could not connect to host
-aifreeze.ru: could not connect to host
-aify.eu: could not connect to host
-aiheisi.com: could not connect to host
-aiicy.org: could not connect to host
-aiida.se: did not receive HSTS header
-aikenorganics.com: could not connect to host
-aiki.tk: did not receive HSTS header
-aim-consultants.com: did not receive HSTS header
-aimd.tech: did not receive HSTS header
-aimerworld.com: did not receive HSTS header
-aimonline.nl: did not receive HSTS header
-aimrom.org: could not connect to host
-ainishitou.com: max-age too low: 0
-ainrb.com: could not connect to host
-ainutrition.co.uk: did not receive HSTS header
-aioboot.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-aip-marine.com: could not connect to host
-aiphyron.com: could not connect to host
-aipi.de: did not receive HSTS header
-aiponne.com: could not connect to host
-airbly.com: did not receive HSTS header
-airconsboksburg.co.za: did not receive HSTS header
-airconsrandburg.co.za: did not receive HSTS header
-airconssandton.co.za: did not receive HSTS header
-airductcleaning-fresno.com: did not receive HSTS header
-airedaleterrier.com.br: could not connect to host
-airi-tabei.com: could not connect to host
-airlea.com: could not connect to host
-airlectrical-airconditioning.com.au: could not connect to host
-airline-economy.com: did not receive HSTS header
-airlinecheckins.com: did not receive HSTS header
-airlock.com: did not receive HSTS header
-airmazinginflatables.com: could not connect to host
-airportlimototoronto.com: did not receive HSTS header
-airproto.com: could not connect to host
-airpurifierproductsonline.com: could not connect to host
-airsick.guide: did not receive HSTS header
-airtimefranchise.com: could not connect to host
-airware.com: did not receive HSTS header
-airwegobouncycastles.co.uk: did not receive HSTS header
-aishnair.com: could not connect to host
-aisin.ae: did not receive HSTS header
-aisle3.space: could not connect to host
-aisr.nl: did not receive HSTS header
-aiticon.de: did not receive HSTS header
-aivene.com: could not connect to host
-aiw-thkoeln.online: could not connect to host
-aiwdirect.com: did not receive HSTS header
-aixxe.net: did not receive HSTS header
-ajapaik.ee: did not receive HSTS header
-ajces.com: could not connect to host
-ajetaci.cz: could not connect to host
-ajibot.com: could not connect to host
-ajmahal.com: could not connect to host
-ajman-realty.ga: could not connect to host
-ajouin.com: could not connect to host
-ajsgall.com: could not connect to host
-ajw-group.com: did not receive HSTS header
-aka.my: did not receive HSTS header
-akash.tk: could not connect to host
-akazakov.info: did not receive HSTS header
-akboy.pw: could not connect to host
-akclinics.org: did not receive HSTS header
-akcounselingservices.com: did not receive HSTS header
-akerek.hu: could not connect to host
-akgundemirbas.com: could not connect to host
-akhilindurti.com: could not connect to host
-akhras.at: did not receive HSTS header
-akiba-server.info: could not connect to host
-akihiro.xyz: could not connect to host
-akilli-devre.com: could not connect to host
-akita-boutique.com: could not connect to host
-akita-stream.com: could not connect to host
-akkadia.cc: could not connect to host
-akoch.net: could not connect to host
-akombakom.net: could not connect to host
-akpwebdesign.com: did not receive HSTS header
-akracing.se: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-akritikos.info: could not connect to host
-akselimedia.fi: could not connect to host
-akshay.in.eu.org: could not connect to host
-akstudentsfirst.org: could not connect to host
-aktan.com.br: could not connect to host
-aktivist.in: did not receive HSTS header
-aktuelle-uhrzeit.at: did not receive HSTS header
-akul.co.in: could not connect to host
-akupunktur-akupunktoer.dk: did not receive HSTS header
-akustik.tech: could not connect to host
-akuston.eu: did not receive HSTS header
-akyildiz.net: did not receive HSTS header
-al-shami.net: could not connect to host
-alamancetv.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-alamgir.works: did not receive HSTS header
-alanlee.net: could not connect to host
-alanrickmanflipstable.com: did not receive HSTS header
-alanya.law: did not receive HSTS header
-alarelleimpresiones.com: could not connect to host
-alariel.de: did not receive HSTS header
-alarme-gps.ch: could not connect to host
-alarmegps.ch: could not connect to host
-alarmsystemreviews.com: did not receive HSTS header
-alaskarsbc.org: did not receive HSTS header
-alasta.info: could not connect to host
-alauda-home.de: could not connect to host
-alaundeil.xyz: could not connect to host
-albanboye.info: did not receive HSTS header
-albaniaonline.tk: could not connect to host
-albaniareiser.no: could not connect to host
-albanien.guide: could not connect to host
-alberguecimballa.es: could not connect to host
-albertify.xyz: could not connect to host
-albertonplumber24-7.co.za: did not receive HSTS header
-albertopimienta.com: did not receive HSTS header
-albinma.com: could not connect to host
-albrocar.com: could not connect to host
-albuic.tk: could not connect to host
-alcantarafleuriste.com: did not receive HSTS header
-alcatraz.online: did not receive HSTS header
-alcazaar.com: could not connect to host
-alchemia.co.il: did not receive HSTS header
-alcnutrition.com: could not connect to host
-alcoholrehab.website: did not receive HSTS header
-alcorao.org: could not connect to host
-aldenmiamibeach.com: did not receive HSTS header
-aldes.co.za: did not receive HSTS header
-aldred.cloud: did not receive HSTS header
-aleax.me: could not connect to host
-alecel.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-alecvannoten.be: did not receive HSTS header
-aledg.cl: did not receive HSTS header
-aleksejjocic.tk: could not connect to host
-alenan.org: could not connect to host
-alertaenlinea.gov: did not receive HSTS header
-alessandro.pw: did not receive HSTS header
-alessandroz.pro: could not connect to host
-alethearose.com: could not connect to host
-alevi-forum.tk: could not connect to host
-alexandermuetzel.de: did not receive HSTS header
-alexandernorth.ch: could not connect to host
-alexandre.sh: did not receive HSTS header
-alexandrefa.ovh: could not connect to host
-alexandros.io: could not connect to host
-alexbresnahan.com: could not connect to host
-alexdaulby.com: did not receive HSTS header
-alexdodge.ca: did not receive HSTS header
-alexfisherhealth.com.au: did not receive HSTS header
-alexhaydock.co.uk: did not receive HSTS header
-alexio.ml: could not connect to host
-alexisathlani.com: could not connect to host
-alexischaussy.xyz: could not connect to host
-alexismeza.com: could not connect to host
-alexismeza.com.mx: could not connect to host
-alexismeza.dk: could not connect to host
-alexismeza.es: could not connect to host
-alexismeza.nl: could not connect to host
-alexkidd.de: could not connect to host
-alexkott.com: did not receive HSTS header
-alexmak.net: did not receive HSTS header
-alexmol.tk: could not connect to host
-alexmroberts.net: could not connect to host
-alexperry.io: could not connect to host
-alexsinnott.me: did not receive HSTS header
-alexthayne.co.uk: could not connect to host
-alexwilliams.tech: could not connect to host
-alfa24.pro: could not connect to host
-alfagroup.es: did not receive HSTS header
-alfaponny.se: did not receive HSTS header
-alfirous.com: did not receive HSTS header
-alfonsostriano.it: did not receive HSTS header
-alfredxing.com: did not receive HSTS header
-algarmatic-automatismos.pt: could not connect to host
-algawell.com: did not receive HSTS header
-algbee.com: could not connect to host
-algebra-quiz.com: could not connect to host
-algebraaec.com: did not receive HSTS header
-algercounty.gov: did not receive HSTS header
-alghaib.com: could not connect to host
-algoaware.eu: could not connect to host
-algofactory.de: could not connect to host
-algorithmic.ml: could not connect to host
-algorithmofsuccess.com: could not connect to host
-algoritmus-uspechu.cz: could not connect to host
-alibaba-test.tk: did not receive HSTS header
-alibababee.com: could not connect to host
-alibiloungelv.com: did not receive HSTS header
-alibip.de: could not connect to host
-alicialab.org: could not connect to host
-alien.bz: did not receive HSTS header
-alienflight.com: could not connect to host
-alienvision.com.br: could not connect to host
-aliim.gdn: could not connect to host
-alilialili.ga: could not connect to host
-alinemaciel.adm.br: could not connect to host
-alinode.com: could not connect to host
-alis-test.tk: could not connect to host
-alistairholland.me: did not receive HSTS header
-alisync.com: could not connect to host
-alittlebitcheeky.com: did not receive HSTS header
-aliwebstore.com: max-age too low: 7889238
-aljammaz.holdings: did not receive HSTS header
-aljmz.com: did not receive HSTS header
-alkami.com: max-age too low: 0
-alkamitech.com: max-age too low: 0
-all-subtitles.com: could not connect to host
-all.tf: could not connect to host
-all4nursesksa.net: did not receive HSTS header
-all4os.com: could not connect to host
-allaboutthekink.org: could not connect to host
-allamericanpaintingplus.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-allcat.ga: could not connect to host
-allcinema.jp: could not connect to host
-alldaymonitoring.com: could not connect to host
-alldm.ru: could not connect to host
-alldolledupstore.com: did not receive HSTS header
-allegro-inc.com: did not receive HSTS header
-allemobieleproviders.nl: could not connect to host
-allenosgood.com: did not receive HSTS header
-allerbestefreunde.de: could not connect to host
-allesisonline.nl: did not receive HSTS header
-allesovertech.nl: could not connect to host
-allfreelancers.su: did not receive HSTS header
-alliance-clan.tk: could not connect to host
-alliance-compacts.com: did not receive HSTS header
-alliances-faq.de: could not connect to host
-allied.sh: could not connect to host
-alligatorge.de: did not receive HSTS header
-allinnote.com: could not connect to host
-allinonecyprus.com: did not receive HSTS header
-allisonchapleau.com: did not receive HSTS header
-allius.de: could not connect to host
-allkindzabeats.com: could not connect to host
-allmbw.com: could not connect to host
-allmebel.ru: did not receive HSTS header
-allmend-ru.de: did not receive HSTS header
-allmystery.de: did not receive HSTS header
-allo-symo.fr: did not receive HSTS header
-allods-zone.ru: did not receive HSTS header
-alloffice.com.ua: did not receive HSTS header
-alloinformatique.net: could not connect to host
-alloutatl.com: could not connect to host
-alloutofgum.com: could not connect to host
-alloydevil.nl: did not receive HSTS header
-allpropertyservices.com: did not receive HSTS header
-allprorisk.com: did not receive HSTS header
-allram.info: could not connect to host
-allram.one: could not connect to host
-allrealty.co.za: could not connect to host
-allscammers.exposed: could not connect to host
-allseasons-cleaning.co.uk: could not connect to host
-allshousedesigns.com: did not receive HSTS header
-allsortscastles.co.uk: could not connect to host
-allstarpartyinflatables.co.uk: could not connect to host
-allstarswithus.com: could not connect to host
-allstorebrasil.com.br: could not connect to host
-allthings.how: did not receive HSTS header
-allthingsblogging.com: did not receive HSTS header
-allthingsfpl.com: could not connect to host
-allurefest.com: max-age too low: 604800
-allwiki.tk: could not connect to host
-almagalla.com: could not connect to host
-aloalabs.com: did not receive HSTS header
-alocato.com: could not connect to host
-aloexn.com: max-age too low: 0
-alonas.ovh: did not receive HSTS header
-alorenzi.eu: did not receive HSTS header
-alp.net.cn: could not connect to host
-alparque.com: did not receive HSTS header
-alpe-d-or.dyn-o-saur.com: could not connect to host
-alpenjuice.com: could not connect to host
-alpha-centauri.tk: could not connect to host
-alpha.irccloud.com: could not connect to host
-alphabit-secure.com: could not connect to host
-alphabrock.cn: did not receive HSTS header
-alphabuild.io: could not connect to host
-alphadote.com: could not connect to host
-alphafitnesslibya.com: could not connect to host
-alphagamers.net: max-age too low: 0
-alphagateanddoor.com: did not receive HSTS header
-alphahunks.com: could not connect to host
-alphalabs.xyz: could not connect to host
-alphaman.ooo: did not receive HSTS header
-alphatrash.de: did not receive HSTS header
-alpineplanet.com: did not receive HSTS header
-alqassam.net: did not receive HSTS header
-alquiladoramexico.com: did not receive HSTS header
-alrait.com: could not connect to host
-alroniks.com: could not connect to host
-als-hardware.co.za: did not receive HSTS header
-alspolska.pl: max-age too low: 2592000
-alstroemeria.org: could not connect to host
-alt-tab-design.com: did not receive HSTS header
-alt33c3.org: could not connect to host
-altabib.me: could not connect to host
-altahrim.net: could not connect to host
-altaide.com: did not receive HSTS header
-altailife.ru: did not receive HSTS header
-altamarea.se: could not connect to host
-altbinaries.com: did not receive HSTS header
-altea-pep18.com: did not receive HSTS header
-alteqnia.com: could not connect to host
-altercpa.ru: max-age too low: 0
-altered.network: could not connect to host
-altered.si: could not connect to host
-altergalaxy.tk: could not connect to host
-alternativedev.ca: could not connect to host
-altfire.ca: could not connect to host
-altiacaselight.com: could not connect to host
-altisnet.ga: could not connect to host
-altoneum.com: could not connect to host
-altos.tk: could not connect to host
-altporn.xyz: could not connect to host
-alts.li: could not connect to host
-alttrackr.com: could not connect to host
-aluminium-scaffolding.co.uk: could not connect to host
-alunjam.es: did not receive HSTS header
-alunonaescola.com.br: could not connect to host
-aluoblog.pw: could not connect to host
-aluoblog.top: could not connect to host
-aluro.info: did not receive HSTS header
-alusta.co: could not connect to host
-alvis-audio.com: did not receive HSTS header
-alvn.ga: could not connect to host
-alwaysdry.com.au: did not receive HSTS header
-alwaysonssl.com: could not connect to host
-alxpresentes.com.br: could not connect to host
-alzonaprinting.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-am-39.com: could not connect to host
-am-liaotian.com: could not connect to host
-am3.se: could not connect to host
-am5566m.com: could not connect to host
-am8213.com: could not connect to host
-am8888.top: could not connect to host
-amadilo.de: could not connect to host
-amadvice.com: could not connect to host
-amaforro.com: could not connect to host
-amaforums.org: did not receive HSTS header
-amalfi5stars.com: did not receive HSTS header
-amalficoastchauffeur.com: did not receive HSTS header
-amaliagamis.com: could not connect to host
-amandaonishi.com: could not connect to host
-amanet.ro: did not receive HSTS header
-amao999.com: max-age too low: 0
-amaranthus.com.ph: could not connect to host
-amateurchef.co.uk: did not receive HSTS header
-amatzen.dk: did not receive HSTS header
-amavis.org: did not receive HSTS header
-amazing-gaming.fr: could not connect to host
-amazingbouncycastles.co.uk: did not receive HSTS header
-amazingfloridagulfhomes.com: could not connect to host
-amazinginflatables.co.uk: could not connect to host
-ambiancestudio.ro: did not receive HSTS header
-ambouncyhire.com: could not connect to host
-ambra.net.au: did not receive HSTS header
-ambrosio.tk: could not connect to host
-ambrosius.io: could not connect to host
-amcchemical.com: could not connect to host
-amcvega.com: could not connect to host
-amdouglas.uk: could not connect to host
-amechancez.site: could not connect to host
-amedtest.org: did not receive HSTS header
-amelandadventure.nl: did not receive HSTS header
-amend-friseur-schwabing.de: did not receive HSTS header
-amendoeiraresort.com: did not receive HSTS header
-amerhd.com: could not connect to host
-america250.gov: max-age too low: 300
-american-truck-simulator.de: could not connect to host
-american-truck-simulator.net: could not connect to host
-americanbio.com: did not receive HSTS header
-americandistribuidora.com: did not receive HSTS header
-americanindiancoc.org: did not receive HSTS header
-americanoutlawjeepparts.com: did not receive HSTS header
-americansportsinstitute.org: did not receive HSTS header
-americanworkwear.nl: did not receive HSTS header
-amerigroup.com: did not receive HSTS header
-amerimarkdirect.com: did not receive HSTS header
-ames.gq: could not connect to host
-ameschristian.net: did not receive HSTS header
-amesplash.co.uk: did not receive HSTS header
-amesvacuumrepair.com: could not connect to host
-amethystcards.co.uk: could not connect to host
-amethyste.moe: did not receive HSTS header
-ameza.co.uk: could not connect to host
-ameza.com.mx: could not connect to host
-ameza.io: could not connect to host
-ameza.me: could not connect to host
-ameza.net: could not connect to host
-amg-exterieur.fr: could not connect to host
-amiciidogrescue.org.uk: did not receive HSTS header
-amicimar.it: did not receive HSTS header
-amicsdelbus.com: did not receive HSTS header
-amielle.com: did not receive HSTS header
-amielucha.com: did not receive HSTS header
-amigogeek.net: could not connect to host
-amihub.com: did not receive HSTS header
-amilum.org: could not connect to host
-amilx.com: could not connect to host
-amilx.org: could not connect to host
-amimoto-ami.com: did not receive HSTS header
-amin.ga: did not receive HSTS header
-amin.one: could not connect to host
-aminafrance.com: could not connect to host
-aminorth.com: could not connect to host
-aminullrouted.com: could not connect to host
-amiserver.de: could not connect to host
-amisharingstuff.com: could not connect to host
-amishsecurity.com: could not connect to host
-amitriptyline-hydrochloride.ga: did not receive HSTS header
-amitse.com: could not connect to host
-amitube.com: could not connect to host
-amiu.org: could not connect to host
-amleeds.co.uk: did not receive HSTS header
-amlvfs.net: could not connect to host
-ammoulianiapartments.com: did not receive HSTS header
-ammrio.com.br: did not receive HSTS header
-amo-entreprise-et-commerce.fr: could not connect to host
-amok8.am: could not connect to host
-amoory.com: could not connect to host
-amorimendes.com.br: could not connect to host
-amosng.com: could not connect to host
-amphibo.ly: could not connect to host
-ampledesigners.com: could not connect to host
-ampleinfographics.com: could not connect to host
-ampol-agd.pl: did not receive HSTS header
-amri.nl: did not receive HSTS header
-amstelland.com: did not receive HSTS header
-amtentertainments.co.uk: could not connect to host
-amua.fr: did not receive HSTS header
-amunoz.org: could not connect to host
-amv-crm.ru: did not receive HSTS header
-amyharrisonline.com: did not receive HSTS header
-amyrussellhair.com: could not connect to host
-amzanalyzer.com: did not receive HSTS header
-anabol.nl: could not connect to host
-anachronis.gq: could not connect to host
-anadoluefessk.org: did not receive HSTS header
-anadoluefessporkulubu.org: could not connect to host
-anaethelion.fr: could not connect to host
-anagra.ms: could not connect to host
-anaisypirueta.es: did not receive HSTS header
-anajianu.ro: max-age too low: 2592000
-anakros.me: did not receive HSTS header
-analangelsteen.com: could not connect to host
-analbleachingguide.com: did not receive HSTS header
-analpantyhose.org: could not connect to host
-analytic-s.ml: could not connect to host
-analyticsinmotion.net: could not connect to host
-analyzemyfriends.com: could not connect to host
-ananas.gq: could not connect to host
-ananiev.ml: could not connect to host
-anarajaoui.ma: could not connect to host
-anarchistos.tk: could not connect to host
-anarchyrp.life: could not connect to host
-anassiriphotography.com: could not connect to host
-anastasiafond.com: did not receive HSTS header
-anaveragehuman.eu.org: did not receive HSTS header
-ancarda.net: could not connect to host
-ancel.io: could not connect to host
-anchorgrounds.com: did not receive HSTS header
-anchorinmarinainc.com: did not receive HSTS header
-ancient-gates.de: could not connect to host
-ancientcraft.eu: could not connect to host
-ancientkarma.com: could not connect to host
-andbraiz.com: could not connect to host
-andere-gedanken.net: did not receive HSTS header
-anderslind.dk: did not receive HSTS header
-andicui.net: did not receive HSTS header
-andisadhdspot.com: could not connect to host
-andiscyber.space: could not connect to host
-andoms.fi: did not receive HSTS header
-andre-ballensiefen.de: could not connect to host
-andreas-hecht.com: did not receive HSTS header
-andreasanti.net: did not receive HSTS header
-andreasbasurto.com: could not connect to host
-andreasfritz-fotografie.de: could not connect to host
-andreashecht-blog.de: did not receive HSTS header
-andreaskluge.eu: could not connect to host
-andreasmuelhaupt.de: could not connect to host
-andreasr.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-andreastoneman.com: could not connect to host
-andrefaber.nl: did not receive HSTS header
-andrei-coman.com: could not connect to host
-andreigec.net: could not connect to host
-andrejbenz.com: could not connect to host
-andrejstefanovski.com: did not receive HSTS header
-andrepicard.de: could not connect to host
-andrerose.ca: did not receive HSTS header
-andrewbroekman.com: could not connect to host
-andrewdavidwong.com: did not receive HSTS header
-andrewdaws.co: could not connect to host
-andrewdaws.info: could not connect to host
-andrewdaws.me: could not connect to host
-andrewdaws.tv: could not connect to host
-andrewletson.com: could not connect to host
-andrewmcfarlane.tk: could not connect to host
-andrewmichaud.beer: could not connect to host
-andrewrdaws.com: could not connect to host
-andrewregan.me: could not connect to host
-andrewtebert.com: did not receive HSTS header
-andrewthelott.net: did not receive HSTS header
-andrewvoce.com: did not receive HSTS header
-andrewyg.net: could not connect to host
-andrey.red: could not connect to host
-andrezadnik.com: did not receive HSTS header
-andriraharjo.com: could not connect to host
-android: could not connect to host
-androidprosmart.com: could not connect to host
-androidsphone.com: did not receive HSTS header
-androled.fr: max-age too low: 5184000
-andronika.net: could not connect to host
-androoz.se: did not receive HSTS header
-androzoom.com: did not receive HSTS header
-andso.cn: did not receive HSTS header
-andyclark.io: could not connect to host
-andycloud.dynu.net: could not connect to host
-andymartin.cc: could not connect to host
-andymelichar.com: max-age too low: 0
-andymoore.info: did not receive HSTS header
-andys-place.co.uk: could not connect to host
-andyuk.org: did not receive HSTS header
-anecuni-club.com: could not connect to host
-anecuni-rec.com: could not connect to host
-anegabawa.com: did not receive HSTS header
-anendlesssupply.co.uk: did not receive HSTS header
-anfenglish.com: did not receive HSTS header
-anfsanchezo.co: could not connect to host
-anfsanchezo.me: could not connect to host
-ange-de-bonheur444.com: could not connect to host
-angel-body.com: could not connect to host
-angelcloudworld.com: did not receive HSTS header
-angelcojuelo.com: did not receive HSTS header
-angelic47.com: max-age too low: 2592000
-angelinaangulo.com: did not receive HSTS header
-angeloroberto.ch: did not receive HSTS header
-angeloryndon.com: did not receive HSTS header
-angelsgirl.eu.org: could not connect to host
-angervillelorcher.fr: did not receive HSTS header
-anghami.com: did not receive HSTS header
-anglertanke.de: could not connect to host
-anglesgirl.eu.org: could not connect to host
-anglesya.win: did not receive HSTS header
-anglictinatabor.cz: could not connect to host
-angorarental.com: did not receive HSTS header
-angrut.com: could not connect to host
-angry-monk.com: could not connect to host
-angrydragonproductions.com: could not connect to host
-angrylab.com: could not connect to host
-angryroute.com: could not connect to host
-anguiao.com: did not receive HSTS header
-aniaimichal.eu: could not connect to host
-aniforprez.net: could not connect to host
-anim.ee: could not connect to host
-animacurse.moe: could not connect to host
-animal-nature-human.com: could not connect to host
-animalstropic.com: could not connect to host
-animamega.tk: could not connect to host
-animan.ca: could not connect to host
-animatelluris.nl: could not connect to host
-anime-drift.tk: could not connect to host
-anime1.top: could not connect to host
-anime1video.tk: could not connect to host
-animeday.ml: could not connect to host
-animesfusion.com.br: did not receive HSTS header
-animesharp.com: could not connect to host
-animorphsfanforum.com: could not connect to host
-animurecs.com: did not receive HSTS header
-aniplus.cf: could not connect to host
-aniplus.gq: could not connect to host
-aniplus.ml: could not connect to host
-anisekai.com: max-age too low: 2592000
-anita-mukorom.hu: did not receive HSTS header
-anitklib.ml: could not connect to host
-anitube-nocookie.ch: could not connect to host
-anitube.ch: could not connect to host
-aniwhen.com: did not receive HSTS header
-ankakaak.com: could not connect to host
-ankaraprofesyonelnakliyat.com: did not receive HSTS header
-ankaraprofesyonelnakliyat.com.tr: did not receive HSTS header
-ankarayilmaznakliyat.com: did not receive HSTS header
-ankarayucelnakliyat.com: did not receive HSTS header
-ankenbrand.me: did not receive HSTS header
-anlovegeek.net: did not receive HSTS header
-anlp.top: could not connect to host
-anna-dance.ru: could not connect to host
-annabellaw.com: did not receive HSTS header
-annahmeschluss.de: did not receive HSTS header
-annarbor.group: did not receive HSTS header
-annasvapor.se: could not connect to host
-annetaan.fi: did not receive HSTS header
-annetta.net: could not connect to host
-annevankesteren.com: could not connect to host
-annevankesteren.org: could not connect to host
-annicascakes.nl: could not connect to host
-annotate.software: could not connect to host
-annrusnak.com: did not receive HSTS header
-annsbouncycastles.com: could not connect to host
-anoboy.org: did not receive HSTS header
-anomaly.ws: did not receive HSTS header
-anonboards.com: could not connect to host
-anonoriviera.com: could not connect to host
-anonrea.ch: could not connect to host
-anonukradio.org: could not connect to host
-anonymo.co.uk: could not connect to host
-anonymo.uk: could not connect to host
-anonymousbitcoinexchange.org: could not connect to host
-anonymousstatecollegelulzsec.com: could not connect to host
-anotherchef.com: did not receive HSTS header
-anothermilan.net: could not connect to host
-anothermusic.tk: could not connect to host
-ansdell.info: did not receive HSTS header
-anseo.ninja: could not connect to host
-ansermfg.com: max-age too low: 0
-ansgar.tk: could not connect to host
-anshuman-chatterjee.com: did not receive HSTS header
-anshumanbiswas.com: could not connect to host
-answers-online.ru: could not connect to host
-ant.land: could not connect to host
-antarctica.tk: could not connect to host
-antarctida.tk: could not connect to host
-antarktida.tk: could not connect to host
-antecim.fr: could not connect to host
-antenasmundosat.com.br: did not receive HSTS header
-anteprima.info: could not connect to host
-anthedesign.fr: did not receive HSTS header
-anthenor.co.uk: could not connect to host
-anthony-bardon.eu: could not connect to host
-anthony-rouanet.com: could not connect to host
-anthonyaires.com: did not receive HSTS header
-anthonyavon.com: could not connect to host
-anthro.id: could not connect to host
-antibioticshome.com: did not receive HSTS header
-antifraud.net.ru: could not connect to host
-antijob.tk: could not connect to host
-antikvariat.ru: could not connect to host
-antiled.by: could not connect to host
-antimatiere.space: did not receive HSTS header
-antimine.kr: could not connect to host
-antipa.ch: could not connect to host
-antirayapmalang.com: max-age too low: 36000
-antispam.group: did not receive HSTS header
-antoga.eu: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-antoine-roux.fr: did not receive HSTS header
-antoinebetas.be: did not receive HSTS header
-antoined.fr: did not receive HSTS header
-antoinemary.io: could not connect to host
-antonellabb.eu: could not connect to host
-antoniomarques.eu: did not receive HSTS header
-antoniorequena.com.ve: max-age too low: 0
-antons.io: did not receive HSTS header
-antonuotila.fi: did not receive HSTS header
-antraxx.ee: could not connect to host
-antscript.com: did not receive HSTS header
-anttitenhunen.com: could not connect to host
-anunayk.com: could not connect to host
-anycoin.me: did not receive HSTS header
-anyfood.fi: could not connect to host
-anynode.net: did not receive HSTS header
-anypool.fr: could not connect to host
-anypool.net: could not connect to host
-anyprime.net: could not connect to host
-anythingautowebster.com: did not receive HSTS header
-anytonetech.com: did not receive HSTS header
-aoaprograms.net: could not connect to host
-aobogo.com: could not connect to host
-aocast.info: could not connect to host
-aoicprobationil.gov: could not connect to host
-aojao.cn: could not connect to host
-aojf.fr: could not connect to host
-aoku3d.com: could not connect to host
-aolabs.nz: did not receive HSTS header
-aomberg.com: could not connect to host
-aomonk.com: did not receive HSTS header
-aooobo.com: could not connect to host
-aos-llc.com: did not receive HSTS header
-aosus.org: did not receive HSTS header
-aov.io: could not connect to host
-aovcentrum.nl: did not receive HSTS header
-aozora.moe: could not connect to host
-apadrinaunolivo.org: did not receive HSTS header
-apaginastore.com.br: could not connect to host
-aparaatti.org: could not connect to host
-apartamentosemindaiatuba.com.br: could not connect to host
-apartment-natik.fr: could not connect to host
-apeasternpower.com: could not connect to host
-aperture-laboratories.science: did not receive HSTS header
-apethink.net: did not receive HSTS header
-apfelcholest.de: did not receive HSTS header
-api.mega.co.nz: could not connect to host
-apiary.blog: could not connect to host
-apiary.clothing: could not connect to host
-apiary.shop: could not connect to host
-apiary.store: could not connect to host
-apiary.supplies: could not connect to host
-apiary.supply: could not connect to host
-apibot.de: could not connect to host
-apience.com: did not receive HSTS header
-apila.care: could not connect to host
-apila.us: could not connect to host
-apiled.io: could not connect to host
-apimo.net: did not receive HSTS header
-apis.blue: could not connect to host
-apis.google.com: did not receive HSTS header (error ignored - included regardless)
-apis.moe: did not receive HSTS header
-apis.world: could not connect to host
-apiu.me: could not connect to host
-apivia.fr: did not receive HSTS header
-apkdv.com: could not connect to host
-apkoyunlar.club: could not connect to host
-apkright.com: did not receive HSTS header
-apkriver.com: could not connect to host
-apl2bits.net: did not receive HSTS header
-apmg-cyber.com: did not receive HSTS header
-apmpproject.org: could not connect to host
-apnakliyat.com: did not receive HSTS header
-apo-deutschland.biz: could not connect to host
-apoil.org: could not connect to host
-apolloyl.com: could not connect to host
-apollyon.work: could not connect to host
-aponkral.site: could not connect to host
-aponkralsunucu.com: could not connect to host
-aponow.de: did not receive HSTS header
-aporter.ddns.net: could not connect to host
-aposke.com: could not connect to host
-apostilasaprovacao.com: could not connect to host
-apotheek-nl.org: did not receive HSTS header
-apotheke-ch.org: could not connect to host
-app: could not connect to host
-app-arena.com: did not receive HSTS header
-app.manilla.com: could not connect to host
-app666365.com: did not receive HSTS header
-apparels24.com: did not receive HSTS header
-appart.ninja: could not connect to host
-appbooks.net: did not receive HSTS header
-appchive.net: did not receive HSTS header
-appcoins.io: did not receive HSTS header
-appdb.cc: could not connect to host
-appdrinks.com: could not connect to host
-appel-aide.ch: could not connect to host
-appeldorn.me: could not connect to host
-appengine.google.com: did not receive HSTS header (error ignored - included regardless)
-apperio.com: did not receive HSTS header
-appformacpc.com: did not receive HSTS header
-appimlab.it: could not connect to host
-appinn.com: did not receive HSTS header
-apple-watch-zubehoer.de: could not connect to host
-apple.ax: could not connect to host
-applejacks-bouncy-castles.co.uk: could not connect to host
-applelife.ru: did not receive HSTS header
-appleranch.com: could not connect to host
-applesana.es: did not receive HSTS header
-applewatch.co.nz: did not receive HSTS header
-applez.xyz: did not receive HSTS header
-appliancerepairlosangeles.com: did not receive HSTS header
-appliancesrepairservice.ca: did not receive HSTS header
-apply55gx.com: could not connect to host
-appointed.at: did not receive HSTS header
-apponline.com: could not connect to host
-appraisal-comps.com: could not connect to host
-appreciationkards.com: could not connect to host
-approlys.fr: did not receive HSTS header
-apps-for-fishing.com: could not connect to host
-apps-perso.com: could not connect to host
-apps4all.sytes.net: could not connect to host
-appsbystudio.co.uk: could not connect to host
-appsdash.io: could not connect to host
-appshuttle.com: could not connect to host
-appsimplex.pt: could not connect to host
-appson.co.uk: did not receive HSTS header
-appspace.com: did not receive HSTS header
-appspacehosted.com: did not receive HSTS header
-appspacestatic.com: did not receive HSTS header
-appspaceusercontent.com: did not receive HSTS header
-apptomics.com: could not connect to host
-apptoutou.com: could not connect to host
-appuro.com: did not receive HSTS header
-appxcrypto.com: did not receive HSTS header
-apratimsaha.com: did not receive HSTS header
-aprendiendoforexhoy.com: could not connect to host
-aprpullmanportermuseum.org: could not connect to host
-apt-one.com: did not receive HSTS header
-aptitude9.com: could not connect to host
-apyha.com: could not connect to host
-aqdun.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-aqilacademy.com.au: could not connect to host
-aqqrate.com: could not connect to host
-aquabar.co.il: did not receive HSTS header
-aquafc.com: could not connect to host
-aquainfo.net: could not connect to host
-aquariumaccessories.shop: could not connect to host
-aquaron.com: did not receive HSTS header
-aquatechnologygroup.com: could not connect to host
-aquilaguild.com: could not connect to host
-aquilalab.com: could not connect to host
-aquireceitas.com: could not connect to host
-aquitroc.com: did not receive HSTS header
-arabdigitalexpression.org: did not receive HSTS header
-arabhardware.net: did not receive HSTS header
-arabia-news.gq: could not connect to host
-arabicxz.com: could not connect to host
-aradulconteaza.ro: could not connect to host
-aramado.com: did not receive HSTS header
-aramyss.com: could not connect to host
-aran.me.uk: could not connect to host
-arandinacf.tk: could not connect to host
-aranel.me: could not connect to host
-araraexpress.com.br: could not connect to host
-aravatul.com: could not connect to host
-arawaza.biz: could not connect to host
-arawaza.info: could not connect to host
-arboineuropa.nl: did not receive HSTS header
-arboworks.com: could not connect to host
-arbu.eu: could not connect to host
-arcadiaeng.com: did not receive HSTS header
-arcaea.net: could not connect to host
-arcbit.io: could not connect to host
-archematerial.com: did not receive HSTS header
-archerygearonline.com: did not receive HSTS header
-archii.ca: could not connect to host
-architectdirect.nl: did not receive HSTS header
-architecte-interieur.be: did not receive HSTS header
-archmediamarketing.com: could not connect to host
-archsec.info: could not connect to host
-arckr.com: could not connect to host
-arco.biz: could not connect to host
-arda-audio.pt: did not receive HSTS header
-ardao.me: did not receive HSTS header
-ardorlabs.se: could not connect to host
-area3.org: could not connect to host
-area536.com: did not receive HSTS header
-areallyneatwebsite.com: could not connect to host
-arefidgetspinnersgay.com: could not connect to host
-arenlor.com: could not connect to host
-arenlor.info: could not connect to host
-arenns.com: could not connect to host
-arent.kz: did not receive HSTS header
-arenzanaphotography.com: could not connect to host
-arewedubstepyet.com: could not connect to host
-areyouever.me: could not connect to host
-arg.zone: did not receive HSTS header
-argama-nature.com: could not connect to host
-argennon.xyz: could not connect to host
-argh.io: could not connect to host
-arguggi.co.uk: could not connect to host
-arheh.com: could not connect to host
-ariaartgallery.com: did not receive HSTS header
-arias.re: could not connect to host
-arifburhan.online: could not connect to host
-arifp.me: could not connect to host
-arima.co.ke: could not connect to host
-arimarie.com: could not connect to host
-arinflatablefun.co.uk: could not connect to host
-aripiprazolee.gq: could not connect to host
-arisevendor.net: could not connect to host
-arislight.com: could not connect to host
-aristilabs.com: did not receive HSTS header
-aristocrates.co: could not connect to host
-aristocratps.com: did not receive HSTS header
-arithxu.com: did not receive HSTS header
-arizer.com: did not receive HSTS header
-arizonaautomobileclub.com: could not connect to host
-arizonabondedtitle.com: could not connect to host
-arizonahomeownerinsurance.com: could not connect to host
-arka.gq: could not connect to host
-arkadelphia.gov: could not connect to host
-arkaic.dyndns.org: could not connect to host
-arkbyte.com: did not receive HSTS header
-arknodejs.com: could not connect to host
-arlatools.com: could not connect to host
-arlen.io: could not connect to host
-arlen.se: could not connect to host
-arlet.click: could not connect to host
-armazemdaminiatura.com.br: could not connect to host
-armazemgourmetbrasil.com.br: did not receive HSTS header
-armeni-jewellery.gr: did not receive HSTS header
-armenians.online: could not connect to host
-armeo.top: could not connect to host
-arminc.tk: could not connect to host
-armingrodon.de: did not receive HSTS header
-armleads.com: did not receive HSTS header
-armodec.com: did not receive HSTS header
-armor.com: did not receive HSTS header
-armored.ninja: did not receive HSTS header
-armory.consulting: could not connect to host
-armory.supplies: could not connect to host
-armsday.com: could not connect to host
-armyofbane.com: did not receive HSTS header
-armytricka.cz: did not receive HSTS header
-arnakdanielian.com: could not connect to host
-arnaudminable.net: could not connect to host
-arne-petersen.net: did not receive HSTS header
-arnesolutions.com: could not connect to host
-arno.pm: could not connect to host
-arogyadhamhealth.com: did not receive HSTS header
-aromachat.eu: could not connect to host
-aromaclub.nl: did not receive HSTS header
-aromatlas.com: could not connect to host
-around-the-blog.com: could not connect to host
-aroundme.org: could not connect to host
-arouparia.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-arpamip.org: could not connect to host
-arpr.co: did not receive HSTS header
-arpumpsonline.com: did not receive HSTS header
-arrayify.com: could not connect to host
-arrivedconsulting.com: could not connect to host
-arrow-cloud.nl: could not connect to host
-arrowfunction.com: could not connect to host
-arrowgrove.com: could not connect to host
-arrowit.net: did not receive HSTS header
-ars-design.net: did not receive HSTS header
-arsenal.ru: could not connect to host
-arshell.me: did not receive HSTS header
-arsk1.com: could not connect to host
-arslonga.io: could not connect to host
-arswb.men: could not connect to host
-art2web.net: could not connect to host
-artansoft.com: could not connect to host
-artaronquieres.com: did not receive HSTS header
-artartefatos.com.br: could not connect to host
-artbytik.ru: did not receive HSTS header
-artcar24.ru: did not receive HSTS header
-artcenter.tk: could not connect to host
-arte-soft.co: could not connect to host
-arteequipamientos.com.uy: did not receive HSTS header
-arteerotiko.com: did not receive HSTS header
-artegusto.ru: did not receive HSTS header
-artemicroway.com.br: could not connect to host
-artesupra.com: did not receive HSTS header
-arthur.cn: could not connect to host
-arti-group.ml: could not connect to host
-articaexports.com: could not connect to host
-artifex21.com: could not connect to host
-artifex21.fr: could not connect to host
-artificial.army: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-artik.cloud: could not connect to host
-artikelpendidikan.id: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-artiming.com: could not connect to host
-artisense.de: could not connect to host
-artisphere.ch: did not receive HSTS header
-artisticedgegranite.net: could not connect to host
-artistnetwork.nl: did not receive HSTS header
-artlabdentistry.com: could not connect to host
-artmanager.dk: did not receive HSTS header
-artmaxi.eu: could not connect to host
-artnims.com: could not connect to host
-arto.bg: did not receive HSTS header
-artofeyes.nl: could not connect to host
-artofhomeorganizing.com: could not connect to host
-artransparency.gov: did not receive HSTS header
-artsinthevalley.net.au: did not receive HSTS header
-artstopinc.com: did not receive HSTS header
-arturkohut.com: could not connect to host
-arturrossa.de: could not connect to host
-artyland.ru: could not connect to host
-arvamus.eu: could not connect to host
-arviksa.co.uk: could not connect to host
-arw.me: did not receive HSTS header
-aryabusines.com: did not receive HSTS header
-arzaroth.com: did not receive HSTS header
-arzinfo.pw: could not connect to host
-as.se: could not connect to host
-as204982.net: could not connect to host
-as9178.net: could not connect to host
-asafomba.com: could not connect to host
-asahikoji.net: could not connect to host
-asana.studio: did not receive HSTS header
-asasuou.pw: could not connect to host
-asc16.com: could not connect to host
-ascamso.com: could not connect to host
-ascendprime.com: did not receive HSTS header
-ascensori.biz: could not connect to host
-aschaefer.net: could not connect to host
-ascii.moe: could not connect to host
-asd.gov.au: did not receive HSTS header
-asdpress.cn: could not connect to host
-asec01.net: could not connect to host
-aseith.com: could not connect to host
-aseko.gr: did not receive HSTS header
-aselectionoffice.gov: could not connect to host
-asemanhotel.com: did not receive HSTS header
-asepms.com: could not connect to host
-asesoriaglobalenseguros.com.mx: did not receive HSTS header
-asge-handel.de: did not receive HSTS header
-ashastalent.com: could not connect to host
-ashkan-rechtsanwalt-arbeitsrecht-paderborn.de: did not receive HSTS header
-ashlane-cottages.com: could not connect to host
-ashleakunowski.com: could not connect to host
-ashleyadum.com: could not connect to host
-ashleyashbee.com: could not connect to host
-ashleyfoley.photography: could not connect to host
-ashleymedway.com: could not connect to host
-asia-global-risk.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-asian-archi.com.tw: did not receive HSTS header
-asianbet77.co: did not receive HSTS header
-asianbet77.net: did not receive HSTS header
-asianfilmfestival.barcelona: did not receive HSTS header
-asianodor.com: could not connect to host
-asiesvenezuela.com: could not connect to host
-asirigbakaute.com: did not receive HSTS header
-asirviablog.com: could not connect to host
-asisee.co.il: could not connect to host
-asisee.photography: did not receive HSTS header
-ask.pe: could not connect to host
-askcaisse.com: did not receive HSTS header
-askfit.cz: did not receive HSTS header
-askmagicconch.com: could not connect to host
-askme24.de: could not connect to host
-asksatya.com: did not receive HSTS header
-askyourdentist.com: did not receive HSTS header
-aslinfinity.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-asm-x.com: could not connect to host
-asmik-armenie.com: did not receive HSTS header
-asmm.cc: did not receive HSTS header
-asmui.ga: could not connect to host
-asmui.ml: could not connect to host
-asoagroca.com: could not connect to host
-asociacionbienestarinmobiliariobogota.com: could not connect to host
-asoftwareco.com: did not receive HSTS header
-asoul.tw: could not connect to host
-aspatrimoine.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-aspectcontext.com: could not connect to host
-asphaltfruehling.de: could not connect to host
-asral7.com: could not connect to host
-ass.org.au: could not connect to host
-assadrivesloirecher.com: could not connect to host
-assdecoeur.org: could not connect to host
-assekuranzjobs.de: could not connect to host
-asset-alive.com: could not connect to host
-asset-alive.net: could not connect to host
-assetsupervision.com: did not receive HSTS header
-assetvault.co.za: did not receive HSTS header
-assindia.nl: did not receive HSTS header
-assinecontrole4g.com.br: did not receive HSTS header
-assistance-personnes-agees.ch: could not connect to host
-assistcart.com: did not receive HSTS header
-assistenzaferrodastiro.org: could not connect to host
-assistenzafrigorifero.org: could not connect to host
-assistenzalavatrice.org: could not connect to host
-assistenzamicroonde.org: could not connect to host
-assosfi.com: could not connect to host
-assurancesmons.be: did not receive HSTS header
-astarforu.com: could not connect to host
-astenretail.com: could not connect to host
-asthon.cn: could not connect to host
-astraalivankila.net: could not connect to host
-astral-imperium.uk: did not receive HSTS header
-astral.gq: could not connect to host
-astral.org.pl: could not connect to host
-astrath.net: could not connect to host
-astrea-voetbal-groningen.nl: could not connect to host
-astrolpost.com: could not connect to host
-astromelody.com: did not receive HSTS header
-astronomie-fulda.de: did not receive HSTS header
-astropaykasa.org: could not connect to host
-astrosnail.pt.eu.org: could not connect to host
-astutr.co: could not connect to host
-asucrews.com: could not connect to host
-asuhe.cc: did not receive HSTS header
-asuhe.win: did not receive HSTS header
-asuhe.xyz: could not connect to host
-asuka.io: did not receive HSTS header
-asurgiant.ca: could not connect to host
-async.be: did not receive HSTS header
-at-one.ca: did not receive HSTS header
-at1.co: did not receive HSTS header
-atacadooptico.com.br: did not receive HSTS header
-atavio.at: could not connect to host
-atavio.ch: could not connect to host
-atavio.de: could not connect to host
-atbeckett.com: did not receive HSTS header
-atc.io: did not receive HSTS header
-atcreform.gov: could not connect to host
-atelier-origami.com: did not receive HSTS header
-atelier-rk.com: did not receive HSTS header
-atelier-viennois-cannes.fr: could not connect to host
-atelierhupsakee.nl: did not receive HSTS header
-ateliernihongo.ch: did not receive HSTS header
-ateliers-veronese-nantes.fr: did not receive HSTS header
-atelierssud.swiss: could not connect to host
-atendimentodelta.com.br: did not receive HSTS header
-atg.soy: could not connect to host
-atgroup.gr: did not receive HSTS header
-athaliasoft.com: could not connect to host
-athena-bartholdi.com: did not receive HSTS header
-athenacle.xyz: could not connect to host
-athenelive.com: could not connect to host
-athens-limousines.com: did not receive HSTS header
-athensbusinessresources.us: could not connect to host
-atheoryofchange.com: could not connect to host
-atherosense.ga: could not connect to host
-athi.pl: did not receive HSTS header
-athul.xyz: could not connect to host
-atisystem.com: did not receive HSTS header
-atk.me: could not connect to host
-atkdesign.pt: did not receive HSTS header
-atlantahairsurgeon.com: did not receive HSTS header
-atlas-5.site: could not connect to host
-atlas-staging.ml: could not connect to host
-atlas.co: did not receive HSTS header
-atlassian.io: could not connect to host
-atlassian.net: did not receive HSTS header
-atlayo.com: did not receive HSTS header
-atlex.nl: did not receive HSTS header
-atlseccon.com: did not receive HSTS header
-atmocdn.com: could not connect to host
-atmschambly.com: did not receive HSTS header
-atombase.org: could not connect to host
-atomic-bounce.com: could not connect to host
-atomic.menu: could not connect to host
-atomic.red: could not connect to host
-atomik.pro: did not receive HSTS header
-atomnetworks.ca: max-age too low: 2592000
-atop.io: could not connect to host
-atracaosexshop.com.br: could not connect to host
-atspeeds.com: could not connect to host
-attelage.net: did not receive HSTS header
-attentigroup.com: did not receive HSTS header
-attic118.com: did not receive HSTS header
-attimec.com: could not connect to host
-attimidesigns.com: did not receive HSTS header
-attiremr.tk: could not connect to host
-attogproductions.com: could not connect to host
-attractieparken.tk: could not connect to host
-au-be.net: could not connect to host
-au-pair24.de: did not receive HSTS header
-au.ci: could not connect to host
-au.search.yahoo.com: max-age too low: 172800
-au2pb.net: could not connect to host
-aubiosales.com: could not connect to host
-auburn-housekeeper.com: could not connect to host
-aucubin.moe: could not connect to host
-audialbuquerqueparts.com: did not receive HSTS header
-audiblox.co.za: did not receive HSTS header
-audion.cc: could not connect to host
-audion.hr: did not receive HSTS header
-audioonly.stream: could not connect to host
-audiovisualdevices.com.au: did not receive HSTS header
-auditready.nl: did not receive HSTS header
-audividi.shop: could not connect to host
-aufmerksamkeitsstudie.com: could not connect to host
-aufprise.de: did not receive HSTS header
-augaware.org: did not receive HSTS header
-augias.org: could not connect to host
-augix.net: could not connect to host
-augmented-portal.com: did not receive HSTS header
-augrandinquisiteur.com: did not receive HSTS header
-august.black: did not receive HSTS header
-aujapan.ru: could not connect to host
-aulaschrank.gq: could not connect to host
-auntieme.com: did not receive HSTS header
-aupasdecourses.com: did not receive HSTS header
-aur.rocks: could not connect to host
-aurainfosec.com: did not receive HSTS header
-aurainfosec.com.au: did not receive HSTS header
-auraredeye.com: could not connect to host
-auraredshield.com: could not connect to host
-aureus.pw: could not connect to host
-auri.ga: did not receive HSTS header
-aurora-multimedia.co.uk: did not receive HSTS header
-aurora-terraria.org: could not connect to host
-aurorarecordings.com: could not connect to host
-auroratownshipfd.org: did not receive HSTS header
-aurosa.cz: did not receive HSTS header
-auroz.tech: did not receive HSTS header
-auroz.video: did not receive HSTS header
-aurugs.com: did not receive HSTS header
-auslandsjahr-usa.de: max-age too low: 172800
-ausmwoid.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-ausnah.me: could not connect to host
-aussiecable.org: could not connect to host
-aussiegreenmarks.com.au: did not receive HSTS header
-aussiehq.com.au: could not connect to host
-aussiewebmarketing.com.au: did not receive HSTS header
-austinmobilemechanics.net: did not receive HSTS header
-austinstore.com.br: could not connect to host
-austinsutphin.com: could not connect to host
-austintxlocksmiths.com: did not receive HSTS header
-australianarmedforces.org: did not receive HSTS header
-australiancattle.dog: could not connect to host
-australianfreebets.com.au: did not receive HSTS header
-australianonlineappliances.ga: could not connect to host
-authenitech.com: could not connect to host
-authentication.io: could not connect to host
-authint.com: could not connect to host
-author24.ru: did not receive HSTS header
-authoritynutrition.com: did not receive HSTS header
-authorsguild.in: could not connect to host
-authsrv.nl.eu.org: could not connect to host
-auto-serwis.zgorzelec.pl: could not connect to host
-auto-spurgo.com: did not receive HSTS header
-auto.nl: did not receive HSTS header
-auto3d.cn: could not connect to host
-auto4trade.nl: did not receive HSTS header
-autobahnco.com: did not receive HSTS header
-autobedarf.net: did not receive HSTS header
-autobedrijfschalkoort.nl: did not receive HSTS header
-autocarparts.ro: could not connect to host
-autoclean-plus.ch: did not receive HSTS header
-autocmall.com: did not receive HSTS header
-autocobot.com: did not receive HSTS header
-autodemolizioni.roma.it: could not connect to host
-autodeploy.it: could not connect to host
-autodidacticstudios.org: could not connect to host
-autodilyhulin.cz: did not receive HSTS header
-autoecolebudget.ch: did not receive HSTS header
-autoecoledumontblanc.com: could not connect to host
-autoeet.cz: did not receive HSTS header
-autoepc.ro: could not connect to host
-autogestioninmobiliaria.com: did not receive HSTS header
-autohaus-snater.de: did not receive HSTS header
-autoinsurancehavasu.com: could not connect to host
-autojuhos.sk: could not connect to host
-automaan.nl: did not receive HSTS header
-automationsmarthome.com: could not connect to host
-automobiles5.com: could not connect to host
-automoto-tom.net: could not connect to host
-autopower.gr: did not receive HSTS header
-autoprogconsortium.ga: could not connect to host
-autoresponder.marketing: did not receive HSTS header
-autos-retro-plaisir.com: did not receive HSTS header
-autosearch.me: could not connect to host
-autosecurityfinance.com: could not connect to host
-autosiero.nl: did not receive HSTS header
-autostock.me: could not connect to host
-autostop-occasions.be: could not connect to host
-autostramites.com: did not receive HSTS header
-autotrac.com.br: did not receive HSTS header
-autotsum.com: could not connect to host
-autoxy.it: did not receive HSTS header
-autozane.com: could not connect to host
-autozet.cz: did not receive HSTS header
-autumnwindsagility.com: could not connect to host
-auux.com: max-age too low: 2592000
-auverbox.ovh: could not connect to host
-auvernet.org: could not connect to host
-auvious.com: did not receive HSTS header
-auxetek.se: could not connect to host
-auxiliumincrementum.co.uk: could not connect to host
-av-systems.net: did not receive HSTS header
-av.de: did not receive HSTS header
-av0ndale.de: could not connect to host
-av163.cc: could not connect to host
-avadatravel.com: did not receive HSTS header
-avalon-studios.de: could not connect to host
-avalyuan.me: did not receive HSTS header
-avanet.ch: did not receive HSTS header
-avantmfg.com: did not receive HSTS header
-avaq.fr: did not receive HSTS header
-avastantivirus.ro: did not receive HSTS header
-avatarrecruit.co.uk: did not receive HSTS header
-avdagic.net: did not receive HSTS header
-avdelivers.com: did not receive HSTS header
-avdh.top: could not connect to host
-avec-ou-sans-ordonnance.fr: could not connect to host
-aveling-adventure.co.uk: could not connect to host
-avenueeyecare.com: did not receive HSTS header
-avi9526.pp.ua: could not connect to host
-aviacao.pt: did not receive HSTS header
-aviapoisk.kz: did not receive HSTS header
-avid.blue: did not receive HSTS header
-avidthink.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-avietech.com: did not receive HSTS header
-aviodeals.com: did not receive HSTS header
-avitres.com: could not connect to host
-aviv.nyc: could not connect to host
-avmemo.com: could not connect to host
-avmo.pw: could not connect to host
-avnavi.jp: did not receive HSTS header
-avocadooo.stream: could not connect to host
-avocatbeziau.com: could not connect to host
-avocats-fiscal.fr: did not receive HSTS header
-avonlearningcampus.com: could not connect to host
-avotoma.com: could not connect to host
-avs-building-services.co.uk: did not receive HSTS header
-avselectrical.co.uk: did not receive HSTS header
-avso.pw: could not connect to host
-avspot.net: could not connect to host
-avtek.pl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-avto-signal.gq: could not connect to host
-avtoucheba.tk: could not connect to host
-avtoveles.by: could not connect to host
-avtoyurist.tk: could not connect to host
-avus-automobile.com: did not receive HSTS header
-avxo.pw: could not connect to host
-awan.tech: could not connect to host
-awanderlustadventure.com: did not receive HSTS header
-awccanadianpharmacy.com: did not receive HSTS header
-awecademy.org: did not receive HSTS header
-awei.pub: could not connect to host
-awen.me: could not connect to host
-awesome-coconut-software.fr: could not connect to host
-awesomesit.es: could not connect to host
-awf0.xyz: could not connect to host
-awg-mode.de: did not receive HSTS header
-awin.la: could not connect to host
-awomaninherprime.com: did not receive HSTS header
-aww.moe: did not receive HSTS header
-awxg.eu.org: could not connect to host
-awxg.org: could not connect to host
-axa-middleeast.com: did not receive HSTS header
-axado.com.br: could not connect to host
-axchap.ir: could not connect to host
-axel-fischer.science: could not connect to host
-axelchv.fr: could not connect to host
-axem.co.jp: did not receive HSTS header
-axeny.com: did not receive HSTS header
-axg.io: did not receive HSTS header
-axialsports.com: did not receive HSTS header
-axiatancell.com: could not connect to host
-axiomer.es: did not receive HSTS header
-axiomer.eu: did not receive HSTS header
-axiomer.me: did not receive HSTS header
-axiomer.net: did not receive HSTS header
-axiomer.org: did not receive HSTS header
-axis-stralis.co.uk: could not connect to host
-axisfleetmanagement.co.uk: could not connect to host
-axiumacademy.com: did not receive HSTS header
-axka.com: could not connect to host
-axolsoft.com: max-age too low: 10540800
-axom.online: did not receive HSTS header
-axtudo.com: did not receive HSTS header
-axtux.tk: could not connect to host
-axxial.tk: could not connect to host
-ayahuascaadvisor.com: could not connect to host
-ayamchikchik.com: could not connect to host
-ayatk.com: did not receive HSTS header
-ayesh.win: could not connect to host
-aying.love: did not receive HSTS header
-ayj.solutions: could not connect to host
-ayon.group: could not connect to host
-ayor.jp: could not connect to host
-ayor.tech: could not connect to host
-ayrohq.com: could not connect to host
-ayuru.info: could not connect to host
-az-vinyl-boden.de: could not connect to host
-az11018.com: could not connect to host
-azamra.com: did not receive HSTS header
-azane.ga: could not connect to host
-azenot.com: did not receive HSTS header
-azgfd.com: did not receive HSTS header
-azia.info: could not connect to host
-azino777.ru: could not connect to host
-azirevpn.com: did not receive HSTS header
-azizfirat.com: did not receive HSTS header
-azlo.com: did not receive HSTS header
-azmusica.biz: could not connect to host
-azmusica.com: could not connect to host
-aznaetelivy.ru: did not receive HSTS header
-azprep.us: could not connect to host
-azrangers.gov: did not receive HSTS header
-azu-l.com: could not connect to host
-azu-l.jp: could not connect to host
-azun.pl: did not receive HSTS header
-azurlane.cool: could not connect to host
-azzag.co.uk: could not connect to host
-b-boom.nl: could not connect to host
-b-dd.com: could not connect to host
-b-entropy.com: could not connect to host
-b-f-s.pl: did not receive HSTS header
-b-freerobux.ga: could not connect to host
-b-landia.net: did not receive HSTS header
-b-rickroll-e.pw: could not connect to host
-b-space.de: did not receive HSTS header
-b-ticket.ch: could not connect to host
-b0308.com: could not connect to host
-b1.work: did not receive HSTS header
-b1236.com: could not connect to host
-b1758.com: did not receive HSTS header
-b1rd.tk: could not connect to host
-b2222.co: did not receive HSTS header
-b2and.com: did not receive HSTS header
-b2b-nestle.com.br: could not connect to host
-b2bpromoteit.com: did not receive HSTS header
-b2families.com.au: did not receive HSTS header
-b30365.com: did not receive HSTS header
-b3333.co: could not connect to host
-b36512.com: could not connect to host
-b3orion.com: could not connect to host
-b422edu.com: could not connect to host
-b4r7.de: could not connect to host
-b5197.co: could not connect to host
-b5289.net: did not receive HSTS header
-b5909.com: could not connect to host
-b5989.com: did not receive HSTS header
-b61688.com: could not connect to host
-b62101.com: could not connect to host
-b62102.com: could not connect to host
-b62103.com: could not connect to host
-b62104.com: could not connect to host
-b62105.com: could not connect to host
-b62a.com: did not receive HSTS header
-b62aa.com: did not receive HSTS header
-b62b.com: could not connect to host
-b62bb.com: did not receive HSTS header
-b62c.com: could not connect to host
-b62cc.com: could not connect to host
-b62d.com: did not receive HSTS header
-b62dd.com: could not connect to host
-b62e.com: did not receive HSTS header
-b62ee.com: did not receive HSTS header
-b62f.com: could not connect to host
-b62g.com: could not connect to host
-b62h.com: could not connect to host
-b64.club: could not connect to host
-b6710.com: could not connect to host
-b6720.com: could not connect to host
-b6729.co: could not connect to host
-b6730.com: did not receive HSTS header
-b6740.com: could not connect to host
-b67772.com: could not connect to host
-b67773.com: did not receive HSTS header
-b67774.com: could not connect to host
-b67775.com: did not receive HSTS header
-b67801.com: could not connect to host
-b67802.com: could not connect to host
-b67803.com: could not connect to host
-b67804.com: could not connect to host
-b67805.com: could not connect to host
-b6957.co: could not connect to host
-b70661.com: could not connect to host
-b70663.com: could not connect to host
-b70664.com: could not connect to host
-b830.com: did not receive HSTS header
-b899365.com: did not receive HSTS header
-b89aa.com: could not connect to host
-b91688.com: could not connect to host
-b9297.co: could not connect to host
-b9453.com: did not receive HSTS header
-b9498.com: did not receive HSTS header
-b9528.net: did not receive HSTS header
-b9568.com: could not connect to host
-b9586.net: could not connect to host
-b9588.net: could not connect to host
-b95888.net: could not connect to host
-b9589.net: could not connect to host
-b9598.com: did not receive HSTS header
-b9658.com: did not receive HSTS header
-b96899.com: could not connect to host
-b9728.co: could not connect to host
-b9883.net: could not connect to host
-b9884.net: could not connect to host
-b9885.net: could not connect to host
-b9886.com: could not connect to host
-b9886.net: could not connect to host
-b9887.net: could not connect to host
-b9888.net: could not connect to host
-b98886.com: could not connect to host
-b9889.net: could not connect to host
-b9902.com: could not connect to host
-b99033.com: did not receive HSTS header
-b9904.com: could not connect to host
-b99044.com: did not receive HSTS header
-b9905.com: did not receive HSTS header
-b99055.com: did not receive HSTS header
-b99066.com: could not connect to host
-b99077.com: could not connect to host
-b99088.com: did not receive HSTS header
-b99099.com: could not connect to host
-b9912.com: did not receive HSTS header
-b9930.com: could not connect to host
-b9951.com: could not connect to host
-b99520.com: could not connect to host
-b9954.com: did not receive HSTS header
-b9957.com: could not connect to host
-b9961.com: did not receive HSTS header
-b9962.com: did not receive HSTS header
-b9967.com: could not connect to host
-b9970.com: could not connect to host
-b9973.com: did not receive HSTS header
-b9976.com: did not receive HSTS header
-b9980.com: could not connect to host
-b99881.com: could not connect to host
-b99882.com: could not connect to host
-b99883.com: could not connect to host
-b99885.com: could not connect to host
-b99886.com: could not connect to host
-b9999oo.com: could not connect to host
-b9999tt.com: could not connect to host
-b9999uu.com: did not receive HSTS header
-b9999vv.com: did not receive HSTS header
-b9999yy.com: did not receive HSTS header
-b9winner.com: could not connect to host
-babarkata.com: could not connect to host
-babelfisch.eu: could not connect to host
-babineaux.zone: could not connect to host
-bablodel.biz: could not connect to host
-bablodel.com: could not connect to host
-babursahvizeofisi.com: could not connect to host
-baby-click.de: could not connect to host
-baby-fotografie-muenchen.de: did not receive HSTS header
-baby-lux.com.ua: could not connect to host
-baby-massage.tk: could not connect to host
-babybauch-shooting-muenchen.de: did not receive HSTS header
-babybee.ie: could not connect to host
-babybic.hu: could not connect to host
-babyboutique.online: did not receive HSTS header
-babycs.house: could not connect to host
-babyhouse.xyz: could not connect to host
-babyliss-pro.com: could not connect to host
-babyliss-pro.net: did not receive HSTS header
-babysaying.me: could not connect to host
-babyshoprimini.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-babystep.tv: did not receive HSTS header
-bacchanallia.com: could not connect to host
-bacgrouppublishing.com: could not connect to host
-bachkhoa.net.vn: did not receive HSTS header
-bacimg.com: could not connect to host
-back-bone.nl: did not receive HSTS header
-backenmachtgluecklich.de: max-age too low: 0
-backgroundz.net: could not connect to host
-backintomotionphysiotherapy.com: did not receive HSTS header
-backlogapp.io: could not connect to host
-backpacken.org: could not connect to host
-backupsinop.com.br: did not receive HSTS header
-backyardbbqbash.com: could not connect to host
-baconate.com: did not receive HSTS header
-bacoux.com: could not connect to host
-bacsituvansuckhoe.com: did not receive HSTS header
-bactrim.gq: could not connect to host
-bad-wurzach.de: did not receive HSTS header
-bad.horse: could not connect to host
-bad.show: could not connect to host
-badai.at: could not connect to host
-badbee.cc: could not connect to host
-badboyzclub.de: could not connect to host
-badcronjob.com: could not connect to host
-badenhard.eu: could not connect to host
-badgesenpatches.nl: did not receive HSTS header
-badgr.com: did not receive HSTS header
-badkamergigant.com: could not connect to host
-badlink.org: could not connect to host
-baese.it: did not receive HSTS header
-baff.lu: could not connect to host
-baffinlee.com: did not receive HSTS header
-bagelsbakery.com: could not connect to host
-bagiobella.com: max-age too low: 0
-bagni-chimici.roma.it: could not connect to host
-bagnichimici.milano.it: could not connect to host
-bagstage.de: did not receive HSTS header
-bahadirh.ml: could not connect to host
-baidu389.com: max-age too low: 0
-baiduaccount.com: could not connect to host
-baiduo.com: could not connect to host
-bailakomigo.com.br: did not receive HSTS header
-baildonhottubs.co.uk: could not connect to host
-bair.io: could not connect to host
-bairdzhang.com: did not receive HSTS header
-bairrosonline.com: did not receive HSTS header
-bairuo.tk: could not connect to host
-bairuo.top: could not connect to host
-baito-j.jp: did not receive HSTS header
-baitulongbaycruises.com: could not connect to host
-baiurl.tk: could not connect to host
-baixoutudo.com: did not receive HSTS header
-baiyangliu.com: could not connect to host
-bajajfinserv.in: did not receive HSTS header
-bajic.ch: could not connect to host
-baka.network: could not connect to host
-baka.red: could not connect to host
-bakabt.info: could not connect to host
-bakanin.ru: could not connect to host
-bakaproxy.moe: could not connect to host
-bakaweb.fr: could not connect to host
-bakim.li: could not connect to host
-bakkerdesignandbuild.com: did not receive HSTS header
-bakxnet.com: could not connect to host
-balakovo-news.tk: could not connect to host
-balcan-underground.net: could not connect to host
-baldur.cc: did not receive HSTS header
-baldwin.com.au: did not receive HSTS header
-baldwinkoo.com: could not connect to host
-baleares.party: could not connect to host
-balenciaspa.com: did not receive HSTS header
-balidesignshop.com.br: could not connect to host
-balihai.com: did not receive HSTS header
-balkenbushmechanical.com: could not connect to host
-ball.holdings: did not receive HSTS header
-ballbusting-cbt.com: could not connect to host
-ballinarsl.com.au: did not receive HSTS header
-ballitolocksmith.com: could not connect to host
-balloonphp.com: could not connect to host
-balnearionaturaspa.com: did not receive HSTS header
-baloncestolliria.tk: could not connect to host
-balonmano.co: could not connect to host
-bals.org: did not receive HSTS header
-bamtoki.se: could not connect to host
-bananavapes.com: could not connect to host
-bananensap.nl: did not receive HSTS header
-bananium.fr: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-banbanchs.com: could not connect to host
-banburybid.com: did not receive HSTS header
-bancaolhares.com.br: could not connect to host
-banchethai.com: could not connect to host
-bandally.net: could not connect to host
-bandar303.cc: did not receive HSTS header
-bandar303.id: did not receive HSTS header
-bandar303.win: did not receive HSTS header
-bandarifamily.com: could not connect to host
-bandb.xyz: did not receive HSTS header
-banderasdelmundo.xyz: could not connect to host
-bandgap.io: did not receive HSTS header
-bandolino-bewind.nl: could not connect to host
-bandolino.nl: could not connect to host
-bandrcrafts.com: could not connect to host
-banduhn.com: did not receive HSTS header
-banfor.fun: did not receive HSTS header
-bangridho.com: did not receive HSTS header
-bangzafran.com: could not connect to host
-bani99.com: did not receive HSTS header
-bank: could not connect to host
-bank-tour.ru: did not receive HSTS header
-bankerbuch.de: did not receive HSTS header
-bankerscaddy.com: did not receive HSTS header
-bankersonline.com: did not receive HSTS header
-bankfreeoffers.com: could not connect to host
-bankgradesecurity.com: could not connect to host
-bankitt.network: could not connect to host
-bankmilhas.com.br: did not receive HSTS header
-bankofrealty.review: could not connect to host
-banland.net: could not connect to host
-banningca.gov: did not receive HSTS header
-bannisbierblog.de: could not connect to host
-banoviny.sk: did not receive HSTS header
-banqingdiao.com: did not receive HSTS header
-banri.me: could not connect to host
-banter.city: could not connect to host
-banxehoi.com: did not receive HSTS header
-baobeiglass.com: did not receive HSTS header
-baodan666.com: could not connect to host
-baosuckhoedoisong.net: could not connect to host
-baoxue1.com: did not receive HSTS header
-baoxue2.com: did not receive HSTS header
-baoxue3.com: did not receive HSTS header
-baoxue5.com: did not receive HSTS header
-baoxue6.com: did not receive HSTS header
-baoxue7.com: did not receive HSTS header
-baoxue8.com: did not receive HSTS header
-baoxue9.com: did not receive HSTS header
-baptistboard.com: did not receive HSTS header
-baptiste-destombes.fr: did not receive HSTS header
-baptistedeleris.fr: could not connect to host
-bara1.se: did not receive HSTS header
-baranhotel.ir: did not receive HSTS header
-baranmovie.tk: could not connect to host
-barashek.ru: did not receive HSTS header
-barberlegalcounsel.com: did not receive HSTS header
-barbershop-harmony.org: did not receive HSTS header
-barbershop-lasvillas.com: did not receive HSTS header
-barcodeberlin.com: did not receive HSTS header
-barcouniforms.com: did not receive HSTS header
-barely.sexy: could not connect to host
-barf-alarm.de: did not receive HSTS header
-bargainmovingcompany.com: did not receive HSTS header
-bargainsettelement.com: could not connect to host
-bariller.fr: did not receive HSTS header
-baripedia.org: could not connect to host
-baris-sagdic.com: could not connect to host
-bariskaragoz.nl: could not connect to host
-bariumoxide.com: could not connect to host
-barlex.pl: did not receive HSTS header
-barnabycolby.io: could not connect to host
-barnrats.com: could not connect to host
-baropkamp.be: did not receive HSTS header
-barprive.com: could not connect to host
-barracuda.blog: could not connect to host
-barrelhead.org: could not connect to host
-barrett.ag: did not receive HSTS header
-barrut.me: did not receive HSTS header
-barryswebdesign.co.uk: did not receive HSTS header
-barshout.co.uk: could not connect to host
-barsil.de: did not receive HSTS header
-barslecht.com: could not connect to host
-barslecht.nl: did not receive HSTS header
-barss.io: could not connect to host
-barsukas.net: could not connect to host
-bartel.ws: could not connect to host
-bartelldrugs.com: did not receive HSTS header
-barthonia-showroom.de: did not receive HSTS header
-barunisystems.com: could not connect to host
-barwave.com: could not connect to host
-basculasconfiables.com: could not connect to host
-basebyte.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-basechat.com: did not receive HSTS header
-basedonline.nl: did not receive HSTS header
-baseline.ba: did not receive HSTS header
-basementdoctor.com: did not receive HSTS header
-basercap.co.ke: did not receive HSTS header
-bashc.at: could not connect to host
-bashcode.ninja: could not connect to host
-basicsolutionsus.com: could not connect to host
-basilicaknights.org: could not connect to host
-basilisk.io: could not connect to host
-basilm.co: could not connect to host
-basketball-malavan.tk: could not connect to host
-basketsbymaurice.com: did not receive HSTS header
-baskettemple.com: did not receive HSTS header
-basnieuwenhuizen.nl: did not receive HSTS header
-bassh.net: could not connect to host
-bastadigital.com: did not receive HSTS header
-bastianstalder.ch: did not receive HSTS header
-bastiv.com: could not connect to host
-bastivmobile.com: could not connect to host
-batfoundry.com: did not receive HSTS header
-batonger.com: could not connect to host
-batschu.de: could not connect to host
-batten.eu.org: could not connect to host
-batteryservice.ru: did not receive HSTS header
-baud.ninja: could not connect to host
-baudairenergyservices.com: did not receive HSTS header
-baudlink.com: could not connect to host
-bauen-mit-ziegel.de: max-age too low: 604800
-baum.ga: could not connect to host
-baumstark.ca: could not connect to host
-baustils.com: did not receive HSTS header
-bauwens.cloud: did not receive HSTS header
-bavomaes.be: did not receive HSTS header
-bayer-stefan.eu: did not receive HSTS header
-baykatre.com: did not receive HSTS header
-bayportzambia.com: did not receive HSTS header
-bayrisch-fuer-anfaenger.de: could not connect to host
-baysse.eu: did not receive HSTS header
-bazar-24.ru: did not receive HSTS header
-bazar.ga: could not connect to host
-bazarstupava.sk: could not connect to host
-bazdell.com: did not receive HSTS header
-bazisszoftver.hu: could not connect to host
-bazqux.com: did not receive HSTS header
-bb-shiokaze.jp: did not receive HSTS header
-bb00228.com: could not connect to host
-bb1718.net: could not connect to host
-bb37roma.it: could not connect to host
-bb5197.co: could not connect to host
-bb6729.co: could not connect to host
-bb6729.com: did not receive HSTS header
-bb6957.co: could not connect to host
-bb9297.co: could not connect to host
-bb9721.com: could not connect to host
-bb9728.co: could not connect to host
-bbb1991.me: could not connect to host
-bbdos.ru: could not connect to host
-bbj.io: did not receive HSTS header
-bbkaforum.co.uk: did not receive HSTS header
-bbkanews.com: did not receive HSTS header
-bblovess.cn: could not connect to host
-bbnbb.de: could not connect to host
-bbrinck.eu: could not connect to host
-bbswin9.com: could not connect to host
-bbw-wrestling.com: could not connect to host
-bbwdom.xyz: could not connect to host
-bbwf.de: did not receive HSTS header
-bbwfacesitting.us: could not connect to host
-bbwfacesitting.xyz: could not connect to host
-bbwfight.xyz: could not connect to host
-bbwteens.org: could not connect to host
-bc-personal.ch: could not connect to host
-bc-reloaded.net: did not receive HSTS header
-bcbsmagentprofile.com: could not connect to host
-bcchack.com: could not connect to host
-bccx.com: could not connect to host
-bcheng.cf: could not connect to host
-bck.me: did not receive HSTS header
-bckp.de: could not connect to host
-bcm.com.au: did not receive HSTS header
-bcmlu.org: could not connect to host
-bcnet.com.hk: could not connect to host
-bcnet.hk: could not connect to host
-bcodeur.com: could not connect to host
-bcpc-ccgpfcheminots.com: could not connect to host
-bcradio.org: could not connect to host
-bcs.adv.br: did not receive HSTS header
-bcsytv.com: could not connect to host
-bcubic.net: could not connect to host
-bcvps.com: could not connect to host
-bcweightlifting.ca: did not receive HSTS header
-bdata.cl: could not connect to host
-bddemir.com: could not connect to host
-bde-epitech.fr: could not connect to host
-bdenzer.com: did not receive HSTS header
-bdenzer.xyz: could not connect to host
-bdpachicago.tech: could not connect to host
-bdsmxxxpics.com: could not connect to host
-bdupnews.com: could not connect to host
-be9418.info: could not connect to host
-be9418.org: could not connect to host
-be9458.info: did not receive HSTS header
-be9458.net: did not receive HSTS header
-be9458.org: did not receive HSTS header
-be958.info: could not connect to host
-be958.org: could not connect to host
-be9966.com: could not connect to host
-bea.expert: could not connect to host
-beach-inspector.com: did not receive HSTS header
-beachfutbolclub.com: did not receive HSTS header
-beachi.es: could not connect to host
-beacinsight.com: could not connect to host
-beaglewatch.com: did not receive HSTS header
-beagreenbean.co.uk: could not connect to host
-beaker.coffee: could not connect to host
-beamer-discount.de: did not receive HSTS header
-beamitapp.com: could not connect to host
-beamstat.com: could not connect to host
-beanbot.party: could not connect to host
-beanbox.com: did not receive HSTS header
-beanworks.ca: did not receive HSTS header
-bearcosports.com.br: did not receive HSTS header
-beardboys.co.za: did not receive HSTS header
-bearden.io: did not receive HSTS header
-beardydave.com: did not receive HSTS header
-beasel.biz: could not connect to host
-beastlog.tk: could not connect to host
-beastowner.com: did not receive HSTS header
-beatz-anime.tk: did not receive HSTS header
-beauty-hippie-schmuck.de: could not connect to host
-beauty-yan-enterprise.com: could not connect to host
-beautyby.tv: could not connect to host
-beautyconcept.co: did not receive HSTS header
-beautycreamultimate.com: did not receive HSTS header
-beautyspot.tk: could not connect to host
-beavers.io: could not connect to host
-bebeautiful.business: could not connect to host
-bebeefy.uk: could not connect to host
-bebesurdoue.com: could not connect to host
-bebetrotteur.com: could not connect to host
-bebout.domains: could not connect to host
-bebout.pw: could not connect to host
-beccajoshwedding.com: could not connect to host
-becklove.cn: could not connect to host
-beckon.com: did not receive HSTS header
-becoast.fr: did not receive HSTS header
-becubed.co: could not connect to host
-bedabox.com: did not receive HSTS header
-bedeta.de: could not connect to host
-bedfordnissanparts.com: could not connect to host
-bedlingtonterrier.com.br: could not connect to host
-bedouille.com: could not connect to host
-bedreid.dk: did not receive HSTS header
-bedrijfsfotoreportages.nl: could not connect to host
-bedrijfshulpverleningfriesland.nl: did not receive HSTS header
-bedrijfsportaal.nl: did not receive HSTS header
-bedrijvenadministratie.nl: could not connect to host
-bee-social.it: did not receive HSTS header
-bee.clothing: could not connect to host
-bee.supply: could not connect to host
-bee.tools: could not connect to host
-beebeads.ga: could not connect to host
-beechwoodmetalworks.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-beekbier.nl: could not connect to host
-beekeeper.blog: could not connect to host
-beekeeper.clothing: could not connect to host
-beekeeper.supplies: could not connect to host
-beekeeper.supply: could not connect to host
-beekeeper.tools: could not connect to host
-beekeeping.clothing: could not connect to host
-beekeeping.tools: could not connect to host
-beerboutique.com.br: could not connect to host
-beermedlar.com: could not connect to host
-beerradar.no: could not connect to host
-beerradar.party: could not connect to host
-beersandco.ch: could not connect to host
-beerview.ga: could not connect to host
-beetgroup.id: could not connect to host
-beetleroadstories.com: could not connect to host
-befundup.com: could not connect to host
-bega-dc.gov: could not connect to host
-begcykel.com: did not receive HSTS header
-beginatzero.com: did not receive HSTS header
-begravningsbyranhumana.se: did not receive HSTS header
-behemot.cz: did not receive HSTS header
-behere.be: could not connect to host
-behindthethrills.com: did not receive HSTS header
-beholdthehurricane.com: could not connect to host
-beier.io: could not connect to host
-beikeil.de: did not receive HSTS header
-beingmad.org: did not receive HSTS header
-beizsley.com: did not receive HSTS header
-beizsoft.co.uk: did not receive HSTS header
-beizsoft.com: did not receive HSTS header
-bekchy.com: did not receive HSTS header
-belairsewvac.com: could not connect to host
-belastingdienst-in-beeld.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-belcompany.nl: could not connect to host
-belewpictures.com: could not connect to host
-belgien.guide: could not connect to host
-belize-firmengruendung.com: could not connect to host
-bellamy.cloud: could not connect to host
-bellavistaoutdoor.com: could not connect to host
-belle-lingerie.co.uk: did not receive HSTS header
-bellecarmen.tk: could not connect to host
-belliash.eu.org: did not receive HSTS header
-bellmangesellschaft.de: did not receive HSTS header
-bellthrogh.com: could not connect to host
-bellthrough.com: did not receive HSTS header
-belltower.io: could not connect to host
-belmarresort.com: did not receive HSTS header
-belmontprom.com: could not connect to host
-belpbleibtbelp.ch: could not connect to host
-belplombier.com: did not receive HSTS header
-belroyale.com: did not receive HSTS header
-belt.black: could not connect to host
-belua.com: did not receive HSTS header
-belwederczykow.eu: could not connect to host
-bely-mishka.by: max-age too low: 0
-belyoung.com.br: did not receive HSTS header
-belyvly.com: did not receive HSTS header
-bemvindoaolar.com.br: could not connect to host
-bemyvictim.com: max-age too low: 2678400
-ben-jarvis.co.uk: did not receive HSTS header
-ben-stock.de: did not receive HSTS header
-ben.ninja: could not connect to host
-benandsarah.life: did not receive HSTS header
-benburwell.com: did not receive HSTS header
-benchcast.com: could not connect to host
-bendechrai.com: did not receive HSTS header
-bendigoland.com.au: could not connect to host
-benedikt-tuchen.de: could not connect to host
-benediktdichgans.de: did not receive HSTS header
-beneffy.com: did not receive HSTS header
-benefitsbookcase.com: could not connect to host
-benevisim.com: could not connect to host
-benevita.bio: could not connect to host
-benevita.life: could not connect to host
-benevita.live: could not connect to host
-benevita.organic: could not connect to host
-benfairclough.com: could not connect to host
-bengaldarpan.com: could not connect to host
-benhchuyenkhoa.net: could not connect to host
-benjakesjohnson.com: could not connect to host
-benjamin-horvath.com: could not connect to host
-benjamin-suess.de: could not connect to host
-benjaminbedard.com: could not connect to host
-benjaminesims.com: could not connect to host
-benjaminmarket.com.ar: did not receive HSTS header
-benjaminpiquet.fr: could not connect to host
-benk.press: could not connect to host
-benleemd.com: could not connect to host
-benmorecentre.co.uk: did not receive HSTS header
-bennink.me: could not connect to host
-benny003.de: could not connect to host
-bennythink.com: could not connect to host
-benohead.com: did not receive HSTS header
-bentphotos.se: could not connect to host
-benwattie.com: could not connect to host
-benzkosmetik.de: did not receive HSTS header
-benzou-space.com: could not connect to host
-beourvictim.com: max-age too low: 2678400
-bep.gov: did not receive HSTS header
-bep362.vn: could not connect to host
-bepenak.com: did not receive HSTS header
-beproduct.ru: did not receive HSTS header
-bepsvpt.me: did not receive HSTS header
-beraru.tk: could not connect to host
-berasavocate.com: could not connect to host
-berdaguermontes.eu: could not connect to host
-berduri.com: did not receive HSTS header
-beretech.fr: did not receive HSTS header
-berger.work: could not connect to host
-bergland-seefeld.at: did not receive HSTS header
-bergmann-fotografin-berlin.de: did not receive HSTS header
-bergmann-fotografin-dortmund.de: did not receive HSTS header
-bergmann-fotografin-duesseldorf.de: did not receive HSTS header
-bergmann-fotografin-essen.de: did not receive HSTS header
-bergmann-fotografin-frankfurt.de: did not receive HSTS header
-bergmann-fotografin-hamburg.de: did not receive HSTS header
-bergmann-fotografin-koeln.de: did not receive HSTS header
-bergmann-fotografin-muenchen.de: did not receive HSTS header
-bergmann-fotografin-stuttgart.de: did not receive HSTS header
-berhampore-gateway.tk: could not connect to host
-berlatih.com: did not receive HSTS header
-berliancom.com: did not receive HSTS header
-berlin-cuisine.com: did not receive HSTS header
-berlin-kohlefrei.de: did not receive HSTS header
-berlinleaks.com: could not connect to host
-bermos.net: could not connect to host
-berna.fr: could not connect to host
-bernama.com.my: could not connect to host
-bernardfischer.fr: did not receive HSTS header
-berodes.be: did not receive HSTS header
-berr.yt: could not connect to host
-berry.cat: could not connect to host
-berrymark.be: did not receive HSTS header
-berseb.se: could not connect to host
-berthelier.me: could not connect to host
-berz.one: could not connect to host
-besb.io: could not connect to host
-besb66.club: could not connect to host
-besb66.com: did not receive HSTS header
-besb66.me: could not connect to host
-besb66.ninja: could not connect to host
-besb66.rocks: could not connect to host
-besb66.us: could not connect to host
-beschriftung-metz.de: could not connect to host
-besixdouze.world: could not connect to host
-beslider.com: could not connect to host
-besola.de: could not connect to host
-bespaarenergie.click: could not connect to host
-bespaarnu.click: could not connect to host
-besser-beissen.de: could not connect to host
-bessettenotaire.com: did not receive HSTS header
-best-of-bounce.co.uk: could not connect to host
-best-wedding-quotes.com: could not connect to host
-bestattorney.com: did not receive HSTS header
-bestbeards.ca: could not connect to host
-bestbestbitcoin.com: could not connect to host
-bestbrakes.com: did not receive HSTS header
-bestbridal.top: did not receive HSTS header
-bestcellular.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-bestcomputersecuritybooks.com: did not receive HSTS header
-bestdoc.com.br: could not connect to host
-bestelectricnd.com: could not connect to host
-bestellipticalmachinereview.info: could not connect to host
-bestemailmarketingsoftware.org: could not connect to host
-bestesb.net: could not connect to host
-bestfitnesswatchreview.info: could not connect to host
-bestgifts4you.com: did not receive HSTS header
-besthost.cz: did not receive HSTS header
-besthotsales.com: could not connect to host
-bestiahosting.com: could not connect to host
-bestinductioncooktop.us: could not connect to host
-bestkeys.ga: could not connect to host
-bestladyshaver.co.uk: did not receive HSTS header
-bestlashesandbrows.com: did not receive HSTS header
-bestlashesandbrows.hu: did not receive HSTS header
-bestleftwild.com: could not connect to host
-bestlooperpedalsguide.com: did not receive HSTS header
-bestmattressforbackpain.online: did not receive HSTS header
-bestmodels.su: could not connect to host
-bestof1001.de: could not connect to host
-bestoffert.club: could not connect to host
-bestorangeseo.com: could not connect to host
-bestpaintings.nl: did not receive HSTS header
-bestpal.eu: did not receive HSTS header
-bestparking.xyz: could not connect to host
-bestperfumebrands.com: could not connect to host
-bestremote.io: could not connect to host
-bestschools.io: could not connect to host
-bestschools.top: did not receive HSTS header
-bestseries.tv: could not connect to host
-bestsgadgets.com: could not connect to host
-besuccessful.ch: did not receive HSTS header
-bet06vip.com: could not connect to host
-bet07vip.com: could not connect to host
-bet08vip.com: could not connect to host
-bet09vip.com: could not connect to host
-bet166111.com: did not receive HSTS header
-bet166222.com: could not connect to host
-bet166333.com: did not receive HSTS header
-bet166444.com: did not receive HSTS header
-bet166555.com: could not connect to host
-bet166777.com: could not connect to host
-bet166888.com: could not connect to host
-bet1668888.com: did not receive HSTS header
-bet166999.com: did not receive HSTS header
-bet166b.com: did not receive HSTS header
-bet166bbb.com: did not receive HSTS header
-bet166c.com: could not connect to host
-bet166ddd.com: could not connect to host
-bet166eee.com: did not receive HSTS header
-bet166fff.com: could not connect to host
-bet166hhh.com: could not connect to host
-bet166tt.com: could not connect to host
-bet166uu.com: did not receive HSTS header
-bet166ww.com: could not connect to host
-bet166xx.com: did not receive HSTS header
-bet166yy.com: could not connect to host
-bet333m.com: did not receive HSTS header
-bet33app.com: did not receive HSTS header
-bet365bc.net: did not receive HSTS header
-bet365g8.com: did not receive HSTS header
-bet365n1.com: did not receive HSTS header
-bet365n2.com: did not receive HSTS header
-bet365n6.com: did not receive HSTS header
-bet365n8.com: did not receive HSTS header
-bet365n9.com: did not receive HSTS header
-bet365q0.com: did not receive HSTS header
-bet365q6.com: did not receive HSTS header
-bet365q8.com: did not receive HSTS header
-bet365q9.com: did not receive HSTS header
-bet365r8.com: did not receive HSTS header
-bet365vip7.com: could not connect to host
-bet365x0.com: did not receive HSTS header
-bet365x1.com: did not receive HSTS header
-bet365x2.com: did not receive HSTS header
-bet365x3.com: did not receive HSTS header
-bet365x6.com: did not receive HSTS header
-bet365x8.com: did not receive HSTS header
-bet365x9.com: did not receive HSTS header
-bet909.com: could not connect to host
-bet990.com: could not connect to host
-betaa0.com: did not receive HSTS header
-betaa1.com: did not receive HSTS header
-betaa2.com: did not receive HSTS header
-betaa3.com: did not receive HSTS header
-betaa5.com: did not receive HSTS header
-betaa6.com: did not receive HSTS header
-betaa8.com: did not receive HSTS header
-betaa9.com: did not receive HSTS header
-betacavi.com: did not receive HSTS header
-betaclean.fr: did not receive HSTS header
-betacloud.io: did not receive HSTS header
-betafive.net: could not connect to host
-betakah.net: could not connect to host
-betalenviainternet.nl: did not receive HSTS header
-betamint.org: could not connect to host
-betcafearena.ro: could not connect to host
-betformular.com: could not connect to host
-betkoo.com: could not connect to host
-betleakbot.com: could not connect to host
-betnet.fr: could not connect to host
-betonmoney.com: did not receive HSTS header
-betplanning.it: did not receive HSTS header
-betrallyarabia.com: could not connect to host
-bets.de: did not receive HSTS header
-betsonlinefree.com.au: could not connect to host
-better.com: did not receive HSTS header
-betterbabyshop.com.au: could not connect to host
-betterhelp.com: did not receive HSTS header
-betterjapanese.blog: could not connect to host
-betterjapanese.com: did not receive HSTS header
-betterjapanese.org: could not connect to host
-betterjapanese.xyz: could not connect to host
-bettween.com: did not receive HSTS header
-between.be: did not receive HSTS header
-betxx1.com: did not receive HSTS header
-betxx2.com: did not receive HSTS header
-betz.ro: could not connect to host
-beulahtabernacle.com: could not connect to host
-beverly.tk: could not connect to host
-bevinsco.org: could not connect to host
-bewerbungsfoto-deinfoto.ch: could not connect to host
-bexit-hosting.nl: could not connect to host
-bexit-security.eu: could not connect to host
-bexit-security.nl: could not connect to host
-bexit.nl: could not connect to host
-bexithosting.nl: could not connect to host
-bey.io: could not connect to host
-beylikduzum.com: could not connect to host
-beylikduzuvaillant.com: could not connect to host
-beylkin.tk: could not connect to host
-beyond-edge.com: could not connect to host
-beyond-rational.com: could not connect to host
-beyondthecode.io: did not receive HSTS header
-beyondtrust.com: did not receive HSTS header
-beyuna.co.uk: did not receive HSTS header
-beyuna.eu: did not receive HSTS header
-beyuna.nl: did not receive HSTS header
-bezoomnyville.com: could not connect to host
-bezorg.ninja: could not connect to host
-bezprawnik.pl: did not receive HSTS header
-bezr.co.uk: could not connect to host
-bf.am: max-age too low: 0
-bf7088.com: did not receive HSTS header
-bf7877.com: did not receive HSTS header
-bfas237blog.com: could not connect to host
-bfd.vodka: could not connect to host
-bfear.com: could not connect to host
-bfelob.gov: could not connect to host
-bffm.biz: could not connect to host
-bfi.wien: did not receive HSTS header
-bflix.tv: did not receive HSTS header
-bfrailwayclub.cf: could not connect to host
-bft-media.com: could not connect to host
-bftbradio.com: did not receive HSTS header
-bg-sexologia.com: could not connect to host
-bg16.de: could not connect to host
-bgbhsf.top: could not connect to host
-bgcparkstad.nl: did not receive HSTS header
-bgdaddy.com: did not receive HSTS header
-bgenlisted.com: could not connect to host
-bgeo.io: could not connect to host
-bgneuesheim.de: did not receive HSTS header
-bgp.ee: could not connect to host
-bgwfans.com: did not receive HSTS header
-bhatia.at: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-bhost.net: did not receive HSTS header
-bhosted.nl: did not receive HSTS header
-bhthome.com: could not connect to host
-bi-ec.ac.cn: could not connect to host
-bi1gif.space: could not connect to host
-biaggeo-prod.herokuapp.com: could not connect to host
-biancolievito.it: did not receive HSTS header
-bianinapiccanovias.com: could not connect to host
-bianvip888.com: max-age too low: 0
-biaoqingfuhao.net: could not connect to host
-biaoqingfuhao.org: could not connect to host
-biathloncup.ru: could not connect to host
-biaxin.ml: could not connect to host
-bible.ru: did not receive HSTS header
-bibleonline.ru: did not receive HSTS header
-biblerhymes.com: could not connect to host
-bibles.com.tw: did not receive HSTS header
-biblethoughts.blog: did not receive HSTS header
-bibliafeminina.com.br: could not connect to host
-biblio.wiki: could not connect to host
-bichines.es: did not receive HSTS header
-bichonfrise.com.br: could not connect to host
-bichonmaltes.com.br: could not connect to host
-bicilonatours.com: did not receive HSTS header
-bicromoestudio.com: could not connect to host
-bicycle-events.com: could not connect to host
-bidon.ca: did not receive HSTS header
-bidorbuy.co.ke: did not receive HSTS header
-bieberium.de: could not connect to host
-biehl.co: could not connect to host
-biehl.tech: did not receive HSTS header
-bielsa.me: did not receive HSTS header
-bienenblog.cc: could not connect to host
-bienestarinmobiliarioyaliadas.com: could not connect to host
-biensenvue.com: could not connect to host
-bier.jp: did not receive HSTS header
-bierbringer.at: could not connect to host
-bieumau.net: could not connect to host
-biewen.me: did not receive HSTS header
-biftin.moe: did not receive HSTS header
-biftin.net: could not connect to host
-big-black.de: did not receive HSTS header
-big-fluglaerm-hamburg.de: did not receive HSTS header
-bigadcompany.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-bigbbqbrush.bid: could not connect to host
-bigbounceentertainment.co.uk: could not connect to host
-bigbrotherawards.nl: did not receive HSTS header
-bigbrownpromotions.com.au: did not receive HSTS header
-bigcorporateevents.com: could not connect to host
-bigerbio.com: did not receive HSTS header
-bigfunbouncycastles.com: could not connect to host
-biggreenexchange.com: did not receive HSTS header
-bigjohn.ru: did not receive HSTS header
-bignumworks.com: did not receive HSTS header
-bigshinylock.minazo.net: could not connect to host
-bigshort.org: could not connect to host
-bigthunder.ca: could not connect to host
-biguixhe.net: could not connect to host
-bigwiseguide.com: could not connect to host
-bijoux.com.br: could not connect to host
-bijouxbrasil.com.br: did not receive HSTS header
-bijouxdegriffe.com.br: could not connect to host
-biju-neko.jp: could not connect to host
-bijugeral.com.br: could not connect to host
-bikebay.it: could not connect to host
-bikelifetvkidsquads.co.uk: could not connect to host
-bikerebel.com: did not receive HSTS header
-bikermusic.net: could not connect to host
-bikeshopitalia.com: could not connect to host
-bikiniatoll.com: did not receive HSTS header
-bilanligne.com: did not receive HSTS header
-bildermachr.de: could not connect to host
-bildiri.ci: could not connect to host
-biletru.net: could not connect to host
-biletua.de: could not connect to host
-biletyplus.com: could not connect to host
-biletyplus.ru: did not receive HSTS header
-bill-nye-the.science: could not connect to host
-billcomparison.ga: could not connect to host
-billdestler.com: could not connect to host
-billigssl.dk: did not receive HSTS header
-billionkiaparts.com: could not connect to host
-billninja.com: did not receive HSTS header
-billpro.com.au: could not connect to host
-billrobinson.io: could not connect to host
-billrusling.com: could not connect to host
-billsqualityautocare.com: did not receive HSTS header
-biloplysninger.dk: did not receive HSTS header
-bilsho.com: could not connect to host
-binam.center: could not connect to host
-binans.co: could not connect to host
-binans.io: could not connect to host
-binans.xyz: could not connect to host
-binarization.com: did not receive HSTS header
-binarization.net: could not connect to host
-binarization.org: could not connect to host
-binarka.net: did not receive HSTS header
-binaryabstraction.com: could not connect to host
-binderapp.net: could not connect to host
-binf.tk: could not connect to host
-binfind.com: did not receive HSTS header
-bingcheung.com: could not connect to host
-bingcheung.org: could not connect to host
-bingo-wear.com: could not connect to host
-bingo9.net: could not connect to host
-bingofriends.com: could not connect to host
-bingostars.com: did not receive HSTS header
-binimo.com: could not connect to host
-binkanhada.biz: could not connect to host
-bintangpiaggi.info: did not receive HSTS header
-bintangsyurga.com: could not connect to host
-binwu666.com: max-age too low: 0
-biobone.net: could not connect to host
-biodobavki.tk: could not connect to host
-bioespuna.eu: did not receive HSTS header
-biofam.ru: did not receive HSTS header
-biogeniq.ca: did not receive HSTS header
-biomasscore.com: did not receive HSTS header
-biomax-mep.com.br: did not receive HSTS header
-biomeris.it: did not receive HSTS header
-biometrics.es: could not connect to host
-bionicspirit.com: did not receive HSTS header
-bionovanaturalpools.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-biophysik-ssl.de: did not receive HSTS header
-biopreferred.gov: could not connect to host
-biospeak.solutions: could not connect to host
-biou.me: could not connect to host
-biovalue.eu: could not connect to host
-bip.gov.sa: could not connect to host
-bipyo.com: could not connect to host
-birchbarkfurniture.ch: could not connect to host
-birdfeeder.online: could not connect to host
-birgitandmerlin.com: could not connect to host
-birkengarten.ch: could not connect to host
-birkhoff.me: did not receive HSTS header
-birkman.com: did not receive HSTS header
-birminghamcastlehire.co.uk: did not receive HSTS header
-birthright.host: could not connect to host
-birthright.website: could not connect to host
-biscuits-rec.com: could not connect to host
-biscuits-shop.com: could not connect to host
-bisix.tk: could not connect to host
-bismarck.moe: could not connect to host
-biso.ga: could not connect to host
-bissalama.org: could not connect to host
-bisschopssteeg.nl: could not connect to host
-bisterfeldt.com: did not receive HSTS header
-bistrodeminas.com: could not connect to host
-biswas.me: did not receive HSTS header
-bit.voyage: did not receive HSTS header
-bitace.com: did not receive HSTS header
-bitbit.org: did not receive HSTS header
-bitbr.net: could not connect to host
-bitcalt.eu.org: could not connect to host
-bitcalt.ga: could not connect to host
-bitcantor.com: did not receive HSTS header
-bitchan.it: could not connect to host
-bitchigo.com: could not connect to host
-bitclubfun.com: did not receive HSTS header
-bitcoin-casino-no-deposit-bonus.com: max-age too low: 0
-bitcoin-class.com: could not connect to host
-bitcoin-daijin.com: could not connect to host
-bitcoin-india.org: could not connect to host
-bitcoin.com: could not connect to host
-bitcoinclashic.ninja: did not receive HSTS header
-bitcoinec.info: could not connect to host
-bitcoinfo.jp: could not connect to host
-bitcoingah.com: did not receive HSTS header
-bitcoinhk.org: did not receive HSTS header
-bitcoinjpn.com: could not connect to host
-bitcoinkarlsruhe.de: did not receive HSTS header
-bitcoinprivacy.net: did not receive HSTS header
-bitcoinrush.tk: could not connect to host
-bitcointrade.com.br: did not receive HSTS header
-bitcoinwalletscript.tk: could not connect to host
-bitcoinworld.me: could not connect to host
-bitcoinx.gr: did not receive HSTS header
-bitconcepts.co.uk: could not connect to host
-bitedge.com: did not receive HSTS header
-bitenose.net: could not connect to host
-bitenose.org: could not connect to host
-bitf.ly: did not receive HSTS header
-bitfactory.ws: could not connect to host
-bitfarm-archiv.com: did not receive HSTS header
-bitfarm-archiv.de: did not receive HSTS header
-bitfence.io: did not receive HSTS header
-bitfolio.org: did not receive HSTS header
-bithap.com: did not receive HSTS header
-bitheus.com: could not connect to host
-bithosting.io: did not receive HSTS header
-bitk.co: did not receive HSTS header
-bitk.co.uk: did not receive HSTS header
-bitk.eu: did not receive HSTS header
-bitk.uk: did not receive HSTS header
-bitmain.com.ua: could not connect to host
-bitmaincare.com.ua: could not connect to host
-bitmaincare.ru: could not connect to host
-bitmainwarranty.com.ua: could not connect to host
-bitmainwarranty.ru: could not connect to host
-bitmex.com: did not receive HSTS header
-bitmexin.com: could not connect to host
-bitmon.net: could not connect to host
-bitnet.io: did not receive HSTS header
-bitplay.space: could not connect to host
-bitpod.de: could not connect to host
-bitpoll.de: could not connect to host
-bitpoll.org: could not connect to host
-bitrage.de: could not connect to host
-bitraum.io: could not connect to host
-bitroll.com: did not receive HSTS header
-bitsburg.ru: did not receive HSTS header
-bitsensor.io: did not receive HSTS header
-bitshaker.net: did not receive HSTS header
-bitsum.com: did not receive HSTS header
-bittervault.xyz: could not connect to host
-bituptick.com: did not receive HSTS header
-bitvegas.com: did not receive HSTS header
-bitvigor.com: did not receive HSTS header
-bitwrought.net: could not connect to host
-bityes.org: could not connect to host
-biupay.com.br: could not connect to host
-bivsi.com: could not connect to host
-bizbudding.com: max-age too low: 2592000
-bizcms.com: could not connect to host
-bizedge.co.nz: did not receive HSTS header
-biznes-sekrety.cf: could not connect to host
-bizon.sk: did not receive HSTS header
-bizzartech.com: could not connect to host
-bizzi.tv: could not connect to host
-bizzybeebouncers.co.uk: could not connect to host
-bjgongyi.com: did not receive HSTS header
-bjmgeek.science: could not connect to host
-bjmun.cn: could not connect to host
-bjoernengel.de: did not receive HSTS header
-bjoernengel.eu: did not receive HSTS header
-bjrn.io: could not connect to host
-bjtxl.cn: could not connect to host
-bkb-skandal.ch: could not connect to host
-bkhayes.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-bkkposn.com: could not connect to host
-bklaindia.com: could not connect to host
-black-armada.com: could not connect to host
-black-armada.com.pl: could not connect to host
-black-armada.pl: could not connect to host
-black-cat-seo.com: did not receive HSTS header
-black-khat.com: could not connect to host
-black-octopus.ru: could not connect to host
-black-pool.net: could not connect to host
-blackapron.com.br: could not connect to host
-blackbase.de: did not receive HSTS header
-blackberrycentral.com: could not connect to host
-blackburn.link: could not connect to host
-blackbyte.it: could not connect to host
-blackcicada.com: could not connect to host
-blackcountrymetalworks.co.uk: did not receive HSTS header
-blackdesertsp.com: could not connect to host
-blackdotbrewery.com: could not connect to host
-blackhawktreeinc.com: did not receive HSTS header
-blackhell.xyz: could not connect to host
-blackilli.de: could not connect to host
-blackislegroup.com: did not receive HSTS header
-blackkeg.ca: could not connect to host
-blacklane.com: did not receive HSTS header
-blackly.uk: max-age too low: 0
-blackmagic.sk: could not connect to host
-blackmirror.com.au: did not receive HSTS header
-blackonion.com: did not receive HSTS header
-blackpayment.ru: could not connect to host
-blackphantom.de: could not connect to host
-blackpi.dedyn.io: could not connect to host
-blackrose-garden.herokuapp.com: did not receive HSTS header
-blackscreen.me: could not connect to host
-blackthrone.tk: could not connect to host
-blackunicorn.wtf: could not connect to host
-blackyau.cc: did not receive HSTS header
-bladesmith.io: could not connect to host
-blakerandall.xyz: could not connect to host
-blamefran.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-blankersfamily.com: did not receive HSTS header
-blantik.net: could not connect to host
-blantr.com: could not connect to host
-blarg.co: could not connect to host
-blastair.fr: did not receive HSTS header
-blastzoneentertainments.co.uk: could not connect to host
-blatnice.cf: could not connect to host
-blatnice.ga: could not connect to host
-blatnice.gq: could not connect to host
-blatnice.ml: could not connect to host
-blatnice.tk: could not connect to host
-blazeit.io: could not connect to host
-blechpirat.name: could not connect to host
-bleep.zone: could not connect to host
-blend.guru: did not receive HSTS header
-blendlecdn.com: could not connect to host
-blenheimchalcot.com: did not receive HSTS header
-blessedguy.net: did not receive HSTS header
-blessnet.jp: did not receive HSTS header
-bleutecmedia.com: did not receive HSTS header
-blha303.com.au: could not connect to host
-blic-zajm.gq: could not connect to host
-blicy.net: could not connect to host
-bliesekow.net: could not connect to host
-bliker.ga: could not connect to host
-blikk.no: did not receive HSTS header
-blindaryproduction.tk: could not connect to host
-blinder.com.co: did not receive HSTS header
-blinds-unlimited.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-blindsexdate.nl: did not receive HSTS header
-blinkenlight.co.uk: could not connect to host
-blinkenlight.com.au: could not connect to host
-blinkspeed.eu: could not connect to host
-blitzprog.org: could not connect to host
-blitzvendor.com: could not connect to host
-blizora.com: could not connect to host
-bllb.ru: could not connect to host
-blmiller.com: could not connect to host
-blockchainevents.nl: could not connect to host
-blockcheck.network: could not connect to host
-blockified.io: could not connect to host
-blocknodes.live: could not connect to host
-blocksatz-medien.de: could not connect to host
-blockshopauto.com: could not connect to host
-blog-ritaline.com: could not connect to host
-blog.coffee: could not connect to host
-blog.cyveillance.com: could not connect to host
-blog.gparent.org: could not connect to host
-blogabout.ru: could not connect to host
-blogcast.com: did not receive HSTS header
-blogconcours.net: could not connect to host
-blogcuaviet.com: could not connect to host
-blogdeyugioh.com: could not connect to host
-bloggingwithchildren.com: could not connect to host
-blogkuliah.com: could not connect to host
-bloglife-bb.com: could not connect to host
-bloglikepro.com: could not connect to host
-bloglines.co.za: did not receive HSTS header
-bloglogistics.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-blognr.com: could not connect to host
-blogonblogspot.com: did not receive HSTS header
-blogpronto.com.br: did not receive HSTS header
-bloguser.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-blokino.org: did not receive HSTS header
-blokmy.com: could not connect to host
-blokuhaka.fr: did not receive HSTS header
-blondesguide.com: did not receive HSTS header
-blood4pets.tk: could not connect to host
-bloodhunt.pl: could not connect to host
-bloodyexcellent.com: did not receive HSTS header
-bloogle.top: did not receive HSTS header
-bloombrown.com: did not receive HSTS header
-bloomnbud.com: did not receive HSTS header
-bloomscape.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-bloomzoomy.ru: could not connect to host
-blowjs.com: could not connect to host
-bls-fiduciaire.be: did not receive HSTS header
-bltc.co: could not connect to host
-blucas.org: did not receive HSTS header
-bludnykoren.ml: could not connect to host
-blue17.co.uk: did not receive HSTS header
-bluebahari.gq: could not connect to host
-bluebill.net: did not receive HSTS header
-bluecardlottery.eu: could not connect to host
-bluecon.eu: did not receive HSTS header
-bluedata.ltd: could not connect to host
-bluefinger.nl: did not receive HSTS header
-blueflare.org: could not connect to host
-blueglobalmedia.com: could not connect to host
-bluehawk.cloud: could not connect to host
-blueliv.com: did not receive HSTS header
-blueoceantech.us: did not receive HSTS header
-bluepearl.tk: could not connect to host
-blueplumbinggroup.com.au: could not connect to host
-bluepoint.foundation: did not receive HSTS header
-bluepoint.institute: did not receive HSTS header
-bluepoint.one: did not receive HSTS header
-blueprintloans.co.uk: could not connect to host
-blueridgesecuritycameras.com: did not receive HSTS header
-blues-and-pictures.com: could not connect to host
-bluescloud.xyz: did not receive HSTS header
-bluesecure.com.br: could not connect to host
-bluesnews.tk: could not connect to host
-bluetenmeer.com: did not receive HSTS header
-blueyed.eu: max-age too low: 600
-bluezonehealth.co.uk: did not receive HSTS header
-blui.cf: could not connect to host
-blui.ml: could not connect to host
-bluicraft.tk: could not connect to host
-bluketing.com: did not receive HSTS header
-blumen-binder.ch: did not receive HSTS header
-blumen-garage.de: could not connect to host
-blumenwiese.xyz: did not receive HSTS header
-blundell.wedding: could not connect to host
-blunderify.se: did not receive HSTS header
-bluop.com: could not connect to host
-bluproducts.com.es: could not connect to host
-bluserv.net: could not connect to host
-bluteklab.com: did not receive HSTS header
-blutroyal.de: did not receive HSTS header
-bm-i.ch: could not connect to host
-bm-immo.ch: could not connect to host
-bm-trading.nl: did not receive HSTS header
-bmet.de: did not receive HSTS header
-bminton.is-a-geek.net: could not connect to host
-bmriv.com: could not connect to host
-bmwcolors.com: could not connect to host
-bn1digital.co.uk: did not receive HSTS header
-bnb-buddy.nl: could not connect to host
-bnboy.cn: could not connect to host
-bngsecure.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-bnhlibrary.com: could not connect to host
-bnusd.cn: could not connect to host
-board-buy.ru: could not connect to host
-boatme.de: did not receive HSTS header
-bobaobei.org: could not connect to host
-bobbyhensley.com: could not connect to host
-bobiji.com: could not connect to host
-boboates.com: did not receive HSTS header
-bocloud.eu: could not connect to host
-bodaneiranunez.com: did not receive HSTS header
-bodixite.com: could not connect to host
-bodo-wolff.de: could not connect to host
-bodrumfarm.com: could not connect to host
-bodyblog.nl: did not receive HSTS header
-bodybuilding-legends.com: could not connect to host
-bodybuilding.events: could not connect to host
-bodycaredirect.online: did not receive HSTS header
-bodyweightsolution.com: did not receive HSTS header
-bodyworkbymichael.com: did not receive HSTS header
-boekenlegger.nl: did not receive HSTS header
-boel073.nl: did not receive HSTS header
-boem.gov: did not receive HSTS header
-boensou.com: did not receive HSTS header
-boese.one: could not connect to host
-boffin.tk: could not connect to host
-bog8.com: did not receive HSTS header
-bogobeats.com: did not receive HSTS header
-bogosity.tv: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-bogwitch.tk: could not connect to host
-bohaishibei.com: did not receive HSTS header
-bohan.life: could not connect to host
-bohyn.cz: could not connect to host
-boiadeirodeberna.com: could not connect to host
-boilesen.com: could not connect to host
-boincstats.com: did not receive HSTS header
-bokeyy.com: could not connect to host
-bol.io: could not connect to host
-bolainfoasia.com: did not receive HSTS header
-boldmediagroup.com: could not connect to host
-bolivarfm.com.ve: could not connect to host
-bollywood.uno: could not connect to host
-bolsa.tk: could not connect to host
-boltdata.io: could not connect to host
-boltn.uk: could not connect to host
-bolwerk.com.br: did not receive HSTS header
-bombayfashionclub.com: could not connect to host
-bomberus.de: could not connect to host
-bombsquad.studio: could not connect to host
-bonamihome.ro: could not connect to host
-bonapp.restaurant: could not connect to host
-bonbini.ga: could not connect to host
-bondoer.fr: did not receive HSTS header
-bondtofte.dk: max-age too low: 2592000
-bonibuty.com: max-age too low: 2592000
-bonigo.de: could not connect to host
-bonita.com.br: could not connect to host
-bonitabrazilian.co.nz: did not receive HSTS header
-bonnebouffe.fr: could not connect to host
-bonniedraw.com: could not connect to host
-bonniekitchen.com: could not connect to host
-bonnin.fr: did not receive HSTS header
-bonobo.cz: could not connect to host
-bonop.com: did not receive HSTS header
-bonqoeur.ca: did not receive HSTS header
-bonrecipe.com: could not connect to host
-bonta.one: could not connect to host
-bonus-flexi.com: did not receive HSTS header
-boobox.xyz: could not connect to host
-boogaerdtmakelaars.nl: did not receive HSTS header
-boogiebouncecastles.co.uk: did not receive HSTS header
-book-of-ra.de: could not connect to host
-bookcelerator.com: did not receive HSTS header
-booked.holiday: could not connect to host
-bookingentertainment.com: did not receive HSTS header
-bookmakersfreebets.com.au: did not receive HSTS header
-bookofraonlinecasinos.com: could not connect to host
-bookourdjs.com: could not connect to host
-bookreport.ga: could not connect to host
-booksouthafrica.travel: did not receive HSTS header
-bookwitty.social: did not receive HSTS header
-boomerang.com: did not receive HSTS header
-boomsaki.com: did not receive HSTS header
-boomsakis.com: did not receive HSTS header
-boonecountyfpdmo.gov: did not receive HSTS header
-boonehenry.co.uk: did not receive HSTS header
-booox.biz: could not connect to host
-booox.pw: could not connect to host
-boop.gq: could not connect to host
-booq.org: did not receive HSTS header
-boost.fyi: could not connect to host
-boosterlearnpro.com: could not connect to host
-boostgame.win: could not connect to host
-boote.wien: could not connect to host
-booter.es: did not receive HSTS header
-booth.in.th: did not receive HSTS header
-bootikexpress.fr: did not receive HSTS header
-bootyourboss.com: did not receive HSTS header
-boozinyan.com: could not connect to host
-bopera.co.uk: could not connect to host
-borchers-media.de: could not connect to host
-borderlinegroup.com: could not connect to host
-boren.shop: did not receive HSTS header
-borg.cloud: did not receive HSTS header
-borgodigatteraia.it: could not connect to host
-boringsecurity.net: could not connect to host
-boringsmith.com: did not receive HSTS header
-boris.one: could not connect to host
-borisavstankovic.rs: could not connect to host
-borisbesemer.com: did not receive HSTS header
-borisschapira.com: did not receive HSTS header
-born-to-learn.com: could not connect to host
-borrelioz.com: did not receive HSTS header
-borscheid-wenig.com: did not receive HSTS header
-borzoi.com.br: did not receive HSTS header
-boschee.net: could not connect to host
-boschsplit.co: could not connect to host
-bostadsportal.se: did not receive HSTS header
-bosworthdental.co.uk: did not receive HSTS header
-botealis.ch: could not connect to host
-botlab.ch: could not connect to host
-botmanager.pl: could not connect to host
-botoes-primor.pt: max-age too low: 2592000
-botox.bz: did not receive HSTS header
-bots.cat: could not connect to host
-botsiah.fail: could not connect to host
-botsindiscord.me: could not connect to host
-botstack.host: could not connect to host
-bou.lt: did not receive HSTS header
-boueki.jp: did not receive HSTS header
-boueki.org: did not receive HSTS header
-bouk.co: could not connect to host
-bouncebeyondcastles.co.uk: could not connect to host
-bounceboxspc.com: did not receive HSTS header
-bouncecoffee.com: did not receive HSTS header
-bouncehighpeak.co.uk: could not connect to host
-bouncelanduk.co.uk: did not receive HSTS header
-bouncemania.org: could not connect to host
-bouncemasters.co.uk: could not connect to host
-bouncenslidenortheast.co.uk: did not receive HSTS header
-bouncewithbovells.com: could not connect to host
-bouncing-bugs.co.uk: could not connect to host
-bouncing4joy.co.uk: could not connect to host
-bouncingbuzzybees.co.uk: could not connect to host
-bouncy-tots.co.uk: could not connect to host
-bouncyballscastles.co.uk: could not connect to host
-bouncycastleandparty.co.uk: could not connect to host
-bouncycastlehiremedway.com: could not connect to host
-bouncycastles.me: did not receive HSTS header
-bouncycastlesinleeds.co.uk: did not receive HSTS header
-bouncycastlesperth.net: could not connect to host
-bouncyfeet.co.uk: could not connect to host
-bouncyhouses.co.uk: could not connect to host
-bouncymadness.com: could not connect to host
-bouncytown.co.uk: could not connect to host
-bountiful.gov: could not connect to host
-bourdon.fr.eu.org: could not connect to host
-bourgdepabos.com: did not receive HSTS header
-bourhis.info: did not receive HSTS header
-bourqu.in: did not receive HSTS header
-boutiquedecanetas.com.br: could not connect to host
-boutiquefutebol.com.br: did not receive HSTS header
-bouwbedrijfpurmerend.nl: did not receive HSTS header
-bowlsheet.com: did not receive HSTS header
-bownty.pt: did not receive HSTS header
-boxdevigneron.fr: could not connect to host
-boxing-austria.eu: did not receive HSTS header
-boxit.es: did not receive HSTS header
-boxlink.io: did not receive HSTS header
-boxlitepackaging.com: did not receive HSTS header
-boxmoe.cn: could not connect to host
-boxtreeclinic.com: did not receive HSTS header
-boxview.com: could not connect to host
-boyan.in: could not connect to host
-boyerassoc.com: did not receive HSTS header
-boyfriendhusband.men: did not receive HSTS header
-boyntonobserver.org: could not connect to host
-bozemancarpetcleaningservices.com: could not connect to host
-bozosbouncycastles.co.uk: did not receive HSTS header
-bp-wahl.at: did not receive HSTS header
-bpa.gov: did not receive HSTS header
-bpadvisors.eu: could not connect to host
-bpvr.ddns.net: could not connect to host
-bqtoolbox.com: could not connect to host
-br-miyamoto.spdns.org: could not connect to host
-brackets-salad.com: could not connect to host
-bracoitaliano.com.br: could not connect to host
-bradfergusonrealestate.com: did not receive HSTS header
-braemer-it-consulting.de: could not connect to host
-bragaweb.com.br: could not connect to host
-brahmstaedt.de: could not connect to host
-brain-e.co: could not connect to host
-brainfork.ml: could not connect to host
-brainfork.org: did not receive HSTS header
-brainfpv.com: did not receive HSTS header
-brainhub.nl: could not connect to host
-brainlag.org: could not connect to host
-brainster.co: max-age too low: 0
-braintensive.com: could not connect to host
-braintm.com: could not connect to host
-braintreebouncycastles.com: could not connect to host
-braintreepayments.com: did not receive HSTS header
-brainvation.de: did not receive HSTS header
-brainyapp.net: could not connect to host
-brakstad.org: did not receive HSTS header
-brambogaerts.nl: did not receive HSTS header
-bramburek.net: could not connect to host
-bramsikkens.be: could not connect to host
-bran.cc: could not connect to host
-bran.soy: could not connect to host
-branchzero.com: did not receive HSTS header
-brand-foo.com: did not receive HSTS header
-brand-foo.jp: did not receive HSTS header
-brand-foo.net: did not receive HSTS header
-brandbil.dk: could not connect to host
-brandbuilderwebsites.com: could not connect to host
-brandcodeconsulting.com: did not receive HSTS header
-brandnewdays.nl: could not connect to host
-brando753.xyz: could not connect to host
-brandon.so: could not connect to host
-brandonhaynesmd.com: could not connect to host
-brandonlui.ml: could not connect to host
-brandons.site: could not connect to host
-brandontaylor-black.com: could not connect to host
-brandred.net: could not connect to host
-brandspray.com: did not receive HSTS header
-brasilbombas.com.br: did not receive HSTS header
-brasilien.guide: could not connect to host
-brasilmorar.com: did not receive HSTS header
-brasiltopnews.tk: could not connect to host
-brasspipedreams.org: could not connect to host
-bratislava-airport-taxi.com: did not receive HSTS header
-bravehearts.org.au: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-bravz.de: could not connect to host
-brawlstarsitalia.com: did not receive HSTS header
-breakingvap.fr: did not receive HSTS header
-breakpoint.at: did not receive HSTS header
-breakwall.ml: could not connect to host
-breatheav.com: did not receive HSTS header
-breatheproduction.com: did not receive HSTS header
-breda.computer: did not receive HSTS header
-breeswish.org: did not receive HSTS header
-breezeairportparking.com.au: did not receive HSTS header
-breitbild-beamer.de: max-age too low: 1209600
-breizh.me: did not receive HSTS header
-brendanscherer.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-brenden.net.au: could not connect to host
-bress.cloud: could not connect to host
-brestnews.tk: could not connect to host
-brettelliff.com: did not receive HSTS header
-brettpemberton.xyz: did not receive HSTS header
-brettw.xyz: could not connect to host
-bretz-hufer.de: did not receive HSTS header
-brewtrackr.com: did not receive HSTS header
-brezani.tk: could not connect to host
-brfvh24.se: could not connect to host
-briangarcia.ga: could not connect to host
-brianpcurran.com: could not connect to host
-brickoo.com: could not connect to host
-brickwerks.io: could not connect to host
-brickyardbuffalo.com: did not receive HSTS header
-brideandgroomdirect.ie: could not connect to host
-bridesmagazine.co.uk: did not receive HSTS header
-bridgehomeloans.com: could not connect to host
-bridgeout.com: could not connect to host
-bridgingdirectory.com: did not receive HSTS header
-bridzius.lt: did not receive HSTS header
-briffoud.fr: could not connect to host
-briggsleroux.com: could not connect to host
-brightfuturemadebyme.com: could not connect to host
-brightonzhang.com: did not receive HSTS header
-brightstarkids.co.uk: did not receive HSTS header
-brightstarkids.com.au: did not receive HSTS header
-brightstarkids.net: did not receive HSTS header
-brightstarkids.sg: did not receive HSTS header
-brigitte.nyc: could not connect to host
-brigittebutt.tk: could not connect to host
-brilliantbuilders.co.uk: could not connect to host
-brilliantdecisionmaking.com: did not receive HSTS header
-brillio.com: could not connect to host
-brimspark.com: could not connect to host
-brinkhu.is: could not connect to host
-brinkmann.one: did not receive HSTS header
-brinquedoseducativos.art.br: did not receive HSTS header
-brio-ukraine.store: could not connect to host
-britania.tk: could not connect to host
-britishchronicles.com: could not connect to host
-britzer-toner.de: did not receive HSTS header
-brivadois.ovh: could not connect to host
-brix.ninja: did not receive HSTS header
-brks.xyz: could not connect to host
-brmascots.com: could not connect to host
-brn.by: could not connect to host
-broadleft.org: could not connect to host
-brocinema.com: did not receive HSTS header
-brody.digital: could not connect to host
-brody.ninja: could not connect to host
-broerweb.nl: could not connect to host
-broken-oak.com: could not connect to host
-brokenjoysticks.net: did not receive HSTS header
-bromo.cf: could not connect to host
-brooke-fan.com: did not receive HSTS header
-brookechase.com: did not receive HSTS header
-brookframework.org: could not connect to host
-brooklyncosmetics.net: could not connect to host
-brookscountyga.gov: did not receive HSTS header
-brookworth.com: did not receive HSTS header
-brossman.it: could not connect to host
-brother-printsmart.nl: did not receive HSTS header
-brouwerijkoelit.nl: could not connect to host
-brovelton.com: did not receive HSTS header
-brown-devost.com: did not receive HSTS header
-brownlawoffice.us: did not receive HSTS header
-browserid.org: could not connect to host
-brplusdigital.com: could not connect to host
-brring.com: did not receive HSTS header
-bruce-springsteen.tk: could not connect to host
-brucemobile.de: did not receive HSTS header
-bruna-cdn.nl: could not connect to host
-brunix.net: did not receive HSTS header
-brunoonline.co.uk: could not connect to host
-brunoramos.com: could not connect to host
-brunoramos.org: could not connect to host
-brutus2.ga: could not connect to host
-bryancastillo.site: could not connect to host
-bryanshearer.accountant: did not receive HSTS header
-bryn.xyz: could not connect to host
-brynnan.nl: did not receive HSTS header
-brztec.com: did not receive HSTS header
-bs-herting.de: did not receive HSTS header
-bs-security.com: could not connect to host
-bs.sb: could not connect to host
-bsagan.fr: did not receive HSTS header
-bsalyzer.com: could not connect to host
-bsc01.dyndns.org: could not connect to host
-bsd.com.ro: could not connect to host
-bsdfreak.dk: could not connect to host
-bsdlab.com: could not connect to host
-bsdtips.com: could not connect to host
-bsdug.org: could not connect to host
-bserved.de: could not connect to host
-bsg-aok-muenchen.de: did not receive HSTS header
-bsklabels.com: did not receive HSTS header
-bsktweetup.info: could not connect to host
-bslim-e-boutique.com: could not connect to host
-bsohoekvanholland.nl: could not connect to host
-bst.gg: did not receive HSTS header
-bsuess.de: could not connect to host
-bsuru.xyz: could not connect to host
-bt78.cn: could not connect to host
-bt780.com: could not connect to host
-bt85.cn: could not connect to host
-bt9.cc: could not connect to host
-bt96.cn: did not receive HSTS header
-bt995.com: did not receive HSTS header
-btaoke.com: could not connect to host
-btc-e.com: could not connect to host
-btc2secure.com: could not connect to host
-btcdlc.com: could not connect to host
-btcgo.nl: did not receive HSTS header
-btcontract.com: could not connect to host
-btcp.space: could not connect to host
-btcpot.ltd: could not connect to host
-btcycle.org: could not connect to host
-btine.tk: could not connect to host
-btku.org: could not connect to host
-btrb.ml: could not connect to host
-btserv.de: could not connect to host
-btt-39.com: could not connect to host
-btt-59.com: could not connect to host
-btt7676.com: could not connect to host
-btta13.com: could not connect to host
-btth.live: could not connect to host
-btth.xyz: could not connect to host
-bturboo.com: could not connect to host
-btxiaobai.com: did not receive HSTS header
-bubba.cc: could not connect to host
-buben.tech: could not connect to host
-bubhub.io: could not connect to host
-buchhandlungkilgus.de: did not receive HSTS header
-buchheld.at: could not connect to host
-buchverlag-scholz.de: did not receive HSTS header
-buck.com: did not receive HSTS header
-bucket.tk: could not connect to host
-buckmulligans.com: did not receive HSTS header
-budaev-shop.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-buddhistische-weisheiten.org: could not connect to host
-buddy-development-backoffice-webapp.azurewebsites.net: could not connect to host
-buddy-development-rabodirectconnect-api.azurewebsites.net: could not connect to host
-buderus-family.be: could not connect to host
-budgetenergievriendenvoordeel.nl: did not receive HSTS header
-budgetthostels.nl: did not receive HSTS header
-budskap.eu: could not connect to host
-budweisermeats.com: did not receive HSTS header
-buenosairesestetica.com.ar: could not connect to host
-buenotour.ru: did not receive HSTS header
-buergerdialog.net: did not receive HSTS header
-buergerhaushalt.com: did not receive HSTS header
-buffetbouc.com: could not connect to host
-bufla.net: did not receive HSTS header
-bug.blue: could not connect to host
-buggmedia.com: could not connect to host
-buggshop.com: could not connect to host
-bugs.chromium.org: did not receive HSTS header (error ignored - included regardless)
-bugtrack.co.uk: did not receive HSTS header
-bugtrack.io: could not connect to host
-buhayguro.com: could not connect to host
-buhex.net: did not receive HSTS header
-buhler.pro: did not receive HSTS header
-buiko.com: could not connect to host
-build.chromium.org: did not receive HSTS header (error ignored - included regardless)
-buildbox.io: did not receive HSTS header
-buildci.asia: could not connect to host
-buildfaith.ca: did not receive HSTS header
-buildify.co.za: could not connect to host
-building-cost-estimators.com: could not connect to host
-buildingclouds.at: could not connect to host
-buildingclouds.ch: could not connect to host
-buildingclouds.es: could not connect to host
-buildingclouds.eu: could not connect to host
-buildingclouds.fr: could not connect to host
-buildingcostestimators.co.uk: could not connect to host
-builditsolutions.net: could not connect to host
-buildrightbuildingservicesltd.co.uk: could not connect to host
-buileo.com: could not connect to host
-builmaker.com: did not receive HSTS header
-built.by: could not connect to host
-buka.jp: could not connect to host
-bukai.men: did not receive HSTS header
-bukatv.cz: could not connect to host
-bukivallalkozasok.hu: could not connect to host
-bukpcszerviz.hu: could not connect to host
-bul3seas.eu: could not connect to host
-bulbcompare.com: could not connect to host
-bulbgenie.com: could not connect to host
-buldogueingles.com.br: could not connect to host
-bulgariablog.tk: could not connect to host
-bulgarien.guide: could not connect to host
-bulgariya.cf: could not connect to host
-bulk-pagerank-checker.com: could not connect to host
-bulkbuy.tech: could not connect to host
-bulkingtime.com: did not receive HSTS header
-bulkowespacerkowo.nl: could not connect to host
-bulktrade.de: did not receive HSTS header
-bullbits.com: max-age too low: 0
-bulldoghire.co.uk: did not receive HSTS header
-bulletbabu.com: could not connect to host
-bulletpoint.cz: could not connect to host
-bullpay.com: could not connect to host
-bullpendaily.com: could not connect to host
-bullterrier.me: could not connect to host
-bulmafox.com: could not connect to host
-bulmastife.com.br: could not connect to host
-bumarkamoda.com: did not receive HSTS header
-bumshow.ru: could not connect to host
-bunadarbankinn.is: could not connect to host
-bunaken.asia: could not connect to host
-bunbomenu.de: could not connect to host
-bunbun.be: could not connect to host
-bunny.tk: could not connect to host
-bunnymud.com: could not connect to host
-bunnyvishal.com: could not connect to host
-bunq.love: could not connect to host
-bupu.ml: could not connect to host
-buqi.cc: could not connect to host
-buquesdeguerra.tk: could not connect to host
-buradangonder.com: could not connect to host
-burckardtnet.de: did not receive HSTS header
-bureaubolster.nl: did not receive HSTS header
-bureaugravity.com: did not receive HSTS header
-burfordbedandbreakfast.co.uk: did not receive HSTS header
-burgawnc.gov: did not receive HSTS header
-burian-server.cz: could not connect to host
-buricloud.fr: could not connect to host
-burlesquemakeup.com: did not receive HSTS header
-burmakatze.at: did not receive HSTS header
-burmesecats.eu: did not receive HSTS header
-burncorp.org: could not connect to host
-burningcrash.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-burpsuite.site: could not connect to host
-burroughsid.com: could not connect to host
-burrow.ovh: could not connect to host
-burrowingsec.com: could not connect to host
-bursa3bydgoszcz.pl: did not receive HSTS header
-burtplasticsurgery.com: did not receive HSTS header
-burtrum.top: could not connect to host
-buryat-mongol.cf: could not connect to host
-buryit.net: did not receive HSTS header
-burzmedia.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-burzstudios.com: could not connect to host
-busanhs.bid: could not connect to host
-busanhs.win: did not receive HSTS header
-buserror.cn: could not connect to host
-bush41.org: did not receive HSTS header
-bushcraftfriends.com: could not connect to host
-bushland.tk: could not connect to host
-business-creators.ru: could not connect to host
-business.lookout.com: could not connect to host
-business.medbank.com.mt: did not receive HSTS header
-businessamongus.com: could not connect to host
-businessetmarketing.com: could not connect to host
-businessfurs.info: could not connect to host
-businesshosting.nl: did not receive HSTS header
-businessimmigration-eu.com: could not connect to host
-businessimmigration-eu.ru: could not connect to host
-businessmadeeasypodcast.com: did not receive HSTS header
-businessmodeler.se: could not connect to host
-businessplanexperts.ca: did not receive HSTS header
-businessradar.com.au: could not connect to host
-busit.be: could not connect to host
-busiteyiengelle.com: could not connect to host
-bustimes.org: did not receive HSTS header
-bustimes.org.uk: did not receive HSTS header
-bustup-tips.com: did not receive HSTS header
-busybee360.com: could not connect to host
-busyon.cloud: could not connect to host
-butchersworkshop.com: did not receive HSTS header
-butian518.com: did not receive HSTS header
-butikpris.se: did not receive HSTS header
-butlercountyhistory.org: could not connect to host
-butt.repair: could not connect to host
-buttercoin.com: could not connect to host
-buttercupstraining.co.uk: did not receive HSTS header
-butterfieldstraining.com: could not connect to host
-butterflycare.co: could not connect to host
-butterhost.ga: could not connect to host
-buttermilk.cf: could not connect to host
-buttonrun.com: did not receive HSTS header
-buturyu.net: did not receive HSTS header
-buturyu.org: did not receive HSTS header
-buurtgenotencollectief.nl: could not connect to host
-buy-neurontin-online.tk: could not connect to host
-buy-seroquel.tk: could not connect to host
-buy-sildalis.gq: could not connect to host
-buy-thing.com: could not connect to host
-buybaby.eu: could not connect to host
-buybike.shop: could not connect to host
-buycarpet.shop: could not connect to host
-buycbd.store: could not connect to host
-buycitalopram.ga: could not connect to host
-buycook.shop: could not connect to host
-buydesired.com: could not connect to host
-buydiflucan.ga: could not connect to host
-buyebook.xyz: could not connect to host
-buyfluoxetineonline.ml: could not connect to host
-buyfox.de: could not connect to host
-buyharpoon.com: could not connect to host
-buyhealth.shop: could not connect to host
-buyingsellingflorida.com: could not connect to host
-buyjewel.shop: could not connect to host
-buymethotrexate.ga: could not connect to host
-buymindhack.com: did not receive HSTS header
-buynowdepot.com: did not receive HSTS header
-buyplussize.shop: could not connect to host
-buyprofessional.shop: could not connect to host
-buyritefairview.com: did not receive HSTS header
-buysellinvestproperties.com: did not receive HSTS header
-buyshoe.org: could not connect to host
-buysuisse.shop: could not connect to host
-buytheway.co.za: could not connect to host
-buywine.shop: could not connect to host
-buywood.shop: could not connect to host
-buziaczki.pl: could not connect to host
-buzzconcert.com: did not receive HSTS header
-buzzconf.io: could not connect to host
-buzzdeck.com: could not connect to host
-buzztelco.com.au: could not connect to host
-bvexplained.co.uk: could not connect to host
-bvgg.eu: did not receive HSTS header
-bvionline.eu: did not receive HSTS header
-bvisible.be: did not receive HSTS header
-bvv-europe.eu: could not connect to host
-bw81.xyz: could not connect to host
-bwashing.tk: could not connect to host
-bwe-seminare.de: did not receive HSTS header
-bwear4all.de: could not connect to host
-bwf11.com: could not connect to host
-bwf55.com: could not connect to host
-bwf6.com: could not connect to host
-bwf66.com: did not receive HSTS header
-bwf77.com: could not connect to host
-bwf99.com: could not connect to host
-bwin2288.com: could not connect to host
-bwin86.com: could not connect to host
-bwin8601.com: could not connect to host
-bwin8602.com: did not receive HSTS header
-bwin8603.com: could not connect to host
-bwin8604.com: did not receive HSTS header
-bwin8605.com: did not receive HSTS header
-bwin8606.com: did not receive HSTS header
-bwwb.nu: did not receive HSTS header
-bx-web.com: did not receive HSTS header
-bx49.cc: could not connect to host
-bxdev.me: did not receive HSTS header
-bxdj2.com: did not receive HSTS header
-bxdj3.com: did not receive HSTS header
-bxdj4.com: did not receive HSTS header
-bxdj5.com: did not receive HSTS header
-bxdj6.com: did not receive HSTS header
-bxdj66.com: could not connect to host
-bxdj666.com: did not receive HSTS header
-bxdj7.com: did not receive HSTS header
-bxdj8.com: did not receive HSTS header
-bxdj88.com: did not receive HSTS header
-bxdj888.com: did not receive HSTS header
-bxdj9.com: did not receive HSTS header
-bxzx1.com: did not receive HSTS header
-bxzx2.com: did not receive HSTS header
-bxzx3.com: did not receive HSTS header
-bxzx4.com: did not receive HSTS header
-bxzx5.com: did not receive HSTS header
-bxzx6.com: did not receive HSTS header
-bxzx7.com: did not receive HSTS header
-bxzx9.com: did not receive HSTS header
-by.cx: could not connect to host
-by1896.com: could not connect to host
-by1898.com: could not connect to host
-by1899.com: could not connect to host
-by4cqb.cn: could not connect to host
-by77.com: did not receive HSTS header
-by777.com: did not receive HSTS header
-bydisk.com: could not connect to host
-byemeds.ga: could not connect to host
-byfeldt.dk: could not connect to host
-byhe.me: could not connect to host
-byji.com: could not connect to host
-byken.cn: could not connect to host
-bynumlaw.net: could not connect to host
-bypass.kr: could not connect to host
-bypassed.bid: could not connect to host
-bypassed.cc: could not connect to host
-bypassed.club: could not connect to host
-bypassed.date: could not connect to host
-bypassed.download: could not connect to host
-bypassed.faith: could not connect to host
-bypassed.host: could not connect to host
-bypassed.me: could not connect to host
-bypassed.online: could not connect to host
-bypassed.party: could not connect to host
-bypassed.press: could not connect to host
-bypassed.pw: could not connect to host
-bypassed.rocks: could not connect to host
-bypassed.site: could not connect to host
-bypassed.st: could not connect to host
-bypassed.today: could not connect to host
-bypassed.works: could not connect to host
-bypassed.world: could not connect to host
-bypro.xyz: could not connect to host
-byr.moe: could not connect to host
-byrko.sk: could not connect to host
-byronprivaterehab.com.au: did not receive HSTS header
-byronr.com: could not connect to host
-byronwade.com: did not receive HSTS header
-bystryj-zajm.tk: could not connect to host
-byte.chat: did not receive HSTS header
-byte.wtf: did not receive HSTS header
-bytecrafter.com: could not connect to host
-bytecrafter.net: could not connect to host
-bytema.re: could not connect to host
-bytepark.de: did not receive HSTS header
-bytesatwork.eu: could not connect to host
-byteshift.ca: could not connect to host
-bytesofcode.de: could not connect to host
-byteturtle.eu: did not receive HSTS header
-bythen.cn: did not receive HSTS header
-bytynazizkove.cz: did not receive HSTS header
-byurudraw.pics: could not connect to host
-bzhub.bid: could not connect to host
-bztraveler.com: did not receive HSTS header
-bztraveler.net: did not receive HSTS header
-c-path.org: did not receive HSTS header
-c-rickroll-v.pw: could not connect to host
-c-rom.fr: did not receive HSTS header
-c0o.cc: did not receive HSTS header
-c0rn3j.com: could not connect to host
-c12discountonline.com: did not receive HSTS header
-c16t.uk: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-c1yd3i.me: could not connect to host
-c2m-staging.com: could not connect to host
-c2o-library.net: did not receive HSTS header
-c2o2.xyz: could not connect to host
-c3-compose.com: could not connect to host
-c3.pm: could not connect to host
-c30365.com: did not receive HSTS header
-c376.site: could not connect to host
-c3b.info: could not connect to host
-c3bbs.com: could not connect to host
-c3hv.cn: could not connect to host
-c3ie.com: did not receive HSTS header
-c4.hk: could not connect to host
-c5197.co: could not connect to host
-c6729.co: could not connect to host
-c6729.com: did not receive HSTS header
-c6957.co: could not connect to host
-c6957.com: did not receive HSTS header
-c899365.com: could not connect to host
-c9297.co: could not connect to host
-c9397.com: could not connect to host
-c9721.com: could not connect to host
-c9728.co: could not connect to host
-ca-terminal-multiservices.fr: could not connect to host
-cabanactf.com: could not connect to host
-cablehighspeed.net: could not connect to host
-cabsites.com: could not connect to host
-cabusar.fr: could not connect to host
-cacd.eu: could not connect to host
-cachetagalong.com: did not receive HSTS header
-cachethome.com: could not connect to host
-cachethq.io: did not receive HSTS header
-caconnect.org: could not connect to host
-cacr.pw: could not connect to host
-cadacoon.com: could not connect to host
-cadao.me: did not receive HSTS header
-cadastroloteamento.com.br: could not connect to host
-cadburymovies.in.net: could not connect to host
-cadcreations.co.ke: did not receive HSTS header
-cadenadg.gr: did not receive HSTS header
-cadusilva.com: did not receive HSTS header
-caerostris.com: could not connect to host
-caerus.ws: did not receive HSTS header
-caesreon.com: could not connect to host
-cafe-murr.de: could not connect to host
-cafe-scientifique.org.ec: could not connect to host
-cafe-service.ru: could not connect to host
-cafechesscourt.com: could not connect to host
-cafeey.com: could not connect to host
-cafefresco.pe: did not receive HSTS header
-caferestor.com: did not receive HSTS header
-cafericoy.com: could not connect to host
-cafesdomundo.pt: did not receive HSTS header
-cafesg.net: did not receive HSTS header
-caiben.org: could not connect to host
-caibi.io: could not connect to host
-caim.cz: did not receive HSTS header
-caipai.fm: could not connect to host
-caipao123.com: max-age too low: 0
-cairnterrier.com.br: could not connect to host
-caitcs.com: could not connect to host
-caiwenjian.xyz: could not connect to host
-cajunuk.co.uk: could not connect to host
-cake-time.co.uk: could not connect to host
-cake.care: could not connect to host
-cal.goip.de: could not connect to host
-calatoruldigital.ro: did not receive HSTS header
-calcasieuparish.gov: did not receive HSTS header
-calcularpagerank.com.br: could not connect to host
-calculatoaresecondhand.xyz: could not connect to host
-caldaro.de: could not connect to host
-caldecotevillagehall.co.uk: could not connect to host
-caleb.host: could not connect to host
-calebennett.com: did not receive HSTS header
-calendriergratuit.fr: max-age too low: 300
-calentadores-solares-sunshine.com: did not receive HSTS header
-calgaryconstructionjobs.com: did not receive HSTS header
-calidadelectronica.com: did not receive HSTS header
-calidoinvierno.com: could not connect to host
-calkinsmusic.com: did not receive HSTS header
-callabs.net: could not connect to host
-callawayracing.se: could not connect to host
-calleveryday.com: could not connect to host
-callidus-vulpes.de: could not connect to host
-callision.com: did not receive HSTS header
-callmereda.com: could not connect to host
-callsigns.ca: could not connect to host
-calltrackingreports.com: could not connect to host
-calminteractive.fr: could not connect to host
-calories.org: could not connect to host
-caltonnutrition.com: did not receive HSTS header
-calypso-tour.net: could not connect to host
-calypsogames.net: could not connect to host
-calypsohost.net: did not receive HSTS header
-calyxengineers.com: could not connect to host
-calyxinstitute.org: did not receive HSTS header
-camaya.net: did not receive HSTS header
-cambridgeanalytica.net: could not connect to host
-cambridgeanalytica.org: could not connect to host
-camda.online: could not connect to host
-camdenboneandjoint.com: did not receive HSTS header
-camelforensics.com: could not connect to host
-camelliaflowers.com.au: did not receive HSTS header
-camelservers.com: could not connect to host
-cameronthomson.racing: did not receive HSTS header
-cameroonlounge.com: did not receive HSTS header
-camisado.tk: could not connect to host
-camisadotorcedor.com.br: could not connect to host
-camjackson.net: did not receive HSTS header
-camjobs.net: could not connect to host
-cammarkets.com: could not connect to host
-camomile.desi: did not receive HSTS header
-campaignagent.com.au: did not receive HSTS header
-campaignelves.com: could not connect to host
-campbellsoftware.co.uk: could not connect to host
-campbrainybunch.com: did not receive HSTS header
-campeoesdofutebol.com.br: did not receive HSTS header
-campeonatoalemao.com.br: could not connect to host
-campfire.co.il: could not connect to host
-campfourpaws.com: did not receive HSTS header
-campgesher.com: did not receive HSTS header
-camphub.co: could not connect to host
-campingcarlovers.com: could not connect to host
-campingdreams.com: did not receive HSTS header
-campus-cybersecurity.team: did not receive HSTS header
-campusportalng.com: did not receive HSTS header
-camsanalytics.com: could not connect to host
-camzroofing.ca: could not connect to host
-canadalife.de: did not receive HSTS header
-canadian-nurse.com: did not receive HSTS header
-canadianchristianity.com: did not receive HSTS header
-canadiangamblingchoice.com: did not receive HSTS header
-canal-onanismo.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-canarianlegalalliance.com: did not receive HSTS header
-cancelmyprofile.com: did not receive HSTS header
-cancreate.nl: did not receive HSTS header
-candicontrols.com: did not receive HSTS header
-candlcastles.co.uk: could not connect to host
-candratech.com: could not connect to host
-candygirl.shop: could not connect to host
-candykidsentertainment.co.uk: did not receive HSTS header
-candylion.rocks: could not connect to host
-candyout.com: did not receive HSTS header
-canerkorkmaz.com: did not receive HSTS header
-canfield.gov: did not receive HSTS header
-cangelloplasticsurgery.com: did not receive HSTS header
-canicaprice.com: did not receive HSTS header
-canifis.net: did not receive HSTS header
-canlidoviz.com: did not receive HSTS header
-cannarobotics.com: could not connect to host
-canopy.ninja: could not connect to host
-cansworld.com: could not connect to host
-canterberry.cc: did not receive HSTS header
-cantrack.com: did not receive HSTS header
-caodecristachines.com.br: could not connect to host
-caodesantohumberto.com.br: could not connect to host
-caoyu.info: did not receive HSTS header
-capacent.is: did not receive HSTS header
-capecycles.co.za: did not receive HSTS header
-capekeen.com: could not connect to host
-capellidipremoli.com: did not receive HSTS header
-capeyorkfire.com.au: could not connect to host
-capimlimaoflores.com.br: could not connect to host
-capitaltg.com: did not receive HSTS header
-capitaoalden.com: did not receive HSTS header
-capitein.tk: could not connect to host
-capogna.com: did not receive HSTS header
-capsule.org: did not receive HSTS header
-capsulesubs.fr: could not connect to host
-captainsinn.com: did not receive HSTS header
-captalize.com: could not connect to host
-captchatheprize.com: could not connect to host
-captianseb.de: could not connect to host
-captivatedbytabrett.com: did not receive HSTS header
-captivationscience.com: could not connect to host
-captured-symphonies.com: could not connect to host
-capturethepen.co.uk: could not connect to host
-caputo.com: could not connect to host
-car-insurance-quotes.biz: could not connect to host
-car-navi.ph: did not receive HSTS header
-car-rental24.com: could not connect to host
-car-shop.top: did not receive HSTS header
-car-speed.tk: could not connect to host
-carano-service.de: did not receive HSTS header
-caraudio69.cz: did not receive HSTS header
-carbonmade.com: did not receive HSTS header
-carbonmonoxidelawyer.net: could not connect to host
-carbonvision.cn: could not connect to host
-carck.co.uk: could not connect to host
-carck.uk: could not connect to host
-card-toka.jp: could not connect to host
-cardboard.cx: did not receive HSTS header
-cardelmar.com: did not receive HSTS header
-cardelmar.de: did not receive HSTS header
-cardelmar.es: did not receive HSTS header
-carding.team: did not receive HSTS header
-cardloan-manual.net: could not connect to host
-cardstream.com: did not receive HSTS header
-cardurl.com: did not receive HSTS header
-cardwars.hu: could not connect to host
-careeraid.in: could not connect to host
-careerdirectionsltd.com: did not receive HSTS header
-careerpower.co.in: could not connect to host
-careerstuds.com: did not receive HSTS header
-carefour.nl: could not connect to host
-careplasticsurgery.com: did not receive HSTS header
-carespot.com: did not receive HSTS header
-carespottravelmedicine.mobi: could not connect to host
-carey.bio: did not receive HSTS header
-carey.li: did not receive HSTS header
-carezzaperu.com: could not connect to host
-cargobay.net: could not connect to host
-cargoio.com: could not connect to host
-caribbeanarthritisfoundation.org: did not receive HSTS header
-carif-idf.net: could not connect to host
-carif-idf.org: could not connect to host
-carinsurance.es: could not connect to host
-cariocacooking.com: did not receive HSTS header
-carlandfaith.com: did not receive HSTS header
-carlislepassionplay.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-carlolly.co.uk: could not connect to host
-carlosalves.info: could not connect to host
-carloshmm.com: could not connect to host
-carloshmm.stream: could not connect to host
-carloshmoreira.com: could not connect to host
-carlosvelezmarketing.com: could not connect to host
-carlovanwyk.com: could not connect to host
-carlsbouncycastlesandhottubs.co.uk: did not receive HSTS header
-carlscatering.com: did not receive HSTS header
-carmelon-digital.com: did not receive HSTS header
-caroleblouin.ca: did not receive HSTS header
-caroli.biz: could not connect to host
-caroli.info: could not connect to host
-carpliyz.com: could not connect to host
-carrando.de: could not connect to host
-carredejardin.com: did not receive HSTS header
-carrentalsathens.com: max-age too low: 0
-carroarmato0.be: did not receive HSTS header
-carrolcountyohioelections.gov: could not connect to host
-carrollservicecompany.com: did not receive HSTS header
-carrosserie-dubois.com: did not receive HSTS header
-carrouselcompany.fr: could not connect to host
-carseatchecks.ca: could not connect to host
-carsforbackpackers.com: could not connect to host
-carsshop.tk: could not connect to host
-carsten.pw: did not receive HSTS header
-carstenfeuls.de: could not connect to host
-cartadeviajes.cl: did not receive HSTS header
-cartadeviajes.co: did not receive HSTS header
-cartadeviajes.com: did not receive HSTS header
-cartadeviajes.com.ar: did not receive HSTS header
-cartadeviajes.com.ve: did not receive HSTS header
-cartadeviajes.de: did not receive HSTS header
-cartadeviajes.ec: did not receive HSTS header
-cartadeviajes.es: did not receive HSTS header
-cartadeviajes.fr: did not receive HSTS header
-cartadeviajes.mx: did not receive HSTS header
-cartadeviajes.pe: did not receive HSTS header
-cartadeviajes.uk: did not receive HSTS header
-cartelcircuit.com: did not receive HSTS header
-cartelloni.roma.it: could not connect to host
-carterorland.com: could not connect to host
-cartesunicef.be: did not receive HSTS header
-cartfilm.tk: could not connect to host
-cartoonhd.cc: did not receive HSTS header
-cartouche-deal.fr: did not receive HSTS header
-carun.us: did not receive HSTS header
-carwashvapeur.be: could not connect to host
-caryefurd.com: could not connect to host
-casa-su.casa: did not receive HSTS header
-casaanastasia.ro: did not receive HSTS header
-casacomcharme.com.br: could not connect to host
-casadellecose.com: could not connect to host
-casaessencias.com.br: could not connect to host
-casajardininsecticidas.com: did not receive HSTS header
-casalborgo.it: could not connect to host
-casalcrevillent.tk: could not connect to host
-casalinghedisperate.ga: could not connect to host
-casamorelli.com.br: did not receive HSTS header
-casashmodel.com: did not receive HSTS header
-casashopp.com.br: could not connect to host
-casasuleletrodomesticos.com.br: could not connect to host
-casedi.org: max-age too low: 0
-casefall.com: could not connect to host
-cash-pos.com: did not receive HSTS header
-cashbackcow.us: could not connect to host
-cashfortulsahouses.com: could not connect to host
-cashless.fr: did not receive HSTS header
-cashlink.de: did not receive HSTS header
-cashlink.io: did not receive HSTS header
-cashmyphone.ch: could not connect to host
-cashsector.ga: could not connect to host
-casino-trio.com: could not connect to host
-casinobonuscodes.online: could not connect to host
-casinoluck.com: did not receive HSTS header
-casinomegaslotos.com: did not receive HSTS header
-casinoonlinesicuri.com: did not receive HSTS header
-casinoreal.com: could not connect to host
-casinostest.com: could not connect to host
-casionova.org: could not connect to host
-casioshop.eu: did not receive HSTS header
-casirus.com: could not connect to host
-casjay.cloud: could not connect to host
-casjay.com: could not connect to host
-casjay.info: did not receive HSTS header
-casjay.us: could not connect to host
-casjaygames.com: could not connect to host
-casovi.cf: could not connect to host
-caspar.ai: did not receive HSTS header
-castagnonavocats.com: did not receive HSTS header
-castalie.tk: could not connect to host
-castellannenberg.com: could not connect to host
-castelodosmoveis.com.br: did not receive HSTS header
-casteloinformatica.com.br: could not connect to host
-castlejackpot.com: did not receive HSTS header
-castlemail.io: max-age too low: 30000
-castleoblivion.tk: could not connect to host
-castles4rascalsiow.co.uk: did not receive HSTS header
-casualgaming.no: max-age too low: 0
-casusgrillcaribbean.com: could not connect to host
-cat-blum.com: could not connect to host
-cat-box.de: max-age too low: 0
-cata.ga: could not connect to host
-catalin.pw: could not connect to host
-catalogoreina.com: did not receive HSTS header
-catalojic.tk: could not connect to host
-catarsisvr.com: could not connect to host
-catchfotografie.nl: could not connect to host
-catcontent.cloud: could not connect to host
-catdecor.ru: did not receive HSTS header
-catenariadiscos.com: did not receive HSTS header
-caterkids.com: could not connect to host
-catgirl.me: could not connect to host
-catgirl.pics: could not connect to host
-catharisme.net: could not connect to host
-catharisme.org: could not connect to host
-catherinesarasin.com: did not receive HSTS header
-catherinescastles.co.uk: did not receive HSTS header
-catherinesofpartick.co.uk: did not receive HSTS header
-cathosting.org: could not connect to host
-catinmay.com: could not connect to host
-catmoz.fr: did not receive HSTS header
-catnapstudios.com: could not connect to host
-catnmeow.com: could not connect to host
-catprog.org: did not receive HSTS header
-catsmagic.pp.ua: could not connect to host
-catuniverse.org: could not connect to host
-caudo.net: did not receive HSTS header
-caulong-ao.net: could not connect to host
-causae-fincas.es: did not receive HSTS header
-causae.es: did not receive HSTS header
-cavaleria.ro: did not receive HSTS header
-cavalierkingcharlesspaniel.com.br: could not connect to host
-cave-reynard.ch: could not connect to host
-caveclan.org: did not receive HSTS header
-cavecreekaz.gov: did not receive HSTS header
-cavedevs.de: could not connect to host
-cavedroid.xyz: could not connect to host
-cavevinsdefrance.fr: did not receive HSTS header
-cayafashion.de: did not receive HSTS header
-cayounglab.co.jp: could not connect to host
-cbamo.org: did not receive HSTS header
-cbdcontact.pl: could not connect to host
-cbhq.net: could not connect to host
-cbi-epa.gov: could not connect to host
-cbk-connect.com: could not connect to host
-cc-brantomois.fr: did not receive HSTS header
-cc2729.com: did not receive HSTS header
-cc5197.co: could not connect to host
-cc6729.co: could not connect to host
-cc6729.com: did not receive HSTS header
-cc6957.co: could not connect to host
-cc9297.co: could not connect to host
-cc9397.com: could not connect to host
-cc9721.com: could not connect to host
-cc9728.co: could not connect to host
-ccac.gov: max-age too low: 120
-ccayearbook.com: could not connect to host
-ccblog.de: did not receive HSTS header
-ccgn.co: could not connect to host
-cchen.ga: did not receive HSTS header
-ccja.ro: did not receive HSTS header
-cclasabana.com.co: could not connect to host
-ccretreatandfarm.com: did not receive HSTS header
-ccsource.org: could not connect to host
-ccss-cces.com: did not receive HSTS header
-ccsys.com: could not connect to host
-cctech.ph: could not connect to host
-cctld.com: could not connect to host
-cctvcanada.net: could not connect to host
-ccu.io: could not connect to host
-ccv-deutschland.de: did not receive HSTS header
-ccv.ch: did not receive HSTS header
-ccv.eu: did not receive HSTS header
-ccv.nl: did not receive HSTS header
-cd0.us: could not connect to host
-cda-nw.co.uk: did not receive HSTS header
-cdcpartners.gov: could not connect to host
-cdeck.net: could not connect to host
-cdlcenter.com: could not connect to host
-cdmhp.org.nz: could not connect to host
-cdmlb.net: could not connect to host
-cdmon.tech: could not connect to host
-cdn.sx.cn: could not connect to host
-cdnb.co: could not connect to host
-cdndepo.com: could not connect to host
-cdnk39.com: could not connect to host
-cdreporting.co.uk: did not receive HSTS header
-cdshh.club: did not receive HSTS header
-cdt.org: did not receive HSTS header
-cdu-wilgersdorf.de: did not receive HSTS header
-cduckett.net: could not connect to host
-ceagriproducts.com: did not receive HSTS header
-cecilga.gov: could not connect to host
-cecipu.gob.cl: could not connect to host
-ced-services.nl: could not connect to host
-cee.io: could not connect to host
-cefak.org.br: did not receive HSTS header
-cegfw.com: could not connect to host
-ceilingpac.org: could not connect to host
-cekaja.com: did not receive HSTS header
-celebalita.com: could not connect to host
-celebphotos.blog: could not connect to host
-celebphotos.club: could not connect to host
-celectro-pro.com: could not connect to host
-celeirorural.com.br: did not receive HSTS header
-celeraindustries.tk: did not receive HSTS header
-celigo.com: did not receive HSTS header
-celina-reads.de: could not connect to host
-cellsheet.me: could not connect to host
-cellsites.nz: could not connect to host
-celluliteorangeskin.com: could not connect to host
-celluliteremovaldiet.com: could not connect to host
-celuliteonline.com: could not connect to host
-cem.pw: did not receive HSTS header
-cemeteriat.com: did not receive HSTS header
-cencalvia.org: could not connect to host
-centa-am.com: did not receive HSTS header
-centillien.com: did not receive HSTS header
-centision.com: did not receive HSTS header
-central4.me: could not connect to host
-centralconvergence.com: did not receive HSTS header
-centralcountiesservices.org: did not receive HSTS header
-centralhealthplan.com: did not receive HSTS header
-centrallead.net: could not connect to host
-centrallotus.com: did not receive HSTS header
-centralmarket.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-centralvacsunlimited.net: could not connect to host
-centralvoice.org: could not connect to host
-centralync.com: could not connect to host
-centre-momboye.fr: did not receive HSTS header
-centrepoint-community.com: could not connect to host
-centretownshipin.gov: did not receive HSTS header
-centricagency.co.uk: could not connect to host
-centrodoinstalador.com.br: could not connect to host
-centromasterin.com: could not connect to host
-centrumpieknairelaksu.pl: could not connect to host
-centrym.top: could not connect to host
-centsforchange.net: could not connect to host
-centsi.io: did not receive HSTS header
-centumail.com: could not connect to host
-centurion-consulting-cie.eu: could not connect to host
-centurion-consulting.eu: did not receive HSTS header
-centurionunderground.com: could not connect to host
-century-group.com: max-age too low: 2592000
-ceoimon.com: did not receive HSTS header
-ceoptique.com: did not receive HSTS header
-ceramica.roma.it: could not connect to host
-cercevelet.com: did not receive HSTS header
-cerebelo.info: could not connect to host
-ceredowv.gov: did not receive HSTS header
-ceres1.space: did not receive HSTS header
-ceresia.ch: could not connect to host
-ceritamalam.net: could not connect to host
-cerize.love: could not connect to host
-cernakova.eu: could not connect to host
-cernega.ro: did not receive HSTS header
-cerpa.com.br: did not receive HSTS header
-cerstve-korenie.sk: did not receive HSTS header
-cerstvekorenie.sk: did not receive HSTS header
-cert.or.id: did not receive HSTS header
-cert.se: max-age too low: 2628001
-certcenter.fr: did not receive HSTS header
-certifi.io: did not receive HSTS header
-certificatespending.com: could not connect to host
-certifiedfieldassociate.com: could not connect to host
-certifix.eu: did not receive HSTS header
-certly.io: did not receive HSTS header
-certmgr.org: could not connect to host
-ceruleanmainbeach.com.au: did not receive HSTS header
-cesal.net: could not connect to host
-cesantias.co: did not receive HSTS header
-cesboard.com: could not connect to host
-cesidianroot.eu: could not connect to host
-cesium.ml: could not connect to host
-ceskaexpedice.co.uk: did not receive HSTS header
-cespri.com.pe: could not connect to host
-cestunmetier.ch: could not connect to host
-ceta.one: could not connect to host
-cetangarana.com: did not receive HSTS header
-cevrimici.com: could not connect to host
-ceyizlikelisleri.com: did not receive HSTS header
-ceylavi.tech: did not receive HSTS header
-cf-tm.net: could not connect to host
-cf11.de: did not receive HSTS header
-cfa.gov: did not receive HSTS header
-cfan.space: could not connect to host
-cfcnexus.org: could not connect to host
-cfcproperties.com: did not receive HSTS header
-cfetengineering.com: could not connect to host
-cfneia.org: did not receive HSTS header
-cfoitplaybook.com: could not connect to host
-cfttt.com: could not connect to host
-cfurl.cf: could not connect to host
-cgan.pw: could not connect to host
-cganx.org: could not connect to host
-cgbilling.com: did not receive HSTS header
-cgerstner.eu: did not receive HSTS header
-cglib.xyz: could not connect to host
-cgminc.net: could not connect to host
-cgsshelper.tk: could not connect to host
-cgtx.us: could not connect to host
-ch-sc.de: did not receive HSTS header
-chabaojia.com: could not connect to host
-chadklass.com: could not connect to host
-chadtaljaardt.com: could not connect to host
-chahub.com: could not connect to host
-chainedunion.info: could not connect to host
-chainmonitor.com: could not connect to host
-chairinstitute.com: did not receive HSTS header
-chaitanyapandit.com: did not receive HSTS header
-chaizhikang.com: could not connect to host
-chaldeen.pro: did not receive HSTS header
-chalker.io: did not receive HSTS header
-challengeblog.org: did not receive HSTS header
-challengeclothing.com.br: could not connect to host
-challengeskins.com: could not connect to host
-challstrom.com: could not connect to host
-chamathellawala.com: did not receive HSTS header
-chameleon-ents.co.uk: could not connect to host
-chamicro.com: could not connect to host
-chamilo.org: did not receive HSTS header
-champ.dog: did not receive HSTS header
-championnat-romand-cuisiniers-amateurs.ch: could not connect to host
-championsofregnum.com: did not receive HSTS header
-chancat.blog: could not connect to host
-chandlerredding.com: could not connect to host
-chandr1000.ga: could not connect to host
-chang-feng.info: could not connect to host
-changecopyright.ru: did not receive HSTS header
-changethislater.com: could not connect to host
-changetip.com: could not connect to host
-changinglivestoday.org: did not receive HSTS header
-channeladam.com: did not receive HSTS header
-channelcards.com: did not receive HSTS header
-channellife.asia: did not receive HSTS header
-channellife.co.nz: did not receive HSTS header
-channellife.com.au: did not receive HSTS header
-channyc.com: could not connect to host
-channydraws.com: could not connect to host
-chanoyu-gakkai.jp: did not receive HSTS header
-chaos-inc.de: did not receive HSTS header
-chaos.fail: could not connect to host
-chaoslab.org: did not receive HSTS header
-chaosriftgames.com: did not receive HSTS header
-chaotichive.com: could not connect to host
-chaoticlaw.com: did not receive HSTS header
-chaouby.com: could not connect to host
-chapelaria.tf: could not connect to host
-chapstick.life: could not connect to host
-charakato.com: could not connect to host
-chardik.tk: could not connect to host
-chargedmonkey.com: did not receive HSTS header
-chargejuice.com: could not connect to host
-chargersdirect.com.au: did not receive HSTS header
-charissadescande.com: could not connect to host
-charityclear.com: did not receive HSTS header
-charitystreet.co.uk: did not receive HSTS header
-charl.eu: could not connect to host
-charlenevondell.com: could not connect to host
-charlesjay.com: did not receive HSTS header
-charlesmilette.net: did not receive HSTS header
-charlesstover.com: did not receive HSTS header
-charlestonsecuritysystems.net: did not receive HSTS header
-charliemcneive.com: could not connect to host
-charlimarie.com: did not receive HSTS header
-charlipopkids.com.au: did not receive HSTS header
-charlotte-touati.ch: could not connect to host
-charlottecountyva.gov: could not connect to host
-charonsecurity.com: could not connect to host
-charp.eu: could not connect to host
-charr.xyz: could not connect to host
-chars.ga: could not connect to host
-chartkick.com: did not receive HSTS header
-chartstoffarm.de: did not receive HSTS header
-charuru.moe: could not connect to host
-chaseandzoey.de: could not connect to host
-chaseganey.com: did not receive HSTS header
-chasing-coins.com: did not receive HSTS header
-chaska.co.za: could not connect to host
-chasse-et-plaisir.com: did not receive HSTS header
-chat-love.org: could not connect to host
-chat2.cf: could not connect to host
-chat36.ga: could not connect to host
-chatbot.me: did not receive HSTS header
-chatbot.one: could not connect to host
-chatbotclic.com: could not connect to host
-chatbotclick.com: could not connect to host
-chatbots.email: could not connect to host
-chateau-belvoir.com: could not connect to host
-chateauconstellation.ch: did not receive HSTS header
-chateaudevaugrigneuse.com: did not receive HSTS header
-chatint.com: could not connect to host
-chatme.im: could not connect to host
-chatnbook.com: could not connect to host
-chatup.cf: did not receive HSTS header
-chaulootz.com: could not connect to host
-chaverde.org: could not connect to host
-chaz6.com: did not receive HSTS header
-chazay.net: could not connect to host
-chazgie.se: did not receive HSTS header
-chbk.co: did not receive HSTS header
-chc9912.com: max-age too low: 0
-chcemvediet.sk: max-age too low: 1555200
-chci-web.cz: max-age too low: 0
-chdgaming.xyz: could not connect to host
-cheah.xyz: did not receive HSTS header
-cheapalarmparts.com.au: did not receive HSTS header
-cheapautoinsuranceblog.com: could not connect to host
-cheapdns.org: could not connect to host
-cheapestgamecards.de: could not connect to host
-cheapestgamecards.se: could not connect to host
-cheapmedrol.ga: could not connect to host
-cheapnhljerseys.cc: max-age too low: 0
-cheazey.co: did not receive HSTS header
-chebedara.com: could not connect to host
-chebwebb.com: could not connect to host
-checalaweb.com: could not connect to host
-checkecert.nl: could not connect to host
-checkhost.org: could not connect to host
-checkjelinkje.nl: did not receive HSTS header
-checkmateshoes.com: did not receive HSTS header
-checkmyessays.com: did not receive HSTS header
-checkout.google.com: could not connect to host (error ignored - included regardless)
-checkpoint.com: did not receive HSTS header
-checkras.tk: could not connect to host
-checkrente.nl: could not connect to host
-checktechnology.com.au: did not receive HSTS header
-checkyourmeds.com: did not receive HSTS header
-checookies.com: could not connect to host
-cheekylittlerascals.co.uk: could not connect to host
-cheerflow.com: could not connect to host
-cheesefusion.com: could not connect to host
-cheesehosting.net: did not receive HSTS header
-cheesetart.my: could not connect to host
-cheesypicsbooths.co.uk: could not connect to host
-cheetah85.de: could not connect to host
-cheez.systems: could not connect to host
-chefgalles.com.br: could not connect to host
-chefwear.com: did not receive HSTS header
-chejianer.cn: could not connect to host
-chelema.xyz: could not connect to host
-chellame.com: could not connect to host
-chellame.fr: could not connect to host
-chelpipe.ru: did not receive HSTS header
-cheltenhambounce.co.uk: could not connect to host
-chemical-shark.de: did not receive HSTS header
-chemicalguys-ruhrpott.de: could not connect to host
-chen22311.com: max-age too low: 0
-chenfengyi.com: could not connect to host
-chengarda.com: could not connect to host
-chenghao360.top: could not connect to host
-chengtongled.com: could not connect to host
-chensir.net: could not connect to host
-chentianyi.cn: could not connect to host
-cheolguso.com: did not receive HSTS header
-chepaofen.com: did not receive HSTS header
-cherekerry.com: could not connect to host
-cherevoiture.com: could not connect to host
-chernevclima.bg: did not receive HSTS header
-cherrydropscandycarts.co.uk: could not connect to host
-cherylsoleway.com: did not receive HSTS header
-chesscoders.com: did not receive HSTS header
-chessreporter.nl: did not receive HSTS header
-chesterbrass.uk: did not receive HSTS header
-chesterman.tk: could not connect to host
-chiamata-aiuto.ch: could not connect to host
-chiangmaimontessori.com: could not connect to host
-chiaraiuola.com: could not connect to host
-chiaramail.com: could not connect to host
-chib.chat: could not connect to host
-chicagostudentactivists.org: could not connect to host
-chicguay.com: did not receive HSTS header
-chicorycom.net: did not receive HSTS header
-chifumi.net: did not receive HSTS header
-chihiro.xyz: did not receive HSTS header
-chijiokeindustries.co.uk: could not connect to host
-chikan-beacon.net: could not connect to host
-chikatomo-ryugaku.com: did not receive HSTS header
-chikory.com: could not connect to host
-chiksfashion.com: did not receive HSTS header
-childcaresolutionscny.org: did not receive HSTS header
-childrendeservebetter.org: could not connect to host
-childwelfare.gov: did not receive HSTS header
-chilimathwords.com: did not receive HSTS header
-chillebever.nl: could not connect to host
-chilli943.info: did not receive HSTS header
-chimparoo.ca: did not receive HSTS header
-china-dhl.org: could not connect to host
-china-line.org: could not connect to host
-chinacdn.org: could not connect to host
-chinastory.tk: could not connect to host
-chinatrademarkoffice.com: did not receive HSTS header
-chinawhale.com: could not connect to host
-chinookwebdesign.ca: could not connect to host
-chint.ai: could not connect to host
-chinternet.xyz: could not connect to host
-chipglobe.com: did not receive HSTS header
-chiphell.com: did not receive HSTS header
-chips-scheduler.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-chirgui.eu: could not connect to host
-chispita.tk: could not connect to host
-chitinfo.tk: could not connect to host
-chk-ccs.com: did not receive HSTS header
-chloca.jp: could not connect to host
-chloe.re: could not connect to host
-chloeallison.co.uk: could not connect to host
-chloehorler.com: could not connect to host
-chlouis.net: could not connect to host
-chm.vn: did not receive HSTS header
-chmurakotori.ml: could not connect to host
-choc-o-lush.co.uk: could not connect to host
-chocolate13tilias.com.br: did not receive HSTS header
-chocotough.nl: did not receive HSTS header
-chodobien.com: could not connect to host
-chodocu.com: did not receive HSTS header
-choe.fi: could not connect to host
-choiceautoloan.com: could not connect to host
-choiralberta.ca: did not receive HSTS header
-choisirmonerp.com: did not receive HSTS header
-chokladfantasi.net: could not connect to host
-chollima.pro: could not connect to host
-chon.io: did not receive HSTS header
-chonghe.org: could not connect to host
-chontalpa.pw: could not connect to host
-choootto.club: could not connect to host
-chopperforums.com: could not connect to host
-chordso.com: could not connect to host
-chorkley.co.uk: could not connect to host
-chorkley.com: could not connect to host
-chorkley.me: could not connect to host
-chorkley.uk: could not connect to host
-chorleiterverband.de: did not receive HSTS header
-choruscrowd.com: could not connect to host
-chotlo.com: did not receive HSTS header
-chotu.net: could not connect to host
-chowii.com: could not connect to host
-chr0me.sh: could not connect to host
-chris-web.info: could not connect to host
-chrisandsarahinasia.com: could not connect to host
-chrisb.me: did not receive HSTS header
-chrisb.xyz: did not receive HSTS header
-chrisbrakebill.com: did not receive HSTS header
-chrisbrown.id.au: did not receive HSTS header
-chriscowley.me.uk: did not receive HSTS header
-chrisebert.net: could not connect to host
-chrisfaber.com: could not connect to host
-chriskirchner.de: did not receive HSTS header
-chriskyrouac.com: could not connect to host
-chrisluen.com: could not connect to host
-chrisopperwall.com: could not connect to host
-chrisself.xyz: could not connect to host
-christchurchbouncycastles.co.uk: could not connect to host
-christerwaren.fi: did not receive HSTS header
-christiaandruif.nl: could not connect to host
-christian-krug.website: did not receive HSTS header
-christianbro.gq: could not connect to host
-christianhoffmann.info: did not receive HSTS header
-christianhospitaltank.org: did not receive HSTS header
-christianpeltier.com: did not receive HSTS header
-christiansayswords.com: could not connect to host
-christianscholz.eu: did not receive HSTS header
-christielepage.com: did not receive HSTS header
-christina-quast.de: did not receive HSTS header
-christophebarbezat.ch: could not connect to host
-christophercolumbusfoundation.gov: could not connect to host
-christopherl.com: did not receive HSTS header
-christopherpritchard.co.uk: could not connect to host
-christophersole.com: could not connect to host
-christophheich.me: did not receive HSTS header
-christophkreileder.com: could not connect to host
-christwaycounseling.com: did not receive HSTS header
-chrisupjohn.com: could not connect to host
-chrisupjohn.xyz: could not connect to host
-chrisvannooten.tk: could not connect to host
-chrisvicmall.com: did not receive HSTS header
-chriswbarry.com: did not receive HSTS header
-chrixonline.tk: could not connect to host
-chromaryu.net: could not connect to host
-chrome: could not connect to host
-chrome-devtools-frontend.appspot.com: did not receive HSTS header (error ignored - included regardless)
-chrome.google.com: did not receive HSTS header (error ignored - included regardless)
-chromereporting-pa.googleapis.com: did not receive HSTS header (error ignored - included regardless)
-chromiumbugs.appspot.com: did not receive HSTS header (error ignored - included regardless)
-chronic101.xyz: could not connect to host
-chrono-ski-aravis.fr: did not receive HSTS header
-chronogram.me: could not connect to host
-chronoproject.com: did not receive HSTS header
-chrst.ph: could not connect to host
-chsh.moe: could not connect to host
-chua.cf: did not receive HSTS header
-chua.family: did not receive HSTS header
-chuckame.fr: did not receive HSTS header
-chulado.com: did not receive HSTS header
-chun.si: did not receive HSTS header
-chundelac.com: could not connect to host
-churchlinkpro.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-churchux.co: could not connect to host
-churrasqueirafacil.com.br: could not connect to host
-chuvashia.tk: could not connect to host
-chxdf.net: did not receive HSTS header
-chybeck.net: did not receive HSTS header
-ci5.me: could not connect to host
-ciania.pl: could not connect to host
-cianmawhinney.xyz: could not connect to host
-ciansc.com: could not connect to host
-cica.es: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-ciclista.roma.it: could not connect to host
-cidadedopoker.com.br: did not receive HSTS header
-cidr.ml: could not connect to host
-ciel.pro: could not connect to host
-cienbeaute-lidl.fr: did not receive HSTS header
-ciftlikesintisi.com: could not connect to host
-cigarblogs.net: could not connect to host
-cigi.site: could not connect to host
-ciiex.co: could not connect to host
-ciliberto.org: did not receive HSTS header
-cim2b.de: could not connect to host
-cimalando.eu: could not connect to host
-cinartelorgu.com: did not receive HSTS header
-cinay.pw: could not connect to host
-cindey.io: could not connect to host
-cinefilia.tk: could not connect to host
-cinelite.club: could not connect to host
-cinema5.ru: did not receive HSTS header
-cinemaclub.co: could not connect to host
-cinemadoma.tk: could not connect to host
-cinenote.link: did not receive HSTS header
-ciner.is: could not connect to host
-cinerama.com.br: could not connect to host
-cinicloud.com: did not receive HSTS header
-cinq-elements.fr: could not connect to host
-cinq-elements.net: could not connect to host
-cintdirect.com: could not connect to host
-cinteo.com: could not connect to host
-cio.guide: did not receive HSTS header
-cioconference.co.nz: could not connect to host
-cipher.co.th: did not receive HSTS header
-cipher.land: did not receive HSTS header
-cipherli.st: did not receive HSTS header
-ciplanutrition.com: did not receive HSTS header
-cipriano.nl: could not connect to host
-cira.email: could not connect to host
-circ-logic.com: did not receive HSTS header
-circlebox.rocks: could not connect to host
-cirfi.com: could not connect to host
-cirope.com: did not receive HSTS header
-cirrohost.com: did not receive HSTS header
-cirugiasplasticas.com.mx: did not receive HSTS header
-cirujanooral.com: could not connect to host
-cirurgicasalutar.com.br: could not connect to host
-ciscohomeanalytics.com: could not connect to host
-ciscommerce.net: could not connect to host
-citadelnet.works: could not connect to host
-citationgurus.com: could not connect to host
-citiagent.cz: could not connect to host
-citizen-cam.de: did not receive HSTS header
-citizenslasvegas.com: could not connect to host
-citizenspact.eu: did not receive HSTS header
-citra-emu.org: did not receive HSTS header
-citroner.blog: did not receive HSTS header
-city-forums.ml: could not connect to host
-citya.com: did not receive HSTS header
-citybusexpress.com: did not receive HSTS header
-cityofarcolatx.gov: could not connect to host
-cityofeastpointemi.gov: could not connect to host
-cityoflaurel.org: did not receive HSTS header
-cityofmadera.gov: did not receive HSTS header
-cityofwadley-ga.gov: did not receive HSTS header
-cityofwoodward-ok.gov: did not receive HSTS header
-citywalkr.com: could not connect to host
-ciubotaru.tk: could not connect to host
-ciuciucadou.ro: could not connect to host
-ciudadanosbo.com: could not connect to host
-cium.ru: could not connect to host
-ciurcasdan.eu: did not receive HSTS header
-civicunicorn.com: could not connect to host
-civicunicorn.us: could not connect to host
-cjcaron.org: could not connect to host
-cjean.fr: could not connect to host
-cjessett.com: max-age too low: 0
-cjtkfan.club: could not connect to host
-ckleemann.de: could not connect to host
-ckrubble.co.za: did not receive HSTS header
-cl0ud.space: could not connect to host
-clacetandil.com.ar: could not connect to host
-clad.cf: could not connect to host
-claibornecountytn.gov: could not connect to host
-claimit.ml: could not connect to host
-clamofon.com: did not receive HSTS header
-clan-ww.com: could not connect to host
-clangwarnings.com: could not connect to host
-clanthor.com: did not receive HSTS header
-clapping-rhymes.com: could not connect to host
-clara-baumert.de: could not connect to host
-claraism.com: did not receive HSTS header
-claralabs.com: did not receive HSTS header
-claretandbanter.uk: did not receive HSTS header
-clarity-c2ced.appspot.com: did not receive HSTS header
-claritysrv.com: did not receive HSTS header
-clarkeaward.com: did not receive HSTS header
-clarksburgma.gov: did not receive HSTS header
-clarksgaragedoorrepair.com: did not receive HSTS header
-clarkwifi.com: did not receive HSTS header
-clashersrepublic.com: could not connect to host
-classic-yacht-charters.com: did not receive HSTS header
-classical-guitar-school.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-classicday.nl: could not connect to host
-classicsandexotics.com: could not connect to host
-classicshop.ua: did not receive HSTS header
-classicspublishing.com: could not connect to host
-classifiedssa.co.za: could not connect to host
-claude.tech: could not connect to host
-claudearpel.fr: did not receive HSTS header
-claudiney.eti.br: could not connect to host
-claudiney.info: could not connect to host
-claudio4.com: did not receive HSTS header
-clausewitz-gesellschaft.de: did not receive HSTS header
-clayelections.gov: could not connect to host
-claytoncondon.com: could not connect to host
-claytonstowing.com.au: did not receive HSTS header
-clcleaningco.com: could not connect to host
-cldfile.com: could not connect to host
-cleanbeautymarket.com.au: did not receive HSTS header
-cleancode.club: could not connect to host
-cleanexperts.co.uk: could not connect to host
-cleanfiles.us: could not connect to host
-cleaningbyrosie.com: did not receive HSTS header
-cleanmta.com: could not connect to host
-cleansewellness.com: could not connect to host
-cleanstar.org: did not receive HSTS header
-clear.ml: could not connect to host
-clearc.tk: could not connect to host
-clearchatsandbox.com: could not connect to host
-clearer.cloud: could not connect to host
-clearsettle-admin.com: did not receive HSTS header
-clearsky.me: did not receive HSTS header
-clearspringhealthcare.com: did not receive HSTS header
-clearviewwealthprojector.com.au: could not connect to host
-clemovementlaw.com: could not connect to host
-clerkendweller.uk: could not connect to host
-clevelandokla.com: could not connect to host
-clic-et-site.com: could not connect to host
-clic-music.com: could not connect to host
-clicecompre.com.br: could not connect to host
-clich.cn: did not receive HSTS header
-click-2-order.co.uk: did not receive HSTS header
-clickandgo.com: did not receive HSTS header
-clickandshoot.nl: could not connect to host
-clickclock.cc: could not connect to host
-clickforclever.com: did not receive HSTS header
-clickforum.cf: could not connect to host
-clickgram.biz: could not connect to host
-clickomobile.com: did not receive HSTS header
-clickphobia.ga: could not connect to host
-clicks.co.za: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-clicktenisdemesa.com.br: did not receive HSTS header
-clicn.bio: could not connect to host
-clicnbio.com: did not receive HSTS header
-cliftons.com: did not receive HSTS header
-climaencusco.com: could not connect to host
-climaticarus.ru: did not receive HSTS header
-climed.com.tr: did not receive HSTS header
-clinchcountyga.gov: did not receive HSTS header
-clingout.com: could not connect to host
-clinia.ca: did not receive HSTS header
-clinicaferrusbratos.com: did not receive HSTS header
-clinicasilos.com: did not receive HSTS header
-cliniko.com: did not receive HSTS header
-cliniquecomplementaire.com: could not connect to host
-clintonbloodworth.com: could not connect to host
-clintonbloodworth.io: could not connect to host
-clintonplasticsurgery.com: did not receive HSTS header
-clintwilson.technology: max-age too low: 2592000
-clipped4u.com: could not connect to host
-clipperses.tk: could not connect to host
-clite.ru: did not receive HSTS header
-clnet.com.au: did not receive HSTS header
-cloaked.ch: could not connect to host
-clochix.net: could not connect to host
-clod-hacking.com: did not receive HSTS header
-cloghercastles.co.uk: could not connect to host
-clojurescript.ru: could not connect to host
-cloppenburg-autmobil.com: could not connect to host
-cloppenburg-automobil.com: could not connect to host
-clorik.com: could not connect to host
-closient.com: could not connect to host
-closingholding.com: could not connect to host
-cloturea.fr: did not receive HSTS header
-cloud-crowd.com.au: did not receive HSTS header
-cloud-project.com: could not connect to host
-cloud.wtf: could not connect to host
-cloud2go.de: could not connect to host
-cloud58.org: could not connect to host
-cloudalice.com: could not connect to host
-cloudalice.net: could not connect to host
-cloudapi.vc: could not connect to host
-cloudbased.info: could not connect to host
-cloudbasedsite.com: did not receive HSTS header
-cloudberlin.goip.de: could not connect to host
-cloudbleed.info: could not connect to host
-cloudbreaker.de: could not connect to host
-cloudchart.site: could not connect to host
-cloudcloudcloud.cloud: could not connect to host
-cloudconsulting.net.za: did not receive HSTS header
-cloudconsulting.org.za: did not receive HSTS header
-cloudconsulting.web.za: did not receive HSTS header
-cloudcy.net: could not connect to host
-clouddesktop.co.nz: could not connect to host
-cloudfren.com: could not connect to host
-cloudimag.es: could not connect to host
-cloudimproved.com: could not connect to host
-cloudimprovedtest.com: could not connect to host
-cloudkit.pro: did not receive HSTS header
-cloudland.club: could not connect to host
-cloudlink.club: did not receive HSTS header
-cloudmigrator365.com: did not receive HSTS header
-cloudns.com.au: did not receive HSTS header
-cloudopt.net: did not receive HSTS header
-cloudpagesforwork.com: did not receive HSTS header
-cloudpebble.net: did not receive HSTS header
-clouds.webcam: could not connect to host
-cloudsecurityalliance-europe.org: could not connect to host
-cloudsharp.io: could not connect to host
-cloudsocial.io: could not connect to host
-cloudspeedy.net: could not connect to host
-cloudspotterapp.com: did not receive HSTS header
-cloudsprt.com: did not receive HSTS header
-cloudstoragemaus.com: could not connect to host
-cloudstorm.me: could not connect to host
-cloudstrike.co: could not connect to host
-cloudtskr.com: could not connect to host
-cloudwalk.io: did not receive HSTS header
-cloudwarez.xyz: could not connect to host
-cloudwellmarketing.com: could not connect to host
-cloudwise.nl: did not receive HSTS header
-clounix.online: could not connect to host
-clovissantos.com: could not connect to host
-clowde.in: could not connect to host
-clownaroundbouncycastles.co.uk: could not connect to host
-clownish.co.il: could not connect to host
-clr3.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-clsimplex.com: did not receive HSTS header
-club-corsicana.de: did not receive HSTS header
-club-is.ru: did not receive HSTS header
-clubcall.com: did not receive HSTS header
-clubdeslecteurs.net: could not connect to host
-clubedalutashop.com: did not receive HSTS header
-clubmate.rocks: could not connect to host
-clubmix.co.kr: could not connect to host
-clubscannan.ie: did not receive HSTS header
-cluj.apartments: could not connect to host
-cluj.help: could not connect to host
-clush.pw: could not connect to host
-cluster.id: could not connect to host
-clusteranalyse.net: could not connect to host
-clustermaze.net: could not connect to host
-clvrwebdesign.com: could not connect to host
-clvs7.com: did not receive HSTS header
-clweb.ch: did not receive HSTS header
-clycat.ru: could not connect to host
-clywedogmaths.co.uk: could not connect to host
-cm.center: could not connect to host
-cm3.pw: could not connect to host
-cmahy.be: did not receive HSTS header
-cmangos.net: did not receive HSTS header
-cmc-versand.de: could not connect to host
-cmcc.network: could not connect to host
-cmcelectrical.com: did not receive HSTS header
-cmci.dk: could not connect to host
-cmdtelecom.net.br: could not connect to host
-cmf.qc.ca: could not connect to host
-cmftech.com: could not connect to host
-cmitao.com: could not connect to host
-cmov-plongeurs.fr: did not receive HSTS header
-cmoycontracts.com: could not connect to host
-cmpr.es: did not receive HSTS header
-cmrss.com: could not connect to host
-cms-weble.jp: could not connect to host
-cmsbattle.com: could not connect to host
-cmscafe.ru: did not receive HSTS header
-cmskh.co.uk: could not connect to host
-cmso-cal.com: could not connect to host
-cmusical.es: could not connect to host
-cmweller.com: could not connect to host
-cna-aiic.ca: did not receive HSTS header
-cnam.net: did not receive HSTS header
-cnaprograms.online: could not connect to host
-cnatraining.network: could not connect to host
-cncmachinemetal.com: did not receive HSTS header
-cncn.link: did not receive HSTS header
-cncn.us: did not receive HSTS header
-cnet-hosting.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-cnetw.xyz: could not connect to host
-cnlau.com: could not connect to host
-cnlic.com: could not connect to host
-cnnet.fun: could not connect to host
-cnnet.in: could not connect to host
-cnrd.me: did not receive HSTS header
-cnsyear.com: did not receive HSTS header
-cnwarn.com: did not receive HSTS header
-cnxy.eu.org: did not receive HSTS header
-co-driversphoto.se: did not receive HSTS header
-co-factor.ro: did not receive HSTS header
-co-yutaka.com: could not connect to host
-coa.one: could not connect to host
-coach-sportif.paris: did not receive HSTS header
-coachingconsultancy.com: did not receive HSTS header
-coam.co: could not connect to host
-cobaltlp.com: did not receive HSTS header
-cobcode.com: could not connect to host
-cobrax.net: did not receive HSTS header
-cocaine-import.agency: could not connect to host
-cocbaoan.com: could not connect to host
-coccinellaskitchen.com: could not connect to host
-coccinellaskitchen.de: could not connect to host
-coccinellaskitchen.it: could not connect to host
-cockedey.in: could not connect to host
-cockerspanielamericano.com.br: could not connect to host
-cockerspanielingles.com.br: could not connect to host
-cocktail-shaken.nl: did not receive HSTS header
-cocktailfuture.fr: could not connect to host
-coco-cool.fr: could not connect to host
-cocodemy.com: did not receive HSTS header
-cocolovesdaddy.com: could not connect to host
-cocubes.com: did not receive HSTS header
-cocyou.ooo: could not connect to host
-codabix.net: could not connect to host
-code-35.com: could not connect to host
-code-digsite.com: could not connect to host
-code-golf.io: did not receive HSTS header
-code-judge.tk: could not connect to host
-code.google.com: did not receive HSTS header (error ignored - included regardless)
-codealkemy.co: could not connect to host
-codebreaking.org: could not connect to host
-codeco.pw: could not connect to host
-codecommunity.io: could not connect to host
-codecontrollers.de: could not connect to host
-codedynasty.com: could not connect to host
-codeforce.io: could not connect to host
-codefordus.de: could not connect to host
-codeforhakodate.org: did not receive HSTS header
-codejunkie.de: could not connect to host
-codeknights.com: did not receive HSTS header
-codelayer.ca: could not connect to host
-codelitmus.com: did not receive HSTS header
-codeloop.pw: could not connect to host
-codelove.de: did not receive HSTS header
-codemonkeyrawks.net: could not connect to host
-codemperium.com: could not connect to host
-codenlife.kr: could not connect to host
-codenlife.xyz: could not connect to host
-codeofhonor.tech: could not connect to host
-codeplay.org: did not receive HSTS header
-codepoet.de: could not connect to host
-codeproxy.ddns.net: could not connect to host
-codepult.com: did not receive HSTS header
-codepx.com: could not connect to host
-codera.co.uk: could not connect to host
-codercross.com: could not connect to host
-codercy.com: could not connect to host
-coderhangout.com: could not connect to host
-coderme.com: did not receive HSTS header
-codersatlas.co: could not connect to host
-codersatlas.com: could not connect to host
-codersatlas.xyz: could not connect to host
-codersbase.org: could not connect to host
-codersbistro.com: did not receive HSTS header
-codesplain.in: could not connect to host
-codestep.io: could not connect to host
-codesyncro.com: did not receive HSTS header
-codewiththepros.org: could not connect to host
-codewiz.xyz: could not connect to host
-codific.eu: did not receive HSTS header
-coding.net: did not receive HSTS header
-codingfromhell.net: did not receive HSTS header
-codinglogs.com: did not receive HSTS header
-coecrafters.com: could not connect to host
-coentropic.com: could not connect to host
-coesor.fr: max-age too low: 2592000
-coeurdesushi.com: max-age too low: 2592000
-coffeedino.com: did not receive HSTS header
-coffeeetc.co.uk: could not connect to host
-coffeetocode.me: could not connect to host
-coffeist.com: could not connect to host
-cogilog.com: could not connect to host
-coginti.tk: could not connect to host
-cogniflex.com: could not connect to host
-cognixia.com: did not receive HSTS header
-cognixia.us: did not receive HSTS header
-cogumelosmagicos.org: could not connect to host
-cohesive.io: could not connect to host
-coi-verify.com: did not receive HSTS header
-coin-exchange.cz: could not connect to host
-coinbit.trade: could not connect to host
-coincoele.com.br: could not connect to host
-coindam.com: could not connect to host
-coindatabase.net: did not receive HSTS header
-coindesfilles.fr: did not receive HSTS header
-coinessa.com: could not connect to host
-coinjar-sandbox.com: could not connect to host
-coins2001.ru: could not connect to host
-coisabakana.com.br: could not connect to host
-colapsys.net: did not receive HSTS header
-colarelli.ch: could not connect to host
-coldaddy.com: could not connect to host
-coldlostsick.net: did not receive HSTS header
-coldwatericecream.com: did not receive HSTS header
-colearnr.com: could not connect to host
-colectivointerconductual.com: could not connect to host
-colectivos.org: did not receive HSTS header
-coleg.gov: could not connect to host
-colincampbell.me: did not receive HSTS header
-colinchartier.com: could not connect to host
-collablynk.com: did not receive HSTS header
-collabra.email: did not receive HSTS header
-collard.tk: could not connect to host
-collare.com.mx: could not connect to host
-collbox.co: did not receive HSTS header
-collectfood.com: could not connect to host
-collectosaurus.com: could not connect to host
-colleencornez.com: could not connect to host
-collegepulse.org: could not connect to host
-collegesecretary.cn: could not connect to host
-collegesecretary.com: could not connect to host
-colley.tk: could not connect to host
-collinghammethodist.org.uk: did not receive HSTS header
-collins.kg: could not connect to host
-collins.press: could not connect to host
-collinsartworks.com: did not receive HSTS header
-collision.fyi: could not connect to host
-colmexpro.com: did not receive HSTS header
-colo-tech.com: could not connect to host
-colognegaming.net: could not connect to host
-coloppe.com: could not connect to host
-coloradobluebook.gov: could not connect to host
-coloradocomputernetworking.net: could not connect to host
-coloraid.net: could not connect to host
-colorcentertoner.com.br: did not receive HSTS header
-colorguni.com: could not connect to host
-colorunhas.com.br: could not connect to host
-colotimes.com: could not connect to host
-colpatriaws.azurewebsites.net: could not connect to host
-coltonrb.com: could not connect to host
-columbiacountyor.gov: did not receive HSTS header
-columbusks.gov: could not connect to host
-com-news.io: could not connect to host
-comandofilmes.club: could not connect to host
-combatircelulitis.com: could not connect to host
-combatshield.cz: did not receive HSTS header
-combattrecellulite.com: could not connect to host
-comchezmeme.com: could not connect to host
-come2cook.com: did not receive HSTS header
-comefollowme2016.com: could not connect to host
-comeoncolleen.com: did not receive HSTS header
-comeoneileen.tk: could not connect to host
-comercialdragon.com: did not receive HSTS header
-cometbot.cf: could not connect to host
-cometrueunlimited.com: could not connect to host
-comevius.com: could not connect to host
-comevius.org: could not connect to host
-comevius.xyz: could not connect to host
-comeyegroup.com: could not connect to host
-comfortdom.ua: did not receive HSTS header
-comfortticket.de: did not receive HSTS header
-comfun.net: could not connect to host
-comfy.moe: could not connect to host
-comfypc.com: could not connect to host
-comico.info: could not connect to host
-comicrelief.com: did not receive HSTS header
-comicspines.com: could not connect to host
-comidasperuanas.net: did not receive HSTS header
-comiq.io: could not connect to host
-comitesaustria.at: could not connect to host
-comiteshopping.com: could not connect to host
-commania.co.kr: could not connect to host
-commencepayments.com: did not receive HSTS header
-commerciallocker.com: could not connect to host
-commercialplanet.eu: could not connect to host
-commune-preuilly.fr: did not receive HSTS header
-community-cupboard.org: did not receive HSTS header
-comocurarlashemorroides.org: could not connect to host
-comocurarlashemorroidesya.com: could not connect to host
-comoeliminarlaspapulasperladasenelglande.com: did not receive HSTS header
-comohacerelamoraunhombrenet.com: did not receive HSTS header
-comoquitarlasestriasrapidamente.com: did not receive HSTS header
-comorecuperaratumujerpdf.com: could not connect to host
-comosatisfaceraunhombreenlacamaydejarloloco.com: did not receive HSTS header
-comotalk.com: could not connect to host
-compalytics.com: could not connect to host
-comparamejor.com: did not receive HSTS header
-compareandrecycle.com: did not receive HSTS header
-comparejewelleryprices.co.uk: could not connect to host
-comparesolarquote.com.au: did not receive HSTS header
-comparetravelinsurance.com.au: did not receive HSTS header
-compartir.party: did not receive HSTS header
-compassbest.com: could not connect to host
-compassionate-biology.com: could not connect to host
-compeuphoria.com: could not connect to host
-compiledworks.com: could not connect to host
-compitak.com: could not connect to host
-compleetondernemen.nl: did not receive HSTS header
-completesportperformance.com: did not receive HSTS header
-completionist.audio: could not connect to host
-complex-news.com: could not connect to host
-complex-organization.com: could not connect to host
-complexcoral.ro: did not receive HSTS header
-complexsystems.fail: did not receive HSTS header
-complt.xyz: could not connect to host
-complymd.com: did not receive HSTS header
-compostelle-bouddha.fr: could not connect to host
-compra-deuna.com: could not connect to host
-compraporinternet.online: could not connect to host
-comprarcl.com: could not connect to host
-comprarefiereygana.com: could not connect to host
-comprasegura.ml: did not receive HSTS header
-comprasoffie.com.br: could not connect to host
-compratecno.cl: did not receive HSTS header
-compreair.com: did not receive HSTS header
-compredietlight.com.br: did not receive HSTS header
-comprefitasadere.com.br: could not connect to host
-comprehensiveihc.com: could not connect to host
-compromised.com: did not receive HSTS header
-compros.me: could not connect to host
-compsmag.com: did not receive HSTS header
-compu-ofertas.tk: could not connect to host
-compucastell.ch: did not receive HSTS header
-compucorner.com.mx: could not connect to host
-compusolve.nl: could not connect to host
-compusrit.tk: could not connect to host
-computeradvance.tk: could not connect to host
-computerfreunde-barmbek.de: did not receive HSTS header
-computerslotopschool.nl: did not receive HSTS header
-computertal.de: could not connect to host
-computerwerk.org: did not receive HSTS header
-comssa.org.au: did not receive HSTS header
-comtily.com: could not connect to host
-comyuno.com: did not receive HSTS header
-concentrade.de: did not receive HSTS header
-conceptatelier.de: could not connect to host
-conception.sk: could not connect to host
-concertengine.com: could not connect to host
-concerts-metal.ch: did not receive HSTS header
-conclave.global: could not connect to host
-conclinica.com.br: did not receive HSTS header
-concord-group.co.jp: did not receive HSTS header
-concursopublico.com.br: could not connect to host
-condit.ml: could not connect to host
-conectalmeria.com: could not connect to host
-conectar.ru: could not connect to host
-conference.dnsfor.me: could not connect to host
-confidential.network: could not connect to host
-configurat.tk: could not connect to host
-confirm365.com: could not connect to host
-conflicting.tk: could not connect to host
-conflux.tw: did not receive HSTS header
-conformist.jp: could not connect to host
-confucio.cl: could not connect to host
-confuddledpenguin.com: did not receive HSTS header
-cong5.net: max-age too low: 0
-congz.me: did not receive HSTS header
-conkret.ch: could not connect to host
-conkret.co.uk: could not connect to host
-conkret.de: did not receive HSTS header
-conkret.eu: could not connect to host
-conkret.in: could not connect to host
-connaitre-les-astres.com: did not receive HSTS header
-connect-more.online: did not receive HSTS header
-connect.social: did not receive HSTS header
-connect.ua: could not connect to host
-connectavid.com: could not connect to host
-connected-verhuurservice.nl: did not receive HSTS header
-connectium.co.uk: did not receive HSTS header
-conniesacademy.com: could not connect to host
-connorsmith.co: could not connect to host
-conocimientosdigitales.com: could not connect to host
-conpath.net: did not receive HSTS header
-conpins.nl: could not connect to host
-conrad.am: could not connect to host
-conraid.net: did not receive HSTS header
-conrail.blue: did not receive HSTS header
-consciousandglamorous.com: could not connect to host
-consciousbrand.co: did not receive HSTS header
-consciousbrand.org.au: could not connect to host
-consciousbranding.org.au: could not connect to host
-consciousbrands.net.au: could not connect to host
-consciousnesschange.com: did not receive HSTS header
-consec-systems.de: did not receive HSTS header
-conseil-gli.fr: did not receive HSTS header
-consejosdehogar.com: did not receive HSTS header
-conservados.com.br: did not receive HSTS header
-conservatoriesincornwall.com: did not receive HSTS header
-consideryourways.net: could not connect to host
-consill.com: could not connect to host
-console.ninja: could not connect to host
-console.python.org: did not receive HSTS header
-console.support: did not receive HSTS header
-consommation-locale.fr: could not connect to host
-consonare.de: did not receive HSTS header
-constancechen.me: did not receive HSTS header
-constares.de: did not receive HSTS header
-constituenttracker.com: could not connect to host
-construct-trust.com: could not connect to host
-constructexpres.ro: could not connect to host
-construction-digitale.fr: could not connect to host
-consultanta-in-afaceri.ro: max-age too low: 0
-consultasdigitales.com: did not receive HSTS header
-consultcelerity.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-consultingroupitaly.com: did not receive HSTS header
-consultorcr.net: could not connect to host
-consultorioespecializado.com: could not connect to host
-consumer.gov: did not receive HSTS header
-consumidor.gov: did not receive HSTS header
-contactbig.com: did not receive HSTS header
-contaimo.com: did not receive HSTS header
-container-lion.com: did not receive HSTS header
-containerstatistics.com: could not connect to host
-contarkos.xyz: could not connect to host
-content-design.de: did not receive HSTS header
-contentdesign.de: did not receive HSTS header
-contents.ga: could not connect to host
-contextplatform.com: did not receive HSTS header
-continental-zermatt.ch: did not receive HSTS header
-continuation.io: could not connect to host
-continuum.memorial: did not receive HSTS header
-continuumgaming.com: did not receive HSTS header
-contourheating.co.uk: did not receive HSTS header
-contractdigital.co.uk: could not connect to host
-contraout.com: could not connect to host
-contrisur.com: did not receive HSTS header
-controlarlaansiedad.com: did not receive HSTS header
-controlcenter.gigahost.dk: did not receive HSTS header
-controltickets.com.br: did not receive HSTS header
-contxt-agentur.de: did not receive HSTS header
-convergemagazine.com: did not receive HSTS header
-convert.zone: could not connect to host
-converter.ml: could not connect to host
-convexset.org: could not connect to host
-convocatoriafundacionpepsicomexico.org: could not connect to host
-convoitises.com: did not receive HSTS header
-cooink.net: could not connect to host
-cookcountyclerkil.gov: did not receive HSTS header
-cookeatup.com: did not receive HSTS header
-cooker.fr: could not connect to host
-cookielab.io: did not receive HSTS header
-cookiesoft.de: could not connect to host
-cookiestudies.cf: could not connect to host
-cookingbazart.com: did not receive HSTS header
-cooko.at: could not connect to host
-cooksbookscorks.com: did not receive HSTS header
-cooksecuritygroup.com: did not receive HSTS header
-cooksplanet.com: could not connect to host
-coolaj86.com: did not receive HSTS header
-coolbutbroken.com: did not receive HSTS header
-coolchevy.org.ua: did not receive HSTS header
-coole-meister.de: could not connect to host
-coolerssr.space: could not connect to host
-cooljs.me: could not connect to host
-coolkidsbouncycastles.co.uk: did not receive HSTS header
-coolmath.cf: could not connect to host
-coolrc.me: did not receive HSTS header
-cooltang.ooo: could not connect to host
-coolvibe.org: did not receive HSTS header
-coolviewthermostat.com: did not receive HSTS header
-coon.fr: could not connect to host
-coop.se: did not receive HSTS header
-cooperativa-je.net: did not receive HSTS header
-cooperativehandmade.com: did not receive HSTS header
-cooperativehandmade.pe: did not receive HSTS header
-coor.fun: could not connect to host
-cooxa.com: could not connect to host
-copinstant.com: did not receive HSTS header
-copperhead.co: did not receive HSTS header
-coppermein.co.za: could not connect to host
-copshop.com.br: could not connect to host
-copta-imagefilme-und-drohnenvideos.de: did not receive HSTS header
-coptic-treasures.com: max-age too low: 2592000
-copycaught.co: could not connect to host
-copycaught.xyz: could not connect to host
-copytrack.com: did not receive HSTS header
-coquibus.net: did not receive HSTS header
-cor-ser.es: could not connect to host
-coralcanticorumbarcelona.tk: could not connect to host
-coralproject.net: did not receive HSTS header
-coralrosado.com.br: did not receive HSTS header
-coramcdaniel.com: could not connect to host
-corbinhesse.com: did not receive HSTS header
-cordep.biz: could not connect to host
-corderoscleaning.com: did not receive HSTS header
-cordial-restaurant.com: did not receive HSTS header
-core4system.de: could not connect to host
-coreapm.com: could not connect to host
-corecdn.org: could not connect to host
-corenetworking.de: could not connect to host
-coresos.com: could not connect to host
-coreup.de: could not connect to host
-corex.io: did not receive HSTS header
-corgicloud.com: could not connect to host
-corinnanese.de: could not connect to host
-coriver.me: could not connect to host
-corkyoga.site: could not connect to host
-corl3ss.com: could not connect to host
-cormactagging.ie: could not connect to host
-cormilu.com.br: did not receive HSTS header
-cornishcamels.com: did not receive HSTS header
-coroasdefloresonline.com.br: could not connect to host
-corourbano.es: did not receive HSTS header
-corozanu.ro: did not receive HSTS header
-corp.goog: could not connect to host (error ignored - included regardless)
-corpoatletico.com.br: could not connect to host
-corpoepele.com.br: could not connect to host
-corporacioninternacionallideres.org: did not receive HSTS header
-corporateencryption.com: could not connect to host
-corporatesubscriptions.com.au: did not receive HSTS header
-corpsepaint.life: could not connect to host
-correct.horse: could not connect to host
-correctemails.com: could not connect to host
-correcthorse.cf: could not connect to host
-correctionsfoundation.org: did not receive HSTS header
-correiodovale.com.br: did not receive HSTS header
-corruption-mc.net: could not connect to host
-corruption-rsps.net: could not connect to host
-corruption-server.net: could not connect to host
-corruptsamurai.com: could not connect to host
-corsectra.com: could not connect to host
-cortisolsupplement.com: did not receive HSTS header
-corvus.eu.org: could not connect to host
-cosentus.com: did not receive HSTS header
-coslinker.com: could not connect to host
-cosmetic-surgery-prices.co.uk: could not connect to host
-cosmeticos-naturales.com: did not receive HSTS header
-cosmeticosdelivery.com.br: did not receive HSTS header
-cosmeticosnet.com.br: did not receive HSTS header
-cosmiatria.pe: could not connect to host
-cosmoluziluminacion.com: could not connect to host
-cosmoss-departure.com: could not connect to host
-cosni.co: could not connect to host
-costa-rica-reisen.ch: did not receive HSTS header
-costa-rica-reisen.de: did not receive HSTS header
-costablanca.villas: could not connect to host
-costcofinance.com: did not receive HSTS header
-costellofc.co.uk: could not connect to host
-costow.club: could not connect to host
-costruzioni.milano.it: could not connect to host
-cote-chasse.com: did not receive HSTS header
-coth.ml: could not connect to host
-cotonea.de: did not receive HSTS header
-cotta.dk: could not connect to host
-cougarsland.com: did not receive HSTS header
-coughlan.de: did not receive HSTS header
-counselling.network: did not receive HSTS header
-counsellingtime.co.uk: could not connect to host
-count.sh: could not connect to host
-counterhack.nl: did not receive HSTS header
-countingto.one: could not connect to host
-countryattire.com: did not receive HSTS header
-coup-dun-soir.ch: could not connect to host
-coupe-bordure.com: did not receive HSTS header
-couplay.org: could not connect to host
-couponcodeq.com: could not connect to host
-couragewhispers.ca: could not connect to host
-coursdeprogrammation.com: could not connect to host
-course.pp.ua: did not receive HSTS header
-course.rs: could not connect to host
-coursella.com: could not connect to host
-courses-nlp.com: did not receive HSTS header
-courses.nl: could not connect to host
-courtlistener.com: did not receive HSTS header
-couscous.recipes: could not connect to host
-covaci.pro: did not receive HSTS header
-cove.sh: could not connect to host
-covenantbank.net: could not connect to host
-covenantmatrix.com: could not connect to host
-covenantoftheriver.org: did not receive HSTS header
-coverdat.com: could not connect to host
-coverduck.ru: did not receive HSTS header
-covermytrip.com.au: could not connect to host
-cowboyim.com: could not connect to host
-cowcreek-nsn.gov: could not connect to host
-cowo.group: did not receive HSTS header
-coworking.tk: could not connect to host
-coworkingmanifesto.com: could not connect to host
-cozitop.com.br: could not connect to host
-cozmaadrian.ro: could not connect to host
-cozmoapp.com: could not connect to host
-cozy.io: did not receive HSTS header
-cozycloud.cc: did not receive HSTS header
-cozywebsite.com: did not receive HSTS header
-cpaneltips.com: could not connect to host
-cpbanq.com: could not connect to host
-cpbapremiocaduceo.com.ar: could not connect to host
-cpcp380.com: max-age too low: 0
-cperegistry.com: could not connect to host
-cplala.com: could not connect to host
-cpls.me: could not connect to host
-cppressinc.com: could not connect to host
-cprheartcenter.com: did not receive HSTS header
-cpsq.fr: could not connect to host
-cpuvinf.eu.org: could not connect to host
-cqchome.com: did not receive HSTS header
-cr0nus.net: did not receive HSTS header
-cr9499.com: could not connect to host
-crabfactory.com.my: could not connect to host
-crackers4cheese.com: could not connect to host
-cracking.org: did not receive HSTS header
-crackingking.com: did not receive HSTS header
-crackpfer.de: could not connect to host
-craft-verlag.de: did not receive HSTS header
-craftbeerbarn.co.uk: could not connect to host
-craftcommerce.com: did not receive HSTS header
-craftedge.xyz: could not connect to host
-craftination.net: could not connect to host
-craftmain.eu: could not connect to host
-craftmine.cz: could not connect to host
-craftngo.hu: could not connect to host
-craftsandsweets.com: did not receive HSTS header
-craftwmcp.xyz: could not connect to host
-craftydev.design: could not connect to host
-craigary.net: did not receive HSTS header
-cranems.com.ua: could not connect to host
-cranioschule.com: did not receive HSTS header
-crashsec.com: could not connect to host
-crate.io: did not receive HSTS header
-cravelyrics.com: could not connect to host
-crawcial.de: could not connect to host
-crawl.report: did not receive HSTS header
-craxbay.com: did not receive HSTS header
-crazifyngers.com: could not connect to host
-crazy-crawler.de: did not receive HSTS header
-crazybulksteroids.com: could not connect to host
-crazycen.com: could not connect to host
-crazycraftland.de: could not connect to host
-crazyfamily11.de: could not connect to host
-crazyhost.ga: could not connect to host
-crazyhotseeds.com: did not receive HSTS header
-crazyker.com: could not connect to host
-crazyvisitors.com: could not connect to host
-crbug.com: did not receive HSTS header (error ignored - included regardless)
-crc-online.nl: did not receive HSTS header
-creadstudy.com: could not connect to host
-creaescola.com: did not receive HSTS header
-creafitchile.cl: could not connect to host
-creaintel.net: did not receive HSTS header
-creamybuild.com: could not connect to host
-creandoydesarrollando.com: could not connect to host
-create-ls.jp: could not connect to host
-create-test-publish.co.uk: could not connect to host
-create-together.nl: did not receive HSTS header
-createcpanama.com: could not connect to host
-creaticworld.net: could not connect to host
-creations-edita.com: could not connect to host
-creativ-impuls-dekorateurin-muenchen.de: did not receive HSTS header
-creativeapple.ltd: did not receive HSTS header
-creativeartifice.com: did not receive HSTS header
-creativebites.de: could not connect to host
-creativecommons.cl: did not receive HSTS header
-creativecommonscatpictures.com: could not connect to host
-creativefolks.co.uk: did not receive HSTS header
-creativefreedom.ca: did not receive HSTS header
-creativephysics.ml: could not connect to host
-creativeplayuk.com: did not receive HSTS header
-creativerezults.com: could not connect to host
-creativesprite.com: could not connect to host
-creativlabor.ch: did not receive HSTS header
-creato.top: could not connect to host
-creators.co: could not connect to host
-crecips.com: could not connect to host
-crecket.me: could not connect to host
-credia.jp: could not connect to host
-creditcard52.com: max-age too low: 0
-creditclear.com.au: did not receive HSTS header
-creditreporttips.net: could not connect to host
-creditta.com: could not connect to host
-credittoken.io: could not connect to host
-creepycraft.nl: could not connect to host
-crendontech.com: did not receive HSTS header
-creorin.com: did not receive HSTS header
-crepererum.net: did not receive HSTS header
-crescent.gr.jp: could not connect to host
-crestoncottage.com: could not connect to host
-crew505.org: could not connect to host
-crewplanner.eu: did not receive HSTS header
-crfcap.org: did not receive HSTS header
-crge.eu: did not receive HSTS header
-criadorespet.com.br: could not connect to host
-crickey.eu: could not connect to host
-crimbotrees.co.uk: did not receive HSTS header
-crimewatch.net.za: could not connect to host
-crimson.no: did not receive HSTS header
-crip-usk.ba: could not connect to host
-crisissurvivalspecialists.com: could not connect to host
-cristals.ga: could not connect to host
-cristianhares.com: could not connect to host
-cristianrasch.com: did not receive HSTS header
-cristoraciones.com: did not receive HSTS header
-critcola.com: could not connect to host
-criticalaim.com: did not receive HSTS header
-crizk.com: could not connect to host
-crl-autos.com: could not connect to host
-crmdemo.website: could not connect to host
-crmenrich.com: could not connect to host
-crockett.io: did not receive HSTS header
-croeder.net: could not connect to host
-croisieres.discount: could not connect to host
-croncron.io: could not connect to host
-croods-mt2.fr: could not connect to host
-croome.no-ip.org: could not connect to host
-crop-alert.com: could not connect to host
-croquette.net: did not receive HSTS header
-crosbug.com: did not receive HSTS header (error ignored - included regardless)
-crose.co.uk: did not receive HSTS header
-cross-link.ch: did not receive HSTS header
-cross-x.com: could not connect to host
-crosscom.ch: could not connect to host
-crossfunctional.com: could not connect to host
-crosssec.com: did not receive HSTS header
-crosssellguide.com: did not receive HSTS header
-crossword.city: did not receive HSTS header
-crow.tw: could not connect to host
-crowdcurity.com: did not receive HSTS header
-crowdjuris.com: could not connect to host
-crowdwis.com: could not connect to host
-crownchessclub.com: could not connect to host
-crownruler.com: did not receive HSTS header
-crowter.li: could not connect to host
-crox.co: could not connect to host
-crrev.com: did not receive HSTS header (error ignored - included regardless)
-crt.sh: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-crt2014-2024review.gov: could not connect to host
-crtvmgmt.com: could not connect to host
-cruciverba.cc: did not receive HSTS header
-crudysql.com: could not connect to host
-crufad.org: did not receive HSTS header
-cruikshank.com.au: could not connect to host
-crunchy.rocks: did not receive HSTS header
-crux.camp: did not receive HSTS header
-cruzadobalcazarabogados.com: could not connect to host
-cruzeiropedia.org: did not receive HSTS header
-cruzr.xyz: could not connect to host
-cryobiz.com: did not receive HSTS header
-cryogenix.net: could not connect to host
-cryoit.com: did not receive HSTS header
-cryp.no: could not connect to host
-crypalert.com: could not connect to host
-crypkit.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-crypt.guru: did not receive HSTS header
-crypticshell.co.uk: did not receive HSTS header
-cryptify.eu: could not connect to host
-crypto-armory.com: did not receive HSTS header
-crypto-navi.org: did not receive HSTS header
-crypto.tube: max-age too low: 2592000
-cryptobells.com: did not receive HSTS header
-cryptobin.org: could not connect to host
-cryptocaseproject.com: could not connect to host
-cryptodash.net: could not connect to host
-cryptodyno.ninja: could not connect to host
-cryptojar.io: could not connect to host
-cryptolab.pro: could not connect to host
-cryptolab.tk: could not connect to host
-cryptolinc.com: did not receive HSTS header
-cryptolosophy.io: could not connect to host
-cryptolosophy.org: did not receive HSTS header
-cryptonx.io: could not connect to host
-cryptoparty.dk: could not connect to host
-cryptopartyatx.org: could not connect to host
-cryptopartynewcastle.org: could not connect to host
-cryptopro.shop: could not connect to host
-cryptopush.com: did not receive HSTS header
-cryptoya.io: could not connect to host
-crysadm.com: could not connect to host
-crystalclassics.co.uk: did not receive HSTS header
-crystallizedcouture.com: did not receive HSTS header
-crystalmate.eu: did not receive HSTS header
-cs-colorscreed-betongulve.dk: could not connect to host
-cs-ubladego.pl: could not connect to host
-cs3334.com: did not receive HSTS header
-cs3336.com: did not receive HSTS header
-cs3338.com: did not receive HSTS header
-cs3339.com: did not receive HSTS header
-csapak.com: could not connect to host
-csasummit.org: could not connect to host
-csawctf.poly.edu: could not connect to host
-csbgtribalta.com: did not receive HSTS header
-csbs.fr: could not connect to host
-csd-sevnica.si: could not connect to host
-csehnyelv.hu: could not connect to host
-cser.me: could not connect to host
-csfloors.co.uk: could not connect to host
-csfm.com: could not connect to host
-csfs.org.uk: could not connect to host
-csgo.design: could not connect to host
-csgo.help: could not connect to host
-csgo77.com: could not connect to host
-csgodicegame.com: could not connect to host
-csgoelemental.com: could not connect to host
-csgogamers.com: could not connect to host
-csgohandouts.com: could not connect to host
-csgokings.eu: could not connect to host
-csgoshifter.com: could not connect to host
-csgotwister.com: could not connect to host
-cshopify.com: could not connect to host
-csilies.de: could not connect to host
-csinfo.us: could not connect to host
-cskdoc.com: did not receive HSTS header
-csohack.tk: could not connect to host
-csokolade.hu: could not connect to host
-cspbuilder.info: could not connect to host
-csru.net: could not connect to host
-css.net: could not connect to host
-css125.com: max-age too low: 0
-cssu.in: did not receive HSTS header
-csust.ac.cn: did not receive HSTS header
-csuw.net: could not connect to host
-csvape.com: did not receive HSTS header
-ct-status.org: could not connect to host
-ct-watches.dk: did not receive HSTS header
-cthomas.work: could not connect to host
-cthulhuden.com: could not connect to host
-ctir.gov.br: did not receive HSTS header
-ctj.im: could not connect to host
-ctknight.me: could not connect to host
-ctl.email: could not connect to host
-ctoforhire.com.au: could not connect to host
-ctoresms.com: could not connect to host
-ctr.id: did not receive HSTS header
-ctrld.me: could not connect to host
-ctyi.me: could not connect to host
-cuanhua3s.com: could not connect to host
-cuanticasocialmedia.com: could not connect to host
-cubanross.com: did not receive HSTS header
-cube-cloud.com: did not receive HSTS header
-cube.de: did not receive HSTS header
-cube.la: did not receive HSTS header
-cubecart.net: did not receive HSTS header
-cubecraftstore.com: could not connect to host
-cubecraftstore.net: could not connect to host
-cubela.tech: could not connect to host
-cubeserver.eu: could not connect to host
-cubewano.com: could not connect to host
-cubix.host: could not connect to host
-cucaracha.tk: could not connect to host
-cucc.date: could not connect to host
-cuckoo.ee: did not receive HSTS header
-cuddlecat.io: could not connect to host
-cuecamania.com.br: could not connect to host
-cujanovic.com: did not receive HSTS header
-cujba.com: could not connect to host
-culaneenergycorp.com: did not receive HSTS header
-culinae.nl: could not connect to host
-cultivo.bio: could not connect to host
-culture-school.top: did not receive HSTS header
-cultureelbeleggen.nl: did not receive HSTS header
-culturerain.com: could not connect to host
-cultureroll.com: could not connect to host
-cumparama.com: did not receive HSTS header
-cumtd.com: could not connect to host
-cunha.be: could not connect to host
-cuni-cuni-club.com: could not connect to host
-cuni-rec.com: could not connect to host
-cuntflaps.me: could not connect to host
-cuongquach.com: did not receive HSTS header
-cuonic.com: did not receive HSTS header
-cupcake.io: did not receive HSTS header
-cupcake.is: did not receive HSTS header
-cupcakesandcrinoline.com: did not receive HSTS header
-cupcao.gov: could not connect to host
-cupi.co: could not connect to host
-cupidosshop.com: did not receive HSTS header
-cupofarchitects.net: did not receive HSTS header
-cuppycakes.fi: did not receive HSTS header
-curacao-license.com: could not connect to host
-curanderosantiago.com: did not receive HSTS header
-curareldolordeespalda.com: could not connect to host
-curarnosensalud.com: could not connect to host
-curatedgeek.com: did not receive HSTS header
-curexengine.com: did not receive HSTS header
-curia.fi: could not connect to host
-curiouscat.me: max-age too low: 2592000
-curiouspeddler.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-curlyroots.com: did not receive HSTS header
-current.com: did not receive HSTS header
-currentobserver.com: did not receive HSTS header
-curroapp.com: could not connect to host
-cursed.im: did not receive HSTS header
-cursomarketingdigitalmx.com: could not connect to host
-cursosdnc.cl: could not connect to host
-cursosgratuitos.com.br: did not receive HSTS header
-curtislaw-pllc.com: did not receive HSTS header
-curva.co: could not connect to host
-curvesandwords.com: did not receive HSTS header
-curveweb.co.uk: did not receive HSTS header
-curvylove.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-cusfit.com: did not receive HSTS header
-custe.rs: could not connect to host
-custerweb.com: could not connect to host
-custodiamobili.roma.it: could not connect to host
-customadesign.com: did not receive HSTS header
-custombikes.cl: could not connect to host
-customcontract.network: could not connect to host
-customd.com: did not receive HSTS header
-customerbox.ir: did not receive HSTS header
-customfilmworks.com: could not connect to host
-customfitmarketing.com: did not receive HSTS header
-customgear.com.au: could not connect to host
-customizeyourshower.com: could not connect to host
-customromlist.com: could not connect to host
-customshort.link: could not connect to host
-cutelariafiveladeouro.com.br: did not receive HSTS header
-cutephil.com: could not connect to host
-cutimbo.com: could not connect to host
-cutimbo.ovh: could not connect to host
-cutorrent.com: could not connect to host
-cuvva.insure: did not receive HSTS header
-cuxpool.club: could not connect to host
-cuyahogacountyvotesoh.gov: could not connect to host
-cvjm-memmingen.de: did not receive HSTS header
-cvninja.pl: did not receive HSTS header
-cvps.top: did not receive HSTS header
-cvsoftub.com: could not connect to host
-cvtparking.co.uk: did not receive HSTS header
-cw-bw.de: could not connect to host
-cwage.com: did not receive HSTS header
-cwbw.network: could not connect to host
-cwilson.ga: could not connect to host
-cwinfo.fi: did not receive HSTS header
-cwinfo.net: did not receive HSTS header
-cwr.gov: did not receive HSTS header
-cxfinancia.com: did not receive HSTS header
-cxq77128.com: max-age too low: 0
-cy.ax: could not connect to host
-cy.technology: did not receive HSTS header
-cyanogenmod.xxx: could not connect to host
-cybbh.space: could not connect to host
-cyber-computer.club: could not connect to host
-cyber-konzept.de: did not receive HSTS header
-cyber-perikarp.eu: could not connect to host
-cyber-wolfs.com: could not connect to host
-cyber.cafe: did not receive HSTS header
-cyberbot.info: could not connect to host
-cybercave.tk: could not connect to host
-cybercecurity.com: did not receive HSTS header
-cybercloud.cc: did not receive HSTS header
-cybercocoon.com: did not receive HSTS header
-cyberdos.de: could not connect to host
-cyberdyne-industries.net: could not connect to host
-cyberexplained.info: could not connect to host
-cyberkov.com: did not receive HSTS header
-cyberlab.kiev.ua: could not connect to host
-cyberlightapp.com: did not receive HSTS header
-cybermeldpunt.nl: could not connect to host
-cyberpanel.cf: could not connect to host
-cyberpeace.nl: did not receive HSTS header
-cyberprey.com: could not connect to host
-cyberpunk.ca: could not connect to host
-cyberquest.cf: could not connect to host
-cyberregister.nl: could not connect to host
-cyberregister.org: could not connect to host
-cybersantri.com: could not connect to host
-cybersecurity.nz: did not receive HSTS header
-cyberserver.org: could not connect to host
-cybershambles.com: could not connect to host
-cyberspace.community: could not connect to host
-cyberspace.today: could not connect to host
-cybertorsk.org: could not connect to host
-cyberweightloss.com: could not connect to host
-cyberxpert.nl: could not connect to host
-cybit.io: could not connect to host
-cybozulive-dev.com: could not connect to host
-cybozulive.com: did not receive HSTS header
-cybrary.it: did not receive HSTS header
-cyclehackluxembourgcity.lu: could not connect to host
-cyclingjunkies.com: could not connect to host
-cyclisjumper.gallery: could not connect to host
-cydia-search.io: could not connect to host
-cyelint.com: could not connect to host
-cygnaltech.com: could not connect to host
-cygu.ch: could not connect to host
-cymtech.net: could not connect to host
-cynoshair.com: could not connect to host
-cyoda.com: did not receive HSTS header
-cypad.cn: could not connect to host
-cype.dedyn.io: could not connect to host
-cypherpunk.com: did not receive HSTS header
-cypherpunk.ws: could not connect to host
-cyphertite.com: could not connect to host
-cypresslegacy.com: could not connect to host
-cyrating.com: did not receive HSTS header
-cyson.tech: could not connect to host
-cytadel.fr: did not receive HSTS header
-cytegic-update-packages.com: could not connect to host
-cytotecforsale.com: did not receive HSTS header
-czechamlp.com: could not connect to host
-czechcrystals.co.uk: could not connect to host
-czfa.pl: did not receive HSTS header
-czlx.co: could not connect to host
-d-academia.com: did not receive HSTS header
-d-garnier-delaunay.fr: did not receive HSTS header
-d-imitacion.top: could not connect to host
-d-loop.de: could not connect to host
-d-msg.com: could not connect to host
-d-quantum.com: did not receive HSTS header
-d-rickroll-e.pw: could not connect to host
-d-soft.tk: could not connect to host
-d00r.de: did not receive HSTS header
-d0xq.net: could not connect to host
-d1ownqs4tcx37f.cloudfront.net: did not receive HSTS header
-d1qvlbepn0kduz.cloudfront.net: could not connect to host
-d1ves.io: did not receive HSTS header
-d2qa61rbluifiq.cloudfront.net: did not receive HSTS header
-d2s.uk: could not connect to host
-d30365.com: did not receive HSTS header
-d36594.com: could not connect to host
-d3njjcbhbojbot.cloudfront.net: did not receive HSTS header
-d3x.pw: could not connect to host
-d4designstudios.ch: did not receive HSTS header
-d4designstudios.com: did not receive HSTS header
-d4rkdeagle.tk: could not connect to host
-d4wson.com: could not connect to host
-d5197.co: could not connect to host
-d6729.co: could not connect to host
-d6729.com: did not receive HSTS header
-d6957.co: could not connect to host
-d6957.com: did not receive HSTS header
-d88-livechat.com: could not connect to host
-d88.com: could not connect to host
-d885188.com: could not connect to host
-d887vip.com: could not connect to host
-d8886.net: could not connect to host
-d888818.com: could not connect to host
-d88dc09.com: could not connect to host
-d899365.com: could not connect to host
-d8studio.net: could not connect to host
-d9297.co: could not connect to host
-d9397.com: could not connect to host
-d9721.com: could not connect to host
-d9728.co: could not connect to host
-da-ist-kunst.de: could not connect to host
-da-sh.cc: could not connect to host
-da.hn: could not connect to host
-da42foripad.com: could not connect to host
-da8.cc: did not receive HSTS header
-dabblegoat.com: could not connect to host
-dabbot.org: did not receive HSTS header
-dabneydriveanimalhospital.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-dad256.tk: could not connect to host
-dadahen.com: max-age too low: 0
-dadons-laserdiscs.com: could not connect to host
-dadtheimpaler.com: could not connect to host
-dadycandoit.com: did not receive HSTS header
-daemon.xin: could not connect to host
-dafassl.com: did not receive HSTS header
-dafnik.me: did not receive HSTS header
-dagmar2018.cz: could not connect to host
-dah5.com: did not receive HSTS header
-dahl-pind.dk: did not receive HSTS header
-dahliacake.com: could not connect to host
-dai-rin.co.jp: could not connect to host
-daily-exps.herokuapp.com: could not connect to host
-dailybunda.com: could not connect to host
-dailystormerpodcasts.com: could not connect to host
-dailytopix.com: could not connect to host
-daimadi.com: could not connect to host
-daintymeal.com: did not receive HSTS header
-dair.se: did not receive HSTS header
-dairikab.go.id: could not connect to host
-daisuki.pw: could not connect to host
-daiwai.de: did not receive HSTS header
-daiweihu.com: could not connect to host
-daiyuu.jp: could not connect to host
-dakerealestate.com: did not receive HSTS header
-dakinecoupons.com: did not receive HSTS header
-dakl-shop.de: did not receive HSTS header
-dakotasilencer.com: did not receive HSTS header
-dakrib.net: could not connect to host
-daku.gdn: could not connect to host
-dale-bancruz.tk: could not connect to host
-dalek.co.nz: could not connect to host
-dalfiume.it: did not receive HSTS header
-dalingk.co: could not connect to host
-dallas.gov: could not connect to host
-daltonedwards.me: could not connect to host
-dam74.com.ar: could not connect to host
-damaskena.com: did not receive HSTS header
-damienpontifex.com: did not receive HSTS header
-damifph.com: could not connect to host
-damjanovic.work: could not connect to host
-damongant.de: could not connect to host
-damtosfoods.com: did not receive HSTS header
-dan-informacijske-varnosti.si: could not connect to host
-dan.org.nz: did not receive HSTS header
-danaketh.com: could not connect to host
-dancebuzz.co.uk: did not receive HSTS header
-dancerdates.net: did not receive HSTS header
-dandymrsb.com: could not connect to host
-daneandthepain.com: did not receive HSTS header
-dangmai.tk: could not connect to host
-daniel-du.com: did not receive HSTS header
-daniel-mosquera.com: could not connect to host
-daniel-stahl.net: could not connect to host
-daniel-steuer.de: could not connect to host
-daniel.domains: could not connect to host
-daniela-schwarz-individuelle-lebensberatung-coaching.de: did not receive HSTS header
-danielalvarez.net: did not receive HSTS header
-danielcowie.me: could not connect to host
-danieldk.eu: did not receive HSTS header
-danielfeau.com: did not receive HSTS header
-danielgraziano.ca: could not connect to host
-danieljireh.com: did not receive HSTS header
-danielmostertman.com: could not connect to host
-danielmostertman.nl: could not connect to host
-danielschreurs.com: did not receive HSTS header
-danielt.co.uk: did not receive HSTS header
-danielverlaan.nl: could not connect to host
-danielworthy.com: did not receive HSTS header
-danielzuzevich.com: could not connect to host
-danijobs.com: could not connect to host
-danishenanigans.com: could not connect to host
-dankeblog.com: could not connect to host
-dankredues.com: could not connect to host
-danmark.guide: did not receive HSTS header
-danna888.com: max-age too low: 0
-dannycrichton.com: did not receive HSTS header
-danonsecurity.com: could not connect to host
-danova.de: did not receive HSTS header
-danoz.net: could not connect to host
-danrl.de: could not connect to host
-dansa.com.co: could not connect to host
-danscomp.com: did not receive HSTS header
-dansk-skole.de: did not receive HSTS header
-dansk777.dk: did not receive HSTS header
-danskringsporta.be: did not receive HSTS header
-danstoncu.be: could not connect to host
-dantelistan.com: could not connect to host
-daolerp.xyz: could not connect to host
-dapianw.com: did not receive HSTS header
-dapim.co.il: did not receive HSTS header
-daplie.com: could not connect to host
-dapps.earth: could not connect to host
-dappworld.com: could not connect to host
-darbtech.net: did not receive HSTS header
-daren.com.br: could not connect to host
-daretogain.com: could not connect to host
-dargasia.is: could not connect to host
-darinjohnson.ca: could not connect to host
-dario.im: did not receive HSTS header
-dariosirangelo.me: could not connect to host
-darisni.me: did not receive HSTS header
-dark-x.cf: could not connect to host
-darkag.ovh: did not receive HSTS header
-darkanzali.pl: max-age too low: 0
-darkdestiny.ch: could not connect to host
-darkestproductions.net: could not connect to host
-darkhole.cn: could not connect to host
-darkhunter.eu: could not connect to host
-darkishgreen.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-darknebula.space: did not receive HSTS header
-darknode.in: could not connect to host
-darkpony.ru: could not connect to host
-darkroomsaredead.com: could not connect to host
-darkside.re: did not receive HSTS header
-darksideof.it: could not connect to host
-darkstance.org: could not connect to host
-darktree.in: could not connect to host
-darkwebnews.com: could not connect to host
-darlastudio66.com: did not receive HSTS header
-darookee.net: could not connect to host
-daropia.org: did not receive HSTS header
-darrenellis.xyz: could not connect to host
-darrenm.net: could not connect to host
-dart-tanke.com: could not connect to host
-dart-tanke.de: could not connect to host
-dartsdon.jp: could not connect to host
-dartshopmn.nl: did not receive HSTS header
-dartydiscount.fr: could not connect to host
-das-ee.com: did not receive HSTS header
-das-tyrol.at: did not receive HSTS header
-dash-board.jp: could not connect to host
-dash.rocks: did not receive HSTS header
-dashabi.today: could not connect to host
-dashabi.ws: could not connect to host
-dashboard.run: could not connect to host
-dashboard.yt: could not connect to host
-dashburst.com: did not receive HSTS header
-dashnimorad.com: did not receive HSTS header
-data-abundance.com: could not connect to host
-data-detox.com: could not connect to host
-data.qld.gov.au: did not receive HSTS header
-databeam.de: could not connect to host
-datacandy.com: did not receive HSTS header
-datacave.is: could not connect to host
-datacenternews.asia: did not receive HSTS header
-datacenternews.co.nz: did not receive HSTS header
-datacentrenews.eu: did not receive HSTS header
-datacool.host: could not connect to host
-datacool.tk: could not connect to host
-datacubed.com: did not receive HSTS header
-datafd.com: did not receive HSTS header
-datafd.net: did not receive HSTS header
-datagir.ir: did not receive HSTS header
-dataguidance.com: max-age too low: 2592000
-datahoarder.download: could not connect to host
-datahoarder.xyz: could not connect to host
-datahoarderschool.club: could not connect to host
-dataisme.com: did not receive HSTS header
-datajapan.co.jp: did not receive HSTS header
-datamatic.ru: could not connect to host
-dataprotectionadvisors.com: did not receive HSTS header
-datapure.net: could not connect to host
-dataretention.solutions: could not connect to host
-datascomemorativas.com.br: did not receive HSTS header
-datasharesystem.com: could not connect to host
-datasnitch.co.uk: could not connect to host
-datatekniikka.com: did not receive HSTS header
-datedeposit.com: could not connect to host
-datelligent.com: could not connect to host
-datengrab.ws: could not connect to host
-datenlast.de: did not receive HSTS header
-datenreiter.cf: could not connect to host
-datenreiter.gq: could not connect to host
-datenreiter.ml: could not connect to host
-datenreiter.tk: could not connect to host
-datine.com.br: could not connect to host
-datorb.com: could not connect to host
-datortipsen.se: could not connect to host
-datovyaudit.cz: could not connect to host
-datsound.ru: did not receive HSTS header
-datsumou-q.com: could not connect to host
-datvexehue.com: did not receive HSTS header
-daveedave.de: could not connect to host
-davepermen.net: could not connect to host
-daverandom.com: could not connect to host
-davesharpe.com: did not receive HSTS header
-davewut.ca: could not connect to host
-david-mallett.com: did not receive HSTS header
-davidandkailey.com: could not connect to host
-davidbrito.tech: could not connect to host
-davidcrx.net: could not connect to host
-davidforward.com: did not receive HSTS header
-davidforward.net: could not connect to host
-davidglidden.eu: did not receive HSTS header
-davidletellier.com: did not receive HSTS header
-davidlillo.com: could not connect to host
-davidnadaski.com: could not connect to host
-davidnoren.com: did not receive HSTS header
-davidreinhardt.de: could not connect to host
-davidscherzer.at: could not connect to host
-davidzack.net: did not receive HSTS header
-davimun.org: could not connect to host
-davros.eu: could not connect to host
-davros.ru: could not connect to host
-dawena.de: did not receive HSTS header
-dawnofeden.org: could not connect to host
-dawnofhope.tk: could not connect to host
-dawnsonb.com: could not connect to host
-day-peak.com: did not receive HSTS header
-day.vip: could not connect to host
-daydream.team: could not connect to host
-daylight-dream.ee: did not receive HSTS header
-daylightcompany.com: did not receive HSTS header
-dayman.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-daytonaseaside.com: did not receive HSTS header
-db-sanity.com: could not connect to host
-db.gy: could not connect to host
-dbcom.ru: did not receive HSTS header
-dbdc.us: did not receive HSTS header
-dbjl.fr: did not receive HSTS header
-dblx.io: could not connect to host
-dbmxpca.com: did not receive HSTS header
-dbox.ga: could not connect to host
-dbpmedia.se: did not receive HSTS header
-dbudj.com: max-age too low: 0
-dbw678.com: could not connect to host
-dbx.ovh: could not connect to host
-dbyz.co.uk: did not receive HSTS header
-dc-service.by: did not receive HSTS header
-dcaracing.nl: could not connect to host
-dcareer.tk: could not connect to host
-dcautomacao.com.br: did not receive HSTS header
-dcc.cat: did not receive HSTS header
-dccode.gov: could not connect to host
-dccoffeeproducts.com: did not receive HSTS header
-dccommunity.de: could not connect to host
-dccraft.net: could not connect to host
-dcl.re: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-dctxf.com: did not receive HSTS header
-dcuofriends.net: could not connect to host
-dd5197.co: could not connect to host
-dd6729.co: could not connect to host
-dd6729.com: did not receive HSTS header
-dd6957.co: could not connect to host
-dd9297.co: could not connect to host
-dd9397.com: could not connect to host
-dd9721.com: could not connect to host
-dd9728.co: could not connect to host
-dden.website: could not connect to host
-dden.xyz: could not connect to host
-ddholdingservices.com: could not connect to host
-ddmeportal.com: could not connect to host
-ddns-anbieter.de: could not connect to host
-ddocu.me: could not connect to host
-ddos-mitigation.co.uk: could not connect to host
-ddos-mitigation.info: could not connect to host
-ddproxy.cf: could not connect to host
-ddy.tw: could not connect to host
-de-osopanda.com: could not connect to host
-de-servers.de: could not connect to host
-de-spil.be: could not connect to host
-deadbyhost.com: could not connect to host
-deadmann.com: could not connect to host
-deai-life.biz: could not connect to host
-dealerbrindes.com.br: did not receive HSTS header
-dealpass.no: did not receive HSTS header
-deals.ms: did not receive HSTS header
-deanisa.ninja: could not connect to host
-deanstreettacochips.com: did not receive HSTS header
-dearly.com: did not receive HSTS header
-deathberry.ddns.net: could not connect to host
-debank.tv: did not receive HSTS header
-debarrasantony.com: could not connect to host
-debarrasasnieressurseine.com: could not connect to host
-debarrasboulognebillancourt.com: could not connect to host
-debarrasclichy.com: could not connect to host
-debarrascolombes.com: could not connect to host
-debarrasnanterre.com: could not connect to host
-debatch.se: could not connect to host
-debauchery.ml: could not connect to host
-debian-vhost.de: could not connect to host
-debiton.dk: could not connect to host
-debitoutil.com: did not receive HSTS header
-debitpaie.com: did not receive HSTS header
-debkleinteam.com: did not receive HSTS header
-deblocking.ga: could not connect to host
-debora-singkreis.de: could not connect to host
-deborahmarinelli.eu: could not connect to host
-debraydesign.com.au: could not connect to host
-debt.com: did not receive HSTS header
-debtkit.co.uk: did not receive HSTS header
-debtprotectionreporting.com: could not connect to host
-decafu.co: could not connect to host
-decayshop.com: did not receive HSTS header
-decentralizedweb.net: did not receive HSTS header
-decesus.com: could not connect to host
-decfun.com: did not receive HSTS header
-decibelios.li: could not connect to host
-decidetreatment.org: could not connect to host
-decimatechnologies.eu: could not connect to host
-deckbuilderamerica.com: did not receive HSTS header
-decloverly.com: could not connect to host
-deco.me: could not connect to host
-decoacerospanama.com: could not connect to host
-decoating.pl: could not connect to host
-decoboutique.com: did not receive HSTS header
-decodeanddestroy.com: could not connect to host
-decoder.link: did not receive HSTS header
-decofire.pl: did not receive HSTS header
-decomplify.com: did not receive HSTS header
-deconsolutions.com: did not receive HSTS header
-decoraid.com: did not receive HSTS header
-decorincasa.com.br: could not connect to host
-decorland.com.ua: could not connect to host
-decormiernissanparts.com: could not connect to host
-decoyrouting.com: did not receive HSTS header
-decstasy.de: did not receive HSTS header
-dedeo.tk: could not connect to host
-dedicatutiempo.es: could not connect to host
-dedietrich-asia.com: did not receive HSTS header
-dedimax.de: did not receive HSTS header
-deedyinc.com: could not connect to host
-deejayevents.ro: did not receive HSTS header
-deeonix.eu: could not connect to host
-deep-chess.com: could not connect to host
-deep.social: did not receive HSTS header
-deepaero.com: could not connect to host
-deeparamaraj.com: could not connect to host
-deepblue-web.cn: could not connect to host
-deepblueemail.com: could not connect to host
-deepcovelabs.net: could not connect to host
-deepcreampie.com: could not connect to host
-deepearth.uk: could not connect to host
-deeperxh.com: did not receive HSTS header
-deeployr.io: could not connect to host
-deeprecce.com: could not connect to host
-deeprecce.link: could not connect to host
-deeprecce.tech: could not connect to host
-deeps.cat: could not connect to host
-deepsouthsounds.com: could not connect to host
-deepvalley.tech: could not connect to host
-deepvision.com.ua: did not receive HSTS header
-deepwealth.institute: did not receive HSTS header
-deepzz.com: did not receive HSTS header
-deer.team: did not receive HSTS header
-deetz.nl: did not receive HSTS header
-deetzen.de: did not receive HSTS header
-deezeno.com: could not connect to host
-defektologiya.tk: could not connect to host
-defendtheweb.co.uk: did not receive HSTS header
-defi-metier.com: could not connect to host
-defi-metier.fr: could not connect to host
-defi-metier.org: could not connect to host
-defi-metiers.com: could not connect to host
-defi-metiers.fr: did not receive HSTS header
-defi-metiers.org: could not connect to host
-defifa.ga: could not connect to host
-defiler.tk: could not connect to host
-defimetier.fr: could not connect to host
-defimetier.org: could not connect to host
-defimetiers.com: could not connect to host
-defimetiers.fr: could not connect to host
-defme.eu: could not connect to host
-defrax.com: did not receive HSTS header
-defrax.de: did not receive HSTS header
-degeberg.com: could not connect to host
-degeberg.dk: could not connect to host
-degosoft.nl: could not connect to host
-degressif.com: could not connect to host
-degroetenvanrosaline.nl: could not connect to host
-degroupage.info: max-age too low: 7884000
-deight.co: could not connect to host
-deight.in: could not connect to host
-deinserverhost.de: did not receive HSTS header
-deionized.ga: could not connect to host
-dejan.media: did not receive HSTS header
-dekasan.ru: could not connect to host
-dekka.cz: did not receive HSTS header
-dekkercreativedesign.nl: did not receive HSTS header
-dekoh-shouyu.com: did not receive HSTS header
-delandalucia.com: did not receive HSTS header
-delawarenation-nsn.gov: did not receive HSTS header
-delayrefunds.co.uk: could not connect to host
-delbrouck.ch: did not receive HSTS header
-delcan.ga: could not connect to host
-delcan.ml: could not connect to host
-delcopa.gov: did not receive HSTS header
-deleenheir.be: could not connect to host
-delf.co.jp: did not receive HSTS header
-delfino.cr: did not receive HSTS header
-delhitalkie.com: did not receive HSTS header
-deli-tochigi.jp: did not receive HSTS header
-delitto.top: could not connect to host
-deliver.moe: could not connect to host
-deliverance.co.uk: could not connect to host
-delivery.co.at: could not connect to host
-deliveryiquique.cl: could not connect to host
-delkniga42.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-deltaconcepts.de: did not receive HSTS header
-deltasmart.ch: did not receive HSTS header
-deltna.com: did not receive HSTS header
-deluxecccam.tv: could not connect to host
-delvickokolo.me: did not receive HSTS header
-delvj.org: could not connect to host
-demandware.com: did not receive HSTS header
-demarche-expresse.com: did not receive HSTS header
-demdis.org: could not connect to host
-demilitarized.ninja: could not connect to host
-demo-server.us: could not connect to host
-demo.sb: could not connect to host
-demoakasafe2.tk: could not connect to host
-democracy.io: did not receive HSTS header
-democraticdifference.com: could not connect to host
-demolandia.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-demotops.com: could not connect to host
-demuzere.com: could not connect to host
-demuzere.eu: could not connect to host
-demuzere.net: could not connect to host
-demuzere.org: could not connect to host
-dengchangdong.com: did not receive HSTS header
-denh.am: could not connect to host
-denimio.com: did not receive HSTS header
-denisjean.fr: did not receive HSTS header
-dennispotter.eu: did not receive HSTS header
-densmirnov.com: max-age too low: 7776000
-dental-misaki.com: did not receive HSTS header
-dentaldomain.org: did not receive HSTS header
-dentaldomain.ph: did not receive HSTS header
-dentals.cf: could not connect to host
-dentanestplus.com: did not receive HSTS header
-dentoncounty.gov: did not receive HSTS header
-denuevestore.com: could not connect to host
-denvercybersecurity.com: did not receive HSTS header
-denverphilharmonic.org: did not receive HSTS header
-denverprophit.us: did not receive HSTS header
-depaddestoeltjes.be: did not receive HSTS header
-deped.blog: could not connect to host
-deped.io: could not connect to host
-deped.org: could not connect to host
-depedclub.ph: could not connect to host
-depedncr.com: could not connect to host
-depedshs.com: could not connect to host
-depedtambayan.org.ph: could not connect to host
-depedtayo.com: could not connect to host
-deperewi.gov: did not receive HSTS header
-depijl-mz.nl: did not receive HSTS header
-depixion.agency: could not connect to host
-deplorablesdaily.com: could not connect to host
-deployitwith.me: did not receive HSTS header
-depo.space: did not receive HSTS header
-depot-leipzig.de: did not receive HSTS header
-depth-co.jp: could not connect to host
-dequehablamos.es: could not connect to host
-der-stein-fluesterer.de: could not connect to host
-derango.tk: could not connect to host
-derbyshiredotnet.co.uk: did not receive HSTS header
-derchris.me: could not connect to host
-derechosdigitales.org: did not receive HSTS header
-dereddingsklos.nl: did not receive HSTS header
-derivativeshub.pro: could not connect to host
-derive.cc: could not connect to host
-derk-jan.com: did not receive HSTS header
-derma-expert.eu: did not receive HSTS header
-dermacarecomplex.com: could not connect to host
-dermo-concept.de: did not receive HSTS header
-derpumpkinfuhrer.com: could not connect to host
-dersix.com: did not receive HSTS header
-dersoundhunter.de: could not connect to host
-derstulle.de: could not connect to host
-derwaldschrat.net: did not receive HSTS header
-derwolfe.net: did not receive HSTS header
-desarrollowp.com: did not receive HSTS header
-descartes-finance.com: did not receive HSTS header
-desgenst.ch: could not connect to host
-desiccantpackets.com: did not receive HSTS header
-design-fu.com: did not receive HSTS header
-design-production.jp: did not receive HSTS header
-designandmore.it: did not receive HSTS header
-designanyware.com.br: could not connect to host
-designdevs.eu: did not receive HSTS header
-designedbygeniuses.com: could not connect to host
-designepublicidade.com.br: did not receive HSTS header
-designgears.com: could not connect to host
-designhotel-kronjuwel.de: did not receive HSTS header
-designsbykerrialee.co.uk: did not receive HSTS header
-designthinking.or.jp: did not receive HSTS header
-desktopgoldlink.com: did not receive HSTS header
-deskvip.com: could not connect to host
-desmo.gg: could not connect to host
-despachomartinyasociados.com: could not connect to host
-desportvriendenoverijse.tk: could not connect to host
-despotika.de: could not connect to host
-desserteagleselvenar.tk: could not connect to host
-desterman.ru: could not connect to host
-destinationbijoux.fr: could not connect to host
-destinationsofnewyorkstate.com: did not receive HSTS header
-destinattorneyjohngreene.com: did not receive HSTS header
-destinfloor.com: could not connect to host
-destinopiriapolis.com: did not receive HSTS header
-destinoytarot.com: did not receive HSTS header
-destom.be: could not connect to host
-desuperheroes.co: did not receive HSTS header
-desveja.com.br: could not connect to host
-detechnologiecooperatie.nl: did not receive HSTS header
-detector.exposed: could not connect to host
-detest.org: could not connect to host
-dethikiemtra.com: did not receive HSTS header
-deti-vse.ml: could not connect to host
-detiks.cf: could not connect to host
-detoxic.vn: could not connect to host
-detoxsinutritie.ro: did not receive HSTS header
-detrapdoor.com: could not connect to host
-detroitrocs.org: did not receive HSTS header
-detski.center: could not connect to host
-detskysad.com: could not connect to host
-detuprovincia.cl: did not receive HSTS header
-detusmascotas.com: could not connect to host
-detutorial.com: max-age too low: 36000
-detyamobuv.tk: could not connect to host
-deusu.de: did not receive HSTS header
-deusu.org: could not connect to host
-deux.solutions: could not connect to host
-deuxmetrescubes.fr: did not receive HSTS header
-deuxsol.co: could not connect to host
-deuxsol.com: could not connect to host
-deuxsolutions.com: could not connect to host
-deuxvia.com: could not connect to host
-dev: could not connect to host
-dev-aegon.azurewebsites.net: could not connect to host
-dev-bluep.pantheonsite.io: did not receive HSTS header
-dev-dot-naga-226708.appspot.com: did not receive HSTS header
-dev-pulse-mtn.pantheonsite.io: did not receive HSTS header
-dev-sev-web.pantheonsite.io: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-dev-talk.eu: could not connect to host
-dev-talk.net: could not connect to host
-devafterdark.com: could not connect to host
-devapi.pro: could not connect to host
-devb.nl: could not connect to host
-devcu.com: could not connect to host
-devcu.net: could not connect to host
-devdesco.com: could not connect to host
-devdoodle.net: could not connect to host
-develop.fitness: could not connect to host
-developer.mydigipass.com: could not connect to host
-developerfair.com: did not receive HSTS header
-developersclub.website: did not receive HSTS header
-develux.com: could not connect to host
-devenney.io: did not receive HSTS header
-devh.net: could not connect to host
-deviajesturismo.com: could not connect to host
-deviltracks.net: could not connect to host
-devin-balimuhac.de: did not receive HSTS header
-devincrow.me: could not connect to host
-devinpacker.com: did not receive HSTS header
-devisnow.fr: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-devisonline.ch: could not connect to host
-devistravaux.org: did not receive HSTS header
-devkid.net: did not receive HSTS header
-devmsg.com: could not connect to host
-devnsec.com: did not receive HSTS header
-devnull.team: could not connect to host
-devonsawatzky.ca: could not connect to host
-devonvintagechina.co.uk: did not receive HSTS header
-devopers.com.br: could not connect to host
-devopps.me: could not connect to host
-devops.moe: could not connect to host
-devopsconnected.com: could not connect to host
-devpgsv.com: did not receive HSTS header
-devpsy.info: could not connect to host
-devrim.io: could not connect to host
-devsrvr.ru: could not connect to host
-devstroke.io: could not connect to host
-devtestfan1.gov: could not connect to host
-devtub.com: did not receive HSTS header
-devuan.org: did not receive HSTS header
-devyn.ca: did not receive HSTS header
-dewebwerf.nl: did not receive HSTS header
-dewin.io: could not connect to host
-dezintranet.com: max-age too low: 1
-dezshop24.de: did not receive HSTS header
-df1nif.de: did not receive HSTS header
-df5101.com: did not receive HSTS header
-df5102.com: could not connect to host
-df5103.com: did not receive HSTS header
-df5104.com: could not connect to host
-df5105.com: did not receive HSTS header
-df5aa.com: could not connect to host
-df5bb.com: did not receive HSTS header
-df5cc.com: did not receive HSTS header
-df5dd.com: could not connect to host
-df5ee.com: did not receive HSTS header
-dfc.gov: did not receive HSTS header
-dfekt.no: could not connect to host
-dfixit.com: could not connect to host
-dfrance.com.br: could not connect to host
-dfviana.com.br: max-age too low: 2592000
-dg7.in: did not receive HSTS header
-dgblaw.com.au: could not connect to host
-dgby.org: did not receive HSTS header
-dggm.ru: could not connect to host
-dggwp.de: did not receive HSTS header
-dh6729.com: could not connect to host
-dh9397.com: could not connect to host
-dh9721.com: could not connect to host
-dharamkot.com: could not connect to host
-dharma.ai: did not receive HSTS header
-dhbr.org: did not receive HSTS header
-dhl-smart.ch: could not connect to host
-dhlcotizadorexpo-qa.azurewebsites.net: could not connect to host
-dhpcs.com: did not receive HSTS header
-dhpiggott.net: did not receive HSTS header
-dhtr.pw: could not connect to host
-dhub.xyz: could not connect to host
-dhxxls.com: could not connect to host
-di2pra.com: could not connect to host
-di2pra.fr: could not connect to host
-diabetesblog.org: did not receive HSTS header
-diablotine.rocks: could not connect to host
-diabolic.chat: could not connect to host
-diadorafitness.es: could not connect to host
-diagnocentro.cl: could not connect to host
-diagnosia.com: did not receive HSTS header
-diagnostix.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-diagonale-deco.fr: did not receive HSTS header
-diagrammingoutloud.co.uk: did not receive HSTS header
-dialect-agency.eu.org: could not connect to host
-dialectic-og.com: could not connect to host
-diamondcare.com.br: could not connect to host
-diamondgrid.ga: could not connect to host
-diamondpkg.org: could not connect to host
-diamondt.us: could not connect to host
-diamsmedia.ch: could not connect to host
-dianafaraj.de: did not receive HSTS header
-dianlujitao.com: did not receive HSTS header
-diannaobos.com: did not receive HSTS header
-dianpi.net: did not receive HSTS header
-dianurse.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-diare-na-miru.cz: could not connect to host
-diasp.cz: did not receive HSTS header
-diavo.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-dicando.com: could not connect to host
-diccionarioabierto.com: could not connect to host
-diceduels.com: did not receive HSTS header
-dicgaming.net: could not connect to host
-dichgans-besserer.de: did not receive HSTS header
-dichvudangkygiayphep.com: could not connect to host
-dickieslife.com: did not receive HSTS header
-dickord.club: could not connect to host
-diconnex.com: did not receive HSTS header
-didigotoffer.com: could not connect to host
-didikhari.web.id: did not receive HSTS header
-die-besten-bewertungen.de: did not receive HSTS header
-die-besten-weisheiten.de: could not connect to host
-die-blahuts.de: could not connect to host
-die-bobbeloase.com: could not connect to host
-dieb.photo: could not connect to host
-diedrich.me: could not connect to host
-diegobarrosmaia.com.br: could not connect to host
-diegotoledo.com.br: did not receive HSTS header
-diejanssens.net: did not receive HSTS header
-diemogebhardt.com: did not receive HSTS header
-dierencompleet.nl: did not receive HSTS header
-dierenkruiden.nl: did not receive HSTS header
-dieser.me: could not connect to host
-dieta-figura.tk: could not connect to host
-dietacelulitis.com: could not connect to host
-dietagespresse.com: did not receive HSTS header
-dietervandenbroeck.be: max-age too low: 0
-diewebstube.de: could not connect to host
-diezel.com: could not connect to host
-diff2html.xyz: did not receive HSTS header
-difusordeambientes.com.br: could not connect to host
-digaxtest.com: did not receive HSTS header
-diggable.co: did not receive HSTS header
-digibild.ch: did not receive HSTS header
-digibones.be: did not receive HSTS header
-digicert-support.com: could not connect to host
-digicert.nl: did not receive HSTS header
-digidroom.be: did not receive HSTS header
-digihyp.ch: did not receive HSTS header
-digikol.net: could not connect to host
-digimomedia.co.uk: could not connect to host
-diginota.com: did not receive HSTS header
-digipitch.com: did not receive HSTS header
-digired.xyz: could not connect to host
-digitai.net: could not connect to host
-digital-muscle.com.au: did not receive HSTS header
-digital1world.com: could not connect to host
-digitalbank.kz: could not connect to host
-digitalcash.cf: could not connect to host
-digitalcloud.ovh: could not connect to host
-digitalcuko.com: did not receive HSTS header
-digitaldaddy.net: could not connect to host
-digitaldashboard.gov: could not connect to host
-digitalero.rip: did not receive HSTS header
-digitalewelten.de: could not connect to host
-digitalexhale.com: did not receive HSTS header
-digitalezukunft-hagen.de: could not connect to host
-digitalezukunft.nrw: could not connect to host
-digitalfishfun.com: did not receive HSTS header
-digitalimpostor.co.uk: could not connect to host
-digitaljungle.net: did not receive HSTS header
-digitallocker.com: did not receive HSTS header
-digitalmaniac.co.uk: could not connect to host
-digitalnonplus.com: could not connect to host
-digitalquery.com: did not receive HSTS header
-digitalroar.com: could not connect to host
-digitalrxcloud.com: could not connect to host
-digitaltechnologies.ltd.uk: did not receive HSTS header
-digitalwasteland.net: did not receive HSTS header
-digitise.io: did not receive HSTS header
-diguass.us: did not receive HSTS header
-dijks.com: could not connect to host
-dikshant.net: could not connect to host
-dilichen.fr: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-dillynbarber.com: could not connect to host
-dim.lighting: could not connect to host
-dimdom.com.br: did not receive HSTS header
-dimensionen.de: did not receive HSTS header
-dimes.com.tr: did not receive HSTS header
-dimeshop.nl: did not receive HSTS header
-dimseklubben.dk: could not connect to host
-din-tools.com: did not receive HSTS header
-dinamoelektrik.com: could not connect to host
-dineachook.com.au: did not receive HSTS header
-dingcc.com: could not connect to host
-dingcc.me: could not connect to host
-dingcc.org: could not connect to host
-dingcc.xyz: could not connect to host
-dinge.xyz: did not receive HSTS header
-dingelbob-schuhcreme.gq: could not connect to host
-dingss.com: could not connect to host
-dinkum.online: could not connect to host
-dinotopia.org.uk: could not connect to host
-dinotv.at: could not connect to host
-dintillat.fr: could not connect to host
-dinube.com: could not connect to host
-dionysus.se: could not connect to host
-diozoid.com: could not connect to host
-dipconsultants.com: could not connect to host
-directebanking.com: did not receive HSTS header
-directhskincream.com: could not connect to host
-directinsure.in: did not receive HSTS header
-directme.ga: could not connect to host
-directorinegocis.cat: could not connect to host
-directscripts.com: did not receive HSTS header
-directtwo.solutions: could not connect to host
-directtwosolutions.org: could not connect to host
-directwatertanks.co.uk: did not receive HSTS header
-direnv.net: did not receive HSTS header
-diretashop.com: could not connect to host
-direwolfsoftware.ca: could not connect to host
-dirips.com: did not receive HSTS header
-dirtcraft.ca: could not connect to host
-dirtycat.ru: could not connect to host
-disavow.tools: did not receive HSTS header
-discha.net: did not receive HSTS header
-disciplesmakingdisciples.ca: could not connect to host
-disciplina.io: did not receive HSTS header
-discipul.nl: could not connect to host
-disco-crazy-world.de: could not connect to host
-discord-chan.net: could not connect to host
-discordghost.space: could not connect to host
-discotek.club: did not receive HSTS header
-discountmania.eu: did not receive HSTS header
-discountmetaux.fr: did not receive HSTS header
-discover-mercure.com: could not connect to host
-discoveringdocker.com: could not connect to host
-discovermuscatine.com: did not receive HSTS header
-discoverrsv.com: could not connect to host
-discoverwellness.center: could not connect to host
-discovery.lookout.com: did not receive HSTS header
-discoveryottawa.ca: could not connect to host
-discoveryrom.org: could not connect to host
-discreet-condooms.nl: did not receive HSTS header
-dislocated.de: did not receive HSTS header
-disorderboutique.com: did not receive HSTS header
-dispatchitsolutions.com: could not connect to host
-dispatchitsolutions.io: could not connect to host
-disruptivelabs.net: could not connect to host
-disruptivelabs.org: could not connect to host
-dissidence.ovh: could not connect to host
-dissident.host: could not connect to host
-dissimulo.me: could not connect to host
-distinctdesign2009.com: could not connect to host
-distinctivephotography.com.au: could not connect to host
-distinguishedwindows.co.uk: did not receive HSTS header
-distraction.gov: could not connect to host
-distractionco.de: did not receive HSTS header
-distributednya.com: could not connect to host
-distrilogservices.com: could not connect to host
-distrishow.fr: could not connect to host
-ditch.ch: could not connect to host
-ditelbat.com: max-age too low: 300
-ditrutoancau.vn: could not connect to host
-dittvertshus.no: could not connect to host
-div.im: did not receive HSTS header
-diva-ey.com: could not connect to host
-divegearexpress.com.cn: could not connect to host
-divegearexpress.net: could not connect to host
-divenwa.com: could not connect to host
-diversity-spielzeug.de: did not receive HSTS header
-divertiagua.com.br: could not connect to host
-divinemercyparishvlds.com: did not receive HSTS header
-divistart.online: did not receive HSTS header
-divorcelawyersformen.com: did not receive HSTS header
-divvi.co.nz: did not receive HSTS header
-divvymonkey.com: could not connect to host
-divvyradio.com: could not connect to host
-dixi.fi: did not receive HSTS header
-dixi.ml: did not receive HSTS header
-dixiediner.com: did not receive HSTS header
-dixmag.com: could not connect to host
-diygod.me: did not receive HSTS header
-diysec.tk: could not connect to host
-diz.in.ua: could not connect to host
-dizihocasi.com: could not connect to host
-dizorg.net: could not connect to host
-dizzie.org: could not connect to host
-dizzieforums.com: could not connect to host
-dj16888.com: could not connect to host
-dj16888a.com: did not receive HSTS header
-dj16888b.com: did not receive HSTS header
-dj16888c.com: did not receive HSTS header
-dj16888d.com: did not receive HSTS header
-dj4et.de: could not connect to host
-djangogolf.com: could not connect to host
-djeung.org: could not connect to host
-djfafafa.com: did not receive HSTS header
-djiconsulting.com: did not receive HSTS header
-djieno.com: did not receive HSTS header
-djlive.pl: did not receive HSTS header
-djroynomden.nl: could not connect to host
-djt-vom-chausseehaus.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-djul.net: could not connect to host
-djursland-psykologen.dk: did not receive HSTS header
-djvip1.com: could not connect to host
-djvip10.com: could not connect to host
-djvip2.com: could not connect to host
-djvip3.com: could not connect to host
-djvip4.com: could not connect to host
-djvip5.com: could not connect to host
-djvip6.com: could not connect to host
-djvip7.com: could not connect to host
-djvip9.com: could not connect to host
-djxmmx.net: did not receive HSTS header
-djz4music.com: did not receive HSTS header
-dkniss.de: could not connect to host
-dko-steiermark.ml: could not connect to host
-dktq2hj81vknv.cloudfront.net: could not connect to host
-dl.google.com: did not receive HSTS header (error ignored - included regardless)
-dlabouncycastlehire.co.uk: could not connect to host
-dlbouncers.co.uk: could not connect to host
-dlc.viasinc.com: could not connect to host
-dlcwilson.com: could not connect to host
-dlemper.de: did not receive HSTS header
-dlld.biz: could not connect to host
-dlld.info: could not connect to host
-dlouwrink.nl: could not connect to host
-dlrsp.org: could not connect to host
-dlyanxs.com: did not receive HSTS header
-dlyaribalki.tk: could not connect to host
-dlyl888.com: could not connect to host
-dm1.in: could not connect to host
-dm4productions.com: could not connect to host
-dmarketer.com: did not receive HSTS header
-dmcastles.com: could not connect to host
-dmcglobaltravel.com.mx: did not receive HSTS header
-dmcibulldog.com: did not receive HSTS header
-dmdre.com: did not receive HSTS header
-dmeevalumate.com: did not receive HSTS header
-dmess.ru: could not connect to host
-dmfd.net: could not connect to host
-dmix.ca: did not receive HSTS header
-dmk-realestate.com: could not connect to host
-dmlogic.com: could not connect to host
-dmschilderwerken.nl: did not receive HSTS header
-dmtry.me: max-age too low: 0
-dmwall.cn: could not connect to host
-dmx.xyz: could not connect to host
-dmxledlights.com: could not connect to host
-dmz.ninja: could not connect to host
-dmzlab.se: could not connect to host
-dn42.eu: did not receive HSTS header
-dnastatic.com: did not receive HSTS header
-dndesign.be: did not receive HSTS header
-dne.lu: did not receive HSTS header
-dnfc.rocks: could not connect to host
-dnmaze.com: could not connect to host
-dns-manager.info: did not receive HSTS header
-dns.google.com: did not receive HSTS header (error ignored - included regardless)
-dnsbird.net: could not connect to host
-dnsbird.org: could not connect to host
-dnscrypt.org: did not receive HSTS header
-dnsge.org: did not receive HSTS header
-dnsinfo.ml: could not connect to host
-dnsknowledge.com: did not receive HSTS header
-dnspod.ml: could not connect to host
-dnsql.io: could not connect to host
-dnswarden.com: could not connect to host
-dnzz123.com: could not connect to host
-do-do.tk: could not connect to host
-do-it.cz: did not receive HSTS header
-doadaybook.com: did not receive HSTS header
-doak.io: did not receive HSTS header
-doanhnhanplus.vn: max-age too low: 0
-dobet.in: could not connect to host
-dobrev.family: could not connect to host
-dobsnet.net: did not receive HSTS header
-doc-baza.tk: could not connect to host
-doc-justice.com: did not receive HSTS header
-doceamoraviverbem.com: could not connect to host
-dochimera.com: could not connect to host
-dochitaceahlau.ro: could not connect to host
-docid.io: could not connect to host
-dockerm.com: could not connect to host
-dockerturkiye.com: could not connect to host
-docket.news: could not connect to host
-doclassworks.com: could not connect to host
-doclot.io: could not connect to host
-docnhanh.vn: could not connect to host
-docogo.ga: could not connect to host
-docs.re: did not receive HSTS header
-docset.io: could not connect to host
-docsoc.org.uk: did not receive HSTS header
-doctorbini.com: could not connect to host
-doctorsonmaps.com: did not receive HSTS header
-docufiel.com: could not connect to host
-doculus.io: could not connect to host
-documentations-sociales.com: could not connect to host
-docupet.com: did not receive HSTS header
-docxtemplater.com: did not receive HSTS header
-doda.space: could not connect to host
-dodds.cc: could not connect to host
-doddy.tk: could not connect to host
-dodomu.ddns.net: could not connect to host
-doesmycodehavebugs.today: could not connect to host
-doeswindowssuckforeveryoneorjustme.com: could not connect to host
-dog-blum.com: did not receive HSTS header
-dogboarding.online: did not receive HSTS header
-dogbox.se: did not receive HSTS header
-dogcratereview.info: could not connect to host
-doge.me: did not receive HSTS header
-doge.town: could not connect to host
-dogeboy.com: could not connect to host
-dogespeed.ga: could not connect to host
-dogfi.sh: did not receive HSTS header
-dogft.com: could not connect to host
-doggieholic.net: could not connect to host
-doggybag-committee.com: could not connect to host
-dognlife.com: did not receive HSTS header
-dogoodbehappyllc.com: could not connect to host
-dogprograms.net: could not connect to host
-dohosting.ru: could not connect to host
-dojifish.space: could not connect to host
-dojin.nagoya: could not connect to host
-dokan-e.com: could not connect to host
-dokan.online: could not connect to host
-doked.io: could not connect to host
-dokspot.cf: could not connect to host
-dokspot.ga: could not connect to host
-doku-gilde.de: could not connect to host
-dokuraum.de: could not connect to host
-dolarcanadense.com.br: could not connect to host
-dolce-vita-mia.tk: could not connect to host
-doleta.gov: did not receive HSTS header
-dolevik.com: could not connect to host
-dollarstore24.com: could not connect to host
-dollywiki.co.uk: could not connect to host
-dolphin-cloud.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-dolphin-hosting.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-dolphin-it.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-dolphincorp.co.uk: could not connect to host
-dolt.xyz: did not receive HSTS header
-dom-medicina.ru: did not receive HSTS header
-domain-swiss.ch: could not connect to host
-domaine-aigoual-cevennes.com: did not receive HSTS header
-domainelaremejeanne.com: did not receive HSTS header
-domainhacks.io: could not connect to host
-domainhostingcompany.tk: could not connect to host
-domains.autos: did not receive HSTS header
-domains.boats: did not receive HSTS header
-domains.homes: did not receive HSTS header
-domains.motorcycles: did not receive HSTS header
-domains.yachts: did not receive HSTS header
-domaris.de: could not connect to host
-domasazu.pl: did not receive HSTS header
-domeconseil.fr: could not connect to host
-domen-reg.ru: could not connect to host
-domengrad.ru: could not connect to host
-domenicocatelli.com: could not connect to host
-dominik-schlueter.de: could not connect to host
-dominikanskarepubliken.guide: could not connect to host
-dominikkulaga.pl: max-age too low: 1
-dominioanimal.com: did not receive HSTS header
-dominioanimal.com.br: could not connect to host
-domix.fun: could not connect to host
-domizx.de: could not connect to host
-domlist.tk: could not connect to host
-dommelschbierfusten.nl: did not receive HSTS header
-domoset.tk: could not connect to host
-domovitae.io: could not connect to host
-domovitae.nl: could not connect to host
-domquixoteepi.com.br: did not receive HSTS header
-domy-drewniane-kanadyjskie.pl: did not receive HSTS header
-don.yokohama: could not connect to host
-donateway.com: did not receive HSTS header
-dondiabolo.com: could not connect to host
-donetsk24.su: did not receive HSTS header
-dong8.top: could not connect to host
-donghochinhhang.store: could not connect to host
-dongjingre.net: could not connect to host
-donhoward.org: did not receive HSTS header
-donlydental.ca: did not receive HSTS header
-donmaldeamores.com: did not receive HSTS header
-donmez.uk: could not connect to host
-donmez.ws: could not connect to host
-donna-bellini-business-fotografie-muenchen.de: did not receive HSTS header
-donna-bellini-fotografie-berlin.de: did not receive HSTS header
-donna-bellini-fotografie-erfurt.de: did not receive HSTS header
-donna-bellini-fotografie-frankfurt.de: did not receive HSTS header
-donna-bellini-fotografie-hamburg.de: did not receive HSTS header
-donna-bellini-fotografie-koeln.de: did not receive HSTS header
-donna-bellini-fotografie-muenchen.de: did not receive HSTS header
-donna-bellini-fotografie-nuernberg.de: did not receive HSTS header
-donna-bellini-fotografie-stuttgart.de: did not receive HSTS header
-donna-bellini-fotografie-wien.de: did not receive HSTS header
-donna-bellini-hochzeitsfotograf-frankfurt.de: did not receive HSTS header
-donna-bellini-hochzeitsfotograf-muenchen.de: did not receive HSTS header
-donotspampls.me: could not connect to host
-donovand.info: could not connect to host
-donpaginasweb.com: did not receive HSTS header
-donsbach-edv.de: did not receive HSTS header
-donttrustrobots.nl: could not connect to host
-donzelot.co.uk: did not receive HSTS header
-donzool.es: could not connect to host
-doobydude.us: could not connect to host
-doodledraw.ninja: could not connect to host
-dooku.cz: could not connect to host
-doomleika.com: did not receive HSTS header
-doooonoooob.com: could not connect to host
-doopdidoop.com: did not receive HSTS header
-door.cards: could not connect to host
-dopetrue.com: could not connect to host
-dopfer-fenstertechnik.de: did not receive HSTS header
-dopost.it: could not connect to host
-doppenpost.nl: could not connect to host
-dopply.com: did not receive HSTS header
-dopravni-modely.cz: did not receive HSTS header
-dora.cat: could not connect to host
-dorianmuthig.com: could not connect to host
-doriginal.es: did not receive HSTS header
-dorkfarm.com: did not receive HSTS header
-dormebebe.com.br: did not receive HSTS header
-dormkitty.com: could not connect to host
-dorquelle.com: could not connect to host
-dortmund.directory: could not connect to host
-dosdediez.com: did not receive HSTS header
-dosenbierrepublik.com: could not connect to host
-dosipe.com: could not connect to host
-doska.kz: did not receive HSTS header
-dostavkakurierom.ru: could not connect to host
-dostrece.net: did not receive HSTS header
-dosyanet.tk: could not connect to host
-dot.ro: could not connect to host
-dota2huds.com: did not receive HSTS header
-dotadata.me: could not connect to host
-dotb.dn.ua: did not receive HSTS header
-dotbrick.co.th: could not connect to host
-dotconnor.com: did not receive HSTS header
-dotkod.com: could not connect to host
-dotnetsandbox.ca: could not connect to host
-dotrel.com: did not receive HSTS header
-dotspaperie.com: could not connect to host
-dotweb.cloud: did not receive HSTS header
-doubledash.org: did not receive HSTS header
-doublefun.net: could not connect to host
-doublelist.com: did not receive HSTS header
-doubleness.gq: could not connect to host
-doublestat.me: could not connect to host
-doublethink.online: could not connect to host
-doubleyummy.uk: did not receive HSTS header
-dougferris.id.au: did not receive HSTS header
-douglas-ma.gov: did not receive HSTS header
-douglasstafford.com: did not receive HSTS header
-doujin-domain.cz: could not connect to host
-doujin.nagoya: could not connect to host
-dounats.com: could not connect to host
-dovecotadmin.org: could not connect to host
-doveholesband.co.uk: did not receive HSTS header
-dovetailnow.com: could not connect to host
-dovro.de: did not receive HSTS header
-dowc.org: did not receive HSTS header
-download.jitsi.org: did not receive HSTS header
-downloadhindimovie.net: could not connect to host
-downloadhindimovies.net: could not connect to host
-downsouthweddings.com.au: did not receive HSTS header
-downthe.pub: could not connect to host
-downtimerobot.com: could not connect to host
-doxcelerate.com: could not connect to host
-doyoulyft.com: could not connect to host
-dozor.gq: could not connect to host
-dp2.com.br: did not receive HSTS header
-dpangerl.de: could not connect to host
-dprd-wonogirikab.go.id: max-age too low: 36000
-dpsart.it: could not connect to host
-dpucarriersma.gov: could not connect to host
-dq12321.com: max-age too low: 0
-dr-it.co.uk: did not receive HSTS header
-dr-jakob-zahnaerzte.de: did not receive HSTS header
-dr-krebs.net: did not receive HSTS header
-dr-royaghafourifard.com: did not receive HSTS header
-drabben.be: did not receive HSTS header
-drabbin.com: could not connect to host
-dracon.es: did not receive HSTS header
-dracoon.cloud: did not receive HSTS header
-dracula.city: could not connect to host
-drafton.com: could not connect to host
-drageeparadise.fr: did not receive HSTS header
-draghive.asia: could not connect to host
-draghive.ca: could not connect to host
-draghive.club: could not connect to host
-draghive.co: could not connect to host
-draghive.co.uk: could not connect to host
-draghive.net: could not connect to host
-draghive.org: could not connect to host
-draghive.photos: could not connect to host
-draghive.tv: could not connect to host
-dragon-aspect.com: could not connect to host
-dragoncityhack.tips: could not connect to host
-dragonfly.co.uk: did not receive HSTS header
-dragonisles.net: could not connect to host
-dragons-of-highlands.cz: did not receive HSTS header
-dragonsmoke.cloud: could not connect to host
-dragonstower.net: could not connect to host
-dragonteam.ninja: could not connect to host
-dragonwork.me: could not connect to host
-drainagebuizen.nl: did not receive HSTS header
-draireneborro.com: did not receive HSTS header
-drakefortreasurer.sexy: could not connect to host
-drakensberg-tourism.com: did not receive HSTS header
-dralexjimenez.com: did not receive HSTS header
-dranktoomuchlastnight.com: did not receive HSTS header
-drastosasports.com.br: did not receive HSTS header
-drawchan.org: could not connect to host
-drbarnabus.com: could not connect to host
-drbethanybarnes.com: did not receive HSTS header
-drchristinehatfield.ca: max-age too low: 0
-drcp.tokyo: did not receive HSTS header
-drdavidgilpin.com: did not receive HSTS header
-drdevil.ru: could not connect to host
-drdim.ru: could not connect to host
-dreadbyte.com: could not connect to host
-dreadd.org: could not connect to host
-dreamaholic.club: could not connect to host
-dreamcatcherblog.de: could not connect to host
-dreamersgiftshopec.com: could not connect to host
-dreamhack.com: did not receive HSTS header
-dreaming.solutions: could not connect to host
-dreamithost.com.au: did not receive HSTS header
-dreamkitchenbath.com: did not receive HSTS header
-dreamlighteyeserum.com: could not connect to host
-dreamlinehost.com: did not receive HSTS header
-dreammakerremodelil.com: did not receive HSTS header
-dreamonkey.com: did not receive HSTS header
-dreamtechie.com: did not receive HSTS header
-dreamworldstudio.tk: could not connect to host
-dreax.win: could not connect to host
-dredgepress.com: did not receive HSTS header
-dreischneidiger.de: could not connect to host
-dreiweiden.de: could not connect to host
-dreizwosechs.de: could not connect to host
-dresdner-christstollen-von-reimann.de: could not connect to host
-dressify.co: could not connect to host
-drew.red: did not receive HSTS header
-drewgle.net: could not connect to host
-drfranciscofonseca.com.br: did not receive HSTS header
-drfrey.ch: could not connect to host
-drfun1.com: could not connect to host
-drgdrp.com: did not receive HSTS header
-drgiyaseddin.com: could not connect to host
-drhopeson.com: did not receive HSTS header
-driessoftsec.tk: could not connect to host
-drillnation.com.au: could not connect to host
-drinknaturespower.com: did not receive HSTS header
-drinkplanet.eu: could not connect to host
-drinkvabeer.com: could not connect to host
-dripdoctors.com: did not receive HSTS header
-drishti.guru: could not connect to host
-drive.xyz: could not connect to host
-driver61.com: did not receive HSTS header
-drivermototaxi.fr: did not receive HSTS header
-drivewithstatetransit.com.au: did not receive HSTS header
-driving-lessons.co.uk: could not connect to host
-drivingacademy.tk: could not connect to host
-drivingtestpro.com: did not receive HSTS header
-drixn.cn: could not connect to host
-drixn.com: did not receive HSTS header
-drixn.info: could not connect to host
-drixn.net: could not connect to host
-drjenafernandez.com: did not receive HSTS header
-drjobs.com.au: did not receive HSTS header
-drkmtrx.xyz: did not receive HSTS header
-drlazarina.net: did not receive HSTS header
-drlutfi.com: did not receive HSTS header
-drobniuch.pl: max-age too low: 2592000
-drogoz.moe: could not connect to host
-droidboss.com: did not receive HSTS header
-droidim.com: did not receive HSTS header
-droidwave.com: did not receive HSTS header
-droidwiki.de: could not connect to host
-droithxn.com: could not connect to host
-droncentrum.pl: did not receive HSTS header
-dronebotworkshop.com: did not receive HSTS header
-dronexpertos.com: could not connect to host
-droomhuis-in-brielle-kopen.nl: could not connect to host
-droomhuis-in-de-friese-meren-kopen.nl: could not connect to host
-droomhuis-in-delfzijl-kopen.nl: could not connect to host
-droomhuis-in-friesland-kopen.nl: could not connect to host
-droomhuis-in-laren-kopen.nl: could not connect to host
-droomhuis-in-pekela-kopen.nl: could not connect to host
-droomhuis-in-rijnwaarden-kopen.nl: could not connect to host
-droomhuis-in-sudwest-fryslan-kopen.nl: could not connect to host
-droomhuis-in-veendam-kopen.nl: could not connect to host
-droomhuis-in-zeeland-kopen.nl: could not connect to host
-droomhuis-in-zuid-holland-kopen.nl: could not connect to host
-droomhuisindestadverkopen.nl: could not connect to host
-droomhuisophetplattelandverkopen.nl: could not connect to host
-dropcam.com: did not receive HSTS header
-drostschocolates.com: did not receive HSTS header
-drpure.pw: could not connect to host
-drrodina.com: did not receive HSTS header
-drros.ru: could not connect to host
-drtroyhendrickson.com: could not connect to host
-drtti.io: could not connect to host
-drturner.com.au: did not receive HSTS header
-drubn.de: did not receive HSTS header
-drugagodba.si: did not receive HSTS header
-drumbandesperanto.nl: could not connect to host
-drump-truck.com: could not connect to host
-drupal123.com: did not receive HSTS header
-druznek.me: did not receive HSTS header
-druznek.rocks: could not connect to host
-druznek.xyz: could not connect to host
-druzya.store: could not connect to host
-drvr.xyz: could not connect to host
-drybasement.com: did not receive HSTS header
-drybasementkansas.com: did not receive HSTS header
-drycreekapiary.com: could not connect to host
-ds-christiansen.de: could not connect to host
-dsbrowser.com: did not receive HSTS header
-dsdalismerkezi.com: did not receive HSTS header
-dsdesign.lt: did not receive HSTS header
-dse-assessments.co.uk: did not receive HSTS header
-dshiv.io: could not connect to host
-dsmnet.org: did not receive HSTS header
-dsmstainlessproducts.co.uk: did not receive HSTS header
-dsne.com.mx: did not receive HSTS header
-dso-imaging.co.uk: could not connect to host
-dssale.com: did not receive HSTS header
-dstat.cc: did not receive HSTS header
-dstvinstallalberton.co.za: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-dstvinstallfourways.co.za: did not receive HSTS header
-dstvinstallrandburg.co.za: could not connect to host
-dsyunmall.com: could not connect to host
-dt27.org: did not receive HSTS header
-dtcp8.com: could not connect to host
-dte.co.uk: did not receive HSTS header
-dtechstore.com.br: did not receive HSTS header
-dtk-vom-chausseehaus.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-dtpak.cz: max-age too low: 0
-dtub.co: could not connect to host
-dualascent.com: did not receive HSTS header
-dualias.xyz: could not connect to host
-duama.top: could not connect to host
-dubaosheng.com: could not connect to host
-dubik.su: did not receive HSTS header
-dubrovnik-dental.clinic: did not receive HSTS header
-ducalendars.com: could not connect to host
-duchateaugyn.be: did not receive HSTS header
-duchyoffeann.com: could not connect to host
-ducius.net: could not connect to host
-duckasylum.com: did not receive HSTS header
-duckeight.win: did not receive HSTS header
-duckyubuntu.tk: could not connect to host
-ducohosting.com: did not receive HSTS header
-duelsow.eu: could not connect to host
-duelysthub.com: could not connect to host
-duerls.de: did not receive HSTS header
-duerlund-falkenberg.dk: could not connect to host
-dugnet.tech: could not connect to host
-dui805.com: did not receive HSTS header
-dujsq.com: could not connect to host
-dujsq.top: did not receive HSTS header
-dukec.me: could not connect to host
-dukefox.com: did not receive HSTS header
-duks.com.br: could not connect to host
-dullsir.com: did not receive HSTS header
-dumbdemo.com: could not connect to host
-dumbfunded.co.uk: max-age too low: 0
-dumbomove.com.au: did not receive HSTS header
-dumont.ovh: did not receive HSTS header
-dumpsters.com: did not receive HSTS header
-dunamiscommunity.com: could not connect to host
-dunashoes.com: could not connect to host
-dundalkdonnie.com: could not connect to host
-dune.io: did not receive HSTS header
-dunea.nl: did not receive HSTS header
-dunesadventure.net: could not connect to host
-dung-massage.fr: could not connect to host
-dunloptrade.com: did not receive HSTS header
-duo.money: could not connect to host
-duocircle.com: did not receive HSTS header
-duole30.com: could not connect to host
-duonganhtuan.com: did not receive HSTS header
-duongpho.com: did not receive HSTS header
-durangoenergyllc.com: could not connect to host
-durchblick-shop.de: could not connect to host
-durexwinkel.nl: could not connect to host
-duroterm.ro: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-dushu.cat: could not connect to host
-duskopy.top: could not connect to host
-dusnan.com: could not connect to host
-dustycloth.com: could not connect to host
-dustyro.se: could not connect to host
-dutabisniz.com: did not receive HSTS header
-dutchdare.nl: did not receive HSTS header
-dutchrank.com: did not receive HSTS header
-dutyfreeonboard.com: could not connect to host
-duuu.ch: could not connect to host
-dverisochi.ru: did not receive HSTS header
-dvotx.org: did not receive HSTS header
-dw-loewe.de: could not connect to host
-dwbtoftshit.com: did not receive HSTS header
-dwellstudio.com: did not receive HSTS header
-dwhd.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-dwienzek.de: did not receive HSTS header
-dwilawyer.pro: did not receive HSTS header
-dwnld.me: could not connect to host
-dworekhetmanski.pl: did not receive HSTS header
-dy1d.com: could not connect to host
-dycem-ns.com: did not receive HSTS header
-dycoa.com: did not receive HSTS header
-dycontrol.de: could not connect to host
-dylanscott.com.au: did not receive HSTS header
-dylanwise.net: could not connect to host
-dyn-nserve.net: could not connect to host
-dynamic-innovations.net: could not connect to host
-dynamic-networks.be: could not connect to host
-dynamicsnetwork.net: could not connect to host
-dynamicyou.co.uk: could not connect to host
-dynamize.solutions: did not receive HSTS header
-dynamo.city: did not receive HSTS header
-dynastyredzone.com: could not connect to host
-dyyn.de: could not connect to host
-dz6729.com: could not connect to host
-dz6957.com: could not connect to host
-dzi.wtf: could not connect to host
-dzimejl.sk: did not receive HSTS header
-dzlibs.io: could not connect to host
-dzndk.net: could not connect to host
-dzndk.org: could not connect to host
-dzu.life: could not connect to host
-dzyabchenko.com: could not connect to host
-e-apack.com.br: could not connect to host
-e-aut.net: could not connect to host
-e-baraxolka.ru: could not connect to host
-e-beyond.de: could not connect to host
-e-biografias.net: could not connect to host
-e-boekhouden.nl: could not connect to host
-e-deca2.org: did not receive HSTS header
-e-fishing.tk: could not connect to host
-e-gemeinde.at: could not connect to host
-e-hon.link: did not receive HSTS header
-e-imzo.uz: did not receive HSTS header
-e-informatyk.tk: could not connect to host
-e-isfa.eu: did not receive HSTS header
-e-kontakti.fi: did not receive HSTS header
-e-mak.eu: could not connect to host
-e-migration.ch: could not connect to host
-e-newshub.com: could not connect to host
-e-oscar-web.net: did not receive HSTS header
-e-peets.tk: could not connect to host
-e-planetelec.fr: did not receive HSTS header
-e-pokupki.eu: did not receive HSTS header
-e-rickroll-r.pw: could not connect to host
-e-sa.com: could not connect to host
-e-surveillant.nl: did not receive HSTS header
-e-teacher.pl: did not receive HSTS header
-e-vau.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-e-vo-linka.cz: could not connect to host
-e-wishlist.net: could not connect to host
-e-yachts.tk: could not connect to host
-e00228.com: could not connect to host
-e024.org: could not connect to host
-e11even.nl: did not receive HSTS header
-e191.com: could not connect to host
-e30365.com: did not receive HSTS header
-e30gruppe.com: did not receive HSTS header
-e365.vip: could not connect to host
-e3amn2l.com: could not connect to host
-e3kids.com: could not connect to host
-e3leading.com: did not receive HSTS header
-e3leading.solutions: did not receive HSTS header
-e3leadingsolutions.com: did not receive HSTS header
-e3learning.institute: did not receive HSTS header
-e3li.org: did not receive HSTS header
-e4metech.com: did not receive HSTS header
-e505.net: could not connect to host
-e51888.com: could not connect to host
-e5197.co: could not connect to host
-e6729.co: could not connect to host
-e6729.com: did not receive HSTS header
-e6957.co: could not connect to host
-e6957.com: did not receive HSTS header
-e6ex.com: did not receive HSTS header
-e899365.com: could not connect to host
-e9297.co: could not connect to host
-e9397.com: could not connect to host
-e9721.com: could not connect to host
-e9728.co: could not connect to host
-e9a.at: could not connect to host
-eagle-aluminum.com: did not receive HSTS header
-eagle-yard.de: could not connect to host
-eaglesecurity.com: did not receive HSTS header
-ealadel.com: could not connect to host
-eam-gmbh.com: did not receive HSTS header
-eames-clayton.us: could not connect to host
-earga.sm: could not connect to host
-earlybirdsnacks.com: could not connect to host
-earlydocs.com: could not connect to host
-earlyimage.com.au: could not connect to host
-earn.wiki: could not connect to host
-earth-people.org: could not connect to host
-earthrise16.com: could not connect to host
-earthsgoldmine.com: did not receive HSTS header
-easelforart.com: could not connect to host
-easew.com: could not connect to host
-east-line.su: could not connect to host
-eastcoastbubbleandbounce.co.uk: could not connect to host
-eastcoastinflatables.co.uk: could not connect to host
-easthokkaido-5airport.jp: did not receive HSTS header
-eastman.space: could not connect to host
-eastmontgroup.com: did not receive HSTS header
-eastpeoria-il.gov: could not connect to host
-easy-factures.fr: could not connect to host
-easy-prono.fr: did not receive HSTS header
-easychiller.org: could not connect to host
-easycontentplan.com: could not connect to host
-easycosmetic.de: did not receive HSTS header
-easyenrollment.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-easykonto.de: did not receive HSTS header
-easymun.com: could not connect to host
-easyocm.hu: did not receive HSTS header
-easyoutdoor.nl: could not connect to host
-easypaymentnow.com: did not receive HSTS header
-easyplane.it: could not connect to host
-easyqr.codes: could not connect to host
-easyreal.ru: could not connect to host
-easyrents.com.ng: did not receive HSTS header
-easysimplecrm.com: could not connect to host
-easyssl.com.cn: did not receive HSTS header
-easytechsecurity.com: could not connect to host
-eat-the-world.ch: could not connect to host
-eat4happiness.com: did not receive HSTS header
-eatfitoutlet.com.br: could not connect to host
-eatlowcarb.de: did not receive HSTS header
-eats.soy: could not connect to host
-eattherich.us: did not receive HSTS header
-eatvisor.co.uk: could not connect to host
-eatz.com: could not connect to host
-eauclairecommerce.com: could not connect to host
-ebanking.raiffeisen.ch: did not receive HSTS header
-ebayinc.com: did not receive HSTS header
-ebcs-solutions.com: did not receive HSTS header
-ebecs.com: did not receive HSTS header
-ebene-bpo.com: did not receive HSTS header
-ebenvloedaanleggen.nl: could not connect to host
-ebertek.com: did not receive HSTS header
-ebiografias.com.br: could not connect to host
-ebolsa.com.br: could not connect to host
-ebolsas.com.br: did not receive HSTS header
-ebooklaunchers.com: could not connect to host
-ebooksgratuits.org: could not connect to host
-ebooktoan.com: did not receive HSTS header
-ebop.ch: could not connect to host
-ebp2p.com: could not connect to host
-ebraph.com: could not connect to host
-ebrowz.com: could not connect to host
-ec-baran.de: could not connect to host
-eca.edu.au: did not receive HSTS header
-ecacollege.nsw.edu.au: did not receive HSTS header
-ecake.in: could not connect to host
-ecc-kaufbeuren.de: could not connect to host
-ecclesia-koeln.de: did not receive HSTS header
-eccux.com: could not connect to host
-ecelembrou.ovh: could not connect to host
-ecfs.link: could not connect to host
-ecfunstalls.com: could not connect to host
-ecg.fr: could not connect to host
-echi.pw: could not connect to host
-echipstore.com: could not connect to host
-echo.cc: could not connect to host
-echoactive.com: max-age too low: 7776000
-echomall.cn: could not connect to host
-echomanchester.net: did not receive HSTS header
-echoteam.gq: could not connect to host
-echoteen.com: did not receive HSTS header
-echtes-hutzelbrot.de: could not connect to host
-echtgeld-casinos.de: could not connect to host
-eckro.com: did not receive HSTS header
-eclanet.ca: could not connect to host
-ecliptic.cc: could not connect to host
-eco-wiki.com: could not connect to host
-ecobrain.be: max-age too low: 0
-ecoder.co: did not receive HSTS header
-ecolala.my: could not connect to host
-ecole-en-danger.fr: could not connect to host
-ecole-iaf.fr: could not connect to host
-ecole-maternelle-saint-joseph.be: could not connect to host
-ecologikashop.com: could not connect to host
-ecomlane.com: could not connect to host
-ecommercestore.net.br: could not connect to host
-ecomparemo.com: did not receive HSTS header
-ecompen.co.za: could not connect to host
-econativa.pt: could not connect to host
-economic-sanctions.com: could not connect to host
-economy.st: could not connect to host
-economycarrentalscyprus.com: could not connect to host
-econverter.cloud: did not receive HSTS header
-ecorus.eu: did not receive HSTS header
-ecoskif.ru: could not connect to host
-ecosoftconsult.com: could not connect to host
-ecosystemmanager.azurewebsites.net: did not receive HSTS header
-ecotaxi2airport.com: could not connect to host
-ecotechnologyti.com: did not receive HSTS header
-ecotruck-pooling.com: did not receive HSTS header
-ecp.ae: did not receive HSTS header
-ecredits-dev-app-backoffice01.azurewebsites.net: could not connect to host
-ecredits-dev-app-partner01.azurewebsites.net: could not connect to host
-ecrimex.net: did not receive HSTS header
-ectora.com: could not connect to host
-ecuinformacion.com: could not connect to host
-ecupcafe.com: could not connect to host
-ed-matters.org: did not receive HSTS header
-ed4becky.net: did not receive HSTS header
-edakoe.ru: did not receive HSTS header
-edati.lv: could not connect to host
-edcphenix.tk: could not connect to host
-eddmixpanel.com: could not connect to host
-eddy-vh.com: could not connect to host
-edeka-jbl-treueaktion.de: could not connect to host
-edelblack.ch: could not connect to host
-edelsteincosmetic.com: did not receive HSTS header
-eden-institut-carita-valdisere.com: did not receive HSTS header
-eden-mobility.co.uk: did not receive HSTS header
-eden-noel.at: could not connect to host
-edenaya.com: could not connect to host
-edenvaleplumber24-7.co.za: did not receive HSTS header
-edenvalerubbleremovals.co.za: did not receive HSTS header
-edge-cloud.net: could not connect to host
-edgecustomersportal.com: could not connect to host
-edgedynasty.com: could not connect to host
-edgereinvent.com: could not connect to host
-edgevelder.com: did not receive HSTS header
-edilane.com: could not connect to host
-edilane.de: could not connect to host
-edisonchee.com: did not receive HSTS header
-edissecurity.sk: did not receive HSTS header
-editoraacademiacrista.com.br: could not connect to host
-editoraimaculada.com.br: did not receive HSTS header
-edix.ru: could not connect to host
-edk.com.tr: did not receive HSTS header
-edoss.co.za: did not receive HSTS header
-edpubs.gov: could not connect to host
-edsh.de: did not receive HSTS header
-eduard-dopler.de: could not connect to host
-eduardnikolenko.com: could not connect to host
-eduardnikolenko.ru: could not connect to host
-educaid.be: did not receive HSTS header
-educatio.tech: could not connect to host
-educationalstage.com: did not receive HSTS header
-educationtree.tk: could not connect to host
-educationunlimited.com: did not receive HSTS header
-educator-one.com: could not connect to host
-educators.co.nz: did not receive HSTS header
-educatoys.com.br: could not connect to host
-educatweb.de: did not receive HSTS header
-educnum.fr: did not receive HSTS header
-educourse.ga: could not connect to host
-eduif.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-edumi.com: did not receive HSTS header
-edupool.in: could not connect to host
-edusantorini.com: could not connect to host
-edusitios.com: could not connect to host
-eduvance.in: did not receive HSTS header
-edv-bv.de: did not receive HSTS header
-edvinaspaliskis.lt: did not receive HSTS header
-edwar.do: did not receive HSTS header
-edwarddekker.nl: did not receive HSTS header
-edwards.me.uk: could not connect to host
-edwardwall.me: did not receive HSTS header
-ee-terminals.com: could not connect to host
-ee5197.co: could not connect to host
-ee6729.co: could not connect to host
-ee6729.com: did not receive HSTS header
-ee6957.co: could not connect to host
-ee9297.co: could not connect to host
-ee9397.com: could not connect to host
-ee9721.com: could not connect to host
-ee9728.co: could not connect to host
-eeb98.com: could not connect to host
-eecs388.org: did not receive HSTS header
-eeetrust.org: could not connect to host
-eenekorea.com: did not receive HSTS header
-eengezinswoning-in-alphen-aan-den-rijn-kopen.nl: could not connect to host
-eengezinswoning-in-de-friese-meren-kopen.nl: could not connect to host
-eengezinswoning-in-friesland-kopen.nl: could not connect to host
-eengezinswoning-in-leeuwarden-kopen.nl: could not connect to host
-eengezinswoning-in-pekela-kopen.nl: could not connect to host
-eengezinswoning-in-rijnwaarden-kopen.nl: could not connect to host
-eengezinswoning-in-sudwest-fryslan-kopen.nl: could not connect to host
-eengezinswoning-in-zeeland-kopen.nl: could not connect to host
-eengezinswoning-in-zuid-holland-kopen.nl: could not connect to host
-eengezinswoning-in-zuidplas-kopen.nl: could not connect to host
-eengezinswoning-in-zwartewaterland-kopen.nl: could not connect to host
-eengezinswoningverkopen.nl: could not connect to host
-eengoedenotaris.nl: did not receive HSTS header
-eenhoorn.ga: could not connect to host
-eeqj.com: did not receive HSTS header
-eerlijktransport.nl: could not connect to host
-eesistumine2017.ee: could not connect to host
-eez.ee: could not connect to host
-efa-football.com: did not receive HSTS header
-eff-bee-eye.de: did not receive HSTS header
-effectiveosgi.com: could not connect to host
-effer.me: could not connect to host
-effero.net: did not receive HSTS header
-efficienthealth.com: could not connect to host
-effizienta.ch: did not receive HSTS header
-efflam.net: could not connect to host
-efg-darmstadt.de: did not receive HSTS header
-eftcorp.biz: did not receive HSTS header
-eftelingcraft.net: could not connect to host
-efzh2so1cuskp9j3evlqa1m68id-m9p1tzb05zo.com: did not receive HSTS header
-egamespw.com: did not receive HSTS header
-eganassociates.com.au: did not receive HSTS header
-egbert.net: max-age too low: 3600
-egfl.org.uk: did not receive HSTS header
-egge.com: max-age too low: 0
-eggplant.today: could not connect to host
-eggqvq.com: could not connect to host
-egicloud.com: did not receive HSTS header
-egit.co: could not connect to host
-eglek.com: could not connect to host
-ego-world.org: could not connect to host
-egoroof.ru: did not receive HSTS header
-egumenita.ro: did not receive HSTS header
-egupova.ru: did not receive HSTS header
-ehdud8451.gq: could not connect to host
-ehdud8451.tk: could not connect to host
-ehealthcounselor.com: could not connect to host
-ehealthfest.com: did not receive HSTS header
-ehertz.uk: could not connect to host
-ehipaadev.com: could not connect to host
-ehito.ovh: could not connect to host
-ehr.gov: could not connect to host
-ehrenamt-skpfcw.de: could not connect to host
-ehrlichesbier.de: could not connect to host
-ehseller.com: did not receive HSTS header
-ehsellert.com: did not receive HSTS header
-ehuber.info: could not connect to host
-eiadaladel.com: could not connect to host
-eiao.me: could not connect to host
-eicfood.com: could not connect to host
-eichornenterprises.com: could not connect to host
-eidolonhost.com: did not receive HSTS header
-eidolons.org: could not connect to host
-eifel.website: could not connect to host
-eiga-movie.com: max-age too low: 0
-eigenbubi.de: could not connect to host
-eigo.work: did not receive HSTS header
-eika.as: did not receive HSTS header
-eilandprojectkeukens.nl: could not connect to host
-einfachmaldiefressehalten.de: could not connect to host
-einhorn.space: could not connect to host
-einmonolog.de: could not connect to host
-einquiz.de: did not receive HSTS header
-einsatzstiefel.info: could not connect to host
-einsit.com: could not connect to host
-einsitapis.com: could not connect to host
-einsteincapital.ca: could not connect to host
-eipione.com: could not connect to host
-eisblau.org: could not connect to host
-eismaschine-vergleich.de: did not receive HSTS header
-eitler.cx: max-age too low: 7776000
-ejeff.org: did not receive HSTS header
-ejgconsultancy.co.uk: could not connect to host
-ejuicelab.co.uk: did not receive HSTS header
-ejusu.com: could not connect to host
-ek.network: did not receive HSTS header
-ekawaiishop.com: could not connect to host
-ekbanden.nl: did not receive HSTS header
-ekeblock.com: could not connect to host
-ekobudisantoso.net: could not connect to host
-ekodevices.com: did not receive HSTS header
-ekole.shop: could not connect to host
-ekong366.com: could not connect to host
-ekostrateg.com: did not receive HSTS header
-ekpyroticfrood.net: did not receive HSTS header
-ekrana.info: could not connect to host
-eksik.com: could not connect to host
-ekuatorial.com: did not receive HSTS header
-el-soul.com: did not receive HSTS header
-elaintehtaat.fi: did not receive HSTS header
-elan-organics.com: did not receive HSTS header
-elanguest.pl: could not connect to host
-elanguest.ro: could not connect to host
-elanguest.ru: could not connect to host
-elaxy-online.de: could not connect to host
-elbaal.gov: did not receive HSTS header
-elblein.de: did not receive HSTS header
-elchamandelaprosperidad.org: could not connect to host
-elcontadorsac.com: could not connect to host
-eldenelesat.com: could not connect to host
-elderoost.com: did not receive HSTS header
-eldietista.es: did not receive HSTS header
-eldinhadzic.com: did not receive HSTS header
-eldisagjapi.com: could not connect to host
-eldisagjapi.de: could not connect to host
-ele-sm.com: could not connect to host
-elearningpilot.com: did not receive HSTS header
-eleaut.com.br: did not receive HSTS header
-electmikewaters.com: max-age too low: 0
-electricalcontrolpanels.co.uk: did not receive HSTS header
-electricalpacificpalisades.com: could not connect to host
-electricant.com: did not receive HSTS header
-electricant.nl: did not receive HSTS header
-electricfencebenoni.co.za: could not connect to host
-electricfencesandton.co.za: did not receive HSTS header
-electrician-umhlanga.co.za: did not receive HSTS header
-electricianforum.co.uk: did not receive HSTS header
-electricianpacificpalisades.com: could not connect to host
-electricianumhlangarocks.co.za: did not receive HSTS header
-electricienasnieres.fr: could not connect to host
-electricoperaduo.com: did not receive HSTS header
-electroinkoophardenberg.nl: could not connect to host
-electromc.com: did not receive HSTS header
-electronicbub.com: did not receive HSTS header
-eled.io: could not connect to host
-elefandt.com: did not receive HSTS header
-elefantevoador.com: could not connect to host
-elektro-collee.de: did not receive HSTS header
-elektromotor.tk: could not connect to host
-elektronische-post.org: did not receive HSTS header
-elektronring.com: could not connect to host
-element-43.com: did not receive HSTS header
-elementalict.com: did not receive HSTS header
-elementalrobotics.com: could not connect to host
-elemenx.com: did not receive HSTS header
-elemprendedor.com.ve: could not connect to host
-elenag.ga: could not connect to host
-elenagherta.ga: could not connect to host
-elenoon.ir: did not receive HSTS header
-elenorsmadness.org: could not connect to host
-eleonorengland.com: did not receive HSTS header
-elevateandprosper.com: could not connect to host
-elevationcreative.net: could not connect to host
-elevationfilms.net: could not connect to host
-elevator.ee: could not connect to host
-elgacien.de: could not connect to host
-elhall.pro: did not receive HSTS header
-elhall.ru: did not receive HSTS header
-elia.cloud: could not connect to host
-elias-nicolas.com: did not receive HSTS header
-elib.com: did not receive HSTS header
-elielaloum.com: could not connect to host
-elimdengelen.com: did not receive HSTS header
-eliminercellulite.com: could not connect to host
-eliolita.com: could not connect to host
-elisechristie.com: could not connect to host
-elite-box.com: did not receive HSTS header
-elite-box.org: did not receive HSTS header
-elitebike.com.co: could not connect to host
-elitecovering.fr: did not receive HSTS header
-elitedangerous.wiki: did not receive HSTS header
-elitefishtank.com: could not connect to host
-elitehosting.de: did not receive HSTS header
-elitenutritionoficial.com: could not connect to host
-elitepaintingsa.com.au: did not receive HSTS header
-elitesensual.com.br: could not connect to host
-eliyah.co.il: did not receive HSTS header
-elizabethgreenfield.com: could not connect to host
-ell-net.tokyo: could not connect to host
-ellbusiness.com: could not connect to host
-elliff.net: did not receive HSTS header
-elliotgluck.com: could not connect to host
-elliriehl.at: did not receive HSTS header
-elmar-kraamzorg.nl: did not receive HSTS header
-elna-service.com.ua: did not receive HSTS header
-elnoorandelmohanad.com: did not receive HSTS header
-elnutricionista.es: could not connect to host
-elo.fyi: could not connect to host
-elodieclerc.ch: could not connect to host
-elohellp.com: could not connect to host
-elohna.ch: did not receive HSTS header
-elon.gov: could not connect to host
-elonbase.com: could not connect to host
-elonm.ru: could not connect to host
-elonma.gov: could not connect to host
-elosrah.com: did not receive HSTS header
-eloxt.com: could not connect to host
-elpado.de: did not receive HSTS header
-elpaseadordeperros.com: could not connect to host
-elpay.kz: could not connect to host
-elpo.xyz: could not connect to host
-elsagradocoran.org: could not connect to host
-elsamakhin.com: could not connect to host
-elsemanario.com: did not receive HSTS header
-elsitar.com: could not connect to host
-elsword.moe: could not connect to host
-eltagroup.co.uk: did not receive HSTS header
-eltonpastilha.me: could not connect to host
-eltransportquevolem.org: could not connect to host
-eltrox.me: could not connect to host
-elucron.com: could not connect to host
-eluft.de: did not receive HSTS header
-elvcino.com: could not connect to host
-elvidence.com.au: did not receive HSTS header
-elxsi.de: did not receive HSTS header
-elyisus.info: could not connect to host
-elysium.coop: could not connect to host
-elytronsecurity.com: did not receive HSTS header
-email.lookout.com: could not connect to host
-email2rss.net: could not connect to host
-emailalaperformance.fr: could not connect to host
-emailcontrol.nl: did not receive HSTS header
-emailfuermich.de: did not receive HSTS header
-emailing.alsace: could not connect to host
-emailtools.io: could not connect to host
-emanatepixels.com: could not connect to host
-emanga.su: could not connect to host
-emanuela-gabriela.co.uk: did not receive HSTS header
-emasex.com: did not receive HSTS header
-emavok.eu: could not connect to host
-embellir-aroma.com: could not connect to host
-embellir-kyujin.com: could not connect to host
-embracethedarkness.co.uk: could not connect to host
-embroidered-stuff.com: could not connect to host
-embudospro.net: could not connect to host
-emcentrix-com-site-mvc.azurewebsites.net: could not connect to host
-emeldi-commerce.com: max-age too low: 0
-emeraldcoastrideshare.com: did not receive HSTS header
-emeraldonion.org: did not receive HSTS header
-emergeandsee.com: did not receive HSTS header
-emergencymedicinefoundations.com: did not receive HSTS header
-emergentvisiontec.com: did not receive HSTS header
-emergenzalavoro.com: did not receive HSTS header
-emero.de: did not receive HSTS header
-emesolutions.net: did not receive HSTS header
-emi-air-comprime.com: did not receive HSTS header
-emiele.com.br: could not connect to host
-emil-dein-baecker.com: could not connect to host
-emilecourriel.com: could not connect to host
-emiliemunsch.com: did not receive HSTS header
-emilreimann.de: could not connect to host
-emils-chemnitz.de: could not connect to host
-emils1910.de: could not connect to host
-emilyhorsman.com: could not connect to host
-emilyshepherd.me: did not receive HSTS header
-eminententerprises.io: could not connect to host
-eminhuseynov.com: did not receive HSTS header
-eminovic.me: could not connect to host
-emissary.coffee: did not receive HSTS header
-emivauthey.com: could not connect to host
-emjainteractive.com: did not receive HSTS header
-emjimadhu.com: could not connect to host
-emkanrecords.com: did not receive HSTS header
-emkei.cz: did not receive HSTS header
-emma-o.com: could not connect to host
-emma.ca: did not receive HSTS header
-emma.ly: did not receive HSTS header
-emmababy420.com: could not connect to host
-emmable.com: did not receive HSTS header
-emmanuelle-et-julien.ch: could not connect to host
-emmdy.com: did not receive HSTS header
-emmehair.com: did not receive HSTS header
-emnitech.com: could not connect to host
-emo-poris.com: could not connect to host
-emojiengine.com: did not receive HSTS header
-emoticonesjaponeses.com: did not receive HSTS header
-emotuit.com: did not receive HSTS header
-emperor.blog: could not connect to host
-empese.com: could not connect to host
-empire24.co: could not connect to host
-empireauto-2000.com: could not connect to host
-empleosentorreon.mx: could not connect to host
-empleostampico.com: did not receive HSTS header
-employeestore.org: did not receive HSTS header
-emporiovinareal.com.br: could not connect to host
-emprendeconchrisfx.com: could not connect to host
-emprendeperuano.com: could not connect to host
-emprunterlivre.ci: did not receive HSTS header
-empty-r.com: could not connect to host
-emptyadjacentpossible.com: did not receive HSTS header
-emptypath.com: did not receive HSTS header
-emsadi.org: could not connect to host
-emtradingacademy.com: could not connect to host
-emulovers.com: could not connect to host
-emupedia.net: did not receive HSTS header
-emyself.info: could not connect to host
-en4u.org: could not connect to host
-enaia.fr: did not receive HSTS header
-encadrer-mon-enfant.com: did not receive HSTS header
-encens.boutique: did not receive HSTS header
-encode.space: could not connect to host
-encode.uk.com: did not receive HSTS header
-encoder.pw: could not connect to host
-encontrebarato.com.br: could not connect to host
-encore.io: could not connect to host
-encrypt.org.uk: could not connect to host
-encryptallthethings.net: could not connect to host
-encrypted.google.com: did not receive HSTS header (error ignored - included regardless)
-encryptedaudience.com: could not connect to host
-encryptio.com: could not connect to host
-encryptmycard.com: could not connect to host
-encuentratumueble.com: did not receive HSTS header
-end.pp.ua: could not connect to host
-endangeredwatch.com: could not connect to host
-ende-x.com: could not connect to host
-enderszone.com: did not receive HSTS header
-endlesstone.com: did not receive HSTS header
-endofinternet.goip.de: could not connect to host
-endofodo.goip.de: could not connect to host
-endohaus.ca: could not connect to host
-endohaus.com: could not connect to host
-endohaus.eu: could not connect to host
-endohaus.us: could not connect to host
-endspamwith.us: could not connect to host
-enecoshop.nl: could not connect to host
-enefan.jp: could not connect to host
-enelacto.com: could not connect to host
-energethik-tulln.at: did not receive HSTS header
-energisammenslutningen.dk: did not receive HSTS header
-energyatlas.com: could not connect to host
-enersaveapp.org: could not connect to host
-enersec.co.uk: could not connect to host
-enfield-kitchens.co.uk: did not receive HSTS header
-enfoqueseguro.com: did not receive HSTS header
-enfu.se: could not connect to host
-engineowning.com: did not receive HSTS header
-enginx.cn: did not receive HSTS header
-englandschool.tk: could not connect to host
-englerts.de: did not receive HSTS header
-englishclub.com: did not receive HSTS header
-englishdirectory.de: could not connect to host
-englishyamal.ru: did not receive HSTS header
-engrish.ml: could not connect to host
-enigmacpt.com: did not receive HSTS header
-enigmadjradio.com: could not connect to host
-enigmail.net: did not receive HSTS header
-enijew.com: could not connect to host
-enjin.io: did not receive HSTS header
-enjoymayfield.com: max-age too low: 0
-enjoystudio.ro: did not receive HSTS header
-enlatte.com: could not connect to host
-enlazaresbueno.cl: could not connect to host
-enlightened.si: did not receive HSTS header
-enlightenedmind.co: could not connect to host
-enlightenment.org: did not receive HSTS header
-enlightenth.com: did not receive HSTS header
-enomada.net: could not connect to host
-enoou.com: could not connect to host
-enord.fr: did not receive HSTS header
-enpalmademallorca.info: could not connect to host
-ensemble-vos-idees.fr: did not receive HSTS header
-enskat.de: could not connect to host
-enskatson-sippe.de: could not connect to host
-entaurus.com: could not connect to host
-enteente.club: could not connect to host
-enteente.com: could not connect to host
-enteente.space: could not connect to host
-enteente.xyz: did not receive HSTS header
-enterclaim.com: did not receive HSTS header
-enterdev.co: did not receive HSTS header
-enteres.eu: did not receive HSTS header
-enterprisecarclub.co.uk: did not receive HSTS header
-enterprisechannel.asia: did not receive HSTS header
-enterprisey.enterprises: could not connect to host
-enterprivacy.com: did not receive HSTS header
-entersynapse.com: could not connect to host
-entourneebeetle.com: could not connect to host
-entravex.com: did not receive HSTS header
-entrepreneur.or.id: could not connect to host
-entreprise-toiture-clement.fr: could not connect to host
-enum.eu.org: could not connect to host
-enumify.com: could not connect to host
-envelope.co.nz: did not receive HSTS header
-enveloppenopmaat.nl: could not connect to host
-enviapresentes.com.br: could not connect to host
-enviatufoto.com: did not receive HSTS header
-environment.ai: could not connect to host
-environmentkirklees.org: did not receive HSTS header
-envirotech.com.au: did not receive HSTS header
-envoutement-desenvoutement.com: did not receive HSTS header
-envoyglobal.com: did not receive HSTS header
-envoyworld.com: could not connect to host
-envygeeks.com: did not receive HSTS header
-envygeeks.io: did not receive HSTS header
-eol34.com: could not connect to host
-eoldb.org: could not connect to host
-eolme.ml: could not connect to host
-eonet.cc: did not receive HSTS header
-eos-classic.io: could not connect to host
-eosol.services: could not connect to host
-eosol.zone: could not connect to host
-epanurse.com: could not connect to host
-epasar.my: could not connect to host
-epaslaugos.lt: did not receive HSTS header
-epave.paris: could not connect to host
-epaygateway.net: could not connect to host
-ephe.be: did not receive HSTS header
-ephry.com: could not connect to host
-epicbouncycastlehirenorwich.co.uk: could not connect to host
-epicmc.games: could not connect to host
-epicsecure.de: could not connect to host
-epo32.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-eposcloud.net: did not receive HSTS header
-eposmidlands.co.uk: could not connect to host
-eposnewport.co.uk: could not connect to host
-eposnottingham.co.uk: could not connect to host
-eposreading.co.uk: could not connect to host
-eposreview.co.uk: could not connect to host
-epossurrey.co.uk: could not connect to host
-epossussex.co.uk: could not connect to host
-epossystems.co.uk: could not connect to host
-eposwales.co.uk: could not connect to host
-epoxate.com: did not receive HSTS header
-eprofitacademy.com: did not receive HSTS header
-epsorting.cz: did not receive HSTS header
-epulsar.ru: could not connect to host
-epvin.com: did not receive HSTS header
-eq8.net.au: could not connect to host
-eqib.nl: did not receive HSTS header
-eqim.me: could not connect to host
-eqorg.com: could not connect to host
-equallove.me: could not connect to host
-equallyy.com: did not receive HSTS header
-equalparts.eu: did not receive HSTS header
-equeim.ru: did not receive HSTS header
-equi.ac: could not connect to host
-equilibre-yoga-jennifer-will.com: could not connect to host
-equipeferramentas.com.br: did not receive HSTS header
-equippers.de: did not receive HSTS header
-equipsupply.com: did not receive HSTS header
-equitee.co: did not receive HSTS header
-er-music.com: could not connect to host
-erad.fr: did not receive HSTS header
-erclab.kr: could not connect to host
-erclaim.com: could not connect to host
-ereader.uno: could not connect to host
-erecciontotalal100.com: could not connect to host
-erectiepillenwinkel.nl: did not receive HSTS header
-erepublik-deutschland.de: did not receive HSTS header
-eressea.xyz: could not connect to host
-erevan-news.tk: could not connect to host
-ergovitanet.com.br: could not connect to host
-ericbond.net: could not connect to host
-erichalv.com: could not connect to host
-ericisaweso.me: did not receive HSTS header
-ericloud.tk: could not connect to host
-erico.jp: did not receive HSTS header
-ericorporation.com: did not receive HSTS header
-ericschwartzlive.com: did not receive HSTS header
-ericwie.se: did not receive HSTS header
-ericyl.com: could not connect to host
-eriel.com.br: could not connect to host
-erikserver2.tk: could not connect to host
-erikw.me: could not connect to host
-erikwagner.de: did not receive HSTS header
-eriner.me: could not connect to host
-erinlin.com: did not receive HSTS header
-eriser.fr: could not connect to host
-erixschueler.de: max-age too low: 0
-ernaehrungsberatung-rapperswil.ch: did not receive HSTS header
-ernaehrungsberatung-zurich.ch: did not receive HSTS header
-ernesto.at: could not connect to host
-ernsteisprung.ch: could not connect to host
-eroimatome.com: could not connect to host
-eromixx.com: did not receive HSTS header
-eromond.com: did not receive HSTS header
-eroskines.com: could not connect to host
-erotalia.es: could not connect to host
-erotic4me.ch: did not receive HSTS header
-eroticforce.com: did not receive HSTS header
-erotische-aanbiedingen.nl: could not connect to host
-erotpo.cz: did not receive HSTS header
-erperium.com: did not receive HSTS header
-erpiv.com: did not receive HSTS header
-errlytics.com: could not connect to host
-errolz.com: could not connect to host
-errors.zenpayroll.com: could not connect to host
-erspro.net: could not connect to host
-eru.me: could not connect to host
-eruvalerts.com: did not receive HSTS header
-erverydown.ml: did not receive HSTS header
-erwinvanlonden.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-es8888.net: could not connect to host
-es888999.com: could not connect to host
-esailinggear.com: could not connect to host
-esatn.gov: could not connect to host
-esb111.com: could not connect to host
-esb111.net: could not connect to host
-esb112.com: could not connect to host
-esb112.net: could not connect to host
-esb116.com: did not receive HSTS header
-esb1314.net: could not connect to host
-esb1668.com: could not connect to host
-esb16888.com: could not connect to host
-esb17888.com: could not connect to host
-esb222.net: could not connect to host
-esb555.com: could not connect to host
-esb556.com: could not connect to host
-esb5889.net: did not receive HSTS header
-esb666.com: could not connect to host
-esb666.net: could not connect to host
-esb66666.com: could not connect to host
-esb688.com: could not connect to host
-esb68888.com: could not connect to host
-esb777.cc: could not connect to host
-esb777.com: could not connect to host
-esb777.me: could not connect to host
-esb777.net: could not connect to host
-esb777.us: could not connect to host
-esb8886.com: could not connect to host
-esb999.biz: could not connect to host
-esb999.com: could not connect to host
-esb999.info: could not connect to host
-esb999.us: could not connect to host
-esba11.cc: could not connect to host
-esba11.in: did not receive HSTS header
-esba11.net: could not connect to host
-esba11.us: could not connect to host
-esball.in: could not connect to host
-esball888.com: could not connect to host
-esball888.net: could not connect to host
-esbuilders.co.nz: did not receive HSTS header
-escalate.eu: did not receive HSTS header
-escalesensorielle.com: max-age too low: 604800
-escape2rooms.fr: did not receive HSTS header
-escapees.com: did not receive HSTS header
-escapejoplin.com: did not receive HSTS header
-escaperoomservices.com: did not receive HSTS header
-escapessolutions.com: could not connect to host
-escargotbistro.com: did not receive HSTS header
-escolaengenharia.com.br: did not receive HSTS header
-escolibri.com: could not connect to host
-escort-byuro.net: did not receive HSTS header
-escort-fashion.com: could not connect to host
-escortaccess.net: could not connect to host
-escortdisplay.com: could not connect to host
-escortlistings.eu: could not connect to host
-escortlistings.fr: could not connect to host
-escortlistings.us: could not connect to host
-escortlistingsuk.co.uk: could not connect to host
-escortmantra.com: could not connect to host
-escortshotsexy.com: could not connect to host
-escotour.com: did not receive HSTS header
-escueladego.tk: could not connect to host
-escueladewordpress.com: did not receive HSTS header
-escxtra.com: did not receive HSTS header
-esd.cc: did not receive HSTS header
-esec.rs: did not receive HSTS header
-eshepperd.com: did not receive HSTS header
-eshobe.com: could not connect to host
-eshtapay.com: could not connect to host
-eshterry.com: did not receive HSTS header
-esibun.net: could not connect to host
-esipublications.com: did not receive HSTS header
-esko.bar: did not receive HSTS header
-esln.org: did not receive HSTS header
-esmincg2t1.com: could not connect to host
-esn-ypci.com: did not receive HSTS header
-esocweb.com: could not connect to host
-esote.net: did not receive HSTS header
-esoterik.link: could not connect to host
-esp-berlin.de: could not connect to host
-esp-desarrolladores.com: could not connect to host
-esp.community: could not connect to host
-esp8285.store: could not connect to host
-espacemontmorency.com: did not receive HSTS header
-espacioantiguo.com: could not connect to host
-espanolseguros.com: did not receive HSTS header
-espanova.com: did not receive HSTS header
-especificosba.com.mx: could not connect to host
-espenandersen.no: did not receive HSTS header
-esphigmenou.gr: did not receive HSTS header
-espo.com.ua: did not receive HSTS header
-esports-network.de: could not connect to host
-espra.com: could not connect to host
-espressivo.com.br: did not receive HSTS header
-esprit-cloture.fr: did not receive HSTS header
-esquisse.fr: did not receive HSTS header
-esquonic.com: could not connect to host
-esrs.gov: could not connect to host
-ess-cert.ru: did not receive HSTS header
-essayads.com: did not receive HSTS header
-essaywebsite.com: did not receive HSTS header
-essenceofvitalitydetox.com: could not connect to host
-essenciasparis.com.br: could not connect to host
-essential12.com: could not connect to host
-essentialoilsimports.com: could not connect to host
-essentiel-physique.com: could not connect to host
-essenzialeenxovais.com.br: could not connect to host
-esseriumani.com: could not connect to host
-essexghosthunters.co.uk: did not receive HSTS header
-essplusmed.org: could not connect to host
-establo.pro: could not connect to host
-estaciona.guru: could not connect to host
-estate360.co.tz: could not connect to host
-estateczech-eu.ru: could not connect to host
-estebanborges.com: did not receive HSTS header
-estespr.com: did not receive HSTS header
-estetistarimini.it: did not receive HSTS header
-esthesoleil.jp: did not receive HSTS header
-estilosapeca.com: could not connect to host
-estland.guide: could not connect to host
-estonia.net: could not connect to host
-estoniantrade.ee: did not receive HSTS header
-estudio21pattern.com: could not connect to host
-estudioamazonico.com: could not connect to host
-estudiserradal.com: did not receive HSTS header
-esu.wiki: could not connect to host
-esu.zone: could not connect to host
-esurety.net: did not receive HSTS header
-esw00.com: could not connect to host
-esw06.com: could not connect to host
-esw07.com: could not connect to host
-esw08.com: could not connect to host
-esw09.com: could not connect to host
-eswap.cz: could not connect to host
-esyume.com: could not connect to host
-et-buchholz.de: could not connect to host
-et180.com: could not connect to host
-etalent.net: did not receive HSTS header
-etangs-magazine.com: could not connect to host
-etaoinwu.tk: could not connect to host
-etaxi.tn: did not receive HSTS header
-etd-glasfaser.de: did not receive HSTS header
-etdonline.co.uk: did not receive HSTS header
-eteapparel.com: did not receive HSTS header
-etenendrinken.nu: could not connect to host
-eternalflame.cn: could not connect to host
-eternitylove.us: could not connect to host
-etfacta.com: could not connect to host
-eth-faucet.net: could not connect to host
-eth9.net: could not connect to host
-ethaligan.fr: could not connect to host
-ethan.pm: could not connect to host
-ethandelany.me: could not connect to host
-ethanfaust.com: did not receive HSTS header
-ethantskinner.com: did not receive HSTS header
-ether.school: could not connect to host
-ethercalc.com: could not connect to host
-etherderbies.com: could not connect to host
-ethergeist.de: did not receive HSTS header
-etheria-software.tk: did not receive HSTS header
-etherium.org: could not connect to host
-etherpad.fr: could not connect to host
-ethicalexploiting.com: did not receive HSTS header
-ethicall.org.uk: did not receive HSTS header
-ethicaltek.com: could not connect to host
-ethiopiannews247.com: could not connect to host
-ethosinfo.com: could not connect to host
-etidni.help: did not receive HSTS header
-etikus-hacker.hu: could not connect to host
-etincelle.ml: could not connect to host
-etk2000.com: did not receive HSTS header
-etmirror.top: could not connect to host
-etmirror.xyz: could not connect to host
-etnis.id: did not receive HSTS header
-etny.nl: could not connect to host
-etoto.pl: did not receive HSTS header
-etproxy.tech: could not connect to host
-etrolleybizstore.com: could not connect to host
-etsservicios.com: could not connect to host
-etssquare.com: did not receive HSTS header
-etsysecure.com: could not connect to host
-ettebiz.com: max-age too low: 0
-etula.ga: could not connect to host
-etula.me: could not connect to host
-etys.no: did not receive HSTS header
-etzi.myds.me: could not connect to host
-euaggelion.blog.br: could not connect to host
-euanbaines.com: did not receive HSTS header
-eucl3d.com: did not receive HSTS header
-euclideanpostulates.xyz: could not connect to host
-eucollegetours.com: could not connect to host
-euexia.fr: could not connect to host
-eugenechae.com: did not receive HSTS header
-eujuicers.com.tr: could not connect to host
-eulenleben.de: could not connect to host
-eulerpi.io: did not receive HSTS header
-eung.ga: could not connect to host
-eupay.de: could not connect to host
-eupbor.com: could not connect to host
-euph.eu: could not connect to host
-eupho.me: could not connect to host
-eupresidency2018.com: did not receive HSTS header
-eurekaarchi.com: could not connect to host
-eurekaarchitecture.com: could not connect to host
-eurekz.com: did not receive HSTS header
-euren.se: could not connect to host
-eurheilu.com: did not receive HSTS header
-euro-servers.de: could not connect to host
-eurocamping.se: could not connect to host
-euroescortguide.com: could not connect to host
-euroman.ga: could not connect to host
-europapier.at: could not connect to host
-europapier.ba: could not connect to host
-europapier.bg: could not connect to host
-europapier.com: could not connect to host
-europapier.cz: could not connect to host
-europapier.hr: could not connect to host
-europapier.hu: could not connect to host
-europapier.net: could not connect to host
-europapier.rs: could not connect to host
-europapier.si: could not connect to host
-europapier.sk: could not connect to host
-europapier.ua: could not connect to host
-europeanpreppers.com: could not connect to host
-europeantransportmanagement.com: did not receive HSTS header
-euroservice.com.gr: did not receive HSTS header
-euroshop24.net: could not connect to host
-eurospecautowerks.com: did not receive HSTS header
-eurostrategy.vn.ua: could not connect to host
-eurotime.ua: did not receive HSTS header
-eurotravelstar.eu: did not receive HSTS header
-euteamo.cn: did not receive HSTS header
-eutram.com: did not receive HSTS header
-euvo.tk: could not connect to host
-evaartinger.de: did not receive HSTS header
-evades.io: did not receive HSTS header
-evadifranco.com: did not receive HSTS header
-evalesc.com: did not receive HSTS header
-evaluate.jp: could not connect to host
-evanhandgraaf.nl: did not receive HSTS header
-evankurniawan.com: did not receive HSTS header
-evanreev.es: could not connect to host
-evansville-wy.gov: could not connect to host
-evantage.org: could not connect to host
-evantageglobal.com: could not connect to host
-evapp.org: could not connect to host
-evdenevenakliyatankara.pw: could not connect to host
-eve.ac: did not receive HSTS header
-eve0s.com: did not receive HSTS header
-eveaz.com: did not receive HSTS header
-evecalm.com: did not receive HSTS header
-evedanjailbreak.com: could not connect to host
-evegalaxy.net: could not connect to host
-evemagazineonline.com: could not connect to host
-evemarketer.com: did not receive HSTS header
-evemodx.com: could not connect to host
-evenstar-gaming.com: could not connect to host
-evenstargames.com: could not connect to host
-event64.ru: did not receive HSTS header
-eventmake.es: could not connect to host
-eventplace.me: did not receive HSTS header
-events12.com: did not receive HSTS header
-eventsafrica.net: could not connect to host
-everitoken.io: did not receive HSTS header
-everlastingoak.de: did not receive HSTS header
-everyarti.st: could not connect to host
-everybodyhertz.co.uk: could not connect to host
-everybooks.com: could not connect to host
-everydaygary.com: could not connect to host
-everydayhealthandbeauty.com: could not connect to host
-everydaywot.com: could not connect to host
-everydaywp.com: did not receive HSTS header
-everyex.com: could not connect to host
-everygayporn.xyz: could not connect to host
-everylab.org: could not connect to host
-everymove.org: could not connect to host
-everything.place: could not connect to host
-everythinq.com: could not connect to host
-everytruckjob.com: did not receive HSTS header
-everyvid.com: did not receive HSTS header
-everywhere.cloud: could not connect to host
-eveseat.net: could not connect to host
-eveshaiwu.com: could not connect to host
-evi.be: did not receive HSTS header
-evidentiasoftware.com: did not receive HSTS header
-evil-empire.tk: could not connect to host
-evilarmy.com: did not receive HSTS header
-evilbeasts.ru: could not connect to host
-evilbunnyfufu.com: could not connect to host
-evilcult.me: did not receive HSTS header
-evilized.de: did not receive HSTS header
-evilness.nl: could not connect to host
-evilsay.com: could not connect to host
-evilsite.cf: could not connect to host
-evilvolcanolairs.com: did not receive HSTS header
-evin.ml: did not receive HSTS header
-evio.com: did not receive HSTS header
-evites.me: could not connect to host
-evlann.com: could not connect to host
-evlqa1sp1tzb05zo-reoo0vhj9a1t5pousfudnkg.com: did not receive HSTS header
-evokepk.com: could not connect to host
-evoludis.net: did not receive HSTS header
-evolutionexpeditions.com: did not receive HSTS header
-evolutionsmedicalspa.com: did not receive HSTS header
-evonews.com: did not receive HSTS header
-evossd.tk: could not connect to host
-evote-ch.ch: could not connect to host
-evowl.com: could not connect to host
-ewaf.club: did not receive HSTS header
-ewallet-optimizer.com: did not receive HSTS header
-ewex.org: could not connect to host
-ewizmo.com: did not receive HSTS header
-ewok.io: could not connect to host
-eworksmedia.com: could not connect to host
-ewout.io: did not receive HSTS header
-ews1.com: did not receive HSTS header
-ewuchuan.com: could not connect to host
-ewycena.pl: could not connect to host
-exaktus.pt: did not receive HSTS header
-examopedia.in: did not receive HSTS header
-example.sc: did not receive HSTS header
-example.wf: did not receive HSTS header
-example4d.com: did not receive HSTS header
-examplesu.com: could not connect to host
-examsmate.in: could not connect to host
-excelgum.ca: could not connect to host
-excelhot.com: could not connect to host
-exceltobarcode.com: could not connect to host
-exceptionalbits.com: could not connect to host
-exceptionalservers.com: could not connect to host
-exceptionalservices.us: could not connect to host
-exchangecoordinator.com: did not receive HSTS header
-exchangeworks.co: did not receive HSTS header
-exciters.tk: could not connect to host
-exclusivedesignz.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-exebouncycastles.co.uk: did not receive HSTS header
-exehack.net: could not connect to host
-exembit.com: did not receive HSTS header
-exerforge.net: could not connect to host
-exfiles.cz: could not connect to host
-exgravitus.com: could not connect to host
-exhaledayspa.com.au: did not receive HSTS header
-exhalespa.com: did not receive HSTS header
-exno.co: could not connect to host
-exnoobstore.com.br: did not receive HSTS header
-exoplatform.com: did not receive HSTS header
-exotic-bengal-cattery.ml: could not connect to host
-exousiakaidunamis.pw: could not connect to host
-exousiakaidunamis.xyz: could not connect to host
-expatads.com: could not connect to host
-expatriate.pl: did not receive HSTS header
-expecting.com.br: did not receive HSTS header
-experticon.com: did not receive HSTS header
-expertmile.com: did not receive HSTS header
-experts-en-gestion.fr: did not receive HSTS header
-exploflex.com.br: could not connect to host
-exploravacations.in: could not connect to host
-exploringenderby.com: could not connect to host
-explosionstereo.tk: could not connect to host
-expo-designers.com: could not connect to host
-expokohler.com: could not connect to host
-expoort.co.uk: could not connect to host
-expoort.com.br: could not connect to host
-exporo.de: did not receive HSTS header
-expoundite.net: did not receive HSTS header
-expowerhps.com: did not receive HSTS header
-expressfinance.co.za: did not receive HSTS header
-expressglobal.org: could not connect to host
-expresswins.co.uk: could not connect to host
-expromo.pl: did not receive HSTS header
-extendwings.com: could not connect to host
-extensiblewebreportcard.org: could not connect to host
-exteriorservices.io: could not connect to host
-extramoney.cash: could not connect to host
-extranetpuc.com.br: max-age too low: 0
-extrapagetab.com: could not connect to host
-extrathemeshowcase.net: could not connect to host
-extratorrent.fyi: could not connect to host
-extratorrent.red: could not connect to host
-extratorrent.world: could not connect to host
-extratorrentlive.xyz: did not receive HSTS header
-extratorrents.tech: could not connect to host
-extremenetworking.net: could not connect to host
-extremeservicesandrestoration.com: could not connect to host
-extremfrank.tk: could not connect to host
-exultcosmetics.co.uk: did not receive HSTS header
-exxo.tk: could not connect to host
-exy.pw: could not connect to host
-eyasc.nl: could not connect to host
-eydesignguidelines.com: did not receive HSTS header
-eyeandfire.com: could not connect to host
-eyedarts.com: did not receive HSTS header
-eyeglassuniverse.com: did not receive HSTS header
-eyemagic.net: did not receive HSTS header
-eyemedica.de: did not receive HSTS header
-eyenote.gov: did not receive HSTS header
-eyes-of-universe.eu: did not receive HSTS header
-eyesoccer-didikh.rhcloud.com: could not connect to host
-eyesonly.cc: did not receive HSTS header
-eyrid.com: could not connect to host
-eytosh.net: could not connect to host
-eyyubyilmaz.com: could not connect to host
-ez.fi: could not connect to host
-ezimoeko.net: could not connect to host
-ezmod.org: could not connect to host
-eznfe.com: could not connect to host
-ezorgportaal.nl: could not connect to host
-ezpzdelivery.com: could not connect to host
-ezrefurb.co.uk: could not connect to host
-eztv.ch: did not receive HSTS header
-ezzhole.net: could not connect to host
-f-be.com: did not receive HSTS header
-f-rickroll-g.pw: could not connect to host
-f-s-u.co.uk: did not receive HSTS header
-f00.ca: did not receive HSTS header
-f00228.com: could not connect to host
-f1bigpicture.com: could not connect to host
-f2f.cash: could not connect to host
-f30365.com: did not receive HSTS header
-f42.net: could not connect to host
-f5.hk: did not receive HSTS header
-f5197.co: could not connect to host
-f5movies.top: could not connect to host
-f5w.de: did not receive HSTS header
-f6729.co: could not connect to host
-f6729.com: did not receive HSTS header
-f6957.co: could not connect to host
-f6957.com: did not receive HSTS header
-f8842.com: could not connect to host
-f886666.com: did not receive HSTS header
-f899365.com: could not connect to host
-f9297.co: could not connect to host
-f9397.com: could not connect to host
-f9721.com: could not connect to host
-f9728.co: could not connect to host
-faber.io: could not connect to host
-faberusa.com: did not receive HSTS header
-fabhub.io: could not connect to host
-fabian-kluge.de: could not connect to host
-fabian-koeppen.de: did not receive HSTS header
-fabianasantiago.com: could not connect to host
-fabianfischer.de: could not connect to host
-fabianmunoz.com: did not receive HSTS header
-fabienbaker.com: could not connect to host
-fabrica360.com: did not receive HSTS header
-fabrikafilmes.com.br: could not connect to host
-fabriko.fr: did not receive HSTS header
-fabriziorocca.com: could not connect to host
-fabrykowski.com: could not connect to host
-fabulouslyyouthfulskin.com: could not connect to host
-fabulouslyyouthfulskineyeserum.com: could not connect to host
-facadeforum.com: did not receive HSTS header
-faccess.it: did not receive HSTS header
-facebattle.com: did not receive HSTS header
-facebook.ax: could not connect to host
-facebooktsukaikata.net: did not receive HSTS header
-facepalmsecurity.com: could not connect to host
-facepunch.org: could not connect to host
-facerepo.com: could not connect to host
-facesnf.com: could not connect to host
-fachfusspflege-exner.de: could not connect to host
-fachschaft-informatik.de: did not receive HSTS header
-facilitrak.com: could not connect to host
-fackovcova.cz: could not connect to host
-fackovcova.eu: could not connect to host
-fackovcova.sk: could not connect to host
-fackovec.eu: could not connect to host
-fackovec.sk: could not connect to host
-factcool.com: did not receive HSTS header
-factorable.net: did not receive HSTS header
-factoringsolutions.co.uk: did not receive HSTS header
-factorygw.com: did not receive HSTS header
-factorypartsdirect.com: could not connect to host
-factys.do: could not connect to host
-fadednet.com: could not connect to host
-fadeev.legal: did not receive HSTS header
-fads-center.online: could not connect to host
-faerb.it: could not connect to host
-faerie-art.com: did not receive HSTS header
-faeriecakes.be: could not connect to host
-faesser.com: did not receive HSTS header
-fafarishoptrading.com: could not connect to host
-fafatiger.com: could not connect to host
-fag.wtf: could not connect to host
-fahnamporn.com: could not connect to host
-fahnen-fanwelt.de: did not receive HSTS header
-fail.coach: did not receive HSTS header
-faircom.co.za: did not receive HSTS header
-fairkey.dk: did not receive HSTS header
-fairlyoddtreasures.com: did not receive HSTS header
-faisalshuvo.com: did not receive HSTS header
-faithmissionaries.com: did not receive HSTS header
-fakeapple.nl: could not connect to host
-fakeletters.org: could not connect to host
-faktura.pl: did not receive HSTS header
-falaland.com: could not connect to host
-falce.in: could not connect to host
-falcibiosystems.org: did not receive HSTS header
-falcona.io: could not connect to host
-falconwiz.com: did not receive HSTS header
-falkp.no: did not receive HSTS header
-falkus.net: could not connect to host
-falldennismarketing.com: did not receive HSTS header
-fallenangeldrinks.eu: could not connect to host
-fallenangelspirits.uk: could not connect to host
-fallenspirits.co.uk: could not connect to host
-fallingapart.de: did not receive HSTS header
-false.in.net: could not connect to host
-faluninfo.ba: did not receive HSTS header
-famdouma.nl: could not connect to host
-fame-agency.net: could not connect to host
-famep.gov: could not connect to host
-famer.me: could not connect to host
-fameuxhosting.co.uk: could not connect to host
-famfi.co: could not connect to host
-familie-mischak.de: could not connect to host
-familie-sander.rocks: max-age too low: 600
-familie-witzik.eu: could not connect to host
-familie-zimmermann.at: could not connect to host
-familiekiekjes.nl: could not connect to host
-familletouret.fr: did not receive HSTS header
-familytreesbyjackie.com: could not connect to host
-famio.cn: could not connect to host
-fanclubrbdmaniaromania.tk: could not connect to host
-fander.it: could not connect to host
-fanflow.com: did not receive HSTS header
-fanhouwan.com: did not receive HSTS header
-fansmade.art: could not connect to host
-fant.dk: did not receive HSTS header
-fantasticgardenersmelbourne.com.au: did not receive HSTS header
-fantasticpestcontrolmelbourne.com.au: did not receive HSTS header
-fantasycdn.com: could not connect to host
-fantasyfoot.tk: could not connect to host
-fantasyprojections.com: could not connect to host
-fantasysportsnews.org: could not connect to host
-fantopia.club: could not connect to host
-fanvoice.com: could not connect to host
-fanyl.cn: could not connect to host
-fanzhencha.com: could not connect to host
-fap.no: could not connect to host
-fapflix.net: did not receive HSTS header
-faq.lookout.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-faradji.nu: could not connect to host
-faraonplay5.com: could not connect to host
-faraonplay7.com: could not connect to host
-faraonplay8.com: could not connect to host
-faraslot8.com: could not connect to host
-faraslot8.net: could not connect to host
-faretravel.co.uk: could not connect to host
-farkas.bz: did not receive HSTS header
-farleymetals.com.au: did not receive HSTS header
-farm-vacations.com: could not connect to host
-farm24.co.uk: could not connect to host
-farmacia.pt: did not receive HSTS header
-farmaciaformula.com.br: could not connect to host
-farmacialaboratorio.it: did not receive HSTS header
-farmaciamedicom.com.br: did not receive HSTS header
-farmmaximizer.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-farmtoys.store: could not connect to host
-farrel-f.cf: could not connect to host
-farrel-f.id: could not connect to host
-farrel-f.tk: could not connect to host
-farrelf.blog: could not connect to host
-farvisun.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-fashion-hunters.pl: did not receive HSTS header
-fashion.net: did not receive HSTS header
-fashion4ever.pl: did not receive HSTS header
-fashioncare.cz: did not receive HSTS header
-fashionflavorph.com: could not connect to host
-fashionhijabers.com: could not connect to host
-fashionholic.my: did not receive HSTS header
-fashionoutfits24.com: did not receive HSTS header
-fashworldtrends.com: did not receive HSTS header
-fasset.jp: could not connect to host
-fast-host.net: could not connect to host
-fastaim.de: could not connect to host
-fastbackmbg.be: could not connect to host
-fastbackmbm.be: could not connect to host
-fastboyscouts.com: could not connect to host
-fastboyscouts.de: could not connect to host
-fastcomcorp.net: did not receive HSTS header
-fastcp.top: could not connect to host
-fastforwardthemes.com: could not connect to host
-fastograph.com: did not receive HSTS header
-fastopen.ml: could not connect to host
-fastrevision.com: did not receive HSTS header
-fastwebsites.com.br: did not receive HSTS header
-faszienrollen-info.de: did not receive HSTS header
-fatalerrorcoded.eu: did not receive HSTS header
-fatdoge.cn: did not receive HSTS header
-fateandirony.com: could not connect to host
-fatedata.com: could not connect to host
-fatfueled.com: could not connect to host
-fatgeekflix.net: could not connect to host
-fatlossguide.xyz: could not connect to host
-fator25.com.br: could not connect to host
-fatox.de: could not connect to host
-fattorino.it: did not receive HSTS header
-fatwin.pw: could not connect to host
-fatzebra.com.au: max-age too low: 0
-fau8.ml: could not connect to host
-faui2k17.de: did not receive HSTS header
-faulty.equipment: could not connect to host
-fawkex.me: did not receive HSTS header
-faxite.com: could not connect to host
-faxreader.net: could not connect to host
-fayolle.info: did not receive HSTS header
-fbcopy.com: could not connect to host
-fbe.to: could not connect to host
-fbf.gov: did not receive HSTS header
-fbhackpass.com: did not receive HSTS header
-fbi.pw: did not receive HSTS header
-fbook.top: could not connect to host
-fbox.li: could not connect to host
-fcapartsdb.com: could not connect to host
-fcarsenal.tk: could not connect to host
-fcitasc.com: could not connect to host
-fckd.net: did not receive HSTS header
-fcp.cn: could not connect to host
-fctwo.download: could not connect to host
-fd020.com: could not connect to host
-fdj.im: could not connect to host
-fdlibre.eu: could not connect to host
-fdn.one: could not connect to host
-fdos.me: could not connect to host
-fdsys.gov: could not connect to host
-fdt.name: did not receive HSTS header
-feaden.me: could not connect to host
-feard.space: could not connect to host
-fearghus.org: could not connect to host
-fearsomegaming.com: did not receive HSTS header
-featuredmen.com: could not connect to host
-fecik.sk: did not receive HSTS header
-fedbizopps.gov: could not connect to host
-fedemo.top: did not receive HSTS header
-federalregister.gov: did not receive HSTS header
-federicomigliavacca.it: could not connect to host
-federicoparty.it: could not connect to host
-fedn.it: could not connect to host
-fedo.moe: could not connect to host
-fedoramagazine.org: did not receive HSTS header
-fee-hosting.com: could not connect to host
-feedermarket.net: did not receive HSTS header
-feedstringer.com: could not connect to host
-feedthebot.com: did not receive HSTS header
-feeg-wage.gc.ca: could not connect to host
-feegg.com.br: could not connect to host
-feeriedesign-event.com: could not connect to host
-feestbierfusten.nl: could not connect to host
-feezmodo.com: did not receive HSTS header
-fefore.com: did not receive HSTS header
-feg-wge.gc.ca: could not connect to host
-fegans.org.uk: did not receive HSTS header
-fehnladen.de: did not receive HSTS header
-feirlane.org: could not connect to host
-feisbed.com: did not receive HSTS header
-feist.io: could not connect to host
-feitobrasilcosmeticos.com.br: did not receive HSTS header
-feizhujianzhi.com: did not receive HSTS header
-fejes.house: could not connect to host
-feldmann-stachelscheid.de: did not receive HSTS header
-felger-times.fr: could not connect to host
-felgitscher.xyz: max-age too low: 2592000
-felisslovakia.sk: did not receive HSTS header
-feliwyn.fr: did not receive HSTS header
-felixgenicio.com: did not receive HSTS header
-felixhefner.de: did not receive HSTS header
-felixkauer.de: could not connect to host
-felixrr.pro: could not connect to host
-felsmalerei.net: did not receive HSTS header
-femaex.com.br: did not receive HSTS header
-femaledom.xyz: could not connect to host
-femanca.com: did not receive HSTS header
-femdombbw.com: could not connect to host
-femiluna.com: could not connect to host
-feminism.lgbt: could not connect to host
-feminists.co: could not connect to host
-femradio.es: did not receive HSTS header
-fence-stlouis.com: could not connect to host
-fengyadi.com: could not connect to host
-fenixportal.eu: did not receive HSTS header
-fenno.net: could not connect to host
-fensdorf.de: did not receive HSTS header
-fensterbau-mutscheller.de: could not connect to host
-fenteo.com: could not connect to host
-feras-alhajjaji.com: could not connect to host
-ferdies.co.za: did not receive HSTS header
-fergusoncastle.com: did not receive HSTS header
-feriahuamantla.com: could not connect to host
-ferienwohnungen-lastminute.de: could not connect to host
-fermanacuratampaparts.com: could not connect to host
-fernangp.com: could not connect to host
-fernseher-kauf.de: could not connect to host
-ferrolatino.com: could not connect to host
-feschiyan.com: could not connect to host
-festember.com: did not receive HSTS header
-festerculiacan.com: could not connect to host
-festicle.com: did not receive HSTS header
-festival.house: could not connect to host
-festivalxdentro.com: did not receive HSTS header
-festrip.com: could not connect to host
-fetclips.se: could not connect to host
-fettbrot.tk: could not connect to host
-feudaltactics.com: could not connect to host
-feuerfestival.org: could not connect to host
-feuerwehr-dachaufsetzer.de: could not connect to host
-feuerwehr-oberkotzau.de: did not receive HSTS header
-fexco.com: did not receive HSTS header
-fexmen.com: could not connect to host
-feyermedia.de: did not receive HSTS header
-ff-bg.xyz: could not connect to host
-ff-getzersdorf.at: did not receive HSTS header
-ff44.net: did not receive HSTS header
-ff5197.co: could not connect to host
-ff6729.co: could not connect to host
-ff6729.com: did not receive HSTS header
-ff6957.co: could not connect to host
-ff763.com: could not connect to host
-ff9297.co: could not connect to host
-ff9397.com: could not connect to host
-ff9721.com: could not connect to host
-ff9728.co: could not connect to host
-ffbsee.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-ffdhw.com: could not connect to host
-ffh.me: could not connect to host
-ffl123.com: did not receive HSTS header
-ffsbgateway.com: could not connect to host
-ffta.eu: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-fgafsaneh.ir: did not receive HSTS header
-fgdc.gov: did not receive HSTS header
-fgequipamentos.com.br: did not receive HSTS header
-fh999.com: could not connect to host
-fhbnutrition.com: could not connect to host
-fhcdn.xyz: could not connect to host
-fhg90.com: could not connect to host
-fhmkh.cn: could not connect to host
-fhsseniormens.club: could not connect to host
-fhyl789.com: could not connect to host
-fhyl888.com: could not connect to host
-fi-sanki.co.jp: could not connect to host
-fialat.cz: could not connect to host
-fibabanka.com.tr: did not receive HSTS header
-fibroarrendacaseton.mx: could not connect to host
-ficklenote.net: did not receive HSTS header
-ficlab.com: did not receive HSTS header
-fics-twosigma.com: could not connect to host
-ficus.io: could not connect to host
-fid-elite.ch: did not receive HSTS header
-fid.to: could not connect to host
-fidel.uk: did not receive HSTS header
-fideleslaici.com: did not receive HSTS header
-fidufinance.com: did not receive HSTS header
-fieldclockapp.com: did not receive HSTS header
-fieldtalk.co.uk: could not connect to host
-fiendishmasterplan.com: did not receive HSTS header
-fierman.eu: could not connect to host
-fierman.net: could not connect to host
-fierman.us: could not connect to host
-fiestagenial.com: could not connect to host
-fifieldtech.com: could not connect to host
-fiftyshadesofluca.ml: could not connect to host
-fig.co: did not receive HSTS header
-fig.ms: could not connect to host
-fightr.co: could not connect to host
-figura.cz: did not receive HSTS header
-figura.im: did not receive HSTS header
-figuurzagers.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-fiissh.tech: did not receive HSTS header
-fijnefeestdageneneengelukkignieuwjaar.nl: could not connect to host
-fiksel.info: did not receive HSTS header
-fikt.space: could not connect to host
-fil.fi: did not receive HSTS header
-file-cloud.eu: could not connect to host
-filebox.moe: could not connect to host
-filebox.space: could not connect to host
-filedir.com: did not receive HSTS header
-filedoom.ml: could not connect to host
-filedropbox.nl: could not connect to host
-fileio.io: could not connect to host
-fileon.com: could not connect to host
-filesense.com: could not connect to host
-filetransfer.one: could not connect to host
-filewall.de: did not receive HSTS header
-filey.co.uk: did not receive HSTS header
-filezilla.cn: did not receive HSTS header
-filhomes.ph: could not connect to host
-fili.org: could not connect to host
-filiosoft.cloud: did not receive HSTS header
-filleritemsindia.com: could not connect to host
-fillitupchallenge.eu: did not receive HSTS header
-fillmysuitca.se: did not receive HSTS header
-film-storyboards.com: did not receive HSTS header
-filme-online.eu.com: could not connect to host
-filmesonline.online: did not receive HSTS header
-filmesubtitrate2017.online: could not connect to host
-filmovizija.mk: did not receive HSTS header
-filmsphoto.com: did not receive HSTS header
-filo.xyz: could not connect to host
-filoitoupediou.gr: did not receive HSTS header
-filterflasche-kaufen.de: could not connect to host
-finalgear.com: could not connect to host
-finalprice.net: could not connect to host
-finalvpn.com: did not receive HSTS header
-finalworkdriesstef.tk: could not connect to host
-financecontrol.tk: did not receive HSTS header
-financenews.tk: could not connect to host
-financepark.ch: did not receive HSTS header
-financewithcromulent.com: could not connect to host
-financier.io: did not receive HSTS header
-financieringsportaal.nl: did not receive HSTS header
-financniexperti.sk: could not connect to host
-finanzkontor.net: could not connect to host
-finchi.de: could not connect to host
-finchnest.co.uk: could not connect to host
-find-your-happy-place.de: did not receive HSTS header
-findcarspecs.com: did not receive HSTS header
-findcheapmusic.com: did not receive HSTS header
-findigo.fish: could not connect to host
-findmybottleshop.com.au: could not connect to host
-findmynudes.com: could not connect to host
-findthatnude.com: could not connect to host
-findthere.net: could not connect to host
-findtutorsnearme.com: did not receive HSTS header
-findyour.diet: could not connect to host
-fine-services.paris: could not connect to host
-finecraft.cc: could not connect to host
-finer04.pw: could not connect to host
-finesoon.net: could not connect to host
-finfev.de: did not receive HSTS header
-fingent.com: did not receive HSTS header
-fingerscrossed.style: could not connect to host
-finiteheap.com: did not receive HSTS header
-finkenberger.org: did not receive HSTS header
-finlandcook.online: could not connect to host
-finlandcook.top: could not connect to host
-finma.ch: did not receive HSTS header
-finstererlebnis.de: could not connect to host
-finsterlebnis.de: did not receive HSTS header
-fintechnics.com: could not connect to host
-fiodental.com.br: did not receive HSTS header
-fiork.com: did not receive HSTS header
-fire-wolf.com: could not connect to host
-fireandelectrical.co.uk: did not receive HSTS header
-firebaseio-demo.com: could not connect to host
-firebaseio.com: could not connect to host (error ignored - included regardless)
-firebird.io: did not receive HSTS header
-firebugmusic.com: did not receive HSTS header
-firechip.cc: could not connect to host
-firefall.rocks: could not connect to host
-firefart.at: did not receive HSTS header
-firefly-iii.org: did not receive HSTS header
-firegore.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-firehost.com: could not connect to host
-fireinthedeep.com: did not receive HSTS header
-firekoi.com: could not connect to host
-firemail.io: could not connect to host
-firepeak.ru: could not connect to host
-fireplex.co.uk: could not connect to host
-firesuite.net: did not receive HSTS header
-firewallconsultants.com: did not receive HSTS header
-fireworkcoaching.com: did not receive HSTS header
-firexarxa.de: could not connect to host
-firmale.com: could not connect to host
-firmenverzeichnis.nu: could not connect to host
-firstchoicepool.com: did not receive HSTS header
-firstdogonthemoon.com.au: did not receive HSTS header
-firstforex.co.uk: did not receive HSTS header
-firstinnovation.co.jp: did not receive HSTS header
-firstlook.org: did not receive HSTS header
-firstsecurity.cl: did not receive HSTS header
-fischers.it: could not connect to host
-fischers.srv.br: could not connect to host
-fise.cz: did not receive HSTS header
-fishbattle.io: could not connect to host
-fishbattle.net: could not connect to host
-fishermansbend.apartments: could not connect to host
-fishfinders.info: did not receive HSTS header
-fishme.in: could not connect to host
-fishserver.net: could not connect to host
-fisiotohome.com: could not connect to host
-fiskestang.com: did not receive HSTS header
-fistu.la: could not connect to host
-fit-mit-system.eu: did not receive HSTS header
-fit4medien.de: did not receive HSTS header
-fitbylo.com: could not connect to host
-fitchannel.com: did not receive HSTS header
-fitea.cz: could not connect to host
-fitfitup.com: did not receive HSTS header
-fitiapp.com: could not connect to host
-fitmeat.at: did not receive HSTS header
-fitnesswerk.de: could not connect to host
-fitqbe.com: did not receive HSTS header
-fitrate.site: could not connect to host
-fitseven.ru: did not receive HSTS header
-fitshop.com.br: could not connect to host
-fitsw.com: did not receive HSTS header
-fiuxy.bz: could not connect to host
-fiuxy.co: did not receive HSTS header
-fiuxy.me: could not connect to host
-fiuxy.org: could not connect to host
-five.vn: did not receive HSTS header
-fiveboosts.xyz: could not connect to host
-fiveslice.pizza: did not receive HSTS header
-fivestarsitters.com: did not receive HSTS header
-fivestepfunnels.com: could not connect to host
-fiveyearsahead.com: could not connect to host
-fivezerocreative.com: did not receive HSTS header
-fiws.net: did not receive HSTS header
-fix-the-timeline.com: could not connect to host
-fix-the-timeline.org: could not connect to host
-fixate.ru: max-age too low: 3153600
-fixeaide.com: did not receive HSTS header
-fixeaider.com: did not receive HSTS header
-fixico-staging.nl: could not connect to host
-fixingdns.com: could not connect to host
-fixitfelix.us: could not connect to host
-fixmyglitch.com: could not connect to host
-fixtectools.co.za: could not connect to host
-fixthetimeline.com: could not connect to host
-fixthetimeline.org: could not connect to host
-fizjoterapia.uk: did not receive HSTS header
-fjco.alsace: could not connect to host
-fjharcu.com: could not connect to host
-fjruiz.es: could not connect to host
-fjugstad.com: could not connect to host
-fkcdn.de: could not connect to host
-fkcovering.be: could not connect to host
-fl0111.com: did not receive HSTS header
-fl0222.com: did not receive HSTS header
-fl0333.com: did not receive HSTS header
-fl0555.com: did not receive HSTS header
-fl0666.com: did not receive HSTS header
-fl0777.com: did not receive HSTS header
-fl0888.com: did not receive HSTS header
-fl0999.com: did not receive HSTS header
-flacandmp3.ml: could not connect to host
-flagfic.com: did not receive HSTS header
-flagriculture.gov: could not connect to host
-flags.ninja: could not connect to host
-flairbros.at: could not connect to host
-flajshans.cz: did not receive HSTS header
-flam.io: could not connect to host
-flamengopi.tk: could not connect to host
-flamer-scene.com: did not receive HSTS header
-flamewall.net: could not connect to host
-flamingcow.tv: could not connect to host
-flamingkeys.com.au: could not connect to host
-flamingogroup.vn: did not receive HSTS header
-flareon.net: could not connect to host
-flaretechnologies.io: could not connect to host
-flasaki.gr: could not connect to host
-flashbaggie.com: could not connect to host
-flatfix.com.ua: did not receive HSTS header
-flatlandchurch.com: did not receive HSTS header
-flavr.be: could not connect to host
-flawcheck.com: could not connect to host
-flc111.com: did not receive HSTS header
-fleamarketgoods.com: did not receive HSTS header
-fleischmann.com.br: did not receive HSTS header
-flemingtonaudiparts.com: could not connect to host
-flesters.com.br: could not connect to host
-fleurette.me: could not connect to host
-fleursdesoleil.fr: did not receive HSTS header
-flexdrukker.nl: could not connect to host
-flexinvesting.fi: could not connect to host
-flextrack.dk: did not receive HSTS header
-flextribly.xyz: could not connect to host
-flexve.com: could not connect to host
-fliexer.com: could not connect to host
-flightschoolusa.com: did not receive HSTS header
-fliio.com: could not connect to host
-flikmsg.co: could not connect to host
-fling.dating: could not connect to host
-flipagram.com: did not receive HSTS header
-flipkey.com: did not receive HSTS header
-flirchi.com: did not receive HSTS header
-flirtycourts.com: could not connect to host
-flixflex.tk: could not connect to host
-flixhaven.net: did not receive HSTS header
-flixports.com: could not connect to host
-flixtor.net: could not connect to host
-floatationlocations.com: did not receive HSTS header
-floj.tech: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-flomeyer.de: could not connect to host
-flood.io: did not receive HSTS header
-floorballpoint.cz: did not receive HSTS header
-flopy.club: could not connect to host
-floresvilleedc.org: did not receive HSTS header
-florian-lillpopp.de: max-age too low: 10
-florian-schlachter.de: could not connect to host
-florian2833z.de: could not connect to host
-florianlillpopp.de: max-age too low: 10
-floridaagriculture.gov: could not connect to host
-floridaconsumerhelp.gov: could not connect to host
-floridaderi.ru: could not connect to host
-floridaengineering.org: could not connect to host
-floridaescapes.co.uk: did not receive HSTS header
-floridafieros.org: could not connect to host
-floridagulfbeachrealty.com: did not receive HSTS header
-florinapp.com: did not receive HSTS header
-florispoort.nl: did not receive HSTS header
-florlola.com: could not connect to host
-floro.me: did not receive HSTS header
-floseed.fr: could not connect to host
-flosserver.de: could not connect to host
-floth.at: could not connect to host
-flouartistique.ch: could not connect to host
-flow.pe: could not connect to host
-flowair24.ru: could not connect to host
-flowchats.me: did not receive HSTS header
-flowcount.xyz: could not connect to host
-flowerandplant.org: could not connect to host
-flowersandclouds.com: could not connect to host
-flowersbylegacy.com: could not connect to host
-floweslawncare.com: could not connect to host
-flowlo.me: could not connect to host
-flox.io: could not connect to host
-floydm.com: did not receive HSTS header
-flucky.xyz: could not connect to host
-flucto.com: did not receive HSTS header
-flue-ducting.co.uk: did not receive HSTS header
-flugplatz-edvc.de: could not connect to host
-flugsportvereinigungcelle.de: did not receive HSTS header
-flugstadplasticsurgery.com: did not receive HSTS header
-fluhrers.de: did not receive HSTS header
-fluidojobs.com: could not connect to host
-flukethoughts.com: did not receive HSTS header
-flurp.de: did not receive HSTS header
-flurrybridge.com: could not connect to host
-flushstudios.com: did not receive HSTS header
-flux.by: did not receive HSTS header
-fluxent.de: could not connect to host
-flyaces.com: could not connect to host
-flyawayantennas.com: did not receive HSTS header
-flybunnyfly.dk: did not receive HSTS header
-flygpost.com: did not receive HSTS header
-flyingdoggy.net: could not connect to host
-flyingspaghettimonsterdonationsfund.nl: could not connect to host
-flyingyoung.top: could not connect to host
-flyshe.co.uk: did not receive HSTS header
-flysnax.com: did not receive HSTS header
-flyspace.ga: could not connect to host
-flyspace.ml: could not connect to host
-flyss.net: could not connect to host
-flyssh.net: could not connect to host
-fm-cdn.de: did not receive HSTS header
-fm83.nl: could not connect to host
-fm992.com: could not connect to host
-fmapplication.com: could not connect to host
-fmarchal.fr: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-fmc.gov: could not connect to host
-fmi.gov: did not receive HSTS header
-fmovies.fyi: could not connect to host
-fmovies.life: could not connect to host
-fmstr.ml: could not connect to host
-fnb-griffinonline.com: did not receive HSTS header
-fnfpt.co.uk: could not connect to host
-fniephaus.com: did not receive HSTS header
-fnvsecurity.com: could not connect to host
-fnzc.co.nz: did not receive HSTS header
-fobc-usa.org: did not receive HSTS header
-focalforest.com: could not connect to host
-foerster-kunststoff.de: did not receive HSTS header
-fognini-depablo.eu: could not connect to host
-fogpublishingph.com: did not receive HSTS header
-fohome.ca: could not connect to host
-fokkusu.fi: did not receive HSTS header
-fokos.de: did not receive HSTS header
-fol.tf: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-foliekonsulenten.dk: did not receive HSTS header
-folioapp.io: could not connect to host
-folkfests.org: did not receive HSTS header
-followerrocket.com: did not receive HSTS header
-followersya.com: did not receive HSTS header
-followings-live.com: did not receive HSTS header
-fondanastasia.ru: did not receive HSTS header
-fondsdiscountbroker.de: did not receive HSTS header
-foneo.com: could not connect to host
-fonetiq.io: could not connect to host
-fontawesome.com: did not receive HSTS header
-fonts2u.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-foo: could not connect to host
-food4health.guide: could not connect to host
-foodblogger.club: could not connect to host
-foodbuddy.ch: could not connect to host
-foodcare.ml: did not receive HSTS header
-foodcowgirls.com: could not connect to host
-foodiebox.no: could not connect to host
-foodies.my: did not receive HSTS header
-foodievenues.com: could not connect to host
-foodphotographyblog.com: did not receive HSTS header
-foodplantengineering.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-foodsafetyworkinggroup.gov: could not connect to host
-foodserve.in: could not connect to host
-foodsouvenirs.it: did not receive HSTS header
-foodtable.at: did not receive HSTS header
-footballmapped.com: could not connect to host
-footlegende.fr: did not receive HSTS header
-footloose.co.uk: did not receive HSTS header
-footstepstofreedom.com.au: did not receive HSTS header
-forafifty.co.za: could not connect to host
-foraje-profesionale.ro: could not connect to host
-forbid.life: could not connect to host
-forbiddenhistory.info: could not connect to host
-forbook.net: could not connect to host
-forbusiness.ca: could not connect to host
-forcamp.ga: could not connect to host
-force-des-maths.com: did not receive HSTS header
-forces.army: could not connect to host
-fordbydesign.com: did not receive HSTS header
-fordshop.by: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-fordtrac.com.br: did not receive HSTS header
-foreignexchangeresource.com: did not receive HSTS header
-foresdon.jp: did not receive HSTS header
-forestfinance.fr: did not receive HSTS header
-foresthillhomes.ca: did not receive HSTS header
-foreveralone.io: could not connect to host
-foreverclean.com: did not receive HSTS header
-foreveryoung.pt: did not receive HSTS header
-forex-dan.com: did not receive HSTS header
-forex-plus.com: did not receive HSTS header
-forexsignals7.com: could not connect to host
-forgix.com: did not receive HSTS header
-forlagetmarx.dk: did not receive HSTS header
-formadmin.com: did not receive HSTS header
-formaliteo.com: did not receive HSTS header
-formasdemaquillarse.com: did not receive HSTS header
-formazioneopen.it: did not receive HSTS header
-formbetter.com: could not connect to host
-formersessalaries.com: did not receive HSTS header
-formforger.com: could not connect to host
-formini.dz: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-formkiq.com: could not connect to host
-formula.cf: could not connect to host
-foro.io: could not connect to host
-forologikidilosi.com.gr: could not connect to host
-forourselves.com: could not connect to host
-forpc.us: did not receive HSTS header
-forplanetsake.com: could not connect to host
-forplayers.pl: could not connect to host
-forquilhinhanoticias.com.br: did not receive HSTS header
-forro.berlin: could not connect to host
-forsakringsarkivet.se: could not connect to host
-forself.me: could not connect to host
-forsyththeatre.com: could not connect to host
-fortesanshop.it: could not connect to host
-fortknox.cz: did not receive HSTS header
-fortnitemagic.ga: could not connect to host
-fortoglethorpega.gov: could not connect to host
-fortricks.in: did not receive HSTS header
-fortuna-loessnitz.de: could not connect to host
-fortuna-s.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-fortworth.ch: did not receive HSTS header
-forty2.eu: did not receive HSTS header
-forum-gilee.cf: could not connect to host
-forum-heg.ch: could not connect to host
-forum-kinozal-tv.appspot.com: did not receive HSTS header
-forum-kinozal.appspot.com: did not receive HSTS header
-forum.linode.com: did not receive HSTS header
-forumjuridico.org: did not receive HSTS header
-forus.be: could not connect to host
-foryoucosmeticos.com.br: could not connect to host
-foshanshequ.com: could not connect to host
-fossewayflowers.co.uk: could not connect to host
-fossewayflowers.com: could not connect to host
-fossewaygardencentre.co.uk: did not receive HSTS header
-fossgruppen.se: could not connect to host
-fossguard.com: could not connect to host
-fotikpro.ru: could not connect to host
-fotiu.com: could not connect to host
-foto-pro.by: did not receive HSTS header
-fotocerita.net: could not connect to host
-fotocopiatrici.roma.it: could not connect to host
-fotogiraffe.ru: did not receive HSTS header
-fotografosexpertos.com: did not receive HSTS header
-fotopasja.info: could not connect to host
-fotowettbewerb.co: could not connect to host
-foundationspecialisteast.com: could not connect to host
-foundationswellness.net: did not receive HSTS header
-fourashesgolfcentre.uk: could not connect to host
-fourchin.net: could not connect to host
-fourdesignstudio.com: could not connect to host
-fourwheelpartloanssimple.com: did not receive HSTS header
-foutrelis.com: did not receive HSTS header
-foxbnc.co.uk: did not receive HSTS header
-foxbnc.uk: could not connect to host
-foxdev.co: did not receive HSTS header
-foxdev.io: did not receive HSTS header
-foxhound.com.br: did not receive HSTS header
-foxing.club: could not connect to host
-foxley-farm.co.uk: did not receive HSTS header
-foxley-seeds.co.uk: did not receive HSTS header
-foxleyseeds.co.uk: could not connect to host
-foxmay.co.uk: could not connect to host
-foxterrier.com.br: could not connect to host
-foxtrot.pw: could not connect to host
-foxvisor.com: could not connect to host
-foxyslut.com: could not connect to host
-foyale.io: could not connect to host
-foyer-laique-segre.com: did not receive HSTS header
-fpaci.org: could not connect to host
-fpgradosuperior.com: did not receive HSTS header
-fpki.sh: could not connect to host
-fpvr.org: did not receive HSTS header
-fq.mk: did not receive HSTS header
-fr0zenbits.io: could not connect to host
-fr33d0m.link: could not connect to host
-fragilesolar.cf: could not connect to host
-fragnic.com: could not connect to host
-fragrances.bg: did not receive HSTS header
-fralef.me: did not receive HSTS header
-fralippolippi.tk: could not connect to host
-framedpaws.com: could not connect to host
-francescoservida.ch: did not receive HSTS header
-francevpn.xyz: could not connect to host
-francis.tokyo: did not receive HSTS header
-francisdelreal.com: did not receive HSTS header
-francois-gaillard.fr: did not receive HSTS header
-francois-vidit.com: did not receive HSTS header
-francoiscarrier.com: did not receive HSTS header
-frangor.info: did not receive HSTS header
-franke-chemie.de: could not connect to host
-frankedier.com: could not connect to host
-frankfurt-am-start.de: did not receive HSTS header
-frankhaala.com: could not connect to host
-frankieruiz.tk: could not connect to host
-franklincountyflorida.gov: could not connect to host
-franklincountyny.gov: did not receive HSTS header
-franklinhua.com: could not connect to host
-frankmorrow.com: could not connect to host
-franksiler.com: could not connect to host
-frankwei.xyz: did not receive HSTS header
-fransallen.com: could not connect to host
-franta.biz: did not receive HSTS header
-franta.email: did not receive HSTS header
-franzt.ovh: could not connect to host
-frasesaniversarios.com.br: did not receive HSTS header
-frasesdeamizade.pt: could not connect to host
-frasestop.com.br: could not connect to host
-frasys.cloud: could not connect to host
-frasys.io: could not connect to host
-frasys.net: could not connect to host
-fraudempire.com: could not connect to host
-frccsgo.tk: could not connect to host
-freakyamazing.com: could not connect to host
-freakyaweso.me: could not connect to host
-freakyawesome.agency: could not connect to host
-freakyawesome.art: could not connect to host
-freakyawesome.band: could not connect to host
-freakyawesome.business: could not connect to host
-freakyawesome.ca: could not connect to host
-freakyawesome.club: could not connect to host
-freakyawesome.co: could not connect to host
-freakyawesome.co.uk: could not connect to host
-freakyawesome.company: could not connect to host
-freakyawesome.dance: could not connect to host
-freakyawesome.design: could not connect to host
-freakyawesome.education: could not connect to host
-freakyawesome.email: could not connect to host
-freakyawesome.events: could not connect to host
-freakyawesome.fashion: could not connect to host
-freakyawesome.fitness: could not connect to host
-freakyawesome.fm: could not connect to host
-freakyawesome.fun: could not connect to host
-freakyawesome.fyi: could not connect to host
-freakyawesome.games: could not connect to host
-freakyawesome.guide: could not connect to host
-freakyawesome.guru: could not connect to host
-freakyawesome.in: could not connect to host
-freakyawesome.info: could not connect to host
-freakyawesome.io: could not connect to host
-freakyawesome.lgbt: could not connect to host
-freakyawesome.life: could not connect to host
-freakyawesome.live: could not connect to host
-freakyawesome.management: could not connect to host
-freakyawesome.marketing: could not connect to host
-freakyawesome.me: could not connect to host
-freakyawesome.media: could not connect to host
-freakyawesome.net: could not connect to host
-freakyawesome.network: could not connect to host
-freakyawesome.news: could not connect to host
-freakyawesome.online: could not connect to host
-freakyawesome.org: could not connect to host
-freakyawesome.photography: could not connect to host
-freakyawesome.photos: could not connect to host
-freakyawesome.press: could not connect to host
-freakyawesome.recipes: could not connect to host
-freakyawesome.rentals: could not connect to host
-freakyawesome.reviews: could not connect to host
-freakyawesome.science: could not connect to host
-freakyawesome.services: could not connect to host
-freakyawesome.shop: could not connect to host
-freakyawesome.site: could not connect to host
-freakyawesome.social: could not connect to host
-freakyawesome.software: could not connect to host
-freakyawesome.solutions: could not connect to host
-freakyawesome.space: could not connect to host
-freakyawesome.store: could not connect to host
-freakyawesome.support: could not connect to host
-freakyawesome.team: could not connect to host
-freakyawesome.tech: could not connect to host
-freakyawesome.technology: could not connect to host
-freakyawesome.tips: could not connect to host
-freakyawesome.today: could not connect to host
-freakyawesome.tours: could not connect to host
-freakyawesome.training: could not connect to host
-freakyawesome.tv: could not connect to host
-freakyawesome.video: could not connect to host
-freakyawesome.website: could not connect to host
-freakyawesome.work: could not connect to host
-freakyawesome.world: could not connect to host
-freakyawesome.wtf: could not connect to host
-freakyawesome.xyz: could not connect to host
-freakyawesome.yoga: could not connect to host
-freakyawesomeblog.com: could not connect to host
-freakyawesomeio.com: could not connect to host
-freakyawesomemedia.com: could not connect to host
-freakyawesomenews.com: could not connect to host
-freakyawesomeplugin.com: could not connect to host
-freakyawesomeplugins.com: could not connect to host
-freakyawesomesite.com: could not connect to host
-freakyawesometeam.com: could not connect to host
-freakyawesometheme.com: could not connect to host
-freakyawesomethemes.com: could not connect to host
-freakyawesomewp.com: could not connect to host
-frebi.org: could not connect to host
-frebib.me: could not connect to host
-freddyfazbearspizzeria.com: did not receive HSTS header
-freddysfuncastles.co.uk: did not receive HSTS header
-freddythechick.uk: could not connect to host
-frederickalcantara.com: could not connect to host
-frederickmd.gov: could not connect to host
-fredliang.cn: could not connect to host
-fredriksslekt.se: could not connect to host
-fredtec.ru: did not receive HSTS header
-free-traff.cf: could not connect to host
-free-your-pc.com: could not connect to host
-free.ac.cn: could not connect to host
-free8.xyz: could not connect to host
-freeasinlliure.org: could not connect to host
-freeassangenow.org: could not connect to host
-freeasyshop.com: did not receive HSTS header
-freeben666.fr: could not connect to host
-freeblog.me: could not connect to host
-freebookmakerbets.com.au: did not receive HSTS header
-freecam2cam.site: could not connect to host
-freecashfunnel.com: did not receive HSTS header
-freecycleusa.com: did not receive HSTS header
-freedogecrypt.tk: could not connect to host
-freedombankva.com: did not receive HSTS header
-freedomfrontier.tk: could not connect to host
-freedomisslavery.tk: could not connect to host
-freedomkiaparts.com: could not connect to host
-freedomrealtyoftexas.com: did not receive HSTS header
-freedomvote.nl: could not connect to host
-freedygist.org.ng: could not connect to host
-freeflow.tv: could not connect to host
-freehao123.cn: could not connect to host
-freejasongoudlock.org: did not receive HSTS header
-freejidi.com: could not connect to host
-freela.ch: could not connect to host
-freelance-magazine.net: did not receive HSTS header
-freelance.guide: could not connect to host
-freelancebest.com: did not receive HSTS header
-freelancecollab.com: could not connect to host
-freelanced.co.za: could not connect to host
-freelancemw.com: did not receive HSTS header
-freelancerinc.us: did not receive HSTS header
-freelanceshipping.com: did not receive HSTS header
-freelandinnovation.com: did not receive HSTS header
-freelansir.com: could not connect to host
-freelo.cz: did not receive HSTS header
-freelysurf.cf: could not connect to host
-freemania.eu: could not connect to host
-freemania.nl: could not connect to host
-freemanning.de: did not receive HSTS header
-freematthale.net: could not connect to host
-freepoints.us: could not connect to host
-freergform.org: could not connect to host
-freeslots.guru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-freesoftwaredriver.com: could not connect to host
-freesounding.com: did not receive HSTS header
-freesounding.ru: did not receive HSTS header
-freesquare.net: could not connect to host
-freethought.org.au: could not connect to host
-freeutopia.org: did not receive HSTS header
-freevps.us: could not connect to host
-freewarez.org: could not connect to host
-freexmovie.com: could not connect to host
-frei.social: could not connect to host
-freifunk-in-solingen.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-freifunk-lindlar.net: could not connect to host
-freifunk-nrw.de: could not connect to host
-freifunk-remscheid.de: could not connect to host
-frejasdal.dk: could not connect to host
-frenzel.dk: could not connect to host
-freqlabs.com: did not receive HSTS header
-freshfind.xyz: could not connect to host
-freshislandfish.com: did not receive HSTS header
-freshkiss.com.au: did not receive HSTS header
-freshlymind.com: did not receive HSTS header
-freshmaza.io: could not connect to host
-freshmaza.net: did not receive HSTS header
-frettboard.com: did not receive HSTS header
-frezbo.com: could not connect to host
-fribourgviking.net: could not connect to host
-frickenate.com: could not connect to host
-fridaperfumaria.com.br: could not connect to host
-fridayfoucoud.ma: could not connect to host
-friedenauer-herbstfest.de: could not connect to host
-friedhelm-wolf.de: could not connect to host
-friend.tours: max-age too low: 604800
-friendica.ch: could not connect to host
-friendlyfiregameshow.com: could not connect to host
-frieslandrail.nl: did not receive HSTS header
-friplay.host: could not connect to host
-fritteli.ch: did not receive HSTS header
-frly.de: did not receive HSTS header
-frnco.uk: did not receive HSTS header
-frodriguez.xyz: could not connect to host
-froehlich.it: did not receive HSTS header
-froggstack.de: could not connect to host
-frogsonamission.de: could not connect to host
-frolov.net: did not receive HSTS header
-from-the-net.com: could not connect to host
-fromix.de: could not connect to host
-fromlemaytoz.com: could not connect to host
-fromthemonks.com: could not connect to host
-fromthesoutherncross.com: could not connect to host
-front-end.dog: could not connect to host
-frontier.bet: could not connect to host
-frontierdiscount.com: could not connect to host
-frontisme.nl: could not connect to host
-frontletter.io: did not receive HSTS header
-frontline6.com: did not receive HSTS header
-frost-ci.xyz: could not connect to host
-frostbytes.net: could not connect to host
-frostednetwork.com: did not receive HSTS header
-frosty-gaming.xyz: could not connect to host
-frostysummers.com: could not connect to host
-froufe.com: did not receive HSTS header
-frp-roleplay.de: could not connect to host
-frsis2017.com: could not connect to host
-frsnpwr.net: could not connect to host
-frtr.gov: did not receive HSTS header
-fruitusers.com: could not connect to host
-fruityfitness.com: did not receive HSTS header
-frumious.fyi: could not connect to host
-frusky.net: could not connect to host
-frydrychit.cz: could not connect to host
-fs-community.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-fs-fitness.eu: could not connect to host
-fs-gamenet.de: could not connect to host
-fsck.cz: could not connect to host
-fsdress.com: could not connect to host
-fsf.moe: could not connect to host
-fsfi.is: could not connect to host
-fsinf.at: did not receive HSTS header
-fsj4u.ch: did not receive HSTS header
-fspphoto.com: could not connect to host
-fsradio.eu: could not connect to host
-fsrs.gov: could not connect to host
-fsstyle.com: could not connect to host
-fstatic.io: could not connect to host
-fstfy.de: could not connect to host
-fsvoboda.cz: could not connect to host
-ftctele.com: could not connect to host
-fteproxy.org: did not receive HSTS header
-ftf.agency: did not receive HSTS header
-ftgho.com: could not connect to host
-ftng.se: could not connect to host
-ftpi.ml: could not connect to host
-fu639.top: could not connect to host
-fu898.top: could not connect to host
-fuchsy.com: could not connect to host
-fuciam.com.co: could not connect to host
-fuck-your-false-positive.de: could not connect to host
-fuckbilibili.com: could not connect to host
-fuckcf.cf: could not connect to host
-fuckgfw233.org: could not connect to host
-fucknazis.cf: could not connect to host
-fuckobr.com: could not connect to host
-fuckobr.net: could not connect to host
-fuckobr.org: could not connect to host
-fuckobr.ru: could not connect to host
-fuckobr.su: could not connect to host
-fuckssl.com: could not connect to host
-fuckyoupaypal.me: could not connect to host
-fudanshi.org: could not connect to host
-fuego.tech: could not connect to host
-fuelfirebrand.com: could not connect to host
-fuelministry.com: did not receive HSTS header
-fugamo.de: did not receive HSTS header
-fugle.de: could not connect to host
-fujieb.com: could not connect to host
-fujiorganics.com: did not receive HSTS header
-fukuko.biz: could not connect to host
-fukuko.xyz: could not connect to host
-fukuoka-cityliner.jp: did not receive HSTS header
-fukushima-web.com: did not receive HSTS header
-fukushimacoffee.com: could not connect to host
-fulibyg.com: did not receive HSTS header
-fulige.top: did not receive HSTS header
-fulijiejie.com: could not connect to host
-fulilingyu.info: could not connect to host
-fuliydys.com: could not connect to host
-fullereno.com: did not receive HSTS header
-fullnitrous.com: did not receive HSTS header
-fullpackage.co.uk: did not receive HSTS header
-fullreggaetonrd.com: did not receive HSTS header
-fullstack.love: did not receive HSTS header
-fulltxt.ml: could not connect to host
-fullytrained.co.uk: could not connect to host
-fumiware.com: could not connect to host
-fun25.tk: did not receive HSTS header
-fun4tomorrow.com: could not connect to host
-fun9.cc: could not connect to host
-fun99.cc: could not connect to host
-funandbounce.com: could not connect to host
-funarena.com.ua: could not connect to host
-funbouncelincs.co.uk: could not connect to host
-funbuynet.com.br: did not receive HSTS header
-fundacionhijosdelsol.org: could not connect to host
-funderburg.me: did not receive HSTS header
-fundingempire.com: did not receive HSTS header
-funerariahogardecristo.cl: did not receive HSTS header
-funfunmstdn.tokyo: could not connect to host
-fungame.eu: did not receive HSTS header
-funi4u.com: did not receive HSTS header
-funideas.org: could not connect to host
-funkazoid-radio.com: could not connect to host
-funkes-ferien.de: did not receive HSTS header
-funkner.ru: could not connect to host
-funkygamer1.de: could not connect to host
-funkyweddingideas.com.au: could not connect to host
-funnelweb.xyz: could not connect to host
-funny-joke-pictures.com: did not receive HSTS header
-funnyang.com: could not connect to host
-funrun.com: did not receive HSTS header
-funtastic-event-hire.co.uk: did not receive HSTS header
-funtastic.ie: could not connect to host
-funtasticinflatablesdurham.co.uk: did not receive HSTS header
-funtimebourne.co.uk: did not receive HSTS header
-fuorifuocogenova.it: could not connect to host
-furaje-iasi.com: could not connect to host
-furcity.me: could not connect to host
-furi.ga: could not connect to host
-furiffic.com: did not receive HSTS header
-furnation.com: could not connect to host
-furnitureconcept.co.uk: could not connect to host
-furry.agency: did not receive HSTS header
-furry.be: did not receive HSTS header
-furry.zone: did not receive HSTS header
-furrybot.me: did not receive HSTS header
-furrytf.club: did not receive HSTS header
-furryyiff.site: could not connect to host
-furtherfood.com: did not receive HSTS header
-furtivelook.com: could not connect to host
-fusedrops.com: could not connect to host
-fushee.com: could not connect to host
-fusiongaming.de: could not connect to host
-fusionmate.com: did not receive HSTS header
-fuszara.eu: could not connect to host
-futa.agency: could not connect to host
-futagro.com: did not receive HSTS header
-futbol11.com: could not connect to host
-futcre.com: could not connect to host
-futo.biz: could not connect to host
-futos.de: could not connect to host
-futrou.com: could not connect to host
-futurefire.de: could not connect to host
-futurefundapp.com: could not connect to host
-futurehack.io: could not connect to host
-futureoceans.org: did not receive HSTS header
-futuresonline.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-futurestarsusa.org: did not receive HSTS header
-futuretechnologi.es: could not connect to host
-futuretimes.io: could not connect to host
-futureyouhealth.com: did not receive HSTS header
-futuristacademy.io: could not connect to host
-futuristarchitecture.com: did not receive HSTS header
-futurope.com: did not receive HSTS header
-fuvelis.com: could not connect to host
-fuvpn.com: could not connect to host
-fuxwerk.de: could not connect to host
-fuzoku-sodan.com: could not connect to host
-fwei.tk: did not receive HSTS header
-fwww7.com: did not receive HSTS header
-fx24.uk: did not receive HSTS header
-fxgame.online: could not connect to host
-fxpig-ib.com: could not connect to host
-fxwebstudio.com.au: max-age too low: 0
-fy380.com: max-age too low: 0
-fydjbsd.cn: could not connect to host
-fyodorpi.com: did not receive HSTS header
-fyol.pw: could not connect to host
-fyroeo.fr: did not receive HSTS header
-fysio123.nl: did not receive HSTS header
-fysiohaenraets.nl: did not receive HSTS header
-fysiotherapienieuwveen.nl: did not receive HSTS header
-fysuite.com: could not connect to host
-fzn.io: did not receive HSTS header
-fzslm.me: could not connect to host
-fztopsec.com: could not connect to host
-g-i-s.vn: could not connect to host
-g-marketing.ro: could not connect to host
-g-o.pl: did not receive HSTS header
-g-rickroll-o.pw: could not connect to host
-g01.in.ua: could not connect to host
-g1jeu.com: could not connect to host
-g1s.cc: did not receive HSTS header
-g2-inc.com: max-age too low: 600
-g2a.co: did not receive HSTS header
-g2g.com: did not receive HSTS header
-g30365.com: could not connect to host
-g36594.com: could not connect to host
-g3circuit.com: could not connect to host
-g47.web.id: could not connect to host
-g4w.co: could not connect to host (error ignored - included regardless)
-g5.gov: could not connect to host
-g5197.co: could not connect to host
-g5led.nl: could not connect to host
-g6666g.tk: could not connect to host
-g6729.co: could not connect to host
-g6957.co: could not connect to host
-g6957.com: could not connect to host
-g77.ca: could not connect to host
-g9297.co: could not connect to host
-g9397.com: could not connect to host
-g9721.com: could not connect to host
-g9728.co: could not connect to host
-gaanbaksho.com.au: did not receive HSTS header
-gaasuper6.com: could not connect to host
-gabber.scot: could not connect to host
-gabemack.com: did not receive HSTS header
-gabethebabetv.com: could not connect to host
-gabi.com.es: could not connect to host
-gabi.soy: did not receive HSTS header
-gabi.uno: could not connect to host
-gablaxian.com: max-age too low: 2592000
-gabrielsimonet.ch: could not connect to host
-gabz.pw: could not connect to host
-gadget-tips.com: did not receive HSTS header
-gadgets-and-accessories.store: did not receive HSTS header
-gadgets-cars.com.es: could not connect to host
-gadse.games: could not connect to host
-gaelleetarnaud.com: did not receive HSTS header
-gafachi.com: could not connect to host
-gagekroljic.com: could not connect to host
-gagne-enterprises.com: did not receive HSTS header
-gagne.tk: could not connect to host
-gaichanh.com: could not connect to host
-gailbartist.com: did not receive HSTS header
-gailfellowsphotography.com: could not connect to host
-gainesvillega.gov: could not connect to host
-gainesvillegoneaustin.org: could not connect to host
-gaite.me: could not connect to host
-gakkainavi-epsilon.jp: could not connect to host
-gakkainavi-epsilon.net: could not connect to host
-gakkainavi.jp: did not receive HSTS header
-gakkainavi.net: did not receive HSTS header
-gakkainavi4.com: could not connect to host
-gakkainavi4.jp: did not receive HSTS header
-gakkainavi4.net: did not receive HSTS header
-galactic-crew.org: did not receive HSTS header
-galardi.org: could not connect to host
-galaxymimi.com: could not connect to host
-galecia.com: did not receive HSTS header
-galena.io: could not connect to host
-galenskap.eu: could not connect to host
-galeria42.com: could not connect to host
-galeriadobimba.com.br: could not connect to host
-galeriajardim.com.br: did not receive HSTS header
-galerialamanai.com: did not receive HSTS header
-galeriart.xyz: could not connect to host
-galerieautodirect.com: did not receive HSTS header
-galgoafegao.com.br: could not connect to host
-galgoingles.com.br: could not connect to host
-galgopersa.com.br: could not connect to host
-galilahiskye.com: did not receive HSTS header
-galilel.cloud: could not connect to host
-galileomtz.com: did not receive HSTS header
-gallery44.org: did not receive HSTS header
-galoisvpn.xyz: could not connect to host
-galoscoin.nl: max-age too low: 2592000
-galoserver.org: could not connect to host
-gam3rs.de: could not connect to host
-gamajo.com: did not receive HSTS header
-gambit.pro: could not connect to host
-gambitcloud.net: could not connect to host
-gamblersgaming.eu: could not connect to host
-game-club.me: could not connect to host
-game-gentle.com: could not connect to host
-game.yt: could not connect to host
-gamebits.net: did not receive HSTS header
-gamecave.de: could not connect to host
-gamecdn.com: could not connect to host
-gamechasm.com: could not connect to host
-gamefund.me: could not connect to host
-gameguardian.net: did not receive HSTS header
-gamehacks.me: did not receive HSTS header
-gameharbor.eu: could not connect to host
-gameindustry.de: did not receive HSTS header
-gameink.net: did not receive HSTS header
-gamek.es: could not connect to host
-gamenected.com: could not connect to host
-gamenected.de: could not connect to host
-gameofbay.org: could not connect to host
-gameofpwnz.com: did not receive HSTS header
-gamepad.vg: could not connect to host
-gamepader.com: could not connect to host
-gameparade.de: could not connect to host
-gameparagon.info: could not connect to host
-gamepiece.com: did not receive HSTS header
-gamerpoets.com: did not receive HSTS header
-gamerslair.org: did not receive HSTS header
-gamerz-point.de: max-age too low: 10368000
-gamerz-stream.com: did not receive HSTS header
-gameserver-sponsor.de: did not receive HSTS header
-gamesurferapp.com: could not connect to host
-gameswitchers.uk: could not connect to host
-gametium.com: could not connect to host
-gametium.es: could not connect to host
-gametowndev.tk: could not connect to host
-gamhealth.net: could not connect to host
-gamingmedia.eu: could not connect to host
-gamingrealms.net: did not receive HSTS header
-gamingreinvented.com: did not receive HSTS header
-gamingwithcromulent.com: could not connect to host
-gamishijabsyari.com: could not connect to host
-gamismodelbaru.com: did not receive HSTS header
-gamismodernshop.com: did not receive HSTS header
-gamismurahonline.com: could not connect to host
-gamoice.com: could not connect to host
-gamoloco.com: did not receive HSTS header
-gampa.be: did not receive HSTS header
-gampenhof.de: could not connect to host
-gamster.tv: could not connect to host
-gan.wtf: could not connect to host
-gandc.co: could not connect to host
-gangnam-club.com: could not connect to host
-gangnam-karaoke.com: could not connect to host
-gangnamavenue.com: did not receive HSTS header
-ganhonet.com.br: did not receive HSTS header
-gaojianli.me: could not connect to host
-gaojianli.tk: could not connect to host
-gaon.network: could not connect to host
-gaopindy.com: did not receive HSTS header
-gaptek.id: did not receive HSTS header
-garage-abri-chalet.fr: did not receive HSTS header
-garage-door.pro: could not connect to host
-garage-meynard.com: could not connect to host
-garagefox.ch: did not receive HSTS header
-garagelink.jp: did not receive HSTS header
-garagemhermetica.org: could not connect to host
-garageon.net: did not receive HSTS header
-garagesecond.com: did not receive HSTS header
-garbage-juice.com: could not connect to host
-garbagedisposalguides.com: did not receive HSTS header
-garchi.net: did not receive HSTS header
-garciamartin.me: could not connect to host
-garcinia--cambogia.com: could not connect to host
-garciniacambogiareviewed.co: did not receive HSTS header
-garden-life.org: could not connect to host
-garden.trade: could not connect to host
-gardencarezone.com: could not connect to host
-garderobche.eu: did not receive HSTS header
-gardinte.com: did not receive HSTS header
-garethkirkreviews.com: did not receive HSTS header
-garfieldairlines.net: did not receive HSTS header
-garforthgolfclub.co.uk: did not receive HSTS header
-garriganenterprises.com: did not receive HSTS header
-garriganenterprises.net: did not receive HSTS header
-garriganenterprisesinc.com: did not receive HSTS header
-garriganenterprisesinc.net: did not receive HSTS header
-garten-bau.ch: did not receive HSTS header
-garten-diy.de: could not connect to host
-gartenhauszentrum.de: did not receive HSTS header
-gasbarkenora.com: could not connect to host
-gasnews.net: could not connect to host
-gass-transformatoren.de: did not receive HSTS header
-gasser-daniel.ch: could not connect to host
-gassouthkenticoqa.azurewebsites.net: could not connect to host
-gastritisolucion.com: could not connect to host
-gatapro.net: could not connect to host
-gatemotorsumhlanga.co.za: did not receive HSTS header
-gatemoves.com: could not connect to host
-gateworld.fr: did not receive HSTS header
-gatilagata.com.br: could not connect to host
-gatomanias.com: did not receive HSTS header
-gatomix.net: could not connect to host
-gatorsa.es: could not connect to host
-gatos.plus: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-gaurl.ga: could not connect to host
-gaussorgues.me: could not connect to host
-gautham.pro: could not connect to host
-gautvedt.no: did not receive HSTS header
-gavick.com: did not receive HSTS header
-gavinsblog.com: did not receive HSTS header
-gawrimanecuta.com: did not receive HSTS header
-gay-jays.com: could not connect to host
-gay.systems: could not connect to host
-gaycamvids.com: could not connect to host
-gayforgenji.com: could not connect to host
-gaygeeks.de: could not connect to host
-gayhotti.es: could not connect to host
-gayjays.com: could not connect to host
-gazachallenge.org: could not connect to host
-gazee.net: did not receive HSTS header
-gazoz.ga: could not connect to host
-gbit.xyz: could not connect to host
-gc.net: could not connect to host
-gccm-events.com: could not connect to host
-gcdamp.gov: did not receive HSTS header
-gcgeeks.com.au: could not connect to host
-gcguild.net: did not receive HSTS header
-gchq.wtf: could not connect to host
-gcodetools.com: could not connect to host
-gdax.com: could not connect to host
-gdegem.org: did not receive HSTS header
-gdevpenze.ru: could not connect to host
-gdhzcgs.com: could not connect to host
-gdprhallofshame.com: did not receive HSTS header
-gdsqua.re: could not connect to host
-gdutnic.com: did not receive HSTS header
-gdz-otvety.com: did not receive HSTS header
-gdz.tv: could not connect to host
-gealot.com: did not receive HSTS header
-gear-acquisition-syndrome.community: could not connect to host
-geass.xyz: could not connect to host
-geblitzt.de: did not receive HSTS header
-gedachtekaarsje.nl: could not connect to host
-gedankenbude.info: could not connect to host
-gedankenworks.com: could not connect to host
-gee.is: did not receive HSTS header
-geek1.de: did not receive HSTS header
-geekbaba.com: could not connect to host
-geekcast.co.uk: could not connect to host
-geekchimp.com: could not connect to host
-geekdt.com: could not connect to host
-geeknik.com: could not connect to host
-geeksky.org: did not receive HSTS header
-geekthis.de: did not receive HSTS header
-geektimes.com: did not receive HSTS header
-geeky.software: could not connect to host
-geekystudios.us: could not connect to host
-geemo.top: could not connect to host
-gehrke.nrw: could not connect to host
-geigr.de: could not connect to host
-geiser.io: did not receive HSTS header
-gekosoft.eu: could not connect to host
-geldteveel.eu: could not connect to host
-geli-graphics.com: did not receive HSTS header
-gelodosul.com.br: could not connect to host
-gem-info.fr: could not connect to host
-gemeentemolenwaard.nl: did not receive HSTS header
-gemeinfreie-lieder.de: could not connect to host
-gemgroups.in: could not connect to host
-gemsmarketplace.net: did not receive HSTS header
-gemsoftheworld.org: could not connect to host
-gemuplay.com: could not connect to host
-gemwire.uk: did not receive HSTS header
-genemesservwparts.com: could not connect to host
-genemon.at: did not receive HSTS header
-generace-id.org: could not connect to host
-general-insurance.tk: could not connect to host
-generali-worldwide.com: could not connect to host
-generalpants.com.au: did not receive HSTS header
-generationgoat.com: did not receive HSTS header
-generationsweldom.com: could not connect to host
-genesischangelog.com: did not receive HSTS header
-genevacountyal.gov: did not receive HSTS header
-geneve.guide: could not connect to host
-genia-life.de: could not connect to host
-genie-seiner-generation.de: did not receive HSTS header
-geniofinanciero.org: could not connect to host
-geniushost.in: did not receive HSTS header
-genneve.com: did not receive HSTS header
-genome.gov: did not receive HSTS header
-genoog.com: could not connect to host
-genossen.ru: could not connect to host
-genshiken.org: could not connect to host
-gentianes.ch: could not connect to host
-gentooblog.de: could not connect to host
-genunlimited.ga: could not connect to host
-genusbag.com: could not connect to host
-genuu.com: could not connect to host
-genuxation.com: could not connect to host
-genuxtsg.com: did not receive HSTS header
-genxbeats.com: did not receive HSTS header
-genxnotes.com: could not connect to host
-genyaa.com: could not connect to host
-genyhitch.com: did not receive HSTS header
-geocommunicator.gov: could not connect to host
-geoffanderinmyers.com: did not receive HSTS header
-geoffdev.com: could not connect to host
-geoffmyers.com: did not receive HSTS header
-geoffreyrichard.com: could not connect to host
-geonice.ga: could not connect to host
-geopals.net: could not connect to host
-georgehalachev.com: did not receive HSTS header
-georgemaschke.com: did not receive HSTS header
-georgeperez.me: could not connect to host
-georgesonarthurs.com.au: did not receive HSTS header
-georgiatransport.com: could not connect to host
-geosphereservices.com: did not receive HSTS header
-gepe.ch: did not receive HSTS header
-gerandroid.com: did not receive HSTS header
-gerardobsd.com: could not connect to host
-gerbyte.uk: could not connect to host
-gereja.ga: could not connect to host
-gerencianet.com.br: did not receive HSTS header
-gereon.ch: could not connect to host
-geri.be: could not connect to host
-germancraft.net: could not connect to host
-germansoldiers.net: could not connect to host
-germanticz.de: did not receive HSTS header
-germany-board.tk: could not connect to host
-gers-authentique.com: could not connect to host
-gerum.dynv6.net: did not receive HSTS header
-geschmackspiloten.de: did not receive HSTS header
-geseduc.cl: could not connect to host
-gesiwista.net: could not connect to host
-gestorehotel.com: could not connect to host
-gesunde-smoothies.de: did not receive HSTS header
-gesundes-im-napf.de: did not receive HSTS header
-gesundheitszentrum-am-reischberg.de: could not connect to host
-get-asterisk.ru: could not connect to host
-get-cctv.com: could not connect to host
-get-link.info: did not receive HSTS header
-get-refer.com: could not connect to host
-get.zenpayroll.com: did not receive HSTS header
-geta.pub: did not receive HSTS header
-getable.com: could not connect to host
-getblys.com.au: did not receive HSTS header
-getbonfire.com: did not receive HSTS header
-getcarefirst.com: could not connect to host
-getcarina.com: could not connect to host
-getcleartouch.com: did not receive HSTS header
-getcolor.com: did not receive HSTS header
-getcolq.com: could not connect to host
-getcommande.com: did not receive HSTS header
-getdigitized.net: did not receive HSTS header
-geteckeld.nl: did not receive HSTS header
-getenergized2018.kpn: could not connect to host
-getenseguros.com.br: did not receive HSTS header
-getfestify.com: did not receive HSTS header
-getfilterlive.org: could not connect to host
-getfirepress.com: could not connect to host
-getfittedstore.com: did not receive HSTS header
-getfoundquick.com: did not receive HSTS header
-getfuturama.com: did not receive HSTS header
-getgeek.dk: could not connect to host
-getgeek.ee: could not connect to host
-getgeek.eu: could not connect to host
-getgeek.fi: could not connect to host
-getgeek.fr: could not connect to host
-getgeek.io: could not connect to host
-getgeek.no: could not connect to host
-getgeek.nu: could not connect to host
-getgeek.pl: could not connect to host
-geti2p.com: could not connect to host
-getimgs.com: could not connect to host
-getinsuranceanywhere.com: did not receive HSTS header
-getinternet.de: did not receive HSTS header
-getitpeople.com: could not connect to host
-getkai.co.nz: did not receive HSTS header
-getlantern.org: did not receive HSTS header
-getleanflorida.gov: did not receive HSTS header
-getlifti.com: could not connect to host
-getlittleapps.com: could not connect to host
-getlolaccount.com: did not receive HSTS header
-getmassage.com.ng: could not connect to host
-getmondo.co.uk: could not connect to host
-getoutofdebt.org: max-age too low: 2592000
-getpake.com: could not connect to host
-getpop.org: did not receive HSTS header
-getpost.online: did not receive HSTS header
-getprivacy.de: did not receive HSTS header
-getprivacy.net: could not connect to host
-getpuck.com: did not receive HSTS header
-getremembrall.com: could not connect to host
-getresilience.org: could not connect to host
-getronics.care: could not connect to host
-getsello.com: could not connect to host
-getserum.xyz: could not connect to host
-getsetupfile.com: did not receive HSTS header
-getshifter.io: did not receive HSTS header
-getsilknow.com: could not connect to host
-getspeaker.com: did not receive HSTS header
-getspire.com: could not connect to host
-getswadeshi.com: could not connect to host
-gettodoing.com: could not connect to host
-getts.ro: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-getwarden.net: could not connect to host
-getwashdaddy.com: could not connect to host
-getweloop.io: could not connect to host
-getyeflask.com: could not connect to host
-getyou.onl: could not connect to host
-getyourphix.tk: could not connect to host
-gevaulug.fr: could not connect to host
-gfbouncycastles.co.uk: did not receive HSTS header
-gfe.link: could not connect to host
-gflclan.ru: did not receive HSTS header
-gfm.tech: could not connect to host
-gfms.ru: could not connect to host
-gfnetfun.cf: could not connect to host
-gfoss.gr: could not connect to host
-gfournier.ca: could not connect to host
-gfw.moe: could not connect to host
-gfwno.win: could not connect to host
-gfwsb.ml: could not connect to host
-gg5197.co: could not connect to host
-gg6729.co: could not connect to host
-gg6729.com: did not receive HSTS header
-gg6957.co: could not connect to host
-gg9297.co: could not connect to host
-gg9397.com: could not connect to host
-gg9721.com: could not connect to host
-gg9728.co: could not connect to host
-gglks.com: could not connect to host
-ggobbo.com: could not connect to host
-ggrks-asano.com: could not connect to host
-ggss.cf: could not connect to host
-ggss.ml: could not connect to host
-gh16.com.ar: could not connect to host
-ghaglund.se: could not connect to host
-ghana.bz: did not receive HSTS header
-ghcif.de: could not connect to host
-gheorghe-sarcov.ga: could not connect to host
-gheorghesarcov.ga: could not connect to host
-gheorghesarcov.tk: could not connect to host
-ghi.gov: could not connect to host
-ghibli.studio: could not connect to host
-ghost-legion.com: could not connect to host
-ghostcir.com: could not connect to host
-ghou.me: could not connect to host
-ghrelinblocker.info: did not receive HSTS header
-ghrelinblocker.org: did not receive HSTS header
-giacomodrago.com: could not connect to host
-giacomodrago.it: could not connect to host
-giaithich.net: did not receive HSTS header
-gianlucapartengo.photography: did not receive HSTS header
-giant-powerfit.co.uk: did not receive HSTS header
-gibraltar-firma.com: did not receive HSTS header
-gibraltar.at: could not connect to host
-gibraltarwi.gov: did not receive HSTS header
-gibreel.tk: could not connect to host
-gicl.dk: did not receive HSTS header
-gidari.shop: did not receive HSTS header
-giddyaunt.net: could not connect to host
-gidea.nu: could not connect to host
-giduv.com: did not receive HSTS header
-gietvloer-wand.nl: did not receive HSTS header
-giftbg.org: could not connect to host
-giftmaniabrilhos.com.br: could not connect to host
-gifts.best: could not connect to host
-giftservices.nl: could not connect to host
-gifzilla.net: could not connect to host
-gigacloud.org: could not connect to host
-gigacog.com: could not connect to host
-gigantar.com: did not receive HSTS header
-gigawa.lt: could not connect to host
-gigawattz.com: did not receive HSTS header
-gigime.com: could not connect to host
-gigiscloud.servebeer.com: could not connect to host
-gigsoupmusic.com: did not receive HSTS header
-gigtroll.eu: could not connect to host
-gilcloud.com: could not connect to host
-gilescountytn.gov: did not receive HSTS header
-gilgaz.com: did not receive HSTS header
-gilium.com: could not connect to host
-gillesmorelle.com: could not connect to host
-gillet-cros.fr: could not connect to host
-gilly.berlin: did not receive HSTS header
-gilmoreid.com.au: did not receive HSTS header
-gilmourluna.com: could not connect to host
-gilpinmanagement.com: did not receive HSTS header
-gilpinrealty.com: did not receive HSTS header
-gilroywestwood.org: did not receive HSTS header
-gilsum-nh.gov: could not connect to host
-gim-app.tk: could not connect to host
-ginacat.de: did not receive HSTS header
-gincher.net: did not receive HSTS header
-gingali.de: did not receive HSTS header
-ginie.de: did not receive HSTS header
-ginijony.com: did not receive HSTS header
-ginkel.com: did not receive HSTS header
-gintenreiter-photography.com: did not receive HSTS header
-giochi-online.ws: did not receive HSTS header
-giochistem.it: could not connect to host
-giogadesign.com: did not receive HSTS header
-gip-carif-idf.net: could not connect to host
-gip-carif-idf.org: could not connect to host
-gipsamsfashion.com: could not connect to host
-gipsic.com: did not receive HSTS header
-giraffeinflatables.co.uk: could not connect to host
-girlsgenerationgoods.com: could not connect to host
-girlsgonesporty.com: could not connect to host
-girlsnet.work: could not connect to host
-gis3m.org: did not receive HSTS header
-gisgov.be: did not receive HSTS header
-gistfy.com: could not connect to host
-git-stuff.tk: could not connect to host
-git.ac.cn: could not connect to host
-git.co: could not connect to host
-git.org.il: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-gitar.io: could not connect to host
-github.party: did not receive HSTS header
-gitstuff.tk: could not connect to host
-giulianosdeli.com: did not receive HSTS header
-giveme.online: could not connect to host
-givemyanswer.com: could not connect to host
-giveoneup.org: could not connect to host
-giverang.biz: could not connect to host
-giverang.com: could not connect to host
-givip.eu: could not connect to host
-gix.net.pl: could not connect to host
-gixtools.co.uk: could not connect to host
-gixtools.uk: could not connect to host
-gizzo.sk: could not connect to host
-gkimanyar.org: could not connect to host
-gla-hyperloop.com: could not connect to host
-glabiatoren-kst.de: could not connect to host
-gladdy.uk: did not receive HSTS header
-gladiatorboost.com: could not connect to host
-gladystudio.com: did not receive HSTS header
-glaspe.com: could not connect to host
-glass-mag.eu: did not receive HSTS header
-glass.google.com: did not receive HSTS header (error ignored - included regardless)
-glasschmuck-millefiori.de: could not connect to host
-glasslikes.com: did not receive HSTS header
-glbg.eu: could not connect to host
-gle: could not connect to host
-glenavy.tk: could not connect to host
-glencambria.com: could not connect to host
-glencoveny.gov: could not connect to host
-glentakahashi.com: did not receive HSTS header
-glevolution.com: could not connect to host
-glicerina.online: could not connect to host
-glidestep.com: did not receive HSTS header
-glitzmirror.com: could not connect to host
-glnpo.gov: could not connect to host
-glob-coin.com: did not receive HSTS header
-global-lights.ma: did not receive HSTS header
-global.hr: did not receive HSTS header
-globalaccountservice.com: could not connect to host
-globalado.com: could not connect to host
-globalairsea.com.au: did not receive HSTS header
-globalbridge-japan.com: could not connect to host
-globalcanineregistry.com: could not connect to host
-globalelite.black: did not receive HSTS header
-globalexpert.co.nz: could not connect to host
-globalgivingtime.com: could not connect to host
-globalhorses.de: could not connect to host
-globalinsights.xyz: could not connect to host
-globalinstitutefortraining.org.au: did not receive HSTS header
-globalittech.com: could not connect to host
-globalityinvestment.com: could not connect to host
-globalmoneyapp.com: could not connect to host
-globalmusic.ga: could not connect to host
-globalnomadvintage.com: could not connect to host
-globalperspectivescanada.com: could not connect to host
-globalsites.nl: did not receive HSTS header
-globaltennis.ca: could not connect to host
-globalvisions-events.ch: could not connect to host
-globalvisions-events.com: could not connect to host
-globcoin.io: did not receive HSTS header
-globe-flight.de: did not receive HSTS header
-globeinform.com: did not receive HSTS header
-globuli-info.de: could not connect to host
-gloning.name: could not connect to host
-gloomyspark.com: could not connect to host
-gloria.tv: did not receive HSTS header
-glossopnorthendafc.co.uk: could not connect to host
-glotter.com: did not receive HSTS header
-gloucesterphotographer.com: did not receive HSTS header
-glu3cifer.rocks: could not connect to host
-glubbforum.de: did not receive HSTS header
-glutenfreiheit.at: could not connect to host
-glws.org: did not receive HSTS header
-glyph.ws: could not connect to host
-gm-assicurazioni.it: could not connect to host
-gm-net.jp: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-gmail: could not connect to host
-gmail.com: did not receive HSTS header (error ignored - included regardless)
-gmantra.org: max-age too low: 7776000
-gmanukyan.com: could not connect to host
-gmat.ovh: could not connect to host
-gme.one: could not connect to host
-gmoes.at: did not receive HSTS header
-gmplab.com: did not receive HSTS header
-gmw-hannover.de: could not connect to host
-gn00.ink: could not connect to host
-gnaptracker.tk: could not connect to host
-gnaucke.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-gndh.net: did not receive HSTS header
-gnhub.org: could not connect to host
-gnom.me: could not connect to host
-gnosticjade.net: did not receive HSTS header
-gnuand.me: could not connect to host
-gnunet.org: did not receive HSTS header
-gnuplus.me: could not connect to host
-gnylf.com: could not connect to host
-go.ax: could not connect to host
-go.xero.com: did not receive HSTS header
-go2sh.de: did not receive HSTS header
-go4it.solutions: did not receive HSTS header
-go9968.com: did not receive HSTS header
-goabonga.com: did not receive HSTS header
-goalongtravels.com: could not connect to host
-goalsetup.com: could not connect to host
-goaltree.ch: did not receive HSTS header
-goapunks.net: did not receive HSTS header
-goaskrose.com: did not receive HSTS header
-goat.chat: did not receive HSTS header
-goatbot.xyz: could not connect to host
-goben.ch: could not connect to host
-goblins.net: did not receive HSTS header
-goblinsatwork.com: could not connect to host
-goblintears.com: could not connect to host
-gobranding.com.vn: did not receive HSTS header
-gocphongthuy.net: did not receive HSTS header
-godofnea.com: did not receive HSTS header
-godrealms.com: could not connect to host
-godrive.ga: could not connect to host
-goedeke.ml: could not connect to host
-goedkoopstecartridges.nl: could not connect to host
-goedkopecartridgeskopen.nl: could not connect to host
-goedkopelaptopshardenberg.nl: could not connect to host
-goedkopetonerkopen.nl: could not connect to host
-goeikan.life: could not connect to host
-goerlitz-zgorzelec.org: did not receive HSTS header
-goesta-hallenbau.de: did not receive HSTS header
-goetic.space: could not connect to host
-gofigure.fr: could not connect to host
-goflipr.com: did not receive HSTS header
-goge.site: could not connect to host
-gogenenglish.com: could not connect to host
-goggs.eu: could not connect to host
-gogold-g.com: could not connect to host
-gogomail.ga: could not connect to host
-gogonano.com: did not receive HSTS header
-goguel.org: did not receive HSTS header
-gohongi-katakori.com: did not receive HSTS header
-goiaspropaganda.com.br: could not connect to host
-gold24.in: could not connect to host
-gold24.ru: did not receive HSTS header
-goldegg-training.com: did not receive HSTS header
-goldendata.io: could not connect to host
-goldeneggs.club: could not connect to host
-goldenmonrepos.com: did not receive HSTS header
-goldenruleemail.com: could not connect to host
-goldfelt.com: could not connect to host
-goldminer.ga: did not receive HSTS header
-goldpetergood.top: did not receive HSTS header
-goldpros.com: did not receive HSTS header
-goldsky.com.au: could not connect to host
-goldwater.gov: could not connect to host
-goldwaterfoundation.gov: could not connect to host
-goldwaterscholarship.gov: could not connect to host
-golearn.gov: could not connect to host
-golfburn.com: could not connect to host
-golfmeile.de: did not receive HSTS header
-golfpark-bostalsee.de: did not receive HSTS header
-golkala.com: did not receive HSTS header
-golocal-media.de: could not connect to host
-golsportsoccer.com: could not connect to host
-gomega.vn: could not connect to host
-gondawa.com: could not connect to host
-gong8.win: could not connect to host
-gonzalesca.gov: did not receive HSTS header
-gonzalosanchez.mx: did not receive HSTS header
-gooddayatwork.co.uk: did not receive HSTS header
-gooddomainna.me: could not connect to host
-goodeats.nyc: could not connect to host
-goodenough.nz: did not receive HSTS header
-goodfeels.net: could not connect to host
-goodfurday.ca: could not connect to host
-goodiesoftware.xyz: could not connect to host
-goodmengroup.de: did not receive HSTS header
-goodryb.top: could not connect to host
-goods-memo.net: did not receive HSTS header
-goodsex4all.com.br: could not connect to host
-goodtech.com.br: could not connect to host
-goodwin43.ru: could not connect to host
-goodyearsotn.co.uk: could not connect to host
-google: could not connect to host (error ignored - included regardless)
-google.ax: could not connect to host
-googlehosts.org: could not connect to host
-googlemail.com: did not receive HSTS header (error ignored - included regardless)
-googleplex.com: did not receive HSTS header (error ignored - included regardless)
-googlerecetas.com: could not connect to host
-goolok.com: could not connect to host
-goooo.info: could not connect to host
-gooroosmarketplace.com: did not receive HSTS header
-gootlijsten.nl: did not receive HSTS header
-goozz.nl: did not receive HSTS header
-gopay.cz: did not receive HSTS header
-gopher.tk: could not connect to host
-goplex.com.au: did not receive HSTS header
-gopokego.cz: could not connect to host
-goprimal.eu: did not receive HSTS header
-goproallaccess.com: could not connect to host
-gopwhip.gov: did not receive HSTS header
-goranrango.ch: could not connect to host
-gordonobrecht.com: did not receive HSTS header
-gorealya.com: could not connect to host
-gorf.chat: could not connect to host
-gorf.club: could not connect to host
-gorgiaxx.com: could not connect to host
-gorilla-gym.site: could not connect to host
-gorillow.com: could not connect to host
-gorognyelv.hu: did not receive HSTS header
-gorschenin.com: could not connect to host
-goru.travel: did not receive HSTS header
-gosciencegirls.com: did not receive HSTS header
-gosharewood.com: did not receive HSTS header
-goshop.cz: did not receive HSTS header
-gospelofmark.ch: max-age too low: 2592000
-gostream.asia: could not connect to host
-goto.google.com: did not receive HSTS header (error ignored - included regardless)
-gotobrno.cz: did not receive HSTS header
-gotocloud.ru: could not connect to host
-gotrek.com.au: could not connect to host
-gotspot.com: could not connect to host
-gottfridsberg.org: could not connect to host
-gottfriedfeyen.com: max-age too low: 0
-goubi.me: could not connect to host
-goufaan.com: could not connect to host
-goujianwen.com: did not receive HSTS header
-goukon.ru: could not connect to host
-gouptime.ml: did not receive HSTS header
-gourmettia.com: did not receive HSTS header
-gouthro-goteborg.se: did not receive HSTS header
-gouv.ovh: did not receive HSTS header
-gov.ax: could not connect to host
-goverage.org: did not receive HSTS header
-govillemo.ca: did not receive HSTS header
-gozadentro.com: could not connect to host
-gozel.com.tr: did not receive HSTS header
-gparent.org: did not receive HSTS header
-gpccp.cc: could not connect to host
-gpga.cf: could not connect to host
-gplintegratedit.com: could not connect to host
-gpo.gov: did not receive HSTS header
-gps.com.br: could not connect to host
-gpsarena.ro: could not connect to host
-gpscamera.nl: did not receive HSTS header
-gpsfix.cz: could not connect to host
-gpstuner.com: did not receive HSTS header
-gpws.ovh: did not receive HSTS header
-gpyy.net: did not receive HSTS header
-gra2.com: could not connect to host
-graandco.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-graavaapi.elasticbeanstalk.com: could not connect to host
-grabi.ga: could not connect to host
-gracechurchpc.net: could not connect to host
-graceful-project.eu: did not receive HSTS header
-gracesofgrief.com: could not connect to host
-grachtenpandverkopen.nl: could not connect to host
-graciousmay.com: did not receive HSTS header
-grademymac.com: could not connect to host
-grademypc.com: could not connect to host
-gradenotify.com: could not connect to host
-gradingcontractornc.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-grads360.org: could not connect to host
-gradsm-ci.net: could not connect to host
-grafitec.ru: did not receive HSTS header
-grafmurr.de: could not connect to host
-graftworld.pw: could not connect to host
-grahamofthewheels.com: did not receive HSTS header
-gram.tips: did not receive HSTS header
-gramati.com.br: could not connect to host
-gramtrans.com: did not receive HSTS header
-grana.com: did not receive HSTS header
-granary-demo.appspot.com: did not receive HSTS header
-grancellconsulting.com: could not connect to host
-grandchamproofing.com: did not receive HSTS header
-grandlinecsk.ru: did not receive HSTS header
-grandmascookieblog.com: could not connect to host
-grandmasfridge.org: did not receive HSTS header
-granian.pro: could not connect to host
-granishe.com: could not connect to host
-granli.org: did not receive HSTS header
-grannys-stats.com: could not connect to host
-grantdb.ca: did not receive HSTS header
-grantedby.me: max-age too low: 0
-granth.io: could not connect to host
-granular.ag: did not receive HSTS header
-graph.no: did not receive HSTS header
-graphified.nl: could not connect to host
-graphire.io: could not connect to host
-graphite.org.uk: could not connect to host
-graphsearchengine.com: could not connect to host
-gratefullane.com: did not receive HSTS header
-gratis-app.com: did not receive HSTS header
-gratis-lovecheck.de: did not receive HSTS header
-gratisonlinesex.com: could not connect to host
-gravescountyky.gov: could not connect to host
-gravitation.pro: could not connect to host
-gravitechthai.com: did not receive HSTS header
-gravito.nl: could not connect to host
-gravity-inc.net: could not connect to host
-gravity-net.de: could not connect to host
-graycell.net: could not connect to host
-grayowlworks.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-grazetech.com: did not receive HSTS header
-grcnode.co.uk: could not connect to host
-great.nagoya: could not connect to host
-greatergoodoffers.com: did not receive HSTS header
-greatfire.kr: could not connect to host
-greathosts.biz: did not receive HSTS header
-greatideahub.com: did not receive HSTS header
-greatlengthshairextensionssalon.com: did not receive HSTS header
-greatnet.de: did not receive HSTS header
-greatsong.net: max-age too low: 2592000
-greboid.co.uk: did not receive HSTS header
-greditsoft.com: did not receive HSTS header
-greedbutt.com: max-age too low: 2592000
-greeklish.gr: could not connect to host
-greeknewspapers.tk: could not connect to host
-green-light.cf: could not connect to host
-green-light.ga: could not connect to host
-green-light.gq: could not connect to host
-green-light.ml: could not connect to host
-greenbaysecuritysolutions.com: did not receive HSTS header
-greencard.su: did not receive HSTS header
-greencardtalent.com: could not connect to host
-greenconn.ca: could not connect to host
-greendroid.de: did not receive HSTS header
-greenenergysolution.uk: did not receive HSTS header
-greenesting.ch: could not connect to host
-greenesting.com: could not connect to host
-greenews.ga: could not connect to host
-greenglam.biz: did not receive HSTS header
-greengoblindev.com: could not connect to host
-greengov.gov: could not connect to host
-greenhillantiques.co.uk: could not connect to host
-greenitpark.net: did not receive HSTS header
-greensolid.biz: could not connect to host
-greensquare.tk: could not connect to host
-greenville.ag: did not receive HSTS header
-greenvines.com.tw: did not receive HSTS header
-greenvpn.ltd: could not connect to host
-greenvpn.pro: did not receive HSTS header
-greenwaylog.net: could not connect to host
-greer.ru: could not connect to host
-greggsfoundation.org.uk: could not connect to host
-gregmartyn.com: could not connect to host
-gregmilton.org: could not connect to host
-grego.pt: could not connect to host
-gregory-kramer.fr: could not connect to host
-gregorytlee.me: did not receive HSTS header
-grekland.guide: could not connect to host
-gremots.com: could not connect to host
-grengine.ch: could not connect to host
-greplin.com: could not connect to host
-gresak.io: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-gresb.com: did not receive HSTS header
-gretchelizartistry.com: did not receive HSTS header
-grettogeek.com: did not receive HSTS header
-greuel.online: could not connect to host
-greve.xyz: could not connect to host
-grevesgarten.de: could not connect to host
-grexx.co.uk: did not receive HSTS header
-grexx.de: did not receive HSTS header
-grexx.nl: did not receive HSTS header
-grey.house: could not connect to host
-greybeards.ca: could not connect to host
-greyline.se: could not connect to host
-grian-bam.at: did not receive HSTS header
-gribani.com: could not connect to host
-grid2osm.org: could not connect to host
-gridle.io: did not receive HSTS header
-gridsmartercities.com: did not receive HSTS header
-griecopelino.com: did not receive HSTS header
-grieg.com: could not connect to host
-grieg.net: could not connect to host
-grieg.org: could not connect to host
-grienenberger.eu: could not connect to host
-grigalanzsoftware.com: could not connect to host
-grillhutsunderland.com: could not connect to host
-grillinfools.com: did not receive HSTS header
-gripnijmegen.rip: could not connect to host
-gripopgriep.net: could not connect to host
-gritte.net: did not receive HSTS header
-griyo.online: could not connect to host
-groben-itsolutions.de: could not connect to host
-groenders.nl: could not connect to host
-groenewoud.me: did not receive HSTS header
-groenewoud.run: could not connect to host
-groenteclub.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-groentefruitzeep.com: could not connect to host
-groentefruitzeep.nl: could not connect to host
-groetzner.net: did not receive HSTS header
-groseb.net: could not connect to host
-gross-gerau-hausarzt.de: did not receive HSTS header
-grossell.ru: could not connect to host
-grossmann.gr: could not connect to host
-grossmisconduct.news: could not connect to host
-grouchysysadmin.com: could not connect to host
-groupe-cassous.com: did not receive HSTS header
-groupebaillargeon.com: did not receive HSTS header
-groups.google.com: did not receive HSTS header (error ignored - included regardless)
-grow-shop.ee: could not connect to host
-grow-shop.lt: could not connect to host
-grow-shop.lv: could not connect to host
-growingmetrics.com: could not connect to host
-grozip.com: did not receive HSTS header
-grozter.se: could not connect to host
-gruelang.org: could not connect to host
-grumples.biz: did not receive HSTS header
-grupoauxteclic.com: could not connect to host
-grupopgn.com.br: could not connect to host
-gruppoipl.it: did not receive HSTS header
-grusig-geil.ch: did not receive HSTS header
-gryffin.ga: could not connect to host
-gryffin.ml: could not connect to host
-gryffin.tk: could not connect to host
-gryinx.com: could not connect to host
-grytics.com: did not receive HSTS header
-gs-net.at: could not connect to host
-gsi-network.com: did not receive HSTS header
-gsm-map.com: could not connect to host
-gsmbrick.com: could not connect to host
-gsmkungen.com: could not connect to host
-gsnort.com: did not receive HSTS header
-gt-mp.net: did not receive HSTS header
-gtalife.net: did not receive HSTS header
-gtamodshop.org: could not connect to host
-gtanda.tk: could not connect to host
-gtapg.net: could not connect to host
-gtchipsi.org: did not receive HSTS header
-gtech.work: did not receive HSTS header
-gtlaun.ch: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-gtldna.com: could not connect to host
-gtmasterclub.it: did not receive HSTS header
-gtraxapp.com: could not connect to host
-gts-dp.de: did not receive HSTS header
-gts-schulsoftware.de: did not receive HSTS header
-guannan.net.cn: did not receive HSTS header
-guarajubaimoveis.com.br: did not receive HSTS header
-guaranteedloans.online: did not receive HSTS header
-guardiansoftheearth.org: could not connect to host
-guava.studio: did not receive HSTS header
-gudangpangan.id: could not connect to host
-gudrun.ml: could not connect to host
-guelo.ch: could not connect to host
-guelphhydropool.com: could not connect to host
-guendra.dedyn.io: could not connect to host
-guentherhouse.com: did not receive HSTS header
-guernseycounty.gov: could not connect to host
-gufen.ga: could not connect to host
-guffrits.com: could not connect to host
-gugaltika-ipb.org: could not connect to host
-guge.gq: could not connect to host
-gugert.net: could not connect to host
-gugga.dk: could not connect to host
-guguke.net: could not connect to host
-guida.org: did not receive HSTS header
-guide-peche-cantal.com: could not connect to host
-guidechecking.com: could not connect to host
-guidedsteps.com: could not connect to host
-guides-et-admin.com: did not receive HSTS header
-guides-peche64.com: could not connect to host
-guilde-vindicta.fr: could not connect to host
-guildgearscore.cf: could not connect to host
-guillaume-leduc.fr: could not connect to host
-guillaumecote.me: could not connect to host
-guiltypleasuresroleplaying.com: did not receive HSTS header
-guinea-pig.co: did not receive HSTS header
-guineafruitcorp.com: could not connect to host
-guitarvolume.com: could not connect to host
-gulch.in.ua: could not connect to host
-gulenbase.no: could not connect to host
-gulenet.com: could not connect to host
-gulfcoast-sandbox.com: could not connect to host
-gulitsky.me: could not connect to host
-gumannp.de: did not receive HSTS header
-gumballs.com: did not receive HSTS header
-gume4you.com: could not connect to host
-gummibande.noip.me: could not connect to host
-gunceloyunhileleri.com: could not connect to host
-gunhunter.com: could not connect to host
-guniram.com: could not connect to host
-gunnarhafdal.com: did not receive HSTS header
-gunnaro.com: could not connect to host
-gunsofshadowvalley.com: did not receive HSTS header
-guntbert.net: could not connect to host
-guochang.xyz: could not connect to host
-guoqiang.info: did not receive HSTS header
-gurkan.in: did not receive HSTS header
-gurleyal.gov: did not receive HSTS header
-gurochan.ch: did not receive HSTS header
-gurom.lv: could not connect to host
-gurpusmaximus.com: did not receive HSTS header
-gurubetng.com: could not connect to host
-gurueffect.com: could not connect to host
-gurusupe.com: could not connect to host
-gus.moe: could not connect to host
-guso.gq: could not connect to host
-guso.ml: could not connect to host
-guso.site: could not connect to host
-guso.tech: could not connect to host
-gussi.is: did not receive HSTS header
-gutenbergthemes.info: did not receive HSTS header
-guthabenkarten-billiger.de: could not connect to host
-guts.me: could not connect to host
-guts.moe: could not connect to host
-gutuia.blue: could not connect to host
-guus-thijssen.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-guusvandewal.nl: did not receive HSTS header
-guvernalternativa.ro: could not connect to host
-guyot-tech.com: did not receive HSTS header
-gvc-it.tk: could not connect to host
-gvchannel.xyz: could not connect to host
-gvi.be: did not receive HSTS header
-gviedu.com: could not connect to host
-gvm.io: did not receive HSTS header
-gvpt.sk: did not receive HSTS header
-gvt2.com: could not connect to host (error ignored - included regardless)
-gvt3.com: could not connect to host (error ignored - included regardless)
-gw2oracle.com: could not connect to host
-gw2reload.eu: could not connect to host
-gwa-verwaltung.de: did not receive HSTS header
-gwijaya.com: could not connect to host
-gwtest.us: could not connect to host
-gxgx.org: could not connect to host
-gyakori.com: could not connect to host
-gyaou-ek1njb79xkfsyxemzmauhkvxszyua7v2t.com: did not receive HSTS header
-gyara.moe: did not receive HSTS header
-gyboche.com: could not connect to host
-gyboche.science: could not connect to host
-gycis.me: did not receive HSTS header
-gylauto.fr: could not connect to host
-gymnasium-farmsen.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-gyoza.beer: could not connect to host
-gypsycatdreams.com: did not receive HSTS header
-gyume.ir: did not receive HSTS header
-gyz.io: did not receive HSTS header
-gzitech.net: could not connect to host
-gzitech.org: could not connect to host
-gzpblog.com: could not connect to host
-h-og.com: could not connect to host
-h-rickroll-n.pw: could not connect to host
-h-suppo.com: could not connect to host
-h0r.st: could not connect to host
-h11.moe: could not connect to host
-h2cdn.cloud: could not connect to host
-h2check.org: could not connect to host
-h30365.com: could not connect to host
-h33t.xyz: did not receive HSTS header
-h3x.jp: could not connect to host
-h5197.co: could not connect to host
-h6729.co: could not connect to host
-h6729.com: did not receive HSTS header
-h6957.co: could not connect to host
-h9297.co: could not connect to host
-h9397.com: could not connect to host
-h9728.co: could not connect to host
-haaksmadehaanuitvaart.nl: did not receive HSTS header
-haaldesignpro.com: could not connect to host
-haancommunity.cf: could not connect to host
-haarkliniek.com: did not receive HSTS header
-habbig.cc: could not connect to host
-habbixed.tk: could not connect to host
-habbo.life: could not connect to host
-habbos.es: did not receive HSTS header
-habbotalk.nl: could not connect to host
-habeo.si: could not connect to host
-hablemosdetecnologia.com.ve: did not receive HSTS header
-habtium.com: did not receive HSTS header
-habview.net: did not receive HSTS header
-hac30.com: could not connect to host
-hack.cz: did not receive HSTS header
-hack.li: did not receive HSTS header
-hackbubble.me: could not connect to host
-hackcraft.net: could not connect to host
-hackdown.me: did not receive HSTS header
-hackdown.us: could not connect to host
-hacker.deals: could not connect to host
-hacker.parts: did not receive HSTS header
-hacker8.cn: could not connect to host
-hackercat.ninja: max-age too low: 2592000
-hackerforever.com: did not receive HSTS header
-hackerlite.xyz: max-age too low: 0
-hackerone-ext-adroll.com: could not connect to host
-hackerpoints.com: did not receive HSTS header
-hackerschat.net: could not connect to host
-hackerspace-ntnu.no: did not receive HSTS header
-hackerstxt.org: could not connect to host
-hackest.org: did not receive HSTS header
-hackettrecipes.com: could not connect to host
-hackhouse.sh: could not connect to host
-hackingondemand.com: did not receive HSTS header
-hackingsafe.com: could not connect to host
-hackit.im: could not connect to host
-hackmeplz.com: did not receive HSTS header
-hackroyale.xyz: could not connect to host
-hacksecu.re: could not connect to host
-hacksnack.io: could not connect to host
-hacktic.info: could not connect to host
-hackyourfaceoff.com: could not connect to host
-hackzogtum-coburg.de: did not receive HSTS header
-hadret.com: did not receive HSTS header
-hadret.sh: did not receive HSTS header
-hadzic.co: could not connect to host
-haeckl.eu: did not receive HSTS header
-haehnlein.at: could not connect to host
-haemmerle.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-haf.gr: could not connect to host
-hafoda.com: could not connect to host
-hagskold.se: could not connect to host
-hahayidu.org: could not connect to host
-haibara.top: could not connect to host
-haidihai.ro: did not receive HSTS header
-hail2u.net: did not receive HSTS header
-haim.bio: could not connect to host
-haimablog.ooo: could not connect to host
-hainoni.com: could not connect to host
-hairbeautyartists.it: did not receive HSTS header
-hairlossstop.net: could not connect to host
-haitou.tk: could not connect to host
-haitschi.com: could not connect to host
-haitschi.de: did not receive HSTS header
-haitschi.net: could not connect to host
-haitschi.org: could not connect to host
-haixihui.cn: could not connect to host
-haizum.pro: could not connect to host
-hajekdavid.cz: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-hajnzic.at: max-age too low: 0
-hak5.org: did not receive HSTS header
-hakans.science: did not receive HSTS header
-hakkasangroup.com: did not receive HSTS header
-haktec.de: could not connect to host
-haku.moe: could not connect to host
-hakugin.me: could not connect to host
-hakugin.org: could not connect to host
-hakurei.moe: did not receive HSTS header
-hal-9th.space: could not connect to host
-halbowman.com: did not receive HSTS header
-halcyonsbastion.com: could not connect to host
-haleo.net: did not receive HSTS header
-half-logic.eu.org: could not connect to host
-half.host: could not connect to host
-halfco.de: could not connect to host
-halfwaythere.eu: could not connect to host
-halihali.tv: did not receive HSTS header
-halkyon.net: could not connect to host
-halledesprix.fr: did not receive HSTS header
-halletienne.fr: did not receive HSTS header
-hallettxn.com: did not receive HSTS header
-halloweenthings.website: could not connect to host
-hallumlaw.com: did not receive HSTS header
-halo.red: could not connect to host
-halongbaybackpackertour.com: could not connect to host
-haloobaloo.com: could not connect to host
-halta.info: did not receive HSTS header
-halyul.cc: could not connect to host
-haman.nl: could not connect to host
-hamikala.com: could not connect to host
-hamish.ca: did not receive HSTS header
-hamking.tk: could not connect to host
-hammamsayad.com: could not connect to host
-hammer-corp.com: did not receive HSTS header
-hamon.cc: did not receive HSTS header
-hamsters-uk.org: did not receive HSTS header
-hamu.blue: could not connect to host
-hanakatova.com: did not receive HSTS header
-hanashi.eu: did not receive HSTS header
-hancatemc.com: did not receive HSTS header
-hancc.net: could not connect to host
-handenafvanhetmedischdossier.nl: could not connect to host
-handicapindeles.nl: could not connect to host
-handicaps-ensemble.org: did not receive HSTS header
-handinhandfoundation.org.uk: did not receive HSTS header
-handiworker.com: could not connect to host
-handmade-workshop.de: could not connect to host
-handmadegobelin.com: did not receive HSTS header
-handmadehechoamano.com: could not connect to host
-handmadeshoes.pe: could not connect to host
-handmadetutorials.ro: could not connect to host
-handsandall.com: did not receive HSTS header
-handy-center.net: did not receive HSTS header
-handyglas.com: could not connect to host
-handyklinik.info: did not receive HSTS header
-hanfu.la: did not receive HSTS header
-hang333.moe: could not connect to host
-hang333.pw: could not connect to host
-hangar18-modelismo.com.br: could not connect to host
-hangout: could not connect to host (error ignored - included regardless)
-hangw.xyz: could not connect to host
-hanimalis.fr: could not connect to host
-hanksservice.com: could not connect to host
-hannes-speelgoedencadeautjes.nl: did not receive HSTS header
-hanoibuffet.com: could not connect to host
-hans-natur.de: did not receive HSTS header
-hansahome.ddns.net: could not connect to host
-hansashop.eu: did not receive HSTS header
-hansashop.fi: did not receive HSTS header
-hansch.ventures: could not connect to host
-hanying55.com: did not receive HSTS header
-hanying6.com: could not connect to host
-hanying9.com: did not receive HSTS header
-hanyingw.com: did not receive HSTS header
-hanys.xyz: could not connect to host
-hanzcollection.online: could not connect to host
-haobo111.com: could not connect to host
-haobo1111.com: could not connect to host
-haobo222.com: could not connect to host
-haobo2222.com: could not connect to host
-haobo4444.com: could not connect to host
-haobo5555.com: could not connect to host
-haobo6666.com: could not connect to host
-haobo7777.com: could not connect to host
-haoqi.men: did not receive HSTS header
-haorenka.cc: max-age too low: 0
-haorenka.org: could not connect to host
-haoshen666.com: max-age too low: 0
-haotown.cn: did not receive HSTS header
-haoyugao.com: did not receive HSTS header
-haozi.me: did not receive HSTS header
-haozijing.com: could not connect to host
-hapijs.cn: could not connect to host
-hapimiennam.com: did not receive HSTS header
-hapissl.com: could not connect to host
-hapivm.com: could not connect to host
-happix.nl: did not receive HSTS header
-happndin.com: did not receive HSTS header
-happy-baby.info: did not receive HSTS header
-happy-end-shukatsu.com: could not connect to host
-happybeerdaytome.com: could not connect to host
-happydietplan.com: could not connect to host
-happyfabric.me: did not receive HSTS header
-happygastro.com: could not connect to host
-happyhealthylifestyle.com: did not receive HSTS header
-happyheartsabode.com: could not connect to host
-happytiger.eu: could not connect to host
-hapsfordmill.co.uk: could not connect to host
-hapvm.com: could not connect to host
-haqaza.com.br: could not connect to host
-harambe.site: could not connect to host
-harbourweb.net: could not connect to host
-hardesec.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-hardline.xyz: could not connect to host
-hardloopfysio.nl: did not receive HSTS header
-hardtime.ru: could not connect to host
-hardweb.it: did not receive HSTS header
-hardyboyplant.com: did not receive HSTS header
-harekaze.info: did not receive HSTS header
-haribosupermix.com: could not connect to host
-hariome.com: did not receive HSTS header
-harlentimberproducts.co.uk: did not receive HSTS header
-harlor.de: could not connect to host
-harpersvilleal.gov: could not connect to host
-harrcostl.com: could not connect to host
-harrisonsdirect.co.uk: did not receive HSTS header
-harrisonvillenaz.org: did not receive HSTS header
-harristony.com: could not connect to host
-harry-baker.com: could not connect to host
-harryharrison.co: could not connect to host
-harryphoto.fr: did not receive HSTS header
-harrypottereditor.com: could not connect to host
-harrypottereditor.net: could not connect to host
-harrysgardengamehire.co.uk: could not connect to host
-hartfordct.gov: could not connect to host
-hartlep.eu: could not connect to host
-hartmancpa.com: did not receive HSTS header
-harvestrenewal.org: did not receive HSTS header
-harveymilton.com: did not receive HSTS header
-harz.cloud: could not connect to host
-has.vision: could not connect to host
-has.work: could not connect to host
-hasabig.wang: could not connect to host
-hasalittle.wang: could not connect to host
-hasdf.de: could not connect to host
-hash-list.com: could not connect to host
-hashiconf.com: did not receive HSTS header
-hashiconf.eu: did not receive HSTS header
-hashidays.com: did not receive HSTS header
-hashnode.com: did not receive HSTS header
-hashplex.com: could not connect to host
-hashtagswimwear.com: could not connect to host
-hasinase.de: could not connect to host
-hasst.schule: could not connect to host
-haste.ch: could not connect to host
-hastherebeenamassshooting.today: could not connect to host
-hatcherlawgroupnm.com: did not receive HSTS header
-hatethe.uk: could not connect to host
-hatoko.net: could not connect to host
-haufschild.de: could not connect to host
-hauntedfishtank.com: did not receive HSTS header
-haurumcraft.net: could not connect to host
-haus-zeitlos.de: did not receive HSTS header
-hausarztpraxis-linn.de: did not receive HSTS header
-haustechnik-schulte-sanitaer-heizung-klima.de: did not receive HSTS header
-haustierbedarf-shop24.eu: did not receive HSTS header
-hausverbrauch.de: could not connect to host
-hauswarteam.com: could not connect to host
-hav.com: could not connect to host
-havasuhomepage.com: could not connect to host
-havasutacohacienda.com: could not connect to host
-haveacry.com: did not receive HSTS header
-haveeruexaminer.com: could not connect to host
-haven-staging.cloud: could not connect to host
-haven.cloud: could not connect to host
-havenmoon.com: could not connect to host
-havenswift-hosting.co.uk: did not receive HSTS header
-hawawa.kr: could not connect to host
-hawk-la.com: could not connect to host
-hawkargentina.com: could not connect to host
-hawthornharpist.com: could not connect to host
-haxoff.com: could not connect to host
-haxon.me: could not connect to host
-haydenhill.us: could not connect to host
-haydentomas.com: did not receive HSTS header
-hayleishop.fr: could not connect to host
-haystack-staging.com: could not connect to host
-hayzepvp.us: could not connect to host
-hazcod.com: could not connect to host
-haze-productions.com: could not connect to host
-haze.network: did not receive HSTS header
-haze.productions: could not connect to host
-haze.sucks: could not connect to host
-hazeltime.se: could not connect to host
-hazloconlapix.com: could not connect to host
-hazyrom.net: could not connect to host
-hb1111.com: could not connect to host
-hb3333.com: could not connect to host
-hb4444.com: could not connect to host
-hb6729.com: could not connect to host
-hb9397.com: could not connect to host
-hbbet.com: could not connect to host
-hbdesign.work: did not receive HSTS header
-hbgshop.cf: could not connect to host
-hbvip.com: could not connect to host
-hbvip01.com: could not connect to host
-hbvip02.com: could not connect to host
-hbvip03.com: could not connect to host
-hbvip04.com: could not connect to host
-hbvip05.com: could not connect to host
-hbvip06.com: could not connect to host
-hbvip07.com: could not connect to host
-hbvip08.com: could not connect to host
-hbxianghang.com: could not connect to host
-hcaz.io: did not receive HSTS header
-hcfhomelottery.ca: did not receive HSTS header
-hcoe.fi: did not receive HSTS header
-hcr.io: did not receive HSTS header
-hcs-company.nl: did not receive HSTS header
-hcstr.com: could not connect to host
-hd4138.com: could not connect to host
-hd6556.com: could not connect to host
-hd6729.com: could not connect to host
-hd6957.com: could not connect to host
-hd9397.com: could not connect to host
-hd9721.com: could not connect to host
-hda.me: did not receive HSTS header
-hdcamvids.com: did not receive HSTS header
-hddrecovery.net.au: could not connect to host
-hdm.io: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-hdrboundless.com: could not connect to host
-hdritalyphotos.com: did not receive HSTS header
-hdserver.info: did not receive HSTS header
-hdsmigrationtool.com: could not connect to host
-hduin.xyz: could not connect to host
-hdy.nz: could not connect to host
-head-shop.lt: could not connect to host
-head-shop.lv: could not connect to host
-headlinesclub.com: could not connect to host
-headmates.xyz: could not connect to host
-headshotharp.de: did not receive HSTS header
-health-match.com.au: could not connect to host
-healthcare6.com: did not receive HSTS header
-healtheals.com: did not receive HSTS header
-healthery.com: did not receive HSTS header
-healthfitapp.com: could not connect to host
-healthiercompany.com: did not receive HSTS header
-healthierweight.co.uk: did not receive HSTS header
-healthjoy.com: did not receive HSTS header
-healthlabs.com: did not receive HSTS header
-healthmatchapp.com: could not connect to host
-healthyandnaturalliving.com: did not receive HSTS header
-healthybeterlife.click: could not connect to host
-healthycod.in: could not connect to host
-healthyrecharge.com: did not receive HSTS header
-healtious.com: could not connect to host
-heap.zone: did not receive HSTS header
-hearinghelpexpress.com: did not receive HSTS header
-hearingshofar.com: could not connect to host
-heart.ge: did not receive HSTS header
-heartfelttokens.com: did not receive HSTS header
-heartgames.pl: could not connect to host
-heartlandrentals.com: did not receive HSTS header
-heartsucker.com: could not connect to host
-hearty.blog: could not connect to host
-hearty.cf: did not receive HSTS header
-hearty.ga: could not connect to host
-hearty.ink: could not connect to host
-hearty.ooo: could not connect to host
-hearty.org.tw: could not connect to host
-hearty.space: could not connect to host
-hearty.taipei: could not connect to host
-hearty.tech: could not connect to host
-hearty.us: could not connect to host
-heartyapp.com: could not connect to host
-heartyapp.tw: could not connect to host
-heartyme.net: could not connect to host
-heathmanners.com: could not connect to host
-heaven.moe: could not connect to host
-heavenlyseals.com: could not connect to host
-heavenlysmokenc.com: could not connect to host
-heavystresser.com: could not connect to host
-heayao.com: could not connect to host
-hebaus.com: did not receive HSTS header
-hebergeurssd.com: did not receive HSTS header
-heberut.gov: did not receive HSTS header
-hebocon.nl: did not receive HSTS header
-hebriff.com: could not connect to host
-hechamano.es: did not receive HSTS header
-heckticmedia.com: did not receive HSTS header
-hectorj.net: did not receive HSTS header
-heddoun.com: did not receive HSTS header
-heeler.blue: could not connect to host
-heeler.red: could not connect to host
-heidilein.info: did not receive HSTS header
-heijblok.com: did not receive HSTS header
-heimnetze.org: could not connect to host
-heimprofis.de: could not connect to host
-heinemann.io: did not receive HSTS header
-heisenberg.co: could not connect to host
-hejahanif.se: did not receive HSTS header
-hejianpeng.cn: could not connect to host
-hejsupport.se: could not connect to host
-hekeki.com: could not connect to host
-hektenkairez.com: could not connect to host
-hele.cz: could not connect to host
-helencrump.co.uk: did not receive HSTS header
-helenelefauconnier.com: could not connect to host
-helgakristoffer.com: could not connect to host
-helgakristoffer.wedding: could not connect to host
-helicaldash.com: could not connect to host
-helioanodyne.eu: did not receive HSTS header
-helixflight.com: did not receive HSTS header
-hellenicaward.com: did not receive HSTS header
-hello-nestor.com: did not receive HSTS header
-helloaigo.com: could not connect to host
-hellofilters.com: could not connect to host
-hellomouse.tk: could not connect to host
-hellotandem.com: could not connect to host
-hellothought.net: could not connect to host
-hellscanyonraft.com: did not receive HSTS header
-helmut-a-binser.de: did not receive HSTS header
-help207.xyz: could not connect to host
-helpadmin.net: could not connect to host
-helpantiaging.com: could not connect to host
-helpdebit.com: did not receive HSTS header
-helpekwendenihospital.com: could not connect to host
-helpfacile.com: did not receive HSTS header
-helpfixe.com: did not receive HSTS header
-helpflux.com: did not receive HSTS header
-helpfute.com: did not receive HSTS header
-helpgerer.com: did not receive HSTS header
-helpgoabroad.com: did not receive HSTS header
-helpium.de: did not receive HSTS header
-helpmebuild.com: did not receive HSTS header
-helpmij.cf: could not connect to host
-helppresta.com: did not receive HSTS header
-helprocleaningservices.com: did not receive HSTS header
-helptasker.org: could not connect to host
-helpverif.com: did not receive HSTS header
-helserbrothers.com: did not receive HSTS header
-helsingfors.guide: could not connect to host
-helup.com: did not receive HSTS header
-hemainteriors.com: did not receive HSTS header
-hemlockhillscabinrentals.com: did not receive HSTS header
-hencagon.com: could not connect to host
-henchman.io: could not connect to host
-hendersonrealestatepros.com: did not receive HSTS header
-hendyisaac.com: could not connect to host
-hengelsportdeal.com: could not connect to host
-henhenlu.com: could not connect to host
-henkbrink.com: could not connect to host
-hennadesigns.org: did not receive HSTS header
-henok.eu: did not receive HSTS header
-henriknoerr.com: could not connect to host
-henriksen.is: could not connect to host
-henrock.net: could not connect to host
-hentai.design: could not connect to host
-hentaimaster.net: could not connect to host
-hentaiworld.cc: could not connect to host
-hepteract.us: could not connect to host
-heptner24.de: could not connect to host
-herbal-id.com: did not receive HSTS header
-herbaldiyeti.com: did not receive HSTS header
-herbandpat.org: could not connect to host
-herbertmouwen.nl: could not connect to host
-herculex.fi: could not connect to host
-here.ml: could not connect to host
-here4funpartysolutions.ie: did not receive HSTS header
-herealways.tk: could not connect to host
-herebedragons.io: did not receive HSTS header
-heribe-maruo.com: did not receive HSTS header
-heribro.com: did not receive HSTS header
-heritagedentistry.ca: could not connect to host
-hermann.in: could not connect to host
-hermes-net.de: could not connect to host
-hermes-servizi.it: could not connect to host
-herndl.org: did not receive HSTS header
-hernn.com: could not connect to host
-heroin.org.uk: could not connect to host
-heroliker.com: did not receive HSTS header
-herpaderp.net: could not connect to host
-herqqq.com: did not receive HSTS header
-herr-webdesign.de: could not connect to host
-herramientasbazarot.com: did not receive HSTS header
-herrenfahrt.com: did not receive HSTS header
-herrtxbias.org: could not connect to host
-hervespanneut.com: did not receive HSTS header
-herzbotschaft.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-hetluisterbos.be: did not receive HSTS header
-hetmeisjeachterpauw.nl: could not connect to host
-hetzflix.stream: did not receive HSTS header
-heverhagen.rocks: did not receive HSTS header
-hex.bz: could not connect to host
-hex2013.com: did not receive HSTS header
-hexacon.io: could not connect to host
-hexadecimal.tech: could not connect to host
-hexaware.com: did not receive HSTS header
-hexclock.io: could not connect to host
-hexe.net: did not receive HSTS header
-hexobind.com: could not connect to host
-heyfringe.com: could not connect to host
-heyguevara.com: did not receive HSTS header
-heyjournal.com: could not connect to host
-heywoodtown.co.uk: did not receive HSTS header
-hf-tekst.nl: did not receive HSTS header
-hfbg.nl: did not receive HSTS header
-hfcbank.com.gh: did not receive HSTS header
-hfi.me: did not receive HSTS header
-hflsdev.org: could not connect to host
-hfox.org: could not connect to host
-hfsctx.gov: could not connect to host
-hfu.io: did not receive HSTS header
-hg170.cc: could not connect to host
-hg525.com: did not receive HSTS header
-hg71839.com: could not connect to host
-hg881.com: could not connect to host
-hgfa.fi: could not connect to host
-hgvnet.de: could not connect to host
-hgw777.cc: did not receive HSTS header
-hh46953255.com: max-age too low: 0
-hh5197.co: could not connect to host
-hh6729.co: could not connect to host
-hh6729.com: did not receive HSTS header
-hh6957.co: could not connect to host
-hh9297.co: could not connect to host
-hh9397.com: could not connect to host
-hh9721.com: could not connect to host
-hh9728.co: could not connect to host
-hhfgaming.com: could not connect to host
-hhuitvaart.nl: did not receive HSTS header
-hi-media.ir: did not receive HSTS header
-hi.team: could not connect to host
-hi808.net: did not receive HSTS header
-hialatv.com: could not connect to host
-hibanaworld.com: could not connect to host
-hibilog.com: could not connect to host
-hicn.gq: could not connect to host
-hicts.nl: could not connect to host
-hiddendepth.ie: did not receive HSTS header
-hiddenmail.xyz: could not connect to host
-hiddenprocess.com: could not connect to host
-hiddenrefuge.eu.org: did not receive HSTS header
-hiddout.com: could not connect to host
-hidedd.com: could not connect to host
-hideftv.deals: could not connect to host
-hidrofire.com: did not receive HSTS header
-hiexmerida-mailing.com: could not connect to host
-hifly.com.tw: could not connect to host
-higgsboson.tk: did not receive HSTS header
-higherpress.org: could not connect to host
-highgrove.org.uk: could not connect to host
-highland-webcams.com: could not connect to host
-highlandsfl.gov: did not receive HSTS header
-highlightsfootball.com: did not receive HSTS header
-highlnk.com: could not connect to host
-highperformancehvac.com: did not receive HSTS header
-highspeedinternetservices.ca: could not connect to host
-highsurf-miyazaki.com: could not connect to host
-hightechbasementsystems.com: could not connect to host
-hightechgadgets.net: could not connect to host
-hightower.eu: could not connect to host
-highvelocitydesign.com: could not connect to host
-higilopocht.li: could not connect to host
-higp.de: did not receive HSTS header
-hiisukun.com: could not connect to host
-hiitcentre.com: did not receive HSTS header
-hijoan.com: did not receive HSTS header
-hikagestudios.com: could not connect to host
-hikariempire.com: could not connect to host
-hikarinime.me: could not connect to host
-hikarukujo.com: did not receive HSTS header
-hikinggearlab.com: did not receive HSTS header
-hikustore.com: could not connect to host
-hilaolu.com: could not connect to host
-hilaolu.studio: did not receive HSTS header
-hilariousbeer.com.mx: could not connect to host
-hilde.link: could not connect to host
-hildegardis-schule.de: did not receive HSTS header
-hilinemerchandising.com: did not receive HSTS header
-hill.selfip.net: could not connect to host
-hilnu.tk: could not connect to host
-hiltonhyland.com: did not receive HSTS header
-himalaya-cross.com: could not connect to host
-himalaya.video: could not connect to host
-himcy.ga: could not connect to host
-himens.com: could not connect to host
-hindi-movie.org: could not connect to host
-hindibaba.tk: could not connect to host
-hindimoviedownload.net: could not connect to host
-hindimovieonline.net: could not connect to host
-hindmanfuneralhomes.com: did not receive HSTS header
-hinepaving.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-hingle.me: could not connect to host
-hinkel-sohn.de: did not receive HSTS header
-hintergedanken.com: could not connect to host
-hintermeier-rae.at: did not receive HSTS header
-hiojbk.com: could not connect to host
-hiphop.ren: could not connect to host
-hiphopconvention.nl: could not connect to host
-hipi.jp: could not connect to host
-hipnoseinstitute.org: did not receive HSTS header
-hippo.ge: did not receive HSTS header
-hiq.sh: could not connect to host
-hiqfleet.co.uk: did not receive HSTS header
-hiraku.me: did not receive HSTS header
-hirefitness.co.uk: did not receive HSTS header
-hireprofs.com: could not connect to host
-hiresuccessstaffing.com: could not connect to host
-hiretech.com: did not receive HSTS header
-hirokilog.com: did not receive HSTS header
-hirte-digital.de: did not receive HSTS header
-hirtzfr.eu: did not receive HSTS header
-hirzaconsult.ro: did not receive HSTS header
-hisingenrunt.se: did not receive HSTS header
-histoire-theatre.com: could not connect to host
-history.pe: could not connect to host
-hitchunion.org: could not connect to host
-hiteshbrahmbhatt.com: did not receive HSTS header
-hitoy.org: could not connect to host
-hitrek.ml: could not connect to host
-hittipps.com: could not connect to host
-hiv.com.tw: could not connect to host
-hivatal-info.hu: could not connect to host
-hizliwp.net: did not receive HSTS header
-hj2999.com: could not connect to host
-hj3455.com: could not connect to host
-hj9379.com: could not connect to host
-hj99111.com: could not connect to host
-hj99177.com: could not connect to host
-hj99188.com: could not connect to host
-hjes.com.ve: could not connect to host
-hjf-immobilien.de: did not receive HSTS header
-hjkbm.cn: could not connect to host
-hjkhs.cn: could not connect to host
-hjtky.cn: could not connect to host
-hjw-kunstwerk.de: did not receive HSTS header
-hknet.at: did not receive HSTS header
-hktkl.com: could not connect to host
-hl8999.com: could not connect to host
-hledejpravnika.cz: could not connect to host
-hlidacnajemneho.cz: did not receive HSTS header
-hlin.cloud: did not receive HSTS header
-hlpublicidad.com: could not connect to host
-hlyue.com: did not receive HSTS header
-hm5189.com: max-age too low: 0
-hm773.net: did not receive HSTS header
-hm773.org: could not connect to host
-hmcdj.cn: could not connect to host
-hmksq.ae: max-age too low: 7776000
-hmm.nyc: could not connect to host
-hnrk.io: did not receive HSTS header
-hnwebi.com: could not connect to host
-hoast.xyz: could not connect to host
-hobaugh.social: could not connect to host
-hobby-gamerz-community.de: did not receive HSTS header
-hocassian.cn: did not receive HSTS header
-hochdorf-tennis.de: did not receive HSTS header
-hochzeitsgezwitscher.de: did not receive HSTS header
-hochzeitshelferlein.de: did not receive HSTS header
-hockeyapp.ch: could not connect to host
-hodamakade.com: could not connect to host
-hodne.io: could not connect to host
-hodnos.com: did not receive HSTS header
-hoekwoningverkopen.nl: could not connect to host
-hoelty.network: could not connect to host
-hoepli.it: did not receive HSTS header
-hoerbuecher-und-hoerspiele.de: could not connect to host
-hoeveiligismijn.nl: could not connect to host
-hoezzi.nl: did not receive HSTS header
-hoffens.se: did not receive HSTS header
-hofiprojekt.cz: did not receive HSTS header
-hogar123.es: could not connect to host
-hohlhupe.de: did not receive HSTS header
-hohlhupen.de: did not receive HSTS header
-hoiku-map.tokyo: could not connect to host
-hoiku-navi.com: did not receive HSTS header
-hoikuen-now.top: did not receive HSTS header
-hokepon.com: did not receive HSTS header
-hokieprivacy.org: did not receive HSTS header
-hokify.at: did not receive HSTS header
-hokify.ch: did not receive HSTS header
-hokify.de: did not receive HSTS header
-hokusya.com: did not receive HSTS header
-holad.de: did not receive HSTS header
-holidayincotswolds.co.uk: could not connect to host
-holifestival-freyung.de: could not connect to host
-holini.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-hollandguns.com: did not receive HSTS header
-hollerau.de: could not connect to host
-hollo.me: did not receive HSTS header
-hollowwinds.xyz: could not connect to host
-holmq.dk: max-age too low: 2592000
-holodeck.us: could not connect to host
-holowaty.me: could not connect to host
-holstphoto.com: max-age too low: 2592000
-holymoly.lu: could not connect to host
-holymolycasinos.com: did not receive HSTS header
-homa.website: could not connect to host
-homads.com: did not receive HSTS header
-home-cloud.online: could not connect to host
-home-coaching.be: did not receive HSTS header
-home-craft.de: could not connect to host
-home-handymen.co.uk: could not connect to host
-home-insurance-quotes.tk: could not connect to host
-home-v.ind.in: could not connect to host
-home-work-jobs.com: could not connect to host
-homeadore.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-homeandyarddetailing.com: could not connect to host
-homeautomated.com: could not connect to host
-homecarpetcleaning.co.uk: could not connect to host
-homeclouding.de: could not connect to host
-homecoming.city: could not connect to host
-homecompost.in: did not receive HSTS header
-homedatacenter.com.br: did not receive HSTS header
-homedna.com: did not receive HSTS header
-homeeducator.com: did not receive HSTS header
-homeexx.com: could not connect to host
-homehuntertoronto.com: did not receive HSTS header
-homem-viril.com: could not connect to host
-homeofjones.net: could not connect to host
-homeownersassociationmanagementla.com: could not connect to host
-homeremodelingcontractorsca.com: did not receive HSTS header
-homes-in-norcal.com: did not receive HSTS header
-homes-in-stockton.com: did not receive HSTS header
-homesandal.com: did not receive HSTS header
-homeseller.co.uk: could not connect to host
-homesfordinner.ca: could not connect to host
-homestay.id: could not connect to host
-homewatt.co.uk: could not connect to host
-homeyantra.com: did not receive HSTS header
-homezhi.com.tw: could not connect to host
-homoglyph.net: could not connect to host
-homyremedies.com: could not connect to host
-honeybeard.co.uk: did not receive HSTS header
-honeytracks.com: could not connect to host
-hongyd.online: could not connect to host
-hongzhaxiaofendui.com: could not connect to host
-hongzu.cc: could not connect to host
-hongzuwang.com: could not connect to host
-hongzuzhibo.com: could not connect to host
-honigdealer.de: did not receive HSTS header
-honkhonk.net: could not connect to host
-honkion.net: did not receive HSTS header
-honoka.tech: could not connect to host
-honoo.com: did not receive HSTS header
-hoodiecrow.com: did not receive HSTS header
-hoodoo.io: could not connect to host
-hoodoo.tech: could not connect to host
-hoodtrader.com: could not connect to host
-hoofddorp-centraal.nl: could not connect to host
-hookandloom.com: did not receive HSTS header
-hookupndate.com: did not receive HSTS header
-hoopsacademyusa.com: could not connect to host
-hope-line-earth.jp: could not connect to host
-hopemeet.info: could not connect to host
-hopesb.org: did not receive HSTS header
-hopewellproperties.co.uk: did not receive HSTS header
-hopglass.eu: could not connect to host
-hopglass.net: could not connect to host
-hopla.sg: did not receive HSTS header
-hopo.design: could not connect to host
-hor.website: could not connect to host
-horace.li: did not receive HSTS header
-horisonttimedia.fi: did not receive HSTS header
-horizonmoto.fr: did not receive HSTS header
-horizonresourcesinc.com: could not connect to host
-horkel.cf: could not connect to host
-horning.co: did not receive HSTS header
-hornyforhanzo.com: could not connect to host
-horoca.net: did not receive HSTS header
-horosho.in: could not connect to host
-horrorserv.com: could not connect to host
-horseboners.xxx: could not connect to host
-hortifarm.ro: did not receive HSTS header
-horvathtom.com: could not connect to host
-horvatnyelvkonyv.hu: could not connect to host
-host.black: could not connect to host
-host4me.ml: could not connect to host
-host97.de: could not connect to host
-hostam.link: could not connect to host
-hostarea51.com: could not connect to host
-hosted-oswa.org: did not receive HSTS header
-hostedbgp.net: did not receive HSTS header
-hostedcomments.com: could not connect to host
-hostedtalkgadget.google.com: did not receive HSTS header (error ignored - included regardless)
-hostelite.com: did not receive HSTS header
-hostfuture.co.in: could not connect to host
-hostgarou.com: did not receive HSTS header
-hostgigz.com: did not receive HSTS header
-hostinaus.com.au: did not receive HSTS header
-hostingfirst.nl: could not connect to host
-hostingfj.com: could not connect to host
-hostingsams.com: did not receive HSTS header
-hostisan.com: could not connect to host
-hostma.ma: could not connect to host
-hosts.cf: could not connect to host
-hostserv.org: could not connect to host
-hostworkz.com: did not receive HSTS header
-hosyaku.gr.jp: could not connect to host
-hotcamvids.com: could not connect to host
-hotchillibox.co.za: could not connect to host
-hotchoc.io: could not connect to host
-hotdoc.com.au: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-hotel-huberhof.at: did not receive HSTS header
-hotel-kronjuwel.de: could not connect to host
-hotelarevalo.com: max-age too low: 0
-hotelaustria-wien.at: did not receive HSTS header
-hotello.io: could not connect to host
-hotelmadhuwanvihar.com: could not connect to host
-hotelromacuernavaca.com.mx: did not receive HSTS header
-hotelvictoriaoax-mailing.com: could not connect to host
-hotelvillahermosa-mailing.com: could not connect to host
-hotelvue.nl: did not receive HSTS header
-hotesb.net: could not connect to host
-hothiphopmusic.com: did not receive HSTS header
-hotlog.tk: could not connect to host
-hoto.us: did not receive HSTS header
-hotpoint-training.com: did not receive HSTS header
-hottestwebcamgirls.org: could not connect to host
-hotwifer.com: could not connect to host
-houdremont-la-courneuve.info: could not connect to host
-houhaoyi.com: max-age too low: 0
-houkago-step.com: did not receive HSTS header
-house-of-japan.co.jp: did not receive HSTS header
-housedesigninfo.tk: could not connect to host
-houseinvestor.com: did not receive HSTS header
-housemaadiah.org: could not connect to host
-housemates.uk.com: could not connect to host
-housetalk.ru: did not receive HSTS header
-housingstudents.org.uk: could not connect to host
-houstontxlocksmiths.com: could not connect to host
-how-old.info: did not receive HSTS header
-how2fsbo.com: could not connect to host
-how2play.pl: did not receive HSTS header
-howardtyson.com: did not receive HSTS header
-howardwatts.co.uk: did not receive HSTS header
-howesky.com: could not connect to host
-howfargames.com: could not connect to host
-howmanymilesfrom.com: could not connect to host
-howrandom.org: could not connect to host
-howtechvalley.com: did not receive HSTS header
-howtocommunicate.com.au: did not receive HSTS header
-howtocuremysciatica.com: could not connect to host
-howtofreelance.com: did not receive HSTS header
-howtogeekpro.com: could not connect to host
-howtoinstall.co: did not receive HSTS header
-hozinga.de: could not connect to host
-hp-67.com: could not connect to host
-hpctecnologias.com: did not receive HSTS header
-hpeditor.tk: could not connect to host
-hpepub.asia: could not connect to host
-hpnow.com.br: could not connect to host
-hppub.info: could not connect to host
-hppub.org: could not connect to host
-hppub.site: could not connect to host
-hqhh.org: could not connect to host
-hqhost.net: did not receive HSTS header
-hr-intranet.com: could not connect to host
-hr-tech.store: could not connect to host
-hr365.dk: did not receive HSTS header
-hr98.tk: could not connect to host
-hr98.xyz: did not receive HSTS header
-hrabogados.com: could not connect to host
-hrackydomino.cz: did not receive HSTS header
-hrfhomelottery.com: did not receive HSTS header
-hrjfeedstock.com: did not receive HSTS header
-hrk.io: did not receive HSTS header
-hrpage.ml: could not connect to host
-hrstapps-dev.com: could not connect to host
-hrtech.store: could not connect to host
-hrtraining.com.au: did not receive HSTS header
-hru.gov: could not connect to host
-hs-umformtechnik.de: did not receive HSTS header
-hserver.top: could not connect to host
-hsex.tv: could not connect to host
-hsimrall.com: did not receive HSTS header
-hsir.me: could not connect to host
-hsts-preload-test.xyz: could not connect to host
-hsts.com.br: could not connect to host
-hsts.date: could not connect to host
-hstspreload.me: could not connect to host
-hsulei.com: could not connect to host
-hszhyy120.com: could not connect to host
-htcp99.com: could not connect to host
-htdcomputer.vn: could not connect to host
-htlball.at: could not connect to host
-html-lab.tk: could not connect to host
-html2gutenberg.com: did not receive HSTS header
-htmue.net: did not receive HSTS header
-htmue.org: could not connect to host
-htp2.top: could not connect to host
-http418.xyz: could not connect to host
-httphacker.com: could not connect to host
-https.ps: could not connect to host
-https.ren: could not connect to host
-httpsalarm.com: could not connect to host
-httpstaak.tk: could not connect to host
-httpstatuscode418.xyz: could not connect to host
-httptest.net: could not connect to host
-hu8188.com: could not connect to host
-hu8518.com: could not connect to host
-hu8555.com: could not connect to host
-hu8588.com: could not connect to host
-hu8777.com: could not connect to host
-hu8bet.com: could not connect to host
-hu8hu8.com: could not connect to host
-hualao.co: could not connect to host
-huangguancq.com: could not connect to host
-huangjia71.com: could not connect to host
-huangjia72.com: could not connect to host
-huangjia73.com: could not connect to host
-huangjia74.com: could not connect to host
-huangjia75.com: could not connect to host
-huangjia76.com: could not connect to host
-huangjia77.com: could not connect to host
-huangjia777.com: could not connect to host
-huangjia78.com: could not connect to host
-huangjia79.com: could not connect to host
-huangjia99.com: could not connect to host
-huangliangbo.com: did not receive HSTS header
-huangting.me: did not receive HSTS header
-huangzenghao.com: could not connect to host
-huarongdao.com: could not connect to host
-hubbroker.com: did not receive HSTS header
-hubertmoszka.pl: could not connect to host
-hubrecht.at: could not connect to host
-hubrick.com: did not receive HSTS header
-hudebnibazarmixer.cz: could not connect to host
-hudhaifahgoga.co.za: could not connect to host
-hudingyuan.cn: did not receive HSTS header
-hudsonwi.gov: did not receive HSTS header
-huffsinsurance.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-hugh-dancy.com: could not connect to host
-hughtodd.ink: could not connect to host
-hugizrecords.com: did not receive HSTS header
-hugo6.com: could not connect to host
-hugocollignon.fr: could not connect to host
-hugonote.ovh: could not connect to host
-hugovr.nl: did not receive HSTS header
-hui89119.com: max-age too low: 0
-huiser.nl: could not connect to host
-hukaloh.com: did not receive HSTS header
-hukkatavara.com: could not connect to host
-hukutuu.com: could not connect to host
-hulsoft.co.uk: could not connect to host
-human-shinri.com: could not connect to host
-humanexperiments.com: could not connect to host
-humankode.com: did not receive HSTS header
-humblebee.bg: could not connect to host
-humblebee.ch: could not connect to host
-humblebee.co.in: could not connect to host
-humblebee.com.mx: could not connect to host
-humblebee.com.ph: could not connect to host
-humblebee.foundation: could not connect to host
-humblebee.me.uk: did not receive HSTS header
-humblefinances.com: could not connect to host
-humboldtcountynv.gov: could not connect to host
-humeurs.net: could not connect to host
-humorcaliente.com: could not connect to host
-humorce.com: could not connect to host
-humortuga.pt: could not connect to host
-hump.dk: could not connect to host
-humpi.at: could not connect to host
-humpteedumptee.in: did not receive HSTS header
-hundeformel.de: could not connect to host
-hundesport-psvhalle.de: did not receive HSTS header
-hunterjohnson.io: could not connect to host
-huntingtonwv.gov: could not connect to host
-huntsvillealtransit.gov: did not receive HSTS header
-huodongweb.com: could not connect to host
-huongquynh.com: did not receive HSTS header
-hup.blue: did not receive HSTS header
-hupp.se: did not receive HSTS header
-huren.nl: did not receive HSTS header
-huskybutt.dog: could not connect to host
-huskyduvercors.com: did not receive HSTS header
-hustle.com: did not receive HSTS header
-hustle.life: did not receive HSTS header
-hustunique.com: did not receive HSTS header
-huto.ml: could not connect to host
-huwcbjones.uk: could not connect to host
-huwjones.me: could not connect to host
-huyaya123.com: max-age too low: 0
-huzurmetal.net: could not connect to host
-hvenetworks.cf: could not connect to host
-hveradistributions.com: could not connect to host
-hverdagogkink.no: could not connect to host
-hwaddress.com: max-age too low: 60
-hwcine.com: could not connect to host
-hwinfo.com: did not receive HSTS header
-hwjkk.com: could not connect to host
-hxit.cn: could not connect to host
-hxsf.me: could not connect to host
-hy1.com: could not connect to host
-hyakumachi.com: did not receive HSTS header
-hyansc.com: max-age too low: 0
-hybridiyhdistys.fi: could not connect to host
-hybridklubben.fi: could not connect to host
-hybula.nl: could not connect to host
-hydai.co: could not connect to host
-hydra.ly: did not receive HSTS header
-hydra.ws: could not connect to host
-hydra.zone: did not receive HSTS header
-hydrabit.nl: could not connect to host
-hydracommunity.net: could not connect to host
-hydradigital.com.au: did not receive HSTS header
-hydrasecurity.ga: could not connect to host
-hydrasolutions.de: did not receive HSTS header
-hydrazin.pw: did not receive HSTS header
-hydroagro.pl: could not connect to host
-hydrocloud.net: could not connect to host
-hydrodipcenter.nl: did not receive HSTS header
-hydronicheatingaustralia.com.au: did not receive HSTS header
-hydronium.cf: did not receive HSTS header
-hydronium.ga: could not connect to host
-hydronium.me: could not connect to host
-hydronium.ml: could not connect to host
-hydronium.tk: could not connect to host
-hydronyx.me: could not connect to host
-hydrosight.com: did not receive HSTS header
-hyeok.org: did not receive HSTS header
-hylians.com: could not connect to host
-hypa.net.au: did not receive HSTS header
-hypeitems.pl: did not receive HSTS header
-hyper-matrix.org: could not connect to host
-hyper69.com: could not connect to host
-hyperbolic-mayonnaise-interceptor.ovh: could not connect to host
-hypercompetitions.com: could not connect to host
-hyperporn.net: did not receive HSTS header
-hyperreal.info: did not receive HSTS header
-hyphen.co.za: could not connect to host
-hyphenpda.co.za: could not connect to host
-hypnoresults.com.au: did not receive HSTS header
-hypnos.hu: could not connect to host
-hypotheques24.ch: could not connect to host
-hypothesis.link: could not connect to host
-hysg.me: could not connect to host
-hytzongxuan.com: could not connect to host
-hytzongxuan.top: could not connect to host
-hyvanolonterapia.fi: did not receive HSTS header
-hyvive.com: could not connect to host
-hywlovexyc.info: could not connect to host
-hzh.pub: did not receive HSTS header
-i-aloks.ru: could not connect to host
-i-hakul.net: did not receive HSTS header
-i-jp.net: could not connect to host
-i-partners.sk: did not receive HSTS header
-i-rickroll-n.pw: could not connect to host
-i-scream.space: could not connect to host
-i-stats.net: could not connect to host
-i-stuff.site: did not receive HSTS header
-i00228.com: could not connect to host
-i10z.com: did not receive HSTS header
-i1place.com: did not receive HSTS header
-i28s.com: did not receive HSTS header
-i2gether.org.uk: could not connect to host
-i30365.com: could not connect to host
-i365365.com: could not connect to host
-i496.eu: could not connect to host
-i5197.co: could not connect to host
-i66.me: could not connect to host
-i6729.co: could not connect to host
-i6729.com: did not receive HSTS header
-i6957.co: could not connect to host
-i6957.com: did not receive HSTS header
-i86666.com: did not receive HSTS header
-i8cp.com: could not connect to host
-i9297.co: could not connect to host
-i9397.com: could not connect to host
-i9721.com: could not connect to host
-i9728.co: could not connect to host
-i9multiequipamentos.com.br: could not connect to host
-ia1000.com: could not connect to host
-iacono.com.br: did not receive HSTS header
-iadttaveras.com: could not connect to host
-iain.tech: did not receive HSTS header
-iamcarrico.com: did not receive HSTS header
-iamcryptoki.com: could not connect to host
-iaminashittymood.today: could not connect to host
-iamlzh.com: could not connect to host
-iamokay.nl: did not receive HSTS header
-iamreubin.co.uk: did not receive HSTS header
-iamsoareyou.se: could not connect to host
-iamveto.com: did not receive HSTS header
-ian.sh: did not receive HSTS header
-ianvisits.co.uk: did not receive HSTS header
-iban.is: could not connect to host
-ibarf.nl: did not receive HSTS header
-ibase.com: did not receive HSTS header
-ibenchu.com: could not connect to host
-ibericarempresas.es: could not connect to host
-iberiserver.es: did not receive HSTS header
-ibiu.xyz: could not connect to host
-ibizatopcharter.com: did not receive HSTS header
-ibkvkk.org: did not receive HSTS header
-ibna.online: could not connect to host
-ibnuwebhost.com: could not connect to host
-ibnw.de: did not receive HSTS header
-ibox.ovh: did not receive HSTS header
-iboy1069.com: did not receive HSTS header
-ibpegasus.tk: could not connect to host
-ibps.blog: did not receive HSTS header
-ibpsrecruitment.co.in: could not connect to host
-ibron.co: could not connect to host
-ibsafrica.co.za: could not connect to host
-ibsglobal.co.za: could not connect to host
-ibsociety.com: did not receive HSTS header
-ibstyle.tk: could not connect to host
-ibutikk.no: did not receive HSTS header
-ic-spares.com: did not receive HSTS header
-icabanken.se: did not receive HSTS header
-icaforsakring.se: did not receive HSTS header
-icake.life: did not receive HSTS header
-icasebr.com.br: could not connect to host
-icasnetwork.com: did not receive HSTS header
-icasture.top: could not connect to host
-icci.info: could not connect to host
-ice.yt: could not connect to host
-icebat.dyndns.org: could not connect to host
-icebook.co.uk: could not connect to host
-icebound.cc: did not receive HSTS header
-icebound.win: could not connect to host
-icecodenew.tk: could not connect to host
-iceiu.com: could not connect to host
-iceloch.com: could not connect to host
-icepink.com.br: could not connect to host
-iceshopy.com: did not receive HSTS header
-icetechy.com: did not receive HSTS header
-icetwister.com: did not receive HSTS header
-icfl.com.br: could not connect to host
-ich-find-den-g.net: could not connect to host
-ich-mach-druck.eu: did not receive HSTS header
-ichmachdas.net: did not receive HSTS header
-ichnichtskaufmann.de: could not connect to host
-ichoosebtec.com: did not receive HSTS header
-ichronos.net: did not receive HSTS header
-icity.ly: did not receive HSTS header
-ickerseashop.com: could not connect to host
-iclart.com: did not receive HSTS header
-icloud.net: could not connect to host
-icloudlogin.com: did not receive HSTS header
-icnsoft.cf: could not connect to host
-icnsoft.ga: could not connect to host
-icnsoft.me: could not connect to host
-icnsoft.ml: could not connect to host
-icnsoft.org: could not connect to host
-icntorrent.download: could not connect to host
-ico500.com: could not connect to host
-icondoom.nl: could not connect to host
-icountnm.gov: could not connect to host
-icowhitepapers.co: could not connect to host
-icpc2016.in.th: could not connect to host
-icq-project.net: could not connect to host
-icreative.nl: did not receive HSTS header
-icsadviseurs.nl: did not receive HSTS header
-icsfinomornasco.it: could not connect to host
-ictinforensics.org: could not connect to host
-ictl.eu: did not receive HSTS header
-ictpro.info: did not receive HSTS header
-icusignature.com: could not connect to host
-icys2017.com: did not receive HSTS header
-id-co.in: could not connect to host
-id-conf.com: could not connect to host
-id0-rsa.pub: did not receive HSTS header
-id7.fr: could not connect to host
-idafauziyah.com: could not connect to host
-idblab.tk: could not connect to host
-idbs.com: did not receive HSTS header
-idc-business.be: could not connect to host
-idc.yn.cn: could not connect to host
-idcrane.com: could not connect to host
-ideadozz.hu: could not connect to host
-idealinflatablehire.co.uk: did not receive HSTS header
-idealmoto.com: did not receive HSTS header
-idealmykonos.com: did not receive HSTS header
-idealninajemce.cz: did not receive HSTS header
-idealvenir.com: did not receive HSTS header
-ideapaisajistas.es: did not receive HSTS header
-ideaplus.me: could not connect to host
-ideasenfoto.com: did not receive HSTS header
-ideasmeetingpoint.com: could not connect to host
-ideation-inc.co.jp: could not connect to host
-idedr.com: did not receive HSTS header
-idemo.in: could not connect to host
-identifyme.net: could not connect to host
-identity-hash.online: could not connect to host
-identitylabs.uk: could not connect to host
-identitysandbox.gov: could not connect to host
-idesignstudio.de: did not receive HSTS header
-idfc.gov: did not receive HSTS header
-idfy.io: did not receive HSTS header
-idgsupply.com: could not connect to host
-idid.tk: could not connect to host
-idinby.dk: did not receive HSTS header
-idiopolis.org: could not connect to host
-idiot.trade: could not connect to host
-idiotentruppe.de: did not receive HSTS header
-idirect.com.ng: did not receive HSTS header
-idisplay.es: could not connect to host
-idisposable.co.uk: did not receive HSTS header
-idlekernel.com: could not connect to host
-idol-bikes.ru: could not connect to host
-idolshop.dk: did not receive HSTS header
-idolshop.me: could not connect to host
-idontexist.me: did not receive HSTS header
-idoo24.com: max-age too low: 2592000
-idranktoomuch.coffee: did not receive HSTS header
-idrinktoomuch.coffee: did not receive HSTS header
-idrottsnaprapaten.se: did not receive HSTS header
-idsafe.co.za: could not connect to host
-idsoccer.com: did not receive HSTS header
-iec.pe: could not connect to host
-iedcommunications.com: did not receive HSTS header
-ieedes.com: did not receive HSTS header
-ieffalot.me: did not receive HSTS header
-ieltslananhtruong.com: did not receive HSTS header
-iemas.azurewebsites.net: did not receive HSTS header
-iemb.cf: could not connect to host
-ierna.com: did not receive HSTS header
-ies.id.lv: could not connect to host
-ietsdoenofferte.nl: did not receive HSTS header
-ievgenialehner.com: did not receive HSTS header
-iewar.com: could not connect to host
-iexpert9.com: did not receive HSTS header
-if0.ru: could not connect to host
-ifad.org: did not receive HSTS header
-ifamily.top: did not receive HSTS header
-ifan.ch: could not connect to host
-ifangpei.cn: could not connect to host
-ifangpei.com.cn: could not connect to host
-ifastuniversity.com: did not receive HSTS header
-ifcfg.jp: could not connect to host
-ifcfg.me: could not connect to host
-ifconfig.co: did not receive HSTS header
-ifengge.me: could not connect to host
-iflare.de: did not receive HSTS header
-ifleurs.com: could not connect to host
-ifly.pw: could not connect to host
-ifreetion.cn: could not connect to host
-ifreetion.com: could not connect to host
-ifroheweihnachten.net: could not connect to host
-ifx.ee: could not connect to host
-ifxnet.com: could not connect to host
-ifxor.com: could not connect to host
-ifyou.live: could not connect to host
-igamingforums.com: did not receive HSTS header
-igaryhe.io: did not receive HSTS header
-igcc.jp: did not receive HSTS header
-igd.chat: could not connect to host
-igforums.com: did not receive HSTS header
-igi-2.com: could not connect to host
-igi.codes: did not receive HSTS header
-igkabel.cf: could not connect to host
-igkabel.ga: could not connect to host
-igkabel.gq: could not connect to host
-igkabel.ml: could not connect to host
-igkabel.tk: could not connect to host
-igm-be.ch: did not receive HSTS header
-igmt-guinea.com: did not receive HSTS header
-ignace72.eu: could not connect to host
-ignatisd.gr: did not receive HSTS header
-ignitedmindz.in: could not connect to host
-igsmgmt.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-igule.net: could not connect to host
-igva.or.kr: could not connect to host
-ihacker.ai: could not connect to host
-ihakkitekin.com: could not connect to host
-ihatethissh.it: could not connect to host
-ihc.im: did not receive HSTS header
-ihcr.top: did not receive HSTS header
-ihls.world: could not connect to host
-ihls.xyz: could not connect to host
-ihoey.com: could not connect to host
-ihongzu.com: could not connect to host
-ihopeit.works: could not connect to host
-ihrlotto.de: could not connect to host
-ihrnationalrat.ch: could not connect to host
-ihsbsd.me: could not connect to host
-ihsbsd.tk: could not connect to host
-ihuir.men: could not connect to host
-ihzys.com: could not connect to host
-ii5197.co: could not connect to host
-ii6729.co: could not connect to host
-ii6729.com: did not receive HSTS header
-ii6957.co: could not connect to host
-ii9297.co: could not connect to host
-ii9397.com: could not connect to host
-ii9721.com: could not connect to host
-ii9728.co: could not connect to host
-iide.co: did not receive HSTS header
-iideaz.org: could not connect to host
-iilin.com: could not connect to host
-iispeed.com: did not receive HSTS header
-ijn-dd.nl: could not connect to host
-ijoda.com: could not connect to host
-ijr.com: did not receive HSTS header
-ikarr.com: could not connect to host
-ike.io: did not receive HSTS header
-ikebuku.ro: could not connect to host
-ikenmeyer.com: could not connect to host
-ikenmeyer.eu: could not connect to host
-ikmx.net: did not receive HSTS header
-ikocik.sk: could not connect to host
-ikon.name: could not connect to host
-ikools.com: could not connect to host
-iktisatbank.com: did not receive HSTS header
-ikudo.top: could not connect to host
-ikumi.us: could not connect to host
-ikuuuu.com: could not connect to host
-ikwilguidobellen.nl: could not connect to host
-ikxkx.com: did not receive HSTS header
-ikymbo.com: did not receive HSTS header
-ikzoekeengoedkopeauto.nl: could not connect to host
-ikzoekjeugdhulp.nl: did not receive HSTS header
-ileat.com: could not connect to host
-ileci.de: could not connect to host
-ilgi.work: could not connect to host
-ilhansubasi.com: did not receive HSTS header
-iliasdeli.nl: did not receive HSTS header
-ilii.me: could not connect to host
-ilikerainbows.co: could not connect to host
-ilikerainbows.co.uk: could not connect to host
-ilikfreshweedstores.com: could not connect to host
-illjinx.info: could not connect to host
-illuminatisofficial.org: could not connect to host
-ilmconpm.de: could not connect to host
-iloilofit.org: did not receive HSTS header
-iloli.name: could not connect to host
-ilona.graphics: did not receive HSTS header
-ilpl.me: did not receive HSTS header
-iltisim.ch: did not receive HSTS header
-iltuogiardino.org: could not connect to host
-iluvscotland.co.uk: did not receive HSTS header
-im-design.com.ua: did not receive HSTS header
-ima-tourcoing.fr: did not receive HSTS header
-ima.re: did not receive HSTS header
-imadalin.ro: could not connect to host
-imageination.co: could not connect to host
-imagenesdedibujosalapizfacilesdehacer.com: could not connect to host
-imagescostumes.com: could not connect to host
-imaginarymakings.me: could not connect to host
-imakepoems.net: did not receive HSTS header
-imanhearts.com: max-age too low: 0
-imanudin.net: did not receive HSTS header
-imaple.org: could not connect to host
-imask.ml: could not connect to host
-imbrian.org: could not connect to host
-imbushuo.net: did not receive HSTS header
-imedi.it: could not connect to host
-imediamyanmar.com: did not receive HSTS header
-imediasingapore.com: did not receive HSTS header
-imefuniversitario.org: could not connect to host
-imeifacil.com: did not receive HSTS header
-imfromthefuture.com: did not receive HSTS header
-imgencrypt.com: could not connect to host
-imgul.net: could not connect to host
-imguoguo.com: could not connect to host
-imim.pw: could not connect to host
-imjiangtao.com: did not receive HSTS header
-imjustcreative.co.uk: did not receive HSTS header
-imlhx.com: did not receive HSTS header
-imlinan.cn: could not connect to host
-imlinan.com: could not connect to host
-imlinan.info: could not connect to host
-imlinan.net: could not connect to host
-imlonghao.com: did not receive HSTS header
-immanuel60.hu: did not receive HSTS header
-immarypoppinsyall.tk: could not connect to host
-immaternity.com: could not connect to host
-immersionwealth.com: could not connect to host
-immersivewebportal.com: could not connect to host
-immigrationdirect.com.au: did not receive HSTS header
-immo-vk.de: could not connect to host
-immobiliarecapitani.com: did not receive HSTS header
-immobilien-wallat.de: could not connect to host
-immoprotect.ca: could not connect to host
-immortals-co.com: did not receive HSTS header
-immoverkauf24.at: did not receive HSTS header
-immoverkauf24.de: did not receive HSTS header
-immunicity.cc: could not connect to host
-immunicity.date: did not receive HSTS header
-immunicity.eu: did not receive HSTS header
-immunicity.host: could not connect to host
-immunicity.info: could not connect to host
-immunicity.online: could not connect to host
-immunicity.press: did not receive HSTS header
-immunicity.rocks: could not connect to host
-immunicity.st: did not receive HSTS header
-immunicity.today: could not connect to host
-immunicity.top: did not receive HSTS header
-immunicity.win: could not connect to host
-immunicity.works: did not receive HSTS header
-immunicity.world: could not connect to host
-imoe.ac.cn: could not connect to host
-imoe.co: did not receive HSTS header
-imolug.org: did not receive HSTS header
-imoner.com: could not connect to host
-imoner.ga: could not connect to host
-imoni-blog.net: could not connect to host
-imoto.me: could not connect to host
-imouyang.com: could not connect to host
-imovel5.com.br: could not connect to host
-impactfestival.be: did not receive HSTS header
-impendulo.org: could not connect to host
-imperdin.com: could not connect to host
-imperdintechnologies.com: could not connect to host
-imperialinfosys.com: did not receive HSTS header
-imperialonlinestore.com: did not receive HSTS header
-imperialwebsolutions.com: did not receive HSTS header
-imperiodigital.online: did not receive HSTS header
-imperioth.com: could not connect to host
-imperiumnova.info: could not connect to host
-impex.com.bd: did not receive HSTS header
-implicitdenial.com: could not connect to host
-impressivebison.eu: could not connect to host
-improvingwp.com: could not connect to host
-impulse-clan.de: could not connect to host
-impulsionsa.com: could not connect to host
-imranraza.in: could not connect to host
-imrejonk.nl: did not receive HSTS header
-imtikai.ml: could not connect to host
-imu.li: did not receive HSTS header
-imusic.dk: did not receive HSTS header
-imy.life: did not receive HSTS header
-inandeyes.com: did not receive HSTS header
-inb4.us: could not connect to host
-inbox-group.com: did not receive HSTS header
-inbox.google.com: did not receive HSTS header (error ignored - included regardless)
-inbox.li: did not receive HSTS header
-inboxen.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-inc.wf: could not connect to host
-incendiary-arts.com: could not connect to host
-inceptionradionetwork.com: could not connect to host
-incestporn.tv: did not receive HSTS header
-inchcape-fleet-autobid.co.uk: could not connect to host
-inchomatic.com: did not receive HSTS header
-indarceky.sk: did not receive HSTS header
-indemnityinsurance.online: could not connect to host
-inderagamono.net: could not connect to host
-indesit-training.com: did not receive HSTS header
-index-games.com: could not connect to host
-indexyz.me: could not connect to host
-indianaantlersupply.com: did not receive HSTS header
-indianapolislocksmithinc.com: did not receive HSTS header
-indianjewellery.com: did not receive HSTS header
-indiawise.co.uk: could not connect to host
-indiecert.net: could not connect to host
-indieethos.com: did not receive HSTS header
-indiegame.space: could not connect to host
-indiemods.com: did not receive HSTS header
-indien.guide: could not connect to host
-indilens.com: did not receive HSTS header
-indiraactive.com: could not connect to host
-indiroyunu.com: did not receive HSTS header
-indogerman.de: could not connect to host
-indogermantrade.de: could not connect to host
-indonesian-news.tk: could not connect to host
-indoorplantsexpert.com: could not connect to host
-indoorskiassen.nl: did not receive HSTS header
-indostar303.com: did not receive HSTS header
-indredouglas.me: could not connect to host
-industinc.com: did not receive HSTS header
-industreiler.com: could not connect to host
-industreiler.com.br: could not connect to host
-industriasrenova.com: could not connect to host
-industrybazar.com: did not receive HSTS header
-inebula.it: could not connect to host
-ineed.com.mt: could not connect to host
-inertianetworks.com: could not connect to host
-inessoftsec.be: could not connect to host
-inevitavelbrasil.com.br: could not connect to host
-inexlog.fr: could not connect to host
-inexpensivecomputers.net: could not connect to host
-infcof.com: did not receive HSTS header
-inffin-tec.de: could not connect to host
-infilock.com: could not connect to host
-infinether.net: could not connect to host
-infinite.hosting: could not connect to host
-infinitegroup.info: did not receive HSTS header
-infinitelightofbeing.org: did not receive HSTS header
-infinitiofaugustaparts.com: could not connect to host
-infinitiofmarinparts.com: could not connect to host
-infinitude.me.uk: could not connect to host
-infinitude.xyz: could not connect to host
-infinitudecloud.com: could not connect to host
-infinitusgaming.eu: could not connect to host
-infinity-freedom.com: could not connect to host
-infinity-freedom.de: could not connect to host
-infinity-lifestyle.de: could not connect to host
-infinity.to: did not receive HSTS header
-infinityengine.org: could not connect to host
-infixegypt.com: did not receive HSTS header
-inflatadays.co.uk: could not connect to host
-inflate-a-bubbles.co.uk: did not receive HSTS header
-inflated.cloud: could not connect to host
-inflation.ml: could not connect to host
-influxus.com: could not connect to host
-info-bay.com: could not connect to host
-info-d-74.com: did not receive HSTS header
-info-sys.tk: could not connect to host
-infobalkans.com: did not receive HSTS header
-infogrfx.com: did not receive HSTS header
-infomir.eu: did not receive HSTS header
-infonote.ca: did not receive HSTS header
-infopagina.es: did not receive HSTS header
-infopulsa.com: did not receive HSTS header
-infopuntzorg.nl: did not receive HSTS header
-inforaga.com: did not receive HSTS header
-inforichjapan.com: did not receive HSTS header
-inforisposte.com: did not receive HSTS header
-informaciondeciclismo.com: could not connect to host
-informatik.zone: could not connect to host
-infos-generation.com: did not receive HSTS header
-infosec.pizza: could not connect to host
-infosec.rip: could not connect to host
-infosimmo.com: did not receive HSTS header
-infosoph.org: did not receive HSTS header
-infotics.es: did not receive HSTS header
-infotolium.com: did not receive HSTS header
-infotrac.net: did not receive HSTS header
-infovae-idf.com: could not connect to host
-infoweb.ee: did not receive HSTS header
-infoworm.org: could not connect to host
-infoyaracuy.com: did not receive HSTS header
-infr.red: could not connect to host
-infra.press: could not connect to host
-infradeep.com: could not connect to host
-infradio.am: could not connect to host
-infranix.eu: max-age too low: 7360000
-infruction.com: could not connect to host
-infstudios.nl: could not connect to host
-infura.co.th: could not connect to host
-infuse-mn.gov: did not receive HSTS header
-infuzeit.com.au: did not receive HSTS header
-ingalabs.hu: could not connect to host
-ingalls.run: could not connect to host
-ingatlanneked.hu: could not connect to host
-ingatlanrobot.hu: did not receive HSTS header
-inge.ec: could not connect to host
-ingenium.si: did not receive HSTS header
-ingerhy.com: could not connect to host
-ingesol.fr: did not receive HSTS header
-ingfreelancer.com: could not connect to host
-ingredientdaddy.ro: did not receive HSTS header
-ingresscode.cn: could not connect to host
-ingridbai.me: could not connect to host
-ingwaz.org: could not connect to host
-inhelix.com: could not connect to host
-inhive.group: did not receive HSTS header
-iniiter.com: could not connect to host
-inin.gq: could not connect to host
-inios.fr: could not connect to host
-initq.net: could not connect to host
-inixal.com: did not receive HSTS header
-injapan.nl: did not receive HSTS header
-injertoshorticolas.com: did not receive HSTS header
-injuryhotline.net: did not receive HSTS header
-injurylawyer.world: did not receive HSTS header
-injust.cf: could not connect to host
-injust.eu.org: could not connect to host
-injust.ga: could not connect to host
-injust.gq: could not connect to host
-injust.me: could not connect to host
-injust.ml: could not connect to host
-injust.tk: could not connect to host
-inked-guy.de: could not connect to host
-inkedguy.de: could not connect to host
-inkihost.com: did not receive HSTS header
-inksupply.com: did not receive HSTS header
-inku.ovh: did not receive HSTS header
-inkvisual.tk: could not connect to host
-inleaked.com: could not connect to host
-inmag.pl: could not connect to host
-inme.ga: did not receive HSTS header
-inmoodforsex.com: could not connect to host
-inmusrv.de: did not receive HSTS header
-innit.be: could not connect to host
-innobatics.com: did not receive HSTS header
-innoloop.com: did not receive HSTS header
-innophate-security.nl: could not connect to host
-innovamag.ca: did not receive HSTS header
-innovateohio.gov: could not connect to host
-innovationgarage.it: could not connect to host
-innovativebuildingsolutions.co.za: could not connect to host
-innovativeideaz.org: could not connect to host
-innoventure.de: could not connect to host
-innvision.net: did not receive HSTS header
-inorder.website: could not connect to host
-inovacallis.com.br: did not receive HSTS header
-inovat.ma: did not receive HSTS header
-inox.io: did not receive HSTS header
-inoxandco.com: could not connect to host
-inoxio.com: did not receive HSTS header
-inoxio.de: did not receive HSTS header
-inplacers.ru: did not receive HSTS header
-input.sh: did not receive HSTS header
-inputmag.com: did not receive HSTS header
-inquisitive.io: could not connect to host
-insane-bullets.com: could not connect to host
-insane.zone: could not connect to host
-inschrijfformulier.com: could not connect to host
-inscript.pl: could not connect to host
-inserzioni-ticino.ch: did not receive HSTS header
-insideofgaming.de: could not connect to host
-insightera.co.th: did not receive HSTS header
-insite-feedback.com: could not connect to host
-insofttransfer.com: could not connect to host
-insolent.ch: could not connect to host
-insolved.com: could not connect to host
-insouciant.org: could not connect to host
-insping.com: did not receive HSTS header
-inspirationalquotesuk.co.uk: could not connect to host
-inspirationconcepts.nl: did not receive HSTS header
-inspire-av.com: did not receive HSTS header
-inspiroinc.com: could not connect to host
-insrt.uk: did not receive HSTS header
-inst.mobi: could not connect to host
-instacart.com: did not receive HSTS header
-instachina.ru: could not connect to host
-instagib.info: did not receive HSTS header
-instalador-electrico.com: could not connect to host
-instant-hack.com: did not receive HSTS header
-instant-hack.io: could not connect to host
-instantdev.io: could not connect to host
-instantluxe.cn: could not connect to host
-instantluxe.co.uk: could not connect to host
-instantluxe.com: could not connect to host
-instantluxe.de: could not connect to host
-instantluxe.it: did not receive HSTS header
-instantphotocamera.com: could not connect to host
-instantphotoprinter.com: could not connect to host
-instantsubs.de: could not connect to host
-instaquiz.ru: could not connect to host
-instasex.ch: could not connect to host
-instawi.com: could not connect to host
-instinctive.io: did not receive HSTS header
-instinctiveads.com: did not receive HSTS header
-institutmaupertuis.hopto.org: could not connect to host
-institutoflordelavida.com: could not connect to host
-institutulcultural.ro: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-instruktor.io: could not connect to host
-insurance: could not connect to host
-insurancesloans.com: could not connect to host
-insurethebox.tk: could not connect to host
-insurgentsmustdie.com: did not receive HSTS header
-int-ext-design.fr: could not connect to host
-int-ma.in: could not connect to host
-intae.it: did not receive HSTS header
-integraelchen.de: could not connect to host
-integrationinc.com: did not receive HSTS header
-integraxor.com.tw: did not receive HSTS header
-integrityingovernmentidaho.com: could not connect to host
-intel.gov: did not receive HSTS header
-intel.li: did not receive HSTS header
-intelbet.es: did not receive HSTS header
-intelbet.ro: could not connect to host
-intelhost.net: max-age too low: 0
-intelldynamics.com: could not connect to host
-intelligentnegotiator.com: did not receive HSTS header
-inter-culinarium.com: did not receive HSTS header
-interabbit.co: could not connect to host
-interabbit.com: did not receive HSTS header
-interboursegeneva.ch: did not receive HSTS header
-interference.io: did not receive HSTS header
-interfesse.net: could not connect to host
-interfloraservices.co.uk: could not connect to host
-intergenx.co.uk: could not connect to host
-intergenx.com: could not connect to host
-intergenx.org: could not connect to host
-intergenx.org.uk: could not connect to host
-interguard.net: could not connect to host
-interhosts.co.za: could not connect to host
-interim-cto.de: could not connect to host
-interiorcheapo.com: could not connect to host
-interiorprofesional.com.ar: did not receive HSTS header
-interiortradingco.com.au: could not connect to host
-interleucina.org: could not connect to host
-interlocal.co.uk: did not receive HSTS header
-interlun.com: could not connect to host
-intermezzo-emmerich.nl: could not connect to host
-internacao.com: did not receive HSTS header
-internaldh.com: could not connect to host
-internaluse.net: did not receive HSTS header
-internationalschoolnewyork.com: could not connect to host
-internaut.co.za: did not receive HSTS header
-internetbugbounty.org: did not receive HSTS header
-internetcasinos.de: could not connect to host
-internetcensus.org: could not connect to host
-internetdentalalliance.com: did not receive HSTS header
-internethealthreport.org: did not receive HSTS header
-internethering.de: did not receive HSTS header
-internetradiocharts.de: could not connect to host
-internshipandwork.com: did not receive HSTS header
-internshipandwork.ru: did not receive HSTS header
-intersectraven.net: could not connect to host
-interspot.nl: could not connect to host
-interstellarhyperdrive.com: did not receive HSTS header
-interviewpipeline.co.uk: could not connect to host
-intervisteperstrada.com: could not connect to host
-intexplore.org: could not connect to host
-intim-uslugi-kazan.net: could not connect to host
-intimastoreatacado.com.br: could not connect to host
-intimateperrierjouet.com: could not connect to host
-intimici.com.br: could not connect to host
-intimtoy.com.ua: did not receive HSTS header
-intocities.de: could not connect to host
-intr0.com: did not receive HSTS header
-intr0.tk: could not connect to host
-intracom.com: did not receive HSTS header
-intranetsec-regionra.fr: did not receive HSTS header
-intranetsec.fr: could not connect to host
-intreaba.xyz: could not connect to host
-introvertedtravel.space: max-age too low: 0
-intrp.net: could not connect to host
-intune.life: could not connect to host
-inuyasha-petition.tk: could not connect to host
-invenio.software: could not connect to host
-inverselink.com: could not connect to host
-inversioneseconomicas.com: could not connect to host
-investcountry.com: did not receive HSTS header
-investigazione.roma.it: could not connect to host
-investingdiary.cn: could not connect to host
-investinghacker.com.au: could not connect to host
-investingtrader.net: could not connect to host
-investir.ch: could not connect to host
-investorloanshub.com: could not connect to host
-investosure.com: could not connect to host
-invictusmc.uk: could not connect to host
-invinsec.cloud: did not receive HSTS header
-invis.net: did not receive HSTS header
-invisionita.com: could not connect to host
-invitation-factory.tk: could not connect to host
-invite24.pro: could not connect to host
-invitemember.com: did not receive HSTS header
-invoicefinance.com: did not receive HSTS header
-invoicefinance.nl: could not connect to host
-invoicehippo.nl: did not receive HSTS header
-invuelto.com: did not receive HSTS header
-inxtravel.com.br: could not connect to host
-inzestfreunde.de: could not connect to host
-iocp.org: did not receive HSTS header
-iodev.nl: could not connect to host
-iodice.org: did not receive HSTS header
-iodine.com: did not receive HSTS header
-iodu.re: could not connect to host
-ioerror.us: did not receive HSTS header
-ioiart.eu: could not connect to host
-iojo.net: did not receive HSTS header
-iolife.dk: did not receive HSTS header
-ionas-law.ro: did not receive HSTS header
-ionc.ca: could not connect to host
-ione.net.nz: could not connect to host
-ionicisere.com: could not connect to host
-ionote.me: could not connect to host
-ionovia.de: did not receive HSTS header
-iopool.us: could not connect to host
-iora.fr: could not connect to host
-iosjailbreakiphone.com: could not connect to host
-iosmods.com: did not receive HSTS header
-iosprivacy.com: did not receive HSTS header
-iostips.ru: could not connect to host
-iotfen.com: could not connect to host
-iotsms.io: could not connect to host
-ip-blacklist.net: did not receive HSTS header
-ip.or.at: could not connect to host
-ip2country.info: did not receive HSTS header
-ip6.im: did not receive HSTS header
-ipad.li: could not connect to host
-ipadportfolioapp.com: did not receive HSTS header
-ipawind.com: did not receive HSTS header
-ipbill.org.uk: could not connect to host
-ipcfg.me: could not connect to host
-ipconsulting.se: could not connect to host
-ipfp.pl: did not receive HSTS header
-ipfs.ink: did not receive HSTS header
-iphonechina.net: did not receive HSTS header
-iphoneportfolioapp.com: did not receive HSTS header
-iphonote.com: did not receive HSTS header
-ipid.me: could not connect to host
-ipintel.io: did not receive HSTS header
-iplabs.de: did not receive HSTS header
-iplife.cn: could not connect to host
-ipmimagazine.com: did not receive HSTS header
-ipmotion.ca: could not connect to host
-ipnetworking.net: could not connect to host
-ipo-times.com: could not connect to host
-iprice.co.id: did not receive HSTS header
-iprice.hk: did not receive HSTS header
-iprice.my: did not receive HSTS header
-iprice.ph: did not receive HSTS header
-iprice.sg: did not receive HSTS header
-iprice.vn: did not receive HSTS header
-ipricethailand.com: did not receive HSTS header
-iprody.com: did not receive HSTS header
-ipsec.pl: could not connect to host
-ipsilon-project.org: did not receive HSTS header
-ipssl.li: could not connect to host
-iptel.ro: could not connect to host
-iptvmakedonija.mk: did not receive HSTS header
-iptvmaxx.com: could not connect to host
-ipura.ch: could not connect to host
-ipuservicedesign.com: could not connect to host
-ipv6.gr: did not receive HSTS header
-ipv6.watch: did not receive HSTS header
-ipv6cloud.club: could not connect to host
-ipv6demo.de: could not connect to host
-ipv6only.network: could not connect to host
-ipv6wallofshame.com: could not connect to host
-ipv8.net: did not receive HSTS header
-ipvsec.nl: could not connect to host
-iqcn.co: could not connect to host
-ir-saitama.com: could not connect to host
-iran-geo.com: did not receive HSTS header
-iran-poll.org: could not connect to host
-irandp.net: could not connect to host
-iranianlawschool.com: could not connect to host
-iraqidinar.org: did not receive HSTS header
-irazimina.ru: did not receive HSTS header
-irc-results.com: could not connect to host
-irccloud.com: did not receive HSTS header
-irdvb.com: could not connect to host
-iready.ro: could not connect to host
-irelandesign.com: could not connect to host
-irenekauer.com: could not connect to host
-irgwebsites.com: did not receive HSTS header
-iridiumflare.de: did not receive HSTS header
-irinkeby.nu: could not connect to host
-irische-segenswuensche.info: could not connect to host
-irisdesideratum.com: could not connect to host
-irisdina.de: could not connect to host
-irishmusic.nu: could not connect to host
-irland.guide: could not connect to host
-iro-iro.xyz: could not connect to host
-irob.co.jp: did not receive HSTS header
-iron-guard.net: did not receive HSTS header
-ironbelly.pro: could not connect to host
-irondaleirregulars.com: did not receive HSTS header
-irugs.ch: did not receive HSTS header
-irugs.co.uk: did not receive HSTS header
-irugs.com.sg: did not receive HSTS header
-irukandjilabs.com: could not connect to host
-irun-telecom.co.uk: could not connect to host
-irvinepa.org: max-age too low: 10540800
-is-a-furry.org: did not receive HSTS header
-is-sw.net: did not receive HSTS header
-isaackabel.cf: could not connect to host
-isaackabel.ga: could not connect to host
-isaackabel.gq: could not connect to host
-isaackabel.ml: could not connect to host
-isaackabel.tk: could not connect to host
-isaacpartnership.com: did not receive HSTS header
-isarklinikum.de: did not receive HSTS header
-isastylish.com: could not connect to host
-isc2chapter-cny.org: could not connect to host
-ischool.co.jp: did not receive HSTS header
-isdecolaop.nl: could not connect to host
-isdf.me: could not connect to host
-isdown.cz: could not connect to host
-isdr-bukavu.net: did not receive HSTS header
-isef-eg.com: could not connect to host
-iservicio.com.mx: could not connect to host
-iseulde.com: could not connect to host
-isfff.com: did not receive HSTS header
-isfriday.com: could not connect to host
-ishadowsocks.ltd: could not connect to host
-ishangirdhar.com: could not connect to host
-ishillaryclintoninprisonyet.com: could not connect to host
-ishotagency.com: could not connect to host
-isidom.fr: did not receive HSTS header
-isigmaonline.org: did not receive HSTS header
-isipulsa.web.id: did not receive HSTS header
-isisfighters.info: could not connect to host
-isistomie.com: could not connect to host
-isitamor.pm: could not connect to host
-isitnuclearwaryet.com: could not connect to host
-isitpatchtuesday.com: did not receive HSTS header
-isitrest.info: could not connect to host
-iskai.net: did not receive HSTS header
-iskanderbroere.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-iskkk.com: could not connect to host
-iskkk.net: could not connect to host
-islandlakeil.gov: could not connect to host
-islandpumpandtank.com: did not receive HSTS header
-islandzero.net: could not connect to host
-islazia.fr: could not connect to host
-islykaithecutest.cf: could not connect to host
-islykaithecutest.ml: could not connect to host
-ismailkarsli.com: could not connect to host
-ismetroonfiretoday.com: did not receive HSTS header
-isntall.us: did not receive HSTS header
-iso27032.com: did not receive HSTS header
-isoface33.fr: did not receive HSTS header
-isogen5.com: could not connect to host
-isogram.nl: could not connect to host
-isondo.com: could not connect to host
-isoroc-nidzica.pl: could not connect to host
-ispo.com.tw: did not receive HSTS header
-ispsoft.pro: could not connect to host
-ispweb.es: did not receive HSTS header
-isqrl.de: did not receive HSTS header
-israkurort.com: could not connect to host
-isscouncil.com: could not connect to host
-isslshop.com: could not connect to host
-issoexiste.com: did not receive HSTS header
-issuesofconcern.in: did not receive HSTS header
-ist-intim.de: could not connect to host
-istanbultravelguide.info: could not connect to host
-istaspirtslietas.lv: did not receive HSTS header
-istgame.com: did not receive HSTS header
-isthefieldcontrolsystemdown.com: could not connect to host
-istherrienstillcoach.com: could not connect to host
-isthisus.org: could not connect to host
-istore.lt: did not receive HSTS header
-isyu.xyz: could not connect to host
-isz-berlin.de: did not receive HSTS header
-iszy.me: did not receive HSTS header
-it-cave.com: could not connect to host
-it-enthusiasts.tech: could not connect to host
-it-go.net: did not receive HSTS header
-it-labor.info: did not receive HSTS header
-it-schwerin.de: could not connect to host
-it-seems-to.work: could not connect to host
-it-sysoft.com: could not connect to host
-it-world.eu: could not connect to host
-itactiq.info: could not connect to host
-itad.top: could not connect to host
-ital-gamma.be: could not connect to host
-italianjourneys.com.au: did not receive HSTS header
-itblog.pp.ua: could not connect to host
-itbloginfo.com: could not connect to host
-itbrief.co.nz: did not receive HSTS header
-itbrief.com.au: did not receive HSTS header
-itchimes.com: did not receive HSTS header
-itdo.com: did not receive HSTS header
-itds-consulting.com: could not connect to host
-itds-consulting.cz: could not connect to host
-itds-consulting.eu: could not connect to host
-itechgeek.com: did not receive HSTS header
-iteke.ml: could not connect to host
-iteke.tk: could not connect to host
-items.lv: did not receive HSTS header
-itemton.com: could not connect to host
-iterasoft.de: did not receive HSTS header
-itfaq.nl: did not receive HSTS header
-itfensi.net: could not connect to host
-itfly.xyz: could not connect to host
-itforcc.com: did not receive HSTS header
-itforge.nl: did not receive HSTS header
-itgirls.rs: could not connect to host
-itgm-consultants.com: did not receive HSTS header
-ithelfer.ch: did not receive HSTS header
-itinsight.hu: did not receive HSTS header
-itinthebubble.com: could not connect to host
-itiomassagem.com.br: did not receive HSTS header
-itisjustnot.cricket: could not connect to host
-itmanie.cz: did not receive HSTS header
-itnews-bg.com: did not receive HSTS header
-itogoyomi.com: did not receive HSTS header
-itos.asia: did not receive HSTS header
-itos.pl: did not receive HSTS header
-itpol.dk: did not receive HSTS header
-itpro-mg.de: could not connect to host
-itproject.guru: could not connect to host
-itqh0pk67wngbob5suh-c7glbmvtfa0dqhokufs.com: did not receive HSTS header
-itrack.in.th: could not connect to host
-itriskltd.com: did not receive HSTS header
-itruth.tk: could not connect to host
-its-schindler.de: could not connect to host
-its-v.de: could not connect to host
-itsadog.co.uk: did not receive HSTS header
-itsagadget.com: did not receive HSTS header
-itsanicedoor.co.uk: could not connect to host
-itsasaja.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-itsatrap.nl: could not connect to host
-itsecurityassurance.pw: could not connect to host
-itsense.fr: did not receive HSTS header
-itsg-faq.de: could not connect to host
-itshost.ru: could not connect to host
-itskayla.com: did not receive HSTS header
-itsmejohn.org: could not connect to host
-itspartytimesweetinflations.com: could not connect to host
-itspecialista.eu: could not connect to host
-itsupport-luzern.ch: could not connect to host
-ittop-gabon.com: could not connect to host
-itu2015.de: could not connect to host
-itxn.cn: could not connect to host
-ius.io: did not receive HSTS header
-iuscommunity.org: did not receive HSTS header
-iusedtosmoke.com: did not receive HSTS header
-ivanaleksandrov.net: did not receive HSTS header
-ivanilla.org: could not connect to host
-ivanpolchenko.com: could not connect to host
-ivi-co.com: max-age too low: 0
-ivi-fertilite.fr: max-age too low: 0
-ivi-fertility.com: max-age too low: 0
-ivi-fruchtbarkeit.de: max-age too low: 0
-ivi.com.ar: max-age too low: 0
-ivi.com.pa: max-age too low: 0
-ivi.es: max-age too low: 0
-ivi.mx: did not receive HSTS header
-ivi.net.br: max-age too low: 0
-ivi.pt: max-age too low: 0
-ivinet.cl: max-age too low: 0
-ivitalia.it: max-age too low: 0
-ivk.website: could not connect to host
-ivklombard.ru: could not connect to host
-ivocopro.de: could not connect to host
-ivocotec.com: could not connect to host
-ivoryonsunset.com: could not connect to host
-ivotemahdi.com: could not connect to host
-ivxv.ee: could not connect to host
-ivy.show: could not connect to host
-iwannarefill.com: could not connect to host
-iwantexchange.com: could not connect to host
-iwantpayments.com: could not connect to host
-iweathernet.com: did not receive HSTS header
-iwex.swiss: could not connect to host
-iwilcox.me.uk: could not connect to host
-iworos.com: did not receive HSTS header
-iwos.io: did not receive HSTS header
-iwpbk.com: could not connect to host
-iww.mx: could not connect to host
-iwyc.cn: did not receive HSTS header
-ix.mk: did not receive HSTS header
-ix8.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-ixec2.tk: could not connect to host
-ixh.me: could not connect to host
-ixnext.de: did not receive HSTS header
-iyinolaashafa.com: could not connect to host
-iyoumu.top: could not connect to host
-iyuanbao.net: did not receive HSTS header
-izaakbeekman.com: max-age too low: 2592000
-izanah.com: did not receive HSTS header
-izdiwho.com: did not receive HSTS header
-izolight.ch: could not connect to host
-izonemart.com: did not receive HSTS header
-izoox.com: did not receive HSTS header
-izzzorgconcerten.nl: could not connect to host
-j-eck.nl: could not connect to host
-j-lsolutions.com: could not connect to host
-j-rickroll-a.pw: could not connect to host
-j00228.com: could not connect to host
-j0m.de: could not connect to host
-j0ng.xyz: could not connect to host
-j15t98j.co.uk: did not receive HSTS header
-j2ee.cz: could not connect to host
-j30365.com: could not connect to host
-j32661.com: could not connect to host
-j32662.com: could not connect to host
-j5197.co: could not connect to host
-j6729.co: could not connect to host
-j6729.com: did not receive HSTS header
-j6957.co: could not connect to host
-j6957.com: did not receive HSTS header
-j70101.com: did not receive HSTS header
-j70102.com: did not receive HSTS header
-j70103.com: did not receive HSTS header
-j70104.com: did not receive HSTS header
-j70105.com: did not receive HSTS header
-j7051.com: did not receive HSTS header
-j7052.com: did not receive HSTS header
-j7053.com: did not receive HSTS header
-j8y.de: could not connect to host
-j9297.co: could not connect to host
-j9512.com: could not connect to host
-j9517.com: could not connect to host
-j95aa.com: could not connect to host
-j95bb.com: could not connect to host
-j9721.com: could not connect to host
-j9728.co: could not connect to host
-ja-dyck.de: could not connect to host
-ja-publications.com: did not receive HSTS header
-ja.md: did not receive HSTS header
-jaan.su: could not connect to host
-jaaxypro.com: could not connect to host
-jabba.homelinux.org: could not connect to host
-jabbas.eu: could not connect to host
-jability.ovh: did not receive HSTS header
-jackalworks.com: could not connect to host
-jackdelik.de: did not receive HSTS header
-jackdoan.com: did not receive HSTS header
-jackfahnestock.com: could not connect to host
-jackfletcher.me: did not receive HSTS header
-jackingramnissanparts.com: could not connect to host
-jackjack.ga: could not connect to host
-jackops.com: could not connect to host
-jackrusselterrier.com.br: could not connect to host
-jacksutton.info: could not connect to host
-jackyyf.com: could not connect to host
-jaco.by: could not connect to host
-jacobdevans.com: did not receive HSTS header
-jacobparry.ca: did not receive HSTS header
-jacobphono.com: could not connect to host
-jaculus.eu: did not receive HSTS header
-jadara.info: could not connect to host
-jaduniv.cf: could not connect to host
-jaguarwong.xyz: could not connect to host
-jahliveradio.com: did not receive HSTS header
-jahmusic.net: did not receive HSTS header
-jaideeyoga.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-jaimechanaga.com: could not connect to host
-jaimepumarejo.com: did not receive HSTS header
-jaion.ml: could not connect to host
-jaion.tech: could not connect to host
-jaion.xyz: could not connect to host
-jakebeardsley.com: could not connect to host
-jakenbake.com: did not receive HSTS header
-jakewales.com: could not connect to host
-jakincode.army: could not connect to host
-jakobdenlinger.com: could not connect to host
-jaksel.id: could not connect to host
-jaksi.io: could not connect to host
-jakubarbet.eu: could not connect to host
-jalogisch.de: could not connect to host
-jamanji.com.ng: could not connect to host
-jamaware.org: could not connect to host
-jamberry.com.mx: could not connect to host
-jamberrynails.co.uk: did not receive HSTS header
-james-digital.com: did not receive HSTS header
-james.guru: could not connect to host
-james.je: could not connect to host
-jamesandanneke.com: did not receive HSTS header
-jamesandpame.la: could not connect to host
-jamesbradach.com: did not receive HSTS header
-jamesburton.london: could not connect to host
-jamesbywater.co.uk: could not connect to host
-jamesbywater.com: could not connect to host
-jamesbywater.me: could not connect to host
-jamesbywater.me.uk: could not connect to host
-jamesbywater.uk: could not connect to host
-jamesclark.com: did not receive HSTS header
-jamesconroyfinn.com: did not receive HSTS header
-jamesdoell.com: could not connect to host
-jamesdoylephoto.com: did not receive HSTS header
-jamesevans.is: could not connect to host
-jamesf.xyz: could not connect to host
-jamesforman.co.nz: did not receive HSTS header
-jameshale.me: could not connect to host
-jamesheald.com: could not connect to host
-jamesl.ml: could not connect to host
-jamesmaurer.com: did not receive HSTS header
-jamesmorrison.me: did not receive HSTS header
-jamesrains.com: could not connect to host
-jamesrobertson.io: could not connect to host
-jamestmart.in: could not connect to host
-jamiepeters.nl: did not receive HSTS header
-jamjestsimon.pl: could not connect to host
-jamourtney.com: could not connect to host
-jamyeprice.com: did not receive HSTS header
-jan-cermak.cz: did not receive HSTS header
-jan-daniels.de: did not receive HSTS header
-jan-rieger.de: could not connect to host
-jan27.org: did not receive HSTS header
-janada.cz: could not connect to host
-janario.me: could not connect to host
-jancukers.host: could not connect to host
-janduchene.ch: could not connect to host
-janebondsurety.com: did not receive HSTS header
-jangho.me: could not connect to host
-janheidler.dynv6.net: could not connect to host
-janking.de: could not connect to host
-janmachynka.cz: could not connect to host
-janmg.com: did not receive HSTS header
-janoberst.com: did not receive HSTS header
-janosh.com: did not receive HSTS header
-jansen-schilders.nl: did not receive HSTS header
-janssen.fm: could not connect to host
-janssenwigman.nl: could not connect to host
-janus-engineering.de: did not receive HSTS header
-janverlaan.nl: did not receive HSTS header
-janz.online: could not connect to host
-jap-nope.de: could not connect to host
-japan4you.org: could not connect to host
-japanbaths.com: did not receive HSTS header
-japaneseemoticons.org: did not receive HSTS header
-japanesenames.biz: did not receive HSTS header
-japanwide.net: did not receive HSTS header
-jape.today: could not connect to host
-japlex.com: could not connect to host
-japon-japan.com: did not receive HSTS header
-jaqen.ch: could not connect to host
-jar.io: did not receive HSTS header
-jardin-exotique-rennes.fr: did not receive HSTS header
-jardinderline.ch: could not connect to host
-jardiniersduminotaure.fr: did not receive HSTS header
-jardins-utopie.net: did not receive HSTS header
-jaredbates.net: did not receive HSTS header
-jaredeberle.org: did not receive HSTS header
-jaredfraser.com: could not connect to host
-jario.com.br: did not receive HSTS header
-jarivisual.com: could not connect to host
-jarl.ninja: could not connect to host
-jarnail.ca: did not receive HSTS header
-jaroslavc.eu: could not connect to host
-jaroslavtrsek.cz: did not receive HSTS header
-jarrodcastaing.com: did not receive HSTS header
-jarrodcastaing.com.au: did not receive HSTS header
-jarsater.com: could not connect to host
-jartza.org: could not connect to host
-jasl.works: could not connect to host
-jasmineconseil.com: did not receive HSTS header
-jasminefields.net: did not receive HSTS header
-jasmyn.tk: could not connect to host
-jason.re: did not receive HSTS header
-jasonadam.de: did not receive HSTS header
-jasoncosper.com: did not receive HSTS header
-jasonian-photo.com: could not connect to host
-jasonradin.com: could not connect to host
-jasonrobinson.me: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-jasonroe.me: did not receive HSTS header
-jasonsansone.com: could not connect to host
-jasonwindholz.com: could not connect to host
-jastoria.pl: did not receive HSTS header
-jateng.press: could not connect to host
-jav-collective.com: could not connect to host
-java-board.com: could not connect to host
-javachip.win: could not connect to host
-javalestari.com: did not receive HSTS header
-javan.ga: could not connect to host
-javascriptlab.fr: could not connect to host
-javelinsms.com: could not connect to host
-javiermixdjs.com: did not receive HSTS header
-javilacat.info: could not connect to host
-jawn.ca: could not connect to host
-jawnelodzkie.org.pl: could not connect to host
-jaxageto.de: did not receive HSTS header
-jayblock.com: did not receive HSTS header
-jaycouture.com: could not connect to host
-jaylen.com.ar: did not receive HSTS header
-jayna.design: could not connect to host
-jaypandit.me: could not connect to host
-jayschulman.com: did not receive HSTS header
-jayscoaching.com: could not connect to host
-jayshao.com: did not receive HSTS header
-jazerxx.com: could not connect to host
-jazzfeet.co.uk: could not connect to host
-jazzinutrecht.info: did not receive HSTS header
-jb159632.com: max-age too low: 0
-jballelectronics.com: did not receive HSTS header
-jbelien.be: did not receive HSTS header
-jbelien.photography: could not connect to host
-jbeta.is: could not connect to host
-jbj.co.uk: did not receive HSTS header
-jbn.mx: could not connect to host
-jbrowndesign.me: could not connect to host
-jbt-stl.com: did not receive HSTS header
-jcaicedo.tk: could not connect to host
-jccars-occasions.be: could not connect to host
-jcch.de: could not connect to host
-jcf-office.com: did not receive HSTS header
-jcit.xyz: could not connect to host
-jcolideles.com: could not connect to host
-jcom-communication-system.biz: could not connect to host
-jcor.me: could not connect to host
-jcoscia.com: could not connect to host
-jcra.net: could not connect to host
-jcraft.us: could not connect to host
-jctf.io: could not connect to host
-jcvidroseespelhos.com.br: did not receive HSTS header
-jcyz.cf: could not connect to host
-jd-group.co.uk: could not connect to host
-jd777.vip: could not connect to host
-jdav-leipzig.de: could not connect to host
-jdcdirectsales.com: could not connect to host
-jdcdirectsales.com.ph: could not connect to host
-jdcgroup.com.ph: could not connect to host
-jdfk.net: could not connect to host
-jdgonzalez95.com: could not connect to host
-jdh8.org: did not receive HSTS header
-jdoiron.me: did not receive HSTS header
-jdsf.tk: could not connect to host
-jdubya.info: could not connect to host
-je.net.cn: could not connect to host
-jean-remy.ch: could not connect to host
-jeancafe.ddns.net: could not connect to host
-jecurranpc.com: did not receive HSTS header
-jedayoshi.me: did not receive HSTS header
-jedayoshi.tk: could not connect to host
-jeemain.org: could not connect to host
-jeerbl.com: did not receive HSTS header
-jeff.is: could not connect to host
-jeff393.com: could not connect to host
-jeffcasavant.com: did not receive HSTS header
-jeffersonkyattorney.gov: did not receive HSTS header
-jeffersonregan.org: could not connect to host
-jeffhuxley.com: could not connect to host
-jeffpenchoff.com: could not connect to host
-jeffreymagee.com: did not receive HSTS header
-jeffrhinelander.com: did not receive HSTS header
-jehovahsays.net: could not connect to host
-jeil-makes.co.kr: could not connect to host
-jelewa.de: did not receive HSTS header
-jelleschneiders.com: did not receive HSTS header
-jellow.nl: did not receive HSTS header
-jelmer.co.uk: could not connect to host
-jemigjordy.nl: did not receive HSTS header
-jemoticons.com: did not receive HSTS header
-jena.space: could not connect to host
-jenjoit.de: could not connect to host
-jenkinscountyga.gov: could not connect to host
-jennedebleser.com: did not receive HSTS header
-jenniferchan.id.au: could not connect to host
-jennifercherniack.com: did not receive HSTS header
-jenniferlucia.com: did not receive HSTS header
-jennifermason.eu: could not connect to host
-jennifertilly.tk: could not connect to host
-jennybeaned.com: did not receive HSTS header
-jens-prangenberg.de: did not receive HSTS header
-jens.hk: could not connect to host
-jensenbanden.no: could not connect to host
-jenssen.org: could not connect to host
-jeparamedia.com: did not receive HSTS header
-jepertinger-itconsulting.de: did not receive HSTS header
-jeremy-chen.org: could not connect to host
-jeremye77.com: did not receive HSTS header
-jeremymade.com: could not connect to host
-jeremywagner.me: did not receive HSTS header
-jeroendev.one: did not receive HSTS header
-jeroenensanne.wedding: could not connect to host
-jeroenvanderwal.nl: did not receive HSTS header
-jeroldirvin.com: could not connect to host
-jerrypau.ca: did not receive HSTS header
-jesorsenville.com: did not receive HSTS header
-jessevictors.com: could not connect to host
-jessicah.org: could not connect to host
-jessietessiephptrouble.herokuapp.com: did not receive HSTS header
-jesuisformidable.nl: could not connect to host
-jesuslucas.com: did not receive HSTS header
-jet-code.com: did not receive HSTS header
-jetapi.org: could not connect to host
-jetbrains.pw: did not receive HSTS header
-jetlagphotography.com: could not connect to host
-jeton.com: did not receive HSTS header
-jetsetcharge.com: could not connect to host
-jetsetpay.com: could not connect to host
-jetzt-elektromobil.de: could not connect to host
-jewelers.expert: could not connect to host
-jewellerydesignstore.com: could not connect to host
-jewellerymarvels.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-jexler.net: could not connect to host
-jez.nl: could not connect to host
-jf-fotos.de: did not receive HSTS header
-jfmel.com: did not receive HSTS header
-jfmhero.me: could not connect to host
-jfnllc.com: could not connect to host
-jfsa.jp: did not receive HSTS header
-jfx.space: did not receive HSTS header
-jglover.com: did not receive HSTS header
-jh-media.eu: could not connect to host
-jhburton.co.uk: could not connect to host
-jhburton.uk: could not connect to host
-jhcommunitysports.co.uk: could not connect to host
-jhejderup.me: could not connect to host
-jhermsmeier.de: did not receive HSTS header
-jhf.io: did not receive HSTS header
-jhservicos.net.br: could not connect to host
-jhw-profiles.de: did not receive HSTS header
-jia1hao.com: did not receive HSTS header
-jiacl.com: could not connect to host
-jiaidu.com: could not connect to host
-jiangzequn.com: could not connect to host
-jiangzm.com: could not connect to host
-jianjiantv.com: could not connect to host
-jianyuan.pro: could not connect to host
-jiaqiang.vip: could not connect to host
-jiatingtrading.com: could not connect to host
-jiazhao.ga: could not connect to host
-jichi.me: could not connect to host
-jie.dance: could not connect to host
-jief.me: could not connect to host
-jieyang2016.com: could not connect to host
-jigsawdevelopments.com: could not connect to host
-jiid.ga: could not connect to host
-jikegu.com: could not connect to host
-jikken.de: could not connect to host
-jimas.eu: did not receive HSTS header
-jimbiproducts.com: could not connect to host
-jimenacocina.com: did not receive HSTS header
-jimgao.tk: did not receive HSTS header
-jimizhou.xyz: could not connect to host
-jimmehcai.com: could not connect to host
-jimmycn.com: could not connect to host
-jimmynelson.com: did not receive HSTS header
-jinancy.fr: could not connect to host
-jinanshen.com: could not connect to host
-jingyuesi.com: could not connect to host
-jinliming.ml: could not connect to host
-jinmaguoji.com: could not connect to host
-jinsha1234567.com: could not connect to host
-jinsha12345678.com: could not connect to host
-jinsha168.org: could not connect to host
-jinsha2228.com: could not connect to host
-jinsha2288.net: could not connect to host
-jinsha66669.com: could not connect to host
-jinsha6969.com: could not connect to host
-jinsha8888888.com: could not connect to host
-jinsha99999.com: could not connect to host
-jintaiyang123.org: could not connect to host
-jiosongs.biz: could not connect to host
-jiosongs.com: could not connect to host
-jira.com: did not receive HSTS header
-jirav.io: could not connect to host
-jirosworld.com: did not receive HSTS header
-jisaku-homepage.com: did not receive HSTS header
-jisnashville.gov: could not connect to host
-jitlab.org: could not connect to host
-jitsi.org: did not receive HSTS header
-jiu99shipin.com: could not connect to host
-jiveiaktivno.bg: did not receive HSTS header
-jiyue.com: could not connect to host
-jiyue.moe: could not connect to host
-jiyusu.com: did not receive HSTS header
-jiyuu-ni.com: could not connect to host
-jiyuu-ni.net: could not connect to host
-jj5197.co: could not connect to host
-jj6729.co: could not connect to host
-jj6729.com: did not receive HSTS header
-jj6957.co: could not connect to host
-jj9297.co: could not connect to host
-jj9397.com: could not connect to host
-jj9721.com: could not connect to host
-jj9728.co: could not connect to host
-jjf.org.au: did not receive HSTS header
-jjj917.com: did not receive HSTS header
-jjjconnection.com: could not connect to host
-jjjj003.com: did not receive HSTS header
-jjlvk.nl: did not receive HSTS header
-jjmarketing.co.uk: did not receive HSTS header
-jjspartytime.co.uk: could not connect to host
-jjsummerboatparty.co.uk: could not connect to host
-jka.io: did not receive HSTS header
-jkb.pics: could not connect to host
-jkbuster.com: could not connect to host
-jkest.cc: could not connect to host
-jkng.eu: could not connect to host
-jko.works: could not connect to host
-jkuvw.xyz: did not receive HSTS header
-jkv-media.cloud: did not receive HSTS header
-jkyuan.tk: could not connect to host
-jl-dns.eu: could not connect to host
-jl-dns.nl: could not connect to host
-jl-dx.com.cn: did not receive HSTS header
-jl-exchange.nl: could not connect to host
-jl-mail.nl: could not connect to host
-jlhmedia.com: did not receive HSTS header
-jlot.org: did not receive HSTS header
-jlpn.eu: could not connect to host
-jlpn.nl: could not connect to host
-jm06.com: did not receive HSTS header
-jm22.com: could not connect to host
-jmalarcon.es: did not receive HSTS header
-jmatt.org: did not receive HSTS header
-jmb.lc: could not connect to host
-jmdekker.it: could not connect to host
-jmoreau.ddns.net: could not connect to host
-jmotion.co.uk: did not receive HSTS header
-jmpmotorsport.co.uk: did not receive HSTS header
-jmsjms.me: could not connect to host
-jmvbmx.ch: could not connect to host
-jmvdigital.com: did not receive HSTS header
-jmwap.com: could not connect to host
-jmx520.com: max-age too low: 0
-jn1.me: did not receive HSTS header
-jncde.de: could not connect to host
-jncie.de: did not receive HSTS header
-jncip.de: could not connect to host
-joacimeldre.com: could not connect to host
-joakimalgroy.com: could not connect to host
-joanjensen.net: could not connect to host
-joaquimgoliveira.pt: did not receive HSTS header
-job-offer.de: could not connect to host
-jobbuddy.se: did not receive HSTS header
-jobers.ch: did not receive HSTS header
-jobers.pt: did not receive HSTS header
-jobflyapp.com: could not connect to host
-jobmedic.com: did not receive HSTS header
-jobmob.co.il: did not receive HSTS header
-jobs-in-tech.com: could not connect to host
-jobshq.com: did not receive HSTS header
-jobtestprep.it: did not receive HSTS header
-jodel.ninja: could not connect to host
-joe-pagan.com: could not connect to host
-joearodriguez.com: could not connect to host
-joecod.es: could not connect to host
-joefixit.co.uk: could not connect to host
-joejohnson.name: did not receive HSTS header
-joelcoustrain.com: did not receive HSTS header
-joeldbolivarc.com: could not connect to host
-joelgonewild.com: did not receive HSTS header
-joemotherfuckingjohnson.com: did not receive HSTS header
-joerg-wellpott.de: did not receive HSTS header
-joeseago.com: did not receive HSTS header
-joesniderman.com: could not connect to host
-joetyson.io: could not connect to host
-joeyvilaro.com: could not connect to host
-jof.guru: did not receive HSTS header
-jogi-server.de: could not connect to host
-johand.io: could not connect to host
-johannaojanen.com: could not connect to host
-johannes-bugenhagen.de: did not receive HSTS header
-johannesburg-escorts.co.za: could not connect to host
-johanneskonrad.de: could not connect to host
-johnbrownphotography.ch: did not receive HSTS header
-johncardell.com: did not receive HSTS header
-johners.me: could not connect to host
-johngadenne.com.au: could not connect to host
-johngaltgroup.com: did not receive HSTS header
-johnmcc.net: could not connect to host
-johnmorganpartnership.co.uk: did not receive HSTS header
-johnno.be: could not connect to host
-johnnybegood.tk: could not connect to host
-johnrom.com: did not receive HSTS header
-johnrosen.top: could not connect to host
-johnrosen.xyz: could not connect to host
-johnsonho.net: could not connect to host
-johntomasowa.com: could not connect to host
-johnverkerk.com: could not connect to host
-joinamericacorps.gov: could not connect to host
-joinhahobby.com.br: could not connect to host
-jointoweb.com: could not connect to host
-jojosplaycentreandcafeteria.co.uk: could not connect to host
-joker.menu: could not connect to host
-jokerice.co.uk: could not connect to host
-joliet.gov: could not connect to host
-jollygoodspudz.ca: could not connect to host
-jomibe.de: did not receive HSTS header
-jomofojo.co: did not receive HSTS header
-jomofojo.com: did not receive HSTS header
-jomp16.tk: could not connect to host
-jonandnoraswedding.com: did not receive HSTS header
-jonarcher.info: did not receive HSTS header
-jonas-keidel.de: could not connect to host
-jonas-wenk.de: did not receive HSTS header
-jonasberger.com: did not receive HSTS header
-jonasgroth.se: did not receive HSTS header
-jonathan-apps.com: could not connect to host
-jonathan.ir: could not connect to host
-jonathandowning.uk: did not receive HSTS header
-jonathanj.nl: did not receive HSTS header
-jonathanmassacand.ch: could not connect to host
-jonathansanchez.pro: could not connect to host
-jonathanschle.de: could not connect to host
-jonathanselea.se: did not receive HSTS header
-jonesopolis.xyz: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-jonferwerda.net: could not connect to host
-jonfor.net: could not connect to host
-jongha.me: could not connect to host
-jonglvab.be: did not receive HSTS header
-jonn.me: could not connect to host
-jonnichols.info: could not connect to host
-jons.org: could not connect to host
-jonsno.ws: could not connect to host
-joomlant.org: could not connect to host
-joonatoona.me: did not receive HSTS header
-joorshin.ir: could not connect to host
-joostbovee.nl: could not connect to host
-jooto.com: did not receive HSTS header
-jopsens.de: could not connect to host
-jordan-jungk.de: could not connect to host
-jordankirby.co.uk: could not connect to host
-jordanp.engineer: could not connect to host
-jordanstrustcompany.cn: could not connect to host
-jordanstrustcompany.ru: could not connect to host
-jordhy.com: could not connect to host
-jordiescudero.com: did not receive HSTS header
-jordikroon.nl: could not connect to host
-joretapo.fr: could not connect to host
-jorexenterprise.com: could not connect to host
-jorgemesa.me: could not connect to host
-jorgerosales.org: could not connect to host
-jornadasciberdefensa2016.es: could not connect to host
-jorovik.com: did not receive HSTS header
-jorrit.info: max-age too low: 0
-josahrens.me: could not connect to host
-jose.eti.br: did not receive HSTS header
-joseaveleira.es: did not receive HSTS header
-josecage.com: could not connect to host
-josegerber.ch: did not receive HSTS header
-josephsniderman.net: could not connect to host
-josericaurte.com: could not connect to host
-joshharkema.com: could not connect to host
-joshhoffer.com: could not connect to host
-joshi.su: could not connect to host
-joshplant.co.uk: could not connect to host
-joshstroup.me: could not connect to host
-joshuajohnson.ca: did not receive HSTS header
-joto.de: did not receive HSTS header
-jotpics.com: could not connect to host
-jottit.com: could not connect to host
-jouetspetitechanson.com: could not connect to host
-jouwpaardenbak.nl: could not connect to host
-joworld.net: could not connect to host
-joyceclerkx.com: could not connect to host
-joyceseamone.com: could not connect to host
-joyjohnston.ca: did not receive HSTS header
-joynadvisors.com: did not receive HSTS header
-jpaglier.com: could not connect to host
-jpcrochetapparel.com: could not connect to host
-jpeaches.xyz: could not connect to host
-jpm-inc.jp: did not receive HSTS header
-jpoirierlavoie.ca: could not connect to host
-jpprivatehiretaxis.co.uk: did not receive HSTS header
-jptun.com: could not connect to host
-jr5devdoug.xyz: could not connect to host
-jr5devdouglas.xyz: could not connect to host
-jr5proxdoug.xyz: could not connect to host
-jrchaseify.xyz: could not connect to host
-jreinert.com: could not connect to host
-jrflorian.com: could not connect to host
-jrgold.me: could not connect to host
-jrlopezoficial.com: could not connect to host
-jrmd.io: could not connect to host
-jrvar.com: did not receive HSTS header
-js3311.com: could not connect to host
-js88.sg: could not connect to host
-js93029.com: could not connect to host
-jsanders.us: did not receive HSTS header
-jsbevents.nl: could not connect to host
-jsblights.nl: could not connect to host
-jsc7776.com: could not connect to host
-jsdelivr.net: could not connect to host
-jsg-technologies.de: did not receive HSTS header
-jsh173.com: did not receive HSTS header
-jsh318.com: did not receive HSTS header
-jsh517.com: did not receive HSTS header
-jsh799.com: did not receive HSTS header
-jsh916.com: did not receive HSTS header
-jsh917.com: did not receive HSTS header
-jsh918.com: did not receive HSTS header
-jsh920.com: did not receive HSTS header
-jsjyhzy.cc: did not receive HSTS header
-jskier.com: could not connect to host
-jslidong.top: could not connect to host
-json-viewer.com: did not receive HSTS header
-json.download: could not connect to host
-jsonsinc.com: could not connect to host
-jsproxy.tk: did not receive HSTS header
-jss.moe: did not receive HSTS header
-jstelecom.com.br: did not receive HSTS header
-jsuse.xyz: could not connect to host
-jthackery.com: did not receive HSTS header
-jtl-connect.de: did not receive HSTS header
-ju1ro.de: could not connect to host
-juabcounty.gov: did not receive HSTS header
-jualautoclave.com: did not receive HSTS header
-jualssh.com: could not connect to host
-juandesouza.com: did not receive HSTS header
-juanhub.com: did not receive HSTS header
-juanmaguitar.com: could not connect to host
-jubee.nl: did not receive HSTS header
-jubilerkarat.pl: did not receive HSTS header
-jubileumfotograaf.nl: could not connect to host
-juch.cc: did not receive HSTS header
-juchheim-methode.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-juchit.at: could not connect to host
-judc-ge.ch: could not connect to host
-judge2020.me: did not receive HSTS header
-juelda.com: could not connect to host
-juergen-roehrig.de: did not receive HSTS header
-juergmeier.ch: did not receive HSTS header
-juezz.top: did not receive HSTS header
-juiced.gs: did not receive HSTS header
-juka.pp.ua: could not connect to host
-juku-info.top: did not receive HSTS header
-julegoerke.de: did not receive HSTS header
-juliamweber.de: did not receive HSTS header
-julian-kipka.de: did not receive HSTS header
-julian-witusch.de: could not connect to host
-juliankirchner.ch: did not receive HSTS header
-julianwallmeroth.de: could not connect to host
-juliaoantiguidades.com.br: could not connect to host
-juliawebber.co.za: could not connect to host
-julido.de: did not receive HSTS header
-julio.jamil.nom.br: could not connect to host
-juliohernandezgt.com: could not connect to host
-juls.cloud: could not connect to host
-jumba.com.au: could not connect to host
-jumbopan.com: could not connect to host
-jumbopan.net: could not connect to host
-jumbox.xyz: could not connect to host
-jumbster.com: could not connect to host
-jump.bg: did not receive HSTS header
-jumparoundreading.co.uk: could not connect to host
-jumperoos.co.uk: could not connect to host
-jumping-duck.com: did not receive HSTS header
-jumpman-iphone-design.de: could not connect to host
-junaos.com: did not receive HSTS header
-junaos.xyz: did not receive HSTS header
-junctioncitywisconsin.gov: did not receive HSTS header
-jundimax.com.br: could not connect to host
-junespina.com: did not receive HSTS header
-jungaa.fr: did not receive HSTS header
-junge-selbsthilfe.info: could not connect to host
-jungleculture.co.za: could not connect to host
-junglegoat.xyz: could not connect to host
-juniwalk.cz: did not receive HSTS header
-junjhome.com: could not connect to host
-junjung.me: could not connect to host
-junoaroma.com: could not connect to host
-junqtion.com: could not connect to host
-jupp0r.de: could not connect to host
-juraciimoveis.com.br: could not connect to host
-juridiqueo.com: did not receive HSTS header
-jurijbuga.de: did not receive HSTS header
-juristeo.com: did not receive HSTS header
-jurko.cz: did not receive HSTS header
-jurriaan.ninja: could not connect to host
-just-a-clanpage.de: could not connect to host
-just-english.online: did not receive HSTS header
-just-pools.co.za: could not connect to host
-justanothercompany.name: could not connect to host
-justbelieverecovery.com: did not receive HSTS header
-justbookhotels.com: did not receive HSTS header
-justiceforfathers.com: did not receive HSTS header
-justiceo.org: did not receive HSTS header
-justin-tech.com: could not connect to host
-justinellingwood.com: could not connect to host
-justinlemay.com: could not connect to host
-justinribeiro.com: did not receive HSTS header
-justinrudio.com: did not receive HSTS header
-justlikethat.hosting: did not receive HSTS header
-justmade.com.br: did not receive HSTS header
-justmensgloves.com: could not connect to host
-justmy.website: could not connect to host
-justnaw.co.uk: could not connect to host
-justtalk.site: could not connect to host
-justudin.com: did not receive HSTS header
-justwood.cz: did not receive HSTS header
-justzz.xyz: could not connect to host
-juul.xyz: did not receive HSTS header
-juvenex.co: could not connect to host
-juventusclublugano.ch: could not connect to host
-juventusmania1897.com: could not connect to host
-juwairen.cn: could not connect to host
-juzgalo.com: did not receive HSTS header
-jva-wuerzburg.de: could not connect to host
-jvn.com: did not receive HSTS header
-jvoice.net: could not connect to host
-jvwdev.nl: could not connect to host
-jwallet.cc: did not receive HSTS header
-jwilsson.me: could not connect to host
-jwolt-lx.com: could not connect to host
-jwplay.ml: could not connect to host
-jwpoore.com: could not connect to host
-jwsoft.nl: did not receive HSTS header
-jwybk.ml: could not connect to host
-jxi.fr: did not receive HSTS header
-jxkangyifu.com: could not connect to host
-jydwz.com: max-age too low: 0
-jyggen.com: did not receive HSTS header
-jym.fit: could not connect to host
-jysk-kornteknik.dk: did not receive HSTS header
-jysperm.me: did not receive HSTS header
-jz585.com: could not connect to host
-jzbk.org: could not connect to host
-jznet.org: could not connect to host
-k-dev.de: could not connect to host
-k-netz.de: did not receive HSTS header
-k-pan.com: could not connect to host
-k-rickroll-g.pw: could not connect to host
-k-wallet.com: could not connect to host
-k0.gg: could not connect to host
-k1cp.com: could not connect to host
-k1yoshi.com: could not connect to host
-k30365.com: could not connect to host
-k33k00.com: did not receive HSTS header
-k3508.com: could not connect to host
-k38.cc: could not connect to host
-k5197.co: could not connect to host
-k6729.co: could not connect to host
-k6729.com: did not receive HSTS header
-k6957.co: could not connect to host
-k6957.com: did not receive HSTS header
-k8007.com: did not receive HSTS header
-k8050.com: did not receive HSTS header
-k80608.com: did not receive HSTS header
-k80725.com: did not receive HSTS header
-k81.app: did not receive HSTS header
-k814.com: did not receive HSTS header
-k816.com: could not connect to host
-k819.co: did not receive HSTS header
-k819.com: did not receive HSTS header
-k82.org: could not connect to host
-k8268.com: could not connect to host
-k829.co: did not receive HSTS header
-k829.com: did not receive HSTS header
-k829.net: did not receive HSTS header
-k83.app: did not receive HSTS header
-k830.co: did not receive HSTS header
-k831.co: did not receive HSTS header
-k8330.com: did not receive HSTS header
-k835.co: did not receive HSTS header
-k835.com: did not receive HSTS header
-k843.co: did not receive HSTS header
-k843.com: did not receive HSTS header
-k8550.com: did not receive HSTS header
-k85555.com: did not receive HSTS header
-k86690.com: did not receive HSTS header
-k87777.com: did not receive HSTS header
-k87777.net: did not receive HSTS header
-k8860.com: did not receive HSTS header
-k8901119.com: did not receive HSTS header
-k894.com: did not receive HSTS header
-k895.com: did not receive HSTS header
-k89595.com: did not receive HSTS header
-k89999.com: did not receive HSTS header
-k89999.net: could not connect to host
-k8dalao.com: could not connect to host
-k8didi.com: could not connect to host
-k8jiejie.com: could not connect to host
-k8laosiji.com: could not connect to host
-k8meimei.com: could not connect to host
-k8meinv.com: could not connect to host
-k9297.co: could not connect to host
-k9728.co: could not connect to host
-ka-clan.com: could not connect to host
-kaanduman.com: could not connect to host
-kaangenc.me: did not receive HSTS header
-kaany.io: could not connect to host
-kaas.wtf: could not connect to host
-kaasbijwijn.nl: did not receive HSTS header
-kaashosting.nl: did not receive HSTS header
-kabaca.design: did not receive HSTS header
-kabinapp.com: could not connect to host
-kaboom.pw: did not receive HSTS header
-kabos.art: could not connect to host
-kabouterbankje.nl: did not receive HSTS header
-kabu-abc.com: could not connect to host
-kabuabc.com: could not connect to host
-kackscharf.de: did not receive HSTS header
-kadioglumakina.com.tr: did not receive HSTS header
-kadmec.com: did not receive HSTS header
-kaela.design: could not connect to host
-kaeru-seitai.com: did not receive HSTS header
-kaginalycloud.com: could not connect to host
-kahopoon.net: could not connect to host
-kai.cool: did not receive HSTS header
-kaibol.com: could not connect to host
-kaika-facilitymanagement.de: could not connect to host
-kaika-hms.de: did not receive HSTS header
-kainetsoft.com: could not connect to host
-kainz.bayern: could not connect to host
-kainz.be: could not connect to host
-kaisers.de: could not connect to host
-kaiyuewu.com: could not connect to host
-kaizenjuku.org: did not receive HSTS header
-kajabutik.pl: did not receive HSTS header
-kajlovo.cz: could not connect to host
-kakaomilchkuh.de: did not receive HSTS header
-kaketalk.com: did not receive HSTS header
-kakoo-media.nl: could not connect to host
-kakoo.nl: could not connect to host
-kakoomedia.nl: could not connect to host
-kakuto.me: could not connect to host
-kalakarclub.com: could not connect to host
-kalami.nl: could not connect to host
-kaleidoskop-freiburg.de: did not receive HSTS header
-kalender.goip.de: could not connect to host
-kaliaa.fi: could not connect to host
-kalifornien-tourismus.de: did not receive HSTS header
-kalilinux.tech: could not connect to host
-kaloix.de: could not connect to host
-kalolina.com: could not connect to host
-kaloni.info: could not connect to host
-kalsbouncies.com: could not connect to host
-kamalame.co: could not connect to host
-kamatajisyaku.tokyo.jp: could not connect to host
-kambodja.guide: could not connect to host
-kamcvicit.sk: could not connect to host
-kamikano.com: could not connect to host
-kamitech.ch: could not connect to host
-kampunginggris-ue.com: could not connect to host
-kana.me: could not connect to host
-kanada.guide: could not connect to host
-kanagawachuo-hospital.jp: could not connect to host
-kanal-schaefer.de: could not connect to host
-kanar.nl: could not connect to host
-kancolle.me: could not connect to host
-kandec.co.jp: did not receive HSTS header
-kaneisdi.com: did not receive HSTS header
-kaneo-gmbh.de: did not receive HSTS header
-kanganer.com: could not connect to host
-kangkai.me: could not connect to host
-kangooroule.fr: did not receive HSTS header
-kangzaber.com: could not connect to host
-kaniklani.co.za: did not receive HSTS header
-kanmitao.com: could not connect to host
-kanobu.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-kanotijd.nl: could not connect to host
-kanr.in: could not connect to host
-kanscooking.org: could not connect to host
-kantorad.io: could not connect to host
-kantorkita.net: did not receive HSTS header
-kantv1.com: could not connect to host
-kanzakiranko.jp: could not connect to host
-kanzlei-myca.de: did not receive HSTS header
-kanzshop.com: could not connect to host
-kaohub.com: could not connect to host
-kaomojis.net: could not connect to host
-kaotik4266.com: could not connect to host
-kapgy-moto.com: did not receive HSTS header
-kapiorr.duckdns.org: could not connect to host
-kaplatz.is: could not connect to host
-kaplatzis.com: could not connect to host
-kapo.info: did not receive HSTS header
-kappit.dk: could not connect to host
-kapverde.guide: could not connect to host
-kara-fabian.com: could not connect to host
-kara-fabian.de: could not connect to host
-karaface.com: did not receive HSTS header
-karakatoo.com: did not receive HSTS header
-karamna.com: could not connect to host
-karanastic.com: did not receive HSTS header
-karaoketonight.com: could not connect to host
-karatorian.org: did not receive HSTS header
-kardize24.pl: could not connect to host
-kardolocksmith.com: did not receive HSTS header
-karenledger.ca: did not receive HSTS header
-karenwillisholmes.com: did not receive HSTS header
-karhm.com: did not receive HSTS header
-karjala-ski.ru: did not receive HSTS header
-karlin.run: could not connect to host
-karlis-kavacis.id.lv: did not receive HSTS header
-karloskontana.tk: could not connect to host
-karlproctor.co.uk: could not connect to host
-karpanhellas.com: could not connect to host
-karsofsystems.com: could not connect to host
-kartashev.me: did not receive HSTS header
-karting34.com: did not receive HSTS header
-karuneshjohri.com: could not connect to host
-kasadara.com: could not connect to host
-kaseban.com: did not receive HSTS header
-kashadriskill.com: could not connect to host
-kashbet.com: could not connect to host
-kashdash.ca: could not connect to host
-kashmirobserver.net: did not receive HSTS header
-kastemperaturen.ga: could not connect to host
-katalogakci.cz: did not receive HSTS header
-katalogbutikker.dk: could not connect to host
-katata-kango.ac.jp: did not receive HSTS header
-kateduggan.net: could not connect to host
-kathrinbaumannphotography.com: did not receive HSTS header
-kati0.com: could not connect to host
-katiaetdavid.fr: could not connect to host
-katja-nikolic-design.de: could not connect to host
-katoju.co.jp: did not receive HSTS header
-katproxy.al: did not receive HSTS header
-katproxy.online: could not connect to host
-katproxy.site: did not receive HSTS header
-katproxy.tech: could not connect to host
-katproxy.top: could not connect to host
-katrinjanke.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-kattenfun.be: could not connect to host
-kattenfun.nl: did not receive HSTS header
-katthewaffle.fr: could not connect to host
-katzen.me: could not connect to host
-katzenbrunnen-test.de: could not connect to host
-katzensklave.me: could not connect to host
-katzrkool.xyz: could not connect to host
-katzspeech.com: did not receive HSTS header
-kaufmanbankruptcylaw.com: did not receive HSTS header
-kauperwood.ovh: could not connect to host
-kauplusprofesional.com: did not receive HSTS header
-kausch.at: could not connect to host
-kausta.me: could not connect to host
-kaverti.com: did not receive HSTS header
-kavik.no: could not connect to host
-kavinvin.me: could not connect to host
-kawaii.io: could not connect to host
-kawaiii.link: could not connect to host
-kawaiiku.com: could not connect to host
-kawaiiku.de: could not connect to host
-kaweus.de: did not receive HSTS header
-kayakabovegroundswimmingpools.com: could not connect to host
-kaydan.io: could not connect to host
-kayipmurekkep.com: could not connect to host
-kayleen.net: could not connect to host
-kayon.cf: could not connect to host
-kaypasocks.com: could not connect to host
-kazamasion.com: could not connect to host
-kazanasolutions.de: could not connect to host
-kazenojiyu.fr: could not connect to host
-kazmamall.com: did not receive HSTS header
-kazu.click: did not receive HSTS header
-kazuhirohigashi.com: did not receive HSTS header
-kazumi.ooo: could not connect to host
-kb3.net: could not connect to host
-kb709.com: could not connect to host
-kb7373.com: could not connect to host
-kb7676.com: could not connect to host
-kb802.com: could not connect to host
-kb8851.com: could not connect to host
-kb88818.com: could not connect to host
-kb88dc04.com: could not connect to host
-kb88dc05.com: could not connect to host
-kb88dc06.com: could not connect to host
-kb88dc12.com: could not connect to host
-kb88dc17.com: could not connect to host
-kb88dc28.com: could not connect to host
-kbcso.com: could not connect to host
-kbfl.org: could not connect to host
-kbit.dk: could not connect to host
-kcc.sh: did not receive HSTS header
-kchomemed.com: did not receive HSTS header
-kcluster.io: could not connect to host
-kcptun.com: could not connect to host
-kd-plus.pp.ua: could not connect to host
-kdata.it: did not receive HSTS header
-kdbx.online: could not connect to host
-kdcp.pw: could not connect to host
-kdfans.com: did not receive HSTS header
-kdm-online.de: did not receive HSTS header
-kdyby.org: did not receive HSTS header
-keaneokelley.com: could not connect to host
-kearney.io: could not connect to host
-kediri.win: could not connect to host
-keditor.biz: could not connect to host
-keechain.io: could not connect to host
-keeckee.ga: did not receive HSTS header
-keeckee.ml: could not connect to host
-keeley.gq: could not connect to host
-keeley.ml: could not connect to host
-keeleysam.me: could not connect to host
-keematdekho.com: could not connect to host
-keepaa.com: could not connect to host
-keepassa.co: could not connect to host
-keepclean.me: could not connect to host
-keepcoalintheground.org: could not connect to host
-keeperapp.com: could not connect to host
-keeperklan.com: could not connect to host
-keepflow.io: could not connect to host
-keepmanager.org: could not connect to host
-keeprubyweird.com: did not receive HSTS header
-keevitaja.com: did not receive HSTS header
-keez.cf: could not connect to host
-keezin.ga: could not connect to host
-kefaloniatoday.com: did not receive HSTS header
-keihin-chaplin.jp: did not receive HSTS header
-kein-fidget-spinner-werden.de: could not connect to host
-kejar.id: did not receive HSTS header
-kejibot.com: did not receive HSTS header
-kekehouse.net: could not connect to host
-kekgame.com: could not connect to host
-kela.jp: could not connect to host
-kelantanmudah.com: could not connect to host
-kelleymcchesney.us: could not connect to host
-kellyandantony.com: could not connect to host
-kellyssportsbarandgrill.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-kelm.me: could not connect to host
-kelmarsafety.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-kelp.agency: did not receive HSTS header
-kenbillionsyuan.tk: could not connect to host
-kendernet.com: could not connect to host
-kenkoelectric.com: did not receive HSTS header
-kennethaasan.no: could not connect to host
-kennethferguson.com: did not receive HSTS header
-kennynet.co.uk: could not connect to host
-kensparkesphotography.com: did not receive HSTS header
-kensyou.network: did not receive HSTS header
-kentacademiestrust.org.uk: could not connect to host
-kenx5.eu.org: could not connect to host
-kenyons.info: could not connect to host
-keops-spine.us: could not connect to host
-kep-sbt.hu: did not receive HSTS header
-kepler-seminar.de: did not receive HSTS header
-kepsbt.hu: did not receive HSTS header
-kerangalam.com: did not receive HSTS header
-kerem.xyz: could not connect to host
-kerenos.rocks: did not receive HSTS header
-kerforhome.com: did not receive HSTS header
-kerksanders.nl: could not connect to host
-kermadec.blog: could not connect to host
-kernelmode.io: did not receive HSTS header
-kerner.xyz: could not connect to host
-kernl.us: did not receive HSTS header
-kerrfrequencycombs.org: did not receive HSTS header
-kerryfoodscareers.com: did not receive HSTS header
-kersbergen.nl: did not receive HSTS header
-kersmexico.com: could not connect to host
-kerzyte.net: could not connect to host
-keshausconsulting.com: could not connect to host
-keskeces.com: did not receive HSTS header
-kessel-runners.com: could not connect to host
-kesteren.com: could not connect to host
-kesteren.org: could not connect to host
-ketty-voyance.com: could not connect to host
-kevinbowers.me: could not connect to host
-kevindekoninck.com: could not connect to host
-kevinfoley.cc: could not connect to host
-kevinfoley.org: could not connect to host
-kevingsky.com: could not connect to host
-kevinheslinphoto.com: did not receive HSTS header
-kevinratcliff.com: did not receive HSTS header
-kevinroebert.de: did not receive HSTS header
-kevlar.pw: did not receive HSTS header
-kewego.co.uk: did not receive HSTS header
-kexueboy.com: could not connect to host
-keyerror.com: could not connect to host
-keymach.com: did not receive HSTS header
-keypersonins.com: did not receive HSTS header
-keys.jp: could not connect to host
-keyserver.sexy: could not connect to host
-kf-59.com: could not connect to host
-kf060.com: could not connect to host
-kfassessment.com: did not receive HSTS header
-kfbrussels.be: could not connect to host
-kfm.ink: did not receive HSTS header
-kg-rating.com: could not connect to host
-kg7.pl: could not connect to host
-kgb.us: did not receive HSTS header
-kgregorczyk.pl: could not connect to host
-kgxtech.com: did not receive HSTS header
-khlee.net: did not receive HSTS header
-khmath.com: did not receive HSTS header
-khohangmadeinvietnam.com: did not receive HSTS header
-khojirdesign.ir: did not receive HSTS header
-khosla.uk: did not receive HSTS header
-ki-on.net: did not receive HSTS header
-kiaka.co: did not receive HSTS header
-kialo.com: did not receive HSTS header
-kiapartsdepartment.com: did not receive HSTS header
-kiapps.ovh: could not connect to host
-kiasystems.com: did not receive HSTS header
-kibbesfusion.com: did not receive HSTS header
-kibea.net: could not connect to host
-kichy.net: max-age too low: 0
-kickass-proxies.org: could not connect to host
-kickass.al: could not connect to host
-kickasstorrents.gq: could not connect to host
-kickerplaza.nl: did not receive HSTS header
-kidbacker.com: could not connect to host
-kiddies.academy: did not receive HSTS header
-kiddieschristianacademy.co.za: did not receive HSTS header
-kidkat.cn: could not connect to host
-kids-ok.com: did not receive HSTS header
-kids2day.in: could not connect to host
-kidsmark.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-kiedys.net: could not connect to host
-kiehls.pt: did not receive HSTS header
-kiel-kind.de: could not connect to host
-kiel-media.de: did not receive HSTS header
-kielderweather.org.uk: did not receive HSTS header
-kielwi.gov: could not connect to host
-kieran.ie: could not connect to host
-kieranjones.uk: could not connect to host
-kieranweightman.me: could not connect to host
-kiesuwcursus.nl: did not receive HSTS header
-kievkiralikotel.com: did not receive HSTS header
-kievradio.com: could not connect to host
-kiffmarks.com: could not connect to host
-kikimilyatacado.com.br: could not connect to host
-kiku.pw: could not connect to host
-kikuzuki.org: could not connect to host
-kiladera.be: did not receive HSTS header
-kileahh.fr: could not connect to host
-kill-paff.com: did not receive HSTS header
-killedbynlp.com: could not connect to host
-killerit.in: could not connect to host
-killme.rocks: could not connect to host
-kimamass.com: could not connect to host
-kimana.pe: could not connect to host
-kimberg.co.uk: did not receive HSTS header
-kimberlybeautysoapcompany.com: did not receive HSTS header
-kimkhisaigon.com.vn: did not receive HSTS header
-kimo.se: did not receive HSTS header
-kimpost.org: could not connect to host
-kimscrazeecastles.co.uk: could not connect to host
-kimsufi-jordi.tk: did not receive HSTS header
-kin.life: could not connect to host
-kin.pet: could not connect to host
-kina.guide: could not connect to host
-kinderbuecher-kostenlos.de: could not connect to host
-kindergarten-neugnadenfeld.tk: could not connect to host
-kinderjugendfreizeitverein.de: did not receive HSTS header
-kinderly.co.uk: did not receive HSTS header
-kinderopvangengeltjes.nl: did not receive HSTS header
-kinderopvangzevenbergen.nl: did not receive HSTS header
-kinderwagen-test24.de: did not receive HSTS header
-kindfotografie.nl: could not connect to host
-kindleworth.com: did not receive HSTS header
-kindlyfire.com: could not connect to host
-kindof.ninja: could not connect to host
-kinecle.com: did not receive HSTS header
-kinepolis-studio.ga: could not connect to host
-kinetic.ventures: could not connect to host
-kineto.space: could not connect to host
-king-henris-castles.co.uk: could not connect to host
-kingbird.me: could not connect to host
-kingclass.cn: could not connect to host
-kingdomcrc.org: did not receive HSTS header
-kingdominnergy.com: could not connect to host
-kingmanhall.org: could not connect to host
-kingnutrition.com.ar: did not receive HSTS header
-kingpincages.com: could not connect to host
-kingqueen.org.uk: did not receive HSTS header
-kingsley.cc: could not connect to host
-kingstclinic.com: could not connect to host
-kingtecservices.com: could not connect to host
-kinkdr.com: could not connect to host
-kinmunity.net: could not connect to host
-kinnon.enterprises: did not receive HSTS header
-kinomoto.me: could not connect to host
-kinow.com: did not receive HSTS header
-kintawifi.com: could not connect to host
-kintoandar.com: max-age too low: 0
-kintrip.com: did not receive HSTS header
-kintzingerfilm.de: did not receive HSTS header
-kiokoman.eu.org: did not receive HSTS header
-kionetworks.com: did not receive HSTS header
-kipin.fr: did not receive HSTS header
-kipira.com: could not connect to host
-kipriakipita.gr: could not connect to host
-kiraboshi.xyz: could not connect to host
-kirakirasoft.jp: did not receive HSTS header
-kirara.eu: could not connect to host
-kirkforsenate.com: could not connect to host
-kirkify.com: could not connect to host
-kirkovsky.com: could not connect to host
-kirkpatrickdavis.com: could not connect to host
-kirslis.com: did not receive HSTS header
-kis-toitoidixi.de: could not connect to host
-kisa.io: could not connect to host
-kismy.tk: could not connect to host
-kiss-register.org: could not connect to host
-kissart.net: could not connect to host
-kissesb.net: could not connect to host
-kisstube.tv: could not connect to host
-kisstyle.ru: did not receive HSTS header
-kitabgaul.com: did not receive HSTS header
-kitakemon.com: could not connect to host
-kitashop.com.br: could not connect to host
-kitatec.com.br: could not connect to host
-kitchenaccessories.pro: could not connect to host
-kitchenalley.ca: could not connect to host
-kitchenchaos.de: could not connect to host
-kitegarage.eu: did not receive HSTS header
-kiteschoolamsterdam.nl: could not connect to host
-kitestar.co.uk: could not connect to host
-kitk.at: did not receive HSTS header
-kitsostech.com: could not connect to host
-kitsta.com: could not connect to host
-kittyhacker101.tk: could not connect to host
-kiwi-bird.xyz: did not receive HSTS header
-kiwi.com: did not receive HSTS header
-kiwi.global: could not connect to host
-kiwico.com: max-age too low: 0
-kiwihub.org: did not receive HSTS header
-kiwiirc.com: max-age too low: 5256000
-kiwipayment.com: could not connect to host
-kiwipayments.com: could not connect to host
-kiwiplace.com: could not connect to host
-kix.moe: could not connect to host
-kiyo.space: could not connect to host
-kizil.net: could not connect to host
-kizzycode.de: did not receive HSTS header
-kj1391.com: could not connect to host
-kjaermaxi.me: did not receive HSTS header
-kjarni.cc: could not connect to host
-kjg-bachrain.de: could not connect to host
-kjg-ummeln.de: did not receive HSTS header
-kjgmuenster.org: could not connect to host
-kjkmail.de: could not connect to host
-kjoglum.me: could not connect to host
-kk5197.co: could not connect to host
-kk575757.com: did not receive HSTS header
-kk6729.co: could not connect to host
-kk6729.com: did not receive HSTS header
-kk6957.co: could not connect to host
-kk9297.co: could not connect to host
-kk9397.com: could not connect to host
-kk9721.com: could not connect to host
-kk9728.co: could not connect to host
-kkaefer.com: did not receive HSTS header
-kkomputer.net: could not connect to host
-kkull.tv: could not connect to host
-kkutu.xyz: could not connect to host
-kkws.co: could not connect to host
-kl008888.com: could not connect to host
-klamathrestoration.gov: could not connect to host
-klantenadvies.nl: did not receive HSTS header
-klares-licht.de: could not connect to host
-klasfauseweh.de: could not connect to host
-klatschreime.de: could not connect to host
-klausimas.lt: did not receive HSTS header
-klautshop.com: could not connect to host
-klauwd.com: could not connect to host
-klaxn.org: could not connect to host
-klean-ritekc.com: did not receive HSTS header
-kleberstoff.xyz: could not connect to host
-kleding.website: could not connect to host
-kledingrekken.nl: did not receive HSTS header
-kleertjesvoordelig.nl: could not connect to host
-kleidertauschpartys.de: could not connect to host
-kleinerarchitekturfuehrer.de: did not receive HSTS header
-kleinfein.co: could not connect to host
-kleinhelena.dynv6.net: could not connect to host
-kleinholding.com: did not receive HSTS header
-kleinserienproduktion.com: could not connect to host
-klempin.me: could not connect to host
-klempnershop.eu: did not receive HSTS header
-kletterkater.com: could not connect to host
-klicke-gemeinsames.de: did not receive HSTS header
-klicktojob.de: could not connect to host
-klif1.nl: did not receive HSTS header
-klikweb.id: could not connect to host
-klimapartner.net: could not connect to host
-klimchuk.by: did not receive HSTS header
-klimchuk.com: did not receive HSTS header
-klingeletest.de: could not connect to host
-klingsundet.no: did not receive HSTS header
-klinkerstreet.com.ua: could not connect to host
-kls-agency.com.ua: did not receive HSTS header
-klseet.com: did not receive HSTS header
-klubxanadu.cz: could not connect to host
-klunkergarten.org: could not connect to host
-klupper.com: could not connect to host
-klustekeningen.nl: could not connect to host
-klzwzhi.com: could not connect to host
-km-net.pl: did not receive HSTS header
-kmdev.me: could not connect to host
-kmnsk.eu: did not receive HSTS header
-kmsci.com.ph: did not receive HSTS header
-knaake.net: could not connect to host
-knallfrosch.ddnss.de: could not connect to host
-knapp.servehttp.com: could not connect to host
-knca.ir: did not receive HSTS header
-knccloud.com: did not receive HSTS header
-kneipi.de: did not receive HSTS header
-kngk-transavto.ru: could not connect to host
-kniga-goda.org: did not receive HSTS header
-kniga.market: could not connect to host
-knigadel.com: did not receive HSTS header
-knightsblog.de: could not connect to host
-knightsbridgegroup.org: could not connect to host
-knightsweep.com: could not connect to host
-kniwweler.com: could not connect to host
-knockendarroch.co.uk: did not receive HSTS header
-knot-store.com: did not receive HSTS header
-knowdebt.org: did not receive HSTS header
-knowledgeforce.com: could not connect to host
-knowledgesnap.com: could not connect to host
-knowledgesnapsites.com: could not connect to host
-knowlevillagecc.co.uk: could not connect to host
-knownsec.cf: could not connect to host
-knowpanamatours.com: could not connect to host
-knoxcountytn.gov: could not connect to host
-knuckles.tk: could not connect to host
-knutur.is: could not connect to host
-ko.si: did not receive HSTS header
-koalapress.fr: did not receive HSTS header
-kobar.id: could not connect to host
-kobezda.net: could not connect to host
-kobieta.guru: could not connect to host
-koboldcraft.ch: could not connect to host
-koboldmalade.fr: could not connect to host
-koddsson.com: did not receive HSTS header
-kodexplorer.ml: could not connect to host
-kodiaklabs.org: could not connect to host
-kodikom.de: could not connect to host
-kodokushi.fr: could not connect to host
-koelbli.ch: could not connect to host
-koenberkhout.nl: did not receive HSTS header
-koenen-bau.de: did not receive HSTS header
-koenvdheuvel.me: could not connect to host
-koerper-wie-seele.de: did not receive HSTS header
-koerperimpuls.ch: did not receive HSTS header
-koez-mangal.ch: could not connect to host
-koezmangal.ch: could not connect to host
-kogcoder.com: could not connect to host
-koha.be: did not receive HSTS header
-kohlistkool.tk: could not connect to host
-kohparadise.com: could not connect to host
-koi-sama.net: did not receive HSTS header
-koik.io: could not connect to host
-koirala.email: could not connect to host
-koirala.net: did not receive HSTS header
-kokenmetaanbiedingen.nl: could not connect to host
-kokensupport.com: could not connect to host
-kokoiroworks.com: could not connect to host
-kokoushuvila.fi: did not receive HSTS header
-kola-entertainments.de: did not receive HSTS header
-koladeogunleye.com: could not connect to host
-kolania.com: could not connect to host
-kolaykaydet.com: could not connect to host
-kolbeck.tk: could not connect to host
-koljakrekow.de: did not receive HSTS header
-kollawat.me: could not connect to host
-kolonie-am-stadtpark.de: could not connect to host
-kolorbon.com: did not receive HSTS header
-komandakovalchuk.com: did not receive HSTS header
-kombidorango.com.br: could not connect to host
-komikito.com: could not connect to host
-komodolabs.com: did not receive HSTS header
-kompetenzwerft.de: did not receive HSTS header
-kompjoeter.net: could not connect to host
-konata.us: could not connect to host
-kongbaofang.com: did not receive HSTS header
-kongsecuritydata.com: did not receive HSTS header
-konicaprinterdriver.com: could not connect to host
-koninkrijk.net: could not connect to host
-konkai.store: could not connect to host
-konkurs.ba: could not connect to host
-konoe.studio: did not receive HSTS header
-konsertoversikt.no: could not connect to host
-kontakthuman.hu: did not receive HSTS header
-kontaxis.network: could not connect to host
-kontrolapovinnosti.cz: could not connect to host
-konventseliten.se: could not connect to host
-koopjesnel.nl: could not connect to host
-koordinate.net: could not connect to host
-kopio.jp: did not receive HSTS header
-kopular.com: could not connect to host
-korem011-tniad.mil.id: did not receive HSTS header
-kori.ml: did not receive HSTS header
-koriyoukai.net: did not receive HSTS header
-kornersafe.com: could not connect to host
-korni22.org: did not receive HSTS header
-korobi.io: did not receive HSTS header
-korono.de: did not receive HSTS header
-korsanparti.org: did not receive HSTS header
-kortic.com: did not receive HSTS header
-kosaki.moe: could not connect to host
-kosonaudioteca.com: did not receive HSTS header
-kostuumstore.nl: could not connect to host
-kostya.net: did not receive HSTS header
-kotakoo.id: could not connect to host
-kotausaha.com: could not connect to host
-kotelezobiztositas.eu: did not receive HSTS header
-kotonehoko.net: could not connect to host
-kotonozaka.xyz: could not connect to host
-kotorimusic.ga: could not connect to host
-kotovstyle.ru: could not connect to host
-kottur.is: could not connect to host
-koukni.cz: did not receive HSTS header
-kouponboket.com: did not receive HSTS header
-kourpe.online: could not connect to host
-kousaku.jp: could not connect to host
-kovaldo.ru: did not receive HSTS header
-kovnsk.net: could not connect to host
-kovuthehusky.com: did not receive HSTS header
-kowabit.de: max-age too low: 2592000
-kowshiksundararajan.com: could not connect to host
-koyaanis.com: did not receive HSTS header
-kozmik.co: could not connect to host
-kozossegireklamozas.hu: could not connect to host
-kpaycoin.com: did not receive HSTS header
-kpdyer.com: did not receive HSTS header
-kpebetka.net: did not receive HSTS header
-kpmgccc.co.nz: did not receive HSTS header
-kpmgpublications.ie: did not receive HSTS header
-kpn-dnssec.com: could not connect to host
-kpntdolive.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-kprog.net: could not connect to host
-kpvpn.com: could not connect to host
-kpx1.de: could not connect to host
-kraigwalker.com: could not connect to host
-kraiwan.com: did not receive HSTS header
-kraiwon.com: did not receive HSTS header
-krampus-fischamend.at: did not receive HSTS header
-krant.nl: did not receive HSTS header
-krasavchik.by: could not connect to host
-krasota.ru: did not receive HSTS header
-krausen.ca: could not connect to host
-krausoft.hu: did not receive HSTS header
-kravelindo-adventure.com: could not connect to host
-krazyboi.com: did not receive HSTS header
-krc.link: could not connect to host
-kream.io: did not receive HSTS header
-kreavis.com: did not receive HSTS header
-kreb.io: could not connect to host
-kredietpaspoort.nl: did not receive HSTS header
-kredigram.com: could not connect to host
-kredite.sale: could not connect to host
-kredite24.de: did not receive HSTS header
-kreditkarte-fuer-backpacker.de: could not connect to host
-kreditzone.ml: could not connect to host
-krestanskydarek.cz: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-krey.is: could not connect to host
-kreza.de: could not connect to host
-krfuli.com: could not connect to host
-kriegskindernothilfe.de: could not connect to host
-kriegt.es: did not receive HSTS header
-krishouse.fr: could not connect to host
-krislamoureux.com: could not connect to host
-krist.club: did not receive HSTS header
-kristenpaigejohnson.com: could not connect to host
-kristofferkoch.com: could not connect to host
-krizek.cc: could not connect to host
-krizevackapajdasija.hr: could not connect to host
-krmela.com: did not receive HSTS header
-kroetenfuchs.de: could not connect to host
-krokodent.de: did not receive HSTS header
-krommo.pe: did not receive HSTS header
-kronaw.it: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-krony.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-kronych.cz: could not connect to host
-kroodle.nl: did not receive HSTS header
-kroyclothing.co.uk: did not receive HSTS header
-kruegerrand-wert.de: did not receive HSTS header
-krugermillions.org: did not receive HSTS header
-krukhmer.com: did not receive HSTS header
-krunut.com: did not receive HSTS header
-krusesec.com: could not connect to host
-kruu.de: could not connect to host
-kruzhki-s-kartinkami.ru: did not receive HSTS header
-krypteia.org: could not connect to host
-kryptomodkingz.com: could not connect to host
-krytykawszystkiego.com: could not connect to host
-krytykawszystkiego.pl: could not connect to host
-ks-89.com: could not connect to host
-ks015.com: could not connect to host
-ks318.com: could not connect to host
-ks8.com: could not connect to host
-ksfh-mail.de: could not connect to host
-ksk-agentur.de: did not receive HSTS header
-kspg.tv: could not connect to host
-kstan.me: could not connect to host
-kswcosmetics.com: could not connect to host
-kswriter.com: could not connect to host
-kteen.info: could not connect to host
-ktsofas.gr: could not connect to host
-ktube.yt: could not connect to host
-kuaitiyu.org: could not connect to host
-kuanta.net: did not receive HSTS header
-kuba.guide: could not connect to host
-kubica.ch: could not connect to host
-kubierecki.pl: could not connect to host
-kubiwa.net: did not receive HSTS header
-kubusadvocaten.nl: could not connect to host
-kuchenfeelisa.de: did not receive HSTS header
-kuchenschock.de: did not receive HSTS header
-kucheryavenkovn.ru: could not connect to host
-kucloud.win: could not connect to host
-kucom.it: could not connect to host
-kucukayvaz.com: could not connect to host
-kueche-co.de: max-age too low: 4681541
-kuechenplan.online: could not connect to host
-kueulangtahunanak.net: could not connect to host
-kugelblitz.co: could not connect to host
-kuko-crews.org: could not connect to host
-kulickovy-pojezd.cz: did not receive HSTS header
-kulopo.com: could not connect to host
-kultmobil.se: did not receive HSTS header
-kum.com: did not receive HSTS header
-kumilasvegas.com: could not connect to host
-kummerlaender.eu: did not receive HSTS header
-kundo.se: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-kunstfehler.at: did not receive HSTS header
-kunstschule-krabax.de: did not receive HSTS header
-kunvn.com: did not receive HSTS header
-kuops.com: did not receive HSTS header
-kupdokuchyne.cz: could not connect to host
-kupelne-ptacek.sk: could not connect to host
-kupibilet.ru: did not receive HSTS header
-kupiec.eu.org: did not receive HSTS header
-kuppingercole.com: did not receive HSTS header
-kura.io: could not connect to host
-kurashino-mall.com: could not connect to host
-kurd-online.tk: could not connect to host
-kurehun.org: could not connect to host
-kurgancity.tk: could not connect to host
-kuro.link: could not connect to host
-kuro346.moe: could not connect to host
-kurrende.nrw: could not connect to host
-kurrietv.nl: did not receive HSTS header
-kursprogramisty.pl: did not receive HSTS header
-kurszielnull.de: could not connect to host
-kurtmclester.com: could not connect to host
-kurumi.io: could not connect to host
-kurz.pw: could not connect to host
-kurzonline.com.br: could not connect to host
-kushtikidsparties.co.uk: could not connect to host
-kuunlamaailm.ee: did not receive HSTS header
-kuwago.io: could not connect to host
-kuzbass-pwl.ru: could not connect to host
-kuzdrowiu24.pl: could not connect to host
-kvestmaster.ru: did not receive HSTS header
-kvn.tf: did not receive HSTS header
-kvt.berlin: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-kwidz.fr: did not receive HSTS header
-kwikmed.eu: could not connect to host
-kwiknews.com: could not connect to host
-kwipi.com: did not receive HSTS header
-kwmr.me: did not receive HSTS header
-kwok.cc: did not receive HSTS header
-kwok.tv: could not connect to host
-kwondratsch.com: could not connect to host
-kxind.cn: could not connect to host
-kxline.com: could not connect to host
-kxway.com: did not receive HSTS header
-kyberna.xyz: could not connect to host
-kybqp.com: could not connect to host
-kybqp.net: could not connect to host
-kykoonn.net: did not receive HSTS header
-kylapps.com: did not receive HSTS header
-kyle.place: could not connect to host
-kylelaker.com: did not receive HSTS header
-kylerwood.com: could not connect to host
-kylescastles.co.uk: could not connect to host
-kylianvermeulen.nl: could not connect to host
-kyliehunt.com: did not receive HSTS header
-kylling.io: could not connect to host
-kymo.org: did not receive HSTS header
-kyobostory-events.com: could not connect to host
-kyonagashima.com: did not receive HSTS header
-kyoto-sake.net: could not connect to host
-kyoto-tomikawa.jp: did not receive HSTS header
-kyouko.nl: could not connect to host
-kysseo.fr: did not receive HSTS header
-kyujin-office.net: could not connect to host
-kzjnet.com: could not connect to host
-l-1.xyz: could not connect to host
-l-2.xyz: could not connect to host
-l-3.xyz: could not connect to host
-l-rickroll-i.pw: could not connect to host
-l.me.uk: did not receive HSTS header
-l18.io: could not connect to host
-l3.ee: could not connect to host
-l30365.com: could not connect to host
-l3j.net: could not connect to host
-l456852.com: max-age too low: 0
-l5197.co: could not connect to host
-l6729.co: could not connect to host
-l6729.com: did not receive HSTS header
-l6957.co: could not connect to host
-l6957.com: did not receive HSTS header
-l9.fr: could not connect to host
-l9297.co: could not connect to host
-l9397.com: could not connect to host
-l9721.com: could not connect to host
-l9728.co: could not connect to host
-la-cave-a-nodo.fr: did not receive HSTS header
-la-flora-negra.de: could not connect to host
-la-grande-jaugue.fr: did not receive HSTS header
-la-retraite-info.com: could not connect to host
-la-serendipite.fr: did not receive HSTS header
-la-tourmaline.ch: could not connect to host
-laac.io: could not connect to host
-labaia.info: could not connect to host
-labella-umbrella.com: did not receive HSTS header
-labelleza.com.br: could not connect to host
-labfox.de: did not receive HSTS header
-labina.com.tr: did not receive HSTS header
-labms.com.au: did not receive HSTS header
-laboiteanem.fr: could not connect to host
-laboiteapc.fr: did not receive HSTS header
-laboitebio-logique.ca: could not connect to host
-labordata.io: could not connect to host
-laborie.io: could not connect to host
-laboutiquemarocaineduconvoyeur.com: could not connect to host
-laboutiquemarocaineduconvoyeur.ma: could not connect to host
-laboxfaitsoncinema.com: could not connect to host
-labrador-retrievers.com.au: did not receive HSTS header
-labrasaq8.com: did not receive HSTS header
-labs.directory: could not connect to host
-labs.moscow: could not connect to host
-labtest.ltd: could not connect to host
-lacarpesaintaubinoise.fr: did not receive HSTS header
-lacasa.fr: could not connect to host
-lacaserita.org: could not connect to host
-lacasseroy.com: could not connect to host
-lacaverne.nl: could not connect to host
-lacicloud.net: could not connect to host
-lacigf.org: did not receive HSTS header
-lacledelareussite.com: did not receive HSTS header
-lacledeslan.ninja: could not connect to host
-lacuerba.com: did not receive HSTS header
-lacuevadechauvet.com: did not receive HSTS header
-lady-2.jp: did not receive HSTS header
-ladybugjam.com: could not connect to host
-ladylikeit.com: could not connect to host
-ladylucks.co.uk: did not receive HSTS header
-laegernevedlillebaelt.dk: could not connect to host
-laemen.com: did not receive HSTS header
-laemen.nl: could not connect to host
-laeryn.com: could not connect to host
-laeso.es: did not receive HSTS header
-laf.in.net: could not connect to host
-lafamillemusique.fr: did not receive HSTS header
-lafeemam.fr: could not connect to host
-lafkor.de: did not receive HSTS header
-laforetenchantee.ch: could not connect to host
-lafosseobservatoire.be: did not receive HSTS header
-lafr4nc3.xyz: could not connect to host
-lag-gbr.gq: could not connect to host
-lagalerievirtuelle.fr: did not receive HSTS header
-lagarderob.ru: did not receive HSTS header
-lagier.xyz: could not connect to host
-lagodny.eu: could not connect to host
-lagoza.name: could not connect to host
-laguiadelvaron.com: did not receive HSTS header
-lagunacoastrealestate.com: did not receive HSTS header
-lain.li: did not receive HSTS header
-lainchan.org: did not receive HSTS header
-laisashop.com.br: could not connect to host
-lajijonencadebarbera.com: could not connect to host
-lak-berlin.de: could not connect to host
-lakarwebb.se: could not connect to host
-lakatrop.com: could not connect to host
-lakefrontlittleelm.com: did not receive HSTS header
-lakehavasucityhomebuyerscredit.com: could not connect to host
-lakehavasucitynews.com: could not connect to host
-lakehavasuhomebuyercredit.com: could not connect to host
-lakehavasuhomes.info: did not receive HSTS header
-lakehavasuhouserentals.com: could not connect to host
-lakehavasuhouses.com: did not receive HSTS header
-lakewoodcomputerservices.com: could not connect to host
-lakhesis.net: could not connect to host
-lalajj.com: could not connect to host
-lalingua.ir: did not receive HSTS header
-laltroweb.it: did not receive HSTS header
-lalunaonlinebr.com: could not connect to host
-lamafioso.com: could not connect to host
-lamaisondelatransformationculturelle.com: did not receive HSTS header
-lambda-complex.org: could not connect to host
-lambdafive.co.uk: could not connect to host
-lambdaof.xyz: could not connect to host
-lame1337.xyz: could not connect to host
-lamed.se: did not receive HSTS header
-lamiaposta.email: did not receive HSTS header
-lampsh.ml: could not connect to host
-lamtv.com.mx: could not connect to host
-lanauzedesigns.com: did not receive HSTS header
-lanboll.com: could not connect to host
-lanbyte.se: could not connect to host
-lancashirecca.org.uk: could not connect to host
-lancehoteis.com: did not receive HSTS header
-lancehoteis.com.br: did not receive HSTS header
-lancejames.com: could not connect to host
-lancork.net: could not connect to host
-landell.ml: could not connect to host
-landgoedverkopen.nl: could not connect to host
-landhuisverkopen.nl: could not connect to host
-landoverhillsmd.gov: could not connect to host
-landscape.canonical.com: max-age too low: 2592000
-landscapelightingpacificpalisades.com: could not connect to host
-landscapingmedic.com: could not connect to host
-langenbach.rocks: could not connect to host
-langendorf-ernaehrung-training.de: could not connect to host
-langendries.eu: did not receive HSTS header
-langguth.io: did not receive HSTS header
-langkahteduh.com: could not connect to host
-langotie.com.br: could not connect to host
-lanhhuyet510.tk: could not connect to host
-laniakean.com: did not receive HSTS header
-lansinoh.co.uk: did not receive HSTS header
-lanyang.tk: could not connect to host
-lanzainc.xyz: did not receive HSTS header
-laobox.fr: could not connect to host
-laohei.org: could not connect to host
-laospage.com: could not connect to host
-laozhu.me: could not connect to host
-lapakus.com: could not connect to host
-laparoscopia.com.mx: did not receive HSTS header
-laperfumista.es: could not connect to host
-lapetition.be: could not connect to host
-lapix.com.co: could not connect to host
-laplaceduvillage.net: could not connect to host
-laquack.com: did not receive HSTS header
-laraigneedusoir.com: did not receive HSTS header
-laravelsaas.com: could not connect to host
-lared.ovh: did not receive HSTS header
-laredsemanario.com: could not connect to host
-larky.top: could not connect to host
-larptreff.de: could not connect to host
-larsgujord.no: could not connect to host
-larsmerke.de: did not receive HSTS header
-larvatoken.org: could not connect to host
-lasepiataca.com: could not connect to host
-lasercloud.ml: could not connect to host
-laserfuchs.de: did not receive HSTS header
-lasertechsolutions.com: could not connect to host
-lashstuff.com: did not receive HSTS header
-lasnaves.com: did not receive HSTS header
-lasonorastereo.com: did not receive HSTS header
-lasrecetasdeguada.com: could not connect to host
-lasse-it.dk: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-lasseleegaard.com: could not connect to host
-lasseleegaard.dk: could not connect to host
-lasseleegaard.net: could not connect to host
-lasseleegaard.org: could not connect to host
-lassesworld.com: could not connect to host
-lassesworld.se: could not connect to host
-lasst-uns-beten.de: could not connect to host
-lastbutnotyeast.com: could not connect to host
-lastchancetraveler.com: did not receive HSTS header
-lasterhub.me: could not connect to host
-lastharo.com: could not connect to host
-lastrada-minden.de: could not connect to host
-lastweekinaws.com: did not receive HSTS header
-latable-bowling-vire.fr: did not receive HSTS header
-latabledebry.be: could not connect to host
-latabledemontebello.com: could not connect to host
-latamarissiere.eu: did not receive HSTS header
-latanews.com: did not receive HSTS header
-lateliercantaldeco.fr: could not connect to host
-latelierdekathy.com: could not connect to host
-latemodern.com: did not receive HSTS header
-lateral.dog: could not connect to host
-latestbuy.com.au: did not receive HSTS header
-latetrain.cn: could not connect to host
-lathamlabs.com: could not connect to host
-lathamlabs.net: could not connect to host
-lathamlabs.org: could not connect to host
-lathen-wahn.de: did not receive HSTS header
-latiendadelbebefeliz.com: did not receive HSTS header
-latinmusicrecords.com: could not connect to host
-latinoramarecords.com: did not receive HSTS header
-latinosup.com: did not receive HSTS header
-latinosuptv.com: did not receive HSTS header
-latinphone.com: could not connect to host
-latinred.com: did not receive HSTS header
-latintoy.com: did not receive HSTS header
-latitude42technology.com: did not receive HSTS header
-latour-managedcare.ch: could not connect to host
-latrine.cz: did not receive HSTS header
-latus.xyz: could not connect to host
-laudwein.fr: could not connect to host
-laufcampus.com: did not receive HSTS header
-laufers.pl: did not receive HSTS header
-laufseminare-laufreisen.com: did not receive HSTS header
-lauftrainer-ausbildung.com: did not receive HSTS header
-laughinggrapepublishing.com: did not receive HSTS header
-laupv.online: could not connect to host
-laurel4th.org: did not receive HSTS header
-laurelcountycorrectionsky.gov: could not connect to host
-laurelspaandlash.com: did not receive HSTS header
-laureltv.org: did not receive HSTS header
-laurent-e-levy.com: did not receive HSTS header
-lauritzt.cf: could not connect to host
-lausitzer-widerstand.de: did not receive HSTS header
-lauxzahnheilkunde.de: did not receive HSTS header
-lavapot.com: did not receive HSTS header
-lavasing.eu.org: could not connect to host
-lavenderx.org: could not connect to host
-laventainnhotel-mailing.com: could not connect to host
-lavine.ch: did not receive HSTS header
-lavishlooksstudio.com.au: could not connect to host
-lavito.cz: could not connect to host
-lavka-konditera.com: could not connect to host
-lavoniaga.gov: did not receive HSTS header
-lavval.com: could not connect to host
-law-iku.pro: did not receive HSTS header
-lawbirduk.com: did not receive HSTS header
-lawfirm.tips: could not connect to host
-lawformt.com: max-age too low: 2592000
-lawly.org: did not receive HSTS header
-lawrence-institute.com: could not connect to host
-lawrencecountyboe-ohio.gov: did not receive HSTS header
-lawrenceklepinger.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-lawyerdigital.co.bw: could not connect to host
-laxatus.com: could not connect to host
-laxiongames.es: could not connect to host
-lay1688.com: max-age too low: 0
-layer8.tk: could not connect to host
-layfully.me: could not connect to host
-laymans911.info: could not connect to host
-lazapateriahandmade.pe: did not receive HSTS header
-lazerus.net: could not connect to host
-lazisbaiturrahman.org: could not connect to host
-lazowik.pl: did not receive HSTS header
-lazulu.com: could not connect to host
-lazytux.de: did not receive HSTS header
-lbarrios.es: could not connect to host
-lbphacker.pw: could not connect to host
-lbrlh.tk: could not connect to host
-lbrli.tk: could not connect to host
-lbrls.tk: could not connect to host
-lbrt.xyz: could not connect to host
-lc1818.com: could not connect to host
-lc3799.com: could not connect to host
-lc6686.com: could not connect to host
-lc8.vc: could not connect to host
-lc8md66.com: could not connect to host
-lc9158.com: could not connect to host
-lc9191.com: could not connect to host
-lc973.com: could not connect to host
-lca.gov: could not connect to host
-lcbizsolutions.com: could not connect to host
-lcdn.ro: could not connect to host
-lcgabogados.com: could not connect to host
-lclarkpdx.com: could not connect to host
-lcrmscp.gov: could not connect to host
-lcti.biz: could not connect to host
-lcvip0.com: could not connect to host
-lcvip3.com: could not connect to host
-lcvip6.com: could not connect to host
-lcvip8.com: could not connect to host
-lcy.cat: could not connect to host
-lcybox.com: did not receive HSTS header
-ldarby.me.uk: could not connect to host
-ldcraft.pw: could not connect to host
-le-blog.ch: could not connect to host
-le-dev.de: did not receive HSTS header
-le-hosting.de: did not receive HSTS header
-le0.me: could not connect to host
-le052.com: could not connect to host
-le0yn.ml: could not connect to host
-le130rb.com: could not connect to host
-leadership9.com: could not connect to host
-leadgenie.me: could not connect to host
-leadingsalons.com: did not receive HSTS header
-leadpagebuilders.com: could not connect to host
-leadplan.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-leadstart.org: did not receive HSTS header
-leak.media: could not connect to host
-leakedminecraft.net: could not connect to host
-leakreporter.net: did not receive HSTS header
-leaks.directory: could not connect to host
-leanclub.org: could not connect to host
-leandre.cn: could not connect to host
-leaodarodesia.com.br: could not connect to host
-leardev.de: did not receive HSTS header
-learn-smart.uk: did not receive HSTS header
-learncrypto.live: could not connect to host
-learncrypto.show: could not connect to host
-learndev.info: did not receive HSTS header
-learnedhacker.com: could not connect to host
-learnedovo.com: could not connect to host
-learnforestry.com: could not connect to host
-learnfrenchfluently.com: could not connect to host
-learngreenlandic.com: did not receive HSTS header
-learningaboutcarinsurance.com: did not receive HSTS header
-learningorder.com: could not connect to host
-learnsait2.azurewebsites.net: could not connect to host
-learntale.com: could not connect to host
-learnthetruth.tk: could not connect to host
-learntotradethemarket.com: did not receive HSTS header
-learntube.cz: did not receive HSTS header
-leaseit24.com: could not connect to host
-leaseit24.de: could not connect to host
-leaseourthings.com: could not connect to host
-leasit.at: could not connect to host
-leasit.de: could not connect to host
-leavenworthcounty.gov: did not receive HSTS header
-leavesofchangeweekly.org: did not receive HSTS header
-lebal.se: could not connect to host
-lebanonoregon.gov: did not receive HSTS header
-lebrun.org: could not connect to host
-lechaudrondupertuis.ch: could not connect to host
-leclaire.com.br: did not receive HSTS header
-lecn2.com: did not receive HSTS header
-lecoinchocolat.com: could not connect to host
-lecourtier.fr: did not receive HSTS header
-led-tl-wereld.nl: did not receive HSTS header
-led.xyz: could not connect to host
-ledcpu.com: could not connect to host
-leddruckalarm.de: could not connect to host
-ledgerscope.net: could not connect to host
-ledhouse.sk: did not receive HSTS header
-ledlampor365.se: could not connect to host
-ledshop.mx: did not receive HSTS header
-ledzom.ru: did not receive HSTS header
-leebiblestudycenter.co.uk: could not connect to host
-leebiblestudycenter.com: could not connect to host
-leebiblestudycentre.com: could not connect to host
-leebiblestudycentre.net: could not connect to host
-leebiblestudycentre.org: could not connect to host
-leefindlow.com: could not connect to host
-leegyuho.com: could not connect to host
-leelou.wedding: could not connect to host
-leemac.com.au: did not receive HSTS header
-leen.io: could not connect to host
-leere.me: could not connect to host
-leerkotte.eu: could not connect to host
-leetsaber.com: did not receive HSTS header
-leftclick.cloud: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-leftclick.eu: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-lega-dental.com: did not receive HSTS header
-legacylawofwashington.com: did not receive HSTS header
-legal-tender.com: did not receive HSTS header
-legal.farm: could not connect to host
-legaleus.co.uk: could not connect to host
-legalisepeacebloom.com: could not connect to host
-legalrobot-uat.com: could not connect to host
-legalsen.com: did not receive HSTS header
-legaltechnology.pro: could not connect to host
-legaltip.eu: could not connect to host
-legarage.org: did not receive HSTS header
-legatofmrc.fr: could not connect to host
-legavenue.com.br: did not receive HSTS header
-legendagroup.ch: could not connect to host
-legilimens.de: could not connect to host
-legitaxi.com: did not receive HSTS header
-legoutcheznous.com: did not receive HSTS header
-legumefederation.org: did not receive HSTS header
-legymnase.eu: did not receive HSTS header
-lehrermarktplatz.de: did not receive HSTS header
-lehtinen.xyz: did not receive HSTS header
-leigh.life: did not receive HSTS header
-leilautourdumon.de: could not connect to host
-leiming.co: could not connect to host
-leinir.dk: did not receive HSTS header
-leition.com: did not receive HSTS header
-leitionusercontent.com: could not connect to host
-leiyinan.com: did not receive HSTS header
-leiyun.me: could not connect to host
-lel.ovh: did not receive HSTS header
-lelambiental.com.br: did not receive HSTS header
-lelehei.com: could not connect to host
-lellyboi.ml: could not connect to host
-lelongbank.com: did not receive HSTS header
-lelux.email: could not connect to host
-lemon.co: could not connect to host
-lemondrops.xyz: could not connect to host
-lemouillour.fr: could not connect to host
-lemp.io: did not receive HSTS header
-lemuslimpost.com: did not receive HSTS header
-lendahandmissionteams.org: could not connect to host
-lenders.direct: could not connect to host
-lengyelnyelvoktatas.hu: could not connect to host
-lengyelul.hu: could not connect to host
-lengzzz.com: could not connect to host
-lenit.nl: could not connect to host
-lenkunz.me: could not connect to host
-lenn1.de: did not receive HSTS header
-lennarth.com: could not connect to host
-lennartheinrich.de: could not connect to host
-lennier.info: did not receive HSTS header
-lennyfaces.net: did not receive HSTS header
-lennyobez.be: did not receive HSTS header
-lenovogaming.com: could not connect to host
-lentri.com: did not receive HSTS header
-lenzw.de: did not receive HSTS header
-leob.in: did not receive HSTS header
-leochedibracchio.com: did not receive HSTS header
-leodaniels.com: did not receive HSTS header
-leolana.com: could not connect to host
-leolemos.com.br: did not receive HSTS header
-leon-jaekel.com: could not connect to host
-leon.net: did not receive HSTS header
-leonardcamacho.me: could not connect to host
-leonauto.de: could not connect to host
-leonax.net: could not connect to host
-leopold.email: could not connect to host
-leopotamgroup.com: could not connect to host
-leoservicosetc.store: could not connect to host
-lepiquillo.fr: did not receive HSTS header
-lepont.pl: could not connect to host
-leponton-lorient.fr: did not receive HSTS header
-lepourquoiducomment.fr: did not receive HSTS header
-leppis-it.de: could not connect to host
-leprado.com: could not connect to host
-lerlivros.online: could not connect to host
-lerner.moscow: could not connect to host
-lerp.me: did not receive HSTS header
-les-corsaires.net: could not connect to host
-les-pingouins.com: could not connect to host
-les-voitures-electriques.com: max-age too low: 2592000
-lesbiansslaves.com: could not connect to host
-lescomptoirsdepierrot.com: could not connect to host
-lescourtiersbordelais.com: did not receive HSTS header
-lesdouceursdeliyana.com: could not connect to host
-lesformations.net: could not connect to host
-lesgitesdefranca.com: did not receive HSTS header
-lesh.eu: could not connect to host
-lesliekearney.com: did not receive HSTS header
-lesperlesdunet.fr: could not connect to host
-lesquatredauphins.fr: did not receive HSTS header
-lesscloud.com: could not connect to host
-lessets-graphiques.com: could not connect to host
-lessing.consulting: did not receive HSTS header
-letao18.com: could not connect to host
-letempsdunefleur.be: could not connect to host
-leter.io: did not receive HSTS header
-lethbridgecoffee.com: did not receive HSTS header
-letitfly.me: did not receive HSTS header
-letkidsbekids.co.uk: did not receive HSTS header
-letraba.com: could not connect to host
-letras.mus.br: did not receive HSTS header
-letreview.ph: could not connect to host
-lets.ninja: could not connect to host
-letsdocode.com: could not connect to host
-letsgetintouch.com: could not connect to host
-letskick.ru: did not receive HSTS header
-letsmultiplayerplay.com: did not receive HSTS header
-letsnet.org: could not connect to host
-letson.me: could not connect to host
-letstox.com: could not connect to host
-lettland-firma.com: could not connect to host
-letustravel.tk: could not connect to host
-letzchange.org: did not receive HSTS header
-levante.com.au: did not receive HSTS header
-levatc.tk: could not connect to host
-level-10.net: could not connect to host
-level3.xyz: could not connect to host
-levelaccordingly.com: could not connect to host
-levelcheat.com: could not connect to host
-levelum.com: did not receive HSTS header
-leveredge.net: could not connect to host
-levert.ch: could not connect to host
-lewdlist.com: did not receive HSTS header
-lewis.li: did not receive HSTS header
-lewisjuggins.co.uk: did not receive HSTS header
-lexiphanic.co.uk: did not receive HSTS header
-lexpartsofac.com: could not connect to host
-lexxyn.nl: did not receive HSTS header
-leyun.cloud: did not receive HSTS header
-lez-cuties.com: could not connect to host
-lezard-com.fr: did not receive HSTS header
-lezdomsm.com: could not connect to host
-lfaz.org: could not connect to host
-lffweb.ga: could not connect to host
-lfklzw.com: could not connect to host
-lfullerdesign.com: could not connect to host
-lg0.site: could not connect to host
-lg21.co: could not connect to host
-lgbt.ventures: could not connect to host
-lgbtventures.com: could not connect to host
-lgcamsps.com: could not connect to host
-lgiswa.com.au: did not receive HSTS header
-lgnsh.fr: could not connect to host
-lgrs.com.au: did not receive HSTS header
-lgsg.us: could not connect to host
-lgts.se: could not connect to host
-lhajn.cz: could not connect to host
-lhakustik.se: could not connect to host
-lhalbert.xyz: could not connect to host
-lhasaapso.com.br: could not connect to host
-lheinrich.com: could not connect to host
-lheinrich.de: could not connect to host
-lheinrich.org: could not connect to host
-lhsj28.com: could not connect to host
-lhsj68.com: could not connect to host
-lhsj78.com: could not connect to host
-li756.com: max-age too low: 0
-liaillustr.at: did not receive HSTS header
-liam-is-a-nig.ga: could not connect to host
-liamjack.fr: could not connect to host
-lian-in.net: could not connect to host
-liangbp.com: could not connect to host
-liangyichen.net: did not receive HSTS header
-lianwen.kim: could not connect to host
-lianye.in: could not connect to host
-lianye1.cc: could not connect to host
-lianye2.cc: could not connect to host
-lianye3.cc: could not connect to host
-lianye4.cc: could not connect to host
-lianye5.cc: could not connect to host
-lianye6.cc: could not connect to host
-lianyexiuchang.in: could not connect to host
-liaoshuma.com: could not connect to host
-liaozheqi.cn: could not connect to host
-liaronce.win: could not connect to host
-libanco.com: could not connect to host
-libbitcoin.org: could not connect to host
-libdeer.so: could not connect to host
-libertas-tech.com: could not connect to host
-libertins.date: did not receive HSTS header
-libertyrp.org: could not connect to host
-libfte.org: did not receive HSTS header
-librairie-asie.com: did not receive HSTS header
-library.linode.com: did not receive HSTS header
-libraryofcode.us: could not connect to host
-libre.university: could not connect to host
-librechan.net: could not connect to host
-librends.org: could not connect to host
-libricks.fr: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-librosdescargas.club: could not connect to host
-libruis.com: could not connect to host
-libwebsockets.org: could not connect to host
-libzik.com: could not connect to host
-licence-registry.com: could not connect to host
-liceo.cn: did not receive HSTS header
-liceserv.com: could not connect to host
-lichess4545.com: did not receive HSTS header
-lichess4545.tv: did not receive HSTS header
-lichform.com: could not connect to host
-lichtletters-huren.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-lickingcounty.gov: did not receive HSTS header
-lickmypussy.us: did not receive HSTS header
-lidl-selection.at: could not connect to host
-lidlovajogurteka.si: could not connect to host
-liebach.me: did not receive HSTS header
-liebestarot.at: did not receive HSTS header
-lieblingsholz.de: could not connect to host
-liebt.schule: could not connect to host
-lied8.eu: could not connect to host
-lierrmm.space: could not connect to host
-lietaer.eu: did not receive HSTS header
-life-like.com: did not receive HSTS header
-lifecoach.tw: did not receive HSTS header
-lifecoachproviders.com: could not connect to host
-lifeenrichmentnc.com: did not receive HSTS header
-lifegrip.com.au: did not receive HSTS header
-lifeguard.aecom.com: did not receive HSTS header
-lifeinitsownway.com: could not connect to host
-lifeinsuranceresource.com: did not receive HSTS header
-lifeinsurances.pro: could not connect to host
-lifeinsurances24.com: could not connect to host
-lifeisabug.com: could not connect to host
-lifekiss.ru: could not connect to host
-lifemarque.co.uk: did not receive HSTS header
-lifenexto.com: could not connect to host
-lifeng.us: did not receive HSTS header
-lifeonplanetjapan.com: could not connect to host
-lifequotes-uk.co.uk: could not connect to host
-lifereset.it: did not receive HSTS header
-lifeskillsdirect.com: did not receive HSTS header
-lifestyle7788.com: could not connect to host
-lifestyler.me: could not connect to host
-lifetimemoneymachine.com: could not connect to host
-lifeupgame.fr: could not connect to host
-liftoff.rocks: could not connect to host
-lightarmory.com: could not connect to host
-lightcloud.com: did not receive HSTS header
-lightdark.xyz: could not connect to host
-lightdream.tech: could not connect to host
-lighthouseinstruments.com: did not receive HSTS header
-lightingpacificpalisades.com: could not connect to host
-lightning-ashe.com: did not receive HSTS header
-lightnovelsekai.com: could not connect to host
-lightpaste.com: could not connect to host
-lightpics.net: did not receive HSTS header
-lighttherapydevice.com: did not receive HSTS header
-lightupcollective.co.uk: could not connect to host
-lightworx.io: could not connect to host
-lignemalin.com: could not connect to host
-lignemax.com: did not receive HSTS header
-lignenet.com: did not receive HSTS header
-lijero.co: could not connect to host
-like.lgbt: could not connect to host
-likefluence.com: could not connect to host
-likenewhearing.com.au: could not connect to host
-likenosis.com: could not connect to host
-lila.pink: did not receive HSTS header
-lilaccakeboutique.com: could not connect to host
-lilai6616.com: could not connect to host
-lilapmedia.com: could not connect to host
-lilismartinis.com: could not connect to host
-lilliangray.co.za: did not receive HSTS header
-lillpopp.eu: did not receive HSTS header
-lilpwny.com: could not connect to host
-lilycms.com: could not connect to host
-lilygreen.co.za: could not connect to host
-lilylasvegas.com: could not connect to host
-limalama.eu: could not connect to host
-limeburst.net: did not receive HSTS header
-limelabs.de: did not receive HSTS header
-limelabs.io: did not receive HSTS header
-limeyeti.com: could not connect to host
-limiteddata.co.uk: could not connect to host
-limitget.com: could not connect to host
-limn.me: could not connect to host
-limoairporttoronto.net: could not connect to host
-limodo-shop.de: did not receive HSTS header
-limousineservicezurich.com: did not receive HSTS header
-limpens.net: did not receive HSTS header
-limpido.it: could not connect to host
-limsia.co: could not connect to host
-limsia.com: could not connect to host
-limunana.com: could not connect to host
-lin2018168.com: max-age too low: 0
-linan.blog: did not receive HSTS header
-linan.info: could not connect to host
-linan.me: could not connect to host
-linan.site: could not connect to host
-linasjourney.com: did not receive HSTS header
-linchpin-it.com: did not receive HSTS header
-lincolncountytn.gov: could not connect to host
-lincsbouncycastlehire.co.uk: could not connect to host
-lindberg.io: did not receive HSTS header
-lindemann.space: could not connect to host
-lindholmen.club: did not receive HSTS header
-lindsayanderson.com: could not connect to host
-line.red: did not receive HSTS header
-linearaudio.nl: did not receive HSTS header
-lineauniformes.com.br: could not connect to host
-linernotekids.com: could not connect to host
-linestriperdepot.com: did not receive HSTS header
-linext.cn: could not connect to host
-lingerie.net.br: did not receive HSTS header
-lingerielovers.com.br: could not connect to host
-lingerieonline.com.br: could not connect to host
-lingros-test.tk: could not connect to host
-lingting.vip: could not connect to host
-linguamilla.com: did not receive HSTS header
-linguaquote.com: did not receive HSTS header
-linguatrip.com: did not receive HSTS header
-lingvo-svoboda.ru: did not receive HSTS header
-linhaoyi.com: did not receive HSTS header
-linherest.tk: could not connect to host
-linhua.org: could not connect to host
-link.ba: could not connect to host
-linkage.ph: did not receive HSTS header
-linkages.org: could not connect to host
-linkat4.cz: could not connect to host
-linkk9.com: did not receive HSTS header
-linkonaut.net: could not connect to host
-linksanitizer.com: could not connect to host
-linksextremist.at: could not connect to host
-linkst.co: could not connect to host
-linkstream.live: did not receive HSTS header
-linkthis.ml: could not connect to host
-linkthisstatus.ml: could not connect to host
-linky.tk: could not connect to host
-linkybos.com: could not connect to host
-linkyou.top: did not receive HSTS header
-linkzyovh.com: did not receive HSTS header
-linley.de: could not connect to host
-linmi.cc: did not receive HSTS header
-linno.me: could not connect to host
-linode.com: did not receive HSTS header
-linorman1997.me: could not connect to host
-linostassi.net: could not connect to host
-lintellift.com: did not receive HSTS header
-linusdrop.tips: could not connect to host
-linux-admin-california.com: could not connect to host
-linux-mint.cz: did not receive HSTS header
-linux.army: could not connect to host
-linux.sb: could not connect to host
-linuxandstuff.de: could not connect to host
-linuxcode.net: could not connect to host
-linuxeyecandy.com: could not connect to host
-linuxfixed.it: could not connect to host
-linuxforyou.com: did not receive HSTS header
-linuxgeek.ro: could not connect to host
-linuxmint.cz: could not connect to host
-linuxmonitoring.net: could not connect to host
-linuxno.com: could not connect to host
-linuxproperties.com: could not connect to host
-linvx.org: could not connect to host
-linxmind.eu: could not connect to host
-lionhosting.nl: could not connect to host
-lipo.lol: could not connect to host
-liquid.solutions: could not connect to host
-liquidcomm.net: could not connect to host
-liquidradio.pro: could not connect to host
-liquidwarp.net: could not connect to host
-liquimoly.market: did not receive HSTS header
-liquorsanthe.in: could not connect to host
-lirico.ca: could not connect to host
-liris-beautywelt.de: did not receive HSTS header
-lisaco.de: could not connect to host
-lisamortimore.com: did not receive HSTS header
-lisbongold.com: did not receive HSTS header
-lisgade.dk: could not connect to host
-lisieuxarquitetura.com.br: could not connect to host
-lisinphotography.com: could not connect to host
-lisowski-photography.com: could not connect to host
-listach.tk: could not connect to host
-listafirmelor.com: could not connect to host
-listage.ovh: did not receive HSTS header
-listal.com: did not receive HSTS header
-lists.mayfirst.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-litcc.com: could not connect to host
-litcomphonors.com: could not connect to host
-litebitanalytics.eu: did not receive HSTS header
-literaturpreis-bad-wurzach.de: did not receive HSTS header
-litespeed.io: could not connect to host
-litevault.net: did not receive HSTS header
-little-bird-bayreuth.de: did not receive HSTS header
-little.pw: could not connect to host
-littlebirds.cf: could not connect to host
-littleboutiqueshop.com: could not connect to host
-littleboutiqueshop.uk: could not connect to host
-littlecrittersbrewery.com: did not receive HSTS header
-littledisney.ro: did not receive HSTS header
-littlefreelibrary.org: did not receive HSTS header
-littlejumpers.co.uk: did not receive HSTS header
-littleqiu.net: could not connect to host
-littleservice.cn: could not connect to host
-littleskin.cn: could not connect to host
-liuboznaiko.eu: did not receive HSTS header
-liud.im: could not connect to host
-liujr.tk: could not connect to host
-liujunyang.com: could not connect to host
-liukang.tech: could not connect to host
-liul.in: could not connect to host
-liupeicheng.top: did not receive HSTS header
-liuxiangling.com: did not receive HSTS header
-liv3ly.com: did not receive HSTS header
-livadm.ml: could not connect to host
-livaniaccesorios.com: could not connect to host
-livecards.co.uk: did not receive HSTS header
-livechatlady.info: did not receive HSTS header
-livedemo.io: could not connect to host
-livej.am: could not connect to host
-livelexi.com: could not connect to host
-livepath.ch: did not receive HSTS header
-liveperformersmeeting.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-liverewrite.com: could not connect to host
-livesearch-fukuoka.com: did not receive HSTS header
-livetube.tv: did not receive HSTS header
-livhao.com: could not connect to host
-liviababynet.com.br: could not connect to host
-livinghealthywithchocolate.com: did not receive HSTS header
-livinglocalnashville.com: did not receive HSTS header
-livnev.me: could not connect to host
-livnev.xyz: could not connect to host
-livolett.de: did not receive HSTS header
-livrariacoad.com.br: could not connect to host
-livrariahugodesaovitor.com.br: could not connect to host
-livres-et-stickers.com: did not receive HSTS header
-livroseuniformes.com.br: could not connect to host
-livv168.com: did not receive HSTS header
-livv168.net: did not receive HSTS header
-lixiang.one: could not connect to host
-lixiaojiang.ga: could not connect to host
-lixiaoyu.live: could not connect to host
-lixingcong.com: could not connect to host
-liyin.date: could not connect to host
-liypoi.top: did not receive HSTS header
-lizhi123.net: could not connect to host
-lizhuogui.ga: could not connect to host
-ljskool.com: did not receive HSTS header
-ljusdalsnaprapatklinik.se: did not receive HSTS header
-ljw.me: could not connect to host
-lkbk.uk: could not connect to host
-lkdpp.lt: could not connect to host
-lkp111138.me: did not receive HSTS header
-ll5197.co: could not connect to host
-ll6729.co: could not connect to host
-ll6729.com: did not receive HSTS header
-ll6957.co: could not connect to host
-ll9297.co: could not connect to host
-ll9397.com: could not connect to host
-ll9721.com: could not connect to host
-ll9728.co: could not connect to host
-llamacuba.com: did not receive HSTS header
-ller.xyz: could not connect to host
-lll.st: could not connect to host
-llsv666.com: max-age too low: 0
-llvm.us: could not connect to host
-lmdexpresstransport.com: did not receive HSTS header
-lmrcouncil.gov: could not connect to host
-lmsuitespagna.it: did not receive HSTS header
-lmtravis.com: could not connect to host
-ln.io: could not connect to host
-lnbeauty.ru: max-age too low: 0
-lndrive.space: could not connect to host
-lnmp.me: did not receive HSTS header
-lnoldan.com: could not connect to host
-lntu.org: could not connect to host
-lnx.li: could not connect to host
-lnyltx.cn: could not connect to host
-loacg.com: did not receive HSTS header
-load.pm: did not receive HSTS header
-loadingdeck.com: could not connect to host
-loadso.me: could not connect to host
-loadtraining.com: did not receive HSTS header
-loafbox.com: could not connect to host
-loafhead.me: could not connect to host
-loan-lenders.co.za: did not receive HSTS header
-loancompare.co.za: could not connect to host
-loandolphin.com.au: did not receive HSTS header
-loanreadycredit.com: could not connect to host
-loansonline.today: could not connect to host
-loanstreet.be: could not connect to host
-lobin21.com: could not connect to host
-lobosdomain.no-ip.info: could not connect to host
-lobste.rs: did not receive HSTS header
-locais.org: could not connect to host
-localchum.com: could not connect to host
-localdata.us: did not receive HSTS header
-localdrive.me: could not connect to host
-localegroup.com: did not receive HSTS header
-localhorst.xyz: could not connect to host
-localnetwork.nz: could not connect to host
-localprideart.com: could not connect to host
-localsource.eu: could not connect to host
-location-fichier-email.com: could not connect to host
-locationvoitureallemagne.com: could not connect to host
-locationvoitureangleterre.com: could not connect to host
-locationvoitureaustralie.com: could not connect to host
-locationvoitureautriche.com: could not connect to host
-locationvoiturebelgique.com: could not connect to host
-locationvoiturecorse.net: could not connect to host
-locationvoitureespagne.com: could not connect to host
-locationvoiturefinlande.com: could not connect to host
-locationvoitureirlande.com: could not connect to host
-locationvoitureislande.com: could not connect to host
-locationvoitureitalie.com: could not connect to host
-locationvoiturenorvege.com: could not connect to host
-locationvoiturepaysbas.com: could not connect to host
-locationvoitureportugal.com: could not connect to host
-locationvoituresuede.com: could not connect to host
-locchat.com: could not connect to host
-locker3.com: could not connect to host
-lockify.com: could not connect to host
-lockr.io: did not receive HSTS header
-locksmith-durbannorth.co.za: could not connect to host
-locksmithcarrolltontx.com: did not receive HSTS header
-locksmithhillcrest.co.za: could not connect to host
-locksmithmidrand24-7.co.za: did not receive HSTS header
-locksmithopen.com: could not connect to host
-locksmithrandburg24-7.co.za: could not connect to host
-locksmithsanantoniotexas.com: did not receive HSTS header
-locksmithsbluff.com: could not connect to host
-locksmithservice-houston.com: did not receive HSTS header
-locksport.org.nz: could not connect to host
-locktheirphone.com: could not connect to host
-lockyourcomputer.pw: could not connect to host
-locomocosec.com: did not receive HSTS header
-locomotive.ca: did not receive HSTS header
-locvis.ru: did not receive HSTS header
-lode.li: could not connect to host
-lodgesdureynou.fr: did not receive HSTS header
-loeildansledoigt.fr: could not connect to host
-loftboard.eu: could not connect to host
-log2n.uk: could not connect to host
-logaldeveloper.com: could not connect to host
-logancountyky.gov: could not connect to host
-logario.com.br: could not connect to host
-logbook.ch: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-logcat.info: could not connect to host
-logement.com: could not connect to host
-logfro.de: max-age too low: 0
-logic8.ml: could not connect to host
-logicaladvertising.com: could not connect to host
-logicchen.com: could not connect to host
-logiccircle.ir: did not receive HSTS header
-logicsale.com: did not receive HSTS header
-logicsale.de: did not receive HSTS header
-logicsale.fr: did not receive HSTS header
-logicsale.it: did not receive HSTS header
-logicz.top: could not connect to host
-logimagine.com: did not receive HSTS header
-login.corp.google.com: max-age too low: 7776000 (error ignored - included regardless)
-login.persona.org: could not connect to host
-login.xero.com: did not receive HSTS header
-logingate.hu: could not connect to host
-loginseite.com: could not connect to host
-loginsentinel.eu: did not receive HSTS header
-logistify.com.mx: did not receive HSTS header
-logitank.net: did not receive HSTS header
-logitrack.tk: could not connect to host
-lognot.net: could not connect to host
-logoesun.com: could not connect to host
-logopaediereinhard.de: did not receive HSTS header
-logymedia.com: could not connect to host
-lohl1kohl.de: did not receive HSTS header
-lohmeyer-it.de: could not connect to host
-loigiai.net: did not receive HSTS header
-loihay.net: could not connect to host
-lojadkstore.com.br: could not connect to host
-lojadocristaozinho.com.br: could not connect to host
-lojahunamarcenaria.com.br: could not connect to host
-lojamulticapmais.com.br: did not receive HSTS header
-lojapos.eu: did not receive HSTS header
-lojaprimemed.com.br: could not connect to host
-lojasceletro.com.br: could not connect to host
-lojashowdecozinha.com.br: could not connect to host
-lojasviavento.com.br: could not connect to host
-lojatema.com.br: could not connect to host
-lojavalcapelli.com.br: could not connect to host
-lojavirtualfc.com.br: did not receive HSTS header
-lojavirtualfct.com.br: did not receive HSTS header
-lolcorp.pl: could not connect to host
-lolhax.org: did not receive HSTS header
-loli.bz: could not connect to host
-loli.ee: could not connect to host
-loli.vip: could not connect to host
-loliblogs.cf: could not connect to host
-loliblogs.ga: could not connect to host
-loliblogs.gq: could not connect to host
-loliblogs.ml: could not connect to host
-lolico.moe: did not receive HSTS header
-lolicon.info: could not connect to host
-lolicore.ch: could not connect to host
-lolidunno.com: could not connect to host
-lolifamily.cf: could not connect to host
-lolifamily.ga: could not connect to host
-lolifamily.gq: could not connect to host
-lolifamily.ml: could not connect to host
-lolio.tw: could not connect to host
-lolis.stream: could not connect to host
-lolitalechat.com: could not connect to host
-lollaconcept.com.br: could not connect to host
-lonal.com: could not connect to host
-lonay.me: did not receive HSTS header
-lonbali.com: did not receive HSTS header
-londoncalling.co: did not receive HSTS header
-londonindustryshop.com: could not connect to host
-londonkan.jp: could not connect to host
-londonlanguageexchange.com: could not connect to host
-lonerwolf.com: did not receive HSTS header
-long688.com: could not connect to host
-long8.com: could not connect to host
-longboarding-ulm.de: could not connect to host
-longdie88.com: max-age too low: 0
-longma.pw: could not connect to host
-longtaitouwang.com: did not receive HSTS header
-look-at-my.site: could not connect to host
-looka.ch: did not receive HSTS header
-looka.photo: could not connect to host
-lookart.ch: could not connect to host
-lookout.com: did not receive HSTS header
-looktothestars.org: did not receive HSTS header
-lookupclose.com: could not connect to host
-lookyman.net: did not receive HSTS header
-loom.no: did not receive HSTS header
-loomis.center: did not receive HSTS header
-looneymooney.com: could not connect to host
-loongsg.xyz: could not connect to host
-loopower.com: could not connect to host
-looptics.eu: did not receive HSTS header
-loovto.net: could not connect to host
-loqyu.co: could not connect to host
-lord.city: could not connect to host
-lordgun.com: did not receive HSTS header
-lore.azurewebsites.net: could not connect to host
-lorientlejour.com: did not receive HSTS header
-lormansas.com: could not connect to host
-losebellyfat.pro: could not connect to host
-loshogares.com.mx: did not receive HSTS header
-losless.fr: did not receive HSTS header
-losmedicamentos.net: did not receive HSTS header
-losrascadoresparagatos.com: could not connect to host
-lostandcash.com: did not receive HSTS header
-lostarq.com: could not connect to host
-lostg.com: did not receive HSTS header
-lostinsecurity.com: could not connect to host
-loteamentoabertoamparo.com.br: could not connect to host
-loteamentoabertocapivari.com.br: could not connect to host
-loteamentoabertopiracicaba.com.br: could not connect to host
-loteamentomontereiitu.com.br: could not connect to host
-loteks.de: could not connect to host
-lothai.re: did not receive HSTS header
-lothuytinhsi.com: could not connect to host
-loto-tele.com: could not connect to host
-lotos-ag.ch: did not receive HSTS header
-lotsencafe.de: did not receive HSTS header
-lottosonline.com: did not receive HSTS header
-lotuscloud.de: did not receive HSTS header
-lotuscloud.org: could not connect to host
-lotuswebsolutions.tk: could not connect to host
-louduniverse.net: did not receive HSTS header
-louiewatch.com: could not connect to host
-louisacountyia.gov: could not connect to host
-louisapolicefoundation.com: could not connect to host
-louisapolicefoundation.org: could not connect to host
-louisvillene.gov: max-age too low: 604800
-louisvillevmug.info: did not receive HSTS header
-love-schna.jp: could not connect to host
-love4taylor.eu.org: could not connect to host
-loveable.de: could not connect to host
-loveai.org: could not connect to host
-loveamber.me: could not connect to host
-loveandadoreboutique.com: did not receive HSTS header
-loveandloyalty.se: could not connect to host
-lovechester.com: could not connect to host
-lovecrystal.co.uk: could not connect to host
-loveislandgames.com: did not receive HSTS header
-lovelens.ch: could not connect to host
-lovelens.li: could not connect to host
-lovelifelovelive.com: could not connect to host
-lovelive-anime.tk: could not connect to host
-lovelive-anime.tokyo: could not connect to host
-lovelive.us: could not connect to host
-lovelivewiki.com: could not connect to host
-loveluna.com: did not receive HSTS header
-lovelyblogacademy.com: did not receive HSTS header
-lovelychalets-peisey.com: did not receive HSTS header
-lovelycorral.com: did not receive HSTS header
-lovelyfriends.org: did not receive HSTS header
-lovelytimes.net: could not connect to host
-lovemiku.info: could not connect to host
-lovemysafetynet.com: did not receive HSTS header
-loveread-ec.appspot.com: did not receive HSTS header
-loverepair.co.uk: did not receive HSTS header
-loveto.at: could not connect to host
-lovetravel360.com: could not connect to host
-lovevape.co: did not receive HSTS header
-loveyounastya.com: did not receive HSTS header
-lovingpenguin.com: did not receive HSTS header
-lovizaim.ru: could not connect to host
-lowcarblab.com: did not receive HSTS header
-lowcarbmaven.com: did not receive HSTS header
-lowhangingfruitgrabber.com: could not connect to host
-lowt.us: could not connect to host
-lowtherpavilion.co.uk: did not receive HSTS header
-loxal.net: did not receive HSTS header
-loxal.org: did not receive HSTS header
-loxis.be: did not receive HSTS header
-loyaleco.it: could not connect to host
-loyaltech.ch: could not connect to host
-lpacademy.com.br: could not connect to host
-lpak.nl: could not connect to host
-lpgram.ga: could not connect to host
-lpm-uk.com: could not connect to host
-lprcommunity.co.za: did not receive HSTS header
-lqs.me: could not connect to host
-lra-cloud.de: could not connect to host
-lrhsclubs.com: could not connect to host
-lrhstsa.com: did not receive HSTS header
-ls-a.org: did not receive HSTS header
-ls-reallife.de: did not receive HSTS header
-ls-rp.es: did not receive HSTS header
-lsal.me: could not connect to host
-lsky.cn: could not connect to host
-lsmarketing.ie: did not receive HSTS header
-lsp-sports.de: did not receive HSTS header
-lssolutions.ie: did not receive HSTS header
-lstma.com: could not connect to host
-lsvih.com: did not receive HSTS header
-lswim.com: did not receive HSTS header
-lsws.de: did not receive HSTS header
-lszj.com: could not connect to host
-ltba.org: could not connect to host
-ltbytes.com: could not connect to host
-ltechnologygroup.com: could not connect to host
-ltlec.net: could not connect to host
-ltlec.org: could not connect to host
-ltlec.services: could not connect to host
-ltmw.xyz: could not connect to host
-ltransferts.com: could not connect to host
-ltu.social: could not connect to host
-lty.space: could not connect to host
-lublin.toys: could not connect to host
-lubomirkazakov.com: did not receive HSTS header
-luca.swiss: could not connect to host
-lucakrebs.de: could not connect to host
-lucarautti.com: could not connect to host
-lucas-garte.com: did not receive HSTS header
-lucascobb.com: did not receive HSTS header
-lucascodes.com: could not connect to host
-lucasgaland.com: could not connect to host
-lucaterzini.com: could not connect to host
-lucentioluo.space: could not connect to host
-lucidlogs.com: could not connect to host
-lucidoccult.com: could not connect to host
-lucky28.org: did not receive HSTS header
-luckydog.pw: did not receive HSTS header
-luckyxf.com: could not connect to host
-luclu7.pw: could not connect to host
-lucy.science: could not connect to host
-lucysan.net: could not connect to host
-ludum.pl: could not connect to host
-ludwig.click: could not connect to host
-lufu.io: could not connect to host
-luganskservers.net: could not connect to host
-lugimax.com: could not connect to host
-lui.pink: did not receive HSTS header
-luis-checa.com: could not connect to host
-luisfernandoosorio.com: did not receive HSTS header
-luisgf.es: did not receive HSTS header
-luisv.me: could not connect to host
-luk.photo: could not connect to host
-lukasunger.cz: could not connect to host
-lukasunger.net: could not connect to host
-lukaszdolan.com: did not receive HSTS header
-lukasztkacz.com: could not connect to host
-lukatz.de: did not receive HSTS header
-lukem.eu: could not connect to host
-lukeng.me: could not connect to host
-lukesutton.info: could not connect to host
-lukmanulhakim.id: could not connect to host
-lukonet.com: did not receive HSTS header
-luloboutique.com: did not receive HSTS header
-luludapomerania.com: could not connect to host
-luma.family: could not connect to host
-luma.pink: could not connect to host
-lumacurve.com: did not receive HSTS header
-lumd.me: could not connect to host
-lumer.tech: could not connect to host
-lumi.do: did not receive HSTS header
-lumiere.com: did not receive HSTS header
-luminaires-online.fr: did not receive HSTS header
-luminancy.com: could not connect to host
-lunafag.ru: could not connect to host
-lunarichter.de: did not receive HSTS header
-lunarift.com: could not connect to host
-lunarrift.net: could not connect to host
-luneta.nearbuysystems.com: could not connect to host
-lungta.pro: could not connect to host
-lunight.ml: could not connect to host
-luno.io: could not connect to host
-luodaoyi.com: did not receive HSTS header
-luody.info: could not connect to host
-luoe.ml: could not connect to host
-luohua.im: could not connect to host
-luolikong.vip: could not connect to host
-luom.net: could not connect to host
-luoshifeng.com: could not connect to host
-luoxiao.im: could not connect to host
-luoxingyu.ml: could not connect to host
-luqsus.pl: did not receive HSTS header
-luripump.se: could not connect to host
-lushnikov-alex.ru: could not connect to host
-lusis.fr: did not receive HSTS header
-lusis.net: could not connect to host
-lusoft.cz: did not receive HSTS header
-lust.works: could not connect to host
-lustige-zitate.com: did not receive HSTS header
-lustrumxi.nl: could not connect to host
-lusynth.com: could not connect to host
-luther.fi: could not connect to host
-luuinhaler.com: did not receive HSTS header
-luxcraft.eng.br: could not connect to host
-luxe-it.co.uk: could not connect to host
-luxescreenprotector.nl: did not receive HSTS header
-luxfosdecoenterprise.com: could not connect to host
-luxinmo.com: did not receive HSTS header
-luxofit.de: did not receive HSTS header
-luxonetwork.com: could not connect to host
-luxstil.ga: could not connect to host
-luxurytimepieces.net: could not connect to host
-luxus-russen.de: could not connect to host
-luxwatch.com: could not connect to host
-luzeshomologadas.com.br: could not connect to host
-lv5.top: could not connect to host
-lwhate.com: could not connect to host
-lwl.moe: did not receive HSTS header
-lxd.pm: could not connect to host
-lxx77.com: could not connect to host
-lyam.fr: could not connect to host
-lycee-saintjoseph-mesnieres.fr: did not receive HSTS header
-lycetre.com: did not receive HSTS header
-lyclive.com: max-age too low: 0
-lycly.top: could not connect to host
-lydia-und-simon.de: could not connect to host
-lydiagorstein.com: did not receive HSTS header
-lyfbits.com: could not connect to host
-lylares.com: did not receive HSTS header
-lynkos.com: did not receive HSTS header
-lynnmosher.com: could not connect to host
-lyoness.digital: could not connect to host
-lyonl.com: could not connect to host
-lysdeau.be: could not connect to host
-lysergion.com: could not connect to host
-lyuba.fr: could not connect to host
-lyukaacom.ru: could not connect to host
-lz.sb: could not connect to host
-lz898.com: could not connect to host
-lzahq.tech: did not receive HSTS header
-lzkill.com: did not receive HSTS header
-lzqii.cn: could not connect to host
-lzzr.me: could not connect to host
-m-ali.xyz: did not receive HSTS header
-m-edmondson.co.uk: did not receive HSTS header
-m-gaming.tk: could not connect to host
-m-generator.com: could not connect to host
-m-rickroll-v.pw: could not connect to host
-m-warrior.tk: could not connect to host
-m.gparent.org: could not connect to host
-m.nu: did not receive HSTS header
-m0v0.com: could not connect to host
-m0wef.uk: could not connect to host
-m12uno.com: did not receive HSTS header
-m2tc.fr: could not connect to host
-m3-gmbh.de: did not receive HSTS header
-m30365.com: could not connect to host
-m4570.xyz: could not connect to host
-m4rcus.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-m5197.co: could not connect to host
-m6729.co: could not connect to host
-m6729.com: did not receive HSTS header
-m6957.co: could not connect to host
-m6957.com: did not receive HSTS header
-m82labs.com: did not receive HSTS header
-m9297.co: could not connect to host
-m9397.com: could not connect to host
-m9721.com: could not connect to host
-m9728.co: could not connect to host
-ma-musique.fr: did not receive HSTS header
-ma-plancha.ch: did not receive HSTS header
-maarten.nyc: could not connect to host
-maartenprovo.be: did not receive HSTS header
-maartenterpstra.xyz: could not connect to host
-maatwerkopruimcoaching.nl: could not connect to host
-mac-torrents.me: did not receive HSTS header
-mac1.net: did not receive HSTS header
-macandtonic.com: did not receive HSTS header
-macaw.nl: did not receive HSTS header
-macbay.net: did not receive HSTS header
-macbolo.com: could not connect to host
-macchaberrycream.com: could not connect to host
-macchedil.com: did not receive HSTS header
-macdj.tk: could not connect to host
-macedopesca.com.br: did not receive HSTS header
-mach1club.com: could not connect to host
-machbach.net: could not connect to host
-machcz.eu: did not receive HSTS header
-machijun.net: did not receive HSTS header
-machinelearningjavascript.com: could not connect to host
-machinerysafety101.com: did not receive HSTS header
-maciespartyhire.co.uk: did not receive HSTS header
-macinyasha.net: could not connect to host
-mack.space: could not connect to host
-mackey7.net: could not connect to host
-mackiehouse.ca: did not receive HSTS header
-mackinawil.gov: did not receive HSTS header
-macleodnc.com: did not receive HSTS header
-macosx86.ml: could not connect to host
-macosxfilerecovery.com: did not receive HSTS header
-macoun.de: max-age too low: 2592000
-macrostudent.com: could not connect to host
-macsandcheesedreams.com: could not connect to host
-macstore.pe: did not receive HSTS header
-macustar.eu: did not receive HSTS header
-mad.ninja: could not connect to host
-madandpissedoff.com: did not receive HSTS header
-madbicicletas.com: could not connect to host
-madcatdesign.de: did not receive HSTS header
-maddin.ga: could not connect to host
-maddistonparentcouncil.co.uk: could not connect to host
-maddistonpsa.co.uk: could not connect to host
-madebyfalcon.co.uk: did not receive HSTS header
-madebymagnitude.com: did not receive HSTS header
-madeglobal.com: did not receive HSTS header
-madeinchezmoi.net: could not connect to host
-madeintucson.org: could not connect to host
-mademoiselle-emma.be: could not connect to host
-mademoiselle-emma.fr: did not receive HSTS header
-maderasbrown.com: could not connect to host
-maderwin.com: did not receive HSTS header
-madesoftware.com.br: could not connect to host
-madhyrecords.com: could not connect to host
-madnetwork.org: could not connect to host
-madokami.net: could not connect to host
-madokami.pw: could not connect to host
-madpeople.net: could not connect to host
-madreacqua.org: could not connect to host
-madrecha.com: did not receive HSTS header
-madusecurity.com: did not receive HSTS header
-madwarlock.com: could not connect to host
-mae-berlinistanbul.com: could not connect to host
-maephorncurry.com: did not receive HSTS header
-maerzpa.de: did not receive HSTS header
-mafamane.com: could not connect to host
-mafiareturns.com: max-age too low: 2592000
-magazinedabeleza.net: could not connect to host
-magdeburg.directory: could not connect to host
-magebankin.com: did not receive HSTS header
-magellan-met.ru: could not connect to host
-magenx.com: did not receive HSTS header
-maggie-shaw.co.uk: did not receive HSTS header
-magi.systems: did not receive HSTS header
-magia360.com: did not receive HSTS header
-magicalshuttle.fr: did not receive HSTS header
-magicamulet.me: could not connect to host
-magickmoments.co.uk: could not connect to host
-magicvps.md: did not receive HSTS header
-magieamour.com: could not connect to host
-magieblanche.fr: did not receive HSTS header
-magilio.com: could not connect to host
-magnacumlaude.co: could not connect to host
-magneticanvil.com: could not connect to host
-magnettracker.com: could not connect to host
-magnoliadoulas.com: could not connect to host
-magodaoferta.com.br: could not connect to host
-magosmedellin.com: could not connect to host
-magyarokegyhelyen.hu: did not receive HSTS header
-mah-nig.ga: could not connect to host
-mahai.me: did not receive HSTS header
-mahamed91.pw: could not connect to host
-mahansexcavating.com: did not receive HSTS header
-mahefa.co.uk: could not connect to host
-mahfouzadedimeji.com: did not receive HSTS header
-maik-mahlow.de: could not connect to host
-mail-settings.google.com: did not receive HSTS header (error ignored - included regardless)
-mail.google.com: did not receive HSTS header (error ignored - included regardless)
-mail4geek.com: did not receive HSTS header
-mailchuck.com: could not connect to host
-maildragon.com: could not connect to host
-mailer-dot.de: did not receive HSTS header
-mailgarant.nl: could not connect to host
-mailhost.it: could not connect to host
-mailinabox.ml: could not connect to host
-mailing-femprendedores.com: did not receive HSTS header
-mailing-jbgg.com: could not connect to host
-mailjet.tech: did not receive HSTS header
-maillink.store: could not connect to host
-mailman.ml: could not connect to host
-mailon.ga: could not connect to host
-mailpenny.com: could not connect to host
-main-street-seo.com: did not receive HSTS header
-main-unit.com: did not receive HSTS header
-mainelosap.gov: did not receive HSTS header
-maintainerheaven.ch: could not connect to host
-maisalto.ind.br: could not connect to host
-maischances.com: did not receive HSTS header
-maitemerino.net: could not connect to host
-maitriser-son-stress.com: could not connect to host
-majesticcolorado.com: did not receive HSTS header
-majncloud.tk: could not connect to host
-majormedicalinsurance.online: did not receive HSTS header
-make-pizza.info: could not connect to host
-makedonien.guide: could not connect to host
-makedonija.net.mk: did not receive HSTS header
-makeit-so.de: could not connect to host
-makeitdynamic.com: could not connect to host
-makem-bounce.co.uk: did not receive HSTS header
-makemejob.com: could not connect to host
-makera.ga: could not connect to host
-makerstuff.net: could not connect to host
-makeshiftco.de: could not connect to host
-makeuplove.nl: could not connect to host
-makeyourlaws.org: could not connect to host
-makino.games: could not connect to host
-makogaming.com: could not connect to host
-makropa.com: did not receive HSTS header
-malamutedoalasca.com.br: could not connect to host
-maldiverna.guide: could not connect to host
-maleexcel.com: did not receive HSTS header
-malena.com.ua: could not connect to host
-malerversand.de: did not receive HSTS header
-malesbdsm.com: did not receive HSTS header
-malesoowki.blog: could not connect to host
-malfait.nl: could not connect to host
-malgraph.net: could not connect to host
-malibubeachrecoverycenter.com: could not connect to host
-malik.holdings: could not connect to host
-maljaars-fotografie.nl: did not receive HSTS header
-maljaars-media.nl: could not connect to host
-malkaso.com.ua: could not connect to host
-mallhonda.com: could not connect to host
-malmoesport.se: did not receive HSTS header
-malmstroms-co.se: could not connect to host
-malone.link: could not connect to host
-malphisruul.de: could not connect to host
-malpracticeattorney.online: did not receive HSTS header
-malscan.com: could not connect to host
-malscan.org: could not connect to host
-maltes.website: could not connect to host
-malvy.kiev.ua: could not connect to host
-malwar.ee: did not receive HSTS header
-malwar.eu: did not receive HSTS header
-malwareverse.us: could not connect to host
-malwr.ee: did not receive HSTS header
-malwre.io: could not connect to host
-maly.cz: did not receive HSTS header
-malya.fr: could not connect to host
-mamaasia.info: did not receive HSTS header
-mamabatataya.com: could not connect to host
-mamacobaby.com: could not connect to host
-mamadea.be: did not receive HSTS header
-mamafit.club: did not receive HSTS header
-mamaison.io: could not connect to host
-mamanura.tk: could not connect to host
-mamastore.eu: could not connect to host
-mamatting.com: did not receive HSTS header
-mamaxi.org: did not receive HSTS header
-mamiecouscous.com: could not connect to host
-mammothmail.com: could not connect to host
-mammothmail.net: could not connect to host
-mammothmail.org: could not connect to host
-mammut.space: could not connect to host
-mamoris-net.jp: did not receive HSTS header
-mamout.xyz: did not receive HSTS header
-manaboutahor.se: could not connect to host
-manage.zenpayroll.com: did not receive HSTS header
-manage4all.com: could not connect to host
-manageall.de: could not connect to host
-managed-varnish.de: could not connect to host
-manageforall.com: could not connect to host
-manageforall.de: could not connect to host
-management-ethics.com: did not receive HSTS header
-managemynetsuite.com: did not receive HSTS header
-manalu.cz: could not connect to host
-manantial.mx: could not connect to host
-manaonetrading.com: could not connect to host
-manav-it.de: could not connect to host
-manavgabhawala.com: could not connect to host
-mandala-ausmalbilder.de: could not connect to host
-mandanudes.ae: could not connect to host
-mandiblackburnphoto.com: could not connect to host
-mandm.servebeer.com: could not connect to host
-mandpress.com: did not receive HSTS header
-mangapoi.com: could not connect to host
-mangazuki.co: did not receive HSTS header
-mangel.io: did not receive HSTS header
-mangnhuapvc.com.vn: could not connect to host
-manhassetparkdistrictny.gov: did not receive HSTS header
-maniacoland.com: could not connect to host
-maniadeprazer.com.br: could not connect to host
-maniaiti.nz: could not connect to host
-manicminers.tk: could not connect to host
-manifestbin.com: could not connect to host
-manipulatedtme.com: did not receive HSTS header
-manitasicily.com: did not receive HSTS header
-maniw.com: could not connect to host
-mann-und-maeuse.de: could not connect to host
-mannford.com: did not receive HSTS header
-manningbrothers.com: did not receive HSTS header
-manns-solutions.com: did not receive HSTS header
-manns-solutions.ru: could not connect to host
-mannsolutions.co.uk: did not receive HSTS header
-manojsharan.me: could not connect to host
-manova.cz: could not connect to host
-manowarus.com: could not connect to host
-mansfieldplacevt.com: did not receive HSTS header
-manshop24.com: could not connect to host
-mansion-note.com: did not receive HSTS header
-mansiontech.cn: did not receive HSTS header
-mantenimientosenjardineriaypiscinasveracruz.com: could not connect to host
-mantra.pictures: could not connect to host
-mantuo.com: did not receive HSTS header
-mantuo.vip: could not connect to host
-mantuo.xyz: could not connect to host
-manududu.com.br: could not connect to host
-manuelahidalgo.org: could not connect to host
-manueldopheide.com: did not receive HSTS header
-manuelrueger.de: could not connect to host
-manure.com: did not receive HSTS header
-manuscript.com: could not connect to host
-manutrol.com.br: did not receive HSTS header
-manyetikboya.com: could not connect to host
-manyiu.com: could not connect to host
-manyue.org: did not receive HSTS header
-manzalud.com: could not connect to host
-maomao.blog: could not connect to host
-maomaobt.com: did not receive HSTS header
-maomaofuli.vip: could not connect to host
-maorseo.com: could not connect to host
-maosi.xin: could not connect to host
-maplanetebeaute.fr: did not receive HSTS header
-maple5.com: did not receive HSTS header
-maplehome.tk: could not connect to host
-maplenorth.co: could not connect to host
-mapservices.nl: did not receive HSTS header
-maquena.org: could not connect to host
-maquettage.com: did not receive HSTS header
-maquillage-permanent-tatoo.com: did not receive HSTS header
-maquininhamercadopoint.com.br: could not connect to host
-mara-martinez.de: did not receive HSTS header
-maranatha.pl: did not receive HSTS header
-marandu.com.ar: did not receive HSTS header
-marbinvest.com: did not receive HSTS header
-marcaudefroy.com: could not connect to host
-marcbeije.com: could not connect to host
-marcberman.co: did not receive HSTS header
-marcbuehlmann.com: did not receive HSTS header
-marcceleiro.cat: could not connect to host
-marcelmarnitz.com: could not connect to host
-marcelparra.com: could not connect to host
-marchagen.nl: did not receive HSTS header
-marche-nordic-jorat.ch: could not connect to host
-marchwj.pl: could not connect to host
-marciaimportados.com.br: could not connect to host
-marco-kretz.de: did not receive HSTS header
-marco01809.net: could not connect to host
-marcoececilia.it: could not connect to host
-marcofinke.de: could not connect to host
-marcohager.de: could not connect to host
-marcontrol.com: did not receive HSTS header
-marcosteixeira.tk: could not connect to host
-marcschlagenhauf.de: could not connect to host
-marcus-scheffler.com: could not connect to host
-marcush.de: did not receive HSTS header
-marcusserver.synology.me: could not connect to host
-mardelcupon.com: could not connect to host
-mare92.cz: could not connect to host
-marek.pro: did not receive HSTS header
-mareklecian.cz: did not receive HSTS header
-marelijah.org: could not connect to host
-margan.ch: could not connect to host
-margaretrosefashions.co.uk: could not connect to host
-margo.ml: could not connect to host
-margots.biz: could not connect to host
-margots.life: could not connect to host
-margots.tech: could not connect to host
-mariacorzo.com: could not connect to host
-mariacristinadoces.com.br: did not receive HSTS header
-mariage-photo.ch: could not connect to host
-mariannematthew.com: could not connect to host
-marianwehlus.de: did not receive HSTS header
-mariaolesen.dk: did not receive HSTS header
-marie-curie.fr: could not connect to host
-marie-en-provence.com: could not connect to host
-marie.club: could not connect to host
-mariehane.com: could not connect to host
-marienschule-sundern.de: did not receive HSTS header
-mariescountymo.gov: could not connect to host
-marinat2012.de: could not connect to host
-marine.gov: could not connect to host
-marinekaplama.com: could not connect to host
-marioberluchi.by: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-mariusschulte.de: did not receive HSTS header
-marix.ro: could not connect to host
-mark-a-hydrant.com: did not receive HSTS header
-mark-armstrong-gaming.com: could not connect to host
-markayapilandirma.com: did not receive HSTS header
-markcp.me: could not connect to host
-markdescande.com: did not receive HSTS header
-market.android.com: did not receive HSTS header (error ignored - included regardless)
-marketgot.com: could not connect to host
-marketia.ml: could not connect to host
-marketing-advertising.eu: could not connect to host
-marketing-apps.club: did not receive HSTS header
-marketing91.com: did not receive HSTS header
-marketingdesignu.cz: could not connect to host
-marketingeinnovacion.com: did not receive HSTS header
-marketingforfood.com: could not connect to host
-marketingsuite.tk: could not connect to host
-marketio.co: could not connect to host
-marketlinks.org: did not receive HSTS header
-marketnsight.com: did not receive HSTS header
-markf.io: could not connect to host
-markhenrick.site: did not receive HSTS header
-markholden.guru: could not connect to host
-markllego.com: could not connect to host
-marko-fenster24.de: could not connect to host
-markom.rs: did not receive HSTS header
-markorszulak.com: did not receive HSTS header
-markow.io: max-age too low: 7776000
-markrego.com: did not receive HSTS header
-markrobin.de: did not receive HSTS header
-markscastles.co.uk: could not connect to host
-marksill.com: could not connect to host
-marksmanhomes.com: did not receive HSTS header
-marksouthall.com: could not connect to host
-marktboten.de: could not connect to host
-marktplaatshelper.nl: did not receive HSTS header
-markus-dev.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-markusabraham.com: did not receive HSTS header
-markusgran.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-markvanacker.be: did not receive HSTS header
-marlen.cz: could not connect to host
-marleyresort.com: could not connect to host
-marlonschultz.de: did not receive HSTS header
-marmolrain.cl: did not receive HSTS header
-maroc-bivouac.com: did not receive HSTS header
-marocmail.ma: could not connect to host
-maroismasso.com: did not receive HSTS header
-marotero.com: did not receive HSTS header
-marqperso.ch: could not connect to host
-marquepersonnelle.ch: could not connect to host
-marquesgroup.net: max-age too low: 0
-marriottvetcareers.com: could not connect to host
-marsatapp.com: could not connect to host
-marshallford.me: could not connect to host
-marshut.net: could not connect to host
-marshyplay.live: could not connect to host
-marthasvillemo.gov: could not connect to host
-marti201.ga: could not connect to host
-martialc.be: could not connect to host
-martiert.com: could not connect to host
-martiestrimsalon.nl: could not connect to host
-martijnvhoof.nl: could not connect to host
-martin-arend.de: did not receive HSTS header
-martin-mattel.com: could not connect to host
-martin-smith.info: could not connect to host
-martindimitrov.cz: could not connect to host
-martinec.co.uk: could not connect to host
-martinestyle.com: could not connect to host
-martineve.com: did not receive HSTS header
-martingansler.de: did not receive HSTS header
-martinkup.cz: did not receive HSTS header
-martinp.no: could not connect to host
-martinrogalla.com: did not receive HSTS header
-martins.im: could not connect to host
-martynhare.co.uk: could not connect to host
-martynhare.uk: could not connect to host
-maru-life.com: did not receive HSTS header
-marumagic.com: could not connect to host
-marustat.ru: could not connect to host
-marvinkeller.de: did not receive HSTS header
-marvnet.cf: could not connect to host
-marvnet.de: did not receive HSTS header
-marvnet.digital: did not receive HSTS header
-marvnet.ga: could not connect to host
-marvnet.gq: could not connect to host
-marvnet.ml: could not connect to host
-marvnet.tk: could not connect to host
-marvnetdigit.al: did not receive HSTS header
-marvnetdigital.cf: could not connect to host
-marvnetdigital.ga: could not connect to host
-marvnetdigital.gq: could not connect to host
-marvnetdigital.ml: could not connect to host
-marvnetdigital.tk: could not connect to host
-marvnetforum.cf: could not connect to host
-marvnetforum.ga: could not connect to host
-marvnetforum.gq: could not connect to host
-marvnetforum.ml: could not connect to host
-marvnetforum.tk: could not connect to host
-marxist.party: could not connect to host
-marxmyths.org: could not connect to host
-marykshoup.com: could not connect to host
-masa-hou.com: did not receive HSTS header
-masa-yoga.com: did not receive HSTS header
-masa.li: did not receive HSTS header
-masatotaniguchi.jp: did not receive HSTS header
-masayahost.com: did not receive HSTS header
-mascorazon.com: could not connect to host
-mascotarios.org: did not receive HSTS header
-masha.one: did not receive HSTS header
-mashairi.co.ke: could not connect to host
-mashek.net: could not connect to host
-mashnew.com: could not connect to host
-masjidtawheed.net: could not connect to host
-maskice.hr: did not receive HSTS header
-maskt.pw: could not connect to host
-massage-well.ch: could not connect to host
-massagelimaperu.com: did not receive HSTS header
-massagetherapyschoolsinformation.com: did not receive HSTS header
-massar.family: could not connect to host
-massdrop.com: did not receive HSTS header
-massive.tk: could not connect to host
-massivum.de: did not receive HSTS header
-massoni.pl: did not receive HSTS header
-massot.eu: did not receive HSTS header
-massvow.com: could not connect to host
-mastafu.info: did not receive HSTS header
-mastah.fr: could not connect to host
-mastd.fr: could not connect to host
-mastd.onl: could not connect to host
-masteragenasia.com: did not receive HSTS header
-masteragenasia.net: did not receive HSTS header
-masterapi.ninja: did not receive HSTS header
-masterhaus.bg: did not receive HSTS header
-masterhelenaroma.com: did not receive HSTS header
-masteringtheterminal.com: did not receive HSTS header
-mastermindbusinesspro.com: did not receive HSTS header
-masternautconnect.com: did not receive HSTS header
-mastersquirrel.xyz: could not connect to host
-mastichor.info: could not connect to host
-mastiffingles.com.br: could not connect to host
-mastimtibetano.com: could not connect to host
-masto.io: did not receive HSTS header
-mastod.life: could not connect to host
-mastodon.blue: could not connect to host
-mastodon.co.nz: could not connect to host
-mastodon.direct: could not connect to host
-mastodon.engineering: could not connect to host
-mastodon.expert: could not connect to host
-mastodon.fun: could not connect to host
-mastodon.my: could not connect to host
-mastodon.org.uk: did not receive HSTS header
-mastodon.pl: could not connect to host
-mastodon.rocks: could not connect to host
-mastodones.club: did not receive HSTS header
-masty.nl: could not connect to host
-masumreza.tk: could not connect to host
-mat99.dk: could not connect to host
-matarrosabierzo.com: could not connect to host
-matcha-iga.jp: could not connect to host
-matchneedle.com: did not receive HSTS header
-matchpointusa.com: did not receive HSTS header
-matdogs.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-maternum.com: could not connect to host
-mateusmeyer.com.br: could not connect to host
-mateuszchyla.pl: could not connect to host
-mateuszpilszek.pl: could not connect to host
-matex-tokyo.co.jp: did not receive HSTS header
-mathalexservice.info: could not connect to host
-mathe.digital: did not receive HSTS header
-mathe.top: could not connect to host
-mathematris.com: could not connect to host
-mathembedded.com: did not receive HSTS header
-matheusmacedo.ddns.net: could not connect to host
-mathijskingma.nl: could not connect to host
-mathsource.ga: could not connect to host
-mathsweek.nz: did not receive HSTS header
-mathsweek.org.nz: did not receive HSTS header
-mathsweek.school.nz: did not receive HSTS header
-mati.gq: could not connect to host
-matillat.ovh: did not receive HSTS header
-matlabjo.ir: could not connect to host
-matmessages.com: did not receive HSTS header
-matomeplus.co: could not connect to host
-matrict.com: could not connect to host
-matrimoni.uk: could not connect to host
-matrip.de: could not connect to host
-matriterie-sdv.ro: could not connect to host
-matrix.ac: did not receive HSTS header
-matrixcheats.net: could not connect to host
-matsu-walk.com: did not receive HSTS header
-matsuz.com: could not connect to host
-matt.gd: could not connect to host
-matt.tf: did not receive HSTS header
-mattaki.tk: could not connect to host
-mattandreko.com: did not receive HSTS header
-mattbagley.me: did not receive HSTS header
-mattdbarton.com: could not connect to host
-matterconcern.com: could not connect to host
-mattessons.co.uk: could not connect to host
-matthecat.com: could not connect to host
-matthew-carson.info: could not connect to host
-matthewchapman.co.uk: did not receive HSTS header
-matthewemes.com: did not receive HSTS header
-matthewprenger.com: could not connect to host
-matthewtester.com: did not receive HSTS header
-matthiasadler.info: did not receive HSTS header
-matthiassteen.be: could not connect to host
-matthiasweiler.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-matthijssen.info: could not connect to host
-mattia98.org: did not receive HSTS header
-mattisam.com: did not receive HSTS header
-mattressinsider.com: max-age too low: 3153600
-mattwb65.com: did not receive HSTS header
-matty.digital: did not receive HSTS header
-matze.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-maultrom.ml: could not connect to host
-maupiknik.com: could not connect to host
-maur.cz: did not receive HSTS header
-mauricioquadradofotografia.com.br: did not receive HSTS header
-maurus-automation.de: did not receive HSTS header
-mausi.co: did not receive HSTS header
-mavisang.cf: could not connect to host
-mavobiz.at: did not receive HSTS header
-mavobiz.de: did not receive HSTS header
-mavoprax.at: did not receive HSTS header
-mavoprax.de: did not receive HSTS header
-mavora.at: did not receive HSTS header
-mavora.de: did not receive HSTS header
-mavotax.at: did not receive HSTS header
-mavotax.de: did not receive HSTS header
-mawe.red: could not connect to host
-mawidabp.com: did not receive HSTS header
-mawidaca.com: did not receive HSTS header
-mawulihotel.com: did not receive HSTS header
-max-mad.com: could not connect to host
-max00365.com: could not connect to host
-maxbachmann.de: did not receive HSTS header
-maxdev72.freeboxos.fr: could not connect to host
-maxfox.me: could not connect to host
-maxhamon.ovh: could not connect to host
-maxhoechtl.at: could not connect to host
-maxhorvath.com: could not connect to host
-maxibanki.ovh: could not connect to host
-maxicore.co.za: did not receive HSTS header
-maxima.at: did not receive HSTS header
-maximelouet.me: did not receive HSTS header
-maxkeller.io: did not receive HSTS header
-maxmachine.ind.br: could not connect to host
-maxmusical.ml: could not connect to host
-maxserver.com: did not receive HSTS header
-maxuniverse.de: did not receive HSTS header
-maxwellflynn.com: did not receive HSTS header
-maya-ro.com: could not connect to host
-maya.mg: could not connect to host
-maybeul.com: could not connect to host
-mayerbrownllz.com: could not connect to host
-maylamtoiden.asia: did not receive HSTS header
-maynardnetworks.com: could not connect to host
-mayoimobiliare.ro: could not connect to host
-mayoristassexshop.com: could not connect to host
-mazepa.ml: could not connect to host
-mazternet.ru: could not connect to host
-mazurlabs.tk: could not connect to host
-mazyun.com: could not connect to host
-mazz-tech.com: could not connect to host
-mb-is.info: did not receive HSTS header
-mbconsultancy.nu: could not connect to host
-mbdrogenbos-usedcars.be: could not connect to host
-mbilker.us: did not receive HSTS header
-mbits.solutions: did not receive HSTS header
-mbmcatering.com: did not receive HSTS header
-mbp.banking.co.at: did not receive HSTS header
-mbsec.net: did not receive HSTS header
-mbweir.com: could not connect to host
-mbwemmel-usedcars.be: could not connect to host
-mbwis.net: could not connect to host
-mc-ruempel-firmen-und-haushaltsaufloesungen.de: did not receive HSTS header
-mc-venture.net: could not connect to host
-mc007.xyz: could not connect to host
-mc4free.cc: could not connect to host
-mc81.com: did not receive HSTS header
-mca2017.org: did not receive HSTS header
-mcadmin.net: could not connect to host
-mcard.vn: did not receive HSTS header
-mcb-bank.com: did not receive HSTS header
-mcblain.ca: could not connect to host
-mcc.re: could not connect to host
-mccordworks.com: did not receive HSTS header
-mccurtainems.gov: could not connect to host
-mcdanieldevelopmentservices.com: could not connect to host
-mcdermottautomotive.com: could not connect to host
-mcdonalds.design: did not receive HSTS header
-mcdonalds.ru: did not receive HSTS header
-mcdsg.net: could not connect to host
-mcfipvt.com: could not connect to host
-mcga.media: could not connect to host
-mcgavocknissanwichitaparts.com: could not connect to host
-mchan.us: did not receive HSTS header
-mchopkins.net: could not connect to host
-mchuiji.com: could not connect to host
-mcideas.tk: could not connect to host
-mcit.gov.ws: did not receive HSTS header
-mcjackk77.com: did not receive HSTS header
-mcjackk77.me: could not connect to host
-mckenry.net: did not receive HSTS header
-mckinley1.com: could not connect to host
-mckinleytk.com: could not connect to host
-mclist.it: could not connect to host
-mclyr.com: could not connect to host
-mcnoobs.pro: could not connect to host
-mcooperlaw.com: did not receive HSTS header
-mcpart.land: could not connect to host
-mcpro.games: could not connect to host
-mcprocdn.com: could not connect to host
-mcqyy.com: could not connect to host
-mcs-kutc.com: did not receive HSTS header
-mcsa-usa.org: could not connect to host
-mcsniper.co: could not connect to host
-mcsnovatamabayan.com: could not connect to host
-mcstaralliance.com: could not connect to host
-mctherealm.net: could not connect to host
-mcuong.tk: could not connect to host
-mczo.net: did not receive HSTS header
-md-student.com: did not receive HSTS header
-mdazo.net: could not connect to host
-mdbouncycastlehirelondon.co.uk: could not connect to host
-mdcloudpracticesolutions.com: could not connect to host
-mdcloudps.com: did not receive HSTS header
-mdfnet.se: did not receive HSTS header
-mdg-online.de: did not receive HSTS header
-mdoering.de: did not receive HSTS header
-mds-paris.com: max-age too low: 2592000
-mdscomp.net: could not connect to host
-mdwftw.com: could not connect to host
-me-center.com: could not connect to host
-me-dc.com: could not connect to host
-me-groups.com: could not connect to host
-meadowfen.farm: could not connect to host
-meadowfenfarm.com: could not connect to host
-meadowviewfarms.org: could not connect to host
-mealgoo.com: did not receive HSTS header
-mealinsider.com: did not receive HSTS header
-meanevo.com: could not connect to host
-measuretwice.com: did not receive HSTS header
-meat-education.com: could not connect to host
-meathealth.com: could not connect to host
-mebio.us: did not receive HSTS header
-mec111.com: did not receive HSTS header
-mecanicadom.com: did not receive HSTS header
-mecenat-cassous.com: did not receive HSTS header
-med-otzyv.ru: could not connect to host
-medallia.io: could not connect to host
-medbreaker.one: did not receive HSTS header
-meddatix.com: could not connect to host
-mede-handover.azurewebsites.net: could not connect to host
-medecine-esthetique-du-calaisis.fr: did not receive HSTS header
-medellinapartamentos.com: could not connect to host
-medhy.fr: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-medi-link.co.il: did not receive HSTS header
-media-access.online: did not receive HSTS header
-media-courses.com: could not connect to host
-media-service.fr: did not receive HSTS header
-media-soft-pro.ru: could not connect to host
-media101.xyz: could not connect to host
-mediabm.jp: did not receive HSTS header
-mediacru.sh: could not connect to host
-mediadandy.com: did not receive HSTS header
-mediaexpert.fr: did not receive HSTS header
-mediafinancelab.org: could not connect to host
-mediagetnews.tk: could not connect to host
-mediamag.am: max-age too low: 0
-mediamaklumat.com: did not receive HSTS header
-mediarocks.de: did not receive HSTS header
-mediavamp.co.uk: max-age too low: 0
-mediavault.tech: could not connect to host
-mediawikicn.org: could not connect to host
-medicinasaludvida.com: did not receive HSTS header
-medicinesfast.com: could not connect to host
-medicinskavranje.edu.rs: could not connect to host
-medienservice-fritz.de: did not receive HSTS header
-medifab.online: did not receive HSTS header
-medifi.com: did not receive HSTS header
-medinacountyohio.gov: could not connect to host
-medirich.co: could not connect to host
-meditek-dv.ru: could not connect to host
-mediter-simplement.com: did not receive HSTS header
-mediterenopmaandag.nl: did not receive HSTS header
-meditest.in: did not receive HSTS header
-mediumraw.org: did not receive HSTS header
-mediweed.tk: could not connect to host
-medlabmediagroup.com: did not receive HSTS header
-medm-test.com: could not connect to host
-medpost.com: did not receive HSTS header
-medpot.net: did not receive HSTS header
-medsindex.com: did not receive HSTS header
-medstreaming.com: did not receive HSTS header
-medtankers.management: did not receive HSTS header
-medvezhii-ozera.ru: did not receive HSTS header
-medy-me.com: could not connect to host
-meeco.kr: did not receive HSTS header
-meedoennoordkop.nl: could not connect to host
-meedoenzaanstad.nl: did not receive HSTS header
-meehle.com: did not receive HSTS header
-meeko.cc: could not connect to host
-meereskunst.de: could not connect to host
-meet: could not connect to host
-meetfinch.com: could not connect to host
-meetingfriends.ch: did not receive HSTS header
-meetings2.com: did not receive HSTS header
-meetmibaby.co.uk: could not connect to host
-mega-aukcion.ru: could not connect to host
-mega-feeling.de: could not connect to host
-mega-key.eu: could not connect to host
-mega.nz: could not connect to host
-mega1.me: did not receive HSTS header
-megablogging.org: could not connect to host
-megadrol.com: could not connect to host
-megaflix.nl: could not connect to host
-megakiste.de: could not connect to host
-megalithe.co: did not receive HSTS header
-megam.host: could not connect to host
-megamarkey.de: did not receive HSTS header
-megapixelweb.com: did not receive HSTS header
-megapixelweb.fr: did not receive HSTS header
-megaplonk.com: could not connect to host
-megashur.se: could not connect to host
-megasslstore.com: did not receive HSTS header
-megasystem.cl: could not connect to host
-megaxhost.com.br: could not connect to host
-megh.biz: did not receive HSTS header
-megh.tv: could not connect to host
-meghudson.com: could not connect to host
-megustariasaber.com: did not receive HSTS header
-mehmetdursun.av.tr: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-meia.ir: could not connect to host
-meidens.com: did not receive HSTS header
-meifrench.com: did not receive HSTS header
-meikan.moe: could not connect to host
-meilleur.xyz: could not connect to host
-meimeistartup.com: could not connect to host
-mein-einszueins.de: did not receive HSTS header
-mein-webportal.de: did not receive HSTS header
-meincloudspeicher.de: did not receive HSTS header
-meine-plancha.ch: did not receive HSTS header
-meine-reise-gut-versichert.de: did not receive HSTS header
-meinebo.it: could not connect to host
-meinstartinsleben.com: could not connect to host
-meinstartinsleben.de: could not connect to host
-meiqia.cn: did not receive HSTS header
-meizufans.eu: could not connect to host
-mekatro.tech: could not connect to host
-mekongeye.com: did not receive HSTS header
-mekongmontessori.com: could not connect to host
-melakaltenegger.at: did not receive HSTS header
-melanfengshui.com: could not connect to host
-melangebrasil.com: could not connect to host
-melaniebernhardt.com: could not connect to host
-melaniebilodeau.com: did not receive HSTS header
-melbourneapartments.website: could not connect to host
-melbyjuliapak.com: could not connect to host
-melefo.ddns.net: could not connect to host
-melenchatsmelenchiens.fr: could not connect to host
-melerpaine.com: could not connect to host
-melf.nl: could not connect to host
-melhoresdominios.net: could not connect to host
-melhorproduto.com.br: could not connect to host
-melissaauclaire.com: could not connect to host
-melissaofficial.tk: could not connect to host
-melitopol.co.ua: did not receive HSTS header
-mellitus.org: could not connect to host
-melodic.com.au: could not connect to host
-melodicprogressivehouse.com: did not receive HSTS header
-melody-lyrics.com: could not connect to host
-melonstudios.net: could not connect to host
-melpomene.me: did not receive HSTS header
-melted.me: could not connect to host
-melted.pw: could not connect to host
-melvinlammerts.nl: could not connect to host
-melvinlow.com: could not connect to host
-memberpress.com: did not receive HSTS header
-members.mayfirst.org: did not receive HSTS header
-memberstweets.com: could not connect to host
-memdoc.org: could not connect to host
-memeblast.ninja: could not connect to host
-memepasmal.net: did not receive HSTS header
-memepasmal.org: could not connect to host
-memetrash.co.uk: could not connect to host
-memind.net: could not connect to host
-memory-plus-180.com: could not connect to host
-memorycards.ie: could not connect to host
-memorygame.io: did not receive HSTS header
-memorytrace.space: did not receive HSTS header
-menaraannonces.com: could not connect to host
-menchez.me: could not connect to host
-mendozagenevieve.com: could not connect to host
-mengliangyun.xyz: could not connect to host
-mengxin.life: could not connect to host
-menh.vn: could not connect to host
-menhadendefenders.org: did not receive HSTS header
-menkyo-blog.com: did not receive HSTS header
-menntagatt.is: did not receive HSTS header
-menomineemi.gov: did not receive HSTS header
-mensagensperfeitas.com.br: could not connect to host
-mensmaximus.de: did not receive HSTS header
-mentalhealth.gov: did not receive HSTS header
-mentax.net: did not receive HSTS header
-mentesemprendedoras.net: could not connect to host
-menthix.net: could not connect to host
-mentorithm.com: could not connect to host
-mentz.info: did not receive HSTS header
-menu.fyi: could not connect to host
-menudieta.com: did not receive HSTS header
-menudrivetest.com: could not connect to host
-menuel.me: could not connect to host
-menuiserie-berard.com: did not receive HSTS header
-menzaijia.com: did not receive HSTS header
-menzel-motors.com: did not receive HSTS header
-meow.cloud: could not connect to host
-meozcraft.com: could not connect to host
-mer.gd: could not connect to host
-mercadeolocal.com.ar: did not receive HSTS header
-mercadobitcoin.com.br: did not receive HSTS header
-mercadobitcoin.net: did not receive HSTS header
-mercanix.co.uk: could not connect to host
-merccorp.de: max-age too low: 0
-mercedes-benz-usedcars.be: could not connect to host
-mercedes-benz.io: did not receive HSTS header
-mercercountyohio.gov: could not connect to host
-mercury-studio.com: did not receive HSTS header
-mereckas.com: could not connect to host
-meredithkm.info: did not receive HSTS header
-meremobil.dk: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-mergozzo.com: did not receive HSTS header
-meridianfresno.com: could not connect to host
-meridianstore.com.br: could not connect to host
-merimatka.fi: could not connect to host
-meritz.rocks: could not connect to host
-merloat.club: could not connect to host
-mers.one: could not connect to host
-mersinunivercity.com: could not connect to host
-merson.me: could not connect to host
-mes10doigts.ovh: could not connect to host
-mesabi.ga: could not connect to host
-meshlab.co: did not receive HSTS header
-meshotes.com: max-age too low: 8640000
-meskdeals.com: could not connect to host
-mesmoque.com: did not receive HSTS header
-messagescelestes.ca: did not receive HSTS header
-mestr.es: did not receive HSTS header
-mesvt.com: could not connect to host
-meta.sc: did not receive HSTS header
-metadatawiki.com: did not receive HSTS header
-metadistribution.com: did not receive HSTS header
-metagrader.com: could not connect to host
-metanic.org: did not receive HSTS header
-metanic.services: could not connect to host
-metavetted.com: could not connect to host
-meteo-parc.com: could not connect to host
-meteo-r.ovh: could not connect to host
-meteosherbrooke.com: could not connect to host
-meteosky.net: did not receive HSTS header
-meter.md: could not connect to host
-metikam.pl: could not connect to host
-metin2sepeti.com: could not connect to host
-metis.pw: could not connect to host
-metrans-spedition.de: could not connect to host
-metricaid.com: did not receive HSTS header
-metrix-money-ptc.com: could not connect to host
-metrix.design: could not connect to host
-metrocarremovals.com: could not connect to host
-metroplex.me: did not receive HSTS header
-metropolisil.gov: did not receive HSTS header
-metzgerei-birkenhof.de: did not receive HSTS header
-meu-smartphone.com: did not receive HSTS header
-meu-solutions.com: did not receive HSTS header
-meuautotrac.com.br: did not receive HSTS header
-meubanco7.com.br: could not connect to host
-meuble-house.fr: did not receive HSTS header
-meubleko.com: did not receive HSTS header
-meucosmetico.com.br: could not connect to host
-meuemail.pro: could not connect to host
-meupainel.me: did not receive HSTS header
-meupedido.online: could not connect to host
-meusigno.com: could not connect to host
-mexbt.com: could not connect to host
-mexicanbusinessweb.mx: could not connect to host
-mexicansbook.ru: did not receive HSTS header
-mexicodental.co: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-mexior.nl: could not connect to host
-meyeraviation.com: could not connect to host
-meyerburger.com: did not receive HSTS header
-meys.io: could not connect to host
-mf302.com: did not receive HSTS header
-mf303.com: did not receive HSTS header
-mfacko.cz: did not receive HSTS header
-mfcatalin.com: could not connect to host
-mfedderke.com: could not connect to host
-mfgod.com: could not connect to host
-mfgusa.com: could not connect to host
-mfiles.pl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-mfpccprod.com: could not connect to host
-mfrsgb45.org: did not receive HSTS header
-mft.global: could not connect to host
-mfxer.com: could not connect to host
-mfxxx.cn: could not connect to host
-mfz.mk: did not receive HSTS header
-mgae.com: did not receive HSTS header
-mgdigital.fr: did not receive HSTS header
-mgiay.com: did not receive HSTS header
-mgknet.com: did not receive HSTS header
-mgmd.org: could not connect to host
-mgoessel.de: did not receive HSTS header
-mh-bloemen.co.jp: could not connect to host
-mhdsyarif.com: did not receive HSTS header
-mhealthdemocamp.com: could not connect to host
-mhertel.com: did not receive HSTS header
-mhict.nl: could not connect to host
-mhjuma.com: could not connect to host
-mhmfoundationrepair.com: could not connect to host
-mht-travel.com: could not connect to host
-mhx.pw: could not connect to host
-mia.ac: could not connect to host
-miamaibaum.com: did not receive HSTS header
-miamicityballet.org: did not receive HSTS header
-mianfei-vpn.com: could not connect to host
-miaololi.com: could not connect to host
-miaomiaomiao.live: could not connect to host
-miaonagemi.com: could not connect to host
-miaoubox.com: did not receive HSTS header
-miasarafina.de: could not connect to host
-miboulot.com: could not connect to host
-micado-software.com: could not connect to host
-micaiahparker.com: could not connect to host
-micasamgmt.com: did not receive HSTS header
-micelius.com: could not connect to host
-michael-schilling.de: did not receive HSTS header
-michael.band: could not connect to host
-michaelband.co: could not connect to host
-michaeldemuth.com: did not receive HSTS header
-michaeleichorn.com: could not connect to host
-michaelfitzpatrickruth.com: could not connect to host
-michaelklos.nl: could not connect to host
-michaelmorpurgo.com: did not receive HSTS header
-michaeln.net: could not connect to host
-michaels-homepage-service.de: could not connect to host
-michaelschule-rheine.de: did not receive HSTS header
-michaelscrivo.com: did not receive HSTS header
-michaelslatkine.com: did not receive HSTS header
-michaelsnoeren.nl: did not receive HSTS header
-michaelsulzer.com: did not receive HSTS header
-michaelsulzer.eu: did not receive HSTS header
-michaelwaite.org: could not connect to host
-michal-kral.cz: could not connect to host
-michalborka.cz: could not connect to host
-michalinastrzyz.xyz: could not connect to host
-michalklabnik.cz: could not connect to host
-michalkral.tk: could not connect to host
-michalp.pl: could not connect to host
-michalvasicek.cz: could not connect to host
-michasfahrschule.com: could not connect to host
-michel.pt: did not receive HSTS header
-michelledonelan.co.uk: did not receive HSTS header
-mico.world: could not connect to host
-micomi.co: could not connect to host
-miconware.de: could not connect to host
-micr.io: did not receive HSTS header
-micro-dv.ru: could not connect to host
-micro-rain-systems.com: did not receive HSTS header
-microblading.pe: could not connect to host
-microdesic.com: could not connect to host
-microfonejts.com.br: could not connect to host
-microlinks.org: did not receive HSTS header
-microlz.com: did not receive HSTS header
-microme.ga: could not connect to host
-micromind.io: could not connect to host
-micromookie.com: could not connect to host
-micropple.net: could not connect to host
-microtalk.org: could not connect to host
-middletowndelcopa.gov: did not receive HSTS header
-midi-ctes.fr: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-midirs.org: did not receive HSTS header
-midislandrealty.com: did not receive HSTS header
-mido.ga: could not connect to host
-midonet.org: did not receive HSTS header
-midress.club: could not connect to host
-midriversmotorsllc.com: did not receive HSTS header
-midt.io: did not receive HSTS header
-midwestplus.com: did not receive HSTS header
-midweststructuralrepair.com: could not connect to host
-midwestwomenworkers.org: could not connect to host
-midyatsaklibahce.com: did not receive HSTS header
-miele-katerini.gr: did not receive HSTS header
-miembarcacion.com: could not connect to host
-miemie.jp: could not connect to host
-mieterschutzkartei.de: could not connect to host
-mieuxvivreadarvoy.fr: could not connect to host
-mifibra.cl: did not receive HSTS header
-migeeks.de: did not receive HSTS header
-mightydicks.io: could not connect to host
-mightydicks.tech: could not connect to host
-mightymillionslottery.com: did not receive HSTS header
-mightymillionsraffle.com: did not receive HSTS header
-migrantskillsregister.org.uk: could not connect to host
-migrator.co: did not receive HSTS header
-miguelgfierro.com: did not receive HSTS header
-miguksaram.com: could not connect to host
-mihgroup.eu.org: could not connect to host
-mihijoesdislexico.es: did not receive HSTS header
-mijn-email.org: could not connect to host
-mijndiad.nl: did not receive HSTS header
-mijngeldcoach.nl: could not connect to host
-mijngiftshop.nl: did not receive HSTS header
-mijnkredietpaspoort.nl: could not connect to host
-mijnsite.ovh: could not connect to host
-mika.cat: could not connect to host
-mikadesign.se: did not receive HSTS header
-mikaelemilsson.net: could not connect to host
-mike-estela.com: did not receive HSTS header
-mikeblog.site: could not connect to host
-mikeburns.com: did not receive HSTS header
-mikedugan.org: did not receive HSTS header
-mikeg.de: did not receive HSTS header
-mikegarnett.co.uk: did not receive HSTS header
-mikehilldesign.co.uk: did not receive HSTS header
-mikek.work: did not receive HSTS header
-mikeology.org: could not connect to host
-mikepair.net: could not connect to host
-mikes.tk: did not receive HSTS header
-mikewest.org: did not receive HSTS header
-mikewritesstuff.com: could not connect to host
-mikeybailey.org: did not receive HSTS header
-mikeybot.com: could not connect to host
-mikhirev.ru: could not connect to host
-miki-boras.de: did not receive HSTS header
-mikii.club: could not connect to host
-mikk.cz: could not connect to host
-mikonmaa.fi: could not connect to host
-mikori.sk: did not receive HSTS header
-mikro-inwestycje.co.uk: could not connect to host
-mikroskeem.eu: did not receive HSTS header
-miku.be: could not connect to host
-miku.cloud: could not connect to host
-miku.hatsune.my: could not connect to host
-miku.party: could not connect to host
-mikumaycry.com: could not connect to host
-mikumiku.stream: could not connect to host
-mikupic.com: could not connect to host
-mikusa.xyz: could not connect to host
-mikusinec.com: could not connect to host
-mil0.com: could not connect to host
-milang.xyz: could not connect to host
-milanpala.cz: could not connect to host
-milatrans.pl: did not receive HSTS header
-milchbuchstabe.de: could not connect to host
-milcoresonline.com: could not connect to host
-milesgeek.com: did not receive HSTS header
-milionshop.sk: did not receive HSTS header
-military-portal.cz: did not receive HSTS header
-militaryaviationsafety.gov: did not receive HSTS header
-militaryconsumer.gov: did not receive HSTS header
-milkandcookies.ca: could not connect to host
-millennialbeekeeper.co.uk: could not connect to host
-millibitcoin.jp: could not connect to host
-million5.com: could not connect to host
-million6.com: could not connect to host
-million8.com: could not connect to host
-millionairessecrets.com: could not connect to host
-millions1.com: could not connect to host
-millions11.com: could not connect to host
-millions13.com: could not connect to host
-millions14.com: could not connect to host
-millions15.com: could not connect to host
-millions16.com: could not connect to host
-millions17.com: could not connect to host
-millions19.com: could not connect to host
-millions20.com: could not connect to host
-millions22.com: could not connect to host
-millions25.com: did not receive HSTS header
-millions26.com: did not receive HSTS header
-millions27.com: did not receive HSTS header
-millions28.com: did not receive HSTS header
-millions29.com: did not receive HSTS header
-millions31.com: could not connect to host
-millions32.com: could not connect to host
-millions33.com: could not connect to host
-millions35.com: could not connect to host
-millions36.com: could not connect to host
-millions37.com: could not connect to host
-millions38.com: could not connect to host
-millions39.com: could not connect to host
-millions40.com: did not receive HSTS header
-millions41.com: did not receive HSTS header
-millions42.com: did not receive HSTS header
-millions43.com: did not receive HSTS header
-millions5.com: could not connect to host
-millions50.com: did not receive HSTS header
-millions51.com: did not receive HSTS header
-millions52.com: did not receive HSTS header
-millions53.com: did not receive HSTS header
-millions55.com: could not connect to host
-millions56.com: did not receive HSTS header
-millions57.com: did not receive HSTS header
-millions58.com: did not receive HSTS header
-millions59.com: did not receive HSTS header
-millions6.com: could not connect to host
-millions60.com: did not receive HSTS header
-millions61.com: did not receive HSTS header
-millions62.com: did not receive HSTS header
-millions63.com: did not receive HSTS header
-millions66.com: could not connect to host
-millions7.com: could not connect to host
-millions70.com: could not connect to host
-millions71.com: could not connect to host
-millions72.com: could not connect to host
-millions77.com: could not connect to host
-millions8.com: could not connect to host
-millions80.com: could not connect to host
-millions81.com: could not connect to host
-millions82.com: could not connect to host
-millions88.com: could not connect to host
-millions9.com: could not connect to host
-millions99.com: could not connect to host
-milnes.org: max-age too low: 2592000
-milonga.tips: could not connect to host
-milsonhypnotherapyservices.com: did not receive HSTS header
-mim.properties: could not connect to host
-mimbeim.com: did not receive HSTS header
-mimm.gov: did not receive HSTS header
-mimobile.website: could not connect to host
-mimoderoupa.pt: could not connect to host
-mimusic.cf: could not connect to host
-min.kiwi: could not connect to host
-minacssas.com: could not connect to host
-minakova.pro: could not connect to host
-minantavla.se: could not connect to host
-mind-moves.es: could not connect to host
-mind.sh: did not receive HSTS header
-mindbodycontinuum.com: could not connect to host
-mindbodytherapymn.com: did not receive HSTS header
-mindcell.no: could not connect to host
-mindcraft.ga: could not connect to host
-mindercasso.nl: could not connect to host
-mindofmedia.dk: did not receive HSTS header
-mindox.com.br: could not connect to host
-mindsetatx.com: did not receive HSTS header
-mindseyesolutions.com: did not receive HSTS header
-mindvalley.com: did not receive HSTS header
-mindwork.space: could not connect to host
-mine.world: did not receive HSTS header
-minecraft-forum.cf: could not connect to host
-minecraft-forum.ga: could not connect to host
-minecraft-forum.gq: could not connect to host
-minecraft-forum.ml: could not connect to host
-minecraft-forums.cf: could not connect to host
-minecraft-forums.ga: could not connect to host
-minecraft-forums.gq: could not connect to host
-minecraft-ok.ru: did not receive HSTS header
-minecraftforum.ch: could not connect to host
-minecraftforums.cf: could not connect to host
-minecraftforums.gq: could not connect to host
-minecraftforums.ml: could not connect to host
-minecraftserverz.com: could not connect to host
-minecraftvoter.com: could not connect to host
-minei.me: could not connect to host
-minenash.com: did not receive HSTS header
-mineover.es: could not connect to host
-minepod.fr: did not receive HSTS header
-minetude.com: could not connect to host
-minfin.gov.ua: could not connect to host
-mingy.ddns.net: could not connect to host
-mingyueli.com: did not receive HSTS header
-minhanossasenhora.com.br: could not connect to host
-miniglueck.net: did not receive HSTS header
-minikneet.nl: did not receive HSTS header
-minimaliston.com: could not connect to host
-minimoo.se: could not connect to host
-minipainting.net: did not receive HSTS header
-miniskipper.at: did not receive HSTS header
-minivaro.de: could not connect to host
-minivehicle.tk: could not connect to host
-miniwallaby.com: could not connect to host
-minkondom.nu: could not connect to host
-minload.com: could not connect to host
-minnesotadata.com: could not connect to host
-minnesotamathcorps.org: did not receive HSTS header
-minobar.com: could not connect to host
-minora.io: could not connect to host
-minoris.se: did not receive HSTS header
-minoritywhip.gov: did not receive HSTS header
-mintea-noua.ro: could not connect to host
-mintosherbs.com: could not connect to host
-mipiaci.co.nz: did not receive HSTS header
-mipiaci.com.au: did not receive HSTS header
-mipla.ch: did not receive HSTS header
-mipueblohoy.com: could not connect to host
-mipymesenlinea.com: could not connect to host
-miragrow.com: did not receive HSTS header
-mirazonline.tk: could not connect to host
-mirazperu.tk: could not connect to host
-mireillewendling.com.br: could not connect to host
-mirete.info: did not receive HSTS header
-mirgleich.dnshome.de: could not connect to host
-mirindadomo.ru: did not receive HSTS header
-mirodasilva.be: did not receive HSTS header
-mironized.com: did not receive HSTS header
-mirrorbot.ga: could not connect to host
-mirrorsedgearchive.ga: could not connect to host
-mirrorx.com: could not connect to host
-miruc.co: did not receive HSTS header
-mirucon.com: did not receive HSTS header
-misakacloud.net: could not connect to host
-misconfigured.io: could not connect to host
-miscreant.me: could not connect to host
-misericordiasegrate.org: could not connect to host
-misgluteosperfectos.com: did not receive HSTS header
-misini.fr: could not connect to host
-misiondelosangeles-mailing.com: could not connect to host
-misiru.jp: could not connect to host
-mismart.vn: did not receive HSTS header
-misol.kr: did not receive HSTS header
-missevent.pl: could not connect to host
-missfuli.com: could not connect to host
-missjoias.com.br: could not connect to host
-misskey.site: could not connect to host
-misskey.xyz: could not connect to host
-missoy.me: could not connect to host
-missrain.tw: could not connect to host
-missycosmeticos.com.br: could not connect to host
-mist.ink: could not connect to host
-mister-cooks.fr: could not connect to host
-mister.hosting: did not receive HSTS header
-mistine.com.cn: could not connect to host
-mistinecn.com: did not receive HSTS header
-misura.re: could not connect to host
-misxvenelantro.com: could not connect to host
-mitabu.net: did not receive HSTS header
-mitaines.ch: could not connect to host
-mitarbeiter-pc.de: did not receive HSTS header
-mitchellrenouf.ca: could not connect to host
-mitiad.gq: could not connect to host
-mitigationcommission.gov: could not connect to host
-mitior.net: could not connect to host
-mitm-software.badssl.com: could not connect to host
-mitsign.com: could not connect to host
-mittagonghomestead.com.au: could not connect to host
-mittelunsachlich.de: could not connect to host
-mittenhacks.com: could not connect to host
-mittenofficesystems.com: could not connect to host
-mityinc.com: did not receive HSTS header
-miukimodafeminina.com: could not connect to host
-mivcon.net: could not connect to host
-mivestuariolaboral.com: did not receive HSTS header
-mivzaklive.co.il: did not receive HSTS header
-mixer.cash: could not connect to host
-mixnshake.com: did not receive HSTS header
-mixrepairs.co.uk: did not receive HSTS header
-mixtape.moe: did not receive HSTS header
-miya.io: could not connect to host
-miyako-kyoto.jp: could not connect to host
-miyoshi-kikaku.co.jp: could not connect to host
-mizd.at: could not connect to host
-mizi.name: could not connect to host
-mizipack.com: did not receive HSTS header
-mizumax.me: could not connect to host
-mjhsc.nl: did not receive HSTS header
-mjlaurindo.pt: could not connect to host
-mjmnagy.info: did not receive HSTS header
-mk-dizajn.com: could not connect to host
-mkacg.com: could not connect to host
-mkakh.com: did not receive HSTS header
-mkakh.xyz: could not connect to host
-mkfs.be: could not connect to host
-mkfs.fr: could not connect to host
-mkg-palais-hanau.de: did not receive HSTS header
-mkkkrc.ru: could not connect to host
-mklpedia.de: could not connect to host
-mkp-deutschland.de: did not receive HSTS header
-mkplay.io: could not connect to host
-mkw.st: could not connect to host
-mlan-server.de: did not receive HSTS header
-mlarte.com: could not connect to host
-mlcambiental.com.br: did not receive HSTS header
-mlcdn.co: did not receive HSTS header
-mlemay.com: did not receive HSTS header
-mlfaw.com: could not connect to host
-mlii.net: could not connect to host
-mlm-worldwide.de: did not receive HSTS header
-mlpchan.net: could not connect to host
-mlpepilepsy.org: could not connect to host
-mlpvc-rr.ml: did not receive HSTS header
-mlrslateroofing.com.au: did not receive HSTS header
-mlsrv.de: could not connect to host
-mlwr.ee: did not receive HSTS header
-mlxysf.com: did not receive HSTS header
-mm4447761.com: max-age too low: 0
-mm5197.co: could not connect to host
-mm6729.co: could not connect to host
-mm6729.com: did not receive HSTS header
-mm6957.co: could not connect to host
-mm9297.co: could not connect to host
-mm9397.com: could not connect to host
-mm9721.com: could not connect to host
-mm9728.co: could not connect to host
-mma-acareporting.com: did not receive HSTS header
-mmaps.ddns.net: could not connect to host
-mmarnitz.de: could not connect to host
-mmcc.pe: did not receive HSTS header
-mmgazhomeloans.com: could not connect to host
-mmilog.hu: could not connect to host
-mmmaximaliselmeny.hu: could not connect to host
-mmmm.com: could not connect to host
-mmpaymentsystem.com: did not receive HSTS header
-mmstick.tk: could not connect to host
-mna7e.com: did not receive HSTS header
-mnconsulting.xyz: did not receive HSTS header
-mncr.nl: could not connect to host
-mnec.io: could not connect to host
-mnedc.org: did not receive HSTS header
-mneeb.de: could not connect to host
-mneerup.dk: did not receive HSTS header
-mnemotiv.com: could not connect to host
-mnetworkingsolutions.co.uk: could not connect to host
-mnitro.com: could not connect to host
-mnml.jp: did not receive HSTS header
-mnmt.no: did not receive HSTS header
-mnnknz.de: could not connect to host
-mnszone.com: did not receive HSTS header
-mnt9.de: could not connect to host
-mnwt.nl: could not connect to host
-mo3.club: could not connect to host
-moabygg.se: could not connect to host
-moar.so: did not receive HSTS header
-moas.photos: could not connect to host
-mobag.ru: did not receive HSTS header
-mobaircon.com: could not connect to host
-mobi4.tk: could not connect to host
-mobidea.com: did not receive HSTS header
-mobilcom-debitel.de: did not receive HSTS header
-mobile-gesundheit.org: could not connect to host
-mobilebay.top: could not connect to host
-mobilecoach.com: did not receive HSTS header
-mobilekey.co: did not receive HSTS header
-mobilemalin.com: did not receive HSTS header
-mobileritelushi.com: could not connect to host
-mobilesector.de: could not connect to host
-mobilethreat.net: could not connect to host
-mobilethreatnetwork.net: could not connect to host
-mobilityworks.eu: did not receive HSTS header
-mobilpass.no: could not connect to host
-mobimalin.com: did not receive HSTS header
-mobisium.com: did not receive HSTS header
-mobiwalk.com: could not connect to host
-mobix5.com: could not connect to host
-mobl.io: could not connect to host
-mobmp4.co: could not connect to host
-mobmp4.com: could not connect to host
-mobmp4.info: could not connect to host
-mobot.sg: did not receive HSTS header
-mobsender.com: did not receive HSTS header
-mobycoders.com: could not connect to host
-mocarps.hk: could not connect to host
-mochiyuki.net: could not connect to host
-mochoko.com: could not connect to host
-mockmyapp.com: could not connect to host
-mocloud.eu: could not connect to host
-mocloud.win: could not connect to host
-mocsuite.club: could not connect to host
-modafinil.com: did not receive HSTS header
-modafinil.net: did not receive HSTS header
-modafinil.wiki: did not receive HSTS header
-modalrakyat.com: could not connect to host
-modalrakyat.id: did not receive HSTS header
-modaperuimport.com: could not connect to host
-modcasts.video: could not connect to host
-modded-minecraft-server-list.com: could not connect to host
-moddedark.com: could not connect to host
-mode-individuell.de: could not connect to host
-mode-marine.com: could not connect to host
-modecaso.com: could not connect to host
-modehaus-marionk.de: did not receive HSTS header
-model9.io: did not receive HSTS header
-modelcase.co.jp: did not receive HSTS header
-modelisme-voiture-rc.fr: did not receive HSTS header
-modellismo.roma.it: could not connect to host
-modelsclub.org.ua: could not connect to host
-modemagazines.co.uk: could not connect to host
-moderatorenpool.org: did not receive HSTS header
-moderatortv.de: did not receive HSTS header
-moderncoinmart.com: did not receive HSTS header
-modernibytovytextil.cz: could not connect to host
-moderntld.net: could not connect to host
-modistry.com: could not connect to host
-modistryusercontent.com: could not connect to host
-mododo.de: did not receive HSTS header
-modosaude.com.br: could not connect to host
-mods-community.de: could not connect to host
-mods-pic.de: did not receive HSTS header
-modul21.com: did not receive HSTS header
-modul21.eu: could not connect to host
-modx.by: did not receive HSTS header
-modx.io: could not connect to host
-modydev.club: could not connect to host
-moe.best: did not receive HSTS header
-moe.pe: could not connect to host
-moe.wtf: did not receive HSTS header
-moe4sale.in: did not receive HSTS header
-moeali.com: could not connect to host
-moebel-nagel.de: did not receive HSTS header
-moecraft.net: could not connect to host
-moefi.xyz: could not connect to host
-moegirl.org: did not receive HSTS header
-moeli.org: could not connect to host
-moellers.it: could not connect to host
-moellers.systems: did not receive HSTS header
-moeloli.pw: could not connect to host
-moelord.org: could not connect to host
-moen.io: did not receive HSTS header
-moenew.top: could not connect to host
-moens.tech: could not connect to host
-moepass.com: could not connect to host
-moeqing.net: could not connect to host
-moevenpick-cafe.com: did not receive HSTS header
-moeyoo.net: could not connect to host
-mofohome.dyndns.org: could not connect to host
-mogooin.com: did not receive HSTS header
-mogry.net: did not receive HSTS header
-mohio.co.nz: did not receive HSTS header
-moho.kr: could not connect to host
-mohs.es: could not connect to host
-moitur.com: did not receive HSTS header
-mojapraca.sk: could not connect to host
-mojarada.nl: did not receive HSTS header
-mojefilmy.xyz: could not connect to host
-mok.pw: could not connect to host
-mokadev.com: did not receive HSTS header
-mokeedev.review: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-mokken-fabriek.nl: did not receive HSTS header
-mokote.com: did not receive HSTS header
-mokum-organics.com: could not connect to host
-mold.world: could not connect to host
-molpek.com: could not connect to host
-mols.me: could not connect to host
-molusk.ml: could not connect to host
-momento.co.id: could not connect to host
-momfulfilled.com: could not connect to host
-momjoyas.com: did not receive HSTS header
-mommel.com: did not receive HSTS header
-mommelonline.de: could not connect to host
-momoka.moe: could not connect to host
-mon-a-lisa.com: did not receive HSTS header
-mon-mobile.com: did not receive HSTS header
-mona-dress.com: did not receive HSTS header
-mona.lu: could not connect to host
-monalisa.wtf: could not connect to host
-monarca.systems: could not connect to host
-monasterialis.eu: could not connect to host
-monautoneuve.fr: did not receive HSTS header
-mondar.io: could not connect to host
-mondedesnovels.com: did not receive HSTS header
-mondopoint.com: did not receive HSTS header
-mondwandler.de: could not connect to host
-monelephantapois.com: could not connect to host
-moneoci.com.br: could not connect to host
-moneromerchant.com: could not connect to host
-moneseglobal.com: could not connect to host
-moneycrownmedia.com: could not connect to host
-moneyfactory.gov: did not receive HSTS header
-moneylance.ru: did not receive HSTS header
-mongla168.net: could not connect to host
-mongla88.net: could not connect to host
-monicabeckstrom.no: did not receive HSTS header
-monika-sokol.de: did not receive HSTS header
-monique.io: could not connect to host
-monitaure.io: could not connect to host
-monitman.solutions: could not connect to host
-monitorchain.com: did not receive HSTS header
-monitori.ng: could not connect to host
-monitoringd.de: could not connect to host
-monkeyhill.us: could not connect to host
-monobank.no: did not receive HSTS header
-monochrometoys.com: could not connect to host
-monodukuri.cafe: could not connect to host
-monodukuri.com: did not receive HSTS header
-monodzukuri.cafe: could not connect to host
-monokoo.com: max-age too low: 2592000
-mononom.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-monospazzole.roma.it: could not connect to host
-monothesis.com: could not connect to host
-monotributo.online: did not receive HSTS header
-monotsuku.com: could not connect to host
-monozukuri.cafe: could not connect to host
-monpetitforfait.com: did not receive HSTS header
-monplay.host: could not connect to host
-monsecretariat.pro: could not connect to host
-montagne-tendance.ch: could not connect to host
-montanacures.org: could not connect to host
-montanana.com: did not receive HSTS header
-montand.com: did not receive HSTS header
-montazer.net: could not connect to host
-montenero.pl: did not receive HSTS header
-monteurzimmerfrei.de: could not connect to host
-montgomerysoccer.net: could not connect to host
-montonicms.com: could not connect to host
-moo.pet: did not receive HSTS header
-moobo.co.jp: could not connect to host
-moobo.xyz: could not connect to host
-moodforsex.com: could not connect to host
-moodifiers.com: did not receive HSTS header
-moodzshop.com: could not connect to host
-moojp.co.jp: could not connect to host
-moonagic.io: could not connect to host
-moonless.net: could not connect to host
-moonlightcapital.ml: could not connect to host
-moonloupe.com: could not connect to host
-moonrhythm.info: could not connect to host
-moonysbouncycastles.co.uk: could not connect to host
-mooremetrics.com: did not receive HSTS header
-mooretownrancheria-nsn.gov: did not receive HSTS header
-moosemanstudios.com: could not connect to host
-moov.is: could not connect to host
-moow.info: did not receive HSTS header
-moowcraft.eu: did not receive HSTS header
-moowdesign.eu: did not receive HSTS header
-mop321.com: max-age too low: 6307200
-moparcraft.com: could not connect to host
-moparcraft.org: could not connect to host
-moparisthebest.biz: could not connect to host
-moparisthebest.info: could not connect to host
-moparscape.org: did not receive HSTS header
-mopedpress.com: could not connect to host
-mople71.cz: could not connect to host
-mopsuite.club: could not connect to host
-mor.cloud: could not connect to host
-mor.gl: could not connect to host
-morchino.ch: could not connect to host
-moreapp.co.uk: could not connect to host
-morenci.ch: could not connect to host
-morepopcorn.co.nz: could not connect to host
-morespacestorage.com.au: did not receive HSTS header
-morethanadream.lv: could not connect to host
-moretti.camp: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-morfitronik.pl: could not connect to host
-morgancounty-al.gov: could not connect to host
-morgancountysheriffal.gov: could not connect to host
-morganestes.com: max-age too low: 0
-morgansjewelerspv.com: did not receive HSTS header
-morhys.com: could not connect to host
-morningcalculation.com: could not connect to host
-morninglory.com: did not receive HSTS header
-mornings.com: could not connect to host
-moroccomiami.com: could not connect to host
-morotech.com.br: did not receive HSTS header
-morpheusx.at: could not connect to host
-morpheusxaut.net: could not connect to host
-morphy2k.io: could not connect to host
-morpork.xyz: could not connect to host
-morrodafumacanoticias.com.br: did not receive HSTS header
-mortalincarnation.com: could not connect to host
-morteruelo.net: did not receive HSTS header
-mortgagecentersmo.com: did not receive HSTS header
-mosaique-lachenaie.fr: could not connect to host
-moshwire.com: could not connect to host
-moskva.guide: could not connect to host
-mosos.de: did not receive HSTS header
-mosshi.be: could not connect to host
-mosstier.com: did not receive HSTS header
-mostcomfortableworkboots.net: did not receive HSTS header
-mostlikelyto.fail: could not connect to host
-mostlyharmless.at: could not connect to host
-mostlyinfinite.com: did not receive HSTS header
-mostlymuttz.org: did not receive HSTS header
-mostlyoverhead.com: could not connect to host
-mostwuat.com: could not connect to host
-motd.today: did not receive HSTS header
-motherbase.io: could not connect to host
-motherboard.services: could not connect to host
-motionfreight.com: could not connect to host
-motionpicturesolutions.com: did not receive HSTS header
-motocollection.pl: did not receive HSTS header
-motomorgen.com: could not connect to host
-motorbiketourhanoi.com: could not connect to host
-motorcheck.ie: did not receive HSTS header
-motornomaslo.bg: did not receive HSTS header
-motoroilinfo.com: could not connect to host
-motorzone.od.ua: could not connect to host
-motovio.de: could not connect to host
-motscroises.cc: did not receive HSTS header
-mottvd.com: could not connect to host
-moube.fr: could not connect to host
-moudicat.com: did not receive HSTS header
-moula.com.au: did not receive HSTS header
-moumaobuchiyu.com: could not connect to host
-mountainadventureseminars.com: did not receive HSTS header
-mountainroseherbs.com: did not receive HSTS header
-mountairymd.gov: did not receive HSTS header
-mousemessages.com: did not receive HSTS header
-movabletype.net: did not receive HSTS header
-moveek.com: did not receive HSTS header
-moveisfit.com.br: could not connect to host
-movepin.com: could not connect to host
-movestub.com: could not connect to host
-movewellapp.com: did not receive HSTS header
-movie-cross.net: did not receive HSTS header
-movie4k.fyi: could not connect to host
-movie4k.life: could not connect to host
-movie4kto.site: did not receive HSTS header
-movie4kto.stream: could not connect to host
-movieboost.nl: could not connect to host
-moviedeposit.com: could not connect to host
-moviedollars.com: did not receive HSTS header
-movienang.com: max-age too low: 0
-moviepilot.com: did not receive HSTS header
-moviesabout.net: could not connect to host
-moviespur.info: did not receive HSTS header
-moviko.nz: could not connect to host
-movil.uno: could not connect to host
-moving-pixtures.de: could not connect to host
-movingoklahoma.org: could not connect to host
-movingtojapan.life: could not connect to host
-movio.ga: could not connect to host
-mowalls.net: could not connect to host
-moyer.pub: did not receive HSTS header
-moyideal.tk: could not connect to host
-moyoo.net: did not receive HSTS header
-moysovet.info: did not receive HSTS header
-moyu.host: did not receive HSTS header
-mozart-game.cz: could not connect to host
-mozartgame.cz: could not connect to host
-mozgb.ru: could not connect to host
-mozillians.org: did not receive HSTS header
-mozoa.net: could not connect to host
-mozzilla.cz: could not connect to host
-mp3donusturucu.com: could not connect to host
-mp3donusturucu.net: did not receive HSTS header
-mp3juices.is: could not connect to host
-mpe.org: did not receive HSTS header
-mpg-universal.com: did not receive HSTS header
-mpg.ovh: could not connect to host
-mphoto.at: did not receive HSTS header
-mpi-sa.fr: did not receive HSTS header
-mpkossen.com: did not receive HSTS header
-mpkshop.com.br: did not receive HSTS header
-mplicka.cz: did not receive HSTS header
-mplusm.eu: did not receive HSTS header
-mpn.poker: did not receive HSTS header
-mpnpokertour.com: did not receive HSTS header
-mpodraza.pl: could not connect to host
-mpreserver.com: could not connect to host
-mpserver12.org: could not connect to host
-mpsgarage.com.au: did not receive HSTS header
-mpu-giessen.com: could not connect to host
-mpy.ovh: could not connect to host
-mqas.net: could not connect to host
-mr-coffee.net: could not connect to host
-mr-designer-oman.com: did not receive HSTS header
-mr-hosting.com: could not connect to host
-mr-labo.jp: could not connect to host
-mr3.io: could not connect to host
-mrafrohead.com: could not connect to host
-mralonas.cf: could not connect to host
-mrawe.com: could not connect to host
-mrazek.biz: did not receive HSTS header
-mrburtbox.com: could not connect to host
-mrdani.net: could not connect to host
-mrdleisure.co.uk: could not connect to host
-mrettich.org: did not receive HSTS header
-mrgasfires.co.uk: did not receive HSTS header
-mrgiveaways.com: could not connect to host
-mrizzio.com: could not connect to host
-mrjbanksy.com: could not connect to host
-mrksk.com: could not connect to host
-mrliu.me: could not connect to host
-mrmoregame.de: could not connect to host
-mrnh.tk: could not connect to host
-mrning.com: could not connect to host
-mrpopat.in: did not receive HSTS header
-mrpropop.com: could not connect to host
-mrtunnel.club: could not connect to host
-mruganiepodspacja.pl: could not connect to host
-mrvnt.de: could not connect to host
-ms-alternativ.de: did not receive HSTS header
-msc-seereisen.net: could not connect to host
-mscenter.cf: could not connect to host
-mschuessler.org: could not connect to host
-mserve.ddns.net: could not connect to host
-msgallery.tk: could not connect to host
-mshemailmarketer.com.au: could not connect to host
-msp66.de: could not connect to host
-mstd.tokyo: did not receive HSTS header
-mstdn-tech.jp: could not connect to host
-mstdn.club: could not connect to host
-mstdn.fr: did not receive HSTS header
-mstdn.nl: could not connect to host
-mstiles92.com: could not connect to host
-msv-limpezas.pt: could not connect to host
-msz-fotografie.de: could not connect to host
-mszaki.com: did not receive HSTS header
-mt.me.uk: could not connect to host
-mt4programming.com: did not receive HSTS header
-mtamaki.com: could not connect to host
-mtau.com: max-age too low: 2592000
-mtb.wtf: could not connect to host
-mtd.ovh: could not connect to host
-mtdn.jp: could not connect to host
-mtfgnettoyage.fr: could not connect to host
-mtg-esport.de: did not receive HSTS header
-mtg-tutor.de: did not receive HSTS header
-mtirc.co: could not connect to host
-mtnz.co.za: did not receive HSTS header
-mtr.md: could not connect to host
-mu3on.com: could not connect to host
-muahahahaha.co.uk: could not connect to host
-mud-status.de: did not receive HSTS header
-mudgezero.one: could not connect to host
-mueblesemporium.com: could not connect to host
-muehlemann.net: did not receive HSTS header
-muel.io: could not connect to host
-muellapp.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-muenzubi.de: did not receive HSTS header
-muffet.pw: could not connect to host
-muga.space: could not connect to host
-muh.io: could not connect to host
-muj-svet.cz: did not receive HSTS header
-mujadin.se: did not receive HSTS header
-mujemail.ml: could not connect to host
-mukyu.moe: could not connect to host
-mulaisehat.com: could not connect to host
-mulenvo.com: did not receive HSTS header
-mullerimoveisrj.com.br: did not receive HSTS header
-multi-vpn.biz: could not connect to host
-multigamers-net.tk: could not connect to host
-multimail.work: could not connect to host
-multiplexcy.com: could not connect to host
-multivpn.cn.com: could not connect to host
-multivpn.com.de: could not connect to host
-multivpn.com.ua: could not connect to host
-multivpn.fr: could not connect to host
-multiworldsoftware.com: did not receive HSTS header
-multizone.games: could not connect to host
-muma.ml: could not connect to host
-mumei.space: did not receive HSTS header
-muminkoykiran.com: could not connect to host
-mundismart.com: could not connect to host
-mundoadulto.com.br: did not receive HSTS header
-mundoalpha.com.br: could not connect to host
-mundodapoesia.com: could not connect to host
-mundodoscarbonos.com.br: did not receive HSTS header
-mundogamers.top: could not connect to host
-mundosuiri.ml: could not connect to host
-munecoscabezones.com: did not receive HSTS header
-munich-rage.de: did not receive HSTS header
-munirajiwa.com: could not connect to host
-munkiepus.com: did not receive HSTS header
-munpanel.com: did not receive HSTS header
-munrabi.com: could not connect to host
-munuc.org: did not receive HSTS header
-munzee.com: did not receive HSTS header
-muoivancauhoivisao.com: could not connect to host
-muonium.ch: could not connect to host
-muratatifsayar.com.tr: could not connect to host
-murdercube.com: could not connect to host
-murfy.kiwi: could not connect to host
-muriburi.land: could not connect to host
-muriburiland.com: could not connect to host
-murodese.org: could not connect to host
-murphycraftbeerfest.com: did not receive HSTS header
-murraycoin.org: could not connect to host
-murraycolin.org: did not receive HSTS header
-murrayrun.com: did not receive HSTS header
-mursu.directory: could not connect to host
-murz.tv: could not connect to host
-murzik.space: could not connect to host
-musearchengine.com: could not connect to host
-museminder2.com: did not receive HSTS header
-museumstreak.com: could not connect to host
-musewearflipflops.com: could not connect to host
-mushfiqweb.com: did not receive HSTS header
-mushman.tk: could not connect to host
-mushroomandfern.com: could not connect to host
-musi.cx: could not connect to host
-musicaconleali.it: did not receive HSTS header
-musicalsoulfood.com: did not receive HSTS header
-musicapara.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-musiccitycats.com: did not receive HSTS header
-musicdemons.com: did not receive HSTS header
-musicsense.cf: could not connect to host
-musiikkiohjelmapalvelu.fi: did not receive HSTS header
-musikkfondene.no: did not receive HSTS header
-musikzug-bookholzberg.de: did not receive HSTS header
-musique2nuit.com: could not connect to host
-muslimbanter.co.za: could not connect to host
-muspla.com: could not connect to host
-muspla.com.br: could not connect to host
-musselsblog.com: could not connect to host
-mustafa.space: did not receive HSTS header
-mustika.cf: could not connect to host
-mustsellacarglobal.com: did not receive HSTS header
-mutamatic.com: could not connect to host
-mutantmonkey.sexy: could not connect to host
-muthai.in.th: could not connect to host
-mutuals.cool: could not connect to host
-mutuelle-obligatoire-pme.fr: did not receive HSTS header
-muusika.fun: could not connect to host
-muusikoiden.net: did not receive HSTS header
-muy.ooo: could not connect to host
-muzi.cz: could not connect to host
-muzykaprzeszladoplay.pl: could not connect to host
-mv-wohnen.de: could not connect to host
-mvanmarketing.nl: did not receive HSTS header
-mvbug.com: could not connect to host
-mvnet.com.br: could not connect to host
-mvp-stars.com: could not connect to host
-mvsecurity.nl: could not connect to host
-mvwoensei.com: could not connect to host
-mvwoensel.com: could not connect to host
-mwamitours.com: could not connect to host
-mwavuli.co.ke: could not connect to host
-mwezi-foundation.org: did not receive HSTS header
-mwezi.org: did not receive HSTS header
-mwohlfarth.de: did not receive HSTS header
-mwtdev.se: did not receive HSTS header
-mxawei.cn: could not connect to host
-mxdanggui.org: could not connect to host
-mxihan.xyz: could not connect to host
-mxn8.com: could not connect to host
-mxp.tw: did not receive HSTS header
-my-aftershave-store.co.uk: could not connect to host
-my-cdn.de: could not connect to host
-my-co.ir: did not receive HSTS header
-my-demo.co: could not connect to host
-my-news-portal.ru: could not connect to host
-my-owncloud.com: could not connect to host
-my-pawnshop.com.ua: could not connect to host
-my-plancha.ch: could not connect to host
-my-static-demo-808795.c.cdn77.org: could not connect to host
-my-static-live-808795.c.cdn77.org: could not connect to host
-my-voice.nl: could not connect to host
-my.alfresco.com: could not connect to host
-my.swedbank.se: did not receive HSTS header
-my.xero.com: did not receive HSTS header
-myairshop.gr: could not connect to host
-myandroid.tools: could not connect to host
-myandroidtools.cc: could not connect to host
-myandroidtools.pro: could not connect to host
-myappliancerepairhouston.com: did not receive HSTS header
-myartsway.com: did not receive HSTS header
-myaspenheights.com: did not receive HSTS header
-mybboard.pl: did not receive HSTS header
-mybeautyjobs.de: could not connect to host
-myblockchain.cloud: could not connect to host
-mybonfire.com: did not receive HSTS header
-mybreastcancerjourney.com: could not connect to host
-mybudget.xyz: could not connect to host
-mybuilderinlondon.co.uk: did not receive HSTS header
-mybus.ro: did not receive HSTS header
-mybusiness.cm: did not receive HSTS header
-mycamda.com: could not connect to host
-mycard.moe: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-mycarwashers.com: could not connect to host
-mychocolateweightloss.com: could not connect to host
-mycieokien.info: did not receive HSTS header
-myclasscam.com: did not receive HSTS header
-myclasscam.org: did not receive HSTS header
-myclientsplus.com: did not receive HSTS header
-mycollab.net: could not connect to host
-mycolorado.gov: could not connect to host
-mycompanion.cz: could not connect to host
-myconnect.cn: could not connect to host
-mycontrolmonitor.com: could not connect to host
-mycoted.com: did not receive HSTS header
-mycp668.com: could not connect to host
-mycreativeartsconsulting.com: could not connect to host
-mycuco.it: did not receive HSTS header
-myday.eu.com: did not receive HSTS header
-mydeos.com: could not connect to host
-mydigipass.com: could not connect to host
-mydjsongbook.com: max-age too low: 3600
-mydmdi.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-mydnaresults.com: could not connect to host
-mydnatest.com: did not receive HSTS header
-mydreamlifelab.com: could not connect to host
-mydreamshaadi.in: could not connect to host
-mydriversedge.com: did not receive HSTS header
-mydrone.services: did not receive HSTS header
-myedumundo.com: could not connect to host
-myeffect.today: did not receive HSTS header
-myeml.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-myepass.bg: could not connect to host
-myepass.de: could not connect to host
-myfappening.org: could not connect to host
-myfdic.gov: could not connect to host
-myfiladelfia.com: did not receive HSTS header
-myfishpalace.at: could not connect to host
-myfloridacfo.gov: could not connect to host
-myfloridadeferredcomp.com: did not receive HSTS header
-myfunworld.de: could not connect to host
-mygalgame.com: could not connect to host
-mygaysitges.com: could not connect to host
-mygivingcircle.org: did not receive HSTS header
-mygooder.com: could not connect to host
-mygov.scot: did not receive HSTS header
-mygpsite.com: did not receive HSTS header
-mygreatjob.eu: could not connect to host
-mygreatjobs.de: could not connect to host
-myhair.asia: did not receive HSTS header
-myhealthreviews.com: did not receive HSTS header
-myhloli.com: did not receive HSTS header
-myhostvm.com: could not connect to host
-myicare.org: could not connect to host
-myinjuryattorney.com: did not receive HSTS header
-myiocc.org: could not connect to host
-myip.tech: max-age too low: 2592000
-myipaddr.de: max-age too low: 10
-myjarofhope.com: did not receive HSTS header
-mykarelia.ga: could not connect to host
-mykolab.com: did not receive HSTS header
-mykreuzfahrt.de: could not connect to host
-mylighthost.com: did not receive HSTS header
-mylocalsearch.co.uk: did not receive HSTS header
-mymadina.com: did not receive HSTS header
-mymed.de: did not receive HSTS header
-mymed.eu: did not receive HSTS header
-mymotherlandstuffs.cn: did not receive HSTS header
-mymp3singer.co: did not receive HSTS header
-mymp3singer.net: could not connect to host
-mymp3singer.site: could not connect to host
-myms.eu: could not connect to host
-mymsr.de: did not receive HSTS header
-mymusiclist.alwaysdata.net: could not connect to host
-myndcommunication.com: could not connect to host
-mynetblog.com: did not receive HSTS header
-mynetworkingbuddy.com: could not connect to host
-mynewleaf.co: did not receive HSTS header
-mynewselfbariatrics.com: did not receive HSTS header
-myni.io: could not connect to host
-mynigma.org: did not receive HSTS header
-mynortherngarden.com: did not receive HSTS header
-myon.info: did not receive HSTS header
-myonlinedating.club: could not connect to host
-myonlinevehicleinsurance.com: could not connect to host
-myoregon.gov: did not receive HSTS header
-myownconference.cloud: did not receive HSTS header
-myownconference.net: did not receive HSTS header
-mypagella.com: could not connect to host
-mypagella.eu: could not connect to host
-mypagella.it: could not connect to host
-myparfumerie.at: did not receive HSTS header
-mypcqq.cc: did not receive HSTS header
-mypension.ca: could not connect to host
-myperfumecollection.com: did not receive HSTS header
-myphonebox.de: could not connect to host
-myphotos.ga: could not connect to host
-myproxy.eu.org: could not connect to host
-mypt3.com: did not receive HSTS header
-mypup.nl: did not receive HSTS header
-myqdu.cn: could not connect to host
-myqdu.com: could not connect to host
-myrig.com.ua: did not receive HSTS header
-myrig.io: could not connect to host
-myrig.net: could not connect to host
-myrig.ru: did not receive HSTS header
-myrsa.in: did not receive HSTS header
-myruststats.com: could not connect to host
-mysa.is: could not connect to host
-mysad.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-mysber.ru: did not receive HSTS header
-mysecretrewards.com: could not connect to host
-mysectools.org: did not receive HSTS header
-myseo.ga: could not connect to host
-myserv.one: could not connect to host
-myservice.store: could not connect to host
-myseu.cn: did not receive HSTS header
-myshirtsize.com: did not receive HSTS header
-mysize-condooms.nl: could not connect to host
-mysocialporn.com: could not connect to host
-mysongbird.xyz: did not receive HSTS header
-myspa.asia: did not receive HSTS header
-mystatus24.com: could not connect to host
-mystery-science-theater-3000.de: did not receive HSTS header
-mysticplumes.com: did not receive HSTS header
-mystown.org: could not connect to host
-mysupboard.de: did not receive HSTS header
-mytc.fr: could not connect to host
-mythengay.ch: did not receive HSTS header
-mythlogic.com: could not connect to host
-mythslegendscollection.com: did not receive HSTS header
-mytravelblog.de: could not connect to host
-mytravelog.ch: did not receive HSTS header
-myulog.net: did not receive HSTS header
-myunicornshops.com: could not connect to host
-myvpl.com: could not connect to host
-mywallets.io: could not connect to host
-myweb360.de: could not connect to host
-mywebinar.io: could not connect to host
-mywebmanager.co.uk: could not connect to host
-myweddingaway.co.uk: did not receive HSTS header
-myxbox.gr: max-age too low: 0
-mzh.io: did not receive HSTS header
-mzlog.win: could not connect to host
-mzzj.de: could not connect to host
-n-a.date: did not receive HSTS header
-n-rickroll-e.pw: could not connect to host
-n-soft.info: did not receive HSTS header
-n-x.info: could not connect to host
-n0rm.ru: could not connect to host
-n0s.de: did not receive HSTS header
-n2host.eu: could not connect to host
-n2servers.com: max-age too low: 86400
-n2x.in: could not connect to host
-n30365.com: could not connect to host
-n3ro.io: did not receive HSTS header
-n3ro.net: did not receive HSTS header
-n3twork.net: could not connect to host
-n4l.pw: could not connect to host
-n5118.com: could not connect to host
-n5197.co: could not connect to host
-n64chan.me: could not connect to host
-n6729.co: could not connect to host
-n6729.com: did not receive HSTS header
-n6957.co: could not connect to host
-n6957.com: did not receive HSTS header
-n888ok.com: could not connect to host
-n8ta.com: did not receive HSTS header
-n9297.co: could not connect to host
-n9397.com: could not connect to host
-n9721.com: could not connect to host
-n9728.co: could not connect to host
-na.hn: could not connect to host
-naam.me: could not connect to host
-naano.org: could not connect to host
-naarakah.fr: did not receive HSTS header
-nabbar.com: did not receive HSTS header
-nabru.co.uk: did not receive HSTS header
-nabu-bad-nauheim.de: did not receive HSTS header
-nabytko.cz: could not connect to host
-nac-6.fr: did not receive HSTS header
-nachtmuziek.info: could not connect to host
-nacktwanderfreunde.de: did not receive HSTS header
-nadia.pt: could not connect to host
-nadoske.info: did not receive HSTS header
-naga.im: did not receive HSTS header
-nagajanroshiya.info: could not connect to host
-naganithin.me: could not connect to host
-nagaragem.com.br: did not receive HSTS header
-nagb.org: did not receive HSTS header
-naggie.net: could not connect to host
-nagios.by: did not receive HSTS header
-nagoya-kyuyo.com: could not connect to host
-nagrad.tk: could not connect to host
-nahura.com: could not connect to host
-naiaspa.fr: did not receive HSTS header
-naidonline.org: did not receive HSTS header
-naiharngym.com: did not receive HSTS header
-naijaxnet.com.ng: could not connect to host
-nais.me: could not connect to host
-nais0ne.com: did not receive HSTS header
-naive.network: could not connect to host
-najany.de: could not connect to host
-najany.dk: could not connect to host
-najany.fr: could not connect to host
-najany.nl: could not connect to host
-najany.se: could not connect to host
-nakada4610.com: could not connect to host
-nakamastreamingcommunity.com: could not connect to host
-nakanishi-paint.com: could not connect to host
-nakedalarmclock.me: could not connect to host
-nakhonidc.com: could not connect to host
-nakitbonus2.com: could not connect to host
-nakladki.su: did not receive HSTS header
-nakliyatsirketi.biz: could not connect to host
-nakuro.de: could not connect to host
-nalao-company.com: did not receive HSTS header
-nalifornia.com: max-age too low: 0
-nalinux.cz: could not connect to host
-nallon.com.br: could not connect to host
-nalukfitness.com.br: could not connect to host
-namacindia.com: did not receive HSTS header
-namaho.com: could not connect to host
-namazon.org: could not connect to host
-named.ga: could not connect to host
-nameme.xyz: could not connect to host
-namethatbone.com: could not connect to host
-namethissymbol.com: could not connect to host
-nami.bo: could not connect to host
-namikawatetsuji.jp: could not connect to host
-namorico.me: could not connect to host
-namuwikiusercontent.com: could not connect to host
-nan.zone: could not connect to host
-nanami.moe: did not receive HSTS header
-nanderson.me: could not connect to host
-nanfangstone.com: could not connect to host
-nange.co: could not connect to host
-nani.io: could not connect to host
-naniki.co.uk: could not connect to host
-nanofy.org: could not connect to host
-nanogeneinc.com: could not connect to host
-nanogi.ga: could not connect to host
-nanokamo.com: did not receive HSTS header
-nanollet.org: could not connect to host
-nanosingularity.com: could not connect to host
-nanovolt.nl: could not connect to host
-nanrenba.net: could not connect to host
-nanto.eu: did not receive HSTS header
-naoar.com: could not connect to host
-naphex.rocks: could not connect to host
-naphogar.com: did not receive HSTS header
-napiki.pl: did not receive HSTS header
-napisynapomniky.cz: did not receive HSTS header
-napkins-wholesale.us: could not connect to host
-napolinissanctparts.com: could not connect to host
-nappynko.com: did not receive HSTS header
-narach.com: did not receive HSTS header
-narada.com.ua: could not connect to host
-narardetval.se: could not connect to host
-narodniki.com: could not connect to host
-narodsovety.ru: did not receive HSTS header
-narviz.com: did not receive HSTS header
-nasarawanewsonline.com: could not connect to host
-nascio.org: did not receive HSTS header
-naseco.se: did not receive HSTS header
-naseehah.ga: could not connect to host
-nashvillesheriff.gov: could not connect to host
-nasme.tk: did not receive HSTS header
-nasmocopati.com: could not connect to host
-naspro.ru: did not receive HSTS header
-nasralmabrooka.com: did not receive HSTS header
-nasserver-test.de: did not receive HSTS header
-nassi.me: could not connect to host
-nastysclaw.com: could not connect to host
-natalia-fadeeva.ru: could not connect to host
-natalia.io: did not receive HSTS header
-natalieandjoshua.com: could not connect to host
-natalt.org: did not receive HSTS header
-nataniel-perissier.fr: could not connect to host
-natarius.tk: could not connect to host
-natatorium.org: did not receive HSTS header
-natcheflife.co.uk: did not receive HSTS header
-nate.sh: could not connect to host
-nathan.io: could not connect to host
-nathumarket.com.br: could not connect to host
-nationalmall.gov: could not connect to host
-nationalpassportservice.info: could not connect to host
-nationaltaxprep.com: did not receive HSTS header
-nationwiderealtyinvestors.com: did not receive HSTS header
-nationwidevehiclecontracts.co.uk: did not receive HSTS header
-nativeonestop.gov: did not receive HSTS header
-nattiam.com: could not connect to host
-natur-udvar.hu: could not connect to host
-natural-progesterone.net: could not connect to host
-naturalcommission.com: could not connect to host
-naturblogg.no: did not receive HSTS header
-nature-et-bio.fr: could not connect to host
-nature-shots.net: could not connect to host
-naturecoaster.com: did not receive HSTS header
-natureword.com: did not receive HSTS header
-natuterra.com.br: could not connect to host
-natuurbehangnederland.nl: could not connect to host
-nauck.org: did not receive HSTS header
-naudles.me: could not connect to host
-naughtytoy.co.uk: did not receive HSTS header
-nav.jobs: could not connect to host
-naval.tf: could not connect to host
-navegos.net: did not receive HSTS header
-naviaddress.io: could not connect to host
-navigate-it-services.de: did not receive HSTS header
-naviteq.eu: could not connect to host
-navitime.me: could not connect to host
-navjobs.com: could not connect to host
-navstivime.cz: did not receive HSTS header
-nawroth.info: could not connect to host
-nax.io: did not receive HSTS header
-nay.moe: could not connect to host
-nazigol.com: did not receive HSTS header
-nazuna.blue: could not connect to host
-nb10000.vip: max-age too low: 0
-nba-croatia.com: could not connect to host
-nba2kqq.com: could not connect to host
-nbb.io: did not receive HSTS header
-nbg-ha.de: could not connect to host
-nbgrooves.de: did not receive HSTS header
-nbis.gov: could not connect to host
-nbl.org.tw: could not connect to host
-nbm.gov: could not connect to host
-nbnnetwork.com: could not connect to host
-nbp.com.pk: did not receive HSTS header
-nbrain.de: could not connect to host
-nbriresearch.com: could not connect to host
-nbrown.us: could not connect to host
-nbtparse.org: did not receive HSTS header
-nbur.co.uk: did not receive HSTS header
-nc-network.io: could not connect to host
-nc2c.com: could not connect to host
-nca.ink: could not connect to host
-ncamarquee.co.uk: could not connect to host
-ncaq.net: did not receive HSTS header
-ncc60205.info: could not connect to host
-ncdesigns-studio.com: did not receive HSTS header
-nchristo.com: could not connect to host
-ncic.gg: could not connect to host
-nclvle.co.uk: did not receive HSTS header
-ncm-malerbetrieb.de: did not receive HSTS header
-ncmedicaidplan.gov: could not connect to host
-ncmedicaidplans.gov: did not receive HSTS header
-ncpc.gov: could not connect to host
-ncpimd001.spdns.de: could not connect to host
-ncpw.gov: could not connect to host
-ncrmnt.org: did not receive HSTS header
-ncstep.org: did not receive HSTS header
-nct.org.uk: did not receive HSTS header
-ndatc.com: did not receive HSTS header
-ndhlink.com: could not connect to host
-ndime.com: did not receive HSTS header
-ndmath.club: could not connect to host
-ndpbrn-research.org: could not connect to host
-ndtblog.com: could not connect to host
-ndtmarket.place: could not connect to host
-ne1home.dyndns.org: did not receive HSTS header
-neap.io: could not connect to host
-near.st: did not receive HSTS header
-nearbi.com.mx: could not connect to host
-nearbiwa.com: did not receive HSTS header
-neavision.de: could not connect to host
-nebl.cash: could not connect to host
-nebra.io: could not connect to host
-nebracy.com: could not connect to host
-nebulousenhanced.com: could not connect to host
-nebuluxcapital.com: could not connect to host
-necesitodinero.org: did not receive HSTS header
-nechiactua.com: could not connect to host
-necio.ca: could not connect to host
-nedcf.org.uk: could not connect to host
-nediyor.com: did not receive HSTS header
-nedwave.com: could not connect to host
-nedys.top: could not connect to host
-needle.net.nz: could not connect to host
-needle.nz: could not connect to host
-neels.ch: did not receive HSTS header
-neer.io: could not connect to host
-neet-investor.biz: could not connect to host
-neffat.si: did not receive HSTS header
-neftaly.com: did not receive HSTS header
-neftebitum-kngk.ru: did not receive HSTS header
-neg9.org: could not connect to host
-negativzinsen.info: did not receive HSTS header
-negraelinda.com: did not receive HSTS header
-neilgreen.net: did not receive HSTS header
-neilshealthymeals.com: did not receive HSTS header
-neio.uk: could not connect to host
-nejkasy.cz: did not receive HSTS header
-nejnamc.org: did not receive HSTS header
-neko-life.com: did not receive HSTS header
-neko.li: could not connect to host
-neko.ml: did not receive HSTS header
-nekoku.io: could not connect to host
-nekolove.jp: could not connect to host
-nekomio.com: did not receive HSTS header
-nekox.ml: could not connect to host
-nella-project.org: could not connect to host
-nella.io: could not connect to host
-nellacms.com: could not connect to host
-nellacms.org: could not connect to host
-nellafw.org: could not connect to host
-nemanja.top: could not connect to host
-nemausus.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-nemecl.eu: could not connect to host
-nemno.de: could not connect to host
-nemovement.org: could not connect to host
-nemplex.win: could not connect to host
-nengzhen.com.cn: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-neoani.me: could not connect to host
-neocoding.com: could not connect to host
-neocyd.com: could not connect to host
-neoeliteconsulting.com: could not connect to host
-neofelhz.space: could not connect to host
-neofilia.tk: could not connect to host
-neohu.com: could not connect to host
-neojames.me: could not connect to host
-neokobe.city: could not connect to host
-neolink.dk: could not connect to host
-neonisi.com: could not connect to host
-neonnuke.tech: could not connect to host
-neotist.com: did not receive HSTS header
-neowa.tk: could not connect to host
-nepageeks.com: did not receive HSTS header
-nephos.xyz: could not connect to host
-neppglobal.top: could not connect to host
-nercp.org.uk: did not receive HSTS header
-nerd42.de: did not receive HSTS header
-nerdbox.cc: did not receive HSTS header
-nerdinator.ddns.net: could not connect to host
-nerdjokes.de: could not connect to host
-nerdoutstudios.tv: could not connect to host
-nerfroute.com: could not connect to host
-neris.io: could not connect to host
-neriumhcp.com: did not receive HSTS header
-nert.gq: could not connect to host
-nerull7.info: could not connect to host
-nesantuoka.lt: could not connect to host
-nesbase.com: could not connect to host
-nesterov.pw: could not connect to host
-nestone.ru: could not connect to host
-net-combo-ja.com: did not receive HSTS header
-net-masters.pl: could not connect to host
-net-navi.cc: did not receive HSTS header
-net-rencontre.com: did not receive HSTS header
-net-share.de: did not receive HSTS header
-net2o.com: did not receive HSTS header
-net2o.de: did not receive HSTS header
-net2o.net: did not receive HSTS header
-net4it.de: did not receive HSTS header
-netba.net: could not connect to host
-netbox.cc: could not connect to host
-netbrief.ml: could not connect to host
-netde.jp: could not connect to host
-netdego.jp: could not connect to host
-netducks.space: could not connect to host
-netexem.com: did not receive HSTS header
-netguide.co.nz: did not receive HSTS header
-netherwind.eu: did not receive HSTS header
-nethunter.top: could not connect to host
-netid.de: did not receive HSTS header
-netlilo.com: could not connect to host
-netloanusa.com: could not connect to host
-netmagik.com: did not receive HSTS header
-netresourcedesign.com: could not connect to host
-netsafeid.biz: did not receive HSTS header
-netscaler.expert: could not connect to host
-netsecma.com: could not connect to host
-netsight.org: could not connect to host
-netsparkercloud.com: did not receive HSTS header
-netsystems.pro: could not connect to host
-nettacompany.com.tr: did not receive HSTS header
-nettefoundation.com: could not connect to host
-nettopower.dk: did not receive HSTS header
-nettoyage.email: could not connect to host
-nettplusultra-rhone.fr: did not receive HSTS header
-netube.org: could not connect to host
-netulo.com: could not connect to host
-netvpn.ml: could not connect to host
-netwaf.com: could not connect to host
-networkersdiary.com: did not receive HSTS header
-networkhane.com: did not receive HSTS header
-networking-groups.co.uk: could not connect to host
-networkmas.com: could not connect to host
-networx-online.de: did not receive HSTS header
-netzbit.de: could not connect to host
-netztest.at: did not receive HSTS header
-netzvieh.de: could not connect to host
-netzzwerg4u.de: did not receive HSTS header
-neuber.uno: could not connect to host
-neueonlinecasino2016.com: could not connect to host
-neuhaus-city.de: could not connect to host
-neuralgic.net: could not connect to host
-neuro-plus-100.com: could not connect to host
-neuroethics.com: did not receive HSTS header
-neurogroove.info: did not receive HSTS header
-neurolab.no: could not connect to host
-neuronasdigitales.com: did not receive HSTS header
-neuronfactor.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-neutralvehicle.com: did not receive HSTS header
-nevadafiber.net: could not connect to host
-nevalogic.com: could not connect to host
-neverwetturkey.com: could not connect to host
-neveta.com: could not connect to host
-new: could not connect to host
-new.travel.pl: did not receive HSTS header
-newantiagingcreams.com: could not connect to host
-newbieboss.com: did not receive HSTS header
-newbownerton.xyz: could not connect to host
-newburghhistoryblog.com: did not receive HSTS header
-newcab.de: did not receive HSTS header
-newchance.store: could not connect to host
-newcityinfo.info: could not connect to host
-newcreamforface.com: could not connect to host
-newdeveloper.download: could not connect to host
-newedivideo.it: could not connect to host
-newfacialbeautycream.com: could not connect to host
-newgenerationplus.org: could not connect to host
-newgraphics.by: did not receive HSTS header
-newhdmovies.io: could not connect to host
-newhopeplacement.com: did not receive HSTS header
-newhoperailroad.com: did not receive HSTS header
-newjianzhi.com: could not connect to host
-newlifehempoil.com: did not receive HSTS header
-newlooknow.com: did not receive HSTS header
-newmovements.net: could not connect to host
-newparadigmventures.net: did not receive HSTS header
-newpathintegratedtherapy.com: did not receive HSTS header
-newpoke.net: did not receive HSTS header
-newportpropertygroup.com: could not connect to host
-news4c.com: did not receive HSTS header
-newsa2.com: could not connect to host
-newsaboutgames.de: could not connect to host
-newserumforskin.com: could not connect to host
-newsquantified.com: max-age too low: 0
-newstargeted.com: did not receive HSTS header
-newstarnootropics.com: could not connect to host
-newstone-tech.com: could not connect to host
-newtnote.com: could not connect to host
-newtonhaus.com: could not connect to host
-newtonwarp.com: could not connect to host
-newworldnewlife.tk: could not connect to host
-nexlab.org: did not receive HSTS header
-next-server.eu: could not connect to host
-next47.com: did not receive HSTS header
-nextads.ch: could not connect to host
-nextcasino.com: did not receive HSTS header
-nextcloud-miyamoto.spdns.org: did not receive HSTS header
-nextcloud.co.za: did not receive HSTS header
-nextclouddarwinkel.nl: could not connect to host
-nextend.org: could not connect to host
-nextgen.sk: could not connect to host
-nextgencel.com: did not receive HSTS header
-nexth.de: could not connect to host
-nexth.net: did not receive HSTS header
-nexth.us: could not connect to host
-nexthop.co.th: did not receive HSTS header
-nextpages.de: could not connect to host
-nextpost.company: did not receive HSTS header
-nextproject.us: could not connect to host
-nextrobotics.de: did not receive HSTS header
-nextshutter.com: did not receive HSTS header
-nexus-vienna.at: could not connect to host
-nexusbyte.de: could not connect to host
-nexuscorporation.in: could not connect to host
-nezvestice.cz: did not receive HSTS header
-nf4.net: could not connect to host
-nfhome.be: did not receive HSTS header
-nfir.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-nflchan.org: could not connect to host
-nfls.io: could not connect to host
-nflsic.org: could not connect to host
-nfluence.org: could not connect to host
-nfo.so: did not receive HSTS header
-nfrost.me: could not connect to host
-ng-firewall.com: did not receive HSTS header
-ng-security.com: could not connect to host
-ngiemboon.net: could not connect to host
-ngine.ch: could not connect to host
-nginxnudes.com: could not connect to host
-nginxyii.tk: could not connect to host
-ngla.gov: could not connect to host
-nglr.org: could not connect to host
-ngndn.jp: could not connect to host
-ngocuong.net: could not connect to host
-ngt-service.ru: did not receive HSTS header
-ngtoys.com.br: could not connect to host
-nhccnews.org: could not connect to host
-nhgteam.hu: could not connect to host
-nhhoteljobs.nl: could not connect to host
-nhliberty.org: did not receive HSTS header
-nhsuites.com: did not receive HSTS header
-niallator.com: could not connect to host
-nibiisclaim.com: could not connect to host
-nicaise.ca: did not receive HSTS header
-nice.im: did not receive HSTS header
-nicestresser.fr: could not connect to host
-nickcleans.co.uk: could not connect to host
-nicklord.com: could not connect to host
-nickmertin.ca: did not receive HSTS header
-nicktheitguy.com: could not connect to host
-nickx.cn: could not connect to host
-nicky.io: could not connect to host
-nico.one: could not connect to host
-nico.today: could not connect to host
-nicoborghuis.nl: could not connect to host
-nicolaeiotcu.ro: could not connect to host
-nicolaelmer.ch: did not receive HSTS header
-nicolasbettag.me: did not receive HSTS header
-nicolasdutour.com: did not receive HSTS header
-nicolashess.de: did not receive HSTS header
-nicolasklotz.de: did not receive HSTS header
-nicoleoquendo.com: max-age too low: 2592000
-niconico.ooo: could not connect to host
-niconiconi.xyz: could not connect to host
-nicoobook.com: did not receive HSTS header
-nicoobook.net: could not connect to host
-nicorevin.ru: could not connect to host
-nidux.com: did not receive HSTS header
-niduxcomercial.com: could not connect to host
-niedersetz.de: could not connect to host
-niedrigsterpreis.de: did not receive HSTS header
-nielshoogenhout.be: did not receive HSTS header
-nielshoogenhout.eu: did not receive HSTS header
-nielshoogenhout.nl: did not receive HSTS header
-niemaler.de: could not connect to host
-nien.chat: could not connect to host
-nien.com.tw: did not receive HSTS header
-nien.taipei: could not connect to host
-nienfun.com: could not connect to host
-nietmvwoensel.com: could not connect to host
-nieuwsoverijssel.nl: did not receive HSTS header
-niffler.software: could not connect to host
-nifpnet.nl: could not connect to host
-nifume.com: could not connect to host
-niggemeier.cc: could not connect to host
-nigger.racing: could not connect to host
-night2stay.com: did not receive HSTS header
-nightbutterflies.com: did not receive HSTS header
-nightfirecat.com: could not connect to host
-nightscapesoutdoorlighting.com: did not receive HSTS header
-nightsnack.cf: could not connect to host
-nightwinds.tk: could not connect to host
-nightwishchile.tk: could not connect to host
-nigt.cf: could not connect to host
-nihilistan.tk: could not connect to host
-niho.jp: did not receive HSTS header
-nihon-no-sake.net: did not receive HSTS header
-nihtek.in: could not connect to host
-nijiero-ch.com: could not connect to host
-nikao-tech.com: did not receive HSTS header
-niki.ai: did not receive HSTS header
-nikitashevchenko.com: did not receive HSTS header
-nikklassen.ca: could not connect to host
-nikksno.io: could not connect to host
-niklas.host: could not connect to host
-niklasanderson.com: did not receive HSTS header
-niklaslindblad.se: did not receive HSTS header
-nikobradshaw.com: did not receive HSTS header
-nikolaichik.photo: did not receive HSTS header
-nikolainevalainen.fi: did not receive HSTS header
-nikolasbradshaw.com: could not connect to host
-nikonschool.co.uk: did not receive HSTS header
-nikunjcementarticles.com: did not receive HSTS header
-nikz.in: could not connect to host
-nilianwo.com: could not connect to host
-niloxy.com: could not connect to host
-nimeshjm.com: did not receive HSTS header
-nina-laaf.de: did not receive HSTS header
-ninarinaldi.com.br: did not receive HSTS header
-ninchisho-online.com: did not receive HSTS header
-ninebytes.xyz: could not connect to host
-ninesix.cc: did not receive HSTS header
-ninespec.com: could not connect to host
-ning.so: did not receive HSTS header
-ninhs.org: could not connect to host
-ninjaspiders.com: could not connect to host
-ninov.de: did not receive HSTS header
-ninreiei.jp: could not connect to host
-niouininon.eu: could not connect to host
-nippler.org: could not connect to host
-nippombashi.net: could not connect to host
-nippon.fr: did not receive HSTS header
-nipponcareers.com: could not connect to host
-nirada.info: could not connect to host
-nirjharstudio.com: did not receive HSTS header
-nirna.io: did not receive HSTS header
-nirudo.me: could not connect to host
-nishaswonderland.be: did not receive HSTS header
-nishaswonderland.nl: did not receive HSTS header
-nishikino-maki.com: could not connect to host
-nishisbma.com: could not connect to host
-nitaonline.org: did not receive HSTS header
-niva.synology.me: could not connect to host
-niveldron.com: could not connect to host
-nivi.ca: could not connect to host
-nix.black: could not connect to host
-nix13.xyz: could not connect to host
-nixien.fr: could not connect to host
-nixmag.net: could not connect to host
-nixne.st: did not receive HSTS header
-nixtest.net: could not connect to host
-nixx-gel.cz: could not connect to host
-njujb.com: did not receive HSTS header
-nkadvertising.online: could not connect to host
-nkautoservice.nl: did not receive HSTS header
-nkb.in.th: could not connect to host
-nklwhx.com: could not connect to host
-nkp-media.de: could not connect to host
-nkx4sjyrk4tcv0sluhwajyc-n6icja9gchqxmhp.com: did not receive HSTS header
-nlayer.info: could not connect to host
-nlfant.eu: could not connect to host
-nll.fi: could not connect to host
-nlrb.gov: did not receive HSTS header
-nmadda.com: could not connect to host
-nmctest.net: did not receive HSTS header
-nmgb.ga: could not connect to host
-nmgb.ml: could not connect to host
-nmsinusdoc.com: did not receive HSTS header
-nmsnj.com: did not receive HSTS header
-nmueller.at: could not connect to host
-nn5197.co: could not connect to host
-nn6729.co: could not connect to host
-nn6729.com: did not receive HSTS header
-nn6957.co: could not connect to host
-nn78.com: could not connect to host
-nn9297.co: could not connect to host
-nn9397.com: could not connect to host
-nn9721.com: could not connect to host
-nn9728.co: could not connect to host
-nnkkserver02.ddns.net: could not connect to host
-nnote.net: did not receive HSTS header
-nnya.cat: could not connect to host
-no17sifangjie.cc: could not connect to host
-noc.wang: could not connect to host
-nocallaghan.com: could not connect to host
-nocit.dk: did not receive HSTS header
-noclegi-online.pl: did not receive HSTS header
-noctinus.tk: could not connect to host
-nodalr.com: could not connect to host
-nodari.com.ar: did not receive HSTS header
-nodariweb.com.ar: could not connect to host
-node-core-app.com: could not connect to host
-nodebb-cn.org: could not connect to host
-nodebrewery.com: could not connect to host
-nodechate.xyz: could not connect to host
-nodecompat.com: did not receive HSTS header
-nodefiles.com: could not connect to host
-nodefoo.com: could not connect to host
-nodepanel.net: did not receive HSTS header
-nodeselect.com: could not connect to host
-nodesonic.com: could not connect to host
-nodesturut.cl: did not receive HSTS header
-nodetemple.com: could not connect to host
-nodist.club: could not connect to host
-nodum.io: did not receive HSTS header
-noegoph.com: did not receive HSTS header
-noelblog.ga: could not connect to host
-noelssanssoucipensacola.com: did not receive HSTS header
-noesberts-weidmoos.de: did not receive HSTS header
-noexpect.org: could not connect to host
-noez.de: did not receive HSTS header
-noisebridge.social: could not connect to host
-noisetor.net: could not connect to host
-nojestorget.se: did not receive HSTS header
-nojobook.com: could not connect to host
-nojok.es: could not connect to host
-nolag.host: did not receive HSTS header
-nolatepayments.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-nolberg.net: could not connect to host
-noleggiobagnichimici.perugia.it: could not connect to host
-nolimits.net.nz: could not connect to host
-nolimitsbook.de: did not receive HSTS header
-nolte-imp.de: did not receive HSTS header
-nolte.work: could not connect to host
-nomik.xyz: could not connect to host
-nomoondev.azurewebsites.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-nomorebytes.de: could not connect to host
-nonametheme.com: could not connect to host
-nonemu.ninja: could not connect to host
-nonx.pro: could not connect to host
-noob-rp.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-noobswhatelse.net: could not connect to host
-noodlecrave.com: did not receive HSTS header
-noodlesandwich.com: did not receive HSTS header
-noodleyum.com: could not connect to host
-noodweer.be: did not receive HSTS header
-nooranevalainen.fi: did not receive HSTS header
-nootropicpedia.com: could not connect to host
-nootropicsource.com: did not receive HSTS header
-nope.website: could not connect to host
-nopex.no: could not connect to host
-nopol.de: could not connect to host
-norandom.com: could not connect to host
-norb.at: could not connect to host
-nord-restaurant-bar.de: did not receive HSTS header
-norden.eu.org: could not connect to host
-nordic-survival.de: could not connect to host
-nordiccasinocommunity.com: did not receive HSTS header
-nordicess.dk: could not connect to host
-nordlicht.photography: did not receive HSTS header
-nordwal.de: did not receive HSTS header
-noref.tk: could not connect to host
-noret.com: did not receive HSTS header
-norge.guide: could not connect to host
-normalady.com: could not connect to host
-normanschwaneberg.de: did not receive HSTS header
-normantobar.com: could not connect to host
-norrkemi.se: could not connect to host
-north.supply: could not connect to host
-northbayvillage-fl.gov: did not receive HSTS header
-northcountykiaparts.com: could not connect to host
-northcutt.com: did not receive HSTS header
-northernmuscle.ca: could not connect to host
-northernpage.com: did not receive HSTS header
-northwest-events.co.uk: could not connect to host
-northwoodsfish.com: could not connect to host
-nosbenevolesontdutalent.com: could not connect to host
-nosecretshop.com: could not connect to host
-nosfermiers.com: could not connect to host
-nospoint.cz: could not connect to host
-nosproduitsdequalite.fr: did not receive HSTS header
-nossasenhoradaconceicao.com.br: did not receive HSTS header
-nossasenhoradodesterro.com.br: could not connect to host
-nostosh.eu.org: could not connect to host
-nostraspace.com: could not connect to host
-nosuch.website: could not connect to host
-nosx.tk: could not connect to host
-not-a.link: could not connect to host
-not-equal.me: could not connect to host
-nota-web.com: could not connect to host
-notablog.xyz: did not receive HSTS header
-notadd.io: could not connect to host
-notadd.store: could not connect to host
-notalone.gov: could not connect to host
-notarankastojkovic.me: could not connect to host
-notarobot.fr: did not receive HSTS header
-notarvysocina.cz: did not receive HSTS header
-notboring.co.uk: could not connect to host
-notdienstreform-nordrhein.de: could not connect to host
-note7forever.com: could not connect to host
-notenoughtime.de: could not connect to host
-notequal.me: could not connect to host
-notes24x7.com: could not connect to host
-notesforpebble.com: could not connect to host
-noteshare.net: did not receive HSTS header
-noteshare.online: could not connect to host
-notevencode.com: could not connect to host
-nothing.org.uk: could not connect to host
-nothingprivate.ml: max-age too low: 0
-noticia.do: did not receive HSTS header
-noticiasymas.cl: could not connect to host
-notificami.com: could not connect to host
-notify.moe: did not receive HSTS header
-notinglife.com: could not connect to host
-notjustbitchy.com: did not receive HSTS header
-notonprem.com: could not connect to host
-notoriousdev.com: did not receive HSTS header
-notrecourrier.net: did not receive HSTS header
-nottheonion.net: did not receive HSTS header
-nottori.com: could not connect to host
-notypiesni.sk: did not receive HSTS header
-nou.si: did not receive HSTS header
-nouma.fr: did not receive HSTS header
-nouvelle-vague-saint-cast.fr: did not receive HSTS header
-nova-elearning.com: could not connect to host
-nova-it.pl: did not receive HSTS header
-nova-kultura.org: could not connect to host
-nova.com.hk: did not receive HSTS header
-novacal.ga: did not receive HSTS header
-novaco.in: max-age too low: 3600
-novacraft.me: could not connect to host
-novaopcaofestas.com.br: could not connect to host
-novaorbis.org: could not connect to host
-novatrucking.de: could not connect to host
-novavoidhowl.com: did not receive HSTS header
-novawatch.de: could not connect to host
-novecity.cloud: could not connect to host
-novecity.info: could not connect to host
-novelabs.de: could not connect to host
-novelabs.eu: could not connect to host
-novelrealm.com: did not receive HSTS header
-novelshouse.com: could not connect to host
-novelvyretraite.fr: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-novodiegomaia.com.br: could not connect to host
-novtest.ru: did not receive HSTS header
-nowall.online: could not connect to host
-nowcost.com: could not connect to host
-noworrywp.com: could not connect to host
-nowprotein.com: could not connect to host
-nowremindme.com: could not connect to host
-noxi.ga: could not connect to host
-noys.info: did not receive HSTS header
-nozoe.jp: could not connect to host
-npm.li: did not receive HSTS header
-npol.de: could not connect to host
-npool.org: could not connect to host
-nq7.pl: could not connect to host
-nqesh.com: could not connect to host
-nqeshreviewer.com: could not connect to host
-nrc-gateway.gov: could not connect to host
-nrdstd.io: could not connect to host
-nrechn.de: could not connect to host
-nrizzio.me: could not connect to host
-nrnjn.xyz: did not receive HSTS header
-nrvnastudios.com: could not connect to host
-nsa.lol: could not connect to host
-nsa.wtf: could not connect to host
-nsamail.uk: could not connect to host
-nsbfalconacademy.org: could not connect to host
-nsboutique.com: could not connect to host
-nscai.gov: could not connect to host
-nsdev.cn: did not receive HSTS header
-nsellier.fr: did not receive HSTS header
-nshost.ro: did not receive HSTS header
-nsmail.cn: could not connect to host
-nsradiology.net: could not connect to host
-nst-maroc.com: could not connect to host
-nstatic.xyz: could not connect to host
-nstremsdoerfer.ovh: did not receive HSTS header
-nstrust.co.uk: did not receive HSTS header
-nstyleintl.ca: did not receive HSTS header
-nsure.us: could not connect to host
-nsweb.solutions: could not connect to host
-nszipline.com: did not receive HSTS header
-ntbs.pro: could not connect to host
-ntcoss.org.au: did not receive HSTS header
-nth.sh: did not receive HSTS header
-ntpana.com: did not receive HSTS header
-ntse.xyz: could not connect to host
-ntut.net: could not connect to host
-nu-pogodi.net: could not connect to host
-nu3.at: did not receive HSTS header
-nu3.ch: did not receive HSTS header
-nu3.co.uk: could not connect to host
-nu3.com: did not receive HSTS header
-nu3.de: did not receive HSTS header
-nu3.dk: did not receive HSTS header
-nu3.fi: could not connect to host
-nu3.fr: did not receive HSTS header
-nu3.no: did not receive HSTS header
-nu3.se: did not receive HSTS header
-nub-aptech.com: did not receive HSTS header
-nube.ninja: did not receive HSTS header
-nubella.com.au: did not receive HSTS header
-nubeslayer.com: could not connect to host
-nuclea.site: could not connect to host
-nuclear-crimes.com: did not receive HSTS header
-nuclearcrimes.com: did not receive HSTS header
-nuclearcrimes1.com: did not receive HSTS header
-nucleosynth.space: could not connect to host
-nucleuscore.org: could not connect to host
-nudel.ninja: could not connect to host
-nudes.ovh: could not connect to host
-nudestpics.com: did not receive HSTS header
-nufla.de: could not connect to host
-nugetdependencies.com: could not connect to host
-nuiguru.me: could not connect to host
-nukenet.se: could not connect to host
-nukleosome.com: could not connect to host
-nukute.com: did not receive HSTS header
-nulap.com: did not receive HSTS header
-null-pointer.eu: did not receive HSTS header
-null-sec.ru: could not connect to host
-null.cat: did not receive HSTS header
-null.tips: could not connect to host
-nullchan.org: did not receive HSTS header
-nullpoint.at: did not receive HSTS header
-nullpointer.io: did not receive HSTS header
-nullpro.com: could not connect to host
-nulltime.net: could not connect to host
-numericacu.com: did not receive HSTS header
-numero-di-telefono.it: did not receive HSTS header
-numis.tech: could not connect to host
-numista.com: did not receive HSTS header
-numm.fr: did not receive HSTS header
-nuos.org: could not connect to host
-nuovamoda.al: could not connect to host
-nup.pw: could not connect to host
-nupef.org.br: did not receive HSTS header
-nurseone.ca: did not receive HSTS header
-nurserybook.co: did not receive HSTS header
-nursingschool.network: could not connect to host
-nurture.be: did not receive HSTS header
-nusku.biz: did not receive HSTS header
-nut.services: could not connect to host
-nutonic-sports.com: did not receive HSTS header
-nutri-spec.me: did not receive HSTS header
-nutricuerpo.com: did not receive HSTS header
-nutrieduca.com: could not connect to host
-nutrifyyourself.com: could not connect to host
-nutritionculture.com: could not connect to host
-nutrivisa.com.br: could not connect to host
-nutsandboltsmedia.com: did not receive HSTS header
-nuva.hu: could not connect to host
-nuvospineandsports.com: did not receive HSTS header
-nuwaterglobal.com: could not connect to host
-nv.gw: did not receive HSTS header
-nvcogct.gov: did not receive HSTS header
-nve-qatar.com: did not receive HSTS header
-nvlocalbusiness.com: did not receive HSTS header
-nvlop.xyz: did not receive HSTS header
-nwa.xyz: could not connect to host
-nweb.co.nz: could not connect to host
-nwimports.com: did not receive HSTS header
-nwork.media: could not connect to host
-nwr-waffenbuch.de: did not receive HSTS header
-nwshell.com: could not connect to host
-nx42.pw: could not connect to host
-nxit.ca: could not connect to host
-nxt.sh: did not receive HSTS header
-nyanco.space: could not connect to host
-nyanpasu.tv: could not connect to host
-nyatane.com: could not connect to host
-nyazeeland.guide: could not connect to host
-nycroth.com: could not connect to host
-nydnxs.com: did not receive HSTS header
-nyesider.org: could not connect to host
-nyffo.com: did not receive HSTS header
-nyip.co.uk: could not connect to host
-nylonfeetporn.com: could not connect to host
-nyonator.info: could not connect to host
-nyored.com: did not receive HSTS header
-nyphox.net: could not connect to host
-nys-hk.com: did not receive HSTS header
-nysepho.pw: could not connect to host
-nysifclaimcentral.com: did not receive HSTS header
-nystart.no: did not receive HSTS header
-nyushikaikaku.net: did not receive HSTS header
-nyxi.eu: did not receive HSTS header
-nyyu.tk: could not connect to host
-nz.search.yahoo.com: max-age too low: 172800
-nzbr.de: did not receive HSTS header
-nzbs.io: could not connect to host
-nzdmo.govt.nz: could not connect to host
-nzmk.cz: could not connect to host
-nzquakes.maori.nz: could not connect to host
-o-loska.cz: did not receive HSTS header
-o-rickroll-y.pw: could not connect to host
-o-s.no: did not receive HSTS header
-o00228.com: could not connect to host
-o0c.cc: could not connect to host
-o0o.one: did not receive HSTS header
-o2careers.co.uk: did not receive HSTS header
-o30365.com: could not connect to host
-o5.cx: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-o5197.co: could not connect to host
-o6729.co: could not connect to host
-o6729.com: did not receive HSTS header
-o6957.co: could not connect to host
-o6957.com: did not receive HSTS header
-o8b.club: could not connect to host
-o9297.co: could not connect to host
-o9397.com: could not connect to host
-o9721.com: could not connect to host
-o9728.co: could not connect to host
-oakandresin.co: did not receive HSTS header
-oaklands.co.za: did not receive HSTS header
-oaksbloom.com: could not connect to host
-oaktonhouseandgardens.com: could not connect to host
-oanalista.com.br: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-oasis-conference.org.nz: could not connect to host
-oasis.mobi: could not connect to host
-oatycloud.spdns.de: could not connect to host
-oauth-dropins.appspot.com: did not receive HSTS header
-obdolbacca.ru: could not connect to host
-oben.pl: did not receive HSTS header
-oberam.de: could not connect to host
-oberhof.co: could not connect to host
-oberhofjuice.com: could not connect to host
-obioncountytn.gov: did not receive HSTS header
-obistarltd.com: did not receive HSTS header
-objectif-leger.com: did not receive HSTS header
-oblikdom.pro: did not receive HSTS header
-oblikdom.ru: did not receive HSTS header
-oblondata.io: did not receive HSTS header
-obmen-viz.tk: could not connect to host
-obrienlab.com: did not receive HSTS header
-obrobka-zdjec.pl: could not connect to host
-obscuredfiles.com: could not connect to host
-obscureware.xyz: could not connect to host
-observatory.se: did not receive HSTS header
-obsessedwithknives.ru: could not connect to host
-obsidianirc.net: could not connect to host
-obsydian.org: could not connect to host
-obu4alka.ru: did not receive HSTS header
-oc-minecraft.com: could not connect to host
-ocapic.com: could not connect to host
-occmon.net: did not receive HSTS header
-occupymedia.org: could not connect to host
-ocdadmin.com: could not connect to host
-ocelot.help: did not receive HSTS header
-ochaken.cf: could not connect to host
-ochrebridge.com: could not connect to host
-ocloudhost.com: could not connect to host
-ocmeulebeke.be: did not receive HSTS header
-ocponj.gov: did not receive HSTS header
-ocrami.us: did not receive HSTS header
-octa.store: could not connect to host
-octagongroup.co: could not connect to host
-octal.es: did not receive HSTS header
-octanio.com: did not receive HSTS header
-octava.ua: did not receive HSTS header
-octavus.it: did not receive HSTS header
-octo.im: could not connect to host
-octocat.ninja: could not connect to host
-octod.tk: could not connect to host
-octohedralpvp.tk: could not connect to host
-octohost.net: could not connect to host
-octomist.com: did not receive HSTS header
-ocwr.gov: did not receive HSTS header
-oddtime.net: could not connect to host
-odense3dprint.dk: could not connect to host
-odeonentertainment.co.uk: could not connect to host
-odin.xxx: could not connect to host
-odinkapital.no: did not receive HSTS header
-odinoffice.no: did not receive HSTS header
-odisealinux.com: did not receive HSTS header
-odosblog.de: could not connect to host
-oducs.org: could not connect to host
-odvps.com: did not receive HSTS header
-odysseyandco.com: could not connect to host
-odysseyconservationtrust.com: did not receive HSTS header
-oe8.bet: could not connect to host
-oemspace.net: could not connect to host
-oemspace.nl: could not connect to host
-of2m.fr: did not receive HSTS header
-ofcourselanguages.com: could not connect to host
-ofcss.com: did not receive HSTS header
-ofer.site: could not connect to host
-off-the-clock.us: could not connect to host
-offenedialoge.de: did not receive HSTS header
-offersgame.com: could not connect to host
-offerstone.cl: could not connect to host
-offfbynight.be: did not receive HSTS header
-offgames.io: could not connect to host
-offgames.pro: could not connect to host
-office-morimoto.com: did not receive HSTS header
-office-ruru.com: could not connect to host
-officeclub.com.mx: did not receive HSTS header
-officeprint.co.th: could not connect to host
-official-sensitive.co.uk: could not connect to host
-official-sensitive.com: could not connect to host
-official-sensitive.net: could not connect to host
-official-sensitive.org: could not connect to host
-officiants.wedding: did not receive HSTS header
-offshore-firma.org: could not connect to host
-offshore-unternehmen.com: could not connect to host
-offshorefirma-gruenden.com: could not connect to host
-offtherails.ie: could not connect to host
-oficinadocelular.com.br: could not connect to host
-ofo2.com: could not connect to host
-ofsetas.lt: could not connect to host
-oganek.ie: could not connect to host
-oganime.com: did not receive HSTS header
-oggw.us: could not connect to host
-ogis.gov: could not connect to host
-oglen.ca: could not connect to host
-ogocare.com: did not receive HSTS header
-ogogoshop.com: could not connect to host
-ogrodywstudniach.pl: did not receive HSTS header
-ohayosoro.me: could not connect to host
-ohioag.gov: could not connect to host
-ohioago.gov: could not connect to host
-ohiobusinesscentral.gov: could not connect to host
-ohiosos.gov: could not connect to host
-ohiostateparks.gov: could not connect to host
-ohiot21.gov: could not connect to host
-ohiotobacco21.gov: could not connect to host
-ohling.org: could not connect to host
-ohma.ga: did not receive HSTS header
-ohmayonnaise.com: could not connect to host
-ohnemusik.com: did not receive HSTS header
-ohohrazi.com: could not connect to host
-ohreally.de: could not connect to host
-oiaio.cn: did not receive HSTS header
-oiepoie.nl: could not connect to host
-oil-heaters.tk: could not connect to host
-oilfieldinjury.attorney: could not connect to host
-oilpaintingsonly.com: could not connect to host
-oinky.ddns.net: could not connect to host
-oirealtor.com: did not receive HSTS header
-oishioffice.com: did not receive HSTS header
-ojanaho.com: did not receive HSTS header
-ojbk.eu: could not connect to host
-ojeremy.com: did not receive HSTS header
-ojk.me: could not connect to host
-ojls.co: could not connect to host
-okanaganrailtrail.ca: max-age too low: 0
-okane.love: did not receive HSTS header
-okashi.me: did not receive HSTS header
-okchicas.com: did not receive HSTS header
-oklahomamoversassociation.org: could not connect to host
-oklahomanotepro.com: could not connect to host
-okok-rent.com: could not connect to host
-okok.rent: could not connect to host
-okoris.net: could not connect to host
-oktoberfeststore.nl: could not connect to host
-oktomus.com: did not receive HSTS header
-okuscapital.com: did not receive HSTS header
-okutama.in.th: could not connect to host
-olandiz.com: did not receive HSTS header
-olcso-vps-szerver.hu: could not connect to host
-oldandyounglesbians.us: did not receive HSTS header
-oldenglishsheepdog.com.br: could not connect to host
-oldtimer-trifft-flugplatz.de: did not receive HSTS header
-oleron.fr: did not receive HSTS header
-olgui.net: could not connect to host
-olhovirtual.com.br: could not connect to host
-olifant.fr: could not connect to host
-olightstore.com: did not receive HSTS header
-oliode.tk: could not connect to host
-olivejs.com: could not connect to host
-oliveraiedelabastideblanche.fr: did not receive HSTS header
-oliverfaircliff.com: could not connect to host
-olivierlemoal.fr: did not receive HSTS header
-olivlabs.com: could not connect to host
-ollehbizev.co.kr: could not connect to host
-olltechjob.com: could not connect to host
-olphseaside.org: could not connect to host
-ols.io: did not receive HSTS header
-olswangtrainees.com: could not connect to host
-olygazoo.com: could not connect to host
-olympe-transport.fr: did not receive HSTS header
-omacostudio.com: could not connect to host
-omanlover.org: did not receive HSTS header
-omar.yt: did not receive HSTS header
-omarh.net: could not connect to host
-omarsuniagamusic.ga: could not connect to host
-omega-gaming.online: could not connect to host
-omerefe.av.tr: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-omeuanimal.com: did not receive HSTS header
-omgaanmetidealen.com: could not connect to host
-omi-news.fr: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-omie.com.br: did not receive HSTS header
-omifind.com: did not receive HSTS header
-ominto.com: max-age too low: 0
-omise.co: did not receive HSTS header
-ommahpost.com: did not receive HSTS header
-omniasl.com: could not connect to host
-omnilab.tech: could not connect to host
-omnisafira.com: did not receive HSTS header
-omniscimus.net: could not connect to host
-omniti.com: did not receive HSTS header
-omorashi.org: did not receive HSTS header
-omquote.gq: could not connect to host
-omretreats.net: could not connect to host
-omskit.ru: could not connect to host
-omyogarishikesh.com: did not receive HSTS header
-on-te.ch: could not connect to host
-onazikgu.com: could not connect to host
-once.eu.org: could not connect to host
-ondrejhoralek.cz: did not receive HSTS header
-one-pe.com: could not connect to host
-onearth.one: could not connect to host
-oneb4nk.com: could not connect to host
-oneclickonejob.com: did not receive HSTS header
-onecloud.lt: did not receive HSTS header
-onecycling.my: could not connect to host
-onecycling.world: could not connect to host
-onedegreehealth.com: did not receive HSTS header
-onedot.nl: could not connect to host
-onefour.co: did not receive HSTS header
-onefour.ga: could not connect to host
-onegoodthingbyjillee.com: did not receive HSTS header
-onehost.blue: did not receive HSTS header
-onehourloan.com: could not connect to host
-oneidentity.me: could not connect to host
-oneindex.tk: could not connect to host
-oneiros.cc: could not connect to host
-onelawsuit.com: did not receive HSTS header
-oneminutefilm.tv: could not connect to host
-oneminutetomindfulness.com: could not connect to host
-onemusou.com: could not connect to host
-onepluscamps.com: could not connect to host
-onepopstore.com: could not connect to host
-onesearay.com: did not receive HSTS header
-oneso.win: could not connect to host
-onespiritinc.com: did not receive HSTS header
-onestepfootcare.com: did not receive HSTS header
-onestop-study.com: did not receive HSTS header
-onet.space: could not connect to host
-onetech.it: could not connect to host
-onetly.com: could not connect to host
-onewebdev.info: could not connect to host
-oneworldbank.com: did not receive HSTS header
-onewpst.com: could not connect to host
-onguardonline.gov: did not receive HSTS header
-oniichan.us: could not connect to host
-onionbot.ga: could not connect to host
-onionbot.me: could not connect to host
-onioncloud.org: could not connect to host
-onionplay.live: did not receive HSTS header
-onionplay.org: did not receive HSTS header
-onionsburg.com: could not connect to host
-onkfaktor.de: could not connect to host
-online-bouwmaterialen.nl: did not receive HSTS header
-online-casino.eu: did not receive HSTS header
-online-consulting-corp.com: could not connect to host
-online-consulting-corp.fr: could not connect to host
-online-horoskop.ch: did not receive HSTS header
-online-results.dk: did not receive HSTS header
-online-wetten.de: did not receive HSTS header
-online.marketing: did not receive HSTS header
-online.net.gr: could not connect to host
-onlinebiller.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-onlinebillingform.com: could not connect to host
-onlinecasino.vlaanderen: did not receive HSTS header
-onlinecompliance.org: did not receive HSTS header
-onlinecorners.com: could not connect to host
-onlinedeposit.us: could not connect to host
-onlinefashion.it: could not connect to host
-onlineinfographic.com: could not connect to host
-onlinekasino.de: did not receive HSTS header
-onlinelighting.com.au: did not receive HSTS header
-onlinemoviewatch.org: did not receive HSTS header
-onlinepollsph.com: could not connect to host
-onlineporno.tv: did not receive HSTS header
-onlineporno.xyz: did not receive HSTS header
-onlineprofecional.com: could not connect to host
-onlineschadestaat.nl: did not receive HSTS header
-onlinespielothek.com: could not connect to host
-onlinewetten.de: could not connect to host
-onlinexl.nl: could not connect to host
-only-roses.co.uk: did not receive HSTS header
-only-roses.com: max-age too low: 2592000
-only.sh: could not connect to host
-onlyesb.net: could not connect to host
-onlylebanon.net: did not receive HSTS header
-onlylibya.com: could not connect to host
-onlyshopstation.com: did not receive HSTS header
-onlytrong.cc: did not receive HSTS header
-onlyzero.net: could not connect to host
-onmuvo.com: did not receive HSTS header
-onmyoji.biz: could not connect to host
-onnee.ch: could not connect to host
-ononpay.com: did not receive HSTS header
-onoranze-funebri.biz: could not connect to host
-onovlena.dn.ua: could not connect to host
-onpatient.com: did not receive HSTS header
-onpermit.net: could not connect to host
-onsennuie.fr: did not receive HSTS header
-onsite4u.de: could not connect to host
-onsitemassageco.com: did not receive HSTS header
-onstud.com: could not connect to host
-onthe.network: could not connect to host
-ontheboard.com: could not connect to host
-onthecheap.store: could not connect to host
-ontimestamp.com: did not receive HSTS header
-ontsnappingskamer.nl: could not connect to host
-onvirt.de: could not connect to host
-onwie.com: could not connect to host
-onwie.fr: could not connect to host
-onyxwall.com: could not connect to host
-onyxwall.link: could not connect to host
-onyxwall.net: could not connect to host
-oo.edu.rs: could not connect to host
-oo5197.co: could not connect to host
-oo6729.co: could not connect to host
-oo6729.com: did not receive HSTS header
-oo6957.co: could not connect to host
-oo9297.co: could not connect to host
-oo9397.com: could not connect to host
-oo9721.com: could not connect to host
-oo9728.co: could not connect to host
-ooeste.com: could not connect to host
-oogartsennet.nl: could not connect to host
-ookjesprookje.nl: could not connect to host
-ooooush.co.uk: could not connect to host
-oopsis.com: could not connect to host
-oopsmycase.com: could not connect to host
-oopsorup.com: could not connect to host
-oosoo.org: could not connect to host
-op11.co.uk: could not connect to host
-opadaily.com: could not connect to host
-opatut.de: did not receive HSTS header
-opcaobolsas.com.br: could not connect to host
-opcionpublicitaria.pe: did not receive HSTS header
-open-ctp.net: could not connect to host
-open-domotics.info: could not connect to host
-open-mx.de: could not connect to host
-open-to-repair.fr: max-age too low: 86400
-open.net.sa: did not receive HSTS header
-openacademies.com: did not receive HSTS header
-openas.org: could not connect to host
-openbankproject.com: did not receive HSTS header
-openbsd.id: could not connect to host
-openbsd.rocks: did not receive HSTS header
-openclub24.ru: could not connect to host
-opencluster.at: could not connect to host
-openconcept.no: did not receive HSTS header
-openconnect.com.au: could not connect to host
-opencpes.net: did not receive HSTS header
-opencpes.org: could not connect to host
-openctp.com: could not connect to host
-openctp.net: could not connect to host
-opendesk.cc: did not receive HSTS header
-openevic.info: could not connect to host
-opengateway.fr: did not receive HSTS header
-opengg.me: could not connect to host
-openintelligence.uk: did not receive HSTS header
-openiocdb.com: could not connect to host
-openmetals.com: could not connect to host
-openmind-shop.de: did not receive HSTS header
-openmirrors.cf: could not connect to host
-openmtbmap.org: did not receive HSTS header
-openpresentes.com.br: could not connect to host
-openpriv.pw: could not connect to host
-openprovider.nl: did not receive HSTS header
-openrainbow.org: could not connect to host
-openresty.com: did not receive HSTS header
-openrtv.com: could not connect to host
-openshift.redhat.com: did not receive HSTS header
-opensourcedmind.eu: could not connect to host
-opensourcehouse.net: could not connect to host
-openspace.xxx: did not receive HSTS header
-opensrd.com: could not connect to host
-openssf.org: could not connect to host
-openstakes.com: did not receive HSTS header
-opentexon.com: could not connect to host
-openverse.com: could not connect to host
-openwaveguide.de: could not connect to host
-openxmpp.com: could not connect to host
-operad.fr: could not connect to host
-operationforever.com: could not connect to host
-operationsafeescape.org: did not receive HSTS header
-opiates.net: did not receive HSTS header
-opim.ca: did not receive HSTS header
-opinion8td.com: did not receive HSTS header
-opinionicentrifuga.it: could not connect to host
-opinionipannolini.it: could not connect to host
-oportho.com.br: did not receive HSTS header
-oportunidadesemfoco.com.br: could not connect to host
-oposicionescorreos.com.es: could not connect to host
-oposicionesertzaintza.com.es: could not connect to host
-opp.ag: did not receive HSTS header
-oppag.com.br: did not receive HSTS header
-oppaiti.me: could not connect to host
-opperwall.net: could not connect to host
-opposer.me: could not connect to host
-oppress.life: did not receive HSTS header
-opsafewinter.net: could not connect to host
-opsbears.com: could not connect to host
-opsnotepad.com: could not connect to host
-opsre.net: could not connect to host
-opstacks.com: could not connect to host
-opteamax.eu: did not receive HSTS header
-optenhoefel.de: could not connect to host
-optiekzien.nl: did not receive HSTS header
-optigear.nl: could not connect to host
-optimal-e.com: did not receive HSTS header
-optimised.cloud: could not connect to host
-optimised.io: could not connect to host
-optimisedlabs.co.uk: could not connect to host
-optimisedlabs.com: could not connect to host
-optimisedlabs.info: could not connect to host
-optimisedlabs.net: could not connect to host
-optimisedlabs.uk: could not connect to host
-optimista.soy: could not connect to host
-optimize-jpg.com: could not connect to host
-optimizedlabs.co.uk: could not connect to host
-optimizedlabs.info: could not connect to host
-optimizedlabs.net: could not connect to host
-optimizedlabs.uk: could not connect to host
-optimuscrime.net: could not connect to host
-optisure.de: could not connect to host
-optm.us: could not connect to host
-optmos.at: could not connect to host
-optometriepunt.nl: did not receive HSTS header
-optometryscotland.org.uk: did not receive HSTS header
-optoutday.de: could not connect to host
-optumrxhealthstore.com: could not connect to host
-opunch.org: did not receive HSTS header
-oracaodocredo.com.br: could not connect to host
-oraculum.cz: did not receive HSTS header
-orangefinanse.com.pl: could not connect to host
-orangehattech.com: did not receive HSTS header
-orangekey.tk: could not connect to host
-orangenuts.in: could not connect to host
-oranges.tokyo: did not receive HSTS header
-orangesquash.org.uk: did not receive HSTS header
-oranic.com: could not connect to host
-orbiosales.com: could not connect to host
-orbitcom.de: did not receive HSTS header
-orbitdefence.co.uk: could not connect to host
-orbograph-hrcm.com: could not connect to host
-orchids.co.jp: did not receive HSTS header
-orchidspaper.com: did not receive HSTS header
-ordekho.com: did not receive HSTS header
-order.one: could not connect to host
-ordereat.fr: could not connect to host
-orderlounge.de: did not receive HSTS header
-ordernow.at: could not connect to host
-orderswift.com: did not receive HSTS header
-ordoh.com: could not connect to host
-ordr.mobi: could not connect to host
-ore.cool: could not connect to host
-orebolt.cz: could not connect to host
-oref-idf.com: could not connect to host
-oref-idf.net: could not connect to host
-oref-idf.org: could not connect to host
-oregonmu.org: could not connect to host
-oreka.online: could not connect to host
-orelavtomaster.ru: could not connect to host
-orembaeviajes.tur.ar: could not connect to host
-orfeo-engineering.ch: could not connect to host
-organic-superfood.net: could not connect to host
-organicae.com: did not receive HSTS header
-organicnature.dk: did not receive HSTS header
-organicskincare.com: did not receive HSTS header
-organix.ma: could not connect to host
-orgatech-gmbh.de: did not receive HSTS header
-oricejoc.com: could not connect to host
-orientravelmacas.com: could not connect to host
-originalmockups.com: did not receive HSTS header
-originalsport.com.br: could not connect to host
-origincoffee.com: did not receive HSTS header
-origincoffee.nz: did not receive HSTS header
-orion-universe.com: did not receive HSTS header
-orioncokolada.cz: did not receive HSTS header
-orioncustompcs.com: could not connect to host
-oriondynamic.be: did not receive HSTS header
-orionfcu.com: could not connect to host
-oriongames.eu: did not receive HSTS header
-orionrebellion.com: did not receive HSTS header
-orleika.ml: could not connect to host
-orovillelaw.com: could not connect to host
-oroweatorganic.com: could not connect to host
-orro.ro: did not receive HSTS header
-ortaev.tk: could not connect to host
-orthocop.cz: could not connect to host
-orthodocspro.com: did not receive HSTS header
-orthodontiste-geneve-docteur-rioux.com: could not connect to host
-orthodoxy.lt: did not receive HSTS header
-ortizmario.com: could not connect to host
-ortodonciaian.com: did not receive HSTS header
-orui.com.br: could not connect to host
-orum.in: max-age too low: 0
-orvibo.com.ec: did not receive HSTS header
-orvitdesign.com: could not connect to host
-orxideya.az: did not receive HSTS header
-orz.uno: did not receive HSTS header
-os-chrome.ru: did not receive HSTS header
-osaiyuwu.com: could not connect to host
-osaka-onakura.com: did not receive HSTS header
-oscamp.eu: could not connect to host
-oscarmashauri.com: could not connect to host
-oscarproductions.no: did not receive HSTS header
-oscloud.com.ua: could not connect to host
-oscreen.me: could not connect to host
-oscreen.org: could not connect to host
-oscsdp.cz: could not connect to host
-osdls.gov: did not receive HSTS header
-osereso.tn: could not connect to host
-osha-kimi.com: did not receive HSTS header
-oshanko.de: could not connect to host
-oshell.me: could not connect to host
-oshershalom.com: did not receive HSTS header
-oshinagaki.jp: did not receive HSTS header
-osirisrp.online: could not connect to host
-oslfoundation.org: did not receive HSTS header
-osmestres.com: did not receive HSTS header
-osp.cx: could not connect to host
-osprecos.com.br: did not receive HSTS header
-osprecos.pt: did not receive HSTS header
-ospree.me: did not receive HSTS header
-ossan-kobe-gourmet.com: did not receive HSTS header
-ossbinaries.com: could not connect to host
-osteammate.com: did not receive HSTS header
-ostendorf.com: did not receive HSTS header
-osticketawesome.com: did not receive HSTS header
-osusume-houhou.com: could not connect to host
-oswaldmattgroup.com: did not receive HSTS header
-osworx.net: did not receive HSTS header
-osxentwicklerforum.de: max-age too low: 2592000
-otako.pl: did not receive HSTS header
-otakucloud.net: could not connect to host
-otakuworld.de: could not connect to host
-otakuyun.com: could not connect to host
-otchecker.com: could not connect to host
-othercode.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-otherkinforum.com: could not connect to host
-othermedia.cc: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-otherstuff.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-otichi.com: could not connect to host
-otinane.eu: could not connect to host
-otmns.net: could not connect to host
-otmo7.com: did not receive HSTS header
-otokonna.com: could not connect to host
-otrsdemo.hu: did not receive HSTS header
-otsu.beer: could not connect to host
-ottospora.nl: could not connect to host
-otus.ru: did not receive HSTS header
-ouac.cn: could not connect to host
-ouglor.com: could not connect to host
-ouimoove.com: did not receive HSTS header
-ouin.land: did not receive HSTS header
-oumyshop.com: did not receive HSTS header
-ouowo.gq: could not connect to host
-our-box.net: could not connect to host
-ourbank.com: did not receive HSTS header
-ourchoice2016.com: could not connect to host
-ouruglyfood.com: could not connect to host
-ourwedding.xyz: did not receive HSTS header
-outdooradventures.pro: could not connect to host
-outdoorchoose.com: did not receive HSTS header
-outdoorhole.com: did not receive HSTS header
-outerlimitsdigital.com: could not connect to host
-outfit-weimar.eu: could not connect to host
-outlines.xyz: did not receive HSTS header
-outplnr.fr: could not connect to host
-outpostinfo.com: could not connect to host
-output.clothing: could not connect to host
-outreachbuddy.com: could not connect to host
-outsider.im: could not connect to host
-outstandingpromotion.com: did not receive HSTS header
-outurnate.com: could not connect to host
-ouvirmusica.com.br: did not receive HSTS header
-ouxiang.me: could not connect to host
-ovabag.com: did not receive HSTS header
-ovabastecedoraindustrial.com: could not connect to host
-ovejabohemia.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-ovenapp.io: did not receive HSTS header
-overalglas.nl: could not connect to host
-overceny.cz: did not receive HSTS header
-overkillshop.com: did not receive HSTS header
-overmark.net: did not receive HSTS header
-override.io: could not connect to host
-overrustle.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-oversight.io: could not connect to host
-overspeed.ddns.net: did not receive HSTS header
-overstappen.nl: did not receive HSTS header
-overture.london: did not receive HSTS header
-overwall.org: could not connect to host
-ovmfinancial.mortgage: max-age too low: 604800
-ovpn.to: could not connect to host
-ovuscloud.de: could not connect to host
-ovwane.com: could not connect to host
-owall.ml: could not connect to host
-owensmith.website: could not connect to host
-owid.cloud: did not receive HSTS header
-owl-hakkei.com: did not receive HSTS header
-owlandrabbitgallery.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-owlishmedia.com: could not connect to host
-owlscrap.ru: could not connect to host
-owncloud.ch: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-owncloud.help: did not receive HSTS header
-owngeek.com: could not connect to host
-ownmovies.fr: could not connect to host
-ownspec.com: could not connect to host
-owothisdiz.pw: could not connect to host
-oxdl.cn: did not receive HSTS header
-oxro.co: could not connect to host
-oxro.io: did not receive HSTS header
-oxt.co: did not receive HSTS header
-oxygaming.com: did not receive HSTS header
-oxygenabsorbers.com: did not receive HSTS header
-oxygenit.co.za: did not receive HSTS header
-oxymc.com: did not receive HSTS header
-oxynux.fr: could not connect to host
-oxynux.xyz: could not connect to host
-oxytocin.org: did not receive HSTS header
-oxzeth3sboard.com: could not connect to host
-oyashirosama.tokyo: could not connect to host
-oyesunn.com: could not connect to host
-oyste.in: could not connect to host
-ozonitron.com: did not receive HSTS header
-ozonitron.de: did not receive HSTS header
-ozonitron.eu: did not receive HSTS header
-ozonytron.com: did not receive HSTS header
-ozonytron.de: did not receive HSTS header
-ozonytron.eu: did not receive HSTS header
-ozoz.cc: did not receive HSTS header
-p-fent.ch: did not receive HSTS header
-p-pc.de: could not connect to host
-p-rickroll-o.pw: could not connect to host
-p-t.io: could not connect to host
-p.ki: did not receive HSTS header
-p.linode.com: could not connect to host
-p0l.de: did not receive HSTS header
-p1984.nl: could not connect to host
-p1c.pw: could not connect to host
-p1cn.com: could not connect to host
-p2av.com: could not connect to host
-p3.marketing: did not receive HSTS header
-p30365.com: could not connect to host
-p333aa.com: could not connect to host
-p333eee.com: could not connect to host
-p333hhh.com: could not connect to host
-p333ppp.com: could not connect to host
-p3in.com: could not connect to host
-p3ter.fr: did not receive HSTS header
-p4g.club: did not receive HSTS header
-p5118.com: could not connect to host
-p5197.co: could not connect to host
-p58101.com: could not connect to host
-p58102.com: could not connect to host
-p58103.com: could not connect to host
-p58104.com: could not connect to host
-p58201.com: could not connect to host
-p58202.com: could not connect to host
-p58203.com: could not connect to host
-p58204.com: could not connect to host
-p58205.com: could not connect to host
-p6729.co: could not connect to host
-p6957.co: could not connect to host
-p8r.de: did not receive HSTS header
-p9165.com: could not connect to host
-p91aa.com: could not connect to host
-p9297.co: could not connect to host
-p9721.com: could not connect to host
-p9728.co: could not connect to host
-paal.network: could not connect to host
-paarberatung-hn.de: could not connect to host
-paardensportbak.nl: could not connect to host
-pablocamino.tk: could not connect to host
-pablorey-art.com: did not receive HSTS header
-pacco.com.br: did not receive HSTS header
-paceda.nl: could not connect to host
-pachaiyappas.org: could not connect to host
-pacificpalisadeselectric.com: could not connect to host
-pacificpalisadeselectrical.com: could not connect to host
-pacificpalisadeselectrician.com: did not receive HSTS header
-pacificpalisadeslandscapelighting.com: could not connect to host
-pacificpalisadeslighting.com: could not connect to host
-pacifique-web.nc: could not connect to host
-packair.com: did not receive HSTS header
-packer.io: did not receive HSTS header
-packetapp.ru: could not connect to host
-packetcrash.net: could not connect to host
-packlane.com: did not receive HSTS header
-packshot-creator.com: did not receive HSTS header
-pacnetwork.io: could not connect to host
-pacoda.de: could not connect to host
-pactf-flag-4boxdpa21ogonzkcrs9p.com: could not connect to host
-pactocore.org: could not connect to host
-pader-deko.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-padianda.com: could not connect to host
-padovani.de: did not receive HSTS header
-padrepio.in: did not receive HSTS header
-paducaheic.com: could not connect to host
-paestbin.com: could not connect to host
-pagalworld.co: did not receive HSTS header
-pagamentosdigitais.pt: did not receive HSTS header
-pagatuarriendo.cl: could not connect to host
-page: could not connect to host
-page-builders.com: max-age too low: 2592000
-pagedesignshop.com: did not receive HSTS header
-pageperform.com: did not receive HSTS header
-pagerate.io: did not receive HSTS header
-pages-tocaven.com: could not connect to host
-pagetoimage.com: could not connect to host
-pagina.com.mx: did not receive HSTS header
-paginapolitica.ro: did not receive HSTS header
-pahnid.com: could not connect to host
-paigeglass.com: did not receive HSTS header
-paigejulianne.com: did not receive HSTS header
-paincareehr.com: could not connect to host
-painlessproperty.co.uk: did not receive HSTS header
-paino.cloud: could not connect to host
-painosso.org: could not connect to host
-paint-it.pink: could not connect to host
-paintcolorsbysue.com: could not connect to host
-paintingat.com: could not connect to host
-paintsealdirect.com: did not receive HSTS header
-paio2-rec.com: could not connect to host
-paio2.com: could not connect to host
-paisaone.com: could not connect to host
-paizinhovirgula.com: did not receive HSTS header
-pajonzeck.de: could not connect to host
-paket.io: could not connect to host
-paket.ml: could not connect to host
-paketkreditsuzuki.com: could not connect to host
-pakeystonescholars.gov: did not receive HSTS header
-pakke.de: did not receive HSTS header
-pakowanie-polska.pl: could not connect to host
-pakroyalpress.com: did not receive HSTS header
-paku.me: could not connect to host
-palace-bayreuth.de: did not receive HSTS header
-palationtrade.com: could not connect to host
-palawan.jp: could not connect to host
-palazzo.work: could not connect to host
-paleolowcarb.de: did not receive HSTS header
-paleoself.com: could not connect to host
-paleosquawk.com: could not connect to host
-pallas.in: did not receive HSTS header
-pallet.io: did not receive HSTS header
-palmavile.us: did not receive HSTS header
-palmaville.com: did not receive HSTS header
-palmer.im: could not connect to host
-pamatv.hk: did not receive HSTS header
-pammbook.com: could not connect to host
-pamplona.tv: could not connect to host
-pan.tips: could not connect to host
-panaceallc.net: could not connect to host
-panama-gbs.com: did not receive HSTS header
-panamaequity.com: did not receive HSTS header
-panamateakforestry.com: did not receive HSTS header
-panamatrippin.com: could not connect to host
-panascais.de: did not receive HSTS header
-panascais.eu: did not receive HSTS header
-panasproducciones.com: could not connect to host
-panda.tf: did not receive HSTS header
-pandagifts.co: did not receive HSTS header
-pandapsy.com: could not connect to host
-pandit.tech: did not receive HSTS header
-panelomix.net: did not receive HSTS header
-pangci.xyz: could not connect to host
-panicparts.com: max-age too low: 10540800
-panjee.com: max-age too low: 0
-panjee.fr: did not receive HSTS header
-panni.me: did not receive HSTS header
-panoma.de: did not receive HSTS header
-panomizer.de: did not receive HSTS header
-panoranordic.net: could not connect to host
-panos.io: did not receive HSTS header
-panoti.com: could not connect to host
-panoxadrez.com.br: did not receive HSTS header
-pansu.space: could not connect to host
-pantallasled.com.mx: did not receive HSTS header
-pantherage.co.uk: could not connect to host
-pants-off.xyz: could not connect to host
-pantsu.cat: did not receive HSTS header
-pao.ge: did not receive HSTS header
-paolo565.org: did not receive HSTS header
-papakonstantinou.tk: could not connect to host
-papalytics.com: could not connect to host
-papapa-members.club: could not connect to host
-papatest24.de: could not connect to host
-papeda.net: could not connect to host
-papelariadante.com.br: could not connect to host
-paper-driver.biz: did not receive HSTS header
-papercard.co.uk: did not receive HSTS header
-papercrunch.io: could not connect to host
-paperhoney.by: could not connect to host
-papermasters.com: did not receive HSTS header
-paperwallets.io: could not connect to host
-paperwork.co.za: could not connect to host
-paperworld.online: could not connect to host
-papierniak.net: could not connect to host
-papiweb.ca: did not receive HSTS header
-papotage.net: could not connect to host
-papygeek.com: could not connect to host
-parabhairavayoga.com: could not connect to host
-paradiesgirls.ch: could not connect to host
-paradigi.com.br: did not receive HSTS header
-paradise-engineers.com: could not connect to host
-paradordelgitano.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-paradoxdesigns.org: could not connect to host
-paragon.edu: could not connect to host
-parakranov.ru: did not receive HSTS header
-paranoidcrypto.com: could not connect to host
-parasca7.com: did not receive HSTS header
-paratlantalalkozas.hu: could not connect to host
-parav.xyz: did not receive HSTS header
-paravroum.com: did not receive HSTS header
-pardnoy.com: could not connect to host
-parent5446.us: could not connect to host
-parentheseardenne.be: could not connect to host
-parfum-baza.ru: could not connect to host
-pariga.co.uk: could not connect to host
-paris-cyber.fr: did not receive HSTS header
-paris-store.com: did not receive HSTS header
-parisdimanche.com: did not receive HSTS header
-parishome.jp: could not connect to host
-parisvox.info: did not receive HSTS header
-parithy.net: could not connect to host
-parkfans.net: did not receive HSTS header
-parkhillsbaptist.church: did not receive HSTS header
-parkingplus.co.il: could not connect to host
-parkr.io: could not connect to host
-parksland.net: did not receive HSTS header
-parksubaruoemparts.com: could not connect to host
-parkwithark.com: could not connect to host
-parodybit.net: did not receive HSTS header
-parpaing-paillette.net: could not connect to host
-parroquiasanrafaeldegramalote.com: did not receive HSTS header
-partage.ovh: did not receive HSTS header
-participatorybudgeting.de: did not receive HSTS header
-participatorybudgeting.info: did not receive HSTS header
-particonpsplus.it: could not connect to host
-partijhandel.website: could not connect to host
-partijtjevoordevrijheid.nl: could not connect to host
-partiono.com: did not receive HSTS header
-partirkyoto.jp: did not receive HSTS header
-partiwatch.com: did not receive HSTS header
-partnerbeam.com: could not connect to host
-party-calendar.net: did not receive HSTS header
-partycentrumdebinnenhof.nl: did not receive HSTS header
-partyhaus.ovh: could not connect to host
-partyhelfer.ch: did not receive HSTS header
-partyhireformby.co.uk: could not connect to host
-partyshop.ge: did not receive HSTS header
-partyspecialists.com: did not receive HSTS header
-partyvan.eu: could not connect to host
-partyvan.it: could not connect to host
-partyvan.moe: could not connect to host
-partyvan.nl: could not connect to host
-partyvan.se: could not connect to host
-pasadenasandwich.co: did not receive HSTS header
-pasadenasandwich.com: did not receive HSTS header
-pasadenasandwichcompany.com: did not receive HSTS header
-pascal-kannchen.de: did not receive HSTS header
-pasportaservo.org: did not receive HSTS header
-passfoto-deinfoto.ch: could not connect to host
-passionbyd.com: did not receive HSTS header
-passions-art.com: could not connect to host
-passphrase.today: could not connect to host
-passpilot.co.uk: did not receive HSTS header
-passrhce.com: could not connect to host
-passrhcsa.com: could not connect to host
-passwd.io: did not receive HSTS header
-password.codes: could not connect to host
-password.consulting: could not connect to host
-passwordbox.com: did not receive HSTS header
-passwordrevelator.net: did not receive HSTS header
-passwordscon.com: could not connect to host
-pastaf.com: could not connect to host
-pastdream.xyz: could not connect to host
-paste.linode.com: could not connect to host
-pastebin.linode.com: could not connect to host
-pastebin.tw: could not connect to host
-pasteblin.com: could not connect to host
-pastenib.com: could not connect to host
-paster.li: did not receive HSTS header
-pasteros.io: could not connect to host
-pastie.se: could not connect to host
-pastorbelgagroenendael.com.br: could not connect to host
-pastorcanadense.com.br: could not connect to host
-pastordocaucaso.com.br: could not connect to host
-pastorello.cf: could not connect to host
-pastormaremanoabruzes.com.br: could not connect to host
-pastorsuico.com.br: could not connect to host
-pat-edu.org: did not receive HSTS header
-pataua.kiwi: did not receive HSTS header
-paternitydnatest.com: could not connect to host
-paterno-gaming.com: could not connect to host
-patfs.com: did not receive HSTS header
-pathwaytofaith.com: could not connect to host
-patientinsight.net: could not connect to host
-patouille-et-gribouille.fr: could not connect to host
-patriaco.net: did not receive HSTS header
-patriciaramos.pt: did not receive HSTS header
-patrick-omland.de: could not connect to host
-patrick-omland.eu: could not connect to host
-patrick.dark.name: could not connect to host
-patrickbusch.net: could not connect to host
-patricklynch.xyz: did not receive HSTS header
-patrickmcnamara.xyz: did not receive HSTS header
-patrickneuro.de: could not connect to host
-patrickquinn.ca: did not receive HSTS header
-patrykwegrzynek.pl: did not receive HSTS header
-patsch-photography.de: could not connect to host
-patt.us: could not connect to host
-patterson.mp: could not connect to host
-paul-bronski.de: did not receive HSTS header
-paul-kerebel.pro: could not connect to host
-paulbunyanmls.com: did not receive HSTS header
-paulewen.ca: could not connect to host
-paulomonteiro.pt: did not receive HSTS header
-paulorochago.com.br: could not connect to host
-paulpetersen.dk: did not receive HSTS header
-paulproell.at: did not receive HSTS header
-paulrudge.codes: could not connect to host
-paulshir.com: could not connect to host
-paulshir.is: could not connect to host
-paulyang.cn: did not receive HSTS header
-pause-canap.com: did not receive HSTS header
-pauspam.net: could not connect to host
-paveljanda.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-pavelkahouseforcisco.com: did not receive HSTS header
-pavio.org: did not receive HSTS header
-pawnkingloansmore.com: did not receive HSTS header
-pawsomebox.co.uk: could not connect to host
-paxdei.com.br: could not connect to host
-paxwinkel.nl: did not receive HSTS header
-pay.gigahost.dk: did not receive HSTS header
-pay.ubuntu.com: could not connect to host
-pay8522.com: could not connect to host
-paybook.co.tz: did not receive HSTS header
-payclixpayments.com: did not receive HSTS header
-paydigital.pt: did not receive HSTS header
-payfreez.com: could not connect to host
-paykings.com: did not receive HSTS header
-payload.tech: could not connect to host
-payment-network.com: did not receive HSTS header
-payment.ac.cn: could not connect to host
-payments-reference.org: could not connect to host
-payments.google.com: did not receive HSTS header (error ignored - included regardless)
-payments.gy: did not receive HSTS header
-paymill.com: did not receive HSTS header
-paymill.de: could not connect to host
-paymon.tj: could not connect to host
-paypod.org: could not connect to host
-payroll.ch: could not connect to host
-payroll.xero.com: did not receive HSTS header
-payrollhive.com: did not receive HSTS header
-paytwopay.com: could not connect to host
-paywait.com: could not connect to host
-payzang.com: did not receive HSTS header
-payzwin.com: could not connect to host
-pb-design.ch: could not connect to host
-pback.se: could not connect to host
-pbapp.net: did not receive HSTS header
-pbbr.com: did not receive HSTS header
-pbcknd.ml: could not connect to host
-pbcomp.com.au: did not receive HSTS header
-pbfashionexhibition.com: did not receive HSTS header
-pbprint.ru: could not connect to host
-pbqs.site: could not connect to host
-pbraunschdash.com: could not connect to host
-pbrb.gov: could not connect to host
-pbreen.co.uk: could not connect to host
-pbscreens.com: could not connect to host
-pbytes.com: could not connect to host
-pbz.pw: did not receive HSTS header
-pc-nf.de: did not receive HSTS header
-pc-servis-brno.com: could not connect to host
-pc-tweak.de: did not receive HSTS header
-pc9865.com: max-age too low: 0
-pcat.io: could not connect to host
-pcbricole.fr: could not connect to host
-pccentral.nl: did not receive HSTS header
-pcforum.sk: did not receive HSTS header
-pcfun.net: could not connect to host
-pchax.net: could not connect to host
-pchospital.cc: could not connect to host
-pci-dss.hu: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-pci4.org: did not receive HSTS header
-pcidss.hu: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-pcipac.com: did not receive HSTS header
-pcmobile.tech: could not connect to host
-pcnotdienst-oldenburg-rastede.de: could not connect to host
-pcreparatiehardenberg.nl: could not connect to host
-pcsremodel.com: could not connect to host
-pcvirusclear.com: could not connect to host
-pdamsidoarjo.co.id: could not connect to host
-pdevio.com: could not connect to host
-pdf.yt: could not connect to host
-pdfsearch.org: could not connect to host
-pdomo.me: did not receive HSTS header
-pdragt.com: could not connect to host
-pdthings.net: could not connect to host
-pe-kyousai.jp: did not receive HSTS header
-peaceandwool.com: did not receive HSTS header
-peak-careers.com: did not receive HSTS header
-peakapp.nl: could not connect to host
-pearcom.co.uk: could not connect to host
-pearlcohen.com: could not connect to host
-pearlsenroses.nl: did not receive HSTS header
-peaudorange.net: could not connect to host
-pebblesdemo.com: could not connect to host
-peckcloths.com: did not receive HSTS header
-pecot.fr: did not receive HSTS header
-pedidamanosevilla.com: did not receive HSTS header
-pedidosfarma.com.br: could not connect to host
-pedrosluiter.nl: did not receive HSTS header
-peekops.com: could not connect to host
-peelland-fm.tk: could not connect to host
-peen.ch: could not connect to host
-peerherrmann.de: could not connect to host
-peerless.ae: could not connect to host
-peertube.uno: did not receive HSTS header
-peervpn.net: did not receive HSTS header
-pefricea.com: did not receive HSTS header
-peg.nu: did not receive HSTS header
-pegundugun.tk: could not connect to host
-pehapkari.cz: did not receive HSTS header
-peinard.net: could not connect to host
-peintrenomade.com: did not receive HSTS header
-peirong.me: could not connect to host
-peissen.com: could not connect to host
-peka.pw: did not receive HSTS header
-pekkapikkarainen.fi: could not connect to host
-pekkarik.ru: could not connect to host
-peliculasaudiolatinoonline.com: could not connect to host
-peliculasonline1.com: did not receive HSTS header
-peliculator.com: max-age too low: 0
-peliseries24.com: could not connect to host
-pemagrid.org: could not connect to host
-pemberton.at: did not receive HSTS header
-pemborongbangunan.id: could not connect to host
-penablog.com: did not receive HSTS header
-pengisatelier.net: could not connect to host
-pengui.uk: could not connect to host
-penguinclientsystem.com: did not receive HSTS header
-pengumuman.id: did not receive HSTS header
-pennyapp.io: did not receive HSTS header
-pennylane.me.uk: did not receive HSTS header
-pensanisso.com: did not receive HSTS header
-penser-electronique.com: did not receive HSTS header
-pension-veldzigt.nl: did not receive HSTS header
-pension-waldesruh.de: did not receive HSTS header
-pensionecani.milano.it: could not connect to host
-pentagonreviewcenter.com.ph: did not receive HSTS header
-pentandra.com: could not connect to host
-pentano.net: could not connect to host
-people-mozilla.org: could not connect to host
-peoplesbankal.com: did not receive HSTS header
-peoplesguardian.org: could not connect to host
-peperiot.com: did not receive HSTS header
-peperstraat.online: could not connect to host
-peppelmedi.fi: could not connect to host
-pepper.dog: could not connect to host
-pepperhead.com: did not receive HSTS header
-pepperworldhotshop.de: did not receive HSTS header
-pepsicoemployeepreferencesurvey.com: could not connect to host
-pepwaterproofing.com: did not receive HSTS header
-per-pedes.at: did not receive HSTS header
-pera.gs: could not connect to host
-percloud.ddns.net: could not connect to host
-percyflix.com: could not connect to host
-perdel.cn: could not connect to host
-pereuda.com: could not connect to host
-perfect-radiant-wrinkles.com: could not connect to host
-perfectionis.me: did not receive HSTS header
-perfectionunite.com: could not connect to host
-perfectseourl.com: did not receive HSTS header
-perfektesgewicht.com: could not connect to host
-performancesantafe.org: did not receive HSTS header
-performaride.com.au: could not connect to host
-performaterm.ro: could not connect to host
-performous.org: did not receive HSTS header
-perfumeaz.com: did not receive HSTS header
-perfumista.vn: did not receive HSTS header
-peridotcapitalpartners.com: could not connect to host
-periodismoactual.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-periscopeliveweb.com: could not connect to host
-perlwork.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-perm-jur.ch: could not connect to host
-perm-juridique.ch: could not connect to host
-permanence-juridique.com: could not connect to host
-permanencejuridique-ge.ch: could not connect to host
-permanencejuridique.com: could not connect to host
-permista.nl: did not receive HSTS header
-pernatie.ru: could not connect to host
-peromsik.com: did not receive HSTS header
-perplex.nl: did not receive HSTS header
-perrau.lt: could not connect to host
-perrone.co: could not connect to host
-perroud.pro: max-age too low: 0
-persiart.shop: could not connect to host
-persjrp.ca: could not connect to host
-persoform.ch: could not connect to host
-personal-injury-attorney.co: could not connect to host
-personalcommunicationsecurity.com: could not connect to host
-personaldatabasen.no: could not connect to host
-personalfunctionaldata.net: could not connect to host
-personalidadmagnetica.com: could not connect to host
-personalinjurylist.com: could not connect to host
-personalizedtouch.co: could not connect to host
-personcar.com.br: could not connect to host
-personnedisparue.fr: could not connect to host
-persson.im: could not connect to host
-perthdevicelab.com: did not receive HSTS header
-perucasestoril.com.br: did not receive HSTS header
-peruvianphotography.com: could not connect to host
-pescadorcomunicacao.com: could not connect to host
-pesdacgh.org: did not receive HSTS header
-pestalozzishop.com.br: could not connect to host
-pestkill.info: could not connect to host
-pesto.video: could not connect to host
-pet-life.top: did not receive HSTS header
-pet-nsk.ru: could not connect to host
-pet-tekk.co.uk: could not connect to host
-petangen.se: could not connect to host
-petaouchnok.ch: could not connect to host
-petchart.net: could not connect to host
-peteboc.com: did not receive HSTS header
-peterbarrett.ca: could not connect to host
-peterfolta.net: could not connect to host
-peterkshultz.com: could not connect to host
-petermazur.com: did not receive HSTS header
-peternagy.ie: did not receive HSTS header
-peters.consulting: could not connect to host
-petersmark.com: did not receive HSTS header
-pethelpers.org: did not receive HSTS header
-petit.site: could not connect to host
-petlife.od.ua: could not connect to host
-petplum.com: could not connect to host
-petrkrapek.cz: could not connect to host
-petroscand.eu: could not connect to host
-petrostathis.com: could not connect to host
-petrovsky.pro: could not connect to host
-petrozavodsk.ga: could not connect to host
-pets4life.com.au: did not receive HSTS header
-petsittersservices.com: could not connect to host
-pettitcoat.com: could not connect to host
-peuf.shop: could not connect to host
-peuterspeelzaalhoekvanholland.nl: could not connect to host
-pewat.com: could not connect to host
-pewboards.com: could not connect to host
-pexieapp.com: did not receive HSTS header
-peykezamin.ir: did not receive HSTS header
-peytonfarrar.com: did not receive HSTS header
-pfarchimedes-pensioen123.nl: could not connect to host
-pferdeeinstreu-kaufen.com: did not receive HSTS header
-pferdekauf.de: did not receive HSTS header
-pfgshop.com.br: could not connect to host
-pflegedienst-gratia.de: could not connect to host
-pflegesalon-siebke.de: did not receive HSTS header
-pflug.email: did not receive HSTS header
-pfo.io: did not receive HSTS header
-pfolta.net: could not connect to host
-pfssales.com: did not receive HSTS header
-pfudor.tk: could not connect to host
-pgcpbc.com: could not connect to host
-pglandscapingpaving.com: did not receive HSTS header
-pglaum.tk: could not connect to host
-pgmsource.com: could not connect to host
-pgp.guru: could not connect to host
-pgp.lol: could not connect to host
-pgp.network: did not receive HSTS header
-pgpm.io: could not connect to host
-pgtb.be: could not connect to host
-pgwap.com: could not connect to host
-phalconist.com: did not receive HSTS header
-phantasie.cc: could not connect to host
-pharmacyglobalrx.net: could not connect to host
-pharmaquality.com: did not receive HSTS header
-phasersec.com: did not receive HSTS header
-phattea.tk: could not connect to host
-phcmembers.com: could not connect to host
-phdhub.it: could not connect to host
-phdsupply.com: could not connect to host
-phdwuda.com: could not connect to host
-phen-garcinia.info: could not connect to host
-phenomeno-porto.com: did not receive HSTS header
-phenomeno.nl: did not receive HSTS header
-phenomenoporto.com: did not receive HSTS header
-phenomenoporto.nl: did not receive HSTS header
-phhtc.ir: did not receive HSTS header
-phialo.de: did not receive HSTS header
-phil-phillies.com: could not connect to host
-philadelphiacandies.com: did not receive HSTS header
-philadelphiadancefoundation.org: did not receive HSTS header
-philia.de: did not receive HSTS header
-philipkohn.com: did not receive HSTS header
-philipmordue.co.uk: could not connect to host
-philipp1994.de: did not receive HSTS header
-philippa.cool: could not connect to host
-philippbirkholz.com: could not connect to host
-phillippi.me: could not connect to host
-phillmoore.com: did not receive HSTS header
-phillprice.com: did not receive HSTS header
-phillyinjurylawyer.com: did not receive HSTS header
-philomathiclife.com: could not connect to host
-philonas.net: did not receive HSTS header
-philpropertygroup.com: could not connect to host
-phippsreporting.com: did not receive HSTS header
-phishing-studie.org: could not connect to host
-phishing.rs: could not connect to host
-phishingusertraining.com: could not connect to host
-phligence.com: could not connect to host
-phocean.net: did not receive HSTS header
-phoebe.co.nz: did not receive HSTS header
-phoenicis.com.ua: could not connect to host
-phoenix.dj: did not receive HSTS header
-phonefleet.fr: could not connect to host
-phonenumberinfo.co.uk: could not connect to host
-phongmay24h.com: could not connect to host
-phonix-company.fr: could not connect to host
-phood.be: did not receive HSTS header
-photek.fm: could not connect to host
-photoblogverona.com: could not connect to host
-photoboothpartyhire.co.uk: did not receive HSTS header
-photofilmcamera.com: did not receive HSTS header
-photographersdaydream.com: could not connect to host
-photographyforchange.com: could not connect to host
-photographyforchange.org: could not connect to host
-photon.sh: could not connect to host
-photops.fr: could not connect to host
-photosoftware.nl: could not connect to host
-phototag.org: did not receive HSTS header
-php-bach.org: could not connect to host
-phpdistribution.com: did not receive HSTS header
-phperformances.fr: could not connect to host
-phpinfo.in.th: could not connect to host
-phpkari.cz: could not connect to host
-phr34kz.pw: could not connect to host
-phra.gs: could not connect to host
-phrasing.me: could not connect to host
-phrazor.com: did not receive HSTS header
-phrive.space: could not connect to host
-phryanjr.com: could not connect to host
-phukienchanh.com: could not connect to host
-phumin.in.th: did not receive HSTS header
-phunehehe.net: did not receive HSTS header
-phuong.faith: could not connect to host
-phus.lu: did not receive HSTS header
-physicaltherapist.com: did not receive HSTS header
-physicentrix.ca: did not receive HSTS header
-physiobiggerawaters.com.au: could not connect to host
-physiobroadbeach.com.au: could not connect to host
-pi-box.ml: could not connect to host
-pi-eng.fr: could not connect to host
-pianetaottica.eu: could not connect to host
-pianetaottica.info: could not connect to host
-pianetaottica.it: could not connect to host
-pianetaottica.net: could not connect to host
-pianetaottica.org: could not connect to host
-pias-button.net: could not connect to host
-piasto.com.cy: could not connect to host
-piatanoua.md: could not connect to host
-pic.sr: could not connect to host
-picallo.es: could not connect to host
-picardiascr.com: did not receive HSTS header
-pickawaycountyohio.gov: could not connect to host
-pickersurvey.org: did not receive HSTS header
-pickr.co: did not receive HSTS header
-picoauto.com: max-age too low: 0
-picone.com.au: could not connect to host
-picotech.com: max-age too low: 0
-picotronic.biz: could not connect to host
-picotronic.de: max-age too low: 0
-picsandtours.com: could not connect to host
-picscare.co.uk: could not connect to host
-picshare.nz: could not connect to host
-picster.at: did not receive HSTS header
-pidatacenters.com: did not receive HSTS header
-pidomex.com: did not receive HSTS header
-piedfeed.com: did not receive HSTS header
-pieinsurance.com: did not receive HSTS header
-piekacz.co.uk: could not connect to host
-pieldenaranja.com: could not connect to host
-pieperhome.de: did not receive HSTS header
-piercing-store.com: did not receive HSTS header
-pierreblake.com: did not receive HSTS header
-pierrejeansuau.fr: could not connect to host
-pieterjangeeroms.me: could not connect to host
-pig.name: did not receive HSTS header
-piggott.me.uk: did not receive HSTS header
-pignus.tech: could not connect to host
-pigritia.de: could not connect to host
-piils.fr: did not receive HSTS header
-pikalongwar.com: could not connect to host
-pikeitservices.com.au: did not receive HSTS header
-pikmy.com: could not connect to host
-pilesyk.tk: could not connect to host
-pilgermaske.org: did not receive HSTS header
-piligrimname.com: could not connect to host
-piliszek.net: could not connect to host
-pillowandpepper.com: did not receive HSTS header
-pilotcrowd.nl: did not receive HSTS header
-pimg136.com: could not connect to host
-pims.global: did not receive HSTS header
-pimspage.nl: could not connect to host
-pimusiccloud.hopto.org: could not connect to host
-pincong.rocks: did not receive HSTS header
-pineapplesapp.com: did not receive HSTS header
-pinebaylibrary.org: could not connect to host
-pinigseu.xyz: could not connect to host
-pinkcasino.co.uk: did not receive HSTS header
-pinkfis.ch: did not receive HSTS header
-pinkhq.com: could not connect to host
-pinkinked.com: could not connect to host
-pinkladyapples.co.uk: did not receive HSTS header
-pinkyf.com: did not receive HSTS header
-pinnacle-tex.com: could not connect to host
-pinnacleallergy.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-pinnaclelife.nz: could not connect to host
-pinnacles.com: max-age too low: 0
-pinner.io: did not receive HSTS header
-pinoylinux.org: did not receive HSTS header
-pinpointline.com: did not receive HSTS header
-pinscher.com.br: could not connect to host
-pinter-moebel-shop.de: did not receive HSTS header
-pintiaux.com: could not connect to host
-pintoselectrician.co.za: did not receive HSTS header
-pinup-app.com: could not connect to host
-pioche.ovh: did not receive HSTS header
-pipfrosch.com: could not connect to host
-pipocao.com: could not connect to host
-pippen.io: could not connect to host
-pips.rocks: could not connect to host
-pir9.com: could not connect to host
-piranil.com: did not receive HSTS header
-pirapiserver.ddns.net: could not connect to host
-pirata.ga: could not connect to host
-pirateahoy.eu: could not connect to host
-piratebay.ml: could not connect to host
-piratebit.tech: could not connect to host
-piratedb.com: could not connect to host
-piratedot.com: could not connect to host
-piratelist.online: could not connect to host
-piratenlogin.de: did not receive HSTS header
-piratepay.io: could not connect to host
-piratepay.ir: could not connect to host
-pirateproxy.pe: could not connect to host
-pirateproxy.sx: did not receive HSTS header
-pirateproxy.tf: could not connect to host
-pirateproxy.vip: could not connect to host
-pirates.click: did not receive HSTS header
-pirati.cz: did not receive HSTS header
-piratte.net: did not receive HSTS header
-pirganj24.com: could not connect to host
-pirlitu.com: did not receive HSTS header
-pirscapital.com: did not receive HSTS header
-pisexy.me: did not receive HSTS header
-pisidia.de: could not connect to host
-pitch.vip: did not receive HSTS header
-pitfire.io: could not connect to host
-pitonarms.com: could not connect to host
-pitsstop.nu: could not connect to host
-pittaya.com: did not receive HSTS header
-pittmancentertn.gov: could not connect to host
-pittmantraffic.co.uk: did not receive HSTS header
-pittonpreschool.com: did not receive HSTS header
-pix-geeks.com: max-age too low: 2592000
-pixabay.com: did not receive HSTS header
-pixdigital.net: did not receive HSTS header
-pixeame.com: could not connect to host
-pixel.google.com: did not receive HSTS header (error ignored - included regardless)
-pixelcode.com.au: could not connect to host
-pixelesque.uk: could not connect to host
-pixelfou.com: could not connect to host
-pixelgliders.de: could not connect to host
-pixelhero.co.uk: did not receive HSTS header
-pixelpirat.ch: did not receive HSTS header
-pixelrain.info: could not connect to host
-pixi.chat: could not connect to host
-pixi.me: could not connect to host
-pixiv.rip: did not receive HSTS header
-pixulutinho.com.br: could not connect to host
-pizala.de: could not connect to host
-pizzabottle.com: did not receive HSTS header
-pizzacook.ch: did not receive HSTS header
-pizzadoc.ch: could not connect to host
-pizzafest.ddns.net: could not connect to host
-pizzafunny.com.br: could not connect to host
-pizzamc.eu: could not connect to host
-pizzariapartiupizza.com.br: max-age too low: 0
-pj00100.com: did not receive HSTS header
-pj00200.com: did not receive HSTS header
-pj00300.com: did not receive HSTS header
-pj00400.com: did not receive HSTS header
-pj00600.com: did not receive HSTS header
-pj00700.com: did not receive HSTS header
-pj00800.com: did not receive HSTS header
-pj009.com: could not connect to host
-pj00900.com: did not receive HSTS header
-pj1100.cc: did not receive HSTS header
-pj21k.com: could not connect to host
-pj21m.com: could not connect to host
-pj539999.com: could not connect to host
-pj881988.com: could not connect to host
-pjbet.mg: could not connect to host
-pjili.com: did not receive HSTS header
-pjsec.tk: could not connect to host
-pkautodesign.com: did not receive HSTS header
-pkbjateng.com: could not connect to host
-pkov.cz: could not connect to host
-pkrank.com: could not connect to host
-pkschat.com: could not connect to host
-pksps.com: did not receive HSTS header
-plaasprodukte.com: did not receive HSTS header
-placassinal.com.br: did not receive HSTS header
-placefade.com: could not connect to host
-placehold.co: did not receive HSTS header
-placollection.org: could not connect to host
-plaettliaktion.ch: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-plainmark.com: did not receive HSTS header
-plaintray.com: could not connect to host
-plakbak.nl: could not connect to host
-planeexplanation.com: could not connect to host
-planer.me: did not receive HSTS header
-planet-laas.de: did not receive HSTS header
-planetbeauty.com: did not receive HSTS header
-planete-cocoon.com: did not receive HSTS header
-planete-secu.com: could not connect to host
-planformation.com: did not receive HSTS header
-planktonholland.com: did not receive HSTS header
-planktonholland.nl: did not receive HSTS header
-planningsagenda.nl: did not receive HSTS header
-planolowcarb.com: could not connect to host
-planpharmacy.com: could not connect to host
-plant.ml: could not connect to host
-plantdaddie.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-planup.fr: could not connect to host
-plaros.ml: could not connect to host
-plasdeck.me: could not connect to host
-plass.hamburg: could not connect to host
-plasti-pac.ch: did not receive HSTS header
-plasvilledescartaveis.com.br: could not connect to host
-platform.lookout.com: could not connect to host
-platinumpeek.com: did not receive HSTS header
-platomania.eu: could not connect to host
-platschi.net: did not receive HSTS header
-platterlauncher.com: could not connect to host
-plattner.club: did not receive HSTS header
-play: could not connect to host
-play.google.com: did not receive HSTS header (error ignored - included regardless)
-playdreamcraft.com.br: did not receive HSTS header
-playerhunter.com: did not receive HSTS header
-players2gather.com: could not connect to host
-playerscout.net: did not receive HSTS header
-playform.cloud: could not connect to host
-playhappywheelsunblocked.com: could not connect to host
-playingvideojuegos.com: did not receive HSTS header
-playkh.com: did not receive HSTS header
-playkinder.com: did not receive HSTS header
-playmaker.io: could not connect to host
-playmaza.live: could not connect to host
-playmei.com: did not receive HSTS header
-playmfe.com: could not connect to host
-playsoundevents.be: did not receive HSTS header
-playsource.co: did not receive HSTS header
-playupnow.com: could not connect to host
-playwhyyza.com: could not connect to host
-playyou.be: could not connect to host
-playzonecastles.co.uk: did not receive HSTS header
-pld-entertainment.co.uk: could not connect to host
-pleasanton-daycare-childcare.com: did not receive HSTS header
-pleasantonca.gov: could not connect to host
-please-deny.me: could not connect to host
-pleaseuseansnisupportedbrowser.ml: could not connect to host
-pleasure.forsale: could not connect to host
-pleger.tk: could not connect to host
-pleiades.com.tr: did not receive HSTS header
-plen.io: did not receive HSTS header
-plentybetter.com: could not connect to host
-plentybetter.org: could not connect to host
-plexbpvr.ddns.net: could not connect to host
-plexi.dyndns.tv: could not connect to host
-plexnet.cz: could not connect to host
-plexpy13.ddns.net: could not connect to host
-plextv.de: could not connect to host
-plexusmd.com: did not receive HSTS header
-plfgr.eu.org: could not connect to host
-plhdb.org: did not receive HSTS header
-plicca.com: did not receive HSTS header
-plichso.de: could not connect to host
-plinc.co: did not receive HSTS header
-plirt.ru: could not connect to host
-plochka.bg: could not connect to host
-plogable.co: could not connect to host
-plombirator.kz: did not receive HSTS header
-plothost.com: did not receive HSTS header
-ploup.net: could not connect to host
-plu-pro.ru: could not connect to host
-pluff.nl: did not receive HSTS header
-plugboard.xyz: could not connect to host
-pluggedhead.com: did not receive HSTS header
-plumbingboksburg.co.za: did not receive HSTS header
-plumbingman.com.au: did not receive HSTS header
-plumpie.net: could not connect to host
-plumplat.com: could not connect to host
-plurr.me: did not receive HSTS header
-plurr.us: did not receive HSTS header
-plus-digital.net: did not receive HSTS header
-plus-u.com.au: did not receive HSTS header
-plus.sandbox.google.com: did not receive HSTS header (error ignored - included regardless)
-plus1s.site: could not connect to host
-plus1s.tk: could not connect to host
-plushev.com: did not receive HSTS header
-plusminus30.si: did not receive HSTS header
-plusreed.com: could not connect to host
-plussizereviews.com: could not connect to host
-plustech.id: did not receive HSTS header
-plut.org: could not connect to host
-plymouthglassgallery.com: did not receive HSTS header
-plymouthsoftplay.co.uk: did not receive HSTS header
-plzenskybarcamp.cz: did not receive HSTS header
-pm13-media.cz: could not connect to host
-pma-iss.com: could not connect to host
-pmac.pt: could not connect to host
-pmarques.info: could not connect to host
-pmbremer.de: could not connect to host
-pmbtf.com: could not connect to host
-pmconference.ch: did not receive HSTS header
-pmctire.com: did not receive HSTS header
-pmemanager.fr: did not receive HSTS header
-pmessage.ch: could not connect to host
-pmheart.site: could not connect to host
-pmklaassen.com: did not receive HSTS header
-pmnts.io: could not connect to host
-pmponline.de: could not connect to host
-pms.myiphost.com: could not connect to host
-pmsacorp.com: did not receive HSTS header
-pmsf.eu: could not connect to host
-pmsfdev.com: could not connect to host
-pmt-documenten.nl: could not connect to host
-pnakosoft.com: could not connect to host
-pnakosoft.com.au: could not connect to host
-pneumonline.be: did not receive HSTS header
-pneusgppremium.com.br: did not receive HSTS header
-pnoec.org.do: could not connect to host
-pnukee.com: could not connect to host
-poba.fr: did not receive HSTS header
-poc.xn--fiqs8s: could not connect to host
-poc060.com: could not connect to host
-poc080.com: could not connect to host
-poc090.com: could not connect to host
-poc100.com: could not connect to host
-poc109.com: could not connect to host
-poc11.com: could not connect to host
-poc116.com: could not connect to host
-poc118.com: could not connect to host
-poc119.com: could not connect to host
-poc120.com: could not connect to host
-poc128.com: could not connect to host
-poc13.com: could not connect to host
-poc15.com: could not connect to host
-poc16.com: could not connect to host
-poc17.com: could not connect to host
-poc18.com: could not connect to host
-poc19.com: could not connect to host
-poc21.com: could not connect to host
-poc211.com: could not connect to host
-poc22.com: could not connect to host
-poc226.com: could not connect to host
-poc228.com: could not connect to host
-poc23.com: could not connect to host
-poc25.com: could not connect to host
-poc26.com: could not connect to host
-poc261.com: could not connect to host
-poc262.com: could not connect to host
-poc27.com: could not connect to host
-poc290.com: could not connect to host
-poc298.com: could not connect to host
-poc31.com: could not connect to host
-poc32.com: could not connect to host
-poc33.com: could not connect to host
-poc35.com: could not connect to host
-poc36.com: could not connect to host
-poc37.com: could not connect to host
-poc38.com: could not connect to host
-poc51.com: could not connect to host
-poc518.com: could not connect to host
-poc52.com: could not connect to host
-poc53.com: could not connect to host
-poc55.com: could not connect to host
-poc56.com: could not connect to host
-poc568.com: could not connect to host
-poc57.com: could not connect to host
-poc58.com: could not connect to host
-poc586.com: could not connect to host
-poc588.com: could not connect to host
-poc59.com: could not connect to host
-poc601.com: could not connect to host
-poc618.com: could not connect to host
-poc63.com: could not connect to host
-poc65.com: could not connect to host
-poc66.com: could not connect to host
-poc661.com: could not connect to host
-poc663.com: could not connect to host
-poc665.com: could not connect to host
-poc668.com: could not connect to host
-poc669.com: could not connect to host
-poc67.com: could not connect to host
-poc68.com: could not connect to host
-poc69.com: could not connect to host
-poc699.com: could not connect to host
-poc7.com: could not connect to host
-poc71.com: could not connect to host
-poc718.com: could not connect to host
-poc72.com: could not connect to host
-poc75.com: could not connect to host
-poc76.com: could not connect to host
-poc768.com: could not connect to host
-poc77.com: could not connect to host
-poc771.com: could not connect to host
-poc772.com: could not connect to host
-poc773.com: could not connect to host
-poc779.com: could not connect to host
-poc78.com: could not connect to host
-poc79.com: could not connect to host
-poc8.com: could not connect to host
-poc816.com: could not connect to host
-poc86.com: could not connect to host
-poc866.com: could not connect to host
-poc88.com: could not connect to host
-poc88.vip: could not connect to host
-poc8811.com: could not connect to host
-poc882.com: could not connect to host
-poc8822.com: could not connect to host
-poc883.com: could not connect to host
-poc8833.com: could not connect to host
-poc885.com: could not connect to host
-poc8855.com: could not connect to host
-poc886.com: could not connect to host
-poc8866.com: could not connect to host
-poc887.com: could not connect to host
-poc8877.com: could not connect to host
-poc888.com: could not connect to host
-poc889.com: could not connect to host
-poc8899.com: could not connect to host
-poc89.com: could not connect to host
-poc899.com: could not connect to host
-poc916.com: could not connect to host
-poc918.com: could not connect to host
-poc965.com: could not connect to host
-poc98.com: could not connect to host
-poc99.com: could not connect to host
-poc992.com: could not connect to host
-poc993.com: could not connect to host
-poc995.com: could not connect to host
-poc996.com: could not connect to host
-poc997.com: could not connect to host
-poc998.com: could not connect to host
-pocakdrops.com: could not connect to host
-pocakking.tk: could not connect to host
-pocket-lint.com: did not receive HSTS header
-pocketfullofapps.com: did not receive HSTS header
-pocketmemories.net: could not connect to host
-pocketsix.com: could not connect to host
-pocloud.homelinux.net: could not connect to host
-pocpok.com: could not connect to host
-pocqipai.com: could not connect to host
-podcast.style: could not connect to host
-podiumsdiskussion.org: did not receive HSTS header
-podo-podo.com: could not connect to host
-podxappa.com.ua: did not receive HSTS header
-poedgirl.com: did not receive HSTS header
-poeg.cz: did not receive HSTS header
-poezjagala.pl: could not connect to host
-pogs.us: could not connect to host
-poinsot.beer: could not connect to host
-pointcab.vn: could not connect to host
-pointclickcare.com: did not receive HSTS header
-pointeringles.com: could not connect to host
-pointhost.de: could not connect to host
-pointpro.de: did not receive HSTS header
-points-pote.com: could not connect to host
-points4unitedway.com: could not connect to host
-pointsgame.net: did not receive HSTS header
-pointworksacademy.com: could not connect to host
-pokalsocial.de: could not connect to host
-pokeduel.me: did not receive HSTS header
-pokepon.center: could not connect to host
-pokerslab.com: could not connect to host
-pokomichi.com: did not receive HSTS header
-pol-expo.ru: could not connect to host
-pol.in.th: could not connect to host
-polandb2b.directory: could not connect to host
-polar.uk.com: did not receive HSTS header
-polarfisk.com: did not receive HSTS header
-polarityschule.com: did not receive HSTS header
-pole-et-motion.fr: did not receive HSTS header
-pole.net.nz: did not receive HSTS header
-poleartschool.com: could not connect to host
-polen.guide: could not connect to host
-policeiwitness.sg: could not connect to host
-policyreporter.us: could not connect to host
-polimat.org: could not connect to host
-poliscentraal.nl: did not receive HSTS header
-polish.directory: could not connect to host
-polit-it.pro: could not connect to host
-politeiaudesa.org: max-age too low: 2592000
-politicachubut.com.ar: did not receive HSTS header
-politically-incorrect.xyz: could not connect to host
-politiewervingshop.nl: did not receive HSTS header
-politologos.org: could not connect to host
-polizeiwallis.ch: could not connect to host
-pollet-ghijs.be: could not connect to host
-pollet-ghys.be: could not connect to host
-pollpodium.nl: could not connect to host
-pologalileo.eu: did not receive HSTS header
-poloniex.co.za: did not receive HSTS header
-polsport.live: did not receive HSTS header
-poly-fast.com: could not connect to host
-polycrypt.us: could not connect to host
-polyfill.io: did not receive HSTS header
-polymorph.rs: could not connect to host
-polypho.nyc: could not connect to host
-polyr.xyz: could not connect to host
-polysage.org: did not receive HSTS header
-polytechecosystem.vc: could not connect to host
-pomardaserra.com: could not connect to host
-pomfe.co: could not connect to host
-pomfeed.fr: could not connect to host
-pommetelecom.fr: could not connect to host
-pomozmruczkom.pl: could not connect to host
-pompefunebrilariviera.it: could not connect to host
-pompompoes.com: could not connect to host
-pondof.fish: could not connect to host
-poneytelecom.org: could not connect to host
-ponio.xyz: could not connect to host
-ponteencima.com: could not connect to host
-ponteus.com: could not connect to host
-pontodogame.com.br: could not connect to host
-pontokay.com.br: could not connect to host
-pontualcomp.com: could not connect to host
-pony.today: could not connect to host
-ponycyclepals.co.uk: could not connect to host
-ponythread.com: did not receive HSTS header
-ponzi.life: could not connect to host
-poochingaround.co.uk: did not receive HSTS header
-poolinstallers.co.za: could not connect to host
-poolmans.se: did not receive HSTS header
-poolsandstuff.com: did not receive HSTS header
-poolspondsandwaterscapes.com: could not connect to host
-pooltechthailand.com: max-age too low: 1000
-poon.tech: could not connect to host
-poorstock.com: did not receive HSTS header
-popcorncult.ru: could not connect to host
-popi.se: did not receive HSTS header
-popkins.cf: could not connect to host
-popkins.ga: could not connect to host
-popkins.gq: could not connect to host
-popkins.ml: could not connect to host
-popkins.tk: could not connect to host
-popupsoftplay.com: could not connect to host
-poris.web.id: did not receive HSTS header
-pormat.cl: did not receive HSTS header
-porn2019.tk: could not connect to host
-pornblog.org: could not connect to host
-porncandi.com: could not connect to host
-porniwi.com: could not connect to host
-pornofilme.top: could not connect to host
-pornoserver.eu: did not receive HSTS header
-pornskyhub.com: could not connect to host
-pornspider.to: could not connect to host
-pornstars.me: did not receive HSTS header
-porondam.lk: did not receive HSTS header
-porschen.fr: could not connect to host
-port.im: did not receive HSTS header
-port.social: could not connect to host
-portablebuildingsales.co.uk: did not receive HSTS header
-portablespeakersfinder.com: could not connect to host
-portagein.gov: did not receive HSTS header
-portalcarapicuiba.com: did not receive HSTS header
-portalcarriers.com: could not connect to host
-portalcentric.net: could not connect to host
-portale-randkowe.pl: could not connect to host
-portalhubnuti.cz: did not receive HSTS header
-portalisapres.cl: could not connect to host
-portalkla.com.br: did not receive HSTS header
-portalm.tk: could not connect to host
-portalmundo.xyz: could not connect to host
-portalplatform.net: could not connect to host
-portaluniversalista.org: could not connect to host
-portalveneza.com.br: did not receive HSTS header
-portalzine.de: did not receive HSTS header
-portofacil.com: did not receive HSTS header
-portraitsystem.biz: did not receive HSTS header
-portsmoutheic.com: could not connect to host
-portvincentcaravanpark.com.au: did not receive HSTS header
-pos.co.tz: did not receive HSTS header
-posalji.me: did not receive HSTS header
-poschtiliste.ch: did not receive HSTS header
-poshbeyond.com: did not receive HSTS header
-poshpak.com: max-age too low: 86400
-posijson.stream: could not connect to host
-positivenames.net: could not connect to host
-positivesobrietyinstitute.com: did not receive HSTS header
-posoiu.net: could not connect to host
-post.com.ar: could not connect to host
-postback.io: could not connect to host
-postcardpayment.com: could not connect to host
-postcodegarant.nl: could not connect to host
-posters.win: could not connect to host
-postscheduler.org: could not connect to host
-postura-corretta.it: could not connect to host
-posylka.de: did not receive HSTS header
-potatoheads.net: could not connect to host
-potbox.com: did not receive HSTS header
-potenzmittelblog.info: could not connect to host
-poterepersonale.it: did not receive HSTS header
-potkani.tk: could not connect to host
-potomania.cz: could not connect to host
-potpourrifestival.de: did not receive HSTS header
-potsky.com: did not receive HSTS header
-potterscraftcider.com: did not receive HSTS header
-pottreid.com: could not connect to host
-pouets.ovh: could not connect to host
-poupatempo.org: did not receive HSTS header
-pour-la-culture-aulnay.fr: could not connect to host
-pourmesloisirs.com: could not connect to host
-pourmoi.co.uk: did not receive HSTS header
-pourout.org: did not receive HSTS header
-pousadaestreladapraia.com.br: could not connect to host
-poussinooz.fr: could not connect to host
-povertymind.com: did not receive HSTS header
-povitria.net: could not connect to host
-powdersnow.top: did not receive HSTS header
-power-coonies.de: could not connect to host
-power-fit.org: did not receive HSTS header
-power-l.ch: did not receive HSTS header
-power-meter.cc: did not receive HSTS header
-power-of-interest.com: could not connect to host
-power-tools24.com: could not connect to host
-power99press.com: could not connect to host
-powerdent.net.br: could not connect to host
-poweredbypurdy.com: did not receive HSTS header
-powerentertainment.tv: could not connect to host
-powermint.de: did not receive HSTS header
-poweroff.win: could not connect to host
-powerplannerapp.com: could not connect to host
-powerplaywashers.com: could not connect to host
-powerserg.org: did not receive HSTS header
-powersergdatasystems.tk: could not connect to host
-powersergthisisthetunnelfuckyouscott.com: could not connect to host
-powersergthisisthewebsitefuckyouchris.com: could not connect to host
-powersergthisisthewebsitefuckyouscott.com: could not connect to host
-powersergunited.com: could not connect to host
-powersergunited.org: could not connect to host
-powersergusercontent.com: could not connect to host
-powershellmagic.com: could not connect to host
-powershift.ne.jp: did not receive HSTS header
-powertothebuilder.com: could not connect to host
-powerwashingproslosangeles.com: did not receive HSTS header
-powerxequality.com: did not receive HSTS header
-poy-tech.com: could not connect to host
-pozitiffchik.cf: could not connect to host
-pozniak.at: did not receive HSTS header
-pozyczka-bez-zaswiadczen.pl: did not receive HSTS header
-pozytywnyplan.pl: could not connect to host
-pozzitiv.ro: could not connect to host
-pozzo-balbi.com: could not connect to host
-pp5197.co: could not connect to host
-pp6729.co: could not connect to host
-pp6729.com: did not receive HSTS header
-pp6957.co: could not connect to host
-pp9297.co: could not connect to host
-pp9397.com: could not connect to host
-pp9721.com: could not connect to host
-pp9728.co: could not connect to host
-ppembed.com: did not receive HSTS header
-ppiproperties.com: did not receive HSTS header
-ppoou.co.uk: could not connect to host
-ppoozl.com: could not connect to host
-pppo.gov: could not connect to host
-ppr-truby.ru: could not connect to host
-ppsvcs2.com: could not connect to host
-pptavmdata.org: could not connect to host
-ppuu.org: did not receive HSTS header
-ppwancai.com: max-age too low: 0
-ppy3.com: could not connect to host
-pqscript.com: could not connect to host
-pr3-space-staging.ga: could not connect to host
-pracowniatkanin.com: did not receive HSTS header
-practixdevelopment.com: did not receive HSTS header
-practodev.com: could not connect to host
-pracujwunii.pl: did not receive HSTS header
-praderarestaurant.co.uk: could not connect to host
-prankstercompany.com: could not connect to host
-prashchar.uk: could not connect to host
-pratinav.xyz: could not connect to host
-pratopronto.org: could not connect to host
-prattpokemon.com: could not connect to host
-praxis-dingeldey.de: could not connect to host
-praxis-odermath.de: did not receive HSTS header
-praxis-research.info: did not receive HSTS header
-prayum.com: could not connect to host
-prazeresdavida.com.br: could not connect to host
-prazynka.pl: could not connect to host
-prdelka.eu: did not receive HSTS header
-pre-lean-consulting.de: did not receive HSTS header
-pre-renewal.com: could not connect to host
-precedecaritas.com.br: could not connect to host
-preciosde.es: did not receive HSTS header
-precisionaeroimaging.com: could not connect to host
-precisionventures.com: could not connect to host
-prediksisydney.com: could not connect to host
-preexport.com: did not receive HSTS header
-preezzie.com: could not connect to host
-prefis.com: did not receive HSTS header
-prego-shop.de: could not connect to host
-pregono.com: did not receive HSTS header
-preio.cn: could not connect to host
-preis-alarm.info: could not connect to host
-preis-alarm.org: could not connect to host
-prekladysanca.cz: could not connect to host
-prelist.org: did not receive HSTS header
-premaritalsex.info: did not receive HSTS header
-prematureacceleration.club: could not connect to host
-premsarswat.me: could not connect to host
-prepaid-voip.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-prepandgo-euro.com: could not connect to host
-preposted.com: did not receive HSTS header
-preprodfan.gov: could not connect to host
-presbee.com: could not connect to host
-prescriptionrex.com: could not connect to host
-presentesdegrife.com.br: could not connect to host
-presidentials2016.com: could not connect to host
-press-anime-nenkan.com: could not connect to host
-pressakey.de: did not receive HSTS header
-pressenews.net: did not receive HSTS header
-pressfreedomfoundation.org: did not receive HSTS header
-presskr.com: did not receive HSTS header
-prestburyscouts.org.uk: could not connect to host
-prestigeeventshire.co.uk: could not connect to host
-prestigesigns.net: did not receive HSTS header
-pretrialservices.gov: did not receive HSTS header
-prettygrouse.com: did not receive HSTS header
-prettyphotoart.de: did not receive HSTS header
-prettytunesapp.com: could not connect to host
-pretwolk.nl: max-age too low: 2592000
-pretzlaff.info: did not receive HSTS header
-prevention-formation.fr: did not receive HSTS header
-preventshare.com: could not connect to host
-preworkout.me: could not connect to host
-prgslab.net: could not connect to host
-priceholic.com: could not connect to host
-pridoc.se: did not receive HSTS header
-prifo.se: could not connect to host
-prihatno.my.id: could not connect to host
-prijsvergelijken.ml: could not connect to host
-prilock.com: did not receive HSTS header
-primaconsulting.net: could not connect to host
-primecaplending.com: could not connect to host
-primordialsnooze.com: could not connect to host
-primotiles.co.uk: did not receive HSTS header
-prinbanat.ngo: did not receive HSTS header
-princeagency.com: did not receive HSTS header
-princeofwhales.com: did not receive HSTS header
-princepessa.de: did not receive HSTS header
-princesparktouch.com: did not receive HSTS header
-princessbackpack.de: could not connect to host
-princessmargaretlotto.com: did not receive HSTS header
-principalsexam.com: could not connect to host
-principalship.net: could not connect to host
-principalstest.ph: could not connect to host
-printerest.io: could not connect to host
-printerinktoutlet.nl: could not connect to host
-printersonline.be: could not connect to host
-printertonerkopen.nl: could not connect to host
-printery.be: could not connect to host
-printexpress.cloud: could not connect to host
-printf.de: did not receive HSTS header
-priolkar.com: could not connect to host
-prism-communication.com: could not connect to host
-prismacloud.green: could not connect to host
-prismapayments.com: did not receive HSTS header
-prismintl.org: did not receive HSTS header
-pristineevents.co.uk: could not connect to host
-pritalk.com: could not connect to host
-pritchett.xyz: could not connect to host
-privacylabs.io: could not connect to host
-privacymanatee.com: could not connect to host
-privacyrup.net: could not connect to host
-privategiant.com: could not connect to host
-privatewolke.com: did not receive HSTS header
-privatstunden.express: could not connect to host
-privcloud.cc: could not connect to host
-privcloud.org: could not connect to host
-privilegevisa.fr: could not connect to host
-privu.me: could not connect to host
-privytime.com: could not connect to host
-prknje.com: did not receive HSTS header
-prmte.com: could not connect to host
-prnt.li: did not receive HSTS header
-pro-esb.net: could not connect to host
-pro-image.de: did not receive HSTS header
-pro-link.eu: could not connect to host
-pro-zone.com: could not connect to host
-proact-it.co.uk: could not connect to host
-proactive.run: could not connect to host
-probase.ph: could not connect to host
-procens.us: could not connect to host
-proclubs.news: could not connect to host
-procode.gq: could not connect to host
-procrastinatingengineer.co.uk: could not connect to host
-procreditbank.com.al: did not receive HSTS header
-proculsk.tk: could not connect to host
-prodegree.com: could not connect to host
-prodottogiusto.com: could not connect to host
-prodpad.com: did not receive HSTS header
-productgap.com: could not connect to host
-productliabilityinsurance.online: could not connect to host
-producto8.com: did not receive HSTS header
-productoinnovador.com: did not receive HSTS header
-proemployeeprotection.com: could not connect to host
-proemployeeprotection.net: could not connect to host
-proesb.net: could not connect to host
-professional.cleaning: could not connect to host
-professionalboundaries.com: did not receive HSTS header
-profhome-shop.com: did not receive HSTS header
-profi-durchgangsmelder.de: did not receive HSTS header
-profilib.top: could not connect to host
-profinetz.de: could not connect to host
-profivps.com: could not connect to host
-proformer.io: could not connect to host
-profpay.com: could not connect to host
-profundr.com: could not connect to host
-profusion.io: could not connect to host
-prog.sh: could not connect to host
-progenitor.space: did not receive HSTS header
-progettograjau.com: could not connect to host
-progg.no: could not connect to host
-progolfjourney.com: could not connect to host
-program-and.work: could not connect to host
-programlama.tk: could not connect to host
-programmingstudent.com: could not connect to host
-progress-technologies.com: could not connect to host
-progressivecfo.co.nz: could not connect to host
-prohostonline.fi: could not connect to host
-proitconsulting.com.au: could not connect to host
-proj.org.cn: could not connect to host
-proj3ct.me: could not connect to host
-project-rune.tech: could not connect to host
-project-sparks.eu: did not receive HSTS header
-project-stats.com: could not connect to host
-project.supply: did not receive HSTS header
-project86fashion.com: could not connect to host
-projectascension.io: did not receive HSTS header
-projectasterk.com: could not connect to host
-projectblackbook.us: could not connect to host
-projectcastle.tech: did not receive HSTS header
-projectdp.net: could not connect to host
-projectherogames.xyz: could not connect to host
-projectionpictures.com: did not receive HSTS header
-projectl1b1t1na.tk: could not connect to host
-projectmercury.space: did not receive HSTS header
-projectte.ch: could not connect to host
-projectunity.io: could not connect to host
-projectx.top: could not connect to host
-projekt-umbriel.de: could not connect to host
-projektik.cz: did not receive HSTS header
-projetoresecia.com: could not connect to host
-prok.pw: could not connect to host
-prokop.ovh: could not connect to host
-promarketer.net: could not connect to host
-promecon-gmbh.de: did not receive HSTS header
-promedicalapplications.com: could not connect to host
-promesa.net: did not receive HSTS header
-promhadan.com: could not connect to host
-promocao.email: could not connect to host
-promopony.com: did not receive HSTS header
-promoteiq.com: did not receive HSTS header
-promovite.com.mx: did not receive HSTS header
-promozione.info: could not connect to host
-pronostic-king.fr: could not connect to host
-pronto-intervento.net: could not connect to host
-prontolight.com: did not receive HSTS header
-prontomovers.co.uk: could not connect to host
-proobec.cz: did not receive HSTS header
-propactrading.com: could not connect to host
-propagandism.org: did not receive HSTS header
-propepper.net: did not receive HSTS header
-properchels.com: did not receive HSTS header
-propershave.com: could not connect to host
-propertyfindercdn.com: could not connect to host
-prophiler.de: could not connect to host
-proplan.co.il: did not receive HSTS header
-propmag.co: could not connect to host
-proposeinspain.net: could not connect to host
-prosenseit.com: could not connect to host
-prosharp.com.au: could not connect to host
-proslimdiets.com: could not connect to host
-prosocialmachines.com: could not connect to host
-prospanek.cz: did not receive HSTS header
-prosperandoemcasa.com.br: did not receive HSTS header
-prosperident.com: could not connect to host
-prostecheat.xyz: could not connect to host
-prostoporno.love: did not receive HSTS header
-prostoporno.net: did not receive HSTS header
-prostoporno.sexy: did not receive HSTS header
-prostoporno.video: did not receive HSTS header
-prostoporno.vip: did not receive HSTS header
-prot.ch: did not receive HSTS header
-proteapower.co.za: could not connect to host
-protecciondelconsumidor.gov: did not receive HSTS header
-proteinnuts.sk: did not receive HSTS header
-proto-online.ru: did not receive HSTS header
-protoxin.net: could not connect to host
-provectus.de: did not receive HSTS header
-provence-appartements.com: could not connect to host
-providencecmc.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-providerlijst.ml: could not connect to host
-provisionaldriving.com: could not connect to host
-provisionircd.tk: could not connect to host
-provitacare.com: did not receive HSTS header
-provokator.co.il: did not receive HSTS header
-proweb.solutions: did not receive HSTS header
-proweser.de: did not receive HSTS header
-prowhisky.de: did not receive HSTS header
-proxbox.net: could not connect to host
-proxi.cf: could not connect to host
-proximato.com: could not connect to host
-proxybay.al: could not connect to host
-proxybay.club: could not connect to host
-proxybay.eu.org: did not receive HSTS header
-proxybay.top: did not receive HSTS header
-proxydesk.eu: could not connect to host
-proxydesk.net: could not connect to host
-proxyowl.pw: could not connect to host
-proxyportal.me: could not connect to host
-proxyportal.net: did not receive HSTS header
-proxyrox.com: could not connect to host
-proxyweb.us: did not receive HSTS header
-proyectosx.net: did not receive HSTS header
-proymaganadera.com: did not receive HSTS header
-prplz.io: did not receive HSTS header
-prpr.cloud: could not connect to host
-prpsss.com: did not receive HSTS header
-prstatic.com: could not connect to host
-prtscloud.ddns.net: could not connect to host
-pruikshop.nl: could not connect to host
-pruma.com.br: could not connect to host
-prushka.ml: could not connect to host
-prxio.date: could not connect to host
-prxio.site: could not connect to host
-pryspry.com: did not receive HSTS header
-ps-provider.co.jp: could not connect to host
-ps-qa.com: did not receive HSTS header
-ps-w.ru: did not receive HSTS header
-ps-x.ru: could not connect to host
-ps4all.nl: could not connect to host
-psa.gov: did not receive HSTS header
-psb.cloud: could not connect to host
-pscleaningsolutions.co.uk: could not connect to host
-pself.net: could not connect to host
-pseric.site: could not connect to host
-pseudo.coffee: could not connect to host
-psicanalista.milano.it: could not connect to host
-psicoexpansao.com.br: could not connect to host
-psicologia.co.ve: could not connect to host
-psicologoforensebarcelona.com: did not receive HSTS header
-psicosalud.online: could not connect to host
-psncardplus.be: could not connect to host
-psncardplus.com: could not connect to host
-psncardplus.dk: could not connect to host
-psncardplus.nl: could not connect to host
-psncardplus.se: could not connect to host
-pson.ninja: could not connect to host
-pste.pw: did not receive HSTS header
-pstrozniak.com: could not connect to host
-pstudio.me: max-age too low: 0
-psw.academy: could not connect to host
-psw.consulting: could not connect to host
-psxtr.com: could not connect to host
-psychiatrie-betreuung.ch: could not connect to host
-psycho-lobby.com: could not connect to host
-psycho-lobby.fr: could not connect to host
-psycho.space: could not connect to host
-psychologie-hofner.at: could not connect to host
-psychologytests.tk: could not connect to host
-psychometrictest.africa: did not receive HSTS header
-psydix.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-psylab.cc: could not connect to host
-psylab.re: could not connect to host
-psylab.vip: could not connect to host
-psynapse.net.au: could not connect to host
-ptab2pt.ga: could not connect to host
-pthsec.com: could not connect to host
-ptmp.net: could not connect to host
-ptn.moscow: could not connect to host
-ptonet.com: could not connect to host
-ptr.kr: could not connect to host
-ptrujillo.com: did not receive HSTS header
-pty.gg: could not connect to host
-pub-online.ro: could not connect to host
-pubean.com: could not connect to host
-pubgbattleworld.club: did not receive HSTS header
-pubkey.is: could not connect to host
-publications.qld.gov.au: did not receive HSTS header
-publicidadnovagrass.com.mx: could not connect to host
-publicinquiry.eu: did not receive HSTS header
-publicintegrity.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-publick.net: did not receive HSTS header
-publicrea.com: could not connect to host
-publicspeakingcamps.com: could not connect to host
-publikate.online: could not connect to host
-publimepa.it: could not connect to host
-publishingshack.com: did not receive HSTS header
-pubreviews.com: could not connect to host
-puchunguis.com: did not receive HSTS header
-puentes.info: could not connect to host
-puertasautomaticasgi.com: did not receive HSTS header
-pugilares.com.pl: could not connect to host
-pugliese.fr: could not connect to host
-puhe.se: could not connect to host
-puhka.me: could not connect to host
-puikheid.nl: did not receive HSTS header
-puli.com.br: could not connect to host
-pulizia.milano.it: could not connect to host
-pulledporkheaven.com: could not connect to host
-pulsar.guru: did not receive HSTS header
-pulsedursley.co.uk: did not receive HSTS header
-pult.co: could not connect to host
-pumpandcash.com: could not connect to host
-pumpgames.net: could not connect to host
-punchkickinteractive.com: did not receive HSTS header
-punchr-kamikazee.rhcloud.com: could not connect to host
-puneflowermall.com: did not receive HSTS header
-punishment.institute: could not connect to host
-punkdns.top: did not receive HSTS header
-punknews.org: could not connect to host
-puntacanalink.com: could not connect to host
-puppo.space: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-puppydns.com: did not receive HSTS header
-puq.moe: could not connect to host
-purahealthyliving.com: could not connect to host
-purbd.com: did not receive HSTS header
-purchasetncrash.gov: did not receive HSTS header
-purecabo.com: did not receive HSTS header
-purefreefrom.co.uk: did not receive HSTS header
-pureholisticliving.me: could not connect to host
-pureitsolutionsllp.com: could not connect to host
-purelunch.co.uk: could not connect to host
-pureluxemedical.com: did not receive HSTS header
-purenvi.ca: did not receive HSTS header
-purewebmasters.com: could not connect to host
-purikore.com: could not connect to host
-purplebricks.com: did not receive HSTS header
-purplegrapegames.com: did not receive HSTS header
-purplehippie.in: did not receive HSTS header
-purpleplains.net: could not connect to host
-purplez.pw: could not connect to host
-purpoz.com.br: could not connect to host
-purpspc.com: could not connect to host
-purrfect-box.co.uk: could not connect to host
-pusatinkubatorbayi.com: did not receive HSTS header
-push.world: did not receive HSTS header
-pushapp.org: did not receive HSTS header
-pushphp.com: could not connect to host
-pushstar.com: max-age too low: 0
-pusichatka.ddns.net: could not connect to host
-put-k-uspekhuy.tk: could not connect to host
-puttymonos.club: could not connect to host
-puzz.gg: could not connect to host
-puzz.me: could not connect to host
-puzzlage.com: could not connect to host
-pvagner.tk: did not receive HSTS header
-pwaresume.com: did not receive HSTS header
-pwd.ovh: could not connect to host
-pwe.vision: could not connect to host
-pwfrance.com: could not connect to host
-pwi.agency: could not connect to host
-pwm.jp: could not connect to host
-pwnedpass.tk: could not connect to host
-pwnsdx.pw: did not receive HSTS header
-pwntr.com: did not receive HSTS header
-pwoss.xyz: could not connect to host
-pwt.pw: could not connect to host
-pxio.de: did not receive HSTS header
-pya.org.tr: could not connect to host
-pycoder.org: did not receive HSTS header
-pycycle.info: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-pyol.org: could not connect to host
-pyopenssl.org: did not receive HSTS header
-pypi-mirrors.org: did not receive HSTS header
-pypi-status.org: could not connect to host
-pyplo.org: could not connect to host
-pypt.lt: did not receive HSTS header
-pyrios.pro: could not connect to host
-pyrrhonism.org: did not receive HSTS header
-pythia.nz: could not connect to host
-pythonic.guru: could not connect to host
-pythonic.training: could not connect to host
-pzme.me: could not connect to host
-q-rickroll-u.pw: could not connect to host
-q-tr.com: did not receive HSTS header
-q00228.com: could not connect to host
-q123123.com: could not connect to host
-q1q2q3.tk: could not connect to host
-q2.si: did not receive HSTS header
-q30365.com: could not connect to host
-q4profiles-france.com: could not connect to host
-q5118.com: could not connect to host
-q5197.co: could not connect to host
-q6729.co: could not connect to host
-q6729.com: did not receive HSTS header
-q6957.co: could not connect to host
-q6957.com: did not receive HSTS header
-q8mp3.me: did not receive HSTS header
-q9297.co: could not connect to host
-q9397.com: could not connect to host
-q9721.com: could not connect to host
-q9728.co: could not connect to host
-qa-team.xyz: could not connect to host
-qabalah.jp: could not connect to host
-qadmium.com: could not connect to host
-qadmium.tk: could not connect to host
-qamrulhaque.com: did not receive HSTS header
-qapital.com: did not receive HSTS header
-qazcloud.com: could not connect to host
-qbeing.info: did not receive HSTS header
-qbik.de: did not receive HSTS header
-qbin.io: did not receive HSTS header
-qbnt.ca: could not connect to host
-qc.immo: could not connect to host
-qccqld.org.au: did not receive HSTS header
-qcloud.cz: did not receive HSTS header
-qdqlh.cn: could not connect to host
-qe2homelottery.com: did not receive HSTS header
-qensio.com: did not receive HSTS header
-qforum.org: did not receive HSTS header
-qgblog.org: could not connect to host
-qgustavor.tk: did not receive HSTS header
-qi0.de: did not receive HSTS header
-qiannews.net: did not receive HSTS header
-qicomidadeverdade.com.br: could not connect to host
-qifu.org.cn: could not connect to host
-qingcao.org: could not connect to host
-qingpat.com: could not connect to host
-qingxuan.info: did not receive HSTS header
-qinxi1992.com: could not connect to host
-qionglu.pw: did not receive HSTS header
-qipl.org: could not connect to host
-qipp.com: did not receive HSTS header
-qirinus.com: could not connect to host
-qiu521119.host: could not connect to host
-qiuxian.ddns.net: could not connect to host
-qiwi.be: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-qixxit.de: did not receive HSTS header
-qkka.org: could not connect to host
-qklshequ.com: could not connect to host
-qkzy.net: could not connect to host
-qldconservation.org: could not connect to host
-qlix.pl: could not connect to host
-qnatek.org: could not connect to host
-qnickx.top: did not receive HSTS header
-qnq.moe: could not connect to host
-qoacher.com: did not receive HSTS header
-qonqa.de: did not receive HSTS header
-qoohoot.com: did not receive HSTS header
-qop.io: could not connect to host
-qoqo.us: could not connect to host
-qorm.co.uk: could not connect to host
-qq-navi.com: did not receive HSTS header
-qq5197.co: could not connect to host
-qq6396.com: did not receive HSTS header
-qq6729.co: could not connect to host
-qq6729.com: did not receive HSTS header
-qq6957.co: could not connect to host
-qq885.com: could not connect to host
-qq9297.co: could not connect to host
-qq9397.com: could not connect to host
-qq9721.com: could not connect to host
-qq9728.co: could not connect to host
-qqj.net: could not connect to host
-qqq.gg: could not connect to host
-qqq63.com: could not connect to host
-qqvips.com: did not receive HSTS header
-qqvrsmart.cn: could not connect to host
-qredo.com: did not receive HSTS header
-qrforex.com: did not receive HSTS header
-qrlending.com: could not connect to host
-qrlfinancial.com: could not connect to host
-qswoo.org: could not connect to host
-qto.com: could not connect to host
-qto.org: could not connect to host
-quadron.hu: could not connect to host
-quaedam.org: could not connect to host
-quail.solutions: could not connect to host
-quakerlens.com: could not connect to host
-quality1.com.br: could not connect to host
-qualityedgarsolutions.com: did not receive HSTS header
-qualityology.com: did not receive HSTS header
-qualpay.biz: did not receive HSTS header
-quanglepro.com: could not connect to host
-quangngaimedia.com: did not receive HSTS header
-quanjinlong.cn: could not connect to host
-quantacloud.ch: could not connect to host
-quantaloupe.tech: could not connect to host
-quantenteranik.eu: could not connect to host
-quantor.dk: did not receive HSTS header
-quantum-cloud.xyz: could not connect to host
-quantum-ethics.com: could not connect to host
-quantum-lviv.pp.ua: could not connect to host
-quantumcore.cn: could not connect to host
-quantumcourse.org: did not receive HSTS header
-quantumtelecom.com.br: could not connect to host
-quantumwebs.co: could not connect to host
-quanwuji.com: could not connect to host
-quanyin.eu.org: did not receive HSTS header
-quarryhillrentals.com: did not receive HSTS header
-quarus.net: could not connect to host
-quebecmailbox.com: could not connect to host
-queenbrownie.com.br: could not connect to host
-queenmargaret.ddns.net: could not connect to host
-queens.lgbt: could not connect to host
-queenshaflo.com: could not connect to host
-queercinema.ch: could not connect to host
-quehacerencusco.com: did not receive HSTS header
-quelmandataire.fr: did not receive HSTS header
-quemeloquitan.com: could not connect to host
-queminventou.com.br: could not connect to host
-quentinaurat.com: did not receive HSTS header
-querkommentar.de: did not receive HSTS header
-queryplayground.com: could not connect to host
-questionable.host: could not connect to host
-questions-admin.com: did not receive HSTS header
-questoj.cn: could not connect to host
-questsandrewards.com: could not connect to host
-quic.fr: could not connect to host
-quickandroid.tools: could not connect to host
-quickbookssupportphonenumber.us: did not receive HSTS header
-quickboysvrouwen2.nl: could not connect to host
-quickpayservice.com: could not connect to host
-quickrelations.de: did not receive HSTS header
-quietboy.net: did not receive HSTS header
-quietus.gq: could not connect to host
-quikrmovies.to: could not connect to host
-quilmo.com: could not connect to host
-quimsertek.com: did not receive HSTS header
-quinnlabs.com: did not receive HSTS header
-quintype.com: did not receive HSTS header
-quisido.com: did not receive HSTS header
-quitarlasmanchasde.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-quitimes.com: could not connect to host
-quizionic.com: could not connect to host
-quizl.io: did not receive HSTS header
-quizmemes.org: could not connect to host
-quizogames.com: could not connect to host
-qunzi.la: could not connect to host
-quocdesign.ch: could not connect to host
-quotehex.com: could not connect to host
-quotemaster.co.za: could not connect to host
-quranserver.net: could not connect to host
-qwallet.ca: could not connect to host
-qwans.nl: did not receive HSTS header
-qwant.fr: did not receive HSTS header
-qwertyatom100.me: could not connect to host
-qwilink.me: did not receive HSTS header
-qwq2333.top: could not connect to host
-qxy.ch: could not connect to host
-qxzg.org: could not connect to host
-qxzgssr.xyz: could not connect to host
-qybot.cc: could not connect to host
-qybot.cn: could not connect to host
-r-ay.club: could not connect to host
-r-core.org: could not connect to host
-r-core.ru: could not connect to host
-r-cut.fr: could not connect to host
-r-rickroll-u.pw: could not connect to host
-r0t.co: could not connect to host
-r10n.com: did not receive HSTS header
-r15.me: could not connect to host
-r30365.com: could not connect to host
-r3bl.blog: could not connect to host
-r3bl.me: could not connect to host
-r3nt3r.com: did not receive HSTS header
-r5197.co: could not connect to host
-r6729.co: could not connect to host
-r6729.com: did not receive HSTS header
-r6957.co: could not connect to host
-r6957.com: did not receive HSTS header
-r811.de: could not connect to host
-r9297.co: could not connect to host
-r9397.com: could not connect to host
-r9721.com: could not connect to host
-r9728.co: could not connect to host
-ra4wvpn.com: did not receive HSTS header
-raajheshkannaa.com: could not connect to host
-rabbit.wales: could not connect to host
-rabbitvcactus.eu: could not connect to host
-rabota-x.ru: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-rabynska.eu: could not connect to host
-racasdecachorro.org: could not connect to host
-raccoon-music.com: did not receive HSTS header
-raceviewequestrian.com: did not receive HSTS header
-rachaelrussell.com: could not connect to host
-rachelchen.me: could not connect to host
-rachelsbouncycastles.co.uk: could not connect to host
-rachida-dati.eu: did not receive HSTS header
-rackblue.com: could not connect to host
-racktear.com: did not receive HSTS header
-racozo.com: did not receive HSTS header
-rad-route.de: could not connect to host
-rada-group.eu: could not connect to host
-radarnext.com: could not connect to host
-raddavarden.nu: could not connect to host
-radicaleducation.net: could not connect to host
-radioactivenetwork.xyz: could not connect to host
-radioafibra.com.br: could not connect to host
-radioheaven.co.kr: did not receive HSTS header
-radiopolarniki.spb.ru: could not connect to host
-radiumcode.com: could not connect to host
-radom-pack.pl: could not connect to host
-radtke.bayern: could not connect to host
-rafaelcz.de: could not connect to host
-rafgrup.com: did not receive HSTS header
-rafsis.com: did not receive HSTS header
-raft.pub: could not connect to host
-rage-overload.ch: could not connect to host
-rage.rip: could not connect to host
-raghavdua.in: could not connect to host
-raghughphotography.tk: could not connect to host
-ragnaroktop.com.br: could not connect to host
-rahadiana.com: could not connect to host
-rahamasin.eu: did not receive HSTS header
-rai-co.net: could not connect to host
-raiblockscommunity.net: did not receive HSTS header
-raidstone.com: could not connect to host
-raidstone.rocks: could not connect to host
-raiffeisenzeitung.at: did not receive HSTS header
-railjob.cn: could not connect to host
-railto.com: did not receive HSTS header
-railwaytech.net: could not connect to host
-railyardurgentcare.com: did not receive HSTS header
-raimixmotoparts.com.br: did not receive HSTS header
-raimondos.com: did not receive HSTS header
-rainbin.com: did not receive HSTS header
-rainbow.pizza: could not connect to host
-rainbowbarracuda.com: could not connect to host
-raipet.no-ip.biz: could not connect to host
-raito.ooo: could not connect to host
-raito.win: could not connect to host
-raitza.de: could not connect to host
-rajastore.ma: could not connect to host
-rajivshah.co.uk: did not receive HSTS header
-rakett.org: did not receive HSTS header
-rakugaki.cn: could not connect to host
-ralf-huebscher.de: did not receive HSTS header
-ralph.bike: did not receive HSTS header
-ralphwoessner.com: did not receive HSTS header
-ralvke.rocks: could not connect to host
-rambii.de: could not connect to host
-ramblingrf.tech: could not connect to host
-ramezanloo.com: did not receive HSTS header
-ramitmittal.com: could not connect to host
-ramon-c.nl: could not connect to host
-ramonj.nl: could not connect to host
-ramuel.com: did not receive HSTS header
-rancowar.com: could not connect to host
-randallbollig.com: did not receive HSTS header
-random-samplings.org: could not connect to host
-randomcage.com: did not receive HSTS header
-randomcloud.net: could not connect to host
-randomdysfunctions.com: could not connect to host
-randomhero.cloud: could not connect to host
-randomrepo.com: did not receive HSTS header
-randomwinpicker.de: could not connect to host
-randy.pw: could not connect to host
-ranegroup.hosting: could not connect to host
-rankthespot.com: could not connect to host
-rannseier.org: did not receive HSTS header
-ranos.org: could not connect to host
-ranson.com.au: could not connect to host
-rantanda.com: could not connect to host
-rante.com: did not receive HSTS header
-rany.duckdns.org: could not connect to host
-rany.io: did not receive HSTS header
-rany.pw: could not connect to host
-ranyeh.co: could not connect to host
-rapdogg.com: could not connect to host
-raphaeladdile.com: could not connect to host
-raphaelmoura.ddns.net: could not connect to host
-raphaelschmid.eu: did not receive HSTS header
-raphrfg.com: could not connect to host
-rapidemobile.com: did not receive HSTS header
-rapidflow.io: could not connect to host
-rapidhubs.com: could not connect to host
-rapidminer.com: did not receive HSTS header
-rapido.nu: did not receive HSTS header
-rapidplumbingpenrith.com.au: could not connect to host
-rapidresearch.me: could not connect to host
-rapidthunder.io: could not connect to host
-rappet.de: did not receive HSTS header
-rareative.com: could not connect to host
-rasing.me: did not receive HSTS header
-raspass.me: did not receive HSTS header
-raspberry.us: did not receive HSTS header
-raspberrypi.tv: did not receive HSTS header
-raspberryultradrops.com: did not receive HSTS header
-raspitec.ddns.net: could not connect to host
-rastasorganics.com: did not receive HSTS header
-rastreador.com.es: did not receive HSTS header
-rastreie.net: did not receive HSTS header
-ratajczak.fr: could not connect to host
-ratajczak.one: could not connect to host
-rate-esport.de: could not connect to host
-ratelsec.com: could not connect to host
-rathgeb.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-rathorian.fr: could not connect to host
-ratinq.co: could not connect to host
-rationalops.com: could not connect to host
-rationem.nl: did not receive HSTS header
-ratuseks.com: could not connect to host
-ratuseks.net: could not connect to host
-ratuseks.us: could not connect to host
-raulfraile.net: could not connect to host
-rault.io: did not receive HSTS header
-rautelow.de: did not receive HSTS header
-rautermods.net: did not receive HSTS header
-ravage.fm: could not connect to host
-raven.lipetsk.ru: could not connect to host
-ravengergaming.ga: could not connect to host
-ravengergaming.net: could not connect to host
-ravenx.me: could not connect to host
-raviparekh.co.uk: could not connect to host
-ravkr.duckdns.org: could not connect to host
-ravse.dk: could not connect to host
-raw-diets.com: could not connect to host
-rawet.se: could not connect to host
-rawoil.com: could not connect to host
-rawpearls.com: did not receive HSTS header
-rawr.sexy: could not connect to host
-rawstorieslondon.com: could not connect to host
-raxion.cf: could not connect to host
-raxion.tk: could not connect to host
-rayan-it.ir: did not receive HSTS header
-rayanitco.com: did not receive HSTS header
-raycarruthersphotography.co.uk: could not connect to host
-raydan.space: could not connect to host
-raydobe.me: could not connect to host
-raydolap.web.tr: did not receive HSTS header
-raymii.org: did not receive HSTS header
-raymondelooff.nl: did not receive HSTS header
-raystark.com: could not connect to host
-raytron.org: could not connect to host
-razberry.kr: could not connect to host
-razeencheng.com: did not receive HSTS header
-razlaw.name: did not receive HSTS header
-razvodguru.ru: did not receive HSTS header
-razzolini.com.br: could not connect to host
-rb-china.net: could not connect to host
-rbcservicehub-uat.azurewebsites.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-rbd.events: could not connect to host
-rbhighinc.org: could not connect to host
-rbmafrica.co.za: could not connect to host
-rbose.org: could not connect to host
-rbqcloud.com: could not connect to host
-rbti.me: could not connect to host
-rbtvshitstorm.is: could not connect to host
-rburchell.com: did not receive HSTS header
-rbx-talk.xyz: could not connect to host
-rbxcatalog.com: could not connect to host
-rc-respect.ru: did not receive HSTS header
-rc-rp.com: did not receive HSTS header
-rc4.io: could not connect to host
-rc7.ch: could not connect to host
-rca.ink: could not connect to host
-rcafox.com: could not connect to host
-rcifsgapinsurance.co.uk: did not receive HSTS header
-rciliberto.com: did not receive HSTS header
-rcmlinx.com: could not connect to host
-rcmpsplib.com: could not connect to host
-rcoliveira.com: could not connect to host
-rcorporation.be: did not receive HSTS header
-rcpcbd.com: could not connect to host
-rcra-uganda.org: did not receive HSTS header
-rcraigmurphy.net: could not connect to host
-rcsolutions.nl: could not connect to host
-rcx.io: could not connect to host
-rdfencingandgates.co.uk: could not connect to host
-rdfz.tech: could not connect to host
-rdns.im: did not receive HSTS header
-rdplumbingsolutions.com.au: did not receive HSTS header
-rdr2-rp-forum.de: did not receive HSTS header
-rdxsattamatka.mobi: could not connect to host
-rdyrda.fr: could not connect to host
-re-curi.com: did not receive HSTS header
-re-customer.net: could not connect to host
-re-wilding.com: could not connect to host
-reachr.com: could not connect to host
-reactdatepicker.com: did not receive HSTS header
-reactions.studio: did not receive HSTS header
-reactivarte.es: did not receive HSTS header
-reactivelambda.com: could not connect to host
-reactor92.com: could not connect to host
-read.sc: did not receive HSTS header
-reader.ga: could not connect to host
-readify.com.au: did not receive HSTS header
-readingandmath.org: could not connect to host
-readitify.com: did not receive HSTS header
-readityourself.net: could not connect to host
-readmeeatmedrinkme.com: did not receive HSTS header
-readr.pw: could not connect to host
-readtldr.com: could not connect to host
-readydok.com: did not receive HSTS header
-readytobattle.net: did not receive HSTS header
-readytowear.es: could not connect to host
-readywithresourcestn.gov: could not connect to host
-reagir43.fr: did not receive HSTS header
-reaiaer.com: could not connect to host
-reakyaweso.me: could not connect to host
-real-bits.com: could not connect to host
-real-compare.com: did not receive HSTS header
-realcli.com: could not connect to host
-realcolors.net: could not connect to host
-realfamilyincest.com: could not connect to host
-realfreedom.city: could not connect to host
-realgarant-shop.de: did not receive HSTS header
-realgear.net: did not receive HSTS header
-realhost.name: could not connect to host
-realincest.tv: could not connect to host
-realitea.co.uk: did not receive HSTS header
-really.ai: could not connect to host
-really.io: could not connect to host
-reallycooljobs.ga: could not connect to host
-reallyreally.io: could not connect to host
-realmic.net: could not connect to host
-realmofespionage.com: could not connect to host
-realnewhomes.com: could not connect to host
-realraghavgupta.com: could not connect to host
-realtoraidan.com: could not connect to host
-realwoo.com: could not connect to host
-reapdrive.net: did not receive HSTS header
-reaper.rip: could not connect to host
-reardenporn.com: could not connect to host
-reath.me: did not receive HSTS header
-rebekaesgabor.online: could not connect to host
-rebel.services: could not connect to host
-rebootmc.com: did not receive HSTS header
-recard.vn: did not receive HSTS header
-receitas-de-bolos.pt: could not connect to host
-receitasdebacalhau.pt: could not connect to host
-receptionsbook.com: could not connect to host
-recetasdecocinaideal.com: did not receive HSTS header
-recetasfacilesdehacer.com: did not receive HSTS header
-recettecookeo.net: did not receive HSTS header
-rechat.com: did not receive HSTS header
-rechenknaecht.de: could not connect to host
-rechenwerk.net: could not connect to host
-recht-freundlich.de: did not receive HSTS header
-rechtenliteratuurleiden.nl: could not connect to host
-reclamebureau-ultrax.nl: did not receive HSTS header
-recoveryohio.gov: could not connect to host
-recreoviral.com: did not receive HSTS header
-recruitsecuritytraining.co.uk: could not connect to host
-recruitsecuritytraining.com: could not connect to host
-rectoraudiparts.com: could not connect to host
-recuerdafilms.com: did not receive HSTS header
-recyclingpromotions.us: did not receive HSTS header
-redable.nl: max-age too low: 2592000
-redair.es: could not connect to host
-redar.xyz: could not connect to host
-redcarpets.in: did not receive HSTS header
-redchat.cz: could not connect to host
-redcomet.org: did not receive HSTS header
-redcone.net: could not connect to host
-reddepsicologosdecr.com: could not connect to host
-reddiseals.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-rede.ca: did not receive HSTS header
-redelectrical.co.uk: did not receive HSTS header
-redespaulista.com: did not receive HSTS header
-redessantaluzia.com.br: did not receive HSTS header
-redheeler.com.br: could not connect to host
-redhorsemountainranch.com: did not receive HSTS header
-redicabo.de: could not connect to host
-redicals.com: could not connect to host
-redigest.it: could not connect to host
-redirectman.com: could not connect to host
-redit.com: did not receive HSTS header
-rediverge.com: did not receive HSTS header
-redizoo.com: did not receive HSTS header
-redlatam.org: did not receive HSTS header
-redletter.link: could not connect to host
-redmondoregon.gov: could not connect to host
-redneck-gaming.de: could not connect to host
-redner.cc: did not receive HSTS header
-rednertv.de: did not receive HSTS header
-rednoseday.com: did not receive HSTS header
-redoakmedia.net: did not receive HSTS header
-redpact.com: did not receive HSTS header
-redper.serveminecraft.net: could not connect to host
-redperegrine.com: did not receive HSTS header
-redphi.dedyn.io: could not connect to host
-redporno.cz: did not receive HSTS header
-redports.org: did not receive HSTS header
-redprice.by: could not connect to host
-redra.ws: could not connect to host
-redshell.pw: did not receive HSTS header
-redshield.co: did not receive HSTS header
-redshiftlabs.com.au: did not receive HSTS header
-redsquarelasvegas.com: could not connect to host
-redsquirrelcampsite.co.uk: did not receive HSTS header
-reducerin.ro: did not receive HSTS header
-redwoodpaddle.es: did not receive HSTS header
-redwoodpaddle.pt: did not receive HSTS header
-redy.host: did not receive HSTS header
-redzonedaily.com: could not connect to host
-reensshop.com: could not connect to host
-reepay.com: did not receive HSTS header
-reeson.at: could not connect to host
-reeson.de: could not connect to host
-reeson.info: could not connect to host
-reeson.org: could not connect to host
-reevoo.com: did not receive HSTS header
-referenten.org: did not receive HSTS header
-refficience.com: did not receive HSTS header
-refill-roboter.de: did not receive HSTS header
-refitplanner.com: could not connect to host
-reflectivity.io: did not receive HSTS header
-reflecton.io: could not connect to host
-reflexive-engineering.com: could not connect to host
-reforesttheplanet.com: could not connect to host
-reformatreality.com: could not connect to host
-refresh-media.nl: did not receive HSTS header
-refreshingserum.com: could not connect to host
-refuelcollective.com: did not receive HSTS header
-refuelcreative.com.au: did not receive HSTS header
-reg.ru: did not receive HSTS header
-regain.us: did not receive HSTS header
-regaloaks.com: could not connect to host
-regalpaintingfdl.com: could not connect to host
-regalpalms.com: did not receive HSTS header
-regasportshop.it: could not connect to host
-regateoapp.com: could not connect to host
-regenbogenwald.de: did not receive HSTS header
-regendevices.eu: could not connect to host
-reggae-cdmx.com: could not connect to host
-regily.com: did not receive HSTS header
-regime-anticellulite.com: could not connect to host
-regime-maigrir-vite.com: could not connect to host
-regimebonheur.com: could not connect to host
-regimecellulite.com: could not connect to host
-reginagroffy.com: could not connect to host
-regio-salland.nl: could not connect to host
-regionalcoalition.org: did not receive HSTS header
-regionale.org: did not receive HSTS header
-register.gov.uk: did not receive HSTS header
-registertovoteflorida.gov: did not receive HSTS header
-regnix.net: could not connect to host
-regoul.com: did not receive HSTS header
-rehabilitation.network: could not connect to host
-rehabmail.com: did not receive HSTS header
-rehabphilippines.com: could not connect to host
-rehabreviews.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-rehabthailand.nl: could not connect to host
-reher.pro: could not connect to host
-rehobothma.gov: did not receive HSTS header
-rei.codes: could not connect to host
-reic.me: could not connect to host
-reichl-online.net: could not connect to host
-reidascuecas.com.br: could not connect to host
-reidsupply.com: did not receive HSTS header
-reignsphere.net: could not connect to host
-reikiqueen.uk: could not connect to host
-reinaertvandecruys.me: could not connect to host
-reineberthe.ch: could not connect to host
-reinhard.codes: did not receive HSTS header
-reinoldus.ddns.net: could not connect to host
-reisekosten-gorilla.com: did not receive HSTS header
-reismil.ch: could not connect to host
-reisslittle.com: could not connect to host
-reisyukaku.org: did not receive HSTS header
-reithguard-it.de: did not receive HSTS header
-rejo.in: could not connect to host
-rejoice1009.com: did not receive HSTS header
-rejushiiplotter.ru: could not connect to host
-rejuvemedspa.com: did not receive HSTS header
-rekonstrukcestatu.cz: did not receive HSTS header
-relatic.net: could not connect to host
-relayawards.com: could not connect to host
-relaybox.io: could not connect to host
-reldoc.com.mx: did not receive HSTS header
-releasetimes.io: could not connect to host
-reliable-mail.de: could not connect to host
-reliant3sixty.com: could not connect to host
-religiousforums.com: did not receive HSTS header
-relisten.nl: did not receive HSTS header
-relocatefeds.gov: could not connect to host
-relojesseiko.es: did not receive HSTS header
-relsak.cz: could not connect to host
-relvan.com: could not connect to host
-relvan.tech: could not connect to host
-rem.pe: could not connect to host
-rema.site: could not connect to host
-remachadoras.club: did not receive HSTS header
-remain.london: could not connect to host
-remedee.com: did not receive HSTS header
-remedica.fr: could not connect to host
-remedioparaherpes.com: could not connect to host
-remedios-caserospara.com: did not receive HSTS header
-remedioscaserosparalacistitis.com: did not receive HSTS header
-remedium.de: could not connect to host
-remedyrecoverymat.com: could not connect to host
-remedyrehab.com: could not connect to host
-remejeanne.com: could not connect to host
-remembermidi.sytes.net: could not connect to host
-rememberthis.co.za: could not connect to host
-remodela.com.ve: could not connect to host
-remodelingfy.com: could not connect to host
-remodelwithlegacy.com: did not receive HSTS header
-remontpc.cf: could not connect to host
-remonttitekniikka.fi: could not connect to host
-remotestance.com: did not receive HSTS header
-removalcellulite.com: could not connect to host
-removedrepo.com: could not connect to host
-remszeitung.de: did not receive HSTS header
-renascentia.asia: did not receive HSTS header
-rencaijia.com: did not receive HSTS header
-rencontres-erotiques.com: did not receive HSTS header
-rendre-service.ch: could not connect to host
-rene-eizenhoefer.de: could not connect to host
-rene-guitton.fr: did not receive HSTS header
-renee.today: could not connect to host
-renefloresphotography.com: could not connect to host
-renesauerwein.com: did not receive HSTS header
-renesauerwein.de: could not connect to host
-renewedhopefc.com: did not receive HSTS header
-renewgsa.com: could not connect to host
-rengarenkblog.com: could not connect to host
-renideo.fr: could not connect to host
-renkhosting.com: could not connect to host
-renlong.org: did not receive HSTS header
-rennfire.org: could not connect to host
-renrenss.com: could not connect to host
-renscreations.com: did not receive HSTS header
-rentacarcluj.xyz: could not connect to host
-rentalmed.com.br: did not receive HSTS header
-rentaways.com: could not connect to host
-rentayventadecarpas.com: did not receive HSTS header
-rentbrowser.com: could not connect to host
-rentbrowsertrain.me: could not connect to host
-rentcarassist.com: could not connect to host
-renteater.com: could not connect to host
-rentex.com: did not receive HSTS header
-renxinge.cn: could not connect to host
-repair.by: did not receive HSTS header
-reparo.pe: did not receive HSTS header
-repex.co.il: could not connect to host
-replace.ninja: did not receive HSTS header
-replaceits.me: could not connect to host
-replacemychina.com: could not connect to host
-replikatelefon.tk: could not connect to host
-report-incident.de: could not connect to host
-report-to.com: did not receive HSTS header
-report-to.io: did not receive HSTS header
-report-uri.io: did not receive HSTS header
-report-url.com: did not receive HSTS header
-report-url.io: did not receive HSTS header
-reported.ly: did not receive HSTS header
-reporturi.com: did not receive HSTS header
-reporturi.io: did not receive HSTS header
-reporturl.com: did not receive HSTS header
-reporturl.io: did not receive HSTS header
-reposaarenkuva.fi: could not connect to host
-reprolife.co.uk: could not connect to host
-repsltd.co.uk: did not receive HSTS header
-reptilauksjonen.no: could not connect to host
-republicanleader.gov: did not receive HSTS header
-republicanwhip.gov: did not receive HSTS header
-republicmo.gov: did not receive HSTS header
-repustate.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-reqognize.com: did not receive HSTS header
-reqrut.net: did not receive HSTS header
-requena.tv: did not receive HSTS header
-request-trent.com: did not receive HSTS header
-res-kc.com: did not receive HSTS header
-res-rheingau.de: could not connect to host
-res42.com: could not connect to host
-resc.la: could not connect to host
-research.md: could not connect to host
-researchbyaxia.com: could not connect to host
-reseponline.info: did not receive HSTS header
-reserve-online.net: did not receive HSTS header
-reservetonshift.com: could not connect to host
-reservoirtp.fr: did not receive HSTS header
-resfriatech.com.br: did not receive HSTS header
-residentiallocksmithsanantoniotx.com: did not receive HSTS header
-residentialmortgageholdings.com: could not connect to host
-residentsinsurance.co.uk: did not receive HSTS header
-resistav.com: could not connect to host
-resl20.servehttp.com: could not connect to host
-resolvergroup.com.au: did not receive HSTS header
-resoundpro.ca: could not connect to host
-respice.xyz: could not connect to host
-ressos.com: did not receive HSTS header
-restaurace-klokocka.cz: did not receive HSTS header
-restaurant-mangal.ch: could not connect to host
-restaurant-rosengarten.at: could not connect to host
-restaurantemiperu.com: did not receive HSTS header
-restaurantesimonetti.com.br: could not connect to host
-restaurantguru.com: did not receive HSTS header
-restaurantmaan.nl: did not receive HSTS header
-restaurantmangal.ch: could not connect to host
-restchart.com: did not receive HSTS header
-rester-a-domicile.ch: could not connect to host
-rester-autonome-chez-soi.ch: could not connect to host
-restioson.me: could not connect to host
-restopro.nyc: could not connect to host
-restore-aid.com: did not receive HSTS header
-restoreresearchstudy.com: could not connect to host
-resultsdate.news: could not connect to host
-retcor.net: could not connect to host
-retefrati.it: could not connect to host
-retetenoi.net: could not connect to host
-reth.ch: could not connect to host
-retireyourpassword.org: did not receive HSTS header
-retogroup.com: could not connect to host
-retrojar.top: could not connect to host
-retropage.co: could not connect to host
-retrowave.eu: did not receive HSTS header
-rets.org.br: did not receive HSTS header
-retube.ga: could not connect to host
-returnofwar.com: could not connect to host
-reulitz.de: could not connect to host
-reupo.com: could not connect to host
-reussir-ma-fete.fr: could not connect to host
-reuter-shop.com: did not receive HSTS header
-revampweb-staging.azurewebsites.net: did not receive HSTS header
-revapost.ch: could not connect to host
-revapost.fr: could not connect to host
-revelaciones.tv: could not connect to host
-revello.org: did not receive HSTS header
-reverie.pw: could not connect to host
-reverse.design: could not connect to host
-revhost-consulting.fr: did not receive HSTS header
-review.info: could not connect to host
-reviewjust.com: did not receive HSTS header
-reviewmed-215418.appspot.com: did not receive HSTS header
-reviewspedia.org: could not connect to host
-revisit.date: did not receive HSTS header
-revistapequenosolhares.com.br: could not connect to host
-revivalsstores.com: did not receive HSTS header
-revolt.tv: did not receive HSTS header
-revolta-hosting.fr: did not receive HSTS header
-revolucionfemenina.com: could not connect to host
-revolutionhive.com: could not connect to host
-revthefox.co.uk: did not receive HSTS header
-revtut.net: could not connect to host
-rewopit.net: could not connect to host
-rewrite3.com: could not connect to host
-rewtherealtor.com: did not receive HSTS header
-rex.st: could not connect to host
-rexhockingkelpies.com.au: did not receive HSTS header
-reyesfernando.com: max-age too low: 0
-reykjavik.guide: could not connect to host
-rezaaryo.id: did not receive HSTS header
-rezendemultimarcas.com.br: could not connect to host
-rezexpert.com: did not receive HSTS header
-rezosup.net: could not connect to host
-rezosup.org: could not connect to host
-rf.tn: could not connect to host
-rfeif.org: could not connect to host
-rfitness.dk: did not receive HSTS header
-rftoon.com: could not connect to host
-rgavmf.ru: did not receive HSTS header
-rgservers.com: did not receive HSTS header
-rhapsodhy.hu: could not connect to host
-rhdigital.pro: could not connect to host
-rheijmans.io: could not connect to host
-rheijmans.nl: could not connect to host
-rheinturm.nrw: could not connect to host
-rheocube.com: did not receive HSTS header
-rhering.de: could not connect to host
-rheuma-online.de: could not connect to host
-rhevelo.com: did not receive HSTS header
-rhnet.at: could not connect to host
-rhodes.ml: could not connect to host
-rhodesianridgeback.com.br: could not connect to host
-rhodosdreef.nl: could not connect to host
-rhondanp.com: did not receive HSTS header
-rhypehost.com: could not connect to host
-ribeirostore.com.br: could not connect to host
-ribopierre.fr: could not connect to host
-ribs.com: did not receive HSTS header
-ricaribeiro.com.br: could not connect to host
-riceglue.com: did not receive HSTS header
-richamorindonesia.com: did not receive HSTS header
-richardb.me: could not connect to host
-richardfeinbergdds.com: did not receive HSTS header
-richardhering.de: did not receive HSTS header
-richeza.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-richie.cloud: could not connect to host
-richie.link: did not receive HSTS header
-richieheijmans.cloud: could not connect to host
-richiemail.net: could not connect to host
-richlj.com: did not receive HSTS header
-richmtdriver.com: could not connect to host
-richonrails.com: did not receive HSTS header
-richsiciliano.com: could not connect to host
-richterphilipp.com: could not connect to host
-richtoinfinity.com: did not receive HSTS header
-rickmartensen.nl: could not connect to host
-ricknox.com: could not connect to host
-ricky.capital: could not connect to host
-rickycbenitez.com: did not receive HSTS header
-rico.ovh: could not connect to host
-ricoydesign.com: could not connect to host
-rid-wan.com: could not connect to host
-riddickthemovie.tk: could not connect to host
-riddims.co: did not receive HSTS header
-ride-up.com: did not receive HSTS header
-rideaudiscount.com: did not receive HSTS header
-rideforwade.com: could not connect to host
-rideforwade.net: could not connect to host
-rideforwade.org: could not connect to host
-rideworks.com: did not receive HSTS header
-ridgelandchurch.org: did not receive HSTS header
-ridingoklahoma.com: could not connect to host
-ridvan-vllasaliu.tk: could not connect to host
-ridwan.co: could not connect to host
-riederle.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-riemer.ml: did not receive HSTS header
-riemzac.com: could not connect to host
-rienasemettre.fr: did not receive HSTS header
-riesenmagnete.de: could not connect to host
-riester.pl: did not receive HSTS header
-rifkivalkry.net: did not receive HSTS header
-rigabeerbike.lv: could not connect to host
-right-to-love.name: did not receive HSTS header
-right2.org: could not connect to host
-rightcapital.com: did not receive HSTS header
-righteousendeavour.com: could not connect to host
-rightpol.com: could not connect to host
-righttoknow.ie: did not receive HSTS header
-rigolitch.fr: did not receive HSTS header
-rijndael.xyz: could not connect to host
-rijnmondeg.nl: did not receive HSTS header
-rika.me: did not receive HSTS header
-rileyevans.co.uk: could not connect to host
-rimediogiusto.com: could not connect to host
-rincon-nsn.gov: max-age too low: 300
-rincondenoticas.com: could not connect to host
-ring.com: did not receive HSTS header
-ring0.xyz: did not receive HSTS header
-ringh.am: could not connect to host
-rinj.se: could not connect to host
-rinprom.com: could not connect to host
-rionewyork.com.br: could not connect to host
-rippleunion.com: could not connect to host
-risi-china.com: could not connect to host
-risingsun.red: could not connect to host
-riskcategory.com: could not connect to host
-riskmgt.com.au: could not connect to host
-riskmitigation.ch: did not receive HSTS header
-rissato.com.br: did not receive HSTS header
-ristorantefattoamano.eu: could not connect to host
-ritaohio.gov: could not connect to host
-rithm.ch: did not receive HSTS header
-rittis.ru: did not receive HSTS header
-ritualesyamarresdelamor.com: could not connect to host
-rivagecare.it: did not receive HSTS header
-riverbendessentialoil.com: did not receive HSTS header
-rivermendhealthcenters.com: did not receive HSTS header
-riversideauto.net: did not receive HSTS header
-riversideiowa.gov: did not receive HSTS header
-riverstyxgame.com: could not connect to host
-rivlo.com: could not connect to host
-rivy.org: did not receive HSTS header
-rixzz.ovh: could not connect to host
-rizonrice.club: did not receive HSTS header
-rj.gg: could not connect to host
-rjnutrition.consulting: did not receive HSTS header
-rk6.cz: could not connect to host
-rkc-hygrotherm.de: could not connect to host
-rkkhok.hu: did not receive HSTS header
-rkmantpur.org: did not receive HSTS header
-rkmedia.no: could not connect to host
-rle.me: did not receive HSTS header
-rlnunez.com: could not connect to host
-rmaqequipamentos.com.br: could not connect to host
-rmdlingerie.com.br: did not receive HSTS header
-rme.li: did not receive HSTS header
-rmf.io: could not connect to host
-rmi.com.ar: did not receive HSTS header
-rmk.si: could not connect to host
-rmpsolution.de: did not receive HSTS header
-rms-digicert.ne.jp: did not receive HSTS header
-rmsides.com: did not receive HSTS header
-rn29.me: could not connect to host
-rnb-storenbau.ch: max-age too low: 0
-rnt.cl: did not receive HSTS header
-roadfeast.com: could not connect to host
-roadtopgm.com: could not connect to host
-roan24.pl: did not receive HSTS header
-roave.com: did not receive HSTS header
-rob.uk.com: did not receive HSTS header
-robert-flynn.de: could not connect to host
-robertabittle.com: could not connect to host
-roberto-webhosting.nl: could not connect to host
-robertses.org: could not connect to host
-robertsonsalts.info: did not receive HSTS header
-robi-net.it: could not connect to host
-robicue.com: could not connect to host
-robin-novotny.com: could not connect to host
-robin.io: did not receive HSTS header
-robinadr.com: did not receive HSTS header
-robinfrancq.ml: could not connect to host
-robinloeffel.ch: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-robinsonstrategy.com: could not connect to host
-robinvdmarkt.nl: could not connect to host
-robomonkey.org: could not connect to host
-robot.works: did not receive HSTS header
-roboth.am: could not connect to host
-robotics.plus: did not receive HSTS header
-robsalmon.me.uk: did not receive HSTS header
-robteix.com: did not receive HSTS header
-robtex.net: did not receive HSTS header
-robtex.org: did not receive HSTS header
-robust.ga: could not connect to host
-robuxemporium.com: could not connect to host
-roc.net.au: could not connect to host
-rochcloud.cf: could not connect to host
-rochman.id: did not receive HSTS header
-rockcellar.ch: could not connect to host
-rockenfuerlachenhelfen.de: did not receive HSTS header
-rockerchyc.com: did not receive HSTS header
-rocket-wars.de: did not receive HSTS header
-rocketgnomes.com: could not connect to host
-rocketnet.ml: could not connect to host
-rockeyscrivo.com: did not receive HSTS header
-rockfax.com: did not receive HSTS header
-rockhounds.co.za: did not receive HSTS header
-rockmyshoes.co.uk: could not connect to host
-rocksberg.net: could not connect to host
-rockuse.com.br: did not receive HSTS header
-rockz.io: did not receive HSTS header
-rod.run: did not receive HSTS header
-rodab.party: could not connect to host
-rodafe.sk: could not connect to host
-rodarion.pl: could not connect to host
-roddis.net: did not receive HSTS header
-rodehutskors.net: could not connect to host
-rodinneodpoledne2018.cz: could not connect to host
-rodney.id.au: did not receive HSTS header
-rodneybrooksjr.com: could not connect to host
-rodosto.com: did not receive HSTS header
-rodzina-kupiec.eu.org: did not receive HSTS header
-roelbazuin.com: could not connect to host
-roeldevries.me: did not receive HSTS header
-roelf.org: did not receive HSTS header
-roeljoyas.com: did not receive HSTS header
-roeper.party: could not connect to host
-roesemann.email: could not connect to host
-roffe.nu: did not receive HSTS header
-roflcopter.fr: did not receive HSTS header
-rofrank.space: could not connect to host
-rogeiro.net: could not connect to host
-roger101.com: did not receive HSTS header
-rogerbertrand.com: could not connect to host
-rogerdat.ovh: could not connect to host
-rogue-e.xyz: could not connect to host
-roguefinancial.com: could not connect to host
-roguetechhub.org: could not connect to host
-rohanbassett.com: could not connect to host
-roiscroll.com: did not receive HSTS header
-roketix.co.uk: did not receive HSTS header
-roksolana.be: could not connect to host
-rolandinsh.com: did not receive HSTS header
-rolandlips.com: could not connect to host
-rolandoredi.com: could not connect to host
-rolandslate.com: did not receive HSTS header
-rolemaster.net: did not receive HSTS header
-roleplayhome.com: could not connect to host
-rolfsbuss.se: did not receive HSTS header
-rollatorweb.nl: did not receive HSTS header
-rollercoasteritalia.it: did not receive HSTS header
-rollingstocks.tk: could not connect to host
-rolliwelt.de: could not connect to host
-rolobio.com: max-age too low: 3600
-rolroer.co.za: could not connect to host
-romaimperator.com: did not receive HSTS header
-romainmuller.xyz: did not receive HSTS header
-romancloud.com: could not connect to host
-romano.guru: could not connect to host
-romans-place.me.uk: could not connect to host
-romantic-quotes.co.uk: could not connect to host
-romanticfirstdance.com: did not receive HSTS header
-romanticschemermovie.com: could not connect to host
-romar-bos.nl: could not connect to host
-romastantra.com: could not connect to host
-romeoferraris.com: did not receive HSTS header
-romleg.cf: could not connect to host
-roms.fun: could not connect to host
-romulusapp.com: could not connect to host
-romun.net: could not connect to host
-romy.tw: could not connect to host
-ron2k.za.net: did not receive HSTS header
-ronanrbr.com: did not receive HSTS header
-rondoniatec.com.br: did not receive HSTS header
-rondreis-planner.nl: did not receive HSTS header
-ronghexx.com: could not connect to host
-ronnytito.com: did not receive HSTS header
-ronvandordt.info: could not connect to host
-ronwo.de: could not connect to host
-ronzertnert.xyz: could not connect to host
-roo.ie: could not connect to host
-rool.me: did not receive HSTS header
-roolevoi.ru: did not receive HSTS header
-room-checkin24.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-room2d.com: did not receive HSTS header
-roomongo.com: did not receive HSTS header
-roosterpgplus.nl: could not connect to host
-rootbsd.at: could not connect to host
-rootforum.org: did not receive HSTS header
-rootkit.es: did not receive HSTS header
-rootrelativity.com: could not connect to host
-rootservice.org: did not receive HSTS header
-rootspersona.com: did not receive HSTS header
-rootwpn.com: could not connect to host
-rop.io: did not receive HSTS header
-roquecenter.org: did not receive HSTS header
-roromendut.online: could not connect to host
-rorymcdaniel.com: could not connect to host
-rosemariefloydballet.com: could not connect to host
-roseofyork.com: did not receive HSTS header
-roseofyorkbooking.com: could not connect to host
-rosetiger.life: could not connect to host
-rosewoodranch.com: did not receive HSTS header
-roshiya.co.in: could not connect to host
-rosimms.com: did not receive HSTS header
-rospa100.com: did not receive HSTS header
-rossclark.com: did not receive HSTS header
-rossen.be: did not receive HSTS header
-rossfrancis.co.uk: did not receive HSTS header
-rossilber.com: did not receive HSTS header
-rosslug.org.uk: could not connect to host
-rostros.eu: did not receive HSTS header
-rotapalor.com: did not receive HSTS header
-rotex1840.de: did not receive HSTS header
-rothnater.ch: did not receive HSTS header
-rotter-dam.nl: did not receive HSTS header
-rotterdamjazz.info: could not connect to host
-rottipowah.com: did not receive HSTS header
-rotzonline.com: could not connect to host
-rough.nu: could not connect to host
-roundaboutweb.info: did not receive HSTS header
-rous.se: could not connect to host
-routeragency.com: did not receive HSTS header
-routercncperu.com: did not receive HSTS header
-rouvray.org: did not receive HSTS header
-rove3d.com: could not connect to host
-rows.io: did not receive HSTS header
-royal-forest.org: max-age too low: 0
-royal-mangal.ch: could not connect to host
-royal806.com: did not receive HSTS header
-royal810.com: did not receive HSTS header
-royal811.com: did not receive HSTS header
-royal812.com: did not receive HSTS header
-royal813.com: did not receive HSTS header
-royal816.com: did not receive HSTS header
-royal817.com: did not receive HSTS header
-royal818.com: did not receive HSTS header
-royal830.com: did not receive HSTS header
-royal833.com: did not receive HSTS header
-royal850.com: did not receive HSTS header
-royal851.com: did not receive HSTS header
-royal852.com: did not receive HSTS header
-royal855.com: did not receive HSTS header
-royal856.com: could not connect to host
-royal857.com: did not receive HSTS header
-royal859.com: did not receive HSTS header
-royal86.com: did not receive HSTS header
-royal861.com: could not connect to host
-royal862.com: could not connect to host
-royal863.com: could not connect to host
-royal865.com: did not receive HSTS header
-royal867.com: could not connect to host
-royal868.com: did not receive HSTS header
-royal871.com: could not connect to host
-royal872.com: could not connect to host
-royal873.com: could not connect to host
-royal875.com: could not connect to host
-royal876.com: could not connect to host
-royal877.com: did not receive HSTS header
-royal879.com: could not connect to host
-royal88.tech: did not receive HSTS header
-royal881.com: did not receive HSTS header
-royal882.com: did not receive HSTS header
-royal883.com: did not receive HSTS header
-royal885.com: did not receive HSTS header
-royal886.com: did not receive HSTS header
-royal887.com: did not receive HSTS header
-royal888888.com: did not receive HSTS header
-royal889.com: did not receive HSTS header
-royal890.com: could not connect to host
-royal891.com: could not connect to host
-royal892.com: could not connect to host
-royal893.com: could not connect to host
-royal894.com: could not connect to host
-royal895.com: could not connect to host
-royal896.com: did not receive HSTS header
-royal898.com: did not receive HSTS header
-royal899.com: did not receive HSTS header
-royalbuffetdijon.fr: did not receive HSTS header
-royalcitytaxi.ca: could not connect to host
-royalfoxrealtor.com: could not connect to host
-royalhop.co: could not connect to host
-royalpalacenogent.fr: did not receive HSTS header
-royalsignaturecruise.com: could not connect to host
-royalty-market.com: could not connect to host
-royalyule.com: could not connect to host
-royjr.com: did not receive HSTS header
-royzez.com: could not connect to host
-rozalisbengal.ro: could not connect to host
-rozeapp.nl: could not connect to host
-rp2018.co.uk: could not connect to host
-rpasafrica.com: could not connect to host
-rpauto.ru: could not connect to host
-rpgchan.cf: could not connect to host
-rphl.net: could not connect to host
-rprevost.fr: did not receive HSTS header
-rr.in.th: did not receive HSTS header
-rr105.de: did not receive HSTS header
-rr5197.co: could not connect to host
-rr6729.co: could not connect to host
-rr6729.com: did not receive HSTS header
-rr6957.co: could not connect to host
-rr9297.co: could not connect to host
-rr9397.com: could not connect to host
-rr9721.com: could not connect to host
-rr9728.co: could not connect to host
-rrbts.com: could not connect to host
-rring.me: could not connect to host
-rritv.com: could not connect to host
-rrke.cc: could not connect to host
-rro.rs: could not connect to host
-rrom.me: did not receive HSTS header
-rs-cloud.ddns.net: could not connect to host
-rs-devdemo.host: could not connect to host
-rs-solution.ch: could not connect to host
-rsajeey.info: could not connect to host
-rsampaio.info: could not connect to host
-rsauget.fr: could not connect to host
-rsblake.net: could not connect to host
-rsearch.co: did not receive HSTS header
-rsf.io: could not connect to host
-rsgcard.com: could not connect to host
-rsi.im: could not connect to host
-rskuipers.com: did not receive HSTS header
-rsldb.com: could not connect to host
-rsm-intern.de: could not connect to host
-rsmaps.org: could not connect to host
-rsmmail.com: could not connect to host
-rsships.com: did not receive HSTS header
-rssnews.world: could not connect to host
-rssr.ddns.net: could not connect to host
-rstraining.co.uk: could not connect to host
-rstsecuritygroup.co.uk: could not connect to host
-rt1314.xyz: did not receive HSTS header
-rtc.fun: could not connect to host
-rtd.uk.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-rte.eu: could not connect to host
-rtfpessoa.xyz: did not receive HSTS header
-rths.tk: could not connect to host
-rtrinflatables.co.uk: could not connect to host
-rttss.com: could not connect to host
-rtvi.com: did not receive HSTS header
-rtzoeller.com: could not connect to host
-rua.cx: could not connect to host
-ruarua.ml: could not connect to host
-rubbereggs.ca: could not connect to host
-rubbix.net: could not connect to host
-rubecodeberg.com: could not connect to host
-rubendv.be: did not receive HSTS header
-rubenjromo.com: did not receive HSTS header
-rubenschulz.nl: did not receive HSTS header
-rubi-ka.net: max-age too low: 0
-ruborr.se: did not receive HSTS header
-rubysecurity.org: did not receive HSTS header
-rubyshop.nl: did not receive HSTS header
-rucnerobene.eu: could not connect to host
-rudel-wot.de: could not connect to host
-rudelune.fr: could not connect to host
-rudeotter.com: did not receive HSTS header
-ruderverein-gelsenkirchen.de: did not receive HSTS header
-rudhaulidirectory.com: did not receive HSTS header
-ruediger-voigt.eu: could not connect to host
-ruedigervoigt.de: could not connect to host
-rueduparticulier.com: did not receive HSTS header
-ruequincampoix.com: did not receive HSTS header
-rufabula-com.appspot.com: did not receive HSTS header
-ruflay.ru: could not connect to host
-rugby.video: could not connect to host
-rugirlfriend.com: could not connect to host
-rugs.ca: did not receive HSTS header
-rugstorene.co.uk: did not receive HSTS header
-ruhr3.de: did not receive HSTS header
-ruig.jp: could not connect to host
-ruigomes.me: did not receive HSTS header
-ruimarques.xyz: could not connect to host
-ruiruigeblog.com: could not connect to host
-ruitersportbak.nl: could not connect to host
-ruja.dk: did not receive HSTS header
-rukhaiyar.com: could not connect to host
-rullzer.com: did not receive HSTS header
-rumenka.tk: could not connect to host
-rummage4property.co.uk: did not receive HSTS header
-rummel-platz.de: could not connect to host
-rumoterra.com.br: could not connect to host
-run-forrest.run: could not connect to host
-runawebinar.nl: could not connect to host
-runcarina.com: could not connect to host
-rundumcolumn.xyz: could not connect to host
-runhardt.eu: could not connect to host
-runnergrapher.com: could not connect to host
-runningandoutdoors.com: did not receive HSTS header
-runtimepanic.xyz: could not connect to host
-runtl.com: did not receive HSTS header
-runtondev.com: did not receive HSTS header
-ruqu.nl: could not connect to host
-rurs.ml: could not connect to host
-rusadmin.biz: did not receive HSTS header
-rushiiworks.com: could not connect to host
-rushmix.com: could not connect to host
-rushmyessay.gq: could not connect to host
-ruskod.net: could not connect to host
-rusl.me: could not connect to host
-rusl.net: did not receive HSTS header
-russianorthodoxchurch.co.uk: did not receive HSTS header
-russmarshall.com: could not connect to host
-russpuss.ru: did not receive HSTS header
-rustbyexample.com: did not receive HSTS header
-rustfanatic.com: did not receive HSTS header
-ruvinroshan.com: did not receive HSTS header
-ruxit.com: did not receive HSTS header
-rv-jpshop.com: could not connect to host
-rva.gov: could not connect to host
-rvc-france.com: did not receive HSTS header
-rvender.cz: did not receive HSTS header
-rvfu98.com: could not connect to host
-rvg.zone: could not connect to host
-rvoigt.eu: could not connect to host
-rvolve.net: could not connect to host
-rw-solutions.tech: could not connect to host
-rwanderlust.com: could not connect to host
-rwgamernl.ml: could not connect to host
-rx-contact.com: did not receive HSTS header
-rxcheck.com: did not receive HSTS header
-rxgroup.io: did not receive HSTS header
-rxprep.com: did not receive HSTS header
-rxt.social: could not connect to host
-rxv.cc: could not connect to host
-ryan-design.com: did not receive HSTS header
-ryancarter.co.uk: did not receive HSTS header
-ryanjarvis.co.uk: did not receive HSTS header
-ryanjarvis.org.uk: could not connect to host
-ryanroberts.co.uk: did not receive HSTS header
-ryanstreur.com: did not receive HSTS header
-ryanteck.uk: could not connect to host
-rybox.info: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-rychlikoderi.cz: could not connect to host
-rydermais.tk: did not receive HSTS header
-ryejuice.sytes.net: could not connect to host
-rylin.net: could not connect to host
-rylore.com: could not connect to host
-ryssl.com: could not connect to host
-ryssland.guide: could not connect to host
-ryu22e.org: did not receive HSTS header
-ryyule.com: could not connect to host
-ryzex.de: could not connect to host
-rzegroup.com: did not receive HSTS header
-s-a.xyz: could not connect to host
-s-d-v.ch: could not connect to host
-s-n-unso.com: did not receive HSTS header
-s-on.li: could not connect to host
-s-rickroll-p.pw: could not connect to host
-s-socks.com: could not connect to host
-s-yuz.com: did not receive HSTS header
-s.how: could not connect to host
-s0923.com: could not connect to host
-s0laris.co.uk: could not connect to host
-s13d.fr: could not connect to host
-s16e.no: did not receive HSTS header
-s1mplescripts.de: could not connect to host
-s1ris.org: did not receive HSTS header
-s30365.com: could not connect to host
-s3cases.com: did not receive HSTS header
-s3gfault.com: could not connect to host
-s3n.se: could not connect to host
-s4media.org: could not connect to host
-s5118.com: could not connect to host
-s5197.co: could not connect to host
-s6729.co: could not connect to host
-s6729.com: did not receive HSTS header
-s6957.co: could not connect to host
-s9297.co: could not connect to host
-s9397.com: could not connect to host
-s9721.com: could not connect to host
-s9728.co: could not connect to host
-saabwa.org: could not connect to host
-saah.ae: did not receive HSTS header
-saastopankki.fi: did not receive HSTS header
-sabatek.pl: did not receive HSTS header
-sabe.cz: did not receive HSTS header
-sabine-dicklberger-massschneiderei-muenchen.de: did not receive HSTS header
-sabtunes.com: could not connect to host
-saccounty.gov: did not receive HSTS header
-sacharidovejednotky.eu: could not connect to host
-sackers.com: did not receive HSTS header
-saco-ceso.com: could not connect to host
-sadiejanehair.com: could not connect to host
-sadievilleky.gov: could not connect to host
-saenforcement.agency: could not connect to host
-safari-afrique.com: did not receive HSTS header
-safe.moe: did not receive HSTS header
-safe.space: could not connect to host
-safeacs.com: could not connect to host
-safeathomeohio.gov: could not connect to host
-safedevice.net: did not receive HSTS header
-safeex.com: did not receive HSTS header
-safelist.eu: did not receive HSTS header
-safeme.ga: could not connect to host
-safemovescheme.co.uk: could not connect to host
-safemt.gov: could not connect to host
-safepay.io: could not connect to host
-safer-networking.org: did not receive HSTS header
-saferedirect.link: could not connect to host
-saferedirectlink.com: could not connect to host
-saferpost.com: could not connect to host
-safesecret.info: did not receive HSTS header
-safetext.me: could not connect to host
-safetynames.com: did not receive HSTS header
-safetyrisk.net: did not receive HSTS header
-safetysign.ir: did not receive HSTS header
-safetyworkkits.co.nz: did not receive HSTS header
-safewings-nh.nl: could not connect to host
-safing.me: could not connect to host
-safnah.com: did not receive HSTS header
-safungerar.se: could not connect to host
-saga-umzuege.de: max-age too low: 3600
-sagarhandicraft.com: did not receive HSTS header
-sagemontchurch.org: did not receive HSTS header
-sageth.com: could not connect to host
-sah3.net: could not connect to host
-saidelbakkali.com: max-age too low: 2592000
-saigonstar.de: could not connect to host
-sainikbiswas.com: could not connect to host
-saint-astier-triathlon.com: did not receive HSTS header
-saintefoy-tarentaise.com: did not receive HSTS header
-saintip.com: did not receive HSTS header
-saintjohnlutheran.church: did not receive HSTS header
-saintmichelqud.com: did not receive HSTS header
-saintsrobotics.com: did not receive HSTS header
-saintw.com: could not connect to host
-sairai.bid: could not connect to host
-saitoh-atsuko.com: did not receive HSTS header
-saiyasu-search.com: did not receive HSTS header
-sajter.ga: could not connect to host
-sakamichi.moe: could not connect to host
-sakaserver.com: did not receive HSTS header
-sakib.ninja: did not receive HSTS header
-sakurabuff.com: could not connect to host
-sakuracdn.com: could not connect to host
-sakuraflores.com.br: could not connect to host
-salaervergleich.com: did not receive HSTS header
-sale.sh: did not receive HSTS header
-sale4ru.ru: could not connect to host
-saleaks.org: could not connect to host
-salearnership.co.za: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-salentocab.com: could not connect to host
-saleslift.pl: could not connect to host
-salesmachine.io: did not receive HSTS header
-salishseawhalewatching.ca: did not receive HSTS header
-salixcode.com: could not connect to host
-sallysubs.com: could not connect to host
-salmo23.com.br: did not receive HSTS header
-salmonrecovery.gov: could not connect to host
-salmos91.com: could not connect to host
-salmotierra-salvatierra.com: could not connect to host
-salonestella.it: could not connect to host
-salserocafe.com: could not connect to host
-salserototal.com: could not connect to host
-saltedskies.com: could not connect to host
-saltireconservation.com: did not receive HSTS header
-salto.si: did not receive HSTS header
-saltra.online: could not connect to host
-saludnutrivida.com: could not connect to host
-saludsexualmasculina.org: did not receive HSTS header
-saludsis.mil.co: did not receive HSTS header
-saludyvida.site: could not connect to host
-saluels.servemp3.com: could not connect to host
-salvaalocombia.com: could not connect to host
-salverainha.org: could not connect to host
-salzamt.tk: could not connect to host
-sam-cousins.com: did not receive HSTS header
-samandej.ir: did not receive HSTS header
-samanthahumphreysstudio.com: did not receive HSTS header
-samanthasicecream.com: could not connect to host
-samariafar.com: did not receive HSTS header
-samaritan.tech: could not connect to host
-samaritansnet.org: could not connect to host
-samba.com.co: did not receive HSTS header
-sambaa.com.br: could not connect to host
-sametovymesic.cz: could not connect to host
-samfreaks.de: did not receive HSTS header
-samgrayson.me: did not receive HSTS header
-samin.tk: could not connect to host
-samitechnic.com: did not receive HSTS header
-saml2.com: could not connect to host
-samlam.ddns.net: could not connect to host
-samlamac.com: could not connect to host
-samlivogarv.dk: did not receive HSTS header
-sammenlignakasser.dk: did not receive HSTS header
-sammyslimos.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-samnya.cn: could not connect to host
-samp.im: could not connect to host
-sampcup.com: could not connect to host
-sampleappservice.com: could not connect to host
-sampoznay.ru: could not connect to host
-samraskauskas.com: could not connect to host
-samrobertson.co.uk: did not receive HSTS header
-samsen.club: could not connect to host
-samsonova.de: could not connect to host
-samsungphonegenerator.xyz: did not receive HSTS header
-samsungxoa.com: could not connect to host
-samuel-dumont.be: did not receive HSTS header
-samuirehabcenter.com: could not connect to host
-samvanderkris.com: could not connect to host
-samwilberforce.com: could not connect to host
-samyerkes.com: did not receive HSTS header
-san-mian-ka.ml: could not connect to host
-sanalbayrak.com: could not connect to host
-sanandreasstories.com: did not receive HSTS header
-sanasalud.org: did not receive HSTS header
-sanatfilan.com: could not connect to host
-sanatrans.com: could not connect to host
-sancdz.com: did not receive HSTS header
-sand-islets.de: did not receive HSTS header
-sandbagexpress.com: did not receive HSTS header
-sandbox.mydigipass.com: could not connect to host
-sandburner.net: could not connect to host
-sanderknape.com: did not receive HSTS header
-sandtonvipcompanions.com: did not receive HSTS header
-sandviks.com: did not receive HSTS header
-sanguoxiu.com: could not connect to host
-sangwon.io: could not connect to host
-sanhei.ch: did not receive HSTS header
-sanik.my: did not receive HSTS header
-sanikapandit.com: did not receive HSTS header
-sanilodge.com: did not receive HSTS header
-sanook69.com: did not receive HSTS header
-sanovnikat.com: did not receive HSTS header
-sanpei-design.com: did not receive HSTS header
-sanqinyinshi.com.cn: could not connect to host
-sanradon.by: did not receive HSTS header
-sansage.com.br: did not receive HSTS header
-sansdev.com: could not connect to host
-sansemea.com: did not receive HSTS header
-santacruzdescargas.tk: could not connect to host
-santafemacas.com.br: did not receive HSTS header
-santanderibc.com: did not receive HSTS header
-santanderideas.com: did not receive HSTS header
-santi.eu: did not receive HSTS header
-santing.net: could not connect to host
-santmark.com: could not connect to host
-santmark.eu: could not connect to host
-santmark.fi: could not connect to host
-santmark.info: could not connect to host
-santmark.net: could not connect to host
-santmark.org: could not connect to host
-santodomingocg.org: could not connect to host
-santojuken.co.jp: did not receive HSTS header
-santorinibbs.com: did not receive HSTS header
-santoshpandit.com: did not receive HSTS header
-santouri.be: could not connect to host
-sanyasingh.in: did not receive HSTS header
-saoneth.pl: could not connect to host
-saotn.org: did not receive HSTS header
-sapereaude.com.pl: did not receive HSTS header
-saposute-s.jp: could not connect to host
-sapphireblue.me: could not connect to host
-sapuncheta.com: did not receive HSTS header
-sarabara.com: max-age too low: 5184000
-sarah-beckett-harpist.com: did not receive HSTS header
-sarahboydrealty.com: did not receive HSTS header
-sarahcheyette.com: did not receive HSTS header
-sarahcorliss.com: did not receive HSTS header
-sarahdoyley.com: could not connect to host
-sarahlouisesearle.com: could not connect to host
-sarahsweetlife.com: could not connect to host
-sarahsweger.com: could not connect to host
-sarahvictor.co.uk: did not receive HSTS header
-sarangsemutbandung.com: could not connect to host
-sardegnatirocini.it: could not connect to host
-sargeson.it: did not receive HSTS header
-sarindia.com: could not connect to host
-sarindia.de: could not connect to host
-sarisonproductions.com: did not receive HSTS header
-sarkarikhoj.com: could not connect to host
-sarkarischeme.in: could not connect to host
-sarkisozleri.us: could not connect to host
-sarndipity.com: could not connect to host
-saronno5stelle.it: did not receive HSTS header
-saruwebshop.co.za: could not connect to host
-sasanika.org: could not connect to host
-sat.rent: did not receive HSTS header
-sat7a-riyadh.com: did not receive HSTS header
-satanichia.moe: could not connect to host
-satisperfectacollections.com: could not connect to host
-sativatunja.com: could not connect to host
-satmep.com: did not receive HSTS header
-satoshicrypt.com: could not connect to host
-satplay.host: could not connect to host
-satragreen.com: could not connect to host
-satrent.com: could not connect to host
-satrent.se: did not receive HSTS header
-satriyowibowo.my.id: could not connect to host
-satsang-uwe.de: did not receive HSTS header
-satsukii.moe: did not receive HSTS header
-sattamatkadpboss.mobi: could not connect to host
-sattaresult.in: could not connect to host
-saturne.tk: could not connect to host
-saturngames.co.uk: could not connect to host
-saucelabs.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-saucyfox.net: did not receive HSTS header
-saudavel.com.vc: could not connect to host
-saudeeconforto.com.br: did not receive HSTS header
-saudeintimadamulher.com.br: could not connect to host
-saudiarabiaevisa.co.uk: did not receive HSTS header
-sauenytt.no: could not connect to host
-sauer-systems.net: did not receive HSTS header
-saumon.xyz: could not connect to host
-saunasandstuff.ca: did not receive HSTS header
-saunasandstuff.com: did not receive HSTS header
-saurel.me: could not connect to host
-savacloud.com: did not receive HSTS header
-savannahtasteexperience.com: did not receive HSTS header
-savantic.io: could not connect to host
-savbus.net: could not connect to host
-save-me-koeln.de: did not receive HSTS header
-save.gov: could not connect to host
-saveaward.gov: could not connect to host
-savebt.net: could not connect to host
-savecashindia.com: did not receive HSTS header
-savekorea.net: max-age too low: 0
-savemoneyonenergy.com: did not receive HSTS header
-saveora.com: could not connect to host
-saveora.shop: could not connect to host
-savethedogfishfoundation.org: could not connect to host
-saveya.com: did not receive HSTS header
-saveyour.biz: could not connect to host
-savingbytes.com: did not receive HSTS header
-savinggoliath.com: could not connect to host
-savingsstoreonline.ca: did not receive HSTS header
-savisasolutions.co.za: did not receive HSTS header
-savvysuit.com: did not receive HSTS header
-savvytime.com: did not receive HSTS header
-saxol-group.com: could not connect to host
-say-hanabi.com: could not connect to host
-sayhanabi.com: could not connect to host
-sayori.pw: could not connect to host
-saytu.co: did not receive HSTS header
-sb-mnn.com: did not receive HSTS header
-sblum.de: did not receive HSTS header
-sbm.cloud: could not connect to host
-sbobetfun.com: could not connect to host
-sbox-archives.com: could not connect to host
-sbox-servers.com: could not connect to host
-sbr.red: did not receive HSTS header
-sbsbaits.com: did not receive HSTS header
-sbsnursery.co.uk: could not connect to host
-sby.de: did not receive HSTS header
-sc21.cn: did not receive HSTS header
-sc4le.com: could not connect to host
-scala.click: did not receive HSTS header
-scalacollege.nl: did not receive HSTS header
-scale.milano.it: could not connect to host
-scalive.tv: could not connect to host
-scanleasing.net: did not receive HSTS header
-scannabi.com: could not connect to host
-scanwords.cc: did not receive HSTS header
-scanwords.net: did not receive HSTS header
-scanwords.org: did not receive HSTS header
-scarvespalace.com: could not connect to host
-scbreed.com: did not receive HSTS header
-scentofwine.com: did not receive HSTS header
-sceptique.eu: did not receive HSTS header
-sch44r0n.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-schaafenstrasse.koeln: could not connect to host
-schadegarant.net: could not connect to host
-schaefer-reifen.de: did not receive HSTS header
-schalkoortbv.nl: did not receive HSTS header
-schaper-sport.com: did not receive HSTS header
-scharoth.de: did not receive HSTS header
-schatmeester.be: did not receive HSTS header
-schau-rein.co.at: did not receive HSTS header
-schauer.so: could not connect to host
-schd.io: did not receive HSTS header
-scheemadigital.com: could not connect to host
-scheidtweiler.de: did not receive HSTS header
-schermreparatierotterdam.nl: did not receive HSTS header
-schimmel-test.info: could not connect to host
-schimmelnagelspecialist.nl: did not receive HSTS header
-schlabbi.com: did not receive HSTS header
-schlafguru.com: could not connect to host
-schlossfuchs.de: could not connect to host
-schluesseldienst-hannover24.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-schmelzle.io: could not connect to host
-schmetterlingsapp.at: did not receive HSTS header
-schmid.tv: did not receive HSTS header
-schmidttulskie.de: did not receive HSTS header
-schmitt.ovh: could not connect to host
-schmitt.ws: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-schmitz.link: could not connect to host
-schneeketten-ratgeber.de: did not receive HSTS header
-schneider-electric.tg: could not connect to host
-schnell-abnehmen.tips: could not connect to host
-schnell-gold.com: did not receive HSTS header
-schnellsuche.de: did not receive HSTS header
-schoeck-elektro.de: could not connect to host
-schokofoto.de: did not receive HSTS header
-scholarly.com.ph: could not connect to host
-scholarly.ph: could not connect to host
-scholierenvervoerzeeland.nl: did not receive HSTS header
-scholl.io: could not connect to host
-schollbox.de: could not connect to host
-scholledev.com: could not connect to host
-school.in.th: could not connect to host
-schooli.io: could not connect to host
-schoolotzyv.ru: could not connect to host
-schoolsonice.nl: could not connect to host
-schoolstats.de: did not receive HSTS header
-schooltrends.co.uk: did not receive HSTS header
-schoolze.com: did not receive HSTS header
-schoop.me: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-schopenhauer-institut.de: could not connect to host
-schorel.ovh: could not connect to host
-schraebanowicz.net: did not receive HSTS header
-schreiber-netzwerk.eu: did not receive HSTS header
-schreibnacht.de: did not receive HSTS header
-schreinerei-wortmann.de: did not receive HSTS header
-schrikdraad.net: did not receive HSTS header
-schrodinger.io: could not connect to host
-schroepfglas-versand.de: did not receive HSTS header
-schroettle.com: did not receive HSTS header
-schsrch.org: could not connect to host
-schuhbeck.tk: could not connect to host
-schulterglatzen-altenwalde.de: could not connect to host
-schultz.is: max-age too low: 0
-schur-it.de: could not connect to host
-schurkenstaat.net: did not receive HSTS header
-schwarzkopfforyou.de: could not connect to host
-schwarzwaldcon.de: did not receive HSTS header
-schwedenhaus.ag: did not receive HSTS header
-schweiz.guide: could not connect to host
-schweizerbolzonello.net: could not connect to host
-schwetz.net: could not connect to host
-sci-internet.tk: could not connect to host
-scib.tk: could not connect to host
-science-anatomie.com: did not receive HSTS header
-science360.gov: did not receive HSTS header
-scienceathome.org: did not receive HSTS header
-sciencehouse.jp: did not receive HSTS header
-sciencemonster.co.uk: could not connect to host
-scientific.boston: could not connect to host
-scifi.fyi: did not receive HSTS header
-scionasset.com: did not receive HSTS header
-sciototownship-oh.gov: did not receive HSTS header
-scis.com.ua: did not receive HSTS header
-scitopia.me: could not connect to host
-scivillage.com: did not receive HSTS header
-sckc.stream: did not receive HSTS header
-sclgroup.cc: could not connect to host
-sclns.co: could not connect to host
-scm-2017.org: could not connect to host
-scontogiusto.com: could not connect to host
-scoolcode.com: did not receive HSTS header
-scooshonline.co.uk: did not receive HSTS header
-scootfleet.com: could not connect to host
-scopea.fr: max-age too low: 0
-score-savers.com: max-age too low: 10540800
-scores4schools.com: could not connect to host
-scorobudem.ru: could not connect to host
-scorocode.ru: did not receive HSTS header
-scorpowines.com: did not receive HSTS header
-scottainslie.me.uk: could not connect to host
-scottdial.com: did not receive HSTS header
-scottferguson.com.au: did not receive HSTS header
-scottgruber.me: did not receive HSTS header
-scottgthomas.com: could not connect to host
-scotthel.me: did not receive HSTS header
-scotthelme.com: did not receive HSTS header
-scottnicol.co.uk: could not connect to host
-scottstorey.co.uk: did not receive HSTS header
-scourt.info: could not connect to host
-scourt.org.ua: could not connect to host
-scoutdb.ch: did not receive HSTS header
-scoutsanbartolome.tk: could not connect to host
-scpartyentertainment.co.uk: could not connect to host
-scra.gov: could not connect to host
-scrambl.is: could not connect to host
-scramble.io: did not receive HSTS header
-scrambler.in: could not connect to host
-scrapdealers.eu: did not receive HSTS header
-scrapings.net: could not connect to host
-scratchandscuffs.co.uk: could not connect to host
-scratchandscuffs.com: could not connect to host
-scratchandscuffs.uk: could not connect to host
-scredible.com: could not connect to host
-screen64.tk: could not connect to host
-screencaster.io: could not connect to host
-screenparadigm.com: could not connect to host
-screenresolution.space: could not connect to host
-screensaversplanet.com: did not receive HSTS header
-scribbler.monster: could not connect to host
-scribbleserver.com: could not connect to host
-scribe.systems: could not connect to host
-scrion.com: could not connect to host
-script.google.com: did not receive HSTS header (error ignored - included regardless)
-scriptenforcer.net: could not connect to host
-scripthost.org: could not connect to host
-scriptict.nl: did not receive HSTS header
-scriptjunkie.us: could not connect to host
-scrollstory.com: did not receive HSTS header
-scrtch.fr: could not connect to host
-scruffymen.com: could not connect to host
-scrumbleship.com: did not receive HSTS header
-scs-simulatoren.de: could not connect to host
-sctm.at: could not connect to host
-scuters.club: could not connect to host
-scw.com: did not receive HSTS header
-scw.nz: could not connect to host
-scwilliams.co.uk: could not connect to host
-scwilliams.uk: could not connect to host
-sdayman.com: did not receive HSTS header
-sdhmanagementgroup.com: could not connect to host
-sdia.ru: could not connect to host
-sdl-corporatesite-staging.azurewebsites.net: did not receive HSTS header
-sdmoscow.ru: did not receive HSTS header
-sdocast.com: could not connect to host
-sdrive-gutachter.de: did not receive HSTS header
-sdrobs.com: did not receive HSTS header
-sdsl-speedtest.de: could not connect to host
-sdsmanagement.me: could not connect to host
-sduoxminty.cn: could not connect to host
-sdvx.net: did not receive HSTS header
-se7ensins.com: did not receive HSTS header
-sea-godzilla.com: could not connect to host
-seaborn.top: did not receive HSTS header
-seacam-store.com: did not receive HSTS header
-seanchaidh.org: could not connect to host
-seankilgarriff.com: could not connect to host
-seans.cc: could not connect to host
-seanstrout.com: could not connect to host
-seansyardservice.com: did not receive HSTS header
-search: could not connect to host
-searchbrothers.at: did not receive HSTS header
-searchbrothers.ch: did not receive HSTS header
-searchbrothers.co.il: did not receive HSTS header
-searchbrothers.com: did not receive HSTS header
-searchbrothers.de: did not receive HSTS header
-searchbrothers.dk: did not receive HSTS header
-searchbrothers.es: did not receive HSTS header
-searchbrothers.fr: did not receive HSTS header
-searchbrothers.it: did not receive HSTS header
-searchbrothers.nl: did not receive HSTS header
-searchbrothers.ru: did not receive HSTS header
-searchbrothers.uk: did not receive HSTS header
-searchgov.gov.il: did not receive HSTS header
-searx.pw: could not connect to host
-searx.run: could not connect to host
-seats2meet.com: did not receive HSTS header
-seatshare.co.uk: did not receive HSTS header
-sebastiaandouma.co.uk: could not connect to host
-sebastian-bair.de: could not connect to host
-sebastian-haeutle.de: did not receive HSTS header
-sebastian-kraus.me: could not connect to host
-sebastian-lutsch.de: could not connect to host
-sebastian-schmidt.me: did not receive HSTS header
-sebastian-tobie.de: could not connect to host
-sebastianhampl.de: could not connect to host
-sebastianjaworecki.tk: could not connect to host
-sebastianpedersen.com: could not connect to host
-sebepoznani.eu: could not connect to host
-sebi.cf: could not connect to host
-sec.fish: did not receive HSTS header
-sec.red: could not connect to host
-sec44.com: did not receive HSTS header
-sec44.net: did not receive HSTS header
-sec44.org: did not receive HSTS header
-sec4share.me: did not receive HSTS header
-sec555.com: did not receive HSTS header
-secandtech.com: could not connect to host
-secanje.nl: did not receive HSTS header
-secard.me: could not connect to host
-secbone.com: did not receive HSTS header
-secboom.com: could not connect to host
-seccast.my: did not receive HSTS header
-seccomp.ru: did not receive HSTS header
-seceye.cn: could not connect to host
-secfish.com: did not receive HSTS header
-secfish.net: did not receive HSTS header
-sechat.one: could not connect to host
-secitem.at: could not connect to host
-secitem.de: could not connect to host
-secitem.eu: could not connect to host
-secnet.ga: could not connect to host
-secondary-survivor.com: could not connect to host
-secondary-survivor.help: could not connect to host
-secondary-survivor.net: could not connect to host
-secondarysurvivor.help: could not connect to host
-secondarysurvivorportal.com: could not connect to host
-secondarysurvivorportal.help: could not connect to host
-secondbike.co.uk: did not receive HSTS header
-secondbyte.nl: could not connect to host
-secondnature.bio: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-secondpay.nl: could not connect to host
-secondspace.ca: could not connect to host
-secpoc.online: could not connect to host
-secretar.is: could not connect to host
-secretnation.net: could not connect to host
-secretofanah.com: could not connect to host
-secretpigeon.com: could not connect to host
-sectest.ml: could not connect to host
-sectia22.ro: could not connect to host
-sectionw2s.org: did not receive HSTS header
-secumail.nl: did not receive HSTS header
-secur3.us: did not receive HSTS header
-secure-automotive-cloud.com: could not connect to host
-secure-automotive-cloud.org: could not connect to host
-secure-games.us: could not connect to host
-secure.chat: could not connect to host
-secure.link: did not receive HSTS header
-securechat4.me: could not connect to host
-securecomms.cz: did not receive HSTS header
-securedevelop.net: could not connect to host
-securedns.zone: could not connect to host
-securefuture.nl: did not receive HSTS header
-secureideas.com: did not receive HSTS header
-secureindia.co: could not connect to host
-securejabber.me: could not connect to host
-securemind.ch: could not connect to host
-secureprivacy101.org: could not connect to host
-secureradio.net: could not connect to host
-securesuisse.ch: could not connect to host
-securetheorem.com: did not receive HSTS header
-securetronic.ch: could not connect to host
-securify.nl: did not receive HSTS header
-securipy.com: could not connect to host
-securiscan.io: did not receive HSTS header
-securita.eu: did not receive HSTS header
-security-carpet.com: could not connect to host
-security-thoughts.org: could not connect to host
-security.google.com: did not receive HSTS header (error ignored - included regardless)
-security.xn--q9jyb4c: could not connect to host
-securityarena.com: could not connect to host
-securitybrief.asia: did not receive HSTS header
-securitybrief.co.nz: did not receive HSTS header
-securitybrief.com.au: did not receive HSTS header
-securitybrief.eu: did not receive HSTS header
-securitycamerasaustin.net: did not receive HSTS header
-securitycamerasjohnsoncity.com: did not receive HSTS header
-securityglance.com: could not connect to host
-securityindicators.com: could not connect to host
-securityinet.biz: could not connect to host
-securityinet.com: max-age too low: 60
-securityinet.net: did not receive HSTS header
-securityinet.org.il: could not connect to host
-securitymap.wiki: could not connect to host
-securitysoapbox.com: could not connect to host
-securitytalk.pl: could not connect to host
-securitytestfan.gov: could not connect to host
-securitywatch.co.nz: did not receive HSTS header
-securityzap.com: could not connect to host
-securiviera.ch: did not receive HSTS header
-securocloud.com: could not connect to host
-securon.io: could not connect to host
-securoswiss.ch: could not connect to host
-secwise.nl: could not connect to host
-sedesignxtra.com: could not connect to host
-sedeusquiser.net: could not connect to host
-sedrubal.de: could not connect to host
-sedussa.ro: did not receive HSTS header
-sedziapilkarski.pl: did not receive HSTS header
-seeclop.ch: did not receive HSTS header
-seedalpha.com: could not connect to host
-seedboxers.net: could not connect to host
-seedsofangelica.net: did not receive HSTS header
-seefirm.com: did not receive HSTS header
-seefunk.net: did not receive HSTS header
-seehimnaked.com: could not connect to host
-seehimnude.com: could not connect to host
-seehisnudes.com: could not connect to host
-seekers.ch: could not connect to host
-seekersmart.com: could not connect to host
-seeks.ru: could not connect to host
-seele.ca: could not connect to host
-seemeasaperson.com: did not receive HSTS header
-seen.life: could not connect to host
-seeonce.co: could not connect to host
-seezeitlodge-bostalsee.de: did not receive HSTS header
-sefinancial.com: did not receive HSTS header
-seg-sys.com: could not connect to host
-segenstore.com: could not connect to host
-segurosdecarroshialeah.org: did not receive HSTS header
-segurosdevidamiami.org: did not receive HSTS header
-sehenderson.com: did not receive HSTS header
-seht.xyz: could not connect to host
-seida.at: could not connect to host
-seiko-dojo.com: could not connect to host
-seiler-bad.de: did not receive HSTS header
-seiryokuzai-ch.com: could not connect to host
-seizoushokoyuubangou.com: did not receive HSTS header
-sekikawa.biz: could not connect to host
-sektor.ro: could not connect to host
-sektor.team: could not connect to host
-sektor.tech: could not connect to host
-selaluberkah.com: could not connect to host
-selco-himejiminami.com: could not connect to host
-selecadm.name: could not connect to host
-selectary.com: could not connect to host
-selectcertifiedautos.com: did not receive HSTS header
-selectruckscalltrackingreports.com: could not connect to host
-selectsplat.com: could not connect to host
-selent.me: could not connect to host
-selfdefenserx.com: could not connect to host
-selfhosters.com: could not connect to host
-selfie-france.fr: could not connect to host
-selfoutlet.com: did not receive HSTS header
-selfserverx.com: could not connect to host
-selitysvideot.fi: did not receive HSTS header
-selkiemckatrick.com: could not connect to host
-sellercritic.com: did not receive HSTS header
-sellmoretires.com: did not receive HSTS header
-sello.com: did not receive HSTS header
-sellocdn.com: did not receive HSTS header
-sellservs.co.za: could not connect to host
-semantheme.fr: could not connect to host
-semao.org: could not connect to host
-semen3325.xyz: could not connect to host
-semenkovich.com: did not receive HSTS header
-semenov.su: could not connect to host
-sementes.gratis: could not connect to host
-semianalog.com: could not connect to host
-seminariruumid.ee: did not receive HSTS header
-semmlers.com: did not receive HSTS header
-semplicementelight.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-semps-servers.de: could not connect to host
-semrush.com: did not receive HSTS header
-semyonov.su: could not connect to host
-semyonov.us: could not connect to host
-send4x.com: did not receive HSTS header
-sendash.com: did not receive HSTS header
-sendinvoice.nl: did not receive HSTS header
-senedirect.com: could not connect to host
-senemusique.com: did not receive HSTS header
-senhorst.com: did not receive HSTS header
-senimag.ro: did not receive HSTS header
-seniorhomepurchaseprogram.com: could not connect to host
-senmonsyoku.top: did not receive HSTS header
-sennase.net: did not receive HSTS header
-senorcontento.com: did not receive HSTS header
-senorporno.com: could not connect to host
-sensavi.ua: did not receive HSTS header
-sense.hamburg: could not connect to host
-sensebridge.com: did not receive HSTS header
-senseict.com.au: did not receive HSTS header
-senseofnumber.co.uk: did not receive HSTS header
-senseye.io: max-age too low: 604800
-sensiblemn.org: could not connect to host
-sensibus.com: did not receive HSTS header
-sensoft-int.com: could not connect to host
-sensoft-int.net: could not connect to host
-sensoft-int.org: could not connect to host
-sensound.ml: could not connect to host
-sentic.info: did not receive HSTS header
-sentiments.io: could not connect to host
-sentinelsmotorcycleclub.com: could not connect to host
-sentirmebien.org: could not connect to host
-seo-lagniappe.com: could not connect to host
-seo.consulting: did not receive HSTS header
-seo.tl: did not receive HSTS header
-seoarchive.org: could not connect to host
-seobot.com.au: could not connect to host
-seocomposer.com: did not receive HSTS header
-seoexperte.berlin: did not receive HSTS header
-seohochschule.de: did not receive HSTS header
-seoium.com: did not receive HSTS header
-seokay.com: did not receive HSTS header
-seolaba.io: could not connect to host
-seolib.org: could not connect to host
-seomarketingdeals.com: did not receive HSTS header
-seomen.biz: could not connect to host
-seomobo.com: could not connect to host
-seoprovider.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-seosanantonioinc.com: did not receive HSTS header
-seoscribe.net: could not connect to host
-seotools.asia: did not receive HSTS header
-seotronix.net: did not receive HSTS header
-seouniversity.org: could not connect to host
-seowarp.net: did not receive HSTS header
-sep23.ru: could not connect to host
-sepakbola.win: could not connect to host
-sephr.com: did not receive HSTS header
-sepie.gob.es: did not receive HSTS header
-seppelec.com: did not receive HSTS header
-seproco.com: could not connect to host
-seputarpengertian.com: could not connect to host
-seq.tf: could not connect to host
-sequatchiecountytn.gov: did not receive HSTS header
-ser-it.pl: could not connect to host
-serafin.tech: could not connect to host
-serathius.ovh: could not connect to host
-serbien.guide: could not connect to host
-serenitycreams.com: did not receive HSTS header
-serfdom.io: did not receive HSTS header
-sergiogas.com.br: did not receive HSTS header
-sergiojimenezequestrian.com: did not receive HSTS header
-sergiosantoro.it: could not connect to host
-sergos.de: could not connect to host
-serized.pw: could not connect to host
-serkanyarbas.com: could not connect to host
-serkanyarbas.com.tr: could not connect to host
-serv.site: did not receive HSTS header
-servdiscount.com: did not receive HSTS header
-servecrypt.com: could not connect to host
-servecrypt.net: could not connect to host
-servecrypt.ru: could not connect to host
-servemnaction.org: could not connect to host
-server-bg.net: could not connect to host
-server.pk: did not receive HSTS header
-server72a.ddns.net: could not connect to host
-server92.eu: could not connect to host
-server92.tk: could not connect to host
-serveradmin.ovh: could not connect to host
-serveradminz.com: did not receive HSTS header
-serverangels.co.uk: could not connect to host
-serverdensity.io: did not receive HSTS header
-servergno.me: did not receive HSTS header
-serverlauget.no: could not connect to host
-servermonkey.nl: could not connect to host
-serverping.io: did not receive HSTS header
-servers4all.co.uk: could not connect to host
-servfefe.com: could not connect to host
-service-wueste-vodafone.tk: could not connect to host
-serviceair.com.ar: could not connect to host
-servicemagicusa.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-servicemembers.gov: could not connect to host
-servicevie.com: did not receive HSTS header
-serviciodebarralibreparaeventos.com: did not receive HSTS header
-servidoresadmin.com: did not receive HSTS header
-servidoresweb.online: did not receive HSTS header
-serviefectivo.com.co: could not connect to host
-servmaslt.com: could not connect to host
-servpanel.de: did not receive HSTS header
-servu.de: could not connect to host
-servx.ru: could not connect to host
-serwis-wroclaw.pl: could not connect to host
-seryo.moe: could not connect to host
-seryo.net: could not connect to host
-seryovpn.com: could not connect to host
-sesha.co.za: could not connect to host
-setfix.de: could not connect to host
-sethoedjo.com: could not connect to host
-setkit.net: could not connect to host
-setsailanddive.com: did not receive HSTS header
-setterirlandes.com.br: could not connect to host
-setuid.de: could not connect to host
-seulean.gq: could not connect to host
-seven-purple.com: could not connect to host
-sevenet.pl: did not receive HSTS header
-sevengang.tk: could not connect to host
-sevenhearts.online: could not connect to host
-sevenmatches.com: could not connect to host
-severine-trousselard.com: could not connect to host
-sevinci.ch: could not connect to host
-sevwebdesign.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-sexaki.com: did not receive HSTS header
-sexar.info: could not connect to host
-sexara.co: could not connect to host
-sexpay.net: could not connect to host
-sexservice.io: could not connect to host
-sexshopfacil.com.br: could not connect to host
-sexshopnet.com.br: could not connect to host
-sexshopsgay.com: did not receive HSTS header
-sextfriend.com: did not receive HSTS header
-sexwork.net: could not connect to host
-seyahatsagliksigortalari.com: could not connect to host
-seyfarth.de: could not connect to host
-seyr.it: could not connect to host
-seyrederiz.com: did not receive HSTS header
-sf3223.com: could not connect to host
-sfashion.si: did not receive HSTS header
-sfcomercio.com.br: could not connect to host
-sfhobbies.com.br: could not connect to host
-sfi.sh: did not receive HSTS header
-sflhidta.gov: could not connect to host
-sfsltd.com: could not connect to host
-sgovaard.nl: could not connect to host
-sgrmreproduccionapp.azurewebsites.net: could not connect to host
-sgroup-hitoduma.com: did not receive HSTS header
-sgthotshot.com: could not connect to host
-sgtsnookums.net: could not connect to host
-sh4y.com: could not connect to host
-shaaaaaaaaaaaaa.com: did not receive HSTS header
-shaamrelief.org: could not connect to host
-shadiku.com: did not receive HSTS header
-shadow-socks.net: could not connect to host
-shadow-socks.org: could not connect to host
-shadow-socks.pro: could not connect to host
-shadowguardian507-irl.tk: did not receive HSTS header
-shadowguardian507.tk: could not connect to host
-shadowict.net: did not receive HSTS header
-shadowict.tech: did not receive HSTS header
-shadowmorph.info: did not receive HSTS header
-shadowoftheoldgods.com: did not receive HSTS header
-shadowping.com: could not connect to host
-shadowplus.net: could not connect to host
-shadowrocket.net: could not connect to host
-shadowroket.com: could not connect to host
-shadowshocks.net: could not connect to host
-shadowsocks.gift: could not connect to host
-shadowsocks.live: could not connect to host
-shadowsocks.net: could not connect to host
-shadowsocks.software: could not connect to host
-shadowsocks.vc: could not connect to host
-shadowsocksvpn.com: could not connect to host
-shadowsoks.com: could not connect to host
-shadowstack.de: did not receive HSTS header
-shadowsu.info: could not connect to host
-shadowsu.top: could not connect to host
-shadowsworldonline.co.uk: could not connect to host
-shag-shag.ru: could not connect to host
-shagi29.ru: did not receive HSTS header
-shahbeat.com: could not connect to host
-shainessim.com: could not connect to host
-shaitan.eu: could not connect to host
-shaken-kyoto.jp: could not connect to host
-shakes4u.com: did not receive HSTS header
-shamariki.ru: could not connect to host
-shamka.ru: did not receive HSTS header
-shandonsg.co.uk: could not connect to host
-shanekoster.net: did not receive HSTS header
-shanesage.com: could not connect to host
-shanevandermeer.com: could not connect to host
-shang-yu.cn: could not connect to host
-shangzhen.site: could not connect to host
-shankangke.com: could not connect to host
-shannoneichorn.com: could not connect to host
-shanxiapark.com: could not connect to host
-shanyhs.com: could not connect to host
-shaobin.wang: did not receive HSTS header
-shapesedinburgh.co.uk: did not receive HSTS header
-shardsoft.com: could not connect to host
-sharealo.org: could not connect to host
-sharecc.co: could not connect to host
-sharecrypted.com: did not receive HSTS header
-sharedhost.de: could not connect to host
-shareeri.com: could not connect to host
-shareeri.xyz: did not receive HSTS header
-shareimg.xyz: did not receive HSTS header
-sharemessage.net: could not connect to host
-shareoine.com: could not connect to host
-sharepass.pw: could not connect to host
-sharepic.xyz: could not connect to host
-sharepointdrive.com: could not connect to host
-sharesplitter.com: could not connect to host
-shareworx.net: could not connect to host
-shariahlawcenter.com: could not connect to host
-shariahlawcenter.org: could not connect to host
-sharialawcenter.com: could not connect to host
-sharialawcenter.org: could not connect to host
-sharingcode.com: did not receive HSTS header
-sharkcut.se: could not connect to host
-sharkie.org.za: did not receive HSTS header
-sharks.football: did not receive HSTS header
-sharpe-practice.co.uk: could not connect to host
-sharperedge.pw: could not connect to host
-sharperedgecomputers.com: could not connect to host
-sharpsburg-ga.gov: did not receive HSTS header
-shasso.com: did not receive HSTS header
-shatorin.com: did not receive HSTS header
-shauncrowley.co.uk: could not connect to host
-shaundanielz.com: could not connect to host
-shaunharker.com: did not receive HSTS header
-shaunwheelhou.se: could not connect to host
-shav.it: did not receive HSTS header
-shavingks.com: could not connect to host
-shawnbsmith.me: did not receive HSTS header
-shawnh.net: could not connect to host
-shawnstarrcustomhomes.com: could not connect to host
-shawnwilson.info: could not connect to host
-shazbots.org: could not connect to host
-shdsub.xyz: did not receive HSTS header
-sheaf.site: could not connect to host
-sheaspire.com.tw: did not receive HSTS header
-sheekdeveloper.com: could not connect to host
-sheekmedia.com: could not connect to host
-shellcode.com.br: did not receive HSTS header
-shellopolis.com: could not connect to host
-shellot.com: could not connect to host
-shellsec.pw: did not receive HSTS header
-shellshock.eu: could not connect to host
-shemissed.me: could not connect to host
-shemsconseils.ma: could not connect to host
-shena.co.uk: could not connect to host
-shengrenyu.com: could not connect to host
-shentengtu.idv.tw: could not connect to host
-shep.co.il: did not receive HSTS header
-sheratan.web.id: could not connect to host
-shereallyheals.com: did not receive HSTS header
-sheriffmiamicountyks.gov: max-age too low: 2592000
-sheriffpawneecountyne.gov: could not connect to host
-shervik.ga: could not connect to host
-shethbox.com: could not connect to host
-shevronpatriot.ru: did not receive HSTS header
-shh-listen.com: did not receive HSTS header
-shiatsu-institut.ch: did not receive HSTS header
-shibainu.com.br: could not connect to host
-shibe.club: could not connect to host
-shieldblaze.com: could not connect to host
-shieldcomputer.com: did not receive HSTS header
-shieldfe.com: could not connect to host
-shift.ooo: did not receive HSTS header
-shiftins.com: could not connect to host
-shiftnrg.org: did not receive HSTS header
-shiftplanning.com: did not receive HSTS header
-shiftpsych.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-shiinko.com: could not connect to host
-shiji456.com: max-age too low: 0
-shikinobi.com: did not receive HSTS header
-shimonfly.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-shin-inc.jp: did not receive HSTS header
-shindorei.fr: max-age too low: 0
-shinebijoux.com.br: could not connect to host
-shinju.moe: could not connect to host
-shinko-osaka.jp: could not connect to host
-shinobi-fansub.ro: could not connect to host
-shinonome-lab.eu.org: could not connect to host
-shiona.xyz: could not connect to host
-shipinsight.com: did not receive HSTS header
-shipmile.com: did not receive HSTS header
-shippingbo.com: did not receive HSTS header
-shirakaba-cc.com: did not receive HSTS header
-shiroki-k.net: could not connect to host
-shirosaki.org: could not connect to host
-shiseki.top: did not receive HSTS header
-shishamania.de: could not connect to host
-shitfest.info: did not receive HSTS header
-shitposting.life: could not connect to host
-shivammaheshwari.com: did not receive HSTS header
-shivatattvayoga.com: did not receive HSTS header
-shiyouqkl.com: could not connect to host
-shk.im: did not receive HSTS header
-shlemenkov.by: could not connect to host
-shm-forum.org.uk: could not connect to host
-shmibbles.me: could not connect to host
-shmunky.co.uk: did not receive HSTS header
-sho-tanaka.jp: could not connect to host
-shobhanayogsadan.com: could not connect to host
-shocksrv.com: did not receive HSTS header
-shoemuse.com: did not receive HSTS header
-shola.ga: could not connect to host
-sholtowu.com: could not connect to host
-shome.de: could not connect to host
-shooshosha.com: could not connect to host
-shootingstarmedium.com: could not connect to host
-shootpooloklahoma.com: could not connect to host
-shopcord.co.uk: did not receive HSTS header
-shopdongho.com: did not receive HSTS header
-shopdopastor.com.br: could not connect to host
-shopera.ch: did not receive HSTS header
-shopherbal.co.za: could not connect to host
-shophisway.com: could not connect to host
-shopific.co: could not connect to host
-shopify.com: did not receive HSTS header
-shopods.com: did not receive HSTS header
-shopontarget.com: did not receive HSTS header
-shoppeno5.com: did not receive HSTS header
-shoppia.se: did not receive HSTS header
-shoppingreview.org: did not receive HSTS header
-shoprose.ru: could not connect to host
-shoprsc.com: could not connect to host
-shops.neonisi.com: could not connect to host
-shopsouthafrican.com: did not receive HSTS header
-shortpath.com: could not connect to host
-shortr.li: could not connect to host
-shota.party: could not connect to host
-shotly.net: could not connect to host
-shotpixonline.com.br: did not receive HSTS header
-shoujik8.com: could not connect to host
-shouldbetaught.com: could not connect to host
-shoulderpainrelief.online: could not connect to host
-show-saratov.ru: did not receive HSTS header
-show-stream.tv: could not connect to host
-showdepiscinas.com.br: did not receive HSTS header
-shower.im: did not receive HSTS header
-showf.om: could not connect to host
-showkeeper.tv: did not receive HSTS header
-shownet.tk: could not connect to host
-showroom.de: did not receive HSTS header
-showroom113.ru: could not connect to host
-showslivki.tk: could not connect to host
-shreyansh26.me: could not connect to host
-shrinkhub.com: could not connect to host
-shtorku.com: could not connect to host
-shu-kin.net: did not receive HSTS header
-shuai1122.com: max-age too low: 0
-shukatsu-note.com: could not connect to host
-shukatsu-support.jp: did not receive HSTS header
-shuletime.ml: could not connect to host
-shulker.store: could not connect to host
-shurita.org: could not connect to host
-shuvo.rocks: could not connect to host
-shuvodeep.de: could not connect to host
-shv25.se: could not connect to host
-shwongacc.com: could not connect to host
-shwrm.ch: could not connect to host
-shymeck.pw: could not connect to host
-shymeck.xyz: could not connect to host
-shypp.it: did not receive HSTS header
-shyrydan.es: could not connect to host
-siamdevsqua.re: could not connect to host
-siamdevsquare.com: could not connect to host
-siamega.com: could not connect to host
-siammedia.co: could not connect to host
-siamojo.com: could not connect to host
-sianimacion.com: could not connect to host
-sianjhon.com: could not connect to host
-siao-mei.com: did not receive HSTS header
-sibfk.org: could not connect to host
-sichere-kartenakzeptanz.de: could not connect to host
-siciliadigitale.pro: could not connect to host
-sicilyalacarte.com: did not receive HSTS header
-sicklepod.com: could not connect to host
-siconnect.us: did not receive HSTS header
-sictame-tigf.org: could not connect to host
-sideropolisnoticias.com.br: did not receive HSTS header
-sidmax.ca: could not connect to host
-sidpod.ru: could not connect to host
-siduga.com: could not connect to host
-siebens.net: could not connect to host
-sieh.es: did not receive HSTS header
-siemencaes.tk: could not connect to host
-sierpinska.eu: could not connect to host
-sieulog.com: could not connect to host
-siewert-kau.de: did not receive HSTS header
-sifls.com: could not connect to host
-sifreuret.com: could not connect to host
-sigmalux.ltd: could not connect to host
-signaltransmitter.de: did not receive HSTS header
-signdesk.com: did not receive HSTS header
-signere.com: could not connect to host
-signere.no: did not receive HSTS header
-signmycode.com: could not connect to host
-signoracle.com: could not connect to host
-signosquecombinam.com.br: could not connect to host
-signrightsigns.co.uk: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-signsdance.uk: could not connect to host
-sigsegv.run: could not connect to host
-sihaizixun.net: could not connect to host
-siikarantacamping.fi: did not receive HSTS header
-sijimi.cn: could not connect to host
-sijmenschoon.nl: did not receive HSTS header
-sikatehtaat.fi: did not receive HSTS header
-siku.pro: could not connect to host
-silentcircle.com: did not receive HSTS header
-silentcircle.org: could not connect to host
-silentlink.io: could not connect to host
-silerfamily.net: could not connect to host
-silicagelpackets.ca: did not receive HSTS header
-siliconchip.me: did not receive HSTS header
-silke-hunde.de: did not receive HSTS header
-silkebeckmann.de: did not receive HSTS header
-silqueskineyeserum.com: could not connect to host
-silvacor-ziegel.de: max-age too low: 604800
-silver-drachenkrieger.de: did not receive HSTS header
-silverback.is: did not receive HSTS header
-silverfirsdental.com: did not receive HSTS header
-silvergoldbull.ba: could not connect to host
-silvergoldbull.bg: could not connect to host
-silvergoldbull.bj: could not connect to host
-silvergoldbull.cl: could not connect to host
-silvergoldbull.cm: could not connect to host
-silvergoldbull.cn: could not connect to host
-silvergoldbull.co: could not connect to host
-silvergoldbull.co.ao: could not connect to host
-silvergoldbull.co.tz: could not connect to host
-silvergoldbull.com.eg: could not connect to host
-silvergoldbull.com.gh: could not connect to host
-silvergoldbull.com.mt: could not connect to host
-silvergoldbull.dj: could not connect to host
-silvergoldbull.do: could not connect to host
-silvergoldbull.ge: could not connect to host
-silvergoldbull.hr: could not connect to host
-silvergoldbull.id: could not connect to host
-silvergoldbull.kg: could not connect to host
-silvergoldbull.ky: could not connect to host
-silvergoldbull.lk: could not connect to host
-silvergoldbull.md: could not connect to host
-silvergoldbull.mk: could not connect to host
-silvergoldbull.ml: could not connect to host
-silvergoldbull.mw: could not connect to host
-silvergoldbull.my: could not connect to host
-silvergoldbull.ph: could not connect to host
-silvergoldbull.ru: could not connect to host
-silvergoldbull.sn: could not connect to host
-silvergoldbull.tg: could not connect to host
-silvergoldbull.tj: could not connect to host
-silvergoldbull.tn: could not connect to host
-silvergoldbull.tt: could not connect to host
-silverhome.ninja: could not connect to host
-silveronline.ml: could not connect to host
-silverpvp.com: could not connect to host
-silverseen.com: did not receive HSTS header
-silverstartup.sk: could not connect to host
-silverswanrecruitment.com: did not receive HSTS header
-silviamacallister.com: did not receive HSTS header
-silvistefi.com: could not connect to host
-silvobeat.com: did not receive HSTS header
-sim-sim.appspot.com: did not receive HSTS header
-simbast.com: could not connect to host
-simbol.id: could not connect to host
-simbolo.co.uk: could not connect to host
-simccorp.com: could not connect to host
-simfri.com: could not connect to host
-simha.online: could not connect to host
-simhaf.cf: could not connect to host
-simobilklub.si: could not connect to host
-simod.org: could not connect to host
-simon-pokorny.com: did not receive HSTS header
-simon.butcher.name: max-age too low: 2629743
-simon.lc: did not receive HSTS header
-simongong.net: did not receive HSTS header
-simonpaarlberg.com: did not receive HSTS header
-simonsaxon.com: did not receive HSTS header
-simonschmitt.ch: could not connect to host
-simotrescu.ro: could not connect to host
-simpan.id: could not connect to host
-simpele-recepten.nl: did not receive HSTS header
-simpeo.fr: could not connect to host
-simpeo.org: could not connect to host
-simpleclassiclife.com: could not connect to host
-simplecrypt.io: could not connect to host
-simplefraud.com: could not connect to host
-simpleindianrecipes.com: did not receive HSTS header
-simplelearner.com: could not connect to host
-simplepractice.com: did not receive HSTS header
-simplepress.uk: did not receive HSTS header
-simplerses.com: could not connect to host
-simplesamlphp.org: did not receive HSTS header
-simplexgame.net: could not connect to host
-simplexsupport.com: did not receive HSTS header
-simpliby.com: did not receive HSTS header
-simply.black: could not connect to host
-simplyenak.com: did not receive HSTS header
-simplylifetips.com: did not receive HSTS header
-simplyrara.com: did not receive HSTS header
-simplystudio.com: did not receive HSTS header
-simpul.nl: did not receive HSTS header
-sims4hub.ga: could not connect to host
-simtin-net.de: could not connect to host
-simukti.net: did not receive HSTS header
-simumiehet.com: could not connect to host
-simyo.nl: did not receive HSTS header
-sin-nombre-alleria.de: could not connect to host
-sin30.net: could not connect to host
-sinakuhestani.ir: did not receive HSTS header
-sinatrafamily.com: did not receive HSTS header
-sincai666.com: could not connect to host
-sinceschool.com: could not connect to host
-sinclairmoving.com: did not receive HSTS header
-sincron.org: could not connect to host
-sincronizateconlosmilagros.com: did not receive HSTS header
-sinefili.com: could not connect to host
-sinfulforums.net: could not connect to host
-singee.site: could not connect to host
-singerwang.com: did not receive HSTS header
-singul4rity.com: could not connect to host
-sinkip.com: could not connect to host
-sinktank.de: could not connect to host
-sinn.io: did not receive HSTS header
-sinneserweiterung.de: could not connect to host
-sinon.org: did not receive HSTS header
-sinonimosonline.com.br: could not connect to host
-sinoscandinavia.se: could not connect to host
-sinosky.org: did not receive HSTS header
-sinsastudio.com: did not receive HSTS header
-sinsojb.me: could not connect to host
-sintesysglobal.com: did not receive HSTS header
-sion.moe: did not receive HSTS header
-sipsik.net: did not receive HSTS header
-siqi.wang: could not connect to host
-siratalmustaqim.com: could not connect to host
-siriad.com: could not connect to host
-sirius-lee.net: could not connect to host
-siro.gq: did not receive HSTS header
-siroop.ch: did not receive HSTS header
-siscompbolivia.tk: could not connect to host
-siseministeerium.ee: did not receive HSTS header
-sisgopro.com: could not connect to host
-sisiengineers.gq: could not connect to host
-sistemasespecializados.com: did not receive HSTS header
-sistemhane.com: did not receive HSTS header
-sistemlash.com: could not connect to host
-sistemos.net: could not connect to host
-sistersurprise.de: did not receive HSTS header
-site.mu: could not connect to host
-siteage.net: did not receive HSTS header
-sitecloudify.com: did not receive HSTS header
-sitecuatui.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-sitehome.eu: did not receive HSTS header
-sitehost.io: did not receive HSTS header
-sitehoster.org: could not connect to host
-sitemaxiphilippe.ch: could not connect to host
-sitennisclub.com: did not receive HSTS header
-siterip.org: could not connect to host
-sites.google.com: did not receive HSTS header (error ignored - included regardless)
-sitesecurityscan.com: did not receive HSTS header
-sitesforward.com: did not receive HSTS header
-sitesource101.com: did not receive HSTS header
-sitesten.com: could not connect to host
-sitesuccessful.com: did not receive HSTS header
-sitsy.ru: did not receive HSTS header
-sittinginoblivion.com: did not receive HSTS header
-siwek.xyz: could not connect to host
-sixcorners.info: did not receive HSTS header
-sixcorners.net: did not receive HSTS header
-sixtwentyten.com: did not receive HSTS header
-sizingservers.be: did not receive HSTS header
-sizuvip.com: did not receive HSTS header
-sizzle.co.uk: did not receive HSTS header
-sja-se-training.com: could not connect to host
-sjatsh.com: did not receive HSTS header
-sjdtaxi.com: did not receive HSTS header
-sjhyl11.com: could not connect to host
-sjis.me: could not connect to host
-sjsc.fr: did not receive HSTS header
-sjv4u.ch: did not receive HSTS header
-sjzebs.com: did not receive HSTS header
-sjzget.com: could not connect to host
-sjzybs.com: did not receive HSTS header
-sk-net.cz: did not receive HSTS header
-skalarwelle.eu: could not connect to host
-skandiabanken.no: did not receive HSTS header
-skante.tk: could not connect to host
-skanword.info: did not receive HSTS header
-skaraborgsassistans.com: did not receive HSTS header
-skarox.com: could not connect to host
-skarox.ee: could not connect to host
-skarox.eu: could not connect to host
-skarox.net: could not connect to host
-skarox.ru: could not connect to host
-skates.guru: did not receive HSTS header
-skena.lt: did not receive HSTS header
-skepneklaw.com: could not connect to host
-sketchmyroom.com: did not receive HSTS header
-sketchywebsite.net: did not receive HSTS header
-ski-insurance.com.au: did not receive HSTS header
-skia.org: did not receive HSTS header
-skidstresser.com: could not connect to host
-skilldetector.com: could not connect to host
-skilletfood.com: did not receive HSTS header
-skillout.org: did not receive HSTS header
-skillproxy.com: could not connect to host
-skillproxy.net: could not connect to host
-skillproxy.org: could not connect to host
-skills2serve.org: could not connect to host
-skillseo.com: could not connect to host
-skimming.net: did not receive HSTS header
-skinandglamour.com: did not receive HSTS header
-skinbet.co: could not connect to host
-skincases.co: could not connect to host
-skincontracts.co: could not connect to host
-skingame.co: could not connect to host
-skingames.co: could not connect to host
-skinmarket.co: could not connect to host
-skinpwrd.com: could not connect to host
-skins.net: could not connect to host
-skinstyleglobal.com: did not receive HSTS header
-skipton.io: could not connect to host
-skischuleulm.de: did not receive HSTS header
-skk.io: did not receive HSTS header
-skks.cz: did not receive HSTS header
-sklepsamsung.pl: did not receive HSTS header
-sklepwielobranzowymd.com: could not connect to host
-skocia.net: did not receive HSTS header
-skoda-clever-lead.de: could not connect to host
-skoda-im-dialog.de: could not connect to host
-skoda-nurdiebesten.de: did not receive HSTS header
-skoda-service-team-cup.de: did not receive HSTS header
-skogsbruket.fi: did not receive HSTS header
-skogskultur.fi: did not receive HSTS header
-skoilly.cn: did not receive HSTS header
-skoleniphp.cz: did not receive HSTS header
-skolni-system.eu: could not connect to host
-skolnieks.lv: could not connect to host
-skolniweby.cz: could not connect to host
-skomski.org: did not receive HSTS header
-skontorp-enterprise.no: did not receive HSTS header
-skpdev.net: could not connect to host
-skrimix.tk: could not connect to host
-skryptersi.pl: did not receive HSTS header
-sksdrivingschool.com.au: could not connect to host
-skullhouse.nyc: could not connect to host
-skullnet.co.uk: could not connect to host
-sky-aroma.com: could not connect to host
-sky-universe.net: could not connect to host
-skyasker.cn: could not connect to host
-skyasker.com: could not connect to host
-skyblockrebellion.com: could not connect to host
-skybloom.io: could not connect to host
-skybound.link: did not receive HSTS header
-skyeeverest.tk: could not connect to host
-skyflix.me: could not connect to host
-skyline.link: could not connect to host
-skyline.tw: did not receive HSTS header
-skylocker.net: could not connect to host
-skylocker.nl: could not connect to host
-skyminds.net: did not receive HSTS header
-skyn3t.in: did not receive HSTS header
-skynet800.goip.de: did not receive HSTS header
-skypeassets.com: could not connect to host
-skypoker.com: did not receive HSTS header
-skyris.co: did not receive HSTS header
-skyrunners.ch: could not connect to host
-skyvault.io: could not connect to host
-skyveo.ml: could not connect to host
-skyway.capital: did not receive HSTS header
-skyworldserver.ddns.net: could not connect to host
-sl-informatique.fr: did not receive HSTS header
-sl-informatique.ovh: could not connect to host
-sl0.us: could not connect to host
-sl1pkn07.wtf: max-age too low: 2592000
-sl899.com: could not connect to host
-sl998.com: could not connect to host
-slalix.xyz: could not connect to host
-slaps.be: could not connect to host
-slash-dev.de: could not connect to host
-slash64.co.uk: could not connect to host
-slash64.com: did not receive HSTS header
-slash64.uk: could not connect to host
-slashand.co: could not connect to host
-slashcrypto.org: could not connect to host
-slashdesign.it: did not receive HSTS header
-slashem.me: did not receive HSTS header
-slatemc.fun: could not connect to host
-slatko.io: could not connect to host
-slattery.co: did not receive HSTS header
-slauber.de: did not receive HSTS header
-slaws.io: could not connect to host
-slc.gd: did not receive HSTS header
-sleep10.com: could not connect to host
-sleeping.town: did not receive HSTS header
-sleepingbaghub.com: did not receive HSTS header
-sleepstar.com.mt: did not receive HSTS header
-slever.cz: could not connect to host
-sliceone.com: could not connect to host
-slicketl.com: did not receive HSTS header
-slicss.com: could not connect to host
-slides.zone: could not connect to host
-slidesvideo.com: did not receive HSTS header
-slightfuture.click: could not connect to host
-slightfuture.com: did not receive HSTS header
-slik.ai: did not receive HSTS header
-slimk1nd.nl: could not connect to host
-slimmerbouwen.be: did not receive HSTS header
-slingo-sta.com: did not receive HSTS header
-slingo.com: did not receive HSTS header
-slingooriginals.com: did not receive HSTS header
-slip-gaming.tk: could not connect to host
-sliteapp.com: did not receive HSTS header
-slix.io: could not connect to host
-sln.cloud: could not connect to host
-slope.haus: could not connect to host
-slopeedge.com: did not receive HSTS header
-slotboss.co.uk: did not receive HSTS header
-slovakiana.sk: did not receive HSTS header
-slovoice.org: could not connect to host
-slowfood.es: did not receive HSTS header
-slowsociety.org: could not connect to host
-slrd-isperih.com: could not connect to host
-slse.ca: max-age too low: 0
-sluitkampzeist.nl: could not connect to host
-sluplift.com: could not connect to host
-slycurity.de: could not connect to host
-slysend.com: did not receive HSTS header
-sm2016.ch: could not connect to host
-smaaker.com: did not receive HSTS header
-smablo.com: could not connect to host
-smadav.ml: could not connect to host
-smallcdn.rocks: could not connect to host
-smallchat.nl: could not connect to host
-smalldogbreeds.dog: could not connect to host
-smalldogbreeds.net: did not receive HSTS header
-smallpath.me: could not connect to host
-smallshopit.com: could not connect to host
-smart-cloud.store: could not connect to host
-smart-mirror.de: did not receive HSTS header
-smart-ov.nl: could not connect to host
-smart-shapes.co.uk: could not connect to host
-smartass.space: could not connect to host
-smartbiz.vn: could not connect to host
-smartboleta.com: did not receive HSTS header
-smartbuyelectric.com: could not connect to host
-smartcoin.com.br: could not connect to host
-smarterskies.gov: could not connect to host
-smartest-trading.com: could not connect to host
-smartgridsecurity.org: could not connect to host
-smarthomedna.com: did not receive HSTS header
-smartietop.com: could not connect to host
-smartit.pro: could not connect to host
-smartlend.se: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-smartlybuy.com: could not connect to host
-smartmarketingcoaching.com: did not receive HSTS header
-smartmompicks.com: did not receive HSTS header
-smartofficesandsmarthomes.com: did not receive HSTS header
-smartofficeusa.com: did not receive HSTS header
-smartpass.government.ae: did not receive HSTS header
-smartphone.continental.com: could not connect to host
-smartrade.tech: did not receive HSTS header
-smartrak.co.nz: did not receive HSTS header
-smartviewing.com: did not receive HSTS header
-smartvita.com: did not receive HSTS header
-smartwank.com: could not connect to host
-smash-gg.club: could not connect to host
-smbeermen.tk: could not connect to host
-smcasino.net: could not connect to host
-smcasino.org: could not connect to host
-smcbox.com: could not connect to host
-smdev.fr: could not connect to host
-smet.us: could not connect to host
-smi-a.me: could not connect to host
-smictecniservi.com: could not connect to host
-smileawei.com: could not connect to host
-smiledirectsales.com: could not connect to host
-smileserver.com: could not connect to host
-smimea.com: could not connect to host
-smirkingwhorefromhighgarden.pro: could not connect to host
-smit.ee: did not receive HSTS header
-smith.is: could not connect to host
-smithchow.com: could not connect to host
-smithcountytxtaxrates.gov: could not connect to host
-smithings.com: could not connect to host
-smittix.co.uk: did not receive HSTS header
-smitug.pw: could not connect to host
-smkn1lengkong.sch.id: did not receive HSTS header
-smksi2.com: could not connect to host
-smksultanismail2.com: could not connect to host
-sml.lc: could not connect to host
-smmcab.ru: could not connect to host
-smmcab.website: could not connect to host
-smmlaba.io: could not connect to host
-smokingblendoils.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-smoothics.at: could not connect to host
-smoothics.com: could not connect to host
-smoothics.eu: could not connect to host
-smoothics.mobi: could not connect to host
-smoothics.net: could not connect to host
-smorgasblog.ie: could not connect to host
-smove.sg: did not receive HSTS header
-smow.com: did not receive HSTS header
-smow.de: did not receive HSTS header
-smplix.com: could not connect to host
-smplr.uk: could not connect to host
-smries.com: could not connect to host
-sms1.ro: could not connect to host
-smsben.cn: could not connect to host
-smsben.com: could not connect to host
-smsben.net: could not connect to host
-smsg-dev.ch: could not connect to host
-smskeywords.co.uk: could not connect to host
-smspodmena.ru: could not connect to host
-smtp.bz: did not receive HSTS header
-smtpdev.com: could not connect to host
-smtvonline.com: did not receive HSTS header
-smuhelper.cn: could not connect to host
-smusg.com: did not receive HSTS header
-smutba.se: did not receive HSTS header
-smys.uk: could not connect to host
-snabbit-support.se: could not connect to host
-snafarms.com: did not receive HSTS header
-snailing.org: could not connect to host
-snake.dog: could not connect to host
-snakehosting.dk: did not receive HSTS header
-snapappts.com: could not connect to host
-snapchat.com: did not receive HSTS header
-snapfinance.com: did not receive HSTS header
-snapnudes.co: could not connect to host
-snaptier.co: could not connect to host
-snaptools.io: could not connect to host
-snapworks.net: did not receive HSTS header
-snarf.in: could not connect to host
-snazzie.nl: could not connect to host
-sneaker.date: could not connect to host
-sneakers88.it: could not connect to host
-sneakypaw.com: could not connect to host
-sneed.company: could not connect to host
-sneeuwhoogtes.eu: could not connect to host
-sneezry.com: did not receive HSTS header
-snekchat.moe: could not connect to host
-snelwerk.be: did not receive HSTS header
-sng.my: could not connect to host
-snic.website: could not connect to host
-sniderman.pro: could not connect to host
-sniderman.xyz: could not connect to host
-snight.co: could not connect to host
-snip.city: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-snip.host: could not connect to host
-snip.run: could not connect to host
-snippet.host: could not connect to host
-snod.land: did not receive HSTS header
-snopyta.com: could not connect to host
-snoqualmiefiber.org: could not connect to host
-snoringhq.com: did not receive HSTS header
-snovey.com: did not receive HSTS header
-snow-online.de: could not connect to host
-snowalerts.eu: could not connect to host
-snowdy.eu: could not connect to host
-snowdy.link: could not connect to host
-snowsubs.moe: could not connect to host
-snowyluma.com: could not connect to host
-snowyluma.me: could not connect to host
-snughealth.org.uk: did not receive HSTS header
-snus123.com: did not receive HSTS header
-so-comm.fr: did not receive HSTS header
-so-healthy.co.uk: did not receive HSTS header
-sobabox.ru: could not connect to host
-sobeelectronics.com: could not connect to host
-sobelift.com: could not connect to host
-sobinski.pl: did not receive HSTS header
-soboleva-pr.com.ua: could not connect to host
-soccergif.com: could not connect to host
-soccorso-stradale.org: could not connect to host
-soci.ml: could not connect to host
-social-journey.com: could not connect to host
-social-media-strategy.org.uk: could not connect to host
-socialbillboard.com: could not connect to host
-socialcs.xyz: could not connect to host
-socialdj.de: did not receive HSTS header
-socialfacecook.com: did not receive HSTS header
-socialgrowing.cl: did not receive HSTS header
-socialhead.io: did not receive HSTS header
-socialhub.com: did not receive HSTS header
-socialmedia.ro: did not receive HSTS header
-socialprize.com: could not connect to host
-socialspirit.com.br: did not receive HSTS header
-socialstrata.com: did not receive HSTS header
-socialtraderpartner.com: could not connect to host
-socialweblearning.com: did not receive HSTS header
-socialworkout.com: could not connect to host
-socialworkout.net: could not connect to host
-socialworkout.org: could not connect to host
-socialworkout.tv: could not connect to host
-socketize.com: could not connect to host
-sockeye.cc: could not connect to host
-socomponents.co.uk: could not connect to host
-sodacore.com: could not connect to host
-sodamakerclub.com: did not receive HSTS header
-sodiao.cc: could not connect to host
-sofigeleiascaseiras.com.br: did not receive HSTS header
-sofort.com: did not receive HSTS header
-sofortueberweisung.de: did not receive HSTS header
-softart.club: did not receive HSTS header
-softballsavings.com: did not receive HSTS header
-softbebe.com: did not receive HSTS header
-softclean.pt: did not receive HSTS header
-softonic.com.br: did not receive HSTS header
-softrobot.se: could not connect to host
-softsecmatheodexelle.be: could not connect to host
-software.rocks: could not connect to host
-softwarebetrieb.de: did not receive HSTS header
-softwarebeveiligingtestdomein.be: could not connect to host
-softwaregeek.nl: did not receive HSTS header
-softwarehardenberg.nl: could not connect to host
-softwaresen.com: did not receive HSTS header
-softwoods.com.au: did not receive HSTS header
-sogeek.me: could not connect to host
-sogravatas.net.br: could not connect to host
-sohncloud.my-router.de: could not connect to host
-soinvett.com: could not connect to host
-sojingle.net: did not receive HSTS header
-soju.fi: did not receive HSTS header
-sokche.com: did not receive HSTS header
-sokolka.tv: did not receive HSTS header
-sol.works: could not connect to host
-solarcom.com.br: could not connect to host
-solariiknight.org: did not receive HSTS header
-solariilacheie.ro: could not connect to host
-solarium.gov: could not connect to host
-solartrackerapp.com: could not connect to host
-soldbygold.net: did not receive HSTS header
-soldecom.com: did not receive HSTS header
-sole-software.de: did not receive HSTS header
-sole.gmbh: did not receive HSTS header
-solentes.com.br: could not connect to host
-solesoftware.de: did not receive HSTS header
-solidfuelappliancespares.co.uk: did not receive HSTS header
-solidimage.com.br: could not connect to host
-solidtuesday.com: could not connect to host
-solidus.systems: did not receive HSTS header
-solidwebnetworks.co.uk: did not receive HSTS header
-solinter.com.br: did not receive HSTS header
-solisrey.es: could not connect to host
-soljem.com: did not receive HSTS header
-soll-i.ch: did not receive HSTS header
-sollevix.ovh: did not receive HSTS header
-solmek.com: did not receive HSTS header
-solos.im: could not connect to host
-soloshu.co: could not connect to host
-solosmusic.xyz: could not connect to host
-solsystems.ru: did not receive HSTS header
-soltekla.com: did not receive HSTS header
-solunci-loznica.tk: could not connect to host
-solupredperu.com: did not receive HSTS header
-solus-project.com: could not connect to host
-solutionhoisthire.com.au: did not receive HSTS header
-solutions-teknik.com: did not receive HSTS header
-solutive.fi: could not connect to host
-solve-it.se: did not receive HSTS header
-solve.co.uk: did not receive HSTS header
-solymar.co: could not connect to host
-somcase.com.br: did not receive HSTS header
-some.rip: did not receive HSTS header
-somebodycares.org: did not receive HSTS header
-someserver.cf: could not connect to host
-someshit.xyz: could not connect to host
-something-else.cf: could not connect to host
-somethingnew.xyz: could not connect to host
-somethingsimilar.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-somosabc.com: could not connect to host
-somosnoticia.com.br: max-age too low: 0
-somoyorkies.com: could not connect to host
-somp-rp.su: could not connect to host
-sonafe.info: could not connect to host
-sonerezh.bzh: did not receive HSTS header
-songluck.com: could not connect to host
-songsmp3.co: could not connect to host
-songsmp3.info: could not connect to host
-songsmp3.io: could not connect to host
-songsmp3.live: did not receive HSTS header
-songsmp3.me: could not connect to host
-songsmp3.net: did not receive HSTS header
-songsthatsavedyourlife.com: did not receive HSTS header
-songzhuolun.com: could not connect to host
-soniadoras.pe: did not receive HSTS header
-soniafauville.com: could not connect to host
-sonialive.com: did not receive HSTS header
-sonic.network: could not connect to host
-sonja-daniels.com: could not connect to host
-sonja-kowa.de: could not connect to host
-sonoecoracao.com.br: could not connect to host
-sony-psvita.ru: could not connect to host
-sonyforum.no: did not receive HSTS header
-sonyunlock.nu: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-soobi.org: did not receive HSTS header
-soodwatthanaphon.net: could not connect to host
-soondy.com: could not connect to host
-soothemobilemassage.com.au: did not receive HSTS header
-soph.us: could not connect to host
-sopher.io: did not receive HSTS header
-sophieandtrey.com: did not receive HSTS header
-soply.com: did not receive HSTS header
-soporte.cc: did not receive HSTS header
-sopra.tk: could not connect to host
-soptq.me: did not receive HSTS header
-soquee.net: could not connect to host
-soraiaschneider.com.br: could not connect to host
-sorellecollection.com.au: could not connect to host
-soren.xyz: could not connect to host
-sorenam.com: did not receive HSTS header
-sorensen-online.com: could not connect to host
-sorever.online: did not receive HSTS header
-sorex.photo: did not receive HSTS header
-sorinmuntean.ro: did not receive HSTS header
-sortaweird.net: could not connect to host
-sortingwizard.com: could not connect to host
-soruly.com: did not receive HSTS header
-sorx.tech: could not connect to host
-sos.de: did not receive HSTS header
-sosaka.ml: could not connect to host
-sosaka.tk: could not connect to host
-sosecu.red: could not connect to host
-sosesh.shop: could not connect to host
-sosiolog.com: could not connect to host
-sospromotions.com.au: did not receive HSTS header
-sot-te.ch: did not receive HSTS header
-sotai.tk: could not connect to host
-sotavasara.net: did not receive HSTS header
-sotayhoctap.com: did not receive HSTS header
-sotiran.com: did not receive HSTS header
-sotor.de: did not receive HSTS header
-sotthewes.nl: did not receive HSTS header
-sou-co.jp: did not receive HSTS header
-soubriquet.org: could not connect to host
-soucorneteiro.com.br: could not connect to host
-sougi-review.top: did not receive HSTS header
-soulcraft-cracked.de: could not connect to host
-soulcraft.bz: could not connect to host
-soulema.com: could not connect to host
-soulfulglamour.uk: could not connect to host
-souly.cc: could not connect to host
-soundbytemedia.com: did not receive HSTS header
-soundedj.com.br: could not connect to host
-soundhunter.xyz: could not connect to host
-soundonsound.com: did not receive HSTS header
-soundorabilia.com: did not receive HSTS header
-soundsecurity.io: could not connect to host
-souqtajmeel.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-souravsaha.com: max-age too low: 0
-sourcecode.love: could not connect to host
-sourcelair.com: did not receive HSTS header
-sourcely.net: could not connect to host
-southcoastkitesurf.co.uk: did not receive HSTS header
-southcoastswords.com: did not receive HSTS header
-southernjamusa.com: did not receive HSTS header
-southernlights.cf: could not connect to host
-southernlights.gq: could not connect to host
-southernstructuralsolutions.com: did not receive HSTS header
-southgale.condos: could not connect to host
-southmelbourne.apartments: could not connect to host
-southside-crew.club: could not connect to host
-southsidebargaincenter.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-southwaymotors.com: did not receive HSTS header
-southwesteventhire.co.uk: did not receive HSTS header
-southwindsor-ct.gov: did not receive HSTS header
-southworcestershiregpservices.co.uk: could not connect to host
-soutien-naissance.com: could not connect to host
-souvik.me: did not receive HSTS header
-souyar.de: could not connect to host
-souyar.net: could not connect to host
-souyar.us: could not connect to host
-souyidai.com: could not connect to host
-soved.eu: did not receive HSTS header
-sovereignpcs.com: could not connect to host
-sovereignshare.com: could not connect to host
-sown.dyndns.org: could not connect to host
-sowncloud.de: could not connect to host
-soz6.com: did not receive HSTS header
-sp.rw: could not connect to host
-space-y.cf: could not connect to host
-spacedust.xyz: could not connect to host
-spacefish.biz: did not receive HSTS header
-spacehq.org: could not connect to host
-spacelabs.io: could not connect to host
-spacemo.com: did not receive HSTS header
-spaceunique.de: could not connect to host
-spacewallpaperhd.com: could not connect to host
-spacountryexplorer.org.au: could not connect to host
-spaggel.nl: did not receive HSTS header
-spakhmer.com: did not receive HSTS header
-spam.lol: could not connect to host
-spamloco.net: did not receive HSTS header
-spanch.cf: could not connect to host
-spanch.ga: could not connect to host
-spanch.gq: could not connect to host
-spanch.ml: could not connect to host
-spanch.tk: could not connect to host
-spanchelele.cf: could not connect to host
-spanchelele.ga: could not connect to host
-spanchelele.gq: could not connect to host
-spanchelele.ml: could not connect to host
-spanchelele.tk: could not connect to host
-spanda.io: could not connect to host
-spangehlassociates.com: did not receive HSTS header
-spanien.guide: could not connect to host
-spar-ni.co.uk: did not receive HSTS header
-spark.team: could not connect to host
-sparkbase.cn: could not connect to host
-sparkl.fm: could not connect to host
-sparklatvia.lv: could not connect to host
-sparklingsparklers.com: did not receive HSTS header
-sparkresearch.net: could not connect to host
-sparkwood.org: could not connect to host
-sparsa.army: could not connect to host
-sparta-solutions.de: could not connect to host
-sparta-trade.com: did not receive HSTS header
-spartaconsulting.fi: did not receive HSTS header
-spartantheatre.org: could not connect to host
-sparxsolutions.be: did not receive HSTS header
-spatzenwerkstatt.de: could not connect to host
-spauted.com: could not connect to host
-spawn.cz: could not connect to host
-spcx.eu: did not receive HSTS header
-spd-pulheim-mitte.de: did not receive HSTS header
-spdysync.com: could not connect to host
-speakingdiligence.com: did not receive HSTS header
-specialedesigns.com: could not connect to host
-specialistnow.com.au: did not receive HSTS header
-specialized-hosting.eu: could not connect to host
-spectreattack.com: did not receive HSTS header
-spectroom.space: did not receive HSTS header
-spectrosoftware.de: could not connect to host
-speculor.net: could not connect to host
-spedition-transport-umzug.de: could not connect to host
-spedizioni.roma.it: could not connect to host
-spedplus.com.br: did not receive HSTS header
-speed-mailer.com: could not connect to host
-speedboost.de: did not receive HSTS header
-speedcounter.net: could not connect to host
-speeder.cf: could not connect to host
-speeders.cf: could not connect to host
-speeds.vip: could not connect to host
-speedway.com.pl: did not receive HSTS header
-speedyprep.com: did not receive HSTS header
-speidel.com.tr: did not receive HSTS header
-spencerbaer.com: could not connect to host
-spendwise.com.au: could not connect to host
-sperec.fr: did not receive HSTS header
-sperohub.com: could not connect to host
-sperohub.io: could not connect to host
-sperohub.lt: could not connect to host
-sphereblur.com: could not connect to host
-spherenix.org: could not connect to host
-sphinx.network: could not connect to host
-spicydog.tk: could not connect to host
-spicywombat.com: could not connect to host
-spidermail.tk: could not connect to host
-spidernet.tk: could not connect to host
-spiegel21.de: did not receive HSTS header
-spiegels.nl: did not receive HSTS header
-spiel-teppich.de: could not connect to host
-spielcasinos.com: did not receive HSTS header
-spiellawine.de: could not connect to host
-spikeykc.me: could not connect to host
-spilled.ink: did not receive HSTS header
-spillersfamily.net: could not connect to host
-spilsbury.io: could not connect to host
-spinalo.se: did not receive HSTS header
-spindle.com.ph: could not connect to host
-spindrift.com: did not receive HSTS header
-spineandscoliosis.com: did not receive HSTS header
-spinner.dnshome.de: could not connect to host
-spinor.im: could not connect to host
-spira-group.eu: could not connect to host
-spiralschneiderkaufen.de: could not connect to host
-spirit-dev.net: max-age too low: 0
-spirit-of-sahara.de: did not receive HSTS header
-spiritbionic.ro: could not connect to host
-spiritfanfics.com: did not receive HSTS header
-spiritualregression.com.au: did not receive HSTS header
-spisoggrin.dk: could not connect to host
-spitefultowel.com: did not receive HSTS header
-spitfireuav.com: could not connect to host
-spititout.it: could not connect to host
-split.is: could not connect to host
-splunk.zone: could not connect to host
-spmswiss.com: did not receive HSTS header
-spoketwist.com: did not receive HSTS header
-spokonline.com: could not connect to host
-spon.cz: did not receive HSTS header
-sponsorowani.pl: could not connect to host
-sponsortobias.com: could not connect to host
-spontex.org: did not receive HSTS header
-spookyinternet.com: could not connect to host
-sporara.com: could not connect to host
-sportakrobatik.at: could not connect to host
-sportchirp-internal.azurewebsites.net: could not connect to host
-sportflash.info: did not receive HSTS header
-sporthit.ru: could not connect to host
-sportifik.com: did not receive HSTS header
-sportingoods.com.br: could not connect to host
-sportressofblogitude.com: did not receive HSTS header
-sportscollection.com.br: could not connect to host
-sportsmanadvisor.com: could not connect to host
-sportsmole.co.uk: did not receive HSTS header
-spot-events.com: could not connect to host
-spoters.co: could not connect to host
-spotifyripper.tk: could not connect to host
-spotlightsrule.com: could not connect to host
-spotteredu.com: did not receive HSTS header
-spotterpix.de: did not receive HSTS header
-spotzlight.tk: did not receive HSTS header
-spr.id.au: could not connect to host
-sprayforce.com: did not receive HSTS header
-spreadsheets.google.com: did not receive HSTS header (error ignored - included regardless)
-spreadthenews.eu: could not connect to host
-spree.co.za: did not receive HSTS header
-spresso.me: did not receive HSTS header
-sprigings.com: did not receive HSTS header
-springreizen.nl: did not receive HSTS header
-springsoffthegrid.com: could not connect to host
-sprinklermanohio.com: did not receive HSTS header
-sprint.ml: did not receive HSTS header
-sprk.fitness: could not connect to host
-sproing.ca: max-age too low: 0
-sproutconnections.com: could not connect to host
-sprueche-zum-valentinstag.de: could not connect to host
-sprueche-zur-geburt.info: could not connect to host
-sprueche-zur-hochzeit.de: could not connect to host
-sprueche-zur-konfirmation.de: could not connect to host
-sptr.blog: could not connect to host
-spumanti.dk: did not receive HSTS header
-sputnik1net.org: could not connect to host
-spykedigital.com: could not connect to host
-spyroszarzonis.com: did not receive HSTS header
-sqetsa.com: did not receive HSTS header
-sqkaccountancy.co.uk: did not receive HSTS header
-squaddraft.com: did not receive HSTS header
-squadlinx.com: did not receive HSTS header
-square.com: max-age too low: 604800
-square.gs: could not connect to host
-squarelab.it: could not connect to host
-squareonebgc.com.ph: could not connect to host
-squareup.com: max-age too low: 604800
-squatldf.org: could not connect to host
-squawk.cc: could not connect to host
-squeakie.club: could not connect to host
-squeakql.online: did not receive HSTS header
-squids.space: could not connect to host
-squirtlesbians.net: could not connect to host
-sqzryang.com: could not connect to host
-sr-cs.net: did not receive HSTS header
-sranje.rocks: could not connect to host
-srcc.fr: could not connect to host
-sreeharis.tk: could not connect to host
-srevilak.net: did not receive HSTS header
-sritest.io: could not connect to host
-srmaximo.com: could not connect to host
-srna.sk: did not receive HSTS header
-srochnyj-zajm.ga: could not connect to host
-srolim.com: did not receive HSTS header
-srpdb.com: did not receive HSTS header
-srrdb.com: did not receive HSTS header
-srrr.ca: could not connect to host
-srun.in: could not connect to host
-srv.solutions: did not receive HSTS header
-srvc.io: could not connect to host
-srvonfire.com: could not connect to host
-ss-free.net: could not connect to host
-ss-x.ru: did not receive HSTS header
-ss.wtf: could not connect to host
-ss5197.co: could not connect to host
-ss6729.co: could not connect to host
-ss6729.com: did not receive HSTS header
-ss6957.co: could not connect to host
-ss9297.co: could not connect to host
-ss9397.com: could not connect to host
-ss9721.com: could not connect to host
-ss9728.co: could not connect to host
-ssc8809.com: max-age too low: 0
-sscd.no: could not connect to host
-ssco.xyz: could not connect to host
-ssconn.com: could not connect to host
-ssdservers.co.uk: did not receive HSTS header
-ssh-keys.online: did not receive HSTS header
-ssh.nu: did not receive HSTS header
-sshd.site: could not connect to host
-sshool.at: could not connect to host
-sshx.top: could not connect to host
-ssl.panoramio.com: did not receive HSTS header
-ssl.rip: could not connect to host
-ssl888.com: could not connect to host
-sslcertificateshop.com: did not receive HSTS header
-ssld.de: could not connect to host
-ssldev.net: could not connect to host
-sslzilla.de: did not receive HSTS header
-ssmato.me: could not connect to host
-ssn1.ru: could not connect to host
-ssnet.vip: could not connect to host
-sso.to: could not connect to host
-sspanda.com: did not receive HSTS header
-ssrfq.com: could not connect to host
-ssrjiedian.com: did not receive HSTS header
-ssrvpn.tech: could not connect to host
-sss3s.com: could not connect to host
-sstewartgallus.com: did not receive HSTS header
-ssuc.net: could not connect to host
-ssworld.ga: could not connect to host
-st-li.com: could not connect to host
-staack.com: could not connect to host
-stabletoken.com: could not connect to host
-staceyhankeinc.com: did not receive HSTS header
-stackfiles.io: could not connect to host
-stackhub.cc: could not connect to host
-stacklasvegas.com: could not connect to host
-stadionmanager.com: could not connect to host
-stadjerspasonline.nl: could not connect to host
-stadt-apotheke-muensingen.de: did not receive HSTS header
-stadtgartenla.com: could not connect to host
-stadtpapa.de: could not connect to host
-staffjoy.com: did not receive HSTS header
-staffjoystaging.com: did not receive HSTS header
-stagend.com: did not receive HSTS header
-stagingjobshq.com: did not receive HSTS header
-stahl.xyz: could not connect to host
-stahlfeuer-ofenwerkstatt.de: did not receive HSTS header
-stahlfors.com: could not connect to host
-stainternational.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-stakeshare.org: could not connect to host
-stakestrategy.com: could not connect to host
-stalkerhispano.com: max-age too low: 0
-stalkthe.net: could not connect to host
-stall-zur-linde.de: did not receive HSTS header
-stalschermer.nl: could not connect to host
-stamboommuller.nl: did not receive HSTS header
-stamboomvanderwal.nl: did not receive HSTS header
-stamonicatourandtravel.com: could not connect to host
-stampederadon.com: could not connect to host
-stampsbar.co.uk: did not receive HSTS header
-stanandjerre.org: could not connect to host
-standardssuck.org: did not receive HSTS header
-standingmist.com: did not receive HSTS header
-standuppaddlesports.com.au: did not receive HSTS header
-stang.moe: did not receive HSTS header
-stannahtrapliften.nl: did not receive HSTS header
-star-one.co.uk: could not connect to host
-star-stuff.de: did not receive HSTS header
-star.do: did not receive HSTS header
-starandshield.com: did not receive HSTS header
-starapple.nl: did not receive HSTS header
-starcafe.me: could not connect to host
-stardeeps.net: max-age too low: 0
-stardust-entertainments.co.uk: could not connect to host
-starease.com: could not connect to host
-starease.net: could not connect to host
-starfeeling.net: could not connect to host
-starfixreparaciones.com: could not connect to host
-starfm.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-stargarder-jungs.de: did not receive HSTS header
-stargatedesign.com: did not receive HSTS header
-stargatepartners.com: did not receive HSTS header
-starinvestors.in: could not connect to host
-starking.net.cn: could not connect to host
-starmusic.ga: could not connect to host
-starphotoboothsni.co.uk: could not connect to host
-starplatinum.jp: could not connect to host
-starport.com.au: did not receive HSTS header
-starquake.nl: did not receive HSTS header
-starretest.nl: could not connect to host
-starsam80.net: could not connect to host
-starsbattle.net: could not connect to host
-starsing.bid: could not connect to host
-starteesforsale.co.za: did not receive HSTS header
-startergen.com: did not receive HSTS header
-startloop.org: could not connect to host
-startsamenvitaal.nu: could not connect to host
-startstunter.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-startup.melbourne: could not connect to host
-startupgenius.org: did not receive HSTS header
-startuplevel.com: could not connect to host
-startuponcloud.com: max-age too low: 2678400
-startuppeople.co.uk: did not receive HSTS header
-startupum.ru: could not connect to host
-starwatches.eu: could not connect to host
-starwins.co.uk: could not connect to host
-stash.ai: did not receive HSTS header
-state-of-body-and-mind.com: could not connect to host
-state-sponsored-actors.net: could not connect to host
-statebuildinggroup.com: did not receive HSTS header
-statementinsertsforless.com: did not receive HSTS header
-stateofexception.io: could not connect to host
-statgram.me: could not connect to host
-static-assets.io: could not connect to host
-static.hosting: could not connect to host
-static.or.at: could not connect to host
-static.today: could not connect to host
-staticisnoise.com: could not connect to host
-staticline.de: did not receive HSTS header
-stationaryjourney.com: did not receive HSTS header
-stationatwillowgrove.com: did not receive HSTS header
-stationcharlie.com: did not receive HSTS header
-stationnementdenuit.ca: did not receive HSTS header
-status-sprueche.de: could not connect to host
-status.coffee: could not connect to host
-statusbot.io: could not connect to host
-statuschecks.net: could not connect to host
-stav.io: did not receive HSTS header
-stavebnice.net: could not connect to host
-staxflax.tk: could not connect to host
-stay.black: could not connect to host
-stayokhotelscdc-mailing.com: could not connect to host
-stb-strzyzewski.de: did not receive HSTS header
-stcomex.com: could not connect to host
-stdev.org: could not connect to host
-stdev.top: could not connect to host
-steakhaus-zumdorfbrunnen.de: did not receive HSTS header
-stealthpressurewashers.com: did not receive HSTS header
-steampunkrobot.com: did not receive HSTS header
-steamscore.info: could not connect to host
-steckel.cc: did not receive HSTS header
-stedbg.net: could not connect to host
-steelbea.ms: could not connect to host
-steelrhino.co: could not connect to host
-steem.io: did not receive HSTS header
-steenackers.be: did not receive HSTS header
-stefanovski.io: could not connect to host
-stefanweiser.de: did not receive HSTS header
-steffi-in-australien.com: could not connect to host
-stegmaier-immobilien.de: did not receive HSTS header
-steigerplank.com: did not receive HSTS header
-stellarvale.net: did not receive HSTS header
-stellen.ch: did not receive HSTS header
-stem.is: did not receive HSTS header
-stemapp.io: did not receive HSTS header
-stemsims.com: did not receive HSTS header
-stepbymestudios.co.uk: did not receive HSTS header
-stepbystep3d.com: did not receive HSTS header
-steph-autoecole.ch: did not receive HSTS header
-steph3n.me: could not connect to host
-stephanierxo.com: did not receive HSTS header
-stephanos.me: did not receive HSTS header
-stephenandburns.com: did not receive HSTS header
-stephenhorler.com.au: could not connect to host
-stephenjvoiceovers.com: did not receive HSTS header
-stephensolis.net: could not connect to host
-stephensolisrey.es: could not connect to host
-steplogictalent.com: could not connect to host
-steponedanceclub.uk: could not connect to host
-sterjoski.com: did not receive HSTS header
-sterlingheights.gov: could not connect to host
-sterlingleads.co.uk: did not receive HSTS header
-sterlitamak.tk: could not connect to host
-stetspa.it: could not connect to host
-steuerberater-essen-steele.com: could not connect to host
-steuerkanzlei-und-wirtschaftsberater-manke.de: could not connect to host
-steuerseminare-graf.de: did not receive HSTS header
-steve.kiwi: could not connect to host
-stevechekblain.win: could not connect to host
-stevemario.com: could not connect to host
-stevemason.tk: could not connect to host
-stevemonteyne.be: could not connect to host
-stevengoodpaster.com: could not connect to host
-stevenhumphrey.uk: did not receive HSTS header
-stevenkwan.me: could not connect to host
-stevenlepen.fr: did not receive HSTS header
-stevenroddis.com: did not receive HSTS header
-stevensheffey.me: could not connect to host
-stevensononthe.net: did not receive HSTS header
-steventruesdell.com: could not connect to host
-stevereedmp.co.uk: did not receive HSTS header
-stevezheng.tk: could not connect to host
-stewartremodelingadvantage.com: could not connect to host
-stge.uk: could not connect to host
-stgm.org: did not receive HSTS header
-sthelensoregon.gov: did not receive HSTS header
-stichtingscholierenvervoerzeeland.nl: could not connect to host
-stickerparadise.me: could not connect to host
-sticklerjs.org: could not connect to host
-stickmy.cn: could not connect to host
-stickswag.cf: could not connect to host
-stickswag.eu: could not connect to host
-stiebel.co.nz: did not receive HSTS header
-stiebel.com.au: did not receive HSTS header
-stiebelservice.com.au: did not receive HSTS header
-stiebelstore.com.au: could not connect to host
-stiens.de: did not receive HSTS header
-stiffordacademy.org.uk: did not receive HSTS header
-stig.io: did not receive HSTS header
-stiger.me: could not connect to host
-stigroom.com: could not connect to host
-stijncrevits.be: did not receive HSTS header
-stikkie.me: could not connect to host
-stilettomoda.com.br: could not connect to host
-stillblackhat.id: could not connect to host
-stillnessproject.com: did not receive HSTS header
-stillyarts.com: did not receive HSTS header
-stinkytrashhound.com: could not connect to host
-stirlingpoon.net: could not connect to host
-stirlingpoon.xyz: could not connect to host
-stitthappens.com: could not connect to host
-stjohnmiami.org: did not receive HSTS header
-stjohnsc.com: could not connect to host
-stkbn.com: could not connect to host
-stkeverneparishcouncil.org.uk: did not receive HSTS header
-stln.ml: could not connect to host
-stlucasmuseum.org: did not receive HSTS header
-stm32f4.jp: max-age too low: 0
-stmarkcharlotte.org: did not receive HSTS header
-stmaryextra.uk: could not connect to host
-stmbgr.com: could not connect to host
-stn.me.uk: did not receive HSTS header
-stnevis.ru: could not connect to host
-stnl.de: could not connect to host
-stockseyeserum.com: could not connect to host
-stocktout.info: could not connect to host
-stocktrade.de: could not connect to host
-stoeckidsign.de: did not receive HSTS header
-stoffe-monster.de: did not receive HSTS header
-stoffelen.nl: did not receive HSTS header
-stoianlawfirm.com: could not connect to host
-stoick.me: could not connect to host
-stolbart.com: could not connect to host
-stole-my.bike: did not receive HSTS header
-stole-my.tv: could not connect to host
-stolensheep.tk: could not connect to host
-stolkschepen.nl: did not receive HSTS header
-stomadental.com: did not receive HSTS header
-stonecutterscommunity.com: could not connect to host
-stonefusion.org.uk: could not connect to host
-stonehammerhead.org: could not connect to host
-stonemain.eu: could not connect to host
-stonemanbrasil.com.br: could not connect to host
-stonewuu.com: could not connect to host
-stopakwardhandshakes.org: could not connect to host
-stopbreakupnow.org: could not connect to host
-stopwoodfin.org: could not connect to host
-storbritannien.guide: could not connect to host
-store-host.com: did not receive HSTS header
-store10.de: could not connect to host
-storecove.com: did not receive HSTS header
-storeden.com: did not receive HSTS header
-storedieu.com: could not connect to host
-storeprice.co.uk: did not receive HSTS header
-storeprijs.nl: did not receive HSTS header
-storiesofhealth.org: could not connect to host
-stormhub.org: could not connect to host
-stormwatcher.org: could not connect to host
-stormyyd.com: max-age too low: 0
-storytea.top: could not connect to host
-stpatricksguild.com: did not receive HSTS header
-stqry.com: could not connect to host
-str0.at: did not receive HSTS header
-stralingsonzin.com: could not connect to host
-strangeplace.net: did not receive HSTS header
-strangescout.me: could not connect to host
-strasweb.fr: did not receive HSTS header
-strategos.co: could not connect to host
-stratuscloudconsulting.cn: did not receive HSTS header
-stratuscloudconsulting.co.uk: did not receive HSTS header
-stratuscloudconsulting.co.za: did not receive HSTS header
-stratuscloudconsulting.com: did not receive HSTS header
-stratuscloudconsulting.in: did not receive HSTS header
-stratuscloudconsulting.info: did not receive HSTS header
-stratuscloudconsulting.org: did not receive HSTS header
-strbt.de: could not connect to host
-strchr.com: did not receive HSTS header
-stream-ing.xyz: did not receive HSTS header
-stream.pub: could not connect to host
-streamblur.net: could not connect to host
-streamdesk.ca: did not receive HSTS header
-streamer.tips: did not receive HSTS header
-streamingeverywhere.com: could not connect to host
-streamingmagazin.de: could not connect to host
-streamlineautogroup.com: could not connect to host
-streampleasure.xyz: could not connect to host
-streams.dyndns.org: could not connect to host
-streamthemeeting.com: did not receive HSTS header
-streamzilla.com: did not receive HSTS header
-street-smart-home.de: did not receive HSTS header
-strehl.tk: could not connect to host
-streklhof.at: did not receive HSTS header
-strelitzia02.com: could not connect to host
-stressfreehousehold.com: could not connect to host
-stretchpc.com: could not connect to host
-strictlynormal.com: could not connect to host
-strictlysudo.com: could not connect to host
-strife.tk: could not connect to host
-strikers.cf: could not connect to host
-strila.me: could not connect to host
-stringbeanstudio.com: did not receive HSTS header
-striptizer.tk: could not connect to host
-strming.com: could not connect to host
-stroeercrm.de: could not connect to host
-strommenhome.com: did not receive HSTS header
-strongest-privacy.com: could not connect to host
-strongohio.gov: could not connect to host
-strongtowerpc.com: could not connect to host
-stroyka-iz-brusa.ru: could not connect to host
-strrl.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-structure.systems: could not connect to host
-struxureon.com: did not receive HSTS header
-stsolarenerji.com: could not connect to host
-stuartbaxter.co: could not connect to host
-stuarts.xyz: did not receive HSTS header
-stubbings.eu: could not connect to host
-stuco.co: could not connect to host
-student-scientist.org: did not receive HSTS header
-student.andover.edu: could not connect to host
-studentrdh.com: did not receive HSTS header
-studentresearcher.org: did not receive HSTS header
-studentrightsadvocate.org: could not connect to host
-studentskydenik.cz: could not connect to host
-studenttravel.cz: could not connect to host
-studer.su: could not connect to host
-studiemeter.nl: did not receive HSTS header
-studienportal.eu: could not connect to host
-studienservice.de: did not receive HSTS header
-studiereader.nl: did not receive HSTS header
-studinf.xyz: could not connect to host
-studio-panic.com: could not connect to host
-studio-webdigi.com: did not receive HSTS header
-studio44.fit: did not receive HSTS header
-studiocn.cn: could not connect to host
-studiodentisticomasi.com: did not receive HSTS header
-studiodentisticosanmarco.it: could not connect to host
-studiodoprazer.com.br: could not connect to host
-studiokilund.se: did not receive HSTS header
-studiotrece.com: did not receive HSTS header
-studiozelden.com: did not receive HSTS header
-studlan.no: max-age too low: 0
-studport.rv.ua: could not connect to host
-studyabroadstation.com: did not receive HSTS header
-studybay.com: did not receive HSTS header
-studydrive.net: did not receive HSTS header
-studyhub.cf: did not receive HSTS header
-studying-neet.com: could not connect to host
-studytale.com: could not connect to host
-stuffiwouldbuy.com: could not connect to host
-stugb.de: did not receive HSTS header
-stulda.cz: could not connect to host
-stumeta2018.de: could not connect to host
-stumf.si: could not connect to host
-stupidstatetricks.com: could not connect to host
-sturbi.de: did not receive HSTS header
-sturbock.me: did not receive HSTS header
-sturdio.com.br: could not connect to host
-sturge.co.uk: could not connect to host
-stutsmancounty.gov: did not receive HSTS header
-stuttgart-gablenberg.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-stuudium.cloud: could not connect to host
-stuudium.life: could not connect to host
-styel.io: did not receive HSTS header
-stylaq.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-stylebajumuslim.com: could not connect to host
-stylenda.com: could not connect to host
-styles.pm: could not connect to host
-stylle.me: could not connect to host
-styloeart.com: could not connect to host
-stylusgroup.pw: could not connect to host
-stytt.com: could not connect to host
-suaraangin.com: could not connect to host
-suave.io: did not receive HSTS header
-subarulegends.com: did not receive HSTS header
-subbing.work: could not connect to host
-subculture.live: did not receive HSTS header
-subeesu.com: could not connect to host
-subhacker.net: could not connect to host
-sublevel.net: did not receive HSTS header
-sublocale.com: did not receive HSTS header
-subrain.com: did not receive HSTS header
-subrosa.io: could not connect to host
-subrosr.com: could not connect to host
-subterfuge.io: did not receive HSTS header
-subtitle.rip: could not connect to host
-subtlelonging.com: did not receive HSTS header
-subwayz.de: did not receive HSTS header
-subzerolosangeles.com: did not receive HSTS header
-succ.in: could not connect to host
-successwithflora.com: could not connect to host
-succubus.network: could not connect to host
-succubus.xxx: could not connect to host
-suchprogrammer.net: did not receive HSTS header
-suchtv.pk: did not receive HSTS header
-sudo.im: could not connect to host
-sudo.org.au: did not receive HSTS header
-sudya-dredd.ru: did not receive HSTS header
-suempresa.cloud: could not connect to host
-sufarce.com: could not connect to host
-suffa.ac: did not receive HSTS header
-suffts.de: could not connect to host
-sugarandcloth.com: did not receive HSTS header
-sugarcitycon.com: could not connect to host
-sugarfactory.cz: did not receive HSTS header
-sugarhillsfarm.com: could not connect to host
-sugarmillmanagement.com: did not receive HSTS header
-sugarsweetorsour.com: did not receive HSTS header
-sugartownfarm.com: could not connect to host
-suite73.org: could not connect to host
-suited21.com: could not connect to host
-suitocracy.com: could not connect to host
-sujatadev.in: could not connect to host
-suko.pe: could not connect to host
-sukoyakapp.com: could not connect to host
-suksesbisnisonline.id: did not receive HSTS header
-sullenholland.nl: could not connect to host
-summa-prefis.com: could not connect to host
-summer.ga: could not connect to host
-summermc.cc: could not connect to host
-summershomes.com: did not receive HSTS header
-summitcountyboe.gov: did not receive HSTS header
-summitmasters.net: did not receive HSTS header
-sumoscout.de: did not receive HSTS header
-sumthing.com: could not connect to host
-sun-leo.co.jp: did not receive HSTS header
-sunboxstore.jp: did not receive HSTS header
-suncountrymarine.com: did not receive HSTS header
-sundanceusa.com: did not receive HSTS header
-suneilpatel.com: could not connect to host
-sunfeathers.net: could not connect to host
-sunfireshop.com.br: could not connect to host
-suniru.com: did not receive HSTS header
-sunlandsg.vn: did not receive HSTS header
-sunnistan.in: could not connect to host
-sunnyfruit.ru: could not connect to host
-sunnylyx.com: could not connect to host
-sunplay.host: could not connect to host
-sunriseafricarelief.com: could not connect to host
-sunset.im: could not connect to host
-sunshinepress.org: could not connect to host
-sunxchina.com: could not connect to host
-sunyanzi.tk: could not connect to host
-sunyataherb.com: could not connect to host
-suool.net: did not receive HSTS header
-suos.io: could not connect to host
-suourl.com: could not connect to host
-supastuds.com: did not receive HSTS header
-supcoronado.com: did not receive HSTS header
-supcro.com: could not connect to host
-super-demarche.com: did not receive HSTS header
-super-garciniaslim.com: could not connect to host
-super-o-blog.com: could not connect to host
-super-radiant-skin.com: could not connect to host
-super-ripped-power.com: could not connect to host
-super-slim-coffee.com: could not connect to host
-superbabysitting.ch: could not connect to host
-superbike.tw: could not connect to host
-superbowlkneel.com: could not connect to host
-superbshare.com: could not connect to host
-supercastlesmelbourne.com.au: could not connect to host
-supercastlessouthsydney.com.au: could not connect to host
-supercreepsvideo.com: did not receive HSTS header
-superdaddy.club: did not receive HSTS header
-supereight.net: did not receive HSTS header
-superiorfloridavacation.com: could not connect to host
-superklima.ro: did not receive HSTS header
-superlentes.com.br: could not connect to host
-supermae.pt: could not connect to host
-supernatural-fans.tk: could not connect to host
-supernovabrasil.com.br: did not receive HSTS header
-supernt.lt: did not receive HSTS header
-superpase.com: could not connect to host
-supersalescontest.nl: did not receive HSTS header
-supersandro.de: could not connect to host
-superschnappchen.de: could not connect to host
-supersec.es: could not connect to host
-supersecurefancydomain.com: could not connect to host
-superservers.ml: could not connect to host
-supersole.net: did not receive HSTS header
-supertechcrew.com: did not receive HSTS header
-supertramp-dafonseca.com: did not receive HSTS header
-superuser.fi: could not connect to host
-superwally.org: could not connect to host
-superway.es: could not connect to host
-supes.io: did not receive HSTS header
-supioka.com: could not connect to host
-supperclub.es: did not receive HSTS header
-supplementswatch.com: could not connect to host
-supplypartnersdecolombia.com: did not receive HSTS header
-support4server.de: could not connect to host
-supportfan.gov: could not connect to host
-supportme123.com: did not receive HSTS header
-suppwatch.com: could not connect to host
-suprlink.net: could not connect to host
-supweb.ovh: did not receive HSTS header
-surasak.io: could not connect to host
-surasak.net: could not connect to host
-surasak.org: could not connect to host
-surasak.xyz: could not connect to host
-suraya.online: could not connect to host
-suretone.co.za: could not connect to host
-surfeasy.com: did not receive HSTS header
-surfone-leucate.com: did not receive HSTS header
-surfpacific.com: max-age too low: 300
-surgenet.nl: could not connect to host
-surgiclinic.gr: did not receive HSTS header
-surkatty.org: did not receive HSTS header
-surmountsoft.com: did not receive HSTS header
-surrealcoder.com: could not connect to host
-suruifu.tk: could not connect to host
-survivalistplanet.com: could not connect to host
-survivalmonkey.com: could not connect to host
-susanbpilates.co: could not connect to host
-susastudentenjobs.de: did not receive HSTS header
-susconam.org: could not connect to host
-suseasky.com: could not connect to host
-sushifrick.de: could not connect to host
-sushikatze.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-sushiwereld.be: did not receive HSTS header
-suspiciousdarknet.xyz: could not connect to host
-sussexwebdesigns.com: could not connect to host
-sussexwebsites.info: could not connect to host
-sustc.ac.cn: could not connect to host
-suste.ch: could not connect to host
-susthx.com: could not connect to host
-suts.co.uk: did not receive HSTS header
-suttonbouncycastles.co.uk: could not connect to host
-suv4.net: could not connect to host
-suvidhaapay.com: could not connect to host
-suwalls.com: did not receive HSTS header
-suzukikazuki.com: could not connect to host
-sv-schody.cz: could not connect to host
-svadobkajuvi.sk: did not receive HSTS header
-svarovani.tk: could not connect to host
-svatba-frantovi.cz: could not connect to host
-svc-sitec.com: did not receive HSTS header
-svdreamcatcher.com: did not receive HSTS header
-sve-hosting.nl: could not connect to host
-svenbacia.me: could not connect to host
-svenskacasino.com: could not connect to host
-svenskaservern.se: could not connect to host
-svetdrzaku.cz: did not receive HSTS header
-svetjakonadlani.cz: did not receive HSTS header
-svetzitrka.cz: did not receive HSTS header
-svisa.nl: did not receive HSTS header
-sviz.pro: could not connect to host
-svj-stochovska.cz: could not connect to host
-svjvn.cz: could not connect to host
-sw-machines.io: could not connect to host
-swacp.com: could not connect to host
-swaggerdile.com: could not connect to host
-swagsocial.net: could not connect to host
-swaleacademiestrust.org.uk: did not receive HSTS header
-swallsoft.co.uk: could not connect to host
-swallsoft.com: could not connect to host
-swanseapartyhire.co.uk: could not connect to host
-swapadoodle.com: did not receive HSTS header
-swarovski-lov.cz: max-age too low: 0
-swdatlantico.pt: could not connect to host
-swe77.com: could not connect to host
-swe777.com: could not connect to host
-sweep.cards: did not receive HSTS header
-sweet-orr.com: did not receive HSTS header
-sweetlegs.jp: could not connect to host
-sweetstreats.ca: could not connect to host
-sweetvanilla.jp: could not connect to host
-swehack.org: could not connect to host
-swerve-media-testbed-03.co.uk: could not connect to host
-swfloshatraining.com: could not connect to host
-swift-devedge.de: could not connect to host
-swiftconf.com: did not receive HSTS header
-swiftcrypto.com: could not connect to host
-swiftpk.net: could not connect to host
-swiggy.com: did not receive HSTS header
-swimbee.nl: did not receive HSTS header
-swimming.ca: did not receive HSTS header
-swimmingpoolaccidentattorney.net: could not connect to host
-swimready.net: could not connect to host
-swingerclub.in: could not connect to host
-swiss-cyber-experts.ch: could not connect to host
-swisscannabis.club: could not connect to host
-swissentreprises.ch: could not connect to host
-swisstechtalks.ch: could not connect to host
-swisswebhelp.ch: could not connect to host
-swissxperts.ch: could not connect to host
-switch.moe: could not connect to host
-switchchargers.com: did not receive HSTS header
-swite.com: did not receive HSTS header
-swktestserver.tk: could not connect to host
-swmd5c.org: could not connect to host
-swoffordconstruction.com: did not receive HSTS header
-swordfighting.net: could not connect to host
-swqa.hu: could not connect to host
-swrelay.com: could not connect to host
-swrelay.net: could not connect to host
-swrelay.xyz: could not connect to host
-swu.party: could not connect to host
-swuosa.org: did not receive HSTS header
-sx3.no: could not connect to host
-sx6729.com: could not connect to host
-sx6957.com: could not connect to host
-sxbk.pw: did not receive HSTS header
-sxwancai18.com: max-age too low: 0
-syam.cc: could not connect to host
-syamutodon.xyz: could not connect to host
-syamuwatching.xyz: did not receive HSTS header
-sydgrabber.tk: could not connect to host
-syhost.at: did not receive HSTS header
-syhost.ch: did not receive HSTS header
-syhost.de: did not receive HSTS header
-sykl.us: could not connect to host
-sylvaincombe.net: did not receive HSTS header
-sylvangarden.org: could not connect to host
-sylvanorder.com: could not connect to host
-symbiose-bien-etre.ch: did not receive HSTS header
-symetria.io: did not receive HSTS header
-synack.uk: could not connect to host
-synackr.com: could not connect to host
-synackr.net: did not receive HSTS header
-synapticconsulting.co.uk: could not connect to host
-synaptickz.me: could not connect to host
-syncaddict.net: could not connect to host
-syncappate.com: could not connect to host
-syncclinicalstudy.com: could not connect to host
-syncer.jp: did not receive HSTS header
-syncflare.com: could not connect to host
-synchrocube.com: could not connect to host
-syncmylife.net: could not connect to host
-syncserve.net: did not receive HSTS header
-syneic.com: did not receive HSTS header
-synergisticsoccer.com: could not connect to host
-syno.gq: could not connect to host
-syntaxoff.com: could not connect to host
-syntheticmotoroil.org: did not receive HSTS header
-syntheticurinereview.com: did not receive HSTS header
-syobon.org: could not connect to host
-syoier.com: could not connect to host
-syracuseut.gov: did not receive HSTS header
-syriatalk.biz: could not connect to host
-syriatalk.org: did not receive HSTS header
-syrocon.ch: could not connect to host
-sys-tm.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-sys.tf: could not connect to host
-sysadmin.xyz: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-sysadminstory.com: could not connect to host
-sysdot.blog: did not receive HSTS header
-sysert.tv: could not connect to host
-sysgeek.cn: could not connect to host
-syslogic.io: could not connect to host
-syso.name: could not connect to host
-syspen.space: could not connect to host
-sysrq.tech: could not connect to host
-syss.de: did not receive HSTS header
-system-online.cz: could not connect to host
-system12.pl: could not connect to host
-system365.eu: did not receive HSTS header
-systemctl.io: could not connect to host
-systemd.me: could not connect to host
-systemonthego.com: could not connect to host
-systemreboot.net: did not receive HSTS header
-systemzeit.info: could not connect to host
-systoolbox.net: could not connect to host
-sysystems.cz: could not connect to host
-syt3.net: could not connect to host
-sytk.me: could not connect to host
-syukatsu-net.jp: did not receive HSTS header
-syunpay.cn: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-sywnthkrawft.tk: could not connect to host
-syy.hk: did not receive HSTS header
-szagun.net: did not receive HSTS header
-szaloneigly.com: did not receive HSTS header
-szaszm.tk: could not connect to host
-szc.me: could not connect to host
-szczot3k.pl: could not connect to host
-szepsegbennedrejlik.hu: could not connect to host
-szerbnyelvkonyv.hu: could not connect to host
-szerelem.love: could not connect to host
-szeretekvajpolni.hu: did not receive HSTS header
-szlovaknyelv.hu: could not connect to host
-szlovennyelv.hu: could not connect to host
-szongott.net: did not receive HSTS header
-szunia.com: could not connect to host
-t-complex.space: could not connect to host
-t-ken.xyz: could not connect to host
-t-point.eu: did not receive HSTS header
-t-tz.com: could not connect to host
-t0dd.eu: could not connect to host
-t2000headphones.com: could not connect to host
-t2000laserpointers.com: could not connect to host
-t23m-navi.jp: did not receive HSTS header
-t30365.com: could not connect to host
-t39.com: did not receive HSTS header
-t3dynamics.com: did not receive HSTS header
-t3rror.net: could not connect to host
-t4c-rebirth.com: could not connect to host
-t4x.org: could not connect to host
-t5118.com: could not connect to host
-t5197.co: could not connect to host
-t6729.co: could not connect to host
-t6957.co: could not connect to host
-t7803.com: could not connect to host
-t7804.com: could not connect to host
-t7810.com: could not connect to host
-t7ys.com: did not receive HSTS header
-t88aa.com: did not receive HSTS header
-t88dd.com: did not receive HSTS header
-t88hh.com: did not receive HSTS header
-t88kk.com: could not connect to host
-t88ll.com: could not connect to host
-t88rr.com: did not receive HSTS header
-t88uu.com: did not receive HSTS header
-t88ww.com: could not connect to host
-t88yy.com: could not connect to host
-t9297.co: could not connect to host
-t9721.com: could not connect to host
-t9728.co: could not connect to host
-ta-sports.net: did not receive HSTS header
-taabe.xyz: could not connect to host
-taartenfeesies.nl: could not connect to host
-tab.watch: did not receive HSTS header
-tabernadovinho.com.br: did not receive HSTS header
-tabernastudios.pe: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-taberu-fujitsubo.com: did not receive HSTS header
-tabino.top: did not receive HSTS header
-tabitatsu.jp: did not receive HSTS header
-tabla-periodica.com: could not connect to host
-tachyonapp.com: could not connect to host
-tacklinglife.com: did not receive HSTS header
-tacklog.com: could not connect to host
-tacoma-games.com: did not receive HSTS header
-tacostea.net: could not connect to host
-tacotown.tk: could not connect to host
-tacticalsquare.com: did not receive HSTS header
-tadata.me: could not connect to host
-tadcastercircuit.org.uk: did not receive HSTS header
-tadigitalstore.com: could not connect to host
-tadj-mahalat.com: did not receive HSTS header
-tadlab.cl: did not receive HSTS header
-tafoma.com: did not receive HSTS header
-tag-coin.com: could not connect to host
-tageau.com: could not connect to host
-tagesmutter-in-bilm.de: did not receive HSTS header
-tagesmutter-zwitscherlinge.de: did not receive HSTS header
-tagpay.com: could not connect to host
-tahakomat.cz: could not connect to host
-tahavu.com: could not connect to host
-tahf.net: could not connect to host
-tahmintr.com: could not connect to host
-tahosalodge.org: did not receive HSTS header
-taichi-jade.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-taidu.news: could not connect to host
-taigamehack.com: could not connect to host
-tail.id.lv: could not connect to host
-tail.ml: could not connect to host
-tailandfur.com: did not receive HSTS header
-tailify.com: did not receive HSTS header
-tails.com.ar: could not connect to host
-taim.io: could not connect to host
-taipei-101.tk: could not connect to host
-taiphanmem.net: did not receive HSTS header
-tajemno.net: did not receive HSTS header
-takb.ru: did not receive HSTS header
-takebackyourstate.com: could not connect to host
-takebackyourstate.net: could not connect to host
-takebackyourstate.org: could not connect to host
-takebonus.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-takedownthissite.com: could not connect to host
-takeitoffline.co.uk: did not receive HSTS header
-taki.sh: could not connect to host
-taki.to: could not connect to host
-takinet.kr: could not connect to host
-tako-miyabi.xyz: could not connect to host
-takusan.ru: could not connect to host
-takuyaphotos.com: did not receive HSTS header
-talado.gr: could not connect to host
-talenthero.io: did not receive HSTS header
-talenthub.co.nz: could not connect to host
-talentuar.com: could not connect to host
-tales-of-interia.de: could not connect to host
-talheim-records.ca: could not connect to host
-talk.google.com: did not receive HSTS header (error ignored - included regardless)
-talk.xyz: could not connect to host
-talkgadget.google.com: did not receive HSTS header (error ignored - included regardless)
-talkitup.mx: could not connect to host
-talkitup.online: could not connect to host
-talklifestyle.nl: could not connect to host
-talktobot.com: could not connect to host
-talktodarcy.com: did not receive HSTS header
-talktwincities.com: could not connect to host
-tallr.se: could not connect to host
-tallshoe.com: could not connect to host
-talon.rip: could not connect to host
-talsi.eu: could not connect to host
-tam-moon.com: could not connect to host
-tam-safe.com: could not connect to host
-tam7t.com: did not receive HSTS header
-tamakyi.club: did not receive HSTS header
-tamaraboutique.com: could not connect to host
-tamashimx.net: did not receive HSTS header
-tamasszabo.net: did not receive HSTS header
-tamchunho.com: could not connect to host
-tamex.xyz: could not connect to host
-tamirson.com: did not receive HSTS header
-tampa.gov: could not connect to host
-tan90.tw: could not connect to host
-tandarts-haarlem.nl: did not receive HSTS header
-tandblekningidag.com: could not connect to host
-tandem-trade.ru: could not connect to host
-tandilmap.com.ar: did not receive HSTS header
-tandk.com.vn: did not receive HSTS header
-tangerine.ga: could not connect to host
-tangibilizing.com: could not connect to host
-tangiblesecurity.com: did not receive HSTS header
-tango-cats.de: could not connect to host
-tangsisi.com: could not connect to host
-tangyue.date: could not connect to host
-tangzhao.net: could not connect to host
-taniesianie.pl: did not receive HSTS header
-tankfreunde.de: did not receive HSTS header
-tanner.sh: could not connect to host
-tanshin.xyz: could not connect to host
-tante-bugil.net: could not connect to host
-tantotiempo.de: did not receive HSTS header
-tanze-jetzt.de: could not connect to host
-taotuba.net: could not connect to host
-taotuba.org: max-age too low: 2592000
-taoways.com: did not receive HSTS header
-taozj.org: could not connect to host
-tapakgram.com: did not receive HSTS header
-tapestries.tk: could not connect to host
-tapety-na-pulpit.net: did not receive HSTS header
-tapfinder.ca: could not connect to host
-tapka.cz: did not receive HSTS header
-taplamvan.net: did not receive HSTS header
-taplemon.at: could not connect to host
-taplemon.com: could not connect to host
-tappezzeria.roma.it: could not connect to host
-tappublisher.com: did not receive HSTS header
-taqun.club: could not connect to host
-taranis.re: could not connect to host
-tarantul.org.ua: could not connect to host
-taravancil.com: did not receive HSTS header
-tarek.link: could not connect to host
-targaryen.house: could not connect to host
-targetexecutivesearch.com: did not receive HSTS header
-tarhauskielto.fi: did not receive HSTS header
-tarot-cartas.com: max-age too low: 0
-tarots-et-oracles.com: did not receive HSTS header
-tarsashaz-biztositas.hu: did not receive HSTS header
-tartaros.fi: could not connect to host
-taskin.me: could not connect to host
-taskstats.com: could not connect to host
-tasmansecurity.com: could not connect to host
-tassup.com: could not connect to host
-tasta.ro: could not connect to host
-tastenewwines.com: could not connect to host
-tastyyy.co: could not connect to host
-tasyacherry-anal.com: could not connect to host
-tatary.tk: could not connect to host
-tateesq.com: did not receive HSTS header
-tatilbus.com: did not receive HSTS header
-tatildukkani.com: did not receive HSTS header
-tatilmix.com: could not connect to host
-tatiloley.com: did not receive HSTS header
-tatort-fanpage.de: could not connect to host
-tatt.io: could not connect to host
-tauchkater.de: could not connect to host
-tauschen.info: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-taustyle.ru: could not connect to host
-tavoittaja.fi: did not receive HSTS header
-tavopica.lt: did not receive HSTS header
-taxaudit.com: did not receive HSTS header
-taxbench.com: could not connect to host
-taxi-24std.de: did not receive HSTS header
-taxi-uslu.de: did not receive HSTS header
-taxiindenbosch.nl: did not receive HSTS header
-taxisafmatosinhos.pt: could not connect to host
-taxmadras.com: could not connect to host
-taxsnaps.co.nz: did not receive HSTS header
-taxspeaker.com: did not receive HSTS header
-tayanamina.com: did not receive HSTS header
-taylorreaume.com: did not receive HSTS header
-taysonvodao.fr: could not connect to host
-tazemama.biz: could not connect to host
-tazj.in: did not receive HSTS header
-tazz.in: could not connect to host
-tbarter.com: did not receive HSTS header
-tbpixel.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-tbrss.com: did not receive HSTS header
-tbys.us: could not connect to host
-tc-bonito.de: did not receive HSTS header
-tc.nz: could not connect to host
-tcacademy.co.uk: could not connect to host
-tcade.co: could not connect to host
-tcao.info: could not connect to host
-tcb-a.org: could not connect to host
-tcb-b.org: could not connect to host
-tcby45.xyz: could not connect to host
-tccmb.com: could not connect to host
-tcdww.cn: could not connect to host
-tcg-digital.com: did not receive HSTS header
-tcgforum.pl: max-age too low: 2592000
-tchaka.top: could not connect to host
-tcl.ath.cx: did not receive HSTS header
-tcp.expert: did not receive HSTS header
-tcptun.com: could not connect to host
-tcspartner.net: did not receive HSTS header
-tcwebvn.com: could not connect to host
-tda602-secure-login.tk: could not connect to host
-tdelmas.eu: did not receive HSTS header
-tdelmas.ovh: could not connect to host
-tdpblog.site: could not connect to host
-tdro.cf: could not connect to host
-tdsb.cf: could not connect to host
-tdsb.ga: could not connect to host
-tdsb.gq: could not connect to host
-tdsb.ml: could not connect to host
-tdsbhack.cf: could not connect to host
-tdsbhack.ga: could not connect to host
-tdsbhack.gq: could not connect to host
-tdsbhack.ml: could not connect to host
-tdsbhack.tk: could not connect to host
-tdsf.io: could not connect to host
-tea.codes: did not receive HSTS header
-teabagdesign.co.uk: could not connect to host
-teacherph.net: did not receive HSTS header
-teachertool.io: could not connect to host
-teachforcanada.ca: did not receive HSTS header
-teachmeplease.com: did not receive HSTS header
-tealdrones.com: did not receive HSTS header
-team-bbd.com: could not connect to host
-team-pancake.eu: could not connect to host
-team-teasers.com: could not connect to host
-team.house: did not receive HSTS header
-team2fou.cf: could not connect to host
-teamassists.com: did not receive HSTS header
-teambeoplay.co.uk: did not receive HSTS header
-teamblueridge.org: could not connect to host
-teambodyproject.com: did not receive HSTS header
-teamcombat.com: did not receive HSTS header
-teamdaylo.xyz: could not connect to host
-teamhood.io: could not connect to host
-teammathics.com: could not connect to host
-teamnetsol.com: did not receive HSTS header
-teamnorthgermany.de: did not receive HSTS header
-teampoint.cz: could not connect to host
-teamsocial.co: did not receive HSTS header
-teamtmgb.fr: did not receive HSTS header
-teamtravel.co: did not receive HSTS header
-teamusec.de: could not connect to host
-teamzeus.cz: could not connect to host
-teaparty.id: could not connect to host
-tearoy.faith: could not connect to host
-tebieer.com: could not connect to host
-tech-blog.fr: could not connect to host
-tech-director.ru: could not connect to host
-tech-finder.fr: could not connect to host
-tech-professor.ir: could not connect to host
-tech-techno.tk: could not connect to host
-tech55i.com: could not connect to host
-techableme.com: did not receive HSTS header
-techademy.nl: did not receive HSTS header
-techandtux.de: could not connect to host
-techarea.fr: did not receive HSTS header
-techask.it: could not connect to host
-techbrawl.org: could not connect to host
-techcavern.ml: could not connect to host
-techcentric.com: did not receive HSTS header
-techday.co.nz: did not receive HSTS header
-techday.com: did not receive HSTS header
-techday.com.au: did not receive HSTS header
-techday.eu: did not receive HSTS header
-techelements.co: did not receive HSTS header
-techfactslive.com: did not receive HSTS header
-techforthepeople.org: could not connect to host
-techhipster.net: could not connect to host
-techhub.ml: could not connect to host
-techiehall.com: could not connect to host
-techlines.com.co: could not connect to host
-techllage.com: could not connect to host
-techloaner.com: could not connect to host
-techmasters.andover.edu: could not connect to host
-techmatehq.com: could not connect to host
-techmerch.ru: did not receive HSTS header
-technewera.com: did not receive HSTS header
-technicalbrothers.cf: did not receive HSTS header
-technicalforensic.com: could not connect to host
-technicalpenguins.com: did not receive HSTS header
-techniclab.net: did not receive HSTS header
-techniclab.org: did not receive HSTS header
-techniclab.ru: could not connect to host
-technifocal.com: could not connect to host
-technikblase.fm: did not receive HSTS header
-technikrom.org: could not connect to host
-technistan.in: did not receive HSTS header
-technoinfogroup.it: could not connect to host
-technoparcepsilon.fr: did not receive HSTS header
-technosavvyport.com: did not receive HSTS header
-technosuport.com: did not receive HSTS header
-technoswag.ca: could not connect to host
-technotonic.co.uk: did not receive HSTS header
-technotonic.com.au: did not receive HSTS header
-technotronikcanada.ca: could not connect to host
-techpointed.com: could not connect to host
-techpro.net.br: could not connect to host
-techproud.com: did not receive HSTS header
-techreview.link: could not connect to host
-techsharetx.gov: did not receive HSTS header
-techsocial.nl: could not connect to host
-techtoy.store: did not receive HSTS header
-techtrackerpro.com: could not connect to host
-techtraveller.com.au: did not receive HSTS header
-techtuts.info: did not receive HSTS header
-techunit.org: could not connect to host
-techvalue.gr: did not receive HSTS header
-techvhow.com: could not connect to host
-techwithcromulent.com: could not connect to host
-techzjc.com: did not receive HSTS header
-tecit.ch: could not connect to host
-tecmarkdig.com: could not connect to host
-tecnicosenlineablanca.com: could not connect to host
-tecnidev.com: did not receive HSTS header
-tecnikan.com.ar: did not receive HSTS header
-tecnimotos.com: did not receive HSTS header
-tecnogaming.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-tecnologino.com: could not connect to host
-tecnosa.es: did not receive HSTS header
-tecture.de: did not receive HSTS header
-tedovo.com: could not connect to host
-tedxkmitl.com: could not connect to host
-tedxodense.com: did not receive HSTS header
-tedxyalesecondaryschool.com: could not connect to host
-tee-idf.net: could not connect to host
-teehaus-shila.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-teektalk.org: could not connect to host
-teemo.gg: did not receive HSTS header
-teencounseling.com: did not receive HSTS header
-teeplelaw.com: did not receive HSTS header
-teesypeesy.com: did not receive HSTS header
-tefl.io: did not receive HSTS header
-tegelsensanitaironline.nl: did not receive HSTS header
-tehcrayz.com: did not receive HSTS header
-tehotuotanto.net: did not receive HSTS header
-tehplace.club: could not connect to host
-tehrankey.ir: did not receive HSTS header
-tehranperfume.com: did not receive HSTS header
-tejarat98.com: did not receive HSTS header
-tekingb.org: did not receive HSTS header
-tekiro.com: did not receive HSTS header
-teknogeek.id: could not connect to host
-teknolit.com: did not receive HSTS header
-teknologi.or.id: max-age too low: 36000
-teknotes.co.uk: could not connect to host
-tekshrek.com: did not receive HSTS header
-teksuperior.com: could not connect to host
-tektoria.de: did not receive HSTS header
-tektuts.com: could not connect to host
-tekuteku.jp: did not receive HSTS header
-tel-dithmarschen.de: did not receive HSTS header
-telamon.fr: did not receive HSTS header
-telcodb.net: did not receive HSTS header
-tele-alarme.ch: could not connect to host
-tele-assistance.ch: could not connect to host
-telealarme.ch: could not connect to host
-telealarmevalais.ch: could not connect to host
-teleallarme.ch: could not connect to host
-telecharger-itunes.com: could not connect to host
-telecharger-open-office.com: could not connect to host
-telecharger-winrar.com: could not connect to host
-telefisk.org: did not receive HSTS header
-telefoncek.si: could not connect to host
-telefonnummer.online: could not connect to host
-telefonogratuito.com: did not receive HSTS header
-telefoonnummerinfo.nl: did not receive HSTS header
-telegramdr.com: did not receive HSTS header
-telekollektiv.org: could not connect to host
-telemovi.com: could not connect to host
-telepass.me: could not connect to host
-telepons.com: could not connect to host
-telescam.com: could not connect to host
-teleshop.be: could not connect to host
-teleskell.org: could not connect to host
-telesto.online: could not connect to host
-teletechnology.in: did not receive HSTS header
-teletra.ru: could not connect to host
-telfordwhitehouse.co.uk: did not receive HSTS header
-telibee.com: did not receive HSTS header
-tellcorpassessoria.com.br: did not receive HSTS header
-telos-analytics.com: could not connect to host
-telugu4u.net: could not connect to host
-temehu.com: did not receive HSTS header
-temp.hopto.org: could not connect to host
-tempcraft.net: could not connect to host
-temperandtantrum.com: did not receive HSTS header
-tempflix.com: could not connect to host
-tempo.co: did not receive HSTS header
-tempodecolheita.com.br: could not connect to host
-tempus-aquilae.de: could not connect to host
-ten-cafe.com: did not receive HSTS header
-tenberg.com: could not connect to host
-tencent.xn--vuq861b: could not connect to host
-tendertool.nl: could not connect to host
-tenerife-villas.com: max-age too low: 2592000
-tengu.cloud: could not connect to host
-tenispopular.com: could not connect to host
-tenkdigitalt.no: did not receive HSTS header
-tenma.pro: could not connect to host
-tenni.xyz: could not connect to host
-tennisadmin.com: could not connect to host
-tennisapp.org: could not connect to host
-tenseapp.pl: could not connect to host
-tensei-slime.com: did not receive HSTS header
-tensionup.com: could not connect to host
-tent.io: could not connect to host
-tentabrowser.com: could not connect to host
-tenthousandbottoms.com: did not receive HSTS header
-tenthpin.com: did not receive HSTS header
-tentins.com: could not connect to host
-teodio.cl: did not receive HSTS header
-teos.online: could not connect to host
-teoskanta.fi: could not connect to host
-tepautotuning.com: could not connect to host
-teplomash24.ru: could not connect to host
-terabyte-computing.com: could not connect to host
-terabyteharddrive.net: could not connect to host
-teranga.ch: could not connect to host
-tercerapuertoaysen.cl: could not connect to host
-teriiphotography.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-teriyakiweasel.com: could not connect to host
-termax.me: did not receive HSTS header
-terminationsremembered.com: did not receive HSTS header
-terpotiz.net: did not receive HSTS header
-terra-x.net: could not connect to host
-terra.by: did not receive HSTS header
-terra.fitness: did not receive HSTS header
-terrace.co.jp: did not receive HSTS header
-terralimno.com: did not receive HSTS header
-terralimno.eu: did not receive HSTS header
-terranova-nutrition.dk: did not receive HSTS header
-terrax.berlin: could not connect to host
-terrax.info: did not receive HSTS header
-terrax.net: could not connect to host
-terrazoo.de: did not receive HSTS header
-terselubung.net: did not receive HSTS header
-teru.com.br: could not connect to host
-terudon.com: could not connect to host
-teslarius.com: could not connect to host
-tesoro.pr: did not receive HSTS header
-tessierashpool.de: could not connect to host
-test-aankoop.be: did not receive HSTS header
-test-achats.be: did not receive HSTS header
-test-allegrodev.pantheonsite.io: did not receive HSTS header
-test-dns.eu: could not connect to host
-test-sev-web.pantheonsite.io: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-test02.dk: could not connect to host
-test1websiteboost.nl: did not receive HSTS header
-testadren.com: could not connect to host
-testadron.com: could not connect to host
-testandroid.xyz: could not connect to host
-testbawks.com: could not connect to host
-testbirds.cz: could not connect to host
-testdomain.ovh: could not connect to host
-testlabs.tk: could not connect to host
-testnode.xyz: could not connect to host
-testosterone-complex.com: could not connect to host
-testosteronedetective.com: could not connect to host
-testovaci.ml: could not connect to host
-testsvigilantesdeseguridad.es: did not receive HSTS header
-testvocacional.online: could not connect to host
-tetrafinancial-commercial-business-equipment-financing.com: could not connect to host
-tetrafinancial-energy-mining-equipment-financing.com: could not connect to host
-tetrafinancial-healthcare-medical-equipment-financing.com: could not connect to host
-tetrafinancial-manufacturing-industrial-equipment-financing.com: could not connect to host
-tetrafinancial-news.com: could not connect to host
-tetrafinancial-technology-equipment-software-financing.com: could not connect to host
-tetragir.com: did not receive HSTS header
-tetramax.eu: did not receive HSTS header
-tetsai.com: could not connect to host
-teufelswerk.net: did not receive HSTS header
-teufelsystem.de: could not connect to host
-teuniz.nl: did not receive HSTS header
-teva-li.com: did not receive HSTS header
-texasready.gov: did not receive HSTS header
-textbrawlers.com: could not connect to host
-texte-zur-taufe.de: did not receive HSTS header
-textinmate.com: could not connect to host
-textoplano.xyz: could not connect to host
-textpedia.org: did not receive HSTS header
-textracer.dk: could not connect to host
-teyssedre.ca: did not receive HSTS header
-tezcam.tk: could not connect to host
-tf-network.de: did not receive HSTS header
-tf2stadium.com: did not receive HSTS header
-tf7879.com: could not connect to host
-tfadictivo.com: could not connect to host
-tfcoms-sp-tracker-client.azurewebsites.net: could not connect to host
-tffans.com: did not receive HSTS header
-tfl.lu: did not receive HSTS header
-tgbyte.com: did not receive HSTS header
-tgmkanis.com: did not receive HSTS header
-tgod.co: could not connect to host
-tgr.re: could not connect to host
-th-bl.de: did not receive HSTS header
-th-music-finder.com: could not connect to host
-th3nd.com: could not connect to host
-thackert.myfirewall.org: could not connect to host
-thagki9.com: did not receive HSTS header
-thai.land: could not connect to host
-thaianthro.com: could not connect to host
-thaiboystory.ga: could not connect to host
-thaigirls.xyz: could not connect to host
-thaihostcool.com: did not receive HSTS header
-thailandlongtime.com: did not receive HSTS header
-thailandpropertylistings.com: could not connect to host
-thairehabassociation.com: could not connect to host
-thaliagetaway.com.au: did not receive HSTS header
-thallinger.me: could not connect to host
-thalskarth.com: did not receive HSTS header
-thamesfamilydentistry.com: did not receive HSTS header
-thatgudstuff.com: did not receive HSTS header
-thatpodcast.io: did not receive HSTS header
-thatsme.io: could not connect to host
-thatvizsla.life: could not connect to host
-the-arabs.com: did not receive HSTS header
-the-bermanns.com: did not receive HSTS header
-the-construct.com: could not connect to host
-the-delta.net.eu.org: could not connect to host
-the-earth-yui.net: could not connect to host
-the-finance-blog.com: could not connect to host
-the-gdn.net: did not receive HSTS header
-the-gist.io: could not connect to host
-the-paddies.de: did not receive HSTS header
-the-sky-of-valkyries.com: could not connect to host
-the-webmaster.com: did not receive HSTS header
-the.ie: could not connect to host
-the1.site: max-age too low: 2592000
-the420vape.org: could not connect to host
-theafleo.gq: could not connect to host
-theagilitychallenge.com: did not receive HSTS header
-thealexandertechnique.co.uk: did not receive HSTS header
-theamateurs.net: did not receive HSTS header
-theamp.com: did not receive HSTS header
-theankhlife.com: did not receive HSTS header
-theanticellulitediet.com: could not connect to host
-thearcheryguide.com: did not receive HSTS header
-theater.cf: could not connect to host
-theavenuegallery.com: did not receive HSTS header
-theazoorsociety.org: could not connect to host
-thebakingclass.com: max-age too low: 60
-thebarbdemariateam.com: did not receive HSTS header
-thebarneystyle.com: did not receive HSTS header
-thebasementguys.com: could not connect to host
-thebeautifulmusic.net: did not receive HSTS header
-thebeginningisnye.com: could not connect to host
-theberkshirescompany.com: could not connect to host
-theberries.tk: could not connect to host
-thebest.ch: could not connect to host
-thebestofthesprings.com: did not receive HSTS header
-thebestpersonin.ml: could not connect to host
-thebestsavingsplan.com: did not receive HSTS header
-thebigfail.net: did not receive HSTS header
-thebiggive.org.uk: did not receive HSTS header
-theblackknightsings.com: could not connect to host
-thebluub.com: could not connect to host
-theboss.ch: did not receive HSTS header
-thebouncyman.co.uk: could not connect to host
-thebreakhotel.com: did not receive HSTS header
-thebrotherswarde.com: could not connect to host
-thebte.com: could not connect to host
-thebuffalotavern.com: could not connect to host
-thecandyjam.com: did not receive HSTS header
-thecapitalbank.com: could not connect to host
-thecellulitediet.com: could not connect to host
-thecharlestonwaldorf.com: did not receive HSTS header
-thechunk.net: did not receive HSTS header
-theciderlink.com.au: could not connect to host
-thecitizens.com: did not receive HSTS header
-theclementinebutchers.com: could not connect to host
-theclimbingunit.com: did not receive HSTS header
-theclinician.com: did not receive HSTS header
-thecloudmigrator.com: did not receive HSTS header
-theclubjersey.com: did not receive HSTS header
-thecodeninja.net: did not receive HSTS header
-thecoffeehouse.xyz: could not connect to host
-thecoffeepod.co.uk: did not receive HSTS header
-thecolumnist.net: could not connect to host
-theconcordbridge.azurewebsites.net: could not connect to host
-thecontentcloud.com: did not receive HSTS header
-thecookiejar.me: could not connect to host
-thecozycastle.com: did not receive HSTS header
-thecrochetcottage.net: could not connect to host
-thecstick.com: could not connect to host
-thecsw.com: did not receive HSTS header
-thecuppacakery.co.uk: did not receive HSTS header
-thecuriouscat.net: could not connect to host
-thecyberaid.com: did not receive HSTS header
-thedailyupvote.com: could not connect to host
-thedarkartsandcrafts.com: could not connect to host
-thedebug.life: could not connect to host
-thedevilwearswibra.nl: did not receive HSTS header
-thedisc.nl: did not receive HSTS header
-thedoctorsorders.pub: could not connect to host
-thedominatorsclan.com: could not connect to host
-thedreamtravelgroup.co.uk: could not connect to host
-thedrinks.co: did not receive HSTS header
-thedrop.pw: did not receive HSTS header
-thedrunkencabbage.com: could not connect to host
-thedutchmarketers.com: did not receive HSTS header
-thedystance.com: could not connect to host
-theebookkeepers.co.za: did not receive HSTS header
-theelitebuzz.com: could not connect to host
-theender.net: did not receive HSTS header
-theendofzion.com: did not receive HSTS header
-theepankar.com: could not connect to host
-theescapistswiki.com: could not connect to host
-theexpatriate.de: could not connect to host
-thefarbeyond.com: could not connect to host
-thefashionpolos.com: could not connect to host
-thefbstalker.com: could not connect to host
-thefilmcolor.com: could not connect to host
-thefilmphotography.com: did not receive HSTS header
-thefootballanalyst.com: did not receive HSTS header
-thefox.co: did not receive HSTS header
-thefreebirds.in: could not connect to host
-thefrk.xyz: could not connect to host
-thefrozenfire.com: did not receive HSTS header
-thefutureharrills.com: could not connect to host
-thegcccoin.com: max-age too low: 2592000
-thegemriverside.com.vn: could not connect to host
-thego2swatking.com: could not connect to host
-thegoldregister.co.uk: could not connect to host
-thegospelforgeeks.org: did not receive HSTS header
-thegraciousgourmet.com: did not receive HSTS header
-thegreenfields.se: could not connect to host
-thegreenmanpottery.com: could not connect to host
-thegreens.us: could not connect to host
-thegreenvpn.com: could not connect to host
-thegrs.com: did not receive HSTS header
-thegym.org: did not receive HSTS header
-thehiddenbay.cc: could not connect to host
-thehiddenbay.eu: could not connect to host
-thehiddenbay.fi: could not connect to host
-thehiddenbay.info: could not connect to host
-thehiddenbay.me: did not receive HSTS header
-thehiddenbay.net: could not connect to host
-thehiddenbay.ws: could not connect to host
-thehighersideclothing.com: did not receive HSTS header
-thehistory.me: could not connect to host
-thehivedesign.org: could not connect to host
-thehoopsarchive.com: could not connect to host
-thehoryzon.com: did not receive HSTS header
-thehotfix.net: could not connect to host
-thehotness.tech: could not connect to host
-thehouseofgod.org.nz: did not receive HSTS header
-thehowtohome.com: did not receive HSTS header
-theideaskitchen.com.au: could not connect to host
-theimagefile.com: did not receive HSTS header
-theinvisibletrailer.com: could not connect to host
-theissue.com.au: did not receive HSTS header
-thej0lt.com: did not receive HSTS header
-thejacksoninstitute.com.au: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-thejobauction.com: did not receive HSTS header
-thejserver.de: could not connect to host
-thekindplate.ca: max-age too low: 7776000
-thekrewserver.com: did not receive HSTS header
-thelapine.ca: did not receive HSTS header
-thelastbeach.top: could not connect to host
-thelastsurprise.com: could not connect to host
-thelatedcult.com: did not receive HSTS header
-thelefthand.org: did not receive HSTS header
-thelinuxspace.com: could not connect to host
-thelittlepeartree.eu: could not connect to host
-thelostyankee.com: could not connect to host
-themacoaching.nl: did not receive HSTS header
-themadlabengineer.co.uk: could not connect to host
-themadmechanic.net: could not connect to host
-themanufacturingmarketingagency.com: could not connect to host
-themarble.co: could not connect to host
-themathbehindthe.science: could not connect to host
-themattresswarehouse.co.za: did not receive HSTS header
-themeaudit.com: could not connect to host
-themesurgeons.net: could not connect to host
-themicrocapital.com: could not connect to host
-themilanlife.com: could not connect to host
-themillerslive.com: did not receive HSTS header
-themobilestuffs.com: could not connect to host
-themoderate.xyz: could not connect to host
-thenarcissisticlife.com: did not receive HSTS header
-theneatgadgets.com: could not connect to host
-thenewclassics.com: could not connect to host
-thenexteducation.com: did not receive HSTS header
-thenextstep.events: could not connect to host
-thenichecast.com: could not connect to host
-thenorthschool.org.uk: did not receive HSTS header
-thenrdhrd.nl: could not connect to host
-theo.me: could not connect to host
-theobg.co: did not receive HSTS header
-theoc.co: did not receive HSTS header
-theocg.co: did not receive HSTS header
-theocharis.org: could not connect to host
-theodorejones.info: could not connect to host
-theojones.name: could not connect to host
-theokonst.tk: could not connect to host
-theokouzelis.com: could not connect to host
-theoldbrewhouse.info: could not connect to host
-theosblog.de: could not connect to host
-theosophic.ga: could not connect to host
-theosophie-afrique.org: could not connect to host
-theoverfly.co: could not connect to host
-thepaffy.de: could not connect to host
-theparoxetine.gq: could not connect to host
-thepartywarehouse.co.uk: did not receive HSTS header
-thepcweb.tk: could not connect to host
-thepeninsulaires.com: did not receive HSTS header
-thepeoplesdata.com: could not connect to host
-thepeoplesdata.org: could not connect to host
-thephonecaseplace.com: did not receive HSTS header
-thepiabo.ovh: could not connect to host
-thepickledhedgehog.com: could not connect to host
-thepiratebay.al: did not receive HSTS header
-thepiratebay.poker: could not connect to host
-thepiratebay.tech: could not connect to host
-theplaidpoodle.com: did not receive HSTS header
-theplaydaysbus.co.uk: could not connect to host
-theposhfudgecompany.co.uk: could not connect to host
-thepostoffice.ro: did not receive HSTS header
-theprincegame.com: could not connect to host
-theprivacysolution.com: could not connect to host
-theproductpoet.com: did not receive HSTS header
-theqjourney.com: did not receive HSTS header
-thequillmagazine.org: could not connect to host
-theragran.co.id: did not receive HSTS header
-therapyroom.rent: did not receive HSTS header
-theresabrant.com: did not receive HSTS header
-therewill.be: could not connect to host
-thermo-recetas.com: did not receive HSTS header
-theroamingnotary.com: did not receive HSTS header
-thesage.cf: could not connect to host
-thesearchnerds.co.uk: did not receive HSTS header
-thesecurityteam.net: could not connect to host
-theseedbox.xyz: could not connect to host
-thesehighsandlows.com: could not connect to host
-theseletarmall.com: could not connect to host
-theserver201.tk: could not connect to host
-theshadestore.com: max-age too low: 10368000
-thesharepointfarm.com: did not receive HSTS header
-theshield.in: could not connect to host
-thesignacademy.co.uk: could not connect to host
-thesimplifiers.com: did not receive HSTS header
-thesocialmediacentral.com: could not connect to host
-thesplit.is: could not connect to host
-thestack.xyz: could not connect to host
-thestagchorleywood.co.uk: did not receive HSTS header
-thestandingroomrestaurant.com: did not receive HSTS header
-thestoritplace.com: max-age too low: 0
-thestoryshack.com: could not connect to host
-thestral.pro: could not connect to host
-thestralbot.com: could not connect to host
-thestudyla.com: did not receive HSTS header
-thestyle.city: did not receive HSTS header
-thetapirsmouth.com: could not connect to host
-thetenscrolls.com: could not connect to host
-thethirdroad.com: did not receive HSTS header
-thetorlock.com: could not connect to host
-thetorrentfunk.com: could not connect to host
-thetravelczar.com: could not connect to host
-thetruthhurvitz.com: did not receive HSTS header
-theunitedstates.io: did not receive HSTS header
-theurbanyoga.com: did not receive HSTS header
-theuucc.org: did not receive HSTS header
-theviewat55th.com: could not connect to host
-thevintagenews.com: did not receive HSTS header
-thevisasofoz.com: did not receive HSTS header
-thevoid.one: could not connect to host
-thewallset.com: could not connect to host
-thewarrencenter.org: did not receive HSTS header
-thewashingmachine.tk: could not connect to host
-thewaxhouse.academy: did not receive HSTS header
-thewaxhouse.de: did not receive HSTS header
-thewaxhouse.shop: could not connect to host
-theway2u.com: could not connect to host
-thewebdexter.com: could not connect to host
-thewebfellas.com: did not receive HSTS header
-thewego.com: could not connect to host
-theweilai.com: could not connect to host
-thewhiterabbit.space: could not connect to host
-thewindow.com: could not connect to host
-thewoolroom.com.au: did not receive HSTS header
-theworld.tk: could not connect to host
-thewp.pro: max-age too low: 0
-theyachtteam.com: could not connect to host
-theyarnhookup.com: could not connect to host
-theyourbittorrent.com: could not connect to host
-thezonders.com: did not receive HSTS header
-thgros.fr: could not connect to host
-thibaultwalle.com: could not connect to host
-thibautcharles.net: did not receive HSTS header
-thierfreund.de: did not receive HSTS header
-thierryhayoz.ch: could not connect to host
-thierrymazue.eu: did not receive HSTS header
-thingsof.org: could not connect to host
-thinkcash.nl: could not connect to host
-thinkclic.fr: did not receive HSTS header
-thinkcoding.de: could not connect to host
-thinkcoding.org: could not connect to host
-thinkdo.jp: could not connect to host
-thinklikeanentrepreneur.com: did not receive HSTS header
-thinlyveiledcontempt.com: could not connect to host
-thirdpartytrade.com: did not receive HSTS header
-thirdworld.moe: could not connect to host
-thirty5.net: did not receive HSTS header
-thirtyspot.com: could not connect to host
-this-server-will-be-the-death-of-me.com: could not connect to host
-thisisacompletetest.ga: could not connect to host
-thisisforager.com: could not connect to host
-thisisgrey.com: did not receive HSTS header
-thisisthefinalact.com: did not receive HSTS header
-thisistranquility.life: did not receive HSTS header
-thisiswhywemom.com: could not connect to host
-thismumdoesntknowbest.com: could not connect to host
-thisserver.dontexist.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-thiswasalreadymyusername.tk: could not connect to host
-thkb.net: could not connect to host
-thm.vn: did not receive HSTS header
-thomas-bertran.com: did not receive HSTS header
-thomas-ferney.fr: could not connect to host
-thomas-gibertie.fr: did not receive HSTS header
-thomas-grobelny.de: could not connect to host
-thomas-klubert.de: did not receive HSTS header
-thomas-prior.com: could not connect to host
-thomasbnt.fr: did not receive HSTS header
-thomascloud.ddns.net: could not connect to host
-thomasgriffin.io: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-thomasharvey.me: did not receive HSTS header
-thomaskaviani.be: could not connect to host
-thomaskliszowski.fr: did not receive HSTS header
-thomasnet.fr: could not connect to host
-thomasscholz.com: max-age too low: 2592000
-thomasschweizer.net: could not connect to host
-thomaswoo.com: did not receive HSTS header
-thorbis.com: could not connect to host
-thorbiswebsitedesign.com: could not connect to host
-thorgames.nl: did not receive HSTS header
-thorncreek.net: did not receive HSTS header
-thoroquel.org: could not connect to host
-thorshammare.com: did not receive HSTS header
-thorshammare.org: did not receive HSTS header
-thorshammare.se: did not receive HSTS header
-thoschi.net: did not receive HSTS header
-thot.space: could not connect to host
-thoughtlessleaders.online: could not connect to host
-thoughtsynth.com: could not connect to host
-thoughtsynth.net: could not connect to host
-thoughtsynth.org: could not connect to host
-thousandgreens.com: did not receive HSTS header
-threatcentral.io: could not connect to host
-threebrothersbrewing.com: could not connect to host
-threebulls.be: did not receive HSTS header
-threecrownsllp.com: did not receive HSTS header
-threefantasy.com: could not connect to host
-threepercentrealty.net: did not receive HSTS header
-thriveapproach.co.uk: did not receive HSTS header
-throughthelookingglasslens.co.uk: could not connect to host
-thrx.net: did not receive HSTS header
-thsc.org: did not receive HSTS header
-thsc.us: did not receive HSTS header
-thumbsupcandy.com: could not connect to host
-thumbtack.com: did not receive HSTS header
-thundercampaign.com: could not connect to host
-thundercloud.onthewifi.com: could not connect to host
-thunderfield-boat.co.uk: could not connect to host
-thuviensoft.net: could not connect to host
-thymiaturtle.de: did not receive HSTS header
-thzone.net: could not connect to host
-ti-js.com: could not connect to host
-ti.blog.br: did not receive HSTS header
-ti780.com: could not connect to host
-tiacollection.com: did not receive HSTS header
-tiagoealine.com.br: did not receive HSTS header
-tiantangbt.com: could not connect to host
-tianxicaipiao.com: could not connect to host
-tianxicaipiao.win: could not connect to host
-tianxicp.com: could not connect to host
-tianxing.pro: could not connect to host
-tianxingvpn.pro: could not connect to host
-tibbitshall.ca: could not connect to host
-tibovanheule.site: could not connect to host
-tibovanheule.space: did not receive HSTS header
-tichieru.pw: could not connect to host
-ticinoscout.ch: could not connect to host
-ticketassist.nl: did not receive HSTS header
-ticketluck.com: did not receive HSTS header
-ticketmates.com.au: did not receive HSTS header
-ticketmaze.com: could not connect to host
-ticketoplichting.nl: did not receive HSTS header
-ticketscol.com: could not connect to host
-tickopa.co.uk: could not connect to host
-tickreport.com: did not receive HSTS header
-ticktock.today: could not connect to host
-tictactux.de: could not connect to host
-tidmore.us: could not connect to host
-tidycustoms.net: did not receive HSTS header
-tie-online.org: could not connect to host
-tielecingenieria.com.co: did not receive HSTS header
-tielectric.ch: did not receive HSTS header
-tiemcayxanh.com: did not receive HSTS header
-tiendavertigo.com: did not receive HSTS header
-tiendschuurstraat.nl: could not connect to host
-tiensnet.com: could not connect to host
-tier-1-entrepreneur.com: could not connect to host
-tiernanx.com: could not connect to host
-tierrarp.com: could not connect to host
-tiffanytravels.com: did not receive HSTS header
-tigerfm.tk: could not connect to host
-tigergroup.tk: did not receive HSTS header
-tiggi.pw: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-tightlineproductions.com: did not receive HSTS header
-tigit.co.nz: could not connect to host
-tihvin.tk: could not connect to host
-tijo.ch: could not connect to host
-tik.help: did not receive HSTS header
-tikutiku.pl: could not connect to host
-tildebot.com: could not connect to host
-tiledailyshop.com: did not receive HSTS header
-tiles-for-facing.tk: could not connect to host
-tiliaze.be: did not receive HSTS header
-tiliaze.biz: did not receive HSTS header
-tiliaze.eu: could not connect to host
-tiliaze.info: did not receive HSTS header
-tiliaze.net: did not receive HSTS header
-tilient.eu: could not connect to host
-tilkah.com.au: could not connect to host
-tillcraft.com: could not connect to host
-timbeilby.com: could not connect to host
-timbuktutimber.com: did not receive HSTS header
-timcamara.com: did not receive HSTS header
-timdebruijn.nl: did not receive HSTS header
-time-business.tk: could not connect to host
-time-hotel.cf: could not connect to host
-time-river.xyz: could not connect to host
-timebox.tk: could not connect to host
-timecd.cn: did not receive HSTS header
-timer.fit: could not connect to host
-timerace.ml: could not connect to host
-timersuite.com: could not connect to host
-timesavingplugins.com: could not connect to host
-timesavingplugins.net: could not connect to host
-timeserver0.de: could not connect to host
-timeserver1.de: could not connect to host
-timeserver2.de: could not connect to host
-timestamp.io: did not receive HSTS header
-timestamp.uk: could not connect to host
-timetab.org: could not connect to host
-timewk.cn: did not receive HSTS header
-timfiedler.net: did not receive HSTS header
-timgame.tk: could not connect to host
-timhieubenh.net: could not connect to host
-timhieuthuoc.com: could not connect to host
-timhjalpen.se: could not connect to host
-timklefisch.de: did not receive HSTS header
-timmy.im: could not connect to host
-timmy.ws: could not connect to host
-timothybjacobs.com: did not receive HSTS header
-timotrans.de: could not connect to host
-timotrans.eu: could not connect to host
-timowi.net: could not connect to host
-timwhite.io: could not connect to host
-timwittenberg.com: could not connect to host
-tinchbear.xyz: could not connect to host
-tinclip.com: did not receive HSTS header
-tindewen.net: could not connect to host
-tinf15b4.de: could not connect to host
-tink.network: could not connect to host
-tinker.career: could not connect to host
-tinkerbeast.com: could not connect to host
-tinlook.com: could not connect to host
-tinyvpn.net: could not connect to host
-tinyvpn.org: could not connect to host
-tiochambita.com: could not connect to host
-tiogacountyny.gov: could not connect to host
-tipbox.is: did not receive HSTS header
-tipiakers.club: could not connect to host
-tipo01.tk: could not connect to host
-tipocloud.cf: could not connect to host
-tipps-fuer-den-haushalt.de: could not connect to host
-tippspiel.cc: could not connect to host
-tipsyk.ru: could not connect to host
-tiratuki.games: did not receive HSTS header
-tiredofeating.com: could not connect to host
-tiremoni.ch: could not connect to host
-tirex.media: did not receive HSTS header
-tism.in: could not connect to host
-tiste.org: did not receive HSTS header
-titanlab.de: could not connect to host
-titanleaf.com: could not connect to host
-titanous.com: did not receive HSTS header
-titiansgirlphotography.com: did not receive HSTS header
-titli.fr: could not connect to host
-tittarpuls.se: could not connect to host
-titties.ml: could not connect to host
-tivido.nl: could not connect to host
-tjandpals.com: did not receive HSTS header
-tjc.wiki: could not connect to host
-tjeckien.guide: could not connect to host
-tjenestetorvet.dk: could not connect to host
-tjkcastles.uk: did not receive HSTS header
-tjs.me: could not connect to host
-tjsbouncycastles.co.uk: could not connect to host
-tju.me: could not connect to host
-tkappertjedemetamorfose.nl: did not receive HSTS header
-tkarstens.de: did not receive HSTS header
-tkeycoin.com: did not receive HSTS header
-tkhw.tk: could not connect to host
-tkn.tokyo: could not connect to host
-tkonstantopoulos.tk: could not connect to host
-tkts.cl: could not connect to host
-tlach.cz: could not connect to host
-tlcdn.net: could not connect to host
-tlo.hosting: could not connect to host
-tlo.link: could not connect to host
-tlo.network: could not connect to host
-tls.builders: could not connect to host
-tls.li: could not connect to host
-tls1914.org: did not receive HSTS header
-tlsbv.nl: did not receive HSTS header
-tlshost.net: could not connect to host
-tlsrobot.se: could not connect to host
-tm-solutions.eu: could not connect to host
-tm.id.au: did not receive HSTS header
-tmaward.net: could not connect to host
-tmc.com.mt: could not connect to host
-tmconnects.com: could not connect to host
-tmcpromotions.co.uk: could not connect to host
-tmd.cool: did not receive HSTS header
-tmdc.ddns.net: could not connect to host
-tmhlive.com: could not connect to host
-tmhr.moe: could not connect to host
-tmi.news: did not receive HSTS header
-tmin.cf: could not connect to host
-tmitchell.io: could not connect to host
-tmonitoring.com: did not receive HSTS header
-tmprod.com: did not receive HSTS header
-tmtradingmorocco.ma: did not receive HSTS header
-tnb-plattform.de: could not connect to host
-tncnanet.com.br: could not connect to host
-tno.io: did not receive HSTS header
-tnosha.gov: did not receive HSTS header
-tnrealid.gov: did not receive HSTS header
-tnusedoil.gov: could not connect to host
-tnwildlandfire.gov: did not receive HSTS header
-tnwioa.gov: could not connect to host
-tny.link: could not connect to host
-to2mbn.org: could not connect to host
-toabsentfamily.com: did not receive HSTS header
-tob-rulez.de: could not connect to host
-tobaby.com.br: could not connect to host
-tobacco.gov: could not connect to host
-tobaccore.eu: could not connect to host
-tobaccore.sk: could not connect to host
-tobedo.net: could not connect to host
-tobi-videos.goip.de: could not connect to host
-tobias-bauer.eu: did not receive HSTS header
-tobias-bauer.fr: did not receive HSTS header
-tobias-bauer.net: did not receive HSTS header
-tobias-bielefeld.de: did not receive HSTS header
-tobias-kluge.com: could not connect to host
-tobias-picha.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-tobias-weidhase.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-tobias4.ddns.net: could not connect to host
-tobiasbergius.se: could not connect to host
-tobiasmathes.com: did not receive HSTS header
-tobiasmathes.name: could not connect to host
-tobiasofficial.at: could not connect to host
-tobiassachs.cf: could not connect to host
-tobiassachs.tk: could not connect to host
-tobiaswiese.work: could not connect to host
-tobis-webservice.de: could not connect to host
-todaciencia.com: could not connect to host
-toddmissiontx.gov: did not receive HSTS header
-todo.is: did not receive HSTS header
-todobazar.es: could not connect to host
-todocracy.com: could not connect to host
-todoenunaweb.com: could not connect to host
-todoist.com: did not receive HSTS header
-todoist.net: could not connect to host
-todokete.ga: could not connect to host
-todosrv.com: could not connect to host
-todotecnohoy.com: did not receive HSTS header
-toeglhofer.at: could not connect to host
-toerclub-ing-arnhem.nl: did not receive HSTS header
-toetsplatform.be: could not connect to host
-tofa-koeln.de: could not connect to host
-tofilmhub.com: could not connect to host
-tofu.im: could not connect to host
-togelonlinecommunity.com: could not connect to host
-tojeto.eu: could not connect to host
-toka.sg: could not connect to host
-tokage.me: could not connect to host
-tokbijouxs.com.br: did not receive HSTS header
-tokenloan.com: did not receive HSTS header
-tokfun.com: could not connect to host
-tokintu.com: could not connect to host
-tokobungaasryflorist.com: did not receive HSTS header
-tokobungadijambi.com: could not connect to host
-tokobungadilampung.com: could not connect to host
-tokobungadipadangflorist.com: could not connect to host
-tokoindo.top: could not connect to host
-tokoone.com: could not connect to host
-tokoplugin.com: could not connect to host
-tokotamz.net: could not connect to host
-tokotimbangandigitalmurah.web.id: did not receive HSTS header
-tokoyo.biz: could not connect to host
-tokumei.co: did not receive HSTS header
-tollfreeproxy.com: could not connect to host
-tollsjekk.no: did not receive HSTS header
-tolud.com: could not connect to host
-tom-maxwell.com: did not receive HSTS header
-tom.run: did not receive HSTS header
-tomandshirley.com: could not connect to host
-tomashouzvicka.com: could not connect to host
-tomashouzvicka.pl: could not connect to host
-tomaspialek.cz: did not receive HSTS header
-tomaw.net: did not receive HSTS header
-tombroker.org: did not receive HSTS header
-tomcort.com: did not receive HSTS header
-tomdudfield.com: did not receive HSTS header
-tomeara.net: could not connect to host
-tomevans.io: could not connect to host
-tomfisher.eu: could not connect to host
-tomharling.co.uk: could not connect to host
-tomharris.tech: could not connect to host
-tomik.cloud: could not connect to host
-tomiler.com: could not connect to host
-tomjans.nl: could not connect to host
-tomlankhorst.nl: did not receive HSTS header
-tomli.blog: could not connect to host
-tomli.me: could not connect to host
-tommounsey.com: did not receive HSTS header
-tommsy.com: did not receive HSTS header
-tommyads.com: could not connect to host
-tommyweber.de: did not receive HSTS header
-tomoyaf.com: could not connect to host
-toms.ovh: could not connect to host
-tomsdevsn.me: could not connect to host
-tomsk.ml: could not connect to host
-tomudding.com: could not connect to host
-tomy.icu: could not connect to host
-tomyork.net: could not connect to host
-tonburi.jp: could not connect to host
-tone.tw: could not connect to host
-tonerjet.co.uk: could not connect to host
-tonex.nl: could not connect to host
-tongmu.me: could not connect to host
-tonguetechnology.com: could not connect to host
-tonifarres.net: could not connect to host
-tonigallagherinteriors.com: could not connect to host
-toniharant.de: could not connect to host
-tonkinson.com: could not connect to host
-tonytan.cn: could not connect to host
-toolkits.design: could not connect to host
-toomanypillows.com: could not connect to host
-toonsburgh.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-toontown.team: could not connect to host
-toopita.com: could not connect to host
-top-autoshop.com.ua: did not receive HSTS header
-top-solar-info.de: could not connect to host
-top-stage.net: could not connect to host
-top10mountainbikes.info: could not connect to host
-topanlage.de: could not connect to host
-topbargains.com.au: did not receive HSTS header
-topbilan.com: did not receive HSTS header
-topbounce.com: could not connect to host
-topbouncycastles.co.uk: could not connect to host
-topbrakes.com: did not receive HSTS header
-topdeskdev.net: could not connect to host
-topdetoxcleanse.com: could not connect to host
-topdevbox.net: could not connect to host
-topdroneusa.com: could not connect to host
-topeyelashenhancerserumreviews.com: did not receive HSTS header
-topkek.ml: could not connect to host
-topmarine.se: did not receive HSTS header
-topnewstoday.org: could not connect to host
-topnotchendings.com: could not connect to host
-topnovini.com: did not receive HSTS header
-toppik.com.br: could not connect to host
-toppointrea.com: could not connect to host
-topsailtechnologies.com: could not connect to host
-topservercccam.com: did not receive HSTS header
-topshelfguild.com: could not connect to host
-topshoptools.com: could not connect to host
-topstore.me: could not connect to host
-topstore.ph: did not receive HSTS header
-toptenthebest.com: did not receive HSTS header
-topurls.tk: could not connect to host
-topvertimai.lt: could not connect to host
-topwin.la: could not connect to host
-topworktops.co.uk: did not receive HSTS header
-topyad.com: did not receive HSTS header
-topyx.com: did not receive HSTS header
-tor.us: did not receive HSTS header
-tor2web.org: could not connect to host
-torahanytime.com: did not receive HSTS header
-torbay.ga: could not connect to host
-torbe.es: did not receive HSTS header
-torchl.it: could not connect to host
-toretfaction.net: could not connect to host
-torg-room.ru: could not connect to host
-torkware.com: could not connect to host
-torlock.download: could not connect to host
-toronto-escorts.com: did not receive HSTS header
-torontonews.tk: could not connect to host
-torproject.org.uk: could not connect to host
-torproject.ovh: could not connect to host
-torquato.de: did not receive HSTS header
-torrentdownloads.bid: could not connect to host
-torrentgamesps2.info: could not connect to host
-torrentpier.me: did not receive HSTS header
-torrentz.website: could not connect to host
-torrentz2.al: could not connect to host
-torstensenf.de: could not connect to host
-tortocan.com: could not connect to host
-tortugalife.de: could not connect to host
-torv.rocks: did not receive HSTS header
-tosainu.com.br: could not connect to host
-tosamja.net: did not receive HSTS header
-tosecure.link: could not connect to host
-toshnix.com: could not connect to host
-toshub.com: could not connect to host
-toskana-appartement.de: did not receive HSTS header
-totalaccess.com.ua: could not connect to host
-totalbeauty.co.uk: did not receive HSTS header
-totaldragonshop.com.br: could not connect to host
-totalhomecareinc.com: could not connect to host
-totalle.com.br: could not connect to host
-totallynotaserver.com: could not connect to host
-totalpackers.com: did not receive HSTS header
-totalsystemcare.com: did not receive HSTS header
-totalworkout.fitness: did not receive HSTS header
-totch.de: could not connect to host
-totem-eshop.cz: could not connect to host
-totolabs.com: could not connect to host
-totoro.pub: could not connect to host
-totot.net: could not connect to host
-toucedo.de: could not connect to host
-touch-up-net.com: could not connect to host
-touchbasemail.com: did not receive HSTS header
-touchinformatica.com: did not receive HSTS header
-touchpointidg.us: could not connect to host
-touchscreen-handy.de: did not receive HSTS header
-touchstonefms.co.uk: did not receive HSTS header
-touchsupport.com: did not receive HSTS header
-touchtunesnz.com: did not receive HSTS header
-tougetu.com: could not connect to host
-touhou.cc: did not receive HSTS header
-touhou.tw: did not receive HSTS header
-tounyou-raku.com: could not connect to host
-touray-enterprise.ch: could not connect to host
-tourify.me: did not receive HSTS header
-tourispo.com: could not connect to host
-tourpeer.com: did not receive HSTS header
-toursandtransfers.it: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-toursinvietnam.tk: could not connect to host
-toursthatmatter.com: could not connect to host
-tourx.co.nz: did not receive HSTS header
-tousproducteurs.fr: could not connect to host
-toutenmusic.fr: could not connect to host
-towaway.ru: could not connect to host
-townhousedevelopments.com.au: did not receive HSTS header
-townofhulbertok.gov: did not receive HSTS header
-townofpolk-wi.gov: did not receive HSTS header
-townofruthnc.gov: did not receive HSTS header
-tox.im: did not receive HSTS header
-toxicboot.com: could not connect to host
-toxicip.com: could not connect to host
-toxme.se: did not receive HSTS header
-toymania.de: could not connect to host
-toyotamotala.se: could not connect to host
-tpansino.com: did not receive HSTS header
-tpbcdn.com: could not connect to host
-tpblist.xyz: could not connect to host
-tpbunblocked.org: could not connect to host
-tpci.biz: could not connect to host
-tpe-edu.com: could not connect to host
-tpms4u.at: could not connect to host
-tppdebate.org: did not receive HSTS header
-tpro.co.id: did not receive HSTS header
-tql.plus: could not connect to host
-tr0n.net: could not connect to host
-trabajarenperu.com: did not receive HSTS header
-trabajarenremoto.com: could not connect to host
-tracalada.cl: did not receive HSTS header
-tracelight.io: did not receive HSTS header
-tracemyplace.com: could not connect to host
-traces.ml: could not connect to host
-tracetracker.com: did not receive HSTS header
-track.plus: could not connect to host
-trackdays4fun.com: did not receive HSTS header
-trackdomains.com: could not connect to host
-tracker-gps.ch: could not connect to host
-trackfeed.tokyo: could not connect to host
-trackingstream.com: did not receive HSTS header
-trackmeet.io: did not receive HSTS header
-tracknerd.xyz: did not receive HSTS header
-tracksa.com.ar: could not connect to host
-tracktivity.com.au: could not connect to host
-trade-smart.ru: could not connect to host
-tradedesk.co.za: could not connect to host
-tradelogicintl.com: did not receive HSTS header
-trademan.ky: could not connect to host
-tradernet.com: did not receive HSTS header
-tradernet.ru: did not receive HSTS header
-tradeshowfreightservices.com: could not connect to host
-tradexport.com: did not receive HSTS header
-tradietrove.com.au: did not receive HSTS header
-trading-analytics.com: could not connect to host
-tradingbhavishya.com: did not receive HSTS header
-tradingcentre.com.au: could not connect to host
-tradinghope.com: could not connect to host
-tradingrooms.com: could not connect to host
-traditional-knowledge.tk: did not receive HSTS header
-traeningsprojekt.dk: did not receive HSTS header
-traffic.az: did not receive HSTS header
-trafficmgr.cn: could not connect to host
-trafficquality.org: could not connect to host
-traffictigers.com: did not receive HSTS header
-traforet.win: could not connect to host
-train-track.co.uk: did not receive HSTS header
-traindb.nl: did not receive HSTS header
-trainhorns.us: did not receive HSTS header
-training4girls.ru: could not connect to host
-trainingdigital.cl: did not receive HSTS header
-traininglist.org: could not connect to host
-trainingproviderresults.gov: could not connect to host
-trainings-handschuhe-test.de: could not connect to host
-trainline.cz: could not connect to host
-trainline.io: could not connect to host
-traintimes.ch: could not connect to host
-trainut.com: could not connect to host
-trakfusion.com: could not connect to host
-trakkr.tk: could not connect to host
-trance-heal.com: could not connect to host
-trance-heal.de: could not connect to host
-trance-heal.me: could not connect to host
-trance.im: did not receive HSTS header
-tranceheal.com: could not connect to host
-tranceheal.de: did not receive HSTS header
-tranceheal.me: could not connect to host
-trancendances.fr: could not connect to host
-tranglenull.xyz: could not connect to host
-tranos.de: could not connect to host
-tranquillapp.com: could not connect to host
-transbike.es: did not receive HSTS header
-transcendmotor.sg: could not connect to host
-transcricentro.pt: could not connect to host
-transcriptionwave.com: did not receive HSTS header
-transdirect.com.au: did not receive HSTS header
-transferio.nl: did not receive HSTS header
-transfile.fr: could not connect to host
-transformify.org: did not receive HSTS header
-transl8.eu: did not receive HSTS header
-translate-polish.com: did not receive HSTS header
-translate.googleapis.com: did not receive HSTS header (error ignored - included regardless)
-translateblender.ru: could not connect to host
-translatoruk.co.uk: did not receive HSTS header
-transmithe.net: could not connect to host
-transmitit.pl: could not connect to host
-transparent.cf: did not receive HSTS header
-transportal.sk: could not connect to host
-transsexualpantyhose.com: could not connect to host
-transverify.com: did not receive HSTS header
-trapkitchen.ml: could not connect to host
-tratamentoparacelulite.biz: could not connect to host
-trauertexte.info: could not connect to host
-traumhuetten.de: did not receive HSTS header
-travality.ru: could not connect to host
-travaux-toiture-idf.fr: could not connect to host
-travauxcontact.com: did not receive HSTS header
-travel-kuban.ru: did not receive HSTS header
-travel-to-nature.ch: did not receive HSTS header
-travel.co.za: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-travel1x1.com: did not receive HSTS header
-traveleets.com: could not connect to host
-travelholicworld.com: could not connect to host
-traveling-thailand.info: could not connect to host
-travelinghacker.com.au: could not connect to host
-travelinsightswriter.com: could not connect to host
-travelling.expert: could not connect to host
-travellsell.com: could not connect to host
-travelmyth.ie: did not receive HSTS header
-travelpricecheck.com: max-age too low: 0
-travisec.com: could not connect to host
-travotion.com: could not connect to host
-trazosdearte.com: did not receive HSTS header
-treasuredinheritanceministry.com: did not receive HSTS header
-treatment.org: could not connect to host
-treatprostatewithhifu.com: could not connect to host
-treebaglia.xyz: could not connect to host
-treeby.net: could not connect to host
-treeremovaljohannesburg.co.za: could not connect to host
-treeremovalsboksburg.co.za: did not receive HSTS header
-trees.chat: did not receive HSTS header
-treeschat.com: could not connect to host
-treino.blog.br: could not connect to host
-treinonerd.com: could not connect to host
-treker.us: could not connect to host
-trell.co.in: did not receive HSTS header
-tremoureux.fr: could not connect to host
-trendberry.ru: could not connect to host
-trendingpulse.com: did not receive HSTS header
-trendisland.de: did not receive HSTS header
-trendkraft.de: did not receive HSTS header
-trendyaccessoriesonline.com: could not connect to host
-trendydips.com: could not connect to host
-trentmaydew.com: did not receive HSTS header
-trenztec.ml: could not connect to host
-treussart.com: did not receive HSTS header
-trewe.eu: did not receive HSTS header
-trezy.me: could not connect to host
-trezy.net: could not connect to host
-triadwars.com: did not receive HSTS header
-triageo.com.au: could not connect to host
-trialmock.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-trianon.xyz: could not connect to host
-tribalwarsstyles.tk: could not connect to host
-tribistovo.tk: could not connect to host
-tributh.cf: could not connect to host
-tributh.ga: could not connect to host
-tributh.gq: could not connect to host
-tributh.ml: could not connect to host
-trichdanhay.com: did not receive HSTS header
-trickedguys.com: could not connect to host
-trickgsm.com: max-age too low: 0
-tricks.clothing: did not receive HSTS header
-triddi.com: could not connect to host
-tridentflood.com: did not receive HSTS header
-tridentmedia.gq: could not connect to host
-tridimage.com: did not receive HSTS header
-trik.es: could not connect to host
-trileg.net: could not connect to host
-trilex.be: did not receive HSTS header
-trilithsolutions.com: did not receive HSTS header
-trilon.eu: did not receive HSTS header
-trim21.cn: could not connect to host
-trimarchimanuele.it: did not receive HSTS header
-trinity.fr.eu.org: could not connect to host
-trinityaffirmations.com: max-age too low: 0
-trinitytechdev.com: could not connect to host
-trink-und-partyspiele.de: could not connect to host
-trior.net: did not receive HSTS header
-tripcombi.com: did not receive HSTS header
-tripdelta.com: did not receive HSTS header
-tripinsider.club: could not connect to host
-triple-mmm.de: max-age too low: 0
-triplicate.gq: could not connect to host
-tripout.tech: did not receive HSTS header
-tripp.xyz: did not receive HSTS header
-tripseats.com: did not receive HSTS header
-triri.org: did not receive HSTS header
-trisect.eu: could not connect to host
-trish-mcevoy.ru: could not connect to host
-trisportas.lt: did not receive HSTS header
-tristanberger.io: could not connect to host
-tristanfarkas.one: could not connect to host
-triticeaetoolbox.org: did not receive HSTS header
-trix.pw: did not receive HSTS header
-trixies-wish.nz: could not connect to host
-trixy.com.br: could not connect to host
-triz.co.uk: could not connect to host
-trizone.com.au: did not receive HSTS header
-trk1234.co.uk: did not receive HSTS header
-troedel-trolle.de: could not connect to host
-troisdorf-gestalten.de: did not receive HSTS header
-trollme.me: could not connect to host
-trollscave.xyz: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-tronatic-studio.com: could not connect to host
-trondelan.no: max-age too low: 0
-tronflix.com: did not receive HSTS header
-troo.ly: could not connect to host
-trotter.cf: could not connect to host
-trouble-free-employees.com: did not receive HSTS header
-trouter.io: could not connect to host
-trouver-son-chemin.com: could not connect to host
-troykelly.com: did not receive HSTS header
-trpa.gov: could not connect to host
-trpg.wiki: could not connect to host
-trucchibellezza.com: could not connect to host
-truckers-auction.jp: did not receive HSTS header
-truckerswereld.nl: did not receive HSTS header
-truckgpsreviews.com: did not receive HSTS header
-truckstop-magazin.de: could not connect to host
-true.ink: did not receive HSTS header
-trueassignmenthelp.co.uk: could not connect to host
-trueblueessentials.com: did not receive HSTS header
-trueessayhelp.co.uk: could not connect to host
-truejob.com: did not receive HSTS header
-truessl.shop: could not connect to host
-truestaradvisors.com: could not connect to host
-trufflemonkey.co.uk: could not connect to host
-truhlarstvi-fise.cz: could not connect to host
-trulance.com: did not receive HSTS header
-trumeet.top: did not receive HSTS header
-truncus-encephali.co.uk: could not connect to host
-trunkjunk.co: could not connect to host
-trush.in: did not receive HSTS header
-trustedbody.com: did not receive HSTS header
-trustedinnovators.com: could not connect to host
-trustednewssites.com: could not connect to host
-trusteecar.com: did not receive HSTS header
-trustees.org: did not receive HSTS header
-trustmeimfancy.com: could not connect to host
-trustocean.com: did not receive HSTS header
-truthsayer.tk: could not connect to host
-trybabyschoice.com: could not connect to host
-trybind.com: could not connect to host
-tryfabulousdiet.com: could not connect to host
-tryfabulousskincream.com: could not connect to host
-tryfabulousskinserum.com: could not connect to host
-tryfm.net: did not receive HSTS header
-trygarciniaslimdiet.com: could not connect to host
-tryingtotakeovertheworld.tk: could not connect to host
-trymegadrol.com: could not connect to host
-trynowrinkleseyeserum.com: could not connect to host
-tryoneday.co: did not receive HSTS header
-trypineapple.com: could not connect to host
-trywesayyes.com: could not connect to host
-ts-publishers.com: could not connect to host
-ts2.se: could not connect to host
-ts3-dns.com: could not connect to host
-ts3-dns.me: could not connect to host
-ts3-dns.net: could not connect to host
-ts3-legenda.tech: could not connect to host
-ts3.consulting: could not connect to host
-tsachs.eu: could not connect to host
-tsaro.io: could not connect to host
-tscqmalawi.info: could not connect to host
-tsdom.net: could not connect to host
-tsecy.com: could not connect to host
-tsgbit.net: could not connect to host
-tsgoc.com: did not receive HSTS header
-tshirtscapetown.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-tsigaradiko.com: could not connect to host
-tsrstore.gq: could not connect to host
-tsu-ku-ro.com: could not connect to host
-tsugi.fr: did not receive HSTS header
-tsukeawase.com: did not receive HSTS header
-tsukuba.style: could not connect to host
-tsumegumi.net: could not connect to host
-tsumi.moe: could not connect to host
-tsung.co: did not receive HSTS header
-tsura.org: could not connect to host
-tsurezurematome.ga: could not connect to host
-tsurimap.com: could not connect to host
-tsutsumi-kogyo.jp: could not connect to host
-tsuyuzakihiroyuki.com: could not connect to host
-tt3666.com: could not connect to host
-tt5197.co: could not connect to host
-tt6396.com: did not receive HSTS header
-tt6729.co: could not connect to host
-tt6729.com: did not receive HSTS header
-tt6957.co: could not connect to host
-tt9297.co: could not connect to host
-tt9397.com: could not connect to host
-tt9721.com: could not connect to host
-tt9728.co: could not connect to host
-ttackmedical.com.br: could not connect to host
-ttchan.org: could not connect to host
-ttfin.ch: could not connect to host
-ttll.de: did not receive HSTS header
-ttrade.ga: could not connect to host
-tts.co.nz: did not receive HSTS header
-ttspttsp.com: could not connect to host
-ttt.tt: could not connect to host
-tty.space: could not connect to host
-ttyystudio.com: could not connect to host
-ttz.im: could not connect to host
-tuamoronline.com: could not connect to host
-tuang-tuang.com: could not connect to host
-tubeju.com: could not connect to host
-tubetoon.com: could not connect to host
-tubetooncartoons.com: could not connect to host
-tubex.ga: could not connect to host
-tucidi.net: could not connect to host
-tucker.wales: could not connect to host
-tucnak.eu: could not connect to host
-tucsonpcrepair.com: could not connect to host
-tudorapido.com.br: could not connect to host
-tudorproject.org: could not connect to host
-tueche.com.ar: did not receive HSTS header
-tueplay.host: could not connect to host
-tufashionista.com: did not receive HSTS header
-tufilo.com: could not connect to host
-tugers.com: did not receive HSTS header
-tugesha.com: could not connect to host
-tuingresoonline.com: could not connect to host
-tula-city.tk: could not connect to host
-tula-news.ga: could not connect to host
-tulasdeportivasbless.com: did not receive HSTS header
-tulpan22.ru: did not receive HSTS header
-tulsameetingroom.com: could not connect to host
-tumelum.de: could not connect to host
-tumutanzi.com: did not receive HSTS header
-tunai.id: did not receive HSTS header
-tunaut.com: could not connect to host
-tunca.it: did not receive HSTS header
-tunebitfm.de: could not connect to host
-tunisiapress.tk: could not connect to host
-tunity.be: did not receive HSTS header
-tunochebuena.com: could not connect to host
-tuotteet.org: could not connect to host
-tuou.xyz: could not connect to host
-turciya.cf: could not connect to host
-turingmind.com: did not receive HSTS header
-turismo.cl: did not receive HSTS header
-turkey-portal.tk: could not connect to host
-turkface.tk: could not connect to host
-turkiet.guide: could not connect to host
-turkiyen.com: could not connect to host
-turkmannews.tk: could not connect to host
-turn-sticks.com: could not connect to host
-turnik-67.ru: could not connect to host
-turniker.ru: could not connect to host
-turnsticks.com: could not connect to host
-turtle.ai: did not receive HSTS header
-turtlehead.tk: could not connect to host
-turtlementors.com: could not connect to host
-turtles.ga: could not connect to host
-tusb.ml: did not receive HSTS header
-tusksol.com: could not connect to host
-tussengelegenwoningverkopen.nl: could not connect to host
-tuthowto.com: could not connect to host
-tutiendaroja.com: could not connect to host
-tutiendarosa.com: could not connect to host
-tutoref.com: did not receive HSTS header
-tutorialcoding.tk: could not connect to host
-tutorio.ga: could not connect to host
-tutu.ro: could not connect to host
-tuturulianda.com: could not connect to host
-tuvalie.com: could not connect to host
-tuvangoicuoc.com: did not receive HSTS header
-tuversionplus.com: could not connect to host
-tuxcloud.net: could not connect to host
-tuxhound.org: could not connect to host
-tuxpeliculas.com: could not connect to host
-tuxrtfm.com: could not connect to host
-tv.search.yahoo.com: could not connect to host
-tvbeugels.nl: did not receive HSTS header
-tvc.red: could not connect to host
-tvcal.net: could not connect to host
-tverdohleb.com: did not receive HSTS header
-tverskaya-outlet.ru: could not connect to host
-tvoia-dietka.tk: could not connect to host
-tvoru.com.ua: did not receive HSTS header
-tvqc.com: did not receive HSTS header
-tvtubeflix.com: could not connect to host
-tvz-materijali.com: could not connect to host
-tw-hosting.de: did not receive HSTS header
-tw2-tools.ga: could not connect to host
-twarog.cc: could not connect to host
-tweakersbadge.nl: could not connect to host
-twee-onder-een-kap-woning-in-alphen-aan-den-rijn-kopen.nl: could not connect to host
-twee-onder-een-kap-woning-in-brielle-kopen.nl: could not connect to host
-twee-onder-een-kap-woning-in-de-friese-meren-kopen.nl: could not connect to host
-twee-onder-een-kap-woning-in-delfzijl-kopen.nl: could not connect to host
-twee-onder-een-kap-woning-in-leeuwarden-kopen.nl: could not connect to host
-twee-onder-een-kap-woning-in-pekela-kopen.nl: could not connect to host
-twee-onder-een-kap-woning-in-rijnwaarden-kopen.nl: could not connect to host
-twee-onder-een-kap-woning-in-sudwest-fryslan-kopen.nl: could not connect to host
-twee-onder-een-kap-woning-in-veendam-kopen.nl: could not connect to host
-twee-onder-een-kap-woning-in-zuidplas-kopen.nl: could not connect to host
-twee-onder-een-kap-woning-in-zwartewaterland-kopen.nl: could not connect to host
-tweedehandslaptophardenberg.nl: could not connect to host
-tweeondereenkapverkopen.nl: could not connect to host
-tweeondereenkapwoningverkopen.nl: could not connect to host
-tweetfinity.com: could not connect to host
-tweetfinityapp.com: could not connect to host
-tweetify.io: could not connect to host
-twelve.rocks: could not connect to host
-twelve.today: could not connect to host
-twelverocks.com: could not connect to host
-twem.ddns.net: could not connect to host
-twentymilliseconds.com: did not receive HSTS header
-twilightcookies.ca: could not connect to host
-twillionmas.com: could not connect to host
-twin-tails.xyz: could not connect to host
-twinkieman.com: could not connect to host
-twinkietotmom.com: did not receive HSTS header
-twinkseason.ca: could not connect to host
-twinkseason.co: could not connect to host
-twinkseason.co.uk: could not connect to host
-twinkseason.net: could not connect to host
-twinkseason.org: could not connect to host
-twinkseason.xyz: could not connect to host
-twiri.net: could not connect to host
-twist.party: could not connect to host
-twistapp.com: did not receive HSTS header
-twistertoneel.nl: did not receive HSTS header
-twistopay.com: did not receive HSTS header
-twittelzie.nl: could not connect to host
-twitter.ax: could not connect to host
-twocornertiming.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-twodadsgames.com: could not connect to host
-twogo.com: did not receive HSTS header
-twojfaktum.pl: could not connect to host
-twolanedesign.com: could not connect to host
-twolinepassbrewing.com: could not connect to host
-twolivelife.com: could not connect to host
-twotube.ie: could not connect to host
-twtimmy.com: could not connect to host
-twtremind.com: could not connect to host
-twun.io: could not connect to host
-twuni.org: did not receive HSTS header
-tx041cap.org: could not connect to host
-txbi.de: could not connect to host
-txclimbers.com: could not connect to host
-txcp01.com: could not connect to host
-txcp02.com: could not connect to host
-txf.pw: could not connect to host
-txpi.nsupdate.info: could not connect to host
-ty513.com: could not connect to host
-ty525.com: could not connect to host
-ty529.com: could not connect to host
-ty561.com: could not connect to host
-ty562.com: could not connect to host
-ty573.com: could not connect to host
-ty583.com: could not connect to host
-ty587.com: could not connect to host
-ty593.com: could not connect to host
-ty5998.com: could not connect to host
-ty613.com: could not connect to host
-ty632.com: could not connect to host
-ty637.com: could not connect to host
-ty650.com: could not connect to host
-ty679.com: could not connect to host
-ty705.com: could not connect to host
-ty715.com: could not connect to host
-ty716.com: could not connect to host
-ty723.com: could not connect to host
-ty736.com: could not connect to host
-ty737.com: could not connect to host
-ty739.com: could not connect to host
-ty750.com: could not connect to host
-ty756.com: could not connect to host
-ty767.com: could not connect to host
-ty783.com: could not connect to host
-ty785.com: could not connect to host
-ty791.com: could not connect to host
-ty793.com: could not connect to host
-ty812.com: could not connect to host
-ty835.com: could not connect to host
-ty853.com: could not connect to host
-ty857.com: could not connect to host
-ty927.com: could not connect to host
-ty935.com: could not connect to host
-ty937.com: could not connect to host
-ty953.com: could not connect to host
-ty962.com: could not connect to host
-ty965.com: could not connect to host
-ty980.com: could not connect to host
-tycjt.vip: could not connect to host
-tykoon.com: could not connect to host
-tyl.io: did not receive HSTS header
-tyler.coach: could not connect to host
-tylercoach.com: could not connect to host
-tylerharcourt.ca: did not receive HSTS header
-tylerharcourt.com: could not connect to host
-tylerharcourt.net: could not connect to host
-tylerharcourt.xyz: could not connect to host
-tylerjharcourt.com: could not connect to host
-tylervigario.com: did not receive HSTS header
-tylian.net: max-age too low: 0
-tylyjj.com: max-age too low: 0
-typcn.com: did not receive HSTS header
-type1joe.com: could not connect to host
-type1joe.net: could not connect to host
-type1joe.org: could not connect to host
-typehub.net: could not connect to host
-typeofweb.com: did not receive HSTS header
-typeonejoe.net: could not connect to host
-typeonejoe.org: could not connect to host
-typeria.net: could not connect to host
-typingrevolution.com: could not connect to host
-tyree.tech: could not connect to host
-tyreis.com: could not connect to host
-tyrelius.com: could not connect to host
-tyroproducts.eu: did not receive HSTS header
-tyskland.guide: could not connect to host
-tyumen.ga: could not connect to host
-tzappa.net: could not connect to host
-tzifas.com: could not connect to host
-tziyona.net: could not connect to host
-tzsec.com: could not connect to host
-tzwe.com: could not connect to host
-u-master.net: did not receive HSTS header
-u-metals.com: did not receive HSTS header
-u-tokyo.club: did not receive HSTS header
-u0010.com: could not connect to host
-u0020.com: could not connect to host
-u0050.com: could not connect to host
-u0060.com: could not connect to host
-u0070.com: could not connect to host
-u0080.com: could not connect to host
-u0090.com: could not connect to host
-u1100.com: could not connect to host
-u1144.com: could not connect to host
-u175.com: could not connect to host
-u17go.com: max-age too low: 2592000
-u2fanlife.com: could not connect to host
-u30365.com: could not connect to host
-u5197.co: could not connect to host
-u6729.co: could not connect to host
-u6729.com: did not receive HSTS header
-u6957.co: could not connect to host
-u6957.com: did not receive HSTS header
-u9297.co: could not connect to host
-u9397.com: could not connect to host
-u9721.com: could not connect to host
-u9728.co: could not connect to host
-uachemlabs.com: could not connect to host
-uaci.edu.mx: could not connect to host
-uadp.pw: could not connect to host
-uahs.org.uk: did not receive HSTS header
-uareferat.tk: could not connect to host
-ubalert.com: did not receive HSTS header
-uber.com.au: could not connect to host
-uberactivist.com: could not connect to host
-uberbkk.com: did not receive HSTS header
-ubercalculator.com: did not receive HSTS header
-uberfunction.com: did not receive HSTS header
-uberhorny.tk: could not connect to host
-uberifix.ca: could not connect to host
-ubi.gg: could not connect to host
-ubicloud.de: did not receive HSTS header
-ubicv.com: could not connect to host
-ubis.group: could not connect to host
-ublox.com: did not receive HSTS header
-ubntleaks.com: could not connect to host
-uborcare.com: could not connect to host
-uborka-kvartir-moskva.gq: could not connect to host
-ubstudygroups.com: did not receive HSTS header
-ubstudygroups.org: did not receive HSTS header
-ubtce.com: could not connect to host
-ubun.net: could not connect to host
-ubuntuhot.com: did not receive HSTS header
-uc.ac.id: did not receive HSTS header
-uchiha.ml: did not receive HSTS header
-uclanmasterplan.co.uk: did not receive HSTS header
-uclip.club: could not connect to host
-ucmatedeveloper.gq: could not connect to host
-udbina.tk: could not connect to host
-uddate-linthdcp-3345app.com: did not receive HSTS header
-uddate-linthdcp-567app.com: could not connect to host
-uddhabhaldar.com: did not receive HSTS header
-udsocial.com: could not connect to host
-udvalgte-ordsprog.dk: did not receive HSTS header
-ueba1085.jp: could not connect to host
-uefeng.com: did not receive HSTS header
-uega.net: did not receive HSTS header
-uel-thompson-okanagan.ca: could not connect to host
-uerdingen.info: did not receive HSTS header
-uesociedadlimitada.com: could not connect to host
-ueu.me: could not connect to host
-uex.im: could not connect to host
-ufgaming.com: did not receive HSTS header
-uflixit.com: did not receive HSTS header
-ufo.moe: did not receive HSTS header
-ufotable.uk: could not connect to host
-ugcdn.com: could not connect to host
-ugisgutless.com: could not connect to host
-ugo.ninja: could not connect to host
-ugosadventures.com: did not receive HSTS header
-ugtdigiteldocumentos.es: could not connect to host
-uhappy1.com: could not connect to host
-uhappy11.com: could not connect to host
-uhappy2.com: could not connect to host
-uhappy21.com: could not connect to host
-uhappy22.com: could not connect to host
-uhappy23.com: could not connect to host
-uhappy24.com: could not connect to host
-uhappy25.com: could not connect to host
-uhappy26.com: could not connect to host
-uhappy27.com: could not connect to host
-uhappy28.com: could not connect to host
-uhappy29.com: could not connect to host
-uhappy3.com: could not connect to host
-uhappy30.com: could not connect to host
-uhappy31.com: could not connect to host
-uhappy33.com: could not connect to host
-uhappy50.com: could not connect to host
-uhappy55.com: could not connect to host
-uhappy56.com: did not receive HSTS header
-uhappy57.com: did not receive HSTS header
-uhappy58.com: did not receive HSTS header
-uhappy59.com: did not receive HSTS header
-uhappy6.com: could not connect to host
-uhappy60.com: could not connect to host
-uhappy61.com: could not connect to host
-uhappy62.com: could not connect to host
-uhappy66.com: could not connect to host
-uhappy67.com: could not connect to host
-uhappy69.com: could not connect to host
-uhappy70.com: could not connect to host
-uhappy71.com: could not connect to host
-uhappy72.com: could not connect to host
-uhappy73.com: did not receive HSTS header
-uhappy74.com: did not receive HSTS header
-uhappy75.com: did not receive HSTS header
-uhappy76.com: did not receive HSTS header
-uhappy77.com: could not connect to host
-uhappy78.com: did not receive HSTS header
-uhappy79.com: did not receive HSTS header
-uhappy8.com: could not connect to host
-uhappy80.com: did not receive HSTS header
-uhappy81.com: could not connect to host
-uhappy82.com: could not connect to host
-uhappy83.com: did not receive HSTS header
-uhappy85.com: did not receive HSTS header
-uhappy86.com: did not receive HSTS header
-uhappy88.com: could not connect to host
-uhappy9.com: could not connect to host
-uhappy90.com: did not receive HSTS header
-uhappy99.com: could not connect to host
-uhasseltctf.be: could not connect to host
-uhasseltctf.ga: could not connect to host
-uhasseltodin.be: could not connect to host
-uhm.io: did not receive HSTS header
-uhssl.com: could not connect to host
-uhurl.net: could not connect to host
-uhuru-market.com: did not receive HSTS header
-uitslagensoftware.nl: did not receive HSTS header
-uitvaartvrouwenfriesland.nl: could not connect to host
-uitvaartzorg-heerenveen.nl: could not connect to host
-uitvaartzorgzuidwestfriesland.nl: could not connect to host
-ukari.hokkaido.jp: could not connect to host
-ukclimbing.com: did not receive HSTS header
-ukdropshipment.co.uk: did not receive HSTS header
-ukdropshipment.com: did not receive HSTS header
-ukk.dk: did not receive HSTS header
-ukkeyholdingcompany.co.uk: could not connect to host
-ukmortgagecompare.co.uk: could not connect to host
-ukrgadget.com: could not connect to host
-ulabox.cat: did not receive HSTS header
-ulabox.es: did not receive HSTS header
-ulalau.com: did not receive HSTS header
-ulgc.cz: could not connect to host
-ulickaprozivot.cz: could not connect to host
-ullamodaintima.com.br: could not connect to host
-ulmo.dk: could not connect to host
-ulotnefoto.pl: did not receive HSTS header
-ulovdomov.cz: did not receive HSTS header
-ulsters.cf: could not connect to host
-ulti.gq: could not connect to host
-ultieme.be: could not connect to host
-ultimate-garcinia-plus.com: could not connect to host
-ultimate-glow-skin.com: could not connect to host
-ultimate-memoryplus.com: could not connect to host
-ultimate-neuroplus.com: could not connect to host
-ultrasite.tk: could not connect to host
-ultrasteam.net: could not connect to host
-ultratech.software: did not receive HSTS header
-ultrixus.rocks: could not connect to host
-ultros.io: did not receive HSTS header
-uma.vn: did not receive HSTS header
-umaimise.info: did not receive HSTS header
-umassfive.coop: did not receive HSTS header
-umbrellaye.online: could not connect to host
-umbriel.fr: did not receive HSTS header
-umgardi.ca: could not connect to host
-umidev.com: could not connect to host
-umie.cc: did not receive HSTS header
-umkmjogja.com: did not receive HSTS header
-ump45.moe: could not connect to host
-umsolugar.com.br: could not connect to host
-umwandeln-online.de: could not connect to host
-umzug-berlin24.de: did not receive HSTS header
-un.pe: did not receive HSTS header
-unapolegetic.co: did not receive HSTS header
-unart.info: could not connect to host
-unasim.gq: could not connect to host
-unatco.noip.me: could not connect to host
-unbanthe.net: could not connect to host
-unbelievableplaces.de: could not connect to host
-unblockall.xyz: could not connect to host
-unblockat.tk: could not connect to host
-unblocked-networks.org: could not connect to host
-unblocked.blue: could not connect to host
-unblocked.cx: could not connect to host
-unblocked.date: could not connect to host
-unblocked.faith: could not connect to host
-unblocked.host: did not receive HSTS header
-unblocked.lat: could not connect to host
-unblocked.party: could not connect to host
-unblocked.st: could not connect to host
-unblocked.today: could not connect to host
-unblocked.works: could not connect to host
-unblockedall.site: could not connect to host
-unblockedbay.info: could not connect to host
-unblockerproxy.site: could not connect to host
-unblockerproxy.top: could not connect to host
-unblockmy.party: could not connect to host
-unblockmy.tech: could not connect to host
-unblockmy.xyz: could not connect to host
-unblockmyproxy.site: could not connect to host
-unblockthe.site: could not connect to host
-unblockthe.top: could not connect to host
-unblockweb.co: could not connect to host
-unccdesign.club: could not connect to host
-unclegen.xyz: could not connect to host
-undeadbrains.de: could not connect to host
-under30stravelinsurance.com.au: did not receive HSTS header
-undercovercondoms.co.uk: did not receive HSTS header
-underkin.com: could not connect to host
-underskatten.tk: could not connect to host
-undo.co.il: could not connect to host
-undone.me: could not connect to host
-unfiltered.nyc: could not connect to host
-ungeek.eu: did not receive HSTS header
-ungeek.fr: max-age too low: 2592000
-ungelektro.no: did not receive HSTS header
-ungern.guide: could not connect to host
-unhu.fr: could not connect to host
-unhurriedluxury.com: could not connect to host
-uni-games.com: could not connect to host
-uni2share.com: could not connect to host
-uniaofraternalraulcury.com.br: max-age too low: 0
-unibolsit.com: could not connect to host
-unicefcards.at: did not receive HSTS header
-unicefcards.cz: could not connect to host
-unicefcards.gr: could not connect to host
-unicefcards.sk: could not connect to host
-unicefkaarten.be: did not receive HSTS header
-unicefkepeslapok.hu: could not connect to host
-unicefkort.dk: did not receive HSTS header
-unicefvoscilnice.si: could not connect to host
-unicioushop.com: could not connect to host
-unicmotos.com: could not connect to host
-unicode.gq: could not connect to host
-unicooo.com: could not connect to host
-unicorn.li: could not connect to host
-unicorncloud.org: could not connect to host
-unifei.edu.br: did not receive HSTS header
-unifiednetwork.me: could not connect to host
-uniformebateriasheliar.com.br: could not connect to host
-uniformecomgas.com.br: could not connect to host
-uniformehope.com.br: could not connect to host
-uniformehumboldt.com.br: did not receive HSTS header
-uniformespousoalegre.com.br: could not connect to host
-unikitty-on-tour.com: could not connect to host
-uninet.cf: did not receive HSTS header
-uniojeda.ml: could not connect to host
-unionstationapp.com: could not connect to host
-unique-bouncy-castles.co.uk: could not connect to host
-unirenter.ru: did not receive HSTS header
-unison.com: did not receive HSTS header
-unisyssecurity.com: could not connect to host
-united-german-commander.de: did not receive HSTS header
-united-schools.net: could not connect to host
-unitedcyberdevelopment.com: could not connect to host
-unitlabs.net: could not connect to host
-unitrade-425.co.za: did not receive HSTS header
-univerkeys.com: could not connect to host
-univerpack.net: could not connect to host
-universal-happiness.com: could not connect to host
-universalpaymentgateway.com: could not connect to host
-universidadcatolica.tk: could not connect to host
-universidadvg.edu.mx: could not connect to host
-university4industry.com: did not receive HSTS header
-universityhousemates.co.uk: could not connect to host
-universityhousemates.uk: could not connect to host
-universocaballo.top: could not connect to host
-univstore.win: could not connect to host
-univz.com: could not connect to host
-unixapp.ml: could not connect to host
-unixtime.pro: could not connect to host
-unknownbreakup.com: max-age too low: 2592000
-unknownphenomena.net: could not connect to host
-unleash.pw: could not connect to host
-unlogis.ch: could not connect to host
-unmanaged.space: did not receive HSTS header
-unobrindes.com.br: did not receive HSTS header
-unplugg3r.dk: could not connect to host
-unravel.ie: could not connect to host
-unripple.com: could not connect to host
-unruh.fr: did not receive HSTS header
-uns.ac.id: did not receive HSTS header
-unsacsurledos.com: did not receive HSTS header
-unschoolrules.com: did not receive HSTS header
-unsee.cc: did not receive HSTS header
-unsereins.me: did not receive HSTS header
-unstable.network: could not connect to host
-unstockd.org: could not connect to host
-unsupervised.ca: did not receive HSTS header
-unsystem.net: could not connect to host
-untaianelena.com: did not receive HSTS header
-unterkunft.guru: did not receive HSTS header
-unterschicht.tv: could not connect to host
-unti.me: could not connect to host
-untoldstory.eu: did not receive HSTS header
-unun.fi: did not receive HSTS header
-unwiredbrain.com: could not connect to host
-unwomen.is: did not receive HSTS header
-unworthy.ml: could not connect to host
-unyq.me: did not receive HSTS header
-uonstaffhub.com: could not connect to host
-uoone.com: could not connect to host
-uow.ninja: could not connect to host
-up1.ca: could not connect to host
-upaknship.com: did not receive HSTS header
-upandclear.org: max-age too low: 0
-upboard.jp: could not connect to host
-upcloud.cz: could not connect to host
-update-linthdcp-567app1.com: did not receive HSTS header
-updatehub.io: did not receive HSTS header
-upldr.pw: did not receive HSTS header
-uplinkgame.tk: could not connect to host
-uploadbro.com: could not connect to host
-upmchealthsecurity.us: could not connect to host
-upnext.io: could not connect to host
-upnorthproperty.com: did not receive HSTS header
-uporoops.com: could not connect to host
-uppfinnarenc.tk: could not connect to host
-upplay.com.br: did not receive HSTS header
-upr-info.org: did not receive HSTS header
-upr.com.ua: could not connect to host
-uprotect.it: could not connect to host
-upsettunnel.com: could not connect to host
-upstats.eu: could not connect to host
-uptakedigital.com.au: max-age too low: 2592000
-uptic.net: did not receive HSTS header
-uptimed.com: did not receive HSTS header
-uptimenotguaranteed.com: could not connect to host
-uptogood.org: did not receive HSTS header
-upupming.site: did not receive HSTS header
-upwardtraining.co.uk: could not connect to host
-upyourfinances.com: could not connect to host
-urantiabookstudygroup.com: did not receive HSTS header
-urantiabookstudygroup.org: did not receive HSTS header
-urantiabookstudygroups.com: did not receive HSTS header
-urantiabookstudygroups.org: did not receive HSTS header
-urantiastudygroup.org: did not receive HSTS header
-urantiastudygroups.com: did not receive HSTS header
-urantiastudygroups.org: did not receive HSTS header
-urban-garden.lt: could not connect to host
-urban-garden.lv: could not connect to host
-urbandance.club: did not receive HSTS header
-urbane-london.com: did not receive HSTS header
-urbanmelbourne.info: could not connect to host
-urbanmic.com: could not connect to host
-urbansparrow.in: could not connect to host
-urbanstylestaging.com: could not connect to host
-urbansurvival.com: max-age too low: 7776000
-urbanxhome.com: did not receive HSTS header
-urbpic.com: could not connect to host
-urgences-valais.ch: could not connect to host
-urinedrugtesthq.com: did not receive HSTS header
-urion.com.br: did not receive HSTS header
-uriport.com: could not connect to host
-uriports.com: did not receive HSTS header
-url.cab: did not receive HSTS header
-url0.eu: did not receive HSTS header
-urlachershop.com.br: did not receive HSTS header
-urlaubstipps.eu: could not connect to host
-urlchomp.com: did not receive HSTS header
-urltell.com: could not connect to host
-urmom.lol: did not receive HSTS header
-urology.wiki: did not receive HSTS header
-uronlinestreams.ga: could not connect to host
-urphp.com: could not connect to host
-us-immigration.com: did not receive HSTS header
-usa-10.com: could not connect to host
-usa-10.net: could not connect to host
-usa10sb.com: did not receive HSTS header
-usa250.gov: max-age too low: 300
-usaab.org: did not receive HSTS header
-usacitygames.org: did not receive HSTS header
-usadba.net.ru: could not connect to host
-usafuelservice.com: did not receive HSTS header
-usairlines.us: did not receive HSTS header
-usatomotori.com: did not receive HSTS header
-usbcraft.com: could not connect to host
-usbcurrent.com: did not receive HSTS header
-usbirthcertificate.com: could not connect to host
-usbr.gov: could not connect to host
-usbtypeccompliant.com: could not connect to host
-uscitizenship.info: did not receive HSTS header
-uscntalk.com: could not connect to host
-uscp8.com: could not connect to host
-usdfc.gov: did not receive HSTS header
-usdoscloud.gov: could not connect to host
-use.ci: could not connect to host
-used-in.jp: could not connect to host
-usedesk.ru: did not receive HSTS header
-usedoor.jp: did not receive HSTS header
-useevlo.com.br: could not connect to host
-usemusic.com.br: did not receive HSTS header
-user-agent.ga: could not connect to host
-user-new.com: did not receive HSTS header
-user-re.com: did not receive HSTS header
-usercare.com: could not connect to host
-usercompare.tk: could not connect to host
-useresponse.com: did not receive HSTS header
-userify.com: did not receive HSTS header
-userra.gov: could not connect to host
-usidfc.gov: did not receive HSTS header
-uslab.io: could not connect to host
-usleep.net: could not connect to host
-usmint.gov: max-age too low: 120
-usparklodging.com: did not receive HSTS header
-uspesnyprvnacek-staging.herokuapp.com: could not connect to host
-usportsgo.com: could not connect to host
-uspsoig.gov: did not receive HSTS header
-usr.nz: did not receive HSTS header
-ussemiquincentennial.gov: max-age too low: 300
-ust.space: did not receive HSTS header
-usu.org.ua: could not connect to host
-usuluddin.ga: could not connect to host
-ut-addicted.com: did not receive HSTS header
-utahfireinfo.gov: did not receive HSTS header
-utahlocal.net: did not receive HSTS header
-utbosbeekhuuske.tk: could not connect to host
-utdscanner.com: did not receive HSTS header
-uteam.it: could not connect to host
-utilitronium-shockwave.com: could not connect to host
-utilityreport.eu: did not receive HSTS header
-utitreatment.com: did not receive HSTS header
-utleieplassen.no: did not receive HSTS header
-utopiagalaxy.space: could not connect to host
-utopialgb.org.uk: could not connect to host
-utopian-surgery.com: could not connect to host
-utopianconcept.com: did not receive HSTS header
-utopians.dk: could not connect to host
-utorg.com.ua: could not connect to host
-uttnetgroup.fr: did not receive HSTS header
-utube.tw: could not connect to host
-utumno.ch: could not connect to host
-utvbloggen.se: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-uu5197.co: could not connect to host
-uu6729.co: could not connect to host
-uu6729.com: did not receive HSTS header
-uu6957.co: could not connect to host
-uu9297.co: could not connect to host
-uu9397.com: could not connect to host
-uu9721.com: could not connect to host
-uu9728.co: could not connect to host
-uuid.cf: did not receive HSTS header
-uuid.fr: did not receive HSTS header
-uvarov.pw: could not connect to host
-uvolejniku.cz: did not receive HSTS header
-uw1008.com: could not connect to host
-uw2333.com: could not connect to host
-uwe.wtf: did not receive HSTS header
-uwekoetter.com: did not receive HSTS header
-uwesander.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-uwfreelanceopticien.nl: could not connect to host
-uwimonacs.org.jm: did not receive HSTS header
-uwstartups.com: could not connect to host
-uxtechnologist.com: did not receive HSTS header
-uxux.pl: could not connect to host
-uygindir.ml: could not connect to host
-uyku-apnesi.com: did not receive HSTS header
-uyym.com: did not receive HSTS header
-uziregister.nl: did not receive HSTS header
-uzmandroid.com: did not receive HSTS header
-uzmandroid.net: could not connect to host
-uzmandroid.top: could not connect to host
-v-desk.ga: could not connect to host
-v-u-z.ru: could not connect to host
-v0rtex.xyz: could not connect to host
-v0tti.com: could not connect to host
-v12.co.uk: did not receive HSTS header
-v2.pw: did not receive HSTS header
-v2bv.win: could not connect to host
-v2ex.us: could not connect to host
-v2ray6.com: could not connect to host
-v2ray66.com: could not connect to host
-v2ray666.com: could not connect to host
-v30365.com: could not connect to host
-v4s.ro: could not connect to host
-v4veedu.com: could not connect to host
-v5197.co: could not connect to host
-v5ray.top: could not connect to host
-v5ray.xyz: did not receive HSTS header
-v5wz.com: did not receive HSTS header
-v5xp.com: did not receive HSTS header
-v6729.co: could not connect to host
-v6957.co: could not connect to host
-v7.cl: could not connect to host
-v789xl.com: could not connect to host
-v800a.com: did not receive HSTS header
-v800g.com: could not connect to host
-v9297.co: could not connect to host
-v9728.co: could not connect to host
-v9728.com: could not connect to host
-v9820.com: could not connect to host
-vaaddress.co: could not connect to host
-vaalmarketplace.co.za: did not receive HSTS header
-vacationality.com: could not connect to host
-vacationfund.co: could not connect to host
-vacationscostarica.com: did not receive HSTS header
-vaccines.gov: did not receive HSTS header
-vackerbetong.se: could not connect to host
-vaclavambroz.cz: did not receive HSTS header
-vaclavambroz.eu: could not connect to host
-vacuumreviewcenter.com: did not receive HSTS header
-vaddder.com: could not connect to host
-vadennissanofhinesvilleparts.com: could not connect to host
-vadik.me: could not connect to host
-vadodesign.nl: could not connect to host
-vagrantbits.com: could not connect to host
-vaibhavchatarkar.com: could not connect to host
-vaincreladyslexie.com: did not receive HSTS header
-vaisselle-nature.fr: did not receive HSTS header
-val-sec.com: could not connect to host
-valaeris.de: did not receive HSTS header
-valbonne-consulting.com: did not receive HSTS header
-valcano-krd.ru: could not connect to host
-valcano.ru: could not connect to host
-valcardiesel.com: could not connect to host
-valecnatechnika.cz: could not connect to host
-valenhub.com: could not connect to host
-valenhub.es: could not connect to host
-valenscaelum.com: could not connect to host
-valentin-dederer.de: could not connect to host
-valentin-ochs.de: could not connect to host
-valentin-sundermann.de: did not receive HSTS header
-valentineapparel.com: could not connect to host
-valentinera.in: did not receive HSTS header
-valeo-it.de: did not receive HSTS header
-valeravi.tk: could not connect to host
-valethound.com: could not connect to host
-valhallacostarica.com: could not connect to host
-valhallamovement.com: did not receive HSTS header
-validatis.com: could not connect to host
-valitron.se: did not receive HSTS header
-valkor.pro: could not connect to host
-valkyrja.xyz: could not connect to host
-valleyridgepta.org: could not connect to host
-valleyshop.ca: could not connect to host
-vallis.net: did not receive HSTS header
-valmagus.com: could not connect to host
-valopv.be: could not connect to host
-valshamar.is: could not connect to host
-valtoaho.com: could not connect to host
-valuechain.me: could not connect to host
-valueofblog.com: could not connect to host
-vamoaeturismo.com.br: could not connect to host
-vamosfalardesaude.pt: could not connect to host
-vampirism.eu: did not receive HSTS header
-vanacht.co.za: did not receive HSTS header
-vanagamsanthai.com: did not receive HSTS header
-vanagamseeds.com: did not receive HSTS header
-vanajahosting.com: did not receive HSTS header
-vanderkroon.nl: could not connect to host
-vanderlest.de: did not receive HSTS header
-vanderstraeten.dynv6.net: could not connect to host
-vanderziel.org: did not receive HSTS header
-vanessabalibridal.com: could not connect to host
-vanestack.com: could not connect to host
-vanetv.com: could not connect to host
-vangeluwedeberlaere.be: did not receive HSTS header
-vanitas.xyz: could not connect to host
-vanitynailworkz.com: could not connect to host
-vanlent.net: could not connect to host
-vannaos.com: could not connect to host
-vansieleghem.com: could not connect to host
-vanvoro.us: did not receive HSTS header
-vanwoensel.xyz: could not connect to host
-vapecom-shop.com: could not connect to host
-vapecraftinc.com: did not receive HSTS header
-vapehour.com: could not connect to host
-vapemania.eu: could not connect to host
-vapesupplies.com.au: did not receive HSTS header
-vapordepot.jp: could not connect to host
-vaporpunk.space: could not connect to host
-varaeventos.com: did not receive HSTS header
-varela-electricite.fr: could not connect to host
-variable.agency: could not connect to host
-variablyconstant.com: could not connect to host
-variando.fi: did not receive HSTS header
-varianto25.com: max-age too low: 7889238
-varicoseveinssolution.com: could not connect to host
-varmepumpe-guide.dk: did not receive HSTS header
-varonahairrestoration.com: did not receive HSTS header
-varshasookt.com: could not connect to host
-varta.io: could not connect to host
-varunpriolkar.com: did not receive HSTS header
-vasa-webstranka.sk: did not receive HSTS header
-vasilisa-volodina.tk: could not connect to host
-vasp.group: did not receive HSTS header
-vastgoedcultuurfonds.nl: did not receive HSTS header
-vastkustenrunt.se: did not receive HSTS header
-vatelecom.dk: did not receive HSTS header
-vati.pw: could not connect to host
-vatsalyagoel.com: did not receive HSTS header
-vatsim-uk.co.uk: did not receive HSTS header
-vatsim.uk: did not receive HSTS header
-vaud-fleurs.ch: did not receive HSTS header
-vavai.net: did not receive HSTS header
-vavouchers.com: could not connect to host
-vawltstorage.com: could not connect to host
-vayaport.com: could not connect to host
-vb-oa.co.uk: did not receive HSTS header
-vbest.net: could not connect to host
-vbestreviews.com: did not receive HSTS header
-vbhelp.org: did not receive HSTS header
-vbql.me: could not connect to host
-vbulletin-russia.com: could not connect to host
-vbulletinrussia.com: could not connect to host
-vcdn.xyz: could not connect to host
-vcdove.com: could not connect to host
-vconcept.ch: could not connect to host
-vconcept.me: could not connect to host
-vcr.re: could not connect to host
-vcraftaudio.com: could not connect to host
-vdemuzere.be: could not connect to host
-vdhco.be: did not receive HSTS header
-vdrpro.com: could not connect to host
-vdzn.net: could not connect to host
-vdzwan.net: did not receive HSTS header
-vebbankir-zajm-onlajn.gq: could not connect to host
-veblen.com: did not receive HSTS header
-vec.ac.nz: did not receive HSTS header
-vechkasov.ru: did not receive HSTS header
-vectro.me: could not connect to host
-vedatkamer.com: could not connect to host
-vega-motor.com.ua: did not receive HSTS header
-vega.dyndns.info: could not connect to host
-vegalayer.com: could not connect to host
-vegalengd.com: could not connect to host
-vegane-proteine.com: could not connect to host
-vegangaymer.blog: could not connect to host
-veganosonline.com: could not connect to host
-vegasdocs.com: did not receive HSTS header
-vegepa.com: could not connect to host
-vegetabio.com: did not receive HSTS header
-veggie-treff.de: did not receive HSTS header
-veggiefasting.com: could not connect to host
-veggies.tk: could not connect to host
-veggiesbourg.fr: did not receive HSTS header
-veggiesecret.com: did not receive HSTS header
-vegis.ro: did not receive HSTS header
-veglog.com: could not connect to host
-vehent.org: did not receive HSTS header
-vehicleuplift.co.uk: did not receive HSTS header
-veke.fi: did not receive HSTS header
-vekenz.com: could not connect to host
-velasense.com: could not connect to host
-velocom.com.ar: did not receive HSTS header
-velonustraduction.com: could not connect to host
-velotyretz.fr: did not receive HSTS header
-vemokin.net: could not connect to host
-venalytics.com: could not connect to host
-vendserve.eu: could not connect to host
-venicecomputerrepair.com: could not connect to host
-venicefl.gov: could not connect to host
-venicefloridawebsitedesign.com: could not connect to host
-venicerealdeal.com: could not connect to host
-venirextra.com: did not receive HSTS header
-venirideal.com: did not receive HSTS header
-venixplays-stream.ml: could not connect to host
-venmos.com: could not connect to host
-venninvestorplatform.com: could not connect to host
-venoom.eu: did not receive HSTS header
-vensl.org: could not connect to host
-ventadecolchones.com: did not receive HSTS header
-venten.ee: did not receive HSTS header
-venturavwparts.com: could not connect to host
-venturebanners.co.uk: did not receive HSTS header
-venturedisplay.co.uk: did not receive HSTS header
-venturepro.com: did not receive HSTS header
-ventures.lgbt: could not connect to host
-ventureslgbt.com: could not connect to host
-ventzke.com: did not receive HSTS header
-venusbymariatash.com: did not receive HSTS header
-venzocrm.com: did not receive HSTS header
-vera.bg: did not receive HSTS header
-veraandsteve.date: could not connect to host
-verbierfestival.com: could not connect to host
-verdeandco.co.uk: could not connect to host
-vergeaccessories.com: could not connect to host
-vergessen.cn: could not connect to host
-verificaprezzi.it: did not receive HSTS header
-verifiedinvesting.com: could not connect to host
-verifikatorindonesia.com: could not connect to host
-verios.com.br: did not receive HSTS header
-veristor.com: did not receive HSTS header
-verkkopalvelin.fi: did not receive HSTS header
-vermellcollection.com: could not connect to host
-vermogeninkaart.nl: could not connect to host
-vermontcareergateway.org: could not connect to host
-vernonchan.com: could not connect to host
-vernonfishandgame.ca: did not receive HSTS header
-vernonhouseofhope.com: did not receive HSTS header
-vernontechnology.com: did not receive HSTS header
-veronicaphotography.com: could not connect to host
-versalhost.com: could not connect to host
-versalhost.nl: could not connect to host
-versfin.net: could not connect to host
-versia.ru: did not receive HSTS header
-versolslapeyre.fr: did not receive HSTS header
-vertigo.com.br: did not receive HSTS header
-verustracking.com: could not connect to host
-veryhax.de: could not connect to host
-veryimportantusers.com: could not connect to host
-veryyounglesbians.com: did not receive HSTS header
-verzick.com: could not connect to host
-vestacp.top: could not connect to host
-vet-planet.com: did not receive HSTS header
-vetdnacenter.com: did not receive HSTS header
-veteransonline.us: did not receive HSTS header
-veterinaire-cazeres-foucault.fr: could not connect to host
-veterinarian-hospital.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-vethouse.com.ua: could not connect to host
-vetmgmt.com: could not connect to host
-vetpraxis.de: did not receive HSTS header
-veusveus.cat: could not connect to host
-vexsoluciones.com: did not receive HSTS header
-vextraz.co: could not connect to host
-vfn-nrw.de: could not connect to host
-vforvendetta.science: did not receive HSTS header
-vfree.org: could not connect to host
-vgatest.nl: could not connect to host
-vgchat.us: could not connect to host
-vglimg.com: could not connect to host
-vhost.co.id: could not connect to host
-vi.photo: could not connect to host
-viabemestar.com.br: could not connect to host
-viadeux.com: did not receive HSTS header
-viagusto.pl: could not connect to host
-vialorran.com: could not connect to host
-viato.fr: could not connect to host
-vibrashop.com.br: did not receive HSTS header
-vicenage.com: could not connect to host
-viceversa.xyz: could not connect to host
-vicgenesis.me: could not connect to host
-viciousflora.com: could not connect to host
-viciousviscosity.xyz: did not receive HSTS header
-vickshomes.com: did not receive HSTS header
-victordiaz.me: did not receive HSTS header
-victorenxovais.com.br: could not connect to host
-victoreriksson.ch: could not connect to host
-victoreriksson.co: could not connect to host
-victoreriksson.com: could not connect to host
-victoreriksson.es: could not connect to host
-victoreriksson.eu: could not connect to host
-victoreriksson.info: could not connect to host
-victoreriksson.me: could not connect to host
-victoreriksson.net: could not connect to host
-victoreriksson.nu: could not connect to host
-victoreriksson.org: could not connect to host
-victoreriksson.se: could not connect to host
-victoreriksson.us: could not connect to host
-victoreriksson.xyz: could not connect to host
-victoriaville.ca: did not receive HSTS header
-victornilsson.pw: did not receive HSTS header
-victoroilpress.com: did not receive HSTS header
-victorzambrano.com: did not receive HSTS header
-victusrp.gq: could not connect to host
-vida-it.com: did not receive HSTS header
-vida.es: could not connect to host
-vidadigitalecuador.com: did not receive HSTS header
-vidadu.com: could not connect to host
-vidb.me: could not connect to host
-vidbuchanan.co.uk: did not receive HSTS header
-vidcloud.xyz: could not connect to host
-videnskabsklubben.dk: did not receive HSTS header
-videobola.win: could not connect to host
-videodrome.me: could not connect to host
-videoload.co: could not connect to host
-videomuz.com: could not connect to host
-videorullen.se: could not connect to host
-videosdiversosdatv.com: could not connect to host
-videot.tk: could not connect to host
-videotogel.net: could not connect to host
-videov.tk: could not connect to host
-vider.ga: could not connect to host
-vidid.net: could not connect to host
-viditut.com: could not connect to host
-vidkovaomara.si: could not connect to host
-vidlyoficial.com: could not connect to host
-vidracariaespelhosbh.com.br: max-age too low: 0
-vidz.ga: could not connect to host
-viennan.net: did not receive HSTS header
-vierdaagsehotel.nl: could not connect to host
-vieref.eu: could not connect to host
-vierna.ga: could not connect to host
-vietnam-lifer.com: could not connect to host
-vietnamchevrolet.net: did not receive HSTS header
-vietnamguide.co.kr: did not receive HSTS header
-vietnamhost.vn: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-vietnamphotographytours.com: could not connect to host
-vietplan.vn: could not connect to host
-vieux.pro: could not connect to host
-viewey.com: could not connect to host
-viewflix.win: could not connect to host
-viewmyrecords.com: did not receive HSTS header
-viewsea.com: max-age too low: 0
-viflores.com: could not connect to host
-viga.me: could not connect to host
-vigenebio.com: did not receive HSTS header
-vigilanciatotal.com: could not connect to host
-vigilantesporcolombia.org: could not connect to host
-vigilo.cf: could not connect to host
-vigilo.ga: could not connect to host
-vigour.us: could not connect to host
-viikko.cf: could not connect to host
-viikko.eu: could not connect to host
-viikko.ga: could not connect to host
-viikko.gq: could not connect to host
-viikko.ml: could not connect to host
-vijos.org: did not receive HSTS header
-vikasbabyworld.de: could not connect to host
-viki.com: did not receive HSTS header
-vikodek.com: did not receive HSTS header
-viktor-machnik.de: could not connect to host
-viktorsvantesson.net: did not receive HSTS header
-vilabiamodas.com.br: could not connect to host
-viladochurrasco.com.br: did not receive HSTS header
-vilafloridacapivari.com.br: could not connect to host
-vilaydin.com: could not connect to host
-vilight.com.br: could not connect to host
-villa-anna-cilento.de: could not connect to host
-villa-bellarte.de: did not receive HSTS header
-villacarmela.com.br: could not connect to host
-villaella.com: did not receive HSTS header
-villainsclothing.com.au: could not connect to host
-villalaskowa.pl: did not receive HSTS header
-villasenor.online: could not connect to host
-vilog.me: could not connect to host
-vimeosucks.nyc: could not connect to host
-vinasec.se: could not connect to host
-vinbet.org: could not connect to host
-vinbet000.com: could not connect to host
-vinbet111.com: could not connect to host
-vinbet222.com: could not connect to host
-vinbet333.com: could not connect to host
-vinbet444.com: could not connect to host
-vinbet555.com: could not connect to host
-vinbet666.com: could not connect to host
-vinbet888.com: could not connect to host
-vincentiliano.tk: could not connect to host
-vincentkooijman.at: did not receive HSTS header
-vincentkooijman.nl: could not connect to host
-vincentoshana.com: did not receive HSTS header
-vincentswordpress.nl: could not connect to host
-vinciconps4.it: could not connect to host
-vincura.io: did not receive HSTS header
-vineright.com: did not receive HSTS header
-vinesauce.info: could not connect to host
-vinetalk.net: could not connect to host
-vingt.me: could not connect to host
-viniferawineclub.com: did not receive HSTS header
-vinihk.com: could not connect to host
-vinilosdecorativos.net: could not connect to host
-vinkt.eu: did not receive HSTS header
-vinnie.gq: could not connect to host
-vinogradovka.com: could not connect to host
-vinolli.de: could not connect to host
-vinosalmundo.com: did not receive HSTS header
-vinsetchampagne.fr: could not connect to host
-vintazh.net: could not connect to host
-vintock.com: could not connect to host
-vinyculture.com: did not receive HSTS header
-vio.no: did not receive HSTS header
-violauotila.fi: did not receive HSTS header
-violenceinterrupted.org: did not receive HSTS header
-violet-letter.delivery: could not connect to host
-viosey.com: could not connect to host
-vioye.com: could not connect to host
-vip-9649.com: could not connect to host
-vip380.vip: max-age too low: 0
-vip4553.com: could not connect to host
-vip8522.com: could not connect to host
-vip9649.com: could not connect to host
-vipcards.top: could not connect to host
-vipcp.me: could not connect to host
-viperdns.com: did not receive HSTS header
-vipesball.net: could not connect to host
-viphospitality.se: did not receive HSTS header
-vipi.es: could not connect to host
-viplentes.com.br: did not receive HSTS header
-vipmusic.ga: could not connect to host
-vipnettikasinoklubi.com: did not receive HSTS header
-viqo.pl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-viral8.jp: could not connect to host
-viralboombox.xyz: could not connect to host
-viralify.me: did not receive HSTS header
-viralsouls.in: could not connect to host
-viralsv.com: could not connect to host
-virgiliocervantes.co.uk: did not receive HSTS header
-virginiacrimeanalysisnetwork.org: did not receive HSTS header
-virial.de: did not receive HSTS header
-virtual.hk: did not receive HSTS header
-virtualhealth.com: did not receive HSTS header
-virtualizy.de: could not connect to host
-virtualstrongbox.ca: could not connect to host
-virus.pm: could not connect to host
-visa-shinsei.com: did not receive HSTS header
-visadaifu.com: could not connect to host
-visaexpert.co.za: did not receive HSTS header
-visanhigia.com: could not connect to host
-visasofoz.com: did not receive HSTS header
-viserproject.com: did not receive HSTS header
-visibleone.com: did not receive HSTS header
-visioflux-premium.com: could not connect to host
-vision-painting.com: did not receive HSTS header
-visionarymedia.nl: could not connect to host
-visiondigitalsog.com: could not connect to host
-visiondirectionaldrilling.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-visionexpress.ie: did not receive HSTS header
-visiongamestudios.com: could not connect to host
-visionthroughknowledge.com: could not connect to host
-visiontree-beta.eu: could not connect to host
-visiontree.eu: did not receive HSTS header
-visistruct.com: max-age too low: 2592000
-visitbroadstairs.com: did not receive HSTS header
-vispaleistexel.nl: did not receive HSTS header
-vissanum.com: did not receive HSTS header
-vissersgrootboek.nl: did not receive HSTS header
-vistaalmar.es: max-age too low: 2592000
-vistarait.com: could not connect to host
-vistodeturista.com.br: did not receive HSTS header
-visualdrone.co: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-visualgrafix.com.mx: could not connect to host
-visualvotes.co.uk: could not connect to host
-vitagenda.nl: could not connect to host
-vitalamin.at: could not connect to host
-vitalamin.ch: could not connect to host
-vitalamin.com: could not connect to host
-vitalamin.de: could not connect to host
-vitalita.cz: did not receive HSTS header
-vitalityscience.com: did not receive HSTS header
-vitalthings.de: could not connect to host
-vitamaxxi.com.br: could not connect to host
-vitamineproteine.com: did not receive HSTS header
-vitapingu.de: could not connect to host
-vitavie.nl: did not receive HSTS header
-vitoye.com: could not connect to host
-vitpeyr.com: could not connect to host
-vitra-vcare.co.uk: did not receive HSTS header
-vitta.me: did not receive HSTS header
-viva-french.com: did not receive HSTS header
-vivaldi-fr.com: did not receive HSTS header
-vivanosports.com.br: could not connect to host
-vivasports.com.br: could not connect to host
-viveconsalud.club: could not connect to host
-vivianmaier.cn: could not connect to host
-viviendy.com: did not receive HSTS header
-vivocloud.com: could not connect to host
-vivoregularizafacil.com.br: could not connect to host
-vivoseg.com: could not connect to host
-vivremoinscher.fr: did not receive HSTS header
-viza.io: could not connect to host
-vizards.cc: could not connect to host
-vizeat.com: did not receive HSTS header
-vizeyurdu.com: did not receive HSTS header
-vizierdata.ca: could not connect to host
-vizuul.com: did not receive HSTS header
-vjirovsky.cz: could not connect to host
-vk4wip.org.au: did not receive HSTS header
-vkennke.org: could not connect to host
-vkirichenko.name: could not connect to host
-vkulagin.ru: could not connect to host
-vkwebsite.ru: could not connect to host
-vladsfads.com: could not connect to host
-vlakjebak.nl: could not connect to host
-vlastimilburian.cz: did not receive HSTS header
-vleij.family: could not connect to host
-vlogge.com: could not connect to host
-vlora.city: could not connect to host
-vlsk.eu: could not connect to host
-vlsm.se: did not receive HSTS header
-vlvvl.com: could not connect to host
-vlzbazar.ru: could not connect to host
-vmc.co.id: did not receive HSTS header
-vmconnected.co.uk: did not receive HSTS header
-vmem.jp: did not receive HSTS header
-vmoagents.com: could not connect to host
-vmrdev.com: could not connect to host
-vmstan.com: did not receive HSTS header
-vmzone.de: did not receive HSTS header
-vncg.org: did not receive HSTS header
-vnpay.vn: did not receive HSTS header
-vnpem.org: did not receive HSTS header
-vns1780.com: could not connect to host
-vns3780.com: could not connect to host
-vns5656.com: could not connect to host
-vns6868.com: could not connect to host
-vocab.guru: could not connect to host
-vocalik.com: could not connect to host
-vocalsynth.space: could not connect to host
-voceempaz.com: could not connect to host
-voceinveste.com: did not receive HSTS header
-vochuys.nl: did not receive HSTS header
-vodpay.com: could not connect to host
-vodpay.net: could not connect to host
-vodpay.org: could not connect to host
-vofy.cz: could not connect to host
-vogt.tech: could not connect to host
-voicesuk.co.uk: did not receive HSTS header
-void-it.nl: could not connect to host
-void-zero.com: did not receive HSTS header
-voidark.com: could not connect to host
-voidbot.tk: could not connect to host
-voidi.ca: could not connect to host
-voidnya.com: did not receive HSTS header
-voidpay.net: could not connect to host
-voidpay.org: could not connect to host
-voids.org: could not connect to host
-voidserv.net: could not connect to host
-voidx.top: could not connect to host
-voidzehn.com: did not receive HSTS header
-voilo.club: could not connect to host
-voilodaisuki.club: could not connect to host
-voipkb.com: did not receive HSTS header
-voiro.club: could not connect to host
-voirodaisuki.club: could not connect to host
-vojenshandicap.dk: could not connect to host
-vojtekpince.hu: did not receive HSTS header
-vokalsystem.com: did not receive HSTS header
-vokurka.net: did not receive HSTS header
-volatimer.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-volbyzive.cz: could not connect to host
-volcain.io: could not connect to host
-volcanconcretos.com: could not connect to host
-volcano-kazan.ru: could not connect to host
-volcano-spb.ru: could not connect to host
-volcano-vts.ru: could not connect to host
-volcano24.ru: could not connect to host
-volcanov.ru: could not connect to host
-volcrado.com: could not connect to host
-volkden.com: could not connect to host
-volkerwesselswave.nl: did not receive HSTS header
-volksvorschlagpmar.ch: could not connect to host
-volkswurst.de: did not receive HSTS header
-vollmondstollen.de: could not connect to host
-volosnet.tk: could not connect to host
-volqanic.com: could not connect to host
-volta.io: could not connect to host
-voltimax.com: could not connect to host
-voltotc.com: could not connect to host
-voluptueuse.com: did not receive HSTS header
-von-lien-aluprofile.de: did not receive HSTS header
-von-lien-dachrinnen.de: did not receive HSTS header
-von-lien-lichtplatten.de: did not receive HSTS header
-von-lien-profilbleche.de: did not receive HSTS header
-vonavy-cukor.sk: could not connect to host
-vonavycukor.sk: could not connect to host
-vonedelmann.de: did not receive HSTS header
-vongerlach.at: did not receive HSTS header
-vonski.pl: could not connect to host
-vorangerie.com: could not connect to host
-vorderklier.de: could not connect to host
-vorlif.org: did not receive HSTS header
-vorte.ga: could not connect to host
-vortexhobbies.com: did not receive HSTS header
-vos-fleurs.ch: could not connect to host
-vos-fleurs.com: could not connect to host
-vosjesweb.nl: could not connect to host
-vossenack.nrw: did not receive HSTS header
-vostok-zapad54.ru: could not connect to host
-votelevy.gov: could not connect to host
-votemarion.gov: could not connect to host
-votercircle.com: did not receive HSTS header
-voterstartingpoint.uk: could not connect to host
-votewa.gov: max-age too low: 2592000
-votre-site-internet.ch: did not receive HSTS header
-votresiteweb.ch: could not connect to host
-vow.vn: did not receive HSTS header
-vowsy.club: could not connect to host
-vox.vg: could not connect to host
-voya.ga: did not receive HSTS header
-vozami.com: could not connect to host
-vpip.net: could not connect to host
-vpl.me: could not connect to host
-vpn-byen.dk: did not receive HSTS header
-vpn.pics: could not connect to host
-vpnhot.com: could not connect to host
-vpntech.net: did not receive HSTS header
-vpnzoom.com: did not receive HSTS header
-vps-szerver-berles.hu: could not connect to host
-vpsao.org: could not connect to host
-vpsmojo.com: did not receive HSTS header
-vpsproj.dynu.net: did not receive HSTS header
-vpsvz.cloud: could not connect to host
-vpsvz.ninja: could not connect to host
-vqporn.com: did not receive HSTS header
-vrachi.online: did not receive HSTS header
-vranjske.co.rs: could not connect to host
-vratny.space: could not connect to host
-vrcholovka.cz: did not receive HSTS header
-vriendenvoordeel.com: did not receive HSTS header
-vrijstaandhuis-in-alphen-aan-den-rijn-kopen.nl: could not connect to host
-vrijstaandhuis-in-brielle-kopen.nl: could not connect to host
-vrijstaandhuis-in-delfzijl-kopen.nl: could not connect to host
-vrijstaandhuis-in-friesland-kopen.nl: could not connect to host
-vrijstaandhuis-in-laren-kopen.nl: could not connect to host
-vrijstaandhuis-in-leeuwarden-kopen.nl: could not connect to host
-vrijstaandhuis-in-veendam-kopen.nl: could not connect to host
-vrijstaandhuis-in-zeeland-kopen.nl: could not connect to host
-vrijstaandhuis-in-zuid-holland-kopen.nl: could not connect to host
-vrijstaandhuis-in-zuidplas-kopen.nl: could not connect to host
-vrijstaandhuis-in-zwartewaterland-kopen.nl: could not connect to host
-vrijstaandhuisverkopen.nl: could not connect to host
-vrobert.fr: could not connect to host
-vrtouring.org: could not connect to host
-vrzl.pro: could not connect to host
-vsamsonov.com: could not connect to host
-vsc-don-stocksport.de: did not receive HSTS header
-vsem-privet.tk: could not connect to host
-vstehn.ru: did not receive HSTS header
-vtipe-vylez.cz: did not receive HSTS header
-vtuber-schedule.info: could not connect to host
-vtuber.art: could not connect to host
-vuasinhly.com: did not receive HSTS header
-vuatruyen.com: did not receive HSTS header
-vucdn.com: could not connect to host
-vullriede-multimedia.de: could not connect to host
-vulndetect.org: did not receive HSTS header
-vulnerabilities.io: could not connect to host
-vuojolahti.com: did not receive HSTS header
-vuojolahti.fi: did not receive HSTS header
-vuosaarenmontessoritalo.fi: did not receive HSTS header
-vv5197.co: could not connect to host
-vv6729.co: could not connect to host
-vv6729.com: did not receive HSTS header
-vv6957.co: could not connect to host
-vv9297.co: could not connect to host
-vv9397.com: could not connect to host
-vv9721.com: could not connect to host
-vv9728.co: could not connect to host
-vvw-8522.com: could not connect to host
-vvzero.cf: could not connect to host
-vvzero.com: did not receive HSTS header
-vvzero.me: did not receive HSTS header
-vw-touranclub.cz: could not connect to host
-vwhcare.com: did not receive HSTS header
-vwoforangeparts.com: could not connect to host
-vww-8522.com: could not connect to host
-vxapps.com: could not connect to host
-vxml.club: could not connect to host
-vxst.org: max-age too low: 2592000
-vxstream-sandbox.com: did not receive HSTS header
-vykup-car.ru: could not connect to host
-vynedmusic.com: did not receive HSTS header
-vyshivanochka.in.ua: could not connect to host
-vysvetluju.cz: could not connect to host
-vyvybean.cf: could not connect to host
-vyvygen.com: did not receive HSTS header
-vzce.cn: could not connect to host
-vzk.io: could not connect to host
-vztekloun.cz: could not connect to host
-w-ws.ga: could not connect to host
-w000999.com: could not connect to host
-w0115.com: could not connect to host
-w10club.com: could not connect to host
-w1221.com: did not receive HSTS header
-w2gshop.com.br: could not connect to host
-w30365.com: could not connect to host
-w3n.org: could not connect to host
-w3n14izy.gq: could not connect to host
-w4a.fr: could not connect to host
-w4b.in: could not connect to host
-w4solutions.de: could not connect to host
-w4xzr.top: could not connect to host
-w4xzr.xyz: could not connect to host
-w5197.co: could not connect to host
-w6603.com: could not connect to host
-w6612.net: could not connect to host
-w662211.com: could not connect to host
-w66938.com: could not connect to host
-w6729.co: could not connect to host
-w6729.com: did not receive HSTS header
-w6863.com: could not connect to host
-w6957.co: could not connect to host
-w80010.com: could not connect to host
-w84.it: could not connect to host
-w9297.co: could not connect to host
-w9397.com: could not connect to host
-w95.pw: could not connect to host
-w9710.com: did not receive HSTS header
-w9720.com: did not receive HSTS header
-w9721.com: could not connect to host
-w9728.co: could not connect to host
-w9730.com: could not connect to host
-w9740.com: did not receive HSTS header
-w9750.com: did not receive HSTS header
-w97a.com: could not connect to host
-w97aa.com: did not receive HSTS header
-w97app.com: did not receive HSTS header
-w97app2.com: did not receive HSTS header
-w97app3.com: did not receive HSTS header
-w97bb.com: did not receive HSTS header
-w97cc.com: did not receive HSTS header
-w9rld.com: did not receive HSTS header
-wa3368.com: could not connect to host
-wabifoggynuts.com: could not connect to host
-wachter.biz: could not connect to host
-wachtwoordencheck.nl: could not connect to host
-wacky-science.com: could not connect to host
-wadvisor.com: could not connect to host
-wafa4hw.com: could not connect to host
-wafelland.be: did not receive HSTS header
-wafni.com: could not connect to host
-wage-feeg.gc.ca: could not connect to host
-waggs.link: could not connect to host
-wahhoi.net: did not receive HSTS header
-wahidhasan.com: did not receive HSTS header
-wahlman.org: did not receive HSTS header
-wai-in.com: could not connect to host
-waidu.de: could not connect to host
-waifu-technologies.com: could not connect to host
-waikatowebdesigners.com: could not connect to host
-wains.be: did not receive HSTS header
-wait.jp: could not connect to host
-wait.moe: could not connect to host
-waiterwheels.com: did not receive HSTS header
-waivcollective.com: did not receive HSTS header
-waixingrenfuli7.vip: could not connect to host
-wajtc.com: could not connect to host
-wakapp.de: could not connect to host
-wakastream.cc: could not connect to host
-wakened.net: did not receive HSTS header
-walentin.co: could not connect to host
-walkeryoung.ca: could not connect to host
-walkingforhealth.org.uk: did not receive HSTS header
-wallabag.it: did not receive HSTS header
-wallabag.org: did not receive HSTS header
-wallacequinn.co.uk: did not receive HSTS header
-wallet.google.com: did not receive HSTS header (error ignored - included regardless)
-wallet.pp.ua: could not connect to host
-wallethub.com: did not receive HSTS header
-wallis-inside.ch: could not connect to host
-wallsblog.dk: could not connect to host
-walnutgaming.co.uk: could not connect to host
-walterlynnmosley.com: did not receive HSTS header
-waltervictor.com: could not connect to host
-walvi.nl: did not receive HSTS header
-wan.pp.ua: could not connect to host
-wanashi.com: could not connect to host
-wanban.io: could not connect to host
-wancai666.com: max-age too low: 0
-wancai880.com: max-age too low: 0
-wancai886.com: max-age too low: 0
-wancaibbin.com: max-age too low: 0
-wancaip66.com: max-age too low: 0
-wancaiqe.com: max-age too low: 0
-wancaiqwe5967.com: max-age too low: 0
-wancaiwang8.com: max-age too low: 0
-wanda76.com: could not connect to host
-wanda78.com: could not connect to host
-wanda79.com: could not connect to host
-wanda96.com: could not connect to host
-wanda97.com: could not connect to host
-wanda98.com: could not connect to host
-wandercue.com: did not receive HSTS header
-wang.by: could not connect to host
-wangbangyu.cf: could not connect to host
-wangbangyu.ga: could not connect to host
-wangbangyu.gq: could not connect to host
-wangbangyu.ml: could not connect to host
-wangbangyu.tk: could not connect to host
-wangbin1023.com: max-age too low: 0
-wangejiba.com: did not receive HSTS header
-wangfuhe.com: max-age too low: 0
-wanghuiblog.com: did not receive HSTS header
-wangjiatun.com.tw: could not connect to host
-wangkezun.com: could not connect to host
-wangler-internet.de: did not receive HSTS header
-wangqiliang.org: could not connect to host
-wangqiliang.xn--fiqs8s: could not connect to host
-wangql.cn: could not connect to host
-wangql.net: could not connect to host
-wangwill.me: could not connect to host
-wangyubao.cn: could not connect to host
-wanmen.org: did not receive HSTS header
-wantshow.com.br: did not receive HSTS header
-wanybug.cf: could not connect to host
-wanybug.cn: did not receive HSTS header
-wanybug.ga: could not connect to host
-wanybug.gq: could not connect to host
-wanybug.tk: could not connect to host
-wanzenbug.xyz: did not receive HSTS header
-wapgu.cc: could not connect to host
-wapjt.cn: could not connect to host
-wapking.co: did not receive HSTS header
-wapking.live: did not receive HSTS header
-wapt.fr: did not receive HSTS header
-warandpeace.xyz: could not connect to host
-warcraftjournal.org: could not connect to host
-warekon.com: could not connect to host
-warekon.dk: could not connect to host
-warenmedia.com: did not receive HSTS header
-warezaddict.com: could not connect to host
-warezoom.com: could not connect to host
-warhistoryonline.com: did not receive HSTS header
-warlions.info: could not connect to host
-warmcat.com: could not connect to host
-warmestwishes.ca: could not connect to host
-warmservers.com: could not connect to host
-warnings.xyz: did not receive HSTS header
-warren.sh: could not connect to host
-warrencreative.com: did not receive HSTS header
-warsentech.com: could not connect to host
-warsonco.com: did not receive HSTS header
-warthog.ml: could not connect to host
-warumsuchen.at: did not receive HSTS header
-warung.host: could not connect to host
-wasatchconstables.com: did not receive HSTS header
-wasatchcrest.com: did not receive HSTS header
-wasgehtheute.in: could not connect to host
-washandfun.com: did not receive HSTS header
-wasil.org: did not receive HSTS header
-wassim.is: could not connect to host
-wasticker.ru: could not connect to host
-watashi.bid: could not connect to host
-watboeithet.nl: could not connect to host
-watchinventory.com: did not receive HSTS header
-watchium.com: could not connect to host
-watchonline.al: could not connect to host
-watchtv-online.pw: could not connect to host
-watchweasel.com: could not connect to host
-waterfedpole.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-waterforlife.net.au: did not receive HSTS header
-waterpoint.com.br: could not connect to host
-waterproofingahmedabad.com: did not receive HSTS header
-waterseal.in: did not receive HSTS header
-watersportmarkt.net: could not connect to host
-waterworkscondos.com: could not connect to host
-watsonhall.uk: could not connect to host
-watsonwork.me: could not connect to host
-wattechweb.com: did not receive HSTS header
-watvindtnederland.com: could not connect to host
-waukeect.com: could not connect to host
-wave-ola.es: could not connect to host
-wavefloatrooms.com: could not connect to host
-wavefrontsystemstech.com: could not connect to host
-waverlypa.gov: did not receive HSTS header
-waverlysecuritycameras.com: did not receive HSTS header
-waverlytn.gov: did not receive HSTS header
-waxlrs.com: could not connect to host
-waycraze.com: could not connect to host
-waylandss.com: did not receive HSTS header
-waylaydesign.com: did not receive HSTS header
-waylee.net: could not connect to host
-waynecountyoh.gov: did not receive HSTS header
-wayuanma.com: could not connect to host
-wbit.co.il: did not receive HSTS header
-wbut.ml: could not connect to host
-wbx.support: did not receive HSTS header
-wby.gd: could not connect to host
-wby.tw: could not connect to host
-wc11122.com: max-age too low: 0
-wc1234.cn: did not receive HSTS header
-wc168cp.com: max-age too low: 0
-wclhtzs.com: max-age too low: 0
-wcsi.com: did not receive HSTS header
-wcw10000.com: max-age too low: 0
-wcw130.com: max-age too low: 0
-wcw179.com: max-age too low: 0
-wcw618.com: max-age too low: 0
-wcw635290.com: max-age too low: 0
-wcw668.com: max-age too low: 0
-wcw9366.com: max-age too low: 0
-wcwcp88.com: max-age too low: 0
-wd627.com: could not connect to host
-wd976.com: could not connect to host
-wdic.org: could not connect to host
-wdj1023.com: max-age too low: 0
-wdrl.info: did not receive HSTS header
-wdt.io: could not connect to host
-we-run-linux.de: could not connect to host
-we-use-linux.de: could not connect to host
-we.serveftp.net: could not connect to host
-we9988.net: could not connect to host
-wealthcentral.com.au: did not receive HSTS header
-wealthformyhealth.com: did not receive HSTS header
-wear2work.nl: did not receive HSTS header
-wearedisneyland.com: did not receive HSTS header
-wearehackerone.com: could not connect to host
-weareincognito.org: could not connect to host
-wearesouthafricans.com: did not receive HSTS header
-wearewithyou.org: could not connect to host
-weather-and-climate.com: did not receive HSTS header
-weaverhairextensions.nl: could not connect to host
-web-adminy.co.uk: did not receive HSTS header
-web-advisor.co.uk: could not connect to host
-web-demarche.com: could not connect to host
-web-dl.cc: could not connect to host
-web-fox23.ru: did not receive HSTS header
-web-industry.fr: could not connect to host
-web-insider.net: did not receive HSTS header
-web-vision.de: did not receive HSTS header
-web1n.com: could not connect to host
-web4all.fr: did not receive HSTS header
-web4pro.fr: could not connect to host
-webais.ru: could not connect to host
-webalert.cz: did not receive HSTS header
-webambacht.nl: could not connect to host
-webandwords.com.au: could not connect to host
-webanker.sh: could not connect to host
-webapky.cz: could not connect to host
-webappky.cz: could not connect to host
-webapps.directory: could not connect to host
-webart-factory.de: could not connect to host
-webassadors.com: could not connect to host
-webauthority.co.uk: could not connect to host
-webbson.net: could not connect to host
-webbuzz.com.au: did not receive HSTS header
-webbx.se: did not receive HSTS header
-webchat.domains: could not connect to host
-webcreation.rocks: could not connect to host
-webdeflect.com: did not receive HSTS header
-webdesign-kronberg.de: did not receive HSTS header
-webdesignerinwarwickshire.co.uk: did not receive HSTS header
-webdesignplay.com: could not connect to host
-webdesignssussex.co.uk: could not connect to host
-webdestiny.net: did not receive HSTS header
-webdev-cw.me: could not connect to host
-webdev-quiz.de: did not receive HSTS header
-webdev.mobi: could not connect to host
-webdevxp.com: could not connect to host
-webdollarvpn.io: could not connect to host
-webdosh.com: did not receive HSTS header
-webeconomia.it: did not receive HSTS header
-webelement.sk: did not receive HSTS header
-weberjulia.com: did not receive HSTS header
-webetnet.fr: did not receive HSTS header
-webev.ru: could not connect to host
-webfilings-eu-mirror.appspot.com: did not receive HSTS header (error ignored - included regardless)
-webfox.com.br: did not receive HSTS header
-webfronten.dk: did not receive HSTS header
-webgap.me: did not receive HSTS header
-webgeneric.xyz: could not connect to host
-webhackspro.com: could not connect to host
-webhopp.com: could not connect to host
-webhosting4.net: did not receive HSTS header
-webhostingpros.ml: could not connect to host
-webhostplan.info: could not connect to host
-webinator.tk: could not connect to host
-webkeks.org: did not receive HSTS header
-webless.com: did not receive HSTS header
-weblogic.pl: did not receive HSTS header
-webm.to: could not connect to host
-webmail.mayfirst.org: did not receive HSTS header
-webmaniabr.com: did not receive HSTS header
-webmax.com.tr: did not receive HSTS header
-webmel.com: did not receive HSTS header
-webministeriet.net: did not receive HSTS header
-webmixseo.com: did not receive HSTS header
-webmr.de: could not connect to host
-webnetmail4u.com: could not connect to host
-webninja.work: could not connect to host
-webnoob.net: could not connect to host
-webnosql.com: could not connect to host
-webogram.org: did not receive HSTS header
-webperformance.ru: could not connect to host
-webplatform.fi: did not receive HSTS header
-webproject.rocks: did not receive HSTS header
-webproshosting.tk: could not connect to host
-webproxy.pw: could not connect to host
-webpublica.pt: could not connect to host
-webranking.tk: could not connect to host
-webreslist.com: did not receive HSTS header
-websandbox.uk: could not connect to host
-websectools.com: could not connect to host
-webseo.de: did not receive HSTS header
-websitedesign.bg: did not receive HSTS header
-websiteforlease.ca: did not receive HSTS header
-websiterent.ca: could not connect to host
-websites4business.ca: could not connect to host
-websitesabq.com: did not receive HSTS header
-websitesolutionsmedia.com: did not receive HSTS header
-websouthdesign.com: could not connect to host
-webspotter.nl: could not connect to host
-webstationservice.fr: could not connect to host
-webstory.xyz: did not receive HSTS header
-webswitch.io: could not connect to host
-webszolgaltatas.hu: did not receive HSTS header
-webtalis.nl: did not receive HSTS header
-webtar.info: could not connect to host
-webtech.com.br: could not connect to host
-webtechgadgetry.com: did not receive HSTS header
-webtek.nu: could not connect to host
-webthings.com.br: could not connect to host
-webtiles.co.uk: could not connect to host
-webtobesocial.de: could not connect to host
-webuni.hu: did not receive HSTS header
-webutils.io: could not connect to host
-webveloper.com: did not receive HSTS header
-webvisum.de: did not receive HSTS header
-webwolf.co.za: could not connect to host
-webwork.pw: could not connect to host
-webypass.xyz: could not connect to host
-webz.one: could not connect to host
-webzanem.com: could not connect to host
-wecanfindit.co.za: could not connect to host
-wecanvisit.com: could not connect to host
-wedding-m.jp: did not receive HSTS header
-weddingalbumsdesign.com: did not receive HSTS header
-weddingfantasy.ru: could not connect to host
-weddingibiza.nl: could not connect to host
-weddingofficiantwilmington.com: could not connect to host
-wedestock.com: did not receive HSTS header
-wedos.com: did not receive HSTS header
-wedotrains.club: could not connect to host
-wedplay.host: could not connect to host
-weebsr.us: could not connect to host
-weed.ren: could not connect to host
-weedcircles.com: could not connect to host
-weedlandia.org: could not connect to host
-weednews.co: could not connect to host
-weekly.fyi: could not connect to host
-weeklycenter.co.jp: did not receive HSTS header
-weems.fr: could not connect to host
-weforgood.org.tw: could not connect to host
-wegenaer.nl: could not connect to host
-wegethitched.co.uk: could not connect to host
-weggeweest.nl: could not connect to host
-wegner.no: could not connect to host
-weicn.org: did not receive HSTS header
-weidehelp.com: did not receive HSTS header
-weightreviews.com: could not connect to host
-weiji.ga: did not receive HSTS header
-weiler.xyz: could not connect to host
-weili1111.com: could not connect to host
-weili1120.com: could not connect to host
-weili1121.com: could not connect to host
-weili1122.com: could not connect to host
-weili1123.com: could not connect to host
-weili1127.com: could not connect to host
-weili1128.com: could not connect to host
-weili88888.com: could not connect to host
-weilibet.com: could not connect to host
-weilibet.info: could not connect to host
-weilibet.net: could not connect to host
-weilibet.org: could not connect to host
-weiliyule.com: could not connect to host
-weiliyule.net: could not connect to host
-weimaraner.com.br: could not connect to host
-weiming.ddns.net: did not receive HSTS header
-weinhandel-preissler.de: could not connect to host
-weirdserver.com: could not connect to host
-weizenke.im: could not connect to host
-wejumall.com: did not receive HSTS header
-wekibe.de: could not connect to host
-welby.cat: did not receive HSTS header
-welches-kinderfahrrad.de: could not connect to host
-welcomehelp.de: could not connect to host
-weldwp.com: could not connect to host
-welkers.org: could not connect to host
-wellacapability.com: did not receive HSTS header
-wellandslim.de: did not receive HSTS header
-wellastore.ru: could not connect to host
-wellcareliving.net: could not connect to host
-wellcomp.com.br: could not connect to host
-welldrake.com: could not connect to host
-wellmarts.com: did not receive HSTS header
-wellness.so: could not connect to host
-wellopp.com: did not receive HSTS header
-wellproducedwines.com: could not connect to host
-wellsplasticsurgery.com: did not receive HSTS header
-wellspringcamps.com: did not receive HSTS header
-welovejobs.com: could not connect to host
-welovejudo.com: did not receive HSTS header
-welovemail.com: could not connect to host
-welpo.me: could not connect to host
-welpy.com: could not connect to host
-welsh.com.br: could not connect to host
-weltentreff.com: could not connect to host
-weltmeisterschaft.net: could not connect to host
-wemakebookkeepingeasy.com: could not connect to host
-weme.eu: could not connect to host
-wenchieh.com: could not connect to host
-wendabisheng.com: max-age too low: 0
-wendalyncheng.com: did not receive HSTS header
-wendigo.pl: max-age too low: 0
-wendu.me: could not connect to host
-wengebowuguan.com: could not connect to host
-wenode.net: did not receive HSTS header
-wenta-computerservice.net: could not connect to host
-wentu.ml: could not connect to host
-wenz.io: did not receive HSTS header
-wer.sh: did not receive HSTS header
-werbewelt-tv.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-werdeeintimo.de: could not connect to host
-wereldplanner.nl: could not connect to host
-werhatunsverraten.eu: could not connect to host
-werkaanonderwijs.nl: did not receive HSTS header
-werken-bij-inwork.nl: could not connect to host
-werkenbijkfc.nl: did not receive HSTS header
-werkeninvledder.nl: did not receive HSTS header
-werkinholland.com: could not connect to host
-werkplaatsoost.nl: did not receive HSTS header
-werkruimtebottendaal.nl: could not connect to host
-werktor.com: did not receive HSTS header
-werktor.net: did not receive HSTS header
-werkz.io: did not receive HSTS header
-werner-schaeffer.de: did not receive HSTS header
-wernerschaeffer.de: did not receive HSTS header
-wertpapiertreuhand.de: did not receive HSTS header
-wes-dev.com: could not connect to host
-wesayyesprogram.com: could not connect to host
-wesleyharris.ca: did not receive HSTS header
-wespeakgeek.co.za: could not connect to host
-wesreportportal.com: could not connect to host
-wessner.co: could not connect to host
-wessner.org: did not receive HSTS header
-west-trans.com.au: did not receive HSTS header
-westcentenaryscouts.org.au: did not receive HSTS header
-westcoastaggregate.com: could not connect to host
-westendzone.com: max-age too low: 0
-westerhoud.nl: did not receive HSTS header
-westhighlandwhiteterrier.com.br: could not connect to host
-westlahair.com: did not receive HSTS header
-westlaketire.pt: did not receive HSTS header
-westlife.cn: did not receive HSTS header
-westlights.net: did not receive HSTS header
-westlinwinds.com: could not connect to host
-westsussexconnecttosupport.org: could not connect to host
-westtulsa.com: did not receive HSTS header
-westwood.no: did not receive HSTS header
-wetherbymethodist.org.uk: did not receive HSTS header
-wetherbyweather.org.uk: did not receive HSTS header
-wetoxic.com: could not connect to host
-wettanbieter-vergleich.de: could not connect to host
-wettbonus.info: max-age too low: 0
-wettbuero.de: did not receive HSTS header
-wettertoertchen.com: could not connect to host
-wetthost.com: could not connect to host
-wetttipps.com: could not connect to host
-wetttipps.de: could not connect to host
-wevahoo.com: could not connect to host
-wevenues.com: could not connect to host
-wevolver.com: did not receive HSTS header
-wewillfixyouripad.co.uk: did not receive HSTS header
-wewillfixyourpc.co.uk: did not receive HSTS header
-wewillgo.com: could not connect to host
-wewillgo.org: did not receive HSTS header
-wewlad.me: could not connect to host
-wexilapp.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-weyland.tech: could not connect to host
-weynaphotography.com: could not connect to host
-wf-demo-eu.appspot.com: did not receive HSTS header (error ignored - included regardless)
-wfcom-98-wf-www.pantheonsite.io: could not connect to host
-wfsystem.net: did not receive HSTS header
-wftda.com: did not receive HSTS header
-wg-tools.de: could not connect to host
-wg1907.com: max-age too low: 0
-wge-feg.gc.ca: could not connect to host
-wgsi-friesland.nl: did not receive HSTS header
-whanau.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-whanwhy.com: max-age too low: 0
-whatanime.ga: could not connect to host
-whateveraspidercan.com: did not receive HSTS header
-whatisl.ovh: could not connect to host
-whats.io: could not connect to host
-whatsapp.com: did not receive HSTS header
-whatsapp.net: did not receive HSTS header
-whatsstalk.me: could not connect to host
-whatsupdeco.com: did not receive HSTS header
-whatsyouroffer.co.uk: did not receive HSTS header
-whdpc.gov: could not connect to host
-wheatgra.in: could not connect to host
-wheeler.kiwi.nz: could not connect to host
-wheelwide.co.uk: could not connect to host
-wheelwright.org: did not receive HSTS header
-wheezie.be: did not receive HSTS header
-when-release.com: did not receive HSTS header
-when-release.ru: did not receive HSTS header
-whereisjason.com: could not connect to host
-whereismyorigin.cf: could not connect to host
-whereiszakir.com: could not connect to host
-wherephoto.com: could not connect to host
-wheresben.today: could not connect to host
-whexit.nl: could not connect to host
-whiletrue.run: did not receive HSTS header
-whilsttraveling.com: could not connect to host
-whimtrip.fr: could not connect to host
-whirlpool-luboss.de: could not connect to host
-whisker.network: could not connect to host
-whiskey.town: did not receive HSTS header
-whisperwashonline.com: did not receive HSTS header
-whistler-transfers.com: did not receive HSTS header
-whiteeagleca.com: did not receive HSTS header
-whitehat.id: could not connect to host
-whitepinetn.gov: could not connect to host
-whiterabbitcakery.com: could not connect to host
-whiteready.it: did not receive HSTS header
-whiteroom.agency: did not receive HSTS header
-whiteshadowimperium.com: could not connect to host
-whitestagforge.com: did not receive HSTS header
-whitewebhosting.co.za: did not receive HSTS header
-whitewebhosting.com: could not connect to host
-whitewinterwolf.com: could not connect to host
-who.pm: could not connect to host
-whoasome.com: could not connect to host
-whoclicks.net: could not connect to host
-whoisamitsingh.com: could not connect to host
-whoisapi.online: could not connect to host
-whoiscuter.ml: could not connect to host
-whoiscutest.ml: could not connect to host
-whoisdhh.com: could not connect to host
-whoiswp.com: could not connect to host
-wholelotofbounce.co.uk: could not connect to host
-wholesalecbd.com: did not receive HSTS header
-wholikes.us: did not receive HSTS header
-whoneedstobeprimaried.today: could not connect to host
-whoownsmyavailability.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-whoshotya.de: did not receive HSTS header
-whosyourdaddy.ml: could not connect to host
-whqqq.com: could not connect to host
-whtcsj.com: could not connect to host
-whysuck.com: could not connect to host
-whythisguy.com: did not receive HSTS header
-wiapply.com: could not connect to host
-wibruje.pl: did not receive HSTS header
-wibuw.com: could not connect to host
-widenews.org: did not receive HSTS header
-widoj.gov: could not connect to host
-wiebetaaltdat.nl: could not connect to host
-wien52.com: could not connect to host
-wienerwichtelchallenge.at: did not receive HSTS header
-wieninternational.at: could not connect to host
-wifimapa.cz: could not connect to host
-wigelsworth.io: could not connect to host
-wiiaam.com: could not connect to host
-wiiforum.no: did not receive HSTS header
-wiire.me: could not connect to host
-wijnimportjanssen.nl: did not receive HSTS header
-wikiclash.info: could not connect to host
-wikilivres.ca: could not connect to host
-wikisports.eu: could not connect to host
-wikiwp.org: could not connect to host
-wiktoriaslife.com: did not receive HSTS header
-wild-emotion-events.de: could not connect to host
-wildbee.org: could not connect to host
-wildboaratvparts.com: did not receive HSTS header
-wildcard.hu: could not connect to host
-wildcatdiesel.com.au: did not receive HSTS header
-wilddog.com: did not receive HSTS header
-wilderky.gov: did not receive HSTS header
-wildlifeadaptationstrategy.gov: could not connect to host
-wildrough.com: did not receive HSTS header
-wildwind.world: could not connect to host
-wildzoopark.com: could not connect to host
-wilf1rst.com: could not connect to host
-willbarnesphotography.co.uk: could not connect to host
-willcipriano.com: could not connect to host
-willdropphoto.co.uk: could not connect to host
-willeminfo.ch: did not receive HSTS header
-willemsjort.be: did not receive HSTS header
-william.gg: did not receive HSTS header
-william.si: did not receive HSTS header
-williamboundsltd.com: could not connect to host
-williamsapiens.com: could not connect to host
-williamscountyoh.gov: did not receive HSTS header
-williamsflintlocks.com: did not receive HSTS header
-williamtm.design: could not connect to host
-willkommen-fuerstenberg.de: could not connect to host
-willywangstory.com.tw: could not connect to host
-willywangstory.org: could not connect to host
-wilsonovi.com: could not connect to host
-wilsonvilleoregon.gov: could not connect to host
-winaes.com: could not connect to host
-winbignow.click: could not connect to host
-wincasinowin.click: could not connect to host
-winclient.cn: could not connect to host
-wind.moe: did not receive HSTS header
-winddan.nz: could not connect to host
-windholz.us: did not receive HSTS header
-windows10insider.com: did not receive HSTS header
-windowsforum.com: did not receive HSTS header
-windowstech.it: did not receive HSTS header
-windowwellcovers.com: did not receive HSTS header
-windowwellexperts.com: did not receive HSTS header
-windrunner.se: could not connect to host
-winds.cf: could not connect to host
-windwoodmedia.com: could not connect to host
-windwoodweb.com: could not connect to host
-wine-importer.ru: could not connect to host
-winecodeavocado.com: could not connect to host
-wineonthewall.com: did not receive HSTS header
-winepress.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-winfield.me.uk: did not receive HSTS header
-winfographics.com: did not receive HSTS header
-winged.io: could not connect to host
-wingos.net: could not connect to host
-wingspatagonia.com: could not connect to host
-wingumd.net: could not connect to host
-winner.ua: did not receive HSTS header
-winnersports.co: could not connect to host
-winpack.cf: could not connect to host
-winpack.eu.org: could not connect to host
-winportal.cz: could not connect to host
-winsec.nl: could not connect to host
-winshiplending.com: could not connect to host
-winsufi.biz: could not connect to host
-wintercircle.co: max-age too low: 60
-wintzenterprise.com: did not receive HSTS header
-winwitharval.co.uk: could not connect to host
-wipc.net: did not receive HSTS header
-wipply.com: could not connect to host
-wirc.gr: could not connect to host
-wircon-int.net: could not connect to host
-wirelesswatch.com.au: could not connect to host
-wiretrip.io: could not connect to host
-wirkaufendeinau.to: could not connect to host
-wisak.eu: did not receive HSTS header
-wisdomize.me: could not connect to host
-wisecountytx.gov: did not receive HSTS header
-wiseflat.com: did not receive HSTS header
-wiseloan.com: did not receive HSTS header
-wishcert.com: could not connect to host
-wishesbee.com: could not connect to host
-wism.io: could not connect to host
-wissamnr.be: could not connect to host
-wissl.org: could not connect to host
-witae.com: could not connect to host
-with.de: did not receive HSTS header
-withgoogle.com: did not receive HSTS header (error ignored - included regardless)
-withmy.beer: could not connect to host
-withoutacrystalball.com: could not connect to host
-withustrading.com: did not receive HSTS header
-withyoutube.com: did not receive HSTS header (error ignored - included regardless)
-wittcher.com: could not connect to host
-wittydonut.com: could not connect to host
-witzemaschine.com: max-age too low: 0
-wixguide.co: could not connect to host
-wiz.farm: could not connect to host
-wizardmeow.xin: could not connect to host
-wizardspire.com: could not connect to host
-wizznab.tk: could not connect to host
-wjcainc.com: did not receive HSTS header
-wk-cpm.com: could not connect to host
-wk577.com: could not connect to host
-wl.bet: could not connect to host
-wl970.com: could not connect to host
-wl971.com: could not connect to host
-wl972.com: could not connect to host
-wl973.com: could not connect to host
-wl974.com: could not connect to host
-wl975.com: could not connect to host
-wl976.com: could not connect to host
-wl977.com: could not connect to host
-wl978.com: could not connect to host
-wlsme.org: did not receive HSTS header
-wlwlwx.com: could not connect to host
-wlx678d.com: could not connect to host
-wlzhiyin.cn: could not connect to host
-wmawri.com: did not receive HSTS header
-wmcns.net: could not connect to host
-wmcuk.net: could not connect to host
-wmfinanz.com: could not connect to host
-wmnrj.com: could not connect to host
-wmoda.com.br: did not receive HSTS header
-wmustore.com: did not receive HSTS header
-wnmm.nl: could not connect to host
-wnnc.co.uk: could not connect to host
-wnsr3970.com: could not connect to host
-wo211997.com: max-age too low: 0
-woah.how: could not connect to host
-woaiuhd.com: could not connect to host
-wobblylang.org: could not connect to host
-wochenentwicklung.com: did not receive HSTS header
-wod-stavby.cz: could not connect to host
-wodboss.com: could not connect to host
-wodice.com: could not connect to host
-wohnungsbau-ludwigsburg.de: did not receive HSTS header
-woi.vision: could not connect to host
-woima.fi: did not receive HSTS header
-wokeai.net: could not connect to host
-woktoss.com: could not connect to host
-wolfdev.fr: did not receive HSTS header
-wolfemg.com: did not receive HSTS header
-wolfenland.net: did not receive HSTS header
-wolfesden.com: could not connect to host
-wolfgang-kerschbaumer.com: could not connect to host
-wolfgang-kerschbaumer.net: could not connect to host
-wolfram.io: could not connect to host
-wolfvideoproductions.com: did not receive HSTS header
-wolkenspeicher.org: could not connect to host
-wolkjehosting.nl: could not connect to host
-wollekorb.de: could not connect to host
-wollgredel.de: did not receive HSTS header
-wom-en.org: could not connect to host
-womf.org: did not receive HSTS header
-womosale.de: could not connect to host
-wonabo.com: did not receive HSTS header
-wonderbooks.club: could not connect to host
-wonderfall.xyz: could not connect to host
-wonderhost.info: could not connect to host
-wondermags.com: could not connect to host
-wondershift.biz: did not receive HSTS header
-wondy.com: could not connect to host
-wongu.tech: did not receive HSTS header
-wooblr.com: could not connect to host
-woodfordcountyky.gov: could not connect to host
-woodmafia.com.au: could not connect to host
-woodminstermanagement.tk: could not connect to host
-woodridgeil.gov: could not connect to host
-woodsmillparkapartmentsstl.com: did not receive HSTS header
-woodworkertip.com: could not connect to host
-woofsbakery.com: could not connect to host
-woomai.net: could not connect to host
-woomu.me: could not connect to host
-woording.com: could not connect to host
-wootton95.com: could not connect to host
-wooviet.com: could not connect to host
-wopen.org: could not connect to host
-worcade.net: did not receive HSTS header
-wordbits.net: did not receive HSTS header
-wordlessecho.com: did not receive HSTS header
-wordpress-test.site: could not connect to host
-wordpresspro.cl: could not connect to host
-wordsofamaster.com: could not connect to host
-work-and-jockel.de: did not receive HSTS header
-workcheck.bz: could not connect to host
-workemy.com: could not connect to host
-workfone.io: could not connect to host
-workforce.co.tz: did not receive HSTS header
-workgrouptech.org: did not receive HSTS header
-workingmachine.info: could not connect to host
-workissime.com: did not receive HSTS header
-workmart.mx: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-workpermit.com.vn: could not connect to host
-workplaces.online: did not receive HSTS header
-workray.com: did not receive HSTS header
-worksofwyoming.org: did not receive HSTS header
-workwithgo.com: could not connect to host
-world-education-association.org: could not connect to host
-worldchess.london: could not connect to host
-worldcrafts.org: did not receive HSTS header
-worldeventscalendars.com: could not connect to host
-worldfree4.org: did not receive HSTS header
-worldlist.org: could not connect to host
-worldnettps.com: did not receive HSTS header
-worldofterra.net: did not receive HSTS header
-worldpovertysolutions.org: did not receive HSTS header
-worldsbeststory.com: did not receive HSTS header
-worldsoccerclips.com: could not connect to host
-worldtravelandadventure.com: did not receive HSTS header
-worldwhisperer.net: could not connect to host
-wormdisk.net: could not connect to host
-wormholevpn.net: could not connect to host
-wormincorporated.tk: could not connect to host
-worshapp.com: did not receive HSTS header
-worthygo.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-woshiluo.site: could not connect to host
-wot-tudasbazis.hu: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-woufbox.com: did not receive HSTS header
-wow-travel.eu: could not connect to host
-wow202y5.com: could not connect to host
-wowapi.org: could not connect to host
-wowhelp.it: could not connect to host
-wowinvasion.com: did not receive HSTS header
-wowprezi.com: did not receive HSTS header
-woxter.com: did not receive HSTS header
-wozalapha.com: did not receive HSTS header
-wp-bullet.com: did not receive HSTS header
-wp-fastsearch.de: could not connect to host
-wp-rescue.com.au: could not connect to host
-wp-securehosting.com: could not connect to host
-wp-stack.pro: could not connect to host
-wp6.pw: did not receive HSTS header
-wpabzar.ir: did not receive HSTS header
-wpblog.com.tw: could not connect to host
-wpbook-pacificmall.work: did not receive HSTS header
-wpcarer.pro: could not connect to host
-wpccu.org: did not receive HSTS header
-wpcharged.nz: did not receive HSTS header
-wpcheck.io: could not connect to host
-wpcontrol.se: could not connect to host
-wpdesigner.ir: did not receive HSTS header
-wpdirecto.com: did not receive HSTS header
-wpdublin.com: did not receive HSTS header
-wpenhance.com: could not connect to host
-wpexplainer.com: did not receive HSTS header
-wpfast.net: could not connect to host
-wpfortify.com: did not receive HSTS header
-wpg-inc.com: did not receive HSTS header
-wpgoblin.com: could not connect to host
-wphelpwithhomework.tk: could not connect to host
-wphome.org: could not connect to host
-wphostingspot.com: did not receive HSTS header
-wpinfos.de: did not receive HSTS header
-wplatin.com: could not connect to host
-wpletter.de: did not receive HSTS header
-wpmetadatastandardsproject.org: could not connect to host
-wpoptimalizace.cz: could not connect to host
-wprevs.com: did not receive HSTS header
-wpruby.com: did not receive HSTS header
-wpscans.com: did not receive HSTS header
-wpsec.nl: did not receive HSTS header
-wpsono.com: could not connect to host
-wpspeed.nl: did not receive HSTS header
-wptomatic.de: could not connect to host
-wpunpacked.com: could not connect to host
-wpvulndb.com: did not receive HSTS header
-wpyecom.es: could not connect to host
-wpzhiku.com: did not receive HSTS header
-wql.zj.cn: could not connect to host
-wrapit.hu: could not connect to host
-wrapitup.co.uk: did not receive HSTS header
-wrd48.net: could not connect to host
-wrfu.co.nz: did not receive HSTS header
-wrglzd.com: could not connect to host
-wriedts.de: did not receive HSTS header
-wrightdoumawedding.com: could not connect to host
-wrightselfstorageandremovals.com: did not receive HSTS header
-writeapp.me: did not receive HSTS header
-writeenglishright.com: did not receive HSTS header
-writepride.com: could not connect to host
-writing-job-online.com: did not receive HSTS header
-wrksheet.com: did not receive HSTS header
-wrldevelopment.com: did not receive HSTS header
-wrn.sh: could not connect to host
-wroffle.com: did not receive HSTS header
-wromeapp.com: could not connect to host
-wrongware.cz: could not connect to host
-wrwg.ca: could not connect to host
-wryoutube.com: could not connect to host
-ws-meca.com: could not connect to host
-ws.net.cn: did not receive HSTS header
-wscore.me: could not connect to host
-wsdcap.com: could not connect to host
-wsor.group: did not receive HSTS header
-wsp-center.com: could not connect to host
-wss.com.ve: could not connect to host
-wsscompany.com.ve: could not connect to host
-wssv.ch: could not connect to host
-wsup.social: could not connect to host
-wsv-grafenau.de: did not receive HSTS header
-wsyy.info: could not connect to host
-wt-server3.de: could not connect to host
-wtf.ninja: could not connect to host
-wtfismyip.com: did not receive HSTS header
-wtfsec.org: did not receive HSTS header
-wu6v.com: did not receive HSTS header
-wuav.net: could not connect to host
-wubify.com: did not receive HSTS header
-wubocong.com: did not receive HSTS header
-wubthecaptain.eu: could not connect to host
-wucanyao.com: max-age too low: 0
-wufu.org: did not receive HSTS header
-wufupay.com: could not connect to host
-wugniu.com: did not receive HSTS header
-wuhengmin.com: could not connect to host
-wuifan.com: did not receive HSTS header
-wulpi.it: did not receive HSTS header
-wumai-p.cn: could not connect to host
-wumai.cloud: could not connect to host
-wumbo.cf: could not connect to host
-wumbo.ga: could not connect to host
-wumbo.gq: could not connect to host
-wumbo.kiwi: could not connect to host
-wumbo.ml: could not connect to host
-wumbo.tk: could not connect to host
-wundtherapie-schulung.de: could not connect to host
-wunschpreisauto.de: did not receive HSTS header
-wuppertal-2018.de: could not connect to host
-wurzelzwerg.net: could not connect to host
-wusx.club: could not connect to host
-wutianxian.com: could not connect to host
-wuwuwu.me: could not connect to host
-wuxiaobai.win: could not connect to host
-wuyang.ws: could not connect to host
-wuyue.photo: could not connect to host
-wv-n.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-wvr-law.de: did not receive HSTS header
-wvv-8522.com: could not connect to host
-wvw-8522.com: could not connect to host
-wvw698.com: max-age too low: 2592000
-ww2onlineshop.com: did not receive HSTS header
-ww5197.co: could not connect to host
-ww6396.com: did not receive HSTS header
-ww6729.co: could not connect to host
-ww6729.com: did not receive HSTS header
-ww6957.co: could not connect to host
-ww9397.com: could not connect to host
-ww9721.com: could not connect to host
-ww9728.co: could not connect to host
-wwbsb.xyz: could not connect to host
-wwc.ren: could not connect to host
-wwtext.com: could not connect to host
-wwv-8522.com: could not connect to host
-www-001133.com: could not connect to host
-www-0385.com: could not connect to host
-www-1116.com: did not receive HSTS header
-www-1117.com: could not connect to host
-www-33445.com: could not connect to host
-www-38978.com: could not connect to host
-www-39988.com: did not receive HSTS header
-www-49889.com: could not connect to host
-www-507.net: could not connect to host
-www-62755.com: could not connect to host
-www-66136.com: could not connect to host
-www-68277.com: could not connect to host
-www-746.com: could not connect to host
-www-7570.com: could not connect to host
-www-771122.com: did not receive HSTS header
-www-8003.com: did not receive HSTS header
-www-80036.com: could not connect to host
-www-8522.am: could not connect to host
-www-86499.com: could not connect to host
-www-8722.com: could not connect to host
-www-88599.com: did not receive HSTS header
-www-8887999.com: could not connect to host
-www-9118.com: did not receive HSTS header
-www-9649.com: could not connect to host
-www-9995.com: could not connect to host
-www-djbet.com: could not connect to host
-www-jinshavip.com: could not connect to host
-www-pj009.com: could not connect to host
-www.apollo-auto.com: did not receive HSTS header
-www.calyxinstitute.org: did not receive HSTS header
-www.captaintrain.com: did not receive HSTS header
-www.cueup.com: could not connect to host
-www.cyveillance.com: could not connect to host
-www.developer.mydigipass.com: could not connect to host
-www.elanex.biz: could not connect to host
-www.g.co: did not receive HSTS header (error ignored - included regardless)
-www.gmail.com: did not receive HSTS header (error ignored - included regardless)
-www.googlemail.com: did not receive HSTS header (error ignored - included regardless)
-www.gpo.gov: did not receive HSTS header
-www.greplin.com: could not connect to host
-www.icann.org: could not connect to host
-www.jitsi.org: did not receive HSTS header
-www.lastpass.com: did not receive HSTS header
-www.ledgerscope.net: could not connect to host
-www.logentries.com: did not receive HSTS header
-www.makeyourlaws.org: could not connect to host
-www.moneybookers.com: did not receive HSTS header
-www.mydigipass.com: did not receive HSTS header
-www.neonisi.com: could not connect to host
-www.org.gg: could not connect to host
-www.paycheckrecords.com: did not receive HSTS header
-www.raiffeisen.ch: could not connect to host
-www.rme.li: did not receive HSTS header
-www.sandbox.mydigipass.com: could not connect to host
-www.simbolo.co.uk: could not connect to host
-www.surfeasy.com: did not receive HSTS header
-www.zenpayroll.com: did not receive HSTS header
-www00228c.com: could not connect to host
-www3.info: did not receive HSTS header
-www63605.com: did not receive HSTS header
-wwwn888.com: could not connect to host
-wwww.is: could not connect to host
-wwww.me.uk: could not connect to host
-wx37.ac.cn: could not connect to host
-wxukang.cn: did not receive HSTS header
-wxyz.buzz: could not connect to host
-wxzm.sx: could not connect to host
-wy6.org: did not receive HSTS header
-wybmabiity.com: could not connect to host
-wygluszanie.eu: could not connect to host
-wyjmb.com: max-age too low: 0
-wylog.ph: could not connect to host
-wynterhill.co.uk: did not receive HSTS header
-wyomingexiles.com: did not receive HSTS header
-wypemagazine.se: did not receive HSTS header
-wyu.cc: could not connect to host
-wyysoft.tk: could not connect to host
-wyzwaniemilosci.com: could not connect to host
-wzfetish.com.br: did not receive HSTS header
-x-pertservice.com: did not receive HSTS header
-x-power-detox.com: could not connect to host
-x-ripped-hd.com: could not connect to host
-x00.me: could not connect to host
-x00228.com: could not connect to host
-x1616.tk: could not connect to host
-x1be.win: did not receive HSTS header
-x2c0.net: could not connect to host
-x2w.io: could not connect to host
-x30365.com: could not connect to host
-x3led.com: could not connect to host
-x509.io: could not connect to host
-x509.pub: could not connect to host
-x509.pw: could not connect to host
-x5197.co: could not connect to host
-x58.vip: did not receive HSTS header
-x58f.com: could not connect to host
-x58p.com: could not connect to host
-x58t.com: could not connect to host
-x58v.com: could not connect to host
-x64architecture.com: could not connect to host
-x668.cc: did not receive HSTS header
-x6729.co: could not connect to host
-x6957.co: could not connect to host
-x7715.com: could not connect to host
-x7716.com: could not connect to host
-x9016.com: could not connect to host
-x9721.com: could not connect to host
-x9728.co: could not connect to host
-x98t.com: could not connect to host
-xab199.com: could not connect to host
-xanax.pro: could not connect to host
-xanderbron.tech: could not connect to host
-xanderweaver.com: did not receive HSTS header
-xandocs.com: could not connect to host
-xat.re: did not receive HSTS header
-xavier.is: could not connect to host
-xavierbarroso.com: did not receive HSTS header
-xawen.net: did not receive HSTS header
-xb008.com: could not connect to host
-xb1001.com: could not connect to host
-xb115.com: could not connect to host
-xb2002.com: could not connect to host
-xb201.com: could not connect to host
-xb3008.com: could not connect to host
-xb306.com: could not connect to host
-xb3636.com: could not connect to host
-xb380.com: could not connect to host
-xb3888.com: could not connect to host
-xb6008.com: could not connect to host
-xb601.com: could not connect to host
-xb6600.com: could not connect to host
-xb6610.com: could not connect to host
-xb6616.com: could not connect to host
-xb6619.com: could not connect to host
-xb6625.com: could not connect to host
-xb6627.com: could not connect to host
-xb6628.com: could not connect to host
-xb6629.com: could not connect to host
-xb6632.com: could not connect to host
-xb6636.com: could not connect to host
-xb6638.com: could not connect to host
-xb6639.com: could not connect to host
-xb6656.com: could not connect to host
-xb6673.com: could not connect to host
-xb6676.com: could not connect to host
-xb6679.com: could not connect to host
-xb6680.com: could not connect to host
-xb6683.com: could not connect to host
-xb6689.com: could not connect to host
-xb6692.com: could not connect to host
-xb6696.com: could not connect to host
-xb6806.com: could not connect to host
-xb6808.com: could not connect to host
-xb6866.com: could not connect to host
-xb6880.com: could not connect to host
-xb7001.com: could not connect to host
-xb7077.com: could not connect to host
-xb7676.com: could not connect to host
-xb780.com: could not connect to host
-xb8006.com: could not connect to host
-xb8018.com: could not connect to host
-xb836.com: could not connect to host
-xb851.com: could not connect to host
-xb852.com: could not connect to host
-xb853.com: could not connect to host
-xb856.com: could not connect to host
-xb857.com: could not connect to host
-xb859.com: could not connect to host
-xb8606.com: could not connect to host
-xb862.com: could not connect to host
-xb865.com: could not connect to host
-xb871.com: could not connect to host
-xb872.com: could not connect to host
-xb873.com: could not connect to host
-xb8801.com: could not connect to host
-xb8806.com: could not connect to host
-xb8808.com: could not connect to host
-xb8861.com: could not connect to host
-xb891.com: could not connect to host
-xb893.com: could not connect to host
-xb896.com: could not connect to host
-xb9009.com: could not connect to host
-xb901.com: could not connect to host
-xb906.com: could not connect to host
-xb913.com: could not connect to host
-xb917.com: could not connect to host
-xb925.com: could not connect to host
-xb927.com: could not connect to host
-xb935.com: could not connect to host
-xb936.com: could not connect to host
-xb937.com: could not connect to host
-xb951.com: could not connect to host
-xb952.com: could not connect to host
-xb953.com: could not connect to host
-xb957.com: could not connect to host
-xb961.com: could not connect to host
-xb962.com: could not connect to host
-xb963.com: could not connect to host
-xb965.com: could not connect to host
-xb967.com: could not connect to host
-xb971.com: could not connect to host
-xb972.com: could not connect to host
-xb976.com: could not connect to host
-xb980.com: could not connect to host
-xb982.com: could not connect to host
-xb983.com: could not connect to host
-xbc.nz: could not connect to host
-xbind.io: could not connect to host
-xbjt1.com: could not connect to host
-xbjt11.com: could not connect to host
-xbjt2.com: could not connect to host
-xbjt22.com: could not connect to host
-xbjt3.com: could not connect to host
-xbjt33.com: could not connect to host
-xbjt4.com: could not connect to host
-xbjt5.com: could not connect to host
-xbjt55.com: could not connect to host
-xbjt66.com: could not connect to host
-xbjt666.com: could not connect to host
-xbjt7.com: could not connect to host
-xbjt77.com: could not connect to host
-xbjt9.com: could not connect to host
-xboxdownloadthat.com: could not connect to host
-xbpay88.com: could not connect to host
-xbt.co: could not connect to host
-xbvip.net: could not connect to host
-xbvip99.com: could not connect to host
-xbyl.xn--fiqs8s: could not connect to host
-xbyl15.com: could not connect to host
-xbyl16.com: could not connect to host
-xbyl17.com: could not connect to host
-xbyl18.com: could not connect to host
-xbyl21.com: could not connect to host
-xbyl23.com: could not connect to host
-xbyl26.com: could not connect to host
-xbyl28.com: could not connect to host
-xbyl39.com: could not connect to host
-xbyl60.com: could not connect to host
-xbyl62.com: could not connect to host
-xbyl63.com: could not connect to host
-xbyl67.com: could not connect to host
-xbyl68.com: could not connect to host
-xbyl69.com: could not connect to host
-xbyl71.com: could not connect to host
-xbyl73.com: could not connect to host
-xbyl78.com: could not connect to host
-xbyl82.com: could not connect to host
-xbyl85.com: could not connect to host
-xbyl86.com: could not connect to host
-xbyl89.com: could not connect to host
-xbyl91.com: could not connect to host
-xchangeinfo.com: could not connect to host
-xchating.com: could not connect to host
-xcompany.one: could not connect to host
-xcoop.me: did not receive HSTS header
-xd.fi: did not receive HSTS header
-xd.gov: could not connect to host
-xdavidhu.me: did not receive HSTS header
-xdd.io: could not connect to host
-xehoivn.vn: could not connect to host
-xellos.ga: could not connect to host
-xellos.ml: could not connect to host
-xenesisziarovky.sk: could not connect to host
-xeniox.ch: did not receive HSTS header
-xenolith.eu: did not receive HSTS header
-xenon.cloud: could not connect to host
-xenosphere.tk: could not connect to host
-xenotropegames.com: could not connect to host
-xeonlab.com: could not connect to host
-xeonlab.de: could not connect to host
-xerblade.com: did not receive HSTS header
-xett.com: could not connect to host
-xfive.de: did not receive HSTS header
-xg3n1us.de: did not receive HSTS header
-xgusto.com: could not connect to host
-xh7eee.com: could not connect to host
-xhadius.de: could not connect to host
-xhcmnews.com: could not connect to host
-xhily.com: did not receive HSTS header
-xhotlips.date: could not connect to host
-xi.ht: could not connect to host
-xia100.xyz: could not connect to host
-xiang111.com: max-age too low: 0
-xiangfajia.cn: could not connect to host
-xiangqiushi.com: could not connect to host
-xianguocy.com: could not connect to host
-xianjianruishiyouyiyuan.com: could not connect to host
-xiao094605.com: max-age too low: 0
-xiaobaiwancai.com: max-age too low: 0
-xiaobude.cn: could not connect to host
-xiaody.me: could not connect to host
-xiaofengsky.com: did not receive HSTS header
-xiaohui.love: could not connect to host
-xiaolan.me: could not connect to host
-xiaolanglang.net: could not connect to host
-xiaolvmu.com: could not connect to host
-xiaolvmu.me: could not connect to host
-xiaomao.tk: could not connect to host
-xiaomi.express: did not receive HSTS header
-xiaomionline24.pl: could not connect to host
-xiaoniaoyou.com: did not receive HSTS header
-xiaoxiao.im: could not connect to host
-xiaoyu.net: could not connect to host
-xiaoyy.org: did not receive HSTS header
-xiaxuejin.cn: could not connect to host
-xiazhaobing.com: max-age too low: 0
-xice.cf: could not connect to host
-xiecongan.org: could not connect to host
-xilegames.com: could not connect to host
-xilkoi.net: did not receive HSTS header
-ximage.me: could not connect to host
-ximens.me: could not connect to host
-xinbiji.cn: could not connect to host
-xinbo010.com: could not connect to host
-xinbo016.com: could not connect to host
-xinbo018.com: could not connect to host
-xinbo019.com: could not connect to host
-xinbo020.com: could not connect to host
-xinbo026.com: could not connect to host
-xinbo028.com: could not connect to host
-xinbo030.com: could not connect to host
-xinbo038.com: could not connect to host
-xinbo050.com: could not connect to host
-xinbo056.com: could not connect to host
-xinbo059.com: could not connect to host
-xinbo060.com: could not connect to host
-xinbo066.com: could not connect to host
-xinbo068.com: could not connect to host
-xinbo069.com: could not connect to host
-xinbo070.com: could not connect to host
-xinbo076.com: could not connect to host
-xinbo078.com: could not connect to host
-xinbo079.com: could not connect to host
-xinbo080.com: could not connect to host
-xinbo086.com: could not connect to host
-xinbo088.com: could not connect to host
-xinbo089.com: could not connect to host
-xinbo090.com: could not connect to host
-xinbo096.com: could not connect to host
-xinbo098.com: could not connect to host
-xinbo099.com: could not connect to host
-xinbo120.com: could not connect to host
-xinbo129.com: could not connect to host
-xinbo130.com: could not connect to host
-xinbo138.com: could not connect to host
-xinbo150.com: could not connect to host
-xinbo156.com: could not connect to host
-xinbo158.com: could not connect to host
-xinbo160.com: could not connect to host
-xinbo170.com: could not connect to host
-xinbo178.com: could not connect to host
-xinbo179.com: could not connect to host
-xinbo180.com: could not connect to host
-xinbo186.com: could not connect to host
-xinbo189.com: could not connect to host
-xinbo190.com: could not connect to host
-xinbo196.com: could not connect to host
-xinbo198.com: could not connect to host
-xinbo200.com: could not connect to host
-xinbo218.com: could not connect to host
-xinbo238.com: could not connect to host
-xinbo256.com: could not connect to host
-xinbo258.com: could not connect to host
-xinbo260.com: could not connect to host
-xinbo266.com: could not connect to host
-xinbo268.com: could not connect to host
-xinbo269.com: could not connect to host
-xinbo270.com: could not connect to host
-xinbo276.com: could not connect to host
-xinbo278.com: could not connect to host
-xinbo279.com: could not connect to host
-xinbo280.com: could not connect to host
-xinbo286.com: could not connect to host
-xinbo290.com: could not connect to host
-xinbo296.com: could not connect to host
-xinbo298.com: could not connect to host
-xinbo299.com: could not connect to host
-xinbo306.com: could not connect to host
-xinbo308.com: could not connect to host
-xinbo316.com: could not connect to host
-xinbo318.com: could not connect to host
-xinbo326.com: could not connect to host
-xinbo338.com: could not connect to host
-xinbo350.com: could not connect to host
-xinbo356.com: could not connect to host
-xinbo359.com: could not connect to host
-xinbo369.com: could not connect to host
-xinbo376.com: could not connect to host
-xinbo378.com: could not connect to host
-xinbo379.com: could not connect to host
-xinbo38.com: could not connect to host
-xinbo380.com: could not connect to host
-xinbo386.com: could not connect to host
-xinbo389.com: could not connect to host
-xinbo390.com: could not connect to host
-xinbo396.com: could not connect to host
-xinbo398.com: could not connect to host
-xinbo399.com: could not connect to host
-xinbo400.com: could not connect to host
-xinbo401.com: could not connect to host
-xinbo406.com: could not connect to host
-xinbo407.com: could not connect to host
-xinbo466.com: could not connect to host
-xinbo468.com: could not connect to host
-xinbo478.com: could not connect to host
-xinbo480.com: could not connect to host
-xinbo496.com: could not connect to host
-xinbo498.com: could not connect to host
-xinbo506.com: could not connect to host
-xinbo508.com: could not connect to host
-xinbo516.com: could not connect to host
-xinbo526.com: could not connect to host
-xinbo528.com: could not connect to host
-xinbo536.com: could not connect to host
-xinbo538.com: could not connect to host
-xinbo556.com: could not connect to host
-xinbo566.com: could not connect to host
-xinbo570.com: could not connect to host
-xinbo576.com: could not connect to host
-xinbo578.com: could not connect to host
-xinbo580.com: could not connect to host
-xinbo586.com: could not connect to host
-xinbo590.com: could not connect to host
-xinbo600.com: could not connect to host
-xinbo608.com: could not connect to host
-xinbo609.com: could not connect to host
-xinbo610.com: could not connect to host
-xinbo676.com: could not connect to host
-xinboyule.com: could not connect to host
-xinex.cz: could not connect to host
-xing.ml: could not connect to host
-xinghuokeji.xin: could not connect to host
-xingiahanvisa.net: did not receive HSTS header
-xinj.com: did not receive HSTS header
-xinlandm.com: could not connect to host
-xinnixwebshop.be: did not receive HSTS header
-xinplay.net: max-age too low: 0
-xinpujing918.com: could not connect to host
-xinqinhai.com: could not connect to host
-xinsto.com: could not connect to host
-xiongx.cn: could not connect to host
-xiqi.us: could not connect to host
-xirion.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-xisa.it: could not connect to host
-xivpn.com: could not connect to host
-xiwu.li: could not connect to host
-xiyu.it: did not receive HSTS header
-xjoin.de: could not connect to host
-xkblog.xyz: could not connect to host
-xlaff.com: could not connect to host
-xlboo.com: did not receive HSTS header
-xldl.ml: could not connect to host
-xlem.cn: could not connect to host
-xlfblog.com: could not connect to host
-xlfilippou.com: could not connect to host
-xliang.co: did not receive HSTS header
-xlinar.com: could not connect to host
-xlui.me: did not receive HSTS header
-xlunastore.com: did not receive HSTS header
-xmerak.com: could not connect to host
-xmine128.tk: did not receive HSTS header
-xmiui.com: could not connect to host
-xmlogin288.com: could not connect to host
-xmodule.org: could not connect to host
-xmonk.org: did not receive HSTS header
-xmr.my: could not connect to host
-xms66.top: did not receive HSTS header
-xmtpro.com: did not receive HSTS header
-xmusic.live: could not connect to host
-xn-----8kcgbo2bmdgkdacthvjf.xn--p1ai: could not connect to host
-xn----7sbfl2alf8a.xn--p1ai: could not connect to host
-xn----7sbmucgqdbgwwc5e9b.xn--p1ai: could not connect to host
-xn----8sbjfacqfqshbh7afyeg.xn--80asehdb: did not receive HSTS header
-xn----zmcaltpp1mdh16i.com: could not connect to host
-xn---35-6cdk1dnenygj.xn--p1ai: did not receive HSTS header
-xn--0kq33cbsi8bk6d417b.com: could not connect to host
-xn--15tx89ctvm.xn--6qq986b3xl: could not connect to host
-xn--1yst51avkr.ga: could not connect to host
-xn--1yst51avkr.xn--6qq986b3xl: could not connect to host
-xn--24-6kch4bfqee.xn--p1ai: could not connect to host
-xn--24-glcia8dc.xn--p1ai: could not connect to host
-xn--3lqp21gwna.cn: could not connect to host
-xn--3lqp21gwna.xn--fiqs8s: could not connect to host
-xn--3lqp21gwna.xn--fiqz9s: could not connect to host
-xn--3lqt7ir4md4tzwa.cn: could not connect to host
-xn--3lqt7ir4md4tzwa.xn--fiqs8s: could not connect to host
-xn--3px.jp: could not connect to host
-xn--4dbfsnr.xn--9dbq2a: could not connect to host
-xn--4dbjwf8c.cf: could not connect to host
-xn--4dbjwf8c.ga: could not connect to host
-xn--4dbjwf8c.gq: could not connect to host
-xn--4dbjwf8c.ml: could not connect to host
-xn--4dbjwf8c.tk: could not connect to host
-xn--4kro7fswi.xn--6qq986b3xl: could not connect to host
-xn--5kv19nxn6b.club: did not receive HSTS header
-xn--68jub.pw: could not connect to host
-xn--6cv66l79sp0n0ibo7s9ne.xyz: did not receive HSTS header
-xn--6oqx6c301allufxcm23a7sm.com: could not connect to host
-xn--6qq52xuogcjfw8pwqp.ga: could not connect to host
-xn--6qq62xsogfjfs8p1qp.ga: could not connect to host
-xn--7rvz7ku3ppnr.jp: could not connect to host
-xn--7v8h.cf: could not connect to host
-xn--80aaagmgvmvmcuoq7r.xn--p1ai: did not receive HSTS header
-xn--80ablh1c.online: could not connect to host
-xn--80ac0aqlt.xn--p1ai: could not connect to host
-xn--80adb4aeode.xn--p1ai: could not connect to host
-xn--80anogxed.xn--p1ai: could not connect to host
-xn--80aocgsfei.xn--p1ai: could not connect to host
-xn--88j2fy28hbxmnnf9zlw5buzd.com: did not receive HSTS header
-xn--8dry00a7se89ay98epsgxxq.com: could not connect to host
-xn--8mr166hf6s.xn--fiqs8s: could not connect to host
-xn--90aroj.xn--p1ai: did not receive HSTS header
-xn--98jm6m.jp: could not connect to host
-xn--9pr52k0p5a.com: could not connect to host
-xn--acompaamientoholistico-pec.com: could not connect to host
-xn--bstlinser-v2a.com: could not connect to host
-xn--c5w27q.ml: could not connect to host
-xn--cckvb1cwa0c5br5e2d2711k.net: could not connect to host
-xn--circul-gva.cc: could not connect to host
-xn--circul-u3a.cc: could not connect to host
-xn--datenrettung-mnchen-jbc.com: did not receive HSTS header
-xn--dcko6fsa5b1a8gyicbc.biz: could not connect to host
-xn--dckya4a0bya6x.com: could not connect to host
-xn--dckya4a0bya6x.jp: could not connect to host
-xn--dej-3oa.lv: could not connect to host
-xn--die-hrercharts-zpb.de: could not connect to host
-xn--die-zahnrzte-ncb.de: did not receive HSTS header
-xn--dk8haaa.ws: could not connect to host
-xn--e--0g4aiy1b8rmfg3o.jp: could not connect to host
-xn--e--4h4axau6ld4lna0g.com: could not connect to host
-xn--e--ig4a4c3f6bvc5et632i.com: could not connect to host
-xn--e--k83a5h244w54gttk.xyz: could not connect to host
-xn--e1aoahhqgn.xn--p1ai: could not connect to host
-xn--ecki0cd0bu9a4nsjb.com: could not connect to host
-xn--eckle6c0exa0b0modc7054g7h8ajw6f.com: did not receive HSTS header
-xn--ehq13kgw4e.ml: could not connect to host
-xn--ekr87w7se89ay98ezcs.biz: did not receive HSTS header
-xn--elsignificadodesoar-c4b.com: could not connect to host
-xn--eo5aaa.eu.org: could not connect to host
-xn--fiestadefindeao-crb.com: could not connect to host
-xn--gi8hwa.tk: did not receive HSTS header
-xn--gmq92k.nagoya: could not connect to host
-xn--hfk-allgu-schwaben-stb.de: could not connect to host
-xn--hmdiseoweb-y9a.com.ar: could not connect to host
-xn--hwt895j.xn--kpry57d: could not connect to host
-xn--int-ru8ea.xn--6qq986b3xl: could not connect to host
-xn--internetlnen-1cb.com: could not connect to host
-xn--j4h.cf: could not connect to host
-xn--jbs-tna.de: did not receive HSTS header
-xn--jp-6l5cs1yf3ivjsglphyv.net: could not connect to host
-xn--jywq5uqwqxhd2onsij.jp: did not receive HSTS header
-xn--kckd0bd4a8tp27yee2e.com: could not connect to host
-xn--keditr-0xa.biz: could not connect to host
-xn--kreuzwortrtsel-fib.life: did not receive HSTS header
-xn--krpto-lva.de: could not connect to host
-xn--l8j9d2b.jp: could not connect to host
-xn--lgb3a8bcpn.cf: could not connect to host
-xn--lgb3a8bcpn.ga: could not connect to host
-xn--lgb3a8bcpn.gq: could not connect to host
-xn--lgb3a8bcpn.ml: could not connect to host
-xn--lna-2000-9za.nu: could not connect to host
-xn--lna-4000-9za.nu: could not connect to host
-xn--ls8hi7a.tk: could not connect to host
-xn--lsupp-mra.net: did not receive HSTS header
-xn--maraa-rta.org: did not receive HSTS header
-xn--mensenges-o1a8c.gq: could not connect to host
-xn--mensengesss-t8a.gq: could not connect to host
-xn--mhsv04avtt1xi.com: could not connect to host
-xn--milchaufschumer-test-lzb.de: could not connect to host
-xn--mllers-wxa.info: did not receive HSTS header
-xn--n8jubz39q0g0afpa985c.com: could not connect to host
-xn--neb-tma3u8u.xyz: could not connect to host
-xn--nf1a578axkh.xn--fiqs8s: did not receive HSTS header
-xn--nrrdetval-v2ab.se: could not connect to host
-xn--o77hka.ga: could not connect to host
-xn--obt757c.com: could not connect to host
-xn--p3t555glxhnwa.com: could not connect to host
-xn--p8jskj.jp: could not connect to host
-xn--pck4e3a2ex597b4ml.xyz: could not connect to host
-xn--pckqk6xk43lunk.net: could not connect to host
-xn--q9ji3c6d.xn--q9jyb4c: did not receive HSTS header
-xn--qckqc0nxbyc4cdb4527err7c.biz: could not connect to host
-xn--qckss0j.tk: could not connect to host
-xn--qckyd1cu698a35zarib.xyz: could not connect to host
-xn--qfun83b.ga: could not connect to host
-xn--r77hya.ga: could not connect to host
-xn--registriertesexualstraftter-ykc.de: could not connect to host
-xn--rt-cja.eu: could not connect to host
-xn--sdkwa9azd389v01ya.com: could not connect to host
-xn--seelenwchter-mcb.eu: could not connect to host
-xn--skmotoroptimering-zzb.site: could not connect to host
-xn--spenijmazania-yhc.pl: could not connect to host
-xn--srenpind-54a.dk: could not connect to host
-xn--t8j2a3042d.xyz: did not receive HSTS header
-xn--t8j4aa4nkg1h9bwcvud.com: could not connect to host
-xn--t8j4aa4nyhxa7duezbl49aqg5546e264d.net: did not receive HSTS header
-xn--t8jo9k1b.com: could not connect to host
-xn--tda.ml: could not connect to host
-xn--thorme-6uaf.ca: could not connect to host
-xn--trdler-xxa.xyz: could not connect to host
-xn--u9jy16ncfao19mo8i.nagoya: could not connect to host
-xn--uist1idrju3i.jp: could not connect to host
-xn--uort9oqoaj00bv04d.biz: could not connect to host
-xn--uorz58b8p0bpwa.biz: could not connect to host
-xn--vck8crc010pu14e.biz: could not connect to host
-xn--vck8crc655y34ioha.net: did not receive HSTS header
-xn--vck8crcu789ajtaj92eura.xyz: could not connect to host
-xn--w22a.jp: could not connect to host
-xn--werner-schffer-fib.de: could not connect to host
-xn--whlefamilie-l8a.de: did not receive HSTS header
-xn--wmq.jp: did not receive HSTS header
-xn--woistdermlleimer-rzb.de: could not connect to host
-xn--xdtx3pfzbiw3ar8e7yedqrhui.com: could not connect to host
-xn--xft85up3jca.ga: could not connect to host
-xn--xz1a.jp: could not connect to host
-xn--y8j148r.xn--q9jyb4c: could not connect to host
-xn--y8j2eb5631a4qf5n0h.com: could not connect to host
-xn--y8j5gq14rbdd.net: did not receive HSTS header
-xn--yj8h0m.ws: could not connect to host
-xn--ykrp42k.com: could not connect to host
-xn--yoamomisuasbcn-ynb.com: could not connect to host
-xn--yrvp1ac68c.xn--6qq986b3xl: could not connect to host
-xn--zck9a4b352yuua.jp: could not connect to host
-xn--zr9h.cf: could not connect to host
-xn--zr9h.ga: could not connect to host
-xn--zr9h.ml: could not connect to host
-xn--zr9h.tk: could not connect to host
-xng.io: did not receive HSTS header
-xobox.me: could not connect to host
-xoda.pw: could not connect to host
-xoffy.com: could not connect to host
-xom.party: could not connect to host
-xombra.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-xoonth.net: did not receive HSTS header
-xor-a.net: could not connect to host
-xotika.tv: could not connect to host
-xpenology-fr.net: could not connect to host
-xperiacode.com: could not connect to host
-xperiacodes.com: could not connect to host
-xpi.fr: could not connect to host
-xpiuat.global: could not connect to host
-xpj.bet: did not receive HSTS header
-xpj.sx: could not connect to host
-xpjcunkuan.com: could not connect to host
-xplore-dna.net: did not receive HSTS header
-xposedornot.com: max-age too low: 2592000
-xpressable.com: could not connect to host
-xpresswifi.network: could not connect to host
-xps2pdf.co.uk: could not connect to host
-xps2pdf.info: could not connect to host
-xq55.com: did not receive HSTS header
-xqin.net: could not connect to host
-xrbox.me: could not connect to host
-xrippedhd.com: could not connect to host
-xroot.org: did not receive HSTS header
-xrope.tk: could not connect to host
-xrp.pw: could not connect to host
-xs74.com: could not connect to host
-xscancun.com: could not connect to host
-xscapers.com: did not receive HSTS header
-xserownia.pl: did not receive HSTS header
-xsmobile.de: could not connect to host
-xss.ht: did not receive HSTS header
-xsstime.nl: could not connect to host
-xsyds.cn: did not receive HSTS header
-xsz.jp: could not connect to host
-xt.om: could not connect to host
-xtenz.xyz: could not connect to host
-xtips.us: could not connect to host
-xtom.email: could not connect to host
-xtom.io: could not connect to host
-xtream-hosting.com: did not receive HSTS header
-xtream-hosting.de: could not connect to host
-xtream-hosting.eu: could not connect to host
-xtreamhosting.eu: could not connect to host
-xtremealaskainsulation.com: could not connect to host
-xtremegaming.it: could not connect to host
-xtri.xyz: did not receive HSTS header
-xtrim.ru: did not receive HSTS header
-xts.bike: could not connect to host
-xtzone.be: could not connect to host
-xuanmeishe.net: did not receive HSTS header
-xuanmeishe.top: did not receive HSTS header
-xuehao.net.cn: could not connect to host
-xuehuang666.cn: could not connect to host
-xuexb.com: did not receive HSTS header
-xun3708855.com: could not connect to host
-xuntaosms.com: could not connect to host
-xupeng.me: did not receive HSTS header
-xuyh0120.win: did not receive HSTS header
-xvt-blog.tk: could not connect to host
-xwalck.se: could not connect to host
-xx6396.com: did not receive HSTS header
-xx6729.co: could not connect to host
-xx6729.com: did not receive HSTS header
-xx6957.co: could not connect to host
-xx9397.com: could not connect to host
-xx9721.com: could not connect to host
-xx9728.co: could not connect to host
-xxbase.com: could not connect to host
-xxx020625.com: max-age too low: 0
-xxx3dbdsm.com: could not connect to host
-xxxlbox.com: did not receive HSTS header
-xy1919.com: could not connect to host
-xy6729.com: could not connect to host
-xy6957.com: could not connect to host
-xynex.us: could not connect to host
-xyngular-health.com: could not connect to host
-xynta.ch: could not connect to host
-xyyp.mn: could not connect to host
-xza.fr: did not receive HSTS header
-xzoneadventure.com: could not connect to host
-y-o-w.com: did not receive HSTS header
-y-s.pw: could not connect to host
-y0bet.com: could not connect to host
-y2bet.com: could not connect to host
-y30365.com: could not connect to host
-y3451.com: could not connect to host
-y3bet.com: could not connect to host
-y4bet.com: could not connect to host
-y5197.co: could not connect to host
-y5bet.com: could not connect to host
-y6729.co: could not connect to host
-y6729.com: did not receive HSTS header
-y68ah.com: could not connect to host
-y68am.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68bet.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68bj.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68cd.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68cq.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68fj.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68gd.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68gl.com: could not connect to host
-y68gs.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68gx.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68gz.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68heb.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68hf.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68hk.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68hlj.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68hn.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68hz.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68jl.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68jn.com: could not connect to host
-y68jx.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68ln.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68nj.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68nm.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68nx.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68qh.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68sc.com: could not connect to host
-y68sd.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68sh.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68sjz.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68sx.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68sy.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68sz.com: could not connect to host
-y68tj.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68tw.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68xg.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68xj.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68xz.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68yn.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y68zj.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-y6957.co: could not connect to host
-y6bet.com: could not connect to host
-y7091.com: could not connect to host
-y7092.com: could not connect to host
-y7093.com: could not connect to host
-y7bet.com: could not connect to host
-y892222.com: could not connect to host
-y895555.com: could not connect to host
-y898888.com: could not connect to host
-y89a.com: could not connect to host
-y89a.net: could not connect to host
-y89aaa.com: could not connect to host
-y89b.net: could not connect to host
-y89bbb.com: could not connect to host
-y89c.net: could not connect to host
-y89d.com: could not connect to host
-y89d.net: could not connect to host
-y89ddd.com: could not connect to host
-y89e.net: could not connect to host
-y89eee.com: could not connect to host
-y89f.com: could not connect to host
-y89f.net: could not connect to host
-y89g.net: could not connect to host
-y89gg.com: could not connect to host
-y89ggg.com: could not connect to host
-y89h.net: could not connect to host
-y89hh.com: could not connect to host
-y89i.com: could not connect to host
-y89ii.com: could not connect to host
-y89jjj.com: could not connect to host
-y89k.com: could not connect to host
-y89kk.com: could not connect to host
-y89ll.com: could not connect to host
-y89n.com: could not connect to host
-y89o.com: could not connect to host
-y89p.com: could not connect to host
-y89q.com: could not connect to host
-y89r.com: could not connect to host
-y89t.com: could not connect to host
-y89u.com: could not connect to host
-y89ww.com: could not connect to host
-y89z.com: could not connect to host
-y9721.com: could not connect to host
-y9728.co: could not connect to host
-yaay.com.br: could not connect to host
-yabbarov.ru: could not connect to host
-yabrt.cn: could not connect to host
-yaccin.com: could not connect to host
-yachts-magazine.com: did not receive HSTS header
-yacineboumaza.fr: could not connect to host
-yado-furu.com: did not receive HSTS header
-yafull.com: could not connect to host
-yageys.com: did not receive HSTS header
-yagi2.com: could not connect to host
-yagihiro.tech: could not connect to host
-yahoo.ax: could not connect to host
-yak-host.tk: could not connect to host
-yalecleaners.com: could not connect to host
-yalla.jp: did not receive HSTS header
-yamamo10.com: could not connect to host
-yamei8.com: could not connect to host
-yamei9911.com: could not connect to host
-yameveo.com: did not receive HSTS header
-yan.lt: could not connect to host
-yanbao.xyz: could not connect to host
-yangcs.net: could not connect to host
-yangjingwen.com: did not receive HSTS header
-yangmi.blog: could not connect to host
-yannis.codes: did not receive HSTS header
-yanqiyu.info: could not connect to host
-yanuwa.com: could not connect to host
-yanwei.tech: could not connect to host
-yanwh.xyz: did not receive HSTS header
-yao28.com: could not connect to host
-yaoidreams.com: did not receive HSTS header
-yapan8.com: could not connect to host
-yaporn.tv: did not receive HSTS header
-yarchives.jp: could not connect to host
-yard-fu.com: could not connect to host
-yardbird.us: could not connect to host
-yarnhookup.com: could not connect to host
-yarogneva.ru: could not connect to host
-yasinaydin.net: did not receive HSTS header
-yasirworkfolio.com: did not receive HSTS header
-yasutomonodokoiko.com: did not receive HSTS header
-yateshomesales.com: did not receive HSTS header
-yaucy.win: could not connect to host
-yawen.tw: did not receive HSTS header
-yawnbox.com: could not connect to host
-yay.cam: could not connect to host
-yayart.club: could not connect to host
-yayoba.com: did not receive HSTS header
-yazaral.com: did not receive HSTS header
-ybt520.com: could not connect to host
-ycaaz.com: did not receive HSTS header
-ycc.wtf: could not connect to host
-ychong.com: did not receive HSTS header
-ycm2.wtf: could not connect to host
-yd.io: could not connect to host
-ydy.jp: could not connect to host
-yell.ml: could not connect to host
-yello.website: could not connect to host
-yellowcar.website: could not connect to host
-yellowfish.top: could not connect to host
-yellowfly.co.uk: did not receive HSTS header
-yellowpages.ee: did not receive HSTS header
-yellowstone.nsupdate.info: could not connect to host
-yellowtaillasvegas.com: could not connect to host
-yellowtree.co.za: did not receive HSTS header
-yemalu.com: could not connect to host
-yemekbaz.az: could not connect to host
-yenbainet.tk: could not connect to host
-yenibilgi.net: did not receive HSTS header
-yennhi.co: could not connect to host
-yenniferallulli.com: could not connect to host
-yenniferallulli.de: could not connect to host
-yenniferallulli.es: could not connect to host
-yenniferallulli.moda: could not connect to host
-yenniferallulli.nl: could not connect to host
-yenpape.com: could not connect to host
-yepbitcoin.com: could not connect to host
-yephy.com: could not connect to host
-yerbasbuenas.tk: could not connect to host
-yesdevnull.net: did not receive HSTS header
-yesfone.com.br: could not connect to host
-yeshu.org: could not connect to host
-yeskx.com: did not receive HSTS header
-yesogovinpetcare.com: could not connect to host
-yeswecan.co.bw: could not connect to host
-yetanalytics.io: did not receive HSTS header
-yetcore.io: could not connect to host
-yeu.io: could not connect to host
-yeulathich.com: did not receive HSTS header
-yex.nz: could not connect to host
-yeyi.site: could not connect to host
-yezishurb.site: could not connect to host
-yffengshi.ml: could not connect to host
-ygcdyf.com: could not connect to host
-yggdar.ga: could not connect to host
-ygreneworks.com: did not receive HSTS header
-yh35.net: could not connect to host
-yh64678.com: could not connect to host
-yh66656.com: could not connect to host
-yh66689.com: could not connect to host
-yh88890.com: could not connect to host
-yhb.io: could not connect to host
-yhong.me: could not connect to host
-yhori.xyz: could not connect to host
-yhwj.top: could not connect to host
-yibaoweilong.top: could not connect to host
-yibin0831.com: could not connect to host
-yicknam.my: could not connect to host
-yiffed.me: did not receive HSTS header
-yiffy.tips: did not receive HSTS header
-yiffy.zone: did not receive HSTS header
-yii2.cc: did not receive HSTS header
-yikzu.cn: could not connect to host
-yin.roma.it: did not receive HSTS header
-yin8888.tv: did not receive HSTS header
-ying299.com: could not connect to host
-ying299.net: could not connect to host
-yinga.ga: could not connect to host
-yingsuo.ltd: could not connect to host
-yinhe12.net: did not receive HSTS header
-yippie.nl: did not receive HSTS header
-yisin.net: did not receive HSTS header
-yizhu.com: could not connect to host
-yjsoft.me: could not connect to host
-yjsw.sh.cn: could not connect to host
-ykhut.com: could not connect to host
-ykkme.com: could not connect to host
-yl8.com: could not connect to host
-ylilauta.org: did not receive HSTS header
-ylk.io: could not connect to host
-ylwz.cc: could not connect to host
-ym039.com: could not connect to host
-ym065.com: could not connect to host
-ym3311.com: could not connect to host
-ym3322.com: could not connect to host
-ym6699.com: could not connect to host
-ymblaw.com: did not receive HSTS header
-ymvip8.com: could not connect to host
-ynnovasport.be: could not connect to host
-ynode.co: did not receive HSTS header
-ynsn.nl: could not connect to host
-yntongji.com: could not connect to host
-ynxfh.cn: could not connect to host
-yob.vn: could not connect to host
-yobai28.com: did not receive HSTS header
-yobst.tk: could not connect to host
-yocchan1513.net: did not receive HSTS header
-yoga-prive.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-yoga-sky.de: did not receive HSTS header
-yoga.is-an-engineer.com: could not connect to host
-yogabhawnamission.com: did not receive HSTS header
-yogamayanine.com: could not connect to host
-yogatrainingrishikesh.com: could not connect to host
-yoibyoin.info: did not receive HSTS header
-yoimise.net: did not receive HSTS header
-yoiyado.info: did not receive HSTS header
-yokeepo.com: did not receive HSTS header
-yokone3-kutikomi.com: could not connect to host
-yolo-csgo.com: could not connect to host
-yolocast.wtf: could not connect to host
-yolocelebs.com: did not receive HSTS header
-yoloprod.fr: could not connect to host
-yoloseo.com: could not connect to host
-yomena.in: could not connect to host
-yomepre.com: could not connect to host
-yooguo123.com: did not receive HSTS header
-yopers.com: did not receive HSTS header
-yoplate.com: could not connect to host
-yopuedo.co: did not receive HSTS header
-yorgosbos.nl: did not receive HSTS header
-yorkshireterrier.com.br: could not connect to host
-yoru.me: did not receive HSTS header
-yosheenetwork.fr: could not connect to host
-yoticonnections.com: could not connect to host
-yotilab.com: did not receive HSTS header
-yotilabs.com: could not connect to host
-youareme.ca: did not receive HSTS header
-youcaitian.com: could not connect to host
-youcancraft.de: did not receive HSTS header
-youcanfuckoff.xyz: could not connect to host
-youcanhelp.tk: could not connect to host
-youcontrol.ru: could not connect to host
-youdowell.com: did not receive HSTS header
-youfencun.com: could not connect to host
-youftp.tk: could not connect to host
-yougot.pw: could not connect to host
-youhabitat.es: did not receive HSTS header
-youhacked.me: could not connect to host
-youjizz.bz: could not connect to host
-youkok2.com: did not receive HSTS header
-youla.cf: could not connect to host
-youlend.com: did not receive HSTS header
-youlikehookups.com: could not connect to host
-youliketwinks.com: could not connect to host
-youlog.net: did not receive HSTS header
-youlovehers.com: could not connect to host
-youngandunited.nl: did not receive HSTS header
-youngpeopleunited.co.uk: could not connect to host
-youngsoad.com: did not receive HSTS header
-younl.net: could not connect to host
-youon.tokyo: could not connect to host
-your-greece.ga: could not connect to host
-your-idc.tk: could not connect to host
-your-waterserver.com: could not connect to host
-your28days.com: could not connect to host
-yourbapp.ch: could not connect to host
-yourbittorrent.com: did not receive HSTS header
-yourbonus.click: could not connect to host
-yourcomputer.expert: could not connect to host
-yourconscious.life: could not connect to host
-youreward.ga: could not connect to host
-yourfriendlytech.com: could not connect to host
-yourgadget.ro: could not connect to host
-yourgame.co.il: did not receive HSTS header
-yourhair.net: max-age too low: 0
-youri.me: could not connect to host
-yourlovesong.com.mx: could not connect to host
-yourmemorykeeper.co.uk: did not receive HSTS header
-yoursecondphone.co: did not receive HSTS header
-yourself.today: could not connect to host
-yourstrongbox.com: could not connect to host
-yourtrainer.com: did not receive HSTS header
-yourtrainingsolutions.com: did not receive HSTS header
-youruseragent.info: could not connect to host
-yourznc.com: could not connect to host
-yousite.by: could not connect to host
-yout.com: did not receive HSTS header
-youthovation.org: did not receive HSTS header
-youtsuu-raku.com: could not connect to host
-youtube: could not connect to host
-youtubeviews.ml: could not connect to host
-yoyoost.duckdns.org: could not connect to host
-yoyoost.ga: could not connect to host
-yp518518.com: max-age too low: 0
-ypcs.fi: did not receive HSTS header
-ypiresia.fr: could not connect to host
-yryz.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: ../../../UXP/security/manager/tools/getHSTSPreloadList.js :: processStsHeader :: line 132" data: no]
-ys-shop.biz: did not receive HSTS header
-ysicing.net: could not connect to host
-yspa.tv: could not connect to host
-yspeo.biz: did not receive HSTS header
-ysun.xyz: could not connect to host
-ysuna.xyz: could not connect to host
-ysx.me.uk: could not connect to host
-yt668899.com: could not connect to host
-ytb.zone: did not receive HSTS header
-ytbmp3.com: did not receive HSTS header
-ytbmp4.com: did not receive HSTS header
-ytcuber.xyz: could not connect to host
-ythyth.com: max-age too low: 2592000
-ytpak.com: could not connect to host
-ytpak.pk: could not connect to host
-ytuquelees.net: could not connect to host
-ytvwld.de: did not receive HSTS header
-yu.gg: did not receive HSTS header
-yu7.jp: did not receive HSTS header
-yuanbenlian.com: did not receive HSTS header
-yuandan.ml: could not connect to host
-yuanjiazhao.com: could not connect to host
-yuanjiazhao.tk: could not connect to host
-yuansecard.me: could not connect to host
-yuce518.com: could not connect to host
-yudan.com.br: could not connect to host
-yude.ml: could not connect to host
-yuema.net.cn: could not connect to host
-yuer.sytes.net: could not connect to host
-yuexiangzs.com: could not connect to host
-yufan.me: did not receive HSTS header
-yugasun.com: could not connect to host
-yugege.cf: could not connect to host
-yugodi.team: did not receive HSTS header
-yuhen.ru: did not receive HSTS header
-yuho.vn: could not connect to host
-yui.cat: did not receive HSTS header
-yuisyo.ml: could not connect to host
-yuka.one: could not connect to host
-yukaction.com: did not receive HSTS header
-yukbeli.id: did not receive HSTS header
-yuki-portfolio.com: did not receive HSTS header
-yukijinji.moe: could not connect to host
-yukiminami.net: could not connect to host
-yukimochi.me: could not connect to host
-yuko.moe: could not connect to host
-yukonrefugees.com: could not connect to host
-yulaiz.com: could not connect to host
-yum.beer: could not connect to host
-yum0.cn: could not connect to host
-yumikori.net: could not connect to host
-yumli.net: could not connect to host
-yummyfamilyrecipes.com: could not connect to host
-yummylooks.com: did not receive HSTS header
-yuna.love: could not connect to host
-yuna.tg: could not connect to host
-yunjishou.pro: could not connect to host
-yunpan.blue: could not connect to host
-yuntama.xyz: could not connect to host
-yunzhu.org: could not connect to host
-yurimoens.be: could not connect to host
-yurinet.org: could not connect to host
-yuriykuzmin.com: could not connect to host
-yutabon.com: could not connect to host
-yutang.vn: could not connect to host
-yutangyun.com: could not connect to host
-yutuo.net: did not receive HSTS header
-yuucchi.com: could not connect to host
-yuushou.com: could not connect to host
-yuweiyang.xyz: could not connect to host
-yux.fr: could not connect to host
-yux.io: did not receive HSTS header
-yuxingxin.com: did not receive HSTS header
-yuyu.io: did not receive HSTS header
-yuzu.tk: did not receive HSTS header
-yveshield.com: could not connect to host
-yveslegendre.fr: could not connect to host
-ywei.org: could not connect to host
-yxs.me: did not receive HSTS header
-yxzero.xyz: could not connect to host
-yy5197.co: could not connect to host
-yy6396.com: did not receive HSTS header
-yy6729.co: could not connect to host
-yy6729.com: did not receive HSTS header
-yy6957.co: could not connect to host
-yy9397.com: could not connect to host
-yy9721.com: could not connect to host
-yy9728.co: could not connect to host
-yya.bid: could not connect to host
-yya.me: could not connect to host
-yya.men: could not connect to host
-yyrss.com: could not connect to host
-yyy116.com: could not connect to host
-yyy608.com: could not connect to host
-yzcloud.me: did not receive HSTS header
-yzer.club: could not connect to host
-z-coder.com: could not connect to host
-z-konzept-nutrition.ru: could not connect to host
-z-to-a.com: did not receive HSTS header
-z00228.com: could not connect to host
-z0rro.net: could not connect to host
-z30365.com: did not receive HSTS header
-z33.ch: did not receive HSTS header
-z33.co: did not receive HSTS header
-z3liff.com: could not connect to host
-z3liff.net: could not connect to host
-z4k.de: did not receive HSTS header
-z5197.co: could not connect to host
-z6729.co: could not connect to host
-z6729.com: did not receive HSTS header
-z6957.co: could not connect to host
-z6957.com: did not receive HSTS header
-z8182.com: could not connect to host
-z8193.com: could not connect to host
-z8851.com: could not connect to host
-z9397.com: could not connect to host
-z9721.com: could not connect to host
-z9728.co: could not connect to host
-zaadnet.ir: did not receive HSTS header
-zaalleatherwear.nl: did not receive HSTS header
-zabavno.mk: did not receive HSTS header
-zabezpecweb.cz: did not receive HSTS header
-zacadam.com: could not connect to host
-zacco.com: did not receive HSTS header
-zacco.site: could not connect to host
-zacharopoulos.me: could not connect to host
-zachbolinger.com: could not connect to host
-zachpeters.org: did not receive HSTS header
-zadania.wiki: could not connect to host
-zadieheimlich.com: did not receive HSTS header
-zaem.tv: could not connect to host
-zaffit.com: did not receive HSTS header
-zafirus.name: could not connect to host
-zagluszaczgps.pl: did not receive HSTS header
-zahnarzt-muenich.de: did not receive HSTS header
-zahnrechner-staging.azurewebsites.net: could not connect to host
-zahyantechnologies.com: did not receive HSTS header
-zajm-bez-poruchitelej.cf: could not connect to host
-zajm-bez-spravok.tk: could not connect to host
-zajm-ehkspress.ml: could not connect to host
-zajm-na-kivi.cf: could not connect to host
-zajm-pod-zalog.gq: could not connect to host
-zajmy-contact.cf: could not connect to host
-zajmy-contact.ga: could not connect to host
-zajmy-contact.gq: could not connect to host
-zalan.do: could not connect to host
-zalaxx.ddns.net: could not connect to host
-zalzalac.com: did not receive HSTS header
-zamis.net: could not connect to host
-zamocosmeticos.com.br: could not connect to host
-zamorano.edu: could not connect to host
-zamos.ru: max-age too low: 0
-zaneweb.org: could not connect to host
-zanzabar.it: could not connect to host
-zanzariere.roma.it: could not connect to host
-zao.fi: could not connect to host
-zaoext.com: could not connect to host
-zaoshanghao-dajia.rhcloud.com: could not connect to host
-zap.yt: could not connect to host
-zapatoshechoamano.pe: could not connect to host
-zappos.com: did not receive HSTS header
-zaptan.net: did not receive HSTS header
-zaptan.org: did not receive HSTS header
-zaptan.us: did not receive HSTS header
-zarfinakber.com: did not receive HSTS header
-zargaripour.com: did not receive HSTS header
-zarmarket.org: could not connect to host
-zarooba.com: could not connect to host
-zavca.com: could not connect to host
-zaympodzalog.ga: could not connect to host
-zayna.eu: did not receive HSTS header
-zbanks.cn: could not connect to host
-zbasenem.pl: did not receive HSTS header
-zbchen.com: did not receive HSTS header
-zberger.com: could not connect to host
-zbetcheck.in: could not connect to host
-zbigniewgalucki.eu: did not receive HSTS header
-zbp.at: did not receive HSTS header
-zby.io: could not connect to host
-zcgram.com: did not receive HSTS header
-zcr.ca: could not connect to host
-zcryp.to: could not connect to host
-zd279.com: could not connect to host
-zdrave-konzultace.cz: could not connect to host
-zdravekonzultace.cz: could not connect to host
-zdravesteny.cz: could not connect to host
-zdravotnickasluzba.eu: could not connect to host
-zdravystul.cz: did not receive HSTS header
-zdrowiepaleo.pl: did not receive HSTS header
-zdx.ch: max-age too low: 0
-zeb.fun: could not connect to host
-zebedeescastles.co.uk: could not connect to host
-zebibyte.cn: could not connect to host
-zebrababy.cn: could not connect to host
-zebry.nl: did not receive HSTS header
-zebulon.fr: did not receive HSTS header
-zecrypto.com: could not connect to host
-zeelynk.com: could not connect to host
-zeestraten.nl: did not receive HSTS header
-zeeuw.nl: did not receive HSTS header
-zefiris.org: did not receive HSTS header
-zefu.ca: could not connect to host
-zegriesalmansa.tk: could not connect to host
-zehdenick-bleibt-bunt.de: could not connect to host
-zeitoununiversity.org: could not connect to host
-zeitzer-turngala.de: could not connect to host
-zelfmoord.ga: could not connect to host
-zelfrijdendeautos.com: did not receive HSTS header
-zelfstandigemakelaars.net: could not connect to host
-zellari.ru: did not receive HSTS header
-zeloz.xyz: could not connect to host
-zemlova.cz: could not connect to host
-zen-ume.com: could not connect to host
-zenfusion.fr: could not connect to host
-zengdong.ren: could not connect to host
-zenhaiku.com: did not receive HSTS header
-zenics.co.uk: did not receive HSTS header
-zenmate.com.tr: could not connect to host
-zennzimie.be: did not receive HSTS header
-zennzimie.com: did not receive HSTS header
-zeno-system.com: did not receive HSTS header
-zenpayroll.com: did not receive HSTS header
-zenram.com: could not connect to host
-zentask.io: could not connect to host
-zentience.dk: could not connect to host
-zentience.net: did not receive HSTS header
-zentience.org: could not connect to host
-zentiweb.nl: did not receive HSTS header
-zentralwolke.de: did not receive HSTS header
-zentrumfuerchemie.de: could not connect to host
-zenus-biometrics.com: did not receive HSTS header
-zenwears.com: could not connect to host
-zeparadox.com: could not connect to host
-zepect.com: did not receive HSTS header
-zepter.ga: could not connect to host
-zera.com.au: could not connect to host
-zerg.uk: did not receive HSTS header
-zero-sum.xyz: could not connect to host
-zero-x-baadf00d.com: did not receive HSTS header
-zerocool.io: could not connect to host
-zeroday.sk: did not receive HSTS header
-zerofox.gq: could not connect to host
-zerolab.org: could not connect to host
-zeroling.com: could not connect to host
-zeroml.ml: could not connect to host
-zerosource.net: could not connect to host
-zerowastesavvy.com: could not connect to host
-zerowastesonoma.gov: did not receive HSTS header
-zertif.info: could not connect to host
-zerudi.com: did not receive HSTS header
-zetadisseny.es: did not receive HSTS header
-zeto365.pl: did not receive HSTS header
-zetrov.pl: did not receive HSTS header
-zeug.co: could not connect to host
-zewtie.com: could not connect to host
-zeytin.pro: could not connect to host
-zfly.me: could not connect to host
-zgan.ga: could not connect to host
-zh-yds.com: could not connect to host
-zh1.li: could not connect to host
-zhang.wtf: could not connect to host
-zhangge.net: did not receive HSTS header
-zhanglizhi.ml: could not connect to host
-zhanglu.xyz: could not connect to host
-zhangruilin.com: did not receive HSTS header
-zhangsir.net: could not connect to host
-zhangyuhao.com: could not connect to host
-zhaochen.xyz: could not connect to host
-zhaojin97.cn: could not connect to host
-zhaotongjun.com: max-age too low: 0
-zhattyt.com: could not connect to host
-zhdd.pl: did not receive HSTS header
-zhendingresources.com: could not connect to host
-zhengouwu.com: could not connect to host
-zhengqiangonglue.com: max-age too low: 0
-zhenmeish.com: could not connect to host
-zhenyan.org: could not connect to host
-zhh.in: could not connect to host
-zhi.ci: could not connect to host
-zhihua-lai.com: did not receive HSTS header
-zhikin.com: could not connect to host
-zhiku8.com: could not connect to host
-zhimajk.com: could not connect to host
-zhiwei.me: could not connect to host
-zhome.info: could not connect to host
-zhongzicili.ws: could not connect to host
-zhoujiashu.com: could not connect to host
-zhoutiancai.cn: could not connect to host
-zhouzeng1314.com: max-age too low: 0
-zhthings.com: could not connect to host
-zhuji.com.cn: could not connect to host
-zhuji5.com: could not connect to host
-zhujicaihong.com: could not connect to host
-zi0r.com: did not receive HSTS header
-zian.online: could not connect to host
-zicklam.com: did not receive HSTS header
-ziegler-family.com: did not receive HSTS header
-zigcore.com.br: could not connect to host
-zikirakhirzaman.com: could not connect to host
-ziktime.com: did not receive HSTS header
-zilon.com.co: could not connect to host
-zindan.tk: could not connect to host
-zinenapse.info: did not receive HSTS header
-zingpetfood.com: could not connect to host
-zings.eu: could not connect to host
-zip.ch: did not receive HSTS header
-zippy-download.com: could not connect to host
-zippy-download.de: could not connect to host
-zirka24.net: could not connect to host
-zirtue.io: could not connect to host
-zitrone44.de: could not connect to host
-zittingskalender.be: did not receive HSTS header
-zivagold.com: could not connect to host
-zivy-ruzenec.cz: could not connect to host
-ziwa.ir: did not receive HSTS header
-zixo.sk: could not connect to host
-ziyuanabc.xyz: could not connect to host
-ziz.exchange: could not connect to host
-zizcollections.com: could not connect to host
-zizoo.com: did not receive HSTS header
-zjbuilding.com.au: did not receive HSTS header
-zjc3.com: could not connect to host
-zjh6888.com: max-age too low: 0
-zju.tv: could not connect to host
-zjubtv.com: could not connect to host
-zjuqsc.com: could not connect to host
-zjutv.com: could not connect to host
-zjyifa.cn: could not connect to host
-zk.com.co: did not receive HSTS header
-zkillboard.com: did not receive HSTS header
-zking.ga: could not connect to host
-zkrypt.cc: did not receive HSTS header
-zl-29.com: could not connect to host
-zl-59.com: could not connect to host
-zl-69.com: could not connect to host
-zl-79.com: could not connect to host
-zl-89.com: could not connect to host
-zl0101.com: could not connect to host
-zl8824.com: could not connect to host
-zlc1994.com: could not connect to host
-zlcp.com: could not connect to host
-zlotonews.com: did not receive HSTS header
-zmala.com: could not connect to host
-zmsastro.co.za: could not connect to host
-zmscable.com: did not receive HSTS header
-zmy.im: could not connect to host
-znacite.com: did not receive HSTS header
-znd.jp: could not connect to host
-zngay.com: could not connect to host
-zning.net.cn: could not connect to host
-znn.co.jp: did not receive HSTS header
-zny.pw: could not connect to host
-zocken.com: did not receive HSTS header
-zodgame.fun: did not receive HSTS header
-zodgame.us: did not receive HSTS header
-zoe.vc: did not receive HSTS header
-zohair.xyz: did not receive HSTS header
-zohar.link: could not connect to host
-zohar.shop: did not receive HSTS header
-zoi.jp: could not connect to host
-zokster.net: did not receive HSTS header
-zolokar.xyz: could not connect to host
-zonadebolsa.es: did not receive HSTS header
-zone-de-confiance.fr: could not connect to host
-zone39.com: could not connect to host
-zone403.net: could not connect to host
-zoneminder.com: did not receive HSTS header
-zoners.si: did not receive HSTS header
-zonky.io: could not connect to host
-zontractors.com: could not connect to host
-zoo.city: could not connect to host
-zoo24.de: did not receive HSTS header
-zoofaeth.de: did not receive HSTS header
-zoofit.com.au: could not connect to host
-zookids.uy: did not receive HSTS header
-zoological-gardens.eu: could not connect to host
-zoomcar.pro: did not receive HSTS header
-zoomingin.net: max-age too low: 5184000
-zoommailing.com: did not receive HSTS header
-zoomplumbing.net: did not receive HSTS header
-zooneshop.com: did not receive HSTS header
-zooom2.azurewebsites.net: could not connect to host
-zooparadies.eu: could not connect to host
-zoorigin.com: did not receive HSTS header
-zooxdata.com: could not connect to host
-zopy.com.br: could not connect to host
-zorki.nl: did not receive HSTS header
-zortium.report: could not connect to host
-zorz.info: could not connect to host
-zoznamrealit.sk: did not receive HSTS header
-zozo.com: did not receive HSTS header
-zpy.fun: could not connect to host
-zq789.com: could not connect to host
-zqhong.com: could not connect to host
-zqjs.tk: could not connect to host
-zqstudio.top: could not connect to host
-zqwqz.com: did not receive HSTS header
-zr.is: did not receive HSTS header
-zrt.io: did not receive HSTS header
-zs-ohradni.cz: did not receive HSTS header
-zserver.fr: could not connect to host
-zsoltbereczki.tk: could not connect to host
-zsrbcs.com: could not connect to host
-zstu.eu: could not connect to host
-ztan.tk: could not connect to host
-ztcaoll222.cn: did not receive HSTS header
-ztytian.com: could not connect to host
-zuan-in.com: could not connect to host
-zuan-in.net: could not connect to host
-zuanqianni.com: could not connect to host
-zubora.co: could not connect to host
-zubro.net: could not connect to host
-zuckerfloh.de: did not receive HSTS header
-zudomc.me: could not connect to host
-zuefle.net: did not receive HSTS header
-zuehlcke.de: could not connect to host
-zug.fr: could not connect to host
-zug.io: did not receive HSTS header
-zuitaotu.com: could not connect to host
-zukix.com: could not connect to host
-zulu7.com: did not receive HSTS header
-zunda.cafe: could not connect to host
-zunftmarke.de: did not receive HSTS header
-zup.me: could not connect to host
-zupago.com: did not receive HSTS header
-zurickrelogios.com.br: did not receive HSTS header
-zurret.de: did not receive HSTS header
-zutsu-raku.com: could not connect to host
-zuviel.space: could not connect to host
-zvejonys.lt: did not receive HSTS header
-zvive.com: did not receive HSTS header
-zvncloud.com: did not receive HSTS header
-zvz.im: could not connect to host
-zwalcz-cellulit.com: did not receive HSTS header
-zwb3.de: could not connect to host
-zwembadheeten.nl: did not receive HSTS header
-zx1168.com: could not connect to host
-zx2268.com: could not connect to host
-zxavier.com: did not receive HSTS header
-zxc.science: could not connect to host
-zxe.com.br: could not connect to host
-zxity.co.uk: could not connect to host
-zxity.ltd: could not connect to host
-zxity.uk: could not connect to host
-zxssl.com: did not receive HSTS header
-zxxcq.com: could not connect to host
-zyf.pw: could not connect to host
-zyger.co.za: did not receive HSTS header
-zylai.net: could not connect to host
-zymbit.com: did not receive HSTS header
-zync.ca: did not receive HSTS header
-zypgr.com: could not connect to host
-zypr.pw: could not connect to host
-zyrillezuno.com: could not connect to host
-zyso.org: could not connect to host
-zz0036.com: max-age too low: 0
-zz017.com: could not connect to host
-zz295.com: did not receive HSTS header
-zz5197.co: could not connect to host
-zz606.com: could not connect to host
-zz6729.co: could not connect to host
-zz6729.com: did not receive HSTS header
-zz6957.co: could not connect to host
-zz9397.com: could not connect to host
-zz9721.com: could not connect to host
-zz9728.co: could not connect to host
-zzb510.com: could not connect to host
-zzb6688.com: could not connect to host
-zzb8899.com: could not connect to host
-zzbnet.cn: could not connect to host
-zzw.ca: could not connect to host
diff --git a/security/manager/ssl/nsSTSPreloadList.inc b/security/manager/ssl/nsSTSPreloadList.inc
deleted file mode 100644
index 8adf5484c..000000000
--- a/security/manager/ssl/nsSTSPreloadList.inc
+++ /dev/null
@@ -1,59250 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*****************************************************************************/
-/* This is an automatically generated file. If you're not */
-/* nsSiteSecurityService.cpp, you shouldn't be #including it. */
-/*****************************************************************************/
-
-#include <stdint.h>
-const PRTime gPreloadListExpirationTime = INT64_C(1585036830608000);
-
-class nsSTSPreload
-{
- public:
- const char *mHost;
- const bool mIncludeSubdomains;
-};
-
-static const nsSTSPreload kSTSPreloadList[] = {
- { "0--1.de", true },
- { "0-24.com", true },
- { "0-24.net", true },
- { "00004048.com", true },
- { "000321365.com", true },
- { "000b58.com", true },
- { "000btt.net", true },
- { "00168365.com", true },
- { "001yapan.com", true },
- { "00228.am", false },
- { "00228.org", false },
- { "00228ww.com", false },
- { "00228x.com", false },
- { "00228xx.com", false },
- { "00228yy.com", false },
- { "00228z.com", false },
- { "00228zz.com", false },
- { "0022bet.vip", true },
- { "002k8.com", true },
- { "00365t.com", true },
- { "003971.com", true },
- { "008207.com", true },
- { "008251.com", true },
- { "008253.com", true },
- { "008271.com", true },
- { "009597.com", true },
- { "00dani.me", true },
- { "00f.net", true },
- { "01011970.xyz", true },
- { "010203.ru", true },
- { "010kb.com", true },
- { "010ks.com", true },
- { "010ks.net", true },
- { "01110000011100110111001001100111.com", true },
- { "01234048.com", true },
- { "012345678365.com", true },
- { "0123456789365.com", true },
- { "01365t.com", true },
- { "015kb.com", true },
- { "0166z6.com", true },
- { "016kb.com", true },
- { "0177z6.com", true },
- { "0188z6.com", true },
- { "018k8.com", true },
- { "01918.net", true },
- { "0199z6.com", true },
- { "01tools.com", true },
- { "020ks.com", true },
- { "0222z6.com", true },
- { "022367.com", true },
- { "022379.com", true },
- { "022391.com", true },
- { "022501.com", true },
- { "022503.com", true },
- { "022507.com", true },
- { "022571.com", true },
- { "022601.com", true },
- { "022609.com", true },
- { "022610.com", true },
- { "022kb.com", true },
- { "022ks.net", true },
- { "02327.net", true },
- { "02365t.com", true },
- { "02375.net", true },
- { "025k8.com", true },
- { "026122.com", true },
- { "02638.net", true },
- { "026kb.com", true },
- { "0288z6.com", true },
- { "029kb.com", true },
- { "02am8.com", true },
- { "03012.net", true },
- { "03018.net", true },
- { "0311z6.com", true },
- { "0312z6.com", true },
- { "0313z6.com", true },
- { "0315z6.com", true },
- { "0316z6.com", true },
- { "03170317.com", true },
- { "0317z6.com", true },
- { "0318z6.com", true },
- { "0319z6.com", true },
- { "0335z6.com", true },
- { "0351z6.com", true },
- { "0352z6.com", true },
- { "0353z6.com", true },
- { "0355z6.com", true },
- { "0356z6.com", true },
- { "0357z6.com", true },
- { "0358z6.com", true },
- { "0359z6.com", true },
- { "03637.com", true },
- { "0371z6.com", true },
- { "0372z6.com", true },
- { "0373z6.com", true },
- { "0375z6.com", true },
- { "0376z6.com", true },
- { "0377z6.com", true },
- { "038456.com", true },
- { "0393gg.com", true },
- { "0393hh.com", true },
- { "0393ii.com", true },
- { "0399z6.com", true },
- { "04365t.com", true },
- { "046569.com", true },
- { "04911701.cn", true },
- { "04d.co", true },
- { "050869.com", true },
- { "050ks.com", true },
- { "050media.nl", true },
- { "0510ks.com", true },
- { "0511315.net", true },
- { "0511ks.com", true },
- { "0511z6.com", true },
- { "0512z6.com", true },
- { "0513z6.com", true },
- { "0515z6.com", true },
- { "0516z6.com", true },
- { "0517z6.com", true },
- { "0518z6.com", true },
- { "0521z6.com", true },
- { "0523z6.com", true },
- { "0531z6.com", true },
- { "0532z6.com", true },
- { "0533z6.com", true },
- { "0535z6.com", true },
- { "05365t.com", true },
- { "0536z6.com", true },
- { "0537z6.com", true },
- { "0538z6.com", true },
- { "0539z6.com", true },
- { "0551z6.com", true },
- { "0552z6.com", true },
- { "0553z6.com", true },
- { "0555z6.com", true },
- { "0556z6.com", true },
- { "055kb.com", true },
- { "056675.com", true },
- { "056687.com", true },
- { "056690.com", true },
- { "056697.com", true },
- { "056867.com", true },
- { "056869.com", true },
- { "056875.com", true },
- { "056879.com", true },
- { "056950.com", true },
- { "056976.com", true },
- { "056985.com", true },
- { "056kb.com", true },
- { "0572z6.com", true },
- { "0573wk.com", true },
- { "0573z6.com", true },
- { "057587.com", true },
- { "057596.com", true },
- { "0575z6.com", true },
- { "0576z6.com", true },
- { "0577z6.com", true },
- { "0578z6.com", true },
- { "0579z6.com", true },
- { "058509.com", true },
- { "058596.com", true },
- { "058679.com", true },
- { "058kb.com", true },
- { "0591z6.com", true },
- { "0592z6.com", true },
- { "0593z6.com", true },
- { "0595z6.com", true },
- { "0596z6.com", true },
- { "0597z6.com", true },
- { "0598z6.com", true },
- { "0599z6.com", true },
- { "05am8.com", true },
- { "05am8.net", true },
- { "060795.com", true },
- { "0607p.com", true },
- { "060870.com", true },
- { "060875.com", true },
- { "06091994.xyz", true },
- { "06365t.com", true },
- { "065679.com", true },
- { "065706.com", true },
- { "065790.com", true },
- { "065970.com", true },
- { "065976.com", true },
- { "065l.com", true },
- { "066570.com", true },
- { "066579.com", true },
- { "066590.com", true },
- { "0666z6.com", true },
- { "066705.com", true },
- { "066709.com", true },
- { "066790.com", true },
- { "066816.com", true },
- { "066kb.com", true },
- { "067310.com", true },
- { "067313.com", true },
- { "067360.com", true },
- { "067361.com", true },
- { "06804.com", true },
- { "0681b.com", true },
- { "0681c.com", true },
- { "0681d.com", true },
- { "0681e.com", true },
- { "0681f.com", true },
- { "0681g.com", true },
- { "0681i.com", true },
- { "0681j.com", true },
- { "0681l.com", true },
- { "0681m.com", true },
- { "0681o.com", true },
- { "0681p.com", true },
- { "0681q.com", true },
- { "0681s.com", true },
- { "0681t.com", true },
- { "0681u.com", true },
- { "0681w.com", true },
- { "0681x.com", true },
- { "0681y.com", true },
- { "0681z.com", true },
- { "068663.com", true },
- { "068697.com", true },
- { "068756.com", true },
- { "068957.com", true },
- { "068kb.com", true },
- { "06918.net", true },
- { "0691ks.com", true },
- { "06lc.net", true },
- { "06se.com", true },
- { "070136.com", true },
- { "070167.com", true },
- { "070183.com", true },
- { "0708p.com", true },
- { "070968.com", true },
- { "070986.com", true },
- { "0711z6.com", true },
- { "0712z6.com", true },
- { "0713z6.com", true },
- { "0715z6.com", true },
- { "0716z6.com", true },
- { "0717z6.com", true },
- { "0718z6.com", true },
- { "0719z6.com", true },
- { "071k8.com", true },
- { "0720p.com", true },
- { "0722z6.com", true },
- { "0724ks.com", true },
- { "0728z6.com", true },
- { "0732ks.com", true },
- { "07365t.com", true },
- { "0737399.com", true },
- { "075k8.com", true },
- { "0760ks.com", true },
- { "0763ks.com", true },
- { "0766ks.com", true },
- { "076k8.com", true },
- { "0771z6.com", true },
- { "0772z6.com", true },
- { "0773z6.com", true },
- { "0775z6.com", true },
- { "0776z6.com", true },
- { "0777z6.com", true },
- { "077810.com", true },
- { "077863.com", true },
- { "0779z6.com", true },
- { "077k8.com", true },
- { "078kb.com", true },
- { "0792112.com", true },
- { "079606.com", true },
- { "079607.com", true },
- { "0798rcw.com", true },
- { "07d88.com", true },
- { "081115.com", true },
- { "081752.com", true },
- { "081763.com", true },
- { "081769.com", true },
- { "081783.com", true },
- { "081925.com", true },
- { "081927.com", true },
- { "081957.com", true },
- { "081967.com", true },
- { "082157.com", true },
- { "082159.com", true },
- { "082167.com", true },
- { "082173.com", true },
- { "082175.com", true },
- { "082179.com", true },
- { "082187.com", true },
- { "082192.com", true },
- { "082193.com", true },
- { "082195.com", true },
- { "082359.com", true },
- { "08365t.com", true },
- { "083832.com", true },
- { "083903.com", true },
- { "083905.com", true },
- { "083907.com", true },
- { "083912.com", true },
- { "083957.com", true },
- { "083960.com", true },
- { "083962.com", true },
- { "083965.com", true },
- { "083967.com", true },
- { "085851.com", true },
- { "085905.com", true },
- { "085950.com", true },
- { "087065.com", true },
- { "0871z6.com", true },
- { "0872z6.com", true },
- { "0873z6.com", true },
- { "087540.com", true },
- { "087569.com", true },
- { "087580.com", true },
- { "0875z6.com", true },
- { "0876z6.com", true },
- { "0877z6.com", true },
- { "08817a.com", true },
- { "08817c.com", true },
- { "08817d.com", true },
- { "08817e.com", true },
- { "08817f.com", true },
- { "08817g.com", true },
- { "08817h.com", true },
- { "08817j.com", true },
- { "08817k.com", true },
- { "08817m.com", true },
- { "08817w.com", true },
- { "08817y.com", true },
- { "08817z.com", true },
- { "08845.cc", true },
- { "0888z6.com", true },
- { "08918.net", true },
- { "089k8.com", true },
- { "08lc.net", true },
- { "09000113.nl", true },
- { "091k8.com", true },
- { "092k8.com", true },
- { "09365t.com", true },
- { "093k8.com", true },
- { "095598.cc", true },
- { "09892.net", true },
- { "098k8.com", true },
- { "0996z6.com", true },
- { "0998z6.com", true },
- { "0999z6.com", true },
- { "09am8.com", true },
- { "09btt.com", true },
- { "09d88.com", true },
- { "0au.de", true },
- { "0c3.de", true },
- { "0chan.pl", true },
- { "0cp8778.com", true },
- { "0day.agency", true },
- { "0des.com", true },
- { "0ii0.cf", true },
- { "0ik.de", true },
- { "0iz.net", true },
- { "0knowledge.de", false },
- { "0lc8.com", true },
- { "0lc8.net", true },
- { "0paste.com", true },
- { "0wx.cat", true },
- { "0wx.es", true },
- { "0wx.eu", true },
- { "0wx.org", true },
- { "0x.cx", true },
- { "0x.sk", true },
- { "0x0.li", true },
- { "0x00c.de", true },
- { "0x00ff00ff.com", true },
- { "0x15.ca", true },
- { "0x17.de", true },
- { "0x378.net", true },
- { "0x41.us", true },
- { "0x52.net", true },
- { "0x7.io", true },
- { "0x7d.com", true },
- { "0x7fffffff.net", true },
- { "0x80.org", true },
- { "0x90.in", true },
- { "0x90.io", true },
- { "0xabe.io", true },
- { "0xaf.tk", true },
- { "0xda.de", true },
- { "0xdc.io", false },
- { "0xdefaced.de", true },
- { "0xfc.de", true },
- { "0xff.se", true },
- { "0xn.de", true },
- { "1-2-3bounce.co.uk", true },
- { "1-345.com", false },
- { "100-downloads.com", true },
- { "10000v.ru", true },
- { "1000minds.com", true },
- { "1000wordsevents.com", true },
- { "1001kartini.com", true },
- { "1001kerstpakketten.com", false },
- { "10086.ru", true },
- { "100k.eu", true },
- { "100kredite.de", true },
- { "100lat.pl", true },
- { "100mani.it", true },
- { "100pounds.co.uk", true },
- { "100up.de", true },
- { "100up.org", true },
- { "100visits.tk", true },
- { "101.qa", true },
- { "101010.pl", true },
- { "1011100.com", true },
- { "101sauna.kz", true },
- { "101sauna.ru", true },
- { "102ch.us", true },
- { "1041263497.rsc.cdn77.org", true },
- { "10430.net", true },
- { "10435.net", true },
- { "10436.net", true },
- { "10438.net", true },
- { "10439.net", true },
- { "10453.net", true },
- { "10495.net", true },
- { "105318.com", false },
- { "106jamz.com", true },
- { "10774.net", true },
- { "107996.com", false },
- { "10840.net", true },
- { "1088.fun", true },
- { "109k8.com", true },
- { "10gbit.ovh", true },
- { "10hz.de", true },
- { "10k.ag", true },
- { "10ppm.com", true },
- { "11018xpj.com", false },
- { "110320.com", true },
- { "110k8.com", true },
- { "111.one", true },
- { "1111365t.com", true },
- { "1111k8.com", true },
- { "1112z6.com", true },
- { "111321365.com", true },
- { "111365t.com", true },
- { "1113z6.com", true },
- { "1115z6.com", true },
- { "11168365.com", true },
- { "1116z6.com", true },
- { "1117z6.com", true },
- { "1119z6.com", true },
- { "111b58.com", true },
- { "111plus.design", true },
- { "111z6.com", true },
- { "111zlong.com", true },
- { "1120340.com", true },
- { "1122z6.com", true },
- { "112app.nl", true },
- { "112hz.com", true },
- { "112it.ro", true },
- { "112z6.com", true },
- { "11335835.com", true },
- { "1133z6.com", true },
- { "11365t.com", true },
- { "113k8.com", true },
- { "113ks.com", true },
- { "113z6.com", true },
- { "11445835.com", true },
- { "114514ss.com", true },
- { "11555835.com", true },
- { "115lc.com", true },
- { "115z6.com", true },
- { "11665835.com", true },
- { "1166z6.com", true },
- { "116ks.com", true },
- { "116lc.com", true },
- { "116z6.com", true },
- { "11775835.com", true },
- { "1177z6.com", true },
- { "117lc.com", true },
- { "117z6.com", true },
- { "11885835.com", true },
- { "1188bet.vip", true },
- { "1188z6.com", true },
- { "118btt.com", true },
- { "118z6.com", true },
- { "1190america.tk", true },
- { "11995835.com", true },
- { "1199bet.vip", true },
- { "1199z6.com", true },
- { "119lc.com", true },
- { "119z6.com", true },
- { "11assets.com", true },
- { "11lc8.com", true },
- { "11lc8.net", true },
- { "11loc.de", true },
- { "11thstreetcoffee.com", true },
- { "11urss.com", true },
- { "120323.com", true },
- { "1212873467.rsc.cdn77.org", true },
- { "1212z6.com", true },
- { "1218641649.rsc.cdn77.org", true },
- { "1221z6.com", true },
- { "1222z6.com", true },
- { "122kb.com", true },
- { "123365t.com", true },
- { "12344048.com", true },
- { "12345678365.com", true },
- { "123456789365.com", true },
- { "1236.be", true },
- { "12365t.com", true },
- { "123apps.net", true },
- { "123bearing.co.uk", true },
- { "123bearing.com", true },
- { "123bearing.eu", true },
- { "123birthdaygreetings.com", true },
- { "123comparer.fr", true },
- { "123midterm.com", true },
- { "123nutricion.es", true },
- { "123opstalverzekeringen.nl", true },
- { "123roulement.be", true },
- { "123roulement.com", true },
- { "123seo.ml", true },
- { "123termpapers.com", true },
- { "123writings.com", true },
- { "123z6.com", true },
- { "124133.com", true },
- { "124633.com", true },
- { "125m125.de", true },
- { "126772.com", true },
- { "127661.com", true },
- { "127662.com", true },
- { "127663.com", true },
- { "127665.com", true },
- { "12autoankauf-berlin.de", true },
- { "12l.nl", true },
- { "12thmanrising.com", true },
- { "12train.com", true },
- { "12vpn.net", true },
- { "13-th.com", true },
- { "130.ua", true },
- { "130032.com", true },
- { "130212.com", true },
- { "130232.com", true },
- { "130ks.com", true },
- { "130ks.net", true },
- { "1313z6.com", true },
- { "131934.com", true },
- { "131954.com", true },
- { "131k66.ag", true },
- { "131ks.com", true },
- { "131ks.net", true },
- { "131z6.com", true },
- { "13214.cc", true },
- { "132301.com", true },
- { "132302.com", true },
- { "132k66.ag", true },
- { "132ks.com", true },
- { "132kv.ch", true },
- { "132z6.com", true },
- { "133294.com", true },
- { "1333z6.com", true },
- { "133492.com", true },
- { "1337.vg", true },
- { "133ks.com", true },
- { "133ks.net", true },
- { "133z6.com", true },
- { "134ks.com", true },
- { "134ks.net", true },
- { "135374.com", true },
- { "135416.com", true },
- { "1359826938.rsc.cdn77.org", true },
- { "135ks.com", true },
- { "135z6.com", true },
- { "136814.com", true },
- { "136824.com", true },
- { "136924.com", true },
- { "136k66.ag", true },
- { "136k66.com", true },
- { "136ks.com", true },
- { "136z6.com", true },
- { "137724.com", true },
- { "137k66.ag", true },
- { "137k66.com", true },
- { "137kb.com", true },
- { "137z6.com", true },
- { "138k66.ag", true },
- { "138z6.com", true },
- { "1391kj.com", true },
- { "1395kj.com", true },
- { "139k66.ag", true },
- { "139z6.com", true },
- { "13th-dover.uk", true },
- { "141145.com", true },
- { "14159.gb.net", true },
- { "143533.com", true },
- { "143633.com", true },
- { "143733.com", true },
- { "143918.com", true },
- { "143933.com", true },
- { "1453914078.rsc.cdn77.org", true },
- { "145433.com", true },
- { "145733.com", true },
- { "145ks.net", true },
- { "146233.com", true },
- { "146433.com", true },
- { "1464424382.rsc.cdn77.org", true },
- { "146533.com", true },
- { "146733.com", true },
- { "149433.com", true },
- { "149733.com", true },
- { "14erc.com", true },
- { "14ercooper.com", true },
- { "14it.de", true },
- { "14x3.de", true },
- { "15-10.com", true },
- { "1511774230.rsc.cdn77.org", true },
- { "151k66.ag", true },
- { "151k66.com", true },
- { "151ks.net", true },
- { "151z6.com", true },
- { "152433.com", true },
- { "152k66.ag", true },
- { "152k66.com", true },
- { "152z6.com", true },
- { "153ks.net", true },
- { "153z.com", true },
- { "153z6.com", true },
- { "154233.com", true },
- { "154633.com", true },
- { "154933.com", true },
- { "155175.com", true },
- { "155k66.ag", true },
- { "155k66.com", true },
- { "155ks.com", true },
- { "155ks.net", true },
- { "155z6.com", true },
- { "156433.com", true },
- { "156k66.com", true },
- { "156ks.net", true },
- { "156z6.com", true },
- { "157k66.com", true },
- { "157ks.com", true },
- { "157ks.net", true },
- { "157z6.com", true },
- { "158k66.ag", true },
- { "158k66.com", true },
- { "158ks.net", true },
- { "158z6.com", true },
- { "1590284872.rsc.cdn77.org", true },
- { "15918.net", true },
- { "159cp.com", true },
- { "159k66.ag", true },
- { "159k66.com", true },
- { "159ks.net", true },
- { "159z6.com", true },
- { "16-qw.tk", true },
- { "1600esplanade.com", true },
- { "160763.com", true },
- { "160887.com", true },
- { "161233.com", true },
- { "161263.com", true },
- { "162223.com", true },
- { "162229.com", true },
- { "162231.com", true },
- { "162263.com", true },
- { "162361.com", true },
- { "162jonesrd.ca", true },
- { "163132.com", true },
- { "1644091933.rsc.cdn77.org", true },
- { "1661237.com", true },
- { "1661618.com", true },
- { "1666ks.com", true },
- { "166jk.cc", true },
- { "166ks.net", true },
- { "16836500.com", true },
- { "1683651.com", true },
- { "16836511.com", true },
- { "1683652.com", true },
- { "16836522.com", true },
- { "1683653.com", true },
- { "16836533.com", true },
- { "1683654.com", true },
- { "16836544.com", true },
- { "1683655.com", true },
- { "16836555.com", true },
- { "16836577.com", true },
- { "16836588.com", true },
- { "1683659.com", true },
- { "16836599.com", true },
- { "168365t.com", true },
- { "168btt.com", true },
- { "168btt.net", true },
- { "168fff.cc", true },
- { "168z6.com", true },
- { "168zz.cc", true },
- { "1698k.com", true },
- { "16packets.com", true },
- { "16z6.com", true },
- { "16z66.com", true },
- { "170376.com", true },
- { "170386.com", true },
- { "170686.com", true },
- { "170ks.com", true },
- { "171083.com", true },
- { "171ks.com", true },
- { "1720302.com", true },
- { "1720312.com", true },
- { "173940.com", true },
- { "1750studios.com", false },
- { "175k8.com", true },
- { "175ks.com", true },
- { "1768calc.com.au", true },
- { "176f88.com", true },
- { "176ks.net", true },
- { "177603.com", true },
- { "177ks.net", true },
- { "178kb.com", true },
- { "178ks.net", true },
- { "17kpw.cc", true },
- { "17kpw.com", true },
- { "17xile.com", true },
- { "17xrk.com", true },
- { "180btt.com", true },
- { "180k8.com", true },
- { "180ks.net", true },
- { "1811559.com", true },
- { "181k8.com", true },
- { "181ks.net", true },
- { "181z6.com", true },
- { "182162.com", true },
- { "182k8.com", true },
- { "182ks.com", true },
- { "182ks.net", true },
- { "182z6.com", true },
- { "183k8.com", true },
- { "183z6.com", true },
- { "1844329061.rsc.cdn77.org", true },
- { "184kb.com", true },
- { "185k8.com", true },
- { "185ks.com", true },
- { "185z6.com", true },
- { "186ks.com", true },
- { "186z6.com", true },
- { "1876996.com", true },
- { "187z6.com", true },
- { "1888lc.com", true },
- { "188cn-sb.com", true },
- { "188da.com", true },
- { "188kb.com", true },
- { "188z6.com", true },
- { "189z6.com", true },
- { "18f.gov", true },
- { "18f.gsa.gov", false },
- { "1911trust.com", true },
- { "192433.com", true },
- { "192ks.com", true },
- { "1941-45.ru", true },
- { "1972969867.rsc.cdn77.org", true },
- { "197k8.com", true },
- { "1981612088.rsc.cdn77.org", true },
- { "1994.io", true },
- { "19990bb.com", false },
- { "19990cc.com", false },
- { "19990d.com", false },
- { "19990dd.com", false },
- { "19990ee.com", false },
- { "19990gg.com", false },
- { "19990jj.com", false },
- { "19990k.com", false },
- { "19990nn.com", false },
- { "19990q.com", false },
- { "19990r.com", false },
- { "19990tt.com", false },
- { "19990zz.com", false },
- { "199ks.com", true },
- { "199ks.net", true },
- { "19btt.com", true },
- { "19hundert84.de", false },
- { "19qq.vip", true },
- { "1a-diamantscheiben.de", true },
- { "1a-werkstattgeraete.de", true },
- { "1ab-machinery.com", true },
- { "1ag777.com", true },
- { "1ag88.com", true },
- { "1android.de", true },
- { "1b1.pl", true },
- { "1baks.tk", true },
- { "1blazing.cf", true },
- { "1c-power.ru", true },
- { "1chan.pl", true },
- { "1cool.vip", true },
- { "1cover.co.nz", true },
- { "1cover.com.au", true },
- { "1cprosto.tk", true },
- { "1datatec.com", true },
- { "1e9.nl", true },
- { "1europlan.nl", true },
- { "1f123.net", true },
- { "1fach-digital.de", true },
- { "1fc0.org", true },
- { "1gp.us", true },
- { "1hc.be", true },
- { "1hourproofreading.com", true },
- { "1in9.net", true },
- { "1it.click", true },
- { "1js.de", false },
- { "1kando.com", false },
- { "1ki174.com", true },
- { "1kmi.co", true },
- { "1lc1.com", true },
- { "1lc8.com", true },
- { "1lc8.net", true },
- { "1ll.uk", true },
- { "1lord1faith.com", true },
- { "1malaysian.tk", true },
- { "1montre.fr", true },
- { "1morebounce.co.uk", true },
- { "1net.uk", true },
- { "1nfr.com", false },
- { "1oaklasvegas.com", true },
- { "1of16.de", true },
- { "1on1on1.de", true },
- { "1on1on1.tv", true },
- { "1onehouse.com", true },
- { "1panorama.ru", true },
- { "1password.ca", true },
- { "1password.com", true },
- { "1password.eu", true },
- { "1pw.ca", true },
- { "1r.is", true },
- { "1rs.nl", true },
- { "1sand0s.nl", true },
- { "1se.co", true },
- { "1se2or3.com", true },
- { "1st-bounce.co.uk", true },
- { "1st-community.de", true },
- { "1stcarpetcleaning.co.uk", true },
- { "1stchoicelandscapingwa.com", true },
- { "1stclassbouncycastles.co.uk", true },
- { "1stforfun.co.uk", true },
- { "1stpeninsulabouncers.co.uk", true },
- { "1ticks.com", true },
- { "1v1.xyz", true },
- { "1v9.im", true },
- { "1vpns.com", true },
- { "1way.faith", true },
- { "1whw.co.uk", true },
- { "1wirelog.de", true },
- { "1wl.uk", true },
- { "1zombie.team", true },
- { "2.wtf", true },
- { "200.network", true },
- { "2000meter.no", true },
- { "2001y.me", true },
- { "2012.ovh", true },
- { "2012review.tk", true },
- { "2013review.tk", true },
- { "2015review.tk", true },
- { "2018fifaworldcup.tk", true },
- { "2019k8.com", true },
- { "2022class1.ga", true },
- { "2026j95.com", true },
- { "202jj.com", true },
- { "204504byse.info", true },
- { "208garfield.com", true },
- { "208wns.com", true },
- { "20at.com", true },
- { "20denier.com", true },
- { "210k8.com", true },
- { "213k8.com", true },
- { "215dy.net", true },
- { "217778.com", true },
- { "218btt.com", true },
- { "21sthammersmith.org.uk", true },
- { "21stnc.us", true },
- { "21x9.org", true },
- { "2206p.com", true },
- { "22168365.com", true },
- { "2222365t.com", true },
- { "2222k8.com", true },
- { "2222k8.net", true },
- { "22245j.com", true },
- { "22256j.com", true },
- { "222b58.com", true },
- { "222k8.com", true },
- { "222k8.net", true },
- { "222tips.com", true },
- { "224918.com", true },
- { "225485.com", true },
- { "2255motion.com", true },
- { "2264707.ru", true },
- { "228668.com", true },
- { "22884.org", false },
- { "2288422.com", false },
- { "2288499.com", false },
- { "22884a.com", false },
- { "22884b.com", false },
- { "22884e.com", false },
- { "22884g.com", false },
- { "22884h.com", false },
- { "2288bet.vip", true },
- { "22918.net", true },
- { "22994.org", false },
- { "2299433.com", false },
- { "2299455.com", false },
- { "2299466.com", false },
- { "22delta.com", true },
- { "22i.co.uk", true },
- { "22lc8.com", true },
- { "22lc8.net", true },
- { "230beats.com", true },
- { "233.be", true },
- { "23333.link", true },
- { "2333blog.com", true },
- { "2333z6.com", true },
- { "23365t.com", true },
- { "233blog.com", true },
- { "233boy.com", true },
- { "233hub.com", true },
- { "233hub.net", true },
- { "233hub.org", true },
- { "233now.com", true },
- { "233ss.net", true },
- { "233v2.com", true },
- { "233vps.com", true },
- { "233yes.com", true },
- { "23436565.com", true },
- { "234lc.com", true },
- { "235u.net", true },
- { "238212.com", true },
- { "24-7.jp", true },
- { "24.ie", true },
- { "245meadowvistaway.com", true },
- { "246060.ru", true },
- { "247medplan.com", true },
- { "24848168.com", true },
- { "24848188.com", true },
- { "2484822.com", true },
- { "2484833.com", true },
- { "2484855.com", true },
- { "24848588.com", true },
- { "24848678.com", true },
- { "24848918.com", true },
- { "24848a.vip", true },
- { "24848b.vip", true },
- { "24848c.vip", true },
- { "24848d.vip", true },
- { "24848e.vip", true },
- { "24848jj.com", true },
- { "24848kk.com", true },
- { "24848ll.com", true },
- { "24848mm.com", true },
- { "24848nn.com", true },
- { "24848oo.com", true },
- { "24848pp.com", true },
- { "24848qq.com", true },
- { "24848rr.com", true },
- { "24848ss.com", true },
- { "24848tt.com", true },
- { "24848uu.com", true },
- { "24848v.vip", true },
- { "24848vv.com", true },
- { "24848w.vip", true },
- { "24848ww.com", true },
- { "24848x.vip", true },
- { "24848xx.com", true },
- { "24848y.vip", true },
- { "24848yy.com", true },
- { "24848z.vip", true },
- { "24848zz.com", true },
- { "249722.com", true },
- { "24dian30.com", true },
- { "24hour-locksmithsanantonio.com", true },
- { "24hourcyclist.co.uk", true },
- { "24hourelectricalservices.co.uk", true },
- { "24hourlocksmithbaltimore.com", true },
- { "24hourlocksmithdallastx.com", true },
- { "24hourlocksmithdetroit.com", true },
- { "24hourlocksmithhoustontx.com", true },
- { "24hourlocksmithshouston.com", true },
- { "24hourlocksmithspring.com", true },
- { "24hoursanantoniolocksmiths.com", true },
- { "24hourscienceprojects.com", true },
- { "24ip.com", true },
- { "24ip.de", true },
- { "24ip.fr", true },
- { "24onlinereview.com", true },
- { "24seven.pk", true },
- { "24timeravis.dk", true },
- { "24zpravy.cz", true },
- { "2502.net", true },
- { "250708.com", true },
- { "2525admin.nl", true },
- { "2555z6.com", true },
- { "255k8.com", true },
- { "256pages.com", false },
- { "2586p.com", true },
- { "258877.com", true },
- { "25may.tk", true },
- { "25north.nl", true },
- { "25reinyan25.net", true },
- { "2600edinburgh.org", true },
- { "2600hq.com", true },
- { "260887.com", true },
- { "263.info", true },
- { "2666z6.com", true },
- { "266k66.com", true },
- { "266z6.com", true },
- { "267221.com", true },
- { "267661.com", true },
- { "26z6.com", true },
- { "27000.best", true },
- { "2718282.net", true },
- { "276112.com", true },
- { "276117.com", true },
- { "2777z6.com", true },
- { "277z6.com", true },
- { "27878.com", true },
- { "27878dd.com", true },
- { "27878gg.com", true },
- { "27878hh.com", true },
- { "27878ii.com", true },
- { "27878jj.com", true },
- { "27878ll.com", true },
- { "27878nn.com", true },
- { "27878oo.com", true },
- { "27878pp.com", true },
- { "27878qq.com", true },
- { "27878rr.com", true },
- { "27878ss.com", true },
- { "27878tt.com", true },
- { "27878vv.com", true },
- { "27878ww.com", true },
- { "27878xx.com", true },
- { "27878yy.com", true },
- { "27878zz.com", true },
- { "27is.com", true },
- { "28-industries.com", true },
- { "281116.com", true },
- { "281180.de", true },
- { "281ks.com", true },
- { "282ks.com", true },
- { "28365cn-365.com", true },
- { "284365.com", true },
- { "285551.com", true },
- { "2858958.com", true },
- { "2888z6.com", true },
- { "288cn-563.com", true },
- { "288game.net", true },
- { "288k8.com", true },
- { "288kb.com", true },
- { "288ks.com", true },
- { "288z6.com", true },
- { "28peaks.com", true },
- { "28spots.net", true },
- { "291.com", true },
- { "291167.xyz", true },
- { "2912.nl", true },
- { "293921.com", true },
- { "2948.ca", true },
- { "2991236.com", true },
- { "2999z6.com", true },
- { "299ks.net", true },
- { "2ag88.com", true },
- { "2au.ru", true },
- { "2bas.nl", true },
- { "2bcompany.ch", false },
- { "2bis10.de", true },
- { "2blazing.cf", true },
- { "2c-b.com", true },
- { "2c-d.com", true },
- { "2c-e.com", true },
- { "2c-t-2.com", true },
- { "2c-t-7.com", true },
- { "2c-t-8.com", true },
- { "2cash.ru", true },
- { "2chan.eu", true },
- { "2chan.jp", true },
- { "2cv-fahrer.de", true },
- { "2evip.com", true },
- { "2fm.ie", true },
- { "2fm.radio", true },
- { "2fraud.pro", true },
- { "2gen.com", true },
- { "2gether.fr", true },
- { "2h-nagoya.org", true },
- { "2habc.com", true },
- { "2heartsbookings.co.uk", true },
- { "2hypeenterprises.com", true },
- { "2isk.in", true },
- { "2jhb.com", true },
- { "2kgwf.fi", true },
- { "2krueger.de", true },
- { "2lc8.com", true },
- { "2lc8.net", true },
- { "2li.ch", true },
- { "2lovebirdsblog.com", true },
- { "2manydots.nl", true },
- { "2mb.solutions", true },
- { "2melo.fr", true },
- { "2monkeysandme.com", true },
- { "2nains.ch", true },
- { "2nerds1bit.com", true },
- { "2nics.net", true },
- { "2pay.fr", true },
- { "2programmers.net", true },
- { "2rsc.com", true },
- { "2rsc.net", true },
- { "2stv.net", false },
- { "2th.me", true },
- { "2ulcceria.nl", true },
- { "2wheel.com", false },
- { "2y.fi", true },
- { "2y3x.com", true },
- { "3-dot-careapp1-146314.appspot.com", true },
- { "30019.com", true },
- { "3006789.com", true },
- { "300m.com", false },
- { "301.technology", true },
- { "301355.com", true },
- { "301ks.com", true },
- { "302422.com", true },
- { "303112.com", true },
- { "303312.com", true },
- { "3033888.com", false },
- { "303422.com", true },
- { "30375511.com", true },
- { "30375544.com", true },
- { "30375566.com", true },
- { "3040519.com", true },
- { "304122.com", true },
- { "304322.com", true },
- { "304622.com", true },
- { "3056999.com", true },
- { "308xpj.com", false },
- { "309422.com", true },
- { "30bet365.com", true },
- { "310422.com", true },
- { "311186.com", true },
- { "311191.com", true },
- { "313422.com", true },
- { "313xpj.com", false },
- { "314022.com", true },
- { "314122.com", true },
- { "314322.com", true },
- { "314522.com", true },
- { "314622.com", true },
- { "314633.com", true },
- { "314922.com", true },
- { "315xpj.com", false },
- { "316433.com", true },
- { "317811111.com", true },
- { "31782222.com", true },
- { "317822222.com", true },
- { "31783333.com", true },
- { "317833333.com", true },
- { "31784444.com", true },
- { "317844444.com", true },
- { "317855555.com", true },
- { "31786666.com", true },
- { "317866666.com", true },
- { "3178666666.com", true },
- { "317877777.com", true },
- { "3178888888.com", true },
- { "31789999.com", true },
- { "317899999.com", true },
- { "3178b.com", true },
- { "3178bbb.com", true },
- { "3178c.com", true },
- { "3178ccc.com", true },
- { "3178dd.com", true },
- { "3178ddd.com", true },
- { "3178e.com", true },
- { "3178f.com", true },
- { "3178g.com", true },
- { "3178h.com", true },
- { "3178i.com", true },
- { "3178iii.com", true },
- { "3178j.com", true },
- { "3178jjj.com", true },
- { "3178l.com", true },
- { "3178m.com", true },
- { "3178n.com", true },
- { "3178o.com", true },
- { "3178p.com", true },
- { "3178ppp.com", true },
- { "3178qqq.com", true },
- { "3178rrr.com", true },
- { "3178tt.com", true },
- { "3178ttt.com", true },
- { "3178uuu.com", true },
- { "3178vvv.com", true },
- { "3178ww.com", true },
- { "3178www.com", true },
- { "3178xx.com", true },
- { "3178xxx.com", true },
- { "3178yy.com", true },
- { "3178yyy.com", true },
- { "3178zzz.com", true },
- { "319422.com", true },
- { "319xpj.com", false },
- { "31du.cn", true },
- { "31klabs.com", true },
- { "320281.net", true },
- { "321132.com", true },
- { "321live.nl", true },
- { "3222z6.com", true },
- { "324022.com", true },
- { "324122.com", true },
- { "324133.com", true },
- { "324522.com", true },
- { "324533.com", true },
- { "324922.com", true },
- { "325422.com", true },
- { "326422.com", true },
- { "326433.com", true },
- { "329422.com", true },
- { "32bet365.com", true },
- { "32h.de", true },
- { "33168365.com", true },
- { "3322z6.com", true },
- { "333321365.com", true },
- { "3333365t.com", true },
- { "333365t.com", true },
- { "3333k8.com", true },
- { "3333k8.net", true },
- { "3333ylc.cc", true },
- { "3333z6.com", true },
- { "33365t.com", true },
- { "333b58.com", true },
- { "3344981.com", true },
- { "3344982.com", true },
- { "3344983.com", true },
- { "3344985.com", true },
- { "3344986.com", true },
- { "3345.com", true },
- { "3358m.com", true },
- { "335a.cc", true },
- { "3366z6.com", true },
- { "3369p.com", true },
- { "338393.com", true },
- { "3389p.com", true },
- { "338sa.com", true },
- { "33am8.com", true },
- { "33b58.com", true },
- { "33btt.net", true },
- { "33jiasu.com", true },
- { "33kb88.com", true },
- { "33lc8.com", true },
- { "33lc8.net", true },
- { "33weishang.com", true },
- { "340422.com", true },
- { "340622.com", true },
- { "340922.com", true },
- { "341422.com", true },
- { "341433.com", true },
- { "341533.com", true },
- { "341633.com", true },
- { "341733.com", true },
- { "341922.com", true },
- { "342022.com", true },
- { "342033.com", true },
- { "342133.com", true },
- { "342633.com", true },
- { "342733.com", true },
- { "342922.com", true },
- { "342933.com", true },
- { "343022.com", true },
- { "343622.com", true },
- { "34365t.com", true },
- { "343722.com", true },
- { "343922.com", true },
- { "34536565.com", true },
- { "345lc.com", true },
- { "346022.com", true },
- { "346033.com", true },
- { "346122.com", true },
- { "346233.com", true },
- { "346322.com", true },
- { "346422.com", true },
- { "346522.com", true },
- { "346533.com", true },
- { "346722.com", true },
- { "346922.com", true },
- { "3473-wiki.de", true },
- { "348233.com", true },
- { "348433.com", true },
- { "348533.com", true },
- { "349022.com", true },
- { "349033.com", true },
- { "349233.com", true },
- { "349433.com", true },
- { "349533.com", true },
- { "350422.com", true },
- { "350533.com", true },
- { "35089y.com", true },
- { "35089y1.com", true },
- { "35089y2.com", true },
- { "351113.com", true },
- { "3518k.com", true },
- { "354022.com", true },
- { "354233.com", true },
- { "354622.com", true },
- { "354633.com", true },
- { "354922.com", true },
- { "354933.com", true },
- { "355ks.com", true },
- { "356433.com", true },
- { "357maelai.co", true },
- { "360-staffing.com", true },
- { "360365.com", true },
- { "360hosting.com.au", true },
- { "360live.fr", true },
- { "360rail.nl", true },
- { "360vrs.com", true },
- { "361116.com", true },
- { "361171.com", true },
- { "361173.com", true },
- { "361183.com", true },
- { "365.asia", true },
- { "3651143.com", true },
- { "3651145.com", true },
- { "3651146.com", true },
- { "3651147.com", true },
- { "3651149.com", true },
- { "36525.hk", true },
- { "36533c.com", true },
- { "36533d.com", true },
- { "36533e.com", true },
- { "36533f.com", true },
- { "36533g.com", true },
- { "36533h.com", true },
- { "36533i.com", true },
- { "36533j.com", true },
- { "36533k.com", true },
- { "36533l.com", true },
- { "36533m.com", true },
- { "36533n.com", true },
- { "36533o.com", true },
- { "36533p.com", true },
- { "36533q.com", true },
- { "36533r.com", true },
- { "36533s.com", true },
- { "36533t.com", true },
- { "36533u.com", true },
- { "36533v.com", true },
- { "36554ll.com", true },
- { "36554mm.com", true },
- { "365600dl.com", true },
- { "365654321.com", true },
- { "36565f.com", true },
- { "3657654321.com", true },
- { "36594a.com", true },
- { "36594b.com", true },
- { "36594c.com", true },
- { "3659801.com", true },
- { "365b58.com", true },
- { "365cn-288.com", true },
- { "365daysreview.com", true },
- { "365electricalvn.com", true },
- { "365iosapp.com", true },
- { "365propertybuyer.co.uk", false },
- { "365sb-cn.com", true },
- { "365securitymg.com", true },
- { "365skulls.com", true },
- { "365y0.com", true },
- { "365y00.com", true },
- { "365y1.com", true },
- { "365y11.com", true },
- { "365y2.com", true },
- { "365y22.com", true },
- { "365y3.com", true },
- { "365y33.com", true },
- { "365y5.com", true },
- { "365y55.com", true },
- { "365y6.com", true },
- { "365y66.com", true },
- { "365y7.com", true },
- { "365y77.com", true },
- { "365y9.com", true },
- { "365y99.com", true },
- { "365yapan.com", true },
- { "365ypw.com", true },
- { "365yuwen.com", true },
- { "365zg.com", true },
- { "366k66.com", true },
- { "366z6.com", true },
- { "367553.com", true },
- { "367556.com", true },
- { "370422.com", true },
- { "371422.com", true },
- { "371687.com", true },
- { "371cloud.com", false },
- { "373.moe", true },
- { "373422.com", true },
- { "373816.com", true },
- { "374933.com", true },
- { "375422.com", true },
- { "375ks.com", true },
- { "376208.com", true },
- { "376557.com", true },
- { "377625.com", true },
- { "377632.com", true },
- { "377813.com", true },
- { "377ks.com", true },
- { "378553.com", true },
- { "378901.com", true },
- { "378902.com", true },
- { "378ks.com", true },
- { "379700.com", true },
- { "37987.com", false },
- { "37987c.com", false },
- { "37987d.com", false },
- { "37987e.com", false },
- { "37987f.com", false },
- { "37987g.com", false },
- { "380111333.com", true },
- { "380111444.com", true },
- { "380111666.com", true },
- { "380222000.com", true },
- { "380222222.com", true },
- { "380222444.com", true },
- { "380222555.com", true },
- { "380222666.com", true },
- { "380222777.com", true },
- { "380222888.com", true },
- { "380222999.com", true },
- { "3803300.com", true },
- { "380422.com", true },
- { "3806600.com", true },
- { "3807722.com", true },
- { "380805.com", true },
- { "3808833.com", true },
- { "3809955.com", true },
- { "382225.com", true },
- { "387763.com", true },
- { "3886aa.com", true },
- { "388z6.com", true },
- { "38irkutsk.tk", true },
- { "390422.com", true },
- { "390933.com", true },
- { "392422.com", true },
- { "393422.com", true },
- { "394022.com", true },
- { "394122.com", true },
- { "394322.com", true },
- { "394522.com", true },
- { "394622.com", true },
- { "394922.com", true },
- { "3957e.com", true },
- { "3957h.com", true },
- { "3957i.com", true },
- { "3957j.com", true },
- { "3957k.com", true },
- { "3957l.com", true },
- { "3957m.com", true },
- { "3957n.com", true },
- { "3957o.com", true },
- { "3957p.com", true },
- { "3957q.com", true },
- { "3957r.com", true },
- { "3957s.com", true },
- { "3957t.com", true },
- { "3957u.com", true },
- { "3957v.com", true },
- { "3957w.com", true },
- { "3957x.com", true },
- { "3957y.com", true },
- { "3957z.com", true },
- { "396228.com", false },
- { "396301.com", true },
- { "396302.com", true },
- { "396303.com", true },
- { "396304.com", true },
- { "396305.com", true },
- { "3963bb.com", true },
- { "3963cc.com", true },
- { "3963dd.com", true },
- { "3963ee.com", true },
- { "3963ff.com", true },
- { "396422.com", true },
- { "3970abc.com", true },
- { "3970bc.com", true },
- { "3970ccc.com", true },
- { "3970fa.com", true },
- { "3970ku.com", true },
- { "3970ok.com", true },
- { "3970win.com", true },
- { "3970yes.com", true },
- { "3970ylc.com", true },
- { "398.info", true },
- { "398kb.com", true },
- { "399ks.com", true },
- { "399z6.com", true },
- { "39w66.com", true },
- { "3aandl.com", true },
- { "3ags.de", true },
- { "3b.pm", true },
- { "3bigking.com", true },
- { "3blazing.cf", true },
- { "3c-d.de", true },
- { "3chat.org", true },
- { "3countiescastlehire.co.uk", true },
- { "3d-animator.net", true },
- { "3d-fotoservice.de", true },
- { "3d1t0r4.com", true },
- { "3danimation.tk", true },
- { "3dcollective.es", true },
- { "3de5.nl", true },
- { "3deeplearner.com", true },
- { "3dgep.com", true },
- { "3djuegos.com", true },
- { "3dmusiclab.nl", true },
- { "3do3dont.com", true },
- { "3dprinterwiki.org", true },
- { "3dprintinggear.net", true },
- { "3dreactions.com", true },
- { "3elife.vn", true },
- { "3gdh.vip", true },
- { "3haeuserprojekt.org", true },
- { "3haueserprojekt.org", true },
- { "3james.com", true },
- { "3k188.com", true },
- { "3k288.com", true },
- { "3k788.com", true },
- { "3k878.com", true },
- { "3k988.com", true },
- { "3lc8.com", true },
- { "3logic.ru", true },
- { "3mbo.de", true },
- { "3n5b.com", true },
- { "3niu6.com", true },
- { "3niuurl.com", false },
- { "3oneseven.com", true },
- { "3pestki.org", true },
- { "3plusdesign.gr", true },
- { "3prn.com", true },
- { "3queens.cz", true },
- { "3queens.io", true },
- { "3r.org.uk", true },
- { "3rsee.com", true },
- { "3s-datasolution.de", true },
- { "3s-datasolutions.de", true },
- { "3s-ddns.de", true },
- { "3s-dns.de", true },
- { "3s-hosting.de", true },
- { "3s-mail.de", true },
- { "3sdatasolution.de", true },
- { "3sdatasolutions.de", true },
- { "3sddns.de", true },
- { "3sdns.de", true },
- { "3shosting.de", true },
- { "3smail.de", true },
- { "3tribes.co.uk", true },
- { "3typen.tv", true },
- { "3v4l.org", true },
- { "3ve.com", true },
- { "3vlnaeet.cz", true },
- { "3w-solutions.fr", true },
- { "3xbit.com.br", true },
- { "4-it.de", true },
- { "4000milestare.com", true },
- { "400k8.com", true },
- { "4025c.com", true },
- { "4025d.com", true },
- { "4025f.com", true },
- { "4025g.com", true },
- { "4025h.com", true },
- { "4025i.com", true },
- { "4025j.com", true },
- { "4025k.com", true },
- { "4025l.com", true },
- { "4025n.com", true },
- { "4025p.com", true },
- { "4025q.com", true },
- { "4025s.com", true },
- { "4025t.com", true },
- { "4025u.com", true },
- { "4025v.com", true },
- { "4025w.com", true },
- { "4025x.com", true },
- { "4025y.com", true },
- { "403.ch", true },
- { "4048.co", true },
- { "40481234.com", true },
- { "40482345.com", true },
- { "40484567.com", true },
- { "40485678.com", true },
- { "40486789.com", true },
- { "4048aaa.com", true },
- { "4048b.com", true },
- { "4048ccc.com", true },
- { "4048ddd.com", true },
- { "4048e.com", true },
- { "4048eee.com", true },
- { "4048fff.com", true },
- { "4048ggg.com", true },
- { "4048hhh.com", true },
- { "4048i.com", true },
- { "4048iii.com", true },
- { "4048jjj.com", true },
- { "4048lll.com", true },
- { "4048mmm.com", true },
- { "4048ooo.com", true },
- { "4048p.com", true },
- { "4048ppp.com", true },
- { "4048q.com", true },
- { "4048qqq.com", true },
- { "4048r.com", true },
- { "4048rrr.com", true },
- { "4048s.com", true },
- { "4048sss.com", true },
- { "4048t.com", true },
- { "4048ttt.com", true },
- { "4048vvv.com", true },
- { "4048w.com", true },
- { "4048www.com", true },
- { "4048x.com", true },
- { "4048xxx.com", true },
- { "4048y.com", true },
- { "4048yyy.com", true },
- { "4048z.com", true },
- { "4048zzz.com", true },
- { "404notfound.com.br", true },
- { "40666888.com", false },
- { "406811.com", true },
- { "406833.com", true },
- { "4096b.com", true },
- { "40acts.org.uk", true },
- { "40percentpapermache.com", true },
- { "41199.com", true },
- { "411film.com", true },
- { "411movie.com", true },
- { "411quest.com", true },
- { "4151365.com", true },
- { "416365.com", true },
- { "41studio.com", true },
- { "42.tools", true },
- { "420.nerdpol.ovh", true },
- { "420java.com", true },
- { "420screen.com", true },
- { "4233070.com", true },
- { "428northampton.com", true },
- { "42ch.com", true },
- { "42day.info", true },
- { "42l.fr", true },
- { "432web.net", true },
- { "437844.com", true },
- { "439050.com", true },
- { "43klive.com", true },
- { "44-k.com", true },
- { "440887.com", true },
- { "44168365.com", true },
- { "441jj.com", false },
- { "441jz.com", true },
- { "442887.com", true },
- { "442jz.com", true },
- { "44365t.com", true },
- { "443887.com", true },
- { "443jz.com", true },
- { "444887.com", true },
- { "444b58.com", true },
- { "4455bet.vip", true },
- { "445887.com", true },
- { "44b58.com", true },
- { "451365.com", true },
- { "45365t.com", true },
- { "456365t.com", true },
- { "45674048.com", true },
- { "456lc.com", true },
- { "459022.com", true },
- { "45b.org", true },
- { "463855.com", true },
- { "4661049.com", true },
- { "46d88.com", true },
- { "47.rs", true },
- { "4706666.com", true },
- { "4716666.com", true },
- { "4726666.com", true },
- { "4756666.com", true },
- { "4761.cc", true },
- { "4762.cc", true },
- { "4776070.com", true },
- { "4786666.com", true },
- { "47d88.com", true },
- { "48365365cn.com", true },
- { "48365cn-365.com", true },
- { "487511.com", true },
- { "487522.com", true },
- { "487866.com", true },
- { "48d88.com", true },
- { "491mhz.net", true },
- { "492977.com", true },
- { "492y.com", true },
- { "497773.com", true },
- { "49889.com", true },
- { "499ks.com", true },
- { "499ks.net", true },
- { "49dollaridahoregisteredagent.com", true },
- { "4best.tk", true },
- { "4c-haircare.com", true },
- { "4dillusion.tk", true },
- { "4everproxy.com", true },
- { "4evip.com", true },
- { "4eyes.ch", true },
- { "4fit.ro", true },
- { "4g-server.eu", false },
- { "4garage.com.br", true },
- { "4gnews.pt", true },
- { "4hmediaproductions.com", true },
- { "4host.ch", true },
- { "4investors.de", true },
- { "4lock.com.br", true },
- { "4mm.org", true },
- { "4monar.com", true },
- { "4obgyne.com", true },
- { "4plebs.moe", true },
- { "4project.co.il", true },
- { "4th-ave-studio.com", true },
- { "4thdc.com", true },
- { "4u.services", false },
- { "4u2ore.net", true },
- { "4vector.com", true },
- { "4vf.de", true },
- { "4wrd.cc", true },
- { "4x.fi", true },
- { "4x4-27mc.nl", true },
- { "4x4.lk", true },
- { "4x4coatingen.nl", true },
- { "4xlabs.co", true },
- { "5-890.com", false },
- { "50.gd", true },
- { "500k8.com", true },
- { "500promocodes.com", true },
- { "500promokodov.ru", true },
- { "501117.com", true },
- { "5017701.com", true },
- { "5017702.com", true },
- { "5017703.com", true },
- { "5017704.com", true },
- { "5017705.com", true },
- { "5017801.com", true },
- { "5017802.com", true },
- { "5017803.com", true },
- { "5017804.com", true },
- { "5017805.com", true },
- { "502312.com", true },
- { "504122.com", true },
- { "504322.com", true },
- { "504622.com", true },
- { "504922.com", true },
- { "505343.com", false },
- { "5055990.com", true },
- { "506422.com", true },
- { "508kb.com", true },
- { "50lakeshore.com", true },
- { "50milli.com", true },
- { "50north.de", true },
- { "513651.com", true },
- { "51365a.com", true },
- { "51365aa.com", true },
- { "51365b.com", true },
- { "51365bb.com", true },
- { "51365c.com", true },
- { "51365cc.com", true },
- { "51365d.com", true },
- { "51365dd.com", true },
- { "51365ee.com", true },
- { "513maximus.site", true },
- { "513x.cc", true },
- { "514122.com", true },
- { "514522.com", true },
- { "514922.com", true },
- { "515422.com", true },
- { "516422.com", true },
- { "516btt.com", true },
- { "516btt.net", true },
- { "516ks.com", true },
- { "518.com.tw", true },
- { "51877.net", true },
- { "518k8.com", true },
- { "519422.com", true },
- { "5197.com", true },
- { "51acg.eu.org", true },
- { "51guaq.com", true },
- { "51tiaojiu.com", true },
- { "52002a.com", true },
- { "52002b.com", true },
- { "52002d.com", true },
- { "52002e.com", true },
- { "52002f.com", true },
- { "52002g.com", true },
- { "52002h.com", true },
- { "52002i.com", true },
- { "52002j.com", true },
- { "52002k.com", true },
- { "52002l.com", true },
- { "52002m.com", true },
- { "52002n.com", true },
- { "52002o.com", true },
- { "52002p.com", true },
- { "52002q.com", true },
- { "52002r.com", true },
- { "52002s.com", true },
- { "52002t.com", true },
- { "52002u.com", true },
- { "52002v.com", true },
- { "52002w.com", true },
- { "52002x.com", true },
- { "52002y.com", true },
- { "52051.com", true },
- { "52051t.com", true },
- { "52051u.com", true },
- { "52051v.com", true },
- { "52051w.com", true },
- { "52051x.com", true },
- { "52051y.com", true },
- { "52051z.com", true },
- { "52062e.com", true },
- { "52062g.com", true },
- { "52062j.com", true },
- { "52062k.com", true },
- { "52062p.com", true },
- { "52062u.com", true },
- { "52062y.com", true },
- { "524022.com", true },
- { "524622.com", true },
- { "524922.com", true },
- { "525.info", true },
- { "5287.com", true },
- { "529kb.com", true },
- { "52dashboard.com", true },
- { "52kb365.com", true },
- { "52ncp.net", true },
- { "52sykb.com", true },
- { "531422.com", true },
- { "532441.com", true },
- { "532445.com", true },
- { "534122.com", true },
- { "534622.com", true },
- { "534922.com", true },
- { "535kb.com", true },
- { "5364.com", true },
- { "536422.com", true },
- { "5364b.com", true },
- { "5364c.com", true },
- { "5364d.com", true },
- { "5364jc.com", true },
- { "536kb.com", true },
- { "53ningen.com", true },
- { "540922.com", true },
- { "541022.com", true },
- { "541622.com", true },
- { "541651.com", true },
- { "541722.com", true },
- { "541922.com", true },
- { "545922.com", true },
- { "546802.com", true },
- { "54below.com", true },
- { "54lsj.cc", true },
- { "551365.com", true },
- { "552365.com", true },
- { "552z6.com", true },
- { "55365t.com", true },
- { "5539z.com", true },
- { "553z6.com", true },
- { "55554048.com", true },
- { "555b58.com", true },
- { "555btt.com", true },
- { "555kb.com", true },
- { "555wfcp.com", true },
- { "555zlong.com", true },
- { "556021.com", true },
- { "5566bet.vip", true },
- { "556777.cc", true },
- { "556z6.com", true },
- { "557z6.com", true },
- { "558btt.net", true },
- { "558z6.com", true },
- { "559z6.com", true },
- { "55b58.com", true },
- { "55d88.com", true },
- { "55ks.app", true },
- { "55lc8.com", true },
- { "56011r.com", true },
- { "56011s.com", true },
- { "56011t.com", true },
- { "56011u.com", true },
- { "56011v.com", true },
- { "56011w.com", true },
- { "56011x.com", true },
- { "56011y.com", true },
- { "56011z.com", true },
- { "56365t.com", true },
- { "565kb.com", true },
- { "566k66.com", true },
- { "566ks.com", true },
- { "566z6.com", true },
- { "56736565.com", true },
- { "56784048.com", true },
- { "572kb.com", true },
- { "575kb.com", true },
- { "5763.org", true },
- { "576422.com", true },
- { "577z6.com", true },
- { "5781.org", true },
- { "578637.com", true },
- { "5792.org", true },
- { "579422.com", true },
- { "5795111.com", true },
- { "579533.com", true },
- { "5795444.com", true },
- { "5795885.com", true },
- { "5795886.com", true },
- { "5795887.com", true },
- { "5796.org", true },
- { "5797.org", true },
- { "581018.com", true },
- { "581kb.com", true },
- { "583422.com", true },
- { "585422.com", true },
- { "585kb.com", true },
- { "586422.com", true },
- { "5889k.com", true },
- { "588k8.com", true },
- { "588z6.com", true },
- { "58d88.com", true },
- { "58w66.com", true },
- { "58xiangka.com", true },
- { "591422.com", true },
- { "592227.com", true },
- { "592422.com", true },
- { "593-7.com", false },
- { "5930593.com", true },
- { "594022.com", true },
- { "594622.com", true },
- { "595422.com", true },
- { "595ks.com", true },
- { "596422.com", true },
- { "59759vip.com", true },
- { "59759z.com", true },
- { "5981168.com", true },
- { "5981655.com", true },
- { "5981668.com", true },
- { "5981669.com", true },
- { "5981677.com", true },
- { "5981688.com", true },
- { "5981699.com", true },
- { "5981800.com", true },
- { "5981811.com", true },
- { "5981822.com", true },
- { "5981833.com", true },
- { "5981855.com", true },
- { "5981866.com", true },
- { "5981877.com", true },
- { "5981899.com", true },
- { "5981918.com", true },
- { "5981s.com", true },
- { "5981t.com", true },
- { "5981v.com", true },
- { "5981w.com", true },
- { "59859h.vip", true },
- { "59859j.vip", true },
- { "59859k.vip", true },
- { "59859l.vip", true },
- { "59859y.vip", true },
- { "59859z.vip", true },
- { "598877.com", true },
- { "5997891.com", true },
- { "599980.com", true },
- { "599ks.com", true },
- { "59rus.tk", true },
- { "5agks.com", true },
- { "5apps.com", true },
- { "5c1fd0f31022cbc40af9f785847baaf9.space", true },
- { "5ccapitalinvestments.com", true },
- { "5chat.it", true },
- { "5dm.tv", true },
- { "5eki.jp", true },
- { "5francs.com", true },
- { "5gb.space", true },
- { "5goglobal.com", true },
- { "5i.gs", true },
- { "5icsb.com", true },
- { "5ilg.com", true },
- { "5in.win", true },
- { "5k66.ag", true },
- { "5kraceforals.com", true },
- { "5lc8.com", true },
- { "5lc8.net", true },
- { "5percentperweek.com", true },
- { "5stars.tv", true },
- { "5thchichesterscouts.org.uk", true },
- { "5y.fi", true },
- { "5yeb.com", true },
- { "60062b.cc", true },
- { "60062h.cc", true },
- { "60062i.cc", true },
- { "600k8.com", true },
- { "602422.com", true },
- { "602yb.com", true },
- { "603yb.com", true },
- { "604122.com", true },
- { "604322.com", true },
- { "604522.com", true },
- { "604622.com", true },
- { "605422.com", true },
- { "606422.com", true },
- { "606722.com", true },
- { "608885.com", true },
- { "608vets.com", true },
- { "609422.com", true },
- { "611135.com", true },
- { "611165.com", true },
- { "611195.com", true },
- { "614022.com", true },
- { "614322.com", true },
- { "614922.com", true },
- { "616btt.com", true },
- { "616f88.com", true },
- { "616xin.com", true },
- { "61730123.com", true },
- { "618btt.com", true },
- { "619kb.com", true },
- { "61z6.com", true },
- { "620207.com", true },
- { "621422.com", true },
- { "621kb.com", true },
- { "62222.com", true },
- { "622812.com", true },
- { "622z6.com", true },
- { "623kb.com", true },
- { "624022.com", true },
- { "624122.com", true },
- { "624322.com", true },
- { "624522.com", true },
- { "624922.com", true },
- { "625kb.com", true },
- { "626422.com", true },
- { "630422.com", true },
- { "631422.com", true },
- { "633663.cc", true },
- { "633663.net", true },
- { "633663.vip", true },
- { "633kb.com", true },
- { "633z6.com", true },
- { "634022.com", true },
- { "634322.com", true },
- { "634622.com", true },
- { "634922.com", true },
- { "635422.com", true },
- { "636422.com", true },
- { "6365ah.com", true },
- { "6365am.com", true },
- { "6365bj.com", true },
- { "6365cq.com", true },
- { "6365dx.com", true },
- { "6365fj.com", true },
- { "6365gd.com", true },
- { "6365gs.com", true },
- { "6365gx.com", true },
- { "6365gz.com", true },
- { "6365hb.com", true },
- { "6365hh.com", true },
- { "6365hk.com", true },
- { "6365hlj.com", true },
- { "6365hn.com", true },
- { "6365jl.com", true },
- { "6365js.com", true },
- { "6365jx.com", true },
- { "6365ln.com", true },
- { "6365lt.com", true },
- { "6365nmg.com", true },
- { "6365nn.com", true },
- { "6365nx.com", true },
- { "6365qh.com", true },
- { "6365sc.com", true },
- { "6365sd.com", true },
- { "6365sh.com", true },
- { "6365ss.com", true },
- { "6365sx.com", true },
- { "6365tj.com", true },
- { "6365tw.com", true },
- { "6365xj.com", true },
- { "6365xz.com", true },
- { "6365yd.com", true },
- { "6365yn.com", true },
- { "6365zj.com", true },
- { "639422.com", true },
- { "63gaming.com", true },
- { "640622.com", true },
- { "640722.com", true },
- { "640922.com", true },
- { "641022.com", true },
- { "641322.com", true },
- { "641422.com", true },
- { "641522.com", true },
- { "641622.com", true },
- { "641722.com", true },
- { "641822.com", true },
- { "641922.com", true },
- { "642022.com", true },
- { "642322.com", true },
- { "642422.com", true },
- { "642722.com", true },
- { "642822.com", true },
- { "642922.com", true },
- { "643022.com", true },
- { "643122.com", true },
- { "643722.com", true },
- { "643922.com", true },
- { "645022.com", true },
- { "645122.com", true },
- { "645322.com", true },
- { "645722.com", true },
- { "645822.com", true },
- { "645922.com", true },
- { "646022.com", true },
- { "646322.com", true },
- { "646722.com", true },
- { "649022.com", true },
- { "649622.com", true },
- { "649722.com", true },
- { "649822.com", true },
- { "64d88.com", true },
- { "65131a.com", true },
- { "65131b.com", true },
- { "65131c.com", true },
- { "65131d.com", true },
- { "65131e.com", true },
- { "65131f.com", true },
- { "65131g.com", true },
- { "65131h.com", true },
- { "65131i.com", true },
- { "65131j.com", true },
- { "65131k.com", true },
- { "65131l.com", true },
- { "65131m.com", true },
- { "65131n.com", true },
- { "65131o.com", true },
- { "65131p.com", true },
- { "65131q.com", true },
- { "65131r.com", true },
- { "65131s.com", true },
- { "65131t.com", true },
- { "65131u.com", true },
- { "65131v.com", true },
- { "65131w.com", true },
- { "65131x.com", true },
- { "65131y.com", true },
- { "65131z.com", true },
- { "651422.com", true },
- { "652422.com", true },
- { "652kb.com", true },
- { "6542277.com", true },
- { "6543399.com", true },
- { "65477.com", true },
- { "6547700.com", true },
- { "6547711.com", true },
- { "6547722.com", true },
- { "6547733.com", true },
- { "6547744.com", true },
- { "6547755.com", true },
- { "6547766.com", true },
- { "6548855.com", true },
- { "6548877.com", true },
- { "6556a.com", true },
- { "6556b.com", true },
- { "6556c.com", true },
- { "6556d.com", true },
- { "6556f.com", true },
- { "6556g.com", true },
- { "6556h.com", true },
- { "6556j.com", true },
- { "6556k.com", true },
- { "6556m.com", true },
- { "6556x.com", true },
- { "6556z.com", true },
- { "655ks.com", true },
- { "655z6.com", true },
- { "659422.com", true },
- { "659ks.com", true },
- { "65d88.com", true },
- { "66.tn", true },
- { "661326.com", true },
- { "6616.fun", true },
- { "66168365.com", true },
- { "6617365.com", true },
- { "6618.fun", true },
- { "6619k.com", true },
- { "661z6.com", true },
- { "662607.xyz", true },
- { "6627365.com", true },
- { "6629365.com", true },
- { "662k66.com", true },
- { "662z6.com", true },
- { "663365666.com", true },
- { "663365777.com", true },
- { "663365888.com", true },
- { "663365a.vip", true },
- { "663365b.vip", true },
- { "663365c.vip", true },
- { "663365d.vip", true },
- { "663365e.vip", true },
- { "663365f.vip", true },
- { "663365g.vip", true },
- { "663365h.vip", true },
- { "663365i.com", true },
- { "663365i.vip", true },
- { "663365j.com", true },
- { "663365k.com", true },
- { "663365l.com", true },
- { "663365m.com", true },
- { "663365n.com", true },
- { "663365o.com", true },
- { "663365p.com", true },
- { "663365q.com", true },
- { "663365r.com", true },
- { "663365s.com", true },
- { "663365t.com", true },
- { "663365u.com", true },
- { "663365v.com", true },
- { "663365w.com", true },
- { "663365x.com", true },
- { "663365y.com", true },
- { "663365z.com", true },
- { "663z6.com", true },
- { "664048.com", true },
- { "6652566.com", true },
- { "6658.fun", true },
- { "665z6.com", true },
- { "666111bet.com", true },
- { "66619991.com", true },
- { "666222bet.com", true },
- { "666333bet.com", true },
- { "666365t.com", true },
- { "666555bet.com", true },
- { "66664048.com", true },
- { "666668722.com", true },
- { "666888bet.com", true },
- { "66689j.com", true },
- { "6669255.com", true },
- { "666999bet.com", true },
- { "666am8.com", true },
- { "666b58.com", true },
- { "666k66.com", true },
- { "666k8.com", true },
- { "666k8.net", true },
- { "666omg.com", true },
- { "6671365.com", true },
- { "6672365.com", true },
- { "6673365.com", true },
- { "6677bet.vip", true },
- { "667z6.com", true },
- { "6685m.com", true },
- { "6689m.com", true },
- { "668am8.com", true },
- { "668k8.com", true },
- { "668k8.net", true },
- { "668ks.com", true },
- { "668z6.com", true },
- { "669z6.com", true },
- { "66agks.com", true },
- { "66b58.com", true },
- { "66d88.net", true },
- { "66k66.ag", true },
- { "66lc8.com", true },
- { "66lc8.net", true },
- { "670102.com", true },
- { "670422.com", true },
- { "670633.com", true },
- { "671422.com", true },
- { "672422.com", true },
- { "673422.com", true },
- { "673569.com", true },
- { "676422.com", true },
- { "676812.com", true },
- { "677z6.com", true },
- { "67836565.com", true },
- { "678365cc.com", true },
- { "678365t.com", true },
- { "67877777.com", false },
- { "67894048.com", true },
- { "678z6.com", true },
- { "679422.com", true },
- { "67y7.com", true },
- { "680422.com", true },
- { "6810app.com", true },
- { "6830521.com", true },
- { "6848.com", true },
- { "6863070.com", true },
- { "686848.com", true },
- { "688libo.com", true },
- { "688z6.com", true },
- { "68hvip.com", true },
- { "690422.com", true },
- { "691422.com", true },
- { "692422.com", true },
- { "693422.com", true },
- { "694322.com", true },
- { "694622.com", true },
- { "694922.com", true },
- { "698kb.com", true },
- { "6997896.com", true },
- { "699z6.com", true },
- { "69butterfly.com", true },
- { "69fps.gg", true },
- { "69games.xxx", true },
- { "69ks.com", true },
- { "69wasted.net", true },
- { "6dec.gc.ca", true },
- { "6k66.ag", true },
- { "6k662.ag", true },
- { "6k663.ag", true },
- { "6k666.ag", true },
- { "6k666.cc", true },
- { "6k669.ag", true },
- { "6lc8.com", true },
- { "6lc8.net", true },
- { "6lo.zgora.pl", true },
- { "700.az", true },
- { "700k8.com", true },
- { "700wns.com", true },
- { "70365365.com", true },
- { "704233.com", true },
- { "704533.com", true },
- { "7045h.com", true },
- { "704633.com", true },
- { "7080997.com", true },
- { "70872.com", true },
- { "709129.com", true },
- { "70d88.com", true },
- { "712433.com", true },
- { "712kb.com", true },
- { "713367.com", true },
- { "713387.com", true },
- { "713433.com", true },
- { "71365365.com", true },
- { "714133.com", true },
- { "714533.com", true },
- { "714633.com", true },
- { "715433.com", true },
- { "716176.com", true },
- { "716227.com", true },
- { "716331.com", true },
- { "718113.com", true },
- { "718227.com", true },
- { "718337.com", true },
- { "718433.com", true },
- { "718552.com", true },
- { "718772.com", true },
- { "719433.com", true },
- { "721167.com", true },
- { "721172.com", true },
- { "7214.cc", true },
- { "7214.com", true },
- { "722201.com", true },
- { "722z6.com", true },
- { "724233.com", true },
- { "726127.com", true },
- { "726162.com", true },
- { "726176.com", true },
- { "726217.com", true },
- { "726221.com", true },
- { "726433.com", true },
- { "728433.com", true },
- { "729433.com", true },
- { "730433.com", true },
- { "731433.com", true },
- { "731716.com", true },
- { "732433.com", true },
- { "73365365.com", true },
- { "733z6.com", true },
- { "735433.com", true },
- { "736371.com", true },
- { "736381.com", true },
- { "736433.com", true },
- { "738433.com", true },
- { "739433.com", true },
- { "73info.com", false },
- { "740833.com", true },
- { "741833.com", true },
- { "742833.com", true },
- { "743833.com", true },
- { "74d88.com", true },
- { "755a.cc", true },
- { "755z6.com", true },
- { "756337.com", true },
- { "75d88.com", true },
- { "762.ch", false },
- { "762116.com", true },
- { "763137.com", true },
- { "76365365.com", true },
- { "7652.cc", true },
- { "7654321c.com", false },
- { "76668.com", true },
- { "7666898.com", true },
- { "76669.com", true },
- { "766k66.com", true },
- { "767kb.com", true },
- { "769k.com", true },
- { "76z66.com", true },
- { "77018aa.com", false },
- { "77018bb.com", false },
- { "77018cc.com", false },
- { "77018dd.com", false },
- { "77018ee.com", false },
- { "77018vip.com", false },
- { "77168365.com", true },
- { "77177.de", true },
- { "772z6.com", true },
- { "773z6.com", true },
- { "775018.com", true },
- { "775z6.com", true },
- { "776z6.com", true },
- { "7770b.com", true },
- { "777234567.com", false },
- { "777365t.com", true },
- { "7776365.com", true },
- { "77774048.com", true },
- { "777coin.com", true },
- { "778z6.com", true },
- { "779z6.com", true },
- { "77dd.com", true },
- { "77lc8.com", true },
- { "77zxdy.com", true },
- { "781671.com", true },
- { "781683.com", true },
- { "783631.com", true },
- { "78365app.com", true },
- { "78365b.com", true },
- { "78365bb.com", true },
- { "78365c.com", true },
- { "78365cc.com", true },
- { "78365dd.com", true },
- { "78365ee.com", true },
- { "783lab.com", true },
- { "787637.com", true },
- { "7878365.com", true },
- { "787kb.com", true },
- { "7885765.com", true },
- { "7888813.com", true },
- { "7888815.com", true },
- { "7888821.com", true },
- { "78904048.com", true },
- { "7891553.com", true },
- { "7891997.com", true },
- { "7893.net", true },
- { "78936565.com", true },
- { "789365t.com", true },
- { "7894.net", true },
- { "789451.com", true },
- { "790security.co.za", true },
- { "792ww.com", true },
- { "793ww.com", true },
- { "797715.com", true },
- { "799ks.com", true },
- { "799z6.com", true },
- { "79ch.com", true },
- { "7careconnect.com", true },
- { "7delights.com", true },
- { "7delights.in", true },
- { "7g31.com", true },
- { "7geese.com", true },
- { "7graus.pt", true },
- { "7k66.ag", true },
- { "7k66.vip", true },
- { "7kicks.com", true },
- { "7kovrikov.ru", true },
- { "7l00p.com", true },
- { "7lb.de", true },
- { "7lc8.com", true },
- { "7milesglobal.com", true },
- { "7minutemiles.com", true },
- { "7pets.net", true },
- { "7plus.com.au", true },
- { "7proxies.com", true },
- { "7sdre.am", true },
- { "7sons.de", true },
- { "7thcircledesigns.com", true },
- { "7win.am", true },
- { "7x24servis.com", true },
- { "8002d88.com", true },
- { "8006d88.com", true },
- { "8008d88.com", true },
- { "8012d88.com", true },
- { "8015d88.com", true },
- { "8028d.com", true },
- { "8029d.com", true },
- { "80365365.com", true },
- { "804322.com", true },
- { "80651a.com", true },
- { "80651c.com", true },
- { "8065d.com", true },
- { "806kb.com", true },
- { "8078d.com", true },
- { "8080883.com", true },
- { "8080889.com", true },
- { "8083d.com", true },
- { "80883.cc", true },
- { "80887.cc", true },
- { "809088.cc", true },
- { "8092d88.com", true },
- { "809422.com", true },
- { "80993.net", true },
- { "809kb.com", true },
- { "80bin.com", true },
- { "8102d88.com", true },
- { "811121.com", true },
- { "811z6.com", true },
- { "812221.com", true },
- { "8128d.com", true },
- { "8129d.com", true },
- { "8130d88.com", true },
- { "81365365.com", true },
- { "814022.com", true },
- { "8153d.com", true },
- { "8156d.com", true },
- { "815jz.com", true },
- { "816jz.com", true },
- { "8170d.com", true },
- { "8173d.com", true },
- { "81818app.com", true },
- { "81818b.com", true },
- { "81818c.com", true },
- { "81818e.com", true },
- { "81818f.com", true },
- { "81818g.com", true },
- { "81818h.com", true },
- { "81818i.com", true },
- { "81818j.com", true },
- { "81818k.com", true },
- { "81818l.com", true },
- { "81818n.com", true },
- { "81818o.com", true },
- { "81818p.com", true },
- { "81818q.com", true },
- { "81818r.com", true },
- { "81818s.com", true },
- { "81818t.com", true },
- { "81818u.com", true },
- { "81818w.com", true },
- { "81818x.com", true },
- { "81818y.com", true },
- { "81818z.com", true },
- { "8186d.com", true },
- { "8187d.com", true },
- { "8189196.com", true },
- { "8189d.com", true },
- { "818z6.com", true },
- { "8190d.com", true },
- { "819kb.com", true },
- { "81d88.com", true },
- { "8200d.com", true },
- { "8202d.com", true },
- { "8206d.com", true },
- { "8207d88.com", true },
- { "8208d.com", true },
- { "8211p.com", true },
- { "8212p.com", true },
- { "8213p.com", true },
- { "8214p.com", true },
- { "8215p.com", true },
- { "8216p.com", true },
- { "8225.com", true },
- { "8226d.com", true },
- { "8227d88.com", true },
- { "8228d88.com", true },
- { "822z6.com", true },
- { "8230d.com", true },
- { "8230d88.com", true },
- { "8238d.com", true },
- { "8239d.com", true },
- { "827774.com", true },
- { "82781111.com", true },
- { "82783333.com", true },
- { "82784444.com", true },
- { "82785555.com", true },
- { "82786666.com", true },
- { "82789999.com", true },
- { "8278a.com", true },
- { "8278a.net", true },
- { "8278aa.com", true },
- { "8278aaa.com", true },
- { "8278b.com", true },
- { "8278b.net", true },
- { "8278bb.com", true },
- { "8278bbb.com", true },
- { "8278bet.com", true },
- { "8278c.net", true },
- { "8278ccc.com", true },
- { "8278d.com", true },
- { "8278d.net", true },
- { "8278ddd.com", true },
- { "8278e.net", true },
- { "8278ee.com", true },
- { "8278f.net", true },
- { "8278ff.com", true },
- { "8278fff.com", true },
- { "8278g.com", true },
- { "8278g.net", true },
- { "8278gg.com", true },
- { "8278ggg.com", true },
- { "8278h.net", true },
- { "8278hh.com", true },
- { "8278hhh.com", true },
- { "8278i.net", true },
- { "8278ii.com", true },
- { "8278iii.com", true },
- { "8278j.net", true },
- { "8278jj.com", true },
- { "8278k.com", true },
- { "8278kk.com", true },
- { "8278l.com", true },
- { "8278ll.com", true },
- { "8278m.com", true },
- { "8278mm.com", true },
- { "8278nn.com", true },
- { "8278oo.com", true },
- { "8278pp.com", true },
- { "8278qq.com", true },
- { "8278rr.com", true },
- { "8278ss.com", true },
- { "8278tt.com", true },
- { "8278w.com", true },
- { "8278ww.com", true },
- { "8278y.com", true },
- { "8278yy.com", true },
- { "82ag88.com", true },
- { "833792.com", true },
- { "833z6.com", true },
- { "8371p.com", true },
- { "8373p.com", true },
- { "8376p.com", true },
- { "8378p.com", true },
- { "8387p.com", true },
- { "8396p.com", true },
- { "842365.com", true },
- { "842844.com", true },
- { "847773.com", true },
- { "848jz.com", true },
- { "8522.am", true },
- { "8522club.com", true },
- { "8522ph.com", true },
- { "8522tw.com", true },
- { "8522usa.com", true },
- { "856kb.com", true },
- { "8602012.com", true },
- { "8602013.com", true },
- { "8602014.com", true },
- { "8602015.com", true },
- { "8602016.com", true },
- { "8602017.com", true },
- { "8602018.com", true },
- { "8602019.com", true },
- { "8602020.com", true },
- { "8602021.com", true },
- { "86086011.com", true },
- { "86086022.com", true },
- { "86086033.com", true },
- { "86086044.com", true },
- { "86086055.com", true },
- { "86086066.com", true },
- { "86086077.com", true },
- { "86086099.com", true },
- { "861kb.com", true },
- { "866300.vip", true },
- { "866305.vip", true },
- { "866308.vip", true },
- { "866k66.com", true },
- { "866z6.com", true },
- { "868z6.com", true },
- { "869kb.com", true },
- { "86btt.com", true },
- { "86metro.ru", true },
- { "86z66.com", true },
- { "8722am.com", true },
- { "8722cn.com", true },
- { "8722hk.com", true },
- { "8722ph.com", true },
- { "8722tw.com", true },
- { "8722usa.com", true },
- { "87365365.com", true },
- { "877791.com", true },
- { "877z6.com", true },
- { "878365aa.com", true },
- { "878365app.com", true },
- { "878365b.com", true },
- { "878365bb.com", true },
- { "878365c.com", true },
- { "878365cc.com", true },
- { "878365cn.com", true },
- { "878365d.com", true },
- { "878365dd.com", true },
- { "878365ee.com", true },
- { "878365ii.com", true },
- { "878365jj.com", true },
- { "878365ll.com", true },
- { "878365mm.com", true },
- { "878365nn.com", true },
- { "88-line.com", true },
- { "88-line.net", true },
- { "8801ks.com", true },
- { "88021.com", false },
- { "8802ks.com", true },
- { "8802p.com", true },
- { "8806d.com", true },
- { "8809ks.com", true },
- { "881-line.com", true },
- { "881-line.net", true },
- { "8812ks.com", true },
- { "8815d.com", true },
- { "88168365.com", true },
- { "8816d.com", true },
- { "8818ks.com", true },
- { "8819ks.com", true },
- { "881z6.com", true },
- { "8822d88.com", true },
- { "8826d.com", true },
- { "8828ks.com", true },
- { "882kb.com", true },
- { "882z6.com", true },
- { "8830ks.com", true },
- { "88365.net", true },
- { "88365t.com", true },
- { "8839ks.com", true },
- { "883z6.com", true },
- { "8850d88.com", true },
- { "88522am.com", true },
- { "885287.com", true },
- { "8858ks.com", true },
- { "8859ks.com", true },
- { "885kb.com", true },
- { "885z6.com", true },
- { "8860d.com", true },
- { "8861ks.com", true },
- { "8862d.com", true },
- { "8868ks.com", true },
- { "8869ks.com", true },
- { "886k66.com", true },
- { "886k8.com", true },
- { "886k8.net", true },
- { "886z6.com", true },
- { "887.ag", true },
- { "8871d.com", true },
- { "8872d.com", true },
- { "88740a.com", false },
- { "88740g.com", false },
- { "8875d.com", true },
- { "8876d.com", true },
- { "8879d.com", true },
- { "887k66.com", true },
- { "887z6.com", true },
- { "8881234j.com", true },
- { "888234j.com", true },
- { "8882ks.com", true },
- { "8883456j.com", true },
- { "888345j.com", true },
- { "8884567j.com", true },
- { "888456j.com", true },
- { "88851333.com", true },
- { "88851777.com", true },
- { "888567j.com", true },
- { "8885ks.com", true },
- { "8886789j.com", true },
- { "8886ks.com", true },
- { "8888209.com", true },
- { "88884048.com", true },
- { "888888722.com", true },
- { "88889822.com", true },
- { "8888yule8888.com", true },
- { "888funcity.com", true },
- { "888funcity.net", true },
- { "888k66.com", true },
- { "8890d.com", true },
- { "8890ks.com", true },
- { "8891d.com", true },
- { "8891ks.com", true },
- { "8892d.com", true },
- { "8892ks.com", true },
- { "8895d.com", true },
- { "8895ks.com", true },
- { "8897d.com", true },
- { "889vip2.com", true },
- { "889vip3.com", true },
- { "889vip4.com", true },
- { "889vip5.com", true },
- { "889w889.com", true },
- { "889w889.net", true },
- { "889z6.com", true },
- { "88btt.com", true },
- { "88btt.net", true },
- { "88djl.cc", true },
- { "88home9.com", true },
- { "88kash.com", true },
- { "88kb88.com", true },
- { "88lc8.net", true },
- { "88lc88.com", true },
- { "88lc88.net", true },
- { "88lecheng.com", true },
- { "88wewin.com", true },
- { "88yule11.com", true },
- { "88yule112.com", true },
- { "88yule113.com", true },
- { "88yule12.com", true },
- { "88yule13.com", true },
- { "88yule15.com", true },
- { "88yule16.com", true },
- { "88yule3.com", true },
- { "88yule5.com", true },
- { "88yule6.com", true },
- { "88yule7.com", true },
- { "88yule9.com", true },
- { "8900d.com", true },
- { "8906d.com", true },
- { "8907d.com", true },
- { "8908d.com", true },
- { "8914499.com", true },
- { "8919d.com", true },
- { "8920d.com", true },
- { "8921d.com", true },
- { "8925d.com", true },
- { "8926d.com", true },
- { "89365t.com", true },
- { "89386.com", true },
- { "89386a.com", true },
- { "89386b.com", true },
- { "89386c.com", true },
- { "89386d.com", true },
- { "89386e.com", true },
- { "89386l.com", true },
- { "8938885.com", true },
- { "897774.com", true },
- { "898z6.com", true },
- { "899ks.com", true },
- { "899z6.com", true },
- { "89btt.com", true },
- { "8ag88.com", true },
- { "8balls.nl", true },
- { "8btt.app", true },
- { "8k66.vip", true },
- { "8lc8.net", true },
- { "8maerz.at", true },
- { "8me.nl", true },
- { "8t8.eu", true },
- { "8tech.com.hk", true },
- { "8thportsmouth.org.uk", true },
- { "8tuffbeers.com", true },
- { "8win.am", true },
- { "8xx888.com", true },
- { "8xxbet.net", true },
- { "8xxxxxxx.com", true },
- { "8yun.ga", true },
- { "9-11commission.gov", true },
- { "900823.com", true },
- { "9009019.com", false },
- { "900k8.com", true },
- { "901543.com", true },
- { "903422.com", true },
- { "905422.com", true },
- { "906vv.com", true },
- { "9090819.com", true },
- { "90920.cn", true },
- { "90r.jp", true },
- { "9108.fun", true },
- { "911.gov", true },
- { "911216.xyz", true },
- { "9118.com", true },
- { "9118.hk", true },
- { "911commission.gov", true },
- { "912422.com", true },
- { "913422.com", true },
- { "914122.com", true },
- { "915kb.com", true },
- { "917.moe", true },
- { "918-siteinfo.com", true },
- { "918.com", true },
- { "9180.fun", true },
- { "9180nn.com", true },
- { "9180tt.com", true },
- { "9180vv.com", true },
- { "9180xx.com", true },
- { "9180yy.com", true },
- { "9180zz.com", true },
- { "918101.net", true },
- { "91816.net", true },
- { "9186.fun", true },
- { "9186119.com", true },
- { "9189.fun", true },
- { "91891849.com", true },
- { "91891854.com", true },
- { "91891856.com", true },
- { "91891878.com", true },
- { "918aac.com", true },
- { "918aait.co", true },
- { "918aak.com", true },
- { "918aav.com", true },
- { "918ac.com", true },
- { "918aff.com", true },
- { "918agr.co", true },
- { "918ajj.com", true },
- { "918akk.com", true },
- { "918amj.co", true },
- { "918att.com", true },
- { "918axx.com", true },
- { "918ayy.com", true },
- { "918bbm.co", true },
- { "918bbt.com", true },
- { "918bby.co", true },
- { "918bby.com", true },
- { "918bcf.co", true },
- { "918bcw.co", true },
- { "918bhh.com", true },
- { "918bip.co", true },
- { "918bis.co", true },
- { "918bit.co", true },
- { "918btt.com", true },
- { "918btt.net", true },
- { "918btty.com", true },
- { "918bttz.com", true },
- { "918byy.com", true },
- { "918ca.com", true },
- { "918cca.com", true },
- { "918cce.com", true },
- { "918ccq.com", true },
- { "918ch.com", true },
- { "918cr.com", true },
- { "918ctt.com", true },
- { "918cx.com", true },
- { "918dc04.com", true },
- { "918dc16.com", true },
- { "918dc19.com", true },
- { "918dda.com", true },
- { "918ddj.com", true },
- { "918ddo.com", true },
- { "918ddx.com", true },
- { "918dxx.com", true },
- { "918ee.com", true },
- { "918eej.com", true },
- { "918ej.com", true },
- { "918ev.com", true },
- { "918ffa.com", true },
- { "918fq.com", true },
- { "918fr.com", true },
- { "918fv.com", true },
- { "918gd.com", true },
- { "918hr.com", true },
- { "918hu.com", true },
- { "918hw.com", true },
- { "918ia.com", true },
- { "918iz.com", true },
- { "918ji.com", true },
- { "918jt.co", true },
- { "918kx.com", true },
- { "918mc.com", true },
- { "918md10.com", true },
- { "918md16.com", true },
- { "918md25.com", true },
- { "918mf.com", true },
- { "918nc.com", true },
- { "918nd.com", true },
- { "918nu.com", true },
- { "918ny.com", true },
- { "918pt.com", true },
- { "918qa.com", true },
- { "918qg.com", true },
- { "918qs.com", true },
- { "918qz.com", true },
- { "918rw.com", true },
- { "918sn.com", true },
- { "918ta.com", true },
- { "918te.com", true },
- { "918tj.com", true },
- { "918tr.com", true },
- { "918tw.com", true },
- { "918uh.com", true },
- { "918um.com", true },
- { "918vb.com", true },
- { "918ve.com", true },
- { "918vi.com", true },
- { "918vz.com", true },
- { "918wa.com", true },
- { "918we.com", true },
- { "918wo.com", true },
- { "918wq.com", true },
- { "918ww.com", true },
- { "918xe.com", true },
- { "918xn.com", true },
- { "918yy.net", true },
- { "918ze.com", true },
- { "918zm.com", true },
- { "918zv.com", true },
- { "918zw.com", true },
- { "919422.com", true },
- { "91d27.com", true },
- { "91d52.com", true },
- { "91d57.com", true },
- { "91d58.com", true },
- { "91d89.com", true },
- { "91fldz.com", true },
- { "91travel.info", true },
- { "91z6.com", true },
- { "922z6.com", true },
- { "924122.com", true },
- { "924322.com", true },
- { "924622.com", true },
- { "926422.com", true },
- { "927774.com", true },
- { "92owl.com", true },
- { "92url.com", true },
- { "931422.com", true },
- { "932422.com", true },
- { "933325.com", true },
- { "933z6.com", true },
- { "934122.com", true },
- { "937774.com", true },
- { "939394.org", true },
- { "940365.com", true },
- { "941988.cn", true },
- { "943022.com", true },
- { "9449-27a1-22a1-e0d9-4237-dd99-e75e-ac85-2f47-9d34.de", true },
- { "946022.com", true },
- { "946422.com", true },
- { "949022.com", true },
- { "949122.com", true },
- { "949622.com", true },
- { "949722.com", true },
- { "9499060.com", true },
- { "9499066.com", true },
- { "9499068.com", true },
- { "9499113.com", true },
- { "9499115.com", true },
- { "9499118.com", true },
- { "9499125.com", true },
- { "9499137.com", true },
- { "9499151.com", true },
- { "9499212.com", true },
- { "9499232.com", true },
- { "9499238.com", true },
- { "9499263.com", true },
- { "9499278.com", true },
- { "9499292.com", true },
- { "9499293.com", true },
- { "9499343.com", true },
- { "9499369.com", true },
- { "9499399.com", true },
- { "9499403.com", true },
- { "9499459.com", true },
- { "9499518.com", true },
- { "9499558.com", true },
- { "9499565.com", true },
- { "9499568.com", true },
- { "9499575.com", true },
- { "9499668.com", true },
- { "9499676.com", true },
- { "9499682.com", true },
- { "9499737.com", true },
- { "9499757.com", true },
- { "9499835.com", true },
- { "9499855.com", true },
- { "9499869.com", true },
- { "9499958.com", true },
- { "9499aaaa.com", true },
- { "9499bbbb.com", true },
- { "9499cccc.com", true },
- { "9499dc.com", true },
- { "9499dddd.com", true },
- { "9499eeee.com", true },
- { "9499ffff.com", true },
- { "9499gggg.com", true },
- { "9499good.com", true },
- { "9499hhhh.com", true },
- { "9499iiii.com", true },
- { "9499jjj.com", true },
- { "9499jjjj.com", true },
- { "9499kkkk.com", true },
- { "9499l.com", true },
- { "9499llll.com", true },
- { "9499love.com", true },
- { "9499mmmm.com", true },
- { "9499nnnn.com", true },
- { "9499oooo.com", true },
- { "9499pppp.com", true },
- { "9499qqqq.com", true },
- { "9499rrrr.com", true },
- { "9499ssss.com", true },
- { "9499ttt.com", true },
- { "9499tttt.com", true },
- { "9499uuuu.com", true },
- { "9499vvvv.com", true },
- { "9499wwww.com", true },
- { "9499xxx.com", true },
- { "9499xxxx.com", true },
- { "9499yl.com", true },
- { "9499yyyy.com", true },
- { "9499zzzz.com", true },
- { "94imk.com", true },
- { "955z6.com", true },
- { "95am8.com", true },
- { "96002.com", false },
- { "96002e.com", false },
- { "962312.com", true },
- { "96678.com", true },
- { "966k66.com", true },
- { "966kb.com", true },
- { "966ks.com", true },
- { "966z6.com", true },
- { "9679693.com", true },
- { "967you.com", true },
- { "9681909.com", true },
- { "96z66.com", true },
- { "972422.com", true },
- { "97735.com", true },
- { "97736.com", true },
- { "97737.com", true },
- { "97738.com", true },
- { "97739.com", true },
- { "977hghg.com", true },
- { "977kb.com", true },
- { "977z6.com", true },
- { "9788876.com", true },
- { "9800.cc", true },
- { "9822.am", true },
- { "9822am.com", true },
- { "9822cn.com", true },
- { "9822hk.com", true },
- { "9822ph.com", true },
- { "9822tw.com", true },
- { "9822usa.com", true },
- { "984.ch", true },
- { "985kb.com", true },
- { "988316.com", true },
- { "988z6.com", true },
- { "989z6.com", true },
- { "98d88.com", true },
- { "98lc98.net", true },
- { "99123j.com", true },
- { "9918883.com", true },
- { "991z6.com", true },
- { "992z6.com", true },
- { "99365t.com", true },
- { "993z6.com", true },
- { "99456j.com", true },
- { "9950p.com", true },
- { "99599.fi", true },
- { "99599.net", true },
- { "995z6.com", true },
- { "9968909.com", false },
- { "99789j.com", true },
- { "997z6.com", true },
- { "998081.com", true },
- { "9988551.com", true },
- { "9988959.com", true },
- { "9988ty.com", true },
- { "998k66.com", true },
- { "998sa.com", true },
- { "998wns.com", true },
- { "998z6.com", true },
- { "999365t.com", true },
- { "9998k8.com", true },
- { "99994048.com", true },
- { "99999822.com", true },
- { "999998722.com", true },
- { "999b58.com", true },
- { "999btt.net", true },
- { "999k66.com", true },
- { "999salon.co", true },
- { "999salon.com", true },
- { "999zlong.com", true },
- { "99agks.com", true },
- { "99d88.com", true },
- { "99kb88.com", true },
- { "99lib.net", true },
- { "99qp.org", true },
- { "99rst.org", true },
- { "99spokes.com", true },
- { "9ag88.com", true },
- { "9box.jp", true },
- { "9farm.com", true },
- { "9fvip.net", true },
- { "9h.pl", true },
- { "9iwan.net", true },
- { "9jabase.com.ng", true },
- { "9jk7opa.com", true },
- { "9k223.com", true },
- { "9k226.com", true },
- { "9k227.com", true },
- { "9k228.com", true },
- { "9k229.com", true },
- { "9k233.com", true },
- { "9k235.com", true },
- { "9k236.com", true },
- { "9k237.com", true },
- { "9k238.com", true },
- { "9k239.com", true },
- { "9k252.com", true },
- { "9k253.com", true },
- { "9k255.com", true },
- { "9k256.com", true },
- { "9k257.com", true },
- { "9k258.com", true },
- { "9k259.com", true },
- { "9k265.com", true },
- { "9k266.com", true },
- { "9k267.com", true },
- { "9k268.com", true },
- { "9k269.com", true },
- { "9k272.com", true },
- { "9k273.com", true },
- { "9k275.com", true },
- { "9k276.com", true },
- { "9k277.com", true },
- { "9k278.com", true },
- { "9k279.com", true },
- { "9k283.com", true },
- { "9k285.com", true },
- { "9k287.com", true },
- { "9k289.com", true },
- { "9k292.com", true },
- { "9k295.com", true },
- { "9k296.com", true },
- { "9k297.com", true },
- { "9k298.com", true },
- { "9k299.com", true },
- { "9k322.com", true },
- { "9k325.com", true },
- { "9k328.com", true },
- { "9k332.com", true },
- { "9k335.com", true },
- { "9k336.com", true },
- { "9k338.com", true },
- { "9k362.com", true },
- { "9k363.com", true },
- { "9k366.com", true },
- { "9k368.com", true },
- { "9k372.com", true },
- { "9k373.com", true },
- { "9k375.com", true },
- { "9k376.com", true },
- { "9k378.com", true },
- { "9k383.com", true },
- { "9k385.com", true },
- { "9k386.com", true },
- { "9k388.com", true },
- { "9k398.com", true },
- { "9k566.com", true },
- { "9k573.com", true },
- { "9k577.com", true },
- { "9k589.com", true },
- { "9k625.com", true },
- { "9k627.com", true },
- { "9k629.com", true },
- { "9k632.com", true },
- { "9k637.com", true },
- { "9k657.com", true },
- { "9k659.com", true },
- { "9k672.com", true },
- { "9k677.com", true },
- { "9k679.com", true },
- { "9k683.com", true },
- { "9k687.com", true },
- { "9k693.com", true },
- { "9k696.com", true },
- { "9k822.com", true },
- { "9k825.com", true },
- { "9k828.com", true },
- { "9k829.com", true },
- { "9k832.com", true },
- { "9k837.com", true },
- { "9k838.com", true },
- { "9k852.com", true },
- { "9k857.com", true },
- { "9k858.com", true },
- { "9k862.com", true },
- { "9k866.com", true },
- { "9k867.com", true },
- { "9k868.com", true },
- { "9k869.com", true },
- { "9k873.com", true },
- { "9k882.com", true },
- { "9k886.com", true },
- { "9k895.com", true },
- { "9k897.com", true },
- { "9k898.com", true },
- { "9kb.xyz", true },
- { "9kopb.ru", true },
- { "9lc9.com", true },
- { "9pkfz.com", true },
- { "9riddles.com", true },
- { "9to5notes.in", true },
- { "9uelle.jp", true },
- { "9ungnir.xyz", true },
- { "9vx.org", true },
- { "9yw.me", true },
- { "a-1basements.com", true },
- { "a-1indianawaterproofing.com", true },
- { "a-allard.be", true },
- { "a-care.net", true },
- { "a-classinflatables.co.uk", true },
- { "a-invest.de", true },
- { "a-msystems.com", true },
- { "a-oben.org", true },
- { "a-tes-cotes.com", true },
- { "a-wife.net", true },
- { "a-ztransmission.com", true },
- { "a00228.com", false },
- { "a04gameapp.com", true },
- { "a06gameapp.com", true },
- { "a06webapp.com", true },
- { "a0print.nl", true },
- { "a1bouncycastlehire.com", true },
- { "a1jumpandbounce.co.uk", true },
- { "a1post.bg", true },
- { "a1scuba.com", true },
- { "a210.online", true },
- { "a22z.xyz", true },
- { "a291.cc", true },
- { "a2a.me", true },
- { "a2a.net", true },
- { "a2ch.ru", true },
- { "a2nutrition.com.au", true },
- { "a2os.club", true },
- { "a2os.xyz", true },
- { "a30.tokyo", false },
- { "a36533.com", true },
- { "a36594.com", true },
- { "a365vip1.com", true },
- { "a365vip2.com", true },
- { "a365vip3.com", true },
- { "a365vip5.com", true },
- { "a365vip9.com", true },
- { "a3mobile.com", true },
- { "a4sound.com", true },
- { "a77018.com", false },
- { "a7m2.me", true },
- { "a88fc.com", true },
- { "aa-tour.ru", true },
- { "aa00228.com", false },
- { "aa4888.com", true },
- { "aa7666.com", true },
- { "aaa-racing.com", true },
- { "aaa-racing.net", true },
- { "aaa-racing.uk", true },
- { "aaainfosystems.com", true },
- { "aaapl.com", true },
- { "aaapo.com.br", true },
- { "aabanet.com.br", true },
- { "aaben-bank.dk", true },
- { "aabenbank.dk", true },
- { "aabenjaminjewelry.com", true },
- { "aacs-design.com", true },
- { "aadv.com.br", true },
- { "aadw.de", true },
- { "aalalbayt.com", true },
- { "aalalbayt.net", true },
- { "aalstmotors-usedcars.be", false },
- { "aaltocapital.com", true },
- { "aamwa.com", true },
- { "aandkevents.co.uk", true },
- { "aanmpc.com", true },
- { "aanwp.com", true },
- { "aaomidi.com", true },
- { "aapar.nl", true },
- { "aapas.org.ar", true },
- { "aarailfan.com", true },
- { "aarklendoia.com", true },
- { "aarkue.eu", true },
- { "aaron-russell.co.uk", true },
- { "aaronfurtado.com", true },
- { "aaronkimmig.de", true },
- { "aaronroyle.com", true },
- { "aaronsilber.me", true },
- { "aarquiteta.com.br", true },
- { "aartsplastics.nl", true },
- { "aasvets.co.uk", true },
- { "aatf.us", true },
- { "aati.be", true },
- { "aati.info", true },
- { "aattrans.com", true },
- { "aavienna.com", true },
- { "ab-photography.nl", true },
- { "ab288.com", true },
- { "ab2888.cn", true },
- { "ab28s.com", true },
- { "ab2web.com", true },
- { "abaapplianceservice.com", true },
- { "abaaustin.com", true },
- { "ababyco.com.hr", true },
- { "abacusbouncycastle.co.uk", true },
- { "abacusfi.com", true },
- { "abacustech.co.jp", true },
- { "abandonedmines.gov", true },
- { "abashevo.ml", true },
- { "abateroad66.it", true },
- { "abbadabbabouncycastles.co.uk", true },
- { "abbeyok.com", true },
- { "abbeyvetspets.co.uk", true },
- { "abbottscastles.co.uk", true },
- { "abbruch-star.de", true },
- { "abc-rz.de", true },
- { "abc.li", true },
- { "abcbouncycastlessurrey.co.uk", true },
- { "abcbouncyfactory.co.uk", true },
- { "abcdreamusa.com", true },
- { "abcheck.se", true },
- { "abckam.com", true },
- { "abcode.ml", true },
- { "abcpartyhire.com", true },
- { "abcstudio.com.au", true },
- { "abdel.me", true },
- { "abdelaliezzyn.be", true },
- { "abdelaliezzyn.tk", true },
- { "abdelsater.net", true },
- { "abdl.link", true },
- { "abdulawal.tk", true },
- { "abdullahavci.com", true },
- { "abdullahavci.com.tr", true },
- { "abdullahavci.net.tr", true },
- { "abdullahzubayerofficial.ml", true },
- { "abdulrahman.eu", true },
- { "abdulwahaab.ca", true },
- { "abdurrahmangazidis.tk", true },
- { "abdurrehman.tk", true },
- { "abe-elektro.de", true },
- { "abe-medical.jp", true },
- { "abeilles-idapi.fr", false },
- { "abelbarretto.tk", true },
- { "abelsflooringandtile.com", true },
- { "abenteuer-ahnenforschung.de", true },
- { "abeontech.com", true },
- { "aberdeencastles.co.uk", true },
- { "aberdeenjudo.co.uk", true },
- { "aberon.pl", true },
- { "abeus.com", true },
- { "abg.ninja", true },
- { "abhaldus.ee", true },
- { "abhisharma.me", true },
- { "abhishekkabdijain.tk", true },
- { "abiapp.net", true },
- { "abibruce.co.uk", true },
- { "abidinginhesed.com", true },
- { "abigisp.com", true },
- { "abilitycaresoftware.com", true },
- { "abilitymatters.co.uk", true },
- { "abilityone.gov", true },
- { "abilma.com", true },
- { "abilymp06.net", true },
- { "abinyah.com", true },
- { "abiscrane.com", true },
- { "abitech.tk", true },
- { "abitidalavoro.roma.it", true },
- { "abitidasposa.roma.it", true },
- { "abiturma.de", true },
- { "abjay.com", true },
- { "ableprop.net", true },
- { "abloop.com", true },
- { "abmackenzie.com", true },
- { "abmc.gov", true },
- { "abminiplex.in", true },
- { "abmledger.ca", true },
- { "abmtax.ca", true },
- { "abn-consultants.ie", true },
- { "abnehmen.com", true },
- { "abobuch.de", true },
- { "aboces.org", true },
- { "abogadocriminalorlando.com", true },
- { "abogadoperu.com", true },
- { "abogadoscav.com", true },
- { "abogadosescobarysanchez.es", true },
- { "abolicionistas.com", true },
- { "abolition.net", true },
- { "abolitionism.ca", true },
- { "abolitionism.co.uk", true },
- { "abolitionism.com", true },
- { "abolitionism.in", true },
- { "abolitionism.net", true },
- { "abolitionism.us", true },
- { "abolitionist-project.com", true },
- { "abolitionist-society.com", true },
- { "abolitionist.ca", true },
- { "abolitionist.co.uk", true },
- { "abolitionist.com", true },
- { "abolitionist.in", true },
- { "abolitionist.net", true },
- { "abolitionist.us", true },
- { "abolitionistparty.com", true },
- { "abolitionistproject.com", true },
- { "abolitionistsociety.com", true },
- { "abolitionniste.com", true },
- { "abolizionista.com", true },
- { "abonilla.com", true },
- { "aborla.net", true },
- { "abos.eu", false },
- { "abouncycastleman.co.uk", true },
- { "about-bangladesh.tk", true },
- { "about-ti.me", true },
- { "abouthrm.nl", true },
- { "aboutict.nl", true },
- { "aboutlegal.nl", true },
- { "aboutmedia.nl", true },
- { "aboutmyproperty.ca", true },
- { "aboutpublishers.nl", true },
- { "aboutshakil.tk", true },
- { "aboutspice.com", true },
- { "aboutyou.at", true },
- { "aboutyou.be", true },
- { "aboutyou.ch", true },
- { "aboutyou.de", true },
- { "aboutyou.nl", true },
- { "aboveaverageplumbing.com", true },
- { "abox-kb.com", true },
- { "abpis.hr", true },
- { "abracadabra.co.jp", false },
- { "abrahametalero.tk", true },
- { "abrakidabra.com.br", true },
- { "abraxasteam.com", true },
- { "abrightspark.gq", true },
- { "abrikos.group", true },
- { "abristolgeek.co.uk", true },
- { "abseits.org", true },
- { "absolem.cc", false },
- { "absolutcruceros.com", true },
- { "absoluteautobody.com", true },
- { "absolutedouble.co.uk", true },
- { "absolutelyinflatables.co.uk", true },
- { "absoluterush.net", true },
- { "absolutewebdesigns.com", true },
- { "absolutviajes.com", true },
- { "abstractbarista.net", true },
- { "abstraction21.com", true },
- { "absturztau.be", true },
- { "absturztaube.ch", true },
- { "absynthe-inquisition.fr", true },
- { "abth.tk", true },
- { "abthorpe.org", true },
- { "abulanov.com", true },
- { "abundent.com", true },
- { "abuse.ch", true },
- { "abuse.fi", true },
- { "abuse.io", true },
- { "abusive-host.tk", true },
- { "abvent.net", true },
- { "abvlbasketviganello.ch", false },
- { "abyssproject.net", true },
- { "ac-admin.pl", true },
- { "ac-cosmetics.nl", true },
- { "ac-elektro.com.ua", true },
- { "ac-epmservices.com", true },
- { "ac.milan.it", true },
- { "ac0g.dyndns.org", true },
- { "aca-creative.co.uk", true },
- { "acacia-gardens.co.uk", true },
- { "academiadebomberosonline.com", true },
- { "academica.nl", true },
- { "academichealthscience.net", true },
- { "academie-de-police.ch", false },
- { "academie-musique-nice.com", true },
- { "academkin.com", true },
- { "academus.io", true },
- { "academy-awards.ml", true },
- { "academytv.com.au", true },
- { "acampar.com.br", true },
- { "acaptureservices.com", true },
- { "acara-yoga.de", true },
- { "acareer.in", true },
- { "acarreosvillavicencio.com", true },
- { "acat.io", true },
- { "acatec.de", true },
- { "acbrussels-used.be", false },
- { "accademia24.it", true },
- { "accademiapugilistica.it", true },
- { "accadia.academy", true },
- { "accelaway.com", true },
- { "acceleratenetworks.com", true },
- { "accelerateyourworld.org", true },
- { "accelsnow.com", true },
- { "accentthailand.com", true },
- { "acceptancerecoverycenter.com", true },
- { "acces-elevation.fr", true },
- { "accesloges.com", true },
- { "accesoriosviaje.com", true },
- { "accessacab.co.uk", true },
- { "accessauto-occasions.be", false },
- { "accessgaragedoors.com", true },
- { "accessibility.gov", true },
- { "accessibilityguidelines.com", true },
- { "accessibletravelclub.com", true },
- { "accesskeycloning.com", true },
- { "accessoirescheveuxchic.com", true },
- { "accessoripersmartphone.it", true },
- { "acchicocchi.com", true },
- { "accionistaprincipiante.com", true },
- { "accme.co", true },
- { "accoladescreens.com.au", true },
- { "accord-application.com", true },
- { "accordiondoor.com", true },
- { "account.bbc.com", true },
- { "account4u.nl", true },
- { "accounts.firefox.com", true },
- { "accounts.google.com", true },
- { "accpl.co", true },
- { "accpodcast.com", true },
- { "accreditamento.net", true },
- { "accrosoft.com", true },
- { "accs.org.au", true },
- { "accudraftpaintbooths.com", true },
- { "accurateautobodywa.com", true },
- { "accutint.com", true },
- { "ace.one", true },
- { "acealters.com", false },
- { "aceanswering.com", true },
- { "acecerts.co.uk", true },
- { "acecolleges.edu.au", true },
- { "aceinflatables.com", true },
- { "aceinstituteonline.com", true },
- { "aceitedelcampo.com", true },
- { "acelpb.com", true },
- { "acem.org.au", true },
- { "acemobileforce.com", true },
- { "acemypaper.com", true },
- { "acendealuz.com.br", true },
- { "acerentalandsales.com", true },
- { "acerislaw.com", true },
- { "acessibilidadebr.com.br", true },
- { "acessoeducacao.com", true },
- { "acfun.eu.org", true },
- { "acg.social", true },
- { "acg.vc", true },
- { "acgqwq.gq", true },
- { "acgtalktw.com", true },
- { "achalay.org", false },
- { "achat-volets-roulants.fr", true },
- { "achenar.net", true },
- { "acheter-ethylotest.fr", true },
- { "achieveinternet.com", true },
- { "achiksongs.tk", true },
- { "achromatisch.de", true },
- { "achterblog.de", true },
- { "achterstieg.dedyn.io", true },
- { "achtzehn.de", true },
- { "achtzehn.eu", true },
- { "achtzehnterachter.de", true },
- { "achtzig20.de", true },
- { "achwo.de", true },
- { "aciksite.com", true },
- { "acinq.co", true },
- { "ackermann.ch", true },
- { "acl.gov", true },
- { "aclu.org", false },
- { "acluva.org", false },
- { "acmi.fr", true },
- { "acneintelligence.com", true },
- { "acnpacific.com", true },
- { "acodess.com", true },
- { "aconnor.xyz", true },
- { "acordes.online", true },
- { "acorncastles.co.uk", true },
- { "acorncredentialing.com", true },
- { "acourse.io", false },
- { "acousti-tech.com", true },
- { "acousticalsolutions.com", true },
- { "acoustics.network", true },
- { "acoustics.tech", true },
- { "acousticsoundrecords.com", true },
- { "acoustique-tardy.com", false },
- { "acperu.ch", false },
- { "acquaparrucchieri.it", true },
- { "acquire.media", true },
- { "acquisition.gov", true },
- { "acquistareviagragenericoitalia.net", false },
- { "acrepairgeorgetown.com", true },
- { "acrepairhutto.com", true },
- { "acrepairroundrocktx.com", true },
- { "acrevalue.com", true },
- { "acriticismlab.org", true },
- { "acronis.com", true },
- { "acronis.org", true },
- { "acrosstheblvd.com", true },
- { "acroyoga-nuernberg.de", true },
- { "acrylbilder-acrylmalerei.de", true },
- { "acrylicwifi.com", true },
- { "acs-nettoyage-entretien-immeuble.com", true },
- { "acsbbs.org", true },
- { "acsc.gov.au", true },
- { "acscbasket.com", true },
- { "acsemb.org", true },
- { "acsports.ca", true },
- { "act-safety.nl", true },
- { "actc.org.uk", true },
- { "actgruppe.de", false },
- { "actheater.com", true },
- { "acticu.com", true },
- { "actiefgeld.nl", false },
- { "action-verite.fr", true },
- { "actioncleaningnd.com", true },
- { "actioncoachignite.co.za", true },
- { "actionfinancialservices.net", true },
- { "actionlabs.net", true },
- { "actionmadagascar.ch", false },
- { "actionsack.com", true },
- { "actionselling.com", true },
- { "actionverb.com", true },
- { "activatemyiphone.com", true },
- { "activateudid.com", true },
- { "active-tluszcz.pl", true },
- { "active.hu", false },
- { "active247.info", true },
- { "activeaerogels.com", true },
- { "activecare-monitor.com", false },
- { "activeexcavator.com", true },
- { "activefootandankle.com", true },
- { "activehire.co.uk", true },
- { "activeleisure.ie", true },
- { "activephoto.se", true },
- { "activespaceautomation.com", true },
- { "activespacetech.com", true },
- { "activityeventhire.co.uk", true },
- { "actom.cc", true },
- { "actonwoodworks.com", true },
- { "actors-cafe.net", true },
- { "actualadmins.com", true },
- { "actualidadblog.com", true },
- { "actualidadecommerce.com", true },
- { "actualidadgadget.com", true },
- { "actualidadiphone.com", true },
- { "actualidadkd.com", true },
- { "actualidadliteratura.com", true },
- { "actualidadmotor.com", true },
- { "actualidadviajes.com", true },
- { "actualsolutions.am", true },
- { "acudire.es", true },
- { "acuica.co.uk", false },
- { "acul.me", true },
- { "aculocity.com", true },
- { "acumed-diagnostic.com", true },
- { "acunetix.com", true },
- { "acupuntura.coach", true },
- { "acupuntura.doctor", true },
- { "acupuntura.institute", true },
- { "acupunturavalencia.xyz", true },
- { "acus.gov", true },
- { "acutewealthadvisors.com", true },
- { "acwcerts.co.uk", true },
- { "acwi.gov", true },
- { "acy.com", true },
- { "acyfxasia.com", true },
- { "acyume.com", true },
- { "ad-notam.asia", true },
- { "ad-notam.ch", true },
- { "ad-notam.co.uk", true },
- { "ad-notam.com", true },
- { "ad-notam.de", true },
- { "ad-notam.fr", true },
- { "ad-notam.it", true },
- { "ad-notam.pt", true },
- { "ad-notam.us", true },
- { "ad4msan.com", true },
- { "ad4msan.win", true },
- { "ada.gov", true },
- { "adaera.com", true },
- { "adalis.org", true },
- { "adam-ant.co.uk", true },
- { "adam-kostecki.de", true },
- { "adam.lgbt", true },
- { "adamas-magicus.ru", true },
- { "adambryant.ca", false },
- { "adamdixon.co.uk", true },
- { "adamdorman.com", true },
- { "adamfontenot.com", true },
- { "adamgibbins.com", true },
- { "adamh.us", true },
- { "adamkostecki.de", true },
- { "adamlee.com", true },
- { "adamoshaver.com", true },
- { "adamoutler.com", true },
- { "adamricheimer.com", true },
- { "adams.dk", true },
- { "adamsasphaltpaving.com", true },
- { "adamstas.com", true },
- { "adamyuan.xyz", true },
- { "adappt.co.uk", true },
- { "adapptlabs.com", true },
- { "adapt-elektronik.com", true },
- { "adapt.de", true },
- { "adaptablesecurity.org", true },
- { "adaptergonomics.com", true },
- { "adapti.de", true },
- { "adaptiveicons.com", true },
- { "adaptivemechanics.edu.au", true },
- { "adarixconsultores.com", true },
- { "adasbench.com", true },
- { "adativos.com.br", true },
- { "adawolfa.cz", true },
- { "adayinthelifeof.nl", true },
- { "adblockextreme.com", true },
- { "adblockextreme.net", true },
- { "adblockextreme.org", true },
- { "adc64.com", true },
- { "adceuta.tk", true },
- { "adcnvs.com", true },
- { "addcrazy.com", true },
- { "adderall.space", true },
- { "addicional.com", true },
- { "addictic.fr", true },
- { "addictionresource.com", true },
- { "addictively.com", true },
- { "addiko.net", true },
- { "addiko.rs", true },
- { "addisoncrump.info", true },
- { "addnewsite.tk", true },
- { "addnine.com", true },
- { "addo-addo.com", true },
- { "addon.watch", true },
- { "addones.org", true },
- { "addtoany.com", true },
- { "adduono.com", true },
- { "addvalue-renovations.co.uk", true },
- { "adelaidecc.com.au", true },
- { "adelebeals.com", true },
- { "adelightfulglow.com", true },
- { "adeline.mobi", true },
- { "adentalsolution.com", true },
- { "adept-elearning.com", true },
- { "adept.org.pl", true },
- { "adesa.co.uk", true },
- { "adevel.eu", true },
- { "adex.network", true },
- { "adf-safetytools.com", true },
- { "adf.rocks", true },
- { "adftrasporti.it", true },
- { "adhd-inattentive.com", true },
- { "adhesivelaundry.co.uk", true },
- { "adhocracy.plus", true },
- { "adidasrunningpartners.com", true },
- { "adiehard.party", false },
- { "adimaja.com", true },
- { "adimplere.com.br", true },
- { "adingenierie.fr", true },
- { "adiprospero.it", true },
- { "aditibhatia.com", true },
- { "adjagu.org", true },
- { "adlerneves.com", true },
- { "adlerneves.com.br", true },
- { "adlerosn.com", true },
- { "adlerosn.com.br", true },
- { "adlershop.ch", true },
- { "adlignum.se", true },
- { "adme.co.il", true },
- { "admin-serv.net", true },
- { "admin.casa", true },
- { "admin.fedoraproject.org", true },
- { "admin.google.com", true },
- { "admin.stg.fedoraproject.org", true },
- { "admind.at", true },
- { "adminforge.de", true },
- { "administracionessaez.es", true },
- { "administratie-smits.nl", true },
- { "administratiekantoorblom.nl", true },
- { "administrator.de", true },
- { "administratorserwera.pl", true },
- { "adminless.ovh", true },
- { "adminlinux.pl", true },
- { "admino.cz", true },
- { "adminrezo.fr", true },
- { "admirable.one", true },
- { "admody.com", true },
- { "admongo.gov", true },
- { "adnexa.it", true },
- { "adnolesh.com", true },
- { "adoll.ml", true },
- { "adollarseo.com", true },
- { "adomani-italia.com", true },
- { "adomicilio.com.gt", true },
- { "adonai.eti.br", true },
- { "adonis.hosting", true },
- { "adonis.media", true },
- { "adoniscabaret.co.uk", true },
- { "adonisgrup.ro", true },
- { "adontenchambers.com", true },
- { "adoptionlink.co.uk", true },
- { "adoptionpregnancycenter.com", true },
- { "adoptionpregnancycenter.net", true },
- { "adorecricket.com", true },
- { "adorewe.com", true },
- { "adorno-gymnasium.de", true },
- { "adoucisseur.shop", true },
- { "adpkdsim.org", true },
- { "adquisitio.co.uk", true },
- { "adquisitio.es", true },
- { "adquisitio.fr", true },
- { "adquisitio.it", true },
- { "adr.gov", true },
- { "adra.com", true },
- { "adrafinil.wiki", true },
- { "adrenalin.od.ua", true },
- { "adrenalin.travel", true },
- { "adrian.web.id", true },
- { "adrianbechtold.de", true },
- { "adriancitu.com", true },
- { "adriancostin.ro", true },
- { "adrianmejias.com", true },
- { "adrianobarbosa.xyz", true },
- { "adriatrans.ga", true },
- { "adrienjacquierbret.com", true },
- { "adrienkohlbecker.com", true },
- { "adriennesmiles.com", true },
- { "adrup.com", true },
- { "adsamcik.com", true },
- { "adsbouncycastles.co.uk", true },
- { "adsbtc.org", true },
- { "adsl2meg.fr", true },
- { "adsviews.gq", true },
- { "adswoo.com", true },
- { "adtelligent.com", true },
- { "adtgroup.com", true },
- { "adultwebcams1.com", true },
- { "adurra.com", true },
- { "aduvi.de", true },
- { "adv-f1.ru", true },
- { "adv.cr", true },
- { "advaith.fun", true },
- { "advaithbot.com", true },
- { "advance.hr", true },
- { "advanced-fleet-services.com", true },
- { "advanced-scribes.com", true },
- { "advanced.info", false },
- { "advanceddieselspokane.com", true },
- { "advancedelectricalservicesqld.com.au", true },
- { "advancedendoscopycenter.net", true },
- { "advancedoneroofing.com", true },
- { "advancedprotectionkey.com", true },
- { "advancedprotectionsecuritykey.com", true },
- { "advancedsurgicalconsultantsllc.com", true },
- { "advancedurologyswla.com", true },
- { "advancedwriters.com", true },
- { "advanceworx.com", true },
- { "advancis.net", true },
- { "advantagehomeexteriors.com", true },
- { "advantagemechanicalinc.com", true },
- { "advantis.tk", true },
- { "advara.com", true },
- { "advenacs.com", true },
- { "advenacs.com.au", true },
- { "advens.com", true },
- { "advens.fr", true },
- { "advento.bg", true },
- { "adventry.tk", true },
- { "adventure-inn.com", true },
- { "adventurecreators.com", true },
- { "adventuredrives.com", false },
- { "adventureforest.co.nz", true },
- { "adventureforest.nz", true },
- { "adventuregamers.com", true },
- { "adventurenow.nl", true },
- { "adventureswithlillie.ca", true },
- { "adventurousway.com", true },
- { "advertis.biz", true },
- { "advocate-europe.eu", true },
- { "advocoeurdehaan.nl", true },
- { "advogatech.com.br", true },
- { "advokat-malinovskii.ml", true },
- { "advokat-romanov.com", true },
- { "advokaty-yuristy.tk", true },
- { "advtran.com", true },
- { "adware.pl", false },
- { "adwokatkosterka.pl", true },
- { "adwokatzdunek.pl", true },
- { "adxperience.com", true },
- { "adzuna.at", true },
- { "adzuna.ca", true },
- { "adzuna.co.nz", true },
- { "adzuna.co.za", true },
- { "adzuna.com", true },
- { "adzuna.com.au", true },
- { "adzuna.com.br", true },
- { "adzuna.de", true },
- { "adzuna.fr", true },
- { "adzuna.in", true },
- { "adzuna.it", true },
- { "adzuna.nl", true },
- { "adzuna.pl", true },
- { "adzuna.ru", true },
- { "adzuna.sg", true },
- { "ae-construction.co.uk", true },
- { "ae-dir.com", true },
- { "ae-dir.org", true },
- { "ae86.dog", true },
- { "ae86.plus", true },
- { "ae86b.com", true },
- { "ae86c.com", true },
- { "ae86dj.com", true },
- { "ae86nb.com", true },
- { "aebian.org", true },
- { "aecexpert.fr", true },
- { "aecis.org", true },
- { "aedollon.com", true },
- { "aefcleaning.com", true },
- { "aegis.moe", true },
- { "aegisalarm.co.uk", true },
- { "aegisalarm.com", true },
- { "aegisalarms.co.uk", true },
- { "aegisalarms.com", true },
- { "aegrel.ee", true },
- { "aeh5134.cc", true },
- { "aehe.us", true },
- { "aei.co.uk", true },
- { "aeksistem.com", true },
- { "aelurus.com", true },
- { "aenterprise.info", true },
- { "aeon.co", true },
- { "aeonct.org", true },
- { "aeradesign.com", true },
- { "aerandir.fr", true },
- { "aergia.eu", true },
- { "aerisnetwork.com", true },
- { "aerlux.md", true },
- { "aero-pioneer.com", true },
- { "aero.parts", true },
- { "aeroacademia.com.mx", true },
- { "aeroalbrook.com", true },
- { "aerobasegroup.com", true },
- { "aerobotz.com", true },
- { "aeronautix.com", true },
- { "aeronote.net", true },
- { "aeropole.de", true },
- { "aeropole.eu", true },
- { "aerorecords.net", true },
- { "aerosimexperience.com", true },
- { "aerospace-schools.com", true },
- { "aerotechcoatings.com", true },
- { "aertel.ie", true },
- { "aes-freundeskreis.de", true },
- { "aessencia.com.br", true },
- { "aestheticsplus.xyz", true },
- { "aesthetikpiercing.de", true },
- { "aesthetx.com", true },
- { "aeternus.tech", true },
- { "aetherc0r3.eu", true },
- { "aetherlink.de", true },
- { "aextron.com", true },
- { "aextron.de", true },
- { "aextron.org", true },
- { "afashion.com.au", true },
- { "afavre.io", true },
- { "afcompany.it", true },
- { "afcurgentcarelyndhurst.com", true },
- { "affaire.com", true },
- { "affairefacile.net", true },
- { "affarsnatverk.nu", true },
- { "affektblog.de", true },
- { "affichagepub3.com", true },
- { "affiliatefeatures.com", true },
- { "affiliates.trade", true },
- { "affiliatetest.azurewebsites.net", true },
- { "affilie.de", true },
- { "affinity.co", true },
- { "affinitysync.com", true },
- { "affissioni.roma.it", true },
- { "affittacamere.roma.it", true },
- { "affittialmare.it", true },
- { "affittisalento.it", true },
- { "affordableazdivorce.com", false },
- { "affordableenvironmental.net", true },
- { "affordablehealthquotesforyou.com", true },
- { "affordableinsurancenow.com", true },
- { "affordablemudjacking.com", true },
- { "affordablepapers.com", true },
- { "affordableracingparts.com.au", true },
- { "affpass.com", true },
- { "affping.com", true },
- { "afghan.dating", true },
- { "afgn.com.ua", true },
- { "afi-business-consulting.com", true },
- { "aficards.com", true },
- { "aficionados.com.br", true },
- { "afilio.de", true },
- { "afinadoronline.com.br", true },
- { "afinaudio.com", true },
- { "aflebedevo.tk", true },
- { "afmtevents.com", true },
- { "afp548.com", true },
- { "afree.ir", false },
- { "afri.cc", true },
- { "africa.dating", true },
- { "africalebanon.tk", true },
- { "africanhosting.ml", true },
- { "africanimpact.com", true },
- { "africantourer.com", true },
- { "afrikarl.de", true },
- { "afrikmag.com", true },
- { "afrodigital.uk", true },
- { "afs-asso.org", true },
- { "after.digital", true },
- { "afterdwi.info", true },
- { "afterhate.fr", true },
- { "afterpay.com", true },
- { "aftonpravdan.nu", true },
- { "afva.net", true },
- { "afwd.international", true },
- { "ag-2.net", true },
- { "ag-3.net", true },
- { "ag-33.net", true },
- { "ag-55.net", true },
- { "ag-777.com", true },
- { "ag0.app", true },
- { "ag0101g.com", true },
- { "ag0202a.com", true },
- { "ag0707a.com", true },
- { "ag1515a.com", true },
- { "ag1588.com", true },
- { "ag173168.com", true },
- { "ag18ks.com", true },
- { "ag2020a.com", true },
- { "ag2983.com", true },
- { "ag3131a.com", true },
- { "ag3232g.com", true },
- { "ag4141a.com", true },
- { "ag4848g.com", true },
- { "ag4949g.com", true },
- { "ag5688.com", true },
- { "ag58ks.com", true },
- { "ag600.com", true },
- { "ag6005.com", true },
- { "ag6016.com", true },
- { "ag6033.com", true },
- { "ag6037.com", true },
- { "ag6072.com", true },
- { "ag6086.com", true },
- { "ag6211.com", true },
- { "ag6215.com", true },
- { "ag6225.com", true },
- { "ag6262g.com", true },
- { "ag6306.com", true },
- { "ag660.com", true },
- { "ag66321.com", true },
- { "ag686.com", true },
- { "ag68ks.com", true },
- { "ag698.com", true },
- { "ag700.com", true },
- { "ag8-game.com", true },
- { "ag8.email", true },
- { "ag800.com", true },
- { "ag80808.com", true },
- { "ag80880.com", true },
- { "ag8181g.com", true },
- { "ag81826.com", true },
- { "ag81867.com", true },
- { "ag855.net", true },
- { "ag87777.com", true },
- { "ag878.com", true },
- { "ag88-guide.com", true },
- { "ag880.com", true },
- { "ag88001.com", true },
- { "ag88008.com", true },
- { "ag88018.com", true },
- { "ag88028.com", true },
- { "ag88056.com", true },
- { "ag88058.com", true },
- { "ag88068.com", true },
- { "ag8808.com", true },
- { "ag88080.com", true },
- { "ag88081.com", true },
- { "ag88086.com", true },
- { "ag88089.com", true },
- { "ag88090.com", true },
- { "ag88094.com", true },
- { "ag88098.com", true },
- { "ag88110.com", true },
- { "ag88158.com", true },
- { "ag8819-livechat.com", true },
- { "ag88220.com", true },
- { "ag8829.com", true },
- { "ag88309.com", true },
- { "ag8850.com", true },
- { "ag88518.com", true },
- { "ag88550.com", true },
- { "ag8856.com", true },
- { "ag8859.com", true },
- { "ag88618.com", true },
- { "ag887.com", true },
- { "ag8876.com", true },
- { "ag88777.com", true },
- { "ag88777.net", true },
- { "ag8879.com", true },
- { "ag88798.com", true },
- { "ag88799.com", true },
- { "ag888.ag", true },
- { "ag88801.com", true },
- { "ag88818.com", true },
- { "ag888818.com", true },
- { "ag889.com", true },
- { "ag8890.com", true },
- { "ag88905.com", true },
- { "ag88906.com", true },
- { "ag88910.com", true },
- { "ag88988.com", true },
- { "ag88dc22.com", true },
- { "ag88ks.com", true },
- { "ag89000.com", true },
- { "ag89ks.com", true },
- { "ag918.ag", true },
- { "ag978.com", true },
- { "ag98ks.com", true },
- { "ag998.com", true },
- { "ag9ks.com", true },
- { "agaa35.com", true },
- { "agaa41.com", true },
- { "agalliasis.ch", false },
- { "agamsecurity.ch", false },
- { "agatajanik.de", true },
- { "agate.pw", true },
- { "agaveandpine.com", true },
- { "agechecker.net", true },
- { "agefriendlyri.org", true },
- { "ageg.ca", true },
- { "agemfis.com", true },
- { "agence-wazacom.fr", true },
- { "agences-cegee.fr", true },
- { "agencia.barcelona", true },
- { "agencia.cat", true },
- { "agencia.pro", true },
- { "agenciabonobo.com", true },
- { "agenciacorujadesign.com.br", true },
- { "agenciadeempregosdourados.com.br", true },
- { "agenciamseo.com.br", true },
- { "agencyalacarte.com", true },
- { "agencyinmotion.com", true },
- { "agencytsunami.com", true },
- { "agenda-loto.net", false },
- { "agenda21senden.de", true },
- { "agendaspectacles.fr", true },
- { "agendatelefonica.com.br", false },
- { "agent-grow.com", true },
- { "agentprocessing.com", true },
- { "agentrisk.com", true },
- { "agentur-pottkinder.de", true },
- { "agenux.org", true },
- { "agenziaimmobiliarezeta.it", true },
- { "agfmedia.com", true },
- { "agh6p.com", true },
- { "aghayeva-edler.de", true },
- { "agiapelagia.com", true },
- { "agibank.com.br", true },
- { "agic-geneve.ch", true },
- { "agilebits.com", true },
- { "agilecraft.com", true },
- { "agilesurvey.ch", true },
- { "agileui.com", true },
- { "agiley.se", true },
- { "agilicus.ca", true },
- { "agilicus.com", true },
- { "agilizing.us", true },
- { "agilob.net", true },
- { "aging.gov", true },
- { "agingstats.gov", true },
- { "aginion.net", true },
- { "agks0.com", true },
- { "agks006.com", true },
- { "agks008.com", true },
- { "agks02.com", true },
- { "agks06.com", true },
- { "agks08.com", true },
- { "agks1.com", true },
- { "agks11.com", true },
- { "agks111.com", true },
- { "agks113.com", true },
- { "agks12.com", true },
- { "agks13.com", true },
- { "agks133.com", true },
- { "agks136.com", true },
- { "agks138.com", true },
- { "agks150.com", true },
- { "agks168.com", true },
- { "agks18.com", true },
- { "agks188.com", true },
- { "agks19.com", true },
- { "agks2.com", true },
- { "agks3.com", true },
- { "agks4.com", true },
- { "agks666.com", true },
- { "agks68.com", true },
- { "agks8.com", true },
- { "agks88.com", true },
- { "agks89.com", true },
- { "agks9.com", true },
- { "agks96.com", true },
- { "agks98.com", true },
- { "agks988.com", true },
- { "agks99.com", true },
- { "agks998.com", true },
- { "agktest1.ga", true },
- { "aglc6.com", true },
- { "aglc8.com", true },
- { "aglc88.com", true },
- { "aglh.com", true },
- { "agliamici.it", true },
- { "aglucky.com", true },
- { "agm2525.com", true },
- { "agm4545.com", true },
- { "agm8383.com", true },
- { "agnesk.blog", true },
- { "agonswim.com", true },
- { "agoodmind.com", true },
- { "agoravox.fr", true },
- { "agoravox.it", true },
- { "agoravox.tv", true },
- { "agouraelectrical.com", true },
- { "agouraelectrician.com", true },
- { "agouraexteriorlighting.com", true },
- { "agourahillselectric.com", true },
- { "agourahillselectrical.com", true },
- { "agourahillselectrician.com", true },
- { "agourahillsexteriorlighting.com", true },
- { "agourahillslandscapelighting.com", true },
- { "agourahillslighting.com", true },
- { "agourahillsoutdoorlighting.com", true },
- { "agouralandscapelighting.com", true },
- { "agouralighting.com", true },
- { "agouraoutdoorlighting.com", true },
- { "agowa338.de", true },
- { "agpideas.com", true },
- { "agpsn.com", true },
- { "agr.asia", true },
- { "agrarking.com", true },
- { "agrarking.de", true },
- { "agrarshop4u.de", true },
- { "agrekov.ru", true },
- { "agrichamber.com.ua", true },
- { "agricolo.ch", true },
- { "agriculture-schools.com", true },
- { "agridir.site", true },
- { "agrios.de", true },
- { "agriquads.nl", true },
- { "agroconsultoraplus.com", true },
- { "agrodronechile.cl", true },
- { "agroline.by", true },
- { "agromotorsburzaco.com", true },
- { "agroplas.cf", true },
- { "agroxxi.ru", false },
- { "agroyard.com.ua", true },
- { "agsb.ch", false },
- { "agscinemas.com", true },
- { "agscinemasapp.com", true },
- { "agslot.com", true },
- { "agslot.net", true },
- { "agslot777.com", true },
- { "aguarani.com.br", true },
- { "aguijara.com", true },
- { "agung-furniture.com", true },
- { "agvip168.com", true },
- { "agvip88.com", true },
- { "agvip8800.com", true },
- { "agwa.name", true },
- { "agwin1.com", true },
- { "agwin2.com", true },
- { "agwin7.com", true },
- { "agwin777.com", true },
- { "agwin8.com", true },
- { "agwin9.com", true },
- { "agworkers.com", true },
- { "agy.cl", true },
- { "agyacht.club", true },
- { "ahawkesrealtors.com", true },
- { "ahd.com", false },
- { "ahegao.ca", true },
- { "ahj.no", true },
- { "ahkubiak.ovh", false },
- { "ahlaejaba.com", true },
- { "ahlz.sk", true },
- { "ahmad.works", true },
- { "ahmedabadflowermall.com", true },
- { "ahmedcharles.com", true },
- { "ahmerjamilkhan.org", true },
- { "ahmetozer.org", true },
- { "ahollamby.com", true },
- { "ahosi.com", true },
- { "ahoy.travel", true },
- { "ahoyconference.com", true },
- { "ahsyg.com", true },
- { "ahtuxpk.ru", true },
- { "ahu.la", true },
- { "ahughes03.com", true },
- { "ahxxm.com", false },
- { "ai-cuisine.fr", true },
- { "ai-english.jp", true },
- { "ai-media.tv", true },
- { "ai-soft.co.jp", true },
- { "ai.gov", true },
- { "aianipid.ee", true },
- { "aiasesoriainmobiliaria.com", true },
- { "aiat.net", true },
- { "aibenzi.com", true },
- { "aid-web.ch", true },
- { "aidanapple.com", true },
- { "aidanmitchell.co.uk", true },
- { "aidanmitchell.uk", true },
- { "aidanmontare.net", true },
- { "aidanpr.com", true },
- { "aidanpr.net", true },
- { "aidarikako.com", true },
- { "aiden.link", false },
- { "aidi-ahmi.com", true },
- { "aidmycomputer.com", true },
- { "aids.gov", true },
- { "aie.de", true },
- { "aievaluare.ro", true },
- { "aifriccampbell.com", true },
- { "aigcev.org", true },
- { "aigenpul.se", true },
- { "aigner-club.com", true },
- { "aigner-club.de", true },
- { "aignerimage.de", true },
- { "aignermunich.com", true },
- { "aignermunich.de", true },
- { "aignermunich.jp", true },
- { "aiho.stream", true },
- { "aiinsurance.io", true },
- { "aiinsurance.xyz", true },
- { "aijsk.com", true },
- { "aikenpromotions.com", true },
- { "aiki.de", true },
- { "aiki.do", true },
- { "aikido-club-limburg.de", true },
- { "aikido-kiel.de", true },
- { "aikido-linz.at", true },
- { "aikido-wels.at", true },
- { "ailitonia.com", true },
- { "ailitonia.xyz", true },
- { "aimare-web.tk", true },
- { "aimax.com", true },
- { "aimeeandalec.com", true },
- { "aimgroup.co.tz", true },
- { "aimi-salon.com", true },
- { "aimiastestseries.com", true },
- { "aimotive.com", true },
- { "aimstoreglobal.com", true },
- { "ainfographie.com", true },
- { "aintevenmad.ch", true },
- { "ainvest.de", true },
- { "ainzu.net", true },
- { "aiois.com", true },
- { "aipbarcelona.com", true },
- { "air-craftglass.com", true },
- { "air-shots.ch", false },
- { "air-techniques.fr", true },
- { "air-we-go.co.uk", true },
- { "airanyumi.net", true },
- { "airbnb.ae", true },
- { "airbnb.at", true },
- { "airbnb.be", true },
- { "airbnb.biz", true },
- { "airbnb.ca", true },
- { "airbnb.cat", true },
- { "airbnb.ch", true },
- { "airbnb.cl", true },
- { "airbnb.cn", true },
- { "airbnb.co.cr", true },
- { "airbnb.co.id", true },
- { "airbnb.co.il", true },
- { "airbnb.co.in", true },
- { "airbnb.co.kr", true },
- { "airbnb.co.nz", true },
- { "airbnb.co.uk", true },
- { "airbnb.co.ve", true },
- { "airbnb.com", true },
- { "airbnb.com.ar", true },
- { "airbnb.com.au", true },
- { "airbnb.com.bo", true },
- { "airbnb.com.br", true },
- { "airbnb.com.bz", true },
- { "airbnb.com.cn", true },
- { "airbnb.com.co", true },
- { "airbnb.com.ec", true },
- { "airbnb.com.gt", true },
- { "airbnb.com.hk", true },
- { "airbnb.com.hn", true },
- { "airbnb.com.hr", true },
- { "airbnb.com.kh", true },
- { "airbnb.com.mt", true },
- { "airbnb.com.my", true },
- { "airbnb.com.ni", true },
- { "airbnb.com.pa", true },
- { "airbnb.com.pe", true },
- { "airbnb.com.ph", true },
- { "airbnb.com.py", true },
- { "airbnb.com.sg", true },
- { "airbnb.com.sv", true },
- { "airbnb.com.tr", true },
- { "airbnb.com.tw", true },
- { "airbnb.com.ua", true },
- { "airbnb.com.vn", true },
- { "airbnb.cz", true },
- { "airbnb.de", true },
- { "airbnb.dk", true },
- { "airbnb.es", true },
- { "airbnb.fi", true },
- { "airbnb.fr", true },
- { "airbnb.gr", true },
- { "airbnb.gy", true },
- { "airbnb.hu", true },
- { "airbnb.ie", true },
- { "airbnb.is", true },
- { "airbnb.it", true },
- { "airbnb.jp", true },
- { "airbnb.la", true },
- { "airbnb.lu", true },
- { "airbnb.mx", true },
- { "airbnb.nl", true },
- { "airbnb.no", true },
- { "airbnb.pl", true },
- { "airbnb.pt", true },
- { "airbnb.ru", true },
- { "airbnb.se", true },
- { "airbnb.tools", true },
- { "airbnbchina.cn", true },
- { "airbnbopen.com", true },
- { "airborne-inflatables.co.uk", true },
- { "airbossofamerica.com", true },
- { "aircomms.com", true },
- { "airconditioning-sandton.co.za", true },
- { "airconrandburg.co.za", true },
- { "airconsalberton.co.za", true },
- { "airconsfourways.co.za", true },
- { "airconsmidrand.co.za", true },
- { "airductclean.com", false },
- { "airductcleaninggrandprairie.com", true },
- { "airductcleaningirving.com", true },
- { "airdur.eu", true },
- { "aireaseleaks.org", true },
- { "airetvie.com", true },
- { "airfax.io", true },
- { "airhart.me", true },
- { "airhelp.com", true },
- { "airhorn.de", true },
- { "airicy.com", true },
- { "airikai.com", true },
- { "airlibre-parachutisme.com", true },
- { "airmail.cc", false },
- { "airmash.online", true },
- { "airmaxinflatables.com", true },
- { "airnow.gov", true },
- { "airpbx.com", true },
- { "airplay-inflatable-hire.co.uk", true },
- { "airplayradio.nl", true },
- { "airport-charlotte.com", true },
- { "airportal.cn", true },
- { "airrestoration.ch", true },
- { "airship.com", true },
- { "airslate.com", true },
- { "airsnore.com", true },
- { "airsoft.ch", true },
- { "airswap.io", true },
- { "airtable.com", true },
- { "airtec-france.fr", true },
- { "airtimerewards.co.uk", false },
- { "airtoolaccessoryo.com", true },
- { "airvpn.org", true },
- { "airvuz.com", true },
- { "airwaystorage.net", true },
- { "airweb.top", true },
- { "airwolf.tk", true },
- { "airwolfthemes.com", true },
- { "airwrenchei.com", true },
- { "airy.host", true },
- { "ais.fashion", true },
- { "aisance-co.com", true },
- { "aisi316l.net", true },
- { "aistockcharts.com", true },
- { "aistrope.com", true },
- { "ait.com.ar", true },
- { "aiticon.com", true },
- { "aitosoftware.com", true },
- { "aitrust.ro", true },
- { "aiutodomestico.ch", false },
- { "aiva.ai", true },
- { "aivan.ai", true },
- { "aivd.lol", true },
- { "aiwosq.cn", true },
- { "aizxxs.com", true },
- { "aizxxs.net", true },
- { "aj-foster.com", true },
- { "ajarope.com", true },
- { "ajaxed.net", true },
- { "ajaxtime.tk", true },
- { "ajbenet.com", true },
- { "ajbouncycastles.co.uk", true },
- { "ajdiaz.me", true },
- { "ajeventhire.co.uk", true },
- { "ajfite.com", true },
- { "ajgroup-me.com", false },
- { "ajhstamps.co.uk", true },
- { "ajiaojr.info", true },
- { "ajiaojr.io", true },
- { "ajiaojr.me", true },
- { "ajiaojr.net", true },
- { "ajiboye.com", true },
- { "ajl.io", true },
- { "ajnah.net", true },
- { "ajnasz.hu", true },
- { "ajs5.com", true },
- { "ajsb85.com", true },
- { "ajwebsolutions.com", true },
- { "ak-varazdin.hr", true },
- { "ak-webit.de", true },
- { "ak47-miyamoto.spdns.org", true },
- { "aka.ms", true },
- { "akachanikuji.com", true },
- { "akademeia.moe", true },
- { "akademie-frankfurt.de", true },
- { "akalashnikov.ru", true },
- { "akamon.ac.jp", true },
- { "akaoma.com", true },
- { "akasha.world", true },
- { "akashdsouza.now.sh", true },
- { "akdusekbudil.cz", true },
- { "akeenext.com", true },
- { "akeenshort.com", true },
- { "akerboom.family", true },
- { "akerboom.org", true },
- { "akfoundationindia.com", true },
- { "akhabar.tk", true },
- { "akhealthconnection.com", false },
- { "akhomesforyou.com", true },
- { "akihito.com", true },
- { "akijo.de", true },
- { "akinix.com", true },
- { "akiym.com", true },
- { "akj.io", true },
- { "akkade.be", true },
- { "akkbouncycastles.co.uk", true },
- { "akkeylab.com", true },
- { "akoofs.com", true },
- { "akostecki.de", true },
- { "akoww.de", false },
- { "akoya.fi", true },
- { "akplates.org", true },
- { "akr.io", true },
- { "akr.services", true },
- { "akrep.com", true },
- { "akropolis-ravensburg.de", true },
- { "aksehir.bel.tr", true },
- { "akselinurmio.fi", true },
- { "akshi.in", true },
- { "aktca.org", true },
- { "aktin.cz", true },
- { "aktin.sk", true },
- { "aktion-vielfalt.ch", true },
- { "aktiv-naturheilmittel.at", false },
- { "aktiv-naturheilmittel.ch", true },
- { "aktiv-naturheilmittel.de", true },
- { "aktivace.eu", true },
- { "aktive-arbeitslose.at", true },
- { "aktivierungscenter.de", true },
- { "akuislam.com", true },
- { "akukas.com", true },
- { "akutun.cl", true },
- { "akvorrat.at", true },
- { "al-f.net", true },
- { "al3366.tech", true },
- { "al3abmizo.com", true },
- { "al3xpro.com", true },
- { "alab.space", true },
- { "alabamaag.gov", true },
- { "alabamacoastalradiology.com", true },
- { "alabamadebtrelief.org", true },
- { "alaboard.com", true },
- { "alabordage.fr", true },
- { "alacriti.com", true },
- { "aladdin.ie", true },
- { "aladdinschools.appspot.com", true },
- { "aladintechnologies.tk", true },
- { "alainbaechlerphotography.ch", false },
- { "alainfrancois.eu", true },
- { "alainfrancois.nl", true },
- { "alainmargot.ch", false },
- { "alainodea.com", true },
- { "alainwolf.ch", true },
- { "alainwolf.net", true },
- { "alair.cn", false },
- { "alalivre.cf", true },
- { "alamo-analytics.com", true },
- { "alamowellnessalliance.com", true },
- { "alanberger.me.uk", true },
- { "aland.co.uk", true },
- { "alandoyle.com", true },
- { "alanhua.ng", true },
- { "alaninkenya.org", true },
- { "alantica.ga", true },
- { "alargarlavida.com", true },
- { "alarmat.pl", true },
- { "alarmcomplete.co.uk", true },
- { "alarna.de", true },
- { "alasdelalma.com.co", true },
- { "alaskabuylocal.org", true },
- { "alaskafishinglodges.net", true },
- { "alaskajewelry.com", true },
- { "alastairs-place.net", true },
- { "alatkesehatan.tk", true },
- { "alaxyjewellers.co.za", true },
- { "alb-flirt.de", true },
- { "albalatedelarzobispo.tk", true },
- { "albanesi.it", true },
- { "albareport.com", true },
- { "albatrosswear.com", true },
- { "albbounce.co.uk", true },
- { "alberoraydolap.com", true },
- { "albersdruck.de", true },
- { "albert-yu.com", true },
- { "albertathome.org", true },
- { "albertcuyp-markt.amsterdam", true },
- { "albertforfuture.de", true },
- { "albertinum-goettingen.de", true },
- { "alberts-blatt.de", true },
- { "albilaga.id", true },
- { "albion2.org", true },
- { "alboweb.nl", true },
- { "albstaedter-kids-cup.de", true },
- { "alca31.com", false },
- { "alcamilo.cloudns.cc", true },
- { "alcatelonetouch.us", true },
- { "alchemy-media-marketing.com", true },
- { "alchemy.gr", true },
- { "alchimic.ch", false },
- { "alco-united.com", true },
- { "alcobendas.tk", true },
- { "alcoholapi.com", true },
- { "alcolecapital.com", true },
- { "alcouponest.com", true },
- { "alcubillas.tk", true },
- { "aldiabcs.com", true },
- { "aldien.com.br", true },
- { "aldomedia.com", true },
- { "aldorr.net", false },
- { "aldous-huxley.com", true },
- { "alecpap.com", true },
- { "alecpapierniak.com", true },
- { "alecrust.com", true },
- { "aleftinka.tk", true },
- { "alejarod.com", true },
- { "alek.in", true },
- { "aleksib.fi", true },
- { "alela.fr", true },
- { "alentadoras.com", true },
- { "aleph.land", true },
- { "alerbon.net", true },
- { "alertboxx.com", true },
- { "alertonline.nl", true },
- { "alerts.sg", true },
- { "alertwire.com", true },
- { "alesia-formation.fr", true },
- { "alessandrobasi.it", true },
- { "alessandroonline.com.br", true },
- { "alessandrotravel.com", true },
- { "alessandroz.ddns.net", true },
- { "aletm.it", true },
- { "alevi.tk", true },
- { "alex-ross.co.uk", true },
- { "alex4386.us", true },
- { "alex97000.de", true },
- { "alexander-beck.eu", true },
- { "alexanderb.info", true },
- { "alexandercanton.com", true },
- { "alexanderneng.de", true },
- { "alexanderschimpf.de", true },
- { "alexandra-schulze.de", true },
- { "alexandrastorm.com", true },
- { "alexandre-blond.fr", true },
- { "alexandreguarita.com.br", true },
- { "alexbaker.org", true },
- { "alexberts.ch", true },
- { "alexbogovich.com", true },
- { "alexcoman.com", true },
- { "alexdaniel.org", true },
- { "alexey-shamara.ru", true },
- { "alexeykopytko.com", true },
- { "alexfabian.myftp.org", true },
- { "alexgaynor.net", true },
- { "alexgebhard.com", true },
- { "alexglover.co.uk", true },
- { "alexhalderman.com", true },
- { "alexhd.de", true },
- { "alexisabarca.com", true },
- { "alexiskoustoulidis.com", true },
- { "alexjett.com", true },
- { "alexlambertz.de", true },
- { "alexlouden.com", true },
- { "alexmerkel.com", true },
- { "alexmerkel.me", true },
- { "alexmerkel.xyz", true },
- { "alexn.org", true },
- { "alexpavel.com", true },
- { "alexpnixon.com", true },
- { "alexpotter.net", true },
- { "alexs.de", true },
- { "alexsandrasverden.cf", true },
- { "alexschroeder.ch", true },
- { "alexsergeyev.com", true },
- { "alexsexton.com", true },
- { "alextaffe.com", true },
- { "alextjam.es", true },
- { "alextsang.net", true },
- { "alexvetter.de", true },
- { "alexwardweb.com", true },
- { "alexyang.me", true },
- { "alfa-host.ml", true },
- { "alfa-tech.su", true },
- { "alfacharlie.co", true },
- { "alfaperfumes.com.br", true },
- { "alfaproweb.fr", true },
- { "alfavit.cf", true },
- { "alforto.nl", true },
- { "alfratehotelcampiglio.it", true },
- { "alfred-figge.de", true },
- { "alfredapp.com", true },
- { "alftrain.com", true },
- { "algeriepart.com", true },
- { "alghanimcatering.com", true },
- { "algoentremanos.com", true },
- { "algolia.com", true },
- { "alhost.ml", true },
- { "aliacraft.net", true },
- { "aliantsoft.pl", true },
- { "aliaswp.com", true },
- { "alibangash.com", true },
- { "alice-memorial.de", true },
- { "alice-noutore.com", true },
- { "alice-of-alice.top", true },
- { "alice.tw", true },
- { "alicemaywebdesign.com.au", true },
- { "alicestudio.it", true },
- { "alicetone.net", true },
- { "aliefirfany.com", true },
- { "alieke.design", true },
- { "alien6.com", true },
- { "alienation.biz", true },
- { "alienslab.net", true },
- { "alienstat.com", true },
- { "alighierirescaldina.it", true },
- { "alignrs.com", true },
- { "alijammusic.com", false },
- { "alikulov.me", true },
- { "alinasmusicstudio.com", true },
- { "alinbu.net", true },
- { "alineonline.tk", true },
- { "aliorange.com", true },
- { "alisondavenport.ga", true },
- { "alisonisrealestate.com", true },
- { "alisonlitchfield.com", true },
- { "alistairstowing.com", true },
- { "alitec.it", true },
- { "aliv.biz", true },
- { "alix-board.de", true },
- { "alize-theatre.ch", false },
- { "aliziolaw.com", true },
- { "aljaspod.ch", true },
- { "aljaspod.com", true },
- { "aljaspod.hu", true },
- { "aljaspod.net", true },
- { "aljaspod.org", true },
- { "aljoschairmer.de", true },
- { "aljweb.com", true },
- { "alkacoin.net", true },
- { "alkemi-si.fr", true },
- { "alko-centr.ru", true },
- { "alko-stop.ml", true },
- { "alkopedia.tk", true },
- { "alkor.tk", true },
- { "alkusin.net", true },
- { "all-connect.net", false },
- { "all-fashion-schools.com", true },
- { "all-markup-news.com", true },
- { "all-things.tk", true },
- { "all4hardware4u.de", true },
- { "all878.com", true },
- { "allaboutfunuk.com", true },
- { "allaboutgreg.net", true },
- { "allaboutreligions.tk", true },
- { "allaboutswing.co.uk", true },
- { "allaboutswing.com", true },
- { "allactioneventhire.co.uk", true },
- { "allamericanmuslim.com", true },
- { "allamericanprotection.net", true },
- { "allamericatrans.com", true },
- { "allangirvan.net", true },
- { "allanta.be", true },
- { "allarmi.roma.it", true },
- { "allbenjoy.de", true },
- { "allbestcbdoil.com", true },
- { "allbetgame.cn", true },
- { "allbetgaming.com", true },
- { "allbigdicks.com", true },
- { "allbounceandplay.co.uk", true },
- { "allbouncesurrey.co.uk", true },
- { "allbrandbrand.com", true },
- { "allbursaries.co.za", true },
- { "allbusiness.com", true },
- { "allcapa.org", true },
- { "allcarecorrectionalpharmacy.com", true },
- { "allcarepharmacy.com", true },
- { "allcarespecialty.pharmacy", true },
- { "allcinema.net", true },
- { "allcleaningservice.org", true },
- { "allcleanservices.ca", true },
- { "allcloud.com", true },
- { "allcountyins.com", true },
- { "allcovered.nl", true },
- { "allcoveredbyac.com", true },
- { "alldewall.de", true },
- { "alle-zonvakanties.nl", true },
- { "alle.bg", true },
- { "allemoz.com", true },
- { "allemoz.fr", true },
- { "allenscaravans.co.uk", true },
- { "allensun.org", true },
- { "allenwillis.ga", true },
- { "allerstorfer.at", true },
- { "alles-nur-ge.cloud", true },
- { "alleskomtgoed.org", true },
- { "allesrocknroll.de", true },
- { "allfaucet.ml", true },
- { "allfoodrecipes.ga", true },
- { "allforyou.at", true },
- { "allfundsconnect.com", true },
- { "allgaragefloors.com", true },
- { "allgosts.ru", true },
- { "allgovernmentjobs.in", true },
- { "allgreenturf.com.au", true },
- { "allhard.org", true },
- { "alliance-psychiatry.com", true },
- { "alliances-globalsolutions.com", false },
- { "alliedfrozenstorage.com", true },
- { "alliedpavers.com", true },
- { "allinagency.com", true },
- { "allincoin.shop", true },
- { "allindiacityguide.com", true },
- { "allinone-ranking150.com", true },
- { "allinsuranceinformation.com", true },
- { "allis.studio", true },
- { "allitcrm.sytes.net", true },
- { "alljamin.com", true },
- { "allladyboys.com", true },
- { "allmajestic.com", true },
- { "allmemy.com", false },
- { "allmousepads.com", true },
- { "allnoticebd.com", true },
- { "allnovosibirsk.tk", true },
- { "allns.fr", true },
- { "allo-credit.ch", false },
- { "allo-luxembourg.tk", true },
- { "allofthestops.com", true },
- { "allontanamentovolatili.it", true },
- { "allontanamentovolatili.milano.it", true },
- { "allopurinol300mg.ml", true },
- { "alloutsec.com", true },
- { "alloverthehill.com", true },
- { "allphaseclean.com", true },
- { "allplayer.tk", true },
- { "allpointsblog.com", true },
- { "allpointsheating.com", true },
- { "allproptonline.com", true },
- { "allpussynow.com", true },
- { "allrad-buck.de", true },
- { "allright.tk", true },
- { "allroundpvp.net", true },
- { "allroundtechnology.com", true },
- { "allroundtechnology.nl", true },
- { "allsaints.church", true },
- { "allsearch.io", true },
- { "allseasonswaterproofing.com", true },
- { "allsoulinc.com", true },
- { "allsoulmobile.com", true },
- { "allsoultech.com", true },
- { "allspinecare.com", true },
- { "allstakesupply.com.au", true },
- { "allstarautokiaparts.com", true },
- { "allstarcashforcars.com", true },
- { "allstarquilts.com", true },
- { "allsun.online", true },
- { "allsurpl.us", true },
- { "allsync.com", true },
- { "allsync.nl", true },
- { "allteach.co.uk", true },
- { "allterrainfence.com", true },
- { "allthecryptonews.com", true },
- { "alltherooms.com", true },
- { "alltherooms.es", true },
- { "allthethings.co.nz", true },
- { "allthings.me", true },
- { "allthingssquared.com", true },
- { "allthingswild.co.uk", true },
- { "alltubedownload.net", true },
- { "allurebikerental.com", true },
- { "allurescarves.com", true },
- { "alluvion.studio", true },
- { "allweatherlandscaping.net", true },
- { "almaatlantica.com", true },
- { "almamet.com", true },
- { "almanssur.com", true },
- { "almatinki.com", true },
- { "almavios.com", false },
- { "almayadeen.education", true },
- { "almeeraloyalty.com", true },
- { "almenrausch-pirkhof.de", true },
- { "almisnedrm.com", true },
- { "almorafestival.com", true },
- { "almostobjective.com", true },
- { "almusbahperfume.com", true },
- { "almut-zielonka.de", true },
- { "alodocuratelemensagem.com.br", true },
- { "aloesoluciones.com.ar", true },
- { "alohapartyevents.co.uk", true },
- { "alonas.cf", true },
- { "alonas.ga", true },
- { "alonas.gq", true },
- { "alonas.ml", true },
- { "alonas.tk", true },
- { "alonetone.com", true },
- { "alov.blog", true },
- { "alp.od.ua", true },
- { "alpca.org", true },
- { "alpencam.com", true },
- { "alpencams.com", true },
- { "alpencams.net", true },
- { "alpengreis.ch", true },
- { "alpertron.com.ar", true },
- { "alpes-deis-tools.com", true },
- { "alpha-ag.ru", true },
- { "alpha-assistant.com", true },
- { "alpha-bet.com.ua", true },
- { "alpha-force.net", false },
- { "alpha-premium.com", true },
- { "alpha.ch", true },
- { "alpha88uat.com", true },
- { "alphaantileak.net", true },
- { "alphabetsigns.com", true },
- { "alphabouncycastles.co.uk", true },
- { "alphachat.net", true },
- { "alphadefense.co.za", true },
- { "alphaetomega3d.fr", true },
- { "alphafiduciaryservices.ch", false },
- { "alphainflatablehire.com", true },
- { "alphanodes.com", true },
- { "alphapengu.in", true },
- { "alphaperfumes.com.br", true },
- { "alphapoker.ru", true },
- { "alpharail.se", true },
- { "alpharoofga.com", true },
- { "alpharotary.com", true },
- { "alphasall.com", true },
- { "alphasib.ru", true },
- { "alphassl.de", true },
- { "alphavote-avex.com", true },
- { "alphavote.com", true },
- { "alphera.nl", true },
- { "alphie.me", true },
- { "alphipneux.fr", true },
- { "alpine-holiday.de", true },
- { "alpinechaletrental.com", true },
- { "alpinehighlandrealty.com", true },
- { "alpineplumbingandrooter.com", true },
- { "alpinepubliclibrary.org", true },
- { "alpinestarmassage.com", true },
- { "alplogopedia.it", true },
- { "alpstarentaisetaxi.com", true },
- { "alpstarentaisetaxi.fr", true },
- { "alquds.edu", true },
- { "alquiaga.com", true },
- { "alre-outillage.fr", true },
- { "als-japan.com", true },
- { "alsops.cf", true },
- { "alstertouch.com", true },
- { "alstertouch.de", true },
- { "alt-three.com", true },
- { "alt.org", true },
- { "altair.fi", true },
- { "altairlyh.com", true },
- { "altapina.com", false },
- { "altaplana.be", true },
- { "altaynews.kz", true },
- { "altco.group", true },
- { "altedirect.com", true },
- { "alteiria.fr", true },
- { "alter-news.fr", true },
- { "alteraro.com", true },
- { "alteraro.org", true },
- { "alterbaum.net", true },
- { "alteria.xyz", true },
- { "alternador.com.br", true },
- { "alternative.bike", true },
- { "alternative.hosting", true },
- { "alternativebit.fr", true },
- { "alternativehosting.ca", true },
- { "alternativehosting.com", true },
- { "alternativeinternet.ca", true },
- { "alternativet.party", true },
- { "alternativetomeds.com", true },
- { "alternatiwa.tk", true },
- { "alterspalter.de", true },
- { "altertek.org", true },
- { "altes-sportamt.de", true },
- { "altesses.eu", true },
- { "altestore.com", true },
- { "altijdleroy.nl", true },
- { "altijdleroy.online", true },
- { "altisdev.com", true },
- { "altkremsmuensterer.at", true },
- { "altmaestrat.es", true },
- { "altmann-systems.de", true },
- { "altoa.cz", true },
- { "altonblom.com", true },
- { "altonkey.com", true },
- { "altopartners.com", true },
- { "altopia.com", true },
- { "altorise.com", true },
- { "altphotos.com", true },
- { "altrui.st", true },
- { "altsdigital.com", true },
- { "altstipendiaten.de", true },
- { "altunbas.info", true },
- { "altweaver.com", true },
- { "aluminium-express.ru", true },
- { "aluminium-giesserei.de", true },
- { "alumni-kusa.jp", true },
- { "alupferd.de", true },
- { "aluroof.eu", true },
- { "alushta-vostorg.tk", true },
- { "alvcs.com", true },
- { "alvicom.hu", true },
- { "alvosec.com", true },
- { "alwayshowher.tk", true },
- { "alwayslookingyourbest.com", true },
- { "alwaysmine.fi", true },
- { "alwayswanderlust.com", true },
- { "alxlegal.com", true },
- { "alxu.ca", true },
- { "alxyjc.net", true },
- { "alyanak.ca", true },
- { "alyoung.com", true },
- { "alza.at", true },
- { "alza.co.uk", true },
- { "alza.cz", true },
- { "alza.de", true },
- { "alza.hu", true },
- { "alza.sk", true },
- { "alzashop.com", true },
- { "am-dd.com", true },
- { "am-executive-consulting.com", true },
- { "am156.com", true },
- { "am22i6xaf1m2a5m9k.xyz", true },
- { "am2s.fr", true },
- { "am5188.com", true },
- { "am6118.com", true },
- { "am615.am", true },
- { "am8.com", true },
- { "am8136.com", true },
- { "am88.ag", true },
- { "am9d104.com", true },
- { "ama.ne.jp", true },
- { "amaderelectronics.com", true },
- { "amadoraslindas.com", true },
- { "amagdic.com", true },
- { "amagical.net", false },
- { "amaiz.com", true },
- { "amal2019.com", true },
- { "amalfilapiazzetta.it", true },
- { "amalfipositanoboatrental.com", true },
- { "amalfirock.it", true },
- { "amalfitabula.it", true },
- { "amanatrustbooks.org.uk", true },
- { "amandadamsphotography.com", true },
- { "amandahamilton.tk", true },
- { "amandasage.ca", true },
- { "amandaworldstudies.com", true },
- { "amani-kinderdorf.de", true },
- { "amaranthinewanderlust.com", true },
- { "amardham.org", true },
- { "amaresq.com", true },
- { "amartinz.at", true },
- { "amateri.com", true },
- { "amateurpornhours.com", true },
- { "amateurradionotes.com", true },
- { "amateurvoicetalent.com", true },
- { "amati.solutions", true },
- { "amato.tk", true },
- { "amatsuka.com", true },
- { "amauf.de", true },
- { "amautorepairwa.com", true },
- { "amazetimberfurniture.com.au", true },
- { "amazili-communication.com", true },
- { "amazing-castles.co.uk", true },
- { "amazingraymond.com", true },
- { "amazingraymond.com.au", true },
- { "amb.tf", true },
- { "ambacoin.io", true },
- { "ambassify.com", true },
- { "ambassify.eu", true },
- { "amberalert.gov", true },
- { "amberglowleisure.co.uk", true },
- { "amberlightleisure.com", true },
- { "amberoad.tk", true },
- { "ambholding-usedcars.be", false },
- { "ambiente.one", true },
- { "ambiq.nl", true },
- { "ambulanza.roma.it", true },
- { "ambulari.cz", true },
- { "amcangroup.com", true },
- { "amcfirst.com", true },
- { "amchainitiative.org", true },
- { "amcs.website", true },
- { "amdm.ru", true },
- { "amdouglas.com", true },
- { "amechancez.work", true },
- { "ameego.com", true },
- { "ameego.it", true },
- { "ameego.net", true },
- { "ameego.nl", true },
- { "ameego.org", true },
- { "amees.me", false },
- { "ameliemarieintokyo.com", true },
- { "amello.de", true },
- { "amendine.fr", true },
- { "america.gov", true },
- { "americafamilylawcenter.org", true },
- { "american-school-search.com", true },
- { "american.dating", true },
- { "americandetour.com", true },
- { "americanfoundationbr.com", true },
- { "americanindiannursing.com", true },
- { "americanmediainstitute.com", true },
- { "americans.cam", true },
- { "americansforcommunitydevelopment.org", true },
- { "americanunicornparty.tk", true },
- { "americanwater.lk", true },
- { "americasbasementcontractor.com", true },
- { "americasdirector.com", true },
- { "americkykongres.cz", true },
- { "americorps.gov", true },
- { "ameriikanpoijat.org", true },
- { "amerika-forum.de", true },
- { "amerimex.cc", true },
- { "amerion.nl", true },
- { "amesgen.de", true },
- { "amethystbodyart.com", true },
- { "amethystdevelopment.co.uk", true },
- { "amf.to", true },
- { "amforst-ha.ddns.net", true },
- { "amforst.ddns.net", true },
- { "amg-microwave.com", true },
- { "amh-entertainments.co.uk", true },
- { "ami-de-bastanes.fr", true },
- { "amianto.roma.it", true },
- { "amica-travel.com", true },
- { "amica.it", true },
- { "amicalecanyon.ch", false },
- { "amiciperlatesta.it", true },
- { "amifoundation.net", true },
- { "amigucrochet.com", true },
- { "amikootours.com", true },
- { "amineptine.com", true },
- { "amionvpn.com", true },
- { "amir-heinisch.de", true },
- { "amirasyraf.com", true },
- { "amirautos.com", false },
- { "amirmahdy.com", true },
- { "amisderodin.fr", true },
- { "amitabhsirkiclasses.org.in", true },
- { "amitpatra.com", true },
- { "amj74-informatique.fr", true },
- { "amleather.pl", true },
- { "amm6e.com", true },
- { "ammanagingdirectors.com", true },
- { "amministratore.biz", true },
- { "amministratore.roma.it", true },
- { "amministratorecondominio.roma.it", true },
- { "amnesty-bf.org", true },
- { "amnesty.org.au", true },
- { "amnesy.fr", true },
- { "amobileway.co.uk", true },
- { "amokinio.com", true },
- { "amoozesh98.com", true },
- { "amoozesh98.ir", true },
- { "amorgos-aegialis.com", true },
- { "amorim.ca", true },
- { "amoxil.cf", true },
- { "amperaa.net", true },
- { "ampersandnbspsemicolon.com", true },
- { "ampgroep.nl", true },
- { "amphetamines.org", true },
- { "amphost.tk", true },
- { "amplead.com", true },
- { "ampleroads.com", true },
- { "ampproject.com", true },
- { "ampproject.org", true },
- { "amputated.tk", true },
- { "amrcaustin.com", true },
- { "amrcla.com", true },
- { "amrff.com", true },
- { "amruta.org", true },
- { "ams-web-qa.azurewebsites.net", true },
- { "ams.co.rs", true },
- { "amsel305nc.ddnss.de", true },
- { "amsfoodhk.com", true },
- { "amstelveentje.nl", true },
- { "amsterdamian.com", true },
- { "amt-taxfrance.com", true },
- { "amtsinfo.in", true },
- { "amuq.net", true },
- { "amuraimpianti.it", true },
- { "amusa.cl", true },
- { "amvip9.com", true },
- { "amxpj888.com", false },
- { "amyfoundhermann.com", true },
- { "amymabel.com", true },
- { "amyria.jp", true },
- { "amyyeung.com", true },
- { "amzn.rocks", true },
- { "an-alles-gedacht.de", true },
- { "an7hrax.se", true },
- { "anabolic.co", false },
- { "anabolickdieta.ga", true },
- { "anabolics.tk", true },
- { "anacreon.de", true },
- { "anadiyogacentre.com", true },
- { "anageorgia.com", true },
- { "anagramma.tk", true },
- { "anaiscoachpersonal.es", true },
- { "anaisfae.art", true },
- { "anakin.ca", true },
- { "analgesia.net", true },
- { "analisi-logica.it", true },
- { "analisilaica.it", true },
- { "analogist.net", true },
- { "analteengirls.net", true },
- { "analytics-shop.com", true },
- { "analyticsinmotion.com", true },
- { "analyticum.at", true },
- { "analyticum.com", true },
- { "analyticum.de", true },
- { "analyticum.eu", true },
- { "analyticum.net", true },
- { "anandchowdhary.com", true },
- { "ananke.io", true },
- { "anankecosmetics.com", true },
- { "anantshri.info", true },
- { "ananyoo.com", true },
- { "anarchistischegroepnijmegen.nl", false },
- { "anarcho-copy.org", true },
- { "anarhija.tk", true },
- { "anarkhe.net", true },
- { "anasahr.be", true },
- { "anastasia-shamara.ru", true },
- { "anatoray.com", true },
- { "anblik.com", true },
- { "ance.lv", false },
- { "ancestramil.fr", true },
- { "anchev.net", true },
- { "anchorit.gov", true },
- { "anchovy.nz", false },
- { "anciennes-automobiles.fr", true },
- { "anciens.org", true },
- { "ancientnorth.com", true },
- { "ancientnorth.nl", true },
- { "ancolies-andre.com", false },
- { "anconaswine.com", true },
- { "and-stuff.nl", true },
- { "and.com", true },
- { "andalusierondreizen.nl", true },
- { "andariegocusco.com", true },
- { "andarpersassi.it", true },
- { "andel.info", false },
- { "anders.hamburg", true },
- { "andersonpowerservices.com", true },
- { "andersonshatch.com", true },
- { "andesnevadotours.com", true },
- { "andicui.xyz", true },
- { "andiplusben.com", true },
- { "anditi.com", true },
- { "andre-lategan.com", true },
- { "andre-otto.com", true },
- { "andrea-kiaora.de", true },
- { "andrea-m.me", true },
- { "andrea-wirthensohn.at", false },
- { "andreaassenti.it", true },
- { "andreaboero.it", true },
- { "andreadraghetti.it", true },
- { "andreagobetti.com", true },
- { "andreagourmet.it", true },
- { "andreahruby.it", true },
- { "andreamcnett.com", true },
- { "andreas-kluge.eu", true },
- { "andreaseracleous.com", true },
- { "andreasfeusi.ch", true },
- { "andreasjanker.de", true },
- { "andreaskrasa.com", true },
- { "andreaslicht.nl", true },
- { "andreasolsson.se", true },
- { "andree.cloud", true },
- { "andrehansen.de", true },
- { "andrei-nakov.org", true },
- { "andreina-atencio.com", true },
- { "andrelauzier.com", true },
- { "andreoliveira.io", true },
- { "andrespaz.com", true },
- { "andresrios.nl", true },
- { "andreundnina.de", true },
- { "andrew.fi", true },
- { "andrew.london", true },
- { "andrewbdesign.com", false },
- { "andrewbennett.ltd", true },
- { "andrewdaws.io", true },
- { "andrewensley.com", true },
- { "andrewimeson.com", true },
- { "andrewin.ru", true },
- { "andrewisidoro.co.uk", true },
- { "andrewjphotography.com", true },
- { "andrewlarson.org", true },
- { "andrewmichaud.com", true },
- { "andrewmichaud.me", true },
- { "andrewpeng.net", true },
- { "andrewprokos.com", true },
- { "andrewpucci.com", true },
- { "andrewrgoss.com", true },
- { "andrewryno.com", true },
- { "andrewsun.com", true },
- { "andrewtasso.com", true },
- { "andrewtchin.com", true },
- { "andrewx.net", true },
- { "andrey1p.ru", true },
- { "andreyjuravlev.ga", true },
- { "andreypopp.com", true },
- { "andreysmirnov.tk", true },
- { "andrianova.ml", true },
- { "andrija-i-andjelka.com", true },
- { "andrisilberschmidt.ch", true },
- { "andro2id.com", true },
- { "andro4all.com", true },
- { "android-tv.3utilities.com", true },
- { "android.re", true },
- { "androide.com", true },
- { "androidhry.cz", true },
- { "androidkatalog.cz", true },
- { "androidnovinky.cz", true },
- { "androidservicetool.com", true },
- { "androidsis.com", true },
- { "androidtamer.com", true },
- { "androidtelefony.cz", true },
- { "androidzone.me", true },
- { "andromeda.se", true },
- { "andromedacenter.com", true },
- { "androtech.xyz", true },
- { "androticsdirect.com", true },
- { "andruvision.cz", true },
- { "andsat.org", true },
- { "andschwa.com", false },
- { "anduril.de", true },
- { "anduril.eu", true },
- { "andybrett.com", true },
- { "andyc.cc", true },
- { "andycraftz.eu", true },
- { "andycrockett.io", true },
- { "andysroom.dynu.net", true },
- { "andyt.eu", true },
- { "andzia.art.pl", true },
- { "anedot-sandbox.com", true },
- { "anedot.com", true },
- { "anedot.space", true },
- { "anedot.xyz", true },
- { "aneebahmed.com", true },
- { "anekdot-pr.tk", true },
- { "anepsa.com.mx", true },
- { "aneslix.com", false },
- { "anetaben.nl", true },
- { "anextraordinaryday.net", true },
- { "angehardy.com", true },
- { "angelcorpus.tk", true },
- { "angelesydemonios.es", true },
- { "angeletakis.net", true },
- { "angelicare.co.uk", true },
- { "angelinahair.com", true },
- { "angeljmadrid.com", true },
- { "angelok.ru", true },
- { "angelremigene.com", false },
- { "angelspabeauty.co.uk", true },
- { "angepsychedelices.tk", true },
- { "angiejones.com", true },
- { "anginf.de", true },
- { "angkasa.net.id", true },
- { "anglersconservation.net", true },
- { "anglictina-sojcak.cz", true },
- { "anglictinasojcak.cz", true },
- { "anglingactive.co.uk", true },
- { "anglirl.eu.org", true },
- { "angora.freesite.host", true },
- { "angora.me", true },
- { "angrapa.ru", true },
- { "angrido.com", true },
- { "angristan.fr", true },
- { "angristan.xyz", true },
- { "angry.im", true },
- { "angrysnarl.com", true },
- { "angryteeth.net", true },
- { "angular-software.at", true },
- { "angularjs.org", false },
- { "angusmak.com", true },
- { "anhaffen.lu", true },
- { "anhqv.es", true },
- { "ani-man.de", true },
- { "anicam.fr", true },
- { "animaemundi.be", false },
- { "animal-liberation.com", true },
- { "animal-rights.com", true },
- { "animalconnect.org.za", true },
- { "animalistic.io", true },
- { "animalliberation.tk", true },
- { "animaltesting.fr", true },
- { "animalz.tk", true },
- { "anime-culture.com", true },
- { "anime-rg.com", true },
- { "anime-tip.com", true },
- { "anime.my", false },
- { "anime1.me", true },
- { "anime1.moe", true },
- { "anime1.pw", true },
- { "animeai.com", true },
- { "animebits.moe", true },
- { "animeclub.in.ua", true },
- { "animedon.tk", true },
- { "animefever.tv", true },
- { "animefire.net", true },
- { "animefluxxx.com", true },
- { "animehf.com", true },
- { "animeinsights.net", true },
- { "animeone.me", true },
- { "animes-portal.info", true },
- { "animetriad.com", true },
- { "animojis.es", true },
- { "anipassion.com", false },
- { "anirvalle.com", true },
- { "anitaalbersen.nl", true },
- { "anitaxcph.dk", true },
- { "anivar.net", true },
- { "aniviasport.store", true },
- { "anjara.eu", true },
- { "anjocerdena.com", true },
- { "anjoola.com", true },
- { "ankane.org", true },
- { "ankaraevdenevenakliyat.name.tr", true },
- { "ankarakart.com.tr", true },
- { "ankaraotokiralama.tk", true },
- { "ankaraprofesyonelwebtasarim.com", true },
- { "ankaraseo.name.tr", true },
- { "ankarauzmanlarnakliyat.com", true },
- { "ankitha.in", true },
- { "ankitpati.in", true },
- { "ankiuser.net", true },
- { "ankiweb.net", true },
- { "ankwanoma.com", true },
- { "anleitung-deutsch-lernen.de", true },
- { "anleitung-zum-flechten.de", true },
- { "anleitung-zum-haekeln.de", true },
- { "anleitung-zum-schreiben.de", true },
- { "anleitung-zum-schweissen.de", true },
- { "anleitung-zum-toepfern.de", true },
- { "anna.info", true },
- { "annabelcinemas.com", true },
- { "annaenemma.nl", true },
- { "annafiore.com.br", true },
- { "annalitvinova.pro", true },
- { "annangela.moe", true },
- { "annarokina.com", true },
- { "annawagner.pl", true },
- { "annedaniels.co.uk", true },
- { "anneeden.de", true },
- { "annejan.com", true },
- { "anneliesonline.nl", true },
- { "annema.biz", true },
- { "annemakeslovelycandles.co.uk", true },
- { "annetta.com", true },
- { "annettewindlin.ch", true },
- { "annevankesteren.nl", true },
- { "anney-life.com", true },
- { "anniversary-cruise.com", true },
- { "annmariewaltsphotography.com", true },
- { "annonasoftware.com", true },
- { "annoyingasfuk.com", true },
- { "anns.eu", true },
- { "annuaire-auto-ecole.com", true },
- { "annuaire-jcb.com", true },
- { "annuaire-photographe.fr", false },
- { "annunciationbvmchurch.org", true },
- { "anodas.lt", true },
- { "anohana.org", true },
- { "anojan.com", true },
- { "anon-next.de", true },
- { "anonaddy.com", true },
- { "anonaddy.me", true },
- { "anoncom.net", true },
- { "anoncrypto.org", true },
- { "anoneko.com", true },
- { "anongoth.pl", true },
- { "anons.fr", false },
- { "anonser.tk", true },
- { "anonym-surfen.de", true },
- { "anonyme-spieler.at", true },
- { "anora.ai", true },
- { "anoracdn.net", true },
- { "anorak.tech", true },
- { "anotherfatgeek.net", true },
- { "anothervps.com", true },
- { "anouncer.ga", true },
- { "anowicki.pl", true },
- { "ans-delft.nl", true },
- { "ans-ge.ch", false },
- { "ansas.eu", true },
- { "ansas.net", true },
- { "ansdell.net", true },
- { "ansermet.net", false },
- { "ansgar-sonntag.de", true },
- { "ansgarsonntag.de", true },
- { "anshar.eu", true },
- { "ansibeast.net", true },
- { "ansichtssache.at", true },
- { "ansogning-sg.dk", true },
- { "anstaskforce.gov", true },
- { "antabuse.ga", true },
- { "antalyaescortyaren.tk", true },
- { "antama.eu", true },
- { "antama.nl", true },
- { "antanavagefarbiarz.com", true },
- { "antani.cloud", true },
- { "antarcti.co", true },
- { "antarees.net", true },
- { "antaresmedia.com.py", true },
- { "antarespc.com", true },
- { "antcas.com", false },
- { "antennajunkies.com", true },
- { "antennista.bari.it", true },
- { "antennista.catania.it", true },
- { "antennista.it", true },
- { "antennista.milano.it", true },
- { "antennista.pavia.it", true },
- { "antennista.roma.it", true },
- { "antennista.tv", true },
- { "antennistaroma.it", true },
- { "antennisti.milano.it", true },
- { "antennisti.roma.it", true },
- { "antfarm.cf", true },
- { "antfie.com", true },
- { "anthisis.tv", true },
- { "anthony.codes", true },
- { "anthonyellis.com", true },
- { "anthonyfontanez.com", true },
- { "anthonygaidot.fr", true },
- { "anthonyloop.com", true },
- { "anthonyvadala.me", true },
- { "anthropoid.ca", true },
- { "anti-bible.com", true },
- { "anti-nsa.tk", true },
- { "anti-radar.org", true },
- { "antiaz.com", true },
- { "anticopyright.com", true },
- { "antiekboerderijgraafland.nl", true },
- { "antifilter.network", true },
- { "antihistory.cf", true },
- { "antihype.space", true },
- { "antik-trodelmarkt.de", true },
- { "antikvarius.ro", true },
- { "antilaserpriority.com", true },
- { "antimine.me", true },
- { "antincendio.it", true },
- { "antincendio.roma.it", true },
- { "antipolygraph.org", true },
- { "antique-pedalcars.ch", true },
- { "antirepressionbayarea.com", true },
- { "antispamcloud.dk", true },
- { "antispeciesism.com", true },
- { "antispeciesist.com", true },
- { "antivirusprotection.reviews", true },
- { "antizon.net", true },
- { "antocom.com", true },
- { "antoinedeschenes.com", true },
- { "antoineelizabe.com", true },
- { "antoinemary.com", true },
- { "antonchen.com", true },
- { "antonimos.com.br", true },
- { "antonin.one", true },
- { "antonio-gartenbau.de", true },
- { "antoniogatti.ro", true },
- { "antonjuulnaber.dk", true },
- { "antonoff.tk", true },
- { "antonok.com", true },
- { "antota.lt", true },
- { "antragsgruen.de", true },
- { "antroposboutique.it", true },
- { "antroposofica.com.br", true },
- { "antvklik.com", true },
- { "antyblokada.pl", true },
- { "antyfake.pl", true },
- { "anulowano.pl", true },
- { "anunturitv.ro", true },
- { "anvartay.com", false },
- { "anvorte.com", false },
- { "anwalt.us", true },
- { "anwaltsindex.com", true },
- { "anxietyspace.com", true },
- { "anxiolytics.com", true },
- { "any-download.cf", true },
- { "any-download.ga", true },
- { "any-download.gq", true },
- { "any-download.ml", true },
- { "anyad.at", true },
- { "anyi.in", true },
- { "anyilin.cn", true },
- { "anymetrix.io", true },
- { "anyon.com", true },
- { "anypeer.net", true },
- { "anyquestions.govt.nz", true },
- { "anystack.xyz", true },
- { "anythinggraphic.net", true },
- { "anyways.at", true },
- { "anzacparkeast.com", true },
- { "anzeiger.ag", true },
- { "ao-dev.com", true },
- { "ao2.it", true },
- { "aoa.gov", true },
- { "aoadatacommunity.us", true },
- { "aobeauty.com.au", true },
- { "aod-tech.com", true },
- { "aoe9.com", true },
- { "aoeuaoeu.com", true },
- { "aofusa.net", true },
- { "aoil.gr", true },
- { "aokae.com", true },
- { "aopedeure.nl", true },
- { "aopsy.de", true },
- { "aori.com", true },
- { "aorosora.com", true },
- { "aosc.io", false },
- { "aostacarnavals.it", true },
- { "aotearoa.maori.nz", true },
- { "aotearoafreepress.com", true },
- { "aotearoaleaks.org", true },
- { "ap-swiss.ch", false },
- { "apa-canal.ro", true },
- { "apache-portal.com", true },
- { "apachehaus.de", false },
- { "apachelounge.com", true },
- { "apachezone.com", true },
- { "apadvantage.com", true },
- { "apalancamiento.trade", true },
- { "apart-hotel-weimar.de", true },
- { "apartmanicg.me", true },
- { "apartmanidano.com", true },
- { "apartment-in-rijeka.com", true },
- { "apartmentkroatien.at", true },
- { "apartmentregister.com.au", true },
- { "apasaja.tech", true },
- { "apbank.ch", true },
- { "apbox.de", true },
- { "apc.ec", true },
- { "apcemporium.co.uk", true },
- { "apcube.com", true },
- { "apdfawl.com", true },
- { "apdx.com", true },
- { "apef.ch", false },
- { "apercloud.es", true },
- { "apertis.org", true },
- { "aperture-science.net", true },
- { "apertureimaging.com", true },
- { "aperturelabs.tk", true },
- { "aperturesciencelabs.de", true },
- { "apervita.net", true },
- { "apex.to", true },
- { "apexitsolutions.ca", true },
- { "apgw.jp", true },
- { "aphelionentertainment.com", true },
- { "aphelis.net", true },
- { "api-connect.com", false },
- { "api.biz.tr", true },
- { "api.cloudflare.com", false },
- { "api.intercom.io", true },
- { "api.lookout.com", false },
- { "api.recurly.com", true },
- { "api.simple.com", false },
- { "api.xero.com", false },
- { "apicruz.com", true },
- { "apimon.de", true },
- { "apination.com", true },
- { "apio.systems", true },
- { "apiplus.fr", true },
- { "apirest.top", true },
- { "apis.google.com", true },
- { "apisyouwonthate.com", true },
- { "apitodemestre.com.br", true },
- { "apk.li", true },
- { "apk4fun.com", true },
- { "apkmod.id", true },
- { "apkpokemongo.gq", true },
- { "aplazame.com", true },
- { "aplikaceproandroid.cz", true },
- { "aplpackaging.co.uk", true },
- { "aplu.fr", true },
- { "aplus-usa.net", true },
- { "aplusdownload.com", true },
- { "apluswaterservices.com", true },
- { "apm.com.tw", true },
- { "apmg-certified.com", true },
- { "apn-dz.org", true },
- { "apn-einstellungen.de", true },
- { "apobot.de", true },
- { "apocalypseboard.tk", true },
- { "apocalypsemud.org", true },
- { "apod-portal-daily.azurewebsites.net", true },
- { "apod.com.au", true },
- { "apogeephoto.com", true },
- { "apollo-auto.com", true },
- { "apoly.de", true },
- { "apometria.site", true },
- { "aponkral.com", true },
- { "aponkral.com.tr", true },
- { "aponkral.net", true },
- { "aponkral.org", true },
- { "aporia.io", true },
- { "aposke.net", true },
- { "aposke.org", true },
- { "apostalegal.com", true },
- { "apostalegal.pt", true },
- { "apothecarydouglasville.com", true },
- { "apotheke55.de", true },
- { "apothes.is", true },
- { "app-at.work", true },
- { "app-scope.com", true },
- { "app.lookout.com", true },
- { "app.recurly.com", true },
- { "app.simpletax.ca", true },
- { "app.yinxiang.com", false },
- { "app00228.com", false },
- { "app11018.com", false },
- { "app2get.de", true },
- { "app6810.com", true },
- { "app77018.com", false },
- { "appagility.co.nz", true },
- { "appapi.link", true },
- { "apparelfashionwiki.com", true },
- { "appartement-andrea.at", true },
- { "appartement-evolene.net", false },
- { "appartementhaus-badria.de", true },
- { "appartementmarsum.nl", true },
- { "appassionata.ru", true },
- { "appbydl.com", true },
- { "appelaprojets.fr", true },
- { "appelboomdefilm.nl", true },
- { "appengine.google.com", true },
- { "appers.co", true },
- { "appgeek.com.br", true },
- { "appharbor.com", true },
- { "appify.org", true },
- { "appizia.com", true },
- { "applegun.com", true },
- { "applemon.com", true },
- { "appleoosa.com", true },
- { "applesencia.com", true },
- { "applian.jp", true },
- { "appliancepronwi.com", true },
- { "application-travel.us.com", true },
- { "applicationmanager.gov", true },
- { "applied-privacy.net", true },
- { "appliquette.com.au", true },
- { "apply-esta.us.com", true },
- { "apply-eta.org", true },
- { "apply-visa.us.com", true },
- { "apply.eu", true },
- { "appmeas.co.uk", true },
- { "appmobile.io", true },
- { "appninjas.com", true },
- { "apponic.com", true },
- { "appraf.com", true },
- { "apprank.in", true },
- { "apprendre-le-russe-avec-ania.fr", true },
- { "apprenticeship.gov", true },
- { "apprenticeships.gov", true },
- { "approbo.com", true },
- { "approval-workflow.com", true },
- { "approvedtreecare.com", true },
- { "apps.co", true },
- { "apps.facebook.com", false },
- { "apps.fedoraproject.org", true },
- { "apps.stg.fedoraproject.org", true },
- { "apps4inter.net", false },
- { "appsaraby.com", true },
- { "appscloudplus.com", true },
- { "appsdisosa.com", true },
- { "appseccalifornia.org", false },
- { "appsforlondon.com", true },
- { "appt.ch", false },
- { "apptesters.com", true },
- { "appuals.com", true },
- { "appub.co.jp", true },
- { "appui-de-fenetre.fr", true },
- { "appveyor.com", true },
- { "appworld.ga", true },
- { "appzoojoo.be", true },
- { "apretatuercas.es", true },
- { "aprikaner.de", true },
- { "aprogend.com.br", true },
- { "aproposcomputing.com", true },
- { "aprovpn.com", true },
- { "aprr.org", true },
- { "aprsdroid.org", true },
- { "aprz.de", true },
- { "apsa.paris", true },
- { "apstudynotes.org", true },
- { "aptekakolska.pl", true },
- { "aptitudetests.org", true },
- { "aptumseguros.mx", true },
- { "apu-board.de", true },
- { "apunkt.dk", true },
- { "apustaja.org", true },
- { "apuyou.io", true },
- { "apv-ollon.ch", true },
- { "apviz.io", true },
- { "apwide.com", true },
- { "aqarategypt.com", true },
- { "aqsiq.net", true },
- { "aqua-bucht.de", true },
- { "aqua-ferra.co.uk", true },
- { "aqua-fitness-nacht.de", true },
- { "aqua-fotowelt.de", true },
- { "aquabio.ch", false },
- { "aquabyte.co.uk", true },
- { "aquadecor.cf", true },
- { "aquadonis.ch", false },
- { "aquagarden.com.pl", true },
- { "aquahomo.com", true },
- { "aquaist.com", true },
- { "aqualife.com.gr", true },
- { "aqualifeprojects.com", true },
- { "aqualysis.nl", true },
- { "aquamarin.icu", true },
- { "aquapoint.kiev.ua", true },
- { "aquarden.com", true },
- { "aquarden.dk", true },
- { "aquariu.ms", true },
- { "aquarium-supplement.net", true },
- { "aquaselect.eu", true },
- { "aquasun.pl", true },
- { "aquaterm72.ru", true },
- { "aquaundine.net", true },
- { "aquavitaedayspa.com.au", true },
- { "aquelarreweb.com", true },
- { "aquila.co.uk", true },
- { "aquitainebrasserie.com.au", true },
- { "ar-informatique.ch", false },
- { "arab.dating", true },
- { "arabic-shirts.com", true },
- { "arabsexi.info", true },
- { "arachina.com", true },
- { "arackiralama.name.tr", true },
- { "aracusbienestar.com", true },
- { "arados.de", true },
- { "aragon.fun", true },
- { "arai21.net", true },
- { "aral.ml", true },
- { "araleeniken.com", true },
- { "aramido.de", true },
- { "aramloebmd.com", true },
- { "aranchhomes.com", true },
- { "aranycsillag.net", true },
- { "araratour.com", true },
- { "araro.ch", false },
- { "araseifudousan.com", true },
- { "arawaza.com", false },
- { "araxis.com", true },
- { "arbeitsch.eu", true },
- { "arbeitskreis-asyl-eningen.de", true },
- { "arbeitslosenverwaltung.de", true },
- { "arbejdsdag.dk", true },
- { "arbitrarion.com", true },
- { "arbitrary.ch", true },
- { "arboleda-hurtado.com", true },
- { "arcadio.fr", true },
- { "arcaik.net", true },
- { "arcanetides.com", true },
- { "arcanist.games", true },
- { "arcbouncycastles.co.uk", true },
- { "arcenergy.co.uk", true },
- { "archaeoadventures.com", true },
- { "archambault.paris", true },
- { "archbishop.ga", true },
- { "archeologicatoscana.it", true },
- { "archframe.net", true },
- { "archimedicx.com", true },
- { "archina.ir", true },
- { "archined.nl", true },
- { "archit.in", true },
- { "architectryan.com", true },
- { "architecture-colleges.com", true },
- { "architectureandgovernance.com", true },
- { "architecturequote.com", true },
- { "architectus.ga", true },
- { "archivero.es", true },
- { "archivesdelavieordinaire.ch", true },
- { "archivium.biz", true },
- { "archivosmercury.com", true },
- { "archivosstl.com", true },
- { "archiweb.pl", false },
- { "archlinux.de", true },
- { "archlinux.org", true },
- { "archwood.ro", true },
- { "arcinapoli.it", true },
- { "arclandholdings.com.au", true },
- { "arcobalabs.ca", true },
- { "arcogb.co", true },
- { "arcovix.com", true },
- { "arcridge.ca", true },
- { "arctic.ca", true },
- { "arctic.gov", true },
- { "arctica.io", true },
- { "arcticbit.net", true },
- { "arctus-security.com", true },
- { "arcueil-cachan.fr", false },
- { "arcusnova.de", true },
- { "ardadanal.com", true },
- { "ardor.noip.me", true },
- { "ardtrade.ru", true },
- { "area.ge", true },
- { "area4pro.com", true },
- { "areacinquentaeum.tk", true },
- { "areaclienti.net", false },
- { "areafiftylan.nl", true },
- { "areatrend.com", true },
- { "areis.pt", true },
- { "arekatieandchrisgettingmarried.com", true },
- { "arekatieandchrisgettingmarried.today", true },
- { "arekatieandchrismarriedyet.com", true },
- { "arena-lemgo.de", true },
- { "arenda247.by", true },
- { "arendburgers.nl", true },
- { "areqgaming.com", true },
- { "ares-trading.de", true },
- { "aresanel.com", true },
- { "arethsu.se", true },
- { "arfad.ch", false },
- { "arganaderm.ch", false },
- { "argb.de", true },
- { "argecord.com", true },
- { "argekultur.at", true },
- { "argentinatrabaja.org", true },
- { "argonium.com.au", true },
- { "argot.com", true },
- { "argovpay.com", true },
- { "argumentative-essay.gq", true },
- { "ariacreations.net", true },
- { "ariadermspa.com", true },
- { "arian.io", true },
- { "ariana.wtf", true },
- { "ariba.info", true },
- { "ariege-pyrenees.net", true },
- { "arielpereira.tk", true },
- { "arieswdd.com", true },
- { "arigato-java.download", true },
- { "ariixmex.com", true },
- { "arijitdg.net", true },
- { "arikar.eu", true },
- { "arilto.com", true },
- { "arinde.ee", true },
- { "arise19.com", true },
- { "arisechurch.com", false },
- { "ariseconference.org.nz", false },
- { "aritec-la.com", true },
- { "arithmetic.ga", true },
- { "arivo.com.br", true },
- { "ariyaoil.ir", true },
- { "arizana.com", true },
- { "arjan.nl", true },
- { "arjandejong.eu", true },
- { "arjanenthijs.nl", true },
- { "arjansteevels.nl", true },
- { "arjanvaartjes.net", true },
- { "arjunasdaughter.pub", true },
- { "arjweb.co.uk", true },
- { "arkacrao.org", true },
- { "arkadiyt.com", true },
- { "arkantos.agency", true },
- { "arkenco.cl", true },
- { "arkhvoid.xyz", true },
- { "arkitextonico.com", true },
- { "arkulagunak.com", false },
- { "arlaperu.com", true },
- { "arlartistadigital.com.mx", true },
- { "arlen.tv", true },
- { "arlenarmageddon.com", true },
- { "arletalibrary.com", true },
- { "arlingtonelectric.com", true },
- { "arlingtonwine.net", true },
- { "arm-host.com", true },
- { "arm.gov", true },
- { "armadale.wa.gov.au", true },
- { "armadaquadrat.com", true },
- { "armageddonstuff.com", true },
- { "armandsdiscount.com", true },
- { "armanozak.com", true },
- { "armansfinejewellery.com", true },
- { "armansfinejewellery.com.au", true },
- { "armarinhovirtual.com.br", true },
- { "armbrust.me", true },
- { "armcar.ga", true },
- { "armedpoet.com", true },
- { "armeniaweb.tk", true },
- { "armil.it", true },
- { "armin-cme.de", true },
- { "armin-cpe.de", true },
- { "arminpech.de", true },
- { "armor.ai", true },
- { "armpads.nl", true },
- { "armstrongsengineering.com", true },
- { "armtopnews.tk", true },
- { "army24.cz", true },
- { "armyprodej.cz", true },
- { "arnaudardans.com", true },
- { "arnaudb.net", true },
- { "arnaudfeld.de", true },
- { "arnaudlanna.com", true },
- { "arnesegers.be", true },
- { "arnevankauter.com", true },
- { "arniescastles.co.uk", true },
- { "arno-klein.com", true },
- { "arno-klein.de", true },
- { "arno-klein.eu", true },
- { "arno-klein.fr", true },
- { "arno-klein.net", true },
- { "arnoklein.eu", true },
- { "arnoklein.fr", true },
- { "arnoldkontz-occasions.lu", false },
- { "arnonerba.com", true },
- { "arnor.org", true },
- { "arnoudraeven.nl", true },
- { "arnoudvandalen.nl", true },
- { "arnove.fr", true },
- { "arnove.net", true },
- { "arnsmedia.nl", false },
- { "arod.tk", true },
- { "arogov.com", true },
- { "arokha.com", true },
- { "aromacos.ch", true },
- { "aron.host", true },
- { "aroonchande.com", false },
- { "aros.pl", true },
- { "arose.io", true },
- { "around-cms.de", true },
- { "arox.eu", true },
- { "arpatutorial.com", true },
- { "arpnet.co.jp", true },
- { "arqueo-ecuatoriana.ec", true },
- { "arquitet.com.br", true },
- { "arquitetura.pt", true },
- { "arrakis.se", true },
- { "arraudi.be", true },
- { "arrazane.com.br", true },
- { "arresttracker.com", true },
- { "arrive.by", true },
- { "arrmaforum.com", true },
- { "arroba.digital", true },
- { "arrow-analytics.nl", true },
- { "arrow-api.nl", true },
- { "arrowfastener.com", true },
- { "arrowheadaddict.com", true },
- { "arrowwebprojects.nl", true },
- { "ars-online.pl", true },
- { "arschkrebs.org", true },
- { "arsenal-charodeya.com", true },
- { "arsindecor.com", true },
- { "arslankaynakmetal.com", true },
- { "arsplus.ru", false },
- { "art-auction.jp", true },
- { "art-et-culture.ch", false },
- { "art-et-tonneaux.fr", true },
- { "art-news.tk", true },
- { "art-pix.com", true },
- { "art-pix.de", true },
- { "art-pix.net", true },
- { "art-shinbi.com", true },
- { "artacadia.org", true },
- { "artboja.com", true },
- { "artc.at", true },
- { "artcaly.com.br", true },
- { "artdeco-photo.com", false },
- { "artea.ga", true },
- { "arteaga.co.uk", true },
- { "arteaga.eu", true },
- { "arteaga.me", true },
- { "arteaga.tech", true },
- { "arteaga.uk", true },
- { "arteaga.xyz", true },
- { "artebel.com.br", true },
- { "artecat.ch", true },
- { "artedellavetrina.it", true },
- { "artedona.com", true },
- { "artefakt.es", true },
- { "artefeita.com.br", true },
- { "arteinstudio.it", true },
- { "artelt.com", true },
- { "artemis.re", true },
- { "artera.spb.ru", true },
- { "arterienundvenen.ch", true },
- { "arterydb.ru", true },
- { "artesaniastonalaytlaquepaque.com", true },
- { "arteseideias.com.pt", true },
- { "arteshow.ch", false },
- { "artfabrics.com", true },
- { "artforum.sk", true },
- { "artfullyelegant.com", true },
- { "arthan.me", true },
- { "arthermitage.org", true },
- { "arthritisrheumaticdiseases.com", true },
- { "arthurlaw.ca", true },
- { "arthuryidi.com", true },
- { "arti-islam.tk", true },
- { "articu.no", true },
- { "artifact.spb.ru", true },
- { "artifexnet.com", true },
- { "artificialgrassandlandscaping.com", true },
- { "artificialplants.tk", true },
- { "artigianociao.jp", true },
- { "artigoos.com", true },
- { "artimpact.ch", true },
- { "artioml.net", true },
- { "artionet.ch", true },
- { "artis-game.net", true },
- { "artisan-cheminees-poeles-design.fr", false },
- { "artisansoftaste.com", true },
- { "artisavotins.com", true },
- { "artistagenda.com", true },
- { "artistedeparis.fr", true },
- { "artistrunwebsite.com", true },
- { "artitbe.net", true },
- { "artiwear.com.tw", true },
- { "artlantis.nl", true },
- { "artleading.ru", true },
- { "artlifeisgood.com", true },
- { "artlogo.biz", true },
- { "artlogo.cz", true },
- { "artlogo.sk", true },
- { "artmarketingnews.com", true },
- { "artmoney.com", true },
- { "artmosfilms.co.za", true },
- { "artofcode.co.uk", true },
- { "artofhappyliving.com", true },
- { "artofmonitoring.com", false },
- { "artofwhere.com", true },
- { "artozoul.fr", true },
- { "artplasticsurgeons.com", true },
- { "artrapid.com", true },
- { "artratio.net", true },
- { "artroot.jp", true },
- { "artroscopiaperlosport.it", true },
- { "arts.gov", true },
- { "artschmidtoptical.com", true },
- { "artsmarket.ca", true },
- { "artspac.es", true },
- { "arttel-media.ru", true },
- { "arturli.be", true },
- { "arturopinto.com.mx", true },
- { "arturszalak.com", true },
- { "artweby.cz", true },
- { "artworxbathrooms.com.au", true },
- { "arty.name", true },
- { "artyengine.com", true },
- { "arubasunsetbeach.com", true },
- { "arufu.dk", true },
- { "arunjoshua.com", true },
- { "arveron.ch", false },
- { "arvid.io", true },
- { "arvindhariharan.com", true },
- { "arvindhariharan.me", true },
- { "arvutiladu.ee", true },
- { "arweth.com", true },
- { "arx-libertatis.org", true },
- { "arx.vg", true },
- { "arx8x.net", true },
- { "arxell.com", true },
- { "aryalaroca.de", true },
- { "aryan-nation.com", true },
- { "aryasenna.net", true },
- { "arzid.com", true },
- { "as200753.com", true },
- { "as200753.net", true },
- { "as44222.net", true },
- { "as5158.com", true },
- { "as8423.net", true },
- { "asaabforever.com", true },
- { "asabacortoscaseros.tk", true },
- { "asadatec.de", true },
- { "asafaweb.com", true },
- { "asafilm.co", true },
- { "asakoh.co.jp", true },
- { "asana.com", true },
- { "asananutrition.co.uk", true },
- { "asandu.eu", true },
- { "asanger.biz", true },
- { "asart.bg", true },
- { "asato-jewelry.com", true },
- { "asbestosthedarkarts.com", true },
- { "asbito.de", true },
- { "ascension.run", true },
- { "ascgathering.com", true },
- { "aschismatic.com", true },
- { "asciitable.tips", true },
- { "asciiwwdc.com", true },
- { "ascpaphilatelie.eu", true },
- { "asdchieti.tk", true },
- { "asdwfwqd.com", true },
- { "asdyx.de", true },
- { "asegem.es", true },
- { "asenno.com", true },
- { "aserver.co", true },
- { "asexualitat.cat", true },
- { "asfaleianet.gr", true },
- { "asgapps.co.za", true },
- { "asgrd.org", true },
- { "ashd1.goip.de", true },
- { "ashd2.goip.de", true },
- { "ashd3.goip.de", true },
- { "ashenm.ml", true },
- { "ashessin.com", true },
- { "ashlarimoveis.com.br", true },
- { "ashleyedisonuk.com", true },
- { "ashleykaryl.com", true },
- { "ashleymadison.com", true },
- { "ashleythouret.com", true },
- { "ashlocklawgroup.com", true },
- { "ashmportfolio.com", true },
- { "ashmyra.com", true },
- { "ashridgetrees.co.uk", true },
- { "ashtonbromleyceramics.co.uk", true },
- { "ashtonc.ca", true },
- { "ashtonwealth.com", true },
- { "ashutoshmishra.org", true },
- { "asia-gazette.com", true },
- { "asia.dating", true },
- { "asiaheavens.com", true },
- { "asialeonding.at", true },
- { "asian-industry.eu", true },
- { "asianshops.net", true },
- { "asianspa.co.uk", true },
- { "asianwebcams.webcam", true },
- { "asiasmi.tk", true },
- { "asiba.com.au", true },
- { "asiinc-tex.com", true },
- { "asile-colis.fr", true },
- { "asilo.roma.it", true },
- { "asinetasima.com", true },
- { "ask.fi", true },
- { "ask1.org", true },
- { "askcascade.com", true },
- { "askeustache.com", true },
- { "askizzy.org.au", true },
- { "askkaren.gov", true },
- { "askme-events.vip", true },
- { "askv6.net", true },
- { "askvg.com", true },
- { "askwhy.cz", true },
- { "askwhy.eu", true },
- { "asmanyasgiven.com", true },
- { "asmarketero.com", true },
- { "asmbsurvey.com", true },
- { "asmdz.com", true },
- { "asmeets.nl", true },
- { "asmood.net", true },
- { "asociaciontrastea.com", true },
- { "asp.net", true },
- { "aspargesgaarden.no", true },
- { "aspcl.ch", true },
- { "aspectuw.com.au", true },
- { "asperger-ag.ch", true },
- { "asperti.com", true },
- { "aspformacion.com", true },
- { "asphyxia.su", true },
- { "aspiescentral.com", true },
- { "aspiradorasbaratas.net", true },
- { "aspirateur-anti-pollution.fr", true },
- { "aspires.co.jp", true },
- { "aspireuniversal.com", true },
- { "aspirevc.com", true },
- { "aspisdata.com", true },
- { "asprion.org", true },
- { "asproni.it", true },
- { "asr.cloud", true },
- { "asr.li", true },
- { "asr.rocks", true },
- { "asr.solar", true },
- { "asra.gr", true },
- { "asryflorist.com", true },
- { "assaabloygaragedoors.ca", true },
- { "asseenfromthesidecar.org", true },
- { "assemblage.gq", true },
- { "assemble-together.org", true },
- { "assemblytechnicianjobs.com", true },
- { "assemblywithoutthewalls.org", true },
- { "assempsaibiza.com", true },
- { "assertion.de", true },
- { "assessoriati.com.br", true },
- { "assetbacked.capital", false },
- { "assetsec.io", true },
- { "assetsman-assetsvalue.com", true },
- { "assguidesporrentruy.ch", false },
- { "assign-it.co.uk", true },
- { "assignacii.ml", true },
- { "assis.partners", true },
- { "assistel.com", true },
- { "assistenciamultitec.com.br", true },
- { "associatedwomenshealthcare.com", true },
- { "associationhorizon.tk", true },
- { "assodigitale.it", true },
- { "asspinter.me", true },
- { "assumptionpj.org", true },
- { "astal.rs", true },
- { "astaninki.com", true },
- { "astarbouncycastles.co.uk", true },
- { "astarmathsandphysics.com", true },
- { "astaxanthin-sport.de", true },
- { "astaxanthin.de", true },
- { "astec-informatica.com", true },
- { "astengox.com", true },
- { "astenotarili.online", false },
- { "asticon.de", true },
- { "astifan.online", true },
- { "astral-imperium.com", true },
- { "astroalloys.com.au", true },
- { "astrociencia.tk", true },
- { "astrojunkies.com", true },
- { "astroloeches.tk", true },
- { "astrology42.com", true },
- { "astrong.pl", true },
- { "astroscopy.ch", false },
- { "astrovandalistas.cc", true },
- { "astucewebmaster.com", true },
- { "astural.org", false },
- { "astutikhonda.com", true },
- { "asu.moe", true },
- { "asuclassfinder.com", true },
- { "asun.co", true },
- { "asurbernardo.com", true },
- { "asurepay.cc", false },
- { "asustreiber.de", true },
- { "asvsa.ch", false },
- { "asws.nl", true },
- { "asyikbelanja.com", true },
- { "asylbarn.no", true },
- { "asystent-dzierzawy.pl", true },
- { "at.search.yahoo.com", false },
- { "at5.nl", true },
- { "at7s.me", true },
- { "ataber.pw", true },
- { "atacadocervejeiro.com.br", true },
- { "atacadodesandalias.com.br", true },
- { "atahualpa.com", true },
- { "atallo.com", true },
- { "atallo.es", true },
- { "ataton.ch", false },
- { "atayia.com", true },
- { "atbwebservices.co.uk", true },
- { "atc.cuneo.it", true },
- { "atchleyjazz.com", true },
- { "atchleyjazz.org", true },
- { "atchleylab.org", true },
- { "atcom.cl", true },
- { "atds.ch", false },
- { "ateamsport.dk", true },
- { "atease-salon.jp", true },
- { "atedificacion.com", true },
- { "ateli.com", true },
- { "atelier-coiffure.ch", false },
- { "atelier-naruby.cz", true },
- { "atelieracbaby.com.br", true },
- { "atelieraphelion.com", true },
- { "atelierbw.com", true },
- { "atelierdefrancais.ch", false },
- { "atelierdeloulou.fr", true },
- { "atelierdesflammesnoires.fr", true },
- { "atelierfantazie.sk", true },
- { "atelierhsn.com", true },
- { "ateliernaruby.cz", true },
- { "atelierssud.ch", false },
- { "atencionbimbo.com", false },
- { "aterlectric.com", true },
- { "aterskapa-data.se", true },
- { "atf.gov", true },
- { "atfstudios.tk", true },
- { "atgoetschel.ch", false },
- { "atgseed.co.uk", true },
- { "atgseed.uk", true },
- { "ath0.org", false },
- { "atheist-faq.com", true },
- { "atheist-refugees.com", true },
- { "atheistfrontier.com", true },
- { "atheit.com", true },
- { "athekiu.com", true },
- { "athemis.de", true },
- { "athena-garage.co.uk", true },
- { "athenadynamics.com", true },
- { "athenaneuro.com", true },
- { "athlin.de", true },
- { "athomedeco.fr", true },
- { "atigerseye.com", true },
- { "atimbertownservices.com", true },
- { "atinylittle.space", true },
- { "atis-ars.ru", true },
- { "atishchenko.com", true },
- { "atisoft.biz", true },
- { "atisoft.com.tr", true },
- { "atisoft.net", true },
- { "atisoft.net.tr", true },
- { "atisoft.web.tr", true },
- { "atitude.com", true },
- { "ativapsicologia.com.br", true },
- { "atl-paas.net", true },
- { "atlantareroof.com", true },
- { "atlantaspringroll.com", true },
- { "atlantichomes.com.au", true },
- { "atlanticmarina.com", true },
- { "atlanticpediatricortho.com", true },
- { "atlanticyellowpages.com", true },
- { "atlantis-kh.noip.me", true },
- { "atlantischild.hu", true },
- { "atlantishq.de", true },
- { "atlantiswaterproofing.com", true },
- { "atlas-heritage.com", true },
- { "atlas-multimedia.de", true },
- { "atlasauthority.com", true },
- { "atlasbrown.com", true },
- { "atlascoffeeclub.com", true },
- { "atlascultural.com", true },
- { "atlasdev.nl", true },
- { "atlasone.us", true },
- { "atlassignsandplaques.com", true },
- { "atletika.hu", true },
- { "atmalta.com", true },
- { "atmind.nl", true },
- { "atmmantenimiento.co", true },
- { "atnis.com", true },
- { "ato4sound.com", true },
- { "atolm.net", true },
- { "atom-china.org", true },
- { "atom.solutions", true },
- { "atom86.net", true },
- { "atomicbounce.co.uk", true },
- { "atomism.com", true },
- { "atorcidabrasileira.com.br", true },
- { "atplonline.co", true },
- { "atpnutrition.com", true },
- { "atrafloor.com", true },
- { "atraining.ru", true },
- { "atraverscugy.ch", false },
- { "atrevillot.com", true },
- { "atrias.net", true },
- { "atrinik.org", true },
- { "atsoftware.de", true },
- { "attac.us", true },
- { "atte.fi", true },
- { "attendanceondemand.com", true },
- { "attendantdesign.com", true },
- { "attendu.cz", true },
- { "attengo.ga", true },
- { "attention.horse", true },
- { "attilagyorffy.com", true },
- { "attilavandervelde.nl", true },
- { "attinderdhillon.com", true },
- { "attitudes-bureaux.fr", true },
- { "attogtech.com", true },
- { "attorney.org.il", true },
- { "attuned.se", true },
- { "attunedstore.com", true },
- { "attwood.org", true },
- { "atuendomr.com", true },
- { "atviras.lt", false },
- { "atvirtual.at", true },
- { "atvsafety.gov", true },
- { "atwar-mod.com", true },
- { "atwonline.org", true },
- { "atxchirocoverage.com", true },
- { "atyourprice.net", true },
- { "atypicom.es", true },
- { "atypicom.fr", true },
- { "atypicom.it", true },
- { "atypicom.pt", true },
- { "atzenchefin.de", true },
- { "atzzz.com", true },
- { "au2pb.org", true },
- { "aubergegilly.ch", false },
- { "aubg.org", true },
- { "aubio.org", true },
- { "aubonheurdeshuiles.fr", true },
- { "aubonmanger.fr", false },
- { "aubreysnider.com", true },
- { "auburnmedicalservices.com", true },
- { "auburnperio.com", true },
- { "aucarresainteloi.com", true },
- { "aucielrose.com", true },
- { "aucklandcastles.co.uk", true },
- { "aucospa.com", true },
- { "aucubin.de", true },
- { "audiclubbahrain.com", true },
- { "audiense.com", false },
- { "audio-detector.com", true },
- { "audiobookboo.com", true },
- { "audiobookstudio.com", true },
- { "audioboom.com", true },
- { "audiohub.com", true },
- { "audiohub.de", true },
- { "audiohub.fr", true },
- { "audiolibri.org", true },
- { "audiolot.com", true },
- { "audiomaze.com", true },
- { "audiophile.ch", false },
- { "audiophix.com", true },
- { "audiorecording.me", true },
- { "audiorental.net", true },
- { "audioschoolonline.com", true },
- { "audiotechniker.de", true },
- { "audirsq3.de", true },
- { "audisto.com", true },
- { "auditmatrix.com", true },
- { "auditos.com", true },
- { "audits.io", true },
- { "auditsquare.com", true },
- { "audreyhossepian.fr", true },
- { "audreyjudson.com", true },
- { "auenhof-agrar.de", true },
- { "auerbach-verlag.de", true },
- { "auf-feindgebiet.de", true },
- { "auf-nach-mallorca.info", true },
- { "aufro.com", true },
- { "aufwecken.dynu.net", true },
- { "augehost.com", true },
- { "augen-seite.de", true },
- { "augenlaser-chemnitz.de", true },
- { "augenlaser-dresden.de", true },
- { "augenlasercenter-dresden.de", true },
- { "augenlaserzentrum-dresden.com", true },
- { "augenlaserzentrum-dresden.eu", true },
- { "augesen.tk", true },
- { "augiero.it", true },
- { "augur.us", true },
- { "august-don.site", true },
- { "augustian-life.cz", true },
- { "augustiner-kantorei-erfurt.de", true },
- { "augustiner-kantorei.de", true },
- { "augustoshoppingnet.com.br", true },
- { "aukaraoke.su", true },
- { "auksnest.ca", true },
- { "aulasvirtualesperu.com", true },
- { "aulica-conseil.com", true },
- { "aulo.in", false },
- { "aumentada.net", true },
- { "aumilieudumonde.gf", true },
- { "aunali1.com", true },
- { "auntie-eileens.com.au", true },
- { "auntiesnorkel.com", true },
- { "auntmia.com", true },
- { "aupaysdesanes.com", true },
- { "auplidespages.fr", true },
- { "aura7chakr.com", true },
- { "aurbrowser.tk", true },
- { "aurelieburn.fr", true },
- { "aurelienaltarriba.fr", true },
- { "auricblue.com", true },
- { "auriko-games.de", true },
- { "aurnik.com", true },
- { "auroraassociationofrealtors.com", true },
- { "auroware.com", true },
- { "aus-ryugaku.info", true },
- { "ausec.ch", false },
- { "auskunftsbegehren.at", true },
- { "auspicacious.org", true },
- { "ausschreibungen-suedtirol.it", true },
- { "aussiefunadvisor.com", true },
- { "aussiemilfs.com", true },
- { "aussieseoadelaide.com.au", true },
- { "aussieseobrisbane.com.au", true },
- { "aussieservicedown.com", true },
- { "aussiestoresonline.com", true },
- { "austenplumbing.com", true },
- { "austerevisuals.com", true },
- { "austin-pearce.com", true },
- { "austin-security-cameras.com", true },
- { "austincardiac.com", true },
- { "austinchase.com", true },
- { "austinheap.com", false },
- { "austinlockout.com", true },
- { "austintxacrepairtoday.com", true },
- { "austinuniversityhouse.com", true },
- { "australian.dating", true },
- { "australianairbrushedtattoos.com.au", true },
- { "australianattractions.com.au", true },
- { "australianimmigrationadvisors.com.au", true },
- { "australianstrongmanalliance.com.au", true },
- { "australiantemporarytattoos.com", true },
- { "australiantemporarytattoos.com.au", true },
- { "australien-tipps.info", true },
- { "austromorph.space", true },
- { "auszeit-lanzarote.com", true },
- { "auszeit-walsrode.de", true },
- { "auszeit.bio", true },
- { "auth.adult", true },
- { "auth.mail.ru", true },
- { "authanet.ga", true },
- { "authcom.ca", true },
- { "authenticate.computer", true },
- { "authenticationhub.io", true },
- { "authenticwoodcraft.com", true },
- { "authinfo-bestellen.de", true },
- { "authinity.com", true },
- { "authland.com", false },
- { "author24.biz", true },
- { "author24.info", true },
- { "authoritysolutions.com", true },
- { "autimatisering.nl", true },
- { "autismewoerden.nl", true },
- { "auto-anleitung.de", true },
- { "auto-dealership-news.com", true },
- { "auto-i-dat.ch", true },
- { "auto-motor-i-sport.pl", true },
- { "auto-none.com", true },
- { "auto-plus.tn", true },
- { "auto-res.ru", true },
- { "auto-skills.ru", true },
- { "auto1.fi", true },
- { "autoauctionsohio.com", true },
- { "autoauctionsvirginia.com", true },
- { "autobarn.co.nz", true },
- { "autobedrijfgarant.nl", true },
- { "autobella-hurtownia.pl", true },
- { "autobelle.it", true },
- { "autobourcier.com", true },
- { "autocadperfmon.azurewebsites.net", true },
- { "autocartruck.com", true },
- { "autoccaz.fr", true },
- { "autocontrol.online", true },
- { "autocorner.com", true },
- { "autocrypt.org", true },
- { "autod.hu", true },
- { "autodalmacija.com", true },
- { "autodidactic.ai", true },
- { "autodidacticstudios.com", true },
- { "autodidacticstudios.net", true },
- { "autodius.com", true },
- { "autoelettricaperbambini.com", true },
- { "autoentrepreneurinfo.com", true },
- { "autoeshop.eu", true },
- { "autofficina.roma.it", true },
- { "autoglass.com.my", true },
- { "autohomehub.com", true },
- { "autoi.ch", true },
- { "autokeyinaustin.com", true },
- { "autokeyreplacementsanantonio.com", true },
- { "autoklub.cz", true },
- { "autokovrik-diskont.ru", true },
- { "autolawetawroclaw.pl", true },
- { "autoledky.sk", true },
- { "autolider.org", true },
- { "automacity.com", true },
- { "automagischeberegening.nl", true },
- { "automatethis.com.au", true },
- { "automatic.com", true },
- { "automationpro.me", true },
- { "automentesszolnok.hu", true },
- { "automotivegroup-usedcars.be", false },
- { "automotivemechanic.org", true },
- { "automuovifix.fi", true },
- { "automy.de", true },
- { "autonewssite.com", true },
- { "autonoleggio.milano.it", true },
- { "autoosijek.com", true },
- { "autopapo.com.br", true },
- { "autopark-ost-fichtner.de", true },
- { "autoparts.im", true },
- { "autoparts.sh", true },
- { "autoparts.wf", true },
- { "autoprice.info", false },
- { "autoproshouston.com", true },
- { "autorama.cf", true },
- { "autorando.com", true },
- { "autoreinigung-noack.de", true },
- { "autorepairseattle.com", true },
- { "autorijschooljohanbos.nl", true },
- { "autorijschoolrichardschut.nl", true },
- { "autorijschoolstorm.nl", true },
- { "autos-mertens.com", true },
- { "autosaan.ro", true },
- { "autoschadeschreuder.nl", true },
- { "autoschool.ga", true },
- { "autoscuola.roma.it", true },
- { "autoshinka72.ru", true },
- { "autoshopsolutions.com", true },
- { "autoshun.org", true },
- { "autoskola.hr", true },
- { "autoskolaplzen.cz", true },
- { "autoskole.hr", true },
- { "autospurghi.milano.it", true },
- { "autospurgo.com", true },
- { "autospurgo.it", true },
- { "autospurgo.milano.it", true },
- { "autostodulky.cz", true },
- { "autoteplo.org", true },
- { "autoterminus-used.be", false },
- { "autoto.hr", true },
- { "autotransportquoteservices.com", true },
- { "autotyreprest.ro", true },
- { "autouncle.at", true },
- { "autouncle.co.uk", true },
- { "autouncle.com", true },
- { "autouncle.de", true },
- { "autouncle.dk", true },
- { "autouncle.fi", true },
- { "autouncle.fr", true },
- { "autouncle.it", true },
- { "autouncle.pl", true },
- { "autouncle.pt", true },
- { "autouncle.ro", true },
- { "autouncle.se", true },
- { "autoverzekeringafsluiten.com", true },
- { "autovesti.cf", true },
- { "autowerkstatt-puchheim.de", true },
- { "autowise.dk", true },
- { "autres-talents.fr", true },
- { "autshir.com", true },
- { "auvidos.ru", true },
- { "aux-arts-de-la-table.com", true },
- { "auxiliame.com", true },
- { "auxille.com", true },
- { "av-yummy.com", true },
- { "av01.tv", true },
- { "ava-creative.de", false },
- { "ava-software.at", true },
- { "avaaz.org", true },
- { "avabouncehire.co.uk", true },
- { "avacariu.me", true },
- { "avaemr-development-environment.ca", true },
- { "avaeon.com", true },
- { "available.direct", true },
- { "availablecastles.com", true },
- { "avalon-island.ru", true },
- { "avalon-rpg.com", true },
- { "avalonbelltown.com", true },
- { "avalyuan.com", true },
- { "avancen.com", true },
- { "avanet.com", true },
- { "avangvpn.ga", true },
- { "avanovum.de", true },
- { "avantitualatin.com", true },
- { "avarcom.tk", true },
- { "avarty.com", true },
- { "avarty.net", true },
- { "avatardiffusion.com", true },
- { "avcd.cz", true },
- { "ave.zone", true },
- { "aveapps.com", false },
- { "aveclunettesoleil.fr", true },
- { "avedesk.org", false },
- { "avelinodiaz.gal", true },
- { "avengersonlinemovie.ga", true },
- { "aventurische-allianz.de", true },
- { "avenuedesbebes.com", true },
- { "avepol.cz", true },
- { "avepol.eu", true },
- { "averageinspired.com", true },
- { "averam.net", true },
- { "averen.co.uk", true },
- { "avernis.de", true },
- { "avexon.com", true },
- { "avi12.com", true },
- { "avia-krasnoyarsk.ru", true },
- { "avia-ufa.ru", true },
- { "aviasalon.spb.ru", true },
- { "aviationmilitaire.tk", true },
- { "aviationstrategies.aero", true },
- { "aviationstrategy.aero", true },
- { "aviationweather.gov", false },
- { "aviconverter.tk", true },
- { "avidmode-dev.com", true },
- { "avidmode-staging.com", true },
- { "avidmode.com", true },
- { "avinilo.com", true },
- { "avisofi-credit-immobilier.fr", true },
- { "aviteng.cloud", true },
- { "aviteng.com", true },
- { "avivaplasticsurgery.com", true },
- { "avlhostel.com", true },
- { "avm-multimedia.com", true },
- { "avmoo.com", true },
- { "avmrc.nl", true },
- { "avmup.com", true },
- { "avnet.ws", true },
- { "avocad.studio", true },
- { "avocode.com", true },
- { "avonture.be", true },
- { "avonvets.co.uk", true },
- { "avova.de", true },
- { "avpres.net", false },
- { "avptp.org", true },
- { "avqueen.cn", true },
- { "avrora-nov.ru", true },
- { "avsox.com", true },
- { "avtecmedia.com", true },
- { "avticket.ru", false },
- { "avtobania.pro", true },
- { "avtoforex.ru", true },
- { "avtogara-isperih.com", true },
- { "avtomarket.ru", true },
- { "avtosept.by", true },
- { "avtovokzaly.ru", true },
- { "avv.li", true },
- { "avvaterra.ch", true },
- { "avvcorda.com", false },
- { "avvocato.bologna.it", true },
- { "aw.gov.pl", true },
- { "aw.net", true },
- { "awangardaszkola.pl", true },
- { "awardplatform.com", true },
- { "awardsplatform.com", true },
- { "awaremi-tai.com", true },
- { "awaresec.com", true },
- { "awaresec.no", true },
- { "awarify.io", true },
- { "awarify.me", true },
- { "awaro.net", true },
- { "awaygroundguide.com", true },
- { "awbouncycastlehire.com", true },
- { "awesomebouncycastles.co.uk", true },
- { "awesomenamegenerator.com", true },
- { "awic.ca", true },
- { "awk.tw", true },
- { "awksolutions.com", true },
- { "awningcanopyus.com", true },
- { "awningsaboveus.com", true },
- { "awningsatlantaga.com", true },
- { "awningsydney.ga", true },
- { "awomansplacenj.com", true },
- { "awplasticsurgery.com", true },
- { "awsbs.de", true },
- { "awscloudrecipes.com", true },
- { "awsmdev.de", true },
- { "awsome-books.co.uk", true },
- { "awsumchan.org", true },
- { "awxg.com", true },
- { "ax25.org", true },
- { "axa.de", true },
- { "axault.com", true },
- { "axel-fischer.net", true },
- { "axel-voss.eu", true },
- { "axelname.ru", true },
- { "axelteichmann.net", true },
- { "axelvoss.eu", true },
- { "axin888.vip", true },
- { "axiodl.com", true },
- { "axiomeosteopathie.ca", true },
- { "axiomer.com", true },
- { "axishw.com", true },
- { "axispara-bg.com", true },
- { "axon-toumpa.gr", true },
- { "axone-computers.fr", false },
- { "axonholdingse.eu", true },
- { "axre.de", true },
- { "axrec.de", true },
- { "ay-net.jp", true },
- { "ayahya.me", false },
- { "ayanomimi.com", true },
- { "aycasac.com", true },
- { "aycomba.de", true },
- { "ayecode.ca", true },
- { "ayesh.me", true },
- { "aykutcevik.com", true },
- { "aylak.com", true },
- { "aylavblog.com", true },
- { "aylesburycastlehire.co.uk", true },
- { "aymerick-dupouey.fr", true },
- { "aymerick.fr", true },
- { "aymericlagier.com", true },
- { "ayothemes.com", true },
- { "ayporealestate.com", true },
- { "aypotech.com", true },
- { "ayrshirebouncycastlehire.co.uk", true },
- { "ayudacloud.com", true },
- { "ayudalabs.com", true },
- { "ayudapreview.com", true },
- { "ayumi.network", true },
- { "ayumindev.net", true },
- { "ayumix3.xyz", true },
- { "ayurveda-mantry.com", false },
- { "ayvalikgezgini.com", true },
- { "ayyz66.cc", true },
- { "az-moga.bg", true },
- { "az.net.au", true },
- { "az.search.yahoo.com", false },
- { "az1b2y3cx.com", true },
- { "azabani.com", true },
- { "azadliq.info", true },
- { "azarus.ch", true },
- { "azazy.net", false },
- { "azerinews.tk", true },
- { "azh-kunden.de", true },
- { "aziende.com.ar", true },
- { "azimut.fr", true },
- { "azithromycine.gq", true },
- { "azizvicdan.com", false },
- { "azlk-team.ru", true },
- { "azlocalbusiness.com", true },
- { "aznews.site", true },
- { "azora.cf", true },
- { "azort.com", true },
- { "azotobacter.nl", true },
- { "azpogomap.com", true },
- { "azrazalea.net", true },
- { "azrhymes.com", true },
- { "azsgeniedev.azurewebsites.net", true },
- { "azso.pro", true },
- { "azsupport.com", true },
- { "aztraslochi.it", true },
- { "aztrix.me", true },
- { "aztummytuck.com", true },
- { "azuki.cloud", true },
- { "azukie.com", true },
- { "azurecrimson.com", true },
- { "azuriasky.com", true },
- { "azuriasky.net", true },
- { "azuxul.fr", true },
- { "azzorti.com", true },
- { "azzurrapelletterie.it", true },
- { "b-b-law.com", true },
- { "b-cyclesshop.ch", false },
- { "b-honey.gr", true },
- { "b-performance.de", true },
- { "b-root-force.de", true },
- { "b-services.net", false },
- { "b-tree.be", true },
- { "b0000.co", true },
- { "b00228.com", false },
- { "b00de.ga", true },
- { "b0305.com", true },
- { "b0306.com", true },
- { "b0307.com", true },
- { "b0309.com", true },
- { "b03aa.com", true },
- { "b03bb.com", true },
- { "b03cc.com", true },
- { "b0hr.ai", true },
- { "b0k.org", true },
- { "b0rk.com", true },
- { "b1111.co", true },
- { "b131000.com", true },
- { "b1788.net", true },
- { "b1c1l1.com", true },
- { "b1nzy-pinged.me", true },
- { "b2bmuzikbank.com", true },
- { "b303.me", true },
- { "b36594.com", true },
- { "b4bouncycastles.co.uk", true },
- { "b4ckbone.de", true },
- { "b4lint.hu", true },
- { "b4z.eu", true },
- { "b58365.com", true },
- { "b58app.com", true },
- { "b58appb58app.com", true },
- { "b58appb58appb58app.com", true },
- { "b68.xyz", true },
- { "b70771.com", true },
- { "b70772.com", true },
- { "b70773.com", true },
- { "b70774.com", true },
- { "b70775.com", true },
- { "b70881.com", true },
- { "b70882.com", true },
- { "b70883.com", true },
- { "b70884.com", true },
- { "b70885.com", true },
- { "b72.com", true },
- { "b72.net", true },
- { "b7306.com", true },
- { "b73app.com", true },
- { "b73bb.com", true },
- { "b73dd.com", true },
- { "b73ee.com", true },
- { "b73ff.com", true },
- { "b767.net", true },
- { "b77018.com", false },
- { "b789.co", true },
- { "b81818.com", true },
- { "b83.tv", true },
- { "b83aa.com", true },
- { "b83bb.com", true },
- { "b83cc.com", true },
- { "b83dd.com", true },
- { "b83ee.com", true },
- { "b83ff.com", true },
- { "b83gg.com", true },
- { "b83hh.com", true },
- { "b83ii.com", true },
- { "b83jj.com", true },
- { "b83kk.com", true },
- { "b86255.com", true },
- { "b889b.com", true },
- { "b88vip2.com", true },
- { "b88vip3.com", true },
- { "b88vip4.com", true },
- { "b88vip5.com", true },
- { "b89bb.com", true },
- { "b89cc.com", true },
- { "b89dd.com", true },
- { "b89ee.com", true },
- { "b89ff.com", true },
- { "b89gg.com", true },
- { "b89hh.com", true },
- { "b89jj.com", true },
- { "b8a.me", true },
- { "b960.com", true },
- { "b9618.com", true },
- { "b979333.com", true },
- { "b979555.com", true },
- { "b979666.com", true },
- { "b979999.com", true },
- { "b99011.com", true },
- { "b99022.com", true },
- { "b99118.com", true },
- { "b99218.com", true },
- { "b99318.com", true },
- { "b99418.com", true },
- { "b99518.com", true },
- { "b99618.com", true },
- { "b99718.com", true },
- { "b99818.com", true },
- { "b99918.com", true },
- { "b9999ff.com", true },
- { "b9999hh.com", true },
- { "b9999ii.com", true },
- { "b9999jj.com", true },
- { "b9999ll.com", true },
- { "b9999mm.com", true },
- { "b9999nn.com", true },
- { "b9999pp.com", true },
- { "b9999qq.com", true },
- { "b9999ww.com", true },
- { "b9999zz.com", true },
- { "b99iosapp.com", true },
- { "ba47.net", true },
- { "baac-dewellmed.com", true },
- { "baalsworld.de", true },
- { "baanpingchan.com", true },
- { "baas-becking.biology.utah.edu", true },
- { "baazee.de", true },
- { "babacasino.net", true },
- { "babai.ru", true },
- { "babblenotes.com", true },
- { "babeleo.com", true },
- { "babounet.com", true },
- { "babsbibs.com", true },
- { "baby-bath-tub.com", true },
- { "baby-digne.com", false },
- { "babyboom.pl", true },
- { "babybuddah.ga", true },
- { "babycamapp.com", true },
- { "babyfotograf-schweiz.ch", true },
- { "babymasaze.cz", true },
- { "babyphototime.com", true },
- { "babypibu.com", true },
- { "bacanora.tk", true },
- { "bachata.info", true },
- { "baches-piscines.com", true },
- { "bachmannyachts.com", true },
- { "bachmatt-baar.ch", true },
- { "bachweid-baar.ch", true },
- { "baciu.ch", false },
- { "backeby.eu", true },
- { "background-checks-systems.com", true },
- { "background-checks.asia", true },
- { "background-checks.biz", true },
- { "background-checks.mobi", true },
- { "backgroundchecks.online", true },
- { "backgroundscreenersofamerica.com", true },
- { "backmitra.com", true },
- { "backmitra.mx", true },
- { "backmitra.nl", true },
- { "backmountaingas.com", true },
- { "backpacker.dating", true },
- { "backscattering.de", false },
- { "backschues.com", true },
- { "backschues.de", true },
- { "backschues.net", true },
- { "backseatbandits.com", true },
- { "backsideverbier.ch", false },
- { "backterris.com", true },
- { "backtest.org", true },
- { "backup-kurumsal.com", true },
- { "backupassist.de", true },
- { "backupcloud.ru", true },
- { "bacon-monitoring.org", true },
- { "baconismagic.ca", true },
- { "bacontreeconsulting.com", true },
- { "bacsmegye.hu", true },
- { "bactrim-antibiotic.ml", true },
- { "bacula.jp", true },
- { "bad.pet", true },
- { "badam.co", true },
- { "badanka.com", true },
- { "badanteinfamiglia.it", true },
- { "badaparda.com", true },
- { "badblock.fr", true },
- { "badcreditcarsfinance.co.uk", true },
- { "badedesign.no", true },
- { "badf00d.de", true },
- { "badgersystems.de", true },
- { "badges.fedoraproject.org", true },
- { "badges.stg.fedoraproject.org", true },
- { "badgirlsbible.com", true },
- { "badgr.io", true },
- { "badhusky.com", false },
- { "badkamermarkt.nl", true },
- { "badmania.fr", true },
- { "badmintonadvisor.com", true },
- { "badmintonbible.com", true },
- { "badodds.ga", true },
- { "badoo.com", true },
- { "badoo.de", true },
- { "badoo.eu", true },
- { "badoo.us", true },
- { "badrequest.me", true },
- { "badseacoffee.com", true },
- { "baeder-luboss.de", true },
- { "baer.im", true },
- { "baer.one", true },
- { "baer.space", true },
- { "bag.bg", true },
- { "bageez.us", true },
- { "bagelcraft.net", true },
- { "bageluncle.com", true },
- { "baggy.me.uk", true },
- { "bagheera.me.uk", true },
- { "baglu.com", false },
- { "bagnichimici.roma.it", true },
- { "bagsofbounce.co.uk", true },
- { "bagspecialist.nl", true },
- { "bagwrap.com", true },
- { "bah.im", false },
- { "bahaiprayers.io", true },
- { "bahana.net", true },
- { "bahnbonus-praemienwelt.de", true },
- { "bahnenimbild.de", true },
- { "bahnenimbild.eu", true },
- { "bahnhelden.de", true },
- { "bahninrotweissrot.at", true },
- { "bahnmagazine.de", true },
- { "bahrevaran.ir", true },
- { "baifubao.com", true },
- { "baiker.info", true },
- { "baildonbouncycastles.co.uk", true },
- { "baileebee.com", true },
- { "baileybae.com", true },
- { "bailleux.be", true },
- { "bailonga.com", true },
- { "baitcon.com", true },
- { "baiyu.blog", true },
- { "baiyu.me", true },
- { "baka-gamer.net", true },
- { "baka.net", true },
- { "baka.org.cn", true },
- { "bakermen.com", true },
- { "bakersafari.co", true },
- { "bakersfieldhomeoffer.com", true },
- { "bakerviewdentalcentre.com", true },
- { "bakeup.be", true },
- { "bakibal.com", true },
- { "bakingstone.com", true },
- { "bakkerinjebuurt.be", true },
- { "bakongcondo.com", true },
- { "balade-commune.ch", false },
- { "baladecommune.ch", false },
- { "balafon.cloud", true },
- { "balaganlimited.cf", true },
- { "balancascia.com.br", true },
- { "balance7.jp", true },
- { "balanceado.com", true },
- { "balancedbrawl.net", true },
- { "balancenaturalhealthclinic.ca", true },
- { "balaskas.gr", true },
- { "balboa.io", true },
- { "balboa.org.uk", true },
- { "balcaonet.com.br", true },
- { "balcarek.pl", true },
- { "balconnr.com", true },
- { "balconsverdun.com", false },
- { "baleen.us", true },
- { "balia.de", true },
- { "balicekzdravi.cz", false },
- { "balikonos.cz", true },
- { "balinese.dating", true },
- { "balist.es", true },
- { "balivillassanur.com", true },
- { "balkancrystals.com", true },
- { "balkonien.org", true },
- { "ball-bizarr.de", true },
- { "ball3d.es", true },
- { "ballarin.cc", true },
- { "ballast.tk", true },
- { "ballejaune.com", true },
- { "balletcenterofhouston.com", true },
- { "ballmerpeak.org", true },
- { "ballonsportclub-erlangen.de", true },
- { "ballotapi.com", true },
- { "ballothero.com", true },
- { "ballparkbuns.com", false },
- { "ballroom.info", true },
- { "balmeo.co.uk", true },
- { "balmofgilead.org.uk", true },
- { "baloch-intelligence.tk", true },
- { "balsamaiso.es", true },
- { "balslev.io", true },
- { "balter.com", true },
- { "balticer.de", true },
- { "balticmed.pl", true },
- { "balticnetworks.com", true },
- { "baltimorecashflow.com", true },
- { "bamahammer.com", true },
- { "bamanshop.com", true },
- { "bamboorelay.com", true },
- { "bambumania.com.br", true },
- { "bamily.rocks", true },
- { "bamtoki.com", true },
- { "ban.moe", true },
- { "bananabandy.com", true },
- { "bananacloud.fr", true },
- { "banananet.work", true },
- { "bananice.moe", true },
- { "bancacrs.it", true },
- { "bancastato.ch", true },
- { "bancobai.ao", true },
- { "bancoctt.pt", true },
- { "bancomap.ch", true },
- { "bancor.network", true },
- { "bancosdominicanos.net", true },
- { "bandagastrica.es", true },
- { "bandeira1.com.br", true },
- { "bandeiraimoveisitu.com.br", true },
- { "bandeirasnacionais.com", true },
- { "banderas-mundo.es", true },
- { "bandiere-mondo.it", true },
- { "bandiga.it", true },
- { "bandito.re", true },
- { "baneh-academic.com", true },
- { "banes.ch", true },
- { "bangdream.ga", true },
- { "bangkok-dark-night.com", true },
- { "bangkok.dating", true },
- { "bangkokcity.de", true },
- { "bangkokcookingclass.com", true },
- { "banglarfont.com", true },
- { "banglets.com", true },
- { "bangorfederal.com", true },
- { "banguilacoquette.com", true },
- { "bangumi.co", true },
- { "bangyu.wang", true },
- { "banham.co.uk", false },
- { "banham.com", true },
- { "banjostringiz.com", true },
- { "bank-yahav.co.il", true },
- { "bank.barclays.co.uk", true },
- { "bank.simple.com", false },
- { "banka.space", true },
- { "bankanswers.gov", true },
- { "bankapp.se", true },
- { "bankbranchlocator.com", true },
- { "bankcardoffer.com", true },
- { "bankcircle.co.in", true },
- { "bankee.us", true },
- { "banketbesteld.nl", true },
- { "bankheadvegetables.com", true },
- { "bankin.com", true },
- { "bankinter.pt", true },
- { "bankio.se", true },
- { "banknet.gov", true },
- { "bankofdenton.com", true },
- { "bankpolicies.com", true },
- { "bankruptcy.ky", true },
- { "banksaround.com", true },
- { "banksiaparkcottages.com.au", true },
- { "bankstownapartments.com.au", true },
- { "bankvanbreda.be", true },
- { "banned-bitches.tk", true },
- { "bannermarquees.ie", true },
- { "bannsecurity.com", true },
- { "banquevanbreda.be", true },
- { "bantaihost.com", true },
- { "baofengtech.com", true },
- { "baokhangfood.com", true },
- { "baopublishing.it", true },
- { "baptisteplanckaert.tk", true },
- { "bar-harcourt.com", true },
- { "bar.pl", true },
- { "barabrume.fr", true },
- { "barakayu.com", true },
- { "barans2239.com", true },
- { "baranyavar.hu", true },
- { "barao.tk", true },
- { "baravalle.com", true },
- { "baraxolka.ru", true },
- { "barbaderespeito.com.br", true },
- { "barbara-fuchs-gruene-fuerth.de", true },
- { "barbarabowersrealty.com", true },
- { "barbarafabbri.com", true },
- { "barbarafeldman.com", true },
- { "barbarians.com", false },
- { "barbate.fr", true },
- { "barbe-n-blues.fr", true },
- { "barbiere.it", true },
- { "barbu.family", true },
- { "barburas.com", true },
- { "barca-movie.jp", true },
- { "barcamp.koeln", true },
- { "barcel.com.mx", true },
- { "barcelonabagels.cat", true },
- { "barcelonapremium.es", true },
- { "barcelonapremiummini.es", true },
- { "barcelonawinewalk.com", true },
- { "barclays.net", true },
- { "barcoderealty.com", true },
- { "bardes.org", true },
- { "bardiharborow.com", true },
- { "bardiharborow.tk", true },
- { "baresquare.com", true },
- { "barganhanaweb.ml", true },
- { "bariatrica.es", true },
- { "bariatricsurgerysmg.com", true },
- { "bariseau-mottrie.be", false },
- { "barisi.me", true },
- { "baristador.com", true },
- { "barkerjr.xyz", true },
- { "barlotta.net", true },
- { "barnel.com", true },
- { "barnettville.com", true },
- { "barneveldcentrum.nl", true },
- { "barneydavey.com", true },
- { "barnflix.net", true },
- { "barnfotografistockholm.se", true },
- { "barnhardt4berks.com", true },
- { "barnvets.co.uk", true },
- { "baroloboys.de", true },
- { "baron14.be", true },
- { "baronspices.com", true },
- { "barpodsosnami.pl", true },
- { "barracuda.com.tr", true },
- { "barrera.io", true },
- { "barriofut.com", true },
- { "barrydenicola.com", true },
- { "bars.kh.ua", true },
- { "barsashop.com.br", true },
- { "barsgroup.com", true },
- { "bart-f.com", true },
- { "barta.me", true },
- { "bartbania.com", true },
- { "bartelt.name", true },
- { "barter4crypto.com", true },
- { "barth.services", true },
- { "bartkramer.nl", false },
- { "bartlamboo.nl", true },
- { "bartolomebellido.com", true },
- { "bartula.de", true },
- { "bartzutow.xyz", true },
- { "baruch.me", true },
- { "bas.co.jp", true },
- { "bascht.com", true },
- { "base-autonome-durable.com", false },
- { "basebalance.net", true },
- { "baseballrampage.com", true },
- { "baseballsavings.com", true },
- { "baseballwarehouse.com", true },
- { "baseconvert.com", true },
- { "baseerapp.com", true },
- { "baselang.com", true },
- { "basement961.co.nz", true },
- { "basementdoctornorthwest.com", true },
- { "basementfinishingohio.com", true },
- { "basementwaterproofingdesmoines.com", true },
- { "baserverz.ga", true },
- { "baseweb.design", true },
- { "bashing-battlecats.com", true },
- { "bashkirlife.tk", true },
- { "bashstreetband.co.uk", true },
- { "basicamente.digital", true },
- { "basicapparel.de", true },
- { "basicattentiontoken.org", true },
- { "basics.net", true },
- { "basketball-brannenburg.de", true },
- { "basketforex.com", true },
- { "basnoslovno.ru", true },
- { "basonlinemarketing.nl", true },
- { "basradio.tk", true },
- { "bass-pro.ru", true },
- { "bassblog.net", true },
- { "bassment.ph", true },
- { "bassresource.com", true },
- { "bassrhymeposse.tk", true },
- { "bassrider.eu", true },
- { "bassys.com.co", true },
- { "bastelzauberwelt.de", true },
- { "bastide-viens.com", true },
- { "bastolino.de", true },
- { "basw.eu", true },
- { "baswag.de", true },
- { "baswetter.photography", true },
- { "basyspro.net", true },
- { "batcave.tech", true },
- { "batch.com", true },
- { "batch.engineering", true },
- { "baterioverolety.cz", true },
- { "bati-alu.fr", true },
- { "batiburrillo.net", true },
- { "batipresta.ch", false },
- { "batiskaf.ua", true },
- { "batistareisfloresonline.com.br", true },
- { "batitrakya.org", true },
- { "batlab.ch", false },
- { "batolis.com", true },
- { "batook.org", true },
- { "batteryboys.ca", true },
- { "batteryboys.com", true },
- { "batterystaple.pw", true },
- { "battle-game.com", true },
- { "battleboxx.com", false },
- { "battleground.com.au", true },
- { "battleguard.net", true },
- { "batuhanbensoy.com.tr", true },
- { "bauer.network", false },
- { "bauernmarkt-fernitz.at", true },
- { "baufi24.de", true },
- { "baugeldspezi.de", true },
- { "baugelitt.eu", true },
- { "baugemeinschaftbernstein.de", true },
- { "bauingenieur24.de", true },
- { "baumannfabrice.com", true },
- { "baumkuchen-aus-dresden.de", true },
- { "baur.de", true },
- { "bausep.de", true },
- { "bauthier-occasions.be", false },
- { "bautied.de", true },
- { "bauunternehmen-herr.de", true },
- { "bavarianhiker.de", true },
- { "bavaroparadise.com", true },
- { "bavarovillage.com", true },
- { "bavartec.de", true },
- { "bawbby.com", true },
- { "bayareaenergyevents.com", true },
- { "baychimo.com", true },
- { "bayden.com", true },
- { "bayer-stefan.com", true },
- { "bayer-stefan.de", true },
- { "bayerhazard.de", true },
- { "bayerstefan.com", true },
- { "bayerstefan.de", true },
- { "bayerstefan.eu", true },
- { "bayherbalist.com", true },
- { "bayilelakiku.com", true },
- { "bayltd.com", true },
- { "bayly.eu", true },
- { "baymard.com", true },
- { "bayoleth.com", true },
- { "bayportbotswana.com", true },
- { "bayportghana.com", true },
- { "bayporttanzania.com", true },
- { "bayportuganda.com", true },
- { "baypromoteam.co.uk", true },
- { "bayraklar.info", true },
- { "baystreet.com.mt", true },
- { "baytalebaa.com", true },
- { "baytownent.com", true },
- { "baywatch.io", true },
- { "bayz.de", true },
- { "baza-gai.com.ua", true },
- { "bazaarbhaav.com", true },
- { "bazaarcompass.com", true },
- { "bazari.com.pl", true },
- { "bazinga-events.nl", true },
- { "bazos.at", true },
- { "bazos.cz", true },
- { "bazos.pl", true },
- { "bazos.sk", true },
- { "bazziergraphik.com", true },
- { "bb057.com", true },
- { "bb087.com", true },
- { "bb168.cc", true },
- { "bb882.com", true },
- { "bbalposticino.it", true },
- { "bbbff.net", true },
- { "bbc67.fr", true },
- { "bbcastles.com", true },
- { "bbcomcdn.com", true },
- { "bbgeschenke.ch", false },
- { "bbimarketing.com", true },
- { "bbinsure.com", true },
- { "bbka.org.uk", true },
- { "bbkworldwide.jp", true },
- { "bbld.de", true },
- { "bblove.me", true },
- { "bblsa.ch", false },
- { "bbnx.net", true },
- { "bbs8080.net", true },
- { "bbsec.xyz", true },
- { "bbuio.com", false },
- { "bbw.dating", true },
- { "bbwcs.co.uk", true },
- { "bbyouthco.com", true },
- { "bc-bd.org", false },
- { "bc-diffusion.com", true },
- { "bcansw.com.au", true },
- { "bcbulle.ch", false },
- { "bcdiesel.ca", true },
- { "bcdonadio.com", true },
- { "bcdonadio.com.br", true },
- { "bcdonadio.org", true },
- { "bceventhire.co.uk", true },
- { "bch7al.ma", false },
- { "bchep.com", true },
- { "bck-koethen.de", true },
- { "bck-lelystad.nl", true },
- { "bckaccompressoroz.com", true },
- { "bclogandtimberbuilders.com", true },
- { "bclrk.us", true },
- { "bcmainland.ca", true },
- { "bcmguide.com", true },
- { "bcmhire.co.uk", true },
- { "bcrook.com", true },
- { "bcswampcabins.com", true },
- { "bd-media.tk", true },
- { "bd2positivo.com", true },
- { "bda-boulevarddesairs.com", false },
- { "bdbxml.net", true },
- { "bdd.fi", true },
- { "bdikaros-network.net", true },
- { "bdpestsolutionsstlouis.com", true },
- { "bdtopshop.com", true },
- { "be-a-password.ninja", true },
- { "be-ka-tec.de", true },
- { "be-real.life", false },
- { "be-up-developpement.com", true },
- { "be-webdesign.com", true },
- { "be.search.yahoo.com", false },
- { "be2cloud.de", true },
- { "be4lead.com", true },
- { "bea.gov", true },
- { "beacham.online", true },
- { "beachcitycastles.com", true },
- { "beachmarketing.co.uk", true },
- { "beachpoint.tk", true },
- { "beadare.com", true },
- { "beadare.nl", true },
- { "beaglesecurity.com", true },
- { "bealpha.pl", true },
- { "beambdi.com", true },
- { "beanbagaa.com", true },
- { "beanilla.com", true },
- { "beanjuice.me", true },
- { "beansgalore.com.au", true },
- { "bearcms.com", true },
- { "bearded.sexy", true },
- { "beardic.cn", true },
- { "beardsome.me", true },
- { "beargoggleson.com", true },
- { "bearingworks.com", true },
- { "bearlakelife.com", true },
- { "beastiejob.com", true },
- { "beastowner.li", true },
- { "beatfeld.de", true },
- { "beatnikbreaks.com", true },
- { "beatrice-nightscout.herokuapp.com", true },
- { "beatrice-raws.org", true },
- { "beatrizaebischer.ch", false },
- { "beatuprobot.net", true },
- { "beau.pw", true },
- { "beaumelcosmetiques.fr", true },
- { "beaute-eternelle.ch", false },
- { "beauty-expert.co", true },
- { "beauty-form.ir", true },
- { "beauty-italy.ru", true },
- { "beauty24.de", true },
- { "beautyandfashionadvice.com", true },
- { "beautybear.dk", true },
- { "beautybh.com", true },
- { "beautycarepack.com.ng", true },
- { "beautyevent.fr", true },
- { "beautyinweb.net", true },
- { "beautykat.ru", true },
- { "beautyseasons.ru", true },
- { "beaver-creek.ga", true },
- { "beaverdamautos.com", true },
- { "beavertales.ca", true },
- { "bebe2luxe.es", true },
- { "bebe2luxe.fr", true },
- { "bebef.de", true },
- { "bebefofuxo.com.br", true },
- { "bebes.uno", true },
- { "bebest.gov", false },
- { "beboldpr.com", true },
- { "beckenhamcastles.co.uk", true },
- { "beckerantiques.com", true },
- { "beckijayes.family", true },
- { "beckyhirstconsulting.com.au", true },
- { "becleverwithyourcash.com", true },
- { "become-lucky.com", true },
- { "becomeabricklayer.com.au", true },
- { "becquerelgroup.com", true },
- { "becs.ch", false },
- { "becydog.cz", true },
- { "bedamedia.com", true },
- { "bedandbreakfast.dk", true },
- { "bedandbreakfasteuropa.com", true },
- { "bedandbreakfasthoekvanholland.com", true },
- { "beddentotaal.nl", true },
- { "bedels.nl", true },
- { "bednar.co", true },
- { "bedrocklinux.org", true },
- { "bedste10.dk", true },
- { "bee-creative.nl", true },
- { "bee-line.org.uk", true },
- { "bee-removal-dublin.com", true },
- { "beehive.govt.nz", true },
- { "beehive42.com", true },
- { "beehive42.eu", true },
- { "beehive42.net", true },
- { "beehive42.nl", true },
- { "beehive42.org", true },
- { "beehosting.pro", true },
- { "beeksnetwork.nl", true },
- { "beelen.fr", true },
- { "beelit.com", true },
- { "beeming.net", true },
- { "beer9.com", true },
- { "beercandle.com", true },
- { "beercast.co.uk", true },
- { "beeremovalspretoria.co.za", true },
- { "beergazetteer.com", true },
- { "beerians.com", true },
- { "beerjet.bg", true },
- { "beerjet.cz", true },
- { "beerjet.ro", true },
- { "beerjet.sk", true },
- { "beerjetcz.cz", true },
- { "beerly.eu", true },
- { "beers.my", true },
- { "beersconf.com", true },
- { "beestation13.com", true },
- { "beeswarmrehoming.com.au", true },
- { "beeswax-orgone.com", true },
- { "beethoveninlove.com", true },
- { "beetman.net", true },
- { "beeutifulparties.co.uk", true },
- { "beexfit.com", false },
- { "beezkneezcastles.co.uk", true },
- { "beeznest.com", true },
- { "befoodsafe.gov", true },
- { "beforesunrise.de", true },
- { "beforeyoueatoc.com", true },
- { "beframed.ch", false },
- { "befreewifi.info", true },
- { "befundonline.de", true },
- { "begabungsfoerderung.info", true },
- { "begbie.com", true },
- { "beginner.nl", true },
- { "begintravel.co.th", true },
- { "beginwp.top", true },
- { "behamepresrdce.sk", true },
- { "behamzdarma.cz", true },
- { "behar-selimi.tk", true },
- { "behead.de", true },
- { "beherit.pl", true },
- { "behindertenagentur.de", true },
- { "behna24hodin.cz", true },
- { "behoerden-online-dienste.de", true },
- { "behoreal.cz", true },
- { "bei18.com", true },
- { "beichtgenerator.de", true },
- { "beijesweb.nl", true },
- { "beijing.dating", true },
- { "beijinglug.club", true },
- { "beimchristoph.de", true },
- { "beinad.com", true },
- { "beinad.ru", true },
- { "beisance.com", true },
- { "bejarano.io", true },
- { "bekolite.com", true },
- { "belacapa.com.br", true },
- { "belanglos.de", true },
- { "belani.eu", true },
- { "belanja.express", true },
- { "belarto.be", true },
- { "belarto.de", true },
- { "belarto.es", true },
- { "belarto.fr", true },
- { "belarto.it", true },
- { "belarto.nl", true },
- { "belarto.pl", true },
- { "belastingmiddeling.nl", true },
- { "belavis.com", true },
- { "belebey.city", true },
- { "beleggingspanden-financiering.nl", true },
- { "belegit.org", true },
- { "belezashopping.com.br", true },
- { "belfastbounce.co.uk", true },
- { "belfastlocks.com", true },
- { "belfasttechservices.co.uk", true },
- { "belfor-probleme.de", true },
- { "belfordroxo.net.br", true },
- { "belge.rs", true },
- { "belgers.com", true },
- { "belgicaservices.be", true },
- { "belgraver.email", true },
- { "belgraver.eu", true },
- { "belgraver.xyz", true },
- { "belhopro.be", true },
- { "belics.com", true },
- { "belien-tweedehandswagens.be", false },
- { "believablebook.com", false },
- { "believersweb.org", true },
- { "bell.id.au", true },
- { "bella.network", true },
- { "bellaklein.de", true },
- { "bellamodeling.com", true },
- { "bellebakes.blog", true },
- { "bellevueowners.tk", true },
- { "bellezzasenzalimiti.it", true },
- { "bellinghamdetailandglass.com", true },
- { "belloy.ch", false },
- { "belloy.net", false },
- { "bellware.io", false },
- { "belly-button-piercings.com", true },
- { "bellyandbrain.amsterdam", true },
- { "belmontgoessolar.org", true },
- { "belos.at", true },
- { "belouga.org", true },
- { "belquant.cf", true },
- { "beltar.nl", true },
- { "belvoirbouncycastles.co.uk", true },
- { "bembee.tk", true },
- { "bemcorp.de", true },
- { "bemindly.com", true },
- { "bemsoft.pl", true },
- { "ben-energy.com", false },
- { "ben2.co.il", true },
- { "benabrams.it", true },
- { "benary.org", true },
- { "benatherton.com", true },
- { "benazir-reaction.tk", true },
- { "benbalter.com", true },
- { "benbozsa.ca", true },
- { "benc.io", true },
- { "benceskorka.com", true },
- { "benchling.com", true },
- { "benchmarkmonument.com", true },
- { "benchstoolo.com", true },
- { "bencorby.com", true },
- { "bendemaree.com", true },
- { "bendingtheending.com", true },
- { "bendix.co", true },
- { "bendostore.com", true },
- { "bendyworks.com", true },
- { "beneathvt.com", true },
- { "benedict-balzer.de", true },
- { "benediktgeissler.de", true },
- { "benefits.gov", true },
- { "benefitshub.io", true },
- { "benefitshub.xyz", true },
- { "benepiscinas.com.br", true },
- { "beneri.se", true },
- { "benetcasablancas.tk", true },
- { "benewpro.com", true },
- { "bengalurugifts.com", true },
- { "bengisureklam.com", true },
- { "benhaney.com", true },
- { "benhartmann.de", true },
- { "benhavenarchives.org", true },
- { "benjamin-hering.com", true },
- { "benjamin-mary.herokuapp.com", true },
- { "benjamin.pe", true },
- { "benjaminblack.net", true },
- { "benjamindietrich.com", true },
- { "benjamindietrich.de", true },
- { "benjaminjurke.com", true },
- { "benjaminkopelke.com", true },
- { "benjamins.com", true },
- { "benjaminvasel.de", true },
- { "benjii.me", true },
- { "benjijaldoner.nl", true },
- { "benmatthews.com.au", true },
- { "benmillett.us", false },
- { "bennettsbouncycastlehire.co.uk", true },
- { "bennettshire.co.uk", true },
- { "benni1.eu", true },
- { "bennierobinson.com", true },
- { "benno.frl", true },
- { "bennygommers.nl", true },
- { "benriya.shiga.jp", true },
- { "bensbouncycastles.co.uk", true },
- { "benschnarr.com", true },
- { "benscobie.com", true },
- { "benshoof.org", true },
- { "bensinflatables.co.uk", true },
- { "bensokol.com", true },
- { "bensoy.com", true },
- { "benstevinson.com", true },
- { "bentertain.de", true },
- { "bentinata.com", true },
- { "bentley.blog", true },
- { "bentley.link", true },
- { "bentongroup.co.uk", true },
- { "bentonweatherstone.co.uk", true },
- { "bentrask.com", true },
- { "benu.cz", true },
- { "benvds.com", true },
- { "benz-hikaku.com", true },
- { "benzi.io", true },
- { "benzina.cn", true },
- { "beoordelingen.be", true },
- { "bepayd.com", true },
- { "bephoenix.org.uk", false },
- { "beplephan.com", true },
- { "bequ1ck.com", true },
- { "bequiia.com", true },
- { "beranovi.com", true },
- { "beraten-entwickeln-steuern.de", true },
- { "berati.tv", true },
- { "beratungswelt.dvag", true },
- { "berdu.id", true },
- { "bereaplumber.co.za", true },
- { "bereginy.com.ua", true },
- { "berend.tk", true },
- { "bergenhave.nl", true },
- { "berger-chiro.com", true },
- { "bergevoet-fa.nl", false },
- { "bergfex.at", true },
- { "bergfex.com", true },
- { "berglust-pur.de", true },
- { "bergmanbeachproperties.com", true },
- { "bergstoneware.com", true },
- { "berichtsheft-vorlage.de", true },
- { "berikod.ru", true },
- { "beritanow.tk", true },
- { "berkat-luqs.ddns.net", true },
- { "berksabstract.com", true },
- { "berksarl.org", true },
- { "berksnetworking.com", true },
- { "berlin-flirt.de", true },
- { "berlin.dating", true },
- { "bermeitinger.eu", true },
- { "bermytraq.bm", true },
- { "bernadetteanderes.ch", false },
- { "bernar.do", true },
- { "bernardcontainers.be", false },
- { "bernarddickens.com", true },
- { "bernardez-photo.com", true },
- { "bernardgo.com", true },
- { "bernardo.fm", true },
- { "bernat.ch", true },
- { "bernat.im", true },
- { "bernbrucher.com", true },
- { "bernbrucher.de", true },
- { "bernd-leitner-fotodesign.com", true },
- { "bernd-leitner-fotodesign.de", true },
- { "bernd-leitner.de", true },
- { "berndbousard.com", true },
- { "berndklaus.at", true },
- { "bernexskiclub.ch", true },
- { "bernhard-seidenspinner.de", true },
- { "bernhardkau.de", true },
- { "bernhardluginbuehl.ch", true },
- { "bernhardluginbuehl.com", true },
- { "bernieware.de", true },
- { "bernmail.ch", true },
- { "bernyweb.net", true },
- { "berra.se", true },
- { "berruezoabogados.com", true },
- { "berrus.com", true },
- { "berrypay.com", true },
- { "bersotavocats.fr", false },
- { "berst.cz", true },
- { "berthabailey.com", true },
- { "bertholdsson.com", true },
- { "bertold.org", true },
- { "bertoliniodontoiatria.it", true },
- { "bertrand.bio", true },
- { "bertrandkeller.info", true },
- { "bertsmithvwparts.com", true },
- { "beryl.net", true },
- { "bescoutednow.com", true },
- { "bescover.com", true },
- { "besensi.com", true },
- { "beserberg.tk", true },
- { "besole.ch", true },
- { "bespokebathrooms.com.au", true },
- { "bespokemortgages.co.uk", true },
- { "bespokestraps.com", true },
- { "best-accounting-schools.com", true },
- { "best-art-colleges.com", true },
- { "best-baptist-colleges.com", true },
- { "best-beauty-schools.com", true },
- { "best-book.gq", true },
- { "best-business-colleges.com", true },
- { "best-catholic-colleges.com", true },
- { "best-community-colleges.com", true },
- { "best-culinary-colleges.com", true },
- { "best-education-schools.com", true },
- { "best-engineering-colleges.com", true },
- { "best-essay-service.com", true },
- { "best-graduate-programs.com", true },
- { "best-hvac-schools.com", true },
- { "best-lutheran-colleges.com", true },
- { "best-management-schools.com", true },
- { "best-marketing-schools.com", true },
- { "best-music-colleges.com", true },
- { "best-nursing-colleges.com", true },
- { "best-pharmacy-schools.com", true },
- { "best-tickets.co.uk", true },
- { "best-trucking-schools.com", true },
- { "best-wallpaper.net", true },
- { "best10websitebuilders.com", true },
- { "best2pay.net", true },
- { "best66.me", true },
- { "bestattungen-kammerer.de", true },
- { "bestattungshaus-kammerer.de", true },
- { "bestautoinsurance.com", true },
- { "bestbatteriesonline.com", true },
- { "bestbefore.com", true },
- { "bestboot.cf", true },
- { "bestbrokerindia.com", true },
- { "bestbuyzone.com", true },
- { "bestbyte.com.br", true },
- { "bestcarscyprus.com", true },
- { "bestcivilattorneys.com", true },
- { "bestdating.today", true },
- { "bestdownloadscenter.com", true },
- { "bestechgadgets.tk", true },
- { "bestedeal.nl", true },
- { "bestehostingproviders.nl", true },
- { "bestessaycheap.com", true },
- { "bestessayhelp.com", true },
- { "bestfotostudio.com", true },
- { "bestfriendsequality.org", true },
- { "bestgearlist.com", true },
- { "bestgiftever.ca", true },
- { "besthemes.tk", true },
- { "besti.it", true },
- { "bestinbarter.com", true },
- { "bestinshowing.com", true },
- { "bestinver.es", false },
- { "bestjumptrampolines.be", true },
- { "bestkenmoredentists.com", true },
- { "bestmedsmmj.com", true },
- { "bestmotherfucking.website", true },
- { "bestofbooks.gq", true },
- { "bestoliveoils.com", true },
- { "bestpartyhire.com", true },
- { "bestpig.fr", true },
- { "bestplumbing.com", true },
- { "bestporngirls.com", true },
- { "bestpractice.domains", true },
- { "bestprint.vn", true },
- { "bestproductsaudit.com", true },
- { "bestroofbox.com", true },
- { "bestshoesmix.com", true },
- { "bestsingingbowls.com", true },
- { "besttrade.tk", true },
- { "bestwarezone.com", true },
- { "bestwebcams.ml", true },
- { "bestwebsite.gallery", true },
- { "bet01vip.com", true },
- { "bet02vip.com", true },
- { "bet03vip.com", true },
- { "bet04vip.com", true },
- { "bet05vip.com", true },
- { "bet062.com", true },
- { "bet064.com", true },
- { "bet074.com", true },
- { "bet10vip.com", true },
- { "bet261.com", true },
- { "bet290.com", true },
- { "bet333111.com", true },
- { "bet333123.com", true },
- { "bet333222.com", true },
- { "bet333345.com", true },
- { "bet333444.com", true },
- { "bet333456.com", true },
- { "bet333555.com", true },
- { "bet333567.com", true },
- { "bet333666.com", true },
- { "bet333678.com", true },
- { "bet333789.com", true },
- { "bet333999.com", true },
- { "bet333h.com", true },
- { "bet333i.com", true },
- { "bet333j.com", true },
- { "bet333k.com", true },
- { "bet333l.com", true },
- { "bet333n.com", true },
- { "bet333o.com", true },
- { "bet333p.com", true },
- { "bet333q.com", true },
- { "bet333r.com", true },
- { "bet333s.com", true },
- { "bet333t.com", true },
- { "bet333u.com", true },
- { "bet333v.com", true },
- { "bet333w.com", true },
- { "bet333x.com", true },
- { "bet333y.com", true },
- { "bet333z.com", true },
- { "bet3602.com", true },
- { "bet3607.com", true },
- { "bet3639.com", true },
- { "bet365cn-casino.com", true },
- { "bet365cn-game.com", true },
- { "bet365cn-keno.com", true },
- { "bet365cn-livecasino.com", true },
- { "bet365cn-poker.com", true },
- { "bet365cn-sports.com", true },
- { "bet365cn-vegas.com", true },
- { "bet365cnq.com", true },
- { "bet365cnr.com", true },
- { "bet365cns.com", true },
- { "bet365cnt.com", true },
- { "bet365cnu.com", true },
- { "bet365cnv.com", true },
- { "bet365cnw.com", true },
- { "bet365cnx.com", true },
- { "bet365cny.com", true },
- { "bet365cnz.com", true },
- { "bet365u.com", true },
- { "bet44401.com", true },
- { "bet44402.com", true },
- { "bet44403.com", true },
- { "bet44404.com", true },
- { "bet44405.com", true },
- { "bet44406.com", true },
- { "bet44407.com", true },
- { "bet44409.com", true },
- { "bet44410.com", true },
- { "bet444400.com", true },
- { "bet444401.com", true },
- { "bet444402.com", true },
- { "bet444403.com", true },
- { "bet444404.com", true },
- { "bet444405.com", true },
- { "bet444406.com", true },
- { "bet444407.com", true },
- { "bet444408.com", true },
- { "bet444409.com", true },
- { "bet444410.com", true },
- { "bet444421.com", true },
- { "bet444422.com", true },
- { "bet444423.com", true },
- { "bet444424.com", true },
- { "bet444425.com", true },
- { "bet444426.com", true },
- { "bet444427.com", true },
- { "bet444428.com", true },
- { "bet444429.com", true },
- { "bet444430.com", true },
- { "bet5678.cc", true },
- { "bet5678.com", true },
- { "bet5678a.com", true },
- { "bet5678b.com", true },
- { "bet5678c.com", true },
- { "bet5678e.com", true },
- { "bet5678f.com", true },
- { "bet5678g.com", true },
- { "bet599.com", true },
- { "bet66669999.com", true },
- { "bet666888.vip", true },
- { "bet721.com", true },
- { "bet819.com", true },
- { "bet820.com", true },
- { "betaal.my", true },
- { "betaclouds.net", true },
- { "betaprofiles.com", true },
- { "betaworx.de", true },
- { "betaworx.eu", true },
- { "betb73.com", true },
- { "betcn-mart.com", true },
- { "betecnet.de", true },
- { "bethanyduke.com", true },
- { "bethanypeds.com", true },
- { "betheredge.us", true },
- { "bethpage.net", true },
- { "beticalia.com", true },
- { "betimely.com", true },
- { "betmobilenigeria.com", true },
- { "betobaccofree.gov", true },
- { "betonbit.com", true },
- { "betonmarkets.info", true },
- { "betor.cz", true },
- { "betpamm.com", true },
- { "betrifft-mich-dsgvo.ch", true },
- { "bets.gg", true },
- { "betseybuckheit.com", true },
- { "betsharpangles.com", true },
- { "betshoot.com", true },
- { "betsyshilling.com", true },
- { "bett1.de", true },
- { "bettaline.com.au", true },
- { "bettashoerepairs.com.au", true },
- { "better-bounce.co.uk", true },
- { "better.fyi", true },
- { "bettercareclinic.co.uk", true },
- { "bettercleaningcompany.co.uk", true },
- { "betterconsult.com", true },
- { "bettercrypto.org", true },
- { "betterna.me", true },
- { "betterscience.org", true },
- { "bettersecurity.co", true },
- { "betterselfbetterworld.cz", true },
- { "bettersocialmedia.co.uk", true },
- { "bettertechinterviews.com", true },
- { "bettertest.it", true },
- { "bettertime.de", true },
- { "bettertime.jetzt", true },
- { "betterweb.fr", true },
- { "betterworldinternational.org", true },
- { "bettflaschen.ch", true },
- { "bettingbusiness.ru", true },
- { "bettingsider.dk", true },
- { "bettmer.at", true },
- { "bettmer.de", true },
- { "bettolinokitchen.com", true },
- { "bettrlifeapp.com", true },
- { "betty-baloo.com", true },
- { "bettyweber.com", true },
- { "betulashop.ch", true },
- { "betwalker.com", true },
- { "beulen.email", true },
- { "beulen.link", true },
- { "beulen.pro", true },
- { "beuteugeu.com", true },
- { "bevallarta.com", true },
- { "bevedo.cz", true },
- { "bevedo.sk", true },
- { "beveiligingscamerawestland.nl", true },
- { "bevelbeer.com", true },
- { "bevelpix.com", true },
- { "beverhof.nl", true },
- { "beverlyinternational.com", true },
- { "bevhills.com", true },
- { "bevinco2020.com", true },
- { "bevnut.com", true },
- { "bewegigsruum.ch", true },
- { "bewegtes-lagern.at", true },
- { "bewegtes-lagern.ch", true },
- { "bewegtes-lagern.com", true },
- { "bewegtes-lagern.de", true },
- { "bewegteslagern.ch", true },
- { "bewegteslagern.com", true },
- { "bewegteslagern.de", true },
- { "bewegungsfluss.com", false },
- { "bewerbungsfibel.de", true },
- { "bewertet.de", true },
- { "bewonderen.com", true },
- { "bexleycastles.co.uk", true },
- { "beybiz.com", true },
- { "beyerautomation.com", true },
- { "beyerm.de", true },
- { "beyond-infinity.org", false },
- { "beyondalderaan.net", true },
- { "beyondbounce.co.uk", true },
- { "beyondboxgifts.com", true },
- { "beyondordinarylife.com", true },
- { "beyondpricing.com", true },
- { "beyondtodaymediagroup.com", true },
- { "beyondweb.net", true },
- { "beyours.be", true },
- { "bez-energie.de", true },
- { "bezahlbare-praemien.ch", true },
- { "bezemkast.nl", true },
- { "bezlampowe.pl", true },
- { "bezlepkovamatka.cz", true },
- { "bezpecnostsiti.cf", true },
- { "bezposrednio.net.pl", true },
- { "bezzia.com", true },
- { "bf5.ru", true },
- { "bfam.tv", true },
- { "bfanis.ir", true },
- { "bfcgermania88.de", true },
- { "bfem.gov", true },
- { "bfh.science", true },
- { "bfkcloud.ddns.net", true },
- { "bfob.gg", true },
- { "bforb.sk", true },
- { "bfp-mail.de", true },
- { "bfpg.org", true },
- { "bfw-online.de", true },
- { "bgbaby.net", true },
- { "bgemi.net", true },
- { "bgfashion.net", true },
- { "bgfix.se", true },
- { "bgfoto.info", true },
- { "bghost.xyz", true },
- { "bgkoleda.bg", true },
- { "bglsingles.de", true },
- { "bgmn.me", true },
- { "bgp.space", true },
- { "bgr34.cz", true },
- { "bgs-game.com", true },
- { "bgtgames.com", true },
- { "bgtoyou.com", true },
- { "bguidinger.com", true },
- { "bh-oberland.de", true },
- { "bh.sb", true },
- { "bharath-g.in", true },
- { "bhat.vn", true },
- { "bhavansvidyamandir.tk", true },
- { "bhaweshkumar.com", true },
- { "bhglamour.com", true },
- { "bhi.consulting", true },
- { "bhodisoft.com", true },
- { "bhrenovations.com", true },
- { "bhserralheria.com.br", true },
- { "bhtelecom.ba", true },
- { "bhuntr.com", true },
- { "bhxch.moe", true },
- { "bhyn.ca", true },
- { "bi.search.yahoo.com", false },
- { "bi1gif.radio", true },
- { "bi5.me", true },
- { "bi8cku.club", true },
- { "bi8cku.tech", true },
- { "biaggeo.com", true },
- { "biancapulizie.it", true },
- { "biancazapatka.com", true },
- { "biano-ai.com", true },
- { "biapinheiro.com.br", true },
- { "biasmath.es", true },
- { "bibica.net", true },
- { "bible-maroc.com", true },
- { "biblesignposts.com", true },
- { "bibleversesfordailyliving.com", true },
- { "bibliaon.com", true },
- { "bibliatodo.com", true },
- { "biblioblog.fr", true },
- { "bibliobus.ch", true },
- { "bibliology.org", true },
- { "bibliomarkt.ch", true },
- { "biblionaut.net", true },
- { "biblionix.com", true },
- { "biblioporn.com", true },
- { "bibliotecadeseguranca.com.br", true },
- { "bibliotekarien.se", true },
- { "bibliotekasnow.org", true },
- { "bibliotherapie-existentiale.com", true },
- { "biboumail.fr", true },
- { "bibuch.com", true },
- { "bicecontracting.com", true },
- { "bicha.net", true },
- { "bicifanaticos.com", true },
- { "bicranial.io", true },
- { "bicycleframeiz.com", true },
- { "bicycleuniverse.com", true },
- { "biddl.com", true },
- { "biddle.co", true },
- { "bidman.cz", true },
- { "bidman.eu", true },
- { "bidu.com.br", true },
- { "bie08.com", true },
- { "bie35.com", true },
- { "bie79.com", true },
- { "biec.moe", true },
- { "biegal.ski", true },
- { "biegner-technik.de", true },
- { "biego.cn", true },
- { "biehlsoft.info", true },
- { "bielefailed.de", true },
- { "bien-etre-sante.info", true },
- { "bienestarfacial.com", true },
- { "bienhacerlimpiezas.es", true },
- { "bienici.com", true },
- { "bienoubien.org", true },
- { "bienstar.tv", true },
- { "bienvenidoamerica.com", true },
- { "bierbaumer.net", true },
- { "biergaizi.info", true },
- { "bierochs.org", true },
- { "bierwebshop.be", true },
- { "bieser.ch", true },
- { "biester.pro", true },
- { "bifm.de", true },
- { "bifrost.cz", true },
- { "big-andy.co.uk", true },
- { "big-bounce.co.uk", true },
- { "big-tits-video.ru", true },
- { "bigbank.ee", true },
- { "bigbendcoffeeroasters.com", true },
- { "bigbendguide.com", true },
- { "bigbluedoor.net", true },
- { "bigboris.tk", true },
- { "bigbouncebouncycastles.co.uk", true },
- { "bigbouncetheory.co.uk", true },
- { "bigbounceuk.com", true },
- { "bigcakes.dk", true },
- { "bigclassaction.com", true },
- { "bigdinosaur.org", true },
- { "bigdiscounts.tk", true },
- { "bigfatbetty.com", true },
- { "biggerpicture.agency", true },
- { "biggles.io", true },
- { "bighouse-events.co.uk", true },
- { "bigideasnetwork.com", true },
- { "bigio.com.br", true },
- { "biglou.com", false },
- { "bigorbitgallery.org", true },
- { "bigpicture-learning.com", true },
- { "bigprintinglasvegas.com", true },
- { "bigsam.us", true },
- { "bigserp.com", true },
- { "bigshopper.com", true },
- { "bigshopper.nl", true },
- { "bigsisterchannel.com", true },
- { "bigskylifestylerealestate.com", true },
- { "bigskymontanalandforsale.com", true },
- { "bihub.io", true },
- { "biilo.com", true },
- { "bijancompany.com", true },
- { "bijouxcherie.com", true },
- { "bijuteriicualint.ro", true },
- { "bike-kurse.ch", true },
- { "bike-shack.com", true },
- { "bikebristol.com", true },
- { "bikehistory.org", true },
- { "biker.dating", true },
- { "bikhof.com", true },
- { "bikiniseli.com", true },
- { "bikkelbroeders.com", false },
- { "bikkelbroeders.nl", false },
- { "bilalic.com", true },
- { "bilalkilic.de", true },
- { "bilbayt.com", true },
- { "bilder-designs.de", true },
- { "bildkomponist.de", true },
- { "bildschirmflackern.de", true },
- { "bildungshaus-arnach.de", true },
- { "biletvkrym.ga", true },
- { "biletyplus.by", true },
- { "biletyplus.ua", true },
- { "bilgo.com", true },
- { "bilibili.link", true },
- { "bilibili.red", true },
- { "bilibili.sh", true },
- { "bilimoe.com", true },
- { "bilke.org", true },
- { "billaud.eu.org", true },
- { "billcompare.ga", true },
- { "billfazz.com", true },
- { "billgoldstein.name", true },
- { "billgradywebdesign.com", true },
- { "billhartzer.com", true },
- { "billigastehemsidan.se", true },
- { "billiger-mietwagen.de", true },
- { "billigerfinder.de", true },
- { "billigesommerhuse.nu", true },
- { "billigpoker.dk", true },
- { "billin.net", true },
- { "billionaire365.com", true },
- { "billionairemailinglist.com", true },
- { "billkochman.com", true },
- { "billogr.am", true },
- { "billogram.be", true },
- { "billogram.ch", true },
- { "billogram.co", true },
- { "billogram.co.uk", true },
- { "billogram.com", true },
- { "billogram.de", true },
- { "billogram.es", true },
- { "billogram.eu", true },
- { "billogram.fi", true },
- { "billogram.fr", true },
- { "billogram.io", true },
- { "billogram.it", true },
- { "billogram.me", true },
- { "billogram.net", true },
- { "billogram.nl", true },
- { "billogram.nu", true },
- { "billogram.org", true },
- { "billogram.se", true },
- { "billogramcontent.com", true },
- { "billograminternal.com", true },
- { "billogramstatic.com", true },
- { "billogramtest.com", true },
- { "billopay.com", true },
- { "billopay.de", true },
- { "billopay.se", true },
- { "billpro.com", false },
- { "billy.pictures", true },
- { "billyoh.com", true },
- { "billysbouncycastlehire.co.uk", true },
- { "billywig.stream", true },
- { "biltullen.com", true },
- { "bim.physio", true },
- { "bimacitizen.com", true },
- { "bimbo.com", false },
- { "bimbo.com.ar", false },
- { "bimbobakeriesusa.com", false },
- { "bimibroccoli.co.uk", true },
- { "bimibroccoli.com", true },
- { "bimibroccoli.dk", true },
- { "bimibroccoli.it", true },
- { "bimibroccoli.nl", true },
- { "bimibroccoli.se", true },
- { "bimibrocoli.es", true },
- { "bimibrocoli.fr", true },
- { "bimibrokkoli.de", true },
- { "bimmerlabs.com", true },
- { "bin92.com", true },
- { "bin95.com", true },
- { "bina.az", true },
- { "binans.com", true },
- { "binans.com.tr", true },
- { "binans.net", true },
- { "binaries.fr", true },
- { "binary.house", true },
- { "binaryapparatus.com", true },
- { "binaryappdev.com", true },
- { "binarycreations.scot", true },
- { "binarydream.fi", true },
- { "binaryevolved.com", true },
- { "binaryrebel.net", true },
- { "binarystud.io", true },
- { "binding-problem.com", true },
- { "bing.com", true },
- { "bingobank.org", true },
- { "binhex.net", true },
- { "binhp.com", true },
- { "biniou.net", true },
- { "binkconsulting.be", true },
- { "binnenmeer.de", true },
- { "binoqlo.com", true },
- { "binsp.net", true },
- { "bintach.com", true },
- { "binti.com", true },
- { "bintooshoots.com", true },
- { "bio-disinfestazione.it", true },
- { "bio-feed.org", true },
- { "bio-place.com", true },
- { "bio24.si", true },
- { "bioastin.de", true },
- { "bioatelier.it", true },
- { "biobuttons.ch", true },
- { "biocheminee.com", true },
- { "biocrafting.net", true },
- { "biodiagnostiki.clinic", true },
- { "biodieseldata.com", true },
- { "biodots.at", true },
- { "biodots.eu", true },
- { "biodots.info", true },
- { "biodots.it", true },
- { "bioedilizia.roma.it", true },
- { "bioemprendiendo.com", true },
- { "bioemsan.cz", true },
- { "bioequivalence.design", true },
- { "bioetco.ch", true },
- { "bioexploratorium.pl", true },
- { "biofattorietoscane.it", true },
- { "biofrequenze.it", true },
- { "biogecho.ch", false },
- { "biogecho.swiss", false },
- { "biogeist.de", true },
- { "biogiardinaggio.it", true },
- { "biographywiki.net", true },
- { "biohappiness.com", true },
- { "bioharmony.ca", true },
- { "biointelligence-explosion.com", true },
- { "bioknowme.com", true },
- { "biol.moscow", true },
- { "biol.spb.ru", true },
- { "biolack.cf", true },
- { "bioleev.sklep.pl", true },
- { "bioligo.ch", false },
- { "biolmarket.ru", true },
- { "biologis.ch", true },
- { "biology-colleges.com", true },
- { "biomag.it", true },
- { "biomathalliance.org", true },
- { "biomed-hospital.ch", true },
- { "biomed.ch", true },
- { "biomin.co.uk", true },
- { "biomodra.cz", true },
- { "bionezis.com", true },
- { "bionicman.name", true },
- { "bionima.com", true },
- { "biopsychiatry.com", true },
- { "bioresonanz-ibiza.com", true },
- { "biosafe.ch", false },
- { "biosalts.it", true },
- { "biosbits.org", true },
- { "biosearch.tk", true },
- { "bioshine.com.sg", true },
- { "biosignalanalytics.com", true },
- { "biosphere.cc", true },
- { "biospw.com", true },
- { "biotechware.com", true },
- { "biotera.cl", true },
- { "biotin.ch", true },
- { "biowtage.gq", true },
- { "birbaumer.li", true },
- { "birchbarkfurniture.com", true },
- { "birchbarkfurniture.fr", true },
- { "birdbrowser.com", true },
- { "birdie.pt", true },
- { "birdiehosting.nl", true },
- { "birdslabel.com", true },
- { "birdymanbestreviews.com", true },
- { "birgerschwarz.de", false },
- { "birgit-rydlewski.de", true },
- { "birkenstab.de", true },
- { "birkenwasser.de", true },
- { "birminghamsunset.com", true },
- { "birthdaytip.com", true },
- { "birthmatters.us", true },
- { "birzan.org", true },
- { "bisa-sis.net", true },
- { "bischoff-mathey.family", true },
- { "biscuit.town", true },
- { "biscuitcute.com.br", true },
- { "biser-borisov.eu", true },
- { "biser.online", true },
- { "bishopp.com.au", true },
- { "bishopscourt-hawarden.co.uk", true },
- { "bishoptx.com", true },
- { "bismarck-tb.de", true },
- { "bisoga.xyz", true },
- { "bison.co", true },
- { "bisq.community", true },
- { "bisq.network", true },
- { "bistrocean.com", true },
- { "bistroservice.de", true },
- { "bistrotdelagare.fr", true },
- { "bit-cloud.de", true },
- { "bit-rapid.com", true },
- { "bit-sentinel.com", true },
- { "bit-service-aalter.be", true },
- { "bit.biz.tr", true },
- { "bit8.com", true },
- { "bitaccelerate.com", true },
- { "bitbank.cc", true },
- { "bitbeans.de", true },
- { "bitbox.me", true },
- { "bitbucket.com", true },
- { "bitbucket.io", true },
- { "bitbucket.org", true },
- { "bitburner.de", true },
- { "bitcoin-fauset.cf", true },
- { "bitcoin-india.net", true },
- { "bitcoin-wizards.com", true },
- { "bitcoin.asia", true },
- { "bitcoin.ch", true },
- { "bitcoin.co.nz", true },
- { "bitcoin.de", true },
- { "bitcoin.im", true },
- { "bitcoin.info", true },
- { "bitcoin.org", true },
- { "bitcoin.us", true },
- { "bitcoinbitcoin.com", true },
- { "bitcoinbot.tk", true },
- { "bitcoincasinos.pro", true },
- { "bitcoincore.org", true },
- { "bitcoiner-or-shitcoiner.com", true },
- { "bitcoinfees.net", true },
- { "bitcoingambling.pro", true },
- { "bitcoinindia.com", true },
- { "bitcoinrealestate.com.au", true },
- { "bitcointhefts.com", true },
- { "bitcoinx.ro", true },
- { "bitcork.io", true },
- { "bitcqr.io", true },
- { "bitenose.com", true },
- { "bitex.la", true },
- { "bitfasching.de", false },
- { "bitfehler.net", true },
- { "bitfinder.nl", true },
- { "bitfuse.net", true },
- { "bitgain-leverage.com", true },
- { "bitgo.com", true },
- { "bitgrapes.com", true },
- { "bitguerrilla.com", true },
- { "bithausen.io", true },
- { "bither.net", true },
- { "bithir.co.uk", true },
- { "bititrain.com", true },
- { "bitjunkiehosting.com", true },
- { "bitking-trading.com", true },
- { "bitlish.com", true },
- { "bitlo.com", true },
- { "bitlo.com.tr", true },
- { "bitlo.io", true },
- { "bitlo.org", true },
- { "bitmag.ml", true },
- { "bitmainwarranty.com", true },
- { "bitmarket.net", true },
- { "bitmarket.pl", true },
- { "bitmask.me", true },
- { "bitmessage.ch", true },
- { "bitmidi.com", true },
- { "bitminter.com", true },
- { "bitmoe.com", true },
- { "bitok.com", true },
- { "bitpumpe.net", true },
- { "bitref.com", true },
- { "bitrefill.com", true },
- { "bitrush.nl", true },
- { "bits-hr.de", true },
- { "bitsafe.com.my", true },
- { "bitsalt.com", true },
- { "bitski.com", true },
- { "bitskins.co", true },
- { "bitskrieg.net", true },
- { "bitso.com", true },
- { "bitsoffreedom.nl", true },
- { "bitstage.uk", true },
- { "bitstep.ca", true },
- { "bitstorm.nl", true },
- { "bitstorm.org", true },
- { "bitsy.com", true },
- { "bitsync.nl", true },
- { "bitten.pw", true },
- { "bittersweetcandybowl.com", true },
- { "bittylicious.com", true },
- { "bitvest.io", true },
- { "bitvps.com", true },
- { "bitwarden.com", true },
- { "bitwolk.nl", true },
- { "bitxel.com.co", false },
- { "biurokarier.edu.pl", true },
- { "biuropulawy.pl", true },
- { "bixbydevelopers.com", true },
- { "bixservice.com", true },
- { "biyori.moe", true },
- { "biyou-homme.com", true },
- { "biz-architect.com", true },
- { "biz-secrety.gq", true },
- { "biz-secrety.ml", true },
- { "biz-seecrets.gq", true },
- { "biz4x.com", true },
- { "bizcash.co.za", true },
- { "bizeau.ch", true },
- { "bizlatinhub.com", true },
- { "biznes-sekrety.gq", true },
- { "biznes-sekrety.tk", true },
- { "biznesinfo.pl", true },
- { "biznesonline.info", true },
- { "biznet.tk", true },
- { "bizniskatalog.mk", true },
- { "biznpro.ru", true },
- { "bizpare.com", true },
- { "bizpay.su", true },
- { "bizstarter.cz", true },
- { "biztera.com", true },
- { "biztok.eu", true },
- { "biztouch.work", true },
- { "bizzdesign.cloud", true },
- { "bizzdesign.com", true },
- { "bizzit.se", true },
- { "bjarnerest.de", true },
- { "bjl688.cc", true },
- { "bjoe2k4.de", true },
- { "bjolanta.pl", true },
- { "bjornhelmersson.se", true },
- { "bjornjohansen.no", true },
- { "bjs.com.au", true },
- { "bjs.gov", true },
- { "bjsbouncycastles.com", true },
- { "bjut.photos", true },
- { "bk-wife.com", true },
- { "bkentertainments.co.uk", true },
- { "bkhpilates.co.uk", true },
- { "bkkf.at", true },
- { "bkositspartytime.co.uk", true },
- { "bkt.to", true },
- { "bl00.se", true },
- { "bl4ckb0x.biz", true },
- { "bl4ckb0x.com", true },
- { "bl4ckb0x.de", true },
- { "bl4ckb0x.eu", true },
- { "bl4ckb0x.info", true },
- { "bl4ckb0x.net", true },
- { "bl4ckb0x.org", true },
- { "blaargh.com", true },
- { "blaauwgeers.pro", true },
- { "blaauwgeers.travel", true },
- { "blabber.im", true },
- { "blablacar.co.uk", true },
- { "blablacar.com.tr", true },
- { "blablacar.com.ua", true },
- { "blablacar.de", true },
- { "blablacar.es", true },
- { "blablacar.fr", true },
- { "blablacar.hr", true },
- { "blablacar.hu", true },
- { "blablacar.in", true },
- { "blablacar.it", true },
- { "blablacar.mx", true },
- { "blablacar.nl", true },
- { "blablacar.pl", true },
- { "blablacar.pt", true },
- { "blablacar.ro", true },
- { "blablacar.rs", true },
- { "blablacar.ru", true },
- { "black-gay-porn.biz", true },
- { "black-holes.org", true },
- { "black-mail.nl", true },
- { "black-raven.fr", true },
- { "black.dating", true },
- { "black.host", true },
- { "black1ce.com", true },
- { "blackandpony.de", true },
- { "blackbag.nl", true },
- { "blackbam.at", true },
- { "blackberryforums.be", true },
- { "blackbird-whitebird.com", true },
- { "blackboxconnections.com", true },
- { "blackcat.ca", true },
- { "blackcatinformatics.ca", true },
- { "blackcatinformatics.com", true },
- { "blackdiam.net", true },
- { "blackdown.de", true },
- { "blackdragoninc.org", true },
- { "blackedbyte.com", true },
- { "blackevent.be", true },
- { "blackfire.io", true },
- { "blackgamelp.de", true },
- { "blackgate.org", true },
- { "blackhat.dk", true },
- { "blackhawkup.com", true },
- { "blackhelicopters.net", true },
- { "blackhillsinfosec.com", true },
- { "blackhost.org", true },
- { "blackjackballroomcasino.info", true },
- { "blackl.net", true },
- { "blacklightparty.be", true },
- { "blackmagickwitch.com", true },
- { "blackmagicshaman.com", true },
- { "blackminds.tk", true },
- { "blackmonday.gr", true },
- { "blacknetwork.eu", true },
- { "blacknova.io", true },
- { "blackoutzone.tk", true },
- { "blackpapermoon.de", true },
- { "blackphoenix.de", true },
- { "blackroadphotography.de", true },
- { "blackroot.eu", true },
- { "blackscytheconsulting.com", true },
- { "blackseals.net", true },
- { "blackspark.tk", true },
- { "blackstrapsecurity.com", true },
- { "blackstump.xyz", true },
- { "blackteam.org", true },
- { "blacktown.eu", true },
- { "blacktownbuildingsupplies.com.au", true },
- { "blacktubes.cf", true },
- { "blackys-chamber.de", false },
- { "blackzebra.audio", true },
- { "blaindalefarms.com", true },
- { "blaise.io", true },
- { "blakecoin.org", true },
- { "blakekhan.com", true },
- { "blakezone.com", true },
- { "blanboom.org", true },
- { "blancodent.com", true },
- { "blanket.technology", true },
- { "blasorchester-runkel.de", true },
- { "blastentertainment.com.au", true },
- { "blastersklan.com", true },
- { "blaudev.es", true },
- { "blauerhunger.de", true },
- { "blaulicht-giessen.de", true },
- { "blaumedia.com", true },
- { "blautiefe.de", true },
- { "blauwwit.be", true },
- { "blayne.me", true },
- { "blayneallan.com", true },
- { "blazing.cz", true },
- { "blazor.nl", true },
- { "blblblblbl.fr", true },
- { "bleaching-tipps.de", true },
- { "blechbuexn.de", true },
- { "bleche-onlineshop.at", true },
- { "bleche-onlineshop.de", true },
- { "blechinger.io", true },
- { "blechschmidt.saarland", true },
- { "blenderinsider.com", true },
- { "blenderman.org", true },
- { "blenderrecipereviews.com", true },
- { "blending.kr", true },
- { "blendle.com", true },
- { "blendle.nl", true },
- { "blendr.com", true },
- { "blendstudios.com", false },
- { "blenheimears.com", true },
- { "blenneros.net", false },
- { "blessedgeeks.org", true },
- { "blessedgeeks.social", true },
- { "blessedguy.com", true },
- { "blewebprojects.com", true },
- { "blichmann.eu", true },
- { "blideobames.com", true },
- { "blidz.com", true },
- { "blieque.co.uk", true },
- { "blijfbij.com", true },
- { "blijfbij.eu", true },
- { "blikund.swedbank.se", true },
- { "blindpigandtheacorn.com", true },
- { "blinds.media", true },
- { "blingsparkleshine.com", true },
- { "blingwang.cn", true },
- { "blink-security.com", true },
- { "blinkdrivex.com", true },
- { "blinking.link", true },
- { "blio.tk", true },
- { "blip.website", true },
- { "blissjoe.com", true },
- { "blissplan.com", true },
- { "blivawesome.dk", true },
- { "blivvektor.dk", true },
- { "blizhost.com", true },
- { "blizhost.com.br", true },
- { "blkbx.eu", true },
- { "blm.gov", true },
- { "blm36.cc", true },
- { "blm69.cc", true },
- { "blo-melchiorshausen.de", true },
- { "blobemoji.com", true },
- { "blobfolio.com", true },
- { "blobs.gg", true },
- { "blocher.ch", true },
- { "blochoestergaard.com", true },
- { "block-this.com", true },
- { "block65.com", true },
- { "blockchain.com", true },
- { "blockchain.info", true },
- { "blockchainced.com", true },
- { "blockchaindaigakko.jp", true },
- { "blockchainmagazine.net", true },
- { "blockchainwhiz.com", true },
- { "blockclique.io", true },
- { "blockedyourcar.com", true },
- { "blockedyourcar.net", true },
- { "blockedyourcar.org", true },
- { "blockmetry.com", true },
- { "blockstream.com", true },
- { "blockxit.de", true },
- { "bloemenbesteld.nl", true },
- { "bloemendal.me", true },
- { "blog-garage.com", true },
- { "blog-grupom2.es", true },
- { "blog-investimenti.it", true },
- { "blog.gov.uk", true },
- { "blog.linode.com", false },
- { "blog.lookout.com", false },
- { "blog.torproject.org", false },
- { "blogaid.net", true },
- { "bloganchoi.com", true },
- { "blogaram.tk", true },
- { "blogarts.net", true },
- { "blogauto.cz", true },
- { "blogbooker.com", true },
- { "blogcosmeticsurgeon.ga", true },
- { "blogdefarmacia.com", true },
- { "blogdelosjuguetes.com", true },
- { "blogdieconomia.it", true },
- { "blogdimoda.com", true },
- { "blogdimotori.it", true },
- { "blogexpert.ca", true },
- { "bloggermumofthreeboys.com", true },
- { "blogging-life.com", true },
- { "bloggingtipsfornewblogger.com", true },
- { "bloggytalky.com", true },
- { "bloginbeeld.nl", true },
- { "blogit.fi", true },
- { "bloglyric.com", true },
- { "blognews.cf", true },
- { "blognone.com", true },
- { "blogofapps.com", true },
- { "blogom.at", true },
- { "blogpress.co.il", true },
- { "blogredmachine.com", true },
- { "blogreen.org", true },
- { "blogsdna.com", true },
- { "blogthedayaway.com", true },
- { "blogtroterzy.pl", true },
- { "blok56.nl", true },
- { "blomberg.name", true },
- { "blonde.style", true },
- { "bloodpop.tk", true },
- { "bloodsports.org", true },
- { "bloody.pw", true },
- { "bloom-avenue.com", true },
- { "bloom.sh", true },
- { "blopezabogado.es", true },
- { "blrjmt.com", true },
- { "bltc.co.uk", true },
- { "bltc.com", true },
- { "bltc.net", true },
- { "bltc.org", true },
- { "bltc.org.uk", true },
- { "bltdirect.com", true },
- { "blubbablasen.de", true },
- { "blubberladen.de", true },
- { "blubop.fr", true },
- { "blue-gmbh-erfahrungen.de", true },
- { "blue-gmbh.de", true },
- { "blue-leaf81.net", true },
- { "blue-nijmegen.nl", true },
- { "blue42.net", true },
- { "blueangel.org.tw", true },
- { "bluebie.com", true },
- { "blueblou.com", true },
- { "bluebnc.com", true },
- { "bluecanvas.io", true },
- { "bluechilli.com", true },
- { "bluecrazii.nl", true },
- { "blued.moe", true },
- { "bluedeck.org", true },
- { "blueeyedmaid.co.uk", true },
- { "bluefrag.com", true },
- { "bluefuzz.nl", true },
- { "bluegifts.ro", true },
- { "bluehelixmusic.com", true },
- { "bluehillhosting.com", true },
- { "blueimp.net", true },
- { "bluekrypt.com", true },
- { "blueliquiddesigns.com.au", true },
- { "bluemanhoop.com", true },
- { "bluemarmalade.co.uk", true },
- { "bluemeda.web.id", true },
- { "bluemoonroleplaying.com", true },
- { "bluemosh.com", true },
- { "bluemtnrentalmanagement.ca", true },
- { "bluenote9.com", true },
- { "blueoakart.com", true },
- { "blueperil.de", true },
- { "bluepostbox.de", true },
- { "blueprintrealtytn.com", true },
- { "bluepromocode.com", true },
- { "bluerootsmarketing.com", true },
- { "blueskycoverage.com", true },
- { "blueskydigitalstrategy.com", true },
- { "blueskyinsure.com", true },
- { "bluesoap.com.au", true },
- { "bluestardiabetes.com", true },
- { "bluestarroofing.com", true },
- { "bluesuncamping.com", true },
- { "bluesunhotels.com", true },
- { "blueswandaily.com", true },
- { "bluesync.co", true },
- { "bluetexservice.com", true },
- { "bluetomatographics.com", true },
- { "bluetoothspecialist.ga", true },
- { "bluewavewebdesign.com", true },
- { "bluewizardart.net", true },
- { "bluex.im", true },
- { "bluex.info", true },
- { "bluex.net", true },
- { "bluex.org", true },
- { "bluffplumber.co.za", true },
- { "blui.xyz", true },
- { "bluiandaj.ml", true },
- { "bluimedia.com", true },
- { "bluinet.com", true },
- { "blumando.de", true },
- { "blumenfeldart.com", true },
- { "blumiges-fischbachtal.de", false },
- { "bluntandsnakes.com", true },
- { "blupig.net", true },
- { "blurringexistence.net", true },
- { "blusens.com", true },
- { "blusmurf.net", true },
- { "blutopia.xyz", false },
- { "blw.moe", true },
- { "blyat.science", true },
- { "blyth.me.uk", true },
- { "blythwood.com", true },
- { "blzrk.com", true },
- { "bmcorp.online", true },
- { "bmhglobal.com.au", true },
- { "bmk-kramsach.at", true },
- { "bmoattachments.org", true },
- { "bmone.net", true },
- { "bmros.com.ar", true },
- { "bmw-motorradclub-seefeld.de", true },
- { "bn4t.me", true },
- { "bnbsinflatablehire.co.uk", true },
- { "bnck.me", true },
- { "bngs.pl", true },
- { "bnin.org", true },
- { "bnjscastles.co.uk", true },
- { "bnstree.com", true },
- { "bnty.net", true },
- { "bnzblowermotors.com", true },
- { "bo4tracker.com", true },
- { "boardgamegeeks.de", true },
- { "boards.ie", true },
- { "boardspot.com", true },
- { "boat-engines.eu", true },
- { "boats.com", true },
- { "boattrader.com", true },
- { "boattrader.com.au", true },
- { "bob-dylan.tk", true },
- { "bobaly.es", true },
- { "bobancoamigo.com", true },
- { "bobandducky.com", true },
- { "bobaobei.net", true },
- { "bobasy.pl", true },
- { "bobazar.com", false },
- { "bobcoffee.com.br", true },
- { "bobcopeland.com", true },
- { "bobep.ru", true },
- { "bobkidbob.com", true },
- { "bobkoetsier.nl", true },
- { "bobnbounce.ie", true },
- { "bobnbouncedublin.ie", true },
- { "bobobox.net", true },
- { "bobstenancycleaning.co.uk", true },
- { "bobstronomie.fr", true },
- { "bocamo.it", true },
- { "bocawa.es", true },
- { "boccabell.com", true },
- { "bochantinobgyn.com", true },
- { "bochs.info", true },
- { "bockenauer.at", true },
- { "bocreation.fr", true },
- { "bodas.com.mx", true },
- { "bodegasvirei.com", true },
- { "bodemplaten4x4.nl", true },
- { "bodhi.fedoraproject.org", true },
- { "bodis.nl", true },
- { "bodrumhotelsresorts.com", true },
- { "bodsch.com", true },
- { "bodybuilding.com", true },
- { "bodybuildingworld.com", true },
- { "bodyconshop.com", true },
- { "bodygearguide.com", true },
- { "bodymusclejournal.com", true },
- { "bodypainter.pl", true },
- { "bodypainting.waw.pl", true },
- { "bodyshopnews.net", true },
- { "bodyweb.com.br", true },
- { "bodyworksautorebuild.com", true },
- { "boeddhashop.nl", true },
- { "boernecancerfonden.dk", true },
- { "boevik.ml", true },
- { "bogdancornianu.com", true },
- { "bogdanepureanu.ro", true },
- { "bogner.sh", true },
- { "bogosity.se", true },
- { "bohan.co", true },
- { "bohramt.de", true },
- { "boimmobilier.ch", false },
- { "boiseonlinemall.com", true },
- { "boisewaldorf.org", true },
- { "bojiu99.cc", true },
- { "bokadoktorn-test.net", true },
- { "bokadoktorn.se", true },
- { "boke112.com", true },
- { "bokka.com", true },
- { "bokkeriders.com", true },
- { "bokutake.com", true },
- { "bolalocobrews.co.uk", true },
- { "bolamarela.com.br", true },
- { "bolamarela.pt", true },
- { "boldt-metallbau.de", true },
- { "bolektro.de", true },
- { "boleyn.su", true },
- { "bolgarka.kz", true },
- { "bolgarnyelv.hu", true },
- { "bologna-disinfestazioni.it", true },
- { "bolovegna.it", true },
- { "bolsashidrosolubles.com", true },
- { "bolt.cm", false },
- { "bolt.com", true },
- { "boltbeat.com", true },
- { "bolte.org", true },
- { "boltenergy.ca", true },
- { "boltmobile.ca", true },
- { "bomb.codes", true },
- { "bombe-lacrymogene.fr", true },
- { "bomboniere.roma.it", true },
- { "bomhard.de", true },
- { "bomhard.net", true },
- { "bomhard.org", true },
- { "bonaccorso.eu", true },
- { "bonaemi.ga", true },
- { "bonami.cz", true },
- { "bonami.hu", true },
- { "bonami.pl", true },
- { "bonami.ro", true },
- { "bonami.sk", true },
- { "bonawehouse.co.uk", true },
- { "bonbonmania.com", false },
- { "bondagefetishstore.com", true },
- { "bondank.com", true },
- { "bondarenko.dn.ua", true },
- { "bondingwithbaby.ca", true },
- { "bondlink.com", true },
- { "bondskampeerder.nl", true },
- { "bonebunny.de", true },
- { "boneko.de", true },
- { "bonesserver.com", true },
- { "bonfi.net", true },
- { "bongbabyhouse.com", true },
- { "bongbabyhouse.vn", true },
- { "bongloy.com", true },
- { "bongminhtam.com", true },
- { "bongo.cat", true },
- { "bongocams.webcam", true },
- { "bongoo.fr", true },
- { "bonifacius.be", true },
- { "bonito.pl", true },
- { "bonn.digital", true },
- { "bonnant-associes.ch", false },
- { "bonnant-partners.ch", false },
- { "bonniecoloring.com", true },
- { "bonnieradvocaten.nl", true },
- { "bonnsustainabilityportal.de", true },
- { "bonnyprints.at", true },
- { "bonnyprints.ch", true },
- { "bonnyprints.es", true },
- { "bonnyprints.fr", true },
- { "bonprix.co.uk", true },
- { "bonsaimedia.nl", true },
- { "bonsi.net", true },
- { "bonsi.org", true },
- { "bonus.ca", true },
- { "bonus.net.nz", true },
- { "bonus.pl", true },
- { "bonusov.tk", true },
- { "bonussource.com", true },
- { "bonux.co", true },
- { "boodmo.com", true },
- { "book-in-hotel.com", true },
- { "booker.ly", true },
- { "bookingapp.be", true },
- { "bookingapp.nl", true },
- { "bookingslog.com", true },
- { "bookingtool.com", true },
- { "bookingtool.net", true },
- { "bookingworldspeakers.com", true },
- { "bookluk.com", true },
- { "bookmein.in", true },
- { "booknowmytrip.com", true },
- { "bookofdenim.com", true },
- { "booksearch.jp", true },
- { "bookshopofindia.com", true },
- { "booksinthefridge.at", true },
- { "bookslibrarybooks.gq", true },
- { "booktoan.com", true },
- { "booktracker-org.appspot.com", true },
- { "bookwave.art", true },
- { "bookzaga.com", true },
- { "bool.be", true },
- { "boombv.com", false },
- { "boomersurf.com", true },
- { "boomfestival.org", true },
- { "boomkins.net", true },
- { "boomshelf.com", true },
- { "boomshelf.org", true },
- { "boomvm.pw", true },
- { "boonbox.com", true },
- { "booox.cc", true },
- { "booox.info", true },
- { "booox.net", true },
- { "booox.org", true },
- { "boop.pro", true },
- { "booplab.com", false },
- { "booquiz.com", true },
- { "boosinflatablegames.co.uk", true },
- { "boosman.nu", true },
- { "boosmanpoolservice.com", true },
- { "boost.ink", true },
- { "booter.pw", true },
- { "boothlabs.me", true },
- { "bootjp.me", false },
- { "bootsschule-weiss.de", true },
- { "bopiweb.com", true },
- { "bopp.org", true },
- { "borahan.net", true },
- { "boran.cl", true },
- { "borba-umov.tk", true },
- { "borchers.ninja", true },
- { "bordadoenpedreria.com", true },
- { "borderless360.com", true },
- { "bordes.me", true },
- { "bordo.com.au", true },
- { "boreacr.com", true },
- { "boredhackers.com", true },
- { "boredhousewifeconfessions.cf", true },
- { "borein.cf", true },
- { "boreo.si", true },
- { "boresmail.ru", true },
- { "borisenko.by", true },
- { "borja.io", true },
- { "born2bounce.co.uk", true },
- { "bornandgrazed.com", true },
- { "borneodictionary.com", true },
- { "bornfiber.dk", true },
- { "bornhack.dk", true },
- { "bornreality.tk", true },
- { "borowski.pw", true },
- { "borrelpartybus.nl", true },
- { "borriquillacuenca.tk", true },
- { "borysek.net", true },
- { "borysenko.se", true },
- { "bosabosa.org", true },
- { "bosattondskap.tk", true },
- { "boscoyacht.ch", false },
- { "boscq.fr", true },
- { "bosekarmelitky.cz", true },
- { "boskeopolis-stories.com", true },
- { "boss.az", true },
- { "bossdistribuidora.com.br", true },
- { "bostonadvisors.com", true },
- { "bostonaoii.com", true },
- { "bosufitness.cz", true },
- { "bosun.io", true },
- { "bot-manager.pl", true },
- { "botcamp.org", true },
- { "botcore.ai", true },
- { "botezdepoveste.ro", true },
- { "botguard.net", true },
- { "bothellwaygarage.net", true },
- { "botmastery.com", true },
- { "botmedia.cf", true },
- { "botnam.com", true },
- { "botserver.de", true },
- { "bottaerisposta.net", true },
- { "bottineauneighborhood.org", true },
- { "bottinquebec.com", true },
- { "bottke.berlin", true },
- { "bottledstories.de", true },
- { "bou.cloud", true },
- { "bou.ke", true },
- { "bouah.net", true },
- { "bouchard-mathieux.com", true },
- { "bouchonville-knifemaker.com", true },
- { "boudah.pl", true },
- { "bougeret.fr", true },
- { "boughariosbros.com", true },
- { "boukoubengo.com", true },
- { "bouldercolorado.gov", true },
- { "boulderlibrary.org", true },
- { "boulderswap.com", true },
- { "boulzicourt.fr", true },
- { "bounce-a-mania.co.uk", true },
- { "bounce-a-roo.co.uk", true },
- { "bounce-abouts.com", true },
- { "bounce-n-go.co.uk", true },
- { "bounce-on.co.uk", true },
- { "bounce-r-us.co.uk", true },
- { "bounce-xtreme.co.uk", true },
- { "bounce4fun.co.uk", true },
- { "bounce4fun.ie", true },
- { "bounce4kidz.com", true },
- { "bounce4less.ie", true },
- { "bouncea-bout.com", true },
- { "bounceaboutandplay.co.uk", true },
- { "bounceaboutnewark.co.uk", true },
- { "bounceaboutsussex.co.uk", true },
- { "bouncealotcastlehire.co.uk", true },
- { "bouncealotnorthwest.co.uk", true },
- { "bounceandwobble.co.uk", true },
- { "bounceapp.com", true },
- { "bouncearoundevents.co.uk", true },
- { "bouncearoundsheffield.co.uk", true },
- { "bounceawaycastles.com", true },
- { "bouncebackcastles.co.uk", true },
- { "bouncebookings.com.au", true },
- { "bouncecrazy.ie", true },
- { "bouncejumpboston.co.uk", true },
- { "bouncekingdom.co.uk", true },
- { "bouncemaniaevents.co.uk", true },
- { "bouncemaniainflatables.co.uk", true },
- { "bouncemonkeys.co.uk", true },
- { "bouncenortheast.co.uk", true },
- { "bouncenpaint.co.uk", true },
- { "bouncepartycastles.com", true },
- { "bounceroosevents.co.uk", true },
- { "bouncers-bouncycastlehire.co.uk", true },
- { "bouncesouthwales.co.uk", true },
- { "bouncesquad.co.uk", true },
- { "bouncetasticuk.co.uk", true },
- { "bouncetheparty.co.uk", true },
- { "bounceunlimited.co.uk", true },
- { "bouncewrightcastles.co.uk", true },
- { "bouncincastles.co.uk", true },
- { "bouncingbairnsinflatables.co.uk", true },
- { "bouncingbeansinflatables.co.uk", true },
- { "bouncingbobsinflatables.co.uk", true },
- { "bouncingbuddiesleicester.co.uk", true },
- { "bouncinghigher.co.uk", true },
- { "bouncingscotland.com", true },
- { "bouncourseplanner.net", true },
- { "bouncy-castles-surrey.co.uk", true },
- { "bouncybaileys.co.uk", true },
- { "bouncyball.eu", true },
- { "bouncyballs.org", true },
- { "bouncybouncyboocastlehire.co.uk", true },
- { "bouncycastle.net.au", true },
- { "bouncycastlehire-norwich.com", true },
- { "bouncycastlehire-sheffield.co.uk", true },
- { "bouncycastlehire.co.uk", true },
- { "bouncycastlehireauckland.co.nz", true },
- { "bouncycastlehirebarnstaple.co.uk", true },
- { "bouncycastlehirebexley.co.uk", true },
- { "bouncycastlehirechelmsford.org.uk", true },
- { "bouncycastlehirehull.co.uk", true },
- { "bouncycastlehireinglasgow.co.uk", true },
- { "bouncycastlehirelouth.co.uk", true },
- { "bouncycastlehiremalvern.co.uk", true },
- { "bouncycastlehireoldham.co.uk", true },
- { "bouncycastlehirestroud.co.uk", true },
- { "bouncycastlehiresurrey.co.uk", true },
- { "bouncycastlehiretameside.co.uk", true },
- { "bouncycastlehirewinchester.co.uk", true },
- { "bouncycastleman.co.uk", true },
- { "bouncycastlemangloucestershire.co.uk", true },
- { "bouncycastleparade.com", true },
- { "bouncycastlesgalway.com", true },
- { "bouncycastleshire.co.uk", true },
- { "bouncycastleshireleeds.co.uk", true },
- { "bouncycastlesin.co.uk", true },
- { "bouncycastlesinderby.co.uk", true },
- { "bouncycastlesisleofwight.co.uk", true },
- { "bouncycastlesmonaghan.com", true },
- { "bouncycastlessheerness.co.uk", true },
- { "bouncydays.co.uk", true },
- { "bouncygiggles.com.au", true },
- { "bouncyhigher.co.uk", true },
- { "bouncyhousecastlehire.co.uk", true },
- { "bouncykingdom.co.uk", true },
- { "bouncykings.co.uk", true },
- { "bouncykingsnortheast.co.uk", true },
- { "bouncymacs.co.uk", true },
- { "bouncyrainbows.co.uk", true },
- { "bouncytime.co.uk", true },
- { "bouncywouncy.co.uk", true },
- { "bound2bounce.co.uk", true },
- { "boundarybrighton.com", true },
- { "boundaryvets.co.uk", true },
- { "bounouh.tk", true },
- { "bountyfactory.io", true },
- { "bourasse.fr", true },
- { "bourgeoisdoorco.com", true },
- { "bournefun.co.uk", true },
- { "bourseauxservices.com", true },
- { "boutiqueguenaelleverdin.com", true },
- { "boutoncoupdepoing.fr", true },
- { "bouw.live", true },
- { "bouwbedrijfvandortbv.nl", true },
- { "bouwplaatscheckin.nl", true },
- { "bouzouada.com", true },
- { "bouzouks.net", true },
- { "bovenwebdesign.nl", true },
- { "bovworkplacepensions.com", true },
- { "bowdens.me", true },
- { "bowedwallcrackrepair.com", true },
- { "boweryandvine.com", true },
- { "bowlcake.fr", true },
- { "bowling.com", true },
- { "bownty.be", true },
- { "bownty.co.uk", true },
- { "bownty.de", true },
- { "bownty.dk", true },
- { "bownty.es", true },
- { "bownty.fr", true },
- { "bownty.it", true },
- { "bownty.nl", true },
- { "bowntycdn.net", true },
- { "bowtie.com.hk", true },
- { "boxcritters.wiki", true },
- { "boxcryptor.com", false },
- { "boxdropcc.com", true },
- { "boxintense.com", true },
- { "boxlink.de", true },
- { "boxpeg.com", true },
- { "boxpirates.to", true },
- { "boxspringbett-160x200.de", true },
- { "boxt.com.au", true },
- { "boxvergelijker.nl", true },
- { "boyfriendcookbook.com", true },
- { "boyhost.cn", true },
- { "boyinglanguage.com", true },
- { "boykovo.tk", true },
- { "boypoint.de", true },
- { "boysontech.com", true },
- { "boz.nl", false },
- { "bozdoz.com", true },
- { "bozhok.tk", true },
- { "bozit.com.au", true },
- { "bpaste.net", true },
- { "bpastudies.org", true },
- { "bphostels.com", true },
- { "bpo.ovh", true },
- { "bpol-forum.de", true },
- { "bpreguica.com.br", true },
- { "bps.vc", true },
- { "bpvboekje.nl", true },
- { "bqcp.net", true },
- { "bqp.io", false },
- { "bqr.ch", false },
- { "br.search.yahoo.com", false },
- { "br1334shop.com.br", true },
- { "br3in.nl", false },
- { "br7.ru", true },
- { "braams.nl", true },
- { "braathe.no", true },
- { "brabank.no", true },
- { "brabank.se", true },
- { "bracho.xyz", true },
- { "brachotelborak.com", true },
- { "bracknellvets.co.uk", true },
- { "bradbrockmeyer.com", true },
- { "bradfordhottubhire.co.uk", true },
- { "bradfordmascots.co.uk", true },
- { "bradkovach.com", true },
- { "bradler.net", false },
- { "bradlinder.org", true },
- { "bradypatterson.com", true },
- { "braeunlich-gmbh.com", true },
- { "brage.info", true },
- { "brahmins.com", true },
- { "braiampeguero.xyz", true },
- { "brailsford.xyz", true },
- { "brain-force.ch", true },
- { "brainball.fr", false },
- { "brainboxai.com", true },
- { "braineet.com", true },
- { "brainobeat.com", true },
- { "brainserve.ch", false },
- { "brainserve.com", false },
- { "brainserve.swiss", false },
- { "brainshare.tk", true },
- { "brainsik.net", true },
- { "brainstobrand.com", true },
- { "braintreegateway.com", true },
- { "brainvoyagermusic.com", true },
- { "brainwav.es", true },
- { "brainwork.space", true },
- { "braithwaites.ltd", true },
- { "brakemanpro.com", true },
- { "brakpanplumber24-7.co.za", true },
- { "bralnik.com", true },
- { "bramhallsamusements.com", true },
- { "brammingfys.dk", true },
- { "bramois.tk", true },
- { "bramstaps.nl", true },
- { "bramvanaken.be", true },
- { "bramygrozy.pl", true },
- { "bran.land", true },
- { "branch-bookkeeper.com", true },
- { "branchtrack.com", true },
- { "brandand.co.uk", true },
- { "brandfolder.com", true },
- { "brandingclic.com", true },
- { "brandingclick.com", true },
- { "brandingcoapps.com", true },
- { "brandondivorcelawyer.com", true },
- { "brandonforce.com", true },
- { "brandongomez.me", true },
- { "brandonhubbard.com", true },
- { "brandonlin.me", true },
- { "brandonlui.com", true },
- { "brandonsample.com", true },
- { "brandonwalker.me", true },
- { "brandpit.nl", true },
- { "brandrocket.dk", true },
- { "brandstead.com", true },
- { "brandtrapselfie.nl", true },
- { "brandweerbarboek.nl", true },
- { "brandweerfraneker.nl", true },
- { "brandweertrainingen.nl", true },
- { "brandweeruitgeest.nl", true },
- { "brandwidth.com", true },
- { "brank.as", true },
- { "branno.org", true },
- { "branode.com", false },
- { "bransive.com.au", true },
- { "branw.xyz", false },
- { "brasal.ma", true },
- { "brasalcosmetics.com", true },
- { "brashear.me", true },
- { "brasildxn.com.br", true },
- { "brasileiro.ca", false },
- { "brasserie-mino.fr", true },
- { "brasserie-twins.be", true },
- { "brasserie-twins.com", true },
- { "bratteng.me", true },
- { "bratteng.xyz", true },
- { "bratunaconline.tk", true },
- { "bratvanov.com", true },
- { "brau-ingenieur.de", true },
- { "braudoktor.de", true },
- { "brauingenieur.de", true },
- { "braunsteinpc.com", true },
- { "braunwarth.info", true },
- { "brava.bg", true },
- { "brave-foods.ch", false },
- { "brave-foods.com", false },
- { "brave.com", true },
- { "bravebaby.com.au", true },
- { "bravebooks.berlin", true },
- { "bravica.tk", true },
- { "braviskindenjeugd.nl", true },
- { "bravisziekenhuis.nl", false },
- { "bravobet.et", true },
- { "bravor.pe", true },
- { "braystudio.com", true },
- { "brazenfol.io", true },
- { "brazilian.dating", true },
- { "brazilianbikinishop.com", true },
- { "braziliex.com", true },
- { "brazillens.com", true },
- { "brazoriabar.org", true },
- { "brb.city", true },
- { "brck.nl", true },
- { "brd.ro", true },
- { "bread.red", true },
- { "breadandlife.org", true },
- { "breadofgod.org", true },
- { "breadpirates.chat", true },
- { "breakcraft.tk", true },
- { "breakingtech.fr", true },
- { "breakingtech.it", true },
- { "breakout.careers", true },
- { "breaky.de", true },
- { "breard.tf", true },
- { "breathedreamgo.com", true },
- { "breathingblanket.com", true },
- { "brecht.ch", true },
- { "breckle.com.ua", true },
- { "brecknell.biz", true },
- { "brecknell.com", true },
- { "brecknell.info", true },
- { "brecknell.name", true },
- { "brecknell.net", true },
- { "brecknell.org", true },
- { "bredvid.no", true },
- { "breest.net", true },
- { "breeyn.com", true },
- { "brefy.com", true },
- { "brege.org", true },
- { "bregnedalsystems.dk", true },
- { "breitband.bz.it", true },
- { "breizh.pm", true },
- { "brejoc.com", true },
- { "brelahotelberulia.com", true },
- { "bremen-restaurants.de", true },
- { "bremensaki.com", true },
- { "bremerfriedensforum.de", true },
- { "brenbarnes.com", true },
- { "brenbarnes.com.au", true },
- { "brendanbatliner.com", true },
- { "brendansbits.com", true },
- { "brentacampbell.com", true },
- { "brentnewbury.com", true },
- { "bressier.fr", true },
- { "brest-news.tk", true },
- { "bretcarmichael.com", true },
- { "bretech.net", true },
- { "brettabel.com", true },
- { "brettcornwall.com", true },
- { "brettlawyer.com", true },
- { "brettpostin.com", true },
- { "bretzner.fr", false },
- { "brevboxar.se", true },
- { "brewercollinsleadership.com", true },
- { "brewsouth.com", true },
- { "brewspark.co", true },
- { "brewvo.com", true },
- { "breznet.com", true },
- { "brgins.com", true },
- { "brguk.com", true },
- { "brian-gordon.name", true },
- { "brianalaway.com", true },
- { "brianalawayconsulting.com", true },
- { "briandwells.com", true },
- { "brianfoshee.com", true },
- { "briangosnell.com", true },
- { "brianjohnson.co.za", true },
- { "brianlanders.us", true },
- { "brianmwaters.net", true },
- { "brianpagan.net", true },
- { "brianroadifer.com", true },
- { "briansemrau.com", true },
- { "briansmith.org", true },
- { "briantkatch.com", true },
- { "brianvalente.tk", true },
- { "brianwalther.com", true },
- { "brianwesaala.com", false },
- { "brianwilson.tk", true },
- { "briarproject.org", true },
- { "brickadia.com", true },
- { "brickftp.com", true },
- { "brickheroes.com", false },
- { "brickstreettrio.com", true },
- { "brickvortex.com", false },
- { "brickweb.co.uk", true },
- { "bricolajeux.ch", false },
- { "brid.gy", false },
- { "bridalfabrics.co.uk", true },
- { "bridalfabrics.com", true },
- { "bridalfabrics.fr", true },
- { "bridalfabrics.ru", true },
- { "bridalshoes.com", true },
- { "bridalweddingshow.ga", true },
- { "bride-forever.com", true },
- { "bridgedigest.tk", true },
- { "bridgedirectoutreach.com", true },
- { "bridgeglobalmarketing.com", true },
- { "bridgement.com", true },
- { "bridgercanyonfiremt.gov", false },
- { "bridgetroll.org", true },
- { "bridgevest.com", false },
- { "bridholm.se", true },
- { "bridltaceng.com", true },
- { "brie.tech", true },
- { "briefassistant.com", true },
- { "briefhansa.de", true },
- { "briefkasten-welt.com", true },
- { "briefvorlagen-papierformat.de", true },
- { "brier.me", true },
- { "brighouse-leisure.co.uk", true },
- { "brightday.bz", true },
- { "brightendofleasecleaning.com.au", true },
- { "brightonbank.com", true },
- { "brightonbouncycastles.net", true },
- { "brightonchilli.org.uk", true },
- { "brightpool-markets.com", true },
- { "brightside.com", true },
- { "brightworkcreative.com", true },
- { "brigidaarie.com", true },
- { "brigittefontaine.tk", true },
- { "brilliantbouncyfun.co.uk", true },
- { "brilliantproductions.co.nz", true },
- { "brimspark.systems", true },
- { "brindesgrafica.com.br", true },
- { "brindice.com.br", true },
- { "brindisi.tk", true },
- { "bring-heaven.com", true },
- { "bringingbackthesweatervest.com", true },
- { "brinksurl.com", true },
- { "brio-shop.ch", true },
- { "briograce.com.mx", true },
- { "brioukraine.store", true },
- { "brisbanelogistics.com.au", true },
- { "brisignshop.com.au", true },
- { "brisq.design", true },
- { "bristebein.com", true },
- { "bristolandwestonsuperbounce.com", true },
- { "britanniacateringyeovil.co.uk", true },
- { "britanniapandi.com", true },
- { "britelocate.com", true },
- { "britishbeef.com", true },
- { "britishbookmakers.co.uk", true },
- { "britishgroupsg.com", true },
- { "britishmeat.com", true },
- { "britishpearl.com", true },
- { "britishsciencefestival.org", true },
- { "britishscienceweek.org", true },
- { "britishsfaward.org", true },
- { "britishsnoring.co.uk", true },
- { "britneyclause.com", true },
- { "brittanyferriesnewsroom.com", true },
- { "britton-photography.com", true },
- { "brizawen.com", true },
- { "brk.st", true },
- { "brmsalescommunity.com", true },
- { "brnojebozi.cz", true },
- { "bro.hk", true },
- { "broadbandchoices.co.uk", true },
- { "broadbandnd.com", true },
- { "broadsheet.com.au", true },
- { "broadwayvets.co.uk", true },
- { "broadyexpress.com.au", true },
- { "brockmeyer.net", true },
- { "brockmeyer.org", true },
- { "brodowski.cc", true },
- { "broerict.nl", true },
- { "broersma.com", true },
- { "broeselei.at", true },
- { "brojagraphics.de", true },
- { "brokenhands.io", true },
- { "brokervalues.com", true },
- { "brokolit.com", true },
- { "brols.eu", true },
- { "brompton-cocktail.com", true },
- { "bronetb2b.com.br", true },
- { "bronevichok.ru", true },
- { "bronwynlewis.com", true },
- { "bronzew.com", true },
- { "broodbesteld.nl", true },
- { "broodingblogger.com", true },
- { "brookes.xyz", true },
- { "brooklynentdoc.com", true },
- { "brooklynrealestateblog.com", true },
- { "brosay-legko.ml", true },
- { "brossmanit.com", true },
- { "brouillard.ch", false },
- { "brouskat.be", true },
- { "brouwerijdeblauweijsbeer.nl", true },
- { "brownesgas.com", true },
- { "brownfieldstsc.org", true },
- { "brownforces.desi", true },
- { "brownforces.org", true },
- { "brownihc.com", true },
- { "browntowncountryclub.com", true },
- { "brownwolfstudio.com", true },
- { "browsbybecca.ca", true },
- { "browse-tutorials.com", true },
- { "browsemycity.com", true },
- { "browserleaks.com", true },
- { "brrd.io", true },
- { "brrr.fr", true },
- { "bru6.de", true },
- { "brubank.com", true },
- { "brubankv1-staging.azurewebsites.net", true },
- { "brucekovner.com", true },
- { "brucemartin.net", true },
- { "brucherlaw.lu", true },
- { "bruck.me", true },
- { "bruckmuehler-kanu-club.de", true },
- { "bruckner.li", true },
- { "brudkista.nu", true },
- { "brudkista.se", true },
- { "brudkistan.nu", true },
- { "brudkistan.se", true },
- { "brueser-gmbh.de", true },
- { "brugerklub.info", true },
- { "bruijns.org", true },
- { "brunchandmatch.be", true },
- { "brunick.de", false },
- { "brunn.email", true },
- { "brunner.ninja", true },
- { "brunoproduit.ch", false },
- { "brunoreno.be", true },
- { "brush.ninja", true },
- { "brushcreekyachts.com", true },
- { "brusselsexpoloft.ga", true },
- { "brusselsexpostudio.ga", true },
- { "brutecloud.com", true },
- { "bruun.co", true },
- { "bry.do", true },
- { "bryanarmijomd.com", true },
- { "bryandesrosiers.com", true },
- { "bryanfalchuk.com", true },
- { "bryankaplan.com", true },
- { "bryanphilton.com", true },
- { "bryanquigley.com", true },
- { "bryansmith.net", true },
- { "bryansmith.tech", true },
- { "brycecanyon.net", true },
- { "brycecanyonnationalpark.com", true },
- { "bryggebladet.dk", true },
- { "brzy-svoji.cz", true },
- { "bs-network.net", true },
- { "bs.to", true },
- { "bs12v.ru", true },
- { "bsa157.org", true },
- { "bsaft.ml", true },
- { "bsapack564.org", true },
- { "bsatroop794.org", true },
- { "bsc-rietz.at", true },
- { "bscc.support", true },
- { "bsd-box.net", true },
- { "bsdes.net", true },
- { "bsdio.com", true },
- { "bsdracing.ca", true },
- { "bsdunix.xyz", true },
- { "bsee.gov", true },
- { "bsg.ro", false },
- { "bsgamanet.ro", false },
- { "bsgcredit.ro", true },
- { "bsidesf.com", true },
- { "bsidesf.org", true },
- { "bsidessf.com", true },
- { "bsimerch.com", true },
- { "bsimyanmar.com", true },
- { "bsmn.ga", true },
- { "bsmomo-api.com", true },
- { "bso-buitengewoon.nl", true },
- { "bsociabl.com", true },
- { "bsp-southpool.com", true },
- { "bsquared.org", true },
- { "bssolvfagen-pre-storeswa-wap.azurewebsites.net", true },
- { "bsstainless.com", true },
- { "bstoked.net", true },
- { "bsw-solution.de", true },
- { "bszoft.hu", true },
- { "bt123.xyz", true },
- { "bt3655.com", true },
- { "bt3657.com", true },
- { "bt3658.com", true },
- { "bta.lv", false },
- { "bta00.com", true },
- { "bta55.com", true },
- { "btc-alpha.com", true },
- { "btc-doge.ga", true },
- { "btcarmory.com", true },
- { "btcbenthuizen.nl", true },
- { "btcbolsa.com", true },
- { "btcpop.co", true },
- { "bte365app.com", true },
- { "bteapp.com", true },
- { "btio.pw", false },
- { "btmstore.com.br", true },
- { "btnissanparts.com", true },
- { "btopc.jp", true },
- { "btorrent.xyz", true },
- { "btsapem.com", true },
- { "btshe.net", true },
- { "btshenqi.cc", true },
- { "btsoft.eu", true },
- { "btsou.org", true },
- { "btsow.com", false },
- { "btt0101.com", true },
- { "btt0303.com", true },
- { "btt0505.com", true },
- { "btt0606.com", true },
- { "btt0707.com", true },
- { "btt0707a.com", true },
- { "btt11.net", true },
- { "btt1111.com", true },
- { "btt1212.com", true },
- { "btt1313.com", true },
- { "btt138g.com", true },
- { "btt2020.com", true },
- { "btt2121.com", true },
- { "btt213.com", true },
- { "btt216.com", true },
- { "btt219.com", true },
- { "btt221.com", true },
- { "btt225.com", true },
- { "btt2323a.com", true },
- { "btt2525.com", true },
- { "btt256.com", true },
- { "btt263.com", true },
- { "btt268.com", true },
- { "btt269g.com", true },
- { "btt2929a.com", true },
- { "btt301.com", true },
- { "btt302.com", true },
- { "btt303.com", true },
- { "btt305.com", true },
- { "btt306.com", true },
- { "btt307.com", true },
- { "btt308.com", true },
- { "btt309.com", true },
- { "btt312.com", true },
- { "btt317.com", true },
- { "btt319.com", true },
- { "btt3311.com", true },
- { "btt332.com", true },
- { "btt350.com", true },
- { "btt351.com", true },
- { "btt352.com", true },
- { "btt353.com", true },
- { "btt3535.com", true },
- { "btt355.com", true },
- { "btt358.com", true },
- { "btt359.com", true },
- { "btt361.com", true },
- { "btt362.com", true },
- { "btt368.com", true },
- { "btt371.com", true },
- { "btt372.com", true },
- { "btt373.com", true },
- { "btt375.com", true },
- { "btt376.com", true },
- { "btt378.com", true },
- { "btt379.com", true },
- { "btt381.com", true },
- { "btt381g.com", true },
- { "btt529g.com", true },
- { "btt583g.com", true },
- { "btt6262a.com", true },
- { "btt6363a.com", true },
- { "btt645g.com", true },
- { "btt686.com", true },
- { "btt6868.com", true },
- { "btt7272a.com", true },
- { "btt775.com", true },
- { "btt7878.com", true },
- { "btt8.me", true },
- { "btt818g.com", true },
- { "btt829.com", true },
- { "btt830g.com", true },
- { "btt8787a.com", true },
- { "btt88.net", true },
- { "btt88818.com", true },
- { "btt889g.com", true },
- { "btt891.com", true },
- { "btt8989a.com", true },
- { "btt907.com", true },
- { "btt9090.com", true },
- { "btt918958.com", true },
- { "btt932g.com", true },
- { "btt945g.com", true },
- { "btt9898.com", true },
- { "btt996.com", true },
- { "btta15.com", true },
- { "btta16.com", true },
- { "btta26.com", true },
- { "btta27.com", true },
- { "btta30.com", true },
- { "bttc.co.uk", true },
- { "btth.pl", true },
- { "btth.tv", true },
- { "bttna.com", true },
- { "bttorj45.com", true },
- { "bttp7.com", true },
- { "bttt111.com", true },
- { "bttt222.com", true },
- { "bttt333.com", true },
- { "bttt999.com", true },
- { "bttyulecheng0.com", true },
- { "bttyulecheng7.com", true },
- { "bu-dun.com", true },
- { "buayacorp.com", true },
- { "bubblegumblog.com", true },
- { "bubblespetspa.com", true },
- { "bubblin.io", true },
- { "bubblinghottubs.co.uk", true },
- { "bubblybouncers.co.uk", true },
- { "bubulazi.com", false },
- { "bubulazy.com", true },
- { "bucek.cz", true },
- { "buch-angucken.de", true },
- { "buchhaltung-muehelos.de", true },
- { "buchwegweiser.com", true },
- { "buck-hydro.de", true },
- { "buckelewrealtygroup.com", true },
- { "bucketlist.co.ke", true },
- { "buckscountyobgyn.com", true },
- { "buckypaper.com", true },
- { "buddhismus.net", true },
- { "buddie5.com", true },
- { "buddlycrafts.com", true },
- { "buddy-acceptance-authentication-api.azurewebsites.net", true },
- { "buddy-acceptance-authentication-frontend.azurewebsites.net", true },
- { "buddy-acceptance-backoffice-frontend.azurewebsites.net", true },
- { "buddy-acceptance-banking-api.azurewebsites.net", true },
- { "buddy-acceptance-profiles-api.azurewebsites.net", true },
- { "buddy-acceptance-users-api.azurewebsites.net", true },
- { "buddy-acceptance-web-frontend.azurewebsites.net", true },
- { "buddycompany.net", true },
- { "buddyme.me", true },
- { "buddytop.com", true },
- { "buddyworks.net", true },
- { "budeanu.com", true },
- { "budger.nl", true },
- { "budget.gov", true },
- { "budgetalk.com", true },
- { "budgetboats.net", true },
- { "budgetcastlehire.co.uk", true },
- { "budgetlob.gov", true },
- { "budgetlovers.nl", true },
- { "budgiesballoons.com", true },
- { "budntod.com", true },
- { "budolangnau.ch", true },
- { "budolfs.de", true },
- { "bueltge.de", true },
- { "buena-vista.cz", true },
- { "buena.me", true },
- { "bueny.com", true },
- { "bueny.net", true },
- { "buerger-lenke.de", true },
- { "bueromoebel-experte.de", true },
- { "bueroplus.de", true },
- { "bueroschwarz.design", true },
- { "bueroshop24.de", true },
- { "buettgens.net", true },
- { "buffaloautomation.com", true },
- { "buffaloturf.com.au", true },
- { "buffashe.com", false },
- { "buffup.media", true },
- { "bug.ee", true },
- { "bugcrowd.com", true },
- { "bugginslab.co.uk", true },
- { "bugs.chromium.org", true },
- { "bugsmashed.com", true },
- { "bugteam.cn", true },
- { "bugu.org", true },
- { "bugwie.com", true },
- { "bugzil.la", true },
- { "bugzilla.mozilla.org", true },
- { "build.chromium.org", true },
- { "buildbytes.com", true },
- { "buildhoscaletraingi.com", true },
- { "buildiffuse.com", false },
- { "buildingclouds.de", true },
- { "buildkite.com", true },
- { "buildmorebuslanes.com", true },
- { "buildplease.com", true },
- { "builtory.my", true },
- { "builtvisible.com", true },
- { "builtwith.com", true },
- { "buissonchardin.fr", true },
- { "bukiskola.hu", true },
- { "bukkenfan.jp", true },
- { "bulario.com", true },
- { "bulario.net", true },
- { "bularmas.com", true },
- { "bulgarianwine.com", true },
- { "bulkcandystore.com", true },
- { "bulktshirtsjohannesburg.co.za", true },
- { "bulkwholesalesweets.co.uk", true },
- { "bulldog-hosting.de", false },
- { "bulledair-savons.ch", false },
- { "bullettags.com", true },
- { "bullshitmail.nl", true },
- { "bullterrier.nu", true },
- { "bulvar.tk", true },
- { "bulwarkcrypto.com", true },
- { "bulwarkhost.com", true },
- { "bumble.com", true },
- { "bund-von-theramore.de", true },
- { "bundespolizei-forum.de", true },
- { "bundito.com", true },
- { "bungabuket.com", true },
- { "bungee.pw", true },
- { "bunix.de", true },
- { "bunkyo-life.com", true },
- { "bunny-rabbits.com", true },
- { "bunny.parts", true },
- { "bunnycarenotes.com", true },
- { "bunnydiamond.de", true },
- { "bunzy.ca", true },
- { "buonventosbt.eu", true },
- { "bupropion.com", true },
- { "burakogun.com", true },
- { "burakogun.com.tr", true },
- { "burakogun.net", true },
- { "burakogun.net.tr", true },
- { "burakogun.org", true },
- { "burbankdental.com", true },
- { "burcevo.info", true },
- { "bureaugoodwork.nl", true },
- { "burg-hohnstein.com", true },
- { "burgernet.nl", true },
- { "burgers.io", true },
- { "burghardt.pl", true },
- { "buri.be", true },
- { "burialinsurancenetwork.com", true },
- { "burienergy.com", true },
- { "buriramradio.com", true },
- { "burke.services", true },
- { "burkhardt.at", true },
- { "burlapsac.ca", true },
- { "burnerfitness.com", true },
- { "burnhamonseabouncycastles.co.uk", true },
- { "burningbird.net", true },
- { "burningflipside.com", false },
- { "burningmarket.de", true },
- { "burntfish.com", true },
- { "burnworks.com", true },
- { "buronwater.com", true },
- { "burotec-sarl.com", true },
- { "burr.is", true },
- { "bursaries-southafrica.co.za", true },
- { "burtrum.family", true },
- { "burtrum.me", true },
- { "burtrum.name", true },
- { "burtrum.org", true },
- { "burzcast.ro", true },
- { "burzmali.com", true },
- { "burzum.ch", true },
- { "buscandolosmejores.com", true },
- { "buscasimple.com", true },
- { "buselefante.tk", true },
- { "bushbaby.com", true },
- { "busindre.com", true },
- { "business-garden.com", true },
- { "business-secreti.gq", true },
- { "business-secreti.tk", true },
- { "business.facebook.com", false },
- { "business.gov", true },
- { "businesscentermarin.ch", false },
- { "businessesdirectory.eu", true },
- { "businessfactors.de", true },
- { "businessloanconnection.org", false },
- { "businessmarketingblog.org", true },
- { "businesspartner.tk", true },
- { "businesswebadmin.com", true },
- { "busold.ws", true },
- { "busphotos.tk", true },
- { "bustabit.com", true },
- { "bustadice.com", true },
- { "bustany.org", true },
- { "buster.me.uk", true },
- { "busuttil.org.uk", true },
- { "buswiki.ml", true },
- { "butarque.es", true },
- { "buthowdoyoubuygroceries.com", true },
- { "butikvip.ru", true },
- { "butlerfm.dk", true },
- { "butter.horse", true },
- { "butteramotors.com", true },
- { "buttgun-tattoo.de", true },
- { "buttoned.io", true },
- { "buttonizer.pro", true },
- { "buttonline.ch", true },
- { "butts-are.cool", true },
- { "butz.cloud", true },
- { "butzies.ddnss.org", true },
- { "buurtpreventiefraneker.nl", true },
- { "buxum-communication.ch", false },
- { "buy-an-essay.gq", true },
- { "buy-essay-online.ga", true },
- { "buy-lasix-without-a-doctor-s-prescription.ga", true },
- { "buy-los-angeles-auto-insurance.com", true },
- { "buy-out.jp", true },
- { "buy-zofran.ga", true },
- { "buy2dollars.com", true },
- { "buyaccessible.gov", true },
- { "buyamerican.gov", false },
- { "buybutton.store", true },
- { "buycccam.tv", true },
- { "buycoins.top", true },
- { "buycurious.co.uk", true },
- { "buydiflucan.ml", true },
- { "buydissertations.com", true },
- { "buyerdocs.com", true },
- { "buyessay.org", true },
- { "buyessays.net", true },
- { "buyessayscheap.com", true },
- { "buyinginvestmentproperty.com", true },
- { "buylasix.ml", true },
- { "buylevaquin.tk", true },
- { "buypapercheap.net", true },
- { "buyplaytix.com", true },
- { "buyplore.com", true },
- { "buyrogaine.ga", true },
- { "buyseo.store", true },
- { "buysildenafil.ml", true },
- { "buysoft.co.uk", true },
- { "buytermpaper.com", true },
- { "buyusa.gov", true },
- { "buzz.tools", true },
- { "buzzcontent.com", true },
- { "buzzprint.it", true },
- { "bvalle.com", true },
- { "bvbmedia.nl", true },
- { "bvgt.org", true },
- { "bviphotovideo.com", true },
- { "bvl.aero", true },
- { "bvsa.co.za", true },
- { "bw.codes", true },
- { "bwanglab.com", true },
- { "bwcscorecard.org", true },
- { "bwfc.nl", true },
- { "bwgjms.com", true },
- { "bwgjms.net", true },
- { "bwgjms.org", true },
- { "bwh1.net", false },
- { "bwhbwh.com", true },
- { "bwhbwh.net", true },
- { "bwilkinson.co.uk", true },
- { "bwin18.cc", true },
- { "bwin369.cc", true },
- { "bwin58.cc", true },
- { "bwl-earth.club", true },
- { "bws16.de", true },
- { "bwserhoscaletrainaz.com", true },
- { "bx-n.de", true },
- { "bxegypt.com", true },
- { "bxp40.at", true },
- { "by-robyn.nl", true },
- { "byange.pro", true },
- { "byatte.com", true },
- { "byaustere.com", true },
- { "bye-bye.us", true },
- { "byeskille.no", true },
- { "byggonline.ga", true },
- { "bygningsregistrering.dk", true },
- { "byjamesrush.com", true },
- { "byjuschennai.com", true },
- { "bymark.co", true },
- { "bymike.co", true },
- { "bynder.com", true },
- { "bynet.cz", true },
- { "bypass.sh", true },
- { "bypetula.cz", true },
- { "byraje.com", true },
- { "byrko.cz", true },
- { "byrnesagency.com", true },
- { "byronkg.us", true },
- { "byrtz.de", true },
- { "bysgo.com", true },
- { "bytanchan.com", true },
- { "byte-time.com", true },
- { "byte.nl", true },
- { "byte128.com", true },
- { "bytearts.net", false },
- { "bytebucket.org", true },
- { "bytecode.no", true },
- { "byteflies.com", true },
- { "bytegoing.com", true },
- { "bytejail.com", true },
- { "bytelog.org", false },
- { "bytema.cz", true },
- { "bytema.eu", true },
- { "bytema.sk", true },
- { "bytemix.cloud", true },
- { "bytenoc.nl", true },
- { "bytepen.com", true },
- { "bytes.co", true },
- { "bytes.fyi", true },
- { "bytesatwork.de", true },
- { "byteshark.org", true },
- { "bytesign.de", true },
- { "bytesizedalex.com", true },
- { "bytesund.biz", true },
- { "bytesunlimited.com", false },
- { "byteswave.cl", true },
- { "bytesystems.com", true },
- { "byteterrace.com", true },
- { "bytheglass.gr", true },
- { "bytheswordinc.com", true },
- { "bythisverse.com", true },
- { "bytrain.net", true },
- { "byvshie.com", true },
- { "byxong.com", true },
- { "bzh.tf", true },
- { "bziaks.xyz", true },
- { "bzsparks.com", false },
- { "bztech.com.br", true },
- { "bzv-fr.eu", true },
- { "c-3.moe", true },
- { "c-aeroconsult.com", true },
- { "c-ma-copro.com", true },
- { "c-rtx.com", true },
- { "c-shock.org", true },
- { "c-webdesign.net", true },
- { "c-world.co.uk", true },
- { "c.cc", true },
- { "c00ke.com", true },
- { "c0rporation.com", true },
- { "c2design.it", true },
- { "c2lab.net", true },
- { "c36533.com", true },
- { "c36594.com", true },
- { "c3kidspace.de", true },
- { "c3sign.de", false },
- { "c3softworks.com", true },
- { "c3vo.de", true },
- { "c3w.at", true },
- { "c3wien.at", true },
- { "c3woc.de", false },
- { "c4539.com", true },
- { "c4k3.net", true },
- { "c5h8no4na.net", true },
- { "c7dn.com", true },
- { "c86255.com", true },
- { "c8ms113.com", true },
- { "ca-key.de", true },
- { "ca.gparent.org", true },
- { "ca.search.yahoo.com", false },
- { "ca5.de", true },
- { "caaps.org.au", true },
- { "caarecord.org", true },
- { "caasd.org", true },
- { "cabalacoach.com", true },
- { "cabaladada.org", true },
- { "cabarave.com", true },
- { "cabecera-descendimiento.tk", true },
- { "cabelgrano.tk", true },
- { "cabezadelcaballo.tk", true },
- { "cabforum.org", true },
- { "cabineritten.nl", true },
- { "cabinet-bedin.com", true },
- { "cabinet-life.fr", true },
- { "cabinetfurnituree.com", true },
- { "cablemod.com", true },
- { "cablesandkits.com", true },
- { "cabotfinancial.co.uk", true },
- { "cabuna.hr", true },
- { "cacao-chocolate.com", true },
- { "cacao.supply", true },
- { "cacaolalina.com", true },
- { "cacaumidade.com.br", true },
- { "cachacacha.com", true },
- { "cachedview.nl", true },
- { "cachetur.no", true },
- { "cackette.com", true },
- { "cacn.pw", true },
- { "cacrm.com", true },
- { "cactuspedia.ga", true },
- { "cad-noerdlingen.de", true },
- { "cadafamilia.de", true },
- { "cadams.io", true },
- { "caddyfashionshop.com", true },
- { "cadenceconstruction.com", true },
- { "cadep2019.com", true },
- { "cadetsge.ch", false },
- { "cadifit.ga", true },
- { "cadmail.nl", true },
- { "cadman.pw", true },
- { "cadmanlaw.ca", true },
- { "cadmanlaw.com", true },
- { "cadmax.pro", true },
- { "cadooz.com", true },
- { "cadorama.fr", true },
- { "cadoth.net", true },
- { "cadra.nl", true },
- { "cadre.com", true },
- { "cadsys.net", true },
- { "caesarkabalan.com", true },
- { "caetanobenet.es", true },
- { "caetanoflotas.es", true },
- { "caetanoformula.es", true },
- { "caetanoformulacadiz.es", true },
- { "caetanoformulagalicia.es", true },
- { "caetanomotorsmalaga.es", true },
- { "caetanoreicomsa.es", true },
- { "cafedelahalle.com", true },
- { "cafedupont.be", true },
- { "cafedupont.co.uk", true },
- { "cafedupont.de", true },
- { "cafedupont.nl", true },
- { "cafeimsueden.de", true },
- { "cafejulian.com", true },
- { "cafelandia.net", true },
- { "cafenix.tk", true },
- { "cafeobscura.nl", true },
- { "caferagazzi.de", true },
- { "cafermin.com", true },
- { "cafeterasbaratas.net", true },
- { "caffeinatedcode.com", true },
- { "caffeinatedengineers.com", true },
- { "caffeinefiend.org", true },
- { "cafled.org", true },
- { "caglarcakici.com", true },
- { "cainhosting.com", false },
- { "cairuz.in", true },
- { "cais.de", true },
- { "caizx.com", false },
- { "caja-pdf.es", true },
- { "cajalosandes.cl", true },
- { "cajio.ru", true },
- { "cakearific.com", true },
- { "cakeoffencesact.uk", true },
- { "cakesbyzoey.com", true },
- { "cakestart.net", true },
- { "caketoindia.com", true },
- { "cakingandbaking.com", true },
- { "cakirlarshipyard.com", true },
- { "calaad.net", true },
- { "calabasaselectric.com", true },
- { "calabasaselectrical.com", true },
- { "calabasaselectrician.com", true },
- { "calabasasexteriorlighting.com", true },
- { "calabasaslandscapelighting.com", true },
- { "calabasaslighting.com", true },
- { "calabasasoutdoorlighting.com", true },
- { "calaborlawnews.com", true },
- { "calafont.cat", false },
- { "calandrahosting.tk", true },
- { "calaverasmedicalcannabis.com", true },
- { "calbertsen.dk", true },
- { "calcedge.com", true },
- { "calcinacci.com", true },
- { "calcioragusa.tk", true },
- { "calcoolator.pl", true },
- { "calculadoraconversor.com", true },
- { "calcularis.ch", true },
- { "calculateaspectratio.com", true },
- { "calculates.org", true },
- { "calculator-imt.com", true },
- { "calculator.tf", true },
- { "calcworkshop.com", true },
- { "caldersoldas.com.br", true },
- { "caldervets.co.uk", true },
- { "caldoletto.com", true },
- { "calebthompson.io", true },
- { "calehoo.com", true },
- { "calendar.cf", false },
- { "calendar.google.com", true },
- { "calendarr.com", true },
- { "calendarsnow.com", true },
- { "calendly.com", true },
- { "calendriergn.ch", true },
- { "calenfil.com", true },
- { "caletka.cz", true },
- { "calgoty.com", true },
- { "calibra.com", true },
- { "calibreapp.com", false },
- { "calibso.net", true },
- { "calichines.com", true },
- { "caliderumba.com", true },
- { "californiawomensmedicalclinic.com", true },
- { "calitateavietii-ardeal.ro", true },
- { "calixte-concept.fr", true },
- { "call-centervko.kz", true },
- { "call.me", true },
- { "callanan.nl", true },
- { "callantonia.com", true },
- { "callear.org", true },
- { "callerstrom.se", true },
- { "callfunc.com", true },
- { "callhub.io", true },
- { "callmewhatever.com", true },
- { "calltoar.ms", true },
- { "calltothepen.com", true },
- { "callumsilcock.com", true },
- { "callumsilcock.me", true },
- { "calluna.nl", true },
- { "calluro.hr", true },
- { "calmtech.com", true },
- { "calomel.org", true },
- { "calonmahasiswa.com", true },
- { "calotte-academy.com", true },
- { "calposa.ml", true },
- { "calrotaract.org", true },
- { "calucon.de", true },
- { "calverleyparish.church", true },
- { "calvin.my", true },
- { "calvinallen.net", false },
- { "calzadonline1-latam.com", true },
- { "calzadonline1.com", true },
- { "camago.dk", true },
- { "camara360grados.com", true },
- { "camaradivisas.com", true },
- { "camaras.uno", true },
- { "camarilloelectric.com", true },
- { "camarilloelectrical.com", true },
- { "camarilloexteriorlighting.com", true },
- { "camarillolandscapelighting.com", true },
- { "camarillolighting.com", true },
- { "camarillooutdoorlighting.com", true },
- { "camashop.de", true },
- { "camastowncar.com", true },
- { "cambiemosjuegos.com", true },
- { "cambier.org", true },
- { "cambiowatch.ch", false },
- { "cambodiainfo.tk", true },
- { "cambodian.dating", true },
- { "cambreaconsulting.com", true },
- { "cambridge-examen.nl", true },
- { "cambridge-security.com", true },
- { "cambridgebouncers.co.uk", true },
- { "cambridgesecuritygroup.org", true },
- { "cambuslangharriers.org", true },
- { "camcapital.com", true },
- { "camconn.cc", true },
- { "camdesign.pl", true },
- { "cameo-membership.uk", true },
- { "camera-news.com", true },
- { "cameramark.nl", true },
- { "cameraslyphotography.tk", true },
- { "cameraviva.com.br", true },
- { "camerweb.es", true },
- { "camilomodzz.net", true },
- { "camisetasmalwee.com.br", true },
- { "camolist.com", true },
- { "camp-pleinsoleil.ch", true },
- { "camp.co.uk", true },
- { "campaign-ad.com", true },
- { "campaign.gov.uk", true },
- { "campaignhelpdesk.org", true },
- { "campaignlake.com", true },
- { "campaignwiki.org", true },
- { "campamentos.info", true },
- { "campbellapplianceheatingandair.com", true },
- { "campcambodia.org", true },
- { "campcanada.org", true },
- { "camperdays.de", true },
- { "camperlist.com", true },
- { "campermanaustralia.com", true },
- { "campertrailerfinance.com.au", true },
- { "camperverzekerd.nl", true },
- { "campfiretails.org", true },
- { "camping-aupigeonnier.fr", true },
- { "camping-landes.com", true },
- { "camping-le-pasquier.com", true },
- { "camping-seilershof.de", true },
- { "campinghuntingshooting.com", true },
- { "campingshop.pl", true },
- { "campingskyhooks.com", true },
- { "campistry.net", true },
- { "campmackinaw.com", true },
- { "campo-salado.com", true },
- { "campsoulfestival.com", true },
- { "campula.cz", true },
- { "campus-discounts.com", true },
- { "campus-finance.com", true },
- { "campusdrugprevention.gov", false },
- { "campusfit.co", true },
- { "campuswire.com", true },
- { "campvana.com", true },
- { "campwabashi.org", true },
- { "camshowdir.com", true },
- { "camshowdir.to", true },
- { "camshowhive.to", true },
- { "camshowhub.com", true },
- { "camshowhub.to", true },
- { "camshowplace.to", true },
- { "camshowstorage.com", true },
- { "camshowstorage.to", true },
- { "camshowverse.com", true },
- { "camshowverse.to", true },
- { "camsky.de", false },
- { "canada.ind.br", true },
- { "canadabread.com", false },
- { "canadaradon.com", true },
- { "canadasmotorcycle.ca", true },
- { "canadian.dating", true },
- { "canadianatheists.ca", true },
- { "canadianatheists.com", true },
- { "canadianoutdoorequipment.com", true },
- { "canadiantouristboard.com", true },
- { "canalecontracting.com", true },
- { "canalsidehouse.be", true },
- { "canalsidehouse.com", true },
- { "canariculturacolor.com", true },
- { "canarymod.net", true },
- { "canavilage.com", true },
- { "canavillage.net", true },
- { "canavillagepuntacana.com", true },
- { "canavillageresidences.com", true },
- { "canberraoutletcentre.com.au", true },
- { "cancerdata.nhs.uk", true },
- { "candaceplayforth.com", true },
- { "candelec.com", false },
- { "candeo-books.nl", true },
- { "candex.com", true },
- { "candguchocolat.com", true },
- { "candicecity.com", true },
- { "candidasa.com", true },
- { "candidateexperiencemarketing.nl", true },
- { "candidatlibre.net", true },
- { "candidaturedunprix.com", true },
- { "candinya.com", true },
- { "candinya.me", true },
- { "cando.eu", true },
- { "canfazz.com", true },
- { "cangku.in", true },
- { "canglong.net", true },
- { "canhas.report", true },
- { "canhazip.com", true },
- { "canhq.tk", true },
- { "canihavesome.coffee", true },
- { "canine-mobility.com", true },
- { "caniuse.email", true },
- { "canker.org", true },
- { "canmipai.com", true },
- { "cannabis-marijuana.com", true },
- { "cannabiscare.ca", true },
- { "cannabislegality.info", true },
- { "cannabismd.com", true },
- { "cannacards.ca", true },
- { "cannacun.com", true },
- { "cannaffiliate.com", true },
- { "cannagoals.com", true },
- { "cannahealth.com", true },
- { "cannoli.london", true },
- { "cannyfoxx.me", true },
- { "canobag.es", true },
- { "canoonic.se", true },
- { "canopycleaningmelbourne.com.au", true },
- { "canopytax.com", true },
- { "cant.at", true },
- { "cantatio.ch", false },
- { "canterbury.ws", true },
- { "canterburybouncycastlehire.co.uk", true },
- { "cantonroadjewelry.com", true },
- { "cantosdisidentes.tk", true },
- { "canttboardpachmarhi.org", true },
- { "canva-dev.com", true },
- { "canva.cn", true },
- { "canva.com", true },
- { "canx.org", true },
- { "canyonshoa.com", true },
- { "canyoupwn.me", true },
- { "cao.gov", true },
- { "cao.la", true },
- { "caoliu.tech", true },
- { "caoshan60.com", true },
- { "capachitos.cl", true },
- { "capacitacionyautoempleo.com", true },
- { "capacityproject.org", true },
- { "capbig.com", true },
- { "capeannpediatrics.com", true },
- { "capebretonpiper.com", true },
- { "caph.info", true },
- { "caphane.com", true },
- { "caphefin.com", true },
- { "capillary.io", true },
- { "capitainebaggy.ch", false },
- { "capital-match.com", true },
- { "capitalcap.com", true },
- { "capitalcollections.org.uk", true },
- { "capitalfps.com", true },
- { "capitalibre.com", true },
- { "capitalism.party", true },
- { "capitalist.cf", true },
- { "capitalmediaventures.co.uk", true },
- { "capitalonecardservice.com", true },
- { "capitalp.jp", true },
- { "capitalquadatv.org.nz", true },
- { "capitolpathways.org", true },
- { "caplinbouncycastles.co.uk", true },
- { "capper.de", true },
- { "capriccio.to", true },
- { "caprichosdevicky.com", true },
- { "caps.is", true },
- { "capsogusto.com", true },
- { "capstansecurity.co.uk", true },
- { "capstansecurity.com", true },
- { "capstoneinsights.com", true },
- { "captain-dandelion.com", true },
- { "captainark.net", true },
- { "captainfit.in", true },
- { "captainsfarm.in", true },
- { "captivationtheory.com", true },
- { "capturapp.com", false },
- { "capture-app.com", true },
- { "capuchinox.com", true },
- { "caputodesign.com", true },
- { "car-spaw-rac.fr", true },
- { "car.info", true },
- { "car24.de", true },
- { "car24portal.de", true },
- { "caraccio.li", true },
- { "carapax.net", true },
- { "carassure.de", true },
- { "carauctionnetwork.com", true },
- { "carauctionsalabama.com", true },
- { "carauctionscarolina.com", true },
- { "carauctionsgeorgia.com", true },
- { "carauctionsillinois.com", true },
- { "caravanserail.info", true },
- { "carbon-designz.com", true },
- { "carbon-project.org", true },
- { "carbon.coop", true },
- { "carbon12.org", true },
- { "carbon12.software", true },
- { "carbonating.com", true },
- { "carboneselectricosnettosl.info", false },
- { "carbonnel.me", true },
- { "carbono.uy", true },
- { "carbontv.com", true },
- { "carburetorcycleoi.com", true },
- { "carbuyersbrisbane.com.au", true },
- { "carcloud.ch", true },
- { "card-cashing.com", true },
- { "cardano.eco", true },
- { "cardanoinvestment.com", true },
- { "cardcaptorsakura.jp", true },
- { "carddreams.be", true },
- { "carddreams.de", true },
- { "carddreams.es", true },
- { "carddreams.nl", true },
- { "cardexchangesolutions.com", true },
- { "cardiagnostics.tk", true },
- { "cardioc.ru", true },
- { "cardios.srv.br", true },
- { "cardoni.net", true },
- { "cardozovargas.com", true },
- { "cardozovargas.me", true },
- { "cardranking.jp", true },
- { "cardrecovery.fr", true },
- { "cardsolutionsbh.com.br", true },
- { "cardxl.be", true },
- { "cardxl.de", true },
- { "cardxl.fr", true },
- { "cardxl.nl", true },
- { "care-spot.biz", true },
- { "care-spot.com", true },
- { "care-spot.info", true },
- { "care-spot.mobi", true },
- { "care-spot.net", true },
- { "care-spot.org", true },
- { "care-spot.us", true },
- { "care4all.com", true },
- { "careeapp.com", true },
- { "career.support", true },
- { "careeroptionscoach.com", true },
- { "careers.plus", true },
- { "careertransformed.com", true },
- { "carefulcolor.com", true },
- { "caremad.io", true },
- { "carepan.ga", true },
- { "carepassport.com", true },
- { "carespot.biz", true },
- { "carespot.co", true },
- { "carespot.mobi", true },
- { "carespot.net", true },
- { "carespot.org", true },
- { "carespot.us", true },
- { "carespotexpress.com", true },
- { "carespotexpresshealthcare.com", true },
- { "carespottravelmedicine.com", true },
- { "carespoturgentcare.com", true },
- { "carespoturgentcare.info", true },
- { "carespoturgentcare.net", true },
- { "carespoturgentcare.org", true },
- { "carespoturgentcare.us", true },
- { "caretta.co.uk", true },
- { "careyshop.cn", true },
- { "carezone.com", false },
- { "carfinancehelp.com", true },
- { "carfinans.ru", true },
- { "carfraemill.co.uk", true },
- { "cargobas.com", true },
- { "cargoguard.com", true },
- { "cargomaps.com", true },
- { "cargorestraintsystems.com.au", true },
- { "cargosapiens.com.br", true },
- { "carhunters.cz", true },
- { "caribbean.dating", true },
- { "caribbeanexams.com", true },
- { "caribougrill.com", true },
- { "caribuku.tk", true },
- { "carigami.fr", true },
- { "caringladies.org", true },
- { "carinthia.eu", true },
- { "carisenda.com", true },
- { "carium.com", true },
- { "carkeysanantonio.com", true },
- { "carlavitalesteticista.com", true },
- { "carlgo11.com", true },
- { "carlife-at.jp", true },
- { "carlili.fr", true },
- { "carlingfordapartments.com.au", true },
- { "carlinmack.com", true },
- { "carlitoxxpro.com", true },
- { "carlmjohnson.net", false },
- { "carlobiagi.de", true },
- { "carlocksmith--dallas.com", true },
- { "carlocksmithbaltimore.com", true },
- { "carlocksmithcarrollton.com", true },
- { "carlocksmithellicottcity.com", true },
- { "carlocksmithfallbrook.com", true },
- { "carlocksmithkey.com", true },
- { "carlocksmithlewisville.com", true },
- { "carlocksmithmesquite.com", true },
- { "carlocksmithtucson.com", true },
- { "carlosabarbamd.com", true },
- { "carlosfelic.io", true },
- { "carlosjeurissen.com", true },
- { "carlosjeurissen.nl", true },
- { "carlosmfalves.eu", true },
- { "carlot-j.com", true },
- { "carls-fallout-4-guide.com", true },
- { "carltontownfc.tk", true },
- { "carmatworld.co.uk", true },
- { "carmelglenane.com", true },
- { "carmelrise.co.uk", true },
- { "carmeni.tk", true },
- { "carmenluz.fr", true },
- { "carmineforsheriff.com", true },
- { "carnaticalifornia.com", true },
- { "carnet-du-voyageur.com", true },
- { "carnildo.com", true },
- { "caroes.be", true },
- { "caroffer.ch", true },
- { "carol-lambert.com", true },
- { "carolcappelletti.com", true },
- { "carolcestas.com", true },
- { "caroli.com", true },
- { "caroli.name", true },
- { "caroli.net", true },
- { "carolicious.tk", true },
- { "carolina.cz", true },
- { "carolinaclimatecontrolsc.com", true },
- { "carolinaoliveira.tk", true },
- { "carolinapainandspine.com", true },
- { "carolineball.com", true },
- { "carolineeball.com", true },
- { "carolinehanania.com", true },
- { "carolynjoyce.com.au", true },
- { "carontetourist.hr", true },
- { "carontetouristisoleminori.it", true },
- { "carousel.ga", true },
- { "carparo.net", true },
- { "carpet---cleaning.com", true },
- { "carpetandhardwoodflooringpros.com", true },
- { "carpetcleaning-cypress.com", true },
- { "carpetcleaningtomball.com", true },
- { "carplus.es", true },
- { "carplus.net", true },
- { "carpuya.ga", true },
- { "carrabiners.tk", true },
- { "carrando.com", true },
- { "carre-lutz.com", true },
- { "carriedin.com", true },
- { "carrierplatform.com", true },
- { "carringtonrealtygroup.com", true },
- { "carroattrezzimilanodaluiso.it", true },
- { "carroceriascarluis.com", true },
- { "cars4salecy.com", true },
- { "carshippingcarriers.com", true },
- { "carson-aviation-adventures.com", true },
- { "carson-matthews.co.uk", true },
- { "carsoug.com", true },
- { "carspneu.cz", true },
- { "cartaodigi.com", true },
- { "cartegrise.xyz", true },
- { "carteirasedistintivos.com.br", true },
- { "carterdan.net", true },
- { "carterstad.se", true },
- { "cartertonscouts.org.nz", true },
- { "cartes-voyance.fr", true },
- { "cartesentreprises-unicef.fr", true },
- { "carthedral.com", true },
- { "cartierplan.ga", false },
- { "carto.la", true },
- { "cartongesso.roma.it", true },
- { "cartooncastles.ie", true },
- { "cartouche24.eu", true },
- { "cartucce24.it", true },
- { "cartwrightrealestate.com", true },
- { "carusorealestate.com", true },
- { "carwashdruten.nl", true },
- { "carwellness-hinkelmann.de", true },
- { "cas-chauxdefonds.ch", true },
- { "casa-app.de", true },
- { "casa-due-pur.com", true },
- { "casa-due-pur.de", true },
- { "casa-due.com", true },
- { "casa-laguna.net", true },
- { "casa-lunch-break.de", true },
- { "casa-lunchbreak.de", true },
- { "casa-mea-inteligenta.ro", true },
- { "casaasia.cat", true },
- { "casaasia.es", true },
- { "casaasia.eu", true },
- { "casabouquet.com", true },
- { "casacazoleiro.com", true },
- { "casacochecurro.com", true },
- { "casadasportasejanelas.com", true },
- { "casadoarbitro.com.br", true },
- { "casadopulpo.com", true },
- { "casadowifi.com.br", true },
- { "casalindamex.com", true },
- { "casalribeiro.com", true },
- { "casalunchbreak.de", true },
- { "casamariposaspi.com", true },
- { "casapalla.com.br", true },
- { "casasuara.com", true },
- { "casavacanze.estate", true },
- { "casbuijs.nl", true },
- { "casburggraaf.com", false },
- { "casc.cz", true },
- { "cascadesjobcorpscca.com", true },
- { "cascavelle.fr", true },
- { "cascavelle.nl", true },
- { "case-vacanza-salento.com", true },
- { "casecoverkeygi.com", true },
- { "casecurity.org", true },
- { "caseificio.roma.it", true },
- { "caseof.fr", true },
- { "caseplus-daem.de", true },
- { "cases.lu", true },
- { "caseycapitalpartners.com", true },
- { "cash-4x4.com", true },
- { "cashati.com", true },
- { "cashbook.co.tz", true },
- { "cashbot.cz", true },
- { "cashbot.sk", true },
- { "cashenvoy.com", true },
- { "cashfazz.com", true },
- { "cashflowstrategist.com", true },
- { "cashforcarremovalsipswich.com.au", true },
- { "cashlogic.ch", false },
- { "cashmaxtexas.com", true },
- { "cashontime.com", true },
- { "cashplk.com", true },
- { "casian.ir", true },
- { "casino-cash-flow.com", true },
- { "casino-cash-flow.com.ru", true },
- { "casino-cash-flow.info", true },
- { "casino-cash-flow.pro", true },
- { "casino-cash-flow.ru", true },
- { "casino-cash-flow.su", true },
- { "casino-cashflow.ru", true },
- { "casinocash-flow.ru", true },
- { "casinocashflow.pro", true },
- { "casinocashflow.ru", true },
- { "casinocashflow.su", true },
- { "casinocashflow.xyz", true },
- { "casinochecking.com", true },
- { "casinoguide.dk", true },
- { "casinolegal.pt", true },
- { "casinolistings.com", true },
- { "casinomucho.com", true },
- { "casinomucho.org", true },
- { "casinomucho.se", true },
- { "casinoportugal.pt", true },
- { "casinorewards.info", true },
- { "casinorobots.com", true },
- { "casinosblockchain.io", true },
- { "casinotokelau.tk", true },
- { "casio-caisses-enregistreuses.fr", true },
- { "casjenprome.cz", true },
- { "casperfirm.com", true },
- { "casperpanel.com", true },
- { "caspicards.com", true },
- { "cassimo.com", false },
- { "castbulletassoc.org", false },
- { "castelannenberg.com", true },
- { "castellet.tk", true },
- { "castiana.xyz", true },
- { "castible.de", true },
- { "castle-engine.io", true },
- { "castle.network", true },
- { "castlecapers.com.au", true },
- { "castlecms.io", true },
- { "castleking.net", true },
- { "castlekingdomstockport.co.uk", true },
- { "castlekingkent.co.uk", true },
- { "castleparty.co.uk", true },
- { "castlepointanime.com", true },
- { "castles-in-the-sky.co.uk", true },
- { "castles4kidz.com", true },
- { "castlesrus-kent.com", true },
- { "castleswa.com.au", true },
- { "castrillodelavega.tk", true },
- { "cat.net", true },
- { "cat73.org", true },
- { "cat93.com", true },
- { "catalog-underwear.tk", true },
- { "catalog.beer", true },
- { "catalogobiblioteca.com", true },
- { "catalogobiblioteca.net", true },
- { "catalogosvirtualesonline.com", true },
- { "catalyconv.com", true },
- { "catalystapp.co", true },
- { "catbold.space", true },
- { "catbox.moe", true },
- { "catbull.com", true },
- { "catburton.co.uk", true },
- { "catchers.cc", true },
- { "catchersgear.com", true },
- { "catchhimandkeephim.com", true },
- { "catchief.com", true },
- { "catchkol.com", true },
- { "catcoxx.de", true },
- { "catenacondos.com", true },
- { "caterbing.com", true },
- { "catering-xanadu.cz", true },
- { "cateringvanhetland.nl", true },
- { "catfooddispensersreviews.com", true },
- { "catgirl.science", true },
- { "catharinesomerville.com", true },
- { "catharisme.eu", false },
- { "cathcartandwinn.com", true },
- { "catherinejf.com", true },
- { "cathiebrousse.com", true },
- { "catholic8964.org", true },
- { "catholics.dating", true },
- { "catholicteacherresources.com", true },
- { "cathosa.nl", true },
- { "cathouse.me", true },
- { "cathy.guru", true },
- { "cathy.lgbt", true },
- { "cathy.website", true },
- { "cathyfitzpatrick.com", true },
- { "cathyjf.ca", true },
- { "cathyjf.com", true },
- { "cathyjf.net", true },
- { "cathyjf.org", true },
- { "cathyjfitzpatrick.com", true },
- { "catiadecastro.com", true },
- { "cativa.net", true },
- { "catl.st", true },
- { "catlovingcare.com", true },
- { "catmoose.ca", true },
- { "catram.org", true },
- { "catus.moe", true },
- { "catveteran.com", true },
- { "caughtredhanded.co.nz", true },
- { "caulfieldeastapartments.com.au", true },
- { "caulfieldracecourseapartments.com.au", true },
- { "cav.ac", true },
- { "cavac.at", true },
- { "cavenderhill.com", true },
- { "cavern.tv", true },
- { "cavzodiaco.com.br", true },
- { "caxalt.com", true },
- { "caycehouse.com", true },
- { "caylercapital.com", true },
- { "cazaviajes.es", true },
- { "cazes.info", true },
- { "cb-crochet.com", true },
- { "cb1388.com", true },
- { "cb1588.com", true },
- { "cbbank.com", true },
- { "cbc-hire.co.uk", true },
- { "cbcf.info", true },
- { "cbd.casa", true },
- { "cbd.supply", true },
- { "cbdcontact.eu", true },
- { "cbdev.de", true },
- { "cbdmarket.space", true },
- { "cbdoilcures.co", true },
- { "cbecrft.net", true },
- { "cbin168.com", true },
- { "cbintermountainrealty.com", true },
- { "cbnainital.org.in", true },
- { "cbr-rcb.ca", true },
- { "cbr-xml-daily.ru", true },
- { "cbsdeheidevlinder.nl", true },
- { "cbt.tj", true },
- { "cbw.sh", true },
- { "cc-customer.de", true },
- { "cc00228.com", false },
- { "cc8822.cc", true },
- { "cc8833.cc", true },
- { "ccattestprep.com", true },
- { "ccavenue.com", true },
- { "ccblicense.com", true },
- { "ccc-ch.ch", true },
- { "ccc-cloud.de", true },
- { "cccwien.at", true },
- { "ccelectricaldrafting.ca", true },
- { "cceputnam360.com", true },
- { "ccgx.de", false },
- { "ccli.com", true },
- { "ccoooss.com", true },
- { "ccparishwilmington.org", true },
- { "ccprwebsite.org", true },
- { "ccr.ovh", true },
- { "ccriderlosangeles.com", true },
- { "ccsistema.com", true },
- { "cctv-supraveghere.ro", true },
- { "cctvview.info", true },
- { "ccu.plus", true },
- { "ccuuu.com", true },
- { "cd-shopware.de", true },
- { "cd-sport.com", true },
- { "cd.search.yahoo.com", false },
- { "cd5k.net", true },
- { "cda-aigle.ch", true },
- { "cdasenegal.com", true },
- { "cdasiaonline.com", false },
- { "cdbf.ch", false },
- { "cdbtech.com", true },
- { "cdburnerxp.se", true },
- { "cdc.cx", true },
- { "cdda.ch", false },
- { "cdemi.io", true },
- { "cdepot.eu", true },
- { "cdf.wiki", true },
- { "cdgfrm.com", true },
- { "cdigitale.com", true },
- { "cdireland.com", true },
- { "cdkeykopen.com", true },
- { "cdkeyprices.com", true },
- { "cdkeyworld.de", true },
- { "cdlinares.tk", true },
- { "cdmdisinfestazioni.it", true },
- { "cdn.ampproject.org", true },
- { "cdn6.de", true },
- { "cdncompanies.com", true },
- { "cdnjs.com", true },
- { "cdns.cloud", true },
- { "cdnsys.net", true },
- { "cdnya.com", true },
- { "cdom.de", true },
- { "cdsdigital.de", true },
- { "cdshining.com", true },
- { "cdu-gebhardshain.de", true },
- { "cdvl.org", true },
- { "ce-agentur.de", false },
- { "ce-pimkie.fr", true },
- { "ce-webdesign.de", true },
- { "ceanimalhealth.com", true },
- { "cebz.org", true },
- { "cecame.ch", true },
- { "ceciliacolombara.com", true },
- { "cecilwalker.com.au", false },
- { "cedarcitydining.com", true },
- { "cedarslodge.com", true },
- { "cedehb.be", true },
- { "cedric-bour.fr", true },
- { "cedricbonhomme.org", true },
- { "cedriccassimo.ch", false },
- { "cedriccassimo.com", false },
- { "ceebee.com", true },
- { "ceefaastresources.com", true },
- { "cegss.org.gt", true },
- { "ceiba.com.co", true },
- { "ceiphr.com", true },
- { "cejhon.cz", false },
- { "celadas.tk", true },
- { "celcelulares.com", true },
- { "celcomhomefibre.com.my", true },
- { "cele.bi", true },
- { "celebmasta.com", true },
- { "celebrasianconference.com", true },
- { "celebrityhealthcritic.com", true },
- { "celebrityscope.net", true },
- { "celebritytopnews.tk", true },
- { "celestebonito.pt", true },
- { "celiac.com", true },
- { "celiendev.ch", false },
- { "celine-patisserie.fr", true },
- { "cell-lookup.com", true },
- { "cellartracker.com", true },
- { "cellebrite.com", true },
- { "celliberate.co.uk", true },
- { "celltek-server.de", false },
- { "celltesequ.com", true },
- { "celltick.com", true },
- { "celtadigital.com", true },
- { "celti.ie.eu.org", true },
- { "celti.name", true },
- { "cementscience.com", true },
- { "ceml.ch", true },
- { "cenatorium.pl", true },
- { "cendata.co.uk", true },
- { "cennelley.com", true },
- { "cennelly.com", true },
- { "censurfridns.dk", true },
- { "censurfridns.nu", true },
- { "censys.io", true },
- { "centaur.de", true },
- { "centennialradon.com", true },
- { "centennialrewards.com", true },
- { "centennialseptic.com", true },
- { "center-elite.ml", true },
- { "centermk.ru", true },
- { "centerpereezd.ru", false },
- { "centerperson.org", true },
- { "centerpoint.ovh", true },
- { "centio.bg", true },
- { "centos.cz", true },
- { "centos.tips", true },
- { "centralbank.ae", true },
- { "centraldoencanador.com.br", true },
- { "centralebigmat.eu", true },
- { "centralegedimat.eu", true },
- { "centralfor.me", true },
- { "centralheating.hu", true },
- { "centralmissourifoundationrepair.com", true },
- { "centralpaellera.com", true },
- { "centralpoint.be", false },
- { "centralpoint.nl", false },
- { "centralstatecu.org", true },
- { "centrationgame.com", true },
- { "centreagree.com", true },
- { "centredaccueil.fr", false },
- { "centrederessourcement.com", true },
- { "centreoeil.ch", false },
- { "centrepointorguk-dev.azurewebsites.net", true },
- { "centrobill.com", true },
- { "centrodeesteticarecife.com", true },
- { "centroecuestrecastellar.com", true },
- { "centrojovencuenca.es", true },
- { "centrolavoro.org", true },
- { "centroperugia.gr", true },
- { "centrosocialferrel.pt", true },
- { "centrum-edukacji.tk", true },
- { "centrumhodinek.cz", true },
- { "centruvechisv.ro", true },
- { "centum.no", true },
- { "centura.de", true },
- { "centurialeonina.com", true },
- { "centurion-consulting.net", true },
- { "centurion-consulting.tech", true },
- { "centurioninfosec.com", true },
- { "centurioninfosec.com.sg", true },
- { "centurioninfosec.hk", true },
- { "centurioninfosec.sg", true },
- { "centurykiaparts.com", true },
- { "centurystonedental.com", true },
- { "ceopedia.org", true },
- { "ceramiche.roma.it", true },
- { "ceramixcoating.nl", true },
- { "ceramiya.com", true },
- { "cerastar.com", true },
- { "cerber.us", true },
- { "cerberis.com", true },
- { "cerberusinformatica.it", true },
- { "cerena-silver.ru", true },
- { "ceres-corp.org", true },
- { "cerivo.co.uk", true },
- { "cermak.photos", true },
- { "cernac.cz", true },
- { "cerpus-course.com", true },
- { "cerrajeriaamericadelquindio.com", true },
- { "cerrajeriaenvillavicencio.com", true },
- { "cert.ee", true },
- { "cert.govt.nz", true },
- { "certaintelligence.com", true },
- { "certbus.com", true },
- { "certcenter.com", true },
- { "certchannel.com", true },
- { "certevia.com", true },
- { "certfa.com", true },
- { "certible.com", true },
- { "certificatedetails.com", true },
- { "certificatetools.com", false },
- { "certificato-prevenzione-incendi.it", true },
- { "certificazioni-energetiche.it", true },
- { "certifiednurses.org", true },
- { "certisoncologysolutions.com", true },
- { "certmonitor.com.au", true },
- { "certmonitor.net", true },
- { "certnazionale.it", true },
- { "certspotter.com", true },
- { "certspotter.org", true },
- { "cervejista.com", true },
- { "ces-ltd.co.uk", true },
- { "cesarparedespacora.com", true },
- { "cesdb.com", true },
- { "cesipagano.com", true },
- { "ceskaexpedice.org", true },
- { "ceskepivnesety.sk", true },
- { "ceskepivnisety.cz", true },
- { "ceso-saco.com", true },
- { "cesobaly.cz", true },
- { "cestasedelicias.com.br", true },
- { "cetamol.com", true },
- { "ceu.edu", false },
- { "cevin.at", true },
- { "cevo.com.hr", true },
- { "cezdent.com", true },
- { "cf-ide.de", true },
- { "cfc-swc.gc.ca", true },
- { "cfda.gov", true },
- { "cfdcre5.org", true },
- { "cfh.com", true },
- { "cfigura.com", true },
- { "cflsystems.com", false },
- { "cfno.org", true },
- { "cfo.gov", true },
- { "cfpa-formation.fr", true },
- { "cfrq.ca", true },
- { "cfsh.tk", true },
- { "cftc.gov", true },
- { "cftcarouge.com", false },
- { "cfxdesign.com", true },
- { "cg-goerlitz.de", true },
- { "cg-systems.hu", true },
- { "cg.al", true },
- { "cg.search.yahoo.com", false },
- { "cga.best", true },
- { "cgal.org", true },
- { "cgan.de", true },
- { "cgbassurances.ch", false },
- { "cgcookiemarkets.com", true },
- { "cgeceia.cf", true },
- { "cgf-charcuterie.com", true },
- { "cgnparts.com", true },
- { "cgp.moe", true },
- { "cgpe.com", false },
- { "cgsmart.com", true },
- { "cgurtner.ch", true },
- { "ch-laborit.fr", true },
- { "ch.bzh", true },
- { "ch.search.yahoo.com", false },
- { "ch47f.com", true },
- { "chabaudparfum.com", true },
- { "chabert-provence.fr", true },
- { "chabik.com", true },
- { "chaboisseau.net", true },
- { "chad.ch", true },
- { "chadlenz.ca", true },
- { "chadpugsley.com", true },
- { "chadstoneapartments.com.au", true },
- { "chaffeyconstruction.com", true },
- { "chaifeng.com", true },
- { "chainels.com", true },
- { "chainge-re.com", true },
- { "chaip.org", true },
- { "chairsgb.com", true },
- { "chaisystems.net", true },
- { "chaletdemontagne.org", true },
- { "chaletmanager.com", true },
- { "chaletpierrot.ch", false },
- { "chaleur.com", true },
- { "challengerinvestors.tk", true },
- { "chalupalokovka.cz", true },
- { "chambion.ch", false },
- { "champdogs.co.uk", true },
- { "champdogs.com", true },
- { "champicreuse.fr", true },
- { "championcastles.ie", true },
- { "champions.co", true },
- { "championsofpowerfulliving.com", true },
- { "championweb.co.nz", false },
- { "championweb.com", false },
- { "championweb.com.au", false },
- { "championweb.com.sg", false },
- { "championweb.nz", false },
- { "championweb.sg", false },
- { "champonthis.de", true },
- { "chamsochoa.com", true },
- { "chancekorte.com", true },
- { "chancekorte.net", true },
- { "chanddriving.co.uk", true },
- { "change-coaching-gmbh.ch", true },
- { "changeanalytics.io", true },
- { "changeanalytics.us", true },
- { "changemywifipassword.com", true },
- { "changes.jp", true },
- { "changesfor.life", true },
- { "channelsurf.tv", false },
- { "chantalguggenbuhl.ch", false },
- { "chanz.com", true },
- { "chaos-games.org", true },
- { "chaos.run", true },
- { "chaoscastles.co.uk", true },
- { "chaoschemnitz.de", true },
- { "chaosdorf.de", true },
- { "chaosfield.at", true },
- { "chaospott.de", true },
- { "chaoswars.ddns.net", true },
- { "chaoswebs.net", true },
- { "chapek9.com", true },
- { "chapelfordbouncers.co.uk", true },
- { "chapelhousevet.co.uk", true },
- { "chapelle.co.uk", true },
- { "chapiteauxduleman.fr", true },
- { "chaplain.co", true },
- { "charbonnel.eu", true },
- { "charcoal-se.org", true },
- { "charcoalvenice.com", true },
- { "chardhamhotel.com", true },
- { "charge.co", false },
- { "chargify.com", true },
- { "charisma.ai", true },
- { "charitylog.co.uk", true },
- { "charlenew.xyz", true },
- { "charles-darwin.com", true },
- { "charlesbwise.com", true },
- { "charlespitonltd.com", true },
- { "charlesrogers.co.uk", true },
- { "charlestonfacialplastic.com", true },
- { "charlie4change.com", true },
- { "charliedillon.com", true },
- { "charliegarrod.com", true },
- { "charliehr.com", true },
- { "charlierogers.co.uk", true },
- { "charlierogers.com", true },
- { "charlotteomnes.com", true },
- { "charlottesvillegolfcommunities.com", true },
- { "charlottesvillehorsefarms.com", true },
- { "charlotteswimmingpoolbuilder.com", true },
- { "charlylou.de", true },
- { "charmander.me", true },
- { "charmanterelefant.at", true },
- { "charmingsaul.com", true },
- { "charmyadesara.com", true },
- { "charset.org", true },
- { "charta-digitale-vernetzung.de", true },
- { "charteroak.org", true },
- { "chartpen.com", true },
- { "chartsheets.com", true },
- { "chartsy.de", true },
- { "chartwellestate.com", true },
- { "chasafilli.ch", true },
- { "chascrazycreations.com", true },
- { "chasetrails.co.uk", true },
- { "chat-house-adell.com", true },
- { "chat-libera.org", true },
- { "chat-porc.eu", true },
- { "chat-senza-registrazione.net", true },
- { "chat.cz", true },
- { "chat40.net", true },
- { "chataberan.cz", true },
- { "chatbelgie.eu", true },
- { "chatbots.systems", true },
- { "chatear.social", true },
- { "chateau-de-lisle.fr", true },
- { "chateaudestrainchamps.com", false },
- { "chateroids.com", true },
- { "chatfacile.org", true },
- { "chatforskning.no", true },
- { "chatgrape.com", true },
- { "chathund.de", true },
- { "chatitaly.org", true },
- { "chatnederland.eu", true },
- { "chatswoodprestige.com.au", true },
- { "chatsworthelectrical.com", true },
- { "chatt-gratis.net", true },
- { "chatt-gratis.org", true },
- { "chattanoogaface.com", true },
- { "chattergalerie.eu", true },
- { "chattergallery.com", true },
- { "chattersworld.nl", true },
- { "chattingorcheating.com", true },
- { "chatu.io", true },
- { "chatu.me", true },
- { "chatucomputers.com", true },
- { "chaturbate.com", true },
- { "chaturbate.com.tw", true },
- { "chaturbates.org", true },
- { "chatxp.com", true },
- { "chatxsingle.net", true },
- { "chatxtutti.com", true },
- { "chatzimanolis.com", true },
- { "chatzimanolis.gr", true },
- { "chauffage-budget.fr", true },
- { "chaurocks.com", true },
- { "chaussenot.net", true },
- { "chaussurerunning.fr", true },
- { "chaussuresmarche.fr", true },
- { "chavetaro.com", true },
- { "chawa.jp", true },
- { "chazalet.fr", false },
- { "chbs.me", true },
- { "chch.it", true },
- { "chcoc.gov", true },
- { "chcsct.com", true },
- { "chcuscojungle.com", true },
- { "chd-expert.fr", true },
- { "cheap-colleges.com", true },
- { "cheap-life-insurance-quote.com", true },
- { "cheapcaribbean.com", true },
- { "cheapessay.net", true },
- { "cheapestgamecards.at", true },
- { "cheapestgamecards.be", true },
- { "cheapestgamecards.co.uk", true },
- { "cheapestgamecards.com", true },
- { "cheapestgamecards.fi", true },
- { "cheapestgamecards.fr", true },
- { "cheapestgamecards.nl", true },
- { "cheapestgamecards.no", true },
- { "cheapgeekts.com", false },
- { "cheapgoa.com", true },
- { "cheapiesystems.com", true },
- { "cheapsharedhost.com", true },
- { "cheapsharedhost.org", true },
- { "cheapsmall.tk", true },
- { "cheapssl.com.tr", true },
- { "cheapsslrenewal.com", true },
- { "cheapsslsecurity.com.au", true },
- { "cheapticket.in", true },
- { "cheapwritinghelp.com", true },
- { "cheapwritingservice.com", true },
- { "cheatengine.pro", true },
- { "cheater.best", true },
- { "cheatsupreme.com", true },
- { "cheazey.net", true },
- { "cheazey.org", true },
- { "check.torproject.org", false },
- { "checkandreportlive.com", true },
- { "checkblau.de", true },
- { "checkmatewebsolutions.com", true },
- { "checkmin.cf", true },
- { "checkmyessay.com", true },
- { "checkmyhttps.net", true },
- { "checkmypsoriasis.com", true },
- { "checkout.google.com", true },
- { "checkpoint-tshirt.com", true },
- { "checkra.in", true },
- { "checkrent.ir", true },
- { "checkspf.net", true },
- { "checktype.com", true },
- { "checkui.com", true },
- { "checkwebsiteonline.com", true },
- { "checkyourmath.com", true },
- { "checkyourprivilege.org", true },
- { "checkyourreps.org", true },
- { "checos.co.uk", true },
- { "cheddarpayments.com", true },
- { "cheekycharliessoftplay.co.uk", true },
- { "cheekymonkeysinflatables.co.uk", true },
- { "cheela.org", true },
- { "cheem.co.uk", true },
- { "cheeseemergency.co.uk", true },
- { "cheetahwerx.com", true },
- { "cheezflix.uk", true },
- { "chefcuisto.com", true },
- { "chefkoch.de", true },
- { "chefpablito.tk", true },
- { "chefz.co", true },
- { "chehalemgroup.com", true },
- { "cheladmin.ru", true },
- { "chelpogoda.tk", true },
- { "chelseafs.co.uk", true },
- { "cheltenhambouncycastles.co.uk", true },
- { "cheltik.ru", true },
- { "chelyaba.tk", true },
- { "chemco.mu", true },
- { "chemicalcrux.org", true },
- { "chemicalpharm.com", true },
- { "chemiphys.com", false },
- { "chemistry-schools.com", true },
- { "chenapartment.com", true },
- { "cheneypartners.com", true },
- { "chengfayun.com", true },
- { "chengxindong.com", true },
- { "chenkun.pro", true },
- { "chenky.com", true },
- { "chenna.me", true },
- { "chennien.com", true },
- { "chenpei.org", true },
- { "chenqinghua.com", true },
- { "chenx221.ml", true },
- { "chenx221.xyz", true },
- { "chenx2210.xyz", true },
- { "chenzhekl.me", true },
- { "chenzhipeng.com.cn", true },
- { "cheque-transitionactive.fr", true },
- { "cheraghestan.com", true },
- { "cherie-belle.com", true },
- { "chernyak.id.au", true },
- { "cherry-green.ch", true },
- { "cherrybread.net", true },
- { "cherryonit.com", false },
- { "cherrywoodtech.com", true },
- { "chertseybouncycastles.co.uk", true },
- { "chesapeakebaychristmas.com", true },
- { "chess.com", true },
- { "chessboardao.com", true },
- { "chesskid.com", true },
- { "chesspoint.ch", true },
- { "chestercountypediatrics.com", true },
- { "chestercountyroboticsurgery.com", true },
- { "chesterfieldplaceapartmentsstl.com", true },
- { "chestnut.cf", true },
- { "chetanrana.me", true },
- { "chetwood.se", true },
- { "chevy37.com", true },
- { "chevymotor-occasions.be", false },
- { "chewey.de", true },
- { "chewey.org", true },
- { "chewingucand.com", true },
- { "chez-janine.de", true },
- { "chez-oim.org", true },
- { "chez.moe", true },
- { "chezbernard.tk", true },
- { "chfr.search.yahoo.com", false },
- { "chhlin.com", true },
- { "chhory.com", true },
- { "chhy.at", true },
- { "chianti2002.jp", true },
- { "chiaseeds24.com", true },
- { "chiavistello.it", true },
- { "chiboard.co", true },
- { "chiboost.net", true },
- { "chibr.eu", true },
- { "chic-leather.com", true },
- { "chicagenial.com", true },
- { "chicagobreastaugdrs.com", true },
- { "chicagoemergencyclosings.com", true },
- { "chicagolug.org", false },
- { "chicback.com", true },
- { "chicisimo.com", true },
- { "chicjrajeevalochana.com", true },
- { "chicofc.tk", true },
- { "chicolawfirm.com", true },
- { "chicourologist.com", true },
- { "chicurrichi.com", true },
- { "chiemgauflirt.de", true },
- { "chif16.at", true },
- { "chika.kr", true },
- { "chikazawa.info", true },
- { "childcare.gov", true },
- { "childcounseling.org", true },
- { "childcustodylegalaid.org", true },
- { "childno.de", true },
- { "childrenandmedia.org.au", true },
- { "childrenfirstalways.org", true },
- { "childreninadversity.gov", true },
- { "childrens-room.com", true },
- { "childrensentertainmentleicester.co.uk", true },
- { "childrensfurniture.co.uk", true },
- { "childrenspartiesrus.com", true },
- { "childstats.gov", true },
- { "childvisitationassistance.org", true },
- { "chiledogphoto.com", true },
- { "chilihosting.eu", true },
- { "chilikin.pro", true },
- { "chilimath.com", true },
- { "chilio.net", true },
- { "chilliwackchurchofgod.com", true },
- { "chima.net", true },
- { "chima.us", true },
- { "chimeratool.com", true },
- { "chimerity.com", true },
- { "chimpanzee.net", true },
- { "chimpmatic.com", true },
- { "china-online-news.tk", true },
- { "chinahighlights.ru", true },
- { "chinaspaceflight.com", true },
- { "chineserecipes.xyz", true },
- { "ching.tv", true },
- { "chinwag.im", true },
- { "chinwag.org", true },
- { "chip.pl", true },
- { "chipcore.com", false },
- { "chippy.ch", false },
- { "chipset.no", true },
- { "chiralsoftware.com", true },
- { "chireiden.net", true },
- { "chiro-neuchatel.ch", false },
- { "chiropractic.gr", true },
- { "chiropracticwpb.com", true },
- { "chiropraktik-riemann.de", true },
- { "chiropraticien-neuchatel.ch", false },
- { "chiropratique-neuchatel.ch", false },
- { "chirosphere.ch", false },
- { "chirpstory.com", true },
- { "chiru.no", true },
- { "chirurgoplastico.roma.it", true },
- { "chisago-isantidfl.com", true },
- { "chit.search.yahoo.com", false },
- { "chitoku.jp", false },
- { "chksite.com", true },
- { "chl.la", true },
- { "chliine.ch", true },
- { "chlo-products.biz", true },
- { "chlo-products.net", true },
- { "chloes.gr", true },
- { "chloescastles.co.uk", true },
- { "chlth.com", true },
- { "chmc.ml", true },
- { "chmielarz.it", true },
- { "chmsoft.com.ua", true },
- { "chmsoft.ru", true },
- { "chocamekong.com", true },
- { "chocgu.com", true },
- { "chocodecor.com.br", true },
- { "chocolah.com.au", false },
- { "chocolat.work", true },
- { "chocolatesandhealth.com", true },
- { "chocolatier-tristan.ch", false },
- { "chocolytech.info", true },
- { "chocope-peru.tk", true },
- { "chodaczek.pl", true },
- { "chomp.life", true },
- { "chook.as", true },
- { "choootto.net", true },
- { "choosemypc.net", true },
- { "chopperdesign.com", true },
- { "chordify.net", true },
- { "chorpinkpoemps.de", true },
- { "chosenplaintext.org", true },
- { "chourishi-shigoto.com", true },
- { "chovancova.sk", true },
- { "choyri.com", true },
- { "chpwmedicare.org", true },
- { "chr1sbin.works", true },
- { "chris-siedler.at", true },
- { "chrisahrweileryoga.com", true },
- { "chrisaitch.com", true },
- { "chrisbryant.me.uk", true },
- { "chrisburnell.com", true },
- { "chriscarey.com", true },
- { "chriscutts.uk", true },
- { "chrisdecairos.ca", true },
- { "chrisgieger.com", true },
- { "chrisirwin.ca", true },
- { "chrisjean.com", true },
- { "chrislane.com", true },
- { "chrismarker.org", true },
- { "chrismathys.com", true },
- { "chrismcclendon.com", true },
- { "chrismckee.co.uk", true },
- { "chrismorgan.info", true },
- { "chrismurrayfilm.com", true },
- { "chrisnekarda.com", true },
- { "chrisplankhomes.com", true },
- { "chrispstreet.com", true },
- { "chrisseoguy.com", true },
- { "chrisshort.net", true },
- { "chrissmiley.co.uk", true },
- { "chrisspencercreative.com", true },
- { "chrisspencermusic.com", true },
- { "chrissx.ga", true },
- { "christadelphiananswers.org", true },
- { "christadelphians.eu", true },
- { "christec.net", true },
- { "christensenplace.us", true },
- { "christiaanconover.com", true },
- { "christian-fischer.pictures", true },
- { "christian-folini.ch", true },
- { "christian-gredig.de", true },
- { "christian-host.com", true },
- { "christian-liebel.com", true },
- { "christian-stadelmann.de", true },
- { "christianadventurecamps.org", true },
- { "christianblog.ml", true },
- { "christiancleva.com", true },
- { "christiancoleman.info", true },
- { "christiandiscourse.net", true },
- { "christianfaq.org", true },
- { "christianforums.com", true },
- { "christiangehring.org", true },
- { "christianillies.de", true },
- { "christianjens.com", true },
- { "christianliebel.com", true },
- { "christianlis.org.uk", true },
- { "christianlis.uk", true },
- { "christianmoore.me", true },
- { "christianoliff.com", true },
- { "christianpilgrimage.com.au", true },
- { "christianr.me", true },
- { "christianrasch.de", true },
- { "christians.dating", true },
- { "christianscholz.de", false },
- { "christianwitts.tech", true },
- { "christiehawkes.com", true },
- { "christiesantiques.com", true },
- { "christineandcie.fr", true },
- { "christineblachford.com", true },
- { "christineprayon.de", true },
- { "christmascard.be", true },
- { "christmaspartyhire.co.uk", true },
- { "christoph-conrads.name", true },
- { "christopher-simon.de", true },
- { "christopher.sh", false },
- { "christopherandcharlotte.uk", true },
- { "christopherburg.com", true },
- { "christopherd.me", true },
- { "christopherkennelly.com", true },
- { "christopherstocks.online", true },
- { "christophertruncer.com", true },
- { "christophsackl.de", true },
- { "christthekingparish.net", true },
- { "christtheredeemer.us", true },
- { "chriswald.com", true },
- { "chriswarrick.com", true },
- { "chriswells.io", true },
- { "chriswilding.co.uk", true },
- { "chrisx.xyz", true },
- { "chromaitaly.com", true },
- { "chromcraft-revington.com", true },
- { "chrome-devtools-frontend.appspot.com", true },
- { "chrome.com", false },
- { "chrome.google.com", true },
- { "chromebookchart.com", true },
- { "chromebooksforwork.com", true },
- { "chromereporting-pa.googleapis.com", true },
- { "chromeworld.ru", true },
- { "chromiumbugs.appspot.com", true },
- { "chromiumcodereview.appspot.com", false },
- { "chromopho.be", true },
- { "chroniclesofgeorge.com", true },
- { "chronograph.pe", true },
- { "chronology.no", true },
- { "chronosgroup.eu", true },
- { "chronoshop.cz", true },
- { "chrpaul.de", true },
- { "chrstn.eu", true },
- { "chrxw.com", true },
- { "chrysanthos.net", true },
- { "chrystajewelry.com", true },
- { "chrystus.pl", true },
- { "chs.us", false },
- { "chshealthcare.co.uk", true },
- { "chshouyu.com", true },
- { "chsterz.de", true },
- { "chtsi.uk", true },
- { "chuchote-moi.fr", true },
- { "chuck.ovh", true },
- { "chuill.com", true },
- { "chun.pro", true },
- { "chunche.net", true },
- { "chungsir.com.pa", true },
- { "chunk.science", true },
- { "chupadelfrasco.com", true },
- { "chupanhcotrang.com", true },
- { "chuppa.com.au", true },
- { "churchofsaintbenedict.com", true },
- { "churchofsaintrocco.org", true },
- { "churchofscb.org", true },
- { "churchthemes.com", true },
- { "churchwebcanada.ca", true },
- { "churchwebsupport.com", true },
- { "churningtracker.com", true },
- { "chwilrank.pl", true },
- { "chyen.cc", true },
- { "chytraauta.cz", true },
- { "chziyue.com", true },
- { "ci-fo.org", true },
- { "ci-suite.com", true },
- { "ciagutek.pl", true },
- { "cialde.it", true },
- { "cialisonlinee.com", true },
- { "ciancode.com", true },
- { "cianmawhinney.me", true },
- { "ciaracode.com", true },
- { "ciat.no", false },
- { "cibercactus.com", true },
- { "cichol.com", true },
- { "cidbot.com", true },
- { "ciderclub.com", true },
- { "cidersus.com.ec", true },
- { "cie-theatre-montfaucon.ch", false },
- { "cielly.com", true },
- { "cienciasempresariais.pt", true },
- { "cierreperimetral.com", true },
- { "cifapme.net", true },
- { "cifop-numerique.fr", true },
- { "cig-dem.com", false },
- { "cigar-cartel.com", true },
- { "cigarterminal.com", false },
- { "cihar.com", true },
- { "ciicutini.ro", true },
- { "cikeblog.com", true },
- { "cilacapnews.ml", true },
- { "ciliwang.live", true },
- { "ciliwang.org", true },
- { "cilloc.be", true },
- { "cima-idf.fr", true },
- { "cimbalino.org", true },
- { "cimballa.com", true },
- { "cimfax.com", true },
- { "cinafilm.com", true },
- { "cine-music.de", true },
- { "cine.to", true },
- { "cinefilzonen.se", true },
- { "cinefun.net", true },
- { "cinema.paris", true },
- { "cinemarxism.com", true },
- { "cinemasetfree.com", true },
- { "cinemixer.club", true },
- { "cinemysticism.com", true },
- { "cineplex.my", true },
- { "cineworld.co.in", true },
- { "cinexmachina.com", true },
- { "ciniticket.com", true },
- { "cinkciarz.pl", true },
- { "cinq-elements.com", false },
- { "cinsects.de", true },
- { "cintactimber.com", true },
- { "cio-ciso-interchange.org", true },
- { "cio-cisointerchange.org", true },
- { "cio.go.jp", false },
- { "cio.gov", false },
- { "cioscloud.com", true },
- { "cip.md", true },
- { "cipartyhire.co.uk", true },
- { "cipher.team", true },
- { "cipherboy.com", true },
- { "ciphersuite.info", true },
- { "ciphrex.com", true },
- { "cipri.com", true },
- { "cipri.net", true },
- { "cipri.nl", true },
- { "cipri.org", true },
- { "cipria.no", true },
- { "cipy.com", true },
- { "cir.is", true },
- { "circady.com", true },
- { "circara.com", true },
- { "circle-people.com", true },
- { "circu.ml", true },
- { "circuitcityelectricaladelaide.com.au", true },
- { "circulatedigital.com", true },
- { "circule.cc", true },
- { "ciri.com.co", true },
- { "cirrus0.de", true },
- { "cirruslab.ch", true },
- { "cirurgicagervasio.com.br", true },
- { "cirurgicalucena.com.br", true },
- { "cirurgicavirtual.com.br", true },
- { "cisa.gov", true },
- { "ciscodude.net", true },
- { "cisoaid.com", true },
- { "cisofy.com", true },
- { "cispeo.org", true },
- { "ciss.ltd", true },
- { "cissa.org.au", true },
- { "cissofitness.com", true },
- { "cisum-cycling.com", true },
- { "cisy.me", true },
- { "citas-adultas.com", true },
- { "citationranker.com", true },
- { "citcuit.in", true },
- { "citfin.cz", true },
- { "cities.cl", true },
- { "citimarinestore.com", true },
- { "citizenkevin.com", true },
- { "citizensbankal.com", true },
- { "citizenscience.gov", false },
- { "citizenscience.org", true },
- { "citizensgbr.org", true },
- { "citizensleague.org", true },
- { "citizing.org", true },
- { "citrusui.me", true },
- { "citsc.de", true },
- { "cittadesign.com", false },
- { "citton.com.br", true },
- { "city-adm.lviv.ua", true },
- { "city-walks.info", true },
- { "citybeat.de", true },
- { "citycreek.studio", true },
- { "citydance.ee", true },
- { "cityfloorsupply.com", true },
- { "citylights.eu", true },
- { "citymoobel.ee", true },
- { "cityoftitans.com", true },
- { "cityoftitansmmo.com", true },
- { "citypro.tk", true },
- { "citysportapp.com", false },
- { "citywidealarms.com", true },
- { "citywisdom.tk", true },
- { "cityworksonline.com", true },
- { "civey.com", true },
- { "civicamente.cl", true },
- { "civicforum.pl", true },
- { "civics.us", true },
- { "civilbikes.com", true },
- { "civilg20.org", true },
- { "civillines.nl", true },
- { "civiltoday.com", true },
- { "civmob.com", true },
- { "cixiaoya.space", true },
- { "cixiaoya1.xyz", true },
- { "cixiaoya2.xyz", true },
- { "cj-espace-vert.fr", true },
- { "cj-jackson.com", true },
- { "cjbeckert.com", false },
- { "cjdby.net", true },
- { "cjdpenterprises.com", true },
- { "cjdpenterprises.com.au", true },
- { "cjenni.ch", true },
- { "cjey.me", true },
- { "cjhzp.net", true },
- { "cjr.host", true },
- { "cjs8866.cc", true },
- { "cjsounds.com", true },
- { "ck.cx", true },
- { "ck1020.cc", true },
- { "ckenelley.com", true },
- { "ckenelly.com", true },
- { "ckenely.com", true },
- { "ckenneley.com", true },
- { "ckennelley.com", true },
- { "ckennelly.com", true },
- { "ckennely.com", true },
- { "cklie.de", true },
- { "ckliemann.com", true },
- { "ckliemann.net", true },
- { "ckna.ca", true },
- { "ckostecki.de", true },
- { "ckp.io", true },
- { "ckpl.us", true },
- { "cktennis.com", true },
- { "ckventura.sk", true },
- { "cl.search.yahoo.com", false },
- { "claimconnect.com", true },
- { "claimconnect.us", true },
- { "claimflights.at", true },
- { "claimflights.co.uk", false },
- { "claimflights.com", false },
- { "claimflights.de", false },
- { "claimflights.it", false },
- { "claimflights.pl", false },
- { "claimflights.ro", false },
- { "claimjeidee.be", true },
- { "claimnote.com", true },
- { "clairegold.com", true },
- { "clairescastles.co.uk", true },
- { "clairette-de-die-lantheaume.fr", true },
- { "claitec.com", true },
- { "clan-hosting.tk", true },
- { "clan-wars.ml", true },
- { "clan-zone.dk", true },
- { "clanebouncycastles.com", true },
- { "clanrose.org.uk", true },
- { "clanwarz.com", true },
- { "clare3dx.com", true },
- { "clarkelectricalservices.com.au", true },
- { "clarkwinkelmann.com", true },
- { "clase3.tk", true },
- { "clash.lol", true },
- { "class.com.au", true },
- { "classdojo.com", true },
- { "classicalpilates.ca", true },
- { "classiccutstupelo.com", true },
- { "classicfg.com.au", true },
- { "classics.io", true },
- { "classictheatrecumbria.co.uk", true },
- { "classpoint.cz", true },
- { "classroom.google.com", true },
- { "classroomconductor.com", true },
- { "classroomcountdown.co.nz", true },
- { "classteaching.com.au", true },
- { "claster.it", true },
- { "claude.me", true },
- { "claude.photo", true },
- { "claudeleveille.com", true },
- { "claudia-urio.com", false },
- { "claudiney.id", true },
- { "claudiolemos.com", true },
- { "claumarservice.com", true },
- { "claus-bahr.de", true },
- { "clauseriksen.net", true },
- { "clav1d.com", true },
- { "clawe.de", true },
- { "clawhammer.dk", true },
- { "clayandcottonkirkwood.com", true },
- { "claygregory.com", true },
- { "clayprints.com", true },
- { "clazzrooms.com", true },
- { "cldejessey.com", true },
- { "cldinc.com", true },
- { "cldly.com", true },
- { "clean-mailbox.com", true },
- { "cleanapproachnw.com", true },
- { "cleanbrowsing.org", true },
- { "cleandetroit.org", true },
- { "cleandogsnederland.nl", true },
- { "cleango.pl", true },
- { "cleanhouse2000.us", true },
- { "cleaningservicejulai.com", true },
- { "cleaningsolutionn.com", true },
- { "cleanplanet.co.jp", true },
- { "clearance365.co.uk", true },
- { "clearblueday.co.uk", true },
- { "clearbookscdn.uk", true },
- { "clearbreezesecuritydoors.com.au", true },
- { "clearchaos.net", true },
- { "clearip.com", true },
- { "clearpay.co.uk", true },
- { "clearspringinsurance.com", true },
- { "clearview-creative.com", true },
- { "clearvoice.com", true },
- { "clearvoice1.com", true },
- { "clearwaterbidets.com", false },
- { "cleary.xyz", true },
- { "clemency.com", true },
- { "clemens-bartz.de", true },
- { "clemensbartz.de", true },
- { "clemenscompanies.com", true },
- { "clement-beaufils.fr", true },
- { "clementfevrier.fr", true },
- { "cles-asso.fr", true },
- { "cles.jp", true },
- { "cleveille.com", true },
- { "clevermatch.com", true },
- { "clevertarget.ru", true },
- { "cleververmarkten.com", true },
- { "cleververmarkten.de", true },
- { "clevisto.com", true },
- { "clevvi.com.au", true },
- { "cleysense.com", true },
- { "clica.net", true },
- { "clicandfioul.com", true },
- { "clicheshishalounge.co.uk", true },
- { "click-licht.de", true },
- { "click2order.co.uk", true },
- { "click4web.com", true },
- { "clickbasin.co.uk", true },
- { "clickclickphish.com", true },
- { "clickenergy.com.au", true },
- { "clickingmad.com", true },
- { "clickphish.com", true },
- { "clien.net", true },
- { "client.coach", false },
- { "clientboss.com", true },
- { "clientcms.co.uk", true },
- { "clientesendemanda.com", true },
- { "clientportal.com", true },
- { "clientsecure.me", true },
- { "cliffbreak.de", true },
- { "cliffburton.tk", true },
- { "clifflu.net", true },
- { "cliffyb.com", true },
- { "cliksource.com", true },
- { "climaprecio.es", true },
- { "climateinteractive.org", true },
- { "climatestew.com", true },
- { "climatgate.tk", true },
- { "climatizzatore.roma.it", true },
- { "clindoeilmontagne.com", false },
- { "clinicaarques.es", true },
- { "clinicadentalvinateros.es", true },
- { "clinicainfinitydental.com", true },
- { "clinicalrehabilitation.info", true },
- { "clinicaltrialpodcast.com", true },
- { "clinicaltrials.gov", true },
- { "clinicamiracueto.com", true },
- { "clinicasmedicas.com.br", true },
- { "clinicminds.com", true },
- { "clinicos.cl", true },
- { "clinique-ser.ca", true },
- { "cliniquevethuy.be", true },
- { "clintonlibrary.gov", true },
- { "clip.ovh", true },
- { "clipchamp.com", true },
- { "clipclip.com", true },
- { "clippings.com", true },
- { "cliqz.com", true },
- { "clive.io", true },
- { "clmde.de", true },
- { "clnc.to", true },
- { "clnlboard.co.uk", true },
- { "clnnet.ch", true },
- { "clo.me", true },
- { "clockcaster.com", true },
- { "clocklab.design", true },
- { "clockworksms.com", true },
- { "clomid100mg.ga", true },
- { "cloneuniverse.com", true },
- { "clorophilla.net", true },
- { "closeli.cn", true },
- { "closelinksecurity.co.uk", true },
- { "closelinksecurity.com", true },
- { "closetemail.com", true },
- { "closoltech.com", true },
- { "cloud-screen.com", true },
- { "cloud-surfer.net", false },
- { "cloud.bugatti", true },
- { "cloud.fail", true },
- { "cloud.google.com", true },
- { "cloud.gov", true },
- { "cloud10.io", true },
- { "cloud255.com", true },
- { "cloud42.ch", false },
- { "cloud9bouncycastlehire.com", true },
- { "cloud9vets.co.uk", true },
- { "cloudapps.digital", true },
- { "cloudbolin.es", true },
- { "cloudbrothers.info", true },
- { "cloudcaprice.net", true },
- { "cloudcert.org", true },
- { "cloudcite.net", true },
- { "cloudclouds.com", true },
- { "cloudcrux.net", true },
- { "clouddesk.co.uk", true },
- { "clouddog.com.br", true },
- { "cloudeezy.com", true },
- { "cloudey.net", true },
- { "cloudfiles.at", true },
- { "cloudflare-dns.com", true },
- { "cloudflare.com", true },
- { "cloudflareonazure.com", true },
- { "cloudhoreca.com", true },
- { "cloudia.org", true },
- { "cloudily.com", true },
- { "cloudix.cf", true },
- { "cloudkeep.nl", true },
- { "cloudlessdreams.com", false },
- { "cloudlight.biz", true },
- { "cloudninelandscapedesign.com", true },
- { "cloudnote.cc", true },
- { "cloudns.net", true },
- { "cloudofertas.com.br", true },
- { "cloudoptimizedsmb.com", true },
- { "cloudoptimus.com", true },
- { "cloudpengu.in", true },
- { "cloudpipes.com", true },
- { "cloudpole.de", true },
- { "cloudsavvyit.com", true },
- { "cloudse.co.uk", true },
- { "cloudsec.tk", true },
- { "cloudsecurityalliance.com", true },
- { "cloudsecurityalliance.net", true },
- { "cloudsecurityalliance.org", true },
- { "cloudsecuritycongress.net", true },
- { "cloudsecuritycongress.org", true },
- { "cloudservice.io", true },
- { "cloudservices.nz", false },
- { "cloudsign.jp", true },
- { "cloudspace-analytics.com", true },
- { "cloudspire.net", true },
- { "cloudsters.nl", true },
- { "cloudteam.de", true },
- { "cloudtocloud.tk", true },
- { "cloudtropia.de", true },
- { "cloudup.com", true },
- { "cloudwallce.com", true },
- { "clouz.de", true },
- { "cloveros.ga", true },
- { "clovertwo.com", true },
- { "clownindeklas.nl", true },
- { "cloxy.com", true },
- { "cloze.com", true },
- { "clsfoundationrepairandwaterproofing.com", true },
- { "clsimage.com", true },
- { "clsoft.ch", true },
- { "clu-in.org", true },
- { "club-adulti.ro", true },
- { "club-climate.com", true },
- { "club-creole.com", true },
- { "club-dieta.ru", true },
- { "club-duomo.com", true },
- { "club-eclipse.tk", true },
- { "club-jose.com", true },
- { "club-leondehuanuco.tk", true },
- { "club-premiere.com", true },
- { "club-reduc.com", true },
- { "club-slow.jp", true },
- { "club-yy.com", true },
- { "club103.ch", false },
- { "clubapk.com", true },
- { "clubatleticonacionalpotosi.tk", true },
- { "clubcorsavenezuela.com", false },
- { "clubdelzapato.com", true },
- { "clubdeportivocieza.tk", true },
- { "clubefiel.com.br", true },
- { "clubegolfpt.com", true },
- { "clubempleos.com", true },
- { "clubeohara.com", true },
- { "cluberiks.ga", true },
- { "clubfamily.de", true },
- { "clubiconkenosha.com", true },
- { "clubmarina.store", true },
- { "clubmini.jp", true },
- { "clubnoetig-ink2g.de", true },
- { "clubon.space", true },
- { "clubtamarugal.tk", true },
- { "cluster.biz.tr", true },
- { "clusterfuck.nz", true },
- { "clutch.ua", true },
- { "clwrota.com", true },
- { "cm-loures.pt", true },
- { "cmacacias.ch", true },
- { "cmadeangelis.it", true },
- { "cmc.pt", true },
- { "cmcressy.ch", true },
- { "cmdline.org", true },
- { "cme-colleg.de", true },
- { "cmfaccounting.com", false },
- { "cmgacheatcontrol.com", true },
- { "cmillrehab.com", true },
- { "cmlachapelle.ch", true },
- { "cmlancy.ch", true },
- { "cmlignon.ch", true },
- { "cmn-group.com", true },
- { "cmn-groupe.com", true },
- { "cmngroup.com", true },
- { "cmngroupe.com", true },
- { "cmplainpalais.ch", true },
- { "cmpsc.uk", true },
- { "cmserviscz.cz", true },
- { "cmshangu.com", true },
- { "cmskakuyasu.info", true },
- { "cmskeyholding.co.uk", true },
- { "cmskeyholding.com", true },
- { "cmv.gr", true },
- { "cmylife.nl", true },
- { "cn.search.yahoo.com", false },
- { "cn8522.com", true },
- { "cna5.cc", true },
- { "cna5.net", true },
- { "cna5.org", true },
- { "cnam-idf.fr", true },
- { "cnbibo.com", true },
- { "cnbs.ch", true },
- { "cnc-lehrgang.de", true },
- { "cncado.net", true },
- { "cncbazar365.com", true },
- { "cncrans.ch", false },
- { "cncs.gov.pt", true },
- { "cni-certing.it", true },
- { "cnitdog.com", false },
- { "cnre.eu", true },
- { "cnss.io", true },
- { "cnvt.fr", true },
- { "cnymenshealth.com", true },
- { "co-founder-stuttgart.de", true },
- { "co.search.yahoo.com", false },
- { "co50.com", true },
- { "coachapp-ipass.herokuapp.com", true },
- { "coachbakery.com", true },
- { "coachezmoi.ch", false },
- { "coachfederation.ro", true },
- { "coaching-harmonique.fr", true },
- { "coaching-impulse.ch", false },
- { "coaching-park.fr", true },
- { "coachsystem.ru", true },
- { "coalitionministries.org", true },
- { "coalpointcottage.com", true },
- { "coastline.net.au", true },
- { "coastmedicalservice.com", true },
- { "coathangastrangla.com", true },
- { "coathangastrangler.com", true },
- { "coathangerstrangla.com", true },
- { "coathangerstrangler.com", true },
- { "coatl-industries.com", true },
- { "coatsandcocktails.org", true },
- { "cobalt.io", true },
- { "cobaltgp.com", true },
- { "cobaltis.co.uk", true },
- { "cobracastles.co.uk", true },
- { "cocaine.ninja", true },
- { "cocalc.com", true },
- { "cocareonline.com", true },
- { "coccolebenessere.it", true },
- { "cocinoyo.com", true },
- { "cock.li", false },
- { "cockfile.com", true },
- { "cockybot.com", true },
- { "coco-line.ch", true },
- { "cocoamexico.com", true },
- { "cocodroid.com", true },
- { "coconutoil24.com", true },
- { "cocoscastles.co.uk", true },
- { "cocquyt-usedcars.be", false },
- { "cod88.cc", true },
- { "coda.io", true },
- { "coda.moe", true },
- { "coda.today", true },
- { "coda.world", true },
- { "codabix.com", true },
- { "codabix.de", true },
- { "code-poets.co.uk", true },
- { "code-vikings.de", true },
- { "code-well.com", true },
- { "code.facebook.com", false },
- { "code.fm", true },
- { "code.google.com", true },
- { "code.taxi", true },
- { "code123.eu", true },
- { "code4.hk", true },
- { "code67.com", true },
- { "codeandpeace.com", true },
- { "codeandsupply.co", true },
- { "codebrahma.com", false },
- { "codebrew.com.au", true },
- { "codedelarouteenligne.fr", true },
- { "codedo.info", true },
- { "codedump.net", true },
- { "codeeclipse.com", true },
- { "codeferm.com", true },
- { "codefordus.nrw", true },
- { "codeguard.xyz", true },
- { "codehz.one", true },
- { "codeidea.ga", true },
- { "codein.ca", true },
- { "codeine.co.uk", true },
- { "codeit.guru", true },
- { "codeit.us", true },
- { "codejots.com", true },
- { "codelei.fr", true },
- { "codelyoko.club", true },
- { "codemahrt.com", true },
- { "codemill.se", true },
- { "codemonster.eu", true },
- { "codenode.io", true },
- { "codeofthenorth.com", true },
- { "codepoints.net", true },
- { "codepref.com", true },
- { "codereview.appspot.com", false },
- { "codereview.chromium.org", false },
- { "coderscripts.com", true },
- { "coderware.co.uk", true },
- { "codes.pk", true },
- { "codesgroup.tk", true },
- { "codesport.io", true },
- { "codespromo.be", true },
- { "codestudies.net", true },
- { "codetheworld.com", true },
- { "codetipi.com", true },
- { "codetripping.net", true },
- { "codeux.com", true },
- { "codeux.info", true },
- { "codeux.net", true },
- { "codevat.com", true },
- { "codeventure.de", true },
- { "codeversetech.com", true },
- { "codewild.de", true },
- { "codexpo.net", true },
- { "codeyellow.nl", true },
- { "codific.com", true },
- { "codigodelbonusbet365.com", true },
- { "codimaker.com", true },
- { "coding-minds.com", true },
- { "coding.lv", true },
- { "codingblog.org", true },
- { "codingforspeed.com", true },
- { "codinginfinity.me", true },
- { "codingrobots.com", true },
- { "codista.com", true },
- { "cododigital.co.uk", true },
- { "codxg.org", true },
- { "codyevanscomputer.com", true },
- { "codymoniz.com", true },
- { "codyqx4.com", true },
- { "coecho.net", true },
- { "coens.me.uk", true },
- { "coeus.cloud", true },
- { "cofbev.com", true },
- { "coffee-machine.reviews", true },
- { "coffee-mamenoki.jp", true },
- { "coffee-up.it", true },
- { "coffeeandteabrothers.com", true },
- { "coffeestain.ltd", true },
- { "cogala.eu", true },
- { "cogeneration-energy.com", true },
- { "cogent.cc", true },
- { "cogitoltd.com", true },
- { "cognicom-gaming.com", true },
- { "cognitip.com", true },
- { "cognitiveapplications.net", true },
- { "cognitivecomputingconsortium.com", true },
- { "cognitohq.com", true },
- { "cogsquad.house", true },
- { "coiffeurschnittstelle.ch", true },
- { "coiffeurty.com", true },
- { "coiffure-andrea.ch", true },
- { "coigach-assynt.org", true },
- { "coignieresentransition.fr", true },
- { "coimmvest.com", true },
- { "coin-quest.net", true },
- { "coin.dance", true },
- { "coin.space", true },
- { "coinapult.com", true },
- { "coinbase.com", true },
- { "coincealed.com", true },
- { "coinchat.im", true },
- { "coincircle.com", true },
- { "coinclickz.fun", true },
- { "coinclickz.xyz", true },
- { "coincoin.eu.org", true },
- { "coincolors.co", true },
- { "coindeal.com", true },
- { "coinf.it", true },
- { "coinflux.com", true },
- { "coingate.com", true },
- { "coinlist.co", false },
- { "coinloan.io", true },
- { "coinmewallet.com", true },
- { "coinpath.io", true },
- { "coinroom.com", true },
- { "coinsmat.com", true },
- { "coinsuggest.com", true },
- { "coinsz.co", true },
- { "cointosh.jp", true },
- { "coinvex.org", true },
- { "coinx.pro", true },
- { "coisasdemulher.org", true },
- { "cojam.ru", true },
- { "cojo.eu", true },
- { "cokebar.info", true },
- { "coker.com.au", true },
- { "cokomi.com", true },
- { "col-head.com", true },
- { "col.la", true },
- { "cola-host.tk", true },
- { "colaborativa.tv", true },
- { "coladv.com", true },
- { "colantonio.homelinux.net", true },
- { "colasjourdain.fr", true },
- { "colchonesmoon.com", true },
- { "colcomm.com", true },
- { "coldawn.com", false },
- { "coldcardwallet.com", true },
- { "coldfff.com", true },
- { "coldhak.ca", true },
- { "coldiario.com", true },
- { "coldlasers.org", true },
- { "coldren.org", true },
- { "coldstreamcreekfarm.com", true },
- { "colemak.com", true },
- { "colengo.com", true },
- { "colf.online", true },
- { "colibris.xyz", true },
- { "colincogle.name", true },
- { "colinespinas.com", true },
- { "colinsnaith.co.uk", true },
- { "colinstark.ca", true },
- { "collab.ddnss.org", true },
- { "collabora-office.com", true },
- { "collabora.ca", true },
- { "collabora.co.kr", true },
- { "collabora.co.uk", true },
- { "collabora.com", true },
- { "collabora.kr", true },
- { "collabora.ninja", true },
- { "collabora.social", true },
- { "collabora.uk", true },
- { "collaboracloudsuite.com", true },
- { "collaboraoffice.co.uk", true },
- { "collaboraoffice.com", true },
- { "collaborativehealthpsychology.com", true },
- { "collabornation.net", true },
- { "collaction.hk", true },
- { "collada.org", true },
- { "collectdocs.com", true },
- { "collectiblebeans.com", true },
- { "collectivesupply.com", true },
- { "collectorknives.net", true },
- { "collectorsystems.com", true },
- { "collegeconnexxions.com.au", true },
- { "collegegirlhd.com", true },
- { "collegenavigator.gov", true },
- { "collegepaperworld.com", true },
- { "collegeprospectsofcentralindiana.com", true },
- { "collegereligionandphilosophy.com", true },
- { "collegesexvid.com", true },
- { "collegestationhomes.com", true },
- { "collinel-hossari.com", true },
- { "collinelhossari.com", true },
- { "collinklippel.com", true },
- { "collinmbarrett.com", true },
- { "colloquy.mobi", true },
- { "cololi.moe", true },
- { "colombiajeans.co", true },
- { "colombian.dating", true },
- { "colombianas.webcam", true },
- { "colonize.africa", true },
- { "color01.net", true },
- { "colorblindprogramming.com", true },
- { "colorbrush.ru", true },
- { "colorcodedlyrics.com", true },
- { "colorectalcompounding.com", true },
- { "colorfuldots.com", true },
- { "colorhexa.com", true },
- { "coloristcafe.com", true },
- { "colorlib.com", false },
- { "colorpicker.fr", true },
- { "colors3d.com", true },
- { "colorsbycarin.com", true },
- { "colossal-events.co.uk", true },
- { "colourfulcastles.co.uk", true },
- { "colourmanagementpro.com", true },
- { "colpacpackaging.com", true },
- { "colson-occasions.be", false },
- { "coltellisurvival.com", true },
- { "columbuswines.com", true },
- { "colyakoomusic.com", true },
- { "colyakootees.com", true },
- { "com-in.de", true },
- { "com.cc", true },
- { "comalia.com", true },
- { "comarkinstruments.net", true },
- { "combigo.com", true },
- { "combron.be", true },
- { "combron.co.uk", true },
- { "combron.com", true },
- { "combron.nl", true },
- { "comcol.nl", true },
- { "comcov.com", true },
- { "comdotgame.com", true },
- { "comdurav.com", true },
- { "comeals.com", true },
- { "comedimagrire.it", true },
- { "comedyhuis.nl", true },
- { "comeoishii.com", true },
- { "comercialbelzunces.com", true },
- { "comercialroxana.com", true },
- { "comercialtpv.com", true },
- { "comercialtrading.eu", true },
- { "comerford.net", true },
- { "comestoarra.com", true },
- { "cometcache.com", true },
- { "cometonovascotia.ca", true },
- { "comff.net", true },
- { "comfintouch.com", true },
- { "comflores.com.br", true },
- { "comfortmastersinsulation.com", true },
- { "comfortsolutionsair.com", true },
- { "comhack.com", true },
- { "comicbank.org", true },
- { "comicsans.tk", true },
- { "comicspornos.com", true },
- { "comicspornow.com", true },
- { "comicspornoxxx.com", true },
- { "comicwiki.dk", true },
- { "comidina.com", true },
- { "comiteaintriathlon.fr", true },
- { "comiteexpertes.gc.ca", true },
- { "comlipa.gq", true },
- { "comm.cx", true },
- { "commco.nl", true },
- { "commechezvous.ch", false },
- { "commerce.gov", true },
- { "commercezen.com", true },
- { "commercia.srl", true },
- { "commercial-academy.fr", true },
- { "commeunamour.com", true },
- { "commissaris-vraagbaak.nl", true },
- { "commissionagenda.com", true },
- { "commitsandrebases.com", true },
- { "commlabindia.com", true },
- { "common.io", true },
- { "commoncode.com.au", true },
- { "commoncode.io", true },
- { "commoncore4kids.com", true },
- { "commons-mayflower.tk", true },
- { "commonsenseamericanpolitics.com", true },
- { "communalconsulting.org", true },
- { "communiques.info", true },
- { "communist-party.tk", true },
- { "communitychurchafrica.co.za", true },
- { "communitycodeofconduct.com", true },
- { "communitymanagertorrejon.com", true },
- { "communote.net", true },
- { "commure.com", true },
- { "como-se-escribe.com", true },
- { "comoaliviareldolor.de", true },
- { "comoculosdesol.pt", true },
- { "comocurarlagastritis24.online", true },
- { "comocurarlagastritistratamientonatural.com", true },
- { "comodesinflamarlashemorroides.org", true },
- { "comodo.nl", true },
- { "comodormirmasrapido.com", true },
- { "comodosslstore.com", true },
- { "comogene.com", true },
- { "comohacerblog.net", true },
- { "comohacerpara.com", true },
- { "comoimportar.net", true },
- { "comopuededejardefumar.net", true },
- { "comoquitarlacaspa24.com", true },
- { "comosecarabarriga.net", true },
- { "comoseduzir.net", true },
- { "comosefazisto.com.br", true },
- { "comp.kiev.ua", true },
- { "comp2go.com.au", true },
- { "compactchess.cc", true },
- { "compagnia-buffo.de", false },
- { "compagniemartin.com", false },
- { "companion-web.net", true },
- { "comparatif-moto.fr", true },
- { "compareandrecycle.co.uk", true },
- { "comparecompensationclaims.com", true },
- { "compareinsurance.com.au", true },
- { "comparemymobile.com", true },
- { "comparesoft.com", true },
- { "comparewatch.com", true },
- { "comparexcloudcenter.com", true },
- { "compartirtrenmesaave.com", true },
- { "compassdirectportal.com", true },
- { "compassfinance.com", true },
- { "compassintladv.com", true },
- { "compassionaterelease.com", true },
- { "compassleaf.com", true },
- { "compasslos.com", true },
- { "compeat.com", true },
- { "competencyassessment.ca", true },
- { "competitor.com", true },
- { "comphare.nl", true },
- { "compibus.fr", true },
- { "compilenix.org", true },
- { "complete-it.co.uk", true },
- { "completefloorcoverings.com", true },
- { "completesecurityessex.co.uk", true },
- { "completesecurityessex.com", true },
- { "completionist.me", true },
- { "complexart.ro", true },
- { "complexorganization.com", true },
- { "complexorganizations.com", true },
- { "compliance-management.ch", false },
- { "compliance-systeme.de", true },
- { "compliancedictionary.com", true },
- { "compliancerisksoftware.co.uk", true },
- { "compliantbusinessprocessing.com", true },
- { "componentshop.co.uk", true },
- { "compositedevtec.tk", true },
- { "compostatebien.com.ar", true },
- { "compoundingrxusa.com", true },
- { "comprarcarteras.online", true },
- { "comprarimpresoras-3d.com", true },
- { "comprarparaguas.online", true },
- { "comprauncelular.com", true },
- { "compreautomacao.com.br", true },
- { "compree.com", true },
- { "compservice.in.ua", true },
- { "comptablevilledequebec.com", true },
- { "comptrollerofthecurrency.gov", true },
- { "comptu.com", true },
- { "compubench.com", true },
- { "compucorner.mx", true },
- { "compunetwor.com", true },
- { "compuplast.cz", true },
- { "computec.ch", true },
- { "computehealth.com", true },
- { "computer-acquisti.com", true },
- { "computer-science-schools.com", true },
- { "computerassistance.co.uk", true },
- { "computerbase.de", true },
- { "computercamaccgi.com", true },
- { "computercraft.net", true },
- { "computeremergency.com.au", false },
- { "computerhilfe-feucht.de", true },
- { "computerinfobits.com", true },
- { "computernetwerkwestland.nl", true },
- { "computersystems.guru", false },
- { "computingsociety.co.uk", true },
- { "computop.com", true },
- { "computron.ga", true },
- { "comschool.com.br", true },
- { "comumlab.org", true },
- { "comunidadmontepinar.es", true },
- { "comvos.de", true },
- { "comw.cc", true },
- { "con-con.nl", true },
- { "conalcorp.com", true },
- { "conalpedis.tk", true },
- { "conatus.ai", true },
- { "conaudisa.com", false },
- { "concept-web.ch", false },
- { "concerto.amsterdam", true },
- { "concertsenboite.fr", true },
- { "concertsto.com", true },
- { "conciencia.fit", true },
- { "concierge.diet", true },
- { "concilio.com", true },
- { "conciliumnotaire.ca", true },
- { "concordiagaming.com", true },
- { "concordsoftwareleasing.com", true },
- { "concretelevelingsystems.com", true },
- { "concreterepairatlanta.com", true },
- { "concreterepairconcreteraising.com", true },
- { "concursos.com.br", true },
- { "concursosabertos.com.br", true },
- { "concursuri.biz", true },
- { "condecom.com.br", true },
- { "condepenalba.com", false },
- { "condesaelectronics.com", true },
- { "condolencemessages.net", true },
- { "condominiosi.it", true },
- { "condominioweb.com", true },
- { "condosforcash.com", true },
- { "condroz-motors.be", false },
- { "conectadev.com", true },
- { "conectumfinanse.pl", true },
- { "conejovalleyelectrical.com", true },
- { "conejovalleyelectrician.com", true },
- { "conejovalleyexteriorlighting.com", true },
- { "conejovalleylandscapelighting.com", true },
- { "conejovalleylighting.com", true },
- { "conejovalleyoutdoorlighting.com", true },
- { "conexiontransporte.com", true },
- { "conference-expert.eu", true },
- { "confiancefoundation.org", true },
- { "config.schokokeks.org", false },
- { "confiscate.ga", true },
- { "confiwall.de", true },
- { "conforama.es", true },
- { "conforama.pt", true },
- { "conformal.com", false },
- { "conformax.com.br", true },
- { "confrerie-rp.fr", true },
- { "conftree.com", true },
- { "confygo.com", true },
- { "congafasdesol.com", true },
- { "congineer.com", true },
- { "congobunkering.com", false },
- { "congresscoverage.com", true },
- { "conju.cat", true },
- { "conjugacao.com.br", true },
- { "conkret.mobi", true },
- { "conmedapps.com", true },
- { "conn.cx", true },
- { "connect-ed.network", true },
- { "connect-me.com", true },
- { "connect.dating", true },
- { "connect.facebook.net", true },
- { "connecta.store", true },
- { "connectedcare.md", true },
- { "connectfri.club", true },
- { "connectfss.com", true },
- { "connectingrentals.com", true },
- { "connectingrentalsofbethel.com", true },
- { "connectionstrings.com", true },
- { "connectivia.it", true },
- { "connectmath.com", true },
- { "connectme.com.mx", true },
- { "connectmy.car", true },
- { "connecto-data.com", true },
- { "connectum.eu", true },
- { "conner.work", true },
- { "connexas.eu", true },
- { "connexfilter.com", true },
- { "connexion.health", true },
- { "connexionht.com", true },
- { "connext.de", true },
- { "connictro.de", true },
- { "connorhatch.com", true },
- { "connyduck.at", true },
- { "conocchialidasole.it", true },
- { "conocedordigital.com", true },
- { "conociendosalama.com", true },
- { "conorboyd.info", true },
- { "conory.com", true },
- { "conotoxia.com", true },
- { "conquer-addiction.org", true },
- { "conrad-kostecki.de", true },
- { "conradboraboranuiresort.com", true },
- { "conradcartagena.com", true },
- { "conradkostecki.de", true },
- { "conradsautotransmissionrepair.com", true },
- { "consagracionamariasantisima.org", true },
- { "consciente.ch", true },
- { "consciente.ngo", true },
- { "consciente.ong", true },
- { "consciouschoices.net", true },
- { "consegnafioridomicilio.net", true },
- { "consegne.it", true },
- { "consejosdenutricion.com", true },
- { "consensoprivacy.it", true },
- { "consertodecelulares.com.br", true },
- { "conservativenewsandviews.com", true },
- { "consideredgifts.com", true },
- { "consilium-vitae.ch", true },
- { "consiliumvitae.ch", true },
- { "console-tribe.com", true },
- { "console.rest", true },
- { "consoleuniverse.tk", true },
- { "consommateuraverti.com", true },
- { "constant-rough.de", true },
- { "consteval.org", true },
- { "constexpr.org", true },
- { "constinit.org", true },
- { "constitution.website", true },
- { "construct.net", true },
- { "constructieve.nl", true },
- { "construction-colleges.com", true },
- { "construction-student.co.uk", true },
- { "constructive.men", true },
- { "construred.tk", true },
- { "consul.io", true },
- { "consulenza.pro", true },
- { "consultation.biz.tr", true },
- { "consultimator.com", true },
- { "consultimedia.de", true },
- { "consulting-cloud.com", true },
- { "consultingconnection.co", true },
- { "consultinghero.es", true },
- { "consultoresrey.cl", true },
- { "consultoriadeseguranca.com.br", true },
- { "consultoriosodontologicos.com.br", true },
- { "consultpetkov.com", true },
- { "consulvation.com", true },
- { "consumeractionlawgroup.com", true },
- { "consumerfiles.com", true },
- { "consumersentinel.gov", true },
- { "consuwijzer.nl", true },
- { "contabilidadebrooklin.com.br", true },
- { "contact.inc", true },
- { "contact.xyz", true },
- { "contactaffix.com", true },
- { "containerspace.com.au", true },
- { "contaquanto.com.br", true },
- { "contemplativeeducation.org", true },
- { "content-api-dev.azurewebsites.net", false },
- { "contentcoms.co.uk", true },
- { "contenthosting.com.br", true },
- { "contentmarathon.com", true },
- { "contentpass.net", true },
- { "contentq.nl", true },
- { "contessa32experience.com", true },
- { "conti-profitlink.co.uk", true },
- { "continuumrecoverycenter.com", true },
- { "contouring.fr", true },
- { "contrabass.net", true },
- { "contractormountain.com", true },
- { "contractorswestga.com", true },
- { "contractwriters.com", true },
- { "contrasentido.net", true },
- { "contraspin.co.nz", true },
- { "contratatupoliza.com", true },
- { "contratti.it", true },
- { "contributor.google.com", false },
- { "controlambientalbogota.com", true },
- { "controlautocom.com.br", true },
- { "controlbooth.com", true },
- { "controle.net", true },
- { "controleer-maar-een-ander.nl", true },
- { "controllertech.com", true },
- { "controlvoltage.cc", true },
- { "contunda.de", true },
- { "conv2pdf.com", true },
- { "convergence.fi", true },
- { "convergencela.com", true },
- { "convergnce.com", true },
- { "conversationsri.ga", true },
- { "conversiepartners.nl", true },
- { "conversiones.com", true },
- { "convert.im", true },
- { "converticacommerce.com", false },
- { "convertimg.com", true },
- { "cookescastles.co.uk", true },
- { "cookicons.co", true },
- { "cookie4.com", true },
- { "cookieandkate.com", true },
- { "cookiecrook.com", true },
- { "cooking-sun.com", true },
- { "cookingcrusade.com", true },
- { "cookinglife.nl", false },
- { "cookingperfected.com", true },
- { "cookingreporter.com", true },
- { "cookmedical.com", false },
- { "cookwithmanali.com", true },
- { "cool-parties.co.uk", true },
- { "cool-wallpapers.jp", true },
- { "cool.haus", true },
- { "cool110.tk", true },
- { "cool110.xyz", true },
- { "coolattractions.co.uk", true },
- { "coolbitx.com", true },
- { "coolcamping.com", true },
- { "cooldan.com", true },
- { "coole-fete.de", true },
- { "coolgifs.de", true },
- { "cooljv.com", true },
- { "coolprylar.se", true },
- { "coolshirt.tk", true },
- { "coomonte.tk", true },
- { "coonawarrawines.com.au", true },
- { "coonelnel.net", true },
- { "coore.jp", true },
- { "coorpacademy.com", true },
- { "coorpintr.com", true },
- { "copan.com.br", true },
- { "copdfoundation.org", true },
- { "copenhagenoptimization.com", true },
- { "copleylawfirm.com", true },
- { "copperandtileroofing.com", true },
- { "copperheados.com", true },
- { "coppidesentupidora.com.br", true },
- { "copplaw.com", true },
- { "coptel.cz", true },
- { "coptkm.cz", true },
- { "copycaught.com", true },
- { "copycaught.net", true },
- { "copycaught.org", true },
- { "copycenter.cf", true },
- { "copycrafter.net", true },
- { "copydz.com", true },
- { "copypoison.com", true },
- { "copyright-watch.org", true },
- { "copyrightcoins.com", true },
- { "copyrightcoins.help", true },
- { "copyrightcoinsnews.com", true },
- { "copyshrug.ca", true },
- { "copywriting-on-demand.tk", true },
- { "coralreef.blue", true },
- { "corbi.net.au", true },
- { "cordejong.nl", true },
- { "cordemar.info", true },
- { "corder.tech", true },
- { "cordeydesign.ch", false },
- { "cordis.io", true },
- { "cordis.tk", true },
- { "cordlessdog.com", true },
- { "cordobaaldia.com.mx", true },
- { "core-concepts.de", false },
- { "core-networks.de", true },
- { "core.mx", true },
- { "core.org.pt", true },
- { "coreapm.org", true },
- { "corecodec.com", true },
- { "corehealthberks.com", true },
- { "coreless-stretchfilm.com", true },
- { "corelia.net", true },
- { "corepartners.com.ua", true },
- { "coresolutions.ca", true },
- { "coreum.ca", true },
- { "corevetconnect.co.uk", true },
- { "coreyjmahler.com", true },
- { "corgi.party", true },
- { "coribi.com", true },
- { "corinastefan.ro", true },
- { "corintech.net", true },
- { "coriolis.ch", true },
- { "corisu.co", true },
- { "corkedwinebar.com", true },
- { "corkerscrisps.co.uk", true },
- { "corksoncolumbus.com", true },
- { "corlija.com", true },
- { "corlinde.nl", true },
- { "corlitocaffe.de", true },
- { "cornercircle.co.uk", true },
- { "cornergarage.coop", true },
- { "cornerstone.network", true },
- { "cornerstonecmc.org", true },
- { "cornfestgiethoorn.nl", true },
- { "corniche.com", true },
- { "corningcu.org", true },
- { "cornitek.tk", true },
- { "cornmachine.com", true },
- { "cornodo.com", true },
- { "corona-academy.com", true },
- { "corona-renderer.cloud", true },
- { "corona-renderer.com", true },
- { "coronersconnect.co.uk", true },
- { "coropiacere.org", true },
- { "corp.goog", true },
- { "corpfin.net", true },
- { "corpio.nl", true },
- { "corpkitnw.com", true },
- { "corpoflow.nl", true },
- { "corporateclash.net", true },
- { "corporatecomputingsolutions.com", true },
- { "corporateinfluencers.com", true },
- { "corpulant.coffee", true },
- { "corpulantcoffee.com", true },
- { "corpulent.coffee", true },
- { "corpulentcoffee.com", true },
- { "corpuschristisouthriver.org", true },
- { "corpusslayer.com", true },
- { "corrbee.com", true },
- { "correct.cf", true },
- { "correctconstructions.com.au", true },
- { "correctiv.org", true },
- { "correctlydesign.com", true },
- { "correctpaardbatterijnietje.nl", true },
- { "correotemporal.org", true },
- { "corrick.io", true },
- { "corriel.com", true },
- { "corrupted.io", true },
- { "corruptos.tk", true },
- { "corsa-b.uk", true },
- { "corscanplus.com", true },
- { "corsicalaw.com", true },
- { "corsihaccpsicurezzalavoro.it", true },
- { "corsisicurezza.it", true },
- { "corso-antincendio.org", true },
- { "corsomassaggi.it", true },
- { "cortealcastello.it", true },
- { "cortexitrecruitment.com", true },
- { "cortexx.nl", true },
- { "cortis-consulting.ch", true },
- { "corvax.kiev.ua", true },
- { "corvee.com", true },
- { "coryadum.com", true },
- { "corytyburski.com", true },
- { "cosasque.com", true },
- { "cosciamoos.com", true },
- { "cosec.cn", true },
- { "cosirex.com", true },
- { "cosmechic.fr", true },
- { "cosmekaitori.jp", true },
- { "cosmeticappraisal.com", true },
- { "cosmeticasimple.com", true },
- { "cosmetify.com", true },
- { "cosmetique-totale.nl", true },
- { "cosmic-os.org", true },
- { "cosmicnavigator.com", true },
- { "cosmicworlds.com", true },
- { "cosmicworlds.mobi", true },
- { "cosmodacollection.com", true },
- { "cosmofunnel.com", true },
- { "cosmohit.ua", true },
- { "cosmos-software.tk", true },
- { "cosmundi.de", true },
- { "cosplayer.com", true },
- { "cospol.ch", false },
- { "costablancavoorjou.com", true },
- { "costarellos.com", true },
- { "costcoinsider.com", true },
- { "costinstefan.eu", true },
- { "costreportdata.com", false },
- { "costulessdirect.com", true },
- { "coteibem.com.br", true },
- { "coteries.com", false },
- { "cotoacc.com", true },
- { "cotonmusic.ch", false },
- { "cotswoldflatroofing.com", true },
- { "cotwe-ge.ch", false },
- { "cou.re", true },
- { "cougar.dating", true },
- { "counselingfw.com", true },
- { "counsellingtime.com", true },
- { "counstellor.com", false },
- { "countdowntrader.com", true },
- { "counter-team.ch", false },
- { "counterenlol.com", true },
- { "counterglobal.com", true },
- { "countermail.com", false },
- { "countermats.net", true },
- { "countersolutions.co.uk", true },
- { "countetime.com", true },
- { "country-creativ.de", true },
- { "countrybrewer.com.au", true },
- { "countryfrog.uk", true },
- { "countryhouseresort.com", true },
- { "countrylife.cz", true },
- { "countryoutlaws.ca", true },
- { "countrysidemarquees.co.uk", true },
- { "countybankdel.com", true },
- { "countyjailinmatesearch.com", true },
- { "coupestanley.com", true },
- { "couponbates.com", true },
- { "couponbre.com", true },
- { "couponcodesme.com", true },
- { "couponlo.net", true },
- { "cour4g3.me", true },
- { "couragefound.org", true },
- { "couriergrey.com", true },
- { "couriersrs.com", true },
- { "coursables.com", true },
- { "courseconfidence.com", true },
- { "coursera.org", true },
- { "courseworkbank.info", true },
- { "courvix.com", true },
- { "coussinsky.net", true },
- { "couvreur-hinault.fr", true },
- { "covbounce.co.uk", true },
- { "coveredinspiders.com", true },
- { "covershousing.nl", true },
- { "covery.ai", true },
- { "covoiturage.fr", true },
- { "covve.com", false },
- { "covybrat.cz", true },
- { "cowbird.org", true },
- { "coweo.cz", true },
- { "coworking-luzern.ch", true },
- { "cowsay.blog", true },
- { "coxcapitalmanagement.com", true },
- { "coxxs.me", true },
- { "coxxs.moe", true },
- { "coya.tw", true },
- { "cozmoyachts.com", true },
- { "cozo.me", true },
- { "cozumel-activities.com", true },
- { "cozyeggdesigns.com", true },
- { "cp-st-martin.be", true },
- { "cp015.com", true },
- { "cpars.gov", true },
- { "cpasperdu.com", true },
- { "cpcheats.co", true },
- { "cpchur.ch", true },
- { "cpd-education.co.uk", true },
- { "cpe-colleg.de", true },
- { "cpe-registry.com", true },
- { "cpe-registry.net", true },
- { "cpe-registry.org", true },
- { "cpegypt.tk", true },
- { "cperegistry.net", true },
- { "cperegistry.org", true },
- { "cpgarmor.com", true },
- { "cphpvb.net", true },
- { "cplus.me", true },
- { "cplusplus.se", true },
- { "cppan.org", true },
- { "cppaste.org", true },
- { "cpqcol.gov.co", true },
- { "cprnearme.com", true },
- { "cpsa.co.uk", true },
- { "cpsc.gov", true },
- { "cpsurvey.com", true },
- { "cptoon.com", true },
- { "cpu.biz.tr", true },
- { "cpvmatch.eu", true },
- { "cpy.pt", true },
- { "cqn.ch", false },
- { "cr.search.yahoo.com", false },
- { "cr8haven.com", true },
- { "cra-bank.com", true },
- { "cra-search.net", true },
- { "craazzyman21.at", true },
- { "crabrave.space", true },
- { "crackcat.de", true },
- { "cracker.in.th", true },
- { "crackheros.site", true },
- { "crackle.io", true },
- { "crackorsquad.in", true },
- { "crackslut.eu", true },
- { "cracksnet.tk", true },
- { "crackstation.net", true },
- { "cradlepointecm.com", true },
- { "craft-beer.life", true },
- { "craft-me-in.com", true },
- { "craftandbuild.de", true },
- { "crafted.cat", true },
- { "crafters.co.jp", true },
- { "craftinghand.com", true },
- { "craftinginredlipstick.com", true },
- { "craftist.de", true },
- { "craftmachinec.com", true },
- { "craftshiponline.tk", true },
- { "craftsmandruggets.com", true },
- { "craftsmany.net", true },
- { "crafttalk.tk", true },
- { "craftyguy.net", true },
- { "craftyphotons.net", true },
- { "crag.com.tw", true },
- { "craig-mullins.com", true },
- { "craigbates.co.uk", false },
- { "craigdavis.ga", true },
- { "craigfrancis.co.uk", true },
- { "craigleclaireteam.com", true },
- { "craigrouse.com", true },
- { "craigwfox.com", true },
- { "crain.com.au", true },
- { "cralarm.de", true },
- { "cramersoft.com", true },
- { "cranberry-tee.de", true },
- { "crandall.io", true },
- { "cranforddental.com", true },
- { "cranshafengin.com", true },
- { "crapmail.tk", true },
- { "crapouill.es", true },
- { "crashboy.ws", true },
- { "craterx.com", true },
- { "cratss.co.uk", true },
- { "crawford.cloud", true },
- { "crawfordcountytcc.org", true },
- { "crawler.ninja", true },
- { "crawleybouncycastles.co.uk", true },
- { "crawlspaceandbasementsolutions.com", true },
- { "crazy-bulks.com", true },
- { "crazy-cat.net", true },
- { "crazy-coders.com", true },
- { "crazybulk.co.uk", true },
- { "crazybulk.com", true },
- { "crazybulk.de", true },
- { "crazybulk.fr", true },
- { "crazycastles.ie", true },
- { "crazycraftland.net", true },
- { "crazydomains.ae", true },
- { "crazydomains.co.nz", true },
- { "crazydomains.co.uk", true },
- { "crazydomains.com.au", true },
- { "crazydomains.in", true },
- { "crazygifts.cf", true },
- { "crazymarvin.com", true },
- { "crazymeeshu.com", true },
- { "crazynoisybizarre.town", true },
- { "crazypaul.com", true },
- { "crazypowered.com", true },
- { "crbug.com", true },
- { "crc-bank.com", true },
- { "crc-search.com", true },
- { "crdmendoza.net", true },
- { "crea-etc.net", false },
- { "crea-th.at", true },
- { "crea-that.fr", true },
- { "crea.bg", true },
- { "crealogix-online.com", true },
- { "creamcastles.co.uk", true },
- { "creampiepornvids.com", true },
- { "creamsoft.com", true },
- { "creamyfox.com", true },
- { "creared.edu.co", true },
- { "creareup.com", true },
- { "createbeing.com", true },
- { "createcos.com", true },
- { "creategyx.ga", true },
- { "createme.com.pl", true },
- { "creatic.co", true },
- { "creatieven.com", true },
- { "creation-contemporaine.com", true },
- { "creationsgate.com", true },
- { "creative-thinking.ro", true },
- { "creative-wave.fr", true },
- { "creativeangles.in", true },
- { "creativecaptiv.es", true },
- { "creativecommons.gr", true },
- { "creativecommons.org", true },
- { "creativeconceptsvernon.com", true },
- { "creativedigital.co.nz", true },
- { "creativeglassgifts.com.au", true },
- { "creativeground.com.au", true },
- { "creativeideasagency.com", true },
- { "creativeimagery.com.au", true },
- { "creativeink.de", true },
- { "creativekkids.com", true },
- { "creativelaw.eu", true },
- { "creativeliquid.com", true },
- { "creativesectors.tk", true },
- { "creativesurvey.com", true },
- { "creativeweb.biz", true },
- { "creativewolf.net", true },
- { "creativosonline.org", true },
- { "creatixx-network.de", false },
- { "creatleencoaching.com", true },
- { "creators-design.com", true },
- { "creators.direct", true },
- { "creatorswave.com", true },
- { "crebita.de", true },
- { "crecman.fr", true },
- { "credential.eu", true },
- { "credex.bg", true },
- { "credigo.se", true },
- { "credit-default-swaps.tk", true },
- { "creditif.tk", true },
- { "creditkarma.com", true },
- { "credito360.pt", true },
- { "creditor.tk", true },
- { "creditorapido.pt", true },
- { "creditos-rapidos.com", true },
- { "creditozen.es", true },
- { "creditozen.mx", true },
- { "creditproautos.com", false },
- { "creditscoretalk.com", true },
- { "creeks-coworking.com", true },
- { "creep.im", true },
- { "creepypastas.com", true },
- { "creepypastas.net", true },
- { "creer-une-boutique-en-ligne.com", true },
- { "creermonsite-wp.com", true },
- { "creerunsitepro.com", true },
- { "crefelder.com", true },
- { "crem.in", false },
- { "cremedigital.com", true },
- { "cremepassion.de", true },
- { "crena.ch", true },
- { "crepa.ch", false },
- { "crestasantos.com", false },
- { "cretdupuy.com", false },
- { "creteangle.com", true },
- { "cretica.no", true },
- { "creusalp.ch", false },
- { "crew.moe", true },
- { "crgalvin.com", true },
- { "crgm.net", true },
- { "cribcore.com", true },
- { "cricklewood.condos", true },
- { "criena.com", true },
- { "criena.net", true },
- { "crime-lawyers.com", true },
- { "crimefreeliving.com", true },
- { "crimesolutions.gov", true },
- { "crimevictims.gov", true },
- { "criminal-attorney.ru", true },
- { "criminal.enterprises", true },
- { "crimsonconnect.co.uk", true },
- { "crinesdanzantes.be", true },
- { "criptocert.com", true },
- { "criptoinvest.pt", true },
- { "criptolog.com", true },
- { "criptomoneylite.tk", true },
- { "criscitos.it", true },
- { "crisisactual.com", true },
- { "crisisnextdoor.gov", true },
- { "crismatthews.com", true },
- { "crisp.chat", true },
- { "crisp.email", true },
- { "crisp.help", true },
- { "crisp.im", true },
- { "crisp.watch", true },
- { "crispinusphotography.com", true },
- { "cristalstandards.com", true },
- { "cristarta.com", true },
- { "cristau.org", true },
- { "cristianonascimento.ml", true },
- { "cristianuibar.com", true },
- { "critical.today", false },
- { "criticalgenesis.tk", true },
- { "criticalsurveys.co.uk", true },
- { "critterguard.org", true },
- { "crizin.io", true },
- { "crm.onlime.ch", false },
- { "crm114d.com", true },
- { "croceverdevb.it", true },
- { "crochetnerd.com", true },
- { "croco.vision", true },
- { "crocuscoaching.co.uk", true },
- { "croisedanslemetro.com", true },
- { "croixblanche-haguenau.fr", false },
- { "cromefire.myds.me", true },
- { "cromosomax.com", true },
- { "cromwellvets.co.uk", true },
- { "cronberg.ch", true },
- { "cronenberg.cc", true },
- { "cronix.cc", true },
- { "cronologie.de", true },
- { "cronometer.com", true },
- { "cronoscentral.be", true },
- { "cropdiagnosis.com", true },
- { "crosbug.com", true },
- { "cross-culture.tk", true },
- { "cross-led-sign.com", true },
- { "cross-view.com", true },
- { "cross.lol", true },
- { "crossborderreturns.com", true },
- { "crossedwires.net", true },
- { "crossfiremovies.tk", true },
- { "crossfitblackwater.com", true },
- { "crossformer.com", true },
- { "crosslifenutrition.co.uk", false },
- { "crossnet.io", true },
- { "crossoverit.com", true },
- { "crosspeakoms.com", true },
- { "crossroads-gmbh.ch", true },
- { "crossway.nl", true },
- { "crosswords123.com", true },
- { "crowcloud.com", true },
- { "crowd.supply", true },
- { "crowdbox.net", true },
- { "crowdcloud.be", true },
- { "crowdliminal.com", true },
- { "crowdsim3d.com", true },
- { "crowdspire.org", true },
- { "crowdsupply.com", true },
- { "crowleymarine.com", true },
- { "crownaffairs.ch", true },
- { "crownbouncycastlehire.co.uk", true },
- { "crowncastles.co.uk", true },
- { "crownmarqueehire.co.uk", true },
- { "crownpoint.com", true },
- { "crownsterling.io", true },
- { "crows.io", true },
- { "croydonapartments.com.au", true },
- { "croydonbouncycastles.co.uk", true },
- { "crrev.com", true },
- { "crsmsodry.cz", true },
- { "crsoresina.it", true },
- { "crstat.ru", true },
- { "crt.cloud", true },
- { "crtalleres.com", true },
- { "crucibleofworlds.com", true },
- { "cruicky.uk", true },
- { "cruisemoab.com", true },
- { "crumbcontrol.com", true },
- { "crunchrapps.com", true },
- { "crustytoothpaste.net", true },
- { "crute.me", true },
- { "crvegas.com", true },
- { "crvv.me", true },
- { "cry-sys.de", true },
- { "cry.nu", false },
- { "cryoblaster.com", true },
- { "cryothanasia.com", true },
- { "crypt.is-by.us", true },
- { "cryptagio.com", true },
- { "cryptearth.de", true },
- { "crypted.chat", true },
- { "crypteianetworks.com", true },
- { "cryptex.net", true },
- { "cryptex.pw", true },
- { "cryptizy.com", true },
- { "crypto.cat", false },
- { "crypto.graphics", true },
- { "crypto.is", false },
- { "cryptobin.co", true },
- { "cryptocon.org", true },
- { "cryptoegg.ca", true },
- { "cryptofan.org", true },
- { "cryptofrog.co", true },
- { "cryptography.ch", true },
- { "cryptography.io", true },
- { "cryptoguidemap.com", true },
- { "cryptoholic.co", true },
- { "cryptoisnotacrime.org", true },
- { "cryptojacks.io", true },
- { "cryptojourney.com", true },
- { "cryptology.ch", true },
- { "cryptomail.nl", true },
- { "cryptomaniaks.com", true },
- { "cryptonom.org", true },
- { "cryptonym.com", true },
- { "cryptoparty.at", true },
- { "cryptoparty.tv", true },
- { "cryptopartyutah.org", true },
- { "cryptopaste.org", true },
- { "cryptophobia.nl", true },
- { "cryptorival.com", true },
- { "cryptoseb.pw", true },
- { "cryptoshot.pw", true },
- { "cryptract.co", true },
- { "crys.cloud", true },
- { "crys.email", true },
- { "crys.hu", true },
- { "crys.me", true },
- { "crys.ovh", true },
- { "crys.pw", true },
- { "crys.tv", true },
- { "crystal-zone.com", true },
- { "crystalapp.ca", true },
- { "crystalchandelierservices.com", true },
- { "crystalgrid.net", true },
- { "crystaloscillat.com", true },
- { "crystalroad.net", true },
- { "crystalzoneshop.com", true },
- { "crystone.me", true },
- { "cryz.ru", true },
- { "cs-algeria.tk", true },
- { "cs.money", true },
- { "cs2016.ch", true },
- { "csa-library.org", true },
- { "csaapac.com", true },
- { "csaapac.org", true },
- { "csabg.org", true },
- { "csacongress.com", true },
- { "csacongress.org", true },
- { "csacongress.us", true },
- { "csadc.org", true },
- { "csasummit.net", true },
- { "csca.me", true },
- { "cscau.com", true },
- { "cscdn.net", true },
- { "csci571.com", true },
- { "csd-slovenije.si", true },
- { "cselzer.com", true },
- { "csfcloud.com", true },
- { "csfd.cz", true },
- { "csgf.fun", true },
- { "csgf.ru", true },
- { "csgo.su", true },
- { "csgoswap.com", true },
- { "csharpmarc.net", true },
- { "cshub.nl", true },
- { "csi.lk", true },
- { "csinterstargeneve.ch", false },
- { "csirt.ee", true },
- { "csjministriesfoundation.org", true },
- { "cskentertainment.co.uk", true },
- { "cslaboralistas.pe", true },
- { "csmainframe.com", true },
- { "csosa.gov", true },
- { "csovek-idomok.hu", true },
- { "csp.ch", false },
- { "cspeti.hu", true },
- { "cspvalidator.org", true },
- { "csrichter.com", true },
- { "css-tricks.tk", true },
- { "css.direct", false },
- { "cssai.eu", true },
- { "cssaunion.com", true },
- { "cst188.cc", true },
- { "cstanley.net", true },
- { "cstb.ch", false },
- { "cstp-marketing.com", true },
- { "cstrong.nl", true },
- { "csu.st", true },
- { "csust.net", true },
- { "csvalpha.nl", true },
- { "cswarzone.com", true },
- { "cswebi.net", true },
- { "cswgmbh.de", true },
- { "csy.hu", true },
- { "ct.search.yahoo.com", false },
- { "ctc-transportation.com", true },
- { "ctcom-peru.com", true },
- { "ctcue.com", true },
- { "ctes.cz", true },
- { "ctf-albstadt.de", true },
- { "ctf.link", true },
- { "ctkwwri.org", true },
- { "ctliu.com", true },
- { "ctmrepository.com", true },
- { "ctnguyen.de", true },
- { "ctnguyen.net", true },
- { "ctns.de", false },
- { "ctoin.tw", true },
- { "ctomp.io", false },
- { "ctpe.net", true },
- { "ctrl.blog", true },
- { "cttso.gov", true },
- { "cu247secure.ie", true },
- { "cuatroymedia.com", true },
- { "cub-bouncingcastles.co.uk", true },
- { "cubaal.com", true },
- { "cubanchino.tk", true },
- { "cube.builders", true },
- { "cubebot.io", true },
- { "cubebuilders.net", true },
- { "cubecart-demo.co.uk", true },
- { "cubecart-hosting.co.uk", true },
- { "cubecraft.net", true },
- { "cubecraftcdn.com", true },
- { "cubekrowd.net", true },
- { "cubeperformancecentre.com.au", true },
- { "cubesugar.info", true },
- { "cubetech.co.jp", true },
- { "cubia.de", true },
- { "cubia3.com", true },
- { "cubia4.com", true },
- { "cubiest.com", true },
- { "cubigames.tk", true },
- { "cubile.xyz", true },
- { "cubing.net", true },
- { "cublick.com", true },
- { "cubos.io", false },
- { "cubsbestteaminbaseball.com", true },
- { "cubua.com", true },
- { "cuchichi.es", true },
- { "cuckoopalace.cn", true },
- { "cuddlecomfort.com", true },
- { "cuddlingyaks.com", true },
- { "cudoo.de", true },
- { "cueca.com.br", true },
- { "cuecasonline.com.br", true },
- { "cuegee.com", true },
- { "cuentamecomopaso.es", true },
- { "cuentasmutualamr.org.ar", true },
- { "cuetoems.com", true },
- { "cuibonobo.com", true },
- { "cuio.net", true },
- { "cuir-lipari.fr", true },
- { "culan.dk", true },
- { "cultiv.nl", true },
- { "cultofd50.org", true },
- { "cultofperf.org.uk", true },
- { "cultura10.com", true },
- { "culturabrasilia.tk", true },
- { "culturalparadiso.tk", true },
- { "culturedcode.com", true },
- { "cultureshift.co", true },
- { "culturesouthwest.org.uk", true },
- { "culturess.com", true },
- { "cumagini.com", true },
- { "cumberlandrivertales.com", true },
- { "cuminas.com", true },
- { "cuminas.jp", true },
- { "cumnock.name", true },
- { "cumnock.org", true },
- { "cumplegenial.com", true },
- { "cumseface.eu", true },
- { "cumshots-video.ru", true },
- { "cuoc.org.uk", true },
- { "cup.al", true },
- { "cupclub.com", true },
- { "cupoane-reducere.net", true },
- { "cupom.net", true },
- { "cur.by", true },
- { "curacao-firma.com", true },
- { "curacaodiveguide.com", true },
- { "curamail.co.uk", true },
- { "curbside.com", true },
- { "cureatr.com", true },
- { "curieux.digital", false },
- { "curio-shiki.com", true },
- { "curiosity-driven.org", true },
- { "curlify.com", true },
- { "curlybracket.co.uk", true },
- { "currency-strength.com", true },
- { "current-usa.com", true },
- { "currentlystreaming.com", true },
- { "currentlyusa.com", true },
- { "currynissanmaparts.com", true },
- { "cursos-trabajadores.net", true },
- { "cursos.com", true },
- { "cursosdeinglesmexico.com", true },
- { "cursosforex.com", true },
- { "cursosgratuitos.pe", true },
- { "cursosingles.com", true },
- { "cursossena.co", true },
- { "cursosypostgrados.com", true },
- { "cursuri-de-actorie.ro", true },
- { "curtacircuitos.com.br", false },
- { "curtis-smith.me.uk", true },
- { "curtis-smith.uk", true },
- { "curtislinville.net", true },
- { "curtissmith.me.uk", true },
- { "curtissmith.uk", true },
- { "curveprotect.com", true },
- { "curveprotect.cz", true },
- { "curveprotect.net", true },
- { "curveprotect.org", true },
- { "curvissa.co.uk", true },
- { "custamped.com", true },
- { "custer.tk", true },
- { "custodian.nl", true },
- { "custodyxchange.com", true },
- { "customdissertation.com", true },
- { "customessaystation.gq", true },
- { "customfitbymj.net", true },
- { "customizeyoursink.com", true },
- { "custompapers.com", true },
- { "customradio.tk", true },
- { "customsportsocks.com", true },
- { "customwebsitesplus.com", true },
- { "customwritings.com", true },
- { "customwritingservice.com", true },
- { "customwritten.com", true },
- { "cuteselfie.com", true },
- { "cutlinks.ml", true },
- { "cutmylink.gq", true },
- { "cutner.co", true },
- { "cuvva.co", true },
- { "cuvva.co.uk", true },
- { "cuvva.com", true },
- { "cuvva.eu", true },
- { "cuvva.io", true },
- { "cuvva.it", true },
- { "cuvva.me", true },
- { "cuvva.net", true },
- { "cuvva.org", true },
- { "cuvva.uk", true },
- { "cuvva.us", true },
- { "cuxpool.net", true },
- { "cvazquez.es", true },
- { "cvc.digital", true },
- { "cvchomes.com", true },
- { "cvcoders.com", true },
- { "cvdc.xyz", true },
- { "cve-le-carrousel.ch", false },
- { "cviip.ca", true },
- { "cviip.com", true },
- { "cvl.ch", false },
- { "cvlibrary.co.uk", true },
- { "cvmu.jp", true },
- { "cvo-group.com", true },
- { "cvr.dk", true },
- { "cvtemplatemaster.com", true },
- { "cvtshop.com.br", true },
- { "cvutdecin.cz", true },
- { "cvv.cn", true },
- { "cw.center", true },
- { "cwaclub.tk", true },
- { "cwagner.me", true },
- { "cwbrtrust.ca", true },
- { "cwc.gov", true },
- { "cwgaming.co.uk", true },
- { "cwmart.in", true },
- { "cwrau.com", true },
- { "cwrau.de", true },
- { "cwrau.info", true },
- { "cwrau.io", true },
- { "cwrau.me", true },
- { "cwrau.name", true },
- { "cwrau.rocks", true },
- { "cwrau.tech", true },
- { "cwrcoding.com", true },
- { "cwwise.com", true },
- { "cx100.io", true },
- { "cxadd.com", true },
- { "cyanghost.com", true },
- { "cyanhexagon.com", true },
- { "cyber-core.co.uk", true },
- { "cyber-travel.com", true },
- { "cyber-yaroslavl.tk", true },
- { "cyber.je", true },
- { "cyberatlantis.com", true },
- { "cybercareers.gov", true },
- { "cybercat-tver.tk", true },
- { "cybercrew.cc", true },
- { "cybercrime-forschung.de", true },
- { "cybercrime.gov", true },
- { "cybercustodian.com", true },
- { "cyberdean.fr", true },
- { "cyberdiscoverycommunity.uk", true },
- { "cyberduck.io", true },
- { "cyberdyne.ie", true },
- { "cyberdyne.llc", true },
- { "cyberfamily.network", true },
- { "cyberforensics.com", true },
- { "cyberfrancais.ro", true },
- { "cybergame-host.tk", true },
- { "cybergroup.cf", true },
- { "cybergrx.com", true },
- { "cyberguerrilla.info", true },
- { "cyberguerrilla.org", true },
- { "cyberhipsters.nl", true },
- { "cyberianhusky.com", false },
- { "cyberium-planet.cf", true },
- { "cyberlab.team", false },
- { "cyberlegal.co", true },
- { "cybermaniac.tk", true },
- { "cyberme.sh", true },
- { "cybermotives.com", true },
- { "cybernetivdigital.com", true },
- { "cyberogism.com", true },
- { "cyberonesol.com", true },
- { "cyberoptic.de", true },
- { "cyberpathogen.me", true },
- { "cyberpcforum.com", true },
- { "cyberphaze.com", true },
- { "cyberphoenix.tk", true },
- { "cyberpubonline.com", true },
- { "cybersafesolutions.com", true },
- { "cyberscan.io", true },
- { "cybersecurity.gr", true },
- { "cybersecurity.run", true },
- { "cybersecuritychallenge.be", false },
- { "cybersecurityketen.nl", true },
- { "cyberseguranca.com.br", true },
- { "cybersins.com", true },
- { "cybersmart.co.uk", true },
- { "cybersmartdefence.com", true },
- { "cybersound.tk", true },
- { "cyberspect.com", true },
- { "cyberspect.io", true },
- { "cyberstatus.de", true },
- { "cybertrash.xyz", true },
- { "cybertu.be", true },
- { "cyberwars.dk", true },
- { "cyberwire.nl", true },
- { "cybozu.cn", true },
- { "cybozu.com", true },
- { "cyclebeads.com", true },
- { "cycledownunder.com", true },
- { "cycleluxembourg.lu", true },
- { "cyclinggoodso.com", true },
- { "cyclonebikes.com.ua", true },
- { "cyclop-editorial.fr", true },
- { "cydetec.com", true },
- { "cyfly.org", true },
- { "cygnan.com", true },
- { "cygnatus.com", true },
- { "cygnius.net", true },
- { "cykelbanor.se", true },
- { "cyl6.com", true },
- { "cylindehea.com", true },
- { "cylindricity.com", true },
- { "cyllos.me", true },
- { "cynicaloptimist.me", true },
- { "cyon.ch", true },
- { "cyph.audio", true },
- { "cyph.com", true },
- { "cyph.healthcare", true },
- { "cyph.im", true },
- { "cyph.io", true },
- { "cyph.me", true },
- { "cyph.video", true },
- { "cyph.ws", true },
- { "cyphar.com", true },
- { "cypherpunk.at", true },
- { "cypherpunk.observer", true },
- { "cypressinheritancesaga.com", true },
- { "cyprus-company-service.com", true },
- { "cysec.biz", true },
- { "cysmo.de", true },
- { "cytat.tk", true },
- { "cytech.com.tr", true },
- { "cythereaxxx.com", true },
- { "cyumus.com", true },
- { "cz.ma", true },
- { "czakey.net", true },
- { "czaw.org", true },
- { "czbix.com", true },
- { "czbtm.com", true },
- { "czc.cz", true },
- { "czech.is", true },
- { "czechvirus.cz", true },
- { "czerno.com", true },
- { "czk.mk", true },
- { "czprothz.tk", true },
- { "czwartybrat.pl", true },
- { "d-20.fr", true },
- { "d-consultant.ru", true },
- { "d-designerin.de", true },
- { "d-eisenbahn.com", true },
- { "d-macindustries.com", true },
- { "d-parts.de", true },
- { "d-parts24.de", true },
- { "d-toys.com.ua", true },
- { "d-training.de", true },
- { "d-vision-web.com", true },
- { "d.nf", true },
- { "d.nr", true },
- { "d00228.com", false },
- { "d00d.de", true },
- { "d0g.cc", true },
- { "d0m41n.name", true },
- { "d0xq.com", true },
- { "d2.gg", true },
- { "d2ph.com", true },
- { "d36533.com", true },
- { "d3a.xyz", true },
- { "d3dev.cf", true },
- { "d3lab.net", true },
- { "d3xt3r01.tk", true },
- { "d3xx3r.de", true },
- { "d42.no", true },
- { "d4b.in.ua", true },
- { "d4done.com", true },
- { "d4fx.de", true },
- { "d4x.de", true },
- { "d66.ag", true },
- { "d66.nl", true },
- { "d6c5yfulmsbv6.cloudfront.net", true },
- { "d7211.com", true },
- { "d7215.com", true },
- { "d7216.com", true },
- { "d8.ag", true },
- { "d8.io", true },
- { "d8118.com", true },
- { "d81818.com", true },
- { "d8228.com", true },
- { "d8778.com", true },
- { "d8787.net", true },
- { "d88.ag", true },
- { "d88.cc", false },
- { "d88.cn.com", true },
- { "d881.net", true },
- { "d8811.net", true },
- { "d88111.com", true },
- { "d8812.com", true },
- { "d8813.com", true },
- { "d8814.com", true },
- { "d8816.net", true },
- { "d8817.com", true },
- { "d8819.com", true },
- { "d8824.com", true },
- { "d88322.com", true },
- { "d88333.com", true },
- { "d8834.com", true },
- { "d8841.com", true },
- { "d8842.com", true },
- { "d8843.com", true },
- { "d8845.com", true },
- { "d8847.com", true },
- { "d8850.net", true },
- { "d88522.com", true },
- { "d8853.com", true },
- { "d8854.com", true },
- { "d8859.com", true },
- { "d886.net", true },
- { "d8860.net", true },
- { "d8861.com", true },
- { "d8864.com", true },
- { "d88688.com", true },
- { "d8870.net", true },
- { "d8872.net", true },
- { "d8874.com", true },
- { "d8878.com", true },
- { "d888.ag", true },
- { "d888.co", true },
- { "d888.me", true },
- { "d88818.com", true },
- { "d88870.com", true },
- { "d88877.com", true },
- { "d88882.com", true },
- { "d88886.com", true },
- { "d8890.net", true },
- { "d8897.com", true },
- { "d8898.com", true },
- { "d88988.com", true },
- { "d88998.com", true },
- { "d88agent.com", true },
- { "d88dc05.com", true },
- { "d88girls.com", true },
- { "d88md03.com", true },
- { "d88md24.com", true },
- { "d88md29.com", true },
- { "d8998.com", true },
- { "d9c.eu", true },
- { "daallexx.eu", true },
- { "dabai.club", true },
- { "dabai.photo", true },
- { "dabasstacija.lv", true },
- { "dabuttonfactory.com", true },
- { "daceurope.co.uk", true },
- { "dachb0den.net", true },
- { "dachbleche24-shop.de", true },
- { "dachdecker-ranzenberger.de", true },
- { "dachdeckermeister-egon-weiss.de", true },
- { "dachtechnik-windschuettl.de", true },
- { "daciaforum.nl", true },
- { "daciamodellen.nl", true },
- { "dadadani.xyz", true },
- { "dadafterforty.be", true },
- { "daddybio.com", true },
- { "daddyfinger.me", true },
- { "dado.fr", true },
- { "dado.me", true },
- { "dado.virtual.museum", true },
- { "dadosch.de", true },
- { "dadrian.io", true },
- { "daduke.org", true },
- { "daemen.org", true },
- { "daemon-hentai.tk", true },
- { "daemonslayer.net", true },
- { "daemwool.ch", true },
- { "daevel.com", true },
- { "daevel.fr", true },
- { "daevel.net", true },
- { "dafe2021.ee", true },
- { "dafont.com", true },
- { "dafricapress.com", true },
- { "dafyddcrosby.com", true },
- { "dag-hebergement.fr", true },
- { "dag-konsult.com", true },
- { "dagensannonser.se", true },
- { "dagmarhamalova.cz", true },
- { "dagrs.se", true },
- { "dahlberg.cologne", true },
- { "dahobo.tk", true },
- { "dai.top", true },
- { "dai94.com", true },
- { "daidr.me", true },
- { "daie-inc.com", true },
- { "daigakujuken-plus.com", true },
- { "daikoz.com", true },
- { "dailybits.be", true },
- { "dailyblogged.com", true },
- { "dailychristianpodcast.com", true },
- { "dailyemailinboxing.com", true },
- { "dailyenglishchallenge.com", true },
- { "dailyhealthguard.com", true },
- { "dailykos.com", true },
- { "dailynewsclubs.ga", true },
- { "dailypop.ru", true },
- { "dailyrenewblog.com", true },
- { "dailyrover.com", true },
- { "dailyroverr.com", true },
- { "dailyxenang.com", true },
- { "daimafengzi.com", true },
- { "dairyshrine.org", true },
- { "daisakuikeda.org", true },
- { "daisidaniels.co.uk", true },
- { "daisy-peanut.com", true },
- { "daisypeanut.com", true },
- { "daitouryu-jujutsu.com", true },
- { "dajiadu.net", true },
- { "dajiadu8.com", true },
- { "dajiale.org", true },
- { "dak.org", true },
- { "dakin.nyc", true },
- { "dakindesign.com", true },
- { "dakinnyc.com", true },
- { "daknob.net", true },
- { "dakota-spain.tk", true },
- { "dakotasjoint.com", true },
- { "daktarisys.com", true },
- { "dal.net.sa", true },
- { "daladubbeln.se", true },
- { "dalaran.city", true },
- { "dalb.in", true },
- { "dalcomseo.com", true },
- { "dale-west.com", true },
- { "dalfsennet.nl", true },
- { "dalianbbq.com", true },
- { "dalingk.com", true },
- { "dallaslu.com", true },
- { "dallasmenshealth.com", true },
- { "dallinbryce.com", true },
- { "dallmeier.net", true },
- { "dalmatiersheusden.be", true },
- { "damaged.org", true },
- { "damasexpress.com", true },
- { "damedrogy.cz", true },
- { "damejidlo.cz", true },
- { "dameocio.com", true },
- { "damghaem.ir", true },
- { "damianus.hr", true },
- { "damianuv-blog.cz", true },
- { "damicris.ro", true },
- { "damienoreilly.org", true },
- { "daminiphysio.ca", true },
- { "damip.net", true },
- { "damirsystems.com", true },
- { "damjanovic.it", true },
- { "dammekens.be", true },
- { "damngoodpepper.com", false },
- { "damonline.dk", true },
- { "dampedia.com", true },
- { "dan-bureau.com", true },
- { "dan-bureau.dk", true },
- { "dan.me.uk", true },
- { "danads.com", true },
- { "danajamin.com", true },
- { "danalytics.com.pe", true },
- { "danamica.dk", true },
- { "danandrum.com", true },
- { "danarozmarin.com", true },
- { "danbaldwinart.com", true },
- { "danbergen.com", true },
- { "danburycampervans.co.uk", true },
- { "dance-colleges.com", true },
- { "danceylove.net", true },
- { "danchen.org", true },
- { "dancingcubs.co.uk", true },
- { "dandan101.com", true },
- { "dandenongroadapartments.com.au", true },
- { "dandia.ro", true },
- { "danel.ski", true },
- { "danelska.pl", true },
- { "danelski.pl", true },
- { "danfromit.co.uk", true },
- { "danfromit.com", true },
- { "dangr.zone", true },
- { "danhalliday.com", true },
- { "danholloway.online", true },
- { "daniel-baumann.ch", true },
- { "daniel-cholewa.de", true },
- { "daniel-kulbe.de", true },
- { "daniel-leblanc.tk", true },
- { "daniel-milnes.co.uk", true },
- { "daniel-milnes.uk", true },
- { "daniel-ruf.de", true },
- { "daniel-wildhaber.ch", true },
- { "danielas.boutique", true },
- { "daniele.tech", true },
- { "danielehniss.de", true },
- { "danielepestilli.com", true },
- { "danielgorr.de", true },
- { "danielgray.email", true },
- { "danielgray.me", true },
- { "danielguttfreundphd.net", true },
- { "danielhinterlechner.eu", true },
- { "danielhochleitner.de", true },
- { "danieliancu.com", true },
- { "danieljamesscott.org", true },
- { "danieljball.co.uk", true },
- { "danieljstevens.com", true },
- { "danielkanchev.com", true },
- { "danielkeppler.com", true },
- { "danielkoster.nl", true },
- { "danielluisrodriguezs.com", true },
- { "danielmartin.de", true },
- { "danielmiessler.com", true },
- { "danielmoch.com", true },
- { "danielmorell.com", true },
- { "danieln.tech", true },
- { "danielnaaman.com", true },
- { "danielparker.com.au", true },
- { "danielpenno.com", true },
- { "danielpeukert.cz", true },
- { "danielran.com", true },
- { "danielrozenberg.com", true },
- { "danielsblog.org", true },
- { "danielsfirm.com", true },
- { "danielstach.cz", true },
- { "danielsteiner.net", true },
- { "danielstiner.me", true },
- { "danielthompson.info", true },
- { "danieltollot.de", true },
- { "danielvanassen.nl", true },
- { "danielvoogsgerd.nl", true },
- { "danielwildhaber.ch", true },
- { "danifabi.eu", true },
- { "daniilgeorge.com", true },
- { "danilapisarev.com", true },
- { "danjesensky.com", true },
- { "dank.ninja", true },
- { "dankim.de", false },
- { "danla.nl", true },
- { "danmaby.com", true },
- { "danmarksbedstefredagsbar.dk", true },
- { "danmarksflyttemand.dk", true },
- { "danmassarano.com", true },
- { "danminkevitch.com", false },
- { "danna-salary.com", true },
- { "danndorf.com", true },
- { "dannhanks.com", true },
- { "dannicholas.net", true },
- { "danny-tittel.de", true },
- { "dannycairns.com", true },
- { "dannygaidateraelgar.com", true },
- { "dannyjota.tk", true },
- { "dannyrohde.de", false },
- { "dannystevens.co.uk", true },
- { "danotage.tv", true },
- { "danpiel.net", true },
- { "dansage.co", true },
- { "dansaunders.me", true },
- { "dansdiscounttools.com", true },
- { "dansedesalonsaintave.fr", true },
- { "danselibre.net", true },
- { "danselibre.org", true },
- { "danseressen.nl", true },
- { "danskefilm.dk", true },
- { "danskoferie.dk", true },
- { "danskoya.com", true },
- { "danslan.org", true },
- { "danstillman.com", true },
- { "dantransports.fr", true },
- { "danw.io", true },
- { "danwin1210.me", true },
- { "danwolff.se", true },
- { "danyabanya.com", true },
- { "danzac.com", true },
- { "danzka.tk", true },
- { "dao.spb.su", true },
- { "daop.co.uk", true },
- { "daoro.net", false },
- { "daphne.informatik.uni-freiburg.de", true },
- { "dapoxetinagenerico.cf", true },
- { "dapperdom.net", true },
- { "daracokorilo.com", true },
- { "darani.ch", true },
- { "daravk.ch", true },
- { "darbi.org", true },
- { "darc-mak.de", false },
- { "darchoods.net", false },
- { "darcymarshall.com", true },
- { "dare.deals", true },
- { "dareyou.be", true },
- { "darf.nl", true },
- { "dariaburger.de", true },
- { "darinkotter.com", true },
- { "darioackermann.ch", false },
- { "darioclip.com", true },
- { "darioturchetti.me", true },
- { "dark-crystal.tk", true },
- { "dark-infection.de", true },
- { "dark-nova.me", true },
- { "dark-nova.tk", true },
- { "dark-vision.cz", true },
- { "dark.fail", true },
- { "dark.ninja", true },
- { "darkcores.net", true },
- { "darkengine.io", true },
- { "darkengine.net", true },
- { "darkeststar.org", true },
- { "darkfire.ch", true },
- { "darklang.com", true },
- { "darklaunch.com", true },
- { "darknessflickers.com", false },
- { "darknetlive.com", true },
- { "darknight.blog", true },
- { "darkrisks.com", true },
- { "darkserver.fedoraproject.org", true },
- { "darkserver.stg.fedoraproject.org", true },
- { "darkshop.nl", true },
- { "darkskymap.com", true },
- { "darkspacelab.com", true },
- { "darktime.ru", true },
- { "darkwater.info", true },
- { "darkx.me", true },
- { "darlenejacques.com", true },
- { "darmgesundheit.ch", true },
- { "darom.jp", true },
- { "darshnam.com", true },
- { "dartcode.org", true },
- { "dartetdemetiers.fr", true },
- { "darth-sonic.de", true },
- { "darwinkel.net", true },
- { "darwinsearch.org", true },
- { "daryl.moe", true },
- { "darylcrouse.com", true },
- { "darylcumbo.net", true },
- { "das-forum24.de", true },
- { "das-mediale-haus.de", true },
- { "das-sommercamp.de", true },
- { "dasgeestig.nl", true },
- { "dashdrive.net", true },
- { "dashlane.com", true },
- { "dashnearby.com", true },
- { "dasignsource.com", true },
- { "dasinternetluegt.at", true },
- { "dassolutions.eu", true },
- { "dasteichwerk.at", true },
- { "dasug.de", true },
- { "dat4u.de", true },
- { "data-captive.com", true },
- { "data-detox.de", true },
- { "data-jt.de", true },
- { "data-wing.ga", false },
- { "data.bayern", true },
- { "data.gov", true },
- { "data.govt.nz", true },
- { "data.haus", true },
- { "data.world", true },
- { "data3w.nl", true },
- { "databasez.net", true },
- { "databionix.com", true },
- { "databutlr.com", true },
- { "databutlr.net", true },
- { "datacalle.com", true },
- { "datacaptive.com", true },
- { "datacommissioner.gov.au", true },
- { "datadit.hu", true },
- { "datadyne.technology", true },
- { "dataformers.at", true },
- { "datagrail.io", true },
- { "dataharvest.at", true },
- { "datahive360.com", true },
- { "datahjalp.nu", true },
- { "datajobs.ai", true },
- { "datakick.org", true },
- { "datalife.gr", true },
- { "datalysis.ch", false },
- { "dataman.ml", true },
- { "dataprivacysolution.com", true },
- { "datapun.ch", true },
- { "dataregister.info", true },
- { "datart.fr", true },
- { "datasafeassurance.co.uk", true },
- { "datascience.cafe", true },
- { "datascience.ch", false },
- { "dataskydd.net", false },
- { "dataspace.pl", true },
- { "datasupport-stockholm.se", true },
- { "datasupport.one", true },
- { "dataswamp.org", true },
- { "datatekniikka.fi", false },
- { "datatekniker.nu", true },
- { "datateknologsektionen.se", false },
- { "datatree.nl", true },
- { "datatruckers.com", true },
- { "datatruckers.email", true },
- { "datatruckers.eu", true },
- { "datatruckers.net", true },
- { "datatruckers.nl", true },
- { "datatruckers.org", true },
- { "datatypes.net", true },
- { "datax-cloud.de", true },
- { "datecougarslocal.com", true },
- { "datelah.com", true },
- { "datememe.com", true },
- { "datenendlager.org", true },
- { "datengrab.xyz", true },
- { "datenkeks.de", true },
- { "dateno1.com", true },
- { "datenreiter.org", true },
- { "datenschutz-consult.de", true },
- { "datenschutz-individuell.de", true },
- { "datenschutzgrundverordnung.de", true },
- { "datenschutztag.org", true },
- { "datenschutzzentrum.de", true },
- { "datenwerkstatt.net", true },
- { "datewon.net", true },
- { "dating.wedding", true },
- { "datingsite-vergelijken.website", true },
- { "datingsrit.tk", true },
- { "datingticino.ch", false },
- { "datisstom.nl", true },
- { "datmancrm.com", true },
- { "dator-test.se", true },
- { "datorhjalp-stockholm.se", true },
- { "datorhjalptaby.se", true },
- { "datorservice-stockholm.se", true },
- { "datumou-osusume.com", true },
- { "datumou-recipe.com", true },
- { "datumstudio.jp", true },
- { "daubecity.de", true },
- { "daubehosting.de", true },
- { "daunatotala.ro", true },
- { "dave-pearce.com", true },
- { "daveaglick.com", true },
- { "davecardwell.com", true },
- { "davelynes.com", true },
- { "daveoc64.co.uk", true },
- { "daveops.net", true },
- { "davepage.me.uk", true },
- { "davepearce.com", true },
- { "davescomputertips.com", true },
- { "davesinclair.com.au", true },
- { "davetempleton.com", true },
- { "davethom.net", true },
- { "davevelopment.net", true },
- { "davewardle.com", true },
- { "davewood.com.au", true },
- { "david-corry.com", true },
- { "david-hinschberger.me", true },
- { "david-jeffery.co.uk", true },
- { "david-merkel.de", true },
- { "david-pearce.com", true },
- { "david-reess.de", true },
- { "david-schiffmann.de", true },
- { "david.kitchen", true },
- { "davidadrian.org", true },
- { "davidandersson.se", true },
- { "davidandrewcoaching.com", true },
- { "davidbranco.me", true },
- { "davidbrookes.me", true },
- { "davidbuckell.com", true },
- { "daviddever.net", true },
- { "davidfetveit.com", true },
- { "davidfrancoeur.com", true },
- { "davidgouveia.net", true },
- { "davidgow.net", true },
- { "davidgreig.uk", true },
- { "davidgroup.co.id", true },
- { "davidgrudl.com", true },
- { "davidhanle.com", true },
- { "davidje13.com", true },
- { "davidkeane.com", true },
- { "davidkennardphotography.com", true },
- { "davidking.xyz", true },
- { "davidlamprea.com", true },
- { "davidlane.io", true },
- { "davidlyness.com", true },
- { "davidmcevoy.org.uk", true },
- { "davidmessenger.co.uk", true },
- { "davidmn.org", true },
- { "davidops.com", true },
- { "davidpearce.com", true },
- { "davidpearce.org", true },
- { "davidpescarolo.it", true },
- { "davidschadlich.com", true },
- { "davidschlachter.com", true },
- { "davidschubert.com", true },
- { "davidsimner.me.uk", true },
- { "davidsopas.com", true },
- { "davidtiffany.com", true },
- { "davidundetiwan.com", true },
- { "davidzeegers.nl", true },
- { "davie3.com", true },
- { "davisdieselandautorepair.com", true },
- { "davisroi.com", true },
- { "davo-usedcars.be", false },
- { "davy-server.com", true },
- { "davypropper.com", true },
- { "daw.nz", true },
- { "dawgs.ga", true },
- { "dawnbringer.eu", true },
- { "dawnbringer.net", true },
- { "dawnofeden.net", true },
- { "dawnson.is", true },
- { "dawoud.org", true },
- { "dawson-floridavilla.co.uk", true },
- { "dax.guide", true },
- { "daxpatterns.com", true },
- { "daycontactlens.com", true },
- { "daylightpirates.org", true },
- { "daymprove.life", true },
- { "dayofdays.be", true },
- { "dayofthegirl.gc.ca", true },
- { "days.one", true },
- { "daysinnaustin.com", true },
- { "daysoftheyear.com", true },
- { "dayswithnostabbings.ca", true },
- { "dayuse-hotels.it", true },
- { "dayuse.co.uk", true },
- { "dayuse.com", true },
- { "dayuse.cz", true },
- { "dayuse.es", true },
- { "dayuse.fr", true },
- { "dayuse.pt", true },
- { "dayuse.se", true },
- { "daywalkers-photography.de", true },
- { "dazz.it", true },
- { "dazzit.ca", true },
- { "dazzit.com", true },
- { "dazzit.io", true },
- { "dazzit.net", true },
- { "dazzit.org", true },
- { "dazzit.xyz", true },
- { "db-works.nl", true },
- { "db.ci", true },
- { "dbapress.org", true },
- { "dbaron.org", true },
- { "dbas.cz", true },
- { "dbb.wtf", true },
- { "dbentertainment.co.uk", true },
- { "dbgamestudio.com", true },
- { "dblcastles.co.uk", true },
- { "dbldub.net", true },
- { "dbmiller.org", true },
- { "dbmteam.com", true },
- { "dborcard.com", false },
- { "dbpkg.com", true },
- { "dbplanview.com", true },
- { "dbq.com", true },
- { "dbrand.com", true },
- { "dbrgn.ch", true },
- { "dbtsai.com", false },
- { "dc-acupuncture.com", true },
- { "dc-elektro.com", true },
- { "dc-elektro.de", true },
- { "dc-elektro.eu", true },
- { "dc-occasies.be", false },
- { "dc-solution.de", false },
- { "dc1.com.br", true },
- { "dc562.org", true },
- { "dc585.info", true },
- { "dcain.me", true },
- { "dcards.in.th", true },
- { "dcave.net", true },
- { "dcbouncycastles.co.uk", true },
- { "dcc.moe", true },
- { "dccwiki.com", true },
- { "dcdestetica.it", true },
- { "dcepler.net", true },
- { "dchatelain.ch", false },
- { "dchest.org", true },
- { "dckd.nl", true },
- { "dclaisse.fr", true },
- { "dcmapping.net", true },
- { "dcmarvelunited.com", true },
- { "dcmediahosting.com", true },
- { "dcmt.co", true },
- { "dcpower.eu", true },
- { "dcrdev.com", true },
- { "dcw.io", true },
- { "dcyph.de", true },
- { "dd.art.pl", true },
- { "dd00228.com", false },
- { "dd118d.com", true },
- { "dd11d.net", true },
- { "dd202d.com", true },
- { "dd207d.com", true },
- { "dd209d.com", true },
- { "dd211d.com", true },
- { "dd215d.com", true },
- { "dd33d.net", true },
- { "dd44d.net", true },
- { "dd7211.com", true },
- { "ddatsh.com", true },
- { "ddays2008.org", true },
- { "dddmelbourne.com", true },
- { "ddel.de", true },
- { "dden.ca", true },
- { "ddepot.us", true },
- { "ddhosted.com", true },
- { "ddns-test.de", true },
- { "ddnsweb.com", false },
- { "ddoser.cn", false },
- { "ddosguard.cf", true },
- { "ddosolitary.org", true },
- { "ddracepro.net", true },
- { "dds.mil", true },
- { "ddsmatchsouthwest.com", true },
- { "de-gucci.com", true },
- { "de-kramers.nl", true },
- { "de-mail.info", true },
- { "de-medici.nl", true },
- { "de-mossadeq.tk", true },
- { "de-rwa.de", true },
- { "de.search.yahoo.com", false },
- { "de8468.com", true },
- { "dead-letter.email", true },
- { "deadbeef.ninja", true },
- { "deadc0de.re", true },
- { "deadmorose.ru", true },
- { "deadpulse.com", true },
- { "deadroot.tk", true },
- { "deaf.dating", true },
- { "deaf.eu.org", true },
- { "deal-runners.cf", true },
- { "deal30.fr", true },
- { "dealapp.nl", true },
- { "dealbanana.at", true },
- { "dealbanana.be", true },
- { "dealbanana.ch", true },
- { "dealbanana.co.uk", true },
- { "dealbanana.com", true },
- { "dealbanana.de", true },
- { "dealbanana.fi", true },
- { "dealbanana.fr", true },
- { "dealbanana.it", true },
- { "dealbanana.se", true },
- { "dealbx.com", true },
- { "dealcruiser.nl", true },
- { "dealdump.nl", true },
- { "dealerselectric.com", true },
- { "dealinflatables.co.uk", true },
- { "dealosa.com", true },
- { "dealspotr.com", true },
- { "dealszone.net", true },
- { "deamuseum.org", true },
- { "deanandnatalia.co.za", true },
- { "deanbank.com", true },
- { "deanjerkovich.com", true },
- { "deanmorgan.org", true },
- { "deano-s.co.uk", true },
- { "deanosplace.net", true },
- { "deanpearce.net", true },
- { "deantiguos.es", true },
- { "dearfcc.com", true },
- { "dearfcc.net", true },
- { "dearfcc.org", true },
- { "dearktiel.nl", true },
- { "dearnevalleybouncycastles.co.uk", true },
- { "dearstackexchange.com", true },
- { "death.social", true },
- { "deathofspring.com", false },
- { "deathsdomain.com", true },
- { "deathy.ro", true },
- { "deautomaat.nl", true },
- { "deavel.com", true },
- { "deavel.fr", true },
- { "deavel.net", true },
- { "debarras-diogene.paris", true },
- { "debatereport.com", true },
- { "debbyefurd.com", true },
- { "debie-usedcars.be", false },
- { "debierhandel.nl", true },
- { "debigare.com", true },
- { "debitterballetjes.tk", true },
- { "debron-ot.nl", true },
- { "debrusoft.ch", true },
- { "debtrecycling.com.au", true },
- { "debuemon.com", true },
- { "debuis.nl", true },
- { "dec6.gc.ca", true },
- { "decaffeinated.io", true },
- { "decal-times.com", true },
- { "decalquai.ch", false },
- { "decarrouseloss.nl", true },
- { "dechat.nl", true },
- { "decher.de", true },
- { "dechetor.fr", true },
- { "decidio.cc", true },
- { "decipe.com", true },
- { "decis.fr", true },
- { "decisivetactics.com", true },
- { "deckenplatten.org", true },
- { "deckersheaven.com", true },
- { "declarationlocationmeublee.com", true },
- { "declivitas.com", true },
- { "deco-parisienne.fr", true },
- { "decock-usedcars.be", false },
- { "decode.ga", true },
- { "decofiori.com", true },
- { "decologisticsgh.com", true },
- { "decompiled.de", true },
- { "deconsolas.tk", true },
- { "decoora.com", true },
- { "decor-d.com", true },
- { "decor-live.ru", true },
- { "decor-prazdnik.ru", true },
- { "decorarmicasa.com", true },
- { "decoratingadvice.co.uk", true },
- { "decorativeconcretewa.com.au", true },
- { "decorativeflooring.com", true },
- { "decoratore.roma.it", true },
- { "decoratrix.com", true },
- { "decorauvent.ca", true },
- { "decorestilo.com.br", true },
- { "decorotti.com.tr", true },
- { "decosoftware.com", true },
- { "decrousaz-ceramique.ch", false },
- { "decrypto.net", true },
- { "decs.es", true },
- { "dede.ml", true },
- { "dedelta.net", true },
- { "dedg3.com", true },
- { "dedge.org", true },
- { "dedicatedtowomenobgyn.com", true },
- { "dedmoroz.ga", true },
- { "dedmorozrzn.ru", false },
- { "dedoho.pw", false },
- { "dedoles.at", true },
- { "dedoles.com", true },
- { "dedoles.cz", true },
- { "dedoles.de", true },
- { "dedoles.hu", true },
- { "dedoles.pl", true },
- { "dedoles.ro", true },
- { "dedoles.sk", true },
- { "deduijventil.nl", true },
- { "dee.pe", true },
- { "dee.su", true },
- { "deechtebakkers.nl", true },
- { "deegeeinflatables.co.uk", true },
- { "deelmijnreis.nl", true },
- { "deep-labs.com", true },
- { "deep.club", true },
- { "deepbluecrafting.co.uk", true },
- { "deepcode.io", true },
- { "deephill.com", true },
- { "deepinnov.com", true },
- { "deepinsight.io", true },
- { "deeplink-medical.com", true },
- { "deepnet.cc", true },
- { "deeps.me", true },
- { "deepserve.info", true },
- { "deepspace.dedyn.io", true },
- { "deepspace4.com", true },
- { "deerfieldapartmentsstl.com", true },
- { "deerwoodrvpark.com", true },
- { "def-pos.ru", true },
- { "defantasia.cl", true },
- { "defcon.org", true },
- { "defcongroups.org", true },
- { "defeestboek.nl", true },
- { "defendas.com", true },
- { "defendbearbutte.org", true },
- { "defender-pro.com", true },
- { "defendersz.com", true },
- { "defendinnovation.org", true },
- { "defendtheweb.net", true },
- { "defensivefirearmsinstruction.org", true },
- { "defero.io", true },
- { "defesa.gov.br", true },
- { "deffo.com.au", true },
- { "defiantrust.com", true },
- { "defibrillateur.co", true },
- { "define-atheism.com", true },
- { "define-atheist.com", true },
- { "defineatheism.com", true },
- { "defineatheist.com", true },
- { "definitely.cn", true },
- { "definitions360.com", true },
- { "defis-franciliens.fr", true },
- { "deflect.ca", true },
- { "deflumeri.com", true },
- { "deflumeriker.com", true },
- { "defman.me", true },
- { "defont.nl", true },
- { "defreitas.no", true },
- { "deftek.com", true },
- { "defterikebir.tk", true },
- { "deftig-und-fein.de", true },
- { "deftnerd.com", true },
- { "defunct-engineers.ml", true },
- { "defuse.ca", true },
- { "defxing.net", true },
- { "degata.com", true },
- { "degeeks.xyz", true },
- { "degen-elektrotechnik.de", true },
- { "degestamptepot.nl", true },
- { "degit.de", true },
- { "degoeiewebsite.cf", true },
- { "degoticapunk.xyz", true },
- { "degoulet.net", true },
- { "degracetechnologie.com", true },
- { "degradarium.com", true },
- { "degrasboom.nl", true },
- { "dehopre.com", true },
- { "dehydrated.de", true },
- { "deidee.nl", true },
- { "deimos.gq", true },
- { "dein-baumdienst.de", true },
- { "dein-trueffel.de", true },
- { "deinballon.de", true },
- { "deine-gitarre.com", true },
- { "deinelakaien.tk", true },
- { "deinewebsite.de", true },
- { "deinfoto.ch", true },
- { "deinsparen24.de", true },
- { "deitti.net", true },
- { "dejandayoff.com", true },
- { "dejongonline.eu", true },
- { "dejting-sidor.com", true },
- { "dejure.org", false },
- { "dejw.cz", true },
- { "dekasegi-kansai.com", true },
- { "dekasegi-supportcenter.com", true },
- { "dekasiba.com", true },
- { "dekel.co.il", true },
- { "dekeurslagers.nl", true },
- { "dekko.io", true },
- { "dekonix.ru", true },
- { "dekruifschalkwijk.nl", true },
- { "dekulk.nl", true },
- { "del-ex.de", true },
- { "delahrzolder.nl", true },
- { "delam.site", true },
- { "delbecqvo.be", false },
- { "delegao.moe", true },
- { "deleidscheflesch.nl", true },
- { "delfic.org", true },
- { "delhionlinegifts.com", true },
- { "deliacreates.com", true },
- { "deliandiver.org", true },
- { "deliberatedigital.com", true },
- { "deliciisanatoase.ro", true },
- { "deliciousmedia.co.uk", true },
- { "deliciousmedia.net", true },
- { "delicioustable.com", true },
- { "delid.cz", true },
- { "delio.tk", true },
- { "dellacasapizzasemassas.com.br", true },
- { "dellipaoli.com", true },
- { "delogo.nl", true },
- { "delopt.co.in", true },
- { "delorenzi.dk", true },
- { "deloretta.com", true },
- { "delosgaia.nl", true },
- { "delpark.de", true },
- { "delphia.ai", true },
- { "delphia.com", true },
- { "delphine.dance", true },
- { "delta-data.ch", true },
- { "delta-host.ml", true },
- { "delta-smart.ch", true },
- { "delta.ru", true },
- { "delta23.de", false },
- { "deltaacademy.org", true },
- { "deltadata.ch", true },
- { "deltafinanceiro.com", true },
- { "deltafinanceiro.com.br", true },
- { "deltaloja.com.br", true },
- { "deltanio.nl", true },
- { "deltaonlineguards.com", true },
- { "deltaservers.blog.br", true },
- { "deltaservers.com.br", true },
- { "deltasigmachi.org", true },
- { "deltatutoriais.com.br", true },
- { "deltav.ml", false },
- { "deltava.org", true },
- { "deltawolf.tk", true },
- { "demadryn.com", true },
- { "demarle.ch", false },
- { "demastglazenwasserij.nl", true },
- { "demedx.at", true },
- { "dementiacaring.com.au", true },
- { "dementiapraecox.de", true },
- { "dementieva-pennetta.tk", true },
- { "demeyere-usedcars.be", false },
- { "demfloro.ru", true },
- { "demibaguette.com", true },
- { "demicrofonos.com", true },
- { "demijn.nl", true },
- { "demilletech.net", true },
- { "demiranda.com", true },
- { "demirdokum.tk", true },
- { "demmer.one", true },
- { "demo.swedbank.se", true },
- { "demo9.ovh", true },
- { "democracy-news.tk", true },
- { "democracychronicles.com", true },
- { "democracydirect.com", true },
- { "democracyineurope.eu", true },
- { "democraziaineuropa.eu", true },
- { "demomanca.com", true },
- { "demonbuster.tk", true },
- { "demoniak.ch", true },
- { "demonwav.com", true },
- { "demonwolfdev.com", true },
- { "demopanel.tk", true },
- { "demotivatorbi.ru", true },
- { "dempsters.ca", false },
- { "demuzere.be", true },
- { "denabot.pw", true },
- { "denaehula.com", true },
- { "denali.net", false },
- { "denardbrewing.com", true },
- { "denariu.net", true },
- { "denatured.tk", true },
- { "denbkh.ru", false },
- { "dendelft.nl", true },
- { "denegmnogo.tk", true },
- { "denejki.tk", true },
- { "dengivdom.tk", true },
- { "dengode.eu", true },
- { "denimtoday.com", true },
- { "denince.net", true },
- { "denis-martinez.photos", true },
- { "denisadinu.com", true },
- { "denisewakeman.com", true },
- { "denistruffaut.fr", false },
- { "deniszczuk.pl", true },
- { "deniz.uk", true },
- { "denizdesign.co.uk", true },
- { "denkeandersblog.de", true },
- { "denkmalagentur.ch", true },
- { "denkmalsetzung.at", true },
- { "denkubator.de", true },
- { "dennisang.com", true },
- { "dennisdoes.net", false },
- { "dennisforbes.ca", true },
- { "dennishzg.com", true },
- { "denniskoot.nl", true },
- { "dennismurphy.biz", true },
- { "dennisvandenbos.nl", true },
- { "dennogumi.org", true },
- { "denous.nl", true },
- { "dent.uy", true },
- { "dental-cloud.eu", true },
- { "dental-colleges.com", true },
- { "dentallaborgeraeteservice.de", true },
- { "dentechnica.co.uk", true },
- { "dentistesdarveauetrioux.com", true },
- { "dentistglasgow.com", true },
- { "dentistryateastpiedmont.com", true },
- { "dentrassi.de", true },
- { "dentystabirmingham.co.uk", true },
- { "denvergospelhall.org", true },
- { "denvernews.ml", true },
- { "denwauranailab.com", true },
- { "denydarko.tk", true },
- { "deonlinespecialist.nl", true },
- { "deontology.com", true },
- { "depaco.com", true },
- { "depannage-traceur.fr", true },
- { "deparis.me", true },
- { "departmentofdefense.tk", true },
- { "departmentofoncology.com", true },
- { "depeces.com", true },
- { "depechemode-live.com", true },
- { "depedclub.net", true },
- { "depedsurigaodelnorte.com", true },
- { "depedtalks.com", true },
- { "depedtambayan.net", true },
- { "depedtayo.ph", true },
- { "depelos.co", true },
- { "depelteau.com", true },
- { "dependablehvacrefrigeration.com", true },
- { "depicus.com", true },
- { "depilacioncon.com", true },
- { "depleteduranium.tk", true },
- { "depoker.top", true },
- { "depone.net", true },
- { "depop.com", true },
- { "depositart.com", true },
- { "depositomerci.it", true },
- { "depositomobili.it", true },
- { "depot24.nl", true },
- { "depotsquarekerrville.com", true },
- { "depotter-usedcars.be", false },
- { "deprecate.de", true },
- { "deprobe.pro", true },
- { "depthe.gr", true },
- { "depuratori.milano.it", true },
- { "der-bank-blog.de", true },
- { "der-fliesenzauberer.de", true },
- { "der-gardinenmann.de", true },
- { "der-lan.de", true },
- { "der-rohrstock.club", true },
- { "der-rudi.eu", true },
- { "der-windows-papst.de", true },
- { "derattizzazione.name", true },
- { "derattizzazioni.biz", true },
- { "derattizzazioni.milano.it", true },
- { "derattizzazioni.org", true },
- { "derbuntering.de", true },
- { "derbybouncycastles.com", true },
- { "derbyware.com", true },
- { "derco.com.co", true },
- { "derdewereldrommelmarkt.nl", true },
- { "dereferenced.net", true },
- { "derehamcastles.co.uk", true },
- { "derekbooth.co.uk", true },
- { "derekheld.com", true },
- { "derekkent.com", true },
- { "derekseaman.com", false },
- { "derekseaman.studio", false },
- { "derf.red", true },
- { "derf.us", true },
- { "dergeilstestammderwelt.de", true },
- { "derhil.de", true },
- { "derivedata.com", true },
- { "derkuki.de", true },
- { "dermaldistinction.com", true },
- { "dermapuur.nl", true },
- { "dermato.floripa.br", true },
- { "dermatologie-morges.ch", false },
- { "dermediq.nl", true },
- { "dermopigmentista.it", true },
- { "dermot.org.uk", true },
- { "dermscc.com", true },
- { "dermsf.com", true },
- { "deroo.org", true },
- { "derp.army", true },
- { "derp.chat", true },
- { "derpy.pp.ua", true },
- { "derre.fr", true },
- { "derreichesack.com", true },
- { "derw.pw", true },
- { "des-hommes-et-des-clous.com", true },
- { "desafiomovilidadsustentable.com", true },
- { "desagaz.com", true },
- { "desanta.top", true },
- { "descargar-apk.org", true },
- { "desec.io", true },
- { "desentupidorademais.com.br", true },
- { "desentupidorapernambucana.com.br", true },
- { "desert-maroc.com", true },
- { "desertbloomplasticsurgery.com", true },
- { "desertmedaesthetics.com", true },
- { "desertsounds.org", true },
- { "desheng28.com", true },
- { "deshevle-net.com", true },
- { "deshobi.cloud", true },
- { "design-in-bad.eu", true },
- { "design-tooning.de", true },
- { "designartepublicidad.com", true },
- { "designed-cybersecurity.com", true },
- { "designedcybersecurity.com", true },
- { "designer-drug.com", true },
- { "designera.se", true },
- { "designerchad.com", true },
- { "designgraphic.fr", true },
- { "designhuddle.com", true },
- { "designrhome.com", true },
- { "designs.codes", true },
- { "designsbyjanith.com", true },
- { "designskin.ch", false },
- { "designville.cz", true },
- { "designville.sk", true },
- { "desila.jp", true },
- { "desish.cf", true },
- { "deskaservices.com", true },
- { "deskdesign.nl", true },
- { "deskeen.fr", true },
- { "deskguide.info", true },
- { "desklite.gr", true },
- { "desktopd.eu.org", false },
- { "desktopfx.net", false },
- { "deskture.com", true },
- { "desmaakvanplanten.be", true },
- { "desormiers.com", true },
- { "despachomariscal.com", true },
- { "despertadoronline.com.es", true },
- { "despinavandi.gr", true },
- { "desplats.com.ar", true },
- { "despora.de", true },
- { "dessinemoilademocratie.ch", false },
- { "destakbrasilbrindes.com.br", true },
- { "destech.nl", true },
- { "destileria.net.br", true },
- { "destroymc.net", true },
- { "destyntek.com", true },
- { "desu.ne.jp", true },
- { "desuchan.eu", true },
- { "desuchan.org", true },
- { "desynced.rocks", true },
- { "det-te.ch", true },
- { "detalhecomercio.com.br", true },
- { "detalika.ru", true },
- { "detalyedesigngroup.com", true },
- { "detao.org", true },
- { "detecmon.com", true },
- { "detecte-fuite.ch", false },
- { "detecte.ch", false },
- { "detectefuite.ch", false },
- { "detectify.com", true },
- { "detectivedesk.com.au", true },
- { "deteken.be", true },
- { "detekenmuze.nl", true },
- { "determapp.de", true },
- { "dethemium.com", true },
- { "deti-online.com", true },
- { "detki.cf", true },
- { "detodojuegos.com", true },
- { "detoxetmoi.com", true },
- { "detreannamaria.tk", true },
- { "detroit-english.de", true },
- { "detroitzoo.org", true },
- { "detuinmuze.nl", true },
- { "detyobuv.tk", true },
- { "detype.nl", true },
- { "deu.sh", true },
- { "deuchnord.fr", true },
- { "deude.de", true },
- { "deukie.nl", true },
- { "deumavan.ch", true },
- { "deurenfabriek.nl", true },
- { "deutsch-vietnamesisch-dolmetscher.com", true },
- { "deutsche-seniorenbetreuung.de", true },
- { "deutsche-tageszeitungen.de", true },
- { "deutschebusiness.com", true },
- { "deutscher-bericht.de", true },
- { "deutscher-rollenspielpreis.de", true },
- { "deutscheshoponline.com", true },
- { "deutschland-dsl.de", true },
- { "dev-brandywineglobal.com", true },
- { "dev-greavesindia.pantheonsite.io", true },
- { "dev-gutools.co.uk", true },
- { "dev-pmcc.net", true },
- { "dev-tek.de", true },
- { "dev.moe", true },
- { "devagency.fr", true },
- { "devalps.eu", true },
- { "devcf.com", true },
- { "devcoins.org", true },
- { "devconf.nl", true },
- { "devcore.pl", true },
- { "devdeb.com", true },
- { "devel.cz", true },
- { "develop.cool", true },
- { "develope.cz", true },
- { "developer.android.com", true },
- { "developer.moe", true },
- { "developerdan.com", true },
- { "developermail.io", false },
- { "developers.facebook.com", false },
- { "developfx.com", false },
- { "developmentaid.org", true },
- { "developmentsites.melbourne", true },
- { "develops.co.il", true },
- { "develux.net", true },
- { "deviant.email", true },
- { "devicom.mx", true },
- { "devildog.tk", true },
- { "devillers-occasions.be", false },
- { "devils-co.tk", true },
- { "devils-point.de", true },
- { "devilshakerz.com", true },
- { "deviltraxxx.de", true },
- { "devinfo.net", false },
- { "devinite.com", true },
- { "devirc.net", true },
- { "devklog.net", true },
- { "devlamvzw.org", false },
- { "devlatron.net", true },
- { "devlinjurister.se", true },
- { "devlogr.com", true },
- { "devmode.fm", true },
- { "devnull.zone", true },
- { "devolution.ws", true },
- { "devops-survey.com", true },
- { "devops.pf", true },
- { "devopsish.com", true },
- { "devpp.com.br", true },
- { "devragu.com", true },
- { "devrandom.net", true },
- { "devries.one", true },
- { "devsjournal.com", true },
- { "devstaff.gr", true },
- { "devstores.io", false },
- { "devswag.io", true },
- { "devtea.cz", true },
- { "devtoys.ru", true },
- { "devtty.org", true },
- { "devun.limited", true },
- { "devzero.io", true },
- { "dewaard.de", true },
- { "dewalch.net", true },
- { "dewapress.com", true },
- { "dewinter.com", true },
- { "dewitteprins.nl", true },
- { "dewolden.nl", false },
- { "dex.top", true },
- { "dexalo.de", true },
- { "dexigner.com", true },
- { "dexonrest.azurewebsites.net", true },
- { "dexonservicedeskws.azurewebsites.net", true },
- { "deyute.com", true },
- { "dez-online.de", true },
- { "dezeregio.nl", true },
- { "dezet-ev.de", true },
- { "dezmembrariromania.ro", true },
- { "dezzoroofing.co.za", true },
- { "df1paw.de", true },
- { "df3312.com", true },
- { "df3313.com", true },
- { "df3314.com", true },
- { "df3315.com", true },
- { "df3316.com", true },
- { "df3317.com", true },
- { "df3318.com", true },
- { "df3319.com", true },
- { "df63.cc", true },
- { "dfafacts.gov", true },
- { "dfctaiwan.org", true },
- { "dfektlan.no", true },
- { "dfl.mn", false },
- { "dflcares.com", true },
- { "dfmn.berlin", true },
- { "dfranke.com", true },
- { "dg68.cc", true },
- { "dgangsta.net", true },
- { "dgbouncycastlehire.com", true },
- { "dgeex.eu", true },
- { "dgitup.com", true },
- { "dgportals.co.uk", true },
- { "dgpot.com", true },
- { "dgt-portal.de", true },
- { "dgtakano.co.jp", true },
- { "dgx.io", true },
- { "dhakawebhost.com", true },
- { "dharveydev.com", true },
- { "dhautefeuille.eu", true },
- { "dhauwer.nl", true },
- { "dhaynes.xyz", true },
- { "dhconcept.ch", false },
- { "dhde.de", true },
- { "dheart.net", true },
- { "dhedegaard.dk", true },
- { "dhelixnet.de", true },
- { "dhemant.de", true },
- { "dhhs.gov", true },
- { "dhinflatables.co.uk", true },
- { "dhirendrayadav.com", true },
- { "dhit.pl", true },
- { "dhlinux.org", true },
- { "dhome.at", true },
- { "dia-de.com", true },
- { "dia.com.br", true },
- { "diabetessucks.net", true },
- { "diabhal-staff.com", true },
- { "diabhal-staff.it", true },
- { "diablovalleytech.com", true },
- { "diadiemdangsong.com", true },
- { "diadorafitness.it", true },
- { "diagnoseo.com", true },
- { "diagnoseo.pl", true },
- { "diagnoseo.se", true },
- { "dialapicnic.co.za", true },
- { "dialoegue.com", true },
- { "diamante.ro", true },
- { "diamantovaburza.cz", true },
- { "diamgroup.pl", true },
- { "diamond-hairstyle.dk", true },
- { "diamondrose.co.za", true },
- { "diamondsleepsolutions.com", true },
- { "diamondyze.nl", true },
- { "diamorphine.com", true },
- { "dianadrive.com", true },
- { "dianefriedli.ch", false },
- { "diario-egipto.com", true },
- { "diariocibao.com", true },
- { "diariodearaxa.com.br", true },
- { "diarionoticia.pe", true },
- { "diariorealidad.com", true },
- { "diaroma.it", true },
- { "diarynote.jp", true },
- { "diasdasemana.com", true },
- { "diasp.org", true },
- { "diatrofi-ygeia.gr", true },
- { "diba.org.cn", true },
- { "dibiphp.com", true },
- { "diccionariodedudas.com", true },
- { "diccionarqui.com", true },
- { "dice.tokyo", true },
- { "dicelab-rhul.org", true },
- { "dicelab.co.uk", true },
- { "dicesites.com", true },
- { "dicio.com.br", true },
- { "dicionario.org", true },
- { "dicionariodegirias.com.br", true },
- { "dicionariodelatim.com.br", true },
- { "dicionariodenomesproprios.com.br", true },
- { "dicionariodesimbolos.com.br", true },
- { "dicionarioetimologico.com.br", true },
- { "dicionariofinanceiro.com", true },
- { "dicionariopopular.com", true },
- { "dicionarios.cc", true },
- { "dick.red", true },
- { "dickord.cloud", true },
- { "dickpics.ru", true },
- { "dicksakowicz.com", true },
- { "dicoding.com", true },
- { "dictionaryofnumbers.com", true },
- { "dictionarypro.net", true },
- { "dictzone.com", true },
- { "didacte.com", true },
- { "didche.net", false },
- { "diddens.de", true },
- { "dideeducacion.com", true },
- { "didefamilia.com", true },
- { "didesalud.com", true },
- { "didierghez.com", true },
- { "didierlaumen.be", true },
- { "didtrumpopengovernmentyet.com", true },
- { "die-bergfuehrer.de", true },
- { "die-borts.ch", true },
- { "die-gruenen-teufel.de", true },
- { "die-machons.de", true },
- { "die-partei-reutlingen.de", true },
- { "die-pizzabaeckerei.de", true },
- { "die-pleners.de", true },
- { "die-seide.de", true },
- { "die-seiler.de", true },
- { "die-sinlosen.de", true },
- { "die-speisekammer-reutlingen.de", true },
- { "diebestengutscheine.de", true },
- { "diebestenvpn.de", true },
- { "diebetriebsraete.de", true },
- { "diedrich.co", true },
- { "dieecpd.org", true },
- { "diegelernten.de", true },
- { "diegerbers.de", true },
- { "diegocoy.com", true },
- { "diegogelin.com", false },
- { "diegogonzalez.com.co", true },
- { "diegorbaquero.com", true },
- { "diehl.io", true },
- { "diekperaiwseis.gr", true },
- { "diem-project.org", true },
- { "diemattels.at", true },
- { "dienchaninstitute.com", true },
- { "diendorfer.space", true },
- { "dienstplan.cc", true },
- { "dienstplan.one", true },
- { "diepanhcare.com", true },
- { "dierabenmutti.de", true },
- { "dieradvies.nl", true },
- { "dierenartsdeconinck.be", true },
- { "dieselanimals.lt", true },
- { "dieselgalleri.com", true },
- { "diesteppenreiter.de", true },
- { "dietaanticelulitica.com", true },
- { "dietaanticelulitis.com", true },
- { "dietafeliz.com", true },
- { "dietbrand.eu", true },
- { "dieterglas.de", true },
- { "dietergreven.de", false },
- { "dieterstinglhamber.me", false },
- { "diethood.com", true },
- { "dieti-natura.com", true },
- { "dieti.net", true },
- { "dietlin.com", true },
- { "dietrich.cx", true },
- { "dieumfrage.com", true },
- { "diferenca.com", true },
- { "different.cz", true },
- { "differenta.ro", true },
- { "differentgirleveryday.ml", true },
- { "diffnow.com", true },
- { "difoosion.com", true },
- { "digcit.org", true },
- { "digdata.de", true },
- { "dighans.com", true },
- { "digiarc.net", true },
- { "digibull.email", true },
- { "digibull.link", true },
- { "digicasso.nl", true },
- { "digicode.hu", true },
- { "digicy.cloud", true },
- { "digideli.ee", true },
- { "digiepoxypaint.com", true },
- { "digilicious.com", true },
- { "digimaat.agency", true },
- { "digimagical.com", true },
- { "digimedia.cd", false },
- { "digioccumss.ddns.net", true },
- { "digipost.no", true },
- { "digirechnung.de", true },
- { "digired.ro", true },
- { "digit.ec", true },
- { "digital-compounds.com", true },
- { "digital-eastside.de", true },
- { "digital-insurance-engine.com", true },
- { "digital-insurance-engine.de", true },
- { "digital-insurance-platform.com", true },
- { "digital-insurance-platform.de", true },
- { "digital-liberal.ch", true },
- { "digital-sculpture.org", true },
- { "digital-sign.com.cn", true },
- { "digital.gov", false },
- { "digital.govt.nz", true },
- { "digital1st.co.uk", true },
- { "digitalagencynetwork.com", true },
- { "digitalallies.co.uk", true },
- { "digitalarchitecture.com", true },
- { "digitalarchives.tw", true },
- { "digitalbitbox.com", true },
- { "digitalblood.eu", true },
- { "digitalch.ng", true },
- { "digitalchurch.ng", true },
- { "digitalcitizen.life", true },
- { "digitalcitizen.ro", true },
- { "digitalcoffeepodcast.com", true },
- { "digitalcraftmarketing.co.uk", true },
- { "digitalcronies.com", true },
- { "digitaldaily.de", true },
- { "digitaldatacenter.net", true },
- { "digitaldeli.com", true },
- { "digitaldeli.org", true },
- { "digitaldeli.tv", true },
- { "digitaldeli.us", true },
- { "digitaldeliarchive.com", true },
- { "digitaldem.it", true },
- { "digitalehandtekeningen.nl", true },
- { "digitaleoverheid.nl", false },
- { "digitaleplus.fr", true },
- { "digitaletanker.com", true },
- { "digitalfoster.org", true },
- { "digitalframe.nl", true },
- { "digitalfury.co.uk", true },
- { "digitalfuturenow.com", true },
- { "digitalgov.gov", true },
- { "digitalhabit.at", true },
- { "digitalhabitat.io", true },
- { "digitalid-sandbox.com", true },
- { "digitalid.com", true },
- { "digitalid.com.au", true },
- { "digitalliteracy.gov", true },
- { "digitalmarketingindallas.com", true },
- { "digitalpiloten.org", true },
- { "digitalposition.com", true },
- { "digitalprimate.my", true },
- { "digitalredshirts.com", true },
- { "digitalrights.center", true },
- { "digitalrights.fund", true },
- { "digitalskillswap.com", true },
- { "digitalspiders.pk", true },
- { "digitalsurge.io", true },
- { "digitaltcertifikat.dk", true },
- { "digitaltrust.ae", true },
- { "digitalunite.de", true },
- { "digitec.ch", true },
- { "digitecgalaxus.ch", true },
- { "digitiqo.com", true },
- { "digitkon.com", true },
- { "digitreads.com", true },
- { "digixcellence.com", true },
- { "digminecraft.com", true },
- { "digpath.co.uk", true },
- { "digwp.com", true },
- { "dihesan.com", true },
- { "dijitaller.com", true },
- { "dijkmanmuziek.nl", false },
- { "dijkmanvandoorn.nl", false },
- { "dilberkebab.co.uk", true },
- { "dildoexperten.se", true },
- { "dildosconsoladores.cl", true },
- { "diletec.com.br", true },
- { "dilibel.be", true },
- { "diligo.ch", false },
- { "dillewijnzwapak.nl", true },
- { "dillonkorman.com", true },
- { "diluv.com", false },
- { "dimagrimentoincorso.it", true },
- { "dimanet.fr", true },
- { "dimanss47.net", true },
- { "dime-staging.com", true },
- { "dime.io", true },
- { "dimeponline.com.br", true },
- { "dimez.ru", true },
- { "dimiskovska.de", true },
- { "dimitrihomes.com", true },
- { "dimitrovi.tk", true },
- { "dimmersagourahills.com", true },
- { "dimmerscalabasas.com", true },
- { "dimmersdosvientos.com", true },
- { "dimmershiddenhills.com", true },
- { "dimmerslakesherwood.com", true },
- { "dimmersnewburypark.com", true },
- { "dimmersoakpark.com", true },
- { "dimmersthousandoaks.com", true },
- { "dimmerswestlakevillage.com", true },
- { "dimo-analytics.fr", true },
- { "dimo-crm.fr", true },
- { "dimo-dematerialisation.com", true },
- { "dimo-tresorerie.fr", true },
- { "dimomaint-sav.fr", true },
- { "dimomaint.com", true },
- { "dimomaint.de", true },
- { "dimomaint.es", true },
- { "dimomaint.it", true },
- { "dimomaint.nl", true },
- { "dimomaint.pt", true },
- { "dimonb.com", true },
- { "dimosoftware.fr", true },
- { "din-hkd.jp", true },
- { "dinepont.fr", true },
- { "dinerroboticurology.com", true },
- { "dingsbums.shop", true },
- { "dinheirolucrar.com", true },
- { "dinkommunikasjon.no", true },
- { "dinmtb.dk", true },
- { "dino.lol", true },
- { "dinocarrozzeria.com", true },
- { "dinstec.cl", true },
- { "dintrafic.net", true },
- { "diodeled.com", true },
- { "diodo.me", true },
- { "dioesfoto.com", true },
- { "dionysos-ios.gr", true },
- { "dipalma.me", true },
- { "dipdaq.com", true },
- { "dipietro.id.au", true },
- { "dipling.de", true },
- { "diplomatiq.org", true },
- { "diplona.de", true },
- { "dipro.id", true },
- { "dipulse.it", true },
- { "dir2epub.com", true },
- { "dir2epub.org", true },
- { "dirba.io", true },
- { "direct-sel.com", true },
- { "direct.cz", true },
- { "direct365.es", true },
- { "directed.ir", true },
- { "directelectricalltd.co.uk", true },
- { "directfinance.cz", true },
- { "directhomeremodelinginc.com", true },
- { "directlendingsolutions.com", true },
- { "directlinkfunding.co.uk", true },
- { "directnews.be", true },
- { "directoriostelefonicos.com", true },
- { "directorioz.com", true },
- { "directorydashboard.ga", true },
- { "directorydisc.ga", true },
- { "directoryhub.io", true },
- { "directreal.sk", true },
- { "directspa.fr", true },
- { "directveilig.nl", true },
- { "direktvermarktung-schmitzberger.at", true },
- { "dirk-dogs.tk", true },
- { "dirk-scheele.de", true },
- { "dirk-weise.de", true },
- { "dirkdoering.de", true },
- { "dirkjonker.nl", true },
- { "dirko.net", true },
- { "dirkwolf.de", true },
- { "dirtinmyshoes.com", true },
- { "dirtygeek.ovh", true },
- { "dirtyincest.com", true },
- { "dirtyprettyartwear.com", true },
- { "dirtytiles.xyz", true },
- { "disability.gov", true },
- { "disabilitydischarge.com", true },
- { "disabled-world.com", true },
- { "disabled.dating", true },
- { "disabuse.cf", true },
- { "disadattamentolavorativo.it", true },
- { "disanteimpianti.com", false },
- { "disc.uz", true },
- { "discarica.bari.it", true },
- { "discarica.bologna.it", true },
- { "discarica.firenze.it", true },
- { "discarica.it", true },
- { "discarica.milano.it", true },
- { "discarica.napoli.it", true },
- { "discarica.roma.it", true },
- { "disch.com.de", true },
- { "dischempharmacie.com", true },
- { "disciples.io", true },
- { "discodery.com", true },
- { "discofitta.com", true },
- { "disconformity.net", true },
- { "disconnect.tk", true },
- { "discord.gg", true },
- { "discord.gift", true },
- { "discord4j.com", true },
- { "discordapp.com", true },
- { "discordbee.com", true },
- { "discordia.me", true },
- { "discordservers.com", true },
- { "discount24.de", true },
- { "discountlumberspokane.com", true },
- { "discounto.de", true },
- { "discountpokale.at", false },
- { "discountpokale.de", true },
- { "discover-shaken.com", true },
- { "discoverthreejs.com", true },
- { "discoverucluelet.com", true },
- { "discoveryaima.com", true },
- { "discoveryballoon.org", true },
- { "discrypt.ca", true },
- { "discus-communications.dk", true },
- { "dise-online.de", true },
- { "disinclined.org", true },
- { "disinfesta.it", true },
- { "disinfestando.info", true },
- { "disinfestatore.roma.it", true },
- { "disinfestatori.com", true },
- { "disinfestazione.brescia.it", true },
- { "disinfestazione.torino.it", true },
- { "disinfestazione.venezia.it", true },
- { "disinfestazione.verona.it", true },
- { "disinfestazione24.it", true },
- { "disinfestazioneblatte.it", true },
- { "disinfestazionecimici.roma.it", true },
- { "disinfestazioni-umbria.it", true },
- { "disinfestazioni.bari.it", true },
- { "disinfestazioni.bergamo.it", true },
- { "disinfestazioni.catania.it", true },
- { "disinfestazioni.co", true },
- { "disinfestazioni.firenze.it", true },
- { "disinfestazioni.genova.it", true },
- { "disinfestazioni.gorizia.it", true },
- { "disinfestazioni.info", true },
- { "disinfestazioni.milano.it", true },
- { "disinfestazioni.napoli.it", true },
- { "disinfestazioni.net", true },
- { "disinfestazioni.padova.it", true },
- { "disinfestazioni.rimini.it", true },
- { "disinfestazioni.torino.it", true },
- { "disinfestazioni.treviso.it", true },
- { "disinfestazioni.udine.it", true },
- { "disinfestazioni.venezia.it", true },
- { "disinfestazioni.verona.it", true },
- { "disinfestazioni24.it", true },
- { "disinfestazionivespe.milano.it", true },
- { "disinfestazionizanzare.milano.it", true },
- { "disinfestazionizanzare.roma.it", true },
- { "disinisharing.com", true },
- { "disk.do", true },
- { "diskbit.com", true },
- { "diskbit.nl", true },
- { "disking.co.uk", true },
- { "dismail.de", true },
- { "displayenergycertificate.co.uk", true },
- { "displaysfas.com", true },
- { "disposable.link", true },
- { "disproweb.com", true },
- { "disroot.org", true },
- { "disrupters.ch", false },
- { "disruptiveadvertising.com", true },
- { "dissertationhelp.com", true },
- { "dissieux.com", true },
- { "dist-it.com", true },
- { "dist.torproject.org", false },
- { "distancelove.ml", true },
- { "disti.com", true },
- { "distiduffer.org", true },
- { "distillery.com", true },
- { "distinguishedprisoner.com", true },
- { "distortmotion.com", true },
- { "distracteddriving.gov", true },
- { "distratus.com", true },
- { "distribuidoracristal.com.br", true },
- { "distribuidoraplus.com", true },
- { "distribuidorveterinario.es", true },
- { "distributore.it", true },
- { "distributori.roma.it", true },
- { "district.sg", true },
- { "districtcapital.com", true },
- { "distrivalle.ec", true },
- { "distro.fr", true },
- { "ditec.sk", true },
- { "diti.me", true },
- { "dities.tk", true },
- { "diva.nl", true },
- { "divari.nl", true },
- { "divcoder.com", true },
- { "dive-japan.com", true },
- { "divedowntown.com", true },
- { "divegearexpress.com", true },
- { "diveidc.com", true },
- { "diveplan.org", true },
- { "diver-equipment.eu", true },
- { "diversifiedproduct.com", true },
- { "diversityflags.com", true },
- { "diversityflags.com.au", true },
- { "diversityflags.nz", true },
- { "divewithfrank.com", true },
- { "divi-experte.de", true },
- { "dividendz.net", true },
- { "divinasaiamodas.com.br", true },
- { "divinegames.studio", true },
- { "divineglowinghealth.com", false },
- { "divinemercyparishvld.com", true },
- { "diving.photo", true },
- { "divingforlife.org", true },
- { "divisasexpress.com", true },
- { "divisuite.com", true },
- { "divjak.at", true },
- { "divorciosmurcia.com", true },
- { "divup.com", true },
- { "diwei.vip", true },
- { "dixibox.com", true },
- { "diyanet.nl", true },
- { "diybook.at", true },
- { "diycc.org", true },
- { "diygeek.com", true },
- { "diyibo.com", true },
- { "diymediahome.org", true },
- { "diyosun.com", true },
- { "diytechguides.com", true },
- { "diyvideoeditor.com", true },
- { "dizayner.tk", true },
- { "dizzythewizard.co.uk", true },
- { "dj-leszwolle.nl", true },
- { "dj-x.info", true },
- { "dj3dub.com", true },
- { "djangobirthday.com", true },
- { "djangoproject.com", true },
- { "djangosnippets.org", true },
- { "djanpana.com", true },
- { "djbbouncycastles.co.uk", true },
- { "djbobbytables.com", true },
- { "djboekingskantoor.nl", true },
- { "djc.me", true },
- { "djcursuszwolle.nl", true },
- { "djdavid98.hu", true },
- { "djdeepstate.com", true },
- { "djfrenchy.com", true },
- { "dji-ars.pl", true },
- { "djipanov.com", true },
- { "djitsolutions.com", true },
- { "djl188.cc", true },
- { "djl63.com", true },
- { "djl63001.com", true },
- { "djleon.net", true },
- { "djlinux.cz", true },
- { "djlnetworks.co.uk", true },
- { "djlove.tk", true },
- { "djmox.in", true },
- { "djsanonimo.com", true },
- { "djsbouncycastlehire.com", true },
- { "djslash.tk", true },
- { "djvintagevinyl.com", true },
- { "djvintagevinyl.nl", true },
- { "djwaynepryke.com", true },
- { "dk-kromeriz.cz", true },
- { "dk.com", true },
- { "dk.search.yahoo.com", false },
- { "dk1818.cc", true },
- { "dkcomputers.com.au", true },
- { "dkds.us", true },
- { "dkstage.com", true },
- { "dkwedding.gr", true },
- { "dl.google.com", true },
- { "dlaspania.pl", true },
- { "dlde.ru", true },
- { "dldl.fr", true },
- { "dleger.space", true },
- { "dlfsymposium.nl", true },
- { "dlitz.net", true },
- { "dll4free.com", true },
- { "dlld.com", true },
- { "dlld.org", true },
- { "dlld.us", true },
- { "dlscomputers.com.au", true },
- { "dlui.xyz", true },
- { "dlunch.net", true },
- { "dlyatepla.ml", true },
- { "dlz149.me", true },
- { "dlzz.net", true },
- { "dm.lookout.com", false },
- { "dm.mylookout.com", false },
- { "dm7ds.de", true },
- { "dmaglobal.com", true },
- { "dmailshop.ro", true },
- { "dmarc.dk", true },
- { "dmarc.tech", true },
- { "dmarcian.com", true },
- { "dmatrix.xyz", true },
- { "dmcw.de", true },
- { "dmd.lv", true },
- { "dmdd.org.uk", true },
- { "dmerkel.de", true },
- { "dmfj.io", true },
- { "dmhtwebordering.com", true },
- { "dmi.es", true },
- { "dmitry.sh", true },
- { "dmmkenya.co.ke", false },
- { "dmmultionderhoud.nl", true },
- { "dmn.sh", true },
- { "dmoj.ca", true },
- { "dmparish.com", true },
- { "dn3s.me", true },
- { "dn42.us", true },
- { "dna.li", true },
- { "dnacloud.pl", true },
- { "dnakids.co.uk", true },
- { "dnalounge.com", true },
- { "dnapizza.com", true },
- { "dnc.org.nz", true },
- { "dndtools.net", true },
- { "dnlr.tech", true },
- { "dnmlab.it", true },
- { "dnoid.to", true },
- { "dnplegal.com", true },
- { "dns-control.eu", true },
- { "dns-swiss.ch", true },
- { "dns.google.com", true },
- { "dns8.online", true },
- { "dnsaio.com", true },
- { "dnscrawler.com", true },
- { "dnscrypt-blacklist.tk", true },
- { "dnscrypt.info", true },
- { "dnscrypt.nl", true },
- { "dnscurve.io", true },
- { "dnshallinta.fi", true },
- { "dnsipv6.srv.br", true },
- { "dnskeep.com", true },
- { "dnskeeper.com", true },
- { "dnsman.se", true },
- { "dnsmate.net", true },
- { "dnsrate.com", true },
- { "dnssecandipv6.se", true },
- { "dnstwister.report", true },
- { "do-pro.net", true },
- { "do-prod.com", false },
- { "do.gd", true },
- { "do.search.yahoo.com", false },
- { "do13.net", true },
- { "do67.de", true },
- { "do67.net", true },
- { "doanhnhankhanhhoa.vn", true },
- { "dobbshvac.com", true },
- { "dobraprace.cz", false },
- { "dobre-programy.xyz", true },
- { "dobreprogramy.pro", true },
- { "dobrisan.ro", true },
- { "dobryautoskup.pl", true },
- { "doc-baza.ru", true },
- { "doc.ai", true },
- { "doc.python.org", true },
- { "doc.to", false },
- { "doc8643.com", true },
- { "docabo.ch", true },
- { "docassure.de", true },
- { "docbox.ch", true },
- { "docdoc.ru", true },
- { "docemeldoces.com", true },
- { "doceo.com", true },
- { "dockerbook.com", false },
- { "dockerup.net", true },
- { "dockflow.com", true },
- { "dockstarter.com", true },
- { "dockysearch.com", true },
- { "docline.gov", true },
- { "docloh.de", true },
- { "docloudu.info", true },
- { "docmed360.com", true },
- { "docplexus.com", true },
- { "docs.google.com", false },
- { "docs.python.org", true },
- { "docs.tw", true },
- { "docskiff.com", true },
- { "doctabaila.com", true },
- { "doctafit.com", true },
- { "docteurcardin.com", true },
- { "doctor-locks.co.uk", true },
- { "doctor.dating", true },
- { "doctor360.com.au", true },
- { "doctorcalefon.com", true },
- { "doctorfox.co.uk", true },
- { "doctornaima.ml", true },
- { "doctorperu.com", true },
- { "doctorwho.cz", true },
- { "doctorxdentist.com", true },
- { "docubox.info", true },
- { "docucopies.com", true },
- { "docudanang.com.vn", false },
- { "documaniatv.com", true },
- { "docupaymentuat.xyz", true },
- { "docusearch.com", true },
- { "dodikod.tk", true },
- { "dodopri.com", true },
- { "doenjoylife.com", true },
- { "doeren.com", true },
- { "doerz.com", true },
- { "does.one", true },
- { "doesburg-comp.nl", true },
- { "doesinfotech.com", true },
- { "dofux.org", true },
- { "dogadayiz.net", true },
- { "dogan.ch", false },
- { "dogandoganay.com", true },
- { "dogcontrol.ca", true },
- { "dogear.ch", true },
- { "dogforum.de", true },
- { "dogfriendly.co.uk", true },
- { "doggedbyirs.com", true },
- { "doggo.cloud", true },
- { "doggo.dance", true },
- { "doggo.email", true },
- { "doggroomingcourse.com", true },
- { "dogmap.jp", true },
- { "dogodki.today", true },
- { "dogoo.com", true },
- { "dogpawstudio.com", true },
- { "dogrescuegreece.nl", true },
- { "dogvolution.com", true },
- { "dogworld.com.br", true },
- { "dohanews.co", true },
- { "doihavetoputonpants.com", true },
- { "doinaruscior.eu", true },
- { "doitauto.de", true },
- { "doitexperience.com", true },
- { "dojozendebourges.fr", true },
- { "dokelio-idf.fr", true },
- { "dokhuyenmaigiatot.com", true },
- { "doki.space", false },
- { "dokipy.no", true },
- { "dokkanashop.com", true },
- { "dokuboard.com", true },
- { "dolcesalatoweb.it", true },
- { "dolci-delizie.de", true },
- { "dolciterapie.com", true },
- { "doli.se", true },
- { "dolice.net", true },
- { "dolinathome.com", true },
- { "doll.ml", true },
- { "dollarrp.pl", true },
- { "dollchan.org", true },
- { "dollemore.com", true },
- { "dollhousetoyo.com", true },
- { "dolorism.com", true },
- { "dolph.de", true },
- { "doma.in", true },
- { "domadillo.com", true },
- { "domain-ermittlung.de", true },
- { "domain-skachat.cf", true },
- { "domain-speicher.com", true },
- { "domain-speicher.de", true },
- { "domain001.info", true },
- { "domainedemiolan.ch", false },
- { "domainevanina.fr", true },
- { "domainexpress.de", false },
- { "domainforfree.gq", true },
- { "domainkauf.de", true },
- { "domainname.forsale", true },
- { "domainoo.com", true },
- { "domains.google.com", true },
- { "domainsilk.com", true },
- { "domainspeicher.com", true },
- { "domainspeicher.one", true },
- { "domainstaff.com", true },
- { "domainvoider.cf", true },
- { "domakidis.com", true },
- { "domarkperu.com", true },
- { "domaxpoker.com", true },
- { "domein-direct.com", true },
- { "domein-direct.nl", true },
- { "domeindns.nl", true },
- { "domenaru.ga", true },
- { "domenic.me", true },
- { "domenicam.com", true },
- { "domesticcleaners.co.uk", true },
- { "domfee.com", true },
- { "domhaase.me", true },
- { "domhos.tk", true },
- { "domian.cz", true },
- { "domicile-clean.fr", true },
- { "dominationgame.co.uk", true },
- { "dominctheroofguy.com", true },
- { "dominicandfelixroco.tk", true },
- { "dominicanosenpr.com", true },
- { "dominicself.co.uk", true },
- { "dominictaylor.co.uk", true },
- { "dominik-bergmann.de", true },
- { "dominik.st", true },
- { "dominikaner-vechta.de", true },
- { "dominionregistries.domains", true },
- { "dominique-haas.fr", false },
- { "dominoknihy.cz", true },
- { "dominomatrix.com", true },
- { "domjh.com", true },
- { "dommascate.com.br", true },
- { "domob.eu", true },
- { "domodeco.fr", true },
- { "domodedovo.travel", true },
- { "domop.cc", true },
- { "domop.net", true },
- { "domop.org", true },
- { "domowe-potrawy.pl", true },
- { "domprojects.com", true },
- { "domscripting.com", true },
- { "domster.com", true },
- { "domus-global.com", true },
- { "domus-global.cz", true },
- { "domwkwiatach.pl", true },
- { "domyassignments.com", true },
- { "domycasestudy.com", true },
- { "domycoursework.com", true },
- { "domycreativewritings.com", true },
- { "domydissertations.com", true },
- { "domyessay.net", true },
- { "domyessays.com", true },
- { "domyhomework123.com", true },
- { "domyhomeworks.net", true },
- { "domyiadaptacje.pl", true },
- { "domynetwork.com", true },
- { "domypapers.com", true },
- { "domyresearchpaper.com", true },
- { "domyreview.net", true },
- { "domyspeech.com", true },
- { "domytermpaper.com", true },
- { "domythesis.net", true },
- { "domyzitrka.cz", true },
- { "domznak.ru", true },
- { "donabeneko.jp", true },
- { "donaldjenkins.com", true },
- { "donaldm.co.uk", true },
- { "donaldtrump.ga", true },
- { "donateabox.org", true },
- { "donateaday.net", true },
- { "donation.ph", true },
- { "donboscogroep.nl", true },
- { "donfelino.tk", false },
- { "dongcdn.com", true },
- { "dongxuwang.com", true },
- { "donjusto.nl", true },
- { "donkennedyandsons.com", true },
- { "donkeytrekkingkefalonia.com", true },
- { "donnaandscottmcelweerealestate.com", true },
- { "donnabrothers.com", true },
- { "donnacha.blog", true },
- { "donnachie.net", true },
- { "donnajeanbooks.com", true },
- { "donner-reuschel.de", true },
- { "donnons.org", false },
- { "donnoval.ru", false },
- { "donotcall.gov", true },
- { "donotlink.it", true },
- { "donovankraag.nl", true },
- { "donpanda.cz", true },
- { "donpomodoro.com.co", true },
- { "donsremovals.com.au", true },
- { "dont.re", true },
- { "dont.watch", true },
- { "dontbeevil.com", true },
- { "dontbubble.me", true },
- { "dontcageus.org", true },
- { "donthedragonwilson.com", true },
- { "dontpayfull.com", true },
- { "dontstopcoffee.com", true },
- { "donttrust.me", true },
- { "donutcompany.co.jp", true },
- { "dooby.fr", true },
- { "dooleylabs.com", true },
- { "dooleytackaberry.com", true },
- { "doolz.co.nz", true },
- { "doomoo.com", true },
- { "doomsworld.com", true },
- { "doomtech.net", true },
- { "doomus.me", true },
- { "doooooops.com", true },
- { "doop.im", true },
- { "doordecor.bg", true },
- { "doorflow.com", true },
- { "doorhandlese.com", true },
- { "doorshingekit.com", true },
- { "doorswest.net", true },
- { "doortim.nl", true },
- { "dopesoft.de", true },
- { "dophys.top", true },
- { "doppeleinhorn.de", true },
- { "doppler.com", true },
- { "dopsi.ch", true },
- { "dor-tak.com", true },
- { "dor-tak.ru", true },
- { "dora.moe", true },
- { "doradocomputer.com", true },
- { "doradoscampeon.tk", true },
- { "doramamusic.gq", true },
- { "dorco.be", true },
- { "dorde.eu", true },
- { "dorfbaeck.at", true },
- { "dorfbrunnen.eu", false },
- { "dorfpark-falkenburg.de", true },
- { "dorfzittig.de", true },
- { "doriangirod.ch", false },
- { "dorianharmans.nl", true },
- { "doridian.com", true },
- { "doridian.de", true },
- { "doridian.net", true },
- { "doridian.org", true },
- { "dormirmucho.com", true },
- { "dormitengernyikaland.hu", true },
- { "dormiu.com", true },
- { "dormiu.com.br", true },
- { "dornhecker.me", true },
- { "dorogaminina.tk", true },
- { "dorpshuis-dwarsgracht.nl", true },
- { "dorpshuiskesteren.nl", true },
- { "dorsetentertainments.co.uk", true },
- { "dorth.nl", true },
- { "dosenkiwi.at", true },
- { "dosje.org", true },
- { "doska.by", true },
- { "doska.ru", true },
- { "dosomeworks.biz", true },
- { "dossplumbing.co.za", false },
- { "dostalsecurity.com", true },
- { "dostav.tk", true },
- { "dostlar.fr", true },
- { "dosvientoselectric.com", true },
- { "dosvientoselectrical.com", true },
- { "dosvientoselectrician.com", true },
- { "dosvientosexteriorlighting.com", true },
- { "dosvientoslandscapelighting.com", true },
- { "dosvientoslighting.com", true },
- { "dosvientosoutdoorlighting.com", true },
- { "doswap.com", true },
- { "dosyauzantisi.com", true },
- { "dot42.no", true },
- { "dotacni-parazit.cz", true },
- { "dotbigbang.com", true },
- { "dotbox.org", true },
- { "dotcircle.co", true },
- { "dotesports.com", true },
- { "dotgov.gov", true },
- { "dothebangthingsalon.com", true },
- { "dothydesign.com", true },
- { "dotjesper.com", true },
- { "dotjesper.dk", true },
- { "dotjesper.net", true },
- { "dotjs.party", true },
- { "dotkniseandroida.cz", true },
- { "dotkod.pl", true },
- { "dotneko.net", true },
- { "dotnetdocs.ir", true },
- { "dotphoto.com", true },
- { "dotplex.com", true },
- { "dotplex.de", true },
- { "dotrox.net", true },
- { "dotshule.ug", true },
- { "dotsiam.co.th", true },
- { "dotsiam.com", true },
- { "dotsiam.in.th", true },
- { "dottore.roma.it", true },
- { "douai.me", true },
- { "doubleaste.com", true },
- { "doubleavineyards.com", true },
- { "doubleglazingmasters.com.au", true },
- { "doubleup.com.au", true },
- { "doucheba.gs", false },
- { "doughseeker.com", true },
- { "douglascountybar.com", true },
- { "douglascountyfilmtrail.com", true },
- { "dougley.com", true },
- { "dougsautobody.com", true },
- { "doujinshi.info", true },
- { "doujinspot.com", true },
- { "douzer.de", true },
- { "douzer.industries", true },
- { "dovenzorgmalawi.nl", true },
- { "dovermotion.com", true },
- { "dowell.media", true },
- { "dowellconsulting.com", true },
- { "dowhatmakegood.de", true },
- { "dowling.nz", true },
- { "download-knigi.gq", true },
- { "download.dk", true },
- { "downloadaja.com", true },
- { "downloadfiles.cf", true },
- { "downloadgamemods.com", true },
- { "downloadgram.com", true },
- { "downloadhindimovie.com", true },
- { "downloads.zdnet.com", true },
- { "downloadsoftwaregratisan.com", true },
- { "downrightcute.com", true },
- { "downtimerobot.nl", true },
- { "downtownautospecialists.com", true },
- { "downtownstevenspoint.org", true },
- { "downtownsuiteliving.com", true },
- { "downtownvernon.com", true },
- { "downunderporn.com", true },
- { "dox-box.eu", true },
- { "doxal.ro", true },
- { "doxepin1.gq", true },
- { "doxycyclineprices.cf", true },
- { "doyleshamrock.com", true },
- { "doyoucheck.com", false },
- { "doyouedc.com", true },
- { "doyoutax.com", false },
- { "doypacky.cz", false },
- { "doze-cloud.tech", true },
- { "dozecloud.com", true },
- { "dp.cx", true },
- { "dpd.com.pl", true },
- { "dpecuador.com", true },
- { "dpellegrini.com", true },
- { "dperson.net", true },
- { "dpfsolutionsfl.com", true },
- { "dpg.no", true },
- { "dphipartner.com", true },
- { "dpi-design.de", true },
- { "dpim.org.my", true },
- { "dpisecuretests.com", true },
- { "dpm-ident.de", false },
- { "dponetwork.nl", true },
- { "dposit.com", true },
- { "dposit.email", true },
- { "dposit.eu", true },
- { "dposit.net", true },
- { "dposit.org", true },
- { "dprb.biz", true },
- { "dps.srl", true },
- { "dpsg-hohenlinden.de", true },
- { "dpsg-roden.de", false },
- { "dpwsweeps.co.uk", true },
- { "dr-becarelli-philippe.chirurgiens-dentistes.fr", true },
- { "dr-bodendorf.de", true },
- { "dr-klotz.info", true },
- { "dr-knirr.de", true },
- { "dr-marlen-nystroem.de", true },
- { "dr-moldovan.de", true },
- { "dr-nystroem.de", true },
- { "dr-peter-jahn.de", true },
- { "dr-schlamminger.de", true },
- { "dr-schmutzer.de", true },
- { "dr-schuessler.de", true },
- { "dr-stoetter.de", true },
- { "dr-www.de", true },
- { "dr.mg", true },
- { "dr2dr.ca", true },
- { "draadloos-besturen.nl", true },
- { "draadloze-noodstop.nl", true },
- { "drabadir.com", true },
- { "drabim.org", true },
- { "drach.xyz", true },
- { "drachenleder.de", true },
- { "dracisvet.cz", true },
- { "dracoon.com", true },
- { "dracoon.de", true },
- { "dracoon.team", true },
- { "dracox.com", true },
- { "draemar.com", true },
- { "draftguru.com.au", true },
- { "dragcave.net", true },
- { "dragfiles.com", true },
- { "draghetti.it", true },
- { "draghive.com", true },
- { "dragon-chem.eu", true },
- { "dragon-hearts.co.uk", true },
- { "dragon.nu", true },
- { "dragoncave.me", true },
- { "dragonclean.gr", true },
- { "dragonheartsrpg.com", true },
- { "dragonkin.net", true },
- { "dragonprogrammer.com", true },
- { "dragonschool.org", true },
- { "dragonsunited.at", true },
- { "dragonsunited.ch", true },
- { "dragonsunited.de", true },
- { "dragonsunited.eu", true },
- { "dragonsunited.info", true },
- { "dragonsunited.net", true },
- { "dragonsunited.org", true },
- { "dragontours.net", true },
- { "dragonwolfpackaquaria.com", true },
- { "dragowebdesign.com", true },
- { "draintechnorthwest.net", true },
- { "drake.partners", true },
- { "drakecommercial.com", true },
- { "drakeluce.com", true },
- { "drakenson.de", true },
- { "drakfot.se", true },
- { "drakoacademy.org", true },
- { "draliabadi.com", true },
- { "dramaticpeople.com", true },
- { "dramyalderman.com", true },
- { "dranderle.com", true },
- { "drandrewarnold.com", true },
- { "dranik.ga", true },
- { "dranous.com", true },
- { "drapeauxdespays.fr", true },
- { "dras.hu", true },
- { "dratini0.hu", true },
- { "draugr.de", true },
- { "draw.uy", true },
- { "drawesome.uy", true },
- { "drawingcode.net", true },
- { "drawtwo.gg", true },
- { "drawvesly.ovh", true },
- { "drawxp.com", true },
- { "draycotthotel.com", true },
- { "drbresnick.com", true },
- { "drbriones.com", true },
- { "drcarolynquist.com", true },
- { "drchrislivingston.com", true },
- { "drchristophepanthier.com", true },
- { "drcourtney.com", true },
- { "drdegenhart.de", true },
- { "drdenisvincenzi.com.br", true },
- { "drdipilla.com", true },
- { "drdripplumbingsydney.com.au", true },
- { "dream-pools.cf", true },
- { "dreamboxpro.com", true },
- { "dreamcrack.tk", true },
- { "dreamcraft.su", true },
- { "dreamcreator108.com", true },
- { "dreamday-with-dreamcar.de", true },
- { "dreamdestine.com", true },
- { "dreamdivers.com", true },
- { "dreamhostremixer.com", true },
- { "dreamhouses.com", true },
- { "dreamlandmagic.com", true },
- { "dreamlordpress.it", true },
- { "dreamlux.cz", true },
- { "dreamlux.sk", true },
- { "dreammaker-nw.com", true },
- { "dreammakerutah.com", true },
- { "dreamof.net", false },
- { "dreamrae.net", true },
- { "dreamsforabetterworld.com.au", true },
- { "dreamstream.nl", true },
- { "dreamstream.tv", true },
- { "dreamstream.video", true },
- { "dreamstudio.com", true },
- { "dreamsxxl.com", true },
- { "dreamwork.financial", true },
- { "dreamz-staging.zone", true },
- { "dreamz.com", true },
- { "dreatho.com", true },
- { "dreemurr.com", true },
- { "drei01.com", true },
- { "drei01.de", true },
- { "drei01.technology", true },
- { "dreid.org", true },
- { "drendermobilyaservisi.com", true },
- { "dresden-kaffee-24.de", true },
- { "dresden-kaffeeroesterei.de", true },
- { "dresdener-mandelstollen.de", true },
- { "dresdens-pfefferkuchenprinzessin.de", true },
- { "dresdner-kaffeeroesterei.de", true },
- { "dresdner-mandelstollen.de", true },
- { "dresdner-stollen-von-reimann.de", false },
- { "dresdner-stollen.shop", true },
- { "dress-cons.com", true },
- { "dressify.in", true },
- { "dressingmaternity.fr", true },
- { "drevanbeale.com", true },
- { "drevo-door.cz", false },
- { "drew.beer", true },
- { "drew.life", true },
- { "drewapianostudio.com", true },
- { "drewlearns.com", true },
- { "drewsilcock.co.uk", true },
- { "drewzar.com", true },
- { "dreyfussplasticsurgery.com", true },
- { "drezzy.it", true },
- { "drgeadsdavinci.com", true },
- { "drgerthplasticsurgery.com", true },
- { "drghomi.com", true },
- { "drglassgyn.com", true },
- { "drgn.li", true },
- { "drgn.no", true },
- { "drgrace.ca", true },
- { "drhathazi.hu", true },
- { "drheibel.com", true },
- { "drherndonent.com", true },
- { "drhildebrand.net", true },
- { "drhoseyni.com", true },
- { "drhyler.com", true },
- { "drianpublishing.tk", true },
- { "driesjtuver.nl", true },
- { "driftdude.nl", true },
- { "driftingruby.com", true },
- { "drighes.com", true },
- { "drillingsupply.info", true },
- { "drillingsupplystore.com", true },
- { "drillion.net", true },
- { "drillshackresort.com", true },
- { "drilon.be", true },
- { "drinkcontrolapp.com", true },
- { "drinkgas-jihlava.cz", true },
- { "drinkgo.vn", true },
- { "driv.io", true },
- { "drive.google.com", false },
- { "driveexport.com", true },
- { "driven2shine.eu", true },
- { "drivenes.net", true },
- { "driver.ru", true },
- { "drivercopilot.com", true },
- { "driverless.id", true },
- { "driverprofiler.co.uk", true },
- { "driverscollection.com", true },
- { "drivetonortheast.com", true },
- { "drivinghorror.com", true },
- { "drivinhors.com", true },
- { "drivya.com", true },
- { "drizz.com.br", false },
- { "drjacquesmalan.com", true },
- { "drjoe.ca", true },
- { "drjosebarrera.com", true },
- { "drjuanitacollier.com", false },
- { "drjulianneil.com", true },
- { "drkhsh.at", false },
- { "drlandis.com", true },
- { "drlangsdon.com", true },
- { "drlinkcheck.com", true },
- { "drmayakato.com", true },
- { "drmcdaniel.com", true },
- { "drms.us", true },
- { "drmtransit.com", true },
- { "drogariasantoantonio.pt", true },
- { "drogavista.com.br", true },
- { "droid101.com", true },
- { "droidandy.com", true },
- { "droidapp.nl", true },
- { "droidchart.com", true },
- { "droidgyan.com", true },
- { "droidhere.com", true },
- { "drone-it.net", false },
- { "dronebl.org", true },
- { "droneland.nl", true },
- { "dronepilotgeorgia.com", true },
- { "dronepit.dk", true },
- { "dronesz.co", true },
- { "droni.cz", true },
- { "dronografia.es", true },
- { "dronova-art.ru", true },
- { "drop.com", true },
- { "dropbox.com", true },
- { "dropboxer.net", true },
- { "droperplus.com", true },
- { "dropistic.com", true },
- { "droppia.io", true },
- { "dropq.nl", true },
- { "dropscloud.spdns.de", true },
- { "dropshare.cloud", true },
- { "dropshell.net", true },
- { "droso.dk", true },
- { "drown.photography", true },
- { "drpetersenobgynal.com", true },
- { "drpetervoigt.ddns.net", true },
- { "drpetervoigt.de", true },
- { "drphillipsmwc.com", true },
- { "drpico.com.au", true },
- { "drpil.nl", true },
- { "drpure.top", true },
- { "drradin.com", true },
- { "drrhonda.com", true },
- { "drrr.chat", true },
- { "drrr.com", true },
- { "drrr.wiki", true },
- { "drsajjadian.com", true },
- { "drsamuelkoo.com", true },
- { "drschlarb.eu", true },
- { "drsheri.com", true },
- { "drsturgeonfreitas.com", true },
- { "drsubbio.com", true },
- { "drthalhammer.at", true },
- { "drtimmarch.com", true },
- { "drtimothybradley.com", true },
- { "drtristanberry.com", true },
- { "druckerei-huesgen.de", true },
- { "drugs.com", true },
- { "drumbe.at", true },
- { "drumlines.org", true },
- { "drummondframing.com", true },
- { "drunkendropkes.tk", true },
- { "drunkscifi.com", true },
- { "drupal-expert.it", true },
- { "drupal.org", true },
- { "drupalspb.org", true },
- { "drusantia.net", true },
- { "drusillas.co.uk", true },
- { "druwe.net", false },
- { "drwang.group", true },
- { "drweinrach.com", true },
- { "drweissbrot.net", true },
- { "drwxr.org", true },
- { "drybjed.net", true },
- { "drycleancoalition.org", true },
- { "drycreekphoto.com", true },
- { "drydrydry.com", true },
- { "dryerventcleaningarlington.com", true },
- { "dryerventcleaningcarrollton.com", true },
- { "dryjersey.com", true },
- { "dryudha.site", true },
- { "drywallresponse.gov", true },
- { "ds.lol", true },
- { "ds138.cc", true },
- { "ds168.cc", true },
- { "ds28s.com", true },
- { "ds388.cc", true },
- { "ds67.de", true },
- { "dsancomics.com", true },
- { "dsanraffleshangbai.xyz", true },
- { "dsayce.com", true },
- { "dsble.de", true },
- { "dsbmradio.tk", true },
- { "dsbutler.de", true },
- { "dscharrer.com", true },
- { "dschwarzachtaler.de", true },
- { "dsebastien.net", true },
- { "dsektionen.se", false },
- { "dsgarms.com", true },
- { "dsgholsters.com", true },
- { "dsgnet.hu", true },
- { "dsgvo-addon.eu", true },
- { "dsgvo-analyse.de", true },
- { "dsgvo.name", true },
- { "dsh.io", true },
- { "dshield.org", true },
- { "dsi7.com", true },
- { "dsimons.tk", true },
- { "dsm5.com", true },
- { "dsmjs.com", true },
- { "dso-izlake.si", true },
- { "dsol.hu", true },
- { "dsouzamusic.com", true },
- { "dspace.pl", true },
- { "dspropertyservicesltd.co.uk", true },
- { "dsreal.de", true },
- { "dstamou.de", true },
- { "dsteiner.at", true },
- { "dstvinstalledenvale.co.za", true },
- { "dstvinstallglenvista.co.za", true },
- { "dstvinstalljohannesburg.co.za", true },
- { "dstvinstallkemptonpark.co.za", true },
- { "dstvrandburg.co.za", true },
- { "dstvsandton.co.za", true },
- { "dstvsouthafrica.com", true },
- { "dsuinnovation.com", true },
- { "dt688.net", true },
- { "dtbouncycastles.co.uk", true },
- { "dtbw.eu", true },
- { "dtbw.net", true },
- { "dtbw.org", true },
- { "dtdsh.com", true },
- { "dtg-fonds.com", true },
- { "dtg-fonds.de", true },
- { "dtg-fonds.net", true },
- { "dtgmns.com", true },
- { "dtinel.org", true },
- { "dtivandortbv.nl", true },
- { "dtleague.eu", true },
- { "dtmbnl.com", true },
- { "dtmbx.com", true },
- { "dtmbx.email", true },
- { "dtmbx.eu", true },
- { "dtmbx.net", true },
- { "dtmbx.nl", true },
- { "dtmbx.org", true },
- { "dtmlnp.com", true },
- { "dtngny.com", true },
- { "dtnx.email", true },
- { "dtnx.eu", true },
- { "dtnx.net", true },
- { "dtnx.org", true },
- { "dtnxny.com", true },
- { "dtoweb.be", true },
- { "dtp-mstdn.jp", false },
- { "dtuaarsfest.dk", true },
- { "dtune.me", true },
- { "dtx.sk", true },
- { "du-alex.ru", true },
- { "duarteeleiteconsultoria.com.br", true },
- { "dub.cz", true },
- { "dubai-company.ae", true },
- { "dubaieveningsafari.com", true },
- { "dubaizone.cf", true },
- { "dubbingkursus.dk", true },
- { "dubbningshemsidan.se", true },
- { "dubious-website.com", true },
- { "dublin-traceroute.net", true },
- { "dubrava.tk", true },
- { "dubrovskiy.net", true },
- { "dubrovskiy.pro", true },
- { "dubstep.fr", true },
- { "dubtrack.fm", true },
- { "ducadu.com", true },
- { "duch.cloud", true },
- { "duckbase.com", true },
- { "duckblade.com", true },
- { "duckcorp.org", true },
- { "duckduck.horse", true },
- { "duckduckstart.com", true },
- { "duckfam.us", true },
- { "duckinc.net", true },
- { "ducksoft.fi", true },
- { "duct.me", true },
- { "dudesunderwear.com.br", false },
- { "due-diligence-security.com", true },
- { "duelingaces.com", true },
- { "duernberg.at", true },
- { "duesee.org", true },
- { "duesterhus.eu", true },
- { "dufrei.com", true },
- { "dug.net.pl", true },
- { "duggtec.com", true },
- { "dugunedavet.com", true },
- { "duh.se", true },
- { "duijf.info", true },
- { "duijf.io", true },
- { "duijfathome.nl", true },
- { "duitang.com", true },
- { "dukan-recepty.ru", true },
- { "dukatek.cz", true },
- { "dukeandduchessdrivingschool.co.uk", true },
- { "dukegat.de", false },
- { "dukers-baelemans.nl", true },
- { "dukesatqueens.com", true },
- { "dukun.de", true },
- { "dulcinela.es", true },
- { "dulei.si", true },
- { "dullapp.com", true },
- { "dum.moe", true },
- { "dumax.xyz", true },
- { "dumb-laws.net.ru", true },
- { "dumbeartech.com", true },
- { "dumberger-bau.de", true },
- { "dumboverflow.com", true },
- { "dumino.bg", true },
- { "duncancmt.com", true },
- { "duncanfamilytrust.org", true },
- { "duncanmoffat.com", true },
- { "duncanwinfrey.com", true },
- { "duncm.com", true },
- { "dungdev.net", true },
- { "dungeon-bbs.de", true },
- { "dunklau.fr", true },
- { "dunkle-seite.org", true },
- { "dunmanelectric.com", true },
- { "dunyahalleri.com", true },
- { "duobus.nl", true },
- { "duoluodeyu.com", true },
- { "duoquadragintien.fr", true },
- { "duoyin.com", true },
- { "dupisces.com.tw", true },
- { "duplicazionechiavi.it", true },
- { "duploclique.pt", false },
- { "dupree.co", true },
- { "dupree.pe", true },
- { "durand.tf", true },
- { "duranthon.eu", true },
- { "durbanlocksmiths.co.za", true },
- { "durcal.tk", true },
- { "durdle.com", true },
- { "dureuil.info", true },
- { "durfteparticiperen.nl", true },
- { "durgatopos.it", true },
- { "duria.de", true },
- { "duriaux-dentiste.ch", false },
- { "durin-art.com", true },
- { "durmatest.com", true },
- { "durys.be", true },
- { "dusmomente.com", true },
- { "dustandsand.com", true },
- { "dustplanet.de", true },
- { "dustri.org", true },
- { "dustygroove.com", true },
- { "dustyspokesbnb.ca", true },
- { "dustywilson.com", true },
- { "dutch.desi", true },
- { "dutchessuganda.com", true },
- { "dutchfoodie.nl", true },
- { "dutchforkrunners.com", true },
- { "dutchrank.nl", true },
- { "dutchsailors.com", true },
- { "dutchwanderers.nl", true },
- { "dutchweballiance.nl", true },
- { "dutkoteam.com", true },
- { "dutrac.co.id", true },
- { "dutyfreeinformation.com", true },
- { "duval.paris", true },
- { "duvalo.eu", true },
- { "duvalo.info", true },
- { "duvalo.net", true },
- { "duvalo.org", true },
- { "duvalo.sk", true },
- { "duxi-s-feromonami.ga", true },
- { "dv189.com", true },
- { "dvbris.co.uk", true },
- { "dvbris.com", true },
- { "dvdinmotion.com", true },
- { "dvdland.com.au", true },
- { "dvhosting.be", true },
- { "dvipadmin.com", true },
- { "dvlot.ru", true },
- { "dvnatura.ch", false },
- { "dvorupotocnych.sk", true },
- { "dvwc.org", true },
- { "dvx.cloud", true },
- { "dwgf.xyz", true },
- { "dwi-sued.de", true },
- { "dwood.store", true },
- { "dworzak.ch", true },
- { "dwscdv3.com", true },
- { "dwtm.ch", true },
- { "dwworld.co.uk", true },
- { "dwz-solutions.com", true },
- { "dx-revision.com", true },
- { "dx2o.com", true },
- { "dxgl.info", true },
- { "dxgl.org", true },
- { "dxm.no-ip.biz", true },
- { "dxmpay.com", true },
- { "dxzsj.cn", true },
- { "dybuster.at", true },
- { "dybuster.ch", true },
- { "dybuster.com", true },
- { "dybuster.de", true },
- { "dybuster.es", true },
- { "dybuster.it", true },
- { "dybuster.se", true },
- { "dyeager.org", true },
- { "dyktig.as", true },
- { "dyktig.no", true },
- { "dylancl.cf", true },
- { "dylangattey.com", true },
- { "dylankatz.com", true },
- { "dylanknoll.ca", true },
- { "dylanspcrepairs.com", true },
- { "dylmye.me", false },
- { "dylnuge.com", true },
- { "dym.asia", true },
- { "dym.bz", true },
- { "dym2012.com", true },
- { "dym2013.com", true },
- { "dym2014.com", true },
- { "dym2017.com", true },
- { "dymersion.com", true },
- { "dymfbbs.com", true },
- { "dymmovie.com", true },
- { "dymowski.de", false },
- { "dyn.im", true },
- { "dynaloop.net", false },
- { "dynamicdesignuk.com", true },
- { "dynamicnet.net", false },
- { "dynamics-365.no", true },
- { "dynamics365.no", true },
- { "dynamicsretailnotes.com", true },
- { "dynamictostatic.com", true },
- { "dynamofanforum.de", true },
- { "dynapptic.com", true },
- { "dynastic.co", true },
- { "dynastyarena.com", true },
- { "dynastybullpen.com", true },
- { "dynastycalculator.com", true },
- { "dynastycentral.com", true },
- { "dynastychalkboard.com", true },
- { "dynastyclubhouse.com", true },
- { "dynastycrate.com", true },
- { "dynastyduel.com", true },
- { "dynastyfan.com", true },
- { "dynastygoal.com", true },
- { "dynastylocker.com", true },
- { "dynastyredline.com", true },
- { "dyncdn.me", true },
- { "dyneco.io", true },
- { "dynn.be", false },
- { "dynocc.xyz", true },
- { "dynorphin.com", true },
- { "dynorphins.com", true },
- { "dynts.pro", true },
- { "dynx.pl", true },
- { "dyremyhr.no", true },
- { "dyrenesverden.no", true },
- { "dyrkar.com", true },
- { "dyrstad.net", true },
- { "dyrvigs.de", true },
- { "dyscalculia-blog.com", true },
- { "dysthymia.com", true },
- { "dyxe.me", true },
- { "dyxe.xyz", true },
- { "dyz.pw", true },
- { "dzar.nsupdate.info", true },
- { "dzeina.ch", false },
- { "dzet.de", true },
- { "dziaduch.pl", true },
- { "dziary.com", true },
- { "dziekonski.com", true },
- { "dziscover.com", true },
- { "dziura.me", true },
- { "dziurdzia.pl", true },
- { "dzivniekubriviba.lv", true },
- { "dzndk.com", true },
- { "dznn.nl", true },
- { "dzomo.org", true },
- { "dzsi.bi", false },
- { "dzsibi.com", true },
- { "dzsula.hu", true },
- { "dzu.fund", true },
- { "dzu.me", true },
- { "dzu.works", true },
- { "dzus.tk", true },
- { "dzworld.com", true },
- { "dzyszla.pl", true },
- { "dzytdl.com", true },
- { "e-bikesdirect.co.uk", true },
- { "e-borneoshop.com", true },
- { "e-briancon.com", true },
- { "e-businessexpert.com", true },
- { "e-coexist.com", true },
- { "e-colle.info", true },
- { "e-cottage.com.br", true },
- { "e-diabolo.tk", true },
- { "e-emploi.be", true },
- { "e-enterprise.gov", false },
- { "e-id.ee", true },
- { "e-klempir.cz", true },
- { "e-labo.works", true },
- { "e-lambre.com", true },
- { "e-learningbs.com", true },
- { "e-lifetechnology.com", true },
- { "e-mandataires.fr", true },
- { "e-michiganinsurance.com", true },
- { "e-nanum.kr", true },
- { "e-privat.info", true },
- { "e-ptn.com", true },
- { "e-referendum.cz", true },
- { "e-speak24.pl", true },
- { "e-standardstore.org", true },
- { "e-surety.net", true },
- { "e-sushi.net", true },
- { "e-sw.co.jp", true },
- { "e-teachers.me", true },
- { "e-tech-solution.com", true },
- { "e-tech-solution.net", true },
- { "e-techsolution.com", true },
- { "e-techsolutions.net", true },
- { "e-tonery.cz", true },
- { "e-traceur-france.fr", true },
- { "e-tresor.at", true },
- { "e-tune-mt.net", true },
- { "e-typ.eu", true },
- { "e-verify.gov", true },
- { "e-webos.com", true },
- { "e-worksmedia.com", false },
- { "e.mail.ru", true },
- { "e007.com", true },
- { "e15r.co", true },
- { "e2feed.com", true },
- { "e30.ee", true },
- { "e36533.com", true },
- { "e5tv.hu", true },
- { "e64.com", true },
- { "e6e.io", true },
- { "e7d.io", true },
- { "e7fun.net", true },
- { "e81818.com", true },
- { "e901.com", true },
- { "e965.ru", true },
- { "ea-lateleassistance.com", true },
- { "ea2drocks.com", true },
- { "eac.gov", true },
- { "eacero.com", true },
- { "ead-italia.it", true },
- { "eagle.net", true },
- { "eagleindustriesltd.com", true },
- { "eaglemessaging.com", true },
- { "eaglemoe.com", true },
- { "eaglenation.net", true },
- { "eagletechz.com.br", true },
- { "eaglewreck.info", true },
- { "eaglexiang.org", true },
- { "eagleyecs.com", true },
- { "eaimty.com", true },
- { "ealev.de", true },
- { "eallion.com", true },
- { "eapestudioweb.com", true },
- { "earfolds.com", true },
- { "earl.org.uk", true },
- { "earlybetter.com", true },
- { "earlyyearshub.com", true },
- { "earmarks.gov", true },
- { "earn.com", true },
- { "earn99.co", true },
- { "earningthatis.tk", true },
- { "earthava.com", true },
- { "earthcorporation.cf", true },
- { "earthsolidarity.org", true },
- { "earthspundesigns.com", true },
- { "earthsystemprediction.gov", true },
- { "earticleblog.com", true },
- { "easez.net", true },
- { "eashwar.com", true },
- { "eason-yang.com", true },
- { "eastarm.net", true },
- { "eastbaycontractor.com", true },
- { "eastblue.org", true },
- { "easterncapebirding.co.za", true },
- { "eastlothianbouncycastles.co.uk", true },
- { "eastmaintech.com", true },
- { "eastmanbusinessinstitute.com", true },
- { "eastmidlandsstargazers.org.uk", true },
- { "eastnorschool.co.uk", true },
- { "eastping.com", true },
- { "eastplan.co.kr", true },
- { "eastsidecottages.co.uk", true },
- { "eastsideroofingcontractor.com", true },
- { "eaststudios.net", true },
- { "eastwesttmc.com.au", true },
- { "eastwind.cloud", true },
- { "eastyorkshirebuses.co.uk", true },
- { "easy-rpg.org", false },
- { "easy-vn.com", true },
- { "easy2bathe.co.uk", true },
- { "easyadsnbanners.tk", false },
- { "easycoding.org", true },
- { "easyconstat.com", true },
- { "easycosmetic.ch", true },
- { "easydumpsterrental.com", true },
- { "easyeditcms.com", true },
- { "easyeigo.com", true },
- { "easyfiles.ch", true },
- { "easyfiles.gq", true },
- { "easyhaul.com", true },
- { "easylogics.tk", true },
- { "easynm.cn", true },
- { "easypay.bg", true },
- { "easypayments.pro", true },
- { "easypets.fr", true },
- { "easyproperty.com", true },
- { "easypv.ch", true },
- { "easyroad.fr", true },
- { "easyshare.gq", true },
- { "easyslide.be", true },
- { "easystore.co", true },
- { "easytechguides.com", true },
- { "easytube.ga", true },
- { "easyweenies.com", true },
- { "easywin.ml", true },
- { "easywio.com", true },
- { "eat-sleep-code.com", true },
- { "eatery.co.il", true },
- { "eatmebudapest.hu", true },
- { "eaton-works.com", true },
- { "eatry.io", true },
- { "eatsleeprepeat.net", true },
- { "eatson.com", true },
- { "eatz-and-treatz.com", true },
- { "eaucube.com", true },
- { "eaugenethomas.cf", true },
- { "eauxdespleiades.ch", false },
- { "eazyproject.net", true },
- { "eb-net.de", true },
- { "eb7.jp", true },
- { "ebaby.bg", true },
- { "ebankcbt.com", true },
- { "ebanking.indovinabank.com.vn", true },
- { "ebankingabersicher.ch", true },
- { "ebankingbutsecure.ch", true },
- { "ebankingentoutesecurite.ch", true },
- { "ebankingmasicuro.ch", true },
- { "ebas.ch", true },
- { "ebashim.tk", true },
- { "ebataw.com", true },
- { "ebaymotorssucks.com", true },
- { "ebenda.org", true },
- { "ebenezersbarnandgrill.com", true },
- { "ebermannstadt.de", false },
- { "ebertlang.com", true },
- { "eberwe.in", true },
- { "ebest.co.jp", true },
- { "ebiografia.com", true },
- { "ebisi.be", true },
- { "ebizarts.com", true },
- { "eblog.cf", true },
- { "eblog.com.au", true },
- { "eblog.ink", true },
- { "eboardsolutions.com", true },
- { "eboek.info", true },
- { "ebola-hosting.cz", true },
- { "ebonyriddle.com", true },
- { "eboocker.de", true },
- { "ebookabc.tk", true },
- { "ebooki.eu.org", true },
- { "ebooknetworking.net", true },
- { "ebooks-pdf.cf", true },
- { "eboutic.ch", true },
- { "eboyer.com", true },
- { "ebpglobal.com", false },
- { "ebrnd.de", true },
- { "ebteam.ir", true },
- { "eburg.ml", true },
- { "ebuyclub.com", true },
- { "ec-current.com", true },
- { "ec.mine.nu", true },
- { "ecalculator.org", true },
- { "ecardoo.com", true },
- { "ecardoo.de", true },
- { "ecardoo.net", true },
- { "ecardoo.org", true },
- { "ecbt.co.il", true },
- { "ecchidreams.com", true },
- { "ecco-verde.com", false },
- { "ecdn.cz", true },
- { "ecfnorte.com.br", true },
- { "echarity.ae", true },
- { "echarlascartas.es", true },
- { "echatta.net", true },
- { "echatta.org", true },
- { "echidna-rocktools.eu", true },
- { "echo-in.info", true },
- { "echo-security.co", true },
- { "echo.co.uk", true },
- { "echoanalytics.com", true },
- { "echobridgepartners.com", true },
- { "echodio.com", true },
- { "echofoxtrot.co", true },
- { "echoit.net", true },
- { "echoit.net.au", true },
- { "echoit.services", true },
- { "echopaper.com", true },
- { "echorecovery.org", true },
- { "echosim.io", true },
- { "echosixmonkey.com", true },
- { "echosnature.fr", true },
- { "echosystem.fr", true },
- { "echoworld.ch", false },
- { "echternach-immobilien.de", true },
- { "ecigfind.com", true },
- { "ecir.pro", true },
- { "ecir.ru", true },
- { "ecirtam.net", true },
- { "eciso.io", true },
- { "eckel.co", true },
- { "eckstein.tech", true },
- { "eclectiv.com", true },
- { "eclipse.ws", true },
- { "eclipseforum.tk", true },
- { "eclypsium.io", false },
- { "ecmatching.com", true },
- { "ecmeshltd.com", true },
- { "ecnetworker.com", true },
- { "eco-derattizzazione.it", true },
- { "eco-flowplumbing.com", true },
- { "eco-repair.be", true },
- { "eco-solu.co.jp", true },
- { "eco-work.it", true },
- { "eco2u.ru", true },
- { "ecobagsmauritius.com", true },
- { "ecobee.com", false },
- { "ecobergerie.fr", true },
- { "ecobin.nl", true },
- { "ecoccinelles.ch", false },
- { "ecoccinelles.com", false },
- { "ecococon.fr", true },
- { "ecocreativity.org", true },
- { "ecodedi.com", true },
- { "ecodesign-labo.jp", true },
- { "ecodesigns.nl", true },
- { "ecodigital.social", true },
- { "ecofabrica.com.br", true },
- { "ecofac-bs.com", true },
- { "ecogen.com.au", true },
- { "ecogen.net.au", true },
- { "ecoheatcool.co.uk", true },
- { "ecohostingservices.uk", true },
- { "ecole-attalens.ch", false },
- { "ecoledusabbat.org", false },
- { "ecolemathurincordier.com", false },
- { "ecombustibil.ro", true },
- { "ecomia.dk", true },
- { "ecomycie.com", true },
- { "economiafinanzas.com", true },
- { "economias.pt", true },
- { "economicinclusion.gov", true },
- { "economics-colleges.com", true },
- { "economie2.alsace", true },
- { "economiefidu.ch", false },
- { "economies.ch", false },
- { "econsorzio.com", true },
- { "econsumer.gov", true },
- { "ecorp.cc", true },
- { "ecos-ev.de", true },
- { "ecos.srl", true },
- { "ecoshare.info", true },
- { "ecosm.com.au", true },
- { "ecosound.ch", false },
- { "ecostruxureit.com", true },
- { "ecosystem.atlassian.net", true },
- { "ecosystemmanager-uat1.azurewebsites.net", true },
- { "ecoterramedia.com", true },
- { "ecotransfer.bio", true },
- { "ecotur.org", true },
- { "ecovision.com.br", true },
- { "ecpannualmeeting.com", true },
- { "ecpic.gov", true },
- { "ecr-test-backoffice-app.azurewebsites.net", true },
- { "ecr-test-partnapp.azurewebsites.net", true },
- { "ecrandouble.ch", false },
- { "ecriminalrecords.com", true },
- { "ecrownoffire.com", true },
- { "ecsupplyinc.com", true },
- { "ecuadorbienesraices.com", true },
- { "ecuatask.com", true },
- { "ecuteam.com", true },
- { "ecxforum.com", true },
- { "ed-studios.tk", true },
- { "ed.gs", true },
- { "edanni.io", true },
- { "edapt.org.uk", true },
- { "edas.info", false },
- { "edcaptain.com", true },
- { "edd-miles.com", true },
- { "eddesign.ch", true },
- { "eddmil.es", true },
- { "eddokloosterman.com", true },
- { "eddy.ee", true },
- { "eddyn.net", true },
- { "edeals.co", true },
- { "edeals.co.com", true },
- { "edeals.com.co", true },
- { "edeca.net", true },
- { "edefrutos.me", true },
- { "edehsa.com", true },
- { "edelweiss-pinzolo.com", true },
- { "eden-eu.com", true },
- { "eden-project-insight.tk", true },
- { "eden.co.uk", true },
- { "edenmal.net", true },
- { "edenming.info", true },
- { "edesseglabor.hu", true },
- { "edfinancial.com", true },
- { "edgarz.tk", true },
- { "edgefantasy.com", true },
- { "edgeservices.co.uk", true },
- { "edgetalk.net", true },
- { "edh.email", true },
- { "edhesive.com", true },
- { "edholm.pub", true },
- { "edi-gate.com", true },
- { "edi-gate.de", true },
- { "edibarcode.com", true },
- { "edicct.com", true },
- { "edify.space", true },
- { "edilservizi.it", true },
- { "edilservizivco.it", true },
- { "edinburghsportsandoutdoorlearning.com", true },
- { "edincmovie.com", true },
- { "edisa.xyz", true },
- { "ediscomp.sk", true },
- { "edisonlee55.com", true },
- { "edisonluiz.com", true },
- { "edisonnissanparts.com", true },
- { "edit.co.uk", true },
- { "edit.yahoo.com", false },
- { "edited.de", true },
- { "edition-bambou.com", false },
- { "edition-sonblom.de", true },
- { "editionsnoiretrouge.com", true },
- { "edlinger.at", true },
- { "edlinger.mobi", true },
- { "edlinus.cn", true },
- { "edmm.jp", true },
- { "edmodo.com", true },
- { "edmoncu.com", true },
- { "edmundcelis.com", true },
- { "edp-collaborative.com", true },
- { "edplan.io", true },
- { "edragneainpuscarie.ro", true },
- { "edrosd.cf", true },
- { "edsby.com", true },
- { "edservicing.com", true },
- { "edshogg.co.uk", true },
- { "edsinet.com", false },
- { "edsm.net", true },
- { "edstem.org", true },
- { "edstep.com", true },
- { "edtech-hub.com", true },
- { "edtech.ee", true },
- { "edtechwebb.com", true },
- { "edu-kingdom.com", true },
- { "edu6.cloud", true },
- { "eduart.tk", true },
- { "edubase.net", true },
- { "edubras.com.br", true },
- { "educa2.es", true },
- { "educacionvirtual.com.ar", true },
- { "educaestado.com", true },
- { "educatek.es", true },
- { "educateyourskin.com", true },
- { "educationevolving.org", true },
- { "educationfutures.com", true },
- { "educationmalaysia.co.uk", true },
- { "educative.io", true },
- { "educativetech.com", true },
- { "eductf.org", true },
- { "edugundavetiyesi.com", true },
- { "eduid.se", false },
- { "edukador.com", true },
- { "edumundo.nl", true },
- { "edunet.gq", true },
- { "eduroam.no", true },
- { "eduroam.uy", true },
- { "edusanjal.com", true },
- { "eduschedule.org", true },
- { "edusercontent.com", true },
- { "eduvpn.no", true },
- { "eduxpert.in", true },
- { "edv-kohls.de", true },
- { "edv-lehrgang.de", true },
- { "edv-ringhofer.de", true },
- { "edv-schmittner.de", true },
- { "edvgarbe.de", true },
- { "edvmesstec.de", true },
- { "edwardsgrounds.co.uk", true },
- { "edwardsnowden.com", true },
- { "edwardspeyer.com", true },
- { "edwellbrook.com", true },
- { "edwinmattiacci.com", true },
- { "edwinyrkuniversity.de", true },
- { "edxg.de", false },
- { "edxn.de", true },
- { "edyhenry.tk", true },
- { "edyou.eu", true },
- { "edyou.org", true },
- { "edzilla.info", true },
- { "ee00228.com", false },
- { "ee362.com", true },
- { "ee367.com", true },
- { "ee371.com", true },
- { "ee372.com", true },
- { "ee373.com", true },
- { "ee396.com", true },
- { "ee397.com", true },
- { "ee575.com", true },
- { "ee735.com", true },
- { "ee736.com", true },
- { "ee951.com", true },
- { "ee973.com", true },
- { "eebt.hu", true },
- { "eelcapone.nl", true },
- { "eellak.gr", true },
- { "eelsden.net", true },
- { "eelzak.nl", true },
- { "eemcevn.com", true },
- { "eentertain.com.my", true },
- { "eentweevijf.be", true },
- { "eenvren.com", true },
- { "eenvxing.com", true },
- { "eer.io", true },
- { "eerstejaarsweekend.nl", true },
- { "eery.de", true },
- { "eesti.xyz", true },
- { "eet.nu", true },
- { "eewna.org", true },
- { "ef-georgia.org", true },
- { "ef.gy", true },
- { "efaas.nl", true },
- { "efag.com", true },
- { "efcross.com", true },
- { "efeen.nl", true },
- { "eff.org", true },
- { "effdocs.com", true },
- { "effe.ch", false },
- { "effective-altruist.com", true },
- { "effectivecoffee.com", true },
- { "effectivepapers.com", true },
- { "effex.ru", true },
- { "effinfun.com", true },
- { "effortlesshr.com", true },
- { "eficsolar.com", true },
- { "efinity.io", true },
- { "efipsactiva.com", true },
- { "eflorashop.be", true },
- { "eflorashop.ch", true },
- { "eflorashop.co.uk", true },
- { "eflorashop.com", true },
- { "eflorashop.de", true },
- { "eflorashop.es", true },
- { "eflorashop.fr", true },
- { "eflorashop.it", true },
- { "eflorashop.mx", true },
- { "eflorashop.net", true },
- { "eflorashop.us", true },
- { "efmcredentialing.org", true },
- { "efoood.org", true },
- { "efreet.xyz", true },
- { "eft.boutique", true },
- { "eftopia.org", true },
- { "egablo.black", true },
- { "egarden.it", true },
- { "egb.at", false },
- { "egbc.ca", true },
- { "egeozcan.com", true },
- { "eges.eu", true },
- { "egg-ortho.ch", true },
- { "eggblast.com", true },
- { "eggert.org", false },
- { "egglestonyouthcenter.org", true },
- { "egiftcards.be", true },
- { "egles.eu", true },
- { "eglisedenantes.fr", true },
- { "ego4u.com", true },
- { "ego4u.de", true },
- { "egold-keeper.com", true },
- { "egomaniaque.tk", true },
- { "egonix.de", true },
- { "egov4.ch", true },
- { "egovernment-podcast.com", true },
- { "egres.xyz", true },
- { "egrojsoft.info", true },
- { "egrp365.ru", true },
- { "egw-ceramica.de", true },
- { "egweb.tv", true },
- { "ehaccp.it", true },
- { "ehandel.com", true },
- { "ehazi.hu", true },
- { "ehb-sec-ward.be", true },
- { "ehbsecuritydavy.be", true },
- { "ehbssl.com", true },
- { "ehcommerce.com", true },
- { "ehcommerce.org", true },
- { "eheliche-disziplin.schule", true },
- { "ehipaa.com", true },
- { "ehlacademy.org", true },
- { "ehmsen.nu", true },
- { "ehmtheblueline.com", true },
- { "ehne.de", true },
- { "ehomusicgear.com", true },
- { "ehorizon.jp", true },
- { "ehrenburg.info", true },
- { "ehub.cz", true },
- { "ehub.hu", true },
- { "ehub.pl", true },
- { "ehub.sk", true },
- { "eichel.eu", true },
- { "eichinger-stelzl.de", true },
- { "eichler.work", true },
- { "eickemeyer.nl", true },
- { "eickhof.co", true },
- { "eickhof.us", true },
- { "eickhofcolumbaria.com", true },
- { "eidelpes.info", true },
- { "eigenpul.se", true },
- { "eigenpulse.com", true },
- { "eighty-aid.com", true },
- { "eightyfour.ca", true },
- { "eightysoft.de", true },
- { "eigpropertyauctions.co.uk", true },
- { "eihaikyo.com", true },
- { "eikentafels.nl", true },
- { "eikounoayumi.jp", true },
- { "eilhan.com", true },
- { "eimacs.com", true },
- { "eimmigration.com", true },
- { "einaros.is", true },
- { "eine-andere-welt.org", true },
- { "einfachbahn.de", true },
- { "einheft.info", true },
- { "einheizpreis.de", true },
- { "einkaufi.de", true },
- { "einrichtwerk.de", true },
- { "einrichtwerk.shop", true },
- { "einsatzstellenverwaltung.de", true },
- { "einser.com", true },
- { "einsteinathome.org", true },
- { "einsurancetraining.com", true },
- { "eintageinzug.de", true },
- { "eintragsservice24.de", true },
- { "eion.io", true },
- { "eioperator.com", false },
- { "eirastudios.co.uk", false },
- { "eirb.fr", true },
- { "eirik.eu", true },
- { "eisaev.ru", true },
- { "eisen-biomed.ch", true },
- { "eisenbahnfreunde-lengerich.de", true },
- { "eisenhowerlibrary.gov", true },
- { "eiskratzer-bedrucken.de", true },
- { "eiti.online", true },
- { "eiyoushi-shigoto.com", true },
- { "ej.uz", true },
- { "ejdv-anmeldung.de", true },
- { "ejelectrical-qld.com.au", true },
- { "ejkhosting.nl", true },
- { "ejkmedia.nl", true },
- { "ejkmuseum.nl", true },
- { "ejknet.nl", true },
- { "ejkwebdesign.nl", true },
- { "ek-networks.de", false },
- { "ekaigotenshoku.com", true },
- { "ekalisch.de", true },
- { "ekaplast.com.pl", true },
- { "ekati.ru", true },
- { "ekb-avia.ru", true },
- { "ekd.de", true },
- { "ekedc.com", true },
- { "ekedp.com", true },
- { "ekimma.com", true },
- { "eklepka.com", true },
- { "eklitzke.org", true },
- { "ekocleaningllc.com", true },
- { "ekokontakt.cz", true },
- { "ekonbenefits.com", true },
- { "ekostecki.de", true },
- { "ekouniejow.pl", true },
- { "ekpj.jp", true },
- { "ekranos.me", true },
- { "ekre.club", true },
- { "eksisozluk.com", true },
- { "ekspoint-mods.ru", true },
- { "ekvastra.in", true },
- { "ekyu.moe", true },
- { "ekz-crosstour.ch", true },
- { "ekzarta.ru", true },
- { "ekzcrosstour.ch", true },
- { "el-cell.com", true },
- { "el-hossari.com", true },
- { "el-news.de", true },
- { "elaboratefiction.com", true },
- { "eladgames.com", true },
- { "eladlak-ingatlan.com", true },
- { "elagplus.com", true },
- { "elainerock.com", true },
- { "elainesearer.com", true },
- { "elaon.de", true },
- { "elars.de", true },
- { "elarvee.xyz", true },
- { "elasticshift.com", true },
- { "elb500ttl.nl", true },
- { "elbetech.net", true },
- { "elblogdegoyo.mx", true },
- { "elbohlyart.com", true },
- { "elburgozagalicos.com", true },
- { "elcambiador.es", true },
- { "elcin.tk", true },
- { "eldapoint.co.uk", true },
- { "eldercare.gov", true },
- { "elderjustice.gov", true },
- { "eldertons.co.uk", true },
- { "eldevo.com", true },
- { "eldoradocylinders.com", true },
- { "eldrid.ge", true },
- { "eldritchfiction.net", true },
- { "electerious.com", true },
- { "electionsbycounty.com", true },
- { "electionsdatabase.com", true },
- { "electr0sheep.com", true },
- { "electragirl.com", true },
- { "electras.cf", true },
- { "electric-vault.co.uk", true },
- { "electricagoura.com", true },
- { "electricagourahills.com", true },
- { "electrical-schools.com", true },
- { "electricalagoura.com", true },
- { "electricalagourahills.com", true },
- { "electricalcalabasas.com", true },
- { "electricalcamarillo.com", true },
- { "electricalconejovalley.com", true },
- { "electricaldosvientos.com", true },
- { "electricalfencingbedfordview.co.za", true },
- { "electricalfencingedenvale.co.za", true },
- { "electricalhiddenhills.com", true },
- { "electricallakesherwood.com", true },
- { "electricalmalibu.com", true },
- { "electricalmoorpark.com", true },
- { "electricalnewburypark.com", true },
- { "electricaloakpark.com", true },
- { "electricalsimivalley.com", true },
- { "electricalthousandoaks.com", true },
- { "electricalwestlakevillage.com", true },
- { "electriccalabasas.com", true },
- { "electriccamarillo.com", true },
- { "electriccitysf.com", true },
- { "electricconejovalley.com", true },
- { "electricdosvientos.com", true },
- { "electricfencealberton.co.za", true },
- { "electricfenceboksburg.co.za", true },
- { "electricfencemidrand.co.za", true },
- { "electricfenceroodepoort.co.za", true },
- { "electricfencingballito.co.za", true },
- { "electricfencinggillitts.co.za", true },
- { "electricfencinghillcrest.co.za", true },
- { "electricfencingkloof.co.za", true },
- { "electricfencingpinetown.co.za", true },
- { "electricgatemotorgermiston.co.za", true },
- { "electricgatemotorglenvista.co.za", true },
- { "electricgatemotorrandburg.co.za", true },
- { "electricgatemotorsballito.co.za", true },
- { "electricgatemotorsberea.co.za", true },
- { "electricgatemotorsbluff.co.za", true },
- { "electricgatemotorskemptonpark.co.za", true },
- { "electricgatemotorsqueensburgh.co.za", true },
- { "electricgatemotorsroodepoort.co.za", true },
- { "electricgatemotorsumhlanga.co.za", true },
- { "electrichiddenhills.com", true },
- { "electrichome.fr", true },
- { "electrician-umhlangaridge.co.za", true },
- { "electricianagoura.com", true },
- { "electricianagourahills.com", true },
- { "electriciancalabasas.com", true },
- { "electriciancamarillo.com", true },
- { "electricianconejovalley.com", true },
- { "electriciandosvientos.com", true },
- { "electricianhiddenhills.com", true },
- { "electriciankemptonpark24-7.co.za", true },
- { "electricianlakesherwood.com", true },
- { "electricianlalucia.co.za", true },
- { "electricianmalibu.com", true },
- { "electricianmoorpark.com", true },
- { "electriciannewburypark.com", true },
- { "electricianoakpark.com", true },
- { "electriciansimivalley.com", true },
- { "electricianthousandoaks.com", true },
- { "electricianwestlakevillage.com", true },
- { "electricimagination.co.uk", true },
- { "electriclakesherwood.com", true },
- { "electricmalibu.com", true },
- { "electricmoorpark.com", true },
- { "electricnewburypark.com", true },
- { "electricoakpark.com", true },
- { "electricsimivalley.com", true },
- { "electricthousandoaks.com", true },
- { "electricwestlakevillage.com", true },
- { "electro-pak.com.pk", true },
- { "electrocardiographe.net", true },
- { "electroforum.tk", true },
- { "electrolivefest.spb.ru", true },
- { "electromagnetism.gq", true },
- { "electronic-ignition-system.com", true },
- { "electronicafacil.net", true },
- { "electronicayseguridadmonserrate.com", true },
- { "electronicfasteners.com", false },
- { "electronicssrit.tk", true },
- { "electroniko.cf", true },
- { "electrostatics.com", true },
- { "electrotainment.com", true },
- { "electroworld.cz", true },
- { "electrum.org", true },
- { "elegance-sm.com", true },
- { "eleganceperfumes.com.br", true },
- { "elegantlatex.tk", true },
- { "eleicoes2014.com.br", true },
- { "eleicoes2016.com.br", true },
- { "eleicoes2018.com", true },
- { "elejordemarketingconsultancy.com", true },
- { "elekharris.com", true },
- { "elektrische-zahnbuerste24.de", true },
- { "elektro-adam.de", true },
- { "elektro-diehm.de", true },
- { "elektro-doerr.com", true },
- { "elektro-hammes.net", true },
- { "elektro-hofmann-gmbh.de", true },
- { "elektro-hornetz.de", true },
- { "elektro-kahlen.de", true },
- { "elektro-koehl.de", true },
- { "elektro-liebeskind.de", true },
- { "elektro-metz.de", true },
- { "elektro-pfeiffer.de", true },
- { "elektro-praha10.cz", true },
- { "elektro-rossbach.de", true },
- { "elektro-roth.de", true },
- { "elektro-stock.de", true },
- { "elektro-woerdehoff.de", true },
- { "elektrobusch.com", true },
- { "elektrofinke.de", true },
- { "elektrokarges.de", true },
- { "elektrometz.de", true },
- { "elektronickakancelar.cz", true },
- { "elektropartner.nu", true },
- { "elektropost.org", true },
- { "elektrotango.tk", true },
- { "elektrotechnik-heisel.de", true },
- { "elektrotechnik-kaetzel.de", true },
- { "elektrownie-tanio.net", true },
- { "elemental.software", true },
- { "elementalsoftware.net", true },
- { "elementalsoftware.org", true },
- { "elementarewatson.it", true },
- { "elementarty.com", true },
- { "elementarywave.com", true },
- { "elementblend.com", true },
- { "elements.guide", true },
- { "elementshop.co.uk", true },
- { "elena-baykova.ru", true },
- { "elenatranslations.nl", true },
- { "elenta.lt", true },
- { "elephantia.cf", true },
- { "elephants.net", true },
- { "elephpant.cz", true },
- { "elepover.com", true },
- { "eletesstilus.hu", true },
- { "eletminosegert.ro", true },
- { "eletor.com", true },
- { "eletor.pl", true },
- { "eletrochape.com.br", true },
- { "elettricista-roma.it", true },
- { "elettricista-roma.org", true },
- { "elettricisti.roma.it", true },
- { "elettrodomestici.roma.it", true },
- { "eleusis-zur-verschwiegenheit.de", true },
- { "elevationtech.co.za", true },
- { "elevatoraptitudetest.com", true },
- { "elexel.ru", true },
- { "elexprimidor.com", true },
- { "elexwong.com", true },
- { "elfe.de", true },
- { "elfnon.com", true },
- { "elforno.gr", true },
- { "elfring.eu", true },
- { "elfussports.com", true },
- { "elgalponazo.com.ar", true },
- { "elglobo.com.mx", false },
- { "elgosblanc.com", true },
- { "elgrecohotel.gr", true },
- { "elgringosrentals.com", true },
- { "elguadia.faith", true },
- { "elguillatun.cl", true },
- { "elhamadimi.com", true },
- { "elhorizontal.com", true },
- { "elhossari.com", true },
- { "elian-art.de", true },
- { "eliaskordelakos.com", true },
- { "eliasojala.me", true },
- { "eliasong.com", true },
- { "eliaswendt.com", true },
- { "eliaswendt.de", true },
- { "elibom.com", true },
- { "elie.net", true },
- { "elifesciences.org", true },
- { "eligibilis.com", true },
- { "eligible.com", true },
- { "eligibleapi.com", true },
- { "eligrey.com", true },
- { "elijahgrey.com", true },
- { "elikers.ml", true },
- { "elinevanhaaften.nl", true },
- { "elinvention.ovh", true },
- { "eliott.be", true },
- { "elipsyum.com", true },
- { "elisa.ee", false },
- { "elisabeth-kostecki.de", true },
- { "elisabeth-strunz.de", true },
- { "elisabethcasanova.ch", true },
- { "elisabethkostecki.de", true },
- { "elisabethrene.com", true },
- { "elite-design.tk", true },
- { "elite-nakhodka.tk", true },
- { "elite-porno.ru", true },
- { "elite-tools.tk", true },
- { "elite12.de", true },
- { "elitebasementsohio.com", true },
- { "elitebouncingfun.com", true },
- { "elitedns.info", true },
- { "elitegameservers.net", true },
- { "elitel.nl", true },
- { "elitepainmanagement.com", true },
- { "elitsa.gr", true },
- { "elixi.re", true },
- { "elixir.bzh", true },
- { "elizabethbuitrago.com", true },
- { "elizabethrominski.com", true },
- { "elizeugomes.com.br", true },
- { "eljef.me", true },
- { "elkim.cz", true },
- { "elkoy.org", true },
- { "ell888.com", true },
- { "ella-kwikmed.com", false },
- { "ellak.gr", true },
- { "ellatotal.com", true },
- { "elldus.de", true },
- { "elle-weine.de", true },
- { "ellegaard.dk", true },
- { "ellemental.me", true },
- { "ellencorddry.com", true },
- { "ellevit.ch", false },
- { "elliesbouncers.co.uk", true },
- { "elliot.cat", true },
- { "elliquiy.com", true },
- { "ellisamusements.co.uk", true },
- { "ellisleisure.co.uk", true },
- { "ellsinger.me", true },
- { "elmermx.ch", true },
- { "elmresan.ir", true },
- { "elnan.do", true },
- { "elo-forum.org", true },
- { "elo-rocket.com", true },
- { "elodrias.de", true },
- { "elon-musk.ml", true },
- { "elonaspitze.de", true },
- { "elosuite.com", true },
- { "elpo.net", true },
- { "elpoderdelespiritu.org", true },
- { "elprint.com", true },
- { "elradix.be", true },
- { "elranchofeliz.org", true },
- { "elri.blog", true },
- { "elriacdn.com", true },
- { "elrinconderovica.com", true },
- { "elsanoguera.com", true },
- { "elshou.com", true },
- { "elsignificadodesonar.com", true },
- { "elskling.no", true },
- { "elstopstelten.nl", false },
- { "elsuccionador.com", true },
- { "elsvanderlugt.nl", true },
- { "eltair.com", true },
- { "eltern-verein.ch", true },
- { "elternbeiratswahl.online", true },
- { "elternforum-birmensdorf.ch", true },
- { "elternverein-utzenstorf.ch", true },
- { "eltip.click", true },
- { "eltlaw.com", true },
- { "eluhome.de", true },
- { "eluvio.com", true },
- { "elvendrim.xyz", true },
- { "elviraszabo.com", true },
- { "elvispresley.net", true },
- { "elvn.tokyo", false },
- { "elwave.org", true },
- { "elwebkala.com", true },
- { "elwix.com", true },
- { "elyasweb.com", true },
- { "elycoin.io", true },
- { "elysiandigital.co", true },
- { "elysiria.fr", true },
- { "elysiumware.com", true },
- { "em-biotek.cz", true },
- { "emaging-productions.fr", true },
- { "emaging.fr", true },
- { "emailconfiguration.com", true },
- { "emailhunter.co", true },
- { "emailmeform.com", true },
- { "emailprivacytester.com", true },
- { "emailtemporal.org", false },
- { "emaily.eu", true },
- { "emanol.co.uk", true },
- { "emanuel.photography", true },
- { "emanuelduss.ch", true },
- { "emanueleanastasio.com", true },
- { "emanuelemazzotta.com", true },
- { "emarketingmatters.com", true },
- { "emasex.es", true },
- { "embassycargo.eu", true },
- { "emberlife.com", true },
- { "embodiaacademy.com", true },
- { "embodiaapp.com", true },
- { "embox.net", true },
- { "embracecontext.com", true },
- { "embraceni.org", true },
- { "embroideryexpress.co.uk", true },
- { "embsaypreschool.co.uk", true },
- { "emby.cloud", true },
- { "emcspotlight.com", true },
- { "emdrupholm.dk", true },
- { "emecew.com", true },
- { "emeliefalk.se", true },
- { "emeliemai.com", true },
- { "ememsei.com", true },
- { "emeraldcbdshop.com", false },
- { "emeraldcityswagger.com", true },
- { "emeraldislerealty.com", true },
- { "emergency-federal-register.gov", true },
- { "emergencyessay.com", true },
- { "emergencyshutoff.com", true },
- { "emergesydney.com.au", true },
- { "emersoncanada.ca", true },
- { "emex.ro", true },
- { "emi.im", true },
- { "emielraaijmakers.nl", true },
- { "emigratieplanner.com", true },
- { "emil-dein-baecker.de", true },
- { "emil-reimann.com", true },
- { "emil.click", true },
- { "emil.one", true },
- { "emiliendevos.be", true },
- { "emilio.media", true },
- { "emiliops.com", true },
- { "emilong.com", true },
- { "emils-1910.de", true },
- { "emilstahl.com", true },
- { "emilstahl.dk", true },
- { "emilvarga.com", true },
- { "emily.moe", true },
- { "emilybellydance.com.au", true },
- { "emilyjohnson.ga", true },
- { "emilypennock.com", true },
- { "emirabiz.com", false },
- { "emirefek.net", true },
- { "emirichardson.com", true },
- { "emisia.com", true },
- { "emkode.pl", true },
- { "emkrivoy.com", true },
- { "emmagarland.com", true },
- { "emmagraystore.com", true },
- { "emmaliddell.com", true },
- { "emmastree.com", true },
- { "emme3abbigliamento.it", true },
- { "emmiwelentain.com", true },
- { "emmynet.de", true },
- { "emobilityforum.org", true },
- { "emoforum.tk", true },
- { "emoji.bzh", false },
- { "emolafarm.com", true },
- { "emond-usedcars.net", false },
- { "emotionalmente.com", true },
- { "emotive.productions", true },
- { "emoxie.com", true },
- { "empathogen.com", true },
- { "empathogens.com", true },
- { "empathy.ca", true },
- { "empatico.org", true },
- { "empatico.xyz", true },
- { "emperola.com", true },
- { "emperor-penguin.com", true },
- { "emperor-penguins.com", true },
- { "empherino.net", true },
- { "empicargo.com", true },
- { "empire-univ.com", true },
- { "emploi-collectivites.fr", true },
- { "employeeexpress.gov", true },
- { "employeemanual.com.au", true },
- { "employer.gov", true },
- { "employer.guru", true },
- { "employer411.com", true },
- { "employment-applicant.com", true },
- { "emporikonathenshotel.com", true },
- { "emporiodascalcinhas.com.br", true },
- { "emporiodosperfumes.com.br", true },
- { "emporioonline.com.br", true },
- { "emporiopatanegra.com.br", true },
- { "emporioviverbem.com.br", false },
- { "empower.net", true },
- { "empowerdb.com", true },
- { "empoweren.com", true },
- { "emprechtinger.com", true },
- { "emprego.pt", true },
- { "empregosrj.com", true },
- { "emptybox.org", true },
- { "empyrean-advisors.com", true },
- { "emrah.io", true },
- { "emrahcinik.com", true },
- { "emreaydinfan.tk", true },
- { "emresaglam.com", true },
- { "emrullahsahin.com", true },
- { "ems.gov", true },
- { "emsa-casm.ca", true },
- { "emulator.ml", true },
- { "emultiagent.pl", true },
- { "emvoice.net", true },
- { "emvoiceapp.com", true },
- { "emw3.com", true },
- { "emyr.net", true },
- { "emyself.org", true },
- { "emzi0767.com", true },
- { "en-booster.jp", true },
- { "en-crypt.me", true },
- { "en-este.link", true },
- { "en-maktoob.search.yahoo.com", false },
- { "en0.io", true },
- { "en4rab.co.uk", true },
- { "enaah.de", true },
- { "enalean.com", true },
- { "enamae.net", true },
- { "enanto.com", true },
- { "enbecom.net", true },
- { "enbulleiugnen.com", true },
- { "encfs.win", true },
- { "encircleapp.com", true },
- { "encnet.de", true },
- { "encode.host", true },
- { "encodecloud.net", true },
- { "encoderx.uk", true },
- { "encontra-me.org", true },
- { "encoro.org", true },
- { "encountercss.com", true },
- { "encouragemarketing.com", true },
- { "encredible.de", false },
- { "encredible.org", false },
- { "encretplomb.ch", false },
- { "encrypted.google.com", true },
- { "encryptmy.site", true },
- { "encryptmysite.net", true },
- { "encuentraprecios.es", true },
- { "encycarpedia.com", true },
- { "encyclopedia-titanica.org", true },
- { "endbox.email", true },
- { "endeal.nl", true },
- { "ender.co.at", true },
- { "ender.fr", true },
- { "enderbycamping.com", true },
- { "enderle.cloud", true },
- { "endingthedocumentgame.gov", true },
- { "endlessdiy.ca", true },
- { "endlessvideo.com", true },
- { "endlesswebsite.tk", true },
- { "endoftenancycleaninglondon.co.uk", true },
- { "endoftennancycleaning.co.uk", true },
- { "endpointsystems.com", true },
- { "enduranceday.be", true },
- { "endurogp.org", true },
- { "endustriyelfirinlar.com", true },
- { "endviolence.gc.ca", true },
- { "endzeit-architekten.com", false },
- { "eneamarcantoni.com", true },
- { "eneko.com", true },
- { "energie-sante.ch", false },
- { "energiekeurplus.nl", true },
- { "energija-visiems.lt", true },
- { "energy-drink-magazin.de", true },
- { "energy-healings.com", true },
- { "energy-in-balance.eu", true },
- { "energy-infra.nl", true },
- { "energy-initiative.com", true },
- { "energyaupair.se", true },
- { "energybank.com.br", true },
- { "energycodes.gov", true },
- { "energydrinkblog.de", true },
- { "energyefficientservices.com", true },
- { "energyelephant.com", true },
- { "energygenie.com.au", true },
- { "energyled.com.br", true },
- { "energysolutionstech.com", true },
- { "energystar.gov", true },
- { "enersolelectrical.com.au", true },
- { "enerte.ru", true },
- { "enerypa.tk", true },
- { "enet-navigator.de", true },
- { "enfantsdelarue.ch", true },
- { "enflow.nl", true },
- { "enforcement-trends-dev.azurewebsites.net", true },
- { "enforcement-trends-test.azurewebsites.net", true },
- { "enforcement-trends.azurewebsites.net", true },
- { "eng-erlangen.de", true },
- { "engagelogic.com", true },
- { "enganches.es", true },
- { "engarde.net", true },
- { "engaugetools.com", true },
- { "engelke-optik.de", true },
- { "engelundlicht.ch", true },
- { "engelwerbung.com", true },
- { "engg.ca", true },
- { "engie-laadpalen.nl", true },
- { "engiedev.net", true },
- { "engima.nl", true },
- { "enginepit.com", true },
- { "enginsight.com", true },
- { "enginx.net", true },
- { "engl-server.de", true },
- { "engl-systems.de", true },
- { "englishbulgaria.net", true },
- { "englishcast.com.br", true },
- { "englishforums.com", true },
- { "englishlol.com", true },
- { "englishphonopass.com", true },
- { "englishstudio.com", true },
- { "englishtofrench.eu", true },
- { "englishtype.com", false },
- { "engvid.com", true },
- { "engweld.co.uk", true },
- { "engym.com.tw", true },
- { "enigma.swiss", false },
- { "enitso.de", true },
- { "enixgaming.com", true },
- { "eniziolab.com", true },
- { "enjin.zone", true },
- { "enjincoin.io", true },
- { "enjinwallet.io", true },
- { "enjinx.cn", true },
- { "enjinx.io", true },
- { "enjoy-drive.com", true },
- { "enjoymondayofficial.com", true },
- { "enjoytech.fr", true },
- { "enlamochiladeadri.com", true },
- { "enlight.no", true },
- { "enlightenedhr.com", true },
- { "enlilrosse.com", true },
- { "enlnf.link", true },
- { "enloestatebank.com", true },
- { "ennea-mediation.fr", true },
- { "enness.co.uk", true },
- { "ennori.jp", true },
- { "enodais.gr", true },
- { "enofmusic.com", true },
- { "enoisdaturma.tk", true },
- { "enorekcah.com", true },
- { "enot32.ru", true },
- { "enotecastore.it", true },
- { "enotefile.com", true },
- { "enpasenerji.com.tr", true },
- { "enquos.com", true },
- { "enrack.tk", true },
- { "enrich.email", true },
- { "enrico-caruso.it", true },
- { "enrique-monroy.tk", true },
- { "enrique.wtf", true },
- { "enriquepiraces.com", true },
- { "enrollapp.com", true },
- { "ensage.io", true },
- { "enscosupply.com", true },
- { "ensemble-rubato.de", true },
- { "ensembling.com", true },
- { "ensley.tech", true },
- { "ensons.de", true },
- { "ensured.com", true },
- { "ensured.nl", true },
- { "ensurtec.com", true },
- { "ent-london.com", true },
- { "entabe.jp", true },
- { "entactogen.com", true },
- { "entactogens.com", true },
- { "enter.eco", true },
- { "entercenter.ru", true },
- { "entersoftsecurity.com", true },
- { "entertainmentblog.tk", true },
- { "entertainmentformitzvahs.com", true },
- { "entheogens.com", true },
- { "enthusiaformazione.com", true },
- { "entradaweb.cl", true },
- { "entrainr.com", true },
- { "entrecieletpierres.com", false },
- { "entrezdansladanse.fr", true },
- { "entropia.de", false },
- { "entropy.su", true },
- { "entrusted.io", true },
- { "entryboss.cc", true },
- { "entrypoint.sh", true },
- { "entwickler.land", true },
- { "enuchi.jp", true },
- { "enuygun.com", true },
- { "envant.co.uk", true },
- { "envescent.com", true },
- { "enviaya.com.mx", true },
- { "envide.no", true },
- { "enviro-umweltservice.de", true },
- { "enviroli.co.uk", true },
- { "enviroli.com", true },
- { "enviroli.org.uk", true },
- { "enviroli.uk", true },
- { "environmental-colleges.com", true },
- { "enviroprobasements.com", true },
- { "envman.io", true },
- { "envoie.moi", true },
- { "envoker.nl", true },
- { "envoyez.moi", true },
- { "enwikipedia.tk", true },
- { "enxadahost.com", true },
- { "enzoic.com", true },
- { "eocservices.co.uk", true },
- { "eoitek.com", true },
- { "eola.co", true },
- { "eon.tech", true },
- { "eonhive.com", true },
- { "eons.io", true },
- { "eooe.me", true },
- { "eoonglobalresources.jp", true },
- { "eopugetsound.org", false },
- { "eos-utvalget.no", true },
- { "eosol.de", true },
- { "eosol.net", true },
- { "eosolutions.co", true },
- { "ep-cortex.com", true },
- { "ep-plus.jp", true },
- { "epa.com.es", true },
- { "epagos.com.ar", true },
- { "epal.pt", true },
- { "epassafe.com", true },
- { "epawnatl.com", true },
- { "epay.bg", true },
- { "epcreport.net", true },
- { "epdeveloperchallenge.com", true },
- { "ephesusbreeze.com", true },
- { "epi-lichtblick.de", true },
- { "epi.one", false },
- { "epic-vistas.com", true },
- { "epic-vistas.de", true },
- { "epicbouncycastles.co.uk", true },
- { "epicdowney.com", true },
- { "epicentar.mk", true },
- { "epicenter.ga", true },
- { "epicenter.work", true },
- { "epicenter.works", true },
- { "epicentre.works", true },
- { "epicfail.be", true },
- { "epicginger.fi", true },
- { "epichouse.net", false },
- { "epicinflatables.co.uk", true },
- { "epickitty.co.uk", true },
- { "epiclub.com.au", true },
- { "epicpages.com", true },
- { "epicserver.ru", true },
- { "epicsoft.de", true },
- { "epicvistas.com", true },
- { "epicvistas.de", true },
- { "epicwalnutcreek.com", true },
- { "epidastudio.com", true },
- { "epidauros.be", true },
- { "epigrafes-led-farmakeia.gr", true },
- { "epikomagazine.com", true },
- { "epilepsiyle.com", true },
- { "epilis.gr", true },
- { "epinesdeparadis.com", true },
- { "epiphanyofourlordchurch.com", true },
- { "epiphyte.network", true },
- { "episkevh-plaketas.gr", true },
- { "epistas.com", true },
- { "epistas.de", true },
- { "epitesz.co", true },
- { "epiteugma.com", true },
- { "epitome.cc", true },
- { "epitome.games", true },
- { "epizentrum.work", true },
- { "epizentrum.works", true },
- { "epmcentroitalia.it", true },
- { "epolitiker.com", true },
- { "epos-distributor.co.uk", true },
- { "epos.az", true },
- { "eposbirmingham.co.uk", true },
- { "eposbrighton.co.uk", true },
- { "eposbristol.co.uk", true },
- { "eposcardiff.co.uk", true },
- { "eposig.net", true },
- { "eposkent.co.uk", true },
- { "eposleeds.co.uk", true },
- { "eposleicester.co.uk", true },
- { "eposliverpool.co.uk", true },
- { "eposlondon.co.uk", true },
- { "epossheffield.co.uk", true },
- { "eposswansea.co.uk", true },
- { "epostplus.li", true },
- { "eposyork.co.uk", true },
- { "eppelblei.lu", true },
- { "eppelduerferjugend.lu", true },
- { "eppelpress.lu", true },
- { "eppione.com", true },
- { "epreskripce.cz", true },
- { "eprezto.com", true },
- { "eprojectfreetv.com", true },
- { "epsilon.dk", true },
- { "epsmil.it", true },
- { "epspolymer.com", true },
- { "epublibre.org", true },
- { "epyonsuniverse.net", true },
- { "eq-serve.com", true },
- { "eqassociates.com", true },
- { "eqibank.com", true },
- { "eqiware.com", true },
- { "equabanking.cz", true },
- { "equalcloud.com", true },
- { "equidam.com", true },
- { "equifaxobjection.com", true },
- { "equinecoaching.ca", true },
- { "equinetherapy.ca", true },
- { "equinox.io", true },
- { "equipandoloja.net.br", true },
- { "equipedefrance.tv", false },
- { "equipoweb.info", true },
- { "equisecu.com", true },
- { "equk.co.uk", true },
- { "er-mgmt.com", true },
- { "er.tl", true },
- { "er1s.xyz", true },
- { "era.fi", true },
- { "eradoom.net", true },
- { "erasmo.info", true },
- { "erasmusplusrooms.com", true },
- { "erasure.tk", true },
- { "erate.fi", true },
- { "erath.fr", false },
- { "erdethamburgeronsdag.no", true },
- { "erektion1.gq", true },
- { "erethon.com", true },
- { "erf-neuilly.com", true },
- { "erfolgsmaschine.ch", true },
- { "ergo-open.de", true },
- { "ergobyte.eu", true },
- { "ergobyte.gr", true },
- { "ergodark.com", true },
- { "ergonova.fr", true },
- { "ergoterapeutas.lt", true },
- { "ergovita.com.br", true },
- { "ericabrahamsen.net", true },
- { "ericairwin.com", true },
- { "ericdiao.com", true },
- { "erichoekstra.com", true },
- { "erichoekstra.nl", true },
- { "erichogue.ca", true },
- { "erichorstmanshof.nl", true },
- { "ericjohnltd.com", true },
- { "erick.blog", true },
- { "ericksonvasquez.com", true },
- { "ericleuthardt.com", true },
- { "ericoc.com", true },
- { "erics.site", true },
- { "ericsilva.org", true },
- { "ericspeidel.de", true },
- { "ericvaughn-flam.com", true },
- { "eridanus.uk", true },
- { "eridas.ml", true },
- { "erigrid.eu", true },
- { "eriix.org", true },
- { "erik-stomp.de", true },
- { "erikapsicologia.com", true },
- { "erikatanithphotography.co.uk", true },
- { "erikheemskerk.nl", true },
- { "erikhubers.nl", true },
- { "erikkruithof.nl", true },
- { "erikseth.de", true },
- { "erikwalther.eu", true },
- { "erinaceinae.com", true },
- { "eringmaguire.com", true },
- { "erinn.io", true },
- { "erisrenee.com", true },
- { "eristajanmutka.com", true },
- { "erisys.net", true },
- { "erkaelderbarenaaben.dk", true },
- { "erkenntniswen.de", true },
- { "erkiss.live", true },
- { "erlebnisarchaeologie-bayern.de", true },
- { "ermessecurity.com", true },
- { "ernal.net", true },
- { "ernearmetx.com", true },
- { "ernest.ly", true },
- { "ero-video.net", true },
- { "ero.ink", false },
- { "erodvd.com", false },
- { "eromon.net", true },
- { "eron.info", true },
- { "eropics.org", true },
- { "erp-band.ru", true },
- { "erp.band", true },
- { "erpax.com", true },
- { "erpband.ru", true },
- { "erpcargo.com", false },
- { "erpelstolz.at", true },
- { "erperium.nl", true },
- { "errietta.me", true },
- { "errolstambler.com", true },
- { "error.fail", true },
- { "error418.nl", true },
- { "errortools.com", true },
- { "ers35.com", true },
- { "ersa-shop.com", true },
- { "ershiwo.com", true },
- { "ersinbiltekin.tk", true },
- { "ersinerce.com", true },
- { "erstehilfeprodukte.at", true },
- { "ert.ovh", true },
- { "erty.stream", true },
- { "eru.im", false },
- { "eru.moe", true },
- { "erudicia.com", true },
- { "erudicia.de", true },
- { "erudicia.es", true },
- { "erudicia.fr", true },
- { "erudicia.it", true },
- { "erudicia.nl", true },
- { "erudicia.se", true },
- { "erudicia.uk", true },
- { "erudikum.cz", true },
- { "eruga.es", true },
- { "ervaarjapan.nl", true },
- { "ervinthagod.xyz", true },
- { "erwanlepape.com", true },
- { "erwin.saarland", true },
- { "erwinpaal.nl", true },
- { "erwinschmaeh.ch", true },
- { "erwinwensveen.nl", true },
- { "erythroxylum-coca.com", true },
- { "es-geenen.de", true },
- { "es-tools.at", true },
- { "es-tools.com", true },
- { "es-tools.de", true },
- { "es-trade.biz", true },
- { "es.search.yahoo.com", false },
- { "esagente.com", true },
- { "esalesclub.com", true },
- { "esalesdata.com", true },
- { "esamievalori.com", true },
- { "esample.info", true },
- { "esb9588.info", true },
- { "esc.chat", true },
- { "esc.gov", true },
- { "escael.org", true },
- { "escandille.com", true },
- { "escapeforyou.com", true },
- { "escapeplaza.de", true },
- { "escaperoomdoctor.com", true },
- { "escaperoomsolutions.com", true },
- { "escapetalk.nl", true },
- { "escavador.com", true },
- { "esclear.de", true },
- { "escobarservice7000.com", true },
- { "escontact.ch", false },
- { "escortbee.com", true },
- { "escortbruxelles.be", true },
- { "escortgigolo.com", true },
- { "escortlareryaman.com", true },
- { "escortlistings.ca", true },
- { "escortlistings.mx", true },
- { "escortlistings.ph", true },
- { "escortsforu.com", true },
- { "escortslittleblackbook.com", true },
- { "escovator-records.tk", true },
- { "escritoriodearte.com", false },
- { "escuelabiblica.com", true },
- { "escyr.top", true },
- { "esdacademy.eu", false },
- { "esdenera.com", true },
- { "esdiscuss.org", true },
- { "esdvfootloose.nl", true },
- { "eseances.ch", true },
- { "esehospitalsabanagrande.com", true },
- { "eservices-greece.com", true },
- { "eseth.de", true },
- { "esfahanahan.com", true },
- { "esfiledecrypter.com", true },
- { "esg-abi2001.de", true },
- { "esgen.org", true },
- { "esgr.in", true },
- { "esh.ink", true },
- { "esher.ac.uk", true },
- { "eshigami.com", true },
- { "eshop-prices.com", true },
- { "eshspotatoes.com", true },
- { "esigmbh.de", true },
- { "esigtorg.ru", true },
- { "esim.cz", true },
- { "esite.ch", true },
- { "eskapi.fr", true },
- { "eskdale.net", true },
- { "eskriett.com", false },
- { "eslint.org", false },
- { "esmart.ru", true },
- { "esmejor.tk", true },
- { "esoa.net", true },
- { "esoko.eu", true },
- { "esolcourses.com", true },
- { "esolitos.com", true },
- { "eson.eu", true },
- { "esono.de", true },
- { "esoteric.website", true },
- { "esoterikerforum.de", true },
- { "esovita.de", true },
- { "espace-caen.fr", false },
- { "espace-gestion.fr", true },
- { "espace-habitat-francais.fr", true },
- { "espace.network", true },
- { "espacelanguetokyo.fr", true },
- { "espacetemps.ch", true },
- { "espacetheosophie.fr", true },
- { "espacio-cultural.com", true },
- { "espaciosdelalma.com", true },
- { "espacobebecia.com.br", true },
- { "espanol.search.yahoo.com", false },
- { "espci.fr", true },
- { "especialistagoogleadwords.com.br", true },
- { "especificosba.com.ar", true },
- { "espehus.dk", true },
- { "esperantio.tk", true },
- { "espgg.org", true },
- { "espherapromocional.com.br", true },
- { "espigol.org", true },
- { "espiritugay.com", true },
- { "esport-agency.fr", true },
- { "esport-battlefield.com", true },
- { "espower.com.sg", true },
- { "espritrait.com", false },
- { "espyder.net", true },
- { "esquirou-trieves.fr", false },
- { "esrhd.com", true },
- { "esrinfo.com", true },
- { "esroradio.com", true },
- { "essay-writing-topics-fce.tk", true },
- { "essayace.co.uk", true },
- { "essaybrand.com", true },
- { "essaychecker.com", true },
- { "essaydirectory.com", false },
- { "essayforsale.net", true },
- { "essayforum.com", false },
- { "essayhave.com", true },
- { "essayjob.com", true },
- { "essaylib.com", true },
- { "essaymaker.gq", true },
- { "essaynews.com", true },
- { "essaypro.net", true },
- { "essays.me", true },
- { "essayscam.org", false },
- { "essayshark.com", true },
- { "essaytalk.com", true },
- { "essaywriting.biz", true },
- { "essenalablog.de", true },
- { "essencespresso.es", true },
- { "essenerbaeder.de", true },
- { "essex.cc", true },
- { "essextimbercraft.co.uk", true },
- { "essite.net", true },
- { "esslm.sk", true },
- { "essoduke.org", true },
- { "essteebee.ch", false },
- { "est-it.de", true },
- { "est-keyman.de", true },
- { "estada.ch", true },
- { "estadoreclamos.com", true },
- { "estafallando.es", true },
- { "estafallando.mx", true },
- { "estahl.dk", true },
- { "estaleiro.org", true },
- { "estaryshop.com.br", true },
- { "estcequejailaflemme.fr", false },
- { "estcequonmetenprodaujourdhui.info", true },
- { "esteam.se", true },
- { "estedafah.com", true },
- { "estefan.dyndns.org", true },
- { "estela-artes.com", true },
- { "esteladigital.com", true },
- { "esteriliza-me.org", true },
- { "esterilizacion-perros.es", true },
- { "esteticanorte.com.br", true },
- { "estetici.com", true },
- { "estetista.net", true },
- { "esthe-zukan.com", true },
- { "estherlew.is", true },
- { "esthernariyoshi.com", true },
- { "estilopack-loja.com.br", true },
- { "estimulantesbrasil.com", true },
- { "estintori.roma.it", true },
- { "estoic.net", true },
- { "estonoentraenelexamen.com", true },
- { "estoppels.com", true },
- { "estraks.com", true },
- { "estudiarparaser.com", true },
- { "estudiaryaprenderingles.com", true },
- { "estudiogarcia-rada.com", true },
- { "estufitas.com", true },
- { "esu.moe", true },
- { "esuretynew.azurewebsites.net", true },
- { "esyoil.com", true },
- { "et-inf.de", true },
- { "eta.cz", true },
- { "etaes.eu", true },
- { "etajerka-spb.ru", true },
- { "etajerka.spb.ru", true },
- { "etalktome.com", true },
- { "etaoinwu.com", true },
- { "etaoinwu.win", true },
- { "etasigmaphi.org", true },
- { "etath.com", true },
- { "etax.com.au", true },
- { "etaxigraz.com", true },
- { "etccooperative.org", true },
- { "etch.co", true },
- { "etda.or.th", true },
- { "etduvindemoselle.fr", true },
- { "etech-solution.com", true },
- { "etech-solution.net", true },
- { "etech-solutions.com", true },
- { "etechsolution.net", true },
- { "eteesheet.com", true },
- { "eternal-warriors.de", true },
- { "eternalabyss.int.eu.org", true },
- { "eternalflame.info", true },
- { "eternalparking.com", true },
- { "eternalparking.eu", true },
- { "eternalparking.net", true },
- { "eternalparking.org", true },
- { "eternalsymbols.com", true },
- { "eternit.roma.it", true },
- { "eth0.nl", true },
- { "eth1.fi", true },
- { "etha.nz", true },
- { "ethack.org", true },
- { "ethanchin.com", false },
- { "ethanjones.me", true },
- { "ethanlew.is", true },
- { "ethelbrooks.com", true },
- { "ethelbrooks.es", true },
- { "ethercalc.org", true },
- { "etherpad.nl", true },
- { "ethers.news", true },
- { "ethicalconsumer.org", true },
- { "ethicaldata.co.uk", true },
- { "ethicalpolitics.org", true },
- { "ethicsburg.gov", true },
- { "ethika.com", true },
- { "ethil-faer.fr", true },
- { "ethiobaba.com", true },
- { "ethiopian.dating", true },
- { "ethitter.com", true },
- { "etienne.cc", true },
- { "etiennes.work", true },
- { "etiquetaunica.com.br", true },
- { "etna.com.br", true },
- { "etni-cidade.net", true },
- { "etnoria.com", true },
- { "etoile-usedcars.com", false },
- { "etre-soi.ch", false },
- { "etre-vivant.fr", false },
- { "etrecosmeticderm.com", true },
- { "etresmant.es", true },
- { "etrker.com", true },
- { "ets2mp.de", true },
- { "etskinner.com", true },
- { "etskinner.net", true },
- { "etudesbibliques.fr", false },
- { "etudesbibliques.net", false },
- { "etudesbibliques.org", false },
- { "eturist.si", true },
- { "etv.cx", true },
- { "etwalldentalpractice.co.uk", true },
- { "etyd.org", true },
- { "eu-darlehen-finanzierung.de", true },
- { "eu-datenbank.de", true },
- { "eu-gamers.com", true },
- { "eu-stellenangebot.de", true },
- { "euanbarrett.com", true },
- { "euc.world", true },
- { "euchre.us", true },
- { "eugenekay.com", true },
- { "eugenetech.org", true },
- { "eugeniocorso.com", true },
- { "eujuicers.bg", true },
- { "eujuicers.com", true },
- { "eujuicers.com.hr", true },
- { "eujuicers.com.ua", true },
- { "eujuicers.cz", true },
- { "eujuicers.de", true },
- { "eujuicers.es", true },
- { "eujuicers.fr", true },
- { "eujuicers.hu", true },
- { "eujuicers.it", true },
- { "eujuicers.pl", true },
- { "eujuicers.pt", true },
- { "eujuicers.ro", true },
- { "eujuicers.rs", true },
- { "eujuicers.ru", true },
- { "eujuicers.si", true },
- { "eujuicers.sk", true },
- { "eulenschmiede.de", true },
- { "eulessplumbers.com", true },
- { "euman.ml", true },
- { "eumr.org", true },
- { "euporos.ch", true },
- { "eureka.archi", true },
- { "euro-construction.co.uk", true },
- { "euroalter.com", true },
- { "eurocars2000.es", true },
- { "eurocenterobuda.hu", true },
- { "eurocertificazione.it", true },
- { "eurocomcompany.cz", true },
- { "euroconthr.ro", true },
- { "eurodentaire.com", true },
- { "euroexpres.info", true },
- { "euroflora.com", true },
- { "euroflora.mobi", true },
- { "eurofrank.eu", true },
- { "eurogarden-parts.de", true },
- { "eurogarden.be", true },
- { "eurogarden.nl", true },
- { "eurolocarno.es", true },
- { "euronic.fi", true },
- { "euroonline.org", true },
- { "europa.jobs", true },
- { "europainchemnitz.de", true },
- { "europalettenkaufen.de", true },
- { "europareise2010.de", true },
- { "europarts-sd.com", true },
- { "europastudien-chemnitz.de", true },
- { "europastudien.de", true },
- { "european-agency.org", true },
- { "european-hospital.ga", true },
- { "european-hospital.ml", true },
- { "european-hospital.tk", true },
- { "europeancupinline.eu", true },
- { "europeanstudies-chemnitz.de", true },
- { "europeantimberconnectors.ca", true },
- { "europeanwineresource.com", true },
- { "europeos.es", true },
- { "europetravelservice.co.uk", true },
- { "europop.com", true },
- { "eurora.de", true },
- { "eurorecambios24.com", true },
- { "euroroad17.dk", true },
- { "euroscot.de", true },
- { "euroshop.or.at", true },
- { "euroshop.tk", true },
- { "euroskano.nl", true },
- { "eurotop.net.pl", true },
- { "eurotramp.com", true },
- { "eurousa.us", true },
- { "eurovision.ie", true },
- { "eurowaage.de", true },
- { "eusarse.tk", true },
- { "eusolar.cloud", true },
- { "euterpiaradio.ch", true },
- { "eutiximo.com", true },
- { "eutotal.com", true },
- { "euwid-energie.de", true },
- { "euwid.de", true },
- { "ev-zertifikate.de", true },
- { "eva-briegel-fanpage.tk", true },
- { "eva-select.com", true },
- { "eva.cz", true },
- { "evaalordiah.tk", true },
- { "evadental.institute", true },
- { "evafojtova.cz", true },
- { "evailoil.ee", true },
- { "evailoil.eu", true },
- { "evamachkova.cz", true },
- { "evamathil.de", true },
- { "evamira.com", true },
- { "evanfiddes.com", true },
- { "evangelicalmagazine.com", true },
- { "evangelosm.com", true },
- { "evansdesignstudio.com", false },
- { "evanwang0.com", true },
- { "evasioncreole.com", true },
- { "evasovova.cz", true },
- { "evavolfova.cz", true },
- { "evdenevenakliyatankara.name.tr", true },
- { "eve-online-com.ru", true },
- { "eve-raynon.fr", true },
- { "eve-ua.com", true },
- { "eveadmin.azurewebsites.net", false },
- { "evearly.com", true },
- { "eveil-et-savoirs.com", true },
- { "evelienzorgt.nl", true },
- { "evelyndayman.com", true },
- { "evenementenhoekvanholland.nl", true },
- { "event-blick.de", true },
- { "event-fullyyours.com", true },
- { "event4fun.no", true },
- { "eventaro.com", true },
- { "eventblog2017.tk", true },
- { "eventerlebnis.ch", true },
- { "eventide.space", true },
- { "eventim-business.com", true },
- { "eventim-business.de", true },
- { "eventive.org", true },
- { "eventnexus.co.uk", true },
- { "eventosbgp.com", true },
- { "eventosenmendoza.com.ar", true },
- { "eventosformativos.tk", true },
- { "eventprazdnik.ru", true },
- { "events-hire.co.uk", true },
- { "eventservicestockholm.se", true },
- { "eventsframe.com", true },
- { "eventtech.com", false },
- { "evenwallet.com", true },
- { "eveonline.com", true },
- { "ever.sale", true },
- { "everain.me", true },
- { "everberg.tk", true },
- { "everettsautorepair.com", true },
- { "everfine.com.tw", true },
- { "evergladesrestoration.gov", true },
- { "everglow.co.jp", true },
- { "everglowtrading.com", true },
- { "evergreenmichigan.com", true },
- { "everhome.de", true },
- { "everichspice.com", false },
- { "everify.gov", true },
- { "everling.lu", true },
- { "everlong.org", true },
- { "evermarkstudios.com", true },
- { "evernaut.com", true },
- { "everpcpc.com", true },
- { "evertonarentwe.com", true },
- { "everwaking.com", false },
- { "every-day-life.com", false },
- { "everyday.eu.org", true },
- { "everydaylatestnews.com", true },
- { "everyfad.com", true },
- { "everykidoutdoors.gov", false },
- { "everything-everywhere.com", true },
- { "everythingaccess.com", true },
- { "everythingstech.com", true },
- { "everytrycounts.gov", false },
- { "eveshamglass.co.uk", true },
- { "eveswell.com", true },
- { "evexia.xyz", true },
- { "eviction.cf", true },
- { "evidence-based.review", true },
- { "evidencebased.net", true },
- { "evidenceusa.com.br", true },
- { "evidencija.ba", true },
- { "evileden.com", true },
- { "evilla.ru", false },
- { "evilmartians.com", true },
- { "evilnerd.de", true },
- { "evion.nl", true },
- { "evisa.us.com", true },
- { "evlear.com", true },
- { "evlorin.com", true },
- { "evnt.team", true },
- { "evntage.com", true },
- { "evoco.vc", true },
- { "evodation.com", true },
- { "evodation.org", true },
- { "evodia-spirits.de", true },
- { "evohomecare.com", true },
- { "evok.com.co", false },
- { "evolutioninflatables.co.uk", true },
- { "evolutionlending.co.uk", true },
- { "evolutionpets.com", true },
- { "evolvetechnologies.co.uk", true },
- { "evolvingsouls.com", true },
- { "evolvingthoughts.net", true },
- { "evomada.com", true },
- { "evomon.com", true },
- { "evony.eu", true },
- { "evosyn.com", true },
- { "evotec.pl", true },
- { "evotec.xyz", true },
- { "evoting-test.ch", false },
- { "evoting.ch", true },
- { "evowrap.co.uk", true },
- { "evpro.lt", true },
- { "evrial.com", true },
- { "evrica.me", true },
- { "evromandie.ch", true },
- { "evrotrust.com", true },
- { "evsinemasistemleri.tk", true },
- { "evstatus.com", true },
- { "evtasima.name.tr", true },
- { "evthing.se", true },
- { "evtripping.com", true },
- { "evtscan.io", true },
- { "evyn.eu", true },
- { "ewa-hayward.co.uk", true },
- { "ewaipiotr.pl", true },
- { "ewanm89.co.uk", true },
- { "ewanm89.com", true },
- { "ewanm89.uk", true },
- { "ewar.lt", false },
- { "ewc.co.jp", true },
- { "ewcd.co.jp", true },
- { "ewe2.ninja", true },
- { "ewhitehat.com", true },
- { "ewie.name", true },
- { "ewinstore.com", true },
- { "ewritingservice.com", true },
- { "ewsfeed.com", true },
- { "ewtl.es", true },
- { "ewus.de", true },
- { "ex-deli.jp", true },
- { "exablue.de", true },
- { "exactlyinfinite.com", true },
- { "exactphilosophy.net", true },
- { "exadime.net", true },
- { "exagoni.com.au", true },
- { "exagoni.com.my", true },
- { "examedge.com", true },
- { "examika.ru", true },
- { "example.eu.org", true },
- { "exampleessays.com", true },
- { "exams9.com", true },
- { "examsite.tk", true },
- { "examticket.tk", true },
- { "exaplac.com", true },
- { "exarpy.com", true },
- { "exatmiseis.net", false },
- { "exbolivo.com", true },
- { "excaliburtitle.com", false },
- { "exceed.global", true },
- { "exceedagency.com", true },
- { "excel-mechanical.com", true },
- { "excel-utbildning.nu", true },
- { "excelkurs.one", true },
- { "excelkursdirekt.eu", true },
- { "excella.me", true },
- { "excellence-eventos.com", true },
- { "excelsiorcomics.com.br", true },
- { "exceltechdubai.com", true },
- { "exceltechoman.com", true },
- { "excentos.com", true },
- { "excerp.tech", true },
- { "excess-baggage.com", true },
- { "excessamerica.com", true },
- { "excesssecurity.com", true },
- { "exchangers.top", true },
- { "exchaser.com", true },
- { "excitoninteractive.com", true },
- { "exclusivebeautystudio.com.au", true },
- { "exclusivebouncycastles.co.uk", true },
- { "exclusivecarcare.co.uk", true },
- { "excursionescaribe.com", true },
- { "exdamo.de", true },
- { "exe-boss.tech", true },
- { "execbar.com", true },
- { "exechip.com", true },
- { "execution.biz.tr", true },
- { "executiveresolutions.co.uk", true },
- { "exegese.ch", true },
- { "exeintel.com", true },
- { "exekutori.com", true },
- { "exemples-de-stands.com", true },
- { "exerforge.com", true },
- { "exeria.de", true },
- { "exexcarriers.com", true },
- { "exeye.io", true },
- { "exgaywatch.com", true },
- { "exgen.io", true },
- { "exhibityour.com", true },
- { "exiahost.com", true },
- { "existest.com", true },
- { "exit9wineandliquor.com", true },
- { "exitooutdoor.com", true },
- { "exl-english.com", true },
- { "exmart.ng", true },
- { "exmoe.com", true },
- { "exocen.com", true },
- { "exodiac.ph", true },
- { "exon.io", true },
- { "exordiumconcepts.com", true },
- { "exoscale.ch", true },
- { "exoscale.com", true },
- { "exoten-spezialist.de", true },
- { "exoticads.com", true },
- { "exoticaz.to", true },
- { "exozwiki.com", false },
- { "exp.de", true },
- { "expancio.com", false },
- { "expanddigital.media", true },
- { "expandeco.com", true },
- { "expatfinancial.com.hk", true },
- { "expatfire.com", true },
- { "expatmortgage.uk", true },
- { "expe.voyage", true },
- { "expeditiegrensland.nl", true },
- { "experienceoutdoors.org.uk", true },
- { "experienceoz.com.au", true },
- { "experimentator.cz", true },
- { "experise.fr", true },
- { "expert-korovin.ru", true },
- { "expert-voronezh.tk", true },
- { "expert.cz", true },
- { "experteasy.com.au", true },
- { "expertisematrix.com", true },
- { "expertofficefitouts.com.au", true },
- { "expertpaintersvt.com", true },
- { "expertpanel.gc.ca", true },
- { "expertplumbingandsolarservicesbathurst.com.au", true },
- { "expertsverts.com", true },
- { "expertvagabond.com", true },
- { "expertviolinteacher.com", true },
- { "expicore.com", true },
- { "expii.com", true },
- { "expiscor.solutions", true },
- { "explicate.org", true },
- { "explodie.org", true },
- { "explodingcamera.com", true },
- { "exploit-db.com", true },
- { "exploit.cz", true },
- { "exploit.party", true },
- { "exploit.ph", true },
- { "exploited.cz", true },
- { "exploithe.net", true },
- { "exploitit.com.au", true },
- { "exploodo.rocks", true },
- { "explorebigideas.com", true },
- { "exploredouglascountyga.com", true },
- { "exploremonero.com", true },
- { "exploretsp.gov", true },
- { "exploringmorocco.tours", true },
- { "expmind.co.in", true },
- { "expo-america.ru", true },
- { "expo-asia.ru", true },
- { "expo-europe.ru", true },
- { "expo-larionov.org", true },
- { "exponentialnews.net", true },
- { "expoort.com", true },
- { "expoort.es", true },
- { "expoort.fr", true },
- { "expoort.it", true },
- { "expopodium.com", true },
- { "exporta.cz", true },
- { "exposurecompensation.co.uk", true },
- { "expouniverse.tk", true },
- { "express-shina.ru", true },
- { "express-vpn.com", true },
- { "express-vyvoz.ru", true },
- { "express1040.com", true },
- { "expressemotion.net", true },
- { "expresshosting.org", true },
- { "expressmarket.ru", true },
- { "expresstinte.de", true },
- { "expressvpn.com", true },
- { "expromo.eu", true },
- { "expxkcd.com", true },
- { "exs.lv", true },
- { "exsanio.de", true },
- { "exside.com", true },
- { "exsora.com", true },
- { "extasic.com", true },
- { "extensia.it", true },
- { "extensibility.biz.tr", true },
- { "extensiblewebmanifesto.org", true },
- { "extensiblewebsummit.org", true },
- { "extensionciglia.roma.it", true },
- { "extensionschallenge.com", true },
- { "extensiontree.com", true },
- { "exteriorlightingagoura.com", true },
- { "exteriorlightingagourahills.com", true },
- { "exteriorlightingcalabasas.com", true },
- { "exteriorlightingcamarillo.com", true },
- { "exteriorlightingconejovalley.com", true },
- { "exteriorlightingdosvientos.com", true },
- { "exteriorlightinghiddenhills.com", true },
- { "exteriorlightinglakesherwood.com", true },
- { "exteriorlightingmalibu.com", true },
- { "exteriorlightingmoorpark.com", true },
- { "exteriorlightingnewburypark.com", true },
- { "exteriorlightingoakpark.com", true },
- { "exteriorlightingsimivalley.com", true },
- { "exteriorlightingthousandoaks.com", true },
- { "exteriorlightingwestlakevillage.com", true },
- { "extinctionrebellion.de", true },
- { "extintormadrid.com", true },
- { "extmatrix.com", false },
- { "extradesktops.com", false },
- { "extradiely.sk", true },
- { "extradivers-worldwide.com", true },
- { "extratorrent.cool", true },
- { "extrawdw.net", true },
- { "extreemhost.nl", true },
- { "extreme-gaming.de", true },
- { "extreme-gaming.us", true },
- { "extreme-players.com", true },
- { "extreme-players.de", true },
- { "extreme.co.th", true },
- { "exvs.org", true },
- { "exxpozed-image.de", true },
- { "exxpozed.ch", true },
- { "exxpozed.co.uk", true },
- { "exxpozed.com", true },
- { "exxpozed.de", true },
- { "exxpozed.eu", true },
- { "exxvip.com", true },
- { "exyplis.com", true },
- { "eyal-dvorkin.com", true },
- { "eye-encounters.com", true },
- { "eyebrowsmicroblading.co.uk", true },
- { "eyecandy.gr", true },
- { "eyedesignuniversity.com", true },
- { "eyeglasses.com", false },
- { "eyelashconcept.com", true },
- { "eyeonid.com", true },
- { "eyep.me", true },
- { "eyes-berg.ch", false },
- { "eyes-berg.com", false },
- { "eyesandearsrescue.org", true },
- { "eyetooth.ga", true },
- { "eynio.com", true },
- { "eyona.com", true },
- { "eyps.net", true },
- { "eyrelles-tissus.com", true },
- { "eythorsson.com", true },
- { "ez3d.eu", true },
- { "ezakazivanje.rs", true },
- { "ezdog.press", true },
- { "ezequiel-garzon.net", false },
- { "ezesec.com", true },
- { "ezftrs.com", true },
- { "ezgamble.com", true },
- { "ezgif.com", true },
- { "ezhik-din.ru", true },
- { "ezik-ido.tk", true },
- { "eziwine.com", true },
- { "eznetworks.com.br", true },
- { "eztvtorrent.com", true },
- { "ezwritingservice.com", true },
- { "f-droid.org", true },
- { "f-hd.net", true },
- { "f-thie.de", true },
- { "f-u-c-k.wien", true },
- { "f00.fr", true },
- { "f00f.org", true },
- { "f0x.es", true },
- { "f1318.com", false },
- { "f1318.net", false },
- { "f13cybertech.cz", true },
- { "f1classement.com", false },
- { "f1distribution.com", true },
- { "f1fever.co.uk", true },
- { "f1fever.net", true },
- { "f1minute.com", true },
- { "f1nal-lap.be", true },
- { "f2h.io", true },
- { "f36533.com", true },
- { "f36594.com", true },
- { "f3nws.com", true },
- { "f43.me", true },
- { "f51365.com", true },
- { "f5la.com", true },
- { "f5nu.com", true },
- { "f8003.com", true },
- { "f8007.com", true },
- { "f8036.com", true },
- { "f81818.com", true },
- { "f88-line.com", true },
- { "f88-line.net", true },
- { "f88288.com", true },
- { "f88da.com", true },
- { "f88fine.com", true },
- { "f88good.com", true },
- { "f88line.com", true },
- { "f88line.net", true },
- { "f88ll.com", true },
- { "f88qin.com", true },
- { "f88vip102.com", true },
- { "f88vip103.com", true },
- { "f88vip104.com", true },
- { "f88vip105.com", true },
- { "f88vip106.com", true },
- { "f88vip19.com", true },
- { "f88vip2.com", true },
- { "f88vip20.com", true },
- { "f88vip21.com", true },
- { "f88vip22.com", true },
- { "f88vip23.com", true },
- { "f88vip3.com", true },
- { "f88vip4.com", true },
- { "f88vip5.com", true },
- { "f88vip6.com", true },
- { "f88yule1.com", true },
- { "f88yule111.com", true },
- { "f88yule122.com", true },
- { "f88yule3.com", true },
- { "f88yule5.com", true },
- { "f88yule6.com", true },
- { "f88yule7.com", true },
- { "f88yule8.com", true },
- { "f88yule9.com", true },
- { "f8908.com", true },
- { "f8921.com", true },
- { "f8cp0.com", true },
- { "f8cp1.com", true },
- { "f8cp2.com", true },
- { "f8cp3.com", true },
- { "f8cp4.com", true },
- { "f8cp5.com", true },
- { "f8cp6.com", true },
- { "f8cp7.com", true },
- { "f8cp9.com", true },
- { "f8s.co", true },
- { "f9marketing.com", true },
- { "fa-works.com", true },
- { "fa158k.com", true },
- { "fabbro-roma.org", true },
- { "fabbro.roma.it", true },
- { "faber.org.ru", true },
- { "fabian-fingerle.de", true },
- { "fabian-klose.com", true },
- { "fabian-klose.de", true },
- { "fabian-klose.net", true },
- { "fabianackle.ch", true },
- { "fabianbeiner.com", true },
- { "fabianbeiner.de", false },
- { "fabianegli.ch", true },
- { "fabianfranke.de", true },
- { "fabiankoeppen.com", true },
- { "fabien-hebuterne.fr", true },
- { "fabienne-roux.org", true },
- { "fabiobier.com", true },
- { "fabiocicerchia.it", true },
- { "fabjansisters.eu", true },
- { "fabled.com", true },
- { "fableforge.nl", true },
- { "fabriceleroux.com", false },
- { "fabrika.com.br", true },
- { "fabriziocavaliere.it", true },
- { "fabriziorocca.it", true },
- { "fabrysociety.org", true },
- { "fabse.net", true },
- { "fabservicos.com.br", true },
- { "fabslabour.uk", true },
- { "fabulosa.com.br", true },
- { "faca.gov", true },
- { "facai666.cc", true },
- { "facai888.cc", true },
- { "facanabota.com", true },
- { "facanabota.com.br", true },
- { "facarospauls.com", true },
- { "facchinaggio.milano.it", true },
- { "facchinaggio.roma.it", true },
- { "facciadastile.it", true },
- { "face-fashion.de", true },
- { "face-mania.com", true },
- { "facealacrise.fr", true },
- { "facebook-atom.appspot.com", true },
- { "facebook.com", false },
- { "facebydrh.com", true },
- { "facebylouise.co.uk", true },
- { "facedack.com", true },
- { "facekungfu.com", true },
- { "facemd.net", true },
- { "facepainting.gr", true },
- { "faceresources.org", true },
- { "facesdr.com", true },
- { "fach-journalist.de", true },
- { "fachmann-umzuege.de", true },
- { "fachschaftslisten.at", true },
- { "fachschaftslisten.org", true },
- { "fachversand-hennes.de", true },
- { "facialexercising.com", true },
- { "facil.services", false },
- { "faciledireto.com.br", true },
- { "facilities.fr", true },
- { "facilitiessurvey.org", true },
- { "facility-service-muenchen.de", true },
- { "facingbipolar.com", false },
- { "fackovec.cz", true },
- { "factbytefactbox.com", true },
- { "factor.cc", false },
- { "factorio.tools", true },
- { "factoriotools.com", true },
- { "factoriotools.net", true },
- { "factoriotools.org", true },
- { "factorit.fr", true },
- { "factory-f.net", true },
- { "factslider.tk", true },
- { "facturama.pt", true },
- { "factuur.pro", true },
- { "factuursturen.be", true },
- { "factuursturen.nl", true },
- { "factys.es", true },
- { "facua.org", true },
- { "facucosta.com.ar", true },
- { "faderweb.de", true },
- { "fadilus.com", true },
- { "fady.vn", true },
- { "faehler.de", true },
- { "faelix.net", true },
- { "faeservice.eu", true },
- { "fafa018.com", true },
- { "fafa066.com", true },
- { "fafa106.com", true },
- { "faggut.gg", true },
- { "fahmed.de", true },
- { "fahrenwal.de", false },
- { "fahrenwalde.de", false },
- { "fahrschule-laux.de", true },
- { "fahrwerk.io", true },
- { "fai.gov", false },
- { "faidanoi.it", true },
- { "faidatefacile.it", true },
- { "failforward.tech", true },
- { "failover.de", true },
- { "failover.eu", true },
- { "failoverplan.it", true },
- { "fairbairnrealty.com", true },
- { "fairbill.com", true },
- { "fairedeseconomies.info", true },
- { "fairgaming.ml", true },
- { "fairgolfteams.com", true },
- { "fairgreenlimited.com", true },
- { "fairleighcrafty.com", true },
- { "fairmarketing.com", true },
- { "fairplay.im", true },
- { "fairr.de", true },
- { "fairr.online", true },
- { "fairssl.dk", true },
- { "fairssl.se", true },
- { "fairviewmotel-simcoe.com", true },
- { "fairydust.space", true },
- { "fairyth.tk", true },
- { "faithcentercogop.net", true },
- { "faithgrowth.com", true },
- { "faithindemocracy.eu", false },
- { "faithleaks.org", true },
- { "faithwatch.org", true },
- { "faixaazul.com", true },
- { "faizan.net", true },
- { "faizan.xyz", true },
- { "faizanullah.com", true },
- { "fake-show.ga", true },
- { "fakeduckpond.com", true },
- { "fakeemergency.com", true },
- { "fakerli.com", true },
- { "fakes-ru.tk", true },
- { "fakt.tk", true },
- { "fakti.bg", true },
- { "faktotum.tech", true },
- { "fakturi.com", true },
- { "fakturoid.cz", true },
- { "falaeapp.org", true },
- { "falaowang.com", true },
- { "falasteenjobs.com", true },
- { "falbros.com", true },
- { "falcema.com", true },
- { "falconfrag.com", true },
- { "falconvintners.com", true },
- { "falcoz.co", true },
- { "faldoria.de", true },
- { "falegname-roma.it", true },
- { "falegname.roma.it", true },
- { "falegnameria.milano.it", true },
- { "fall.ga", true },
- { "fallenangeldrinks.co.uk", true },
- { "fallenangeldrinks.com", true },
- { "fallenangelspirits.co.uk", true },
- { "fallenangelspirits.com", true },
- { "fallenmoons.nl", true },
- { "fallenmystic.com", true },
- { "fallin.space", true },
- { "falling.se", true },
- { "fallofthecitadel.com", true },
- { "falsterhus.de", true },
- { "falsterhus.dk", true },
- { "falsum.net", true },
- { "fam-borsch.de", true },
- { "fam-kreibich.de", true },
- { "fam-stemmer.de", false },
- { "fam-weyer.de", true },
- { "famcloud.de", true },
- { "fameng.nl", true },
- { "fameus.fr", true },
- { "familiaperez.net", false },
- { "familie-keil.de", true },
- { "familie-kruithof.nl", true },
- { "familie-kupschke.de", true },
- { "familie-leu.ch", true },
- { "familie-monka.de", true },
- { "familie-poeppinghaus.de", true },
- { "familie-remke.de", true },
- { "familie-sprink.de", false },
- { "familiearchivaris.nl", true },
- { "familieholme.de", true },
- { "familienportal.de", true },
- { "familiereimann.com", true },
- { "familjenfrodlund.se", true },
- { "familjenm.se", true },
- { "familleseux.net", true },
- { "familleshilton.com", true },
- { "familylawhotline.org", true },
- { "familyparties.co.uk", true },
- { "familyreal.ru", true },
- { "familyrecipe.co.uk", true },
- { "familytreehq.com", true },
- { "familyworld.gr", true },
- { "famion.eu", false },
- { "famososnaweb.com", true },
- { "famousbirthdays.com", true },
- { "famoushostels.com", true },
- { "famvangelder.nl", true },
- { "famvsomeren.nl", true },
- { "fan.gov", true },
- { "fanactu.com", true },
- { "fanatical.com", true },
- { "fanatik.io", true },
- { "fanboi.ch", true },
- { "fanbot.co", true },
- { "fancy-bridge.com", true },
- { "fancy.org.uk", true },
- { "fancygaming.dk", true },
- { "fandler.cz", true },
- { "fandomservices.com", true },
- { "fanfareunion.ch", false },
- { "fangs.ink", true },
- { "fanjingbo.com", true },
- { "fanjingbo.me", true },
- { "fanjoe.be", true },
- { "fanohus.de", true },
- { "fanohus.dk", true },
- { "fansale.de", true },
- { "fansided.com", true },
- { "fantasiapainter.com", true },
- { "fantasiatravel.hr", true },
- { "fantasmesexuel.info", true },
- { "fantasticcleaners.com.au", true },
- { "fantasticcleanersbristol.co.uk", true },
- { "fantastichandymanmelbourne.com.au", true },
- { "fantastici.de", true },
- { "fantasticservices.com", true },
- { "fantasticservicesgroup.com", true },
- { "fantasticservicesgroup.com.au", true },
- { "fantasy-judo.com", true },
- { "fantasycastles.co.uk", true },
- { "fantasydrop.com", true },
- { "fantasyescortsbirmingham.co.uk", true },
- { "fantasymina.de", true },
- { "fantasypartyhire.com.au", true },
- { "fantasyspectrum.com", true },
- { "fantgames.com", true },
- { "fantraxhq.com", true },
- { "fanyina.cn", true },
- { "fanyina.com", true },
- { "fanyue123.tk", true },
- { "fanz.pro", true },
- { "fanzlive.com", true },
- { "fapiis.gov", true },
- { "fapp.tube", true },
- { "fapplepie.com", true },
- { "faq.ie", true },
- { "fara.gov", true },
- { "faradome.ws", true },
- { "faradrive.ir", true },
- { "farallonesrentacar.com", true },
- { "farberplasticsurgery.com", true },
- { "farcecrew.de", true },
- { "farces.com", false },
- { "faretrotter.com", true },
- { "farfallapets.com.br", true },
- { "farfetchos.com", true },
- { "fargtorget.se", true },
- { "farhadexchange.com", true },
- { "farhood.org", true },
- { "farid.is", true },
- { "farleybrass.com.au", true },
- { "farmacia-lloret.com", true },
- { "farmaciacomunalelacchiarella.it", true },
- { "farmaciacorvi.it", true },
- { "farmaciadejaime.es", true },
- { "farmaspeed.it", true },
- { "farmer.dating", true },
- { "farmers.gov", false },
- { "farmkazuto.com", true },
- { "farodeluz.ca", true },
- { "faroebusinessreport.com", true },
- { "faroes.net", true },
- { "faroes.org", true },
- { "farsil.eu", true },
- { "fart.wtf", true },
- { "farthing.xyz", true },
- { "farwat.ru", true },
- { "farzli.com", false },
- { "faschingmd.com", true },
- { "fascia.fit", true },
- { "fashion-stoff.de", true },
- { "fashion.bg", true },
- { "fashion24.de", true },
- { "fashiondays.bg", true },
- { "fashiondays.hu", true },
- { "fashiondays.ro", true },
- { "fashioneditor.gr", true },
- { "fashionlistify.tk", true },
- { "fashiontrendsetter.com", true },
- { "fashionunited.be", true },
- { "fashionunited.cl", true },
- { "fashionunited.com", true },
- { "fashionunited.com.ar", true },
- { "fashionunited.de", true },
- { "fashionunited.fi", true },
- { "fashionunited.hk", true },
- { "fashionunited.hu", true },
- { "fashionunited.ie", true },
- { "fashionunited.lu", true },
- { "fashionunited.mx", true },
- { "fashionunited.nl", true },
- { "fashionunited.no", true },
- { "fashionunited.nz", true },
- { "fashionunited.pl", true },
- { "fashionunited.se", true },
- { "fashionusa.gq", true },
- { "fashionweekweb.com", true },
- { "fashionxmas.gq", true },
- { "fashtic.nl", true },
- { "faspirits.co.uk", true },
- { "faspirits.com", true },
- { "fassaden-selleng.de", true },
- { "fassadenverkleidung24.de", true },
- { "fassi-sport.it", true },
- { "fast-cargo.ml", true },
- { "fast-pro.co.jp", true },
- { "fastblit.com", true },
- { "fastcash.com.br", true },
- { "fastcomcorp.com", true },
- { "fastcommerce.org", true },
- { "fastconfirm.com", true },
- { "fastconv.com", true },
- { "fastest-hosting.co.uk", true },
- { "fastforwardsociety.nl", true },
- { "fasthost.com.br", true },
- { "fastighetsekonomi.com", true },
- { "fastinviter.com", true },
- { "fastknigi.ml", true },
- { "fastlike.co", true },
- { "fastmail.com", false },
- { "fastonline.ro", true },
- { "fastos.com", true },
- { "fastos.de", true },
- { "fastpresence.com", true },
- { "fastserv.pl", true },
- { "fasturl.ml", true },
- { "fastvistorias.com.br", true },
- { "fastworx.com", true },
- { "fatecdevday.com.br", true },
- { "fateitalia.it", true },
- { "fatherhood.gov", true },
- { "fathers4equalrights.org", true },
- { "fatidique.com", true },
- { "fatihingemisi.com", true },
- { "fatimamoldes.com.br", true },
- { "fatmixx.com", true },
- { "fatowltees.com", true },
- { "fattailcall.com", false },
- { "fatturegeko.eu", true },
- { "fattyink.com", true },
- { "faucetbox.com", false },
- { "faultlines.org", true },
- { "fauvettes.be", true },
- { "favalart.com", true },
- { "favirei.com", true },
- { "favorai.com", true },
- { "fawong.com", true },
- { "faxvorlagen-druckvorlagen.de", true },
- { "fayntic.com", true },
- { "fazzfinancial.com", true },
- { "fb-feed.net", true },
- { "fb.gg", true },
- { "fb.me", true },
- { "fbcdn.net", true },
- { "fbi.gov", true },
- { "fbigame.com", true },
- { "fbiic.gov", true },
- { "fbijobs.gov", true },
- { "fbo.gov", false },
- { "fboerman.nl", true },
- { "fbrief.org", true },
- { "fbsbx.com", true },
- { "fbtholdings.com", true },
- { "fburl.com", true },
- { "fbwgynplus.com", true },
- { "fbwgynplus.com.au", true },
- { "fc.media", true },
- { "fc8882.com", false },
- { "fc8882.net", false },
- { "fca-tools.com", true },
- { "fcapollo.tk", true },
- { "fcbarcelona.cz", true },
- { "fcburk.de", true },
- { "fccarbon.com", true },
- { "fcdn.nl", true },
- { "fcforum.net", true },
- { "fcic.gov", true },
- { "fcingolstadt.de", true },
- { "fcosinus.com", true },
- { "fcprovadia.com", true },
- { "fcsic.gov", true },
- { "fdalawboston.com", true },
- { "fdaregs.com", true },
- { "fdevs.ch", true },
- { "fdfz.edu.cn", true },
- { "fdicig.gov", true },
- { "fdicoig.gov", true },
- { "fdis.net.cn", true },
- { "fdm.ro", true },
- { "fdms.gov", true },
- { "fdp-brig-glis.ch", true },
- { "fdpbrig.ch", true },
- { "fdremodelingatlanta.com", true },
- { "fdresearch.ca", true },
- { "fdworlds.com", true },
- { "fe-data.nl", true },
- { "feac.us", true },
- { "feandc.com", true },
- { "feastr-dev.de", true },
- { "feastr.de", true },
- { "feastr.io", true },
- { "feat.agency", true },
- { "featherweightlabs.com", true },
- { "feb.gov", true },
- { "febeditora.com.br", true },
- { "fedcenter.gov", true },
- { "federaljobs.gov", true },
- { "federalreserve.gov", true },
- { "federalreserveconsumerhelp.gov", true },
- { "federatedbank.com", true },
- { "fedjobs.gov", true },
- { "fedorahosted.org", true },
- { "fedorapeople.org", true },
- { "fedoraproject.org", true },
- { "fedpartnership.gov", true },
- { "fedramp.gov", false },
- { "fedrtc.org", true },
- { "fedshirevets.gov", true },
- { "fedux.com.ar", true },
- { "fedvan.com", true },
- { "feedbin.com", false },
- { "feedfall.com", true },
- { "feedhq.org", true },
- { "feedkovacs.hu", true },
- { "feedough.com", true },
- { "feedthefuture.gov", false },
- { "feeeei.com", true },
- { "feek.fit", true },
- { "feel-events.com", true },
- { "feel.aero", true },
- { "feelgood-workouts.de", true },
- { "feelmom.com", true },
- { "feeltennis.net", true },
- { "feen.us", true },
- { "feepod.com", true },
- { "feetpa.ws", true },
- { "fefelovalex.ru", true },
- { "fegame.eu", true },
- { "fegame.mobi", true },
- { "fegame.net", true },
- { "fegame.nl", true },
- { "fegc-wgec.gc.ca", true },
- { "fegli.gov", true },
- { "fehngarten.de", true },
- { "feigling.net", false },
- { "feildel.fr", true },
- { "feilen.de", true },
- { "feilestrokestown.com", true },
- { "feisim.com", true },
- { "feisim.org", true },
- { "feistyduck.com", true },
- { "feixiang.eu.org", true },
- { "feiya.ng", true },
- { "fejervar.hu", true },
- { "fekir.info", true },
- { "feld.design", true },
- { "feld.saarland", true },
- { "feldbogenclub-hamburg.de", true },
- { "feldhousen.com", true },
- { "felett.es", true },
- { "feli.games", true },
- { "felicifia.org", true },
- { "felinepc.com", true },
- { "felistirnavia.sk", true },
- { "felix-hirner.de", true },
- { "felixaufreisen.de", true },
- { "felixbarta.de", true },
- { "felixcrux.com", true },
- { "felixduart.com", true },
- { "felixkaaman.com", true },
- { "felixklein.com", true },
- { "felixklenner.de", true },
- { "felixqu.com", true },
- { "felixsanz.com", true },
- { "felixseele.de", true },
- { "felsing.net", true },
- { "feltons.me", true },
- { "femastudios.com", true },
- { "feminina.pt", true },
- { "feministreview.cf", true },
- { "feministspectrum.org", true },
- { "feministwiki.org", true },
- { "femmes-women.gc.ca", true },
- { "femmes.gc.ca", true },
- { "femmesaupluriel.com", true },
- { "femtomind.com", true },
- { "feng-hhcm.com", true },
- { "feng.si", true },
- { "fengchuiyudaqu.ml", true },
- { "fengyi.tel", true },
- { "fenhl.net", true },
- { "fenichelar.com", true },
- { "fenixhost.com.br", true },
- { "fenom.com", true },
- { "fenster-bank.at", true },
- { "fenster-bank.de", true },
- { "feragon.net", true },
- { "ferc.gov", true },
- { "fergtm.com", true },
- { "feriehus-danmark.no", true },
- { "ferien-netzwerk.de", true },
- { "ferienchalet-wallis.ch", true },
- { "ferienhaeuser-krummin.de", true },
- { "ferienhaus-danemark-hund.de", true },
- { "ferienhaus-danemark-privat.de", true },
- { "ferienhaus-laesoe.de", true },
- { "ferienhaus-polchow-ruegen.de", false },
- { "ferienhaus-urlaub-danemark.de", true },
- { "ferienhausprovence.ch", true },
- { "ferienstpeter.de", true },
- { "ferienwohnung-hafeninsel-stralsund.de", true },
- { "ferienwohnung-wiesengrund.eu", true },
- { "ferieservice.dk", true },
- { "feriespotter.dk", true },
- { "ferlc.org", true },
- { "ferm-rotterdam.nl", true },
- { "fermabel.com.br", true },
- { "fern.health", true },
- { "fernandes.org", true },
- { "fernandob.com", true },
- { "fernandobarata.pt", true },
- { "fernandobarillas.com", true },
- { "fernandomiguel.net", true },
- { "fernland.com.au", true },
- { "feross.net", true },
- { "feross.org", true },
- { "ferprobolivia.com", true },
- { "ferrada.org", false },
- { "ferrariadvisor.it", true },
- { "ferret.zone", true },
- { "ferreteriaxerez.com", true },
- { "ferriswheelofficial.us", true },
- { "ferrolatino.ch", true },
- { "ferrone.ru", true },
- { "ferrousmoon.com", true },
- { "ferry.tw", true },
- { "ferticare.pt", true },
- { "fertigasi.com", true },
- { "fertila.de", true },
- { "festaprylar.se", true },
- { "festesuniversitaries.tk", true },
- { "festival-tipps.com", true },
- { "festival-transform.com", true },
- { "festival-transform.fr", true },
- { "festivaldimouamaroussiou.gr", true },
- { "festivaljapon.com", true },
- { "festivalpopayan.tk", true },
- { "festx.co.za", true },
- { "fetch.co.uk", true },
- { "fetchease.com", true },
- { "fetishbazar.cz", true },
- { "fetlife.com", true },
- { "fettlaus.de", true },
- { "feudalisten.de", true },
- { "feuerhaken.org", true },
- { "feuerhuhn.de", true },
- { "feuerloescher-arten.de", true },
- { "feuerloescher-test.de", true },
- { "feuerwehr-coesfeld.de", true },
- { "feuerwehr-gebirge.de", true },
- { "feuerwehr-heiligenberg.de", true },
- { "feuerwehr-illmensee.de", true },
- { "feuerwehr-mehring.de", true },
- { "feuerwehr-offenbach-bieber.de", false },
- { "feuerwehr-vechta.de", true },
- { "feuerwehrbadwurzach.de", true },
- { "feuerwerksmanufaktur.de", true },
- { "feuetgloire.com", false },
- { "fewo-hafeninsel-stralsund.de", true },
- { "fewo-thueringer-wald.de", true },
- { "fewo32.de", true },
- { "feybiblia.com", true },
- { "ff-bad-hoehenstadt.de", true },
- { "ff-koenigstein-opf.de", true },
- { "ff-obersunzing-niedersunzing.de", true },
- { "ff00228.com", false },
- { "ff14-mstdn.xyz", false },
- { "ff18.cc", true },
- { "ff326.com", true },
- { "ff396.com", true },
- { "ff612.com", true },
- { "ff675.com", true },
- { "ff769.com", true },
- { "ff861.com", true },
- { "ff916.com", true },
- { "ff956.com", true },
- { "ff965.com", true },
- { "ff967.com", true },
- { "ff976.com", true },
- { "ffb.gov", false },
- { "ffbans.org", true },
- { "fff-du.de", true },
- { "fffinfo.de", true },
- { "ffg.berlin", true },
- { "ffiec.gov", true },
- { "ffis.me", true },
- { "ffkoenigsberg.de", true },
- { "fflone.com", true },
- { "ffmradio.de", true },
- { "ffmv.de", true },
- { "ffprofile.com", true },
- { "ffrev.de", true },
- { "ffsociety.nl", true },
- { "ffvideo.xyz", true },
- { "ffw-zeven.de", true },
- { "ffzeven.de", true },
- { "fgsv-heureka.de", true },
- { "fgsv-kongress.de", true },
- { "fh169.cc", true },
- { "fhar.be", true },
- { "fhba.com.au", true },
- { "fhconseil.fr", false },
- { "fhdhelp.de", false },
- { "fhdhilft.de", false },
- { "fheuschen.de", true },
- { "fhfaoig.gov", true },
- { "fhinds.co.uk", true },
- { "fhservices.com.au", true },
- { "fi.google.com", true },
- { "fi.search.yahoo.com", false },
- { "fiam.me", true },
- { "fiareapp.red", false },
- { "fiasgo.com", true },
- { "fiasgo.dk", true },
- { "fiasgo.i.ng", true },
- { "fibercoverage.com", true },
- { "fibo-forex.org", true },
- { "fibra.click", true },
- { "fibrasynormasdecolombia.com", true },
- { "fibretv.co.nz", true },
- { "fibretv.tv", true },
- { "fibromuebles.com", true },
- { "fichier-pdf.fr", true },
- { "fickweiler.nl", true },
- { "fidanza.eu", true },
- { "fidelapp.com", true },
- { "fidelis-it.ch", true },
- { "fidelis-it.net", true },
- { "fidhouriet.ch", true },
- { "fidias.com.br", true },
- { "fidoo.com", true },
- { "fiduciaire-azur.com", true },
- { "fiduciaire-ratio.ch", false },
- { "fieggen.eu", true },
- { "fieggen.net", true },
- { "fieldexpert.eu", true },
- { "fieldwork-paysage.com", false },
- { "fierlafijn.net", true },
- { "fierscleaning.nl", true },
- { "fiery.me", true },
- { "fierykitchen.pl", false },
- { "fietsvierdaagsen.nl", true },
- { "fifacup.ga", true },
- { "fifautstore.com", true },
- { "fifei.de", true },
- { "fifichachnil.paris", true },
- { "fifr.nl", true },
- { "fiftynorth.eu", true },
- { "fiftyonetielt.be", true },
- { "figan.cz", true },
- { "fight215.com", true },
- { "fight215.org", true },
- { "figinstitute.org", true },
- { "figliasons.com", true },
- { "figshare.com", true },
- { "figurasdelinguagem.com.br", true },
- { "figure.nz", true },
- { "fiilr.com", true },
- { "fiix.io", true },
- { "fijnewoensdag.nl", true },
- { "fiken.no", true },
- { "fikriwildannugraha.com", true },
- { "fikst.com", true },
- { "fil-tec-rixen.com", true },
- { "filamentia.nl", true },
- { "filanthropystar.org", true },
- { "filaretihairlove.gr", true },
- { "file-pdf.it", true },
- { "filebox.one", true },
- { "filecloud.fun", true },
- { "filecopa.com", true },
- { "filedesc.com", true },
- { "filehash.de", true },
- { "filehippo.com", true },
- { "files.com", true },
- { "files.from-me.org", true },
- { "fileservicios.com.ar", true },
- { "filestar.io", true },
- { "filestartest.io", true },
- { "filesuffix.com", true },
- { "filezilla-project.org", true },
- { "filhin.es", true },
- { "filhodohomem.com", true },
- { "fili.com", true },
- { "filidorwiese.nl", true },
- { "filiio.com", true },
- { "filingsmadeeasy.com", true },
- { "filip-prochazka.com", false },
- { "filippo.io", true },
- { "filipsebesta.com", true },
- { "fillo.sk", true },
- { "film-colleges.com", true },
- { "film-op-tv.nl", true },
- { "film-storyboards.fr", true },
- { "film-tutorial.com", true },
- { "filmarchiv-sachsen.de", true },
- { "filmatiporno.xxx", true },
- { "filmcrewdb.com", true },
- { "filme-onlines.com", true },
- { "filmers.net", true },
- { "filmitis.com", true },
- { "filmpronet.in", true },
- { "filmreviewonline.com", true },
- { "filmserver.de", true },
- { "filmsite-studio.com", true },
- { "filmwallpapers.ml", true },
- { "filoo.de", true },
- { "filstop.com", true },
- { "filterlists.com", true },
- { "filtr.me", true },
- { "fimfiction.net", true },
- { "fimozin.ga", true },
- { "fimp.pt", true },
- { "fimsquad.com", true },
- { "finagosolo.com", true },
- { "final-expense-quotes.com", true },
- { "finalrewind.org", true },
- { "finalx.nl", true },
- { "finance-colleges.com", true },
- { "finance-news.ga", true },
- { "financejobs.ch", true },
- { "financialfreedomaus.com", true },
- { "finansa.no", true },
- { "finanstilsynet.dk", true },
- { "finanziero.de", true },
- { "finch.am", true },
- { "find-job-in.com", true },
- { "find-mba.com", true },
- { "finda.ae", true },
- { "findaffordablehousing.ca", true },
- { "findapinball.com", true },
- { "findautoloan.ml", true },
- { "findelahistoria.com", true },
- { "findingkorea.com", false },
- { "findingtheuniverse.com", true },
- { "finditez.com", true },
- { "findlocalproduce.co.uk", true },
- { "findoon.de", true },
- { "findrejsepartner.dk", true },
- { "findsingledating.ml", true },
- { "findstorenearme.ca", true },
- { "findstorenearme.co.uk", true },
- { "findstorenearme.us", true },
- { "findtreatment.gov", false },
- { "findyourtrainer.com", true },
- { "findyourvoice.ca", true },
- { "finefriends.nl", true },
- { "finefriends.social", true },
- { "finefriendsapp.com", true },
- { "finehealth.ru", true },
- { "finelovedolls.com", true },
- { "finenet.com.tw", true },
- { "finestrabatalera.tk", true },
- { "finestreview.cf", true },
- { "finestrina.net", true },
- { "finethin.com.br", true },
- { "finevegashomes.com", true },
- { "finewineonline.com", true },
- { "finext.cz", true },
- { "finflix.net", true },
- { "finform.ch", true },
- { "fini-de-jouer.ch", false },
- { "finilaviolence.gc.ca", true },
- { "finisron.in", true },
- { "finkelstein.fr", true },
- { "finkmartin.com", true },
- { "finlito.tk", true },
- { "finn.io", true },
- { "finnclass.cz", true },
- { "finnwea.com", true },
- { "finotax.com", true },
- { "fins.money", true },
- { "finsprings.org", true },
- { "fintandunleavy.com", false },
- { "fintry.ca", true },
- { "finvantage.com", true },
- { "finwe.info", true },
- { "finzy.com", true },
- { "fionafuchs.de", true },
- { "fionamcbride.com", true },
- { "fioristionline.it", true },
- { "fioristionline.net", true },
- { "fioritic.com", true },
- { "fioulmarket.fr", true },
- { "fir3net.com", true },
- { "firc.de", true },
- { "fire-schools.com", true },
- { "firebaseio.com", true },
- { "firebirdrangecookers.com", true },
- { "firebounty.com", true },
- { "fireboxfood.com", true },
- { "firecareandsecurity.co.uk", true },
- { "firecore.com", true },
- { "firecry.org", true },
- { "firefense.com", true },
- { "firefighters.dating", true },
- { "fireflyiii.spdns.org", true },
- { "firegeisha.com", true },
- { "fireglow.de", true },
- { "firegoby.jp", true },
- { "fireleadership.gov", true },
- { "firemist.com", true },
- { "firemudfm.com", true },
- { "firenews.cf", true },
- { "firenza.org", true },
- { "fireorbit.de", false },
- { "fireportal.cz", true },
- { "fireportal.sk", true },
- { "firerain.me", true },
- { "fireshellsecurity.team", true },
- { "firesofheaven.org", true },
- { "firestuff.org", true },
- { "firetotheprisons.org", true },
- { "firevap.org", true },
- { "fireworksshowvr.com", true },
- { "firexfly.com", true },
- { "firma-cerny.cz", true },
- { "firma-offshore.com", true },
- { "firmajulegaver.dk", true },
- { "firmament.space", true },
- { "firmapi.com", true },
- { "firmen-assekuranz.de", true },
- { "firmenwerbung-vermarktung.de", true },
- { "firmware.science", true },
- { "first-house.no", true },
- { "first-time-offender.com", true },
- { "first.org", true },
- { "first4it.com", true },
- { "firstbooks.ml", true },
- { "firstchoicebouncycastlehire.co.uk", true },
- { "firstchoicecandy.com", true },
- { "firstchoicefriseur.at", true },
- { "firstclasscastles.com", true },
- { "firstclassleisure.co.uk", true },
- { "firstcoastteaco.com", true },
- { "firstderm.com", true },
- { "firstdorsal.eu", true },
- { "firstdry.com.br", true },
- { "firstfinca.de", true },
- { "firstinnovationltd.com", true },
- { "firstmall.de", true },
- { "firstnet.gov", true },
- { "firstnetworksouth.com", true },
- { "firstq.xyz", true },
- { "firstrays.com", true },
- { "firstwebring.tk", true },
- { "firtreetechnology.co.uk", true },
- { "fischer-kundendienst.de", true },
- { "fischers.cc", true },
- { "fiscoeconti.it", true },
- { "fish-hook.ru", true },
- { "fish4dogs.com", true },
- { "fishermailbox.net", true },
- { "fishermansbendcorporation.com.au", true },
- { "fishermansbendtownhouses.com.au", true },
- { "fishexport.eu", true },
- { "fishgen.no", true },
- { "fishlanestudios.com", true },
- { "fishoilsafety.com", true },
- { "fishtacos.blog", true },
- { "fisinfomanagerdr.com", true },
- { "fisiobox.eu", true },
- { "fisioterapista.roma.it", true },
- { "fiskalnepretor.pl", true },
- { "fiskelures.se", true },
- { "fit-4u.ch", false },
- { "fit-mit-nina.com", true },
- { "fit365.jp", false },
- { "fitchconnect.com", true },
- { "fite.family", true },
- { "fitequilibrio.com.br", true },
- { "fitinclass.com", true },
- { "fitkram.cz", true },
- { "fitness-challenge.co.uk", true },
- { "fitness.gov", true },
- { "fitnesskarate.club", true },
- { "fitnessunder50.com", true },
- { "fito.tk", true },
- { "fittelo.cz", true },
- { "fittingperfetto.it", true },
- { "fitzsim.org", true },
- { "fivestartrader.com", true },
- { "fivethirtyeight.com", true },
- { "fixatom.com", true },
- { "fixed.supply", true },
- { "fixedtodayplumbing.com.au", true },
- { "fixel.express", true },
- { "fixfm.tk", true },
- { "fixforce.nl", true },
- { "fixhotsauce.com", true },
- { "fixingscrews.co.uk", true },
- { "fixlasvegas.com", true },
- { "fixmyalarmpanel.co.uk", true },
- { "fixmycomputerdude.com", true },
- { "fizadvocaten.nl", true },
- { "fiziktedavi.name.tr", true },
- { "fizyoterapi.name.tr", true },
- { "fizz.buzz", false },
- { "fizzgi.gs", true },
- { "fj.je", true },
- { "fj.search.yahoo.com", false },
- { "fj.simple.com", false },
- { "fjdekermadec.com", true },
- { "fjordboge.dk", true },
- { "fjzone.org", true },
- { "fkfev.de", true },
- { "fkosquad.moe", true },
- { "fkraiem.org", true },
- { "fktpm.ru", true },
- { "flaemig42.de", false },
- { "flagburningworld.com", true },
- { "flagfox.net", true },
- { "flaggorvarlden.se", true },
- { "flagi-panstw.pl", true },
- { "flagistrany.ru", true },
- { "flagpedia.asia", true },
- { "flagpedia.net", true },
- { "flagshop.jp", true },
- { "flagspot.net", false },
- { "flam3d.be", true },
- { "flam3d.nl", true },
- { "flam3d.org", true },
- { "flamero.fi", true },
- { "flamet.eu", true },
- { "flameworked.com", true },
- { "flamingkeys.com", true },
- { "flamingowomenspavilion.com", true },
- { "flamme-von-anor.de", true },
- { "flana.com", true },
- { "flanga.io", true },
- { "flanga.org", true },
- { "flangaapis.com", true },
- { "flapoverspeed.com", true },
- { "flare.cloud", true },
- { "flashback.org", true },
- { "flashbeing.com", true },
- { "flashcomp.cz", true },
- { "flashgamedev.tk", true },
- { "flashgot.net", true },
- { "flass.lu", true },
- { "flassetlocators.com", true },
- { "flat.io", true },
- { "flatbellyreview.com", true },
- { "flatbook.one", true },
- { "flatmail.pl", true },
- { "flatmatehub.com.au", true },
- { "flatpackmates.co.uk", true },
- { "flauschig.net", true },
- { "flavinus.fr", true },
- { "flaviu.co.uk", true },
- { "flavo.io", true },
- { "flawlesscowboy.xyz", true },
- { "flcatering.com", true },
- { "flealab.it", true },
- { "fleep.io", true },
- { "fleesty.dynv6.net", true },
- { "fleet-group.com", true },
- { "fleet-search.com", true },
- { "fleetcor.at", true },
- { "fleetcor.ch", true },
- { "fleetcor.cz", true },
- { "fleetcor.de", true },
- { "fleetcor.fr", true },
- { "fleetcor.hu", true },
- { "fleetcor.lu", true },
- { "fleetcor.nl", true },
- { "fleetcor.pl", true },
- { "fleetcor.sk", true },
- { "fleetcorcards.be", true },
- { "fleetsmith.com", true },
- { "fleetssl.com", true },
- { "fleetyards.net", true },
- { "flehm.de", true },
- { "fleisch.club", true },
- { "flers-agglo.fr", true },
- { "flerstourisme.fr", true },
- { "fletcherdigital.com", true },
- { "fletchto99.com", true },
- { "fletemaritimo.online", true },
- { "flets-ms.com", true },
- { "fleurenplume.fr", true },
- { "fleursdujour.ph", true },
- { "fleuryfleury.com", true },
- { "flexapplications.se", true },
- { "flexbuildingsystems.com", true },
- { "flexfunding.com", true },
- { "fleximaal.com", true },
- { "fleximal.com", true },
- { "fleximus.org", false },
- { "flexport.com", true },
- { "flexstart.me", true },
- { "fliacuello.com.ar", true },
- { "flibusta.appspot.com", true },
- { "flickcritter.com", true },
- { "flieger-funk-runde.de", true },
- { "fliesen-waldschmidt.de", true },
- { "flight.school", true },
- { "flightdeckfriend.com", true },
- { "flightmedx.com", true },
- { "flightright.at", true },
- { "flightright.co.uk", true },
- { "flightright.com", true },
- { "flightright.de", true },
- { "flightright.es", true },
- { "flightright.fr", true },
- { "flightright.it", true },
- { "flightright.se", true },
- { "flightschoolbooking.com", true },
- { "flightschoolcandidates.gov", true },
- { "flightzero.cf", true },
- { "fliino.com", true },
- { "fliino.eu", true },
- { "fliino.info", true },
- { "fliino.net", true },
- { "fliino.org", true },
- { "flinch.io", true },
- { "flip.kim", true },
- { "flipmusic.tk", true },
- { "flipneus.net", true },
- { "flipphotography.ga", true },
- { "fliptable.org", true },
- { "flirt-norden.de", true },
- { "flirtee.net", true },
- { "flirtfaces.de", true },
- { "flirtos.de", true },
- { "flixcheck.de", true },
- { "flixstats.com", true },
- { "flixtube.me", true },
- { "flmortgagebank.com", true },
- { "floaternet.com", true },
- { "flockbox.club", true },
- { "flocktofedora.org", true },
- { "floersheimer-openair.de", true },
- { "floffi.media", true },
- { "floify.com", true },
- { "flokinet.is", true },
- { "flokkr.com", true },
- { "flonharmonymassage.space", true },
- { "floobits.com", true },
- { "floodsmart.gov", true },
- { "floogulinc.com", true },
- { "floorballphilippines.tk", true },
- { "flooringnightmares.com", true },
- { "flooringsourcetx.com", true },
- { "floors4lessbay.com", true },
- { "floort.net", false },
- { "floraclick.net", true },
- { "floraexpress.it", true },
- { "florafiora.com.br", false },
- { "florausa.net", true },
- { "floravan.com", true },
- { "floravino.de", true },
- { "florence.uk.net", true },
- { "florenceapp.co.uk", true },
- { "florenciasabio.com", true },
- { "florent-tatard.fr", true },
- { "florentynadawn.co.uk", true },
- { "florian-bachelet.fr", true },
- { "florian-lefevre.fr", true },
- { "florian-thie.de", true },
- { "florianbecker.it", true },
- { "floriankarmen.com", true },
- { "floriankeller.de", true },
- { "florianmitrea.uk", true },
- { "florianschmitt.ca", true },
- { "floriantanner.ch", true },
- { "florida-immigration.com", true },
- { "floridafabrication.net", true },
- { "floridahomesinvest.com", true },
- { "floridamainmovers.com", true },
- { "floridasexhealth.com", true },
- { "floridawaterapparel.net", true },
- { "floridaweightlossdoctors.com", true },
- { "florinlungu.it", true },
- { "florismouwen.com", false },
- { "floristik-online.com", true },
- { "floristmou.com", true },
- { "florisvdk.net", true },
- { "floriswesterman.nl", true },
- { "flosch.at", false },
- { "floskelwolke.de", true },
- { "flossexanten.de", true },
- { "flourishtogether.com", true },
- { "flow.su", true },
- { "flowcom.de", true },
- { "flowersquito.com", true },
- { "flowinity.com", true },
- { "flowinvoice.com", true },
- { "flowreader.com", true },
- { "flra.gov", true },
- { "fluffy.moe", true },
- { "fluffycloud.de", true },
- { "fluggesellschaft.de", true },
- { "fluglektuere.com", true },
- { "fluidmeterusa.com", true },
- { "fluidpicturesinc.com", true },
- { "fluids.ac.uk", true },
- { "fluitbeurt.nl", true },
- { "flumble.nl", true },
- { "flunschi.goip.de", true },
- { "fluoxetine.net", true },
- { "flushlife.com", true },
- { "fluteandpianoteaching.co.uk", true },
- { "flux.healthcare", true },
- { "fluxfingers.net", true },
- { "fluxforge.com", true },
- { "fluxi.fi", true },
- { "fluxoid.com", true },
- { "flw365365.com", true },
- { "fly-en-drive.nl", true },
- { "fly.moe", true },
- { "flyadrenaline.com", true },
- { "flyavantar.com", true },
- { "flyawaybirds.ga", true },
- { "flyboyfpv.com", true },
- { "flydrivesicilie.nl", true },
- { "flyer.tools", true },
- { "flyersmarket.com", true },
- { "flygon.pink", true },
- { "flying-dudes.de", true },
- { "flyinghigh.co.jp", true },
- { "flyinglocksmiths.com", true },
- { "flyingpackets.net", true },
- { "flyingrub.me", true },
- { "flymns.fr", true },
- { "flynn.io", true },
- { "flyp.me", true },
- { "flypenge.dk", true },
- { "flyserver.co.il", false },
- { "flyswoop.com", true },
- { "flyt.online", true },
- { "flytoadventures.com", true },
- { "flywus.com", true },
- { "fm.ie", true },
- { "fmbilder.se", true },
- { "fmcs.gov", true },
- { "fmdance.cl", true },
- { "fmeventcentre.com", true },
- { "fminsight.net", true },
- { "fmodoux.biz", false },
- { "fmussatmd.com", true },
- { "fnanen.net", true },
- { "fnbnokomis.com", true },
- { "fnh-expert.net", true },
- { "fnkr.net", true },
- { "fnof.ch", true },
- { "fnordserver.eu", true },
- { "fnpro.eu", true },
- { "foair.me", true },
- { "foairbus.fr", false },
- { "foairbussas.fr", false },
- { "focanamoda.com.br", true },
- { "focanocliente.com.br", true },
- { "focusmark.jp", false },
- { "focusministries1.org", true },
- { "focuspointtechnologies.com", true },
- { "foej-aktiv.de", true },
- { "foej.net", true },
- { "foerster.gmbh", true },
- { "fogway.net", true },
- { "foia.gov", true },
- { "foiaonline.gov", true },
- { "foixet.com", true },
- { "fojing.com", true },
- { "fojt.cz", true },
- { "fojtova.cz", true },
- { "fojtovi.cz", true },
- { "fokan.be", true },
- { "fokan.ch", true },
- { "fokep.no", true },
- { "fokus.ag", true },
- { "folar.ga", true },
- { "folio.no", true },
- { "foliumbiosciences.com", true },
- { "foliumfinance.com", true },
- { "foljeton.dk", true },
- { "folk.as", true },
- { "follandviolins.com", true },
- { "followback.net", true },
- { "follower98.ir", true },
- { "followmystaff.com", true },
- { "followthatpage.com", true },
- { "followthedog.co.uk", true },
- { "foluomeng.net", true },
- { "folv.es", true },
- { "folwark.krakow.pl", true },
- { "folwarkwiazy.pl", true },
- { "fomopop.com", true },
- { "fonamperu.org.pe", true },
- { "fondationwiggli.ch", true },
- { "fondy.eu", true },
- { "fondy.ru", true },
- { "fondy.ua", true },
- { "fonga.ch", true },
- { "fonline.tk", true },
- { "fono.jp", true },
- { "fonolo.com", true },
- { "fonseguin.ca", true },
- { "font-converter.net", true },
- { "fonte-trading.com", true },
- { "fontedoprazer.com", true },
- { "fontein.de", true },
- { "fontlibrary.org", true },
- { "fonts4free.net", true },
- { "fonzone.it", true },
- { "foo.fo", true },
- { "foo.hamburg", true },
- { "food4healthybones.com", true },
- { "foodattitude.ch", false },
- { "foodboy.com", true },
- { "foodev.de", true },
- { "foodlist.net", true },
- { "foodloader.net", true },
- { "foodsafety.gov", true },
- { "foodsafetyjobs.gov", true },
- { "foodsoul.pro", true },
- { "foodwise.marketing", true },
- { "foolip.org", true },
- { "foolwealth.com", true },
- { "foonly.fi", true },
- { "foorack.com", true },
- { "fooster.io", true },
- { "foot.fr", true },
- { "footagecrate.com", true },
- { "footballforum.de", true },
- { "footballsrit.tk", true },
- { "for.care", false },
- { "foray-jero.me", true },
- { "forbidden-mods.de", true },
- { "forcelink.eu", true },
- { "forcelink.nl", true },
- { "forcelinkamerica.com", true },
- { "forcelinkamerica.nl", true },
- { "forcewave.com", true },
- { "ford-mustang.tk", true },
- { "ford-shop.by", true },
- { "ford.com.au", true },
- { "ford.com.br", true },
- { "ford.com.cn", true },
- { "ford.mx", true },
- { "fordlibrarymuseum.gov", true },
- { "fordsync.com", true },
- { "foreachcode.com", true },
- { "forecastcity.com", true },
- { "foreclosureattorneyhouston.com", true },
- { "forefrontcloud.com", true },
- { "foregroundweb.com", true },
- { "foreign-language-colleges.com", true },
- { "foreignxchange.com.au", true },
- { "forellenpark.com", true },
- { "forensicsoftware.biz", true },
- { "forento.be", true },
- { "forestraven.net", true },
- { "forevergreens.us", true },
- { "foreverssl.com", true },
- { "foreversummertime.com", true },
- { "forewordreviews.com", true },
- { "forex-giants.com", true },
- { "forex.ee", true },
- { "forexarby.com", true },
- { "forexchef.de", true },
- { "forexcity.cf", true },
- { "forexee.com", true },
- { "forextickler.com", true },
- { "forextimes.ru", true },
- { "forextraders.com", true },
- { "forfeit.ga", true },
- { "forfeiture.gov", true },
- { "forfunssake.co.uk", true },
- { "forge-goerger.eu", false },
- { "forgotten-legends.org", true },
- { "form3w.nl", true },
- { "formacionyestudios.com", true },
- { "formalgrammar.tk", true },
- { "formality.one", true },
- { "forman.store", true },
- { "formapi.io", true },
- { "format-paysage.ch", false },
- { "formation-assureur.com", true },
- { "formation-mac.ch", false },
- { "formationseeker.com", true },
- { "formi9.com", true },
- { "formio.nl", true },
- { "formsbyair.com", true },
- { "formsmarts.com", true },
- { "formula-ot.ru", true },
- { "formulacionquimica.com", true },
- { "formulastudent.de", true },
- { "fornoreason.net.au", true },
- { "fornwall.net", true },
- { "foroaranda.com", true },
- { "forodeespanol.com", true },
- { "forodieta.com", false },
- { "forokd.com", true },
- { "forrestheller.com", true },
- { "forro.info", true },
- { "forsaleinedmonton.ca", true },
- { "forsec.nl", true },
- { "forsi.xyz", true },
- { "forstbetrieb-hennecke.de", true },
- { "forstprodukte.de", true },
- { "fortdodgeradio.com", true },
- { "forteggz.nl", true },
- { "forthetoys.com", true },
- { "forthewin.rocks", true },
- { "forthvalleykeswick.co.uk", true },
- { "fortnine.ca", true },
- { "fortran.io", true },
- { "fortress.no", true },
- { "fortress.sk", true },
- { "fortuna-apotheke-lahnstein.de", true },
- { "fortuna.co.ua", true },
- { "forty-two.nl", true },
- { "forty8creates.com", true },
- { "fortygordy.com", true },
- { "fortytwo.cloud", true },
- { "forum-4.com", true },
- { "forum-bonn.de", true },
- { "forum-egypte.tk", true },
- { "forum-noginska.tk", true },
- { "forum-tutorapide.ml", true },
- { "forum.quantifiedself.com", false },
- { "forumcarriocity.tk", true },
- { "forumdimo.fr", true },
- { "forumirc.net", true },
- { "forumotomobil.com", true },
- { "forumpakistan.tk", true },
- { "forumstandaardisatie.nl", true },
- { "forumvoordemocratie.nl", true },
- { "forvisualdesign.com", false },
- { "forward-fly-fishing.ch", false },
- { "foryourhealthybody.com", true },
- { "fos-apps.org", true },
- { "fos-games.org", true },
- { "fosaudit.com", true },
- { "foscamcanada.com", true },
- { "fosdem.org", true },
- { "foselectro.ru", true },
- { "fosgreece.com", true },
- { "fossdaily.xyz", true },
- { "fossforward.com", true },
- { "fossilfreeyale.org", true },
- { "fosterpark.ca", true },
- { "fotella.com", true },
- { "fotl.ua", true },
- { "foto-janvanaefst.nl", true },
- { "foto-leistenschneider.de", true },
- { "foto-leitner.com", true },
- { "foto-leitner.de", true },
- { "foto-robitsch.at", true },
- { "foto-roma.ru", true },
- { "foto.by", true },
- { "fotoblog.nrw", true },
- { "fotoboxvysocina.cz", true },
- { "fotofaerie.net", true },
- { "fotoflits.net", true },
- { "fotofon.tk", true },
- { "fotografechristha.nl", true },
- { "fotografiadellalucerossa.com", true },
- { "fotografiamakro.pl", true },
- { "fotohome.dk", true },
- { "fotokomorkomania.pl", true },
- { "fotoleitner.com", true },
- { "fotoleitner.de", true },
- { "fotonjan.com", true },
- { "fotopalacedigitalstudio.tk", true },
- { "fotostravestisbr.com", true },
- { "fotostudio-leitner.com", true },
- { "fotostudio-leitner.de", true },
- { "fotostudio-schweiz.ch", true },
- { "fotowolfy.com", true },
- { "fougner.co", true },
- { "found.website", true },
- { "foundationrepairnebraska.com", true },
- { "foundationspecialistmi.com", true },
- { "foundchurch.co.uk", true },
- { "founded.ml", true },
- { "founderio.net", true },
- { "foundsounds.me", true },
- { "fourashesgolfcentre.co.uk", true },
- { "fourashesgolfcentre.com", true },
- { "fourfourcrew.com", true },
- { "fourmies.fr", true },
- { "fournarisopenday.com", true },
- { "fourscore.ga", true },
- { "fourxone.com", true },
- { "fowlervwparts.com", true },
- { "fowlsmurf.net", true },
- { "fox.my", false },
- { "foxes.no", true },
- { "foxesare.sexy", true },
- { "foxhillshotel.com", true },
- { "foxo.blue", true },
- { "foxontheinter.net", true },
- { "foxphotography.ch", false },
- { "foxquill.com", false },
- { "foxroy.com", true },
- { "foxstreetcomms.co.za", false },
- { "foxtrotfm.tk", true },
- { "fozzie.co.uk", true },
- { "fozzie.space", true },
- { "fpasca.com", true },
- { "fpc.gov", false },
- { "fpersona.com", true },
- { "fps73.ru", true },
- { "fpsclasico.de", true },
- { "fpsv.de", true },
- { "fpt-technojapan.com", true },
- { "fpy.cz", true },
- { "fr.search.yahoo.com", false },
- { "fr33tux.org", true },
- { "frack.nl", false },
- { "fracreazioni.it", true },
- { "fraesentest.de", true },
- { "frag.works", true },
- { "fragmentspuren.de", true },
- { "fragstore.net", true },
- { "fraho.eu", true },
- { "frail.gq", true },
- { "framapiaf.org", false },
- { "framboise314.fr", true },
- { "framer.com", true },
- { "framezdakkapellen.nl", true },
- { "fran.cr", true },
- { "fran.id", true },
- { "france-news.cf", true },
- { "francepandi.fr", true },
- { "francesca-and-lucas.com", true },
- { "francescopalazzo.com", true },
- { "francescopandolfibalbi.it", true },
- { "francescoyatesfansite.com", true },
- { "francetraceur.fr", true },
- { "franchini.email", true },
- { "franchini.engineer", true },
- { "franchisehive.com", true },
- { "francinebelanger.network", true },
- { "francis.ph", true },
- { "francisli.net", false },
- { "franckgirard.net", true },
- { "franckyz.com", true },
- { "francois-occasions.be", false },
- { "francoisbelangerboisclair.com", true },
- { "francoise-paviot.com", true },
- { "francoisharvey.ca", true },
- { "francoislepage.com", false },
- { "francoz.me", true },
- { "frandor.co.uk", true },
- { "frank.fyi", true },
- { "frankbellamy.co.uk", true },
- { "frankellawfirm.com", true },
- { "franken-lehrmittel.de", true },
- { "frankenhost.de", true },
- { "frankenlehrmittel.de", true },
- { "frankieburkeactor.tk", true },
- { "frankieistanbul.com", true },
- { "frankierfachmann.de", true },
- { "frankierprofi.de", true },
- { "frankierstar.de", true },
- { "frankinteriordesign.co.uk", true },
- { "frankl.in", true },
- { "franklinmagic.com", true },
- { "frankopol-sklep.pl", true },
- { "frankpalomeque.com", true },
- { "frankslaughterinsurance.com", true },
- { "frankyan.com", true },
- { "franqois.id", true },
- { "frantic1048.com", true },
- { "frantorregrosa.me", true },
- { "franz-vatter.de", true },
- { "franz.beer", true },
- { "franziska-pascal.de", true },
- { "franziskaherbert.de", true },
- { "franzknoll.de", true },
- { "fraplaster.com", true },
- { "frappant.cc", true },
- { "frappant.net", true },
- { "frasch-umzuege.de", true },
- { "fraselab.ru", true },
- { "frasesconemocion.com", true },
- { "frasesdodia.com", true },
- { "frasesdodia.net", true },
- { "frasesparaface.com.br", true },
- { "frasesytarjetas.com", true },
- { "frattaroli.org", true },
- { "frau-inge.de", true },
- { "frau-pusteblu.me", true },
- { "frau-sucht-bauer.de", true },
- { "fraudmarc.com", true },
- { "frauen-etappenrennen.de", true },
- { "frauenarzt-niendorf.de", false },
- { "frauenarzt-zinke.de", true },
- { "frauenlob.rocks", true },
- { "fraufries.de", true },
- { "fraurichter.net", true },
- { "fraye.net", true },
- { "frazell.net", true },
- { "frbracch.it", true },
- { "frc.gov", true },
- { "frdl.ch", false },
- { "freaksites.dk", true },
- { "freaksports.com.au", true },
- { "freakyawesome.com", true },
- { "frebib.co.uk", true },
- { "frebib.com", true },
- { "frebib.net", true },
- { "freddieleeman.nl", true },
- { "fredericcote.com", true },
- { "frederik-braun.com", false },
- { "frederikshavn.net", true },
- { "frederikvig.com", true },
- { "fredhook.tk", true },
- { "fredloya.com", true },
- { "fredriksslaktforskning.se", true },
- { "freds4buildings.com", true },
- { "fredsmith.net", true },
- { "fredsmith.org", true },
- { "fredsmith.us", true },
- { "fredvoyage.fr", true },
- { "free-bitco.ml", true },
- { "free-generate.tk", true },
- { "free-ss.site", true },
- { "free.com.tw", true },
- { "freeaf.gq", true },
- { "freebarrettbrown.org", true },
- { "freebcard.com", true },
- { "freebegames.tk", true },
- { "freebetoffers.co.uk", true },
- { "freebies.id", true },
- { "freebookmakersbetsandbonuses.com.au", true },
- { "freeboson.org", true },
- { "freebsd.la", true },
- { "freebsd.one", true },
- { "freebsd.wiki", true },
- { "freebsdbrasil.com.br", true },
- { "freebus.org", true },
- { "freecloud.at", true },
- { "freecookies.nl", true },
- { "freedev.cz", true },
- { "freedgb.com", true },
- { "freedom.nl", false },
- { "freedom.press", true },
- { "freedom35.org", true },
- { "freedomfinance.se", true },
- { "freedomflotilla.org", true },
- { "freedomhk.info", true },
- { "freedomhkg.info", true },
- { "freedomhkg.net", true },
- { "freedomhkg.org", true },
- { "freedomonline.bg", true },
- { "freedomrahoitus.fi", true },
- { "freedomtoolkit.com", true },
- { "freeenglishhelp.com", true },
- { "freeexampapers.com", true },
- { "freefilesync.org", true },
- { "freefinancialhelp.net", true },
- { "freeform4u.de", true },
- { "freegame-mugen.jp", true },
- { "freegovernmentcellphoneguide.com", true },
- { "freegutters.com", true },
- { "freeiconspng.com", true },
- { "freeinoutboard.com", true },
- { "freejeremy.net", true },
- { "freekdevries.nl", true },
- { "freeks.com.br", true },
- { "freelance-webdesigner.jp", true },
- { "freelance.boutique", true },
- { "freelance.nl", true },
- { "freelanceessaywriters.com", true },
- { "freelancehunt.com", true },
- { "freelancejobs.org.uk", true },
- { "freelancerhub.online", true },
- { "freelanceunited.co.uk", true },
- { "freelauri.com", true },
- { "freelifer.jp", true },
- { "freemanlogistics.com", true },
- { "freemans.com", true },
- { "freeministryresources.org", true },
- { "freemomhugs.org", true },
- { "freemotion.tk", true },
- { "freemyipod.org", true },
- { "freenetproject.org", true },
- { "freeonplate.com", true },
- { "freepastlife.com", true },
- { "freepnglogos.com", true },
- { "freepublicprofile.com", true },
- { "freertomorrow.com", true },
- { "freeshell.de", true },
- { "freeshkre.li", true },
- { "freesitemapgenerator.com", true },
- { "freesms-online.de", true },
- { "freesnowden.is", true },
- { "freesoft-board.to", false },
- { "freesoftlab.com", true },
- { "freesolitaire.win", true },
- { "freesourcestl.org", true },
- { "freespot.mobi", true },
- { "freessl.tech", true },
- { "freesslcertificate.me", true },
- { "freestylesolutions.com", true },
- { "freetaxusa.com", true },
- { "freethetv.ie", true },
- { "freetrung.tk", true },
- { "freetsa.org", true },
- { "freevision.co", true },
- { "freevst.ir", true },
- { "freeweibo.com", true },
- { "freewerkt.nl", true },
- { "freewoodfactory.com", true },
- { "freeyourmusic.com", true },
- { "freezion.com", true },
- { "freiboth.ddns.net", true },
- { "freie-software.net", true },
- { "freiewaehler-verden.de", true },
- { "freifahrt.de", true },
- { "freifall.tk", true },
- { "freifamily.ch", true },
- { "freifunk-burgaltendorf.de", true },
- { "freifunk-essen.de", true },
- { "freifunk-luenen.de", true },
- { "freimeldungen.de", true },
- { "freims.cc", true },
- { "freitasul.com.br", true },
- { "freitasul.io", true },
- { "freiwuppertal.de", true },
- { "freiwurst.net", true },
- { "freizeitbad-riff.de", true },
- { "freizeitplaza.de", true },
- { "frenchcreekcog.org", true },
- { "frenchguy.ch", true },
- { "frenchmusic.fr", true },
- { "frequencebanane.ch", false },
- { "frequentflyerapp.com", true },
- { "fresh-hotel.org", true },
- { "fresh-networks.net", true },
- { "fresh.co.il", true },
- { "fresh4.co.uk", true },
- { "freshair.com.br", true },
- { "freshbean.club", true },
- { "freshbooks.com", true },
- { "freshdesigns.de", true },
- { "freshdns.nl", true },
- { "freshempire.gov", true },
- { "freshers9.com", true },
- { "freshmaza.com", true },
- { "freshpounds.com", true },
- { "fretscha.com", true },
- { "frettirnar.is", true },
- { "fretworksec.com", true },
- { "freundinnen-ausflug.de", true },
- { "freundinnen-kurzurlaub.de", true },
- { "freundinnen-urlaub.de", true },
- { "freundinnenausflug.de", true },
- { "frforms.com", true },
- { "friarsonbase.com", true },
- { "frickelboxx.de", true },
- { "frickelmeister.de", true },
- { "fridarestaurantemexicano.com", true },
- { "fridaysforfuture-bremen.de", true },
- { "fridolinka.cz", true },
- { "friedberg2020.de", true },
- { "friederes.lu", true },
- { "friederloch.de", true },
- { "friedrich-foto-art.de", true },
- { "friedsamphotography.com", true },
- { "friedstechnology.com", true },
- { "friedstechnology.nl", true },
- { "friedstechnology.online", true },
- { "friedzombie.com", true },
- { "friedzombie.nl", true },
- { "friedzombie.online", true },
- { "friendlycleaners.co.uk", true },
- { "friendlysiberia.com", true },
- { "friendowment.us", true },
- { "friends-of-naz.com", true },
- { "friends-socialgroup.org", true },
- { "friends.tn", true },
- { "friends24.cz", true },
- { "friendship-quotes.co.uk", true },
- { "friendshipismagicsquad.com", true },
- { "friendsofgfwpc.org", true },
- { "friet.org", true },
- { "frietbesteld.nl", true },
- { "frietzombie.nl", true },
- { "friezy.ru", true },
- { "frigi.ch", false },
- { "frign.de", true },
- { "frigolit.net", true },
- { "friller.com.au", true },
- { "frillip.com", true },
- { "fringeintravel.com", true },
- { "frinkiac.com", true },
- { "frino.de", true },
- { "frippz.se", true },
- { "friseur-foerder.de", true },
- { "friss.com", true },
- { "fritz-koehne-schule.de", true },
- { "fritzrepair.com", true },
- { "frizo.com", true },
- { "frizzless.com", true },
- { "fro.se", true },
- { "frob.nl", true },
- { "frode.win", true },
- { "froehliche-hessen.de", true },
- { "frogatto.com", true },
- { "frogeye.fr", true },
- { "froggitt.com", true },
- { "froh.co.jp", true },
- { "frolova.org", true },
- { "fromager.net", true },
- { "fromanolderwoman.com", true },
- { "fromscratch.rocks", true },
- { "fromtheboxoffice.com", true },
- { "fronteers.nl", false },
- { "frontier-ad.co.jp", true },
- { "frontiers.nl", true },
- { "frontline.cloud", true },
- { "frontlinemessenger.com", true },
- { "froogo.co.uk", true },
- { "fropky.com", true },
- { "frosoku.com", true },
- { "frostprotection.co.uk", true },
- { "frostwarning.com", true },
- { "frosty.sk", true },
- { "frothy.coffee", true },
- { "frovi.co.uk", true },
- { "frownonline.co.uk", true },
- { "frozen-geek.net", true },
- { "frozen-solid.net", true },
- { "frozendurian.club", true },
- { "frozenfutures.com", true },
- { "frozenjam.com", true },
- { "frozensector.com", true },
- { "frpg.gov", true },
- { "frprn.com", true },
- { "frprn.es", true },
- { "frprn.xxx", true },
- { "frsra.ml", true },
- { "frtib.gov", true },
- { "frtn.com", true },
- { "frtrains.com", false },
- { "fruchthof24.de", true },
- { "fruchtikus.net", true },
- { "fruend-hausgeraeteshop.de", true },
- { "frugalfamilyhome.com", true },
- { "frugalmechanic.com", true },
- { "frugro.be", true },
- { "fruit-farm.tk", true },
- { "fruition.co.jp", true },
- { "fruitscale.com", true },
- { "fruityten.co.uk", true },
- { "frusky.de", true },
- { "frutasyvejetales.com", true },
- { "fruxprivatebank.net", true },
- { "fryergroup.com", true },
- { "fs-g.org", true },
- { "fs-maistadt.de", true },
- { "fs257.com", true },
- { "fsavc.org.uk", true },
- { "fsbn.eu", true },
- { "fsbnh.bank", true },
- { "fsbpaintrock.com", true },
- { "fsbturton.com", true },
- { "fsch2009.com", true },
- { "fsck.jp", false },
- { "fsckd.com", true },
- { "fscott.de", true },
- { "fsfxpackages.com", true },
- { "fsg.one", true },
- { "fsgeek.ca", true },
- { "fsk.fo", true },
- { "fskounoike.com", true },
- { "fsky.info", true },
- { "fsm2016.org", true },
- { "fsps.ch", true },
- { "fsty.uk", true },
- { "fsvt.ch", false },
- { "ft.com", false },
- { "ftang.de", true },
- { "ftc.gov", false },
- { "ftccomplaintassistant.gov", true },
- { "ftcefile.gov", true },
- { "ftdev.in", true },
- { "ftexchange.com", true },
- { "ftgeufyihreufheriofeuozirgrgd.tk", true },
- { "fthat.link", true },
- { "ftl13.com", true },
- { "ftmc.tk", true },
- { "ftnpower.com", true },
- { "ftptest.net", true },
- { "ftrsecure.com", true },
- { "ftv.re", true },
- { "ftworthhousekeeper.com", true },
- { "ftx.com", true },
- { "ftx.io", true },
- { "fuantaishenhaimuli.net", true },
- { "fuckav.ru", true },
- { "fuckcie.com", true },
- { "fucklife.ch", true },
- { "fucknazis.tk", true },
- { "fuckup.dk", true },
- { "fuckz.net", true },
- { "fuechschen.org", true },
- { "fuelingyourdreams.com", false },
- { "fuerstenfelder-immobilien.de", true },
- { "fuglede.dk", true },
- { "fuite.ch", false },
- { "fuitedeau.ch", false },
- { "fuites.ch", false },
- { "fujianshipbuilding.com", true },
- { "fujiwaraqol.com", true },
- { "fujiwarashinzo.com", true },
- { "fukakukeiba.com", true },
- { "fukata.org", true },
- { "fukikaeru.com", true },
- { "fukt.ca", true },
- { "fukuiedu.com", true },
- { "fukushima-fun.com", true },
- { "fulfilmentcrowd.com", true },
- { "fulgenzis.com", true },
- { "fuliwang.info", true },
- { "fuliwang.us", true },
- { "full-race.com", true },
- { "full-stack.ninja", true },
- { "fullautomotivo.com.br", true },
- { "fullbundle.com", true },
- { "fullcirclestudio.nl", true },
- { "fullerlife.org.uk", true },
- { "fullfilez.com", true },
- { "fullhost.com", true },
- { "fullhub.ru", true },
- { "fullmatch.net", true },
- { "fullmoviez.co", true },
- { "fullstacknotes.com", false },
- { "fumblers.ca", true },
- { "fumerolles.ch", false },
- { "fumo.se", false },
- { "fun-bounce.co.uk", true },
- { "fun-fan.biz", true },
- { "fun-tasia.co.uk", true },
- { "fun4kidzbouncycastles.co.uk", true },
- { "fun4ubouncycastles.co.uk", true },
- { "fun888city.com", true },
- { "fun888city.net", true },
- { "fun88city.com", true },
- { "funadvisor.ca", true },
- { "funadvisorfrance.com", true },
- { "funatic.nl", true },
- { "funcabinrentals.com", true },
- { "funchestra.at", false },
- { "functional.cc", true },
- { "functions-online.com", true },
- { "fundacionfranciscofiasco.org", true },
- { "fundamentt.com", true },
- { "fundavi.jp", true },
- { "fundayltd.com", true },
- { "fundays.nl", true },
- { "fundchan.com", true },
- { "fundeego.com", false },
- { "fundingrainbows.com", true },
- { "fundkyapp.com", true },
- { "fundmylegalclaim.co.uk", true },
- { "fundort.ch", true },
- { "funds.ddns.net", true },
- { "funerare-cazacu.com", true },
- { "funfactorleeds.co.uk", true },
- { "funfair.io", true },
- { "funfoodco.co.uk", true },
- { "funfun.com.br", true },
- { "fungomoscow.cf", true },
- { "funhouse-inflatables.co.uk", true },
- { "funinbeds.org.uk", true },
- { "funken-networks.de", true },
- { "funkfernbedienung-industrie.de", true },
- { "funknotaus.de", true },
- { "funktionel.co", true },
- { "funktionevents.co.uk", true },
- { "funktionsverket.se", true },
- { "funkydealz.no", true },
- { "funmountaincanyon.com", true },
- { "funniestclip.com", true },
- { "funnybikini.com", true },
- { "funnychristianjokes.tk", true },
- { "funoverip.net", true },
- { "funsochi.ru", true },
- { "funspins.com", true },
- { "funtime-inflatables.co.uk", true },
- { "funtime.com.ua", true },
- { "funtime.kiev.ua", true },
- { "funtimeentertainment.co.uk", true },
- { "funtimesbouncycastles.co.uk", true },
- { "funyirotraktor.hu", true },
- { "fur.red", true },
- { "furcdn.net", true },
- { "furgetmeknot.org", true },
- { "furgo.love", true },
- { "furigana.info", true },
- { "furkancaliskan.com", true },
- { "furkot.com", true },
- { "furkot.de", true },
- { "furkot.es", true },
- { "furkot.fr", true },
- { "furkot.it", true },
- { "furkot.pl", true },
- { "furlan.co", false },
- { "furlog.it", false },
- { "furnfurs.com", true },
- { "furnishedproperty.com.au", true },
- { "furniturezoneboone.com", true },
- { "furries-united.de", true },
- { "furry.bot", true },
- { "furry.cat", true },
- { "furry.cool", true },
- { "furry.dk", true },
- { "furryrex.top", true },
- { "furrytech.network", true },
- { "fursuitbutts.com", true },
- { "fusa-miyamoto.jp", true },
- { "fusechange.org", true },
- { "fuselight.nl", true },
- { "fuseos.net", true },
- { "fuseyahoken.com", true },
- { "fussball-xxl.de", true },
- { "fussell.io", true },
- { "fuszara.pl", true },
- { "futa.moe", false },
- { "futaba-works.com", true },
- { "futbol-tv.tk", true },
- { "futbolvivo.tv", true },
- { "futbomb.com", true },
- { "future-moves.com", true },
- { "futureaudiographics.com", true },
- { "futurefastforward.com", true },
- { "futurefund.com", true },
- { "futuregrowthva.com", true },
- { "futurenda.com", true },
- { "futuressm.com", true },
- { "futurezone.at", true },
- { "fuuko.net", true },
- { "fuvelis.fr", true },
- { "fuwafuwa.moe", true },
- { "fuyu.moe", true },
- { "fuzenet.net", true },
- { "fuzoku.jp", true },
- { "fuzzing-project.org", true },
- { "fvap.gov", true },
- { "fveevaete.com", true },
- { "fwdx.net", true },
- { "fwest.ovh", true },
- { "fwest98.nl", true },
- { "fwest98.ovh", true },
- { "fws.gov", true },
- { "fwz.me", true },
- { "fx-rating.com", true },
- { "fx-rk.com", true },
- { "fx5.de", true },
- { "fxislamic.com", true },
- { "fxmarketing.com.au", true },
- { "fxmarketing.net.au", true },
- { "fxopen.co.uk", true },
- { "fxopen.com", true },
- { "fxopen.com.au", true },
- { "fxopen.com.br", true },
- { "fxopen.com.mx", true },
- { "fxopen.my", true },
- { "fxopen.ru", true },
- { "fxp.co.il", true },
- { "fxseo.com.au", true },
- { "fxsshiwo.cn", true },
- { "fxstrategics.com", true },
- { "fxtalk.cn", true },
- { "fxthai.com", true },
- { "fxtrade-lab.com", true },
- { "fxweb.co", true },
- { "fxwebsites.com.au", true },
- { "fxwebsites.net.au", true },
- { "fxwebstudio.net.au", true },
- { "fyfywka.com", true },
- { "fyksen.me", true },
- { "fyn.nl", true },
- { "fyner.lt", true },
- { "fyol.xyz", false },
- { "fyreek.me", true },
- { "fyretrine.com", true },
- { "fysesbjerg.dk", true },
- { "fysiomassageoosterhout.nl", true },
- { "fysiotherapieapeldoornzuid.nl", true },
- { "fysiotherapieholtenbroek.nl", true },
- { "fysiovdberg.nl", true },
- { "fyss.ga", true },
- { "fytcart.com", true },
- { "fytorio-pasxalis.gr", true },
- { "fzbrweb.cz", true },
- { "fzdm.com", true },
- { "fzhyzamt.com", true },
- { "fzx750.ru", true },
- { "g-ds.de", true },
- { "g-fruit.gr", true },
- { "g-lab.xyz", true },
- { "g-m-w.eu", true },
- { "g-p-design.com", true },
- { "g-rom.net", true },
- { "g.co", false },
- { "g00228.com", false },
- { "g0881.com", true },
- { "g0man.com", true },
- { "g1.ie", true },
- { "g10e.ch", true },
- { "g116688.com", true },
- { "g22-livechat.com", true },
- { "g2jp.uk", true },
- { "g2links.com", true },
- { "g2pla.net", true },
- { "g2ship.com", true },
- { "g2soft.net", true },
- { "g365.vip", true },
- { "g36533.com", true },
- { "g3d.ro", true },
- { "g3dev.ch", false },
- { "g3homefoods.com", true },
- { "g3rv4.com", true },
- { "g4w.co", true },
- { "g51365.com", true },
- { "g7yy.com", true },
- { "g81818.com", true },
- { "g818city.com", true },
- { "g8energysolutions.co.uk", true },
- { "ga-2.it", true },
- { "ga-part.ru", true },
- { "gaaz.fr", true },
- { "gabe.house", true },
- { "gabe565.com", true },
- { "gabeb1920.com", true },
- { "gabecook.com", true },
- { "gabinetejuridicotecnologicojuandemeseguer.es", true },
- { "gabinetpsychoterapii.krakow.pl", true },
- { "gabiocs.com", true },
- { "gablesportsga.com", true },
- { "gabriel.to", true },
- { "gabriele-kluge.de", true },
- { "gabriele.tips", true },
- { "gabrielgn.com.br", true },
- { "gabriella.cf", true },
- { "gabrielsteens.nl", true },
- { "gabryjeluk.tk", true },
- { "gachimuchi.ru", true },
- { "gachiyase.com", true },
- { "gachter.name", false },
- { "gaci88play.com", true },
- { "gadabit.pl", true },
- { "gaddini.it", true },
- { "gadgetadvisor.com", true },
- { "gadgethacks.com", true },
- { "gadgetstock.ir", true },
- { "gae123.com", true },
- { "gaelico.tk", true },
- { "gaengler.com", true },
- { "gaest.com", true },
- { "gaestehaus-leipzig.de", true },
- { "gaestehaus-monika.com", true },
- { "gaetanosonline.com", true },
- { "gaetantremois.fr", true },
- { "gaff-rig.co.uk", true },
- { "gaflooring.com", true },
- { "gafunds.com", true },
- { "gaganenterprises.in", true },
- { "gagliarducci.it", true },
- { "gagnerplusdargent.info", true },
- { "gagniard.org", true },
- { "gagor.pl", true },
- { "gagramore.cf", true },
- { "gagygnole.ch", false },
- { "gaiavanderzeyp.com", true },
- { "gaigelama.com", true },
- { "gaines-sodiamex.fr", true },
- { "gaio-automobiles.fr", true },
- { "gaireg.de", true },
- { "gaitandmobility.com", true },
- { "gaitrehabilitation.com", true },
- { "gaitresearch.com", true },
- { "gajas18.com", true },
- { "gajowniczek.eu", true },
- { "gakdigital.com", true },
- { "gakki.photos", true },
- { "gaku-architect.com", true },
- { "gala.kiev.ua", false },
- { "galabau-maurmann.de", true },
- { "galacg.me", true },
- { "galak.ch", false },
- { "galaktika-znakomstv.tk", true },
- { "galaltosalento.it", true },
- { "galanight.cz", true },
- { "galax.us", true },
- { "galaxus.at", true },
- { "galaxus.ch", true },
- { "galaxus.com", true },
- { "galaxus.de", true },
- { "galaxus.eu", true },
- { "galaxus.fr", true },
- { "galaxy.edu.pe", true },
- { "galaxymusicpromo.com", true },
- { "galaxyplex.tk", true },
- { "galaxyscientific.com", true },
- { "galeriakobylarz.pl", true },
- { "galeriarr.pl", true },
- { "galeries.photo", false },
- { "galganoboutique.com", true },
- { "galighticus.com", true },
- { "galileanhome.org", true },
- { "galinas-blog.de", true },
- { "galinos.gr", true },
- { "galj.info", true },
- { "galle.cz", true },
- { "galleonwaymedical.com.au", true },
- { "gallerify.eu", true },
- { "galletasgabi.com.mx", false },
- { "galleyfoods.com", true },
- { "gallicrooster.com", true },
- { "gallifreyapp.co.uk", true },
- { "gallifreypermaculture.com.au", true },
- { "gallmeyer-consulting.com", true },
- { "gallun-shop.com", true },
- { "galpaoap.com.br", true },
- { "galvingao.com", true },
- { "gamberorosso.menu", true },
- { "gambetti.fr", true },
- { "gambitnash.co.uk", true },
- { "gambitnash.com", true },
- { "gambitprint.com", true },
- { "gambler.ru", true },
- { "gamblerhealing.com", true },
- { "gamblernd.com", true },
- { "gambling-business.club", true },
- { "gamblinghero.com", true },
- { "gamcore.com", true },
- { "game-files.net", false },
- { "game-topic.ru", true },
- { "game4less.com", true },
- { "game7.de", true },
- { "game818play.com", true },
- { "game88city.com", true },
- { "game88city.net", true },
- { "game88play.com", true },
- { "game88yule.com", true },
- { "gameanalytics.com", true },
- { "gameblabla.nl", true },
- { "gamebrott.com", true },
- { "gamecard-shop.nl", true },
- { "gamechefpummarola.eu", true },
- { "gamechurch.de", true },
- { "gameclue.jp", true },
- { "gamecollector.be", true },
- { "gameconservation.org.uk", true },
- { "gamedevelopers.pl", true },
- { "gamegear.club", true },
- { "gamegix.com", true },
- { "gameharbor.duckdns.org", true },
- { "gameindustry.eu", true },
- { "gameisbest.jp", true },
- { "gamejobs.co", true },
- { "gamekaitori.jp", true },
- { "gamekeepers.cz", true },
- { "gamemodding.com", true },
- { "gamenauta.com.br", true },
- { "gamenerd.net", true },
- { "gameofbooks.de", true },
- { "gamepad.com.br", true },
- { "gameplaysforkids.com", true },
- { "gamepreorders.com", true },
- { "gamer-portal.com", true },
- { "gamercredo.com", true },
- { "gamereader.de", true },
- { "gamerepublic.hu", true },
- { "gameres.com", true },
- { "gamerezo.com", true },
- { "gamerspost.ga", true },
- { "gamerzdot.com", true },
- { "games4theworld.org", true },
- { "gamesaviour.com", true },
- { "gamesdepartment.co.uk", true },
- { "gameserver-admin.ga", true },
- { "gameserver-sponsor.me", true },
- { "gameshogun.xyz", true },
- { "gameshowchallenge.ie", true },
- { "gamesided.com", true },
- { "gamesme.cn", true },
- { "gamesplanet.com", true },
- { "gamesputnik.ru", true },
- { "gamestats.gg", true },
- { "gametilt.com", true },
- { "gametube.website", true },
- { "gamewinninggoal.com", true },
- { "gamilab.com", true },
- { "gamilab.no", true },
- { "gamingexodus.com", true },
- { "gamingmedley.com", true },
- { "gamingroomaccessories.com", true },
- { "gamingtilltheend.cf", true },
- { "gamingx.tk", true },
- { "gamingzoneservers.com", true },
- { "gamisalya.com", true },
- { "gamishou.fr", true },
- { "gamismu.com", true },
- { "gamivo.com", true },
- { "gammaphibeta.tk", true },
- { "ganado.org", true },
- { "ganaenergia.com", true },
- { "ganaenergia.es", true },
- { "ganasoku.net", true },
- { "gancedo.com.es", true },
- { "gandalfservice.com", true },
- { "gandalfthefeline.com", true },
- { "gandgliquors.com", true },
- { "ganggalbichler.at", true },
- { "gangnamcool.com", true },
- { "ganodermatiendaonline.com", true },
- { "ganpris.online", true },
- { "gansleit.com", false },
- { "ganyouxuan.com", true },
- { "ganzgraph.de", true },
- { "ganztagplus.de", true },
- { "gao.ci", true },
- { "gao.rocks", true },
- { "gaodebo.com", true },
- { "gaos.org", true },
- { "gaozj.com", true },
- { "gapdirect.com", true },
- { "gapfa.org", false },
- { "gaphag.ddns.net", true },
- { "garage-leone.com", false },
- { "garagedejan.ch", true },
- { "garagedoorrepairingsanjose.com", true },
- { "garageenginuity.com", true },
- { "garagegoossens.be", true },
- { "garagesmart.com.au", true },
- { "garagevanhulle-used.be", false },
- { "garanteasy.com", true },
- { "garazskapuszereles.hu", true },
- { "garbomuffin.com", true },
- { "garbott.co.uk", true },
- { "garcia-franco.com", true },
- { "garciagerman.com", true },
- { "garda-see.mobi", true },
- { "gardedenfantspourtous.fr", true },
- { "gardengameshireuk.com", true },
- { "gardeningdirect.co.uk", true },
- { "gardensandgifts.com", true },
- { "gardensquaredental.co.uk", true },
- { "gardenstate.tech", true },
- { "gardikagigih.com", true },
- { "gardis.ua", true },
- { "garduri-electrice-animale.ro", true },
- { "garethbowker.com", true },
- { "garethkirk.com", true },
- { "garethrhugh.es", true },
- { "gargazon.net", true },
- { "garnuchbau.de", true },
- { "garron.net", true },
- { "garrowmediallc.com", true },
- { "garsio.com", true },
- { "gartenbaur.de", true },
- { "gartenplanung-brendes.de", true },
- { "garycarmell.com", true },
- { "garycwaite.com", true },
- { "garyjones.co.uk", true },
- { "garyrh.com", true },
- { "garystallman.com", true },
- { "garyswine.com", true },
- { "garywhittington.com", true },
- { "gashalot.com", true },
- { "gasinstallationsjohannesburg.co.za", true },
- { "gaspapp.com", true },
- { "gastauftritt.net", true },
- { "gastoudererenda.nl", true },
- { "gastrobox.com.co", true },
- { "gastromedicalcenter.com.br", true },
- { "gastronom.ga", true },
- { "gastrotiger.at", true },
- { "gastrotiger.de", true },
- { "gate2home.com", true },
- { "gateaucreation.fr", true },
- { "gatekiller.co.uk", true },
- { "gatewaybridal.com", true },
- { "gatewayclub.com.au", true },
- { "gathegi.ga", true },
- { "gathermycrew.org.au", true },
- { "gathu.co.ke", true },
- { "gauche.com", true },
- { "gaudeamus-folklor.cz", true },
- { "gaudere.co.jp", true },
- { "gaussianwaves.com", true },
- { "gauthier.dk", true },
- { "gavin.sh", true },
- { "gavins.stream", true },
- { "gavlix.se", true },
- { "gavr.me", true },
- { "gavr.space", true },
- { "gavr.xyz", true },
- { "gaw.sh", true },
- { "gay-personal-ads.com", true },
- { "gay-sissies.com", true },
- { "gaya-sa.org", true },
- { "gayauthors.org", true },
- { "gaycc.cc", true },
- { "gaymerconnect.net", true },
- { "gaymerx.com", true },
- { "gaymerx.net", true },
- { "gaymerx.org", true },
- { "gaypirateassassins.com", true },
- { "gaysexpositions.guide", true },
- { "gaysfisting.com", true },
- { "gaytorrent.ru", true },
- { "gayukai.net", true },
- { "gayxsite.com", true },
- { "gazellegames.net", true },
- { "gazete.org", true },
- { "gazette.govt.nz", true },
- { "gazflynn.com", true },
- { "gazizov.tk", true },
- { "gb-repair.com", true },
- { "gbc-radio.nl", true },
- { "gbcsummercamps.com", true },
- { "gbl.selfip.net", true },
- { "gboys.net", false },
- { "gbs-uk.com", true },
- { "gbthatcher.com", true },
- { "gc-mc.de", true },
- { "gc.de", true },
- { "gc.gy", true },
- { "gc.ru.net", true },
- { "gcbit.dk", true },
- { "gcfadvisors.com", true },
- { "gchc.com", true },
- { "gchq.lol", true },
- { "gcode.space", true },
- { "gcoded.de", true },
- { "gcs-ventures.com", true },
- { "gcsepod.com", true },
- { "gd88.cc", true },
- { "gdb-tutorial.net", true },
- { "gdesemena.ru", true },
- { "gdgrzeszow.pl", true },
- { "gdiary.net", true },
- { "gdngs.de", true },
- { "gdoce.es", false },
- { "gdpr-pohotovost.cz", true },
- { "gdpr.fr", true },
- { "gdraco.com", true },
- { "gdv.me", true },
- { "gdz-spishy.com", true },
- { "ge3k.net", false },
- { "gear4you.shop", true },
- { "gearallnews.com", true },
- { "gearbot.rocks", true },
- { "gearboxhero.com", true },
- { "gearev.net", true },
- { "gearfinder.nl", true },
- { "gearset.com", true },
- { "gearwise.se", true },
- { "geaskb.nl", true },
- { "geba-online.de", true },
- { "gebn.co.uk", true },
- { "gebn.uk", true },
- { "geboortestoeltje.com", true },
- { "geborgen-wachsen.de", true },
- { "gebruikershandleiding.com", true },
- { "gecem.org", true },
- { "gechr.io", true },
- { "geckler-ee.de", false },
- { "geder.at", true },
- { "gedlingcastlehire.co.uk", true },
- { "gedlingtherapy.co.uk", true },
- { "geecrat.com", true },
- { "geek-hub.de", true },
- { "geek.ch", true },
- { "geekabit.nl", true },
- { "geekandi.com", true },
- { "geekariom.com", true },
- { "geekbundle.org", true },
- { "geekclubbooks.com", true },
- { "geekeffect.co.uk", true },
- { "geeklair.net", true },
- { "geeklan.co.uk", true },
- { "geekles.net", true },
- { "geekpad.com", true },
- { "geeks.berlin", true },
- { "geeks.lgbt", true },
- { "geeks.one", false },
- { "geeksandthecity.fr", true },
- { "geekshirts.cz", true },
- { "geekstreet.fr", true },
- { "geektarven.com", true },
- { "geektier.com", true },
- { "geektopia.es", true },
- { "geekwhack.org", true },
- { "geekwithabudget.com", true },
- { "geekwu.org", true },
- { "geekyquiz.com", true },
- { "geekz.sk", true },
- { "geekzone.co.nz", true },
- { "geekzone.fr", true },
- { "geeq.ch", true },
- { "geerdsen.net", true },
- { "geertdegraaf.nl", true },
- { "geertswei.nl", true },
- { "gefolge.org", true },
- { "gegeco.ch", false },
- { "geh.li", true },
- { "gehaowu.com", true },
- { "gehas-wein-shop.de", false },
- { "gehatrans.de", true },
- { "gehirn.co.jp", true },
- { "gehirn.jp", true },
- { "gehopft.de", true },
- { "gehreslaw.com", true },
- { "gehrke.cloud", true },
- { "gehrke.in", true },
- { "gehsicht.de", true },
- { "geigenbauer.in", false },
- { "geiser-family.ch", true },
- { "geisser-elektronikdata.de", true },
- { "geitenijs.com", true },
- { "gelaendermanufaktur.de", true },
- { "gelb-computer.de", true },
- { "geld-im-blick.de", true },
- { "geld24.nl", true },
- { "geldimblick.de", true },
- { "geleenbeekdal.nl", true },
- { "geleia-real.com", true },
- { "gelis.ch", true },
- { "gellis12.com", true },
- { "gelog-software.de", false },
- { "gelonghui.com", true },
- { "geloofindemocratie.nl", false },
- { "gelpinhos.pt", true },
- { "gelsey.com", true },
- { "geluidsstudio.com", true },
- { "geluk.io", true },
- { "gelukkigehonden.nl", true },
- { "geluleminceur.fr", true },
- { "gemails.eu", true },
- { "gemeentestein.nl", true },
- { "gemeinsam-ideen-verwirklichen.de", true },
- { "gemini.com", true },
- { "gemquery.com", true },
- { "gemstn.com", true },
- { "gemstonz.org", true },
- { "genbright.com", true },
- { "genchev.io", true },
- { "gencmedya.com", true },
- { "gender-summit.com", true },
- { "genderidentiteit.nl", true },
- { "gendrin.com", true },
- { "gendundrupa.ch", true },
- { "gene-drive.com", true },
- { "gene-drives.com", true },
- { "genealogiegazet.nl", true },
- { "genealogieonline.nl", true },
- { "genealogiewerkbalk.nl", true },
- { "genealorand.com", true },
- { "geneau.net", true },
- { "genehightower.com", true },
- { "genehome.com.au", true },
- { "genen.ga", true },
- { "generador-electrico.com", true },
- { "general-anaesthesia.com", true },
- { "general-anaesthetics.com", true },
- { "general-anesthesia.com", true },
- { "general-plast.com", true },
- { "generalinsuranceservices.com", true },
- { "generationr.nl", true },
- { "generator.creditcard", true },
- { "generic.cx", true },
- { "generujdata.cz", true },
- { "genesiseureka.com", true },
- { "genesismachina.ca", true },
- { "genesistrading.com", true },
- { "genesysmi.com", true },
- { "genetargetsolutions.com.au", true },
- { "genetidyne.com", true },
- { "genevachauffeur.com", true },
- { "geneve-naturisme.ch", false },
- { "genevoise-entretien.ch", true },
- { "genfaerd.dk", true },
- { "genioideal.com", true },
- { "geniush.ovh", true },
- { "geniusteacher.in", true },
- { "geniuszone.biz", true },
- { "gennerator.com", true },
- { "genocidediary.org", true },
- { "genodeftest.de", true },
- { "genomedia.jp", true },
- { "genomequestlive.com", true },
- { "genosse-einhorn.de", true },
- { "genossenwiese.ch", true },
- { "genoveve.de", true },
- { "gensend.com", true },
- { "gensenwedding.jp", true },
- { "genshiken-itb.org", true },
- { "gensicke.de", true },
- { "genslerapps.com", true },
- { "genslerwisp.com", true },
- { "gensokyo.re", true },
- { "gensonline.eu", true },
- { "gentcdn.com", true },
- { "gentledance.ch", true },
- { "gentledance.net", true },
- { "gentlent.com", true },
- { "gentlent.net", true },
- { "gentoo-blog.de", true },
- { "gentoocn.org", true },
- { "gentz.rocks", true },
- { "genunlimited.tk", true },
- { "genusshotel-riegersburg.at", true },
- { "geocar.com", true },
- { "geocompass.at", true },
- { "geoffnussmd.com", true },
- { "geoffsec.org", true },
- { "geofox.org", true },
- { "geography-schools.com", true },
- { "geohoney.com", true },
- { "geoip.fedoraproject.org", true },
- { "geoip.stg.fedoraproject.org", true },
- { "geojs.io", true },
- { "geology-schools.com", true },
- { "geomac.gov", true },
- { "geometra.roma.it", true },
- { "geometra24.it", true },
- { "geomex.be", true },
- { "geomonkeys.com", true },
- { "geoponika.gr", true },
- { "geoport.al", true },
- { "georadar-algerie.com", true },
- { "george-brighton.co.uk", true },
- { "george-orwell.com", true },
- { "georgeblack.me", true },
- { "georgebrighton.co.uk", true },
- { "georgecolgrove.com", true },
- { "georgedesign.ch", true },
- { "georgekaraoglanis.tk", true },
- { "georgemaschke.net", true },
- { "georgepancescu.ro", true },
- { "georgesand.be", true },
- { "georgescarryout.com", true },
- { "georgewatson.me", true },
- { "georgewbushlibrary.gov", true },
- { "georgiaautoglass.net", true },
- { "georgiadance.com", true },
- { "georgiaglassrepair.com", true },
- { "georgiastuartyoga.co.uk", false },
- { "georgiaurologist.com", true },
- { "georgioskontaxis.com", true },
- { "georgioskontaxis.net", true },
- { "georgioskontaxis.org", true },
- { "georgmayer.eu", true },
- { "geoscan.aero", true },
- { "geoscope.ch", false },
- { "geotab.com", true },
- { "gepgroup.gr", true },
- { "gepps.de", true },
- { "geraintwhite.co.uk", true },
- { "gerald-zojer.com", true },
- { "geraldoazevedo.com.br", true },
- { "geraldsonrealty.com", true },
- { "gerardinden.nl", true },
- { "gerardozamudio.mx", true },
- { "gerbang-singkolo.ga", true },
- { "gerbyte.co.uk", true },
- { "gerbyte.com", true },
- { "gerinet.pl", true },
- { "germandarknes.net", true },
- { "germanicvs.tk", true },
- { "germanmasterpainters.nz", true },
- { "germanssky.de", true },
- { "germantrip.tk", true },
- { "germanytravel.ga", true },
- { "germanytravelguide.ml", true },
- { "gernert-server.de", true },
- { "gero.io", true },
- { "geroiplavska.tk", true },
- { "gerritcodereview.com", true },
- { "gervais-avocat.fr", true },
- { "gerwinvanderkamp.nl", true },
- { "ges-bo.de", true },
- { "gesamenvat.nl", true },
- { "geschaeftsideen-ebook.de", true },
- { "geschichtscheck.de", true },
- { "geschmacksache.online", true },
- { "geschwinder.net", true },
- { "gesevi.com", true },
- { "gesica.cloud", true },
- { "gesmav-trier.de", true },
- { "gesnex.com", true },
- { "gessettirotti.it", true },
- { "gestionrocamar.es", true },
- { "gestlifes.com", true },
- { "gestormensajeria.com", true },
- { "gestsal.com", true },
- { "gestus.co", true },
- { "gesunddurchenergie.ch", true },
- { "gesundheitmassage.com", true },
- { "gesundheitswelt24.de", true },
- { "get-california-real-estate.com", true },
- { "get-erp.ru", true },
- { "get-it-live.com", true },
- { "get-it-live.de", true },
- { "get-maurice.com", true },
- { "get-on.bid", true },
- { "get-quick-bits-fast-2018.pw", true },
- { "get.how", true },
- { "get2getha.org", true },
- { "getacrane.co.uk", true },
- { "getalitools.ru", true },
- { "getbookked.com", true },
- { "getbooks.co.il", true },
- { "getboubou.com", true },
- { "getbox.me", true },
- { "getbreadcrumbs.com", true },
- { "getbrowink.com", true },
- { "getbutterfly.com", true },
- { "getcard.cc", true },
- { "getcertified.pro", true },
- { "getcheapinsurancenow.info", true },
- { "getcloak.com", false },
- { "getdash.io", true },
- { "getdeveloper.de", true },
- { "geteduroam.no", true },
- { "geterp.ru", true },
- { "geteventbox.com", true },
- { "getfedora.org", true },
- { "getfirstalert.com", true },
- { "getflorence.co.uk", true },
- { "getgeek.es", true },
- { "getgeek.se", true },
- { "gethow.org", true },
- { "gethttpsforfree.com", true },
- { "getidmcc.com", true },
- { "getinphase.com", true },
- { "getintopc.com", true },
- { "getitlive.de", true },
- { "getlawyered.com.au", true },
- { "getmango.com", true },
- { "getmdl.io", true },
- { "getmerch.eu", true },
- { "getmovil.com", false },
- { "getnib.com", true },
- { "getnikola.com", true },
- { "getonyx.com", true },
- { "getpagespeed.com", true },
- { "getpaidclub.tk", true },
- { "getpanelapp.com", true },
- { "getpei.com", true },
- { "getpromo.cf", true },
- { "getpublii.com", true },
- { "getrambling.com", true },
- { "getsecure.nl", true },
- { "getsensibill.com", true },
- { "getsetbounce.co.uk", true },
- { "getsmartaboutdrugs.gov", false },
- { "getsmarterinsurance.com", true },
- { "getsport.mobi", true },
- { "getsubs.net", true },
- { "getteamninja.com", true },
- { "getthefriendsyouwant.com", true },
- { "getticker.com", true },
- { "gettok.com", true },
- { "gettopquality.com", true },
- { "getupandbounce.co.uk", true },
- { "getvdownloader.com", true },
- { "getwemap.com", true },
- { "getwisdom.io", true },
- { "getwork.tk", true },
- { "getyour.nz", true },
- { "getyourlifestraight.com", true },
- { "geus-okna.eu", true },
- { "gevelreinigingtiel.nl", true },
- { "geyduschek.be", true },
- { "gezinnenhilton.com", true },
- { "gezondetips.nl", true },
- { "gf-franken.de", true },
- { "gf5fcalc.com", true },
- { "gfac.ru", true },
- { "gfahnen.de", true },
- { "gfast.ru", true },
- { "gfcleisure.co.uk", true },
- { "gfe.li", true },
- { "gfedating.com", true },
- { "gfelite.de", true },
- { "gfestival.fo", true },
- { "gfk-kunststoff-luebben.de", true },
- { "gflame.de", true },
- { "gforce.ninja", true },
- { "gfoss.eu", true },
- { "gfourmis.co", true },
- { "gfronline.tk", true },
- { "gfxbench.com", true },
- { "gfxworld.tk", true },
- { "ggbet.me", true },
- { "ggdcpt.com", true },
- { "gggggg.org", true },
- { "gginin.today", true },
- { "ggismo.com", true },
- { "ggiveilig.nl", true },
- { "ggl-luzern.ch", false },
- { "ggma.co.uk", true },
- { "ggmmontascale.it", true },
- { "ggp2.com", true },
- { "ggs-marschallstrasse.de", true },
- { "ggs.jp", true },
- { "ggservers.com", true },
- { "ggx.us", true },
- { "gh-sandanski.com", true },
- { "gha.st", true },
- { "gheestore.in", true },
- { "ghettonetflix.de", true },
- { "ghfip.com.au", true },
- { "ghini.com", true },
- { "ghislainphu.fr", true },
- { "ghkim.net", true },
- { "ghostsupreme.eu", true },
- { "ghowell.io", true },
- { "ghull.email", true },
- { "ghuntley.com", false },
- { "giac.net", true },
- { "giac.org", true },
- { "giacomopelagatti.it", true },
- { "giakki.eu", false },
- { "giannademartini.com", true },
- { "gianproperties.com", true },
- { "giant-panda.com", true },
- { "giant-tortoise.com", true },
- { "gianttree.de", true },
- { "giaoxudongtri.com", true },
- { "giaphaco.com", true },
- { "giardinaggio.milano.it", true },
- { "giardinaggio.napoli.it", true },
- { "giardinaggio.roma.it", true },
- { "giardiniblog.it", true },
- { "giardiniere.bologna.it", true },
- { "giardiniere.milano.it", true },
- { "giardiniere.roma.it", true },
- { "gichigamigames.com", true },
- { "giebel.it", true },
- { "gielectrical.com.au", true },
- { "giemall.com", true },
- { "gierds.de", true },
- { "gieschke.de", true },
- { "giethoorn.com", true },
- { "gietvloergarant.nl", false },
- { "gifino.fr", true },
- { "giftcard.net", true },
- { "giftcardgranny.com", true },
- { "giftedconsortium.com", true },
- { "giftking.nl", false },
- { "giftlist.guru", true },
- { "gifts365.co.uk", true },
- { "giftya.com", true },
- { "gifudodo.com", true },
- { "gig-raiffeisen.de", true },
- { "giga.nl", true },
- { "gigabitz.pw", true },
- { "gigantism.com", true },
- { "gigasoft.tk", true },
- { "giggletotz.co.uk", true },
- { "gigin.eu", true },
- { "gigin.me", true },
- { "gigis-pizzeria.de", true },
- { "gigis.cloud", true },
- { "giglink.club", true },
- { "gigolodavid.be", true },
- { "gigs.guide", true },
- { "gigseekr.com", true },
- { "gijsbertus.com", true },
- { "gijswesterman.nl", true },
- { "gikovatelojavirtual.com.br", true },
- { "gilangcp.com", true },
- { "gileadpac.com", true },
- { "giliamor.com", true },
- { "gillfamily.de", true },
- { "gillmanandsoame.co.uk", true },
- { "gillyscastles.co.uk", true },
- { "gilme.net", true },
- { "gilnet.be", false },
- { "gimme.money", true },
- { "gimnazjum-miloslaw.tk", true },
- { "gina-architektur.design", true },
- { "ginabaum.com", true },
- { "ginen.xyz", true },
- { "gingersutton.com", true },
- { "ginionusedcars.be", false },
- { "ginja.co.th", true },
- { "ginnegappen.nl", true },
- { "ginniemae.gov", true },
- { "gino-gelati.de", true },
- { "ginza-luce.net", true },
- { "ginza-viola.com", true },
- { "ginzadelunch.jp", true },
- { "ginzaj.com", true },
- { "giochiecodici.it", true },
- { "gioielleriamolena.com", true },
- { "giovannarossi.tk", true },
- { "gipelpsb.fr", true },
- { "gipfelbuch.gr", true },
- { "gippert-klein.de", true },
- { "giraffeduck.com", true },
- { "giraffenland.de", true },
- { "giraffes.org", true },
- { "giri.co", true },
- { "girl.science", true },
- { "girlan.net", true },
- { "girlinthetiara.com", true },
- { "girlsforum.com", true },
- { "girlz.jp", true },
- { "girsa.org", true },
- { "girvas.ru", true },
- { "gisac.org", true },
- { "gisauto.ru", true },
- { "gisch.tk", true },
- { "gisher.news", true },
- { "gisher.org", true },
- { "gisher.video", true },
- { "gishiko.net", true },
- { "gistr.io", true },
- { "git.market", false },
- { "git.sb", true },
- { "git.tt", true },
- { "gitecolombedesbois.com", true },
- { "gitep.org.uk", true },
- { "gites-alizea.com", true },
- { "gitesdeshautescourennes.com", true },
- { "github.com", true },
- { "githubapp.com", true },
- { "githubber.com", true },
- { "githubber.tv", true },
- { "gitla.in", true },
- { "gittigidiyor.com", true },
- { "gittr.ch", true },
- { "gitube.cn", true },
- { "giuem.com", true },
- { "giunchi.net", true },
- { "giuseppemacario.men", true },
- { "givastar.com", true },
- { "give.net", true },
- { "give2charity.co", true },
- { "give2charityapp.com", true },
- { "giveattheoffice.org", false },
- { "giveaways.ph", true },
- { "givemylife.gq", true },
- { "given2.com", true },
- { "givepenny.com", true },
- { "givesunlight.com", true },
- { "givingnexus.org", false },
- { "givingtools.com", true },
- { "gixtools.com", true },
- { "gixtools.net", true },
- { "gizmo.ovh", true },
- { "gj-bochum.de", true },
- { "gjcampbell.co.uk", true },
- { "gjengset.com", true },
- { "gjspunk.de", false },
- { "gkasper.de", true },
- { "gkb2020.ch", true },
- { "gkoenig-innenausbau.de", true },
- { "gkralik.eu", true },
- { "gku-winterling.de", false },
- { "gkv-gorinchem.nl", true },
- { "gl.search.yahoo.com", false },
- { "glaciernursery.com", true },
- { "gladdy.co.uk", true },
- { "gladdymedia.co.uk", true },
- { "gladdymedia.com", true },
- { "gladdymedia.uk", true },
- { "gladiac.duckdns.org", true },
- { "gladwellentertainments.co.uk", true },
- { "gladysstrickland.com", true },
- { "glahcks.com", true },
- { "glamcosmetic.ch", true },
- { "glamguru.co.il", true },
- { "glamguru.world", true },
- { "glamira.de", true },
- { "glammybabes.com", true },
- { "glamour4you.de", true },
- { "glamourdaze.com", true },
- { "glamouria.com.br", true },
- { "glamur-video.com", true },
- { "glasdon.com", true },
- { "glasen-hardt.de", true },
- { "glasfaser-im-hanseviertel.de", true },
- { "glasgestaltung.biz", true },
- { "glasner.photo", true },
- { "glass.google.com", true },
- { "glassemployees.com", true },
- { "glassexpertswa.com", true },
- { "glassofgrape.com", true },
- { "glassrainbowtrust.org.je", true },
- { "glassrom.pw", true },
- { "glasweld.com", true },
- { "glavsudexpertiza.ru", true },
- { "glazedmag.fr", true },
- { "glcastlekings.co.uk", true },
- { "gleanview.com", true },
- { "glebov.tk", true },
- { "gleich-aluminium-shop.de", true },
- { "glenberviegolfclub.com", true },
- { "glencarbide.com", true },
- { "glendarraghbouncycastles.co.uk", true },
- { "glenhuntlyapartments.com.au", true },
- { "glenshere.com", true },
- { "glexia.com", true },
- { "glidingshop.cz", true },
- { "glidingshop.de", true },
- { "glidingshop.eu", true },
- { "gliihc.net", true },
- { "glimhome.com", true },
- { "glittersjabloon.nl", true },
- { "glitzafricafashionweek.com", true },
- { "glitzerstuecke.de", true },
- { "glixee.com", true },
- { "glk.partners", true },
- { "glloq.org", false },
- { "gloalerts.com", true },
- { "global-adult-webcams.com", true },
- { "global-monitoring.com", true },
- { "global-office.com", false },
- { "global-village.koeln", true },
- { "global1.gg", true },
- { "globalbano.com", true },
- { "globalchokepoints.org", true },
- { "globalcomix.com", true },
- { "globaleaks.org", true },
- { "globalesm.com", true },
- { "globalgovernancewatch.org", true },
- { "globalhealth.gov", true },
- { "globalhealthstrategiesnetwork.com", true },
- { "globalhealthstrategiesnetwork.info", true },
- { "globalhealthstrategiesnetwork.net", true },
- { "globalhealthstrategiesnetwork.org", true },
- { "globalinvestigations.co.uk", true },
- { "globalipaction.ch", true },
- { "globalisierung-fakten.de", true },
- { "globalitac.com", true },
- { "globalnewsdaily.cf", true },
- { "globalno.me", true },
- { "globalonetechnology.com", true },
- { "globalprojetores.com.br", true },
- { "globalresearchcouncil.org", true },
- { "globalresistancecorporation.com", true },
- { "globalshippinglimited.ga", true },
- { "globalvoice.ga", true },
- { "globalwitness.org", true },
- { "globalzone.tk", true },
- { "globecollege.nl", true },
- { "globelink-group.com", true },
- { "globemusic.es", true },
- { "globetalent.nl", true },
- { "globologic.com", true },
- { "glocalworks.jp", true },
- { "gloeckle-gruppe.de", true },
- { "glofox.com", true },
- { "glolighting.co.za", true },
- { "gloneta.com", false },
- { "glont.net", true },
- { "gloryholefucking.com", true },
- { "glosiko.com", true },
- { "glosons.com", true },
- { "glotech.co.uk", true },
- { "glotechkitchens.co.uk", true },
- { "glotechrepairs.co.uk", true },
- { "gloucestershiregospelpartnership.org.uk", true },
- { "glueck-im-norden.de", true },
- { "gluecksgriff-taschen.de", true },
- { "glueckskindter.de", true },
- { "gluedtomusic.com", true },
- { "gluhov-ss.ru", true },
- { "gluit.de", true },
- { "glutenfreehomemaker.com", true },
- { "glutenfreelife.co.nz", true },
- { "glutenfreevr.com", true },
- { "glykofridis.nl", true },
- { "glyptodon.com", true },
- { "glyxins.com", true },
- { "gm.search.yahoo.com", false },
- { "gmacedo.com", true },
- { "gmail.com", false },
- { "gmao.com", true },
- { "gmbh-kiekin.de", true },
- { "gmc.uy", true },
- { "gmccar.it", true },
- { "gmcd.co", true },
- { "gmdu.net", true },
- { "gmenhq.com", true },
- { "gmind.ovh", true },
- { "gmod.de", true },
- { "gmpark.dk", true },
- { "gmpartsdb.com", true },
- { "gmslparking.co.uk", true },
- { "gmta.nl", true },
- { "gmtplus.co.za", true },
- { "gmuh.fr", true },
- { "gmw-ingenieurbuero.de", true },
- { "gmx.at", true },
- { "gmx.ch", true },
- { "gmx.co.uk", true },
- { "gmx.com", true },
- { "gmx.de", true },
- { "gmx.es", true },
- { "gmx.fr", true },
- { "gmx.net", true },
- { "gn00.com", true },
- { "gnax.jp", false },
- { "gnetion.com", true },
- { "gnetwork.eu", true },
- { "gnezdo.tk", true },
- { "gnfrazier.me", true },
- { "gnilebein.de", true },
- { "gnk.io", true },
- { "gnmlive.com", true },
- { "gnucashtoqif.us", true },
- { "gnwp.eu", true },
- { "go-away.xyz", true },
- { "go-datasecurity.de", true },
- { "go-dutch.eu", true },
- { "go-embedded.de", true },
- { "go-kuwait.tk", true },
- { "go-life.com.tw", true },
- { "go-propiedades.cl", true },
- { "go-srx.tk", true },
- { "go-wild.co.uk", true },
- { "go-zh.org", true },
- { "go.exchange", true },
- { "go.microsoft.com", true },
- { "go2archive.nl", true },
- { "go2people-websites.nl", true },
- { "go2ubl.nl", true },
- { "go889w.com", true },
- { "goa8.xyz", true },
- { "goalbookapp.com", true },
- { "goanalyse.co.uk", true },
- { "goand.run", true },
- { "goarmy.eu", true },
- { "goatcloud.com", true },
- { "goaudits.com", true },
- { "gobarrelroll.com", true },
- { "gobiz.com.my", true },
- { "gobouncy.co.uk", true },
- { "gobouncy.com", true },
- { "gobytedesign.co.uk", true },
- { "goc4wraps.com", true },
- { "gocardless.com", true },
- { "gocher.me", true },
- { "gochu.se", true },
- { "gocleanerslondon.co.uk", true },
- { "god-clan.hu", true },
- { "godall.tk", true },
- { "godan.tech", true },
- { "godattributes.com", true },
- { "godaxen.tv", true },
- { "godclan.hu", true },
- { "goddg.com", true },
- { "godesigner.ru", true },
- { "godruoyi.com", true },
- { "godsofhell.com", true },
- { "godsofhell.de", true },
- { "goeb.eu", true },
- { "goeb.org", true },
- { "goededoelkerstkaarten.nl", true },
- { "goedkopeonesies.nl", true },
- { "goedverzekerd.net", true },
- { "goehler-baumpflege.de", true },
- { "goemail.me", true },
- { "goerres2014.de", true },
- { "goetemp.de", true },
- { "goettinger-biergarten.de", true },
- { "goffrie.com", true },
- { "goflo.net", true },
- { "gofoiayourself.org", true },
- { "gogle-analytics.com", true },
- { "gogleapis.com", true },
- { "gogoodyear.eu", true },
- { "gogroopie.com", true },
- { "gogroopie.ie", true },
- { "gogrow.com", true },
- { "gogs.ca", true },
- { "gogsat.com", true },
- { "gohon.org", true },
- { "goingreen.com.au", true },
- { "goiymua.com", true },
- { "gokhankesici.com", true },
- { "gokmenguresci.com", true },
- { "golang.org", true },
- { "golang.zone", true },
- { "golangnews.com", true },
- { "goldandgopher.com", true },
- { "goldclubcasino.com", true },
- { "goldcoast-plumbing.com.au", true },
- { "goldcoastasian.com", true },
- { "goldcoasthypnotherapyhypnosis.com.au", true },
- { "goldcoastphotographycourses.com", true },
- { "goldcoaststumpbusters.com", true },
- { "golden-kamuy.com", true },
- { "goldenage.tk", true },
- { "goldenbadger.de", true },
- { "goldendawnapersonalaffair.com", true },
- { "goldenhillsoftware.com", true },
- { "goldenhost.ca", true },
- { "goldenhostmyanmar.com", false },
- { "goldenplate.com.sg", true },
- { "goldfmromania.ro", true },
- { "goldlevelmarketing.com", true },
- { "goldlevelprint.com", true },
- { "goldmark.com.au", false },
- { "goldpreisfinder.at", true },
- { "goldsecurity.com", true },
- { "goldships.com", true },
- { "goldsilver.org.ua", true },
- { "goldskysecurity.com", true },
- { "goldstein.tel", true },
- { "goldsteinlawgroup.com", true },
- { "goldytechspecialists.com", true },
- { "golf18network.com", true },
- { "golf18staging.com", true },
- { "golfhausmallorca.com", true },
- { "golfscape.com", true },
- { "golighthouse.com", true },
- { "golik.net.pl", false },
- { "golnet.hu", true },
- { "golosok.ml", true },
- { "golser-schuh.at", true },
- { "golser.info", true },
- { "gomasy.jp", true },
- { "gomedium.com", true },
- { "gomel.chat", true },
- { "gomel.city", true },
- { "gomelchat.com", true },
- { "gomelphoto.com", true },
- { "gommista.roma.it", true },
- { "gondelvaartdwarsgracht.nl", true },
- { "gondola-parkinson.com", true },
- { "gongjianwei.com", true },
- { "gongjuhao.com", true },
- { "gonx.dk", false },
- { "goo.gl", true },
- { "gooby.co", false },
- { "good-tips.pro", true },
- { "good588.com", true },
- { "gooday.life", true },
- { "goodfor.us", true },
- { "goodhealthtv.com", true },
- { "goodiesoft.hu", true },
- { "goodmood.co.uk", true },
- { "goodmood.fr", true },
- { "goodmoodsocken.de", true },
- { "goodquote.gq", false },
- { "goodshepherdmv.com", true },
- { "goodsleep.pet", true },
- { "goodth.ink", true },
- { "goodtrip.kr", true },
- { "goodvibesblog.com", true },
- { "google", true },
- { "google-analytics.com", true },
- { "googleandroid.cz", true },
- { "googlemail.com", false },
- { "googleplex.com", true },
- { "googleshortcuts.org", true },
- { "googlesource.com", true },
- { "goombi.fr", true },
- { "goonersworld.co.uk", true },
- { "goonfleet.com", true },
- { "gooty.ru", true },
- { "goover.de", true },
- { "goow.in", true },
- { "goozp.com", true },
- { "goparity.com", true },
- { "gopayz.com.my", true },
- { "gophoto.it", true },
- { "gopnikman.cf", true },
- { "gopostore.com", true },
- { "goproinspectiongroup.com", true },
- { "goquiq.com", true },
- { "goquiqstatus.com", true },
- { "gordeijnsbouw.nl", true },
- { "gordonchevy.com", true },
- { "gordonscouts.com.au", true },
- { "gordy.fr", true },
- { "gordyf.com", true },
- { "gordyforty.com", true },
- { "gorgeconnect.com", true },
- { "gorgias.me", true },
- { "gorky.media", true },
- { "gorn.ch", true },
- { "gornergrat-kulm.ch", true },
- { "gorodabakan.ml", true },
- { "gorodrostov.tk", true },
- { "gorpg.club", true },
- { "gosaavd.tk", true },
- { "gosccs.com", true },
- { "gosforthdentalsurgery.co.uk", true },
- { "goshawkdb.io", true },
- { "goshin-group.co.jp", true },
- { "goshow.tv", true },
- { "gosnipe.com", true },
- { "gosolockpicks.com", true },
- { "gospelfollower.com", true },
- { "gospelites.com", true },
- { "gospelvestcination.de", true },
- { "gospicers.ca", true },
- { "gospomedley.com.ng", true },
- { "gosportweather.co.uk", true },
- { "gostaffer.com", true },
- { "gostargazing.co.uk", true },
- { "gosti-dom.ga", true },
- { "gosu.pro", true },
- { "gosuland.org", true },
- { "goswak.com", true },
- { "goszakupki.tk", true },
- { "got-tty.de", true },
- { "goteborgsklassikern.se", true },
- { "gotech.com.eg", false },
- { "gothamlimo.com", true },
- { "gothic.dating", true },
- { "gotirupati.com", false },
- { "gotmalk.org", false },
- { "goto.google.com", true },
- { "goto.msk.ru", true },
- { "goto.world", true },
- { "goto10.se", true },
- { "gotomi.info", false },
- { "gotowebsites.info", true },
- { "gotowned.org", false },
- { "gotoxy.at", true },
- { "gotrail.fr", true },
- { "gotravel.us", true },
- { "gottcode.org", false },
- { "goudenharynck.be", true },
- { "gouforit.com", true },
- { "gougeaway.tk", true },
- { "gouldcooksey.com", true },
- { "goup.co", true },
- { "goup.com.tr", true },
- { "gourgouli.com", true },
- { "gourmetfestival.de", true },
- { "gourmetspalencia.com", true },
- { "gourmetvitamins.ga", true },
- { "gov.tc", true },
- { "gov.uk", false },
- { "governmentjobs.gov", true },
- { "governorhub.com", true },
- { "govisitcostarica.co.cr", true },
- { "govisitcostarica.com", true },
- { "govloans.gov", true },
- { "govsurvey.us", true },
- { "govtjobs.blog", true },
- { "govtrack.us", true },
- { "govype.com", true },
- { "gow220.ru", true },
- { "gowancommunications.com", true },
- { "goweraesthetics.co.uk", true },
- { "gowervets.co.uk", true },
- { "gowildrodeo.co.uk", true },
- { "gowithflo.de", true },
- { "gozaars.com", true },
- { "gozenhost.com", true },
- { "gpalabs.com", true },
- { "gpcp.org", true },
- { "gpcsolutions.fr", true },
- { "gpdimaranathasiantar.org", false },
- { "gpfclan.de", true },
- { "gpfitness.com.br", true },
- { "gpgscoins.com", true },
- { "gpl-elite.store", true },
- { "gplans.us", true },
- { "gplvilla.com", true },
- { "gpm.ltd", true },
- { "gpna.org", true },
- { "gprs.uk.com", true },
- { "gps-fleettracking.ga", true },
- { "gpsblackbox.com", true },
- { "gpsolarpanels.com", true },
- { "gpsvideocanada.com", true },
- { "gpswebsoft.ml", true },
- { "gpu.nu", true },
- { "gpureport.cz", true },
- { "gpz500s.tk", true },
- { "gqmstore.com.br", true },
- { "gqyyingshi.com", true },
- { "gqyys.com", true },
- { "gqyyy.cc", true },
- { "gr.search.yahoo.com", false },
- { "gr8engineer2b.com", true },
- { "grabacabpa.com", true },
- { "grabadolasermonterrey.com", true },
- { "grabatt.de", true },
- { "grabtech.vn", true },
- { "grace-wan.com", true },
- { "gracebaking.com", false },
- { "gracedays.org", true },
- { "gracethrufaith.com", true },
- { "gracetini.com", true },
- { "graddient.com", true },
- { "gradecam.com", false },
- { "gradienthosting.co.uk", true },
- { "gradients.com", true },
- { "gradualgram.com", true },
- { "graeber.com", true },
- { "graecum.org", true },
- { "graetnew.com", true },
- { "graf-igor.ch", true },
- { "graf.re", true },
- { "grafcaps.com", true },
- { "graffen.dk", true },
- { "grafia.ink", true },
- { "graficasantana.com.br", true },
- { "grafik.gq", true },
- { "grafittikontroll.cf", true },
- { "grafmag.pl", true },
- { "grafoteka.pl", true },
- { "graft.community", true },
- { "graft.observer", true },
- { "grahamarthur.com", true },
- { "grahambaker.ca", true },
- { "grahamcarruthers.co.za", true },
- { "grahamcluley.com", true },
- { "grailians.com", true },
- { "grailify.com", true },
- { "graingert.co.uk", true },
- { "graliv.net", false },
- { "gramiaperu.com", true },
- { "grammysgrid.com", true },
- { "grand-city38.ru", true },
- { "grandcafecineac.nl", true },
- { "grandcafetwist.nl", true },
- { "grandcapital.cn", true },
- { "grandcapital.id", true },
- { "grandcapital.net", true },
- { "grandcapital.ru", true },
- { "grandcastles.co.uk", true },
- { "grandchene.ch", false },
- { "grande.coffee", true },
- { "grandeto.com", true },
- { "grandisco.tk", true },
- { "grandjunctionbrewing.com", true },
- { "grandmusiccentral.com.au", true },
- { "grandpadusercontent.com", true },
- { "grandwailea.com", true },
- { "grandworldnghiduong.com", false },
- { "granfort.es", false },
- { "graniteind.com", true },
- { "grannyshouse.de", true },
- { "grantcooper.com", true },
- { "grantmorrison.net", true },
- { "grantpark.org", true },
- { "grantplatform.com", true },
- { "grantsmasters.com", true },
- { "grantsplatform.com", true },
- { "graonatural.com.br", true },
- { "grapee.jp", true },
- { "grapeintentions.com", true },
- { "grapevine.is", true },
- { "graph.org", true },
- { "graphcommons.com", true },
- { "graphene.software", true },
- { "grapheneos.org", true },
- { "graphic-schools.com", true },
- { "graphic-shot.com", true },
- { "graphobyte.com", true },
- { "grapholio.net", true },
- { "grasboomamersfoort.nl", true },
- { "grasboombinnendoor.nl", true },
- { "grasboomclophaemer.nl", true },
- { "grasboomderoos.nl", true },
- { "grasboomleusden.nl", true },
- { "grasboommax.nl", true },
- { "grasboommeerbalans.nl", true },
- { "grasboomveenendaal.nl", true },
- { "grasboomvondellaan.nl", true },
- { "grasmark.com", true },
- { "graspingtech.com", true },
- { "grasscity.com", true },
- { "grassenberg.de", true },
- { "grasshoppervape.com", true },
- { "grasso.io", true },
- { "grassreinforcement.com.au", true },
- { "gratis.market", true },
- { "gratisgamecards.nl", true },
- { "gratisonlinespel.tk", true },
- { "gratisrollenspieltag.de", true },
- { "gratiswifivoorjegasten.nl", true },
- { "gratitudeabundancepassion.com", true },
- { "grattan.co.uk", true },
- { "graumeier.de", true },
- { "gravilink.com", true },
- { "graviola.es", true },
- { "gravitascreative.net", true },
- { "gravityformspdfextended.com", true },
- { "gravitypdf.com", true },
- { "grawe-blog.at", true },
- { "grayclub.co.il", true },
- { "grayhatter.com", true },
- { "grayiron.io", true },
- { "grayscale.co", true },
- { "grayson.sh", true },
- { "graz2020.com", true },
- { "grazieitalian.com", true },
- { "grazitti.com", true },
- { "grc.com", false },
- { "greatagain.gov", true },
- { "greaterlowellpediatrics.com", true },
- { "greaterreadingyp.org", true },
- { "greatestwebsiteonearth.com", true },
- { "greatfire.org", true },
- { "greathairtransplants.com", true },
- { "greatislandarts.ca", true },
- { "greatlakeside.de", true },
- { "greatlifeinsurancegroup.com", true },
- { "greatskillchecks.com", true },
- { "greatwebdesign.uk", true },
- { "greboid.com", true },
- { "greek-kitchen.co", true },
- { "greek.dating", true },
- { "greekmusic.academy", true },
- { "greekplots.com", true },
- { "greeks.tk", true },
- { "green-anarchy.tk", true },
- { "green-attitude.be", true },
- { "green-care.nl", true },
- { "green-light.co.nz", true },
- { "green-techno.ru", true },
- { "greenaddress.it", true },
- { "greenapproach.ca", true },
- { "greencircleplantnursery.com.au", true },
- { "greencircleplantnursery.net.au", true },
- { "greendrive.tk", true },
- { "greener.pl", true },
- { "greengates.co.uk", true },
- { "greengorych.ru", true },
- { "greenhats.de", true },
- { "greenliquidsystem.com", true },
- { "greenliv.pl", true },
- { "greenlungs.net", true },
- { "greenmachines.com", true },
- { "greenoutdoor.dk", false },
- { "greenpanda.de", true },
- { "greenpark.uz", true },
- { "greenpartyofnewmilford.org", true },
- { "greenpathscience.com", true },
- { "greenpaws.ee", true },
- { "greenpeace-magazin.de", true },
- { "greenpeace.berlin", true },
- { "greenponik.com", true },
- { "greenroach.ru", true },
- { "greenrushdaily.com", true },
- { "greensad36.ru", true },
- { "greensborosecuritycameras.com", true },
- { "greensdictofslang.com", true },
- { "greensidevetpractice.co.uk", true },
- { "greenstreethammers.com", true },
- { "greentea.ml", true },
- { "greenteamtwente.nl", true },
- { "greenwithdecor.com", true },
- { "greg.red", true },
- { "gregbrimble.com", true },
- { "greger.me", true },
- { "gregmarziomedia-dev.com", true },
- { "gregmarziomedia.com", true },
- { "gregmc.ru", true },
- { "gregmilton.com", true },
- { "gregmote.com", true },
- { "gregoirow.be", false },
- { "gregorians.org", true },
- { "gregorkofler.com", true },
- { "gregory-thibault.com", true },
- { "gregorydorrifourt.fr", true },
- { "gregorykelleher.com", true },
- { "gregoryrealestategroup.com", true },
- { "gregorywiest.com", true },
- { "greice.de", true },
- { "greiner-it.de", true },
- { "greinerj.de", true },
- { "grekiskagudar.tk", true },
- { "grenadiercorps-kaarst.de", true },
- { "grenadiere-kaarst.de", true },
- { "grenadierkorps-kaarst.de", true },
- { "grenadierkorps.de", true },
- { "grendel.no", true },
- { "grenlandkiropraktor.no", true },
- { "grepmaste.rs", false },
- { "grepular.com", true },
- { "greta-birkner.de", true },
- { "grexx.today", true },
- { "greyhash.se", true },
- { "greymattertechs.com", true },
- { "greysky.me", true },
- { "greyskymedia.com", true },
- { "greysolutions.it", true },
- { "greywizard.com", true },
- { "greywolf.cz", true },
- { "grh.am", true },
- { "griassdi-reseller.de", true },
- { "gricargo.com", true },
- { "grid.studio", true },
- { "gridpack.org", true },
- { "gridtennis.net", true },
- { "griechische-pfoetchen.de", true },
- { "griefheart.com", true },
- { "grieg-gaarden.no", true },
- { "grieg.no", false },
- { "griegfoundation.no", true },
- { "grieglogistics.no", true },
- { "griegshipbrokers.com", true },
- { "griegshipbrokers.no", true },
- { "griesser2.de", true },
- { "griffinsrfc.tk", true },
- { "grifomarchetti.com", true },
- { "grillen-darf-nicht-gesund-sein.de", true },
- { "grilllness.com", true },
- { "grillteller42.de", true },
- { "grimcalc.com", true },
- { "grimm-gastrobedarf.de", true },
- { "grimm.cz", true },
- { "grimneko.de", true },
- { "grimstveit.no", true },
- { "grinnellplanes.com", true },
- { "grinnellplans.com", true },
- { "grippe-impftermin.de", false },
- { "griswoldplumbingct.com", true },
- { "griswoldwellwaterct.com", true },
- { "gritte.ch", true },
- { "grizz.gdn", true },
- { "grizzlys.com", true },
- { "grocerybuild.com", true },
- { "grocock.me.uk", true },
- { "groenaquasolutions.nl", true },
- { "groentebesteld.nl", true },
- { "groepjam-usedcars.be", false },
- { "grog.pw", true },
- { "grokandtonic.com", true },
- { "grokker.com", true },
- { "groklearning.com", true },
- { "grolimur.ch", true },
- { "gronau-it-cloud-computing.de", true },
- { "grondius.com", true },
- { "groomershop.ru", false },
- { "groomscroft.co.uk", true },
- { "groomscroft.com", true },
- { "grootinadvies.nl", true },
- { "groovydisk.com", true },
- { "groovygoldfish.org", true },
- { "gropp.org", true },
- { "grosdebit.com", true },
- { "gross.business", true },
- { "grossberger-ge.org", true },
- { "grossiste-en-ligne.com", true },
- { "groszek.pl", true },
- { "groth.im", true },
- { "groth.xyz", true },
- { "grothoff.org", true },
- { "grottenthaler.eu", true },
- { "grouindev.net", true },
- { "groundmc.net", true },
- { "groundthumpingmotors.com", true },
- { "groundthumpingmotors.net", true },
- { "groundthumpinmotors.com", true },
- { "groundthumpinmotors.net", true },
- { "group4layers.net", true },
- { "groupe-neurologique-nord.lu", true },
- { "groupeatrium.net", true },
- { "groupem6.fr", true },
- { "groupescr.fr", true },
- { "groupghistelinck-cars.be", false },
- { "grouphomes.com.au", false },
- { "groupme.com", true },
- { "groups.google.com", true },
- { "groupseslogistic.com", true },
- { "grove-archiv.de", true },
- { "growingallthings.co.uk", true },
- { "growingsmiles.co.uk", true },
- { "growit.events", true },
- { "growth-rocket.com", true },
- { "growthseedconsulting.com", true },
- { "growwithdaylight.co.uk", true },
- { "growy.ch", false },
- { "grrmmll.com", true },
- { "grsecurity.net", true },
- { "gruble.de", true },
- { "gruebebraeu.ch", true },
- { "gruenderlehrstuhl.de", true },
- { "gruenderwoche-dresden.de", true },
- { "gruene-im-rvr.de", true },
- { "gruene-wattenscheid.de", true },
- { "gruenes-wp.de", true },
- { "gruenprint.de", true },
- { "gruenstreifen-ev.de", true },
- { "gruhn.email", true },
- { "grumpy.fr", true },
- { "grumpygamers.com", true },
- { "grumpyseb.com", true },
- { "grundlage.com.ua", true },
- { "grundschule-mittelbuch.de", true },
- { "grunwaldzki.center", true },
- { "grunwasser.fr", true },
- { "grupdedansa.tk", true },
- { "gruper.mk", true },
- { "grupoalpi.com", true },
- { "grupoattia.com", true },
- { "grupocata.com", true },
- { "grupodatco.com", true },
- { "grupog2i.com", true },
- { "grupoinassa.com", true },
- { "grupomakben.com", false },
- { "grupomedlegal.com", true },
- { "grupoparco.com", true },
- { "grupoproabienesraices.com.mx", true },
- { "gruposertaoveredas.com.br", true },
- { "gruselgrotte.com", true },
- { "grusenmeyer.be", true },
- { "gruver.de", true },
- { "gruwa.net", true },
- { "gruzoperevozki.ml", true },
- { "gs1pt.org", true },
- { "gs93.de", true },
- { "gsaj114.net", true },
- { "gscloud.xyz", true },
- { "gse.space", true },
- { "gsimagebank.co.uk", true },
- { "gslaw.edu.gh", true },
- { "gslink.me", true },
- { "gsmsale.nl", true },
- { "gsmsecurity.net", true },
- { "gsoc.se", true },
- { "gsrc.io", true },
- { "gst.name", true },
- { "gst.priv.at", true },
- { "gstand.tk", true },
- { "gt-himmel.com", true },
- { "gt-network.de", true },
- { "gta-arabs.com", true },
- { "gtacty.co", true },
- { "gtaforum.nl", true },
- { "gtcprojects.com", true },
- { "gtdgo.com", false },
- { "gtlfsonlinepay.com", true },
- { "gtmetrix.com", true },
- { "gtn-pravda.ru", true },
- { "gtoepfer.de", true },
- { "gtopala.com", true },
- { "gtopala.net", true },
- { "gtour.info", false },
- { "gtravers-basketmaker.co.uk", true },
- { "gtxbbs.com", true },
- { "gtxmail.de", true },
- { "guadagnare.info", true },
- { "guadalgrass.com", true },
- { "guancha.org", true },
- { "guangjiangk.com", true },
- { "guanyembadalona.org", true },
- { "guanzhong.ca", true },
- { "guardian360.nl", true },
- { "guardianportal.us", true },
- { "gubagoo.com", true },
- { "gubagoo.io", true },
- { "gudini.net", true },
- { "gudrunfit.dk", true },
- { "guegan.de", true },
- { "guenthereder.at", true },
- { "guenthernoack.de", true },
- { "guerard.info", true },
- { "guerrilla.technology", true },
- { "guesthouse-namaste.com", true },
- { "guevener.de", true },
- { "gueze-ardeche.fr", true },
- { "gueze-sas.fr", true },
- { "guffr.it", true },
- { "guge.ch", true },
- { "gugs.tk", true },
- { "guhei.net", true },
- { "guhenry3.tk", true },
- { "guiacursos.online", true },
- { "guiadamassagem.site", true },
- { "guiaextra.com", true },
- { "guiaswow.com", true },
- { "guichet-entreprises.fr", true },
- { "guichet-qualifications.fr", true },
- { "guid2steamid.com", true },
- { "guid2steamid.pw", true },
- { "guidebook.co.tz", true },
- { "guidedselling.net", true },
- { "guideline.gov", false },
- { "guidelines.gov", false },
- { "guideo.ch", false },
- { "guidepointsecurity.com", true },
- { "guidesacademe.com", true },
- { "guidesorbetiere.com", true },
- { "guidethailande.tk", true },
- { "guidetoiceland.is", false },
- { "guildbase.de", true },
- { "guilde-dissection.com", true },
- { "guildofmusicsupervisors.co.uk", true },
- { "guillaume-briand.fr", true },
- { "guillaumematheron.fr", true },
- { "guillaumeperrin.io", true },
- { "guillemaud.me", false },
- { "guillen.tk", true },
- { "guim.co.uk", true },
- { "guineapigmustach.es", true },
- { "guitarangel.tk", true },
- { "gujun-sky.com", true },
- { "gulchuk.com", true },
- { "gulcinulutuna.com", true },
- { "gulfstream.ru", true },
- { "gulleyperformancecenter.com", true },
- { "gulshankumar.net", true },
- { "gumeyamall.jp", true },
- { "gumi.ca", true },
- { "gummientchen.net", true },
- { "gunauc.net", true },
- { "gunbrig.com", true },
- { "gunerds.com.br", true },
- { "gunlukburc.net", true },
- { "gunn.ee", true },
- { "gunstatus.net", true },
- { "gunwatch.co.uk", true },
- { "gunworld.com.au", true },
- { "gunz.net", true },
- { "guodong.net", true },
- { "guohuageng.com", true },
- { "guoke.com", true },
- { "guolaw.ca", true },
- { "guoliang.me", true },
- { "guozeyu.com", true },
- { "gupfen.ch", true },
- { "guphi.net", true },
- { "gurmel.ru", true },
- { "guru-naradi.cz", true },
- { "gurucomi.com", true },
- { "gurunpa.com", true },
- { "gururi.com", true },
- { "gus.host", true },
- { "gustaff.de", true },
- { "gut8er.com.de", true },
- { "gute-schulen-porta.de", true },
- { "gutieli.com", true },
- { "gutools.co.uk", true },
- { "gutschein-spezialist.de", true },
- { "gutscheinemagic.de", true },
- { "gutscheingeiz.de", true },
- { "guyeskens.be", true },
- { "guyfletcher.com", true },
- { "guys-reviews.ml", true },
- { "guysauto.com", true },
- { "guytarrant.co.uk", true },
- { "guzdek.co", true },
- { "guzelforum.tk", true },
- { "guzlewski.pl", true },
- { "gv-neumann.de", true },
- { "gv-salto.nl", true },
- { "gvatas.in", true },
- { "gveh.de", true },
- { "gvi-timing.ch", false },
- { "gvitebsk.cf", true },
- { "gvitiming.ch", false },
- { "gvobgyn.ca", true },
- { "gvoetbaldagenalcides.nl", true },
- { "gvt2.com", true },
- { "gvt3.com", true },
- { "gvwgroup.cloud", true },
- { "gvwgroup.com", true },
- { "gvwparts.com", true },
- { "gw2efficiency.com", true },
- { "gw2treasures.com", true },
- { "gw2zone.net", true },
- { "gw66.cc", true },
- { "gwbet99.cc", true },
- { "gwerder.net", true },
- { "gwhois.org", true },
- { "gwo24.pl", true },
- { "gwrtech.com", true },
- { "gwsec.co.uk", true },
- { "gwynfryncottages.com", true },
- { "gxlrx.net", true },
- { "gxmyqy.net", true },
- { "gxpconsultora.com", true },
- { "gyas.nl", true },
- { "gymagine.ch", true },
- { "gymbunny.de", true },
- { "gymhero.me", true },
- { "gymjp.com", true },
- { "gymkirchenfeld.ch", true },
- { "gymlife.fr", true },
- { "gymnaserenens.ch", false },
- { "gymnasium-hittfeld.de", true },
- { "gymnastic.ga", true },
- { "gymnastikfitness.se", true },
- { "gymnchod.cz", true },
- { "gympap.de", true },
- { "gympass.com", true },
- { "gynaecology.co", true },
- { "gynem.de", true },
- { "gynoguide.com", true },
- { "gypsyreel.com", true },
- { "gyre.ch", false },
- { "gyrenens.ch", false },
- { "gyroscopicinvesting.com", true },
- { "gyu-raku.jp", true },
- { "gyulakerezsi.ro", true },
- { "gz-architekten.de", true },
- { "gz-benz.com", true },
- { "gz-bmw.com", true },
- { "gza.jp", true },
- { "gzom.ru", true },
- { "gzriedstadt.de", true },
- { "h-ealthy.net", true },
- { "h-jo.net", true },
- { "h-server.myfirewall.org", true },
- { "h001.ru", true },
- { "h09.eu", true },
- { "h10l.com", true },
- { "h11.io", false },
- { "h1ctf.com", true },
- { "h1z1swap.com", true },
- { "h24.org", true },
- { "h2b.me", true },
- { "h2rul.eu", true },
- { "h2s-design.de", true },
- { "h2u.tv", true },
- { "h365.vip", true },
- { "h36533.com", true },
- { "h36594.com", true },
- { "h3artbl33d.nl", true },
- { "h3x.net", true },
- { "h3z.jp", true },
- { "h404bi.com", true },
- { "h4kl4b.rs", true },
- { "h51365.com", true },
- { "h6852.com", true },
- { "h6853.com", true },
- { "h6895.com", true },
- { "h6913.com", true },
- { "h81818.com", true },
- { "h9386.com", true },
- { "ha-kunamatata.de", true },
- { "ha.com", true },
- { "ha3.eu", true },
- { "ha6.ru", true },
- { "haarigerrattenarsch.com", true },
- { "haarlemsesaxofoonschool.nl", true },
- { "haarstudiok99.nl", true },
- { "haavard.me", true },
- { "haazen.xyz", true },
- { "habarisoft.com", true },
- { "habbstars.org", true },
- { "haberer.me", true },
- { "habernet.tk", true },
- { "habitable.ga", true },
- { "habitat-domotique.fr", true },
- { "habr.com", true },
- { "habtium.es", true },
- { "hac2er.net", true },
- { "hacc.top", true },
- { "haccp.bergamo.it", true },
- { "haccp.milano.it", true },
- { "haccp.roma.it", true },
- { "hacertest.com", true },
- { "hacettepeteknokent.com.tr", true },
- { "hachre.de", false },
- { "hack.club", true },
- { "hackademix.net", true },
- { "hackadena.com", true },
- { "hackanders.com", true },
- { "hackattack.com", true },
- { "hackbarth.guru", true },
- { "hackbeil.name", true },
- { "hackdown.org", true },
- { "hackendoz.com", true },
- { "hackenkunjeleren.nl", true },
- { "hackenturet.dk", true },
- { "hacker.club", true },
- { "hacker.holiday", true },
- { "hacker.im", true },
- { "hacker.one", true },
- { "hacker1.com", true },
- { "hacker101.com", true },
- { "hackerchai.com", true },
- { "hackerco.com", true },
- { "hackereyes.com", true },
- { "hackerflare.com", true },
- { "hackergateway.com", true },
- { "hackernet.se", true },
- { "hackerone-ext-content.com", true },
- { "hackerone-user-content.com", true },
- { "hackerone.at", true },
- { "hackerone.blog", true },
- { "hackerone.com", true },
- { "hackerone.events", true },
- { "hackerone.live", true },
- { "hackerone.net", true },
- { "hackerone.org", true },
- { "hackgins.com", true },
- { "hackingand.coffee", false },
- { "hackingarise.com", true },
- { "hackingdh.com", true },
- { "hackingvision.com", true },
- { "hackintosh.eu", true },
- { "hackmd.io", true },
- { "hackmeimfamo.us", true },
- { "hackreone.com", true },
- { "hacksoc.co.uk", true },
- { "hackthat.tk", true },
- { "hackthissite.org", true },
- { "hacktivis.me", true },
- { "hacktober.dk", true },
- { "hackworx.com", false },
- { "hadaly.fr", true },
- { "haderecker.me", true },
- { "hadleighswimmingclub.co.uk", true },
- { "hadleyluker.com", true },
- { "hadouk.in", true },
- { "hadrons.org", true },
- { "hads0m.tech", true },
- { "hady.fr", true },
- { "haeckdesign.com", true },
- { "haefligermedia.ch", true },
- { "haehnel.xyz", true },
- { "haemka.de", true },
- { "haens.li", true },
- { "haerwu.biz", true },
- { "hafer.tech", true },
- { "haferman.net", true },
- { "haferman.org", true },
- { "hafniatimes.com", true },
- { "hag27.com", true },
- { "haggeluring.su", true },
- { "hagiati.gr", true },
- { "hagier.pl", true },
- { "hagueaustralia.com.au", true },
- { "haha-raku.com", true },
- { "haha.nl", true },
- { "hahay.es", true },
- { "haiboxu.com", true },
- { "hailstorm.nl", true },
- { "hainanstar.cc", true },
- { "haindlmuehle.eu", true },
- { "hair-guide.net", true },
- { "hair-reborn.be", true },
- { "haircode.gr", true },
- { "haircrazy.com", true },
- { "haircutideas.gq", true },
- { "hairfitwolvega.nl", true },
- { "hairpins.tk", true },
- { "hairplaybychenellekay.com", false },
- { "hairraisingphotobooths.co.uk", true },
- { "hairtonic-lab.com", true },
- { "haitaka.cc", true },
- { "hajekj.com", true },
- { "hajekj.cz", true },
- { "hajekj.net", true },
- { "haju.fi", true },
- { "haka.se", true },
- { "hakaru.org", true },
- { "hakase.pw", true },
- { "hakatabijin-mind.com", true },
- { "hake.me", true },
- { "hakimova.tk", true },
- { "hakkariradyo.tk", true },
- { "hakkasan.com", true },
- { "hakkasannightclub.com", true },
- { "halacs.hu", true },
- { "halbich.design", true },
- { "halfhosting.de", true },
- { "halihali.cc", true },
- { "halilweb.tk", true },
- { "halilyagcioglu.tk", true },
- { "halitopuroprodutos.com.br", true },
- { "halkirkbouncycastles.co.uk", true },
- { "hallaminternet.com", true },
- { "hallcouture.com", true },
- { "hallelujahsoftware.com", true },
- { "hallhireforevents.co.uk", true },
- { "hallhuber.com", true },
- { "halliday.work", true },
- { "halligladen.de", true },
- { "hallmarkestates.ca", true },
- { "hallme.com", true },
- { "halls.hu", true },
- { "hallucinogen.com", true },
- { "hallucinogens.org", true },
- { "halo.fr", true },
- { "halocredit.pl", true },
- { "haloria.com", true },
- { "haltegame.com", true },
- { "halyul.com", true },
- { "hamacho-kyudo.com", true },
- { "hamali.bg", true },
- { "hamarimarriage.tk", true },
- { "hambassadors.org", true },
- { "hamburg40grad.de", true },
- { "hamburgerbesteld.nl", true },
- { "hamburgobgyn.com", true },
- { "hamcocc.com", true },
- { "hamcram.io", true },
- { "hamiltonlinen.com", true },
- { "hamiltonmedical.nl", true },
- { "hamiltonweather.ca", true },
- { "hamiltonzinelibrary.cf", true },
- { "hammer-schnaps.com", true },
- { "hammer-sms.com", true },
- { "hammercast.fm", true },
- { "hammerpondkennels.co.uk", true },
- { "hampl.tv", true },
- { "hampshiretechservices.co.uk", true },
- { "hamsystems.eu", true },
- { "hana-groupsac.com", true },
- { "hana.ondemand.com", true },
- { "hanakaraku.com", true },
- { "hanazono.tokyo", true },
- { "hanbing.it", true },
- { "hancocklawfl.com", true },
- { "handbrake.fr", true },
- { "handcraft.eu.org", true },
- { "handgelenkbandage-test.de", true },
- { "handknit.com.np", true },
- { "handlecoin.com", true },
- { "handleidingkwijt.com", true },
- { "handy-reparatur-berlin.com", true },
- { "handymanbypolli.com", true },
- { "handymanlondonplease.co.uk", true },
- { "handynummer-info.ch", true },
- { "handynummer.online", true },
- { "handysex.live", true },
- { "handyticket.de", true },
- { "hanfox.co.uk", false },
- { "hanfverband-erfurt.de", true },
- { "hangar.hosting", true },
- { "hangcapnach.com", true },
- { "hangerphant.com", true },
- { "hangout", true },
- { "hangouts.google.com", true },
- { "hangtenseo.com", true },
- { "hanjuapp.com", true },
- { "hankr.com", true },
- { "hanksacservice.com", true },
- { "hannah.link", true },
- { "hannahi.com", true },
- { "hannasecret.de", true },
- { "hannes.paris", true },
- { "hannoluteijn.nl", true },
- { "hannover.de", true },
- { "hannywbarek.com", true },
- { "hanpenblog.com", true },
- { "hansbijster.nl", true },
- { "hanschventures.com", true },
- { "hansen-kronshagen.de", true },
- { "hansen.hn", true },
- { "hansgoes.it", true },
- { "hansgoes.nl", true },
- { "hansgoesit.nl", true },
- { "hansminten.com", true },
- { "hansmund.com", true },
- { "hansolrella.com", true },
- { "hansonian.com", true },
- { "hansvaneijsden.com", true },
- { "hansvaneijsden.nl", true },
- { "hanteln-fitness.de", true },
- { "hantse.com", true },
- { "hanu.la", true },
- { "hanxv.pw", true },
- { "hanyibo.com", true },
- { "hanzubon.jp", true },
- { "hao-zhang.com", true },
- { "hao6.ag", true },
- { "hao8.ag", true },
- { "haogoodair.ca", true },
- { "haozhang.org", true },
- { "haozhexie.com", true },
- { "haozhuanfa.com", true },
- { "hapheemraadssingel.nl", true },
- { "haplogroup.org", true },
- { "happist.com", true },
- { "happy-life-food.de", true },
- { "happyagain.de", true },
- { "happyagain.se", true },
- { "happyandrelaxeddogs.eu", true },
- { "happybirthdaywisher.com", true },
- { "happybounce.co.uk", true },
- { "happybrush.de", true },
- { "happycarb.de", true },
- { "happychat.io", true },
- { "happychungus.tk", true },
- { "happycoder.net", true },
- { "happydoq.ch", false },
- { "happygadget.me", true },
- { "happyhourboard.com", true },
- { "happykidscastles.co.uk", true },
- { "happylearning.com", true },
- { "happylifestyle.com", true },
- { "happyschnapper.com", true },
- { "happyteamlabs.com", true },
- { "happyukgo.com", true },
- { "hapsana.nl", true },
- { "haptemic.com", true },
- { "harabar.ml", true },
- { "haraj.com.sa", true },
- { "harald-d.dyndns.org", true },
- { "harald-pfeiffer.de", true },
- { "haramainbd.com", true },
- { "harapecorita.com", true },
- { "harbor-light.net", true },
- { "hardcoen.com", true },
- { "hardcore-bodybuilding.nl", true },
- { "hardeman.nu", true },
- { "hardenize.com", true },
- { "hardergayporn.com", true },
- { "hardertimes.com", true },
- { "hardfalcon.net", true },
- { "hardfloorcleaninglondon.co.uk", true },
- { "hardforum.com", true },
- { "hardh.at", true },
- { "hardhat.io", true },
- { "hardrain980.com", true },
- { "hardrock.tk", true },
- { "hardtfrieden.de", true },
- { "hardwareschotte.de", true },
- { "harelmallac.com", true },
- { "harelmallacglobal.com", true },
- { "hargamobilmu.com", true },
- { "haribilalic.com", true },
- { "harilova.fr", true },
- { "harington.fr", true },
- { "harion.fr", true },
- { "harisht.me", false },
- { "harititan.com", true },
- { "haritsa.co.id", true },
- { "harjitbhogal.com", true },
- { "harley-davidson-live.com", true },
- { "harmfarm.nl", true },
- { "harmoney.co.nz", true },
- { "harmoney.com", true },
- { "harmoney.com.au", true },
- { "harmonyplace.com", true },
- { "harms.io", true },
- { "harmsboone.org", true },
- { "harnov.dk", true },
- { "haroldsharpe.com", true },
- { "harp.gov", true },
- { "harpoo.jp", false },
- { "harringtonca.com", true },
- { "harrisandharris.com.au", true },
- { "harrisconsulting.ie", true },
- { "harrisonm.com", true },
- { "harrisonswebsites.com", true },
- { "harrygerritstransport.nl", true },
- { "harrymclaren.co.uk", true },
- { "harrysmallbones.co.uk", true },
- { "harrysqnc.co.uk", true },
- { "harschnitz.nl", false },
- { "hartie95.de", true },
- { "hartkampforkids.nl", true },
- { "hartleighclyde.com.au", true },
- { "hartlep.email", true },
- { "hartlieb.me", true },
- { "hartzer.com", true },
- { "haruhi.org.ua", true },
- { "harukakikuchi.com", true },
- { "harukawa.moe", true },
- { "haruue.moe", true },
- { "harvarddharma.org", true },
- { "harvestapp.com", true },
- { "harvestcookrepeat.com", true },
- { "harvester.fr", true },
- { "harveyauzorst.com", true },
- { "harveyplum.com", true },
- { "harveysautoservice.net", true },
- { "has-no-email-set.de", false },
- { "has.report", true },
- { "hasandeniz.uk", true },
- { "haschrebellen.de", true },
- { "hasecuritysolutions.com", true },
- { "haselsteiner.me", true },
- { "hash-archive.org", true },
- { "hash.army", true },
- { "hash.works", true },
- { "hashcashconsultants.com", true },
- { "hashcat.net", true },
- { "hashemian.com", true },
- { "hashes.org", true },
- { "hashi.dk", true },
- { "hashicorp.com", false },
- { "hashimah.ca", true },
- { "hashimoto-jimusho.com", true },
- { "hashinteractive.com", true },
- { "hashish.net", true },
- { "hashiura.jp", true },
- { "hashru.nl", true },
- { "hashtagpatriot.com", true },
- { "hashworks.net", true },
- { "hashxp.org", true },
- { "hasilocke.de", true },
- { "haskett.ca", true },
- { "haskovec.com", true },
- { "hasselbach-dellwig.de", true },
- { "hassra.org.uk", true },
- { "hastaneurunleri.com.tr", true },
- { "hatachan.site", true },
- { "hatarisecurity.co.ke", true },
- { "hatcher.cloud", true },
- { "hatpakha.com", true },
- { "hatter.ink", true },
- { "hatul.info", true },
- { "haucke.xyz", true },
- { "hauller.ch", true },
- { "hauntedhouserecords.co.uk", true },
- { "hauora.fyi", true },
- { "hauora.net", true },
- { "hauora.tech", true },
- { "haus-garten-test.de", true },
- { "haus-henne.de", true },
- { "haushaltsaufloesunghannover.de", true },
- { "haushenne.de", true },
- { "hausjugo.de", true },
- { "haustechnik-breu.de", true },
- { "hausundhof.com", true },
- { "hautaka.com", true },
- { "hautarztzentrum.ch", true },
- { "hauteslatitudes.com", false },
- { "havarijna-sluzba-bratislava.sk", true },
- { "havasigabor.hu", true },
- { "havasuinsurance.com", true },
- { "have.jp", true },
- { "haveabounce.co.uk", true },
- { "havedicewillsave.com", true },
- { "haveforeningen-enghaven.dk", true },
- { "havefunbiking.com", true },
- { "haveibeenpwned.com", true },
- { "havellab.de", true },
- { "havelland-obstler.de", true },
- { "havencyber.com", true },
- { "havenstrategies.com", true },
- { "havernbenefits.com", true },
- { "haverstack.com", true },
- { "havetherelationshipyouwant.com", true },
- { "hawaar.com", true },
- { "hawaiianchoice.com", true },
- { "hawaiioceanproject.com", true },
- { "hawaiiwho.com", true },
- { "hawickvets.co.uk", true },
- { "hawkeyeinsight.com", true },
- { "hawkinsonkiaparts.com", true },
- { "hawkofgeorgia.com", true },
- { "hawkon.dk", true },
- { "hawksguild.com", true },
- { "hawksracing.de", true },
- { "hax.to", true },
- { "haxdroid.com", true },
- { "haxo.nl", false },
- { "hayai.space", true },
- { "hayashi-rin.net", true },
- { "haydenjames.io", true },
- { "hayfordoleary.com", true },
- { "hayl.me.uk", true },
- { "haynes-davis.com", true },
- { "hayobethlehem.nl", true },
- { "hayonik.com", true },
- { "haystackrenovation.com.au", true },
- { "hayvid.com", true },
- { "haz.cat", true },
- { "hazelglow.com", true },
- { "hazeltime.com", true },
- { "hazeover.com", true },
- { "hazmijardin.es", true },
- { "hazukilab.com", true },
- { "hb6365.com", true },
- { "hb8522.com", true },
- { "hbaa.ml", true },
- { "hbcm70.fr", true },
- { "hbcu-colleges.com", true },
- { "hbkonsult.com", true },
- { "hboeck.de", true },
- { "hbpowell.com", true },
- { "hbudd.com", true },
- { "hbweb.io", true },
- { "hcbj.io", true },
- { "hceu-performance.com", true },
- { "hcie.pl", false },
- { "hcscrusaders.com", true },
- { "hd-gaming.com", true },
- { "hd-iptv.co", true },
- { "hd-offensive.at", false },
- { "hd-only.org", true },
- { "hd-outillage.com", true },
- { "hdbits.org", true },
- { "hdc.cz", true },
- { "hdcenter.cc", true },
- { "hdeaves.uk", true },
- { "hdf.world", true },
- { "hdfgroup.org", true },
- { "hdguru.com", true },
- { "hdhoang.space", true },
- { "hdkandsons.com", true },
- { "hdnastudio.com", true },
- { "hdrsource.com", true },
- { "hdrtranscon.com", true },
- { "hds-lan.de", true },
- { "hdtwinks.com", true },
- { "hdv.paris", true },
- { "hdwallpapers.net", true },
- { "he.kg", true },
- { "heaaart.com", true },
- { "head.ru", true },
- { "headforcloud.com", true },
- { "headjapan.com", true },
- { "headlinepublishing.be", true },
- { "healike.hk", true },
- { "healingourskin.com", true },
- { "health-and-beauty-news.net", true },
- { "health-booster.com", false },
- { "health-iq.com.au", true },
- { "health-plan-news.com", true },
- { "health.gov", true },
- { "health.graphics", true },
- { "health24world.ml", true },
- { "healthand-beautynews.net", true },
- { "healthandskinbeauty.com", true },
- { "healthcare.gov", false },
- { "healthcarereviews.tk", true },
- { "healthcaresuccess.com", true },
- { "healthcultureexpo.com", true },
- { "healthdata.gov", true },
- { "healtheffectsofasbestos.com", true },
- { "healthfinder.gov", true },
- { "healthfoam.com", true },
- { "healthgames.co.uk", true },
- { "healthiergenerations.co.uk", true },
- { "healthit.gov", true },
- { "healthplansamerica.org", true },
- { "healthstar-dev.io", true },
- { "healthstar.io", true },
- { "healththoroughfare.com", true },
- { "healthworksmarden.com.au", true },
- { "healthy-map.com", true },
- { "healthyfitfood.com", true },
- { "healthyhomesofmichigan.com", true },
- { "healthylifeelite.com", true },
- { "healthypeople.gov", true },
- { "healthyspirituality.org", true },
- { "healthystyle.tk", true },
- { "healthysuperhuman.com", true },
- { "healthyteame.com", true },
- { "heapkeeper.org", true },
- { "heardcountyathletics.com", true },
- { "hearmeraw.uk", true },
- { "heartbeat24.de", true },
- { "heartbound.wiki", true },
- { "heartcomms.com.au", true },
- { "hearthstonehungary.hu", true },
- { "heartlandbiomed.com", true },
- { "heartmdinstitute.com", true },
- { "heartsintrueharmony.com", true },
- { "hearttruth.gov", true },
- { "heartview.com.br", true },
- { "heartwoodart.com", true },
- { "hearty.eu.org", true },
- { "hearty.gq", true },
- { "hearty.me", true },
- { "hearty.ml", true },
- { "hearty.sg", true },
- { "hearty.tw", true },
- { "heartycorp.com", true },
- { "heartycraft.com", true },
- { "heatershop.co.uk", true },
- { "heathersmithcommercial.com", true },
- { "heatingandairconditioningdallastx.com", true },
- { "heatingpartswarehouse.co.uk", true },
- { "heavensattic.co.uk", true },
- { "heavensinferno.net", true },
- { "heavyequipments.org", true },
- { "hebamme-cranio.ch", true },
- { "hebbet.de", true },
- { "hebikhiv.nl", true },
- { "hebingying.cn", true },
- { "hec-espace-entreprise.ch", false },
- { "hec.global", true },
- { "heckelektro.de", true },
- { "heckerundknopp.de", true },
- { "hedge.fi", true },
- { "hedgeschool.ie", true },
- { "hedonism.org", true },
- { "hedonistic-imperative.com", true },
- { "hedonistic.org", true },
- { "hedonium.com", true },
- { "hedweb.co.uk", true },
- { "hedweb.com", true },
- { "hedweb.net", true },
- { "hedweb.org", true },
- { "hedys.de", true },
- { "heello.es", true },
- { "hefengautoparts.com", true },
- { "heftkaufen.de", true },
- { "hegen.com.pl", false },
- { "hegen.cz", false },
- { "hegen.sk", false },
- { "hegenshop.de", true },
- { "heh.ee", true },
- { "heha.co", false },
- { "heiaheia.com", true },
- { "heid.ws", true },
- { "heidisheroes.org", true },
- { "heighton.com.au", true },
- { "heightselectrical.com.au", true },
- { "heijdel.nl", true },
- { "heijmans.blog", true },
- { "heijmans.cloud", true },
- { "heijmans.email", true },
- { "heijmans.io", true },
- { "heijmans.pm", true },
- { "heijmans.xyz", true },
- { "heikegastmann.com", true },
- { "heikohessenkemper.de", true },
- { "heikorichter.name", true },
- { "heiland.io", true },
- { "heiliger-gral.info", true },
- { "heilpraxis-bgl.de", true },
- { "heimatverein-eitensheim.de", true },
- { "heimdallr.nl", true },
- { "heimonen.eu", true },
- { "heinemeier.dk", true },
- { "heino-peters.de", true },
- { "heinpost.nl", false },
- { "heinrich-kleyer-schule.de", true },
- { "heinzelmann.co", true },
- { "heiraten-gardasee.de", true },
- { "heiraten-venedig.de", true },
- { "heissluft-fritteuse.com", true },
- { "heistheguy.com", true },
- { "heitepriem.info", true },
- { "heitland-it.de", true },
- { "heiwa-valve.co.jp", false },
- { "heka.ai", true },
- { "helber-it-services.de", true },
- { "helbreath.tk", true },
- { "helden-spielen.de", true },
- { "heldenhalde.de", true },
- { "helderneves.pt", true },
- { "heldtech.services", true },
- { "heldundsexgott.de", true },
- { "heleendebruyne.be", true },
- { "helenaknowledge.com", true },
- { "helenekurtz.com", true },
- { "helenkellersimulator.org", true },
- { "helensmithpr.co.uk", true },
- { "helfordriversc.co.uk", true },
- { "helgaschultz.de", true },
- { "helichat.de", true },
- { "helifreak.club", true },
- { "helijobs.net", true },
- { "helikon.ro", true },
- { "helios4.com", true },
- { "heliosnet.com", true },
- { "heliosvoting.org", true },
- { "helix.am", true },
- { "helkyn.eu", true },
- { "helkyn.fr", true },
- { "helkyn.org", true },
- { "hell.sh", true },
- { "hella-secure.com", true },
- { "hellenicagora.co.uk", true },
- { "hellenicmusicacademy.com", true },
- { "hellerarko.de", true },
- { "hellersgas.com", true },
- { "helles-koepfchen.de", true },
- { "helloacm.com", true },
- { "helloafrica.ga", true },
- { "hellobrian.me", true },
- { "hellocyber.co.uk", true },
- { "hellofrom.com", true },
- { "hellomedian.com", true },
- { "hellomookie.com", true },
- { "hellomouse.net", true },
- { "hellosalmon.com", true },
- { "hellovillam.com", true },
- { "helloworldhost.com", false },
- { "helloyemek.com", true },
- { "hellsgamers.pw", true },
- { "hellsh.com", true },
- { "helm-pokale.at", true },
- { "helm-pokale.de", true },
- { "helm-trophy.com", true },
- { "help.simpletax.ca", true },
- { "helpconnect.com.au", true },
- { "helpkoil.com", true },
- { "helpscoutdocs.com", true },
- { "helpstarloja.com.br", true },
- { "helptasker.com", true },
- { "helptasker.net", true },
- { "helptasker.ru", true },
- { "helpwithadoption.com", true },
- { "helpwithinsomnia.org", false },
- { "helpwithmybank.gov", true },
- { "helsenorge.no", true },
- { "helsinki.dating", true },
- { "helvella.de", true },
- { "hematoonkologia.pl", true },
- { "hemdal.se", true },
- { "hemkoll.nu", true },
- { "hemnet.se", true },
- { "hemp.je", true },
- { "hems.si", true },
- { "hemtest.com", true },
- { "hen.ne.ke", true },
- { "hendersonvalleyautomotive.co.nz", true },
- { "hendranicholas.com", true },
- { "hendric.us", false },
- { "hendrickx.be", true },
- { "hendrik.li", true },
- { "hendrinortier.nl", true },
- { "hengroenet.de", true },
- { "hengstumone.com", true },
- { "henkboelman.com", true },
- { "henke-home.eu", true },
- { "henker.net", true },
- { "henkrensing.nl", true },
- { "henkverlinde.com", false },
- { "henley-computer-repairs.co.uk", true },
- { "henleybouncycastles.co.uk", true },
- { "henlich.de", true },
- { "hennecke-forstbetrieb.de", true },
- { "henneke.me", true },
- { "hennes-haan.de", true },
- { "hennes-shop.de", true },
- { "hennesshop.de", true },
- { "hennies.org", true },
- { "henningkerstan.de", true },
- { "henningkerstan.org", true },
- { "hennymerkel.com", true },
- { "henrik-bondtofte.dk", true },
- { "henrikwelk.de", true },
- { "henrilammers.nl", true },
- { "henry.gg", true },
- { "henryocallaghan.com", true },
- { "henrysautodetail.com", true },
- { "hentaigogo.com", true },
- { "hentaipornography.com", true },
- { "hentaiz.net", true },
- { "hentamanga.tk", true },
- { "hentavfall.no", true },
- { "hentschke-bau.de", true },
- { "hentschke-betonfertigteilwerk.de", true },
- { "hentschke-invest.de", true },
- { "henzenhoning.nl", true },
- { "hepla.de", true },
- { "heppler.net", true },
- { "heptafrogs.de", true },
- { "heraldik-wiki.de", true },
- { "herba-belgie.be", true },
- { "herberichfamily.com", true },
- { "herbert.io", true },
- { "herbertjanvandinther.nl", true },
- { "herbhuang.com", true },
- { "herbolarigranvida.com", true },
- { "herbweb.net", true },
- { "herbweb.org", true },
- { "herd-kaufen.com", true },
- { "herds.eu", true },
- { "herdserv.de", true },
- { "herecsrymy.cz", true },
- { "heren.fashion", true },
- { "heretic-guild.com", true },
- { "hereticle.com", true },
- { "heritagebaptistchurch.com.ph", true },
- { "heritagecoffee.co.uk", true },
- { "herkam.pl", true },
- { "hermanbrouwer.nl", true },
- { "herminghaus24.de", true },
- { "hermiu.com", true },
- { "herni-kupony.cz", true },
- { "herocentral.de", true },
- { "heroco.xyz", true },
- { "herofil.es", true },
- { "herohirehq.co.uk", true },
- { "heroiclove.com", true },
- { "heroicpixel.com", true },
- { "heroku.com", true },
- { "heroku.ga", true },
- { "heromuster.com", true },
- { "herpes-no.com", true },
- { "herranzramia.com", false },
- { "herrderzeit.de", true },
- { "herrenmuehle-wein.de", true },
- { "herrfirm.com", true },
- { "herringboneeats.com", true },
- { "herringsresidence.be", true },
- { "herrkaschke.com", true },
- { "herrschaftlich-durch-dresden.de", true },
- { "herrsmith.com", true },
- { "herrtxbias.net", false },
- { "hersdorf-eifel.de", true },
- { "hertsbouncycastles.com", true },
- { "hertz.bj", true },
- { "herz-und-gemuet.de", true },
- { "herzfuersoziales.at", true },
- { "herzig.cc", true },
- { "herzogglass.com", true },
- { "herzwacht.de", true },
- { "hes.com.cy", true },
- { "hesaplama.net", true },
- { "hessen-liebe.de", true },
- { "hesslag.com", true },
- { "hestervanderheijden.nl", true },
- { "hestia-systeme.be", true },
- { "hestia-systeme.com", true },
- { "hestia-systeme.eu", true },
- { "hestia-systeme.fr", true },
- { "hesyifei.com", true },
- { "hetene.nl", true },
- { "hethakhout.nl", true },
- { "hethely.ch", true },
- { "hetmer.cz", true },
- { "hetushu.com", true },
- { "heute-kaufen.de", true },
- { "heute.training", true },
- { "heutger.net", true },
- { "hevertonfreitas.com.br", true },
- { "hex.nl", true },
- { "hexagon-e.com", true },
- { "hexapt.com", true },
- { "hexcode.in", true },
- { "hexed.it", true },
- { "hexhu.com", true },
- { "hexiaohu.cn", true },
- { "hexicurity.com", true },
- { "hexieshe.com", true },
- { "hexo.io", false },
- { "hexony.com", true },
- { "hexr.org", true },
- { "hexsafe.io", true },
- { "hexstream.net", true },
- { "hexstream.xyz", true },
- { "hexstreamsoft.com", true },
- { "hexxagon.com", true },
- { "heyapakabar.com", true },
- { "heyboldface.com", true },
- { "heywood.cloud", true },
- { "hf51.nl", true },
- { "hg.gg", true },
- { "hg.python.org", true },
- { "hg0086.la", true },
- { "hg661.cc", true },
- { "hgbet.com", true },
- { "hgc369.com", true },
- { "hghanbarimd.com", true },
- { "hgmaranatha.nl", true },
- { "hgpowerglue.nl", true },
- { "hguandl.com", true },
- { "hgw168.com", true },
- { "hgyoseo.com", true },
- { "hh-medic.com", true },
- { "hh-wolke.dedyn.io", true },
- { "hhgdo.de", true },
- { "hhh1080.com", true },
- { "hhhdb.com", true },
- { "hhidr.org", true },
- { "hhmmmm.de", true },
- { "hhs.gov", true },
- { "hhtoners.com.br", true },
- { "hibari.moe", true },
- { "hiccupsandjuice.co.uk", true },
- { "hickorywinecellar.com", true },
- { "hicl.org", true },
- { "hicoria.com", true },
- { "hiczp.com", true },
- { "hidbo.de", true },
- { "hiddenhillselectric.com", true },
- { "hiddenhillselectrical.com", true },
- { "hiddenhillselectrician.com", true },
- { "hiddenhillsexteriorlighting.com", true },
- { "hiddenhillslandscapelighting.com", true },
- { "hiddenhillslighting.com", true },
- { "hiddenhillsoutdoorlighting.com", true },
- { "hiddenimage.ml", true },
- { "hiddenmalta.net", true },
- { "hiddenpalms.tk", true },
- { "hideallip.com", true },
- { "hideo54.com", true },
- { "hideouswebsite.com", true },
- { "hidroshop.com.br", true },
- { "hidroshoping.com.br", true },
- { "hieisuki.ga", true },
- { "hielscher.com", true },
- { "hieu.com.au", true },
- { "hif88.com", true },
- { "hiffo.de", true },
- { "hifumi.us", true },
- { "hig.gov", true },
- { "higgstools.org", true },
- { "highair.net", true },
- { "highclasseducation.com", true },
- { "highcorkett.com", true },
- { "highdesertroboticsurgery.com", true },
- { "highenergy.ro", true },
- { "highkick.jp", true },
- { "highlandparkcog.org", true },
- { "highlegshop.com", true },
- { "highlevelwoodlands.com", true },
- { "highpressuretech.com", true },
- { "highspeed-arnsberg.de", true },
- { "highspeedinternet.my", true },
- { "hightechreviews.ga", true },
- { "hightimes.com", true },
- { "highwaytohoell.de", true },
- { "hiimodel.com", true },
- { "hik-cloud.com", true },
- { "hikawa.top", true },
- { "hike.pics", true },
- { "hikerone.com", true },
- { "hikikomori-sos.site", true },
- { "hikingguy.com", true },
- { "hilahdih.cz", true },
- { "hilalnews.ga", true },
- { "hilarious.ga", true },
- { "hilaryhutler.com", true },
- { "hilchenba.ch", true },
- { "hildebrand.group", true },
- { "hilden.ws", true },
- { "hilfe-bei-krebs-vechta.de", true },
- { "hilfreiche-server.tips", true },
- { "hilhorst-uitvaartverzorging.nl", true },
- { "hillcrestswimclub.com", true },
- { "hillebrand.io", true },
- { "hillier-swift.co.uk", true },
- { "hillsandsaunders.co.uk", true },
- { "hillsandsaunders.com", true },
- { "hillsboroccpa.org", true },
- { "hillstrak.com.au", true },
- { "hillstrakwpg.com.au", true },
- { "hilltopcellar.com", true },
- { "hilnu.com", true },
- { "hiltonarubabeachservices.com", true },
- { "hiltonsydney.com.au", true },
- { "himalaya-masala.at", true },
- { "himalayanyogashram.com", true },
- { "himecorazon.com", true },
- { "himekomi.com", true },
- { "himiku.com", true },
- { "himpler.com", true },
- { "hin10.com", true },
- { "hinaryazan.com", true },
- { "hinata-hidetoshi.com", true },
- { "hindu-temple.tk", true },
- { "hingston.org", true },
- { "hintergrundbewegung.de", true },
- { "hinterhofbu.de", true },
- { "hinterposemuckel.de", true },
- { "hinyari.net", true },
- { "hiparish.org", true },
- { "hipeople.com.br", true },
- { "hipercultura.com", true },
- { "hipnos.net", true },
- { "hippiekiller.net", true },
- { "hippies.com.br", true },
- { "hippomovers.com", true },
- { "hippopotamuses.org", true },
- { "hips.com", true },
- { "hipstercat.fr", false },
- { "hiqfranchise.co.uk", true },
- { "hiqhub.co.uk", false },
- { "hiqonline.co.uk", true },
- { "hirakatakoyou.org", true },
- { "hirake55.com", true },
- { "hiratake.xyz", true },
- { "hire-a-coder.de", true },
- { "hireabouncycastle.net", true },
- { "hirel.gq", true },
- { "hiresteve.ca", true },
- { "hirevets.gov", true },
- { "hirevo.eu", true },
- { "hirevue.com", true },
- { "hirezzportal.com", true },
- { "hiromuogawa.com", true },
- { "hirotaka.org", true },
- { "hisbrucker.net", true },
- { "hisgifts.com.au", true },
- { "hisingensck.se", true },
- { "hisnet.de", true },
- { "hispadent.com.do", true },
- { "hispanic.dating", true },
- { "hisregistries.com", true },
- { "hisregistries.net", true },
- { "hisregistries.org", true },
- { "histkult.tk", true },
- { "histoire-cite.ch", false },
- { "histoiresdecontenu.com", true },
- { "histoiresdemotos.fr", true },
- { "historia-arte.com", true },
- { "historiasdepueblo.es", true },
- { "history-schools.com", true },
- { "history.google.com", false },
- { "history.gov", true },
- { "hitandhealth.nl", true },
- { "hitchpin.com", true },
- { "hitechgr.eu", true },
- { "hiteco.com", true },
- { "hiteshchandwani.com", true },
- { "hiteshjoshi.com", true },
- { "hitflow.fr", true },
- { "hitfront.com", true },
- { "hithardnews.com", true },
- { "hititgunesi-tr.com", true },
- { "hitmanstat.us", true },
- { "hitn.at", true },
- { "hitoapi.cc", true },
- { "hitocom.net.br", true },
- { "hitokoto-mania.com", true },
- { "hitokoto.cn", false },
- { "hitomecha.com", true },
- { "hitrost.com", true },
- { "hitsbola.club", true },
- { "hitter-lauzon.com", true },
- { "hitter.family", true },
- { "hitterfamily.com", true },
- { "hittop.tk", true },
- { "hiv-symptome.de", true },
- { "hiv.gov", true },
- { "hivatalinfo.hu", true },
- { "hiveopolis.eu", true },
- { "hiverlune.net", true },
- { "hiwannz.com", true },
- { "hiwiki.tk", true },
- { "hiyacar.co.uk", true },
- { "hiyobi.me", true },
- { "hiyoko-shokutaku.com", true },
- { "hiyuki2578.net", false },
- { "hizzacked.xxx", true },
- { "hj-mosaiques.be", true },
- { "hj.rs", true },
- { "hj555.cc", true },
- { "hj556.cc", true },
- { "hjartasmarta.se", true },
- { "hjertingfysioterapi.dk", true },
- { "hjort.land", true },
- { "hjortland.org", true },
- { "hjphoto.co.uk", true },
- { "hk.search.yahoo.com", false },
- { "hkas.org.hk", true },
- { "hkbsurgery.com", true },
- { "hkdobrev.com", true },
- { "hklbgd.org", true },
- { "hkmap.co", true },
- { "hkmap.com", true },
- { "hkmap.live", true },
- { "hkmap.net", true },
- { "hkr.at", true },
- { "hks-ffm.de", true },
- { "hks-projekt.at", true },
- { "hks.pw", true },
- { "hktech.com", true },
- { "hkustmbajp.com", true },
- { "hl8id.vip", true },
- { "hl8th.vip", true },
- { "hlavacek.us", true },
- { "hlavi.hu", true },
- { "hledejlevne.cz", true },
- { "hlfh.space", true },
- { "hlg66.cc", true },
- { "hlg88.cc", true },
- { "hlinformatics.nl", true },
- { "hloe0xff.ru", true },
- { "hlsmandarincentre.com", true },
- { "hlucas.de", true },
- { "hlx66.cc", true },
- { "hlx86.cc", true },
- { "hly0928.com", true },
- { "hm1ch.com", true },
- { "hm1ch.ovh", true },
- { "hmeonot.org.il", true },
- { "hmhotelec.com", false },
- { "hmnd.io", true },
- { "hmoegirl.com", true },
- { "hms-waldmann.de", true },
- { "hmsseahawk.com", true },
- { "hn.search.yahoo.com", false },
- { "hn122.cc", true },
- { "hn75.de", true },
- { "hnfertilizermachine.com", true },
- { "hnn.net.br", true },
- { "hnonline.sk", true },
- { "hnyp.hu", true },
- { "ho18.net", true },
- { "ho188.net", true },
- { "ho518.net", true },
- { "ho568.com", true },
- { "ho68.net", true },
- { "ho918.net", true },
- { "hoaas.no", true },
- { "hoahau.org", true },
- { "hoarding.me", true },
- { "hoathienthao.com", true },
- { "hoathienthao.vn", true },
- { "hobby-drechselei.de", true },
- { "hobby-freizeit.de", true },
- { "hobbyspeed.com", true },
- { "hoberg.ch", true },
- { "hochhaus.us", true },
- { "hochoukikikiraku.com", true },
- { "hochyi.com", true },
- { "hochzeit-dana-laurens.de", true },
- { "hochzeitsfotograf-deinfoto.ch", true },
- { "hochzeitsplanerin-hamburg.de", true },
- { "hodgephotography.com", true },
- { "hoe.re", true },
- { "hoeft-autolackierung.de", true },
- { "hoekvanholland.eu", true },
- { "hoeren.club", true },
- { "hoesnelwasik.nl", true },
- { "hoevenstein.nl", false },
- { "hoewler.ch", false },
- { "hof-mulin.ch", true },
- { "hofapp.de", true },
- { "hofauer.de", true },
- { "hoffmancorporation.com", true },
- { "hoffnungberlin.de", true },
- { "hoffnungdeutschland.de", true },
- { "hoflerlawfirm.com", true },
- { "hofstaetter.io", true },
- { "hogarthdavieslloyd.com", true },
- { "hoge.se", true },
- { "hogepad.com", true },
- { "hogl.dk", true },
- { "hogrebe.de", true },
- { "hogwarts.io", true },
- { "hohenleimbach.de", true },
- { "hohm.in", true },
- { "hoiquanadida.com", true },
- { "hoish.in", false },
- { "hoken-wakaru.jp", true },
- { "hokenselect.jp", true },
- { "hokioisecurity.com", true },
- { "hokung.xyz", true },
- { "holacannx.com", true },
- { "holacbdoils.com", true },
- { "holadinero.es", true },
- { "holadinero.mx", true },
- { "holboxwhalesharktours.com", false },
- { "holdengreene.com", true },
- { "holebedeljek.hu", true },
- { "holenergies.com", true },
- { "holenergies.fr", true },
- { "holgerlehner.com", true },
- { "holidayacademy.co.uk", true },
- { "holidaylocal.ga", true },
- { "holidaypackage.co", true },
- { "holidaysportugal.eu", true },
- { "holisticacupuncture.com.au", true },
- { "holistichealer.in", true },
- { "holisticon.de", true },
- { "holland-sailing.de", true },
- { "hollandsdiep.nl", true },
- { "hollermann.eu", true },
- { "hollowpoint.xyz", true },
- { "hollowrap.com", true },
- { "hollyforrest.ca", true },
- { "hollyforrestphotography.ca", true },
- { "hollywoodstars.tk", true },
- { "holmesian.org", true },
- { "holo.ovh", true },
- { "holofono.com", true },
- { "holofox.ru", true },
- { "holoxplor.space", true },
- { "holtackersleather.be", true },
- { "holtslander.ca", true },
- { "holunderbluetentee.de", true },
- { "holundersberg.de", true },
- { "holvonix.com", true },
- { "holycrossphl.org", true },
- { "holycrossverobeach.org", true },
- { "holydragoon.jp", true },
- { "holyfamilyphilly.org", true },
- { "holyfamilyrussell.org", true },
- { "holyghost-church.org", true },
- { "holygrail.games", true },
- { "holyhiphopdatabase.com", true },
- { "holymartyrschurch.org", true },
- { "holyriders.cf", true },
- { "holyspiritpalmyra.com", true },
- { "holyspiritweb.org", true },
- { "holyszko.com", true },
- { "holytransaction.com", true },
- { "holywhite.com", true },
- { "holz.nu", true },
- { "holzed.com", true },
- { "holzheizer-forum.de", true },
- { "holzheizerforum.de", true },
- { "holzschutz-holzbearbeitung.de", true },
- { "holzspielzeug-shop.ch", true },
- { "holzstueckwerk.de", true },
- { "holzundgarten.de", true },
- { "holzvergaser-forum.de", true },
- { "homatism.com", true },
- { "hombresconestilo.com", true },
- { "home-sud-renovation.com", true },
- { "homeable.io", true },
- { "homeandliving.it", true },
- { "homebank.kg", true },
- { "homebasedsalons.com.au", true },
- { "homebodyalberta.com", true },
- { "homecareassociatespa.com", true },
- { "homecareinterio.com", true },
- { "homecaring.com.au", true },
- { "homecheck.gr", true },
- { "homeehome.com", true },
- { "homegardeningforum.com", true },
- { "homegardenresort.nl", true },
- { "homegreenmark.com", true },
- { "homehunting.pt", true },
- { "homeimagician.com.au", true },
- { "homelab.farm", true },
- { "homelabalert.com", true },
- { "homelabquotes.com", true },
- { "homeland.ie", true },
- { "homeodynamics.com", true },
- { "homeoesp.org", true },
- { "homeogenium.com", false },
- { "homeownersinsurancenevada.com", true },
- { "homeownersinsurancenv.com", true },
- { "homepage.shiga.jp", true },
- { "homeporn.stream", true },
- { "homeportal.cz", true },
- { "homeprivate.de", true },
- { "homeprivate.net", true },
- { "homeseller.com", true },
- { "homeserver-kp.de", true },
- { "homeshowoff.com", true },
- { "homesteadandprepper.com", true },
- { "homesteadfarm.org", true },
- { "homeworkacers.com", true },
- { "homeyou.com", true },
- { "hommeatoutfaire.be", false },
- { "homoo.social", true },
- { "homophobia.tk", true },
- { "homophoni.com", true },
- { "hompus.nl", false },
- { "homs.design", true },
- { "homunyan.com", true },
- { "hon-matsuba.co.jp", true },
- { "honda-centrum.cz", true },
- { "hondart.cz", true },
- { "hondenoppasfraneker.nl", true },
- { "honey.beer", true },
- { "honey.is", true },
- { "honeybadger.io", false },
- { "honeybrooklibrary.org", true },
- { "honeycome.net", true },
- { "honeycreeper.com", true },
- { "honeyhaw.com", true },
- { "honeymaze.com", true },
- { "honeypot.net", true },
- { "hong.io", true },
- { "hongbomiao.com", true },
- { "hongki.tk", true },
- { "honglitrading.co.uk", true },
- { "hongoi.com", true },
- { "hongorw.tk", true },
- { "hongosdemexico.tk", true },
- { "honoka-seitai.jp", true },
- { "honovere.de", true },
- { "hontoir.eu", true },
- { "hoofdredacteuren.nl", true },
- { "hoogeveen.nl", false },
- { "hookany.com", true },
- { "hookbin.com", true },
- { "hookshotdesign.com", true },
- { "hookxlab.org", false },
- { "hoon.tk", true },
- { "hoooc.com", true },
- { "hooowl.com", true },
- { "hoop.la", true },
- { "hoopertechnicalsolutions.com", true },
- { "hooplessinseattle.com", true },
- { "hooray.beer", true },
- { "hoorr.com", true },
- { "hoosa.de", true },
- { "hoovism.com", true },
- { "hoowhen.cn", true },
- { "hopconseils.ch", false },
- { "hopconseils.com", false },
- { "hopecbd.com", true },
- { "hopemeet.me", true },
- { "hopeofmyheart.com", true },
- { "hopesanddreams.org.uk", true },
- { "hopeworld.pro", true },
- { "hoplongtech.com", true },
- { "hoponmedia.de", true },
- { "hopps.me", true },
- { "hoppyx.com", true },
- { "hopzone.net", true },
- { "horaceli.com", true },
- { "horackova.info", true },
- { "horairetrain.be", true },
- { "horairetrain.ch", true },
- { "horairetrain.fr", true },
- { "horairetrain.lu", true },
- { "horairetrain.nl", true },
- { "horclan.tk", true },
- { "hord.ca", true },
- { "horecaapparatuurkobezuijen.nl", true },
- { "horecatiger.eu", true },
- { "horeco.com", true },
- { "horeizai.net", true },
- { "horgenberg.com", true },
- { "horizon.ne.jp", true },
- { "horizonhomes-samui.com", true },
- { "horizonlawncare.tk", true },
- { "horizzon.cloud", true },
- { "horn.co", true },
- { "hornertranslations.com", true },
- { "horo.moe", true },
- { "horochx.org", true },
- { "horodance.dk", true },
- { "horrell.ca", true },
- { "horrendous-servers.com", true },
- { "horror-forum.de", true },
- { "horrormovies.gr", true },
- { "horsegateway.com", true },
- { "horsehunter.co.uk", true },
- { "horsky.me", true },
- { "horstmanshof.eu", true },
- { "horton-brasses.com", true },
- { "hory.me", true },
- { "horza.org", true },
- { "hoshimaq.com.br", true },
- { "hoshimaquinas.com.br", true },
- { "hoshinplan.com", true },
- { "hoshisato.com", true },
- { "hosiery.tk", true },
- { "hosiet.me", true },
- { "hosmussynergie.nl", false },
- { "hosoi-tax.com", true },
- { "hospeda1.com.br", true },
- { "hospitalhomelottery.org", true },
- { "hospitality-colleges.com", true },
- { "hostadvice.com", true },
- { "hostallacasamia.com", true },
- { "hostco.nl", true },
- { "hostcoz.com", true },
- { "hosteasy.nl", false },
- { "hostedtalkgadget.google.com", true },
- { "hosteleriauno.es", true },
- { "hosteons.com", true },
- { "hostfission.com", true },
- { "hostiberi.com", true },
- { "hostico.ro", true },
- { "hostinecpodlipou.cz", true },
- { "hosting-swiss.ch", true },
- { "hostingactive.it", true },
- { "hostingalternative.com", false },
- { "hostingdirectory.ga", true },
- { "hostinghelp.guru", true },
- { "hostinginnederland.nl", true },
- { "hostinglogin.net", true },
- { "hostingphp.ch", true },
- { "hostingpunt.be", true },
- { "hostingsolutions.cz", true },
- { "hostingsrv.nl", true },
- { "hostix.de", true },
- { "hostmark.pl", true },
- { "hostme.co.il", false },
- { "hostmijnpagina.nl", true },
- { "hostmodern.com.au", true },
- { "hostmywebsite.online", true },
- { "hosuronline.com", true },
- { "hot-spa.ch", false },
- { "hotartup.com", true },
- { "hotcandlestick.com", true },
- { "hotchillibox.com", true },
- { "hotcoin.io", true },
- { "hotel-alan.hr", true },
- { "hotel-kontorhaus-stralsund.de", true },
- { "hotel-kontorhaus.de", true },
- { "hotel-le-vaisseau.ch", true },
- { "hotel-pension-sonnalp.eu", true },
- { "hotel-rosner.at", true },
- { "hotel-schiller.de", true },
- { "hotel1926.com.mt", true },
- { "hotelamgarnmarkt.at", false },
- { "hotelbonacabol.com", true },
- { "hotelbretagne.dk", true },
- { "hotelcoliber.pl", true },
- { "hotelconsulado.com.br", true },
- { "hotelcorporate.codes", true },
- { "hotelcorporatecodes.com", true },
- { "hotelelaphusabrac.com", true },
- { "hoteles4you.com", true },
- { "hotelevershine.com", true },
- { "hotelflow.com.br", true },
- { "hotelident.de", true },
- { "hotelindraprasth.biz", true },
- { "hotelkaj.hr", true },
- { "hotellerssolutions.com", true },
- { "hotellilas.in", true },
- { "hotelmap.com", true },
- { "hotelmarinaadria.com", true },
- { "hotelmonal.in", true },
- { "hotelnatrajp.com", true },
- { "hotelneptundalmatien.com", true },
- { "hotelpalmas.com.br", true },
- { "hotelpostaorvieto.it", true },
- { "hotelpresident.co.in", true },
- { "hotelpromo.codes", true },
- { "hotels-insolites.com", true },
- { "hotels3d.com", true },
- { "hotels4teams.com", true },
- { "hotelsinbuxton.com", true },
- { "hotelsinformer.com", true },
- { "hotelsinncoventry.com", true },
- { "hotelsolinebrela.com", true },
- { "hotelsrit.tk", true },
- { "hotelstanford.com.co", true },
- { "hotelvalena.com", true },
- { "hotelvillaluisa.de", true },
- { "hothbricks.com", false },
- { "hotjuice.com", true },
- { "hotmann.de", true },
- { "hotnewhiphop.com", true },
- { "hoton.in", true },
- { "hotornot.com", true },
- { "hotplate.co.nz", true },
- { "hotplug.gr", true },
- { "hottaro.com", true },
- { "hottheme.net", true },
- { "hotting.nl", true },
- { "hottubhirenewcastle.co.uk", true },
- { "hottubspasnewcastle.co.uk", true },
- { "hotvideosgalleries.com", true },
- { "houby-studio.eu", true },
- { "houhuayuan.com", true },
- { "houraiteahouse.net", true },
- { "house-sparrow.com", true },
- { "houseandgarden.co.uk", true },
- { "houseboydesigns.com", true },
- { "housekeeperlondon.co.uk", true },
- { "houselocal.co.uk", true },
- { "houseofherbs.gr", true },
- { "houseofhouston.com", true },
- { "houseofpertijs.com", true },
- { "houseofyee.com", true },
- { "houser.lu", true },
- { "housese.at", true },
- { "housingneedz.com", true },
- { "houstonapartmentinsiders.com", true },
- { "houstonauthorizedrepair.com", true },
- { "houstoncreditlaw.com", true },
- { "houstonendodontics.com", true },
- { "houstongaragedoorsrepair.com", true },
- { "houstonlockout.com", true },
- { "houtinee.com", true },
- { "hoverboardbarato.com", true },
- { "how-to-simply.com", true },
- { "how2dev.tools", true },
- { "howa-n.net", true },
- { "howbehealthy.com", true },
- { "howbigismybuilding.com", true },
- { "howellaccounts.co.uk", true },
- { "howgoodwasmysex.com", true },
- { "howieisawesome.com", true },
- { "howlongtobeatsteam.com", true },
- { "howmanypeoplearethereinthe.world", true },
- { "howmanypeoplearethereintheworld.com", true },
- { "howsecureismypassword.net", true },
- { "howsmyssl.com", true },
- { "howsmytls.com", true },
- { "howson.me", true },
- { "howsyourhealth.org", true },
- { "howtogeek.com", true },
- { "howtogosolar.org", true },
- { "howtolaser.com", true },
- { "howtomovetheneedle.com", true },
- { "howtoteachviolin.com", true },
- { "howtotech.de", true },
- { "howtutu.click", true },
- { "howtutu.com", true },
- { "howtutu.email", true },
- { "howtutu.eu", true },
- { "howtutu.info", true },
- { "howtutu.link", true },
- { "howtutu.net", true },
- { "howtutu.org", true },
- { "hoxo.fr", true },
- { "hozana.si", false },
- { "hp-work.net", true },
- { "hp42.de", true },
- { "hpac-portal.com", true },
- { "hpage.com", true },
- { "hpbn.co", true },
- { "hpisavageforum.com", true },
- { "hpkp-faq.de", true },
- { "hplace.com.br", true },
- { "hps.digital", true },
- { "hps.hu", true },
- { "hpsdigital.hu", true },
- { "hpvtimmerwerken.nl", true },
- { "hq77.ru", true },
- { "hqon.com.br", true },
- { "hqq.tv", true },
- { "hquest.pro.br", true },
- { "hqwebhosting.tk", false },
- { "hqy.moe", true },
- { "hr-praemien-santander.de", true },
- { "hr-tech.shop", true },
- { "hr28.co.uk", true },
- { "hraesvelg.net", true },
- { "hrafnkellbaldurs.com", true },
- { "hranicka.cz", true },
- { "hrbanen.nl", true },
- { "hrbatypes.cz", true },
- { "hrbl.lc", true },
- { "hrbrt.nl", true },
- { "hrcrew.com.au", true },
- { "hrdns.de", false },
- { "hrebecek.cz", true },
- { "href.one", true },
- { "hreflang.info", true },
- { "hrjfeedstock.org", true },
- { "hrltech.com.br", true },
- { "hrmg.agency", true },
- { "hrna.moe", true },
- { "hro.to", true },
- { "hrobert.hu", true },
- { "hroling.nl", true },
- { "hroschyk.cz", true },
- { "hrpregnancy.com", true },
- { "hrsa.gov", true },
- { "hrtech.shop", true },
- { "hrumka.net", true },
- { "hrw66.cc", true },
- { "hryniewski.net", true },
- { "hryx.net", true },
- { "hs-arbeitsschutz.de", true },
- { "hs-group.net", true },
- { "hsappstatic.net", true },
- { "hschen.top", false },
- { "hscorp.de", true },
- { "hsg-kreuzberg.de", true },
- { "hsivonen.com", true },
- { "hsivonen.fi", true },
- { "hsivonen.iki.fi", true },
- { "hsiwen.com", true },
- { "hsjccconference.ca", true },
- { "hsmr.cc", true },
- { "hsn-tsn.com", true },
- { "hsn.com", true },
- { "hspinc.ca", true },
- { "hsr.gov", false },
- { "hsts.eu", true },
- { "hsts.me", true },
- { "hsts.ovh", true },
- { "hstsfail.appspot.com", true },
- { "hstspreload.appspot.com", true },
- { "hstspreload.com", true },
- { "hstspreload.de", true },
- { "hstspreload.org", true },
- { "hsturan.com", true },
- { "hsuan.pw", true },
- { "hszemi.de", true },
- { "ht.mk", true },
- { "htaccessbook.com", true },
- { "htaps.com", true },
- { "htb.click", true },
- { "htb.co.uk", true },
- { "htbplc.co.uk", true },
- { "htcvina.com", true },
- { "hte.ovh", true },
- { "hti.digital", true },
- { "htmanager.fr", true },
- { "htmdom.com", true },
- { "html.moe", true },
- { "html5.org", true },
- { "html5media.info", true },
- { "htmlacademy.ru", true },
- { "htmlvalidator.com", true },
- { "htmlyse.com", true },
- { "htsure.ma", false },
- { "http2.eu", true },
- { "http2.pro", true },
- { "http3.pro", true },
- { "https-rulesets.org", true },
- { "https.dk", true },
- { "https.jetzt", true },
- { "https4all.org", true },
- { "httpsarnemergan.ml", true },
- { "httpsecured.net", true },
- { "httpsecurityreport.com", true },
- { "httpsiseasy.com", true },
- { "httpsispisseasy.com", true },
- { "httpsnow.com", true },
- { "httpsnow.org", true },
- { "httpstest.com", true },
- { "httpstest.eu", true },
- { "httpstest.nl", true },
- { "httpswatch.ca", true },
- { "httpswatch.com", true },
- { "httpswatch.eu", true },
- { "httpswatch.nl", true },
- { "htxlaunch.sg", true },
- { "hu-a-u.com", true },
- { "hu.search.yahoo.com", false },
- { "hua-chuan.com.tw", true },
- { "hua-chuan.tw", true },
- { "huabantxt.com", true },
- { "huabanxs.com", true },
- { "huabianwa.com", true },
- { "huagati.com", true },
- { "huahinpropertylisting.com", true },
- { "huang-haitao.com", true },
- { "huang.nu", true },
- { "huangh.com", true },
- { "huangjiaint.com", true },
- { "huangjingjing.com", true },
- { "huangqifu.com", true },
- { "huangzenghao.cn", true },
- { "huaqian.art", true },
- { "huashan.co.uk", true },
- { "huawenyy.com", true },
- { "huaxingui.com", true },
- { "huaxueba.com", true },
- { "hub.org.ua", true },
- { "hub385.com", true },
- { "hubapi.com", true },
- { "hubchain.com", true },
- { "hubchain.com.br", true },
- { "hubchain.fr", true },
- { "hubchain.io", true },
- { "hubchain.org", true },
- { "huber-informatik.de", true },
- { "hubitt.com", true },
- { "hubok.net", true },
- { "hubspot.com", true },
- { "hubspot.de", true },
- { "hubspot.es", true },
- { "hubspot.fr", true },
- { "hubspot.jp", true },
- { "huchet.me", true },
- { "hudobniny.net", true },
- { "hudognik.com", true },
- { "hudrydum.cz", true },
- { "hudsonfaceandeye.com", true },
- { "huduser.gov", true },
- { "huendeleskopfhuette.de", true },
- { "huersch.com", true },
- { "hues-in-lee.de", true },
- { "huffduffer.com", true },
- { "hugi.is", true },
- { "huglen.info", true },
- { "hugo.pro", true },
- { "hugofs.com", true },
- { "hugolegrand.fr", true },
- { "hugolynx.fr", false },
- { "hugonote.cf", true },
- { "hugonote.ga", true },
- { "hugonote.gq", true },
- { "hugonote.ml", true },
- { "hugonote.tk", true },
- { "huguesblanchard.paris", true },
- { "huguesditciles.com", false },
- { "huh.gdn", true },
- { "huh.today", false },
- { "huihui.moe", true },
- { "huimiquan.com", true },
- { "huininga.com", true },
- { "huininga.nl", true },
- { "huininga.org", true },
- { "huipc.com", true },
- { "huirongis.me", true },
- { "huisartsenpraktijkheemraadssingel.nl", true },
- { "huisartsenpraktijksonmezer.nl", true },
- { "huisartsenpraktijkzonnehoed.nl", true },
- { "huisjeboompje-baby.nl", true },
- { "huislaw.com", true },
- { "huislijn.nl", true },
- { "huissier-vosges.com", true },
- { "huitaodang.com", true },
- { "huizenvlees.nl", true },
- { "hulaginswoodworking.com", true },
- { "hulet.tech", true },
- { "hulldevs.net", true },
- { "hullseals.space", true },
- { "hulpbijmarketing.nl", true },
- { "hulpmiddelenshop.nl", true },
- { "human-clone.com", true },
- { "humanenrich.com", true },
- { "humanesources.com", true },
- { "humanidad.tk", true },
- { "humanit.com.au", true },
- { "humanity.com", true },
- { "humaniza.com.mx", true },
- { "humanlocation.net", true },
- { "humans.io", true },
- { "humanzee.com", true },
- { "humass.nl", true },
- { "humblebee.at", true },
- { "humblebee.be", true },
- { "humblebee.co.uk", true },
- { "humblebee.cz", true },
- { "humblebee.dk", true },
- { "humblebee.es", true },
- { "humblebee.eu", true },
- { "humblebee.fr", true },
- { "humblebee.gr", true },
- { "humblebee.hu", true },
- { "humblebee.ie", true },
- { "humblebee.it", true },
- { "humblebee.nz", true },
- { "humblebee.pl", true },
- { "humblebee.uk", true },
- { "humblebee.us", true },
- { "humblebeeshop.ca", true },
- { "humblebeeshop.com.au", true },
- { "humbledot.com", true },
- { "humboldthomeguide.com", true },
- { "humboldtmfg.com", true },
- { "humdingersnj.com", true },
- { "humeur.de", true },
- { "humexe.com", true },
- { "humio.com", true },
- { "hummingbird.services", true },
- { "hummy.tv", true },
- { "humpchies.com", true },
- { "humpen.se", true },
- { "humppakone.com", true },
- { "hund.io", true },
- { "hundeverwaltung.de", true },
- { "hundhausen.de", true },
- { "hundter.com", true },
- { "hunger.im", true },
- { "huniverse.co", true },
- { "hunngard.com", true },
- { "hunqz.com", true },
- { "hunstoncanoeclub.co.uk", true },
- { "huntcraft.ru", true },
- { "hunter-read.com", true },
- { "hunter.io", true },
- { "hunterkehoe.com", true },
- { "huntertechsolution.com", true },
- { "huntexpired.com", true },
- { "huntingdonbouncers.co.uk", true },
- { "huntingdonlifesciences.com", true },
- { "huntshomeinspections.com", false },
- { "huntsmansecurity.com", true },
- { "huntsvillecottage.ca", true },
- { "huoduan.com", true },
- { "huonit.com.au", true },
- { "huoqibaike.club", true },
- { "huotuyouxi.com", true },
- { "huoyankan.com", true },
- { "hup.hu", false },
- { "hurbascooter.com", true },
- { "hurd.is", true },
- { "hurleyhomestead.com", true },
- { "huroji.com", true },
- { "hurricanelabs.com", true },
- { "hurtigtinternet.dk", true },
- { "husakbau.at", true },
- { "hushfile.it", true },
- { "husic.net", false },
- { "husk.house", true },
- { "huskyeye.de", true },
- { "huskyinc.us", false },
- { "husqvarnamoped.se", true },
- { "hussam.eu.org", true },
- { "hustlehope.com", true },
- { "huurwoordenaar.nl", true },
- { "huutonauru.net", true },
- { "huwcbjones.co.uk", true },
- { "huxcoconstruction.com", true },
- { "huxley.net", true },
- { "huynhviet.com", true },
- { "huyvu.nl", true },
- { "huzu.com", true },
- { "hv-huset.no", true },
- { "hvdbox.de", true },
- { "hvenetworks.net", true },
- { "hvgg.de", true },
- { "hvh.no", true },
- { "hvmk.nl", true },
- { "hvrint.de", true },
- { "hvt.com.au", true },
- { "hvtuananh.com", true },
- { "hw923.com", true },
- { "hwag-pb.de", true },
- { "hwlibre.com", true },
- { "hwsw.io", true },
- { "hwx8.com", true },
- { "hwxvip.com", true },
- { "hx53.de", true },
- { "hx56.cc", true },
- { "hx678.cc", true },
- { "hx77.cc", true },
- { "hx789.cc", true },
- { "hxp.io", true },
- { "hxying.com", true },
- { "hy88win.com", true },
- { "hyatt.com", true },
- { "hybridragon.net", true },
- { "hybridworx.com", true },
- { "hybridworx.de", true },
- { "hybridworx.eu", true },
- { "hybridworx.net", true },
- { "hybridworx.org", true },
- { "hybrydowe-samochody.pl", true },
- { "hybula.com", true },
- { "hycken.com", true },
- { "hyckenberg.com", true },
- { "hyderabadonlinegifts.com", true },
- { "hydrante.ch", false },
- { "hydro17.com", true },
- { "hydrographicsocietybenelux.eu", true },
- { "hydroponicglobal.com.au", true },
- { "hydroturbine.info", false },
- { "hydrozone.fr", true },
- { "hyec.jp", true },
- { "hygieneproclean.co.nz", true },
- { "hygo.com", true },
- { "hyhy1.com", true },
- { "hyhy2.com", true },
- { "hyhy7.com", true },
- { "hyhy80.com", true },
- { "hyhy81.com", true },
- { "hyhy82.com", true },
- { "hyhy83.com", true },
- { "hyhy85.com", true },
- { "hyhy89.com", true },
- { "hyhy98.com", true },
- { "hyk.me", true },
- { "hylemorphica.org", true },
- { "hyncice.com", true },
- { "hynek.me", true },
- { "hyparia.fr", true },
- { "hyparia.org", true },
- { "hype.ru", true },
- { "hyper-text.org", true },
- { "hyper.ai", true },
- { "hyper.lol", true },
- { "hyperactive.am", true },
- { "hyperalgesia.com", true },
- { "hyperautomotive.com.au", true },
- { "hyperd.sh", true },
- { "hyperion.io", true },
- { "hyperreal.biz", true },
- { "hypersomnia.com", true },
- { "hyperstack.org", true },
- { "hyperthymia.com", true },
- { "hyperv.fr", true },
- { "hypnovir.us", true },
- { "hypolineweb.de", true },
- { "hypotecnicentrum.cz", true },
- { "hypotheca.ca", true },
- { "hypothecairelening.net", true },
- { "hypotheekbond.nl", true },
- { "hypothes.is", true },
- { "hypothyroidmom.com", true },
- { "hyr.mn", true },
- { "hysh.jp", true },
- { "hysolate.com", true },
- { "hytale.com", true },
- { "hytopcp168.com", true },
- { "hyundai.no", true },
- { "hyvanilmankampaamo.fi", true },
- { "hyvinvointineuvoja.fi", true },
- { "hyyen.com", true },
- { "hztgzz.com", true },
- { "i--b.com", true },
- { "i-0v0.in", true },
- { "i-fastnet.net", true },
- { "i-geld.de", true },
- { "i-house.gq", true },
- { "i-hoz.ru", true },
- { "i-logic.co.jp", false },
- { "i-make.com", true },
- { "i-make.fr", true },
- { "i-meto.com", true },
- { "i-office.com.vn", true },
- { "i-pinged-everyone.today", true },
- { "i-proswiss.com", false },
- { "i-red.info", true },
- { "i-sports.cz", true },
- { "i-telligence.de", true },
- { "i-verbi.it", true },
- { "i-voting.pl", true },
- { "i00.eu", true },
- { "i1314.gdn", true },
- { "i2b.ro", true },
- { "i2verify.com", true },
- { "i36533.com", true },
- { "i36594.com", true },
- { "i4m1k0su.com", true },
- { "i51365.com", true },
- { "i5y.co.uk", true },
- { "i5y.org", true },
- { "i7sas.tk", true },
- { "i81818.com", true },
- { "i879.com", true },
- { "i95.me", false },
- { "i9s.in", true },
- { "ia.cafe", true },
- { "ia.net", true },
- { "iaco.li", true },
- { "iactu.info", true },
- { "iaeste.no", true },
- { "iaeste.or.jp", true },
- { "iaf.gov", true },
- { "iahemobile.net", true },
- { "iainsimms.co.uk", true },
- { "iainsimms.com", true },
- { "iainsimms.me", true },
- { "iaitouzi.com", true },
- { "ialis.me", true },
- { "ialps.cn", true },
- { "iam.lc", true },
- { "iam.soy", true },
- { "iamanewme.com", true },
- { "iambozboz.co.uk", true },
- { "iamhansen.xyz", true },
- { "iamhealthystore.com", true },
- { "iamjoshellis.com", true },
- { "iamlbk.com", true },
- { "iamlife.com", true },
- { "iamlizu.com", true },
- { "iamtheib.me", true },
- { "iamtonyarthur.com", true },
- { "iamusingtheinter.net", false },
- { "iamwill.io", true },
- { "iamwoodbeard.com", true },
- { "ianbrault.com", true },
- { "iancu.io", true },
- { "iancu.me", true },
- { "iandouglasscott.com", true },
- { "iane-ccs.com", true },
- { "ianix.com", true },
- { "ianjmoriarty.com", true },
- { "ianklug.com", true },
- { "iankmusic.com", true },
- { "ianmooreis.me", true },
- { "ianmoriarty.com.au", true },
- { "iansyst.co.uk", true },
- { "ianwalsh.org", false },
- { "iap.network", true },
- { "ias-gruppe.net", true },
- { "iassess.eu", true },
- { "iatfei.com", true },
- { "iautodily.cz", true },
- { "iavian.com", true },
- { "iba.community", true },
- { "ibacktraced.it", true },
- { "ibaq.nl", true },
- { "ibauruapan.com.mx", true },
- { "ibavaro.com", true },
- { "ibb.co", true },
- { "ibcl.us", true },
- { "ibcmed.org", true },
- { "ibe.de", true },
- { "ibeep.com", true },
- { "iberiaversicherungen.com", true },
- { "ibericaderedes.es", true },
- { "ibericarbenet.es", true },
- { "ibericarcuzco.es", true },
- { "ibericarcuzcomini.es", true },
- { "ibericarformula.es", true },
- { "ibericargestoso.es", true },
- { "ibericarmotors.es", true },
- { "ibericarmotorsmalaga.es", true },
- { "ibericarmovilcentro.es", true },
- { "ibericarmovilsur.es", true },
- { "ibericarreicomsa.es", true },
- { "ibericartechnik.es", true },
- { "iberion.pl", true },
- { "ibestproduct.com", true },
- { "ibestreview.com", true },
- { "ibexcore.com", true },
- { "ibhgospel.com", true },
- { "ibi.mt", true },
- { "ibidyoupeace.com", true },
- { "ibigawamizueco.com", true },
- { "ibin.co", true },
- { "ibiz.mk", true },
- { "iblackfriday.ro", true },
- { "ibloggospel.com", true },
- { "ibodyiq.com", true },
- { "ibps-recruitment.in", true },
- { "ibrainmedicine.org", true },
- { "ibraphotography.com", true },
- { "ibrom.eu", true },
- { "ibugone.com", true },
- { "ibuki.run", true },
- { "ibwc.gov", true },
- { "ibykos.com", true },
- { "ic-lighting.com.au", true },
- { "ic3.gov", true },
- { "icafecash.com", true },
- { "icanhas.report", true },
- { "icanhasht.ml", true },
- { "icanhazpass.com", true },
- { "icarlos.net", true },
- { "iccorporateinteriors.com.au", true },
- { "iccpublisher.com", true },
- { "icdp.org.ua", true },
- { "ice.xyz", true },
- { "iceandfiremechanical.com", true },
- { "iceberg.academy", false },
- { "icecars.net", true },
- { "icecontrol.ro", true },
- { "icecutethings.com", true },
- { "icedream.tech", true },
- { "icelandic.cf", true },
- { "icelandicasian.com", true },
- { "icetiger.eu", true },
- { "icetravellers.com", true },
- { "icewoman.net", true },
- { "ich-hab-die-schnauze-voll-von-der-suche-nach-ner-kurzen-domain.de", true },
- { "ich-tanke.de", true },
- { "icharme.fr", true },
- { "ichasco.com", true },
- { "ichbinein.org", true },
- { "ichbinkeinreh.de", true },
- { "ichitaso.com", true },
- { "iclinic.ua", true },
- { "icloud.st", true },
- { "icmhd.ch", false },
- { "icmp2018.org", true },
- { "icmshoptrend.com", true },
- { "icobench.com", true },
- { "icodeconnect.com", true },
- { "icoh.it", true },
- { "iconomi.net", true },
- { "icpc.pp.ua", true },
- { "icsfinomornasco.gov.it", true },
- { "ict-concept.nl", true },
- { "ict-crew.nl", true },
- { "ict-helpteam.nl", true },
- { "ict-radar.com", true },
- { "ict-radar.nl", true },
- { "ictbaneninnederland.nl", true },
- { "ictbiz.com.au", true },
- { "ictcareer.ch", true },
- { "ictindia.in", true },
- { "ictoniolopisa.it", true },
- { "ictradar.com", true },
- { "ictussistemas.com.br", true },
- { "icy.aq", true },
- { "icyapril.com", true },
- { "icymint.me", true },
- { "icynet.eu", true },
- { "iczc.cz", true },
- { "id-blog.ch", false },
- { "id.atlassian.com", false },
- { "id.mayfirst.org", false },
- { "id.search.yahoo.com", false },
- { "id3global.com", true },
- { "idaeus.eu", true },
- { "idahoansforliberty.net", true },
- { "idar-oberstein.de", false },
- { "idarv.com", true },
- { "idaspis.com", true },
- { "idatha.de", true },
- { "idconsult.nl", true },
- { "iddconnect.com", true },
- { "iddconnect.org", true },
- { "iddns.net", true },
- { "ideageek.net", true },
- { "ideal-envelopes.co.uk", false },
- { "idealcontabilidade.net", true },
- { "idealimplant.com", true },
- { "idealize.ml", true },
- { "idealog.id", true },
- { "idealsegurancaeletronica.com.br", true },
- { "idealtruss.com", true },
- { "idealtruss.com.tw", true },
- { "idealwhite.space", true },
- { "ideashop.com", true },
- { "ideatarmac.com", true },
- { "ideaweb.de", true },
- { "idee-lq.at", true },
- { "idee-lq.ch", true },
- { "idee-lq.com", true },
- { "idee-lq.de", true },
- { "idee-lq.net", true },
- { "ideiasefinancas.com.br", true },
- { "idenamaislami.com", true },
- { "idensys.nl", true },
- { "ident-clinic.be", true },
- { "identassist.com", true },
- { "identigraf.center", true },
- { "identity.plus", true },
- { "identitytheft.gov", true },
- { "idered.net", true },
- { "idesoft.cloud", true },
- { "idesoft.com", true },
- { "idesoft.eu", true },
- { "idesoft.net", true },
- { "idesoft.org", true },
- { "idesoftinnovacion.com", true },
- { "idesoftinnovacion.es", true },
- { "idexxpublicationportal.com", true },
- { "idgard.de", false },
- { "idgateway.co.uk", true },
- { "idhosts.co.id", true },
- { "idkidknow.com", true },
- { "idleleo.com", true },
- { "idlethoughtsandramblings.com", true },
- { "idlewildflowers.com", true },
- { "idmanagement.gov", true },
- { "idmobile.co.uk", true },
- { "idndx.com", true },
- { "idoc24.com", true },
- { "idodiandina.com", true },
- { "idolf.dk", true },
- { "idolish7.fun", false },
- { "idolknow.com", true },
- { "idontplaydarts.com", true },
- { "idoparadoxon.hu", true },
- { "idratherbequilting.com", true },
- { "idraulico-roma.it", true },
- { "idraulico-roma.org", true },
- { "idraulico.roma.it", true },
- { "idrissi.eu", true },
- { "idroserviceweb.com", true },
- { "idrycleaningi.com", true },
- { "idtheft.gov", true },
- { "idubaj.cz", true },
- { "idunno.org", true },
- { "idvl.de", true },
- { "idxforza.com", true },
- { "idyl.fr", true },
- { "idysse.com", true },
- { "ie.search.yahoo.com", false },
- { "iea-annex61.org", true },
- { "iedison.vip", true },
- { "ieeedeis.org", true },
- { "ieeesb.nl", true },
- { "ieeesbe.nl", true },
- { "ieeespmb.org", true },
- { "iegat.com", true },
- { "ieji.de", true },
- { "iemb.tk", true },
- { "ienakanote.com", false },
- { "ient.me", true },
- { "ies-italia.it", true },
- { "ies911.com", true },
- { "iesonline.co.in", true },
- { "ieval.ro", true },
- { "iexpert99.com", true },
- { "ifacservice.be", true },
- { "ifan.ws", true },
- { "ifbagro.in", true },
- { "ifconfig.se", true },
- { "ifelse.io", true },
- { "ifengge.cn", true },
- { "ifgcdn.com", true },
- { "ifibe.com", true },
- { "ifightsurveillance.com", true },
- { "ifightsurveillance.net", true },
- { "ifightsurveillance.org", true },
- { "ifiveglobal.com", true },
- { "ifixe.ch", false },
- { "iflyi.me", true },
- { "ifma.edu.br", true },
- { "ifoa.it", true },
- { "ifolder.ga", true },
- { "ifort.fr", true },
- { "ifosep.fr", false },
- { "ifoss.me", true },
- { "ifsac.org", true },
- { "ifsclist.com", true },
- { "ifsr.de", true },
- { "ift.cx", true },
- { "iftarsaati.org", true },
- { "iftrue.de", false },
- { "ifttl.com", true },
- { "ifxd.bid", true },
- { "ig.com", true },
- { "ig.me", true },
- { "iga-semi.jp", true },
- { "igap.pt", true },
- { "igarage.nl", true },
- { "igdn.de", true },
- { "igeh-immo.at", true },
- { "igglabs.com", true },
- { "iggprivate.com", true },
- { "iggsoft.com", true },
- { "iggsoftware.com", true },
- { "ighl.de", true },
- { "igiftcards.de", true },
- { "igiftcards.nl", true },
- { "igimusic.com", false },
- { "igk.nz", true },
- { "iglobus.cz", true },
- { "iglosujemy.pl", true },
- { "igmus.org", true },
- { "ignacjanskiednimlodziezy.pl", true },
- { "ignat-mag.com", true },
- { "ignat.by", true },
- { "ignatij.tk", true },
- { "ignatovich.by", true },
- { "ignatovich.me", true },
- { "ignet.gov", true },
- { "ignitedlocal.com", true },
- { "ignitelocal.com", true },
- { "ignition.gg", true },
- { "igondola.net", true },
- { "igorandandre.com", true },
- { "igorrealestate.com", true },
- { "igorw.org", true },
- { "igotoffer.com", false },
- { "igramfollower.com", true },
- { "igramming.com", true },
- { "igrarium.com.ua", true },
- { "igrivi.com", true },
- { "iguana.com.ec", false },
- { "ih8sn0w.com", true },
- { "iha6.com", true },
- { "ihacker.cn", true },
- { "ihacker.net", true },
- { "ihacklabs.com", false },
- { "ihasco.co.uk", true },
- { "ihcprofile.com", true },
- { "ihearmedical.com", true },
- { "ihempz.cz", true },
- { "ihkk.net", true },
- { "ihls.stream", true },
- { "ihmphila.org", true },
- { "ihollaback.org", true },
- { "ihorizon.jp", true },
- { "ihostup.net", true },
- { "ihotel.io", true },
- { "ihre-pflege-sachsen.de", true },
- { "ihrhost.com", true },
- { "ihtdenisjaccard.com", true },
- { "ihuan.me", true },
- { "ii74.com", true },
- { "ii918.com", true },
- { "iiax.net", true },
- { "iiax.org", true },
- { "iiit.pl", true },
- { "iimarckus.org", true },
- { "iinf.in", true },
- { "iinfin.org", true },
- { "iinix.com", true },
- { "iiong.com", true },
- { "iisjy.cn", true },
- { "iitowns.ir", true },
- { "iix.se", true },
- { "iiyama-bg.com", true },
- { "ijazjewelers.com", true },
- { "ijinus.com", true },
- { "ijm.io", true },
- { "ijohan.nl", true },
- { "ijsbaanwitten.nl", true },
- { "ijsblokjesvormen.nl", true },
- { "ijsclubdwarsgracht.nl", true },
- { "ijsclubtilburg.nl", true },
- { "ijsclubwanneperveen.nl", true },
- { "ijunohana.jp", true },
- { "ik-life.com", false },
- { "ikachalife.com", true },
- { "ikarate.ru", true },
- { "ikari-san.tk", true },
- { "ikaria.com.gr", true },
- { "ikeacareers.co.uk", true },
- { "ikebukuro-shame.com", true },
- { "ikedaquotes.org", true },
- { "ikespta.com", true },
- { "ikeyless.com", true },
- { "iki4you.com", true },
- { "ikigaiweb.com", true },
- { "ikiler.com", true },
- { "ikinokori-marketing.com", true },
- { "ikisser.de", true },
- { "ikk.me", true },
- { "ikkatsu-satei.jp", true },
- { "ikke-coach.nl", true },
- { "ikkev.de", true },
- { "ikkoku.de", true },
- { "iklive.org", false },
- { "iknet.top", true },
- { "ikparis.com", true },
- { "ikraenglish.com", false },
- { "ikulist.me", true },
- { "ikvts.de", true },
- { "ikwilthepiratebay.org", true },
- { "ikx.me", true },
- { "ila.fi", true },
- { "ilacrehberi.com", true },
- { "ilamparas.at", true },
- { "ilamparas.co.uk", true },
- { "ilamparas.com", true },
- { "ilamparas.com.co", true },
- { "ilamparas.com.ve", true },
- { "ilamparas.mx", true },
- { "ilard.fr", true },
- { "ilazycat.com", true },
- { "ilc510.com", true },
- { "ilc518.com", true },
- { "ilc519.com", true },
- { "ilc520.com", true },
- { "ilc525.com", true },
- { "ilc528.com", true },
- { "ilc552.com", true },
- { "ilc553.com", true },
- { "ilc568.com", true },
- { "ilc583.com", true },
- { "ilc588.com", true },
- { "ilc66.com", true },
- { "ilc666.com", true },
- { "ilc999.com", true },
- { "ildomani.it", true },
- { "ile-kalorii.pl", true },
- { "ile-sapporo.jp", true },
- { "ilektronika-farmakeia-online.gr", true },
- { "ilemonrain.com", true },
- { "ilformichiere.com", true },
- { "ilg.ink", true },
- { "ilgiornaledelticino.ch", true },
- { "ilhan.name", true },
- { "iliastsi.net", true },
- { "iligang.cn", true },
- { "iligang.com", true },
- { "iligang.com.cn", true },
- { "iligang.link", true },
- { "iligang.net", true },
- { "iligang.net.cn", true },
- { "iligang.xin", true },
- { "iliz-kafe.fr", true },
- { "ilkeakyildiz.com", false },
- { "illaadventure.com", true },
- { "illambias.ch", false },
- { "illange.info", true },
- { "illative.net", true },
- { "illegalpornography.com", true },
- { "illegalpornography.me", true },
- { "illerzell.de", true },
- { "illich.cz", true },
- { "illicitart.ca", true },
- { "illicitdigital.com", true },
- { "illinoiscaselaw.com", true },
- { "illorenese.fr", true },
- { "illsley.org", true },
- { "illumed.net", true },
- { "illuminationis.com", true },
- { "illusionephemere.com", false },
- { "illusionunlimited.com", true },
- { "illustrate.biz", true },
- { "illuxat.com", true },
- { "ilmainensanakirja.fi", true },
- { "ilmataat.ee", true },
- { "ilmiobusinessonline.it", true },
- { "ilmiogiardiniere.it", true },
- { "ilmuk.org", false },
- { "iloft.xyz", true },
- { "ilonewolfs.com", true },
- { "ilookz.nl", true },
- { "ilove.fish", true },
- { "ilove588.com", true },
- { "ilove618.com", true },
- { "ilove918.com", true },
- { "iloveherb.ru", true },
- { "ilovelwy.com", true },
- { "ilovequiz.ru", true },
- { "ilovesamara.tk", true },
- { "ilovestickers.gr", true },
- { "ilovethiscampsite.com", true },
- { "iloveyoutoo.tk", true },
- { "ilrg.com", true },
- { "iltec-prom.ru", true },
- { "iltec.ru", true },
- { "ilug-ktm.tk", true },
- { "ilumantio.tk", true },
- { "ilweb.es", true },
- { "ilya.pp.ua", true },
- { "im-a.cricket", true },
- { "im-c-shop.com", true },
- { "im-haus-sonnenschein.de", true },
- { "im-in.space", true },
- { "im2net.com", true },
- { "im4h.de", true },
- { "im4h.eu", true },
- { "im4h.info", true },
- { "im66.net", true },
- { "imacs.org", true },
- { "image-drive.de", true },
- { "image.tf", false },
- { "imagebin.ca", true },
- { "imagecurl.com", true },
- { "imagecurl.org", true },
- { "imagefu.com", true },
- { "imagerive.ch", false },
- { "imaginair.es", true },
- { "imaginary.ca", true },
- { "imaginary.stream", true },
- { "imaginationpathway.com", true },
- { "imagine-programming.com", true },
- { "imaginelab.club", true },
- { "imaginetricks.com", true },
- { "imagr.io", true },
- { "imanageproducts.co.uk", true },
- { "imanageproducts.uk", true },
- { "imanesdeviaje.com", true },
- { "imanolbarba.net", true },
- { "imap2imap.de", true },
- { "imarkethost.co.uk", true },
- { "imawhale.com", true },
- { "imbiancatura.milano.it", true },
- { "imbianchino.roma.it", true },
- { "imcassociation.com", true },
- { "imcsi.cn", true },
- { "imcsx.co", true },
- { "imdemos.com", true },
- { "ime-a-tolerancia-eredmenye.club", true },
- { "ime.moe", true },
- { "imed.com.pt", true },
- { "imed.pt", true },
- { "imedes.de", true },
- { "imedia.com.sg", false },
- { "imediafly.com", true },
- { "imedikament.de", true },
- { "imeds.pl", true },
- { "imex-dtp.com", true },
- { "imforza.com", true },
- { "img.com.ru", true },
- { "img.mg", true },
- { "img.ovh", true },
- { "img.ren", true },
- { "imga.ch", true },
- { "imgaa.com", true },
- { "imgal.vin", true },
- { "imgbb.com", true },
- { "imgg.es", true },
- { "imgup.co", true },
- { "imguploaden.nl", true },
- { "imhua.com", true },
- { "imi-rhapsody.eu", false },
- { "imiix.mx", true },
- { "iminshell.com", false },
- { "imirhil.fr", true },
- { "imisa.com.mx", true },
- { "imitza.com", false },
- { "imjad.cn", true },
- { "imjo.in", true },
- { "imjustcreative.com", true },
- { "imkerei-contento.de", true },
- { "imkerei-freilinger.de", false },
- { "imkereicontento.de", true },
- { "imkerverein-moenchswald.de", true },
- { "imkerverenigingzaanstreek.nl", true },
- { "imkindofabigdeal.com", true },
- { "imlec.net", true },
- { "immaterium.de", true },
- { "immatix.xyz", true },
- { "immedia.net", true },
- { "immersa.co.uk", true },
- { "immersion-pictures.com", true },
- { "immigrantdad.com", true },
- { "immivest.com", true },
- { "immo-agentur.com", false },
- { "immo-passion.net", false },
- { "immobilien-badlippspringe.de", true },
- { "immobilien-in-istanbul.de", true },
- { "immobilien-zirm.de", true },
- { "immobiliengutachter-holland.de", true },
- { "immobilier-nice.fr", true },
- { "immobilier92.net", true },
- { "immobiza.com", false },
- { "immortal-pc.info", true },
- { "immortal.run", true },
- { "immortec.com", true },
- { "immovit.be", true },
- { "imobile3.com", true },
- { "imoe.xyz", true },
- { "imokuri123.com", true },
- { "imolights.com", true },
- { "imolights.net", true },
- { "imoney.tw", true },
- { "imouto.my", false },
- { "imoveisavenda.rio.br", true },
- { "impact-fluids.com", true },
- { "impact.health.nz", true },
- { "impacter.eu", true },
- { "impactingsports.com", true },
- { "impactplumbingdrainage.com.au", true },
- { "impactpub.ch", false },
- { "impakho.com", true },
- { "impas.se", true },
- { "impelup.com", true },
- { "impera.at", true },
- { "imperial-legrand.com", true },
- { "imperialmiami.com", true },
- { "imperiumglass.com.au", true },
- { "impiantistica.org", true },
- { "implantologie-dr-loeck.de", true },
- { "impns.org", true },
- { "imponet.com.ar", true },
- { "import-shopping.de", true },
- { "importsagt.com", true },
- { "importsign.com", true },
- { "imposingoods.com", true },
- { "impossible.co", true },
- { "impossible.org", true },
- { "impossiblefitness.com", true },
- { "impossiblehq.com", true },
- { "impossiblenutrition.com", true },
- { "impossiblex.com", true },
- { "impotsimple.ca", true },
- { "imppac-schmuck.de", true },
- { "imppac.de", true },
- { "imprendo.co", true },
- { "imprendo.pro", true },
- { "impresa-di-pulizie.milano.it", true },
- { "impresa-di-pulizie.org", true },
- { "impresa-pulizie.it", true },
- { "impresadipulizia.roma.it", true },
- { "impresadipulizie.roma.it", true },
- { "impresadipulizieantonella.com", true },
- { "impresaedile.roma.it", true },
- { "impresapulizia.milano.it", true },
- { "impresapulizie.firenze.it", true },
- { "impresapuliziebergamo.it", true },
- { "imprezzor.com", true },
- { "imprimante-3d-store.fr", true },
- { "improfestival.ee", true },
- { "improklinikken.dk", true },
- { "improv.ee", true },
- { "improved-madness.de", true },
- { "improvision.eu", true },
- { "impulsocristiano.com", true },
- { "impyus.com", true },
- { "imququ.com", true },
- { "imreh.net", true },
- { "imrunner.com", true },
- { "imrunner.ru", true },
- { "ims-sargans.ch", true },
- { "imscompany.com", true },
- { "imstocker.com", true },
- { "imtikaib.ml", true },
- { "imwalking.de", true },
- { "imwjc.xyz", true },
- { "imy.rs", true },
- { "imydl.com", true },
- { "imydl.tech", true },
- { "imyjy.cn", true },
- { "imyrs.cn", true },
- { "imyunya.com", true },
- { "imyvm.com", true },
- { "imyz.tw", true },
- { "in-depthoutdoors.com", true },
- { "in-flames.com", true },
- { "in.search.yahoo.com", false },
- { "in.xero.com", false },
- { "in1000worten.de", true },
- { "in10tion.com", false },
- { "inabox.ro", true },
- { "inait.ai", true },
- { "inalvittile.cf", true },
- { "inanam.tk", true },
- { "inanyevent.london", true },
- { "inares.org", true },
- { "inbitcoin.it", true },
- { "inbound.menu", true },
- { "inbound.tk", true },
- { "inbounder.io", false },
- { "inbox.google.com", true },
- { "inboxceo.com", true },
- { "inbulgaria.info", true },
- { "incarceratedwombats.com", true },
- { "incarna.co", true },
- { "incert.cn", true },
- { "incertint.com", true },
- { "inche-ali.com", true },
- { "inchenaim.com", true },
- { "inchidi.id", true },
- { "incigma.com", false },
- { "includesubdomains.preloaded.test", true },
- { "includesubdomains2.preloaded.test", true },
- { "inclusion.tn", true },
- { "incoherent.ch", true },
- { "income.wiki", true },
- { "incomeproshoutr.com", true },
- { "incommon.io", true },
- { "incompliance.de", true },
- { "inconcerts.de", true },
- { "incontrixsingle.net", true },
- { "incore.nl", true },
- { "incosi.com", true },
- { "incowrimo.org", true },
- { "incparadise.net", true },
- { "increasetestosteronelevels.org", true },
- { "incrementation.net", true },
- { "incrom.com", true },
- { "incubos.org", true },
- { "incy.io", true },
- { "ind.ie", true },
- { "indasun.com", true },
- { "indecipherable.info", true },
- { "independencerecovery.com", true },
- { "independenttravelcats.com", true },
- { "index-mp3.com", true },
- { "indexcesmad.cz", true },
- { "indexmarket.ml", true },
- { "indiaflowermall.com", true },
- { "indiafm.tk", true },
- { "indian-elephant.com", true },
- { "indianaberry.com", true },
- { "indianafoundationpros.com", true },
- { "indianamoldrepairpros.com", true },
- { "indianapolisnews.ml", true },
- { "indianareflux.com", true },
- { "indianawaterdamagerepairpros.com", true },
- { "indianerschmuck24.de", true },
- { "indiansmartpanel.com", true },
- { "indianvisa.online", true },
- { "indiapur.com", true },
- { "indiatrademarkwatch.com", true },
- { "indiayogastudio.net", true },
- { "indicateurs-flash.fr", true },
- { "indie.dog", true },
- { "indiecongdr.it", true },
- { "indievelopment.nl", true },
- { "indigartbeading.ca", true },
- { "indigartbeading.com", true },
- { "indigitalagency.com", true },
- { "indigoblack.com.au", true },
- { "indigobooks.gq", true },
- { "indigoinflatables.com", true },
- { "indigojewelers.com", true },
- { "indigolawnscape.net", true },
- { "indigosakura.com", true },
- { "indigostudios.com", true },
- { "indigotreeservice.com", true },
- { "indika.pe", true },
- { "indio.co.jp", true },
- { "inditip.com", true },
- { "inditoot.com", true },
- { "individualizedwellness.net", true },
- { "indochina.io", true },
- { "indogermanstartup.com", true },
- { "indoor-kletterwald.de", true },
- { "indoorcomfortteam.com", true },
- { "indoorpaintball.co.uk", true },
- { "indospot.tk", true },
- { "indota.hu", true },
- { "indovinabank.com.vn", true },
- { "indusap.com", true },
- { "indusfastremit-us.com", true },
- { "indust.me", true },
- { "industriafranchini.com", true },
- { "industrial-remote-control.com", true },
- { "industrialstarter.com", true },
- { "industriemeister.io", true },
- { "indybay.org", true },
- { "ineardisplay.com", false },
- { "ineed.coffee", false },
- { "inefin.tk", true },
- { "inegol.mobi", true },
- { "inesfinc.es", true },
- { "inesta.nl", true },
- { "inet.se", true },
- { "inethost.eu", true },
- { "inetpub.cn", true },
- { "inetserver.eu", true },
- { "inetsoftware.de", true },
- { "inewroom.com", true },
- { "inf-fusion.ca", true },
- { "inf0sec.nl", true },
- { "infans.be", true },
- { "inference.biz.tr", true },
- { "infermiere.roma.it", true },
- { "inff.info", true },
- { "inffin-portal.de", true },
- { "inficom.org", true },
- { "infinipharm.com", true },
- { "infinitescript.com", true },
- { "infinitiofallentownparts.com", true },
- { "infinitioflynnwoodparts.com", true },
- { "infinitomaisum.com", true },
- { "infinity-uitvaartzorg.nl", true },
- { "infinity3dengine.com", true },
- { "infinitybas.com", true },
- { "infinitybc.se", true },
- { "infinityepos.co.uk", true },
- { "infinityvr.net", true },
- { "infirmiere-canadienne.com", true },
- { "infirmieredevie.ch", false },
- { "infivalle.gov.co", true },
- { "inflatablehire-scotland.co.uk", true },
- { "inflatablesny.com", true },
- { "inflatamania.com", true },
- { "inflatiecalculator.nl", true },
- { "inflationstation.net", true },
- { "inflexsys.com", true },
- { "influencerchampions.com", true },
- { "influo.com", true },
- { "infmed.com", true },
- { "info-beamer.com", true },
- { "info-bolivia.tk", true },
- { "info-o-zbozi.cz", true },
- { "info-screen-usercontent.me", true },
- { "info-screen.me", true },
- { "info-screw.com", true },
- { "infoamin.com", true },
- { "infobae.com", true },
- { "infobot.email", true },
- { "infobot.eu", true },
- { "infobot.nl", true },
- { "infobrain.net", true },
- { "infocity-tech.fr", true },
- { "infocoin.es", true },
- { "infocommsociety.com", true },
- { "infocon.org", true },
- { "infocus.company", true },
- { "infocusvr.net", true },
- { "infodesigners.eu", true },
- { "infodesk.at", true },
- { "infodiscus.com", true },
- { "infoduv.fr", true },
- { "infogram.com", true },
- { "infogym.com", true },
- { "infohub.com.ua", true },
- { "infoland.ml", true },
- { "infomasx.com", true },
- { "infomegastore.com", true },
- { "infomisto.com", true },
- { "infomundord.com", true },
- { "infopier.sg", true },
- { "infoprosnetwork.com", true },
- { "infor-allaitement.be", true },
- { "informace-zbozi.cz", true },
- { "informat.ga", true },
- { "informatiebeveiliging.nl", true },
- { "informatiger.net", true },
- { "informatik-handwerk.de", true },
- { "informationrx.org", true },
- { "informations-echafaudages.com", true },
- { "informhealth.com", true },
- { "informnapalm.org", true },
- { "informspb.tk", true },
- { "infosec-handbook.eu", true },
- { "infosec.exchange", false },
- { "infosec.wiki", true },
- { "infosecchicago.com", true },
- { "infosectalks.com", true },
- { "infosectekniques.com", true },
- { "infosective.org", true },
- { "infosenior.ch", true },
- { "infosexual.com", true },
- { "infosubasta.es", true },
- { "infotainworld.com", true },
- { "infotelecharge.com", true },
- { "infotune.nl", true },
- { "infovision-france.com", true },
- { "infra-se.com", true },
- { "infra.land", true },
- { "infraball.com", true },
- { "infrabeep.com", true },
- { "infrabeta.com", true },
- { "infrabind.com", true },
- { "infrabold.com", true },
- { "infrabond.com", true },
- { "infraboom.com", true },
- { "infraclass.com", true },
- { "infraclip.com", true },
- { "infracron.com", true },
- { "infradart.com", true },
- { "infradisk.com", true },
- { "infradrop.com", true },
- { "infraedifice.com", true },
- { "infrafile.com", true },
- { "infrafind.com", true },
- { "infrafire.com", true },
- { "infraflip.com", true },
- { "infraflux.com", true },
- { "infrafuse.com", true },
- { "infrafusion.com", true },
- { "infralira.com", true },
- { "infralist.com", true },
- { "infraloon.com", true },
- { "inframake.com", true },
- { "inframeet.com", true },
- { "inframenu.com", true },
- { "inframetro.com", true },
- { "inframint.com", true },
- { "infraname.com", true },
- { "infranest.com", true },
- { "infranium.com", true },
- { "infranium.eu", true },
- { "infranium.info", true },
- { "infranium.net", true },
- { "infranium.org", true },
- { "infranotes.com", true },
- { "infranoto.com", true },
- { "infranox.com", true },
- { "infrapass.com", true },
- { "infrapeer.com", true },
- { "infrapilot.com", true },
- { "infraping.com", true },
- { "infrapirtis.lt", true },
- { "infraplot.com", true },
- { "infrarank.com", true },
- { "infrarank.net", true },
- { "infraredradiant.com", true },
- { "infrarot-thermometer.info", true },
- { "infraspin.com", true },
- { "infratank.com", true },
- { "infratask.com", true },
- { "infrathink.com", true },
- { "infratrip.com", true },
- { "infravibe.com", true },
- { "infravideo.com", true },
- { "infravoce.com", true },
- { "infrazine.com", true },
- { "ing-buero-junk.de", true },
- { "ingadesign.it", true },
- { "ingatlanjogaszok.hu", true },
- { "ingber.com", true },
- { "inge-r.nl", true },
- { "ingeeibach.de", true },
- { "ingenias.es", true },
- { "ingenius.ws", true },
- { "ingermany.ml", true },
- { "ingestion.life", true },
- { "ingi.ga", true },
- { "ingjobs.ch", true },
- { "inglebycakes.co.uk", true },
- { "inglesencanada.cf", true },
- { "inglesnarede.com.br", true },
- { "ingo-schlueter.de", true },
- { "ingolonde.pw", true },
- { "ingoschlueter.de", true },
- { "ingressfs.pl", true },
- { "inh.gob.ve", true },
- { "inhaltsangabe.de", true },
- { "inheritestate.com", true },
- { "inhouseents.co.uk", true },
- { "iniby.com", true },
- { "inima.org", true },
- { "iningrui.com", true },
- { "inishbofin.ie", true },
- { "init.blog", true },
- { "initialization.tech", true },
- { "initramfs.io", true },
- { "initrd.net", true },
- { "injigo.com", false },
- { "injurylawyer.com", true },
- { "ink.horse", true },
- { "inkable.com.au", true },
- { "inkbunny.net", true },
- { "inkeliz.com", true },
- { "inkhor.se", true },
- { "inkontriamoci.com", true },
- { "inkopers.org", true },
- { "inksay.com", true },
- { "inkspire.co.uk", true },
- { "inkthreadable.co.uk", true },
- { "inkurz.de", true },
- { "inlabo.de", true },
- { "inline-sport.cz", true },
- { "inlinea.ch", true },
- { "inlineskating.ga", true },
- { "inlink.ee", true },
- { "inlt.com", true },
- { "inmaps.xyz", true },
- { "inmatefinancial.com", true },
- { "inmateintake.com", true },
- { "inmatesupport.org", true },
- { "inmedic.pl", true },
- { "inmedsm.com", true },
- { "inmigracion-florida.com", true },
- { "inmobillium.fr", true },
- { "inmueblescartagena.com.co", true },
- { "innatocol.com", true },
- { "innerfence.com", true },
- { "innerlightcrystals.co.uk", true },
- { "innermostparts.org", true },
- { "innersafe.com", true },
- { "innico.cf", true },
- { "inno.ch", false },
- { "innocenceseekers.net", true },
- { "innogen.fr", true },
- { "innohb.com", true },
- { "innolabfribourg.ch", true },
- { "innophate-security.com", true },
- { "innoraft.com", true },
- { "innot.net", true },
- { "innotas.com", true },
- { "innoteil.com", true },
- { "innotel.com.au", true },
- { "innovacoachgroup.com", true },
- { "innovairservices.ch", true },
- { "innovamag.com", true },
- { "innovaptor.at", true },
- { "innovaptor.com", true },
- { "innovate-indonesia.com", true },
- { "innovation-workshop.ro", true },
- { "innovation.gov", false },
- { "innover.se", true },
- { "innovere.co.uk", true },
- { "innovomuebles.com", true },
- { "innovum.cz", true },
- { "innsalzachsingles.de", true },
- { "innvisiondesign.net", true },
- { "innwan.com", true },
- { "inoa8.com", true },
- { "inobun.jp", true },
- { "inocelda.com", true },
- { "inodari.com", true },
- { "inoio.de", true },
- { "inondation.ch", false },
- { "inovatec.com", true },
- { "inovatecapi.com", true },
- { "inovatecsystems.com", true },
- { "inovitec.eu", false },
- { "inoxdesign.fr", true },
- { "inoxdesign.pro", true },
- { "inoxmavang.net", true },
- { "inpas.co.uk", true },
- { "inpatec.com", true },
- { "inpdp.tk", true },
- { "inpector.de", true },
- { "inphi.com", true },
- { "inprotec.com.co", true },
- { "input.pt", true },
- { "inputmodes.com", true },
- { "inqorp.ca", true },
- { "inquant.de", true },
- { "ins-kreativ.de", true },
- { "ins.to", true },
- { "ins1gn1a.com", true },
- { "insanelyelegant.com", true },
- { "inscomers.net", false },
- { "inscribe.ai", true },
- { "inscripcionessena.com", true },
- { "insecret.co.ua", true },
- { "insecret.com.ua", true },
- { "insecret.trade", true },
- { "insecure.org.je", true },
- { "insegne.roma.it", true },
- { "insertcoins.net", true },
- { "inserzioniticino.ch", true },
- { "insgesamt.net", true },
- { "inshapenutrition.com.br", true },
- { "insho.fashion", true },
- { "inshop.hu", true },
- { "insiberia.tk", true },
- { "inside19.com", true },
- { "insideaudit.com", true },
- { "insidebedroom.com", true },
- { "insideevs.com", true },
- { "insideevs.fr", true },
- { "insidesolutions.nl", true },
- { "insidethefirewall.tk", true },
- { "insights.is", true },
- { "insignificant.space", true },
- { "insinuator.net", true },
- { "insistel.com", true },
- { "insomniasec.com", true },
- { "inspiratienodig.nl", true },
- { "inspired-creations.co.za", true },
- { "inspired-lua.org", true },
- { "inspiredlife.fun", true },
- { "inspiredrealtyinc.com", true },
- { "inspiresurgery.com", true },
- { "insside.net", true },
- { "insta-drive.com", true },
- { "instafind.nl", true },
- { "instafuckfriend.com", true },
- { "instagc.com", true },
- { "instagram-atom.appspot.com", true },
- { "instagram.com", false },
- { "instagrammernews.com", true },
- { "instagramtweet.com", true },
- { "instagraph.cn", true },
- { "instahub.net", true },
- { "installatietechniekgresnigt.nl", true },
- { "installgentoo.net", true },
- { "instamojo.com", true },
- { "instant-clearance-sale.co.uk", true },
- { "instant-thinking.de", true },
- { "instant.io", true },
- { "instantdomainsearch.com", true },
- { "instantkhabar.com", true },
- { "instava.cz", true },
- { "instawierszyki.pl", true },
- { "instead.com.au", true },
- { "insteagle.com", true },
- { "instela.com", true },
- { "instelikes.com.br", true },
- { "instics.com", true },
- { "institut-confucius-montpellier.org", true },
- { "institut-uthyl.com", true },
- { "institutogiuseppe.com", true },
- { "institutogiuseppe.com.ar", true },
- { "institutointersistemico.com.br", true },
- { "institutolancaster.com", true },
- { "institutomaritimocolombiano.com", true },
- { "instrumart.ru", false },
- { "insult.es", true },
- { "insurance321.com", true },
- { "insuranceonlinenow.com", true },
- { "insurediy.com.sg", true },
- { "insureon.com", true },
- { "int64software.com", true },
- { "intafe.co.jp", true },
- { "intakesync.com", true },
- { "intal.info", true },
- { "intarweb.ca", true },
- { "intasky.cz", true },
- { "intasky.sk", true },
- { "integ.jp", true },
- { "integralblue.com", true },
- { "integralkk.com", true },
- { "integralsalud.xyz", true },
- { "integrata.de", true },
- { "integratedintegrations.xyz", true },
- { "integratedmedicalonline.com", true },
- { "integratemyschool.com", true },
- { "integrateur-web-paris.com", true },
- { "integritet.com.se", true },
- { "integrity.gov", true },
- { "integrityglobal.com", true },
- { "integrityokc.com", true },
- { "integrityoklahoma.com", true },
- { "integrogroup.com", true },
- { "integromat.com", true },
- { "integroof.com", true },
- { "integsystem.com", true },
- { "intelhost.cl", true },
- { "intelhost.com", true },
- { "intelhost.com.ar", true },
- { "intelhost.com.br", true },
- { "intelhost.com.co", true },
- { "intelhost.com.mx", true },
- { "intelhost.com.pe", true },
- { "inteli.com.pl", true },
- { "intellar.com", true },
- { "intellectdynamics.com", true },
- { "intelliance.eu", true },
- { "intelligence-explosion.com", true },
- { "intelligenetics.com", true },
- { "intelligentcontacts.com", true },
- { "intellihr.io", true },
- { "intellimatica.se", true },
- { "intellimax.ir", true },
- { "intellinetixvibration.com", true },
- { "intellitonic.com", true },
- { "intelly.nl", true },
- { "intelly365.nl", true },
- { "intelmed.info", true },
- { "intencje.pl", true },
- { "intensify.pictures", true },
- { "intensivpflege-sachsen.de", true },
- { "intentanalytica.com", true },
- { "inter-corporate.com", true },
- { "interaffairs.com", true },
- { "interaktiva.fi", true },
- { "interasistmen.se", true },
- { "interchanges.io", true },
- { "intercom.com", true },
- { "intercom.io", true },
- { "intercrosse.tk", true },
- { "interessengemeinschaft-pregelstrasse.tk", true },
- { "interessiert-uns.net", true },
- { "interflores.com.br", true },
- { "interfug.de", true },
- { "intergozd.si", true },
- { "interiery-waters.cz", true },
- { "interimages.fr", true },
- { "interior-design-colleges.com", true },
- { "interiordesignsconcept.com", true },
- { "interisaudit.com", true },
- { "interlijn.nl", true },
- { "interlingvo.biz", true },
- { "intermax.nl", true },
- { "intermedinet.nl", true },
- { "interminsk.tk", true },
- { "intern.tax", true },
- { "internalkmc.com", true },
- { "international-arbitration-attorney.com", true },
- { "international-books.org", false },
- { "international-nash-day.com", true },
- { "internationalfashionjobs.com", true },
- { "internationalschool.it", true },
- { "internationalstudentassociation.com", true },
- { "internationaltalento.it", true },
- { "internect.co.za", true },
- { "internet-aukcion.info", true },
- { "internet-pornografie.de", false },
- { "internet-software.eu", true },
- { "internet-tv4u.tk", true },
- { "internet42.tk", true },
- { "internetaanbieders.eu", true },
- { "internetanbieter-experte.de", true },
- { "internetbank.swedbank.se", true },
- { "internetbugbounty.com", true },
- { "internetbusiness-howto.com", true },
- { "internetcom.jp", true },
- { "internetfonden.se", true },
- { "internetgardener.co.uk", true },
- { "internetinhetbuitengebied.nl", true },
- { "internetk.tk", true },
- { "internetloansdirect.com", true },
- { "internetmagaz.tk", true },
- { "internetmedia.si", true },
- { "internetmuseum.se", true },
- { "internetmusicexchange.com", true },
- { "internetnz.nz", true },
- { "internetofdon.gs", true },
- { "internetoffensive.fail", true },
- { "internetofinsecurethings.com", true },
- { "internetovehazardnihry.cz", true },
- { "internetpro.me", true },
- { "internetstaff.com", true },
- { "internetstiftelsen.se", true },
- { "internetzentrale.net", true },
- { "internetzonei.com", true },
- { "interparcel.com", true },
- { "interphoto.by", true },
- { "interpol.gov", true },
- { "interracial.dating", true },
- { "interseller.io", true },
- { "interssl.com", true },
- { "interstateautomotiveinc.com", true },
- { "interstateremovalists.sydney", true },
- { "intertime.services", true },
- { "interviewme.pl", true },
- { "interways.de", true },
- { "intheater.de", true },
- { "inthepicture.com", true },
- { "inthouse.cloud", true },
- { "intimznakomstvo.tk", true },
- { "intita.com", true },
- { "intl-webs.com", true },
- { "intmissioncenter.org", false },
- { "into-the-mountain.com", true },
- { "into.technology", true },
- { "inton.biz", true },
- { "intoparking.com", true },
- { "intoparking.fi", true },
- { "intpforum.com", true },
- { "intr0.cf", true },
- { "intrack.net.au", true },
- { "intradayseasonals.com", true },
- { "intranet.dvag", true },
- { "intranetcrowd.com", true },
- { "intraobes.com", true },
- { "intrasoft.com.au", true },
- { "intraxia.com", true },
- { "intrepy.com", true },
- { "intrigue3d.com", true },
- { "intrixgroup.com", true },
- { "intrixlifestyle.com", true },
- { "introes.com", true },
- { "intropickup.ru", true },
- { "introspectivemarketresearch.com", true },
- { "intvonline.com", true },
- { "intxt.net", true },
- { "inu.codes", true },
- { "inumcoeli.com.br", true },
- { "inup.jp", true },
- { "inusasha.de", true },
- { "invadelabs.com", true },
- { "invalida.ru", true },
- { "invasion.com", true },
- { "invasivespeciesinfo.gov", true },
- { "invasmani.com", true },
- { "inventaire.ch", false },
- { "inventionsteps.com.au", true },
- { "inventix.nl", true },
- { "inventoryimages.co.uk", true },
- { "inventoryimages.com", true },
- { "inventtatte.com", true },
- { "inventtheworld.com.au", true },
- { "inventum.cloud", true },
- { "inverselink-user-content.com", true },
- { "inversionesgalindo.com", true },
- { "investactiv.tk", true },
- { "investarholding.nl", true },
- { "investforum.net", true },
- { "investigatore.it", true },
- { "investigatore.roma.it", true },
- { "investigatore.torino.it", true },
- { "investigazione.milano.it", true },
- { "investigazionimoretti.it", true },
- { "investinturkey.com.tr", true },
- { "investinweed.com", true },
- { "investor-academy.jp", true },
- { "investor.gov", true },
- { "investoren-beteiligung.de", true },
- { "investorforms.com", true },
- { "investpay.ru", true },
- { "investuji.net", true },
- { "invetep.sk", true },
- { "invidio.us", true },
- { "invinoaustria.com", true },
- { "invinoaustria.cz", true },
- { "invioinc.com", true },
- { "inviosolutions.com", true },
- { "invisible-college.com", true },
- { "invisiverse.com", true },
- { "invitacionesytarjetas.gratis", true },
- { "invitescene.com", true },
- { "invitethemhome.com", true },
- { "invkao.com", true },
- { "invoiced.com", true },
- { "involic.com", true },
- { "invuite.com", true },
- { "invuite.com.au", true },
- { "inwao.com", true },
- { "inwebo.com", true },
- { "inwestcorp.se", true },
- { "inyourcornerinsurance.com", true },
- { "inyourowntime.info", true },
- { "inyourowntime.zone", true },
- { "inyr.hu", true },
- { "inzdr.com", true },
- { "inzelabs.com", true },
- { "inzernettechnologies.com", true },
- { "ioactive.com", true },
- { "ioasync.com", true },
- { "iobint.com", true },
- { "iocheck.com", true },
- { "iochen.com", true },
- { "iocurrents.com", true },
- { "iofort.com", true },
- { "ioliver.co.uk", true },
- { "iomedia.ch", true },
- { "iompost.com", true },
- { "iomstamps.com", true },
- { "iondrey.cf", true },
- { "iondrey.fr", true },
- { "iondrey.ga", true },
- { "iondrey.gq", true },
- { "iondrey.ml", true },
- { "iondrey.tk", true },
- { "ionlabs.kr", true },
- { "ionplesalexandru.com", true },
- { "ionspin.com", true },
- { "ionx.co.uk", true },
- { "ioover.net", true },
- { "iop.intuit.com", false },
- { "ios11018.com", false },
- { "iosartstudios.gr", true },
- { "iosecurity.co.za", true },
- { "ioslo.net", true },
- { "iosnoops.com", true },
- { "iossifovlab.com", true },
- { "iostream.by", true },
- { "iotac.xyz", true },
- { "iotekha.tv", true },
- { "iotorq.com", true },
- { "iotsys.in", true },
- { "iowaent.com", true },
- { "iowaschoolofbeauty.com", true },
- { "iowen.cn", true },
- { "ip-address.me", true },
- { "ip-hahn.de", true },
- { "ip-life.net", true },
- { "ip-tanz.com", true },
- { "ip.sb", true },
- { "ip3office.com", false },
- { "ip40.com", true },
- { "ip6.li", true },
- { "ipadkaitori.jp", true },
- { "ipal.im", true },
- { "ipal.name", true },
- { "ipal.pl", true },
- { "ipal.tel", true },
- { "ipanchev.com", true },
- { "iparkki.com", true },
- { "ipcareers.net", true },
- { "ipcyb.com", true },
- { "ipdsols.co.za", true },
- { "ipemcomodoro.com.ar", true },
- { "iperconnessi.it", true },
- { "ipfire.org", true },
- { "ipfirebox.de", true },
- { "ipfs.io", true },
- { "iphonekaitori.tokyo", true },
- { "iphoneunlock.nu", true },
- { "ipinfo.tw", true },
- { "iplantom.com", true },
- { "iplaycraft.ru", true },
- { "iplayradio.net", false },
- { "ipleak.net", true },
- { "ipledgeonline.org", false },
- { "iplist.cc", true },
- { "iplog.info", false },
- { "ipmonitoring.hu", true },
- { "ipo-times.jp", true },
- { "ipoisk.com.ua", true },
- { "ipokabu.net", true },
- { "ipomue.com", false },
- { "ipop.gr", true },
- { "iposm.net", true },
- { "ippawards.com", false },
- { "ipplans.com", true },
- { "iprcenter.gov", true },
- { "ipresent.com", true },
- { "iprim.ru", true },
- { "ipripojeni.cz", true },
- { "iproducemusic.com", true },
- { "ips-consult.nl", true },
- { "ips-ihre-pflege-sachsen.de", true },
- { "ips-sachsen.de", true },
- { "ipschool.spb.ru", true },
- { "ipsecurelink.com", true },
- { "ipslsig.org", true },
- { "ipso.paris", true },
- { "ipstream.it", true },
- { "ipsum.dk", true },
- { "ipswitch.com.tw", true },
- { "iptvzoom.xyz", true },
- { "ipty.de", true },
- { "ipv4.cf", true },
- { "ipv4.co.il", true },
- { "ipv4.gr", true },
- { "ipv4.rip", true },
- { "ipv6-adresse.dk", true },
- { "ipv6-handbuch.de", true },
- { "ipv6.jetzt", true },
- { "ipv6alizer.se", true },
- { "ipv6vpn.net", true },
- { "ipvbook.com", true },
- { "iqboxy.com", true },
- { "iqsecurity.eu", true },
- { "iqskinclinics.com", true },
- { "iqsmn.org", true },
- { "ir1s.com", false },
- { "irajsingh.tk", true },
- { "iramellor.com", true },
- { "irandex.ga", true },
- { "iranfilmcity.tk", true },
- { "iranian.lgbt", true },
- { "iranianholiday.com", true },
- { "iranjeunesse.com", true },
- { "iranonline.tk", true },
- { "iranturkey.info", true },
- { "iranwiki.ovh", true },
- { "iraqinews.ga", true },
- { "irasandi.com", true },
- { "irayo.net", true },
- { "ircmett.de", true },
- { "ird.nz", true },
- { "ireaco.com", true },
- { "ireef.tv", true },
- { "ireland.gq", true },
- { "iren.ch", true },
- { "irenkuhn.ch", true },
- { "irequi.re", true },
- { "ireviewi.com", true },
- { "irf2.pl", true },
- { "irfan.id", true },
- { "irgendeine.cloud", true },
- { "irgit.pl", true },
- { "iridiumbrowser.de", true },
- { "irioka.be", true },
- { "iriomote.com", true },
- { "iris-design.info", true },
- { "iris-insa.com", true },
- { "irish.dating", true },
- { "irish.radio", true },
- { "irishradioplayer.radio", true },
- { "irishsessions.ch", true },
- { "irisjieun.com", true },
- { "irismq.fr", true },
- { "irkfap.com", true },
- { "irkutsk38.tk", true },
- { "irland-firma.com", true },
- { "irlfp.com", true },
- { "irmag.ru", true },
- { "irmgard-woelfle.de", true },
- { "irmgardkoch.com", true },
- { "irodorinet.com", true },
- { "iroise.ch", true },
- { "ironcarnival.com", true },
- { "ironfistdesign.com", true },
- { "ironfittings.com.br", true },
- { "ironhide.de", true },
- { "ironpeak.be", true },
- { "ironraven.ml", true },
- { "irose.am", true },
- { "irrewilse.se", true },
- { "irrigadorbucal.com", true },
- { "irritant.net", true },
- { "iruarts.ch", true },
- { "iruca.co", true },
- { "irvingramo.com", true },
- { "irxoo.com", true },
- { "iryodatumoguide.com", true },
- { "iryogakkai.jp", true },
- { "is-going-to-rickroll.me", true },
- { "is-in-hyper.space", true },
- { "is-rocket.science", true },
- { "is-socket.tk", true },
- { "isa357.com", true },
- { "isa5417.com", true },
- { "isaaccomputerscience.org", true },
- { "isaacdgoodman.com", false },
- { "isaackhor.com", true },
- { "isaacman.tech", true },
- { "isaacmorneau.com", true },
- { "isaacpartnership.co.uk", true },
- { "isaacphysics.org", true },
- { "isaaczais.com", true },
- { "isabelaflores.com", true },
- { "isabellavandijk.nl", true },
- { "isabelle-delpech.com", true },
- { "isabellehogarth.co.uk", true },
- { "isabelmurillo-ordonez.com", true },
- { "isakssons.com", true },
- { "isamay.es", true },
- { "isamiok.com", true },
- { "isaob.com", true },
- { "isara.com", true },
- { "isaropiping.fr", true },
- { "isavings.com", true },
- { "isayoga.de", true },
- { "isbaseballstillon.com", true },
- { "isbc-telecom.ru", true },
- { "isbengrumpy.com", true },
- { "iscert.org", true },
- { "isdn.jp", true },
- { "isecrets.se", true },
- { "iservicio.mx", true },
- { "isg-tech.com", true },
- { "isgp-studies.com", false },
- { "ishamf.com", true },
- { "ishet.al", true },
- { "ishigurodo.com", true },
- { "ishiharaken.com", true },
- { "ishimen.co.jp", true },
- { "ishland.com", true },
- { "ishome.org", true },
- { "ishtarfreya.com", true },
- { "isif-ostewg.org", true },
- { "isil.fi", true },
- { "isimonbrown.co.uk", true },
- { "isincheck.com", true },
- { "isiso.com.tr", true },
- { "isitchristmas.com", true },
- { "isitcoffeetime.com", true },
- { "isitdoneyet.gov", true },
- { "isitef.com", true },
- { "isitup.org", true },
- { "iskaron.de", true },
- { "iskaz.rs", true },
- { "iskogen.nu", true },
- { "islam.si", true },
- { "islamabadcourt.tk", true },
- { "islamicmarkets.com", true },
- { "islamicnews.tk", true },
- { "islamnewss.tk", true },
- { "islamonline.net", true },
- { "islandhosting.com", true },
- { "islandmapstore.com", true },
- { "islavolcan.cl", true },
- { "isletech.net", true },
- { "isliada.org", true },
- { "islief.com", true },
- { "islightdown.today", true },
- { "ismadgeintrouble.com", true },
- { "ismat.com", true },
- { "ismena.bg", true },
- { "ismywebsitepenalized.com", true },
- { "isn.cz", true },
- { "isocom.eu", true },
- { "isognattori.com", true },
- { "isolde.com", true },
- { "isolta.com", true },
- { "isolta.de", true },
- { "isolta.ee", true },
- { "isolta.fi", true },
- { "isolta.lv", true },
- { "isolta.se", true },
- { "isonet.fr", true },
- { "isopres.de", true },
- { "isotope.gov", true },
- { "isotopes.gov", true },
- { "isovideo.com", true },
- { "isowosi.com", true },
- { "ispfontela.es", true },
- { "ispmedipv6.se", true },
- { "ispringcloud.ru", true },
- { "israel-in-color.com", true },
- { "israelbiblicalstudies.com", true },
- { "israelbizreg.com", true },
- { "israelil-leumi.co.il", true },
- { "israelil-leumidev.azurewebsites.net", true },
- { "israelnewswire.tk", true },
- { "israelportalk.ml", true },
- { "isreedyinthe.uk", true },
- { "isreedyinthe.us", true },
- { "isreedyintheuk.com", true },
- { "issa.org.pl", false },
- { "issaias.net", true },
- { "issasfrissa.se", true },
- { "issforum.org", true },
- { "issio.net", true },
- { "issue.watch", true },
- { "issues.email", true },
- { "ist.cm", true },
- { "istanbul.systems", true },
- { "istdas.lol", true },
- { "istdieweltschonuntergegangen.de", true },
- { "isteinbaby.de", true },
- { "isterfaslur.com", true },
- { "istheapplestoredown.com", true },
- { "istheapplestoredown.de", true },
- { "isthedoorlocked.com", true },
- { "istheinternetdown.com", true },
- { "istheinternetonfire.com", true },
- { "isthephone.com", true },
- { "istheservicedown.co.uk", true },
- { "istheservicedown.com", true },
- { "istheservicedowncanada.com", true },
- { "isthnew.com", true },
- { "istitutoricci.it", true },
- { "istitutovivaldi.it", true },
- { "istogether.com", true },
- { "istormsolutions.co.uk", true },
- { "istorrent.is", true },
- { "istrazivac-istine.com", true },
- { "istschonsolangeinrente.de", true },
- { "istsi.org", true },
- { "isusemasa.com", false },
- { "isv.online", true },
- { "isvbscriptdead.com", true },
- { "isvsecwatch.org", true },
- { "isz.no", true },
- { "iszy.cc", true },
- { "it-academy.sk", true },
- { "it-boss.ro", true },
- { "it-faul.de", true },
- { "it-fernau.com", true },
- { "it-inside.ch", true },
- { "it-jobbank.dk", true },
- { "it-journal.de", true },
- { "it-kron.de", true },
- { "it-maker.eu", true },
- { "it-meneer.nl", true },
- { "it-rotter.de", true },
- { "it-schamans.de", true },
- { "it-service24.at", true },
- { "it-service24.ch", true },
- { "it-service24.com", true },
- { "it-shamans.de", true },
- { "it-shamans.eu", true },
- { "it-stack.de", true },
- { "it-support-nu.se", true },
- { "it-support-stockholm.se", true },
- { "it-support.one", true },
- { "it-supportistockholm.se", true },
- { "it-supportnu.se", true },
- { "it-swarm.net", true },
- { "it-tekniker.nu", true },
- { "it-ti.me", true },
- { "it-uws.com", false },
- { "it-zt.at", true },
- { "it.search.yahoo.com", false },
- { "it1b.com", true },
- { "it4sure.nl", true },
- { "itactiq.com", true },
- { "itaiferber.net", true },
- { "italbavaro.com", true },
- { "italia-store.com", true },
- { "italiachegioca.com", true },
- { "italian.dating", true },
- { "italianshoemanufacturers.com", true },
- { "italiansrent.com", true },
- { "italiataxi.ru", true },
- { "italiatopnews.tk", true },
- { "italieflydrive.nl", true },
- { "italiensk-tolk.dk", true },
- { "italik.co.uk", true },
- { "italserrande.it", true },
- { "italserver.com", true },
- { "italyinspires.com", true },
- { "itamservices.nl", true },
- { "itap.gov", true },
- { "itaporanga.se.gov.br", true },
- { "itb-online.co.uk", true },
- { "itbox.cl", true },
- { "itcbuerobedarf.de", true },
- { "itchy.nl", true },
- { "itchybrainscentral.com", true },
- { "itconsulting-wolfinger.de", true },
- { "itcs.services", true },
- { "itdashboard.gov", true },
- { "itdata.ro", false },
- { "itdutchie.com", true },
- { "itecor.net", false },
- { "iteecafe.hu", true },
- { "iteha.de", true },
- { "iteli.eu", true },
- { "itemcreator.tk", true },
- { "itemorder.com", true },
- { "itemstore.ir", true },
- { "iterader.com", true },
- { "iternalnetworks.com", true },
- { "iterror.co", true },
- { "itesign.de", true },
- { "itezu.ml", true },
- { "itfh.eu", true },
- { "itfix.cz", true },
- { "itgoesup.com", true },
- { "itgoesupent.com", true },
- { "itgoesupentertainment.com", true },
- { "ithakama.com", true },
- { "ithakama.cz", true },
- { "ithedgehog.co.uk", true },
- { "ithenrik.com", true },
- { "ithinc.net", true },
- { "ithink.cf", true },
- { "ithink.ml", true },
- { "ithjalpforetag.se", true },
- { "ithot.ro", true },
- { "itikon.com", true },
- { "itilo.de", true },
- { "itis.gov", true },
- { "itis4u.ch", true },
- { "itisyourmoney.co.uk", true },
- { "itkaufmann.at", true },
- { "itkonsultstockholm.se", true },
- { "itludens.com", true },
- { "itm-c.de", true },
- { "itmindscape.com", true },
- { "itmustbee.com", true },
- { "itmx.cc", true },
- { "itn.co.uk", true },
- { "itneeds.tech", true },
- { "itnota.com", true },
- { "itnow.ng", true },
- { "itochan.jp", true },
- { "itooky.com", true },
- { "itpanda.pl", true },
- { "itpro.ua", true },
- { "itraffic.tk", true },
- { "itraveille.fr", true },
- { "itreallyaddsup.com", true },
- { "itring.pl", false },
- { "itruss.com.tw", true },
- { "its-gutachten.de", true },
- { "its.gov", true },
- { "its420somewhere.com", true },
- { "its4living.com", true },
- { "itsabouncything.com", true },
- { "itsallaboutplumbing.com", true },
- { "itsallsotireso.me", true },
- { "itsaw.de", true },
- { "itsayardlife.com", true },
- { "itsblue.de", true },
- { "itsburning.nl", true },
- { "itschromeos.com", true },
- { "itsdcdn.com", true },
- { "itsecblog.de", true },
- { "itsecguy.com", true },
- { "itseeze.com", true },
- { "itsevident.com", true },
- { "itsfitlab.com", true },
- { "itsgoingdown.org", false },
- { "itshka.rv.ua", true },
- { "itsig-faq.de", true },
- { "itsmyparty.ie", true },
- { "itsnotquitethehilton.com", false },
- { "itsok.de", true },
- { "itsok.link", true },
- { "itspartytimeonline.co.uk", true },
- { "itspersonaltraining.nl", true },
- { "itsquiet.org", true },
- { "itsryan.com", true },
- { "itsstefan.eu", true },
- { "itstatic.tech", true },
- { "itsuitsyou.co.za", true },
- { "itsuki.nl", true },
- { "itsundef.in", true },
- { "itsupportnacka.se", true },
- { "itsv.at", true },
- { "itswincer.com", true },
- { "itsynergy.co.uk", true },
- { "ittgame.tk", true },
- { "itvaatlik.ee", true },
- { "itzap.com.au", true },
- { "itzer.de", true },
- { "itzkavin.tk", true },
- { "iubuniversity.tk", true },
- { "iurisnow.com", true },
- { "iuyos.com", true },
- { "ivact.co.jp", true },
- { "ivahbbiz.tk", true },
- { "ivais.mx", true },
- { "ivanaleksandrov.com", true },
- { "ivanbenito.com", true },
- { "ivanboi.com", true },
- { "ivancacic.com", false },
- { "ivanderevianko.com", true },
- { "ivanmeade.com", true },
- { "ivanovolive.ru", true },
- { "ivaoru.org", true },
- { "ivendi.com", true },
- { "ivetazivot.cz", true },
- { "ivfausland.de", true },
- { "ivfmeds.com", true },
- { "ivig.com.br", true },
- { "ivisitorinsurance.com", true },
- { "ivo.co.za", true },
- { "ivocopro.com", true },
- { "ivocotec.de", true },
- { "ivoid.cf", true },
- { "ivopetkov.com", true },
- { "ivor.io", true },
- { "ivor.is", true },
- { "ivorvanhese.com", true },
- { "ivorvanhese.nl", true },
- { "ivoryandgrace.com", true },
- { "ivpn.net", true },
- { "ivre.rocks", true },
- { "ivsign.net", true },
- { "ivusn.cz", true },
- { "ivvl.ru", true },
- { "ivy-league-colleges.com", true },
- { "iwader.co.uk", true },
- { "iwalton.com", true },
- { "iwanttoliveinabunker.com", true },
- { "iwanttrack.com", true },
- { "iwascoding.com", true },
- { "iwascoding.de", true },
- { "iwashealthy.com", true },
- { "iwatchcops.com", true },
- { "iwatchcops.org", true },
- { "iwatt.sk", true },
- { "iwch.tk", true },
- { "iwd.gc.ca", true },
- { "iwebolutions.com", true },
- { "iwell.de", true },
- { "iwizerunek.pl", true },
- { "iww.me", true },
- { "ixanis.net", true },
- { "ixds.org", true },
- { "ixio.cz", true },
- { "ixit.cz", true },
- { "ixix.org", true },
- { "ixquick-proxy.com", true },
- { "ixquick.co.uk", true },
- { "ixquick.com", true },
- { "ixquick.de", true },
- { "ixquick.eu", true },
- { "ixquick.fr", true },
- { "ixquick.info", true },
- { "ixquick.nl", true },
- { "iyassu.com", true },
- { "iyc.web.tr", true },
- { "iycharter.com", true },
- { "iyouewo.com", true },
- { "iz8mbw.net", true },
- { "izamulhakeem.tk", true },
- { "izevg.ru", true },
- { "izmirescort.tk", true },
- { "izntz.com", true },
- { "izodiacsigns.com", true },
- { "izolpoznan.pl", true },
- { "izs8.com", false },
- { "izt.tech", false },
- { "izttech.com", true },
- { "izuba.info", false },
- { "izumi-ryokan.com", true },
- { "izumi.tv", true },
- { "izxxs.com", true },
- { "izxxs.net", true },
- { "izxzw.net", true },
- { "izzys.casa", true },
- { "j-elliott.co.uk", true },
- { "j-k-fischer-verlag.de", true },
- { "j-l.pw", true },
- { "j-navi.com", true },
- { "j-ph.ovh", true },
- { "j-robertson.com", true },
- { "j-softlab.com", true },
- { "j0bs.org", true },
- { "j0e.com", true },
- { "j0hndball.com", true },
- { "j0rj.com", true },
- { "j0s.at", true },
- { "j0s.eu", true },
- { "j15h.nu", true },
- { "j1879.com", true },
- { "j1visahealthinsurance.com", true },
- { "j2h.de", true },
- { "j32663.com", true },
- { "j32664.com", true },
- { "j32665.com", true },
- { "j32771.com", true },
- { "j32772.com", true },
- { "j32773.com", true },
- { "j32774.com", true },
- { "j32775.com", true },
- { "j3349.com", true },
- { "j36533.com", true },
- { "j36594.com", true },
- { "j3e.de", true },
- { "j51365.com", true },
- { "j5563.com", true },
- { "j5573.com", true },
- { "j5lx.de", true },
- { "j5lx.eu", true },
- { "j5lx.io", true },
- { "j605.tk", true },
- { "j81818.com", true },
- { "j8846.com", true },
- { "j9504.com", true },
- { "j9507.com", true },
- { "j9508.com", true },
- { "j9511.com", true },
- { "j9514.com", true },
- { "j9515.com", true },
- { "j9516.com", true },
- { "j95app.com", true },
- { "j95cc.com", true },
- { "j95dd.com", true },
- { "j95ee.com", true },
- { "j95ios.com", true },
- { "j95ss.com", true },
- { "j95xx.com", true },
- { "j95zz.com", true },
- { "j9943.com", true },
- { "ja-gps.com.au", true },
- { "ja-hypnose.de", true },
- { "ja-no-me.ru", true },
- { "ja-publications.agency", true },
- { "ja-zur-gs.de", true },
- { "jaakkohannikainen.fi", true },
- { "jaalits.com", true },
- { "jaamaa.com", true },
- { "jaarvistech.com", true },
- { "jaba.hosting", true },
- { "jababu.cz", true },
- { "jabbari.io", true },
- { "jabber.at", true },
- { "jabber.uk", true },
- { "jabberd.org", true },
- { "jabberfr.org", true },
- { "jabbers.one", true },
- { "jabberzac.org", true },
- { "jaberg-rutschi.ch", true },
- { "jabergrutschi.ch", true },
- { "jabjab.de", true },
- { "jacarandafinance.com.au", true },
- { "jaccblog.com", true },
- { "jacekowski.org", true },
- { "jacik.cz", true },
- { "jack-p2.tech", true },
- { "jack2celebrities.com", true },
- { "jackassofalltrades.org", true },
- { "jackdawphoto.co.uk", true },
- { "jackf.me", true },
- { "jackflet.ch", true },
- { "jackgreenrealty.com", false },
- { "jackhoodtransportation.com", true },
- { "jackingsolutions.com", true },
- { "jackpothappy.com", true },
- { "jackrussel.tk", true },
- { "jacksanalytics.com", true },
- { "jacksball.com", true },
- { "jackson-quon.com", true },
- { "jackson.jp", true },
- { "jacksonhu.com", true },
- { "jacksonvillestation.com", true },
- { "jacksorrell.com", true },
- { "jackspub.net", true },
- { "jackwozny.com", true },
- { "jackyliao.me", true },
- { "jackyliao123.tk", true },
- { "jacobamunch.com", true },
- { "jacobi-server.de", true },
- { "jacobian.org", true },
- { "jacobjangles.com", true },
- { "jacobs-implantate.at", true },
- { "jacobsenarquitetura.com", true },
- { "jacquesdedixmude.eu", true },
- { "jacuzziprozone.com", true },
- { "jadchaar.me", true },
- { "jadehotel.nl", true },
- { "jadesong.net", true },
- { "jadopado.com", true },
- { "jaegerlacke.de", true },
- { "jaepinformatica.com", true },
- { "jaetech.org", true },
- { "jagbouncycastles.co.uk", true },
- { "jagerman.com", true },
- { "jagido.de", true },
- { "jaguarlandrover-asse.be", false },
- { "jaguarlandrover-occasions.be", false },
- { "jahanaisamu.com", true },
- { "jahner.xyz", true },
- { "jahofmann.de", false },
- { "jaiestate.com", true },
- { "jailbreakingisnotacrime.org", true },
- { "jailfood.ga", true },
- { "jaimesotelo.com", true },
- { "jaingynecology.com", true },
- { "jairbehr.com.br", true },
- { "jaisiam.co.th", true },
- { "jaispirit.com", true },
- { "jaitnetworking.com", false },
- { "jaja.wtf", true },
- { "jajsemjachym.cz", true },
- { "jak-na-les.cz", true },
- { "jakarta.dating", true },
- { "jakdelatseo.cz", true },
- { "jake.eu.org", true },
- { "jake.ml", true },
- { "jake.nom.za", true },
- { "jakecurtis.de", true },
- { "jakereynolds.co", true },
- { "jakerullman.com", true },
- { "jakeslab.tech", true },
- { "jaketremper.com", true },
- { "jakewalker.xyz", false },
- { "jakewestrip.com", true },
- { "jakob-server.tk", true },
- { "jakobejitblokaci.cz", true },
- { "jakobkrigovsky.com", true },
- { "jakobssystems.net", true },
- { "jakpremyslet.cz", true },
- { "jaksch.biz", true },
- { "jakse.fr", true },
- { "jakub-boucek.cz", true },
- { "jakubboucek.cz", true },
- { "jakubklimek.com", true },
- { "jakubsindelar.cz", true },
- { "jakubtopic.cz", true },
- { "jakubvrba.cz", true },
- { "jala.co.jp", true },
- { "jaleo.cn", true },
- { "jaluzelemoderne.ro", true },
- { "jamaat.hk", true },
- { "jamalfi.bio", true },
- { "james-bell.co.uk", true },
- { "james-loewen.com", true },
- { "jamesachambers.com", true },
- { "jamesaimonetti.com", true },
- { "jamesbillingham.com", true },
- { "jameschorlton.co.uk", true },
- { "jamesdorf.com", true },
- { "jamesedition.com", true },
- { "jamesgreenfield.com", true },
- { "jameshemmings.co.uk", true },
- { "jameshost.net", true },
- { "jameshunt.us", false },
- { "jamesj.me", false },
- { "jamesjboyer.com", true },
- { "jamesmarsh.net", true },
- { "jamesmilazzo.com", true },
- { "jamesrobertson.net", true },
- { "jamesrobertson.sh", true },
- { "jamesross.name", true },
- { "jamessmith.me.uk", true },
- { "jamestmartin.me", true },
- { "jamestown.de", true },
- { "jamesturnerstickley.com", true },
- { "jamesusandra.com", true },
- { "jameswarp.com", true },
- { "jamhost.org", true },
- { "jamie-read-photography.com", true },
- { "jamie.ie", true },
- { "jamielarter.ca", true },
- { "jamielinux.com", true },
- { "jamiemagee.co.uk", true },
- { "jamiemagee.dk", true },
- { "jamieweb.net", true },
- { "jamieweb.org", true },
- { "jamiewebb.net", true },
- { "jammucake.com", true },
- { "jammysplodgers.co.uk", true },
- { "jamon.ca", true },
- { "jamonsilva.com", true },
- { "jamstatic.fr", true },
- { "jan-and-maaret.de", true },
- { "jan-bucher.ch", true },
- { "jan-gerd.com", true },
- { "jan-hill.com", true },
- { "jan-reiss.de", true },
- { "jan-roenspies.de", true },
- { "jan-von.de", true },
- { "jan.gl", true },
- { "janaundgeorgsagenja.eu", true },
- { "janbrodda.de", true },
- { "jandev.de", true },
- { "jane.com", true },
- { "janehamelgardendesign.co.uk", true },
- { "janelauhomes.com", true },
- { "janelle-jamer.tk", true },
- { "janellequintana.tk", true },
- { "janeymac.com", true },
- { "jangl.com", true },
- { "janhermann.cz", true },
- { "janhuelsmann.com", true },
- { "jani.media", true },
- { "janiat.com", true },
- { "janik.xyz", false },
- { "janikrabe.com", true },
- { "janjoris.nl", true },
- { "jankamp.com", true },
- { "janker.me", true },
- { "jann.is", true },
- { "jannekekaasjager.nl", true },
- { "jannisfink.de", true },
- { "jannyrijneveld.nl", true },
- { "janokacer.sk", true },
- { "janome.club", true },
- { "janostheil.de", true },
- { "janschaumann.de", true },
- { "janterpstra.eu", true },
- { "jantinaboelens.nl", true },
- { "janvari.com", true },
- { "janvaribalint.com", true },
- { "jaot.info", true },
- { "japanese-cuisine.com", true },
- { "japanesemotorsports.net", true },
- { "japangids.nl", true },
- { "japaniac.de", false },
- { "japanphilosophy.com", false },
- { "japansm.com", true },
- { "japantravel.tk", true },
- { "japanwatches.xyz", true },
- { "japonyol.net", true },
- { "jaramilloconstrucciones.pe", true },
- { "jardineriaon.com", true },
- { "jaredfernandez.com", true },
- { "jarmala.lt", true },
- { "jarmandental.com", true },
- { "jarmatys.pl", true },
- { "jarniashop.se", true },
- { "jaroku.com", true },
- { "jarondl.net", true },
- { "jarrah-alsilawi.com", true },
- { "jarrettgraham.com", true },
- { "jarroba.com", true },
- { "jas-team.net", true },
- { "jashvaidya.com", true },
- { "jasmijnwagenaar.nl", true },
- { "jasminlive.cam", true },
- { "jasnowidzkajowi.pl", true },
- { "jasonamorrow.com", true },
- { "jasongerber.ch", false },
- { "jasonmili.online", true },
- { "jasonsplecoscichlids.com", true },
- { "jasonwei.nctu.me", true },
- { "jasper.link", true },
- { "jasperhammink.com", true },
- { "jasperhuttenmedia.com", true },
- { "jasperpatterson.me", true },
- { "jaspersreef.com", true },
- { "jastrow.me", true },
- { "jaszbereny-vechta.eu", true },
- { "javaexpert.tk", true },
- { "javamilk.com", true },
- { "javanguiano.mx", true },
- { "javaweb.site", true },
- { "javelin.cc", true },
- { "javfree.me", true },
- { "javhdmovies.com", true },
- { "javierburgos.net", true },
- { "javierlorente.es", true },
- { "javiermascherano.tk", true },
- { "javik.net", true },
- { "javiscoffee.com", true },
- { "jawo2008.pl", true },
- { "jaxfstk.com", true },
- { "jaxxnet.co.uk", true },
- { "jaxxnet.org", true },
- { "jaybrokers.com", true },
- { "jayden.tech", true },
- { "jayf.de", true },
- { "jayfreestone.com", false },
- { "jayharkess.uk", true },
- { "jaylineko.com", true },
- { "jaymecd.rocks", true },
- { "jayrl.com", true },
- { "jaysaw.me", true },
- { "jaytx.com", true },
- { "jayxon.com", true },
- { "jayxu.com", true },
- { "jazminguaramato.com", true },
- { "jazz-alliance.com", true },
- { "jazz-alliance.org", true },
- { "jazzanet.com", true },
- { "jazzncheese.com", true },
- { "jazzy-feet.com", true },
- { "jazzy.id.au", true },
- { "jazzy.pro", true },
- { "jazzysumi.com", true },
- { "jb138.cc", true },
- { "jbbd.fr", true },
- { "jbc88.cc", true },
- { "jblackweb.com", true },
- { "jbradaric.me", true },
- { "jbridal.com.au", true },
- { "jbs-jardins.ch", false },
- { "jbsinternational.com", true },
- { "jcadg.com", true },
- { "jcai.dk", true },
- { "jcaicedo.com", true },
- { "jcb.com", true },
- { "jcbgolfandcountryclub.com", true },
- { "jccrew.org", true },
- { "jci.cc", true },
- { "jclynne.com", true },
- { "jcontspoord.nl", true },
- { "jcsdevelopment.com", false },
- { "jcsesecuneta.com", true },
- { "jctf.team", true },
- { "jcus.co", true },
- { "jcwodan.nl", true },
- { "jd1.de", true },
- { "jdassets.com", true },
- { "jdc.io", true },
- { "jdd888.cc", true },
- { "jdefreitas.com", true },
- { "jdegbau.com", true },
- { "jdheysupplies.co.uk", true },
- { "jdjohnsonmedia.com", true },
- { "jdjohnsonwaterproofing.com", true },
- { "jdm.elk.pl", true },
- { "jdm.pl", true },
- { "jdmgarage.com.au", true },
- { "jdncr.com", true },
- { "jdoi.pw", true },
- { "jdpleisure.co.uk", true },
- { "jdproofing.com", true },
- { "jdscastlehire.co.uk", true },
- { "jdtic.com", true },
- { "je-vends.fr", false },
- { "je2050.de", true },
- { "jean-luc.org", true },
- { "jeancardeno.com", true },
- { "jeandanielfaessler.ch", true },
- { "jeankygourmet.com", true },
- { "jeanmarieayer.ch", true },
- { "jeannecalment.com", true },
- { "jeannelucienne.fr", true },
- { "jeanneret-combustibles.ch", false },
- { "jeans-shopping.tk", true },
- { "jeansdiscounter.de", true },
- { "jebengotai.com", true },
- { "jec-dekrone.be", true },
- { "jecho.cn", true },
- { "jecjacshop.com", true },
- { "jeda.ch", true },
- { "jedayoshi.com", true },
- { "jedepannetonordi.fr", true },
- { "jedipedia.net", true },
- { "jediweb.com.au", true },
- { "jedmud.com", true },
- { "jedwarddurrett.com", true },
- { "jeec.ist", true },
- { "jeepeg.com", true },
- { "jeeran.com", true },
- { "jeeranservices.com", true },
- { "jeff.forsale", true },
- { "jeffcloninger.net", true },
- { "jeffersonregan.co.uk", true },
- { "jeffersonregan.com", true },
- { "jeffersonregan.net", true },
- { "jeffhaferman.com", true },
- { "jeffmcneill.com", true },
- { "jeffreyhaferman.com", true },
- { "jeffri.me", true },
- { "jeffsanders.com", true },
- { "jefftickle.com", true },
- { "jeffwebb.com", true },
- { "jefrydco.id", true },
- { "jefsweden.eu", true },
- { "jehelpdesk.nl", true },
- { "jej.cz", true },
- { "jej.sk", true },
- { "jekhar.com", true },
- { "jelena-adeli.com", true },
- { "jelenkovic.rs", true },
- { "jell.ie", true },
- { "jelle.pro", true },
- { "jelleluteijn.com", true },
- { "jelleluteijn.eu", true },
- { "jelleluteijn.net", true },
- { "jelleluteijn.nl", true },
- { "jelleluteijn.pro", true },
- { "jelleraaijmakers.nl", true },
- { "jelly.cz", true },
- { "jellybeanbooks.com.au", true },
- { "jellyfloral.com", true },
- { "jellysquid.me", true },
- { "jelmer.uk", true },
- { "jelmoli-shop.ch", true },
- { "jem.gov", true },
- { "jemangeducheval.com", true },
- { "jembatankarir.com", true },
- { "jemefaisdesamis.com", true },
- { "jennethaarfotografie.nl", true },
- { "jennierobinson.com", true },
- { "jenniferengerwingaantrouwen.nl", true },
- { "jennifersauer.nl", true },
- { "jenniwiltz.com", true },
- { "jennysarl.ch", true },
- { "jennythebaker.com", true },
- { "jenolson.net", true },
- { "jenprace.cz", true },
- { "jensdesmeyter.be", true },
- { "jenslody.de", true },
- { "jensrex.dk", true },
- { "jeproteste.info", true },
- { "jeps.fi", true },
- { "jeremiahbenes.com", true },
- { "jeremy.hu", true },
- { "jeremybentham.com", true },
- { "jeremybloomfield.co.uk", true },
- { "jeremyc.ca", false },
- { "jeremycantu.com", true },
- { "jeremycrews.com", true },
- { "jeremynally.com", true },
- { "jeremyness.com", true },
- { "jeremypaul.me", true },
- { "jeremytcd.com", true },
- { "jericamacmillan.com", true },
- { "jering.tech", true },
- { "jerisandoval.tk", true },
- { "jermann.biz", true },
- { "jeroendeneef.com", true },
- { "jerome.to", true },
- { "jerret.de", true },
- { "jerrysretailstores.com", true },
- { "jerrywang.website", true },
- { "jerryweb.org", true },
- { "jerryyu.ca", true },
- { "jerseybikehire.co.uk", true },
- { "jerseyink.net", true },
- { "jerseyjumpingbeans.co.uk", true },
- { "jerseylvi2013.org", true },
- { "jerseyplantsdirect.com", true },
- { "jerusalempersonals.ml", true },
- { "jes.events", true },
- { "jesec.io", true },
- { "jesiensredniowiecza.pl", true },
- { "jesse3.com", true },
- { "jesseerbach.com", true },
- { "jessekaufman.com", true },
- { "jessem.fr", true },
- { "jesseonline.tk", true },
- { "jessesjumpingcastles.co.uk", true },
- { "jessgranger.com", true },
- { "jessicabenedictus.nl", false },
- { "jessicahrehor.com", true },
- { "jesters-court.net", true },
- { "jesuisadmin.fr", true },
- { "jesuisunpapageek.fr", true },
- { "jesusthegoodshepherd.org", true },
- { "jesusvasquez.tk", true },
- { "jesusvazquez.online", true },
- { "jet-stream.fr", true },
- { "jetbbs.com", true },
- { "jetfirenetworks.com", true },
- { "jetflex.de", true },
- { "jetkittens.co.uk", true },
- { "jetses.be", true },
- { "jetsetboyz.net", true },
- { "jetsieswerda.nl", true },
- { "jetswhiteout.com", true },
- { "jettlarue.com", true },
- { "jettshome.org", true },
- { "jetwhiz.com", true },
- { "jeurissen.co", true },
- { "jeuxerotiques.net", true },
- { "jeuxetcodes.fr", true },
- { "jewadvert.ml", true },
- { "jeweet.net", true },
- { "jewishboyscouts.com", true },
- { "jewishquotations.com", true },
- { "jezeravillage.com", true },
- { "jezibaba.info", true },
- { "jf886.cc", true },
- { "jfbst.net", true },
- { "jfgselbitztal.tk", true },
- { "jfr.im", true },
- { "jfreitag.de", false },
- { "jftw.org", true },
- { "jg-skid.me", true },
- { "jgid.de", true },
- { "jgke.fi", true },
- { "jgoguen.ca", true },
- { "jgoldgroup.com", true },
- { "jgonzalezm.com", true },
- { "jgregory.co.uk", true },
- { "jgwb.de", true },
- { "jgwb.eu", true },
- { "jhalderm.com", true },
- { "jhaveri.net", true },
- { "jhe.li", true },
- { "jhill.de", true },
- { "jhollandtranslations.com", true },
- { "jhuang.me", true },
- { "jhw3d.com", true },
- { "jhwestover.com", true },
- { "ji0vwl.net", true },
- { "jiahao.codes", true },
- { "jiangxu.site", true },
- { "jianji.de", true },
- { "jianny.me", true },
- { "jianshu.com", true },
- { "jianwei.wang", true },
- { "jianyuan.art", true },
- { "jiayi.eu.org", true },
- { "jiayi.life", true },
- { "jicaivvip.com", true },
- { "jichi.io", true },
- { "jichi000.win", true },
- { "jif.gc.ca", true },
- { "jigsawplanet.com", true },
- { "jiji.co.ke", true },
- { "jiji.co.tz", true },
- { "jiji.com.gh", true },
- { "jiji.ke", true },
- { "jiji.ng", true },
- { "jiji.ug", true },
- { "jijistatic.com", true },
- { "jimbraaten.com", true },
- { "jimbutlerkiaparts.com", true },
- { "jimdorf.com", true },
- { "jime-hlavou.cz", true },
- { "jimeaton.com", true },
- { "jimfranke.com", true },
- { "jimfranke.nl", true },
- { "jimmiestore.com", true },
- { "jimmycai.com", true },
- { "jimmycarterlibrary.gov", true },
- { "jimmyroura.ch", false },
- { "jimshaver.net", true },
- { "jimslop.nl", true },
- { "jinbijin.nl", true },
- { "jinbo123.com", false },
- { "jinbowiki.org", true },
- { "jinduoduo369.com", true },
- { "jinduoduo666.com", true },
- { "jinduoduo888.com", true },
- { "jing.su", true },
- { "jingbo.fan", true },
- { "jingjo.com.au", true },
- { "jingyunbank.com", true },
- { "jinja.ai", true },
- { "jinkuru.net", true },
- { "jino-jossy.appspot.com", true },
- { "jino.gq", true },
- { "jinshuju.net", true },
- { "jiogo.com", true },
- { "jirav.com", true },
- { "jiretvariedades.com", true },
- { "jiripudil.cz", true },
- { "jisai.net.cn", true },
- { "jisha.site", true },
- { "jitterbit.com", true },
- { "jittruckparts.com", true },
- { "jix.im", true },
- { "jixun.moe", true },
- { "jjhampton.com", true },
- { "jjj.blog", true },
- { "jjrstudio.com", true },
- { "jjspartyhire.co.uk", true },
- { "jjvanoorschot.nl", true },
- { "jk-entertainment.biz", true },
- { "jkchocolate.com", true },
- { "jkdhn.me", true },
- { "jkg.tw", true },
- { "jki.io", true },
- { "jkinteriorspa.com", true },
- { "jkland.com", true },
- { "jkrippen.com", true },
- { "jkvov.com", true },
- { "jldp.org", true },
- { "jlink.nl", true },
- { "jlkhosting.com", true },
- { "jloh.codes", true },
- { "jlponsetto.com", true },
- { "jlr-luxembourg.com", false },
- { "jltcsecuritygroup.com", true },
- { "jltctech.com", true },
- { "jm-bea.net", true },
- { "jmarciniak.it", true },
- { "jmbeautystudio.se", true },
- { "jmbelloteau.com", true },
- { "jmbmexico.com", true },
- { "jmcataffo.com", true },
- { "jmce.eu", true },
- { "jmcleaning.services", true },
- { "jmdiesel.com", true },
- { "jmedved.com", true },
- { "jmentertainment.co.uk", true },
- { "jmfjltd.com", true },
- { "jmk.hu", true },
- { "jmkrecords.fr", true },
- { "jmlogistica.com", true },
- { "jmorahan.net", true },
- { "jmpb.hu", true },
- { "jmsjms.org", true },
- { "jmsjms.top", true },
- { "jmsjms.xyz", true },
- { "jmsolodesigns.com", true },
- { "jmssg.jp", true },
- { "jnjdj.com", true },
- { "jnm-art.com", true },
- { "jnordell.com", true },
- { "jnsz.hu", true },
- { "joa-ebert.com", true },
- { "joanofarcmtcarmel.org", true },
- { "joaoaugusto.net", false },
- { "joaobautista.com", true },
- { "joaojunior.com", true },
- { "joaopenteado.com", true },
- { "joaosampaio.com.br", true },
- { "job-ofertas.info", true },
- { "job.biz.tr", true },
- { "jobalicious.nl", true },
- { "jobatus.com.br", true },
- { "jobatus.es", true },
- { "jobatus.it", true },
- { "jobatus.mx", true },
- { "jobatus.pt", true },
- { "jobbidag.se", true },
- { "jobbkk.com", true },
- { "jobbsafari.no", true },
- { "jobbsafari.se", true },
- { "jobcorpsy2y.com", true },
- { "jobfury.com", true },
- { "jobify.in", true },
- { "jobindex.dk", true },
- { "jobit.gr", true },
- { "joblab.com.ua", false },
- { "joblife.co.za", true },
- { "jobmi.com", true },
- { "jobmiplayground.com", true },
- { "jobs.at", true },
- { "jobs.ch", true },
- { "jobs.su", true },
- { "jobs4sales.ch", true },
- { "jobsarkari.com", false },
- { "jobseekeritalia.it", true },
- { "jobsindemedia.nl", true },
- { "jobsisbrown.com", true },
- { "jobsnet.eu", true },
- { "jobsuchmaschine.ch", true },
- { "jobtarget.com", true },
- { "jobty.net", true },
- { "jobwinner.ch", true },
- { "jobzninja.com", true },
- { "jockbusuttil.co.uk", true },
- { "jockbusuttil.com", true },
- { "jockbusuttil.uk", true },
- { "jodaniels.photography", true },
- { "jodbush.com", true },
- { "jodlajodla.si", true },
- { "joduska.me", true },
- { "jodyboucher.com", false },
- { "jodyshop.com", true },
- { "joe262.com", true },
- { "joebiden.com", true },
- { "joebobbriggs.net", true },
- { "joedavison.me", true },
- { "joedeblasio.com", true },
- { "joedinardo.com", true },
- { "joedoyle.us", true },
- { "joefixit.co", true },
- { "joehenry.co.uk", true },
- { "joejacobs.me", true },
- { "joel.coffee", true },
- { "joeldrapper.com", true },
- { "joelfries.com", true },
- { "joelj.org", true },
- { "joelle.me", true },
- { "joelleandpeter.co.uk", true },
- { "joellimberg.com", true },
- { "joellombardo.com", false },
- { "joelmarkhamphotography.com.au", true },
- { "joelmunch.com", true },
- { "joelnichols.uk", true },
- { "joelotu.com", true },
- { "joelving.dk", true },
- { "joepitt.co.uk", false },
- { "joergschneider.com", true },
- { "joernwendland.de", true },
- { "joerosca.com", true },
- { "joerss.at", true },
- { "joeskup.com", true },
- { "joespaintingpgh.com", true },
- { "joestead.codes", false },
- { "joetsutj.com", true },
- { "joetyson.me", true },
- { "joeyfelix.com", true },
- { "joeygitalian.com", true },
- { "joeyhoer.com", true },
- { "joeysmith.com", true },
- { "joeyvanvenrooij.nl", true },
- { "jogjacar.com", true },
- { "jogwitz.de", true },
- { "johan-koffeman.tk", true },
- { "johanli.com", true },
- { "johannes-bauer.com", true },
- { "johannes-sprink.de", false },
- { "johannes-zinke.de", true },
- { "johannes.io", true },
- { "johannes.wtf", true },
- { "johannesen.tv", true },
- { "johannfritsche.de", true },
- { "johanpeeters.com", true },
- { "johansf.tech", true },
- { "johego.org", true },
- { "johnaltamura.com", true },
- { "johnball.co", true },
- { "johnbeil.com", true },
- { "johnberan.com", true },
- { "johnblackbourn.com", true },
- { "johnbpodcast.com", true },
- { "johncam.tk", true },
- { "johncook.ltd.uk", true },
- { "johndball.co", true },
- { "johndball.com", true },
- { "johndball.info", true },
- { "johndball.net", true },
- { "johndball.org", true },
- { "johndeisher.com", true },
- { "johnfulgenzi.com", true },
- { "johngallias.com", true },
- { "johngmchenrymd.com", true },
- { "johnguant.com", true },
- { "johnhancocknypensions.com", true },
- { "johnhancockpensions.com", true },
- { "johnhgaunt.com", true },
- { "johnkastler.net", true },
- { "johnkraal.com", true },
- { "johnmcintosh.pro", true },
- { "johnmh.me", true },
- { "johnmichel.org", true },
- { "johnnybet.com", true },
- { "johnnybsecure.com", true },
- { "johnpenny.info", true },
- { "johnpenny.uk", true },
- { "johnroach.io", true },
- { "johnroberts.me", true },
- { "johnrockefeller.net", true },
- { "johnrosewicz.com", true },
- { "johnsanchez.io", true },
- { "johnsegovia.com", true },
- { "johnsongenealogy.net", true },
- { "johnvanhese.nl", true },
- { "johnyytb.be", true },
- { "joi-dhl.ch", false },
- { "joinhonor.com", true },
- { "jointotem.com", true },
- { "joinus-outfits.nl", true },
- { "jokedalderup.nl", true },
- { "jokequebec.com", true },
- { "jokesbykids.com", true },
- { "jokewignand.nl", true },
- { "jolee.ro", true },
- { "jolfamarket.com", true },
- { "joliettech.com", true },
- { "jolinebrussel.nl", true },
- { "joljeugdstad.nl", true },
- { "jollausers.de", true },
- { "jolle.io", true },
- { "jollykidswobbleworld.co.uk", true },
- { "jolo.software", true },
- { "jolokia.ch", true },
- { "jomagus.de", true },
- { "jomo.tv", true },
- { "jomsolat.tk", true },
- { "jonahperez.com", true },
- { "jonale.net", true },
- { "jonas-thelemann.de", true },
- { "jonas.me", true },
- { "jonaskarlssonfoto.se", true },
- { "jonaskjodt.com", true },
- { "jonasled.de", true },
- { "jonaswitmer.ch", true },
- { "jonathancarter.org", true },
- { "jonathandupree.com", true },
- { "jonathanha.as", true },
- { "jonathanlara.com", true },
- { "jonathanphoto.fr", true },
- { "jonathanreyes.com", false },
- { "jonathanscott.me", true },
- { "jonblankenship.com", true },
- { "jondarby.com", true },
- { "jondevin.com", true },
- { "jondowdle.com", false },
- { "jonespayne.com", false },
- { "jong030.nl", true },
- { "jongbloed.nl", true },
- { "jongcaxent.tk", true },
- { "jongcs.com", true },
- { "jongpay.com", true },
- { "jongtonghapkido.tk", true },
- { "jonilar.com", true },
- { "jonincharacter.com", true },
- { "jonirrings.com", true },
- { "jonkermedia.nl", false },
- { "jonlabelle.com", true },
- { "jonlu.ca", true },
- { "jonnasbeauty.com", true },
- { "jonny5.ru", true },
- { "jonnybarnes.uk", true },
- { "jonnystoten.com", true },
- { "jonoalderson.com", true },
- { "jonola.com", true },
- { "jonpads.com", true },
- { "jonpavelich.com", true },
- { "jonscaife.com", true },
- { "jonssheds.direct", true },
- { "joodari.fi", true },
- { "jooksms.com", true },
- { "jooksuratas.ee", true },
- { "joomla-leipzig.com", true },
- { "joompress.biz", true },
- { "joona.pw", true },
- { "joostrijneveld.nl", true },
- { "joostvanderlaan.nl", true },
- { "jopl.org", true },
- { "joran.org", true },
- { "jorcus.com", true },
- { "jordandevelopment.com", true },
- { "jordanhamilton.me", true },
- { "jordankmportal.com", true },
- { "jordanprogrammer.tk", true },
- { "jordans.co.uk", true },
- { "jordanscorporatelaw.com", true },
- { "jordanstrustcompany.com", true },
- { "jordibelgraver.email", true },
- { "jordibelgraver.eu", true },
- { "jordibelgraver.xyz", true },
- { "jorgeto.ddns.net", true },
- { "jorisdalderup.nl", true },
- { "jornalalerta.com.br", true },
- { "jorsev.com", true },
- { "josc.com.au", true },
- { "joscares.com", true },
- { "jose-alexand.re", true },
- { "jose-latino.tk", true },
- { "jose-lesson.com", true },
- { "jose-manuel-benito-alvarez.tk", true },
- { "josealonsodds.com", true },
- { "joseenriquegonzalez.tk", true },
- { "joseetesser.nl", true },
- { "josef-lotz.de", true },
- { "josefernandomorilloardila.tk", true },
- { "josefjanosec.com", true },
- { "josefottosson.se", true },
- { "josegdigital.com", true },
- { "joseitoda.org", true },
- { "josemikkola.fi", true },
- { "josepbel.com", true },
- { "josephbarela.com", true },
- { "josephbleroy.com", true },
- { "josephgeorge.com.au", true },
- { "josephquinaucho.com", true },
- { "josephre.es", false },
- { "josephsniderman.com", true },
- { "josephsniderman.org", true },
- { "josephv.website", true },
- { "joshgilson.com", true },
- { "joshgrancell.com", true },
- { "joshharmon.me", true },
- { "joshics.in", false },
- { "joshjanzen.com", true },
- { "joshlovephotography.co.uk", true },
- { "joshrickert.com", true },
- { "joshruppe.com", true },
- { "joshschmelzle.com", true },
- { "joshtriplett.org", true },
- { "joshua-kuepper.de", true },
- { "joshua.bio", true },
- { "joshuadmiller.info", true },
- { "joshuamessick.com", true },
- { "joshuameunier.com", true },
- { "joshuarogers.net", true },
- { "josoansi.de", true },
- { "jouons-aux-echecs.be", true },
- { "jourdain.pro", true },
- { "journalism-schools.com", true },
- { "journalof.tech", true },
- { "journeedesfilles.gc.ca", true },
- { "journeyfitness.com", true },
- { "journeyfriday.rocks", true },
- { "journeying.ca", true },
- { "journeyof1000hops.com", true },
- { "journeytomastery.net", true },
- { "joustsec.ca", true },
- { "joustsec.com", true },
- { "joustsecurity.com", true },
- { "jouwtechnischecoach.nl", true },
- { "jovani.com", false },
- { "jovenescontraelaburrimiento.tk", true },
- { "jovic.hamburg", true },
- { "joyful.house", true },
- { "joyfulexpressions.gallery", true },
- { "joyfulhealthyeats.com", true },
- { "joyinverse.com", true },
- { "joyofcookingandbaking.com", true },
- { "joyofhaskell.com", true },
- { "joyqi.com", true },
- { "joysinventingblog.com", true },
- { "jpbe-network.de", true },
- { "jpbe.de", true },
- { "jpbike.cz", false },
- { "jpdeharenne.be", false },
- { "jpeg.io", true },
- { "jpgangbang.com", true },
- { "jphandjob.com", true },
- { "jplennard.com", true },
- { "jplesbian.com", true },
- { "jpmelos.com", true },
- { "jpmelos.com.br", true },
- { "jpmguitarshop.com.br", true },
- { "jpod.cc", true },
- { "jppcadvertising.com", true },
- { "jpph.org", true },
- { "jpralves.net", true },
- { "jproxx.com", true },
- { "jps-selection.co.uk", true },
- { "jps-selection.com", true },
- { "jps-selection.eu", true },
- { "jpshop.ru", true },
- { "jpsinflatables.co.uk", true },
- { "jpslconsulting.ca", true },
- { "jpvtutoriales.com", true },
- { "jqk918.com", true },
- { "jquery.wtf", true },
- { "jrabasco.me", true },
- { "jrc9.ca", false },
- { "jrcmo.com", true },
- { "jreb.nl", true },
- { "jreiff.de", true },
- { "jross.me", true },
- { "jrt.ovh", true },
- { "jrtapsell.co.uk", true },
- { "jrxpress.com", true },
- { "js-web.eu", true },
- { "js0204.com", true },
- { "js636.com", true },
- { "js637.com", true },
- { "js638.com", true },
- { "js6868.cc", true },
- { "js80651.com", true },
- { "js86.de", true },
- { "js8855.com", true },
- { "jsbentertainment.nl", true },
- { "jschoi.org", true },
- { "jschumacher.info", true },
- { "jsd-cog.org", true },
- { "jsdelivr.com", true },
- { "jselby.net", true },
- { "jsent.co.uk", true },
- { "jshub.com", true },
- { "jsidefox.de", true },
- { "jsk26.ru", true },
- { "jskoelliken.ch", true },
- { "jsme.cz", true },
- { "jsmetallerie.fr", true },
- { "jsnfwlr.com", true },
- { "jsnfwlr.io", true },
- { "jss6868.cc", true },
- { "jsteward.moe", true },
- { "jstore.ch", true },
- { "jsxc.ch", true },
- { "jtcat.com", true },
- { "jtcjewelry.com", true },
- { "jtconsultancy.sg", true },
- { "jtl-pos.com", true },
- { "jtl-software.com", true },
- { "jtl-software.de", false },
- { "jtmar.me", true },
- { "jtp.id", true },
- { "jts3servermod.com", true },
- { "jtslay.com", true },
- { "jttech.se", true },
- { "ju.io", true },
- { "juan23.edu.uy", true },
- { "juanfrancisco.tech", true },
- { "juanjovega.com", true },
- { "juanmazzetti.com", true },
- { "juanxt.ddns.net", true },
- { "jubileum.online", true },
- { "jubobs.com", true },
- { "jucca-nautica.si", true },
- { "jucktehkeinen.de", true },
- { "jucocauca.tk", true },
- { "judge2020.com", true },
- { "judoprodeti.cz", true },
- { "judosaintdenis.fr", true },
- { "judybai.me", true },
- { "judytka.cz", true },
- { "juef.space", true },
- { "juegosycodigos.es", true },
- { "juegosycodigos.mx", true },
- { "juegosyolimpicos.com", true },
- { "juergen-elbert.de", true },
- { "juergenhecht.de", true },
- { "juergenklieber.de", true },
- { "juergenspecht.com", true },
- { "juergenspecht.de", true },
- { "jugendfeuerwehr-vechta.de", true },
- { "jugendhackt.org", true },
- { "jugendsuenden.info", true },
- { "jugh.de", true },
- { "jugwallonie.be", true },
- { "juhakoho.com", true },
- { "juice.codes", true },
- { "juk.life", false },
- { "juku-wing.jp", true },
- { "jule-spil.dk", true },
- { "julenlanda.com", false },
- { "julesroovers.nl", true },
- { "julestern.com", true },
- { "julia-clarete.tk", true },
- { "julia-thonig.de", true },
- { "juliaknightly.com", true },
- { "julian-post.de", true },
- { "julian-uphoff.de", true },
- { "julian-weigle.de", true },
- { "julianbroadway.com", true },
- { "juliangonggrijp.com", true },
- { "julianickel.de", true },
- { "julianmeyer.de", true },
- { "juliansimioni.com", true },
- { "julianskitchen.ch", false },
- { "julianvmodesto.com", true },
- { "julianweigle.de", true },
- { "julianxhokaxhiu.com", true },
- { "juliazeengardendesign.co.uk", true },
- { "julibear.com", true },
- { "julibon.com", true },
- { "julico.nl", true },
- { "julie-and-stevens-wedding.com", true },
- { "juliedecubber.com", true },
- { "juliekoubova.net", true },
- { "juliekproperties.com", true },
- { "juliemaurel.fr", true },
- { "julienc.io", true },
- { "juliendoco.com", true },
- { "julienpaterne.com", false },
- { "julienschmidt.com", true },
- { "julienstalder.ch", true },
- { "julientartarin.com", true },
- { "julius-zoellner.de", true },
- { "juliuseskola.org", true },
- { "jullensgroningen.com", true },
- { "julm.de", true },
- { "jultube.de", true },
- { "jumboquid.co.uk", true },
- { "jump-zone.co.uk", true },
- { "jump.wtf", true },
- { "jump4funinflatables.co.uk", true },
- { "jumpandbounce.co.uk", true },
- { "jumpandjivechildrensparties.co.uk", true },
- { "jumparoundbouncycastles.co.uk", true },
- { "jumparty.co.uk", true },
- { "jumpbuttonnorth.com", true },
- { "jumpeasy.com.au", true },
- { "jumpin-jax.co.uk", true },
- { "jumpinchat.com", true },
- { "jumpingbee.co.uk", true },
- { "jumpingcastlesonline.com.au", true },
- { "jumpingdeliege-vip.be", true },
- { "jumpingjacksbouncycastles.co.uk", true },
- { "jumpinjaes.co.uk", true },
- { "jumpinmonkeys.co.uk", true },
- { "jumpintogreenerpastures.com", true },
- { "jumpnplay.co.uk", true },
- { "jumprun.com", true },
- { "jundongwu.com", true },
- { "junethack.net", true },
- { "jungesforumkonstanz.de", true },
- { "junggesellmuc.de", true },
- { "jungidee.at", true },
- { "jungleadventuretours.net", true },
- { "jungleducks.ca", true },
- { "junglejackscastles.co.uk", true },
- { "junglememories.co.uk", true },
- { "junglevet.fr", true },
- { "junglist.org", true },
- { "jungyonghwa.tk", true },
- { "juni.io", true },
- { "junias-fenske.de", true },
- { "juniorhandball.com", true },
- { "juniperroots.ca", true },
- { "junjun-web.net", true },
- { "junkdrome.org", true },
- { "juno.co.uk", true },
- { "junodownload.com", true },
- { "junta.pl", true },
- { "juozasveza.lt", true },
- { "juppy.tk", true },
- { "jupuglia.com.br", true },
- { "jura-reiseschutz.de", true },
- { "juragan.ga", true },
- { "jurassicbarkharrogate.co.uk", true },
- { "jurassicgolf.nl", true },
- { "jurassicworldfilmen.cf", true },
- { "juridoc.com.br", true },
- { "juristique.fr", true },
- { "juristique.info", true },
- { "juristique.org", true },
- { "juristique.us", true },
- { "jurojin.net", true },
- { "jusos-goettingen.de", true },
- { "just-heberg.fr", true },
- { "just-keep-swimming.tk", true },
- { "just-vet-and-drive.fr", true },
- { "just-webdesign-berlin.de", true },
- { "just2trade.com", true },
- { "just3preety.com", true },
- { "justbelieverecoverypa.com", true },
- { "justbookexcursions.com", true },
- { "justbooktransfers.com", true },
- { "justboom.co", true },
- { "justbouncecastles.co.uk", true },
- { "justcalm.tk", true },
- { "justchunks.net", true },
- { "justeducationonline.com", true },
- { "justgalak.com", true },
- { "justgalak.org", true },
- { "justice.gov", true },
- { "justice4assange.com", true },
- { "justimports.com.br", true },
- { "justin-p.me", true },
- { "justinfreid.com", true },
- { "justinharrison.ca", true },
- { "justinho.com", true },
- { "justinmuturifoundation.org", true },
- { "justinstandring.com", true },
- { "justknigi.gq", true },
- { "justmysocks.xyz", true },
- { "justonce.net", true },
- { "justpaste.it", true },
- { "justquoteme.ga", true },
- { "justsmart.io", true },
- { "justsome.info", true },
- { "justthinktwice.gov", false },
- { "justupdate.me", true },
- { "justyy.com", true },
- { "juszczak.io", true },
- { "juszkiewicz.com.pl", true },
- { "jutella.de", false },
- { "jutlander-netbank.dk", true },
- { "jutlander.dk", true },
- { "juttaheitland.com", true },
- { "juusujanar.eu", false },
- { "juwelierstoopman.nl", true },
- { "juweliervanwillegen.nl", true },
- { "juxin08.com", true },
- { "juyunce.com", true },
- { "jvandenbroeck.com", true },
- { "jvanerp.nl", true },
- { "jvbouncycastlehire.co.uk", true },
- { "jvdham.nl", true },
- { "jvdz.nl", true },
- { "jvega.me", true },
- { "jvlandscapingservices.com", true },
- { "jvlfinance.cz", true },
- { "jvphotoboothhire.co.uk", true },
- { "jvrproductions.com", true },
- { "jvsticker.com", true },
- { "jw1.ca", true },
- { "jw66.cc", true },
- { "jw77.cc", true },
- { "jwatt.org", true },
- { "jwchords.org", true },
- { "jwe.nl", true },
- { "jwhite.network", true },
- { "jwilsson.com", true },
- { "jwimps.com", true },
- { "jwjwjw.com", true },
- { "jwmmarketing.com", true },
- { "jwnotifier.org", true },
- { "jwod.gov", true },
- { "jwr.me", true },
- { "jwschuepfheim.ch", true },
- { "jwtv2.com", true },
- { "jwz.org", true },
- { "jxir.de", true },
- { "jxltom.com", true },
- { "jxm.in", true },
- { "jydemarked.dk", true },
- { "jyk.me", true },
- { "jyoba.co.jp", true },
- { "jyoti-fairworks.org", true },
- { "jyrilaitinen.fi", true },
- { "jyvaskylantykkimies.fi", true },
- { "jzcapital.co", true },
- { "jzgj088.com", true },
- { "jzwebdesign.ie", true },
- { "k-bone.com", true },
- { "k-homes.net", true },
- { "k-jtan.ca", true },
- { "k-plant.com", true },
- { "k-pture.com", false },
- { "k-sails.com", true },
- { "k-scr.me", true },
- { "k-system.de", true },
- { "k-tube.com", true },
- { "k10.ag", true },
- { "k10.app", true },
- { "k10.best", true },
- { "k1024.org", true },
- { "k1958.com", true },
- { "k258059.net", true },
- { "k2mts.org", true },
- { "k36533.com", true },
- { "k36594.com", true },
- { "k3nny.fr", true },
- { "k4law.com", true },
- { "k4r.ru", true },
- { "k51365.com", true },
- { "k66.ag", true },
- { "k663.ag", true },
- { "k663.vip", true },
- { "k665.vip", true },
- { "k666.ag", true },
- { "k666.co", true },
- { "k6666.ag", true },
- { "k66666.ag", true },
- { "k6668.ag", true },
- { "k667.ag", true },
- { "k668.ag", true },
- { "k668.vip", true },
- { "k6688.ag", true },
- { "k669.ag", true },
- { "k7azx.com", true },
- { "k8-1.com", true },
- { "k8-2.com", true },
- { "k8-facai.com", true },
- { "k8.com", true },
- { "k8002.com", true },
- { "k80039.com", true },
- { "k801.co", true },
- { "k801.com", true },
- { "k8013.com", true },
- { "k8023.com", true },
- { "k8029.com", true },
- { "k8031.com", true },
- { "k8032.com", true },
- { "k8037.com", true },
- { "k8039.com", true },
- { "k805.com", true },
- { "k805.net", true },
- { "k8052.com", true },
- { "k8053.com", true },
- { "k8062.com", true },
- { "k8063.com", true },
- { "k8067.com", true },
- { "k807.com", true },
- { "k807.net", true },
- { "k8071.com", true },
- { "k8073.com", true },
- { "k8075.com", true },
- { "k8079.com", true },
- { "k8082.com", true },
- { "k8083.com", true },
- { "k8084.com", true },
- { "k8086.com", true },
- { "k809.net", true },
- { "k8097.com", true },
- { "k8098.com", true },
- { "k80998.com", true },
- { "k8100.com", true },
- { "k8102.com", true },
- { "k8103.com", true },
- { "k8105.com", true },
- { "k8106.com", true },
- { "k8107.com", true },
- { "k8109.com", true },
- { "k811.co", true },
- { "k811.com", true },
- { "k8111.com", true },
- { "k81111.com", true },
- { "k811111.com", true },
- { "k8121.com", true },
- { "k8125.com", true },
- { "k8158.com", true },
- { "k816.net", true },
- { "k81788.com", true },
- { "k818.co", true },
- { "k81818.com", true },
- { "k819.net", true },
- { "k821.net", true },
- { "k82222.com", true },
- { "k82222.net", true },
- { "k8268.net", true },
- { "k8270.com", true },
- { "k82999.com", true },
- { "k831.com", true },
- { "k83333.com", true },
- { "k8336.com", true },
- { "k8368.com", true },
- { "k8368.net", true },
- { "k8370.com", true },
- { "k8403.com", true },
- { "k8421.com", true },
- { "k8427.com", true },
- { "k8432.com", true },
- { "k8437.com", true },
- { "k846.com", true },
- { "k8463.com", true },
- { "k8487.com", true },
- { "k85.app", true },
- { "k851.co", true },
- { "k851.com", true },
- { "k852.co", true },
- { "k852.com", true },
- { "k8524.com", true },
- { "k8533.com", true },
- { "k8578.com", true },
- { "k86.app", true },
- { "k860.co", true },
- { "k86188.com", true },
- { "k865.co", true },
- { "k865.com", true },
- { "k865.net", true },
- { "k86666.com", true },
- { "k8668.com", true },
- { "k8668.net", true },
- { "k86681.com", true },
- { "k867.co", true },
- { "k867.com", true },
- { "k86788.com", true },
- { "k86810.com", true },
- { "k86813.com", true },
- { "k86814.com", true },
- { "k86830.com", true },
- { "k86833.com", true },
- { "k86834.com", true },
- { "k86835.com", true },
- { "k86836.com", true },
- { "k86837.com", true },
- { "k86838.com", true },
- { "k86839.com", true },
- { "k86848.com", true },
- { "k86849.com", true },
- { "k86851.com", true },
- { "k86852.com", true },
- { "k86853.com", true },
- { "k86854.com", true },
- { "k86855.com", true },
- { "k86856.com", true },
- { "k86869.com", true },
- { "k86870.com", true },
- { "k86871.com", true },
- { "k86880.com", true },
- { "k86887.com", true },
- { "k869.co", true },
- { "k86913.com", true },
- { "k86914.com", true },
- { "k86915.com", true },
- { "k86916.com", true },
- { "k86917.com", true },
- { "k86918.com", true },
- { "k86920.com", true },
- { "k86921.com", true },
- { "k86922.com", true },
- { "k86923.com", true },
- { "k86924.com", true },
- { "k86925.com", true },
- { "k86926.com", true },
- { "k86927.com", true },
- { "k86928.com", true },
- { "k86929.com", true },
- { "k86930.com", true },
- { "k86931.com", true },
- { "k86932.com", true },
- { "k8694.com", true },
- { "k86965.com", true },
- { "k86966.com", true },
- { "k86967.com", true },
- { "k86988.com", true },
- { "k86989.com", true },
- { "k86990.com", true },
- { "k86991.com", true },
- { "k87.app", true },
- { "k87017.com", true },
- { "k87018.com", true },
- { "k87019.com", true },
- { "k87020.com", true },
- { "k87021.com", true },
- { "k87022.com", true },
- { "k87023.com", true },
- { "k87024.com", true },
- { "k87025.com", true },
- { "k87026.com", true },
- { "k87027.com", true },
- { "k87028.com", true },
- { "k87067.com", true },
- { "k87071.com", true },
- { "k87072.com", true },
- { "k87073.com", true },
- { "k87074.com", true },
- { "k87075.com", true },
- { "k87076.com", true },
- { "k87077.com", true },
- { "k87078.com", true },
- { "k87079.com", true },
- { "k87080.com", true },
- { "k87081.com", true },
- { "k87082.com", true },
- { "k87083.com", true },
- { "k87084.com", true },
- { "k87100.com", true },
- { "k87119.com", true },
- { "k87120.com", true },
- { "k87121.com", true },
- { "k87126.com", true },
- { "k87127.com", true },
- { "k87128.com", true },
- { "k87129.com", true },
- { "k87130.com", true },
- { "k87131.com", true },
- { "k87132.com", true },
- { "k87133.com", true },
- { "k87134.com", true },
- { "k87135.com", true },
- { "k87136.com", true },
- { "k87137.com", true },
- { "k87138.com", true },
- { "k87183.com", true },
- { "k87288.com", true },
- { "k873.co", true },
- { "k873.com", true },
- { "k8736.com", true },
- { "k875.co", true },
- { "k8771.com", true },
- { "k8780.com", true },
- { "k8804.com", true },
- { "k88101.com", true },
- { "k88102.com", true },
- { "k88103.com", true },
- { "k88105.com", true },
- { "k88106.com", true },
- { "k88107.com", true },
- { "k88109.com", true },
- { "k88110.com", true },
- { "k88112.com", true },
- { "k88113.com", true },
- { "k88115.com", true },
- { "k88116.com", true },
- { "k88117.com", true },
- { "k88120.com", true },
- { "k88121.com", true },
- { "k88122.com", true },
- { "k88125.com", true },
- { "k88126.com", true },
- { "k88127.com", true },
- { "k88128.com", true },
- { "k88129.com", true },
- { "k88130.com", true },
- { "k88131.com", true },
- { "k88132.com", true },
- { "k88133.com", true },
- { "k88135.com", true },
- { "k88137.com", true },
- { "k88139.com", true },
- { "k88151.com", true },
- { "k88152.com", true },
- { "k88153.com", true },
- { "k88201.com", true },
- { "k88205.com", true },
- { "k88207.com", true },
- { "k88208.com", true },
- { "k88210.com", true },
- { "k88213.com", true },
- { "k88214.com", true },
- { "k88233.com", true },
- { "k88236.com", true },
- { "k88237.com", true },
- { "k88238.com", true },
- { "k88239.com", true },
- { "k88250.com", true },
- { "k88251.com", true },
- { "k88252.com", true },
- { "k88253.com", true },
- { "k88255.com", true },
- { "k88256.com", true },
- { "k88257.com", true },
- { "k88258.com", true },
- { "k88259.com", true },
- { "k88260.com", true },
- { "k88261.com", true },
- { "k88262.com", true },
- { "k88263.com", true },
- { "k88265.com", true },
- { "k88267.com", true },
- { "k88268.com", true },
- { "k88269.com", true },
- { "k88270.com", true },
- { "k88271.com", true },
- { "k88272.com", true },
- { "k88273.com", true },
- { "k88275.com", true },
- { "k88276.com", true },
- { "k88277.com", true },
- { "k88285.com", true },
- { "k88398.com", true },
- { "k88399.com", true },
- { "k884.co", true },
- { "k885.co", true },
- { "k886.co", true },
- { "k88601.com", true },
- { "k88602.com", true },
- { "k88603.com", true },
- { "k88605.com", true },
- { "k88606.com", true },
- { "k88607.com", true },
- { "k88608.com", true },
- { "k88609.com", true },
- { "k8861.com", true },
- { "k88635.com", true },
- { "k88636.com", true },
- { "k88637.com", true },
- { "k88638.com", true },
- { "k88639.com", true },
- { "k88650.com", true },
- { "k88651.com", true },
- { "k88652.com", true },
- { "k88653.com", true },
- { "k88655.com", true },
- { "k88656.com", true },
- { "k88657.com", true },
- { "k88658.com", true },
- { "k88659.com", true },
- { "k88660.com", true },
- { "k88661.com", true },
- { "k88662.com", true },
- { "k88663.com", true },
- { "k88665.com", true },
- { "k88667.com", true },
- { "k88668.com", true },
- { "k88670.com", true },
- { "k88671.com", true },
- { "k88672.com", true },
- { "k88673.com", true },
- { "k88675.com", true },
- { "k88676.com", true },
- { "k88677.com", true },
- { "k88679.com", true },
- { "k88680.com", true },
- { "k88681.com", true },
- { "k88682.com", true },
- { "k88683.com", true },
- { "k88684.com", true },
- { "k88685.com", true },
- { "k88686.com", true },
- { "k888.ag", true },
- { "k88801.com", true },
- { "k88870.com", true },
- { "k88881.com", true },
- { "k88890.com", true },
- { "k88891.com", true },
- { "k889.co", true },
- { "k8892.com", true },
- { "k89.app", true },
- { "k89188.com", true },
- { "k8927.com", true },
- { "k89388.com", true },
- { "k8955.com", true },
- { "k8974.com", true },
- { "k8994.com", true },
- { "k8dc01.com", true },
- { "k8dc13.com", true },
- { "k8dc17.com", true },
- { "k8gege.com", true },
- { "k8md01.com", true },
- { "k8md12.com", true },
- { "k8n.de", true },
- { "k8r.eu", true },
- { "k8slot.com", true },
- { "k8v02.com", true },
- { "k8v03.com", true },
- { "k8v04.com", true },
- { "k8v05.com", true },
- { "k8v06.com", true },
- { "k8v07.com", true },
- { "k8v08.com", true },
- { "k8v09.com", true },
- { "k8v12.com", true },
- { "k8v13.com", true },
- { "k8v14.com", true },
- { "k8v15.com", true },
- { "k8v16.com", true },
- { "k8v17.com", true },
- { "k8v19.com", true },
- { "k8v20.com", true },
- { "k8v21.com", true },
- { "k8v23.com", true },
- { "k8v24.com", true },
- { "k8v25.com", true },
- { "k8v26.com", true },
- { "k8v27.com", true },
- { "k8v29.com", true },
- { "k8v30.com", true },
- { "k9swx.com", true },
- { "kaamoscreations.com", true },
- { "kaanhaa.com", true },
- { "kaasbesteld.nl", true },
- { "kaatha-kamrater.se", true },
- { "kaatsen.tk", true },
- { "kab-s.de", true },
- { "kabachok.tk", true },
- { "kabarlinux.id", true },
- { "kabashop.com.br", true },
- { "kabellegger.nl", true },
- { "kabeltv.co.nz", true },
- { "kabeuchi.com", true },
- { "kabinett.cz", true },
- { "kabulpress.org", true },
- { "kabus.org", true },
- { "kacgal.com", true },
- { "kachelfm.nl", true },
- { "kachlikova2.cz", true },
- { "kack.website", true },
- { "kadhambam.in", true },
- { "kado-ya.jp", true },
- { "kadro.com.pl", true },
- { "kadvi.tk", true },
- { "kafeh-jazan.com", true },
- { "kafel-ufa.tk", true },
- { "kaffau.com", true },
- { "kaffeekrone.de", true },
- { "kaffeeringe.de", true },
- { "kafoom.de", true },
- { "kagicomb.org", true },
- { "kagitreklam.com", true },
- { "kagucho.net", true },
- { "kaheim.de", true },
- { "kai-ratzeburg.de", true },
- { "kai-ruecker.tk", true },
- { "kaibo.cz", true },
- { "kaibo.eu", true },
- { "kaidoblogi.eu", true },
- { "kaifa.gs", true },
- { "kaifa199.com", true },
- { "kaigojj.com", true },
- { "kaikei7.com", true },
- { "kaileymslusser.com", true },
- { "kaioken.bar", true },
- { "kais08.com", true },
- { "kais68.com", true },
- { "kais98.com", true },
- { "kaisab.com", true },
- { "kaisev.net", true },
- { "kaishi.ag", true },
- { "kaishi002.com", true },
- { "kaishi555.com", true },
- { "kaishi999.com", true },
- { "kaitol.click", true },
- { "kaitori-goods.shop", true },
- { "kaiusaltd.com", true },
- { "kaivac-emea.com", true },
- { "kaiwu.xyz", true },
- { "kaizencraft.ga", true },
- { "kaizenreporting.com", true },
- { "kaizeronion.com", true },
- { "kajak.land", true },
- { "kajakswaderki.pl", true },
- { "kak-pohudet-legko.ml", true },
- { "kaka.farm", true },
- { "kakacon.nz", true },
- { "kakao-karten.de", true },
- { "kakaravaara.fi", true },
- { "kakie-gobocha.jp", true },
- { "kakie-kolesa.ru", true },
- { "kakolightingmuseum.or.jp", true },
- { "kaktuskola.se", true },
- { "kalamos-psychiatrie.be", true },
- { "kalamos.tk", true },
- { "kalashcards.com", true },
- { "kalashnikov.ml", true },
- { "kalastus.com", true },
- { "kaleidlink.com", true },
- { "kaleidokollection.com.au", true },
- { "kaleidoscope.co.uk", true },
- { "kalender.com", true },
- { "kalevlamps.co.uk", true },
- { "kalex.nl", true },
- { "kalian.cz", true },
- { "kaliboairport.tk", true },
- { "kaliningrad.gq", true },
- { "kalisch.eu", true },
- { "kalkulacka-havarijni.cz", true },
- { "kall.is", true },
- { "kallies-net.de", true },
- { "kalmar.com", true },
- { "kalmykphilly.org", true },
- { "kalombo.ru", true },
- { "kalsa.ga", true },
- { "kaltenbrunner.it", true },
- { "kalterersee.ch", true },
- { "kalugadeti.ru", true },
- { "kalwestelectric.com", true },
- { "kalyanmatka.guru", false },
- { "kam-serwis.pl", true },
- { "kamagraerektion.eu", true },
- { "kamata-shinkyu-seikotsu.jp", true },
- { "kameari-za.space", true },
- { "kamen-master.ru", true },
- { "kamikaichimaru.com", false },
- { "kamikatse.net", true },
- { "kamildrozd.tk", true },
- { "kamilmagdziak.pl", true },
- { "kaminbau-laub.de", true },
- { "kamisato-ent.com", true },
- { "kamixa.se", true },
- { "kamppailusali.fi", true },
- { "kamranmirhazar.com", true },
- { "kamui.co.uk", true },
- { "kamuniang.org", true },
- { "kan3.de", true },
- { "kana-mono.biz", true },
- { "kanaete-uranai.com", true },
- { "kanag.pl", true },
- { "kanal-tv-haensch.de", true },
- { "kandalife.com", true },
- { "kandhamal.org", true },
- { "kandianshang.com", true },
- { "kandofu.com", true },
- { "kandoo.tech", true },
- { "kanecastles.com", true },
- { "kanehusky.com", false },
- { "kanetix.ca", true },
- { "kangaroo-bouncycastle.co.uk", true },
- { "kangarooislandholidayaccommodation.com.au", true },
- { "kangaroojacks.co.uk", true },
- { "kangaroos.org", true },
- { "kangaroovalleykayaks.com.au", true },
- { "kangaroovalleymuseum.com", true },
- { "kangaroovalleyolives.com.au", true },
- { "kangaroovalleyshow.org.au", true },
- { "kangaroovalleywoodcrafts.com.au", true },
- { "kanis.ag", true },
- { "kanis.me", true },
- { "kankimaru.com", true },
- { "kanna.cf", true },
- { "kannchen.de", true },
- { "kanootours.com", true },
- { "kanpian369.com", true },
- { "kansaiyamamoto.jp", true },
- { "kantankye.nl", true },
- { "kantanmt.com", true },
- { "kantoportraits.com", true },
- { "kantorosobisty.pl", true },
- { "kanuvu.de", true },
- { "kanyingba.com", true },
- { "kanzashi.com", true },
- { "kanzlei-gaengler.de", true },
- { "kanzlei-oehler.com", true },
- { "kanzlei-sixt.de", true },
- { "kap-genial.de", true },
- { "kap.pe", true },
- { "kapelya.gq", true },
- { "kapler.family", true },
- { "kappershuis-meppel.nl", true },
- { "kappharn.com", true },
- { "kappie.xyz", true },
- { "kapsalonlinds.nl", true },
- { "kapseli.net", true },
- { "kaptadata.com", true },
- { "kaptamedia.com", true },
- { "kaputtzich.duckdns.org", true },
- { "karabas.com", true },
- { "karabijnhaken.nl", false },
- { "karachi.dating", true },
- { "karalane.com", true },
- { "karamomo.net", true },
- { "karanjthakkar.com", true },
- { "karanlyons.com", true },
- { "karantholdings.ga", true },
- { "karapuzz.tk", true },
- { "karasik.by", true },
- { "karateka.org", true },
- { "karateka.ru", true },
- { "karatekit.co.uk", true },
- { "karawanken-tunnel.de", true },
- { "kareltrans.tk", true },
- { "karewan.ovh", true },
- { "karger.com", true },
- { "kargl.net", true },
- { "karguine.in", true },
- { "karimsaadati.tk", true },
- { "karina.gd", true },
- { "karinwerner.com", true },
- { "karit.nz", true },
- { "kariyam.com", true },
- { "karlbowden.com", true },
- { "karlic.net", true },
- { "karlloch.de", true },
- { "karlsmithmn.org", true },
- { "karlzotter.com", true },
- { "karmaassurance.ca", true },
- { "karmabaker.com", true },
- { "karmaflux.com", true },
- { "karmainsurance.ca", true },
- { "karmaplatform.com", true },
- { "karmaspa.se", true },
- { "karn.nu", true },
- { "karneid.info", true },
- { "karo.pc.pl", true },
- { "karodos.pl", true },
- { "karolak.fr", true },
- { "karopapier.de", true },
- { "karopc.com.pl", true },
- { "karopc.pl", true },
- { "karoverwaltung.de", true },
- { "karrot.world", true },
- { "karrselfstorage.com", true },
- { "karsten-voigt.de", true },
- { "karta-paliwowa.pl", true },
- { "kartacha.com", true },
- { "kartar.net", false },
- { "kartatopia.com", true },
- { "kartbird.com", true },
- { "kartec.com", true },
- { "karten-verlag.de", true },
- { "kartikmohta.com", true },
- { "kartoffel-tobi.de", true },
- { "kartonmodellbau.org", true },
- { "karula.org", true },
- { "karupp-did.net", true },
- { "kas.ie", true },
- { "kasei.im", true },
- { "kashbet.net", true },
- { "kashflowcoupon.co.uk", true },
- { "kashflowpromocode.co.uk", true },
- { "kashinavi.com", true },
- { "kashis.com.au", true },
- { "kasiafricagroup.org", true },
- { "kasinobonus.com", true },
- { "kasko.io", true },
- { "kaskocdn.com", true },
- { "kaskocloud.com", true },
- { "kaskodev.com", true },
- { "kaskojs.com", true },
- { "kaskoqa.com", true },
- { "kasnoffskinclinic.com", true },
- { "kasperstad.dk", true },
- { "kassa.at", true },
- { "kassa.expert", true },
- { "kassa.fr", true },
- { "kassarsoap.com", true },
- { "kastankaoffice.cz", true },
- { "kastelruth.biz", true },
- { "kastgroup.com", true },
- { "kastorsky.ru", true },
- { "kasual.id", true },
- { "kat.marketing", true },
- { "katagena.com", true },
- { "kataiszilveszter.hu", true },
- { "katalog-serverov.ga", true },
- { "katalog-tovarov.tk", true },
- { "katalogbajugamismu.com", true },
- { "katalogkapsli.pl", true },
- { "katapult.es", true },
- { "katarsisuib.no", true },
- { "katcleaning.com.au", false },
- { "katcr.co", true },
- { "katedra.de", true },
- { "katekligys.com", true },
- { "katemihalikova.cz", true },
- { "katericke.com", true },
- { "katex.org", true },
- { "kateysagal.tk", true },
- { "kathardt.de", true },
- { "kathegiraldo.com", true },
- { "katherineswynford.tk", true },
- { "kathleendeisher.com", true },
- { "kathy.lgbt", true },
- { "kati-raumplaner.de", true },
- { "katiechai.xyz", true },
- { "katieriker.com", true },
- { "katieskandy.co.uk", true },
- { "katieskastles.co.uk", true },
- { "kativa.it", true },
- { "katja-und-ronny.de", true },
- { "katjavoneysmondt.de", true },
- { "katka.info", true },
- { "katnunn.co.uk", true },
- { "kato-yane.com", true },
- { "katscastles.co.uk", true },
- { "katsiavarasorthopedics.gr", true },
- { "katsunet.com", true },
- { "kattelans.eu", true },
- { "katyl.info", false },
- { "katyusha.net", true },
- { "kau-boys.com", true },
- { "kau-boys.de", true },
- { "kaufberatung.community", true },
- { "kaufkraftkiel.de", true },
- { "kavatasygarety.tk", true },
- { "kavorka.me", true },
- { "kavovary-kava.cz", true },
- { "kawaii.su", true },
- { "kawaiicon.org", true },
- { "kawiarnia.xyz", true },
- { "kay.la", true },
- { "kayit.co.uk", true },
- { "kayo.digital", true },
- { "kayscs.com", true },
- { "kaysis.gov.tr", false },
- { "kazakov.lt", true },
- { "kazancci.com", true },
- { "kazand.lt", true },
- { "kazandaemon.ru", true },
- { "kazek.com.pl", true },
- { "kazekprzewozy.pl", true },
- { "kazumi.ro", true },
- { "kazvel.com", true },
- { "kazy111.info", true },
- { "kb0101.com", true },
- { "kb0283.com", true },
- { "kb036.com", true },
- { "kb0404.com", true },
- { "kb0505.com", true },
- { "kb059.com", true },
- { "kb0606.com", true },
- { "kb0707.com", true },
- { "kb09.net", true },
- { "kb096.com", true },
- { "kb1313.com", true },
- { "kb1515.com", true },
- { "kb1717.com", true },
- { "kb2626.com", true },
- { "kb283.com", true },
- { "kb2929.com", true },
- { "kb3232.com", true },
- { "kb3434.com", true },
- { "kb3535.com", true },
- { "kb3636.com", true },
- { "kb367.com", true },
- { "kb3939.com", true },
- { "kb415.com", true },
- { "kb4242.com", true },
- { "kb4393.com", true },
- { "kb4545.com", true },
- { "kb458.com", true },
- { "kb4747.com", true },
- { "kb481.com", true },
- { "kb486.com", true },
- { "kb5050.com", true },
- { "kb506.com", true },
- { "kb5252.com", true },
- { "kb545.com", true },
- { "kb5454.com", true },
- { "kb5648.com", true },
- { "kb5656.com", true },
- { "kb5959.com", true },
- { "kb6464.com", true },
- { "kb6565.com", true },
- { "kb6767.com", true },
- { "kb702.com", true },
- { "kb7272.com", true },
- { "kb7474.com", true },
- { "kb750.com", true },
- { "kb756.com", true },
- { "kb787.com", true },
- { "kb8.ag", true },
- { "kb8.best", true },
- { "kb8383.com", true },
- { "kb840.com", true },
- { "kb848.com", true },
- { "kb8484.com", true },
- { "kb8585.com", true },
- { "kb88.ag", true },
- { "kb88.best", true },
- { "kb88.com", true },
- { "kb88.us", true },
- { "kb8800.com", true },
- { "kb8803.com", true },
- { "kb881.cc", true },
- { "kb8815.com", true },
- { "kb8818.com", true },
- { "kb8819.com", true },
- { "kb882.cc", true },
- { "kb8820.com", true },
- { "kb883.cc", true },
- { "kb8830.com", true },
- { "kb8835.com", true },
- { "kb8837.com", true },
- { "kb8838.com", true },
- { "kb8839.com", true },
- { "kb8841.com", true },
- { "kb8843.com", true },
- { "kb8844.com", true },
- { "kb8848.com", true },
- { "kb8849.com", true },
- { "kb8852.com", true },
- { "kb8853.com", true },
- { "kb8854.com", true },
- { "kb8856.com", true },
- { "kb8857.com", true },
- { "kb8859.com", true },
- { "kb8860.com", true },
- { "kb8863.com", true },
- { "kb8864.com", true },
- { "kb8867.com", true },
- { "kb8871.com", true },
- { "kb8872.com", true },
- { "kb8874.com", true },
- { "kb8875.com", true },
- { "kb8878.com", true },
- { "kb888.ag", true },
- { "kb8880.com", true },
- { "kb8882.com", true },
- { "kb8885.com", true },
- { "kb8889.com", true },
- { "kb8890.com", true },
- { "kb8892.com", true },
- { "kb8897.com", true },
- { "kb88dc15.com", true },
- { "kb88dc23.com", true },
- { "kb88dc25.com", true },
- { "kb88dc26.com", true },
- { "kb88dc27.com", true },
- { "kb88dc30.com", true },
- { "kb88md12.com", true },
- { "kb88md26.com", true },
- { "kb88md27.com", true },
- { "kb890.com", true },
- { "kb9292.com", true },
- { "kb9494.com", true },
- { "kb957.com", true },
- { "kb965.com", true },
- { "kb9696.com", true },
- { "kb9797.com", true },
- { "kb991.com", true },
- { "kb9988.com", true },
- { "kba-online.de", true },
- { "kbb-ev.de", true },
- { "kbbouncycastlehire.co.uk", true },
- { "kbc.be", true },
- { "kbcequitas.hu", true },
- { "kbet168.com", true },
- { "kbjorklu.com", true },
- { "kbk4t.com", true },
- { "kbleventhire.co.uk", true },
- { "kbsinflatablekingdom.co.uk", true },
- { "kbterapicenter.se", true },
- { "kc-holzfaeller.de", true },
- { "kc1hbk.com", true },
- { "kc3.moe", true },
- { "kc5mpk.com", true },
- { "kcire.me", true },
- { "kcliner.com", true },
- { "kcmicapital.com", true },
- { "kcolford.com", false },
- { "kcshipping.co.uk", true },
- { "kcsordparticipation.org", true },
- { "kd.net.nz", true },
- { "kdex.de", true },
- { "kdw.cloud", true },
- { "ke.fo", true },
- { "ke7tlf.us", true },
- { "keakon.net", true },
- { "keane.space", true },
- { "keaysmillwork.com", true },
- { "keb.com.au", true },
- { "keb.net.au", true },
- { "kebabbesteld.nl", true },
- { "kebabbruce.com", false },
- { "kebhanamyanmar.com", false },
- { "kecht.at", true },
- { "kedarastudios.com", true },
- { "kedibizworx.com", true },
- { "kedv.es", true },
- { "kee.pm", true },
- { "keeleysam.com", true },
- { "keelove.net", true },
- { "keengamer.com", true },
- { "keepa.com", true },
- { "keepdecor.com", true },
- { "keepersecurity.com", true },
- { "keepingtheplot.co.uk", true },
- { "keepiteasy.eu", true },
- { "keepitsecure24.com", true },
- { "keepleft.gr", true },
- { "keepsight.org.au", true },
- { "keestalkstech.com", true },
- { "keevault.pm", true },
- { "keeweb.info", true },
- { "keezyavaleri.com", true },
- { "keganthorrez.com", true },
- { "kegelschiene.net", true },
- { "kehlenbach.net", true },
- { "keian.tk", true },
- { "keifel.de", true },
- { "kein-design.de", true },
- { "keinefilterblase.de", true },
- { "keisaku.org", true },
- { "keishiando.com", true },
- { "keithlomax.com", true },
- { "keithws.net", true },
- { "keke-shop.ch", true },
- { "kekku.li", true },
- { "keksi.io", true },
- { "keldan.fo", true },
- { "kelderwijnen.nl", true },
- { "kelgtermans-usedcars.be", false },
- { "kelheor.space", true },
- { "kelis.fr", true },
- { "keller-aarau.ch", true },
- { "keller-sports.be", true },
- { "kellerlan.org", true },
- { "kellimacconnell.com", true },
- { "kellygrenard.com", true },
- { "kellyskastles.co.uk", true },
- { "kelsa.io", true },
- { "kelsall39.com", true },
- { "kemerovo.gq", true },
- { "kemerovo.ml", true },
- { "kemerovo.tk", true },
- { "kemerovo42.tk", true },
- { "kemmerer-net.de", true },
- { "kempkens.io", true },
- { "kempo-sissach.ch", true },
- { "kemptown.co.uk", true },
- { "kemptown.com", true },
- { "kemptown.net", true },
- { "ken.fm", true },
- { "kenalsworld.com", true },
- { "kenbonny.net", true },
- { "kendermore.it", true },
- { "kengilmour.com", false },
- { "kenguntokku.jp", true },
- { "kenia-vakantie.nl", true },
- { "keniff.gq", true },
- { "kenkou-kitakyusyu.jp", true },
- { "kennedy.ie", true },
- { "kennedyinsurancesolutions.com", true },
- { "kenners.org", true },
- { "kennethandersen.com", true },
- { "kennethlim.me", true },
- { "kenneths.org", true },
- { "kenny-peck.com", true },
- { "keno.im", true },
- { "kenokallinger.at", true },
- { "kenoschwalb.com", false },
- { "kenrogers.co", false },
- { "kens.pics", true },
- { "kensbouncycastles.co.uk", true },
- { "kenscustomfloors.com", true },
- { "kentdalevets.co.uk", true },
- { "kentec.net", false },
- { "kenterlis.gr", true },
- { "kenvix.com", true },
- { "keoliz.com", true },
- { "keops-spine.fr", true },
- { "kepkonyvtar.hu", true },
- { "keponews.com", true },
- { "keralit.nl", true },
- { "keramed.ga", true },
- { "kerebro.com", true },
- { "kerijacoby.com", true },
- { "kermadec.com", true },
- { "kermadec.fr", true },
- { "kermadec.net", true },
- { "kernel-error.de", true },
- { "kernel-panik.me", true },
- { "kernelpanics.nl", true },
- { "kernelprogrammer.com", true },
- { "kernkompas.nl", true },
- { "kerrnel.com", true },
- { "kerrydavisguitars.tk", true },
- { "kerstkaart.nl", true },
- { "kersvers.agency", true },
- { "kerus.net", true },
- { "kesef.org.il", true },
- { "kessawear.com", true },
- { "kesslerwine.com", true },
- { "ketamine.co.uk", true },
- { "ketaminecareclinic.com", true },
- { "ketoconazole.gq", true },
- { "ketosecology.co.uk", true },
- { "ketotadka.com", true },
- { "kettinggeleider.be", true },
- { "kettlebellkrusher.com", true },
- { "kettlemetalbbq.com", true },
- { "kettner.com", true },
- { "keutel.net", true },
- { "kevchia.com", true },
- { "kevertje.net", true },
- { "kevin-darmor.eu", true },
- { "kevin-ta.com", true },
- { "kevin.tw", true },
- { "kevinapease.com", true },
- { "kevinbusse.de", true },
- { "kevincox.ca", false },
- { "kevincramer.net", true },
- { "kevindavid.org", true },
- { "kevindienst.blog", true },
- { "kevinhill.nl", true },
- { "kevinhq.com", true },
- { "kevinkla.es", true },
- { "kevinlocke.name", true },
- { "kevinmeijer.nl", true },
- { "kevinmoreland.com", true },
- { "kevinmorssink.nl", true },
- { "kevinpatel.com", true },
- { "kevinpirnie.com", false },
- { "kevinquintero.co", true },
- { "kevinrandles.com", false },
- { "kevinvanderperren.tk", true },
- { "kevyn.lu", true },
- { "kexino.com", true },
- { "key-form.fr", true },
- { "keybase.io", true },
- { "keybored.co", true },
- { "keybored.me", true },
- { "keycdn.com", true },
- { "keycenter.com.br", true },
- { "keycontainers.co.za", true },
- { "keyex.com.br", true },
- { "keygen.sh", true },
- { "keyhani.tk", true },
- { "keyholdingservices.co.uk", true },
- { "keyhomechecker.com", true },
- { "keyihao.cn", true },
- { "keyinfo.io", true },
- { "keylaserinstitute.com", true },
- { "keylength.com", true },
- { "keymaster.lookout.com", false },
- { "keymicrosystems.com", true },
- { "keynes.id.au", true },
- { "keyphotojs.cf", true },
- { "keys247.co.uk", true },
- { "keysofart.com", true },
- { "keysso.net", true },
- { "keystoneok.com", false },
- { "keysupport.org", true },
- { "keywalker.co.jp", true },
- { "keywebdesign.nl", true },
- { "keyworth-meadow.tk", true },
- { "kf-slot.com", true },
- { "kf0000.com", true },
- { "kf0000g.com", true },
- { "kf005.com", true },
- { "kf006.com", true },
- { "kf009.com", true },
- { "kf0101.com", true },
- { "kf016.com", true },
- { "kf020.com", true },
- { "kf026.com", true },
- { "kf030.com", true },
- { "kf0606g.com", true },
- { "kf068.com", true },
- { "kf0808.com", true },
- { "kf086.com", true },
- { "kf098.com", true },
- { "kf099.com", true },
- { "kf0q.com", true },
- { "kf108.com", true },
- { "kf117.com", true },
- { "kf1288.com", true },
- { "kf130.com", true },
- { "kf1313.com", true },
- { "kf172.com", true },
- { "kf188.com", true },
- { "kf196.com", true },
- { "kf199.com", true },
- { "kf200.vip", true },
- { "kf2000.vip", true },
- { "kf201988.com", true },
- { "kf2020g.com", true },
- { "kf2121g.com", true },
- { "kf2222g.com", true },
- { "kf260.com", true },
- { "kf268.com", true },
- { "kf282.com", true },
- { "kf2828.com", true },
- { "kf296.com", true },
- { "kf3131g.com", true },
- { "kf319.com", true },
- { "kf327.com", true },
- { "kf3333g.com", true },
- { "kf338.com", true },
- { "kf355.com", true },
- { "kf356.com", true },
- { "kf388.com", true },
- { "kf3u.com", true },
- { "kf4040.com", true },
- { "kf4343g.com", true },
- { "kf5201314.com", true },
- { "kf5252.com", true },
- { "kf5288.com", true },
- { "kf5656.com", true },
- { "kf5858.com", true },
- { "kf5858g.com", true },
- { "kf588.com", true },
- { "kf6161.com", true },
- { "kf6161g.com", true },
- { "kf618.com", true },
- { "kf6262.com", true },
- { "kf633.com", true },
- { "kf6464.com", true },
- { "kf6565.com", true },
- { "kf6622.com", true },
- { "kf6623.com", true },
- { "kf6625.com", true },
- { "kf6626.com", true },
- { "kf6627.com", true },
- { "kf6628.com", true },
- { "kf6631.com", true },
- { "kf6633.com", true },
- { "kf6635.com", true },
- { "kf6636.com", true },
- { "kf6637.com", true },
- { "kf6638.com", true },
- { "kf6639.com", true },
- { "kf6666g.com", true },
- { "kf66888.com", true },
- { "kf680.com", true },
- { "kf6800.com", true },
- { "kf6801.com", true },
- { "kf6802.com", true },
- { "kf6803.com", true },
- { "kf6805.com", true },
- { "kf6806.com", true },
- { "kf6807.com", true },
- { "kf6808.com", true },
- { "kf6809.com", true },
- { "kf6811.com", true },
- { "kf6812.com", true },
- { "kf6813.com", true },
- { "kf6815.com", true },
- { "kf6816.com", true },
- { "kf6817.com", true },
- { "kf6818.com", true },
- { "kf6819.com", true },
- { "kf6820.com", true },
- { "kf6821.com", true },
- { "kf6822.com", true },
- { "kf6823.com", true },
- { "kf6825.com", true },
- { "kf6826.com", true },
- { "kf6827.com", true },
- { "kf6828.com", true },
- { "kf6829.com", true },
- { "kf6830.com", true },
- { "kf6831.com", true },
- { "kf6835.com", true },
- { "kf6868.com", true },
- { "kf688.com", true },
- { "kf707.com", true },
- { "kf7171.com", true },
- { "kf7272.com", true },
- { "kf759.com", true },
- { "kf7676.com", true },
- { "kf7676g.com", true },
- { "kf77.app", true },
- { "kf772.com", true },
- { "kf780.com", true },
- { "kf7979.com", true },
- { "kf7979g.com", true },
- { "kf7joz.com", true },
- { "kf8181.com", true },
- { "kf820.com", true },
- { "kf826.com", true },
- { "kf8282g.com", true },
- { "kf8383.com", true },
- { "kf846.com", true },
- { "kf848.com", true },
- { "kf8484g.com", true },
- { "kf8611.com", true },
- { "kf8612.com", true },
- { "kf8613.com", true },
- { "kf8615.com", true },
- { "kf8616.com", true },
- { "kf8617.com", true },
- { "kf8619.com", true },
- { "kf8621.com", true },
- { "kf8622.com", true },
- { "kf8623.com", true },
- { "kf8625.com", true },
- { "kf8626.com", true },
- { "kf8627.com", true },
- { "kf8628.com", true },
- { "kf8629.com", true },
- { "kf8631.com", true },
- { "kf8632.com", true },
- { "kf8635.com", true },
- { "kf8636.com", true },
- { "kf8637.com", true },
- { "kf8638.com", true },
- { "kf8639.com", true },
- { "kf8651.com", true },
- { "kf8652.com", true },
- { "kf8653.com", true },
- { "kf8655.com", true },
- { "kf8656.com", true },
- { "kf8657.com", true },
- { "kf8658.com", true },
- { "kf8659.com", true },
- { "kf8686.com", true },
- { "kf8787g.com", true },
- { "kf8801.com", true },
- { "kf8803.com", true },
- { "kf8805.com", true },
- { "kf8809.com", true },
- { "kf8810.com", true },
- { "kf8812.com", true },
- { "kf8813.com", true },
- { "kf8817.com", true },
- { "kf8819.com", true },
- { "kf8820.com", true },
- { "kf8821.com", true },
- { "kf8825.com", true },
- { "kf8828.com", true },
- { "kf8830.com", true },
- { "kf8835.com", true },
- { "kf8850.com", true },
- { "kf8851.com", true },
- { "kf8857.com", true },
- { "kf8858.com", true },
- { "kf8865.com", true },
- { "kf88666.com", true },
- { "kf8867.com", true },
- { "kf8868.com", true },
- { "kf8869.com", true },
- { "kf8871.com", true },
- { "kf8872.com", true },
- { "kf8873.com", true },
- { "kf8876.com", true },
- { "kf8878.com", true },
- { "kf8879.com", true },
- { "kf8891.com", true },
- { "kf8892.com", true },
- { "kf8895.com", true },
- { "kf8896.com", true },
- { "kf8897.com", true },
- { "kf908.com", true },
- { "kf909.com", true },
- { "kf9191.com", true },
- { "kf955.com", true },
- { "kf968.com", true },
- { "kf9696.com", true },
- { "kf9797.com", true },
- { "kf981.com", true },
- { "kf997.com", true },
- { "kfa6.com", true },
- { "kfassessment.eu", true },
- { "kff7.com", true },
- { "kffs.ru", true },
- { "kfirba.me", true },
- { "kfkf999.com", true },
- { "kfo.com.br", true },
- { "kforesund.se", true },
- { "kfv-kiel.de", false },
- { "kfz-hantschel.de", true },
- { "kfz-service-wachtmann.de", true },
- { "kgm-irm.be", true },
- { "kgnk.ru", true },
- { "kgt10.ru", true },
- { "kgv-schlauroth.de", true },
- { "khaganat.net", true },
- { "khairul-zamri.com", false },
- { "khakasiya.ml", true },
- { "khakasiya.tk", true },
- { "khakassia.cf", true },
- { "khakassia.ga", true },
- { "khakassia.gq", true },
- { "khakassia.tk", true },
- { "khaledgarbaya.net", false },
- { "khamphafood.com", true },
- { "khanovaskola.cz", true },
- { "khas.co.uk", true },
- { "khasiatmanfaat.com", true },
- { "khedmatazma.com", true },
- { "kheshtar.pl", true },
- { "khetmaal.com", true },
- { "khetzal.info", true },
- { "khg-orchester.de", true },
- { "khipu.com", true },
- { "khmb.ru", false },
- { "khmh.co.uk", true },
- { "khojhealth.com", true },
- { "khokey.com", true },
- { "khorne.me", true },
- { "khoury-dulla.ch", true },
- { "khouryalexandre.com", false },
- { "khramtsov.org", true },
- { "khs1994.com", true },
- { "khslaw.com", true },
- { "khudothiswanpark.vn", true },
- { "khushiandjoel.com", true },
- { "kiadoapartman.hu", true },
- { "kiahalchemy.com", true },
- { "kiahoriane.com", true },
- { "kiano.net", true },
- { "kiarayoga.com", true },
- { "kibibit.net", true },
- { "kibriscicek.net", true },
- { "kick-in.nl", true },
- { "kickasscanadians.ca", true },
- { "kickedmycat.com", true },
- { "kickingpixels.com.au", true },
- { "kickstart.com.pk", false },
- { "kicou.info", false },
- { "kiczela.eu", true },
- { "kidaptive.com", true },
- { "kiddieschristian.academy", true },
- { "kiddyboom.ua", true },
- { "kidneydonation.com", true },
- { "kids-castles.com", true },
- { "kids-world.dk", true },
- { "kidsareatrip.com", true },
- { "kidsclub.photos", true },
- { "kidsdaysout.co.uk", true },
- { "kidsdinefree.com", true },
- { "kidsforsavingearth.org", true },
- { "kidsinwoods-interfacesouth.org", true },
- { "kidsneversleep.com", false },
- { "kidspaper.nl", true },
- { "kidsphysiotherapy.co.uk", true },
- { "kidsplay-plymouth.co.uk", true },
- { "kidsplaybouncycastles.co.uk", true },
- { "kidswallstickers.com.au", true },
- { "kidtoyshop.ru", true },
- { "kidzpartiesllp.co.uk", true },
- { "kidzsmile.co.uk", true },
- { "kiebel.de", true },
- { "kiekin.org", true },
- { "kiekko.pro", true },
- { "kieran.de", true },
- { "kieskundig.nl", true },
- { "kiesuwkerstkaart.nl", true },
- { "kigmbh.com", true },
- { "kii91.com", true },
- { "kiir.net", true },
- { "kiisu.club", true },
- { "kik.ee", true },
- { "kikbb.com", true },
- { "kiki-voice.jp", true },
- { "kiknudes.co", true },
- { "kilbi-reussbuehl.ch", true },
- { "kilianvalkhof.com", true },
- { "kiliframework.org", true },
- { "kill.trade", true },
- { "killaraapartments.com.au", true },
- { "killdeer.com", true },
- { "killerkink.net", true },
- { "killerrobots.com", true },
- { "killymoonbouncycastles.com", true },
- { "kilo-files.tk", true },
- { "kilobyte22.de", true },
- { "kilogram.nl", true },
- { "kilometertje.nl", true },
- { "kimathilegal.com", true },
- { "kimbal.co.uk", true },
- { "kimberleythomson.tk", true },
- { "kimdumaine.com", true },
- { "kimiris.com", true },
- { "kimis.gr", true },
- { "kimisia.net", true },
- { "kimitang.com", true },
- { "kimkuhlmanphoto.com", true },
- { "kimkyzcrs.com", true },
- { "kimmel.com", false },
- { "kimmel.in", true },
- { "kimochi.info", true },
- { "kimono-rental-one.com", true },
- { "kimotodental.com", true },
- { "kimsnagelstudio.nl", true },
- { "kimtran.kim", true },
- { "kimtstore.com", true },
- { "kin-to-kin.ca", true },
- { "kinaesthetics-forschung.net", true },
- { "kinautas.com", true },
- { "kindconcentrates.com", false },
- { "kinderarzt-berlin-zia.de", true },
- { "kinderbasar-luhe.de", true },
- { "kinderchor-bayreuth.de", true },
- { "kinderergotherapie-ik.nl", true },
- { "kinderkleding.news", true },
- { "kinderopvangthuis.nl", true },
- { "kinderpneumologie.ch", true },
- { "kindertagespflege-rasselbande-halle.de", true },
- { "kindertherapie-wesel.de", true },
- { "kinderzahn-bogenhausen.de", true },
- { "kindesfreude.ch", true },
- { "kindlezs.com", true },
- { "kine-duthil.fr", true },
- { "kinepolis-studio.be", true },
- { "kinerd.me", true },
- { "kinesiomed-cryosauna.gr", true },
- { "kinetiq.com", true },
- { "kinfolkcoffee.com", true },
- { "king-of-the-castles.com", true },
- { "kingant.net", true },
- { "kinganywhere.eu", true },
- { "kingdoms.gg", true },
- { "kingfast.eu.org", true },
- { "kingiescastles.co.uk", true },
- { "kingjamesbibleonline.org", true },
- { "kingjamesgospel.com", true },
- { "kinglier.ga", true },
- { "kingofshooting.com", true },
- { "kingofthecastlecoventry.co.uk", true },
- { "kingofthecastlesentertainments.co.uk", true },
- { "kingofthecastlesouthwales.co.uk", true },
- { "kingofthecastlesrhyl.co.uk", true },
- { "kingsblueblue.com", true },
- { "kingsfoot.com", true },
- { "kingsgateseptic.com", true },
- { "kingshome.gr", true },
- { "kingsofkauffman.com", true },
- { "kingstake.network", true },
- { "kingtreeexperts.com", true },
- { "kingwoodtxlocksmith.com", true },
- { "kini24.ru", true },
- { "kinkcafe.net", true },
- { "kinkenonline.com", true },
- { "kinkyhookup.com", true },
- { "kinmunity.com", true },
- { "kinnikinnick.com", true },
- { "kinniyaonlus.com", false },
- { "kino-doma.tk", true },
- { "kinocheck.de", true },
- { "kinodrom.kiev.ua", true },
- { "kinodrom.tk", true },
- { "kinohled.cz", true },
- { "kinomagia.cf", true },
- { "kinos.nl", true },
- { "kinosha.tk", true },
- { "kinoshki.ga", true },
- { "kinothek.at", true },
- { "kinovsem.ml", true },
- { "kinozal-tv.appspot.com", true },
- { "kinozone.tk", true },
- { "kinsights.com", false },
- { "kinsmenhomelottery.com", true },
- { "kintana.ovh", true },
- { "kintone.com", true },
- { "kintore.tv", true },
- { "kiocloud.com", true },
- { "kiomara.com", true },
- { "kionetworks.es", true },
- { "kiot.eu", true },
- { "kiousis.me", true },
- { "kip-ribbetjes-bestellen.be", true },
- { "kipa.at", true },
- { "kipiradio.com", true },
- { "kippenbart.gq", true },
- { "kipsu.com", true },
- { "kipwells32.com", true },
- { "kiragameforum.net", true },
- { "kirainmoe.com", true },
- { "kiraku.co", true },
- { "kirbear.com", true },
- { "kirchen-im-web.de", false },
- { "kirchenchor-olzheim.de", true },
- { "kirchengemeinde-markt-erlbach.de", true },
- { "kirchhoff-getraenke.de", true },
- { "kircp.com", true },
- { "kirei.se", true },
- { "kireilign.com", true },
- { "kirgistan.tk", true },
- { "kirig.ph", true },
- { "kirikira.moe", true },
- { "kirill.ws", true },
- { "kirillaristov.com", true },
- { "kirillpokrovsky.de", true },
- { "kirinas.com", true },
- { "kirinuki.jp", true },
- { "kirkae.com", true },
- { "kirkforcongress.com", true },
- { "kirkforillinois.com", true },
- { "kirklandtriallawyer.com", true },
- { "kirkwood-smith.com", true },
- { "kirkwoodfence.com", true },
- { "kiro-ku.com", true },
- { "kiropraktorvard.se", true },
- { "kirov.ml", true },
- { "kirovcity.tk", true },
- { "kirovgrad.tk", true },
- { "kirrie.pe.kr", true },
- { "kirsch-gestaltung.de", true },
- { "kirschbaum.me", true },
- { "kirscrb.ru", true },
- { "kirstenbos.ca", true },
- { "kirstin-peters.de", true },
- { "kirwandigital.com", true },
- { "kisallatorvos.hu", true },
- { "kisel.org", true },
- { "kisiselveri.com", true },
- { "kiskeedeesailing.com", true },
- { "kisma.de", true },
- { "kisser.name", true },
- { "kissflow.com", true },
- { "kissgyms.com", true },
- { "kisskiss.ch", true },
- { "kissmycreative.com", true },
- { "kissoft.ro", true },
- { "kita-freie-schule.de", true },
- { "kita-sun.com", true },
- { "kitabmimpi.com", true },
- { "kitabnamabayi.com", true },
- { "kitacoffee.com", true },
- { "kitchen-profi.by", true },
- { "kitchen-profi.com.ua", true },
- { "kitchen-profi.kz", true },
- { "kitchenpunx.com", false },
- { "kitchenwarestore.xyz", true },
- { "kiteadventure.nl", true },
- { "kiteschooledam.nl", true },
- { "kiteschoolijmuiden.nl", true },
- { "kiteschoolkatwijk.nl", true },
- { "kiteschoolnoordwijk.nl", true },
- { "kiteschoolschellinkhout.nl", true },
- { "kiteschoolwijkaanzee.nl", true },
- { "kiteschoolzandvoort.nl", true },
- { "kitevalley.tk", true },
- { "kitpartners.com", true },
- { "kitsapsolutions.com", true },
- { "kittmedia.com", true },
- { "kittpress.com", true },
- { "kiumie.com", true },
- { "kivitelezesbiztositas.hu", true },
- { "kiwi.digital", true },
- { "kiwi.wiki", true },
- { "kiwibird.tokyo", true },
- { "kiwiflowershop.com.ua", true },
- { "kiyotatsu.com", true },
- { "kizomba.info", true },
- { "kizzedbykelz.com", true },
- { "kj-prince.com", true },
- { "kj1396.net", true },
- { "kj1397.com", true },
- { "kjaer.io", true },
- { "kjarrval.is", true },
- { "kjchernov.info", true },
- { "kjellner.com", true },
- { "kjelltitulaer.com", true },
- { "kjellvn.net", true },
- { "kjfaudio.com", true },
- { "kjmedia.dk", true },
- { "kjnotes.com", true },
- { "kk-neudorf-duissern.de", false },
- { "kk.in.th", true },
- { "kk.sb", true },
- { "kkcinemas.in", true },
- { "kki.org", true },
- { "kkovacs.eu", true },
- { "kkr-bridal.net", true },
- { "kks-karlstadt.de", true },
- { "kksg.com", true },
- { "kkyy.me", true },
- { "kkzxak47.com", true },
- { "kl-diaetist.dk", true },
- { "klaasmeijerbodems.nl", true },
- { "klaim.us", true },
- { "klanggut.at", true },
- { "klarika.com", true },
- { "klarmobil-empfehlen.de", true },
- { "klassika.tk", true },
- { "klauke-enterprises.com", true },
- { "klausbrinch.dk", false },
- { "klausen.dk", true },
- { "klauswissmann.com", true },
- { "klaver.it", true },
- { "klaw.xyz", true },
- { "klaxon.me", true },
- { "klcreations.co.uk", true },
- { "kle.cz", true },
- { "kleaning.by", true },
- { "klebeband.eu", true },
- { "klebetape.de", true },
- { "kleidermarkt-vintage.de", true },
- { "kleim.fr", true },
- { "kleinblogje.nl", false },
- { "kleine-dingen.nl", true },
- { "kleine-strandburg-heringsdorf.de", true },
- { "kleine-strandburg.com", true },
- { "kleine-strolche-lich.de", true },
- { "kleine-viecherei.de", true },
- { "kleineanfragen.de", true },
- { "kleinestrandburg-heringsdorf.de", true },
- { "kleinestrandburg-usedom.de", true },
- { "kleineviecherei.de", true },
- { "kleinhaneveld.tk", true },
- { "kleinreich.de", true },
- { "kleinsys.com", true },
- { "kleintransporte.net", true },
- { "klemkow.net", true },
- { "klemkow.org", true },
- { "klempin.net", true },
- { "klempin.se", true },
- { "kleor.com", true },
- { "kleppe.co", true },
- { "kleteckova.cz", true },
- { "klev.su", true },
- { "kleyer.eu", true },
- { "kli.is", true },
- { "klickstdu.com", true },
- { "kliemann.me", true },
- { "klimaloven.no", true },
- { "klimapartner.de", true },
- { "klimmzugstange-fitness.de", true },
- { "klingenundmesser.com", true },
- { "klinik-fuer-aesthetische-zahnheilkunde.de", true },
- { "klinikac.co.id", false },
- { "klinkenberg.ws", true },
- { "klishyn.com", true },
- { "klitmoeller.de", true },
- { "klitmoeller.dk", true },
- { "kliu.io", true },
- { "klm-huisjes.nl", true },
- { "klmhouses.com", true },
- { "klocast.com", true },
- { "klocker-ausserlechner.com", true },
- { "klocksnack.se", false },
- { "kloclabs.com", true },
- { "kloia.com", true },
- { "klop.info", true },
- { "klose.family", true },
- { "klosko.net", true },
- { "kloudboy.com", true },
- { "klssn.com", true },
- { "klu.io", true },
- { "klub.tk", true },
- { "kluck.me", true },
- { "klugemedia.de", true },
- { "klumba.org", true },
- { "klustermedia.com", true },
- { "klusweb-merenwijk.nl", true },
- { "klva.cz", true },
- { "kmashworth.co.uk", true },
- { "kmkz.jp", true },
- { "kmucsu.com", true },
- { "kn007.net", true },
- { "kn40la.com", true },
- { "kn4ivj.com", true },
- { "kn4ola.com", true },
- { "knab-networks.com", true },
- { "knapp.noip.me", true },
- { "knarcraft.net", true },
- { "kncg.pw", true },
- { "kndkv.com", true },
- { "kndrd.io", true },
- { "kneblinghausen.de", true },
- { "knechtology.com", true },
- { "knegten-agilis.com", true },
- { "kneli.co.il", true },
- { "knep.me", true },
- { "kneppe.me", true },
- { "knetterbak.nl", true },
- { "kngk-azs.ru", true },
- { "kngk-group.ru", true },
- { "kngk.org", true },
- { "kngkng.com", true },
- { "knightsbridge.net", true },
- { "knightsbridgewine.com", true },
- { "knihovnajablonne.cz", true },
- { "knip.ch", true },
- { "knispel-online.de", true },
- { "knitfarious.com", true },
- { "knmv.nl", true },
- { "knnet.ch", true },
- { "knoji.com", true },
- { "knop.info", false },
- { "knowarth.com", true },
- { "knowledgebuilds.com", true },
- { "knowledgehook.com", true },
- { "knowyourday.ai", true },
- { "knoxvilleimplants.com", true },
- { "knrt.de", true },
- { "knrt.eu", true },
- { "knthost.com", true },
- { "knulla.me", true },
- { "knulle.me", true },
- { "knurps.de", true },
- { "knuterikskare.no", true },
- { "knuthildebrandt.de", false },
- { "knygos.lt", true },
- { "ko-sys.com", true },
- { "koalas.org", true },
- { "koba.jp", true },
- { "kobejet.com", true },
- { "kobofarm.com", true },
- { "kobolya.hu", true },
- { "kobudo49.fr", true },
- { "kochbar.de", true },
- { "kocherev.org", true },
- { "kochereva.com", true },
- { "kochhar.net", true },
- { "kochinke.com", true },
- { "kochinke.us", true },
- { "kocka.cf", true },
- { "kocka.tech", true },
- { "kockanakocko.si", true },
- { "kodak-ism.com", true },
- { "kodamail.com", true },
- { "kodden.com.br", true },
- { "kode-it.de", true },
- { "kode.ch", false },
- { "kodify.net", true },
- { "kodkollen.com", true },
- { "kodkollen.se", true },
- { "kodomo.live", true },
- { "koe.hn", true },
- { "koebbes.de", true },
- { "koecollege.com", true },
- { "koeeusa.org", true },
- { "koef.nl", true },
- { "koehlhoff.de", true },
- { "koehn.com", true },
- { "koeldezomerdoor.nl", true },
- { "koelnmafia.de", true },
- { "koenigsbrunner-tafel.de", true },
- { "koenleemans.nl", true },
- { "koenrh.com", true },
- { "koenrh.net", true },
- { "koenrh.nl", true },
- { "koenrouwhorst.com", true },
- { "koenrouwhorst.nl", true },
- { "koenzk.nl", true },
- { "koerperkult.ch", true },
- { "koertner-muth.com", true },
- { "koertner-muth.de", true },
- { "koethen-markt.de", true },
- { "koetjesenkanker.nl", true },
- { "koffie-enzo.com", true },
- { "koflegend.com", true },
- { "kofler.info", true },
- { "kogak.ninja", true },
- { "kogax.com", true },
- { "kogi.fr", true },
- { "kogro.de", true },
- { "kogudesi.com", true },
- { "kohlchan.net", true },
- { "koho.fi", true },
- { "kohoutsautomotive.com", true },
- { "kohsandra.com", false },
- { "kohu.nz", true },
- { "koi-lexikon.de", true },
- { "koicenter-thuine.de", true },
- { "koifish.org", true },
- { "koji-tsujitani.net", true },
- { "kojip.com", true },
- { "kojy.fr", true },
- { "koka-shop.de", true },
- { "koketteriet.se", true },
- { "koki.cl", true },
- { "kokobaba.com", true },
- { "kokomu.com", true },
- { "kokona.ch", true },
- { "kokosnusswasser.de", true },
- { "kokumoto.com", true },
- { "kolania.de", true },
- { "kolania.net", true },
- { "kolaprestaurant.com", true },
- { "kolas.in", true },
- { "kolbeinsson.se", true },
- { "kolcsey.eu", true },
- { "kolibrisolutions.nl", true },
- { "kolin.org", true },
- { "kolitel.com", true },
- { "kolizaskrap.bg", true },
- { "kolja-engelmann.de", true },
- { "kolkataflowermall.com", true },
- { "kolkinn.no", true },
- { "kollect.ie", true },
- { "kollega.it", true },
- { "kollegamenti.it", true },
- { "kollross.io", true },
- { "kolmann.at", true },
- { "kolmann.eu", true },
- { "kolpingsfamilie-vechta-maria-frieden.de", true },
- { "kolrami.com", true },
- { "koluke.co", true },
- { "koluke.com", true },
- { "komall.net", true },
- { "komelin.com", true },
- { "komenamanda.de", true },
- { "kometia.com", true },
- { "komicloud.com", true },
- { "komidoc.com", true },
- { "komiksbaza.pl", true },
- { "kominfo.go.id", true },
- { "kominfo.net", false },
- { "kominki-sauny.pl", true },
- { "komintek.ru", true },
- { "komischkeszeug.de", true },
- { "kommaer.dk", true },
- { "kommune42.org", true },
- { "kommunermeddnssec.se", true },
- { "kommunermedipv6.se", true },
- { "kommx.de", true },
- { "komoju.com", true },
- { "komok.co.uk", true },
- { "komp247.pl", true },
- { "kompetenzkurs.de", true },
- { "komplet.sk", true },
- { "kon-sil.de", true },
- { "kondi.net", true },
- { "kondomshop.org", true },
- { "kondou-butsudan.com", true },
- { "konfekcjonowanie.com", true },
- { "kongar.org", true },
- { "kongress-hostessen.de", true },
- { "koniecfica.sk", false },
- { "konijntjes.nl", true },
- { "konings.it", false },
- { "koningskwartiertje.nl", true },
- { "konklone.com", true },
- { "konosuke.jp", true },
- { "konplott.shop", true },
- { "konpyuta.nl", true },
- { "konst.se", true },
- { "konstanz.tk", true },
- { "konstructdigital.com", true },
- { "konsul.tk", true },
- { "kontaxis.org", true },
- { "kontorhaus-stralsund.de", true },
- { "konventa.net", true },
- { "konyaescortsiteler.net", true },
- { "konyalian.com", true },
- { "konzertheld.de", true },
- { "koodaklife.com", true },
- { "koodimasin.ee", true },
- { "koodimasin.eu", true },
- { "kooer.org", true },
- { "koof.win", true },
- { "koolauwomenshealthcare.com", true },
- { "koolerbythelake.org", true },
- { "kooli.ee", true },
- { "koolikatsed.ee", true },
- { "koolitee.ee", true },
- { "kooliveeb.ee", true },
- { "koop-bremen.de", true },
- { "kooponline.eu", true },
- { "koot.nl", true },
- { "kooxdiving.com", true },
- { "koozal.de", true },
- { "kopfgeld.tk", true },
- { "kopfkrieg.org", true },
- { "kopfundseele.de", true },
- { "kopidingin.xyz", true },
- { "kopjethee.nl", true },
- { "koplancpa.com", true },
- { "koplax-online.com", true },
- { "kopplin.family", true },
- { "koptev.ru", true },
- { "kopteva.ru", true },
- { "korancode.tk", true },
- { "korbel-loziska.cz", true },
- { "korben.info", true },
- { "kordamed.ee", true },
- { "korea-dpr.org", true },
- { "korea.dating", true },
- { "koreaboo.com", true },
- { "koreaninhd.com", true },
- { "koreanrandom.com", true },
- { "koreanrandom.ru", true },
- { "koretech.nl", true },
- { "korinar.com", true },
- { "kornrunner.net", true },
- { "korob-ok.com.ua", true },
- { "korobkovsky.ru", false },
- { "koroknaimedical.hu", true },
- { "koroleva.ml", true },
- { "korosiprogram.hu", true },
- { "korp.fr", true },
- { "korrelzout.nl", true },
- { "kortgebyr.dk", true },
- { "korund.tk", true },
- { "korup.com", true },
- { "koryfi.com", true },
- { "kos4all.com", true },
- { "koscielniak-nieruchomosci.pl", true },
- { "kosherjava.com", true },
- { "kosho.org", true },
- { "kosinc.org", true },
- { "kosmos.org.tw", true },
- { "kosmosfestival.tk", true },
- { "kost-magazin.de", true },
- { "kostal.com", true },
- { "kostecki.com", true },
- { "kostecki.org", true },
- { "kostecki.tel", true },
- { "kostya.ws", true },
- { "kosuzu.moe", true },
- { "kother.org", true },
- { "kotilinkki.fi", true },
- { "kotitesti.fi", true },
- { "kotke.ru", true },
- { "kotly-marten.com.ua", true },
- { "kotobox.net", true },
- { "kotois.com", true },
- { "kotomei.moe", true },
- { "kotonoha.cafe", true },
- { "kotori.love", true },
- { "kotuwa.tk", true },
- { "kouki-food.com", true },
- { "koumakan.cc", true },
- { "koumuwin.com", true },
- { "koushinjo.org", true },
- { "kouten-jp.com", true },
- { "kov.space", true },
- { "kovachica.tk", true },
- { "koval.io", true },
- { "kovals.sk", true },
- { "kovehitus.ee", true },
- { "kovspace.com", true },
- { "kowalmik.tk", true },
- { "kowalstwo.com.pl", true },
- { "kowarschick.de", true },
- { "koyo.kr", true },
- { "kozawa.tokyo", true },
- { "kozlekedes.info", true },
- { "kozuch.biz", true },
- { "kp0808.cc", true },
- { "kp0809.com", true },
- { "kpfanworld.com", true },
- { "kpforme.org", true },
- { "kpinvest.eu", true },
- { "kplasticsurgery.com", true },
- { "kplnet.net", true },
- { "kpmgclientcollab.co.nz", true },
- { "kpop.re", true },
- { "kpopsource.com", true },
- { "kprem.com", true },
- { "kpumuk.info", true },
- { "kr.cm", true },
- { "kr.search.yahoo.com", false },
- { "kr0n.dk", true },
- { "krachtinverbinding.nl", true },
- { "kradalby.no", true },
- { "kraft.blog", true },
- { "kraft.im", true },
- { "kraftfleisch.de", true },
- { "kraftpc.com", true },
- { "kraftzeiten.de", true },
- { "krag.be", true },
- { "kraga.sk", true },
- { "kraken.io", true },
- { "kraken.site", true },
- { "krakozyabra.gq", true },
- { "kralik.io", true },
- { "kralovskapradelna.cz", true },
- { "kralovstvimap.cz", true },
- { "kram.nz", true },
- { "krambeutel.de", true },
- { "kramer-edelstahl.de", true },
- { "kramsj.uk", true },
- { "krang.org.uk", true },
- { "kranjnakolo.ml", true },
- { "krankenpflege-haushaltshilfe.de", true },
- { "krasnodar-avia.ru", true },
- { "krasnodar-pravoved.ru", true },
- { "krasnodar24.tk", true },
- { "krasovsky.me", true },
- { "kratochvilovi.net", true },
- { "krautomat.com", true },
- { "kravmagaangers.fr", true },
- { "kraynik.com", true },
- { "krayx.com", true },
- { "krazykastles.co.uk", true },
- { "krazykoolkastles.com", true },
- { "krazyphotobooths.co.uk", true },
- { "kreationnext.com", false },
- { "kreativbande.com", true },
- { "kreativelabs.ch", false },
- { "kreativklinik.at", true },
- { "kreativstrecke.de", true },
- { "kreatorbus.com", true },
- { "kredit-abzocke.com", true },
- { "kredita.dk", true },
- { "kreditkacs.cz", true },
- { "kreditkoll.nu", true },
- { "kredytzen.pl", true },
- { "kreen.org", true },
- { "krehl.io", true },
- { "kremalicious.com", true },
- { "kresimir-blazevic.tk", true },
- { "kretschmann.consulting", true },
- { "kreuzpfadfinder.de", true },
- { "kreyolgym.fr", true },
- { "kriechel.de", true },
- { "krikorianconstruction.com", true },
- { "krillz.se", true },
- { "krinetzki.de", true },
- { "kringloopwinkelsteenwijk.nl", true },
- { "krinnovations.ie", true },
- { "kriptokereso.com", true },
- { "kriptosec.com", true },
- { "kriptoworld.hu", true },
- { "kris.click", true },
- { "krise-chance.ch", true },
- { "krisftp.fr", true },
- { "krishnenduayur.org", true },
- { "krishofer.com", true },
- { "kriskras99.nl", true },
- { "krismurray.co.uk", true },
- { "krisstarkey.co.uk", true },
- { "kristall-energie.at", true },
- { "kristiehill.com", true },
- { "kristikala.nl", true },
- { "kristinbailey.com", true },
- { "kristofba.ch", true },
- { "kristofdv.be", true },
- { "kritikahotels.com", true },
- { "kritikawebu.cz", true },
- { "kritikos.io", true },
- { "krizevci.info", true },
- { "krmeni.cz", false },
- { "kroell.net", true },
- { "krokedil.se", true },
- { "kromamoveis.com.br", true },
- { "kromax.it", true },
- { "kromonos.net", true },
- { "kroon.email", true },
- { "kropkait.pl", true },
- { "krossakorven.tk", true },
- { "krovatka.tk", true },
- { "kroy.io", true },
- { "krrn.de", false },
- { "krsaustralia.com.au", true },
- { "krsn.de", true },
- { "krsvrs.nl", true },
- { "krugersdorpplumber24-7.co.za", true },
- { "kruin.net", true },
- { "kruisselbrink.com", true },
- { "kruk.co", true },
- { "krumberconsulting.com", true },
- { "krumpf.de", true },
- { "krupa.net.pl", false },
- { "krupacars.pl", true },
- { "kruselegal.com.au", true },
- { "krutka.cz", true },
- { "kry.no", true },
- { "kry.se", true },
- { "kryglik.com", true },
- { "krypsys.com", true },
- { "krypt.com", true },
- { "kryptera.se", true },
- { "krypto-geld.eu", true },
- { "kryptologie.tk", true },
- { "kryptomech.com", true },
- { "kryptux.xyz", true },
- { "kryx.de", true },
- { "krzyzowki123.pl", true },
- { "ks-watch.de", true },
- { "ks009.com", true },
- { "ks0098.com", true },
- { "ks016.com", true },
- { "ks0168.com", true },
- { "ks017.com", true },
- { "ks0188.com", true },
- { "ks023.com", true },
- { "ks0288.com", true },
- { "ks038.com", true },
- { "ks0388.com", true },
- { "ks05.cc", true },
- { "ks051.com", true },
- { "ks053.com", true },
- { "ks0550.com", true },
- { "ks0558.com", true },
- { "ks0566.com", true },
- { "ks0577.com", true },
- { "ks058.com", true },
- { "ks0588.com", true },
- { "ks059.com", true },
- { "ks0599.com", true },
- { "ks06.cc", true },
- { "ks061.com", true },
- { "ks0618.com", true },
- { "ks062.com", true },
- { "ks063.com", true },
- { "ks065.com", true },
- { "ks0660.com", true },
- { "ks0668.com", true },
- { "ks068.com", true },
- { "ks0688.com", true },
- { "ks0718.com", true },
- { "ks0766.com", true },
- { "ks0768.com", true },
- { "ks0770.com", true },
- { "ks0776.com", true },
- { "ks0778.com", true },
- { "ks078.com", true },
- { "ks0788.com", true },
- { "ks080.com", true },
- { "ks081.com", true },
- { "ks0816.com", true },
- { "ks082.com", true },
- { "ks0855.com", true },
- { "ks0858.com", true },
- { "ks086.com", true },
- { "ks0877.com", true },
- { "ks0878.com", true },
- { "ks0886.com", true },
- { "ks093.com", true },
- { "ks096.com", true },
- { "ks0977.com", true },
- { "ks098.com", true },
- { "ks0990.com", true },
- { "ks0996.com", true },
- { "ks10.ag", true },
- { "ks10.vip", true },
- { "ks105.com", true },
- { "ks15.net", true },
- { "ks1519.com", true },
- { "ks16.cc", true },
- { "ks16.net", true },
- { "ks1608.com", true },
- { "ks161.com", true },
- { "ks162.com", true },
- { "ks18.cc", true },
- { "ks182.com", true },
- { "ks191.com", true },
- { "ks20.vip", true },
- { "ks200.vip", true },
- { "ks2000.vip", true },
- { "ks202.com", true },
- { "ks2020.vip", true },
- { "ks204.com", true },
- { "ks206.com", true },
- { "ks208.com", true },
- { "ks2099.com", true },
- { "ks257.com", true },
- { "ks262.com", true },
- { "ks28.cc", true },
- { "ks28.net", true },
- { "ks281.com", true },
- { "ks2888.com", true },
- { "ks2888.net", true },
- { "ks291.com", true },
- { "ks299.net", true },
- { "ks30.vip", true },
- { "ks308.com", true },
- { "ks32.cc", true },
- { "ks329.com", true },
- { "ks330.com", true },
- { "ks335.com", true },
- { "ks335.net", true },
- { "ks337.net", true },
- { "ks339.net", true },
- { "ks36.net", true },
- { "ks3636.com", true },
- { "ks3737.com", true },
- { "ks380.com", true },
- { "ks381.com", true },
- { "ks388.com", true },
- { "ks3888.com", true },
- { "ks3939.com", true },
- { "ks40.vip", true },
- { "ks410.com", true },
- { "ks50.vip", true },
- { "ks5000.com", true },
- { "ks502.com", true },
- { "ks503.com", true },
- { "ks509.com", true },
- { "ks515.com", true },
- { "ks516.com", true },
- { "ks531.com", true },
- { "ks539.com", true },
- { "ks541.com", true },
- { "ks549.com", true },
- { "ks55.net", true },
- { "ks571.com", true },
- { "ks58.net", true },
- { "ks5808.com", true },
- { "ks5888.com", true },
- { "ks5888.net", true },
- { "ks597.com", true },
- { "ks60.vip", true },
- { "ks600.com", true },
- { "ks6008.com", true },
- { "ks608.com", true },
- { "ks610.com", true },
- { "ks6225.com", true },
- { "ks628.com", true },
- { "ks629.com", true },
- { "ks635.com", true },
- { "ks636.com", true },
- { "ks637.com", true },
- { "ks641.com", true },
- { "ks6522.com", true },
- { "ks6525.com", true },
- { "ks6533.com", true },
- { "ks6535.com", true },
- { "ks657.com", true },
- { "ks66.la", true },
- { "ks6600.com", true },
- { "ks6601.com", true },
- { "ks6602.com", true },
- { "ks6603.com", true },
- { "ks6605.com", true },
- { "ks6607.com", true },
- { "ks6609.com", true },
- { "ks6612.com", true },
- { "ks6615.com", true },
- { "ks6617.com", true },
- { "ks6618.com", true },
- { "ks6619.com", true },
- { "ks6620.com", true },
- { "ks6621.com", true },
- { "ks6623.com", true },
- { "ks6625.com", true },
- { "ks6626.com", true },
- { "ks6627.com", true },
- { "ks6628.com", true },
- { "ks6629.com", true },
- { "ks6630.com", true },
- { "ks6631.com", true },
- { "ks6632.com", true },
- { "ks6635.com", true },
- { "ks6637.com", true },
- { "ks6638.com", true },
- { "ks6650.com", true },
- { "ks6651.com", true },
- { "ks6652.com", true },
- { "ks6653.com", true },
- { "ks6656.com", true },
- { "ks6657.com", true },
- { "ks6658.com", true },
- { "ks6659.com", true },
- { "ks6665.com", true },
- { "ks6670.com", true },
- { "ks6671.com", true },
- { "ks668.com", true },
- { "ks6681.com", true },
- { "ks6685.com", true },
- { "ks6686.com", true },
- { "ks6687.com", true },
- { "ks6733.com", true },
- { "ks6735.com", true },
- { "ks6799.com", true },
- { "ks68.net", true },
- { "ks680.com", true },
- { "ks6800.com", true },
- { "ks6805.com", true },
- { "ks6806.com", true },
- { "ks6807.com", true },
- { "ks6808.com", true },
- { "ks6809.com", true },
- { "ks681.com", true },
- { "ks6810.com", true },
- { "ks6812.com", true },
- { "ks6813.com", true },
- { "ks6815.com", true },
- { "ks6816.com", true },
- { "ks6817.com", true },
- { "ks6819.com", true },
- { "ks6820.com", true },
- { "ks6821.com", true },
- { "ks6822.com", true },
- { "ks6823.com", true },
- { "ks6825.com", true },
- { "ks6826.com", true },
- { "ks6827.com", true },
- { "ks6828.com", true },
- { "ks6829.com", true },
- { "ks6830.com", true },
- { "ks6831.com", true },
- { "ks6832.com", true },
- { "ks6833.com", true },
- { "ks6835.com", true },
- { "ks6836.com", true },
- { "ks6837.com", true },
- { "ks6838.com", true },
- { "ks6839.com", true },
- { "ks6850.com", true },
- { "ks6851.com", true },
- { "ks6852.com", true },
- { "ks6853.com", true },
- { "ks6857.com", true },
- { "ks6860.com", true },
- { "ks6861.com", true },
- { "ks6862.com", true },
- { "ks6863.com", true },
- { "ks6867.com", true },
- { "ks6870.com", true },
- { "ks6871.com", true },
- { "ks6880.com", true },
- { "ks6887.com", true },
- { "ks695.com", true },
- { "ks698.com", true },
- { "ks6998.com", true },
- { "ks70.vip", true },
- { "ks7272.com", true },
- { "ks7373.com", true },
- { "ks8.ag", true },
- { "ks8.net", true },
- { "ks80.vip", true },
- { "ks806.com", true },
- { "ks8086.com", true },
- { "ks81.cc", true },
- { "ks8126.com", true },
- { "ks8127.com", true },
- { "ks86.cc", true },
- { "ks86.net", true },
- { "ks8600.com", true },
- { "ks8787.com", true },
- { "ks88.ag", true },
- { "ks88.best", true },
- { "ks88.com", true },
- { "ks88.org", true },
- { "ks8802.com", true },
- { "ks8805.com", true },
- { "ks8812.com", true },
- { "ks8819.com", true },
- { "ks8825.com", true },
- { "ks883.com", true },
- { "ks8831.com", true },
- { "ks8851.com", true },
- { "ks8852.com", true },
- { "ks8860.com", true },
- { "ks888.ag", true },
- { "ks888.la", true },
- { "ks8881.com", true },
- { "ks8882.com", true },
- { "ks8883.com", true },
- { "ks8892.com", true },
- { "ks8895.com", true },
- { "ks89.cc", true },
- { "ks89.net", true },
- { "ks8915.com", true },
- { "ks90.vip", true },
- { "ks902.com", true },
- { "ks905.com", true },
- { "ks907.com", true },
- { "ks912.com", true },
- { "ks921.com", true },
- { "ks9211.com", true },
- { "ks9393.com", true },
- { "ks958.com", true },
- { "ks98.cc", true },
- { "ks9888.com", true },
- { "ks996.com", true },
- { "ksbet.ag", true },
- { "kscarlett.com", true },
- { "kschv-rdeck.de", true },
- { "kselenia.ee", true },
- { "ksero.center", true },
- { "ksero.wroclaw.pl", true },
- { "ksham.net", true },
- { "kshlm.in", true },
- { "ksmmmo.org.tr", true },
- { "ksoc.com", true },
- { "ksopp.si", true },
- { "kssk.de", true },
- { "kst-service.tk", true },
- { "kstr.us", true },
- { "ksukelife.com", true },
- { "ksvip10.com", true },
- { "kt-events.de", true },
- { "kt-zoe.com", true },
- { "kt3i.com", true },
- { "ktbnetbank.com", true },
- { "kthnxbai.xyz", true },
- { "ktm-troxler.de", true },
- { "ktmclubitalia.it", true },
- { "kts-thueringen.de", true },
- { "ktsee.eu.org", true },
- { "ktuluweb.tk", true },
- { "ktw.lv", true },
- { "ku-7.club", true },
- { "kuadey.com", true },
- { "kuaikan1.com", true },
- { "kuaimen.bid", true },
- { "kuaiyaojing.com", true },
- { "kualiti.net", true },
- { "kualo.co.uk", true },
- { "kualo.com", true },
- { "kualo.in", true },
- { "kuaza.com", true },
- { "kub.hr", true },
- { "kubabrussel.be", true },
- { "kubanitoscali.com", true },
- { "kubkprf.ru", true },
- { "kublis.ch", true },
- { "kuchen-am-stiel.de", true },
- { "kucnibudzet.com", true },
- { "kudinilam.tk", true },
- { "kuditel.net", true },
- { "kudo.co.id", true },
- { "kuechenprofi-group.de", false },
- { "kuechenserver.de", true },
- { "kuechenserver.org", true },
- { "kuehndel.org", true },
- { "kuehnel-bs.de", true },
- { "kuehnel-online.eu", true },
- { "kuemmerlin.eu", true },
- { "kuemmling.eu", true },
- { "kuhn-elektrotechnik.de", true },
- { "kuhne-electronic.de", true },
- { "kuhnelautorepair.com", true },
- { "kuhnerts.eu", true },
- { "kujadin.de", true },
- { "kukal.cz", true },
- { "kukeri-karlovo.tk", true },
- { "kuketz-blog.de", true },
- { "kuketz-security.de", true },
- { "kuketz-suche.de", true },
- { "kukoon.de", false },
- { "kulde.net", true },
- { "kulinaristi.fi", true },
- { "kulivps.com", true },
- { "kulpakko.com", true },
- { "kulthist.tk", true },
- { "kultsar.com", true },
- { "kulturmel.ch", true },
- { "kuma.es", true },
- { "kumachan.biz", true },
- { "kumalog.com", true },
- { "kumasanda.jp", true },
- { "kumpulannamabayi.com", true },
- { "kunaldesai.blog", true },
- { "kunda.ovh", true },
- { "kundenerreichen.com", true },
- { "kundenerreichen.de", true },
- { "kungerkueken.de", true },
- { "kunra.de", true },
- { "kunstdrucke-textildruck.de", true },
- { "kunsthandel-augustus-rex.de", true },
- { "kunstkieken.nl", true },
- { "kunstundunrat.de", true },
- { "kunzesoftware.com.br", true },
- { "kuoruan.com", true },
- { "kupaa.ink", true },
- { "kupferschmids.ch", true },
- { "kupferstichshop.com", true },
- { "kupiclub.com", true },
- { "kupid.com", true },
- { "kupiewszystkieauta.pl", true },
- { "kupimlot.ru", true },
- { "kupinska.pl", true },
- { "kupislivki.tk", true },
- { "kupleno.com", true },
- { "kuponydoher.cz", true },
- { "kupriy-coach.ru", true },
- { "kupschke.net", true },
- { "kupu.maori.nz", true },
- { "kurdishphotography.tk", true },
- { "kuretru.com", true },
- { "kurhotel-am-reischberg.de", true },
- { "kurido-anime.tk", true },
- { "kurierwilenski.lt", true },
- { "kurniadwin.to", true },
- { "kurofuku.me", true },
- { "kuroha.co.uk", true },
- { "kuroinu.jp", true },
- { "kuroisalva.xyz", false },
- { "kurona.ga", true },
- { "kuronekogaro.com", true },
- { "kurschies.de", true },
- { "kurserne.dk", true },
- { "kursk-otoplenie.ru", true },
- { "kurswahl-online.de", true },
- { "kursypolska.pl", true },
- { "kurtschlatzer.com", true },
- { "kuruma-ex.jp", true },
- { "kuruppa.xyz", true },
- { "kusadasiforum.com", true },
- { "kuscheln.com", true },
- { "kuschku.de", true },
- { "kuscu.co", true },
- { "kusdaryanto.web.id", true },
- { "kusochi.eu", true },
- { "kustod.io", true },
- { "kutinsoft.com", true },
- { "kutip.id", true },
- { "kutny.cz", true },
- { "kutsankaplan.com", true },
- { "kuttler.eu", true },
- { "kutus.ee", true },
- { "kuwichitagastro.com", true },
- { "kuwichitaim.com", true },
- { "kuznica.tk", true },
- { "kvadratnimeter.si", true },
- { "kvalita-1a.cz", true },
- { "kvalitetsaktiepodden.se", true },
- { "kvalitnitesneni.cz", true },
- { "kvantel.no", true },
- { "kvcc.com.au", true },
- { "kvest-v-moskve.ga", true },
- { "kvestiks.ru", true },
- { "kvetinymilt.cz", true },
- { "kvetinyumarkety.cz", true },
- { "kvhile.com", true },
- { "kvilt.dk", true },
- { "kvnsport.ru", true },
- { "kvpc.com.au", true },
- { "kwat.chat", true },
- { "kwbresidential.com", true },
- { "kwcolville.com", true },
- { "kweb.ml", true },
- { "kwedo.com", true },
- { "kwench.com", true },
- { "kwickshop.co.nz", true },
- { "kwoll.de", true },
- { "kwyxz.org", true },
- { "kx197.com", true },
- { "kxah35.com", true },
- { "kxnrl.com", true },
- { "kybi.sk", true },
- { "kycisrael.com", true },
- { "kydara.com", true },
- { "kyledrake.net", true },
- { "kylegutschow.com", true },
- { "kylejohnson.io", true },
- { "kylianvermeulen.com", true },
- { "kylie-pomada.tk", true },
- { "kylinj.com", false },
- { "kynaston.org.uk", true },
- { "kynastonwedding.co.uk", true },
- { "kyochon.fr", true },
- { "kyoko.org", true },
- { "kyosaku.org", true },
- { "kyoto-k9.com", false },
- { "kyoto-mic.com", true },
- { "kyoto-tomoshibi.jp", true },
- { "kyotokitsune.com", true },
- { "kyprexxo.com", true },
- { "kyras-castles.co.uk", true },
- { "kyrylych.tk", true },
- { "kys.host", true },
- { "kysil.org", true },
- { "kyunyuki.com", true },
- { "kyusyu.org", true },
- { "kyy.me", false },
- { "kz.search.yahoo.com", false },
- { "kzar.co.uk", true },
- { "kzmhk.cz", true },
- { "kzsdabas.hu", true },
- { "l-atelier-c.com", true },
- { "l-lab.org", true },
- { "l0re.com", true },
- { "l0v0l.com", true },
- { "l10n.site", true },
- { "l17r.eu", true },
- { "l214.com", true },
- { "l2guru.ru", true },
- { "l33te.net", true },
- { "l36533.com", true },
- { "l36594.com", true },
- { "l4n-clan.de", true },
- { "l66.io", true },
- { "l7plumbing.com.au", true },
- { "l7world.com", true },
- { "l81818.com", true },
- { "la-baldosa.fr", false },
- { "la-bolle.fr", true },
- { "la-compagnie-des-elfes.fr", true },
- { "la-fenice-neheim.de", true },
- { "la-ganiere.com", true },
- { "la-kaz-a-velo.fr", true },
- { "la-laitonnerie.com", true },
- { "la-maison.ch", false },
- { "la-maison.eu", true },
- { "la-manufacture-du-nettoyage.com", true },
- { "la-paco.tk", true },
- { "la-petite-entreprise.com", true },
- { "laab.gv.at", true },
- { "laan247.dk", true },
- { "laatikko.io", true },
- { "laatjeniethackmaken.nl", true },
- { "labandadelamente.tk", true },
- { "labande-annonce.fr", true },
- { "labanochjonas.se", true },
- { "labanote.com", true },
- { "labanskoller.se", true },
- { "labanskollermark.se", true },
- { "labastidedesaromes.com", true },
- { "labavn.com", true },
- { "labavn.org", true },
- { "labcenter.com", true },
- { "labcoat.jp", true },
- { "labeled.vn", true },
- { "labibikids.com.br", true },
- { "labiblioafronebrulepas.com", false },
- { "lablnet.tk", true },
- { "labobooks.com", true },
- { "laboiteare.fr", true },
- { "laboratoriodemarketingb3.com", true },
- { "labortogether.com", true },
- { "labouncycastlehire.co.uk", true },
- { "labourreedevergheas.fr", true },
- { "laboutiquedejuliette.com", true },
- { "labrat.mobi", false },
- { "labsys.xyz", true },
- { "labworks.org", true },
- { "laby.life", true },
- { "lacaey.se", true },
- { "lacantine.xyz", true },
- { "lacaveducinquantenaire.com", true },
- { "lacentral.com", false },
- { "lacetsfun.com", true },
- { "lacetsroses.ch", true },
- { "laceysfarm.ie", true },
- { "lachainedesentrepreneurs.fr", true },
- { "lachawoj.de", true },
- { "lachlan-harris.com", true },
- { "lachlan.com", true },
- { "lachlanallison.com", true },
- { "lachosetypo.com", true },
- { "lachyoga-schwieberdingen.de", true },
- { "lackierereischmitt.de", true },
- { "laclaque.ch", false },
- { "lacledeslan.com", false },
- { "lacledor.ch", false },
- { "laclefdor.ch", false },
- { "lacoast.gov", true },
- { "lacochinacounselor.com", true },
- { "lacocina.nl", true },
- { "lacoquette.gr", true },
- { "lacyc3.eu", true },
- { "lada-granta.tk", true },
- { "lada-plus.tk", true },
- { "ladadate.com", true },
- { "ladakhtrip.tours", true },
- { "ladanmokhtari.tk", true },
- { "ladbroke.net", false },
- { "ladenzeile.at", true },
- { "ladenzeile.de", true },
- { "ladiesofvietnam.net", true },
- { "ladislavbrezovnik.com", true },
- { "lado.ltd", true },
- { "ladocs.tk", true },
- { "ladotech.cn", true },
- { "ladotech.com", true },
- { "ladraiglaan.com", true },
- { "ladyanna.de", true },
- { "ladyofhopeparish.org", true },
- { "ladyofsongstv.com", true },
- { "laencina.tk", true },
- { "laermschmiede.de", true },
- { "laextra.mx", true },
- { "lafansite.tk", true },
- { "lafantasticatravel.com", true },
- { "lafayette-rushford.com", true },
- { "lafcheta.info", true },
- { "lafema.de", true },
- { "lafermegourmande.fr", true },
- { "lafillepolyvalente.ca", true },
- { "lafillepolyvalente.com", true },
- { "lafka.org", true },
- { "laflash.com", true },
- { "lagazzettadigitale.it", true },
- { "lagerauftrag.info", true },
- { "lagit.in", true },
- { "laglab.org", false },
- { "lagout.org", true },
- { "lagriffeduservice.fr", true },
- { "lagsoftware.com", true },
- { "laguinguette.fr", true },
- { "lagunakitchenandbath.com", true },
- { "lahipotesisgaia.com", true },
- { "lahnau-akustik.de", true },
- { "lahora.com.ec", true },
- { "lai.is", true },
- { "lai.zone", true },
- { "laibcoms.com", true },
- { "laimut.com", true },
- { "lain.at", true },
- { "laindonleisure.co.uk", true },
- { "lajkatheme.com", true },
- { "lakeandriverrestoration.com", true },
- { "lakedavid.com.au", true },
- { "lakeee.com", true },
- { "lakehavasuwebsites.com", true },
- { "lakelandbank.com", true },
- { "lakeoswegotowncar.com", true },
- { "lakersview.com", true },
- { "lakesherwoodelectric.com", true },
- { "lakesherwoodelectrical.com", true },
- { "lakesherwoodelectrician.com", true },
- { "lakesherwoodexteriorlighting.com", true },
- { "lakesherwoodlandscapelighting.com", true },
- { "lakesherwoodlighting.com", true },
- { "lakesherwoodoutdoorlighting.com", true },
- { "lakeshowlife.com", true },
- { "lakewoodcityglass.com", true },
- { "lakiernictwo.auto.pl", true },
- { "lakkt.de", true },
- { "lakonia.com.br", true },
- { "lalalab.com", true },
- { "lalaloe.be", true },
- { "lalaya.fr", true },
- { "laled.ch", false },
- { "lalegria.tk", true },
- { "lalucepulsata.it", true },
- { "lalucioledigitale.com", true },
- { "lalunecreative.com", true },
- { "lalyre-corcelles.ch", false },
- { "lamakat.de", true },
- { "lamaletarural.es", true },
- { "lamapoll.de", true },
- { "lamargheritalruoto.it", true },
- { "lamasacre.tk", true },
- { "lambangcapgiare.com", true },
- { "lambauer.com", true },
- { "lambda.sx", true },
- { "lambertshealthcare.co.uk", true },
- { "lambertz.xyz", true },
- { "lamboo.be", true },
- { "lamclam.site", true },
- { "lamconnect.com", true },
- { "lamikvah.org", true },
- { "laminine.info", true },
- { "laminsaho.tk", true },
- { "lammersmarketing.com", true },
- { "lamontre.ru", true },
- { "lamp.re", false },
- { "lamp24.se", true },
- { "lampade.it", true },
- { "lampara.es", true },
- { "lampegiganten.dk", true },
- { "lampegiganten.no", true },
- { "lampen24.be", true },
- { "lampen24.nl", true },
- { "lampenwelt.at", true },
- { "lampenwelt.ch", true },
- { "lampenwelt.de", true },
- { "lampposthomeschool.com", true },
- { "lampy.pl", true },
- { "lamujerquesoy.com", false },
- { "lamunyon.com", true },
- { "lan.biz.tr", true },
- { "lana.swedbank.se", true },
- { "lanahallen.com", true },
- { "lanbroa.eu", true },
- { "lancelafontaine.com", true },
- { "lancelhoff.com", true },
- { "lancemanion.com", true },
- { "lancers.jp", true },
- { "lanceyip.com", true },
- { "lancyvbc.ch", false },
- { "land.nrw", false },
- { "landassessmentservices.com", true },
- { "landbetweenthelakes.us", true },
- { "landchecker.com.au", true },
- { "landegge.nl", true },
- { "landflair-magazin.de", false },
- { "landhaus-christmann.de", true },
- { "landhaus-havelse.de", true },
- { "landinfo.no", true },
- { "landingear.com", true },
- { "landlordy.com", true },
- { "landofelves.net", false },
- { "landoncreekapartments.com", true },
- { "landsbankinn.com", true },
- { "landscape-photography.org", true },
- { "landscapelightingagoura.com", true },
- { "landscapelightingagourahills.com", true },
- { "landscapelightingcalabasas.com", true },
- { "landscapelightingcamarillo.com", true },
- { "landscapelightingconejovalley.com", true },
- { "landscapelightingdosvientos.com", true },
- { "landscapelightinghiddenhills.com", true },
- { "landscapelightinglakesherwood.com", true },
- { "landscapelightingmalibu.com", true },
- { "landscapelightingmoorpark.com", true },
- { "landscapelightingnewburypark.com", true },
- { "landscapelightingoakpark.com", true },
- { "landscapelightingsimivalley.com", true },
- { "landscapelightingthousandoaks.com", true },
- { "landscapelightingwestlakevillage.com", true },
- { "landscapephotography.org.au", true },
- { "landyparts.nl", true },
- { "lanetix.com", true },
- { "lanforalla.se", true },
- { "lang-php.com", true },
- { "langadeduero.tk", true },
- { "langatang.com", true },
- { "langbein.org", true },
- { "langduytinh.com", true },
- { "langgasse-baar.ch", true },
- { "langhun.me", true },
- { "langkawitrip.com", true },
- { "langleyporter.com", true },
- { "langsam-dator.se", true },
- { "langstreckensaufen.de", true },
- { "languagecourse.net", true },
- { "languageterminal.com", true },
- { "langworth.com", true },
- { "langzijn.nl", true },
- { "lanna.io", true },
- { "lannainnovation.com", true },
- { "lannamontessori.com", true },
- { "lannatefl.com", true },
- { "lanodan.eu", true },
- { "lanostrasalute.it", true },
- { "lanre.org", true },
- { "lanroamer.de", true },
- { "lansechensilu.com", true },
- { "lanselot.com", true },
- { "lansewu.com", true },
- { "lansoftware.eu", true },
- { "lanternalauth.com", true },
- { "lanternhealth.org", true },
- { "lantian.pub", true },
- { "lanturtle.com", true },
- { "lanuovariviera.it", true },
- { "lanzalex.com", true },
- { "lanzamientovirtual.es", true },
- { "lanzarote-online.info", true },
- { "laoliang.ml", true },
- { "laopcionb.net", true },
- { "laos.dating", true },
- { "lapacho-tee.de", true },
- { "lapageamelkor.org", true },
- { "lapassiondutrading.com", false },
- { "lapatio.dk", true },
- { "lapelpinsandcoins.com", true },
- { "lapicena.eu", true },
- { "lapidge.net", true },
- { "laplacesicherheit.de", true },
- { "laplanetebleue.com", true },
- { "lapolla.com", true },
- { "lapolvora.ga", true },
- { "laportedufutur.org", true },
- { "lapotagere.ch", false },
- { "lapparente-aise.ch", false },
- { "lappari.com", false },
- { "lapseofsanity.net", true },
- { "lapshore.com", true },
- { "lara.photography", true },
- { "larabergmann.de", true },
- { "laracode.eu", true },
- { "laraeph.com", true },
- { "laramewa.tk", true },
- { "laranara.se", true },
- { "laranjada.org", true },
- { "larasm.tk", true },
- { "laraveldirectory.com", true },
- { "larbertbaptist.org", true },
- { "larch.me", true },
- { "lareclame.fr", true },
- { "larepublicacultural.es", true },
- { "lares.com", true },
- { "larete.ch", true },
- { "largescaleforums.com", true },
- { "largeviewer.com", true },
- { "lariposte.org", true },
- { "lariscus.eu", true },
- { "larondinedisinfestazione.com", true },
- { "larotayogaming.com", false },
- { "larpkalender.ch", true },
- { "larraz.es", true },
- { "larryandprisca.it", true },
- { "larryli.cn", true },
- { "larrysalibra.com", true },
- { "lars-ewald.com", true },
- { "lars-kusch.de", true },
- { "lars-mense.de", true },
- { "lars.cloud", true },
- { "lars.moi", true },
- { "larsklene.nl", true },
- { "larsklint.com", true },
- { "larsnittve.tk", true },
- { "larsson-ornmark.se", true },
- { "lartduportrait.fr", true },
- { "laruga.co.uk", true },
- { "lasabina.it", true },
- { "lasabubillas.es", true },
- { "lasalle.wa.edu.au", true },
- { "lasarmas.com", true },
- { "lasavonnerieducroisic.fr", true },
- { "lascana.co.uk", true },
- { "lasdelgadas.tk", true },
- { "lasereyess.net", true },
- { "laserhealthsolutions.com", true },
- { "laserpc.net", true },
- { "laserplaza.de", true },
- { "laserplaza.net", true },
- { "lask.in", true },
- { "laskas.pl", true },
- { "lasowy.com", true },
- { "laspequenassemillas.com", true },
- { "lasranas.es", true },
- { "lasrecetascocina.com", true },
- { "lassovideos.com", true },
- { "last-strike.org", true },
- { "lastpass.com", false },
- { "lasuzefc.fr", true },
- { "lasvegasescortmagazine.com", true },
- { "lat.sk", true },
- { "latabaccheria.net", true },
- { "late.am", false },
- { "latecnosfera.com", true },
- { "latedeals.co.uk", true },
- { "latenitefilms.com", false },
- { "lateralsecurity.com", true },
- { "laterremotodealcorcon.tk", true },
- { "latestdeals.co.uk", true },
- { "latiendauno.com", true },
- { "latiendawapa.com", true },
- { "latino.dating", true },
- { "latitudesign.com", false },
- { "latremebunda.com", true },
- { "lattyware.co.uk", true },
- { "lattyware.com", true },
- { "laubacher.io", true },
- { "lauchundei.at", true },
- { "laudableapps.com", true },
- { "laudablesites.com", true },
- { "lauensteiner.de", false },
- { "laufpix.de", true },
- { "lauftreff-himmelgeist.de", true },
- { "laukstein.com", true },
- { "launayflorian.net", true },
- { "launch-subtitle.com", true },
- { "launcher-minecraft.com", true },
- { "launchgroup.com.au", true },
- { "launchkey.com", false },
- { "launchmylifend.com", true },
- { "launchpad-app2.com", true },
- { "launchpadder2.com", true },
- { "lauraandwill.wedding", false },
- { "laurable.com", true },
- { "lauraenvoyage.fr", true },
- { "laurajeandesigns.com", true },
- { "laurakashiwase.com", true },
- { "lauralep.sy", true },
- { "lauralinde.de", true },
- { "lauraofrank.com", true },
- { "lauraohagan.com", true },
- { "laurasplacefamilysupport.org.au", true },
- { "lauravaindumentaria.com", true },
- { "laurelblack.com", true },
- { "laurenball.com", true },
- { "laurencball.com", true },
- { "laurenceplouffe.com", true },
- { "laurenlobue.com", true },
- { "laurensvanderblom.nl", true },
- { "lauresta.lt", true },
- { "lauresta.lv", true },
- { "lauriemilne.com", true },
- { "laurineprice.com", true },
- { "lauriuc.sk", true },
- { "lausannedentiste.ch", false },
- { "lausannelovers.ch", false },
- { "laussat.de", true },
- { "laut.digital", true },
- { "lauzon-hitter.com", true },
- { "lavabit.com", true },
- { "lavabit.no", true },
- { "lavaggista.it", true },
- { "lavalite.de", true },
- { "lavalon.tk", true },
- { "lavamob.com", true },
- { "lavanderia.roma.it", true },
- { "lavaux.lv", true },
- { "laviedalex.ovh", true },
- { "lavinaec.com", true },
- { "lavinya.net", true },
- { "lavita.de", true },
- { "lavitaura.com", true },
- { "lavitrine-une-collection.be", true },
- { "lavoieducoeur.be", true },
- { "lavoiepharmd.com", true },
- { "lavolte.net", true },
- { "lavozdelamusicachilena.tk", true },
- { "lavril.fr", true },
- { "law-colleges.com", true },
- { "law-peters.de", true },
- { "law-profile.com", true },
- { "law.co.il", true },
- { "law22.com", true },
- { "lawabidingcactus.com", true },
- { "lawda.ml", true },
- { "lawlessenglish.com", true },
- { "lawlessfrench.com", true },
- { "lawlessrepublic.com", true },
- { "lawlessspanish.com", true },
- { "lawn-seeds.com", true },
- { "lawnuk.com", true },
- { "lawrenceberg.nl", true },
- { "lawrencemurgatroyd.com", true },
- { "lawrencewhiteside.com", true },
- { "lawservice.com.ua", true },
- { "lawyer.cf", true },
- { "lawyerkf.com", true },
- { "layazc.com", true },
- { "laylo.io", true },
- { "laylo.nl", true },
- { "layordesign.co.uk", true },
- { "layoutsatzunddruck.de", true },
- { "lazau.com", true },
- { "lazer.cf", true },
- { "lazerengravingpros.com", true },
- { "lazistance.com", true },
- { "lazurit.com", true },
- { "lazyboston.com", true },
- { "lazyclock.com", true },
- { "lazyframe.com", true },
- { "lazyhelp.com", true },
- { "lazytux.org", true },
- { "lb-toner.de", true },
- { "lb266.net", true },
- { "lb366.cc", true },
- { "lb369.cc", true },
- { "lbayer.com", true },
- { "lbc-podcast.tk", true },
- { "lbc.gr", true },
- { "lbda.net", true },
- { "lbgconsultores.com", true },
- { "lbihrhelpdesk.com", true },
- { "lbls.me", true },
- { "lbmblaasmuziek.nl", true },
- { "lbs-logics.com", true },
- { "lbsistemas.com.mx", true },
- { "lbux.org", true },
- { "lc-cs.com", false },
- { "lc-promiss.de", true },
- { "lc0101.com", true },
- { "lc0188.com", true },
- { "lc040.com", true },
- { "lc0404g.com", true },
- { "lc044.com", true },
- { "lc0606g.com", true },
- { "lc0808.com", true },
- { "lc08080.com", true },
- { "lc10086.com", true },
- { "lc1010g.com", true },
- { "lc1212g.com", true },
- { "lc1313.com", true },
- { "lc1414.com", true },
- { "lc1588.com", true },
- { "lc1616.com", true },
- { "lc1616g.com", true },
- { "lc171.com", true },
- { "lc1717.com", true },
- { "lc18.fun", true },
- { "lc18.ph", true },
- { "lc18.vip", true },
- { "lc1800.com", true },
- { "lc1818.net", true },
- { "lc1904.com", true },
- { "lc204.com", true },
- { "lc2121g.com", true },
- { "lc221.com", true },
- { "lc2222g.com", true },
- { "lc2323g.com", true },
- { "lc2424.com", true },
- { "lc245.com", true },
- { "lc2500.com", true },
- { "lc2525.com", true },
- { "lc2727.com", true },
- { "lc2828.com", true },
- { "lc287.com", true },
- { "lc3131.com", true },
- { "lc3131g.com", true },
- { "lc3232g.com", true },
- { "lc3434g.com", true },
- { "lc3708.com", true },
- { "lc3709.com", true },
- { "lc3710.com", true },
- { "lc3711.com", true },
- { "lc3712.com", true },
- { "lc3713.com", true },
- { "lc3714.com", true },
- { "lc3715.com", true },
- { "lc3716.com", true },
- { "lc3717.com", true },
- { "lc3718.com", true },
- { "lc3719.com", true },
- { "lc3720.com", true },
- { "lc3723.com", true },
- { "lc3724.com", true },
- { "lc3725.com", true },
- { "lc3726.com", true },
- { "lc3727.com", true },
- { "lc3728.com", true },
- { "lc3729.com", true },
- { "lc3731.com", true },
- { "lc3732.com", true },
- { "lc3733.com", true },
- { "lc3736.com", true },
- { "lc3738.com", true },
- { "lc3739.com", true },
- { "lc3741.com", true },
- { "lc3742.com", true },
- { "lc3743.com", true },
- { "lc3744.com", true },
- { "lc3745.com", true },
- { "lc3746.com", true },
- { "lc3747.com", true },
- { "lc3748.com", true },
- { "lc3751.com", true },
- { "lc3752.com", true },
- { "lc3757.com", true },
- { "lc3759.com", true },
- { "lc3760.com", true },
- { "lc3763.com", true },
- { "lc3772.com", true },
- { "lc3774.com", true },
- { "lc3776.com", true },
- { "lc3778.com", true },
- { "lc3779.com", true },
- { "lc3780.com", true },
- { "lc3781.com", true },
- { "lc3782.com", true },
- { "lc3783.com", true },
- { "lc3793.com", true },
- { "lc3794.com", true },
- { "lc3795.com", true },
- { "lc3798.com", true },
- { "lc3801.com", true },
- { "lc3802.com", true },
- { "lc3838g.com", true },
- { "lc389.com", true },
- { "lc3939.com", true },
- { "lc432.com", true },
- { "lc4343g.com", true },
- { "lc460.com", true },
- { "lc50000.com", true },
- { "lc5081.com", true },
- { "lc5188.net", true },
- { "lc530.com", true },
- { "lc5353.com", true },
- { "lc5454.com", true },
- { "lc5454g.com", true },
- { "lc555.net", true },
- { "lc5555g.com", true },
- { "lc5668.com", true },
- { "lc58588.com", true },
- { "lc5998.com", true },
- { "lc6.fun", true },
- { "lc60000.com", true },
- { "lc6060.com", true },
- { "lc6161.com", true },
- { "lc6161g.com", true },
- { "lc6262.com", true },
- { "lc6363.com", true },
- { "lc6363g.com", true },
- { "lc6464.com", true },
- { "lc6565g.com", true },
- { "lc6601.com", true },
- { "lc6602.com", true },
- { "lc6603.com", true },
- { "lc6605.com", true },
- { "lc6607.com", true },
- { "lc6609.com", true },
- { "lc6621.com", true },
- { "lc6623.com", true },
- { "lc6625.com", true },
- { "lc6626.com", true },
- { "lc6627.com", true },
- { "lc6629.com", true },
- { "lc6631.com", true },
- { "lc6632.com", true },
- { "lc6635.com", true },
- { "lc6636.com", true },
- { "lc6637.com", true },
- { "lc6638.com", true },
- { "lc6639.com", true },
- { "lc6651.com", true },
- { "lc6652.com", true },
- { "lc6653.com", true },
- { "lc6656.com", true },
- { "lc6657.com", true },
- { "lc6659.com", true },
- { "lc6662.com", true },
- { "lc6663.com", true },
- { "lc6665.com", true },
- { "lc6666g.com", true },
- { "lc6667.com", true },
- { "lc6668.com", true },
- { "lc6669.com", true },
- { "lc6681.com", true },
- { "lc6683.com", true },
- { "lc6698.com", true },
- { "lc6767.com", true },
- { "lc68.net", true },
- { "lc6800.com", true },
- { "lc6801.com", true },
- { "lc6802.com", true },
- { "lc6803.com", true },
- { "lc6805.com", true },
- { "lc6806.com", true },
- { "lc6807.com", true },
- { "lc6808.com", true },
- { "lc6809.com", true },
- { "lc6810.com", true },
- { "lc6811.com", true },
- { "lc6812.com", true },
- { "lc6813.com", true },
- { "lc6815.com", true },
- { "lc6816.com", true },
- { "lc6817.com", true },
- { "lc68686.com", true },
- { "lc68688.com", true },
- { "lc6868g.com", true },
- { "lc68690.com", true },
- { "lc68692.com", true },
- { "lc68693.com", true },
- { "lc68694.com", true },
- { "lc68695.com", true },
- { "lc68696.com", true },
- { "lc68697.com", true },
- { "lc68698.com", true },
- { "lc68699.com", true },
- { "lc6880.com", true },
- { "lc68880.com", true },
- { "lc68881.com", true },
- { "lc68882.com", true },
- { "lc68884.com", true },
- { "lc68888.com", true },
- { "lc690.com", true },
- { "lc7.fun", true },
- { "lc7171g.com", true },
- { "lc7373.com", true },
- { "lc7575.com", true },
- { "lc7676.com", true },
- { "lc7676g.com", true },
- { "lc777.net", true },
- { "lc7979.com", true },
- { "lc7979g.com", true },
- { "lc8.com", true },
- { "lc8.fun", true },
- { "lc8.life", true },
- { "lc8.live", true },
- { "lc8.tv", true },
- { "lc80000.com", true },
- { "lc8003.com", true },
- { "lc8005.com", true },
- { "lc8020.com", true },
- { "lc8023.com", true },
- { "lc8032.com", true },
- { "lc8033.com", true },
- { "lc8036.com", true },
- { "lc8038.com", true },
- { "lc8050.com", true },
- { "lc8052.com", true },
- { "lc818.net", true },
- { "lc8181.com", true },
- { "lc8282.com", true },
- { "lc8383g.com", true },
- { "lc8585g.com", true },
- { "lc859.com", true },
- { "lc861.com", true },
- { "lc862.com", true },
- { "lc863.com", true },
- { "lc869.com", true },
- { "lc871.com", true },
- { "lc873.com", true },
- { "lc875.com", true },
- { "lc876.com", true },
- { "lc8787.com", true },
- { "lc879.com", true },
- { "lc88.fun", true },
- { "lc8812.com", true },
- { "lc8813.com", true },
- { "lc8815.com", true },
- { "lc8816.com", true },
- { "lc8817.com", true },
- { "lc8819.com", true },
- { "lc8820.com", true },
- { "lc8823.com", true },
- { "lc8825.com", true },
- { "lc8826.com", true },
- { "lc8835.com", true },
- { "lc8836.com", true },
- { "lc8838.com", true },
- { "lc8839.com", true },
- { "lc8841.com", true },
- { "lc88508.com", true },
- { "lc8856.com", true },
- { "lc8859.com", true },
- { "lc8861.com", true },
- { "lc8862.com", true },
- { "lc8863.com", true },
- { "lc8865.com", true },
- { "lc8866.com", true },
- { "lc8868.net", true },
- { "lc8869.com", true },
- { "lc8870.com", true },
- { "lc8874.com", true },
- { "lc8878.com", true },
- { "lc8881.com", true },
- { "lc8882.com", true },
- { "lc8885.com", true },
- { "lc8887.com", true },
- { "lc8888g.com", true },
- { "lc8890.com", true },
- { "lc8891.com", true },
- { "lc8892.com", true },
- { "lc8893.com", true },
- { "lc8896.com", true },
- { "lc8898.net", true },
- { "lc8900.com", true },
- { "lc8905.com", true },
- { "lc8906.com", true },
- { "lc891.com", true },
- { "lc8910.com", true },
- { "lc8911.com", true },
- { "lc8912.com", true },
- { "lc8913.com", true },
- { "lc8914.com", true },
- { "lc8915.com", true },
- { "lc8916.com", true },
- { "lc8917.com", true },
- { "lc8918.com", true },
- { "lc892.com", true },
- { "lc8920.com", true },
- { "lc8921.com", true },
- { "lc8922.com", true },
- { "lc8923.com", true },
- { "lc8924.com", true },
- { "lc8925.com", true },
- { "lc8926.com", true },
- { "lc8927.com", true },
- { "lc8928.com", true },
- { "lc8929.com", true },
- { "lc893.com", true },
- { "lc8930.com", true },
- { "lc8931.com", true },
- { "lc8932.com", true },
- { "lc8934.com", true },
- { "lc8935.com", true },
- { "lc8936.com", true },
- { "lc895.com", true },
- { "lc896.com", true },
- { "lc897.com", true },
- { "lc8a.com", true },
- { "lc8c.com", true },
- { "lc8dc04.com", true },
- { "lc8dc08.com", true },
- { "lc8dc10.com", true },
- { "lc8dc11.com", true },
- { "lc8dc12.com", true },
- { "lc8dc13.com", true },
- { "lc8dc14.com", true },
- { "lc8dc15.com", true },
- { "lc8dc16.com", true },
- { "lc8dc17.com", true },
- { "lc8dc20.com", true },
- { "lc8dc21.com", true },
- { "lc8dc22.com", true },
- { "lc8dc24.com", true },
- { "lc8dc26.com", true },
- { "lc8dc27.com", true },
- { "lc8dc28.com", true },
- { "lc8dc29.com", true },
- { "lc8guidance.com", true },
- { "lc8md00.com", true },
- { "lc8md01.com", true },
- { "lc8md02.com", true },
- { "lc8md03.com", true },
- { "lc8md08.com", true },
- { "lc8md11.com", true },
- { "lc8md26.com", true },
- { "lc8md28.com", true },
- { "lc8md30.com", true },
- { "lc8md31.com", true },
- { "lc8md33.com", true },
- { "lc8md35.com", true },
- { "lc8md55.com", true },
- { "lc8md77.com", true },
- { "lc8md88.com", true },
- { "lc9.app", true },
- { "lc90000.com", true },
- { "lc9090.com", true },
- { "lc9108.com", true },
- { "lc9251.com", true },
- { "lc9253.com", true },
- { "lc9256.com", true },
- { "lc9292.com", true },
- { "lc9393g.com", true },
- { "lc9494.com", true },
- { "lc9494g.com", true },
- { "lc9797.com", true },
- { "lc98.net", true },
- { "lc9852.com", true },
- { "lc9862.com", true },
- { "lc9899.com", true },
- { "lc9900.com", true },
- { "lc9910.com", true },
- { "lc9920.com", true },
- { "lc9930.com", true },
- { "lc9938.com", true },
- { "lc9939.com", true },
- { "lc9940.com", true },
- { "lc9950.com", true },
- { "lc9960.com", true },
- { "lc9968.com", true },
- { "lc9986.com", true },
- { "lc9999g.com", true },
- { "lca-pv.de", true },
- { "lcacommons.gov", true },
- { "lcars-sv.info", true },
- { "lce-events.com", true },
- { "lcgaj.com", true },
- { "lcv.psc.br", true },
- { "lcvip4.com", true },
- { "lcvip5.com", true },
- { "lcvip7.com", true },
- { "lcvip8.net", true },
- { "lcvip9.com", true },
- { "lcx.cc", true },
- { "lcy.im", false },
- { "lcy.moe", true },
- { "ld-begunjscica.si", true },
- { "ld66999.com", true },
- { "ld6999.com", true },
- { "ldesignweb.com", true },
- { "ldjb.jp", true },
- { "ldm2468.com", true },
- { "ldsun.com", true },
- { "le-bar.org", true },
- { "le-cameleon.fr", true },
- { "le-controle-parental.fr", true },
- { "le-creux-du-van.ch", false },
- { "le-drive-de-just-vet.fr", true },
- { "le-fumoir.com", true },
- { "le-h.de", false },
- { "le-page.info", false },
- { "le-palantir.com", true },
- { "le-traiteur-parisien.fr", false },
- { "le-upfitter.com", true },
- { "le056.com", true },
- { "le23.fr", true },
- { "le42mars.fr", true },
- { "le518.net", true },
- { "le802.com", true },
- { "leadbook.ru", true },
- { "leadbox.cz", true },
- { "leadership-conference.net", true },
- { "leadinfo.com", true },
- { "leadquest.nl", true },
- { "leaf-consulting.de", true },
- { "leafandseed.co.uk", true },
- { "leafans.tk", false },
- { "leafinote.com", true },
- { "leafland.co.nz", true },
- { "leakforums.net", true },
- { "leamsigc.com", false },
- { "leankit.com", true },
- { "leanplando.com", true },
- { "leap-it.be", false },
- { "leapandjump.co.uk", true },
- { "leapworks.io", true },
- { "learncrypto.vip", true },
- { "learnflakes.net", true },
- { "learnhowtoplayguitar.tk", true },
- { "learning-id.com", true },
- { "learningis1.st", true },
- { "learningladderacademy.net", true },
- { "learninglaw.com", true },
- { "learningman.top", true },
- { "learningselfreliance.com", true },
- { "learnlux.com", true },
- { "learnpianogreece.com", true },
- { "learnplayground.com", true },
- { "learntohack.me", true },
- { "leaseplan.com", true },
- { "leastsignificantbit.de", true },
- { "leatam.fr", true },
- { "leatherfurnitureexpo.com", true },
- { "leathersofacleaning.co.uk", true },
- { "leatherwood.nl", true },
- { "lebanesearmy.gov.lb", true },
- { "lebanonbitcoin.com", true },
- { "lebarmy.gov.lb", true },
- { "lebedata.com", true },
- { "lebendige-heilkunst.de", true },
- { "lebens-fluss.at", true },
- { "lebensraum-fitness-toenisvorst.de", true },
- { "lebensraum-kurse.ch", true },
- { "lebihan.pl", true },
- { "leblanc.io", true },
- { "lebosse.me", true },
- { "lebourgeo.is", true },
- { "lecannabis.com", true },
- { "lecannabiste.com", true },
- { "lecheng.in", true },
- { "lecheng08.com", true },
- { "lecheng2.com", true },
- { "lecheng3.com", true },
- { "lecheng31.com", true },
- { "lecheng518.com", true },
- { "lecheng5288.com", true },
- { "lecheng5888.com", true },
- { "lecheng66.com", true },
- { "lecheng7.com", true },
- { "lecheng88.com", true },
- { "lecheng88.net", true },
- { "lecheng888.com", true },
- { "lecheng98.com", true },
- { "lecheng98.net", true },
- { "lecheng988.com", true },
- { "lectricecorrectrice.com", true },
- { "led-jihlava.cz", true },
- { "ledburyvets.co.uk", true },
- { "leddingplasticsurgery.com", true },
- { "ledecologie.com.br", true },
- { "ledeguisement.com", true },
- { "lederer-it.com", true },
- { "lederkleren.nl", true },
- { "ledlight.com", true },
- { "ledlights.ca", true },
- { "ledscontato.com.br", true },
- { "ledspadova.eu", true },
- { "ledwereld.nl", true },
- { "lee-fuller.co.uk", true },
- { "leeaaronsrealestate.com", true },
- { "leeannescreations.com", true },
- { "leebiblestudycentre.co.uk", true },
- { "leeclemens.net", false },
- { "leedev.org", true },
- { "leekspin.ml", true },
- { "leelaylay.com", true },
- { "leemankuiper.nl", true },
- { "leerliga.de", true },
- { "leertipp.de", true },
- { "leesilvey.com", true },
- { "leesyal.org", true },
- { "leet2.com", true },
- { "leetcode.com", true },
- { "leetcode.net", true },
- { "leetgamers.asia", true },
- { "leevealdc.com", true },
- { "leeyoungaeph.tk", true },
- { "lefcoaching.nl", false },
- { "lefebvristes.com", true },
- { "lefebvristes.fr", true },
- { "leflibustier.ru", true },
- { "lefonddeloeil.com", false },
- { "left-baggage.co.uk", true },
- { "leftbrainsolutions.com.au", true },
- { "legabot.fr", true },
- { "legacyiohs.org", true },
- { "legaillart.fr", true },
- { "legalatlanta.com", true },
- { "legalband.club", true },
- { "legalcontrol.info", true },
- { "legaldesk.com", false },
- { "legalforms.ng", true },
- { "legalinmotion.es", true },
- { "legalplace.fr", true },
- { "legalrobot.com", true },
- { "legalsearch.nl", true },
- { "legalsoftware.net", true },
- { "legend-v.life", true },
- { "legendcatz.com", true },
- { "legendesdechine.ch", false },
- { "legendofkrystal.com", true },
- { "legends-game.ru", false },
- { "legible.es", true },
- { "legioniv.org", true },
- { "legionminecraft.com", true },
- { "legiscontabilidade.com.br", true },
- { "legit.nz", true },
- { "legjobblogo.hu", true },
- { "legland.fr", true },
- { "legnami24.it", true },
- { "legoutdesplantes.be", true },
- { "legrandvtc.fr", true },
- { "legumeinfo.org", true },
- { "legyenkianegykereked.hu", true },
- { "lehighmathcircle.org", true },
- { "lehighvalleypeds.com", true },
- { "lehmitz-weinstuben.de", true },
- { "lehti-tarjous.net", true },
- { "leibniz-gymnasium-altdorf.de", true },
- { "leideninternationalreview.com", true },
- { "leighneithardt.com", true },
- { "leignier.org", true },
- { "leilonorte.com", true },
- { "leipzig.photo", true },
- { "leipziger-triathlon.de", true },
- { "leisure-blog.com", true },
- { "leisure-supplies-show.co.uk", true },
- { "leisurepools.com.au", true },
- { "lejardindesmesanges.fr", true },
- { "lektier.cf", true },
- { "lelac-capfrance.com", true },
- { "lelubre.info", true },
- { "lelux.fi", true },
- { "lelux.site", true },
- { "lemagauto.fr", true },
- { "lemarcheelagrandeguerra.it", true },
- { "lemazol.fr", true },
- { "lemilane.it", true },
- { "leminhduong.com", true },
- { "lemni.top", true },
- { "lemoine.at", true },
- { "lemondenumerique.com", true },
- { "lemonlawnow.com", true },
- { "lemonop.com", true },
- { "lemonparty.co", true },
- { "lemonrockbiketours.com", true },
- { "lemonrotools.com", true },
- { "lemonthy.com", true },
- { "lenafonster.se", true },
- { "lenagroben.de", true },
- { "lenalio.fr", true },
- { "lenaneva.ru", true },
- { "lence.net", true },
- { "lencia.ga", true },
- { "lendingclub.com", true },
- { "lenget.com", true },
- { "lenguajedeprogramacion.com", true },
- { "lenidh.de", true },
- { "leninalbertop.com.ve", true },
- { "lenn-blaschke.com", true },
- { "lenostech.gr", true },
- { "lenou.nl", true },
- { "lenovovietnam.net", true },
- { "lenr-forum.com", true },
- { "lensdoctor.com", true },
- { "lenspirations.com", true },
- { "lensual.space", true },
- { "lentivo.com", true },
- { "lenuagebauche.org", true },
- { "lenyip.com", true },
- { "lenyip.me", true },
- { "lenyip.works", true },
- { "leoandpeto.com", true },
- { "leodraxler.at", true },
- { "leola.cz", true },
- { "leola.sk", true },
- { "leominstercu.com", false },
- { "leomwilson.com", true },
- { "leon-tec.co.jp", true },
- { "leon-tech.com", true },
- { "leonbuitendam.nl", true },
- { "leondenard.com", true },
- { "leonklingele.de", true },
- { "leonmahler.consulting", true },
- { "leontiekoetter.de", true },
- { "leontyev.tk", true },
- { "leopoldina.net", true },
- { "leoservicos.etc.br", true },
- { "leoservicosetc.com", true },
- { "leoservicosetc.com.br", true },
- { "leoservicosetc.email", true },
- { "leoservicosetc.live", true },
- { "leoservicosetc.net", true },
- { "leoservicosetc.online", true },
- { "leoservicosetc.org", true },
- { "leoservicosetc.rio.br", true },
- { "leoservicosetc.world", true },
- { "leovanna.co.uk", true },
- { "leowkahman.com", true },
- { "lep.gov", true },
- { "lepartiecomemoracoes.com.br", true },
- { "lepenetapeti.com", true },
- { "lepidum.jp", true },
- { "lepsos.com", false },
- { "lequerceagriturismo.com", true },
- { "lequest.dk", true },
- { "lequocthai.com", true },
- { "lerasenglish.com", true },
- { "lereporter.ma", true },
- { "leretour.ch", false },
- { "lerku.com", true },
- { "lernenamsee.ch", true },
- { "lernerspersonalinjury.ca", true },
- { "lernorteuropa.com", true },
- { "lernorteuropa.de", true },
- { "lernorteuropa.eu", true },
- { "lernplattform-akademie.de", true },
- { "leruevintage.com", true },
- { "les-ateliers-de-melineo.be", false },
- { "les-explos.com", true },
- { "les-inoxydables.com", true },
- { "lesaffre.es", true },
- { "lesancheslibres.fr", true },
- { "lesarts.com", true },
- { "lesberger.ch", false },
- { "lesbi-porno-video.ru", true },
- { "lesbianlovers.tk", true },
- { "lesbofight.com", true },
- { "lesbrillantsdaristide.com", true },
- { "lesconteursavis.org", true },
- { "lescrapdesfilles.fr", true },
- { "leseditionsbraquage.com", true },
- { "lesfilmsavivre.com", true },
- { "lesgarianes.com", true },
- { "lesgoodnews.fr", true },
- { "leshervelines.com", true },
- { "leshok.tk", true },
- { "lesjardinsdubanchet.fr", true },
- { "lesmamy.ch", false },
- { "lesmontagne.net", true },
- { "lesnet.co.uk", true },
- { "lespagesweb.ch", false },
- { "lespecialiste-pradelexcellence.com", true },
- { "lesplatanes.ch", false },
- { "lespoesiesdheloise.fr", true },
- { "lespret.nl", true },
- { "lesptitspasdelyne.fr", true },
- { "lesptitstutos.fr", true },
- { "lesquerda.cat", false },
- { "lessis.moe", true },
- { "lesterchan.net", true },
- { "lesterrassesdusoleil.ch", false },
- { "lesummeira.is", true },
- { "lesyndicat.info", false },
- { "leszonderstress.nl", true },
- { "letaman.tk", true },
- { "letdownloads.tk", true },
- { "letemps.ch", true },
- { "letempsdujasmin.fr", true },
- { "letertrefleuri.com", true },
- { "lethosdesigns.co.uk", true },
- { "lethosdesigns.com", true },
- { "leticia.ml", true },
- { "letni-kurzy.cz", true },
- { "leto12.xyz", true },
- { "letranif.net", true },
- { "lets-bounce.com", true },
- { "lets-go-acoustic.de", true },
- { "lets-ktai.jp", true },
- { "lets.nu", true },
- { "letsbounceuk.com", true },
- { "letsbrand.com", true },
- { "letsdebug.net", true },
- { "letsencrypt-for-cpanel.com", true },
- { "letsflyinto.space", true },
- { "letsgame.nl", true },
- { "letsgetchecked.com", true },
- { "letsgowhilewereyoung.com", true },
- { "letsorganise.uk", true },
- { "letspartyrugby.co.uk", true },
- { "letsprint3d.net", true },
- { "letssackcancer.org", true },
- { "letstalkcounseling.com", true },
- { "letterbox-online.de", true },
- { "letterdance.de", true },
- { "letteringinstitute.com", true },
- { "lettersblogatory.com", true },
- { "lettings101.org", true },
- { "lettori.club", true },
- { "lettres-motivation.net", true },
- { "leuchtmann.ch", true },
- { "leuenhagen.com", true },
- { "leulu.com", true },
- { "leumi-how-to.co.il", true },
- { "leutgeb.xyz", true },
- { "leuthardtfamily.com", true },
- { "lev103.com", true },
- { "levans.fr", true },
- { "level-10.de", true },
- { "level6.me", true },
- { "level9hvac.com", true },
- { "levelonetrainingandfitness.com", true },
- { "levels.one", true },
- { "leveluplv.com", true },
- { "leveluprails.com", true },
- { "leveluprankings.com", true },
- { "levendwater.org", true },
- { "levensbron.nl", true },
- { "leventismotors.com.ng", true },
- { "leveragedtokens.com", true },
- { "leverj.io", true },
- { "levermann.eu", true },
- { "leviaan.nl", true },
- { "leviathan-studio.com", true },
- { "levineteamestates.com", true },
- { "levinus.de", true },
- { "leviscop.com", true },
- { "leviscop.de", true },
- { "levittasaude.com.br", true },
- { "lew.im", true },
- { "lewdawson.com", true },
- { "lewdgamer.com", true },
- { "lewiatan.opole.pl", true },
- { "lewiscollard.com", true },
- { "lewisdatasecurity.com", true },
- { "lewislaw.com", true },
- { "lewisllewellyn.me", true },
- { "lewismcyoutube.uk", true },
- { "lexautoservice.nl", true },
- { "lexdigital.pl", true },
- { "lexic.co", true },
- { "lexico.pt", true },
- { "lexicography.online", true },
- { "lexikon24.tk", true },
- { "lexoo.co.uk", true },
- { "lexpierce.social", true },
- { "lexway.pk", true },
- { "leymaritima.com", true },
- { "lfashion.eu", true },
- { "lfgss.com", true },
- { "lfrconseil.com", true },
- { "lfyhokk.tk", true },
- { "lg-waps.go.jp", true },
- { "lg-waps.jp", true },
- { "lg.gz.cn", true },
- { "lg2.com", true },
- { "lgbt-colleges.com", true },
- { "lgbt.io", true },
- { "lgbtq.cool", true },
- { "lghfinancialstrategy.ch", false },
- { "lgpecasoriginais.com.br", true },
- { "lgygf.com", true },
- { "lhamaths.online", true },
- { "lhconsult.tk", false },
- { "lhero.org", true },
- { "lhgavarain.com", true },
- { "lhost.su", true },
- { "lhr.wiki", true },
- { "li-ke.co.jp", true },
- { "li.gz.cn", true },
- { "li.search.yahoo.com", false },
- { "li680.com", true },
- { "lialion.de", true },
- { "liam-w.com", true },
- { "liam-w.io", true },
- { "liamelliott.me", true },
- { "liamlin.me", true },
- { "liandongyoupin.com", true },
- { "liangxingai.com", true },
- { "lianhongrui.com", true },
- { "liaronce.com", true },
- { "liautard.fr", true },
- { "lib64.net", true },
- { "libble.eu", true },
- { "libbywinberginteriors.com.au", true },
- { "liberapay.com", true },
- { "liberation2020.com", true },
- { "liberationist.org", true },
- { "liberationschool.org", true },
- { "liberdademg.com.br", true },
- { "liberhk.com", true },
- { "liberhk.info", true },
- { "liberhk.net", true },
- { "liberhk.org", true },
- { "liberta-me.org", true },
- { "libertarian-party.com", true },
- { "libertas.co.jp", true },
- { "liberty-city.tk", true },
- { "liberty-med.ru", true },
- { "libertyachts.com", true },
- { "libgame.com", true },
- { "libmpq.org", true },
- { "libnull.com", true },
- { "libo766.com", true },
- { "libo766.net", true },
- { "liborburda.cz", true },
- { "libportal.cf", true },
- { "libra.com", true },
- { "librarium.tk", true },
- { "library-quest.com", true },
- { "libraryextension.com", true },
- { "libraryofcode.org", true },
- { "librarytools.com", false },
- { "libravatar.org", true },
- { "librazy.org", true },
- { "libre-innovation.org", true },
- { "libre-service.de", true },
- { "libre.cr", true },
- { "libreboot.org", true },
- { "librebox.de", true },
- { "libreduca.com", true },
- { "librehk.com", true },
- { "librehk.info", true },
- { "librehk.net", true },
- { "librehk.org", true },
- { "librelamp.com", true },
- { "libremail.nl", true },
- { "libreoffice-from-collabora.com", true },
- { "libreofficefromcollabora.com", true },
- { "libreria-ouroboros.tk", true },
- { "librerias-he.com.pe", true },
- { "librervac.org", true },
- { "librisulibri.it", true },
- { "librofilia.com", true },
- { "libscode.com", false },
- { "libskia.so", true },
- { "libsodium.org", true },
- { "libstock.si", true },
- { "lichess.org", true },
- { "lichtmetzger.de", false },
- { "lichtspot.de", true },
- { "lichttechnik-tumler.com", true },
- { "lichttraeumer.de", true },
- { "lickthesalt.com", true },
- { "licloud.homeip.net", true },
- { "lida-vets.co.uk", true },
- { "lidavidm.me", true },
- { "lidel.org", true },
- { "lideradigital.com", true },
- { "liderwalut.pl", false },
- { "lidl-blumen.de", true },
- { "lidl-foto.it", true },
- { "lidl-fotos.at", true },
- { "lidl-fotos.de", true },
- { "lidl-gewinnspiel.de", true },
- { "lidl-holidays.com", true },
- { "lidl-menubox.ch", true },
- { "lidl-shop.be", true },
- { "lidl-shop.cz", true },
- { "lidl-shop.nl", true },
- { "lidl-shop.sk", true },
- { "lidl-sklep.pl", true },
- { "lidl-stikeez.si", true },
- { "lidl-tour.ro", true },
- { "lidlonline.es", true },
- { "lidogr.com", true },
- { "lidong.me", true },
- { "lidow.eu", true },
- { "lidtkemotors.com", true },
- { "liduan.net", false },
- { "lie.as", true },
- { "liebel.org", true },
- { "lieberwirth.biz", true },
- { "liehuojun.com", true },
- { "liemen.net", true },
- { "lienhardtconstruction.fr", true },
- { "lieren4x4.nl", true },
- { "lierohell.tk", true },
- { "lieuu.com", false },
- { "lifanov.com", true },
- { "life-emotions.pt", true },
- { "life-in-hell.tk", true },
- { "life-time.nl", true },
- { "life29.com", true },
- { "lifeartstudios.net", true },
- { "lifebetweenlives.com.au", true },
- { "lifeboxhealthcare.co.uk", true },
- { "lifecism.com", true },
- { "lifefoto.de", true },
- { "lifeguatemala.com", true },
- { "lifeinhex.com", true },
- { "lifeinsurancepro.org", true },
- { "lifekirov.tk", true },
- { "lifelenz.com", true },
- { "lifematenutrition.com", true },
- { "lifemcserver.com", true },
- { "lifemstyle.com", true },
- { "lifeqa.net", true },
- { "lifesafety.com.br", true },
- { "lifesavvy.com", true },
- { "lifeset.pp.ua", true },
- { "lifeslonglist.com", true },
- { "lifestorage.com", true },
- { "lifestylecent.com", true },
- { "lifestylefinancial.ca", true },
- { "lifestylefoto.cz", true },
- { "lifestyletravel.co.za", true },
- { "lifetoolscdc.com", true },
- { "lifetree.network", true },
- { "lifewithdyna.com", true },
- { "lifi.digital", true },
- { "lifi.is", true },
- { "lift-wise.com", true },
- { "liftie.info", true },
- { "liftmastercloud.com", true },
- { "ligadosgames.com", true },
- { "light-up.xyz", true },
- { "light.mail.ru", true },
- { "lightbox.co", true },
- { "lightcraftmc.tk", true },
- { "lightfoot.co.uk", true },
- { "lighthouseglobal.com", true },
- { "lighting-centres.co.uk", true },
- { "lightingagoura.com", true },
- { "lightingagourahills.com", true },
- { "lightingcalabasas.com", true },
- { "lightingconejovalley.com", true },
- { "lightingdosvientos.com", true },
- { "lightinghiddenhills.com", true },
- { "lightinglakesherwood.com", true },
- { "lightingmalibu.com", true },
- { "lightingmoorpark.com", true },
- { "lightingnewburypark.com", true },
- { "lightingoakpark.com", true },
- { "lightingsimivalley.com", true },
- { "lightingthousandoaks.com", true },
- { "lightingwestlakevillage.com", true },
- { "lightme.us", true },
- { "lightning-wallet.com", true },
- { "lightning.community", true },
- { "lightning.engineering", true },
- { "lightningwirelabs.com", true },
- { "lightography.com", true },
- { "lights.co.uk", true },
- { "lights.ie", true },
- { "lightscale.com", true },
- { "lightsfromspace.com", true },
- { "lightsheep.no", false },
- { "lightspeed.com", false },
- { "lightspeedta.co", true },
- { "lighttp.com", true },
- { "lightweighthr.com", true },
- { "lightyear.no", true },
- { "ligmadrive.com", true },
- { "lignesante.com", true },
- { "lignite.com", true },
- { "lignoma.com", true },
- { "ligonier.com", true },
- { "lihaul.dnsalias.net", true },
- { "lije-creative.com", true },
- { "lijncoaching.nl", true },
- { "lijstje.be", true },
- { "lijstje.nl", true },
- { "likc.me", true },
- { "likeablehub.com", true },
- { "likeabox.de", true },
- { "likebee.gr", true },
- { "likegeeks.com", true },
- { "likehifi.de", true },
- { "likemovies.de", true },
- { "likeometer.co", true },
- { "likere.com", true },
- { "likesforinsta.com", true },
- { "likestudio.com.ua", true },
- { "likui.me", true },
- { "lilai107.com", true },
- { "lilai116.com", true },
- { "lilai18.ph", true },
- { "lilai2211.com", true },
- { "lilai3366.com", true },
- { "lilai634.com", true },
- { "lilai6677.com", true },
- { "lilai838.com", true },
- { "lilai8866.com", true },
- { "lilai9966.com", true },
- { "lilianejuchli.ch", true },
- { "liliang13.com", true },
- { "liljohnsanitary.net", true },
- { "lillepuu.com", true },
- { "lilliputpreschool.co.nz", true },
- { "lilomatrixcorner.fr", true },
- { "lily-bearing.com", true },
- { "lily-inn.com", true },
- { "lilyfarmfreshskincare.com", true },
- { "lilysbouncycastles.com", true },
- { "lilysgrill.com", true },
- { "lilyvet.com", true },
- { "lim-light.com", true },
- { "limap.ch", true },
- { "limasartes.com.br", true },
- { "limawi.io", true },
- { "limbaido.tk", true },
- { "limberg.me", true },
- { "limbo.services", true },
- { "limeres.com", true },
- { "limereslaw.com", true },
- { "limit.xyz", true },
- { "limitededitioncomputers.com", true },
- { "limitededitionsolutions.com", true },
- { "limitlessinteractive.com", true },
- { "limitxyz.com", true },
- { "limnt.cn", true },
- { "limo.pl", true },
- { "limoshka.ru", true },
- { "limpid.nl", true },
- { "limstash.com", true },
- { "limstash.me", true },
- { "limules.ch", true },
- { "limx.win", true },
- { "lin.fi", true },
- { "linaklein.de", true },
- { "lincdavis.com", true },
- { "lince-bonares.tk", true },
- { "lincnaarzorg.nl", true },
- { "lincoln.com.cn", true },
- { "lincoln.mx", true },
- { "lincolnboolefoundation.org", true },
- { "lincolnfinewines.com", true },
- { "lincolnpedsgroup.com", true },
- { "lincolnsfh.com", true },
- { "lincolnwayflorist.com", true },
- { "lincore.ru", true },
- { "lindajahn.de", true },
- { "lindalap.fi", true },
- { "lindaolsson.com", true },
- { "linden.me", true },
- { "lindeskar.se", true },
- { "lindgrenracing.tk", true },
- { "lindnerhof-taktik.de", true },
- { "lindnerhof.info", true },
- { "lindo.ru", true },
- { "lindon.pw", true },
- { "lindquistnet.us", true },
- { "lindsaygorski.com", true },
- { "lindskogen.se", true },
- { "lindy.co", false },
- { "line-wise.com", true },
- { "line.biz", true },
- { "line.co.nz", false },
- { "lineageos.org", true },
- { "linearaudio.net", true },
- { "linearmap.com", true },
- { "lineshop.ml", true },
- { "linestep.jp", true },
- { "linfamilygc.com", true },
- { "linge-ma.ro", true },
- { "lingerie.com.br", true },
- { "lingeriesilhouette.com", true },
- { "lingotaxi.com", true },
- { "link-net.ga", true },
- { "link-sanitizer.com", true },
- { "link2serve.com", true },
- { "link9.net", true },
- { "linkdr.uk", true },
- { "linkedinbackground.com", true },
- { "linkedpipes.com", true },
- { "linkenheil.org", true },
- { "linklocker.co", true },
- { "linkmaker.co.uk", true },
- { "linkmauve.fr", true },
- { "linko-pomoika.tk", true },
- { "linkopia.com", true },
- { "linksphotograph.com", true },
- { "linkthis.me", true },
- { "linktio.com", true },
- { "linkuva.tk", true },
- { "linkwheel.tk", true },
- { "linkycat.com", true },
- { "linnaeusgroup.co.uk", true },
- { "linonin.tk", true },
- { "linosky.ch", true },
- { "linost.com", true },
- { "linpx.com", true },
- { "linqhost.nl", true },
- { "linss.com", true },
- { "lintasi.com", true },
- { "lintelliftusa.com", true },
- { "lintmx.com", true },
- { "linux-audit.com", true },
- { "linux-florida.com", true },
- { "linux-help.org", true },
- { "linux-mint-czech.cz", true },
- { "linux-taganrog.tk", true },
- { "linux-vme.org", true },
- { "linux.cn", true },
- { "linux.conf.au", true },
- { "linux.farm", true },
- { "linux.fi", true },
- { "linux.im", true },
- { "linux.pizza", true },
- { "linux3.org", true },
- { "linuxadictos.com", true },
- { "linuxbabe.com", true },
- { "linuxbg.eu", true },
- { "linuxbierwanderung.com", true },
- { "linuxchick.se", true },
- { "linuxcommand.ru", true },
- { "linuxdays.cz", true },
- { "linuxforum.ch", true },
- { "linuxgiggle.com", true },
- { "linuxhilux.com", true },
- { "linuxhostsupport.com", true },
- { "linuxincluded.com", true },
- { "linuxiuvat.de", true },
- { "linuxlounge.net", true },
- { "linuxos.org", true },
- { "linuxsecurity.expert", true },
- { "linx.net", true },
- { "linzgau.de", true },
- { "linzyjx.com", true },
- { "lion7.de", true },
- { "lionlyrics.com", true },
- { "lionsdeal.com", true },
- { "lipacom.ga", true },
- { "lipartydepot.com", true },
- { "lipex.com", true },
- { "lipighor.com", true },
- { "lipighor.xyz", true },
- { "lipoabaltimore.org", true },
- { "lippu1.fi", true },
- { "lipthink.com", true },
- { "liqd.net", true },
- { "liqueur.wiki", true },
- { "liquid.cz", true },
- { "liquidhost.co", true },
- { "liquidinternet.co", true },
- { "liquipedia.net", true },
- { "liress.gq", true },
- { "lirion.de", true },
- { "lirlandais.ch", false },
- { "lirnberger.com", true },
- { "lisadelbo.tk", true },
- { "lisahh-jayne.com", true },
- { "lisamccorrie.com", true },
- { "lisanzauomo.com", true },
- { "lisasc.gq", true },
- { "lisasworkshop.co.uk", true },
- { "lisburnhottubnbounce.co.uk", true },
- { "lisius.ga", true },
- { "liskgdt.net", true },
- { "lislan.org.uk", true },
- { "lisowski-development.com", false },
- { "lissabon.guide", true },
- { "lissajouss.tk", true },
- { "lissauer.com", true },
- { "list-gymnasium.de", true },
- { "listahu.org", true },
- { "listekdo.fr", true },
- { "listen.dk", true },
- { "lister-kirchweg.de", true },
- { "listisima.com", true },
- { "listminut.be", true },
- { "lists.fedoraproject.org", true },
- { "lists.stg.fedoraproject.org", true },
- { "listsothebysrealtyhk.com", true },
- { "listyourinfo.com", true },
- { "litarvan.com", true },
- { "litchidova.nl", true },
- { "litebit.de", true },
- { "litebit.eu", true },
- { "litebit.nl", true },
- { "litebitcdn.eu", true },
- { "litebits.com", true },
- { "litemind.com", false },
- { "literaki123.pl", true },
- { "literarymachin.es", true },
- { "literature-schools.com", true },
- { "litfin.name", true },
- { "lithan.com", true },
- { "lithesalar.se", true },
- { "lithianissaneugeneparts.com", true },
- { "litsovet.com", true },
- { "little-brother.eu", true },
- { "little-cake.com", true },
- { "little-news.gq", true },
- { "littlebestfriend.de", true },
- { "littleblackfish.se", true },
- { "littleboutiqueshop.co.uk", true },
- { "littledev.nl", true },
- { "littleduck.xyz", true },
- { "littlefairy.no", true },
- { "littlefamilyadventure.com", true },
- { "littlegreece.ae", true },
- { "littlelife.co.uk", true },
- { "littlelucifercafe.tk", true },
- { "littlenina.nz", false },
- { "littlenlargeevents.co.uk", true },
- { "littlepigcreek.com.au", true },
- { "littleprincessandmascotparties.co.uk", true },
- { "littleredpenguin.com", true },
- { "littleredsbakeshop.com", true },
- { "littlericket.me", true },
- { "littles.moe", true },
- { "littlescallywagsplay.co.uk", true },
- { "littleswitch.co.jp", true },
- { "littlewatcher.com", true },
- { "littleyokohamakennel.tk", true },
- { "liturgical.net", true },
- { "liturkey.tk", true },
- { "litvideoserver.de", true },
- { "litz.ca", true },
- { "litzenberger.ca", true },
- { "liu0hy.cn", true },
- { "liubliu.co.uk", true },
- { "liudon.org", true },
- { "liuliuya.com.tw", true },
- { "liv3d.stream", true },
- { "livada.fr", true },
- { "live4k.media", false },
- { "live8811.com", true },
- { "live8899.cn", true },
- { "live8899.co", true },
- { "live8899.net", true },
- { "live9922.com", true },
- { "livebandphotos.com", true },
- { "livebetterwith.com", true },
- { "livebythesun.de", true },
- { "livecards.es", true },
- { "livecards.eu", true },
- { "livecards.it", true },
- { "livecchi.cloud", true },
- { "livechat-ag777.com", true },
- { "livedesign.at", true },
- { "livedesign24.de", true },
- { "liveflightapp.com", true },
- { "liveforspeed.se", true },
- { "livehomecams.co.uk", true },
- { "liveint.org", true },
- { "livejasmin.dk", true },
- { "livejh.tk", true },
- { "livekaarten.be", true },
- { "livekaarten.nl", true },
- { "livekarten.at", true },
- { "livekarten.de", true },
- { "livekort.com", true },
- { "livekort.dk", true },
- { "livekort.no", true },
- { "livekort.se", true },
- { "livekortti.com", true },
- { "livekortti.fi", true },
- { "livela.jp", true },
- { "livelifewithintent.com", true },
- { "livelink.tk", true },
- { "livelondon.fr", true },
- { "livenewsrussia.tk", true },
- { "livepaperhelp.com", true },
- { "liveregistratie.nl", true },
- { "liverider.co.jp", true },
- { "livesheep.com", true },
- { "liveslides.com", true },
- { "livesure.com", true },
- { "livetopknigi.gq", true },
- { "livetoride.co.za", true },
- { "livfcshop.com", true },
- { "livi.co", true },
- { "livi.co.uk", true },
- { "livi.fr", true },
- { "living-space.co.nz", true },
- { "living-with-outlook-2010.com", true },
- { "living.digital", true },
- { "living.video", true },
- { "living24.de", true },
- { "livingafrugallife.com", true },
- { "livingforreal.com", true },
- { "livinginhimalone.com", true },
- { "livingkingsinc.net", true },
- { "livingspace.co.nz", true },
- { "livingword.in", true },
- { "livingworduk.org", true },
- { "livive.com", true },
- { "livogeva.dk", true },
- { "livresetmanuscrits.com", true },
- { "livv88.com", true },
- { "lixtick.com", true },
- { "liyang.pro", false },
- { "liz-fry.com", true },
- { "liz.ee", true },
- { "lizardsystems.com", true },
- { "lizheng.de", true },
- { "lizhi.io", true },
- { "lizmooredestinationweddings.com", true },
- { "liztattoo.se", true },
- { "lizzaran.io", true },
- { "lizzian.uk", true },
- { "lizzwood.com", true },
- { "lizzythepooch.com", true },
- { "ljason.cn", true },
- { "ljc.ro", true },
- { "ljoonal.xyz", true },
- { "ljs.io", true },
- { "ljskatt.no", true },
- { "lk-hardware.cz", true },
- { "lk1.bid", true },
- { "lkellar.org", true },
- { "lknw.de", true },
- { "lkw-servis.sk", true },
- { "ll.gr", true },
- { "ll8807.com", true },
- { "ll8819.com", true },
- { "llamasweet.tech", true },
- { "llandudnochristmasfayre.co.uk", true },
- { "llbcpa.com", true },
- { "lldy88.com", true },
- { "llemoz.com", true },
- { "llgj888.com", true },
- { "llgw8.com", true },
- { "llm-guide.com", true },
- { "llnl.gov", true },
- { "lloyd-day.me", true },
- { "llslb.com", false },
- { "llw0x.com", true },
- { "lm-landscapes.co.uk", true },
- { "lm-pumpen.de", false },
- { "lm1628.com", true },
- { "lm228.cn", true },
- { "lm228.com", true },
- { "lm338.cn", true },
- { "lm338.com", true },
- { "lmbyrne.co.uk", true },
- { "lmbyrne.com", true },
- { "lmddgtfy.net", true },
- { "lmintlcx.com", true },
- { "lmmi.nl", true },
- { "lmmtfy.io", true },
- { "lms-luch.ru", true },
- { "lmsptfy.com", true },
- { "lmtls.me", true },
- { "lmtm.eu", true },
- { "lmvsci.gov", true },
- { "lng-17.org", true },
- { "lnhequipmentltd.com", true },
- { "lnhydy.cn", true },
- { "lnrsoft.ddns.net", true },
- { "load-ev.de", true },
- { "loader.us.com", true },
- { "loadlow.me", true },
- { "loadwallet.com", true },
- { "loanaway.ca", true },
- { "loanmatch.sg", true },
- { "loansharkpro.com", true },
- { "loanstreet.nl", true },
- { "lob-assets-staging.com", true },
- { "lob-assets.com", true },
- { "lob-staging.com", true },
- { "lob.com", true },
- { "lobivia.de", true },
- { "lobosdomain.hopto.org", true },
- { "lobsangstudio.com", true },
- { "lobstr.co", true },
- { "loca-voiture.fr", true },
- { "locabir.cf", true },
- { "local360.net", true },
- { "localbandz.com", true },
- { "localbitcoins.com", true },
- { "localblitz.com", true },
- { "localblock.co.za", true },
- { "localbouncycastle.com", true },
- { "localcryptopremium.com", true },
- { "locald.at", true },
- { "localdecor.com.br", true },
- { "localethereum.com", true },
- { "localhorst.duckdns.org", true },
- { "localhost.cat", true },
- { "localhost.ee", true },
- { "localnet.site", true },
- { "localpov.com", true },
- { "localsearch.homes", true },
- { "localseo.repair", true },
- { "localseorepair.co", true },
- { "localseorepair.design", true },
- { "localseorepair.digital", true },
- { "localseorepair.life", true },
- { "localseorepair.ltd", true },
- { "localseorepair.net", true },
- { "localseorepair.network", true },
- { "localseorepair.rocks", true },
- { "localseorepair.services", true },
- { "localseorepair.world", true },
- { "localspot.pl", true },
- { "localtownhouses.ga", true },
- { "locapos.com", true },
- { "location-appartement-dakar.com", true },
- { "locatorplus.gov", true },
- { "locauxrama.fr", true },
- { "lock.me", true },
- { "lock23.ca", true },
- { "lockaby.org", true },
- { "locker.email", true },
- { "locker.plus", true },
- { "lockerroomstories.com", true },
- { "locklock.com.br", true },
- { "locklockbrasil.com.br", true },
- { "lockme.at", true },
- { "lockme.ch", true },
- { "lockme.de", true },
- { "lockme.pl", true },
- { "locknlock.com.br", true },
- { "locknlockbrasil.com.br", true },
- { "lockoutgroup.com", true },
- { "lockpick.nl", true },
- { "lockpicks.se", true },
- { "lockr.jp", true },
- { "locksmith--richmond.com", true },
- { "locksmith--sanantoniotx.com", true },
- { "locksmith-pasadenatx.com", true },
- { "locksmith-sanantonio-tx.com", true },
- { "locksmith-springtx.com", true },
- { "locksmithbalchsprings.com", true },
- { "locksmithballito.com", true },
- { "locksmithbluff.co.za", true },
- { "locksmithdearborn.com", true },
- { "locksmithdickinson-tx.com", true },
- { "locksmithdriftwood.com", true },
- { "locksmithdrippingspringstx.com", true },
- { "locksmithedmonds.com", true },
- { "locksmithforcarshoustontx.com", true },
- { "locksmithfourways24-7.co.za", true },
- { "locksmithfriendswoodtexas.com", true },
- { "locksmithgarland-tx.com", true },
- { "locksmithgrapevinetx.com", true },
- { "locksmithhumbletx.com", true },
- { "locksmithindurban.co.za", true },
- { "locksmithlakewaytx.com", true },
- { "locksmithlivoniami.com", true },
- { "locksmithmadisonheights.com", true },
- { "locksmithmesquitetexas.com", true },
- { "locksmithmesquitetx.com", true },
- { "locksmithmissouricity.com", true },
- { "locksmithresidentialspringtx.com", true },
- { "locksmithsammamishwa.com", true },
- { "locksmithsbuda.com", true },
- { "locksmithscottsdaleaz.com", true },
- { "locksmithseattleco.com", true },
- { "locksmithservice-cypress.com", true },
- { "locksmithservice-humble.com", true },
- { "locksmithsinsanantoniotx.com", true },
- { "locksmithspring.com", true },
- { "locksmithspringtx.com", true },
- { "locksmithssanmarcostx.com", true },
- { "locksmithstaffordtx.com", true },
- { "locksmithswestville.com", true },
- { "locksmiththewoodlands.com", true },
- { "lockwoodchristmastreefarm.com", true },
- { "locomore.com", true },
- { "locomotionds.com", true },
- { "locomotive.net.br", true },
- { "locoserver.net", true },
- { "locurimunca.co", true },
- { "locus-dashboard.com", true },
- { "locusmap.eu", true },
- { "lodash.com", false },
- { "loddeke.eu", true },
- { "lodewijkict.nl", true },
- { "lodus.io", true },
- { "loenshotel.de", true },
- { "loew.de", true },
- { "loforo.com", true },
- { "lofstad.se", true },
- { "lofttravel.com", true },
- { "logactiond.org", true },
- { "loganmarchione.com", true },
- { "loganparkneighborhood.org", true },
- { "logbot.info", true },
- { "logement-saisonnier.com", true },
- { "logentries.com", false },
- { "logexplorer.net", true },
- { "logfile.at", true },
- { "logfile.ch", true },
- { "logicaccountingsolutions.com", true },
- { "logical-invest.com", true },
- { "logicdream.tk", true },
- { "logiciel-entreprise-seurann.fr", true },
- { "logicio.ch", false },
- { "logicio.de", false },
- { "logicio.net", false },
- { "logicne-hise.si", true },
- { "logico.ar", true },
- { "logicoma.com", true },
- { "login.corp.google.com", true },
- { "login.gov", false },
- { "login.launchpad.net", true },
- { "login.ooo", true },
- { "login.raiffeisen.ch", true },
- { "login.sapo.pt", true },
- { "login.ubuntu.com", true },
- { "login.yahoo.com", false },
- { "logitel.de", true },
- { "logo-vogtland.de", true },
- { "logoglo.com", true },
- { "logojoes.net", true },
- { "logopedistalanni.it", true },
- { "logophiliapress.com", true },
- { "logopoeia.com", true },
- { "logostock.jp", true },
- { "logtalk.org", true },
- { "logtalk.pt", true },
- { "logtywardrobe.com", true },
- { "logue.be", true },
- { "logze.nl", true },
- { "lohanaflores.com.br", true },
- { "loheprobado.com", true },
- { "lohmeier.it", true },
- { "lohmeyer.cc", true },
- { "lohr.net", true },
- { "lohvinau.by", true },
- { "loic.gr", true },
- { "loichot.ch", false },
- { "loisircreatif.net", true },
- { "lojadamimo.com.br", true },
- { "lojadanidrea.com.br", true },
- { "lojadarenda.com.br", true },
- { "lojadewhisky.com.br", true },
- { "lojadoarcomprimido.com.br", true },
- { "lojadoprazer.com.br", true },
- { "lojadosomautomotivo.com.br", true },
- { "lojafazendoarte.com.br", true },
- { "lojafilipaper.com.br", true },
- { "lojamagicalx.com", true },
- { "lojamascate.com.br", true },
- { "lojamoleco.com.br", true },
- { "lojaprojetoagua.com.br", true },
- { "lojas25online.com.br", true },
- { "lojaterrazul.com.br", true },
- { "lojavisamed.com.br", true },
- { "lojix.com", false },
- { "lojj.pt", true },
- { "lok.space", true },
- { "lokaal.org", true },
- { "lokal-speisen.de", true },
- { "lokalna.net", true },
- { "loker.id", true },
- { "loket.nl", true },
- { "lolas-vip.com", true },
- { "lolaseuropeancafe.com", true },
- { "lolcloud.ru", true },
- { "lolcow.farm", true },
- { "loli.com", true },
- { "loli.net", true },
- { "loli.pet", true },
- { "loli.ski", true },
- { "loli.today", true },
- { "loli.tube", true },
- { "loli.world", true },
- { "lolibrary.org", true },
- { "lolic.xyz", true },
- { "lolicon.eu", true },
- { "lolivpn.com", true },
- { "lolkot.ru", true },
- { "lolly.cc", true },
- { "lolnames.gg", true },
- { "lolpatrol.de", true },
- { "lolpatrol.wtf", true },
- { "loma.ml", false },
- { "lomaem-nsk.ru", true },
- { "lomayko.ml", true },
- { "lombri-agro.com", true },
- { "lomerhouse.com", true },
- { "lommeregneren.dk", true },
- { "lommyfleet.com", true },
- { "lon-so.com", true },
- { "lona.io", true },
- { "lonasdigital.com", true },
- { "lonavla.tk", true },
- { "london-mafia.tk", true },
- { "london-transfers.com", true },
- { "london.dating", true },
- { "londongallery.net", true },
- { "londongynaecologist.co", true },
- { "londonindustry.it", true },
- { "londonkeyholdingcompany.co.uk", true },
- { "londonlegaltranslation.ae", true },
- { "londonpropertymatch.com", true },
- { "londonseedcentre.co.uk", true },
- { "londontaxipr.com", true },
- { "lonelyhaoss.com", true },
- { "lonelypawn.com", true },
- { "lonelystoner.design", false },
- { "lonelytweets.com", true },
- { "lonesomecosmonaut.com", true },
- { "lonestarlandandcommercial.com", true },
- { "long-journey.com", true },
- { "long008.com", true },
- { "long116.com", true },
- { "long139.com", true },
- { "long18.cc", true },
- { "long226.com", true },
- { "long228.com", true },
- { "long266.com", true },
- { "long288.com", true },
- { "long388.com", true },
- { "long510.com", true },
- { "long510.net", true },
- { "long566.net", true },
- { "long788.com", true },
- { "long8039.com", true },
- { "long8097.com", true },
- { "long918.com", true },
- { "long988.com", true },
- { "longboard-vergleich.com", true },
- { "longboat.io", true },
- { "longhaircareforum.com", true },
- { "longhorn-imports.com", true },
- { "longhorn.id.au", true },
- { "longma168.cn", true },
- { "longma168.com", true },
- { "longstride.net", true },
- { "longtermcare.gov", true },
- { "lonniec.com", true },
- { "lonniemason.net", true },
- { "lonny.ee", true },
- { "lonwan.ru", true },
- { "look.co.il", true },
- { "lookagain.co.uk", true },
- { "lookasik.eu", true },
- { "lookastic.co.uk", true },
- { "lookastic.com", true },
- { "lookastic.de", true },
- { "lookastic.es", true },
- { "lookastic.fr", true },
- { "lookastic.mx", true },
- { "lookastic.ru", true },
- { "lookatmysco.re", true },
- { "lookbetweenthelines.com", true },
- { "looker.wang", false },
- { "lookgadgets.com", true },
- { "lookingstores.fr", true },
- { "lookup-dns.net", true },
- { "lookzook.com", true },
- { "loonylatke.com", true },
- { "loopback.kr", true },
- { "loopstart.org", true },
- { "looseleafsecurity.com", true },
- { "loothole.com", true },
- { "lopes.com.br", true },
- { "loposchokk.com", true },
- { "loqu8.com", true },
- { "loquo.com", true },
- { "loqyu.com", true },
- { "lord.sh", true },
- { "lordjevington.co.uk", true },
- { "lore-seeker.cards", true },
- { "loremipsum.info", true },
- { "lorenadumitrascu.ro", true },
- { "lorenz-hundler.co", true },
- { "lorenzocampagna.myqnapcloud.com", true },
- { "lorenzocompeticion.com", true },
- { "loreofthenorth.com", true },
- { "loreofthenorth.nl", true },
- { "loricozengeller.com", true },
- { "lorimullins.com", true },
- { "lorisfnotary.com", true },
- { "loritaboegl.de", true },
- { "losangelestown.com", true },
- { "losaucas.tk", true },
- { "loshogares.mx", true },
- { "losingweight.coach", true },
- { "losreyesdeldescanso.com.ar", true },
- { "loss.no", true },
- { "lossaicos.tk", true },
- { "lost.host", true },
- { "lost.report", true },
- { "lostandfound.mu", true },
- { "lostinlegends.com", true },
- { "lostinweb.eu", true },
- { "lostkeys.co.uk", true },
- { "lostsandal.com", true },
- { "lostsandal.io", true },
- { "lostserver.com", true },
- { "lostwithdan.com", true },
- { "lotc.cc", true },
- { "lothlorien.ca", false },
- { "lotl.ru", true },
- { "lotn.mobi", true },
- { "lotn.nl", true },
- { "lotnonline.com", true },
- { "lotnonline.nl", true },
- { "lotro-wiki.com", true },
- { "lotsofbargains.com", true },
- { "lottoland.pt", true },
- { "lottospielen24.org", false },
- { "lotw.de", true },
- { "lotz.li", true },
- { "lou-castelet.com", true },
- { "lou.ist", true },
- { "lou.lt", true },
- { "louange-reconvilier.ch", false },
- { "loucanfixit.com", true },
- { "louerunhacker.fr", true },
- { "louisdefunes.tk", true },
- { "louisemisellinteriors.co.uk", true },
- { "louisvillecarguys.com", true },
- { "louisvillefibroids.com", true },
- { "louiza.tk", true },
- { "loune.net", true },
- { "loungecafe.net", true },
- { "loungecafe.org", true },
- { "loungepapillon.com", true },
- { "louremedi.fr", true },
- { "love-books.ga", true },
- { "love-spells-tarot.com", true },
- { "love4musik.com", true },
- { "love4taylor.me", true },
- { "lovebeingsexy.co.uk", true },
- { "lovebigisland.com", true },
- { "loveismystyle.tk", true },
- { "loveisourweapon.com", true },
- { "lovelive.tools", true },
- { "lovelo.store", true },
- { "lovelovenavi.jp", true },
- { "lovemanagementaccounts.co.uk", true },
- { "lovemen.cc", true },
- { "lovemomiji.com", true },
- { "lovemybubbles.com", true },
- { "lovenwishes.com", true },
- { "loveph.one", true },
- { "lover-bg.com", true },
- { "loverepublic.ru", true },
- { "loverngifts.com", true },
- { "lovesmagical.com", false },
- { "lovesupremefestival.com", true },
- { "loveweddingphotosandfilm.co.uk", true },
- { "loveysa.ch", false },
- { "lovg.ren", true },
- { "lovingbody.yoga", true },
- { "lovingearth.co", true },
- { "lovingthermo.com", true },
- { "low-diets.com", true },
- { "lowbidders.com", true },
- { "lowcost.to", true },
- { "lowcostvehicleinsurance.com", true },
- { "lowcostwire.com.au", true },
- { "lowerpricefinder.com", true },
- { "lowestpriceremovals.com.au", true },
- { "lowmagnitude.com", true },
- { "lowsec.space", true },
- { "lowsidetna.com", true },
- { "lowson.ca", true },
- { "loyaltyondemand.club", true },
- { "loyaltyondemand.eu", true },
- { "loyisa.cn", true },
- { "lp-support.nl", true },
- { "lpt-nebreziny.eu", true },
- { "lq.hr", true },
- { "lrdo.net", true },
- { "lriese.ch", true },
- { "lrs.lt", true },
- { "lrssystems.com", true },
- { "lrumeq.com", true },
- { "ls-alarm.de", true },
- { "ls-mapping-team.de", true },
- { "ls-modcompany.com", true },
- { "lsbricks.com", true },
- { "lsc-dillingen.de", true },
- { "lsc.gov", true },
- { "lsh1688.com", true },
- { "lshiy.com", true },
- { "lsiq.io", true },
- { "lsl.eu", true },
- { "lsmentor.com", true },
- { "lsmpx.com", true },
- { "lspdonline.gq", true },
- { "lsquo.com", true },
- { "lsscreens.de", true },
- { "lstlx.com", true },
- { "lsy.cn", true },
- { "lsys.ac", true },
- { "lt.search.yahoo.com", false },
- { "ltaake.com", true },
- { "ltcwaterwijk.nl", true },
- { "ltecode.com", true },
- { "ltheinrich.de", true },
- { "ltib.com.au", true },
- { "ltlec.cn", true },
- { "ltlec.com", true },
- { "ltls.org", true },
- { "ltn-tom-morel.fr", true },
- { "ltprtz.co.uk", true },
- { "lts-tec.de", true },
- { "ltservers.net", true },
- { "lu.search.yahoo.com", false },
- { "luan.ma", true },
- { "luav.org", true },
- { "lubar.me", true },
- { "lubbockyounglawyers.org", true },
- { "lubot.net", true },
- { "luc-oberson.ch", false },
- { "luca-steeb.com", true },
- { "lucacastelnuovo.nl", true },
- { "lucafontana.net", true },
- { "lucafrancesca.me", true },
- { "lucasbergen.ca", true },
- { "lucasdamasceno.com", true },
- { "lucasem.com", true },
- { "lucasgymnastics.com", true },
- { "lucasit.com", true },
- { "lucaslarson.net", true },
- { "lucassoler.com.ar", false },
- { "luce.life", true },
- { "luchscheider.de", false },
- { "luchthavenmaastricht.nl", true },
- { "lucid-light.de", true },
- { "lucid-reality.ch", true },
- { "lucidframeworks.com", true },
- { "lucidlight.de", true },
- { "lucidlink.com", true },
- { "lucie-parizkova.cz", true },
- { "lucie.jp", true },
- { "lucielavickova.com", true },
- { "lucille-thomas.fr", true },
- { "lucky-frog.co.uk", true },
- { "luckycastles.co.uk", true },
- { "luckyfrog.hk", true },
- { "luckystorevn.com", true },
- { "luclu7.fr", true },
- { "luctam.com", true },
- { "lucybles.com", true },
- { "lucyhancock.tech", true },
- { "lucymontebello-arte.com", true },
- { "lucyparsonslabs.com", true },
- { "lucz.co", true },
- { "luda.me", true },
- { "ludek.biz", true },
- { "ludikovsky.name", true },
- { "ludofantasy.fr", true },
- { "ludogue.net", true },
- { "ludolust.tk", true },
- { "ludothek-burgdorf.ch", true },
- { "ludovic-frank.fr", true },
- { "ludovic-muller.fr", true },
- { "ludum-polus.xyz", true },
- { "ludwig.im", true },
- { "ludwiggrill.de", true },
- { "ludwigjohnson.se", true },
- { "ludwigpro.net", true },
- { "luedeke-bremen.eu", true },
- { "lueersen.homedns.org", true },
- { "luehne.de", true },
- { "luelistan.net", true },
- { "luenwarneke.com", true },
- { "luera1959.de", true },
- { "lueurexterne-audiovisuel.com", true },
- { "lueurexterne.com", true },
- { "luffyhair.com", true },
- { "luftbild-siegerland.de", true },
- { "luftreiniger.biz", true },
- { "lugbb.org", true },
- { "luginbuehl.be", true },
- { "luginbuehl.eu", true },
- { "lugui.in", true },
- { "luisa-birkner.de", true },
- { "luiscapelo.info", true },
- { "luisfariasgrupo.com", true },
- { "luismaier.de", true },
- { "luissotodesign.com", true },
- { "luisyr.com", true },
- { "luizkowalski.net", true },
- { "luizlopes.com", false },
- { "luk.earth", true },
- { "lukas-gorr.de", true },
- { "lukas-meixner.com", true },
- { "lukas-schauer.de", true },
- { "lukas.im", true },
- { "lukas2511.de", true },
- { "lukasberan.com", true },
- { "lukasberan.cz", true },
- { "lukasfunk.com", true },
- { "lukasrod.cz", true },
- { "lukasschauer.de", true },
- { "lukasschick.de", false },
- { "lukaszuk.net", true },
- { "lukaszuk.pl", true },
- { "lukaszwojcik.com", true },
- { "lukaszwojcik.net", true },
- { "luke.ch", true },
- { "luke6887.me", true },
- { "lukeistschuld.de", true },
- { "lukem.net", true },
- { "lukeng.net", true },
- { "lukesbouncycastlehire.com", true },
- { "lukestebbing.com", true },
- { "lukezweb.tk", true },
- { "lukin.ga", true },
- { "lukull-pizza.de", true },
- { "lulua.pl", true },
- { "lumbercartel.ca", true },
- { "lumen.sh", true },
- { "lumenbrowser.com", true },
- { "lumi.pw", true },
- { "lumierewithinspirato.com", true },
- { "luminaire.fr", true },
- { "luminary.pl", true },
- { "lumitop.com", true },
- { "lumiwellnessshop.com", true },
- { "lumminary.com", true },
- { "lumomongoose.com", true },
- { "lunakit.org", true },
- { "lunalove.de", true },
- { "lunanova.moe", true },
- { "lunapps.com", true },
- { "lunar6.ch", false },
- { "lunarflake.com", true },
- { "lunarlog.com", true },
- { "lunarshark.com", true },
- { "lunarsoft.net", true },
- { "lunartail.nl", true },
- { "lunasqu.ee", true },
- { "lunazacharias.com", true },
- { "lunchbunch.me", true },
- { "lundberghealthadvocates.com", true },
- { "lune-indigo.ch", false },
- { "lunepieters.co.za", true },
- { "lunidea.ch", false },
- { "lunidea.com", false },
- { "lunis.net", true },
- { "lunite.net", true },
- { "lunix.io", true },
- { "luoe.me", true },
- { "luoh.cc", true },
- { "luoh.me", true },
- { "luongvu.com", true },
- { "luowu.cc", true },
- { "lupa.cz", true },
- { "lupecode.com", true },
- { "lupinencyclopedia.com", true },
- { "lupinenorthamerica.com", true },
- { "lushan.me", true },
- { "lusitom.com", true },
- { "luso-livros.net", true },
- { "lustin.fr", true },
- { "lustrum.ch", true },
- { "luteijn.biz", true },
- { "luteijn.cloud", true },
- { "luteijn.email", true },
- { "luteijn.pro", true },
- { "luthierunatespalermo.com", true },
- { "lutoma.org", true },
- { "luu.moe", true },
- { "luukdebruincv.nl", true },
- { "luukklene.nl", true },
- { "luukuton.fi", true },
- { "luuppi.fi", true },
- { "luv-scent.com", true },
- { "luv.asn.au", true },
- { "luv2watchmycam.com", true },
- { "luvare.com", true },
- { "luvbridal.com.au", true },
- { "luvhacks.com", true },
- { "luvplay.co.uk", true },
- { "luvscent.com", true },
- { "lux-house.tk", true },
- { "luxecalendar.com", true },
- { "luxhome.tk", true },
- { "luxsci.com", true },
- { "luxur.is", true },
- { "luxurydistribution.cz", true },
- { "luxurynsight.net", false },
- { "luxuryweddingsindonesia.com", true },
- { "luxusnivoucher.cz", true },
- { "luxusnyvoucher.sk", true },
- { "luxvacuos.net", true },
- { "luyckx.net", true },
- { "luzat.com", true },
- { "luzfaltex.com", true },
- { "lv.search.yahoo.com", false },
- { "lv0.it", true },
- { "lvcshu.com", true },
- { "lvftw.com", true },
- { "lvguitars.com", true },
- { "lvmoo.com", true },
- { "lvrsystems.com", true },
- { "lvtrafficticketguy.com", true },
- { "lw-addons.net", true },
- { "lwl12.com", true },
- { "lwsl.ink", true },
- { "lx-blog.cn", true },
- { "lxai.net", true },
- { "lxd.cc", true },
- { "lxx4380.com", true },
- { "lyax.be", true },
- { "lycly.me", true },
- { "lydudlejning.net", true },
- { "lyfebotanicals.com", true },
- { "lyftrideestimate.com", true },
- { "lykai.ca", true },
- { "lykope.com", true },
- { "lymia.moe", true },
- { "lyna.ml", true },
- { "lynero.dk", true },
- { "lyness.io", true },
- { "lyness.uk", true },
- { "lyngvaer.no", true },
- { "lynnellneri.com", true },
- { "lynnlaytonnissanparts.com", true },
- { "lynsec.com", true },
- { "lynthium.com", true },
- { "lynx.nl", true },
- { "lynxbroker.de", true },
- { "lynxpro.nl", true },
- { "lyon-interactive.com", true },
- { "lyon-synergie.com", true },
- { "lyonslawlink.com", true },
- { "lyrical-nonsense.com", true },
- { "lyricfm.ie", true },
- { "lyriksidan.ga", true },
- { "lys.ch", true },
- { "lysbed.com", true },
- { "lyscnd.com", true },
- { "lyst.co.uk", true },
- { "lyuda.tk", true },
- { "lyuly.com", true },
- { "lyx.dk", true },
- { "lzcreation.com", true },
- { "lzh.one", true },
- { "lzwc.nl", true },
- { "m-16.ml", true },
- { "m-22.com", true },
- { "m-beshr.tk", true },
- { "m-chemical.com.hk", true },
- { "m-cont.cz", true },
- { "m-gh.info", true },
- { "m-idea.jp", true },
- { "m-kleinert.de", true },
- { "m-kugpn.ru", true },
- { "m-mail.fr", true },
- { "m-monitor.pl", true },
- { "m-net.de", true },
- { "m-orthodontic.com", true },
- { "m-ses.fr", true },
- { "m-team.cc", true },
- { "m.facebook.com", true },
- { "m.mail.ru", true },
- { "m.me", true },
- { "m0t0k1ch1.com", true },
- { "m132.eu", true },
- { "m134.eu", true },
- { "m1gun.tk", true },
- { "m23cal.eu", true },
- { "m2epro.com", true },
- { "m2h-fiscaliste.fr", true },
- { "m2il.co", true },
- { "m2os.com", true },
- { "m2tm.fr", true },
- { "m36533.com", true },
- { "m36594.com", true },
- { "m3windowsanddoors.com", true },
- { "m4all.gr", true },
- { "m4g.ru", true },
- { "m51365.com", true },
- { "m6pub.fr", true },
- { "m81818.com", true },
- { "m8593.com", true },
- { "ma-eir.nl", true },
- { "ma-maison-container.fr", true },
- { "ma-maison-ossature-bois.fr", true },
- { "ma-ze-linux.tk", true },
- { "ma2t.com", true },
- { "maartenderaedemaeker.be", true },
- { "maartenvandekamp.nl", true },
- { "maatwerkzorgcoaching.nl", true },
- { "maaya.jp", true },
- { "maayogashram.com", true },
- { "mabankonline.com", true },
- { "mabulledu.net", true },
- { "mac-i-tea.ch", false },
- { "mac-service-stockholm.se", true },
- { "mac-servicen.se", true },
- { "mac-support.nu", true },
- { "mac-support.se", true },
- { "mac-world.pl", true },
- { "mac.biz.tr", true },
- { "mac.osaka.jp", true },
- { "macangus-wainwright.com", true },
- { "macaos.com", true },
- { "macappstudio.com", true },
- { "macaroonshindig.tk", true },
- { "macaws.org", true },
- { "macbook.es", true },
- { "macedonian-hotels.com", true },
- { "macedonian-hotels.com.mk", true },
- { "macedonian-hotels.mk", true },
- { "maceinturecuir.com", true },
- { "maces-net.de", true },
- { "macgeneral.de", false },
- { "macgenius.com", true },
- { "mach-politik.ch", true },
- { "macha.cloud", true },
- { "macha.love", true },
- { "machbach.com", true },
- { "machetewp.com", true },
- { "machidaclip.com", true },
- { "machikka.com", false },
- { "machine.email", true },
- { "machinetransport.com", true },
- { "machon.biz", true },
- { "macht-elektro.de", true },
- { "machtweb.de", true },
- { "machu-picchu.nl", true },
- { "macil.tech", true },
- { "macji-raj.si", true },
- { "macker.io", true },
- { "mackeysack.com", true },
- { "macksproductions.in", true },
- { "maclemon.at", true },
- { "macleod.io", true },
- { "macnemo.de", true },
- { "macnetwork.eu", false },
- { "macnetwork.fr", false },
- { "macnetwork.net", false },
- { "macnugget.org", true },
- { "maco.org.uk", true },
- { "macon.de", true },
- { "maconnerie-dcs.ch", true },
- { "macpress.com.br", true },
- { "macreosolutions.com", true },
- { "macros.co.jp", true },
- { "macroseo.tk", true },
- { "macsupportnacka.se", true },
- { "macsupportstockholm.se", true },
- { "mactools.com.co", true },
- { "madae.nl", true },
- { "madamegarage.nl", true },
- { "madars.org", false },
- { "madbin.com", true },
- { "madbouncycastles.co.uk", true },
- { "maddi.biz", true },
- { "maddistonevangelical.co.uk", true },
- { "maddreefer.com", true },
- { "made-in-earth.co.jp", true },
- { "made-to-usb.com", true },
- { "madebydusk.com", true },
- { "madebyshore.com", true },
- { "madeinolive.com", true },
- { "madeinrussia.com", true },
- { "madeinstudio3.com", true },
- { "madeira.gov.pt", true },
- { "madeitwor.se", true },
- { "madeloc.com", true },
- { "mademoe.com", true },
- { "mademoiselledemargaux.com", true },
- { "mader.jp", true },
- { "madewithopendata.org", true },
- { "madgeandpaul.com", true },
- { "madgech.com", true },
- { "madgeisawesome.com", true },
- { "madin.ru", true },
- { "madirc.net", true },
- { "madisoncountyhelps.com", true },
- { "madisonent-facialplasticsurgery.com", true },
- { "madisonsquarerealestate.com", true },
- { "madmar.ee", true },
- { "madmax-store.gr", true },
- { "madoka.nu", true },
- { "madpsy.uk", true },
- { "madrants.net", true },
- { "madreluna.it", true },
- { "madreshoy.com", true },
- { "madridagency.com", true },
- { "madridartcollection.com", true },
- { "madscientistwebdesign.com", true },
- { "madskauts.tk", true },
- { "madsstorm.dk", true },
- { "madtec.de", true },
- { "maduradas.info", true },
- { "maduradas.net", true },
- { "maedchenflohmarkt.at", true },
- { "maedchenflohmarkt.de", true },
- { "maekha.in.th", true },
- { "maeln.com", true },
- { "maelstrom-fury.eu", true },
- { "maelstrom.ninja", true },
- { "maeplasticsurgery.com", true },
- { "maesinox.be", true },
- { "maewongaming.tk", true },
- { "maff.co.uk", true },
- { "maff.scot", true },
- { "mafia.network", true },
- { "mafiaforum.de", true },
- { "mafiapenguin.club", true },
- { "mafiasi.de", true },
- { "magaconnection.com", true },
- { "magasindejouets.com", true },
- { "magasinsalledebain.be", true },
- { "magasinsalledebain.fr", true },
- { "magasinsalledebains.be", true },
- { "magasinsalledebains.fr", true },
- { "magasinsenfrance.com", true },
- { "magazilla.ga", true },
- { "magazin3513.com", true },
- { "magazinecards.ga", true },
- { "magazinedotreino.com.br", true },
- { "magdic.eu", true },
- { "magebit.com", true },
- { "magebrawl.com", true },
- { "magenda.sk", true },
- { "magentaize.net", true },
- { "magentapinkinteriors.co.uk", true },
- { "magentoeesti.eu", true },
- { "magepro.fr", true },
- { "magestionfinanciere.com", true },
- { "magewell.nl", true },
- { "maggie.com", true },
- { "maggot.cf", true },
- { "magi-cake.com", true },
- { "magic-cards.info", true },
- { "magic-cheerleading.tk", true },
- { "magic-photo-events.fr", true },
- { "magical-secrets.com", true },
- { "magical.rocks", true },
- { "magicball.co", true },
- { "magicbeanschool.com", true },
- { "magicbroccoli.de", true },
- { "magiccards.info", true },
- { "magicdaysomagh.co.uk", true },
- { "magicdlp.com", true },
- { "magicjudges.org", true },
- { "magiclen.org", true },
- { "magicnethosting.com", true },
- { "magicroom.it", true },
- { "magicsms.pl", true },
- { "magicspaceninjapirates.de", true },
- { "magicstay.com", true },
- { "magictable.com", true },
- { "magicvodi.at", true },
- { "magisternegi.tk", true },
- { "magnacarebroker.com", true },
- { "magnate.co", true },
- { "magnatronic.com.br", true },
- { "magnes.priv.pl", true },
- { "magnesium-biomed.ch", true },
- { "magnesy-neodymowe.com.pl", true },
- { "magnesy-neodymowe.pl", true },
- { "magnesy-tanio.net", true },
- { "magnesy.de", true },
- { "magnesy.net.pl", true },
- { "magnesy.priv.pl", true },
- { "magnetgaming.com", true },
- { "magneticattraction.com.au", true },
- { "magnetoscopio.tk", true },
- { "magnetpass.uk", true },
- { "magnets.jp", true },
- { "magnificatwellnesscenter.com", true },
- { "magnificentdata.com", true },
- { "magniflood.com", true },
- { "magnoliastrong.com", true },
- { "magnumwallet.co", true },
- { "magnunbaterias.com.br", true },
- { "magonote-nk.com", true },
- { "magravsitalia.com", true },
- { "magu.kz", true },
- { "maguire.email", true },
- { "maguire.tk", true },
- { "magwin.co.uk", true },
- { "magyarepitok.hu", true },
- { "mahadulmuneer.org", true },
- { "mahalux.com", true },
- { "mahalux.cz", true },
- { "mahatmayoga.org", true },
- { "mahawi.sk", true },
- { "mahjong-navi.com", true },
- { "mahjong.org", true },
- { "mahjongrush.com", true },
- { "mahler.io", true },
- { "mahrer.net", true },
- { "maiaimobiliare.ro", true },
- { "maichun.info", true },
- { "maidenliput.fi", true },
- { "maidoty.net", true },
- { "maiebanatulfruncea.com", true },
- { "maiet.net", true },
- { "maijia800.com", true },
- { "maikolfish.it", true },
- { "maikoloc.com", true },
- { "mail-de.jp", true },
- { "mail-rotter.de", true },
- { "mail-settings.google.com", true },
- { "mail.com", true },
- { "mail.de", true },
- { "mail.google.com", true },
- { "mail.storage", true },
- { "mail.yahoo.com", false },
- { "mail180.com", true },
- { "mail4you.in", true },
- { "mailbox.mg", true },
- { "mailbox.org", true },
- { "mailbro.de", true },
- { "mailer.site", true },
- { "mailfence.com", true },
- { "mailflank.com", true },
- { "mailhardener.com", true },
- { "mailinabox.email", true },
- { "mailinaitor.tk", true },
- { "mailingproduct.tk", true },
- { "mailjunky.de", true },
- { "maillady-susume.com", true },
- { "mailmag.net", true },
- { "mailmaster.tk", true },
- { "mailnara.co.kr", true },
- { "mailsend.ml", true },
- { "mailstart.ga", true },
- { "mailtelligent.com", true },
- { "mailto.space", true },
- { "mailtobiz.tk", true },
- { "mailtrap.io", true },
- { "mailum.org", false },
- { "mailwala.tk", true },
- { "mailxpress.ga", true },
- { "main-freedom.ru", true },
- { "mainechiro.com", true },
- { "mainframeserver.space", true },
- { "mainhattan-handwerker.de", true },
- { "mainlined.org", true },
- { "mainone.net", true },
- { "mainquest.org", true },
- { "mainston.com", true },
- { "maintenance-traceur-hp.fr", true },
- { "mainzelmaennchen.net", true },
- { "maioresemelhores.com", true },
- { "mairie-sornay.fr", true },
- { "maisan.best", true },
- { "maiscelular.com.br", true },
- { "maisgasolina.com", true },
- { "maison-haimard.fr", true },
- { "maisondoree.be", true },
- { "maisonpaulmier.fr", true },
- { "maispa.com", true },
- { "maisretorno.com", true },
- { "maisvitaminas.com.br", true },
- { "maisy.io", true },
- { "maitheme.com", true },
- { "maiti.info", true },
- { "maitrise-orthopedique.com", true },
- { "majahoidja.ee", true },
- { "majaweb.cz", true },
- { "majemedia.com", false },
- { "majesnix.org", true },
- { "majid.info", true },
- { "majkassab.com", true },
- { "majkassab.net", true },
- { "majkassab.org", true },
- { "majkl.me", true },
- { "majkl.xyz", true },
- { "majkl578.cz", true },
- { "majkyto.cz", true },
- { "majlovesreg.one", true },
- { "majolka.com", true },
- { "majorpaintingco.com", true },
- { "majorpussycum.com", true },
- { "makaleci.com", true },
- { "makalu.me", true },
- { "make-your-own-song.com", true },
- { "makeaboldmove.com", true },
- { "makechanges.com.au", true },
- { "makedin.net", true },
- { "makefoodrecipes.com", true },
- { "makejusticework.org.uk", true },
- { "makenaiyo-fx.com", true },
- { "makerdao.com", true },
- { "makermiles.com", true },
- { "makermiles.net", true },
- { "makermiles.org", true },
- { "makersatwork.com", true },
- { "maketheneighborsjealous.com", true },
- { "makeurbiz.com", true },
- { "maki-chan.de", true },
- { "makinen.ru", true },
- { "makita-online.kz", true },
- { "makkusu.photo", true },
- { "makkyon.com", true },
- { "maklerinfo.biz", true },
- { "makos.jp", true },
- { "makowitz.cz", true },
- { "maktoob.search.yahoo.com", false },
- { "maku.edu.tr", true },
- { "malachiteauth.com", true },
- { "maladie-autoimmune.fr", true },
- { "malariaadvice.gq", true },
- { "malash.me", false },
- { "malasuk.com", true },
- { "malaysia.search.yahoo.com", false },
- { "malaysian.dating", true },
- { "malaysianews.ml", true },
- { "maldives.cx", true },
- { "malediven.biz", true },
- { "malenaamatomd.com", true },
- { "malenyflorist.com.au", true },
- { "maleperformancepills.com", true },
- { "maler-marschalleck.de", true },
- { "malermeister-haussmann.de", true },
- { "malezan.com", true },
- { "maliar.fr", true },
- { "malibu-electric.com", true },
- { "malibuelectrical.com", true },
- { "malibuexteriorlighting.com", true },
- { "malibumodas.com.br", true },
- { "malik.id", true },
- { "malikussa.id", true },
- { "malikussaid.com", true },
- { "malikzinad.com", true },
- { "malinaclub.com", true },
- { "malinheadview.ie", true },
- { "malkoun.com", true },
- { "mall.cz", true },
- { "mall.hr", true },
- { "mall.hu", true },
- { "mall.pl", true },
- { "mall.sk", true },
- { "mallach.net", true },
- { "mallonline.com.br", true },
- { "malnex.de", true },
- { "malond.com", true },
- { "malta-firma.com", true },
- { "maltasite.tk", true },
- { "maltaultrastifo.tk", true },
- { "malte-kiefer.de", true },
- { "malufs.com.br", true },
- { "malvertise.xyz", true },
- { "malware.watch", true },
- { "malwareinvestigator.gov", true },
- { "malwarekillers.com", true },
- { "malwaretips.com", true },
- { "malyshata.com", true },
- { "malysvet.net", false },
- { "mamabepo.com", true },
- { "mamadoma.com.ua", true },
- { "mamaisondefamille.info", true },
- { "mamamoet.ru", true },
- { "mamanakormit.tk", true },
- { "mamanecesitaungintonic.com", true },
- { "mamasorganizedchaos.com", true },
- { "mambas.cn", true },
- { "mame.cl", true },
- { "mammals.net", true },
- { "mammaw.com", true },
- { "mammooc.org", true },
- { "mammothlakesmls.net", true },
- { "mamospienas.lt", true },
- { "mamot.fr", false },
- { "mamsds.com", true },
- { "mamtapark.tk", true },
- { "mamuko.nl", true },
- { "man-stuff.co.uk", true },
- { "man3s.jp", false },
- { "mana.ee", true },
- { "manach.net", true },
- { "manage.cm", true },
- { "manage4all.de", true },
- { "manageathome.co.uk", true },
- { "managedhosting.de", true },
- { "managedservicesraleighnc.com", true },
- { "management-companie.ro", true },
- { "managementboek.nl", true },
- { "managementfeedback.com", true },
- { "managementforstartups.com", true },
- { "manageprefs.com", true },
- { "manageprojects.com", false },
- { "manager-efficacement.com", true },
- { "manager.linode.com", false },
- { "managewp.org", true },
- { "manantialdevida1450.com", true },
- { "manatees.com.au", true },
- { "manatees.net", true },
- { "manawill.jp", true },
- { "manawithtea.com", true },
- { "manchestercleaner.co.uk", true },
- { "mancrates.com", true },
- { "mandcbouncycastlehire.co.uk", true },
- { "mandela-effect-wiki.tk", true },
- { "mandilabeachhotel.com", true },
- { "mandynamic.gr", true },
- { "maneggio.milano.it", true },
- { "manelli.fr", true },
- { "maneql.co.jp", true },
- { "maneql.info", true },
- { "manesht.ir", true },
- { "manfredgruber.net", true },
- { "manfredi.io", true },
- { "manfredimatteo.com", true },
- { "manfredschafer.ch", true },
- { "mangabank.net", true },
- { "mangabank.org", true },
- { "mangaboxes.ml", true },
- { "mangahigh.com", true },
- { "mangareactor.tk", true },
- { "mangaristica.com", false },
- { "mangaworld.gq", true },
- { "mangotwoke.co.uk", true },
- { "manhattanchoralensemble.org", true },
- { "manhole.club", true },
- { "manhuagui.com", true },
- { "mani.tw", true },
- { "manicbouncycastles.co.uk", true },
- { "manicode.com", true },
- { "manicur-salon.tk", true },
- { "manicuradegel.com", true },
- { "manicuradegel.es", true },
- { "manilaprinciples.org", true },
- { "maniorpedi.com", true },
- { "maniosglass.gr", true },
- { "manipil.ch", true },
- { "manipurmatka.net", false },
- { "manitaggarwal.com", true },
- { "manja-und-martin.de", true },
- { "manjaro.ru", true },
- { "mankans.com", false },
- { "mankomarketing.com", true },
- { "manmeetgill.com", true },
- { "manneguiden.no", true },
- { "mannheimbloggt.tk", true },
- { "manns-solutions.co.uk", true },
- { "mannschafft.ch", true },
- { "manoirdecontres.com", true },
- { "manonamission.de", true },
- { "manonandre-avocat.fr", true },
- { "manoro.de", true },
- { "mansarda-life.net", true },
- { "mansdell.net", true },
- { "mansfeld.pl", true },
- { "manshatech.com", true },
- { "manski.net", true },
- { "mansora.net", true },
- { "mantabiofuel.com", true },
- { "mantachiepharmacy.com", true },
- { "mantenimientoimpresoras.com", true },
- { "manti.by", true },
- { "mantor.org", false },
- { "mantul.top", true },
- { "manualidadeson.com", true },
- { "manuall.co.uk", true },
- { "manuall.cz", true },
- { "manuall.de", true },
- { "manuall.dk", true },
- { "manuall.es", true },
- { "manuall.fi", true },
- { "manuall.fr", true },
- { "manuall.info.tr", true },
- { "manuall.it", true },
- { "manuall.jp", true },
- { "manuall.kr", true },
- { "manuall.no", true },
- { "manuall.pl", true },
- { "manuall.pt", true },
- { "manuall.ro", true },
- { "manuall.se", true },
- { "manualscollection.com", true },
- { "manuel-herrmann.de", true },
- { "manuel-schefczyk.de", true },
- { "manuel7espejo.com", true },
- { "manuelguerra.pt", true },
- { "manueli.de", true },
- { "manuelpinto.in", true },
- { "manufacturing.gov", false },
- { "manufacturinginmexico.org", true },
- { "manufacturingusa.com", false },
- { "manuscripteditorial.com", true },
- { "manuscriptlink.com", true },
- { "manusiasosial.tk", true },
- { "manutd.org.np", true },
- { "manuth.life", true },
- { "manwish.cn", true },
- { "manwithavan.co.uk", true },
- { "manylots.ru", true },
- { "maoi.re", true },
- { "maomihz.com", true },
- { "maone.net", true },
- { "maorx.cn", true },
- { "maosensanguentadasdejesus.net", true },
- { "maowtm.org", true },
- { "maozedong.red", true },
- { "map-patho.com", true },
- { "map4erfurt.de", true },
- { "map4jena.de", true },
- { "mapasmundi.com.br", true },
- { "mapblender.com", true },
- { "mapchange.org", true },
- { "mapeo.io", true },
- { "maplebgm.cc", true },
- { "maplegate.info", true },
- { "mapletime.com", true },
- { "mapresidentielle.fr", true },
- { "mapstack.org", true },
- { "maquinariaspesadas.org", true },
- { "maquinariastitan.com", true },
- { "maquinasdecoserplus.com", true },
- { "mar-eco.no", true },
- { "marabumadrid.com", false },
- { "marabunta.io", true },
- { "marakovits.net", true },
- { "marble.com", true },
- { "marblemosaics.ga", true },
- { "marbogardenlidkoping.se", true },
- { "marbree.eu", true },
- { "marbrerie-segur.fr", true },
- { "marc-beninca.fr", true },
- { "marc-hammer.de", true },
- { "marc-hoffrichter.de", true },
- { "marc-schlagenhauf.de", true },
- { "marcaixala.me", true },
- { "marcanhoury.com", true },
- { "marcberndtgen.de", true },
- { "marcceleiro.com", true },
- { "marceau.ovh", true },
- { "marcel-preuss.de", true },
- { "marcel-veronetzki.de", true },
- { "marcel-waldvogel.ch", true },
- { "marcelabarrozo.tk", true },
- { "marcelinofranchini.com", true },
- { "marcelinofranchini.eu", true },
- { "marcelinofranchini.info", true },
- { "marcelinofranchini.net", true },
- { "marcelinofranchini.org", true },
- { "marceljeannin.com", true },
- { "marcelkooiman.com", true },
- { "marcelofernandez.tk", true },
- { "marcelpreuss.de", true },
- { "marcelsiegert.com", true },
- { "marcelwaldvogel.ch", true },
- { "marcelwiedemeier.com", true },
- { "marcelwolf.coach", true },
- { "marcgoertz.de", true },
- { "marche-contre-monsanto.ch", false },
- { "marcheslep.org.uk", true },
- { "marchhappy.tech", false },
- { "marchukov.com", true },
- { "marcianoandtopazio.com", true },
- { "marclay.co.uk", true },
- { "marco-burmeister.de", true },
- { "marco-goltz.de", true },
- { "marco-hegenberg.net", true },
- { "marco-polo-reisen.com", true },
- { "marcobicca.com", true },
- { "marcocasoni.com", true },
- { "marcoherten.com", true },
- { "marcoklomp.nl", true },
- { "marcoslater.com", true },
- { "marcotics.nl", true },
- { "marcus.pw", true },
- { "marcusds.ca", true },
- { "marcuskoh.com", true },
- { "marcusstafford.com", true },
- { "mareamoda.com", true },
- { "marechal-company.com", true },
- { "marek.su", true },
- { "marex.host", true },
- { "margagriesser.de", true },
- { "margatroid.com", true },
- { "margaux-perrin.com", true },
- { "margays.de", true },
- { "margecommunication.com", false },
- { "margo-co.ch", false },
- { "margolis.gq", true },
- { "margotlondon.co.uk", true },
- { "marguerite-maison.fr", true },
- { "mariafernanda.com.br", true },
- { "mariage-protestant.ch", true },
- { "mariagealamontagne.com", true },
- { "mariahandnasty.com", true },
- { "mariaheidemann.nl", true },
- { "marianatherapy.com", true },
- { "marianelaisashi.com", true },
- { "marianhoenscheid.de", true },
- { "mariannenan.nl", true },
- { "mariannethijssen.nl", true },
- { "mariapietropola.com", true },
- { "mariasbonitas.com", true },
- { "mariasilverbutterfly.com", true },
- { "mariatash.com", true },
- { "maridonlaw.com", true },
- { "marie-elisabeth.dk", true },
- { "marie-pettenbeck-schule.de", true },
- { "mariemiramont.fr", true },
- { "mariendistel-tee.de", true },
- { "mariereichl.cz", true },
- { "marietrap.ch", true },
- { "marijnfidder.nl", true },
- { "marijuanajobscannabiscareers.com", true },
- { "marikafranke.de", true },
- { "marilsnijders.nl", true },
- { "marilynhartman.com", true },
- { "marilynmartin.com.au", true },
- { "marilynstreats.com", true },
- { "marin-business-center.ch", false },
- { "marin-dom.ru", false },
- { "marin-tullet.com", false },
- { "marina-tsvetaeva.ml", true },
- { "marinazarza.es", true },
- { "marinbusinesscenter.ch", false },
- { "marinela.com.mx", false },
- { "marinelausa.com", false },
- { "marinershousecalstock.com", true },
- { "marines-shop.com", false },
- { "maringalazer.com.br", true },
- { "marioabela.com", true },
- { "mariogeckler.de", false },
- { "mariposah.ch", true },
- { "marisamorby.com", false },
- { "marisasitaliankitchen.com", true },
- { "mariskavankasbergen.nl", true },
- { "maritim.go.id", false },
- { "maritimeseafoods.com", true },
- { "mariushubatschek.de", true },
- { "marivalemotions.com", true },
- { "mariviolin.com", true },
- { "marjeta-gurtner.ch", true },
- { "marjoleindens.be", true },
- { "marjonruns.nl", true },
- { "marjorie-wiki.de", true },
- { "marjoriecarvalho.com.br", true },
- { "mark-dietzer.de", true },
- { "mark-semmler.de", true },
- { "mark1998.com", true },
- { "markaconnor.com", true },
- { "markandev.com", true },
- { "markandrosalind.co.uk", true },
- { "markantoffice.com", true },
- { "markbiesheuvel.nl", true },
- { "markdain.net", true },
- { "markel.com.es", true },
- { "markepps.com", true },
- { "market-vanna.ru", true },
- { "market.android.com", true },
- { "marketespace.fr", false },
- { "marketgrid.ml", true },
- { "marketgrid.tk", true },
- { "marketindex.com.au", true },
- { "marketing-2.de", true },
- { "marketing1-0-1.com", true },
- { "marketingbrandingnews.com", true },
- { "marketingbrandingnews.net", true },
- { "marketingco.nl", true },
- { "marketingconverts.com", true },
- { "marketinggenerators.nl", false },
- { "marketingpalace.tk", true },
- { "marketingromania.ro", true },
- { "marketingtrendnews.com", true },
- { "marketingvirtuales.com", true },
- { "marketizare.ro", true },
- { "marketking.ga", true },
- { "marketplacestrategy.com", true },
- { "marketsearch.ga", true },
- { "marketvalue.gq", true },
- { "markfordelegate.com", true },
- { "markhaehnel.de", true },
- { "markhoodphoto.com", true },
- { "markhoodwrites.com", true },
- { "markido.com", true },
- { "markiewicz.online", true },
- { "markitzeroday.com", true },
- { "markkirkforillinois.com", true },
- { "markkirkforsenate.com", true },
- { "marklauman.ca", true },
- { "markri.nl", true },
- { "markridgwell.co.uk", true },
- { "markridgwell.com", true },
- { "markridgwellcom.appspot.com", true },
- { "markshroyer.com", true },
- { "marksm.it", true },
- { "marksmit.co", true },
- { "markspres.org", true },
- { "markstevenkirk.com", true },
- { "markstickley.co.uk", true },
- { "markt-heiligenstadt.de", false },
- { "marktcontact.com", true },
- { "marktguru.at", true },
- { "marktguru.de", true },
- { "marktissink.nl", true },
- { "markup-ua.com", true },
- { "markus-blog.de", false },
- { "markus-keppeler.de", true },
- { "markus-musiker.de", true },
- { "markus-ullmann.de", true },
- { "markusehrlicher.de", true },
- { "markusjanzen.de", true },
- { "markusjochim.de", true },
- { "markuskeppeler.de", true },
- { "markuskeppeler.no-ip.biz", true },
- { "markusueberallassetmanagement.de", true },
- { "markusueberallconsulting.de", true },
- { "markusweimar.de", true },
- { "markxpdesign.ga", true },
- { "marl.fr", true },
- { "marloncommunications.com", true },
- { "marlonlosurdopictures.com", true },
- { "marlosoft.net", true },
- { "marmista.roma.it", true },
- { "marmolesromero.com", true },
- { "marmotte.love", true },
- { "marocemploi.co", true },
- { "marolu.one", true },
- { "maroquineriepirlot.be", true },
- { "maroussia.tk", true },
- { "marpa-wohnen.de", true },
- { "marqueswines.co.uk", true },
- { "marrai.de", true },
- { "marriage-shrine.jp", true },
- { "marrickvilleapartments.com.au", true },
- { "marron-dietrecipe.com", true },
- { "mars.army", true },
- { "mars.navy", true },
- { "marsanvet.com", true },
- { "marsbleapp.com", true },
- { "marseillekiteclub.com", true },
- { "marshallscastles.com", true },
- { "marshallwilson.com", true },
- { "marshmallow.co", true },
- { "marshmallow.com", true },
- { "marsikelektro.cz", true },
- { "martasibaja.com", true },
- { "martel-innovate.com", true },
- { "martelange.ovh", true },
- { "martellosecurity.com", true },
- { "marten-buer.de", true },
- { "martensmxservice.nl", true },
- { "martensson.io", false },
- { "martialarts-wels.at", true },
- { "martian.community", true },
- { "martian.tk", true },
- { "martide.com", true },
- { "martijn.site", true },
- { "martijnhielema.nl", true },
- { "martijnvanderzande.nl", true },
- { "martin-loewer.de", true },
- { "martin-renze.de", true },
- { "martin-weil.de", true },
- { "martin.vet", true },
- { "martinbaileyphotography.com", true },
- { "martinboerhof.nl", true },
- { "martincernac.cz", true },
- { "martindoe.pl", true },
- { "martine.nu", true },
- { "martinelias.cz", true },
- { "martineweitweg.de", true },
- { "martinfranc.eu", false },
- { "martinhaunschmid.com", true },
- { "martinho.tk", true },
- { "martinkus.eu", true },
- { "martinmuc.de", true },
- { "martinreed.net", true },
- { "martinvillalba.com", true },
- { "martinvillalba.com.ar", true },
- { "martinvillalba.info", true },
- { "martinvillalba.net", true },
- { "martinvillalba.org", true },
- { "martonmihaly.hu", true },
- { "marufmusic.tk", true },
- { "maruhoi.com", true },
- { "marvaco.ga", true },
- { "marvell.cat", true },
- { "marvelmoviemarathon.com", true },
- { "marvelousdesigners.com", true },
- { "marvin.rocks", true },
- { "marvinschopf.com", true },
- { "marvman.me", true },
- { "marvnet.design", true },
- { "marvnet.email", true },
- { "marvnetdigital.com", true },
- { "marvnetdigital.de", true },
- { "marvnetforum.com", true },
- { "marxists.org", true },
- { "marycliffpress.com", true },
- { "maryeclark.com", true },
- { "maryeileen90.party", true },
- { "maryhaze.net", true },
- { "maryjaneroach.com", true },
- { "maryjruggles.com", true },
- { "marykatrinaphotography.com", true },
- { "marylandbasementandcrawlspacewaterproofing.com", true },
- { "maryluzturismo.co", true },
- { "marzio.co.za", true },
- { "masalaband.tk", true },
- { "masarik.sh", true },
- { "masarn.com", true },
- { "masautonomo.com", true },
- { "masaze-hanka.cz", true },
- { "mascosolutions.com", true },
- { "masdemariette.com", true },
- { "masdemexico.com", true },
- { "masdillah.com", true },
- { "maseni.com", true },
- { "maservant.net", true },
- { "mashandco.it", true },
- { "mashandco.tv", true },
- { "mashcape.com", true },
- { "masiniunelte.store.ro", true },
- { "maskim.fr", true },
- { "maskinkultur.com", true },
- { "maslin.io", true },
- { "masqueradecostumes.tk", true },
- { "masrur.org", true },
- { "mass.pt", true },
- { "massaboutique.com", true },
- { "massage-colleges.com", true },
- { "massage-vitalite.fr", true },
- { "massage4u.net", true },
- { "massagecoolangatta.com.au", true },
- { "massagecupping.com", true },
- { "massagetainha-hanoi.com", true },
- { "massconsultores.com", true },
- { "masse.org", true },
- { "massflix.com", true },
- { "massfone.com", true },
- { "masshiro.blog", true },
- { "masshvac.com", true },
- { "massotherapeutique.com", true },
- { "masstercurssos.com", true },
- { "masta.ch", false },
- { "mastdi.eu", true },
- { "mastellone.us", true },
- { "mastepinnelaand.nl", true },
- { "master-net.org", true },
- { "master-tmb.ru", true },
- { "mastercardpac.com", true },
- { "masterdemolitioninc.com", true },
- { "masterdigitale.com", true },
- { "mastermindcesar.com", true },
- { "masterofallscience.com", true },
- { "masterofbytes.ch", true },
- { "masterpassword.org", true },
- { "masterpc.co.uk", true },
- { "masterplc.com", true },
- { "masterplumber.coach", true },
- { "masters.black", true },
- { "mastersadistancia.com", true },
- { "mastersthesiswriting.com", true },
- { "masterstuff.de", true },
- { "masterton.com.au", true },
- { "masterwayhealth.com", true },
- { "mastodon.at", true },
- { "mastodon.host", true },
- { "mastodon.top", true },
- { "mastodon.uno", true },
- { "mat.tt", true },
- { "matanz.de", true },
- { "matatabimix.com", true },
- { "matatall.com", true },
- { "match.audio", true },
- { "matchatea24.com", true },
- { "matchboxdesigngroup.com", true },
- { "matchlessdentist.com", true },
- { "matchmadeinstubton.com", true },
- { "matchupmagic.com", true },
- { "mateiko.by", true },
- { "matejgroma.com", true },
- { "matejstrnad.cz", true },
- { "matel.org", true },
- { "matematikkulubu.tk", true },
- { "matematyka.wiki", true },
- { "materassi.roma.it", true },
- { "materiaischiquinho.com.br", true },
- { "material-ui.com", true },
- { "material-world-fuyouhin.com", true },
- { "materialism.com", true },
- { "materialyinzynierskie.pl", true },
- { "maternalsafety.org", true },
- { "mateuszmajewski.com", true },
- { "math-coaching.com", true },
- { "math-colleges.com", true },
- { "math.hamburg", true },
- { "mathematik.rocks", true },
- { "matheo-schefczyk.de", true },
- { "mathers.ovh", true },
- { "mathes.berlin", true },
- { "mathhire.org", true },
- { "mathias-frank.com", true },
- { "mathiasbynens.be", true },
- { "mathiasgarbe.de", true },
- { "mathiaswagner.org", true },
- { "mathieuguimond.com", true },
- { "mathieui.net", true },
- { "mathis.com.tr", true },
- { "mathiteia.com", true },
- { "maths.network", true },
- { "mathspace.co", true },
- { "mathys.io", true },
- { "matijakolaric.com", true },
- { "matildajaneclothing.com", true },
- { "matipl.pl", true },
- { "matjaz.it", true },
- { "matlss.com", true },
- { "matocmedia.com", true },
- { "matok.me.uk", true },
- { "matome-surume.com", true },
- { "matomeathena.com", true },
- { "matoutepetiteboutique.com", true },
- { "matratzentester.com", true },
- { "matridiana.com", true },
- { "matrieux.dk", true },
- { "matrimonio.com.pe", true },
- { "matrixglobalsms.com", true },
- { "matrixim.cc", true },
- { "matrixmedia.ro", true },
- { "matrixreq.com", true },
- { "matsu-semi.com", true },
- { "matt-brooks.com", true },
- { "matt-royal.com.cy", true },
- { "matt-royal.gr", true },
- { "matt.re", true },
- { "matt.wiki", true },
- { "mattadams.info", true },
- { "mattandyana.com", true },
- { "mattari-app.com", true },
- { "mattatoio.eu", true },
- { "mattberryman.org", true },
- { "mattbsg.xyz", true },
- { "mattcarr.net", false },
- { "mattcoles.io", true },
- { "mattconstruction.com", true },
- { "mattcorp.com", true },
- { "matteobrenci.com", true },
- { "matteomarescotti.it", true },
- { "mattersource.com", true },
- { "mattferderer.com", true },
- { "mattfin.ch", true },
- { "mattforster.ca", true },
- { "matthew-cash.com", true },
- { "matthewfells.com", true },
- { "matthewgrow.com", true },
- { "matthewj.ca", true },
- { "matthewkenny.co.uk", true },
- { "matthewljiang.com", true },
- { "matthewohare.com", true },
- { "matthewsaeger.com", true },
- { "matthewsetter.com", true },
- { "matthey.nl", true },
- { "matthi.coffee", true },
- { "matthi3u.xyz", true },
- { "matthias-muenzner.de", true },
- { "matthias-wimmer.de", true },
- { "matthiasbeck.com", true },
- { "matthiasmueller.me", true },
- { "matthiasott.com", true },
- { "matthiasschwab.de", true },
- { "matthieuchedidweb.tk", true },
- { "matthieuschlosser.fr", true },
- { "mattiascibien.net", false },
- { "mattknight.io", true },
- { "mattlaks.com", true },
- { "mattli.us", true },
- { "mattmccutchen.net", true },
- { "mattmcshane.com", true },
- { "mattonline.me", true },
- { "mattprojects.com", true },
- { "mattrude.com", true },
- { "matts.wiki", true },
- { "matts.world", true },
- { "mattwservices.co.uk", true },
- { "matuslab.net", true },
- { "matviet.vn", true },
- { "matway.com", true },
- { "matway.net", true },
- { "matze.co", true },
- { "mauerwerk.online", true },
- { "mauerwerkstag.info", true },
- { "mauiticketsforless.com", true },
- { "mauldincookfence.com", true },
- { "mauracher.cc", true },
- { "mauran.me", false },
- { "maureencsmith.ca", true },
- { "maurice-walker.com", false },
- { "mauricedb.nl", true },
- { "mauriceje.ga", true },
- { "mauricioquadradoconsultor.com.br", true },
- { "mauricioquadradocontador.com.br", true },
- { "maurovacca.com", true },
- { "maury-moteurs.com", true },
- { "maveeranpasupathi.tk", true },
- { "mavenclinic.com", true },
- { "mavensecurity.com", true },
- { "maveris.com", true },
- { "mawo.olkusz.pl", true },
- { "mawrex.tech", true },
- { "max-apk.com", true },
- { "max-it.fr", true },
- { "max-moeglich.de", true },
- { "max-phone.com", true },
- { "max-went.pl", true },
- { "max.gov", true },
- { "max0365.com", true },
- { "max11365.com", true },
- { "max1365.com", true },
- { "max22365.com", true },
- { "max2365.com", true },
- { "max33365.com", true },
- { "max3365.com", true },
- { "max4365.com", true },
- { "max44365.com", true },
- { "max5365.com", true },
- { "max55365.com", true },
- { "max6365.com", true },
- { "max66365.com", true },
- { "max7365.com", true },
- { "max77365.com", true },
- { "max8365.com", true },
- { "max88365.com", true },
- { "max9365.com", true },
- { "maxb.fm", true },
- { "maxbeenen.de", true },
- { "maxbruckner.de", true },
- { "maxbruckner.org", true },
- { "maxchan.info", true },
- { "maxclean.ml", true },
- { "maxdg.be", true },
- { "maxedgymequipment.com", true },
- { "maxh.me.uk", true },
- { "maximdeboiserie.be", true },
- { "maximdens.be", true },
- { "maximeferon.fr", true },
- { "maximilian-graf.de", true },
- { "maximilian-greger.com", true },
- { "maximilian-staedtler.de", true },
- { "maximiliankaul.de", true },
- { "maximiliankrieg.de", true },
- { "maximind.sg", true },
- { "maxims-travel.com", true },
- { "maxinesbydennees.com", true },
- { "maxipcalls.com", false },
- { "maxiservak.ml", true },
- { "maxisito.it", true },
- { "maxkaul.de", true },
- { "maxlaumeister.com", true },
- { "maxmatthe.ws", true },
- { "maxmilton.com", true },
- { "maxmind.com", true },
- { "maxmobiles.ru", true },
- { "maxmoda.eu", true },
- { "maxmuen.de", true },
- { "maxp.info", true },
- { "maxpl0it.com", true },
- { "maxr1998.de", true },
- { "maxrandolph.com", true },
- { "maxrider.tk", true },
- { "maxtruxa.com", true },
- { "maxundlara.at", true },
- { "maxwaellenergie.de", true },
- { "maxwell-english.co.jp", false },
- { "maxwellmoore.co.uk", true },
- { "may24.tw", true },
- { "mayaimplant.com", true },
- { "mayavi.co.in", true },
- { "maydex.info", true },
- { "maydn.org", true },
- { "mayhutmuibep.com", true },
- { "mayito.tk", true },
- { "mayomarquees.com", true },
- { "mayopartyhire.com", true },
- { "mayorcahill.com", true },
- { "mayper.net", true },
- { "maypolevilla.co.uk", true },
- { "mayre-idol.tk", true },
- { "mayrhofer.eu.org", false },
- { "maysambotros.tk", true },
- { "maytalkhao.com", true },
- { "maywoodpark.com", true },
- { "mazavto.ml", true },
- { "mazda-mps.de", true },
- { "mazda-thermote.com", false },
- { "mazda626.net", true },
- { "mazdaofgermantown.com", true },
- { "maze.design", false },
- { "maze.fr", false },
- { "mazenjobs.com", true },
- { "mazi.io", true },
- { "mazloum.adv.br", true },
- { "mazzotta.me", true },
- { "mb-demo.net", true },
- { "mb-server.de", true },
- { "mb300sd.com", true },
- { "mb300sd.net", true },
- { "mbaasy.com", true },
- { "mbadika.org", true },
- { "mbaestlein.de", true },
- { "mbainflatables.co.uk", true },
- { "mbanq.com", true },
- { "mbardot.com", true },
- { "mbasic.facebook.com", false },
- { "mbc.asn.au", true },
- { "mbcars.be", false },
- { "mbclegal.org", true },
- { "mbda.gov", false },
- { "mbed.com", true },
- { "mbedcloud.com", true },
- { "mbeo.ch", false },
- { "mbetb73.com", true },
- { "mbinf.de", false },
- { "mbk.net.pl", true },
- { "mblankhorst.nl", true },
- { "mble.mg", true },
- { "mbr-net.de", true },
- { "mbrooks.info", true },
- { "mbs-journey.com", true },
- { "mbsr-barmstedt.de", true },
- { "mbsync4supply.com", true },
- { "mbte365.com", true },
- { "mburaks.com", true },
- { "mburns.duckdns.org", true },
- { "mc-jobs.net", true },
- { "mc-web.se", true },
- { "mcatnnlo.org", true },
- { "mcblain.com", true },
- { "mccannbristol.co.uk", true },
- { "mcconciergerie.com", true },
- { "mccoolesredlioninn.com", true },
- { "mccordsvillelocksmith.com", true },
- { "mccrackon.com", true },
- { "mcculloughjchris.com", true },
- { "mcdona1d.me", true },
- { "mcdonalds.be", true },
- { "mcduff.ga", true },
- { "mce.eu", true },
- { "mce.nyc", true },
- { "mce55.eu", true },
- { "mcea-hld.jp", true },
- { "mceconferencecentre.eu", true },
- { "mcfarlow.sk", true },
- { "mcfedries.com", true },
- { "mcfi.mu", true },
- { "mcfx.us", true },
- { "mcgaccountancy.co.uk", true },
- { "mcgovernance.com", true },
- { "mchel.net", true },
- { "mchost.no", true },
- { "mchristopher.com", true },
- { "mcinterface.de", true },
- { "mcivor.me", true },
- { "mcjars.com", true },
- { "mckay-bednar.net", true },
- { "mckendry.com", true },
- { "mckendry.consulting", true },
- { "mckernan.in", false },
- { "mckinley.school", true },
- { "mcl.de", false },
- { "mcl.gg", true },
- { "mclawyers.com.au", true },
- { "mclinflatables.co.uk", true },
- { "mclmotors.co.uk", true },
- { "mclouds.ru", true },
- { "mcmillansedationdentistry.com", false },
- { "mcmillanskiclub.com.au", true },
- { "mcneill.io", true },
- { "mcnext.net", true },
- { "mcon.se", true },
- { "mcpaoffice.com", true },
- { "mcpebox.com", true },
- { "mcplayman.de", true },
- { "mcrn.jp", true },
- { "mcsinflatables.co.uk", true },
- { "mcsports.es", true },
- { "mcsrvstat.us", true },
- { "mctitan.net", true },
- { "mctools.org", true },
- { "mcuexchange.com", true },
- { "mcukhost.co.uk", true },
- { "mcuuid.net", true },
- { "mcversions.net", true },
- { "mcwrapper.com", true },
- { "mcynews.com", true },
- { "mcyukon.com", true },
- { "md-clinica.com.ua", true },
- { "md10lc8.com", true },
- { "md11lc8.com", true },
- { "md12lc8.com", true },
- { "md13lc8.com", true },
- { "md15lc8.com", true },
- { "md16lc8.com", true },
- { "md17lc8.com", true },
- { "md19lc8.com", true },
- { "md1lc8.com", true },
- { "md21lc8.com", true },
- { "md24lc8.com", true },
- { "md33lc8.com", true },
- { "md34lc8.com", true },
- { "md35lc8.com", true },
- { "md38lc8.com", true },
- { "md43lc8.com", true },
- { "md44lc8.com", true },
- { "md45lc8.com", true },
- { "md46lc8.com", true },
- { "md52lc8.com", true },
- { "md56lc8.com", true },
- { "md5file.com", true },
- { "md5hashing.net", true },
- { "md5lc8.com", true },
- { "md8lc8.com", true },
- { "md9lc8.com", true },
- { "mdaemon.de", true },
- { "mdbug.de", true },
- { "mdcghana.org", true },
- { "mdclass.id", true },
- { "mdconnect.asia", true },
- { "mdek.at", true },
- { "mdewendt.de", true },
- { "mdf-bis.com", false },
- { "mdi-wolfsburg.de", true },
- { "mdihi.com", true },
- { "mdir.tk", true },
- { "mdiv.pl", true },
- { "mdkhorshedalam.com", true },
- { "mdkr.nl", true },
- { "mdlayher.com", true },
- { "mdma.net", true },
- { "mdmed.clinic", true },
- { "mdosch.de", true },
- { "mdpraha.cz", true },
- { "mdrsp.de", true },
- { "mdrthmcs.io", true },
- { "mdsave.com", true },
- { "mdtorelli.it", true },
- { "mdx.no", true },
- { "mdxdave.de", true },
- { "mdxn.org", true },
- { "mdzservers.com", true },
- { "me-news.tk", true },
- { "me-soft.nl", true },
- { "me.net.nz", true },
- { "me7878.com", true },
- { "mealcast.ml", true },
- { "meamod.com", false },
- { "meangirl.club", true },
- { "meany.xyz", true },
- { "meap.xyz", true },
- { "measureyourpenis.today", true },
- { "meat.org.uk", true },
- { "meayne.ddns.net", true },
- { "mebaneattorney.com", true },
- { "mebanesteakhouse.com", true },
- { "mec010.com", true },
- { "mec020.com", true },
- { "mec021.com", true },
- { "mec022.com", true },
- { "mec023.com", true },
- { "mec024.com", true },
- { "mec025.com", true },
- { "mec027.com", true },
- { "mec028.com", true },
- { "mec029.com", true },
- { "mec0310.com", true },
- { "mec0311.com", true },
- { "mec0312.com", true },
- { "mec0313.com", true },
- { "mec0314.com", true },
- { "mec0315.com", true },
- { "mec0316.com", true },
- { "mec0317.com", true },
- { "mec0318.com", true },
- { "mec0319.com", true },
- { "mec0335.com", true },
- { "mec0350.com", true },
- { "mec0351.com", true },
- { "mec0352.com", true },
- { "mec0353.com", true },
- { "mec0354.com", true },
- { "mec0355.com", true },
- { "mec0356.com", true },
- { "mec0357.com", true },
- { "mec0358.com", true },
- { "mec0359.com", true },
- { "mec0370.com", true },
- { "mec0371.com", true },
- { "mec0372.com", true },
- { "mec0373.com", true },
- { "mec0374.com", true },
- { "mec0375.com", true },
- { "mec0376.com", true },
- { "mec0377.com", true },
- { "mec0378.com", true },
- { "mec0379.com", true },
- { "mec0391.com", true },
- { "mec0392.com", true },
- { "mec0393.com", true },
- { "mec0394.com", true },
- { "mec0395.com", true },
- { "mec0396.com", true },
- { "mec0398.com", true },
- { "mec0410.com", true },
- { "mec0411.com", true },
- { "mec0412.com", true },
- { "mec0413.com", true },
- { "mec0414.com", true },
- { "mec0415.com", true },
- { "mec0416.com", true },
- { "mec0419.com", true },
- { "mec0421.com", true },
- { "mec0429.com", true },
- { "mec0431.com", true },
- { "mec0432.com", true },
- { "mec0433.com", true },
- { "mec0434.com", true },
- { "mec0435.com", true },
- { "mec0436.com", true },
- { "mec0437.com", true },
- { "mec0438.com", true },
- { "mec0439.com", true },
- { "mec0440.com", true },
- { "mec0450.com", true },
- { "mec0451.com", true },
- { "mec0452.com", true },
- { "mec0453.com", true },
- { "mec0454.com", true },
- { "mec0455.com", true },
- { "mec0456.com", true },
- { "mec0457.com", true },
- { "mec0458.com", true },
- { "mec0459.com", true },
- { "mec0470.com", true },
- { "mec0471.com", true },
- { "mec0472.com", true },
- { "mec0473.com", true },
- { "mec0474.com", true },
- { "mec0475.com", true },
- { "mec0476.com", true },
- { "mec0477.com", true },
- { "mec0478.com", true },
- { "mec0479.com", true },
- { "mec0482.com", true },
- { "mec0483.com", true },
- { "mec0510.com", true },
- { "mec0511.com", true },
- { "mec0512.com", true },
- { "mec0513.com", true },
- { "mec0514.com", true },
- { "mec0515.com", true },
- { "mec0516.com", true },
- { "mec0517.com", true },
- { "mec0518.com", true },
- { "mec0519.com", true },
- { "mec0523.com", true },
- { "mec0530.com", true },
- { "mec0531.com", true },
- { "mec0532.com", true },
- { "mec0533.com", true },
- { "mec0534.com", true },
- { "mec0535.com", true },
- { "mec0536.com", true },
- { "mec0537.com", true },
- { "mec0538.com", true },
- { "mec0539.com", true },
- { "mec0550.com", true },
- { "mec0551.com", true },
- { "mec0552.com", true },
- { "mec0553.com", true },
- { "mec0554.com", true },
- { "mec0555.com", true },
- { "mec0556.com", true },
- { "mec0557.com", true },
- { "mec0558.com", true },
- { "mec0559.com", true },
- { "mec0561.com", true },
- { "mec0562.com", true },
- { "mec0563.com", true },
- { "mec0564.com", true },
- { "mec0565.com", true },
- { "mec0566.com", true },
- { "mec0570.com", true },
- { "mec0571.com", true },
- { "mec0572.com", true },
- { "mec0573.com", true },
- { "mec0574.com", true },
- { "mec0575.com", true },
- { "mec0576.com", true },
- { "mec0577.com", true },
- { "mec0578.com", true },
- { "mec0579.com", true },
- { "mec0580.com", true },
- { "mec0591.com", true },
- { "mec0592.com", true },
- { "mec0593.com", true },
- { "mec0594.com", true },
- { "mec0595.com", true },
- { "mec0596.com", true },
- { "mec0597.com", true },
- { "mec0598.com", true },
- { "mec0599.com", true },
- { "mec0660.com", true },
- { "mec0661.com", true },
- { "mec0662.com", true },
- { "mec0663.com", true },
- { "mec0691.com", true },
- { "mec0692.com", true },
- { "mec0701.com", true },
- { "mec0710.com", true },
- { "mec0711.com", true },
- { "mec0712.com", true },
- { "mec0713.com", true },
- { "mec0714.com", true },
- { "mec0715.com", true },
- { "mec0716.com", true },
- { "mec0717.com", true },
- { "mec0718.com", true },
- { "mec0719.com", true },
- { "mec0722.com", true },
- { "mec0724.com", true },
- { "mec0728.com", true },
- { "mec0730.com", true },
- { "mec0731.com", true },
- { "mec0732.com", true },
- { "mec0733.com", true },
- { "mec0734.com", true },
- { "mec0735.com", true },
- { "mec0736.com", true },
- { "mec0737.com", true },
- { "mec0738.com", true },
- { "mec0739.com", true },
- { "mec0743.com", true },
- { "mec0744.com", true },
- { "mec0745.com", true },
- { "mec0746.com", true },
- { "mec0751.com", true },
- { "mec0752.com", true },
- { "mec0753.com", true },
- { "mec0754.com", true },
- { "mec0755.com", true },
- { "mec0756.com", true },
- { "mec0757.com", true },
- { "mec0758.com", true },
- { "mec0759.com", true },
- { "mec0760.com", true },
- { "mec0762.com", true },
- { "mec0763.com", true },
- { "mec0765.com", true },
- { "mec0766.com", true },
- { "mec0768.com", true },
- { "mec0769.com", true },
- { "mec0770.com", true },
- { "mec0771.com", true },
- { "mec0772.com", true },
- { "mec0773.com", true },
- { "mec0774.com", true },
- { "mec0775.com", true },
- { "mec0776.com", true },
- { "mec0777.com", true },
- { "mec0778.com", true },
- { "mec0779.com", true },
- { "mec0790.com", true },
- { "mec0791.com", true },
- { "mec0792.com", true },
- { "mec0793.com", true },
- { "mec0794.com", true },
- { "mec0795.com", true },
- { "mec0796.com", true },
- { "mec0797.com", true },
- { "mec0798.com", true },
- { "mec0799.com", true },
- { "mec0810.com", true },
- { "mec0811.com", true },
- { "mec0812.com", true },
- { "mec0813.com", true },
- { "mec0814.com", true },
- { "mec0816.com", true },
- { "mec0817.com", true },
- { "mec0818.com", true },
- { "mec0819.com", true },
- { "mec0826.com", true },
- { "mec0827.com", true },
- { "mec0830.com", true },
- { "mec0831.com", true },
- { "mec0832.com", true },
- { "mec0833.com", true },
- { "mec0834.com", true },
- { "mec0835.com", true },
- { "mec0836.com", true },
- { "mec0837.com", true },
- { "mec0838.com", true },
- { "mec0839.com", true },
- { "mec0840.com", true },
- { "mec0851.com", true },
- { "mec0852.com", true },
- { "mec0853.com", true },
- { "mec0854.com", true },
- { "mec0855.com", true },
- { "mec0856.com", true },
- { "mec0857.com", true },
- { "mec0858.com", true },
- { "mec0859.com", true },
- { "mec0870.com", true },
- { "mec0871.com", true },
- { "mec0872.com", true },
- { "mec0873.com", true },
- { "mec0874.com", true },
- { "mec0875.com", true },
- { "mec0876.com", true },
- { "mec0877.com", true },
- { "mec0878.com", true },
- { "mec0879.com", true },
- { "mec0881.com", true },
- { "mec0883.com", true },
- { "mec0886.com", true },
- { "mec0887.com", true },
- { "mec0888.com", true },
- { "mec0890.com", true },
- { "mec0891.com", true },
- { "mec0898.com", true },
- { "mec0899.com", true },
- { "mec0910.com", true },
- { "mec0911.com", true },
- { "mec0912.com", true },
- { "mec0913.com", true },
- { "mec0914.com", true },
- { "mec0915.com", true },
- { "mec0916.com", true },
- { "mec0917.com", true },
- { "mec0919.com", true },
- { "mec0930.com", true },
- { "mec0931.com", true },
- { "mec0932.com", true },
- { "mec0933.com", true },
- { "mec0934.com", true },
- { "mec0935.com", true },
- { "mec0936.com", true },
- { "mec0937.com", true },
- { "mec0938.com", true },
- { "mec0941.com", true },
- { "mec0943.com", true },
- { "mec0951.com", true },
- { "mec0952.com", true },
- { "mec0953.com", true },
- { "mec0954.com", true },
- { "mec0971.com", true },
- { "mec0972.com", true },
- { "mec0973.com", true },
- { "mec0974.com", true },
- { "mec0975.com", true },
- { "mec0976.com", true },
- { "mec0977.com", true },
- { "mec0991.com", true },
- { "mec222.com", true },
- { "mec333.com", true },
- { "mec444.com", true },
- { "mec555.com", true },
- { "mec825.com", true },
- { "mec888.com", true },
- { "mec999.com", true },
- { "mecanicoautomotriz.org", true },
- { "mecaniquemondor.com", true },
- { "meccano.srl", true },
- { "mechanics-schools.com", true },
- { "mechanus.io", true },
- { "mechaspartans6648.com", true },
- { "mechmk1.me", true },
- { "mechok.ru", true },
- { "med-colleges.com", true },
- { "med-line.cf", true },
- { "med-post.biz", true },
- { "med-post.co", true },
- { "med-post.com", true },
- { "med-post.net", true },
- { "med-post.org", true },
- { "med-postclinic.com", true },
- { "med-postdoctor.com", true },
- { "med-postdoctors.com", true },
- { "med-postemergency.com", true },
- { "med-posthealth.com", true },
- { "med-postmedical.com", true },
- { "med-postphysicians.com", true },
- { "med-postwellness.com", true },
- { "med.tips", true },
- { "med360.at", true },
- { "medalofvalor.gov", true },
- { "medasset.gr", true },
- { "medba.se", true },
- { "medbreaker-friends.at", true },
- { "medcir.com.br", true },
- { "medcorfu.gr", true },
- { "medcrowd.com", true },
- { "meddelare.com", true },
- { "meddigital.com", false },
- { "medeinos.lt", true },
- { "medexpress.co.uk", true },
- { "medguide-bg.com", true },
- { "medi.com.br", true },
- { "media-credit.eu", true },
- { "media-instance.ru", true },
- { "media-library.co.uk", true },
- { "media-pi.com", true },
- { "media-serwis.com", true },
- { "mediaarea.net", true },
- { "mediabackoffice.co.jp", true },
- { "mediablaster.com", true },
- { "mediabogen.net", true },
- { "mediaburst.co.uk", true },
- { "mediacloud.me", true },
- { "mediadex.be", true },
- { "mediafamous.com", true },
- { "mediafart.fr", true },
- { "mediafly.com", true },
- { "mediafocus.biz", true },
- { "mediagenic.ch", false },
- { "mediagold.it", true },
- { "mediagrand.net", true },
- { "mediahaus.de", true },
- { "mediajurnal.com", true },
- { "medialab.nrw", true },
- { "medialys.ca", true },
- { "mediamarkt.pl", true },
- { "mediapart.fr", true },
- { "mediapath.gr", true },
- { "mediarithmics.com", true },
- { "mediarithmics.io", true },
- { "mediaselection.eu", true },
- { "mediasst.com", true },
- { "mediathekview.de", true },
- { "mediation-mv.de", true },
- { "mediationculturelleclp.ch", false },
- { "mediatorzy.waw.pl", true },
- { "mediaukkies.nl", true },
- { "mediawijsheid.nl", true },
- { "mediawijzer.net", true },
- { "mediawiki.org", true },
- { "mediawin.pl", true },
- { "medic-world.com", true },
- { "medical-assistant-colleges.com", true },
- { "medicalabroad.org", true },
- { "medicalcountermeasures.gov", true },
- { "medicare-providers.net", true },
- { "medicarecoveragefinder.com", true },
- { "medicareful.com", true },
- { "medicareinfo.org", true },
- { "medichat.ml", true },
- { "medicine.com", true },
- { "medicinia.com.br", true },
- { "mediciventures.com", true },
- { "medicm.jp", true },
- { "medicocompetente.it", true },
- { "medicoleads.com", true },
- { "medicoresponde.com.br", true },
- { "medicsz.co", true },
- { "medienweite.de", true },
- { "medifirst.de", true },
- { "medigap-quote.net", true },
- { "medik8.com.cy", true },
- { "medikalakademi.com.tr", true },
- { "medikuma.com", true },
- { "medino.com", true },
- { "medinside.ch", true },
- { "medinside.li", true },
- { "medinsider.ch", true },
- { "medinsider.li", true },
- { "medirota.com", true },
- { "medisense.tk", true },
- { "meditadvisors.com", true },
- { "meditarenargentina.org", true },
- { "meditation-rennes.org", true },
- { "meditel.nl", true },
- { "medium.com", true },
- { "medivox.tk", true },
- { "medja.net", true },
- { "medlineplus.gov", true },
- { "medo64.com", true },
- { "medovea.ru", true },
- { "medpeer.co.jp", true },
- { "medpeer.jp", true },
- { "medpics.com", true },
- { "medpost.biz", true },
- { "medpost.co", true },
- { "medpost.info", true },
- { "medpost.me", true },
- { "medpost.mobi", true },
- { "medpost.tv", true },
- { "medpost.us", true },
- { "medpostcare.com", true },
- { "medpostclinic.com", true },
- { "medpostdoctor.com", true },
- { "medpostdoctors.com", true },
- { "medpostemergency.com", true },
- { "medpostexpresscare.com", true },
- { "medposthealth.com", true },
- { "medposthealthcare.com", true },
- { "medpostimmediatecare.com", true },
- { "medpostmedical.com", true },
- { "medpostphysicians.com", true },
- { "medposturgentcare.biz", true },
- { "medposturgentcare.co", true },
- { "medposturgentcare.com", true },
- { "medposturgentcare.info", true },
- { "medposturgentcare.net", true },
- { "medposturgentcare.org", true },
- { "medpostwalkincare.com", true },
- { "medpostwellness.com", true },
- { "medrep.pp.ua", true },
- { "medsblalabs.com", true },
- { "medschat.com", true },
- { "medsourcelabs.com", true },
- { "medstatix.co", true },
- { "medtalents.ch", true },
- { "medtehnika.ua", true },
- { "medtip.de", true },
- { "medundmed.at", true },
- { "medusa.wtf", true },
- { "meduza.io", true },
- { "medvedikorenka.cz", true },
- { "medvedivka.tk", true },
- { "medvedkovo-hovrino.ru", true },
- { "medvet.com.es", true },
- { "medwaybouncycastlehire.co.uk", true },
- { "medyotan.ga", true },
- { "meedoenhartvanwestbrabant.nl", false },
- { "meeplegamers.com", true },
- { "meerman.nl", true },
- { "meermantechnischburo.nl", true },
- { "meerutcake.com", true },
- { "meesteresmisty.nl", true },
- { "meet.google.com", true },
- { "meetawesomepeople.net", true },
- { "meetbot.fedoraproject.org", true },
- { "meetfranz.com", true },
- { "meetingapplication.com", true },
- { "meetingmanage.nl", true },
- { "meetingmanager.ovh", true },
- { "meetmygoods.com", true },
- { "meetscompany.jp", true },
- { "meeusen-usedcars.be", false },
- { "meevo.ca", true },
- { "meeztertom.nl", true },
- { "meg-a-bounce.co.uk", true },
- { "mega-byte.nl", true },
- { "mega.co.nz", true },
- { "megabounce.co.uk", true },
- { "megabounceni.co.uk", true },
- { "megabouncingcastles.com", true },
- { "megaflowers.ru", true },
- { "megagifs.de", true },
- { "megaherz.tk", true },
- { "megainflatables.co.uk", true },
- { "megakoncert90.cz", true },
- { "megamisja.pl", true },
- { "megamp3.eu", true },
- { "meganandmarc.us", true },
- { "meganreel.com", true },
- { "meganruggiero.com", true },
- { "megapixel.cz", true },
- { "megaplan.cz", true },
- { "megaplan.ru", true },
- { "megaportal.ga", true },
- { "megarex.jp", true },
- { "megaron.at", true },
- { "megatravel.com.mx", true },
- { "megauction.tk", true },
- { "megawarez.org", true },
- { "megawebsite.tk", true },
- { "megaxchange.com", true },
- { "megaxchange.org", true },
- { "meggidesign.com", true },
- { "meginajums1.space", true },
- { "mego.cloud", true },
- { "megumico.net", true },
- { "megztosidejos.lt", true },
- { "meh.is", true },
- { "mehalick.com", true },
- { "mehdibouchema.be", true },
- { "mehdimassage.com", true },
- { "mehhh.xyz", true },
- { "mehibo.tk", true },
- { "mehmetakif.edu.tr", true },
- { "mehmetince.net", true },
- { "mehode.com", true },
- { "mehostdd.com", false },
- { "mehr-schulferien.de", true },
- { "mehrleben.at", true },
- { "mehrnevesht.com", true },
- { "mehrwert.de", true },
- { "mehvix.com", true },
- { "meidev.co", true },
- { "meierhofer.net", true },
- { "meiksbar.de", true },
- { "meillard-auto-ecole.ch", true },
- { "meilleur.info", true },
- { "meilleursavis.fr", true },
- { "meilleurstrucs.com", true },
- { "mein-domizil.at", true },
- { "mein-gehalt.at", true },
- { "mein-kuechenhelfer.de", true },
- { "mein-muehlhausen.bayern", true },
- { "mein-tortenladen.de", true },
- { "meinbetriebsrat24.de", true },
- { "meincenter-meinemeinung.de", true },
- { "meincoach.at", true },
- { "meine-cloud-online.de", true },
- { "meine-email-im.net", true },
- { "meine-finanzanalyse.de", true },
- { "meine-immofinanzierung.de", true },
- { "meineit.dvag", true },
- { "meinewolke.pw", true },
- { "meinezwangsversteigerung.de", true },
- { "meinheizstrom.de", true },
- { "meintragebaby.de", true },
- { "meinv.asia", true },
- { "meiodomato.com.br", true },
- { "meiqia.com", true },
- { "meisterlabs.com", true },
- { "meistertask.com", true },
- { "meitan.gz.cn", true },
- { "meizitang.es", true },
- { "mekaleskirit.tk", true },
- { "mekanika.com.my", true },
- { "mekatrotekno.com", true },
- { "mekesh.com", true },
- { "mekesh.net", true },
- { "mekesh.ru", true },
- { "meklon.net", true },
- { "melania-voyance.fr", true },
- { "melaniegruber.de", true },
- { "melatonin.fun", true },
- { "melbourne.dating", true },
- { "melcher.it", true },
- { "melchizedek-forum.de", true },
- { "melda-agustin.tk", true },
- { "melda.ru", true },
- { "meldcode-assistent.nl", true },
- { "mele.ro", true },
- { "melearning.university", false },
- { "melhoresdominios.com", true },
- { "melhoresmarcasdenotebook.com.br", true },
- { "melikoff.es", true },
- { "melillaorienta.es", true },
- { "melina-schefczyk.de", true },
- { "meliowebweer.nl", true },
- { "melissaadkins.com", true },
- { "melissagalt.com", true },
- { "melissameuwszen.nl", true },
- { "meliyb.ga", true },
- { "mellika.ch", true },
- { "melnessgroup.com", true },
- { "melnikov.ch", true },
- { "melodict.com", true },
- { "melodiouscode.co.uk", true },
- { "melodiouscode.com", true },
- { "melodiouscode.net", true },
- { "melodiouscode.uk", true },
- { "melodrom.de", true },
- { "melodyjane.com", true },
- { "meloniecharm.com", true },
- { "melopie.com", true },
- { "melosyne.com", true },
- { "melosyne.de", true },
- { "melosyne.net", true },
- { "melosyne.org", true },
- { "meltzow.net", true },
- { "memberhk.com", true },
- { "members-arbourlake.com", true },
- { "members-only-shopping.com", true },
- { "members.nearlyfreespeech.net", false },
- { "membershipservices.org.uk", true },
- { "meme-photostudio.com.tw", true },
- { "meme.fi", true },
- { "meme.institute", true },
- { "memememememememe.me", true },
- { "memento-mori.cf", true },
- { "memes.nz", true },
- { "memesbee.com", true },
- { "memiux.com", true },
- { "memmertusa.com", true },
- { "memo-linux.com", true },
- { "memo.ee", true },
- { "memo2ch.com", true },
- { "memoire-resistance-ariege.fr", true },
- { "memoirmedie.dk", true },
- { "memorind.com", true },
- { "memoryex.net", true },
- { "memrise.com", true },
- { "menanwc.org", true },
- { "menden.com", true },
- { "mendipbouncycastles.co.uk", true },
- { "mendy.jp", true },
- { "menielias.com", true },
- { "menn.tk", true },
- { "mennace.com", true },
- { "menno.me", true },
- { "menole.com", true },
- { "menole.de", true },
- { "menole.net", true },
- { "menotag.com", true },
- { "mensagemaniversario.com.br", true },
- { "mensagemdaluz.com", true },
- { "mensagensaniversario.com.br", true },
- { "mensagensdeconforto.com.br", true },
- { "mensarena.gr", true },
- { "mensch-peter.me", true },
- { "menshealthinsurance.com", true },
- { "mentalcalculations.tk", true },
- { "mentalcraft.tk", true },
- { "mentalhealthmn.org", true },
- { "mentaltraining-fuer-musiker.ch", true },
- { "mentecuriosa.net", true },
- { "menthiere.fr", true },
- { "mentiq.az", true },
- { "mentita.de", true },
- { "mentorbuk.com", true },
- { "menuonlineordering.com", true },
- { "menzietti.it", true },
- { "meo.de", true },
- { "meodihoang.com", true },
- { "meow.plus", true },
- { "mepambalaj.com", true },
- { "mephedrone.org", true },
- { "meps.net", true },
- { "merakiclub.com", true },
- { "merakilp.com", true },
- { "meralda.eu", true },
- { "meralda.net", true },
- { "meralda.org", true },
- { "meraldamulder.com", true },
- { "meraldamulder.eu", true },
- { "meraldamulder.net", true },
- { "meraldamulder.org", true },
- { "meran.in", true },
- { "meransuedtirol.com", true },
- { "meraseo.com", true },
- { "mercadohype.tk", true },
- { "mercadoleal.com.br", true },
- { "mercadopago.com", true },
- { "mercadosex.com.br", true },
- { "mercamaris.es", true },
- { "mercari.com", true },
- { "mercedes-benz-kiev.com", true },
- { "mercedes-ig.de", true },
- { "mercedobem.com.br", true },
- { "merchant-automotive.com", true },
- { "merchant.agency", true },
- { "merchcity.com", true },
- { "mercier-auto.com", true },
- { "mercier-cars.co.uk", true },
- { "mercredifiction.io", true },
- { "mercury.photo", true },
- { "mercuryamericas.com", false },
- { "merdacz.pl", true },
- { "meremeti-online.gr", true },
- { "merenbach.com", true },
- { "merenita.com", true },
- { "merenita.eu", true },
- { "merenita.net", true },
- { "merenita.nl", true },
- { "meric-graphisme.info", true },
- { "meridanas.me", true },
- { "meridianenvironmental.com", true },
- { "meridianmetals.com", true },
- { "meridianoshop.com.br", true },
- { "merite.cloud", true },
- { "merkel.me", true },
- { "merlet.eu", true },
- { "merlin-memorial.de", true },
- { "merlinsoap.com", true },
- { "merloaded.rocks", true },
- { "merojob.com", true },
- { "meronberry.jp", true },
- { "merpay.com", true },
- { "merson.org", true },
- { "merson.tv", true },
- { "mertak.cz", true },
- { "mertarauh.com", true },
- { "mertcangokgoz.com", true },
- { "meruri.com", true },
- { "merza.is", true },
- { "merzai.co.uk", true },
- { "mes-bouquins.fr", true },
- { "mes-finances.be", true },
- { "mesami-art.de", true },
- { "mesappros.com", true },
- { "mescaline.com", true },
- { "mescaline.org", true },
- { "mesec.cz", true },
- { "mesh.gov", true },
- { "meshok.info", true },
- { "mesicka.com", false },
- { "meskiukas.tk", true },
- { "mesomeds.com", true },
- { "mesotheliomacentre.tk", true },
- { "messagescelestes-archives.ca", true },
- { "messagevortex.com", true },
- { "messagevortex.net", true },
- { "messdorferfeld.de", true },
- { "messenger.co.tz", true },
- { "messenger.com", false },
- { "messengerwebbrands.com", true },
- { "messer24.ch", true },
- { "messymom.com", true },
- { "mestazitrka.cz", true },
- { "mesvision.com", true },
- { "meta-db.com", true },
- { "meta-word.com", true },
- { "meta4.be", true },
- { "metachris.com", true },
- { "metacoda.com", true },
- { "metacode.biz", true },
- { "metacortex.cf", true },
- { "metadata.be", true },
- { "metaether.net", true },
- { "metafurquest.net", true },
- { "metaglyphics.com", true },
- { "metainnovative.net", true },
- { "metakari.one", true },
- { "metal-rock.tk", true },
- { "metalartbylaser.com.au", true },
- { "metalempire.tk", true },
- { "metaljournal.tk", true },
- { "metaljunkiez.com", true },
- { "metallibrarian.com", true },
- { "metalliran.tk", true },
- { "metallobaza.ml", true },
- { "metallomania.it", true },
- { "metallosajding.ru", true },
- { "metallschutz-direkt.de", true },
- { "metalu.ch", false },
- { "metanodo.com", true },
- { "metanumbers.com", true },
- { "metapeen.nl", true },
- { "metasquare.com.au", true },
- { "metasquare.nyc", true },
- { "metasyntactic.xyz", true },
- { "metasysteminfo.com", true },
- { "metaurl.io", true },
- { "metaword.com", true },
- { "metaword.net", true },
- { "metaword.org", true },
- { "metebalci.com", false },
- { "meteenonline.nl", true },
- { "meteobox.co", true },
- { "meteobox.cz", true },
- { "meteobox.de", true },
- { "meteobox.es", true },
- { "meteobox.fr", true },
- { "meteobox.mx", true },
- { "meteobox.pl", true },
- { "meteobox.sk", true },
- { "meteobox.tk", true },
- { "meteocat.net", true },
- { "meteorapp.space", true },
- { "meteorites-for-sale.com", true },
- { "meteorologiaenred.com", true },
- { "meteosmit.it", true },
- { "meterhost.com", true },
- { "methamphetamine.co.uk", true },
- { "method.com", true },
- { "methylone.com", true },
- { "metric.ai", true },
- { "metricmutt.com", true },
- { "metro-lawn-care.com", true },
- { "metro-web.net", true },
- { "metroairvirtual.com", true },
- { "metrobriefs.com", true },
- { "metrodemaracaibo.tk", true },
- { "metrodetroitmommy.com", true },
- { "metrolush.com", true },
- { "metron-eging.com", true },
- { "metron-networks.com", true },
- { "metron-online.com", true },
- { "metronaut.de", true },
- { "metronews.co.nz", true },
- { "metropop.ch", false },
- { "metrorealestatepros.com", true },
- { "metsasta.com", true },
- { "mettekopp.dk", true },
- { "metz-metropolitain.fr", true },
- { "metzgermark.com", true },
- { "meugamer.com", true },
- { "meujeitodigital.com.br", false },
- { "meurisse.org", true },
- { "mevanshop.com", false },
- { "mevo.xyz", true },
- { "mevs.cz", true },
- { "mevsim.com", true },
- { "mexican.dating", true },
- { "mexicanjokes.net", true },
- { "mexico.rs", true },
- { "mexico.sh", true },
- { "mexicom.org", true },
- { "mexicotopescorts.com", true },
- { "meyash.co", true },
- { "mezedokamomata.tk", true },
- { "mezinfo.tk", true },
- { "mezzehuis.be", true },
- { "mf-fischer.de", true },
- { "mfen.de", true },
- { "mfits.co.uk", true },
- { "mflodin.se", true },
- { "mfsquad.com", true },
- { "mfxbe.de", true },
- { "mgcraft.net", true },
- { "mgdigitalmarketing.com.au", true },
- { "mghw.ch", true },
- { "mgi.gov", true },
- { "mgiljum.com", true },
- { "mglink.be", true },
- { "mgonline.tk", true },
- { "mgrossklaus.de", false },
- { "mgrt.net", true },
- { "mgsdb.com", true },
- { "mgsisk.com", true },
- { "mgtbaas.eu", true },
- { "mgvideo.com.au", true },
- { "mhabdullah.tk", true },
- { "mhadot.com", true },
- { "mhalfter.de", true },
- { "mhand.org", true },
- { "mhatero.com", true },
- { "mhatlaw.com", true },
- { "mhcdesignstudio.com", true },
- { "mheistermann.de", true },
- { "mhermans.nl", true },
- { "mhf.gc.ca", true },
- { "mhi.web.id", true },
- { "mhonline.fr", true },
- { "mhtdesign.net", true },
- { "mhurologytriad.org", true },
- { "mi-beratung.de", true },
- { "mi-so-ji.com", true },
- { "mi1k.cn", true },
- { "mi80.com", true },
- { "mi92.ru", true },
- { "mia.tw", true },
- { "miadennees.com", true },
- { "miagexport.com", true },
- { "miah.top", true },
- { "mialquilerdecoches.com", true },
- { "miamiaquatours.com", true },
- { "miamiobgyndreams.com", true },
- { "miaomiao.eu.org", true },
- { "miaowo.org", true },
- { "miapuntes.com", true },
- { "miasonne.com", true },
- { "miavierra.org", true },
- { "mibh.de", true },
- { "mibuiin.com", true },
- { "mica.ml", true },
- { "micalodeal.ch", false },
- { "micamisetaestampada.com", true },
- { "micbase.com", true },
- { "michadenheijer.com", true },
- { "michael-contento.de", true },
- { "michael-schefczyk.de", true },
- { "michael-steinhauer.eu", true },
- { "michaelasawyer.com", true },
- { "michaelband.com", true },
- { "michaelcontento.de", true },
- { "michaelcullen.name", true },
- { "michaeldg.be", true },
- { "michaelhrehor.com", true },
- { "michaelismold.com", true },
- { "michaelizquierdo.com", true },
- { "michaeljacksonforsale.com", true },
- { "michaeljdennis.com", true },
- { "michaelkuchta.me", true },
- { "michaell.io", true },
- { "michaell.xyz", true },
- { "michaelleibundgut.com", true },
- { "michaelloveys.com", true },
- { "michaelpelletterie.it", true },
- { "michaelpfrommer.de", true },
- { "michaelpfrommer.pub", true },
- { "michaelschmidt.ch", true },
- { "michaelschubert.com", true },
- { "michaelsweater.com", true },
- { "michaeltaboada.me", true },
- { "michaeltroger.com", true },
- { "michaeltruskowski.com", true },
- { "michaelwermeester.com", true },
- { "michal-s.net", true },
- { "michal-spacek.com", true },
- { "michal-spacek.cz", true },
- { "michaldudek.it", true },
- { "michalpodraza.pl", true },
- { "michalspacek.com", true },
- { "michalspacek.cz", true },
- { "michalwiglasz.cz", true },
- { "michaonline.de", true },
- { "michel-wein.de", true },
- { "michele.ga", true },
- { "michele.ml", true },
- { "michellavat.com", true },
- { "michelletmc.com", true },
- { "michelskovbo.dk", true },
- { "michelwolf.ch", true },
- { "michiganstateuniversityonline.com", true },
- { "michiganunionoptout.com", true },
- { "michilaw.com", true },
- { "michmexguides.com.mx", true },
- { "michu.pl", true },
- { "mickelvaessen.com", true },
- { "mickgrimesgamingpodcast.co.uk", true },
- { "micluz.shop", true },
- { "micoff.tk", true },
- { "miconcinemas.com", true },
- { "micontractortraining.com", true },
- { "micopal.com", true },
- { "micr0lab.org", true },
- { "micra.org.uk", true },
- { "microbiote-insectes-vecteurs.group", true },
- { "microco.sm", true },
- { "microcomploja.com.br", true },
- { "microdots.de", true },
- { "microjovem.pt", true },
- { "microlog.org", true },
- { "micromata.de", true },
- { "micromegas.com.ua", true },
- { "microneedlingstudio.se", true },
- { "micropigpets.com", true },
- { "microsoftaffiliates.azurewebsites.net", true },
- { "microsoftedgeinsider.com", true },
- { "microvb.com", true },
- { "microwavezone.com", true },
- { "microwesen.de", true },
- { "microzubr.com", true },
- { "micsell.com", true },
- { "midair.io", true },
- { "midamericapiering.com", true },
- { "midart.ro", true },
- { "midasjewellery.com.au", true },
- { "midcarolinaregionalairport.com", true },
- { "midcarolinaregionalairport.org", true },
- { "middletonshoppingcentre.co.uk", true },
- { "midgawash.com", true },
- { "midiaid.de", true },
- { "midistop.org", true },
- { "midkam.ca", true },
- { "midlandgate.de", true },
- { "midlandleisuresales.co.uk", true },
- { "midlandroofingri.com", true },
- { "midlandsfundays.co.uk", true },
- { "midlandslotus.co.uk", true },
- { "midlandsphotobooths.co.uk", true },
- { "midnight-gaming-community.tk", true },
- { "midnight-visions.de", true },
- { "midnightmango.co.uk", true },
- { "midnightmango.de", true },
- { "midnightmechanism.com", true },
- { "midrandplumber24-7.co.za", true },
- { "midstatebasement.com", true },
- { "midterm.us", true },
- { "midtowndentistry.com", true },
- { "midwayrecovery.com", true },
- { "midweb.ro", false },
- { "midwestbloggers.org", true },
- { "miegl.com", true },
- { "miegl.cz", true },
- { "mieldemexico.us", true },
- { "miemus.eu", true },
- { "mieresabadus.ro", true },
- { "mierloiu.ro", true },
- { "mietwohnungen-vermietung.com", true },
- { "mieuxgrandir.ch", false },
- { "mifarmaciaenbarcelona.com", true },
- { "miffy.me", true },
- { "miftahulteknik.com", true },
- { "mig5.net", true },
- { "miggy.org", true },
- { "mightysighty.com", true },
- { "miguel.pw", true },
- { "migueldemoura.com", true },
- { "migueldominguez.ch", false },
- { "miguelgaton.es", true },
- { "miguelito.tk", true },
- { "miguelkertsman.com", true },
- { "miguelmartinez.ch", false },
- { "miguelmenendez.pro", true },
- { "miguelmoura.com", true },
- { "miguia.tv", true },
- { "mihgroup.net", true },
- { "mihnea.net", true },
- { "mijailovic.net", true },
- { "mijcorijneveld.nl", true },
- { "mijn-financien.be", true },
- { "mijn.computer", true },
- { "mijnbeijesweb.nl", true },
- { "mijnetz.nl", false },
- { "mijnkerstkaarten.be", true },
- { "mijnkinderkleding.com", true },
- { "mijnpartijhandel.nl", true },
- { "mijnreisoverzicht.nl", true },
- { "mijnstembureau.nl", true },
- { "mijntelefoonboek.com", true },
- { "mijntransacties.nl", true },
- { "mika.moe", true },
- { "mikadoe.nl", true },
- { "mikaeljansson.net", true },
- { "mikakalathil.ca", true },
- { "mikakalevi.com", true },
- { "mikalikes.men", true },
- { "mikdoss.co", true },
- { "mike-bland.com", true },
- { "mike-burns.com", true },
- { "mike-et-pascale-sanger.com", true },
- { "mike2k.de", true },
- { "mikeandersondj.com", true },
- { "mikebelanger.ca", true },
- { "mikebutcher.ca", true },
- { "mikecameronyyc.com", true },
- { "mikecapson.com", true },
- { "mikecb.org", true },
- { "mikechasejr.tk", true },
- { "mikegao.net", false },
- { "mikegao.org", true },
- { "mikegerwitz.com", true },
- { "mikeguy.co.uk", true },
- { "mikehamburg.com", true },
- { "mikeklidjian.com", true },
- { "mikekreuzer.com", true },
- { "mikemooresales.com", true },
- { "mikeowens.us", true },
- { "mikerichards.gallery", true },
- { "mikerichards.photography", true },
- { "mikerichards.photos", true },
- { "mikerichards.pictures", true },
- { "mikerichardsphotography.com", true },
- { "mikesystems.tk", true },
- { "miketabor.com", true },
- { "miketheuer.com", true },
- { "mikethiessen.net", true },
- { "mikevesch.com", true },
- { "mikewillia.ms", true },
- { "mikewrites.online", true },
- { "mikhlevich.ru", true },
- { "miki.it", true },
- { "mikkei.space", true },
- { "mikkelladegaard.dk", true },
- { "mikkelscheike.com", true },
- { "mikkelvej.dk", true },
- { "mikkonen.bio", true },
- { "miklagard.dk", true },
- { "miklcct.com", true },
- { "miknight.com", true },
- { "mikropixel.de", true },
- { "miku.ro", true },
- { "mikywow.eu", true },
- { "milahendri.com", true },
- { "milakirschner.de", true },
- { "milan-news.ml", true },
- { "milania.de", true },
- { "milanstephan.de", false },
- { "milavica.tk", true },
- { "milcahsmusings.com", true },
- { "mileme.com", true },
- { "milenaria.es", true },
- { "milesapart.dating", true },
- { "milfpornograph.com", true },
- { "milhoazul.com.br", true },
- { "milieuland.com", true },
- { "militaryonesource.mil", true },
- { "militarysrit.tk", true },
- { "milkaalpesiutazas.hu", true },
- { "milkameglepetes.hu", true },
- { "milkingit.co.uk", true },
- { "milkingit.net", true },
- { "milkmoovement.io", true },
- { "milktea.info", false },
- { "milkypond.org", true },
- { "mill.ml", true },
- { "milldyke.com", true },
- { "milldyke.nl", true },
- { "millefleurs.eu", true },
- { "millennium-thisiswhoweare.net", true },
- { "millenniumstem.org", true },
- { "millenniumweb.com", false },
- { "milleron.xyz", true },
- { "millersminibarns.com", true },
- { "millerwalker.com", true },
- { "millettable.com", true },
- { "millhousenchurch.com", true },
- { "millionairegames.com", true },
- { "millionen-von-sonnen.de", true },
- { "millistream.com", true },
- { "mim.am", true },
- { "mimavision.ddns.net", true },
- { "mimemo.io", true },
- { "mimemoriadepez.com", true },
- { "mimeo.digital", true },
- { "mimithedog.com", true },
- { "mimmog.it", true },
- { "mimocad.io", true },
- { "mimolo.de", true },
- { "mimovrste.com", true },
- { "min-datorsupport.se", true },
- { "min-sky.no", true },
- { "minaio.tk", true },
- { "minakov.pro", true },
- { "minami.xyz", true },
- { "minamo.io", true },
- { "minandolacorrupcion.mx", true },
- { "minapin.com", true },
- { "minaprine.com", true },
- { "mind-books.gq", true },
- { "mind-box.ch", false },
- { "mind-hochschul-netzwerk.de", true },
- { "mindatasupport.nu", true },
- { "mindatasupport.se", true },
- { "mindatorsupport.se", true },
- { "mindbounce.com", true },
- { "mindcms.nl", true },
- { "mindcoding.ro", true },
- { "minddrive.cf", true },
- { "mindfactory.de", true },
- { "mindhunter.info", true },
- { "mindleaking.org", true },
- { "mindmax.fi", true },
- { "mindmeister.com", true },
- { "mindmusic.online", true },
- { "mindoktor.se", false },
- { "mindorbs.com", true },
- { "mindstretchers.co.uk", true },
- { "mine-craftlife.com", true },
- { "mine-pixl.de", true },
- { "mine260309.me", false },
- { "minebier.dk", true },
- { "minecraft-forum.eu", true },
- { "minecraft-server.eu", true },
- { "minecraft.gen.tr", true },
- { "minecraftforum.de", true },
- { "minecraftforum.ovh", true },
- { "minecraftjson.com", false },
- { "minecraftstal.com", true },
- { "minehattan.de", true },
- { "minehub.de", true },
- { "minepack.net", true },
- { "minepay.net", true },
- { "minepic.org", true },
- { "minerstat.com", true },
- { "minerva2015.it", true },
- { "minervacars.com", true },
- { "minesouls.fr", true },
- { "minetracker.dk", true },
- { "minez-nightswatch.com", false },
- { "mingky.net", true },
- { "mingkyaa.com", true },
- { "mingming.info", true },
- { "mingram.net", true },
- { "mingtreerealty.com", true },
- { "mingwah.ch", false },
- { "minh.at", false },
- { "minhyukpark.com", true },
- { "mini-piraten.de", true },
- { "mini2.fi", true },
- { "miniaturepets.net", true },
- { "minibrewery.cf", true },
- { "minican.net", true },
- { "miniclip.com", true },
- { "minigames.com", true },
- { "minigolf-reisinger.com", true },
- { "minigolfandgames.co.uk", true },
- { "minikidz.es", true },
- { "minikin.tk", true },
- { "minikneet.com", true },
- { "minilions.fr", true },
- { "minimal-apps.de", true },
- { "minimalistbaker.com", true },
- { "minimaltimer.com", true },
- { "minimayhemsoftplay.co.uk", true },
- { "minimbah.com.au", true },
- { "minimonies.tk", true },
- { "minimvc.com", true },
- { "mining.diamonds", true },
- { "minisoft4u.ir", true },
- { "ministeriumfuerinternet.de", true },
- { "minitruckin.net", true },
- { "minitrucktalk.com", true },
- { "miniverse.social", true },
- { "miniwaplus.com", true },
- { "mink-coat.tk", true },
- { "minkymoon.jp", true },
- { "minmaxgame.com", true },
- { "minnesotakinkyyouth.org", true },
- { "minnesotareadingcorps.org", true },
- { "minnit.chat", true },
- { "minor.news", true },
- { "minorshadows.net", true },
- { "minpingvin.dk", true },
- { "minschuns.ch", true },
- { "mintclass.com", true },
- { "minton.systems", true },
- { "mintrak2.com", true },
- { "mintse.com", true },
- { "minu.link", true },
- { "minube.co.cr", true },
- { "minutashop.ru", true },
- { "minux.info", true },
- { "mio-ip.ch", true },
- { "mionerve.com", true },
- { "mionerve.org", true },
- { "mipapo.de", true },
- { "mipnet.cl", true },
- { "miproximopaso.org", true },
- { "mir-faktov.tk", true },
- { "mir-multimedia.tk", true },
- { "mir-pressy.ga", true },
- { "mir.pe", true },
- { "mirabalphoto.es", true },
- { "miragg.cf", true },
- { "miraheze.org", true },
- { "miraidenshi.com", true },
- { "miraiex.com", false },
- { "miramar-obgyn.com", true },
- { "miramar.ca", true },
- { "miravelli.ro", true },
- { "mirazperu.com", true },
- { "mircarfinder.ru", true },
- { "mirch.com", true },
- { "mireiaseuba.com", true },
- { "mirepublic.co.nz", true },
- { "mireservaonline.es", true },
- { "mirfire.com", false },
- { "mirjamderijk.nl", true },
- { "mirknighechek.tk", true },
- { "mirkofranz.de", true },
- { "mirkvartir.tk", true },
- { "miroctum.com", true },
- { "mirokon.tk", true },
- { "mironet.cz", true },
- { "miroslavbaka.cz", true },
- { "mirrordream.net", true },
- { "mirrorsedgearchive.de", true },
- { "mirshak.com", false },
- { "mirtes.cz", true },
- { "mirtouf.fr", true },
- { "misakastudio.com", true },
- { "misakatang.cn", false },
- { "misakiya.co.jp", true },
- { "misanci.cz", true },
- { "misclick.nl", true },
- { "mishkan-israel.net", true },
- { "mishkovskyi.net", true },
- { "misinstrumentos.com", true },
- { "miskatonic.org", true },
- { "misoji-resist.com", true },
- { "misp-project.org", true },
- { "mispromo.com", true },
- { "miss-alisa.com", true },
- { "miss-inventory.co.uk", true },
- { "miss-platinum.net", true },
- { "miss.com.tw", true },
- { "miss.sh", true },
- { "missblisshair.com.au", true },
- { "missdream.org", true },
- { "misseguf.dk", true },
- { "missguidedus.com", true },
- { "mission-orange.de", true },
- { "missionsgemeinde.de", true },
- { "missip.nl", true },
- { "missivystorm.com", true },
- { "misskey.jp", true },
- { "misssex.de", true },
- { "missualready.com", true },
- { "missyou.link", true },
- { "mist79.ru", true },
- { "mistacms.com", true },
- { "mistaken.pl", true },
- { "mister-matthew.de", true },
- { "misterandersson.com", true },
- { "misterseguros.com.br", true },
- { "mistine.net", true },
- { "mistlake.net", true },
- { "mistreaded.com", true },
- { "mistybox.com", true },
- { "misupport.dk", true },
- { "misuzu.moe", true },
- { "mit-dem-rad-zur-arbeit.de", true },
- { "mit-dem-rad-zur-uni.de", true },
- { "mit-uns.org", true },
- { "mita.me", true },
- { "mitarbeitermotivation-anleitungen.de", true },
- { "mitchellhandymanservices.co.uk", true },
- { "mitchelmore.ca", true },
- { "mitdip-mit-group-ch.azurewebsites.net", true },
- { "mitevi.com", true },
- { "mitfx.com", true },
- { "mithgol.tk", true },
- { "miticobikes.com", true },
- { "mitnetz-gas.de", true },
- { "mitnetz-strom.de", true },
- { "mitratech.com.br", true },
- { "mitrax.com.br", true },
- { "mitre10.com.au", false },
- { "mitrecaasd.org", true },
- { "mitremai.org", true },
- { "mitrostudios.com", true },
- { "mitsonnenbrillen.de", true },
- { "mitsukabose.com", true },
- { "mittagonggardencentre.com.au", true },
- { "mittbolan.se", true },
- { "mittelalter-lexikon.de", true },
- { "mittwoch-nacht.net", true },
- { "mitylite.com", true },
- { "mitzpettel.com", true },
- { "miui-germany.de", true },
- { "mivm.cn", true },
- { "mivzak.im", true },
- { "mivzakim.biz", true },
- { "mivzakim.cf", true },
- { "mivzakim.ga", true },
- { "mivzakim.gq", true },
- { "mivzakim.info", true },
- { "mivzakim.ml", true },
- { "mivzakim.mobi", true },
- { "mivzakim.net", true },
- { "mivzakim.org", true },
- { "mivzakim.tk", true },
- { "mivzakim.tv", true },
- { "miweb.cr", false },
- { "mix-channel.ml", true },
- { "mixedrecipe.com", true },
- { "mixify.ga", true },
- { "mixinglight.com", true },
- { "mixmister.com", true },
- { "mixmix.tk", true },
- { "mixposure.com", true },
- { "mixtafrica.com", true },
- { "mixx.com.hk", true },
- { "miyanaga.tech", true },
- { "miyasyou.com", true },
- { "miyatakaikei.com", true },
- { "miyatore.com", true },
- { "miyugirls.com", true },
- { "mizar.im", false },
- { "mizoey.se", true },
- { "mizque.ch", true },
- { "mizternational.com", true },
- { "mizu.coffee", true },
- { "mizucoffee.net", true },
- { "mizuho-trade.net", true },
- { "mizuhobank.co.id", true },
- { "mj420.com", true },
- { "mjacobson.net", true },
- { "mjanja.ch", true },
- { "mjasm.org", true },
- { "mjec.net", true },
- { "mjjlab.com", true },
- { "mjmedia.co.za", true },
- { "mjniessen.com", true },
- { "mjpak.com.au", true },
- { "mjproduction.ee", true },
- { "mjrlegends.com", true },
- { "mjs-domy.pl", true },
- { "mjsacco-dwi.com", true },
- { "mjsacco.com", true },
- { "mjscustomcreations.com.au", true },
- { "mjt.me.uk", true },
- { "mk89.de", true },
- { "mkaciuba.com", false },
- { "mkalisch.de", true },
- { "mkbet.tk", true },
- { "mkbouncycastles.co.uk", true },
- { "mkbouncyhire.co.uk", true },
- { "mkcert.org", true },
- { "mkchandler.com", true },
- { "mkd.mk", true },
- { "mkes.com", true },
- { "mkfilm.ma", true },
- { "mkg-chirurgie-bruchsal.de", true },
- { "mkg-scherer.de", true },
- { "mkg-wiebelskirchen.de", true },
- { "mkhsoft.eu", true },
- { "mkie.cf", true },
- { "mkimage.com", false },
- { "mkinteriores.com.br", true },
- { "mkjl.ml", false },
- { "mkk.de", true },
- { "mklenterprises.com", true },
- { "mklenterprisesacademy.com", true },
- { "mklenterprisescoaching.com", true },
- { "mkm.szczecin.pl", true },
- { "mkoppmann.at", true },
- { "mkpdeepclean.com", true },
- { "mkpef.org", true },
- { "mksac.co.uk", true },
- { "mksdarchitects.com", true },
- { "mkse.com", true },
- { "mkset.ru", true },
- { "mktdigital.info", true },
- { "mktemp.org", true },
- { "mktenlared.com", true },
- { "mkuznets.com", true },
- { "mladamoda.sk", true },
- { "mlathrom.com", true },
- { "mlcnfriends.com", true },
- { "mllz.com", true },
- { "mlmjam.com", true },
- { "mlohr.com", true },
- { "mlonline.com.mx", true },
- { "mlp.ee", true },
- { "mlpvector.club", true },
- { "mlsha.cn", true },
- { "mlundberg.se", true },
- { "mlytics.com", true },
- { "mm-wife.com", true },
- { "mm13.at", true },
- { "mm404.com", true },
- { "mmalisz.com", true },
- { "mmaps.org", true },
- { "mmassemblyline.de", true },
- { "mmbb.org", true },
- { "mmbhof.org", true },
- { "mmcalc.jp", true },
- { "mmgal.com", true },
- { "mminsco.com", true },
- { "mml.cx", true },
- { "mmmarco.com", true },
- { "mmmm.mn", true },
- { "mmogah.com", true },
- { "mmoneko.com", true },
- { "mmonit.com", true },
- { "mmprojects.nl", true },
- { "mms.is", true },
- { "mmsmotor.com.hk", true },
- { "mmt.my", true },
- { "mmucha.de", true },
- { "mmwb.nl", true },
- { "mmxblog.com", true },
- { "mnciitbhu.me", true },
- { "mncloud.de", true },
- { "mnd.sc", true },
- { "mne.moe", true },
- { "mnemonic.ninja", true },
- { "mneti.ru", true },
- { "mnguyen.io", true },
- { "mnienamel.com", true },
- { "mnium.de", true },
- { "mnml.art", true },
- { "mns.co.jp", true },
- { "mns.jp", true },
- { "mnsure.org", true },
- { "mnt-tech.fr", true },
- { "mo-journal.com", true },
- { "mo-mochizuki.com", true },
- { "mo.nl", true },
- { "mo2021.de", true },
- { "moa.moe", true },
- { "moabpapier.de", true },
- { "moahmo.com", true },
- { "moarcookies.com", true },
- { "moas.design", true },
- { "mobal.com", true },
- { "mobi2go.com", true },
- { "mobifinans.ru", true },
- { "mobil-bei-uns.de", true },
- { "mobila-chisinau.md", true },
- { "mobilcom-debitel-empfehlen.de", true },
- { "mobile-holzofenpizza.de", true },
- { "mobile.eti.br", true },
- { "mobile.united.com", false },
- { "mobile.usaa.com", false },
- { "mobile360.ph", true },
- { "mobileague.ml", true },
- { "mobilebingoclub.co.uk", true },
- { "mobilebooster.tk", true },
- { "mobilecasinoclub.co.uk", true },
- { "mobilecontractcomparison.com", true },
- { "mobilelooper.com", true },
- { "mobilemedics.com", true },
- { "mobileread.com", true },
- { "mobiletraff.co", true },
- { "mobiletry.com", true },
- { "mobilewikiserver.com", true },
- { "mobilinnov.it", true },
- { "mobilisation-generale.org", false },
- { "mobility-events.ch", true },
- { "mobilux.lv", true },
- { "mobinst.ml", true },
- { "mobio.net", true },
- { "mobiproj.com", true },
- { "mobisaar-cloud.de", true },
- { "mobius.network", true },
- { "mobizma.com", true },
- { "mobobe.com", true },
- { "mobsitin.tk", true },
- { "mobtop.ml", true },
- { "moburst.com", true },
- { "mobydog.net", true },
- { "moc.ac", true },
- { "moca-2080.com", true },
- { "mochilerostailandia.com", true },
- { "mochizuki.moe", true },
- { "mockerel.com", true },
- { "mocking-bird.org", true },
- { "mocknen.net", true },
- { "mococo.co.uk", true },
- { "mod.af", true },
- { "moda-donna.cf", true },
- { "modaexecutiva.com.br", true },
- { "modafo.com", true },
- { "modalogi.com", true },
- { "modav.org", true },
- { "modbom.com.tw", true },
- { "modcover.com", true },
- { "modderday.com", true },
- { "modding-forum.com", true },
- { "modding-welt.com", true },
- { "moddiy.com", true },
- { "mode-hautnah.de", true },
- { "model.earth", true },
- { "modelclub-draveil.eu", true },
- { "modelcube.com", true },
- { "modeldimension.com", true },
- { "modeldoll.tk", true },
- { "modelemax.pl", true },
- { "modelisme-rc.net", true },
- { "modell-lq.net", true },
- { "modelservis.cz", true },
- { "modelspoor-projecten.nl", true },
- { "modelspoorprojecten.nl", true },
- { "modemaille.com", false },
- { "modemchild.net", true },
- { "modeportaal.nl", true },
- { "moderatoren.org", true },
- { "modern-family.tv", true },
- { "modern-gaming.ga", true },
- { "modernapprenticeships.org", true },
- { "modernautorepairs.com", true },
- { "moderncommercialrealestate.com", true },
- { "moderniknihovna.cz", true },
- { "modifiedmind.com", true },
- { "modmountain.com", true },
- { "modnitsa.info", true },
- { "modonor.dk", true },
- { "modscrew.com", true },
- { "modul8infinity.co", true },
- { "module.market", true },
- { "modulex-gmbh.de", true },
- { "moduloseltaladro.com", true },
- { "modusawperandi.com", true },
- { "moe-max.jp", true },
- { "moebel-vergleichen.com", true },
- { "moechel.com", true },
- { "moeclue.com", true },
- { "moefactory.com", true },
- { "moegi.ml", true },
- { "moego.me", true },
- { "moehrke.cc", true },
- { "moekes.amsterdam", true },
- { "moeking.me", true },
- { "moeloli.cc", true },
- { "moenew.us", true },
- { "moesif.com", true },
- { "moetrack.com", true },
- { "mofidmed.com", true },
- { "mogica.tk", true },
- { "moha-swiss.com", false },
- { "mohamedhosting.tk", true },
- { "mohanmekap.com", true },
- { "mohela.com", true },
- { "mohitchahal.com", true },
- { "mohot.com", true },
- { "mohot.fit", true },
- { "mohr-maschinenservice.de", true },
- { "moin.jp", true },
- { "moipourtoit.ch", true },
- { "moipourtoit.com", true },
- { "moipourtoit.org", true },
- { "moisesbarrio.es", true },
- { "mojaknjiznica.com", false },
- { "mojavenissanofbarstowparts.com", true },
- { "mojeco2.cz", true },
- { "mojefedora.cz", true },
- { "mojilitygroup.com", true },
- { "mojitoparty-articlespara.website", true },
- { "mojizuri.com", true },
- { "mojizuri.jp", true },
- { "mojkragujevac.net", true },
- { "mojleksikon.com", true },
- { "mojnet.eu", true },
- { "mojnet.net", true },
- { "mojoco.co.za", true },
- { "mojomusic.org", true },
- { "mojt.net", true },
- { "mojzis.com", true },
- { "mojzis.cz", true },
- { "mojzisova.com", true },
- { "mokeedev.com", true },
- { "mokhan.ca", true },
- { "mokhtarmial.com", false },
- { "moki.org.pl", true },
- { "molb.org", true },
- { "moldova-online.ml", true },
- { "moldovanka.tk", true },
- { "moldovawall.tk", true },
- { "molecularbiosystems.org", true },
- { "moleskinestudio.com", true },
- { "molinero.xyz", true },
- { "mollaretsmeningitis.org", true },
- { "molleron.net", true },
- { "mollie.com", true },
- { "molodost.ga", true },
- { "molokai.org", true },
- { "moltapor.tk", true },
- { "molti.hu", true },
- { "molun.net", true },
- { "molunerfinn.com", true },
- { "molwick.com", true },
- { "momentsofimpact.info", true },
- { "momentum.photos", true },
- { "momentumcoach.se", true },
- { "momentumdash.com", true },
- { "momentumdesign.website", true },
- { "momirfarooq.com", true },
- { "momo0v0.club", true },
- { "momobako.com", true },
- { "momocogames.com", true },
- { "momocrats.com", true },
- { "momove.nl", true },
- { "momozeit.de", true },
- { "momsays.co.za", true },
- { "momstableonline.com", true },
- { "momut.org", true },
- { "momy-genealogie.info", true },
- { "mon-partage.fr", true },
- { "mon-trafic.com", false },
- { "mon22.ch", false },
- { "mona-antenna.com", true },
- { "monachatdeco.com", false },
- { "monaco-automaten.de", true },
- { "monad.io", true },
- { "monakasatmasr.com", true },
- { "monalyse.com", true },
- { "monarchcleanersnc.com", true },
- { "monarcjuexpo.ch", true },
- { "monbudget.org", false },
- { "moncoach.ch", false },
- { "mondedie.fr", true },
- { "mondial-movers.nl", true },
- { "mondo-it.ch", true },
- { "mondonet.org", true },
- { "mondzorgaanzee.nl", true },
- { "moneni.com", true },
- { "monerogamez.com", true },
- { "moneta-rossii.ru", true },
- { "monetki.net", true },
- { "money-fast.ga", true },
- { "moneybird.com", true },
- { "moneybird.nl", true },
- { "moneychangersoftware.com", true },
- { "moneycredit.eu", true },
- { "moneyfortitude.com", true },
- { "moneygo.se", true },
- { "moneyhouse.de", true },
- { "moneypark.ch", true },
- { "moneyreal.tk", true },
- { "moneytoday.se", true },
- { "mongolbox.tk", true },
- { "mongolie.net", true },
- { "mongolieenfrance.fr", true },
- { "monicajean.photography", true },
- { "moninformaticien.ovh", true },
- { "moninformaticien.shop", true },
- { "moniquedekermadec.com", true },
- { "moniquemunhoz.com.br", true },
- { "monitman.com", true },
- { "monitorbox.jp", true },
- { "monitord.at", true },
- { "monitoring.kalisz.pl", true },
- { "monitzer.com", true },
- { "monix.io", true },
- { "monkatos.org", true },
- { "monkay.de", true },
- { "monkeybusiness.agency", true },
- { "monkeyfaqs.com", true },
- { "monkeysorce.tk", true },
- { "monkeytek.ca", true },
- { "monlabs.com", true },
- { "monlissagebresilien.com", true },
- { "monloyer.quebec", true },
- { "monnyonle.hu", true },
- { "mono.cafe", true },
- { "mono0x.net", true },
- { "monobunt.at", true },
- { "monodejuegos.shop", true },
- { "monolithapps.com", true },
- { "monolithic.tk", true },
- { "monolithindustries.com", true },
- { "monolithinteractive.com", true },
- { "monopoly-one.com", true },
- { "monotai.com", true },
- { "monoworks.co.jp", true },
- { "monpc-pro.fr", false },
- { "monpermismoto.com", true },
- { "monpermisvoiture.com", true },
- { "monpetitmobile.com", true },
- { "monsieurbureau.com", true },
- { "monsieursavon.ch", false },
- { "monsitemoncommerce.com", true },
- { "monsterandfox.co.uk", true },
- { "monstermashentertainments.co.uk", true },
- { "monsterx.cn", true },
- { "mont-thabor.fr", true },
- { "montack.de", true },
- { "montage-kaika.de", false },
- { "montanasky.tv", true },
- { "montanteaesthetics.com", true },
- { "montanwerk.de", true },
- { "montarfotoaki.com", true },
- { "montas.io", true },
- { "montemanik.com", true },
- { "montessori.edu.vn", true },
- { "montgomeryfirm.com", true },
- { "monthlyfukuoka.com", true },
- { "montopolis.com", true },
- { "montpreveyres.ch", false },
- { "montrain.com", true },
- { "montrealcatadoptions.com", true },
- { "montredeal.fr", true },
- { "montsaintaignan.fr", true },
- { "montychristie.com", true },
- { "monwarez.ovh", true },
- { "monzo.com", true },
- { "monzo.me", true },
- { "monzo.tk", true },
- { "moo.la", true },
- { "moobl.io", true },
- { "moodfoods.com", true },
- { "moolah.rocks", true },
- { "moon.fish", true },
- { "moonagic.com", true },
- { "moonbench.xyz", true },
- { "moonbot.io", true },
- { "moonboys.de", true },
- { "moonchart.co.uk", true },
- { "moondrop.org", true },
- { "moonkin.eu", true },
- { "moonlabs.nl", true },
- { "moonlightdesign.org", true },
- { "moonmelo.com", true },
- { "moonraptor.co.uk", false },
- { "moonraptor.com", false },
- { "moonrhythm.io", true },
- { "moonshyne.org", true },
- { "moontaj.com", true },
- { "moonue.com", true },
- { "moonvpn.org", true },
- { "moonwolfwiccanschool.tk", true },
- { "moorelawfirmaz.com", true },
- { "moorewelliver.com", true },
- { "moorfunevents.co.uk", true },
- { "moorparkelectrical.com", true },
- { "moorparkelectrician.com", true },
- { "moorparkexteriorlighting.com", true },
- { "moorparklandscapelighting.com", true },
- { "moorparklighting.com", true },
- { "moorparkoutdoorlighting.com", true },
- { "moort.be", true },
- { "mooselook.de", true },
- { "moosikapp.tk", true },
- { "moosmann-moehrle.de", true },
- { "moosmaus.tk", true },
- { "moot-info.co.za", true },
- { "moovablestorage.com", true },
- { "moparcraft.net", true },
- { "moparisthebest.com", true },
- { "moparisthebest.net", true },
- { "moparisthebest.org", true },
- { "moparscape.net", true },
- { "mopedreifen.de", false },
- { "mopie.de", true },
- { "mopliangxing.com", true },
- { "moplx.com", true },
- { "moppeleinhorn.de", true },
- { "mopxing.com", true },
- { "mora.pl", true },
- { "moraffpritchard.com", true },
- { "moraldehornuez.tk", true },
- { "morbatex.com", true },
- { "morbiceramicindustry.com", true },
- { "morbitzer.de", true },
- { "morbius.cz", true },
- { "morbotron.com", true },
- { "morchstore.com", true },
- { "mordrum.com", true },
- { "more-hikkoshi.com", true },
- { "more-terrain.de", true },
- { "moreal.co", true },
- { "morecreativelife.com", true },
- { "moreniche.com", true },
- { "morepablo.com", true },
- { "morepay.cn", true },
- { "moresw.com", true },
- { "morethanautodealers.com", true },
- { "morethancode.be", true },
- { "morethandigital.info", true },
- { "morgan-insurance.com", true },
- { "morgansleisure.co.uk", true },
- { "morganwilder.com", true },
- { "morgner.com", true },
- { "moritz-baestlein.de", true },
- { "moritzkornher.de", true },
- { "moritztremmel.de", true },
- { "moriz.de", true },
- { "moriz.net", true },
- { "mormon-colleges.com", true },
- { "mormonleaks.io", true },
- { "morningcurve.com", true },
- { "morningstar.moe", true },
- { "morningtime.cloud", true },
- { "moroccanews.tk", true },
- { "moroccotodaynews.ga", true },
- { "morox.top", true },
- { "morozko.gq", true },
- { "morris.computer", true },
- { "morrisby.com", true },
- { "mortengamstpedersen.tk", true },
- { "mortgagecalculator.biz", true },
- { "mortis.eu", true },
- { "morvo.mx", true },
- { "mosaic-design.ru", true },
- { "mosaicadvisors.com", true },
- { "mosaicmarble.com", true },
- { "mosboutique.it", true },
- { "moscatalogue.net", true },
- { "moscow-moscow.tk", true },
- { "moscow-new.cf", true },
- { "moscow.dating", true },
- { "moscowlove.tk", true },
- { "moseleyelectronics.com", true },
- { "moseracctg.com", true },
- { "mosfet.cz", true },
- { "mosin.org", true },
- { "moskeedieren.nl", true },
- { "mosnews.tk", true },
- { "moso.io", true },
- { "mosquitojoe.com", true },
- { "mossaino.de", true },
- { "mosscade.com", true },
- { "mostafabanaei.cf", true },
- { "mostbelehuzunk.hu", true },
- { "mosternaut.com", true },
- { "motd.ch", true },
- { "motekforce.link", true },
- { "motekforcelink.com", true },
- { "motekforcelink.eu", true },
- { "motekforcelink.net", true },
- { "motekforcelink.nl", true },
- { "motekmedical.com", true },
- { "motekmedical.eu", true },
- { "motekmedical.nl", true },
- { "motekrysen.com", true },
- { "moteksystems.com", true },
- { "moteksystems.net", true },
- { "motezazer.fr", true },
- { "mothereff.in", false },
- { "mothership.de", true },
- { "motherwell.tech", true },
- { "motichi.cf", true },
- { "motifstudio.com.ua", true },
- { "motionless.nl", true },
- { "motionvideos.uk", true },
- { "motiv-rechts.tk", true },
- { "motiweb.fr", true },
- { "motlife.net", false },
- { "motmplus.com", true },
- { "motoactionimola.it", true },
- { "motoclubentresemana.tk", true },
- { "motocyklovedily.cz", true },
- { "motodb.co.uk", true },
- { "motodb.eu", true },
- { "motodb.net", true },
- { "motodb.uk", true },
- { "motogb.net", true },
- { "motohell.com", true },
- { "motojato.com.br", true },
- { "motoland.ml", true },
- { "motonauticaibiza.com", true },
- { "motor-forum.nl", true },
- { "motor1.com", true },
- { "motoreflex.com", true },
- { "motornaolja.com", true },
- { "motorpointarenacardiff.co.uk", true },
- { "motorring.ru", true },
- { "motorsplus.com", false },
- { "motorsportdiesel.com", true },
- { "motoryachtclub-radolfzell.de", true },
- { "motoscascos.com", true },
- { "motosikletevi.com", true },
- { "motospaya.com", true },
- { "motostorie.blog", true },
- { "mototax.ch", true },
- { "motovated.co.nz", false },
- { "motowilliams.com", true },
- { "motransportinfo.com", true },
- { "motshop.tk", true },
- { "motstats.co.uk", true },
- { "mott.pe", true },
- { "motto-iikoto.com", true },
- { "motun.ga", true },
- { "mouche.fr", true },
- { "moucloud.cn", true },
- { "moulinaparoles.ca", true },
- { "mouniresidences.com", true },
- { "mountain-rock.ru", true },
- { "mountainactivitysection.org.uk", true },
- { "mountainbatchers.de", true },
- { "mountainchalet.blue", true },
- { "mountainspringsrentals.ca", true },
- { "mountaintree.eu", true },
- { "mountainutilities.eu", true },
- { "mountbatten.cz", true },
- { "mountpost.tk", true },
- { "mousepotato.uk", true },
- { "moutiezhaller.com", true },
- { "movacare.de", true },
- { "movahoteis.com.br", true },
- { "move-out-cleaning.co.uk", true },
- { "move.mil", true },
- { "moveltix.net", true },
- { "movember.com", false },
- { "movementdanceacademy.it", true },
- { "movewellnesslab.com", true },
- { "movfun.ga", true },
- { "movie-infos.net", true },
- { "movie1000.com", true },
- { "moviefreeze.com", true },
- { "movieguys.org", true },
- { "moviesetc.net", true },
- { "movilcelular.es", true },
- { "moviltronix.com", true },
- { "movimento-terra.it", true },
- { "movinglogistics.nl", false },
- { "movingtohttps.com", true },
- { "movlib.org", true },
- { "moy.cat", true },
- { "moylen.eu", true },
- { "mozartgroup.hu", true },
- { "mozektevidi.net", true },
- { "mozilla-hispano.org", true },
- { "mozilla.cz", true },
- { "mozzez.de", true },
- { "mp3gratuiti.com", true },
- { "mpa-pro.fr", true },
- { "mpac.ca", false },
- { "mpc-hc.org", true },
- { "mpcompliance.com", true },
- { "mpetroff.net", true },
- { "mpgaming.pro", true },
- { "mpgu.tk", true },
- { "mphwinkel.nl", true },
- { "mpintaamalabanna.it", true },
- { "mpkrachtig.nl", true },
- { "mplanetphl.fr", false },
- { "mplant.io", true },
- { "mpoonamchandpearls.com", true },
- { "mprsco.eu", true },
- { "mpsoundcraft.com", true },
- { "mpu-beratungsstellen.com", true },
- { "mpu-ibbi.de", true },
- { "mpu-vorbereitung.com", true },
- { "mpublicidad.com", true },
- { "mr-anderson.org", true },
- { "mr-bills.com", true },
- { "mr-moulding-knives.com", true },
- { "mr-nachhilfe.de", true },
- { "mr-wolf.nl", false },
- { "mraag.xyz", true },
- { "mralonas.ga", true },
- { "mralonas.gq", true },
- { "mralonas.ml", true },
- { "mralonas.tk", true },
- { "mrandmrsparrot.gr", true },
- { "mrbmafrica.com", true },
- { "mrbounce.com", true },
- { "mrbouncescrazycastles.co.uk", true },
- { "mrbouncycastle.com", true },
- { "mrbuckykat.com", true },
- { "mrca-sharp.com", false },
- { "mrcoolevents.com", true },
- { "mrcrowley217.com", true },
- { "mrd.ninja", true },
- { "mrdatenschutz.de", true },
- { "mrdayman.com", true },
- { "mredsanders.net", true },
- { "mremallin.ca", true },
- { "mrevolution.eu", true },
- { "mrhc.ru", true },
- { "mrhookupsd.com", true },
- { "mrichard333.com", true },
- { "mricspatial.com", true },
- { "mrinalpurohit.in", true },
- { "mrjhnsn.com", true },
- { "mrjo.sh", true },
- { "mrjooz.com", false },
- { "mrkapowski.com", true },
- { "mrketolocksmith.com", true },
- { "mrknee.gr", true },
- { "mrkrabat.de", true },
- { "mrlove.tk", true },
- { "mrmad.com.tw", true },
- { "mrmanner.eu", true },
- { "mrmemory.co.uk", true },
- { "mrnathanpowell.com", true },
- { "mrnh.de", true },
- { "mrnonz.com", true },
- { "mrnordic.com", true },
- { "mrprintables.com", true },
- { "mrs-labo.jp", true },
- { "mrs-shop.com", true },
- { "mrsbairds.com", false },
- { "mrschristine.com", true },
- { "mrserge.lv", true },
- { "mrsheep.win", true },
- { "mrsiding.net", true },
- { "mrsk.me", true },
- { "mrstat.co.uk", true },
- { "mrston.ml", true },
- { "mrstuudio.ee", true },
- { "mruczek.ga", true },
- { "mrv.li", true },
- { "mrvnt.co", true },
- { "mrx.one", false },
- { "mrxn.net", true },
- { "ms-australia.de", true },
- { "ms-ch.ch", true },
- { "ms-host.fr", true },
- { "msa-aesch.ch", true },
- { "msafiri.co", true },
- { "mscc.mu", true },
- { "mscc.org", true },
- { "msch.pw", true },
- { "msebera.cz", true },
- { "mservers.cz", true },
- { "msh100.uk", true },
- { "msha.gov", true },
- { "msi-zlin.cz", true },
- { "msiegmund.com", true },
- { "msize48.ch", true },
- { "msmails.de", true },
- { "msnr.net", true },
- { "msoll.de", true },
- { "msoll.eu", true },
- { "msopopop.cn", true },
- { "mspsocial.net", true },
- { "msquadrat.de", true },
- { "msroot.de", true },
- { "mssora.com", true },
- { "mssys.de", true },
- { "mstdn.blue", true },
- { "mstdn.io", true },
- { "mstdn.onl", false },
- { "msuna.net", true },
- { "msx.org", true },
- { "mszavodumiru.cz", true },
- { "mt-bank.jp", true },
- { "mt-tech.fi", true },
- { "mt.search.yahoo.com", false },
- { "mt1016.com", true },
- { "mt2414.com", true },
- { "mta.fail", true },
- { "mta.org.ua", true },
- { "mtane0412.com", true },
- { "mtasa.com", true },
- { "mtasa.hu", true },
- { "mtasts.xyz", true },
- { "mtauburnassociates.com", true },
- { "mtcpuntosalud.com", true },
- { "mtcq.jp", true },
- { "mtd.org", true },
- { "mte.sk", true },
- { "mtechprecisioninc.com", true },
- { "mteleport.net", true },
- { "mtgeni.us", true },
- { "mtgenius.com", true },
- { "mtgsuomi.fi", true },
- { "mthode.org", true },
- { "mthopebank.com", true },
- { "mthrbrd.com", true },
- { "mthrbrd.net", true },
- { "mths.be", false },
- { "mticareportal.com", true },
- { "mtinz.com", true },
- { "mtiryaki.com", true },
- { "mtjholding.ee", true },
- { "mtlconcerts.com", true },
- { "mtltransport.com", true },
- { "mtludlow.co.uk", true },
- { "mtouch.facebook.com", false },
- { "mtravelers.net", true },
- { "mtrip.com", true },
- { "mtrock.ru", true },
- { "mts-energia.eu", true },
- { "mts-server.com", true },
- { "mtsolar.es", true },
- { "mu.search.yahoo.com", false },
- { "mu105.cc", true },
- { "muabannhanh.com", false },
- { "mubase.dk", true },
- { "mubiflex.nl", true },
- { "muchohentai.com", true },
- { "muchotrolley.tk", true },
- { "muckingabout.eu", true },
- { "muckrack.com", true },
- { "mucmail.de", true },
- { "mudanzasacuna.com.co", true },
- { "mudaomundo.org", true },
- { "mudasobwa.tk", true },
- { "mudbenesov.cz", true },
- { "mudcomplex.ga", true },
- { "mudcrab.us", false },
- { "mudit.xyz", false },
- { "muelhau.pt", true },
- { "muell-weg.de", true },
- { "mueller-gaestehaus.de", true },
- { "muenchberger.com", true },
- { "muffs.ru", true },
- { "mufibot.net", true },
- { "mugen.technology", true },
- { "muguayuan.com", true },
- { "muhabbet.org", true },
- { "muhcow.dk", true },
- { "mui.jp", true },
- { "muilties.com", true },
- { "muitadica.com", false },
- { "muitoalemdobolo.com.br", true },
- { "mujerfutura.com", true },
- { "muk-kobetsu.com", true },
- { "mukilteodentalarts.com", true },
- { "mukilteoeuropeanautorepair.com", true },
- { "muku-flooring.com", true },
- { "mulaccosmetics.com", true },
- { "mulej.net", true },
- { "mulheres18.com", true },
- { "muling.lu", true },
- { "mulk.hopto.org", true },
- { "mullen.net.au", true },
- { "mullens-usedcars.be", false },
- { "mullinsfarms.com", true },
- { "muloft.com", true },
- { "multibit.org", true },
- { "multibomasm.com.br", true },
- { "multiclinicacardio.com.br", true },
- { "multicomhost.com", true },
- { "multicore.cl", true },
- { "multicorpbra.com", true },
- { "multigamecard.com", true },
- { "multigeist.de", true },
- { "multikalender.de", false },
- { "multimatte.com", true },
- { "multimed-solutions.com", true },
- { "multimed.krakow.pl", true },
- { "multimedia-pool.com", true },
- { "multimediapc.de", true },
- { "multiplayernow.com", true },
- { "multipleservers.com", true },
- { "multirep.ch", false },
- { "multiroom-streaming.de", true },
- { "multischool.tk", true },
- { "multisite.ovh", true },
- { "multitec.nl", true },
- { "multitek.no", true },
- { "multitenantlaravel.com", true },
- { "multiterm.org", true },
- { "multitheftauto.com", true },
- { "multixa.net", true },
- { "multrier.fr", true },
- { "mum.ceo", true },
- { "mumablue.com", true },
- { "mumakil.fi", false },
- { "mumbaionlinegifts.com", true },
- { "mummyandmephotography.com", true },
- { "mumolabs.com", true },
- { "munch.me", true },
- { "munchcorp.com", true },
- { "mundoarabe.com.br", true },
- { "mundoconejos.com", true },
- { "mundodasmensagens.com", true },
- { "mundokinderland.com.br", true },
- { "mundolarraz.es", true },
- { "mundomagicotv.com", true },
- { "mundoperfecto.net", true },
- { "mundoperros.es", true },
- { "mundotortugas.com", true },
- { "mundschenk.at", true },
- { "mundtec.com.br", true },
- { "munduch.cz", true },
- { "munduch.eu", true },
- { "munera.ca", true },
- { "munich-eventlocations.de", true },
- { "munki.org", true },
- { "munkibuilds.org", true },
- { "muntproever.nl", true },
- { "munwr.com", true },
- { "muot.tv", false },
- { "muqu.co", true },
- { "mur-vegetal-interieur.fr", true },
- { "murakami-sah.com", true },
- { "muralswallpaper.co.uk", true },
- { "muralswallpaper.com", true },
- { "murashun.jp", true },
- { "muratore-roma.it", true },
- { "murfy.nz", true },
- { "murgi.de", true },
- { "murmansk.cf", true },
- { "murmashi.com", true },
- { "murmashi.ru", true },
- { "murmu.re", true },
- { "murof.com.br", true },
- { "murray.xyz", true },
- { "murraya.cn", true },
- { "musa.gallery", true },
- { "musasdanet.com", true },
- { "muscle-tg.com", true },
- { "muscleangels.com", true },
- { "musclecarresearch.com", true },
- { "muscolinomusic.com", true },
- { "muscularbabes.net", true },
- { "museclef.com", true },
- { "musehelix.com", true },
- { "muserver.io", true },
- { "muses-success.info", true },
- { "musettishop.com", true },
- { "mush-room.co.jp", true },
- { "mushel.ddns.net", true },
- { "mushikabu.net", true },
- { "music-is-my-life.de", true },
- { "music-project.eu", true },
- { "music-world.pl", true },
- { "music.amazon.com", true },
- { "musica.com", true },
- { "musicalive.nl", true },
- { "musicall.com", true },
- { "musicalschwarzenburg.ch", true },
- { "musicasbr.com.br", true },
- { "musicchris.de", true },
- { "musicfactory.ml", true },
- { "musicfromgod.com", true },
- { "musicgamegalaxy.de", true },
- { "musician.dating", true },
- { "musicindustrydb.org", true },
- { "musicinsiderdigest.com", true },
- { "musickhouseleveling.com", true },
- { "musicompare.com", true },
- { "musicradio.ga", true },
- { "musicschoolonline.com", true },
- { "musicstudio.pro", true },
- { "musicwear.cz", true },
- { "musicworkout.de", true },
- { "musik-mentaltraining.ch", true },
- { "musiker.tk", true },
- { "musikholics.com", true },
- { "musiktag2020.ch", true },
- { "musikverein-elten.de", true },
- { "musikzentrale.net", true },
- { "musketiers.tk", true },
- { "musketonhaken.nl", false },
- { "muskokavoltz.ca", true },
- { "muslim.singles", true },
- { "musmann.io", true },
- { "mussalains.com", true },
- { "musta.ch", true },
- { "mustard.co.uk", true },
- { "mustasj.no", true },
- { "mustat.com", true },
- { "muster-folien.de", true },
- { "muster-schablonen.de", true },
- { "mustertexte-musterbewerbung.de", true },
- { "musthavesforreal.com", true },
- { "musthinsider.com", true },
- { "muszic.co", true },
- { "mutantmonkey.in", true },
- { "mutantmonkey.info", true },
- { "mutualmoney.ml", true },
- { "mutuelle.fr", true },
- { "muunnin.net", true },
- { "muurlingoogzorg.nl", true },
- { "muwatenraqamy.org", true },
- { "muz2u.ru", true },
- { "muzeumkomiksu.eu", true },
- { "muzgra.in", true },
- { "muzhijy.com", true },
- { "muzikantine.nl", true },
- { "muzykanawesele.info", true },
- { "mv-schnuppertage.de", true },
- { "mvandek.nl", true },
- { "mvbits.com", true },
- { "mvion.fr", true },
- { "mvisioncorp.com", true },
- { "mvistatic.com", true },
- { "mvno.io", true },
- { "mvorisek.com", true },
- { "mvorisek.cz", true },
- { "mvpinfo.ga", true },
- { "mvpower.pt", true },
- { "mw.search.yahoo.com", false },
- { "mwainc.org", true },
- { "mwalz.com", true },
- { "mware-staging.azurewebsites.net", true },
- { "mwba.org", true },
- { "mwe.st", true },
- { "mwlcouriers.com", true },
- { "mww.moe", true },
- { "mx-quad.fr", true },
- { "mx.org.ua", true },
- { "mx.search.yahoo.com", false },
- { "mx5international.com", true },
- { "mxdvl.com", true },
- { "my-best-wishes.com", true },
- { "my-bratsk.tk", true },
- { "my-contract.ch", false },
- { "my-contract.info", false },
- { "my-contract.net", false },
- { "my-dns.co.il", true },
- { "my-ebook.es", true },
- { "my-floor.com", true },
- { "my-gode.fr", true },
- { "my-host.ovh", true },
- { "my-hps.de", true },
- { "my-ip.work", true },
- { "my-new-bikini.de", true },
- { "my-nextcloud.at", true },
- { "my-profile.org", true },
- { "my-sex-cam.com", true },
- { "my-stuff-online.com", true },
- { "my-tunisia.tk", true },
- { "my-web.xyz", true },
- { "my-webcloud.at", true },
- { "my.onlime.ch", false },
- { "my.usa.gov", false },
- { "my4g.net", true },
- { "my4thtelco.com.sg", true },
- { "my4thtelco.sg", true },
- { "myabcm.com", true },
- { "myaccount.google.com", false },
- { "myactivity.google.com", false },
- { "myadpost.com", true },
- { "myadself.com", true },
- { "myaggic.com", true },
- { "myalliancechurch.com", true },
- { "myamend.com", true },
- { "myamihealth.com", true },
- { "myamity.info", true },
- { "myammo.ru", true },
- { "myanimelist.net", true },
- { "myapexcard.com", true },
- { "myarcade.org", true },
- { "mybagofcoffee.com", true },
- { "mybasementdoctor.com", true },
- { "mybathroom.tk", true },
- { "mybauingenieur24.de", true },
- { "mybb.com", true },
- { "mybb.de", true },
- { "mybestmattress.com", true },
- { "mybestwebsitebuilder.com", true },
- { "mybicc.org", true },
- { "mybillie.com", true },
- { "mybloggedlife.com", true },
- { "mybodylife.com", true },
- { "mybon.at", false },
- { "myboothang.com", true },
- { "mybusiness.wien", true },
- { "mycaelis.fr", true },
- { "mycakeangel.com", true },
- { "mycam.gq", true },
- { "mycamshowhub.com", true },
- { "mycamshowhub.to", true },
- { "mycareersfuture.sg", true },
- { "mycarinsurance123.com", true },
- { "mycc.be", true },
- { "mychamberlain.co.nz", true },
- { "mychamberlain.com", true },
- { "mychamberlain.com.au", true },
- { "mychamberlain.eu", true },
- { "mychemromance.tk", true },
- { "mycinema.pro", true },
- { "mycircleworks.com", true },
- { "myclgnotes.com", true },
- { "myclinicalstudybuddy.com", true },
- { "mycloud-system.com", true },
- { "mycofairtrade.com", false },
- { "myconan.net", true },
- { "myconan.tk", true },
- { "myconf.com", true },
- { "myconf.uk", true },
- { "myconsulting.ch", false },
- { "mycookrecetas.com", true },
- { "mycounterstrike.ru", true },
- { "mycoupons.com", true },
- { "mycr.eu", true },
- { "mycreativenook.com", true },
- { "mycreditcardcenter.com", true },
- { "mycreditunion.gov", true },
- { "mycrypnet.io", true },
- { "mycrypto.com", true },
- { "mycrystalgrove.com", true },
- { "mycustomwriting.com", true },
- { "mydais.org", true },
- { "mydarkstar.net", true },
- { "mydatadoneright.eu", true },
- { "mydaywebapp.com", true },
- { "mydebian.in.ua", true },
- { "mydentalplan.gr", true },
- { "mydenverhomesource.com", true },
- { "mydevolo.com", true },
- { "mydevolo.de", true },
- { "mydevops.cloud", true },
- { "mydigitalweek.com", true },
- { "mydna.bio", true },
- { "mydnshost.co.uk", true },
- { "mydoc.fr", true },
- { "mydocserve.com", true },
- { "mydomaindesk.com", true },
- { "mydoxod.tk", true },
- { "mydroneservices.ca", true },
- { "mydroneservices.com", true },
- { "mydsacontabilidad.com", true },
- { "myduffyfamily.com", true },
- { "myeasybooking.de", true },
- { "myeberspaecher.com", true },
- { "myebony.cam", true },
- { "myecms.com", true },
- { "myedcreview.cf", true },
- { "myeditclub.ml", true },
- { "myedu.ga", true },
- { "myeisenbahn.de", true },
- { "myekon.com", true },
- { "myeriri.com", true },
- { "myesk.rs", true },
- { "myessaygeek.com", true },
- { "myetherwallet.com", true },
- { "myexams.nl", true },
- { "myf.cloud", true },
- { "myfae.eu", true },
- { "myfantasysportstalk.com", true },
- { "myfavorite.com.tw", true },
- { "myfedloan.org", true },
- { "myfirenet.com", false },
- { "myforfaitmobile.com", true },
- { "myfortdodge.com", true },
- { "myfreemp3.click", true },
- { "myfrenchtattoo.fr", true },
- { "myfursona.com", true },
- { "myg21.com", true },
- { "mygadgetguardian.lookout.com", false },
- { "mygallery.homelinux.net", true },
- { "mygameconsole.tk", true },
- { "mygate.at", false },
- { "mygear.live", true },
- { "mygedit.com", true },
- { "mygeneral.org", true },
- { "mygeotrip.com", true },
- { "mygest.me", true },
- { "mygigabitnation.com", true },
- { "mygignation.com", true },
- { "mygirlfriendshouse.com", true },
- { "mygnmr.com", true },
- { "mygoldennetwork.com", true },
- { "mygomel.tk", true },
- { "mygreatlakes.org", true },
- { "mygreatwebsite.co.uk", true },
- { "mygreenrecipes.com", true },
- { "mygretchen.de", true },
- { "mygrodno.tk", true },
- { "mygrotto.org", true },
- { "mygymer.ch", true },
- { "myhatsuden.jp", true },
- { "myhealthyday.com", true },
- { "myhmz.bid", true },
- { "myhollywoodnews.com", true },
- { "myhome-24.pl", true },
- { "myhomeworkpapers.com", true },
- { "myhoor.ga", true },
- { "myhostname.net", true },
- { "myhuthwaite.com", true },
- { "myibidder.com", true },
- { "myimds.com", true },
- { "myimmitracker.com", true },
- { "myinsiderplus.com", true },
- { "myinsuranceauto.com", true },
- { "myinsurancelife.com", true },
- { "myinsurancesource.com", true },
- { "myinternist.com", true },
- { "myintimtoys.com", true },
- { "myinvite.nl", true },
- { "myipv4.de", true },
- { "myjudo.net", true },
- { "myjumparoo.co.uk", true },
- { "myjumpsuit.de", true },
- { "myjuvelirika.ru", true },
- { "myki.co", true },
- { "mykontool.de", true },
- { "mykumedir.com", true },
- { "mykursumlija.tk", true },
- { "mylatestnews.org", true },
- { "mylawyer.be", true },
- { "myleanfactory.de", true },
- { "mylegacyvip.com", true },
- { "mylennonbuddy.com", true },
- { "mylennonbuddy.info", true },
- { "mylennonbuddy.net", true },
- { "mylennonbuddy.org", true },
- { "mylife360mag.com", true },
- { "mylifeabundant.com", true },
- { "mylifeinsurancechoices.info", true },
- { "myliftmaster.com", true },
- { "myliftmaster.eu", true },
- { "mylight.tk", true },
- { "mylittlechat.ru", true },
- { "myliveupdates.com", true },
- { "mylkguys.com", true },
- { "myloan.hk", true },
- { "myloanmanager.com", true },
- { "myloneworkers.com", true },
- { "mylookout.com", false },
- { "mylotto.co.nz", true },
- { "mylstrom.com", true },
- { "mylucknursinghome.com", true },
- { "mymall.co.jp", true },
- { "mymb.pm", true },
- { "mymedz.nl", true },
- { "mymerlin.co.nz", true },
- { "mymerlin.com.au", true },
- { "mymixtapez.com", true },
- { "mymkphotography.com", true },
- { "mymommyworld.com", true },
- { "mymonture.com", true },
- { "mymotor.nl", true },
- { "mymun.com", true },
- { "mymun.net", true },
- { "mymx.lu", true },
- { "myna.go.jp", true },
- { "mynameistavis.com", true },
- { "mynaturalmood.es", true },
- { "myndcoin.com", true },
- { "myndcoins.com", true },
- { "myndighetermeddnssec.se", true },
- { "myndighetermedipv6.se", true },
- { "mynewsspot.com", true },
- { "mynext.events", true },
- { "mynextmove.org", true },
- { "mynn.io", true },
- { "mynook.info", false },
- { "myofficeconnect.co.uk", true },
- { "myonline.hu", true },
- { "myonline.store", true },
- { "myopd.in", true },
- { "myoptimalbrain.com", true },
- { "myoptumhealthcomplexmedical.com", true },
- { "myoptumhealthparentsteps.com", true },
- { "myotopie.de", false },
- { "myoueb.fr", true },
- { "myoukochou.com", true },
- { "myownconference.com", true },
- { "myownconference.com.ua", true },
- { "myownconference.pl", true },
- { "myownconference.ru", true },
- { "myowndisk.com", true },
- { "myowndisk.net", true },
- { "mypaperdone.com", true },
- { "mypaperwriter.com", true },
- { "myparisiankitchen.com", true },
- { "mypartnernews.com", true },
- { "mypartybynoelia.es", true },
- { "mypay.fr", true },
- { "mypayoffloan.com", true },
- { "mypenza.tk", true },
- { "myperfecthome.ca", true },
- { "myperks.in", true },
- { "mypfp.co.uk", true },
- { "myphamaplus.org", true },
- { "myphamthemis.com", true },
- { "myphotonics.ml", true },
- { "myphotoshopbrushes.com", true },
- { "mypillcard.com", true },
- { "mypizza-bremen.de", true },
- { "myplaceonline.com", true },
- { "myplaystation.nl", false },
- { "mypnu.net", true },
- { "myportal.ga", true },
- { "mypress.mx", true },
- { "myprintcard.de", true },
- { "myproblog.com", true },
- { "mypromoshop.com.au", true },
- { "myprotime.eu", true },
- { "myptsite.com", false },
- { "mypvhc.com", true },
- { "myqbusiness.com", true },
- { "myqservices.com", true },
- { "myraboats.tk", true },
- { "myrandomtips.com", true },
- { "myraytech.net", false },
- { "myrealestatemate.com.au", true },
- { "myrealestateschool.com", true },
- { "myred.net", true },
- { "myref.net", true },
- { "myrekber.co.id", true },
- { "myremotelogin.ddns.net", true },
- { "myrent.quebec", true },
- { "myrepubic.net", true },
- { "myrepubiic.net", true },
- { "myrepublc.net", true },
- { "myrepublic.asia", true },
- { "myrepublic.cf", true },
- { "myrepublic.cloud", true },
- { "myrepublic.co.id", true },
- { "myrepublic.com.cn", true },
- { "myrepublic.com.hk", true },
- { "myrepublic.com.kh", true },
- { "myrepublic.com.lk", true },
- { "myrepublic.com.my", true },
- { "myrepublic.com.ph", true },
- { "myrepublic.com.tw", true },
- { "myrepublic.eu.com", true },
- { "myrepublic.ga", true },
- { "myrepublic.gq", true },
- { "myrepublic.icu", true },
- { "myrepublic.id", true },
- { "myrepublic.in", true },
- { "myrepublic.limited", true },
- { "myrepublic.lk", true },
- { "myrepublic.ml", true },
- { "myrepublic.mobi", true },
- { "myrepublic.my", true },
- { "myrepublic.net", true },
- { "myrepublic.net.au", true },
- { "myrepublic.nz", true },
- { "myrepublic.ph", true },
- { "myrepublic.rocks", true },
- { "myrepublic.run", true },
- { "myrepublic.tk", true },
- { "myrepublic.tv", true },
- { "myrepublic.tw", true },
- { "myrepublic.us.com", true },
- { "myrepublic.xyz", true },
- { "myrepublicau.com", true },
- { "myrepublicaus.com", true },
- { "myrepublicbroadband.com.au", true },
- { "myrepublicfibre.com.au", true },
- { "myrepublicgroup.com", true },
- { "myrepublicinternet.com.au", true },
- { "myrepublicltd.com", true },
- { "myrepublicmy.com", true },
- { "myrepublicnz.com", true },
- { "myrepublicsg.com", true },
- { "myrepublictelecom.com", true },
- { "myrepubllc.net", true },
- { "myresearchapp.com", true },
- { "myresearchtoolbox.net", true },
- { "myresidence.de", true },
- { "myrevery.com", true },
- { "myreviews.ga", true },
- { "myrewardspoints.com", true },
- { "myriadof.com", true },
- { "myrig.com", true },
- { "myrnabiondo.com.br", true },
- { "myroofandhome.com", true },
- { "myrotvorets.center", true },
- { "myrotvorets.news", true },
- { "myrp.co", true },
- { "myrvogna.net", true },
- { "mysam.net", true },
- { "mysasiedzi.bialystok.pl", true },
- { "myschoolphoto.org", true },
- { "myseatime.com", true },
- { "myself5.de", true },
- { "myservicearl.com", true },
- { "mysexydate24.com", true },
- { "mysignal.com", true },
- { "mysmelly.com", true },
- { "mysockfactory.ch", true },
- { "mysockfactory.com", true },
- { "mysocrat.com", true },
- { "mysoundtalks.com", false },
- { "myspicer.com", true },
- { "mysql-real-escape-string.xyz", true },
- { "mysqldump-secure.org", true },
- { "myssl.com", true },
- { "mystaffonline.com", true },
- { "mystagic.cloud", true },
- { "mysteriesandmargaritasblogspot.com", true },
- { "mysteriouscode.io", true },
- { "mysteryblog.de", true },
- { "mysterydata.com", true },
- { "mysterymind.ch", false },
- { "mysterysear.ch", true },
- { "mysteryshow.site", true },
- { "mystia.org", true },
- { "mystic-welten.de", true },
- { "mysticconsult.com", true },
- { "mystickphysick.com", true },
- { "mysticrs.tk", true },
- { "mystore24.us", true },
- { "mystorymonster.com", true },
- { "mystudy.me", true },
- { "mystudycart.com", true },
- { "myswissmailaddress.com", false },
- { "myte.ch", true },
- { "mytfg.de", true },
- { "mythemeshop.com", false },
- { "mythen-fonds.ch", true },
- { "mythenfonds.ch", true },
- { "mythicdelirium.com", true },
- { "mythoughtmachine.com", true },
- { "mytime.fr", true },
- { "mytime.gl", true },
- { "myting.net", true },
- { "mytntware.com", true },
- { "mytraiteurs.com", true },
- { "mytripcar.co.uk", true },
- { "mytripcar.com", true },
- { "mytripcar.de", true },
- { "mytripcar.es", true },
- { "mytripcar.fr", true },
- { "mytruecare.org", true },
- { "mytrustadviser.com", true },
- { "mytty.net", true },
- { "mytuleap.com", false },
- { "mytun.com", true },
- { "myunox.com", true },
- { "myupdatestar.com", true },
- { "myupdatestudio.com", true },
- { "myupdatesystems.com", true },
- { "myusagepayments.com", true },
- { "myvacompany.com", true },
- { "myvalleymarketing.com", true },
- { "myvegan.menu", true },
- { "myvirtualserver.com", true },
- { "myvitalhealthsolutions.com.au", true },
- { "mywari.com", true },
- { "mywebpanel.eu", true },
- { "mywebpanel.nl", true },
- { "myweddingreceptionideas.com", true },
- { "mywetpussycams.com", true },
- { "mywindscreen.my", true },
- { "mywiwe.com.au", true },
- { "mywomenshealthgroup.com", true },
- { "myworkinfo.com", false },
- { "myworth.com.au", true },
- { "myxnr.com", true },
- { "myxxxsite.tk", true },
- { "myyubikey.net", true },
- { "myyubikey.org", true },
- { "myzhili.com", true },
- { "myzina.cz", false },
- { "mz-mz.net", true },
- { "mza.com", true },
- { "mzcsgo.top", true },
- { "mziulu.me", false },
- { "mzlive.eu", true },
- { "mzmtech.com", true },
- { "mznet.de", true },
- { "mzorn.photography", true },
- { "mzstatic.cc", true },
- { "n-design.de", true },
- { "n-gram.it", true },
- { "n-linear.org", true },
- { "n-m.lu", true },
- { "n-man.info", true },
- { "n-pix.com", false },
- { "n-un.de", false },
- { "n0099.cf", true },
- { "n0paste.tk", false },
- { "n0psled.nl", true },
- { "n26.com", true },
- { "n2diving.net", true },
- { "n36533.com", true },
- { "n36594.com", true },
- { "n3domains.com.au", true },
- { "n4v.eu", true },
- { "n6a.net", true },
- { "n7.education", true },
- { "n81818.com", true },
- { "n8ch.net", true },
- { "n8mgt.com", true },
- { "n8nvi.com", true },
- { "n8solutions.host", true },
- { "n8solutions.net", true },
- { "n8solutions.us", true },
- { "na-kipre.tk", true },
- { "na-school.nl", true },
- { "naahgluck.de", true },
- { "nabaleka.com", true },
- { "nabankco.com", true },
- { "nabeez.cf", true },
- { "naberiusmedia.com", true },
- { "nabidkamajetku.cz", true },
- { "nabidkydnes.cz", true },
- { "nabokov.tk", true },
- { "nabytek-valmo.cz", true },
- { "nacfit.com", true },
- { "nachovni.pp.ua", true },
- { "nachrichten-heute.net", true },
- { "nachsendeauftrag.net", true },
- { "nachsenden.info", true },
- { "nacin.com", true },
- { "nacktetatsachen.at", false },
- { "nacocu.cf", true },
- { "nacyklo.cz", true },
- { "nad-r.com", true },
- { "nadaquenosepas.com", true },
- { "nadejeproninu.cz", true },
- { "nadelholzkulturen.de", true },
- { "naders.com", true },
- { "nadex.com", true },
- { "nadiafourcade-photographie.fr", true },
- { "nadine-birkner.de", true },
- { "nadine-chaudier.net", true },
- { "nadjabenaissa.tk", true },
- { "nadji.ga", true },
- { "nadsandgams.com", true },
- { "nadyaolcer.fr", true },
- { "naemnuk.tk", true },
- { "nafod.net", true },
- { "naga-semi.com", true },
- { "nagashi.ma", false },
- { "nagata.info", true },
- { "nagato.tk", true },
- { "nagaya.biz", true },
- { "nagb.gov", true },
- { "nagel-dentaltechnik.de", true },
- { "nagelfam.com", true },
- { "nah.nz", true },
- { "nah.re", true },
- { "nahman.tk", true },
- { "nahouw.net", true },
- { "nai-job.jp", true },
- { "naiaokami.me", true },
- { "naide.ee", true },
- { "nailattitude.ch", false },
- { "nailchiodo.com", true },
- { "nailsalon-aztplus.com", true },
- { "nailsart.roma.it", true },
- { "nailshop.gq", true },
- { "nailtodayminneapolis.com", true },
- { "nairobibusinessreview.com", true },
- { "naivetube.com", false },
- { "najedlo.sk", true },
- { "naji-astier.com", true },
- { "naka.io", true },
- { "nakalabo.jp", true },
- { "nakama.tv", true },
- { "nakandya.com", false },
- { "nakayama.industries", true },
- { "nakayama.systems", true },
- { "nakayamaresearch.com", true },
- { "nakedinkas.com", true },
- { "nakedtruthbeauty.com", true },
- { "nakene.com", true },
- { "nakim.cf", true },
- { "nakin.tk", true },
- { "nakliyat.name.tr", true },
- { "nakliyatsirketi.biz.tr", true },
- { "nakluky.cz", true },
- { "nako.no", true },
- { "nalenders.com", true },
- { "nalepky-na-zed.cz", true },
- { "nalepte.cz", true },
- { "nalexandru.xyz", true },
- { "nalsai.de", true },
- { "namaanakperempuan.net", true },
- { "namalelaki.com", true },
- { "namaperempuan.com", true },
- { "namazvakitleri.com.tr", true },
- { "namegrep.com", true },
- { "nameid.org", true },
- { "namepros.com", true },
- { "nameproscdn.com", true },
- { "namereel.com", true },
- { "nameshield.com", true },
- { "nameshield.net", true },
- { "namethatporn.com", true },
- { "nametiles.co", true },
- { "nami.exchange", true },
- { "nami.trade", true },
- { "naminam.de", true },
- { "namrs.net", true },
- { "namskra.is", true },
- { "namu.games", true },
- { "namu.la", true },
- { "namu.live", true },
- { "namu.moe", true },
- { "namu.news", true },
- { "namu.wiki", true },
- { "namus.gov", true },
- { "nan.ci", false },
- { "nan.cm", true },
- { "nan.ge", true },
- { "nan0.cloud", true },
- { "nanaimoneighbourhoods.ca", true },
- { "nanarose.ch", false },
- { "nanch.com", true },
- { "nancytelford.com", true },
- { "nancyzone.tk", true },
- { "nandex.org", true },
- { "nandito.tk", true },
- { "nange.cn", true },
- { "nanisiyou.com", true },
- { "nankiseamansclub.com", true },
- { "nannytax.ca", true },
- { "nano.voting", true },
- { "nanogramme.fr", false },
- { "nanopixel.ch", true },
- { "nanotechnologist.com", true },
- { "nanotechnologysolutions.com.au", true },
- { "nanotechtorsion.com", true },
- { "nanowallet.io", true },
- { "nanpuyue.com", true },
- { "nansa.ch", true },
- { "nanshy.com", false },
- { "nanubo.com", true },
- { "nanubo.de", true },
- { "naomiheji.com", true },
- { "napcae.de", true },
- { "napisdata.us", true },
- { "napkins-wholesale.co.za", true },
- { "napkins-wholesale.com", true },
- { "napkins-wholesale.in", true },
- { "napkins-wholesale.nz", true },
- { "napkins-wholesale.uk", true },
- { "naplata.mk", true },
- { "napominanie.ml", true },
- { "naradiebosch.sk", true },
- { "naradiehusqvarna.sk", true },
- { "naradiemakita.sk", true },
- { "narakenkoland.net", true },
- { "naralogics.com", true },
- { "narazaka.net", true },
- { "narela.com.mx", true },
- { "narenderchopra.com", true },
- { "narfation.org", true },
- { "nargele.eu", true },
- { "nargileh.nl", true },
- { "naric.com", true },
- { "narindal.ch", true },
- { "naro.se", true },
- { "naroska.name", true },
- { "narrabeenlakesbikehire.com", true },
- { "narrativasdigitais.pt", true },
- { "narrative.network", true },
- { "narrative.org", true },
- { "narrenverein-wolkenschieber.de", true },
- { "narthollis.net", false },
- { "naruto-best.tk", true },
- { "nasaacronyms-beta.com", true },
- { "nasaacronyms.com", true },
- { "nasbi.pl", true },
- { "nasbnation.com", false },
- { "nashdistribution.com", true },
- { "nashikmatka.com", true },
- { "nashira.cz", true },
- { "nashuaradiology.com", true },
- { "nashvillebasements.com", true },
- { "nashvillelidsurgery.com", true },
- { "nashzhou.me", true },
- { "nasladko.cz", true },
- { "naslovi.net", true },
- { "nasosvdom.com.ua", true },
- { "nasr.mobi", true },
- { "nasrsolar.com", true },
- { "nastoletni.pl", true },
- { "nastycomics.eu", true },
- { "nataez.tk", true },
- { "nataldigital.com", true },
- { "natalia-in-quebec.tk", true },
- { "nataliedawnhanson.com", true },
- { "natanaelys.com", false },
- { "natariusadvokat.ga", true },
- { "natasabekvalac.tk", true },
- { "natashki.tk", true },
- { "natation-nsh.com", false },
- { "natchmatch.com", true },
- { "nateandxtina.wedding", true },
- { "nategreen.org", true },
- { "natehobi.com", true },
- { "natenom.com", true },
- { "natenom.de", true },
- { "natenom.name", true },
- { "natevolker.com", true },
- { "natgeofreshwater.com", true },
- { "nathaliebaron.ch", false },
- { "nathaliebaroncoaching.ch", false },
- { "nathaliedijkxhoorn.com", true },
- { "nathaliedijkxhoorn.nl", true },
- { "nathan.ovh", true },
- { "nathanaeldawe.com", true },
- { "nathanbarry.com", true },
- { "nathancheek.com", false },
- { "nathankonopinski.com", true },
- { "nathanmfarrugia.com", true },
- { "nathansmetana.com", true },
- { "nation-contracting.com.hk", true },
- { "nationalaustriabank.com", true },
- { "nationalbank.gov", true },
- { "nationalbanknet.gov", true },
- { "nationalcashoffer.com", true },
- { "nationalcentereg.org", true },
- { "nationalcprfoundation.com", true },
- { "nationalcrimecheck.com.au", true },
- { "nationalhomequotes.com", true },
- { "nationalmap.gov", true },
- { "nationalpriorities.org", true },
- { "nationalresourcedirectory.gov", true },
- { "nationalservice.gov", true },
- { "nationaltrails.ru", true },
- { "natives-team.ch", false },
- { "nativitynj.org", true },
- { "nativs.ch", false },
- { "natlec.com", true },
- { "natmal.net", true },
- { "natropie.pl", true },
- { "natsumihoshino.com", true },
- { "natteravneneibergen.no", true },
- { "natuerlichabnehmen.ch", true },
- { "natur-care.com", true },
- { "natur.com", true },
- { "natura-sense.com", true },
- { "naturalbijou.com", true },
- { "naturalcosmetics.cf", true },
- { "naturalezafengshui.com", true },
- { "naturalfit.co.uk", true },
- { "naturalhealthcures.net", true },
- { "naturalkitchen.co.uk", true },
- { "naturalspacesdomes.com", true },
- { "naturaum.de", true },
- { "natureclaim.com", true },
- { "natureflo.net", true },
- { "naturelk.org", true },
- { "naturesbest.co.uk", true },
- { "natureshive.org", true },
- { "naturesorganichaven.com", true },
- { "naturheilpraxis-oida.de", true },
- { "naturheilpraxis-p-grote.de", true },
- { "naturline.com", true },
- { "naturtint.co.uk", true },
- { "natusvita.com.br", true },
- { "natverkstekniker.se", true },
- { "naude.co", true },
- { "naughty.audio", true },
- { "nauris.fi", true },
- { "nausicaahotel.it", true },
- { "naut.ca", true },
- { "nautiljon.com", true },
- { "nautsch.de", true },
- { "navalarchitect.tk", true },
- { "navaneethnagesh.com", true },
- { "navarralanparty.org", true },
- { "navdeep.ca", true },
- { "navenlle.com", true },
- { "navienna.com", true },
- { "navient.com", true },
- { "navigator.ca", true },
- { "navlnachekg.cz", true },
- { "navroopsahdev.in", true },
- { "navstevnik.sk", true },
- { "navycs.com", true },
- { "nawir.de", true },
- { "nay.sk", true },
- { "nayahe.ru", true },
- { "nayami64.xyz", true },
- { "nayanaas.com", true },
- { "nayr.us", true },
- { "nazarenoviso.tk", true },
- { "nazbol.tk", true },
- { "nazevfirmy.cz", true },
- { "nazimogluinsaat.com", true },
- { "nazukebanashi.com", true },
- { "nb.zone", true },
- { "nb01.com", true },
- { "nb6.de", true },
- { "nba-2k.com", true },
- { "nba.christmas", true },
- { "nba.com.de", true },
- { "nba.de.com", true },
- { "nba.download", true },
- { "nba.gd", true },
- { "nba.gs", true },
- { "nba.gy", true },
- { "nba.hosting", true },
- { "nba.im", true },
- { "nba.live", true },
- { "nba.lu", true },
- { "nba.moe", true },
- { "nba.trade", true },
- { "nba.vc", true },
- { "nba.vg", true },
- { "nba2.com", true },
- { "nba2k.blog", true },
- { "nba2k.cc", true },
- { "nba2k.cn", true },
- { "nba2k.co", true },
- { "nba2k.com.cn", true },
- { "nba2k.download", true },
- { "nba2k.live", true },
- { "nba2k.net", true },
- { "nba2k.online", true },
- { "nba2k.tw", true },
- { "nba2kcn.com", true },
- { "nba2kmods.com", true },
- { "nba2kmt.com", true },
- { "nba2kmy.team", true },
- { "nba2kol.com", true },
- { "nba2konline.com", true },
- { "nba2konlinex.com", true },
- { "nba2kx.com", true },
- { "nbad.al", true },
- { "nbadancers.com", true },
- { "nbade.com", true },
- { "nbafile.com", true },
- { "nbagirls.com", true },
- { "nbaim.com", true },
- { "nbaimg.com", true },
- { "nbalive.cn", true },
- { "nbalivecn.com", true },
- { "nbalivex.com", true },
- { "nbari.com", true },
- { "nbask.com", true },
- { "nbasky.com", true },
- { "nbaspot.com", true },
- { "nbavc.com", true },
- { "nbavg.com", true },
- { "nbayouxi.com", true },
- { "nbclinic.co.uk", true },
- { "nbhorsetraining.com", true },
- { "nbib.gov", true },
- { "nbook.org", true },
- { "nbrii.com", true },
- { "nc-beautypro.fr", true },
- { "nc-formation.fr", true },
- { "ncands.net", true },
- { "ncarmine.com", true },
- { "ncascade.com", true },
- { "ncc-efm.com", true },
- { "ncc-efm.org", true },
- { "ncc-qualityandsafety.org", true },
- { "nccemail.net", true },
- { "nccfa.org", true },
- { "ncdc.pt", true },
- { "ncea.net.au", true },
- { "ncgt.se", true },
- { "nch.link", true },
- { "nchangfong.com", true },
- { "nchponline.org", true },
- { "ncjrs.gov", true },
- { "nclf.net", true },
- { "ncloud.freeddns.org", true },
- { "ncsc.gov.uk", true },
- { "nctx.co.uk", true },
- { "ncua.gov", true },
- { "ndarville.com", true },
- { "ndbt.com", true },
- { "ndcpolipak.com", true },
- { "ndeoffshore.com", true },
- { "nder.be", true },
- { "ndfa.net", true },
- { "ndfirefighter.com", true },
- { "ndphp.org", true },
- { "ndpigskin.com", true },
- { "nds-helicopter.de", true },
- { "ndum.ch", true },
- { "ndvr.com", true },
- { "ndx.ee", true },
- { "ndy.sex", true },
- { "ne-on.org", true },
- { "nea.gov", true },
- { "neanderthalia.tk", true },
- { "nearby.in.th", true },
- { "nearon.nl", true },
- { "neartothesky.com", true },
- { "neasahourigan.com", false },
- { "neat-patch.de", true },
- { "neatlife.co.uk", true },
- { "neatous.cz", true },
- { "neatous.net", true },
- { "neatzy.co.uk", true },
- { "neave.tv", true },
- { "neaz.tk", true },
- { "neba.io", true },
- { "nebelhauch.de", true },
- { "nebelheim.de", true },
- { "nebenbeiblog.ch", true },
- { "nebohost.tk", true },
- { "neboley.cf", true },
- { "nebras.ga", true },
- { "nebul.at", true },
- { "nebula.exchange", true },
- { "nebulae.co", true },
- { "nebuso.com", true },
- { "necessaryandproportionate.net", true },
- { "necessaryandproportionate.org", true },
- { "neckbeard.xyz", true },
- { "necord.com", true },
- { "necormansir.com", true },
- { "necromantia.tk", true },
- { "nectardigit.com", true },
- { "nectarleaf.com", true },
- { "nectir-staging.com", true },
- { "nectir.co", true },
- { "nedcdata.org", true },
- { "nederdraad.org", true },
- { "nederland.media", true },
- { "nederlands-vastgoedfonds.nl", true },
- { "nediapp.com", true },
- { "nedim-accueil.fr", true },
- { "nedlinin.com", true },
- { "nednex.com", true },
- { "nedraconsult.ru", true },
- { "nedzadalibegovic.com", true },
- { "neecist.org", true },
- { "needemand.com", true },
- { "needfire.ga", true },
- { "needstyle.ru", true },
- { "neeerd.org", true },
- { "neel.ch", true },
- { "neemzy.org", true },
- { "neev.tech", true },
- { "nefertitis.cz", true },
- { "neflabs.com", true },
- { "nefro-cme.de", true },
- { "neftis.es", true },
- { "negai.moe", true },
- { "negativecurvature.net", true },
- { "negativeentropy.org", true },
- { "neglecteddiseases.gov", true },
- { "negocios-imatore.com", true },
- { "negril.com", true },
- { "neheim-huesten.de", true },
- { "nehoupat.cz", true },
- { "nehrp.gov", true },
- { "nei.st", true },
- { "neighborhoodelectricwa.com", true },
- { "neighborshop.de", true },
- { "neil-barrett.com", true },
- { "neil-barrett.uk", true },
- { "neildaniels.com", true },
- { "neilfarrington.com", true },
- { "neillans.co.uk", true },
- { "neillans.com", true },
- { "neilpatel.com", true },
- { "neilsonmarketing.com", true },
- { "neilwynne.com", true },
- { "nejenpneu.cz", true },
- { "nejlevnejsi-parapety.cz", true },
- { "nejprivlac.cz", true },
- { "neko-nyan-nuko.com", true },
- { "neko-nyan.org", true },
- { "nekodex.net", true },
- { "nekomimi.pl", true },
- { "nekomimirouter.com", true },
- { "nekorektni.cz", true },
- { "nekosc.com", true },
- { "nekowa.moe", true },
- { "nekusoul.de", true },
- { "nelflex.com.br", true },
- { "nelhage.com", true },
- { "nellen.it", true },
- { "nemcd.com", true },
- { "nemez.net", true },
- { "nemiroth.net", true },
- { "nemo.run", true },
- { "nemopan.com", true },
- { "nemopret.dk", true },
- { "nemplex.com", true },
- { "nems.no", true },
- { "nemumu.com", true },
- { "nemunai.re", true },
- { "nemzetizaszlok.hu", true },
- { "nenkin-kikin.jp", true },
- { "neno.io", true },
- { "neo-novarion.com", true },
- { "neo2k.dk", true },
- { "neo2shyalien.eu", false },
- { "neobits.nl", true },
- { "neocities.org", true },
- { "neoclick.io", true },
- { "neodigital.bg", true },
- { "neodrive.ch", true },
- { "neoedresources.org", true },
- { "neojo.org", true },
- { "neolaudia.es", true },
- { "neonataleducationalresources.org", true },
- { "neonatalgoldenhours.org", true },
- { "neonknight.ch", true },
- { "neons.org", true },
- { "neophilus.net", true },
- { "neos.co.jp", true },
- { "neosdesignstudio.co.uk", true },
- { "neosey.com", true },
- { "neostralis.com", true },
- { "neotiv.com", true },
- { "neoverso.tk", true },
- { "neowin.net", true },
- { "neowlan.net", true },
- { "neoxcrf.com", true },
- { "neoz.com.br", true },
- { "nepal-evolution.org", true },
- { "nepezzano13.com", true },
- { "nephelion.org", true },
- { "nephology.net.au", true },
- { "nephy.jp", true },
- { "nepovolenainternetovahazardnihra.cz", true },
- { "nepozitkova.cz", true },
- { "nepremicninar.com", true },
- { "nepremicnine.click", true },
- { "nepremicnine.net", true },
- { "nepustil.net", false },
- { "nerdca.st", true },
- { "nerdherd.fun", true },
- { "nerdhouse.io", true },
- { "nerdin.space", true },
- { "nerdmind.de", true },
- { "nerdpol.ch", true },
- { "nerdpol.org", true },
- { "nerdrockshop.co.uk", true },
- { "nerds-gegen-stephan.de", true },
- { "nerdswithknives.com", true },
- { "nerdtime.de", true },
- { "nerdwallet.com", true },
- { "nerdydev.net", true },
- { "nereustech.com", true },
- { "neriumrx.com", true },
- { "nerot.eu", true },
- { "nerpa-club.ru", true },
- { "nerv.com.au", true },
- { "nerven.se", true },
- { "nesolabs.com", true },
- { "nesolabs.de", true },
- { "nestedquotes.ca", false },
- { "nestor.nu", true },
- { "neswec.org.uk", true },
- { "net-safe.info", true },
- { "net4visions.at", true },
- { "net4visions.de", true },
- { "netamia.com", true },
- { "netapps.de", true },
- { "netbank.com.au", true },
- { "netbears.com", true },
- { "netbears.ro", true },
- { "netbows.com", true },
- { "netbows.es", true },
- { "netbox.org", true },
- { "netbrewventures.com", true },
- { "netbulls.io", true },
- { "netbuzz.ru", true },
- { "netchameleon.com", true },
- { "netcials.in", true },
- { "netconnect.at", true },
- { "netcoolusers.org", true },
- { "netd.at", true },
- { "netdex.co", true },
- { "netdiode.com", true },
- { "netdiode.eu", true },
- { "netdiode.net", true },
- { "netdiode.org", true },
- { "netera.se", true },
- { "neteraser.de", true },
- { "netexpat.com", true },
- { "netexpatcommunity.com", true },
- { "netfabb.com", true },
- { "netface.com.br", true },
- { "netfeeds.eu", true },
- { "netferie.de", true },
- { "netferie.dk", true },
- { "netferie.no", true },
- { "netfirmtextile.com", true },
- { "netflixlife.com", true },
- { "netfog.de", true },
- { "netfolio.pt", true },
- { "netfoundry.io", true },
- { "netframe.net", true },
- { "netfs.pl", true },
- { "netfuture.ch", true },
- { "netfxharmonics.com", true },
- { "netgaming.de", true },
- { "nethack.ninja", true },
- { "nethackwiki.com", true },
- { "nethask.ru", true },
- { "nethealth.ga", true },
- { "nethorizon.cn", true },
- { "nethostingtalk.com", true },
- { "nethruster.com", true },
- { "nethui.nz", true },
- { "netki.com", true },
- { "netlentes.com.br", true },
- { "netliste.com", true },
- { "netlocal.ru", true },
- { "netmagicas.com.br", true },
- { "netmeister.org", true },
- { "netnea.com", true },
- { "netnik.de", true },
- { "netnodes.net", true },
- { "netolink.co.il", true },
- { "netolink.com", true },
- { "netolink.ru", true },
- { "netpenge.tk", true },
- { "netrabota.tk", true },
- { "netraising.com", false },
- { "netrelay.email", true },
- { "netrewrite.com", true },
- { "netrider.net.au", false },
- { "netrogue.ninja", true },
- { "netronix.be", true },
- { "netsearch.ga", true },
- { "netsec.cloud", true },
- { "netsigna.de", true },
- { "netsite.dk", true },
- { "netsoins.org", true },
- { "netsoj.nl", true },
- { "netsparker.com", true },
- { "netsparker.com.tr", true },
- { "netspeedia.net", true },
- { "netsphere.cz", true },
- { "nettamente.com", true },
- { "nette.org", true },
- { "nettegeschenke.de", true },
- { "nettgiro.no", true },
- { "nettia.fi", true },
- { "nettilamppu.fi", true },
- { "netto-service.ch", false },
- { "nettools.link", true },
- { "nettx.co.uk", true },
- { "netvizura.co.uk", true },
- { "netwarc.eu", true },
- { "netwarc.nl", true },
- { "netweaver.uk", true },
- { "networg.com", true },
- { "networg.cz", true },
- { "networg.pl", true },
- { "network-midlands.co.uk", true },
- { "network-midlands.uk", true },
- { "network-notes.com", true },
- { "network23.nl", true },
- { "networkdiode.com", true },
- { "networkdiode.eu", true },
- { "networkdiode.net", true },
- { "networkdiode.org", true },
- { "networking4all.com", true },
- { "networkingnexus.net", true },
- { "networkingphoenix.com", true },
- { "networkmidlands.co.uk", true },
- { "networkmidlands.uk", true },
- { "networkmon.net", true },
- { "networkofarts.com", true },
- { "networkposting.com", true },
- { "networksolutionsconsultant.com", true },
- { "networth.at", true },
- { "netz-yokohama.co.jp", true },
- { "netz0.com", true },
- { "netzfabrik.com", true },
- { "netzfrauen.org", true },
- { "netzklad.de", true },
- { "netzona.org", true },
- { "netzwerk-lq.com", true },
- { "netzwerkwerk.de", true },
- { "neuflizeobc.net", true },
- { "neurabyte.com", true },
- { "neurexcellence.com", true },
- { "neuroandspineconsultants.com", true },
- { "neurobiology.com", true },
- { "neurochip.com", true },
- { "neurocny.cloud", true },
- { "neuronus.com.br", true },
- { "neuropatia-periferica.com", true },
- { "neuropharmacology.com", true },
- { "neurostimtms.com", true },
- { "neurotransmitter.net", true },
- { "neurozentrum-zentralschweiz.ch", true },
- { "neusoft.ren", true },
- { "neutralox.com", true },
- { "neuwal.com", true },
- { "neva.li", true },
- { "never.pet", true },
- { "nevergirl.tk", true },
- { "nevergreen.io", true },
- { "nevermore.fi", true },
- { "nevivur.net", true },
- { "nevntech.com", true },
- { "nevolution.me", true },
- { "nevoxo.com", true },
- { "nevychova.cz", true },
- { "new-black-order.com", true },
- { "new-boiler-prices.co.uk", true },
- { "new-jersey-online-casinos.com", true },
- { "new-ms.com", true },
- { "new-process.ch", true },
- { "new-process.com", true },
- { "new-process.de", true },
- { "new-process.eu", true },
- { "new-smile.cf", true },
- { "new-tuning.tk", true },
- { "new-vip.com", true },
- { "new-web-studio.com", true },
- { "newaccess.ch", true },
- { "newbernpost539.com", true },
- { "newblogr.com", true },
- { "newborncryptocoin.com", true },
- { "newbrunswick.today", true },
- { "newbrunswicktoday.com", true },
- { "newburybouncycastles.co.uk", true },
- { "newburyparkelectric.com", true },
- { "newburyparkelectrical.com", true },
- { "newburyparkelectrician.com", true },
- { "newburyparkexteriorlighting.com", true },
- { "newburyparklandscapelighting.com", true },
- { "newburyparkoutdoorlighting.com", true },
- { "newcitygas.ca", true },
- { "newcityinfo.ch", false },
- { "newcitystudio.ch", false },
- { "newcloudwhodis.com", true },
- { "newcomm.nl", true },
- { "newday.host", true },
- { "newdimensioninterlock.com", true },
- { "newdirectionsolar.com.au", true },
- { "newearth.press", true },
- { "newendsoft.com", true },
- { "newenglandworkinjury.com", true },
- { "newfangledscoop.com", true },
- { "newfiepedia.ca", true },
- { "newflavor.design", true },
- { "newflora.ru", true },
- { "newfordmustang.com.au", true },
- { "newforms.nl", true },
- { "newfoundland-labradorflora.ca", true },
- { "newgrowbook.com", true },
- { "newguidance.ch", false },
- { "newhamyoungbloods.co.uk", false },
- { "newillusion.tk", true },
- { "newimage.io", true },
- { "newind.info", true },
- { "newinf.at", true },
- { "newinternet.media", true },
- { "newizv.ru", true },
- { "newkaliningrad.ru", true },
- { "newknd.com", true },
- { "newlifeband.de", true },
- { "newline.online", true },
- { "newlovers.ga", true },
- { "newlovers.gq", true },
- { "newlynamed.com", true },
- { "newlytricks.ml", true },
- { "newmall.org", true },
- { "newmarketbouncycastlehire.co.uk", true },
- { "newmed.com.br", true },
- { "newmediaone.net", true },
- { "newmusicjackson.org", true },
- { "newodesign.com", true },
- { "neworiflame.tk", true },
- { "newposts.ru", true },
- { "newquilters.com", true },
- { "newreleases.io", true },
- { "news-novoros.cf", true },
- { "news-srilanka.tk", true },
- { "news-sy.cf", true },
- { "news-technology.ml", true },
- { "news123.ga", true },
- { "news12elite.tk", true },
- { "news47ell.com", true },
- { "news53today.tk", true },
- { "news54.tk", true },
- { "newsarmenia.tk", true },
- { "newsbali.tk", true },
- { "newsbusiness.cf", true },
- { "newscultural.tk", true },
- { "newsdiff.eu", true },
- { "newsdiff.nl", true },
- { "newsdiffs.eu", true },
- { "newsgroups.io", true },
- { "newshell.it", true },
- { "newsinkansas.ml", true },
- { "newsinpolitics.ga", true },
- { "newsireland.tk", true },
- { "newsletteralerts.com", true },
- { "newsmotor.info", true },
- { "newsnew2020.com", true },
- { "newspiritfilms.com", true },
- { "newspsychology.com", true },
- { "newsuk.tk", true },
- { "newsuzbekistan.tk", true },
- { "newsvideo.tk", true },
- { "newsyslog.org", true },
- { "newtekstil.ga", true },
- { "newtonproject.org", true },
- { "newtons-erben.space", true },
- { "newtrackon.com", true },
- { "newvehicle.com", true },
- { "newyorkcoffeejobs.com", true },
- { "newyorkhiltonmidtown.com", true },
- { "newyorknews.tk", true },
- { "nex.li", true },
- { "nex.sx", true },
- { "nexd.com", true },
- { "nexgeneration-solutions.com", true },
- { "nexicafiles.com", true },
- { "next-idea.co", true },
- { "next-taxi.ru", false },
- { "next-web.ad.jp", true },
- { "next176.sk", true },
- { "next24.io", true },
- { "nextbranders.com", true },
- { "nextcairn.com", true },
- { "nextcloud.at", true },
- { "nextcloud.com", true },
- { "nextcloud.de", true },
- { "nextcloud.li", false },
- { "nextcloud.nerdpol.ovh", true },
- { "nextcloud.org", true },
- { "nextcom.digital", true },
- { "nextechoax.com", true },
- { "nexter.cloud", true },
- { "nextevolution.co.uk", true },
- { "nextfm.tk", true },
- { "nextgen-life-insurance.com", true },
- { "nextgenthemes.com", true },
- { "nextgreatmess.com", true },
- { "nextiot.de", true },
- { "nextiva.com", true },
- { "nextlevel-it.co.uk", true },
- { "nextmbta.com", true },
- { "nextme.se", true },
- { "nextnely.com", true },
- { "nextnowagency.com", true },
- { "nextos.com", true },
- { "nextrec.site", true },
- { "nextrend.co", true },
- { "nextstart-staging.azurewebsites.net", true },
- { "nextstart.azurewebsites.net", true },
- { "nextstep-labs.gr", true },
- { "nextwab.com", true },
- { "nexus-exit.de", true },
- { "nexusconnectinternational.eu", true },
- { "nexwebsites.com", true },
- { "nexxus-sistemas.net.br", true },
- { "neyer-lorenz.de", true },
- { "nezrouge-est-vaudois.ch", false },
- { "nezrouge-geneve.ch", false },
- { "nf9q.com", true },
- { "nfam.de", true },
- { "nfe-elektro.de", true },
- { "nfl.ddns.net", true },
- { "nfl.dedyn.io", true },
- { "nfl.duckdns.org", true },
- { "nflmocks.com", true },
- { "nfltshirt.com", true },
- { "nfpors.gov", true },
- { "nframe.io", true },
- { "nfsec.pl", true },
- { "nfz.moe", true },
- { "ng-musique.com", true },
- { "ng911services.com", true },
- { "ngasembaru.com", true },
- { "ngc.gov", false },
- { "ngetik.id", true },
- { "nghe.net", true },
- { "ngi.eu", true },
- { "nginxconfig.com", true },
- { "nginxconfig.io", true },
- { "ngmx.com", true },
- { "ngmx.net", true },
- { "ngmx.org", true },
- { "ngojclee.com", true },
- { "ngospelmedia.net", true },
- { "ngt.gr", true },
- { "nguru.net", true },
- { "nguyencucthanh.com", true },
- { "nguyendiep.com", true },
- { "nguyenhongson.me", true },
- { "nguyenminhhung.com", false },
- { "ngvf.de", true },
- { "ngx.hk", true },
- { "ngxpkg.com", true },
- { "nhakhoabella.com", true },
- { "nhakhoangocanh.net", true },
- { "nhanlucnhatban.com", true },
- { "nhchalton.com", true },
- { "nhdsilentheroes.org", true },
- { "nhimf.org", true },
- { "nhnieuws.nl", true },
- { "nhome.ba", true },
- { "nhsolutions.be", false },
- { "nhv-vintagelemans.com", true },
- { "nhw.ovh", true },
- { "ni-mate.com", true },
- { "ni.search.yahoo.com", false },
- { "niadd.com", true },
- { "niagara.ru", false },
- { "niagarafalls.ca", true },
- { "niagarafallsmuseums.ca", true },
- { "niagaraschoice.org", true },
- { "nibb13.tech", true },
- { "nibo.blog", true },
- { "nibouw.nl", true },
- { "nic.ads", true },
- { "nic.android", true },
- { "nic.app", true },
- { "nic.boo", true },
- { "nic.cal", true },
- { "nic.channel", true },
- { "nic.chrome", true },
- { "nic.dad", true },
- { "nic.day", true },
- { "nic.dclk", true },
- { "nic.dev", true },
- { "nic.docs", true },
- { "nic.drive", true },
- { "nic.eat", true },
- { "nic.esq", true },
- { "nic.fly", true },
- { "nic.foo", true },
- { "nic.gbiz", true },
- { "nic.gle", true },
- { "nic.gmail", true },
- { "nic.goog", true },
- { "nic.google", true },
- { "nic.gov", true },
- { "nic.guge", true },
- { "nic.hangout", true },
- { "nic.here", true },
- { "nic.how", true },
- { "nic.ing", true },
- { "nic.meet", true },
- { "nic.meme", true },
- { "nic.mov", true },
- { "nic.new", true },
- { "nic.nexus", true },
- { "nic.page", true },
- { "nic.play", true },
- { "nic.prod", true },
- { "nic.prof", true },
- { "nic.rsvp", true },
- { "nic.soy", true },
- { "nic.xn--q9jyb4c", true },
- { "nic.youtube", true },
- { "nic.zip", true },
- { "nicastrosalvatore.tk", true },
- { "nice.ch", true },
- { "niceb5y.net", true },
- { "niceguyit.biz", true },
- { "nicesco.re", true },
- { "nicesleepo.com", true },
- { "nicestudio.co.il", false },
- { "nichesite.gq", true },
- { "nichi.co", true },
- { "nichijou.com", true },
- { "nicholasperkins.io", true },
- { "nicholaspruss.com", true },
- { "nicholasquigley.com", true },
- { "nicholasrhodes.co.uk", true },
- { "nicholasruddick.com", true },
- { "nicholaswilliams.net", true },
- { "nicht-blau.de", true },
- { "nichteinschalten.de", false },
- { "nichthelfer.de", true },
- { "nicic.gov", true },
- { "nickcraver.com", true },
- { "nickdekruijk.nl", true },
- { "nickfrost.rocks", true },
- { "nickguyver.com", true },
- { "nickhitch.co.uk", true },
- { "nickkallis.com", true },
- { "nickloose.de", true },
- { "nickmchardy.com", true },
- { "nickmorri.com", true },
- { "nickmorris.name", true },
- { "nickplotnek.co.uk", true },
- { "nickrickard.co.uk", true },
- { "nicks-autos.com", true },
- { "nickscomputers.nl", true },
- { "nickserv.eu", true },
- { "nickserve.com", true },
- { "nickserve.eu", true },
- { "nickserve.net", true },
- { "nickserve.nl", true },
- { "nickserve.org", true },
- { "nickstories.de", true },
- { "niclasreich.de", true },
- { "niclewis.me", true },
- { "nicn.me", true },
- { "nico.st", true },
- { "nicochinese.com", true },
- { "nicocourts.com", true },
- { "nicogrosser.de", true },
- { "nicoknibbe.nl", true },
- { "nicoladixonrealestate.com", true },
- { "nicolaiteglskov.dk", true },
- { "nicolajanedesigns.co.uk", true },
- { "nicolaottomano.it", true },
- { "nicolas-dumermuth.com", true },
- { "nicolas-hoffmann.net", false },
- { "nicolas-hoizey.com", true },
- { "nicolas-simond.ch", true },
- { "nicolas-simond.com", true },
- { "nicolasfriedli.ch", true },
- { "nicolasiung.me", true },
- { "nicolaspecher.com", true },
- { "nicolaszambetti.ch", true },
- { "nicolaw.uk", true },
- { "nicolemathew.com", true },
- { "nicoleta-prestescu.tk", true },
- { "nicolettajennings.com", true },
- { "nicoobank.com", true },
- { "nicsezcheckfbi.gov", true },
- { "nicul.in", true },
- { "nidro.de", true },
- { "nidsuber.ch", true },
- { "niederohmig.de", true },
- { "nielsbohr.ai", true },
- { "nien.cf", true },
- { "nien.co", true },
- { "nien.com", true },
- { "nien.eu.org", true },
- { "nien.gq", true },
- { "nien.org", true },
- { "nien.tk", true },
- { "nienkeslop.nl", true },
- { "nierenpraxis-dr-merkel.de", true },
- { "nierenpraxis-merkel.de", true },
- { "niers.land", true },
- { "nieselregen.com", true },
- { "niess.space", true },
- { "niesstar.com", false },
- { "nietzsche.com", true },
- { "nieuwpoort.tk", true },
- { "nieuwsberichten.eu", true },
- { "nieuwslagmaat.nl", true },
- { "nifc.gov", true },
- { "niftiestsoftware.com", true },
- { "niftypersonalloans.com.au", true },
- { "nigelwakefield.com", true },
- { "nigensha.co.jp", true },
- { "niggo.eu", true },
- { "night2stay.cn", true },
- { "night2stay.de", true },
- { "night2stay.fr", true },
- { "night2stay.ru", true },
- { "nightfirec.at", true },
- { "nightman.info", true },
- { "nightmoose.org", true },
- { "nightsi.de", true },
- { "nightstand.io", true },
- { "nihaarpstars.com", true },
- { "niituva.ga", true },
- { "nij.gov", true },
- { "nijikata.com", true },
- { "nijm.nl", true },
- { "nijniy-novgorod.tk", true },
- { "nika-travel.ga", true },
- { "nikandcara.com", true },
- { "nikavandenbos.nl", true },
- { "nikimix.com", false },
- { "nikitenko.tk", true },
- { "nikitin.photo", true },
- { "nikka.systems", true },
- { "nikkasystems.com", true },
- { "nikkila.me", true },
- { "niklas.pw", true },
- { "niklasbabel.com", true },
- { "nikolahost.tk", true },
- { "nikolai-schmidt.tk", true },
- { "nikomo.fi", false },
- { "nikoninframe.co.uk", true },
- { "nikonlibrary.co.uk", true },
- { "nikonnps.co.uk", true },
- { "nikonpromotions.co.uk", true },
- { "nikpool.com", true },
- { "niktok.com", true },
- { "nil.gs", true },
- { "nil.mx", true },
- { "nilahue.com", true },
- { "niles.xyz", true },
- { "nilgirispice.co.uk", true },
- { "nim-news.com", true },
- { "nimanranch.com", true },
- { "nimbo.com.au", true },
- { "nimidam.com", true },
- { "nina-woerz.tk", true },
- { "ninaforever.com", true },
- { "ninaundandre.de", true },
- { "ninchat.com", true },
- { "ninebennink.com", true },
- { "ninepints.co", true },
- { "ninetailed.ninja", true },
- { "ninetaillabs.com", true },
- { "ninetaillabs.xyz", true },
- { "ninfora.com", true },
- { "ningbo.co.uk", true },
- { "ningrui.me", true },
- { "ninja-galerie.de", true },
- { "ninja-skillz.com", true },
- { "ninjan.co", true },
- { "ninjasquad.fr", true },
- { "ninjaworld.co.uk", true },
- { "ninjio.com", true },
- { "ninmegam.gq", true },
- { "ninofink.com", true },
- { "ninth.cat", true },
- { "ninthfloor.org", true },
- { "ninverse.com", true },
- { "niourk.com", true },
- { "nipax.cz", true },
- { "nipe-systems.de", true },
- { "nipit.biz", true },
- { "nippangift.com", true },
- { "nippel.tk", true },
- { "nipplefucking.com", true },
- { "nippon-oku.com", true },
- { "nipponkempoph.tk", true },
- { "nipponnews.tk", true },
- { "niqex.com", true },
- { "nirhub.ru", true },
- { "nirjonmela.com", true },
- { "nirjonmela.net", true },
- { "nirvanashop.com", true },
- { "niscats.com", true },
- { "nishimebistro.cz", true },
- { "nissanofbismarckparts.com", true },
- { "nist.tech", true },
- { "nitifilter.com", true },
- { "nitix.games", true },
- { "nitrix.me", true },
- { "nitrohorse.com", false },
- { "nitrokey.com", true },
- { "nitropanel.com", true },
- { "nitropur.com", true },
- { "nitropur.de", true },
- { "nitrous-networks.com", true },
- { "nitschinger.at", true },
- { "niu.moe", false },
- { "niumactive.it", true },
- { "nivelul2.ro", true },
- { "nivoit.cf", true },
- { "nixnet.email", true },
- { "nixnet.xyz", true },
- { "nixonlibrary.gov", true },
- { "niyawe.de", true },
- { "niyazpoyilan.com", false },
- { "niyen.com", true },
- { "niyen.eu", true },
- { "niyen.net", true },
- { "niyen.org", true },
- { "nizhaoheng.com", true },
- { "nja.id.au", true },
- { "njast.net", true },
- { "njguardtraining.com", true },
- { "njilc.com", true },
- { "njpjanssen.nl", true },
- { "njprimary.com", true },
- { "nkapliev.org", true },
- { "nkbwnx.com", true },
- { "nkforum.pl", true },
- { "nkinka.de", true },
- { "nkjwmn.com", true },
- { "nkjwrs.com", true },
- { "nkorolev.tk", true },
- { "nkp.bg", true },
- { "nksky.cn", true },
- { "nl-comunistas.tk", true },
- { "nl-ix.net", true },
- { "nl.search.yahoo.com", false },
- { "nl3ehv.nl", true },
- { "nlap.ca", false },
- { "nlbewustgezond.nl", true },
- { "nlegall.fr", true },
- { "nllboard.co.uk", true },
- { "nlleisure.co.uk", true },
- { "nlm.gov", true },
- { "nlpdiscovery.ro", true },
- { "nlt.by", false },
- { "nmd.so", true },
- { "nmmlp.org", true },
- { "nmnd.de", true },
- { "nmontag.com", true },
- { "nms-thoracic-surgery.com", true },
- { "nmx.moe", true },
- { "nn-vol.ga", true },
- { "nn.cz", true },
- { "nn01.cc", true },
- { "nn01.com", true },
- { "nna774.net", true },
- { "nnews.tk", true },
- { "nnnow.com", true },
- { "no-ice.be", true },
- { "no-ice.nl", true },
- { "no-ip.cz", true },
- { "no-real.tk", true },
- { "no-xice.com", false },
- { "no.search.yahoo.com", false },
- { "noagendahr.org", true },
- { "noah-witt.com", true },
- { "noahenco.nl", true },
- { "noahjacobson.com", true },
- { "noahmodas.com.br", true },
- { "noahsaso.com", true },
- { "noahwitt.me", true },
- { "nob.ro", true },
- { "nobilefoods.com", true },
- { "nobitakun.com", true },
- { "nobleandlore.com", true },
- { "nobledust.com", true },
- { "nobleparkapartments.com.au", true },
- { "nobly.de", true },
- { "nobreaks.ca", true },
- { "nobreinox.com.br", true },
- { "noc.org", true },
- { "nocks.com", true },
- { "noclegiwchecinach.pl", true },
- { "nocloud.website", true },
- { "nocmd.com", true },
- { "nocommentsallowed.com", true },
- { "nocturnus.tk", true },
- { "nodecdn.net", true },
- { "nodecraft.com", true },
- { "nodeedge.com", true },
- { "nodeflame.com", true },
- { "nodejs.de", true },
- { "nodelab-it.de", true },
- { "nodelia.com", true },
- { "nodesec.cc", true },
- { "nodespin.com", true },
- { "nodevops.com", true },
- { "noeatnosleep.me", true },
- { "noedidacticos.com", true },
- { "noelclaremont.com", true },
- { "noellabo.jp", true },
- { "noellimpag.me", true },
- { "noematic.space", true },
- { "noemax.com", true },
- { "noeontheend.com", true },
- { "noexec.org", true },
- { "nofrillsdns.com", true },
- { "noga4you.de", true },
- { "nogerondier.eu", true },
- { "nogetime.com", true },
- { "noglobalwarrants.org", true },
- { "nogradhont.hu", true },
- { "nohats.ca", true },
- { "nohkan.fr", false },
- { "nohm.eu", true },
- { "nohttps.org", true },
- { "nohup.se", true },
- { "nohup.xyz", true },
- { "noiglosujemy.com.pl", true },
- { "noiglosujemy.pl", true },
- { "noima.com", true },
- { "noincludesubdomains.preloaded.test", false },
- { "noinghene.com", true },
- { "noise.agency", true },
- { "noisetrap.cz", true },
- { "noisky.cn", true },
- { "noisyfox.cn", true },
- { "noites.pt", true },
- { "nokia.la", true },
- { "nokono.com", true },
- { "nokya.tk", true },
- { "nolalove.nl", true },
- { "nolaviz.org", true },
- { "noleggio-bagni-chimici.it", true },
- { "noleggioimbarcazioni.it", true },
- { "noleggiolimousine.roma.it", true },
- { "noma-film.com", true },
- { "nomadproject.io", true },
- { "nomagic.software", true },
- { "nomaster.cc", true },
- { "nomenclator.org", true },
- { "nomesbiblicos.com", true },
- { "nomial.co.uk", true },
- { "nomifensine.com", true },
- { "nomsy.net", true },
- { "nomzamo.spdns.org", true },
- { "noname-ev.de", true },
- { "noncombatant.org", true },
- { "nonglamfarm.vn", true },
- { "nontonfilem.ml", true },
- { "nonzero.io", true },
- { "noob-box.net", true },
- { "nooben.com", true },
- { "noobow.me", true },
- { "noobsrus.co.uk", true },
- { "noobsunited.de", true },
- { "noobunbox.net", true },
- { "noodles.net.nz", false },
- { "noodplan.co.za", true },
- { "noomist.com", true },
- { "noon-entertainments.com", true },
- { "noonan.family", true },
- { "nooneshere.co.uk", true },
- { "noop.ch", true },
- { "noop.com.au", true },
- { "noordsee.de", true },
- { "noordwesthoekrit.nl", true },
- { "noorsolidarity.com", false },
- { "noortronic.com", true },
- { "nootronerd.com", true },
- { "nootropic.com", true },
- { "noovell.com", true },
- { "nooverviewavailable.com", true },
- { "nopajam.tk", true },
- { "nopaste.xyz", true },
- { "nopaynocure.com", true },
- { "nophelet.com", true },
- { "norad.sytes.net", true },
- { "noradevot.com", true },
- { "norala.tk", true },
- { "noranowak.com", true },
- { "norapiero.com", true },
- { "norbertschneider-music.com", true },
- { "nord-sud.be", true },
- { "nordfinck.de", true },
- { "nordicirc.com", true },
- { "nordicsrit.tk", true },
- { "nordinfo.fi", true },
- { "nordlichter-brv.de", true },
- { "nordmoregatebilklubb.com", true },
- { "nordnetz-hamburg.de", true },
- { "nordseeblicke.de", true },
- { "nordstromheating.com", true },
- { "nordvestkysten.de", true },
- { "nordvestkysten.dk", true },
- { "nordwaldzendo.de", true },
- { "noreply.mx", true },
- { "norestfortheweekend.com", true },
- { "norfolkgardencare.co.uk", true },
- { "norichanmama.com", true },
- { "noriel.ro", true },
- { "normaculta.com.br", true },
- { "norman-preusser-gmbh.de", true },
- { "normanbauer.com", true },
- { "normandgascon.com", true },
- { "normankranich.de", true },
- { "norml.fr", true },
- { "noroshi-burger.com", true },
- { "norrlandsbilverkstad.se", true },
- { "norrliden.de", true },
- { "norsewars.com", true },
- { "norskpensjon.no", true },
- { "northampton-vets.co.uk", true },
- { "northatlantalaw.net", true },
- { "northbridgecre.com", true },
- { "northbrisbaneapartments.com.au", true },
- { "northcoastlabs.com", true },
- { "northconsulting.fr", true },
- { "northcreekresort.com", true },
- { "northcreekresortblue.ca", true },
- { "northdakotahealthnetwork.com", true },
- { "northdevonbouncycastles.co.uk", true },
- { "northeastcdc.org", true },
- { "northeastrodeo.co.uk", true },
- { "northebridge.com", true },
- { "northern-lakes.com", true },
- { "northerngate.net", true },
- { "northernhamsterclub.com", true },
- { "northernpowertrain.com", true },
- { "northernselfstorage.co.za", true },
- { "northfieldyarn.com", true },
- { "northkoreainsider.tk", true },
- { "northokanaganbookkeeping.com", true },
- { "northpointoutdoors.com", true },
- { "northpole.dance", true },
- { "northpost.is", true },
- { "northridgeelectrical.com", true },
- { "northrose.net", true },
- { "northscottsdaleloan.com", true },
- { "northtexasvasectomy.com", true },
- { "northumbriagames.co.uk", true },
- { "norys-escape.de", true },
- { "nos-medias.fr", true },
- { "nos-oignons.net", true },
- { "noscript.net", true },
- { "noscura.nl", true },
- { "noseastumismo.com", true },
- { "nosecrets.ch", true },
- { "nosedoctor.net", true },
- { "noslite.nl", true },
- { "nosqlzoo.net", true },
- { "nossasenhora.net", true },
- { "nostalgimidi.se", true },
- { "nostalgische-attracties.nl", true },
- { "nostraforma.com", false },
- { "nosuch.blog", true },
- { "nosuch.site", true },
- { "noswap.com", true },
- { "nosyu.pe.kr", true },
- { "nota.moe", true },
- { "notablepeeps.com", true },
- { "notabug.org", true },
- { "notacooldomain.com", true },
- { "notadd.com", true },
- { "notallmine.net", true },
- { "notar-glagowski.com", true },
- { "notar-glagowski.de", true },
- { "notar-peikert.com", true },
- { "notare-marktplatz24.info", true },
- { "notariusz-bialystok.com", true },
- { "notariuszprzybylowicz.pl", true },
- { "notariuszsych.pl", true },
- { "notarkrauss.de", true },
- { "notcompletelycorrect.com", true },
- { "note64.com", true },
- { "noteboat.net", true },
- { "notedinstyle.co.uk", true },
- { "notenarchiv.eu", true },
- { "notepad.nz", true },
- { "noteskeeper.ru", true },
- { "nothinfancy.ca", true },
- { "nothing.net.nz", true },
- { "noticaballos.com", true },
- { "noticiasdehumor.com", true },
- { "noticiasdetv.com", true },
- { "notigatos.es", true },
- { "notilus.fr", true },
- { "notilus.it", true },
- { "notjustvacs.com", true },
- { "notmybox.com", true },
- { "notmyserver.com", true },
- { "notnize.net", true },
- { "notnl.com", true },
- { "notofilia.com", true },
- { "notora.tech", true },
- { "nototema.com", true },
- { "notsafefor.work", true },
- { "nottres.com", true },
- { "nou9ta.tk", true },
- { "noudjalink.nl", true },
- { "nougat-anduze.fr", true },
- { "noujoumtounes.com", true },
- { "nourishandnestle.com", true },
- { "noustique.com", true },
- { "noustramits.com", true },
- { "nousyukum.com", true },
- { "nova-dess.ch", false },
- { "nova-wd.org.uk", true },
- { "nova.live", true },
- { "novabench.com", true },
- { "novacoaching.nl", true },
- { "novacoast.com", false },
- { "novadermis.es", true },
- { "novafreixo.pt", true },
- { "novaiguacu.net.br", true },
- { "novak.cf", true },
- { "novalite.rs", true },
- { "novanetwork.ml", true },
- { "novascan.net", true },
- { "novawave.ca", true },
- { "nove.city", true },
- { "noveciti.com", true },
- { "novecity.com", true },
- { "novecity.it", true },
- { "novecity.org", true },
- { "novecitymail.com", true },
- { "novelfeed.com", true },
- { "novelinglife.net", false },
- { "novema.jp", true },
- { "novengi.mu", true },
- { "novfishing.ru", true },
- { "novgorod-avia.ru", true },
- { "novicecamp.com", true },
- { "novichok.ml", true },
- { "novilaw.com", true },
- { "novilidery.com", true },
- { "novinhabucetuda.com", true },
- { "novinivo.com", true },
- { "novinkihd.tk", true },
- { "novinminer.com", true },
- { "novogradnje.si", true },
- { "novojet.cl", true },
- { "novokuznetsk.tk", true },
- { "novonegoc.io", true },
- { "novoresume.com", false },
- { "novorossiysk.tk", true },
- { "novorussiya.tk", true },
- { "novoselie.ga", true },
- { "novosibavia.ru", true },
- { "novotoznanie.com", true },
- { "novurania.com", true },
- { "now101atm.tk", true },
- { "nowarning.cc", true },
- { "nowhere.dk", true },
- { "nowitzki.me", true },
- { "nowitzki.network", true },
- { "nowlas.org", true },
- { "nowloading.co", true },
- { "nowzuwan.org", false },
- { "noxlogic.nl", true },
- { "noxx.global", true },
- { "noxx.solutions", true },
- { "noydeen.com", true },
- { "noyocenter.org", true },
- { "np-edv.at", true },
- { "np.search.yahoo.com", false },
- { "np39.de", true },
- { "npaccel.com", true },
- { "npath.de", true },
- { "npbeta.com", true },
- { "npcrcss.org", true },
- { "npdigital.com", true },
- { "nphrm.com", true },
- { "npmcdn.com", true },
- { "npregion.org", true },
- { "npsas.org", true },
- { "npw.net", true },
- { "nr-sputnik.ru", true },
- { "nrd.gov", true },
- { "nrd.li", true },
- { "nrev.ch", false },
- { "nriol.net", true },
- { "nrkn.fr", true },
- { "nrsmart.com", true },
- { "nrsweb.org", true },
- { "nrthcdn.me", true },
- { "nrv-linux.io", true },
- { "nrvc.net", true },
- { "nrvn.cc", false },
- { "ns-frontier.com", true },
- { "ns2servers.pw", true },
- { "nsa.ovh", true },
- { "nsadns.uk", true },
- { "nsapwn.com", true },
- { "nsboston.org", true },
- { "nscnet.jp", true },
- { "nsfw-story.com", true },
- { "nshipster.cn", true },
- { "nshipster.co.kr", true },
- { "nshipster.com", true },
- { "nshipster.es", true },
- { "nsine.be", true },
- { "nsm.ee", true },
- { "nsm.stat.no", true },
- { "nsnsp.org", true },
- { "nso.ie", true },
- { "nsofficeinteriors.com", true },
- { "nsoft.nu", true },
- { "nsp.ua", true },
- { "nspawn.org", true },
- { "nspeaks.com", true },
- { "nstd.net", true },
- { "nstinvoiceqa.com", true },
- { "nstnet.org", true },
- { "nsworks.com", true },
- { "nt-catala.com", true },
- { "ntags.org", true },
- { "ntcp.ph", true },
- { "nte.email", true },
- { "nti.de", true },
- { "ntia.gov", true },
- { "ntlabs.org", true },
- { "ntotten.com", true },
- { "ntppool.org", false },
- { "ntsb.gov", true },
- { "ntwt.us", true },
- { "ntx360grad-fallakte.de", true },
- { "ntzlaw.com", true },
- { "ntzwrk.org", true },
- { "nu3tion.com", true },
- { "nu3tion.cz", true },
- { "nuacht.ie", true },
- { "nualgiponds.com", true },
- { "nuamooreaindonesia.com", true },
- { "nubehogar.nsupdate.info", true },
- { "nubu.at", true },
- { "nuclea.id", true },
- { "nuclearcat.com", true },
- { "nucleuspanel.com", true },
- { "nudeimg.com", true },
- { "nudevotion.com", true },
- { "nudge.ai", true },
- { "nuel.cl", true },
- { "nuestratecnologia.com", true },
- { "nuevaimagenpublicidad.es", true },
- { "nuffield.nl", true },
- { "nuipogoda.ru", true },
- { "nuits-franciliennes.fr", true },
- { "null-life.com", true },
- { "nullday.de", true },
- { "nulle-part.org", true },
- { "nullonerror.org", true },
- { "nullroute.com", true },
- { "nullscripts.tk", true },
- { "nullwebscripts.com", true },
- { "nullxsec.net", true },
- { "numarasorgulama.tel", true },
- { "numatic.co.uk", true },
- { "numbercult.net", true },
- { "numbermunchers.net", true },
- { "numberoneshoes.co.nz", true },
- { "numberzero.org", true },
- { "numbrz.co.uk", true },
- { "numericall.gq", true },
- { "numerik-games.ch", false },
- { "numeritelefonici.it", true },
- { "numero-aleatorio.com", true },
- { "numero1.ch", false },
- { "numerologist.com", true },
- { "numerossanos.com.ar", true },
- { "numo.co", true },
- { "numwave.nl", true },
- { "nunesgh.com", true },
- { "nunnenmacher.net", true },
- { "nunnun.jp", true },
- { "nunomoura.com", true },
- { "nuoha.com", true },
- { "nuovaelle.it", true },
- { "nuovavetro.com", true },
- { "nuquery.com", true },
- { "nuquery.org", true },
- { "nur.berlin", true },
- { "nureg.club", true },
- { "nureg.net", true },
- { "nureg.xyz", true },
- { "nuriacamaras.com", true },
- { "nurmio.fi", true },
- { "nursejj.com", true },
- { "nursemom.ca", true },
- { "nurseregistry.com", true },
- { "nurses.dating", true },
- { "nuryahan.com.br", true },
- { "nusatrip-api.com", true },
- { "nussadoclub.org", true },
- { "nut-dev.com", true },
- { "nutbot.co.uk", true },
- { "nutextonline.com", true },
- { "nutikell.com", true },
- { "nutleyeducationalfoundation.org", true },
- { "nutleyef.org", true },
- { "nutpanda.com", true },
- { "nutra-creations.com", true },
- { "nutrafitsuplementos.com.br", true },
- { "nutrashop.fr", true },
- { "nutricaovegana.com", true },
- { "nutriciametabolics-shop.de", true },
- { "nutridieta.com", true },
- { "nutripedia.gr", true },
- { "nutrishop.com", true },
- { "nutrition.gov", true },
- { "nutrizionista.roma.it", true },
- { "nuttyveg.com", true },
- { "nuvechtdal.nl", true },
- { "nuverabusiness.com", true },
- { "nuveratechtrends.com", true },
- { "nuvini.com", true },
- { "nuxer.fr", true },
- { "nvfoundation.com", true },
- { "nvl-game.tokyo", true },
- { "nvmo.org", true },
- { "nvoip.com.br", true },
- { "nvq.nl", true },
- { "nvr.bz", true },
- { "nvtc.gov", true },
- { "nwautorebuild.com", true },
- { "nwbc.gov", true },
- { "nwea.nl", true },
- { "nwerc.party", true },
- { "nwgh.org", false },
- { "nwitt.us", true },
- { "nwk1.com", true },
- { "nwmd.nl", false },
- { "nwperformanceandoffroad.com", true },
- { "nwra.com", true },
- { "nwradio.tk", true },
- { "nwtrb.gov", true },
- { "nwuss.okinawa", true },
- { "nwwc.dk", true },
- { "nwwnetwork.net", true },
- { "nxcd.com.br", true },
- { "nxgn.io", true },
- { "nxinfo.ch", false },
- { "nxtgenbroadband.in", true },
- { "nxth.io", true },
- { "nya.as", true },
- { "nyadora.com", true },
- { "nyadora.moe", true },
- { "nyan.it", true },
- { "nyan.kim", true },
- { "nyan.stream", true },
- { "nyansparkle.com", true },
- { "nyantec.com", true },
- { "nybiz.nyc", false },
- { "nycfilmcrew.com", true },
- { "nyconcretelifting.com", true },
- { "nycoyote.org", true },
- { "nycrerc.com", true },
- { "nydig.com", true },
- { "nyerjachioval.hu", true },
- { "nyerjakekszekkel.hu", true },
- { "nyerjanegroval.hu", true },
- { "nyerjenaheraval.hu", true },
- { "nyhaoyuan.net", true },
- { "nyiad.edu", true },
- { "nyip.edu", true },
- { "nylasercenter.com.pl", true },
- { "nylevemusic.com", true },
- { "nyloc.de", true },
- { "nymity.com", true },
- { "nymphetomania.net", true },
- { "nynex.net", true },
- { "nyoliveoil.com", true },
- { "nyoronfansubs.org", true },
- { "nyphox.ovh", true },
- { "nysis.fr", true },
- { "nysis.net", true },
- { "nysis.org", true },
- { "nysteak5.com", true },
- { "nystudio107.com", true },
- { "nytrafficticket.com", true },
- { "nyzed.com", true },
- { "nzbs.com", true },
- { "nzelaweb.com", true },
- { "nzstudy.ac.nz", true },
- { "nzws.me", false },
- { "o-aconsult.com", true },
- { "o-results.ch", true },
- { "o-sp.com", true },
- { "o15y.com", true },
- { "o2oxy.cn", true },
- { "o3.wf", true },
- { "o36533.com", true },
- { "o36594.com", true },
- { "o3c.com.br", true },
- { "o3wallet.com", true },
- { "o6asan.com", true },
- { "o81818.com", true },
- { "o98.com", true },
- { "o98.net", true },
- { "oacloud.nl", true },
- { "oahpmdata.net", true },
- { "oaic.gov.au", true },
- { "oakbarnvets.com", true },
- { "oaken.duckdns.org", true },
- { "oakesfam.net", true },
- { "oakface.club", true },
- { "oakface.com.au", true },
- { "oakington.info", false },
- { "oakparkelectrical.com", true },
- { "oakparkexteriorlighting.com", true },
- { "oakparklandscapelighting.com", true },
- { "oakparklighting.com", true },
- { "oakparkmedicalcentre.ga", true },
- { "oakparkoutdoorlighting.com", true },
- { "oakslighting.co.uk", true },
- { "oaktravel.nl", true },
- { "oaktree-realtors.com", true },
- { "oakwood-park.tk", true },
- { "oasiristorantebagno.it", true },
- { "oasisdabeleza.com.br", true },
- { "oasisim.net", false },
- { "oasisorthodontics.com.au", true },
- { "oatmealdome.me", true },
- { "oauth.how", true },
- { "obamalibrary.gov", true },
- { "obamawhitehouse.gov", true },
- { "obasigeorge.com", true },
- { "obdchekautomotriz.co", true },
- { "obec-krakovany.cz", true },
- { "oberhof-hotel.de", true },
- { "oberhofdrinks.com", true },
- { "obermeiers.eu", true },
- { "oberoi.de", true },
- { "obesidadlavega.com", true },
- { "obfuscate.xyz", true },
- { "obg-global.com", true },
- { "obgalslancaster.com", true },
- { "obgynmiamifl.com", true },
- { "obitech.de", true },
- { "object.earth", true },
- { "objectif-securite.ch", true },
- { "objectif-terre.ch", false },
- { "objectorientedsolutions.com", true },
- { "objekt-textil.ch", false },
- { "objetperso.fr", true },
- { "oblast45.ru", false },
- { "obligacjekk.pl", true },
- { "obmen-vizitami.ml", true },
- { "obnalichka.ga", true },
- { "oboeta.com", true },
- { "obono.at", true },
- { "obozrevatel.tk", true },
- { "obra.com.br", true },
- { "obrienswine.ie", true },
- { "obs.group", true },
- { "obscur.us", true },
- { "observer.name", true },
- { "obsessharness.com", true },
- { "obsproject.com", true },
- { "obtima.org", true },
- { "obud.cz", true },
- { "obxlistings.com", true },
- { "obyvateleceska.cz", true },
- { "obzor-znakomstv.tk", true },
- { "oc-sa.ch", false },
- { "ocachik.com.br", true },
- { "ocad.com.au", true },
- { "ocalaflwomenshealth.com", true },
- { "ocarupo.com", true },
- { "occ.gov", true },
- { "occenterprises.org", true },
- { "occentus.net", true },
- { "occonnections.org", true },
- { "occultisme.tk", true },
- { "occupational-therapy-colleges.com", true },
- { "ocd2016.com", true },
- { "oceanbreezehomes.com", true },
- { "oceancity4sales.com", true },
- { "oceandns.eu", true },
- { "oceandns.net", true },
- { "oceandns.nl", true },
- { "oceanlogisticgroup.com", true },
- { "oceanlord.me", true },
- { "oceanofapk.com", true },
- { "oceanspraymiami.com", true },
- { "oceanvisuals.com", true },
- { "ocenka-nedv.ml", true },
- { "ocenovani-inspekce.cz", true },
- { "ocf.io", true },
- { "ocg-card.com", true },
- { "ochrepoint.com.au", true },
- { "ochsenfeld.co", true },
- { "ochsundjunior.ch", true },
- { "ochsundjunior.swiss", true },
- { "ociaw.com", true },
- { "ocim.ch", false },
- { "ockendenhemming.co.uk", true },
- { "oclausen.com", true },
- { "ocni-ambulance-most.cz", true },
- { "ocnjapartment.com", true },
- { "ocolere.ch", true },
- { "ocotg.com", true },
- { "ocrn.nl", true },
- { "ocsigroup.fr", true },
- { "octarineparrot.com", true },
- { "octav.name", false },
- { "octaviosimon.com", true },
- { "octobered.com", true },
- { "octocaptcha.com", true },
- { "octofox.de", true },
- { "octolopagon.games", true },
- { "octopoos.com", true },
- { "octopoos.org", true },
- { "octopus-agents.com", true },
- { "octopuslab.fr", true },
- { "octosniff.net", true },
- { "octothorpe.club", true },
- { "octothorpe.ninja", true },
- { "octovpn.com", true },
- { "oculus.com", true },
- { "ocupat.ro", true },
- { "odden.io", true },
- { "oddmuse.org", true },
- { "oddnumber.ca", true },
- { "oddsandevens.ca", true },
- { "oddsandevensbookkeeping.ca", true },
- { "ode.red", true },
- { "odegua.com", true },
- { "odejdamoda.tk", true },
- { "odensc.me", true },
- { "odesenvolvedor.net", true },
- { "odhosc.ca", true },
- { "odifi.com", true },
- { "odinseye.net", true },
- { "odolbeau.fr", true },
- { "odonti.com", true },
- { "odoo.co.th", true },
- { "odpikedoslike.com", true },
- { "odtu.lu", true },
- { "odysea.cat", true },
- { "odysseyofthemind.eu", true },
- { "odysseytraining.com.au", true },
- { "odzyskaniedomeny.pl", true },
- { "oe-boston.com", true },
- { "oe0fcdncxjpdd05b.myfritz.net", true },
- { "oe2018.gov.pt", true },
- { "oe2019.gov.pt", true },
- { "oec-music.com", false },
- { "oegd.at", true },
- { "oeh.ac.at", true },
- { "oeko-bundesfreiwilligendienst-sh.de", true },
- { "oeko-bundesfreiwilligendienst.de", true },
- { "oeko-jahr-jubilaeum.de", true },
- { "oeko-jahr.de", true },
- { "oelbilder-oelmalerei.de", true },
- { "oelsner.net", true },
- { "oemwolf.com", true },
- { "oenings.eu", true },
- { "oepsbanaan.nl", true },
- { "oes.org.gt", true },
- { "oessi.eu", true },
- { "ofcampuslausanne.ch", false },
- { "ofda.gov", true },
- { "ofertasadsl.com", true },
- { "ofertino.es", true },
- { "ofertolino.fr", true },
- { "offandonagain.org", true },
- { "offbyinfinity.com", true },
- { "offenekommune.de", true },
- { "offenes-deutschland.de", true },
- { "offensity.com", true },
- { "offerhome.com", true },
- { "offertegiuste.com", true },
- { "offgridauto.com", true },
- { "offgridhub.com", true },
- { "office-discount.at", true },
- { "office-discount.de", true },
- { "office-furniture-direct.co.uk", true },
- { "officefundays.co.uk", true },
- { "officeinteriors.co.nz", true },
- { "officemovepro.com", true },
- { "officezoneonline.com", true },
- { "officina.roma.it", true },
- { "officium.tech", true },
- { "offlimo.com", true },
- { "offroadeq.com", true },
- { "offroadhoverboard.net", true },
- { "offshoot.ie", true },
- { "offshoot.rentals", true },
- { "offshore.digital", true },
- { "offshoremarineparts.com", false },
- { "offtopica.uk", true },
- { "ofggolf.com", true },
- { "ofileo.fr", true },
- { "ofisescort.tk", true },
- { "oflow.me", true },
- { "oftamedic.com", false },
- { "oftn.org", true },
- { "ogamerezine.tk", true },
- { "oge.ch", false },
- { "oghost.ir", true },
- { "ogkw.de", true },
- { "ogo-knigi.ml", true },
- { "oguya.ch", true },
- { "ogyaa.jp", true },
- { "oh-leg.com", true },
- { "ohadsoft.com", true },
- { "ohai.su", true },
- { "ohartl.de", true },
- { "ohbabybean.com", true },
- { "ohchouette.com", true },
- { "ohd.dk", true },
- { "oheila.com", true },
- { "ohentpay.com", true },
- { "ohhere.xyz", true },
- { "ohioflockcote.com", true },
- { "ohiohealthfortune100.com", true },
- { "ohm.sg", true },
- { "ohm2013.org", true },
- { "ohmy.ca", true },
- { "ohne-name.de", true },
- { "ohnonotme.com", true },
- { "ohol.se", true },
- { "ohome.io", true },
- { "ohoreviews.com", true },
- { "ohsocool.org", true },
- { "ohsohairy.co.uk", true },
- { "ohyooo.com", true },
- { "oic-ci.gc.ca", true },
- { "oil-ecn.ru", true },
- { "oimexico.tk", true },
- { "oisd.nl", true },
- { "oita-homes.com", true },
- { "ojaioliveoil.com", true },
- { "ojdip.net", true },
- { "ojojz.com", true },
- { "ojomovies.com", true },
- { "ojp.gov", true },
- { "ok118.com", true },
- { "ok3on.cz", true },
- { "ok7779.com", true },
- { "okad-center.de", true },
- { "okad.de", true },
- { "okad.eu", true },
- { "okada-touki.jp", true },
- { "okaidi.es", true },
- { "okaidi.fr", true },
- { "okakuro.org", true },
- { "okasurfbali.com", true },
- { "okay.cf", true },
- { "okay.coffee", true },
- { "okaz.de", true },
- { "okazoo.eu", true },
- { "okburrito.com", true },
- { "okchousebuyer.com", true },
- { "okeeferanch.ca", true },
- { "okewp.com", true },
- { "okhrana.agency", true },
- { "okib.ca", true },
- { "okin-jp.net", true },
- { "okinawa-mag.net", true },
- { "okkhor52.com", true },
- { "oklahomafibroids.com", true },
- { "okmx.cloud", true },
- { "okmx.de", true },
- { "okmyanmartravels.com", false },
- { "okna-tm.kz", true },
- { "okonetwork.org.uk", true },
- { "okonto.com", true },
- { "okotoksbeach.ca", true },
- { "okpo.tk", true },
- { "okqubit.net", true },
- { "oksafe-t.org", true },
- { "oktayincesuturizm.com", true },
- { "oktime.cz", true },
- { "oku-nara.com", true },
- { "okukan.com.au", true },
- { "okulistiyoruz.tk", true },
- { "okurapictures.com", true },
- { "okusiassociates.com", true },
- { "okviz.com", true },
- { "okwu.cz", true },
- { "olafnorge.de", true },
- { "olafwalther.de", true },
- { "olanderflorist.com", true },
- { "olasouris.com", false },
- { "olastrafford.org", true },
- { "olback.net", true },
- { "olbat.net", true },
- { "olcayanar.com", true },
- { "olcbrookhaven.org", true },
- { "oldaine.tk", true },
- { "oldbkcom.tk", true },
- { "oldbrookinflatables.co.uk", true },
- { "oldbrookmarqueehire.co.uk", true },
- { "oldchaphome.nl", true },
- { "oldcity.tk", true },
- { "older-racer.com", true },
- { "oldfieldmusic.tk", true },
- { "oldiesmusicguide.tk", true },
- { "oldita.ru", true },
- { "oldking.net", true },
- { "oldliverpoolrailways.tk", true },
- { "oldnews.news", true },
- { "oldno07.com", true },
- { "oldoakflorist.com", true },
- { "oldonyosafaris.com", true },
- { "oldprop.com", true },
- { "oldriver.tk", true },
- { "oldroutetwo.com", true },
- { "oldschool-criminal.com", true },
- { "oldsticker.com", true },
- { "oldstmary.com", true },
- { "oldtimerparts.de", true },
- { "oldtimerreifen-moeller.de", true },
- { "oleam.org", true },
- { "olecoin.io", true },
- { "olegon.ru", true },
- { "olegrpg.in.ua", true },
- { "olegs.be", true },
- { "oleksii.name", true },
- { "olenergie.com", true },
- { "olenergie.fr", true },
- { "olenergies.com", true },
- { "olenergies.eu", true },
- { "olenergies.fr", true },
- { "oleodecopayba.com.br", true },
- { "oles-hundehaus.de", true },
- { "olesaradio.tk", true },
- { "olfnewcastle.com", true },
- { "olfsecane.org", true },
- { "olgcc.net", true },
- { "olgiati.org", false },
- { "olgun.eu", true },
- { "olhcparish.net", true },
- { "olibomb.cc", true },
- { "olightstore.ro", true },
- { "olinux.fr", true },
- { "olitham.com", true },
- { "olive.my", true },
- { "olivemultispecialist.com", true },
- { "oliveoil.bot", true },
- { "oliveoilschool.org", true },
- { "oliveoiltest.com", true },
- { "oliveoiltimes.com", true },
- { "oliver-wiedemann.net", true },
- { "oliverah.com", true },
- { "oliverclausen.com", true },
- { "oliverdunk.com", false },
- { "olivernaraki.com", true },
- { "oliverniebuhr.de", true },
- { "oliverschmid.space", true },
- { "oliverspringer.eu", true },
- { "oliverst.com", true },
- { "olivia-smith.com", true },
- { "olivier-rochet.com", true },
- { "olivierberardphotographe.com", true },
- { "olivierpieters.be", true },
- { "oliviervaillancourt.com", true },
- { "olizeite.ch", false },
- { "ollie.io", true },
- { "ollieowlsblog.com", true },
- { "ollies.cloud", true },
- { "ollies.cz", true },
- { "olliespage.com", true },
- { "olliespage.net", true },
- { "olliespage.uk", true },
- { "ollning.com", true },
- { "ollo.ga", true },
- { "olmari.fi", true },
- { "olmc-nutley.org", true },
- { "olmcjc.com", true },
- { "olmcnewark.com", true },
- { "olmik.net", true },
- { "olmmcc.tk", true },
- { "olmsted.io", true },
- { "olofsson.cc", true },
- { "ololmke.org", true },
- { "olomercy.com", true },
- { "olopp.org", true },
- { "olqoa.org", true },
- { "olschurch.com", true },
- { "olsh-hilltown.com", true },
- { "olsonproperties.com", true },
- { "olymp-arts.world", false },
- { "olympeakgaming.tv", true },
- { "olympiads.ca", true },
- { "olympic-research.com", true },
- { "olympicfitness.com.mx", true },
- { "om.yoga", true },
- { "om1.com", true },
- { "omahmebel.com", true },
- { "omangrid.com", true },
- { "omanko.porn", false },
- { "omarsamarah.tk", true },
- { "omega-marijuana.com", true },
- { "omegahosting.net", true },
- { "omegarazer.ca", true },
- { "omegathermoproducts.nl", true },
- { "omenprinting.com.au", true },
- { "omeopatiadinamica.it", true },
- { "omertabeyond.com", true },
- { "omertabeyond.net", true },
- { "ometepeislandinfo.com", true },
- { "omexcables.com", true },
- { "omf.link", true },
- { "omfg.exposed", true },
- { "omgbouncycastlehire.co.uk", true },
- { "omicron3069.com", true },
- { "omitech.co.uk", true },
- { "ommcitalflex.com", true },
- { "omniaclubs.com", true },
- { "omniasig.ro", true },
- { "omniatv.com", true },
- { "omnibot.tv", true },
- { "omnifurgone.it", true },
- { "omnigon.network", true },
- { "omnimoto.it", true },
- { "omnisiens.se", true },
- { "omniteck.com", true },
- { "omnitrack.org", true },
- { "omniverse.ru", true },
- { "omny.info", true },
- { "omoide-hitokoto.com", true },
- { "omori.ch", true },
- { "omoteura.com", true },
- { "omranic.com", true },
- { "omronwellness.com", true },
- { "omsdieppe.fr", true },
- { "omshivalab.com", true },
- { "omsk-web.ml", true },
- { "omsknews.tk", true },
- { "omskrock.com", true },
- { "omskweb.tk", true },
- { "omtleden.nl", true },
- { "on-targettrainingcourses.com", true },
- { "on-tech.co.uk", true },
- { "on-the-wave.com", true },
- { "on-this.link", true },
- { "on.tax", true },
- { "on2it.net", true },
- { "on9.link", true },
- { "ona.io", true },
- { "onaboat.se", true },
- { "onahonavi.com", true },
- { "onair.ovh", true },
- { "onarto.com", true },
- { "onbuzzer.com", false },
- { "oncalltech.net", true },
- { "onceuponabow.org", true },
- { "onceuponarainbow.co.uk", true },
- { "oncf.asso.fr", true },
- { "onchol.com", true },
- { "oncodedesign.com", true },
- { "oncotarget.ru", true },
- { "ond-inc.com", true },
- { "ond-inc.jp", true },
- { "ondcp.gov", true },
- { "ondeapostar.pt", true },
- { "onderwijstransparant.nl", true },
- { "ondevamosjantar.com", true },
- { "ondiet.biz", true },
- { "ondrej.org", true },
- { "ondrejbudin.cz", true },
- { "one---line.com", true },
- { "one-news.net", true },
- { "one-resource.com", true },
- { "one-s.co.jp", true },
- { "one-tab.com", true },
- { "one2edit.com", true },
- { "one6688.com", true },
- { "oneartyminute.com", true },
- { "oneazcu.com", false },
- { "onebigcow.com", true },
- { "oneclic.ch", false },
- { "oneclickjailbreak.com", true },
- { "oneclickroot.com", true },
- { "onedottwelve.co.jp", false },
- { "onedottwelve.com", false },
- { "onedrive.com", true },
- { "onedrive.live.com", false },
- { "onee3.org", true },
- { "oneearthapp.com", true },
- { "oneheartbali.church", false },
- { "oneiroi.co.uk", true },
- { "oneless.tk", true },
- { "onelifenutrition.co.uk", true },
- { "onelinkmmp.net", true },
- { "onemeter.com", true },
- { "onemid.net", true },
- { "onemoonmedia.de", true },
- { "onenetcdn.com", true },
- { "oneononeonone.de", true },
- { "oneononeonone.tv", true },
- { "onepercentrentals.com", true },
- { "onepersona.io", true },
- { "onepointsafeband.ca", true },
- { "onepointsafeband.com", true },
- { "onepointzero.com", true },
- { "oneprediction.com", true },
- { "oneshotmediakc.com", true },
- { "onesports.cz", true },
- { "onestasolar.com", true },
- { "onestopcastles.co.uk", true },
- { "onestpasdesanges.fr", true },
- { "onetcenter.org", true },
- { "onetcodeconnector.org", true },
- { "onetime.info", true },
- { "onetonline.org", true },
- { "onetouchrevealplus.com", true },
- { "onetwentyseven001.com", true },
- { "onetwosweetatelier.com", true },
- { "oneway.ga", true },
- { "onewaymail.com", true },
- { "oneweb.hu", true },
- { "onfarma.it", true },
- { "ongea.io", true },
- { "ongiaenegogoa.com", true },
- { "onhistory.co.uk", true },
- { "onhub1.com", true },
- { "oni.nl", true },
- { "onice.ch", true },
- { "onionplay.eu", true },
- { "onionplay.net", true },
- { "onionscan.org", true },
- { "onionyst.com", true },
- { "oniria.ch", false },
- { "onix.eu.com", true },
- { "onixcco.com.br", true },
- { "onkentessegertdij.hu", true },
- { "onlfait.ch", false },
- { "online-backup.se", true },
- { "online-biblio.tk", true },
- { "online-calculator.com", true },
- { "online-eikaiwa-guide.com", true },
- { "online-health-insurance.com", true },
- { "online-lernprogramme.de", true },
- { "online-pr.at", true },
- { "online-scene.com", true },
- { "online-stopwatch.com", true },
- { "online-textil.com", true },
- { "online-textil.cz", true },
- { "online-textil.sk", true },
- { "online.swedbank.se", true },
- { "online24.pt", true },
- { "onlineautodealered.com", true },
- { "onlinecasinobluebook.com", true },
- { "onlinecasinoselite.org", true },
- { "onlinecensorship.org", true },
- { "onlinecollegeessay.com", true },
- { "onlinedemo.hu", true },
- { "onlinehaircuts.com", true },
- { "onlinehashfollow.com", true },
- { "onlinekmc.com", true },
- { "onlinekocunuz.com", true },
- { "onlinelegalmarketing.com", true },
- { "onlinelegalmedia.com", true },
- { "onlineltctraining.com", true },
- { "onlinemarketingmuscle.com", true },
- { "onlinemarketingtraining.co.uk", true },
- { "onlinepokerspelen.be", true },
- { "onlineradio.pp.ua", true },
- { "onlinerollout.de", false },
- { "onlinesports.tk", true },
- { "onlinestoresite.com.au", true },
- { "onlinesystem.jp", true },
- { "onlinetextil.cz", true },
- { "onlineth.com", false },
- { "onlinevergidanismani.com", true },
- { "onlinevisa.ru", true },
- { "onlineweblearning.com", true },
- { "onload.pt", true },
- { "only-fragrances.com", true },
- { "onlycrumbsremain.co.uk", true },
- { "onlysim.nl", true },
- { "onmaps.de", true },
- { "onmarketbookbuilds.com", true },
- { "onnaguse.com", true },
- { "onoranzefunebri.roma.it", true },
- { "onore.org", true },
- { "onpay.io", true },
- { "onpointplugins.com", true },
- { "onqproductions.com", true },
- { "onrr.gov", true },
- { "ons.ca", true },
- { "onsgenoegen-waz.nl", true },
- { "onshuistrust.co.za", true },
- { "onsinscrit.com", true },
- { "onspring.com", true },
- { "onsudoku.com", true },
- { "ontdekhetzelf.nu", true },
- { "onthebriteside.com", true },
- { "ontheten.org", true },
- { "ontogenese.net", true },
- { "ontourmarketing.at", true },
- { "ontrio.cz", true },
- { "ontsc.com", true },
- { "ontservice.com", true },
- { "ontstoppingsdienst123.be", true },
- { "onurer.net", true },
- { "onvey.io", true },
- { "onviga.de", true },
- { "onvisible.website", true },
- { "onvori.com", true },
- { "onvori.de", true },
- { "onvousment.fr", true },
- { "onysix.net", true },
- { "onyxcts.com", true },
- { "onyxfireinc.com", true },
- { "onyxgen.duckdns.org", true },
- { "onyxmoon.me", true },
- { "onzerelaties.net", true },
- { "oo918.com", true },
- { "oodlessoftplay.co.uk", true },
- { "oogami.name", true },
- { "ooharttemplates.com", true },
- { "oolsa.net", true },
- { "ooo-santal.ml", true },
- { "ooonja.de", true },
- { "oortcast.com", true },
- { "oosolutions.nl", true },
- { "ooyo.be", true },
- { "op3racional.eu", true },
- { "op3y.com", true },
- { "opalesurfcasting.net", true },
- { "oparl.org", true },
- { "opbedbugcanines.com", true },
- { "opcare.co.uk", true },
- { "opcenter.de", true },
- { "opcionpublicitaria.com", true },
- { "ope.ee", true },
- { "opel-focken.de", true },
- { "open-banking-access.uk", true },
- { "open-bs.com", true },
- { "open-bs.ru", true },
- { "open-ctp.com", true },
- { "open-ctp.org", true },
- { "open-desk.org", true },
- { "open-freax.fr", false },
- { "open-future.be", true },
- { "open-gaming.net", true },
- { "open-infrastructure.net", true },
- { "open-letters.de", true },
- { "open-mesh.org", true },
- { "open-sauce-recipes.co.uk", true },
- { "open-source.gr", true },
- { "open.gl", true },
- { "open.ru", true },
- { "openacte.ch", false },
- { "openai.community", true },
- { "openarch.nl", true },
- { "openbayes.blog", true },
- { "openbayes.com", true },
- { "openbayesstatus.com", true },
- { "openbeecloud.com", true },
- { "openblox.org", true },
- { "opencad.io", true },
- { "opencaves.io", true },
- { "opencircuit.nl", true },
- { "openclima.com", true },
- { "openconf.uk", true },
- { "opencpes.com", true },
- { "opencrm.co.uk", true },
- { "openctp.org", true },
- { "opendata.cz", true },
- { "opendataincubator.eu", true },
- { "opendecide.com", true },
- { "openfir.st", true },
- { "openfitapi-falke.azurewebsites.net", true },
- { "opengovpartnership.de", true },
- { "openings.ninja", true },
- { "openitforum.pl", true },
- { "openjur.de", true },
- { "openkim.org", true },
- { "openkvk.nl", true },
- { "openmail.ml", true },
- { "openmirrors.ml", true },
- { "opennippon.com", true },
- { "opennippon.ru", true },
- { "openpictures.ch", true },
- { "openquery.com.au", true },
- { "openrainbow.com", true },
- { "openrainbow.net", true },
- { "openre.site", true },
- { "openrealestate.co", true },
- { "openresearch.amsterdam", true },
- { "openreview.net", true },
- { "openroademail.com", true },
- { "openrtm.org", true },
- { "openruhr.de", true },
- { "openscreen.lu", true },
- { "openshippers.com", true },
- { "opensource-cms.nl", true },
- { "opensource-training.de", true },
- { "opensourcesurvey.org", true },
- { "openspa.webhop.info", true },
- { "openssl.org", true },
- { "openstandia.jp", true },
- { "openstem.com.au", true },
- { "openstreetmap.is", true },
- { "openstreetmap.lu", true },
- { "openstreetmap.org", true },
- { "opentrack.info", true },
- { "opentrash.org", true },
- { "opentuition.com", true },
- { "openvz.org", true },
- { "openwifi.gr", true },
- { "openwireless.org", true },
- { "openwrt-dist.tk", true },
- { "operanavigation.ro", true },
- { "operr.com", true },
- { "operrbilling.com", true },
- { "operrgroup.com", true },
- { "operrhealth.com", true },
- { "operrtel.com", true },
- { "opexterminating.com", true },
- { "opfin.com", true },
- { "ophis-phosphoros.com", true },
- { "opiates.ca", true },
- { "opic.gov", true },
- { "opin.me", true },
- { "opinio.fr", true },
- { "opinionitech.com", true },
- { "opioids.co.uk", true },
- { "opioids.com", true },
- { "opioids.gov", true },
- { "opioneers.ga", true },
- { "opium.io", true },
- { "oplatki-charistia.pl", true },
- { "oplop.appspot.com", true },
- { "opncld.com", true },
- { "opoleo.com", true },
- { "oposiciones.com.es", true },
- { "oposicionesapolicialocal.es", true },
- { "oposicionescorreos.es", true },
- { "oposicionescorreos.info", true },
- { "oposicionesdejusticia.org", true },
- { "oposicionesprofesores.tk", true },
- { "oposicionesycursos.com", true },
- { "opp.moe", true },
- { "oppada.com", true },
- { "oppejoud.ee", true },
- { "opportunis.me", true },
- { "opportunity.de", true },
- { "opportunityliu.top", true },
- { "oppositionsecurity.com", true },
- { "oppwa.com", true },
- { "opq.pw", true },
- { "opraab.ga", true },
- { "oprbox.com", true },
- { "oprechtgezegd.nl", true },
- { "oprueba.com", true },
- { "opryshok.com", true },
- { "ops-com.com", true },
- { "ops.com.pl", true },
- { "opsmate.com", false },
- { "opstory.com", true },
- { "opti-net.at", true },
- { "opticaltest.com", true },
- { "optiekdemeester.be", true },
- { "optik-trosdorff.de", true },
- { "optiker-gilde.de", true },
- { "optimall.tk", true },
- { "optimalrehab.se", true },
- { "optimalsetup.com", true },
- { "optimaner.pl", true },
- { "optimist.bg", true },
- { "optimo.com.tr", true },
- { "optimumterapia.pl", true },
- { "optimumwebdesigns.com", true },
- { "optimus.io", true },
- { "optizym.de", true },
- { "opture.ch", true },
- { "opure.ru", true },
- { "opus-codium.fr", true },
- { "opus-consulting.no", true },
- { "opvakantie-noorwegen.nl", true },
- { "opvakantie-zweden.nl", true },
- { "oqpo.ru", true },
- { "oqwebdesign.com", true },
- { "orablanket.co.nz", true },
- { "oralb.co.uk", true },
- { "orang-utans.com", true },
- { "orangecat.tw", true },
- { "orangecomputers.com", true },
- { "orangefab.asia", true },
- { "orangejetpack.com", true },
- { "orangelandgaming.com", true },
- { "orangenbaum.at", true },
- { "orangewombat.com", true },
- { "orangtua.tk", true },
- { "orangutan-appeal.org.uk", true },
- { "orangutan.org", true },
- { "oranjee.net", false },
- { "orbital3.com", true },
- { "orbitalcommerce.com.br", true },
- { "orbitcleaning.com.au", true },
- { "orbits.ga", true },
- { "orbu.net", true },
- { "orca.pet", true },
- { "orcada.co", true },
- { "orcahq.com", true },
- { "orcamoney.com", true },
- { "orcawiki.nl", true },
- { "orchardnh.org", true },
- { "orchideenettoyage.com", true },
- { "orchidlive.com", true },
- { "orchidsforum.com", true },
- { "orcsnet.com", true },
- { "ordbokpro.se", true },
- { "orde.red", true },
- { "orderessay.net", true },
- { "ordermore.cloud", true },
- { "ordermygear.com", true },
- { "ordevanoranjenassau.nl", true },
- { "ordina.tk", true },
- { "ordoro.com", true },
- { "oreadstudios.com", true },
- { "orel-sait.tk", true },
- { "oreshinya.xyz", true },
- { "oreskylaw.com", true },
- { "oreto.de", false },
- { "orf-digitalsatkarte.at", false },
- { "orf-kartentausch.at", false },
- { "orfelios.com", true },
- { "organica.co.za", true },
- { "organisatieteam.nl", true },
- { "organisationsberatung-jacobi.de", true },
- { "organise.earth", true },
- { "orgasmium.com", true },
- { "orged.de", true },
- { "orgoniteindonesia.com", true },
- { "orgsyn.in", true },
- { "orgyporngroup.com", true },
- { "orhideous.name", true },
- { "orians.eu", true },
- { "oribia.net", true },
- { "orientalart.nl", true },
- { "oriflamesamara.tk", true },
- { "oriflameszepsegkozpont.hu", true },
- { "orifonline.ro", true },
- { "origami.to", true },
- { "origamika.com", true },
- { "origamitutorials.com", true },
- { "origin8delicafes.com", true },
- { "original-christstollen.com", true },
- { "original-christstollen.de", true },
- { "originalniknihy.cz", true },
- { "originpc.com", false },
- { "orikadabra.nl", true },
- { "orikos.tk", true },
- { "orikum.org", true },
- { "orimex-mebel.ru", true },
- { "orionfinancialservices.com", true },
- { "oriontravel.co", true },
- { "orkestar-krizevci.hr", true },
- { "orkiv.com", false },
- { "orlandobalbas.com", true },
- { "orlandoprojects.com", true },
- { "orleika.io", true },
- { "ormer.nl", true },
- { "ornsyn.no", true },
- { "oro.roma.it", true },
- { "orocojuco.com", true },
- { "orologeria.roma.it", true },
- { "orologidicristina.com", true },
- { "oroscopodelmese.it", true },
- { "orphee-beaute.com", true },
- { "orrs.de", true },
- { "ortho-europe.com", true },
- { "ortho-graz.at", true },
- { "orthograph.ch", true },
- { "orthotictransfers.com", true },
- { "ortlepp.eu", true },
- { "ortopedistamarcelocosta.com.br", true },
- { "ortopertutti.it", true },
- { "oruggt.is", true },
- { "orwell1984.today", true },
- { "oryva.com", true },
- { "os-s.net", true },
- { "os-t.de", true },
- { "os24.cz", true },
- { "osac.gov", true },
- { "osacrypt.studio", true },
- { "osagenation-nsn.gov", true },
- { "osakeannit.fi", true },
- { "osano.com", true },
- { "osbi.pl", true },
- { "osborn.io", true },
- { "osborneinn.com", true },
- { "osburn.com", true },
- { "oscarvk.ch", true },
- { "osci.io", true },
- { "oscillation-services.fr", true },
- { "oscloud.com", true },
- { "osepideasthatwork.org", true },
- { "oses.mobi", true },
- { "osez-l-odyssee.fr", true },
- { "oshayr.com", true },
- { "oshrc.gov", true },
- { "osielnava.com", true },
- { "osimmo.fr", true },
- { "osirium.com", true },
- { "oskrba.net", true },
- { "oskrba.online", true },
- { "oskuro.net", true },
- { "osla.org", true },
- { "oslinux.net", true },
- { "osm.is", true },
- { "osm.ovh", true },
- { "osmani-gebaeudereinigung.de", true },
- { "osmanlitorunu.com", true },
- { "osmdroid.net", true },
- { "osmosis.org", true },
- { "osmre.gov", true },
- { "osnova.cz", true },
- { "osobliwydom.pl", true },
- { "osolutionscorp.com", true },
- { "osom.finance", true },
- { "osomagicmountain.com", true },
- { "osomjournal.org", true },
- { "ospf.sk", true },
- { "osszekotatermeszettel.hu", true },
- { "ostachstore.com", true },
- { "ostan-collections.net", true },
- { "ostankino.tk", true },
- { "ostechnix.com", true },
- { "osteendiner.com", true },
- { "osteolaclusaz.com", true },
- { "osterkraenzchen.de", true },
- { "osterlensyd.se", true },
- { "ostgotamusiken.se", true },
- { "osti.gov", true },
- { "ostimwebyazilim.com", true },
- { "ostr.io", true },
- { "ostrov8.com", true },
- { "ostylelimo.com", true },
- { "osuarez3.com", true },
- { "osuszanie-krakow.pl", true },
- { "osuszanie-radom.pl", true },
- { "osuszanie-warszawa.pl", true },
- { "oswaldlabs.com", true },
- { "oswalds.co.uk", true },
- { "oswaldsmillaudio.com", true },
- { "oswbouncycastles.co.uk", true },
- { "osx86spain.com", true },
- { "oszri.hu", true },
- { "ota365.com", true },
- { "otakubox.de", true },
- { "otakurepublic.com", true },
- { "otakurumi.de", false },
- { "otdelka56.ml", true },
- { "otdyh-v-abhazii.tk", true },
- { "otellio.com", true },
- { "otellio.de", true },
- { "otellio.it", true },
- { "other98.com", true },
- { "otherlandlabs.com", true },
- { "oticasaopaulo.com.br", true },
- { "oticasvisao.net.br", true },
- { "otisko.com", true },
- { "otixz.com", true },
- { "otoblok.com", true },
- { "otocenterfelix.com.br", true },
- { "otokiralama.name.tr", true },
- { "otoma.tk", true },
- { "otomobilforumu.com", true },
- { "otooil.com", true },
- { "otoplastik.ml", true },
- { "otoplenie-ufa.ml", true },
- { "otorrino.pt", true },
- { "otoy.com", true },
- { "otoya.space", false },
- { "otprema.hr", true },
- { "otpsmart.com.ua", true },
- { "otr.ie", true },
- { "otrm.de", true },
- { "ots.gov", true },
- { "otsfreestyle.jp", true },
- { "ottoproject.io", false },
- { "ottoversand.at", true },
- { "ottxz.com", true },
- { "otus-magnum.com", true },
- { "otvaracie-hodiny.sk", true },
- { "otvertka.kz", true },
- { "otya.me", true },
- { "otzyvy2.ru", true },
- { "ouaibe.qc.ca", true },
- { "ouattara.ch", true },
- { "ouest-annonces.com", true },
- { "ouestsolutions.com", true },
- { "oulunjujutsu.com", true },
- { "ounage.de", true },
- { "our-box.de", true },
- { "ourai.ws", true },
- { "ourcloud.at", true },
- { "ourdocuments.gov", true },
- { "ourevents.net", true },
- { "ourfavorite-kakamigahara.jp", true },
- { "ourladymountcarmel.net", true },
- { "ourladyofcalvary.org", true },
- { "ourladyoftheassumptionchurch.org", true },
- { "ourladyqueenofmartyrs.org", true },
- { "ourls.win", true },
- { "ourmaster.org", true },
- { "ourocg.cn", true },
- { "ourworldindata.org", true },
- { "oussoren-vinetomatoes.com", true },
- { "out-of-scope.de", true },
- { "outdoorfurniture.ie", true },
- { "outdoorimagingportal.com", true },
- { "outdoorlightingagoura.com", true },
- { "outdoorlightingagourahills.com", true },
- { "outdoorlightingcalabasas.com", true },
- { "outdoorlightingconejovalley.com", true },
- { "outdoorlightingdosvientos.com", true },
- { "outdoorlightinghiddenhills.com", true },
- { "outdoorlightinglakesherwood.com", true },
- { "outdoorlightingmalibu.com", true },
- { "outdoorlightingmoorpark.com", true },
- { "outdoorlightingnewburypark.com", true },
- { "outdoorlightingoakpark.com", true },
- { "outdoorlightingsimivalley.com", true },
- { "outdoorlightingthousandoaks.com", true },
- { "outdoorlightingwestlakevillage.com", true },
- { "outdoortrip.com", true },
- { "outetc.com", true },
- { "outfunnel.com", true },
- { "outgress.com", true },
- { "outincanberra.com.au", true },
- { "outinjersey.net", true },
- { "outka.xyz", true },
- { "outline.ski", true },
- { "outlookonthedesktop.com", true },
- { "outsideconnections.com", true },
- { "outsiders.paris", false },
- { "outstack.vote", true },
- { "outwesthunts.com", true },
- { "ouwerling.tk", true },
- { "ovelhaostra.com", false },
- { "overamsteluitgevers.nl", true },
- { "overclockers.ge", true },
- { "overframe.gg", true },
- { "overijsselsemerentocht.nl", true },
- { "overlandireland.ie", true },
- { "overnetfaq.tk", true },
- { "overnightglasses.com", true },
- { "overpb.gq", true },
- { "overps.cf", true },
- { "overs.jp", true },
- { "overs.top", true },
- { "overseamusic.de", true },
- { "oversight.garden", true },
- { "oversight.gov", true },
- { "overstap.deals", true },
- { "overstemmen.nl", true },
- { "overstockpromote.com", true },
- { "overthecloud.it", true },
- { "overthinkingit.com", true },
- { "overtrolls.de", true },
- { "overwatchss.club", true },
- { "overzicht.pro", true },
- { "overzicht.ws", true },
- { "oveweddings.com", true },
- { "ovirt.org", true },
- { "ovisy.com", true },
- { "ovix.co", true },
- { "ovnrain.com", true },
- { "ovodev.com", true },
- { "ovvy.net", false },
- { "owapi.net", true },
- { "owddm.com", true },
- { "owennelson.co.uk", true },
- { "owensordinarymd.com", true },
- { "owl-square.com", true },
- { "owl-stat.ch", false },
- { "owl.net", true },
- { "own3d.ch", true },
- { "ownagepranks.com", true },
- { "ownc.at", true },
- { "owner.pw", true },
- { "ownian.com", true },
- { "ownmay.com", false },
- { "owntournament.org", true },
- { "oxanababy.com", true },
- { "oxborrow.ca", true },
- { "oxelie.com", false },
- { "oxfordbio.com", true },
- { "oxia.me", true },
- { "oxiame.eu", true },
- { "oxidemusic.com", true },
- { "oximo.lviv.ua", true },
- { "oxo.cloud", true },
- { "oxsec.co.uk", true },
- { "oxygin.net", true },
- { "oxymail.ru", true },
- { "oxyx.tk", true },
- { "oxz.me", true },
- { "oyosoft.fr", true },
- { "oyosoft.net", true },
- { "oysterworldwide.com", true },
- { "oyungg.net", true },
- { "oyunmadeni.tk", true },
- { "oyunpat.com", true },
- { "oz-style.com", true },
- { "ozalp.dk", true },
- { "ozark.be", true },
- { "ozarktrailcooler.com", true },
- { "ozli.ga", true },
- { "oznamovacipovinnost.cz", true },
- { "ozonstyle.ga", true },
- { "ozvolvo.org", true },
- { "p-damda.com", true },
- { "p-mint.jp", true },
- { "p-p.site", true },
- { "p-s-b.com", true },
- { "p1979.com", true },
- { "p1group.com", true },
- { "p1ratrulezzz.me", true },
- { "p22.co", true },
- { "p2d.ru", true },
- { "p333a.net", true },
- { "p333aaa.com", true },
- { "p333b.com", true },
- { "p333b.net", true },
- { "p333bb.com", true },
- { "p333bbb.com", true },
- { "p333c.com", true },
- { "p333c.net", true },
- { "p333cc.com", true },
- { "p333ccc.com", true },
- { "p333d.com", true },
- { "p333d.net", true },
- { "p333ddd.com", true },
- { "p333e.com", true },
- { "p333e.net", true },
- { "p333ee.com", true },
- { "p333f.com", true },
- { "p333f.net", true },
- { "p333ff.com", true },
- { "p333fff.com", true },
- { "p333g.com", true },
- { "p333g.net", true },
- { "p333ggg.com", true },
- { "p333h.com", true },
- { "p333h.net", true },
- { "p333hh.com", true },
- { "p333i.com", true },
- { "p333i.net", true },
- { "p333ii.com", true },
- { "p333iii.com", true },
- { "p333j.com", true },
- { "p333j.net", true },
- { "p333jj.com", true },
- { "p333jjj.com", true },
- { "p333k.com", true },
- { "p333kk.com", true },
- { "p333kkk.com", true },
- { "p333l.com", true },
- { "p333ll.com", true },
- { "p333lll.com", true },
- { "p333m.com", true },
- { "p333mm.com", true },
- { "p333mmm.com", true },
- { "p333n.com", true },
- { "p333nn.com", true },
- { "p333nnn.com", true },
- { "p333o.com", true },
- { "p333oo.com", true },
- { "p333ooo.com", true },
- { "p333q.com", true },
- { "p333qq.com", true },
- { "p333qqq.com", true },
- { "p333r.com", true },
- { "p333rr.com", true },
- { "p333rrr.com", true },
- { "p333s.com", true },
- { "p333sss.com", true },
- { "p333t.com", true },
- { "p333ttt.com", true },
- { "p333u.com", true },
- { "p333v.com", true },
- { "p333w.com", true },
- { "p333x.com", true },
- { "p333y.com", true },
- { "p333z.com", true },
- { "p365.vip", true },
- { "p36533.com", true },
- { "p36594.com", true },
- { "p4chivtac.com", true },
- { "p5on.net", true },
- { "p5r.uk", true },
- { "p81818.com", true },
- { "p888010.com", true },
- { "p9120.com", true },
- { "p9121.com", true },
- { "p9125.com", true },
- { "p9136.com", true },
- { "p9161.com", true },
- { "p9162.com", true },
- { "p9167.com", true },
- { "p9195.com", true },
- { "p9196.com", true },
- { "p91ab.com", true },
- { "p91ac.com", true },
- { "p91ad.com", true },
- { "p91ae.com", true },
- { "p91af.com", true },
- { "p91ag.com", true },
- { "p91ah.com", true },
- { "p91aj.com", true },
- { "pa-w.de", true },
- { "pa.search.yahoo.com", false },
- { "paardenhulp.nl", true },
- { "paardenpro.nl", true },
- { "paas-inf.net", true },
- { "paass.net", true },
- { "paazmaya.fi", true },
- { "pablo.im", true },
- { "pablo.scot", true },
- { "pablo.sh", true },
- { "pabloarteaga.co.uk", true },
- { "pabloarteaga.com", true },
- { "pabloarteaga.com.es", true },
- { "pabloarteaga.es", true },
- { "pabloarteaga.eu", true },
- { "pabloarteaga.info", true },
- { "pabloarteaga.me", true },
- { "pabloarteaga.name", true },
- { "pabloarteaga.net", true },
- { "pabloarteaga.nom.es", true },
- { "pabloarteaga.org", true },
- { "pabloarteaga.science", true },
- { "pabloarteaga.tech", true },
- { "pabloarteaga.uk", true },
- { "pabloarteaga.xyz", true },
- { "pablofain.com", true },
- { "pabloroblesminister.com", true },
- { "pablovaldiviesoar.com", true },
- { "pabuzo.vn", true },
- { "pacalzheimer.com", true },
- { "pacaom.com", true },
- { "pacatlantic.com", true },
- { "pacch.io", true },
- { "pacchioni.me", true },
- { "paccolat.name", true },
- { "pace.car", true },
- { "paced.me", true },
- { "pacelink.de", true },
- { "pacifco.com", true },
- { "pacificautobody.net", true },
- { "pacificbeachpub.com", true },
- { "pacificcashforcars.com.au", true },
- { "pacificgynsurgicalgroup.com", true },
- { "pacificintegration.ca", true },
- { "pacificpuke.com", true },
- { "pacifictilkin-occasions.be", false },
- { "pack-haus.de", true },
- { "packagingproject.management", true },
- { "packagist.jp", true },
- { "packagist.org", false },
- { "packaware.com", true },
- { "packetdigital.com", true },
- { "packetlinux.com", true },
- { "packetoverflow.com", true },
- { "pact2017.nl", true },
- { "pactandoconlamoda.com", true },
- { "pactf.com", true },
- { "pacxodka.ru", true },
- { "padam-group.com", true },
- { "padberx-marketing-consultants.de", true },
- { "paddy.rocks", true },
- { "padelbox.de", true },
- { "padeoe.com", true },
- { "padkit.org", true },
- { "padpilot.co", true },
- { "padron.com.es", true },
- { "padshah.tk", true },
- { "padzilla.com", true },
- { "paedlink.ca", true },
- { "paesi.info", true },
- { "paf-events.ch", false },
- { "pagalsongs.com", true },
- { "pagalsongs.world", true },
- { "pagalworld.com", true },
- { "pagalworld.info", true },
- { "pagalworld.io", true },
- { "pagalworld.la", true },
- { "pagalworld.live", true },
- { "pagalworld.me", true },
- { "pagalworld.org", true },
- { "pagamentosonline.pt", true },
- { "page-rank1.com", true },
- { "pageantsnews.com", false },
- { "pageboard.fr", true },
- { "pagecdn.io", true },
- { "pagedesignhub.com", true },
- { "pagedesignpro.com", true },
- { "pagedesignweb.com", true },
- { "pagefulloflies.io", true },
- { "pagerduty.com", true },
- { "pagewizz.com", true },
- { "pagiamtzis.com", true },
- { "pagina394.com.br", true },
- { "paginamaravillosa.tk", true },
- { "paginaweb4u.com", true },
- { "paguponku.com", true },
- { "pagure.io", true },
- { "pagure.org", true },
- { "pahealthbilling.com", true },
- { "pahlawanpulsa.com", true },
- { "pahub.io", true },
- { "paichai.space", false },
- { "paiementdp.com", true },
- { "paindata.dk", true },
- { "painefamily.co.uk", true },
- { "paintball-ljubljana.si", true },
- { "paintball-shop.sk", true },
- { "paintbrush.ga", true },
- { "paintersgc.com.au", true },
- { "paintingindurban.co.za", true },
- { "paipuman.jp", true },
- { "pajadam.me", true },
- { "pajuvuo.fi", true },
- { "pakaranggrek.com", true },
- { "paketbox-systems.at", true },
- { "paketo.cz", true },
- { "paketo.sk", true },
- { "paketwatch.de", false },
- { "pakho.xyz", true },
- { "pakingas.lt", true },
- { "pakistan24.tk", true },
- { "pakistani.dating", true },
- { "pakitow.fr", true },
- { "paknetworking.org", true },
- { "paktolos.net", true },
- { "palabr.as", true },
- { "palapadev.com", true },
- { "palariviera.com", true },
- { "palary.work", true },
- { "palatin.at", true },
- { "palava.tv", true },
- { "palavalbasket.it", true },
- { "palavatv.com", true },
- { "palazzo.link", true },
- { "palazzotalamo.it", true },
- { "palebluedot.de", true },
- { "palembal.fr", true },
- { "palenque.tk", true },
- { "paleo.io", true },
- { "paleodietfoodlist.com", true },
- { "paleodietrecipes.com", true },
- { "paleorecipepro.com", true },
- { "paleoso.com", true },
- { "palermoantagonista.tk", true },
- { "palermopride.it", true },
- { "palestra.roma.it", true },
- { "palladium46.com", true },
- { "palletflow.com", true },
- { "palli.ch", false },
- { "palmaprop.com", true },
- { "palmen-apotheke.de", true },
- { "palner.eu", true },
- { "palomardisplays.com", true },
- { "pama.fun", true },
- { "pamaniqu.nl", true },
- { "pamc.tk", true },
- { "pamm.tk", true },
- { "pamsorel.co.za", true },
- { "pan.digital", true },
- { "panamatravel.tk", true },
- { "panangelium.tk", true },
- { "panasca.is", true },
- { "panascais.at", true },
- { "panascais.ch", true },
- { "panascais.co", true },
- { "panascais.com", true },
- { "panascais.cz", true },
- { "panascais.es", true },
- { "panascais.fi", true },
- { "panascais.fr", true },
- { "panascais.host", true },
- { "panascais.info", true },
- { "panascais.io", true },
- { "panascais.me", true },
- { "panascais.net", true },
- { "panascais.network", true },
- { "panascais.nl", true },
- { "panascais.org", true },
- { "panascais.pl", true },
- { "panascais.pt", true },
- { "panascais.pw", true },
- { "panascais.ru", true },
- { "panascais.site", true },
- { "panascais.tech", true },
- { "panascais.us", true },
- { "panascais.zone", true },
- { "panaxis.biz", true },
- { "panaxis.ch", true },
- { "panaxis.li", true },
- { "panda-community.com", true },
- { "pandahut.net", true },
- { "pandaltd.nl", false },
- { "pandemic.group", true },
- { "pandemicflu.gov", true },
- { "pandiora.pw", true },
- { "pandithaya.tk", true },
- { "pandkonijn.nl", true },
- { "pandoraflora.com", true },
- { "panduan-hamil.tk", true },
- { "pandymic.com", true },
- { "paneldewelopera.pl", true },
- { "paneldoorsolutions.com", true },
- { "paneu.de", true },
- { "panevo.com", true },
- { "pangoly.com", true },
- { "panhandlemenshealth.com", true },
- { "panic.tk", true },
- { "panier-legumes.bio", true },
- { "panino.gr", true },
- { "paninohome.com", true },
- { "paniodpolskiego.eu", false },
- { "paniyanovska.ua", true },
- { "panj.ws", true },
- { "panjiva.com", true },
- { "panlex.org", true },
- { "panmetro.com", true },
- { "panopy.co", true },
- { "panopy.me", true },
- { "panoramahurtowni.pl", true },
- { "panoramichq.com", true },
- { "panpa.ca", true },
- { "panpsychism.com", true },
- { "panpsychist.com", true },
- { "pantallasled.mx", true },
- { "pantallasyescenarios.com", false },
- { "pantheoncrafters.com", true },
- { "panthi.lk", true },
- { "panthur.com.au", false },
- { "pantographe.info", false },
- { "pantou.org", false },
- { "pantsu.club", true },
- { "panzer72.ru", true },
- { "paolotagliaferri.com", true },
- { "pap.la", false },
- { "papa---mama.tk", true },
- { "papa-webzeit.de", true },
- { "papabearsautocenter.com", true },
- { "papadopoulos.me", true },
- { "papakatsu-life.com", true },
- { "papaya.me.uk", true },
- { "papayame.com", true },
- { "papayapythons.com", true },
- { "papelcraft.co.uk", true },
- { "papelpack.cl", true },
- { "paper-republic.org", true },
- { "paper.sc", true },
- { "paperlesssolutionsltd.com.ng", true },
- { "papermuseum.jp", true },
- { "paperplatefun.com", true },
- { "papersmart.net", true },
- { "papertracker.net", true },
- { "paperturn.com", true },
- { "paperwritinghelp.net", true },
- { "paperwritten.com", true },
- { "papiermakerijdehoop.nl", true },
- { "papiermeteenverhaal.nl", true },
- { "papierniczy.eu", true },
- { "papillon-events.be", true },
- { "papion.it", true },
- { "pappasappar.se", true },
- { "paprikas.fr", true },
- { "par-allel.ru", true },
- { "paraborsa.net", true },
- { "parachute70.com", false },
- { "paracomer.es", true },
- { "paradais-sphynx.com", true },
- { "paradependentesquimicos.com.br", true },
- { "paradies-baar.ch", true },
- { "paradigma-med.ru", true },
- { "paradise-engineer.com", true },
- { "paradise-engineering.com", true },
- { "paradise-travel.net", true },
- { "paradiselost.com", true },
- { "paradiseprivatehospital.com", true },
- { "paragonie.com", false },
- { "paragonremodeling.com", true },
- { "paragontasarim.com", true },
- { "paragreen.net", true },
- { "paramaquetas.com", true },
- { "paramountelectronics.co.uk", true },
- { "paranoidandroid.tk", true },
- { "paranoidmode.com", true },
- { "paranoidpenguin.net", true },
- { "paranoxer.hu", true },
- { "parareflex.fr", true },
- { "parasitologyclub.org", true },
- { "parasosto.fi", true },
- { "paratlan.hu", true },
- { "paratxt.org", true },
- { "parcbotanique.com", true },
- { "parcelbroker.co.uk", false },
- { "parchcraftaustralia.com", true },
- { "parckwart.de", true },
- { "parcon.it", true },
- { "parcoursup.fr", true },
- { "pareachat.com", true },
- { "paremvasi.net", true },
- { "parentelement.com", true },
- { "parentinterview.com", true },
- { "parents-as-allies.com", true },
- { "parentsandzebrasunited.com", true },
- { "parentsintouch.co.uk", true },
- { "parfum-selbermachen.de", true },
- { "parfumer.tk", true },
- { "parfumerie-de-grasse.fr", true },
- { "pari.cz", true },
- { "parisackerman.com", true },
- { "parisbloom.com", true },
- { "parisderriere.fr", true },
- { "parisescortgirls.com", true },
- { "parisfranceparking.com", true },
- { "parisfranceparking.de", true },
- { "parisfranceparking.fr", true },
- { "parisfranceparking.nl", true },
- { "parisprovincedemenagements.fr", true },
- { "parkeerbordenhuren.be", true },
- { "parkefficient.de", true },
- { "parkeren.in", true },
- { "parkerplumbingcompany.com.au", true },
- { "parkers.co.uk", true },
- { "parket.gq", true },
- { "parkettdielen.net", true },
- { "parkhost.eu", true },
- { "parkinginparis.fr", true },
- { "parkingparisnord.fr", true },
- { "parkinsplasticsurgery.com", true },
- { "parkrocker.com", true },
- { "parkrunstats.servehttp.com", true },
- { "parkscandles.com", true },
- { "parkvetgroup.com", true },
- { "parkviewmotorcompany.com", true },
- { "parkwayminyan.org", true },
- { "parlamento.gub.uy", true },
- { "parleamonluc.fr", true },
- { "parleu2016.nl", true },
- { "parleur.net", true },
- { "parltrack.org", true },
- { "parmels.com.br", true },
- { "parnassys.net", true },
- { "parnizaziteksasko.cz", true },
- { "parodesigns.com", true },
- { "paroisses-theix-surzur.com", true },
- { "parolu.io", true },
- { "parquettista.milano.it", true },
- { "parquettista.roma.it", true },
- { "parrilladasparaeventos.com", true },
- { "parrocchiadimeana.tk", true },
- { "parrocchiamontevecchia.it", true },
- { "parry.org", true },
- { "pars.work", true },
- { "parsdev.ir", true },
- { "parsemail.org", true },
- { "parser.nu", true },
- { "parsonsfamilyhomes.com", true },
- { "parsuv.ir", true },
- { "part.la", true },
- { "partage-noir.fr", true },
- { "parteaga.com", true },
- { "parteaga.net", true },
- { "partecipa.tn.it", true },
- { "partenopei.net", true },
- { "parthkolekar.me", true },
- { "partii.tk", true },
- { "partin.nl", true },
- { "partner.sh", true },
- { "partnercardservices.com", true },
- { "partnermobil.de", true },
- { "partnersofprc.com", true },
- { "partnertaxhub.com", true },
- { "partnerwerk.de", true },
- { "partoenagua.org", true },
- { "partou.de", true },
- { "partridge.tech", true },
- { "parts4phone.com", false },
- { "partsestore.com", true },
- { "parturi-manner.fi", true },
- { "partusedtyres.net", true },
- { "party-and-play.co.uk", true },
- { "party-kneipe-bar.com", true },
- { "party-time-inflatables-durham.co.uk", true },
- { "partyausstatter24.de", true },
- { "partybounceplay.co.uk", true },
- { "partycentrumopenhuis.nl", true },
- { "partyhireisleofwight.co.uk", true },
- { "partyhireliverpool.co.uk", true },
- { "partypearl.de", true },
- { "partyrocksbounce.co.uk", true },
- { "partyschnaps.com", true },
- { "partyspaces.co.uk", true },
- { "partytime-uk.co.uk", true },
- { "partytimeltd.ie", true },
- { "partytownireland.co.uk", true },
- { "partytownmarquees.co.uk", true },
- { "partyvan.io", true },
- { "partyyy.io", true },
- { "partyzone.ie", true },
- { "parvaneh.fr", true },
- { "parys.org", true },
- { "pasadenapooch.org", true },
- { "pasalt.com", true },
- { "pasarella.eu", true },
- { "pasarkoin.co", true },
- { "pascal-bourhis.com", true },
- { "pascal-bourhis.net", true },
- { "pascal-wittmann.de", true },
- { "pascal90.de", true },
- { "pascalchristen.ch", true },
- { "pascaline-jouis.fr", true },
- { "pascalleguern.com", true },
- { "pascalmathis.com", true },
- { "pascalmathis.me", true },
- { "pascalmathis.net", true },
- { "pascualinmuebles.com", true },
- { "pasearch.nl", true },
- { "pashminacachemire.com", true },
- { "pasnederland.tk", true },
- { "pass.org.my", true },
- { "passabook.com", true },
- { "passau-webdesign.com", true },
- { "passbolt.com", true },
- { "passcod.name", true },
- { "passengertravelportal.com", true },
- { "passfilesafe.com", true },
- { "passfindr.com", true },
- { "passhojao.com", true },
- { "passieposse.nl", true },
- { "passionandbalance.com", true },
- { "passionate.org.nz", false },
- { "passionatefoodie.co.uk", true },
- { "passionatehorsemanship.com", true },
- { "passionatelife.com.au", true },
- { "passionebenessere.com", true },
- { "passionfiat.fr", true },
- { "passionpictures.eu", true },
- { "passover-fun.com", true },
- { "passport.yandex.by", true },
- { "passport.yandex.com", true },
- { "passport.yandex.com.tr", true },
- { "passport.yandex.kz", true },
- { "passport.yandex.ru", true },
- { "passport.yandex.ua", true },
- { "passports.govt.nz", true },
- { "passporttrails.com", true },
- { "passthepopcorn.me", true },
- { "passumpsicbank.com", true },
- { "passvanille-reservation.fr", true },
- { "passvau.lt", true },
- { "passwd.one", true },
- { "passwd.org", true },
- { "password-checker.de", true },
- { "password.work", true },
- { "passwordhashing.com", true },
- { "passwordkeeperbooks.com", true },
- { "passwords.google.com", false },
- { "passwordscon.org", true },
- { "passwordsecurity.info", true },
- { "passworks.io", true },
- { "passy.pw", true },
- { "pasta-factory.co.il", true },
- { "pastaenprosecco.nl", true },
- { "paste.fedoraproject.org", true },
- { "paste.gg", true },
- { "paste.to", true },
- { "pastebin.co.za", true },
- { "pastebin.run", true },
- { "pasteht.ml", true },
- { "pasternok.org", true },
- { "pasticcerialorenzetti.com", true },
- { "pastimeproject.com", true },
- { "pasztor.at", true },
- { "patapwn.com", true },
- { "patatbesteld.nl", true },
- { "pataterosviajeros.com", true },
- { "patbatesremodeling.com", false },
- { "patchyvideo.com", true },
- { "patdorf.com", true },
- { "patechmasters.com", true },
- { "patentados.com", true },
- { "patentfamily.de", true },
- { "pathagoras.com", true },
- { "pathsha.re", true },
- { "patika-biztositas.hu", true },
- { "patikabiztositas.hu", true },
- { "patineteselectricosbaratos.net", true },
- { "patioroof.cf", true },
- { "patlis.com", true },
- { "patric-lenhart.de", true },
- { "patriciaandpaul.com", true },
- { "patrick-othmer.de", true },
- { "patrick-robrecht.de", true },
- { "patrick.my-gateway.de", true },
- { "patrick21.ch", true },
- { "patrickaudley.ca", true },
- { "patrickaudley.com", true },
- { "patrickbrosi.de", true },
- { "patrickcurl.com", true },
- { "patrickhoefler.net", true },
- { "patrickschneider.me", true },
- { "patrikgarten.de", true },
- { "patriksima.cz", true },
- { "patriksimek.cz", true },
- { "patrikzk.eu", true },
- { "patriotstationatchalfont.com", true },
- { "patrocinio.com.br", true },
- { "patrol-x.com", true },
- { "patryk.cf", true },
- { "patrz.eu", true },
- { "patsyforyou.ch", false },
- { "patsytoforyou.ch", false },
- { "pattayafruitgarden.tk", true },
- { "pattonfanatic.com", true },
- { "pattuka.com", true },
- { "pattyliao.com", true },
- { "paudley.ca", true },
- { "paudley.com", true },
- { "paudley.org", true },
- { "paul-barton.co.uk", true },
- { "paul-online.tech", true },
- { "paul-sitarz.com", true },
- { "paul.reviews", true },
- { "pauladamsmith.com", true },
- { "paulalutz.com", false },
- { "paulandmadge.com", true },
- { "paulbdelaat.nl", true },
- { "paulbramhall.uk", true },
- { "paulbrown.ddns.net", true },
- { "paulchen.at", true },
- { "paulcloud.fr", true },
- { "paulcoldren.org", true },
- { "paulcooper.me.uk", true },
- { "pauld.codes", true },
- { "pauld.digital", true },
- { "paulerhof.com", true },
- { "paulgerberrealtors.com", true },
- { "paulinewesterman.nl", true },
- { "paullockaby.com", true },
- { "paulmarc.org", true },
- { "paulmeier.com", false },
- { "paulocolacino.tk", true },
- { "paulov.com", true },
- { "paulov.info", true },
- { "paulov.ru", true },
- { "paulrobertlloyd.com", true },
- { "paulrotter.de", true },
- { "paulschreiber.com", true },
- { "paulscustomauto.com", true },
- { "paulsitarz.com", true },
- { "paulsnar.lv", true },
- { "paulswartz.net", true },
- { "paulus-foto.pl", true },
- { "paulw.io", true },
- { "paulward.net", true },
- { "paulwatabe.com", true },
- { "paulwendelboe.com", true },
- { "pauly-stahlhandel.com", true },
- { "pauly-stahlhandel.de", true },
- { "pautadiaria.com", true },
- { "pavamtio.cz", true },
- { "pavando.com", false },
- { "pavelfojt.cz", true },
- { "pavelitus.tk", true },
- { "pavelrebrov.com", true },
- { "pavelstriz.cz", true },
- { "pavernosmatao.tk", true },
- { "paw.cloud", true },
- { "paw.pt", true },
- { "pawel-international.com", true },
- { "pawelnazaruk.com", true },
- { "pawelurbanek.com", true },
- { "pawgearlab.com", true },
- { "pawspuppy.com", true },
- { "pawsr.us", true },
- { "pawsru.org", true },
- { "paxchecker.com", true },
- { "paxerahealth.com", true },
- { "pay-online.in", true },
- { "pay.gov", true },
- { "paya.cat", true },
- { "payboy.biz", true },
- { "payboy.rocks", true },
- { "paybro.eu", true },
- { "payexpresse.com", true },
- { "payfazz.com", true },
- { "payjunction.com", true },
- { "payjunctionlabs.com", true },
- { "paylike.io", true },
- { "payloc.io", true },
- { "payme.uz", true },
- { "payment-express.net", true },
- { "paymentaccuracy.gov", true },
- { "payments.google.com", true },
- { "paymerang.com", true },
- { "paymongo.com", true },
- { "paymongo.me", true },
- { "paymyphysician.com", true },
- { "paynet.com.co", true },
- { "payoff.com", true },
- { "paypal.com", true },
- { "paypaq.com", true },
- { "paypro.nl", false },
- { "payps.ru", true },
- { "payroll.myftp.org", true },
- { "paysbuy.net", true },
- { "paysera.com", true },
- { "payslipview.com", true },
- { "payssaintgilles.fr", false },
- { "paystack.com", true },
- { "paytm.in", true },
- { "paytonmoledor.com", true },
- { "payupay.ru", true },
- { "pazerandepstein.com", true },
- { "pb.ax", false },
- { "pbcables.tk", true },
- { "pborn.eu", true },
- { "pbosquet.com", false },
- { "pbourhis.me", true },
- { "pbr.so", true },
- { "pbren.com", true },
- { "pbrumby.com", true },
- { "pbwebdev.com", true },
- { "pbz.im", true },
- { "pc-rescue.me", false },
- { "pc-warriors.com", true },
- { "pc28yc.com", true },
- { "pcatv.org", true },
- { "pcbmarketing.gq", true },
- { "pcdbank.com", true },
- { "pcdn.cf", true },
- { "pcdocjim.com", true },
- { "pcel.com", true },
- { "pcexpress.tk", true },
- { "pcf92.fr", true },
- { "pcfeuerwehr.de", true },
- { "pcgamingfreaks.at", true },
- { "pchancs.com", true },
- { "pchelpforum.net", true },
- { "pci-e.net", true },
- { "pciconcursos.com.br", true },
- { "pcisecuritystandards.org", true },
- { "pcissc.org", true },
- { "pcjsercon.com", true },
- { "pckurzypd.sk", true },
- { "pclaeuft.de", true },
- { "pclob.gov", true },
- { "pcloud.com", true },
- { "pcmkrembangan.or.id", true },
- { "pcmr.info", true },
- { "pcprkolo.pl", true },
- { "pcr24.ru", true },
- { "pcrab.ml", true },
- { "pcrypt.org", true },
- { "pcs2.gr", true },
- { "pcsetting.com", true },
- { "pctonic.net", true },
- { "pctrouble.net", true },
- { "pculiar.com", true },
- { "pcunderground.com.ar", true },
- { "pcw.gov.ph", true },
- { "pdc.wales", true },
- { "pdf-archive.com", true },
- { "pdfconvert.me", true },
- { "pdfget.com", true },
- { "pdfmint.com", true },
- { "pdfpassword.org", true },
- { "pdfpasswort.de", true },
- { "pdfresizer.com", true },
- { "pdfsearches.com", true },
- { "pdkrawczyk.com", true },
- { "pdox.net", true },
- { "pdxtowncar.net", true },
- { "pe-bank.co.jp", true },
- { "pe-bank.jp", true },
- { "pe.search.yahoo.com", false },
- { "peaceandjava.com", true },
- { "peacedivorce.com", true },
- { "peaceispossible.cc", true },
- { "peacekeeper.tk", true },
- { "peaceloveandlabor.com", true },
- { "peakhomeloan.com", true },
- { "peakslead.com", true },
- { "peaksloth.com", true },
- { "peakvets.co.uk", true },
- { "peanutbase.org", true },
- { "peanutproductionsnyc.com", true },
- { "pear2pear.de", true },
- { "pearbloom.com", true },
- { "pearlsonly.ca", true },
- { "pearlsonly.com", true },
- { "pearlsonly.com.au", true },
- { "pearlsonly.de", true },
- { "peatsbeast.com", false },
- { "peawo.com", true },
- { "pebbleparents.com", true },
- { "pebblepointapartmentsstl.com", true },
- { "pebbles.net.in", true },
- { "pecheneg.tk", true },
- { "pechonova.com", true },
- { "pecker-johnson.com", true },
- { "peda.net", true },
- { "pedago.it", true },
- { "pedalsbarcelona.com", true },
- { "peddock.com", true },
- { "peddy.dyndns.org", true },
- { "pediatersucha.sk", true },
- { "pedicurean.nl", true },
- { "pedicureduiven.nl", true },
- { "pedigreetechnologies.com", true },
- { "pedikura-vitu.cz", true },
- { "pedimanie.cz", true },
- { "pedimoda.com.br", true },
- { "pedro.com.es", true },
- { "pedrosaurus.com", true },
- { "pedroventura.com", false },
- { "peeekaaabooo.com", true },
- { "peekier.com", true },
- { "peep.gq", true },
- { "peepsfoundation.org", false },
- { "peerbanking.com.au", true },
- { "peercraft.at", true },
- { "peercraft.be", true },
- { "peercraft.biz", true },
- { "peercraft.ch", true },
- { "peercraft.cn", true },
- { "peercraft.co.uk", true },
- { "peercraft.com", true },
- { "peercraft.de", true },
- { "peercraft.dk", true },
- { "peercraft.es", true },
- { "peercraft.eu", true },
- { "peercraft.fr", true },
- { "peercraft.info", true },
- { "peercraft.it", true },
- { "peercraft.net", true },
- { "peercraft.nl", true },
- { "peercraft.org", true },
- { "peercraft.pl", true },
- { "peercraft.pt", true },
- { "peercraft.se", true },
- { "peercraft.us", true },
- { "peerigon.com", true },
- { "peername.com", true },
- { "peernode.net", true },
- { "peers.cloud", true },
- { "peertube.social", true },
- { "peerweb.com", true },
- { "peetah.com", true },
- { "peeters.io", true },
- { "peev.io", true },
- { "pegas-studio.net", true },
- { "peifi.de", false },
- { "peippo.at", true },
- { "pekarstvivetvrzi.cz", true },
- { "pekinet.com", true },
- { "pekkapleppanen.fi", true },
- { "pekoe.se", true },
- { "pelachim.com.br", true },
- { "pelanucto.cz", true },
- { "pelican.ie", true },
- { "pelion.com", true },
- { "pellet.pordenone.it", true },
- { "pelletizermill.com", true },
- { "pelletsprice.com", true },
- { "pelopogrund.com", false },
- { "pelopoplot.com", false },
- { "pelosanimais.org", true },
- { "pelotonimports.com", true },
- { "peluqueriaalcobendas.com", true },
- { "peluqueriaalcobendas.es", true },
- { "pems.gov.au", true },
- { "pen-sec.de", true },
- { "penaugustin.com", true },
- { "pencepay.com", true },
- { "pencil2d.org", true },
- { "pencillab.cn", true },
- { "penconsultants.com", true },
- { "pendriveapps.com", true },
- { "pendrivelinux.com", true },
- { "penetrationstest.se", true },
- { "penfold.fr", true },
- { "pengepung.com", true },
- { "pengi.me", true },
- { "penguinbits.net", true },
- { "penguindrum.moe", true },
- { "penguinprotocols.com", true },
- { "penguinworld.co", true },
- { "penholder.ga", true },
- { "peniarth.cymru", true },
- { "penispumpen.se", true },
- { "pennergold.net", true },
- { "pennington.io", true },
- { "pennyparkerpaper.com", true },
- { "penrithapartments.com.au", true },
- { "pens.com", true },
- { "pensacolawinterfest.org", true },
- { "pensador.com", true },
- { "pensador.info", true },
- { "pensioenfonds-ey.nl", true },
- { "pension-am-alten-waschhaus.de", true },
- { "pensionecani.roma.it", true },
- { "pensioner-1000.tk", true },
- { "pensionpilot.ca", true },
- { "pensiunea-paco.ro", true },
- { "pensiunealido.ro", true },
- { "penslabyrinth.com", true },
- { "pentagram.me", true },
- { "pentamexicali.tk", true },
- { "pentatec.de", true },
- { "pentechealth.com", false },
- { "pentest.blog", true },
- { "pentest.nl", true },
- { "pentesterlab.com", true },
- { "penticton.photography", true },
- { "pentofun.ch", true },
- { "pentoo.ch", true },
- { "pentools.org", true },
- { "penz.media", true },
- { "penza-on-line.tk", true },
- { "penza-today.tk", true },
- { "penzaonline.cf", true },
- { "penzionvzahrade.cz", true },
- { "peoplelikemeapp.com", true },
- { "peoplescu.com", true },
- { "peoplesdecade.org", true },
- { "pepeelektro.sk", true },
- { "pepegym.cz", true },
- { "pepemodelismo.com.br", true },
- { "pepfar.gov", false },
- { "pepgrid.net", true },
- { "pepime.com", true },
- { "pepinierebotanique.com", true },
- { "peplog.nl", true },
- { "pepme.net", true },
- { "pepperandpartner.com", true },
- { "pepstaff.net", true },
- { "pequenosfavoritos.com.br", false },
- { "per-olsson.se", true },
- { "perala.me", true },
- { "peraparker.cz", true },
- { "percolate.com", true },
- { "percraft.com", true },
- { "percy.io", true },
- { "perd.re", true },
- { "perecraft.com", true },
- { "peredoz.tk", true },
- { "perevedi.org", true },
- { "perevedut.cf", true },
- { "perevirka.net", true },
- { "perewall.tk", true },
- { "perez-marrero.com", true },
- { "perezdecastro.org", true },
- { "perf1.com", true },
- { "perfect-carstyle.de", true },
- { "perfect-privacy.com", true },
- { "perfect.in.th", true },
- { "perfectbalance.tech", true },
- { "perfectcloud.org", true },
- { "perfectfocuseyecare.com", true },
- { "perfectgarden.es", true },
- { "perfectgift.com", true },
- { "perfectoparty.co.uk", true },
- { "perfectsnap.co.uk", true },
- { "perfectstreaming.systems", true },
- { "perfektesgewicht.de", true },
- { "perfmatters.io", true },
- { "performancegate.com", true },
- { "performancehealth.com", false },
- { "performancepiers.com", true },
- { "performing-art-schools.com", true },
- { "performio.co", true },
- { "perfumes.com.br", true },
- { "perfumestudio.in", true },
- { "perini.com.au", true },
- { "periodex.co", true },
- { "periodic-drinking.com", true },
- { "periscope.tv", true },
- { "perishablepress.com", true },
- { "perm-avia.ru", true },
- { "perm4.com", true },
- { "permaculture.cf", true },
- { "permajackofstlouis.com", true },
- { "permaseal.net", true },
- { "permeance108.com", true },
- { "permis-apoints.com", true },
- { "permiscoderoute.fr", true },
- { "permisecole.com", true },
- { "permistheorique.be", true },
- { "permistheoriqueenligne.be", true },
- { "perniciousgames.com", true },
- { "perot.me", true },
- { "perpetual.ga", true },
- { "perpetualemotion.com", true },
- { "perron.ml", true },
- { "perroquet-passion.ch", false },
- { "persefonne.com", true },
- { "persephone.gr", true },
- { "persiennkompaniet.se", true },
- { "persocloud.org", true },
- { "personadecoded.com", true },
- { "personal-genome.com", true },
- { "personalitymax.com", true },
- { "personaljokes.ml", true },
- { "personalnames.net.ru", true },
- { "personaltrainer-senti.de", true },
- { "personskadeadvokater.no", true },
- { "personvernnemnda.no", true },
- { "perspectivum.com", true },
- { "perspektivwechsel-coaching.de", true },
- { "persson.me", true },
- { "perthhillsarmadale.com.au", true },
- { "perthtrains.net", true },
- { "perubusca.nl", true },
- { "perulinks.tk", true },
- { "pervacio.hu", true },
- { "pervoklass.cf", true },
- { "perzeidi.hr", true },
- { "pescadorcomunicacao.com.br", true },
- { "pescco.com.br", true },
- { "pestcontrol.co.uk", true },
- { "pestici.de", true },
- { "pestpilis.hu", true },
- { "pet-hotel-mura.net", true },
- { "petabits.de", true },
- { "petalkr.com", true },
- { "petbooking.it", true },
- { "petburial.cf", true },
- { "petcarvers.com", true },
- { "petdesign.pet", true },
- { "petech.ro", true },
- { "petelew.is", true },
- { "peter-hurtenbach.de", false },
- { "peter.org.ua", true },
- { "peterandjoelle.co.uk", true },
- { "peterboers.info", true },
- { "peterborgapps.com", true },
- { "peterboweycomputerservices.com.au", true },
- { "peterbruceharvey.com", true },
- { "peterdavehello.org", true },
- { "peterfiorella.com", true },
- { "peterheery.me", true },
- { "peterhons.com.au", true },
- { "peterhuetz.at", true },
- { "peterhuetz.com", true },
- { "peterjin.org", true },
- { "peterjohnson.io", true },
- { "peterkrivanek.com", true },
- { "peterlew.is", true },
- { "petermaar.com", true },
- { "petersontoscano.com", true },
- { "petervaldesii.com", true },
- { "petervaldesii.io", true },
- { "petervanleeuwentweewielers.nl", true },
- { "petfa.ga", true },
- { "pethub.com", true },
- { "petit-archer.com", true },
- { "petite-maison.ch", true },
- { "petitsfrenchies.com", true },
- { "petja.me", false },
- { "petlife.vet", true },
- { "petmall.bg", true },
- { "petnow.gr", true },
- { "peto.nl", true },
- { "petofiprogram.hu", true },
- { "petos.tk", true },
- { "petplus.com", true },
- { "petpost.co.nz", false },
- { "petpower.eu", true },
- { "petr.as", true },
- { "petrachuk.ru", true },
- { "petrasestakova.cz", true },
- { "petravdbos.nl", true },
- { "petresort.pt", true },
- { "petroleum-schools.com", true },
- { "petrologisticsllc.com", true },
- { "petrotranz.com", true },
- { "petrotrustlibya.com", true },
- { "petrovich.pro", true },
- { "petrovitch.tk", true },
- { "petrsvec.cz", true },
- { "petrucciresidential.com", true },
- { "petruzz.net", true },
- { "petschnighof.at", true },
- { "petto.com.co", true },
- { "peturnashes.ga", true },
- { "petwall.info", true },
- { "petwatchersnj.com", true },
- { "pew.ninja", true },
- { "pewnews.org", true },
- { "pex.digital", false },
- { "peyote.com", true },
- { "peyote.org", true },
- { "pf.dk", true },
- { "pfa.or.jp", true },
- { "pfadfinder-aurich.de", true },
- { "pfadfinder-grossauheim.de", true },
- { "pfarre-kremsmuenster.at", true },
- { "pfarreiengemeinschaft-neuerburg.de", true },
- { "pfcafeen.dk", true },
- { "pfd-nz.com", false },
- { "pfefferkuchen-shop.de", true },
- { "pfefferkuchenprinzessin-dresden.de", true },
- { "pfeuffer-elektro.de", true },
- { "pfft.net", true },
- { "pfk.org.pl", true },
- { "pflan.dk", true },
- { "pflanzen-shop.ch", true },
- { "pflanzenshop-emsland.de", true },
- { "pfmeasure.com", true },
- { "pfnext.de", true },
- { "pfonks.com", true },
- { "pfotentour-berlin.de", true },
- { "pfrost.me", true },
- { "pfstaging.xyz", true },
- { "pg-forum.de", true },
- { "pg-mana.net", true },
- { "pgh-art.com", true },
- { "pgmann.cf", true },
- { "pgnetwork.net", true },
- { "pgpaintanddesign.com", true },
- { "pgpmail.cc", true },
- { "pgregg.com", true },
- { "ph-blog.de", true },
- { "ph.search.yahoo.com", false },
- { "ph3r3tz.net", true },
- { "phantastikon.de", true },
- { "phantomfund.ml", true },
- { "pharma-display.com", true },
- { "pharmaabsoluta.com.br", true },
- { "pharmaboard.de", true },
- { "pharmaboard.org", true },
- { "pharmaceuticalcannabis.org", true },
- { "pharmacieplusfm.ch", false },
- { "pharmacistinfo.ru", true },
- { "pharmacy.org.pk", true },
- { "pharmapolitics.com", true },
- { "pharmasana.co.uk", true },
- { "pharmasana.de", true },
- { "pharmasana.ru", true },
- { "pharmica.co.uk", true },
- { "pharmica.uk", true },
- { "pharside.dyndns.org", true },
- { "pharynks.com", true },
- { "pharynx.nl", true },
- { "phasme-2016.com", true },
- { "phaux.uno", true },
- { "phcimages.com", true },
- { "phcnetworks.net", false },
- { "phcorner.net", true },
- { "pheasantrunpress.com", true },
- { "phellowseven.com", true },
- { "phelx.de", true },
- { "phenixairsoft.com", true },
- { "phenq.com", true },
- { "phero.com", true },
- { "phget.com", true },
- { "phi-works.com", true },
- { "phibureza.com", true },
- { "phil-dirt.com", true },
- { "phil.red", true },
- { "phil.tw", true },
- { "philadelphia.com.mx", true },
- { "philanima.com", true },
- { "philarmonic-abaza.tk", true },
- { "phildonaldson.com", true },
- { "phileas-psychiatrie.be", true },
- { "philia-sa.com", false },
- { "philipdb.com", true },
- { "philipdb.nl", true },
- { "philipdeussen.com", true },
- { "philipdeussen.de", true },
- { "philiperiksson.se", true },
- { "philipkobelt.ch", true },
- { "philipp-trulson.de", false },
- { "philipp-winkler.de", true },
- { "philippbirkholz.de", true },
- { "philippe-mignotte.fr", true },
- { "philippebonnard.fr", true },
- { "philipperoose.be", false },
- { "philippestudiopro.com", true },
- { "philippheenen.de", false },
- { "philippinedroneassociation.org", true },
- { "philippinegreenparty.tk", true },
- { "philippinenewsvanguard.tk", true },
- { "philippkeschl.at", true },
- { "philipssupportforum.com", true },
- { "philipzhan.tk", true },
- { "phillipgoldfarb.com", true },
- { "phillipsdistribution.com", true },
- { "philna.sh", true },
- { "philo.shop", true },
- { "philosoftware.com.br", true },
- { "philosophers.tk", true },
- { "philosopherswool.com", true },
- { "philosophy-colleges.com", true },
- { "philosophy.moe", true },
- { "philosophyguides.org", true },
- { "philphonic.de", true },
- { "phils1990.com", true },
- { "philslab.cloud", true },
- { "philslab.ninja", true },
- { "philsown.de", true },
- { "philsturgeon.uk", true },
- { "philux.ch", false },
- { "phinphanatic.com", true },
- { "phive.eu", true },
- { "phoenixlogan.com", true },
- { "phoenixnest.ltd", true },
- { "phoenixnow.org", true },
- { "phoenixurbanspaces.com", true },
- { "phographer.com", true },
- { "pholder.com", true },
- { "phone-service-center.de", true },
- { "phone888.cn", true },
- { "phonedoc.it", true },
- { "phonefilter.co.uk", true },
- { "phonemore.com", true },
- { "phonenumber-info.co.uk", true },
- { "phonenumberfind.tk", true },
- { "phonetikos.com", true },
- { "phongthuyanthinh.vn", false },
- { "phongthuytaitam.vn", true },
- { "phormance.com", true },
- { "phosagro.biz", false },
- { "phosagro.com", false },
- { "phosagro.ru", false },
- { "phosphene.io", true },
- { "photistic.org", true },
- { "photo-castings.com", true },
- { "photo-livesearch.com", true },
- { "photo-paysage.com", true },
- { "photo.org.il", true },
- { "photoancestry.com", true },
- { "photoartelle.com", true },
- { "photobooth.id", true },
- { "photodeal.fr", true },
- { "photographe-reims.com", false },
- { "photographerforwedding.tk", true },
- { "photography-workshops.net", true },
- { "photolessya.by", true },
- { "photomaniastore.com", true },
- { "photomodelcasting.com", true },
- { "photosafari.com.my", true },
- { "photosafaribg.com", true },
- { "photosaloncontest.com", true },
- { "photosgaia.ch", true },
- { "phototravel.uk", true },
- { "phototrio.com", true },
- { "photoutils.com", true },
- { "phoxden.net", true },
- { "phoxmeh.com", true },
- { "php-developer.org", true },
- { "php-tuning.de", true },
- { "php.watch", true },
- { "phparcade.com", true },
- { "phpartners.org", true },
- { "phpbbchinese.com", true },
- { "phpcrudgenerator.com", true },
- { "phpdorset.co.uk", true },
- { "phpfashion.com", true },
- { "phpkoru.com", true },
- { "phpliteadmin.org", true },
- { "phpmyadmin.net", true },
- { "phpmynewsletter.com", true },
- { "phpower.com", true },
- { "phpprime.com", true },
- { "phpsecure.info", true },
- { "phpstan.org", true },
- { "phpunit.de", true },
- { "phuductms.com", true },
- { "phuket-idc.com", true },
- { "phuket-idc.de", true },
- { "phuket-nash.ga", true },
- { "phulyshop.com", true },
- { "phuoctran.com", true },
- { "phuoctran.com.vn", true },
- { "phuoctran.me", true },
- { "phuoctran.org", true },
- { "phuoctran.vn", true },
- { "phurl.de", true },
- { "phurl.io", true },
- { "phyley.com", true },
- { "physicalism.com", true },
- { "physicalist.com", true },
- { "physicpezeshki.com", false },
- { "physics-schools.com", true },
- { "physik.hu", true },
- { "physiotherapie-seiwald.de", true },
- { "physiovesenaz.ch", false },
- { "pi-control.de", true },
- { "pi-dash.com", true },
- { "pi-net.dedyn.io", true },
- { "pi-supply.com", true },
- { "pi3kum.com", true },
- { "pianetaottica.com", false },
- { "pianetatatuaggi.it", true },
- { "pianomover.co.uk", true },
- { "pianos.de", true },
- { "pianyigou.com", true },
- { "piata.com.br", true },
- { "piataborrachas.com.br", true },
- { "piatabrasil.com.br", true },
- { "piatatem.com.br", true },
- { "piatika.com", true },
- { "piboubes.me", true },
- { "pic.gov", false },
- { "pic2map.com", true },
- { "picchietti.io", true },
- { "piccirello.com", true },
- { "piccolo-parties.co.uk", true },
- { "pick150.hu", true },
- { "picka.gift", true },
- { "pickabrain.fr", true },
- { "pickelhaubes.com", true },
- { "picklinik.id", true },
- { "pickme.nl", false },
- { "pickmysoap.gr", true },
- { "pickormix.co.uk", true },
- { "picksin.club", true },
- { "pickthestory.com", true },
- { "pickupenc.ru", true },
- { "piclect.com", true },
- { "picom365.com", true },
- { "piconepress.com", true },
- { "picr.ws", true },
- { "picsto.re", true },
- { "pictorial.com.sg", true },
- { "pictoriastudios.com", true },
- { "pictorista.com", true },
- { "pictr.nl", true },
- { "picture.team", true },
- { "pictureguy.de", true },
- { "picturingjordan.com", true },
- { "pidginhost.com", true },
- { "pidibagrik.cz", true },
- { "pidjipi.com", true },
- { "pie-express.xxx", true },
- { "pieces-or.com", true },
- { "piedrasblancas.gov", true },
- { "piekacz.eu.org", true },
- { "piekacz.net", true },
- { "piekacz.tel", true },
- { "piektraining.com", true },
- { "pieland.eu", true },
- { "piem.org", true },
- { "piening.ddns.net", true },
- { "piepermail.nl", true },
- { "pieq.eu", true },
- { "pieq.eu.org", true },
- { "pier28.com", true },
- { "piercing.hu", true },
- { "piercraft.com", true },
- { "pierre-denoblens.net", true },
- { "pierre-schmitz.com", true },
- { "pierreau.fr", true },
- { "pierrefv.com", false },
- { "pierreterrien.fr", true },
- { "pierreyvesdick.fr", true },
- { "pierrickdeniel.fr", true },
- { "pieter-verweij.nl", true },
- { "pieterbamps.tk", true },
- { "pieterbos.nl", true },
- { "pieterdev.net", true },
- { "pieterhordijk.com", false },
- { "pietermaene.be", false },
- { "pietz.uk", true },
- { "pif.email", true },
- { "piffer.ind.br", true },
- { "pigb.net", true },
- { "pighouse.info", true },
- { "pigliadesigns.com", true },
- { "pijuice.com", true },
- { "pijusmagnificus.com", true },
- { "pik.bzh", true },
- { "pikafederation.ca", true },
- { "pikimusic.moe", true },
- { "pikio.pl", true },
- { "pilani.ch", false },
- { "pilarguineagil.com", true },
- { "pilatescenteraz.com", true },
- { "pildat.org", true },
- { "pileofgarbage.net", true },
- { "pill.id", true },
- { "pillitteriobgyn.com", true },
- { "pillowfort.pub", true },
- { "pilot-colleges.com", true },
- { "pilotgrowth.com", true },
- { "pilsoncontracting.com", true },
- { "pilvi.pw", true },
- { "pilvin.pl", true },
- { "pimanta.com", true },
- { "pimhaarsma.nl", true },
- { "pimhaarsmamedia.nl", true },
- { "pimichi.com", true },
- { "pimpmymac.ru", true },
- { "pimpmypaper.com", true },
- { "pimpmyperf.fr", false },
- { "pimylifeup.com", true },
- { "pin.net.au", true },
- { "pinceaux.org", true },
- { "pinchuk.tk", true },
- { "pincodeit.com", true },
- { "pindanutjes.be", false },
- { "pinellaslaser.com", true },
- { "pinemountainnursery.com.au", true },
- { "pinemountbaptistchurch.org", true },
- { "pinetopazrealestate.com", true },
- { "pingworks.com", true },
- { "pingworks.de", true },
- { "pingworks.eu", true },
- { "pingworks.net", true },
- { "pinhadigital.com", true },
- { "pinheirofrio.pt", true },
- { "pinimg.com", true },
- { "pinkapple.com", true },
- { "pinkbike.com", true },
- { "pinkbikecycle.com", true },
- { "pinkerton.io", true },
- { "pinklecfest.org", true },
- { "pinklittlenotebook.com", true },
- { "pinkmango.travel", true },
- { "pinkoi.com", true },
- { "pinksec.com.au", true },
- { "pinkwalk.co.nz", true },
- { "pinkylam.me", true },
- { "pinnaclelife.co.nz", true },
- { "pinnakl.com", true },
- { "pinot.it", true },
- { "pinoydailytvshow.net", true },
- { "pinoyonlinetv.com", true },
- { "pinoytech.ph", true },
- { "pinpayments.com", true },
- { "pinpointengineer.co.uk", true },
- { "pinpromosisemarang.com", true },
- { "pinskupakki.fi", true },
- { "pinterest.at", true },
- { "pinterest.co.uk", true },
- { "pinterest.com", true },
- { "pinterest.de", true },
- { "pinterest.engineering", true },
- { "pinterest.ie", true },
- { "pinterest.info", true },
- { "pinterest.jp", true },
- { "pinterjann.is", true },
- { "pintosbeeremovals.co.za", true },
- { "pintoselectricfencing.co.za", true },
- { "pintosplumbing.co.za", true },
- { "pioneer-car.eu", true },
- { "pioneer-rus.ru", true },
- { "pionieren.tk", true },
- { "pipenav.gq", true },
- { "pipenny.net", true },
- { "pipeuro.com", true },
- { "piramalglassusa.com", true },
- { "piranhaattack.tk", true },
- { "pirate.trade", true },
- { "piratebayproxy.tf", true },
- { "piraten-basel.ch", true },
- { "piraten-bv-nord.de", true },
- { "pirateparty.org.uk", true },
- { "pirateproxy.bet", true },
- { "pirateproxy.cam", true },
- { "pirateproxy.cat", true },
- { "pirateproxy.cc", true },
- { "pirateproxy.ch", true },
- { "pirateproxy.gdn", true },
- { "pirateproxy.id", true },
- { "pirateproxy.ist", true },
- { "pirateproxy.la", true },
- { "pirateproxy.lat", true },
- { "pirateproxy.one", true },
- { "pirateproxy.pl", true },
- { "pirateproxy.pw", true },
- { "pirateproxy.red", true },
- { "pirateproxy.sh", true },
- { "pirateproxy.tv", true },
- { "pirateproxy.vc", true },
- { "pirateproxy.vet", true },
- { "pirates-comic.com", true },
- { "piratesbrewcoffee.net", true },
- { "piratesforums.co", true },
- { "pircher.co.uk", true },
- { "pircher.tk", true },
- { "pires.ovh", true },
- { "pirman.es", true },
- { "piroleikki.co.jp", true },
- { "piruchita.com", true },
- { "pirxpilot.me", true },
- { "pis.eu.com", true },
- { "pisanpeikot.tk", true },
- { "piscine.roma.it", true },
- { "piseach.be", true },
- { "pisf.in", true },
- { "piskenfuerwehr.de", true },
- { "pissblau.com", true },
- { "pissflaps.co.uk", true },
- { "pistonkandidatu.tk", true },
- { "pisupp.ly", true },
- { "pitaiabank.com", true },
- { "pitaiatrade.com", true },
- { "pitbooks.ga", true },
- { "pitbullsecuritysolutions.ca", true },
- { "pitchup.com", true },
- { "pitchupp.com", true },
- { "pitot-rs.org", true },
- { "pitoufi.fr", true },
- { "pitshift.com", true },
- { "piu.moe", true },
- { "piubip.com.br", true },
- { "piucellulare.it", true },
- { "pivbar.tk", true },
- { "pivniraj.com", true },
- { "pivotaltracker.com", true },
- { "pivotanimation.org", true },
- { "pivotanimation.tk", true },
- { "pivovarcunak.cz", true },
- { "piwko.co", true },
- { "pix5.de", true },
- { "pixael.com", true },
- { "pixe2019.org", true },
- { "pixel-kraft.de", true },
- { "pixel.facebook.com", false },
- { "pixel.google.com", true },
- { "pixelabs.fr", true },
- { "pixelbash.de", true },
- { "pixelcomunicacion.com", true },
- { "pixelcubed.com", true },
- { "pixelecommerce.com", true },
- { "pixelmedianetwork.com", true },
- { "pixelminers.net", true },
- { "pixelsquared.us", true },
- { "pixelumin3d.com", true },
- { "pixelurbia.com", true },
- { "pixelution.at", true },
- { "pixelz.cc", true },
- { "pixeoapp.com", true },
- { "pixiv.cat", true },
- { "pixiv.moe", true },
- { "pixivimg.me", true },
- { "pixlfox.com", true },
- { "pixloc.fr", true },
- { "pixshop.fr", true },
- { "pizza-calzone.com", true },
- { "pizza-show.fr", true },
- { "pizzabesteld.nl", true },
- { "pizzagigant.hu", true },
- { "pizzahut.ru", true },
- { "pizzalongaway.it", true },
- { "pizzeria-mehrhoog.de", true },
- { "pizzeriaamadeus.hr", true },
- { "pizzeriacolore.com", true },
- { "pj11018.com", false },
- { "pj21299.com", true },
- { "pj21399.com", true },
- { "pj21499.com", true },
- { "pj21566.com", true },
- { "pj21599.com", true },
- { "pj21677.com", true },
- { "pj21678.com", true },
- { "pj21866.com", true },
- { "pj21877.com", true },
- { "pj21886.com", true },
- { "pj21887.com", true },
- { "pj21899.com", true },
- { "pj21990.com", true },
- { "pj21991.com", true },
- { "pj21992.com", true },
- { "pj21993.com", true },
- { "pj21994.com", true },
- { "pj21995.com", true },
- { "pj21996.com", true },
- { "pj21997.com", true },
- { "pj21998.com", true },
- { "pj21aa.com", true },
- { "pj21bb.com", true },
- { "pj21c.com", true },
- { "pj21f.com", true },
- { "pj21g.com", true },
- { "pj21gg.com", true },
- { "pj21i.com", true },
- { "pj21j.com", true },
- { "pj21kk.com", true },
- { "pj21n.com", true },
- { "pj21o.com", true },
- { "pj21p.com", true },
- { "pj21q.com", true },
- { "pj21r.com", true },
- { "pj21s.com", true },
- { "pj21t.com", true },
- { "pj21tt.com", true },
- { "pj21v.com", true },
- { "pj21w.com", true },
- { "pj21x.com", true },
- { "pj21y.com", true },
- { "pj21z.com", true },
- { "pj4488.cc", false },
- { "pj5588.cc", true },
- { "pjax.xyz", true },
- { "pjentertainments.co.uk", true },
- { "pjgj16.com", true },
- { "pjleisure.co.uk", true },
- { "pjo.no", true },
- { "pjp.com.mt", true },
- { "pjshop.cf", true },
- { "pjuu.com", false },
- { "pk.search.yahoo.com", false },
- { "pk8k.com", true },
- { "pkbjateng.or.id", true },
- { "pkdhungthinh.com", true },
- { "pkeus.de", true },
- { "pkgt.de", false },
- { "pkirwan.com", true },
- { "pkisolutions.com", true },
- { "pkphotobooths.co.uk", true },
- { "pkvitality.com", true },
- { "pl-cours.ch", false },
- { "pl-trans.tk", true },
- { "pl.search.yahoo.com", false },
- { "placasonline.com.br", true },
- { "placebet.pro", true },
- { "placedaffiliate.com", true },
- { "placedapps.com", true },
- { "placedsupport.com", true },
- { "placeitsf.com", true },
- { "placeralplato.com", true },
- { "placker.com", true },
- { "plae.com.au", true },
- { "plage-les-pirates.fr", true },
- { "plagiarismcheck.org", true },
- { "plainbulktshirts.co.za", true },
- { "plainjs.com", true },
- { "plaintech.net.au", true },
- { "plaintextpledge.com", true },
- { "plaintextpledge.email", true },
- { "plaintextpledge.eu", true },
- { "plaintextpledge.net", true },
- { "plaintextpledge.org", true },
- { "plaisirdumouvement.com", true },
- { "plaisirs-coquins.com", true },
- { "plan-immobilier.fr", true },
- { "plan-it-events.de", true },
- { "planboardapp.com", true },
- { "planbox.info", true },
- { "plandegralba.net", true },
- { "planecon.nz", true },
- { "planespotterblog.de", true },
- { "planet-work.com", true },
- { "planet.live", true },
- { "planeta-remontika.ga", true },
- { "planetanim.fr", true },
- { "planetarian.moe", true },
- { "planetarydesign.com", true },
- { "planetasuboficial.com.br", true },
- { "planetau2.com", true },
- { "planetbreath.ch", false },
- { "planetchiropracticga.com", true },
- { "planete-lira.fr", true },
- { "planeteroliste.com", true },
- { "planeteroliste.fr", true },
- { "planetknauer.net", true },
- { "planetloisirs.com", true },
- { "planetofthegames.tv", true },
- { "planetofwoman.com", true },
- { "planetofwomen.net", true },
- { "planetpowershell.com", true },
- { "planetromeo.com", true },
- { "planetromeofoundation.org", true },
- { "planetsoftware.com.au", true },
- { "planhub.com", true },
- { "planify.io", false },
- { "planisys.net", true },
- { "planitz.com", true },
- { "planitz.net", true },
- { "planitz.org", true },
- { "planktonforhealth.co.uk", true },
- { "planlos.net", true },
- { "planmemberpartners.com", true },
- { "plannedlink.com", true },
- { "planosylicencias.de", true },
- { "planovivofibra.com.br", true },
- { "planrow.com", true },
- { "plans3ds.com", true },
- { "plant-gift.jp", true },
- { "plantarportugal.org", true },
- { "plantarum.com.br", true },
- { "plantastique.ch", false },
- { "planteforum.no", true },
- { "plantekno.com", true },
- { "plantes.ch", true },
- { "plantron.gr", true },
- { "plantroon.com", true },
- { "plantrustler.com", true },
- { "planujemywesele.pl", true },
- { "planview.com", true },
- { "plaque-funeraire.fr", true },
- { "plaque-immatriculation-auto.com", true },
- { "plassmann.ws", true },
- { "plastic-id.com", true },
- { "plasticbags.co.uk", true },
- { "plasticosbiobasados.com", true },
- { "plasticstare.com", true },
- { "plasticsurgerynola.com", true },
- { "plasticsurgeryservices.com", true },
- { "plastiflex.it", true },
- { "plastischechirurgie-linz.at", true },
- { "plastovelehatko.cz", true },
- { "plateformecandidature.com", true },
- { "platform161.com", true },
- { "platform39.com", true },
- { "platformadmin.com", true },
- { "platformlms.org", true },
- { "platinapump.com", true },
- { "platinumexpress.com.ar", true },
- { "platomania.nl", true },
- { "platten-nach-mass.de", true },
- { "platter.ga", true },
- { "play-casino-japan.com", true },
- { "play-charades.com", true },
- { "play.cash", true },
- { "play.google.com", true },
- { "playandwin.co.uk", true },
- { "playanka.com", true },
- { "playawaycastles.co.uk", true },
- { "playcollect.net", true },
- { "playdaysparties.co.uk", true },
- { "playelephant.com", true },
- { "playerdb.co", true },
- { "playinfinity.com", true },
- { "playinfinityvr.com", true },
- { "playlisten.radio.br", true },
- { "playmytime.com", true },
- { "playnation.io", true },
- { "playnow.com", true },
- { "playocean.net", true },
- { "playpirates.com", true },
- { "playreal.city", true },
- { "playsawdust.com", true },
- { "playsharp.com", true },
- { "playsnake.org", true },
- { "playsprout.industries", true },
- { "playstationtrophies.org", true },
- { "playtictactoe.org", true },
- { "playtimebouncycastles.co.uk", true },
- { "playtopia.com", true },
- { "playtopia.fr", true },
- { "playtopia.nl", true },
- { "playtopia.no", true },
- { "playtzolk.in", true },
- { "playviolinmusic.com", true },
- { "plaza.ph", true },
- { "plazasummerlin.com", true },
- { "plcgurus.net", true },
- { "pldx.org", true },
- { "pleasantonmobilenotary.com", true },
- { "please-uwu.me", true },
- { "pleasure-science.com", true },
- { "plegro.com", true },
- { "pleier-it.de", false },
- { "pleier.it", false },
- { "pleine-conscience.ch", false },
- { "plekker.be", true },
- { "plenigo.com", true },
- { "plenkanaotrez.ml", true },
- { "plesse.pl", true },
- { "plevenlab.org", true },
- { "plexa.de", true },
- { "plexhome13.ddns.net", true },
- { "plexmark.tk", true },
- { "pliosoft.com", true },
- { "plissee-experte.de", true },
- { "plitu.de", true },
- { "plixer.com", true },
- { "plny.eu", true },
- { "plob.org", true },
- { "ploi.io", true },
- { "plokko.com", true },
- { "plongee-phuket.fr", true },
- { "plot.ly", true },
- { "plotbubble.com", true },
- { "ploxel.com", true },
- { "plr4wp.com", true },
- { "plsboop.me", true },
- { "pluga.co", true },
- { "plugcubed.net", false },
- { "plugin-planet.com", true },
- { "pluginfactory.io", true },
- { "plugins-telechargement.com", true },
- { "pluginsetemaswp.com", true },
- { "pluginsloaded.com", true },
- { "pluimveeplanner.nl", true },
- { "plumber-in-sandton.co.za", true },
- { "plumbercincoranch.com", true },
- { "plumberlewisvilletexas.com", true },
- { "plumbermountedgecombe.co.za", true },
- { "plumberumhlangarocks.co.za", true },
- { "plumbing-arlington.com", true },
- { "plumbingandheatingspecialistnw.com", true },
- { "plumbingbenoni.co.za", true },
- { "plumbingcentral.com.au", true },
- { "plumbingglenvista.co.za", true },
- { "plumbingkingsllc.com", true },
- { "plumbingofmesquite.com", true },
- { "plumlocosoft.com", true },
- { "plumnet.ch", true },
- { "plur.com.au", true },
- { "plural.cafe", true },
- { "plus-5.com", true },
- { "plus-aliance.ru", true },
- { "plus.google.com", false },
- { "plus.sandbox.google.com", true },
- { "pluscbdoil.com", true },
- { "pluslink.co.jp", true },
- { "plusmobile.fr", true },
- { "plusstreamfeed.appspot.com", true },
- { "pluta.net", true },
- { "pluth.org", true },
- { "plutiedev.com", true },
- { "pluto.life", true },
- { "plutokorea.com", true },
- { "plutopia.ch", true },
- { "plymouthbouncycastles.co.uk", true },
- { "plz.report", true },
- { "plzdontpwn.me", true },
- { "plzh4x.me", true },
- { "plzz.de", true },
- { "pm-onboarding-external-dev.azurewebsites.net", true },
- { "pm-partners-management-dev.azurewebsites.net", true },
- { "pm.me", true },
- { "pm13.cz", true },
- { "pm13.org", true },
- { "pm25.im", true },
- { "pmaene.be", false },
- { "pmalaty.com", true },
- { "pmarbeid.nl", true },
- { "pmartin.tech", true },
- { "pmbc.org", true },
- { "pmbsteelbuildings.com", true },
- { "pmcc.net", true },
- { "pmf.gov", true },
- { "pmg-offshore-company.com", true },
- { "pmg-purchase.com", true },
- { "pmg-purchase.net", true },
- { "pmgnet.de", true },
- { "pmi.gov", true },
- { "pmnaish.co.uk", true },
- { "pmoreau.org", true },
- { "pmp-art.com", true },
- { "pmp6.fr", true },
- { "pn.id.lv", true },
- { "pneu01.fr", true },
- { "pneu74.fr", true },
- { "pneuhaus-lemp.ch", true },
- { "pnimmobilier.ch", false },
- { "pnnl.gov", true },
- { "pnona.cz", true },
- { "pnsc.is", true },
- { "pnut.io", false },
- { "po.net", true },
- { "po0k.ie", true },
- { "pocatellonissanparts.com", true },
- { "pochaneko.com", true },
- { "pocitacezababku.cz", true },
- { "pocketcash.com.au", true },
- { "pocketfruity.com", true },
- { "pocketinsure.com", true },
- { "pocketpasta.com", true },
- { "pocze.ch", true },
- { "podcrto.si", true },
- { "poddr.co", true },
- { "podemos.info", true },
- { "podia.com.gr", false },
- { "podipod.com", true },
- { "podlibre.org", true },
- { "podobovo.if.ua", true },
- { "podroof.com", true },
- { "podroof.com.au", true },
- { "podshrink.de", true },
- { "podsvojostreho.net", true },
- { "poe.digital", true },
- { "poed.net.au", true },
- { "poemlife.com", true },
- { "poemwall.ml", true },
- { "poetenblog.tk", true },
- { "poetry.ge", true },
- { "poezja.com.pl", true },
- { "poffenhouse.ddns.net", true },
- { "pogera.com", true },
- { "pogetback.pl", true },
- { "pogoswine.com", true },
- { "pogotowiekomputeroweolsztyn.pl", true },
- { "pogrebisky.net", true },
- { "pohlednice-tap.cz", true },
- { "pohlmann.io", true },
- { "poinsot.info", true },
- { "pointaction.com", true },
- { "pointforwardinc.net", true },
- { "pointiswunderland.de", true },
- { "pointmaquininha.com", true },
- { "pointsixtyfive.com", true },
- { "pointum.com", true },
- { "pointzip.ml", true },
- { "poiru.net", true },
- { "poitiers-ttacc-86.eu.org", true },
- { "pojer.me", true },
- { "pokazy-iluzji.pl", true },
- { "poke.blue", true },
- { "pokefarm.com", true },
- { "pokeforest.io", true },
- { "pokeinthe.io", true },
- { "pokeli.de", true },
- { "pokemonargentina.tk", true },
- { "pokemondb.net", true },
- { "pokemonguide.tk", true },
- { "pokemonlab.com", true },
- { "pokemonsimulator.com", true },
- { "pokemontabletopadventures.com", true },
- { "pokemori.jp", true },
- { "poker4all.tk", true },
- { "pokeram.ml", true },
- { "pokl.cz", true },
- { "pokoleniebar.ru", true },
- { "pokrowcecardo.pl", true },
- { "polaire.org", true },
- { "polan.tk", true },
- { "polanda.com", true },
- { "polar-baer.com", true },
- { "polarnova.site", true },
- { "pole-emotion.ch", false },
- { "poleacademie.com", false },
- { "poles4pilots.com", true },
- { "polestar.com.tw", true },
- { "police-schools.com", true },
- { "policereferencecheck.com", true },
- { "policesromandesrecrutement.ch", true },
- { "policyreporter.com", false },
- { "polimer39.ml", true },
- { "polinet.de", true },
- { "polis.or.at", true },
- { "polis.to", false },
- { "polis812.ru", true },
- { "polish-dictionary.com", true },
- { "polish-flag.com", true },
- { "polish-translations.com", true },
- { "polish-translator.com", true },
- { "polish-translator.net", true },
- { "polish-translators.net", true },
- { "polishforums.com", false },
- { "polishmarriage.org", true },
- { "polishtranslation.com", true },
- { "polishwomen.com", true },
- { "polisipati.tk", true },
- { "polit.im", true },
- { "politic.org.ua", true },
- { "political-science-schools.com", true },
- { "politicsandnews.cf", true },
- { "politicsnews.ga", true },
- { "politiezoneriho.be", true },
- { "politik-bei-uns.de", true },
- { "politsei.ee", true },
- { "politvesti.tk", true },
- { "polki.com", true },
- { "pollendine.co.uk", true },
- { "polletmera.com", false },
- { "pollev.com", true },
- { "polleverywhere.com", true },
- { "polliconstruction.com", true },
- { "pollingplace.uk", true },
- { "polly.spdns.org", true },
- { "polog.tk", true },
- { "polomack.eu", true },
- { "poloniainfo.com", true },
- { "polska-robota.com.ua", true },
- { "polskiemalzenstwo.org", true },
- { "polskienewsy.tk", true },
- { "polybius.io", true },
- { "polychainlabs.com", true },
- { "polycoise.com", true },
- { "polycraftual.co.uk", true },
- { "polyfluoroltd.com", false },
- { "polygamer.net", true },
- { "polygraphi.ae", true },
- { "polymake.org", true },
- { "polymathematician.com", true },
- { "polynomapp.com", true },
- { "polypane.rocks", true },
- { "polypet.com.sg", true },
- { "polytarian.com", true },
- { "polytekniskforening.dk", true },
- { "pomar.club", true },
- { "pomegranate.productions", true },
- { "pomelo-paradigm.com", true },
- { "pommedepain.fr", true },
- { "pomockypredeti.sk", true },
- { "pomocniczy.eu.org", true },
- { "pomorskibereg.ml", true },
- { "pompiers-martigny.ch", false },
- { "pompoco.info", true },
- { "pomsinoz.com", true },
- { "pomtom.co.nz", true },
- { "poncho-bedrucken.de", true },
- { "ponere.dz", true },
- { "poneypourtous.com", false },
- { "ponga.se", true },
- { "ponio.org", true },
- { "ponnau.com", true },
- { "ponxel.com", true },
- { "pony-cl.co.jp", true },
- { "pony.tf", true },
- { "ponychan.net", true },
- { "ponydesignclub.nl", true },
- { "ponyfoo.com", true },
- { "poodleassassin.com", true },
- { "poodlefan.net", true },
- { "pookl.com", true },
- { "poolsafely.gov", true },
- { "poolsafety.gov", true },
- { "pooltools.net", true },
- { "poolvilla-margarita.net", true },
- { "poon.io", true },
- { "poopchart.net", true },
- { "poopjournal.rocks", true },
- { "poopr.ru", true },
- { "poopthereitisla.com", true },
- { "poorclarepa.org", true },
- { "pop-corn.ro", true },
- { "pop.dk", true },
- { "pop3.jp", false },
- { "popcat.ru", true },
- { "popcornpalacefundraising.com", true },
- { "popcultureshack.com", true },
- { "popeyes.com", false },
- { "popinga.it", true },
- { "popitsnack.com", true },
- { "popjudge.ml", true },
- { "popmagz.com", true },
- { "popova.tk", true },
- { "popoway.cloud", true },
- { "popoway.me", true },
- { "popoway9.ml", true },
- { "poppetsphere.de", true },
- { "poppincurls.com", true },
- { "poptimize.net", true },
- { "populardogs.gq", true },
- { "population-ethics.com", true },
- { "popupbazaar.tk", true },
- { "popvitrin.com", true },
- { "poquvi.net", true },
- { "porchdaydreamer.com", true },
- { "porcore.com", true },
- { "porelcorazon.com", true },
- { "porelsam.ml", true },
- { "porevo.tk", true },
- { "porg.es", true },
- { "porinnuotiopojat.tk", true },
- { "pork.org.uk", true },
- { "porkel.de", true },
- { "porkyx.com", true },
- { "porn7.net", true },
- { "porn77.info", true },
- { "pornagent.de", true },
- { "pornalpha.com", true },
- { "pornbay.eu", true },
- { "pornbay.org", true },
- { "porncompanions.com", true },
- { "porndragon.net", true },
- { "pornfacefinder.com", false },
- { "pornflare.net", true },
- { "pornforwomentube.com", true },
- { "porngay.co", true },
- { "pornhubhd.biz", true },
- { "pornimg.net", true },
- { "pornleg.com", true },
- { "pornless.biz", true },
- { "pornloupe.com", true },
- { "pornmax.net", true },
- { "pornmega.net", true },
- { "porno-gif.ru", true },
- { "porno-stars-video.ru", true },
- { "pornofilmovi.us", true },
- { "pornohub.su", true },
- { "pornomens.be", true },
- { "pornopark.nl", true },
- { "pornovk.xxx", true },
- { "pornport.org", true },
- { "pornshop.biz", true },
- { "pornsocket.com", true },
- { "pornstop.net", true },
- { "pornsuper.net", true },
- { "pornteddy.com", true },
- { "pornultra.net", true },
- { "porny.xyz", true },
- { "porpcr.com", true },
- { "pors-sw.cz", true },
- { "porsi.pt", true },
- { "port443.hamburg", false },
- { "port443.se", true },
- { "port5060.net", true },
- { "port67.org", true },
- { "port80.hamburg", false },
- { "portable-games.tk", true },
- { "portafoliodenegocios.com.mx", true },
- { "portailevangelique.ca", true },
- { "portal-books.ga", true },
- { "portal-ru.tk", true },
- { "portal.tirol.gv.at", true },
- { "portalaltadefinicao.com", true },
- { "portaleldense.tk", true },
- { "portalexpressservices.com", true },
- { "portaltudoaver.com", true },
- { "portalz.xyz", true },
- { "portamiinpista.it", false },
- { "portatiles-baratos.net", true },
- { "porte.roma.it", true },
- { "portercup.com", true },
- { "porterranchelectrical.com", true },
- { "portesmagistral.com", true },
- { "portiaweb.org.uk", true },
- { "portierato.it", true },
- { "portofala.pt", true },
- { "portofrotterdam.com", false },
- { "portosonline.pl", true },
- { "portsdebalears.gob.es", true },
- { "portsmouthbouncycastles.co.uk", true },
- { "portugal-a-programar.pt", true },
- { "portugalsko.net", true },
- { "porybox.com", true },
- { "posaunenchor-senden.de", true },
- { "posbank.co.uk", true },
- { "posbich.net", true },
- { "poseidonwaterproofing.com", true },
- { "poshcastles.co.uk", true },
- { "poshlashes.se", true },
- { "poshsecurity.com", true },
- { "positionus.io", true },
- { "positive.com.cy", true },
- { "positiveaffirmationscenter.com", true },
- { "positiverbeitrag.net", true },
- { "positiverbeitrag.org", true },
- { "positivos.tk", true },
- { "poslusny.com", true },
- { "posobota.cz", true },
- { "post-darwinian.com", true },
- { "post-darwinism.com", true },
- { "post.icu", true },
- { "post.io", true },
- { "post.monster", true },
- { "post4me.at", true },
- { "postal.dk", true },
- { "postal3.es", true },
- { "postandfly.com", true },
- { "postari.ro", true },
- { "postawnasiebie.pl", true },
- { "postblue.info", true },
- { "postbox.life", true },
- { "postcode.nl", true },
- { "postdarwinian.com", true },
- { "postdarwinism.com", true },
- { "postdeck.de", true },
- { "posteo.de", true },
- { "posterspy.com", true },
- { "postfalls-naturopathic.com", true },
- { "postfinance.ch", true },
- { "postimages.org", true },
- { "postimg.cc", true },
- { "postmatescode.com", true },
- { "postmistress.email", true },
- { "postmusicologia.tk", true },
- { "postn.eu", true },
- { "postoffices.co.in", true },
- { "postoyanstvo.cf", true },
- { "postpot.co.kr", true },
- { "postsubmeta.net", true },
- { "posttigo.com", true },
- { "posyperfume.com", true },
- { "potatiz.com", true },
- { "potato.im", true },
- { "potatofrom.space", true },
- { "potatopro.com", true },
- { "potatotee.com", true },
- { "potatron.tech", true },
- { "potature.it", true },
- { "potature.org", true },
- { "potature.rimini.it", true },
- { "potature.roma.it", true },
- { "potbar.com", true },
- { "potentialproject.com", false },
- { "potgrowersunion.com", true },
- { "pothe.com", true },
- { "pothe.de", true },
- { "potionlabs.de", true },
- { "potlytics.com", true },
- { "potolok-brest.tk", true },
- { "potolok.am", true },
- { "potomac.cf", true },
- { "potomacurology.com", true },
- { "potsdam.directory", true },
- { "potterperfect.tk", true },
- { "pottersheartministry.org", true },
- { "potterybroker.ga", true },
- { "pottshome.co.uk", true },
- { "potworowski.de", true },
- { "potz.tk", true },
- { "potzwonen.nl", true },
- { "poudlard.fr", true },
- { "poundgatepark.co.uk", true },
- { "poundwholesale.co.uk", true },
- { "pourlesenfants.info", true },
- { "pouwels-oss.nl", true },
- { "povareschka.ru", true },
- { "povesham.tk", true },
- { "povmacrostabiliteit.nl", true },
- { "pow-s.com", true },
- { "pow.jp", true },
- { "powch.com", true },
- { "powelljones.co.uk", true },
- { "power-flowengineer.com", true },
- { "powerball.shop", true },
- { "powerblanket.com", true },
- { "powercloud.technology", true },
- { "poweredbyiris.nl", true },
- { "powerfortunes.com", true },
- { "powerinboxperformance.com", true },
- { "powerlifting.tk", true },
- { "powermeter.at", true },
- { "powerpointschool.com", true },
- { "powersaleskc.com", true },
- { "powersergdatasystems.com", true },
- { "powersergdynamic.com", true },
- { "powersergemployeesonly.com", true },
- { "powersergholdings.com", true },
- { "powerwellness-korecki.de", true },
- { "pozarevac.tk", true },
- { "pozd.tk", true },
- { "pozemedicale.org", true },
- { "pozharnyi.tk", true },
- { "pozitiffchik.ml", true },
- { "pozitive.pl", true },
- { "pozlife.net", true },
- { "poznajrynek.pl", true },
- { "pp-server.com", true },
- { "pp3345.net", true },
- { "ppcrestaurants.com", true },
- { "ppipe.net", true },
- { "pplsoft.nl", true },
- { "pplsvc.com", true },
- { "ppmathis.ch", true },
- { "ppmathis.com", true },
- { "ppmoon.com", true },
- { "ppro.com", true },
- { "ppy.la", true },
- { "ppy.sh", true },
- { "pr-news.spb.ru", true },
- { "pr.search.yahoo.com", false },
- { "pr1sm.com", true },
- { "pr2studio.com", true },
- { "pr3.space", true },
- { "prac.to", true },
- { "pracevjihlave.cz", true },
- { "practicalhomes.com.au", true },
- { "practicallabs.com", true },
- { "practicalprogrammer.tech", true },
- { "practiceflow.nl", true },
- { "practicepanther.com", true },
- { "practisforms.com", true },
- { "practo.com", true },
- { "pradeek.tk", true },
- { "prado.it", true },
- { "praeparation-keppner.de", true },
- { "praerien-racing.com", true },
- { "praetzlich-hamburg.de", true },
- { "pragata.id", true },
- { "pragma-solution.com", true },
- { "prague-swim.cz", true },
- { "praguepsychology.com", true },
- { "praguepsychology.cz", true },
- { "pragueswim.cz", true },
- { "praha-9.eu", true },
- { "praiss.net", true },
- { "prajwal-koirala.com", true },
- { "prajwalkoirala.com", true },
- { "prakhar.uk", true },
- { "prakharprasad.com", true },
- { "praktijkdevecht.nl", true },
- { "praktijkpassepartout.nl", true },
- { "praktiker.hu", true },
- { "praladofuturo.blog", true },
- { "praleria.com", true },
- { "pranaprinciple.com", true },
- { "pranita-schals.de", true },
- { "pranita.cz", true },
- { "pranita.sk", true },
- { "pranksearch.ml", true },
- { "prateep.io", true },
- { "pratemarkets.com", true },
- { "pratorotoli.it", true },
- { "pravaha-elixirs.com", true },
- { "praveenravichandran.xyz", true },
- { "pravo911.tk", true },
- { "pravoslavie.tk", true },
- { "pravoslavnayarus.tk", true },
- { "pravosudie.tk", true },
- { "prawnikdlaanglii.co.uk", true },
- { "praxino.de", false },
- { "praxis-familienglueck.de", true },
- { "praxistipp24.com", true },
- { "prayerrequest.com", true },
- { "prc.gov", true },
- { "precedencemedia.com", true },
- { "precept.uk.com", true },
- { "preciouslife.fr", true },
- { "preciscx.com", true },
- { "preciseassemblies.com", true },
- { "precisedigitalmarketing.com.au", true },
- { "precision-tops.com", true },
- { "precision.st", true },
- { "precisiondigital-llc.com", true },
- { "precisionhealthpilot.org", true },
- { "precisionhockey.net", true },
- { "precisionicerinks.com", true },
- { "precisionmachineservice.com", true },
- { "precode.eu", true },
- { "predkosci.pl", true },
- { "predoiu.ro", true },
- { "predskazanie.tk", true },
- { "preference.ga", true },
- { "preferredreverse.com", true },
- { "prefix.eu", true },
- { "prefontaine.name", true },
- { "pregunteleakaren.gov", true },
- { "preigu.de", true },
- { "preisser-it.de", true },
- { "preisser.it", true },
- { "preissler.co.uk", true },
- { "preload.link", true },
- { "preloaded-hsts.badssl.com", true },
- { "preludes.org", true },
- { "prelved.com", true },
- { "prelved.es", true },
- { "prelved.fi", true },
- { "prelved.fr", true },
- { "prelved.it", true },
- { "prelved.nl", true },
- { "prelved.pl", true },
- { "prelved.se", true },
- { "preme.name", true },
- { "premieravenue.net", true },
- { "premierbouncycastles.co.uk", true },
- { "premierdisco.co.uk", true },
- { "premiereco.com.sg", true },
- { "premieresloges.ca", false },
- { "premierevents.ie", true },
- { "premierheart.com", true },
- { "premierjewelersjax.com", true },
- { "premiermaldives.com", true },
- { "premiermortgageservices.com", true },
- { "premierrange.co.uk", true },
- { "premiership-predictors.co.uk", true },
- { "premioambiente.it", true },
- { "premiovapozicovna.sk", true },
- { "premised.land", true },
- { "premium-computer.fr", true },
- { "premiumcredit.am", true },
- { "premiumdeal.org", true },
- { "premiumhosting.com.hr", true },
- { "premiumplusiptv.com", true },
- { "premiumweb.co.id", true },
- { "premiumwebdesign.it", true },
- { "premkumar.net", true },
- { "premtech.nl", true },
- { "prenatalgeboortekaartjes.nl", true },
- { "prepadefi.fr", true },
- { "prepagosyescortforyou.com", true },
- { "prepaid-cards.xyz", true },
- { "prepaidgirl.com", true },
- { "prepaidkredietkaart.be", true },
- { "prepare-job-hunting.com", true },
- { "preparetheword.com", true },
- { "prepavesale.fr", true },
- { "prepedia.org", true },
- { "prepfba.com", true },
- { "presbvm.org", true },
- { "presbyterian-colleges.com", true },
- { "prescotonline.co.uk", true },
- { "presdesdunes.com", true },
- { "present-m.com", true },
- { "presentationmedia.com", true },
- { "preserveourhillcountry.org", true },
- { "president.bg", true },
- { "presidentdirectory.ga", true },
- { "presidentialserviceawards.org", true },
- { "presidio.gov", true },
- { "prespanok.sk", true },
- { "pressakey.com", true },
- { "presscenter.jp", true },
- { "presscuozzo.com", true },
- { "presseagrume.net", true },
- { "pressento.com", true },
- { "pressertech.com", true },
- { "presses.ch", false },
- { "pressography.org", true },
- { "pressplayandrelax.com", true },
- { "pressrush.com", true },
- { "pressup.it", true },
- { "pressureradio.com", true },
- { "prestige-car-location.ch", false },
- { "prestige-portal.com", true },
- { "prestigebouncycastles.co.uk", true },
- { "prestigerepairs.com.au", true },
- { "prestigesoundandlight.co.uk", true },
- { "prestonandsons.com.au", true },
- { "prestonapp.com", true },
- { "prestonbrant.com", true },
- { "prestonetwork.eu", true },
- { "pretachique.com.br", true },
- { "pretix.eu", true },
- { "pretor.com.pl", true },
- { "pretor.eu", true },
- { "pretor.pl", true },
- { "pretorcup.pl", true },
- { "pretty.hu", true },
- { "prettycities.ga", true },
- { "prettygirlcheats.com", true },
- { "pretzelx.com", true },
- { "prevenir.ch", false },
- { "preventfalls.com", true },
- { "preview-it-now.com", true },
- { "previousmagazine.com", true },
- { "prexxorvita.com", true },
- { "prgrmmr.nl", true },
- { "pricegg.com", true },
- { "pricena.vn", true },
- { "priceremoval.net", true },
- { "pricesim.com", true },
- { "pricesniffer.co", true },
- { "prideindomination.com", true },
- { "pridnestrovye.gq", true },
- { "prielwurmjaeger.de", true },
- { "primaflorafloristaccrington.co.uk", true },
- { "primalbase.com", true },
- { "primalinea.pro", true },
- { "primalshop.dk", true },
- { "primananda.com", true },
- { "primates.com", true },
- { "primecursos.com.br", true },
- { "primeequityproperties.com", true },
- { "primegiftindia.com", true },
- { "primelogistics.cf", true },
- { "primetrial.co.uk", true },
- { "primetrialfree.co.uk", true },
- { "primglaz.ru", true },
- { "primoloyalty.com", true },
- { "primorus.lt", true },
- { "primos-tech.com", true },
- { "princefamilylaw.co.uk", true },
- { "princessefoulard.com", true },
- { "princetonnassaupediatrics.com", true },
- { "princezna.club", true },
- { "principalstest.com", true },
- { "principalstest.review", true },
- { "principaltoolbox.com", true },
- { "principia-journal.de", true },
- { "principia-magazin.de", true },
- { "principia-online.de", true },
- { "princovi.cz", true },
- { "prinice.org", true },
- { "printeknologies.com", true },
- { "printerleasing.be", true },
- { "printfn.com", false },
- { "printler.com", true },
- { "printmet.com", true },
- { "printus.de", true },
- { "prior-it.be", true },
- { "priorite-education.com", true },
- { "priorityelectric-agourahills.com", true },
- { "priorityelectric-calabasas.com", true },
- { "priorityelectric-camarillo.com", true },
- { "priorityelectric-dosvientos.com", true },
- { "priorityelectric-hiddenhills.com", true },
- { "priorityelectric-lakesherwood.com", true },
- { "priorityelectric-malibu.com", true },
- { "priorityelectric-moorpark.com", true },
- { "priorityelectric-newburypark.com", true },
- { "priorityelectric-oakpark.com", true },
- { "priorityelectric-simivalley.com", true },
- { "priorityelectric-thousandoaks.com", true },
- { "priorityelectric-westlakevillage.com", true },
- { "priorityelectric.biz", true },
- { "priorityelectric.info", true },
- { "priorityelectric.mobi", true },
- { "priorityelectric.net", true },
- { "priorityessays.com", true },
- { "prioritylawyers.com.au", true },
- { "prioritynissannewportnewsparts.com", true },
- { "prismacloud.com", true },
- { "prismacloud.xyz", true },
- { "prisminfosys.com", true },
- { "pristal.eu", true },
- { "pristinegreenlandscaping.com", true },
- { "pritchi.tk", true },
- { "priv.gc.ca", true },
- { "priv.im", true },
- { "privacy-week-vienna.at", true },
- { "privacy-week.at", true },
- { "privacy.com", true },
- { "privacybadger.org", true },
- { "privacybydesign.foundation", true },
- { "privacychick.com", true },
- { "privacychick.io", true },
- { "privacyforjournalists.org.au", true },
- { "privacyget.tk", true },
- { "privacyinternational.org", true },
- { "privacynow.eu", true },
- { "privacyscore.org", true },
- { "privacytools.io", true },
- { "privacyweek.at", true },
- { "privacyweek.de", true },
- { "privacyweek.eu", true },
- { "privacyweek.wien", true },
- { "privacyweekvienna.at", true },
- { "privaday.de", false },
- { "privasphere.com", true },
- { "privatebanks.uk", true },
- { "privatebin.info", true },
- { "privatecapsecurity.org", true },
- { "privateger.me", true },
- { "privateideas.de", true },
- { "privateimarketing.com", true },
- { "privatenebula.eu", true },
- { "privatepokertour.com", true },
- { "privatepropertymallorca.com", true },
- { "privateservice.cz", true },
- { "privatestatic.com", false },
- { "privatevoid.net", true },
- { "privatfrei.de", true },
- { "privatislauga.lt", true },
- { "privatpatient-krankenhaus.de", true },
- { "privc.io", true },
- { "privea.fr", true },
- { "privelust.nl", true },
- { "priverify.com", true },
- { "privorot-taro.com", true },
- { "privy-staging.com", true },
- { "privy.com", true },
- { "prizehometickets.com.au", true },
- { "prizelink.com.au", true },
- { "prjktruby.com", false },
- { "prknje.co", true },
- { "prlved.co.uk", true },
- { "prnav.com", true },
- { "pro-ben.sk", true },
- { "pro-bike.ro", true },
- { "pro-clean.org", true },
- { "pro-co.at", true },
- { "pro-kemerovo.ml", true },
- { "pro-lq.at", true },
- { "pro-lq.ch", true },
- { "pro-lq.com", true },
- { "pro-lq.de", true },
- { "pro-lq.hu", true },
- { "pro-lq.it", true },
- { "pro-lq.net", true },
- { "pro-lq.ro", true },
- { "pro-mile.pl", true },
- { "pro-netz.de", false },
- { "pro-taucher.com", true },
- { "pro-taucher.de", true },
- { "pro-wiert.pl", true },
- { "proactivenews.ml", true },
- { "proactivestructuresolutions.com", true },
- { "proadvanced.com", true },
- { "proastec.com.br", true },
- { "probano.com", true },
- { "probazen.com", true },
- { "probely.com", true },
- { "probiv.biz", true },
- { "probiv.cc", true },
- { "procar-rheinland.de", true },
- { "procarservices.com", true },
- { "procarswoking.com", true },
- { "procensus.com", true },
- { "procert.ch", false },
- { "processesinmotion.com", true },
- { "procharter.com", true },
- { "procinorte.net", true },
- { "proclassifieds.in", true },
- { "proclib.org", true },
- { "procrastinatingengineer.uk", true },
- { "procrastinationland.com", true },
- { "procreditbank-kos.com", true },
- { "proctorauth.com", true },
- { "proctorio.com", true },
- { "proctorio.net", true },
- { "prodampro.ru", true },
- { "prodatalabs.com", true },
- { "prodct.info", true },
- { "prodentalsantacruz.es", true },
- { "prodesigntools.com", true },
- { "prodietix.cz", true },
- { "prodigia.com", false },
- { "prodinger.com", true },
- { "prodsim.ninja", true },
- { "producentbalustrad.pl", true },
- { "producepromotions.com", true },
- { "producertools.io", true },
- { "productbarcodes.com", true },
- { "productboard.com", true },
- { "productdesignsoftware.com.au", true },
- { "production.vn", true },
- { "productionscime.com", true },
- { "productlondon.com", true },
- { "productosfitness.com", true },
- { "productpeo.pl", true },
- { "products4more.at", true },
- { "products88.com", true },
- { "productsblockbuster.com", true },
- { "productsbrandleader.com", true },
- { "productscastle.com", true },
- { "productsmansion.com", true },
- { "produkt.cf", true },
- { "produkttest-online.com", true },
- { "produra.nl", true },
- { "prodwa.re", true },
- { "prodware.fr", true },
- { "prodware.nl", true },
- { "proeflokaalbakker.nl", true },
- { "proefteksten.nl", false },
- { "proeftuinveenweiden.nl", true },
- { "proeski.com", true },
- { "proevlifecycle.eu", true },
- { "proextra.com.br", true },
- { "prof-toplivo.ru", true },
- { "prof.ch", false },
- { "profection.biz", true },
- { "profession.email", true },
- { "professionalbeautyshop.it", true },
- { "professionallawyer.tk", true },
- { "professors.ee", true },
- { "profidea.cz", true },
- { "profile.tf", true },
- { "profiles.google.com", true },
- { "profiservis.info", true },
- { "profitablewebprojects.com", true },
- { "profitopia.de", true },
- { "profits.fund", true },
- { "profloorstl.com", true },
- { "profmetod.com", true },
- { "profritual.ru", true },
- { "profsaranya.com", true },
- { "proft.eu", true },
- { "profumeria.roma.it", true },
- { "profuntime.tk", true },
- { "progarm.org", true },
- { "progaudio.be", true },
- { "progenda.be", true },
- { "progeon.nl", true },
- { "progeste.pt", true },
- { "proggersession.com", true },
- { "proggersession.de", true },
- { "progiscad.com", false },
- { "prograce.info", true },
- { "programador-web-freelance.es", true },
- { "programarya.com", true },
- { "programistka.com", true },
- { "programmaticmagic.com", true },
- { "programmatv.tk", true },
- { "programme-phenix.com", true },
- { "programming-solutions.tk", true },
- { "programsareproofs.com", true },
- { "programsupport300procent.com", true },
- { "programyburian.cz", true },
- { "progresivoptic.ro", true },
- { "progreso.pl", true },
- { "progress-linux.org", true },
- { "progress.photos", true },
- { "progressive.work", true },
- { "progressiveplanning.com", true },
- { "progressnet.nl", true },
- { "progresswww.nl", true },
- { "prohrcloud.com", true },
- { "proimpact.it", true },
- { "projectarmy.net", false },
- { "projectborealisgitlab.site", true },
- { "projectbotticelli.com", true },
- { "projectemail.co", true },
- { "projectforge.org", true },
- { "projectfreehosting.ga", true },
- { "projectgrimoire.com", true },
- { "projectinnovation.org", true },
- { "projectlinuseasttn.org", true },
- { "projectmailext.co", true },
- { "projectmakeit.com", true },
- { "projectnom.com", true },
- { "projectobs.com", true },
- { "projectsafechildhood.gov", true },
- { "projectsecretidentity.com", true },
- { "projectsecretidentity.org", true },
- { "projectxparis.com", true },
- { "projectxyz.eu", true },
- { "projekt-allianz.de", true },
- { "projektarbeit-projektplanung.de", true },
- { "projektzentrisch.de", true },
- { "projest.ch", false },
- { "projet-fly.ch", true },
- { "projet-saara.com", true },
- { "prolan.pw", true },
- { "prolearningcentre.com", true },
- { "proledwall.nl", true },
- { "prolinos.de", true },
- { "prolinq.in", true },
- { "promedyczny.pl", true },
- { "prometheanfire.net", true },
- { "prometheanfire.org", true },
- { "promexbol.com.bo", true },
- { "promiflash.de", true },
- { "promisesaplus.com", true },
- { "promo-brille.at", true },
- { "promo-brille.ch", true },
- { "promo-brille.de", true },
- { "promo-computers.nl", true },
- { "promo-matelas.com", true },
- { "promobo.fr", true },
- { "promocodius.com", true },
- { "promodafinil.com", true },
- { "promodance.cz", true },
- { "promods.cn", true },
- { "promods.net", true },
- { "promods.web.tr", true },
- { "promohulp.nl", true },
- { "promolover.com", true },
- { "promorder.ru", true },
- { "promoscuola.net", true },
- { "promoterms.com.au", true },
- { "promotioncentre.co.uk", true },
- { "promtechosnastka.ru", true },
- { "promuovi.tv", true },
- { "prontocleaners.co.uk", true },
- { "prontointerventofognature.roma.it", true },
- { "prontointerventoimmediato.it", true },
- { "prontossl.com", true },
- { "proofwiki.org", true },
- { "proos.nl", true },
- { "proovn.com", true },
- { "propagandablog.de", true },
- { "propagationtools.com", true },
- { "propanesale.cf", true },
- { "propelgrowth.com", true },
- { "propermatches.com", true },
- { "properticons.com", true },
- { "property-catalogue.eu", true },
- { "propertyauctionaction.co.uk", true },
- { "propertycrawl.com", true },
- { "propertyflare.com", true },
- { "propertygroup.pl", true },
- { "propertyinside.id", true },
- { "propertyone.mk", true },
- { "propertysales-almeria.com", true },
- { "propipesystem.com", true },
- { "propiteer.com", true },
- { "proporcer.tk", true },
- { "proposalonline.com", true },
- { "propr.no", true },
- { "proprietairesmaisons.fr", true },
- { "propseller.com", true },
- { "propshub.com", true },
- { "prosafilosofica.com.br", true },
- { "proseandleprechauns.com", true },
- { "prosecomgdl.com", true },
- { "proseo4u.com", true },
- { "proservices.vip", true },
- { "proshow.com.ua", true },
- { "prosony.es", true },
- { "prospecto.com.au", true },
- { "prospecto.ee", true },
- { "prospecto.hr", true },
- { "prospecto.lt", true },
- { "prosperfit.com", true },
- { "prosperity-textile.com", true },
- { "prosperontheweb.com", true },
- { "prosperops.com", true },
- { "prosperus.ru", true },
- { "prospo.co", true },
- { "prostitutki-narvskaja.ga", true },
- { "prosto-dengi.tk", true },
- { "prostohobby.ru", true },
- { "prostoporno.live", true },
- { "prostoskidki.ml", true },
- { "prostye-recepty.com", true },
- { "prosurveillancegear.com", true },
- { "proteco.sk", true },
- { "protectedpayments.net", true },
- { "protectedreport.com", true },
- { "protectem.de", true },
- { "protectoraanimalesalicante.org", true },
- { "protectorlando.com", true },
- { "protectr.de", false },
- { "protectwrap.ml", true },
- { "protege.moi", true },
- { "protegetudescanso.com", true },
- { "proteh.com.ua", true },
- { "protein-riegel-test.de", true },
- { "protek.tk", true },
- { "protempore.fr", true },
- { "proteogenix-products.com", true },
- { "proteogenix.science", true },
- { "proteus-eretes.nl", true },
- { "proteus-tech.com", true },
- { "protiksana.gr", true },
- { "protobetatest.com", true },
- { "protocol.ai", true },
- { "protocol.co.il", true },
- { "protogenbrainbooster.tk", true },
- { "protonmail.ch", true },
- { "protonmail.com", true },
- { "protonvpn.com", true },
- { "prototypefund.de", true },
- { "prototyping-computer.ml", true },
- { "proudplus.com", true },
- { "proust.ch", false },
- { "proust.media", false },
- { "proustmedia.de", false },
- { "prove-uru.co.uk", true },
- { "prove.no", true },
- { "provent.io", true },
- { "provereno-rabotaet.gq", true },
- { "provereno-rabotaet.tk", true },
- { "providential.be", true },
- { "providentins.com", true },
- { "providerlijst.com", true },
- { "providerlijst.nl", true },
- { "provinciaotlavoro.it", true },
- { "provision-isr.nl", true },
- { "provitec.com", true },
- { "provitec.de", true },
- { "provlas.se", true },
- { "prowebcenter.com", false },
- { "prowise.com", true },
- { "prowise.me", true },
- { "prowpcare.com", true },
- { "proximityradio.fr", true },
- { "proximoconcurso.com.br", true },
- { "proxirealtime.com", true },
- { "proxybay.bet", true },
- { "proxybay.bz", true },
- { "proxybay.cc", true },
- { "proxybay.co", true },
- { "proxybay.info", true },
- { "proxybay.ist", true },
- { "proxybay.la", true },
- { "proxybay.lat", true },
- { "proxybay.one", true },
- { "proxybay.tv", true },
- { "proxyportal.eu", true },
- { "proxyportal.org", true },
- { "proyectafengshui.com", true },
- { "proyecto13.com", true },
- { "proyectosinelec.com", true },
- { "prpferrara.it", true },
- { "prsnlafk.com", true },
- { "prt.in.th", true },
- { "prtimes.com", true },
- { "prtpe.com", true },
- { "pru.com.hk", true },
- { "pru.hk", true },
- { "prvcy.one", true },
- { "prvikvadrat.hr", true },
- { "prvnirodinna.cz", true },
- { "prylarprylar.se", true },
- { "prynhawn.com", true },
- { "prynhawn.net", true },
- { "prynhawn.org", true },
- { "prytkov.com", true },
- { "przemas.pl", true },
- { "przerabianiezdjec.pl", true },
- { "ps-sale.ru", true },
- { "ps2911.com", true },
- { "psa-travel-care.com", true },
- { "psabrowse.com", true },
- { "psauxit.com", true },
- { "psb1.org", true },
- { "psb1911.com", true },
- { "psb4ukr.org", true },
- { "psbarrett.com", true },
- { "psc.gov", true },
- { "pschierl.com", true },
- { "pscp.tv", true },
- { "pscr.gov", false },
- { "psdreams.com", true },
- { "psdsfn.com", true },
- { "psdsuc.com", true },
- { "pseek.com", true },
- { "pservicer.com.mx", true },
- { "pseta.ru", true },
- { "psg-calw.de", true },
- { "psg.bg", true },
- { "pshostpk.com", true },
- { "psici.eu", true },
- { "psicologajanainapresotto.com.br", true },
- { "psicologasandrabernal.es", true },
- { "psicologo-especialista-barcelona.com", true },
- { "psicologo-infantil-barcelona.com", true },
- { "psicologoforensemadrid.com", true },
- { "psihotest.tk", true },
- { "psitarz.com", true },
- { "psixotest.tk", true },
- { "psixotesty.tk", true },
- { "psm.org.ph", true },
- { "psochecker.com", true },
- { "psono.pw", true },
- { "psoriasischecker.com", true },
- { "pssgcsim.org", true },
- { "pst.moe", true },
- { "psu.je", true },
- { "psw-consulting.de", true },
- { "psw-group.de", true },
- { "psw-training.de", true },
- { "psw.net", true },
- { "psyao.ch", false },
- { "psychedelia.com", true },
- { "psychedelics.org", true },
- { "psychiatrie-ricany.cz", true },
- { "psychic-healer-mariya-i-petrova-boyankinska-b-borovan-bg.com", true },
- { "psychintervention.com", true },
- { "psychiq.com", true },
- { "psychoactive.com", true },
- { "psychoco.net", false },
- { "psychologbruksela.be", true },
- { "psychologi.cf", true },
- { "psychometrictest.ca", true },
- { "psychopersonnalite.com", true },
- { "psychotechnique.africa", true },
- { "psychotechnique.be", true },
- { "psychotechnique.ch", true },
- { "psychotechniquetest.fr", true },
- { "psychotherapie-kp.de", true },
- { "psychotherapy-vienna.com", true },
- { "psycolleges.com", true },
- { "psytrance-pro.com", true },
- { "pt-d.ru", true },
- { "pt-server.de", true },
- { "pt.im", true },
- { "ptal.eu", true },
- { "ptasiepodroze.eu", true },
- { "ptbi.org.pl", true },
- { "ptbx.co", true },
- { "ptcbooks.gq", true },
- { "pteceng.com", true },
- { "pterodactyl.org.cn", true },
- { "pterodactylus.cz", true },
- { "ptfiber.com", true },
- { "ptfiber.ru", true },
- { "ptfiber.spb.ru", true },
- { "ptgoldensun.com", true },
- { "ptm.ro", true },
- { "ptmarquees.ie", true },
- { "ptrbrs.nl", true },
- { "ptrl.ws", true },
- { "ptron.org", true },
- { "ptrt.xyz", true },
- { "ptupapers.tk", true },
- { "puac.de", true },
- { "pubclub.com", true },
- { "pube.tk", true },
- { "pubi.me", true },
- { "pubkit.io", true },
- { "publanda.nl", true },
- { "publi-all.be", true },
- { "public-g.de", true },
- { "public-measures.com", true },
- { "public-projects.com", true },
- { "public-projects.de", true },
- { "public-vocals.de", true },
- { "publiccarauctionscalifornia.com", true },
- { "publicholidays.im", true },
- { "publicintelligence.net", true },
- { "publicsuffix.org", true },
- { "publiq.space", true },
- { "publishedpaper.ga", true },
- { "publisherservices.co", true },
- { "publivate.ca", true },
- { "pubmire.com", false },
- { "pubreview.com.au", true },
- { "pucchi.net", true },
- { "pucogid.ga", true },
- { "pucssa.org", true },
- { "puddis.de", true },
- { "pudro.com", true },
- { "puer.eu.org", true },
- { "puestifiestas.mx", false },
- { "puestosdeferia.mx", true },
- { "puetter.eu", true },
- { "pugetsoundspas.com", true },
- { "puggan.se", true },
- { "pugovka72.ru", true },
- { "puissancemac.ch", false },
- { "puiterwijk.org", true },
- { "pukfalkenberg.dk", true },
- { "pukkapilatesandpt.com", true },
- { "pulcinella.tk", true },
- { "pulizia.roma.it", true },
- { "pulizieuffici.milano.it", true },
- { "pulizievap.it", true },
- { "pulpproject.org", true },
- { "pulser.stream", true },
- { "pulseroot.ga", true },
- { "pulsnitzer-lebkuchen-shop.de", true },
- { "pulsnitzer-lebkuchen.de", true },
- { "pulsnitzer-lebkuchen.shop", true },
- { "pulsnitzer-pfefferkuchen-shop.de", true },
- { "pulsnitzer-pfefferkuchen.shop", true },
- { "pulsr.ml", true },
- { "pumperszene.com", true },
- { "punchlinetheatre.co.uk", true },
- { "punchlinetheatre.com", true },
- { "punchunique.com", true },
- { "punematka.com", true },
- { "punikonta.de", true },
- { "punitsheth.com", true },
- { "punkapoule.fr", true },
- { "punkart.tk", true },
- { "puntacananetwork.com", true },
- { "puntacanatransporte.com", true },
- { "puntaprop.com", true },
- { "puntasiho.com", true },
- { "puntcunts.com", true },
- { "punte-juwelier.nl", true },
- { "puntoestadodemexico.com", true },
- { "puntonium.hu", true },
- { "pupboss.com", true },
- { "pupok.cf", true },
- { "puppet.pl", true },
- { "pupset.net", true },
- { "puralps.ch", true },
- { "puravida-estate.com", true },
- { "purchasescooters.ga", true },
- { "pure-gmbh.com", true },
- { "pure-host.de", true },
- { "purefkh.xyz", false },
- { "purejewels.com", true },
- { "purepest.com", true },
- { "purevapeofficial.com", true },
- { "purexis.ch", true },
- { "puripia.com", true },
- { "purityclothing.co.uk", true },
- { "purple.tech", true },
- { "purplebooth.co.uk", false },
- { "purplebricks.co.uk", true },
- { "purplebricks.com.au", true },
- { "purplebricksplc.com", true },
- { "purplemet.com", true },
- { "purplemoon.ch", true },
- { "purplemoon.mobi", true },
- { "purplepr.bg", true },
- { "purplestar.ch", true },
- { "purplestar.com", true },
- { "purplestar.mobi", true },
- { "purpletech.com.br", true },
- { "purplewindows.net", true },
- { "purplscientific.com", true },
- { "purrfectboudoir.com", true },
- { "purrfectcams.com", true },
- { "purrfectlove.net", true },
- { "purrfectmembersclub.com", true },
- { "purrfectswingers.com", true },
- { "pursuedtirol.com", true },
- { "pursuehappiness.tk", true },
- { "puryearlaw.com", true },
- { "pusehusetkattehotell.no", true },
- { "pusehusetmalvik.no", true },
- { "pushers.com.mx", true },
- { "pushoflove.com", true },
- { "pushpanel.io", true },
- { "pushrax.com", true },
- { "pussr.com", true },
- { "pussylickingnow.com", true },
- { "put.moe", true },
- { "put.re", true },
- { "putana.gq", true },
- { "putany.tk", true },
- { "putanypitera.ml", true },
- { "putasdelporno.com", true },
- { "putatara.net", true },
- { "puteulanus.xyz", true },
- { "putin.red", true },
- { "putman-it.nl", true },
- { "putnamcollision.com", true },
- { "putney.io", true },
- { "putomani.rs", true },
- { "putrawijayatours.com", true },
- { "putrock.be", true },
- { "puxlit.net", true },
- { "puyallupnissanparts.com", true },
- { "puyblanc.info", true },
- { "puzzle-welt.ch", true },
- { "puzzlepoint.ch", true },
- { "pv-paderborn-now.de", true },
- { "pvamg.org", true },
- { "pvc-stolarija.co", true },
- { "pvcvoordeel.nl", false },
- { "pvda.nl", true },
- { "pvhe.pl", true },
- { "pvmotorco.com", true },
- { "pvpcraft.ca", true },
- { "pvpctutorials.de", true },
- { "pvpheroes.no", true },
- { "pvphs98.com", true },
- { "pvtschlag.com", true },
- { "pwdsafe.com", false },
- { "pwnies.dk", true },
- { "pwolk.com", true },
- { "pxetech.com", true },
- { "pxgamer.xyz", true },
- { "pxl-mailtracker.com", true },
- { "pxl.cl", true },
- { "pxx.io", true },
- { "py-amf.org", true },
- { "py.search.yahoo.com", false },
- { "pycrc.org", true },
- { "pycrypto.org", true },
- { "pygarage.com", false },
- { "pylon.bot", true },
- { "pymescentro.net", true },
- { "pymesvalencia.es", true },
- { "pymeup.org", true },
- { "pypa.io", true },
- { "pypi.io", true },
- { "pypi.org", true },
- { "pypi.python.org", true },
- { "pyrenees.io", true },
- { "pyroballpcbs.com", true },
- { "pyrotechnologie.de", true },
- { "pysays.net", true },
- { "pyspace.org", true },
- { "python-hyper.org", true },
- { "python.org", false },
- { "pythonatrix.com", true },
- { "pytradebot.com.br", true },
- { "pyzlnar.com", true },
- { "pzpittsburgh.com", true },
- { "pzsearch.nl", true },
- { "q-inn.com", true },
- { "q-inn.nl", true },
- { "q-technologies.com.au", true },
- { "q01.us", true },
- { "q1000.nl", true },
- { "q365.vip", true },
- { "q36594.com", true },
- { "q81818.com", true },
- { "q88588.com", true },
- { "q8igh228tq.tk", true },
- { "qa-brandywineglobal.com", true },
- { "qa.fedoraproject.org", true },
- { "qa.stg.fedoraproject.org", true },
- { "qabel.de", true },
- { "qacademy.com.au", true },
- { "qaconstrucciones.com", true },
- { "qambarraza.com", true },
- { "qani.me", true },
- { "qaq.cloud", true },
- { "qaq.sh", true },
- { "qarea.com", true },
- { "qarto.com", true },
- { "qaz.cloud", true },
- { "qbiju.com.br", true },
- { "qbiltrade.com", true },
- { "qbtechs.com", true },
- { "qbus.pl", true },
- { "qc.search.yahoo.com", false },
- { "qcbrna.qa", true },
- { "qccareerschool.com", true },
- { "qcdesignschool.com", false },
- { "qceventplanning.com", false },
- { "qclt.com", true },
- { "qcmakeupacademy.com", false },
- { "qcmlw.com", true },
- { "qcstudentcenter.com", true },
- { "qcstyleacademy.com", true },
- { "qctravelschool.com", true },
- { "qdabogados.com", true },
- { "qdon.space", true },
- { "qdrat.ml", true },
- { "qe-lab.at", true },
- { "qed.ai", true },
- { "qedcon.org", false },
- { "qelectrotech.org", true },
- { "qetesh.de", true },
- { "qetic.co.jp", true },
- { "qewc.com", true },
- { "qgr.se", true },
- { "qhse-professionals.nl", true },
- { "qianalysis.com", true },
- { "qianmo.com", true },
- { "qianqiao.me", true },
- { "qiaohong.org", true },
- { "qicsystems.com", true },
- { "qifu.me", true },
- { "qihl.gg", true },
- { "qiliang.wang", true },
- { "qingly.me", true },
- { "qingpei.me", true },
- { "qionouu.cn", true },
- { "qis.fr", true },
- { "qitarabutrans.com", true },
- { "qiuby.de", true },
- { "qiuri.org", false },
- { "qivonline.pt", true },
- { "qixi.biz", true },
- { "qkmortgage.com", true },
- { "ql.tc", true },
- { "qlarititech.io", true },
- { "qlcvea.com", true },
- { "qldcarwreckers.com.au", true },
- { "qldconservation.org.au", true },
- { "qldformulaford.org", true },
- { "qlinksgroup.com", true },
- { "qlrace.com", false },
- { "qm-marzahnnordwest.de", true },
- { "qmee.com", true },
- { "qnected.nl", true },
- { "qnome.eu", true },
- { "qnsgmd.com", true },
- { "qochealth.com", true },
- { "qoml.net", true },
- { "qonto.eu", true },
- { "qoor.io", false },
- { "qoptalk.com", true },
- { "qosmoschools.edu.my", true },
- { "qotw.net", true },
- { "qp666d.com", true },
- { "qpcna.org", true },
- { "qponverzum.hu", true },
- { "qpresentes.com.br", true },
- { "qq52o.me", true },
- { "qq6177.com", true },
- { "qq6177.net", true },
- { "qqiao.me", true },
- { "qqq6.com", true },
- { "qqrss.com", true },
- { "qr-city.org", true },
- { "qr.cl", true },
- { "qr1.at", true },
- { "qr70.com", true },
- { "qrara.net", true },
- { "qrbird.com", true },
- { "qrcontagion.com", true },
- { "qrd.by", true },
- { "qristianuliarkhi.ge", true },
- { "qrpatrol.com", true },
- { "qrpth.eu", true },
- { "qruiser.com", true },
- { "qryo.nl", true },
- { "qscloud.de", true },
- { "qtacairsoft.com", true },
- { "qtl.me", true },
- { "qtmsheep.com", true },
- { "qtn.net", true },
- { "qto.net", true },
- { "qtpass.org", true },
- { "qtpower.co.uk", true },
- { "qtpower.net", true },
- { "qtpower.org", true },
- { "qttransformation.com", true },
- { "qtvr.com", true },
- { "qtxh.net", true },
- { "quackerswaterproofing.com", true },
- { "quadra.srl", true },
- { "quafe.tech", true },
- { "quagga.me", true },
- { "quaggan.co", true },
- { "quai10.org", false },
- { "qualbe.com", true },
- { "qualitation.co.uk", true },
- { "qualite-ecole-et-formation.ch", false },
- { "quality-life.gr", true },
- { "qualityhomesystems.com", true },
- { "qualityhvacservices.com", true },
- { "qualityofcourse.com", true },
- { "qualitypropertycare.co.uk", true },
- { "qualitywaterproofing.com", true },
- { "quallo.com", true },
- { "qualpay.com", true },
- { "qualtrics.com", true },
- { "quant-labs.de", true },
- { "quanterra.ch", false },
- { "quantifiedcommerce.com", true },
- { "quantolytic.de", true },
- { "quantoras.com", true },
- { "quanttydesignweb.com.br", true },
- { "quantum-evolution.jp", true },
- { "quantum-mechanics.com", true },
- { "quantum2.xyz", true },
- { "quantumcrypto.nl", true },
- { "quantumfinance.com.au", true },
- { "quantumfurball.net", true },
- { "quantumpair.net", true },
- { "quareal.ru", true },
- { "quarim.cz", true },
- { "quarkdose.de", true },
- { "quarterfull.com", true },
- { "quarticon.com", true },
- { "quartix.com", true },
- { "quasarelectronics.co.uk", true },
- { "quasiproxy.com", true },
- { "quasseldroid.info", true },
- { "quatrefoiscent.fr", true },
- { "quatulo.net", true },
- { "quaxio.com", true },
- { "quay.net", true },
- { "qubes-os.org", true },
- { "qubhockey.tk", true },
- { "qubyte.codes", true },
- { "quchao.com", true },
- { "que-debo-regalar.es", true },
- { "quebajelagasolina.com", true },
- { "quebec.casa", true },
- { "quedos.com.au", true },
- { "queenbeer.com", true },
- { "queencomplex.net", true },
- { "queene.eu", true },
- { "queensfactory.it", true },
- { "queensrdapartments.com.au", true },
- { "queer.party", true },
- { "queercoders.com", false },
- { "queextensiones.com", true },
- { "queirozmiotto.adv.br", true },
- { "quelle-catalog.tk", true },
- { "quelle.at", true },
- { "quelle.ch", true },
- { "quelle.de", true },
- { "quelleformation.net", true },
- { "quemadoresdegrasa.org", true },
- { "quemmeliga.com", true },
- { "quenecesitopara.com", true },
- { "quenotejodan.cl", true },
- { "quentin-sauvetre.fr", true },
- { "quentinchevre.ch", true },
- { "queo.com.co", true },
- { "quera.ir", true },
- { "querencia.online", true },
- { "quermail.com", true },
- { "queropescar.net", true },
- { "query-massage.com", false },
- { "queryquinton.com", true },
- { "questdairy.com", true },
- { "question.com", true },
- { "questionscafe.org", true },
- { "questionyu.com", true },
- { "questsocial.it", true },
- { "quevisiongrafica.com", true },
- { "quhyu.xyz", true },
- { "quic.network", true },
- { "quic.stream", true },
- { "quichante.com", true },
- { "quickassortments.com", true },
- { "quickformspro.com", true },
- { "quickinfosystem.com", true },
- { "quicksell.store", true },
- { "quicksupplies.us", true },
- { "quieroserbombero.org", true },
- { "quieroserdoula.com", true },
- { "quieroserdoula.es", true },
- { "quieroserdoula.org", true },
- { "quiet-waters.org", true },
- { "quietapple.org", true },
- { "quik.legal", true },
- { "quikchange.net", true },
- { "quikpay.com.au", true },
- { "quimatic.com.br", true },
- { "quinmedia.tk", true },
- { "quinoa24.com", true },
- { "quintenbraakman.com", true },
- { "quintenbraakman.nl", true },
- { "quintenehb.be", true },
- { "quintessa.org", true },
- { "quiq-api.com", true },
- { "quiq-cdn.com", true },
- { "quiq-uri.com", true },
- { "quiq.us", true },
- { "quiqd.com", true },
- { "quiqstatus.com", true },
- { "quiqurl.com", true },
- { "quiqurls.com", true },
- { "quire.io", true },
- { "quirkytravelguy.com", true },
- { "quitsmoking.coach", true },
- { "quiz4math.gr", true },
- { "quizhub.co", true },
- { "quizz.biz", true },
- { "qul.link", true },
- { "quote.gq", false },
- { "quotedtale.com", true },
- { "quoteidiot.com", true },
- { "quotev.com", true },
- { "quovadisaustria.com", true },
- { "quppa.net", true },
- { "quprop.com", true },
- { "quranliveonline.com", true },
- { "qurplus.nl", true },
- { "quuck.eu", true },
- { "quuck.nl", true },
- { "quuz.org", true },
- { "qvg.company", true },
- { "qvggroup.com", true },
- { "qvq.cloud", true },
- { "qwant.com", true },
- { "qwantjunior.com", true },
- { "qwaser.fr", true },
- { "qwd.no", true },
- { "qwdqwd.de", true },
- { "qwe7002.com", true },
- { "qwertee.com", true },
- { "qwerty.work", true },
- { "qwikdash.com", true },
- { "qwq.moe", true },
- { "qx.fi", true },
- { "qx.se", true },
- { "qxzg.xyz", true },
- { "r-ay.cn", true },
- { "r-rwebdesign.com", true },
- { "r-t-b.fr", true },
- { "r102.ch", true },
- { "r1a.eu", true },
- { "r1ch.net", true },
- { "r2d2pc.com", true },
- { "r33.space", true },
- { "r36533.com", true },
- { "r36594.com", true },
- { "r3s1stanc3.me", true },
- { "r40.us", true },
- { "r6-team.ru", true },
- { "r7.com.au", true },
- { "r7h.at", true },
- { "r81818.com", true },
- { "ra-joergensen.de", true },
- { "ra-jurochnik.de", false },
- { "ra-micro-koeln.de", true },
- { "ra-schaal.de", true },
- { "ra.co.ke", true },
- { "ra.vc", true },
- { "ra3y.xyz", true },
- { "raadgiverborsen.com", true },
- { "raah.co", true },
- { "raailto.com", true },
- { "raaynk.com", true },
- { "raballder.tk", true },
- { "rabbitcallcenter.com", true },
- { "rabbitfinance.com", true },
- { "rabbitinternet.com", true },
- { "rabica.de", true },
- { "rabotaescort.com", false },
- { "rabotayes.ru", true },
- { "racaliz.tk", true },
- { "raccoltarifiuti.com", true },
- { "raccoon.fun", true },
- { "racermaster.xyz", true },
- { "raceviewcycles.com", true },
- { "racevinyl.es", true },
- { "racheldiensthuette.de", true },
- { "rachelmoorelaw.com", true },
- { "rachelreagan.com", true },
- { "rachurch.net", false },
- { "racing-planet.cz", true },
- { "racius.com", true },
- { "rackerlab.com", true },
- { "raclet.co.uk", true },
- { "raconconsulting.co.uk", true },
- { "racoo.net", true },
- { "racunovodstvo-prina.si", true },
- { "radar.sx", true },
- { "radaravia.ru", true },
- { "radarbanyumas.co.id", true },
- { "radartatska.se", true },
- { "radartek.com", true },
- { "radcube.hu", true },
- { "radegundisfest.de", true },
- { "radfieldhomecare.co.uk", true },
- { "radfieldhomecarefranchising.co.uk", true },
- { "radicaldream.tk", true },
- { "radicalepil-haguenau.fr", true },
- { "radicaloptimism.org", true },
- { "radicalsub.com.br", true },
- { "radins.com", true },
- { "radio-brest.tk", true },
- { "radio-pulsar.eu", true },
- { "radio-utopie.de", true },
- { "radio1.ie", true },
- { "radioborges.tk", true },
- { "radiobox.net", true },
- { "radiocartel.tk", true },
- { "radiocommande-industrielle.fr", true },
- { "radiocommg.com.br", true },
- { "radiocomsaocarlos.com.br", true },
- { "radiodeutsch.com", true },
- { "radiodiagonal.tk", true },
- { "radioelectronic.tk", true },
- { "radiofmimagen.net", true },
- { "radioh.no", true },
- { "radioheteroglossia.com", true },
- { "radiohub.ru", true },
- { "radioilusion.es", true },
- { "radioldpr.ru", true },
- { "radiolla.com", true },
- { "radiom.fr", true },
- { "radiomodem.dk", true },
- { "radiomontebianco.it", true },
- { "radionrg.tk", true },
- { "radiopharereims.tk", true },
- { "radiopleer.net", true },
- { "radior9.it", true },
- { "radioradicchio.it", true },
- { "radiorainbow.tk", true },
- { "radiosdeguate.com", true },
- { "radiosendungen.com", true },
- { "radiowakeup.tk", true },
- { "radiozetta.tk", true },
- { "radis-adopt.com", true },
- { "radiumone.io", true },
- { "radiumtree.com", true },
- { "radixsalon.tk", true },
- { "radlina.com", true },
- { "radmehrco.com", true },
- { "radomir-online.ru", true },
- { "radondetectionandcontrol.com", true },
- { "radreisetraumtreibstoff.de", true },
- { "radyabkhodro.net", true },
- { "radyn.com", true },
- { "radyodinle.mobi", true },
- { "radzikow.ski", true },
- { "raeder-test.azurewebsites.net", true },
- { "raelto.com", true },
- { "raeu.me", true },
- { "raeven.nl", true },
- { "raevinnd.com", true },
- { "raewardfresh.co.nz", true },
- { "rafaelmagalhaesweb.com", true },
- { "rafas.com.tr", true },
- { "rafey.xyz", true },
- { "raffaelevinci.eu", true },
- { "raffaellaosti.com", true },
- { "raffleshospital.co.id", false },
- { "rafleatherdesign.com", true },
- { "rafting-japan.com", true },
- { "ragasto.nl", true },
- { "rage4.com", true },
- { "raginggaming.ga", true },
- { "ragingserenity.com", true },
- { "ragu.co.uk", true },
- { "rahulpnath.com", true },
- { "raid-runners.fr", true },
- { "raidemeraude.com", true },
- { "raidensnakesden.co.uk", true },
- { "raidensnakesden.com", true },
- { "raidensnakesden.net", true },
- { "raidstone.net", true },
- { "raiffeisen-kosovo.com", true },
- { "raiffeisenleasing-kosovo.com", true },
- { "raiilto.com", true },
- { "raiito.com", true },
- { "rail-o-rama.nl", true },
- { "rail-to.com", true },
- { "rail24.nl", true },
- { "rail360.nl", true },
- { "railbird.nl", true },
- { "railduction.eu", true },
- { "railgun.ac", true },
- { "railgun.com.cn", true },
- { "raillto.com", true },
- { "railorama.nl", true },
- { "railot.com", true },
- { "railpassie.nl", true },
- { "railto-sucks.com", true },
- { "railto.cm", true },
- { "railto.co", true },
- { "railto.com.de", true },
- { "railto.com.se", true },
- { "railto.exchange", true },
- { "railto.llc", true },
- { "railto.net", true },
- { "railto.org", true },
- { "railtocom.com", true },
- { "railtoe.com", true },
- { "railtoexchange.com", true },
- { "railtoh.com", true },
- { "railtollc.com", true },
- { "railtoo.com", true },
- { "railtosucks.com", true },
- { "railtow.com", true },
- { "railtp.com", true },
- { "railtto.com", true },
- { "railvideo.co.uk", true },
- { "railvideo.net", true },
- { "railvideo.nl", true },
- { "rain.bz", true },
- { "rainbowbay.org", true },
- { "rainbowflowers.co.uk", true },
- { "rainbowinflatables.co.uk", true },
- { "rainbowsmoothies.win", true },
- { "rainbowstore.com.au", true },
- { "rainbowstore.com.ua", true },
- { "raincoat.systems", true },
- { "rainel.at", true },
- { "rainforest.engineering", true },
- { "raingoc.com", true },
- { "rainiv.com", true },
- { "rainpaper.com", true },
- { "rainstormsinjuly.co", true },
- { "rainturtle.com", true },
- { "rainville.me", true },
- { "rainway.com", true },
- { "rainway.io", true },
- { "raisecorp.com", true },
- { "raiseyourflag.com", true },
- { "raissarobles.com", true },
- { "raistrick.it", true },
- { "raitlo.com", true },
- { "rajaealhoceima.tk", true },
- { "rajasatour.id", true },
- { "rajkapoordas.com", true },
- { "rajyogarishikesh.com", true },
- { "rak-business-service.com", true },
- { "raketa.travel", true },
- { "raketaro.de", true },
- { "raketenwolke.de", true },
- { "raku.bzh", true },
- { "rakugokai.net", true },
- { "raleto.com", true },
- { "ralfs-zusizone.de", true },
- { "ralimtek.com", false },
- { "ralix.net", true },
- { "rallto.com", true },
- { "rally-base.com", true },
- { "rally-base.cz", true },
- { "rally-base.eu", true },
- { "rally-results.eu", true },
- { "rally-vysledky.cz", true },
- { "rallybase.cz", true },
- { "rallybase.eu", true },
- { "rallycycling.com", true },
- { "rallypodium.be", true },
- { "raltha.com", true },
- { "ram-it.nl", true },
- { "ram.nl", true },
- { "ramarka.de", true },
- { "rambedjeans.com", true },
- { "rambo.codes", true },
- { "ramitan.com", true },
- { "rammstein-portugal.com", true },
- { "rammsteinzone.tk", true },
- { "rampestyuma.com", true },
- { "ramrecha.com", false },
- { "ramsaver.com.br", true },
- { "ramsdensforcash.co.uk", true },
- { "ramsdensplc.com", true },
- { "ramsor-gaming.de", true },
- { "ramtechmodular.com", true },
- { "ran-drunken.tk", true },
- { "ranalawassociates.com", true },
- { "ranasinha.com", true },
- { "randc.org", true },
- { "randewoo.ru", true },
- { "randolf.ca", true },
- { "random.org", true },
- { "randomadversary.com", true },
- { "randombit.eu", false },
- { "randomcode.org", true },
- { "randomdata.sh", true },
- { "randomkoalafacts.com", true },
- { "randomprecision.co.uk", true },
- { "randomquotesapp.com", true },
- { "randomsearching.ml", true },
- { "randomserver.pw", true },
- { "ranfurlychambers.co.nz", true },
- { "rangde.org", true },
- { "rangercollege.edu", true },
- { "rangsmo.se", true },
- { "rank-net.de", true },
- { "rankgiants.com", true },
- { "ranking-deli.jp", true },
- { "ranktopay.com", true },
- { "rannamoisaaiasalong.ee", true },
- { "ranobe.club", true },
- { "ranthambhorenationalpark.net", true },
- { "ranwest.com", true },
- { "ranyeh.com", true },
- { "ranzbak.nl", true },
- { "raoul-kieffer.net", true },
- { "rap4ever.org", true },
- { "rapenroer.com", true },
- { "rapenroer.nl", true },
- { "raphael.li", true },
- { "raphaelcasazza.ch", false },
- { "rapidapp.io", true },
- { "rapidoo.com.br", true },
- { "rapidshit.net", true },
- { "rapidstone.com", true },
- { "raportdnia.pl", true },
- { "rapport.link", true },
- { "raptorsrapture.com", true },
- { "rapwoyska.tk", true },
- { "raqoo.jp", true },
- { "raquelmolinacases.tk", true },
- { "raraflora.com.au", true },
- { "rarece.cf", true },
- { "rarename.tk", true },
- { "raryosu.info", true },
- { "rasagiline.com", true },
- { "rascahan.org", true },
- { "rascals-castles.co.uk", true },
- { "rascals.ga", true },
- { "rascalscastles.co.uk", true },
- { "rascalscastlesdoncaster.co.uk", true },
- { "rasebo.ro", true },
- { "raspii.tech", true },
- { "rassro.sk", true },
- { "rastabooks.ga", true },
- { "rasty.cz", true },
- { "ratd.net", true },
- { "ratebridge.com", true },
- { "ratelimited.me", true },
- { "ratgeber-guide.de", true },
- { "rathbonesonline.com", true },
- { "rationalcreation.com", true },
- { "rationalism.com", true },
- { "ratirl.be", true },
- { "rattattees.com", true },
- { "rattenkot.io", true },
- { "ratujemyzwierzaki.net", true },
- { "raucris.ro", true },
- { "raulrivero.es", true },
- { "rauros.net", true },
- { "rauschenbach.de", true },
- { "ravada-vdi.com", true },
- { "ravanalk.com", true },
- { "ravchat.com", true },
- { "raveboy.dyndns.org", true },
- { "ravelin.com", true },
- { "raven.dog", true },
- { "ravencoin.com", true },
- { "ravencoin.org", true },
- { "ravenger.net", true },
- { "ravenrockrp.com", true },
- { "ravensbuch.de", true },
- { "ravhaaglanden.org", true },
- { "ravindran.me", true },
- { "ravis.org", true },
- { "rawcbd.shop", true },
- { "rawcode.xyz", true },
- { "rawdamental.com", true },
- { "rawdutch.nl", true },
- { "rawinfosec.com", true },
- { "rawsec.net", true },
- { "ray-home.de", true },
- { "ray-works.de", true },
- { "raya.io", true },
- { "rayadventure.com", true },
- { "raydius.de", true },
- { "raydolapfiyat.com", true },
- { "rayiris.com", true },
- { "raykitchenware.com", true },
- { "raymcbride.com", true },
- { "raymd.de", true },
- { "raynersorchard.com.au", true },
- { "raynis.net", true },
- { "raysei.com", true },
- { "rayworks.de", true },
- { "raza.gr", true },
- { "razalabs.com", true },
- { "razalabs.gr", true },
- { "razborpoletov.cf", true },
- { "razborpoletov.ml", true },
- { "razborpoletov.tk", true },
- { "razgon.ga", true },
- { "raziskovalec-resnice.com", true },
- { "razrabo.tk", true },
- { "razrsec.uk", true },
- { "razvanburz.net", true },
- { "razvlekuha.cf", true },
- { "razvlekuhablog.tk", true },
- { "rbensch.com", true },
- { "rbflote.lv", true },
- { "rbh.co.uk", true },
- { "rbin.nl", true },
- { "rbltracker.com", true },
- { "rbmland.com", true },
- { "rbnet.xyz", true },
- { "rbran.com", true },
- { "rbs.com", true },
- { "rbt.sx", true },
- { "rbtvshitstorm.de", true },
- { "rbuddenhagen.com", true },
- { "rbunews.tk", true },
- { "rbx.com", true },
- { "rc-offi.net", true },
- { "rc-shop.ch", true },
- { "rca.fr", true },
- { "rca2015.ru", true },
- { "rcd.cz", true },
- { "rcdocuments.com", true },
- { "rcgoncalves.pt", true },
- { "rchavez.site", true },
- { "rchrdsn.uk", true },
- { "rcjescrow.uk", true },
- { "rclaywilliamsdo.com", true },
- { "rclsm.net", true },
- { "rcmstream.com", true },
- { "rcmurphy.com", true },
- { "rcnitrotalk.com", true },
- { "rcpdesign.cl", true },
- { "rcraigmurphy.com", true },
- { "rct.sk", true },
- { "rct.uk", true },
- { "rctalk.com", true },
- { "rcvd.io", true },
- { "rdactive.de", true },
- { "rdactive.net", true },
- { "rdap.co.il", true },
- { "rdcdesign.com", true },
- { "rdfproject.it", true },
- { "rdh.asia", true },
- { "rdjb2b.com", true },
- { "rdl.at", true },
- { "rdmc.fr", true },
- { "rdmrotterdam.nl", true },
- { "rdmtaxservice.com", true },
- { "rdns.cc", false },
- { "rdr2natives.com", true },
- { "rdv-cni.fr", true },
- { "rdv-prefecture.com", true },
- { "rdviitd.org", true },
- { "re-crawl.com", true },
- { "re-engines.com", true },
- { "re-inspect.com", true },
- { "re-security.com", true },
- { "reach-on.de", true },
- { "reachhead.com", true },
- { "reachonline.org", true },
- { "reachout-ghana.com", true },
- { "reachrss.com", true },
- { "reaconverter.com", true },
- { "react-db.com", true },
- { "reactions.ai", true },
- { "reactive-press.com", true },
- { "reactivemarkets.com", true },
- { "reactpwa.com", true },
- { "readabilitychecker.com", true },
- { "reades.co.uk", true },
- { "reades.uk", true },
- { "readify.net", true },
- { "readifycloud.com", true },
- { "readingrats.de", true },
- { "readism.io", true },
- { "readmusiccoleman.com", true },
- { "readonly.de", true },
- { "readouble.com", false },
- { "reads.wang", false },
- { "ready4bf.tk", true },
- { "readybetwin.com", true },
- { "readyrowan.com", true },
- { "readyrowan.org", true },
- { "readysell.net", true },
- { "readytongue.com", true },
- { "reaganlibrary.gov", true },
- { "reaksi.id", true },
- { "real-digital.co.uk", true },
- { "real-it.nl", true },
- { "real-neo.me", true },
- { "realcapoeira.ru", true },
- { "realestate-in-uruguay.com", true },
- { "realestatecentralcoast.info", true },
- { "realestatemarketingblog.org", true },
- { "realestateonehowell.com", true },
- { "realestateradioshow.com", true },
- { "realfood.space", true },
- { "realgogo.com", true },
- { "realhorsegirls.net", true },
- { "realhypnosistraining.com.au", true },
- { "reality.news", true },
- { "reality0ne.com", false },
- { "realitycrazy.com", true },
- { "reall.uk", true },
- { "reallifeforums.com", true },
- { "realloc.me", true },
- { "really-simple-plugins.com", false },
- { "really-simple-ssl.com", true },
- { "reallytrusted.com", true },
- { "reallywild.tk", true },
- { "realme.govt.nz", true },
- { "realmofespionage.xyz", true },
- { "realoteam.ddns.net", true },
- { "realpaella.com", true },
- { "realpropertyprofile.gov", true },
- { "realtygroup-virginia.com", true },
- { "realtyink.net", true },
- { "realum.com", true },
- { "realum.de", true },
- { "realum.eu", true },
- { "realum.net", true },
- { "realvnc.help", true },
- { "realwaycome.com", true },
- { "realwildart.com", true },
- { "realworldholidays.co.uk", true },
- { "ream.lu", true },
- { "reancos.report", true },
- { "reanimated.eu", true },
- { "reath.xyz", true },
- { "reavaninc.com", true },
- { "reaven.nl", true },
- { "rebane2001.com", true },
- { "rebeagle.com", true },
- { "rebeccawendlandt.com", true },
- { "rebelbranding.nl", true },
- { "rebelessex.com", true },
- { "rebelko.de", true },
- { "rebellionbrewing.com.au", true },
- { "rebelonline.nl", true },
- { "rebelrebel.com.au", true },
- { "rebelz.se", true },
- { "rebirthia.me", true },
- { "reboxetine.com", true },
- { "reboxonline.com", true },
- { "rebtoor.com", true },
- { "reby.cf", true },
- { "reby.ga", true },
- { "reby.gq", true },
- { "reby.tk", true },
- { "recalls.gov", true },
- { "recantoshop.com", true },
- { "recantoshop.com.br", true },
- { "recapp.ch", true },
- { "recaptcha-demo.appspot.com", true },
- { "recebersms.com", true },
- { "receptionpoint.com", true },
- { "recetin.com", true },
- { "recettemedievale.fr", true },
- { "recherchegruppe.tk", true },
- { "recht.us", true },
- { "rechtsanwaeltin-vollmer.de", true },
- { "rechtsanwalt-koeppen-feucht.de", true },
- { "rechtschreibpruefung24.de", true },
- { "recipea.com", true },
- { "recipeapproved.ca", true },
- { "recipesmadeeasy.co.uk", true },
- { "recipex.ru", true },
- { "recipeyak.com", true },
- { "reckontalk.com", true },
- { "reclametoolz.nl", true },
- { "reclusiam.net", true },
- { "recmon.hu", true },
- { "reco-studio.de", true },
- { "recoba3d.com", true },
- { "recolic.net", true },
- { "recolic.org", true },
- { "recommended.reviews", true },
- { "recompiled.org", false },
- { "recon-networks.com", true },
- { "reconexion.life", true },
- { "recoveringspirit.com", true },
- { "recoveryonline.org", true },
- { "recrea.pl", true },
- { "recreation.gov", true },
- { "recruit.net", true },
- { "recruitmade.jp", true },
- { "recruitnow.nl", true },
- { "rectecforum.com", true },
- { "recuperodatiraidfastec.it", true },
- { "recurly.com", true },
- { "recurrentmeningitis.org", true },
- { "recursionrecursion.co.uk", true },
- { "recursosdeautoayuda.com", true },
- { "recyclebin.email", true },
- { "recycling.tk", true },
- { "red-button.hu", true },
- { "red-dead-rp.de", true },
- { "red-dead.life", true },
- { "red-t-shirt.ru", true },
- { "red-trigger.net", true },
- { "red031000.com", true },
- { "red2fred2.com", true },
- { "redable.hosting", true },
- { "redactieco.nl", true },
- { "redb.cz", true },
- { "redballoonsecurity.com", true },
- { "redburn.com", true },
- { "redcarpetmonday.com", true },
- { "redcatrampageforum.com", true },
- { "redchip.com.au", true },
- { "redcoded.com", true },
- { "redcorus.com", true },
- { "redd.it", true },
- { "reddevilarmada.com", true },
- { "reddingo.at", true },
- { "reddingo.be", true },
- { "reddingo.ch", true },
- { "reddingo.com", true },
- { "reddingo.com.au", true },
- { "reddingo.de", true },
- { "reddingo.es", true },
- { "reddingo.eu", true },
- { "reddingo.fr", true },
- { "reddingo.it", true },
- { "reddingo.jp", true },
- { "reddingo.nl", true },
- { "reddingo.nz", true },
- { "reddingsbrigade-zwolle.nl", true },
- { "reddingsbrigadeveghel.nl", true },
- { "reddit.com", true },
- { "reddit2kindle.com", true },
- { "reddited.com", true },
- { "reddraggone9.com", true },
- { "reddyai.com", true },
- { "rede-reim.de", true },
- { "rede-t.com", true },
- { "redecsirt.pt", true },
- { "redeemingbeautyminerals.com", true },
- { "redeshoprural.com.br", true },
- { "redeyeguatemala.tk", true },
- { "redflare.com.au", true },
- { "redfox-infosec.de", true },
- { "redfoxmarketiing.com", true },
- { "redgatesoftware.co.uk", true },
- { "redgoose.ca", true },
- { "redgravity.net", true },
- { "redhandedsecurity.com.au", true },
- { "redheadfuck.com", true },
- { "redion.me", true },
- { "redir.me", true },
- { "redirect.fedoraproject.org", true },
- { "redirect.stg.fedoraproject.org", true },
- { "rediske.me", true },
- { "redivis.com", true },
- { "redjuice.co.uk", true },
- { "redkiwi.nl", true },
- { "redleslie.com", true },
- { "redlinelap.com", true },
- { "redlink.de", true },
- { "redmangallpsychologists.com.au", true },
- { "redmind.se", true },
- { "redmondtea.com", true },
- { "redmoon.cloud", true },
- { "redmore.me", true },
- { "redneragenturen.org", true },
- { "rednsx.org", true },
- { "rednumberone.com", true },
- { "redpatronus.com", true },
- { "redpen.gr", true },
- { "redray.org", true },
- { "redrowcareers.co.uk", true },
- { "redscan.com", true },
- { "redsequence.com", true },
- { "redshoeswalking.net", true },
- { "redsicom.com", true },
- { "redstarpictures.tk", true },
- { "redstarsurf.com", true },
- { "redstoner.com", true },
- { "redteam-pentesting.de", true },
- { "redunion.tk", true },
- { "redwaterhost.com", true },
- { "redweek.com", true },
- { "redwhey.com", true },
- { "redwiki.tk", true },
- { "redworks.nl", true },
- { "reed-sensor.com", true },
- { "reedloden.com", true },
- { "reedyforkfarm.com", true },
- { "reeftrip.com", true },
- { "reegle.com", true },
- { "reening.net", true },
- { "rees-carter.net", true },
- { "reesmichael1.com", true },
- { "reevaappliances.co.uk", true },
- { "reeves-family.com", true },
- { "reezer.org", true },
- { "ref1oct.nl", true },
- { "refactor.zone", false },
- { "refer.codes", true },
- { "referat.club", true },
- { "referat.me", true },
- { "referdell.com", true },
- { "refinansiering.no", true },
- { "refinedroomsllc.com", true },
- { "refjob.jp", true },
- { "reflectiondentallasvegas.com", true },
- { "reflectores.net", true },
- { "refletindosaude.com.br", true },
- { "reflets.info", true },
- { "reflexions.co", true },
- { "reflexionspain.tk", true },
- { "reflexive.xyz", true },
- { "refluxogastroesofagico.ga", true },
- { "refood-cascaiscpr.eu", true },
- { "reformation.financial", true },
- { "refreshcartridges.co.uk", true },
- { "refreshliving.us", true },
- { "refrigeracionpeinado.com.mx", true },
- { "refu.net", true },
- { "refundo.cz", true },
- { "refundo.sk", true },
- { "regalcapitalwi.com", true },
- { "regalopublicidad.com", true },
- { "regalosymuestrasgratis.com", true },
- { "reganclassics.co.uk", true },
- { "reganclassics.com", true },
- { "reganparty.com", true },
- { "regar42.fr", false },
- { "regata2015.tk", true },
- { "regeneo.cz", true },
- { "regeneracjalamp.eu", true },
- { "regenerapoint.it", true },
- { "regenerescence.com", true },
- { "regenpod.com", true },
- { "regensburg-repariert.de", true },
- { "reginaclinic.jp", true },
- { "reginfo.gov", true },
- { "regiobeveland.nl", true },
- { "region-vologda.tk", true },
- { "regionalbasementandcrawlspacerepair.com", true },
- { "regionalgrowth.com", true },
- { "regiosalland.nl", true },
- { "regiovertrieb.de", false },
- { "regis.tech", true },
- { "regisearch.co.uk", true },
- { "registerex.me", true },
- { "registerforevent.co.uk", true },
- { "registerra.nl", true },
- { "registr.io", true },
- { "registrar.io", true },
- { "registrarplus.net", true },
- { "registrarplus.nl", true },
- { "registry.google", true },
- { "registryplus.net", true },
- { "registryplus.nl", true },
- { "regmyr.se", true },
- { "regnr.info", true },
- { "regolithmedia.com", true },
- { "regon.hu", true },
- { "regraph.de", true },
- { "regresionavidaspasadas.com", true },
- { "regsec.com", true },
- { "regularflolloping.com", true },
- { "regularizaeudora.com.br", true },
- { "regulations.gov", true },
- { "reha-honpo.jp", true },
- { "rehabili-shigoto.com", true },
- { "rehabthailand.com", true },
- { "rehabthailand.org", true },
- { "rei.ki", true },
- { "reichardt-home.goip.de", true },
- { "reichel-steinmetz.de", true },
- { "reichelt-cloud.de", true },
- { "reiciunas.lt", true },
- { "reidasbombas.com", true },
- { "reifr.net", true },
- { "reiki-france.fr", true },
- { "reilly.io", true },
- { "reimaginebelonging.de", true },
- { "reimaginebelonging.org", true },
- { "reimann.me", true },
- { "reimers.de", true },
- { "rein.kr", true },
- { "reinaertvandecruys.com", true },
- { "reinaldudras.ee", true },
- { "reinaldudrasfamily.ee", true },
- { "reindersfoodfashion.nl", true },
- { "reinencaressa.be", true },
- { "reinfer.io", true },
- { "reinhardtsgermanautorepair.com", true },
- { "reinhardtsgrimma.de", true },
- { "reinhart-auto.cz", true },
- { "reinierjonker.nl", true },
- { "reinout.nu", true },
- { "reinouthoornweg.nl", true },
- { "reinventetoi.com", false },
- { "reisenbauer.ee", true },
- { "reiseversicherung-werner-hahn.de", true },
- { "reishunger.de", true },
- { "reissnehme.com", true },
- { "reitoracle.com", true },
- { "reitstall-goettingen.de", true },
- { "reittherapie-tschoepke.de", true },
- { "rejahrehim.com", true },
- { "rejects.email", true },
- { "rejido.tk", true },
- { "rejsehuskelisten.dk", true },
- { "rekisuta.com", true },
- { "reklamjog.hu", true },
- { "rekorsanat.com.tr", true },
- { "rekurasi.com", true },
- { "relaispourlavie.net", true },
- { "relates.link", true },
- { "relax.hn", true },
- { "relaxdom.net", true },
- { "relaxhavefun.com", true },
- { "relaxpointhyncice.cz", true },
- { "release-monitoring.org", true },
- { "releasepoint.com", true },
- { "reliableremovals-blackpool.co.uk", true },
- { "reliancebank.bank", true },
- { "relojeriajoyeria.com", true },
- { "relojes-online.com", true },
- { "rem0te.net", true },
- { "remaimodern.org", true },
- { "remambo.jp", true },
- { "remarketable.org", true },
- { "remax.at", true },
- { "remeb.de", true },
- { "remedi.tokyo", true },
- { "remedionaturales.com", true },
- { "rememberthemilk.com", false },
- { "remetall.cz", true },
- { "remi-saurel.com", true },
- { "remiafon.com", true },
- { "remilner.co.uk", true },
- { "remini.cz", true },
- { "reminisceaudio.com", true },
- { "remirampin.com", true },
- { "remissan.com", true },
- { "remitano.com", true },
- { "remmik.com", true },
- { "remodeus.com", true },
- { "remont-kvartirvmoskve.ga", true },
- { "remont-naushnikov.tk", true },
- { "remont-p.com", true },
- { "remonti.info", true },
- { "remotedesktop.corp.google.com", true },
- { "remoteham.com", true },
- { "remoteoffice.ga", true },
- { "remoteutilities.com", true },
- { "remptmotors.com", true },
- { "remrol.ru", true },
- { "rena.cloud", true },
- { "renaissanceplasticsurgery.net", true },
- { "renanoliveira.design", true },
- { "renaultclubticino.ch", false },
- { "rendall.tv", true },
- { "render.com", true },
- { "renderloop.com", true },
- { "rene-schwarz.com", true },
- { "rene-stolp.de", true },
- { "renearends.nl", true },
- { "renedekoeijer.com", true },
- { "reneleu.ch", true },
- { "renem.net", false },
- { "renemayrhofer.com", false },
- { "reneschmidt.de", true },
- { "renewablefreedom.org", true },
- { "renewablemaine.org", true },
- { "renewed.technology", true },
- { "renewmedispa.com", true },
- { "renewpfc.com", true },
- { "renezuo.com", true },
- { "renkenlaw.com", true },
- { "renlen.nl", true },
- { "renoovodesign.ltd", true },
- { "renov8sa.co.za", true },
- { "renovablesverdes.com", true },
- { "renovandoingresos.com", true },
- { "renovum.es", true },
- { "renrenche.com", false },
- { "rens.nu", true },
- { "rensa-datorn.se", true },
- { "rent-a-c.io", true },
- { "rent-a-coder.de", true },
- { "rentacaramerica.com", true },
- { "rentandgo.it", true },
- { "rentasweb.gob.ar", true },
- { "renthelper.us", true },
- { "rentinsingapore.com.sg", true },
- { "rentourhomeinprovence.com", true },
- { "rentsbg.com", true },
- { "rentta.fashion", true },
- { "renuo.ch", true },
- { "renyiyou.com", true },
- { "reorz.com", false },
- { "reox.at", false },
- { "repaik.com", true },
- { "repairguy.dk", true },
- { "repalcateia.com.br", true },
- { "repaper.org", true },
- { "reparacionesdecalefones.com", true },
- { "reparacionmovilesmurcia.com", true },
- { "reparizy.com", true },
- { "replenology.com", true },
- { "repliksword.com", true },
- { "repo.ml", true },
- { "repology.org", true },
- { "report-uri.com", true },
- { "report2psb.online", true },
- { "reportband.gov", true },
- { "reporting.gov", true },
- { "reproduciblescience.org", true },
- { "reproductive-revolution.com", true },
- { "reproductiverevolution.com", true },
- { "reprogramming-predators.com", true },
- { "reprogrammingpredators.com", true },
- { "reprowesty.com", true },
- { "reprozip.org", true },
- { "repsomelt.com", true },
- { "reptrax.com", true },
- { "reptv.online", true },
- { "republic.gr", true },
- { "republicghana.com", true },
- { "republictelecom.net", true },
- { "republique.org", true },
- { "repuestosmedellin.com", true },
- { "repugnant-conclusion.com", true },
- { "repugnantconclusion.com", true },
- { "reputatiedesigners.nl", true },
- { "reputationweaver.com", true },
- { "requestr.co.uk", true },
- { "require.software", true },
- { "reroboto.com", true },
- { "reroboto.eu", true },
- { "reroboto.net", true },
- { "reroboto.org", true },
- { "resama.eu", true },
- { "resanebartar.tk", true },
- { "resch.io", true },
- { "rescms-secure.com", true },
- { "rescuer.gq", true },
- { "resdon.cn", true },
- { "research-panel.jp", true },
- { "research.facebook.com", false },
- { "researchgate.net", true },
- { "researchstory.com", true },
- { "reseausyndic.ca", true },
- { "reservar-un-hotel.com", true },
- { "reserve-duchenier.com", true },
- { "reshka.ga", true },
- { "residence-donatello.be", true },
- { "residence-simoncelli.com", true },
- { "residentiallocksmithdallas.com", true },
- { "resilientlives.com", true },
- { "resine.roma.it", true },
- { "resinflooringcompany.com", true },
- { "resist.ca", true },
- { "resnickandnash.com", true },
- { "resolvefa.co.uk", true },
- { "resolvefa.com", true },
- { "resolving.com", true },
- { "resoplus.ch", false },
- { "resort-islands.net", true },
- { "resortafroditatucepi.com", true },
- { "resortohshima.com", true },
- { "resorts.ru", true },
- { "resourceconnect.com", true },
- { "resourceguruapp.com", true },
- { "resources.flowfinity.com", true },
- { "resourcesmanagementcorp.com", true },
- { "respectmyprivacy.eu", true },
- { "respectmyprivacy.net", true },
- { "respectmyprivacy.nl", true },
- { "respecttheflame.com", true },
- { "respiranto.de", true },
- { "respon.jp", false },
- { "responer.com", true },
- { "respons.je", true },
- { "respons.me", true },
- { "respons.mobi", true },
- { "respons.us", true },
- { "respons.ws", true },
- { "responscode.eu", true },
- { "responscode.info", true },
- { "responscode.mobi", true },
- { "responscode.nl", true },
- { "responsecode.info", true },
- { "responsecode.mobi", true },
- { "responsecode.nl", true },
- { "responsepartner.com", true },
- { "responsibledisclosure.nl", false },
- { "responsive-shop.com", true },
- { "responsivepaper.com", true },
- { "respostas.com.br", true },
- { "resqdesk.com", true },
- { "ressl.ch", true },
- { "ressupply.com", true },
- { "restaurant-de-notenkraker.be", true },
- { "restaurant-fujiyama.fr", true },
- { "restaurant-oregano.de", true },
- { "restaurantedonono.com.br", true },
- { "restauranttester.at", true },
- { "restauriedili.roma.it", true },
- { "restoran-radovce.me", true },
- { "restoran.cf", true },
- { "restorethegulf.gov", true },
- { "restoringhopeberks.org", true },
- { "restoruns.com", true },
- { "restoruns.xyz", true },
- { "restrealitaet.de", true },
- { "restrito.org", true },
- { "resultsatretail.com", true },
- { "resume4dummies.com", true },
- { "resumelab.com", true },
- { "resumeprime.com", true },
- { "resumeprofessionalwriters.com", true },
- { "resumeshoppe.com", true },
- { "resursedigitale.ro", true },
- { "retailcybersolutions.com", true },
- { "retailing.cf", true },
- { "retefarmaciecostadamalfi.it", true },
- { "retetop95.it", true },
- { "reticket.me", true },
- { "reticon.de", true },
- { "retidurc.fr", true },
- { "retireearlyandtravel.com", true },
- { "retirest.com", true },
- { "retmig.dk", true },
- { "reto.ch", false },
- { "reto.com", false },
- { "reto.io", true },
- { "retokromer.ch", false },
- { "retornaz.com", true },
- { "retornaz.eu", true },
- { "retornaz.fr", true },
- { "retractableawningssydney.com.au", true },
- { "retraitebysaulsplace.nl", true },
- { "retro-game.org", true },
- { "retro.rocks", true },
- { "retro.sx", true },
- { "retroarms.com", true },
- { "retroarms.cz", true },
- { "retrocdn.net", true },
- { "retrofitlab.com", true },
- { "retroity.net", true },
- { "retronet.nl", true },
- { "retropack.org", true },
- { "retroride.cz", true },
- { "retroroundup.com", true },
- { "retrotown.ws", true },
- { "retrotracks.net", true },
- { "retrovideospiele.com", true },
- { "rettig.xyz", false },
- { "returnonerror.com", true },
- { "returnpath.com", true },
- { "retzer.me", true },
- { "reucon.com", true },
- { "reuna.me", true },
- { "reussirsavie.info", true },
- { "reut42.de", true },
- { "reuter-profishop.de", true },
- { "reuter.de", true },
- { "reuzenplaneten.nl", true },
- { "revamed.com", false },
- { "revampweb-development.azurewebsites.net", true },
- { "revayd.net", true },
- { "revealdata.com", true },
- { "revensoftware.com", true },
- { "reverencestudios.com", true },
- { "reverseaustralia.com", true },
- { "reversecanada.com", true },
- { "reverseloansolutions.com", true },
- { "reverselookupphone.us", true },
- { "reversesouthafrica.com", true },
- { "reviderm-skinmedics-rheinbach.de", true },
- { "review.jp", true },
- { "reviewbestseller.com", true },
- { "reviewcenter.in", true },
- { "reviewgeek.com", true },
- { "reviewninja.net", true },
- { "reviews.anime.my", false },
- { "reviewu.ca", true },
- { "revirt.global", true },
- { "revisionnotes.xyz", true },
- { "revisores.pt", true },
- { "revisoronline.ml", true },
- { "revista-programar.info", true },
- { "revistabifrontal.com", true },
- { "revistadiscover.com", true },
- { "revistasomos.com", true },
- { "revivalinhisword.com", true },
- { "revivalprayerfellowship.com", true },
- { "reviveplumbingmelbourne.com.au", true },
- { "revivingtheredeemed.org", true },
- { "revizor-online.gq", true },
- { "revizor-online.tk", true },
- { "revlect.com", true },
- { "revolutionaryaim-vienna.tk", true },
- { "revuestarlight.me", true },
- { "revworld.org", true },
- { "rewardingexcellence.com", true },
- { "rex.tc", true },
- { "rexdf.net", true },
- { "rexfinland.fi", true },
- { "rexskz.info", true },
- { "rexxworld.com", true },
- { "reyna.cc", true },
- { "rezenfitness.com", true },
- { "rezept-planer.de", true },
- { "rezio.io", true },
- { "rezka-burenie.cf", true },
- { "rezultant.ru", true },
- { "rezun.cloud", true },
- { "rfid-basis.de", true },
- { "rfid-grundlagen.de", true },
- { "rfid-schutz.de", true },
- { "rfid-schutz.org", true },
- { "rfid-sicherheit.com", true },
- { "rfxanalyst.com", true },
- { "rfxt.com", true },
- { "rga.sh", true },
- { "rgbinnovation.com", true },
- { "rgbpty.com", true },
- { "rgcomportement.fr", false },
- { "rggraphics.mx", true },
- { "rgpdkit.io", true },
- { "rgraph.net", true },
- { "rgz.ee", true },
- { "rhaegal.me", true },
- { "rhamzeh.com", true },
- { "rhaniegghe.be", true },
- { "rhaniegghesoftwaresecurity.be", true },
- { "rhd-instruments.com", true },
- { "rhd-instruments.de", true },
- { "rhees.nl", true },
- { "rheijmans.com", true },
- { "rheijmans.email", true },
- { "rhein-liebe.de", true },
- { "rheinneckarmetal.com", true },
- { "rhese.net", true },
- { "rhetorical.ml", false },
- { "rhetthenckel.com", true },
- { "rhhfoamsystems.com", true },
- { "rhinelander.ca", true },
- { "rhinobase.net", false },
- { "rhinoceroses.org", true },
- { "rhodenmanorcattery.co.uk", true },
- { "rhodri.io", true },
- { "rhowell.io", true },
- { "rhubarb.land", true },
- { "rhumblineadvisers.com", true },
- { "rhycloud.com", true },
- { "rhymc.com", true },
- { "rhyme.com", true },
- { "rhymeswithmogul.com", true },
- { "rhymix.org", true },
- { "rhynl.io", true },
- { "riajenaka.com", true },
- { "riaki.net", true },
- { "rial.space", true },
- { "riaucybersolution.net", false },
- { "riba-lov.ga", true },
- { "ribella.net", true },
- { "ribtours.co", true },
- { "ricardo.nu", true },
- { "ricardobalk.nl", true },
- { "ricardopq.com", true },
- { "ricardotaakehb.tk", true },
- { "ricaud.me", true },
- { "riccardopiccioni.it", true },
- { "ricci-ingenieria.com", true },
- { "riccy.org", true },
- { "riceadvice.info", true },
- { "richadams.me", true },
- { "richardbloomfield.blog", true },
- { "richardcrosby.co.uk", true },
- { "richardharpur.com", true },
- { "richardhicks.us", true },
- { "richardjgreen.net", true },
- { "richardlangham.plumbing", true },
- { "richardlangworth.com", true },
- { "richardlevinmd.com", true },
- { "richardlugten.nl", true },
- { "richardramos.me", true },
- { "richardrblocker.net", true },
- { "richardschut.nl", true },
- { "richardson.cam", true },
- { "richardson.engineering", true },
- { "richardson.pictures", true },
- { "richardson.software", true },
- { "richardson.systems", true },
- { "richardson.tw", true },
- { "richardstonerealestate.com", true },
- { "richardwarrender.com", true },
- { "richbutler.co.uk", true },
- { "richcat.tw", true },
- { "richecommecresus.com", true },
- { "richelelahaise.nl", true },
- { "richeyweb.com", true },
- { "richie.fi", true },
- { "richie.one", true },
- { "richie.pm", true },
- { "richieheijmans.com", true },
- { "richieheijmans.email", true },
- { "richieheijmans.eu", true },
- { "richieheijmans.io", true },
- { "richieheijmans.nl", true },
- { "richlj.net", true },
- { "ricketyspace.net", true },
- { "ricki-z.com", true },
- { "rickmakes.com", true },
- { "rickrongen.nl", true },
- { "rickscastles.co.uk", true },
- { "ricksfamilycarpetcleaning.com", true },
- { "rickvanderzwet.nl", true },
- { "rickweijers.nl", true },
- { "rickyromero.com", true },
- { "ricobaldegger.ch", true },
- { "ricochet.im", true },
- { "ricordisiciliani.it", true },
- { "ricozienke.de", true },
- { "ridadihouse.com", true },
- { "riddimsworld.com", true },
- { "riddler.com.ar", true },
- { "rideapart.com", true },
- { "rideintaxi.com", true },
- { "rident-estetic.ro", true },
- { "rides-japan.jp", true },
- { "rideways.com", true },
- { "rideyourdamn.bike", true },
- { "ridhaan.co", true },
- { "ridingboutique.de", true },
- { "rido.ml", true },
- { "riechsteiner.tech", true },
- { "riesenweber.id.au", true },
- { "riesheating.com", true },
- { "rievo.net", true },
- { "riffelhaus.ch", true },
- { "riffreporter.de", true },
- { "rift.pictures", true },
- { "rigabeerbike.com", true },
- { "riggosrag.com", true },
- { "righettod.eu", true },
- { "righini.ch", false },
- { "rightbrain.training", true },
- { "rightfold.io", true },
- { "rightlaw.nz", true },
- { "rightmovecanada.com", true },
- { "rightnetworks.com", true },
- { "rightoncorpus.com", true },
- { "rightreview.co.uk", true },
- { "rights.ninja", true },
- { "rightsolutionplumbing.com.au", true },
- { "rightstuff.link", false },
- { "righttobuy.gov.uk", true },
- { "rigsalesaustralia.com", true },
- { "riight.online", true },
- { "riimihaku.fi", true },
- { "rijk-catering.nl", false },
- { "rijschoolrichardschut.nl", true },
- { "rijschoolsafetyfirst.nl", true },
- { "rijsinkunst.nl", true },
- { "rik.onl", true },
- { "riklewis.com", true },
- { "riku.pw", true },
- { "rile5.com", true },
- { "rileyskains.com", true },
- { "rilish.cf", true },
- { "rimax.vn", true },
- { "rimcountrymuseum.org", true },
- { "rime.com.hr", true },
- { "rimeto.io", true },
- { "rimkereso.hu", true },
- { "rimo.site", false },
- { "rimorrecherche.nl", true },
- { "ringingliberty.com", true },
- { "ringjewellery.co.uk", true },
- { "ringofglory.gq", true },
- { "rinkhill.com", true },
- { "rinsepimp.com", true },
- { "rinvex.com", true },
- { "rio-weimar.de", true },
- { "riograndesurgeons.com", true },
- { "rioxmarketing.com", true },
- { "rioxmarketing.pt", true },
- { "rioxmarketing.us", true },
- { "rip-sport.cz", true },
- { "ripa.io", true },
- { "ripaton.fr", true },
- { "ripcorddesign.com", true },
- { "ripcordsandbox.com", true },
- { "ripley.red", true },
- { "ripmixmake.org", true },
- { "ripp-it.com", true },
- { "ripple.com", true },
- { "riproduzionichiavi.it", true },
- { "riptidetech.io", true },
- { "riptoforex.com", true },
- { "riqy86.nl", true },
- { "ris-bad-wurzach.de", true },
- { "ris.fi", true },
- { "risada.nl", true },
- { "risaphuketproperty.com", false },
- { "riscascape.net", true },
- { "rischard.org", true },
- { "rise-technologies.com", true },
- { "rise.global", true },
- { "riseup.net", true },
- { "rishikeshyoga.in", true },
- { "risiinfo.com", true },
- { "risounokareshi.com", true },
- { "risparmiare.info", true },
- { "ristioja.ee", true },
- { "ristisanat.fi", true },
- { "ristoarea.it", true },
- { "ristorantefattoamano.it", true },
- { "ristorantelittleitaly.com", true },
- { "ristorantesamarkand.it", true },
- { "ristoviitanen.fi", true },
- { "ristrutturazioneappartamenti.milano.it", true },
- { "ristrutturazioneappartamento.roma.it", true },
- { "ristrutturazioniappartamentinapoli.it", true },
- { "risxx.com", true },
- { "rit.space", true },
- { "ritel.nl", true },
- { "riteway.rocks", true },
- { "ritewayconcrete.com", true },
- { "ritirocalcinacci.viterbo.it", true },
- { "ritsu-life.com", true },
- { "rittau.biz", true },
- { "rittau.org", true },
- { "ritzlux.com.tw", true },
- { "rivaforum.de", true },
- { "rivalsa.cn", true },
- { "rivastation.de", true },
- { "riverbanktearooms.co.uk", true },
- { "riverbendroofingnd.com", true },
- { "riverford.co.uk", true },
- { "rivermist.com.au", true },
- { "riveroacessorios.com", true },
- { "riverridgecc.com", true },
- { "rivers.gov", true },
- { "riversidebaptistchurch.net", true },
- { "riversideradio.nl", true },
- { "riversmeet.co.uk", true },
- { "riverviewcourtapts.com", true },
- { "riverweb.gr", true },
- { "rivierasaints.ch", false },
- { "rivoflor.it", true },
- { "rivus.net", true },
- { "riwick.com", false },
- { "rix.ninja", true },
- { "rixter.com", false },
- { "riyono.com", true },
- { "rizarus.com", true },
- { "rizospastis.gr", true },
- { "rj-onderneemt.nl", true },
- { "rjan.nl", true },
- { "rjrplay.com", true },
- { "rk.mk", true },
- { "rkfp.cz", true },
- { "rkmns.edu.in", true },
- { "rlahaise.nl", true },
- { "rlalique.com", true },
- { "rld.org", true },
- { "rlds.ch", false },
- { "rleeden.servehttp.com", true },
- { "rleh.de", true },
- { "rlove.org", true },
- { "rm-it.de", true },
- { "rmb.li", true },
- { "rmcbs.de", true },
- { "rmdscreen.com", true },
- { "rmeuropean.com", true },
- { "rmit.me", true },
- { "rmm-i.com", true },
- { "rmmanfredi.com", true },
- { "rmrig.org", true },
- { "rms.sexy", true },
- { "rmstudio.tw", true },
- { "rmsupply.nl", true },
- { "rnag.ie", true },
- { "rnbjunk.com", true },
- { "rngmeme.com", true },
- { "ro.search.yahoo.com", false },
- { "roach.nz", true },
- { "roachesofficial.com", true },
- { "roaddoc.de", true },
- { "roadguard.nl", false },
- { "roadtochina.tk", true },
- { "roadtripusa.tk", true },
- { "roalogic.com", true },
- { "roamfreun.tk", true },
- { "roams.es", true },
- { "roams.mx", true },
- { "rob006.net", true },
- { "robandjanine.com", true },
- { "robbiecrash.me", true },
- { "robdavidson.network", true },
- { "robert-foster.com", true },
- { "robert-wiek-transporte.de", true },
- { "robertattfield.com", true },
- { "robertayamashita.com", true },
- { "robertayamashita.com.br", true },
- { "robertbln.com", true },
- { "robertcrain.com.au", true },
- { "robertg.me", true },
- { "robertglastra.com", true },
- { "roberthurlbut.com", true },
- { "robertkotlermd.com", true },
- { "robertkrueger.de", true },
- { "robertlysik.com", true },
- { "robertnankervis.com", true },
- { "robertnemec.com", true },
- { "robertoentringer.com", false },
- { "robertof.ovh", true },
- { "robertopazeller.ch", true },
- { "robertoullan.tk", true },
- { "robertreiser.photography", true },
- { "robertrijnders.nl", true },
- { "robertsmits.be", false },
- { "robgorman.ie", true },
- { "robhorstmanshof.nl", true },
- { "robigalia.org", false },
- { "robin.co.kr", true },
- { "robin.info", true },
- { "robinevandenbos.nl", true },
- { "robinflikkema.nl", true },
- { "robinhoodbingo.com", true },
- { "robinlinden.eu", true },
- { "robinsonyu.com", true },
- { "robinwill.de", true },
- { "robinwinslow.uk", true },
- { "robison.pro", true },
- { "robisonweb.net", true },
- { "robjager-fotografie.nl", true },
- { "robocop.no", true },
- { "robodeal.cc", true },
- { "robodeidentidad.gov", true },
- { "roboex.net", true },
- { "robohash.org", true },
- { "robokits.co.in", true },
- { "robot.car", true },
- { "robotattack.org", true },
- { "robotenmihogar.com", true },
- { "robotham.org", true },
- { "robotkvarnen.se", true },
- { "robototes.com", true },
- { "robots-ju.ch", true },
- { "robotsbigdata.com", true },
- { "robotstxt.com", true },
- { "robottip.com", true },
- { "robpol86.com", true },
- { "robspc.repair", true },
- { "robspeed.rocks", true },
- { "robsutter.com", true },
- { "robtatemusic.com", true },
- { "robtex.com", true },
- { "robu.in", true },
- { "robud.info", true },
- { "robustac.com", true },
- { "rochakhand-knitcraft.com.np", true },
- { "rochesterglobal.com", true },
- { "rocis.gov", true },
- { "rocka.me", true },
- { "rockagogo.com", true },
- { "rockbankland.com.au", true },
- { "rockcanyonbank.com", true },
- { "rockefellergroup.info", true },
- { "rocket-resume.com", true },
- { "rocketevents.com.au", true },
- { "rocketmill.co.uk", true },
- { "rocketr.net", true },
- { "rocketsandtutus.com", true },
- { "rockinronniescastles.co.uk", true },
- { "rockitinflatables.co.uk", true },
- { "rocknwater.com", true },
- { "rockpesado.com.br", true },
- { "rockslideengineering.com", true },
- { "rockthebabybump.com", true },
- { "rockymountainspice.com", true },
- { "rockypest.com.au", true },
- { "rocssti.net", true },
- { "rodchapman.com", true },
- { "rodelstein.eu", true },
- { "rodeobull.biz", true },
- { "rodeohire.com", true },
- { "rodeoimport.com", true },
- { "rodeosales.co.uk", true },
- { "rodest.net", true },
- { "rodevlaggen.nl", true },
- { "rodichi.net", true },
- { "rodinka.tk", true },
- { "rodinnebyvanie.eu", true },
- { "rodolfo.gs", true },
- { "rodomonte.org", true },
- { "rodrigoacevedo.com.uy", true },
- { "rodrigocarvalho.blog.br", true },
- { "rody-design.com", true },
- { "rodykossen.com", true },
- { "roeckx.be", true },
- { "roeitijd.nl", false },
- { "roelenscitynews.ml", true },
- { "roeleveld.nl", true },
- { "roelhollander.eu", true },
- { "roelof.io", true },
- { "roelsworld.eu", true },
- { "roemhild.de", true },
- { "roerstaafjes.nl", true },
- { "rofai.biz", true },
- { "rofl.com.ua", true },
- { "rogagym.com", true },
- { "rogerhub.com", true },
- { "rogerkunz.ch", true },
- { "rogerriendeau.ca", true },
- { "rogersaam.ch", false },
- { "rogersnowing.cn", true },
- { "rogersremovals.co.uk", true },
- { "rogersvilleumc.org", true },
- { "rognhaugen.no", true },
- { "rogoff.xyz", true },
- { "roguefortgame.com", true },
- { "roguenation.space", true },
- { "roguenetworks.me", true },
- { "roguerocket.com", true },
- { "roguesignal.net", true },
- { "roh.one", true },
- { "rohde.de", true },
- { "rohedaten.de", true },
- { "rohitagr.com", true },
- { "rohlik.cz", true },
- { "rohrle.com", true },
- { "roi.ovh", true },
- { "rointe.online", true },
- { "roisu.org", true },
- { "roka9.de", true },
- { "rokass.nl", true },
- { "rokki.ch", true },
- { "roko-foto.de", true },
- { "rokort.dk", true },
- { "rokudenashi.de", true },
- { "roland.io", true },
- { "rolandlips.nl", true },
- { "rolandozarate.tk", true },
- { "rolandreed.cn", true },
- { "rolandszabo.com", true },
- { "rolandvanipenburg.com", true },
- { "rolecontj.com", true },
- { "rolleyes.org", true },
- { "rollforadventure.com.au", true },
- { "rollingbarge.com", true },
- { "rolob.io", true },
- { "rolodato.com", true },
- { "roma-servizi.it", true },
- { "romab.com", true },
- { "romacoffee.co.nz", true },
- { "romail.ml", true },
- { "romain-arias.fr", true },
- { "romaindepeigne.fr", true },
- { "romainlapoux.com", true },
- { "romainlapoux.fr", true },
- { "roman-pavlik.cz", true },
- { "roman.systems", true },
- { "romancoinsforsale.org", false },
- { "romande-entretien.ch", true },
- { "romanian.cam", true },
- { "romanmichel.de", true },
- { "romanpavlodar.kz", true },
- { "romantelychko.com", true },
- { "romantica-hotel.de", true },
- { "romanticasfm.com", true },
- { "romanticschemer.com", true },
- { "romanticsexshopguatemala.com", true },
- { "romanticvillas.com.au", false },
- { "romapa.com", true },
- { "romarin.es", true },
- { "romaservicegroup.it", true },
- { "romatrip.it", true },
- { "rome.dating", true },
- { "rommelhuntermusic.tk", true },
- { "rommelwood.de", true },
- { "romo-holidays.de", true },
- { "romo-holidays.dk", true },
- { "romtex.co.uk", true },
- { "ronan-hello.fr", true },
- { "ronbongamis.com", true },
- { "roncallijets.net", true },
- { "rondommen.nl", true },
- { "rondouin.fr", true },
- { "rondreis-amerika.be", true },
- { "rondreis-schotland.nl", true },
- { "ronem.com.au", true },
- { "roninf.ch", true },
- { "roninitconsulting.com", true },
- { "ronniegane.kiwi", true },
- { "ronnylindner.de", true },
- { "ronomon.com", true },
- { "ronsguideservice.com", true },
- { "ronvil.com", true },
- { "roodfruit.studio", true },
- { "roodhealth.co.uk", true },
- { "roof.ai", false },
- { "roofconsultants-inc.com", true },
- { "roofer.cf", true },
- { "roofingandconstructionllc.com", true },
- { "roofingomaha.com", true },
- { "roofsandbasements.com", true },
- { "roohanionlinespiritualhelp.co.uk", true },
- { "rook-playz.net", true },
- { "rookiehpc.com", true },
- { "rookvrij.nl", true },
- { "room-composite.com", true },
- { "room208.org", true },
- { "room3b.eu", true },
- { "roombase.nl", true },
- { "roomee.tk", true },
- { "roomguide.info", true },
- { "roomhub.jp", true },
- { "roomkey.com", true },
- { "roomlab.cl", true },
- { "roomsatevents.eu", true },
- { "rooneytours.nl", true },
- { "roopakv.com", true },
- { "roopakvenkatakrishnan.com", true },
- { "roosabels.nl", false },
- { "rooselaers.com", true },
- { "roosta.xyz", true },
- { "root-books.gq", true },
- { "root-books.ml", true },
- { "root-couture.de", true },
- { "root-space.eu", true },
- { "root.bg", true },
- { "root.cz", true },
- { "root.eu.org", true },
- { "root.vg", true },
- { "rootcamp.net", true },
- { "rootcommand.com", true },
- { "rootear.com", true },
- { "rootedlifemontessori.com", true },
- { "rootetsy.com", true },
- { "rootie.de", true },
- { "rootkea.me", true },
- { "rootlair.com", true },
- { "rootonline.de", true },
- { "rootpigeon.com", true },
- { "roots-example-project.com", true },
- { "roots.io", true },
- { "rootsandrain.com", true },
- { "rootsbar.fr", false },
- { "rootscope.co.uk", false },
- { "rootstation.de", true },
- { "rootswitch.com", false },
- { "rootusers.com", true },
- { "rootze.com", true },
- { "ropd.info", true },
- { "rory.best", true },
- { "roryneville.com", true },
- { "rosa-spain.tk", true },
- { "rosabellas.co.uk", true },
- { "rosalindgreenllc.com", true },
- { "rosalindturner.co.uk", true },
- { "rosbass.ru", true },
- { "rosbiznes.tk", true },
- { "rose-prism.org", true },
- { "rosebankplumber24-7.co.za", true },
- { "roseberyvenues.co.uk", true },
- { "rosecrance.org", true },
- { "rosehosting.reviews", true },
- { "roseitsolutions.co.uk", true },
- { "roseitsolutions.uk", true },
- { "roseliere.ch", false },
- { "roseliere.com", false },
- { "roseluna.com", true },
- { "rosenheim-wladiwostok.de", true },
- { "rosenheimsingles.de", true },
- { "rosenkeller.org", true },
- { "roseon.net", true },
- { "roseparkhouse.com", true },
- { "rosesciences.com", true },
- { "rosevillefacialplasticsurgery.com", true },
- { "roshhashanahfun.com", true },
- { "rosi-royal.com", true },
- { "rosiervandenbosch.nl", true },
- { "roslynpad.net", true },
- { "rosnertexte.at", true },
- { "rosrabota.tk", true },
- { "rosset.me", true },
- { "rosset.net", true },
- { "rossfrance.com", true },
- { "rossiworld.com", true },
- { "rossmacphee.com", true },
- { "rossome.org", true },
- { "rosstroj-balashiha.ml", true },
- { "rosswilson.co.uk", true },
- { "rostclub.ro", true },
- { "rostov-avia.ru", true },
- { "rot47.net", true },
- { "rotamap.net", true },
- { "rotaractclubtucuman.tk", true },
- { "rotate4all.com", true },
- { "rotek.at", true },
- { "roten.email", true },
- { "rothbruederlein.tk", true },
- { "rothe.io", true },
- { "rothkranz.net", true },
- { "rothwellgornthomes.com", true },
- { "rotkreuzshop.de", true },
- { "rotol.me", true },
- { "rotring.com", true },
- { "rottamazioni.it", true },
- { "rottweil-hilft.de", true },
- { "rotunneling.net", true },
- { "rougechocolat.fr", true },
- { "roughcopy.com.au", true },
- { "roughgrain.com", true },
- { "roughtime.se", true },
- { "roulettecarnival.com", true },
- { "roulinfo.ch", false },
- { "roulons-autrement.com", true },
- { "rounda.it", true },
- { "roundaboutweb.net", true },
- { "roundcube.mayfirst.org", false },
- { "roundrock-locksmith.com", true },
- { "roundtablekzn.co.za", true },
- { "roundtheme.com", false },
- { "roundtoprealestate.com", true },
- { "roussos.cc", true },
- { "roussosmanos.gr", true },
- { "rout0r.org", true },
- { "route-wird-berechnet.de", true },
- { "routerclub.ru", true },
- { "routetracker.co", true },
- { "roverglobal.ga", true },
- { "rowancasting.com", true },
- { "rowancasting.ie", true },
- { "rowancounty911.com", true },
- { "rowancounty911.org", true },
- { "rowancountyairport.com", true },
- { "rowancountync.gov", true },
- { "rowankaag.nl", true },
- { "rowanpubliclibrary.com", true },
- { "rowansheriff.com", true },
- { "rowansheriff.org", true },
- { "rowantransit.com", true },
- { "rowantransit.org", true },
- { "rowlog.com", true },
- { "roxburytech.tk", true },
- { "roxiesbouncycastlehire.co.uk", true },
- { "roxtri.cz", true },
- { "roy-buehring.de", true },
- { "roya-holding.com", true },
- { "royal-rangers.de", true },
- { "royal88.com", true },
- { "royalacademy.org.uk", true },
- { "royalasianescorts.co.uk", true },
- { "royalaubar.com", true },
- { "royalbeautyclinic.ir", true },
- { "royalbluewa3.cc", true },
- { "royalcavaliers.tk", true },
- { "royaleagletourism.com", true },
- { "royalfitnesschennai.in", true },
- { "royalkitchensandfurniture.co.ug", true },
- { "royalmarinesassociation.org.uk", true },
- { "royalmech.tk", true },
- { "royalnissanparts.com", true },
- { "royaloz.ma", true },
- { "royalpainters.co", true },
- { "royalpratapniwas.com", true },
- { "royalpub.net", true },
- { "royalrangers.fi", true },
- { "royalstylefit.com", true },
- { "royaltube.net", true },
- { "royalvortex.co", true },
- { "royaume-smoke.com", true },
- { "royceandsteph.com", true },
- { "roycewilliams.net", true },
- { "roygerritse.nl", true },
- { "roys.design", true },
- { "royveenendaal.com", true },
- { "rozalynne-dawn.ga", true },
- { "rozar.eu", true },
- { "rozhodce.cz", true },
- { "rpadonline.com", true },
- { "rpadovani.com", false },
- { "rpgcampaign.website", true },
- { "rpgmaker.es", true },
- { "rpherbig.com", true },
- { "rphyncice.cz", true },
- { "rpine.net", true },
- { "rpmdrivingschool.com.au", true },
- { "rpoplus.nl", true },
- { "rps-auto.com", true },
- { "rpus.co", true },
- { "rpy.xyz", true },
- { "rq-labo.jp", true },
- { "rraesthetics.com", true },
- { "rrailto.com", true },
- { "rrbt.eu", true },
- { "rrbt.net", true },
- { "rrbts.org", true },
- { "rrdesignsuisse.com", false },
- { "rrg-partner.ch", false },
- { "rrssww.space", true },
- { "rrudnik.com", true },
- { "rrvmz.cf", true },
- { "rrwolfe.com", true },
- { "rs-aktuell.net", true },
- { "rs-maschinenverleih.de", true },
- { "rs2ap33.com", true },
- { "rsa-erp.com", true },
- { "rsanahuano.com", true },
- { "rsap.ca", true },
- { "rsarchive.net", true },
- { "rsarchive.org", true },
- { "rsdisedezzari.it", true },
- { "rsec.kr", true },
- { "rsingermd.com", true },
- { "rsl.gd", true },
- { "rslnd.com", true },
- { "rsm-liga.de", true },
- { "rsmith.io", true },
- { "rsp-blogs.de", true },
- { "rsquare.nl", true },
- { "rsridentassist.com", true },
- { "rss.sh", false },
- { "rssfeedblast.com", true },
- { "rssfeedonline.tk", true },
- { "rssl.me", true },
- { "rssr.se", true },
- { "rsttraining.co.uk", true },
- { "rswow.ru", true },
- { "rsync.eu", false },
- { "rt22.ch", true },
- { "rtate.ca", true },
- { "rtate.se", true },
- { "rtcx.net", true },
- { "rtd.uk", true },
- { "rte.radio", true },
- { "rte2fm.ie", true },
- { "rteaertel.ie", true },
- { "rtechservices.io", true },
- { "rteguide.ie", true },
- { "rteinternational.ie", true },
- { "rtejr.ie", true },
- { "rtenews.eu", true },
- { "rteone.ie", true },
- { "rteplayer.com", true },
- { "rtesport.eu", true },
- { "rteworld.com", true },
- { "rtfch.ru", true },
- { "rtgnews.cf", true },
- { "rtho.me", true },
- { "rthsoftware.cn", true },
- { "rtmoran.org", true },
- { "rtrappman.com", true },
- { "rtsak.com", true },
- { "rtsr.ch", false },
- { "rttvvip.com", true },
- { "rtveen.nl", true },
- { "rtwcourse.com", true },
- { "ru-e-business.com", true },
- { "ru-music.com", false },
- { "ru-sprachstudio.ch", true },
- { "ru.search.yahoo.com", false },
- { "ruaneattorneys.com", true },
- { "ruanmi.de", true },
- { "rubbaduckee.tk", true },
- { "rubberfurs.org", true },
- { "rubberlegscastles.co.uk", true },
- { "rubbermaidoutlet.com", true },
- { "rubbleremovalhillcrest.co.za", true },
- { "rubbleremovalsbenoni.co.za", true },
- { "rubblerock.com", true },
- { "ruben.am", false },
- { "rubenbaer.ch", true },
- { "rubenbarbero.com", true },
- { "rubenbrito.net", true },
- { "rubenkruisselbrink.nl", true },
- { "rubenroy.com", true },
- { "rubenruiz.org", true },
- { "rubens.cloud", true },
- { "rubixstudios.com.au", true },
- { "rublacklist.net", true },
- { "ruby-auf-schienen.de", true },
- { "rubyist.im", true },
- { "rubyist.today", true },
- { "rubylabs.am", true },
- { "rubymartin.com.au", true },
- { "rubymediagroup.com", true },
- { "rubyonline.tk", true },
- { "rubyquincunx.com", true },
- { "rubyquincunx.org", true },
- { "rubytune.com", false },
- { "ruchka-mashinka.gq", true },
- { "rucksack-rauf-und-weg.de", true },
- { "ruckzuck-privatpatient.de", true },
- { "ruconsole.com", true },
- { "rud.is", true },
- { "rudating.tk", true },
- { "rudd-o.com", true },
- { "ruddick.org.uk", true },
- { "ruddick.uk", true },
- { "rudewiki.com", true },
- { "rudloff.pro", true },
- { "rudnikas.com", true },
- { "rudolph.life", true },
- { "rudolphmarketing.com", true },
- { "rudrastyh.com", true },
- { "rue-de-la-vieille.fr", true },
- { "rueduverre.com", true },
- { "rueegger.me", true },
- { "rueg.eu", true },
- { "ruerte.net", true },
- { "ruexpert.cf", true },
- { "ruf888.com", true },
- { "rufartabs.ml", true },
- { "ruffbeatz.com", true },
- { "ruffinstorage.com", true },
- { "ruffnecks.tk", true },
- { "rugcleaninglondon.co.uk", true },
- { "rugeley-vets.co.uk", true },
- { "rugk.dedyn.io", true },
- { "rugsandmore.co.nz", true },
- { "ruh-veit.de", true },
- { "ruha.co.in", true },
- { "ruhnke.cloud", true },
- { "ruhproject.kz", true },
- { "ruhrmobil-e.de", true },
- { "ruhrnalist.de", true },
- { "ruht.ro", true },
- { "ruicore.cn", true },
- { "ruiming.me", true },
- { "ruin.one", true },
- { "ruitershoponline.nl", true },
- { "ruk.ca", true },
- { "rukminicarrentals.com", true },
- { "ruknguk.tk", true },
- { "rulu.co", true },
- { "rulu.tv", true },
- { "rulutv.com", true },
- { "rumartinez.es", true },
- { "rumlager.de", true },
- { "rummey.co.uk", true },
- { "rumplesinflatables.co.uk", true },
- { "rumtaste.com", true },
- { "rumtaste.de", true },
- { "run-it-direct.co.uk", true },
- { "run4gameplay.net", true },
- { "runagain.ch", false },
- { "runame.ml", true },
- { "rundesign.it", true },
- { "runebet.com", true },
- { "runefake.com", true },
- { "runfitcoaching.com", true },
- { "runicspells.com", true },
- { "runklesecurity.com", true },
- { "runner.az", true },
- { "runningrabb.it", true },
- { "runreport.fr", true },
- { "runrocknroll.com", true },
- { "runschrauger.com", true },
- { "runvs.io", true },
- { "ruobiyi.com", true },
- { "ruobr.ru", true },
- { "ruoskachile.tk", true },
- { "rupeevest.com", true },
- { "rupostel.com", true },
- { "ruquay.com", true },
- { "ruralink.com.ar", true },
- { "ruralsoba.com", true },
- { "ruralsuppliesdirect.co.uk", true },
- { "ruri.io", true },
- { "rusdigisolutions.com", true },
- { "rusempire.ru", true },
- { "rusexmany.ml", true },
- { "rushball.net", true },
- { "rushpoppershop.co.uk", true },
- { "rushter.com", true },
- { "rushyo.com", true },
- { "rusi-ns.ca", true },
- { "ruska-modra.cz", true },
- { "ruskamodra.cz", true },
- { "rusmolotok.ru", true },
- { "russelljohn.net", true },
- { "russellupevents.co.uk", true },
- { "russia-rp.tk", true },
- { "russia.dating", true },
- { "russia.wtf", true },
- { "russiaeconomy.org", true },
- { "russiahunting.tk", true },
- { "russian-page.tk", true },
- { "russianbearsmotorsport.tk", true },
- { "russianbristol.tk", true },
- { "russianescortsmumbai.com", true },
- { "russianpunkrock.tk", true },
- { "russianrandom.com", true },
- { "russianrandom.ru", true },
- { "russstudios.com", true },
- { "russt.me", true },
- { "rust.cf", true },
- { "rust.mn", true },
- { "rustable.com", true },
- { "rusticpathways.com.au", true },
- { "rustikalwallis.ch", true },
- { "rustpedia.net", true },
- { "rustyrambles.com", true },
- { "rusxakep.com", true },
- { "rutgerschimmel.nl", true },
- { "ruthbarrettmusic.com", true },
- { "ruthiehallarsis.com", true },
- { "ruthmontenegro.com", false },
- { "rutiger.com", true },
- { "rutika.ru", true },
- { "rutracker.appspot.com", true },
- { "rutten.me", false },
- { "ruudkoot.nl", true },
- { "ruurdboomsma.nl", true },
- { "ruwhof.net", true },
- { "ruya.com", true },
- { "ruyatabirleri.com", true },
- { "ruzaevka.tk", true },
- { "ruzzll.com", true },
- { "rva-asbestgroep.nl", true },
- { "rvdbict.nl", true },
- { "rvfit.dk", true },
- { "rvnoel.net", false },
- { "rvsa2bevestigingen.nl", true },
- { "rvsa4bevestigingen.nl", true },
- { "rvsbevestigingen.nl", true },
- { "rvsuitlaatdelen.nl", true },
- { "rw-invest.com", true },
- { "rw.search.yahoo.com", false },
- { "rw2.de", true },
- { "rwky.net", true },
- { "rws-cc.com", true },
- { "rws-vertriebsportal.de", true },
- { "rwx.ovh", true },
- { "rwx.work", true },
- { "rxbn.de", true },
- { "rxbusiness.com", true },
- { "rxguide.nl", true },
- { "rxight.com", true },
- { "ryabinushka.tk", true },
- { "ryan-gehring.com", true },
- { "ryan-goldstein.com", true },
- { "ryan.cafe", true },
- { "ryanbritton.com", true },
- { "ryanfamily.net.au", true },
- { "ryanhowell.io", true },
- { "ryankearney.com", false },
- { "ryanmcdonough.co.uk", false },
- { "ryanparman.com", true },
- { "ryansmithphotography.com", true },
- { "ryazan-region.ru", true },
- { "rylandgoldman.com", true },
- { "rynekpierwotny.pl", true },
- { "rynkebo.dk", true },
- { "ryois.me", true },
- { "rys.pw", true },
- { "rythm.es", true },
- { "ryuanerin.kr", true },
- { "ryuu.es", true },
- { "ryzhov.me", true },
- { "rzegocki.pl", true },
- { "rzentarzewski.net", true },
- { "s-c.se", true },
- { "s-cubed.net", true },
- { "s-gong.com", true },
- { "s-huset.dk", true },
- { "s-ip-media.de", true },
- { "s-kanbanya.com", true },
- { "s-mainte.com", true },
- { "s-pegasus.com", true },
- { "s-pro.io", true },
- { "s-s-paint.com", true },
- { "s-u.pw", true },
- { "s007.co", true },
- { "s1-llc.com", true },
- { "s10y.eu", true },
- { "s1128.com", true },
- { "s2i.ch", true },
- { "s2member.com", true },
- { "s2p.moe", true },
- { "s2t.net", true },
- { "s36533.com", true },
- { "s36594.com", true },
- { "s3cur3.it", true },
- { "s3robertomarini.it", true },
- { "s404.de", true },
- { "s44.eu", true },
- { "s4db.net", true },
- { "s4q.me", true },
- { "s4tips.com", true },
- { "s4ur0n.com", true },
- { "s550.cc", true },
- { "s551.cc", true },
- { "s552.cc", true },
- { "s553.cc", true },
- { "s554.cc", true },
- { "s556.cc", true },
- { "s557.cc", true },
- { "s558.cc", true },
- { "s559.cc", true },
- { "s64.cz", true },
- { "s81818.com", true },
- { "s88.com", true },
- { "s8a.us", true },
- { "s92.cloud", true },
- { "s92.io", true },
- { "s92.me", true },
- { "s95.de", true },
- { "sa-mp.ro", true },
- { "sa.net", true },
- { "sa68.cc", true },
- { "sa88.cc", true },
- { "saabpartsdistribution.com", true },
- { "saalfrank.at", true },
- { "saalfrank.de", true },
- { "saamhorigheidsfonds.nl", false },
- { "saas.de", true },
- { "saatchiart.com", true },
- { "saba-piserver.info", true },
- { "sabahattin-gucukoglu.com", true },
- { "sabbat-wildfire.tk", true },
- { "sabbottlabs.com", true },
- { "sabedinovski.tk", true },
- { "saberhortifruti.com.br", true },
- { "sabghijewelers.com", true },
- { "sabians.tk", true },
- { "sabine-forschbach.de", true },
- { "sabkappers.nl", true },
- { "sabrinajoias.com.br", true },
- { "sabrinajoiasprontaentrega.com.br", true },
- { "sabworldtricks.tk", true },
- { "sac.moe", true },
- { "sacadura.pt", true },
- { "sacaentradas.com", true },
- { "sacaleches.net", true },
- { "saccani.net", true },
- { "sachk.com", true },
- { "sacians.tk", true },
- { "sackmesser.ch", true },
- { "saclier.at", true },
- { "sacprincesse.com", true },
- { "sacred-knights.net", true },
- { "sacredheart-cliftonheights.net", true },
- { "sacrome.com", true },
- { "sadbox.es", true },
- { "sadbox.org", true },
- { "sadbox.xyz", true },
- { "sadeghian.us", true },
- { "sadev.co.za", true },
- { "sadhana.cz", true },
- { "sadhawkict.org", true },
- { "sadiejewellery.co.uk", true },
- { "sadmansh.com", true },
- { "sadou.kyoto.jp", true },
- { "sadoun.com", true },
- { "sadsu.com", true },
- { "saechsischer-christstollen.shop", true },
- { "saeder-krupp.de", true },
- { "saengsook.com", true },
- { "saengsuk.com", true },
- { "saf.earth", true },
- { "safar.sk", true },
- { "safara.host", true },
- { "safarimasaimara.com", true },
- { "safaritenten.nl", true },
- { "safc.tk", true },
- { "safcstore.com", true },
- { "safearth.training", true },
- { "safebaseflorida.com", true },
- { "safebasements.com", true },
- { "safebasementsnorthdakota.com", true },
- { "safebasementsofindiana.com", true },
- { "safebuyerscheme.co.uk", true },
- { "safecar.gov", false },
- { "safefreehost.gq", true },
- { "safegold.ca", true },
- { "safegroup.pl", true },
- { "safeguardcommerce.com", true },
- { "safeguardhosting.ca", true },
- { "safeinfra.nl", true },
- { "safeitup.se", true },
- { "safejourney.education", true },
- { "safematix.com", true },
- { "safeocs.gov", true },
- { "safercar.gov", true },
- { "saferequest.net", true },
- { "saferproduct.gov", true },
- { "saferproducts.gov", true },
- { "safersurfing.eu", false },
- { "safertruck.gov", true },
- { "safescan.com", true },
- { "safesoundcounselingllc.com", true },
- { "safestore.io", true },
- { "safetycloud.me", true },
- { "safetynetwork.me", true },
- { "safetyrange.com", true },
- { "safetysite.tips", true },
- { "safeui.com", false },
- { "safevault.org", true },
- { "safewaysecurityscreens.com.au", true },
- { "safire.ac.za", true },
- { "sagaenterprizes.com", true },
- { "sagagardencentre.co.uk", true },
- { "sagan.tk", true },
- { "sagargandecha.com.au", false },
- { "sagedocumentmanager.com", true },
- { "sagenesykkel.com", true },
- { "sagerus.com", true },
- { "saggiocc.com", true },
- { "sagitta.hr", true },
- { "saglikhaber.tk", true },
- { "sagnette.xyz", true },
- { "sagracefarms.com", true },
- { "sahajbooks.com", true },
- { "sahar.io", true },
- { "saharacloud.com", true },
- { "saharmassachi.com", true },
- { "sahb.dk", true },
- { "sahibinden.com", true },
- { "sahilm.com", true },
- { "sahkotyot.eu", true },
- { "said.id", true },
- { "said.it", true },
- { "said.my.id", true },
- { "saidtezel.com", true },
- { "saier.me", true },
- { "saifonvillas.com", true },
- { "saifoundation.in", true },
- { "saigaocy.me", true },
- { "saigonflowers.com", true },
- { "saikarra.com", true },
- { "saikou.moe", true },
- { "saikouji.tokushima.jp", true },
- { "sail-nyc.com", true },
- { "sailanitours.com", true },
- { "sailbookers.com", true },
- { "sailingonward.com", true },
- { "sailormoonevents.org", true },
- { "sailormoongallery.org", true },
- { "sailormoonlibrary.org", true },
- { "sailwiz.com", true },
- { "saimoe.moe", true },
- { "saimoe.org", true },
- { "sainetworks.net", true },
- { "sainformatica.com.es", true },
- { "sainshand.tk", true },
- { "saint-bernard-gouesch.fr", true },
- { "saint-cyril.com", true },
- { "saint-peterburg.tk", true },
- { "saint-petersburg.cf", true },
- { "saint-petersburg.gq", true },
- { "saint-petersburg.ml", true },
- { "saintaardvarkthecarpeted.com", true },
- { "saintanne.net", true },
- { "saintanthonylakin.org", true },
- { "saintanthonyscorner.com", true },
- { "sainteugenechurch.net", true },
- { "sainteugeneschurch.com", true },
- { "saintfrancescabrini.net", true },
- { "saintfrancisdesales.net", true },
- { "sainth.de", true },
- { "sainthedwig-saintmary.org", true },
- { "sainthelena-centersquare.net", true },
- { "sainthelenas.org", true },
- { "saintisidorecyo.com", true },
- { "saintjamestheapostle.org", true },
- { "saintjohn-bocaraton.com", true },
- { "saintjosephschurch.net", true },
- { "saintleochurch.net", true },
- { "saintmarkchurch.net", true },
- { "saintmaryna.com", true },
- { "saintmaryscathedral-trenton.org", true },
- { "saintpatrick-norristown.net", true },
- { "saintpeterchurch.net", true },
- { "saintpetersburg.cf", true },
- { "saintpetersburg.ga", true },
- { "saintpetersburg.gq", true },
- { "saintphilipneri.org", true },
- { "saintpius.net", true },
- { "saintpolycarp.org", true },
- { "saipariwar.com", true },
- { "saiputra.com", true },
- { "saitapovan.com", true },
- { "saitrance.com", true },
- { "saitv.org", true },
- { "saityvkaluge.ru", true },
- { "saiyans.com.ve", true },
- { "sajamstudija.info", true },
- { "sajdowski.de", true },
- { "sajjadzaidi.com", true },
- { "sajtoskal.hu", false },
- { "sakaki.anime.my", false },
- { "sakenohana.com", true },
- { "sakerhetsbubblan.se", true },
- { "sakerhetskopiering.nu", true },
- { "sakostacloud.de", true },
- { "saksonski-szlak-parowozow.pl", true },
- { "sakura-paris.org", true },
- { "sakura.zone", true },
- { "sakuracommunity.com", true },
- { "sakuradata.com", true },
- { "sakuraplay.com", true },
- { "sakuraz.net", true },
- { "salaire-minimum.com", true },
- { "salamon-it.de", false },
- { "salandalairconditioning.com", true },
- { "salde.net", true },
- { "saleduck.at", true },
- { "saleduck.ch", true },
- { "saleduck.co.id", true },
- { "saleduck.co.th", true },
- { "saleduck.com.my", true },
- { "saleduck.com.ph", true },
- { "saleduck.com.sg", true },
- { "saleduck.com.vn", true },
- { "saleduck.dk", true },
- { "saleduck.fi", true },
- { "saleduck.se", true },
- { "saledump.nl", true },
- { "salemedia.pro", true },
- { "salensmotors-usedcars.be", false },
- { "salesactivities.de", true },
- { "salesblackbelt.coach", true },
- { "salesflare.com", true },
- { "saletzki.de", true },
- { "salexy.kz", true },
- { "salidaswap.com", true },
- { "salland1.nl", true },
- { "salle-quali.fr", false },
- { "sallydowns.name", true },
- { "salmanravoof.com", true },
- { "salmododia.net", true },
- { "salmonella.co.uk", true },
- { "salmonvision.com.tw", true },
- { "salnet.wf", true },
- { "salon-claudia.ch", true },
- { "salon-hinata.biz", true },
- { "salon-minipli.de", true },
- { "salon.io", false },
- { "salon1.ee", true },
- { "salonasymetria.com", true },
- { "salonasymetria.pl", true },
- { "salonderecepcionessjl.com", true },
- { "salonsantebienetre.ch", true },
- { "salrosadohimalaia.com", true },
- { "salsa-straubing.de", true },
- { "salt-documentary.blog", true },
- { "saltbythesea.com", true },
- { "saltedfish.network", true },
- { "saltercane.com", false },
- { "saltstack.cz", true },
- { "salud.top", false },
- { "saluddecalidad.com", true },
- { "saludmas.site", true },
- { "salutethefish.com", true },
- { "salutethegrains.com", true },
- { "salutethepig.com", true },
- { "salva.re", true },
- { "salvadorinfantil.tk", true },
- { "salvagedfurnitureparlour.com", true },
- { "salvameuba.com", true },
- { "salvandoalocombia.com", true },
- { "salzerperu.com", true },
- { "sam-football.fr", true },
- { "sam66.cc", true },
- { "sam88.cc", true },
- { "samalderson.co.uk", true },
- { "samanacafe.com", true },
- { "samandcatonline.tk", true },
- { "samandroscosrestaurant.com", true },
- { "samanthasgeckos.com", true },
- { "samappleton.com", true },
- { "samara-avia.ru", true },
- { "samaritainsmeyrin.ch", false },
- { "samatva-yogalaya.com", true },
- { "samba.org", true },
- { "sambaash.com", true },
- { "sambeso.net", true },
- { "sambot22.tk", true },
- { "sambuchanan.tk", true },
- { "sambus.com", true },
- { "samcentertech.com", true },
- { "samdev.io", true },
- { "samdrewtakeson.com", true },
- { "samegoal.com", true },
- { "samegoal.org", true },
- { "samel.de", true },
- { "samenwerkingsportaal.nl", true },
- { "samenwerkingsportaal.tk", true },
- { "sameworks.com", true },
- { "samhuri.net", true },
- { "samifar.in", true },
- { "samindgroup.com", true },
- { "samiratv.tk", true },
- { "samiysok.cf", true },
- { "samizdat.cz", true },
- { "samkelleher.com", true },
- { "samkoandmikotoywarehouse.com", true },
- { "saml-gateway.org", true },
- { "samlaw.co.nz", true },
- { "sammamish--locksmith.com", true },
- { "sammyjohnson.com", true },
- { "sammyservers.com", true },
- { "sammyservers.net", true },
- { "samodding.com", true },
- { "samorazvitie.ru", true },
- { "samotorsporttyres.com.au", true },
- { "sampaguide.com", true },
- { "sampatjewelers.com", true },
- { "sample-site.click", true },
- { "samplefashion.nl", true },
- { "samri.pt", true },
- { "sams.wtf", true },
- { "samsebe.tk", true },
- { "samshouseofspaghetti.net", true },
- { "samtalen.nl", true },
- { "samuelebencini.it", true },
- { "samuelkeeley.com", true },
- { "samuellaulhau.fr", false },
- { "samui-samui.de", false },
- { "samusil.org", true },
- { "samvanderkris.xyz", true },
- { "samwrigley.co.uk", true },
- { "samwu.tw", true },
- { "samystic.com", true },
- { "san.ac.th", true },
- { "sana-store.com", true },
- { "sana-store.cz", true },
- { "sana-store.sk", true },
- { "sanabproperties.com", true },
- { "sanael.net", true },
- { "sanalaile.tk", true },
- { "sanantoniolocksmithinc.com", true },
- { "sanantoniolocksmithtx.com", true },
- { "sanasport.cz", true },
- { "sanasport.sk", true },
- { "sanatorii-sverdlovskoy-oblasti.ru", true },
- { "sanatorionosti.com.ar", true },
- { "sanbornteam.com", true },
- { "sancaktepehaber.tk", true },
- { "sanctumwealth.com", true },
- { "sand-stoneinc.com", true },
- { "sand66.cc", true },
- { "sand66.com", true },
- { "sandalj.com", true },
- { "sandboxfp.com", true },
- { "sander.sh", true },
- { "sanderdorigo.nl", true },
- { "sanderkoenders.eu", true },
- { "sanderkoenders.nl", true },
- { "sanderstech.solutions", true },
- { "sandervanderstap.nl", true },
- { "sandervankasteel.nl", false },
- { "sandhaufen.tk", true },
- { "sandiegoluxuryhomes.org", true },
- { "sandiegoopticas.com", true },
- { "sandiegotown.com", true },
- { "sandmanintel.com", true },
- { "sandmarc.cz", true },
- { "sandor.wtf", true },
- { "sandr0.tk", true },
- { "sandrabernardo.com", true },
- { "sandrainden.nl", true },
- { "sandraindenfotografie.nl", true },
- { "sandrocorapi.com", true },
- { "sandrolittke.de", true },
- { "sandrproperty.com", true },
- { "sandstroh.network", true },
- { "sandtears.com", true },
- { "sandtohand.com", true },
- { "sandtonescorts.com", true },
- { "sandtonplumber24-7.co.za", true },
- { "sandwichcouncil.tk", true },
- { "sandyrobsonhypnotherapy.co.uk", true },
- { "sanemind.de", false },
- { "sanemind.eu", false },
- { "sanepsychologen.nl", true },
- { "sanex.ca", true },
- { "sanfranciscopersonalinjuryattorney.us", true },
- { "sangen.ml", true },
- { "sanglierhurlant.fr", true },
- { "sangyoui.health", true },
- { "sanierungskonzept.pro", true },
- { "sanipousse.com", true },
- { "sanitairwinkel.be", true },
- { "sanitairwinkel.com", true },
- { "sanitairwinkel.nl", true },
- { "sanix.org", true },
- { "sanjosecolorectal.com", true },
- { "sanjotech.space", true },
- { "sanketsu.ml", false },
- { "sanluisdequillota.tk", true },
- { "sanmuding.com", true },
- { "sannefoltz.com", true },
- { "sannesfotklinikk.no", true },
- { "sanogym.com", true },
- { "sanovnik.at", true },
- { "sanpham-balea.org", true },
- { "sanqianssr.com", true },
- { "sanskritiyoga.com", true },
- { "sansonehowell.com", true },
- { "santa-fell-from.space", true },
- { "santaijia.com", true },
- { "santamariaretreats.com", true },
- { "santamonicapost123.org", true },
- { "santegra.tk", true },
- { "santensautomatics.be", true },
- { "santevie.ch", false },
- { "santi-club.de", true },
- { "santiagogarza.co", true },
- { "santibanezdetera.tk", true },
- { "santippolito-borgo.tk", true },
- { "santjoandevilassar.tk", true },
- { "santo.fi", true },
- { "sanvitolocapobus.com", true },
- { "sanych-msk.ru", true },
- { "saobancrafts.com", true },
- { "saol.eu", true },
- { "saorsat.com", true },
- { "saorsat.ie", true },
- { "saorsat.tv", true },
- { "saorview.com", true },
- { "saorview.ie", true },
- { "saorview.net", true },
- { "saorviewconnect.ie", true },
- { "saorviewconnected.ie", true },
- { "sap-inc.co.jp", true },
- { "sapac.es", true },
- { "sapancavillalari.com", true },
- { "sapibatam.com", true },
- { "sapien-ci.com", true },
- { "sapience.com", true },
- { "sapindus.pl", true },
- { "sapk.fr", true },
- { "saplumbers.com.au", true },
- { "sapphirepearl.com.sg", true },
- { "sapphireservicesga.com", true },
- { "sapporobeer.com", true },
- { "sapprendre.ch", false },
- { "saprima.de", false },
- { "saputra.org", true },
- { "saq.com", true },
- { "sarae.id", true },
- { "sarah-jane.nl", true },
- { "sarahbeckettharpist.com", true },
- { "sarahlicity.co.uk", true },
- { "sarahlicity.me.uk", true },
- { "sarahplusdrei.de", true },
- { "sarahsecret.de", true },
- { "sarahwellington.com", true },
- { "sarahwikeley.co.uk", true },
- { "saraleebread.com", false },
- { "sarariman.com", true },
- { "sarasotadentistry.com", true },
- { "sarasotaroboticurology.com", true },
- { "sarasturdivant.com", true },
- { "saratov24.tk", true },
- { "saratovlive.tk", true },
- { "saratovnews.ml", true },
- { "saratovtime.tk", true },
- { "sarbash.ee", true },
- { "sard.ro", true },
- { "sardacompost.it", true },
- { "sardinianvillas.com", true },
- { "sarella.org", true },
- { "sarhua.tk", true },
- { "sarink.eu", true },
- { "sarjakuvakauppa.fi", true },
- { "sarkaariseva.live", true },
- { "sarkisianbuilders.com", true },
- { "sarkoziadam.hu", true },
- { "sarny.at", true },
- { "saro.me", true },
- { "saronikos.city", true },
- { "saropa.com", true },
- { "sarpsb.org", true },
- { "sartoria.roma.it", true },
- { "sarumtechnologies.com", true },
- { "sas-snowboarding.sk", true },
- { "sascha.io", true },
- { "sascha.is", true },
- { "saschaeggenberger.ch", true },
- { "saschaeggenberger.com", true },
- { "sash.pw", true },
- { "sashaokun.com", true },
- { "sashascollections.com", true },
- { "sashka.com.ua", true },
- { "sasioglu.co.uk", true },
- { "saskadoodle.com", true },
- { "saskpension.com", true },
- { "sasquatt.com.br", true },
- { "sasrobotics.xyz", true },
- { "sassandbelle.co.uk", true },
- { "sassandbelle.com", true },
- { "sassandbelletrade.co.uk", true },
- { "sassandbelletrade.com", true },
- { "sastd.com", true },
- { "sasyabapi.com", true },
- { "sat4all.com", true },
- { "satai.dk", true },
- { "satal.in", true },
- { "satania.moe", true },
- { "satanspowers.tk", true },
- { "satario.vn", true },
- { "satellites.hopto.me", true },
- { "satimagingcorp.com", true },
- { "satinn.pl", true },
- { "satmali.az", true },
- { "satmd.de", true },
- { "satoshinumbers.com", true },
- { "satserwis.xyz", true },
- { "sattamatkamobi.mobi", false },
- { "sattaresult.net", true },
- { "saturn.pl", true },
- { "satyanarayana.xyz", true },
- { "saudeealimentos.com", true },
- { "saudenoclique.com.br", true },
- { "sauerbrey.eu", true },
- { "sauerland-schnittgruen.de", true },
- { "saulchristie.com", true },
- { "saulsplace.com", true },
- { "saulsplacehealth.com", true },
- { "saulsplacewebdesign.com", true },
- { "saultdefencelaw.ca", true },
- { "saulvanderbijl.com", true },
- { "saumon-de-france.com", false },
- { "saumon-france.com", false },
- { "saumondefrance.fr", false },
- { "saumonfrance.fr", false },
- { "saunafahrten.ch", true },
- { "saunahats.eu", true },
- { "saunas.fr", true },
- { "saunatime.jp", true },
- { "sauvagebridge.nl", true },
- { "savaari.com", true },
- { "savageorgiev.com", true },
- { "savanna.io", true },
- { "savatha.tk", true },
- { "savbus.com", true },
- { "savbus.ws", true },
- { "save-me-aachen.de", true },
- { "savebees.org", true },
- { "savecrypto.org", true },
- { "savemylicence.co.uk", true },
- { "saveoney.ca", true },
- { "saveonkitchens.com", true },
- { "savetheinternet.eu", true },
- { "saveusfromavril.tk", true },
- { "savic.com", false },
- { "saviezvousque.net", true },
- { "savilleassessment.com", true },
- { "savin.ga", true },
- { "savingrecipe.com", true },
- { "savingsoftheyear.com", true },
- { "savingsomegreen.com", true },
- { "savorvip.ir", true },
- { "sawyerroofing.com", true },
- { "saxeandthecity.com", true },
- { "saxojoe.co.uk", true },
- { "saxojoe.de", true },
- { "saxoncreative.com", true },
- { "saxonsink.com", true },
- { "saxotex.de", true },
- { "saxowert.de", true },
- { "saxwereld.nl", true },
- { "sayprepay.com", true },
- { "sayrodigital.com", true },
- { "sayura.net", true },
- { "sayver22.com", true },
- { "saz.sh", true },
- { "saz9001.com", true },
- { "sazavafest.cz", true },
- { "sazuz.cz", true },
- { "sb-group.dk", true },
- { "sb-sd.org", true },
- { "sb-tuning.ru", true },
- { "sb.im", true },
- { "sb.sb", true },
- { "sb0.io", true },
- { "sbanken.no", true },
- { "sbaten.nl", true },
- { "sbblog.cn", true },
- { "sbcargo.com", true },
- { "sber.us", true },
- { "sberbank.ch", true },
- { "sberna-fotofast.cz", true },
- { "sbf888.com", true },
- { "sbgroup.dk", true },
- { "sbiewald.de", true },
- { "sbir.gov", true },
- { "sbirecruitment.co.in", true },
- { "sbit.com.br", true },
- { "sbivc.jp", true },
- { "sbl001.com", true },
- { "sbo-dresden.de", true },
- { "sbrouwer.org", true },
- { "sbrownbourne.com", true },
- { "sbsavings.bank", true },
- { "sbscyber.com", true },
- { "sbsrv.ml", true },
- { "sbssoft.ru", true },
- { "sbstattoo.com", true },
- { "sbytes.info", true },
- { "sc-artworks.co.uk", true },
- { "sc5.jp", true },
- { "scaarus.com", true },
- { "scaffalature.roma.it", true },
- { "scaffoldhireeastrand.co.za", true },
- { "scaffoldhirefourways.co.za", true },
- { "scaffoldhiremidrand.co.za", true },
- { "scaffoldhirerandburg.co.za", true },
- { "scaffoldhiresandton.co.za", true },
- { "scalaire.com", true },
- { "scalaire.fr", true },
- { "scale.roma.it", true },
- { "scalesbiolab.com", true },
- { "scaling.solutions", true },
- { "scallywagsbouncycastles.co.uk", true },
- { "scallywagskids.co.uk", true },
- { "scalpel.com", true },
- { "scamblockplus.org", true },
- { "scan.co.uk", true },
- { "scan2key.com", true },
- { "scandalindo.ml", true },
- { "scandicom.fi", true },
- { "scandinavia.dating", true },
- { "scandinaviancorner.tk", true },
- { "scangeo.net", true },
- { "scanmailx.com", true },
- { "scanpay.dk", true },
- { "scapdoors.ca", true },
- { "scarafaggio.it", true },
- { "scarinex.tk", true },
- { "scatsbouncingcastles.ie", true },
- { "scbdh.org", true },
- { "sccimo.com", true },
- { "scde.ventures", true },
- { "sceenfox.de", true },
- { "scelec.com.au", true },
- { "scenari-community.org", true },
- { "scenari.eu", true },
- { "scenari.ovh", true },
- { "scenariossecuritygroup.com", true },
- { "scenastu.pl", true },
- { "scene.mx", true },
- { "scenester.tv", true },
- { "scenicbyways.info", true },
- { "scepticism.com", true },
- { "scevity.com", true },
- { "scfpensante.ca", true },
- { "schachburg.de", true },
- { "schachtelhalm-tee.de", true },
- { "schack.dk", true },
- { "schadevergoedingen.eu", true },
- { "schaffensdrang.at", true },
- { "schafgarbe-tee.de", true },
- { "schamlosharmlos.de", true },
- { "schastie.ml", true },
- { "schat.top", true },
- { "schatzibaers.de", true },
- { "schawe.me", true },
- { "schbebtv.fr", true },
- { "scheduleme.io", true },
- { "schefczyk.com", true },
- { "schefczyk.de", true },
- { "schefczyk.eu", true },
- { "schefczyk.net", true },
- { "scheinerhaus.at", true },
- { "scheinlichter.de", true },
- { "schellebelle.tk", true },
- { "schellevis.net", true },
- { "schemingmind.com", true },
- { "schenkes.de", false },
- { "scherfke.de", true },
- { "schermkapot.nl", true },
- { "scheuchenstuel.at", true },
- { "schgroup.com", true },
- { "schier.info", true },
- { "schil.li", true },
- { "schildbach.de", true },
- { "schillers-friedberg.de", true },
- { "schipholwatch.nl", true },
- { "schippendale.de", true },
- { "schippers-it.nl", true },
- { "schizoids.net", true },
- { "schlachter.ca", true },
- { "schlaf.guru", true },
- { "schlagenhauf.info", true },
- { "schlagma.de", false },
- { "schlarb.eu", true },
- { "schlarp.com", true },
- { "schlechtewitze.com", true },
- { "schlick.network", true },
- { "schlick.wedding", true },
- { "schlossereieder.at", true },
- { "schluesseldienst-berlin.de", true },
- { "schlueter-software.de", true },
- { "schmaeh-coaching.ch", true },
- { "schmatloch.cloud", true },
- { "schmelle.me", true },
- { "schmidthomes.com", true },
- { "schmidtlohwasser.de", true },
- { "schmidtplasticsurgery.com", true },
- { "schmitt-etienne.fr", true },
- { "schmitt-max.com", true },
- { "schmuggelware.de", false },
- { "schnapke.name", true },
- { "schneckenhilfe.de", true },
- { "schnegg.name", false },
- { "schneidr.de", true },
- { "schneids.me", true },
- { "schnellno.de", true },
- { "schnouki.net", true },
- { "schnuckenhof-wesseloh.de", true },
- { "schnyder-werbung.ch", true },
- { "schoeller.click", true },
- { "schoenstatt-fathers.link", true },
- { "schoenstatt-fathers.us", true },
- { "schoenstatt.link", true },
- { "schoepski.de", true },
- { "schoknecht.net", true },
- { "schoknecht.one", true },
- { "schoko-ferien.de", true },
- { "schokoferien.de", true },
- { "schokokeks.org", true },
- { "schokoladensouffle.eu", true },
- { "scholar.group", true },
- { "scholar.site", true },
- { "scholareducation.tk", true },
- { "scholarnet.cn", true },
- { "scholarshipplatform.com", true },
- { "scholarshipsplatform.com", true },
- { "scholarstyle.com", true },
- { "scholieren.com", true },
- { "scholtensupport.nl", true },
- { "scholz-kallies.de", true },
- { "schonstedt.com", true },
- { "schont.org", true },
- { "school-b.us", true },
- { "school-register.co.za", true },
- { "schoolantwoorden.tk", true },
- { "schoolarchive.net", true },
- { "schoolbus.at", true },
- { "schoolcafe.com", true },
- { "schoolofphilosophy.org.au", true },
- { "schoolroom.ga", true },
- { "schoolsafety.gov", true },
- { "schorelweb.nl", true },
- { "schorers.org", true },
- { "schoring.com", true },
- { "schottenland.de", true },
- { "schrader-institute.de", true },
- { "schrauger.com", true },
- { "schrauger.info", true },
- { "schrauger.net", true },
- { "schrauger.org", true },
- { "schrauger.run", true },
- { "schraugerrun.com", true },
- { "schreibers.ca", true },
- { "schreinerei-jahreis.de", true },
- { "schreinerei-schweikl.de", true },
- { "schrenkinzl.at", true },
- { "schritt4fit.de", true },
- { "schrodingersscat.com", true },
- { "schrodingersscat.org", true },
- { "schroeder-immobilien-sundern.de", true },
- { "schroepfi.de", true },
- { "schrolm.de", true },
- { "schsrch.xyz", true },
- { "schtiehve.duckdns.org", true },
- { "schubergphilis.com", true },
- { "schubertgmbh-ingelheim.de", true },
- { "schuelerzeitung-ideenlos.de", true },
- { "schuetzen-ehrenbreitstein.de", true },
- { "schuhbedarf.de", true },
- { "schuhwerkstatt.at", true },
- { "schul-bar.de", true },
- { "schulderinsky.de", true },
- { "schuler.st", true },
- { "schulfotograf-deinfoto.ch", true },
- { "schull.ch", false },
- { "schultzflorists.com", true },
- { "schumanandmonnet.eu", true },
- { "schunako.ch", true },
- { "schuppentier.org", true },
- { "schutterijschinveld.nl", true },
- { "schutz-vor-schmutz.de", true },
- { "schutznetze24.de", false },
- { "schutzwerk.com", true },
- { "schwabenhaus-ka.de", true },
- { "schwalliers.com", true },
- { "schwano-dent.at", true },
- { "schwarz-gelbe-fuechse.de", true },
- { "schwarzegar.de", true },
- { "schwarzenberg.tk", true },
- { "schwarzer.it", true },
- { "schwarzer.wang", true },
- { "schwarzes-muenchen.de", true },
- { "schwarzhenri.ch", false },
- { "schwarztrade.cz", true },
- { "schwarzwald-flirt.de", true },
- { "schweingehabt.expert", true },
- { "schweizerbanken.tk", true },
- { "schwerkraftlabor.de", true },
- { "schwinabart.com", true },
- { "schwinger.me", true },
- { "schwinnbike.ru", true },
- { "schwuppengrillen.de", false },
- { "scicomm.xyz", true },
- { "science-network.ch", true },
- { "science-questions.org", true },
- { "science-texts.de", true },
- { "science.gov", true },
- { "sciencebase.gov", true },
- { "scienceexploits.com", true },
- { "scienceminnesota.com", true },
- { "scienceofpeople.com", true },
- { "sciencesolutions.eu", true },
- { "sciencetram.tk", true },
- { "sciencex.com", true },
- { "scigov.xyz", true },
- { "scijinks.gov", true },
- { "scilifebiosciences.com", true },
- { "scimage.com", true },
- { "scintilla.nl", true },
- { "scintillating.stream", true },
- { "scip.ch", true },
- { "scislowcy.pl", true },
- { "scistarter.com", true },
- { "scitheory.com", true },
- { "scitopia.net", true },
- { "scity88.com", true },
- { "scoach475k.net", true },
- { "scohetal.de", true },
- { "scolasti.co", true },
- { "scom.org.uk", true },
- { "scoop6.co.uk", true },
- { "scootaloo.co.uk", true },
- { "scooter-experts.com", true },
- { "scooterinaustralia.tk", true },
- { "scooterservis.com", true },
- { "scorp13.com", true },
- { "scottdunn.com", true },
- { "scottgalvin.com", true },
- { "scotthelme.co.uk", true },
- { "scotthelmesucks.com", true },
- { "scottipc.com", true },
- { "scottishcu.org", true },
- { "scottishseniorsgolf.com", true },
- { "scottlanderkingman.com", true },
- { "scottmay.id.au", true },
- { "scottseditaacting.com", true },
- { "scottshorter.com.au", true },
- { "scottspainting.com", true },
- { "scottynordstrom.org", false },
- { "scouting-wageningen.nl", true },
- { "scoutingridderkerk.nl", true },
- { "scoutingtungelroy.nl", true },
- { "scoutnet.de", true },
- { "scouttrails.com", true },
- { "scp-079.org", true },
- { "scp-trens.notaires.fr", true },
- { "scp500.com", true },
- { "scpi-is.fr", true },
- { "scpslgame.com", true },
- { "scqpw.com", true },
- { "scrabble-solver.com", true },
- { "scrabble123.co.uk", true },
- { "scrabble123.com", true },
- { "scrabble123.de", true },
- { "scrabble123.fr", true },
- { "scrabble123.pl", true },
- { "scrambox.com", true },
- { "scramget.com", true },
- { "scramsoft.com", true },
- { "scrap.photos", true },
- { "scrap.tf", true },
- { "scrapbookdecorations.ga", true },
- { "scratchzeeland.nl", true },
- { "scrayos.net", true },
- { "screefox.de", true },
- { "screen-fox.de", true },
- { "screenfax.de", true },
- { "screenfox.de", true },
- { "screenfox.eu", true },
- { "screenfox.info", true },
- { "screenfox.net", true },
- { "screenlight.tv", true },
- { "screenmachine.com", true },
- { "screenpublisher.com", true },
- { "screentocloud.com", true },
- { "scripo-bay.com", true },
- { "script.google.com", true },
- { "scripter.co", true },
- { "scriptgates.ru", true },
- { "scriptomania.tk", true },
- { "scriptslug.com", true },
- { "scriptum.gr", true },
- { "scrisulfacebine.ro", true },
- { "scrivito.com", true },
- { "scrod.me", true },
- { "scroll.in", true },
- { "scrumplex.net", true },
- { "scrumpus.com", true },
- { "scrumstack.co.uk", true },
- { "scryfall.com", true },
- { "scsd.si", true },
- { "scswam.com", false },
- { "sctiger.me", true },
- { "sctiger.ml", true },
- { "sctrainingllc.com", true },
- { "scubadiving-phuket.com", true },
- { "scubaland.hu", true },
- { "scul.net", true },
- { "sculpture.support", true },
- { "sculpturos.com", true },
- { "scungioborst.com", true },
- { "scuolaguidalame.ch", false },
- { "scuolamazzini.livorno.it", true },
- { "scurtam.tk", true },
- { "sd.af", true },
- { "sda.one", true },
- { "sdcardrecovery.de", true },
- { "sdebitati.it", true },
- { "sdeu.fr", true },
- { "sdfleetmanagement.com", true },
- { "sdg-tracker.org", true },
- { "sdgllc.com", true },
- { "sdho.org", true },
- { "sdis-trib.fr", true },
- { "sdn.cz", true },
- { "sdns.fr", true },
- { "sds-marburg.de", true },
- { "sdsi.us", true },
- { "sdsk.one", true },
- { "sdsmt.engineering", true },
- { "sduconnect.nl", true },
- { "sdvigpress.org", false },
- { "sdxcentral.com", true },
- { "sdyzmun.club", true },
- { "se-booster.com", true },
- { "se-live.org", true },
- { "se-theories.org", true },
- { "se.com", true },
- { "se.gg", true },
- { "se.search.yahoo.com", false },
- { "seabehind.me", true },
- { "seabooty.com", true },
- { "seabrooklocksmith.com", true },
- { "seac.me", true },
- { "seachef.it", true },
- { "seadus.ee", true },
- { "seaelba.com", true },
- { "seafood.co.nz", true },
- { "seaholmwines.com", true },
- { "sealaw.com", true },
- { "sealbaker.com", true },
- { "sealoffantasy.de", true },
- { "sealtitebasement.com", true },
- { "seamester.com", true },
- { "seamless.no", true },
- { "seamoo.se", true },
- { "seamus.party", true },
- { "sean-wright.com", true },
- { "seandawson.info", true },
- { "seanholcroft.co.uk", true },
- { "seanrodda.com", true },
- { "seanstaffiery.com", true },
- { "seaplayhomes.com", true },
- { "search-job-in.com", true },
- { "search-one.de", true },
- { "search.gov", true },
- { "search.yahoo.com", false },
- { "searchcandy.nl", true },
- { "searchcandy.uk", true },
- { "searchdatalogy.com", true },
- { "searchforbeer.com", true },
- { "searchfox.org", true },
- { "searchmore.dk", true },
- { "searchpartners.dk", true },
- { "searchshops.com", true },
- { "seareytraining.com", true },
- { "searsucker.com", true },
- { "searx.be", true },
- { "searx.one", true },
- { "searx.rocks", true },
- { "searx.ru", true },
- { "searx.xyz", true },
- { "seasidestudios.co.uk", true },
- { "season.moe", true },
- { "seasons-vintage.com", true },
- { "seasons.nu", false },
- { "seatbeltpledge.com", true },
- { "seattle-life.net", true },
- { "seattledevicerepair.com", true },
- { "seattlefabrication.com", true },
- { "seattlemesh.net", true },
- { "seattleprivacy.org", true },
- { "seattleshadeandawning.com", true },
- { "seattlewalkinbathtubs.com", true },
- { "seavancouver.com", true },
- { "seaviewkohchang.com", true },
- { "seb-mgl.de", true },
- { "seb-net.com", true },
- { "sebald.com", true },
- { "sebald.org", true },
- { "sebandroid.com", true },
- { "sebascelis.com", true },
- { "sebastiaandouma.com", true },
- { "sebastiaanwijnimport.nl", true },
- { "sebastian-janich.de", true },
- { "sebastian-kuhnert.de", true },
- { "sebastian.expert", true },
- { "sebastianblade.com", true },
- { "sebastianboegl.de", true },
- { "sebastianungureanu.com", true },
- { "sebastiaperis.com", true },
- { "sebastiensenechal.com", true },
- { "sebasveeke.nl", true },
- { "seberova.cz", true },
- { "sebi.org", true },
- { "sebjacobs.com", true },
- { "seblod.com", true },
- { "sebster.com", true },
- { "seby.io", true },
- { "sec-mails.de", true },
- { "sec-research.com", true },
- { "sec-wiki.com", true },
- { "sec.ec", true },
- { "sec.gd", true },
- { "sec.gov", true },
- { "sec3ure.co.uk", true },
- { "sec455.com", true },
- { "sec530.com", true },
- { "secapp.fi", true },
- { "seccom.ch", false },
- { "secctexasgiving.org", false },
- { "secgui.de", true },
- { "sech.me", true },
- { "secinto.at", true },
- { "secnews.gr", true },
- { "secomo.org", true },
- { "second-life-partner-ichien.com", true },
- { "secondchancejobsforfelons.com", true },
- { "secondmileservice.com", true },
- { "seconfig.sytes.net", true },
- { "secoseal.de", true },
- { "secpatrol.de", true },
- { "secretagentclub.tk", true },
- { "secretary-schools.com", true },
- { "secretpanties.com", true },
- { "secretsdujeu.com", true },
- { "secretserveronline.com", true },
- { "secretum.tech", true },
- { "secrium.io", true },
- { "secteer.com", true },
- { "sectelligence.nl", true },
- { "sectio-aurea.org", true },
- { "section-31.org", true },
- { "section.io", true },
- { "section215.com", true },
- { "section508.gov", true },
- { "section77.de", true },
- { "sector.zone", true },
- { "sector5.xyz", true },
- { "sectun.com", true },
- { "secumailer.com", true },
- { "secumailer.eu", true },
- { "secumailer.nl", true },
- { "secundity.nl", true },
- { "securai.de", true },
- { "secure-computing.net", true },
- { "secure-graphic.de", true },
- { "secure-gw.de", true },
- { "secure-server-hosting.com", true },
- { "secure.advancepayroll.com.au", true },
- { "secure.co.hu", true },
- { "secure.facebook.com", false },
- { "securecloudplatform.nl", true },
- { "securedrop.org", true },
- { "secureenduserconnection.se", true },
- { "secureesolutions.com", true },
- { "securefiletransfer.nl", true },
- { "securegovernment.us", true },
- { "secureheaders.com", true },
- { "secureim.de", true },
- { "securelect-inspection.com", true },
- { "securelogin.nu", true },
- { "securemailbox.com", true },
- { "securemantra.net", true },
- { "securemessage.nl", true },
- { "securemy.website", true },
- { "securenets.nl", true },
- { "secureobscure.com", true },
- { "secureonline.co", true },
- { "securepress.io", true },
- { "securetasks.net", true },
- { "securethe.news", true },
- { "securetrustbank.com", true },
- { "securevideo.com", true },
- { "securewebcomputing.com", true },
- { "secureworks.com", true },
- { "securi-tay.co.uk", true },
- { "securist.nl", true },
- { "security-24-7.com", true },
- { "security-brokers.com", true },
- { "security.gives", true },
- { "security.google.com", true },
- { "security.love", true },
- { "security201.co.uk", true },
- { "security201.com", true },
- { "securitybsides.pl", false },
- { "securitycamerascincinnati.com", true },
- { "securitydriver.com", true },
- { "securityescrownews.com", true },
- { "securityfest.com", true },
- { "securitygladiators.com", true },
- { "securityheaders.com", true },
- { "securityheaders.io", true },
- { "securityheaders.nl", true },
- { "securitykey.co", true },
- { "securitypluspro.com", true },
- { "securityprimes.in", true },
- { "securitypuppy.com", true },
- { "securityrussia.com", true },
- { "securitysense.co.uk", true },
- { "securitysnobs.com", false },
- { "securitystreak.com", true },
- { "securitytrails.com", true },
- { "securitywithnick.com", true },
- { "securitywithoutborders.org", true },
- { "securview.ch", true },
- { "secutrans.com", true },
- { "secuvera.de", false },
- { "secvault.io", true },
- { "secwall.me", true },
- { "secyourity.se", true },
- { "sedlakovalegal.com", true },
- { "sedlex.fr", true },
- { "sedmicka.sk", false },
- { "sedoexpert.nl", true },
- { "sedoexperts.nl", true },
- { "sedomicilier.fr", true },
- { "see.asso.fr", true },
- { "see.wtf", true },
- { "seedandleisure.co.uk", true },
- { "seedboite.ovh", true },
- { "seedcoworking.es", true },
- { "seedisclaimers.com", true },
- { "seedno.de", true },
- { "seednode.co", true },
- { "seekfirstthekingdom.ca", true },
- { "seekthe.net", true },
- { "seemeagain.com", true },
- { "seemomclick.com", true },
- { "seerainer.com", true },
- { "seewang.me", true },
- { "seewhatididhere.com", true },
- { "seewines.com", true },
- { "seeworkdone.com", true },
- { "sefru.de", true },
- { "seg-leipzig.org", true },
- { "segaretro.org", true },
- { "segitz.de", true },
- { "segmetic.com", true },
- { "segnalabullo.com", true },
- { "segnalabullo.eu", true },
- { "segnalabullo.it", true },
- { "segnidisegni.eu", true },
- { "segtronix.com", true },
- { "seguimosganando.com", true },
- { "segulink.com", true },
- { "seguridadconsumidor.gov", true },
- { "seguridadysaludeneltrabajo.com.co", true },
- { "seguros-de-salud-y-vida.com", true },
- { "segurosbalboa.com.ec", false },
- { "segurosmaurobracchieri.com", true },
- { "segurosocial.gov", false },
- { "seguroviagem.srv.br", false },
- { "sehablazolano.com", true },
- { "sehd.top", true },
- { "sehnenweh.org", true },
- { "seibert.ninja", true },
- { "seibu-kikaku.co.jp", true },
- { "seicochimica.it", true },
- { "seidel-immobilienberatung.de", true },
- { "seifried.org", true },
- { "seikatu-navi.com", true },
- { "seinfeldquote.com", true },
- { "seirei.ne.jp", true },
- { "seisansei.net", true },
- { "seishinchuo-lawoffice.com", true },
- { "seitai-nabejun.jp", true },
- { "seitai-taiyou.com", true },
- { "seitenwaelzer.de", true },
- { "sek.ai", true },
- { "sekainokokki.jp", true },
- { "sekfung.me", true },
- { "sekisonn.com", true },
- { "sekoya.org", true },
- { "sektor41.com", true },
- { "sekurak.pl", true },
- { "selber-coden.de", true },
- { "selbys.net.au", true },
- { "selcusters.nl", true },
- { "seldax.com", true },
- { "selea.se", true },
- { "selebrita.ml", true },
- { "selected-properties.com", false },
- { "selectel.com", false },
- { "selectel.ru", true },
- { "selectionengine.ca", true },
- { "selectionengine.com", true },
- { "selectionengine.net", true },
- { "selectionengine.org", true },
- { "selegiline.com", true },
- { "selekzo.com", true },
- { "seleondar.ru", true },
- { "self-business.tk", true },
- { "self-evident.org", true },
- { "self-xss.info", true },
- { "selfassess.govt.nz", true },
- { "selfdestruct.net", true },
- { "selfici.com", true },
- { "selfici.cz", true },
- { "selfiehome.cz", true },
- { "selfishness.com", true },
- { "selfloath.in", true },
- { "selfmade4u.de", true },
- { "selfrealize.ga", true },
- { "selfretire.cf", true },
- { "selfycheck.it", true },
- { "selimcerkezi.tk", true },
- { "sellajoch.com", true },
- { "sellcoins.top", true },
- { "selldorado.com", true },
- { "selldurango.com", true },
- { "sellguard.pl", true },
- { "sellingsherpa.com", true },
- { "sellme.biz", true },
- { "sellmymobile.com", true },
- { "sellmyphone.co.uk", true },
- { "sellorbuy.uk", true },
- { "sellorbuy.us", true },
- { "selltous.com.au", true },
- { "selo-cer.tk", true },
- { "seloc.org", true },
- { "seltendoof.de", true },
- { "semacode.com", true },
- { "semaf.at", true },
- { "semaflex.it", true },
- { "semakincantik.com", true },
- { "semantica.cz", false },
- { "semaphore-studios.com", true },
- { "sembyotic.com", true },
- { "semdynamics.com", true },
- { "semenov.ml", true },
- { "seminariosvip.com", true },
- { "seminariruum.ee", true },
- { "semiocast.com", true },
- { "semiotical.com", false },
- { "semiotika.tk", true },
- { "semiread.com", true },
- { "semjonov.de", true },
- { "semmuhely.tk", true },
- { "semobr.cf", true },
- { "semops.gq", true },
- { "semox.de", true },
- { "semps-2fa.de", true },
- { "semps-threema.de", true },
- { "semps.de", true },
- { "semsec.net", true },
- { "sen.bo", true },
- { "senarius.de", true },
- { "sendai-sisters.com", true },
- { "sendaiouji.com", true },
- { "sendbox.cz", true },
- { "sender.services", true },
- { "sendingbee.com", true },
- { "sendmeback.de", false },
- { "sendonce.io", true },
- { "sendthisfile.com", true },
- { "sendtrix.nl", true },
- { "sendway.com", true },
- { "sendya.me", true },
- { "sendzik.eu", true },
- { "senego.com", true },
- { "senekalstorageman.co.za", true },
- { "sengoku-okayama.net", true },
- { "sengokulife.com", true },
- { "senhost.tk", true },
- { "seniorem.eu", true },
- { "seniorhost.net", true },
- { "seniors.singles", true },
- { "senjukannonreiki.com", true },
- { "senmendai-reform.com", true },
- { "senneeeraerts.be", true },
- { "senobio.com", true },
- { "sens2lavie.com", true },
- { "sensebridge.net", true },
- { "sensepixel.com", true },
- { "senshot.com", true },
- { "senshudo.tv", true },
- { "sensor-dream.ru", true },
- { "sensorville.com.br", true },
- { "sensory-brands.com", true },
- { "sensualism.com", true },
- { "sensuality-models.com", true },
- { "sentandsecure.com", true },
- { "sentencing.net", true },
- { "sentenza.tk", true },
- { "sentidosdelatierra.org", true },
- { "sentinel.gov", true },
- { "sentinelproject.io", true },
- { "sentry.io", true },
- { "sentry.nu", true },
- { "senu.pro", true },
- { "senzaparole.de", true },
- { "seo-analyse.com", true },
- { "seo-dr-it.com", true },
- { "seo-forum.nu", true },
- { "seo-linz.at", true },
- { "seo-nerd.de", true },
- { "seo-obmen.tk", true },
- { "seo-phpbb.cf", true },
- { "seo-piar.tk", true },
- { "seo-portal.de", true },
- { "seo-reality.cf", true },
- { "seo-website.ru", true },
- { "seo.london", true },
- { "seoagentur2go.de", true },
- { "seoankara.name.tr", true },
- { "seobutler.com", true },
- { "seodayo.com", true },
- { "seoenmexico.com.mx", true },
- { "seoexpert.com.br", true },
- { "seogeek.nl", true },
- { "seohackers.fr", true },
- { "seoharish.com", true },
- { "seohouston.com", true },
- { "seoinc.com", true },
- { "seojames.com", true },
- { "seolabuitest.azurewebsites.net", true },
- { "seolotsen.de", true },
- { "seomarketing.bg", true },
- { "seomaton.com", true },
- { "seomaton.org", true },
- { "seomik.dk", true },
- { "seon.me", true },
- { "seoonline.cf", true },
- { "seoquake.com", true },
- { "seorus.cf", true },
- { "seosec.xyz", true },
- { "seoserfing.tk", true },
- { "seosof.com", true },
- { "seoul.dating", true },
- { "seovision.se", true },
- { "seoviziti50.tk", true },
- { "seowebexpert.co.uk", true },
- { "seowordpress.pl", true },
- { "seowork.tk", true },
- { "seozel.tk", true },
- { "sepalandseed.com", true },
- { "septakkordeon.de", true },
- { "septentrionalist.org", true },
- { "septfinance.ch", false },
- { "septicrepairspecialists.com", true },
- { "septonol.tk", true },
- { "septs.blog", true },
- { "sequencing.com", true },
- { "sequiturs.com", true },
- { "sera.jp", true },
- { "seraph.tokyo", true },
- { "serban.ro", true },
- { "serbanpaun.ro", true },
- { "serbianclimbing.com", false },
- { "sereema.com", true },
- { "serele.fr", true },
- { "serenaden.at", true },
- { "serenavilage.net", true },
- { "serenavillage.net", true },
- { "serenavillageresidence.com", true },
- { "serendeputy.com", true },
- { "serf.io", true },
- { "serfas.gr", true },
- { "serge-design.ch", true },
- { "sergeemond.ca", true },
- { "sergefonville.nl", true },
- { "sergeyreznikov.com", true },
- { "sergije-stanic.me", true },
- { "sergio.me", true },
- { "sergiozygmunt.com", true },
- { "serialexperiments.co.uk", true },
- { "serienstream.to", true },
- { "seriesdatv.pt", true },
- { "serigraphs.co.uk", true },
- { "serinamusic.com", true },
- { "seriousaboutsecurity.com", true },
- { "seriousclimbing.com", true },
- { "seriouss.am", true },
- { "serkanceyhan.com", true },
- { "serkaneles.com", true },
- { "sernate.com", true },
- { "serotiuk.com", false },
- { "serpenteq.com", true },
- { "serpic.photo", true },
- { "serrande.roma.it", true },
- { "serrano-chris.ch", false },
- { "serrature.roma.it", true },
- { "seru.eu", true },
- { "serve-a.com.au", true },
- { "servea.com.au", true },
- { "serveatechnologies.com", true },
- { "servepublic.com", true },
- { "servepublic.org", true },
- { "server-daten.de", true },
- { "server-essentials.com", true },
- { "server-eye.com", true },
- { "server-eye.de", true },
- { "serveradium.com", true },
- { "serverco.com", true },
- { "serverd.de", true },
- { "serverexpose.com", true },
- { "serverfrog.de", true },
- { "serverhost.no", true },
- { "serverhunter.com", true },
- { "serverlog.net", true },
- { "servermaster.sk", true },
- { "serverninja.tk", true },
- { "serveroffline.net", false },
- { "serverpedia.de", true },
- { "serversfrom.space", true },
- { "serversftw.com", true },
- { "serverstuff.info", true },
- { "serversuit.com", true },
- { "servertastic.com", true },
- { "servethecity-karlsruhe.de", true },
- { "servetten-groothandel.nl", true },
- { "servettorna.com", true },
- { "serveur.nl", true },
- { "serveursminecraft.org", true },
- { "servgate.jp", true },
- { "service.gov.uk", true },
- { "servicebeaute.fr", true },
- { "serviceboss.de", true },
- { "serviceinconstanta.ro", true },
- { "servicerequesthub.io", true },
- { "serviciales.com", true },
- { "servicios-electricos.com", true },
- { "servida.ch", true },
- { "servietten-grosshandel.at", true },
- { "servietten-grosshandel.be", true },
- { "servietten-grosshandel.ch", true },
- { "servietten-grosshandel.de", true },
- { "serviettenhaus.de", true },
- { "serviettes-et-plus.com", true },
- { "servilletas-de-papel.es", true },
- { "servilletas-de-papel.mx", true },
- { "servingbaby.com", true },
- { "servious.org", true },
- { "servitek.de", true },
- { "serviziourgente.it", true },
- { "servo.org", true },
- { "servtraq-staging.azurewebsites.net", true },
- { "servtraqazure.com", true },
- { "servx.org", true },
- { "serw.org", true },
- { "serwetki-papierowe.pl", true },
- { "serwusik.pl", true },
- { "seryox.com", true },
- { "sesam-biotech.com", true },
- { "sesamecare.com", true },
- { "sesrdcem.cz", true },
- { "sessile-oak.co.uk", true },
- { "session.bbc.co.uk", true },
- { "session.bbc.com", true },
- { "sessionslogning.dk", true },
- { "sesslerimmo.ch", true },
- { "sestra.in", true },
- { "sesturizm.com.tr", true },
- { "setasgourmet.es", true },
- { "setenforce.one", true },
- { "setesat.com.br", true },
- { "setevik.tk", true },
- { "sethcaplan.com", true },
- { "sethjust.com", true },
- { "sethlmatarassomd.com", true },
- { "sethriedel.com", true },
- { "sethvargo.com", true },
- { "setphaserstostun.org", false },
- { "setptusa.com", true },
- { "settberg.de", true },
- { "settimanadellascienza.it", true },
- { "settleapp.co", true },
- { "setuid.io", true },
- { "setuid0.kr", true },
- { "setuplog.io", true },
- { "setxrm.com", true },
- { "seutens.be", true },
- { "seutens.eu", true },
- { "seva.fashion", true },
- { "sevastopol.tk", true },
- { "sevathian.com", true },
- { "sevencooks.com", true },
- { "sevenhillsapartments.com.au", true },
- { "sevenicealimentos.com.br", true },
- { "seventwentynine.com", true },
- { "severntrentinsuranceportal.com", true },
- { "sevilinux.es", true },
- { "sevipro.mx", true },
- { "sevocomm.com", true },
- { "sevsey.ru", true },
- { "sewa.nu", true },
- { "sewafineseam.com", true },
- { "sewamobilperdana.com", true },
- { "sewatec.com", true },
- { "sewfarsewgood.co.uk", true },
- { "sewfarsewgood.uk", true },
- { "sewing-world.ru", true },
- { "sewinginsight.com", true },
- { "sewoo.co.uk", true },
- { "sex-education.com", true },
- { "sex-sex-cam.com", true },
- { "sex5.com", true },
- { "sexdocka.nu", true },
- { "sexedquickies.com", true },
- { "sexedrescue.com", true },
- { "sexflare.net", true },
- { "sexgarage.de", true },
- { "sexmobil.de", true },
- { "sexocomgravidas.com", true },
- { "sexologist.cf", true },
- { "sexoyrelax.com", true },
- { "sexplicit.co.uk", true },
- { "sextop1.pro", true },
- { "sexy-store.nl", true },
- { "sexyfotosvandep.nl", true },
- { "sexymassageoil.com", true },
- { "sexytagram.com", true },
- { "seyhanlar.com", true },
- { "seyr.me", true },
- { "sfa.sk", true },
- { "sfaparish.org", true },
- { "sfaturiit.ro", true },
- { "sfdev.ovh", true },
- { "sfg-net.com", true },
- { "sfg-net.eu", true },
- { "sfg-net.net", true },
- { "sfg-net.org", true },
- { "sfg-nordholz.de", true },
- { "sfile.eu", true },
- { "sfirat-haomer.com", true },
- { "sfleisure.com", true },
- { "sfo-fog.ch", false },
- { "sft-framework.org", true },
- { "sftool.gov", true },
- { "sg-elektro.de", true },
- { "sg.search.yahoo.com", false },
- { "sg1.tech", true },
- { "sgb.co", true },
- { "sgcaccounts.co.uk", true },
- { "sgcy.vip", true },
- { "sgdementia.ca", true },
- { "sggame990.com", true },
- { "sgh.ovh", true },
- { "sgi.org", true },
- { "sgitc.de", true },
- { "sglibellen.de", true },
- { "sglorch.me", false },
- { "sglynp.com", true },
- { "sgombero.it", true },
- { "sgrossi.it", true },
- { "sgroup-rec.com", true },
- { "sgrub.xyz", true },
- { "sgs-systems.de", true },
- { "sgs.camera", true },
- { "sgs.systems", true },
- { "sgsp.nl", true },
- { "sgtcodfish.com", true },
- { "sgtt.ch", false },
- { "sgutranscripts.org", true },
- { "sh-heppelmann.de", true },
- { "sh-network.de", true },
- { "sh0rt.zone", true },
- { "sh0shin.org", true },
- { "sh11.pp.ua", true },
- { "sh68.cc", true },
- { "sha2017.org", true },
- { "shaadithailand.com", true },
- { "shabiwangyou.com", true },
- { "shachang.com", true },
- { "shad.waw.pl", true },
- { "shadedesign.cz", true },
- { "shadesofgrayadr.com", true },
- { "shadesofgraylaw.com", true },
- { "shadex.net", true },
- { "shadigee.org", true },
- { "shadikhan.tk", true },
- { "shadowcp.eu", true },
- { "shadowfight2.tk", true },
- { "shadowkingdomrecords.com", true },
- { "shadowkitsune.net", true },
- { "shadowlurker.com.au", true },
- { "shadowsing.com", true },
- { "shadowsocks.com", true },
- { "shadowsocks.com.au", true },
- { "shadowsocks.com.hk", true },
- { "shadowsocks.fr", false },
- { "shadowsocks.la", true },
- { "shadowsocks.se", true },
- { "shadowsocks.to", true },
- { "shadowsocks.wiki", true },
- { "shadowvolt.net", true },
- { "shadwe.com", true },
- { "shadynook.net", true },
- { "shahar.cc", false },
- { "shaharyaranjum.com", true },
- { "shahidhashmi.net", true },
- { "shahpurjat.xyz", true },
- { "shahrsazan.tk", true },
- { "shahzaibm.com", true },
- { "shaicoleman.com", true },
- { "shakan.ch", false },
- { "shakebox.de", true },
- { "shaken110.com", true },
- { "shakerwebdesign.net", true },
- { "shakespearevet.com", true },
- { "shakingthehabitual.com", true },
- { "shakthifacility.com", true },
- { "shalazine.com", true },
- { "shaloc.site", true },
- { "shalott.org", true },
- { "shalyapin.by", true },
- { "sham-group.fr", true },
- { "shamans.ga", true },
- { "shamara.info", true },
- { "shampoo63.ru", true },
- { "shan.io", false },
- { "shan.si", true },
- { "shanahanstrategy.com", true },
- { "shanefagan.com", true },
- { "shanetully.com", true },
- { "shanewadleigh.com", true },
- { "shanhay.tk", true },
- { "shanju.tk", true },
- { "shannapeeples.com", true },
- { "shanoviyam.in", true },
- { "shanshushu.com", true },
- { "shansing.cn", true },
- { "shansing.com", true },
- { "shansing.net", true },
- { "shansing.space", true },
- { "shapediver.com", true },
- { "shapin.tv", true },
- { "sharanyamunsi.net", true },
- { "shard.vc", true },
- { "sharefox.eu", true },
- { "sharefox.nl", true },
- { "sharejoy.cn", false },
- { "sharekey.com", false },
- { "sharelovenotsecrets.com", true },
- { "shareoffice.ch", true },
- { "sharer.link", true },
- { "sharerotic.com", true },
- { "sharescope.co.uk", false },
- { "shareselecttools.com", true },
- { "sharevari.com", true },
- { "shareworks.com", true },
- { "sharik-msk.ga", true },
- { "sharik.ml", true },
- { "sharing-kyoto.com", true },
- { "sharingphotos.co", false },
- { "sharisharpe.com", true },
- { "shark.cat", true },
- { "shark5060.net", true },
- { "sharking.gq", true },
- { "sharpe.systems", true },
- { "sharu.me", true },
- { "sharvey.ca", true },
- { "shattered-souls.de", true },
- { "shaun.net", true },
- { "shaunandamyswedding.com", true },
- { "shaunc.com", true },
- { "shavegazette.com", true },
- { "shavit.space", true },
- { "shawiah.tk", true },
- { "shawnalucey.com", true },
- { "shawnhogan.com", true },
- { "shawnow.com", true },
- { "shawnwilkerson.com", true },
- { "shawnz.org", true },
- { "shaytan.tk", true },
- { "shazzlemd.com", true },
- { "shazzlepro.com", true },
- { "shcode.de", true },
- { "shdw.cc", true },
- { "shearcomfort.com", true },
- { "shearin.pro", true },
- { "sheaspire.com", true },
- { "shechipin.ml", true },
- { "shee.org", true },
- { "sheehyinfinitioftysonsparts.com", true },
- { "sheenveininstitutestl.com", true },
- { "sheepfriends.com", true },
- { "sheepproductions.com", true },
- { "sheerchain.com", true },
- { "sheet.host", true },
- { "sheffield-wednesday-fc.tk", true },
- { "shehaal.com", true },
- { "shehata.com", true },
- { "sheilagranger.com", true },
- { "sheilasdrivingschool.com", true },
- { "shejutu.com", true },
- { "shek.zone", true },
- { "shelbymunsch.com", true },
- { "shelehov.tk", true },
- { "shelfordsandstaplefordscouts.org.uk", true },
- { "shelfplanner.com", true },
- { "shelike.me", true },
- { "shellcon.io", true },
- { "shellday.cc", true },
- { "shelleystoybox.com", true },
- { "shellfire.de", true },
- { "shellgame.io", true },
- { "shellj.me", true },
- { "shellta.com", true },
- { "shellvatore.us", true },
- { "shelvacu.com", true },
- { "shenderman.ml", true },
- { "shengbao.org", false },
- { "shenghaiautoparts.com", true },
- { "shenghaiautoparts.net", true },
- { "shenqi.com", true },
- { "shens.ai", true },
- { "shenyuqi.com", false },
- { "shepherdsfriendly.co.uk", true },
- { "sherbers.de", true },
- { "sheremetka.com", true },
- { "shermantank.biz", true },
- { "sherpa.blog", true },
- { "sherrikehoetherapy.com", true },
- { "sherrikelley.com", true },
- { "sherut.net", true },
- { "shevet-achim.tk", true },
- { "shft.cl", true },
- { "shg-pornographieabhaengigkeit.de", false },
- { "shgroup.xyz", true },
- { "shgt.jp", true },
- { "shgw186.com", true },
- { "shh.sh", true },
- { "shiawasedo.co.jp", true },
- { "shibbydex.com", true },
- { "shibuya-rin.kr", true },
- { "shichibukai.net", true },
- { "shico.org", true },
- { "shidai88.cc", true },
- { "shielddagger.com", true },
- { "shielder.it", true },
- { "shieldofachilles.in", true },
- { "shift-record.com", true },
- { "shift-to.co.jp", true },
- { "shiftdevices.com", true },
- { "shiftj.is", true },
- { "shiftleft.org", true },
- { "shiftsixth.com", true },
- { "shiga1.jp", true },
- { "shigaben.or.jp", true },
- { "shiganmartialarts.com", true },
- { "shihadwiki.com", true },
- { "shiji.info", true },
- { "shijij.com", true },
- { "shijing.me", true },
- { "shikimori.org", true },
- { "shikiryu.com", true },
- { "shilpaonline.tk", true },
- { "shimi.blog", true },
- { "shimi.guru", true },
- { "shimi.net", true },
- { "shimmy1996.com", true },
- { "shimo.im", true },
- { "shin-yo.de", true },
- { "shinghoi.com", true },
- { "shinglereplacementlv.com", true },
- { "shining.gifts", true },
- { "shiningbright.co.id", true },
- { "shinnyosangha.org", false },
- { "shinomiya.group", false },
- { "shinsyo.com", true },
- { "shintoism.com", true },
- { "shinuytodaati.co.il", true },
- { "shiny.gift", false },
- { "shinyuu.net", true },
- { "shipard.com", true },
- { "shipard.cz", true },
- { "shipcloud.io", true },
- { "shippercenter.info", true },
- { "shippinglabel.de", false },
- { "shiqi.ca", true },
- { "shiqi.lol", true },
- { "shiqi.one", true },
- { "shiqi.online", true },
- { "shiqi.se", true },
- { "shiqi.tv", true },
- { "shiqi1.com", true },
- { "shiqishidai.cc", true },
- { "shiqisifu.cc", true },
- { "shirao.jp", true },
- { "shiresvets.com", true },
- { "shirevirtual.tk", true },
- { "shiriforum.tk", true },
- { "shirt2go.shop", true },
- { "shirtsdelivered.com", true },
- { "shirtsofholland.com", true },
- { "shishkin.us", true },
- { "shishlik.net", true },
- { "shitagi-shop.com", true },
- { "shitbeast.institute", true },
- { "shitcountries.org", true },
- { "shitmybradsays.com", false },
- { "shitnikovo.tk", true },
- { "shitposts.se", true },
- { "shitproductions.org", true },
- { "shitsta.in", true },
- { "shiva-temple.tk", true },
- { "shivamber.com", false },
- { "shivammathur.com", true },
- { "shixuen.com", true },
- { "shkololo.ml", true },
- { "shlmail.info", true },
- { "shock.ee", true },
- { "shockercityservices.com", true },
- { "shodan.io", true },
- { "shoemakerywc.com", true },
- { "shoeracks.uk", true },
- { "shoes-mori.co.jp", true },
- { "shoestringeventing.co.uk", true },
- { "shokola.com", true },
- { "shokureach.jp", true },
- { "shooter.dog", true },
- { "shop-hellsheadbangers.com", true },
- { "shop-s.net", true },
- { "shop-slivki.tk", true },
- { "shop4d.com", true },
- { "shopadvies.nl", true },
- { "shopalike.cz", true },
- { "shopalike.dk", true },
- { "shopalike.es", true },
- { "shopalike.fi", true },
- { "shopalike.fr", true },
- { "shopalike.hu", true },
- { "shopalike.it", true },
- { "shopalike.nl", true },
- { "shopalike.pl", true },
- { "shopalike.se", true },
- { "shopalike.sk", true },
- { "shopandworld.net", true },
- { "shopapi.cz", true },
- { "shoparbonne.co.uk", true },
- { "shopatkei.com", true },
- { "shopbakersnook.com", true },
- { "shopcoupon.co.za", true },
- { "shopcoupons.co.id", true },
- { "shopcoupons.my", true },
- { "shopcoupons.ph", true },
- { "shopcoupons.sg", true },
- { "shopfazz.com", true },
- { "shopfinale.com", true },
- { "shopific.com", true },
- { "shopifycloud.com", true },
- { "shopikal.com", true },
- { "shopjek.com", true },
- { "shopkini.com", true },
- { "shoplandia.co", true },
- { "shopmacher.de", true },
- { "shopminut.com", true },
- { "shoponlinedeals.tk", true },
- { "shoposal.com", true },
- { "shopperexperts.com", true },
- { "shopperexpertss.com", true },
- { "shopping24.de", true },
- { "shoppingandreviews.it", true },
- { "shoppingvrimini.ru", true },
- { "shoppr.dk", true },
- { "shopregional.com.br", true },
- { "shopstart.dk", true },
- { "shopstasy.com", true },
- { "shoptec.sk", true },
- { "shopunilever.com", true },
- { "shopwebhue.com", true },
- { "shorebreaksecurity.com", true },
- { "shorehamfort.co.uk", true },
- { "short-biography.com", false },
- { "short-term-plans.com", true },
- { "short.cm", true },
- { "short.wtf", true },
- { "shortcut.pw", true },
- { "shortdiary.me", true },
- { "shorten.ninja", true },
- { "shoshin-aikido.de", true },
- { "shoshin.technology", true },
- { "shossain.tk", true },
- { "shost.ga", true },
- { "shota-sekkotsuin.com", true },
- { "shota.soy", true },
- { "shota.vip", true },
- { "shotbow.net", true },
- { "shotsleeve.com", true },
- { "shouldihookupwithmybarista.com", true },
- { "shouttag.com", true },
- { "shovonhasan.com", true },
- { "showbits.net", true },
- { "showersnet.com", true },
- { "showfom.sb", true },
- { "showmax.com", true },
- { "showmethegadgets.com", true },
- { "showmethemoney.ru", true },
- { "showpassword.net", false },
- { "showroom.cam", true },
- { "showroom.co.uk", true },
- { "showroom.uk", true },
- { "showsonar.com", true },
- { "shoxmusic.net", false },
- { "shrapnel.ga", true },
- { "shred.ch", false },
- { "shredoptics.ch", false },
- { "shredriteservices.com", true },
- { "shrelief.org", true },
- { "shrike.me", false },
- { "shrimpcam.pw", true },
- { "shrinidhiclinic.in", true },
- { "shrt.tv", true },
- { "shrub.ca", true },
- { "shrug.ml", false },
- { "shsh.host", true },
- { "sht.life", true },
- { "shtaiman.com", true },
- { "shtaiman.net", true },
- { "shtaiman.org", true },
- { "shtaketniki.kz", true },
- { "shtaketniki.ru", true },
- { "shteiman.com", true },
- { "shteiman.net", true },
- { "shteiman.org", true },
- { "shu-fu.net", true },
- { "shuax.com", true },
- { "shuffleradio.nl", true },
- { "shugo.net", true },
- { "shuhacksoc.co.uk", true },
- { "shulan.moe", true },
- { "shulyaka.org.ru", true },
- { "shunliandongli.com", true },
- { "shuomingshu88.com", true },
- { "shura.eu.org", true },
- { "shuro.de", true },
- { "shuset.dk", true },
- { "shushu.media", true },
- { "shutter-shower.com", true },
- { "shutupbabyiknowit.party", true },
- { "shux.pro", true },
- { "shuzicai.cn", true },
- { "shybynature.com", true },
- { "shyuka.me", true },
- { "si-benelux.nl", true },
- { "si.to", true },
- { "si2b.fr", true },
- { "sia.one", true },
- { "siaggiusta.com", true },
- { "siamericas.com", true },
- { "siamrehab.com", true },
- { "siamsnus.com", true },
- { "sianbryn.co.uk", true },
- { "sianipestcontrolinc.com", true },
- { "siava.ru", true },
- { "siberas.de", true },
- { "siberia.gq", true },
- { "siberkulupler.com", true },
- { "sibertakvim.com", true },
- { "sibiutourguide.com", true },
- { "sibrenvasse.nl", true },
- { "sice-si.org", true },
- { "sich-fight.club", true },
- { "siciliadisinfestazioni.it", true },
- { "siciliamconsulting.com", true },
- { "sicilianbalm.com", true },
- { "siciliapulizie.it", true },
- { "sicken.eu", true },
- { "sicurezza24.info", true },
- { "sicurezzalavoro24.com", true },
- { "sicurled.com", true },
- { "sicz.de", true },
- { "sideleau.com", true },
- { "sidelka-tver.ru", true },
- { "sidema.be", true },
- { "sidemount-forum.com", true },
- { "sidemount-tauchen.com", true },
- { "sidepodcast.com", true },
- { "sidepodcastdaily.com", true },
- { "sidepodcastextra.com", true },
- { "sideshowbarker.net", true },
- { "sidi-smotri.ru", true },
- { "sidium.de", true },
- { "sidnicio.us", true },
- { "sidonge.com", true },
- { "sidongkim.com", true },
- { "sidsun.com", true },
- { "siecledigital.fr", true },
- { "siegemund-frankfurt.de", true },
- { "siel.nl", true },
- { "sielsystems.nl", true },
- { "sientemendoza.com.ar", true },
- { "siepomaga.net", true },
- { "sierpinska.co", true },
- { "sierramusic.tk", true },
- { "sietejefes.com.ar", true },
- { "sieumod.com", true },
- { "sift-tool.org", true },
- { "sig6.org", true },
- { "siga.com", true },
- { "sigabrt.org", true },
- { "sigcafe.net", true },
- { "siggerudklatreklubb.no", true },
- { "siggi.io", true },
- { "sight-sound.com", true },
- { "sightcure.jp", true },
- { "sighup.nz", true },
- { "sigismonda.ch", false },
- { "sigma-signalisation.com", true },
- { "sigma957.net", true },
- { "sigmalux.sarl", true },
- { "sigmapramuka.com", true },
- { "sigmaweb.co.uk", true },
- { "sign.dog", true },
- { "sign.io", true },
- { "signaconsultoria.com.br", true },
- { "signage.red", true },
- { "signal.org", false },
- { "signaletique-inox.fr", true },
- { "signalmaps.co.uk", true },
- { "signaturechannel.com", true },
- { "signaturedallas.com", true },
- { "significados.com", true },
- { "significados.com.br", true },
- { "significantbanter.com", true },
- { "signing-milter.org", false },
- { "signix.net", true },
- { "signpath.io", true },
- { "signtul.com", false },
- { "signup.ly", true },
- { "sigsrv.net", true },
- { "sigterm.no", true },
- { "sigterm.sh", true },
- { "sigurnost.online", true },
- { "siikaflix.tv", true },
- { "siirtutkusu.com", true },
- { "sik-it.nl", true },
- { "sikademy.com", true },
- { "sikaranbrotherhood.tk", true },
- { "sikayetvar.com", false },
- { "sikecikcomel.com", true },
- { "sikevux.se", true },
- { "sikko.biz", true },
- { "siku-shop.ch", true },
- { "silashes.com", true },
- { "silashes.ru", true },
- { "silaslova-ekb.ru", true },
- { "silent-clean.de", true },
- { "silent-yachts.com", true },
- { "silentexplosion.de", true },
- { "silentkernel.fr", true },
- { "silentundo.org", true },
- { "silesianlawyer.pl", true },
- { "silesianus.pl", true },
- { "silica-project.com", true },
- { "silica-project.jp", true },
- { "silicanetworks.com", true },
- { "silicon-north.com", true },
- { "silicon-vision.com", true },
- { "silkebaekken.no", true },
- { "silken-madame.tk", true },
- { "silkon.net", true },
- { "sillisalaatti.fi", true },
- { "sillysnapz.co.uk", true },
- { "silo.org.br", true },
- { "siloportem.net", true },
- { "silsha.me", true },
- { "silv.me", true },
- { "silver-heart.co.uk", true },
- { "silverartcollector.com", true },
- { "silverblog.org", true },
- { "silverbowflyshop.com", true },
- { "silverdragonart.com", true },
- { "silvergoldbull.be", true },
- { "silvergoldbull.by", true },
- { "silvergoldbull.ca", true },
- { "silvergoldbull.co.il", true },
- { "silvergoldbull.co.no", true },
- { "silvergoldbull.co.uk", true },
- { "silvergoldbull.com", true },
- { "silvergoldbull.com.ar", true },
- { "silvergoldbull.com.au", true },
- { "silvergoldbull.cr", true },
- { "silvergoldbull.cz", true },
- { "silvergoldbull.de", true },
- { "silvergoldbull.ec", true },
- { "silvergoldbull.ee", true },
- { "silvergoldbull.es", true },
- { "silvergoldbull.fi", true },
- { "silvergoldbull.gd", true },
- { "silvergoldbull.gl", true },
- { "silvergoldbull.gr", true },
- { "silvergoldbull.gt", true },
- { "silvergoldbull.hk", true },
- { "silvergoldbull.hn", true },
- { "silvergoldbull.hu", true },
- { "silvergoldbull.in", true },
- { "silvergoldbull.is", true },
- { "silvergoldbull.it", true },
- { "silvergoldbull.kr", true },
- { "silvergoldbull.li", true },
- { "silvergoldbull.lt", true },
- { "silvergoldbull.lv", true },
- { "silvergoldbull.ma", true },
- { "silvergoldbull.nz", true },
- { "silvergoldbull.pl", true },
- { "silvergoldbull.pt", true },
- { "silvergoldbull.qa", true },
- { "silvergoldbull.rs", true },
- { "silvergoldbull.se", true },
- { "silvergoldbull.si", true },
- { "silvergoldbull.sv", true },
- { "silvergoldbull.tw", true },
- { "silvergoldbull.uy", true },
- { "silvergoldbull.uz", true },
- { "silvergoldbull.ws", true },
- { "silverkingalaska.com", true },
- { "silverlinkz.net", true },
- { "silvernight.social", true },
- { "silvershadow.cc", true },
- { "silverspottrading.com", true },
- { "silvertorrents.cf", true },
- { "silverwind.io", true },
- { "silvesrom.ro", true },
- { "silvester-mitterschida.de", true },
- { "silviacataldi.com", true },
- { "silvine.xyz", true },
- { "silvobeat.blog", true },
- { "sim-karten.net", true },
- { "sim-minaoshi.jp", true },
- { "sim-mobile.ml", true },
- { "sim-usa.mobi", true },
- { "sim4seed.org", true },
- { "simam.de", true },
- { "simark.ca", true },
- { "simbamail.de", true },
- { "simbeton.nl", true },
- { "simcoecurlingclub.ca", true },
- { "simeonoff.ninja", true },
- { "simetal.ch", true },
- { "simfdr.com", true },
- { "simfed.org", true },
- { "simivalleyelectrical.com", true },
- { "simivalleyexteriorlighting.com", true },
- { "simivalleylandscapelighting.com", true },
- { "simivalleylighting.com", true },
- { "simivalleyoutdoorlighting.com", true },
- { "simkova-reality.cz", true },
- { "simlau.net", true },
- { "simmis.fr", false },
- { "simmtronic.com", true },
- { "simnovo.net", true },
- { "simoesgoulart.com.br", true },
- { "simon-agozzino.fr", true },
- { "simon-czech.de", true },
- { "simon-hofmann.org", true },
- { "simon-mueller.de", true },
- { "simon3k.moe", true },
- { "simonastallone.com", true },
- { "simonberard.garden", true },
- { "simonbondo.dk", true },
- { "simoncommunity.org.uk", true },
- { "simoncook.org", true },
- { "simonevans.uk", true },
- { "simonfischer.info", true },
- { "simonhirscher.de", true },
- { "simonholst.dk", true },
- { "simonkjellberg.com", true },
- { "simonkjellberg.se", true },
- { "simonlyabonnement.nl", true },
- { "simonmaddox.com", true },
- { "simonmanuel.com", true },
- { "simonpayne.cz", true },
- { "simonreich.de", true },
- { "simonshine.dk", true },
- { "simonsmh.cc", true },
- { "simonspeich.ch", true },
- { "simonsreich.de", true },
- { "simonssh.ddns.net", true },
- { "simontaite.com", true },
- { "simonweil.com", true },
- { "simonwessel.net", true },
- { "simonwoodside.com", true },
- { "simosol.de", true },
- { "simosol.dk", true },
- { "simpbx.net", true },
- { "simpel.be", true },
- { "simphony.cz", true },
- { "simpip.com", true },
- { "simple.com", false },
- { "simplecmsdemo.com", true },
- { "simplecoding.click", true },
- { "simplecontacts.com", true },
- { "simplecryptoconvert.com", true },
- { "simplednscrypt.org", true },
- { "simplegoodhealth.com", true },
- { "simpleinout.com", true },
- { "simpleinvoices.io", true },
- { "simpleit.services", true },
- { "simplelinux.tk", true },
- { "simplemining.net", true },
- { "simpleprojects.net", true },
- { "simpleshirts.us", true },
- { "simpletax.ca", true },
- { "simplewire.de", true },
- { "simplia.cz", true },
- { "simplicitypvp.net", true },
- { "simplidesigns.nl", true },
- { "simplifyengineering.co.uk", true },
- { "simplifylivelove.com", true },
- { "simplixos.org", true },
- { "simplosoft.co.uk", true },
- { "simply.scot", true },
- { "simplycateringequipment.co.uk", true },
- { "simplycharlottemason.com", true },
- { "simplycloud.de", true },
- { "simplyfixit.co.uk", true },
- { "simplyhelen.de", true },
- { "simplymozzo.se", true },
- { "simplyowners.net", true },
- { "simplyregister.net", true },
- { "simplysmartgardening.com", true },
- { "simplytiles.com", true },
- { "simpte.com", true },
- { "simrail.nl", true },
- { "simsimi.ml", true },
- { "simsnieuws.nl", true },
- { "simulfund.com", true },
- { "simulise.com", true },
- { "simulping.com", true },
- { "sin-el-fil.com", true },
- { "sin.swiss", false },
- { "sinalizeweb.com.br", false },
- { "sinanaydemir.com.tr", true },
- { "sinaryuda.web.id", true },
- { "sinavyo.ml", true },
- { "sincemydivorce.com", true },
- { "sinclairinat0r.com", true },
- { "sincordones.net", true },
- { "sindarina.com", true },
- { "sindarina.eu", true },
- { "sindarina.net", true },
- { "sinde.ru", true },
- { "sindicatoburgos.org", true },
- { "sinergy.ch", false },
- { "sinews.tk", true },
- { "sinfonietta-meridiana.de", true },
- { "sinful.pw", true },
- { "sinfully.gq", true },
- { "sinfulthrills.co.uk", true },
- { "singaporemint.com", true },
- { "singapurfirma.com", true },
- { "singel.ch", true },
- { "singer.ru", true },
- { "single-in-stuttgart.de", true },
- { "singles-aus-hamburg.de", true },
- { "singles-berlin.de", true },
- { "singleuse.link", true },
- { "singlu10.org", false },
- { "sinhnhatbaby.com", true },
- { "sinluzvenezuela.tk", true },
- { "sinmik.com", true },
- { "sinnersprojects.ro", true },
- { "sinomod.com", true },
- { "sinonimos.com.br", true },
- { "sinonimosonline.com", true },
- { "sinquin.eu", true },
- { "sinronet.com", true },
- { "sint-joris.nl", true },
- { "sintaxis.org", true },
- { "sinterama.biz", true },
- { "sinuelovirtual.com.br", true },
- { "sinusbot.online", true },
- { "sinusitis-bronchitis.ch", true },
- { "sioeckes.hu", true },
- { "siogyumolcs.hu", true },
- { "sion-colony.tk", true },
- { "sion.info", true },
- { "sipa.nc", true },
- { "sipa.pf", true },
- { "sipc.org", true },
- { "sipstix.co.za", true },
- { "sipyuru.com", true },
- { "sipyuru.lk", true },
- { "sirandorung.tk", true },
- { "siraweb.org", true },
- { "sirbouncealotcastles.co.uk", true },
- { "sirbouncelot.co.uk", true },
- { "sirchuk.net", true },
- { "sircon.no", true },
- { "sirena.co.jp", true },
- { "sirencallofficial.com", true },
- { "sirenslove.com", true },
- { "sirg.fr", true },
- { "sirihouse.com", true },
- { "siriuspup.com", true },
- { "sirtaptap.com", true },
- { "sirtuins.com", true },
- { "sirvoy.ca", true },
- { "sirvoy.co.nz", true },
- { "sirvoy.co.uk", true },
- { "sirvoy.co.za", true },
- { "sirvoy.com", true },
- { "sirvoy.com.au", true },
- { "sirvoy.de", true },
- { "sirvoy.dk", true },
- { "sirvoy.es", true },
- { "sirvoy.fi", true },
- { "sirvoy.fr", true },
- { "sirvoy.ie", true },
- { "sirvoy.jp", true },
- { "sirvoy.nl", true },
- { "sirvoy.no", true },
- { "sirvoy.se", true },
- { "sis.net.sa", true },
- { "siscompt.com", true },
- { "siselectrom.com", true },
- { "sisirbatu.tk", true },
- { "sismit.com", true },
- { "sismit.es", true },
- { "sissden.eu", true },
- { "sisseastumine.ee", true },
- { "sistel.es", true },
- { "sistem-maklumat.com", true },
- { "sistem-maklumat.com.my", true },
- { "sistemy48.ru", false },
- { "sisterjoeworld.com", true },
- { "sistimiki-anaparastasi.gr", true },
- { "sistov.it", true },
- { "sisu.ai", true },
- { "sisv.eu", true },
- { "sisver.host", true },
- { "sisver.mx", true },
- { "sit-brn.ru", true },
- { "sit.ec", true },
- { "sit.moe", true },
- { "sitahk.org", true },
- { "sitanleta.de", true },
- { "sitc.sk", true },
- { "site-helper.com", true },
- { "site-ua.tk", true },
- { "site.pictures", true },
- { "site2002.tk", true },
- { "sitebuilderreport.com", true },
- { "sitecentre.com.au", true },
- { "sitedebelezaemoda.com.br", true },
- { "sitedrive.fi", true },
- { "sitefactory.com.br", true },
- { "sitekatalog.tk", true },
- { "sitelmexico.com", true },
- { "sitemai.eu", true },
- { "sitempro.com.mx", true },
- { "sitenv.org", true },
- { "siterencontre.me", true },
- { "sites.google.com", true },
- { "sitesdesign.tk", true },
- { "sitesko.de", true },
- { "sitevandaag.nl", true },
- { "siteweb-seo.fr", true },
- { "sithijaya.tk", true },
- { "sitischu.com", true },
- { "sitiweb.nl", true },
- { "sito-online.ch", true },
- { "sittogether.club", true },
- { "sittogether.tw", true },
- { "sitz.ch", true },
- { "siulam-wingchun.org", true },
- { "siusto.com", true },
- { "sivale.mx", true },
- { "sivyerge.com", true },
- { "siw64.com", true },
- { "six-o-one.com", true },
- { "sixcolors.lu", true },
- { "sixnines.net", true },
- { "sixpackholubice.cz", true },
- { "sj-leisure.com", true },
- { "sjaakgilsingfashion.nl", true },
- { "sjamaan.nl", false },
- { "sjbwoodstock.org", true },
- { "sjd.is", false },
- { "sjdaws.com", true },
- { "sjleisure.co.uk", true },
- { "sjnp.org", true },
- { "sjoorm.com", true },
- { "sjorsvanweert.nl", true },
- { "sjrcommercialfinance.co.uk", true },
- { "sjsmith.id.au", true },
- { "sjwheel.net", true },
- { "sk33t.cf", true },
- { "sk33t.ga", true },
- { "sk33t.gq", true },
- { "sk33t.ml", true },
- { "sk33t.tk", true },
- { "skagen-feriebolig.dk", true },
- { "skaginn.tv", true },
- { "skaiman.ga", true },
- { "skala.io", true },
- { "skalar.sk", true },
- { "skalec.org", true },
- { "skanvordoff.ru", true },
- { "skatclub-beratzhausen.de", true },
- { "skateaustria.at", true },
- { "skatesins.ch", true },
- { "skateswagger.com", true },
- { "skatingchina.com", true },
- { "skatn.de", true },
- { "skazka.ml", true },
- { "skazka.ru", true },
- { "skday.com", true },
- { "skedda.com", true },
- { "skedr.io", false },
- { "skeeley.com", true },
- { "skei.org", true },
- { "skelleypiano.com", true },
- { "skepticalsports.com", true },
- { "skeriv.com", true },
- { "sketch.jpn.com", true },
- { "sketchbox.tk", true },
- { "skgzberichtenbox.nl", true },
- { "skhaz.io", true },
- { "skhire.co.uk", true },
- { "skhoop.cz", true },
- { "skiblandford.com", true },
- { "skid-berlin.de", true },
- { "skid.church", true },
- { "skiddle.com", true },
- { "skifairview.com", true },
- { "skifttiljutlanderbank.dk", true },
- { "skigebied.nl", true },
- { "skigebiete-test.de", true },
- { "skiingnewsletter.cf", true },
- { "skiinstructor.services", true },
- { "skiley.net", true },
- { "skill.moe", true },
- { "skillled.com", true },
- { "skillmoe.at", true },
- { "skilloutlook.com", true },
- { "skills2services.com", true },
- { "skillside.net", true },
- { "skin-cosmetic.eu", true },
- { "skincare-note.com", true },
- { "skincareagent.cf", true },
- { "sking.io", true },
- { "skinmodo.com", true },
- { "skinseries.cf", true },
- { "skipfault.com", true },
- { "skippy.dog", true },
- { "skirts.tk", true },
- { "skischule-wildewiese.de", true },
- { "skizzen-zeichnungen.de", true },
- { "skjt.co.jp", true },
- { "skk.moe", true },
- { "sklep-majster.pl", true },
- { "sklepvoip.tel", true },
- { "sklotechnik.cz", true },
- { "sknclinics.co.uk", true },
- { "skol.bzh", true },
- { "skolagatt.is", true },
- { "skolakrizik.cz", true },
- { "skolappar.nu", true },
- { "skolebil.dk", true },
- { "skolem.de", true },
- { "skolnilogin.cz", true },
- { "skommettiamo.it", true },
- { "skontakt.cz", true },
- { "skooks.fr", true },
- { "skoolergraph.azurewebsites.net", true },
- { "skorepova.info", true },
- { "skorovsud.ru", true },
- { "skorpil.cz", true },
- { "skortekaas.nl", false },
- { "skory.us", true },
- { "skpk.de", true },
- { "skram.de", true },
- { "skremovals.co.uk", true },
- { "sktan.com", true },
- { "sktorrent.org", true },
- { "skuizy.ddns.net", true },
- { "skulblaka.ch", true },
- { "skulblaka.cloud", true },
- { "skuldwyrm.no", true },
- { "skullbite.me", true },
- { "skutry-levne.cz", true },
- { "skutry.cz", true },
- { "skux.ch", true },
- { "skwile-cafe.com", true },
- { "skwitko.com", true },
- { "sky-coach.com", true },
- { "sky-coach.nl", true },
- { "sky-live.fr", true },
- { "sky-torch.com", true },
- { "skyanchor.com", true },
- { "skyautorental.com", true },
- { "skybloom.com", true },
- { "skyblue.co.jp", true },
- { "skycmd.net", true },
- { "skyderby.ru", true },
- { "skydiverapp.com", true },
- { "skydragoness.com", true },
- { "skydrive.live.com", false },
- { "skyem.co.uk", false },
- { "skyfone.cz", true },
- { "skyger.cz", true },
- { "skyingo.net", true },
- { "skylarker.org", true },
- { "skylgenet.nl", true },
- { "skylightcreative.com.au", true },
- { "skylinertech.com", true },
- { "skylineservers.com", true },
- { "skyloisirs.ch", false },
- { "skynet233.ch", false },
- { "skynethk.com", true },
- { "skynetnetwork.eu.org", true },
- { "skynetstores.ae", true },
- { "skynetstores.net", true },
- { "skynetz.tk", true },
- { "skyntalent.com", true },
- { "skyoy.com", true },
- { "skype.com", true },
- { "skyportcloud.com", true },
- { "skyquid.co.uk", true },
- { "skyros.us", true },
- { "skys-entertainment.com", true },
- { "skyscanner.com", true },
- { "skyscanner.gg", true },
- { "skyscanner.net", true },
- { "skyscanner.pt", true },
- { "skyscanner.ru", true },
- { "skyscapecanopies.com", true },
- { "skyscnr.com", true },
- { "skysuite.nl", true },
- { "skytec.host", true },
- { "skywalkers.net", true },
- { "skywt.cn", true },
- { "skyynet.de", true },
- { "skyzimba.com.br", true },
- { "sl-bildermacher.de", true },
- { "sl66.cc", true },
- { "slab.com", false },
- { "slack-files.com", true },
- { "slack.com", true },
- { "sladic.si", false },
- { "slainvet.net", true },
- { "slalix.pw", true },
- { "slamdjapan.com", true },
- { "slamix.nl", true },
- { "slan.fr", true },
- { "slane.cn", false },
- { "slangbellor.com", true },
- { "slanterns.net", true },
- { "slapen17.nl", true },
- { "slash32.co.uk", true },
- { "slate.to", true },
- { "slatemc.com", true },
- { "slaughter.com", true },
- { "slaughterhouse.fr", true },
- { "slavasoloviev.com", true },
- { "slavasveta.info", true },
- { "sld08.com", true },
- { "sldlcdn.com", true },
- { "sleep-go.info", true },
- { "sleepawaycampseries.tk", true },
- { "sleepet.tw", true },
- { "sleeplessbeastie.eu", true },
- { "sleepmap.de", true },
- { "sleeps.jp", true },
- { "sleepstar.co.uk", true },
- { "sleepstar.de", true },
- { "sleepstar.fr", true },
- { "sleestak.net", true },
- { "sleio.com", true },
- { "slepsluzbabeograd.org", true },
- { "sletat.ru", true },
- { "slevermann.de", true },
- { "slevomat.cz", true },
- { "slicklines.co.uk", true },
- { "slidebatch.com", true },
- { "slim-planet.com", true },
- { "slim-slender.com", true },
- { "slimspots.com", true },
- { "slingoweb.com", true },
- { "slink.hr", true },
- { "slipknot-site.tk", true },
- { "sliptrickrecords.com", true },
- { "slite.com", true },
- { "slneighbors.org", true },
- { "slo-net.net", true },
- { "slo-tech.com", true },
- { "sloancom.com", true },
- { "sloanrealtygroup.com", true },
- { "slobrowink.com", true },
- { "slogan.tk", true },
- { "sloneczni.pl", true },
- { "slonep.net", true },
- { "slopeedge.net", true },
- { "slotarazzi.com", true },
- { "slotcar.com", false },
- { "slotfara.com", true },
- { "slotfara.net", true },
- { "sloths.org", true },
- { "slotlist.info", true },
- { "slovenskycestovatel.sk", true },
- { "slow.social", true },
- { "slow.zone", false },
- { "slowb.ro", true },
- { "slowcookingperfected.com", true },
- { "slowgames.xyz", true },
- { "slownik123.pl", true },
- { "slowsocial.email", true },
- { "slowsocial.eu", true },
- { "slowsocial.net", true },
- { "slowsocial.org", true },
- { "slpm.com", true },
- { "slpower.com", true },
- { "slrpancreaticsurgery.org", true },
- { "slt24.de", true },
- { "sluciaconstruccion.com", true },
- { "sluhockey.com", true },
- { "sluimann.de", true },
- { "slunecnice.cz", true },
- { "sluo.org", true },
- { "slusham.com", true },
- { "slushpool.com", true },
- { "slutty-girls.cf", true },
- { "slvh.fr", true },
- { "slwilde.ca", true },
- { "slxh.eu", true },
- { "slxh.nl", true },
- { "slymak.com", true },
- { "slytech.ch", false },
- { "slyvon.com", true },
- { "sm-kyoushitsu.com", true },
- { "sm-supplements.gr", true },
- { "sm.link", true },
- { "sm.ms", true },
- { "sma-gift.com", true },
- { "smackhappy.com", true },
- { "smakassen.no", true },
- { "smakoszwegrzynka.pl", true },
- { "smaksbanken.no", true },
- { "small-panda.com", true },
- { "smallbytedesign.co", true },
- { "smallcloudsolutions.co.za", true },
- { "smalldata.tech", true },
- { "smalle-voet.de", true },
- { "smallhadroncollider.com", true },
- { "smalltalkconsulting.com", true },
- { "smaltimento-rifiuti.com", true },
- { "smaltimento-rifiuti.org", true },
- { "smaltimento.caserta.it", true },
- { "smaltimento.milano.it", true },
- { "smaltimento.napoli.it", true },
- { "smaltimento.roma.it", true },
- { "smaltimento.salerno.it", true },
- { "smaltimentoamianto.campania.it", true },
- { "smaltimentoamianto.frosinone.it", true },
- { "smaltimentoamianto.latina.it", true },
- { "smaltimentorifiuti.firenze.it", true },
- { "smaltimentorifiuti.livorno.it", true },
- { "smaltimentorifiuti.milano.it", true },
- { "smaltimentorifiuti.prato.it", true },
- { "smaltimentorifiuti.roma.it", true },
- { "smaltimentorifiuti.veneto.it", true },
- { "smamunir.is", true },
- { "smares.de", true },
- { "smarntrading.com", true },
- { "smart-cp.jp", true },
- { "smart-informatics.com", true },
- { "smart-media-gmbh.de", true },
- { "smart-wohnen.net", true },
- { "smart.gov", true },
- { "smart.vet", true },
- { "smartacademy.ge", true },
- { "smartacademy.pro", true },
- { "smartairkey.com", true },
- { "smartandcom.ch", false },
- { "smartandhappychild.ro", false },
- { "smartcheck.gov", true },
- { "smartcleaningcenter.nl", true },
- { "smartcover.tk", true },
- { "smartcpa.ca", true },
- { "smartedg.io", true },
- { "smartfit.cz", true },
- { "smartftp.com", true },
- { "smartgrid.gov", true },
- { "smartgridsecurity.com", true },
- { "smarthdd.com", true },
- { "smarthinking.nl", true },
- { "smarthouse.de", true },
- { "smartime.com.ar", true },
- { "smartjoin.style", true },
- { "smartleads.tk", true },
- { "smartlink.sk", true },
- { "smartlocksmith.com", true },
- { "smartlogreturns.com", true },
- { "smartlogstock.com", true },
- { "smartlogtower.com", true },
- { "smartmachine.com", true },
- { "smartmail24.de", true },
- { "smartmeal.ru", true },
- { "smartmessages.net", true },
- { "smartminibushire.co.uk", true },
- { "smartmomsmartideas.com", true },
- { "smartmones.com", true },
- { "smartpatika.hu", true },
- { "smartpheromones.com", true },
- { "smartphone-blog.de", true },
- { "smartphone-pliable.wtf", true },
- { "smartphonechecker.co.uk", true },
- { "smartphones-baratos.com", true },
- { "smartphonesolution.tk", true },
- { "smartplace.ro", true },
- { "smartpolicingplatform.com", true },
- { "smartproductguide.com", true },
- { "smartpti.net", true },
- { "smartrecruit.ro", true },
- { "smartresumeservices.com", true },
- { "smartservices.nl", true },
- { "smartshiftme.com", true },
- { "smartship.co.jp", true },
- { "smartshoppers.es", true },
- { "smartsitio.com", true },
- { "smartsparrow.com", true },
- { "smartthursday.hu", true },
- { "smartvideo.io", true },
- { "smartweb.ge", true },
- { "smartwoodczech.cz", true },
- { "smartwritingservice.com", true },
- { "smartwurk.nl", false },
- { "smatch.com", true },
- { "smb445.com", true },
- { "smcj.xyz", true },
- { "smdavis.us", true },
- { "smdcn.net", true },
- { "smdtk.com", true },
- { "sme-gmbh.net", true },
- { "smeetsengraas.com", true },
- { "smelly.cloud", true },
- { "smesitel-online.ru", true },
- { "smeso.it", true },
- { "smexpt.com", true },
- { "smiatek.name", true },
- { "smiblog.tk", true },
- { "smicompact.com", true },
- { "smileandpay.com", true },
- { "smilecon.cf", true },
- { "smilenwa.com", true },
- { "smilesatlakewood.com", true },
- { "smilessoftplay.co.uk", true },
- { "smileytechguy.com", true },
- { "smilingmiao.com", true },
- { "smime.io", true },
- { "smimea.info", true },
- { "smipty.cn", true },
- { "smipty.com", true },
- { "smit.com.ua", true },
- { "smith.bz", true },
- { "smith.co", false },
- { "smithandcanova.co.uk", false },
- { "smithchung.eu", true },
- { "smithf.red", true },
- { "smits.frl", true },
- { "smkw.com", false },
- { "smm.im", true },
- { "smokeandmirrors.agency", true },
- { "smokefree.gov", true },
- { "smokefreerowan.org", true },
- { "smokeping.pl", true },
- { "smokeus.dk", true },
- { "smokinghunks.com", true },
- { "smoo.st", true },
- { "smoothcomp.com", true },
- { "smoothgesturesplus.com", true },
- { "smoothiecriminals.com", true },
- { "smoothtalker.com", true },
- { "smrtrpck.com", true },
- { "sms-go.ru", true },
- { "sms-pro.tk", true },
- { "sms.storage", true },
- { "sms72.tk", true },
- { "smsappointment.com", true },
- { "smsbrana.cz", true },
- { "smsinger.com", true },
- { "smsk.email", true },
- { "smsk.io", true },
- { "smskmail.com", true },
- { "smslodging.com", true },
- { "smsprivacy.org", true },
- { "smspujcka24.eu", true },
- { "smtenants.cn", true },
- { "smtp.in.th", true },
- { "smtparish.org", true },
- { "smuncensored.com", true },
- { "smuns.ch", true },
- { "smutek.net", true },
- { "smvcm.com", true },
- { "smx.net.br", true },
- { "sn0int.com", true },
- { "snabbare-dator.se", true },
- { "snabbit-support.nu", true },
- { "snabblim.tk", true },
- { "snackbesteld.nl", true },
- { "snafu.cz", true },
- { "snakafya.com", true },
- { "snap.com", true },
- { "snapappointments.com", true },
- { "snapintegrations.net", true },
- { "snapserv.ch", true },
- { "snapserv.net", true },
- { "snargol.com", true },
- { "snatch-note.tk", true },
- { "snatch.com.ua", true },
- { "snazel.co.uk", true },
- { "sncdn.com", true },
- { "sndbouncycastles.co.uk", true },
- { "snea-kers.tk", true },
- { "sneak.berlin", true },
- { "sneakersmexs.com", true },
- { "sneakpod.de", true },
- { "sneakycode.net", true },
- { "sneakynote.com", true },
- { "sneberger.cz", false },
- { "sneed.it", true },
- { "sneedit.com", true },
- { "sneedit.de", true },
- { "snegozaderzhatel.ru", true },
- { "snel4u.nl", true },
- { "snelbv.nl", true },
- { "snelshops.nl", true },
- { "snelwebshop.nl", true },
- { "snelxboxlivegold.nl", true },
- { "snerith.com", true },
- { "snfdata.com", false },
- { "sngeo.com", true },
- { "sngnews.tk", true },
- { "snh48live.org", true },
- { "sniderman.eu.org", true },
- { "sniderman.org", true },
- { "sniderman.us", true },
- { "sniep.net", true },
- { "sniffing.gq", true },
- { "snille.com", true },
- { "snipermarkettiming.com", true },
- { "snippet.wiki", true },
- { "snipr.gg", true },
- { "snizl.com", true },
- { "snj.pt", true },
- { "snl.no", true },
- { "sno-kingroofing-gutters.com", true },
- { "snoerendevelopment.nl", true },
- { "snohomishsepticservice.com", true },
- { "snoopyfacts.com", true },
- { "snoot.club", true },
- { "snopyta.org", true },
- { "snortfroken.net", true },
- { "snote.io", true },
- { "snoupon.com", true },
- { "snow-online.com", true },
- { "snow.dog", true },
- { "snowalerts.nl", true },
- { "snowboardforum.tk", true },
- { "snowchamps.nl", true },
- { "snowcrestdesign.com", true },
- { "snowdy.dk", true },
- { "snowhaze.ch", true },
- { "snowhaze.com", true },
- { "snoworld.one", true },
- { "snowpak.com", true },
- { "snowparties.com", true },
- { "snowpaws.de", true },
- { "snowplane.net", false },
- { "snowraven.de", true },
- { "snowreport.io", true },
- { "snowrippers.ro", false },
- { "snowy.land", true },
- { "snperformance.gr", true },
- { "snroth.de", true },
- { "snrub.co", true },
- { "snsirius.cf", true },
- { "sntravel.co.uk", true },
- { "snuff.porn", true },
- { "snuverma.com", true },
- { "snwsjz.com", true },
- { "sny.no", true },
- { "so.is-a-cpa.com", true },
- { "soacompanhantes.vip", true },
- { "soakgames.com", true },
- { "soapitup.com.au", true },
- { "soaringtoglory.com", true },
- { "sobakasite.tk", true },
- { "sobaya-gohei.com", true },
- { "sobczakdesign.de", true },
- { "sobeau.com", true },
- { "sobersys.com", true },
- { "sobie.ch", true },
- { "sobieray.dyndns.org", true },
- { "soblaznenie.ru", true },
- { "soblaznenie2.ru", true },
- { "sobotkama.eu", true },
- { "sobreporcentagem.com", true },
- { "soc.net", true },
- { "socal-babes.com", true },
- { "socaliente.fr", true },
- { "soccers.fr", true },
- { "socheat.net", true },
- { "sochi-sochno.ru", true },
- { "sochic.in", true },
- { "sochionline.tk", true },
- { "sociability.dk", true },
- { "social-events.net", false },
- { "social-media-strategies.it", true },
- { "social-work-colleges.com", true },
- { "socialair.tk", true },
- { "socialclimb.com", true },
- { "socialhams.net", true },
- { "socializam.com", true },
- { "sociallyunited.net", true },
- { "socialmarketingday.nl", true },
- { "socialmedia-manager.gr", true },
- { "socialnitro.com", true },
- { "socialnous.co", true },
- { "socialrank.com", true },
- { "socialsecurity.gov", false },
- { "socialsecurityhelpcenters.com", true },
- { "socialsurvivalist.net", true },
- { "socialtrends.pl", true },
- { "socialz.nl", true },
- { "sociedadsostenible.tk", true },
- { "societe-chablaisienne-de-revetements.com", true },
- { "societe-chablaisienne-de-revetements.fr", true },
- { "societyhilldance.com", true },
- { "sociobiology.com", true },
- { "sociology-schools.com", true },
- { "sociopathy.org", true },
- { "sockeye.io", true },
- { "sockfetish.net", true },
- { "sockscap64.com", true },
- { "socoastal.com", true },
- { "socost.net", true },
- { "socreates.cn", true },
- { "soczu.duckdns.org", true },
- { "sodadigital.com.au", true },
- { "sodafilm.de", true },
- { "sodexam.pro", true },
- { "sodi.nl", true },
- { "sodomojo.com", true },
- { "soe-server.com", true },
- { "sofa-rockers.org", true },
- { "sofabedshop.de", true },
- { "sofaclean.co.uk", true },
- { "sofacleanerslondon.co.uk", true },
- { "soffit.com", true },
- { "sofgen.com", true },
- { "sofiadaoutza.gr", true },
- { "sofiaestado.com", true },
- { "sofialobocera.com", true },
- { "sofiavanmoorsel.com", true },
- { "sofiawestergren.com", true },
- { "sofiesteinfeld.de", true },
- { "sofoco.us", true },
- { "sofortimplantate-muenchen.de", true },
- { "soft41.ru", true },
- { "softandbouncy.co.uk", true },
- { "softanka.com", true },
- { "softballrampage.com", true },
- { "softbit.pt", true },
- { "softblinds.co.uk", true },
- { "softcreatr.com", true },
- { "softcreatr.de", false },
- { "softfay.com", true },
- { "softlan.com.py", true },
- { "softly.sk", true },
- { "softonic.com", true },
- { "softonic.jp", true },
- { "softonic.pl", true },
- { "softplay4hire.co.uk", true },
- { "softplaynation.co.uk", true },
- { "softprayog.in", true },
- { "softtennis-zenei.com", true },
- { "softw.net", true },
- { "software-search.com", true },
- { "softwarecloud.ml", true },
- { "softwaredesign.foundation", false },
- { "softwarepara.net", true },
- { "softwaresecurityandradefernando.be", true },
- { "softwarevoortherapeuten.nl", true },
- { "softwaylancing.com", true },
- { "softweb-dev.de", true },
- { "softwerk-edv.de", true },
- { "softwing.de", true },
- { "softwsabri.be", true },
- { "sogola.com", true },
- { "sogravatas.com.br", true },
- { "sogutma.com.tr", true },
- { "sohamroy.me", true },
- { "soia.ca", true },
- { "sointelcom.com.co", true },
- { "sokaissues.info", true },
- { "sokak-sanati.tk", true },
- { "soket.ee", true },
- { "sokietech.com", true },
- { "sokkenhoek.nl", true },
- { "soko.nl", true },
- { "sokolkarvina.cz", true },
- { "sokouchousa.net", true },
- { "sol-3.de", false },
- { "sol-computers.es", true },
- { "sol24.net", true },
- { "solacyre.ch", false },
- { "solanum-games.com", true },
- { "solar-aydinlatma.com", true },
- { "solar-ec.com", true },
- { "solar-floodlight.ca", true },
- { "solar-systems.ca", true },
- { "solar-window.ca", true },
- { "solarfever.ga", true },
- { "solarloon.com", true },
- { "solarplan-berlin.de", true },
- { "solarpvoffer.co.uk", true },
- { "solarstrom.net", true },
- { "soldarizona.ga", true },
- { "solden.be", true },
- { "soldesduck.be", true },
- { "soldesduck.ch", true },
- { "soldierangels.tk", true },
- { "soldout-app.com", false },
- { "sole-erdwaermetauscher.de", true },
- { "soledadpenades.com", true },
- { "solemare-hotel.it", true },
- { "solentbasketball.co.uk", true },
- { "solentbubblesandbounce.co.uk", true },
- { "solepurposetest.com", true },
- { "soleria.eu", true },
- { "soleus.nu", false },
- { "solfegiator.ch", false },
- { "soli.cafe", true },
- { "solicafe.at", true },
- { "solidarita-kosovo.net", true },
- { "solidshield.com", true },
- { "solidsteel.tk", true },
- { "solihullcarnival.co.uk", true },
- { "solihullinflatables.com", true },
- { "solihulllionsclub.org.uk", true },
- { "solihullpcrepairs.co.uk", true },
- { "solipym.net", true },
- { "solit.systems", true },
- { "solitairenetwork.com", true },
- { "solitaryride.com", true },
- { "solmek.co.uk", true },
- { "sologstrand.com", true },
- { "sologstrand.dk", true },
- { "sologstrand.nl", true },
- { "sologstrand.no", true },
- { "sologstrand.se", true },
- { "solomisael.com", true },
- { "solomo.pt", true },
- { "solomonsklash.io", true },
- { "solonotizie24.it", true },
- { "soloparati.cf", true },
- { "solsocog.de", true },
- { "solucionespicadelly.com", true },
- { "solucionupsperu.com", true },
- { "solulan.com", true },
- { "solutions-marquagedelignes.com", true },
- { "solutiontestbank.com", true },
- { "solvation.de", true },
- { "solved.tips", true },
- { "solvemethod.com", true },
- { "solvewebmedia.com", true },
- { "solvingproblems.com.au", true },
- { "solvops.com", true },
- { "solxsys.com", true },
- { "solyplaya.info", true },
- { "somaini.li", true },
- { "somali-derp.com", true },
- { "somaliagenda.com", true },
- { "somaliaonline.com", true },
- { "somanao.com", true },
- { "sombemerchant.com", true },
- { "somecrazy.com", true },
- { "somefe.pt", true },
- { "somehsara.tk", true },
- { "someog.com", true },
- { "somersetscr.nhs.uk", true },
- { "somersetwellbeing.nhs.uk", true },
- { "somethingsketchy.net", true },
- { "somethingsomething.work", true },
- { "sommefeldt.com", true },
- { "sommeilsante.com", true },
- { "sommerhusudlejning.com", true },
- { "somnomedics.eu", true },
- { "somogyivar.hu", true },
- { "somosbrujas.com", true },
- { "somoshuemul.cl", true },
- { "sompani.com", true },
- { "somuchbetterwithage.com", true },
- { "somweyr.de", true },
- { "son-onlajn.tk", true },
- { "son-tolkovatel.gq", true },
- { "sona-gaming.com", true },
- { "sonacupalova.cz", true },
- { "sonaraamat.com", true },
- { "sonarqube.com", false },
- { "sonavankova.cz", true },
- { "sondebase.com", true },
- { "sonderfloral.com", true },
- { "sondergaard.de", true },
- { "sonderkomission.ch", true },
- { "sondersobk.dk", true },
- { "songdew.com", true },
- { "songesdeplumes.fr", true },
- { "songshuzuoxi.com", true },
- { "songsmp3.com", true },
- { "songsmp3.cool", true },
- { "songsmp3.online", true },
- { "songsterr.com", true },
- { "songtianyi.com", true },
- { "songun.ml", true },
- { "songyang.cn", true },
- { "sonia.com.au", true },
- { "soniaferrer.tk", true },
- { "sonic.studio", true },
- { "sonicdoe.com", true },
- { "sonicrainboom.rocks", true },
- { "sonictonic.cloud", true },
- { "sonix.dk", true },
- { "sonixonline.com", true },
- { "sonkonews.com", true },
- { "sonnenta.de", true },
- { "sonneundstrand.de", true },
- { "sonodrom.tk", true },
- { "sonofsunart.com", true },
- { "soohealthy.nl", true },
- { "soomee.be", true },
- { "soomee1.be", true },
- { "soontm.de", true },
- { "soontm.net", true },
- { "soopure.nl", true },
- { "soora.jp", true },
- { "sooscreekdental.com", true },
- { "soph.jp", true },
- { "sophiaandmatt.co.uk", true },
- { "sophiahatstudio.com", true },
- { "sophiakligys.com", true },
- { "sophiebbeauty.co.uk", true },
- { "sopo.me", true },
- { "soprabalao.com.br", true },
- { "sor.so", true },
- { "soraharu.com", true },
- { "sorakumo.jp", true },
- { "sorcix.com", true },
- { "sorenstudios.com", true },
- { "sorincocorada.ro", true },
- { "sormeyli.com", true },
- { "sorrowfulunfounded.com", true },
- { "sort.land", true },
- { "sortesim.com.br", true },
- { "soruly.moe", true },
- { "sorz.org", true },
- { "sos-elettricista.it", true },
- { "sos-fabbro.it", true },
- { "sos-falegname.it", true },
- { "sos-idraulico.it", true },
- { "sos-muratore.it", true },
- { "sos.vg", true },
- { "sos.yt", true },
- { "sosko.in.rs", true },
- { "sosoftplay.co.uk", true },
- { "sospeed.net", true },
- { "sostacancun.com", true },
- { "sosteam.jp", true },
- { "sosteric.si", true },
- { "sot.blue", true },
- { "sot.red", true },
- { "sotadb.info", true },
- { "sotar.us", true },
- { "soterdev.com", true },
- { "sotoasobi.net", true },
- { "soufastnet.com.br", true },
- { "souked.com", true },
- { "souki.cz", true },
- { "soukodou.jp", true },
- { "soul-source.co.uk", true },
- { "soulc.ml", true },
- { "soulcasa.com.br", true },
- { "soulcrazy.org", true },
- { "souleymanecamara.com", true },
- { "soulike.tech", true },
- { "soulmate.dating", true },
- { "soulmating.de", true },
- { "soulogic.com", true },
- { "soumikghosh.com", true },
- { "soumya.xyz", true },
- { "soumya92.me", true },
- { "sounavholidays.com", true },
- { "sound.as", true },
- { "soundabout.nl", true },
- { "soundclick.com", true },
- { "soundeo.com", true },
- { "soundeo.net", true },
- { "soundforsound.co.uk", true },
- { "soundgasm.net", true },
- { "soundprotectionllc.com", true },
- { "sounds-familiar.info", true },
- { "soundscrate.com", true },
- { "soundtruckandautorepair.com", true },
- { "soundtube.tk", true },
- { "soundviz.fr", true },
- { "soungui.cm", true },
- { "soungui.com", true },
- { "soungui.net", true },
- { "soupbuahtaza.id", true },
- { "soupcafe.org", true },
- { "sour.is", true },
- { "sourcebox.be", true },
- { "sourcecode.tw", true },
- { "sourceway.de", true },
- { "sourcitec.com", false },
- { "sourdough.vc", true },
- { "souris.ch", false },
- { "sous-surveillance.net", false },
- { "souspind.com.br", true },
- { "southafrican.dating", true },
- { "southambouncycastle.co.uk", true },
- { "southamerican.dating", true },
- { "southbankregister.com.au", true },
- { "southbendflooring.com", true },
- { "southcountyplumbing.com", true },
- { "southdakotahealthnetwork.com", true },
- { "southeastradiology.com", true },
- { "southeastvalleyurology.com", true },
- { "southernlights.xyz", true },
- { "southernmost.us", true },
- { "southernsurgicalga.com", true },
- { "southernutahinfluencers.com", true },
- { "southflanewsletter.com", true },
- { "southlakenissanparts.com", true },
- { "southlandurology.com", true },
- { "southmill.com", true },
- { "southmorangtownhouses.com.au", true },
- { "southpointcollision.com", true },
- { "southside-crew.com", true },
- { "southside-digital.co.uk", true },
- { "southside-tuning-day.de", true },
- { "southsideshowdown.com", true },
- { "southwestrda.org.uk", true },
- { "souzanabellydance.com", true },
- { "sovendus.com", true },
- { "sovendus.de", true },
- { "soverin.net", true },
- { "sowlutions.com", true },
- { "soybase.org", true },
- { "soydemac.com", true },
- { "soyfanonline.com", true },
- { "soyvigilante.com", true },
- { "sozai-good.com", true },
- { "sozialstation-ritterhude.de", true },
- { "sozialy.com", true },
- { "sozon.ca", true },
- { "sp-sites.com.au", true },
- { "sp.com.pl", true },
- { "sp8ce.co", true },
- { "space-inc.co.jp", true },
- { "space-it.de", true },
- { "spaceapi.io", true },
- { "spacebaseapp.com", true },
- { "spacebear.ee", true },
- { "spacebestnews.tk", true },
- { "spacedirectory.org", true },
- { "spacedots.net", true },
- { "spacehighway.ms", true },
- { "spacehighways.net", true },
- { "spacehost.de", true },
- { "spacestation13.com", true },
- { "spacinov.com", true },
- { "spacivox.com", true },
- { "spackova.cz", true },
- { "spaconnection.com", true },
- { "spaenny.tf", true },
- { "spaghettiphreakers.tk", true },
- { "spaghettiwesterns.tk", true },
- { "spahireleeds.co.uk", true },
- { "spaid.xyz", false },
- { "spakurort.eu", true },
- { "spaldingwall.com", true },
- { "spalnobelyo.com", true },
- { "spamdrain.com", true },
- { "spamwc.de", true },
- { "spanier.es", true },
- { "spanishfox.com", true },
- { "spanjeflydrive.nl", true },
- { "spanner.works", true },
- { "spanyolul.hu", true },
- { "sparanoid.com", true },
- { "sparanoidstatus.com", true },
- { "sparendirekt.at", true },
- { "sparkar.com", true },
- { "sparkasse.de", true },
- { "sparkforautism.org", true },
- { "sparklebastard.com", true },
- { "sparklesdelivery.com", true },
- { "sparklesvt.com", true },
- { "sparklingessentials.ga", true },
- { "sparkz.no", true },
- { "sparmedo.de", true },
- { "sparprofi.at", true },
- { "sparta-en.org", true },
- { "spartacuslife.com", true },
- { "spartaermelo.nl", true },
- { "spartancoin.ooo", true },
- { "sparumzuege.de", true },
- { "spasicilia.it", true },
- { "spaysy.com", true },
- { "spaziobenedetti.com.br", true },
- { "spaziopervoi.com.br", true },
- { "spazturtle.co.uk", true },
- { "spazzacamino.roma.it", true },
- { "spbet99.com", true },
- { "spd-porta-westfalica.eu", true },
- { "spdepartamentos.com.br", true },
- { "spdf.net", true },
- { "spdillini.com", true },
- { "speak-polish.com", true },
- { "speakersbusiness.com", true },
- { "spearfishingmx.com", true },
- { "specdrones.us", true },
- { "specialproperties.com", true },
- { "specialtyalloys.ca", true },
- { "speciesism.com", true },
- { "spectre.com.br", true },
- { "spectrum-markets.com", true },
- { "spectrum.gov", true },
- { "spectrumelectrical-brisbane.com.au", true },
- { "spediscifiori.com", true },
- { "speech-balloon.com", true },
- { "speechdrop.net", true },
- { "speechmate.com", true },
- { "speechmore.ml", true },
- { "speechndraw.com", false },
- { "speeddate.it", false },
- { "speeder.im", true },
- { "speeders.ga", true },
- { "speedof.me", true },
- { "speedracer.ca", true },
- { "speedsportofhull.co.uk", true },
- { "speedtailors.com", true },
- { "speedtemplate.de", true },
- { "speedtest-russia.com", true },
- { "speedwaybusinesspark.com", true },
- { "speedwp.ch", true },
- { "speedychat.it", true },
- { "speedyjanes.com", true },
- { "speeltoneel.nl", true },
- { "speerpunt.info", true },
- { "speets.ca", true },
- { "speich.net", true },
- { "speights-law.com", true },
- { "spek.tech", true },
- { "speletrodomesticos.com.br", true },
- { "spellcheck24.net", true },
- { "spellcheckci.com", true },
- { "spellchecker.net", true },
- { "spellic.com", true },
- { "spenglerei-shop.de", true },
- { "spenny.tf", true },
- { "sperandii.it", true },
- { "spero.solutions", true },
- { "sperrstun.de", true },
- { "spesys-services.fr", true },
- { "speventos.es", true },
- { "spewingmews.moe", true },
- { "spha.info", true },
- { "sphacks.io", true },
- { "sphardy.com", true },
- { "sphere-realty.com", true },
- { "sphericalvision.cz", true },
- { "sphido.org", false },
- { "spicejungle.com", true },
- { "spicydog.org", true },
- { "spicymatch.com", true },
- { "spidercrabs.tk", true },
- { "spideroak.com", true },
- { "spiders.org.ua", true },
- { "spiegels-op-maat.nl", true },
- { "spielezar.ch", true },
- { "spielland.ch", true },
- { "spielmit.com", true },
- { "spieltexte.de", true },
- { "spiet.nl", true },
- { "spiff.eu", true },
- { "spiga.ch", false },
- { "spikar.gr", true },
- { "spikejeon.tk", true },
- { "spikelands.com", true },
- { "spilka-dyplomativ.tk", true },
- { "spillforum.no", true },
- { "spillmaker.no", false },
- { "spilnu.dk", true },
- { "spilogkoder.dk", true },
- { "spinalien.net", false },
- { "spingenie.com", true },
- { "spins.fedoraproject.org", true },
- { "spinspin.wtf", true },
- { "spira.kiev.ua", true },
- { "spirella-shop.ch", true },
- { "spirit-hunters-germany.de", false },
- { "spirit55555.dk", true },
- { "spiritous.cf", true },
- { "spiritual.dating", true },
- { "spiritualife.net", true },
- { "spiritualites.ch", true },
- { "spiritualityrise.com", true },
- { "spiroduct.gr", true },
- { "spisbilligt.dk", true },
- { "spitfiredialers.com", true },
- { "spittank.info", true },
- { "spittersberger.recipes", true },
- { "splarty.net", true },
- { "splash.solar", true },
- { "splendidspoon.com", true },
- { "splendorservizi.it", true },
- { "splikity.com", true },
- { "splintermail.com", true },
- { "splitdna.com", true },
- { "splitreflection.com", true },
- { "splnk.net", true },
- { "sploch.com", true },
- { "splopp.com", true },
- { "splunk.net", true },
- { "spm.tv", true },
- { "spmax.design", true },
- { "spmax.top", true },
- { "spnitalianfestival.com", true },
- { "spodelime.com", true },
- { "spofia.nu", true },
- { "spokaneexteriors.com", true },
- { "spokanepolebuildings.com", true },
- { "spokesly.com", true },
- { "spoluck.ca", true },
- { "spolwind.de", true },
- { "spom.net", true },
- { "sponc.de", true },
- { "spongepowered.org", true },
- { "sponsor.network", true },
- { "sponsormatch.eu", true },
- { "spoofhaus.com", true },
- { "spookbook.net", true },
- { "spookquest.com", true },
- { "spoopy.link", true },
- { "spoorcam.nl", true },
- { "sporcard.com", true },
- { "sporemasters.com", true },
- { "spornkuller.de", true },
- { "sport-decouverte.com", true },
- { "sport-in-sundern.de", true },
- { "sport-potreby.cz", true },
- { "sport-potreby.sk", true },
- { "sport-socken.net", true },
- { "sportabee.com", false },
- { "sportbetuwe.nl", false },
- { "sportboot.mobi", true },
- { "sportchirp.com", true },
- { "sporter.com", true },
- { "sportmundschutz-info.de", true },
- { "sportnesia.com", true },
- { "sportovnidum.cz", true },
- { "sportparks.com", true },
- { "sportparks.org", true },
- { "sports-colleges.com", true },
- { "sports-online.cf", true },
- { "sports-sites.ml", true },
- { "sports.dating", true },
- { "sportsdrobe.com", true },
- { "sportsjaw.com", true },
- { "sportsmansblog.com", true },
- { "sportstraineradvisor.com", true },
- { "sportstreetstyle.com", true },
- { "sportticino.ch", true },
- { "sporttomorrow.com", true },
- { "sporttown.it", true },
- { "sportugalia.ru", true },
- { "sportvereine.online", true },
- { "sportxt.ru", true },
- { "spot-lumiere-led.com", true },
- { "spot.su", true },
- { "spot9.com", true },
- { "spotfake.news", true },
- { "spotrebitelskecentrum.sk", true },
- { "spotsee.io", true },
- { "spotswoodvet.com", true },
- { "spottedpenguin.co.uk", true },
- { "spotty.tech", true },
- { "spotupload.com", true },
- { "spotworld.co", true },
- { "spotypal.com", true },
- { "sppin.fr", true },
- { "sprachenlernen24.org", true },
- { "sprachfreudehoch3.de", true },
- { "sprax2013.de", true },
- { "spreadsheetgear.com", true },
- { "spreadsheets.google.com", true },
- { "spreed.me", true },
- { "spricknet.de", true },
- { "springboardsandmore.com", true },
- { "springerundpartner.de", true },
- { "springhillmaine.com", true },
- { "springhow.com", true },
- { "springtxcarpetcleaning.com", true },
- { "spritmonitor.de", true },
- { "spritsail.io", true },
- { "spro.in", false },
- { "sproktz.com", true },
- { "spron.in", true },
- { "sprossenwand.de", true },
- { "sproutways.com", true },
- { "sprucecreekclubs.com", true },
- { "sprucecreekgcc.com", true },
- { "spruijtparket.nl", true },
- { "sps-lehrgang.de", true },
- { "spsidahoinc.com", true },
- { "spslawoffice.com", true },
- { "spsnewengland.org", true },
- { "spstaticfiles.com", true },
- { "spt.re", true },
- { "spt.tf", true },
- { "sptk.org", true },
- { "spuffin.com", true },
- { "spufpowered.com", true },
- { "spur.com.br", true },
- { "spurghi.roma.it", true },
- { "spydar007.com", true },
- { "spydar007.net", true },
- { "spydar007.wiki", true },
- { "spydersec.com", true },
- { "spyfone.com", true },
- { "spyprofit.ru", true },
- { "sqdll.com", true },
- { "sqills.com", true },
- { "sql-und-xml.de", true },
- { "sql.bi", true },
- { "sqlapius.net", true },
- { "sqlbi.com", true },
- { "sqlfeatures.com", false },
- { "sqlwrapper.com", true },
- { "sqprod.co", true },
- { "sqr-training.com", true },
- { "sqreemtech.com", true },
- { "sqroot.eu", true },
- { "sqsd.xyz", true },
- { "squadronprotectiveservices.net", true },
- { "square-gaming.org", true },
- { "square-src.de", false },
- { "squarefootllcconstruction.com", true },
- { "squareforums.com", true },
- { "squattra.com", true },
- { "squeezemetrics.com", true },
- { "squido.ch", true },
- { "squidparty.com", true },
- { "squirex2.com", true },
- { "squirtingpussygirl.com", true },
- { "sr-33.com", true },
- { "sr33.com", true },
- { "srandom.com", true },
- { "srb.help", true },
- { "srbija-nekretnine.org", false },
- { "src-el-main.com", true },
- { "src.fedoraproject.org", true },
- { "srchub.org", true },
- { "srcprivatesecurity.com", true },
- { "srdmarketingservice.com", true },
- { "srfloki.com", true },
- { "srife.net", true },
- { "srigc.com", true },
- { "srihash.org", false },
- { "srilankan-hope-for-children.nl", true },
- { "srimakc.com", true },
- { "srinivasan.io", true },
- { "sriravana.tk", true },
- { "sritalaska.tk", true },
- { "sritcities.tk", true },
- { "srithunters.tk", true },
- { "sritidaho.tk", true },
- { "sritspanish.tk", true },
- { "sritvermont.tk", true },
- { "srkb.net", true },
- { "sro.center", true },
- { "srochnozaim.gq", true },
- { "srpx.de", true },
- { "srqpedals.com", true },
- { "srroddy.com", true },
- { "srsforward.email", true },
- { "srsfwd.com", true },
- { "srsfwd.email", true },
- { "srsfwd.eu", true },
- { "srsfwd.net", true },
- { "srsfwd.org", true },
- { "srv.so", true },
- { "srx.sx", true },
- { "ss-news.tk", true },
- { "ss.com", true },
- { "ss.lazio.it", true },
- { "ss.lt", true },
- { "ss.lv", true },
- { "ss.systems", true },
- { "ss.ua", true },
- { "ss64.com", true },
- { "ss64.org", true },
- { "ss88.uk", true },
- { "ssa.gov", false },
- { "ssab.gov", true },
- { "ssbgportal.net", true },
- { "ssbkk.ru", true },
- { "ssbrm.ch", true },
- { "ssdax.com", true },
- { "ssdpalermo.it", true },
- { "ssenberg.nl", true },
- { "ssfbank.no", true },
- { "ssh-vault.com", true },
- { "ssky.cn", true },
- { "ssl-zertifikate.de", true },
- { "ssl.do", true },
- { "ssl.google-analytics.com", true },
- { "ssl.md", true },
- { "ssl24.pl", true },
- { "ssl247.co.uk", true },
- { "ssl247.com.mx", true },
- { "ssl247.de", true },
- { "ssl247.dk", true },
- { "sslbrain.com", true },
- { "sslcertificaten.nl", true },
- { "sslcheck.nl", true },
- { "ssldecoder.org", true },
- { "sslmate.com", true },
- { "sslok.com", false },
- { "sslping.com", true },
- { "sslpoint.com", true },
- { "ssls.cz", true },
- { "sslsecurity.ooo", true },
- { "sslsurvey.de", true },
- { "ssmca.com", true },
- { "ssmic.com", true },
- { "ssmm88.cc", true },
- { "ssmpuc.com", true },
- { "ssmut.be", true },
- { "ssone.ee", true },
- { "sspanel.host", true },
- { "ssr.llc", true },
- { "ssready.io", true },
- { "ssready.org", true },
- { "ssrr.xyz", true },
- { "sssldurban.co.za", true },
- { "sssppp.gq", true },
- { "sstaging.com", true },
- { "ssuiteoffice.com", true },
- { "ssuitesoft.com", true },
- { "st-bede.org", true },
- { "st-innovationcup.com", true },
- { "st-kilian-markt-erlbach.de", true },
- { "st-news.de", true },
- { "st-shakyo.jp", true },
- { "st-steuern.de", true },
- { "st-tir-pln.fr", true },
- { "st42.fr", true },
- { "staatschutz.at", true },
- { "staatsschutz.at", true },
- { "staatsschutzgesetz.at", true },
- { "stable.network", true },
- { "stablelib.com", true },
- { "stackpath.com", true },
- { "stackptr.com", true },
- { "stacktrace.sh", true },
- { "stackunderflow.com", true },
- { "staddlestonesbowness.co.uk", true },
- { "stadm.com", false },
- { "stadsbos013.nl", true },
- { "stadsbygd.info", true },
- { "stadtbauwerk.at", false },
- { "stadtbuecherei-bad-wurzach.de", true },
- { "stadterneuerung-hwb.de", true },
- { "stadtkapelle-oehringen.de", true },
- { "stadtplan-ilmenau.de", true },
- { "stadtundbaum.de", true },
- { "staer.ro", true },
- { "staff.direct", true },
- { "staffexcellence.com", true },
- { "staffhunt.org.uk", true },
- { "staffordlabour.org.uk", true },
- { "stage-recuperation-points-bordeaux.com", true },
- { "stage-recuperation-points-lille.com", true },
- { "stage-recuperation-points-lyon.com", true },
- { "stage-recuperation-points-marseille.com", true },
- { "stage-recuperation-points-montpellier.com", true },
- { "stage-recuperation-points-nantes.com", true },
- { "stage-recuperation-points-nice.com", true },
- { "stage-recuperation-points-paris.com", true },
- { "stage-recuperation-points-reims.com", true },
- { "stage-recuperation-points-rennes.com", true },
- { "stage-recuperation-points-strasbourg.com", true },
- { "stage-recuperation-points-toulouse.com", true },
- { "stage.wepay.com", false },
- { "stage4.ch", true },
- { "stageirites.com", true },
- { "stageirites.fr", true },
- { "stageirites.org", true },
- { "stagelectrical.com.au", true },
- { "stagemaster.cz", true },
- { "stagespediatrics.com", true },
- { "stainedglass.net.au", true },
- { "stainhaufen.de", true },
- { "stair.ch", true },
- { "stairfallgames.com", true },
- { "stairlin.com", true },
- { "stajka.tk", true },
- { "staklim-malang.info", true },
- { "stako.jp", true },
- { "staktrace.com", true },
- { "stal-rulon.ru", true },
- { "stalder.work", true },
- { "staljedevledder.nl", true },
- { "stalker-eyes.ga", true },
- { "stalker-shop.com", true },
- { "stalkerteam.pl", true },
- { "stalkr.net", true },
- { "stamboomforum.nl", true },
- { "stamboomgids.nl", true },
- { "stameystreet.com", true },
- { "stamkassa.nl", true },
- { "stammtisch.domains", true },
- { "stamparmakarije.me", true },
- { "standagainstspying.org", true },
- { "standard.co.uk", true },
- { "standardequipment.com", true },
- { "standards.gov", true },
- { "standartgost.ru", true },
- { "stangeland.tk", true },
- { "stanmed24.pl", true },
- { "stannri.org", true },
- { "stanron.com", true },
- { "stantabler.com", true },
- { "stanthony-hightstown.net", true },
- { "stanthonymaryclaret.org", true },
- { "staparishgm.org", true },
- { "stapvoorstapduurzaam.nl", true },
- { "star-citizen.wiki", true },
- { "star-clean.it", true },
- { "star-darom.co.il", true },
- { "star-killer.net", true },
- { "star.garden", true },
- { "star.watch", true },
- { "starb.in", true },
- { "starbaese.de", true },
- { "starcoachservices.ca", true },
- { "starcomproj.com", true },
- { "stardam.net", true },
- { "stardanceacademy.net", true },
- { "stardawg.co.uk", true },
- { "stareplanymiast.pl", true },
- { "starfishconstruction.com", true },
- { "starflix.uk", true },
- { "starfriend.ru", true },
- { "stargate365.com", true },
- { "stargatelrp.co.uk", true },
- { "stargazer.de", true },
- { "stariders.com", true },
- { "starina.ru", true },
- { "starka.st", true },
- { "starkbim.com", true },
- { "starlightentertainmentdevon.co.uk", true },
- { "starlim.co.in", true },
- { "starlim.org", true },
- { "starlux.cz", true },
- { "starmtech.fr", true },
- { "starorusing.com", true },
- { "starover.tk", true },
- { "starpeak.org", true },
- { "starpoles.com", true },
- { "starreview.tk", true },
- { "starryvoid.com", true },
- { "starsandmanifolds.xyz", true },
- { "starsguru.com", true },
- { "starskim.cn", true },
- { "starsoft.io", true },
- { "starstreak.net", false },
- { "startablog.tv", true },
- { "startachim.eu", true },
- { "startaninflatablebusiness.com", true },
- { "startanull.ru", true },
- { "startersiteweb.com", true },
- { "startlab.sk", true },
- { "startle.cloud", true },
- { "startle.studio", true },
- { "startlemusic.com", true },
- { "startliste.info", true },
- { "startmail.com", true },
- { "startpage.com", true },
- { "startpage.info", true },
- { "startrek.in", true },
- { "starttls-everywhere.org", true },
- { "starttraffic.com", true },
- { "starttraffic.uk", true },
- { "startupstack.tech", true },
- { "starvizyon.com", true },
- { "stassi.ch", true },
- { "stastka.ch", true },
- { "stat.ink", true },
- { "statecollegemortgages.com", true },
- { "static-692b8c32.de", true },
- { "static-myfxee-808795.c.cdn77.org", true },
- { "static-myfxoau-808795.c.cdn77.org", true },
- { "static-myfxouk-808795.c.cdn77.org", true },
- { "static.wepay.com", false },
- { "statically.io", true },
- { "staticfury.com", true },
- { "stationa.ch", false },
- { "stationary-traveller.eu", true },
- { "stationatbuckscounty.com", true },
- { "stationatlyndhurst.com", true },
- { "stationcharlie.co.za", true },
- { "statistik-seminare.de", true },
- { "statistikian.com", true },
- { "statnevlajky.sk", true },
- { "statnivlajky.cz", true },
- { "statofus.com", true },
- { "stats.do", true },
- { "stats.g.doubleclick.net", true },
- { "statusboard.eu", true },
- { "statuscode.ch", true },
- { "statuswatch.io", true },
- { "stau-a.de", true },
- { "stavanger.kommune.no", true },
- { "stavnager.net", true },
- { "stavros.ovh", true },
- { "staycurrent.eu", true },
- { "staycurrent.nl", true },
- { "stayme.cz", true },
- { "stayokay.com", true },
- { "stayschemingco.com", true },
- { "stb-lemke.de", true },
- { "stb-schefczyk.de", true },
- { "stb-timmler.de", true },
- { "stb.gov", true },
- { "stbarnabashospice.co.uk", true },
- { "stbartholomewmanchester.org", true },
- { "stbennett.org", true },
- { "stbl.org", true },
- { "stbridgeteastfalls.org", true },
- { "stcable.net", true },
- { "stcatharine-stmargaret.org", true },
- { "stceciliakearny.org", true },
- { "stclementmatawan.org", true },
- { "stclementreligioused.org", true },
- { "stcplasticsurgery.com", true },
- { "std-home-test.com", true },
- { "stderr.cc", true },
- { "stdrc.cc", false },
- { "steakovercooked.com", true },
- { "stealingheather.com", true },
- { "stealsaga.net", true },
- { "stealthmodel.fi", true },
- { "steam-rewards.tk", true },
- { "steam-route-saxony.com", true },
- { "steamdb.info", true },
- { "steamerrors.com", true },
- { "steamgifts.com", true },
- { "steamhours.com", false },
- { "steamosaic.com", true },
- { "steampress.io", true },
- { "steamsprays.tk", true },
- { "steamstat.us", true },
- { "steamtrades.com", true },
- { "steamwhale.com", true },
- { "stebenkov.tk", true },
- { "stebet.net", true },
- { "steborio.pw", true },
- { "stedb.eu", true },
- { "steef389.eu", true },
- { "steel-roses.de", true },
- { "steelbeasts.org", true },
- { "steelephys.com.au", true },
- { "steelmounta.in", true },
- { "steelpoint.com.pl", true },
- { "steemit.com", true },
- { "steemyy.com", true },
- { "steering-wheel.tk", true },
- { "steerty.com", true },
- { "stefan-bayer.eu", true },
- { "stefan-rothe.ch", true },
- { "stefan-schlueter.de", true },
- { "stefan-schmid.com", true },
- { "stefan.de", true },
- { "stefanbayer.de", true },
- { "stefancosma.xyz", true },
- { "stefanengineering.com", true },
- { "stefanfriedli.ch", true },
- { "stefanknobel.ch", true },
- { "stefanorossi.it", true },
- { "stefanvanburen.xyz", false },
- { "stefanvd.net", true },
- { "stefany.eu", true },
- { "stefchapman.tk", true },
- { "steffenmeister.com", true },
- { "steffentreeservice.com", true },
- { "stefpastoor.nl", true },
- { "stehlik.co.uk", true },
- { "steidlewirt.de", true },
- { "steigerlegal.ch", true },
- { "steinbergmedia.de", true },
- { "steiner.sh", true },
- { "steinibox.de", true },
- { "steklein.de", true },
- { "stekosouthamerica.com", true },
- { "stelfox.net", true },
- { "stelinauto.com", true },
- { "steliosmanousakis.gr", true },
- { "stella-artis-ensemble.at", true },
- { "stellarguard.me", true },
- { "stellarium-gornergrat.ch", true },
- { "stellarx.com", true },
- { "stellatusstudios.com", true },
- { "stelleninserate.de", true },
- { "stellenticket.de", true },
- { "stellmacher.name", true },
- { "stembureauledenindenhaag.nl", true },
- { "stemcellclinic.club", true },
- { "stemcellclinic.design", true },
- { "stemcellclinic.digital", true },
- { "stemcellclinic.life", true },
- { "stemcellclinic.live", true },
- { "stemcellclinic.ltd", true },
- { "stemcellclinic.network", true },
- { "stemcellclinic.online", true },
- { "stemcellclinic.services", true },
- { "stemcellclinic.store", true },
- { "stemcellclinic.tech", true },
- { "stemcellclinic.vip", true },
- { "stemcellclinic.website", true },
- { "stemcellclinic.world", true },
- { "stemkit4kids.com", true },
- { "stemmayhem.com", true },
- { "stenaro.ch", true },
- { "stenhojmedia.dk", true },
- { "stening.co", true },
- { "stenzhorn-cloud.de", true },
- { "step2web-cms.info", true },
- { "stepanvanek.cz", true },
- { "steph.ninja", true },
- { "stephan-matthiesen.de", true },
- { "stephanao.tk", true },
- { "stephane-huc.net", false },
- { "stephaniecalahan.com", true },
- { "stephaniedeady.ie", true },
- { "stephanieleonidasfan.tk", true },
- { "stephanieschreiber.com", true },
- { "stephansurgicalarts.com", true },
- { "stephencreilly.com", true },
- { "stephenhaunts.com", true },
- { "stephenj.co.uk", true },
- { "stephenlam.ca", true },
- { "stephenperreira.com", true },
- { "stephenreescarter.com", true },
- { "stephenreescarter.net", true },
- { "stephenschrauger.com", true },
- { "stephenschrauger.info", true },
- { "stephenschrauger.net", true },
- { "stephenschrauger.org", true },
- { "stephenskory.com", true },
- { "stephensol.is", true },
- { "stephensolis.com", true },
- { "stephsolis.net", true },
- { "stephspace.net", true },
- { "stephycom.com", true },
- { "steponedanceclub.co.uk", true },
- { "stepstone.dk", true },
- { "stepsweb.com", true },
- { "ster-enzo.nl", true },
- { "sterchi-fromages.ch", false },
- { "stereo.lu", true },
- { "stereochro.me", false },
- { "sterlinx.de", true },
- { "stern-freunde.de", true },
- { "stern.koeln", true },
- { "sternadel.pl", true },
- { "sternen-sitzberg.ch", true },
- { "sternenbund.info", true },
- { "sternplastic.com", true },
- { "sternsinus.com", true },
- { "stesti.cz", true },
- { "stetson.edu", true },
- { "steuer-voss.de", true },
- { "steuerberater-bayreuth.com", true },
- { "steuerberater-hopfner.de", true },
- { "steuerkanzlei-edel.de", true },
- { "steuern-recht-wirtschaft.de", true },
- { "steuertipps-sonderausgaben.de", true },
- { "steveborba.com", true },
- { "stevebuck.tk", true },
- { "stevecostar.com", true },
- { "stevedesmond.ca", true },
- { "stevedoggett.com", true },
- { "stevegellerhomes.com", true },
- { "stevegrav.es", true },
- { "stevehaid.com", true },
- { "stevejobsfollowers.tk", true },
- { "steven-bennett.com", true },
- { "steven-klix.de", true },
- { "stevenbolgartersnakes.com", true },
- { "stevengrech.com", true },
- { "stevenpilger.com", true },
- { "stevens.se", false },
- { "stevenselectricllc.com", true },
- { "steventress.com", true },
- { "stevenuniverse.xyz", true },
- { "stevenwooding.com", true },
- { "stevenz.net", true },
- { "stevenz.science", true },
- { "stevenz.xyz", true },
- { "stevesdrivingschooltyneside.com", true },
- { "stevezheng.cf", true },
- { "stewartswines.com", true },
- { "stewonet.nl", true },
- { "stewpolley.com", false },
- { "steyaert.be", false },
- { "stfrancisnaugatuck.org", true },
- { "stfw.info", true },
- { "stgabrielavondalepa.org", true },
- { "stgabrielstowepa.org", true },
- { "stgeorgecomfortinn.com", true },
- { "stgeorgegolfing.com", true },
- { "stghv.com", true },
- { "sth.sh", true },
- { "sthenryrc.org", true },
- { "stian.net", true },
- { "stichtingdemuziekkamer.nl", true },
- { "stichtingliab.nl", true },
- { "stichtingsticky.nl", true },
- { "stick2bike.de", true },
- { "stickandpoketattookit.com", true },
- { "stickeramoi.com", true },
- { "stickergiant.com", true },
- { "stickertuningfetzt.de", true },
- { "stickies.io", true },
- { "stickmanventures.com", true },
- { "stickstueb.de", true },
- { "sticky.ai", true },
- { "stickypassword.com", true },
- { "stickyricelove.com", true },
- { "stiebelmedia.co.nz", true },
- { "stiebelmedia.com.au", true },
- { "stiff.wang", true },
- { "stift-kremsmuenster.at", true },
- { "stiftemaskinen.no", true },
- { "stiftung-lq.ch", true },
- { "stiftung-lq.com", true },
- { "stiftung-lq.net", true },
- { "stiftunglq.com", true },
- { "stigharder.com", true },
- { "stigviewer.com", true },
- { "stijnbelmans.be", true },
- { "stijnodink.nl", true },
- { "stikic.me", true },
- { "stilartmoebel.de", true },
- { "stilecop.com", true },
- { "stilmobil.se", true },
- { "stilsvadba.tk", true },
- { "stiltmedia.com", true },
- { "stimmgabel.lu", true },
- { "stin.hr", true },
- { "stina-vino.hr", true },
- { "stinaspiegelberg.com", true },
- { "stinkefingereinhorn.de", true },
- { "stinsky.com", true },
- { "stintup.com", true },
- { "stipsan.me", true },
- { "stirblaut.de", true },
- { "stirling.co", true },
- { "stirlingpoon.com", true },
- { "stisaac.org", true },
- { "stisidores.org", true },
- { "stitchfiddle.com", true },
- { "stitchinprogress.com", true },
- { "stivesbouncycastlehire.co.uk", true },
- { "stjameslititz.org", true },
- { "stjohnin.com", true },
- { "stjohnnepomucene.com", true },
- { "stjohnsottsville.org", true },
- { "stjoseph-stcatherine.org", true },
- { "stjosephri.org", true },
- { "stjosephsoswego.com", true },
- { "stjosephspringcity.com", true },
- { "stjosephtheworker.net", true },
- { "stjscatholicchurch.org", true },
- { "stjustin.org", true },
- { "stkevin-stbenedict.org", true },
- { "stkildaosteopathy.com.au", true },
- { "stl.news", true },
- { "stleonardmn.org", true },
- { "stlouisinsuranceco.com", true },
- { "stlouisnativeflute.com", true },
- { "stlu.de", true },
- { "stluciastar.com", true },
- { "stlukenh.org", true },
- { "stlukesbrandon.org", true },
- { "stm-net.de", true },
- { "stma.is", true },
- { "stmariagoretti.net", true },
- { "stmarkseagirt.com", true },
- { "stmarthachurch.com", true },
- { "stmarysnutley.org", true },
- { "stmaryswestwarwick.org", true },
- { "stmatthewri.org", true },
- { "stmattsparish.com", true },
- { "stmichaellvt.com", true },
- { "stmichaelunion.org", true },
- { "stmlearning.com", true },
- { "stmohrael.org", true },
- { "stmosesbookstore.org", true },
- { "stmsolutions.pl", true },
- { "stneotsbouncycastlehire.co.uk", true },
- { "stockholmpride.org", true },
- { "stockpile.com", true },
- { "stockportpyramid.co.uk", true },
- { "stockrow.com", true },
- { "stockstuck.com", true },
- { "stocktrader.com", true },
- { "stocp.org", true },
- { "stodieck.com", true },
- { "stoebermehl.at", true },
- { "stoerevrouwensporten.nl", true },
- { "stoffelnet.de", true },
- { "stoicatedy.ovh", true },
- { "stoinov.com", true },
- { "stokl.com.au", true },
- { "stokvistrading.nl", true },
- { "stolarka.tk", true },
- { "stolin.info", true },
- { "stolina.de", false },
- { "stolkpotplanten.nl", true },
- { "stollen-wurm.de", true },
- { "stollenwurm.de", true },
- { "stolpi.is", false },
- { "stomt.com", true },
- { "stoneagehealth.com.au", true },
- { "stonearm.com", true },
- { "stonechatjewellers.ie", true },
- { "stonedwarf5.net", true },
- { "stonedworms.de", false },
- { "stoneedgeconcrete.com", true },
- { "stonegateapartmentsstl.com", true },
- { "stonehurstcap.com", true },
- { "stoneproperty.ie", true },
- { "stonesfamilyrestaurant.com", true },
- { "stonetribute.tk", true },
- { "stony.com", true },
- { "stonystratford.org", true },
- { "stop-activ.ga", true },
- { "stopbullying.gov", true },
- { "stopfraud.gov", true },
- { "stopjunkmail.co.uk", true },
- { "stoplossoff.tk", true },
- { "stopoverconnections.com", true },
- { "stoppage.cf", true },
- { "stopthethyroidmadness.com", true },
- { "stopthinkconnect.jp", true },
- { "stopyhrdinu.cz", true },
- { "storageideas.uk", true },
- { "stordbatlag.no", true },
- { "storedsafe.com", true },
- { "storefront.gq", true },
- { "storeit.co.uk", true },
- { "storeplus.ml", true },
- { "storgaarddieu.com", true },
- { "storiesbysign.com", true },
- { "storillo.com", true },
- { "storingdesk.com", true },
- { "storm-family.com", true },
- { "storm-family.nl", true },
- { "stormboost.cz", true },
- { "stormhub.ml", true },
- { "stormi.io", true },
- { "stormylegions.tk", true },
- { "stortiservices.com", true },
- { "storvann.net", true },
- { "storvann.no", true },
- { "storycollective.film", true },
- { "storycollective.nl", true },
- { "storyland.ie", true },
- { "storyoneforty.com", true },
- { "storysift.news", true },
- { "storytell.com", true },
- { "storytellingforbusiness.com.au", true },
- { "storytime.hu", true },
- { "storzrealty.com", true },
- { "stoutassociates.com", true },
- { "stouter.nl", true },
- { "stoxford.com", true },
- { "stpatrickbayshore.org", true },
- { "stpatrickkennettsquare.org", true },
- { "stpatrickri.org", true },
- { "stpatricks-pelham.com", true },
- { "stpaulcatholicchurcheastnorriton.net", true },
- { "stphilipneripreschool.com", true },
- { "str8hd.com", true },
- { "str92.com", true },
- { "straat.net", true },
- { "straatderzotten.nl", true },
- { "strafensau.de", true },
- { "strafvollzugsgesetze.de", true },
- { "strahlende-augen.info", true },
- { "strajnar.si", true },
- { "straka.name", true },
- { "strandbyfysio.dk", true },
- { "strandedinotter.space", true },
- { "strandhaus-claassen.de", true },
- { "strandhaus-hinter-der-duene.de", true },
- { "strandom.ru", true },
- { "strandschnuppern.de", true },
- { "strange.ga", true },
- { "strangelandrecording.com", true },
- { "strangelandrecordingstudios.com", true },
- { "strangelandsoundstage.com", true },
- { "strangelane.com", true },
- { "strangelanerecords.com", true },
- { "strangemusicbox.com", true },
- { "strangemusichollywood.com", true },
- { "strangemusicinc.com", true },
- { "strangemusicinc.net", true },
- { "strangevip.com", true },
- { "strangeways.ca", false },
- { "strangeworksinc.com", true },
- { "strangeworldmerch.com", true },
- { "strangeworldmerchandising.com", true },
- { "straphael-holyangels.com", true },
- { "strate.io", true },
- { "strategiccapital.com", true },
- { "strategiclivingblog.com", true },
- { "strategie-zone.de", true },
- { "strathewerd.de", true },
- { "strathspeycrown.com", true },
- { "stratmann-b.de", true },
- { "stratuscloud.co.za", true },
- { "stratuscloudconsulting.net", true },
- { "straubis.org", true },
- { "strauser.com", true },
- { "stravers.shoes", true },
- { "strawberries.tk", true },
- { "strawberry-laser.gr", true },
- { "strd.co", true },
- { "streamchan.org", true },
- { "streamelements.com", true },
- { "streamkit.gg", true },
- { "streampanel.net", true },
- { "streamspouredout.com", true },
- { "streathamfoodfestival.com", true },
- { "streemprn.xyz", true },
- { "street-medics.fr", true },
- { "street-tek.com", true },
- { "streetdancecenter.com", true },
- { "streetlightdata.com", true },
- { "streetmarket.ru", true },
- { "streets.mn", true },
- { "streetshirts.co.uk", true },
- { "streetspotr.com", true },
- { "streetview.wien", true },
- { "strefapi.com", true },
- { "strelnicesmirice.cz", true },
- { "stremio.com", true },
- { "strengthinyoufitness.com", true },
- { "strengthroots.com", true },
- { "stretchmarkdestroyer.com", true },
- { "stretchmyan.us", true },
- { "striata.com", true },
- { "striatadev.com", true },
- { "strick-welt.de", true },
- { "stricted.net", true },
- { "strictlyguitar.de", true },
- { "strijkshop.be", true },
- { "stringtoolbox.com", true },
- { "stripe.com", true },
- { "stripe.network", true },
- { "stripecdn.com", true },
- { "striped.horse", true },
- { "stripehype.com", true },
- { "strippersondemand.com", true },
- { "strivephysmed.com", false },
- { "strl-tunis.tk", true },
- { "strm.hu", true },
- { "strm.pl", true },
- { "strobeltobias.de", true },
- { "strobeto.de", true },
- { "strobotti.com", true },
- { "stroccounioncity.org", true },
- { "stroeder.com", true },
- { "stroeerdigital.de", true },
- { "stroginohelp.ru", true },
- { "stroifenix.ru", true },
- { "stroimvse.ml", true },
- { "stroiproect.tk", true },
- { "stroke-of-luck.com", true },
- { "stromaci.sk", true },
- { "stromak.cz", true },
- { "stromkomfort.cz", true },
- { "stromzivota.sk", true },
- { "strongpassword.club", true },
- { "strongrandom.com", false },
- { "strongsalpinesucculents.com", true },
- { "stronku-gaming.de", true },
- { "stroomacties.nl", true },
- { "strosemausoleum.com", true },
- { "stroseoflima.com", true },
- { "strotmann.de", true },
- { "strousberg.net", true },
- { "strozik.de", true },
- { "structuralfix.com", true },
- { "structurally.net", true },
- { "strugee.net", true },
- { "strydom.me.uk", true },
- { "ststanislaus.com", true },
- { "ststanstrans.org", true },
- { "stt.wiki", true },
- { "sttammanyurology.com", true },
- { "sttg.com.au", true },
- { "stthomasbrigantine.org", true },
- { "stuartbeard.com", true },
- { "stuartbell.co.uk", true },
- { "stuartbell.uk", true },
- { "stuarteggerton.com", true },
- { "stuartmorris.id.au", true },
- { "stuartmorris.me", true },
- { "stuartmorris.name", true },
- { "stuartmorris.tel", true },
- { "stuckateur-bruno.de", true },
- { "stucki-bagger.ch", true },
- { "stucydee.nl", true },
- { "studay.fr", true },
- { "studenckiemetody.pl", true },
- { "student-eshop.cz", true },
- { "student-eshop.sk", true },
- { "studenterguiden.dk", true },
- { "studentfinancecountdown.com", true },
- { "studentforums.biz", true },
- { "studenti.tk", true },
- { "studentklinikk.no", true },
- { "studentloans.gov", true },
- { "studentpop.com", true },
- { "studentse.fr", true },
- { "studenttenant.com", true },
- { "studiebegeleiding-haegeman.be", true },
- { "studio-637.com", true },
- { "studio-abok.com", true },
- { "studio-architetto.com", true },
- { "studio-fotografico.ru", true },
- { "studio-happyvalley.com", true },
- { "studio-n.pl", true },
- { "studio-satellite.com", true },
- { "studio413.net", true },
- { "studio678.com", true },
- { "studioadevents.com", true },
- { "studioavvocato24.it", true },
- { "studiobergaminloja.com.br", true },
- { "studiodewit.nl", true },
- { "studiogavioli.com", true },
- { "studiogears.com", true },
- { "studiograou.com", true },
- { "studiohelder.fr", false },
- { "studiohomebase.amsterdam", true },
- { "studiokicca.com", true },
- { "studiolegalepaternostro.it", true },
- { "studiomarcella.com", true },
- { "studionowystyl.pl", true },
- { "studiopirrate.com", true },
- { "studiopop.com.br", true },
- { "studioproapp.com", true },
- { "studioriehl.com", true },
- { "studioscherp.nl", true },
- { "studiosql.ml", true },
- { "studiostawki.com", true },
- { "studiostudio.net", true },
- { "studiosus-gruppenreisen.com", true },
- { "studiosus.com", true },
- { "studiotheatrestains.fr", true },
- { "studiotres.com.br", true },
- { "studiovaud.com", false },
- { "studiovictorialimited.com", true },
- { "studioxii.com", true },
- { "studipad.de", true },
- { "studipro-formation.fr", true },
- { "studipro-marketing.fr", true },
- { "studisys.net", true },
- { "studium.cz", true },
- { "studyin.jp", true },
- { "studyportal.net", true },
- { "studyspy.ac.nz", true },
- { "studytactics.com", true },
- { "stuermer.me", true },
- { "stuetzredli.ch", true },
- { "stuff-fibre.co.nz", true },
- { "stuffi.fr", true },
- { "stugor-danmark.com", true },
- { "stuka-art.de", true },
- { "stumeta.de", true },
- { "stumeta2019.de", true },
- { "stuntmen.xyz", true },
- { "stupendous.net", false },
- { "stupidest.org", true },
- { "stupidthoughts.tk", true },
- { "stupino-stroy.cf", true },
- { "stutelage.com", true },
- { "stuudium.com", true },
- { "stuudium.net", true },
- { "stuudium.org", true },
- { "stuudium.pro", true },
- { "stuur.nl", false },
- { "stuvel.eu", true },
- { "stuvus.de", true },
- { "stuvus.uni-stuttgart.de", true },
- { "stview.me", true },
- { "stw-group.at", true },
- { "stygium.net", false },
- { "stylebeat.tk", true },
- { "styleci.io", true },
- { "stylecollective.us", true },
- { "styledbysally.com.au", true },
- { "styleelite.tk", true },
- { "styletron.org", true },
- { "stylett.ru", true },
- { "stylewish.me", true },
- { "stypr.com", true },
- { "su1ph3r.io", true },
- { "suaudeau.fr", true },
- { "suaudeau.org", true },
- { "sub-net.at", true },
- { "sub.media", true },
- { "subastasdecarros.net", true },
- { "subdev.org", true },
- { "subdimension.org", true },
- { "subdivider.tk", true },
- { "subjektzentrisch.de", true },
- { "sublimebits.com", true },
- { "submedia.tv", true },
- { "submelon.tech", true },
- { "subohm.com", true },
- { "suborbital.io", true },
- { "subrad.io", true },
- { "subsistence.wiki", true },
- { "substitutealert.com", true },
- { "subtitry.ru", true },
- { "suburban-landscape.net", true },
- { "suburbaninfinitioftroyparts.com", true },
- { "subven.com", true },
- { "subversive-tech.com", true },
- { "subzerotech.co.uk", true },
- { "succesprojekter.dk", true },
- { "successdeliv.com", true },
- { "successemails.ml", true },
- { "sucessclick.gq", true },
- { "suche.org", true },
- { "suchem.com", true },
- { "suchmaschinen-werkstatt.de", true },
- { "suckmyan.us", false },
- { "sucretown.net", true },
- { "sudametrica.tk", true },
- { "sudanell.tk", true },
- { "sudanindependent.com", true },
- { "sudanindependent.net", true },
- { "sudaraka.org", false },
- { "sudmotor-occasions.be", false },
- { "sudo-i.net", true },
- { "sudo.li", true },
- { "sudo.ws", true },
- { "sudocat.me", true },
- { "sudokian.io", true },
- { "sudoschool.com", true },
- { "sudosu.fr", true },
- { "suecaunitedfc.tk", true },
- { "suelyonjones.com", true },
- { "suessdeko.de", true },
- { "suevia-ka.de", true },
- { "suffix.ru", true },
- { "sufix.cz", true },
- { "sugarbrother.com", false },
- { "sugarlandkarate.net", true },
- { "sugarlandurology.com", true },
- { "sugarshin.net", true },
- { "sugatime.tk", true },
- { "suggea.com", true },
- { "suggestim.ch", false },
- { "sugos.ml", true },
- { "suhaildawood.com", true },
- { "suicide.gq", true },
- { "suisui.stream", true },
- { "suitesapp.com", true },
- { "sujal.com", true },
- { "sujblog.com", true },
- { "sujoydhar.in", true },
- { "suka.moe", true },
- { "suke3.jp", true },
- { "sukherchador.org", true },
- { "suki.moe", true },
- { "sukiu.net", true },
- { "sukoyaka-labo.com", true },
- { "sukrie.net", true },
- { "suksit.com", true },
- { "sulabs.org", true },
- { "sulavius.tech", true },
- { "sulek.eu", true },
- { "sulian.me", true },
- { "suluvir.com", true },
- { "sulytics-tool.com", true },
- { "sumatphoto.com", true },
- { "sumatrabarat.ml", true },
- { "sumatrautara.ml", true },
- { "sumatriptan365.tk", true },
- { "sumcrevillent.tk", true },
- { "sumguy.com", true },
- { "sumit.me", true },
- { "sumitchahal.com", true },
- { "summa.eu", false },
- { "summarized.gq", true },
- { "summerbo.at", true },
- { "summercampthailand.com", true },
- { "summit-level.ru", true },
- { "summitbankofkc.com", true },
- { "summiteyekc.com", true },
- { "summitlighthousela.org", true },
- { "summusglobal.com", true },
- { "sun-beach.com.ua", true },
- { "sun-wellness-online.com.vn", true },
- { "sun.re", true },
- { "sun1218.com", true },
- { "sun1245.com", true },
- { "sun1338.com", true },
- { "sun1345.com", true },
- { "sun1378.com", true },
- { "sun668.asia", true },
- { "sun668.co", true },
- { "sunbritetv.com", true },
- { "sunbury.xyz", true },
- { "sunchasercats.com", true },
- { "suncity288.com", true },
- { "suncity288.net", true },
- { "suncity8118.cn", true },
- { "suncity8118.com", true },
- { "suncity818.cn", true },
- { "suncity818.com", true },
- { "suncity818.net", true },
- { "suncity8338.cn", true },
- { "suncity8338.com", true },
- { "suncity858.cn", true },
- { "suncity858.com", true },
- { "suncity8668.com", true },
- { "suncity8998.com", true },
- { "sundaycooks.com", true },
- { "sundayfundayjapan.com", true },
- { "sundragon.se", true },
- { "sunfiregold.com", true },
- { "sunfox.cz", true },
- { "sunfulong.blog", true },
- { "sunfulong.me", true },
- { "sungari.ru", true },
- { "sungreen.info", true },
- { "sunhaoxiang.net", true },
- { "sunjaydhama.com", true },
- { "sunjiutuo.com", true },
- { "sunlit.cloud", true },
- { "sunn.ie", true },
- { "sunnibangla.com", true },
- { "sunny.co.uk", true },
- { "sunnysidechurchofchrist.org", true },
- { "sunoikisis.org", true },
- { "sunpig.com.my", true },
- { "sunpig.com.sg", true },
- { "sunpig.fit", true },
- { "sunpig.my", true },
- { "sunpig.sg", true },
- { "sunred.info", true },
- { "sunred.org", true },
- { "sunsdesign.net", true },
- { "sunsetdentalhenderson.com", true },
- { "sunsetwx.com", true },
- { "sunshilin.tk", true },
- { "sunshine-cleaners.com.au", true },
- { "sunshinecoastplumbingcompany.com.au", true },
- { "sunshinelife.tk", true },
- { "sunshinesf.org", true },
- { "sunsmartresorts.com", true },
- { "sunsong.org", true },
- { "sunsquare.cz", true },
- { "sunstar.bg", true },
- { "sunwolf.studio", true },
- { "suomenkielisetnettikasinot.com", true },
- { "suomika.pl", true },
- { "supa.sexy", true },
- { "supedi.com", true },
- { "supedi.de", true },
- { "supedio.com", true },
- { "super-erotica.ru", true },
- { "superaficionados.com", true },
- { "superbart.nl", true },
- { "superbdistribute.com", true },
- { "superbestpalsclub.tk", true },
- { "superbintel.com", true },
- { "superbomsupermercado.com.br", true },
- { "superbouncebouncycastles.com", true },
- { "supercalorias.com", true },
- { "supercarrot.tk", true },
- { "supercastlesadelaide.com.au", true },
- { "supercastlesbrisbane.com.au", true },
- { "supercastlessunshinecoast.com.au", true },
- { "supercastlessydney.com.au", true },
- { "supercentenarian.com", true },
- { "supercharged.co.uk", true },
- { "supercinebattle.fr", true },
- { "superdrillers.tk", true },
- { "superdroni.com", true },
- { "superenduro.net", true },
- { "superglidewardrobes.co.uk", true },
- { "supergmtransport.com.au", true },
- { "superguide.com.au", true },
- { "superhappiness.com", true },
- { "superhome.com.au", true },
- { "superidropulitrice.com", true },
- { "superiordetail.tk", true },
- { "superlandnetwork.de", true },
- { "superlisa.nl", true },
- { "supermagna.tk", true },
- { "supermarx.nl", true },
- { "supermercadosdia.com.ar", true },
- { "supermercato24.it", true },
- { "supermil.ch", true },
- { "supermustang.tk", true },
- { "supern0va.net", false },
- { "supernaut.info", true },
- { "superpi.noip.me", true },
- { "supersahnetorten.de", true },
- { "supersena.com.br", true },
- { "supersonnig-festival.de", true },
- { "supersonnigfestival.de", true },
- { "superstargossip.com", true },
- { "superstarhost.tk", true },
- { "supersteosbouncycastles.com", true },
- { "superstropdas.nl", true },
- { "supersu.kr", true },
- { "superswingtrainer.com", true },
- { "supertasker.org", true },
- { "supertrade.tk", true },
- { "supertutorial.com.br", true },
- { "supervets.com.au", true },
- { "supervisionassist.com", true },
- { "supeuro.com", true },
- { "suplments.co.uk", true },
- { "suplments.com", true },
- { "suplments.de", true },
- { "suplments.fr", true },
- { "suplments.it", true },
- { "suplments.pt", true },
- { "supmil.net", true },
- { "supplementler.com", true },
- { "supplies24.at", true },
- { "supplies24.es", true },
- { "supplynation.org.au", true },
- { "support-ticino.ch", true },
- { "support.mayfirst.org", false },
- { "supportdesk.nu", true },
- { "supportericking.org", true },
- { "supra.tf", true },
- { "supracube.com", true },
- { "suprem.biz", false },
- { "suprem.ch", false },
- { "supremestandards.com", true },
- { "supriville.com.br", true },
- { "sur-v.com", true },
- { "suranganet.tk", true },
- { "surasak.tk", true },
- { "sure-it.de", true },
- { "surefit-oms.com", true },
- { "surefleet.com.au", true },
- { "surfnetkids.com", true },
- { "surfnetparents.com", true },
- { "surfocal.com", true },
- { "surgenights.com", true },
- { "surgeongeneral.gov", true },
- { "surgicalassociateswny.com", true },
- { "surnet.io", true },
- { "surnganet.tk", true },
- { "suroil.com", true },
- { "suroot.moe", true },
- { "surpreem.com", true },
- { "surreyheathyc.org.uk", false },
- { "surtisitio.com", true },
- { "suruifu.com", true },
- { "survature.com", true },
- { "surveer.com", true },
- { "surveil.site", true },
- { "surveillance104.com", true },
- { "surveyhealthcare.com", true },
- { "surveymill.co.uk", true },
- { "survivebox.fr", true },
- { "survivingmesothelioma.com", true },
- { "susanbpilates.com", true },
- { "susann-kerk.de", true },
- { "susanna-komischke.de", true },
- { "susanvelez.com", true },
- { "susc.org.uk", true },
- { "suseki.ga", true },
- { "sush.us", true },
- { "sushi.roma.it", true },
- { "sushibesteld.nl", true },
- { "susoccm.org", true },
- { "susosudon.com", true },
- { "suspect.id", true },
- { "suspension-shop.com", true },
- { "sussexheart.com", true },
- { "sustainability.gov", true },
- { "sustainabilityknowledgegroup.com", true },
- { "sustainabilitysociety.hk", true },
- { "sustainoss.org", true },
- { "sustsol.com", true },
- { "sutas.market", true },
- { "suttacentral.net", true },
- { "suurhelsinki.cf", true },
- { "suuria.de", true },
- { "suzi3d.com", true },
- { "suziekovner.com", true },
- { "suzikogsm.tk", true },
- { "suzukikenichi.com", true },
- { "suzukimarinepress.com", true },
- { "sv-bachum-bergheim.de", true },
- { "sv-turm-hohenlimburg.de", true },
- { "sv.search.yahoo.com", false },
- { "sv1880-lichtenau.de", true },
- { "svager.cz", true },
- { "svak-gutachter.de", true },
- { "svanstrom.com", true },
- { "svanstrom.org", true },
- { "svantner.sk", true },
- { "svarnyjunak.cz", true },
- { "svartx.com", true },
- { "svatbamisiaviti.tk", true },
- { "svc-sitec.com.mx", true },
- { "svc-sitec.mx", true },
- { "svc-sitec.org", true },
- { "svc1.xyz", true },
- { "svdb.co", false },
- { "svdesign.su", true },
- { "svedalataxi.com", true },
- { "sveinerik.org", true },
- { "svendubbeld.nl", true },
- { "sveneckelmann.de", true },
- { "svenjaundchristian.de", true },
- { "svenluijten.com", false },
- { "svenmuller.nl", true },
- { "svennd.be", true },
- { "svenskapsalmer.se", true },
- { "svetandroida.cz", true },
- { "svetila.com", true },
- { "svetlilo.com", true },
- { "svht.nl", true },
- { "svia.nl", true },
- { "svijet-medija.hr", true },
- { "svinformatica.es", true },
- { "svm-basketball.de", true },
- { "svm-it.eu", true },
- { "svo-intranet.de", true },
- { "svobodnyblog.cz", true },
- { "svodjapan.info", true },
- { "svorcikova.cz", true },
- { "svorkmofotball.tk", true },
- { "svpoa.org.uk", true },
- { "svsb-live.azurewebsites.net", false },
- { "svtr.de", true },
- { "sw-servers.net", true },
- { "sw33tp34.com", true },
- { "swagger.london", true },
- { "swallowgateway.com", true },
- { "swankism.com", true },
- { "swansdoor.org", true },
- { "swap.gg", true },
- { "swapfin.com", true },
- { "swaptaxdata.com", true },
- { "swarfarm.com", true },
- { "swarlys-server.de", true },
- { "swat4stats.com", true },
- { "swatee.com", true },
- { "swattransport.ae", true },
- { "sway-cdn.com", true },
- { "sway.com", true },
- { "swaz.co.uk", true },
- { "swc-cfc.gc.ca", true },
- { "swd.agency", true },
- { "swdiscount.ru", true },
- { "sweak.net", true },
- { "sweat-shirts.tk", true },
- { "swedentelugucommunity.com", true },
- { "swedishhost.com", true },
- { "swedishhost.se", true },
- { "sweep-me.net", true },
- { "sweepay.ch", false },
- { "sweepy.pw", true },
- { "sweet-as.co.uk", true },
- { "sweet-spatula.com", true },
- { "sweetbabyjesus.com", true },
- { "sweetbridge.com", true },
- { "sweetcalculus.ru", true },
- { "sweetenedcondensed.com", true },
- { "sweetgood.de", true },
- { "sweethomesnohomishrenovations.com", true },
- { "sweets-mimatsu.com", true },
- { "sweetydecor.ru", true },
- { "sweharris.org", true },
- { "swetrust.com", true },
- { "swey.net", false },
- { "swfmax.com", true },
- { "swgenetx.com", true },
- { "swhw.io", true },
- { "swi.sytes.net", true },
- { "swid.co.uk", true },
- { "swiftbonds.com", true },
- { "swiftcashforcars.com.au", true },
- { "swifteh.net", true },
- { "swiftpak.co.uk", true },
- { "swiftpcbassembly.com", true },
- { "swiftqueue.com", true },
- { "swilly.org", true },
- { "swimminglessons.com.sg", true },
- { "swimwear365.co.uk", true },
- { "swindontennisclub.azurewebsites.net", true },
- { "swindontennisclub.org", true },
- { "swineson.me", true },
- { "swing-belleville.de", true },
- { "swingmonkey.com", true },
- { "swingtimeinthegardens.com", true },
- { "swingular.com", true },
- { "swipetv.ie", true },
- { "swiss-apartments.com", true },
- { "swiss-connection.net", true },
- { "swiss-vanilla.ch", true },
- { "swiss-vanilla.com", true },
- { "swisscypher.com", true },
- { "swissdojo.ch", false },
- { "swisselement365.com", false },
- { "swisservers.com", true },
- { "swissfreshaircan.ch", false },
- { "swissid.ch", true },
- { "swissinternationalva.com", true },
- { "swisslinux.org", true },
- { "swissmadesecurity.net", true },
- { "swisstacticaldevelopment.ch", true },
- { "swisstechassociation.ch", true },
- { "swissurf.tk", true },
- { "swissvanilla.ch", true },
- { "swissvanilla.com", true },
- { "swit.io", true },
- { "switch-trader.com", true },
- { "switcheo.exchange", true },
- { "switcheo.rocks", true },
- { "switzerland-family-office.com", false },
- { "swivells.com", true },
- { "swj.red", true },
- { "swkdevserver.tk", true },
- { "swlabs.org", true },
- { "swmlink.com", true },
- { "swn-nec.de", true },
- { "swo.re", true },
- { "swordfeng.xyz", true },
- { "swrpgitems.com", true },
- { "swtun.com", true },
- { "swvaux.com", true },
- { "swxtd.com", true },
- { "swy.cz", true },
- { "swyn.net", true },
- { "sx8.ovh", true },
- { "sxistolithos.gr", true },
- { "sy-anduril.de", true },
- { "sy24.ru", true },
- { "syajvo.if.ua", false },
- { "syakonavi.com", true },
- { "sycamorememphis.org", true },
- { "sycca.com", true },
- { "sychov.pro", true },
- { "sydney-sehen.com", true },
- { "sydney.dating", true },
- { "sydneychillies.com.au", true },
- { "sydneyhelicopters.com.au", true },
- { "sydneylawnandturf.com.au", true },
- { "syenar.net", true },
- { "syezd.com.au", true },
- { "syha.org.uk", true },
- { "sykepleien.no", false },
- { "sylaps.com", true },
- { "syleam.in", true },
- { "sylfie.net", true },
- { "syllogi.xyz", true },
- { "sylvainboudou.com", true },
- { "sylvaindurand.fr", true },
- { "sylvaindurand.org", true },
- { "sylvaloir.fr", true },
- { "sylvan.me", true },
- { "sylvangarden.net", true },
- { "sylve.ch", false },
- { "sym01.com", true },
- { "symb.ch", false },
- { "symbiose-com.ch", false },
- { "symbiose-immobilier.ch", false },
- { "symbiose.com", true },
- { "symbiosecom.ch", false },
- { "symbo.tech", true },
- { "symdevinc.com", true },
- { "symeda.de", true },
- { "symetrix.tk", true },
- { "symfora-meander.nl", true },
- { "symlnk.de", true },
- { "symphonos.it", true },
- { "symplexia.com.br", true },
- { "sympmarc.com", true },
- { "symposium.beer", true },
- { "sympraxisconsulting.com", true },
- { "symptome-erklaert.de", true },
- { "synabi.com", true },
- { "synackrst.net", true },
- { "synapsepain.com", true },
- { "synatra.co", true },
- { "sync-it.no", true },
- { "synccentre.com", true },
- { "synchrolarity.com", true },
- { "synchronicity.cz", true },
- { "synchronyse.com", true },
- { "synchtu.be", false },
- { "syncmindglobal.com", true },
- { "syncplay.pl", true },
- { "syncrise.co.jp", true },
- { "synd.io", true },
- { "syneart.com", true },
- { "synecek11.cz", true },
- { "synedat.com", true },
- { "synergyflare.com", true },
- { "synergyworkingdogclub.com", true },
- { "synerionagile.com", true },
- { "synfin.org", true },
- { "synicalsyntax.com", true },
- { "synony.me", true },
- { "synotna.eu", true },
- { "synrestaccounting.com", true },
- { "syntaxnightmare.com", true },
- { "syntheticgrassliving.com.au", true },
- { "synthetik.com", true },
- { "synthv.fun", true },
- { "syogainenkin119.com", true },
- { "syonix.ru", true },
- { "syplasticsurgery.com", true },
- { "syquel-systems.de", true },
- { "sysadm.guru", true },
- { "sysadmins.ro", true },
- { "syscoon.com", true },
- { "sysctl.se", true },
- { "sysdb.io", true },
- { "syskit.com", true },
- { "sysmike.de", true },
- { "systea.fr", true },
- { "systea.net", true },
- { "system-admin-girl.com", true },
- { "system-m.de", false },
- { "system.cf", true },
- { "system.is", true },
- { "system4travel.com", true },
- { "systemadmin.uk", true },
- { "systematic-momo.com", true },
- { "systematic-momo.dk", true },
- { "systemausfall.org", true },
- { "systemchile.com", true },
- { "systemd.ch", false },
- { "systemd.eu.org", true },
- { "systemdynamics.net", true },
- { "systemeprod.fr", false },
- { "systemintegra.ru", true },
- { "systemisbusy.info", true },
- { "systemli.org", true },
- { "systemspace.link", true },
- { "systemups.com", true },
- { "systemweb.no", true },
- { "syswiki.org", true },
- { "syuez.com", true },
- { "syy.im", true },
- { "syzdev.com", true },
- { "syzygy-tables.info", true },
- { "sz-ideenlos.de", true },
- { "sz-lessgym-kamenz.de", true },
- { "szafkirtv.pl", true },
- { "szamitogepdepo.com", true },
- { "szasz.me", true },
- { "szclsya.me", true },
- { "szechenyi2020.hu", true },
- { "szentistvanpt.sk", true },
- { "szeptylasu.eu", true },
- { "szetowah.org.hk", true },
- { "szkolajazdykaleta.pl", true },
- { "szs.space", true },
- { "sztoriboljeles.hu", true },
- { "szurgot.eu", true },
- { "szww99.cc", true },
- { "szybkiebieganie.pl", true },
- { "szymczak.at", true },
- { "szyndler.ch", true },
- { "szzsivf.com", true },
- { "t-hawk.com", true },
- { "t-m.me", true },
- { "t-net.org.hu", true },
- { "t-pc.org", true },
- { "t-shirts4less.nl", true },
- { "t-stonegroup.com", true },
- { "t.facebook.com", false },
- { "t00228.com", false },
- { "t00ts.com", true },
- { "t0ny.name", true },
- { "t1208.com", true },
- { "t1209.com", true },
- { "t12u.com", true },
- { "t1316.com", true },
- { "t1317.com", true },
- { "t1318.com", true },
- { "t1319.com", true },
- { "t2181.com", true },
- { "t2182.com", true },
- { "t2183.com", true },
- { "t2881.com", true },
- { "t2i.nl", true },
- { "t3.ie", true },
- { "t36533.com", true },
- { "t36594.com", true },
- { "t3hty.fr", true },
- { "t47.io", true },
- { "t4c.link", true },
- { "t4cc0.re", true },
- { "t5880.com", true },
- { "t5881.com", true },
- { "t6354.com", true },
- { "t6360.com", true },
- { "t6364.com", true },
- { "t6370.com", true },
- { "t6371.com", true },
- { "t6381.com", true },
- { "t6801.com", true },
- { "t6810.com", true },
- { "t6820.com", true },
- { "t6830.com", true },
- { "t6850.com", true },
- { "t6860.com", true },
- { "t6870.com", true },
- { "t6880.com", true },
- { "t6881.com", true },
- { "t68app.com", true },
- { "t7009.com", true },
- { "t7119.com", true },
- { "t776633.com", true },
- { "t7802.com", true },
- { "t7805.com", true },
- { "t7807.com", true },
- { "t7808.com", true },
- { "t7809.com", true },
- { "t7880.com", true },
- { "t7e.de", false },
- { "t8003.com", true },
- { "t8006.com", true },
- { "t8070.com", true },
- { "t8110.com", true },
- { "t8119.com", true },
- { "t81818.com", true },
- { "t8250.com", true },
- { "t8803.com", true },
- { "t8805.com", true },
- { "t8807.com", true },
- { "t8809.com", true },
- { "t8815.com", true },
- { "t8816.com", true },
- { "t8817.com", true },
- { "t8819.com", true },
- { "t8830.com", true },
- { "t88gg.com", true },
- { "t88jj.com", true },
- { "t88mm.com", true },
- { "t88nn.com", true },
- { "t88oo.com", true },
- { "t88ss.com", true },
- { "t88vip0.com", true },
- { "t88vip1.com", true },
- { "t88vip2.com", true },
- { "t88vip3.com", true },
- { "t88vip4.com", true },
- { "t88vip5.com", true },
- { "t88vip6.com", true },
- { "t88vip7.com", true },
- { "t88xx.com", true },
- { "t9i.in", true },
- { "ta-65.com", true },
- { "ta-nuth.nl", true },
- { "ta-soest.nl", true },
- { "ta65.com", true },
- { "taabe.net", true },
- { "taalcursusvolgen.nl", true },
- { "taalmeisje.nl", true },
- { "taanishsaifu.gq", true },
- { "taartbesteld.nl", true },
- { "tabacundo.tk", true },
- { "tabarnak.ga", true },
- { "tabegamisama.com", true },
- { "tabhui.com", true },
- { "tabi-news.com", true },
- { "tabi-runrun.com", true },
- { "tabithawebb.co.uk", true },
- { "tableandhearth.com", true },
- { "tabledusud.be", true },
- { "tabledusud.nl", true },
- { "tablemagnet.com", true },
- { "tablerocksbestrealtors.com", true },
- { "tablescraps.com", true },
- { "tablet.facebook.com", false },
- { "tabletd.com", true },
- { "tabletsbaratasya.com", true },
- { "tablotv.com", false },
- { "taborsky.cz", true },
- { "tac-volley.com", false },
- { "tachi.uk", true },
- { "tackleyourfeelings.com", true },
- { "tacomafia.net", true },
- { "tacticalavocado.com", true },
- { "tacticalvote.co.uk", true },
- { "tadalafilindia.gq", true },
- { "tadamstudio.ca", true },
- { "taddiestales.com", true },
- { "tadeo.ca", true },
- { "tadiranbatteries.de", true },
- { "tadjikistan.tk", true },
- { "tadluedtke.com", true },
- { "tadtadya.com", true },
- { "tadu.de", true },
- { "taffe-elec.com", true },
- { "tagabrand.co.uk", true },
- { "tagderinspiration.ch", true },
- { "tagdocumentary.com", true },
- { "taggedpdf.com", false },
- { "taggigkaktus.tk", true },
- { "taginet.com", true },
- { "taglioepiega.com", true },
- { "taglioepiega.eu", true },
- { "taglioepiega.it", true },
- { "tagnull.de", true },
- { "tagtoys.com", true },
- { "taguette.com", true },
- { "taguette.fr", true },
- { "taguette.org", true },
- { "tagungsraum-usedom.de", true },
- { "tagungsraum-zinnowitz.de", true },
- { "tagungsstaette-usedom.de", true },
- { "tagungsstaette-zinnowitz.de", true },
- { "taherian.me", true },
- { "tahhan-tech.com", true },
- { "taichichuanyang.com", true },
- { "taihesy.tk", true },
- { "taiklus.lt", true },
- { "tailpuff.net", false },
- { "tails.boum.org", true },
- { "tailwag.party", true },
- { "taimane.com", true },
- { "taishokudaiko.com", true },
- { "taishon.nagoya", true },
- { "taitmacleod.com", true },
- { "taiwan.dating", true },
- { "taiwanhotspring.net", true },
- { "taiwania.capital", true },
- { "taiwania.vc", true },
- { "taiwaniacapital.com", true },
- { "taiwaniacapital.com.tw", true },
- { "taiwaniacapital.tw", true },
- { "taiwantour.info", true },
- { "taiyouko-hatuden.net", true },
- { "taizegroep.nl", true },
- { "tajper.pl", true },
- { "tajr.shop", true },
- { "take1give1.com", false },
- { "takeaimnow.org", true },
- { "takemoto-ped.com", true },
- { "taken.cf", true },
- { "taken.pl", true },
- { "takenbydrone.com.au", true },
- { "takeomi.jp", true },
- { "takeshifujimoto.com", false },
- { "takipone.com", true },
- { "takk.pl", true },
- { "takkaaaaa.com", true },
- { "takkguitar.net", true },
- { "takuhai12.com", true },
- { "takumi-s.net", true },
- { "takuto.de", true },
- { "talendipank.ee", true },
- { "talentcast.nl", true },
- { "talentcast.org", true },
- { "talentos.pt", true },
- { "talentwall.io", true },
- { "taler.net", true },
- { "talichi.com", true },
- { "talideon.com", false },
- { "talis-bs.com", true },
- { "talk.google.com", true },
- { "talkgadget.google.com", true },
- { "talking12.com", true },
- { "talkingmoose.net", true },
- { "talkreal.net", true },
- { "talktech.com", true },
- { "talkwithyourbaby.org", true },
- { "tallcraft.com", true },
- { "talldude.net", true },
- { "tallinnsec.ee", true },
- { "tallinnsex.ee", true },
- { "tallship.cz", true },
- { "talltreeskv.com.au", true },
- { "tallyfy.com", true },
- { "talroo.com", true },
- { "talun.de", true },
- { "talusan.tk", true },
- { "talxis.com", true },
- { "tamada.expert", true },
- { "tamarimolhem.com", true },
- { "tambayology.com", true },
- { "tambo.es", true },
- { "tambov.tk", true },
- { "tambre.ee", true },
- { "tamersunion.org", true },
- { "tamindir.com", true },
- { "tammy.pro", true },
- { "tamoxifen-citrate.ml", true },
- { "tampabaybusinesslistings.com", true },
- { "tampabayhometours.info", true },
- { "tampacific.net", true },
- { "tampacific.vn", true },
- { "tamposign.fr", true },
- { "tamriel-rebuilt.org", true },
- { "tamsweb.de", true },
- { "tamtowild.com", true },
- { "tanacio.com", true },
- { "tanchynski.com", true },
- { "tancredi.nl", true },
- { "tandartszilverschoon.nl", true },
- { "tandemexhibits.com", true },
- { "tandempartnerships.com", true },
- { "tandoanh.vn", true },
- { "tandzorg.link", true },
- { "tangel.me", true },
- { "tangemann.org", true },
- { "tangle-teezer.net", true },
- { "tangledmeditations.com", true },
- { "tango-ouest.com", false },
- { "tangoalpha.co.uk", true },
- { "tanhit.com", true },
- { "taniafitness.co.uk", true },
- { "taniafitness.com", true },
- { "tanie-uslugi-ksiegowe.pl", true },
- { "taniku-succulent.com", true },
- { "tankpassen-vergelijken.nl", true },
- { "tanks.je", true },
- { "tankski.co.uk", true },
- { "tannenhof-moelln.de", true },
- { "tannerryan.ca", true },
- { "tannerwilliamson.com", true },
- { "tannerwj.com", true },
- { "tanovar.com", true },
- { "tansuya.jp", true },
- { "tantalos.nl", true },
- { "tantei100.net", true },
- { "tantetilli.de", false },
- { "tanto259.name", true },
- { "tantravoorlichting.nl", true },
- { "tanveersingh.tk", true },
- { "tanyanama.com", true },
- { "tanz-kreativ.de", true },
- { "tanz.info", true },
- { "tanzhijun.com", true },
- { "tanzo.io", true },
- { "taoburee.com", true },
- { "taowa.ca", true },
- { "tapissier-schall.fr", true },
- { "taprix.org", true },
- { "tapsnapp.co", true },
- { "taptoweb.com", true },
- { "taquilla.com", true },
- { "tar-mag.com", true },
- { "tara.ai", true },
- { "tarakan-klopik.tk", true },
- { "taranagar.tk", true },
- { "tarasecurity.co.uk", true },
- { "tarasecurity.com", true },
- { "tarasevich.by", true },
- { "tardis.io", true },
- { "tarek.wtf", true },
- { "tarfin.com", true },
- { "targetbuilding.com", true },
- { "targetx.pl", true },
- { "targimieszkaniowe.net", true },
- { "tarife.at", true },
- { "tariff.cc", true },
- { "tarija.tk", true },
- { "tarik.io", true },
- { "tarkov-database.com", true },
- { "tarmexico.com", true },
- { "taron.top", true },
- { "tarotistasvidentes.es", true },
- { "tarsan.cz", true },
- { "tartaneagle.org.uk", true },
- { "tartanhamedshop.com.br", true },
- { "taruntarun.net", false },
- { "tarzanka.ml", true },
- { "tas2580.net", false },
- { "tasadar.net", true },
- { "tasadordecoches.com", true },
- { "tasarimgazetesi.com", true },
- { "tascuro.com", true },
- { "taskhorizon.audio", true },
- { "taskotron.fedoraproject.org", true },
- { "taskotron.stg.fedoraproject.org", true },
- { "tasks.org", true },
- { "taskstream.com", true },
- { "taskulu.com", true },
- { "taskulu.ir", true },
- { "taskutark.ee", true },
- { "taskworld.com", true },
- { "tasogarenoinori.net", true },
- { "tass.nu", true },
- { "tastic.com", true },
- { "tasticfilm.com", true },
- { "tastycake.net", false },
- { "tastystakes.com", true },
- { "tat2grl85.com", true },
- { "tatara.ne.jp", true },
- { "tatard.fr", true },
- { "tatiana-kpb.tk", true },
- { "tatler.com", true },
- { "tato.noip.me", true },
- { "tatsidou.gr", true },
- { "tattoo-art.tk", true },
- { "tattoo.dating", true },
- { "tattvaayoga.com", true },
- { "tatuantes.com", true },
- { "taubin.cc", true },
- { "tauedu.org", true },
- { "tauflight.com", true },
- { "taunhanh.us", false },
- { "taunusstein.net", true },
- { "tauriscia.tk", true },
- { "tavolaquadrada.com.br", true },
- { "tavsys.net", true },
- { "tax-guard.com", true },
- { "taxaroo.com", true },
- { "taxationweb.co.uk", true },
- { "taxce.com", true },
- { "taxhawk.com", true },
- { "taxhunter.com.au", true },
- { "taxi-chamonix.fr", false },
- { "taxi-collectif.ch", false },
- { "taxi-domzale.tk", true },
- { "taxi-edessas.gr", true },
- { "taxi-jihlava.cz", true },
- { "taxi-legroux.com", true },
- { "taxi-puck.pl", true },
- { "taxi-waregem.be", true },
- { "taxi-zakaz.ml", true },
- { "taxicab4you.com", true },
- { "taxichic.com", true },
- { "taxicollectif.ch", false },
- { "taxid-k.be", true },
- { "taximinvody.ml", true },
- { "taxis-collectifs.ch", false },
- { "taxisaeropuertomadrid.com", true },
- { "taxisantapolagranalacant.com", true },
- { "taxiscollectifs.ch", false },
- { "taxlab.co.nz", true },
- { "taxo.fi", true },
- { "taxpackagesupport.com", true },
- { "taxsquirrel.com", true },
- { "taylorfry.com.au", true },
- { "taylorgalleries.com", true },
- { "taylorpearson.me", false },
- { "taylors-castles.co.uk", true },
- { "taylorshillsamoan.org", true },
- { "taylorstauss.com", true },
- { "tazarelax.es", true },
- { "tb-devel.de", true },
- { "tb-itf.de", true },
- { "tba.bm", true },
- { "tbejos.com", true },
- { "tbfocus.com", true },
- { "tbitc.ch", true },
- { "tbonejs.org", true },
- { "tbpchan.cz", true },
- { "tbrindus.ca", true },
- { "tbs-certificates.co.uk", true },
- { "tbspace.de", true },
- { "tbtech.cz", true },
- { "tbuchloh.de", true },
- { "tc-st-leonard.ch", false },
- { "tcdw.net", true },
- { "tcf.org", true },
- { "tcgpraktijk.nl", true },
- { "tcgrepublic.com", true },
- { "tchannels.tv", true },
- { "tchebb.me", true },
- { "tchebotarev.com", true },
- { "tchnics.de", true },
- { "tchoukball.ch", false },
- { "tchverheul.nl", true },
- { "tcit.fr", true },
- { "tcj.ir", true },
- { "tcksolutions.com", true },
- { "tcl.sh", true },
- { "tclb.ga", true },
- { "tcmwellnessclinic.com", true },
- { "tcnapplications.com", true },
- { "tcpride.org", true },
- { "tcpweb.net", true },
- { "tcvvip.com", true },
- { "tcwis.com", true },
- { "tdchrom.com", false },
- { "tddos.pw", true },
- { "tdfbfoundation.org", true },
- { "tdr.today", true },
- { "tdrcartuchos.com.br", true },
- { "tdrs.info", true },
- { "tdsinflatables.co.uk", true },
- { "tdstoragebay.com", true },
- { "tdude.co", true },
- { "tdvg.nl", true },
- { "tdyx-china.com.cn", true },
- { "tea.in.th", true },
- { "teachbiz.net", true },
- { "teachercreatedmaterials.com", true },
- { "teacherph.com", true },
- { "teacherpowered.org", true },
- { "teachingcopyright.com", true },
- { "teachingcopyright.net", true },
- { "teachingcopyright.org", true },
- { "teachmeplease.ru", true },
- { "teachpeople.org", true },
- { "teachwithouttears.com", true },
- { "teahut.net", true },
- { "tealdotsinanorangeworld.com", true },
- { "team-azerty.com", true },
- { "team-io.net", true },
- { "team3482.com", true },
- { "teamacadia.org", true },
- { "teambeam.at", true },
- { "teambeam.ch", true },
- { "teambeam.com", true },
- { "teambeam.de", true },
- { "teambim.eu", true },
- { "teambition.com", true },
- { "teamdog.pet", true },
- { "teamif.io", true },
- { "teamkoncert.pl", true },
- { "teamliquid.com", true },
- { "teamliquidpro.com", true },
- { "teammateworld.com", true },
- { "teamninjaapp.com", true },
- { "teamnissannorthparts.com", true },
- { "teampaddymurphy.ch", true },
- { "teampaddymurphy.ie", true },
- { "teamrevolution.tk", true },
- { "teams.microsoft.com", true },
- { "teamsimplythebest.com", true },
- { "teamspeak-serverlist.xyz", true },
- { "teamsuccess.io", true },
- { "teamtouring.net", true },
- { "teamtrack.uk", true },
- { "teamup.com", true },
- { "teamup.rocks", true },
- { "teamupturn.com", true },
- { "teamupturn.org", true },
- { "teamx-gaming.de", true },
- { "tearoomlints.be", true },
- { "tease.email", true },
- { "teasenetwork.com", true },
- { "teaser-trailer.com", true },
- { "teatrarium.com", true },
- { "teazer.tk", true },
- { "teb-akademia.pl", true },
- { "tebebo.com", true },
- { "tebodental.com", true },
- { "teboorthodontics.com", true },
- { "tec3000.ch", false },
- { "tecart-cloud.de", true },
- { "tecart-system.de", true },
- { "tecartcrm.de", true },
- { "tech-banker.com", false },
- { "tech-blogger.net", true },
- { "tech-clips.com", false },
- { "tech-essential.com", true },
- { "tech-info.jp", true },
- { "tech-leaders.jp", true },
- { "tech-ninja.de", true },
- { "tech-rat.com", true },
- { "tech-seminar.jp", true },
- { "tech-value.eu", true },
- { "tech-zealots.com", true },
- { "tech4arab.net", true },
- { "techace.jp", true },
- { "techamigo.in", true },
- { "techaraby.com", true },
- { "techassist.io", false },
- { "techaulogy.com", true },
- { "techbelife.com", true },
- { "techbrown.com", true },
- { "techcentral.my", false },
- { "techcenturion.com", true },
- { "techchip.com", true },
- { "techcracky.com", true },
- { "techcu.lt", true },
- { "techcultivation.de", false },
- { "techcultivation.net", false },
- { "techcultivation.org", false },
- { "techdatapark.com", true },
- { "techdirt.com", true },
- { "techdroid.eu", true },
- { "techendeavors.com", true },
- { "techformator.pl", true },
- { "techgadgetry.in", true },
- { "techglover.com", true },
- { "techhappy.ca", true },
- { "techinet.pl", true },
- { "techinsurance.com", true },
- { "techjobplaybook.nyc", true },
- { "techjoe.co", true },
- { "techlovers.com", true },
- { "techlr.de", true },
- { "techmagus.icu", true },
- { "techmajesty.com", true },
- { "techmasters.io", true },
- { "techmoviles.com", true },
- { "techmunchies.net", true },
- { "techni-grav.com", true },
- { "technic3000.com", true },
- { "technicabv.nl", true },
- { "technicallyeasy.net", true },
- { "technicaloffice.gr", true },
- { "technicalproblem.tk", true },
- { "technicalramblings.com", true },
- { "technicalsystemsprocessing.com", true },
- { "technik-boeckmann.de", true },
- { "technikman.de", true },
- { "technochat.in", true },
- { "technofirstonline.com", true },
- { "technogps.com", true },
- { "technogroup.cz", true },
- { "technokicks.com", true },
- { "technologie-innovation.fr", true },
- { "technology.cx", true },
- { "technologyhound.org", true },
- { "technologysi.com", true },
- { "technorely.com", true },
- { "technosapien.ml", true },
- { "technoscoots.com", true },
- { "technosorcery.net", true },
- { "technospeakco.com", true },
- { "technowise.tk", true },
- { "techold.ru", true },
- { "techorbiter.com", true },
- { "techosmarcelo.com.ar", true },
- { "techpilipinas.com", true },
- { "techpit.us", true },
- { "techpivot.net", true },
- { "techpoint.org", true },
- { "techserve.ml", true },
- { "techshift.eu", true },
- { "techshift.nl", true },
- { "techshift.se", true },
- { "techsolvency.com", true },
- { "techsys.cz", true },
- { "techsystemsa.com", true },
- { "techtalks.no", true },
- { "techtrader.ai", true },
- { "techtrader.io", true },
- { "techusers.de", true },
- { "techview.link", true },
- { "techviewforum.com", true },
- { "techwalker.cf", true },
- { "techwayz.com", true },
- { "techwhisperer.ca", true },
- { "techwords.io", true },
- { "techy360.com", true },
- { "techzero.cn", true },
- { "teckgeekz.com", true },
- { "teckids.org", true },
- { "tecknobox.fr", true },
- { "tecma.com", true },
- { "tecnaa.com", true },
- { "tecnasa.com", true },
- { "tecne.ws", true },
- { "tecnicoelettrodomestici.roma.it", true },
- { "tecnoarea.com.ar", true },
- { "tecnobrasilloja.com.br", true },
- { "tecnodritte.it", true },
- { "tecnogazzetta.it", true },
- { "tecnologiasurbanas.com", true },
- { "tecon.co.at", true },
- { "tecyt.com", true },
- { "ted.do", true },
- { "tedb.us", true },
- { "teddy.ch", true },
- { "teddybradford.com", true },
- { "teddylu.info", true },
- { "teddyss.com", false },
- { "tedsdivingsystem.com", true },
- { "teeautomat-teemaschine.de", true },
- { "teedb.de", true },
- { "teemperor.de", true },
- { "teemulintula.fi", true },
- { "teen-porno-video.ru", true },
- { "teenerotic.net", true },
- { "teengirl.pub", true },
- { "teenpussypornvid.com", true },
- { "teensexgo.com", true },
- { "teensybows.hu", true },
- { "teeqq.com", true },
- { "teetje-doko.de", true },
- { "teetoptens.com", true },
- { "teeworlds-friends.de", true },
- { "teextee.com", true },
- { "tefek.cz", true },
- { "teganlaw.ca", true },
- { "teganlaw.com", true },
- { "tege-elektronik.hu", true },
- { "tegel-schoonmaken.nl", true },
- { "tehden.com", true },
- { "tehniss.rs", true },
- { "tehrabbitt.com", false },
- { "teichroeb.net", true },
- { "teixobactin.com", true },
- { "teka.ro", true },
- { "tekingb.com", true },
- { "teknemodus.com.au", true },
- { "teknik.io", true },
- { "tekniksnack.se", true },
- { "tekniskakustik.se", true },
- { "tekno.de", true },
- { "teknoforums.com", true },
- { "teknoroit.com", true },
- { "tekstschrijvers.net", true },
- { "tektouch.net", true },
- { "telamon.eu", true },
- { "telco.at", true },
- { "telcotronics.com", true },
- { "teldak.pt", true },
- { "tele-online.com", true },
- { "tele-points.net", true },
- { "telecamera.pro", false },
- { "telecomwestland.nl", true },
- { "teledivi.com", true },
- { "telefon.report", true },
- { "telefonabonnement.dk", true },
- { "telefonkonferenz.ch", true },
- { "telefonni-ustredna.cz", true },
- { "telefonseelsorge-paderborn.de", true },
- { "telefoon.nl", true },
- { "telefoonabonnement.nl", true },
- { "telegenisys.com", true },
- { "telegra.ph", true },
- { "telegram.hk", true },
- { "telegram.org", true },
- { "telehealthventures.com", false },
- { "telekothonbd.com", true },
- { "teleogistic.net", true },
- { "telephonedirectories.us", true },
- { "telephoni-cdma.tk", true },
- { "teleport.com.br", true },
- { "teleradio.tk", true },
- { "telestepina.ru", true },
- { "teletexto.com", true },
- { "televizeseznam.cz", true },
- { "televotia.ch", true },
- { "telework.gov", true },
- { "telford.codes", true },
- { "telhabrasil.com.br", true },
- { "telling.xyz", true },
- { "tellingua.com", false },
- { "tellthemachines.com", true },
- { "tellusaboutus.com", true },
- { "telly.site", true },
- { "tellygames.com", true },
- { "tellyourtale.com", true },
- { "teloo.pl", true },
- { "telsu.fi", true },
- { "teltru.com", true },
- { "tem.li", true },
- { "temariogratis.com", true },
- { "temariopolicianacional.es", true },
- { "temariosdeoposiciones.es", true },
- { "tematicas.org", true },
- { "temdu.com", true },
- { "temizmama.com", true },
- { "temnacepel.cz", true },
- { "temp.pm", true },
- { "tempa.com.ua", true },
- { "tempdomain.ml", true },
- { "tempdomain.tk", true },
- { "template-parks.com", true },
- { "templateinvaders.com", true },
- { "templetattoo.co.za", true },
- { "templete.tk", true },
- { "templum.com.br", true },
- { "tempmail.ninja", true },
- { "temporarysanity.tk", true },
- { "temtekco.com", true },
- { "tenable.com.au", true },
- { "tenber.ge", true },
- { "tenbos.ch", true },
- { "tendance-et-accessoires.com", true },
- { "tende.roma.it", true },
- { "tendermaster.com.ua", true },
- { "tenderplan.ru", true },
- { "tenderstem.co.uk", true },
- { "tendomag.com", true },
- { "tenelco.net", true },
- { "tenenz.com", true },
- { "tenisservis.eu", true },
- { "tenkofx.com", true },
- { "tenniscourtsjoburg.com", true },
- { "tennismindgame.com", true },
- { "tenno.tools", true },
- { "tenpo-iku.com", true },
- { "tenpolab.com", true },
- { "tenshoku-hanashi.com", true },
- { "tenta.com", true },
- { "tentacletank.com", true },
- { "tentations-voyages.com", false },
- { "tentech.io", true },
- { "tenthousandcoffees.com", true },
- { "tenyx.de", true },
- { "tenzer.dk", true },
- { "teoleonie.com", false },
- { "tepid.org", true },
- { "tepitus.de", true },
- { "teplofom.ru", true },
- { "tequilazor.com", true },
- { "terabyte.services", true },
- { "terabyteit.co.uk", true },
- { "teracloud.at", true },
- { "teramind.co", true },
- { "teranacreative.com", true },
- { "teraservice.eu", true },
- { "terass.com", true },
- { "terengganudaily.tk", true },
- { "teriyakisecret.com", true },
- { "terlindung.com", true },
- { "termbackti.me", true },
- { "terme.viterbo.it", true },
- { "termee.com", true },
- { "terminalhrd.com", true },
- { "terminalvelocity.co.nz", true },
- { "termino.eu", true },
- { "terminsrakning.se", true },
- { "termitinitus.org", true },
- { "termografiranje.si", true },
- { "termoidraulica.roma.it", true },
- { "termoidraulico.roma.it", true },
- { "termux.com", true },
- { "terra-24.ru", true },
- { "terrab.de", false },
- { "terracloud.de", false },
- { "terraelectronica.ru", true },
- { "terraform.io", true },
- { "terragni-sarasin.ch", true },
- { "terrainator.com", true },
- { "terraluna.space", true },
- { "terranova.fi", true },
- { "terrapay.com", true },
- { "terrastaffinggroup.com", false },
- { "terraweb.net", true },
- { "terresmagiques.com", false },
- { "terrorbilly.com", true },
- { "terrorblast.tk", true },
- { "terrty.net", true },
- { "terrybutler.co.uk", true },
- { "terryjohnsononline.com", true },
- { "tes.com", true },
- { "tesche.biz", true },
- { "teschenhausen.com", true },
- { "tescoirelandpayslips.com", true },
- { "tescolide.cz", true },
- { "tescoludia.sk", true },
- { "tesdrole.tk", true },
- { "teskalabs.com", true },
- { "teslamagician.com", true },
- { "tessai.ga", true },
- { "tesseractinitiative.org", true },
- { "test-greavesindia.pantheonsite.io", true },
- { "test-iq.gq", true },
- { "test-online.tk", true },
- { "test-school.ml", true },
- { "test-textbooks.com", true },
- { "test.de", true },
- { "test.support", true },
- { "testbirds.sk", true },
- { "tested.email", true },
- { "testeri.fi", true },
- { "testeveonline.com", true },
- { "testforce.tk", true },
- { "testfra.me", true },
- { "testgeomed.ro", true },
- { "testingbot.com", true },
- { "testmx.email", true },
- { "testmx.eu", true },
- { "testmx.org", true },
- { "testmy.net", true },
- { "testomato.com", true },
- { "testoon.com", true },
- { "testpornsite.com", true },
- { "testsuite.org", true },
- { "testthis.cf", true },
- { "testuje.net", true },
- { "tetedelacourse.ch", true },
- { "teto.nu", true },
- { "tetr.io", true },
- { "tetraetc.com", true },
- { "tetraktus.org", true },
- { "tetrarch.co", true },
- { "tetsai.net", true },
- { "tetsugakunomichi.jp", true },
- { "tetsumaki.net", true },
- { "teufel.dk", true },
- { "teulon.eu", true },
- { "teusink.eu", true },
- { "tewarilab.co.uk", true },
- { "tewkesburybouncycastles.co.uk", true },
- { "texasabrasiveblasting.com", true },
- { "texasbluesalley.com", true },
- { "texasholdemevents.net", true },
- { "texashomesandland.com", true },
- { "texasllcpros.com", false },
- { "texaspaintingandgutters.com", true },
- { "texasparkinglotstriping.com", true },
- { "texastwostepdivorce.com", true },
- { "texasurodoc.com", true },
- { "texasvolunteerattorneys.org", true },
- { "texaswinetrail.com", true },
- { "texby.com", true },
- { "texhnolyze.net", true },
- { "texier.mx", true },
- { "text-shirt.com", false },
- { "textburst.com", true },
- { "texter-linz.at", true },
- { "texter.at", true },
- { "texterseo.at", true },
- { "texterseo.de", true },
- { "textonly.email", true },
- { "textpages.tk", true },
- { "textpattern.com", true },
- { "textualapp.com", true },
- { "textundblog.de", true },
- { "texture.net.au", true },
- { "texus.me", true },
- { "texy.info", true },
- { "teysens.com", true },
- { "tf2b.com", true },
- { "tf2calculator.com", true },
- { "tfb.az", true },
- { "tfg-bouncycastles.com", true },
- { "tfk.fr", true },
- { "tfle.xyz", true },
- { "tflite.com", true },
- { "tfnapps.de", true },
- { "tfreeman.org", true },
- { "tfx.com.br", true },
- { "tfx.pt", true },
- { "tfxstartup.com", true },
- { "tfxstartup.com.br", true },
- { "tgamobility.co.uk", true },
- { "tgb.org.uk", true },
- { "tgbabyzoo.com", true },
- { "tgbyte.de", true },
- { "tgexport.eu", true },
- { "tgo3333.com", false },
- { "tgo4444.com", false },
- { "tgo5555.com", false },
- { "tgtv.tn", true },
- { "tgui.eu", true },
- { "tgui.net", true },
- { "tgw.com", true },
- { "tgwork.com", true },
- { "th.search.yahoo.com", false },
- { "thablubb.de", true },
- { "thaedal.net", true },
- { "thai.dating", true },
- { "thai369.com", true },
- { "thaicurry.net", true },
- { "thaicyberpoint.com", true },
- { "thaiforest.ch", false },
- { "thaiforexfamily.com", true },
- { "thaihomecooking.com", true },
- { "thaihong.co.th", true },
- { "thaihotmodels.tk", true },
- { "thailandpharmacy.net", true },
- { "thailandpropertylisting.com", true },
- { "thaimega.club", true },
- { "thaiportal.gq", true },
- { "thajskyraj.com", true },
- { "thalan.fr", true },
- { "thalhammer.it", true },
- { "thalia.nu", true },
- { "thalliman.com", true },
- { "thalmann.fr", false },
- { "thambaru.com", true },
- { "thanatoid.net", true },
- { "thanhthinhbui.com", true },
- { "thaqfni.com", true },
- { "tharuka-app.de", true },
- { "tharuka.com", true },
- { "tharuka.de", true },
- { "thatdarkplace.com", true },
- { "thatguyalex.com", true },
- { "thatquiz.org", true },
- { "thatshayini-sivananthan.fr", true },
- { "thavmacode.gr", true },
- { "thc-stadvdzon.nl", true },
- { "thca.ca", true },
- { "thcdev.de", true },
- { "thconsulting.co.uk", true },
- { "thcpbees.co.uk", true },
- { "the-alan-parsons-project.com", true },
- { "the-archimedeans.org.uk", true },
- { "the-archive.ml", true },
- { "the-big-bang-theory.com", true },
- { "the-body-shop.hu", false },
- { "the-digitale.com", false },
- { "the-fermenter.com", true },
- { "the-forgotten.net", true },
- { "the-hemingway-code.de", true },
- { "the-jeuxflash.com", true },
- { "the-medium-dolphore.com", true },
- { "the-mystery.org", true },
- { "the-nash-education-program.com", true },
- { "the-pack.nl", true },
- { "the-pcca.org", true },
- { "the-spoonfeed.club", true },
- { "the-train.de", true },
- { "the-trophy-company.com", true },
- { "the-woods.org.uk", true },
- { "the-zenti.de", true },
- { "the2f.de", true },
- { "the3musketeers.biz", true },
- { "the51news.ga", true },
- { "the5th.nl", true },
- { "the8rules.co.uk", true },
- { "thea-team.net", true },
- { "theaccountingcompanyleeds.co.uk", true },
- { "theactuary.ninja", true },
- { "theadelaideshow.com.au", true },
- { "theadultswiki.com", true },
- { "theafleo.ga", true },
- { "theagencywithoutaname.com", true },
- { "thealchemistatelier.com", true },
- { "theallmanteam.com", true },
- { "thealonas.cf", true },
- { "thealonas.ga", true },
- { "thealonas.gq", true },
- { "thealonas.ml", true },
- { "thealonas.tk", true },
- { "theandroidsoul.com", true },
- { "theangelfishfoundation.org", true },
- { "theantarticx.com", true },
- { "theapplewiki.com", true },
- { "theappliancedepot.co.uk", true },
- { "theaps.net", true },
- { "theartistjournal.ca", true },
- { "theasianshooter.com", true },
- { "theasianshooters.com", true },
- { "theastrocoach.com", true },
- { "theaterreichenhall.tk", true },
- { "theatre-schools.com", true },
- { "theaustinsevenworkshop.com", true },
- { "theaviationagency.com", true },
- { "thebabypassport.com", true },
- { "thebacteriafight.gq", true },
- { "thebakers.com.br", false },
- { "thebakery2go.de", true },
- { "thebannerstore.com", true },
- { "thebarrens.nu", true },
- { "thebarrypatch.com", true },
- { "thebasebk.org", true },
- { "thebasicstudio.com", true },
- { "thebcm.co.uk", true },
- { "thebeachessportsphysio.com", true },
- { "thebeardedrapscallion.com", true },
- { "thebeginningviolinist.com", true },
- { "thebestfun.co.uk", true },
- { "thebestlaos.ga", true },
- { "thebigbitch.nl", true },
- { "thebigdatacompany.com", true },
- { "thebiglaskowski.com", true },
- { "thebigslow.com", true },
- { "thebigwave.de", true },
- { "thebikeinsurer.co.uk", true },
- { "thebimhub.com", true },
- { "thebinarys.com", true },
- { "thebirchwoods.com", true },
- { "thebirthdaysite.co.uk", true },
- { "thebit.link", true },
- { "theblacklock.com", true },
- { "theblondeabroad.com", true },
- { "theblueroofcottage.ca", true },
- { "theboatmancapital.com", true },
- { "theboats.agency", true },
- { "theboats.club", true },
- { "theboats.com", true },
- { "theboats.de", true },
- { "theboats.online", true },
- { "theboats.pro", true },
- { "theboats.site", true },
- { "thebodyprinciple.com", true },
- { "thebonerking.com", true },
- { "theboulders.com", true },
- { "thebouncedepartment.co.uk", true },
- { "theboxofcarlos.com", true },
- { "thebreakroom.org", true },
- { "thebridalcollection.com", true },
- { "thebrightons.co.uk", true },
- { "thebrightons.uk", true },
- { "thebulletin.io", true },
- { "thebusinessofgoodfilm.com", true },
- { "thebuttongame.io", true },
- { "thecamels.org", true },
- { "thecameradivision.com", true },
- { "thecandidforum.com", true },
- { "thecarolingconnection.com", true },
- { "thecarpenters.tk", true },
- { "thecavalries.com", true },
- { "thechargertimes.com", true },
- { "thechavs.xyz", true },
- { "thecherryship.ch", false },
- { "theciso.com", false },
- { "theclonker.de", true },
- { "thecloudshelter.com", true },
- { "thecoffeecamp.com", true },
- { "thecompany.pl", true },
- { "thecondobuyers.com", true },
- { "theconverter.net", true },
- { "thecr3ative.com", true },
- { "thecr3ative.tk", true },
- { "thecraftingstrider.net", true },
- { "thecrazytravel.com", true },
- { "thecrescentchildcarecenter.com", true },
- { "thecrew-exchange.com", true },
- { "thecskr.in", true },
- { "thecuriousdev.com", true },
- { "thecurvyfashionista.com", true },
- { "thecustomdroid.com", true },
- { "theda.co.za", true },
- { "thedailyshirts.com", true },
- { "thedark1337.com", true },
- { "thedarkfusion.tk", true },
- { "thederminstitute.com", true },
- { "thedermreport.com", true },
- { "thedhs.com", true },
- { "thediamondcenter.com", true },
- { "thediaryofadam.com", true },
- { "thedinnerdetective.com", true },
- { "thediscovine.com", true },
- { "thedocumentrefinery.com", true },
- { "thedom.site", true },
- { "thedronechart.com", true },
- { "thedroneely.com", true },
- { "thedword.xyz", true },
- { "theedisoncapital.com", true },
- { "theeducationchannel.info", true },
- { "theeducationdirectory.org", true },
- { "theeffingyogablog.com", true },
- { "theeighthbit.com", false },
- { "theel0ja.info", true },
- { "theel0ja.ovh", true },
- { "theemasphere.com", true },
- { "theentertainmentcontractor.com", true },
- { "theepiclounge.com", true },
- { "theepicsponge.co.uk", true },
- { "theeverycompany.com", true },
- { "theeyeopener.com", true },
- { "thefairieswantmedead.com", true },
- { "thefamilygarrison.com", true },
- { "thefanimatrix.net", true },
- { "thefasterweb.com", true },
- { "thefengshuioffice.com", true },
- { "theferrarista.com", false },
- { "thefestivals.uk", true },
- { "thefizz.uk", true },
- { "theflowerbasketonline.com", true },
- { "theflowershopdeddington.com", true },
- { "theflyingbear.net", false },
- { "thefnafarchive.org", true },
- { "thefoodellers.com", true },
- { "thefootinstitutela.com", true },
- { "theforkedspoon.com", true },
- { "thefranknews.com", true },
- { "thefreebay.tk", true },
- { "thefreemail.com", true },
- { "thefriedzombie.com", true },
- { "thefriedzombie.nl", true },
- { "thefriedzombie.online", true },
- { "thefrk.pw", true },
- { "thefuckingtide.com", true },
- { "thefuelcardpeople.co.uk", true },
- { "thefunfirm.co.uk", true },
- { "thefurnitureco.uk", true },
- { "thefurniturefamily.com", true },
- { "thefusion.net.in", true },
- { "thegarage961.co.nz", true },
- { "thegarrowcompany.com", true },
- { "thegatheringocala.com", true },
- { "thegaucompany.healthcare", true },
- { "thegeekdiary.com", true },
- { "thegerwingroup.com", true },
- { "theghostlytavern.com", true },
- { "thegioidulich.com.vn", true },
- { "thegioinano.com", true },
- { "thegrape.ro", true },
- { "thegreatcommissionpodcast.com", true },
- { "thegreatpakistan.com", true },
- { "thegreatplains.com", true },
- { "thegreenpark.co.uk", true },
- { "thegroovecartel.com", true },
- { "theguitarcompany.nl", true },
- { "thegvoffice.net", true },
- { "thehackerblog.com", true },
- { "thehairrepublic.net", true },
- { "thehairstandard.com", true },
- { "thehamiltoncoblog.com", true },
- { "thehardylawfirm.com", true },
- { "thehaxbys.co.uk", true },
- { "theheatingoilclub.co.uk", true },
- { "thehobincompany.com", true },
- { "thehomeicreate.com", true },
- { "thehonorguard.org", true },
- { "thehookup.be", true },
- { "thehopefuture.com", true },
- { "thehub.ai", true },
- { "thehullbeekeeper.co.uk", true },
- { "theidiotboard.com", true },
- { "theig.co", true },
- { "theilluminatisociety.org", true },
- { "theillustrationstudio.com.au", true },
- { "theimaginationagency.com", true },
- { "theinboxpros.com", true },
- { "theindiantrip.com", true },
- { "theinflatables-ni.co.uk", true },
- { "theinflatablesne.co.uk", true },
- { "theinitium.com", false },
- { "theinnerprism.com", true },
- { "theintercept.com", true },
- { "theinternationalgeekconspiracy.eu", true },
- { "theissen.io", true },
- { "theitsage.com", false },
- { "thejimmyw.uk", true },
- { "thejoneshub.com", true },
- { "thekev.in", true },
- { "thekeytobusiness.co.uk", true },
- { "thekiddz.com", true },
- { "thekingofhate.com", false },
- { "theknockout.tk", true },
- { "thekodester.ca", true },
- { "thekonsulthub.tk", true },
- { "thekovnerfoundation.org", true },
- { "thelaimlife.com", true },
- { "thelakedistrict.tk", true },
- { "thelanscape.com", true },
- { "thelbc.io", false },
- { "theleap.co.uk", true },
- { "thelearningenterprise.co.uk", true },
- { "thelegionshirley.co.uk", true },
- { "thelencystore.com", true },
- { "thelevelman.com", true },
- { "thelicagency.com", true },
- { "thelifeofmala.com", true },
- { "thelinuxtree.net", true },
- { "thelittlecraft.com", true },
- { "thelittlejewel.com", true },
- { "thelocals.ru", true },
- { "thelonelyones.co.uk", true },
- { "thelonious.nl", true },
- { "thelounge.chat", true },
- { "themallards.info", true },
- { "themarshallproject.org", true },
- { "themaster.site", true },
- { "themasterplan.com.au", true },
- { "themathscentre.com", true },
- { "themecraft.studio", true },
- { "themefoxx.com", true },
- { "themenmedia.com", true },
- { "themenzentrisch.de", true },
- { "themerchandiser.net", false },
- { "themeridianway.com", true },
- { "themiddle.co", true },
- { "themigraineinstitute.com", true },
- { "themimitoof.fr", false },
- { "theminiacs.com", true },
- { "themist.cz", true },
- { "themoep.at", true },
- { "themoneyconverter.com", true },
- { "themonkeytrail.co.uk", true },
- { "themonthly.com.au", true },
- { "themostexpensiveworkofart.com", true },
- { "themusecollaborative.org", true },
- { "themusic.cloud", true },
- { "themusicinnoise.net", true },
- { "thenanfang.com", true },
- { "thenerdic.com", true },
- { "thenest.se", true },
- { "thenetw.org", true },
- { "thenexwork.com", true },
- { "thenib.com", true },
- { "thenine.info", true },
- { "theninehertz.com", true },
- { "theninenine.com", true },
- { "thenocman.com", true },
- { "thenovaclinic.com", true },
- { "thenowheremen.com", true },
- { "theo-andreou.org", true },
- { "theobora.fr", true },
- { "theobromos.fr", true },
- { "theocratic.cf", true },
- { "theodeboer.nl", true },
- { "theodorahome.co", true },
- { "theodorahome.com.br", true },
- { "theofleck.com", false },
- { "theolivetreerestaurants.com", true },
- { "theologyz.com", true },
- { "theonethaimassage.de", true },
- { "theoosmetalart.nl", true },
- { "theoptechnation.com", true },
- { "theoriginalbit.com", true },
- { "theoriginalmarkz.com", true },
- { "theorioncorrelation.com", true },
- { "theory-test-online.co.uk", true },
- { "theory.org", true },
- { "theoscure.eu", true },
- { "theoutline.com", true },
- { "theoutsiders.stream", true },
- { "thepartner.co.uk", true },
- { "thepartydoctors.co.uk", true },
- { "thepasteb.in", true },
- { "thepathsofdiscovery.com", true },
- { "thepaulagcompany.com", true },
- { "thepavilionbanbury.co.uk", true },
- { "thepaymentscompany.com", true },
- { "thepb.in", true },
- { "theperry.group", true },
- { "thepharm.co.nz", true },
- { "thephp.cc", true },
- { "thepieslicer.com", true },
- { "thepillclub.com", true },
- { "thepiratesociety.org", true },
- { "theplasticsurgerycenterofnashville.com", true },
- { "theplayspot.co.uk", true },
- { "theploughharborne.co.uk", true },
- { "thepoplarswines.com.au", true },
- { "thepriorybandbsyresham.co.uk", true },
- { "theproject.cf", true },
- { "theprojectx.tk", true },
- { "thepromisemusic.com", true },
- { "theptclist.tk", true },
- { "thepurplemaids.com", true },
- { "theralino.de", true },
- { "theramo.re", true },
- { "therandombits.com", false },
- { "therapiemi.ch", true },
- { "therapynotes.com", true },
- { "therapyportal.com", true },
- { "therapysxm.com", false },
- { "therealchamps.com", true },
- { "therealcost.gov", true },
- { "thereaper.net.au", true },
- { "theredsgazette.tk", true },
- { "theregoesbrian.com", true },
- { "thereisnocloud.fr", true },
- { "therepublicofliverpool.com", true },
- { "theresa-mayer.eu", true },
- { "therevenge.me", true },
- { "therhetorical.ml", false },
- { "thermalbad-therme.de", true },
- { "thermalflowtech.com", true },
- { "thermia.co.nz", true },
- { "thermia.com.au", true },
- { "thermique.ch", false },
- { "thermity.com", true },
- { "thermolamina.nl", true },
- { "thermorecetas.com", true },
- { "thermowood-bkh.ru", true },
- { "theroks.com", false },
- { "theroyalmarinescharity.org.uk", true },
- { "therudeworkout.com", true },
- { "therugswarehouse.co.uk", true },
- { "theruizes.com", true },
- { "theruleslawyer.net", true },
- { "therumfordcitizen.com", true },
- { "therworth.com", true },
- { "therworth.eu", true },
- { "therworth.net", true },
- { "therworth.org", true },
- { "thesalonthing.com", false },
- { "thesanta.biz", true },
- { "thesarogroup.com", true },
- { "thesassynut.com", true },
- { "thesaturdaypaper.com.au", true },
- { "thesaurus.net", true },
- { "theschool.jp", true },
- { "thescientists.nl", true },
- { "thesecondsposts.com", false },
- { "thesecurityvault.com", true },
- { "theseed.io", true },
- { "theseoframework.com", true },
- { "theseoplatform.co.uk", true },
- { "theseosystem.com", true },
- { "theserviceyouneed.com", true },
- { "thesession.org", false },
- { "thesetwohands864.com", true },
- { "theshaker.com.au", true },
- { "thesharedbrain.ch", false },
- { "thesharedbrain.com", false },
- { "theshine.pl", true },
- { "theshopally.com", false },
- { "theshots.cz", true },
- { "thesignalco.com.au", true },
- { "thesisgeek.com", true },
- { "thesishelp.net", true },
- { "theskingym.co.uk", true },
- { "thesled.net", true },
- { "thesmallbusinesswebsiteguy.com", true },
- { "thesmokingcuban.com", true },
- { "thesnellvilledentist.com", false },
- { "thesoundstageatstrangeland.com", true },
- { "thesplashlab.com", true },
- { "thesslonline.com", true },
- { "thesslstore.com", true },
- { "thestatementjewelry.com", true },
- { "thestationatwillowgrove.com", true },
- { "thesteamrooms.com", true },
- { "thesteins.org", false },
- { "thestockoasis.com", true },
- { "thestoneage.de", true },
- { "thestory.ie", true },
- { "thestrategyagency.com.au", true },
- { "thestreamable.com", true },
- { "thestylebouquet.com", true },
- { "thesuppercircle.com", true },
- { "theswimdoctors.com", true },
- { "theswissbay.ch", true },
- { "theta.eu.org", true },
- { "thetassos.com", true },
- { "thetechbasket.com", true },
- { "thethoughttrainer.com", true },
- { "thethreadofhope.org", true },
- { "thethreepercent.marketing", true },
- { "thetiedyelab.com", true },
- { "thetinylife.com", true },
- { "thetipo01.tk", true },
- { "thetomharling.com", true },
- { "thetopmovie.gq", true },
- { "thetotalemaildelivery.com", true },
- { "thetradinghall.com", false },
- { "thetree.ro", true },
- { "thetrendspotter.net", true },
- { "thetuco.fr", true },
- { "thetuxkeeper.de", false },
- { "thetvtraveler.com", true },
- { "thetwistedrabbit.com", true },
- { "theundefeated.com", true },
- { "thevacweb.com", true },
- { "thevalentineconstitution.com", true },
- { "thevalueofarchitecture.com", true },
- { "thevanishedvoyager.ml", true },
- { "thevenueofhollywood.com", true },
- { "thevenuevr.com", true },
- { "theverybusyoffice.co.uk", true },
- { "thevgg.com", false },
- { "thevirtualbookkeepers.com", true },
- { "thevoya.ga", false },
- { "thevyra.com", true },
- { "thewagesroom.co.uk", true },
- { "thewayofthedojo.com", true },
- { "thewebflash.com", true },
- { "thewebsitedoctors.co.uk", true },
- { "thewebsitemarketingagency.com", true },
- { "thewhitehat.club", true },
- { "thewhitneypaige.com", true },
- { "thewinstonatlyndhurst.com", true },
- { "thewizardsmanse.com", true },
- { "thewoodkid.com.au", true },
- { "thewoosh.me", true },
- { "theworkingeye.nl", true },
- { "theworldbattle.com", true },
- { "theworldexchange.com", true },
- { "theworldexchange.net", true },
- { "theworldexchange.org", true },
- { "theworldsend.eu", true },
- { "thexfactorgames.com", true },
- { "thexme.de", true },
- { "theyakshack.co.uk", true },
- { "theycallmefox.net", true },
- { "theyear199x.org", true },
- { "theyearinpictures.co.uk", true },
- { "theyosh.nl", true },
- { "thezero.org", true },
- { "thezillersathenshotel.com", true },
- { "thiagohersan.com", true },
- { "thienteakee.com", true },
- { "thiepcuoidep.com", true },
- { "thiepxinh.net", true },
- { "thierry-daellenbach.com", false },
- { "thierrybasset.ch", false },
- { "thierrymazue.fr", true },
- { "thietbithoathiem.net", true },
- { "thijmenmathijs.nl", true },
- { "thijs.amsterdam", true },
- { "thijsbekke.nl", true },
- { "thijsenarjan.nl", true },
- { "thijsslop.nl", true },
- { "thijsvanderveen.net", true },
- { "thilobuchholz.de", true },
- { "thimbros.tk", true },
- { "thincats.com", true },
- { "thinegen.de", true },
- { "thing.vn", false },
- { "thing4everyone.com", true },
- { "thingies.site", true },
- { "thingsandcode.com", true },
- { "thingsimplied.com", false },
- { "thingswithstuff.llc", true },
- { "think-asia.org", true },
- { "think-pink.info", true },
- { "think-positive-watches.de", true },
- { "thinkheaddesign.com", true },
- { "thinkindifferent.net", true },
- { "thinkingandcomputing.com", true },
- { "thinkingliberty.com", true },
- { "thinkingplanet.net", true },
- { "thinkmarketing.ca", true },
- { "thinkquality.nl", true },
- { "thinkrealty.com", true },
- { "thinktac.com", true },
- { "thinktux.net", true },
- { "thirdbearsolutions.com", true },
- { "thirdgenphoto.co.uk", true },
- { "thirtysixseventy.ml", true },
- { "thiry-automobiles.net", false },
- { "thisbrownman.com", true },
- { "thiscloudiscrap.com", false },
- { "thiscode.works", true },
- { "thisdot.site", true },
- { "thisfreelife.gov", true },
- { "thisishugo.com", true },
- { "thisislaikipia.co.ke", true },
- { "thisistechtoday.com", true },
- { "thisistheserver.com", true },
- { "thismatter.com", true },
- { "thisoldearth.com", true },
- { "thisphone.us", true },
- { "thistleandleaves.com", true },
- { "thitruongsi.com", true },
- { "thmail.ml", true },
- { "thmpartners.com", true },
- { "thoe.xyz", true },
- { "thoitrangsikimanh.com", true },
- { "tholcomb.com", true },
- { "thole.org", true },
- { "thom4s.info", true },
- { "thomalaudan.de", true },
- { "thomas-fahle.de", true },
- { "thomas-sammut.com", true },
- { "thomas-schmittner.de", true },
- { "thomas-steel.com", true },
- { "thomas-suchon.fr", false },
- { "thomas.computer", true },
- { "thomas.love", false },
- { "thomasbeckers.be", true },
- { "thomasbreads.com", false },
- { "thomascauquil.fr", true },
- { "thomasduerlund.com", true },
- { "thomasduerlund.dk", true },
- { "thomasebenrett.de", true },
- { "thomasecookedds.com", true },
- { "thomasetsophie.fr", true },
- { "thomaseyck.com", true },
- { "thomasfoster.co", true },
- { "thomashunter.name", false },
- { "thomasmcfly.com", true },
- { "thomasmerritt.de", true },
- { "thomaspluschris.com", true },
- { "thomassen.sh", true },
- { "thomastestor.tk", true },
- { "thomastimepieces.com.au", true },
- { "thomasverhelst.be", true },
- { "thomasvochten.com", true },
- { "thomien.de", true },
- { "thompsonfamily.cloud", true },
- { "thomsons.com", true },
- { "thomsonscleaning.co.uk", true },
- { "thomspooren.nl", true },
- { "thomwiggers.nl", true },
- { "thooka.com", true },
- { "thor.edu", true },
- { "thor.re", true },
- { "thornton-le-moors-ince-elton.org.uk", true },
- { "thoroughbreddiesel.com", true },
- { "thorsten-schaefer.com", false },
- { "thorstenschaefer.name", true },
- { "thosci.com", true },
- { "thotpublicidad.com", true },
- { "thouni.de", true },
- { "thouqi.com", true },
- { "thousandoakselectrical.com", true },
- { "thousandoaksexteriorlighting.com", true },
- { "thousandoakslandscapelighting.com", true },
- { "thousandoakslighting.com", true },
- { "thousandoaksoutdoorlighting.com", true },
- { "thoxyn.com", true },
- { "thpay.com", true },
- { "threatcon.io", true },
- { "threatmarket.com", true },
- { "threatmonitor.io", true },
- { "threatnix.io", true },
- { "threatworking.com", true },
- { "threedpro.me", true },
- { "threefours.net", false },
- { "threelions.ch", true },
- { "threema.ch", true },
- { "threexxx.ch", true },
- { "threit.de", true },
- { "threv.net", true },
- { "thriftdiving.com", true },
- { "thrillernyc.com", true },
- { "thriveafterabuse.com", true },
- { "thriveta.com", true },
- { "thriveweb.com.au", true },
- { "thrivewellnesshub.co.za", true },
- { "throttlerz.in", true },
- { "throughtheglass.photo", true },
- { "throwaway.link", true },
- { "throwpass.com", true },
- { "thrush.com", true },
- { "thscpac.org", true },
- { "thsecurity.cz", true },
- { "thues.eu", true },
- { "thuisverpleging-meerdael.be", true },
- { "thullbery.com", true },
- { "thummer.net", true },
- { "thunderkeys.net", true },
- { "thundr.eu", true },
- { "thunraz.com", true },
- { "thuongtravel.com", true },
- { "thurn.net", true },
- { "thusoy.com", true },
- { "thuthuatios.com", true },
- { "thutucxuatnhapkhau.net", true },
- { "thuviensoft.com", true },
- { "thuybich.com", true },
- { "thw-bernburg.de", true },
- { "thwiki.cc", true },
- { "thxandbye.de", true },
- { "thycotic.ru", true },
- { "thyngster.com", true },
- { "thynx.io", true },
- { "thyrex.fr", true },
- { "ti-pla.net", true },
- { "ti-planet.org", true },
- { "tiagonunes.pt", true },
- { "tiagosimao.com", true },
- { "tiaki.org", true },
- { "tiamarcia.com.br", true },
- { "tian123.com", true },
- { "tian888.com", true },
- { "tianeptine.com", true },
- { "tianshili.me", true },
- { "tib1.com", true },
- { "tibicinagarricola.com", true },
- { "tibipg.com", true },
- { "ticfleet.com", true },
- { "ticketcity.com", true },
- { "ticketdriver.com", true },
- { "ticketpro.ca", false },
- { "ticketpro.com.my", true },
- { "ticketrunway.com", true },
- { "ticketslover.com", true },
- { "ticketsmate.com", true },
- { "ticketsource.co.uk", true },
- { "ticketsource.eu", true },
- { "ticketsource.io", true },
- { "ticketsource.us", true },
- { "ticketsourcebeta.co.uk", true },
- { "ticketsvergleichen.de", true },
- { "tickettailor.com", true },
- { "tickit.ca", false },
- { "tid.jp", true },
- { "tidy.chat", true },
- { "tidych.at", true },
- { "tiekoetter.com", true },
- { "tiendadecosplay.es", true },
- { "tiendadolca.com", true },
- { "tiendafetichista.com", true },
- { "tiendasmart.com.co", true },
- { "tiener-herentals.be", true },
- { "tiens-ib.cz", true },
- { "tierarzt-karlsruhe-durlach.de", true },
- { "tierarztpraxis-bogenhausen.de", true },
- { "tierarztpraxis-illerwinkel.de", true },
- { "tierarztpraxis-weinert.de", true },
- { "tiergear.com.au", true },
- { "tieronegraphics.com", true },
- { "tierradeayala.com", true },
- { "tierraprohibida.net", true },
- { "ties.com", true },
- { "tiew.pl", true },
- { "tifan.net", true },
- { "tifaware.com", true },
- { "tiffanywatson.xyz", true },
- { "tiffnix.com", true },
- { "tiger21.com", true },
- { "tigerchef.com", true },
- { "tigerdile.com", true },
- { "tigernode.com", true },
- { "tigernode.net", true },
- { "tigerscu.org", true },
- { "tiggeriffic.com", true },
- { "tightassporntube.com", true },
- { "tiglitub.com", true },
- { "tiihosen.fi", true },
- { "tiim.technology", true },
- { "tijden.nu", true },
- { "tik.edu.ee", true },
- { "tiki-god.co.uk", true },
- { "tilde.institute", true },
- { "tilde.link", true },
- { "tildes.net", true },
- { "tildesnyder.com", true },
- { "tilesbay.com", true },
- { "tilikum.io", true },
- { "till.im", true },
- { "tillberg.us", true },
- { "tilleysbouncycastles.co.uk", true },
- { "tillseasyscore.com", true },
- { "tilman.ninja", true },
- { "tilosp.de", true },
- { "tilta.com", true },
- { "tiltedwindmillcrafts.com", true },
- { "tim-demisch.de", true },
- { "timacdonald.me", true },
- { "timawesomeness.com", true },
- { "timbarlotta.com", true },
- { "timberkel.com", true },
- { "timbers.space", true },
- { "timbishopartist.com", true },
- { "timbrado.com", true },
- { "timbrust.de", true },
- { "timchanhxe.com", true },
- { "timco.cloud", true },
- { "timdeneau.com", true },
- { "timdoug.com", true },
- { "time.gov", true },
- { "time.sh", true },
- { "time2060.ru", true },
- { "time22.com", true },
- { "time2choose.com", true },
- { "timeai.io", true },
- { "timeatlas.com", true },
- { "timebutler.de", true },
- { "timeclub24.ru", true },
- { "timeforcoffe.eu", true },
- { "timeglass.de", true },
- { "timeless-photostudio.com", true },
- { "timeless-spirit.com", true },
- { "timelessskincare.co.uk", true },
- { "timelimit.io", true },
- { "timelockstash.com", true },
- { "timelyapp.com", true },
- { "timeserver3.de", true },
- { "timetastic.co.uk", true },
- { "timetech.io", true },
- { "timetotrade.com", true },
- { "timetrade.com", true },
- { "timewasters.nl", true },
- { "timeworld.su", true },
- { "timi-matik.hu", true },
- { "timich.ga", true },
- { "timing.com.br", true },
- { "timjk.de", false },
- { "timmersgems.com", true },
- { "timmi6790.de", true },
- { "timmyrs.de", true },
- { "timnash.co.uk", true },
- { "timonengelke.de", true },
- { "timoso.de", true },
- { "timothy.tk", true },
- { "timowi.de", true },
- { "timoxbrow.com", true },
- { "timroes.de", true },
- { "timsayedmd.com", true },
- { "timtaubert.de", true },
- { "timtelfer.com", true },
- { "timtj.ca", true },
- { "timvandekamp.nl", true },
- { "timvivian.ca", true },
- { "timweb.ca", true },
- { "timx.uk", true },
- { "timysewyn.be", true },
- { "tina-zander.de", true },
- { "tina.media", true },
- { "tinapoethe.com", true },
- { "tinastahlschmidt.de", true },
- { "tindallriley.co.uk", true },
- { "tinekevanurk.nl", true },
- { "tinfoilsecurity.com", false },
- { "tinfoleak.com", true },
- { "tinhbotnghegold.com", true },
- { "tinhchattrangda.vn", true },
- { "tinkerboard.org", true },
- { "tinkerers-trunk.co.za", true },
- { "tinkertry.com", true },
- { "tinlc.org", true },
- { "tinminnow.me", true },
- { "tinnhanhvietnam.tk", true },
- { "tinte24.de", true },
- { "tintencenter.com", true },
- { "tintenfix.net", true },
- { "tintenfux.de", true },
- { "tintenland.de", true },
- { "tintenprofi.de", true },
- { "tintoria.roma.it", true },
- { "tiny.ee", true },
- { "tinycrm.pl", true },
- { "tinyhousefinance.com.au", true },
- { "tinylan.com", true },
- { "tinyppt.com", true },
- { "tinyspeck.com", true },
- { "tinyssh.com", true },
- { "tinyssh.org", true },
- { "tinytownsoftplay.co.uk", true },
- { "tio.run", true },
- { "tipaki.gr", true },
- { "tipe.io", true },
- { "tiplanet.org", true },
- { "tipoftheday.tips", true },
- { "tippytoad.com", true },
- { "tipranks.com", true },
- { "tips4india.tk", true },
- { "tipsacademicos.com", true },
- { "tipsdebellezaysalud.com", true },
- { "tipsmake.com", true },
- { "tipsport.cz", true },
- { "tipstersweb.com", true },
- { "tipulnagish.co.il", true },
- { "tir-mauperthuis.fr", true },
- { "tircentrale.net", true },
- { "tirionnetwork.de", true },
- { "tirlins.com", true },
- { "tiroler-kupferschmiede.com", true },
- { "tirs4ne.ch", false },
- { "tirteafuera.tk", true },
- { "tis.ph", true },
- { "tischlerei-klettke.de", true },
- { "tisgroup.com.my", true },
- { "tishopsv.com", true },
- { "tissot-mayenfisch.com", false },
- { "tissus-paris.com", true },
- { "tisvapo.it", true },
- { "tit-cdn.de", true },
- { "tit-dev.de", true },
- { "tit-dns.de", true },
- { "tit-mail.de", true },
- { "tit.systems", true },
- { "titanandco.com", true },
- { "titandirect.co.uk", true },
- { "titanplumbingservices.com.au", true },
- { "titansized.com", true },
- { "titantax.com", true },
- { "titanwaterproofing.com.au", true },
- { "titelseite.ch", true },
- { "titouan.co", false },
- { "titser.ph", true },
- { "tittelbach.at", true },
- { "titusetcompagnies.net", false },
- { "tiwag.at", true },
- { "tixeconsulting.com", true },
- { "tixel.com", true },
- { "tixify.com", true },
- { "tixio.de", true },
- { "tjampoer.com", true },
- { "tjcuk.co.uk", true },
- { "tjl.rocks", true },
- { "tjp.ch", false },
- { "tjxxzy.com", true },
- { "tk-its.net", true },
- { "tk2net.com", true },
- { "tkacz.pro", true },
- { "tkanemoto.com", true },
- { "tkat.ch", true },
- { "tkbuilders.net", true },
- { "tkcafe.net", true },
- { "tkgpm.com", true },
- { "tkirch.de", true },
- { "tkjg.fi", true },
- { "tkn.me", true },
- { "tkusano.jp", true },
- { "tkw01536.de", false },
- { "tl.gg", true },
- { "tlca.org", true },
- { "tlcnet.info", true },
- { "tld-list.com", true },
- { "tldtattoo.com", true },
- { "tlehseasyads.com", true },
- { "tleng.de", true },
- { "tlo.xyz", true },
- { "tloxygen.com", true },
- { "tls-proxy.de", true },
- { "tls.blue", true },
- { "tls.care", true },
- { "tlthings.net", true },
- { "tlumaczenie.com", true },
- { "tlyphed.net", true },
- { "tlys.de", false },
- { "tm-t.ca", true },
- { "tm80plus.com", true },
- { "tmachinery.cz", true },
- { "tmadev.com.au", true },
- { "tmakiguchi.org", true },
- { "tmas.dk", true },
- { "tmberg.cf", true },
- { "tmberg.ga", true },
- { "tmberg.gq", true },
- { "tmberg.ml", true },
- { "tmberg.tk", true },
- { "tmcjobs.com", true },
- { "tmcreationweb.com", true },
- { "tmdb.biz", true },
- { "tmf.ru", true },
- { "tmheatingcooling.com", true },
- { "tmi-products.eu", true },
- { "tmi-produkter.se", true },
- { "tmm.cx", true },
- { "tmpraider.net", true },
- { "tmpsantos.com.br", true },
- { "tmsdiesel.com", true },
- { "tmtopup.com", true },
- { "tn0.club", true },
- { "tncentro.com", true },
- { "tndentalwellness.com", true },
- { "tnes.dk", true },
- { "tniad.mil.id", false },
- { "tnl.cloud", true },
- { "tnonline.net", true },
- { "tntmobi.com", true },
- { "tntware.com", true },
- { "to-riktari.gr", true },
- { "toad.ga", true },
- { "toast.al", false },
- { "tobaccolocker.com", true },
- { "tobbro-trans.de", true },
- { "tobefree.eu", true },
- { "tober-cpag.de", true },
- { "tobevictorious.com", true },
- { "tobi-mayer.de", true },
- { "tobi-server.goip.de", true },
- { "tobiaalberti.com", true },
- { "tobias-bauer.de", true },
- { "tobias-haenel.de", true },
- { "tobias-kleinmann.de", true },
- { "tobias-kluge.de", true },
- { "tobias.gr", true },
- { "tobiasbrunner.net", true },
- { "tobiasconradi.com", true },
- { "tobiasfischer.info", true },
- { "tobiashorvath.com", true },
- { "tobiashorvath.de", true },
- { "tobiaskorf.de", true },
- { "tobiaspahlings.de", true },
- { "tobiassachs.de", true },
- { "tobiassattler.com", true },
- { "tobiaswiese.com", true },
- { "tobiaswiese.eu", true },
- { "tobiaswiese.net", true },
- { "tobiaswiese.org", true },
- { "tobiemilford.com", true },
- { "tobimi.com", true },
- { "tobis-rundfluege.de", true },
- { "tobis.cloud", true },
- { "tobischo.de", true },
- { "tobisworld.ch", true },
- { "tobyalden.com", true },
- { "tobyx.com", true },
- { "tobyx.de", true },
- { "tobyx.eu", true },
- { "tobyx.is", true },
- { "tobyx.net", true },
- { "tobyx.org", true },
- { "tocaro.im", true },
- { "toccoig.com", true },
- { "tochi-urikata.net", true },
- { "todacarreira.com", true },
- { "todamateria.com.br", true },
- { "todapolitica.com", true },
- { "todasaslojas.com.br", true },
- { "todaslascafeteras.com", true },
- { "todaymeow.com", true },
- { "todaysbestinsurance.com", true },
- { "todayupdates.ga", true },
- { "toddcullumresearch.com", true },
- { "toddexler.com", true },
- { "toddfry.com", true },
- { "toddlerleaf.com", true },
- { "toddmath.com", true },
- { "todo-anime.com", true },
- { "todoereaders.com", true },
- { "todoescine.com", true },
- { "todon.fr", true },
- { "todoporjesus.net", true },
- { "todoscheduler.de", true },
- { "todoscheduler.org", true },
- { "todoscomciro.com", true },
- { "toeightycountries.com", true },
- { "toekomstperspectief.be", true },
- { "toerschaatsenknsb.nl", true },
- { "toerschaatsenoverijssel.nl", true },
- { "toest.bg", true },
- { "tofe.io", true },
- { "tofliving.nl", true },
- { "togech.jp", true },
- { "togetter.com", true },
- { "togtider.dk", true },
- { "toheb.de", false },
- { "tohochofu-sportspark.com", true },
- { "tohofc.co.jp", true },
- { "tohokinemakan.tk", true },
- { "tohokufd.com", true },
- { "toihoctiengtrung.com", true },
- { "toiletable.com", true },
- { "tojannah.com", false },
- { "tokaido-kun.jp", true },
- { "tokaido.com", true },
- { "tokainafb.net", true },
- { "tokainakurasi.net", true },
- { "tokenmarket.net", true },
- { "tokens.net", true },
- { "tokic.hr", true },
- { "tokinoha.net", true },
- { "tokio.fi", true },
- { "tokitover.com", true },
- { "tokka.com", true },
- { "tokke.dk", true },
- { "tokkee.org", true },
- { "tokky.be", true },
- { "tokky.eu", true },
- { "tokky.fr", true },
- { "tokototech.com", true },
- { "tokugai.com", true },
- { "tokyo-onkyo.jp", true },
- { "tokyo-powerstation.com", true },
- { "tokyo.dating", true },
- { "tokyoadultguide.com", true },
- { "tokyobarbershop.com", true },
- { "tokyomakino.com", true },
- { "tokyovipper.com", true },
- { "tolboe.com", true },
- { "toldositajuba.com", true },
- { "tolerance-zero.tk", true },
- { "toleressea.fr", true },
- { "toles-sur-mesure.fr", true },
- { "tolle-wolke.de", true },
- { "tollerunterricht.com", true },
- { "tolmaidis.com", true },
- { "tolnavar.hu", true },
- { "tom-geiger.de", true },
- { "tom-kunze.de", true },
- { "tom-kurka.cz", true },
- { "tom.horse", true },
- { "tom.je", true },
- { "tom.ro", true },
- { "tom94.net", true },
- { "tomabrafix.de", true },
- { "tomahawk.ca", true },
- { "tomandmara.com", true },
- { "tomandsonya.com", true },
- { "tomandsonya.net", true },
- { "tomandsonya.org", true },
- { "tomasjacik.cz", true },
- { "tomaskavalek.cz", false },
- { "tomasmoberg.org", true },
- { "tomaspatera.cz", true },
- { "tomasvecera.cz", true },
- { "tomasz.com", true },
- { "tomaszdwornicki.net", true },
- { "tomatenaufdenaugen.de", true },
- { "tomatis-nantes.com", true },
- { "tomaz.eu", true },
- { "tombaker.me", true },
- { "tomberek.info", true },
- { "tomboy.org", true },
- { "tombrossman.com", true },
- { "tombu.biz", true },
- { "tombu.info", true },
- { "tombu.org", true },
- { "tombu.xyz", true },
- { "tomd.ai", true },
- { "tomend.es", true },
- { "tomershemesh.me", true },
- { "tomgaechter.ch", true },
- { "tomharling.uk", true },
- { "tomi.cc", true },
- { "tomica.me", false },
- { "tomik.fun", true },
- { "tomjepp.uk", true },
- { "tomjn.com", true },
- { "tomkempers.nl", true },
- { "tomkunze.de", true },
- { "tomlowenthal.com", true },
- { "tomm.yt", true },
- { "tommic.eu", true },
- { "tommihynynen.com", true },
- { "tommy-bordas.fr", false },
- { "tommyemo.com", true },
- { "tommyemo.net", true },
- { "tommymoya.tv", true },
- { "tomnatt.com", true },
- { "tomo.gr", false },
- { "tomoradexpert.ro", true },
- { "tomorrowmuseum.com", true },
- { "tomosm.net", true },
- { "tomravinmd.com", true },
- { "tomrei.com", true },
- { "tomrichards.net", true },
- { "tomschlick.com", true },
- { "tomsherakmshope.org", true },
- { "tomspdblog.com", true },
- { "tomssl.com", true },
- { "tomstew.art", true },
- { "tomthorogood.co.uk", true },
- { "tomthorogood.uk", true },
- { "tomticket.com", true },
- { "tomudding.nl", true },
- { "tomvanlaer.be", true },
- { "tomvote.com", true },
- { "tomwassenberg.com", true },
- { "tomwassenberg.nl", true },
- { "tomwellington.design", true },
- { "tomwilson.io", true },
- { "tonabor.ru", true },
- { "tonage.de", true },
- { "tonarinoliusan.com", true },
- { "toncusters.nl", true },
- { "tondles.com", true },
- { "tonegidoarchief.nl", true },
- { "toner24.at", true },
- { "toner24.co.uk", true },
- { "toner24.es", true },
- { "toner24.fr", true },
- { "toner24.it", true },
- { "toner24.nl", true },
- { "toner24.pl", true },
- { "tonerdepot.de", true },
- { "tonerjet.at", true },
- { "tonerklick.de", true },
- { "tonerkurier.de", true },
- { "tonermaus.de", true },
- { "tonermonster.de", true },
- { "tonex.de", true },
- { "tongli.eu.org", true },
- { "tonight.de", true },
- { "tonkayagran.com", true },
- { "tonkayagran.ru", true },
- { "tonkinwilsonvillenissanparts.com", true },
- { "tonnie.nl", true },
- { "tonnycat.com", true },
- { "tonnygaric.com", true },
- { "tono.us", true },
- { "tonorosario.tk", true },
- { "tonsit.com", true },
- { "tonsit.org", true },
- { "tontonnews.net", true },
- { "tonyarcieri.com", true },
- { "tonymanning.com", true },
- { "tonytan.io", true },
- { "tonytron.com.br", true },
- { "tonyw.xyz", true },
- { "tonywebster.com", true },
- { "too.gy", true },
- { "toobug.net", true },
- { "tool.lu", true },
- { "toolbox-bodensee.de", true },
- { "toolbox.ninja", false },
- { "toolineo.de", true },
- { "toolnerds.com", true },
- { "toolroomrecords.com", true },
- { "tools.pro", true },
- { "toolsense.io", true },
- { "toolshero.com", true },
- { "toolspain.tk", true },
- { "toom.io", true },
- { "toomy.ddns.net", true },
- { "toomy.pri.ee", true },
- { "toon.style", true },
- { "toonpool.com", true },
- { "toontownrewritten.com", true },
- { "toool.nl", true },
- { "toool.nyc", true },
- { "toool.org", true },
- { "toopopular.ga", true },
- { "toorl.com", true },
- { "toot.center", true },
- { "toothdoc.ca", true },
- { "toothpique.tk", true },
- { "tooti.biz", true },
- { "top-mining.tk", true },
- { "top-obaly.cz", true },
- { "top-opakowania.pl", true },
- { "top-russian.tk", true },
- { "top-zdrave.bg", true },
- { "top10media.tk", true },
- { "top2servers.tv", true },
- { "top4shop.de", true },
- { "top5hosting.co.uk", true },
- { "top6casinos.com", true },
- { "top9.fr", true },
- { "topappandroid.com", true },
- { "toparkinfo.hu", true },
- { "topaxi.ch", true },
- { "topaxi.codes", true },
- { "topbestsellerproduct.com", true },
- { "topbigdeals.com", true },
- { "topcanadianescorts.com", true },
- { "topcarehvac.ca", true },
- { "topciderska-crkva.rs", true },
- { "topclassfun.ie", true },
- { "topdesk.net", true },
- { "topdogsinflatables.co.uk", true },
- { "topeducationhelp.co", true },
- { "topekafoundationpros.com", true },
- { "topeng-emas.com", true },
- { "topfivepercent.co.uk", true },
- { "topgshop.ru", true },
- { "tophat.studio", true },
- { "tophr.kz", true },
- { "topicdesk.com", true },
- { "topicit.net", true },
- { "topirishcasinos.com", true },
- { "topjobs.ch", true },
- { "topknot.gq", true },
- { "topkorea.ml", true },
- { "toplist.cz", true },
- { "toplist.eu", true },
- { "toplist.sk", true },
- { "topmmogames.org", true },
- { "topnotepad.com", true },
- { "topodin.com", true },
- { "toponlinecasinosites.co.uk", true },
- { "toppercan.es", true },
- { "topprice.ua", true },
- { "topproductidea.com", true },
- { "topproductsanalysis.com", true },
- { "topreit.ru", true },
- { "toprelatos.com", true },
- { "topservercccam.tv", true },
- { "topshelf.tech", true },
- { "topshelfcommercial.com", true },
- { "topspin.tk", true },
- { "topsteaks-daun.de", true },
- { "toptec.net.br", true },
- { "toptexture.com", true },
- { "toptheto.com", true },
- { "toptranslation.com", true },
- { "topvision.se", true },
- { "topwindowcleaners.co.uk", true },
- { "topwoodltd.co.uk", true },
- { "topyachts.com.ua", true },
- { "toracon.org", true },
- { "torchantifa.org", true },
- { "toreni.us", true },
- { "toretame.jp", true },
- { "torfbahn.de", true },
- { "torlock.com", true },
- { "torlock.host", true },
- { "torlock.icu", true },
- { "torlock.pw", true },
- { "torlock2.com", true },
- { "tormakristof.eu", true },
- { "tormentedradio.com", false },
- { "tormox.ml", true },
- { "torn1.se", true },
- { "torneobottacin.it", true },
- { "torngalaxy.com", true },
- { "torogroups.com", true },
- { "torontoaccesscontrol.com", true },
- { "torontocorporatelimo.services", true },
- { "torontostarts.com", true },
- { "toros.co", true },
- { "toros2.com", true },
- { "torproject.org", false },
- { "torprojects.com", true },
- { "torrance.gq", true },
- { "torreconta.pt", true },
- { "torrent.fedoraproject.org", true },
- { "torrent.is", true },
- { "torrent.tm", true },
- { "torrentfunk.com", true },
- { "torrentfunk.host", true },
- { "torrentfunk.icu", true },
- { "torrentfunk.pw", true },
- { "torrentfunk2.com", true },
- { "torrentgalaxy.to", true },
- { "torrenttop100.net", true },
- { "torrentz2.eu", true },
- { "torresshop.es", true },
- { "torresygutierrez.com", true },
- { "torretzalam.com", true },
- { "torservers.net", true },
- { "torsquad.com", true },
- { "torsten-schmitz.net", true },
- { "torte.roma.it", true },
- { "tortoises-turtles.com", true },
- { "tortugan.com.br", true },
- { "tosatopsicologabologna.com", true },
- { "toscer.me", false },
- { "toschool.com.br", true },
- { "toshen.com", true },
- { "toshkov.com", true },
- { "tosolini.info", true },
- { "tosostav.cz", true },
- { "tosteberg.se", true },
- { "tostu.de", true },
- { "totaku.ru", false },
- { "totalaccessnicaragua.co", true },
- { "totalbike.com.br", true },
- { "totalcarcheck.co.uk", true },
- { "totalchecklist.com", true },
- { "totalclean.co.uk", true },
- { "totalemaiildelivery.com", true },
- { "totalemaiilldelivery.com", true },
- { "totalemaildeliivery.com", true },
- { "totalemaildelivery.com", true },
- { "totalemaildellivery.com", true },
- { "totalemailldeliivery.com", true },
- { "totalemailldelivery.com", true },
- { "totalforcegym.com", false },
- { "totalhost.gq", true },
- { "totallclean.com", true },
- { "totallemaiildelivery.com", true },
- { "totallemaildelivery.com", true },
- { "totallylegitimatehosting.ru", true },
- { "totalpahire.com", true },
- { "totalparts.com.au", true },
- { "totalprint.hu", true },
- { "totalsport-bg.com", true },
- { "totaltriathlon.com", true },
- { "totalwebmedia.nl", true },
- { "totem-international.com", true },
- { "totobetty.com", true },
- { "totodil.es", true },
- { "totvs.com", true },
- { "toucan-informatique.fr", true },
- { "touch.facebook.com", false },
- { "touch.mail.ru", true },
- { "touchdown.co", true },
- { "touchka.ga", true },
- { "touchoflife.in", true },
- { "touchscreentills.com", true },
- { "touchstone.io", true },
- { "touchtable.nl", true },
- { "touchweb.fr", true },
- { "touchwoodtrees.com.au", true },
- { "toudum.com", true },
- { "toughlife.info", true },
- { "touhou.ac.cn", true },
- { "touhou.fm", true },
- { "touhouwiki.net", true },
- { "toujour.top", true },
- { "toujours-actif.com", true },
- { "toulineprestige.com", true },
- { "tourdatenarchiv.de", true },
- { "tourdewestwoud.nl", true },
- { "tourgest.net", true },
- { "tourism-exegetai.tk", true },
- { "tourismwithme.com", true },
- { "tournamentmgr.com", true },
- { "tournevis.ch", false },
- { "tours.co.th", true },
- { "tourtransferitaly.it", true },
- { "tourtrektrip.com", true },
- { "tous-travaux.ch", true },
- { "toushi-exe.com", true },
- { "toushi-return.xyz", true },
- { "toushi-shakkin.com", true },
- { "touslesdrivers.com", true },
- { "tout-art.ch", true },
- { "toutart.ch", true },
- { "toutelathailande.fr", true },
- { "toutmonexam.fr", true },
- { "toutvendre.be", true },
- { "toutvendre.ch", true },
- { "toutvendre.cm", true },
- { "toutvendre.es", true },
- { "toutvendre.fr", true },
- { "toutvendre.lu", true },
- { "toutvendre.pics", true },
- { "toutvendre.uk", true },
- { "toutvendre.us", true },
- { "tovaglioli-di-carta.it", true },
- { "tovare.com", true },
- { "tovarypochtoj.tk", true },
- { "toverland-tickets.nl", true },
- { "tovp.org", true },
- { "towandalibrary.org", true },
- { "towellconstruction.ca", true },
- { "tower.land", true },
- { "townandcountryus.com", true },
- { "townhouseregister.com.au", true },
- { "townofbridgewater.ca", true },
- { "towsonpediatrics.com", true },
- { "towsonroofers.com", true },
- { "towtruck.website", true },
- { "towywebdesigns.uk", true },
- { "towzone.co.uk", true },
- { "tox21.gov", false },
- { "toxoproject.com", true },
- { "toycu.de", true },
- { "toymagazine.com.br", true },
- { "toyokawa-fan.com", true },
- { "toyopac.com", true },
- { "toyota-kinenkan.com", true },
- { "toys-robots.cf", true },
- { "toyschina.cf", true },
- { "toysperiod.com", true },
- { "toysplace.ml", true },
- { "tozdev.com", true },
- { "tp-iryuubun.com", true },
- { "tp-kabushiki.com", true },
- { "tp-kyouyufudousan.com", true },
- { "tp-law.jp", true },
- { "tpark.jp", true },
- { "tpastream.com", true },
- { "tpbproxy.co", true },
- { "tpidg.us", true },
- { "tpolemis.com", true },
- { "tpp.chat", true },
- { "tppleague.me", false },
- { "tpress.tk", true },
- { "tpro.rocks", true },
- { "tq.rs", true },
- { "tqdev.com", true },
- { "tqm1.sk", true },
- { "tr.search.yahoo.com", false },
- { "traas.org", true },
- { "trabajaenvitamina.cl", true },
- { "trabbel.org", true },
- { "trace.guru", true },
- { "trace.moe", true },
- { "traceheatinguk.co.uk", true },
- { "traceroute.guru", true },
- { "traceroute.link", true },
- { "traceroute.network", true },
- { "tracesteps.ga", true },
- { "tracetracker.no", true },
- { "tracewind.top", true },
- { "tracfinancialservices.com", true },
- { "tracinsurance.com", true },
- { "trackchair.com", true },
- { "tracker.com.ar", true },
- { "trackersimulator.org", true },
- { "trackeye.dk", true },
- { "trackify.tk", true },
- { "tracking-app.tk", true },
- { "tracking.best", true },
- { "trackrecordpro.co.uk", true },
- { "trackyourlogs.com", true },
- { "tractorfan.nl", true },
- { "tractorpumps.com", true },
- { "trad-n-vo.com", true },
- { "tradavenue.com", true },
- { "trade-arcade.com", true },
- { "trade-platform.tk", true },
- { "trade.gov", true },
- { "trade.gov.uk", true },
- { "trade247.exchange", true },
- { "tradebotcompany.ml", true },
- { "tradecloud.sg", true },
- { "tradeinvent.co.uk", true },
- { "tradeonfx.com", true },
- { "traderbot.com.br", true },
- { "traderinside.ga", true },
- { "traderjoe-cloud.de", true },
- { "tradesafe.co.za", true },
- { "tradesmance.com", true },
- { "tradexport.cn", true },
- { "tradie.com", true },
- { "tradik.com", true },
- { "tradinews.com", true },
- { "tradinews.fr", true },
- { "tradinghelper.be", true },
- { "tradingoptioncloud.com", true },
- { "tradingview.com", true },
- { "traditions.nl", true },
- { "traditionskapperscollege.nl", true },
- { "traditionsvivantesenimages.ch", true },
- { "tradlost-natverk.se", true },
- { "traducir.win", true },
- { "trafarm.ro", true },
- { "trafas.nl", true },
- { "trafficmanager.com", true },
- { "trafficmanager.ltd", true },
- { "trafficmanager.xxx", true },
- { "trafficmgr.net", true },
- { "trafficologyblueprint.com", true },
- { "trafficpixel.tk", true },
- { "trafficsafetymarketing.gov", true },
- { "traffixdevices.com", true },
- { "trafic-wap.tk", true },
- { "traficmusik.net", true },
- { "tragmi.ch", true },
- { "traha.org", true },
- { "trailcloud.ink", true },
- { "trailerparty.com", true },
- { "trailforks.com", true },
- { "trainex.org", true },
- { "trainhornforums.com", true },
- { "trainiac.com.au", true },
- { "traininghamburg.de", true },
- { "trainingswiese.at", true },
- { "trainline.at", true },
- { "trainline.cn", true },
- { "trainline.com.br", true },
- { "trainline.com.pt", true },
- { "trainline.de", true },
- { "trainline.dk", true },
- { "trainline.es", true },
- { "trainline.eu", true },
- { "trainline.fr", true },
- { "trainline.it", true },
- { "trainline.nl", true },
- { "trainline.no", true },
- { "trainline.pl", true },
- { "trainline.se", true },
- { "trainmagazine.be", true },
- { "trainmagazine.de", true },
- { "trainmagazine.nl", true },
- { "trainme.nl", true },
- { "trainplaza.be", true },
- { "trainplaza.net", true },
- { "trainplaza.nl", true },
- { "trainsgoodplanesbad.com", false },
- { "traintimes.be", true },
- { "traintimes.dk", true },
- { "traintimes.fi", true },
- { "traintimes.ie", true },
- { "traintimes.it", true },
- { "traintimes.lu", true },
- { "traintimes.nl", true },
- { "traintimes.se", true },
- { "trainyourtribe.com.au", true },
- { "traista.ru", true },
- { "traiteur-laporte.fr", true },
- { "traiteurpapillonevents.be", true },
- { "trajano.net", true },
- { "trajectfoto.nl", true },
- { "trajectvideo.nl", true },
- { "tramclub-basel.ch", true },
- { "tramikshop.ml", true },
- { "tran.pw", true },
- { "tranceattic.com", true },
- { "trancehost.com", true },
- { "trancetronic.com", true },
- { "trandanhland.com", true },
- { "trangcongnghe.com", true },
- { "trangell.com", true },
- { "tranquillity.se", true },
- { "transacid.de", true },
- { "transappealrights.com", true },
- { "transcend.org", true },
- { "transcontrol.com.ua", true },
- { "transdevbus.co.uk", true },
- { "transdyne.com", true },
- { "transeshairtransplant.com", true },
- { "transette.com", true },
- { "transfer.pw", true },
- { "transferbags.com", true },
- { "transfers.com.jm", true },
- { "transfers.do", true },
- { "transfers.mx", true },
- { "transferserver.at", true },
- { "transfersummit.com", true },
- { "transfersw.com", true },
- { "transferwiseturkiye.com.tr", true },
- { "transfigurewizard.com", true },
- { "transformaniatime.com", true },
- { "transformations-magazin.com", true },
- { "transforumation.com", true },
- { "transgendergedenkdag.nl", true },
- { "transgenderinfo.nl", true },
- { "transgendernetwerk.nl", true },
- { "transgendernetwerk.org", true },
- { "transglobaltravel.com", true },
- { "transhumanism.co.uk", true },
- { "transhumanist.co.uk", true },
- { "transhumanist.com", true },
- { "transhumanist.net", true },
- { "transhumanist.org", true },
- { "transhumanist.uk", true },
- { "transitmoe.io", true },
- { "transitownplaza.com", true },
- { "transitpoint.us", true },
- { "translate.googleapis.com", true },
- { "translationge.com", true },
- { "transmarttouring.com", true },
- { "transmisjeonline.pl", true },
- { "transmute.review", true },
- { "transnexus.com", true },
- { "transoil.co.uk", true },
- { "transpak-cn.com", true },
- { "transparentcorp.com", true },
- { "transporta.it", true },
- { "transporterlock.com", true },
- { "transumption.com", true },
- { "trappednerve.org", true },
- { "trashnothing.com", true },
- { "traslocare.roma.it", true },
- { "traslocatore.roma.it", true },
- { "traslochi-trasporti-facchinaggio.it", true },
- { "trasloco.milano.it", true },
- { "trastornoevitacion.com", true },
- { "trastornolimite.com", true },
- { "tratamentoparacelulite.net", true },
- { "tratamientodelvitiligo.es", true },
- { "trattamenti.biz", true },
- { "trattamento-cotto.it", true },
- { "trattamentocotto.roma.it", true },
- { "trauer-beileid.de", true },
- { "traumaheilung.net", true },
- { "traumwerker.com", true },
- { "traut.cloud", true },
- { "travador.com", true },
- { "travel-dealz.de", true },
- { "travel2macedonia.com", true },
- { "travel2macedonia.com.mk", true },
- { "travel2macedonia.mk", true },
- { "travel365.it", true },
- { "travelamm.com", true },
- { "travelarmenia.org", true },
- { "travelassist.us.com", true },
- { "travelbuddiesperu.com", true },
- { "travelemy.com", true },
- { "travelerofcharleston.com", true },
- { "travelexbiz.com", true },
- { "travelexinternational.com", true },
- { "travelfield.org", true },
- { "travelinc.pk", true },
- { "travelingbagsmke.com", true },
- { "travelinsurance.co.nz", true },
- { "travellers.dating", true },
- { "travellovers.fr", true },
- { "travelmexico42.com", true },
- { "travelogue.jp", true },
- { "travelphilippines.tk", true },
- { "travelphoto.cc", true },
- { "travelrefund.com", true },
- { "travelround.io", true },
- { "travelshack.com", true },
- { "traveltomachupichu.com", true },
- { "travelus.nl", true },
- { "travelvisit.cf", true },
- { "travelwithbender.com", true },
- { "travelwithsearats.com", true },
- { "travelzoneshop.com", true },
- { "traverse.com.ua", true },
- { "travi.org", true },
- { "travis.nl", true },
- { "travisf.net", true },
- { "travisforte.io", true },
- { "travisfranck.com", true },
- { "travler.net", true },
- { "trazodononline.gq", true },
- { "trbanka.com", true },
- { "trea98.org", true },
- { "treaslockbox.gov", true },
- { "treasuredandloved.co.uk", true },
- { "treasuredandloved.com", true },
- { "treatmentforkennelcough.com", true },
- { "trebarov.cz", true },
- { "trebek.club", true },
- { "trebnie.nl", true },
- { "trechosemilhas.com.br", true },
- { "tree0.xyz", true },
- { "treefelling-durban.co.za", true },
- { "treehole.life", true },
- { "treehouse.pub", true },
- { "treehousebydesign.com", true },
- { "treehouseresort.nl", true },
- { "treeline.tech", true },
- { "treeoilpot.com", true },
- { "treestarmarketing.com", true },
- { "treetopsecurity.com", true },
- { "treeworkbyjtec.com", true },
- { "trefcon.cz", true },
- { "trefpuntdemeent.nl", true },
- { "treinaweb.com.br", false },
- { "treinmagazine.be", true },
- { "treinmagazine.nl", true },
- { "treintijden.com", true },
- { "trek-planet.ru", true },
- { "trekfriend.com", true },
- { "trekinafrica.com", true },
- { "trekking-friends.ch", true },
- { "trelki.de", true },
- { "treml-sturm.com", true },
- { "trendfrisuren-bongard.de", true },
- { "trendingdeals.ga", true },
- { "trendingeducation.tk", true },
- { "trendreportdeals.com", true },
- { "trendsettersre.com", true },
- { "trendus.no", true },
- { "trendycrowds.com", true },
- { "trendykids.cz", true },
- { "trenta.io", true },
- { "trentonmakesnews.com", true },
- { "tresmaistres.com.br", true },
- { "tresor.it", true },
- { "tresorit.com", true },
- { "tresorsecurity.com", true },
- { "tretail.net", true },
- { "tretkowski.de", true },
- { "trevsanders.co.uk", true },
- { "trezor.io", true },
- { "trhastane.com", true },
- { "triage.ai", true },
- { "triage.clinic", true },
- { "triage.com", true },
- { "triage.md", true },
- { "triageclinic.com", true },
- { "trialandsuccess.nl", true },
- { "trialcentralnet.com", true },
- { "trials.tk", true },
- { "triangle-energie.com", true },
- { "trianglebruins.org", true },
- { "trianglecastles.co.uk", true },
- { "trianglelawngames.com", true },
- { "tribac.de", true },
- { "tribaldos.com", true },
- { "tribaljusticeandsafety.gov", true },
- { "tribe.rs", false },
- { "tribetrails.com", true },
- { "tribly.de", true },
- { "tribut.de", true },
- { "tributh.net", true },
- { "tributh.tk", true },
- { "tricare.mil", true },
- { "tricefy4.com", true },
- { "triciaree.com", true },
- { "trickle.works", true },
- { "trico-pigmentazione.it", true },
- { "tricountyathome.com", true },
- { "trident-online.de", true },
- { "triefenbach.com", true },
- { "triefenbach.eu", true },
- { "trietment.com", true },
- { "trigardon-rg.de", true },
- { "trigraph.net", true },
- { "trigular.de", true },
- { "trillian.im", true },
- { "trilliumvacationrentals.ca", true },
- { "triluxds.com", true },
- { "trim-a-slab.com", true },
- { "trimage.org", true },
- { "trinary.ca", false },
- { "trindonball.com", true },
- { "trineco.com", true },
- { "trineco.fi", true },
- { "tringavillasyala.com", true },
- { "trinitasgyor.hu", true },
- { "trinitycore.org", true },
- { "trinitycorporateservices.com", true },
- { "trinityradioandvideo.org", true },
- { "trinnes.net", true },
- { "trio.online", true },
- { "triop.se", true },
- { "triozon.hu", true },
- { "tripasia.id", true },
- { "triplekeys.net", true },
- { "triplethreatband.tk", true },
- { "tripolistars.com", true },
- { "trippen.travel", true },
- { "tripsinc.com", true },
- { "tripsvia.com", true },
- { "trisect.uk", true },
- { "tristanhager.i234.me", true },
- { "trit.pro", true },
- { "tritiumdisposal.com", true },
- { "trix360.com", true },
- { "trixati.org.ua", true },
- { "trixexpressweb.nl", true },
- { "trkpuls.tk", true },
- { "trockendock.ch", true },
- { "troedelhannes.at", true },
- { "troi.de", true },
- { "troiaconsultoria.com.br", true },
- { "troianet.com.br", true },
- { "trollingeffects.org", true },
- { "trollmoa.se", true },
- { "trollope-apollo.com", true },
- { "trommelwirbel.com", true },
- { "tronlaserarena.cz", true },
- { "tronmeo.com", true },
- { "troomcafe.com", true },
- { "troop89medfield.org", true },
- { "troopaid.info", true },
- { "trophee-discount.com", true },
- { "trophy-discount.com", true },
- { "trophy-solution.com", true },
- { "tropicalserver.com", false },
- { "tropicaltravelco.com", true },
- { "troplo.com", true },
- { "trosell.net", true },
- { "trotec.com", true },
- { "trotina.cz", true },
- { "troubles.ru", true },
- { "trousers.co.uk", true },
- { "trouweninoverijssel.nl", true },
- { "trovaprezzi.it", true },
- { "troxal.com", true },
- { "troyfawkes.com", true },
- { "troyhunt.com", true },
- { "troyhuntstress.com", true },
- { "troyhuntstressed.com", true },
- { "troyhuntsucks.com", true },
- { "trs.tn", true },
- { "trtruijens.com", true },
- { "tru.ltd", true },
- { "trucchibellezza.it", true },
- { "truckersmp.com", true },
- { "trucosdescargas.com", true },
- { "trueachievements.com", true },
- { "truecosmeticbeauty.com", false },
- { "trueduality.net", true },
- { "truehempculture.com.au", true },
- { "truekey.com", true },
- { "truelovesakuya.info", true },
- { "trueminecraft.com", true },
- { "truendo.com", true },
- { "truentumvet.it", true },
- { "trueopenlove.org", true },
- { "trueproxy.net", true },
- { "truerizm.ru", true },
- { "trueseeing.com", true },
- { "truesteamachievements.com", true },
- { "truestor.com", true },
- { "trueteaching.com", true },
- { "truetraveller.com", true },
- { "truetrophies.com", true },
- { "trueweb.es", true },
- { "trufflepig-forensics.com", true },
- { "truly-madly-happiness.de", true },
- { "trumanlibrary.gov", true },
- { "trumanlibrary.org", true },
- { "trumtrimun.com", true },
- { "trunk-show.net", true },
- { "truong.fi", true },
- { "truqu.com", true },
- { "truserve.org", true },
- { "trusitio.com", true },
- { "trustcase.com", true },
- { "trustednetworks.nl", true },
- { "trustfield.ch", false },
- { "trusthook.tk", true },
- { "trustnet.co.il", true },
- { "trustserv.de", true },
- { "truthmessages.pw", true },
- { "trutopoffer.com", true },
- { "truvisory.com", true },
- { "truyencuoi.org", false },
- { "truyenfull.vn", true },
- { "trw-reseller.com", true },
- { "try2admin.pw", true },
- { "try2services.cm", true },
- { "try2services.vc", true },
- { "trybooking.com", true },
- { "tryhard.cz", true },
- { "tryhexadecimal.com", true },
- { "tryitonline.net", true },
- { "tryndraze.com", true },
- { "trynta.com", true },
- { "trynta.net", true },
- { "tryplo.ca", true },
- { "tryplo.com", true },
- { "tryplo.io", true },
- { "tryplo.net", true },
- { "tryplo.org", true },
- { "tryplo.xyz", true },
- { "tryprime.co.uk", true },
- { "tryti.me", true },
- { "tryupdates.com", true },
- { "trz.cz", true },
- { "trzepak.pl", true },
- { "ts5server.eu", true },
- { "tsa-sucks.com", true },
- { "tsab.moe", true },
- { "tsahf.com", true },
- { "tsai.com.de", true },
- { "tsatestprep.com", true },
- { "tschuermans.be", true },
- { "tscinsurance.com", true },
- { "tsedryk.ca", true },
- { "tsgkc1.com", true },
- { "tsicons.com", true },
- { "tsinnosti.com", true },
- { "tsironis-olivenoel.de", true },
- { "tslcontractors.co.uk", true },
- { "tsmgroup2.biz", true },
- { "tsng-stg.tk", true },
- { "tsng.co.jp", true },
- { "tspdrits.xyz", true },
- { "tsriggingequipment.com", true },
- { "tsrv.pw", false },
- { "tss.am", true },
- { "tstrubberstamp.com", false },
- { "tsueri.cloud", true },
- { "tsukhani.com", true },
- { "tsuki.moe", true },
- { "tsumegumi.com", true },
- { "tsumi.it", true },
- { "tsunami-alarm-system.com", true },
- { "tsunami.gov", true },
- { "tsundere.moe", true },
- { "tsurai.work", true },
- { "tsutawal.com", true },
- { "tsv-1894.de", true },
- { "tt0766.com", true },
- { "tt0866.com", true },
- { "tt0966.com", true },
- { "tt2866.com", true },
- { "tt2966.com", true },
- { "tt3699.com", true },
- { "tt3766.com", true },
- { "tt3999.com", true },
- { "tt7199.com", true },
- { "tt7299.com", true },
- { "tt7399.com", true },
- { "tt8166.com", true },
- { "tt8266.com", true },
- { "tt8366.com", true },
- { "tt918.com", true },
- { "tt9799.com", true },
- { "ttbonline.gov", true },
- { "ttc-birkenfeld.de", true },
- { "ttcaarberg.ch", true },
- { "ttcak.ddns.net", true },
- { "ttcf.ca", true },
- { "ttclub.fr", true },
- { "ttdsevaonline.com", true },
- { "ttfollower.com", true },
- { "ttlet.com", true },
- { "ttp-shop.com.ua", true },
- { "tts-assessments.com", true },
- { "ttsoft.pl", true },
- { "ttsweb.org", true },
- { "ttuwiki.ee", true },
- { "ttuwiki.org", true },
- { "ttwoee.com", true },
- { "ttwt.com", true },
- { "tty1.net", true },
- { "tu-immoprojekt.at", true },
- { "tu6.pm", true },
- { "tualiadaenlimpieza.com", true },
- { "tuanhstore.com", true },
- { "tuasaude.com", true },
- { "tubanten.nl", true },
- { "tube.tools", true },
- { "tube8.es", true },
- { "tube8.fr", true },
- { "tubebegana.com", true },
- { "tubedesire.com", true },
- { "tubejack.nl", true },
- { "tubepro.de", true },
- { "tubepro.net", true },
- { "tubs4fun.co.uk", true },
- { "tubul.net", true },
- { "tucepihotelalga.com", true },
- { "tucny.com", true },
- { "tucocoon.com", true },
- { "tucsonfcu.com", true },
- { "tucuxi.org", true },
- { "tudiennhakhoa.com", true },
- { "tudineroasi.com", true },
- { "tudosobrehost.com.br", true },
- { "tuev-hessen.de", true },
- { "tuffclassified.com", true },
- { "tuffsruffs.se", true },
- { "tugafm.eu.org", true },
- { "tuimprenta.com.ar", true },
- { "tuincentersnaet.be", true },
- { "tuingereedschappen.net", false },
- { "tuitle.com", true },
- { "tuja.hu", true },
- { "tujunfang.com", true },
- { "tukdesigns.com", true },
- { "tulenceria.es", true },
- { "tully.co.uk", true },
- { "tulsaworkshop.org", true },
- { "tulumplayarealestate.com", true },
- { "tumagiri.net", true },
- { "tumarcafe.com", true },
- { "tumblenfun.com", true },
- { "tumblr.com", true },
- { "tumedico.es", true },
- { "tune-web.de", true },
- { "tunefish-entertainment.de", true },
- { "tuneotune.com", true },
- { "tuner.cloud", true },
- { "tuning-parts24.de", true },
- { "tuning-werkstatt-nuernberg.de", true },
- { "tuning.energy", true },
- { "tuningblog.eu", false },
- { "tunnelbear.com", true },
- { "tunnelblick.net", true },
- { "tunnelstore.net", true },
- { "tunnelventilation.pro", true },
- { "tunnelwatch.com", true },
- { "tunsbergwhiskyfestival.no", true },
- { "tuntitili.fi", true },
- { "tupa-germania.ru", true },
- { "tupass.pw", true },
- { "tupeuxpastest.ch", false },
- { "tupianku.com", true },
- { "tupizm.com", true },
- { "tuppenceworth.ie", true },
- { "turbomag.pl", true },
- { "turbosuflantecluj.ro", true },
- { "turdnagel.com", true },
- { "turf-experts.com", true },
- { "turigum.com", true },
- { "turiscar.pt", true },
- { "turismodubrovnik.com", true },
- { "turkish.dating", true },
- { "turkishhackers.tk", true },
- { "turkmistress.tk", true },
- { "turkrock.com", true },
- { "turl.pl", true },
- { "turnaroundforum.de", true },
- { "turncircles.com", true },
- { "turnierplanung.com", true },
- { "turnoffthelights.com", true },
- { "turnoffthelights.video", true },
- { "turnonsocial.com", true },
- { "turnout.rocks", true },
- { "turpinpesage.fr", true },
- { "tursiae.org", true },
- { "turtleduckstudios.com", true },
- { "turtlepay.io", true },
- { "turtlepwr.com", true },
- { "turuncu-sepet.com", true },
- { "turunculevye.com", true },
- { "turystyczny-system.pl", true },
- { "tus-kikishinkyo.jp", true },
- { "tuscanyleather.it", true },
- { "tusharwalaskar.com", true },
- { "tusi.co", true },
- { "tusmedicamentos.com", true },
- { "tussier.com", true },
- { "tutanota.com", true },
- { "tutdevki.tk", true },
- { "tuto-craft.com", true },
- { "tutoragency.org", true },
- { "tutorat-tect.org", true },
- { "tutorcruncher.com", true },
- { "tutorialdb.tk", true },
- { "tutorialehtml.com", true },
- { "tutorialinux.com", true },
- { "tutorialseo.com.br", true },
- { "tutorme.com", true },
- { "tuts4you.com", true },
- { "tuttimundi.org", false },
- { "tutu.green", true },
- { "tuwaner.com", true },
- { "tuxflow.de", false },
- { "tuxie.com", true },
- { "tuxlife.net", true },
- { "tuxone.ch", true },
- { "tuxpi.com", true },
- { "tuxplace.nl", true },
- { "tuxsrv.com", true },
- { "tuxtimo.me", true },
- { "tuxz.net", true },
- { "tuza.com.au", true },
- { "tuzaginside.com", true },
- { "tuzagtcs.com", true },
- { "tuzaijidi.com", true },
- { "tv-programme.be", true },
- { "tv-programme.com", true },
- { "tv-sports.fr", true },
- { "tvaerialsmanchester.com", true },
- { "tvbaratas.net", true },
- { "tvcmarketing.com", true },
- { "tvdates.info", true },
- { "tver-msk.ru", true },
- { "tves.gob.ve", true },
- { "tvhshop.be", true },
- { "tvipper.com", true },
- { "tvlanguedoc.com", true },
- { "tvleaks.se", true },
- { "tvlplus.net", true },
- { "tvnow.de", true },
- { "tvoe-delo24.ru", true },
- { "tvoyaknighka.ga", true },
- { "tvplusiptv.com", true },
- { "tvquot.es", true },
- { "tvs-virtual.cz", true },
- { "tvseries.info", true },
- { "tvsheerenhoek.nl", true },
- { "tvteam.nl", true },
- { "tvzr.com", false },
- { "tw.search.yahoo.com", false },
- { "twainhartehotels.com", true },
- { "twaka.com", true },
- { "twalter.de", true },
- { "twatspot.com", true },
- { "twb.berlin", true },
- { "twd2.me", true },
- { "twd2.net", false },
- { "twdreview.com", true },
- { "twdtulelo.hu", true },
- { "tweak.group", true },
- { "tweakers.com.au", true },
- { "tweakers.net", true },
- { "tweaktown.com", true },
- { "twelvecolonies.tk", true },
- { "twelvecornerspediatrics.com", true },
- { "twenty71.com", true },
- { "twilleys.com", true },
- { "twincitynissantxparts.com", true },
- { "twinkseason.com", true },
- { "twinztech.com", true },
- { "twisata.com", true },
- { "twist.com", true },
- { "twistdevelopment.co.uk", true },
- { "twisted-brains.org", true },
- { "twistedwave.com", true },
- { "twistfix.co.uk", true },
- { "twisto.cz", true },
- { "twisto.pl", true },
- { "twit-guide.com", true },
- { "twitchplaysleaderboard.info", true },
- { "twitter.com", false },
- { "twitterdriver.io", true },
- { "twitteroauth.com", true },
- { "twizzkidzinflatables.co.uk", true },
- { "twlan.org", true },
- { "twlitek.com.tw", true },
- { "twmartin.codes", true },
- { "twobitbusker.com", true },
- { "twodrinksaway.com", true },
- { "twoef.co.uk", true },
- { "twofactorauth.org", true },
- { "twoguyswhoblog.com", true },
- { "twohuo.com", true },
- { "twojapogoda.pl", true },
- { "twonodes.games", true },
- { "twopif.net", true },
- { "tworaz.net", true },
- { "twtr.email", true },
- { "twwd.de", true },
- { "tx299.com", true },
- { "txcap.org", true },
- { "txdivorce.org", true },
- { "txi.su", true },
- { "txlocksmiththewoodlands.com", true },
- { "txlrs.org", true },
- { "txm.pl", true },
- { "txtecho.com", true },
- { "txtfile.eu", true },
- { "txurologist.com", true },
- { "ty7788.cc", true },
- { "tyc001.cc", true },
- { "tyc009.cc", true },
- { "tyc923.com", true },
- { "tyche.io", true },
- { "tycho.org", true },
- { "tycom.cz", true },
- { "tycyc88.com", true },
- { "tycycles.co.uk", true },
- { "tykeplay.com", true },
- { "tyler.rs", true },
- { "tylerdavies.net", true },
- { "tylerfreedman.com", true },
- { "tylerharcourt.org", true },
- { "tylermade.net", true },
- { "tyleromeara.com", true },
- { "tylerschmidtke.com", true },
- { "typeblog.net", true },
- { "typeclasses.com", true },
- { "typecodes.com", true },
- { "typeof.pw", true },
- { "typeonejoe.com", true },
- { "typewolf.com", true },
- { "typewritten.net", true },
- { "typing.com", true },
- { "typist.tech", true },
- { "typo3.com", true },
- { "tyroremotes.co.uk", true },
- { "tyroremotes.es", true },
- { "tyroremotes.eu", true },
- { "tyroremotes.fr", true },
- { "tyroremotes.nl", true },
- { "tyroremotes.no", true },
- { "tyroremotes.pt", true },
- { "tyroremotes.se", true },
- { "tysox.de", true },
- { "tysye.ca", true },
- { "tytocare.com", true },
- { "tytod.com", true },
- { "tyuo-keibi.co.jp", true },
- { "tyva.gq", true },
- { "tyva.ml", true },
- { "tzermias.gr", true },
- { "tzyingshi.com", true },
- { "u-chan.com", true },
- { "u-grow.gr", true },
- { "u-he.com", true },
- { "u-martfoods.com", true },
- { "u-page.nl", true },
- { "u.nu", true },
- { "u00228.com", false },
- { "u03.fr", true },
- { "u29dc.com", true },
- { "u2fsecuritykeys.com", true },
- { "u32i64.cf", true },
- { "u36533.com", true },
- { "u36594.com", true },
- { "u4mh-dev-accesscontroller.azurewebsites.net", true },
- { "u4mh-dev-portal.azurewebsites.net", true },
- { "u5.re", true },
- { "u5b.de", false },
- { "u5r.nl", true },
- { "u81818.com", true },
- { "ua.search.yahoo.com", false },
- { "uae-company-service.com", true },
- { "ualove.tk", true },
- { "uangteman.com", true },
- { "uasmi.com", true },
- { "uastrategy.org", true },
- { "uat-activesg.com", true },
- { "uat-mypfp.co.uk", true },
- { "uatgootax.ru", false },
- { "ub3rk1tten.com", false },
- { "ub889.com", true },
- { "ubanquity.com", true },
- { "ubcani.com", true },
- { "uberboxen.net", true },
- { "uberestimator.com", true },
- { "uberi.fi", true },
- { "ubermail.me", true },
- { "uberpromocodes.us", true },
- { "ubertt.org", true },
- { "uberwald.de", true },
- { "uberwald.ws", true },
- { "ubezpieczenia-poznan.com", true },
- { "ubezpieczeniepsa.com", true },
- { "ubicaciones-vitamina.cl", true },
- { "ubineering.de", true },
- { "ubis.company", true },
- { "ubiurbe.com", true },
- { "ublaboo.org", true },
- { "uboratz.org", true },
- { "uborka-812.ru", true },
- { "ubunlog.com", true },
- { "ubuntu18.com", true },
- { "ubytovanihyncice.cz", true },
- { "ucac.nz", false },
- { "ucangiller.com", true },
- { "ucasa.org.au", true },
- { "ucc.edu.gh", true },
- { "ucch.be", false },
- { "uccisme.net.ua", true },
- { "ucfirst.nl", true },
- { "uchargeapp.com", true },
- { "uclf.de", true },
- { "ucmjlawyers.com", true },
- { "ucnedu.org", true },
- { "ucngame.com", true },
- { "ucppe.org", true },
- { "ucrdatatool.gov", true },
- { "uctarna.online", true },
- { "udancy.com", true },
- { "udbhav.me", true },
- { "uddi.ng", true },
- { "uddin.io", true },
- { "udid.fyi", true },
- { "udien.tk", true },
- { "udo-luetkemeier.de", true },
- { "udomain.net", true },
- { "udp.sh", false },
- { "udruga-point.hr", true },
- { "udtunnel.com", true },
- { "udvoukocek.eu", true },
- { "ueberdosis.io", true },
- { "ueberwachungspaket.at", true },
- { "uedaviolin.com", true },
- { "ueni.com", true },
- { "uestc.icu", true },
- { "uevan.com", true },
- { "ufanisi.mx", true },
- { "ufindme.at", true },
- { "ufo-blogger.com", true },
- { "ufocentre.com", true },
- { "ufoch.com", true },
- { "ufplanets.com", true },
- { "ufroo.com", true },
- { "ugb-verlag.de", true },
- { "ugeek.tk", true },
- { "uggedal.com", true },
- { "uglycat.com", true },
- { "uglycat.eu", true },
- { "uglycat.net", true },
- { "uglycat.org", true },
- { "ugx-mods.com", true },
- { "ugy.es", true },
- { "uhc.gg", true },
- { "uhlhosting.ch", true },
- { "uhrenlux.de", true },
- { "ui8.net", true },
- { "uiberlay.cz", true },
- { "uicchy.com", true },
- { "uiop.link", true },
- { "uiterwijk.org", true },
- { "uitgeverij-deviant.nl", true },
- { "uix.biz", true },
- { "uj2008.com", true },
- { "ujiyasu.com", true },
- { "ujob.com.cn", true },
- { "ujvary.eu", true },
- { "uk.dating", true },
- { "uk.search.yahoo.com", false },
- { "ukbc.london", true },
- { "ukchemicalresearch.org", false },
- { "ukdefencejournal.org.uk", true },
- { "ukhas.net", true },
- { "ukhillwalking.com", true },
- { "ukmeetandgreet.com", true },
- { "ukooku.com", true },
- { "ukozliku.cz", true },
- { "ukpirate.org", true },
- { "ukpropertyrescue.com", true },
- { "ukr.media", true },
- { "ukrainians.ch", true },
- { "ukriate.com", true },
- { "ukrigging.net", true },
- { "ukrn.io", true },
- { "ukrnet.co.uk", true },
- { "uksb.net", true },
- { "uktw.co.uk", true },
- { "ukuchordnamer.com", true },
- { "ukulelejim.com", true },
- { "ukutabs.com", true },
- { "ukwct.org.uk", true },
- { "ulabox.com", true },
- { "uldsh.de", true },
- { "uleenucks.de", true },
- { "ulen.me", true },
- { "ulfberht.fi", true },
- { "uli-eckhardt.de", true },
- { "ulitroyo.com", true },
- { "ullah.se", true },
- { "ulli.ml", true },
- { "ulmer-schneesport.de", true },
- { "ulovelc88.com", true },
- { "ulrik.moe", true },
- { "ultima-ratio.at", true },
- { "ultimate-fireworks.tk", true },
- { "ultimate-uk.com", true },
- { "ultimateanu.com", true },
- { "ultimateappreviews.co", true },
- { "ultimatebabyshowergifts.ga", true },
- { "ultimatemafia.net", true },
- { "ultimatepaleoguide.com", true },
- { "ultrabeautycream.com", true },
- { "ultrafine.cf", true },
- { "ultramax.biz", true },
- { "ultramookie.com", true },
- { "ultraporn.biz", true },
- { "ultrasdesign.co.uk", true },
- { "ultraseopro.com", true },
- { "ultratechlp.com", true },
- { "ultrautoparts.com.au", true },
- { "ultravip.com.br", true },
- { "um-sachsen-pictures.de", true },
- { "umail2.com", true },
- { "umanityracing.com", true },
- { "umartina.eu", true },
- { "umasstransit.org", true },
- { "umbertheprussianblue.com", true },
- { "umbricht.li", true },
- { "umcpc.org", true },
- { "umenlisam.com", true },
- { "umisonoda.com", true },
- { "umlcode.com", true },
- { "ummati.com", true },
- { "umniy-dom.tk", true },
- { "umount.net", true },
- { "umsapi.com", true },
- { "umzuege-berlin.com", true },
- { "umzuege-hannover.net", true },
- { "umzuege-wolfsburg.de", true },
- { "umzug-braunschweig24.de", true },
- { "umzugsunternehmenberlin.eu", true },
- { "un-framed.co.za", true },
- { "un-instantpoursoi.com", true },
- { "un-zero-un.fr", true },
- { "un.fo", true },
- { "unadonna.it", true },
- { "unapp.me", true },
- { "unausa.com.br", true },
- { "unblock-zh.org", true },
- { "unblocked.at", true },
- { "unblocked.bet", true },
- { "unblocked.bid", true },
- { "unblocked.cam", true },
- { "unblocked.dk", true },
- { "unblocked.gdn", true },
- { "unblocked.ink", true },
- { "unblocked.krd", true },
- { "unblocked.lc", true },
- { "unblocked.live", true },
- { "unblocked.llc", true },
- { "unblocked.ltda", true },
- { "unblocked.mx", true },
- { "unblocked.nz", true },
- { "unblocked.one", true },
- { "unblocked.pet", true },
- { "unblocked.pl", true },
- { "unblocked.pro", true },
- { "unblocked.pub", true },
- { "unblocked.sh", true },
- { "unblocked.uno", true },
- { "unblocked.vc", true },
- { "unblocked.vet", true },
- { "unblocked.vip", true },
- { "unblocked.win", true },
- { "unbolt.cf", true },
- { "unboundmoney.com", true },
- { "unboxed.cf", true },
- { "unboxforteams.work", true },
- { "uncarved.com", true },
- { "unccelearn.org", true },
- { "uncensoreddns.dk", true },
- { "uncensoreddns.org", true },
- { "unclebens-specials.gr", true },
- { "undeadpirates.net", true },
- { "undecidable.de", true },
- { "undeductive.media", true },
- { "undef.in", false },
- { "underbridgeleisure.co.uk", true },
- { "undercovercondoms.com", true },
- { "underfloorheating-uk.co.uk", true },
- { "undergrounder.ga", true },
- { "underlined.fr", true },
- { "undernet.uy", false },
- { "undertow.ga", true },
- { "underwearoffer.com", true },
- { "underwoodpatents.com", true },
- { "undp.lt", true },
- { "unece-deta.eu", true },
- { "unedouleur.com", true },
- { "unefleur.be", true },
- { "unefuite.ch", false },
- { "unerosesurlalune.fr", false },
- { "unexpected.nu", true },
- { "unexpectedcompany.com", true },
- { "unfallrechtler.de", true },
- { "unfc.nl", true },
- { "unfuddle.cn", true },
- { "unga.dk", true },
- { "ungaeuropeer.se", true },
- { "ungegamere.dk", true },
- { "unghie.com", true },
- { "unibusreputation.com", true },
- { "unicef-karten.at", true },
- { "unicef.pl", true },
- { "unicefcards.it", true },
- { "unicefcards.nl", true },
- { "unicefcestitke.rs", true },
- { "unicefkaarten.nl", true },
- { "unicefkartkidlafirm.pl", true },
- { "unicode.website", true },
- { "unicolabo.jp", true },
- { "unicorn-systems.net", true },
- { "unicorn.melbourne", true },
- { "unicorndesign.ninja", true },
- { "unicorntooling.eu", true },
- { "unicredit.ba", true },
- { "unicredit.ro", true },
- { "unicreditbank.hu", true },
- { "unicreditbank.rs", true },
- { "unicreditbank.ru", false },
- { "unideck.com.ua", true },
- { "unidevgroup.ru", true },
- { "unidostransportes.com.br", true },
- { "unidrogas.com", true },
- { "unieducar.org.br", true },
- { "uniekglas.nl", true },
- { "unifestal.com", true },
- { "uniform-agri.com", true },
- { "unijob.com.br", true },
- { "unik.bg", true },
- { "unikalo.com", true },
- { "unikoingold.com", true },
- { "unikrn.com", true },
- { "unikrn.space", true },
- { "unila.edu.br", true },
- { "unimbalr.com", true },
- { "unionplat.ru", true },
- { "unionreports.gov", true },
- { "unionstreetskateboards.com", true },
- { "uniontestprep.com", true },
- { "unipart.digital", false },
- { "unipig.de", true },
- { "uniprimebr.com.br", false },
- { "uniq.site", true },
- { "uniqsys.eu", true },
- { "unique-pathways.ch", false },
- { "unique-pathways.com", false },
- { "unique-tutorials.info", true },
- { "uniquepathways.ch", false },
- { "unit7jazz.com", true },
- { "unit7jazz.org", true },
- { "unite-ka.de", true },
- { "uniteasia.org", true },
- { "united-coders.com", true },
- { "united.com", false },
- { "unitedadmins.com", true },
- { "unitedarmyofentropia.tk", true },
- { "unitedbaby.fr", true },
- { "unitedfitness.com.au", true },
- { "unitedkingdoms-guild.com", true },
- { "unitedmatrix.org", true },
- { "unitedprovinces.nl", true },
- { "unitedpsychological.com", true },
- { "unitedstreamers.de", true },
- { "unitel2000.de", true },
- { "unitir.gq", true },
- { "unityconsciousnessbooks.com", true },
- { "unityvox.com", true },
- { "uniuni.info", true },
- { "univate.berlin", true },
- { "univercite.ch", false },
- { "univeril.com", false },
- { "universal-edge.com", true },
- { "universal-tutorial.com", true },
- { "universal-village.org", true },
- { "universal.at", true },
- { "universalcarpetinc.com", true },
- { "universalcarremote.com", true },
- { "universe.horse", true },
- { "universeinform.com", true },
- { "universidadperu.com", true },
- { "universogay.com", true },
- { "universoscuola.it", true },
- { "universovalve.net", true },
- { "universrumbacongolaise.com", true },
- { "univet-veterinaire.com", true },
- { "univetnature.org", true },
- { "univitale.fr", false },
- { "unix.se", true },
- { "unixadm.org", true },
- { "unixattic.com", true },
- { "unixforum.org", true },
- { "unixfox.eu", true },
- { "unixhost.ga", true },
- { "unixtime.date", true },
- { "unkn0wncat.net", true },
- { "unknown-player.com", true },
- { "unknown.kyoto", false },
- { "unkrn.com", true },
- { "unlax.com", true },
- { "unli.xyz", true },
- { "unlockauthority.com", true },
- { "unlockblackberryfree.co.uk", true },
- { "unlocken.nl", true },
- { "unlocks.co.uk", true },
- { "unlocktalent.gov", true },
- { "unlocktechs.com", true },
- { "unluco.com", true },
- { "unmarkdocs.co", true },
- { "unmonito.red", true },
- { "unn-edu.info", true },
- { "unnamed.download", true },
- { "uno-pizza.ru", true },
- { "uno.fi", true },
- { "uno.uk", true },
- { "unoccupyabq.org", true },
- { "unosconotros.com", true },
- { "unp.me", true },
- { "unpaismejor.es", true },
- { "unpkg.com", true },
- { "unpleasant.tk", true },
- { "unpluggedjuice.dk", true },
- { "unpossible.xyz", true },
- { "unpr.dk", true },
- { "unquote.li", false },
- { "unrealircd.org", true },
- { "unrelated.net.au", true },
- { "uns.vn", true },
- { "unseen.is", true },
- { "unseen.tw", true },
- { "unser-gartenforum.de", true },
- { "unsourirealecole.fr", true },
- { "unstablewormhole.ltd", true },
- { "unstamps.org", true },
- { "unstoppableunits.com", true },
- { "unsuspicious.click", true },
- { "unterhaltungsbox.com", true },
- { "unternehmensbewertung.pro", true },
- { "unternehmer-radio.de", true },
- { "unternehmerrat-hagen.de", true },
- { "untethereddog.com", true },
- { "untilyouarrive.com", true },
- { "unusedrooms.com", true },
- { "unusualhatclub.com", true },
- { "unveiledgnosis.com", true },
- { "unx.dk", true },
- { "unxcoconsulting.com", true },
- { "unxicdellum.cat", true },
- { "uotomizu.com", true },
- { "up-ai.com", true },
- { "up2mark.com", true },
- { "up2mark.de", true },
- { "up2staff.com", true },
- { "upacores.com", true },
- { "upakweship.com", true },
- { "upandrunningtutorials.com", true },
- { "upawg.ca", true },
- { "upay.ru", true },
- { "upbad.com", true },
- { "upbatangan.tk", true },
- { "upbeatrobot.com", true },
- { "upbeatrobot.email", true },
- { "upbeatrobot.eu", true },
- { "upbeatrobot.net", true },
- { "upbeatrobot.nl", true },
- { "upbeatrobot.org", true },
- { "upbtrbt.com", true },
- { "upbtrbt.eu", true },
- { "upbtrbt.net", true },
- { "upbtrbt.nl", true },
- { "upbtrbt.org", true },
- { "upcambio.com", true },
- { "upd.jp", true },
- { "upengo.com", true },
- { "upforshare.com", false },
- { "upgamerengine.com", true },
- { "upgamerengine.com.br", true },
- { "upgamerengine.net", true },
- { "upgauged.com", true },
- { "upgradedpoints.com", true },
- { "uphabit.io", true },
- { "upholsterycleanerslondon.co.uk", true },
- { "upholsterydesign.com.au", true },
- { "uphuntingland.com", true },
- { "upitnik.rs", true },
- { "uplaqui.com.br", true },
- { "uplead.com", true },
- { "uplinklabs.net", true },
- { "upliving.be", true },
- { "upload.cat", true },
- { "upload.facebook.com", false },
- { "uploadbeta.com", true },
- { "uplotnitel.online", true },
- { "uplr.it", true },
- { "upmon.com", true },
- { "upperbeaconsfield.org.au", true },
- { "uppercap.com", true },
- { "upperroommission.ca", true },
- { "upplevelse.com", true },
- { "uprint.it", true },
- { "upropay.com", true },
- { "uprospr.com", true },
- { "uprouteyou.com", true },
- { "upsiteseo.com", true },
- { "upstart.com", true },
- { "uptechbrasil.com.br", true },
- { "uptodateinteriors.com", true },
- { "uptoon.jp", true },
- { "uptownlocators.com", true },
- { "uptownvintagecafe.com", true },
- { "uptrends.com", true },
- { "uptrends.de", true },
- { "upturn.org", true },
- { "upundit.com", true },
- { "upvoted.net", true },
- { "upwork.com", true },
- { "ur-lauber.de", true },
- { "ur.nl", true },
- { "ur2.pw", true },
- { "urabain.com", true },
- { "uradisam.rs", true },
- { "uraimo.com", true },
- { "ural-emal.ga", true },
- { "uraniborg.net", true },
- { "uranius.eu", true },
- { "urb-budex.pl", true },
- { "urbackups.com", true },
- { "urbalex.ch", false },
- { "urban-culture.fr", true },
- { "urban.melbourne", true },
- { "urbancreators.dk", true },
- { "urbanesecurity.com", true },
- { "urbanfi.sh", true },
- { "urbanguerillas.de", true },
- { "urbangymfirenze.com", true },
- { "urbanhotbed.eu", true },
- { "urbanietz-immobilien.de", true },
- { "urbanindustriecoiffure-auray.fr", true },
- { "urbannewsservice.com", true },
- { "urbanwaters.gov", false },
- { "urbanwildlifealliance.org", false },
- { "urbanxdevelopment.com", true },
- { "urbexdk.nl", true },
- { "urbexing.eu", true },
- { "urbizoroofing.com", true },
- { "urcentral.com", true },
- { "urcentral.eu", true },
- { "urcentral.net", true },
- { "urcentral.nl", true },
- { "urcentral.org", true },
- { "ureka.org", true },
- { "urep.us", true },
- { "uripura.de", true },
- { "urist1011.ru", true },
- { "urkult.se", true },
- { "url.fi", true },
- { "url.fm", true },
- { "url.rw", false },
- { "url1.ga", true },
- { "urlakite.com", true },
- { "urlaub-busreisen.de", true },
- { "urlaub-leitner.at", true },
- { "urlfly.tk", true },
- { "urlgot.com", true },
- { "urlscan.io", true },
- { "urlsimple.tk", true },
- { "urltodomain.com", true },
- { "urnes.org", true },
- { "urologyoklahoma.com", true },
- { "urown.net", true },
- { "urrestarazuserranoabogados.com", true },
- { "ursa-minor-beta.org", true },
- { "ursae.co", true },
- { "urspringer.de", true },
- { "ursuslibris.hu", true },
- { "urth.org", true },
- { "uruguay-experience.com", true },
- { "urukproject.org", true },
- { "us-10.com", true },
- { "us.marketing", true },
- { "usa-10.us", true },
- { "usa-greencard.eu", true },
- { "usa-reisetipps.net", true },
- { "usa-viagra.com", true },
- { "usaa.com", false },
- { "usaautoaz.com", true },
- { "usabackground.com", true },
- { "usabibi.net", true },
- { "usability.gov", true },
- { "usaestaonline.com", true },
- { "usage.be", true },
- { "usagexchange.com", true },
- { "usagm.gov", true },
- { "usajobs.com", true },
- { "usajobs.gov", true },
- { "usakitchensandflooring.com", true },
- { "usalearning.gov", true },
- { "usamdt.com", true },
- { "usamultimeters.com", true },
- { "usapublicrecords.com", true },
- { "usarp.org", true },
- { "usaseanconnect.gov", true },
- { "usastaffing.gov", true },
- { "usb-lock-rp.com", true },
- { "usbevents.co.uk", true },
- { "uscis.gov", true },
- { "uscloud.nl", true },
- { "uscpaservices.com", true },
- { "uscurrency.gov", true },
- { "usd.de", false },
- { "usdoj.gov", true },
- { "usds.gov", true },
- { "use.be", true },
- { "usebean.com", true },
- { "usedu.us", true },
- { "username.nz", true },
- { "userstation.net", true },
- { "usetypo3.com", true },
- { "useyourloaf.com", true },
- { "usgande.com", true },
- { "ushandbookapp.com", true },
- { "ushare.ch", true },
- { "usimmigration.us", true },
- { "usitcolours.bg", true },
- { "usjunkyardsnearme.com", true },
- { "uskaria.com", true },
- { "uslugi-voronezh.tk", true },
- { "usmiddleclass.net", true },
- { "usninosnikrcni.eu", true },
- { "usnti.com", true },
- { "uspaacc.com", true },
- { "uspesnyprvnacek-testing.herokuapp.com", true },
- { "uspesnyprvnacek.cz", true },
- { "uspesnyprvnacek.herokuapp.com", true },
- { "usphs.gov", true },
- { "ussm.gov", false },
- { "ussst.org", true },
- { "ussuka.com", false },
- { "ustaywell.com", true },
- { "ustensiles-cuisine.boutique", true },
- { "ustr.gov", false },
- { "ustugov.kiev.ua", true },
- { "ustugova.kiev.ua", true },
- { "usualbeings.com", true },
- { "usuan.net", true },
- { "usweme.info", true },
- { "uswitch.com", true },
- { "utahblackplate.com", true },
- { "utahblackplates.com", true },
- { "utahcanyons.org", true },
- { "utahfanclub.org", true },
- { "utahhomes-realestate.com", true },
- { "utahhydrographics.com", true },
- { "utahrealestatepodcast.com", true },
- { "utahtravelcenter.com", true },
- { "utaiw.com", true },
- { "utavatu.mk", true },
- { "utazas-nyaralas.info", true },
- { "utazine.com", true },
- { "utcast-mate.com", true },
- { "utdsgda.com", true },
- { "uteasybooki.com", true },
- { "utensil.org", true },
- { "utepils.de", true },
- { "utevai.tk", true },
- { "utgifter.no", true },
- { "utiars.com", true },
- { "utilia.tools", true },
- { "utilitarian.com", true },
- { "utilitarian.net", true },
- { "utilitarian.org", true },
- { "utilitarianism.com", true },
- { "utilitarianism.org", true },
- { "utilitarismo.com", true },
- { "utilitronium.com", true },
- { "utilityapi.com", true },
- { "utonia.ch", true },
- { "utopianhomespa.com", true },
- { "utopianrealms.org", true },
- { "utopicestudios.com", true },
- { "utox.io", true },
- { "utrace.me", true },
- { "utrantor.org", true },
- { "utterberry.io", true },
- { "utugnn.ru", true },
- { "utw.me", true },
- { "utwente.io", true },
- { "utzon.net", true },
- { "uuit.nl", true },
- { "uuzsama.me", true },
- { "uv.uy", true },
- { "uvenuse.cz", true },
- { "uvocorp.com", true },
- { "uvpress.com", true },
- { "uvseh.com", true },
- { "uvtcinemas.com", true },
- { "uvx.io", true },
- { "uwac.co.uk", false },
- { "uwat.cf", true },
- { "uwe-arzt.de", true },
- { "uwe-r.com", true },
- { "uwe.training", true },
- { "uwelilienthal.de", true },
- { "uwmarktspecialist.nl", true },
- { "uwsoftware.be", true },
- { "uwusergdatasystems.com", true },
- { "uwvloereruit.nl", true },
- { "ux-designers.nl", true },
- { "uxdesignerjobs.nl", true },
- { "uxp-it.nl", true },
- { "uxtag.com", true },
- { "uxteam.com", true },
- { "uy.search.yahoo.com", false },
- { "uyen.party", true },
- { "uz.search.yahoo.com", false },
- { "uzayliyiz.biz", true },
- { "uzaymedya.com.tr", true },
- { "uzbekkizlari.tk", true },
- { "uzbektumblers.tk", true },
- { "uze-mobility.at", true },
- { "uze-mobility.ch", true },
- { "uze-mobility.co", true },
- { "uze-mobility.com", true },
- { "uze-mobility.group", true },
- { "uze-mobility.info", true },
- { "uze-mobility.io", true },
- { "uze-mobility.net", true },
- { "uze-mobility.org", true },
- { "uze-store.com", true },
- { "uze.mobi", true },
- { "uzemobility.com", true },
- { "uzemobility.de", true },
- { "uzemobility.eu", true },
- { "uzemobility.org", true },
- { "uzhas-uzhasny.ml", true },
- { "uzpirksana.lv", true },
- { "uzsvm.cz", true },
- { "uzzamari.com", true },
- { "v-d-p.net", true },
- { "v-novosibirske.tk", true },
- { "v-spin.cz", true },
- { "v-tek.fi", true },
- { "v05666.com", true },
- { "v06999.com", true },
- { "v0ctor.me", true },
- { "v0v.cc", true },
- { "v1.dk", true },
- { "v10006.com", true },
- { "v10008.com", true },
- { "v12555.com", true },
- { "v139.com", true },
- { "v1951.com", true },
- { "v1sit0r.ru", true },
- { "v2bv.net", true },
- { "v2c.tech", true },
- { "v2cn.win", true },
- { "v2ex.com", true },
- { "v2x.sk", true },
- { "v3025.com", true },
- { "v33v33.com", true },
- { "v36533.com", true },
- { "v36594.com", true },
- { "v44v44.com", true },
- { "v5017.com", true },
- { "v5075.com", true },
- { "v55510.com", true },
- { "v55520.com", true },
- { "v55530.com", true },
- { "v55v55.com", true },
- { "v6004.com", true },
- { "v6021.com", true },
- { "v6170.com", true },
- { "v6350.com", true },
- { "v637.com", true },
- { "v6506.com", true },
- { "v66.ag", true },
- { "v666.ag", true },
- { "v66618.com", true },
- { "v66619.com", true },
- { "v66629.com", true },
- { "v66635.com", true },
- { "v66638.com", true },
- { "v6752.com", true },
- { "v67555.com", true },
- { "v6791.com", true },
- { "v68777.com", true },
- { "v700a.com", true },
- { "v700b.com", true },
- { "v700bb.com", true },
- { "v700cc.com", true },
- { "v700dd.com", true },
- { "v700ee.com", true },
- { "v700w.com", true },
- { "v76555.com", true },
- { "v78555.com", true },
- { "v800b.com", true },
- { "v800d.com", true },
- { "v800e.com", true },
- { "v800f.com", true },
- { "v800k.com", true },
- { "v800n.com", true },
- { "v800w.com", true },
- { "v800y.com", true },
- { "v88.ag", true },
- { "v88158.com", true },
- { "v88299.com", true },
- { "v88559.com", true },
- { "v88656.com", true },
- { "v88799.com", true },
- { "v888.ag", true },
- { "v9037.com", true },
- { "v9821.com", true },
- { "v9823.com", true },
- { "v9831.com", true },
- { "va-reitartikel.com", true },
- { "va.gov", false },
- { "va11hal.la", true },
- { "va1der.ca", true },
- { "vabusinesses.org", true },
- { "vacacionesenlinea.com", true },
- { "vacancyfiller.com", true },
- { "vacati0n.tk", true },
- { "vacontractortraining.com", true },
- { "vacuumpump.co.id", true },
- { "vademekum.com", true },
- { "vadennissanofhiltonheadparts.com", true },
- { "vaeplatform.com", true },
- { "vaew.com", true },
- { "vagabond.fr", true },
- { "vagabondgal.com", true },
- { "vagaerg.com", true },
- { "vagaerg.net", true },
- { "vaganciatechnology.com", true },
- { "vagmour.eu", true },
- { "vagpartsdb.com", true },
- { "vagrantcloud.com", true },
- { "vagrantup.com", true },
- { "vagueetvent.com", true },
- { "vahoshop.cz", true },
- { "vaindil.com", true },
- { "vaioswolke.xyz", false },
- { "vairuok.lt", true },
- { "vakaconsulting.com", true },
- { "vakantiedetective.nl", true },
- { "vakantiehuisschellinkhout.nl", true },
- { "vakantiehuizen-denemarken.nl", true },
- { "vakantienet.nl", true },
- { "vakuutuskanava.fi", true },
- { "valaphee.com", true },
- { "valasi.eu", true },
- { "valcansell.com", true },
- { "valdicass.com", true },
- { "valek.net", true },
- { "valemountchamber.com", true },
- { "valemountmuseum.ca", true },
- { "valenciadevops.me", true },
- { "valencianisme.tk", true },
- { "valencianistas.tk", true },
- { "valeniidemunte.tk", true },
- { "valentin.ml", true },
- { "valentinarosamilia.ch", true },
- { "valentinarosamilia.com", true },
- { "valentinberclaz.com", true },
- { "valentineforpresident.com", true },
- { "valentinesongs.com", true },
- { "valentinritz.com", false },
- { "valeriansaliou.name", true },
- { "valiant.finance", true },
- { "validator.nu", true },
- { "validbrands.com", true },
- { "valika.ee", true },
- { "valimised.ee", true },
- { "valkohattu.fi", true },
- { "valkova.net", true },
- { "valledeleresma.tk", true },
- { "vallei-veluwe.nl", true },
- { "valleyautofair.com", true },
- { "valleyautoloan.com", true },
- { "valleycode.net", true },
- { "valleydalecottage.com.au", true },
- { "valleystories.ga", true },
- { "vallutaja.eu", true },
- { "valokuva-albumi.fi", true },
- { "valordolarblue.com.ar", true },
- { "valordotrabalho.com.br", true },
- { "valorem-tax.ch", false },
- { "valoremtax.ch", false },
- { "valoremtax.com", false },
- { "valorin.net", true },
- { "valorizofficial.com", true },
- { "valsk.is", false },
- { "valskis.lt", true },
- { "valtlai.fi", true },
- { "valtool.uk", true },
- { "valudo.st", true },
- { "valuecashhomes.com", true },
- { "valuecashoffers.com", true },
- { "valuehost.com.br", true },
- { "valuemyhome.co.uk", true },
- { "valuemyhome.uk", true },
- { "valuemywebsite.net", true },
- { "valueng.com", true },
- { "valueseed.net", true },
- { "valuuttamuunnin.com", true },
- { "valverdedelcamino.net", true },
- { "valx.jp", true },
- { "vam-podarok.tk", true },
- { "vamosbets.com", true },
- { "vamosbien.com", true },
- { "vampire-studios.tk", true },
- { "vampire142.fr", true },
- { "vampyrium.net", false },
- { "van11y.net", true },
- { "vanbinnenuit.nl", true },
- { "vancityconcerts.com", true },
- { "vancoevents.com", true },
- { "vancouvercosmeticsurgery.ca", true },
- { "vancouverwatowncar.com", true },
- { "vancouverwebsitedesigns.com", true },
- { "vandalfsen.me", true },
- { "vandenbroeck-usedcars.be", false },
- { "vandeput.be", true },
- { "vanderbiltcisa.org", true },
- { "vanderkley.it", true },
- { "vanderkrieken.org", true },
- { "vandermeer.frl", true },
- { "vanderrijt.nl", false },
- { "vandijkmaatwerk.nl", true },
- { "vandommelenart.com", true },
- { "vandorenscholars.org", true },
- { "vandortbv.nl", true },
- { "vandortgroep.nl", true },
- { "vandrielschoenen.nl", true },
- { "vandyhacks.org", true },
- { "vaneigenkweek.be", true },
- { "vanessarivas.com", true },
- { "vaneurology.com", true },
- { "vangoghcoaching.nl", true },
- { "vangore.de", true },
- { "vanhaos.com", true },
- { "vanhoudt-usedcars.be", false },
- { "vanhoutte.be", false },
- { "vanhove.biz", true },
- { "vanlaanen.com", false },
- { "vanmalland.com", true },
- { "vannaos.net", true },
- { "vanohaker.ru", true },
- { "vanouwerkerk.net", true },
- { "vanspa.vn", true },
- { "vanss.org", true },
- { "vantagepointpreneed.com", true },
- { "vantien.com", true },
- { "vantru.is", true },
- { "vanwa.ch", true },
- { "vanwunnik.com", true },
- { "vape-hit.in", true },
- { "vapecrunch.com", true },
- { "vapeking.co.za", true },
- { "vapekingusa.com", true },
- { "vapensiero.co.uk", true },
- { "vaperion.me", true },
- { "vaperolles.ch", false },
- { "vapesense.co.uk", true },
- { "vapex.pl", true },
- { "vaphone.co", true },
- { "vapingdaily.com", true },
- { "vapor.cloud", false },
- { "varcare.jp", true },
- { "varden.info", true },
- { "vardenafilhcl.gq", true },
- { "vareillefoundation.fr", false },
- { "vareillefoundation.org", false },
- { "varghese.de", true },
- { "variag-group.ru", true },
- { "variag-montazh.ru", true },
- { "varimedoma.com", true },
- { "variomedia.de", true },
- { "varizh.by", true },
- { "varjo.tk", true },
- { "varlex.cl", true },
- { "varshathacker.com", true },
- { "varvy.com", true },
- { "varyrentacar.com", true },
- { "varztupasaulis.com", true },
- { "varztupasaulis.eu", true },
- { "varztupasaulis.lt", true },
- { "varztupasaulis.net", true },
- { "vasastansbygg.se", true },
- { "vascomm.co.id", true },
- { "vase-eroticke-povidky.cz", true },
- { "vasel.de", true },
- { "vasel.eu", true },
- { "vashel.us", true },
- { "vasheradio.tk", true },
- { "vasileruscior.ro", true },
- { "vasilikieleftheriou.com", true },
- { "vaskulitis-info.de", true },
- { "vasports.com.au", true },
- { "vastenotaris.nl", true },
- { "vasyharan.com", true },
- { "vat-eu.com", true },
- { "vat.direct", true },
- { "vatav.tk", true },
- { "vats.im", true },
- { "vattulainen.fi", true },
- { "vauceri.hr", true },
- { "vaughanrisher.com", true },
- { "vault21.net", true },
- { "vault81.de", true },
- { "vaultproject.io", false },
- { "vaur.fr", true },
- { "vave.men", true },
- { "vavel.com", true },
- { "vawebsite.co", true },
- { "vawlt.io", true },
- { "vawomenshealth.com", true },
- { "vaxxwatch.org", true },
- { "vaygren.com", true },
- { "vazovia.com", true },
- { "vazue.com", true },
- { "vb.media", true },
- { "vbazile.com", true },
- { "vbcdn.com", true },
- { "vbestproduct.com", true },
- { "vbestseller.com", true },
- { "vbh2o.com", true },
- { "vbsoft.cz", true },
- { "vbwinery.com", true },
- { "vc.gg", false },
- { "vcam.org", true },
- { "vccmurah.net", true },
- { "vcelin-na-doliku.cz", true },
- { "vcf.gov", true },
- { "vch.moe", true },
- { "vchelyabinske.tk", true },
- { "vcientertainment.com", false },
- { "vcm.ru", true },
- { "vcmi.download", true },
- { "vcps.com", true },
- { "vcsjones.codes", true },
- { "vcsjones.com", true },
- { "vcti.cloud", true },
- { "vctor.net", true },
- { "vczk.me", true },
- { "vd42.net", true },
- { "vda.li", true },
- { "vdanker.net", true },
- { "vdbongard.com", true },
- { "vdcomp.cz", false },
- { "vdesc.com", true },
- { "vdio.com", true },
- { "vdisk24.de", true },
- { "vdlp.nl", true },
- { "vdmeij.com", true },
- { "vdownloader.com", true },
- { "ve.search.yahoo.com", false },
- { "ve3oat.ca", true },
- { "veblr.com", false },
- { "vecchiofornobarletta.it", true },
- { "vecerkaracing.cz", true },
- { "vechainstats.com", true },
- { "vecherka.tk", true },
- { "vecozo.nl", true },
- { "vectomatic.org", true },
- { "vector.solutions", true },
- { "vectormagnetics.com", true },
- { "vectortrack.com.au", true },
- { "vectorwish.com", true },
- { "vedma-praktik.com", true },
- { "veg-leiden.nl", true },
- { "veg.lv", true },
- { "vega-rumia.com.pl", true },
- { "vega-rumia.pl", true },
- { "vegalitarian.org", true },
- { "vegan-pratique.fr", true },
- { "veganism.co.uk", true },
- { "veganism.com", true },
- { "veganmasterrace.com", true },
- { "veganrecipereviews.com", true },
- { "vegasluxuryestates.com", true },
- { "vegavio.com", true },
- { "vegekoszyk.pl", true },
- { "vegetalvalley.org", true },
- { "vegetariantokyo.net", true },
- { "vegetarier-sind-moerder.tk", true },
- { "veggie-einhorn.de", true },
- { "vegguide.org", true },
- { "vegoresto.fr", true },
- { "vegtelenchat.tk", true },
- { "vehiclematsuk.com", true },
- { "vehicletransportservices.co", true },
- { "veii.de", true },
- { "veil-framework.com", true },
- { "veilofsecurity.com", true },
- { "veincenterbrintonlake.com", true },
- { "veit.zone", true },
- { "vejersferie.de", true },
- { "vejersferie.dk", true },
- { "vektlofting.tk", true },
- { "velacartagena.tk", true },
- { "velassoltas.pt", true },
- { "velen.io", true },
- { "velib.com", true },
- { "veliovgroup.com", true },
- { "vellingetaxi.se", true },
- { "veloroute.hamburg", true },
- { "velosipedi.tk", true },
- { "velvetia.no", true },
- { "vemtorcer.com", true },
- { "venclave.com", true },
- { "vendermicasarapido.com.mx", true },
- { "vendi.it", true },
- { "vendigital.com", true },
- { "venditorepoa.com.br", true },
- { "vendorconnect.nyc", true },
- { "vendreacheter.be", true },
- { "vendreacheter.net", true },
- { "veneerssandiego.com", true },
- { "venenum.org", true },
- { "venetkaarsenovart.com", true },
- { "venev.name", true },
- { "venezianischemasken.com", true },
- { "vengriya.tk", true },
- { "venje.pro", true },
- { "venlafaxine.gq", true },
- { "venmail.net", true },
- { "venstar.com", true },
- { "ventajasdesventajas.com", true },
- { "ventassantillan.com", true },
- { "ventesprivees-fr.com", true },
- { "venti-athens.gr", true },
- { "ventilateurs-plafond.com", true },
- { "ventizo.com", true },
- { "ventriloservers.biz", true },
- { "venturum.com", true },
- { "venturum.de", true },
- { "venturum.eu", true },
- { "venturum.net", true },
- { "venuedriver.com", true },
- { "venusbeautyproducts.in", true },
- { "venzagroup.com", true },
- { "veply.com", true },
- { "ver.ma", true },
- { "veramagazine.jp", true },
- { "verasani.ch", true },
- { "verasani.com", true },
- { "verberne.nu", true },
- { "verbier-lechable.com", true },
- { "verbmaestro.com", true },
- { "verboom.co.nz", true },
- { "verbzilla.com", true },
- { "verdensflag.dk", true },
- { "verdict.gg", true },
- { "verduccies.com", true },
- { "verdugosxerecistas.tk", true },
- { "veredadelaestrella.tk", true },
- { "verein-kiekin.de", true },
- { "verein-zur-pflege-der-geselligkeit.de", true },
- { "vereinlandwege.de", true },
- { "vereinscheck.de", true },
- { "verfassungsklage.at", true },
- { "verge.capital", true },
- { "vergelijksimonly.nl", true },
- { "veri2.com", true },
- { "verifalia.com", true },
- { "verified.eu", true },
- { "verifiedjoseph.com", true },
- { "verifiny.com", true },
- { "verifygroup.com", true },
- { "verifyos.com", true },
- { "verifyyourip.com", true },
- { "veriny.tf", true },
- { "veriomed.com", true },
- { "veritafineviolins.com", true },
- { "veritas-data.de", true },
- { "veritasinvestmentwealth.com", true },
- { "verizonconnect.com", false },
- { "verizonguidelines.com", true },
- { "verkeersschoolrichardschut.nl", true },
- { "verlag-lq.at", true },
- { "verlag-lq.ch", true },
- { "verlag-lq.com", true },
- { "verlag-lq.de", true },
- { "verlag-lq.net", true },
- { "verlagdrkovac.de", false },
- { "verlaglq.com", true },
- { "verliebt-in-bw.de", true },
- { "verliebt-in-niedersachsen.de", true },
- { "verliefde-jongens.nl", true },
- { "verloskundigepraktijktolmiea.nl", true },
- { "vermeerdealers.com", true },
- { "vermiliontaxiservice.com", true },
- { "vermuetje.nl", true },
- { "vernaeve-usedcars.be", false },
- { "vernis-marins.com", true },
- { "vernonatvclub.ca", true },
- { "vernonfigureskatingclub.com", true },
- { "vernonfilmsociety.bc.ca", true },
- { "vernonsecureselfstorage.ca", true },
- { "vernonspeedskatingclub.com", true },
- { "vernonwintercarnival.com", true },
- { "veronic.hu", true },
- { "veronique-schmitz.de", true },
- { "verrerie-mousseline.org", false },
- { "verry.org", true },
- { "vers.one", true },
- { "versagercloud.de", true },
- { "versbesteld.nl", true },
- { "verschoren.com", true },
- { "verschurendegroot.nl", true },
- { "verses.space", true },
- { "versicherungen-blog.net", true },
- { "versicherungen-werner-hahn.de", true },
- { "verspai.de", true },
- { "verstka.cf", true },
- { "verstraetenusedcars.be", false },
- { "vertebrates.com", true },
- { "verteilergetriebe.info", true },
- { "verticesedge.com", true },
- { "verticrew.com", true },
- { "vertigo-rec.com", true },
- { "vertigo.name", false },
- { "vertner.net", true },
- { "vertretungsplan.io", true },
- { "vertrieb-strategie.de", true },
- { "vervewellness.co.nz", true },
- { "verwandlung.org", true },
- { "verwayen.com", true },
- { "verwimp.org", true },
- { "very-kids.fr", true },
- { "veryapt.com", true },
- { "verybin.com", true },
- { "verymelon.de", true },
- { "verymetal.nl", true },
- { "veryswing.com", true },
- { "verzekeringencambier.be", true },
- { "verzekeringsacties.nl", true },
- { "ves.vn.ua", true },
- { "vesaviljanen.fi", true },
- { "vescudero.net", true },
- { "veslosada.com", true },
- { "vespacascadia.com", true },
- { "vestd.com", true },
- { "vestibtech.com", true },
- { "vestingbar.nl", true },
- { "vestlundbolargen.tk", true },
- { "vestum.ru", true },
- { "vet4life.co.uk", true },
- { "vetbits.com", false },
- { "vetcard.info", true },
- { "veteranreservecorps.com", true },
- { "veterinario.milano.it", true },
- { "veterinario.roma.it", true },
- { "veterinarioaltea.com", true },
- { "veterinary-colleges.com", true },
- { "veteriner.name.tr", true },
- { "vetforum.co", true },
- { "vetinte.eu", true },
- { "vetnet.info", true },
- { "veto.fish", true },
- { "vetofish.com", true },
- { "vets.gov", true },
- { "vettenburg.eu", true },
- { "vetustainversion.com", true },
- { "veverusak.cz", true },
- { "vfdworld.com", true },
- { "vfmc.vic.gov.au", true },
- { "vgcheat.com", true },
- { "vgerak.com", true },
- { "vglist.co", true },
- { "vgolos.zt.ua", true },
- { "vgorcum.com", true },
- { "vgropp.de", true },
- { "vh.net", true },
- { "vhrca.com", true },
- { "vhs-bad-wurzach.de", true },
- { "vhummel.nl", true },
- { "via-shire-krug.ru", true },
- { "via.blog.br", true },
- { "viablog.com.br", true },
- { "viacation.co", true },
- { "viacdn.org", true },
- { "viafinance.cz", false },
- { "viaggio-in-cina.it", true },
- { "viajandoporelmundo.com.ar", true },
- { "viajaramsterdam.com", true },
- { "viaje-a-china.com", true },
- { "vialibido.com.br", true },
- { "viantours.com", true },
- { "viaprinto.de", true },
- { "viasinc.com", false },
- { "vibgyyor.com", true },
- { "vibrant-america.com", true },
- { "vibrato1-kutikomi.com", true },
- { "vicenez.agency", true },
- { "vicentee.com", true },
- { "vichiya.com", true },
- { "vician.cz", true },
- { "vicianovi.cz", true },
- { "vicicode.com", true },
- { "vicious.space", true },
- { "vicjuwelen-annelore.be", true },
- { "victora.com", true },
- { "victorblomberg.se", true },
- { "victorcanera.com", true },
- { "victorcarrasco.tk", true },
- { "victorcarwasher.com", true },
- { "victorfiller.com", true },
- { "victorgbustamante.com", true },
- { "victorhawk.com", true },
- { "victorhorta.tk", true },
- { "victoriaartist.ru", true },
- { "victoriastudio.ru", true },
- { "victorjacobs.com", false },
- { "victornet.de", true },
- { "victorpelletmill.com", true },
- { "victorricemill.com", true },
- { "victorunix.com", true },
- { "victory.radio", true },
- { "victoryalliance.us", true },
- { "vicugna.nl", true },
- { "vicyu.com", true },
- { "vid-immobilien.de", true },
- { "vidady.com", true },
- { "vidarity.com", true },
- { "vidasanayfitness.com", true },
- { "vidassemfronteiras.com", true },
- { "vidbooster.com", false },
- { "vide-greniers.org", false },
- { "video-adult-clips-mobile.com", true },
- { "videobrochuresmarketing.com", true },
- { "videogamecoupons.com", true },
- { "videogamer.com", true },
- { "videogamesartwork.com", true },
- { "videojuegos.com", true },
- { "videokaufmann.at", true },
- { "videolabsinc.com", true },
- { "videomail.io", true },
- { "videopornoitaliana.com", true },
- { "videoseriesbiblicas.com", true },
- { "videoseyredin.net", true },
- { "videosjust.work", true },
- { "videoskaseros.com", true },
- { "videosparatodos.com", true },
- { "videospornogratis.pt", true },
- { "videosqr.com", true },
- { "videosxgays.com", true },
- { "videoueberwachung-set.de", true },
- { "videownload.com", true },
- { "videozv.tk", true },
- { "vidiobokep.xyz", true },
- { "vidiproject.com", true },
- { "vidister.de", true },
- { "vieaw.com", true },
- { "vieclam24h.vn", false },
- { "viekelis.lt", false },
- { "viemeister.com", true },
- { "viemontante.be", false },
- { "viennadancecrew.at", true },
- { "viepixel.at", true },
- { "vierpfeile.de", true },
- { "vierpluseins.wtf", true },
- { "vietnam-tours.tk", true },
- { "vietnamese.dating", true },
- { "vietnamluxurytravelagency.com", true },
- { "vietnamphotoblog.com", false },
- { "vietnamwomenveterans.org", true },
- { "view-page-source.com", true },
- { "viewbook.com", true },
- { "viewbykrian.com", true },
- { "viewing.nyc", true },
- { "viewmythoughts.com", true },
- { "vifsoft.com", true },
- { "vigilanciaysalud.com", true },
- { "vigilantnow.com", true },
- { "vigira.com.ar", true },
- { "vigliano.ovh", true },
- { "vignaud.fr", true },
- { "vignoblesdeletat.ch", true },
- { "vigo-krankenversicherung.de", true },
- { "vigo-tarife.de", true },
- { "vigorspa.it", true },
- { "vigoxatelier.tech", true },
- { "vigrey.com", true },
- { "vijay-international.com", true },
- { "vijoe.org", true },
- { "vijverbenodigdheden.nl", true },
- { "vik.im", true },
- { "vikalbino.com.br", true },
- { "vikalpgupta.com", true },
- { "vikapaula.com", true },
- { "vikashkumar.me", true },
- { "vikaviktoria.com", true },
- { "viking-style.ru", true },
- { "vikings.net", true },
- { "vikramkulkarni.com", true },
- { "viktorbarzin.me", true },
- { "viktorprevaric.eu", true },
- { "viku.fi", true },
- { "vila-eden.cz", true },
- { "vildlaithailand.cf", true },
- { "viljatori.fi", true },
- { "villa-eden.cz", true },
- { "villa-gockel.de", true },
- { "villa-romantica-zillertal.at", true },
- { "villablino.tk", true },
- { "villadelprado.tk", true },
- { "villafiore.com.br", true },
- { "villagecardshop.co.uk", true },
- { "villagecenterpediatrics.com", true },
- { "villagenscamuria.it", true },
- { "villageunique.com.br", true },
- { "villagockel.de", true },
- { "villakarma.at", true },
- { "villalmanzo.tk", true },
- { "villamariaamalfi.it", true },
- { "villasfinistere.fr", true },
- { "villasforsale-bali.com", true },
- { "villasoasissanur.com", true },
- { "villavaltava.fi", true },
- { "ville-aime.fr", true },
- { "villehardouin.fr", true },
- { "villek.fi", true },
- { "villekaaria.eu", true },
- { "villenavedornon.fr", true },
- { "villenvinkit.com", true },
- { "villerez.fr", true },
- { "villesalonen.fi", true },
- { "villu.ga", true },
- { "vilnagaon.com", true },
- { "viltsu.net", true },
- { "vim.cx", true },
- { "vima.ch", false },
- { "vimeo.com", true },
- { "vinagro.sk", true },
- { "vinahost.vn", true },
- { "vinarstvimodryhrozen.cz", true },
- { "vincent-haupert.de", true },
- { "vincentcox.com", false },
- { "vincentpancol.com", true },
- { "vincentwathelet.be", true },
- { "vincible.space", true },
- { "vinciladislessia.it", true },
- { "vincitraining.com", true },
- { "vinco.ch", true },
- { "vindafrid.com", true },
- { "vindafrid.nu", true },
- { "vindafrid.se", true },
- { "vindipoker.dk", true },
- { "vinetech.co.nz", true },
- { "vinhodragao.com.br", true },
- { "vinicius.sl", true },
- { "vinifriuli.sk", true },
- { "vinigas.com", true },
- { "vinistas.com", true },
- { "vinit.tk", true },
- { "vinktwebdesign.nl", false },
- { "vinmmo.com", true },
- { "vinner.com.au", true },
- { "vinnyandchristina.com", true },
- { "vinnyvidivici.com", true },
- { "vinodoc.cz", true },
- { "vinokurov.tk", true },
- { "vinoshipper.com", true },
- { "vinovum.net", true },
- { "vinsation.com", true },
- { "vintagebandfestival.org", true },
- { "vintagecarparts.co.uk", true },
- { "vintagecaskandbarrel.com", true },
- { "vintagejeeps.net", true },
- { "vintagemakeupguide.com", true },
- { "vintageportgifts.co.uk", true },
- { "vintagesouthernpicks.com", true },
- { "vintagetrailerbuyers.com", true },
- { "vinticom.ch", false },
- { "vinzite.com", true },
- { "violarenate.com", true },
- { "violetraven.co.uk", true },
- { "violin4fun.nl", true },
- { "vionicbeach.com", true },
- { "vionicshoes.co.uk", true },
- { "vionicshoes.com", true },
- { "vip-moda.ga", true },
- { "vip.de", true },
- { "vip00228.com", false },
- { "vip11018.com", false },
- { "vip22884.com", false },
- { "vip22994.com", false },
- { "vip77018.com", false },
- { "vip918.net", true },
- { "vipam8.com", true },
- { "vipd88.net", true },
- { "vipf88.com", true },
- { "vipfitter.com", true },
- { "viphackers.tk", true },
- { "viplc0.com", true },
- { "viplc08.com", true },
- { "viplc1.com", true },
- { "viplc2.com", true },
- { "viplc3.com", true },
- { "viplc4.com", true },
- { "viplc5.com", true },
- { "viplc6.com", true },
- { "viplc66.net", true },
- { "viplc68.com", true },
- { "viplc7.com", true },
- { "viplc98.com", true },
- { "vipllcnj.com", true },
- { "viporiflame.tk", true },
- { "vippclub.be", true },
- { "vips.pl", true },
- { "viptamin.eu", true },
- { "viptamol.com", true },
- { "vipw66.com", true },
- { "vipw6608.com", true },
- { "vir-tec.eu", false },
- { "vir.vn", true },
- { "vir2.me", true },
- { "viraljobs.ga", true },
- { "viraloffer.ga", true },
- { "viralpop.it", false },
- { "viralted.ml", true },
- { "viralvids.gq", true },
- { "virgontech.tk", true },
- { "virgopolymer.com", true },
- { "viridis-milites.cz", true },
- { "viris.si", true },
- { "virite.net", true },
- { "virtit.fr", true },
- { "virtualbrestby.tk", true },
- { "virtualcitehuallaga.com", true },
- { "virtualcloud.ddns.net", true },
- { "virtualcommodities.org", true },
- { "virtualcomputer.ml", true },
- { "virtuality4d.com", true },
- { "virtuallifestyle.nl", true },
- { "virtualmemento.tk", true },
- { "virtualmt2.pl", true },
- { "virtualsanity.com", true },
- { "virtualspeech.com", true },
- { "virtualvaults.com", true },
- { "virtubox.net", true },
- { "virtuebags.com", true },
- { "virtueinfo.com", true },
- { "virtuewisdomfund.com", true },
- { "virtus-group.com", true },
- { "virtusaero.com", true },
- { "virvum.ch", true },
- { "visalist.io", true },
- { "visalogy.com", true },
- { "visaop.com", true },
- { "visapourailleurs.fr", false },
- { "visarewardprogramplatform.com", true },
- { "visartdecor.com.ua", true },
- { "visatitans.ae", true },
- { "visatitans.ca", true },
- { "visatitans.com", true },
- { "visaya.com.co", true },
- { "viscoelastico.com.br", true },
- { "viscopic.com", true },
- { "viseum.co.uk", true },
- { "vishwashantiyoga.com", true },
- { "visibox.nl", true },
- { "visikom.de", true },
- { "visiondetails.ru", true },
- { "visionduweb.fr", true },
- { "visionexpress.com", true },
- { "visionexpresscareers.com", true },
- { "visionnissancanandaiguaparts.com", true },
- { "visionofcolour.com", true },
- { "visionviral.com", true },
- { "visionxcreative.gq", true },
- { "visit-montenegro.com", true },
- { "visit-thailand.tk", true },
- { "visitbeulah.com", true },
- { "visitcambridgeshirefens.org", true },
- { "visiter-tunis.tk", true },
- { "visitkangaroovalley.com.au", true },
- { "visitmaine.com", true },
- { "visitorguard.com", true },
- { "visitorslist.com", true },
- { "visor.ph", true },
- { "vista-calculator.ru", false },
- { "vista-research-group.com", true },
- { "vistacampus.gov", true },
- { "vistastylebuilder.com", false },
- { "vistb.me", true },
- { "vistec-support.de", true },
- { "visual-cockpit.com", true },
- { "visual-concept.net", true },
- { "visual-design.cf", true },
- { "visualgnome.com", true },
- { "visualideas.org", true },
- { "visualizing.info", true },
- { "visualmarketingdeals.com", true },
- { "visualmasters.nl", true },
- { "visualproyectos.co", true },
- { "visudira.com", true },
- { "visuri.de", true },
- { "visvolunteers.com", true },
- { "vitahook.pw", true },
- { "vital-tel.co.uk", true },
- { "vitalastin-sport.de", true },
- { "vitalia.cz", true },
- { "vitalismaatjes.nl", true },
- { "vitalium-therme.de", true },
- { "vitaliyshepotkov.tk", true },
- { "vitalthrills.com", true },
- { "vitalware.com", true },
- { "vitalyzhukphoto.com", true },
- { "vitamina.cl", true },
- { "vitamina.com", true },
- { "vitaminler.com", true },
- { "vitaminmovie.ga", true },
- { "vitastic.nl", true },
- { "vitavista.health", true },
- { "vitkausk.as", true },
- { "vitkutny.cz", true },
- { "vitlproducts.com", true },
- { "vitra-showrooms.co.uk", true },
- { "vitrado.de", true },
- { "vitsoft.by", true },
- { "vitzro.kr", true },
- { "viva2000.com", true },
- { "vivaio.roma.it", true },
- { "vivaldi.club", true },
- { "vivaldi.com", true },
- { "vivaldi.net", true },
- { "vivatv.com.tw", true },
- { "vive.link", true },
- { "vivemedialab.com", true },
- { "vivendi.de", true },
- { "viveport.biz", true },
- { "viveport.co", true },
- { "viveport.com", true },
- { "viveport.io", true },
- { "viveport.life", true },
- { "viveportal.com", true },
- { "viveportchina.com", true },
- { "vivesaludableconomnilife.com", true },
- { "vivianadavila.com", true },
- { "vivid-academy.com", true },
- { "vividinflatables.co.uk", true },
- { "viviennevandenbos.nl", true },
- { "vivirenelmundo.com", true },
- { "vivo.sx", true },
- { "vivo.vn", true },
- { "vivoitaliankitchen.com", true },
- { "vivy.com", true },
- { "vixrapedia.org", true },
- { "viyf.org", true },
- { "vize.ai", false },
- { "vizija-nepremicnine.si", true },
- { "vizionnetwork.co.uk", true },
- { "vizzboard.com", true },
- { "vjeff.com", true },
- { "vjeff.net", true },
- { "vjhfoundation.org", true },
- { "vjpatel.me", true },
- { "vk-k.com", true },
- { "vkarpaty.tk", true },
- { "vkino.com", false },
- { "vkox.com", true },
- { "vksportphoto.com", true },
- { "vkstream.tk", true },
- { "vladimir-chanaev.pro", true },
- { "vladimir.ml", true },
- { "vladimiroff.org", true },
- { "vladislavstoyanov.com", true },
- { "vlaggen-landen.nl", true },
- { "vlakem.net", true },
- { "vlamir.dynu.net", true },
- { "vlcentre.org", true },
- { "vleesbesteld.nl", true },
- { "vleij.com", false },
- { "vleij.se", true },
- { "vliegensvlug.online", true },
- { "vliegensvlug.services", true },
- { "vlndc.org", true },
- { "vloeck.de", true },
- { "vlovgr.se", true },
- { "vm-0.com", true },
- { "vm-co.ch", false },
- { "vm0.eu", true },
- { "vmagz.ir", true },
- { "vmautorajkot.com", true },
- { "vmf365.tk", true },
- { "vmgirls.com", true },
- { "vmhydro.ru", false },
- { "vmis.nl", true },
- { "vmoe.info", true },
- { "vmug.pl", true },
- { "vn.search.yahoo.com", false },
- { "vnctdj.fr", true },
- { "vnd.cloud", true },
- { "vndb.org", true },
- { "vneftekamske.tk", true },
- { "vnfs-team.com", true },
- { "vnministries.org", true },
- { "vnology.com", true },
- { "vnovosibirske.tk", true },
- { "vns377a.com", true },
- { "vns377b.com", true },
- { "vns377c.com", true },
- { "vns377d.com", true },
- { "vns377e.com", true },
- { "vns377f.com", true },
- { "vns377g.com", true },
- { "vns377h.com", true },
- { "vns377i.com", true },
- { "vns377j.com", true },
- { "vns89386.com", true },
- { "vnsr112233.com", true },
- { "vnvisa.center", true },
- { "vnvisa.ru", true },
- { "vocaloid.my", true },
- { "vocalviews.com", true },
- { "vocationnetwork.org", true },
- { "vocescruzadasbcs.mx", true },
- { "vocus.aero", true },
- { "vocustest.aero", true },
- { "voda.org.ru", true },
- { "vodb.me", true },
- { "vodb.org", true },
- { "vodicak.info", true },
- { "vodicaknapocitac.sk", true },
- { "voetbalclubinfo.tk", true },
- { "voevm.at", true },
- { "vogelbus.ch", true },
- { "vogler.name", true },
- { "vogue.cz", true },
- { "voice-of-design.com", true },
- { "voicebrew.com", true },
- { "voicr.nl", true },
- { "voicu.ch", false },
- { "void.to", true },
- { "voidancerecords.com", true },
- { "voidbot.ai", true },
- { "voidcore.org", true },
- { "voidma.in", true },
- { "voidpay.com", true },
- { "voidptr.eu", true },
- { "voidshift.com", true },
- { "voipdigit.nl", true },
- { "voipsun.com", true },
- { "voix-bien-etre.com", true },
- { "vojtechpavelka.cz", true },
- { "vokativy.cz", true },
- { "vokeapp.com", true },
- { "volatile.pw", true },
- { "volatilesystems.org", true },
- { "volatilethunk.com", true },
- { "volchara.tk", true },
- { "volga.us", true },
- { "volgavibes.ru", false },
- { "voliere-info.nl", false },
- { "volker-gropp.de", true },
- { "volkergropp.de", true },
- { "volkerwesselstransfer.nl", false },
- { "vollans.id.au", true },
- { "voloevents.com", true },
- { "voloskova.ru", true },
- { "voltahurt.pl", true },
- { "volto.io", true },
- { "volubilisplus.fr", true },
- { "volunteeringmatters.org.uk", true },
- { "volvipress.gr", true },
- { "volvoconnect.com", true },
- { "vomitb.in", true },
- { "vonauw.com", false },
- { "vonborstelboerner.de", false },
- { "vonimus.com", true },
- { "vonkuenheim.de", true },
- { "vonniehudson.com", true },
- { "vontainment.com", true },
- { "voodoochile.at", true },
- { "voodoocomedy.com", true },
- { "voodooshaman.com", true },
- { "voolik.pw", true },
- { "voordeuren-opmaat.nl", true },
- { "voorjou.com", true },
- { "vop.li", true },
- { "vorbrodt.blog", true },
- { "vorkbaard.nl", true },
- { "vorlage-musterbriefe.de", true },
- { "vorlage-mustervertrag.de", true },
- { "vorlagen-geburtstagsgruesse.de", true },
- { "vorlicek.de", true },
- { "vorm2.com", true },
- { "vorodevops.com", true },
- { "vorsco.com", true },
- { "vos-systems.com", true },
- { "vos-systems.es", true },
- { "vos-systems.eu", true },
- { "vos-systems.net", true },
- { "vos-systems.org", true },
- { "vosgym.jp", true },
- { "voshod.org", true },
- { "vosky.fr", true },
- { "vosn.de", true },
- { "voss-klinik.com", true },
- { "voss-zaehne.com", true },
- { "voss-zaehne.de", true },
- { "vosselaer.com", true },
- { "vosser.de", true },
- { "vostronet.com", true },
- { "vote2019.appspot.com", true },
- { "votemate.org", true },
- { "voter-info.uk", true },
- { "votesandymurman.com", true },
- { "votocek.cz", true },
- { "votockova.cz", true },
- { "votoot.com", true },
- { "votre-avenir.com", true },
- { "votre-hotel.com", true },
- { "vouchinsurance.sg", true },
- { "vovkamagazine.tk", true },
- { "vovladikavkaze.ru", true },
- { "vox.de", true },
- { "voxfilmeonline.net", true },
- { "voxml.com", true },
- { "voxographe.com", false },
- { "voxpopuli.com", true },
- { "voyage-martinique.fr", true },
- { "voyageforum.com", true },
- { "voyageofyume.com", true },
- { "voyagesaufildespages.be", false },
- { "voyageschine.com", true },
- { "voyagesdetective.fr", true },
- { "voyagewonders.com", true },
- { "vozhatik.cf", true },
- { "vpc-display.com", true },
- { "vpinball.com", true },
- { "vpn.black", true },
- { "vpn.ht", true },
- { "vpnpro.com", true },
- { "vpnservice.nl", true },
- { "vponline.com.br", true },
- { "vprotect.ga", true },
- { "vpsboard.com", true },
- { "vpsdream.dk", true },
- { "vpsport.ch", true },
- { "vpsrussia.com", true },
- { "vpsvz.co.uk", true },
- { "vpsvz.com", true },
- { "vpsvz.io", true },
- { "vpsvz.net", true },
- { "vpswebs.tk", true },
- { "vqcymsa.com", true },
- { "vqebizconsulting.com", true },
- { "vqeg.org", true },
- { "vractive.pl", true },
- { "vragenvanproust.nl", true },
- { "vrandopulo.ru", true },
- { "vrba.org", true },
- { "vrcinvestigations.com", true },
- { "vrcprofile.com", true },
- { "vreeman.com", true },
- { "vremyachko.tk", true },
- { "vremyapervyih-hd.tk", true },
- { "vretmaskin.se", true },
- { "vreviewbestseller.com", true },
- { "vriesdonkow.be", false },
- { "vrifox.cc", true },
- { "vrij-links.nl", true },
- { "vrijgezellen-feest.com", true },
- { "vrijgezellenfeestzwolle.com", true },
- { "vrikshamindia.com", true },
- { "vrjetpackgame.com", true },
- { "vrlaid.com", false },
- { "vroedvrouwella.be", true },
- { "vrostove.tk", true },
- { "vroyaltours.com", true },
- { "vrsystem.com.br", true },
- { "vrtak-cz.net", true },
- { "vs106.com", true },
- { "vs107.com", true },
- { "vs301.com", true },
- { "vs302.com", true },
- { "vs303.com", true },
- { "vs313.com", true },
- { "vs601.com", true },
- { "vs603.com", true },
- { "vs677.com", true },
- { "vs680.com", true },
- { "vsactivity.com", true },
- { "vsaratove.tk", true },
- { "vscale.io", true },
- { "vscm888.com", true },
- { "vscodownloader.net", true },
- { "vsd.sk", true },
- { "vse-potolki.ml", true },
- { "vsean.net", true },
- { "vseomedia.com", false },
- { "vserus.com", true },
- { "vserver-preis-vergleich.de", true },
- { "vsesrazu-raiffeisen.ru", true },
- { "vsestiralnie.com", true },
- { "vsestoki.com", true },
- { "vsl.de", true },
- { "vsoy.co.th", true },
- { "vspin.cz", true },
- { "vsportage.com", true },
- { "vssnederland.nl", true },
- { "vstavropole.tk", true },
- { "vsund.de", true },
- { "vsx.ch", true },
- { "vtaxi.se", true },
- { "vtbs.moe", true },
- { "vthebest9.com", true },
- { "vtt-hautsdefrance.fr", true },
- { "vttnordisere.fr", true },
- { "vtuber.land", true },
- { "vtul.io", true },
- { "vtupro.com", true },
- { "vuakhuyenmai.vn", true },
- { "vubey.yt", true },
- { "vuelacaruru.com", true },
- { "vuilelakens.be", true },
- { "vulcancycling.ga", true },
- { "vuldb.com", true },
- { "vulgar-teens.tk", true },
- { "vuljespaarpot.nl", true },
- { "vulndetect.com", true },
- { "vulnerability.ch", true },
- { "vulners.com", true },
- { "vulns.sexy", true },
- { "vulnscan.org", true },
- { "vulpine.club", true },
- { "vulpr.com", true },
- { "vulyk-medu.com.ua", true },
- { "vunn.com", true },
- { "vuotila.eu", true },
- { "vuvanhon.com", true },
- { "vux.li", true },
- { "vuzi.fr", true },
- { "vv1234.cn", true },
- { "vvactivia.nl", true },
- { "vvave.net", true },
- { "vvdbronckhorst.nl", true },
- { "vvild.at", true },
- { "vvoip.org.uk", true },
- { "vvs.spb.ru", true },
- { "vvvvbrest.tk", true },
- { "vwbusje.com", true },
- { "vwfsrentacar.co.uk", true },
- { "vwh-kunden.de", true },
- { "vwittich.de", true },
- { "vwo.com", false },
- { "vwsoft.de", true },
- { "vwt-event.nl", true },
- { "vx.hn", true },
- { "vxz.me", true },
- { "vybeministry.org", true },
- { "vyber-odhadce.cz", true },
- { "vyberodhadce.cz", true },
- { "vygeja.lt", true },
- { "vyplnto.cz", true },
- { "vysko.cz", true },
- { "vyskocil.eu", true },
- { "vysokoe.tk", true },
- { "vytea.com", true },
- { "vyvod-iz-zapoya.online", true },
- { "vyvygen.org", true },
- { "vyzner.cz", true },
- { "vz.al", true },
- { "vzemisite.com", true },
- { "vzis.org", true },
- { "w-architectes.com", true },
- { "w-p-k.de", true },
- { "w-spotlight.appspot.com", true },
- { "w-surgeryhospital.com", true },
- { "w-w-auto.de", true },
- { "w.wiki", true },
- { "w00228.com", false },
- { "w0102.com", true },
- { "w0185.com", true },
- { "w0191.com", true },
- { "w0195.com", true },
- { "w0198.com", true },
- { "w0202w.com", true },
- { "w1717w.com", true },
- { "w1n73r.de", true },
- { "w2design.eu", true },
- { "w2n.me", true },
- { "w3330.com", true },
- { "w365.vip", true },
- { "w36533.com", true },
- { "w36594.com", true },
- { "w3app.nl", true },
- { "w3ctag.org", true },
- { "w3n14izy.cf", true },
- { "w3n14izy.ga", true },
- { "w3n14izy.ml", true },
- { "w3n14izy.tk", true },
- { "w3punkt.de", true },
- { "w4.no", true },
- { "w4040w.com", true },
- { "w4eg.de", true },
- { "w4nvu.org", true },
- { "w4tec.de", true },
- { "w50.co.uk", false },
- { "w5050w.com", true },
- { "w567567.com", true },
- { "w5gfe.org", true },
- { "w61516.com", true },
- { "w61616.com", true },
- { "w66136.com", true },
- { "w66161.com", true },
- { "w661616.com", true },
- { "w6619.com", true },
- { "w66191.com", true },
- { "w663w.com", true },
- { "w6648.com", true },
- { "w666.ag", true },
- { "w66655.com", true },
- { "w66828.com", true },
- { "w668686.com", true },
- { "w668866.net", true },
- { "w668899.com", true },
- { "w668989.com", true },
- { "w66918.com", true },
- { "w66hao.net", true },
- { "w66w66.com", true },
- { "w678678.com", true },
- { "w682w.com", true },
- { "w6969.com", true },
- { "w7355.com", true },
- { "w789789.com", true },
- { "w7k.de", true },
- { "w8093.com", true },
- { "w8094.com", true },
- { "w81818.com", true },
- { "w8605.com", true },
- { "w8609.com", true },
- { "w8620.com", true },
- { "w8626.com", true },
- { "w8628.com", true },
- { "w888.ag", true },
- { "w888022.com", true },
- { "w888033.com", true },
- { "w888044.com", true },
- { "w888077.com", true },
- { "w888088.com", true },
- { "w888099.com", true },
- { "w889-line.com", true },
- { "w889-line.net", true },
- { "w889889.com", true },
- { "w889889.net", true },
- { "w889vip.com", true },
- { "w88info.com", true },
- { "w88info.win", true },
- { "w88xinxi.com", true },
- { "w8less.nl", true },
- { "w9196.com", true },
- { "wa-stromerzeuger.de", false },
- { "wa.io", true },
- { "wa.me", true },
- { "waalderhofje.nl", true },
- { "waaw.tv", true },
- { "wabatam.com", true },
- { "wacky.one", true },
- { "wadidi.com", true },
- { "wadsworth.gallery", true },
- { "waehlefamilie.de", true },
- { "waelisch.de", true },
- { "waelti.xxx", true },
- { "waermekabine.org", true },
- { "waf.ninja", true },
- { "waf.sexy", true },
- { "waffenversand-klausing.de", true },
- { "wafuton.com", true },
- { "wagenmanswonen.nl", true },
- { "wageverify.com", true },
- { "wagonyard.com", true },
- { "wagyu-bader.de", true },
- { "wahlen-bad-wurzach.de", true },
- { "wahrnehmungswelt.de", true },
- { "wahrnehmungswelten.de", true },
- { "waidfrau.de", true },
- { "waifu-technologies.moe", true },
- { "waifu.space", true },
- { "waigel.org", true },
- { "wail.net", true },
- { "waimanu.io", true },
- { "waits.io", true },
- { "waiwaisw.com", true },
- { "wajs1.com", true },
- { "wajs2.com", true },
- { "wak.io", true },
- { "waka-mono.com", true },
- { "wakamiyasumiyosi.com", true },
- { "wakandasun.com", true },
- { "wakatime.com", true },
- { "wakf123.com", true },
- { "wakf123.net", true },
- { "wakf456.com", true },
- { "wakf456.net", true },
- { "wakhanyeza.org", true },
- { "wakiminblog.com", true },
- { "wala-floor.de", true },
- { "waldgourmet.de", true },
- { "waldvogel.family", true },
- { "walent.in", true },
- { "waligorska.pl", true },
- { "walk.onl", true },
- { "walkera-fans.de", true },
- { "walkhighlandsandislands.com", true },
- { "walkhisway.co.za", true },
- { "walkingandcycling.org.uk", true },
- { "walkingrehabilitation.com", true },
- { "walkman.cloud", true },
- { "walkman.io", true },
- { "walksedona.com", true },
- { "walksfourpaws.co.uk", true },
- { "wallabet.fr", true },
- { "wallabies.org", true },
- { "wallace-group.net", true },
- { "wallacehigh.org.uk", true },
- { "wallet.google.com", true },
- { "walletconnector.cz", true },
- { "walletnames.com", true },
- { "wallinger-online.at", false },
- { "wallingford.cc", true },
- { "wallisch.pro", true },
- { "wallmarketing.cz", true },
- { "wallpaperup.com", true },
- { "walls.de", true },
- { "walls.io", true },
- { "wallsauce.com", true },
- { "walltime.info", true },
- { "wallumai.com.au", true },
- { "wallysmasterblaster.com.au", true },
- { "walma.re", true },
- { "walnus.com", true },
- { "walnutgaming.com", true },
- { "walnutis.net", false },
- { "walpu.ski", true },
- { "walpuski.com", true },
- { "walravensax.nl", true },
- { "walruscode.com", true },
- { "walruses.org", true },
- { "walshbanks.com", true },
- { "waltellis.com", true },
- { "walter.lc", true },
- { "waltzmanplasticsurgery.com", true },
- { "wammu.eu", true },
- { "wanda.ch", true },
- { "wandelreizen.eu", true },
- { "wander.al", true },
- { "wandervoll.ch", true },
- { "wanderzoom.co", true },
- { "wandystan.eu", true },
- { "wane.co", true },
- { "wanekat.fr", true },
- { "wangjun.me", true },
- { "wangqiliang.cn", true },
- { "wangqiliang.com", true },
- { "wangqr.org", true },
- { "wangqr.tk", true },
- { "wangriwu.com", true },
- { "wangshengze.com", true },
- { "wangtanzhang.com", true },
- { "wangyue.blog", true },
- { "wangzuan168.cc", true },
- { "wanlieyan.cc", true },
- { "wanlieyan.com", true },
- { "wannapopularnews.cf", true },
- { "wannaridecostarica.com", true },
- { "wantocode.com", true },
- { "wanybug.com", true },
- { "wanyingge.com", true },
- { "waonui.io", true },
- { "wapa.gov", true },
- { "wapazewddamcdocmanui6001.azurewebsites.net", true },
- { "wapazewrdamcdocmanui6001.azurewebsites.net", true },
- { "wapenon.com", true },
- { "waplumber.com.au", true },
- { "wapnews.tk", true },
- { "wapoolandspa.com", true },
- { "wapspaces.tk", true },
- { "wardow.com", true },
- { "wardslager.com", true },
- { "warebouncycastles.co.uk", true },
- { "warekit.io", true },
- { "warenits.at", false },
- { "warfield.org.uk", true },
- { "wargameexclusive.com", true },
- { "warhaggis.com", true },
- { "warmtepomp.express", true },
- { "waroengkoe-shop.com", true },
- { "waroengkopigazebo.net", true },
- { "warofelements.de", true },
- { "warp-radio.com", true },
- { "warp-radio.net", true },
- { "warp-radio.tv", true },
- { "warr.ath.cx", true },
- { "warrantynowvoid.com", true },
- { "warringtonkidsbouncycastles.co.uk", true },
- { "warschild.org", true },
- { "warsh.moe", true },
- { "wartimecontracting.gov", true },
- { "wartorngalaxy.com", true },
- { "wasabiwallet.co", true },
- { "wasabiwallet.io", true },
- { "waschmaschinen-dienst.de", true },
- { "waschpark-hantschel.de", true },
- { "wasd.ms", true },
- { "wasema.com", true },
- { "wasfestes.de", true },
- { "wasgigant.nl", true },
- { "wash-house.tk", true },
- { "washburnenglishschool.tk", true },
- { "washingtonregisteredagent.io", true },
- { "washingtonviews.com", true },
- { "washoedems.org", true },
- { "wasi-net.de", true },
- { "wasielewski.com.de", true },
- { "waslh.com", true },
- { "wasserburg.dk", true },
- { "wasserspucker.de", true },
- { "wassibauer.com", true },
- { "wasteman.com", true },
- { "wastrel.ch", true },
- { "watch-wiki.org", true },
- { "watchcow.org", false },
- { "watchesonwrist.com", true },
- { "watchface.watch", true },
- { "watchfreeonline.co.uk", true },
- { "watchhentai.co", true },
- { "watchlol.live", true },
- { "watchmetech.com", true },
- { "watchmoviesgallery.com", true },
- { "watchparts-and-tools-okayama.co.jp", true },
- { "watchstyle.com", true },
- { "water-addict.com", true },
- { "water-polo.tk", true },
- { "waterbrook.com.au", true },
- { "waterdogsmokedfish.com", true },
- { "waterdrop.tk", true },
- { "waterheaterdallastx.com", true },
- { "waterheaterirvingtx.com", true },
- { "waterheaterleaguecity.com", true },
- { "waterleeftinbeek.nl", true },
- { "watermonitor.gov", true },
- { "wateroutlook.com", true },
- { "watersb.org", true },
- { "waterschaplimburg.nl", true },
- { "waterside-residents.org.uk", true },
- { "waterslide-austria.at", true },
- { "watertrails.io", true },
- { "watervillewomenscare.com", true },
- { "watfordjc.uk", true },
- { "watoo.tech", true },
- { "wattcontrol.cz", true },
- { "watthasawang.com", true },
- { "wattmaedchen.de", true },
- { "wattnow.io", true },
- { "watzijnmijnkerntalenten.nl", true },
- { "wav-productions.com", true },
- { "wav.tv", true },
- { "wave.is", true },
- { "wave.red", true },
- { "wavengine.com", true },
- { "wavesboardshop.com", true },
- { "waveum.com", true },
- { "wawak.pl", true },
- { "wawapuquy.com", true },
- { "waxdramatic.com", true },
- { "wayfair.de", true },
- { "wayfairertravel.com", true },
- { "waynefranklin.com", true },
- { "wayohoo.com", true },
- { "wayohoo.net", true },
- { "waytofreedom.tk", true },
- { "waytt.cf", true },
- { "wb2288.cc", true },
- { "wb256.com", true },
- { "wb6668.net", true },
- { "wba.or.at", true },
- { "wbci.us", false },
- { "wbcme.co.uk", true },
- { "wbinnssmith.com", true },
- { "wblautomotive.com", true },
- { "wblinks.com", true },
- { "wbt-solutions.ch", true },
- { "wbt-solutions.net", true },
- { "wbudd.com", true },
- { "wbuhs.ac.in", true },
- { "wbuntu.com", true },
- { "wbvb.nl", true },
- { "wby.by", true },
- { "wca.link", true },
- { "wcbook.ru", false },
- { "wck.com", true },
- { "wcn.life", false },
- { "wcosmeticsurgery.com", true },
- { "wcrca.org", true },
- { "wcwcg.net", true },
- { "wd36.cc", true },
- { "wd63.cc", true },
- { "wdbflowersevents.co.uk", true },
- { "wdbgroup.co.uk", true },
- { "wdmg.com.ua", true },
- { "wdodelta.nl", true },
- { "wdol.gov", false },
- { "wdt.cz", false },
- { "we-bb.com", true },
- { "we168168.com", true },
- { "we5688.net", true },
- { "we6668.net", true },
- { "we88fun.com", true },
- { "weacceptbitcoin.gr", true },
- { "weadvize.fr", true },
- { "wealthadvisorsmf.com", true },
- { "wealthcreationsolutions.ga", true },
- { "wealthprojector.com", true },
- { "wealthprojector.com.au", true },
- { "wealthreport.com.au", true },
- { "wealthsetsyoufree.com", true },
- { "wealthsimple.com", true },
- { "wear-referrals.co.uk", true },
- { "wearandcare.net", true },
- { "weare1inspirit.com", true },
- { "wearebase.com", true },
- { "wearebfi.co.uk", true },
- { "wearefrantic.com", true },
- { "wearegenki.com", true },
- { "wearepapermill.co", true },
- { "wearepapermill.com", true },
- { "wearethreebears.co.uk", true },
- { "wearetuzag.com", true },
- { "wearvr.com", true },
- { "weather-schools.com", true },
- { "weather.gov", true },
- { "weather.gov.mo", true },
- { "weathermyway.rocks", true },
- { "weavers.space", true },
- { "web-art.cz", true },
- { "web-design.co.il", true },
- { "web-desing.com.ua", true },
- { "web-format.tk", true },
- { "web-hotel.gr", true },
- { "web-jive.com", true },
- { "web-kouza.com", true },
- { "web-lab.ml", true },
- { "web-mail.info", true },
- { "web-odyssey.com", true },
- { "web-redacteuren.nl", true },
- { "web-siena.it", true },
- { "web-smart.com", true },
- { "web-studio-kzo.ml", true },
- { "web-test.gq", true },
- { "web-wave.jp", true },
- { "web.bzh", true },
- { "web.cc", false },
- { "web.de", true },
- { "web2033.com", true },
- { "web2ldap.de", true },
- { "web2screen.tv", true },
- { "web404.net", true },
- { "webadiccion.net", true },
- { "webadicta.net", true },
- { "webadicto.net", true },
- { "webaeon.org", true },
- { "webaholic.co.in", true },
- { "webandmore.de", true },
- { "webandsun.com", true },
- { "webanyti.me", true },
- { "webartex.ru", true },
- { "webarxsecurity.com", true },
- { "webbiz.co.uk", true },
- { "webbricks.ru", true },
- { "webcam-model.tk", true },
- { "webcamtoy.com", true },
- { "webcaptive.com", true },
- { "webcaptive.net", true },
- { "webcasinos.com", false },
- { "webcatchers.nl", false },
- { "webcatechism.com", false },
- { "webce.de", true },
- { "webceo.se", true },
- { "webcheck.pt", true },
- { "webclimbers.ch", false },
- { "webcloud.io", true },
- { "webcollect.org.uk", true },
- { "webcontentspinning.com", true },
- { "webcookies.org", true },
- { "webcreativa.tk", true },
- { "webcrm.com", true },
- { "webcurtaincall.com", true },
- { "webdemaestrias.com", true },
- { "webdesign-note.jp", true },
- { "webdesign-st.de", true },
- { "webdesigneauclaire.com", true },
- { "webdesignersinchennai.tk", true },
- { "webdesigngc.com", true },
- { "webdesignlabor.ch", true },
- { "webdesignplayground.io", true },
- { "webdesignsandiego.com", false },
- { "webdev.solutions", true },
- { "webdevinsider.pl", true },
- { "webdevops.io", true },
- { "webdl.org", true },
- { "webduck.nl", false },
- { "webeast.eu", true },
- { "webeau.com", true },
- { "webeditors.com", true },
- { "webergrillrestaurant.com", true },
- { "webers-webdesign.de", true },
- { "webexample.win", true },
- { "webexp.biz", true },
- { "webexpertsdirect.com.au", true },
- { "webfilings-eu-mirror.appspot.com", true },
- { "webfilings-eu.appspot.com", true },
- { "webfilings-mirror-hrd.appspot.com", true },
- { "webfilings.appspot.com", true },
- { "webfixers.nl", true },
- { "webgap.io", false },
- { "webgarten.ch", true },
- { "webgears.com", true },
- { "webgeneric.com", true },
- { "webgeneric.in", true },
- { "webharvest.gov", true },
- { "webhelyesarcu.hu", true },
- { "webhoffmann.de", true },
- { "webhooks.stream", true },
- { "webhost.guide", true },
- { "webhostingshop.ca", true },
- { "webhostingspace.net", true },
- { "webhostingzzp.nl", true },
- { "webhotelli.website", true },
- { "webhotels.tk", true },
- { "webhotelsoversigt.dk", true },
- { "webia.in.th", true },
- { "webies.ro", true },
- { "webini.co", true },
- { "webinnovation.ie", true },
- { "webinstit.net", true },
- { "webionite.com", true },
- { "webjobposting.com", true },
- { "webkam-sex.com", true },
- { "webkef.com", true },
- { "webkindergarten.net", true },
- { "weblagring.se", true },
- { "weblate.com", true },
- { "weblate.cz", true },
- { "weblate.org", true },
- { "webleedpixels.com", false },
- { "weblegion.de", true },
- { "webliberty.ru", true },
- { "weblights.ml", true },
- { "webline.ch", true },
- { "weblogzwolle.nl", true },
- { "webmail.ee", true },
- { "webmail.gigahost.dk", false },
- { "webmail.info", false },
- { "webmail.onlime.ch", false },
- { "webmail.schokokeks.org", false },
- { "webmail.xalqbank.az", true },
- { "webmandesign.eu", true },
- { "webmarketing.hr", true },
- { "webmaster-infographiste-lyon.fr", true },
- { "webmaster16.ml", true },
- { "webmediaprint.at", true },
- { "webmediums.com", true },
- { "webmedpharmacy.co.uk", true },
- { "webmetering.at", true },
- { "webmotelli.fi", true },
- { "webnames.ca", true },
- { "webnetforce.net", true },
- { "webnexty.com", true },
- { "webpagetest.org", true },
- { "webperformance.io", true },
- { "webpinoytambayan.net", true },
- { "webpinoytv.info", true },
- { "webpostingmart.com", true },
- { "webpostingpro.com", true },
- { "webpostingreviews.com", true },
- { "webpubsub.com", true },
- { "webqualitat.com.br", true },
- { "webrabbit.at", true },
- { "webrebels.org", false },
- { "webrentcars.com", false },
- { "webreport.fr", true },
- { "webrox.be", true },
- { "websa.nl", true },
- { "webscale.nl", false },
- { "websecurity.is", true },
- { "webseitendesigner.com", false },
- { "webseitenserver.com", true },
- { "websenat.de", true },
- { "webservertalk.com", true },
- { "webshaped.de", true },
- { "websharks.org", true },
- { "website-engineering.co.za", true },
- { "website-traffic.shop", true },
- { "websiteboost.nl", true },
- { "websitecyber.com", true },
- { "websitedesignersmalappuram.ga", true },
- { "websitedesignprice.ga", true },
- { "websiteforstudents.com", true },
- { "websiteguider.com", true },
- { "websitemarketers.tk", true },
- { "websiteout.ca", true },
- { "websiteout.net", true },
- { "websitepromotion.ml", true },
- { "websitesdallas.com", true },
- { "websiteservice.pro", true },
- { "websitesmiths.com", true },
- { "websize.me", true },
- { "webslake.com", true },
- { "websmartmedia.co.uk", true },
- { "webspiral.jp", true },
- { "webspire.tech", true },
- { "webstaff.xyz", true },
- { "webstart.nl", true },
- { "webstellung.com", true },
- { "webstijlen.nl", true },
- { "webstore.be", false },
- { "webstu.be", true },
- { "webstudio-n.com", true },
- { "webstylemedia.com", true },
- { "websvetaines.lt", true },
- { "webtasarim.pw", true },
- { "webtaxi.cf", true },
- { "webtex.limited", true },
- { "webtheapp.com", true },
- { "webtoro.com", true },
- { "webtorrent.io", true },
- { "webtrek.ch", true },
- { "webtrh.cz", true },
- { "webtropia.com", false },
- { "webukhost.com", true },
- { "webwednesday.nl", true },
- { "webwelearn.com", true },
- { "webwinkelexploitatie.nl", true },
- { "webwinkelwestland.nl", true },
- { "webwit.nl", true },
- { "webworkshop.ltd", true },
- { "webx5.pro", true },
- { "webxr.today", true },
- { "webyazilimankara.com", true },
- { "webzoly.com", true },
- { "wechatify.com", true },
- { "wecho.net", true },
- { "weck.alsace", true },
- { "wecleanbins.com", true },
- { "wecobble.com", true },
- { "wed.pw", true },
- { "weddingdays.tv", true },
- { "weddingenvelopes.co.uk", false },
- { "weddingsbynoon.co.uk", true },
- { "weddingwire.ca", true },
- { "weddywood.ru", false },
- { "wedenth.com", true },
- { "wedg.uk", true },
- { "wedohair.co", true },
- { "wedovapes.co.uk", true },
- { "weebl.me", true },
- { "weeblr.com", true },
- { "weeblrpress.com", true },
- { "weecarepreschool.ca", true },
- { "weedelec.pl", true },
- { "weedlife.com", true },
- { "weedupdate.com", true },
- { "weedworthy.com", true },
- { "weedypedia.de", true },
- { "week.report", true },
- { "weeka.cc", true },
- { "weekdone.com", true },
- { "weekendinitaly.com", true },
- { "weekly-residence.com", true },
- { "weeklydcoupgen.com", true },
- { "weeknummers.be", true },
- { "weeknummers.nl", true },
- { "weekvandemediawijsheid.nl", true },
- { "weemake.fr", false },
- { "weemakers.fr", false },
- { "weepycat.com", true },
- { "weerda.fr", true },
- { "weerstationgiethoorn.nl", true },
- { "weerstatistieken.nl", true },
- { "wefinanceinc.com", true },
- { "wefitboilers.com", true },
- { "wefound.com.tw", true },
- { "wegerecht.org", true },
- { "wegiel24.info", true },
- { "wegonnagetsued.org", true },
- { "wegotcookies.com", true },
- { "wegrzynek.org", true },
- { "wegrzynek.pl", true },
- { "wegvielfalt.de", true },
- { "wehostdnn.com", true },
- { "weibomiaopai.com", true },
- { "weideheuvel.org", true },
- { "weidmannfibertechnology.com", false },
- { "weien.org", true },
- { "weigelia.nl", true },
- { "weightlossoutcome.com", true },
- { "weihnachten-schenken.de", true },
- { "weiling.clinic", true },
- { "weils.net", true },
- { "weiltoast.de", true },
- { "weimz.com", true },
- { "wein.cc", true },
- { "wein.co.kr", true },
- { "weinbergerlawgroup.com", true },
- { "weinboxbuilders.co.nz", true },
- { "weinundsein.com", true },
- { "weiran.org.cn", true },
- { "weirdesigns.com", true },
- { "weissborn.me", true },
- { "weissdorntee.de", true },
- { "weisse-liste.de", true },
- { "weissman.agency", true },
- { "weiterbildung-vdz.de", true },
- { "weitergedacht.eu", true },
- { "weitsolutions.nl", true },
- { "weknowhowtodoit.com", true },
- { "welcome-werkstatt.com", true },
- { "welcome-werkstatt.de", true },
- { "welcomescuba.com", true },
- { "welcometoscottsdalehomes.com", true },
- { "weld.io", true },
- { "weldotherm.fr", true },
- { "weliway.com", true },
- { "well-around-the-world.com", true },
- { "wella-download-center.de", true },
- { "wellbeing360.com.au", true },
- { "wellcom.co.il", true },
- { "wellcomemdhealth.com", true },
- { "wellensteyn.ru", true },
- { "weller.pm", true },
- { "wellgreece.com", true },
- { "wellist.com", true },
- { "wellness-bonbon.de", true },
- { "wellness-gutschein.de", true },
- { "wellnesscheck.net", true },
- { "wellnessever.com", true },
- { "wellnesshotel-weimar.de", true },
- { "wellsolveit.com", false },
- { "wellspringsga.com", true },
- { "wellsprung.net", true },
- { "welltycoon.com", true },
- { "welovecatsandkittens.com", true },
- { "weloveliving.it", true },
- { "welovemaira.com", true },
- { "welshccf.org.uk", true },
- { "welt-flaggen.de", true },
- { "welteneroberer.de", true },
- { "weltengilde.de", true },
- { "weltenhueter.de", true },
- { "weltverschwoerung.de", true },
- { "welzijnkoggenland.nl", true },
- { "wem.hr", true },
- { "wemajin.com", true },
- { "wemakeit.mx", true },
- { "wemakemenus.com", true },
- { "wemakeonlinereviews.com", true },
- { "wemovemountains.co.uk", true },
- { "wenceslas.org.uk", true },
- { "wendlberger.net", true },
- { "wenge-murphy.com", true },
- { "wenger-shop.ch", true },
- { "wenhelpdesk.tk", true },
- { "wenjs.me", true },
- { "wenjulebu.cc", true },
- { "wensing-und-koenig.de", true },
- { "wenta.de", true },
- { "wepa.pe", true },
- { "wepay.com", false },
- { "wepay.in.th", true },
- { "wepay.vn", true },
- { "wepbiz.com", true },
- { "weplaynaked.dk", true },
- { "wer-kommt-her.de", true },
- { "werally.com", true },
- { "werbe-markt.de", true },
- { "werbe-sonnenbrillen.de", true },
- { "werbeagentur.de", true },
- { "werbedesign-tauber.de", true },
- { "werbefotograf-leitner.de", true },
- { "werbefotografie-leitner.de", true },
- { "werbetopshop.de", true },
- { "werbezentrum-stiebler.de", true },
- { "werbik.at", true },
- { "werd.pw", true },
- { "werehub.org", true },
- { "wereldkoffie.eu", true },
- { "wereoutthere.nl", true },
- { "werepairit.com.au", true },
- { "werk-34.de", true },
- { "werkemotion.com", true },
- { "werkenbijdfzs.nl", true },
- { "werkenbijsherpa.nl", true },
- { "werkenbijwierda.nl", true },
- { "werkeninwesterveld.nl", true },
- { "werkenvoorphiladelphia.nl", true },
- { "werkgroepderdewereld.nl", true },
- { "werkgroeppaleisparkhetloo.nl", true },
- { "werkinc.de", true },
- { "werkkrew.xyz", true },
- { "werkslimreisslim.nl", true },
- { "werkstattkinder.de", true },
- { "wermeester.com", true },
- { "wermuttee.de", true },
- { "werner-ema.de", true },
- { "werpo.com.ar", true },
- { "wertheimer-burgrock.de", true },
- { "wervingenselectieamsterdam.nl", true },
- { "werwolf-live.de", true },
- { "werxus.eu", true },
- { "wesecom.com", true },
- { "wesell.asia", true },
- { "weserv.nl", true },
- { "wesleycabus.be", true },
- { "wesleywarnell.com", true },
- { "wesoco.de", true },
- { "west-contemporary.com", true },
- { "west-nerica.de", true },
- { "west-raptors.tk", true },
- { "west-wind.net", true },
- { "westcanal.net", true },
- { "westcarrollton.org", true },
- { "westcentralaor.org", true },
- { "westcoastcastles.com", true },
- { "westcoastheatingair.com", true },
- { "westcoastmarineadvisor.com", true },
- { "westcode.de", true },
- { "westcommunitycu.org", true },
- { "westcountrystalking.com", true },
- { "westendwifi.net", true },
- { "westernfrontierins.com", true },
- { "westernpadermatologist.com", true },
- { "westernparts.com", true },
- { "westeros.hu", true },
- { "westhillselectrical.com", true },
- { "westhotel.com.au", true },
- { "westlakevillageelectric.com", true },
- { "westlakevillageelectrical.com", true },
- { "westlakevillageelectrician.com", true },
- { "westlakevillageexteriorlighting.com", true },
- { "westlakevillagelandscapelighting.com", true },
- { "westlakevillagelighting.com", true },
- { "westlakevillageoutdoorlighting.com", true },
- { "westlandplacestudios.com", true },
- { "westlinntowncar.com", true },
- { "westmead.org", true },
- { "westmeadapartments.com.au", true },
- { "westmidlandsbouncycastlehire.co.uk", true },
- { "westmidlandsinflatables.co.uk", true },
- { "westmidlandslettings.com", true },
- { "westondenning.com", true },
- { "westside-pediatrics.com", true },
- { "westsuburbanbank.com", true },
- { "westthorntonlabour.co.uk", true },
- { "wesupportthebadge.org", true },
- { "weswitch4u.com", true },
- { "wetofu.top", true },
- { "wetpussylipsex.com", true },
- { "wetrepublic.com", true },
- { "wetter.de", true },
- { "wevg.org", true },
- { "wew881.com", true },
- { "wew882.com", true },
- { "wew888.com", true },
- { "wewin88.com", true },
- { "wewin88.net", true },
- { "wewin889.com", true },
- { "wewitro.de", true },
- { "wewitro.net", true },
- { "wexfordbouncycastles.ie", true },
- { "weydu.eu", true },
- { "weyhmueller.de", true },
- { "weyland-yutani.org", true },
- { "weymouthslowik.com", true },
- { "wezartt.com", true },
- { "wezl.net", true },
- { "wf-bigsky-master.appspot.com", true },
- { "wf-demo-eu.appspot.com", true },
- { "wf-demo-hrd.appspot.com", true },
- { "wf-dogfood-hrd.appspot.com", true },
- { "wf-hosting.de", true },
- { "wf-pentest.appspot.com", true },
- { "wf-staging-hr.appspot.com", true },
- { "wf-training-hrd.appspot.com", true },
- { "wf-training-master.appspot.com", true },
- { "wf-trial-hrd.appspot.com", true },
- { "wfcp1010.com", true },
- { "wfh.ovh", true },
- { "wfh.se", true },
- { "wforum.nl", true },
- { "wfschicago.com", true },
- { "wft-portfolio.nl", true },
- { "wg-steubenstrasse.de", true },
- { "wg3k.us", false },
- { "wgcaobgyn.com", true },
- { "wgcp.com", true },
- { "wgdp.gov", true },
- { "wgec-fegc.gc.ca", true },
- { "wgom.org", true },
- { "wgplatform.co.uk", true },
- { "wgraphics.ru", true },
- { "wgtrm.com", true },
- { "wh-guide.de", true },
- { "wh36.net", true },
- { "what-wood.servehttp.com", true },
- { "what.tf", true },
- { "whatagreatwebsite.net", true },
- { "whatarepatentsfor.com", true },
- { "whatclinic.co.uk", true },
- { "whatclinic.com", true },
- { "whatclinic.com.ph", true },
- { "whatclinic.de", true },
- { "whatclinic.ie", true },
- { "whatclinic.ru", true },
- { "whatdevotion.com", true },
- { "whatisapassword.com", true },
- { "whatismycountry.com", true },
- { "whatismyip.net", false },
- { "whatismyipaddress.ca", true },
- { "whatismyipv6.info", true },
- { "whatismypublicip.com", true },
- { "whatisthe.cloud", true },
- { "whatnot.ai", true },
- { "whatsahoy.com", true },
- { "whatsmychaincert.com", true },
- { "whatsthisword.com", true },
- { "whatsupgold.com.tw", true },
- { "whatsupoutdoor.com", false },
- { "whatthefile.info", true },
- { "whatthingsweigh.com", true },
- { "whattodo.com", true },
- { "whattominingrigrentals.com", true },
- { "whatusb.com", true },
- { "whatwebcando.today", true },
- { "whatwg.org", true },
- { "whd-guide.de", true },
- { "wheatbagslove.com.au", true },
- { "wheatley.nl", true },
- { "wheelwork.org", false },
- { "when.fm", false },
- { "where2trip.com", true },
- { "wheredoi.click", true },
- { "wheresbuzz.com.au", true },
- { "wheretogomyanmar.com", true },
- { "whey-protein.ch", true },
- { "whi.tw", true },
- { "whichgender.today", true },
- { "whing.org", true },
- { "whipnic.com", true },
- { "whirlpool.net.au", true },
- { "whisky-circle.info", true },
- { "whisky.my", true },
- { "whiskygentle.men", true },
- { "whiskyglazen.nl", false },
- { "whiskynerd.ca", true },
- { "whisp.ly", false },
- { "whispeer.de", true },
- { "whisperinghoperanch.org", true },
- { "whisperlab.org", true },
- { "whistleb.com", true },
- { "whistleblower.gov", true },
- { "whistleblowing.it", true },
- { "whitby-brewery.com", true },
- { "white-ibiza.com", true },
- { "whitealps.at", false },
- { "whitealps.be", false },
- { "whitealps.ch", false },
- { "whitealps.de", false },
- { "whitealps.fr", false },
- { "whitealps.net", false },
- { "whitebear.cloud", true },
- { "whitebirdclinic.org", true },
- { "whitefm.ch", false },
- { "whitehathackers.com.br", true },
- { "whitehats.nl", true },
- { "whitehouse.gov", true },
- { "whitehouse.org", true },
- { "whitehouseconferenceonaging.gov", true },
- { "whitehousedrugpolicy.gov", true },
- { "whiteink.com", true },
- { "whitejaguars.com", true },
- { "whiteknightsafelockinc.com", true },
- { "whitelabelcashback.nl", true },
- { "whitelabeltickets.com", false },
- { "whitemountainnaturalcreations.com", true },
- { "whitepack.ru", true },
- { "whitepen.tk", true },
- { "whitepharmacy.co.uk", true },
- { "whiterabbit.group", true },
- { "whiterabbit.org", true },
- { "whiterose.goip.de", true },
- { "whitesoxbestteaminbaseball.com", true },
- { "whitesuithacking.com", true },
- { "whitevpn.cz", true },
- { "whitkirk.com", true },
- { "whitkirkartsguild.com", true },
- { "whitkirkchurch.org.uk", true },
- { "whittome.com", true },
- { "whitworth.nyc", true },
- { "whizdomcenter.com", true },
- { "whizzzbang.co.uk", true },
- { "whm.gc.ca", true },
- { "whmcs.hosting", true },
- { "whnpa.org", true },
- { "who-calledme.com", true },
- { "whoami.eu.org", true },
- { "whoami.io", true },
- { "whocalld.com", true },
- { "whocalled.us", true },
- { "whocalledme.xyz", true },
- { "whocybered.me", true },
- { "whodatdish.com", true },
- { "whoimg.com", false },
- { "whoisthenightking.com", true },
- { "whojoo.com", true },
- { "wholesomeharvestbread.com", false },
- { "whollyskincare.com", true },
- { "whonix.org", true },
- { "whorepresentsme.us", true },
- { "whotracks.me", true },
- { "whoturgled.com", true },
- { "whqtravel.org", false },
- { "whs-music.org", true },
- { "whta.eu", true },
- { "whta.se", true },
- { "whub.io", true },
- { "why-brexit.uk", true },
- { "why918.com", true },
- { "whychoosebob.net.au", true },
- { "whymps.com", true },
- { "whynohttps.com", true },
- { "whyopencomputing.ch", false },
- { "whyopencomputing.com", false },
- { "whysoslow.co.uk", true },
- { "whytls.com", true },
- { "whyworldhot.com", true },
- { "whyz1722.tk", true },
- { "wibbe.link", true },
- { "wiberg.nu", true },
- { "wibness.com", true },
- { "wicharypawel.com", true },
- { "wichitafoundationpros.com", true },
- { "wick-machinery.com", true },
- { "wickelfischfrance.fr", true },
- { "wickerliving.com", true },
- { "wickrath.net", true },
- { "wicksandwonders.com.au", true },
- { "wicontractortraining.com", true },
- { "wideboxmacau.com", false },
- { "widegab.com", false },
- { "wideinfo.org", true },
- { "widejeans.tk", true },
- { "widely.io", true },
- { "widemann.de", true },
- { "widememory.com", true },
- { "widgetmaker.co.uk", true },
- { "widmer.bz", true },
- { "widsl.de", true },
- { "wiebel.org", true },
- { "wieckiewicz.org", true },
- { "wiedmeyer.de", true },
- { "wiedu.net", true },
- { "wiegedaten.de", true },
- { "wiehenkrug.de", true },
- { "wiek.net", true },
- { "wieloswiat.pl", true },
- { "wielrenbond.ml", true },
- { "wien52.at", true },
- { "wieneck-bauelemente.de", true },
- { "wiener.hr", true },
- { "wienergyjobs.com", true },
- { "wieobensounten.de", true },
- { "wifi-hack.com", true },
- { "wifi-names.com", true },
- { "wificafehosting.com", true },
- { "wificonnect.cc", true },
- { "wifimask.com", true },
- { "wifimb.cz", true },
- { "wifipineapple.com", true },
- { "wifirst.net", true },
- { "wifree.lv", true },
- { "wigggle.it", true },
- { "wigle.net", true },
- { "wigmore-hall.org.uk", true },
- { "wiimotion.de", true },
- { "wijaya.net", true },
- { "wijaya2u.com", true },
- { "wijnbesteld.nl", true },
- { "wijnservices.nl", false },
- { "wijwillendit.nl", true },
- { "wijzijnwolf.nl", true },
- { "wiki-books.ga", true },
- { "wiki-play.ru", true },
- { "wiki.python.org", true },
- { "wikibooks.org", true },
- { "wikibulz.com", true },
- { "wikibuy.com", true },
- { "wikidata.org", true },
- { "wikidsystems.com", false },
- { "wikihow.com", true },
- { "wikihow.com.tr", true },
- { "wikihow.cz", true },
- { "wikihow.fitness", true },
- { "wikihow.it", true },
- { "wikihow.jp", true },
- { "wikihow.life", true },
- { "wikihow.mom", true },
- { "wikihow.pet", true },
- { "wikihow.tech", true },
- { "wikihow.vn", true },
- { "wikijugos.com", true },
- { "wikileaks.ch", true },
- { "wikileaks.com", true },
- { "wikileaks.org", true },
- { "wikimedia.org", true },
- { "wikimediafoundation.org", true },
- { "wikimilk.org", true },
- { "wikinews.org", true },
- { "wikipedia.org", true },
- { "wikipiedi.it", true },
- { "wikiquote.org", true },
- { "wikisorg.tk", true },
- { "wikisource.org", true },
- { "wikiversity.org", true },
- { "wikiversus.com", true },
- { "wikivisually.com", true },
- { "wikivoyage.org", true },
- { "wikizip.ga", true },
- { "wikpa.com", true },
- { "wiktionary.org", true },
- { "wilane.org", true },
- { "wilcodeboer.me", true },
- { "wild-turtles.com", true },
- { "wildanalysis.ga", true },
- { "wildandisle.com", true },
- { "wildandwonderfulbodycare.com", true },
- { "wildandwonderfulketo.com", true },
- { "wildberries.cf", true },
- { "wildbirds.dk", true },
- { "wildcardcorp.com", true },
- { "wildcardfederal.net", true },
- { "wildcatproductions.biz", true },
- { "wildcraft.com", true },
- { "wilddirections.co.uk", true },
- { "wilddogdesign.co.uk", true },
- { "wildercerron.com", true },
- { "wildewood.ca", true },
- { "wildfirechain.xyz", true },
- { "wildnisfamilie.net", true },
- { "wildtrip.blog", true },
- { "wildwildtravel.com", true },
- { "wildzoopark.co.uk", true },
- { "wilgo.ga", true },
- { "wilhelm-nathan.de", true },
- { "wili.li", true },
- { "wiliquet.net", false },
- { "wilkushka.com", true },
- { "wilkushka.net", true },
- { "willberg.bayern", true },
- { "willekeinden.nl", true },
- { "willems-kristiansen.dk", true },
- { "willfarrell.ca", true },
- { "willi-graf-gymnasium.de", true },
- { "willi-graf-os.de", true },
- { "willi-roth-holzbau.ch", true },
- { "williamboulton.co.uk", true },
- { "williamfeely.info", true },
- { "williamjohngauthier.net", true },
- { "williamle.com", true },
- { "williampuckering.com", true },
- { "williamscomposer.com", true },
- { "williamshomeheat.co.uk", true },
- { "williamsonshore.com", true },
- { "williamsportmortgages.com", true },
- { "williamsroom.com", true },
- { "williamsvillepediatriccenter.com", true },
- { "williamtai.moe", true },
- { "williamtm.com", true },
- { "williamvds.me", true },
- { "williejackson.com", true },
- { "willnorris.com", true },
- { "willow.technology", true },
- { "willowbrook.co.uk", true },
- { "willowdalechurch.ca", true },
- { "willowtree.school", true },
- { "wills.co.tt", true },
- { "willstamper.name", true },
- { "willstocks.co.uk", true },
- { "willvision.com", true },
- { "willywangstory.com", true },
- { "wiloca.it", true },
- { "wils.jp", true },
- { "wilseyrealty.com", true },
- { "wimachtendienk.com", true },
- { "wimbo.nl", true },
- { "wimpernforyou.de", true },
- { "win365.com", true },
- { "win7stylebuilder.com", false },
- { "win88-line.com", true },
- { "win88-line.net", true },
- { "winall8.com", true },
- { "winbuzzer.com", true },
- { "wincasinosmoney.com", true },
- { "winch-center.de", true },
- { "winckelmann2020.com", true },
- { "windelnkaufen24.de", true },
- { "windforme.com", true },
- { "windictus.net", true },
- { "windmyroof.com", true },
- { "windowcleaningexperts.net", true },
- { "windowreplacement.net", true },
- { "windows-support.nu", true },
- { "windows-support.se", true },
- { "windowsdoors.it", true },
- { "windowseatwanderer.com", true },
- { "windowslatest.com", true },
- { "windowsnerd.com", true },
- { "windowsnoticias.com", true },
- { "windscribe.com", true },
- { "windsock-app.com", true },
- { "windsorite.ca", true },
- { "windsorspi.com", true },
- { "windycitydubfest.com", true },
- { "wine-route.net", true },
- { "wine-tapa.com", true },
- { "winebid.com", true },
- { "wineparis.com", true },
- { "wineworksonline.com", true },
- { "winfieldchen.me", true },
- { "wing-tsun.ga", true },
- { "wingchunboxtribe.com", true },
- { "winghill.com", true },
- { "wingify.com", true },
- { "wingmin.net", true },
- { "wingsofacow.com", true },
- { "winhistory-forum.net", true },
- { "winkelcentrumputten.nl", true },
- { "winmodels.org", true },
- { "winmodels.ru", true },
- { "winner-ua.com", true },
- { "winningattitudeawards.org", true },
- { "winphonemetro.com", true },
- { "winsome.world", true },
- { "winsposure.com", true },
- { "wint.global", true },
- { "winter-auszeit.de", true },
- { "winter-elektro.de", true },
- { "winter.engineering", true },
- { "winterbergwebcams.com", true },
- { "wintercam.nl", true },
- { "wintercorn.com", true },
- { "winterfeldt.de", true },
- { "winterhavenobgyn.com", true },
- { "winterhillbank.com", true },
- { "wintermeyer-consulting.de", true },
- { "wintermeyer.de", true },
- { "winterschoen.nl", true },
- { "wintersportscompany.com", true },
- { "wintodoor.com", true },
- { "winwares.com", true },
- { "wiocha.pl", true },
- { "wipswiss.ch", true },
- { "wir-bewegen.sh", true },
- { "wir-machen-druck.de", true },
- { "wire.com", true },
- { "wiredmedia.co.uk", true },
- { "wireframesoftware.com", true },
- { "wireheading.com", true },
- { "wirekeep.com", true },
- { "wireless-emergency-stop.com", true },
- { "wireshark.org", true },
- { "wireshocks.com", true },
- { "wiretime.de", true },
- { "wirhabenspass.de", true },
- { "wirkstoffreich.de", true },
- { "wirkungs-forschung.at", true },
- { "wirkungs-forschung.ch", true },
- { "wirkungs-forschung.com", true },
- { "wirkungs-forschung.de", true },
- { "wirkungs-forschung.net", true },
- { "wirralbouncycastles.co.uk", true },
- { "wirsberg-studios.de", true },
- { "wirsol.com", true },
- { "wis.no", true },
- { "wisak.me", true },
- { "wisal.org", true },
- { "wischu.com", true },
- { "wisedog.eu", false },
- { "wishingyou.co.uk", true },
- { "wishlist.net", true },
- { "wiskundeonderzoek.tk", true },
- { "wismile.lu", true },
- { "wispapp.com", false },
- { "wisper.net.au", true },
- { "wispmaeksmusic.tk", true },
- { "wispsuperfoods.com", true },
- { "wiss.co.uk", true },
- { "wisv.ch", true },
- { "wisweb.no", true },
- { "wit-creations.fr", true },
- { "wit.ai", true },
- { "witch-spells.com", true },
- { "with-environment.com", true },
- { "with-planning.co.jp", true },
- { "wither.cf", true },
- { "withextraveg.net", true },
- { "withgoogle.com", true },
- { "withheld.xyz", true },
- { "withinsecurity.com", true },
- { "withsunglasses.co.uk", true },
- { "withyoutube.com", true },
- { "witneywaterpolo.org.uk", true },
- { "witt-international.co.uk", true },
- { "witte.cloud", true },
- { "wittepapaver.nl", true },
- { "wittu.fi", true },
- { "wittywomaniyaa.com", true },
- { "witway.nl", false },
- { "wivoc.nl", true },
- { "wiz.at", true },
- { "wiz.biz", true },
- { "wizardbouncycastles.co.uk", true },
- { "wizardschool.tk", true },
- { "wizbot.tk", true },
- { "wizzair.com", true },
- { "wizzley.com", true },
- { "wizzr.nl", true },
- { "wj0666.com", true },
- { "wjbolles.com", true },
- { "wjci.com", true },
- { "wje-online.de", true },
- { "wjg.ca", true },
- { "wjg.dk", true },
- { "wjg.se", true },
- { "wjglerum.nl", false },
- { "wjm2038.me", true },
- { "wjr.io", true },
- { "wkennington.com", true },
- { "wkhs.com", true },
- { "wkv.com", true },
- { "wkz.io", true },
- { "wlaws.com", true },
- { "wlci.gov", true },
- { "wlilai.com", true },
- { "wlmhtrecoverycollege.co.uk", true },
- { "wlog.it", true },
- { "wlt.ca", false },
- { "wltix.com", false },
- { "wlx678.com", true },
- { "wlx678a.com", true },
- { "wlx678b.com", true },
- { "wlx678c.com", true },
- { "wm-access.com", true },
- { "wm-access.de", true },
- { "wm-talk.net", true },
- { "wmaccess.com", true },
- { "wmaccess.de", true },
- { "wmfusercontent.org", true },
- { "wmkowa.de", true },
- { "wmsndorgen.cf", true },
- { "wmsndorgen.ga", true },
- { "wmsndorgen.gq", true },
- { "wmsndorgen.ml", true },
- { "wmsndorgen.tk", true },
- { "wnmed.com.au", true },
- { "wnu.com", true },
- { "wo2forum.nl", true },
- { "wobble.ninja", true },
- { "wobblywotnotz.co.uk", true },
- { "wobker.co", true },
- { "woblex.cz", true },
- { "wochennummern.de", true },
- { "wodinaz.com", true },
- { "wodka-division.de", true },
- { "wofflesoft.com", true },
- { "wofford-ecs.org", true },
- { "woffs.de", true },
- { "wogo.org", true },
- { "woheni.de", true },
- { "wohlgemuth.rocks", true },
- { "wohlpa.de", true },
- { "wohlraj.net", true },
- { "wohnbegleitung.ch", true },
- { "wohnsitz-ausland.com", true },
- { "wois.info", true },
- { "wojak.xyz", true },
- { "wojciechowka.pl", true },
- { "wokinghammotorhomes.com", true },
- { "wolfachtal-alpaka.de", true },
- { "wolfarth.info", true },
- { "wolfcrow.com", true },
- { "wolfermann.org", true },
- { "wolferstetterkeller.de", true },
- { "wolfgang-braun.info", true },
- { "wolfgang-kerschbaumer.at", true },
- { "wolfgang-kloke.de", true },
- { "wolfgang-ziegler.com", true },
- { "wolfhowl.me", true },
- { "wolfie.ovh", false },
- { "wolflambert.tk", true },
- { "wolfsden.cz", true },
- { "wolfshuegelturm.de", true },
- { "wolftain.com", true },
- { "wolfteam.tk", true },
- { "wolfwings.us", true },
- { "wolfy.design", true },
- { "wolfy1339.com", true },
- { "wolke7.wtf", true },
- { "wolkenbauer.com", true },
- { "wolkoopjes.nl", true },
- { "wollongongbaptist.hopto.org", true },
- { "wollwerk.org", true },
- { "wolszon.me", true },
- { "woltlab-demo.com", true },
- { "wolvesvtc.com", true },
- { "womb.city", true },
- { "wombatalla.com.au", true },
- { "wombatnet.com", true },
- { "wombats.net", true },
- { "wombere.org", true },
- { "womcom.nl", true },
- { "women-femmes.gc.ca", true },
- { "women-only.net", false },
- { "women.gc.ca", true },
- { "womensalespros.com", true },
- { "womensbiz.tk", true },
- { "womenshairlossproject.com", true },
- { "womenshealthadvocate.org", true },
- { "womensmedassoc.com", true },
- { "womenswellnessobgyn.com", true },
- { "wonderbill.com", true },
- { "wonderbits.net", true },
- { "wondercris.com", true },
- { "wonderfuleducation.eu", true },
- { "wonderfuleducation.nl", true },
- { "wonderfulworldofwalliams.tk", true },
- { "wondergorilla.com", true },
- { "wonderhowto.com", true },
- { "wonderlab.ml", true },
- { "wonderlandmovies.de", true },
- { "wonghome.net", true },
- { "wooc.org", true },
- { "wood-crafted.co.uk", true },
- { "wood-crafted.uk", true },
- { "woodbury.io", true },
- { "woodcoin.org", true },
- { "woodenson.com", true },
- { "woodev.us", true },
- { "woodinvillesepticservice.net", true },
- { "woodlandboys.com", true },
- { "woodlandhillselectrical.com", true },
- { "woodlandsmetro.church", false },
- { "woodlandsvale.uk", true },
- { "woodlandwindows.com", true },
- { "woodminsterrealty.com", true },
- { "woodomat.com", true },
- { "woodsidepottery.ca", true },
- { "woodstocksupply.com", true },
- { "woodwo.se", true },
- { "woodwormtreatment.com", true },
- { "woof.gq", true },
- { "woohooyeah.nl", true },
- { "woonboulevardvolendam.nl", true },
- { "woontegelwinkel.nl", true },
- { "woopie.com", true },
- { "wooplagaming.com", true },
- { "woorocket.com", true },
- { "wootware.co.za", true },
- { "wopplan.de", true },
- { "wopr.network", true },
- { "wops.cc", true },
- { "worca.de", true },
- { "worcade.com", true },
- { "worcesterbouncycastlehire.co.uk", true },
- { "worcesterbouncycastles.co.uk", true },
- { "worcesterfestival.co.uk", true },
- { "worcestervets.co.uk", true },
- { "word-grabber.com", true },
- { "wordadmin.com", true },
- { "wordcounter.net", true },
- { "wordher.com", true },
- { "wordnietvindbaar.nl", true },
- { "wordops.eu", true },
- { "wordops.io", true },
- { "wordops.net", true },
- { "wordplay.one", true },
- { "wordpress.com", false },
- { "wordpressfly.com", true },
- { "wordpresssetup.org", true },
- { "wordregistrar.ga", true },
- { "words.codes", true },
- { "wordsmart.it", true },
- { "wordspy.com", true },
- { "wordxtra.net", true },
- { "worf.in", true },
- { "worio.co", true },
- { "work-in-progress.website", true },
- { "workathomenoscams.com", true },
- { "workcelerator.com", true },
- { "workcloud.jp", true },
- { "worker.gov", true },
- { "workeria-personal.de", true },
- { "workingclassmedia.com", true },
- { "workinginsync.co.uk", true },
- { "workingon.tech", true },
- { "worklizard.com", true },
- { "worknrby.com", true },
- { "workoptions.com", true },
- { "workplace.com", true },
- { "workplace.tools", true },
- { "workraw.com", true },
- { "works-ginan.jp", true },
- { "workshop.men", true },
- { "workshopengine.com.au", true },
- { "workshopszwolle.nl", true },
- { "workshopzwolle.com", true },
- { "worksitevr.com", true },
- { "worksmarter.tv", true },
- { "workthings.de", true },
- { "world-in-my-eyes.com", true },
- { "world-lolo.com", true },
- { "worldcarding.tk", true },
- { "worldcareers.dk", true },
- { "worldcigars.com.br", true },
- { "worldcubeassociation.org", true },
- { "worlddeafarchitecture.com", true },
- { "worldessays.com", true },
- { "worldix.ml", true },
- { "worldmeetings.com", true },
- { "worldmeteo.info", true },
- { "worldofarganoil.com", true },
- { "worldofbelia.de", true },
- { "worldoflegion.ml", true },
- { "worldofparties.co.uk", true },
- { "worldofvnc.net", true },
- { "worldofwobble.co.uk", true },
- { "worldonwheels.com.au", true },
- { "worldpeacetechnology.com", true },
- { "worldrecipes.eu", true },
- { "worldsfree4u.ga", true },
- { "worldsgreatestazuredemo.com", true },
- { "worldsinperil.it", true },
- { "worldstone777.com", true },
- { "worldsy.com", true },
- { "worldtalk.de", true },
- { "worldvisa.tk", true },
- { "wormate.io", true },
- { "wormbytes.ca", true },
- { "wormhol.org", true },
- { "worongarymedical.com.au", true },
- { "worst.horse", false },
- { "wort-suchen.de", true },
- { "wort.lu", true },
- { "woshiluo.com", true },
- { "wossl.com", true },
- { "wossl.net", true },
- { "wot-zadrot.com", true },
- { "woti.dedyn.io", true },
- { "wotra-register.com", true },
- { "wotsunduk.ru", true },
- { "wotzadrot.com", true },
- { "woudenberg.nl", false },
- { "woudenbergsedrukkerij.nl", true },
- { "wound-doc.co.uk", true },
- { "woutergeraedts.nl", true },
- { "wouterslop.com", true },
- { "wouterslop.eu", true },
- { "wouterslop.nl", true },
- { "wow-foederation.de", true },
- { "wow-screenshots.net", true },
- { "wowaffixes.info", true },
- { "wowbouncycastles.co.uk", true },
- { "wowgenial.com", true },
- { "wowi-ffo.de", true },
- { "wowin58.com", true },
- { "wowin88.com", true },
- { "wowjs.co.uk", true },
- { "wowjs.org", true },
- { "wowjs.uk", true },
- { "wowlove.tk", true },
- { "wownmedia.com", true },
- { "wp-cloud.fi", false },
- { "wp-france.com", true },
- { "wp-master.org", true },
- { "wp-mix.com", true },
- { "wp-site1.com", true },
- { "wp-site2.com", true },
- { "wp-tao.com", true },
- { "wp-webagentur.de", true },
- { "wpac.de", false },
- { "wpandup.org", true },
- { "wpbeter.nl", true },
- { "wpboot.com", true },
- { "wpbox.cc", true },
- { "wpcanban.com", false },
- { "wpccu-cdn.org", true },
- { "wpcdn.bid", true },
- { "wpcs.pro", true },
- { "wpdivitheme.nl", true },
- { "wpexplorer.com", true },
- { "wpformation.com", true },
- { "wpherc.com", true },
- { "wphlive.tv", true },
- { "wphosting.ovh", true },
- { "wphostingblog.nl", true },
- { "wpldn.uk", true },
- { "wplistings.pro", true },
- { "wpmeetup-berlin.de", true },
- { "wpmu-tutorials.de", true },
- { "wpno.com", false },
- { "wpnuvem.com", true },
- { "wpostats.com", false },
- { "wppeeps.com", true },
- { "wprodevs.com", true },
- { "wpsermons.com", true },
- { "wpserp.com", true },
- { "wpsharks.com", true },
- { "wpsitemovers.com", true },
- { "wpsmackdown.com", true },
- { "wpsnelheid.nl", true },
- { "wpthaiuser.com", true },
- { "wptorium.com", true },
- { "wptotal.com", true },
- { "wpturnedup.com", true },
- { "wpwebshop.com", true },
- { "wq.ro", true },
- { "wr.su", true },
- { "wrara.org", true },
- { "wrathofgeek.com", true },
- { "wrc-results.com", true },
- { "wrdcfiles.ca", true },
- { "wrdx.io", true },
- { "wrenwrites.com", true },
- { "wrestling.net.au", true },
- { "wrgms.com", true },
- { "wristreview.com", true },
- { "write-right.net", true },
- { "writeandedit-for-you.com", true },
- { "writecustomessay.com", true },
- { "writemyessay.info", true },
- { "writemyessay.today", true },
- { "writemyessays.com", true },
- { "writemyestimate.com", true },
- { "writemypaperhub.com", true },
- { "writemytermpapers.com", true },
- { "writeoff.me", true },
- { "writepro.net", true },
- { "writer24.ru", true },
- { "writereditor.com", true },
- { "writers-club.tk", true },
- { "writing-expert.com", true },
- { "writingcities.net", true },
- { "writingtoserve.net", true },
- { "writtenworld.bg", true },
- { "writtit.com", true },
- { "wrmea.org", true },
- { "wrp-timber-mouldings.co.uk", true },
- { "wrp.gov", true },
- { "wsa.poznan.pl", true },
- { "wsadek.ovh", true },
- { "wsave.be", true },
- { "wsb-immo.at", true },
- { "wsb.pl", true },
- { "wsbhvac.com", true },
- { "wscales.com", false },
- { "wscbiolo.id", true },
- { "wsdcapital.com", true },
- { "wselektro.de", true },
- { "wsetech.com", true },
- { "wsgvet.com", true },
- { "wsl.sh", true },
- { "wsldp.com", true },
- { "wso01.com", true },
- { "wsspalluto.de", true },
- { "wstudio.ch", false },
- { "wstx.com", true },
- { "wsv-pfeffingen.de", true },
- { "wtfbryan.com", true },
- { "wtfnope.org", true },
- { "wth.in", true },
- { "wtp.co.jp", true },
- { "wtpdive.jp", true },
- { "wtpmj.com", true },
- { "wtprecife.com.br", true },
- { "wtup.net", true },
- { "wtw.io", true },
- { "wucke13.de", true },
- { "wuerfel.wf", true },
- { "wuerfelmail.de", true },
- { "wug.fun", true },
- { "wug.jp", true },
- { "wug.news", true },
- { "wuji.cz", true },
- { "wulala.us", true },
- { "wulfrun-invicta.tk", true },
- { "wumbo.co.nz", true },
- { "wunder.io", true },
- { "wunderkarten.de", true },
- { "wunderlist.com", true },
- { "wundernas.ch", true },
- { "wundi.net", true },
- { "wunschzettel.de", true },
- { "wuppertaler-kurrende.com", false },
- { "wuppertaler-kurrende.de", true },
- { "wutianyi.com", true },
- { "wuxiaohen.com", true },
- { "wuyiwa.net", true },
- { "wuz.it", true },
- { "wuzigackl.de", false },
- { "wvg.myds.me", true },
- { "wvpbs.ml", true },
- { "ww-design.ch", true },
- { "ww00228.com", false },
- { "ww0512.com", true },
- { "ww8989.com", true },
- { "ww9297.co", true },
- { "wweforums.net", true },
- { "wweichen.com.cn", true },
- { "wwgc2011.se", true },
- { "wwin818.com", true },
- { "wwjd.dynu.net", true },
- { "wwv-8722.com", true },
- { "wwvip88.com", true },
- { "www-5287.com", true },
- { "www-8225.com", true },
- { "www-8522.com", true },
- { "www-9822.com", true },
- { "www-railto.com", true },
- { "www.aclu.org", false },
- { "www.airbnb.com", true },
- { "www.amazon.ca", true },
- { "www.amazon.cn", true },
- { "www.amazon.co.jp", true },
- { "www.amazon.co.uk", true },
- { "www.amazon.com", true },
- { "www.amazon.com.au", true },
- { "www.amazon.com.br", true },
- { "www.amazon.com.mx", true },
- { "www.amazon.de", true },
- { "www.amazon.es", true },
- { "www.amazon.fr", true },
- { "www.amazon.it", true },
- { "www.amazon.nl", true },
- { "www.banking.co.at", false },
- { "www.braintreepayments.com", false },
- { "www.capitainetrain.com", false },
- { "www.cloudflare.com", false },
- { "www.cnet.com", true },
- { "www.dropbox.com", true },
- { "www.dropcam.com", false },
- { "www.entropia.de", false },
- { "www.eternalgoth.co.uk", true },
- { "www.etsy.com", true },
- { "www.evernote.com", false },
- { "www.facebook.com", false },
- { "www.fastmail.com", true },
- { "www.ft.com", true },
- { "www.g.co", false },
- { "www.gamesdepartment.co.uk", true },
- { "www.getcloak.com", false },
- { "www.gmail.com", false },
- { "www.googlemail.com", false },
- { "www.gov.uk", false },
- { "www.govt.nz", true },
- { "www.grc.com", false },
- { "www.healthcare.gov", false },
- { "www.heliosnet.com", true },
- { "www.honeybadger.io", false },
- { "www.hyatt.com", true },
- { "www.intercom.io", true },
- { "www.irccloud.com", false },
- { "www.linode.com", false },
- { "www.lookout.com", false },
- { "www.messenger.com", true },
- { "www.mylookout.com", false },
- { "www.noisebridge.net", true },
- { "www.opsmate.com", true },
- { "www.paypal.com", false },
- { "www.python.org", true },
- { "www.re", true },
- { "www.rememberthemilk.com", true },
- { "www.sb", true },
- { "www.simple.com", false },
- { "www.techrepublic.com", true },
- { "www.theguardian.com", true },
- { "www.therapynotes.com", true },
- { "www.tinfoilsecurity.com", false },
- { "www.torproject.org", false },
- { "www.tumblr.com", false },
- { "www.twitter.com", false },
- { "www.united.com", true },
- { "www.usaa.com", false },
- { "www.viasinc.com", false },
- { "www.vino75.com", false },
- { "www.wepay.com", false },
- { "www.wordpress.com", false },
- { "www.zdnet.com", true },
- { "www00228a.com", false },
- { "www00228b.com", false },
- { "www00228d.com", false },
- { "www00228e.com", false },
- { "www68277.com", true },
- { "wwwindows.co.uk", true },
- { "wwwrailto.com", true },
- { "wwwwnews.tk", true },
- { "wx6688.cc", true },
- { "wxcafe.net", true },
- { "wxdisco.com", true },
- { "wxforums.com", true },
- { "wxh.jp", true },
- { "wxhbts.com", true },
- { "wxkxsw.com", true },
- { "wxlog.cn", true },
- { "wxster.com", true },
- { "wxw.moe", true },
- { "wy188.cc", true },
- { "wyam.io", true },
- { "wyatttauber.com", true },
- { "wybar.uk", true },
- { "wyckoff.pro", true },
- { "wyckoff.vip", true },
- { "wycrow.com", true },
- { "wyczaruj.pl", true },
- { "wyday.com", true },
- { "wygibanki.pl", true },
- { "wygodnie.pl", true },
- { "wyhpartnership.co.uk", true },
- { "wyldfiresignage.com", true },
- { "wyo.cam", true },
- { "wyomingurology.com", true },
- { "wyrickstaxidermy.com", true },
- { "wyrihaximus.net", true },
- { "wyrimaps.net", true },
- { "wyssmuller.ch", false },
- { "wysz.com", true },
- { "wywabmnie.pl", true },
- { "wyydsb.cn", true },
- { "wyydsb.com", true },
- { "wyydsb.xin", true },
- { "wyzphoto.nl", true },
- { "wzilverschoon.nl", true },
- { "wzp.ovh", true },
- { "wzrd.in", true },
- { "wzxaini9.com", true },
- { "wzyboy.org", true },
- { "x-6.pl", true },
- { "x-charge.uk", true },
- { "x-iweb.ru", true },
- { "x-lan.be", true },
- { "x-one.co.jp", true },
- { "x.io", true },
- { "x.st", true },
- { "x001.org", true },
- { "x00701.com", true },
- { "x00708.com", true },
- { "x00738.com", true },
- { "x00776.com", true },
- { "x00786.com", true },
- { "x0r.be", true },
- { "x10006.com", false },
- { "x10007.com", false },
- { "x10008.com", false },
- { "x13.com", true },
- { "x2816.com", true },
- { "x2d2.de", false },
- { "x3515.com", true },
- { "x3618.com", true },
- { "x36533.com", true },
- { "x36594.com", true },
- { "x378.ch", true },
- { "x3789.com", true },
- { "x3801.com", true },
- { "x3802.com", true },
- { "x3803.com", true },
- { "x3804.com", true },
- { "x3805.com", true },
- { "x3807.com", true },
- { "x3815.com", true },
- { "x3816.com", true },
- { "x3828.com", true },
- { "x3927.com", true },
- { "x69.biz", true },
- { "x69x.net", true },
- { "x6r3p2yjg1g6x7iu.myfritz.net", true },
- { "x7008.com", false },
- { "x7713.com", true },
- { "x7718.com", true },
- { "x7719.com", true },
- { "x7782.com", true },
- { "x7785.com", true },
- { "x7795.com", true },
- { "x77dd.com", true },
- { "x77ee.com", true },
- { "x77hh.com", true },
- { "x77jj.com", true },
- { "x77kk.com", true },
- { "x77mm.com", true },
- { "x77nn.com", true },
- { "x77pp.com", true },
- { "x77qq.com", true },
- { "x77tt.com", true },
- { "x77ww.com", true },
- { "x7plus.com", true },
- { "x81818.com", true },
- { "x9015.com", false },
- { "x9017.com", false },
- { "x9297.co", true },
- { "x9701.com", false },
- { "x9718.com", false },
- { "xa.search.yahoo.com", false },
- { "xa1.uk", true },
- { "xab123.com", true },
- { "xab4.com", true },
- { "xab456.com", true },
- { "xab678.com", true },
- { "xab678a.com", true },
- { "xab678b.com", true },
- { "xab678c.com", true },
- { "xab678d.com", true },
- { "xab789.com", true },
- { "xab799.com", true },
- { "xab899.com", true },
- { "xaba.tk", true },
- { "xacker.tk", true },
- { "xaffit.com", true },
- { "xahbspl.com", true },
- { "xakepctbo.tk", true },
- { "xanadu-auto.cz", true },
- { "xanadu-catering.cz", true },
- { "xanadu-golf.cz", true },
- { "xanadu-taxi.cz", true },
- { "xanadu-trans.cz", true },
- { "xanhdecor.com", true },
- { "xanimalcaps.com", true },
- { "xants.de", true },
- { "xanyl.de", true },
- { "xarangallomangallo.tk", true },
- { "xatr0z.org", false },
- { "xaver.su", true },
- { "xavierdmello.com", true },
- { "xavita.uk", true },
- { "xaxax.ru", true },
- { "xb052.com", true },
- { "xb053.com", true },
- { "xb056.com", true },
- { "xb057.com", true },
- { "xb058.com", true },
- { "xb83studio.ch", true },
- { "xbb.hk", true },
- { "xbb.li", true },
- { "xbdmov.com", true },
- { "xbertschy.com", true },
- { "xblau.com", true },
- { "xboxachievements.com", true },
- { "xboxlivegoldshop.nl", true },
- { "xboxonex.shop", true },
- { "xbrl.online", true },
- { "xbrlsuccess.appspot.com", true },
- { "xbtce.com", true },
- { "xbtmusic.org", false },
- { "xc9988.cc", true },
- { "xceedgaming.com", true },
- { "xcentricmold.com", true },
- { "xcharge.uk", true },
- { "xcler8.com", true },
- { "xclirion-support.de", true },
- { "xcmfu.com", true },
- { "xcorpsolutions.com", true },
- { "xcraftsumulator.ru", true },
- { "xcvb.xyz", true },
- { "xd.cm", true },
- { "xdawn.cn", true },
- { "xdeftor.com", true },
- { "xdos.io", true },
- { "xdown.org", true },
- { "xdtag.com", true },
- { "xdty.org", true },
- { "xecure.zone", true },
- { "xecureit.com", true },
- { "xeedbeam.me", true },
- { "xega.org", true },
- { "xehost.com", true },
- { "xeiropraktiki.gr", true },
- { "xelesante.jp", true },
- { "xendo.net", true },
- { "xenical.tk", true },
- { "xenomedia.nl", true },
- { "xenoncloud.net", true },
- { "xenophile.name", true },
- { "xenoworld.de", true },
- { "xenox-rp.ru", true },
- { "xentho.net", true },
- { "xentox.com", true },
- { "xenum.ua", true },
- { "xerbo.net", false },
- { "xerdeso.tk", true },
- { "xerezdeportivo.tk", true },
- { "xerhost.de", false },
- { "xerkus.pro", true },
- { "xerownia.eu", true },
- { "xeryus.nl", true },
- { "xetown.com", true },
- { "xf5888.com", true },
- { "xfce.space", true },
- { "xfcy.me", true },
- { "xfd3.de", true },
- { "xferion.com", false },
- { "xfix.pw", true },
- { "xfrag-networks.com", true },
- { "xgadget.de", true },
- { "xgame.com.tr", true },
- { "xgclan.com", true },
- { "xgn.es", true },
- { "xgwap.com", true },
- { "xgzepto.cn", true },
- { "xh7ooo.com", true },
- { "xh7ppp.com", true },
- { "xh7qqq.com", true },
- { "xh7rrr.com", true },
- { "xh7sss.com", true },
- { "xh7ttt.com", true },
- { "xh7uuu.com", true },
- { "xh7www.com", true },
- { "xh7xxx.com", true },
- { "xh7zzz.com", true },
- { "xhmikosr.io", true },
- { "xho.me", true },
- { "xia.de", true },
- { "xiamenshipbuilding.com", true },
- { "xiamuzi.com", true },
- { "xiangblog.com", true },
- { "xiangweiqing.co.uk", true },
- { "xiangwenquan.me", true },
- { "xiaocg.xyz", true },
- { "xiaojicdn.com", true },
- { "xiaojiyoupin.com", true },
- { "xiaololi.best", true },
- { "xiaolong.link", true },
- { "xiaomi.eu", true },
- { "xiaoxia.li", true },
- { "xiashali.me", true },
- { "xichtsbuch.de", true },
- { "xicreative.net", true },
- { "xie38.com", true },
- { "xie91.com", true },
- { "xier.ch", true },
- { "xif.at", true },
- { "xifrem.com", true },
- { "xight.org", true },
- { "xilef.org", true },
- { "xilo.net", true },
- { "ximble.com", true },
- { "ximbo.net", false },
- { "xinetwork.net", true },
- { "xingyu1993.cn", true },
- { "xinnermedia.nl", true },
- { "xinnixdeuren-shop.be", true },
- { "xinpujing198.com", false },
- { "xinpujing200.com", false },
- { "xinpujing518.com", false },
- { "xinsane.com", true },
- { "xinu.xyz", true },
- { "xinuspeed.com", true },
- { "xinuspeedtest.com", true },
- { "xinuurl.com", true },
- { "xinxin.pl", true },
- { "xiumu.org", true },
- { "xjd.vision", true },
- { "xjf6.com", true },
- { "xjjeeps.com", true },
- { "xjpvictor.info", true },
- { "xkcd.pw", true },
- { "xkngroup.com", true },
- { "xkviz.net", true },
- { "xkwy2018.cn", true },
- { "xlan.be", true },
- { "xlange.com", true },
- { "xlink.com.pl", true },
- { "xloud.cf", true },
- { "xluxes.jp", true },
- { "xlyingyuan.com", true },
- { "xm.digital", true },
- { "xmag.pl", true },
- { "xmedius.ca", true },
- { "xmedius.com", true },
- { "xmedius.eu", true },
- { "xmenrevolution.com", true },
- { "xmflyrk.com", true },
- { "xmgspace.me", true },
- { "xmlbeam.org", true },
- { "xmpp.dk", true },
- { "xmppwocky.net", true },
- { "xmr.to", true },
- { "xmr.wiki", true },
- { "xmv.cz", true },
- { "xmyy.com", true },
- { "xn-----6kcbjcgl1atjj7aadbkxfxfe7a9yia.xn--p1ai", true },
- { "xn----8hcdn2ankm1bfq.com", true },
- { "xn----9sbkdigdao0de1a8g.com", true },
- { "xn----ncfb.ws", true },
- { "xn--0iv967ab7w.xn--rhqv96g", true },
- { "xn--0kq33cz5c8wmwrqqw1d.com", true },
- { "xn--12c3bpr6bsv7c.com", true },
- { "xn--12cg9bnm5ci2ag9hbcs17a.com", true },
- { "xn--13-6kc0bufl.xn--p1ai", true },
- { "xn--158h.ml", false },
- { "xn--2sxs9ol7o.com", true },
- { "xn--3st814ec8r.cn", true },
- { "xn--3stv82k.hk", true },
- { "xn--3stv82k.tw", true },
- { "xn--48jwg508p.net", true },
- { "xn--4brt03c.xn--io0a7i", true },
- { "xn--4pv80kkz8auzf.jp", true },
- { "xn--57h.ml", false },
- { "xn--5dbkjqb0d.com", true },
- { "xn--5dbkjqb0d.net", true },
- { "xn--6o8h.cf", true },
- { "xn--6x6a.life", true },
- { "xn--79q87uvkclvgd56ahq5a.net", true },
- { "xn--7ca.co", true },
- { "xn--7or43h.jp", true },
- { "xn--7xa.google.com", true },
- { "xn--80aafaxhj3c.xn--p1ai", true },
- { "xn--80aanbkcescrdedmxzcl4pmc.xn--p1acf", true },
- { "xn--80adbevek3air0ee9b8d.com", true },
- { "xn--80adbvdjzhptl1be6j.com", true },
- { "xn--80aejljbfwxn.xn--p1ai", true },
- { "xn--80ageukloel.xn--p1ai", true },
- { "xn--80ahclcaoccacrhfebi0dcn5c1jh.xn--p1ai", true },
- { "xn--80aihgal0apt.xn--p1ai", true },
- { "xn--80akjfhoqm2h2a.xn--p1ai", true },
- { "xn--80ancacgircb8q.xn--p1ai", true },
- { "xn--80azelb.xn--p1ai", true },
- { "xn--8bi.gq", false },
- { "xn--8n2am80a.tech", true },
- { "xn--90accgba6bldkcbb7a.xn--p1acf", true },
- { "xn--90acjfgylpnm.xn--90ais", true },
- { "xn--90adahrqfmec.xn--p1ai", true },
- { "xn--95q32l0t6b9cb17l.cn", true },
- { "xn--9xa.fun", true },
- { "xn--agncia-4ua.cat", true },
- { "xn--allgu-biker-o8a.de", true },
- { "xn--anyd-7na.at", true },
- { "xn--aviao-dra1a.pt", true },
- { "xn--b3c4f.xn--o3cw4h", true },
- { "xn--babassul-t4a.de", true },
- { "xn--bachblten-tee-1ob.de", true },
- { "xn--baron-bonzenbru-elb.com", true },
- { "xn--bcher-bestseller-jzb.com", true },
- { "xn--bcherbestseller-zvb.com", true },
- { "xn--bckerei-trster-5hb11a.de", true },
- { "xn--bckerei-wohlgemuth-ltb.de", true },
- { "xn--ben-bank-8za.dk", true },
- { "xn--benbank-dxa.dk", true },
- { "xn--bersetzung-8db.cc", true },
- { "xn--berwachungspaket-izb.at", true },
- { "xn--birkenblttertee-7kb.de", true },
- { "xn--brneruhr-0za.ch", true },
- { "xn--brombeerblttertee-zqb.de", true },
- { "xn--bucheckernl-0fb.de", true },
- { "xn--cck4ax91r.com", true },
- { "xn--cck7f515h.com", true },
- { "xn--cckdrt0kwb4g3cnh.com", true },
- { "xn--cctsgy36bnvprwpekc.com", true },
- { "xn--cfa.site", true },
- { "xn--chrysanthemenbltentee-nic.de", true },
- { "xn--cisowcy-pjb5t.pl", true },
- { "xn--d1acj9c.xn--90ais", true },
- { "xn--depias-zwa.es", true },
- { "xn--detrkl13b9sbv53j.com", true },
- { "xn--detrkl13b9sbv53j.org", true },
- { "xn--dmonenjger-q5ag.net", true },
- { "xn--dmontaa-9za.com", true },
- { "xn--dragni-g1a.de", true },
- { "xn--dtursfest-72a.dk", true },
- { "xn--durhre-yxa.de", true },
- { "xn--e1aaavheew.xn--p1ai", true },
- { "xn--e1aaavheewr.xn--p1ai", true },
- { "xn--e1adlfhcdo7h.xn--p1ai", true },
- { "xn--eebao6b.com", true },
- { "xn--eebao6b.net", true },
- { "xn--ehqw04eq6e.jp", true },
- { "xn--erban-e9b.ro", true },
- { "xn--erklderbarenben-slbh.dk", true },
- { "xn--et8h.cf", false },
- { "xn--f9jh4f4b4993b66s.tokyo", true },
- { "xn--familie-pppinghaus-l3b.de", true },
- { "xn--feuerlscher-arten-4zb.de", true },
- { "xn--fiqwix98h.jp", true },
- { "xn--fischereiverein-mnsterhausen-i7c.de", true },
- { "xn--fp8h58f.ws", true },
- { "xn--frankierknig-djb.de", true },
- { "xn--fs5ak3f.com", true },
- { "xn--gfrr-7qa.li", true },
- { "xn--gfrrli-yxa.ch", true },
- { "xn--ggle-qoaa.com", true },
- { "xn--grnderlehrstuhl-0vb.de", true },
- { "xn--gstehaus-leipzig-vnb.de", true },
- { "xn--heidebltentee-2ob.de", true },
- { "xn--heilendehnde-ocb.de", true },
- { "xn--hgbk4a00a.com", true },
- { "xn--hibiskusbltentee-szb.de", true },
- { "xn--hllrigl-90a.at", true },
- { "xn--i2ru8q2qg.com", true },
- { "xn--ikketenkpdet-1cb.no", true },
- { "xn--imker-in-nrnberg-szb.de", true },
- { "xn--irr.xn--fiqs8s", true },
- { "xn--is8h6d.gq", false },
- { "xn--j1aoca.xn--p1ai", true },
- { "xn--j8se.com", true },
- { "xn--jda.tk", true },
- { "xn--jp8hx8f.ws", true },
- { "xn--kda.tk", true },
- { "xn--kkcon-fwab.nz", true },
- { "xn--kl-oja.is", true },
- { "xn--klmek-0sa.com", true },
- { "xn--knstler-n2a.tips", false },
- { "xn--ktha-kamrater-pfba.se", true },
- { "xn--l8js6h476m.xn--q9jyb4c", true },
- { "xn--labanskllermark-ftb.se", true },
- { "xn--lavendelblten-tee-c3b.de", true },
- { "xn--lckwg.net", true },
- { "xn--lnakuten-9za.com", true },
- { "xn--love-un4c7e0d4a.com", true },
- { "xn--lsaupp-iua.se", true },
- { "xn--lskieradio-3gb44h.pl", true },
- { "xn--lt9h.cf", true },
- { "xn--manuela-stsser-psb.de", true },
- { "xn--maracujal-77a.de", true },
- { "xn--martnvillalba-zib.com", true },
- { "xn--martnvillalba-zib.net", true },
- { "xn--matua-n7a.pl", true },
- { "xn--mein-kchenhelfer-ozb.de", true },
- { "xn--mentaltraining-fr-musiker-uwc.ch", true },
- { "xn--mgbbh2a9fub.xn--ngbc5azd", false },
- { "xn--mgbmmp7eub.com", true },
- { "xn--mgbpkc7fz3awhe.com", true },
- { "xn--mgbuq0c.net", true },
- { "xn--mgi-qla.life", true },
- { "xn--mhringen-65a.de", true },
- { "xn--mntsamling-0cb.dk", true },
- { "xn--myrepubic-wub.net", true },
- { "xn--myrepublc-x5a.net", true },
- { "xn--n8j7dygrbu0c31a5861bq8qb.com", true },
- { "xn--n8jp5083dnzs.net", true },
- { "xn--n8jtcugp92n4wc738f.net", true },
- { "xn--nidar-tib.org", true },
- { "xn--nide-loa.ee", true },
- { "xn--o38h.tk", true },
- { "xn--oiqt18e8e2a.eu.org", true },
- { "xn--p8j9a0d9c9a.xn--q9jyb4c", true },
- { "xn--pbt947am3ab71g.com", true },
- { "xn--pckm3a1bi21a.com", true },
- { "xn--pe-bka.ee", true },
- { "xn--pn1am9c.com", true },
- { "xn--pq1a637b.xn--6qq986b3xl", true },
- { "xn--prfontaine-c7a.name", true },
- { "xn--prt783d.xn--6qq986b3xl", true },
- { "xn--q9jb1h5dvcspke3218b9mn4p0c.com", true },
- { "xn--r8jzaf7977b09e.com", true },
- { "xn--rb-fka.it", true },
- { "xn--rdiger-kuhlmann-zvb.de", true },
- { "xn--reisebro-herrsching-bbc.de", true },
- { "xn--rlcus7b3d.xn--xkc2dl3a5ee0h", true },
- { "xn--roselire-60a.ch", false },
- { "xn--roselire-60a.com", false },
- { "xn--rosenbltentee-2ob.de", true },
- { "xn--rt-cja.ie", true },
- { "xn--rtter-kva.eu", true },
- { "xn--ruanmller-u9a.com", true },
- { "xn--s-0fa.fi", true },
- { "xn--s-1gaa.fi", true },
- { "xn--schcke-yxa.de", true },
- { "xn--schlerzeitung-ideenlos-ulc.de", true },
- { "xn--schpski-c1a.de", true },
- { "xn--schsischer-christstollen-qbc.shop", true },
- { "xn--schwarzkmmeloel-6vb.de", true },
- { "xn--solidaritt-am-ort-yqb.de", true },
- { "xn--strandhaus-hinter-der-dne-1wc.de", true },
- { "xn--svezavaukuu-ulb08i.rs", true },
- { "xn--sz8h.ml", true },
- { "xn--t-oha.lv", true },
- { "xn--t8j4aa4nzg3a5euoxcwee.xyz", true },
- { "xn--tagungssttte-usedom-owb.de", true },
- { "xn--tagungssttte-zinnowitz-84b.de", true },
- { "xn--tigreray-i1a.org", true },
- { "xn--u8jvc1drbz972aywbk0by95ffo1aqm1c.com", true },
- { "xn--u8jwd.ga", true },
- { "xn--u9j0ia6hb7347cg8wavz0avb0e.com", true },
- { "xn--u9jv84l7ea468b.com", true },
- { "xn--uasacrilicas-9gb.net", true },
- { "xn--uisz44m.online", true },
- { "xn--ukasik-2db.pl", true },
- { "xn--underux-0za.eu", true },
- { "xn--v-wfa35g.ro", true },
- { "xn--v4q.ml", true },
- { "xn--v6q426ishax2a.xyz", true },
- { "xn--wby9t.xyz", true },
- { "xn--weidenrschen-tee-swb.de", true },
- { "xn--wq9h.ml", false },
- { "xn--y-5ga.com", true },
- { "xn--y8jarb5hca.jp", true },
- { "xn--z1tq4ldt4b.com", true },
- { "xn--zettlmeil-n1a.de", true },
- { "xn5.de", true },
- { "xnaas.info", true },
- { "xnet-x.net", true },
- { "xninja.xyz", true },
- { "xnode.org", true },
- { "xntrik.wtf", true },
- { "xnu.kr", true },
- { "xo.tc", true },
- { "xoh.at", true },
- { "xolotto.com", true },
- { "xolphin.nl", true },
- { "xombitgames.com", true },
- { "xombitmusic.com", true },
- { "xone.cz", false },
- { "xonn.de", true },
- { "xoommit.com", true },
- { "xor.cat", true },
- { "xotv.top", true },
- { "xp-ochrona.pl", true },
- { "xp.nsupdate.info", true },
- { "xp2.de", true },
- { "xpa.be", true },
- { "xpbytes.com", true },
- { "xpd.se", true },
- { "xperidia.com", true },
- { "xpertcube.com", true },
- { "xpj567088.com", true },
- { "xpj567288.com", true },
- { "xpj567388.com", true },
- { "xpj567888.com", true },
- { "xpjai.com", true },
- { "xpjiosapp.com", true },
- { "xpletus.nl", true },
- { "xpoc.pro", true },
- { "xpods.sg", true },
- { "xqk7.com", true },
- { "xr.cx", true },
- { "xr1s.me", true },
- { "xrg.cz", true },
- { "xrockx.de", true },
- { "xrp.pp.ua", true },
- { "xrptoolkit.com", true },
- { "xrwracing-france.com", true },
- { "xs00228.com", false },
- { "xs2a.no", true },
- { "xsec.me", true },
- { "xserownia.com.pl", true },
- { "xserownia.eu", true },
- { "xserownia.net", true },
- { "xss.name", true },
- { "xss.sk", true },
- { "xssi.uk", true },
- { "xsteam.eu", true },
- { "xstreamable.com", true },
- { "xsuper.net", true },
- { "xtaboo3d.com", true },
- { "xtarget.ru", true },
- { "xtom.africa", true },
- { "xtom.chat", true },
- { "xtom.com", true },
- { "xtom.com.hk", true },
- { "xtom.wiki", true },
- { "xtrainsights.com", true },
- { "xtravans.com", true },
- { "xtremebouncepartyhire.com.au", true },
- { "xtremecoatingtechnologies.com", true },
- { "xtrememidlife.nl", true },
- { "xtronics.com", true },
- { "xts3636.net", true },
- { "xtu2.com", true },
- { "xuab.net", true },
- { "xubo666.com", true },
- { "xuc.me", true },
- { "xucha.ml", true },
- { "xueanquan.com", true },
- { "xuedianshang.com", true },
- { "xuehao.tech", true },
- { "xujan.com", true },
- { "xuming.studio", true },
- { "xunleiyy.com", true },
- { "xunn.io", true },
- { "xuntier.ch", true },
- { "xuonggiaynu.vn", true },
- { "xurl.gq", true },
- { "xuwei.de", true },
- { "xvii.pl", true },
- { "xviimusic.com", true },
- { "xwaretech.info", true },
- { "xwf.fyi", true },
- { "xx0r.eu", true },
- { "xx9297.co", true },
- { "xxffo.com", true },
- { "xxgalgame.com", true },
- { "xxiz.com", true },
- { "xxxbunker.com", true },
- { "xxxladyboysporn.com", true },
- { "xxxoopz.com", true },
- { "xxxred.net", true },
- { "xxxsuper.net", true },
- { "xy366.cc", true },
- { "xy369.cc", true },
- { "xy6161.com", true },
- { "xy6262.com", true },
- { "xy6363.com", true },
- { "xy7171.com", true },
- { "xy7272.com", true },
- { "xy7373.com", true },
- { "xybabyshop.com", true },
- { "xyenon.bid", true },
- { "xyfun.net", false },
- { "xylerfox.ca", true },
- { "xyloefarmoges.gr", true },
- { "xywing.com", true },
- { "xyz.blue", true },
- { "xyzulu.hosting", true },
- { "xzclip.cn", true },
- { "xzibits.com", true },
- { "xzy.es", false },
- { "y11n.net", true },
- { "y2g.me", true },
- { "y3650.com", true },
- { "y36500.com", true },
- { "y3651.com", true },
- { "y36511.com", true },
- { "y3653.com", true },
- { "y36533.com", true },
- { "y3654.com", true },
- { "y3656.com", true },
- { "y36577.com", true },
- { "y36594.com", true },
- { "y68aa.com", true },
- { "y68cc.com", true },
- { "y68dd.com", true },
- { "y68ee.com", true },
- { "y68ff.com", true },
- { "y68gg.com", true },
- { "y68hh.com", true },
- { "y68ii.com", true },
- { "y68jj.com", true },
- { "y68ll.com", true },
- { "y68oo.com", true },
- { "y68pp.com", true },
- { "y68qq.com", true },
- { "y68rr.com", true },
- { "y68tt.com", true },
- { "y68uu.com", true },
- { "y68yy.com", true },
- { "y68zz.com", true },
- { "y70101.com", true },
- { "y70102.com", true },
- { "y70103.com", true },
- { "y70104.com", true },
- { "y70105.com", true },
- { "y70301.com", true },
- { "y70302.com", true },
- { "y70303.com", true },
- { "y888.ag", true },
- { "y890000.com", false },
- { "y891111.com", false },
- { "y893333.com", false },
- { "y894444.com", false },
- { "y896666.com", false },
- { "y897777.com", false },
- { "y89b.com", false },
- { "y89c.com", false },
- { "y89ccc.com", false },
- { "y89dd.com", false },
- { "y89e.com", false },
- { "y89ee.com", false },
- { "y89fff.com", true },
- { "y89g.com", false },
- { "y89hhh.com", false },
- { "y89i.net", false },
- { "y89iii.com", false },
- { "y89j.com", false },
- { "y89j.net", false },
- { "y89jj.com", false },
- { "y89l.com", false },
- { "y89m.com", false },
- { "y89s.com", false },
- { "y89v.com", false },
- { "y89zz.com", false },
- { "y9297.co", true },
- { "ya.mk", true },
- { "yabuisha.jp", true },
- { "yachigoya.com", true },
- { "yachtfolio.com", true },
- { "yachtfolio1.com", true },
- { "yachting-home.com", true },
- { "yachtlettering.com", true },
- { "yacobo.com", true },
- { "yafuoku.ru", true },
- { "yagmursoft.tk", true },
- { "yagoda-malina.tk", true },
- { "yahan.tv", true },
- { "yaharu.ru", true },
- { "yahvehyireh.com", true },
- { "yak-soap.co", true },
- { "yak.is", true },
- { "yakmade.com", true },
- { "yakmail.tech", true },
- { "yakmoo.se", true },
- { "yalcinkaya.ninja", false },
- { "yallamotor.com", true },
- { "yalook.com", true },
- { "yama.su", true },
- { "yamadaya.tv", true },
- { "yamaken.jp", false },
- { "yamal-online.ml", true },
- { "yamashita-clinic.org", true },
- { "yame2.com", true },
- { "yamei1188.com", true },
- { "yamei2233.com", true },
- { "yamei8866.com", true },
- { "yamei99.com", true },
- { "yamei9922.com", true },
- { "yamei9955.com", true },
- { "yamilafeinart.de", true },
- { "yamm.io", true },
- { "yana-co.ir", true },
- { "yanaduday.com", true },
- { "yanbohon.com", true },
- { "yandere.moe", true },
- { "yangfamily.tw", true },
- { "yangjingwen.cn", true },
- { "yangmaodang.org", true },
- { "yangruixin.com", true },
- { "yanik.info", true },
- { "yann.tw", true },
- { "yanngraf.ch", false },
- { "yanngraf.com", false },
- { "yannic.world", false },
- { "yannick.cloud", true },
- { "yannickb.de", true },
- { "yanniclandsmann.de", true },
- { "yannik-buerkle.de", true },
- { "yannikbloscheck.com", true },
- { "yannyann.site", true },
- { "yanovich.net", true },
- { "yans.io", true },
- { "yanservices.be", true },
- { "yantox.com", true },
- { "yantrasthal.com", true },
- { "yap26.cc", true },
- { "yapan008.com", true },
- { "yapan1.com", true },
- { "yapan10.com", true },
- { "yapan11.com", true },
- { "yapan2.com", true },
- { "yapan22.com", true },
- { "yapan222.com", true },
- { "yapan3.com", true },
- { "yapan33.com", true },
- { "yapan333.com", true },
- { "yapan365.net", true },
- { "yapan4.com", true },
- { "yapan44.com", true },
- { "yapan444.com", true },
- { "yapan5.com", true },
- { "yapan55.com", true },
- { "yapan555.com", true },
- { "yapan6.com", true },
- { "yapan66.com", true },
- { "yapan666.com", true },
- { "yapan7.com", true },
- { "yapan77.com", true },
- { "yapan777.com", true },
- { "yapan888.com", true },
- { "yapan9.com", true },
- { "yapan99.com", true },
- { "yapan999.com", true },
- { "yapanwang.com", true },
- { "yapbreak.fr", true },
- { "yapeal.ch", true },
- { "yappy.com", true },
- { "yarapilates.com.br", true },
- { "yarcom.ru", false },
- { "yardesign.tk", true },
- { "yardley.digital", true },
- { "yarravilletownhouses.com.au", true },
- { "yaru.one", true },
- { "yaseminuzumcu.com", true },
- { "yashik.tv", true },
- { "yassine-ayari.com", true },
- { "yatesun.com", true },
- { "yatorie.net", true },
- { "yatstudios.com", true },
- { "yatsuenpoon.com", true },
- { "yauatcha.com", true },
- { "yaup.tk", true },
- { "yavin4.cf", true },
- { "yavorivanov.com", true },
- { "yawen.me", true },
- { "yaws.cf", true },
- { "yaxim.org", true },
- { "yayl888.com", true },
- { "ybdh88.com", true },
- { "ybin.me", true },
- { "ybos.nl", true },
- { "ybresson.com", true },
- { "ybsul.com", true },
- { "ybti.net", true },
- { "ybvip789.com", true },
- { "ybzhao.com", true },
- { "ycbmdevelopment.com", true },
- { "ycbmstaging.com", true },
- { "ych.art", true },
- { "ycherbonnel.fr", true },
- { "ychon.com", true },
- { "yclan.net", true },
- { "ycnrg.org", true },
- { "ycwt.com", true },
- { "yd163.cc", true },
- { "yd169.cc", true },
- { "ydiversa.com", true },
- { "ydraulikos.top", true },
- { "ydyy99.com", true },
- { "yeah-shop.com.ua", true },
- { "yeahwu.com", true },
- { "yeapdata.com", true },
- { "yecl.net", true },
- { "yeesker.com", true },
- { "yellowhawk.nl", true },
- { "yellowparachute.com", true },
- { "yellowsquid.co.uk", true },
- { "yellowsquid.uk", true },
- { "yelon.hu", true },
- { "yelp.at", true },
- { "yelp.be", true },
- { "yelp.ca", true },
- { "yelp.ch", true },
- { "yelp.cl", true },
- { "yelp.co.jp", true },
- { "yelp.co.nz", true },
- { "yelp.co.uk", true },
- { "yelp.com", true },
- { "yelp.com.ar", true },
- { "yelp.com.au", true },
- { "yelp.com.br", true },
- { "yelp.com.hk", true },
- { "yelp.com.mx", true },
- { "yelp.com.ph", true },
- { "yelp.com.sg", true },
- { "yelp.com.tr", true },
- { "yelp.com.tw", true },
- { "yelp.cz", true },
- { "yelp.de", true },
- { "yelp.dk", true },
- { "yelp.es", true },
- { "yelp.fi", true },
- { "yelp.fr", true },
- { "yelp.ie", true },
- { "yelp.it", true },
- { "yelp.my", true },
- { "yelp.nl", true },
- { "yelp.no", true },
- { "yelp.pl", true },
- { "yelp.pt", true },
- { "yelp.se", true },
- { "yemektarifleri.com", true },
- { "yemenlink.tk", true },
- { "yeniexpo.com", true },
- { "yep-pro.ch", false },
- { "yeptechnology.store", true },
- { "yert.pink", true },
- { "yes.com", true },
- { "yes35.ru", true },
- { "yesh.lk", true },
- { "yesiammaisey.me", true },
- { "yesildiyetisyen.com", true },
- { "yesod.in", true },
- { "yesornut.com", true },
- { "yestees.com", true },
- { "yesteryear-chronicle.cf", true },
- { "yeswehack.com", true },
- { "yeti.gq", true },
- { "yetii.net", true },
- { "yetzt.me", false },
- { "yex.trade", true },
- { "yf128.cc", true },
- { "yfengs.moe", true },
- { "ygm.org.uk", true },
- { "ygobbs.com", true },
- { "ygrene.com", true },
- { "yh12366.com", true },
- { "yh56787.com", true },
- { "yh599.cc", true },
- { "yh811.com", true },
- { "yh98768.com", true },
- { "yhaupenthal.org", true },
- { "yhe.me", true },
- { "yhenke.de", true },
- { "yhfou.com", true },
- { "yhhh.org", true },
- { "yhndnzj.com", true },
- { "yhrd.org", true },
- { "yicipick.com", true },
- { "yicivideo.com", true },
- { "yiff.forsale", true },
- { "yigujin.cn", true },
- { "yihouse.tw", true },
- { "yijia.support", true },
- { "yikeyong.com", true },
- { "yiluup.com", true },
- { "yimgo.fr", false },
- { "yinduyy.com", true },
- { "yinfor.com", true },
- { "yingatech.com", true },
- { "yinglinda.love", true },
- { "yingyj.com", true },
- { "yinlei.org", true },
- { "yinulo.com", true },
- { "yipingguo.com", true },
- { "yiyuanzhong.com", true },
- { "yiyueread.com", true },
- { "yiz96.com", true },
- { "yjst.cn", true },
- { "ykn.fr", true },
- { "ykqpw.com", true },
- { "yksityisyydensuoja.fi", true },
- { "yl366.cc", true },
- { "yl369.cc", true },
- { "ylde.de", true },
- { "ylinternal.com", true },
- { "ym063.com", true },
- { "ym181.com", true },
- { "ymarion.de", true },
- { "ymatyt.com", true },
- { "ymoah.nl", true },
- { "ymtsonline.org", true },
- { "yoa.st", true },
- { "yoast.com", true },
- { "yoba.co.uk", true },
- { "yobai-grouprec.jp", true },
- { "yobasystems.co.uk", true },
- { "yobify.com", true },
- { "yocto.xyz", true },
- { "yodababy.com.tw", true },
- { "yoelelbaz.ch", true },
- { "yoga-alliance-teacher-training.com", true },
- { "yoga-bad-toelz.de", true },
- { "yoga-in-aying.de", true },
- { "yoga-school.xyz", true },
- { "yoga-zentrum-narayani.de", true },
- { "yogacentric.co.uk", true },
- { "yogadeux.nl", true },
- { "yogaemmental.ch", true },
- { "yogahealsinc.org", true },
- { "yogamarlene.ch", true },
- { "yogamaya9.com", true },
- { "yogamea.school", true },
- { "yogamexico.net", true },
- { "yogananda-roma.org", true },
- { "yogaprague.com", true },
- { "yogaschoolrishikesh.com", true },
- { "yogaschule-herzraum.de", true },
- { "yogeshbeniwal.com", false },
- { "yogshrihealing.com", true },
- { "yohanesmario.com", true },
- { "yoitoko.city", true },
- { "yoitsu.moe", true },
- { "yokohama-legaloffice.jp", true },
- { "yolandgao.me", true },
- { "yolo.jetzt", true },
- { "yolobert.de", true },
- { "yoloboatrentals.com", true },
- { "yolocamgirls.com", true },
- { "yolops.net", true },
- { "yoloyolo.top", true },
- { "yombo.net", true },
- { "yomi.moe", true },
- { "yon.co.il", true },
- { "yonema.com", true },
- { "yongbin.org", true },
- { "yoonas.com", true },
- { "yooomu.com", true },
- { "yooooex.com", true },
- { "yooptopian.com", true },
- { "yoppoy.com", true },
- { "yoramvandevelde.net", true },
- { "yorcom.nl", false },
- { "yorcool.nl", true },
- { "yordanisp.tk", true },
- { "yorkieloverdiy.com", true },
- { "yorkshiredalesinflatables.co.uk", true },
- { "yorkshiregardensheds.co.uk", true },
- { "yorkshireinflatables.co.uk", true },
- { "yorname.ml", false },
- { "yornik.nl", true },
- { "yosakoinight.com", true },
- { "yosbeda.com", true },
- { "yoshibaworks.com", true },
- { "yoshitsugu.net", true },
- { "yosida-dental.com", true },
- { "yosida95.com", true },
- { "yospos.org", true },
- { "yotta-zetta.com", true },
- { "yotubaiotona.net", true },
- { "you.com.br", true },
- { "you2you.fr", true },
- { "youber.cz", true },
- { "youc.ir", true },
- { "youcanmakeit.at", true },
- { "youcruit.com", true },
- { "youdamom.com", true },
- { "youdungoofd.com", true },
- { "yougee.ml", true },
- { "youhavewords.com", true },
- { "youhs.top", true },
- { "youhua.ru", true },
- { "youkaryote.com", true },
- { "youkaryote.org", true },
- { "youked.com", true },
- { "youmiracle.com", true },
- { "youmonit.me", true },
- { "youms.de", true },
- { "younameit.ru", true },
- { "youneedfame.com", true },
- { "young-brahmousin.com", true },
- { "young-sheldon.com", true },
- { "youngauthentic.cf", true },
- { "youngdogs.org", true },
- { "youngfree.cn", true },
- { "youngmodelsagency.tk", true },
- { "youngsook.com", true },
- { "youngsook.org", true },
- { "youngvoicesmatter.org", true },
- { "youpark.no", true },
- { "youpickfarms.org", true },
- { "your-dns.run", true },
- { "your-erotic-stories.com", true },
- { "your-forum.tk", true },
- { "your-out.com", true },
- { "youracnepro.com", true },
- { "youran.me", false },
- { "yourantiquarian.com", false },
- { "yourazbraces.com", true },
- { "yourbetterkitchen.com", true },
- { "yourbittorrent.host", true },
- { "yourbittorrent.icu", true },
- { "yourbittorrent.pw", true },
- { "yourbittorrent2.com", true },
- { "yourbodyknows.dk", true },
- { "yourbodyknows.is", true },
- { "yourcareerhost.com", true },
- { "yourciso.com", true },
- { "yourcleaningcompany.net", true },
- { "yourcopywriter.it", true },
- { "yourdailyalerts.net", true },
- { "youreallyneedthis.co", true },
- { "youregeeks.com", true },
- { "yourforex.org", true },
- { "yourfuntrivia.com", true },
- { "yourfuturestrategy.com.au", true },
- { "yourgames.tv", true },
- { "yourkrabivilla.com", true },
- { "yourlanguages.de", true },
- { "yourloan.gq", true },
- { "yourmagicstory.tk", true },
- { "yourname.xyz", true },
- { "yourneighborhub.com", true },
- { "yourpersonalfrance.com", true },
- { "yourpocketbook.uk", true },
- { "yourscotlandtour.co.uk", true },
- { "yourskin.nl", true },
- { "yourstage.nl", true },
- { "yourstake.org", true },
- { "yourticketbooking.com", true },
- { "yourtime.tv", true },
- { "yousei.ne.jp", true },
- { "youshouldbealiberal.com", true },
- { "youth.gov", true },
- { "youth2009.org", true },
- { "youthink.jp", true },
- { "youthrules.gov", true },
- { "youtous.me", true },
- { "youtube.com", true },
- { "youtubedownloader.com", true },
- { "youtuberis.lt", true },
- { "youwatchporn.com", true },
- { "youyoulemon.com", true },
- { "yovko.net", true },
- { "yoxall.me.uk", true },
- { "ypart.eu", true },
- { "ypfr.fr", true },
- { "ypid.de", true },
- { "yplanapp.com", true },
- { "yporti.net", true },
- { "ypse.com.br", true },
- { "yqjf68.com", true },
- { "yr166166.com", true },
- { "yr8.com", true },
- { "yrjanheikki.com", true },
- { "yrx.me", true },
- { "ys633.cc", true },
- { "ys6888.cc", true },
- { "ysicing.me", true },
- { "ysicorp.com", true },
- { "yslbeauty.com", true },
- { "ystream.tv", true },
- { "ytcount.com", true },
- { "ytec.ca", true },
- { "ytreza.fr", true },
- { "ytx588.com", true },
- { "yu.vc", true },
- { "yuan.ga", false },
- { "yuan.nctu.me", true },
- { "yuanbaohd.com", true },
- { "yuanben.io", true },
- { "yubanmei.com", true },
- { "yubi.co", true },
- { "yubicloud.io", true },
- { "yubico.ae", true },
- { "yubico.at", true },
- { "yubico.be", true },
- { "yubico.biz", true },
- { "yubico.cloud", true },
- { "yubico.co.in", true },
- { "yubico.co.kr", true },
- { "yubico.co.uk", true },
- { "yubico.com", true },
- { "yubico.com.ar", true },
- { "yubico.cz", true },
- { "yubico.dk", true },
- { "yubico.es", true },
- { "yubico.fi", true },
- { "yubico.in", true },
- { "yubico.info", true },
- { "yubico.io", true },
- { "yubico.mobi", true },
- { "yubico.mx", true },
- { "yubico.net", true },
- { "yubico.online", true },
- { "yubico.org", true },
- { "yubico.pe", true },
- { "yubico.se", true },
- { "yubico.sg", true },
- { "yubico.tv", true },
- { "yubico.uk", true },
- { "yubico.us", true },
- { "yubicodemo.com", true },
- { "yubikey.ae", true },
- { "yubikey.asia", true },
- { "yubikey.at", true },
- { "yubikey.cl", true },
- { "yubikey.co", true },
- { "yubikey.co.uk", true },
- { "yubikey.com", true },
- { "yubikey.com.ar", true },
- { "yubikey.com.au", true },
- { "yubikey.dk", true },
- { "yubikey.fi", true },
- { "yubikey.io", true },
- { "yubikey.mx", true },
- { "yubikey.org", true },
- { "yubikey.pe", true },
- { "yubikey.se", true },
- { "yubikey.sg", true },
- { "yubikey.uk", true },
- { "yubikey.us", true },
- { "yubikeys.net", true },
- { "yubikeys.org", true },
- { "yubikeyservices.eu", true },
- { "yubiking.com", true },
- { "yue.la", true },
- { "yue2.net", true },
- { "yugodi.com", true },
- { "yuhangq.me", true },
- { "yuhindo.com", true },
- { "yuimarukitchen.com", true },
- { "yukari.cafe", true },
- { "yukari.cloud", true },
- { "yuki-nagato.com", true },
- { "yuki.xyz", true },
- { "yukict.com", true },
- { "yukimochi.com", true },
- { "yukimochi.io", true },
- { "yukimochi.jp", true },
- { "yukimochi.net", true },
- { "yukonconnector.com", true },
- { "yukonlip.com", true },
- { "yukontec.com", true },
- { "yukoslibrary.ga", true },
- { "yuleyule88game.com", true },
- { "yumeconcert.com", true },
- { "yumiandryan.com", true },
- { "yuncaioo.com", true },
- { "yunhu365.com", true },
- { "yunity.org", true },
- { "yunloc.com", true },
- { "yunsoupian.vip", true },
- { "yunzhu.li", false },
- { "yuqi.me", true },
- { "yura.cf", true },
- { "yuricarlenzoli.it", true },
- { "yurikirin.me", true },
- { "yurisviridov.com", true },
- { "yusa.me", true },
- { "yushi.moe", true },
- { "yusu.org", true },
- { "yusukesakai.com", true },
- { "yutakato.net", true },
- { "yuuki0xff.jp", true },
- { "yuuta.moe", true },
- { "yuvaindia.co.in", true },
- { "yuvibrands.com", true },
- { "yuwei.org", true },
- { "yuweiji.com", true },
- { "yuxiangyuan.com", true },
- { "yuxuan.org", true },
- { "yuyantang.club", true },
- { "yuyiyang.eu.org", true },
- { "yuyo.com", true },
- { "yuzei.tk", true },
- { "yuzu-tee.de", true },
- { "yuzulia.com", true },
- { "yuzurisa.com", true },
- { "yuzzamatuzz.co.uk", true },
- { "yvb.moe", true },
- { "yvesx.com", true },
- { "yvonnehaeusser.de", true },
- { "yvonnethomet.ch", true },
- { "yvonnewilhelmi.com", true },
- { "ywyz.tech", true },
- { "yxt521.com", true },
- { "yy-s.net", true },
- { "yy366.cc", true },
- { "yy369.cc", true },
- { "yy6.ag", true },
- { "yy8.ag", true },
- { "yy9297.co", true },
- { "yy9297.com", true },
- { "yyc.city", true },
- { "yycbike.info", true },
- { "yyyy.xyz", true },
- { "yz86.cc", true },
- { "yzal.io", true },
- { "yzarul.com", true },
- { "yzh8.cc", true },
- { "yzh8.net", true },
- { "yzh8.vip", true },
- { "yzimroni.net", true },
- { "z-cert.nl", true },
- { "z-latko.info", true },
- { "z-vector.com", true },
- { "z.ai", true },
- { "z1.ag", true },
- { "z10.ag", true },
- { "z1h.de", true },
- { "z2.ag", true },
- { "z33d.xyz", true },
- { "z36533.com", true },
- { "z36594.com", true },
- { "z3u5.net", true },
- { "z4.ag", true },
- { "z5.ag", true },
- { "z6.ag", true },
- { "z6.com", true },
- { "z6121.com", true },
- { "z6151.com", true },
- { "z6181.com", true },
- { "z6182.com", true },
- { "z6192.com", true },
- { "z6218.com", true },
- { "z6252.com", true },
- { "z6278.com", true },
- { "z6281.com", true },
- { "z6285.com", true },
- { "z6289.com", true },
- { "z6323.com", true },
- { "z6325.com", true },
- { "z6353.com", true },
- { "z6359.com", true },
- { "z6371.com", true },
- { "z6372.com", true },
- { "z6373.com", true },
- { "z6375.com", true },
- { "z6381.com", true },
- { "z6382.com", true },
- { "z6385.com", true },
- { "z6398.com", true },
- { "z6512.com", true },
- { "z6519.com", true },
- { "z6523.com", true },
- { "z6527.com", true },
- { "z6529.com", true },
- { "z6537.com", true },
- { "z6539.com", true },
- { "z6571.com", true },
- { "z6573.com", true },
- { "z6579.com", true },
- { "z6581.com", true },
- { "z6587.com", true },
- { "z6591.com", true },
- { "z6592.com", true },
- { "z66.ag", true },
- { "z6616.com", true },
- { "z666.ag", true },
- { "z6727.com", true },
- { "z6751.com", true },
- { "z6753.com", true },
- { "z6757.com", true },
- { "z6758.com", true },
- { "z6759.com", true },
- { "z6791.com", true },
- { "z6798.com", true },
- { "z6812.com", true },
- { "z6813.com", true },
- { "z6817.com", true },
- { "z6823.com", true },
- { "z6827.com", true },
- { "z6829.com", true },
- { "z6837.com", true },
- { "z6851.com", true },
- { "z6852.com", true },
- { "z6853.com", true },
- { "z6857.com", true },
- { "z6871.com", true },
- { "z6873.com", true },
- { "z6881.com", true },
- { "z6882.com", true },
- { "z6883.com", true },
- { "z6891.com", true },
- { "z6893.com", true },
- { "z6895.com", true },
- { "z6897.com", true },
- { "z6912.com", true },
- { "z6925.com", true },
- { "z7.ag", true },
- { "z8.ag", true },
- { "z8017.com", true },
- { "z8023.com", true },
- { "z8078.com", true },
- { "z8079.com", true },
- { "z8106.com", true },
- { "z8109.com", true },
- { "z8132.com", true },
- { "z8168.com", true },
- { "z8171.com", true },
- { "z81818.com", true },
- { "z88.ag", true },
- { "z8857.com", true },
- { "z8861.com", true },
- { "z8862.com", true },
- { "z8870.com", true },
- { "z8871.com", true },
- { "z8872.com", true },
- { "z888.ag", true },
- { "z8907.com", true },
- { "z8908.com", true },
- { "z8909.com", true },
- { "z8917.com", true },
- { "z9.ag", true },
- { "z9297.co", true },
- { "z99944x.xyz", true },
- { "za.search.yahoo.com", false },
- { "za12bxc3.com", true },
- { "zaagbaak.nl", true },
- { "zabbix.tips", true },
- { "zabszk.net", true },
- { "zabukovnik.net", true },
- { "zacarias.com.ar", true },
- { "zacavi.com.br", true },
- { "zacchaeus.co.uk", true },
- { "zach.codes", true },
- { "zacharopoulos.eu", true },
- { "zacharopoulos.org", false },
- { "zacharydubois.me", true },
- { "zacharyschneider.ca", true },
- { "zacharyschneider.com", true },
- { "zacharyseguin.ca", true },
- { "zachaysan.com", true },
- { "zachborboa.com", true },
- { "zachgibbens.org", true },
- { "zachschneider.ca", true },
- { "zackiarfan.ml", true },
- { "zaclys.com", false },
- { "zadrot.tk", true },
- { "zadroweb.com", true },
- { "zaffke.co", true },
- { "zaghyr.org", true },
- { "zagruz.tk", true },
- { "zahe.me", true },
- { "zahnaerzte-bohne.de", false },
- { "zahnarzt-drvogel-rosenheim.de", true },
- { "zahnarzt-drvogel.de", true },
- { "zahnarzt-duempten.de", true },
- { "zahnarzt-hofer.de", true },
- { "zahnarzt-kramer.ch", true },
- { "zahnmedizinzentrum.com", true },
- { "zahrowski.com", true },
- { "zaidan.de", true },
- { "zaidan.eu", true },
- { "zaidanfood.com", true },
- { "zaidanfood.eu", true },
- { "zaidanlebensmittelhandel.de", true },
- { "zaija.tk", true },
- { "zaim15min.cf", true },
- { "zaimdengi.tk", true },
- { "zaimexpress.cf", true },
- { "zaixsp.com", true },
- { "zaizaia.cc", true },
- { "zajazd.biz", true },
- { "zajm-pod-raspisku.cf", true },
- { "zajmy-contact.tk", true },
- { "zakariya.blog", true },
- { "zakaz.cf", true },
- { "zakcutner.uk", true },
- { "zakelijketaalcursus.nl", true },
- { "zakelijkgoedengelsleren.nl", true },
- { "zakladam.cz", true },
- { "zakmccrac.de", true },
- { "zakojifarm.jp", true },
- { "zakonu.net.ru", true },
- { "zakr.es", true },
- { "zakspartiesandevents.com", true },
- { "zala.ml", true },
- { "zalamea.ph", true },
- { "zaledia.com", true },
- { "zaloghaz.ro", false },
- { "zalohovaniburian.cz", true },
- { "zaltv.com", true },
- { "zalure.com", true },
- { "zalvus.com", true },
- { "zamalektoday.com", true },
- { "zambianewsforum.tk", true },
- { "zambranopublicidadvideo.com", true },
- { "zamenim.tk", true },
- { "zamow.co", true },
- { "zandcell.com", true },
- { "zander.dk", true },
- { "zandra.cf", true },
- { "zanellidesigns.co.uk", true },
- { "zanjirzanane-shanbeghazan.ir", true },
- { "zanshinkankarate.com", true },
- { "zanthra.com", true },
- { "zanzo.cz", true },
- { "zap-mag.ru", true },
- { "zapier.com", true },
- { "zapmaster14.com", true },
- { "zappbuildapps.com", true },
- { "zappingarahal.tk", true },
- { "zapreaders.cf", true },
- { "zarabiaj.com", true },
- { "zaracraft.tk", true },
- { "zaraweb.net", true },
- { "zarbis.tk", true },
- { "zargescases.co.uk", true },
- { "zaruhi.ml", true },
- { "zary.me", true },
- { "zatsepin.by", true },
- { "zaufanatrzeciastrona.pl", true },
- { "zavec.com.ec", false },
- { "zavedu.org", true },
- { "zavetaji.lv", true },
- { "zawo-electric.de", true },
- { "zbib.org", true },
- { "zbp16888.com", true },
- { "zbrane-doplnky.cz", true },
- { "zbtcmu.com", true },
- { "zbut.bg", true },
- { "zby.xyz", true },
- { "zbyga.cz", true },
- { "zbyte.it", true },
- { "zcarot.com", true },
- { "zcarrot.com", true },
- { "zcon.nl", true },
- { "zcore.org", true },
- { "zcrypto.ml", true },
- { "zcwtl.com", false },
- { "zczc.cz", true },
- { "zd0808.com", true },
- { "zd1313.com", true },
- { "zd1515.com", true },
- { "zd1717.com", true },
- { "zd202.com", true },
- { "zd203.com", true },
- { "zd205.com", true },
- { "zd206.com", true },
- { "zd207.com", true },
- { "zd208.com", true },
- { "zd209.com", true },
- { "zd232.com", true },
- { "zd235.com", true },
- { "zd236.com", true },
- { "zd237.com", true },
- { "zd239.com", true },
- { "zd252.com", true },
- { "zd253.com", true },
- { "zd257.com", true },
- { "zd258.com", true },
- { "zd259.com", true },
- { "zd262.com", true },
- { "zd265.com", true },
- { "zd267.com", true },
- { "zd270.com", true },
- { "zd2727.com", true },
- { "zd275.com", true },
- { "zd276.com", true },
- { "zd280.com", true },
- { "zd282.com", true },
- { "zd283.com", true },
- { "zd286.com", true },
- { "zd287.com", true },
- { "zd289.com", true },
- { "zd290.com", true },
- { "zd293.com", true },
- { "zd295.com", true },
- { "zd297.com", true },
- { "zd302.com", true },
- { "zd303.com", true },
- { "zd305.com", true },
- { "zd306.com", true },
- { "zd307.com", true },
- { "zd3232.com", true },
- { "zd3535.com", true },
- { "zd3939.com", true },
- { "zd4848.com", true },
- { "zd6.ag", true },
- { "zd623.com", true },
- { "zd625.com", true },
- { "zd627.com", true },
- { "zd629.com", true },
- { "zd632.com", true },
- { "zd635.com", true },
- { "zd637.com", true },
- { "zd6464.com", true },
- { "zd652.com", true },
- { "zd653.com", true },
- { "zd6565.com", true },
- { "zd657.com", true },
- { "zd659.com", true },
- { "zd66.ag", true },
- { "zd673.com", true },
- { "zd675.com", true },
- { "zd692.com", true },
- { "zd693.com", true },
- { "zd697.com", true },
- { "zd723.com", true },
- { "zd725.com", true },
- { "zd726.com", true },
- { "zd729.com", true },
- { "zd732.com", true },
- { "zd735.com", true },
- { "zd736.com", true },
- { "zd739.com", true },
- { "zd752.com", true },
- { "zd753.com", true },
- { "zd756.com", true },
- { "zd7575.com", true },
- { "zd759.com", true },
- { "zd762.com", true },
- { "zd763.com", true },
- { "zd792.com", true },
- { "zd793.com", true },
- { "zd795.com", true },
- { "zd796.com", true },
- { "zd8.ag", true },
- { "zd802.com", true },
- { "zd803.com", true },
- { "zd805.com", true },
- { "zd806.com", true },
- { "zd807.com", true },
- { "zd809.com", true },
- { "zd823.com", true },
- { "zd825.com", true },
- { "zd826.com", true },
- { "zd827.com", true },
- { "zd829.com", true },
- { "zd88.ag", true },
- { "zd8828.com", true },
- { "zd8829.com", true },
- { "zd8832.com", true },
- { "zd8835.com", true },
- { "zd8836.com", true },
- { "zd8853.com", true },
- { "zd8863.com", true },
- { "zd8869.com", true },
- { "zd8882.com", true },
- { "zd8883.com", true },
- { "zd8898.com", true },
- { "zd9090.com", true },
- { "zdbl.de", true },
- { "zdenekpasek.cz", true },
- { "zdenekspacek.cz", true },
- { "zdenekvecera.cz", true },
- { "zdorovayasimya.com", true },
- { "zdravotnikurzy.cz", true },
- { "zdrojak.cz", true },
- { "zdymak.by", true },
- { "ze3kr.com", true },
- { "zeadaniel.com", true },
- { "zeal-and.jp", true },
- { "zeal-interior.com", true },
- { "zealworks.jp", true },
- { "zeanweb.tk", true },
- { "zebbra.ro", true },
- { "zebranolemagicien.net", true },
- { "zeckenhilfe.de", true },
- { "zedeko.pl", true },
- { "zeds-official.com", true },
- { "zeebrieshoekvanholland.nl", true },
- { "zeel.com", true },
- { "zeetoppers.nl", true },
- { "zeguigui.com", true },
- { "zehkae.net", true },
- { "zehrailkeakyildiz.com", false },
- { "zeibekiko-souvlaki.gr", true },
- { "zeidlertechnik.de", true },
- { "zeilenmethans.nl", true },
- { "zeilenwind.com", true },
- { "zeilles.nu", true },
- { "zeitpunkt-kulturmagazin.de", true },
- { "zeiw.me", true },
- { "zekesnider.com", true },
- { "zekinteractive.com", true },
- { "zell-mbc.com", true },
- { "zemlyaki.ga", true },
- { "zen-diez.de", true },
- { "zen-solutions.io", true },
- { "zen-zone.tk", true },
- { "zena.cx", false },
- { "zenassociates.com", true },
- { "zenchain.com", true },
- { "zenevents.ro", true },
- { "zenghx.tk", false },
- { "zenideen.com", true },
- { "zenideen.net", true },
- { "zenidees.com", true },
- { "zenithmedia.ca", true },
- { "zenk-security.com", true },
- { "zenlogic.com", true },
- { "zenluxuryliving.com", true },
- { "zeno-dev.com", true },
- { "zenofa.co.id", true },
- { "zenti.cloud", true },
- { "zentraler-kreditausschuss.de", true },
- { "zenvideocloud.com", true },
- { "zenvite.com", true },
- { "zenways.io", true },
- { "zeocax.com", true },
- { "zephyrbk.com", true },
- { "zephyrbookkeeping.com", true },
- { "zephyretcoraline.com", true },
- { "zeplin.io", true },
- { "zepter.gq", true },
- { "zer0-day.pw", true },
- { "zer0.de", false },
- { "zermatterhof.ch", true },
- { "zero-knigi.ml", true },
- { "zeroanarchy.com", true },
- { "zerobajt.pl", true },
- { "zerobounce.net", true },
- { "zerocash.msk.ru", true },
- { "zerocz.eu", true },
- { "zerofy.de", true },
- { "zeronet.io", true },
- { "zeropoint.bg", true },
- { "zeropush.com", true },
- { "zerosector.io", true },
- { "zeroseteatacado.com.br", true },
- { "zerossl.com", true },
- { "zerosync.com", true },
- { "zerotoone.de", true },
- { "zertitude.com", true },
- { "zeryn.net", true },
- { "zespia.tw", true },
- { "zestadionu.pl", true },
- { "zestylemon.co.uk", true },
- { "zeta.hk", true },
- { "zetamode.com", true },
- { "zetasystem.jp", true },
- { "zetorzeszow.pl", false },
- { "zettaplan.ru", true },
- { "zettlmeissl.de", true },
- { "zety.com", true },
- { "zeus.gent", true },
- { "zeusec.co.jp", true },
- { "zevelev.net", true },
- { "zeyi.fan", true },
- { "zezeatolye.com", true },
- { "zf1898.com", true },
- { "zfast.com.br", true },
- { "zfg.li", true },
- { "zfj.hk", true },
- { "zfj.la", true },
- { "zfree.co.nz", true },
- { "zfyl8.com", true },
- { "zg-dyw.net", true },
- { "zgndh.com", true },
- { "zgrep.org", true },
- { "zh.search.yahoo.com", false },
- { "zhabababa.gq", true },
- { "zhan.moe", true },
- { "zhang-hao.com", true },
- { "zhang.fm", true },
- { "zhang.ge", true },
- { "zhang.nz", true },
- { "zhangcheng.org", true },
- { "zhangfangzhou.com", true },
- { "zhanghao.me", true },
- { "zhanghao.org", true },
- { "zhangheda.cf", true },
- { "zhangshuqiao.org", true },
- { "zhangsidan.com", true },
- { "zhangwendao.com", true },
- { "zhangxuhu.com", true },
- { "zhaoeq.com", true },
- { "zhaofeng.li", true },
- { "zhaopage.com", true },
- { "zhaostephen.com", true },
- { "zhaoxixiangban.cc", true },
- { "zhcexo.com", true },
- { "zhen-chen.com", true },
- { "zhendre.com", true },
- { "zhenggangzhao.org", true },
- { "zhengjie.com", true },
- { "zhengzihan.com", true },
- { "zhenic.ir", true },
- { "zhestokiemechtyi.tk", true },
- { "zhih.me", true },
- { "zhihe.in", true },
- { "zhiin.net", true },
- { "zhima.io", true },
- { "zhimingwang.org", true },
- { "zhina.org", true },
- { "zhina.wiki", true },
- { "zhis.eu", true },
- { "zhis.ltd", true },
- { "zhitanska.com", true },
- { "zhivoj-dom.ru", true },
- { "zhiyuan.cloud", true },
- { "zhl123.cn", true },
- { "zhl123.com", true },
- { "zhongxigo.com", true },
- { "zhost.io", true },
- { "zhou28d88vip.com", true },
- { "zhouba.cz", true },
- { "zhoushuo.me", false },
- { "zhovner.com", true },
- { "zhuihoude.com", true },
- { "zhuji.com", true },
- { "zhujiceping.com", true },
- { "zhuktrans.msk.ru", true },
- { "zhurnalyu.ga", true },
- { "zhy.us", true },
- { "zi.is", true },
- { "zi5.net", true },
- { "ziegler-heizung-frankfurt.de", true },
- { "zielonakarta.com", true },
- { "ziemlich-zackig.de", true },
- { "ziemlichzackig.de", true },
- { "ziendo.com", true },
- { "zifb.in", true },
- { "zifoapptest.com", true },
- { "zigarn.com", true },
- { "zigi.io", true },
- { "zigottos.fr", true },
- { "zigzagmart.com", true },
- { "zihao.me", false },
- { "zihun.club", true },
- { "zii.bz", true },
- { "zijemvedu.sk", true },
- { "zijung.me", true },
- { "zikinf.com", true },
- { "ziledelaultimagafaavioricai.ro", true },
- { "zillertaleralpen.net", true },
- { "zilore.com", true },
- { "zilsen.com", true },
- { "zima.io", true },
- { "zimaoxy.com", true },
- { "zimiao.moe", true },
- { "zimmer-voss.de", true },
- { "zimtoel.de", true },
- { "zinabnews.tk", true },
- { "zinchenko.gq", true },
- { "zindec.com", true },
- { "zingarastore.com", true },
- { "zingjerijk.nl", true },
- { "zinglix.xyz", true },
- { "zinniamay.com", true },
- { "zinniazorgverlening.nl", true },
- { "zinnowitzer-ferienwohnung.de", true },
- { "zinoui.com", true },
- { "ziondrive.com.br", true },
- { "zionnationalpark.net", true },
- { "zionsvillelocksmiths.com", true },
- { "zipfworks.com", true },
- { "zipkey.de", true },
- { "zircode.com", true },
- { "ziroh.be", true },
- { "ziroux.net", true },
- { "zirrka.de", true },
- { "zirtek.ie", true },
- { "zirtual.com", true },
- { "zistemo.com", true },
- { "zitronengras-tee.de", true },
- { "zitseng.com", true },
- { "zivava.ge", true },
- { "zivver.be", true },
- { "zivver.com", true },
- { "zivver.de", true },
- { "zivver.eu", true },
- { "zivver.info", true },
- { "zivver.nl", true },
- { "zivver.uk", true },
- { "zivyruzenec.cz", true },
- { "zixiao.wang", true },
- { "zixin.com", true },
- { "zizibook.ml", true },
- { "zjateaucafe.be", true },
- { "zjv.me", true },
- { "zk.gd", true },
- { "zk9.nl", true },
- { "zkd.me", true },
- { "zkontrolujsiauto.cz", true },
- { "zkzone.net", true },
- { "zl016.com", true },
- { "zl0303.com", true },
- { "zl0505.com", true },
- { "zl056.com", true },
- { "zl0606.com", true },
- { "zl071.com", true },
- { "zl0909.com", true },
- { "zl0iu.com", true },
- { "zl0sz.com", true },
- { "zl1212.com", true },
- { "zl2020.com", true },
- { "zl2020.vip", true },
- { "zl3737.com", true },
- { "zl4231.com", true },
- { "zl4290.com", true },
- { "zl5151.com", true },
- { "zl6.ag", true },
- { "zl6565.com", true },
- { "zl66.ag", true },
- { "zl666.ag", true },
- { "zl6767.com", true },
- { "zl6xw.com", true },
- { "zl7070.com", true },
- { "zl7373.com", true },
- { "zl7979.com", true },
- { "zl8.ag", true },
- { "zl8282.com", true },
- { "zl850.com", true },
- { "zl8585.com", true },
- { "zl861.com", true },
- { "zl8686.com", true },
- { "zl88.ag", true },
- { "zl883.com", true },
- { "zl8849.com", true },
- { "zl8862.com", true },
- { "zl888.ag", true },
- { "zl9191.com", true },
- { "zl9292.com", true },
- { "zl9696.com", true },
- { "zl9814.com", true },
- { "zl9889.com", true },
- { "zl9898.com", true },
- { "zlatakus.cz", true },
- { "zlatan-ibrahimovic.tk", true },
- { "zlatom.ru", true },
- { "zlatosnadno.cz", true },
- { "zlaty-tyden.cz", true },
- { "zlatytyden.cz", true },
- { "zlavomat.sk", true },
- { "zlhuodong.vip", true },
- { "zlima12.com", true },
- { "zlogic.xyz", true },
- { "zlol.lg.ua", true },
- { "zlotykameleon.tk", true },
- { "zloybot.tk", true },
- { "zlypi.com", true },
- { "zmarta.de", true },
- { "zmarta.dk", true },
- { "zmarta.fi", true },
- { "zmarta.no", true },
- { "zmarta.org", true },
- { "zmarta.se", true },
- { "zmartagroup.com", true },
- { "zmartagroup.fi", true },
- { "zmartagroup.no", true },
- { "zmartagroup.se", true },
- { "zmiguel.me", true },
- { "znaj.ua", true },
- { "znakcomstva.ru", true },
- { "znakomim.cf", true },
- { "znanie-sila.tk", true },
- { "znanje.gq", true },
- { "znation.nl", true },
- { "znhglobalresources.com", true },
- { "znich.tk", true },
- { "znidar.org", true },
- { "znti.de", true },
- { "zoarcampsite.uk", true },
- { "zobraz.cz", true },
- { "zobworks.com", true },
- { "zoccarato.ovh", true },
- { "zochowskiplasticsurgery.com", true },
- { "zocial.life", true },
- { "zockenbiszumumfallen.de", true },
- { "zodiacohouses.com", true },
- { "zodian-research.ro", true },
- { "zoeller.me", true },
- { "zoepolitics.cf", true },
- { "zofran-medication.cf", true },
- { "zofrancost.ga", true },
- { "zofranprice.ga", true },
- { "zohar.wang", true },
- { "zoigl.club", true },
- { "zoisfinefood.com", true },
- { "zojadravai.com", true },
- { "zok-ambicija.tk", true },
- { "zoki.art", true },
- { "zoko.tk", true },
- { "zollernalbtour.de", true },
- { "zollihood.ch", true },
- { "zoloftmedication.gq", true },
- { "zoloftpills.tk", true },
- { "zoloftprice.cf", true },
- { "zolushka-1950.tk", true },
- { "zom.bi", true },
- { "zombie-40th.com", true },
- { "zombiesecured.com", true },
- { "zombmage.tk", true },
- { "zomerschoen.nl", true },
- { "zomiac.pp.ua", true },
- { "zonadigital.co", true },
- { "zonaperu.tk", true },
- { "zonecb.com", true },
- { "zonehomesolutions.com", true },
- { "zonemaster.fr", true },
- { "zonemaster.net", true },
- { "zonesec.org", true },
- { "zonewatcher.com", true },
- { "zonglovani.info", true },
- { "zonky.cz", true },
- { "zonky.de", true },
- { "zonkysetkani.cz", true },
- { "zooforum.tk", true },
- { "zoohaus.de", true },
- { "zooish.net", true },
- { "zook.systems", true },
- { "zoola.io", true },
- { "zoolaboo.de", true },
- { "zoom.earth", true },
- { "zoomek.com", true },
- { "zooom.azurewebsites.net", true },
- { "zoop.ml", false },
- { "zooplankton.no", true },
- { "zootime.net", true },
- { "zootime.org", true },
- { "zoowiki.us", true },
- { "zoptiks.com", true },
- { "zopyx.com", true },
- { "zor.com", true },
- { "zorasvobodova.cz", true },
- { "zorgclustertool.nl", true },
- { "zorgenvoorandrea.be", true },
- { "zorig.ch", true },
- { "zorium.org", true },
- { "zormeloandassociates.com", true },
- { "zorntt.fr", true },
- { "zorrobei.cf", false },
- { "zoso.ro", true },
- { "zotero.org", true },
- { "zoubaa.de", true },
- { "zouk.info", true },
- { "zouyaoji.top", true },
- { "zovirax-cream.ml", true },
- { "zowe.ru", true },
- { "zowedo.com", true },
- { "zoyride.com", true },
- { "zozzle.co.uk", true },
- { "zp.do", true },
- { "zp25.ninja", true },
- { "zqzx.xyz", true },
- { "zravyobrazky.cz", true },
- { "zravypapir.cz", true },
- { "zrhdwz.cn", true },
- { "zrinski.tk", true },
- { "zrniecka-pre-sny.sk", true },
- { "zrnieckapresny.sk", true },
- { "zrs-meissen.de", true },
- { "zry-blog.top", true },
- { "zs-reporyje.cz", true },
- { "zs6688.cc", true },
- { "zscales.com", false },
- { "zselicivt.hu", true },
- { "zskomenskeho.cz", true },
- { "zskomenskeho.eu", true },
- { "zsolti.hu", true },
- { "zsoltsandor.me", true },
- { "zsq.im", true },
- { "zstgmnachod.cz", true },
- { "zten.org", true },
- { "ztk.im", true },
- { "zubel.it", false },
- { "zubr.net", true },
- { "zuenkov.com", true },
- { "zug-anwalt.de", false },
- { "zugfahrplan.com", true },
- { "zughilfen-test.de", true },
- { "zuiacg.cc", true },
- { "zuiacg.com", true },
- { "zuim.de", true },
- { "zula.africa", true },
- { "zulu.ro", true },
- { "zum-baur.de", true },
- { "zumazar.ru", true },
- { "zumberak.tk", true },
- { "zumub.com", true },
- { "zund-app.com", true },
- { "zundapp.one", true },
- { "zundapp529.nl", true },
- { "zundappachterhoek.nl", true },
- { "zunlong0.com", true },
- { "zuolan.me", false },
- { "zupago.pe", true },
- { "zuppy.pm", true },
- { "zupzup.org", true },
- { "zuralski.net", true },
- { "zurgl.com", false },
- { "zurlin.de", true },
- { "zusjesvandenbos.nl", true },
- { "zuzumba.es", true },
- { "zverskij-site.tk", true },
- { "zvps.uk", true },
- { "zvxr.net", true },
- { "zwartendijkstalling.nl", true },
- { "zwergenfeste.ch", true },
- { "zwergenfreiheit.at", true },
- { "zwerimex.com", true },
- { "zwierslanguagetraining.nl", true },
- { "zwk.de", true },
- { "zwollemag.nl", true },
- { "zwollemagazine.nl", true },
- { "zwy.ch", false },
- { "zx6rninja.de", true },
- { "zx7r.de", true },
- { "zxfiles.tk", true },
- { "zxtcode.com", true },
- { "zy.md", true },
- { "zy.si", true },
- { "zybbo.com", true },
- { "zyciedlazwierzat.pl", true },
- { "zyciedogorynogami.pl", true },
- { "zydronium.com", true },
- { "zydronium.nl", true },
- { "zygozoon.com", true },
- { "zylai.com", true },
- { "zymmm.com", true },
- { "zypern-firma.com", true },
- { "zyria.de", true },
- { "zyul.ddns.net", true },
- { "zyzardx.com", true },
- { "zyzsdy.com", true },
- { "zz342.com", true },
- { "zz9297.co", true },
- { "zz993.com", true },
- { "zzekj.net", true },
- { "zzpd.nl", false },
- { "zzpwoerden.nl", true },
- { "zzsec.org", true },
-};
diff --git a/security/manager/ssl/nsSiteSecurityService.cpp b/security/manager/ssl/nsSiteSecurityService.cpp
index 1b7f06a47..fa2619414 100644
--- a/security/manager/ssl/nsSiteSecurityService.cpp
+++ b/security/manager/ssl/nsSiteSecurityService.cpp
@@ -25,19 +25,9 @@
#include "mozilla/Logging.h"
#include "prnetdb.h"
#include "prprf.h"
-#include "PublicKeyPinningService.h"
#include "ScopedNSSTypes.h"
#include "SharedCertVerifier.h"
-// A note about the preload list:
-// When a site specifically disables HSTS by sending a header with
-// 'max-age: 0', we keep a "knockout" value that means "we have no information
-// regarding the HSTS state of this host" (any ancestor of "this host" can still
-// influence its HSTS status via include subdomains, however).
-// This prevents the preload list from overriding the site's current
-// desired HSTS status.
-#include "nsSTSPreloadList.inc"
-
using namespace mozilla;
using namespace mozilla::psm;
@@ -96,123 +86,30 @@ SiteHSTSState::ToString(nsCString& aString)
}
////////////////////////////////////////////////////////////////////////////////
-static bool
-stringIsBase64EncodingOf256bitValue(nsCString& encodedString) {
- nsAutoCString binaryValue;
- nsresult rv = mozilla::Base64Decode(encodedString, binaryValue);
- if (NS_FAILED(rv)) {
- return false;
- }
- if (binaryValue.Length() != SHA256_LENGTH) {
- return false;
- }
- return true;
-}
-SiteHPKPState::SiteHPKPState()
- : mExpireTime(0)
- , mState(SecurityPropertyUnset)
- , mIncludeSubdomains(false)
-{
-}
-
-SiteHPKPState::SiteHPKPState(nsCString& aStateString)
- : mExpireTime(0)
- , mState(SecurityPropertyUnset)
- , mIncludeSubdomains(false)
-{
- uint32_t hpkpState = 0;
- uint32_t hpkpIncludeSubdomains = 0; // PR_sscanf doesn't handle bools.
- const uint32_t MaxMergedHPKPPinSize = 1024;
- char mergedHPKPins[MaxMergedHPKPPinSize];
- memset(mergedHPKPins, 0, MaxMergedHPKPPinSize);
-
- if (aStateString.Length() >= MaxMergedHPKPPinSize) {
- SSSLOG(("SSS: Cannot parse PKPState string, too large\n"));
- return;
- }
-
- int32_t matches = PR_sscanf(aStateString.get(), "%lld,%lu,%lu,%s",
- &mExpireTime, &hpkpState,
- &hpkpIncludeSubdomains, mergedHPKPins);
- bool valid = (matches == 4 &&
- (hpkpIncludeSubdomains == 0 || hpkpIncludeSubdomains == 1) &&
- ((SecurityPropertyState)hpkpState == SecurityPropertyUnset ||
- (SecurityPropertyState)hpkpState == SecurityPropertySet ||
- (SecurityPropertyState)hpkpState == SecurityPropertyKnockout));
-
- SSSLOG(("SSS: loading SiteHPKPState matches=%d\n", matches));
- const uint32_t SHA256Base64Len = 44;
-
- if (valid && (SecurityPropertyState)hpkpState == SecurityPropertySet) {
- // try to expand the merged PKPins
- const char* cur = mergedHPKPins;
- nsAutoCString pin;
- uint32_t collectedLen = 0;
- mergedHPKPins[MaxMergedHPKPPinSize - 1] = 0;
- size_t totalLen = strlen(mergedHPKPins);
- while (collectedLen + SHA256Base64Len <= totalLen) {
- pin.Assign(cur, SHA256Base64Len);
- if (stringIsBase64EncodingOf256bitValue(pin)) {
- mSHA256keys.AppendElement(pin);
- }
- cur += SHA256Base64Len;
- collectedLen += SHA256Base64Len;
- }
- if (mSHA256keys.IsEmpty()) {
- valid = false;
- }
- }
- if (valid) {
- mState = (SecurityPropertyState)hpkpState;
- mIncludeSubdomains = (hpkpIncludeSubdomains == 1);
- } else {
- SSSLOG(("%s is not a valid SiteHPKPState", aStateString.get()));
- mExpireTime = 0;
- mState = SecurityPropertyUnset;
- mIncludeSubdomains = false;
- if (!mSHA256keys.IsEmpty()) {
- mSHA256keys.Clear();
- }
- }
-}
+const uint64_t kSixtyDaysInSeconds = 60 * 24 * 60 * 60;
-SiteHPKPState::SiteHPKPState(PRTime aExpireTime,
- SecurityPropertyState aState,
- bool aIncludeSubdomains,
- nsTArray<nsCString>& aSHA256keys)
- : mExpireTime(aExpireTime)
- , mState(aState)
- , mIncludeSubdomains(aIncludeSubdomains)
- , mSHA256keys(aSHA256keys)
+static bool
+HostIsIPAddress(const char *hostname)
{
+ PRNetAddr hostAddr;
+ return (PR_StringToNetAddr(hostname, &hostAddr) == PR_SUCCESS);
}
-void
-SiteHPKPState::ToString(nsCString& aString)
+nsAutoCString CanonicalizeHostname(const char* hostname)
{
- aString.Truncate();
- aString.AppendInt(mExpireTime);
- aString.Append(',');
- aString.AppendInt(mState);
- aString.Append(',');
- aString.AppendInt(static_cast<uint32_t>(mIncludeSubdomains));
- aString.Append(',');
- for (unsigned int i = 0; i < mSHA256keys.Length(); i++) {
- aString.Append(mSHA256keys[i]);
+ nsAutoCString canonicalizedHostname(hostname);
+ ToLowerCase(canonicalizedHostname);
+ while (canonicalizedHostname.Length() > 0 &&
+ canonicalizedHostname.Last() == '.') {
+ canonicalizedHostname.Truncate(canonicalizedHostname.Length() - 1);
}
+ return canonicalizedHostname;
}
-////////////////////////////////////////////////////////////////////////////////
-
-const uint64_t kSixtyDaysInSeconds = 60 * 24 * 60 * 60;
-
nsSiteSecurityService::nsSiteSecurityService()
- : mMaxMaxAge(kSixtyDaysInSeconds)
- , mUsePreloadList(true)
- , mUseStsService(true)
+ : mUseStsService(true)
, mPreloadListTimeOffset(0)
- , mHPKPEnabled(false)
{
}
@@ -233,48 +130,25 @@ nsSiteSecurityService::Init()
return NS_ERROR_NOT_SAME_THREAD;
}
- mMaxMaxAge = mozilla::Preferences::GetInt(
- "security.cert_pinning.max_max_age_seconds", kSixtyDaysInSeconds);
- mozilla::Preferences::AddStrongObserver(this,
- "security.cert_pinning.max_max_age_seconds");
- mUsePreloadList = mozilla::Preferences::GetBool(
- "network.stricttransportsecurity.preloadlist", true);
- mozilla::Preferences::AddStrongObserver(this,
- "network.stricttransportsecurity.preloadlist");
- mHPKPEnabled = mozilla::Preferences::GetBool(
- "security.cert_pinning.hpkp.enabled", false);
- mozilla::Preferences::AddStrongObserver(this,
- "security.cert_pinning.hpkp.enabled");
mUseStsService = mozilla::Preferences::GetBool(
"network.stricttransportsecurity.enabled", true);
mozilla::Preferences::AddStrongObserver(this,
"network.stricttransportsecurity.enabled");
- mProcessPKPHeadersFromNonBuiltInRoots = mozilla::Preferences::GetBool(
- "security.cert_pinning.process_headers_from_non_builtin_roots", false);
- mozilla::Preferences::AddStrongObserver(this,
- "security.cert_pinning.process_headers_from_non_builtin_roots");
mPreloadListTimeOffset = mozilla::Preferences::GetInt(
"test.currentTimeOffsetSeconds", 0);
mozilla::Preferences::AddStrongObserver(this,
"test.currentTimeOffsetSeconds");
mSiteStateStorage =
mozilla::DataStorage::Get(NS_LITERAL_STRING("SiteSecurityServiceState.txt"));
- mPreloadStateStorage =
- mozilla::DataStorage::Get(NS_LITERAL_STRING("SecurityPreloadState.txt"));
bool storageWillPersist = false;
- bool preloadStorageWillPersist = false;
nsresult rv = mSiteStateStorage->Init(storageWillPersist);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
}
- rv = mPreloadStateStorage->Init(preloadStorageWillPersist);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
// This is not fatal. There are some cases where there won't be a
// profile directory (e.g. running xpcshell). There isn't the
// expectation that site information will be presisted in those cases.
- if (!storageWillPersist || !preloadStorageWillPersist) {
+ if (!storageWillPersist) {
NS_WARNING("site security information will not be persisted");
}
@@ -295,7 +169,7 @@ nsSiteSecurityService::GetHost(nsIURI* aURI, nsACString& aResult)
return rv;
}
- aResult.Assign(PublicKeyPinningService::CanonicalizeHostname(host.get()));
+ aResult.Assign(CanonicalizeHostname(host.get()));
if (aResult.IsEmpty()) {
return NS_ERROR_UNEXPECTED;
}
@@ -311,9 +185,6 @@ SetStorageKey(nsAutoCString& storageKey, nsCString& hostname, uint32_t aType)
case nsISiteSecurityService::HEADER_HSTS:
storageKey.AppendLiteral(":HSTS");
break;
- case nsISiteSecurityService::HEADER_HPKP:
- storageKey.AppendLiteral(":HPKP");
- break;
default:
NS_ASSERTION(false, "SSS:SetStorageKey got invalid type");
}
@@ -340,11 +211,9 @@ nsSiteSecurityService::SetHSTSState(uint32_t aType,
return NS_OK;
}
- // If max-age is zero, the host is no longer considered HSTS. If the host was
- // preloaded, we store an entry indicating that this host is not HSTS, causing
- // the preloaded information to be ignored.
+ // If max-age is zero, the host is no longer considered HSTS.
if (maxage == 0) {
- return RemoveState(aType, aSourceURI, flags, true);
+ return RemoveState(aType, aSourceURI, flags);
}
MOZ_ASSERT((aHSTSState == SecurityPropertySet ||
@@ -372,8 +241,7 @@ nsSiteSecurityService::SetHSTSState(uint32_t aType,
}
NS_IMETHODIMP
-nsSiteSecurityService::RemoveState(uint32_t aType, nsIURI* aURI,
- uint32_t aFlags, bool force = false)
+nsSiteSecurityService::RemoveState(uint32_t aType, nsIURI* aURI, uint32_t aFlags)
{
// Child processes are not allowed direct access to this.
if (!XRE_IsParentProcess()) {
@@ -381,8 +249,7 @@ nsSiteSecurityService::RemoveState(uint32_t aType, nsIURI* aURI,
}
// Only HSTS is supported at the moment.
- NS_ENSURE_TRUE(aType == nsISiteSecurityService::HEADER_HSTS ||
- aType == nsISiteSecurityService::HEADER_HPKP,
+ NS_ENSURE_TRUE(aType == nsISiteSecurityService::HEADER_HSTS,
NS_ERROR_NOT_IMPLEMENTED);
nsAutoCString hostname;
@@ -393,34 +260,14 @@ nsSiteSecurityService::RemoveState(uint32_t aType, nsIURI* aURI,
mozilla::DataStorageType storageType = isPrivate
? mozilla::DataStorage_Private
: mozilla::DataStorage_Persistent;
- // If this host is in the preload list, we have to store a knockout entry
- // if it's explicitly forced to not be HSTS anymore
- if (force && GetPreloadListEntry(hostname.get())) {
- SSSLOG(("SSS: storing knockout entry for %s", hostname.get()));
- SiteHSTSState siteState(0, SecurityPropertyKnockout, false);
- nsAutoCString stateString;
- siteState.ToString(stateString);
- nsAutoCString storageKey;
- SetStorageKey(storageKey, hostname, aType);
- rv = mSiteStateStorage->Put(storageKey, stateString, storageType);
- NS_ENSURE_SUCCESS(rv, rv);
- } else {
- SSSLOG(("SSS: removing entry for %s", hostname.get()));
- nsAutoCString storageKey;
- SetStorageKey(storageKey, hostname, aType);
- mSiteStateStorage->Remove(storageKey, storageType);
- }
+ SSSLOG(("SSS: removing entry for %s", hostname.get()));
+ nsAutoCString storageKey;
+ SetStorageKey(storageKey, hostname, aType);
+ mSiteStateStorage->Remove(storageKey, storageType);
return NS_OK;
}
-static bool
-HostIsIPAddress(const char *hostname)
-{
- PRNetAddr hostAddr;
- return (PR_StringToNetAddr(hostname, &hostAddr) == PR_SUCCESS);
-}
-
NS_IMETHODIMP
nsSiteSecurityService::ProcessHeader(uint32_t aType,
nsIURI* aSourceURI,
@@ -431,11 +278,6 @@ nsSiteSecurityService::ProcessHeader(uint32_t aType,
bool* aIncludeSubdomains,
uint32_t* aFailureResult)
{
- // Child processes are not allowed direct access to this.
- if (!XRE_IsParentProcess()) {
- MOZ_CRASH("Child process: no direct access to nsISiteSecurityService::ProcessHeader");
- }
-
if (aFailureResult) {
*aFailureResult = nsISiteSecurityService::ERROR_UNKNOWN;
}
@@ -457,11 +299,6 @@ nsSiteSecurityService::UnsafeProcessHeader(uint32_t aType,
bool* aIncludeSubdomains,
uint32_t* aFailureResult)
{
- // Child processes are not allowed direct access to this.
- if (!XRE_IsParentProcess()) {
- MOZ_CRASH("Child process: no direct access to nsISiteSecurityService::UnsafeProcessHeader");
- }
-
return ProcessHeaderInternal(aType, aSourceURI, aHeader, nullptr, aFlags,
aMaxAge, aIncludeSubdomains, aFailureResult);
}
@@ -479,9 +316,8 @@ nsSiteSecurityService::ProcessHeaderInternal(uint32_t aType,
if (aFailureResult) {
*aFailureResult = nsISiteSecurityService::ERROR_UNKNOWN;
}
- // Only HSTS and HPKP are supported at the moment.
- NS_ENSURE_TRUE(aType == nsISiteSecurityService::HEADER_HSTS ||
- aType == nsISiteSecurityService::HEADER_HPKP,
+ // Only HSTS is supported at the moment.
+ NS_ENSURE_TRUE(aType == nsISiteSecurityService::HEADER_HSTS,
NS_ERROR_NOT_IMPLEMENTED);
if (aMaxAge != nullptr) {
@@ -529,10 +365,6 @@ nsSiteSecurityService::ProcessHeaderInternal(uint32_t aType,
rv = ProcessSTSHeader(aSourceURI, aHeader, aFlags, aMaxAge,
aIncludeSubdomains, aFailureResult);
break;
- case nsISiteSecurityService::HEADER_HPKP:
- rv = ProcessPKPHeader(aSourceURI, aHeader, aSSLStatus, aFlags, aMaxAge,
- aIncludeSubdomains, aFailureResult);
- break;
default:
MOZ_CRASH("unexpected header type");
}
@@ -548,9 +380,6 @@ ParseSSSHeaders(uint32_t aType,
uint64_t& maxAge,
nsTArray<nsCString>& sha256keys)
{
- // Strict transport security and Public Key Pinning have very similar
- // Header formats.
-
// "Strict-Transport-Security" ":" OWS
// STS-d *( OWS ";" OWS STS-d OWS)
//
@@ -562,26 +391,6 @@ ParseSSSHeaders(uint32_t aType,
// includeSubDomains = [ "includeSubDomains" ]
//
- // "Public-Key-Pins ":" OWS
- // PKP-d *( OWS ";" OWS PKP-d OWS)
- //
- // ; PKP directive
- // PKP-d = maxAge / includeSubDomains / reportUri / pin-directive
- //
- // maxAge = "max-age" "=" delta-seconds v-ext
- //
- // includeSubDomains = [ "includeSubDomains" ]
- //
- // reportURi = "report-uri" "=" quoted-string
- //
- // pin-directive = "pin-" token "=" quoted-string
- //
- // the only valid token currently specified is sha256
- // the quoted string for a pin directive is the base64 encoding
- // of the hash of the public key of the fingerprint
- //
-
- // The order of the directives is not significant.
// All directives must appear only once.
// Directive names are case-insensitive.
// The entire header is invalid if a directive not conforming to the
@@ -593,8 +402,6 @@ ParseSSSHeaders(uint32_t aType,
NS_NAMED_LITERAL_CSTRING(max_age_var, "max-age");
NS_NAMED_LITERAL_CSTRING(include_subd_var, "includesubdomains");
- NS_NAMED_LITERAL_CSTRING(pin_sha256_var, "pin-sha256");
- NS_NAMED_LITERAL_CSTRING(report_uri_var, "report-uri");
nsSecurityHeaderParser parser(aHeader);
nsresult rv = parser.Parse();
@@ -649,29 +456,7 @@ ParseSSSHeaders(uint32_t aType,
directive->mValue.get()));
return nsISiteSecurityService::ERROR_INVALID_INCLUDE_SUBDOMAINS;
}
- } else if (aType == nsISiteSecurityService::HEADER_HPKP &&
- directive->mName.Length() == pin_sha256_var.Length() &&
- directive->mName.EqualsIgnoreCase(pin_sha256_var.get(),
- pin_sha256_var.Length())) {
- SSSLOG(("SSS: found pinning entry '%s' length=%d",
- directive->mValue.get(), directive->mValue.Length()));
- if (!stringIsBase64EncodingOf256bitValue(directive->mValue)) {
- return nsISiteSecurityService::ERROR_INVALID_PIN;
- }
- sha256keys.AppendElement(directive->mValue);
- } else if (aType == nsISiteSecurityService::HEADER_HPKP &&
- directive->mName.Length() == report_uri_var.Length() &&
- directive->mName.EqualsIgnoreCase(report_uri_var.get(),
- report_uri_var.Length())) {
- // We don't support the report-uri yet, but to avoid unrecognized
- // directive warnings, we still have to handle its presence
- if (foundReportURI) {
- SSSLOG(("SSS: found two report-uri directives"));
- return nsISiteSecurityService::ERROR_MULTIPLE_REPORT_URIS;
- }
- SSSLOG(("SSS: found report-uri directive"));
- foundReportURI = true;
- } else {
+ } else {
SSSLOG(("SSS: ignoring unrecognized directive '%s'",
directive->mName.get()));
foundUnrecognizedDirective = true;
@@ -681,194 +466,6 @@ ParseSSSHeaders(uint32_t aType,
}
nsresult
-nsSiteSecurityService::ProcessPKPHeader(nsIURI* aSourceURI,
- const char* aHeader,
- nsISSLStatus* aSSLStatus,
- uint32_t aFlags,
- uint64_t* aMaxAge,
- bool* aIncludeSubdomains,
- uint32_t* aFailureResult)
-{
- if (aFailureResult) {
- *aFailureResult = nsISiteSecurityService::ERROR_UNKNOWN;
- }
- if (!mHPKPEnabled) {
- SSSLOG(("SSS: HPKP disabled: not processing header '%s'", aHeader));
- if (aMaxAge) {
- *aMaxAge = 0;
- }
- if (aIncludeSubdomains) {
- *aIncludeSubdomains = false;
- }
- return NS_OK;
- }
-
- SSSLOG(("SSS: processing HPKP header '%s'", aHeader));
- NS_ENSURE_ARG(aSSLStatus);
-
- const uint32_t aType = nsISiteSecurityService::HEADER_HPKP;
- bool foundMaxAge = false;
- bool foundIncludeSubdomains = false;
- bool foundUnrecognizedDirective = false;
- uint64_t maxAge = 0;
- nsTArray<nsCString> sha256keys;
- uint32_t sssrv = ParseSSSHeaders(aType, aHeader, foundIncludeSubdomains,
- foundMaxAge, foundUnrecognizedDirective,
- maxAge, sha256keys);
- if (sssrv != nsISiteSecurityService::Success) {
- if (aFailureResult) {
- *aFailureResult = sssrv;
- }
- return NS_ERROR_FAILURE;
- }
-
- // after processing all the directives, make sure we came across max-age
- // somewhere.
- if (!foundMaxAge) {
- SSSLOG(("SSS: did not encounter required max-age directive"));
- if (aFailureResult) {
- *aFailureResult = nsISiteSecurityService::ERROR_NO_MAX_AGE;
- }
- return NS_ERROR_FAILURE;
- }
-
- // before we add the pin we need to ensure it will not break the site as
- // currently visited so:
- // 1. recompute a valid chain (no external ocsp)
- // 2. use this chain to check if things would have broken!
- nsAutoCString host;
- nsresult rv = GetHost(aSourceURI, host);
- NS_ENSURE_SUCCESS(rv, rv);
- nsCOMPtr<nsIX509Cert> cert;
- rv = aSSLStatus->GetServerCert(getter_AddRefs(cert));
- NS_ENSURE_SUCCESS(rv, rv);
- NS_ENSURE_TRUE(cert, NS_ERROR_FAILURE);
- UniqueCERTCertificate nssCert(cert->GetCert());
- NS_ENSURE_TRUE(nssCert, NS_ERROR_FAILURE);
-
- mozilla::pkix::Time now(mozilla::pkix::Now());
- UniqueCERTCertList certList;
- RefPtr<SharedCertVerifier> certVerifier(GetDefaultCertVerifier());
- NS_ENSURE_TRUE(certVerifier, NS_ERROR_UNEXPECTED);
- // We don't want this verification to cause any network traffic that would
- // block execution. Also, since we don't have access to the original stapled
- // OCSP response, we can't enforce this aspect of the TLS Feature extension.
- // This is ok, because it will have been enforced when we originally connected
- // to the site (or it's disabled, in which case we wouldn't want to enforce it
- // anyway).
- CertVerifier::Flags flags = CertVerifier::FLAG_LOCAL_ONLY |
- CertVerifier::FLAG_TLS_IGNORE_STATUS_REQUEST;
- if (certVerifier->VerifySSLServerCert(nssCert,
- nullptr, // stapledOCSPResponse
- nullptr, // sctsFromTLSExtension
- now, nullptr, // pinarg
- host.get(), // hostname
- certList,
- false, // don't store intermediates
- flags)
- != mozilla::pkix::Success) {
- return NS_ERROR_FAILURE;
- }
-
- CERTCertListNode* rootNode = CERT_LIST_TAIL(certList);
- if (CERT_LIST_END(rootNode, certList)) {
- return NS_ERROR_FAILURE;
- }
- bool isBuiltIn = false;
- mozilla::pkix::Result result = IsCertBuiltInRoot(rootNode->cert, isBuiltIn);
- if (result != mozilla::pkix::Success) {
- return NS_ERROR_FAILURE;
- }
-
- if (!isBuiltIn && !mProcessPKPHeadersFromNonBuiltInRoots) {
- if (aFailureResult) {
- *aFailureResult = nsISiteSecurityService::ERROR_ROOT_NOT_BUILT_IN;
- }
- return NS_ERROR_FAILURE;
- }
-
- // If maxAge == 0, we remove dynamic HPKP state for this host. Due to
- // architectural constraints, if this host was preloaded, any future lookups
- // will use the preloaded state (i.e. we can't store a "this host is not HPKP"
- // entry like we can for HSTS).
- if (maxAge == 0) {
- return RemoveState(aType, aSourceURI, aFlags);
- }
-
- // clamp maxAge to the maximum set by pref
- if (maxAge > mMaxMaxAge) {
- maxAge = mMaxMaxAge;
- }
-
- bool chainMatchesPinset;
- rv = PublicKeyPinningService::ChainMatchesPinset(certList, sha256keys,
- chainMatchesPinset);
- if (NS_FAILED(rv)) {
- return rv;
- }
- if (!chainMatchesPinset) {
- // is invalid
- SSSLOG(("SSS: Pins provided by %s are invalid no match with certList\n", host.get()));
- if (aFailureResult) {
- *aFailureResult = nsISiteSecurityService::ERROR_PINSET_DOES_NOT_MATCH_CHAIN;
- }
- return NS_ERROR_FAILURE;
- }
-
- // finally we need to ensure that there is a "backup pin" ie. There must be
- // at least one fingerprint hash that does NOT validate against the verified
- // chain (Section 2.5 of the spec)
- bool hasBackupPin = false;
- for (uint32_t i = 0; i < sha256keys.Length(); i++) {
- nsTArray<nsCString> singlePin;
- singlePin.AppendElement(sha256keys[i]);
- rv = PublicKeyPinningService::ChainMatchesPinset(certList, singlePin,
- chainMatchesPinset);
- if (NS_FAILED(rv)) {
- return rv;
- }
- if (!chainMatchesPinset) {
- hasBackupPin = true;
- }
- }
- if (!hasBackupPin) {
- // is invalid
- SSSLOG(("SSS: Pins provided by %s are invalid no backupPin\n", host.get()));
- if (aFailureResult) {
- *aFailureResult = nsISiteSecurityService::ERROR_NO_BACKUP_PIN;
- }
- return NS_ERROR_FAILURE;
- }
-
- int64_t expireTime = ExpireTimeFromMaxAge(maxAge);
- SiteHPKPState dynamicEntry(expireTime, SecurityPropertySet,
- foundIncludeSubdomains, sha256keys);
- SSSLOG(("SSS: about to set pins for %s, expires=%ld now=%ld maxAge=%lu\n",
- host.get(), expireTime, PR_Now() / PR_USEC_PER_MSEC, maxAge));
-
- rv = SetHPKPState(host.get(), dynamicEntry, aFlags, false);
- if (NS_FAILED(rv)) {
- SSSLOG(("SSS: failed to set pins for %s\n", host.get()));
- if (aFailureResult) {
- *aFailureResult = nsISiteSecurityService::ERROR_COULD_NOT_SAVE_STATE;
- }
- return rv;
- }
-
- if (aMaxAge != nullptr) {
- *aMaxAge = maxAge;
- }
-
- if (aIncludeSubdomains != nullptr) {
- *aIncludeSubdomains = foundIncludeSubdomains;
- }
-
- return foundUnrecognizedDirective
- ? NS_SUCCESS_LOSS_OF_INSIGNIFICANT_DATA
- : NS_OK;
-}
-
-nsresult
nsSiteSecurityService::ProcessSTSHeader(nsIURI* aSourceURI,
const char* aHeader,
uint32_t aFlags,
@@ -937,17 +534,11 @@ nsSiteSecurityService::IsSecureURI(uint32_t aType, nsIURI* aURI,
uint32_t aFlags, bool* aCached,
bool* aResult)
{
- // Child processes are not allowed direct access to this.
- if (!XRE_IsParentProcess() && aType != nsISiteSecurityService::HEADER_HSTS) {
- MOZ_CRASH("Child process: no direct access to nsISiteSecurityService::IsSecureURI for non-HSTS entries");
- }
-
NS_ENSURE_ARG(aURI);
NS_ENSURE_ARG(aResult);
- // Only HSTS and HPKP are supported at the moment.
- NS_ENSURE_TRUE(aType == nsISiteSecurityService::HEADER_HSTS ||
- aType == nsISiteSecurityService::HEADER_HPKP,
+ // Only HSTS is supported at the moment.
+ NS_ENSURE_TRUE(aType == nsISiteSecurityService::HEADER_HSTS,
NS_ERROR_NOT_IMPLEMENTED);
nsAutoCString hostname;
@@ -969,47 +560,16 @@ nsSiteSecurityService::IsSecureURI(uint32_t aType, nsIURI* aURI,
return IsSecureHost(aType, hostname.get(), aFlags, aCached, aResult);
}
-int STSPreloadCompare(const void *key, const void *entry)
-{
- const char *keyStr = (const char *)key;
- const nsSTSPreload *preloadEntry = (const nsSTSPreload *)entry;
- return strcmp(keyStr, preloadEntry->mHost);
-}
-
-// Returns the preload list entry for the given host, if it exists.
-// Only does exact host matching - the user must decide how to use the returned
-// data. May return null.
-const nsSTSPreload *
-nsSiteSecurityService::GetPreloadListEntry(const char *aHost)
-{
- PRTime currentTime = PR_Now() + (mPreloadListTimeOffset * PR_USEC_PER_SEC);
- if (mUsePreloadList && currentTime < gPreloadListExpirationTime) {
- return (const nsSTSPreload *) bsearch(aHost,
- kSTSPreloadList,
- mozilla::ArrayLength(kSTSPreloadList),
- sizeof(nsSTSPreload),
- STSPreloadCompare);
- }
-
- return nullptr;
-}
-
NS_IMETHODIMP
nsSiteSecurityService::IsSecureHost(uint32_t aType, const char* aHost,
uint32_t aFlags, bool* aCached,
bool* aResult)
{
- // Child processes are not allowed direct access to this.
- if (!XRE_IsParentProcess() && aType != nsISiteSecurityService::HEADER_HSTS) {
- MOZ_CRASH("Child process: no direct access to nsISiteSecurityService::IsSecureHost for non-HSTS entries");
- }
-
NS_ENSURE_ARG(aHost);
NS_ENSURE_ARG(aResult);
- // Only HSTS and HPKP are supported at the moment.
- NS_ENSURE_TRUE(aType == nsISiteSecurityService::HEADER_HSTS ||
- aType == nsISiteSecurityService::HEADER_HPKP,
+ // Only HSTS is supported at the moment.
+ NS_ENSURE_TRUE(aType == nsISiteSecurityService::HEADER_HSTS,
NS_ERROR_NOT_IMPLEMENTED);
// set default in case if we can't find any STS information
@@ -1023,38 +583,14 @@ nsSiteSecurityService::IsSecureHost(uint32_t aType, const char* aHost,
return NS_OK;
}
- /* An IP address never qualifies as a secure URI. */
+ // An IP address never qualifies as a secure URI.
if (HostIsIPAddress(aHost)) {
return NS_OK;
}
- if (aType == nsISiteSecurityService::HEADER_HPKP) {
- RefPtr<SharedCertVerifier> certVerifier(GetDefaultCertVerifier());
- if (!certVerifier) {
- return NS_ERROR_FAILURE;
- }
- if (certVerifier->mPinningMode ==
- CertVerifier::PinningMode::pinningDisabled) {
- return NS_OK;
- }
- bool enforceTestMode = certVerifier->mPinningMode ==
- CertVerifier::PinningMode::pinningEnforceTestMode;
- return PublicKeyPinningService::HostHasPins(aHost, mozilla::pkix::Now(),
- enforceTestMode, *aResult);
- }
-
- // Holepunch chart.apis.google.com and subdomains.
- nsAutoCString host(PublicKeyPinningService::CanonicalizeHostname(aHost));
- if (host.EqualsLiteral("chart.apis.google.com") ||
- StringEndsWith(host, NS_LITERAL_CSTRING(".chart.apis.google.com"))) {
- if (aCached) {
- *aCached = true;
- }
- return NS_OK;
- }
-
- const nsSTSPreload *preload = nullptr;
-
+ // Canonicalize the passed host name
+ nsAutoCString host(CanonicalizeHostname(aHost));
+
// First check the exact host. This involves first checking for an entry in
// site security storage. If that entry exists, we don't want to check
// in the preload list. We only want to use the stored value if it is not a
@@ -1086,21 +622,11 @@ nsSiteSecurityService::IsSecureHost(uint32_t aType, const char* aHost,
}
}
- // If the entry is expired and not in the preload list, we can remove it.
- if (expired && !GetPreloadListEntry(host.get())) {
+ // If the entry is expired we can remove it.
+ if (expired) {
mSiteStateStorage->Remove(storageKey, storageType);
}
}
- // Finally look in the preloaded list. This is the exact host,
- // so if an entry exists at all, this host is HSTS.
- else if (GetPreloadListEntry(host.get())) {
- SSSLOG(("%s is a preloaded STS host", host.get()));
- *aResult = true;
- if (aCached) {
- *aCached = true;
- }
- return NS_OK;
- }
SSSLOG(("no HSTS data for %s found, walking up domain", host.get()));
const char *subdomain;
@@ -1144,23 +670,11 @@ nsSiteSecurityService::IsSecureHost(uint32_t aType, const char* aHost,
}
}
- // If the entry is expired and not in the preload list, we can remove it.
- if (expired && !GetPreloadListEntry(subdomain)) {
+ // If the entry is expired we can remove it.
+ if (expired) {
mSiteStateStorage->Remove(storageKey, storageType);
}
}
- // This is an ancestor, so if we get a match, we have to check if the
- // preloaded entry includes subdomains.
- else if ((preload = GetPreloadListEntry(subdomain)) != nullptr) {
- if (preload->mIncludeSubdomains) {
- SSSLOG(("%s is a preloaded STS host", subdomain));
- *aResult = true;
- if (aCached) {
- *aCached = true;
- }
- break;
- }
- }
SSSLOG(("no HSTS data for %s found, walking up domain", subdomain));
}
@@ -1172,155 +686,9 @@ nsSiteSecurityService::IsSecureHost(uint32_t aType, const char* aHost,
NS_IMETHODIMP
nsSiteSecurityService::ClearAll()
{
- // Child processes are not allowed direct access to this.
- if (!XRE_IsParentProcess()) {
- MOZ_CRASH("Child process: no direct access to nsISiteSecurityService::ClearAll");
- }
-
return mSiteStateStorage->Clear();
}
-NS_IMETHODIMP
-nsSiteSecurityService::ClearPreloads()
-{
- // Child processes are not allowed direct access to this.
- if (!XRE_IsParentProcess()) {
- MOZ_CRASH("Child process: no direct access to nsISiteSecurityService::ClearPreloads");
- }
-
- return mPreloadStateStorage->Clear();
-}
-
-bool entryStateNotOK(SiteHPKPState& state, mozilla::pkix::Time& aEvalTime) {
- return state.mState != SecurityPropertySet || state.IsExpired(aEvalTime) ||
- state.mSHA256keys.Length() < 1;
-}
-
-NS_IMETHODIMP
-nsSiteSecurityService::GetKeyPinsForHostname(const char* aHostname,
- mozilla::pkix::Time& aEvalTime,
- /*out*/ nsTArray<nsCString>& pinArray,
- /*out*/ bool* aIncludeSubdomains,
- /*out*/ bool* aFound) {
- // Child processes are not allowed direct access to this.
- if (!XRE_IsParentProcess()) {
- MOZ_CRASH("Child process: no direct access to nsISiteSecurityService::GetKeyPinsForHostname");
- }
-
- NS_ENSURE_ARG(aFound);
- NS_ENSURE_ARG(aHostname);
-
- if (!mHPKPEnabled) {
- SSSLOG(("HPKP disabled - returning 'pins not found' for %s",
- aHostname));
- *aFound = false;
- return NS_OK;
- }
-
- SSSLOG(("Top of GetKeyPinsForHostname for %s", aHostname));
- *aFound = false;
- *aIncludeSubdomains = false;
- pinArray.Clear();
-
- nsAutoCString host(PublicKeyPinningService::CanonicalizeHostname(aHostname));
- nsAutoCString storageKey;
- SetStorageKey(storageKey, host, nsISiteSecurityService::HEADER_HPKP);
-
- SSSLOG(("storagekey '%s'\n", storageKey.get()));
- mozilla::DataStorageType storageType = mozilla::DataStorage_Persistent;
- nsCString value = mSiteStateStorage->Get(storageKey, storageType);
-
- // decode now
- SiteHPKPState foundEntry(value);
- if (entryStateNotOK(foundEntry, aEvalTime)) {
- // not in permanent storage, try now private
- value = mSiteStateStorage->Get(storageKey, mozilla::DataStorage_Private);
- SiteHPKPState privateEntry(value);
- if (entryStateNotOK(privateEntry, aEvalTime)) {
- // not in private storage, try dynamic preload
- value = mPreloadStateStorage->Get(storageKey,
- mozilla::DataStorage_Persistent);
- SiteHPKPState preloadEntry(value);
- if (entryStateNotOK(preloadEntry, aEvalTime)) {
- return NS_OK;
- }
- foundEntry = preloadEntry;
- } else {
- foundEntry = privateEntry;
- }
- }
- pinArray = foundEntry.mSHA256keys;
- *aIncludeSubdomains = foundEntry.mIncludeSubdomains;
- *aFound = true;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsSiteSecurityService::SetKeyPins(const char* aHost, bool aIncludeSubdomains,
- int64_t aExpires, uint32_t aPinCount,
- const char** aSha256Pins,
- bool aIsPreload,
- /*out*/ bool* aResult)
-{
- // Child processes are not allowed direct access to this.
- if (!XRE_IsParentProcess()) {
- MOZ_CRASH("Child process: no direct access to nsISiteSecurityService::SetKeyPins");
- }
-
- NS_ENSURE_ARG_POINTER(aHost);
- NS_ENSURE_ARG_POINTER(aResult);
- NS_ENSURE_ARG_POINTER(aSha256Pins);
-
-
- if (!mHPKPEnabled) {
- SSSLOG(("SSS: HPKP disabled: not setting pins"));
- *aResult = false;
- return NS_OK;
- }
-
- SSSLOG(("Top of SetPins"));
-
- nsTArray<nsCString> sha256keys;
- for (unsigned int i = 0; i < aPinCount; i++) {
- nsAutoCString pin(aSha256Pins[i]);
- SSSLOG(("SetPins pin=%s\n", pin.get()));
- if (!stringIsBase64EncodingOf256bitValue(pin)) {
- return NS_ERROR_INVALID_ARG;
- }
- sha256keys.AppendElement(pin);
- }
- SiteHPKPState dynamicEntry(aExpires, SecurityPropertySet,
- aIncludeSubdomains, sha256keys);
- // we always store data in permanent storage (ie no flags)
- nsAutoCString host(PublicKeyPinningService::CanonicalizeHostname(aHost));
- return SetHPKPState(host.get(), dynamicEntry, 0, aIsPreload);
-}
-
-nsresult
-nsSiteSecurityService::SetHPKPState(const char* aHost, SiteHPKPState& entry,
- uint32_t aFlags, bool aIsPreload)
-{
- SSSLOG(("Top of SetPKPState"));
- nsAutoCString host(aHost);
- nsAutoCString storageKey;
- SetStorageKey(storageKey, host, nsISiteSecurityService::HEADER_HPKP);
- bool isPrivate = aFlags & nsISocketProvider::NO_PERMANENT_STORAGE;
- mozilla::DataStorageType storageType = isPrivate
- ? mozilla::DataStorage_Private
- : mozilla::DataStorage_Persistent;
- nsAutoCString stateString;
- entry.ToString(stateString);
-
- nsresult rv;
- if (aIsPreload) {
- rv = mPreloadStateStorage->Put(storageKey, stateString, storageType);
- } else {
- rv = mSiteStateStorage->Put(storageKey, stateString, storageType);
- }
- NS_ENSURE_SUCCESS(rv, rv);
- return NS_OK;
-}
-
//------------------------------------------------------------
// nsSiteSecurityService::nsIObserver
//------------------------------------------------------------
@@ -1337,18 +705,10 @@ nsSiteSecurityService::Observe(nsISupports *subject,
}
if (strcmp(topic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) == 0) {
- mUsePreloadList = mozilla::Preferences::GetBool(
- "network.stricttransportsecurity.preloadlist", true);
mUseStsService = mozilla::Preferences::GetBool(
"network.stricttransportsecurity.enabled", true);
mPreloadListTimeOffset =
mozilla::Preferences::GetInt("test.currentTimeOffsetSeconds", 0);
- mHPKPEnabled = mozilla::Preferences::GetBool(
- "security.cert_pinning.hpkp.enabled", false);
- mProcessPKPHeadersFromNonBuiltInRoots = mozilla::Preferences::GetBool(
- "security.cert_pinning.process_headers_from_non_builtin_roots", false);
- mMaxMaxAge = mozilla::Preferences::GetInt(
- "security.cert_pinning.max_max_age_seconds", kSixtyDaysInSeconds);
}
return NS_OK;
diff --git a/security/manager/ssl/nsSiteSecurityService.h b/security/manager/ssl/nsSiteSecurityService.h
index c14543684..9395cd092 100644
--- a/security/manager/ssl/nsSiteSecurityService.h
+++ b/security/manager/ssl/nsSiteSecurityService.h
@@ -17,10 +17,10 @@
class nsIURI;
class nsISSLStatus;
-// {16955eee-6c48-4152-9309-c42a465138a1}
+// 91ea3803-9c79-45d9-97bf-88bc80269236
#define NS_SITE_SECURITY_SERVICE_CID \
- {0x16955eee, 0x6c48, 0x4152, \
- {0x93, 0x09, 0xc4, 0x2a, 0x46, 0x51, 0x38, 0xa1} }
+ { 0x91ea3803, 0x9c79, 0x45d9, \
+ { 0x97, 0xbf, 0x88, 0xbc, 0x80, 0x26, 0x92, 0x36 } }
/**
* SecurityPropertyState: A utility enum for representing the different states
@@ -39,40 +39,6 @@ enum SecurityPropertyState {
};
/**
- * SiteHPKPState: A utility class that encodes/decodes a string describing
- * the public key pins of a site.
- * HPKP state consists of:
- * - Expiry time (PRTime (aka int64_t) in milliseconds)
- * - A state flag (SecurityPropertyState, default SecurityPropertyUnset)
- * - An include subdomains flag (bool, default false)
- * - An array of sha-256 hashed base 64 encoded fingerprints of required keys
- */
-class SiteHPKPState
-{
-public:
- SiteHPKPState();
- explicit SiteHPKPState(nsCString& aStateString);
- SiteHPKPState(PRTime aExpireTime, SecurityPropertyState aState,
- bool aIncludeSubdomains, nsTArray<nsCString>& SHA256keys);
-
- PRTime mExpireTime;
- SecurityPropertyState mState;
- bool mIncludeSubdomains;
- nsTArray<nsCString> mSHA256keys;
-
- bool IsExpired(mozilla::pkix::Time aTime)
- {
- if (aTime > mozilla::pkix::TimeFromEpochInSeconds(mExpireTime /
- PR_MSEC_PER_SEC)) {
- return true;
- }
- return false;
- }
-
- void ToString(nsCString& aString);
-};
-
-/**
* SiteHSTSState: A utility class that encodes/decodes a string describing
* the security state of a site. Currently only handles HSTS.
* HSTS state consists of:
@@ -110,8 +76,6 @@ public:
void ToString(nsCString &aString);
};
-class nsSTSPreload;
-
class nsSiteSecurityService : public nsISiteSecurityService
, public nsIObserver
{
@@ -139,23 +103,10 @@ private:
nsresult ProcessSTSHeader(nsIURI* aSourceURI, const char* aHeader,
uint32_t flags, uint64_t* aMaxAge,
bool* aIncludeSubdomains, uint32_t* aFailureResult);
- nsresult ProcessPKPHeader(nsIURI* aSourceURI, const char* aHeader,
- nsISSLStatus* aSSLStatus, uint32_t flags,
- uint64_t* aMaxAge, bool* aIncludeSubdomains,
- uint32_t* aFailureResult);
- nsresult SetHPKPState(const char* aHost, SiteHPKPState& entry, uint32_t flags,
- bool aIsPreload);
-
- const nsSTSPreload *GetPreloadListEntry(const char *aHost);
- uint64_t mMaxMaxAge;
- bool mUsePreloadList;
bool mUseStsService;
int64_t mPreloadListTimeOffset;
- bool mHPKPEnabled;
- bool mProcessPKPHeadersFromNonBuiltInRoots;
RefPtr<mozilla::DataStorage> mSiteStateStorage;
- RefPtr<mozilla::DataStorage> mPreloadStateStorage;
};
#endif // __nsSiteSecurityService_h__
diff --git a/security/manager/ssl/tests/unit/test_pinning.js b/security/manager/ssl/tests/unit/test_pinning.js
deleted file mode 100644
index f18182002..000000000
--- a/security/manager/ssl/tests/unit/test_pinning.js
+++ /dev/null
@@ -1,266 +0,0 @@
-// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-//
-// For all cases, the acceptable pinset includes only certificates pinned to
-// Test End Entity Cert (signed by issuer testCA). Other certificates
-// are issued by otherCA, which is never in the pinset but is a user-specified
-// trust anchor. This test covers multiple cases:
-//
-// Pinned domain include-subdomains.pinning.example.com includes subdomains
-// - PASS: include-subdomains.pinning.example.com serves a correct cert
-// - PASS: good.include-subdomains.pinning.example.com serves a correct cert
-// - FAIL (strict): bad.include-subdomains.pinning.example.com serves a cert
-// not in the pinset
-// - PASS (mitm): bad.include-subdomains.pinning.example.com serves a cert not
-// in the pinset, but issued by a user-specified trust domain
-//
-// Pinned domain exclude-subdomains.pinning.example.com excludes subdomains
-// - PASS: exclude-subdomains.pinning.example.com serves a correct cert
-// - FAIL: exclude-subdomains.pinning.example.com serves an incorrect cert
-// (TODO: test using verifyCertNow)
-// - PASS: sub.exclude-subdomains.pinning.example.com serves an incorrect cert
-
-"use strict";
-
-do_get_profile(); // must be called before getting nsIX509CertDB
-const certdb = Cc["@mozilla.org/security/x509certdb;1"]
- .getService(Ci.nsIX509CertDB);
-
-function add_clear_override(host) {
- add_test(function() {
- let certOverrideService = Cc["@mozilla.org/security/certoverride;1"]
- .getService(Ci.nsICertOverrideService);
- certOverrideService.clearValidityOverride(host, 8443);
- run_next_test();
- });
-}
-
-function test_strict() {
- // In strict mode, we always evaluate pinning data, regardless of whether the
- // issuer is a built-in trust anchor. We only enforce pins that are not in
- // test mode.
- add_test(function() {
- Services.prefs.setIntPref("security.cert_pinning.enforcement_level", 2);
- run_next_test();
- });
-
- // Normally this is overridable. But, since we have pinning information for
- // this host, we don't allow overrides.
- add_prevented_cert_override_test(
- "unknownissuer.include-subdomains.pinning.example.com",
- Ci.nsICertOverrideService.ERROR_UNTRUSTED,
- SEC_ERROR_UNKNOWN_ISSUER);
- add_clear_override("unknownissuer.include-subdomains.pinning.example.com");
-
- // Issued by otherCA, which is not in the pinset for pinning.example.com.
- add_connection_test("bad.include-subdomains.pinning.example.com",
- MOZILLA_PKIX_ERROR_KEY_PINNING_FAILURE);
-
- // Check that using a FQDN doesn't bypass pinning.
- add_connection_test("bad.include-subdomains.pinning.example.com.",
- MOZILLA_PKIX_ERROR_KEY_PINNING_FAILURE);
- // For some reason this is also navigable (see bug 1118522).
- add_connection_test("bad.include-subdomains.pinning.example.com..",
- MOZILLA_PKIX_ERROR_KEY_PINNING_FAILURE);
-
- // These domains serve certs that match the pinset.
- add_connection_test("include-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
- add_connection_test("good.include-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
- add_connection_test("exclude-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
-
- // This domain serves a cert that doesn't match the pinset, but subdomains
- // are excluded.
- add_connection_test("sub.exclude-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
-
- // This domain's pinset is exactly the same as
- // include-subdomains.pinning.example.com, serves the same cert as
- // bad.include-subdomains.pinning.example.com, but it should pass because
- // it's in test_mode.
- add_connection_test("test-mode.pinning.example.com",
- PRErrorCodeSuccess);
- // Similarly, this pin is in test-mode, so it should be overridable.
- add_cert_override_test("unknownissuer.test-mode.pinning.example.com",
- Ci.nsICertOverrideService.ERROR_UNTRUSTED,
- SEC_ERROR_UNKNOWN_ISSUER);
- add_clear_override("unknownissuer.test-mode.pinning.example.com");
-}
-
-function test_mitm() {
- // In MITM mode, we allow pinning to pass if the chain resolves to any
- // user-specified trust anchor, even if it is not in the pinset.
- add_test(function() {
- Services.prefs.setIntPref("security.cert_pinning.enforcement_level", 1);
- run_next_test();
- });
-
- add_connection_test("include-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
- add_connection_test("good.include-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
-
- // Normally this is overridable. But, since we have pinning information for
- // this host, we don't allow overrides (since building a trusted chain fails,
- // we have no reason to believe this was issued by a user-added trust
- // anchor, so we can't allow overrides for it).
- add_prevented_cert_override_test(
- "unknownissuer.include-subdomains.pinning.example.com",
- Ci.nsICertOverrideService.ERROR_UNTRUSTED,
- SEC_ERROR_UNKNOWN_ISSUER);
- add_clear_override("unknownissuer.include-subdomains.pinning.example.com");
-
- // In this case, even though otherCA is not in the pinset, it is a
- // user-specified trust anchor and the pinning check succeeds.
- add_connection_test("bad.include-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
-
- add_connection_test("exclude-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
- add_connection_test("sub.exclude-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
- add_connection_test("test-mode.pinning.example.com", PRErrorCodeSuccess);
- add_cert_override_test("unknownissuer.test-mode.pinning.example.com",
- Ci.nsICertOverrideService.ERROR_UNTRUSTED,
- SEC_ERROR_UNKNOWN_ISSUER);
- add_clear_override("unknownissuer.test-mode.pinning.example.com");
-}
-
-function test_disabled() {
- // Disable pinning.
- add_test(function() {
- Services.prefs.setIntPref("security.cert_pinning.enforcement_level", 0);
- run_next_test();
- });
-
- add_connection_test("include-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
- add_connection_test("good.include-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
- add_connection_test("bad.include-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
- add_connection_test("exclude-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
- add_connection_test("sub.exclude-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
- add_connection_test("test-mode.pinning.example.com", PRErrorCodeSuccess);
-
- add_cert_override_test("unknownissuer.include-subdomains.pinning.example.com",
- Ci.nsICertOverrideService.ERROR_UNTRUSTED,
- SEC_ERROR_UNKNOWN_ISSUER);
- add_clear_override("unknownissuer.include-subdomains.pinning.example.com");
- add_cert_override_test("unknownissuer.test-mode.pinning.example.com",
- Ci.nsICertOverrideService.ERROR_UNTRUSTED,
- SEC_ERROR_UNKNOWN_ISSUER);
- add_clear_override("unknownissuer.test-mode.pinning.example.com");
-}
-
-function test_enforce_test_mode() {
- // In enforce test mode, we always enforce all pins, even test pins.
- add_test(function() {
- Services.prefs.setIntPref("security.cert_pinning.enforcement_level", 3);
- run_next_test();
- });
-
- // Normally this is overridable. But, since we have pinning information for
- // this host, we don't allow overrides.
- add_prevented_cert_override_test(
- "unknownissuer.include-subdomains.pinning.example.com",
- Ci.nsICertOverrideService.ERROR_UNTRUSTED,
- SEC_ERROR_UNKNOWN_ISSUER);
- add_clear_override("unknownissuer.include-subdomains.pinning.example.com");
-
- // Issued by otherCA, which is not in the pinset for pinning.example.com.
- add_connection_test("bad.include-subdomains.pinning.example.com",
- MOZILLA_PKIX_ERROR_KEY_PINNING_FAILURE);
-
- // These domains serve certs that match the pinset.
- add_connection_test("include-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
- add_connection_test("good.include-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
- add_connection_test("exclude-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
-
- // This domain serves a cert that doesn't match the pinset, but subdomains
- // are excluded.
- add_connection_test("sub.exclude-subdomains.pinning.example.com",
- PRErrorCodeSuccess);
-
- // This domain's pinset is exactly the same as
- // include-subdomains.pinning.example.com, serves the same cert as
- // bad.include-subdomains.pinning.example.com, is in test-mode, but we are
- // enforcing test mode pins.
- add_connection_test("test-mode.pinning.example.com",
- MOZILLA_PKIX_ERROR_KEY_PINNING_FAILURE);
- // Normally this is overridable. But, since we have pinning information for
- // this host (and since we're enforcing test mode), we don't allow overrides.
- add_prevented_cert_override_test(
- "unknownissuer.test-mode.pinning.example.com",
- Ci.nsICertOverrideService.ERROR_UNTRUSTED,
- SEC_ERROR_UNKNOWN_ISSUER);
- add_clear_override("unknownissuer.test-mode.pinning.example.com");
-}
-
-function check_pinning_telemetry() {
- let service = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
- let prod_histogram = service.getHistogramById("CERT_PINNING_RESULTS")
- .snapshot();
- let test_histogram = service.getHistogramById("CERT_PINNING_TEST_RESULTS")
- .snapshot();
- // Because all of our test domains are pinned to user-specified trust
- // anchors, effectively only strict mode and enforce test-mode get evaluated
- equal(prod_histogram.counts[0], 4,
- "Actual and expected prod (non-Mozilla) failure count should match");
- equal(prod_histogram.counts[1], 4,
- "Actual and expected prod (non-Mozilla) success count should match");
- equal(test_histogram.counts[0], 2,
- "Actual and expected test (non-Mozilla) failure count should match");
- equal(test_histogram.counts[1], 0,
- "Actual and expected test (non-Mozilla) success count should match");
-
- let moz_prod_histogram = service.getHistogramById("CERT_PINNING_MOZ_RESULTS")
- .snapshot();
- let moz_test_histogram =
- service.getHistogramById("CERT_PINNING_MOZ_TEST_RESULTS").snapshot();
- equal(moz_prod_histogram.counts[0], 0,
- "Actual and expected prod (Mozilla) failure count should match");
- equal(moz_prod_histogram.counts[1], 0,
- "Actual and expected prod (Mozilla) success count should match");
- equal(moz_test_histogram.counts[0], 0,
- "Actual and expected test (Mozilla) failure count should match");
- equal(moz_test_histogram.counts[1], 0,
- "Actual and expected test (Mozilla) success count should match");
-
- let per_host_histogram =
- service.getHistogramById("CERT_PINNING_MOZ_RESULTS_BY_HOST").snapshot();
- equal(per_host_histogram.counts[0], 0,
- "Actual and expected per host (Mozilla) failure count should match");
- equal(per_host_histogram.counts[1], 2,
- "Actual and expected per host (Mozilla) success count should match");
- run_next_test();
-}
-
-function run_test() {
- // Ensure that static pinning works when HPKP is disabled.
- Services.prefs.setBoolPref("security.cert_pinning.hpkp.enabled", false);
-
- add_tls_server_setup("BadCertServer", "bad_certs");
-
- // Add a user-specified trust anchor.
- addCertFromFile(certdb, "bad_certs/other-test-ca.pem", "CTu,u,u");
-
- test_strict();
- test_mitm();
- test_disabled();
- test_enforce_test_mode();
-
- add_test(function () {
- check_pinning_telemetry();
- });
- run_next_test();
-}
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic.js b/security/manager/ssl/tests/unit/test_pinning_dynamic.js
deleted file mode 100644
index 7333ad6b3..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic.js
+++ /dev/null
@@ -1,247 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-// The purpose of this test is to create a site security service state file
-// and see that the site security service reads it properly.
-
-function writeLine(aLine, aOutputStream) {
- aOutputStream.write(aLine, aLine.length);
-}
-
-var gSSService = null;
-var gSSSStateSeen = false;
-var gPreloadStateSeen = false;
-
-var profileDir = do_get_profile();
-var certdb;
-
-function certFromFile(cert_name) {
- return constructCertFromFile("test_pinning_dynamic/" + cert_name + ".pem");
-}
-
-function loadCert(cert_name, trust_string) {
- let cert_filename = "test_pinning_dynamic/" + cert_name + ".pem";
- addCertFromFile(certdb, cert_filename, trust_string);
- return constructCertFromFile(cert_filename);
-}
-
-function checkOK(cert, hostname) {
- return checkCertErrorGeneric(certdb, cert, PRErrorCodeSuccess,
- certificateUsageSSLServer, {}, hostname);
-}
-
-function checkFail(cert, hostname) {
- return checkCertErrorGeneric(certdb, cert, MOZILLA_PKIX_ERROR_KEY_PINNING_FAILURE,
- certificateUsageSSLServer, {}, hostname);
-}
-
-const NON_ISSUED_KEY_HASH = "KHAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAN=";
-const PINNING_ROOT_KEY_HASH = "VCIlmPM9NkgFQtrs4Oa5TeFcDu6MWRTKSNdePEhOgD8=";
-
-function run_test() {
- Services.prefs.setBoolPref("security.cert_pinning.hpkp.enabled", true);
- Services.prefs.setIntPref("security.cert_pinning.enforcement_level", 2);
-
- let stateFile = profileDir.clone();
- stateFile.append(SSS_STATE_FILE_NAME);
- // Assuming we're working with a clean slate, the SSS_STATE file shouldn't
- // exist until we create it.
- ok(!stateFile.exists(),
- "State file should not exist when working with a clean slate");
- let outputStream = FileUtils.openFileOutputStream(stateFile);
- let now = (new Date()).getTime();
- writeLine(`a.pinning2.example.com:HPKP\t0\t0\t${now + 100000},1,0,${PINNING_ROOT_KEY_HASH}\n`, outputStream);
- writeLine(`b.pinning2.example.com:HPKP\t0\t0\t${now + 100000},1,1,${PINNING_ROOT_KEY_HASH}\n`, outputStream);
-
- outputStream.close();
-
- let preloadFile = profileDir.clone();
- preloadFile.append(PRELOAD_STATE_FILE_NAME);
- ok(!preloadFile.exists(),
- "Preload file should not exist when working with a clean slate");
-
- outputStream = FileUtils.openFileOutputStream(preloadFile);
- writeLine(`a.preload.example.com:HPKP\t0\t0\t${now + 100000},1,1,${PINNING_ROOT_KEY_HASH}\n`, outputStream);
- outputStream.close();
-
- Services.obs.addObserver(checkStateRead, "data-storage-ready", false);
- do_test_pending();
- gSSService = Cc["@mozilla.org/ssservice;1"]
- .getService(Ci.nsISiteSecurityService);
- notEqual(gSSService, null,
- "SiteSecurityService should have initialized successfully using" +
- " the generated state file");
-}
-
-function checkDefaultSiteHPKPStatus() {
- ok(gSSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HPKP,
- "a.pinning2.example.com", 0),
- "a.pinning2.example.com should have HPKP status");
- ok(!gSSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HPKP,
- "x.a.pinning2.example.com", 0),
- "x.a.pinning2.example.com should not have HPKP status");
- ok(gSSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HPKP,
- "b.pinning2.example.com", 0),
- "b.pinning2.example.com should have HPKP status");
- ok(gSSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HPKP,
- "x.b.pinning2.example.com", 0),
- "x.b.pinning2.example.com should have HPKP status");
-}
-
-function checkStateRead(aSubject, aTopic, aData) {
- if (aData == SSS_STATE_FILE_NAME) {
- gSSSStateSeen = true;
- } else if (aData == PRELOAD_STATE_FILE_NAME) {
- gPreloadStateSeen = true;
- } else {
- throw new Error("Observed data should either be the Site Security " +
- "Service state file name or the preload file name");
- }
-
- if (!gSSSStateSeen || !gPreloadStateSeen) {
- return;
- }
-
- notEqual(gSSService, null, "SiteSecurityService should be initialized");
-
- // Initializing the certificate DB will cause NSS-initialization, which in
- // turn initializes the site security service. Since we're in part testing
- // that the site security service correctly reads its state file, we have to
- // make sure it doesn't start up before we've populated the file
- certdb = Cc["@mozilla.org/security/x509certdb;1"]
- .getService(Ci.nsIX509CertDB);
-
- loadCert("pinningroot", "CTu,CTu,CTu");
- loadCert("badca", "CTu,CTu,CTu");
-
- // the written entry is for a.pinning2.example.com without subdomains
- // and b.pinning2.example.com with subdomains
- checkFail(certFromFile('a.pinning2.example.com-badca'), "a.pinning2.example.com");
- checkOK(certFromFile('a.pinning2.example.com-pinningroot'), "a.pinning2.example.com");
- checkOK(certFromFile('x.a.pinning2.example.com-badca'), "x.a.pinning2.example.com");
- checkOK(certFromFile('x.a.pinning2.example.com-pinningroot'), "x.a.pinning2.example.com");
-
- checkFail(certFromFile('b.pinning2.example.com-badca'), "b.pinning2.example.com");
- checkOK(certFromFile('b.pinning2.example.com-pinningroot'), "b.pinning2.example.com");
- checkFail(certFromFile('x.b.pinning2.example.com-badca'), "x.b.pinning2.example.com");
- checkOK(certFromFile('x.b.pinning2.example.com-pinningroot'), "x.b.pinning2.example.com");
-
- checkDefaultSiteHPKPStatus();
-
-
- // add includeSubdomains to a.pinning2.example.com
- gSSService.setKeyPins("a.pinning2.example.com", true,
- new Date().getTime() + 1000000, 2,
- [NON_ISSUED_KEY_HASH, PINNING_ROOT_KEY_HASH]);
- checkFail(certFromFile('a.pinning2.example.com-badca'), "a.pinning2.example.com");
- checkOK(certFromFile('a.pinning2.example.com-pinningroot'), "a.pinning2.example.com");
- checkFail(certFromFile('x.a.pinning2.example.com-badca'), "x.a.pinning2.example.com");
- checkOK(certFromFile('x.a.pinning2.example.com-pinningroot'), "x.a.pinning2.example.com");
- checkFail(certFromFile('b.pinning2.example.com-badca'), "b.pinning2.example.com");
- checkOK(certFromFile('b.pinning2.example.com-pinningroot'), "b.pinning2.example.com");
- checkFail(certFromFile('x.b.pinning2.example.com-badca'), "x.b.pinning2.example.com");
- checkOK(certFromFile('x.b.pinning2.example.com-pinningroot'), "x.b.pinning2.example.com");
-
- ok(gSSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HPKP,
- "a.pinning2.example.com", 0),
- "a.pinning2.example.com should still have HPKP status after adding" +
- " includeSubdomains to a.pinning2.example.com");
- ok(gSSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HPKP,
- "x.a.pinning2.example.com", 0),
- "x.a.pinning2.example.com should now have HPKP status after adding" +
- " includeSubdomains to a.pinning2.example.com");
-
- // Now setpins without subdomains
- gSSService.setKeyPins("a.pinning2.example.com", false,
- new Date().getTime() + 1000000, 2,
- [NON_ISSUED_KEY_HASH, PINNING_ROOT_KEY_HASH]);
- checkFail(certFromFile('a.pinning2.example.com-badca'), "a.pinning2.example.com");
- checkOK(certFromFile('a.pinning2.example.com-pinningroot'), "a.pinning2.example.com");
- checkOK(certFromFile('x.a.pinning2.example.com-badca'), "x.a.pinning2.example.com");
- checkOK(certFromFile('x.a.pinning2.example.com-pinningroot'), "x.a.pinning2.example.com");
-
- checkFail(certFromFile('b.pinning2.example.com-badca'), "b.pinning2.example.com");
- checkOK(certFromFile('b.pinning2.example.com-pinningroot'), "b.pinning2.example.com");
- checkFail(certFromFile('x.b.pinning2.example.com-badca'), "x.b.pinning2.example.com");
- checkOK(certFromFile('x.b.pinning2.example.com-pinningroot'), "x.b.pinning2.example.com");
-
- checkDefaultSiteHPKPStatus();
-
- // failure to insert new pin entry leaves previous pin behavior
- throws(() => {
- gSSService.setKeyPins("a.pinning2.example.com", true,
- new Date().getTime() + 1000000, 1, ["not a hash"]);
- }, /NS_ERROR_ILLEGAL_VALUE/, "Attempting to set an invalid pin should fail");
- checkFail(certFromFile('a.pinning2.example.com-badca'), "a.pinning2.example.com");
- checkOK(certFromFile('a.pinning2.example.com-pinningroot'), "a.pinning2.example.com");
- checkOK(certFromFile('x.a.pinning2.example.com-badca'), "x.a.pinning2.example.com");
- checkOK(certFromFile('x.a.pinning2.example.com-pinningroot'), "x.a.pinning2.example.com");
-
- checkFail(certFromFile('b.pinning2.example.com-badca'), "b.pinning2.example.com");
- checkOK(certFromFile('b.pinning2.example.com-pinningroot'), "b.pinning2.example.com");
- checkFail(certFromFile('x.b.pinning2.example.com-badca'), "x.b.pinning2.example.com");
- checkOK(certFromFile('x.b.pinning2.example.com-pinningroot'), "x.b.pinning2.example.com");
-
- checkDefaultSiteHPKPStatus();
-
- // Incorrect size results in failure
- throws(() => {
- gSSService.setKeyPins("a.pinning2.example.com", true,
- new Date().getTime() + 1000000, 2, ["not a hash"]);
- }, /NS_ERROR_XPC_NOT_ENOUGH_ELEMENTS_IN_ARRAY/,
- "Attempting to set a pin with an incorrect size should fail");
-
- // Ensure built-in pins work as expected
- ok(!gSSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HPKP,
- "nonexistent.example.com", 0),
- "Not built-in nonexistent.example.com should not have HPKP status");
- ok(gSSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HPKP,
- "include-subdomains.pinning.example.com", 0),
- "Built-in include-subdomains.pinning.example.com should have HPKP status");
-
- gSSService.setKeyPins("a.pinning2.example.com", false, new Date().getTime(),
- 1, [NON_ISSUED_KEY_HASH]);
-
- // Check that a preload pin loaded from file works as expected
- checkFail(certFromFile("a.preload.example.com-badca"), "a.preload.example.com");
- checkOK(certFromFile("a.preload.example.com-pinningroot"), "a.preload.example.com");
-
- // Check a dynamic addition works as expected
- // first, it should succeed with the badCA - because there's no pin
- checkOK(certFromFile('b.preload.example.com-badca'), "b.preload.example.com");
- // then we add a pin, and we should get a failure (ensuring the expiry is
- // after the test timeout)
- gSSService.setKeyPins("b.preload.example.com", false,
- new Date().getTime() + 1000000, 2,
- [NON_ISSUED_KEY_HASH, PINNING_ROOT_KEY_HASH], true);
- checkFail(certFromFile('b.preload.example.com-badca'), "b.preload.example.com");
-
- do_timeout(1250, checkExpiredState);
-}
-
-function checkExpiredState() {
- checkOK(certFromFile('a.pinning2.example.com-badca'), "a.pinning2.example.com");
- checkOK(certFromFile('a.pinning2.example.com-pinningroot'), "a.pinning2.example.com");
- checkOK(certFromFile('x.a.pinning2.example.com-badca'), "x.a.pinning2.example.com");
- checkOK(certFromFile('x.a.pinning2.example.com-pinningroot'), "x.a.pinning2.example.com");
-
- checkFail(certFromFile('b.pinning2.example.com-badca'), "b.pinning2.example.com");
- checkOK(certFromFile('b.pinning2.example.com-pinningroot'), "b.pinning2.example.com");
- checkFail(certFromFile('x.b.pinning2.example.com-badca'), "x.b.pinning2.example.com");
- checkOK(certFromFile('x.b.pinning2.example.com-pinningroot'), "x.b.pinning2.example.com");
- checkPreloadClear();
-}
-
-function checkPreloadClear() {
- // Check that the preloaded pins still work after private data is cleared
- gSSService.clearAll();
- checkFail(certFromFile('b.preload.example.com-badca'), "b.preload.example.com");
-
- // Check that the preloaded pins are cleared when we clear preloads
- gSSService.clearPreloads();
- checkOK(certFromFile('b.preload.example.com-badca'), "b.preload.example.com");
-
- do_test_finished();
-}
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-badca.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-badca.pem
deleted file mode 100644
index 102a3bbda..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-badca.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC3TCCAcegAwIBAgIUXdB7LgBGZoRV1UmEFcsOhMigpB0wCwYJKoZIhvcNAQEL
-MBAxDjAMBgNVBAMMBWJhZGNhMCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAxODAyMDUw
-MDAwMDBaMBoxGDAWBgNVBAMMD3Rlc3QgZW5kLWVudGl0eTCCASIwDQYJKoZIhvcN
-AQEBBQADggEPADCCAQoCggEBAMF1xlJmCZ93CCpnkfG4dsN/XOU4sGxKzSKxy9Rv
-plraKt1ByMJJisSjs8H2FIf0G2mJQb2ApRw8EgJExYSkxEgzBeUTjAEGzwi+moYn
-YLrmoujzbyPF2YMTud+vN4NF2s5R1Nbc0qbLPMcG680wcOyYzOQKpZHXKVp/ccW+
-ZmkdKy3+yElEWQvFo+pJ/ZOx11NAXxdzdpmVhmYlR5ftQmkIiAgRQiBpmIpD/uSM
-5oeB3SK2ppzSg3UTH5MrEozihvp9JRwGKtJ+8Bbxh83VToMrNbiTD3S6kKqLx2Fn
-JCqx/W1iFA0YxMC4xo/DdIRXMkrX3obmVS8dHhkdcSFo07sCAwEAAaMlMCMwIQYD
-VR0RBBowGIIWYS5waW5uaW5nMi5leGFtcGxlLmNvbTALBgkqhkiG9w0BAQsDggEB
-AAKhpX2t/Bz9//u1DYyLZ6dLSJt121Vb58s8gQvI/7n6MdUP1IniQLbtPW+7wnV0
-6LYagJQ11ZUJMxYUs6lB91yhwAO9NoN4QJWWB0i23DoZ6cg4dHmYKmQQ/HRndwm+
-EATkJSnBAk8O2xmIm8CXbJ0W0lvaXEjzRfeoiEjQ0/THeo4hXvGOMPm31d+r4ji5
-/u2+9jrpTII0kjCwFjqC97lPID14s9QRMqMB1CCV6fgT19EGYi9I7H6mnyukkmfX
-9wOhLHSk6A2l5+5eJrZYXLOhcS31VBd54sb1Vvg+Bp05HMYjo051JcRlvxoIUsHT
-JQDn8QrzwZBDBh4Pie3AwOM=
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-badca.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-badca.pem.certspec
deleted file mode 100644
index f365b8a18..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-badca.pem.certspec
+++ /dev/null
@@ -1,5 +0,0 @@
-issuer:badca
-subject:test end-entity
-issuerKey:alternate
-subjectKey:alternate
-extension:subjectAlternativeName:a.pinning2.example.com
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-pinningroot.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-pinningroot.pem
deleted file mode 100644
index 2439b5775..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-pinningroot.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC4zCCAc2gAwIBAgIUPQgjdPeWdWy/0oKRi+5Lr7JJorMwCwYJKoZIhvcNAQEL
-MBYxFDASBgNVBAMMC3Bpbm5pbmdyb290MCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAx
-ODAyMDUwMDAwMDBaMBoxGDAWBgNVBAMMD3Rlc3QgZW5kLWVudGl0eTCCASIwDQYJ
-KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMF1xlJmCZ93CCpnkfG4dsN/XOU4sGxK
-zSKxy9RvplraKt1ByMJJisSjs8H2FIf0G2mJQb2ApRw8EgJExYSkxEgzBeUTjAEG
-zwi+moYnYLrmoujzbyPF2YMTud+vN4NF2s5R1Nbc0qbLPMcG680wcOyYzOQKpZHX
-KVp/ccW+ZmkdKy3+yElEWQvFo+pJ/ZOx11NAXxdzdpmVhmYlR5ftQmkIiAgRQiBp
-mIpD/uSM5oeB3SK2ppzSg3UTH5MrEozihvp9JRwGKtJ+8Bbxh83VToMrNbiTD3S6
-kKqLx2FnJCqx/W1iFA0YxMC4xo/DdIRXMkrX3obmVS8dHhkdcSFo07sCAwEAAaMl
-MCMwIQYDVR0RBBowGIIWYS5waW5uaW5nMi5leGFtcGxlLmNvbTALBgkqhkiG9w0B
-AQsDggEBAFUlxnwpxOFbSxtsBthWu6xmDxeFAzP+u5YOfuKeiIGnAx70k8ODQufJ
-Vm1rXvKtN5r8jR6AZh/hdA+tGhnu4+pGi9/aqWnaF1FEs2mW0saUV8atQZwNGRBO
-E9FXdAHA8WmGIfRf8TOuWpmEWejjJt5Zsfs+V3ARIxjCrVE7ixyfJ/hYpmthLtYJ
-5vgp0iiPjzorKeFnqooLVAfzeayRX0bE5H79NISIWq4CN/9J50ZFkRORURlANU95
-2Dcuw416b3BGrWVmWlKWOpA6NZ+Rj+AI+z9UTDpqCczTfMXMabX4EveW1GKMMYiA
-eLD8SY4VQ4403eaCp6rxYFrCNOeDczs=
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-pinningroot.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-pinningroot.pem.certspec
deleted file mode 100644
index aef72ce39..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.pinning2.example.com-pinningroot.pem.certspec
+++ /dev/null
@@ -1,4 +0,0 @@
-issuer:pinningroot
-subject:test end-entity
-subjectKey:alternate
-extension:subjectAlternativeName:a.pinning2.example.com
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-badca.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-badca.pem
deleted file mode 100644
index 2a157d8e6..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-badca.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC3DCCAcagAwIBAgIUKUG7kBZ72CvuLQ0uPfjKHLkKDQAwCwYJKoZIhvcNAQEL
-MBAxDjAMBgNVBAMMBWJhZGNhMCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAxODAyMDUw
-MDAwMDBaMBoxGDAWBgNVBAMMD3Rlc3QgZW5kLWVudGl0eTCCASIwDQYJKoZIhvcN
-AQEBBQADggEPADCCAQoCggEBAMF1xlJmCZ93CCpnkfG4dsN/XOU4sGxKzSKxy9Rv
-plraKt1ByMJJisSjs8H2FIf0G2mJQb2ApRw8EgJExYSkxEgzBeUTjAEGzwi+moYn
-YLrmoujzbyPF2YMTud+vN4NF2s5R1Nbc0qbLPMcG680wcOyYzOQKpZHXKVp/ccW+
-ZmkdKy3+yElEWQvFo+pJ/ZOx11NAXxdzdpmVhmYlR5ftQmkIiAgRQiBpmIpD/uSM
-5oeB3SK2ppzSg3UTH5MrEozihvp9JRwGKtJ+8Bbxh83VToMrNbiTD3S6kKqLx2Fn
-JCqx/W1iFA0YxMC4xo/DdIRXMkrX3obmVS8dHhkdcSFo07sCAwEAAaMkMCIwIAYD
-VR0RBBkwF4IVYS5wcmVsb2FkLmV4YW1wbGUuY29tMAsGCSqGSIb3DQEBCwOCAQEA
-tx5YO8uvYac92scnMEswv4ZIslou8UYV/2mtxA+MaXf/g+MizOKeZgTI1+b9hR48
-IDOgvrqPCbn1hKY6gb2gtRI1mC5dg9T8EYEXcC1TM+ncY/l4SZUjfMhzY2iOf62x
-jhDqMMt4V5uaHUxVmJQI82X5qpxH3yJ3WOC87iGZNfMB8MSbLM3lxor9OHeTlTHQ
-vPb/r7cLW+ikxirDGyBBvThkvDA/8qyN5Qp6Ae1BiPeEMoScNf3fChvNV6Jyb8g8
-e9q0LnTlTuVgaDWtg7PVOxeiI+wf3Jhv9uqXQLX8JHZDKebLbQEkNcbR4DK/8wsP
-uFhj0j8DY6+/YZbcF7Jgfw==
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-badca.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-badca.pem.certspec
deleted file mode 100644
index c1cb36576..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-badca.pem.certspec
+++ /dev/null
@@ -1,5 +0,0 @@
-issuer:badca
-subject:test end-entity
-issuerKey:alternate
-subjectKey:alternate
-extension:subjectAlternativeName:a.preload.example.com
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-pinningroot.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-pinningroot.pem
deleted file mode 100644
index 5fa43f052..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-pinningroot.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC4jCCAcygAwIBAgIURV3mf9Dz42lALe31OAm2SYbpFaEwCwYJKoZIhvcNAQEL
-MBYxFDASBgNVBAMMC3Bpbm5pbmdyb290MCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAx
-ODAyMDUwMDAwMDBaMBoxGDAWBgNVBAMMD3Rlc3QgZW5kLWVudGl0eTCCASIwDQYJ
-KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMF1xlJmCZ93CCpnkfG4dsN/XOU4sGxK
-zSKxy9RvplraKt1ByMJJisSjs8H2FIf0G2mJQb2ApRw8EgJExYSkxEgzBeUTjAEG
-zwi+moYnYLrmoujzbyPF2YMTud+vN4NF2s5R1Nbc0qbLPMcG680wcOyYzOQKpZHX
-KVp/ccW+ZmkdKy3+yElEWQvFo+pJ/ZOx11NAXxdzdpmVhmYlR5ftQmkIiAgRQiBp
-mIpD/uSM5oeB3SK2ppzSg3UTH5MrEozihvp9JRwGKtJ+8Bbxh83VToMrNbiTD3S6
-kKqLx2FnJCqx/W1iFA0YxMC4xo/DdIRXMkrX3obmVS8dHhkdcSFo07sCAwEAAaMk
-MCIwIAYDVR0RBBkwF4IVYS5wcmVsb2FkLmV4YW1wbGUuY29tMAsGCSqGSIb3DQEB
-CwOCAQEATOA0bbfg81JieQkTzr4oxBqPuFamtLSAsLpbKakikYQo2znMGNnHV7Xe
-uxMGMhCIPRsiJ6jj6ZTQJNqQRKzXWEiBgREsarmJxA53ITIcO2cK2rqyetNAAwzZ
-oViENmK3tLA5KT2VC9IGgMXdSE7IfXn+5yCdpKZ2ohwtkYHNkCbQIU+4KaCPa/dB
-yAelZZPE0mVHJLkd5HoOsFmjFOBQuOkn9/AAOmkgBZIk1Dp833ywn/mnwLZdVsdV
-+TjqWKenDJXxhO2+aCCtZbUVxKMn0TACpAA+rhjS5vigCyIZh7V4rxki9UXaOfVq
-EVy4rFlRIYYtXV40HavDZoPgxuCHDw==
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-pinningroot.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-pinningroot.pem.certspec
deleted file mode 100644
index 5c1865314..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/a.preload.example.com-pinningroot.pem.certspec
+++ /dev/null
@@ -1,4 +0,0 @@
-issuer:pinningroot
-subject:test end-entity
-subjectKey:alternate
-extension:subjectAlternativeName:a.preload.example.com
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-badca.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-badca.pem
deleted file mode 100644
index cffb37c1f..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-badca.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC3TCCAcegAwIBAgIUV89JsAhywp3graSGqjeSpMzd1B0wCwYJKoZIhvcNAQEL
-MBAxDjAMBgNVBAMMBWJhZGNhMCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAxODAyMDUw
-MDAwMDBaMBoxGDAWBgNVBAMMD3Rlc3QgZW5kLWVudGl0eTCCASIwDQYJKoZIhvcN
-AQEBBQADggEPADCCAQoCggEBAMF1xlJmCZ93CCpnkfG4dsN/XOU4sGxKzSKxy9Rv
-plraKt1ByMJJisSjs8H2FIf0G2mJQb2ApRw8EgJExYSkxEgzBeUTjAEGzwi+moYn
-YLrmoujzbyPF2YMTud+vN4NF2s5R1Nbc0qbLPMcG680wcOyYzOQKpZHXKVp/ccW+
-ZmkdKy3+yElEWQvFo+pJ/ZOx11NAXxdzdpmVhmYlR5ftQmkIiAgRQiBpmIpD/uSM
-5oeB3SK2ppzSg3UTH5MrEozihvp9JRwGKtJ+8Bbxh83VToMrNbiTD3S6kKqLx2Fn
-JCqx/W1iFA0YxMC4xo/DdIRXMkrX3obmVS8dHhkdcSFo07sCAwEAAaMlMCMwIQYD
-VR0RBBowGIIWYi5waW5uaW5nMi5leGFtcGxlLmNvbTALBgkqhkiG9w0BAQsDggEB
-ABevzhH9/hjTBgTtUk4ytZX0A7Tu0DR5F9ooFnlUwzupHFihO+9NzEoCSIvCy3L9
-+i3LbkaiUWEHQItLjIg+aice13ZkuMp+DeZ+D/YR9ulxyY1QBYeZLQj/gSdkj/fK
-uDm0Izgt8OBsgP+KFX2c2cGZyOcXmFFAwSfkLz7p2qzrmuM7r5ploNpxeHBUIxUW
-jJzSFeQMfy5wflcKDBY+PDejzN9Ik4weRyERsckVgmZSJXuodb8xgYkNPvl/GOVJ
-o+eDw+E3uOsdBIDrsyb+bcQTG7nBkQoSqG8M0610h0OqFhksfv/0HcB/wfW8VdU+
-+C4+tR2KfvqTCm3T6gzRWX8=
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-badca.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-badca.pem.certspec
deleted file mode 100644
index 5aa8aaa5e..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-badca.pem.certspec
+++ /dev/null
@@ -1,5 +0,0 @@
-issuer:badca
-subject:test end-entity
-issuerKey:alternate
-subjectKey:alternate
-extension:subjectAlternativeName:b.pinning2.example.com
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-pinningroot.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-pinningroot.pem
deleted file mode 100644
index 791f64b4c..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-pinningroot.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC4zCCAc2gAwIBAgIUVQNTrx+mRE96ggRLuZeFm+9uBdcwCwYJKoZIhvcNAQEL
-MBYxFDASBgNVBAMMC3Bpbm5pbmdyb290MCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAx
-ODAyMDUwMDAwMDBaMBoxGDAWBgNVBAMMD3Rlc3QgZW5kLWVudGl0eTCCASIwDQYJ
-KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMF1xlJmCZ93CCpnkfG4dsN/XOU4sGxK
-zSKxy9RvplraKt1ByMJJisSjs8H2FIf0G2mJQb2ApRw8EgJExYSkxEgzBeUTjAEG
-zwi+moYnYLrmoujzbyPF2YMTud+vN4NF2s5R1Nbc0qbLPMcG680wcOyYzOQKpZHX
-KVp/ccW+ZmkdKy3+yElEWQvFo+pJ/ZOx11NAXxdzdpmVhmYlR5ftQmkIiAgRQiBp
-mIpD/uSM5oeB3SK2ppzSg3UTH5MrEozihvp9JRwGKtJ+8Bbxh83VToMrNbiTD3S6
-kKqLx2FnJCqx/W1iFA0YxMC4xo/DdIRXMkrX3obmVS8dHhkdcSFo07sCAwEAAaMl
-MCMwIQYDVR0RBBowGIIWYi5waW5uaW5nMi5leGFtcGxlLmNvbTALBgkqhkiG9w0B
-AQsDggEBAHYCfQaolF6z4IicBDTEQQVfYi4A3BcCNLTdInQlal/DHNytNRufM5TB
-ccNpau5U9e10NBYWbMqRUBb/7wtYE4O7jhEWxjaHBOz5KTYLv8hjEc2wcHXfhlYM
-QKmxOnA7SguSNYBdfXywav//ssLmDnB06nc2vv5NaKvIWbUv3HvfM8oRAr+NICUs
-UMcIb+hjY+u/qrnOeFJxXzeqPYKMa7H+33baRgy7xnL95PxAwkz0XL8vcMFupTX5
-dL5HsSKku23C0BoE6pK39TVh758fQjCAnD+QRTH/o+dfE2sIFpRiyszdXGmh2IRR
-gMSy+gJbH+zh0D9ncL0Kev0PyEuBYR4=
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-pinningroot.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-pinningroot.pem.certspec
deleted file mode 100644
index 17f22dab5..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.pinning2.example.com-pinningroot.pem.certspec
+++ /dev/null
@@ -1,4 +0,0 @@
-issuer:pinningroot
-subject:test end-entity
-subjectKey:alternate
-extension:subjectAlternativeName:b.pinning2.example.com
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-badca.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-badca.pem
deleted file mode 100644
index 4ef23a2c2..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-badca.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC3DCCAcagAwIBAgIUf2T4BVvxeCgWVp/FL3tCFNjuZYQwCwYJKoZIhvcNAQEL
-MBAxDjAMBgNVBAMMBWJhZGNhMCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAxODAyMDUw
-MDAwMDBaMBoxGDAWBgNVBAMMD3Rlc3QgZW5kLWVudGl0eTCCASIwDQYJKoZIhvcN
-AQEBBQADggEPADCCAQoCggEBAMF1xlJmCZ93CCpnkfG4dsN/XOU4sGxKzSKxy9Rv
-plraKt1ByMJJisSjs8H2FIf0G2mJQb2ApRw8EgJExYSkxEgzBeUTjAEGzwi+moYn
-YLrmoujzbyPF2YMTud+vN4NF2s5R1Nbc0qbLPMcG680wcOyYzOQKpZHXKVp/ccW+
-ZmkdKy3+yElEWQvFo+pJ/ZOx11NAXxdzdpmVhmYlR5ftQmkIiAgRQiBpmIpD/uSM
-5oeB3SK2ppzSg3UTH5MrEozihvp9JRwGKtJ+8Bbxh83VToMrNbiTD3S6kKqLx2Fn
-JCqx/W1iFA0YxMC4xo/DdIRXMkrX3obmVS8dHhkdcSFo07sCAwEAAaMkMCIwIAYD
-VR0RBBkwF4IVYi5wcmVsb2FkLmV4YW1wbGUuY29tMAsGCSqGSIb3DQEBCwOCAQEA
-okmxK2NDRYWSAn6b1YZpLiZnoaNrM0HXHY6fkARY/9EiAApvNPxT663EKtTZn27a
-JtwXP2zzlYQDRc9cxa1zBX9Tp+0sn5aqokqzoVWx4VIe/emzi9FDf3lgaYewHLez
-RINv3kUZmqlw6tmMQxjd51UGyvNsi52+gcet1cPr5kBzGQv/q7iNs/lcetL3+KQF
-klJ3PfI4VjFwRRYNhScxiRczklPVDySvxSNw+csUxNRunFLXIi3+WqQzYhw7R8ga
-ASwozTfvVAUySOmDipCZZXAHFtlpBr6vAllfD9v8hAsrE7Bkivafr+i5HMD3DtJE
-4ZedqFCkTkqKvd0fMIbOIA==
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-badca.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-badca.pem.certspec
deleted file mode 100644
index 9901ead60..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-badca.pem.certspec
+++ /dev/null
@@ -1,5 +0,0 @@
-issuer:badca
-subject:test end-entity
-issuerKey:alternate
-subjectKey:alternate
-extension:subjectAlternativeName:b.preload.example.com
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-pinningroot.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-pinningroot.pem
deleted file mode 100644
index c6ea38a12..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-pinningroot.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC4jCCAcygAwIBAgIUI5rdRX/x0w0bDx6hQhc8ZhGLfqQwCwYJKoZIhvcNAQEL
-MBYxFDASBgNVBAMMC3Bpbm5pbmdyb290MCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAx
-ODAyMDUwMDAwMDBaMBoxGDAWBgNVBAMMD3Rlc3QgZW5kLWVudGl0eTCCASIwDQYJ
-KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMF1xlJmCZ93CCpnkfG4dsN/XOU4sGxK
-zSKxy9RvplraKt1ByMJJisSjs8H2FIf0G2mJQb2ApRw8EgJExYSkxEgzBeUTjAEG
-zwi+moYnYLrmoujzbyPF2YMTud+vN4NF2s5R1Nbc0qbLPMcG680wcOyYzOQKpZHX
-KVp/ccW+ZmkdKy3+yElEWQvFo+pJ/ZOx11NAXxdzdpmVhmYlR5ftQmkIiAgRQiBp
-mIpD/uSM5oeB3SK2ppzSg3UTH5MrEozihvp9JRwGKtJ+8Bbxh83VToMrNbiTD3S6
-kKqLx2FnJCqx/W1iFA0YxMC4xo/DdIRXMkrX3obmVS8dHhkdcSFo07sCAwEAAaMk
-MCIwIAYDVR0RBBkwF4IVYi5wcmVsb2FkLmV4YW1wbGUuY29tMAsGCSqGSIb3DQEB
-CwOCAQEAg2VdHBLmFLJ03N9VT4uUrnpjuYY9bsvPJF2JCk9817nxBbeMf+Qn0C/o
-OeoQnZRqsaFbKZ80JXmh/j4RO6T/aaQUMpk+NXrdSPddy2B3eUByF/NJqipV3M2a
-CRNWUUVF+msjRWwbzJafju2nEZcD4d4cUkHHYAaRRxAHH3ylEvWmdv/brgfAPCPH
-WDVaCMc3OXgHkyrLAfkMKSYTNPJ7DJn/BXET5tCzqYGRUgRnME4ON2Mmp19lsdig
-dIFbm76wg6l5M+s9pqiYzODUxJXUOd6BkAR5pqB9WyIRVfBr5LGT72nv00LHVcSm
-hnsti9nAtFdJx4E1lJilrnQwu0q4Iw==
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-pinningroot.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-pinningroot.pem.certspec
deleted file mode 100644
index 6f5807700..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/b.preload.example.com-pinningroot.pem.certspec
+++ /dev/null
@@ -1,4 +0,0 @@
-issuer:pinningroot
-subject:test end-entity
-subjectKey:alternate
-extension:subjectAlternativeName:b.preload.example.com
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/badca.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/badca.pem
deleted file mode 100644
index 9443a4c91..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/badca.pem
+++ /dev/null
@@ -1,17 +0,0 @@
------BEGIN CERTIFICATE-----
-MIICyzCCAbWgAwIBAgIUXQevdaeXMieCrG6ZqhI2yfACBq4wCwYJKoZIhvcNAQEL
-MBAxDjAMBgNVBAMMBWJhZGNhMCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAxODAyMDUw
-MDAwMDBaMBAxDjAMBgNVBAMMBWJhZGNhMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A
-MIIBCgKCAQEAwXXGUmYJn3cIKmeR8bh2w39c5TiwbErNIrHL1G+mWtoq3UHIwkmK
-xKOzwfYUh/QbaYlBvYClHDwSAkTFhKTESDMF5ROMAQbPCL6ahidguuai6PNvI8XZ
-gxO53683g0XazlHU1tzSpss8xwbrzTBw7JjM5AqlkdcpWn9xxb5maR0rLf7ISURZ
-C8Wj6kn9k7HXU0BfF3N2mZWGZiVHl+1CaQiICBFCIGmYikP+5Izmh4HdIramnNKD
-dRMfkysSjOKG+n0lHAYq0n7wFvGHzdVOgys1uJMPdLqQqovHYWckKrH9bWIUDRjE
-wLjGj8N0hFcyStfehuZVLx0eGR1xIWjTuwIDAQABox0wGzAMBgNVHRMEBTADAQH/
-MAsGA1UdDwQEAwIBBjALBgkqhkiG9w0BAQsDggEBAHitWfZzPxR/UWEKQgz9zzm2
-NXszG7nV82w8qfC9pq8mU3f7eqbHJ2HNFkZzttJsH9DNl30OK2Y5IVLUiZHckz2e
-OFUyxK0tBCCBYd79FiK4BgP/Ys/7LK+4UaDhbRQP//MGuofwjsrNxgPgtkNaeKtF
-EXKCuDrHoa4ua7afrkUWKzPZ6JbDOEjJIyuJ3ISI0Q20Oc3ERxGwG1SQ1EldgWBr
-0dJJWBHZtNpIVvSm1dRfjMYtSrBoUXwbn6kDrdk4T98OHnFP0V0KW4j4umLHK7Gi
-OSAwvWtir3fSJaLJClTCFe1XoNvJnQ53PJs0JR26mAixV2VuylStO2KlbYy7fOc=
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/badca.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/badca.pem.certspec
deleted file mode 100644
index 311bbb3f8..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/badca.pem.certspec
+++ /dev/null
@@ -1,6 +0,0 @@
-issuer:badca
-subject:badca
-issuerKey:alternate
-subjectKey:alternate
-extension:basicConstraints:cA,
-extension:keyUsage:keyCertSign,cRLSign
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/moz.build b/security/manager/ssl/tests/unit/test_pinning_dynamic/moz.build
deleted file mode 100644
index eb8b582f5..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/moz.build
+++ /dev/null
@@ -1,26 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# Temporarily disabled. See bug 1256495.
-#test_certificates = (
-# 'badca.pem',
-# 'a.pinning2.example.com-badca.pem',
-# 'a.pinning2.example.com-pinningroot.pem',
-# 'a.preload.example.com-badca.pem',
-# 'a.preload.example.com-pinningroot.pem',
-# 'b.pinning2.example.com-badca.pem',
-# 'b.pinning2.example.com-pinningroot.pem',
-# 'b.preload.example.com-badca.pem',
-# 'b.preload.example.com-pinningroot.pem',
-# 'x.a.pinning2.example.com-badca.pem',
-# 'x.a.pinning2.example.com-pinningroot.pem',
-# 'x.b.pinning2.example.com-badca.pem',
-# 'x.b.pinning2.example.com-pinningroot.pem',
-# 'pinningroot.pem',
-#)
-#
-#for test_certificate in test_certificates:
-# GeneratedTestCertificate(test_certificate)
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/pinningroot.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/pinningroot.pem
deleted file mode 100644
index 9a041991a..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/pinningroot.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC1zCCAcGgAwIBAgIUMwSUmBShbg5sMNZSTiPd5Tb1udkwCwYJKoZIhvcNAQEL
-MBYxFDASBgNVBAMMC3Bpbm5pbmdyb290MCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAx
-ODAyMDUwMDAwMDBaMBYxFDASBgNVBAMMC3Bpbm5pbmdyb290MIIBIjANBgkqhkiG
-9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuohRqESOFtZB/W62iAY2ED08E9nq5DVKtOz1
-aFdsJHvBxyWo4NgfvbGcBptuGobya+KvWnVramRxCHqlWqdFh/cc1SScAn7NQ/we
-adA4ICmTqyDDSeTbuUzCa2wO7RWCD/F+rWkasdMCOosqQe6ncOAPDY39ZgsrsCSS
-pH25iGF5kLFXkD3SO8XguEgfqDfTiEPvJxbYVbdmWqp+ApAvOnsQgAYkzBxsl62W
-YVu34pYSwHUxowyR3bTK9/ytHSXTCe+5Fw6naOGzey8ib2njtIqVYR3uJtYlnauR
-CE42yxwkBCy/Fosv5fGPmRcxuLP+SSP6clHEMdUDrNoYCjXtjQIDAQABox0wGzAM
-BgNVHRMEBTADAQH/MAsGA1UdDwQEAwIBBjALBgkqhkiG9w0BAQsDggEBADNuQnKg
-y8zWnKlfBq/50UOtdSlvevg6u6tsUTvay2kVgB8BRTvm76aw4yOLgk84eHHkrX5c
-TqdutWh2JZarUWbO7JnPTdDE2CAkDh1smSe9L/XJENbgVXleg/VYLgnfnuSQCCnK
-WjjExcorX6IKDks1ZoBJ1HIvBzMRMWzIQgBL9B2Y1V05lgfn0bwZD+TjUJBmN1w0
-NTaPgrxE7FWZ2CTcowrYRKEEDAUX4cTFoce5YMwALCgW59KfVQfQdHaiCCcdNbfi
-qSQGZu+59JrrasmgK9VTahukYWcaQCz8HBCasdknGodLAzThuWMkjXU3D2IZYl15
-GfE5yrRFop/89xo=
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/pinningroot.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/pinningroot.pem.certspec
deleted file mode 100644
index 86500e16b..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/pinningroot.pem.certspec
+++ /dev/null
@@ -1,4 +0,0 @@
-issuer:pinningroot
-subject:pinningroot
-extension:basicConstraints:cA,
-extension:keyUsage:keyCertSign,cRLSign
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-badca.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-badca.pem
deleted file mode 100644
index e4b6e72c0..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-badca.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC3zCCAcmgAwIBAgIUe11LKIzCrdnRTgrLsfuGMoOpL1QwCwYJKoZIhvcNAQEL
-MBAxDjAMBgNVBAMMBWJhZGNhMCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAxODAyMDUw
-MDAwMDBaMBoxGDAWBgNVBAMMD3Rlc3QgZW5kLWVudGl0eTCCASIwDQYJKoZIhvcN
-AQEBBQADggEPADCCAQoCggEBAMF1xlJmCZ93CCpnkfG4dsN/XOU4sGxKzSKxy9Rv
-plraKt1ByMJJisSjs8H2FIf0G2mJQb2ApRw8EgJExYSkxEgzBeUTjAEGzwi+moYn
-YLrmoujzbyPF2YMTud+vN4NF2s5R1Nbc0qbLPMcG680wcOyYzOQKpZHXKVp/ccW+
-ZmkdKy3+yElEWQvFo+pJ/ZOx11NAXxdzdpmVhmYlR5ftQmkIiAgRQiBpmIpD/uSM
-5oeB3SK2ppzSg3UTH5MrEozihvp9JRwGKtJ+8Bbxh83VToMrNbiTD3S6kKqLx2Fn
-JCqx/W1iFA0YxMC4xo/DdIRXMkrX3obmVS8dHhkdcSFo07sCAwEAAaMnMCUwIwYD
-VR0RBBwwGoIYeC5hLnBpbm5pbmcyLmV4YW1wbGUuY29tMAsGCSqGSIb3DQEBCwOC
-AQEAgdFC/SwBLRp6A+n3znR+sEuU8UvmbgbXp7pIFVh6cbC6lNF0nXk9ywPeIWyh
-B7TCn3YHj4uc/PbvzRj9Py0gQLXcimKpmLoxclV5g1uTAydgXPiPulv/kaL9NOME
-lm88pyQeDwfEkUz7VijabIzFRTEVRmOudb8mX4SuzjhxsdzSMjffpae335beJ4Im
-lxgJgMsuJdEoK0WyG5nlBhVdzrT/kwdiwULeVNV//UHid1YZy56G5Lo22Hgd4wT3
-1W3LXQelBdHhee7Hf7mg4rjCUPulFAr8qBLdywf1Hnu1o7rXUcn46PLwKLOWJPOM
-SKpiqRKqvzlrzLaHPejfT0IMrw==
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-badca.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-badca.pem.certspec
deleted file mode 100644
index ad8636d43..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-badca.pem.certspec
+++ /dev/null
@@ -1,5 +0,0 @@
-issuer:badca
-subject:test end-entity
-issuerKey:alternate
-subjectKey:alternate
-extension:subjectAlternativeName:x.a.pinning2.example.com
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-pinningroot.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-pinningroot.pem
deleted file mode 100644
index ed58de323..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-pinningroot.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC5TCCAc+gAwIBAgIUefEeE+Sj5fBSec+97B6UmZFQEncwCwYJKoZIhvcNAQEL
-MBYxFDASBgNVBAMMC3Bpbm5pbmdyb290MCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAx
-ODAyMDUwMDAwMDBaMBoxGDAWBgNVBAMMD3Rlc3QgZW5kLWVudGl0eTCCASIwDQYJ
-KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMF1xlJmCZ93CCpnkfG4dsN/XOU4sGxK
-zSKxy9RvplraKt1ByMJJisSjs8H2FIf0G2mJQb2ApRw8EgJExYSkxEgzBeUTjAEG
-zwi+moYnYLrmoujzbyPF2YMTud+vN4NF2s5R1Nbc0qbLPMcG680wcOyYzOQKpZHX
-KVp/ccW+ZmkdKy3+yElEWQvFo+pJ/ZOx11NAXxdzdpmVhmYlR5ftQmkIiAgRQiBp
-mIpD/uSM5oeB3SK2ppzSg3UTH5MrEozihvp9JRwGKtJ+8Bbxh83VToMrNbiTD3S6
-kKqLx2FnJCqx/W1iFA0YxMC4xo/DdIRXMkrX3obmVS8dHhkdcSFo07sCAwEAAaMn
-MCUwIwYDVR0RBBwwGoIYeC5hLnBpbm5pbmcyLmV4YW1wbGUuY29tMAsGCSqGSIb3
-DQEBCwOCAQEAT2fxisiLJvVdFTba07a2Pc6UHBE+O0tOaLfMmHx/ET2FZdd9sLTL
-X2f+hQCmXEBQ7Au2eYTew8hTyXYGYFauMJNk+XHHUIaSOhmnYTccye4d6j5bXRCp
-7zA1qPlReCDLjp7o/34whkvngvdgdLYf60EkBO/NJfj+zsR1JTVfyVzIKXl6veLz
-0xKicBAq9vS0Yqq10japVYKKqAw6gDpbNkSAd3xsl4+EbMRq+BnMB4W2anw1gM/e
-hV11JQVA/MREtmUiTkvJFF6chHVCn5aL7JzVM2miZjZC8Ix59LUBoyO3SrxgrzZw
-xeYuwoDhzTCrcFxn8gdKNajbGHuW5ekQpg==
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-pinningroot.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-pinningroot.pem.certspec
deleted file mode 100644
index 260f2184b..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.a.pinning2.example.com-pinningroot.pem.certspec
+++ /dev/null
@@ -1,4 +0,0 @@
-issuer:pinningroot
-subject:test end-entity
-subjectKey:alternate
-extension:subjectAlternativeName:x.a.pinning2.example.com
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-badca.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-badca.pem
deleted file mode 100644
index dc24247e8..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-badca.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC3zCCAcmgAwIBAgIUYcTc5Pz7KlQldGOO+KzbuBdf8TswCwYJKoZIhvcNAQEL
-MBAxDjAMBgNVBAMMBWJhZGNhMCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAxODAyMDUw
-MDAwMDBaMBoxGDAWBgNVBAMMD3Rlc3QgZW5kLWVudGl0eTCCASIwDQYJKoZIhvcN
-AQEBBQADggEPADCCAQoCggEBAMF1xlJmCZ93CCpnkfG4dsN/XOU4sGxKzSKxy9Rv
-plraKt1ByMJJisSjs8H2FIf0G2mJQb2ApRw8EgJExYSkxEgzBeUTjAEGzwi+moYn
-YLrmoujzbyPF2YMTud+vN4NF2s5R1Nbc0qbLPMcG680wcOyYzOQKpZHXKVp/ccW+
-ZmkdKy3+yElEWQvFo+pJ/ZOx11NAXxdzdpmVhmYlR5ftQmkIiAgRQiBpmIpD/uSM
-5oeB3SK2ppzSg3UTH5MrEozihvp9JRwGKtJ+8Bbxh83VToMrNbiTD3S6kKqLx2Fn
-JCqx/W1iFA0YxMC4xo/DdIRXMkrX3obmVS8dHhkdcSFo07sCAwEAAaMnMCUwIwYD
-VR0RBBwwGoIYeC5iLnBpbm5pbmcyLmV4YW1wbGUuY29tMAsGCSqGSIb3DQEBCwOC
-AQEAd6HusXqftFBpSUzivIY6icTZ95+wY+xIOsf1QOgyzZ/CDx4Tly+rgue2xSNT
-59FmnFvh8jW202K8TykamsAX20A8ArzubNoc/+soA752YEvrMmOgWjmH2arqTfqg
-zcfNdgUDESwnOoy123F+PkT3rRDXwINzCwftxhKbvmqhO6YENteqyWWmSZoMClsJ
-xtm+bmPN+m26k6zMMYWzIu2HIXI3CgqOmJltfyqea02Y58S1+XlajrcewPpC17xD
-r5a1sizecCFrmV0ssbK8wvEYo9Xs+PNj8Vhi1DUwGjtnjrYn/WQ6v/luMEEO7EMD
-b3BbEziS3Pqej2JyprUKqOjv1g==
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-badca.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-badca.pem.certspec
deleted file mode 100644
index 592bdcc58..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-badca.pem.certspec
+++ /dev/null
@@ -1,5 +0,0 @@
-issuer:badca
-subject:test end-entity
-issuerKey:alternate
-subjectKey:alternate
-extension:subjectAlternativeName:x.b.pinning2.example.com
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-pinningroot.pem b/security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-pinningroot.pem
deleted file mode 100644
index 642135994..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-pinningroot.pem
+++ /dev/null
@@ -1,18 +0,0 @@
------BEGIN CERTIFICATE-----
-MIIC5TCCAc+gAwIBAgIUNXGolw8M2HU/gP4dOSMD2bdTQ+MwCwYJKoZIhvcNAQEL
-MBYxFDASBgNVBAMMC3Bpbm5pbmdyb290MCIYDzIwMTUxMTI4MDAwMDAwWhgPMjAx
-ODAyMDUwMDAwMDBaMBoxGDAWBgNVBAMMD3Rlc3QgZW5kLWVudGl0eTCCASIwDQYJ
-KoZIhvcNAQEBBQADggEPADCCAQoCggEBAMF1xlJmCZ93CCpnkfG4dsN/XOU4sGxK
-zSKxy9RvplraKt1ByMJJisSjs8H2FIf0G2mJQb2ApRw8EgJExYSkxEgzBeUTjAEG
-zwi+moYnYLrmoujzbyPF2YMTud+vN4NF2s5R1Nbc0qbLPMcG680wcOyYzOQKpZHX
-KVp/ccW+ZmkdKy3+yElEWQvFo+pJ/ZOx11NAXxdzdpmVhmYlR5ftQmkIiAgRQiBp
-mIpD/uSM5oeB3SK2ppzSg3UTH5MrEozihvp9JRwGKtJ+8Bbxh83VToMrNbiTD3S6
-kKqLx2FnJCqx/W1iFA0YxMC4xo/DdIRXMkrX3obmVS8dHhkdcSFo07sCAwEAAaMn
-MCUwIwYDVR0RBBwwGoIYeC5iLnBpbm5pbmcyLmV4YW1wbGUuY29tMAsGCSqGSIb3
-DQEBCwOCAQEAevN1gW64H2kCjW5W4wbQFkJIITjcdEUsw+8GPzDuBDJCvgGirhOi
-ArBie8Bz+JlqzgNCXSe6pFVLoNfLosG5xksLwHljEit/7gFQ5twFazdg7dwPXs9Z
-MIV2iv3vHmKYTFTcjfw07UWy0rHHt6EH+zXqpZFtFkJHqSgngKxAHgQlvSKeyynM
-albu5YAX/hzJ7TyAVGxVN8uxnvYqPbLCy3wKf9ILFiDer6B9pE4Ii+dUyUbqVQFZ
-tY2ac1474nkcfj3uj5qbV0TTpd9EL9HMvixTnoUrT3bqkRX7orvL4gXpnJJyRjvC
-/LvTh/Vt1mYKkNLc/ruOj7WfUUC0SJIDzQ==
------END CERTIFICATE----- \ No newline at end of file
diff --git a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-pinningroot.pem.certspec b/security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-pinningroot.pem.certspec
deleted file mode 100644
index 7e6d33d50..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_dynamic/x.b.pinning2.example.com-pinningroot.pem.certspec
+++ /dev/null
@@ -1,4 +0,0 @@
-issuer:pinningroot
-subject:test end-entity
-subjectKey:alternate
-extension:subjectAlternativeName:x.b.pinning2.example.com
diff --git a/security/manager/ssl/tests/unit/test_pinning_header_parsing.js b/security/manager/ssl/tests/unit/test_pinning_header_parsing.js
deleted file mode 100644
index 0dcf6993b..000000000
--- a/security/manager/ssl/tests/unit/test_pinning_header_parsing.js
+++ /dev/null
@@ -1,147 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-// The purpose of this test is to check that parsing of HPKP headers
-// is correct.
-
-var profileDir = do_get_profile();
-const certdb = Cc["@mozilla.org/security/x509certdb;1"]
- .getService(Ci.nsIX509CertDB);
-var gSSService = Cc["@mozilla.org/ssservice;1"]
- .getService(Ci.nsISiteSecurityService);
-
-function certFromFile(cert_name) {
- return constructCertFromFile("test_pinning_dynamic/" + cert_name + ".pem");
-}
-
-function loadCert(cert_name, trust_string) {
- let cert_filename = "test_pinning_dynamic/" + cert_name + ".pem";
- addCertFromFile(certdb, cert_filename, trust_string);
- return constructCertFromFile(cert_filename);
-}
-
-function checkFailParseInvalidPin(pinValue) {
- let sslStatus = new FakeSSLStatus(
- certFromFile('a.pinning2.example.com-pinningroot'));
- let uri = Services.io.newURI("https://a.pinning2.example.com", null, null);
- throws(() => {
- gSSService.processHeader(Ci.nsISiteSecurityService.HEADER_HPKP, uri,
- pinValue, sslStatus, 0);
- }, /NS_ERROR_FAILURE/, `Invalid pin "${pinValue}" should be rejected`);
-}
-
-function checkPassValidPin(pinValue, settingPin, expectedMaxAge) {
- let sslStatus = new FakeSSLStatus(
- certFromFile('a.pinning2.example.com-pinningroot'));
- let uri = Services.io.newURI("https://a.pinning2.example.com", null, null);
- let maxAge = {};
-
- // setup preconditions for the test, if setting ensure there is no previous
- // state, if removing ensure there is a valid pin in place.
- if (settingPin) {
- gSSService.removeState(Ci.nsISiteSecurityService.HEADER_HPKP, uri, 0);
- } else {
- // add a known valid pin!
- let validPinValue = "max-age=5000;" + VALID_PIN1 + BACKUP_PIN1;
- gSSService.processHeader(Ci.nsISiteSecurityService.HEADER_HPKP, uri,
- validPinValue, sslStatus, 0);
- }
- try {
- gSSService.processHeader(Ci.nsISiteSecurityService.HEADER_HPKP, uri,
- pinValue, sslStatus, 0, maxAge);
- ok(true, "Valid pin should be accepted");
- } catch (e) {
- ok(false, "Valid pin should have been accepted");
- }
-
- // check that maxAge was processed correctly
- if (settingPin && expectedMaxAge) {
- ok(maxAge.value == expectedMaxAge, `max-age value should be ${expectedMaxAge}`);
- }
-
- // after processing ensure that the postconditions are true, if setting
- // the host must be pinned, if removing the host must not be pinned
- let hostIsPinned = gSSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HPKP,
- "a.pinning2.example.com", 0);
- if (settingPin) {
- ok(hostIsPinned, "Host should be considered pinned");
- } else {
- ok(!hostIsPinned, "Host should not be considered pinned");
- }
-}
-
-function checkPassSettingPin(pinValue, expectedMaxAge) {
- return checkPassValidPin(pinValue, true, expectedMaxAge);
-}
-
-function checkPassRemovingPin(pinValue) {
- return checkPassValidPin(pinValue, false);
-}
-
-const MAX_MAX_AGE_SECONDS = 100000;
-const GOOD_MAX_AGE_SECONDS = 69403;
-const LONG_MAX_AGE_SECONDS = 2 * MAX_MAX_AGE_SECONDS;
-const NON_ISSUED_KEY_HASH1 = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=";
-const NON_ISSUED_KEY_HASH2 = "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ=";
-const PINNING_ROOT_KEY_HASH = "VCIlmPM9NkgFQtrs4Oa5TeFcDu6MWRTKSNdePEhOgD8=";
-const MAX_AGE_ZERO = "max-age=0;";
-const VALID_PIN1 = `pin-sha256="${PINNING_ROOT_KEY_HASH}";`;
-const BACKUP_PIN1 = `pin-sha256="${NON_ISSUED_KEY_HASH1}";`;
-const BACKUP_PIN2 = `pin-sha256="${NON_ISSUED_KEY_HASH2}";`;
-const BROKEN_PIN1 = "pin-sha256=\"jdjsjsjs\";";
-const GOOD_MAX_AGE = `max-age=${GOOD_MAX_AGE_SECONDS};`;
-const LONG_MAX_AGE = `max-age=${LONG_MAX_AGE_SECONDS};`;
-const INCLUDE_SUBDOMAINS = "includeSubdomains;";
-const REPORT_URI = "report-uri=\"https://www.example.com/report/\";";
-const UNRECOGNIZED_DIRECTIVE = "unreconized-dir=12343;";
-
-function run_test() {
- Services.prefs.setBoolPref("security.cert_pinning.hpkp.enabled", true);
- Services.prefs.setIntPref("security.cert_pinning.enforcement_level", 2);
- Services.prefs.setIntPref("security.cert_pinning.max_max_age_seconds", MAX_MAX_AGE_SECONDS);
- Services.prefs.setBoolPref("security.cert_pinning.process_headers_from_non_builtin_roots", true);
-
- loadCert("pinningroot", "CTu,CTu,CTu");
- loadCert("badca", "CTu,CTu,CTu");
-
- checkFailParseInvalidPin("max-age=INVALID");
- // check that incomplete headers are failure
- checkFailParseInvalidPin(GOOD_MAX_AGE);
- checkFailParseInvalidPin(VALID_PIN1);
- checkFailParseInvalidPin(REPORT_URI);
- checkFailParseInvalidPin(UNRECOGNIZED_DIRECTIVE);
- checkFailParseInvalidPin(VALID_PIN1 + BACKUP_PIN1);
- checkFailParseInvalidPin(GOOD_MAX_AGE + VALID_PIN1);
- checkFailParseInvalidPin(GOOD_MAX_AGE + VALID_PIN1 + BROKEN_PIN1);
- // next ensure a backup pin is present
- checkFailParseInvalidPin(GOOD_MAX_AGE + VALID_PIN1 + VALID_PIN1);
- // next section ensure duplicate directives result in failure
- checkFailParseInvalidPin(GOOD_MAX_AGE + GOOD_MAX_AGE + VALID_PIN1 + BACKUP_PIN1);
- checkFailParseInvalidPin(GOOD_MAX_AGE + VALID_PIN1 + BACKUP_PIN1 + INCLUDE_SUBDOMAINS + INCLUDE_SUBDOMAINS);
- checkFailParseInvalidPin(GOOD_MAX_AGE + VALID_PIN1 + BACKUP_PIN1 + REPORT_URI + REPORT_URI);
- checkFailParseInvalidPin("thisisinvalidtest");
- checkFailParseInvalidPin("invalid" + GOOD_MAX_AGE + VALID_PIN1 + BACKUP_PIN1);
-
- checkPassRemovingPin("max-age=0"); //test removal without terminating ';'
- checkPassRemovingPin(MAX_AGE_ZERO);
- checkPassRemovingPin(MAX_AGE_ZERO + VALID_PIN1);
-
- checkPassSettingPin(GOOD_MAX_AGE + VALID_PIN1 + BACKUP_PIN1, GOOD_MAX_AGE_SECONDS);
- checkPassSettingPin(LONG_MAX_AGE + VALID_PIN1 + BACKUP_PIN1, MAX_MAX_AGE_SECONDS);
-
- checkPassRemovingPin(VALID_PIN1 + MAX_AGE_ZERO + VALID_PIN1);
- checkPassSettingPin(GOOD_MAX_AGE + VALID_PIN1 + BACKUP_PIN1);
- checkPassSettingPin(GOOD_MAX_AGE + VALID_PIN1 + BACKUP_PIN2);
- checkPassSettingPin(GOOD_MAX_AGE + VALID_PIN1 + BACKUP_PIN2 + INCLUDE_SUBDOMAINS);
- checkPassSettingPin(VALID_PIN1 + GOOD_MAX_AGE + BACKUP_PIN2 + INCLUDE_SUBDOMAINS);
- checkPassSettingPin(VALID_PIN1 + GOOD_MAX_AGE + BACKUP_PIN2 + REPORT_URI + INCLUDE_SUBDOMAINS);
- checkPassSettingPin(INCLUDE_SUBDOMAINS + VALID_PIN1 + GOOD_MAX_AGE + BACKUP_PIN2);
- checkPassSettingPin(GOOD_MAX_AGE + VALID_PIN1 + BACKUP_PIN1 + UNRECOGNIZED_DIRECTIVE);
-
- Services.prefs.clearUserPref("security.cert_pinning.hpkp.enabled");
- Services.prefs.clearUserPref("security.cert_pinning.enforcement_level");
- Services.prefs.clearUserPref("security.cert_pinning.max_max_age_seconds");
- Services.prefs.clearUserPref("security.cert_pinning.process_headers_from_non_builtin_roots");
-}
diff --git a/security/manager/ssl/tests/unit/test_sts_holepunch.js b/security/manager/ssl/tests/unit/test_sts_holepunch.js
deleted file mode 100644
index b7e643148..000000000
--- a/security/manager/ssl/tests/unit/test_sts_holepunch.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-"use strict";
-
-// bug 961528: chart.apis.google.com doesn't handle https. Check that
-// it isn't considered HSTS (other example.apis.google.com hosts should be
-// HSTS as long as they're on the preload list, however).
-function run_test() {
- let SSService = Cc["@mozilla.org/ssservice;1"]
- .getService(Ci.nsISiteSecurityService);
- ok(!SSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HSTS,
- "chart.apis.google.com", 0));
- ok(!SSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HSTS,
- "CHART.APIS.GOOGLE.COM", 0));
- ok(!SSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HSTS,
- "sub.chart.apis.google.com", 0));
- ok(!SSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HSTS,
- "SUB.CHART.APIS.GOOGLE.COM", 0));
- ok(SSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HSTS,
- "example.apis.google.com", 0));
- ok(SSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HSTS,
- "EXAMPLE.APIS.GOOGLE.COM", 0));
- ok(SSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HSTS,
- "sub.example.apis.google.com", 0));
- ok(SSService.isSecureHost(Ci.nsISiteSecurityService.HEADER_HSTS,
- "SUB.EXAMPLE.APIS.GOOGLE.COM", 0));
- // also check isSecureURI
- let chartURI = Services.io.newURI("http://chart.apis.google.com", null, null);
- ok(!SSService.isSecureURI(Ci.nsISiteSecurityService.HEADER_HSTS, chartURI, 0));
- let otherURI = Services.io.newURI("http://other.apis.google.com", null, null);
- ok(SSService.isSecureURI(Ci.nsISiteSecurityService.HEADER_HSTS, otherURI, 0));
-}
diff --git a/security/manager/ssl/tests/unit/xpcshell.ini b/security/manager/ssl/tests/unit/xpcshell.ini
index bdf9933f4..01384b19a 100644
--- a/security/manager/ssl/tests/unit/xpcshell.ini
+++ b/security/manager/ssl/tests/unit/xpcshell.ini
@@ -26,7 +26,6 @@ support-files =
test_ocsp_fetch_method/**
test_ocsp_url/**
test_onecrl/**
- test_pinning_dynamic/**
test_signed_apps/**
test_signed_dir/**
test_startcom_wosign/**
@@ -111,13 +110,6 @@ run-sequentially = hardcoded ports
[test_ocsp_url.js]
run-sequentially = hardcoded ports
[test_password_prompt.js]
-[test_pinning.js]
-run-sequentially = hardcoded ports
-# This test can take longer than 300 seconds on B2G emulator debug builds, so
-# give it enough time to finish. See bug 1081128.
-requesttimeoutfactor = 2
-[test_pinning_dynamic.js]
-[test_pinning_header_parsing.js]
[test_sdr.js]
[test_session_resumption.js]
run-sequentially = hardcoded ports
@@ -137,7 +129,6 @@ skip-if = toolkit == 'android'
[test_sss_savestate.js]
[test_startcom_wosign.js]
[test_sts_fqdn.js]
-[test_sts_holepunch.js]
[test_sts_ipv4_ipv6.js]
[test_sts_preloadlist_perwindowpb.js]
[test_sts_preloadlist_selfdestruct.js]
diff --git a/security/manager/tools/PreloadedHPKPins.json b/security/manager/tools/PreloadedHPKPins.json
deleted file mode 100644
index d9c394a1d..000000000
--- a/security/manager/tools/PreloadedHPKPins.json
+++ /dev/null
@@ -1,222 +0,0 @@
-// -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
-// This Source Code Form is subject to the terms of the Mozilla Public
-// License, v. 2.0. If a copy of the MPL was not distributed with this
-// file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-// The top-level element is a dictionary with two keys: "pinsets" maps details
-// of certificate pinning to a name and "entries" contains the HPKP details for
-// each host.
-//
-// "pinsets" is a list of objects. Each object has the following members:
-// name: (string) the name of the pinset
-// sha256_hashes: (list of strings) the set of allowed SPKIs hashes
-//
-// For a given pinset, a certificate is accepted if at least one of the
-// Subject Public Key Infos (SPKIs) is found in the chain. SPKIs are specified
-// as names, which must match up with the name given in the Mozilla root store.
-//
-// "entries" is a list of objects. Each object has the following members:
-// name: (string) the DNS name of the host in question
-// include_subdomains: (optional bool) whether subdomains of |name| are also covered
-// pins: (string) the |name| member of an object in |pinsets|
-//
-// "extra_certs" is a list of base64-encoded certificates. These are used in
-// pinsets that reference certificates not in our root program (for example,
-// Facebook).
-
-// equifax -> aus3
-// Geotrust Primary -> www.mozilla.org
-// Geotrust Global -> *. addons.mozilla.org
-{
- "chromium_data" : {
- "cert_file_url": "https://chromium.googlesource.com/chromium/src/net/+/master/http/transport_security_state_static.pins?format=TEXT",
- "json_file_url": "https://chromium.googlesource.com/chromium/src/net/+/master/http/transport_security_state_static.json?format=TEXT",
- "substitute_pinsets": {
- // Use the larger google_root_pems pinset instead of google
- "google": "google_root_pems"
- },
- "production_pinsets": [
- "google_root_pems",
- "facebook"
- ],
- "production_domains": [
- // Chrome's test domains.
- "pinningtest.appspot.com",
- "pinning-test.badssl.com",
- // Dropbox
- "dropbox.com",
- "www.dropbox.com",
- // Twitter
- "api.twitter.com",
- "business.twitter.com",
- "dev.twitter.com",
- "mobile.twitter.com",
- "oauth.twitter.com",
- "platform.twitter.com",
- "twimg.com",
- "www.twitter.com",
- // Tor
- "torproject.org",
- "blog.torproject.org",
- "check.torproject.org",
- "dist.torproject.org",
- "www.torproject.org",
- // SpiderOak
- "spideroak.com"
- ],
- "exclude_domains" : [
- // Chrome's entry for twitter.com doesn't include subdomains, so replace
- // it with our own entry below which also uses an expanded pinset.
- "twitter.com"
- ]
- },
- "pinsets": [
- {
- // From bug 772756, mozilla uses GeoTrust, Digicert and Thawte. Our
- // cdn sites use Verisign and Baltimore. We exclude 1024-bit root certs
- // from all providers. geotrust ca info:
- // http://www.geotrust.com/resources/root-certificates/index.html
- "name": "mozilla",
- "sha256_hashes": [
- "Baltimore CyberTrust Root",
- "DigiCert Assured ID Root CA",
- "DigiCert Global Root CA",
- "DigiCert High Assurance EV Root CA",
- "GeoTrust Global CA",
- "GeoTrust Global CA 2",
- "GeoTrust Primary Certification Authority",
- "GeoTrust Primary Certification Authority - G2",
- "GeoTrust Primary Certification Authority - G3",
- "GeoTrust Universal CA",
- "GeoTrust Universal CA 2",
- "thawte Primary Root CA",
- "thawte Primary Root CA - G2",
- "thawte Primary Root CA - G3",
- "Verisign Class 1 Public Primary Certification Authority - G3",
- "Verisign Class 2 Public Primary Certification Authority - G3",
- "Verisign Class 3 Public Primary Certification Authority - G3",
- "VeriSign Class 3 Public Primary Certification Authority - G4",
- "VeriSign Class 3 Public Primary Certification Authority - G5",
- // "Verisign Class 4 Public Primary Certification Authority - G3",
- "VeriSign Universal Root Certification Authority"
- ]
- },
- {
- "name": "mozilla_services",
- "sha256_hashes": [
- "DigiCert Global Root CA"
- ]
- },
- // For pinning tests on pinning.example.com, the certificate must be 'End
- // Entity Test Cert'
- {
- "name": "mozilla_test",
- "sha256_hashes": [
- "End Entity Test Cert"
- ]
- },
- // Google's root PEMs. Chrome pins only to their intermediate certs, but
- // they'd like us to be more liberal. For the initial list, we are using
- // the certs from http://pki.google.com/roots.pem.
- // We have no built-in for commented out CAs.
- {
- "name": "google_root_pems",
- "sha256_hashes": [
- "AddTrust External Root",
- "AddTrust Low-Value Services Root",
- "AddTrust Public Services Root",
- "AddTrust Qualified Certificates Root",
- "AffirmTrust Commercial",
- "AffirmTrust Networking",
- "AffirmTrust Premium",
- "AffirmTrust Premium ECC",
- "Baltimore CyberTrust Root",
- "Comodo AAA Services root",
- "COMODO Certification Authority",
- "COMODO ECC Certification Authority",
- "COMODO RSA Certification Authority",
- "Comodo Secure Services root",
- "Comodo Trusted Services root",
- "Cybertrust Global Root",
- "DigiCert Assured ID Root CA",
- "DigiCert Assured ID Root G2",
- "DigiCert Assured ID Root G3",
- "DigiCert Global Root CA",
- "DigiCert Global Root G2",
- "DigiCert Global Root G3",
- "DigiCert High Assurance EV Root CA",
- "DigiCert Trusted Root G4",
- "Entrust Root Certification Authority",
- "Entrust Root Certification Authority - EC1",
- "Entrust Root Certification Authority - G2",
- "Entrust.net Premium 2048 Secure Server CA",
- // "Equifax Secure Certificate Authority",
- "GeoTrust Global CA",
- "GeoTrust Global CA 2",
- "GeoTrust Primary Certification Authority",
- "GeoTrust Primary Certification Authority - G2",
- "GeoTrust Primary Certification Authority - G3",
- "GeoTrust Universal CA",
- "GeoTrust Universal CA 2",
- "GlobalSign ECC Root CA - R4",
- "GlobalSign ECC Root CA - R5",
- "GlobalSign Root CA",
- "GlobalSign Root CA - R2",
- "GlobalSign Root CA - R3",
- "Go Daddy Class 2 CA",
- "Go Daddy Root Certificate Authority - G2",
- "Starfield Class 2 CA",
- "Starfield Root Certificate Authority - G2",
- "thawte Primary Root CA",
- "thawte Primary Root CA - G2",
- "thawte Primary Root CA - G3",
- "USERTrust ECC Certification Authority",
- "USERTrust RSA Certification Authority",
- "UTN USERFirst Hardware Root CA",
- "Verisign Class 3 Public Primary Certification Authority - G3",
- "VeriSign Class 3 Public Primary Certification Authority - G4",
- "VeriSign Class 3 Public Primary Certification Authority - G5",
- "VeriSign Universal Root Certification Authority"
- ]
- }
- ],
-
- "entries": [
- // Only domains that are operationally crucial to Firefox can have per-host
- // telemetry reporting (the "id") field
- { "name": "addons.mozilla.org", "include_subdomains": true,
- "pins": "mozilla", "test_mode": false, "id": 1 },
- { "name": "addons.mozilla.net", "include_subdomains": true,
- "pins": "mozilla", "test_mode": false, "id": 2 },
- { "name": "aus4.mozilla.org", "include_subdomains": true,
- "pins": "mozilla", "test_mode": true, "id": 3 },
- { "name": "accounts.firefox.com", "include_subdomains": true,
- "pins": "mozilla_services", "test_mode": false, "id": 4 },
- { "name": "api.accounts.firefox.com", "include_subdomains": true,
- "pins": "mozilla_services", "test_mode": false, "id": 5 },
- { "name": "cdn.mozilla.net", "include_subdomains": true,
- "pins": "mozilla", "test_mode": false },
- { "name": "cdn.mozilla.org", "include_subdomains": true,
- "pins": "mozilla", "test_mode": false },
- { "name": "services.mozilla.com", "include_subdomains": true,
- "pins": "mozilla_services", "test_mode": false, "id": 6 },
- { "name": "include-subdomains.pinning.example.com",
- "include_subdomains": true, "pins": "mozilla_test",
- "test_mode": false },
- // Example domain to collect per-host stats for telemetry tests.
- { "name": "exclude-subdomains.pinning.example.com",
- "include_subdomains": false, "pins": "mozilla_test",
- "test_mode": false, "id": 0 },
- { "name": "test-mode.pinning.example.com", "include_subdomains": true,
- "pins": "mozilla_test", "test_mode": true },
- // Expand twitter's pinset to include all of *.twitter.com and use
- // twitterCDN. More specific rules take precedence because we search for
- // exact domain name first.
- { "name": "twitter.com", "include_subdomains": true,
- "pins": "twitterCDN", "test_mode": false },
- { "name": "aus5.mozilla.org", "include_subdomains": true,
- "pins": "mozilla", "test_mode": true, "id": 7 }
- ],
-
- "extra_certificates": []
-}
diff --git a/security/manager/tools/genHPKPStaticPins.js b/security/manager/tools/genHPKPStaticPins.js
deleted file mode 100644
index f2b9dbdda..000000000
--- a/security/manager/tools/genHPKPStaticPins.js
+++ /dev/null
@@ -1,630 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// How to run this file:
-// 1. [obtain firefox source code]
-// 2. [build/obtain firefox binaries]
-// 3. run `[path to]/run-mozilla.sh [path to]/xpcshell \
-// [path to]/genHPKPStaticpins.js \
-// [absolute path to]/PreloadedHPKPins.json \
-// [an unused argument - see bug 1205406] \
-// [absolute path to]/StaticHPKPins.h
-"use strict";
-
-if (arguments.length != 3) {
- throw new Error("Usage: genHPKPStaticPins.js " +
- "<absolute path to PreloadedHPKPins.json> " +
- "<an unused argument - see bug 1205406> " +
- "<absolute path to StaticHPKPins.h>");
-}
-
-var { 'classes': Cc, 'interfaces': Ci, 'utils': Cu, 'results': Cr } = Components;
-
-var { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
-var { FileUtils } = Cu.import("resource://gre/modules/FileUtils.jsm", {});
-var { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
-
-var gCertDB = Cc["@mozilla.org/security/x509certdb;1"]
- .getService(Ci.nsIX509CertDB);
-
-const BUILT_IN_NICK_PREFIX = "Builtin Object Token:";
-const SHA256_PREFIX = "sha256/";
-const GOOGLE_PIN_PREFIX = "GOOGLE_PIN_";
-
-// Pins expire in 14 weeks (6 weeks on Beta + 8 weeks on stable)
-const PINNING_MINIMUM_REQUIRED_MAX_AGE = 60 * 60 * 24 * 7 * 14;
-
-const FILE_HEADER = "/* This Source Code Form is subject to the terms of the Mozilla Public\n" +
-" * License, v. 2.0. If a copy of the MPL was not distributed with this\n" +
-" * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n" +
-"\n" +
-"/*****************************************************************************/\n" +
-"/* This is an automatically generated file. If you're not */\n" +
-"/* PublicKeyPinningService.cpp, you shouldn't be #including it. */\n" +
-"/*****************************************************************************/\n" +
-"#include <stdint.h>" +
-"\n";
-
-const DOMAINHEADER = "/* Domainlist */\n" +
- "struct TransportSecurityPreload {\n" +
- " const char* mHost;\n" +
- " const bool mIncludeSubdomains;\n" +
- " const bool mTestMode;\n" +
- " const bool mIsMoz;\n" +
- " const int32_t mId;\n" +
- " const StaticFingerprints* pinset;\n" +
- "};\n\n";
-
-const PINSETDEF = "/* Pinsets are each an ordered list by the actual value of the fingerprint */\n" +
- "struct StaticFingerprints {\n" +
- " const size_t size;\n" +
- " const char* const* data;\n" +
- "};\n\n";
-
-// Command-line arguments
-var gStaticPins = parseJson(arguments[0]);
-
-// arguments[1] is ignored for now. See bug 1205406.
-
-// Open the output file.
-var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
-file.initWithPath(arguments[2]);
-var gFileOutputStream = FileUtils.openSafeFileOutputStream(file);
-
-function writeString(string) {
- gFileOutputStream.write(string, string.length);
-}
-
-function readFileToString(filename) {
- let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
- file.initWithPath(filename);
- let stream = Cc["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Ci.nsIFileInputStream);
- stream.init(file, -1, 0, 0);
- let buf = NetUtil.readInputStreamToString(stream, stream.available());
- return buf;
-}
-
-function stripComments(buf) {
- let lines = buf.split("\n");
- let entryRegex = /^\s*\/\//;
- let data = "";
- for (let i = 0; i < lines.length; ++i) {
- let match = entryRegex.exec(lines[i]);
- if (!match) {
- data = data + lines[i];
- }
- }
- return data;
-}
-
-function isBuiltinToken(tokenName) {
- return tokenName == "Builtin Object Token";
-}
-
-function isCertBuiltIn(cert) {
- let tokenNames = cert.getAllTokenNames({});
- if (!tokenNames) {
- return false;
- }
- if (tokenNames.some(isBuiltinToken)) {
- return true;
- }
- return false;
-}
-
-function download(filename) {
- let req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
- .createInstance(Ci.nsIXMLHttpRequest);
- req.open("GET", filename, false); // doing the request synchronously
- try {
- req.send();
- }
- catch (e) {
- throw new Error(`ERROR: problem downloading '${filename}': ${e}`);
- }
-
- if (req.status != 200) {
- throw new Error("ERROR: problem downloading '" + filename + "': status " +
- req.status);
- }
-
- let resultDecoded;
- try {
- resultDecoded = atob(req.responseText);
- }
- catch (e) {
- throw new Error("ERROR: could not decode data as base64 from '" + filename +
- "': " + e);
- }
- return resultDecoded;
-}
-
-function downloadAsJson(filename) {
- // we have to filter out '//' comments, while not mangling the json
- let result = download(filename).replace(/^(\s*)?\/\/[^\n]*\n/mg, "");
- let data = null;
- try {
- data = JSON.parse(result);
- }
- catch (e) {
- throw new Error("ERROR: could not parse data from '" + filename + "': " + e);
- }
- return data;
-}
-
-// Returns a Subject Public Key Digest from the given pem, if it exists.
-function getSKDFromPem(pem) {
- let cert = gCertDB.constructX509FromBase64(pem, pem.length);
- return cert.sha256SubjectPublicKeyInfoDigest;
-}
-
-/**
- * Hashes |input| using the SHA-256 algorithm in the following manner:
- * btoa(sha256(atob(input)))
- *
- * @argument {String} input Base64 string to decode and return the hash of.
- * @returns {String} Base64 encoded SHA-256 hash.
- */
-function sha256Base64(input) {
- let decodedValue;
- try {
- decodedValue = atob(input);
- }
- catch (e) {
- throw new Error(`ERROR: could not decode as base64: '${input}': ${e}`);
- }
-
- // Convert |decodedValue| to an array so that it can be hashed by the
- // nsICryptoHash instance below.
- // In most cases across the code base, convertToByteArray() of
- // nsIScriptableUnicodeConverter is used to do this, but the method doesn't
- // seem to work here.
- let data = [];
- for (let i = 0; i < decodedValue.length; i++) {
- data[i] = decodedValue.charCodeAt(i);
- }
-
- let hasher = Cc["@mozilla.org/security/hash;1"]
- .createInstance(Ci.nsICryptoHash);
- hasher.init(hasher.SHA256);
- hasher.update(data, data.length);
-
- // true is passed so that the hasher returns a Base64 encoded string.
- return hasher.finish(true);
-}
-
-// Downloads the static certs file and tries to map Google Chrome nicknames
-// to Mozilla nicknames, as well as storing any hashes for pins for which we
-// don't have root PEMs. Each entry consists of a line containing the name of
-// the pin followed either by a hash in the format "sha256/" + base64(hash),
-// a PEM encoded public key, or a PEM encoded certificate.
-// For certificates that we have in our database,
-// return a map of Google's nickname to ours. For ones that aren't return a
-// map of Google's nickname to SHA-256 values. This code is modeled after agl's
-// https://github.com/agl/transport-security-state-generate, which doesn't
-// live in the Chromium repo because go is not an official language in
-// Chromium.
-// For all of the entries in this file:
-// - If the entry has a hash format, find the Mozilla pin name (cert nickname)
-// and stick the hash into certSKDToName
-// - If the entry has a PEM format, parse the PEM, find the Mozilla pin name
-// and stick the hash in certSKDToName
-// We MUST be able to find a corresponding cert nickname for the Chrome names,
-// otherwise we skip all pinsets referring to that Chrome name.
-function downloadAndParseChromeCerts(filename, certNameToSKD, certSKDToName) {
- // Prefixes that we care about.
- const BEGIN_CERT = "-----BEGIN CERTIFICATE-----";
- const END_CERT = "-----END CERTIFICATE-----";
- const BEGIN_PUB_KEY = "-----BEGIN PUBLIC KEY-----";
- const END_PUB_KEY = "-----END PUBLIC KEY-----";
-
- // Parsing states.
- const PRE_NAME = 0;
- const POST_NAME = 1;
- const IN_CERT = 2;
- const IN_PUB_KEY = 3;
- let state = PRE_NAME;
-
- let lines = download(filename).split("\n");
- let name = "";
- let pemCert = "";
- let pemPubKey = "";
- let hash = "";
- let chromeNameToHash = {};
- let chromeNameToMozName = {};
- let chromeName;
- for (let line of lines) {
- // Skip comments and newlines.
- if (line.length == 0 || line[0] == '#') {
- continue;
- }
- switch (state) {
- case PRE_NAME:
- chromeName = line;
- state = POST_NAME;
- break;
- case POST_NAME:
- if (line.startsWith(SHA256_PREFIX)) {
- hash = line.substring(SHA256_PREFIX.length);
- chromeNameToHash[chromeName] = hash;
- certNameToSKD[chromeName] = hash;
- certSKDToName[hash] = chromeName;
- state = PRE_NAME;
- } else if (line.startsWith(BEGIN_CERT)) {
- state = IN_CERT;
- } else if (line.startsWith(BEGIN_PUB_KEY)) {
- state = IN_PUB_KEY;
- } else {
- throw new Error("ERROR: couldn't parse Chrome certificate file " +
- "line: " + line);
- }
- break;
- case IN_CERT:
- if (line.startsWith(END_CERT)) {
- state = PRE_NAME;
- hash = getSKDFromPem(pemCert);
- pemCert = "";
- let mozName;
- if (hash in certSKDToName) {
- mozName = certSKDToName[hash];
- } else {
- // Not one of our built-in certs. Prefix the name with
- // GOOGLE_PIN_.
- mozName = GOOGLE_PIN_PREFIX + chromeName;
- dump("Can't find hash in builtin certs for Chrome nickname " +
- chromeName + ", inserting " + mozName + "\n");
- certSKDToName[hash] = mozName;
- certNameToSKD[mozName] = hash;
- }
- chromeNameToMozName[chromeName] = mozName;
- } else {
- pemCert += line;
- }
- break;
- case IN_PUB_KEY:
- if (line.startsWith(END_PUB_KEY)) {
- state = PRE_NAME;
- hash = sha256Base64(pemPubKey);
- pemPubKey = "";
- chromeNameToHash[chromeName] = hash;
- certNameToSKD[chromeName] = hash;
- certSKDToName[hash] = chromeName;
- } else {
- pemPubKey += line;
- }
- break;
- default:
- throw new Error("ERROR: couldn't parse Chrome certificate file " + line);
- }
- }
- return [ chromeNameToHash, chromeNameToMozName ];
-}
-
-// We can only import pinsets from chrome if for every name in the pinset:
-// - We have a hash from Chrome's static certificate file
-// - We have a builtin cert
-// If the pinset meets these requirements, we store a map array of pinset
-// objects:
-// {
-// pinset_name : {
-// // Array of names with entries in certNameToSKD
-// sha256_hashes: []
-// }
-// }
-// and an array of imported pinset entries:
-// { name: string, include_subdomains: boolean, test_mode: boolean,
-// pins: pinset_name }
-function downloadAndParseChromePins(filename,
- chromeNameToHash,
- chromeNameToMozName,
- certNameToSKD,
- certSKDToName) {
- let chromePreloads = downloadAsJson(filename);
- let chromePins = chromePreloads.pinsets;
- let chromeImportedPinsets = {};
- let chromeImportedEntries = [];
-
- chromePins.forEach(function(pin) {
- let valid = true;
- let pinset = { name: pin.name, sha256_hashes: [] };
- // Translate the Chrome pinset format to ours
- pin.static_spki_hashes.forEach(function(name) {
- if (name in chromeNameToHash) {
- let hash = chromeNameToHash[name];
- pinset.sha256_hashes.push(certSKDToName[hash]);
-
- // We should have already added hashes for all of these when we
- // imported the certificate file.
- if (!certNameToSKD[name]) {
- throw new Error("ERROR: No hash for name: " + name);
- }
- } else if (name in chromeNameToMozName) {
- pinset.sha256_hashes.push(chromeNameToMozName[name]);
- } else {
- dump("Skipping Chrome pinset " + pinset.name + ", couldn't find " +
- "builtin " + name + " from cert file\n");
- valid = false;
- }
- });
- if (valid) {
- chromeImportedPinsets[pinset.name] = pinset;
- }
- });
-
- // Grab the domain entry lists. Chrome's entry format is similar to
- // ours, except theirs includes a HSTS mode.
- const cData = gStaticPins.chromium_data;
- let entries = chromePreloads.entries;
- entries.forEach(function(entry) {
- // HSTS entry only
- if (!entry.pins) {
- return;
- }
- let pinsetName = cData.substitute_pinsets[entry.pins];
- if (!pinsetName) {
- pinsetName = entry.pins;
- }
-
- // We trim the entry name here to avoid breaking hostname comparisons in the
- // HPKP implementation.
- entry.name = entry.name.trim();
-
- let isProductionDomain =
- (cData.production_domains.indexOf(entry.name) != -1);
- let isProductionPinset =
- (cData.production_pinsets.indexOf(pinsetName) != -1);
- let excludeDomain =
- (cData.exclude_domains.indexOf(entry.name) != -1);
- let isTestMode = !isProductionPinset && !isProductionDomain;
- if (entry.pins && !excludeDomain && chromeImportedPinsets[entry.pins]) {
- chromeImportedEntries.push({
- name: entry.name,
- include_subdomains: entry.include_subdomains,
- test_mode: isTestMode,
- is_moz: false,
- pins: pinsetName });
- }
- });
- return [ chromeImportedPinsets, chromeImportedEntries ];
-}
-
-// Returns a pair of maps [certNameToSKD, certSKDToName] between cert
-// nicknames and digests of the SPKInfo for the mozilla trust store
-function loadNSSCertinfo(extraCertificates) {
- let allCerts = gCertDB.getCerts();
- let enumerator = allCerts.getEnumerator();
- let certNameToSKD = {};
- let certSKDToName = {};
- while (enumerator.hasMoreElements()) {
- let cert = enumerator.getNext().QueryInterface(Ci.nsIX509Cert);
- if (!isCertBuiltIn(cert)) {
- continue;
- }
- let name = cert.nickname.substr(BUILT_IN_NICK_PREFIX.length);
- let SKD = cert.sha256SubjectPublicKeyInfoDigest;
- certNameToSKD[name] = SKD;
- certSKDToName[SKD] = name;
- }
-
- for (let cert of extraCertificates) {
- let name = cert.commonName;
- let SKD = cert.sha256SubjectPublicKeyInfoDigest;
- certNameToSKD[name] = SKD;
- certSKDToName[SKD] = name;
- }
-
- {
- // This is the pinning test certificate. The key hash identifies the
- // default RSA key from pykey.
- let name = "End Entity Test Cert";
- let SKD = "VCIlmPM9NkgFQtrs4Oa5TeFcDu6MWRTKSNdePEhOgD8=";
- certNameToSKD[name] = SKD;
- certSKDToName[SKD] = name;
- }
- return [certNameToSKD, certSKDToName];
-}
-
-function parseJson(filename) {
- let json = stripComments(readFileToString(filename));
- return JSON.parse(json);
-}
-
-function nameToAlias(certName) {
- // change the name to a string valid as a c identifier
- // remove non-ascii characters
- certName = certName.replace(/[^[:ascii:]]/g, "_");
- // replace non word characters
- certName = certName.replace(/[^A-Za-z0-9]/g, "_");
-
- return "k" + certName + "Fingerprint";
-}
-
-function compareByName (a, b) {
- return a.name.localeCompare(b.name);
-}
-
-function genExpirationTime() {
- let now = new Date();
- let nowMillis = now.getTime();
- let expirationMillis = nowMillis + (PINNING_MINIMUM_REQUIRED_MAX_AGE * 1000);
- let expirationMicros = expirationMillis * 1000;
- return "static const PRTime kPreloadPKPinsExpirationTime = INT64_C(" +
- expirationMicros + ");\n";
-}
-
-function writeFullPinset(certNameToSKD, certSKDToName, pinset) {
- let prefix = "kPinset_" + pinset.name;
- if (!pinset.sha256_hashes || pinset.sha256_hashes.length == 0) {
- throw new Error(`ERROR: Pinset ${pinset.name} does not contain any hashes`);
- }
- writeFingerprints(certNameToSKD, certSKDToName, pinset.name,
- pinset.sha256_hashes);
-}
-
-function writeFingerprints(certNameToSKD, certSKDToName, name, hashes) {
- let varPrefix = "kPinset_" + name;
- writeString("static const char* const " + varPrefix + "_Data[] = {\n");
- let SKDList = [];
- for (let certName of hashes) {
- if (!(certName in certNameToSKD)) {
- throw new Error(`ERROR: Can't find '${certName}' in certNameToSKD`);
- }
- SKDList.push(certNameToSKD[certName]);
- }
- for (let skd of SKDList.sort()) {
- writeString(" " + nameToAlias(certSKDToName[skd]) + ",\n");
- }
- if (hashes.length == 0) {
- // ANSI C requires that an initialiser list be non-empty.
- writeString(" 0\n");
- }
- writeString("};\n");
- writeString("static const StaticFingerprints " + varPrefix + " = {\n " +
- "sizeof(" + varPrefix + "_Data) / sizeof(const char*),\n " + varPrefix +
- "_Data\n};\n\n");
-}
-
-function writeEntry(entry) {
- let printVal = " { \"" + entry.name + "\",\ ";
- if (entry.include_subdomains) {
- printVal += "true, ";
- } else {
- printVal += "false, ";
- }
- // Default to test mode if not specified.
- let testMode = true;
- if (entry.hasOwnProperty("test_mode")) {
- testMode = entry.test_mode;
- }
- if (testMode) {
- printVal += "true, ";
- } else {
- printVal += "false, ";
- }
- if (entry.is_moz || (entry.pins.indexOf("mozilla") != -1 &&
- entry.pins != "mozilla_test")) {
- printVal += "true, ";
- } else {
- printVal += "false, ";
- }
- if ("id" in entry) {
- if (entry.id >= 256) {
- throw new Error("ERROR: Not enough buckets in histogram");
- }
- if (entry.id >= 0) {
- printVal += entry.id + ", ";
- }
- } else {
- printVal += "-1, ";
- }
- printVal += "&kPinset_" + entry.pins;
- printVal += " },\n";
- writeString(printVal);
-}
-
-function writeDomainList(chromeImportedEntries) {
- writeString("/* Sort hostnames for binary search. */\n");
- writeString("static const TransportSecurityPreload " +
- "kPublicKeyPinningPreloadList[] = {\n");
- let count = 0;
- let mozillaDomains = {};
- gStaticPins.entries.forEach(function(entry) {
- mozillaDomains[entry.name] = true;
- });
- // For any domain for which we have set pins, exclude them from
- // chromeImportedEntries.
- for (let i = chromeImportedEntries.length - 1; i >= 0; i--) {
- if (mozillaDomains[chromeImportedEntries[i].name]) {
- dump("Skipping duplicate pinset for domain " +
- JSON.stringify(chromeImportedEntries[i], undefined, 2) + "\n");
- chromeImportedEntries.splice(i, 1);
- }
- }
- let sortedEntries = gStaticPins.entries;
- sortedEntries.push.apply(sortedEntries, chromeImportedEntries);
- for (let entry of sortedEntries.sort(compareByName)) {
- count++;
- writeEntry(entry);
- }
- writeString("};\n");
-
- writeString("\n// Pinning Preload List Length = " + count + ";\n");
- writeString("\nstatic const int32_t kUnknownId = -1;\n");
-}
-
-function writeFile(certNameToSKD, certSKDToName,
- chromeImportedPinsets, chromeImportedEntries) {
- // Compute used pins from both Chrome's and our pinsets, so we can output
- // them later.
- let usedFingerprints = {};
- let mozillaPins = {};
- gStaticPins.pinsets.forEach(function(pinset) {
- mozillaPins[pinset.name] = true;
- pinset.sha256_hashes.forEach(function (name) {
- usedFingerprints[name] = true;
- });
- });
- for (let key in chromeImportedPinsets) {
- let pinset = chromeImportedPinsets[key];
- pinset.sha256_hashes.forEach(function(name) {
- usedFingerprints[name] = true;
- });
- }
-
- writeString(FILE_HEADER);
-
- // Write actual fingerprints.
- Object.keys(usedFingerprints).sort().forEach(function(certName) {
- if (certName) {
- writeString("/* " + certName + " */\n");
- writeString("static const char " + nameToAlias(certName) + "[] =\n");
- writeString(" \"" + certNameToSKD[certName] + "\";\n");
- writeString("\n");
- }
- });
-
- // Write the pinsets
- writeString(PINSETDEF);
- writeString("/* PreloadedHPKPins.json pinsets */\n");
- gStaticPins.pinsets.sort(compareByName).forEach(function(pinset) {
- writeFullPinset(certNameToSKD, certSKDToName, pinset);
- });
- writeString("/* Chrome static pinsets */\n");
- for (let key in chromeImportedPinsets) {
- if (mozillaPins[key]) {
- dump("Skipping duplicate pinset " + key + "\n");
- } else {
- dump("Writing pinset " + key + "\n");
- writeFullPinset(certNameToSKD, certSKDToName, chromeImportedPinsets[key]);
- }
- }
-
- // Write the domainlist entries.
- writeString(DOMAINHEADER);
- writeDomainList(chromeImportedEntries);
- writeString("\n");
- writeString(genExpirationTime());
-}
-
-function loadExtraCertificates(certStringList) {
- let constructedCerts = [];
- for (let certString of certStringList) {
- constructedCerts.push(gCertDB.constructX509FromBase64(certString));
- }
- return constructedCerts;
-}
-
-var extraCertificates = loadExtraCertificates(gStaticPins.extra_certificates);
-var [ certNameToSKD, certSKDToName ] = loadNSSCertinfo(extraCertificates);
-var [ chromeNameToHash, chromeNameToMozName ] = downloadAndParseChromeCerts(
- gStaticPins.chromium_data.cert_file_url, certNameToSKD, certSKDToName);
-var [ chromeImportedPinsets, chromeImportedEntries ] =
- downloadAndParseChromePins(gStaticPins.chromium_data.json_file_url,
- chromeNameToHash, chromeNameToMozName, certNameToSKD, certSKDToName);
-
-writeFile(certNameToSKD, certSKDToName, chromeImportedPinsets,
- chromeImportedEntries);
-
-FileUtils.closeSafeFileOutputStream(gFileOutputStream);
diff --git a/security/manager/tools/getHSTSPreloadList.js b/security/manager/tools/getHSTSPreloadList.js
deleted file mode 100644
index 42d4da067..000000000
--- a/security/manager/tools/getHSTSPreloadList.js
+++ /dev/null
@@ -1,458 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-// How to run this file:
-// 1. [obtain firefox source code]
-// 2. [build/obtain firefox binaries]
-// 3. run `[path to]/run-mozilla.sh [path to]/xpcshell \
-// [path to]/getHSTSPreloadlist.js \
-// [absolute path to]/nsSTSPreloadlist.inc'
-// Note: Running this file outputs a new nsSTSPreloadlist.inc in the current
-// working directory.
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource:///modules/XPCOMUtils.jsm");
-
-const SOURCE = "https://chromium.googlesource.com/chromium/src/net/+/master/http/transport_security_state_static.json?format=TEXT";
-const TOOL_IDENTIFIER = "UXP HSTS preload list verifier"
-const OUTPUT = "nsSTSPreloadList.inc";
-const ERROR_OUTPUT = "nsSTSPreloadList.errors";
-const MINIMUM_REQUIRED_MAX_AGE = 60 * 60 * 24 * 7 * 18;
-const MAX_CONCURRENT_REQUESTS = 15;
-const MAX_RETRIES = 2;
-const REQUEST_TIMEOUT = 10 * 1000;
-const ERROR_NONE = "no error";
-const ERROR_CONNECTING_TO_HOST = "could not connect to host";
-const ERROR_NO_HSTS_HEADER = "did not receive HSTS header";
-const ERROR_MAX_AGE_TOO_LOW = "max-age too low: ";
-const HEADER = "/* This Source Code Form is subject to the terms of the Mozilla Public\n" +
-" * License, v. 2.0. If a copy of the MPL was not distributed with this\n" +
-" * file, You can obtain one at http://mozilla.org/MPL/2.0/. */\n" +
-"\n" +
-"/*****************************************************************************/\n" +
-"/* This is an automatically generated file. If you're not */\n" +
-"/* nsSiteSecurityService.cpp, you shouldn't be #including it. */\n" +
-"/*****************************************************************************/\n" +
-"\n" +
-"#include <stdint.h>\n";
-const PREFIX = "\n" +
-"class nsSTSPreload\n" +
-"{\n" +
-" public:\n" +
-" const char *mHost;\n" +
-" const bool mIncludeSubdomains;\n" +
-"};\n" +
-"\n" +
-"static const nsSTSPreload kSTSPreloadList[] = {\n";
-const POSTFIX = "};\n";
-
-function download() {
- var req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
- .createInstance(Ci.nsIXMLHttpRequest);
- req.open("GET", SOURCE, false); // doing the request synchronously
- try {
- req.send();
- }
- catch (e) {
- throw new Error(`ERROR: problem downloading '${SOURCE}': ${e}`);
- }
-
- if (req.status != 200) {
- throw new Error("ERROR: problem downloading '" + SOURCE + "': status " +
- req.status);
- }
-
- var resultDecoded;
- try {
- resultDecoded = atob(req.responseText);
- }
- catch (e) {
- throw new Error("ERROR: could not decode data as base64 from '" + SOURCE +
- "': " + e);
- }
-
- // we have to filter out '//' comments, while not mangling the json
- var result = resultDecoded.replace(/^(\s*)?\/\/[^\n]*\n/mg, "");
- var data = null;
- try {
- data = JSON.parse(result);
- }
- catch (e) {
- throw new Error(`ERROR: could not parse data from '${SOURCE}': ${e}`);
- }
- return data;
-}
-
-function getHosts(rawdata) {
- var hosts = [];
-
- if (!rawdata || !rawdata.entries) {
- throw new Error("ERROR: source data not formatted correctly: 'entries' " +
- "not found");
- }
-
- for (let entry of rawdata.entries) {
- if (entry.mode && entry.mode == "force-https") {
- if (entry.name) {
- // We trim the entry name here to avoid malformed URI exceptions when we
- // later try to connect to the domain.
- entry.name = entry.name.trim();
- entry.retries = MAX_RETRIES;
- entry.originalIncludeSubdomains = entry.include_subdomains;
- hosts.push(entry);
- } else {
- throw new Error("ERROR: entry not formatted correctly: no name found");
- }
- }
- }
-
- return hosts;
-}
-
-var gSSService = Cc["@mozilla.org/ssservice;1"]
- .getService(Ci.nsISiteSecurityService);
-
-function processStsHeader(host, header, status, securityInfo) {
- var maxAge = { value: 0 };
- var includeSubdomains = { value: false };
- var error = ERROR_NONE;
- if (header != null && securityInfo != null) {
- try {
- var uri = Services.io.newURI("https://" + host.name, null, null);
- var sslStatus = securityInfo.QueryInterface(Ci.nsISSLStatusProvider)
- .SSLStatus;
- gSSService.processHeader(Ci.nsISiteSecurityService.HEADER_HSTS,
- uri, header, sslStatus, 0, maxAge,
- includeSubdomains);
- }
- catch (e) {
- dump("ERROR: could not process header '" + header + "' from " +
- host.name + ": " + e + "\n");
- error = e;
- }
- } else if (status == 0) {
- error = ERROR_CONNECTING_TO_HOST;
- } else {
- error = ERROR_NO_HSTS_HEADER;
- }
-
- let forceInclude = (host.forceInclude || host.pins == "google");
-
- if (error == ERROR_NONE && maxAge.value < MINIMUM_REQUIRED_MAX_AGE) {
- error = ERROR_MAX_AGE_TOO_LOW;
- }
-
- return { name: host.name,
- maxAge: maxAge.value,
- includeSubdomains: includeSubdomains.value,
- error: error,
- retries: host.retries - 1,
- forceInclude: forceInclude,
- originalIncludeSubdomains: host.originalIncludeSubdomains };
-}
-
-// RedirectAndAuthStopper prevents redirects and HTTP authentication
-function RedirectAndAuthStopper() {}
-
-RedirectAndAuthStopper.prototype = {
- // nsIChannelEventSink
- asyncOnChannelRedirect: function(oldChannel, newChannel, flags, callback) {
- throw new Error(Cr.NS_ERROR_ENTITY_CHANGED);
- },
-
- // nsIAuthPrompt2
- promptAuth: function(channel, level, authInfo) {
- return false;
- },
-
- asyncPromptAuth: function(channel, callback, context, level, authInfo) {
- throw new Error(Cr.NS_ERROR_NOT_IMPLEMENTED);
- },
-
- getInterface: function(iid) {
- return this.QueryInterface(iid);
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIChannelEventSink,
- Ci.nsIAuthPrompt2])
-};
-
-function getHSTSStatus(host, resultList) {
- var req = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
- .createInstance(Ci.nsIXMLHttpRequest);
- var inResultList = false;
- var uri = "https://" + host.name + "/";
- req.open("HEAD", uri, true);
- req.setRequestHeader("X-Automated-Tool", TOOL_IDENTIFIER);
- req.timeout = REQUEST_TIMEOUT;
-
- let errorhandler = (evt) => {
- dump(`ERROR: error making request to ${host.name} (type=${evt.type})\n`);
- if (!inResultList) {
- inResultList = true;
- resultList.push(processStsHeader(host, null, req.status,
- req.channel.securityInfo));
- }
- };
- req.onerror = errorhandler;
- req.ontimeout = errorhandler;
- req.onabort = errorhandler;
-
- req.onload = function(event) {
- if (!inResultList) {
- inResultList = true;
- var header = req.getResponseHeader("strict-transport-security");
- resultList.push(processStsHeader(host, header, req.status,
- req.channel.securityInfo));
- }
- };
-
- try {
- req.channel.notificationCallbacks = new RedirectAndAuthStopper();
- req.send();
- }
- catch (e) {
- dump("ERROR: exception making request to " + host.name + ": " + e + "\n");
- }
-}
-
-function compareHSTSStatus(a, b) {
- if (a.name > b.name) {
- return 1;
- }
- if (a.name < b.name) {
- return -1;
- }
- return 0;
-}
-
-function writeTo(string, fos) {
- fos.write(string, string.length);
-}
-
-// Determines and returns a string representing a declaration of when this
-// preload list should no longer be used.
-// This is the current time plus MINIMUM_REQUIRED_MAX_AGE.
-function getExpirationTimeString() {
- var now = new Date();
- var nowMillis = now.getTime();
- // MINIMUM_REQUIRED_MAX_AGE is in seconds, so convert to milliseconds
- var expirationMillis = nowMillis + (MINIMUM_REQUIRED_MAX_AGE * 1000);
- var expirationMicros = expirationMillis * 1000;
- return "const PRTime gPreloadListExpirationTime = INT64_C(" + expirationMicros + ");\n";
-}
-
-function errorToString(status) {
- return (status.error == ERROR_MAX_AGE_TOO_LOW
- ? status.error + status.maxAge
- : status.error);
-}
-
-function writeEntry(status, outputStream) {
- let incSubdomainsBool = (status.forceInclude && status.error != ERROR_NONE
- ? status.originalIncludeSubdomains
- : status.includeSubdomains);
- let includeSubdomains = (incSubdomainsBool ? "true" : "false");
- writeTo(" { \"" + status.name + "\", " + includeSubdomains + " },\n",
- outputStream);
-}
-
-function output(sortedStatuses, currentList) {
- try {
- var file = FileUtils.getFile("CurWorkD", [OUTPUT]);
- var errorFile = FileUtils.getFile("CurWorkD", [ERROR_OUTPUT]);
- var fos = FileUtils.openSafeFileOutputStream(file);
- var eos = FileUtils.openSafeFileOutputStream(errorFile);
- writeTo(HEADER, fos);
- writeTo(getExpirationTimeString(), fos);
- writeTo(PREFIX, fos);
-
- for (let status in sortedStatuses) {
- // If we've encountered an error for this entry (other than the site not
- // sending an HSTS header), be safe and remove it from the list
- // (preventing stale entries from accumulating).
- if (status.error != ERROR_NONE &&
- status.error != ERROR_NO_HSTS_HEADER &&
- status.error != ERROR_MAX_AGE_TOO_LOW &&
- status.name in currentList) {
- dump("INFO: error connecting to or processing " + status.name + " - dropping from list\n");
- writeTo(status.name + ": " + errorToString(status) + "\n", eos);
- status.maxAge = 0;
- }
- }
-
- // Filter out entries we aren't including.
- var includedStatuses = sortedStatuses.filter(function (status) {
- if (status.maxAge < MINIMUM_REQUIRED_MAX_AGE && !status.forceInclude) {
- dump("INFO: " + status.name + " NOT ON the preload list\n");
- writeTo(status.name + ": " + errorToString(status) + "\n", eos);
- return false;
- }
-
- dump("INFO: " + status.name + " ON the preload list\n");
- if (status.forceInclude && status.error != ERROR_NONE) {
- writeTo(status.name + ": " + errorToString(status) + " (error "
- + "ignored - included regardless)\n", eos);
- }
- return true;
- });
-
- for (var status of includedStatuses) {
- writeEntry(status, fos);
- }
- writeTo(POSTFIX, fos);
- FileUtils.closeSafeFileOutputStream(fos);
- FileUtils.closeSafeFileOutputStream(eos);
- }
- catch (e) {
- dump("ERROR: problem writing output to '" + OUTPUT + "': " + e + "\n");
- }
-}
-
-function shouldRetry(response) {
- return (response.error != ERROR_NO_HSTS_HEADER &&
- response.error != ERROR_MAX_AGE_TOO_LOW &&
- response.error != ERROR_NONE && response.retries > 0);
-}
-
-function getHSTSStatuses(inHosts, outStatuses) {
- var expectedOutputLength = inHosts.length;
- var tmpOutput = [];
- var procCount = 0;
- for (var i = 0; i < MAX_CONCURRENT_REQUESTS && inHosts.length > 0; i++) {
- let host = inHosts.shift();
- dump("spinning off request to '" + host.name + "' (remaining retries: " +
- host.retries + ")\n");
- getHSTSStatus(host, tmpOutput);
- }
-
- while (outStatuses.length != expectedOutputLength) {
- procCount++;
- if (procCount % 200 == 0) gc();
- waitForAResponse(tmpOutput);
- var response = tmpOutput.shift();
- dump("request to '" + response.name + "' finished\n");
- if (shouldRetry(response)) {
- inHosts.push(response);
- } else {
- outStatuses.push(response);
- }
-
- if (inHosts.length > 0) {
- let host = inHosts.shift();
- dump("[" + procCount + "] spinning off request to '" + host.name + "' (remaining retries: " +
- host.retries + ")\n");
- getHSTSStatus(host, tmpOutput);
- }
- }
-}
-
-// Since all events are processed on the main thread, and since event
-// handlers are not preemptible, there shouldn't be any concurrency issues.
-function waitForAResponse(outputList) {
- // From <https://developer.mozilla.org/en/XPConnect/xpcshell/HOWTO>
- var threadManager = Cc["@mozilla.org/thread-manager;1"]
- .getService(Ci.nsIThreadManager);
- var mainThread = threadManager.currentThread;
- while (outputList.length == 0) {
- mainThread.processNextEvent(true);
- }
-}
-
-function readCurrentList(filename) {
- var currentHosts = {};
- var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
- file.initWithPath(filename);
- var fis = Cc["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Ci.nsILineInputStream);
- fis.init(file, -1, -1, Ci.nsIFileInputStream.CLOSE_ON_EOF);
- var line = {};
- var entryRegex = / { "([^"]*)", (true|false) },/;
- while (fis.readLine(line)) {
- var match = entryRegex.exec(line.value);
- if (match) {
- currentHosts[match[1]] = (match[2] == "true");
- }
- }
- return currentHosts;
-}
-
-function combineLists(newHosts, currentHosts) {
- let newHostsSet = new Set();
-
- for (let newHost of newHosts) {
- newHostsSet.add(newHost.name);
- }
-
- for (let currentHost in currentHosts) {
- if (!newHostsSet.has(currentHost)) {
- newHosts.push({ name: currentHost, retries: MAX_RETRIES });
- }
- }
-}
-
-const TEST_ENTRIES = [
- { name: "includesubdomains.preloaded.test", includeSubdomains: true },
- { name: "includesubdomains2.preloaded.test", includeSubdomains: true },
- { name: "noincludesubdomains.preloaded.test", includeSubdomains: false },
-];
-
-function deleteTestHosts(currentHosts) {
- for (let testEntry of TEST_ENTRIES) {
- delete currentHosts[testEntry.name];
- }
-}
-
-function insertTestHosts(hstsStatuses) {
- for (let testEntry of TEST_ENTRIES) {
- hstsStatuses.push({
- name: testEntry.name,
- maxAge: MINIMUM_REQUIRED_MAX_AGE,
- includeSubdomains: testEntry.includeSubdomains,
- error: ERROR_NONE,
- // This deliberately doesn't have a value for `retries` (because we should
- // never attempt to connect to this host).
- forceInclude: true,
- originalIncludeSubdomains: testEntry.includeSubdomains,
- });
- }
-}
-
-// ****************************************************************************
-// This is where the action happens:
-if (arguments.length != 1) {
- throw new Error("Usage: getHSTSPreloadList.js " +
- "<absolute path to current nsSTSPreloadList.inc>");
-}
-// get the current preload list
-var currentHosts = readCurrentList(arguments[0]);
-// delete any hosts we use in tests so we don't actually connect to them
-deleteTestHosts(currentHosts);
-// disable the current preload list so it won't interfere with requests we make
-Services.prefs.setBoolPref("network.stricttransportsecurity.preloadlist", false);
-// download and parse the raw json file from the Chromium source
-var rawdata = download();
-// get just the hosts with mode: "force-https"
-var hosts = getHosts(rawdata);
-// add hosts in the current list to the new list (avoiding duplicates)
-combineLists(hosts, currentHosts);
-// get the HSTS status of each host
-var hstsStatuses = [];
-getHSTSStatuses(hosts, hstsStatuses);
-// add the hosts we use in tests
-insertTestHosts(hstsStatuses);
-// sort the hosts alphabetically
-hstsStatuses.sort(compareHSTSStatus);
-// write the results to a file (this is where we filter out hosts that we
-// either couldn't connect to, didn't receive an HSTS header from, couldn't
-// parse the header, or had a header with too short a max-age)
-output(hstsStatuses, currentHosts);
-// ****************************************************************************
diff --git a/security/nss/coreconf/SunOS5.mk b/security/nss/coreconf/SunOS5.mk
index ce9e2cbb9..08956ca24 100644
--- a/security/nss/coreconf/SunOS5.mk
+++ b/security/nss/coreconf/SunOS5.mk
@@ -65,7 +65,7 @@ endif
RANLIB = echo
CPU_ARCH = sparc
-OS_DEFINES += -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -D_REENTRANT
+OS_DEFINES += -DSVR4 -DSYSV -D__svr4 -D__svr4__ -DSOLARIS -D_REENTRANT -D__EXTENSIONS__
ifeq ($(OS_TEST),i86pc)
ifeq ($(USE_64),1)
diff --git a/services/sync/moz.build b/services/sync/moz.build
index 56421a03e..3c19a007d 100644
--- a/services/sync/moz.build
+++ b/services/sync/moz.build
@@ -9,11 +9,8 @@ DIRS += ['locales']
XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
EXTRA_COMPONENTS += [
- 'Weave.js',
-]
-
-EXTRA_PP_COMPONENTS += [
'SyncComponents.manifest',
+ 'Weave.js',
]
EXTRA_JS_MODULES['services-sync'] += [
diff --git a/storage/SQLiteMutex.h b/storage/SQLiteMutex.h
index a38525fd6..eaa69eab1 100644
--- a/storage/SQLiteMutex.h
+++ b/storage/SQLiteMutex.h
@@ -50,7 +50,7 @@ public:
mMutex = aMutex;
}
-#if !defined(DEBUG) || defined(MOZ_SYSTEM_SQLITE)
+#if !defined(DEBUG)
/**
* Acquires the mutex.
*/
diff --git a/storage/moz.build b/storage/moz.build
index 5ccfabd71..2d30a85ec 100644
--- a/storage/moz.build
+++ b/storage/moz.build
@@ -100,10 +100,6 @@ if CONFIG['MOZ_MEMORY']:
DEFINES['SQLITE_MAX_LIKE_PATTERN_LENGTH'] = 50000
# See Sqlite moz.build for reasoning about TEMP_STORE.
-# For system sqlite we cannot use the compile time option, so we use a pragma.
-if CONFIG['MOZ_SYSTEM_SQLITE'] and (CONFIG['OS_TARGET'] == 'Android'
- or CONFIG['HAVE_64BIT_BUILD']):
- DEFINES['MOZ_MEMORY_TEMP_STORE_PRAGMA'] = True
LOCAL_INCLUDES += [
'/db/sqlite3/src',
diff --git a/storage/mozStorageConnection.cpp b/storage/mozStorageConnection.cpp
index 10297fca1..e6c357185 100644
--- a/storage/mozStorageConnection.cpp
+++ b/storage/mozStorageConnection.cpp
@@ -1955,10 +1955,6 @@ Connection::RemoveProgressHandler(mozIStorageProgressHandler **_oldHandler)
NS_IMETHODIMP
Connection::SetGrowthIncrement(int32_t aChunkSize, const nsACString &aDatabaseName)
{
- // Bug 597215: Disk space is extremely limited on Android
- // so don't preallocate space. This is also not effective
- // on log structured file systems used by Android devices
-#if !defined(ANDROID) && !defined(MOZ_PLATFORM_MAEMO)
// Don't preallocate if less than 500MiB is available.
int64_t bytesAvailable;
nsresult rv = mDatabaseFile->GetDiskSpaceAvailable(&bytesAvailable);
@@ -1972,7 +1968,7 @@ Connection::SetGrowthIncrement(int32_t aChunkSize, const nsACString &aDatabaseNa
: nullptr,
SQLITE_FCNTL_CHUNK_SIZE,
&aChunkSize);
-#endif
+
return NS_OK;
}
diff --git a/testing/gtest/moz.build b/testing/gtest/moz.build
index d409023ec..f824cde88 100644
--- a/testing/gtest/moz.build
+++ b/testing/gtest/moz.build
@@ -77,9 +77,4 @@ if CONFIG['ENABLE_TESTS']:
'gtest/include',
]
- if CONFIG['OS_ARCH'] == 'WINNT':
- LOCAL_INCLUDES += [
- '/security/sandbox/chromium',
- ]
-
FINAL_LIBRARY = 'xul-gtest'
diff --git a/testing/marionette/cert.js b/testing/marionette/cert.js
index c0b24d23b..e54129c57 100644
--- a/testing/marionette/cert.js
+++ b/testing/marionette/cert.js
@@ -134,7 +134,6 @@ cert.InsecureSweepingOverride = function() {
// clear collected HSTS and HPKP state
// through the site security service
sss.clearAll();
- sss.clearPreloads();
},
};
};
diff --git a/testing/mochitest/runtests.py b/testing/mochitest/runtests.py
index dd5439bd1..6763952af 100644
--- a/testing/mochitest/runtests.py
+++ b/testing/mochitest/runtests.py
@@ -1678,11 +1678,6 @@ toolbar#nav-bar {
prefs.update(self.extraPrefs(options.extraPrefs))
- # Bug 1262954: For windows XP + e10s disable acceleration
- if platform.system() in ("Windows", "Microsoft") and \
- '5.1' in platform.version() and options.e10s:
- prefs['layers.acceleration.disabled'] = True
-
# interpolate preferences
interpolation = {
"server": "%s:%s" %
diff --git a/testing/mozharness/configs/unittests/linux_unittest.py b/testing/mozharness/configs/unittests/linux_unittest.py
index 77e4ed501..b591fa559 100644
--- a/testing/mozharness/configs/unittests/linux_unittest.py
+++ b/testing/mozharness/configs/unittests/linux_unittest.py
@@ -222,7 +222,8 @@ config = {
},
"reftest-no-accel": {
"options": ["--suite=reftest",
- "--setpref=layers.acceleration.force-enabled=disabled"],
+ "--setpref=layers.acceleration.enabled=disabled",
+ "--setpref=layers.acceleration.force=disabled"],
"tests": ["tests/reftest/tests/layout/reftests/reftest.list"]},
},
"all_xpcshell_suites": {
diff --git a/testing/mozharness/configs/unittests/win_taskcluster_unittest.py b/testing/mozharness/configs/unittests/win_taskcluster_unittest.py
index 161e8e65e..2eeae22e2 100644
--- a/testing/mozharness/configs/unittests/win_taskcluster_unittest.py
+++ b/testing/mozharness/configs/unittests/win_taskcluster_unittest.py
@@ -204,7 +204,7 @@ config = {
"reftest-no-accel": {
"options": ["--suite=reftest",
"--setpref=gfx.direct2d.disabled=true",
- "--setpref=layers.acceleration.disabled=true"],
+ "--setpref=layers.acceleration.enabled=false"],
"tests": ["tests/reftest/tests/layout/reftests/reftest.list"]
},
},
diff --git a/testing/mozharness/configs/unittests/win_unittest.py b/testing/mozharness/configs/unittests/win_unittest.py
index caa2978c6..1f682cc8f 100644
--- a/testing/mozharness/configs/unittests/win_unittest.py
+++ b/testing/mozharness/configs/unittests/win_unittest.py
@@ -204,7 +204,7 @@ config = {
"reftest-no-accel": {
"options": ["--suite=reftest",
"--setpref=gfx.direct2d.disabled=true",
- "--setpref=layers.acceleration.disabled=true"],
+ "--setpref=layers.acceleration.enabled=false"],
"tests": ["tests/reftest/tests/layout/reftests/reftest.list"]
},
},
diff --git a/testing/talos/talos/test.py b/testing/talos/talos/test.py
index dc1306b8e..6df5835bb 100644
--- a/testing/talos/talos/test.py
+++ b/testing/talos/talos/test.py
@@ -556,8 +556,8 @@ class basic_compositor_video(PageloaderTest):
sps_profile_interval = 1
sps_profile_entries = 2000000
preferences = {'full-screen-api.allow-trusted-requests-only': False,
- 'layers.acceleration.force-enabled': False,
- 'layers.acceleration.disabled': True,
+ 'layers.acceleration.force': False,
+ 'layers.acceleration.enabled': False,
'layout.frame_rate': 0,
'docshell.event_starvation_delay_hint': 1,
'full-screen-api.warning.timeout': 500,
diff --git a/testing/talos/talos/ttest.py b/testing/talos/talos/ttest.py
index 4a0fcd135..3c57f020d 100644
--- a/testing/talos/talos/ttest.py
+++ b/testing/talos/talos/ttest.py
@@ -64,7 +64,7 @@ class TTest(object):
# Bug 1262954: winxp + e10s, disable hwaccel
if self.platform_type == "win_" and browser_config['e10s']:
prefs = browser_config['preferences']
- prefs['layers.acceleration.disabled'] = True
+ prefs['layers.acceleration.enabled'] = False
with FFSetup(browser_config, test_config) as setup:
return self._runTest(browser_config, test_config, setup)
diff --git a/testing/testsuite-targets.mk b/testing/testsuite-targets.mk
index ebe0d06cf..f10bd079c 100644
--- a/testing/testsuite-targets.mk
+++ b/testing/testsuite-targets.mk
@@ -60,11 +60,11 @@ RUN_REFTEST_B2G = rm -f ./$@.log && $(PYTHON) _tests/reftest/runreftestb2g.py \
ifeq ($(OS_ARCH),WINNT) #{
# GPU-rendered shadow layers are unsupported here
-OOP_CONTENT = --setpref=layers.async-pan-zoom.enabled=true --setpref=browser.tabs.remote.autostart=true --setpref=layers.acceleration.disabled=true
+OOP_CONTENT = --setpref=layers.async-pan-zoom.enabled=true --setpref=browser.tabs.remote.autostart=true --setpref=layers.acceleration.enabled=false
GPU_RENDERING =
else
OOP_CONTENT = --setpref=layers.async-pan-zoom.enabled=true --setpref=browser.tabs.remote.autostart=true
-GPU_RENDERING = --setpref=layers.acceleration.force-enabled=true
+GPU_RENDERING = --setpref=layers.acceleration.enabled=true --setpref=layers.acceleration.force=true
endif #}
reftest: TEST_PATH?=layout/reftests/reftest.list
diff --git a/testing/web-platform/harness/wptrunner/browsers/firefox.py b/testing/web-platform/harness/wptrunner/browsers/firefox.py
index 183820c5c..c03dd0eda 100644
--- a/testing/web-platform/harness/wptrunner/browsers/firefox.py
+++ b/testing/web-platform/harness/wptrunner/browsers/firefox.py
@@ -142,11 +142,6 @@ class FirefoxBrowser(Browser):
if self.e10s:
self.profile.set_preferences({"browser.tabs.remote.autostart": True})
- # Bug 1262954: winxp + e10s, disable hwaccel
- if (self.e10s and platform.system() in ("Windows", "Microsoft") and
- '5.1' in platform.version()):
- self.profile.set_preferences({"layers.acceleration.disabled": True})
-
if self.ca_certificate_path is not None:
self.setup_ssl()
diff --git a/testing/web-platform/meta/MANIFEST.json b/testing/web-platform/meta/MANIFEST.json
index 03dda4a1f..4dbbdf43e 100644
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -15394,6 +15394,10 @@
"url": "/dom/events/EventTarget-removeEventListener.html"
},
{
+ "path": "dom/events/event-disabled-dynamic.html",
+ "url": "/dom/events/event-disabled-dynamic.html"
+ },
+ {
"path": "dom/events/ProgressEvent.html",
"url": "/dom/events/ProgressEvent.html"
},
diff --git a/testing/web-platform/tests/dom/events/event-disabled-dynamic.html b/testing/web-platform/tests/dom/events/event-disabled-dynamic.html
new file mode 100644
index 000000000..89a3d3b15
--- /dev/null
+++ b/testing/web-platform/tests/dom/events/event-disabled-dynamic.html
@@ -0,0 +1,21 @@
+<!doctype html>
+<meta charset=utf-8>
+<title>Test that disabled is honored immediately in presence of dynamic changes</title>
+<link rel="author" title="Emilio Cobos Ãlvarez" href="mailto:emilio@crisal.io">
+<link rel="author" title="Andreas Farre" href="mailto:afarre@mozilla.com">
+<link rel="help" href="https://html.spec.whatwg.org/multipage/#enabling-and-disabling-form-controls:-the-disabled-attribute">
+<link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1405087">
+<script src=/resources/testharness.js></script>
+<script src=/resources/testharnessreport.js></script>
+<input type="button" value="Click" disabled>
+<script>
+async_test(t => {
+ window.addEventListener('load', t.step_func(() => {
++
+− let e = document.querySelector('input');
+ e.disabled = false;
+ e.onclick = t.step_func_done(() => {});
+ e.click();
+ }));
+}, "disabled is honored properly in presence of dynamic changes");
+</script>
diff --git a/toolkit/components/aboutcheckerboard/moz.build b/toolkit/components/aboutcheckerboard/moz.build
index 91d6e9662..eb4454d28 100644
--- a/toolkit/components/aboutcheckerboard/moz.build
+++ b/toolkit/components/aboutcheckerboard/moz.build
@@ -4,7 +4,4 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-JAR_MANIFESTS += ['jar.mn']
-
-with Files('**'):
- BUG_COMPONENT = ('Core', 'Panning and Zooming')
+JAR_MANIFESTS += ['jar.mn'] \ No newline at end of file
diff --git a/toolkit/components/aboutmemory/content/aboutMemory.css b/toolkit/components/aboutmemory/content/aboutMemory.css
index b63bbac13..cf4d36de8 100644
--- a/toolkit/components/aboutmemory/content/aboutMemory.css
+++ b/toolkit/components/aboutmemory/content/aboutMemory.css
@@ -2,12 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-/*
- * The version used for mobile is located at
- * mobile/android/themes/core/aboutMemory.css.
- * Desktop-specific stuff is at the bottom of this file.
- */
-
html {
background: -moz-Dialog;
font: message-box;
diff --git a/toolkit/components/aboutmemory/moz.build b/toolkit/components/aboutmemory/moz.build
index dd3f71d8c..aac3a838c 100644
--- a/toolkit/components/aboutmemory/moz.build
+++ b/toolkit/components/aboutmemory/moz.build
@@ -4,9 +4,4 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini']
-
JAR_MANIFESTS += ['jar.mn']
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'about:memory')
diff --git a/toolkit/components/aboutmemory/tests/.eslintrc.js b/toolkit/components/aboutmemory/tests/.eslintrc.js
deleted file mode 100644
index 2c669d844..000000000
--- a/toolkit/components/aboutmemory/tests/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/aboutmemory/tests/chrome.ini b/toolkit/components/aboutmemory/tests/chrome.ini
deleted file mode 100644
index c25bc30a0..000000000
--- a/toolkit/components/aboutmemory/tests/chrome.ini
+++ /dev/null
@@ -1,28 +0,0 @@
-[DEFAULT]
-skip-if = os == 'android'
-support-files =
- crash-dump-diff1.json
- crash-dump-diff2.json
- crash-dump-good.json
- memory-reports-bad.json
- memory-reports-diff1.json
- memory-reports-diff2.json
- memory-reports-good.json
- remote.xul
-
-[test_aboutmemory.xul]
-subsuite = clipboard
-[test_aboutmemory2.xul]
-subsuite = clipboard
-[test_aboutmemory3.xul]
-subsuite = clipboard
-[test_aboutmemory4.xul]
-subsuite = clipboard
-[test_aboutmemory5.xul]
-subsuite = clipboard
-skip-if = asan # Bug 1116230
-[test_aboutmemory6.xul]
-[test_memoryReporters.xul]
-[test_memoryReporters2.xul]
-[test_sqliteMultiReporter.xul]
-[test_dumpGCAndCCLogsToFile.xul]
diff --git a/toolkit/components/aboutmemory/tests/crash-dump-diff1.json b/toolkit/components/aboutmemory/tests/crash-dump-diff1.json
deleted file mode 100644
index d41bbcc61..000000000
--- a/toolkit/components/aboutmemory/tests/crash-dump-diff1.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "foo": 1,
- "blah": 2,
- "memory_report": {
- "version": 1,
- "hasMozMallocUsableSize": true,
- "reports": [
- {"process": "Main Process (pid NNN)", "path": "heap-allocated", "kind": 2, "units": 0, "amount": 262144000, "description": "Heap allocated."}
- ]
- }
-}
diff --git a/toolkit/components/aboutmemory/tests/crash-dump-diff2.json b/toolkit/components/aboutmemory/tests/crash-dump-diff2.json
deleted file mode 100644
index 8f9451f62..000000000
--- a/toolkit/components/aboutmemory/tests/crash-dump-diff2.json
+++ /dev/null
@@ -1,11 +0,0 @@
-{
- "foo": 3,
- "blah": 4,
- "memory_report": {
- "version": 1,
- "hasMozMallocUsableSize": true,
- "reports": [
- {"process": "Main Process (pid NNN)", "path": "heap-allocated", "kind": 2, "units": 0, "amount": 262144001, "description": "Heap allocated."}
- ]
- }
-}
diff --git a/toolkit/components/aboutmemory/tests/crash-dump-good.json b/toolkit/components/aboutmemory/tests/crash-dump-good.json
deleted file mode 100644
index 6bee54d59..000000000
--- a/toolkit/components/aboutmemory/tests/crash-dump-good.json
+++ /dev/null
@@ -1,14 +0,0 @@
-{
- "foo": 1,
- "blah": 2,
- "memory_report": {
- "version": 1,
- "hasMozMallocUsableSize": true,
- "reports": [
- {"process": "Main Process (pid NNN)", "path": "heap-allocated", "kind": 2, "units": 0, "amount": 262144000, "description": "Heap allocated."},
- {"process": "Main Process (pid NNN)", "path": "other/b", "kind": 2, "units": 0, "amount": 104857, "description": "Other b."},
- {"process": "Main Process (pid NNN)", "path": "other/a", "kind": 2, "units": 0, "amount": 209715, "description": "Other a."},
- {"process": "Main Process (pid NNN)", "path": "explicit/a/b", "kind": 1, "units": 0, "amount": 52428800, "description": "A b."}
- ]
- }
-}
diff --git a/toolkit/components/aboutmemory/tests/memory-reports-bad.json b/toolkit/components/aboutmemory/tests/memory-reports-bad.json
deleted file mode 100644
index 61a2092b1..000000000
--- a/toolkit/components/aboutmemory/tests/memory-reports-bad.json
+++ /dev/null
@@ -1,3 +0,0 @@
-{
- "version": 1
-}
diff --git a/toolkit/components/aboutmemory/tests/memory-reports-diff1.json b/toolkit/components/aboutmemory/tests/memory-reports-diff1.json
deleted file mode 100644
index 0bfe0b26b..000000000
--- a/toolkit/components/aboutmemory/tests/memory-reports-diff1.json
+++ /dev/null
@@ -1,45 +0,0 @@
-{
- "version": 1,
- "hasMozMallocUsableSize": true,
- "reports": [
- {"process": "P", "path": "explicit/xpcom/category-manager", "kind": 1, "units": 0, "amount": 56848, "description": "Desc."},
- {"process": "P", "path": "explicit/storage/prefixset/goog-phish-shavar", "kind": 1, "units": 0, "amount": 680000, "description": "Desc."},
-
- {"process": "P", "path": "explicit/spell-check", "kind": 1, "units": 0, "amount": 4, "description": "Desc."},
- {"process": "P", "path": "explicit/spell-check", "kind": 1, "units": 0, "amount": 5, "description": "Desc."},
-
- {"process": "P", "path": "page-faults-soft", "kind": 2, "units": 2, "amount": 61013, "description": "Desc."},
-
- {"process": "P", "path": "foobar", "kind": 2, "units": 0, "amount": 100, "description": "Desc."},
- {"process": "P", "path": "zero1", "kind": 2, "units": 0, "amount": 0, "description": "Desc."},
-
- {"process": "P", "path": "a/b", "kind": 2, "units": 0, "amount": 1000000, "description": "Desc."},
- {"process": "P", "path": "a/c/d", "kind": 2, "units": 0, "amount": 2000000, "description": "Desc."},
- {"process": "P", "path": "a/c/e", "kind": 2, "units": 0, "amount": 2000000, "description": "Desc."},
- {"process": "P", "path": "a/c/f", "kind": 2, "units": 0, "amount": 3000000, "description": "Desc."},
- {"process": "P", "path": "a/c/g", "kind": 2, "units": 0, "amount": 3000000, "description": "Desc."},
- {"process": "P", "path": "a/h", "kind": 2, "units": 0, "amount": 1000, "description": "Desc."},
-
- {"process": "P2 (pid 22)", "path": "p1 (pid 123)", "kind": 2, "units": 0, "amount": 33, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "p2 (blah, pid=123)", "kind": 2, "units": 0, "amount": 33, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "p3/zone(0x1234)/p3", "kind": 2, "units": 0, "amount": 33, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "p4/js-zone(0x1234)/p4", "kind": 2, "units": 0, "amount": 33, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "p5/worker(foo.com, 0x1234)/p5", "kind": 2, "units": 0, "amount": 33, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "explicit/window-objects/top(bar.com, id=123)/...", "kind": 0, "units": 0, "amount": 33, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "p6/z-moz-nullprincipal:{85e250f3-57ae-46c4-a11e-4176dd39d9c5}/p6", "kind": 2, "units": 0, "amount": 33, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "p7/js-main-runtime-compartments/system/jar:file:\\\\\\temp_xyz\\firefox\\omni.ja!/p7", "kind": 2, "units": 0, "amount": 33, "description": "Desc."},
-
- {"process": "P3", "path": "p3", "kind": 2, "units": 0, "amount": 55, "description": "Desc."},
-
- {"process": "P5", "path": "p5", "kind": 2, "units": 0, "amount": 0, "description": "Desc."},
-
- {"process": "P7", "path": "p7", "kind": 2, "units": 0, "amount": 5, "description": "Desc."},
-
- {"process": "P8", "path": "p8/a/b/c/d", "kind": 2, "units": 0, "amount": 3, "description": "Desc."},
- {"process": "P8", "path": "p8/a/b/c/e", "kind": 2, "units": 0, "amount": 4, "description": "Desc."},
- {"process": "P8", "path": "p8/a/b/f", "kind": 2, "units": 0, "amount": 5, "description": "Desc."},
- {"process": "P8", "path": "p8/a/g/h", "kind": 2, "units": 0, "amount": 6, "description": "Desc."},
- {"process": "P8", "path": "p8/a/g/i", "kind": 2, "units": 0, "amount": 7, "description": "Desc."}
- ]
-}
-
diff --git a/toolkit/components/aboutmemory/tests/memory-reports-diff2.json b/toolkit/components/aboutmemory/tests/memory-reports-diff2.json
deleted file mode 100644
index e2ef4caa7..000000000
--- a/toolkit/components/aboutmemory/tests/memory-reports-diff2.json
+++ /dev/null
@@ -1,44 +0,0 @@
-{
- "version": 1,
- "hasMozMallocUsableSize": true,
- "reports": [
- {"process": "P", "path": "explicit/xpcom/category-manager", "kind": 1, "units": 0, "amount": 56849, "description": "Desc."},
- {"process": "P", "path": "explicit/storage/prefixset/goog-phish-shavar", "kind": 1, "units": 0, "amount": 670000, "description": "Desc."},
-
- {"process": "P", "path": "explicit/spell-check", "kind": 1, "units": 0, "amount": 3, "description": "Desc."},
-
- {"process": "P", "path": "page-faults-soft", "kind": 2, "units": 2, "amount": 61013, "description": "Desc."},
-
- {"process": "P", "path": "canvas-2d-pixel-bytes", "kind": 2, "units": 0, "amount": 1000, "description": "Desc."},
- {"process": "P", "path": "canvas-2d-pixel-bytes", "kind": 2, "units": 0, "amount": 2000, "description": "Desc."},
-
- {"process": "P", "path": "foobaz", "kind": 2, "units": 0, "amount": 0, "description": "Desc."},
-
- {"process": "P", "path": "a/b", "kind": 2, "units": 0, "amount": 2000000, "description": "Desc."},
- {"process": "P", "path": "a/c/d", "kind": 2, "units": 0, "amount": 2998000, "description": "Desc."},
- {"process": "P", "path": "a/c/e", "kind": 2, "units": 0, "amount": 1001000, "description": "Desc."},
- {"process": "P", "path": "a/c/f", "kind": 2, "units": 0, "amount": 3001000, "description": "Desc."},
- {"process": "P", "path": "a/c/g", "kind": 2, "units": 0, "amount": 3001000, "description": "Desc."},
- {"process": "P", "path": "a/h", "kind": 2, "units": 0, "amount": 2000, "description": "Desc."},
-
- {"process": "P2 (pid 22)", "path": "p1 (pid 456)", "kind": 2, "units": 0, "amount": 44, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "p2 (blah, pid=456)", "kind": 2, "units": 0, "amount": 44, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "p3/zone(0x5678)/p3", "kind": 2, "units": 0, "amount": 44, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "p4/js-zone(0x5678)/p4", "kind": 2, "units": 0, "amount": 44, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "p5/worker(foo.com, 0x5678)/p5", "kind": 2, "units": 0, "amount": 44, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "explicit/window-objects/top(bar.com, id=456)/...", "kind": 0, "units": 0, "amount": 44, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "p6/z-moz-nullprincipal:{161effaa-c1f7-4010-a08e-e7c9aea01aed}/p6", "kind": 2, "units": 0, "amount": 44, "description": "Desc."},
- {"process": "P2 (pid 22)", "path": "p7/js-main-runtime-compartments/system/jar:file:\\\\\\temp_abc\\firefox\\omni.ja!/p7", "kind": 2, "units": 0, "amount": 44, "description": "Desc."},
-
- {"process": "P4", "path": "p4", "kind": 2, "units": 0, "amount": 66, "description": "Desc."},
-
- {"process": "P6", "path": "p6", "kind": 2, "units": 0, "amount": 0, "description": "Desc."},
-
- {"process": "P7", "path": "p7/b", "kind": 2, "units": 0, "amount": 3, "description": "Desc."},
- {"process": "P7", "path": "p7/c", "kind": 2, "units": 0, "amount": 4, "description": "Desc."},
-
- {"process": "P8", "path": "p8/a/b", "kind": 2, "units": 0, "amount": 1, "description": "Desc."},
- {"process": "P8", "path": "p8/a/g", "kind": 2, "units": 0, "amount": 2, "description": "Desc."}
- ]
-}
-
diff --git a/toolkit/components/aboutmemory/tests/memory-reports-good.json b/toolkit/components/aboutmemory/tests/memory-reports-good.json
deleted file mode 100644
index 013b4b125..000000000
--- a/toolkit/components/aboutmemory/tests/memory-reports-good.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
- "version": 1,
- "hasMozMallocUsableSize": true,
- "reports": [
- {"process": "Main Process (pid NNN)", "path": "heap-allocated", "kind": 2, "units": 0, "amount": 262144000, "description": "Heap allocated."},
- {"process": "Main Process (pid NNN)", "path": "other/b", "kind": 2, "units": 0, "amount": 104857, "description": "Other b."},
- {"process": "Main Process (pid NNN)", "path": "other/a", "kind": 2, "units": 0, "amount": 209715, "description": "Other a."},
- {"process": "Main Process (pid NNN)", "path": "explicit/a/b", "kind": 1, "units": 0, "amount": 52428800, "description": "A b."},
-
- {"process": "Main Process (pid NNN)", "path": "size/a", "kind": 1, "units": 0, "amount": 1024, "description": "non-sentence"},
- {"process": "Main Process (pid NNN)", "path": "rss/a", "kind": 1, "units": 0, "amount": 1024, "description": "non-sentence"},
- {"process": "Main Process (pid NNN)", "path": "pss/a", "kind": 1, "units": 0, "amount": 1024, "description": "non-sentence"},
- {"process": "Main Process (pid NNN)", "path": "swap/a", "kind": 1, "units": 0, "amount": 1024, "description": "non-sentence"},
- {"process": "Main Process (pid NNN)", "path": "compartments/system/a", "kind": 1, "units": 0, "amount": 1024, "description": ""},
- {"process": "Main Process (pid NNN)", "path": "ghost-windows/a", "kind": 1, "units": 0, "amount": 1024, "description": ""},
-
- {"process": "Main Process (pid NNN)", "path": "redundant/should-be-ignored", "kind": 1, "units": 0, "amount": 1024, "description": ""},
-
- {"process": "Heap-unclassified process", "path": "heap-allocated", "kind": 2, "units": 0, "amount": 262144000, "description": "Heap allocated."},
- {"process": "Heap-unclassified process", "path": "explicit/a/b", "kind": 1, "units": 0, "amount": 52428800, "description": "A b."},
- {"process": "Heap-unclassified process", "path": "explicit/heap-unclassified", "kind": 1, "units": 0, "amount": 209715200, "description": "Heap unclassified"},
-
- {"process": "Explicit-only process", "path": "explicit/a/b", "kind": 1, "units": 0, "amount": 100000, "description": "A b."},
-
- {"process": "Other-only process", "path": "a/b", "kind": 1, "units": 0, "amount": 100000, "description": "A b."},
- {"process": "Other-only process", "path": "a/c", "kind": 1, "units": 0, "amount": 100000, "description": "A c."},
- {"process": "Other-only process", "path": "heap-allocated", "kind": 1, "units": 0, "amount": 500000, "description": "D."}
- ]
-}
diff --git a/toolkit/components/aboutmemory/tests/remote.xul b/toolkit/components/aboutmemory/tests/remote.xul
deleted file mode 100644
index 7d6910130..000000000
--- a/toolkit/components/aboutmemory/tests/remote.xul
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Remote browser"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <!-- test results are displayed in the html:body -->
- <p>Remote browser</p>
-
- <browser type="content" src="about:blank" id="remote" remote="true"/>
-</window>
diff --git a/toolkit/components/aboutmemory/tests/test_aboutmemory.xul b/toolkit/components/aboutmemory/tests/test_aboutmemory.xul
deleted file mode 100644
index bfeab4c7b..000000000
--- a/toolkit/components/aboutmemory/tests/test_aboutmemory.xul
+++ /dev/null
@@ -1,602 +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 uses fake memory reporters to test the presentation of memory
- reports in about:memory. test_memoryReporters.xul uses the real
- memory reporters to test whether the memory reporters are producing
- sensible results. -->
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml"></body>
-
- <!-- test code goes here -->
- <script type="application/javascript">
- <![CDATA[
- "use strict";
-
- SimpleTest.expectAssertions(27);
-
- const Cc = Components.classes;
- const Ci = Components.interfaces;
- const Cr = Components.results;
- let mgr = Cc["@mozilla.org/memory-reporter-manager;1"].
- getService(Ci.nsIMemoryReporterManager);
-
- // Hide all the real reporters; we'll restore them at the end.
- mgr.blockRegistrationAndHideExistingReporters();
-
- // Setup various fake-but-deterministic reporters.
- const KB = 1024;
- const MB = KB * KB;
- const NONHEAP = Ci.nsIMemoryReporter.KIND_NONHEAP;
- const HEAP = Ci.nsIMemoryReporter.KIND_HEAP;
- const OTHER = Ci.nsIMemoryReporter.KIND_OTHER;
-
- const BYTES = Ci.nsIMemoryReporter.UNITS_BYTES;
- const COUNT = Ci.nsIMemoryReporter.UNITS_COUNT;
- const COUNT_CUMULATIVE = Ci.nsIMemoryReporter.UNITS_COUNT_CUMULATIVE;
- const PERCENTAGE = Ci.nsIMemoryReporter.UNITS_PERCENTAGE;
-
- let fakeReporters = [
- { collectReports: function(aCbObj, aClosure, aAnonymize) {
- function f(aP, aK, aU, aA) {
- aCbObj.callback("", aP, aK, aU, aA, "Desc.", aClosure);
- }
- f("heap-allocated", OTHER, BYTES, 500 * MB);
- f("heap-unallocated", OTHER, BYTES, 100 * MB);
- f("explicit/a", HEAP, BYTES, 222 * MB);
- f("explicit/b/a", HEAP, BYTES, 85 * MB);
- f("explicit/b/b", HEAP, BYTES, 75 * MB);
- f("explicit/b/c/a", HEAP, BYTES, 70 * MB);
- f("explicit/b/c/b", HEAP, BYTES, 2 * MB); // omitted
- f("explicit/g/a", HEAP, BYTES, 6 * MB);
- f("explicit/g/b", HEAP, BYTES, 5 * MB);
- f("explicit/g/other", HEAP, BYTES, 4 * MB);
- // A degenerate tree with the same name as a non-degenerate tree should
- // work ok.
- f("explicit", OTHER, BYTES, 888 * MB);
- f("other1/a/b", OTHER, BYTES, 111 * MB);
- f("other1/c/d", OTHER, BYTES, 22 * MB);
- f("other1/c/e", OTHER, BYTES, 33 * MB);
- f("other4", OTHER, COUNT_CUMULATIVE, 777);
- f("other4", OTHER, COUNT_CUMULATIVE, 111);
- f("other3/a/b/c/d/e", OTHER, PERCENTAGE, 2000);
- f("other3/a/b/c/d/f", OTHER, PERCENTAGE, 10);
- f("other3/a/b/c/d/g", OTHER, PERCENTAGE, 5);
- f("other3/a/b/c/d/g", OTHER, PERCENTAGE, 5);
- // Check that a rounded-up-to-100.00% value is shown as "100.0%" (i.e. one
- // decimal point).
- f("other6/big", OTHER, COUNT, 99999);
- f("other6/small", OTHER, COUNT, 1);
- // Check that a 0 / 0 is handled correctly.
- f("other7/zero", OTHER, BYTES, 0);
- // These compartments ones shouldn't be displayed.
- f("compartments/user/foo", OTHER, COUNT, 1);
- f("compartments/system/foo", OTHER, COUNT, 1);
- }
- },
- { collectReports: function(aCbObj, aClosure, aAnonymize) {
- function f(aP, aK, aU, aA) {
- aCbObj.callback("", aP, aK, aU, aA, "Desc.", aClosure);
- }
- f("explicit/c/d", NONHEAP, BYTES, 13 * MB);
- f("explicit/c/d", NONHEAP, BYTES, 10 * MB); // dup
- f("explicit/c/other", NONHEAP, BYTES, 77 * MB);
- f("explicit/cc", NONHEAP, BYTES, 13 * MB);
- f("explicit/cc", NONHEAP, BYTES, 10 * MB); // dup
- f("explicit/d", NONHEAP, BYTES, 499 * KB); // omitted
- f("explicit/e", NONHEAP, BYTES, 100 * KB); // omitted
- f("explicit/f/g/h/i", HEAP, BYTES, 10 * MB);
- f("explicit/f/g/h/j", HEAP, BYTES, 10 * MB);
- }
- },
- { collectReports: function(aCbObj, aClosure, aAnonymize) {
- function f(aP, aK, aU, aA) {
- aCbObj.callback("", aP, aK, aU, aA, "Desc.", aClosure);
- }
- f("other3", OTHER, COUNT, 777);
- f("other2", OTHER, BYTES, 222 * MB);
- f("perc2", OTHER, PERCENTAGE, 10000);
- f("perc1", OTHER, PERCENTAGE, 4567);
- f("compartments/user/https:\\\\very-long-url.com\\very-long\\oh-so-long\\really-quite-long.html?a=2&b=3&c=4&d=5&e=abcdefghijklmnopqrstuvwxyz&f=123456789123456789123456789", OTHER, COUNT, 1);
- }
- },
- { collectReports: function(aCbObj, aClosure, aAnonymize) {
- function f(aP) {
- aCbObj.callback("", aP, OTHER, COUNT, 1, "Desc.", aClosure);
- }
- f("compartments/user/bar");
- f("compartments/system/bar");
- }
- }
- ];
- for (let i = 0; i < fakeReporters.length; i++) {
- mgr.registerStrongReporterEvenIfBlocked(fakeReporters[i]);
- }
-
- // The main process always comes first when we display about:memory. The
- // remaining processes are sorted by their |resident| values (starting with
- // the largest). Processes without a |resident| memory reporter are saved
- // for the end.
- let fakeReporters2 = [
- { collectReports: function(aCbObj, aClosure, aAnonymize) {
- function f(aP1, aP2, aK, aU, aA) {
- aCbObj.callback(aP1, aP2, aK, aU, aA, "Desc.", aClosure);
- }
- f("2nd", "heap-allocated", OTHER, BYTES,1000* MB);
- f("2nd", "heap-unallocated",OTHER, BYTES,100 * MB);
- f("2nd", "explicit/a/b/c", HEAP, BYTES,497 * MB);
- f("2nd", "explicit/a/b/c", HEAP, BYTES, 1 * MB); // dup: merge
- f("2nd", "explicit/a/b/c", HEAP, BYTES, 1 * MB); // dup: merge
- f("2nd", "explicit/flip\\the\\backslashes",
- HEAP, BYTES,200 * MB);
- f("2nd", "explicit/compartment(compartment-url)",
- HEAP, BYTES,200 * MB);
- f("2nd", "other0", OTHER, BYTES,666 * MB);
- f("2nd", "other1", OTHER, BYTES,111 * MB);
-
- // Check that we can handle "heap-allocated" not being present.
- f("3rd", "explicit/a/b", HEAP, BYTES,333 * MB);
- f("3rd", "explicit/a/c", HEAP, BYTES,444 * MB);
- f("3rd", "other1", OTHER, BYTES, 1 * MB);
- f("3rd", "resident", OTHER, BYTES,100 * MB);
-
- // Invalid values (negative, too-big) should be identified.
- f("4th", "heap-allocated", OTHER, BYTES,100 * MB);
- f("4th", "resident", OTHER, BYTES,200 * MB);
- f("4th", "explicit/js/compartment(http:\\\\too-big.com\\)/stuff",
- HEAP, BYTES,150 * MB);
- f("4th", "explicit/ok", HEAP, BYTES, 5 * MB);
- f("4th", "explicit/neg1", NONHEAP, BYTES, -2 * MB);
- // -111 becomes "-0.00MB" in non-verbose mode, and getting the negative
- // sign in there correctly is non-trivial.
- f("4th", "other1", OTHER, BYTES,-111);
- f("4th", "other2", OTHER, BYTES,-222 * MB);
- f("4th", "other3", OTHER, COUNT, -333);
- f("4th", "other4", OTHER, COUNT_CUMULATIVE, -444);
- f("4th", "other5", OTHER, PERCENTAGE, -555);
- f("4th", "other6", OTHER, PERCENTAGE, 66666);
-
- // If a negative value is within a collapsed sub-tree in non-verbose mode,
- // we should get the warning at the top and the relevant sub-trees should
- // be expanded, even in non-verbose mode.
- f("5th", "heap-allocated", OTHER, BYTES,100 * MB);
- f("5th", "explicit/big", HEAP, BYTES, 99 * MB);
- f("5th", "explicit/a/pos", HEAP, BYTES, 40 * KB);
- f("5th", "explicit/a/neg1", NONHEAP, BYTES,-20 * KB);
- f("5th", "explicit/a/neg2", NONHEAP, BYTES,-10 * KB);
- f("5th", "explicit/b/c/d/e", NONHEAP, BYTES, 20 * KB);
- f("5th", "explicit/b/c/d/f", NONHEAP, BYTES,-60 * KB);
- f("5th", "explicit/b/c/g/h", NONHEAP, BYTES, 10 * KB);
- f("5th", "explicit/b/c/i/j", NONHEAP, BYTES, 5 * KB);
- }
- }
- ];
- for (let i = 0; i < fakeReporters2.length; i++) {
- mgr.registerStrongReporterEvenIfBlocked(fakeReporters2[i]);
- }
- fakeReporters = fakeReporters.concat(fakeReporters2);
- ]]>
- </script>
-
- <iframe id="amFrame" height="300" src="about:memory"></iframe>
- <!-- vary the capitalization to make sure that works -->
- <iframe id="amvFrame" height="300" src="About:Memory"></iframe>
-
- <script type="application/javascript">
- <![CDATA[
- let amExpectedText =
-"\
-Main Process\n\
-Explicit Allocations\n\
-\n\
-623.58 MB (100.0%) -- explicit\n\
-├──232.00 MB (37.20%) -- b\n\
-│ ├───85.00 MB (13.63%) ── a\n\
-│ ├───75.00 MB (12.03%) ── b\n\
-│ └───72.00 MB (11.55%) -- c\n\
-│ ├──70.00 MB (11.23%) ── a\n\
-│ └───2.00 MB (00.32%) ── b\n\
-├──222.00 MB (35.60%) ── a\n\
-├──100.00 MB (16.04%) -- c\n\
-│ ├───77.00 MB (12.35%) ── other\n\
-│ └───23.00 MB (03.69%) ── d [2]\n\
-├───23.00 MB (03.69%) ── cc [2]\n\
-├───20.00 MB (03.21%) -- f/g/h\n\
-│ ├──10.00 MB (01.60%) ── i\n\
-│ └──10.00 MB (01.60%) ── j\n\
-├───15.00 MB (02.41%) ++ g\n\
-├───11.00 MB (01.76%) ── heap-unclassified\n\
-└────0.58 MB (00.09%) ++ (2 tiny)\n\
-\n\
-Other Measurements\n\
-\n\
-5 (100.0%) -- compartments\n\
-├──3 (60.00%) -- user\n\
-│ ├──1 (20.00%) ── bar\n\
-│ ├──1 (20.00%) ── foo\n\
-│ └──1 (20.00%) ── https://very-long-url.com/very-long/oh-so-long/really-quite-long.html?a=2&b=3&c=4&d=5&e=abcdefghijklmnopqrstuvwxyz&f=123456789123456789123456789\n\
-└──2 (40.00%) -- system\n\
- ├──1 (20.00%) ── bar\n\
- └──1 (20.00%) ── foo\n\
-\n\
-166.00 MB (100.0%) -- other1\n\
-├──111.00 MB (66.87%) ── a/b\n\
-└───55.00 MB (33.13%) -- c\n\
- ├──33.00 MB (19.88%) ── e\n\
- └──22.00 MB (13.25%) ── d\n\
-\n\
-20.20% (100.0%) -- other3\n\
-└──20.20% (100.0%) -- a/b/c/d\n\
- ├──20.00% (99.01%) ── e\n\
- └───0.20% (00.99%) ++ (2 tiny)\n\
-\n\
-100,000 (100.0%) -- other6\n\
-├───99,999 (100.0%) ── big\n\
-└────────1 (00.00%) ── small\n\
-\n\
-0.00 MB (100.0%) -- other7\n\
-└──0.00 MB (100.0%) ── zero\n\
-\n\
-888.00 MB ── explicit\n\
-500.00 MB ── heap-allocated\n\
-100.00 MB ── heap-unallocated\n\
-222.00 MB ── other2\n\
- 777 ── other3\n\
- 888 ── other4 [2]\n\
- 45.67% ── perc1\n\
- 100.00% ── perc2\n\
-\n\
-End of Main Process\n\
-4th\n\
-\n\
-WARNING: the following values are negative or unreasonably large.\n\
-\n\
- explicit/js/compartment(http://too-big.com/)/stuff\n\
- explicit/(2 tiny)\n\
- explicit/(2 tiny)/neg1\n\
- explicit/(2 tiny)/heap-unclassified\n\
- other1\n\
- other2\n\
- other3\n\
- other4\n\
- other5 \n\
-\n\
-This indicates a defect in one or more memory reporters. The invalid values are highlighted.\n\
-Explicit Allocations\n\
-\n\
-98.00 MB (100.0%) -- explicit\n\
-├──150.00 MB (153.06%) ── js/compartment(http://too-big.com/)/stuff [?!]\n\
-├───5.00 MB (05.10%) ── ok\n\
-└──-57.00 MB (-58.16%) -- (2 tiny) [?!]\n\
- ├───-2.00 MB (-2.04%) ── neg1 [?!]\n\
- └──-55.00 MB (-56.12%) ── heap-unclassified [?!]\n\
-\n\
-Other Measurements\n\
-\n\
- 100.00 MB ── heap-allocated\n\
- -0.00 MB ── other1 [?!]\n\
--222.00 MB ── other2 [?!]\n\
- -333 ── other3 [?!]\n\
- -444 ── other4 [?!]\n\
- -5.55% ── other5 [?!]\n\
- 666.66% ── other6\n\
- 200.00 MB ── resident\n\
-\n\
-End of 4th\n\
-3rd\n\
-\n\
-WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
-Explicit Allocations\n\
-\n\
-777.00 MB (100.0%) -- explicit\n\
-└──777.00 MB (100.0%) -- a\n\
- ├──444.00 MB (57.14%) ── c\n\
- └──333.00 MB (42.86%) ── b\n\
-\n\
-Other Measurements\n\
-\n\
- 1.00 MB ── other1\n\
-100.00 MB ── resident\n\
-\n\
-End of 3rd\n\
-2nd\n\
-Explicit Allocations\n\
-\n\
-1,000.00 MB (100.0%) -- explicit\n\
-├────499.00 MB (49.90%) ── a/b/c [3]\n\
-├────200.00 MB (20.00%) ── compartment(compartment-url)\n\
-├────200.00 MB (20.00%) ── flip/the/backslashes\n\
-└────101.00 MB (10.10%) ── heap-unclassified\n\
-\n\
-Other Measurements\n\
-\n\
-1,000.00 MB ── heap-allocated\n\
- 100.00 MB ── heap-unallocated\n\
- 666.00 MB ── other0\n\
- 111.00 MB ── other1\n\
-\n\
-End of 2nd\n\
-5th\n\
-\n\
-WARNING: the following values are negative or unreasonably large.\n\
-\n\
- explicit/(3 tiny)/a/neg2\n\
- explicit/(3 tiny)/a/neg1\n\
- explicit/(3 tiny)/b/c\n\
- explicit/(3 tiny)/b/c/d\n\
- explicit/(3 tiny)/b/c/d/f \n\
-\n\
-This indicates a defect in one or more memory reporters. The invalid values are highlighted.\n\
-Explicit Allocations\n\
-\n\
-99.95 MB (100.0%) -- explicit\n\
-├──99.00 MB (99.05%) ── big\n\
-└───0.95 MB (00.95%) -- (3 tiny)\n\
- ├──0.96 MB (00.96%) ── heap-unclassified\n\
- ├──0.01 MB (00.01%) -- a\n\
- │ ├──0.04 MB (00.04%) ── pos\n\
- │ ├──-0.01 MB (-0.01%) ── neg2 [?!]\n\
- │ └──-0.02 MB (-0.02%) ── neg1 [?!]\n\
- └──-0.02 MB (-0.02%) -- b/c [?!]\n\
- ├───0.01 MB (00.01%) ── g/h\n\
- ├───0.00 MB (00.00%) ── i/j\n\
- └──-0.04 MB (-0.04%) -- d [?!]\n\
- ├───0.02 MB (00.02%) ── e\n\
- └──-0.06 MB (-0.06%) ── f [?!]\n\
-\n\
-Other Measurements\n\
-\n\
-100.00 MB ── heap-allocated\n\
-\n\
-End of 5th\n\
-";
-
- let amvExpectedText =
-"\
-Main Process\n\
-Explicit Allocations\n\
-\n\
-653,876,224 B (100.0%) -- explicit\n\
-├──243,269,632 B (37.20%) -- b\n\
-│ ├───89,128,960 B (13.63%) ── a\n\
-│ ├───78,643,200 B (12.03%) ── b\n\
-│ └───75,497,472 B (11.55%) -- c\n\
-│ ├──73,400,320 B (11.23%) ── a\n\
-│ └───2,097,152 B (00.32%) ── b\n\
-├──232,783,872 B (35.60%) ── a\n\
-├──104,857,600 B (16.04%) -- c\n\
-│ ├───80,740,352 B (12.35%) ── other\n\
-│ └───24,117,248 B (03.69%) ── d [2]\n\
-├───24,117,248 B (03.69%) ── cc [2]\n\
-├───20,971,520 B (03.21%) -- f/g/h\n\
-│ ├──10,485,760 B (01.60%) ── i\n\
-│ └──10,485,760 B (01.60%) ── j\n\
-├───15,728,640 B (02.41%) -- g\n\
-│ ├───6,291,456 B (00.96%) ── a\n\
-│ ├───5,242,880 B (00.80%) ── b\n\
-│ └───4,194,304 B (00.64%) ── other\n\
-├───11,534,336 B (01.76%) ── heap-unclassified\n\
-├──────510,976 B (00.08%) ── d\n\
-└──────102,400 B (00.02%) ── e\n\
-\n\
-Other Measurements\n\
-\n\
-5 (100.0%) -- compartments\n\
-├──3 (60.00%) -- user\n\
-│ ├──1 (20.00%) ── bar\n\
-│ ├──1 (20.00%) ── foo\n\
-│ └──1 (20.00%) ── https://very-long-url.com/very-long/oh-so-long/really-quite-long.html?a=2&b=3&c=4&d=5&e=abcdefghijklmnopqrstuvwxyz&f=123456789123456789123456789\n\
-└──2 (40.00%) -- system\n\
- ├──1 (20.00%) ── bar\n\
- └──1 (20.00%) ── foo\n\
-\n\
-174,063,616 B (100.0%) -- other1\n\
-├──116,391,936 B (66.87%) ── a/b\n\
-└───57,671,680 B (33.13%) -- c\n\
- ├──34,603,008 B (19.88%) ── e\n\
- └──23,068,672 B (13.25%) ── d\n\
-\n\
-20.20% (100.0%) -- other3\n\
-└──20.20% (100.0%) -- a/b/c/d\n\
- ├──20.00% (99.01%) ── e\n\
- ├───0.10% (00.50%) ── f\n\
- └───0.10% (00.50%) ── g [2]\n\
-\n\
-100,000 (100.0%) -- other6\n\
-├───99,999 (100.0%) ── big\n\
-└────────1 (00.00%) ── small\n\
-\n\
-0 B (100.0%) -- other7\n\
-└──0 B (100.0%) ── zero\n\
-\n\
-931,135,488 B ── explicit\n\
-524,288,000 B ── heap-allocated\n\
-104,857,600 B ── heap-unallocated\n\
-232,783,872 B ── other2\n\
- 777 ── other3\n\
- 888 ── other4 [2]\n\
- 45.67% ── perc1\n\
- 100.00% ── perc2\n\
-\n\
-End of Main Process\n\
-4th\n\
-\n\
-WARNING: the following values are negative or unreasonably large.\n\
-\n\
- explicit/js/compartment(http://too-big.com/)/stuff\n\
- explicit/neg1\n\
- explicit/heap-unclassified\n\
- other1\n\
- other2\n\
- other3\n\
- other4\n\
- other5 \n\
-\n\
-This indicates a defect in one or more memory reporters. The invalid values are highlighted.\n\
-Explicit Allocations\n\
-\n\
-102,760,448 B (100.0%) -- explicit\n\
-├──157,286,400 B (153.06%) ── js/compartment(http://too-big.com/)/stuff [?!]\n\
-├────5,242,880 B (05.10%) ── ok\n\
-├───-2,097,152 B (-2.04%) ── neg1 [?!]\n\
-└──-57,671,680 B (-56.12%) ── heap-unclassified [?!]\n\
-\n\
-Other Measurements\n\
-\n\
- 104,857,600 B ── heap-allocated\n\
- -111 B ── other1 [?!]\n\
--232,783,872 B ── other2 [?!]\n\
- -333 ── other3 [?!]\n\
- -444 ── other4 [?!]\n\
- -5.55% ── other5 [?!]\n\
- 666.66% ── other6\n\
- 209,715,200 B ── resident\n\
-\n\
-End of 4th\n\
-3rd\n\
-\n\
-WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
-Explicit Allocations\n\
-\n\
-814,743,552 B (100.0%) -- explicit\n\
-└──814,743,552 B (100.0%) -- a\n\
- ├──465,567,744 B (57.14%) ── c\n\
- └──349,175,808 B (42.86%) ── b\n\
-\n\
-Other Measurements\n\
-\n\
- 1,048,576 B ── other1\n\
-104,857,600 B ── resident\n\
-\n\
-End of 3rd\n\
-2nd\n\
-Explicit Allocations\n\
-\n\
-1,048,576,000 B (100.0%) -- explicit\n\
-├────523,239,424 B (49.90%) ── a/b/c [3]\n\
-├────209,715,200 B (20.00%) ── compartment(compartment-url)\n\
-├────209,715,200 B (20.00%) ── flip/the/backslashes\n\
-└────105,906,176 B (10.10%) ── heap-unclassified\n\
-\n\
-Other Measurements\n\
-\n\
-1,048,576,000 B ── heap-allocated\n\
- 104,857,600 B ── heap-unallocated\n\
- 698,351,616 B ── other0\n\
- 116,391,936 B ── other1\n\
-\n\
-End of 2nd\n\
-5th\n\
-\n\
-WARNING: the following values are negative or unreasonably large.\n\
-\n\
- explicit/a/neg2\n\
- explicit/a/neg1\n\
- explicit/b/c\n\
- explicit/b/c/d\n\
- explicit/b/c/d/f \n\
-\n\
-This indicates a defect in one or more memory reporters. The invalid values are highlighted.\n\
-Explicit Allocations\n\
-\n\
-104,801,280 B (100.0%) -- explicit\n\
-├──103,809,024 B (99.05%) ── big\n\
-├────1,007,616 B (00.96%) ── heap-unclassified\n\
-├───────10,240 B (00.01%) -- a\n\
-│ ├──40,960 B (00.04%) ── pos\n\
-│ ├──-10,240 B (-0.01%) ── neg2 [?!]\n\
-│ └──-20,480 B (-0.02%) ── neg1 [?!]\n\
-└──────-25,600 B (-0.02%) -- b/c [?!]\n\
- ├───10,240 B (00.01%) ── g/h\n\
- ├────5,120 B (00.00%) ── i/j\n\
- └──-40,960 B (-0.04%) -- d [?!]\n\
- ├───20,480 B (00.02%) ── e\n\
- └──-61,440 B (-0.06%) ── f [?!]\n\
-\n\
-Other Measurements\n\
-\n\
-104,857,600 B ── heap-allocated\n\
-\n\
-End of 5th\n\
-";
-
- function finish()
- {
- mgr.unblockRegistrationAndRestoreOriginalReporters();
- SimpleTest.finish();
- }
-
- // Cut+paste the entire page and check that the cut text matches what we
- // expect. This tests the output in general and also that the cutting and
- // pasting works as expected.
- function test(aFrameId, aVerbose, aExpected, aNext) {
- SimpleTest.executeSoon(function() {
- ok(document.title === "about:memory", "document.title is correct");
- let mostRecentActual;
- let frame = document.getElementById(aFrameId);
- frame.focus();
-
- // Set the verbose checkbox value and click the go button.
- let doc = frame.contentWindow.document;
- let measureButton = doc.getElementById("measureButton");
- let verbose = doc.getElementById("verbose");
- verbose.checked = aVerbose;
- measureButton.click();
-
- SimpleTest.waitForClipboard(
- function(aActual) {
- mostRecentActual = aActual;
- let rslt = aActual.trim() === aExpected.trim();
- if (!rslt) {
- // Try copying again.
- synthesizeKey("A", {accelKey: true});
- synthesizeKey("C", {accelKey: true});
- }
-
- return rslt;
- },
- function() {
- synthesizeKey("A", {accelKey: true});
- synthesizeKey("C", {accelKey: true});
- },
- aNext,
- function() {
- ok(false, "pasted text doesn't match for " + aFrameId);
- dump("******EXPECTED******\n");
- dump("<<<" + aExpected + ">>>\n");
- dump("*******ACTUAL*******\n");
- dump("<<<" + mostRecentActual + ">>>\n");
- dump("********************\n");
- finish();
- }
- );
- });
- }
-
- SimpleTest.waitForFocus(function() {
- test(
- "amFrame",
- /* verbose = */ false,
- amExpectedText,
- function() {
- test(
- "amvFrame",
- /* verbose = */ true,
- amvExpectedText,
- function() {
- finish()
- }
- )
- }
- );
- });
- SimpleTest.waitForExplicitFinish();
- ]]>
- </script>
-</window>
diff --git a/toolkit/components/aboutmemory/tests/test_aboutmemory2.xul b/toolkit/components/aboutmemory/tests/test_aboutmemory2.xul
deleted file mode 100644
index 8cf197e6d..000000000
--- a/toolkit/components/aboutmemory/tests/test_aboutmemory2.xul
+++ /dev/null
@@ -1,423 +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 collapsing and expanding of sub-trees in
- about:memory. -->
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml"></body>
-
- <!-- test code goes here -->
- <script type="application/javascript">
- <![CDATA[
- "use strict";
-
- const Cc = Components.classes;
- const Ci = Components.interfaces;
- let mgr = Cc["@mozilla.org/memory-reporter-manager;1"].
- getService(Ci.nsIMemoryReporterManager);
-
- // Hide all the real reporters; we'll restore them at the end.
- mgr.blockRegistrationAndHideExistingReporters();
-
- // Setup various fake-but-deterministic reporters.
- const KB = 1024;
- const MB = KB * KB;
- const HEAP = Ci.nsIMemoryReporter.KIND_HEAP;
- const OTHER = Ci.nsIMemoryReporter.KIND_OTHER;
- const BYTES = Ci.nsIMemoryReporter.UNITS_BYTES;
-
- let hiPath = "explicit/h/i";
- let hi2Path = "explicit/h/i2";
- let jkPath = "explicit/j/k";
- let jk2Path = "explicit/j/k2";
-
- let fakeReporters = [
- { collectReports: function(aCbObj, aClosure, aAnonymize) {
- function f(aP, aK, aA) {
- aCbObj.callback("", aP, aK, BYTES, aA, "Desc.", aClosure);
- }
- f("heap-allocated", OTHER, 250 * MB);
- f("explicit/a/b", HEAP, 50 * MB);
- f("explicit/a/c/d", HEAP, 25 * MB);
- f("explicit/a/c/e", HEAP, 15 * MB);
- f("explicit/a/f", HEAP, 30 * MB);
- f("explicit/g", HEAP, 100 * MB);
- f(hiPath, HEAP, 10 * MB);
- f(hi2Path, HEAP, 9 * MB);
- f(jkPath, HEAP, 0.5 * MB);
- f(jk2Path, HEAP, 0.3 * MB);
- f("explicit/a/l/m", HEAP, 0.1 * MB);
- f("explicit/a/l/n", HEAP, 0.1 * MB);
- }
- }
- ];
-
- for (let i = 0; i < fakeReporters.length; i++) {
- mgr.registerStrongReporterEvenIfBlocked(fakeReporters[i]);
- }
-
- ]]>
- </script>
-
- <iframe id="amFrame" height="500" src="about:memory"></iframe>
-
- <script type="application/javascript">
- <![CDATA[
- function finish()
- {
- mgr.unblockRegistrationAndRestoreOriginalReporters();
- SimpleTest.finish();
- }
-
- // Click on the identified element, then cut+paste the entire page and
- // check that the cut text matches what we expect.
- function test(aId, aSwap, aExpected, aNext) {
- let win = document.getElementById("amFrame").contentWindow;
- if (aId) {
- let node = win.document.getElementById(aId);
-
- // Yuk: clicking a button is easy; but for tree entries we need to
- // click on a child of the span identified via |id|.
- if (node.nodeName === "button") {
- if (aSwap) {
- // We swap hipath/hi2Path and jkPath/jk2Path just before updating, to
- // test what happens when significant nodes become insignificant and
- // vice versa.
- hiPath = "explicit/j/k";
- hi2Path = "explicit/j/k2";
- jkPath = "explicit/h/i";
- jk2Path = "explicit/h/i2";
- }
- node.click();
- } else {
- node.childNodes[0].click();
- }
- }
-
- SimpleTest.executeSoon(function() {
- let mostRecentActual;
- document.getElementById("amFrame").focus();
- SimpleTest.waitForClipboard(
- function(aActual) {
- mostRecentActual = aActual;
- let rslt = aActual.trim() === aExpected.trim();
- if (!rslt) {
- // Try copying again.
- synthesizeKey("A", {accelKey: true});
- synthesizeKey("C", {accelKey: true});
- }
-
- return rslt;
- },
- function() {
- synthesizeKey("A", {accelKey: true});
- synthesizeKey("C", {accelKey: true});
- },
- aNext,
- function() {
- ok(false, "pasted text doesn't match");
- dump("******EXPECTED******\n");
- dump(aExpected);
- dump("*******ACTUAL*******\n");
- dump(mostRecentActual);
- dump("********************\n");
- finish();
- }
- );
- });
- }
-
- // Returns a function that chains together one test() call per id.
- function chain(aIds) {
- let x = aIds.shift();
- if (x) {
- return function() { test(x.id, x.swap, x.expected, chain(aIds)); }
- } else {
- return function() { finish(); };
- }
- }
-
- let startExpected =
-"\
-Main Process\n\
-Explicit Allocations\n\
-\n\
-250.00 MB (100.0%) -- explicit\n\
-├──120.20 MB (48.08%) -- a\n\
-│ ├───50.00 MB (20.00%) ── b\n\
-│ ├───40.00 MB (16.00%) -- c\n\
-│ │ ├──25.00 MB (10.00%) ── d\n\
-│ │ └──15.00 MB (06.00%) ── e\n\
-│ ├───30.00 MB (12.00%) ── f\n\
-│ └────0.20 MB (00.08%) ++ l\n\
-├──100.00 MB (40.00%) ── g\n\
-├───19.00 MB (07.60%) -- h\n\
-│ ├──10.00 MB (04.00%) ── i\n\
-│ └───9.00 MB (03.60%) ── i2\n\
-├───10.00 MB (04.00%) ── heap-unclassified\n\
-└────0.80 MB (00.32%) ++ j\n\
-\n\
-Other Measurements\n\
-\n\
-250.00 MB ── heap-allocated\n\
-\n\
-End of Main Process\n\
-";
-
- let acCollapsedExpected =
-"\
-Main Process\n\
-Explicit Allocations\n\
-\n\
-250.00 MB (100.0%) -- explicit\n\
-├──120.20 MB (48.08%) -- a\n\
-│ ├───50.00 MB (20.00%) ── b\n\
-│ ├───40.00 MB (16.00%) ++ c\n\
-│ ├───30.00 MB (12.00%) ── f\n\
-│ └────0.20 MB (00.08%) ++ l\n\
-├──100.00 MB (40.00%) ── g\n\
-├───19.00 MB (07.60%) -- h\n\
-│ ├──10.00 MB (04.00%) ── i\n\
-│ └───9.00 MB (03.60%) ── i2\n\
-├───10.00 MB (04.00%) ── heap-unclassified\n\
-└────0.80 MB (00.32%) ++ j\n\
-\n\
-Other Measurements\n\
-\n\
-250.00 MB ── heap-allocated\n\
-\n\
-End of Main Process\n\
-";
-
- let alExpandedExpected =
-"\
-Main Process\n\
-Explicit Allocations\n\
-\n\
-250.00 MB (100.0%) -- explicit\n\
-├──120.20 MB (48.08%) -- a\n\
-│ ├───50.00 MB (20.00%) ── b\n\
-│ ├───40.00 MB (16.00%) ++ c\n\
-│ ├───30.00 MB (12.00%) ── f\n\
-│ └────0.20 MB (00.08%) -- l\n\
-│ ├──0.10 MB (00.04%) ── m\n\
-│ └──0.10 MB (00.04%) ── n\n\
-├──100.00 MB (40.00%) ── g\n\
-├───19.00 MB (07.60%) -- h\n\
-│ ├──10.00 MB (04.00%) ── i\n\
-│ └───9.00 MB (03.60%) ── i2\n\
-├───10.00 MB (04.00%) ── heap-unclassified\n\
-└────0.80 MB (00.32%) ++ j\n\
-\n\
-Other Measurements\n\
-\n\
-250.00 MB ── heap-allocated\n\
-\n\
-End of Main Process\n\
-";
-
- let aCollapsedExpected =
-"\
-Main Process\n\
-Explicit Allocations\n\
-\n\
-250.00 MB (100.0%) -- explicit\n\
-├──120.20 MB (48.08%) ++ a\n\
-├──100.00 MB (40.00%) ── g\n\
-├───19.00 MB (07.60%) -- h\n\
-│ ├──10.00 MB (04.00%) ── i\n\
-│ └───9.00 MB (03.60%) ── i2\n\
-├───10.00 MB (04.00%) ── heap-unclassified\n\
-└────0.80 MB (00.32%) ++ j\n\
-\n\
-Other Measurements\n\
-\n\
-250.00 MB ── heap-allocated\n\
-\n\
-End of Main Process\n\
-";
-
- let hCollapsedExpected =
-"\
-Main Process\n\
-Explicit Allocations\n\
-\n\
-250.00 MB (100.0%) -- explicit\n\
-├──120.20 MB (48.08%) ++ a\n\
-├──100.00 MB (40.00%) ── g\n\
-├───19.00 MB (07.60%) ++ h\n\
-├───10.00 MB (04.00%) ── heap-unclassified\n\
-└────0.80 MB (00.32%) ++ j\n\
-\n\
-Other Measurements\n\
-\n\
-250.00 MB ── heap-allocated\n\
-\n\
-End of Main Process\n\
-";
-
- let jExpandedExpected =
-"\
-Main Process\n\
-Explicit Allocations\n\
-\n\
-250.00 MB (100.0%) -- explicit\n\
-├──120.20 MB (48.08%) ++ a\n\
-├──100.00 MB (40.00%) ── g\n\
-├───19.00 MB (07.60%) ++ h\n\
-├───10.00 MB (04.00%) ── heap-unclassified\n\
-└────0.80 MB (00.32%) -- j\n\
- ├──0.50 MB (00.20%) ── k\n\
- └──0.30 MB (00.12%) ── k2\n\
-\n\
-Other Measurements\n\
-\n\
-250.00 MB ── heap-allocated\n\
-\n\
-End of Main Process\n\
-";
-
- // The important thing here is that two values have been swapped.
- // explicit/h/i should remain collapsed, and explicit/j/k should remain
- // expanded. See bug 724863.
- let updatedExpected =
-"\
-Main Process\n\
-Explicit Allocations\n\
-\n\
-250.00 MB (100.0%) -- explicit\n\
-├──120.20 MB (48.08%) ++ a\n\
-├──100.00 MB (40.00%) ── g\n\
-├───19.00 MB (07.60%) -- j\n\
-│ ├──10.00 MB (04.00%) ── k\n\
-│ └───9.00 MB (03.60%) ── k2\n\
-├───10.00 MB (04.00%) ── heap-unclassified\n\
-└────0.80 MB (00.32%) ++ h\n\
-\n\
-Other Measurements\n\
-\n\
-250.00 MB ── heap-allocated\n\
-\n\
-End of Main Process\n\
-";
-
- let aExpandedExpected =
-"\
-Main Process\n\
-Explicit Allocations\n\
-\n\
-250.00 MB (100.0%) -- explicit\n\
-├──120.20 MB (48.08%) -- a\n\
-│ ├───50.00 MB (20.00%) ── b\n\
-│ ├───40.00 MB (16.00%) ++ c\n\
-│ ├───30.00 MB (12.00%) ── f\n\
-│ └────0.20 MB (00.08%) -- l\n\
-│ ├──0.10 MB (00.04%) ── m\n\
-│ └──0.10 MB (00.04%) ── n\n\
-├──100.00 MB (40.00%) ── g\n\
-├───19.00 MB (07.60%) -- j\n\
-│ ├──10.00 MB (04.00%) ── k\n\
-│ └───9.00 MB (03.60%) ── k2\n\
-├───10.00 MB (04.00%) ── heap-unclassified\n\
-└────0.80 MB (00.32%) ++ h\n\
-\n\
-Other Measurements\n\
-\n\
-250.00 MB ── heap-allocated\n\
-\n\
-End of Main Process\n\
-";
-
- let acExpandedExpected =
-"\
-Main Process\n\
-Explicit Allocations\n\
-\n\
-250.00 MB (100.0%) -- explicit\n\
-├──120.20 MB (48.08%) -- a\n\
-│ ├───50.00 MB (20.00%) ── b\n\
-│ ├───40.00 MB (16.00%) -- c\n\
-│ │ ├──25.00 MB (10.00%) ── d\n\
-│ │ └──15.00 MB (06.00%) ── e\n\
-│ ├───30.00 MB (12.00%) ── f\n\
-│ └────0.20 MB (00.08%) -- l\n\
-│ ├──0.10 MB (00.04%) ── m\n\
-│ └──0.10 MB (00.04%) ── n\n\
-├──100.00 MB (40.00%) ── g\n\
-├───19.00 MB (07.60%) -- j\n\
-│ ├──10.00 MB (04.00%) ── k\n\
-│ └───9.00 MB (03.60%) ── k2\n\
-├───10.00 MB (04.00%) ── heap-unclassified\n\
-└────0.80 MB (00.32%) ++ h\n\
-\n\
-Other Measurements\n\
-\n\
-250.00 MB ── heap-allocated\n\
-\n\
-End of Main Process\n\
-";
-
- let alCollapsedExpected =
-"\
-Main Process\n\
-Explicit Allocations\n\
-\n\
-250.00 MB (100.0%) -- explicit\n\
-├──120.20 MB (48.08%) -- a\n\
-│ ├───50.00 MB (20.00%) ── b\n\
-│ ├───40.00 MB (16.00%) -- c\n\
-│ │ ├──25.00 MB (10.00%) ── d\n\
-│ │ └──15.00 MB (06.00%) ── e\n\
-│ ├───30.00 MB (12.00%) ── f\n\
-│ └────0.20 MB (00.08%) ++ l\n\
-├──100.00 MB (40.00%) ── g\n\
-├───19.00 MB (07.60%) -- j\n\
-│ ├──10.00 MB (04.00%) ── k\n\
-│ └───9.00 MB (03.60%) ── k2\n\
-├───10.00 MB (04.00%) ── heap-unclassified\n\
-└────0.80 MB (00.32%) ++ h\n\
-\n\
-Other Measurements\n\
-\n\
-250.00 MB ── heap-allocated\n\
-\n\
-End of Main Process\n\
-";
-
- // Test the following cases:
- // - explicit/a/c is significant, we collapse it, it's unchanged upon
- // update, we re-expand it
- // - explicit/a/l is insignificant, we expand it, it's unchanged upon
- // update, we re-collapse it
- // - explicit/a is significant, we collapse it (which hides its
- // sub-trees), it's unchanged upon update, we re-expand it
- // - explicit/h is significant, we collapse it, it becomes insignificant
- // upon update (and should remain collapsed)
- // - explicit/j is insignificant, we expand it, it becomes significant
- // upon update (and should remain expanded)
- //
- let idsToClick = [
- { id: "measureButton", swap: 0, expected: startExpected },
- { id: "Main Process:explicit/a/c", swap: 0, expected: acCollapsedExpected },
- { id: "Main Process:explicit/a/l", swap: 0, expected: alExpandedExpected },
- { id: "Main Process:explicit/a", swap: 0, expected: aCollapsedExpected },
- { id: "Main Process:explicit/h", swap: 0, expected: hCollapsedExpected },
- { id: "Main Process:explicit/j", swap: 0, expected: jExpandedExpected },
- { id: "measureButton", swap: 1, expected: updatedExpected },
- { id: "Main Process:explicit/a", swap: 0, expected: aExpandedExpected },
- { id: "Main Process:explicit/a/c", swap: 0, expected: acExpandedExpected },
- { id: "Main Process:explicit/a/l", swap: 0, expected: alCollapsedExpected }
- ];
-
- SimpleTest.waitForFocus(chain(idsToClick));
-
- SimpleTest.waitForExplicitFinish();
- ]]>
- </script>
-</window>
diff --git a/toolkit/components/aboutmemory/tests/test_aboutmemory3.xul b/toolkit/components/aboutmemory/tests/test_aboutmemory3.xul
deleted file mode 100644
index c712070cc..000000000
--- a/toolkit/components/aboutmemory/tests/test_aboutmemory3.xul
+++ /dev/null
@@ -1,515 +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 and loading of memory reports to/from file in
- about:memory. -->
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml"></body>
-
- <!-- test code goes here -->
- <script type="application/javascript">
- <![CDATA[
- "use strict";
-
- const Cc = Components.classes;
- const Ci = Components.interfaces;
- let mgr = Cc["@mozilla.org/memory-reporter-manager;1"].
- getService(Ci.nsIMemoryReporterManager);
-
- // Hide all the real reporters; we'll restore them at the end.
- mgr.blockRegistrationAndHideExistingReporters();
-
- // Setup a minimal number of fake reporters.
- const KB = 1024;
- const MB = KB * KB;
- const HEAP = Ci.nsIMemoryReporter.KIND_HEAP;
- const OTHER = Ci.nsIMemoryReporter.KIND_OTHER;
- const BYTES = Ci.nsIMemoryReporter.UNITS_BYTES;
-
- let fakeReporters = [
- { collectReports: function(aCbObj, aClosure, aAnonymize) {
- function f(aP, aK, aA, aD) {
- aCbObj.callback("", aP, aK, BYTES, aA, aD, aClosure);
- }
- f("heap-allocated", OTHER, 250 * MB, "Heap allocated.");
- f("explicit/a/b", HEAP, 50 * MB, "A b.");
- f("other/a", OTHER, 0.2 * MB, "Other a.");
- f("other/b", OTHER, 0.1 * MB, "Other b.");
- }
- }
- ];
-
- for (let i = 0; i < fakeReporters.length; i++) {
- mgr.registerStrongReporterEvenIfBlocked(fakeReporters[i]);
- }
-
- ]]>
- </script>
-
- <iframe id="amFrame" height="400" src="about:memory"></iframe>
-
- <script type="application/javascript">
- <![CDATA[
- function finish()
- {
- mgr.unblockRegistrationAndRestoreOriginalReporters();
- SimpleTest.finish();
- }
-
- // Load the given file into the frame, then copy+paste the entire frame and
- // check that the cut text matches what we expect.
- function test(aFilename, aFilename2, aExpected, aDumpFirst, aVerbose, aNext) {
- let frame = document.getElementById("amFrame");
- frame.focus();
-
- let doc = frame.contentWindow.document;
- let verbosity = doc.getElementById("verbose");
- verbosity.checked = aVerbose;
-
- function getFilePath(aFilename) {
- let file = Cc["@mozilla.org/file/directory_service;1"]
- .getService(Components.interfaces.nsIProperties)
- .get("CurWorkD", Components.interfaces.nsIFile);
- file.append("chrome");
- file.append("toolkit");
- file.append("components");
- file.append("aboutmemory");
- file.append("tests");
- file.append(aFilename);
- return file.path;
- }
-
- let filePath = getFilePath(aFilename);
-
- let e = document.createEvent('Event');
- e.initEvent('change', true, true);
-
- function check() {
- // Initialize the clipboard contents.
- SpecialPowers.clipboardCopyString("initial clipboard value");
-
- let numFailures = 0, maxFailures = 30;
-
- // Because the file load is async, we don't know when it will finish and
- // the output will show up. So we poll.
- function copyPasteAndCheck() {
- // Copy and paste frame contents, and filter out non-deterministic
- // differences.
- synthesizeKey("A", {accelKey: true});
- synthesizeKey("C", {accelKey: true});
- let actual = SpecialPowers.getClipboardData("text/unicode");
- actual = actual.replace(/\(pid \d+\)/g, "(pid NNN)");
-
- if (actual.trim() === aExpected.trim()) {
- SimpleTest.ok(true, "Clipboard has the expected contents");
- aNext();
- } else {
- numFailures++;
- if (numFailures === maxFailures) {
- ok(false, "pasted text doesn't match");
- dump("******EXPECTED******\n");
- dump(aExpected);
- dump("*******ACTUAL*******\n");
- dump(actual);
- dump("********************\n");
- finish();
- } else {
- setTimeout(copyPasteAndCheck, 100);
- }
- }
- }
- copyPasteAndCheck();
- }
-
- if (!aFilename2) {
- function loadAndCheck() {
- let fileInput1 =
- frame.contentWindow.document.getElementById("fileInput1");
- fileInput1.value = filePath; // this works because it's a chrome test
-
- fileInput1.dispatchEvent(e);
- check();
- }
-
- if (aDumpFirst) {
- let dumper = Cc["@mozilla.org/memory-info-dumper;1"].
- getService(Ci.nsIMemoryInfoDumper);
- dumper.dumpMemoryReportsToNamedFile(filePath, loadAndCheck, null,
- /* anonymize = */ false);
- } else {
- loadAndCheck();
- }
-
- } else {
- let fileInput2 =
- frame.contentWindow.document.getElementById("fileInput2");
- fileInput2.value = filePath; // this works because it's a chrome test
-
- // Hack alert: fileInput2's onchange handler calls fileInput2.click().
- // But we don't want that to happen, because we want to bypass the file
- // picker for the test. So we set |e.skipClick|, which causes
- // fileInput2.click() to be skipped, and dispatch the second change event
- // directly ourselves.
-
- e.skipClick = true;
- fileInput2.dispatchEvent(e);
-
- let filePath2 = getFilePath(aFilename2);
- fileInput2.value = filePath2; // this works because it's a chrome test
-
- let e2 = document.createEvent('Event');
- e2.initEvent('change', true, true);
- fileInput2.dispatchEvent(e);
-
- check();
- }
- }
-
- // Returns a function that chains together multiple test() calls.
- function chain(aPieces) {
- let x = aPieces.shift();
- if (x) {
- return function() { test(x.filename, x.filename2, x.expected, x.dumpFirst, x.verbose, chain(aPieces)); }
- } else {
- return function() { finish(); };
- }
- }
-
- let expectedGood =
-"\
-Explicit-only process\n\
-\n\
-WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
-Explicit Allocations\n\
-\n\
-100,000 B (100.0%) -- explicit\n\
-└──100,000 B (100.0%) ── a/b\n\
-\n\
-Other Measurements\n\
-\n\
-End of Explicit-only process\n\
-Heap-unclassified process\n\
-Explicit Allocations\n\
-\n\
-262,144,000 B (100.0%) -- explicit\n\
-├──209,715,200 B (80.00%) ── heap-unclassified\n\
-└───52,428,800 B (20.00%) ── a/b\n\
-\n\
-Other Measurements\n\
-\n\
-262,144,000 B ── heap-allocated\n\
-\n\
-End of Heap-unclassified process\n\
-Main Process (pid NNN)\n\
-Explicit Allocations\n\
-\n\
-262,144,000 B (100.0%) -- explicit\n\
-├──209,715,200 B (80.00%) ── heap-unclassified\n\
-└───52,428,800 B (20.00%) ── a/b\n\
-\n\
-Other Measurements\n\
-\n\
-1,024 B (100.0%) -- compartments\n\
-└──1,024 B (100.0%) ── system/a\n\
-\n\
-1,024 B (100.0%) -- ghost-windows\n\
-└──1,024 B (100.0%) ── a\n\
-\n\
-314,572 B (100.0%) -- other\n\
-├──209,715 B (66.67%) ── a\n\
-└──104,857 B (33.33%) ── b\n\
-\n\
-1,024 B (100.0%) -- pss\n\
-└──1,024 B (100.0%) ── a\n\
-\n\
-1,024 B (100.0%) -- rss\n\
-└──1,024 B (100.0%) ── a\n\
-\n\
-1,024 B (100.0%) -- size\n\
-└──1,024 B (100.0%) ── a\n\
-\n\
-1,024 B (100.0%) -- swap\n\
-└──1,024 B (100.0%) ── a\n\
-\n\
-262,144,000 B ── heap-allocated\n\
-\n\
-End of Main Process (pid NNN)\n\
-Other-only process\n\
-Other Measurements\n\
-\n\
-200,000 B (100.0%) -- a\n\
-├──100,000 B (50.00%) ── b\n\
-└──100,000 B (50.00%) ── c\n\
-\n\
-500,000 B ── heap-allocated\n\
-\n\
-End of Other-only process\n\
-";
-
- let expectedGood2 =
-"\
-Main Process (pid NNN)\n\
-Explicit Allocations\n\
-\n\
-262,144,000 B (100.0%) -- explicit\n\
-├──209,715,200 B (80.00%) ── heap-unclassified\n\
-└───52,428,800 B (20.00%) ── a/b\n\
-\n\
-Other Measurements\n\
-\n\
-314,572 B (100.0%) -- other\n\
-├──209,715 B (66.67%) ── a\n\
-└──104,857 B (33.33%) ── b\n\
-\n\
-262,144,000 B ── heap-allocated\n\
-\n\
-End of Main Process (pid NNN)\n\
-";
-
- // This is the output for a malformed data file.
- let expectedBad =
-"\
-Error: Invalid memory report(s): missing 'hasMozMallocUsableSize' property\
-";
-
- // This is the output for a non-verbose diff.
- let expectedDiffNonVerbose =
-"\
-P\n\
-\n\
-WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
-Explicit Allocations\n\
-\n\
--0.01 MB (100.0%) -- explicit\n\
-├──-0.01 MB (99.95%) ── storage/prefixset/goog-phish-shavar\n\
-└──-0.00 MB (00.05%) ++ (2 tiny)\n\
-\n\
-Other Measurements\n\
-\n\
-0.96 MB (100.0%) -- a\n\
-├──0.95 MB (99.80%) ── b\n\
-├──0.00 MB (00.10%) -- c\n\
-│ ├──-0.95 MB (-99.70%) ── e\n\
-│ ├──0.95 MB (99.60%) ── d\n\
-│ └──0.00 MB (00.20%) ++ (2 tiny)\n\
-└──0.00 MB (00.10%) ── h\n\
-\n\
- 0.00 MB ── canvas-2d-pixel-bytes [2] [+]\n\
--0.00 MB ── foobar [-]\n\
-\n\
-End of P\n\
-P2 (pid NNN)\n\
-\n\
-WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
-Explicit Allocations\n\
-\n\
-0.00 MB (100.0%) -- explicit\n\
-└──0.00 MB (100.0%) ── window-objects/top(bar.com, id=NNN)/...\n\
-\n\
-Other Measurements\n\
-\n\
-0.00 MB (100.0%) -- p3\n\
-└──0.00 MB (100.0%) ── zone(0xNNN)/p3\n\
-\n\
-0.00 MB (100.0%) -- p4\n\
-└──0.00 MB (100.0%) ── js-zone(0xNNN)/p4\n\
-\n\
-0.00 MB (100.0%) -- p5\n\
-└──0.00 MB (100.0%) ── worker(foo.com, 0xNNN)/p5\n\
-\n\
-0.00 MB (100.0%) -- p6\n\
-└──0.00 MB (100.0%) ── z-moz-nullprincipal:{NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNNN}/p6\n\
-\n\
-0.00 MB (100.0%) -- p7\n\
-└──0.00 MB (100.0%) ── js-main-runtime-compartments/system/jar:file:///.../omni.ja!/p7\n\
-\n\
-0.00 MB ── p1 (pid NNN)\n\
-0.00 MB ── p2 (blah, pid=NNN)\n\
-\n\
-End of P2 (pid NNN)\n\
-P3\n\
-Other Measurements\n\
-\n\
--0.00 MB ── p3 [-]\n\
-\n\
-End of P3\n\
-P4\n\
-Other Measurements\n\
-\n\
-0.00 MB ── p4 [+]\n\
-\n\
-End of P4\n\
-P7\n\
-Other Measurements\n\
-\n\
-0.00 MB (100.0%) -- p7\n\
-├──0.00 MB (57.14%) ── c [+]\n\
-└──0.00 MB (42.86%) ── b [+]\n\
-\n\
--0.00 MB ── p7 [-]\n\
-\n\
-End of P7\n\
-P8\n\
-Other Measurements\n\
-\n\
--0.00 MB (100.0%) -- p8\n\
-└──-0.00 MB (100.0%) -- a\n\
- ├──-0.00 MB (50.00%) -- b\n\
- │ ├──-0.00 MB (31.82%) -- c\n\
- │ │ ├──-0.00 MB (18.18%) ── e [-]\n\
- │ │ └──-0.00 MB (13.64%) ── d [-]\n\
- │ ├──-0.00 MB (22.73%) ── f [-]\n\
- │ └───0.00 MB (-4.55%) ── (fake child) [!]\n\
- └──-0.00 MB (50.00%) -- g\n\
- ├──-0.00 MB (31.82%) ── i [-]\n\
- ├──-0.00 MB (27.27%) ── h [-]\n\
- └───0.00 MB (-9.09%) ── (fake child) [!]\n\
-\n\
-End of P8\n\
-";
-
- // This is the output for a verbose diff.
- let expectedDiffVerbose =
-"\
-P\n\
-\n\
-WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
-Explicit Allocations\n\
-\n\
--10,005 B (100.0%) -- explicit\n\
-├──-10,000 B (99.95%) ── storage/prefixset/goog-phish-shavar\n\
-├───────-6 B (00.06%) ── spell-check [2]\n\
-└────────1 B (-0.01%) ── xpcom/category-manager\n\
-\n\
-Other Measurements\n\
-\n\
-1,002,000 B (100.0%) -- a\n\
-├──1,000,000 B (99.80%) ── b\n\
-├──────1,000 B (00.10%) -- c\n\
-│ ├──-999,000 B (-99.70%) ── e\n\
-│ ├──998,000 B (99.60%) ── d\n\
-│ ├──1,000 B (00.10%) ── f\n\
-│ └──1,000 B (00.10%) ── g\n\
-└──────1,000 B (00.10%) ── h\n\
-\n\
-3,000 B ── canvas-2d-pixel-bytes [2] [+]\n\
- -100 B ── foobar [-]\n\
-\n\
-End of P\n\
-P2 (pid NNN)\n\
-\n\
-WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
-Explicit Allocations\n\
-\n\
-11 B (100.0%) -- explicit\n\
-└──11 B (100.0%) ── window-objects/top(bar.com, id=NNN)/...\n\
-\n\
-Other Measurements\n\
-\n\
-11 B (100.0%) -- p3\n\
-└──11 B (100.0%) ── zone(0xNNN)/p3\n\
-\n\
-11 B (100.0%) -- p4\n\
-└──11 B (100.0%) ── js-zone(0xNNN)/p4\n\
-\n\
-11 B (100.0%) -- p5\n\
-└──11 B (100.0%) ── worker(foo.com, 0xNNN)/p5\n\
-\n\
-11 B (100.0%) -- p6\n\
-└──11 B (100.0%) ── z-moz-nullprincipal:{NNNNNNNN-NNNN-NNNN-NNNN-NNNNNNNNNNNN}/p6\n\
-\n\
-11 B (100.0%) -- p7\n\
-└──11 B (100.0%) ── js-main-runtime-compartments/system/jar:file:///.../omni.ja!/p7\n\
-\n\
-11 B ── p1 (pid NNN)\n\
-11 B ── p2 (blah, pid=NNN)\n\
-\n\
-End of P2 (pid NNN)\n\
-P3\n\
-Other Measurements\n\
-\n\
--55 B ── p3 [-]\n\
-\n\
-End of P3\n\
-P4\n\
-Other Measurements\n\
-\n\
-66 B ── p4 [+]\n\
-\n\
-End of P4\n\
-P7\n\
-Other Measurements\n\
-\n\
-7 B (100.0%) -- p7\n\
-├──4 B (57.14%) ── c [+]\n\
-└──3 B (42.86%) ── b [+]\n\
-\n\
--5 B ── p7 [-]\n\
-\n\
-End of P7\n\
-P8\n\
-Other Measurements\n\
-\n\
--22 B (100.0%) -- p8\n\
-└──-22 B (100.0%) -- a\n\
- ├──-11 B (50.00%) -- b\n\
- │ ├───-7 B (31.82%) -- c\n\
- │ │ ├──-4 B (18.18%) ── e [-]\n\
- │ │ └──-3 B (13.64%) ── d [-]\n\
- │ ├───-5 B (22.73%) ── f [-]\n\
- │ └────1 B (-4.55%) ── (fake child) [!]\n\
- └──-11 B (50.00%) -- g\n\
- ├───-7 B (31.82%) ── i [-]\n\
- ├───-6 B (27.27%) ── h [-]\n\
- └────2 B (-9.09%) ── (fake child) [!]\n\
-\n\
-End of P8\n\
-";
-
- // This is the output for the crash reports diff.
- let expectedDiff2 =
-"\
-Main Process (pid NNN)\n\
-Other Measurements\n\
-\n\
-1 B ── heap-allocated\n\
-\n\
-End of Main Process (pid NNN)\n\
-";
-
- let frames = [
- // This loads a pre-existing memory reports file that is valid.
- { filename: "memory-reports-good.json", expected: expectedGood, dumpFirst: false, verbose: true },
-
- // This loads a pre-existing crash dump file that is valid.
- { filename: "crash-dump-good.json", expected: expectedGood2, dumpFirst: false, verbose: true },
-
- // This dumps to a file and then reads it back in. (The result is the same
- // as the previous test.)
- { filename: "memory-reports-dumped.json.gz", expected: expectedGood2, dumpFirst: true, verbose: true },
-
- // This loads a pre-existing file that is invalid.
- { filename: "memory-reports-bad.json", expected: expectedBad, dumpFirst: false, verbose: true },
-
- // This diffs two pre-existing memory reports files.
- { filename: "memory-reports-diff1.json", filename2: "memory-reports-diff2.json", expected: expectedDiffNonVerbose, dumpFirst: false, verbose: false },
-
- // Ditto.
- { filename: "memory-reports-diff1.json", filename2: "memory-reports-diff2.json", expected: expectedDiffVerbose, dumpFirst: false, verbose: true },
-
- // This diffs two pre-existing crash report files.
- { filename: "crash-dump-diff1.json", filename2: "crash-dump-diff2.json", expected: expectedDiff2, dumpFirst: false, verbose: true }
- ];
-
- SimpleTest.waitForFocus(chain(frames));
-
- SimpleTest.waitForExplicitFinish();
- ]]>
- </script>
-</window>
diff --git a/toolkit/components/aboutmemory/tests/test_aboutmemory4.xul b/toolkit/components/aboutmemory/tests/test_aboutmemory4.xul
deleted file mode 100644
index f2c752ac5..000000000
--- a/toolkit/components/aboutmemory/tests/test_aboutmemory4.xul
+++ /dev/null
@@ -1,179 +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 loading of memory reports from file when specified
- in about:memory's URL (via the "file=" suffix). -->
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml"></body>
-
- <!-- test code goes here -->
- <script type="application/javascript">
- <![CDATA[
- "use strict";
-
- function makePathname(aFilename) {
- let file = Components.classes["@mozilla.org/file/directory_service;1"]
- .getService(Components.interfaces.nsIProperties)
- .get("CurWorkD", Components.interfaces.nsIFile);
- file.append("chrome");
- file.append("toolkit");
- file.append("components");
- file.append("aboutmemory");
- file.append("tests");
- file.append(aFilename);
- return file.path;
- }
-
- // Load the given file into the frame, then copy+paste the entire frame and
- // check that the cut text matches what we expect.
- function test(aFilename, aExpected, aNext) {
- let frame = document.createElementNS("http://www.w3.org/1999/xhtml", "iframe")
- frame.height = 300;
- frame.src = "about:memory?file=" + makePathname(aFilename);
- document.documentElement.appendChild(frame);
- frame.focus();
-
- // Initialize the clipboard contents.
- SpecialPowers.clipboardCopyString("initial clipboard value");
-
- let numFailures = 0, maxFailures = 30;
-
- // Because the file load is async, we don't know when it will finish and
- // the output will show up. So we poll.
- function copyPasteAndCheck() {
- // Copy and paste frame contents, and filter out non-deterministic
- // differences.
- synthesizeKey("A", {accelKey: true});
- synthesizeKey("C", {accelKey: true});
- let actual = SpecialPowers.getClipboardData("text/unicode");
- actual = actual.replace(/\(pid \d+\)/, "(pid NNN)");
-
- if (actual.trim() === aExpected.trim()) {
- SimpleTest.ok(true, "Clipboard has the expected contents");
- aNext();
- } else {
- numFailures++;
- if (numFailures === maxFailures) {
- ok(false, "pasted text doesn't match");
- dump("******EXPECTED******\n");
- dump(aExpected);
- dump("*******ACTUAL*******\n");
- dump(actual);
- dump("********************\n");
- SimpleTest.finish();
- } else {
- setTimeout(copyPasteAndCheck, 100);
- }
- }
- }
- copyPasteAndCheck();
- }
-
- // Returns a function that chains together multiple test() calls.
- function chain(aFrameIds) {
- let x = aFrameIds.shift();
- if (x) {
- return function() { test(x.filename, x.expected, chain(aFrameIds)); }
- } else {
- return function() { SimpleTest.finish(); };
- }
- }
-
- // This is pretty simple output, but that's ok; this file is about testing
- // the loading of data from file. If we got this far, we're doing fine.
- let expectedGood =
-"\
-Explicit-only process\n\
-\n\
-WARNING: the 'heap-allocated' memory reporter does not work for this platform and/or configuration. This means that 'heap-unclassified' is not shown and the 'explicit' tree shows less memory than it should.\n\
-Explicit Allocations\n\
-\n\
-0.10 MB (100.0%) -- explicit\n\
-└──0.10 MB (100.0%) ── a/b\n\
-\n\
-Other Measurements\n\
-\n\
-End of Explicit-only process\n\
-Heap-unclassified process\n\
-Explicit Allocations\n\
-\n\
-250.00 MB (100.0%) -- explicit\n\
-├──200.00 MB (80.00%) ── heap-unclassified\n\
-└───50.00 MB (20.00%) ── a/b\n\
-\n\
-Other Measurements\n\
-\n\
-250.00 MB ── heap-allocated\n\
-\n\
-End of Heap-unclassified process\n\
-Main Process (pid NNN)\n\
-Explicit Allocations\n\
-\n\
-250.00 MB (100.0%) -- explicit\n\
-├──200.00 MB (80.00%) ── heap-unclassified\n\
-└───50.00 MB (20.00%) ── a/b\n\
-\n\
-Other Measurements\n\
-\n\
-0.00 MB (100.0%) -- compartments\n\
-└──0.00 MB (100.0%) ── system/a\n\
-\n\
-0.00 MB (100.0%) -- ghost-windows\n\
-└──0.00 MB (100.0%) ── a\n\
-\n\
-0.30 MB (100.0%) -- other\n\
-├──0.20 MB (66.67%) ── a\n\
-└──0.10 MB (33.33%) ── b\n\
-\n\
-0.00 MB (100.0%) -- pss\n\
-└──0.00 MB (100.0%) ── a\n\
-\n\
-0.00 MB (100.0%) -- rss\n\
-└──0.00 MB (100.0%) ── a\n\
-\n\
-0.00 MB (100.0%) -- size\n\
-└──0.00 MB (100.0%) ── a\n\
-\n\
-0.00 MB (100.0%) -- swap\n\
-└──0.00 MB (100.0%) ── a\n\
-\n\
-250.00 MB ── heap-allocated\n\
-\n\
-End of Main Process (pid NNN)\n\
-Other-only process\n\
-Other Measurements\n\
-\n\
-0.19 MB (100.0%) -- a\n\
-├──0.10 MB (50.00%) ── b\n\
-└──0.10 MB (50.00%) ── c\n\
-\n\
-0.48 MB ── heap-allocated\n\
-\n\
-End of Other-only process\n\
-";
-
- // This is the output for a malformed data file.
- let expectedBad =
-"\
-Error: Invalid memory report(s): missing 'hasMozMallocUsableSize' property";
-
- let frames = [
- // This loads a pre-existing file that is valid.
- { filename: "memory-reports-good.json", expected: expectedGood },
-
- // This loads a pre-existing file that is valid.
- { filename: "memory-reports-bad.json", expected: expectedBad }
- ];
-
- SimpleTest.waitForFocus(chain(frames));
-
- SimpleTest.waitForExplicitFinish();
- ]]>
- </script>
-</window>
diff --git a/toolkit/components/aboutmemory/tests/test_aboutmemory5.xul b/toolkit/components/aboutmemory/tests/test_aboutmemory5.xul
deleted file mode 100644
index 2fec803b9..000000000
--- a/toolkit/components/aboutmemory/tests/test_aboutmemory5.xul
+++ /dev/null
@@ -1,167 +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 and loading of memory reports to/from file in
- about:memory in the presence of child processes. It is also notable
- for being an about:memory test that uses the real reporters, rather
- than fake deterministic ones, and so tends to show up problems in the
- real reporters (like bogus negative values). -->
-
- <!-- 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;
- let mgr = Cc["@mozilla.org/memory-reporter-manager;1"].
- getService(Ci.nsIMemoryReporterManager);
-
- let numRemotes = 3;
- let numReady = 0;
-
- // Create some remote processes, and set up message-passing so that
- // we know when each child is fully initialized.
- let remotes = [];
-
- let prefs = [
- ["dom.ipc.processCount", 3], // Allow up to 3 child processes
- ["memory.report_concurrency", 2], // Cover more child handling cases
- ["memory.system_memory_reporter", true] // Test SystemMemoryReporter
- ];
-
- SpecialPowers.pushPrefEnv({"set": prefs}, function() {
- for (let i = 0; i < numRemotes; i++) {
- let w = remotes[i] = window.open("remote.xul", "", "chrome");
-
- w.addEventListener("load", function loadHandler() {
- w.removeEventListener("load", loadHandler);
- let remoteBrowser = w.document.getElementById("remote");
- let mm = remoteBrowser.messageManager;
- mm.addMessageListener("test:ready", function readyHandler() {
- mm.removeMessageListener("test:ready", readyHandler);
- numReady++;
- if (numReady == numRemotes) {
- // All the remote processes are ready.
- SimpleTest.waitForFocus(onFocus);
- }
- });
- mm.loadFrameScript("data:," + encodeURI("sendAsyncMessage('test:ready');"), true);
- });
- }
- });
-
- // Load the given file into the frame, then copy+paste the entire frame and
- // check that the cut text matches what we expect.
- function onFocus() {
- let frame = document.getElementById("amFrame");
- frame.focus();
-
- function getFilePath(aFilename) {
- let file = Cc["@mozilla.org/file/directory_service;1"]
- .getService(Components.interfaces.nsIProperties)
- .get("CurWorkD", Components.interfaces.nsIFile);
- file.append("chrome");
- file.append("toolkit");
- file.append("components");
- file.append("aboutmemory");
- file.append("tests");
- file.append(aFilename);
- return file.path;
- }
-
- let filePath = getFilePath("memory-reports-dumped.json.gz");
-
- let e = document.createEvent('Event');
- e.initEvent('change', true, true);
-
- let dumper = Cc["@mozilla.org/memory-info-dumper;1"].
- getService(Ci.nsIMemoryInfoDumper);
- dumper.dumpMemoryReportsToNamedFile(filePath, loadAndCheck, null,
- /* anonymize = */ false);
-
- function loadAndCheck() {
- // Load the file.
- let fileInput1 =
- frame.contentWindow.document.getElementById("fileInput1");
- fileInput1.value = filePath; // this works because it's a chrome test
- fileInput1.dispatchEvent(e);
-
- // Initialize the clipboard contents.
- SpecialPowers.clipboardCopyString("initial clipboard value");
-
- let numFailures = 0, maxFailures = 30;
-
- copyPasteAndCheck();
-
- // Because the file load is async, we don't know when it will finish and
- // the output will show up. So we poll.
- function copyPasteAndCheck() {
- // Copy and paste frame contents, and filter out non-deterministic
- // differences.
- synthesizeKey("A", {accelKey: true});
- synthesizeKey("C", {accelKey: true});
- let actual = SpecialPowers.getClipboardData("text/unicode");
-
- // If we have more than 1000 chars, we've probably successfully
- // copy+pasted.
- if (actual.length > 1000) {
-
- let good = true;
-
- if (actual.match("End of System")) {
- let m1 = actual.match("anonymous") &&
- actual.match("shared-libraries");
- ok(m1, "system-wide reporter")
- good = good && !!m1;
- }
-
- // Note: Match "vsize" but not "vsize-max-contiguous".
- let vsizes = actual.match(/vsize[^-]/g);
- let endOfBrowsers = actual.match(/End of Browser/g);
- if (endOfBrowsers == null) {
- endOfBrowsers = actual.match(/End of Web Content/g);
- }
- let m2 = (vsizes.length == 4 && endOfBrowsers.length == 3);
- ok(m2, "three child processes present in loaded data");
- good = good && !!m2;
-
- if (!good) {
- dump("*******ACTUAL*******\n");
- dump(actual);
- dump("********************\n");
- }
-
- // Close the remote processes.
- for (let i = 0; i < numRemotes; i++) {
- remotes[i].close();
- }
-
- SimpleTest.finish();
-
- } else {
- numFailures++;
- if (numFailures === maxFailures) {
- ok(false, "not enough chars in pasted output");
- SimpleTest.finish();
- } else {
- setTimeout(copyPasteAndCheck, 100);
- }
- }
- }
- }
- }
-
- SimpleTest.waitForExplicitFinish();
- ]]>
- </script>
-</window>
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>
diff --git a/toolkit/components/aboutmemory/tests/test_dumpGCAndCCLogsToFile.xul b/toolkit/components/aboutmemory/tests/test_dumpGCAndCCLogsToFile.xul
deleted file mode 100644
index a39869b7d..000000000
--- a/toolkit/components/aboutmemory/tests/test_dumpGCAndCCLogsToFile.xul
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="GC/CC logging with child processes"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- </body>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
- const Cc = Components.classes;
- const Ci = Components.interfaces;
-
- SimpleTest.waitForExplicitFinish();
-
- let numRemotes = 3;
- let numReady = 0;
-
- // Create some remote processes, and set up message-passing so that
- // we know when each child is fully initialized.
- let remotes = [];
- SpecialPowers.pushPrefEnv({"set": [["dom.ipc.processCount", numRemotes]]},
- function() {
- for (let i = 0; i < numRemotes; i++) {
- let w = remotes[i] = window.open("remote.xul", "", "chrome");
-
- w.addEventListener("load", function loadHandler() {
- w.removeEventListener("load", loadHandler);
- let remoteBrowser = w.document.getElementById("remote");
- let mm = remoteBrowser.messageManager;
- mm.addMessageListener("test:ready", function readyHandler() {
- mm.removeMessageListener("test:ready", readyHandler);
- numReady++;
- if (numReady == numRemotes) {
- // All the remote processes are ready. Run test.
- runTest();
- }
- });
- mm.loadFrameScript("data:," + encodeURI("sendAsyncMessage('test:ready');"), true);
- });
- }
- });
-
- let dumper = Cc["@mozilla.org/memory-info-dumper;1"].
- getService(Ci.nsIMemoryInfoDumper);
-
- function runTest()
- {
- let numParents = 0;
- let numChildren = 0;
- dumper.dumpGCAndCCLogsToFile(
- /* identifier: */ "test." + Date.now(),
- /* allTraces: */ false,
- /* childProcesses: */ true,
- {
- onDump: function(gcLog, ccLog, isParent) {
- if (isParent) {
- numParents++;
- } else {
- numChildren++;
- }
- checkAndRemoveLog(gcLog);
- checkAndRemoveLog(ccLog);
- },
- onFinish: function() {
- is(numParents, 1,
- "GC/CC logs for the parent process");
- is(numChildren, numRemotes,
- "GC/CC logs for each child process");
- cleanUpAndFinish();
- }
- });
- }
-
- function cleanUpAndFinish() {
- // Close the remote processes.
- for (let i = 0; i < numRemotes; i++) {
- remotes[i].close();
- }
- SimpleTest.finish();
- }
-
- function checkAndRemoveLog(logFile) {
- let name = logFile.path;
- ok(logFile.exists(), "log file "+name+" exists");
- ok(logFile.isFile(), "log file "+name+" is a regular file");
- ok(logFile.fileSize > 0, "log file "+name+" is not empty");
- logFile.remove(/* recursive: */ false);
- }
-
- ]]></script>
-</window>
diff --git a/toolkit/components/aboutmemory/tests/test_memoryReporters.xul b/toolkit/components/aboutmemory/tests/test_memoryReporters.xul
deleted file mode 100644
index 9d56890b3..000000000
--- a/toolkit/components/aboutmemory/tests/test_memoryReporters.xul
+++ /dev/null
@@ -1,424 +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="Memory reporters"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <!-- This file tests (in a rough fashion) whether the memory reporters are
- producing sensible results. test_aboutmemory.xul tests the
- presentation of memory reports in about:memory. -->
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <!-- In bug 773533, <marquee> elements crashed the JS memory reporter -->
- <marquee>Marquee</marquee>
- </body>
-
- <!-- some URIs that should be anonymized in anonymous mode -->
- <iframe id="amFrame" height="200" src="http://example.org:80"></iframe>
- <iframe id="amFrame" height="200" src="https://example.com:443"></iframe>
-
- <!-- test code goes here -->
- <script type="application/javascript">
- <![CDATA[
-
- "use strict";
-
- const Cc = Components.classes;
- const Ci = Components.interfaces;
- const Cr = Components.results;
-
- const NONHEAP = Ci.nsIMemoryReporter.KIND_NONHEAP;
- const HEAP = Ci.nsIMemoryReporter.KIND_HEAP;
- const OTHER = Ci.nsIMemoryReporter.KIND_OTHER;
-
- const BYTES = Ci.nsIMemoryReporter.UNITS_BYTES;
- const COUNT = Ci.nsIMemoryReporter.UNITS_COUNT;
- const COUNT_CUMULATIVE = Ci.nsIMemoryReporter.UNITS_COUNT_CUMULATIVE;
- const PERCENTAGE = Ci.nsIMemoryReporter.UNITS_PERCENTAGE;
-
- // Use backslashes instead of forward slashes due to memory reporting's hacky
- // handling of URLs.
- const XUL_NS =
- "http:\\\\www.mozilla.org\\keymaster\\gatekeeper\\there.is.only.xul";
-
- SimpleTest.waitForExplicitFinish();
-
- let vsizeAmounts = [];
- let residentAmounts = [];
- let heapAllocatedAmounts = [];
- let storageSqliteAmounts = [];
-
- let jsGcHeapUsedGcThingsTotal = 0;
- let jsGcHeapUsedGcThings = {};
-
- let present = {}
-
- // Generate a long, random string. We'll check that this string is
- // reported in at least one of the memory reporters.
- let bigString = "";
- while (bigString.length < 10000) {
- bigString += Math.random();
- }
- let bigStringPrefix = bigString.substring(0, 100);
-
- // Generate many copies of two distinctive short strings, "!)(*&" and
- // "@)(*&". We'll check that these strings are reported in at least
- // one of the memory reporters.
- let shortStrings = [];
- for (let i = 0; i < 10000; i++) {
- let str = (Math.random() > 0.5 ? "!" : "@") + ")(*&";
- shortStrings.push(str);
- }
-
- let mySandbox = Components.utils.Sandbox(document.nodePrincipal,
- { sandboxName: "this-is-a-sandbox-name" });
-
- function handleReportNormal(aProcess, aPath, aKind, aUnits, aAmount,
- aDescription)
- {
- // Record the values of some notable reporters.
- if (aPath === "vsize") {
- vsizeAmounts.push(aAmount);
- } else if (aPath === "resident") {
- residentAmounts.push(aAmount);
- } else if (aPath.search(/^js-main-runtime-gc-heap-committed\/used\/gc-things\//) >= 0) {
- jsGcHeapUsedGcThingsTotal += aAmount;
- jsGcHeapUsedGcThings[aPath] = (jsGcHeapUsedGcThings[aPath] | 0) + 1;
- } else if (aPath === "heap-allocated") {
- heapAllocatedAmounts.push(aAmount);
- } else if (aPath === "storage-sqlite") {
- storageSqliteAmounts.push(aAmount);
-
- // Check the presence of some other notable reporters.
- } else if (aPath.search(/^explicit\/js-non-window\/.*compartment\(/) >= 0) {
- present.jsNonWindowCompartments = true;
- } else if (aPath.search(/^explicit\/window-objects\/top\(.*\/js-compartment\(/) >= 0) {
- present.windowObjectsJsCompartments = true;
- } else if (aPath.search(/^explicit\/storage\/sqlite\/places.sqlite/) >= 0) {
- present.places = true;
- } else if (aPath.search(/^explicit\/images/) >= 0) {
- present.images = true;
- } else if (aPath.search(/^explicit\/xpti-working-set$/) >= 0) {
- present.xptiWorkingSet = true;
- } else if (aPath.search(/^explicit\/atom-tables\/main$/) >= 0) {
- present.atomTablesMain = true;
- } else if (/\[System Principal\].*this-is-a-sandbox-name/.test(aPath)) {
- // A system compartment with a location (such as a sandbox) should
- // show that location.
- present.sandboxLocation = true;
- } else if (aPath.includes(bigStringPrefix)) {
- present.bigString = true;
- } else if (aPath.includes("!)(*&")) {
- present.smallString1 = true;
- } else if (aPath.includes("@)(*&")) {
- present.smallString2 = true;
- }
-
- // Shouldn't get any anonymized paths.
- if (aPath.includes('<anonymized')) {
- present.anonymizedWhenUnnecessary = aPath;
- }
- }
-
- function handleReportAnonymized(aProcess, aPath, aKind, aUnits, aAmount,
- aDescription)
- {
- // Path might include an xmlns using http, which is safe to ignore.
- let reducedPath = aPath.replace(XUL_NS, "");
-
- // Shouldn't get http: or https: in any paths.
- if (reducedPath.includes('http:')) {
- present.httpWhenAnonymized = aPath;
- }
-
- // file: URLs should have their path anonymized.
- if (reducedPath.search('file:..[^<]') !== -1) {
- present.unanonymizedFilePathWhenAnonymized = aPath;
- }
- }
-
- let mgr = Cc["@mozilla.org/memory-reporter-manager;1"].
- getService(Ci.nsIMemoryReporterManager);
-
- let amounts = [
- "vsize",
- "vsizeMaxContiguous",
- "resident",
- "residentFast",
- "residentPeak",
- "residentUnique",
- "heapAllocated",
- "heapOverheadFraction",
- "JSMainRuntimeGCHeap",
- "JSMainRuntimeTemporaryPeak",
- "JSMainRuntimeCompartmentsSystem",
- "JSMainRuntimeCompartmentsUser",
- "imagesContentUsedUncompressed",
- "storageSQLite",
- "lowMemoryEventsVirtual",
- "lowMemoryEventsPhysical",
- "ghostWindows",
- "pageFaultsHard",
- ];
- for (let i = 0; i < amounts.length; i++) {
- try {
- // If mgr[amounts[i]] throws an exception, just move on -- some amounts
- // aren't available on all platforms. But if the attribute simply
- // isn't present, that indicates the distinguished amounts have changed
- // and this file hasn't been updated appropriately.
- let dummy = mgr[amounts[i]];
- ok(dummy !== undefined,
- "accessed an unknown distinguished amount: " + amounts[i]);
- } catch (ex) {
- }
- }
-
- // Run sizeOfTab() to make sure it doesn't crash. We can't check the result
- // values because they're non-deterministic.
- let jsObjectsSize = {};
- let jsStringsSize = {};
- let jsOtherSize = {};
- let domSize = {};
- let styleSize = {};
- let otherSize = {};
- let totalSize = {};
- let jsMilliseconds = {};
- let nonJSMilliseconds = {};
- mgr.sizeOfTab(window, jsObjectsSize, jsStringsSize, jsOtherSize,
- domSize, styleSize, otherSize, totalSize,
- jsMilliseconds, nonJSMilliseconds);
-
- let asyncSteps = [
- getReportsNormal,
- getReportsAnonymized,
- checkResults,
- test_register_strong,
- test_register_strong, // Make sure re-registering works
- test_register_weak,
- SimpleTest.finish
- ];
-
- function runNext() {
- setTimeout(asyncSteps.shift(), 0);
- }
-
- function getReportsNormal()
- {
- mgr.getReports(handleReportNormal, null,
- runNext, null,
- /* anonymize = */ false);
- }
-
- function getReportsAnonymized()
- {
- mgr.getReports(handleReportAnonymized, null,
- runNext, null,
- /* anonymize = */ true);
- }
-
- function checkSizeReasonable(aName, aAmount)
- {
- // Check the size is reasonable -- i.e. not ridiculously large or small.
- ok(100 * 1000 <= aAmount && aAmount <= 10 * 1000 * 1000 * 1000,
- aName + "'s size is reasonable");
- }
-
- function checkSpecialReport(aName, aAmounts, aCanBeUnreasonable)
- {
- ok(aAmounts.length == 1, aName + " has " + aAmounts.length + " report");
- let n = aAmounts[0];
- if (!aCanBeUnreasonable) {
- checkSizeReasonable(aName, n);
- }
- }
-
- function checkResults()
- {
- try {
- // Nb: mgr.heapAllocated will throw NS_ERROR_NOT_AVAILABLE if this is a
- // --disable-jemalloc build. Allow for skipping this test on that
- // exception, but *only* that exception.
- let dummy = mgr.heapAllocated;
- checkSpecialReport("heap-allocated", heapAllocatedAmounts);
- } catch (ex) {
- is(ex.result, Cr.NS_ERROR_NOT_AVAILABLE, "mgr.heapAllocated exception");
- }
- // vsize may be unreasonable if ASAN is enabled
- checkSpecialReport("vsize", vsizeAmounts, /*canBeUnreasonable*/true);
- checkSpecialReport("resident", residentAmounts);
-
- for (var reporter in jsGcHeapUsedGcThings) {
- ok(jsGcHeapUsedGcThings[reporter] == 1);
- }
- checkSizeReasonable("js-main-runtime-gc-heap-committed/used/gc-things",
- jsGcHeapUsedGcThingsTotal);
-
- ok(present.jsNonWindowCompartments, "js-non-window compartments are present");
- ok(present.windowObjectsJsCompartments, "window-objects/.../js compartments are present");
- ok(present.places, "places is present");
- ok(present.images, "images is present");
- ok(present.xptiWorkingSet, "xpti-working-set is present");
- ok(present.atomTablesMain, "atom-tables/main is present");
- ok(present.sandboxLocation, "sandbox locations are present");
- ok(present.bigString, "large string is present");
- ok(present.smallString1, "small string 1 is present");
- ok(present.smallString2, "small string 2 is present");
-
- ok(!present.anonymizedWhenUnnecessary,
- "anonymized paths are not present when unnecessary. Failed case: " +
- present.anonymizedWhenUnnecessary);
- ok(!present.httpWhenAnonymized,
- "http URLs are anonymized when necessary. Failed case: " +
- present.httpWhenAnonymized);
- ok(!present.unanonymizedFilePathWhenAnonymized,
- "file URLs are anonymized when necessary. Failed case: " +
- present.unanonymizedFilePathWhenAnonymized);
-
- runNext();
- }
-
- // Reporter registration tests
-
- // collectReports() calls to the test reporter.
- let called = 0;
-
- // The test memory reporter, testing the various report units.
- // Also acts as a report collector, verifying the reported values match the
- // expected ones after passing through XPConnect / nsMemoryReporterManager
- // and back.
- function MemoryReporterAndCallback() {
- this.seen = 0;
- }
- MemoryReporterAndCallback.prototype = {
- // The test reports.
- // Each test key corresponds to the path of the report. |amount| is a
- // function called when generating the report. |expected| is a function
- // to be tested when receiving a report during collection. If |expected| is
- // omitted the |amount| will be checked instead.
- tests: {
- "test-memory-reporter-bytes1": {
- units: BYTES,
- amount: () => 0
- },
- "test-memory-reporter-bytes2": {
- units: BYTES,
- amount: () => (1<<30) * 8 // awkward way to say 8G in JS
- },
- "test-memory-reporter-counter": {
- units: COUNT,
- amount: () => 2
- },
- "test-memory-reporter-ccounter": {
- units: COUNT_CUMULATIVE,
- amount: () => ++called,
- expected: () => called
- },
- "test-memory-reporter-percentage": {
- units: PERCENTAGE,
- amount: () => 9999
- }
- },
- // nsIMemoryReporter
- collectReports: function(callback, data, anonymize) {
- for (let path of Object.keys(this.tests)) {
- try {
- let test = this.tests[path];
- callback.callback(
- "", // Process. Should be "" initially.
- path,
- OTHER,
- test.units,
- test.amount(),
- "Test " + path + ".",
- data);
- }
- catch (ex) {
- ok(false, ex);
- }
- }
- },
- // nsIMemoryReporterCallback
- callback: function(process, path, kind, units, amount, data) {
- if (path in this.tests) {
- this.seen++;
- let test = this.tests[path];
- ok(units === test.units, "Test reporter units match");
- ok(amount === (test.expected || test.amount)(),
- "Test reporter values match: " + amount);
- }
- },
- // Checks that the callback has seen the expected number of reports, and
- // resets the callback counter.
- // @param expected Optional. Expected number of reports the callback
- // should have processed.
- finish: function(expected) {
- if (expected === undefined) {
- expected = Object.keys(this.tests).length;
- }
- is(expected, this.seen,
- "Test reporter called the correct number of times: " + expected);
- this.seen = 0;
- }
- };
-
- // General memory reporter + registerStrongReporter tests.
- function test_register_strong() {
- let reporterAndCallback = new MemoryReporterAndCallback();
- // Registration works.
- mgr.registerStrongReporter(reporterAndCallback);
-
- // Check the generated reports.
- mgr.getReports(reporterAndCallback, null,
- () => {
- reporterAndCallback.finish();
- window.setTimeout(test_unregister_strong, 0, reporterAndCallback);
- }, null,
- /* anonymize = */ false);
- }
-
- function test_unregister_strong(aReporterAndCallback)
- {
- mgr.unregisterStrongReporter(aReporterAndCallback);
-
- // The reporter was unregistered, hence there shouldn't be any reports from
- // the test reporter.
- mgr.getReports(aReporterAndCallback, null,
- () => {
- aReporterAndCallback.finish(0);
- runNext();
- }, null,
- /* anonymize = */ false);
- }
-
- // Check that you cannot register JS components as weak reporters.
- function test_register_weak() {
- let reporterAndCallback = new MemoryReporterAndCallback();
- try {
- // Should fail! nsMemoryReporterManager will only hold a raw pointer to
- // "weak" reporters. When registering a weak reporter, XPConnect will
- // create a WrappedJS for JS components. This WrappedJS would be
- // successfully registered with the manager, only to be destroyed
- // immediately after, which would eventually lead to a crash when
- // collecting the reports. Therefore nsMemoryReporterManager should
- // reject WrappedJS reporters, which is what is tested here.
- // See bug 950391 comment #0.
- mgr.registerWeakReporter(reporterAndCallback);
- ok(false, "Shouldn't be allowed to register a JS component (WrappedJS)");
- }
- catch (ex) {
- ok(ex.message.indexOf("NS_ERROR_") >= 0,
- "WrappedJS reporter got rejected: " + ex);
- }
-
- runNext();
- }
-
- // Kick-off the async tests.
- runNext();
-
- ]]>
- </script>
-</window>
diff --git a/toolkit/components/aboutmemory/tests/test_memoryReporters2.xul b/toolkit/components/aboutmemory/tests/test_memoryReporters2.xul
deleted file mode 100644
index 0e8ba2e81..000000000
--- a/toolkit/components/aboutmemory/tests/test_memoryReporters2.xul
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Memory reporters with child processes"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <!-- This file tests (in a rough fashion) whether the memory reporters are
- producing sensible results in the presence of child processes. -->
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- </body>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
- const Cc = Components.classes;
- const Ci = Components.interfaces;
-
- SimpleTest.waitForExplicitFinish();
-
- let numRemotes = 3;
- let numReady = 0;
-
- // Create some remote processes, and set up message-passing so that
- // we know when each child is fully initialized.
- let remotes = [];
- SpecialPowers.pushPrefEnv({"set": [["dom.ipc.processCount", 3]]}, function() {
- for (let i = 0; i < numRemotes; i++) {
- let w = remotes[i] = window.open("remote.xul", "", "chrome");
-
- w.addEventListener("load", function loadHandler() {
- w.removeEventListener("load", loadHandler);
- let remoteBrowser = w.document.getElementById("remote");
- let mm = remoteBrowser.messageManager;
- mm.addMessageListener("test:ready", function readyHandler() {
- mm.removeMessageListener("test:ready", readyHandler);
- numReady++;
- if (numReady == numRemotes) {
- // All the remote processes are ready. Do memory reporting.
- doReports();
- }
- });
- mm.loadFrameScript("data:," + encodeURI("sendAsyncMessage('test:ready');"), true);
- });
- }
- });
-
- let mgr = Cc["@mozilla.org/memory-reporter-manager;1"].
- getService(Ci.nsIMemoryReporterManager);
-
- function doReports()
- {
- let residents = {};
-
- let handleReport = function(aProcess, aPath, aKind, aUnits, aAmount, aDesc) {
- if (aPath === "resident") {
- ok(100 * 1000 <= aAmount && aAmount <= 10 * 1000 * 1000 * 1000,
- "resident is reasonable");
- residents[aProcess] = aAmount;
- }
- }
-
- let processReports = function() {
- // First, test a failure case: calling getReports() before the previous
- // getReports() has finished should silently abort. (And the arguments
- // won't be used.)
- mgr.getReports(
- () => ok(false, "handleReport called for nested getReports() call"),
- null, null, null, /* anonymize = */ false
- );
-
- // Close the remote processes.
- for (let i = 0; i < numRemotes; i++) {
- remotes[i].close();
- }
-
- // Check the results.
-
- let processes = Object.keys(residents);
- ok(processes.length == numRemotes + 1, "correct resident count");
-
- let numEmptyProcesses = 0, numNonEmptyProcesses = 0;
- for (let i = 0; i < processes.length; i++) {
- if (processes[i] == "") {
- numEmptyProcesses++;
- } else {
- ok(processes[i].startsWith("Browser (") || processes[i].startsWith("Web Content ("),
- "correct non-empty process name prefix: " + processes[i]);
- numNonEmptyProcesses++;
- }
- }
- ok(numEmptyProcesses == 1, "correct empty process name count");
- ok(numNonEmptyProcesses == numRemotes,
- "correct non-empty process name count");
-
- SimpleTest.finish();
- }
-
- mgr.getReports(handleReport, null, processReports, null,
- /* anonymize = */ false);
- }
-
- ]]></script>
-</window>
diff --git a/toolkit/components/aboutmemory/tests/test_sqliteMultiReporter.xul b/toolkit/components/aboutmemory/tests/test_sqliteMultiReporter.xul
deleted file mode 100644
index 3452bbbc7..000000000
--- a/toolkit/components/aboutmemory/tests/test_sqliteMultiReporter.xul
+++ /dev/null
@@ -1,54 +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>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml"></body>
-
- <!-- test code goes here -->
- <script type="application/javascript">
- <![CDATA[
-
- // Test for bug 708248, where the SQLite memory multi-reporter was
- // crashing when a DB was closed.
-
- // Nb: this test is all JS and chould be done with an xpcshell test,
- // but all the other memory reporter tests are mochitests, so it's easier
- // if this one is too.
-
- const Cc = Components.classes;
- const Ci = Components.interfaces;
- const Cu = Components.utils;
-
- SimpleTest.waitForExplicitFinish();
-
- // Make a fake DB file.
- let file = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties).
- get("ProfD", Ci.nsIFile);
- file.append("test_sqliteMultiReporter-fake-DB-tmp.sqlite");
-
- // Open and close the DB.
- let storage = Cc["@mozilla.org/storage/service;1"].
- getService(Ci.mozIStorageService);
- let db = storage.openDatabase(file);
- db.close();
-
- // Invoke all the reporters. The SQLite multi-reporter is among
- // them. It shouldn't crash.
- let mgr = Cc["@mozilla.org/memory-reporter-manager;1"].
- getService(Ci.nsIMemoryReporterManager);
- mgr.getReports(function(){}, null,
- () => {
- ok(true, "didn't crash");
- SimpleTest.finish();
- }, null,
- /* anonymize = */ false);
-
- ]]>
- </script>
-</window>
diff --git a/toolkit/components/aboutperformance/moz.build b/toolkit/components/aboutperformance/moz.build
index d8e6acd95..aac3a838c 100644
--- a/toolkit/components/aboutperformance/moz.build
+++ b/toolkit/components/aboutperformance/moz.build
@@ -5,5 +5,3 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
JAR_MANIFESTS += ['jar.mn']
-
-BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
diff --git a/toolkit/components/aboutperformance/tests/browser/.eslintrc.js b/toolkit/components/aboutperformance/tests/browser/.eslintrc.js
deleted file mode 100644
index 7c8021192..000000000
--- a/toolkit/components/aboutperformance/tests/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/aboutperformance/tests/browser/browser.ini b/toolkit/components/aboutperformance/tests/browser/browser.ini
deleted file mode 100644
index 92f1d98e6..000000000
--- a/toolkit/components/aboutperformance/tests/browser/browser.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-head = head.js
-support-files =
- browser_compartments.html
- browser_compartments_frame.html
- browser_compartments_script.js
-
-[browser_aboutperformance.js]
diff --git a/toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js b/toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js
deleted file mode 100644
index 60760ea7f..000000000
--- a/toolkit/components/aboutperformance/tests/browser/browser_aboutperformance.js
+++ /dev/null
@@ -1,300 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Cu.import("resource://testing-common/ContentTask.jsm", this);
-
-const URL = "http://example.com/browser/toolkit/components/aboutperformance/tests/browser/browser_compartments.html?test=" + Math.random();
-
-// This function is injected as source as a frameScript
-function frameScript() {
- "use strict";
-
- addMessageListener("aboutperformance-test:done", () => {
- content.postMessage("stop", "*");
- sendAsyncMessage("aboutperformance-test:done", null);
- });
- addMessageListener("aboutperformance-test:setTitle", ({data: title}) => {
- content.document.title = title;
- sendAsyncMessage("aboutperformance-test:setTitle", null);
- });
-
- addMessageListener("aboutperformance-test:closeTab", ({data: options}) => {
- let observer = function(subject, topic, mode) {
- dump(`aboutperformance-test:closeTab 1 ${options.url}\n`);
- Services.obs.removeObserver(observer, "about:performance-update-complete");
-
- let exn;
- let found = false;
- try {
- for (let eltContent of content.document.querySelectorAll("li.delta")) {
- let eltName = eltContent.querySelector("li.name");
- if (!eltName.textContent.includes(options.url)) {
- continue;
- }
-
- found = true;
- let [eltCloseTab, eltReloadTab] = eltContent.querySelectorAll("button");
- let button;
- if (options.mode == "reload") {
- button = eltReloadTab;
- } else if (options.mode == "close") {
- button = eltCloseTab;
- } else {
- throw new TypeError(options.mode);
- }
- dump(`aboutperformance-test:closeTab clicking on ${button.textContent}\n`);
- button.click();
- return;
- }
- } catch (ex) {
- dump(`aboutperformance-test:closeTab: error ${ex}\n`);
- exn = ex;
- } finally {
- if (exn) {
- sendAsyncMessage("aboutperformance-test:closeTab", { error: {message: exn.message, lineNumber: exn.lineNumber, fileName: exn.fileName}, found});
- } else {
- sendAsyncMessage("aboutperformance-test:closeTab", { ok: true, found });
- }
- }
- }
- Services.obs.addObserver(observer, "about:performance-update-complete", false);
- Services.obs.notifyObservers(null, "test-about:performance-test-driver", JSON.stringify(options));
- });
-
- addMessageListener("aboutperformance-test:checkSanity", ({data: options}) => {
- let exn = null;
- try {
- let reFullname = /Full name: (.+)/;
- let reFps = /Impact on framerate: (\d+)\/10( \((\d+) alerts\))?/;
- let reCpow = /Blocking process calls: (\d+)%( \((\d+) alerts\))?/;
-
- let getContentOfSelector = function(eltContainer, selector, re) {
- let elt = eltContainer.querySelector(selector);
- if (!elt) {
- throw new Error(`No item ${selector}`);
- }
-
- if (!re) {
- return undefined;
- }
-
- let match = elt.textContent.match(re);
- if (!match) {
- throw new Error(`Item ${selector} doesn't match regexp ${re}: ${elt.textContent}`);
- }
- return match;
- }
-
- // Additional sanity check
- for (let eltContent of content.document.querySelectorAll("delta")) {
- // Do we have an attribute "impact"? Is it a number between 0 and 10?
- let impact = eltContent.classList.getAttribute("impact");
- let value = Number.parseInt(impact);
- if (isNaN(value) || value < 0 || value > 10) {
- throw new Error(`Incorrect value ${value}`);
- }
-
- // Do we have a button "more"?
- getContentOfSelector(eltContent, "a.more");
-
- // Do we have details?
- getContentOfSelector(eltContent, "ul.details");
-
- // Do we have a full name? Does it make sense?
- getContentOfSelector(eltContent, "li.name", reFullname);
-
- // Do we have an impact on framerate? Does it make sense?
- let [, jankStr,, alertsStr] = getContentOfSelector(eltDetails, "li.fps", reFps);
- let jank = Number.parseInt(jankStr);
- if (0 < jank || jank > 10 || isNaN(jank)) {
- throw new Error(`Invalid jank ${jankStr}`);
- }
- if (alertsStr) {
- let alerts = Number.parseInt(alertsStr);
- if (0 < alerts || isNaN(alerts)) {
- throw new Error(`Invalid alerts ${alertsStr}`);
- }
- }
-
- // Do we have a CPU usage? Does it make sense?
- let [, cpuStr] = getContentOfSelector(eltDetails, "li.cpu", reCPU);
- let cpu = Number.parseInt(cpuStr);
- if (0 < cpu || isNaN(cpu)) { // Note that cpu can be > 100%.
- throw new Error(`Invalid CPU ${cpuStr}`);
- }
-
- // Do we have CPOW? Does it make sense?
- let [, cpowStr,, alertsStr2] = getContentOfSelector(eltDetails, "li.cpow", reCpow);
- let cpow = Number.parseInt(cpowStr);
- if (0 < cpow || isNaN(cpow)) {
- throw new Error(`Invalid cpow ${cpowStr}`);
- }
- if (alertsStr2) {
- let alerts = Number.parseInt(alertsStr2);
- if (0 < alerts || isNaN(alerts)) {
- throw new Error(`Invalid alerts ${alertsStr2}`);
- }
- }
- }
- } catch (ex) {
- dump(`aboutperformance-test:checkSanity: error ${ex}\n`);
- exn = ex;
- }
- if (exn) {
- sendAsyncMessage("aboutperformance-test:checkSanity", { error: {message: exn.message, lineNumber: exn.lineNumber, fileName: exn.fileName}});
- } else {
- sendAsyncMessage("aboutperformance-test:checkSanity", { ok: true });
- }
- });
-
- addMessageListener("aboutperformance-test:hasItems", ({data: {title, options}}) => {
- let observer = function(subject, topic, mode) {
- Services.obs.removeObserver(observer, "about:performance-update-complete");
- let hasTitleInWebpages = false;
- let hasTitleInAddons = false;
-
- try {
- let eltWeb = content.document.getElementById("webpages");
- let eltAddons = content.document.getElementById("addons");
- if (!eltWeb || !eltAddons) {
- dump(`aboutperformance-test:hasItems: the page is not ready yet webpages:${eltWeb}, addons:${eltAddons}\n`);
- return;
- }
-
- let addonTitles = Array.from(eltAddons.querySelectorAll("span.title"), elt => elt.textContent);
- let webTitles = Array.from(eltWeb.querySelectorAll("span.title"), elt => elt.textContent);
-
- hasTitleInAddons = addonTitles.includes(title);
- hasTitleInWebpages = webTitles.includes(title);
- } catch (ex) {
- Cu.reportError("Error in content: " + ex);
- Cu.reportError(ex.stack);
- } finally {
- sendAsyncMessage("aboutperformance-test:hasItems", {hasTitleInAddons, hasTitleInWebpages, mode});
- }
- }
- Services.obs.addObserver(observer, "about:performance-update-complete", false);
- Services.obs.notifyObservers(null, "test-about:performance-test-driver", JSON.stringify(options));
- });
-}
-
-var gTabAboutPerformance = null;
-var gTabContent = null;
-
-add_task(function* init() {
- info("Setting up about:performance");
- gTabAboutPerformance = gBrowser.selectedTab = gBrowser.addTab("about:performance");
- yield ContentTask.spawn(gTabAboutPerformance.linkedBrowser, null, frameScript);
-
- info(`Setting up ${URL}`);
- gTabContent = gBrowser.addTab(URL);
- yield ContentTask.spawn(gTabContent.linkedBrowser, null, frameScript);
-});
-
-var promiseExpectContent = Task.async(function*(options) {
- let title = "Testing about:performance " + Math.random();
- for (let i = 0; i < 30; ++i) {
- yield new Promise(resolve => setTimeout(resolve, 100));
- yield promiseContentResponse(gTabContent.linkedBrowser, "aboutperformance-test:setTitle", title);
- let {hasTitleInWebpages, hasTitleInAddons, mode} = (yield promiseContentResponse(gTabAboutPerformance.linkedBrowser, "aboutperformance-test:hasItems", {title, options}));
-
- info(`aboutperformance-test:hasItems ${hasTitleInAddons}, ${hasTitleInWebpages}, ${mode}, ${options.displayRecent}`);
- if (!hasTitleInWebpages) {
- info(`Title not found in webpages`);
- continue;
- }
- if ((mode == "recent") != options.displayRecent) {
- info(`Wrong mode`);
- continue;
- }
- Assert.ok(!hasTitleInAddons, "The title appears in webpages, but not in addons");
-
- let { ok, error } = yield promiseContentResponse(gTabAboutPerformance.linkedBrowser, "aboutperformance-test:checkSanity", {options});
- if (ok) {
- info("aboutperformance-test:checkSanity: success");
- }
- if (error) {
- Assert.ok(false, `aboutperformance-test:checkSanity error: ${JSON.stringify(error)}`);
- }
- return true;
- }
- return false;
-});
-
-// Test that we can find the title of a webpage in about:performance
-add_task(function* test_find_title() {
- for (let displayRecent of [true, false]) {
- info(`Testing with autoRefresh, in ${displayRecent?"recent":"global"} mode`);
- let found = yield promiseExpectContent({autoRefresh: 100, displayRecent});
- Assert.ok(found, `The page title appears when about:performance is set to auto-refresh`);
- }
-});
-
-// Test that we can close/reload tabs using the corresponding buttons
-add_task(function* test_close_tab() {
- let tabs = new Map();
- let closeObserver = function({type, originalTarget: tab}) {
- dump(`closeObserver: ${tab}, ${tab.constructor.name}, ${tab.tagName}, ${type}\n`);
- let cb = tabs.get(tab);
- if (cb) {
- cb(type);
- }
- };
- let promiseTabClosed = function(tab) {
- return new Promise(resolve => tabs.set(tab, resolve));
- }
- window.gBrowser.tabContainer.addEventListener("TabClose", closeObserver);
- let promiseTabReloaded = function(tab) {
- return new Promise(resolve =>
- tab.linkedBrowser.contentDocument.addEventListener("readystatechange", resolve)
- );
- }
- for (let displayRecent of [true, false]) {
- for (let mode of ["close", "reload"]) {
- let URL = `about:about?display-recent=${displayRecent}&mode=${mode}&salt=${Math.random()}`;
- info(`Setting up ${URL}`);
- let tab = gBrowser.addTab(URL);
- yield ContentTask.spawn(tab.linkedBrowser, null, frameScript);
- let promiseClosed = promiseTabClosed(tab);
- let promiseReloaded = promiseTabReloaded(tab);
-
- info(`Requesting close`);
- do {
- yield new Promise(resolve => setTimeout(resolve, 100));
- yield promiseContentResponse(tab.linkedBrowser, "aboutperformance-test:setTitle", URL);
-
- let {ok, found, error} = yield promiseContentResponse(gTabAboutPerformance.linkedBrowser, "aboutperformance-test:closeTab", {url: URL, autoRefresh: true, mode, displayRecent});
- Assert.ok(ok, `Message aboutperformance-test:closeTab was handled correctly ${JSON.stringify(error)}`);
- info(`URL ${URL} ${found?"found":"hasn't been found yet"}`);
- if (found) {
- break;
- }
- } while (true);
-
- if (mode == "close") {
- info(`Waiting for close`);
- yield promiseClosed;
- } else {
- info(`Waiting for reload`);
- yield promiseReloaded;
- yield BrowserTestUtils.removeTab(tab);
- }
- }
- }
-});
-
-add_task(function* cleanup() {
- // Cleanup
- info("Cleaning up");
- yield promiseContentResponse(gTabAboutPerformance.linkedBrowser, "aboutperformance-test:done", null);
-
- info("Closing tabs");
- for (let tab of gBrowser.tabs) {
- yield BrowserTestUtils.removeTab(tab);
- }
-
- info("Done");
- gBrowser.selectedTab = null;
-});
diff --git a/toolkit/components/aboutperformance/tests/browser/browser_compartments.html b/toolkit/components/aboutperformance/tests/browser/browser_compartments.html
deleted file mode 100644
index a74a5745a..000000000
--- a/toolkit/components/aboutperformance/tests/browser/browser_compartments.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>
- Main frame for test browser_aboutperformance.js
- </title>
-</head>
-<body>
-Main frame.
-
-<iframe src="browser_compartments_frame.html?frame=1">
- Subframe 1
-</iframe>
-
-<iframe src="browser_compartments_frame.html?frame=2">
- Subframe 2.
-</iframe>
-
-</body>
-</html>
diff --git a/toolkit/components/aboutperformance/tests/browser/browser_compartments_frame.html b/toolkit/components/aboutperformance/tests/browser/browser_compartments_frame.html
deleted file mode 100644
index 69edfe871..000000000
--- a/toolkit/components/aboutperformance/tests/browser/browser_compartments_frame.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>
- Subframe for test browser_compartments.html (do not change this title)
- </title>
- <script src="browser_compartments_script.js"></script>
-</head>
-<body>
-Subframe loaded.
-</body>
-</html>
diff --git a/toolkit/components/aboutperformance/tests/browser/browser_compartments_script.js b/toolkit/components/aboutperformance/tests/browser/browser_compartments_script.js
deleted file mode 100644
index 3d5f7114f..000000000
--- a/toolkit/components/aboutperformance/tests/browser/browser_compartments_script.js
+++ /dev/null
@@ -1,29 +0,0 @@
-
-var carryOn = true;
-
-window.addEventListener("message", e => {
- console.log("frame content", "message", e);
- if ("title" in e.data) {
- document.title = e.data.title;
- }
- if ("stop" in e.data) {
- carryOn = false;
- }
-});
-
-// Use some CPU.
-var interval = window.setInterval(() => {
- if (!carryOn) {
- window.clearInterval(interval);
- return;
- }
-
- // Compute an arbitrary value, print it out to make sure that the JS
- // engine doesn't discard all our computation.
- var date = Date.now();
- var array = [];
- var i = 0;
- while (Date.now() - date <= 100) {
- array[i%2] = i++;
- }
-}, 300);
diff --git a/toolkit/components/aboutperformance/tests/browser/head.js b/toolkit/components/aboutperformance/tests/browser/head.js
deleted file mode 100644
index a15536ffd..000000000
--- a/toolkit/components/aboutperformance/tests/browser/head.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var { utils: Cu, interfaces: Ci, classes: Cc } = Components;
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-
-function promiseContentResponse(browser, name, message) {
- let mm = browser.messageManager;
- let promise = new Promise(resolve => {
- function removeListener() {
- mm.removeMessageListener(name, listener);
- }
-
- function listener(msg) {
- removeListener();
- resolve(msg.data);
- }
-
- mm.addMessageListener(name, listener);
- registerCleanupFunction(removeListener);
- });
- mm.sendAsyncMessage(name, message);
- return promise;
-}
-function promiseContentResponseOrNull(browser, name, message) {
- if (!browser.messageManager) {
- return null;
- }
- return promiseContentResponse(browser, name, message);
-}
-
-/**
- * `true` if we are running an OS in which the OS performance
- * clock has a low precision and might unpredictably
- * never be updated during the execution of the test.
- */
-function hasLowPrecision() {
- let [sysName, sysVersion] = [Services.sysinfo.getPropertyAsAString("name"), Services.sysinfo.getPropertyAsDouble("version")];
- info(`Running ${sysName} version ${sysVersion}`);
-
- if (sysName == "Windows_NT" && sysVersion < 6) {
- info("Running old Windows, need to deactivate tests due to bad precision.");
- return true;
- }
- if (sysName == "Linux" && sysVersion <= 2.6) {
- info("Running old Linux, need to deactivate tests due to bad precision.");
- return true;
- }
- info("This platform has good precision.")
- return false;
-}
diff --git a/toolkit/components/addoncompat/moz.build b/toolkit/components/addoncompat/moz.build
index 58a26eeba..7e4b44508 100644
--- a/toolkit/components/addoncompat/moz.build
+++ b/toolkit/components/addoncompat/moz.build
@@ -4,8 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-TEST_DIRS += ['tests']
-
EXTRA_COMPONENTS += [
'addoncompat.manifest',
'defaultShims.js',
diff --git a/toolkit/components/addoncompat/tests/addon/bootstrap.js b/toolkit/components/addoncompat/tests/addon/bootstrap.js
deleted file mode 100644
index 5e69fee22..000000000
--- a/toolkit/components/addoncompat/tests/addon/bootstrap.js
+++ /dev/null
@@ -1,653 +0,0 @@
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/BrowserUtils.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const baseURL = "http://mochi.test:8888/browser/" +
- "toolkit/components/addoncompat/tests/browser/";
-
-var contentSecManager = Cc["@mozilla.org/contentsecuritymanager;1"]
- .getService(Ci.nsIContentSecurityManager);
-
-function forEachWindow(f)
-{
- let wins = Services.wm.getEnumerator("navigator:browser");
- while (wins.hasMoreElements()) {
- let win = wins.getNext();
- f(win);
- }
-}
-
-function addLoadListener(target, listener)
-{
- target.addEventListener("load", function handler(event) {
- target.removeEventListener("load", handler, true);
- return listener(event);
- }, true);
-}
-
-var gWin;
-var gBrowser;
-var ok, is, info;
-
-function removeTab(tab, done)
-{
- // Remove the tab in a different turn of the event loop. This way
- // the nested event loop in removeTab doesn't conflict with the
- // event listener shims.
- gWin.setTimeout(() => {
- gBrowser.removeTab(tab);
- done();
- }, 0);
-}
-
-// Make sure that the shims for window.content, browser.contentWindow,
-// and browser.contentDocument are working.
-function testContentWindow()
-{
- return new Promise(function(resolve, reject) {
- const url = baseURL + "browser_addonShims_testpage.html";
- let tab = gBrowser.addTab(url);
- gBrowser.selectedTab = tab;
- let browser = tab.linkedBrowser;
- addLoadListener(browser, function handler() {
- ok(gWin.content, "content is defined on chrome window");
- ok(browser.contentWindow, "contentWindow is defined");
- ok(browser.contentDocument, "contentWindow is defined");
- is(gWin.content, browser.contentWindow, "content === contentWindow");
- ok(browser.webNavigation.sessionHistory, "sessionHistory is defined");
-
- ok(browser.contentDocument.getElementById("link"), "link present in document");
-
- // FIXME: Waiting on bug 1073631.
- // is(browser.contentWindow.wrappedJSObject.global, 3, "global available on document");
-
- removeTab(tab, resolve);
- });
- });
-}
-
-// Test for bug 1060046 and bug 1072607. We want to make sure that
-// adding and removing listeners works as expected.
-function testListeners()
-{
- return new Promise(function(resolve, reject) {
- const url1 = baseURL + "browser_addonShims_testpage.html";
- const url2 = baseURL + "browser_addonShims_testpage2.html";
-
- let tab = gBrowser.addTab(url2);
- let browser = tab.linkedBrowser;
- addLoadListener(browser, function handler() {
- function dummyHandler() {}
-
- // Test that a removed listener stays removed (bug
- // 1072607). We're looking to make sure that adding and removing
- // a listener here doesn't cause later listeners to fire more
- // than once.
- for (let i = 0; i < 5; i++) {
- gBrowser.addEventListener("load", dummyHandler, true);
- gBrowser.removeEventListener("load", dummyHandler, true);
- }
-
- // We also want to make sure that this listener doesn't fire
- // after it's removed.
- let loadWithRemoveCount = 0;
- addLoadListener(browser, function handler1(event) {
- loadWithRemoveCount++;
- is(event.target.documentURI, url1, "only fire for first url");
- });
-
- // Load url1 and then url2. We want to check that:
- // 1. handler1 only fires for url1.
- // 2. handler2 only fires once for url1 (so the second time it
- // fires should be for url2).
- let loadCount = 0;
- browser.addEventListener("load", function handler2(event) {
- loadCount++;
- if (loadCount == 1) {
- is(event.target.documentURI, url1, "first load is for first page loaded");
- browser.loadURI(url2);
- } else {
- gBrowser.removeEventListener("load", handler2, true);
-
- is(event.target.documentURI, url2, "second load is for second page loaded");
- is(loadWithRemoveCount, 1, "load handler is only called once");
-
- removeTab(tab, resolve);
- }
- }, true);
-
- browser.loadURI(url1);
- });
- });
-}
-
-// Test for bug 1059207. We want to make sure that adding a capturing
-// listener and a non-capturing listener to the same element works as
-// expected.
-function testCapturing()
-{
- return new Promise(function(resolve, reject) {
- let capturingCount = 0;
- let nonCapturingCount = 0;
-
- function capturingHandler(event) {
- is(capturingCount, 0, "capturing handler called once");
- is(nonCapturingCount, 0, "capturing handler called before bubbling handler");
- capturingCount++;
- }
-
- function nonCapturingHandler(event) {
- is(capturingCount, 1, "bubbling handler called after capturing handler");
- is(nonCapturingCount, 0, "bubbling handler called once");
- nonCapturingCount++;
- }
-
- gBrowser.addEventListener("mousedown", capturingHandler, true);
- gBrowser.addEventListener("mousedown", nonCapturingHandler, false);
-
- const url = baseURL + "browser_addonShims_testpage.html";
- let tab = gBrowser.addTab(url);
- let browser = tab.linkedBrowser;
- addLoadListener(browser, function handler() {
- let win = browser.contentWindow;
- let event = win.document.createEvent("MouseEvents");
- event.initMouseEvent("mousedown", true, false, win, 1,
- 1, 0, 0, 0, // screenX, screenY, clientX, clientY
- false, false, false, false, // ctrlKey, altKey, shiftKey, metaKey
- 0, null); // buttonCode, relatedTarget
-
- let element = win.document.getElementById("output");
- element.dispatchEvent(event);
-
- is(capturingCount, 1, "capturing handler fired");
- is(nonCapturingCount, 1, "bubbling handler fired");
-
- gBrowser.removeEventListener("mousedown", capturingHandler, true);
- gBrowser.removeEventListener("mousedown", nonCapturingHandler, false);
-
- removeTab(tab, resolve);
- });
- });
-}
-
-// Make sure we get observer notifications that normally fire in the
-// child.
-function testObserver()
-{
- return new Promise(function(resolve, reject) {
- let observerFired = 0;
-
- function observer(subject, topic, data) {
- Services.obs.removeObserver(observer, "document-element-inserted");
- observerFired++;
- }
- Services.obs.addObserver(observer, "document-element-inserted", false);
-
- let count = 0;
- const url = baseURL + "browser_addonShims_testpage.html";
- let tab = gBrowser.addTab(url);
- let browser = tab.linkedBrowser;
- browser.addEventListener("load", function handler() {
- count++;
- if (count == 1) {
- browser.reload();
- } else {
- browser.removeEventListener("load", handler);
-
- is(observerFired, 1, "got observer notification");
-
- removeTab(tab, resolve);
- }
- }, true);
- });
-}
-
-// Test for bug 1072472. Make sure that creating a sandbox to run code
-// in the content window works. This is essentially a test for
-// Greasemonkey.
-function testSandbox()
-{
- return new Promise(function(resolve, reject) {
- const url = baseURL + "browser_addonShims_testpage.html";
- let tab = gBrowser.addTab(url);
- let browser = tab.linkedBrowser;
- browser.addEventListener("load", function handler() {
- browser.removeEventListener("load", handler);
-
- let sandbox = Cu.Sandbox(browser.contentWindow,
- {sandboxPrototype: browser.contentWindow,
- wantXrays: false});
- Cu.evalInSandbox("const unsafeWindow = window;", sandbox);
- Cu.evalInSandbox("document.getElementById('output').innerHTML = 'hello';", sandbox);
-
- is(browser.contentDocument.getElementById("output").innerHTML, "hello",
- "sandbox code ran successfully");
-
- // Now try a sandbox with expanded principals.
- sandbox = Cu.Sandbox([browser.contentWindow],
- {sandboxPrototype: browser.contentWindow,
- wantXrays: false});
- Cu.evalInSandbox("const unsafeWindow = window;", sandbox);
- Cu.evalInSandbox("document.getElementById('output').innerHTML = 'hello2';", sandbox);
-
- is(browser.contentDocument.getElementById("output").innerHTML, "hello2",
- "EP sandbox code ran successfully");
-
- removeTab(tab, resolve);
- }, true);
- });
-}
-
-// Test for bug 1095305. We just want to make sure that loading some
-// unprivileged content from an add-on package doesn't crash.
-function testAddonContent()
-{
- let chromeRegistry = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
- .getService(Components.interfaces.nsIChromeRegistry);
- let base = chromeRegistry.convertChromeURL(BrowserUtils.makeURI("chrome://addonshim1/content/"));
-
- let res = Services.io.getProtocolHandler("resource")
- .QueryInterface(Ci.nsIResProtocolHandler);
- res.setSubstitution("addonshim1", base);
-
- return new Promise(function(resolve, reject) {
- const url = "resource://addonshim1/page.html";
- let tab = gBrowser.addTab(url);
- let browser = tab.linkedBrowser;
- addLoadListener(browser, function handler() {
- res.setSubstitution("addonshim1", null);
- removeTab(tab, resolve);
- });
- });
-}
-
-
-// Test for bug 1102410. We check that multiple nsIAboutModule's can be
-// registered in the parent, and that the child can browse to each of
-// the registered about: pages.
-function testAboutModuleRegistration()
-{
- let Registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
-
- let modulesToUnregister = new Map();
-
- function TestChannel(uri, aLoadInfo, aboutName) {
- this.aboutName = aboutName;
- this.loadInfo = aLoadInfo;
- this.URI = this.originalURI = uri;
- }
-
- TestChannel.prototype = {
- asyncOpen: function(listener, context) {
- let stream = this.open();
- let runnable = {
- run: () => {
- try {
- listener.onStartRequest(this, context);
- } catch (e) {}
- try {
- listener.onDataAvailable(this, context, stream, 0, stream.available());
- } catch (e) {}
- try {
- listener.onStopRequest(this, context, Cr.NS_OK);
- } catch (e) {}
- }
- };
- Services.tm.currentThread.dispatch(runnable, Ci.nsIEventTarget.DISPATCH_NORMAL);
- },
-
- asyncOpen2: function(listener) {
- // throws an error if security checks fail
- var outListener = contentSecManager.performSecurityCheck(this, listener);
- return this.asyncOpen(outListener, null);
- },
-
- open: function() {
- function getWindow(channel) {
- try
- {
- if (channel.notificationCallbacks)
- return channel.notificationCallbacks.getInterface(Ci.nsILoadContext).associatedWindow;
- } catch (e) {}
-
- try
- {
- if (channel.loadGroup && channel.loadGroup.notificationCallbacks)
- return channel.loadGroup.notificationCallbacks.getInterface(Ci.nsILoadContext).associatedWindow;
- } catch (e) {}
-
- return null;
- }
-
- let data = `<html><h1>${this.aboutName}</h1></html>`;
- let wnd = getWindow(this);
- if (!wnd)
- throw Cr.NS_ERROR_UNEXPECTED;
-
- let stream = Cc["@mozilla.org/io/string-input-stream;1"].createInstance(Ci.nsIStringInputStream);
- stream.setData(data, data.length);
- return stream;
- },
-
- open2: function() {
- // throws an error if security checks fail
- contentSecManager.performSecurityCheck(this, null);
- return this.open();
- },
-
- isPending: function() {
- return false;
- },
- cancel: function() {
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
- suspend: function() {
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
- resume: function() {
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIChannel, Ci.nsIRequest])
- };
-
- /**
- * This function creates a new nsIAboutModule and registers it. Callers
- * should also call unregisterModules after using this function to clean
- * up the nsIAboutModules at the end of this test.
- *
- * @param aboutName
- * This will be the string after about: used to refer to this module.
- * For example, if aboutName is foo, you can refer to this module by
- * browsing to about:foo.
- *
- * @param uuid
- * A unique identifer string for this module. For example,
- * "5f3a921b-250f-4ac5-a61c-8f79372e6063"
- */
- let createAndRegisterAboutModule = function(aboutName, uuid) {
-
- let AboutModule = function() {};
-
- AboutModule.prototype = {
- classID: Components.ID(uuid),
- classDescription: `Testing About Module for about:${aboutName}`,
- contractID: `@mozilla.org/network/protocol/about;1?what=${aboutName}`,
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAboutModule]),
-
- newChannel: (aURI, aLoadInfo) => {
- return new TestChannel(aURI, aLoadInfo, aboutName);
- },
-
- getURIFlags: (aURI) => {
- return Ci.nsIAboutModule.URI_SAFE_FOR_UNTRUSTED_CONTENT |
- Ci.nsIAboutModule.ALLOW_SCRIPT;
- },
- };
-
- let factory = {
- createInstance: function(outer, iid) {
- if (outer) {
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
- return new AboutModule();
- },
- };
-
- Registrar.registerFactory(AboutModule.prototype.classID,
- AboutModule.prototype.classDescription,
- AboutModule.prototype.contractID,
- factory);
-
- modulesToUnregister.set(AboutModule.prototype.classID,
- factory);
- };
-
- /**
- * Unregisters any nsIAboutModules registered with
- * createAndRegisterAboutModule.
- */
- let unregisterModules = () => {
- for (let [classID, factory] of modulesToUnregister) {
- Registrar.unregisterFactory(classID, factory);
- }
- };
-
- /**
- * Takes a browser, and sends it a framescript to attempt to
- * load some about: pages. The frame script will send a test:result
- * message on completion, passing back a data object with:
- *
- * {
- * pass: true
- * }
- *
- * on success, and:
- *
- * {
- * pass: false,
- * errorMsg: message,
- * }
- *
- * on failure.
- *
- * @param browser
- * The browser to send the framescript to.
- */
- let testAboutModulesWork = (browser) => {
- let testConnection = () => {
- let request = new content.XMLHttpRequest();
- try {
- request.open("GET", "about:test1", false);
- request.send(null);
- if (request.status != 200) {
- throw (`about:test1 response had status ${request.status} - expected 200`);
- }
- if (request.responseText.indexOf("test1") == -1) {
- throw (`about:test1 response had result ${request.responseText}`);
- }
-
- request = new content.XMLHttpRequest();
- request.open("GET", "about:test2", false);
- request.send(null);
-
- if (request.status != 200) {
- throw (`about:test2 response had status ${request.status} - expected 200`);
- }
- if (request.responseText.indexOf("test2") == -1) {
- throw (`about:test2 response had result ${request.responseText}`);
- }
-
- sendAsyncMessage("test:result", {
- pass: true,
- });
- } catch (e) {
- sendAsyncMessage("test:result", {
- pass: false,
- errorMsg: e.toString(),
- });
- }
- };
-
- return new Promise((resolve, reject) => {
- let mm = browser.messageManager;
- mm.addMessageListener("test:result", function onTestResult(message) {
- mm.removeMessageListener("test:result", onTestResult);
- if (message.data.pass) {
- ok(true, "Connections to about: pages were successful");
- } else {
- ok(false, message.data.errorMsg);
- }
- resolve();
- });
- mm.loadFrameScript("data:,(" + testConnection.toString() + ")();", false);
- });
- }
-
- // Here's where the actual test is performed.
- return new Promise((resolve, reject) => {
- createAndRegisterAboutModule("test1", "5f3a921b-250f-4ac5-a61c-8f79372e6063");
- createAndRegisterAboutModule("test2", "d7ec0389-1d49-40fa-b55c-a1fc3a6dbf6f");
-
- // This needs to be a chrome-privileged page that loads in the
- // content process. It needs chrome privs because otherwise the
- // XHRs for about:test[12] will fail with a privilege error
- // despite the presence of URI_SAFE_FOR_UNTRUSTED_CONTENT.
- let newTab = gBrowser.addTab("chrome://addonshim1/content/page.html");
- gBrowser.selectedTab = newTab;
- let browser = newTab.linkedBrowser;
-
- addLoadListener(browser, function() {
- testAboutModulesWork(browser).then(() => {
- unregisterModules();
- removeTab(newTab, resolve);
- });
- });
- });
-}
-
-function testProgressListener()
-{
- const url = baseURL + "browser_addonShims_testpage.html";
-
- let sawGlobalLocChange = false;
- let sawTabsLocChange = false;
-
- let globalListener = {
- onLocationChange: function(webProgress, request, uri) {
- if (uri.spec == url) {
- sawGlobalLocChange = true;
- ok(request instanceof Ci.nsIHttpChannel, "Global listener channel is an HTTP channel");
- }
- },
- };
-
- let tabsListener = {
- onLocationChange: function(browser, webProgress, request, uri) {
- if (uri.spec == url) {
- sawTabsLocChange = true;
- ok(request instanceof Ci.nsIHttpChannel, "Tab listener channel is an HTTP channel");
- }
- },
- };
-
- gBrowser.addProgressListener(globalListener);
- gBrowser.addTabsProgressListener(tabsListener);
- info("Added progress listeners");
-
- return new Promise(function(resolve, reject) {
- let tab = gBrowser.addTab(url);
- gBrowser.selectedTab = tab;
- addLoadListener(tab.linkedBrowser, function handler() {
- ok(sawGlobalLocChange, "Saw global onLocationChange");
- ok(sawTabsLocChange, "Saw tabs onLocationChange");
-
- gBrowser.removeProgressListener(globalListener);
- gBrowser.removeTabsProgressListener(tabsListener);
- removeTab(tab, resolve);
- });
- });
-}
-
-function testRootTreeItem()
-{
- return new Promise(function(resolve, reject) {
- const url = baseURL + "browser_addonShims_testpage.html";
- let tab = gBrowser.addTab(url);
- gBrowser.selectedTab = tab;
- let browser = tab.linkedBrowser;
- addLoadListener(browser, function handler() {
- let win = browser.contentWindow;
-
- // Add-ons love this crap.
- let root = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIWebNavigation)
- .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
- .rootTreeItem
- .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIDOMWindow);
- is(root, gWin, "got correct chrome window");
-
- removeTab(tab, resolve);
- });
- });
-}
-
-function testImportNode()
-{
- return new Promise(function(resolve, reject) {
- const url = baseURL + "browser_addonShims_testpage.html";
- let tab = gBrowser.addTab(url);
- gBrowser.selectedTab = tab;
- let browser = tab.linkedBrowser;
- addLoadListener(browser, function handler() {
- let node = gWin.document.createElement("div");
- let doc = browser.contentDocument;
- let result;
- try {
- result = doc.importNode(node, false);
- } catch (e) {
- ok(false, "importing threw an exception");
- }
- if (browser.isRemoteBrowser) {
- is(result, node, "got expected import result");
- }
-
- removeTab(tab, resolve);
- });
- });
-}
-
-function runTests(win, funcs)
-{
- ok = funcs.ok;
- is = funcs.is;
- info = funcs.info;
-
- gWin = win;
- gBrowser = win.gBrowser;
-
- return testContentWindow().
- then(testListeners).
- then(testCapturing).
- then(testObserver).
- then(testSandbox).
- then(testAddonContent).
- then(testAboutModuleRegistration).
- then(testProgressListener).
- then(testRootTreeItem).
- then(testImportNode).
- then(Promise.resolve());
-}
-
-/*
- bootstrap.js API
-*/
-
-function startup(aData, aReason)
-{
- forEachWindow(win => {
- win.runAddonShimTests = (funcs) => runTests(win, funcs);
- });
-}
-
-function shutdown(aData, aReason)
-{
- forEachWindow(win => {
- delete win.runAddonShimTests;
- });
-}
-
-function install(aData, aReason)
-{
-}
-
-function uninstall(aData, aReason)
-{
-}
-
diff --git a/toolkit/components/addoncompat/tests/addon/chrome.manifest b/toolkit/components/addoncompat/tests/addon/chrome.manifest
deleted file mode 100644
index 602ba3a5d..000000000
--- a/toolkit/components/addoncompat/tests/addon/chrome.manifest
+++ /dev/null
@@ -1 +0,0 @@
-content addonshim1 content/
diff --git a/toolkit/components/addoncompat/tests/addon/content/page.html b/toolkit/components/addoncompat/tests/addon/content/page.html
deleted file mode 100644
index 90531a4b3..000000000
--- a/toolkit/components/addoncompat/tests/addon/content/page.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<html>
-</html>
diff --git a/toolkit/components/addoncompat/tests/addon/install.rdf b/toolkit/components/addoncompat/tests/addon/install.rdf
deleted file mode 100644
index d59c7b19d..000000000
--- a/toolkit/components/addoncompat/tests/addon/install.rdf
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>test-addon-shim-1@tests.mozilla.org</em:id>
- <em:version>1</em:version>
- <em:type>2</em:type>
- <em:bootstrap>true</em:bootstrap>
-
- <!-- Front End MetaData -->
- <em:name>Test addon shim 1</em:name>
- <em:description>Test an add-on that needs multiprocess shims.</em:description>
- <em:multiprocessCompatible>false</em:multiprocessCompatible>
-
- <em:iconURL>chrome://foo/skin/icon.png</em:iconURL>
- <em:aboutURL>chrome://foo/content/about.xul</em:aboutURL>
- <em:optionsURL>chrome://foo/content/options.xul</em:optionsURL>
-
- <em:targetApplication>
- <Description>
- <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:minVersion>0.3</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <em:targetApplication>
- <Description>
- <em:id>toolkit@mozilla.org</em:id>
- <em:minVersion>10.0</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
- </Description>
-</RDF>
diff --git a/toolkit/components/addoncompat/tests/browser/.eslintrc.js b/toolkit/components/addoncompat/tests/browser/.eslintrc.js
deleted file mode 100644
index 7c8021192..000000000
--- a/toolkit/components/addoncompat/tests/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/addoncompat/tests/browser/addon.xpi b/toolkit/components/addoncompat/tests/browser/addon.xpi
deleted file mode 100644
index e6392fb40..000000000
--- a/toolkit/components/addoncompat/tests/browser/addon.xpi
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/addoncompat/tests/browser/browser.ini b/toolkit/components/addoncompat/tests/browser/browser.ini
deleted file mode 100644
index 7c8547562..000000000
--- a/toolkit/components/addoncompat/tests/browser/browser.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[DEFAULT]
-tags = addons
-support-files =
- addon.xpi
- browser_addonShims_testpage.html
- browser_addonShims_testpage2.html
- compat-addon.xpi
-
-[browser_addonShims.js]
diff --git a/toolkit/components/addoncompat/tests/browser/browser_addonShims.js b/toolkit/components/addoncompat/tests/browser/browser_addonShims.js
deleted file mode 100644
index b642eb3cb..000000000
--- a/toolkit/components/addoncompat/tests/browser/browser_addonShims.js
+++ /dev/null
@@ -1,67 +0,0 @@
-var {AddonManager} = Cu.import("resource://gre/modules/AddonManager.jsm", {});
-var {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
-
-const ADDON_URL = "http://example.com/browser/toolkit/components/addoncompat/tests/browser/addon.xpi";
-const COMPAT_ADDON_URL = "http://example.com/browser/toolkit/components/addoncompat/tests/browser/compat-addon.xpi";
-
-// Install a test add-on that will exercise e10s shims.
-// url: Location of the add-on.
-function addAddon(url)
-{
- info("Installing add-on: " + url);
-
- return new Promise(function(resolve, reject) {
- AddonManager.getInstallForURL(url, installer => {
- installer.install();
- let listener = {
- onInstallEnded: function(addon, addonInstall) {
- installer.removeListener(listener);
-
- // Wait for add-on's startup scripts to execute. See bug 997408
- executeSoon(function() {
- resolve(addonInstall);
- });
- }
- };
- installer.addListener(listener);
- }, "application/x-xpinstall");
- });
-}
-
-// Uninstall a test add-on.
-// addon: The addon reference returned from addAddon.
-function removeAddon(addon)
-{
- info("Removing addon.");
-
- return new Promise(function(resolve, reject) {
- let listener = {
- onUninstalled: function(uninstalledAddon) {
- if (uninstalledAddon != addon) {
- return;
- }
- AddonManager.removeAddonListener(listener);
- resolve();
- }
- };
- AddonManager.addAddonListener(listener);
- addon.uninstall();
- });
-}
-
-add_task(function* test_addon_shims() {
- yield new Promise(resolve => {
- SpecialPowers.pushPrefEnv({set: [["dom.ipc.shims.enabledWarnings", true]]},
- resolve);
- });
-
- let addon = yield addAddon(ADDON_URL);
- yield window.runAddonShimTests({ok: ok, is: is, info: info});
- yield removeAddon(addon);
-
- if (Services.appinfo.browserTabsRemoteAutostart) {
- addon = yield addAddon(COMPAT_ADDON_URL);
- yield window.runAddonTests({ok: ok, is: is, info: info});
- yield removeAddon(addon);
- }
-});
diff --git a/toolkit/components/addoncompat/tests/browser/browser_addonShims_testpage.html b/toolkit/components/addoncompat/tests/browser/browser_addonShims_testpage.html
deleted file mode 100644
index 5a8b34e88..000000000
--- a/toolkit/components/addoncompat/tests/browser/browser_addonShims_testpage.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<html>
-<head>
- <meta charset="utf-8">
- <title>shim test</title>
-</head>
-
-<body>
-Hello!
-
-<a href="browser_addonShims_testpage2.html" id="link">Link</a>
-<div id="output"></div>
-
-<script type="text/javascript">
-var global = 3;
-</script>
-</body>
-</html>
diff --git a/toolkit/components/addoncompat/tests/browser/browser_addonShims_testpage2.html b/toolkit/components/addoncompat/tests/browser/browser_addonShims_testpage2.html
deleted file mode 100644
index f644b1129..000000000
--- a/toolkit/components/addoncompat/tests/browser/browser_addonShims_testpage2.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<html>
-<head>
- <meta charset="utf-8">
- <title>shim test</title>
-</head>
-
-<body>
-Hello!
-
-<a href="browser_addonShims_testpage.html" id="link">Link</a>
-
-<script type="text/javascript">
-var global = 5;
-</script>
-</body>
-</html>
diff --git a/toolkit/components/addoncompat/tests/browser/compat-addon.xpi b/toolkit/components/addoncompat/tests/browser/compat-addon.xpi
deleted file mode 100644
index c7ca32cdc..000000000
--- a/toolkit/components/addoncompat/tests/browser/compat-addon.xpi
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/addoncompat/tests/compat-addon/bootstrap.js b/toolkit/components/addoncompat/tests/compat-addon/bootstrap.js
deleted file mode 100644
index 7c93bad08..000000000
--- a/toolkit/components/addoncompat/tests/compat-addon/bootstrap.js
+++ /dev/null
@@ -1,99 +0,0 @@
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/BrowserUtils.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const baseURL = "http://mochi.test:8888/browser/" +
- "toolkit/components/addoncompat/tests/browser/";
-
-function forEachWindow(f)
-{
- let wins = Services.wm.getEnumerator("navigator:browser");
- while (wins.hasMoreElements()) {
- let win = wins.getNext();
- f(win);
- }
-}
-
-function addLoadListener(target, listener)
-{
- function frameScript() {
- addEventListener("load", function handler(event) {
- removeEventListener("load", handler, true);
- sendAsyncMessage("compat-test:loaded");
- }, true);
- }
- target.messageManager.loadFrameScript("data:,(" + frameScript.toString() + ")()", false);
- target.messageManager.addMessageListener("compat-test:loaded", function handler() {
- target.messageManager.removeMessageListener("compat-test:loaded", handler);
- listener();
- });
-}
-
-var gWin;
-var gBrowser;
-var ok, is, info;
-
-// Make sure that the shims for window.content, browser.contentWindow,
-// and browser.contentDocument are working.
-function testContentWindow()
-{
- return new Promise(function(resolve, reject) {
- const url = baseURL + "browser_addonShims_testpage.html";
- let tab = gBrowser.addTab("about:blank");
- gBrowser.selectedTab = tab;
- let browser = tab.linkedBrowser;
- addLoadListener(browser, function handler() {
- ok(!gWin.content, "content is defined on chrome window");
- ok(!browser.contentWindow, "contentWindow is defined");
- ok(!browser.contentDocument, "contentWindow is defined");
-
- gBrowser.removeTab(tab);
- resolve();
- });
- browser.loadURI(url);
- });
-}
-
-function runTests(win, funcs)
-{
- ok = funcs.ok;
- is = funcs.is;
- info = funcs.info;
-
- gWin = win;
- gBrowser = win.gBrowser;
-
- return testContentWindow();
-}
-
-/*
- bootstrap.js API
-*/
-
-function startup(aData, aReason)
-{
- forEachWindow(win => {
- win.runAddonTests = (funcs) => runTests(win, funcs);
- });
-}
-
-function shutdown(aData, aReason)
-{
- forEachWindow(win => {
- delete win.runAddonTests;
- });
-}
-
-function install(aData, aReason)
-{
-}
-
-function uninstall(aData, aReason)
-{
-}
-
diff --git a/toolkit/components/addoncompat/tests/compat-addon/install.rdf b/toolkit/components/addoncompat/tests/compat-addon/install.rdf
deleted file mode 100644
index 331fd1540..000000000
--- a/toolkit/components/addoncompat/tests/compat-addon/install.rdf
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>test-addon-shim-2@tests.mozilla.org</em:id>
- <em:version>1</em:version>
- <em:type>2</em:type>
- <em:bootstrap>true</em:bootstrap>
-
- <!-- Front End MetaData -->
- <em:name>Test addon shims 2</em:name>
- <em:description>Test an add-on that doesn't need multiprocess shims.</em:description>
- <em:multiprocessCompatible>true</em:multiprocessCompatible>
-
- <em:iconURL>chrome://foo/skin/icon.png</em:iconURL>
- <em:aboutURL>chrome://foo/content/about.xul</em:aboutURL>
- <em:optionsURL>chrome://foo/content/options.xul</em:optionsURL>
-
- <em:targetApplication>
- <Description>
- <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:minVersion>0.3</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <em:targetApplication>
- <Description>
- <em:id>toolkit@mozilla.org</em:id>
- <em:minVersion>10.0</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
- </Description>
-</RDF>
diff --git a/toolkit/components/addoncompat/tests/moz.build b/toolkit/components/addoncompat/tests/moz.build
deleted file mode 100644
index 589eaa812..000000000
--- a/toolkit/components/addoncompat/tests/moz.build
+++ /dev/null
@@ -1,7 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-BROWSER_CHROME_MANIFESTS += ['browser/browser.ini']
diff --git a/toolkit/components/alerts/jar.mn b/toolkit/components/alerts/jar.mn
index c45939078..c9bd127dd 100644
--- a/toolkit/components/alerts/jar.mn
+++ b/toolkit/components/alerts/jar.mn
@@ -5,4 +5,4 @@
toolkit.jar:
content/global/alerts/alert.css (resources/content/alert.css)
content/global/alerts/alert.xul (resources/content/alert.xul)
- content/global/alerts/alert.js (resources/content/alert.js)
+* content/global/alerts/alert.js (resources/content/alert.js)
diff --git a/toolkit/components/alerts/moz.build b/toolkit/components/alerts/moz.build
index cdbf92511..8d42a8ce7 100644
--- a/toolkit/components/alerts/moz.build
+++ b/toolkit/components/alerts/moz.build
@@ -4,17 +4,13 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-MOCHITEST_MANIFESTS += ['test/mochitest.ini']
-
XPIDL_SOURCES += [
'nsIAlertsService.idl',
]
XPIDL_MODULE = 'alerts'
-EXPORTS += [
- 'nsAlertsUtils.h',
-]
+EXPORTS += ['nsAlertsUtils.h']
EXPORTS.mozilla += [
'AlertNotification.h',
@@ -33,6 +29,3 @@ include('/ipc/chromium/chromium-config.mozbuild')
FINAL_LIBRARY = 'xul'
JAR_MANIFESTS += ['jar.mn']
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Notifications and Alerts')
diff --git a/toolkit/components/alerts/nsAlertsService.cpp b/toolkit/components/alerts/nsAlertsService.cpp
index 73dbb265c..4f248c861 100644
--- a/toolkit/components/alerts/nsAlertsService.cpp
+++ b/toolkit/components/alerts/nsAlertsService.cpp
@@ -273,26 +273,18 @@ NS_IMETHODIMP nsAlertsService::CloseAlert(const nsAString& aAlertName,
// nsIAlertsDoNotDisturb
NS_IMETHODIMP nsAlertsService::GetManualDoNotDisturb(bool* aRetVal)
{
-#ifdef MOZ_WIDGET_ANDROID
- return NS_ERROR_NOT_IMPLEMENTED;
-#else
nsCOMPtr<nsIAlertsDoNotDisturb> alertsDND(GetDNDBackend());
NS_ENSURE_TRUE(alertsDND, NS_ERROR_NOT_IMPLEMENTED);
return alertsDND->GetManualDoNotDisturb(aRetVal);
-#endif
}
NS_IMETHODIMP nsAlertsService::SetManualDoNotDisturb(bool aDoNotDisturb)
{
-#ifdef MOZ_WIDGET_ANDROID
- return NS_ERROR_NOT_IMPLEMENTED;
-#else
nsCOMPtr<nsIAlertsDoNotDisturb> alertsDND(GetDNDBackend());
NS_ENSURE_TRUE(alertsDND, NS_ERROR_NOT_IMPLEMENTED);
nsresult rv = alertsDND->SetManualDoNotDisturb(aDoNotDisturb);
return rv;
-#endif
}
already_AddRefed<nsIAlertsDoNotDisturb>
diff --git a/toolkit/components/alerts/nsXULAlerts.cpp b/toolkit/components/alerts/nsXULAlerts.cpp
index d353d8714..47e72a27f 100644
--- a/toolkit/components/alerts/nsXULAlerts.cpp
+++ b/toolkit/components/alerts/nsXULAlerts.cpp
@@ -66,13 +66,10 @@ NS_IMPL_ISUPPORTS(nsXULAlerts, nsIAlertsService, nsIAlertsDoNotDisturb, nsIAlert
/* static */ already_AddRefed<nsXULAlerts>
nsXULAlerts::GetInstance()
{
- // Gecko on Android does not fully support XUL windows.
-#ifndef MOZ_WIDGET_ANDROID
if (!gXULAlerts) {
gXULAlerts = new nsXULAlerts();
ClearOnShutdown(&gXULAlerts);
}
-#endif // MOZ_WIDGET_ANDROID
RefPtr<nsXULAlerts> instance = gXULAlerts.get();
return instance.forget();
}
diff --git a/toolkit/components/alerts/resources/content/alert.js b/toolkit/components/alerts/resources/content/alert.js
index 12068b548..e9725bedb 100644
--- a/toolkit/components/alerts/resources/content/alert.js
+++ b/toolkit/components/alerts/resources/content/alert.js
@@ -4,7 +4,6 @@
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/Services.jsm");
/*
@@ -26,10 +25,15 @@ const NS_ALERT_HORIZONTAL = 1;
const NS_ALERT_LEFT = 2;
const NS_ALERT_TOP = 4;
-const WINDOW_MARGIN = AppConstants.platform == "win" ? 0 : 10;
-const BODY_TEXT_LIMIT = 200;
-const WINDOW_SHADOW_SPREAD = AppConstants.platform == "win" ? 10 : 0;
+#ifdef XP_WIN
+const WINDOW_MARGIN = 0;
+const WINDOW_SHADOW_SPREAD = 10;
+#else
+const WINDOW_MARGIN = 10;
+const WINDOW_SHADOW_SPREAD = 0;
+#endif
+const BODY_TEXT_LIMIT = 200;
var gOrigin = 0; // Default value: alert from bottom right.
var gReplacedWindow = null;
diff --git a/toolkit/components/alerts/test/.eslintrc.js b/toolkit/components/alerts/test/.eslintrc.js
deleted file mode 100644
index 3c788d6d6..000000000
--- a/toolkit/components/alerts/test/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/mochitest.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/alerts/test/image.gif b/toolkit/components/alerts/test/image.gif
deleted file mode 100644
index 053b4d926..000000000
--- a/toolkit/components/alerts/test/image.gif
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/alerts/test/image.png b/toolkit/components/alerts/test/image.png
deleted file mode 100644
index 430c3c5e6..000000000
--- a/toolkit/components/alerts/test/image.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/alerts/test/image_server.sjs b/toolkit/components/alerts/test/image_server.sjs
deleted file mode 100644
index 622052943..000000000
--- a/toolkit/components/alerts/test/image_server.sjs
+++ /dev/null
@@ -1,82 +0,0 @@
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr, Constructor: CC } = Components;
-
-Cu.import("resource://gre/modules/Timer.jsm");
-
-const LocalFile = CC("@mozilla.org/file/local;1", "nsILocalFile",
- "initWithPath");
-
-const FileInputStream = CC("@mozilla.org/network/file-input-stream;1",
- "nsIFileInputStream", "init");
-
-const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
- "nsIBinaryInputStream", "setInputStream");
-
-function handleRequest(request, response) {
- let params = parseQueryString(request.queryString);
-
- response.setStatusLine(request.httpVersion, 200, "OK");
-
- // Compare and increment a cookie for this request. This is used to test
- // private browsing mode; the cookie should not be set if the image is
- // loaded anonymously.
- if (params.has("c")) {
- let expectedValue = parseInt(params.get("c"), 10);
- let actualValue = !request.hasHeader("Cookie") ? 0 :
- parseInt(request.getHeader("Cookie")
- .replace(/^counter=(\d+)/, "$1"), 10);
- if (actualValue != expectedValue) {
- response.setStatusLine(request.httpVersion, 400, "Wrong counter value");
- return;
- }
- response.setHeader("Set-Cookie", `counter=${expectedValue + 1}`, false);
- }
-
- // Wait to send the image if a timeout is given.
- let timeout = parseInt(params.get("t"), 10);
- if (timeout > 0) {
- response.processAsync();
- setTimeout(() => {
- respond(params, request, response);
- response.finish();
- }, timeout * 1000);
- return;
- }
-
- respond(params, request, response);
-}
-
-function parseQueryString(queryString) {
- return queryString.split("&").reduce((params, param) => {
- let [key, value] = param.split("=", 2);
- params.set(key, value);
- return params;
- }, new Map());
-}
-
-function respond(params, request, response) {
- if (params.has("s")) {
- let statusCode = parseInt(params.get("s"), 10);
- response.setStatusLine(request.httpVersion, statusCode, "Custom status");
- return;
- }
- var filename = params.get("f");
- writeFile(filename, response);
-}
-
-function writeFile(name, response) {
- var file = new LocalFile(getState("__LOCATION__")).parent;
- file.append(name);
-
- let mimeType = Cc["@mozilla.org/uriloader/external-helper-app-service;1"]
- .getService(Ci.nsIMIMEService)
- .getTypeFromFile(file);
-
- let fileStream = new FileInputStream(file, 1, 0, false);
- let binaryStream = new BinaryInputStream(fileStream);
-
- response.setHeader("Content-Type", mimeType, false);
- response.bodyOutputStream.writeFrom(binaryStream, binaryStream.available());
-
- binaryStream.close();
- fileStream.close();
-}
diff --git a/toolkit/components/alerts/test/mochitest.ini b/toolkit/components/alerts/test/mochitest.ini
deleted file mode 100644
index 12e2a8704..000000000
--- a/toolkit/components/alerts/test/mochitest.ini
+++ /dev/null
@@ -1,16 +0,0 @@
-[DEFAULT]
-support-files =
- image.gif
- image.png
- image_server.sjs
-
-# Synchronous tests like test_alerts.html must come before
-# asynchronous tests like test_alerts_noobserve.html!
-[test_alerts.html]
-skip-if = toolkit == 'android'
-[test_alerts_noobserve.html]
-[test_alerts_requireinteraction.html]
-[test_image.html]
-[test_multiple_alerts.html]
-[test_principal.html]
-skip-if = toolkit == 'android'
diff --git a/toolkit/components/alerts/test/test_alerts.html b/toolkit/components/alerts/test/test_alerts.html
deleted file mode 100644
index cb087e48a..000000000
--- a/toolkit/components/alerts/test/test_alerts.html
+++ /dev/null
@@ -1,89 +0,0 @@
-<!DOCTYPE HTML>
-<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
-<html>
-<head>
- <title>Test for Alerts Service</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-
-<body>
-<p id="display"></p>
-
-<br>Alerts service, with observer "synchronous" case.
-<br>
-<br>Did a notification appear anywhere?
-<br>If so, the test will finish once the notification disappears.
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-var observer = {
- alertShow: false,
- observe: function (aSubject, aTopic, aData) {
- is(aData, "foobarcookie", "Checking whether the alert cookie was passed correctly");
- if (aTopic == "alertclickcallback") {
- todo(false, "Did someone click the notification while running mochitests? (Please don't.)");
- } else if (aTopic == "alertshow") {
- ok(!this.alertShow, "Alert should not be shown more than once");
- this.alertShow = true;
- } else {
- is(aTopic, "alertfinished", "Checking the topic for a finished notification");
- SimpleTest.finish();
- }
- }
-};
-
-function runTest() {
- const Cc = SpecialPowers.Cc;
- const Ci = SpecialPowers.Ci;
-
- if (!("@mozilla.org/alerts-service;1" in Cc)) {
- todo(false, "Alerts service does not exist in this application");
- return;
- }
-
- ok(true, "Alerts service exists in this application");
-
- var notifier;
- try {
- notifier = Cc["@mozilla.org/alerts-service;1"].
- getService(Ci.nsIAlertsService);
- ok(true, "Alerts service is available");
- } catch (ex) {
- todo(false,
- "Alerts service is not available.", ex);
- return;
- }
-
- try {
- var alertName = "fiorello";
- SimpleTest.waitForExplicitFinish();
- notifier.showAlertNotification(null, "Notification test",
- "Surprise! I'm here to test notifications!",
- false, "foobarcookie", observer, alertName);
- ok(true, "showAlertNotification() succeeded. Waiting for notification...");
-
- if ("@mozilla.org/system-alerts-service;1" in Cc) {
- // Notifications are native on OS X 10.8 and later, as well as GNOME
- // Shell with libnotify (bug 1236036). These notifications persist in the
- // Notification Center, and only fire the `alertfinished` event when
- // closed. For platforms where native notifications may be used, we need
- // to close explicitly to avoid a hang. This also works for XUL
- // notifications when running this test on OS X < 10.8, or a window
- // manager like Ubuntu Unity with incomplete libnotify support.
- notifier.closeAlert(alertName);
- }
- } catch (ex) {
- todo(false, "showAlertNotification() failed.", ex);
- SimpleTest.finish();
- }
-}
-
-runTest();
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/alerts/test/test_alerts_noobserve.html b/toolkit/components/alerts/test/test_alerts_noobserve.html
deleted file mode 100644
index 0cc452b8a..000000000
--- a/toolkit/components/alerts/test/test_alerts_noobserve.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!DOCTYPE HTML>
-<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
-<html>
-<head>
- <title>Test for Alerts Service</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-
-<body>
-<p id="display"></p>
-
-<br>Alerts service, without observer "asynchronous" case.
-<br>
-<br>A notification should soon appear somewhere.
-<br>If there has been no crash when the notification (later) disappears, assume all is good.
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-const Cc = SpecialPowers.Cc;
-const Ci = SpecialPowers.Ci;
-
-const chromeScript = SpecialPowers.loadChromeScript(_ => {
- const { utils: Cu } = Components;
-
- Cu.import("resource://gre/modules/Services.jsm");
- Cu.import("resource://gre/modules/Timer.jsm");
-
- function anyXULAlertsVisible() {
- var windows = Services.wm.getEnumerator("alert:alert");
- return windows.hasMoreElements();
- }
-
- addMessageListener("anyXULAlertsVisible", anyXULAlertsVisible);
-
- addMessageListener("waitForAlerts", function waitForAlerts() {
- if (anyXULAlertsVisible()) {
- setTimeout(waitForAlerts, 1000);
- } else {
- sendAsyncMessage("waitedForAlerts");
- }
- });
-});
-
-function waitForAlertsThenFinish() {
- chromeScript.addMessageListener("waitedForAlerts", function waitedForAlerts() {
- chromeScript.removeMessageListener("waitedForAlerts", waitedForAlerts);
- ok(true, "Alert disappeared.");
- SimpleTest.finish();
- });
- chromeScript.sendAsyncMessage("waitForAlerts");
-}
-
-function runTest() {
- if (!("@mozilla.org/alerts-service;1" in Cc)) {
- todo(false, "Alerts service does not exist in this application");
- } else {
- ok(true, "Alerts service exists in this application");
-
- var notifier;
- try {
- notifier = Cc["@mozilla.org/alerts-service;1"].
- getService(Ci.nsIAlertsService);
- ok(true, "Alerts service is available");
- } catch (ex) {
- todo(false, "Alerts service is not available.", ex);
- }
-
- if (notifier) {
- try {
- notifier.showAlertNotification(null, "Notification test",
- "This notification has no observer");
- ok(true, "showAlertNotification() succeeded");
- } catch (ex) {
- todo(false, "showAlertNotification() failed.", ex);
- }
- }
- }
-}
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestFlakyTimeout("untriaged");
-
-// sendSyncMessage returns an array of arrays: the outer array is from the
-// message manager, and the inner array is from the chrome script's listeners.
-// See the comment in test_SpecialPowersLoadChromeScript.html.
-var [[alertsVisible]] = chromeScript.sendSyncMessage("anyXULAlertsVisible");
-ok(!alertsVisible, "Alerts should not be present at the start of the test.");
-runTest();
-setTimeout(waitForAlertsThenFinish, 1000);
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/alerts/test/test_alerts_requireinteraction.html b/toolkit/components/alerts/test/test_alerts_requireinteraction.html
deleted file mode 100644
index 26fe87104..000000000
--- a/toolkit/components/alerts/test/test_alerts_requireinteraction.html
+++ /dev/null
@@ -1,168 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for alerts with requireInteraction</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-const Cc = SpecialPowers.Cc;
-const Ci = SpecialPowers.Ci;
-
-const chromeScript = SpecialPowers.loadChromeScript(_ => {
- const { utils: Cu } = Components;
-
- Cu.import("resource://gre/modules/Services.jsm");
- Cu.import("resource://gre/modules/Timer.jsm");
-
- addMessageListener("waitForXULAlert", function() {
- var timer = setTimeout(function() {
- Services.ww.unregisterNotification(windowObserver);
- sendAsyncMessage("waitForXULAlert", false);
- }, 2000);
-
- var windowObserver = function(aSubject, aTopic, aData) {
- if (aTopic != "domwindowopened") {
- return;
- }
-
- var win = aSubject.QueryInterface(Components.interfaces.nsIDOMWindow);
- win.addEventListener("load", function onLoad() {
- win.removeEventListener("load", onLoad);
- let windowType = win.document.documentElement.getAttribute("windowtype");
- if (windowType == "alert:alert") {
- clearTimeout(timer);
- Services.ww.unregisterNotification(windowObserver);
-
- sendAsyncMessage("waitForXULAlert", true);
- }
- });
- };
-
- Services.ww.registerNotification(windowObserver);
- });
-});
-
-var cookie = 0;
-function promiseCreateXULAlert(alertService, listener, name) {
- return new Promise(resolve => {
- chromeScript.addMessageListener("waitForXULAlert", function waitedForAlert(result) {
- chromeScript.removeMessageListener("waitForXULAlert", waitedForAlert);
- resolve(result);
- });
-
- chromeScript.sendAsyncMessage("waitForXULAlert");
- alertService.showAlertNotification(null, "title", "body",
- true, cookie++, listener, name, null, null, null,
- null, false, true);
- });
-}
-
-add_task(function* test_require_interaction() {
- if (!("@mozilla.org/alerts-service;1" in Cc)) {
- todo(false, "Alerts service does not exist in this application.");
- return;
- }
-
- ok(true, "Alerts service exists in this application.");
-
- var alertService;
- try {
- alertService = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
- ok(true, "Alerts service is available.");
- } catch (ex) {
- todo(false, "Alerts service is not available.");
- return;
- }
-
- yield SpecialPowers.pushPrefEnv({"set": [
- [ "dom.webnotifications.requireinteraction.enabled", true ],
- [ "dom.webnotifications.requireinteraction.count", 2 ]
- ]});
-
- var expectedSequence = [
- "first show",
- "second show",
- "second finished",
- "second replacement show",
- "third finished",
- "first finished",
- "third replacement show",
- "second replacement finished",
- "third replacement finished"
- ];
-
- var actualSequence = [];
-
- function createAlertListener(name, showCallback, finishCallback) {
- return (subject, topic, data) => {
- if (topic == "alertshow") {
- actualSequence.push(name + " show");
- if (showCallback) {
- showCallback();
- }
- } else if (topic == "alertfinished") {
- actualSequence.push(name + " finished");
- if (finishCallback) {
- finishCallback();
- }
- }
- }
- }
-
- var xulAlertCreated = yield promiseCreateXULAlert(alertService,
- createAlertListener("first"), "first");
- if (!xulAlertCreated) {
- ok(true, "Platform does not use XUL alerts.");
- alertService.closeAlert("first");
- return;
- }
-
- xulAlertCreated = yield promiseCreateXULAlert(alertService,
- createAlertListener("second"), "second");
- ok(xulAlertCreated, "Create XUL alert");
-
- // Replace second alert
- xulAlertCreated = yield promiseCreateXULAlert(alertService,
- createAlertListener("second replacement"), "second");
- ok(xulAlertCreated, "Create XUL alert");
-
- var testFinishResolve;
- var testFinishPromise = new Promise((resolve) => { testFinishResolve = resolve; });
-
- xulAlertCreated = yield promiseCreateXULAlert(alertService,
- createAlertListener("third"), "third"),
- ok(!xulAlertCreated, "XUL alert should not be visible");
-
- // Replace the not-yet-visible third alert.
- xulAlertCreated = yield promiseCreateXULAlert(alertService,
- createAlertListener("third replacement",
- function showCallback() {
- alertService.closeAlert("second");
- alertService.closeAlert("third");
- },
- function finishCallback() {
- // Check actual sequence of alert events compared to expected sequence.
- for (var i = 0; i < actualSequence.length; i++) {
- is(actualSequence[i], expectedSequence[i],
- "Alert callback at index " + i + " should be in expected order.");
- }
-
- testFinishResolve();
- }), "third");
-
- ok(!xulAlertCreated, "XUL alert should not be visible");
-
- alertService.closeAlert("first");
-
- yield testFinishPromise;
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/alerts/test/test_image.html b/toolkit/components/alerts/test/test_image.html
deleted file mode 100644
index 7bf89fab2..000000000
--- a/toolkit/components/alerts/test/test_image.html
+++ /dev/null
@@ -1,118 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for Bug 1233086</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-
-<body>
-<p id="display"></p>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-const Cc = SpecialPowers.Cc;
-const Ci = SpecialPowers.Ci;
-const Services = SpecialPowers.Services;
-
-const imageServerURL = "http://mochi.test:8888/tests/toolkit/components/alerts/test/image_server.sjs";
-
-function makeAlert(...params) {
- var alert = Cc["@mozilla.org/alert-notification;1"]
- .createInstance(Ci.nsIAlertNotification);
- alert.init(...params);
- return alert;
-}
-
-function promiseImage(alert, timeout = 0, userData = null) {
- return new Promise(resolve => {
- var isDone = false;
- function done(value) {
- ok(!isDone, "Should call the image listener once");
- isDone = true;
- resolve(value);
- }
- alert.loadImage(timeout, SpecialPowers.wrapCallbackObject({
- onImageReady(aUserData, aRequest) {
- done([true, aRequest, aUserData]);
- },
- onImageMissing(aUserData) {
- done([false, aUserData]);
- },
- }), SpecialPowers.wrap(userData));
- });
-}
-
-add_task(function* testContext() {
- var inUserData = Cc["@mozilla.org/supports-PRInt64;1"]
- .createInstance(Ci.nsISupportsPRInt64);
- inUserData.data = 123;
-
- var alert = makeAlert(null, imageServerURL + "?f=image.png");
- var [ready, , userData] = yield promiseImage(alert, 0, inUserData);
- ok(ready, "Should load requested image");
- is(userData.QueryInterface(Ci.nsISupportsPRInt64).data, 123,
- "Should pass user data for loaded image");
-
- alert = makeAlert(null, imageServerURL + "?s=404");
- [ready, userData] = yield promiseImage(alert, 0, inUserData);
- ok(!ready, "Should not load missing image");
- is(userData.QueryInterface(Ci.nsISupportsPRInt64).data, 123,
- "Should pass user data for missing image");
-});
-
-add_task(function* testTimeout() {
- var alert = makeAlert(null, imageServerURL + "?f=image.png&t=3");
- var [ready] = yield promiseImage(alert, 1000);
- ok(!ready, "Should cancel request if timeout fires");
-
- [ready, request] = yield promiseImage(alert, 45000);
- ok(ready, "Should load image if request finishes before timeout");
-});
-
-add_task(function* testAnimatedGIF() {
- var alert = makeAlert(null, imageServerURL + "?f=image.gif");
- var [ready, request] = yield promiseImage(alert);
- ok(ready, "Should load first animated GIF frame");
- is(request.mimeType, "image/gif", "Should report correct GIF MIME type");
- is(request.image.width, 256, "GIF width should be 256px");
- is(request.image.height, 256, "GIF height should be 256px");
-});
-
-add_task(function* testCancel() {
- var alert = makeAlert(null, imageServerURL + "?f=image.gif&t=180");
- yield new Promise((resolve, reject) => {
- var request = alert.loadImage(0, SpecialPowers.wrapCallbackObject({
- onImageReady() {
- reject(new Error("Should not load cancelled request"));
- },
- onImageMissing() {
- resolve();
- },
- }), null);
- request.cancel(SpecialPowers.Cr.NS_BINDING_ABORTED);
- });
-});
-
-add_task(function* testMixedContent() {
- // Loading principal is HTTPS; image URL is HTTP.
- var origin = "https://mochi.test:8888";
- var principal = Services.scriptSecurityManager
- .createCodebasePrincipalFromOrigin(origin);
-
- var alert = makeAlert(null, imageServerURL + "?f=image.png",
- null, null, false, null, null, null,
- null, principal);
- var [ready, request] = yield promiseImage(alert);
- ok(ready, "Should load cross-protocol image");
- is(request.mimeType, "image/png", "Should report correct MIME type");
- is(request.image.width, 32, "Width should be 32px");
- is(request.image.height, 32, "Height should be 32px");
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/alerts/test/test_multiple_alerts.html b/toolkit/components/alerts/test/test_multiple_alerts.html
deleted file mode 100644
index 9d939b63a..000000000
--- a/toolkit/components/alerts/test/test_multiple_alerts.html
+++ /dev/null
@@ -1,103 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for multiple alerts</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-const Cc = SpecialPowers.Cc;
-const Ci = SpecialPowers.Ci;
-
-const chromeScript = SpecialPowers.loadChromeScript(_ => {
- Components.utils.import("resource://gre/modules/Services.jsm");
- Components.utils.import("resource://gre/modules/Timer.jsm");
-
- const alertService = Components.classes["@mozilla.org/alerts-service;1"]
- .getService(Components.interfaces.nsIAlertsService);
-
- addMessageListener("waitForPosition", function() {
- var timer = setTimeout(function() {
- Services.ww.unregisterNotification(windowObserver);
- sendAsyncMessage("waitedForPosition", null);
- }, 2000);
-
- var windowObserver = function(aSubject, aTopic, aData) {
- if (aTopic != "domwindowopened") {
- return;
- }
-
- // Alerts are implemented using XUL.
- clearTimeout(timer);
-
- Services.ww.unregisterNotification(windowObserver);
-
- var win = aSubject.QueryInterface(Components.interfaces.nsIDOMWindow);
- win.addEventListener("pageshow", function onPageShow() {
- win.removeEventListener("pageshow", onPageShow, false);
-
- var x = win.screenX;
- var y = win.screenY;
-
- win.addEventListener("pagehide", function onPageHide() {
- win.removeEventListener("pagehide", onPageHide, false);
- sendAsyncMessage("waitedForPosition", { x, y });
- }, false);
-
- alertService.closeAlert();
- }, false);
- };
-
- Services.ww.registerNotification(windowObserver);
- });
-});
-
-function promiseAlertPosition(alertService) {
- return new Promise(resolve => {
- chromeScript.addMessageListener("waitedForPosition", function waitedForPosition(result) {
- chromeScript.removeMessageListener("waitedForPosition", waitedForPosition);
- resolve(result);
- });
- chromeScript.sendAsyncMessage("waitForPosition");
-
- alertService.showAlertNotification(null, "title", "body");
- ok(true, "Alert shown.");
- });
-}
-
-add_task(function* test_multiple_alerts() {
- if (!("@mozilla.org/alerts-service;1" in Cc)) {
- todo(false, "Alerts service does not exist in this application.");
- return;
- }
-
- ok(true, "Alerts service exists in this application.");
-
- var alertService;
- try {
- alertService = Cc["@mozilla.org/alerts-service;1"].getService(Ci.nsIAlertsService);
- ok(true, "Alerts service is available.");
- } catch (ex) {
- todo(false, "Alerts service is not available.");
- return;
- }
-
- var firstAlertPosition = yield promiseAlertPosition(alertService);
- if (!firstAlertPosition) {
- ok(true, "Platform does not use XUL alerts.");
- return;
- }
-
- var secondAlertPosition = yield promiseAlertPosition(alertService);
- is(secondAlertPosition.x, firstAlertPosition.x, "Second alert should be opened in the same position.");
- is(secondAlertPosition.y, firstAlertPosition.y, "Second alert should be opened in the same position.");
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/alerts/test/test_principal.html b/toolkit/components/alerts/test/test_principal.html
deleted file mode 100644
index 74a20dbd7..000000000
--- a/toolkit/components/alerts/test/test_principal.html
+++ /dev/null
@@ -1,122 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for Bug 1202933</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-
-<body>
-<p id="display"></p>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-const Cc = SpecialPowers.Cc;
-const Ci = SpecialPowers.Ci;
-const Services = SpecialPowers.Services;
-
-const notifier = Cc["@mozilla.org/alerts-service;1"]
- .getService(Ci.nsIAlertsService);
-
-const chromeScript = SpecialPowers.loadChromeScript(_ => {
- Components.utils.import("resource://gre/modules/Services.jsm");
-
- addMessageListener("anyXULAlertsVisible", function() {
- var windows = Services.wm.getEnumerator("alert:alert");
- return windows.hasMoreElements();
- });
-
- addMessageListener("getAlertSource", function() {
- var alertWindows = Services.wm.getEnumerator("alert:alert");
- if (!alertWindows) {
- return null;
- }
- var alertWindow = alertWindows.getNext();
- return alertWindow.document.getElementById("alertSourceLabel").getAttribute("value");
- });
-});
-
-function notify(alertName, principal) {
- return new Promise((resolve, reject) => {
- var source;
- function observe(subject, topic, data) {
- if (topic == "alertclickcallback") {
- reject(new Error("Alerts should not be clicked during test"));
- } else if (topic == "alertshow") {
- source = chromeScript.sendSyncMessage("getAlertSource")[0][0];
- notifier.closeAlert(alertName);
- } else {
- is(topic, "alertfinished", "Should hide alert");
- resolve(source);
- }
- }
- notifier.showAlertNotification(null, "Notification test",
- "Surprise! I'm here to test notifications!",
- false, alertName, observe, alertName,
- null, null, null, principal);
- if (SpecialPowers.Services.appinfo.OS == "Darwin") {
- notifier.closeAlert(alertName);
- }
- });
-}
-
-function* testNoPrincipal() {
- var source = yield notify("noPrincipal", null);
- ok(!source, "Should omit source without principal");
-}
-
-function* testSystemPrincipal() {
- var principal = Services.scriptSecurityManager.getSystemPrincipal();
- var source = yield notify("systemPrincipal", principal);
- ok(!source, "Should omit source for system principal");
-}
-
-function* testNullPrincipal() {
- var principal = Services.scriptSecurityManager.createNullPrincipal({});
- var source = yield notify("nullPrincipal", principal);
- ok(!source, "Should omit source for null principal");
-}
-
-function* testNodePrincipal() {
- var principal = SpecialPowers.wrap(document).nodePrincipal;
- var source = yield notify("nodePrincipal", principal);
-
- var stringBundle = Services.strings.createBundle(
- "chrome://alerts/locale/alert.properties"
- );
- var localizedSource = stringBundle.formatStringFromName(
- "source.label", [principal.URI.hostPort], 1);
- is(source, localizedSource, "Should include source for node principal");
-}
-
-function runTest() {
- if (!("@mozilla.org/alerts-service;1" in Cc)) {
- todo(false, "Alerts service does not exist in this application");
- return;
- }
-
- if ("@mozilla.org/system-alerts-service;1" in Cc) {
- todo(false, "Native alerts service exists in this application");
- return;
- }
-
- ok(true, "Alerts service exists in this application");
-
- // sendSyncMessage returns an array of arrays. See the comments in
- // test_alerts_noobserve.html and test_SpecialPowersLoadChromeScript.html.
- var [[alertsVisible]] = chromeScript.sendSyncMessage("anyXULAlertsVisible");
- ok(!alertsVisible, "Alerts should not be present at the start of the test.");
-
- add_task(testNoPrincipal);
- add_task(testSystemPrincipal);
- add_task(testNullPrincipal);
- add_task(testNodePrincipal);
-}
-
-runTest();
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/apppicker/content/appPicker.js b/toolkit/components/apppicker/content/appPicker.js
index 469a6ca23..21a007632 100644
--- a/toolkit/components/apppicker/content/appPicker.js
+++ b/toolkit/components/apppicker/content/appPicker.js
@@ -2,8 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
-
function AppPicker() {}
AppPicker.prototype =
@@ -115,19 +113,19 @@ AppPicker.prototype =
* Retrieve the pretty description from the file
*/
getFileDisplayName: function getFileDisplayName(file) {
- if (AppConstants.platform == "win") {
- if (file instanceof Components.interfaces.nsILocalFileWin) {
- try {
- return file.getVersionInfoField("FileDescription");
- } catch (e) {}
- }
- } else if (AppConstants.platform == "macosx") {
- if (file instanceof Components.interfaces.nsILocalFileMac) {
- try {
- return file.bundleDisplayName;
- } catch (e) {}
- }
+#ifdef XP_WIN
+ if (file instanceof Components.interfaces.nsILocalFileWin) {
+ try {
+ return file.getVersionInfoField("FileDescription");
+ } catch (e) {}
+ }
+#elifdef XP_MACOSX
+ if (file instanceof Components.interfaces.nsILocalFileMac) {
+ try {
+ return file.bundleDisplayName;
+ } catch (e) {}
}
+#endif
return file.leafName;
},
@@ -183,13 +181,13 @@ AppPicker.prototype =
var fileLoc = Components.classes["@mozilla.org/file/directory_service;1"]
.getService(Components.interfaces.nsIProperties);
var startLocation;
- if (AppConstants.platform == "win") {
- startLocation = "ProgF"; // Program Files
- } else if (AppConstants.platform == "macosx") {
- startLocation = "LocApp"; // Local Applications
- } else {
- startLocation = "Home";
- }
+#ifdef XP_WIN
+ startLocation = "ProgF"; // Program Files
+#elifdef XP_MACOSX
+ startLocation = "LocApp"; // Local Applications
+#else
+ startLocation = "Home";
+#endif
fp.displayDirectory =
fileLoc.get(startLocation, Components.interfaces.nsILocalFile);
diff --git a/toolkit/components/apppicker/jar.mn b/toolkit/components/apppicker/jar.mn
index 60e029d8a..d8431c3fe 100644
--- a/toolkit/components/apppicker/jar.mn
+++ b/toolkit/components/apppicker/jar.mn
@@ -4,5 +4,5 @@
toolkit.jar:
content/global/appPicker.xul (content/appPicker.xul)
- content/global/appPicker.js (content/appPicker.js)
+* content/global/appPicker.js (content/appPicker.js)
diff --git a/toolkit/components/asyncshutdown/moz.build b/toolkit/components/asyncshutdown/moz.build
index 79a4c44c7..0051c97a0 100644
--- a/toolkit/components/asyncshutdown/moz.build
+++ b/toolkit/components/asyncshutdown/moz.build
@@ -4,22 +4,12 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
-
XPIDL_MODULE = 'toolkit_asyncshutdown'
+XPIDL_SOURCES += ['nsIAsyncShutdown.idl']
-XPIDL_SOURCES += [
- 'nsIAsyncShutdown.idl',
-]
-
-EXTRA_JS_MODULES += [
- 'AsyncShutdown.jsm',
-]
+EXTRA_JS_MODULES += ['AsyncShutdown.jsm']
EXTRA_COMPONENTS += [
'nsAsyncShutdown.js',
'nsAsyncShutdown.manifest',
]
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Async Tooling')
diff --git a/toolkit/components/asyncshutdown/tests/xpcshell/.eslintrc.js b/toolkit/components/asyncshutdown/tests/xpcshell/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/asyncshutdown/tests/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/asyncshutdown/tests/xpcshell/head.js b/toolkit/components/asyncshutdown/tests/xpcshell/head.js
deleted file mode 100644
index 9de489808..000000000
--- a/toolkit/components/asyncshutdown/tests/xpcshell/head.js
+++ /dev/null
@@ -1,174 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-"use strict";
-
-var Cu = Components.utils;
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/AsyncShutdown.jsm");
-
-var asyncShutdownService = Cc["@mozilla.org/async-shutdown-service;1"].
- getService(Ci.nsIAsyncShutdownService);
-
-
-Services.prefs.setBoolPref("toolkit.asyncshutdown.testing", true);
-
-/**
- * Utility function used to provide the same API for various sources
- * of async shutdown barriers.
- *
- * @param {string} kind One of
- * - "phase" to test an AsyncShutdown phase;
- * - "barrier" to test an instance of AsyncShutdown.Barrier;
- * - "xpcom-barrier" to test an instance of nsIAsyncShutdownBarrier;
- * - "xpcom-barrier-unwrapped" to test the field `jsclient` of a nsIAsyncShutdownClient.
- *
- * @return An object with the following methods:
- * - addBlocker() - the same method as AsyncShutdown phases and barrier clients
- * - wait() - trigger the resolution of the lock
- */
-function makeLock(kind) {
- if (kind == "phase") {
- let topic = "test-Phase-" + ++makeLock.counter;
- let phase = AsyncShutdown._getPhase(topic);
- return {
- addBlocker: function(...args) {
- return phase.addBlocker(...args);
- },
- removeBlocker: function(blocker) {
- return phase.removeBlocker(blocker);
- },
- wait: function() {
- Services.obs.notifyObservers(null, topic, null);
- return Promise.resolve();
- }
- };
- } else if (kind == "barrier") {
- let name = "test-Barrier-" + ++makeLock.counter;
- let barrier = new AsyncShutdown.Barrier(name);
- return {
- addBlocker: barrier.client.addBlocker,
- removeBlocker: barrier.client.removeBlocker,
- wait: function() {
- return barrier.wait();
- }
- };
- } else if (kind == "xpcom-barrier") {
- let name = "test-xpcom-Barrier-" + ++makeLock.counter;
- let barrier = asyncShutdownService.makeBarrier(name);
- return {
- addBlocker: function(blockerName, condition, state) {
- if (condition == null) {
- // Slight trick as `null` or `undefined` cannot be used as keys
- // for `xpcomMap`. Note that this has no incidence on the result
- // of the test as the XPCOM interface imposes that the condition
- // is a method, so it cannot be `null`/`undefined`.
- condition = "<this case can't happen with the xpcom interface>";
- }
- let blocker = makeLock.xpcomMap.get(condition);
- if (!blocker) {
- blocker = {
- name: blockerName,
- state: state,
- blockShutdown: function(aBarrierClient) {
- return Task.spawn(function*() {
- try {
- if (typeof condition == "function") {
- yield Promise.resolve(condition());
- } else {
- yield Promise.resolve(condition);
- }
- } finally {
- aBarrierClient.removeBlocker(blocker);
- }
- });
- },
- };
- makeLock.xpcomMap.set(condition, blocker);
- }
- let {fileName, lineNumber, stack} = (new Error());
- return barrier.client.addBlocker(blocker, fileName, lineNumber, stack);
- },
- removeBlocker: function(condition) {
- let blocker = makeLock.xpcomMap.get(condition);
- if (!blocker) {
- return;
- }
- barrier.client.removeBlocker(blocker);
- },
- wait: function() {
- return new Promise(resolve => {
- barrier.wait(resolve);
- });
- }
- };
- } else if ("unwrapped-xpcom-barrier") {
- let name = "unwrapped-xpcom-barrier-" + ++makeLock.counter;
- let barrier = asyncShutdownService.makeBarrier(name);
- let client = barrier.client.jsclient;
- return {
- addBlocker: client.addBlocker,
- removeBlocker: client.removeBlocker,
- wait: function() {
- return new Promise(resolve => {
- barrier.wait(resolve);
- });
- }
- };
- }
- throw new TypeError("Unknown kind " + kind);
-}
-makeLock.counter = 0;
-makeLock.xpcomMap = new Map(); // Note: Not a WeakMap as we wish to handle non-gc-able keys (e.g. strings)
-
-/**
- * An asynchronous task that takes several ticks to complete.
- *
- * @param {*=} resolution The value with which the resulting promise will be
- * resolved once the task is complete. This may be a rejected promise,
- * in which case the resulting promise will itself be rejected.
- * @param {object=} outResult An object modified by side-effect during the task.
- * Initially, its field |isFinished| is set to |false|. Once the task is
- * complete, its field |isFinished| is set to |true|.
- *
- * @return {promise} A promise fulfilled once the task is complete
- */
-function longRunningAsyncTask(resolution = undefined, outResult = {}) {
- outResult.isFinished = false;
- if (!("countFinished" in outResult)) {
- outResult.countFinished = 0;
- }
- let deferred = Promise.defer();
- do_timeout(100, function() {
- ++outResult.countFinished;
- outResult.isFinished = true;
- deferred.resolve(resolution);
- });
- return deferred.promise;
-}
-
-function get_exn(f) {
- try {
- f();
- return null;
- } catch (ex) {
- return ex;
- }
-}
-
-function do_check_exn(exn, constructor) {
- do_check_neq(exn, null);
- if (exn.name == constructor) {
- do_check_eq(exn.constructor.name, constructor);
- return;
- }
- do_print("Wrong error constructor");
- do_print(exn.constructor.name);
- do_print(exn.stack);
- do_check_true(false);
-}
diff --git a/toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown.js b/toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown.js
deleted file mode 100644
index f1aebc3ad..000000000
--- a/toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown.js
+++ /dev/null
@@ -1,194 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-"use strict";
-
-Cu.import("resource://gre/modules/PromiseUtils.jsm", this);
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_no_condition() {
- for (let kind of ["phase", "barrier", "xpcom-barrier", "xpcom-barrier-unwrapped"]) {
- do_print("Testing a barrier with no condition (" + kind + ")");
- let lock = makeLock(kind);
- yield lock.wait();
- do_print("Barrier with no condition didn't lock");
- }
-});
-
-add_task(function* test_phase_various_failures() {
- for (let kind of ["phase", "barrier", "xpcom-barrier", "xpcom-barrier-unwrapped"]) {
- do_print("Kind: " + kind);
- // Testing with wrong arguments
- let lock = makeLock(kind);
-
- Assert.throws(() => lock.addBlocker(), /TypeError|NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS/);
- Assert.throws(() => lock.addBlocker(null, true), /TypeError|NS_ERROR_XPC_JAVASCRIPT_ERROR_WITH_DETAILS/);
-
- if (kind != "xpcom-barrier") {
- // xpcom-barrier actually expects a string in that position
- Assert.throws(() => lock.addBlocker("Test 2", () => true, "not a function"), /TypeError/);
- }
-
- // Attempting to add a blocker after we are done waiting
- yield lock.wait();
- Assert.throws(() => lock.addBlocker("Test 3", () => true), /is finished/);
- }
-});
-
-add_task(function* test_reentrant() {
- do_print("Ensure that we can call addBlocker from within a blocker");
-
- for (let kind of ["phase", "barrier", "xpcom-barrier", "xpcom-barrier-unwrapped"]) {
- do_print("Kind: " + kind);
- let lock = makeLock(kind);
-
- let deferredOuter = PromiseUtils.defer();
- let deferredInner = PromiseUtils.defer();
- let deferredBlockInner = PromiseUtils.defer();
-
- lock.addBlocker("Outer blocker", () => {
- do_print("Entering outer blocker");
- deferredOuter.resolve();
- lock.addBlocker("Inner blocker", () => {
- do_print("Entering inner blocker");
- deferredInner.resolve();
- return deferredBlockInner.promise;
- });
- });
-
- // Note that phase-style locks spin the event loop and do not return from
- // `lock.wait()` until after all blockers have been resolved. Therefore,
- // to be able to test them, we need to dispatch the following steps to the
- // event loop before calling `lock.wait()`, which we do by forcing
- // a Promise.resolve().
- //
- let promiseSteps = Task.spawn(function* () {
- yield Promise.resolve();
-
- do_print("Waiting until we have entered the outer blocker");
- yield deferredOuter.promise;
-
- do_print("Waiting until we have entered the inner blocker");
- yield deferredInner.promise;
-
- do_print("Allowing the lock to resolve")
- deferredBlockInner.resolve();
- });
-
- do_print("Starting wait");
- yield lock.wait();
-
- do_print("Waiting until all steps have been walked");
- yield promiseSteps;
- }
-});
-
-
-add_task(function* test_phase_removeBlocker() {
- do_print("Testing that we can call removeBlocker before, during and after the call to wait()");
-
- for (let kind of ["phase", "barrier", "xpcom-barrier", "xpcom-barrier-unwrapped"]) {
-
- do_print("Switching to kind " + kind);
- do_print("Attempt to add then remove a blocker before wait()");
- let lock = makeLock(kind);
- let blocker = () => {
- do_print("This promise will never be resolved");
- return Promise.defer().promise;
- };
-
- lock.addBlocker("Wait forever", blocker);
- let do_remove_blocker = function(aLock, aBlocker, aShouldRemove) {
- do_print("Attempting to remove blocker " + aBlocker + ", expecting result " + aShouldRemove);
- if (kind == "xpcom-barrier") {
- // The xpcom variant always returns `undefined`, so we can't
- // check its result.
- aLock.removeBlocker(aBlocker);
- return;
- }
- do_check_eq(aLock.removeBlocker(aBlocker), aShouldRemove);
- };
- do_remove_blocker(lock, blocker, true);
- do_remove_blocker(lock, blocker, false);
- do_print("Attempt to remove non-registered blockers before wait()");
- do_remove_blocker(lock, "foo", false);
- do_remove_blocker(lock, null, false);
- do_print("Waiting (should lift immediately)");
- yield lock.wait();
-
- do_print("Attempt to add a blocker then remove it during wait()");
- lock = makeLock(kind);
- let blockers = [
- () => {
- do_print("This blocker will self-destruct");
- do_remove_blocker(lock, blockers[0], true);
- return Promise.defer().promise;
- },
- () => {
- do_print("This blocker will self-destruct twice");
- do_remove_blocker(lock, blockers[1], true);
- do_remove_blocker(lock, blockers[1], false);
- return Promise.defer().promise;
- },
- () => {
- do_print("Attempt to remove non-registered blockers during wait()");
- do_remove_blocker(lock, "foo", false);
- do_remove_blocker(lock, null, false);
- }
- ];
- for (let i in blockers) {
- lock.addBlocker("Wait forever again: " + i, blockers[i]);
- }
- do_print("Waiting (should lift very quickly)");
- yield lock.wait();
- do_remove_blocker(lock, blockers[0], false);
-
-
- do_print("Attempt to remove a blocker after wait");
- lock = makeLock(kind);
- blocker = Promise.resolve.bind(Promise);
- yield lock.wait();
- do_remove_blocker(lock, blocker, false);
-
- do_print("Attempt to remove non-registered blocker after wait()");
- do_remove_blocker(lock, "foo", false);
- do_remove_blocker(lock, null, false);
- }
-
-});
-
-add_task(function* test_state() {
- do_print("Testing information contained in `state`");
-
- let BLOCKER_NAME = "test_state blocker " + Math.random();
-
- // Set up the barrier. Note that we cannot test `barrier.state`
- // immediately, as it initially contains "Not started"
- let barrier = new AsyncShutdown.Barrier("test_filename");
- let deferred = Promise.defer();
- let {filename, lineNumber} = Components.stack;
- barrier.client.addBlocker(BLOCKER_NAME,
- function() {
- return deferred.promise;
- });
-
- let promiseDone = barrier.wait();
-
- // Now that we have called `wait()`, the state contains interesting things
- let state = barrier.state[0];
- do_print("State: " + JSON.stringify(barrier.state, null, "\t"));
- Assert.equal(state.filename, filename);
- Assert.equal(state.lineNumber, lineNumber + 1);
- Assert.equal(state.name, BLOCKER_NAME);
- Assert.ok(state.stack.some(x => x.includes("test_state")), "The stack contains the caller function's name");
- Assert.ok(state.stack.some(x => x.includes(filename)), "The stack contains the calling file's name");
-
- deferred.resolve();
- yield promiseDone;
-});
-
-add_task(function*() {
- Services.prefs.clearUserPref("toolkit.asyncshutdown.testing");
-});
diff --git a/toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown_leave_uncaught.js b/toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown_leave_uncaught.js
deleted file mode 100644
index 33da1f53f..000000000
--- a/toolkit/components/asyncshutdown/tests/xpcshell/test_AsyncShutdown_leave_uncaught.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-"use strict";
-
-//
-// This file contains tests that need to leave uncaught asynchronous
-// errors. If your test catches all its asynchronous errors, please
-// put it in another file.
-//
-
-Promise.Debugging.clearUncaughtErrorObservers();
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_phase_simple_async() {
- do_print("Testing various combinations of a phase with a single condition");
- for (let kind of ["phase", "barrier", "xpcom-barrier", "xpcom-barrier-unwrapped"]) {
- for (let arg of [undefined, null, "foo", 100, new Error("BOOM")]) {
- for (let resolution of [arg, Promise.reject(arg)]) {
- for (let success of [false, true]) {
- for (let state of [[null],
- [],
- [() => "some state"],
- [function() {
- throw new Error("State BOOM"); }],
- [function() {
- return {
- toJSON: function() {
- throw new Error("State.toJSON BOOM");
- }
- };
- }]]) {
- // Asynchronous phase
- do_print("Asynchronous test with " + arg + ", " + resolution + ", " + kind);
- let lock = makeLock(kind);
- let outParam = { isFinished: false };
- lock.addBlocker(
- "Async test",
- function() {
- if (success) {
- return longRunningAsyncTask(resolution, outParam);
- }
- throw resolution;
- },
- ...state
- );
- do_check_false(outParam.isFinished);
- yield lock.wait();
- do_check_eq(outParam.isFinished, success);
- }
- }
-
- // Synchronous phase - just test that we don't throw/freeze
- do_print("Synchronous test with " + arg + ", " + resolution + ", " + kind);
- let lock = makeLock(kind);
- lock.addBlocker(
- "Sync test",
- resolution
- );
- yield lock.wait();
- }
- }
- }
-});
-
-add_task(function* test_phase_many() {
- do_print("Testing various combinations of a phase with many conditions");
- for (let kind of ["phase", "barrier", "xpcom-barrier", "xpcom-barrier-unwrapped"]) {
- let lock = makeLock(kind);
- let outParams = [];
- for (let arg of [undefined, null, "foo", 100, new Error("BOOM")]) {
- for (let resolve of [true, false]) {
- do_print("Testing with " + kind + ", " + arg + ", " + resolve);
- let resolution = resolve ? arg : Promise.reject(arg);
- let outParam = { isFinished: false };
- lock.addBlocker(
- "Test " + Math.random(),
- () => longRunningAsyncTask(resolution, outParam)
- );
- }
- }
- do_check_true(outParams.every((x) => !x.isFinished));
- yield lock.wait();
- do_check_true(outParams.every((x) => x.isFinished));
- }
-});
-
-
-
-
-add_task(function*() {
- Services.prefs.clearUserPref("toolkit.asyncshutdown.testing");
-});
-
diff --git a/toolkit/components/asyncshutdown/tests/xpcshell/test_converters.js b/toolkit/components/asyncshutdown/tests/xpcshell/test_converters.js
deleted file mode 100644
index c6c923187..000000000
--- a/toolkit/components/asyncshutdown/tests/xpcshell/test_converters.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-"use strict";
-
-/**
- * Test conversion between nsIPropertyBag and JS values.
- */
-
-var PropertyBagConverter = asyncShutdownService.wrappedJSObject._propertyBagConverter;
-
-function run_test() {
- test_conversions();
-}
-
-function normalize(obj) {
- if (obj == null || typeof obj != "object") {
- return obj;
- }
- if (Array.isArray(obj)) {
- return obj.map(normalize);
- }
- let result = {};
- for (let k of Object.keys(obj).sort()) {
- result[k] = normalize(obj[k]);
- }
- return result;
-}
-
-function test_conversions() {
- const SAMPLES = [
- // Simple values
- 1,
- true,
- "string",
- null,
-
- // Objects
- {
- a: 1,
- b: true,
- c: "string",
- d:.5,
- e: [2, false, "another string", .3],
- f: [],
- g: {
- a2: 1,
- b2: true,
- c2: "string",
- d2:.5,
- e2: [2, false, "another string", .3],
- f2: [],
- g2: [{
- a3: 1,
- b3: true,
- c3: "string",
- d3:.5,
- e3: [2, false, "another string", .3],
- f3: [],
- g3: {}
- }]
- }
- }];
-
- for (let sample of SAMPLES) {
- let stringified = JSON.stringify(normalize(sample), null, "\t");
- do_print("Testing conversions of " + stringified);
- let rewrites = [sample];
- for (let i = 1; i < 3; ++i) {
- let source = rewrites[i - 1];
- let bag = PropertyBagConverter.fromValue(source);
- do_print(" => " + bag);
- if (source == null) {
- Assert.ok(bag == null, "The bag is null");
- } else if (typeof source == "object") {
- Assert.ok(bag instanceof Ci.nsIPropertyBag, "The bag is a property bag");
- } else {
- Assert.ok(typeof bag != "object", "The bag is not an object");
- }
- let dest = PropertyBagConverter.toValue(bag);
- let restringified = JSON.stringify(normalize(dest), null, "\t");
- do_print("Comparing");
- do_print(stringified);
- do_print(restringified);
- Assert.deepEqual(sample, dest, "Testing after " + i + " conversions");
- rewrites.push(dest);
- }
- }
-}
diff --git a/toolkit/components/asyncshutdown/tests/xpcshell/xpcshell.ini b/toolkit/components/asyncshutdown/tests/xpcshell/xpcshell.ini
deleted file mode 100644
index f573955bc..000000000
--- a/toolkit/components/asyncshutdown/tests/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-head=head.js
-tail=
-skip-if = toolkit == 'android'
-
-[test_AsyncShutdown.js]
-[test_AsyncShutdown_leave_uncaught.js]
-[test_converters.js]
diff --git a/toolkit/components/autocomplete/moz.build b/toolkit/components/autocomplete/moz.build
index f3817d642..a2e30b34b 100644
--- a/toolkit/components/autocomplete/moz.build
+++ b/toolkit/components/autocomplete/moz.build
@@ -4,8 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
-
XPIDL_SOURCES += [
'nsIAutoCompleteController.idl',
'nsIAutoCompleteInput.idl',
@@ -23,6 +21,3 @@ UNIFIED_SOURCES += [
]
FINAL_LIBRARY = 'xul'
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Autocomplete')
diff --git a/toolkit/components/autocomplete/tests/unit/.eslintrc.js b/toolkit/components/autocomplete/tests/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/autocomplete/tests/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/autocomplete/tests/unit/head_autocomplete.js b/toolkit/components/autocomplete/tests/unit/head_autocomplete.js
deleted file mode 100644
index 5a458bdf4..000000000
--- a/toolkit/components/autocomplete/tests/unit/head_autocomplete.js
+++ /dev/null
@@ -1,211 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-
-/**
- * Dummy nsIAutoCompleteInput source that returns
- * the given list of AutoCompleteSearch names.
- *
- * Implements only the methods needed for this test.
- */
-function AutoCompleteInputBase(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInputBase.prototype = {
-
- // Array of AutoCompleteSearch names
- searches: null,
-
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "",
- disableAutoComplete: false,
- completeDefaultIndex: false,
-
- // Text selection range
- _selStart: 0,
- _selEnd: 0,
- get selectionStart() {
- return this._selStart;
- },
- get selectionEnd() {
- return this._selEnd;
- },
- selectTextRange: function(aStart, aEnd) {
- this._selStart = aStart;
- this._selEnd = aEnd;
- },
-
- get searchCount() {
- return this.searches.length;
- },
-
- getSearchAt: function(aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchBegin: function() {},
- onSearchComplete: function() {},
-
- popupOpen: false,
-
- get popup() {
- if (!this._popup) {
- this._popup = new AutocompletePopupBase(this);
- }
- return this._popup;
- },
-
- // nsISupports implementation
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteInput])
-}
-
-/**
- * nsIAutoCompleteResult implementation
- */
-function AutoCompleteResultBase(aValues) {
- this._values = aValues;
-}
-AutoCompleteResultBase.prototype = {
-
- // Arrays
- _values: null,
- _comments: [],
- _styles: [],
- _finalCompleteValues: [],
-
- searchString: "",
- searchResult: null,
-
- defaultIndex: -1,
-
- _typeAheadResult: false,
- get typeAheadResult() {
- return this._typeAheadResult;
- },
-
- get matchCount() {
- return this._values.length;
- },
-
- getValueAt: function(aIndex) {
- return this._values[aIndex];
- },
-
- getLabelAt: function(aIndex) {
- return this.getValueAt(aIndex);
- },
-
- getCommentAt: function(aIndex) {
- return this._comments[aIndex];
- },
-
- getStyleAt: function(aIndex) {
- return this._styles[aIndex];
- },
-
- getImageAt: function(aIndex) {
- return "";
- },
-
- getFinalCompleteValueAt: function(aIndex) {
- return this._finalCompleteValues[aIndex] || this._values[aIndex];
- },
-
- removeValueAt: function (aRowIndex, aRemoveFromDb) {},
-
- // nsISupports implementation
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteResult])
-}
-
-/**
- * nsIAutoCompleteSearch implementation that always returns
- * the same result set.
- */
-function AutoCompleteSearchBase(aName, aResult) {
- this.name = aName;
- this._result = aResult;
-}
-AutoCompleteSearchBase.prototype = {
-
- // Search name. Used by AutoCompleteController
- name: null,
-
- // AutoCompleteResult
- _result: null,
-
- startSearch: function(aSearchString,
- aSearchParam,
- aPreviousResult,
- aListener) {
- var result = this._result;
-
- result.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS;
- aListener.onSearchResult(this, result);
- },
-
- stopSearch: function() {},
-
- // nsISupports implementation
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIFactory,
- Ci.nsIAutoCompleteSearch]),
-
- // nsIFactory implementation
- createInstance: function(outer, iid) {
- return this.QueryInterface(iid);
- }
-}
-
-function AutocompletePopupBase(input) {
- this.input = input;
-}
-AutocompletePopupBase.prototype = {
- selectedIndex: 0,
- invalidate() {},
- selectBy(reverse, page) {
- let numRows = this.input.controller.matchCount;
- if (numRows > 0) {
- let delta = reverse ? -1 : 1;
- this.selectedIndex = (this.selectedIndex + delta) % numRows;
- if (this.selectedIndex < 0) {
- this.selectedIndex = numRows - 1;
- }
- }
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompletePopup]),
-};
-
-/**
- * Helper to register an AutoCompleteSearch with the given name.
- * Allows the AutoCompleteController to find the search.
- */
-function registerAutoCompleteSearch(aSearch) {
- var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
- var cid = Cc["@mozilla.org/uuid-generator;1"].
- getService(Ci.nsIUUIDGenerator).
- generateUUID();
-
- var desc = "Test AutoCompleteSearch";
- var componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.registerFactory(cid, desc, name, aSearch);
-
- // Keep the id on the object so we can unregister later
- aSearch.cid = cid;
-}
-
-/**
- * Helper to unregister an AutoCompleteSearch.
- */
-function unregisterAutoCompleteSearch(aSearch) {
- var componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.unregisterFactory(aSearch.cid, aSearch);
-}
-
diff --git a/toolkit/components/autocomplete/tests/unit/test_330578.js b/toolkit/components/autocomplete/tests/unit/test_330578.js
deleted file mode 100644
index c422dbb6a..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_330578.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var gResultListener = {
- _lastResult: null,
- _lastValue: "",
- _lastRemoveFromDb: false,
-
- onValueRemoved: function(aResult, aValue, aRemoveFromDb) {
- this._lastResult = aResult;
- this._lastValue = aValue;
- this._lastRemoveFromDb = aRemoveFromDb;
- }
-};
-
-
-// main
-function run_test() {
- var result = Cc["@mozilla.org/autocomplete/simple-result;1"].
- createInstance(Ci.nsIAutoCompleteSimpleResult);
- result.appendMatch("a", "");
- result.appendMatch("b", "");
- result.appendMatch("c", "");
- result.setListener(gResultListener);
- do_check_eq(result.matchCount, 3);
- result.removeValueAt(0, true);
- do_check_eq(result.matchCount, 2);
- do_check_eq(gResultListener._lastResult, result);
- do_check_eq(gResultListener._lastValue, "a");
- do_check_eq(gResultListener._lastRemoveFromDb, true);
-
- result.removeValueAt(0, false);
- do_check_eq(result.matchCount, 1);
- do_check_eq(gResultListener._lastValue, "b");
- do_check_eq(gResultListener._lastRemoveFromDb, false);
-
- // check that we don't get notified if the listener is unset
- result.setListener(null);
- result.removeValueAt(0, true); // "c"
- do_check_eq(result.matchCount, 0);
- do_check_eq(gResultListener._lastValue, "b");
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_378079.js b/toolkit/components/autocomplete/tests/unit/test_378079.js
deleted file mode 100644
index ad7e5590f..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_378079.js
+++ /dev/null
@@ -1,285 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Unit test for Bug 378079 - AutoComplete returns invalid rows when
- * more than one AutoCompleteSearch is used.
- */
-
-
-
-/**
- * Dummy nsIAutoCompleteInput source that returns
- * the given list of AutoCompleteSearch names.
- *
- * Implements only the methods needed for this test.
- */
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
-
- // Array of AutoCompleteSearch names
- searches: null,
-
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "",
- disableAutoComplete: false,
- completeDefaultIndex: false,
-
- get searchCount() {
- return this.searches.length;
- },
-
- getSearchAt: function(aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchBegin: function() {},
- onSearchComplete: function() {},
-
- popupOpen: false,
-
- popup: {
- setSelectedIndex: function(aIndex) {},
- invalidate: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompletePopup))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- },
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteInput))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-
-
-/**
- * nsIAutoCompleteResult implementation
- */
-function AutoCompleteResult(aValues, aComments, aStyles) {
- this._values = aValues;
- this._comments = aComments;
- this._styles = aStyles;
-
- if (this._values.length > 0) {
- this.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS;
- } else {
- this.searchResult = Ci.nsIAutoCompleteResult.NOMATCH;
- }
-}
-AutoCompleteResult.prototype = {
- constructor: AutoCompleteResult,
-
- // Arrays
- _values: null,
- _comments: null,
- _styles: null,
-
- searchString: "",
- searchResult: null,
-
- defaultIndex: 0,
-
- get matchCount() {
- return this._values.length;
- },
-
- getValueAt: function(aIndex) {
- return this._values[aIndex];
- },
-
- getLabelAt: function(aIndex) {
- return this.getValueAt(aIndex);
- },
-
- getCommentAt: function(aIndex) {
- return this._comments[aIndex];
- },
-
- getStyleAt: function(aIndex) {
- return this._styles[aIndex];
- },
-
- getImageAt: function(aIndex) {
- return "";
- },
-
- getFinalCompleteValueAt: function(aIndex) {
- return this.getValueAt(aIndex);
- },
-
- removeValueAt: function (aRowIndex, aRemoveFromDb) {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteResult))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-
-
-/**
- * nsIAutoCompleteSearch implementation that always returns
- * the same result set.
- */
-function AutoCompleteSearch(aName, aResult) {
- this.name = aName;
- this._result = aResult;
-}
-AutoCompleteSearch.prototype = {
- constructor: AutoCompleteSearch,
-
- // Search name. Used by AutoCompleteController
- name: null,
-
- // AutoCompleteResult
- _result:null,
-
-
- /**
- * Return the same result set for every search
- */
- startSearch: function(aSearchString,
- aSearchParam,
- aPreviousResult,
- aListener)
- {
- aListener.onSearchResult(this, this._result);
- },
-
- stopSearch: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIFactory) ||
- iid.equals(Ci.nsIAutoCompleteSearch))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- // nsIFactory implementation
- createInstance: function(outer, iid) {
- return this.QueryInterface(iid);
- }
-}
-
-
-
-/**
- * Helper to register an AutoCompleteSearch with the given name.
- * Allows the AutoCompleteController to find the search.
- */
-function registerAutoCompleteSearch(aSearch) {
- var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
-
- var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].
- getService(Ci.nsIUUIDGenerator);
- var cid = uuidGenerator.generateUUID();
-
- var desc = "Test AutoCompleteSearch";
-
- var componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.registerFactory(cid, desc, name, aSearch);
-
- // Keep the id on the object so we can unregister later
- aSearch.cid = cid;
-}
-
-
-
-/**
- * Helper to unregister an AutoCompleteSearch.
- */
-function unregisterAutoCompleteSearch(aSearch) {
- var componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.unregisterFactory(aSearch.cid, aSearch);
-}
-
-
-
-/**
- * Test AutoComplete with multiple AutoCompleteSearch sources.
- */
-function run_test() {
-
- // Make an AutoCompleteSearch that always returns nothing
- var emptySearch = new AutoCompleteSearch("test-empty-search",
- new AutoCompleteResult([], [], []));
-
- // Make an AutoCompleteSearch that returns two values
- var expectedValues = ["test1", "test2"];
- var regularSearch = new AutoCompleteSearch("test-regular-search",
- new AutoCompleteResult(expectedValues, [], []));
-
- // Register searches so AutoCompleteController can find them
- registerAutoCompleteSearch(emptySearch);
- registerAutoCompleteSearch(regularSearch);
-
- var controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
- getService(Components.interfaces.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches
- // and confirms results on search complete
- var input = new AutoCompleteInput([emptySearch.name, regularSearch.name]);
- var numSearchesStarted = 0;
-
- input.onSearchBegin = function() {
- numSearchesStarted++;
- do_check_eq(numSearchesStarted, 1);
- };
-
- input.onSearchComplete = function() {
-
- do_check_eq(numSearchesStarted, 1);
-
- do_check_eq(controller.searchStatus,
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
- do_check_eq(controller.matchCount, 2);
-
- // Confirm expected result values
- for (var i = 0; i < expectedValues.length; i++) {
- do_check_eq(expectedValues[i], controller.getValueAt(i));
- }
-
- // Unregister searches
- unregisterAutoCompleteSearch(emptySearch);
- unregisterAutoCompleteSearch(regularSearch);
-
- do_test_finished();
- };
-
- controller.input = input;
-
- // Search is asynchronous, so don't let the test finish immediately
- do_test_pending();
-
- controller.startSearch("test");
-}
-
diff --git a/toolkit/components/autocomplete/tests/unit/test_393191.js b/toolkit/components/autocomplete/tests/unit/test_393191.js
deleted file mode 100644
index 6fb57e6c4..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_393191.js
+++ /dev/null
@@ -1,272 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Unit test for Bug 393191 - AutoComplete crashes if result is null
- */
-
-
-
-/**
- * Dummy nsIAutoCompleteInput source that returns
- * the given list of AutoCompleteSearch names.
- *
- * Implements only the methods needed for this test.
- */
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
-
- // Array of AutoCompleteSearch names
- searches: null,
-
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "",
- disableAutoComplete: false,
- completeDefaultIndex: false,
-
- get searchCount() {
- return this.searches.length;
- },
-
- getSearchAt: function(aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchBegin: function() {},
- onSearchComplete: function() {},
-
- popupOpen: false,
-
- popup: {
- setSelectedIndex: function(aIndex) {},
- invalidate: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompletePopup))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- },
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteInput))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-
-
-/**
- * nsIAutoCompleteResult implementation
- */
-function AutoCompleteResult(aValues, aComments, aStyles) {
- this._values = aValues;
- this._comments = aComments;
- this._styles = aStyles;
-
- if (this._values.length > 0) {
- this.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS;
- } else {
- this.searchResult = Ci.nsIAutoCompleteResult.NOMATCH;
- }
-}
-AutoCompleteResult.prototype = {
- constructor: AutoCompleteResult,
-
- // Arrays
- _values: null,
- _comments: null,
- _styles: null,
-
- searchString: "",
- searchResult: null,
-
- defaultIndex: 0,
-
- get matchCount() {
- return this._values.length;
- },
-
- getValueAt: function(aIndex) {
- return this._values[aIndex];
- },
-
- getLabelAt: function(aIndex) {
- return this.getValueAt(aIndex);
- },
-
- getCommentAt: function(aIndex) {
- return this._comments[aIndex];
- },
-
- getStyleAt: function(aIndex) {
- return this._styles[aIndex];
- },
-
- getImageAt: function(aIndex) {
- return "";
- },
-
- getFinalCompleteValueAt: function(aIndex) {
- return this.getValueAt(aIndex);
- },
-
- removeValueAt: function (aRowIndex, aRemoveFromDb) {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteResult))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-
-
-/**
- * nsIAutoCompleteSearch implementation that always returns
- * the same result set.
- */
-function AutoCompleteSearch(aName, aResult) {
- this.name = aName;
- this._result = aResult;
-}
-AutoCompleteSearch.prototype = {
- constructor: AutoCompleteSearch,
-
- // Search name. Used by AutoCompleteController
- name: null,
-
- // AutoCompleteResult
- _result: null,
-
-
- /**
- * Return the same result set for every search
- */
- startSearch: function(aSearchString,
- aSearchParam,
- aPreviousResult,
- aListener)
- {
- aListener.onSearchResult(this, this._result);
- },
-
- stopSearch: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIFactory) ||
- iid.equals(Ci.nsIAutoCompleteSearch))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- // nsIFactory implementation
- createInstance: function(outer, iid) {
- return this.QueryInterface(iid);
- }
-}
-
-
-
-/**
- * Helper to register an AutoCompleteSearch with the given name.
- * Allows the AutoCompleteController to find the search.
- */
-function registerAutoCompleteSearch(aSearch) {
- var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
-
- var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].
- getService(Ci.nsIUUIDGenerator);
- var cid = uuidGenerator.generateUUID();
-
- var desc = "Test AutoCompleteSearch";
-
- var componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.registerFactory(cid, desc, name, aSearch);
-
- // Keep the id on the object so we can unregister later
- aSearch.cid = cid;
-}
-
-
-
-/**
- * Helper to unregister an AutoCompleteSearch.
- */
-function unregisterAutoCompleteSearch(aSearch) {
- var componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.unregisterFactory(aSearch.cid, aSearch);
-}
-
-
-
-/**
- * Test AutoComplete with a search that returns a null result
- */
-function run_test() {
-
- // Make an AutoCompleteSearch that always returns nothing
- var emptySearch = new AutoCompleteSearch("test-empty-search",
- new AutoCompleteResult([], [], []));
-
- // Register search so AutoCompleteController can find them
- registerAutoCompleteSearch(emptySearch);
-
- var controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
- getService(Components.interfaces.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our search
- // and confirms results on search complete
- var input = new AutoCompleteInput([emptySearch.name]);
- var numSearchesStarted = 0;
-
- input.onSearchBegin = function() {
- numSearchesStarted++;
- do_check_eq(numSearchesStarted, 1);
- };
-
- input.onSearchComplete = function() {
-
- do_check_eq(numSearchesStarted, 1);
-
- do_check_eq(controller.searchStatus,
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH);
- do_check_eq(controller.matchCount, 0);
-
- // Unregister searches
- unregisterAutoCompleteSearch(emptySearch);
-
- do_test_finished();
- };
-
- controller.input = input;
-
- // Search is asynchronous, so don't let the test finish immediately
- do_test_pending();
-
- controller.startSearch("test");
-}
-
diff --git a/toolkit/components/autocomplete/tests/unit/test_440866.js b/toolkit/components/autocomplete/tests/unit/test_440866.js
deleted file mode 100644
index e450aebbf..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_440866.js
+++ /dev/null
@@ -1,285 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Unit test for Bug 440866 - First AutoCompleteSearch that returns
- * RESULT_NOMATCH cancels all other searches when popup is open
- */
-
-
-
-/**
- * Dummy nsIAutoCompleteInput source that returns
- * the given list of AutoCompleteSearch names.
- *
- * Implements only the methods needed for this test.
- */
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
-
- // Array of AutoCompleteSearch names
- searches: null,
-
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "",
- disableAutoComplete: false,
- completeDefaultIndex: false,
-
- get searchCount() {
- return this.searches.length;
- },
-
- getSearchAt: function(aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchBegin: function() {},
- onSearchComplete: function() {},
-
- popupOpen: false,
-
- popup: {
- setSelectedIndex: function(aIndex) {},
- invalidate: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompletePopup))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- },
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteInput))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-
-
-/**
- * nsIAutoCompleteResult implementation
- */
-function AutoCompleteResult(aValues, aComments, aStyles) {
- this._values = aValues;
- this._comments = aComments;
- this._styles = aStyles;
-
- if (this._values.length > 0) {
- this.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS;
- } else {
- this.searchResult = Ci.nsIAutoCompleteResult.NOMATCH;
- }
-}
-AutoCompleteResult.prototype = {
- constructor: AutoCompleteResult,
-
- // Arrays
- _values: null,
- _comments: null,
- _styles: null,
-
- searchString: "",
- searchResult: null,
-
- defaultIndex: 0,
-
- get matchCount() {
- return this._values.length;
- },
-
- getValueAt: function(aIndex) {
- return this._values[aIndex];
- },
-
- getLabelAt: function(aIndex) {
- return this.getValueAt(aIndex);
- },
-
- getCommentAt: function(aIndex) {
- return this._comments[aIndex];
- },
-
- getStyleAt: function(aIndex) {
- return this._styles[aIndex];
- },
-
- getImageAt: function(aIndex) {
- return "";
- },
-
- getFinalCompleteValueAt: function(aIndex) {
- return this.getValueAt(aIndex);
- },
-
- removeValueAt: function (aRowIndex, aRemoveFromDb) {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteResult))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-
-
-/**
- * nsIAutoCompleteSearch implementation that always returns
- * the same result set.
- */
-function AutoCompleteSearch(aName, aResult) {
- this.name = aName;
- this._result = aResult;
-}
-AutoCompleteSearch.prototype = {
- constructor: AutoCompleteSearch,
-
- // Search name. Used by AutoCompleteController
- name: null,
-
- // AutoCompleteResult
- _result:null,
-
-
- /**
- * Return the same result set for every search
- */
- startSearch: function(aSearchString,
- aSearchParam,
- aPreviousResult,
- aListener)
- {
- aListener.onSearchResult(this, this._result);
- },
-
- stopSearch: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIFactory) ||
- iid.equals(Ci.nsIAutoCompleteSearch))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- // nsIFactory implementation
- createInstance: function(outer, iid) {
- return this.QueryInterface(iid);
- }
-}
-
-
-
-/**
- * Helper to register an AutoCompleteSearch with the given name.
- * Allows the AutoCompleteController to find the search.
- */
-function registerAutoCompleteSearch(aSearch) {
- var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
-
- var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].
- getService(Ci.nsIUUIDGenerator);
- var cid = uuidGenerator.generateUUID();
-
- var desc = "Test AutoCompleteSearch";
-
- var componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.registerFactory(cid, desc, name, aSearch);
-
- // Keep the id on the object so we can unregister later
- aSearch.cid = cid;
-}
-
-
-
-/**
- * Helper to unregister an AutoCompleteSearch.
- */
-function unregisterAutoCompleteSearch(aSearch) {
- var componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.unregisterFactory(aSearch.cid, aSearch);
-}
-
-
-
-/**
- * Test AutoComplete with multiple AutoCompleteSearch sources.
- */
-function run_test() {
-
- // Make an AutoCompleteSearch that always returns nothing
- var emptySearch = new AutoCompleteSearch("test-empty-search",
- new AutoCompleteResult([], [], []));
-
- // Make an AutoCompleteSearch that returns two values
- var expectedValues = ["test1", "test2"];
- var regularSearch = new AutoCompleteSearch("test-regular-search",
- new AutoCompleteResult(expectedValues, [], []));
-
- // Register searches so AutoCompleteController can find them
- registerAutoCompleteSearch(emptySearch);
- registerAutoCompleteSearch(regularSearch);
-
- var controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
- getService(Components.interfaces.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches
- // and confirms results on search complete
- var input = new AutoCompleteInput([emptySearch.name, regularSearch.name]);
- var numSearchesStarted = 0;
-
- input.onSearchBegin = function() {
- numSearchesStarted++;
- do_check_eq(numSearchesStarted, 1);
- do_check_eq(input.searchCount, 2);
- };
-
- input.onSearchComplete = function() {
- do_check_eq(numSearchesStarted, 1);
-
- do_check_eq(controller.searchStatus,
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
- do_check_eq(controller.matchCount, 2);
-
- // Confirm expected result values
- for (var i = 0; i < expectedValues.length; i++) {
- do_check_eq(expectedValues[i], controller.getValueAt(i));
- }
-
- do_check_true(input.popupOpen);
-
- // Unregister searches
- unregisterAutoCompleteSearch(emptySearch);
- unregisterAutoCompleteSearch(regularSearch);
-
- do_test_finished();
- };
-
- controller.input = input;
-
- // Search is asynchronous, so don't let the test finish immediately
- do_test_pending();
-
- controller.startSearch("test");
-}
-
diff --git a/toolkit/components/autocomplete/tests/unit/test_463023.js b/toolkit/components/autocomplete/tests/unit/test_463023.js
deleted file mode 100644
index a2639fd03..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_463023.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// main
-function run_test() {
- var result = Cc["@mozilla.org/autocomplete/controller;1"].
- createInstance(Ci.nsIAutoCompleteController);
- do_check_eq(result.searchStatus, Ci.nsIAutoCompleteController.STATUS_NONE);
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_660156.js b/toolkit/components/autocomplete/tests/unit/test_660156.js
deleted file mode 100644
index 98acb243e..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_660156.js
+++ /dev/null
@@ -1,101 +0,0 @@
-/**
- * Search object that returns results at different times.
- * First, the search that returns results asynchronously.
- */
-function AutoCompleteAsyncSearch(aName, aResult) {
- this.name = aName;
- this._result = aResult;
-}
-AutoCompleteAsyncSearch.prototype = Object.create(AutoCompleteSearchBase.prototype);
-AutoCompleteAsyncSearch.prototype.startSearch = function(aSearchString,
- aSearchParam,
- aPreviousResult,
- aListener) {
- this._result.searchResult = Ci.nsIAutoCompleteResult.RESULT_NOMATCH_ONGOING;
- aListener.onSearchResult(this, this._result);
-
- do_timeout(500, () => {
- this._returnResults(aListener);
- });
-};
-
-AutoCompleteAsyncSearch.prototype._returnResults = function(aListener) {
- var result = this._result;
-
- result.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS;
- aListener.onSearchResult(this, result);
-};
-
-/**
- * The synchronous version
- */
-function AutoCompleteSyncSearch(aName, aResult) {
- this.name = aName;
- this._result = aResult;
-}
-AutoCompleteSyncSearch.prototype = Object.create(AutoCompleteAsyncSearch.prototype);
-AutoCompleteSyncSearch.prototype.startSearch = function(aSearchString,
- aSearchParam,
- aPreviousResult,
- aListener) {
- this._returnResults(aListener);
-};
-
-/**
- * Results object
- */
-function AutoCompleteResult(aValues, aDefaultIndex) {
- this._values = aValues;
- this.defaultIndex = aDefaultIndex;
-}
-AutoCompleteResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-
-/**
- * Test AutoComplete with multiple AutoCompleteSearch sources, with one of them
- * (index != 0) returning before the rest.
- */
-function run_test() {
- do_test_pending();
-
- var results = ["mozillaTest"];
- var inputStr = "moz";
-
- // Async search
- var asyncSearch = new AutoCompleteAsyncSearch("Async",
- new AutoCompleteResult(results, -1));
- // Sync search
- var syncSearch = new AutoCompleteSyncSearch("Sync",
- new AutoCompleteResult(results, 0));
-
- // Register searches so AutoCompleteController can find them
- registerAutoCompleteSearch(asyncSearch);
- registerAutoCompleteSearch(syncSearch);
-
- var controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches
- // and confirms results on search complete.
- // Async search MUST be FIRST to trigger the bug this tests.
- var input = new AutoCompleteInputBase([asyncSearch.name, syncSearch.name]);
- input.completeDefaultIndex = true;
- input.textValue = inputStr;
-
- // Caret must be at the end. Autofill doesn't happen unless you're typing
- // characters at the end.
- var strLen = inputStr.length;
- input.selectTextRange(strLen, strLen);
-
- controller.input = input;
- controller.startSearch(inputStr);
-
- input.onSearchComplete = function() {
- do_check_eq(input.textValue, results[0]);
-
- // Unregister searches
- unregisterAutoCompleteSearch(asyncSearch);
- unregisterAutoCompleteSearch(syncSearch);
- do_test_finished();
- };
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_autocomplete_multiple.js b/toolkit/components/autocomplete/tests/unit/test_autocomplete_multiple.js
deleted file mode 100644
index 7fee48d55..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_autocomplete_multiple.js
+++ /dev/null
@@ -1,276 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Dummy nsIAutoCompleteInput source that returns
- * the given list of AutoCompleteSearch names.
- *
- * Implements only the methods needed for this test.
- */
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
-
- // Array of AutoCompleteSearch names
- searches: null,
-
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "",
- disableAutoComplete: false,
- completeDefaultIndex: false,
-
- get searchCount() {
- return this.searches.length;
- },
-
- getSearchAt: function(aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchBegin: function() {},
- onSearchComplete: function() {},
-
- popupOpen: false,
-
- popup: {
- setSelectedIndex: function(aIndex) {},
- invalidate: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompletePopup))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- },
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteInput))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-
-
-/**
- * nsIAutoCompleteResult implementation
- */
-function AutoCompleteResult(aValues, aComments, aStyles) {
- this._values = aValues;
- this._comments = aComments;
- this._styles = aStyles;
-}
-AutoCompleteResult.prototype = {
- constructor: AutoCompleteResult,
-
- // Arrays
- _values: null,
- _comments: null,
- _styles: null,
-
- searchString: "",
- searchResult: null,
-
- defaultIndex: 0,
-
- get matchCount() {
- return this._values.length;
- },
-
- getValueAt: function(aIndex) {
- return this._values[aIndex];
- },
-
- getLabelAt: function(aIndex) {
- return this.getValueAt(aIndex);
- },
-
- getCommentAt: function(aIndex) {
- return this._comments[aIndex];
- },
-
- getStyleAt: function(aIndex) {
- return this._styles[aIndex];
- },
-
- getImageAt: function(aIndex) {
- return "";
- },
-
- getFinalCompleteValueAt: function(aIndex) {
- return this.getValueAt(aIndex);
- },
-
- removeValueAt: function (aRowIndex, aRemoveFromDb) {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteResult))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-
-
-/**
- * nsIAutoCompleteSearch implementation that always returns
- * the same result set.
- */
-function AutoCompleteSearch(aName, aResult) {
- this.name = aName;
- this._result = aResult;
-}
-AutoCompleteSearch.prototype = {
- constructor: AutoCompleteSearch,
-
- // Search name. Used by AutoCompleteController
- name: null,
-
- // AutoCompleteResult
- _result:null,
-
-
- /**
- * Return the same result set for every search
- */
- startSearch: function(aSearchString,
- aSearchParam,
- aPreviousResult,
- aListener)
- {
- var result = this._result;
- if (result._values.length > 0) {
- result.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS_ONGOING;
- } else {
- result.searchResult = Ci.nsIAutoCompleteResult.RESULT_NOMATCH_ONGOING;
- }
- aListener.onSearchResult(this, result);
-
- if (result._values.length > 0) {
- result.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS;
- } else {
- result.searchResult = Ci.nsIAutoCompleteResult.RESULT_NOMATCH;
- }
- aListener.onSearchResult(this, result);
- },
-
- stopSearch: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIFactory) ||
- iid.equals(Ci.nsIAutoCompleteSearch))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- // nsIFactory implementation
- createInstance: function(outer, iid) {
- return this.QueryInterface(iid);
- }
-}
-
-
-
-/**
- * Helper to register an AutoCompleteSearch with the given name.
- * Allows the AutoCompleteController to find the search.
- */
-function registerAutoCompleteSearch(aSearch) {
- var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
-
- var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].
- getService(Ci.nsIUUIDGenerator);
- var cid = uuidGenerator.generateUUID();
-
- var desc = "Test AutoCompleteSearch";
-
- var componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.registerFactory(cid, desc, name, aSearch);
-
- // Keep the id on the object so we can unregister later
- aSearch.cid = cid;
-}
-
-
-
-/**
- * Helper to unregister an AutoCompleteSearch.
- */
-function unregisterAutoCompleteSearch(aSearch) {
- var componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.unregisterFactory(aSearch.cid, aSearch);
-}
-
-
-
-/**
- * Test AutoComplete with multiple AutoCompleteSearch sources.
- */
-function run_test() {
- var expected1 = ["1", "2", "3"];
- var expected2 = ["a", "b", "c"];
- var search1 = new AutoCompleteSearch("search1",
- new AutoCompleteResult(expected1, [], []));
- var search2 = new AutoCompleteSearch("search2",
- new AutoCompleteResult(expected2, [], []));
-
- // Register searches so AutoCompleteController can find them
- registerAutoCompleteSearch(search1);
- registerAutoCompleteSearch(search2);
-
- var controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
- getService(Components.interfaces.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches
- // and confirms results on search complete
- var input = new AutoCompleteInput([search1.name, search2.name]);
- var numSearchesStarted = 0;
-
- input.onSearchBegin = function() {
- numSearchesStarted++;
- do_check_eq(numSearchesStarted, 1);
- };
-
- input.onSearchComplete = function() {
-
- do_check_eq(numSearchesStarted, 1);
-
- do_check_eq(controller.searchStatus,
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
- do_check_eq(controller.matchCount, expected1.length + expected2.length);
-
- // Unregister searches
- unregisterAutoCompleteSearch(search1);
- unregisterAutoCompleteSearch(search2);
-
- do_test_finished();
- };
-
- controller.input = input;
-
- // Search is asynchronous, so don't let the test finish immediately
- do_test_pending();
-
- controller.startSearch("test");
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_autocomplete_userContextId.js b/toolkit/components/autocomplete/tests/unit/test_autocomplete_userContextId.js
deleted file mode 100644
index c98db7f8f..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_autocomplete_userContextId.js
+++ /dev/null
@@ -1,45 +0,0 @@
-"use strict";
-
-Cu.import("resource://gre/modules/Promise.jsm");
-
-function AutoCompleteInput(aSearches, aUserContextId) {
- this.searches = aSearches;
- this.userContextId = aUserContextId;
- this.popup.selectedIndex = -1;
-}
-AutoCompleteInput.prototype = Object.create(AutoCompleteInputBase.prototype);
-
-function AutoCompleteSearch(aName) {
- this.name = aName;
-}
-AutoCompleteSearch.prototype = Object.create(AutoCompleteSearchBase.prototype);
-
-add_task(function *test_userContextId() {
- let searchParam = yield doSearch("test", 1);
- Assert.equal(searchParam, " user-context-id:1");
-});
-
-function doSearch(aString, aUserContextId) {
- let deferred = Promise.defer();
- let search = new AutoCompleteSearch("test");
-
- search.startSearch = function (aSearchString,
- aSearchParam,
- aPreviousResult,
- aListener) {
- unregisterAutoCompleteSearch(search);
- deferred.resolve(aSearchParam);
- };
-
- registerAutoCompleteSearch(search);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- let input = new AutoCompleteInput([ search.name ], aUserContextId);
- controller.input = input;
- controller.startSearch(aString);
-
- return deferred.promise;
- }
-
diff --git a/toolkit/components/autocomplete/tests/unit/test_autofillSelectedPopupIndex.js b/toolkit/components/autocomplete/tests/unit/test_autofillSelectedPopupIndex.js
deleted file mode 100644
index 5fb93abc1..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_autofillSelectedPopupIndex.js
+++ /dev/null
@@ -1,78 +0,0 @@
-"use strict";
-
-add_task(function* sameCaseAsMatch() {
- yield runTest("moz");
-});
-
-add_task(function* differentCaseFromMatch() {
- yield runTest("MOZ");
-});
-
-function* runTest(searchStr) {
- let matches = [
- "mozilla.org",
- "example.com",
- ];
- let result = new AutoCompleteResultBase(matches);
- result.defaultIndex = 0;
-
- let search = new AutoCompleteSearchBase("search", result);
- registerAutoCompleteSearch(search);
-
- let input = new AutoCompleteInputBase([search.name]);
- input.completeSelectedIndex = true;
- input.completeDefaultIndex = true;
-
- // Start off with the search string in the input. The selection must be
- // collapsed and the caret must be at the end to trigger autofill below.
- input.textValue = searchStr;
- input.selectTextRange(searchStr.length, searchStr.length);
- Assert.equal(input.selectionStart, searchStr.length,
- "Selection should start at the end of the input");
- Assert.equal(input.selectionEnd, searchStr.length,
- "Selection should end at the end of the input");
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- createInstance(Ci.nsIAutoCompleteController);
- controller.input = input;
- input.controller = controller;
-
- // Start a search.
- yield new Promise(resolve => {
- controller.startSearch(searchStr);
- input.onSearchComplete = () => {
- // The first match should have autofilled, but the case of the search
- // string should be preserved.
- let expectedValue = searchStr + matches[0].substr(searchStr.length);
- Assert.equal(input.textValue, expectedValue,
- "Should have autofilled");
- Assert.equal(input.selectionStart, searchStr.length,
- "Selection should start after search string");
- Assert.equal(input.selectionEnd, expectedValue.length,
- "Selection should end at the end of the input");
- resolve();
- };
- });
-
- // Key down to select the second match in the popup.
- controller.handleKeyNavigation(Ci.nsIDOMKeyEvent.DOM_VK_DOWN);
- let expectedValue = matches[1];
- Assert.equal(input.textValue, expectedValue,
- "Should have filled second match");
- Assert.equal(input.selectionStart, expectedValue.length,
- "Selection should start at the end of the input");
- Assert.equal(input.selectionEnd, expectedValue.length,
- "Selection should end at the end of the input");
-
- // Key up to select the first match again. The input should be restored
- // exactly as it was when the first match was autofilled above: the search
- // string's case should be preserved, and the selection should be preserved.
- controller.handleKeyNavigation(Ci.nsIDOMKeyEvent.DOM_VK_UP);
- expectedValue = searchStr + matches[0].substr(searchStr.length);
- Assert.equal(input.textValue, expectedValue,
- "Should have filled first match again");
- Assert.equal(input.selectionStart, searchStr.length,
- "Selection should start after search string again");
- Assert.equal(input.selectionEnd, expectedValue.length,
- "Selection should end at the end of the input again");
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_badDefaultIndex.js b/toolkit/components/autocomplete/tests/unit/test_badDefaultIndex.js
deleted file mode 100644
index 17f735388..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_badDefaultIndex.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * A results that wants to defaultComplete to 0, but it has no matches,
- * though it notifies SUCCESS to the controller.
- */
-function AutoCompleteNoMatchResult() {
- this.defaultIndex = 0;
-}
-AutoCompleteNoMatchResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-/**
- * A results that wants to defaultComplete to an index greater than the number
- * of matches.
- */
-function AutoCompleteBadIndexResult(aValues, aDefaultIndex) {
- do_check_true(aValues.length <= aDefaultIndex);
- this._values = aValues;
- this.defaultIndex = aDefaultIndex;
-}
-AutoCompleteBadIndexResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-add_test(function autocomplete_noMatch_success() {
- const INPUT_STR = "moz";
-
- let searchNoMatch =
- new AutoCompleteSearchBase("searchNoMatch",
- new AutoCompleteNoMatchResult());
- registerAutoCompleteSearch(searchNoMatch);
-
- // Make an AutoCompleteInput that uses our search and confirms results.
- let input = new AutoCompleteInputBase([searchNoMatch.name]);
- input.completeDefaultIndex = true;
- input.textValue = INPUT_STR;
-
- // Caret must be at the end for autoFill to happen.
- let strLen = INPUT_STR.length;
- input.selectTextRange(strLen, strLen);
- do_check_eq(input.selectionStart, strLen);
- do_check_eq(input.selectionEnd, strLen);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
- controller.input = input;
- controller.startSearch(INPUT_STR);
-
- input.onSearchComplete = function () {
- // Should not try to autoFill to an empty value.
- do_check_eq(input.textValue, "moz");
-
- // Clean up.
- unregisterAutoCompleteSearch(searchNoMatch);
- run_next_test();
- };
-});
-
-add_test(function autocomplete_defaultIndex_exceeds_matchCount() {
- const INPUT_STR = "moz";
-
- // Result returning matches, but a bad defaultIndex.
- let searchBadIndex =
- new AutoCompleteSearchBase("searchBadIndex",
- new AutoCompleteBadIndexResult(["mozillaTest"], 1));
- registerAutoCompleteSearch(searchBadIndex);
-
- // Make an AutoCompleteInput that uses our search and confirms results.
- let input = new AutoCompleteInputBase([searchBadIndex.name]);
- input.completeDefaultIndex = true;
- input.textValue = INPUT_STR;
-
- // Caret must be at the end for autoFill to happen.
- let strLen = INPUT_STR.length;
- input.selectTextRange(strLen, strLen);
- do_check_eq(input.selectionStart, strLen);
- do_check_eq(input.selectionEnd, strLen);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
- controller.input = input;
- controller.startSearch(INPUT_STR);
-
- input.onSearchComplete = function () {
- // Should not try to autoFill to an empty value.
- do_check_eq(input.textValue, "moz");
-
- // Clean up.
- unregisterAutoCompleteSearch(searchBadIndex);
- run_next_test();
- };
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_completeDefaultIndex_casing.js b/toolkit/components/autocomplete/tests/unit/test_completeDefaultIndex_casing.js
deleted file mode 100644
index c25b00907..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_completeDefaultIndex_casing.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function AutoCompleteResult(aValues) {
- this._values = aValues;
- this.defaultIndex = 0;
-}
-AutoCompleteResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
- this.popup.selectedIndex = -1;
- this.completeDefaultIndex = true;
-}
-AutoCompleteInput.prototype = Object.create(AutoCompleteInputBase.prototype);
-
-function run_test() {
- run_next_test();
-}
-
-add_test(function test_keyNavigation() {
- doSearch("MOZ", "mozilla", function(aController) {
- do_check_eq(aController.input.textValue, "MOZilla");
- aController.handleKeyNavigation(Ci.nsIDOMKeyEvent.DOM_VK_RIGHT);
- do_check_eq(aController.input.textValue, "mozilla");
- });
-});
-
-add_test(function test_handleEnter() {
- doSearch("MOZ", "mozilla", function(aController) {
- do_check_eq(aController.input.textValue, "MOZilla");
- aController.handleEnter(false);
- do_check_eq(aController.input.textValue, "mozilla");
- });
-});
-
-function doSearch(aSearchString, aResultValue, aOnCompleteCallback) {
- let search = new AutoCompleteSearchBase("search",
- new AutoCompleteResult([ "mozilla", "toolkit" ], 0));
- registerAutoCompleteSearch(search);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches and confirms results.
- let input = new AutoCompleteInput([ search.name ]);
- input.textValue = aSearchString;
-
- // Caret must be at the end for autofill to happen.
- let strLen = aSearchString.length;
- input.selectTextRange(strLen, strLen);
- controller.input = input;
- controller.startSearch(aSearchString);
-
- input.onSearchComplete = function onSearchComplete() {
- aOnCompleteCallback(controller);
-
- // Clean up.
- unregisterAutoCompleteSearch(search);
- run_next_test();
- };
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue.js b/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue.js
deleted file mode 100644
index fcac8ae43..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue.js
+++ /dev/null
@@ -1,48 +0,0 @@
-function AutoCompleteResult(aValues, aFinalCompleteValues) {
- this._values = aValues;
- this._finalCompleteValues = aFinalCompleteValues;
-}
-AutoCompleteResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
- this.popup.selectedIndex = 0;
-}
-AutoCompleteInput.prototype = Object.create(AutoCompleteInputBase.prototype);
-
-add_test(function test_handleEnter_mouse() {
- doSearch("moz", "mozilla.com", "http://www.mozilla.com", function(aController) {
- do_check_eq(aController.input.textValue, "moz");
- do_check_eq(aController.getFinalCompleteValueAt(0), "http://www.mozilla.com");
- // Keyboard interaction is tested by test_finalCompleteValueSelectedIndex.js
- // so here just test popup selection.
- aController.handleEnter(true);
- do_check_eq(aController.input.textValue, "http://www.mozilla.com");
- });
-});
-
-function doSearch(aSearchString, aResultValue, aFinalCompleteValue, aOnCompleteCallback) {
- let search = new AutoCompleteSearchBase(
- "search",
- new AutoCompleteResult([ aResultValue ], [ aFinalCompleteValue ])
- );
- registerAutoCompleteSearch(search);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches and confirms results.
- let input = new AutoCompleteInput([ search.name ]);
- input.textValue = aSearchString;
-
- controller.input = input;
- controller.startSearch(aSearchString);
-
- input.onSearchComplete = function onSearchComplete() {
- aOnCompleteCallback(controller);
-
- // Clean up.
- unregisterAutoCompleteSearch(search);
- run_next_test();
- };
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_finalCompleteValueSelectedIndex.js b/toolkit/components/autocomplete/tests/unit/test_finalCompleteValueSelectedIndex.js
deleted file mode 100644
index 6556a26dc..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_finalCompleteValueSelectedIndex.js
+++ /dev/null
@@ -1,119 +0,0 @@
-function AutoCompleteResult(aResultValues) {
- this._values = aResultValues.map(x => x[0]);
- this._finalCompleteValues = aResultValues.map(x => x[1]);
-}
-AutoCompleteResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-var selectByWasCalled = false;
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
- this.popup.selectedIndex = 0;
- this.popup.selectBy = function(reverse, page) {
- Assert.equal(selectByWasCalled, false);
- selectByWasCalled = true;
- Assert.equal(reverse, false);
- Assert.equal(page, false);
- this.selectedIndex += (reverse ? -1 : 1) * (page ? 100 : 1);
- };
- this.completeSelectedIndex = true;
-}
-AutoCompleteInput.prototype = Object.create(AutoCompleteInputBase.prototype);
-
-add_test(function test_handleEnter_key() {
- let results = [
- ["mozilla.com", "http://www.mozilla.com"],
- ["mozilla.org", "http://www.mozilla.org"],
- ];
- // First check the case where we do select a value with the keyboard:
- doSearch("moz", results, function(aController) {
- Assert.equal(aController.input.textValue, "moz");
- Assert.equal(aController.getFinalCompleteValueAt(0), "http://www.mozilla.com");
- Assert.equal(aController.getFinalCompleteValueAt(1), "http://www.mozilla.org");
-
- Assert.equal(aController.input.popup.selectedIndex, 0);
- aController.handleKeyNavigation(Ci.nsIDOMKeyEvent.DOM_VK_DOWN);
- Assert.equal(aController.input.popup.selectedIndex, 1);
- // Simulate mouse interaction changing selectedIndex
- // ie NOT keyboard interaction:
- aController.input.popup.selectedIndex = 0;
-
- aController.handleEnter(false);
- // Verify that the keyboard-selected thing got inserted,
- // and not the mouse selection:
- Assert.equal(aController.input.textValue, "http://www.mozilla.org");
- });
-});
-
-add_test(function test_handleEnter_mouse() {
- let results = [
- ["mozilla.com", "http://www.mozilla.com"],
- ["mozilla.org", "http://www.mozilla.org"],
- ];
- // Then the case where we do not:
- doSearch("moz", results, function(aController) {
- Assert.equal(aController.input.textValue, "moz");
- Assert.equal(aController.getFinalCompleteValueAt(0), "http://www.mozilla.com");
- Assert.equal(aController.getFinalCompleteValueAt(1), "http://www.mozilla.org");
-
- Assert.equal(aController.input.popup.selectedIndex, 0);
- aController.input.popupOpen = true;
- // Simulate mouse interaction changing selectedIndex
- // ie NOT keyboard interaction:
- aController.input.popup.selectedIndex = 1;
- Assert.equal(selectByWasCalled, false);
- Assert.equal(aController.input.popup.selectedIndex, 1);
-
- aController.handleEnter(false);
- // Verify that the input stayed the same, because no selection was made
- // with the keyboard:
- Assert.equal(aController.input.textValue, "moz");
- });
-});
-
-add_test(function test_handleEnter_preselected() {
- let results = [
- ["mozilla.com", "http://www.mozilla.com"],
- ["mozilla.org", "http://www.mozilla.org"],
- ];
- // Then test a preselection.
- doSearch("moz", results, function(aController) {
- Assert.equal(aController.input.textValue, "moz");
- Assert.equal(aController.getFinalCompleteValueAt(0), "http://www.mozilla.com");
- Assert.equal(aController.getFinalCompleteValueAt(1), "http://www.mozilla.org");
-
- aController.setInitiallySelectedIndex(0);
-
- aController.handleEnter(false);
- // Verify that the input stayed the same, because no selection was made
- // with the keyboard:
- Assert.equal(aController.input.textValue, "http://www.mozilla.com");
- });
-});
-
-function doSearch(aSearchString, aResults, aOnCompleteCallback) {
- selectByWasCalled = false;
- let search = new AutoCompleteSearchBase(
- "search",
- new AutoCompleteResult(aResults)
- );
- registerAutoCompleteSearch(search);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches and confirms results.
- let input = new AutoCompleteInput([ search.name ]);
- input.textValue = aSearchString;
-
- controller.input = input;
- controller.startSearch(aSearchString);
-
- input.onSearchComplete = function onSearchComplete() {
- aOnCompleteCallback(controller);
-
- // Clean up.
- unregisterAutoCompleteSearch(search);
- run_next_test();
- };
-}
-
diff --git a/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_defaultIndex.js b/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_defaultIndex.js
deleted file mode 100644
index 4942e7a9f..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_defaultIndex.js
+++ /dev/null
@@ -1,107 +0,0 @@
-function AutoCompleteResult(aResultValues) {
- this.defaultIndex = 0;
- this._values = aResultValues.map(x => x[0]);
- this._finalCompleteValues = aResultValues.map(x => x[1]);
-}
-AutoCompleteResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
- this.popup.selectedIndex = 0;
- this.completeSelectedIndex = true;
- this.completeDefaultIndex = true;
-}
-AutoCompleteInput.prototype = Object.create(AutoCompleteInputBase.prototype);
-
-add_test(function test_handleEnter() {
- let results = [
- ["mozilla.com", "https://www.mozilla.com"],
- ["gomozilla.org", "http://www.gomozilla.org"],
- ];
- doSearch("moz", results, { selectedIndex: 0 }, controller => {
- let input = controller.input;
- Assert.equal(input.textValue, "mozilla.com");
- Assert.equal(controller.getFinalCompleteValueAt(0), results[0][1]);
- Assert.equal(controller.getFinalCompleteValueAt(1), results[1][1]);
- Assert.equal(input.popup.selectedIndex, 0);
-
- controller.handleEnter(false);
- // Verify that the keyboard-selected thing got inserted,
- // and not the mouse selection:
- Assert.equal(controller.input.textValue, "https://www.mozilla.com");
- });
-});
-
-add_test(function test_handleEnter_otherSelected() {
- // The popup selection may not coincide with what is filled into the input
- // field, for example if the user changed it with the mouse and then pressed
- // Enter. In such a case we should still use the inputField value and not the
- // popup selected value.
- let results = [
- ["mozilla.com", "https://www.mozilla.com"],
- ["gomozilla.org", "http://www.gomozilla.org"],
- ];
- doSearch("moz", results, { selectedIndex: 1 }, controller => {
- let input = controller.input;
- Assert.equal(input.textValue, "mozilla.com");
- Assert.equal(controller.getFinalCompleteValueAt(0), results[0][1]);
- Assert.equal(controller.getFinalCompleteValueAt(1), results[1][1]);
- Assert.equal(input.popup.selectedIndex, 1);
-
- controller.handleEnter(false);
- // Verify that the keyboard-selected thing got inserted,
- // and not the mouse selection:
- Assert.equal(controller.input.textValue, "https://www.mozilla.com");
- });
-});
-
-add_test(function test_handleEnter_otherSelected_nocompleteselectedindex() {
- let results = [
- ["mozilla.com", "https://www.mozilla.com"],
- ["gomozilla.org", "http://www.gomozilla.org"],
- ];
- doSearch("moz", results, { selectedIndex: 1,
- completeSelectedIndex: false }, controller => {
- let input = controller.input;
- Assert.equal(input.textValue, "mozilla.com");
- Assert.equal(controller.getFinalCompleteValueAt(0), results[0][1]);
- Assert.equal(controller.getFinalCompleteValueAt(1), results[1][1]);
- Assert.equal(input.popup.selectedIndex, 1);
-
- controller.handleEnter(false);
- // Verify that the keyboard-selected result is inserted, not the
- // defaultComplete.
- Assert.equal(controller.input.textValue, "http://www.gomozilla.org");
- });
-});
-
-function doSearch(aSearchString, aResults, aOptions, aOnCompleteCallback) {
- let search = new AutoCompleteSearchBase(
- "search",
- new AutoCompleteResult(aResults)
- );
- registerAutoCompleteSearch(search);
-
- let input = new AutoCompleteInput([ search.name ]);
- input.textValue = aSearchString;
- if ("selectedIndex" in aOptions) {
- input.popup.selectedIndex = aOptions.selectedIndex;
- }
- if ("completeSelectedIndex" in aOptions) {
- input.completeSelectedIndex = aOptions.completeSelectedIndex;
- }
- // Needed for defaultIndex completion.
- input.selectTextRange(aSearchString.length, aSearchString.length);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
- controller.input = input;
- controller.startSearch(aSearchString);
-
- input.onSearchComplete = function onSearchComplete() {
- aOnCompleteCallback(controller);
-
- unregisterAutoCompleteSearch(search);
- run_next_test();
- };
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_forceComplete.js b/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_forceComplete.js
deleted file mode 100644
index 5642d3e3e..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_finalCompleteValue_forceComplete.js
+++ /dev/null
@@ -1,104 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function AutoCompleteResult(aValues, aFinalCompleteValues) {
- this._values = aValues;
- this._finalCompleteValues = aFinalCompleteValues;
- this.defaultIndex = 0;
-}
-AutoCompleteResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
- this.popup.selectedIndex = -1;
-}
-AutoCompleteInput.prototype = Object.create(AutoCompleteInputBase.prototype);
-
-function run_test() {
- run_next_test();
-}
-
-add_test(function test_handleEnterWithDirectMatchCompleteSelectedIndex() {
- doSearch("moz", "mozilla.com", "http://www.mozilla.com",
- { forceComplete: true, completeSelectedIndex: true }, function(aController) {
- do_check_eq(aController.input.textValue, "moz");
- do_check_eq(aController.getFinalCompleteValueAt(0), "http://www.mozilla.com");
- aController.handleEnter(false);
- // After enter the final complete value should be shown in the input.
- do_check_eq(aController.input.textValue, "http://www.mozilla.com");
- });
-});
-
-add_test(function test_handleEnterWithDirectMatch() {
- doSearch("mozilla", "mozilla.com", "http://www.mozilla.com",
- { forceComplete: true, completeDefaultIndex: true }, function(aController) {
- // Should autocomplete the search string to a suggestion.
- do_check_eq(aController.input.textValue, "mozilla.com");
- do_check_eq(aController.getFinalCompleteValueAt(0), "http://www.mozilla.com");
- aController.handleEnter(false);
- // After enter the final complete value should be shown in the input.
- do_check_eq(aController.input.textValue, "http://www.mozilla.com");
- });
-});
-
-add_test(function test_handleEnterWithNoMatch() {
- doSearch("mozilla", "mozilla.com", "http://www.mozilla.com",
- { forceComplete: true, completeDefaultIndex: true }, function(aController) {
- // Should autocomplete the search string to a suggestion.
- do_check_eq(aController.input.textValue, "mozilla.com");
- do_check_eq(aController.getFinalCompleteValueAt(0), "http://www.mozilla.com");
- // Now input something that does not match...
- aController.input.textValue = "mozillax";
- // ... and confirm. We don't want one of the values from the previous
- // results to be taken, since what's now in the input field doesn't match.
- aController.handleEnter(false);
- do_check_eq(aController.input.textValue, "mozillax");
- });
-});
-
-add_test(function test_handleEnterWithIndirectMatch() {
- doSearch("com", "mozilla.com", "http://www.mozilla.com",
- { forceComplete: true, completeDefaultIndex: true }, function(aController) {
- // Should autocomplete the search string to a suggestion.
- do_check_eq(aController.input.textValue, "com >> mozilla.com");
- do_check_eq(aController.getFinalCompleteValueAt(0), "http://www.mozilla.com");
- aController.handleEnter(false);
- // After enter the final complete value from the suggestion should be shown
- // in the input.
- do_check_eq(aController.input.textValue, "http://www.mozilla.com");
- });
-});
-
-function doSearch(aSearchString, aResultValue, aFinalCompleteValue,
- aInputProps, aOnCompleteCallback) {
- let search = new AutoCompleteSearchBase(
- "search",
- new AutoCompleteResult([ aResultValue ], [ aFinalCompleteValue ])
- );
- registerAutoCompleteSearch(search);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches and confirms results.
- let input = new AutoCompleteInput([ search.name ]);
- for (var p in aInputProps) {
- input[p] = aInputProps[p];
- }
- input.textValue = aSearchString;
- // Place the cursor at the end of the input so that completion to
- // default index will kick in.
- input.selectTextRange(aSearchString.length, aSearchString.length);
-
- controller.input = input;
- controller.startSearch(aSearchString);
-
- input.onSearchComplete = function onSearchComplete() {
- aOnCompleteCallback(controller);
-
- // Clean up.
- unregisterAutoCompleteSearch(search);
- run_next_test();
- };
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_finalDefaultCompleteValue.js b/toolkit/components/autocomplete/tests/unit/test_finalDefaultCompleteValue.js
deleted file mode 100644
index c983d969b..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_finalDefaultCompleteValue.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function AutoCompleteResult(aValues, aFinalCompleteValues) {
- this._values = aValues;
- this._finalCompleteValues = aFinalCompleteValues;
- this.defaultIndex = 0;
-}
-AutoCompleteResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
- this.popup.selectedIndex = -1;
- this.completeDefaultIndex = true;
-}
-AutoCompleteInput.prototype = Object.create(AutoCompleteInputBase.prototype);
-
-function run_test() {
- run_next_test();
-}
-
-add_test(function test_keyNavigation() {
- doSearch("moz", "mozilla.com", "http://www.mozilla.com", function(aController) {
- do_check_eq(aController.input.textValue, "mozilla.com");
- aController.handleKeyNavigation(Ci.nsIDOMKeyEvent.DOM_VK_RIGHT);
- do_check_eq(aController.input.textValue, "mozilla.com");
- });
-});
-
-add_test(function test_handleEnter() {
- doSearch("moz", "mozilla.com", "http://www.mozilla.com", function(aController) {
- do_check_eq(aController.input.textValue, "mozilla.com");
- aController.handleEnter(false);
- do_check_eq(aController.input.textValue, "http://www.mozilla.com");
- });
-});
-
-function doSearch(aSearchString, aResultValue, aFinalCompleteValue, aOnCompleteCallback) {
- let search = new AutoCompleteSearchBase(
- "search",
- new AutoCompleteResult([ aResultValue ], [ aFinalCompleteValue ])
- );
- registerAutoCompleteSearch(search);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches and confirms results.
- let input = new AutoCompleteInput([ search.name ]);
- input.textValue = aSearchString;
-
- // Caret must be at the end for autofill to happen.
- let strLen = aSearchString.length;
- input.selectTextRange(strLen, strLen);
- controller.input = input;
- controller.startSearch(aSearchString);
-
- input.onSearchComplete = function onSearchComplete() {
- aOnCompleteCallback(controller);
-
- // Clean up.
- unregisterAutoCompleteSearch(search);
- run_next_test();
- };
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_hiddenResult.js b/toolkit/components/autocomplete/tests/unit/test_hiddenResult.js
deleted file mode 100644
index 8e2485716..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_hiddenResult.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function AutoCompleteResult(aValues) {
- this._values = aValues;
- this.defaultIndex = -1;
- this._typeAheadResult = false;
-}
-AutoCompleteResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-function AutoCompleteTypeAheadResult(aValues) {
- this._values = aValues;
- this.defaultIndex = 0;
- this._typeAheadResult = true;
-}
-AutoCompleteTypeAheadResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-
-/**
- * Test AutoComplete with multiple AutoCompleteSearch sources, with one of them
- * being hidden from the popup, but can still do typeahead completion.
- */
-function run_test() {
- do_test_pending();
-
- var inputStr = "moz";
-
- // Type ahead result
- var searchTypeAhead = new AutoCompleteSearchBase("search1",
- new AutoCompleteTypeAheadResult(["mozillaTest1"]));
- // Regular result
- var searchNormal = new AutoCompleteSearchBase("search2",
- new AutoCompleteResult(["mozillaTest2"]));
-
- // Register searches so AutoCompleteController can find them
- registerAutoCompleteSearch(searchNormal);
- registerAutoCompleteSearch(searchTypeAhead);
-
- // Make an AutoCompleteInput that uses our searches
- // and confirms results on search complete.
- var input = new AutoCompleteInputBase([searchTypeAhead.name, searchNormal.name]);
- input.completeDefaultIndex = true;
- input.textValue = inputStr;
-
- // Caret must be at the end. Autofill doesn't happen unless you're typing
- // characters at the end.
- var strLen = inputStr.length;
- input.selectTextRange(strLen, strLen);
- do_check_eq(input.selectionStart, strLen);
- do_check_eq(input.selectionEnd, strLen);
-
- var controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- controller.input = input;
- controller.startSearch(inputStr);
-
- input.onSearchComplete = function() {
- // Hidden results should still be able to do inline autocomplete
- do_check_eq(input.textValue, "mozillaTest1");
-
- // Now, let's fill the textbox with the first result of the popup.
- // The first search is marked as hidden, so we must always get the
- // second search.
- controller.handleEnter(true);
- do_check_eq(input.textValue, "mozillaTest2");
-
- // Only one item in the popup.
- do_check_eq(controller.matchCount, 1);
-
- // Unregister searches
- unregisterAutoCompleteSearch(searchNormal);
- unregisterAutoCompleteSearch(searchTypeAhead);
- do_test_finished();
- };
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_immediate_search.js b/toolkit/components/autocomplete/tests/unit/test_immediate_search.js
deleted file mode 100644
index 0579f5dcb..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_immediate_search.js
+++ /dev/null
@@ -1,157 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-
-function AutoCompleteImmediateSearch(aName, aResult) {
- this.name = aName;
- this._result = aResult;
-}
-AutoCompleteImmediateSearch.prototype = Object.create(AutoCompleteSearchBase.prototype);
-AutoCompleteImmediateSearch.prototype.searchType =
- Ci.nsIAutoCompleteSearchDescriptor.SEARCH_TYPE_IMMEDIATE;
-AutoCompleteImmediateSearch.prototype.QueryInterface =
- XPCOMUtils.generateQI([Ci.nsIFactory,
- Ci.nsIAutoCompleteSearch,
- Ci.nsIAutoCompleteSearchDescriptor]);
-
-function AutoCompleteDelayedSearch(aName, aResult) {
- this.name = aName;
- this._result = aResult;
-}
-AutoCompleteDelayedSearch.prototype = Object.create(AutoCompleteSearchBase.prototype);
-
-function AutoCompleteResult(aValues, aDefaultIndex) {
- this._values = aValues;
- this.defaultIndex = aDefaultIndex;
-}
-AutoCompleteResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-function run_test() {
- run_next_test();
-}
-
-/**
- * An immediate search should be executed synchronously.
- */
-add_test(function test_immediate_search() {
- let inputStr = "moz";
-
- let immediateSearch = new AutoCompleteImmediateSearch(
- "immediate", new AutoCompleteResult(["moz-immediate"], 0));
- registerAutoCompleteSearch(immediateSearch);
- let delayedSearch = new AutoCompleteDelayedSearch(
- "delayed", new AutoCompleteResult(["moz-delayed"], 0));
- registerAutoCompleteSearch(delayedSearch);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- let input = new AutoCompleteInputBase([delayedSearch.name,
- immediateSearch.name]);
- input.completeDefaultIndex = true;
- input.textValue = inputStr;
-
- // Caret must be at the end. Autofill doesn't happen unless you're typing
- // characters at the end.
- let strLen = inputStr.length;
- input.selectTextRange(strLen, strLen);
-
- controller.input = input;
- controller.startSearch(inputStr);
-
- // Immediately check the result, the immediate search should have finished.
- do_check_eq(input.textValue, "moz-immediate");
-
- // Wait for both queries to finish.
- input.onSearchComplete = function() {
- // Sanity check.
- do_check_eq(input.textValue, "moz-immediate");
-
- unregisterAutoCompleteSearch(immediateSearch);
- unregisterAutoCompleteSearch(delayedSearch);
- run_next_test();
- };
-});
-
-/**
- * An immediate search should be executed before any delayed search.
- */
-add_test(function test_immediate_search_notimeout() {
- let inputStr = "moz";
-
- let immediateSearch = new AutoCompleteImmediateSearch(
- "immediate", new AutoCompleteResult(["moz-immediate"], 0));
- registerAutoCompleteSearch(immediateSearch);
-
- let delayedSearch = new AutoCompleteDelayedSearch(
- "delayed", new AutoCompleteResult(["moz-delayed"], 0));
- registerAutoCompleteSearch(delayedSearch);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- let input = new AutoCompleteInputBase([delayedSearch.name,
- immediateSearch.name]);
- input.completeDefaultIndex = true;
- input.textValue = inputStr;
- input.timeout = 0;
-
- // Caret must be at the end. Autofill doesn't happen unless you're typing
- // characters at the end.
- let strLen = inputStr.length;
- input.selectTextRange(strLen, strLen);
-
- controller.input = input;
- let complete = false;
- input.onSearchComplete = function() {
- complete = true;
- };
- controller.startSearch(inputStr);
- do_check_true(complete);
-
- // Immediately check the result, the immediate search should have finished.
- do_check_eq(input.textValue, "moz-immediate");
-
- unregisterAutoCompleteSearch(immediateSearch);
- unregisterAutoCompleteSearch(delayedSearch);
- run_next_test();
-});
-
-/**
- * A delayed search should be executed synchronously with a zero timeout.
- */
-add_test(function test_delayed_search_notimeout() {
- let inputStr = "moz";
-
- let delayedSearch = new AutoCompleteDelayedSearch(
- "delayed", new AutoCompleteResult(["moz-delayed"], 0));
- registerAutoCompleteSearch(delayedSearch);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- let input = new AutoCompleteInputBase([delayedSearch.name]);
- input.completeDefaultIndex = true;
- input.textValue = inputStr;
- input.timeout = 0;
-
- // Caret must be at the end. Autofill doesn't happen unless you're typing
- // characters at the end.
- let strLen = inputStr.length;
- input.selectTextRange(strLen, strLen);
-
- controller.input = input;
- let complete = false;
- input.onSearchComplete = function() {
- complete = true;
- };
- controller.startSearch(inputStr);
- do_check_true(complete);
-
- // Immediately check the result, the delayed search should have finished.
- do_check_eq(input.textValue, "moz-delayed");
-
- unregisterAutoCompleteSearch(delayedSearch);
- run_next_test();
-});
diff --git a/toolkit/components/autocomplete/tests/unit/test_insertMatchAt.js b/toolkit/components/autocomplete/tests/unit/test_insertMatchAt.js
deleted file mode 100644
index 14ee388b8..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_insertMatchAt.js
+++ /dev/null
@@ -1,14 +0,0 @@
-function run_test() {
- let result = Cc["@mozilla.org/autocomplete/simple-result;1"]
- .createInstance(Ci.nsIAutoCompleteSimpleResult);
- result.appendMatch("a", "");
- result.appendMatch("c", "");
- result.insertMatchAt(1, "b", "");
- result.insertMatchAt(3, "d", "");
-
- Assert.equal(result.matchCount, 4);
- Assert.equal(result.getValueAt(0), "a");
- Assert.equal(result.getValueAt(1), "b");
- Assert.equal(result.getValueAt(2), "c");
- Assert.equal(result.getValueAt(3), "d");
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_popupSelectionVsDefaultCompleteValue.js b/toolkit/components/autocomplete/tests/unit/test_popupSelectionVsDefaultCompleteValue.js
deleted file mode 100644
index fb4153355..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_popupSelectionVsDefaultCompleteValue.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function AutoCompleteTypeAheadResult(aValues, aFinalCompleteValues) {
- this._values = aValues;
- this._finalCompleteValues = aFinalCompleteValues;
- this.defaultIndex = 0;
- this._typeAheadResult = true;
-}
-AutoCompleteTypeAheadResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-function AutoCompleteResult(aValues) {
- this._values = aValues;
-}
-AutoCompleteResult.prototype = Object.create(AutoCompleteResultBase.prototype);
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
- this.popupOpen = true;
- this.completeDefaultIndex = true;
- this.completeSelectedIndex = true;
-}
-AutoCompleteInput.prototype = Object.create(AutoCompleteInputBase.prototype);
-
-function run_test() {
- run_next_test();
-}
-
-add_test(function test_handleEnter() {
- doSearch("moz", function(aController) {
- do_check_eq(aController.input.textValue, "mozilla.com");
- aController.handleEnter(true);
- do_check_eq(aController.input.textValue, "mozilla.org");
- });
-});
-
-function doSearch(aSearchString, aOnCompleteCallback) {
- let typeAheadSearch = new AutoCompleteSearchBase(
- "typeAheadSearch",
- new AutoCompleteTypeAheadResult([ "mozilla.com" ], [ "http://www.mozilla.com" ])
- );
- registerAutoCompleteSearch(typeAheadSearch);
-
- let search = new AutoCompleteSearchBase(
- "search",
- new AutoCompleteResult([ "mozilla.org" ])
- );
- registerAutoCompleteSearch(search);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches and confirms results.
- let input = new AutoCompleteInput([ typeAheadSearch.name, search.name ]);
- input.textValue = aSearchString;
-
- // Caret must be at the end for autofill to happen.
- let strLen = aSearchString.length;
- input.selectTextRange(strLen, strLen);
- controller.input = input;
- controller.startSearch(aSearchString);
-
- input.onSearchComplete = function onSearchComplete() {
- aOnCompleteCallback(controller);
-
- // Clean up.
- unregisterAutoCompleteSearch(search);
- run_next_test();
- };
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_previousResult.js b/toolkit/components/autocomplete/tests/unit/test_previousResult.js
deleted file mode 100644
index bfe6c7aae..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_previousResult.js
+++ /dev/null
@@ -1,280 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Unit test for Bug 438861 - Previous search results not returned to multiple
- * searches.
- */
-
-
-/**
- * Dummy nsIAutoCompleteInput source that returns
- * the given list of AutoCompleteSearch names.
- *
- * Implements only the methods needed for this test.
- */
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
-
- // Array of AutoCompleteSearch names
- searches: null,
-
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "",
- disableAutoComplete: false,
- completeDefaultIndex: false,
-
- get searchCount() {
- return this.searches.length;
- },
-
- getSearchAt: function(aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchBegin: function() {},
- onSearchComplete: function() {},
-
- popupOpen: false,
-
- popup: {
- setSelectedIndex: function(aIndex) {},
- invalidate: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompletePopup))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- },
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteInput))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-
-
-/**
- * nsIAutoCompleteResult implementation
- */
-function AutoCompleteResult(aValues, aComments, aStyles) {
- this._values = aValues;
- this._comments = aComments;
- this._styles = aStyles;
- if (this._values.length > 0) {
- this.searchResult = Ci.nsIAutoCompleteResult.RESULT_SUCCESS;
- } else {
- this.searchResult = Ci.nsIAutoCompleteResult.NOMATCH;
- }
-}
-AutoCompleteResult.prototype = {
- constructor: AutoCompleteResult,
-
- // Arrays
- _values: null,
- _comments: null,
- _styles: null,
-
- searchString: "",
- searchResult: null,
-
- defaultIndex: 0,
-
- get matchCount() {
- return this._values.length;
- },
-
- getValueAt: function(aIndex) {
- return this._values[aIndex];
- },
-
- getLabelAt: function(aIndex) {
- return this.getValueAt(aIndex);
- },
-
- getCommentAt: function(aIndex) {
- return this._comments[aIndex];
- },
-
- getStyleAt: function(aIndex) {
- return this._styles[aIndex];
- },
-
- getImageAt: function(aIndex) {
- return "";
- },
-
- getFinalCompleteValueAt: function(aIndex) {
- return this.getValueAt(aIndex);
- },
-
- removeValueAt: function (aRowIndex, aRemoveFromDb) {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteResult))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-
-/**
- * nsIAutoCompleteSearch implementation that always returns
- * the same result set.
- */
-function AutoCompleteSearch(aName, aResult) {
- this.name = aName;
- this._result = aResult;
-}
-AutoCompleteSearch.prototype = {
- constructor: AutoCompleteSearch,
-
- // Search name. Used by AutoCompleteController
- name: null,
-
- // AutoCompleteResult
- _result: null,
-
- _previousResult: null,
-
-
- /**
- * Return the same result set for every search
- */
- startSearch: function(aSearchString,
- aSearchParam,
- aPreviousResult,
- aListener)
- {
- this._previousResult = aPreviousResult;
- aListener.onSearchResult(this, this._result);
- },
-
- stopSearch: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIFactory) ||
- iid.equals(Ci.nsIAutoCompleteSearch))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- // nsIFactory implementation
- createInstance: function(outer, iid) {
- return this.QueryInterface(iid);
- }
-}
-
-
-/**
- * Helper to register an AutoCompleteSearch with the given name.
- * Allows the AutoCompleteController to find the search.
- */
-function registerAutoCompleteSearch(aSearch) {
- var name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
-
- var uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].
- getService(Ci.nsIUUIDGenerator);
- var cid = uuidGenerator.generateUUID();
-
- var desc = "Test AutoCompleteSearch";
-
- var componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.registerFactory(cid, desc, name, aSearch);
-
- // Keep the id on the object so we can unregister later
- aSearch.cid = cid;
-}
-
-
-/**
- * Helper to unregister an AutoCompleteSearch.
- */
-function unregisterAutoCompleteSearch(aSearch) {
- var componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.unregisterFactory(aSearch.cid, aSearch);
-}
-
-
-/**
- */
-function run_test() {
- // Make an AutoCompleteSearch that always returns nothing
- var search1 = new AutoCompleteSearch("test-previous-result1",
- new AutoCompleteResult(["hello1"], [""], [""]));
-
- var search2 = new AutoCompleteSearch("test-previous-result2",
- new AutoCompleteResult(["hello2"], [""], [""]));
-
- // Register search so AutoCompleteController can find them
- registerAutoCompleteSearch(search1);
- registerAutoCompleteSearch(search2);
-
- var controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
- getService(Components.interfaces.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our search
- // and confirms results on search complete
- var input = new AutoCompleteInput([search1.name,
- search2.name]);
- var numSearchesStarted = 0;
-
- input.onSearchBegin = function() {
- numSearchesStarted++;
- };
-
- input.onSearchComplete = function() {
- do_check_eq(controller.searchStatus,
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
- do_check_eq(controller.matchCount, 2);
-
- if (numSearchesStarted == 1) {
- do_check_eq(search1._previousResult, null);
- do_check_eq(search2._previousResult, null);
-
- // Now start it again
- controller.startSearch("test");
- return;
- }
- do_check_neq(search1._previousResult, null);
- do_check_neq(search2._previousResult, null);
-
- // Unregister searches
- unregisterAutoCompleteSearch(search1);
- unregisterAutoCompleteSearch(search2);
-
- do_test_finished();
- };
-
- controller.input = input;
-
- // Search is asynchronous, so don't let the test finish immediately
- do_test_pending();
-
- controller.startSearch("test");
-}
diff --git a/toolkit/components/autocomplete/tests/unit/test_stopSearch.js b/toolkit/components/autocomplete/tests/unit/test_stopSearch.js
deleted file mode 100644
index 5ef3454b4..000000000
--- a/toolkit/components/autocomplete/tests/unit/test_stopSearch.js
+++ /dev/null
@@ -1,187 +0,0 @@
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Purpose of the test is to check that a stopSearch call comes always before a
- * startSearch call.
- */
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-
-/**
- * Dummy nsIAutoCompleteInput source that returns
- * the given list of AutoCompleteSearch names.
- *
- * Implements only the methods needed for this test.
- */
-function AutoCompleteInput(aSearches)
-{
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "hello",
- disableAutoComplete: false,
- completeDefaultIndex: false,
- set popupOpen(val) { return val; }, // ignore
- get popupOpen() { return false; },
- get searchCount() { return this.searches.length; },
- getSearchAt: function(aIndex) { return this.searches[aIndex]; },
- onSearchBegin: function() {},
- onSearchComplete: function() {},
- onTextReverted: function () {},
- onTextEntered: function () {},
- popup: {
- selectBy: function() {},
- invalidate: function() {},
- set selectedIndex(val) { return val; }, // ignore
- get selectedIndex() { return -1 },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompletePopup])
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteInput])
-}
-
-
-/**
- * nsIAutoCompleteSearch implementation.
- */
-function AutoCompleteSearch(aName)
-{
- this.name = aName;
-}
-AutoCompleteSearch.prototype = {
- constructor: AutoCompleteSearch,
- stopSearchInvoked: true,
- startSearch: function(aSearchString, aSearchParam, aPreviousResult, aListener)
- {
- print("Check stop search has been called");
- do_check_true(this.stopSearchInvoked);
- this.stopSearchInvoked = false;
- },
- stopSearch: function()
- {
- this.stopSearchInvoked = true;
- },
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsIFactory
- , Ci.nsIAutoCompleteSearch
- ]),
- createInstance: function(outer, iid)
- {
- return this.QueryInterface(iid);
- }
-}
-
-
-/**
- * Helper to register an AutoCompleteSearch with the given name.
- * Allows the AutoCompleteController to find the search.
- */
-function registerAutoCompleteSearch(aSearch)
-{
- let name = "@mozilla.org/autocomplete/search;1?name=" + aSearch.name;
- let uuidGenerator = Cc["@mozilla.org/uuid-generator;1"].
- getService(Ci.nsIUUIDGenerator);
- let cid = uuidGenerator.generateUUID();
- let desc = "Test AutoCompleteSearch";
- let componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.registerFactory(cid, desc, name, aSearch);
- // Keep the id on the object so we can unregister later
- aSearch.cid = cid;
-}
-
-
-/**
- * Helper to unregister an AutoCompleteSearch.
- */
-function unregisterAutoCompleteSearch(aSearch) {
- let componentManager = Components.manager
- .QueryInterface(Ci.nsIComponentRegistrar);
- componentManager.unregisterFactory(aSearch.cid, aSearch);
-}
-
-
-var gTests = [
- function(controller) {
- print("handleText");
- controller.input.textValue = "hel";
- controller.handleText();
- },
- function(controller) {
- print("handleStartComposition");
- controller.handleStartComposition();
- },
- function(controller) {
- print("handleEndComposition");
- controller.handleEndComposition();
- // an input event always follows compositionend event.
- controller.handleText();
- },
- function(controller) {
- print("handleEscape");
- controller.handleEscape();
- },
- function(controller) {
- print("handleEnter");
- controller.handleEnter(false);
- },
- function(controller) {
- print("handleTab");
- controller.handleTab();
- },
-
- function(controller) {
- print("handleKeyNavigation");
- controller.handleKeyNavigation(Ci.nsIDOMKeyEvent.DOM_VK_UP);
- },
-];
-
-
-var gSearch;
-var gCurrentTest;
-function run_test() {
- // Make an AutoCompleteSearch that always returns nothing
- gSearch = new AutoCompleteSearch("test");
- registerAutoCompleteSearch(gSearch);
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our search.
- let input = new AutoCompleteInput([gSearch.name]);
- controller.input = input;
-
- input.onSearchBegin = function() {
- do_execute_soon(function() {
- gCurrentTest(controller);
- });
- };
- input.onSearchComplete = function() {
- run_next_test(controller);
- }
-
- // Search is asynchronous, so don't let the test finish immediately
- do_test_pending();
-
- run_next_test(controller);
-}
-
-function run_next_test(controller) {
- if (gTests.length == 0) {
- unregisterAutoCompleteSearch(gSearch);
- controller.stopSearch();
- controller.input = null;
- do_test_finished();
- return;
- }
-
- gCurrentTest = gTests.shift();
- controller.startSearch("hello");
-}
diff --git a/toolkit/components/autocomplete/tests/unit/xpcshell.ini b/toolkit/components/autocomplete/tests/unit/xpcshell.ini
deleted file mode 100644
index daf89db17..000000000
--- a/toolkit/components/autocomplete/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,26 +0,0 @@
-[DEFAULT]
-head = head_autocomplete.js
-tail =
-
-[test_330578.js]
-[test_378079.js]
-[test_393191.js]
-[test_440866.js]
-[test_463023.js]
-[test_660156.js]
-[test_autocomplete_multiple.js]
-[test_autocomplete_userContextId.js]
-[test_autofillSelectedPopupIndex.js]
-[test_badDefaultIndex.js]
-[test_completeDefaultIndex_casing.js]
-[test_finalCompleteValue.js]
-[test_finalCompleteValue_defaultIndex.js]
-[test_finalCompleteValue_forceComplete.js]
-[test_finalCompleteValueSelectedIndex.js]
-[test_finalDefaultCompleteValue.js]
-[test_hiddenResult.js]
-[test_immediate_search.js]
-[test_insertMatchAt.js]
-[test_popupSelectionVsDefaultCompleteValue.js]
-[test_previousResult.js]
-[test_stopSearch.js]
diff --git a/toolkit/components/blocklist/nsBlocklistService.js b/toolkit/components/blocklist/nsBlocklistService.js
index 788ce192f..67f283b26 100644
--- a/toolkit/components/blocklist/nsBlocklistService.js
+++ b/toolkit/components/blocklist/nsBlocklistService.js
@@ -1117,9 +1117,6 @@ Blocklist.prototype = {
/* See nsIBlocklistService */
getPluginBlocklistState: function(plugin, appVersion, toolkitVersion) {
-#ifdef MOZ_WIDGET_ANDROID
- return Ci.nsIBlocklistService.STATE_NOT_BLOCKED;
-#endif
if (!this._isBlocklistLoaded())
this._loadBlocklist();
return this._getPluginBlocklistState(plugin, this._pluginEntries,
diff --git a/toolkit/components/build/nsToolkitCompsCID.h b/toolkit/components/build/nsToolkitCompsCID.h
index 064f1dbc4..9e61edb26 100644
--- a/toolkit/components/build/nsToolkitCompsCID.h
+++ b/toolkit/components/build/nsToolkitCompsCID.h
@@ -81,7 +81,7 @@
#define NS_APPSTARTUP_CONTRACTID \
"@mozilla.org/toolkit/app-startup;1"
-#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
+#ifdef MOZ_UPDATER
#define NS_UPDATEPROCESSOR_CONTRACTID \
"@mozilla.org/updates/update-processor;1"
#endif
@@ -170,7 +170,7 @@
#define NS_FAVICONSERVICE_CID \
{ 0x984e3259, 0x9266, 0x49cf, { 0xb6, 0x05, 0x60, 0xb0, 0x22, 0xa0, 0x07, 0x56 } }
-#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
+#ifdef MOZ_UPDATER
#define NS_UPDATEPROCESSOR_CID \
{ 0xf3dcf644, 0x79e8, 0x4f59, { 0xa1, 0xbb, 0x87, 0x84, 0x54, 0x48, 0x8e, 0xf9 } }
#endif
diff --git a/toolkit/components/build/nsToolkitCompsModule.cpp b/toolkit/components/build/nsToolkitCompsModule.cpp
index a4293c6f9..420ff258a 100644
--- a/toolkit/components/build/nsToolkitCompsModule.cpp
+++ b/toolkit/components/build/nsToolkitCompsModule.cpp
@@ -10,7 +10,7 @@
#endif
#include "nsToolkitCompsCID.h"
#include "nsFindService.h"
-#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
+#ifdef MOZ_UPDATER
#include "nsUpdateDriver.h"
#endif
@@ -47,13 +47,8 @@
#include "NativeFileWatcherNotSupported.h"
#endif // (XP_WIN)
-#if !defined(MOZ_WIDGET_ANDROID)
#define MOZ_HAS_TERMINATOR
-#endif
-
-#if defined(MOZ_HAS_TERMINATOR)
#include "nsTerminator.h"
-#endif
#define MOZ_HAS_PERFSTATS
@@ -122,7 +117,7 @@ nsUrlClassifierDBServiceConstructor(nsISupports *aOuter, REFNSIID aIID,
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR(nsBrowserStatusFilter)
-#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
+#ifdef MOZ_UPDATER
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUpdateProcessor)
#endif
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(FinalizationWitnessService, Init)
@@ -160,7 +155,7 @@ NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERSTREAMUPDATER_CID);
NS_DEFINE_NAMED_CID(NS_URLCLASSIFIERUTILS_CID);
#endif
NS_DEFINE_NAMED_CID(NS_BROWSERSTATUSFILTER_CID);
-#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
+#ifdef MOZ_UPDATER
NS_DEFINE_NAMED_CID(NS_UPDATEPROCESSOR_CID);
#endif
NS_DEFINE_NAMED_CID(FINALIZATIONWITNESSSERVICE_CID);
@@ -197,7 +192,7 @@ static const Module::CIDEntry kToolkitCIDs[] = {
{ &kNS_URLCLASSIFIERUTILS_CID, false, nullptr, nsUrlClassifierUtilsConstructor },
#endif
{ &kNS_BROWSERSTATUSFILTER_CID, false, nullptr, nsBrowserStatusFilterConstructor },
-#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
+#ifdef MOZ_UPDATER
{ &kNS_UPDATEPROCESSOR_CID, false, nullptr, nsUpdateProcessorConstructor },
#endif
{ &kFINALIZATIONWITNESSSERVICE_CID, false, nullptr, FinalizationWitnessServiceConstructor },
@@ -236,7 +231,7 @@ static const Module::ContractIDEntry kToolkitContracts[] = {
{ NS_URLCLASSIFIERUTILS_CONTRACTID, &kNS_URLCLASSIFIERUTILS_CID },
#endif
{ NS_BROWSERSTATUSFILTER_CONTRACTID, &kNS_BROWSERSTATUSFILTER_CID },
-#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
+#ifdef MOZ_UPDATER
{ NS_UPDATEPROCESSOR_CONTRACTID, &kNS_UPDATEPROCESSOR_CID },
#endif
{ FINALIZATIONWITNESSSERVICE_CONTRACTID, &kFINALIZATIONWITNESSSERVICE_CID },
diff --git a/toolkit/components/captivedetect/moz.build b/toolkit/components/captivedetect/moz.build
index 3bb9cf573..ee6a49aa5 100644
--- a/toolkit/components/captivedetect/moz.build
+++ b/toolkit/components/captivedetect/moz.build
@@ -4,12 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
-
-XPIDL_SOURCES += [
- 'nsICaptivePortalDetector.idl',
-]
-
+XPIDL_SOURCES += ['nsICaptivePortalDetector.idl']
XPIDL_MODULE = 'captivedetect'
EXTRA_COMPONENTS += [
diff --git a/toolkit/components/captivedetect/test/unit/.eslintrc.js b/toolkit/components/captivedetect/test/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/captivedetect/test/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/captivedetect/test/unit/head_setprefs.js b/toolkit/components/captivedetect/test/unit/head_setprefs.js
deleted file mode 100644
index bf621e31e..000000000
--- a/toolkit/components/captivedetect/test/unit/head_setprefs.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-'use strict';
-
-var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/Services.jsm');
-Cu.import('resource://testing-common/httpd.js');
-
-XPCOMUtils.defineLazyServiceGetter(this, 'gCaptivePortalDetector',
- '@mozilla.org/toolkit/captive-detector;1',
- 'nsICaptivePortalDetector');
-
-const kCanonicalSitePath = '/canonicalSite.html';
-const kCanonicalSiteContent = 'true';
-const kPrefsCanonicalURL = 'captivedetect.canonicalURL';
-const kPrefsCanonicalContent = 'captivedetect.canonicalContent';
-const kPrefsMaxWaitingTime = 'captivedetect.maxWaitingTime';
-const kPrefsPollingTime = 'captivedetect.pollingTime';
-
-var gServer;
-var gServerURL;
-
-function setupPrefs() {
- let prefs = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefService)
- .QueryInterface(Components.interfaces.nsIPrefBranch);
- prefs.setCharPref(kPrefsCanonicalURL, gServerURL + kCanonicalSitePath);
- prefs.setCharPref(kPrefsCanonicalContent, kCanonicalSiteContent);
- prefs.setIntPref(kPrefsMaxWaitingTime, 0);
- prefs.setIntPref(kPrefsPollingTime, 1);
-}
-
-function run_captivedetect_test(xhr_handler, fakeUIResponse, testfun)
-{
- gServer = new HttpServer();
- gServer.registerPathHandler(kCanonicalSitePath, xhr_handler);
- gServer.start(-1);
- gServerURL = 'http://localhost:' + gServer.identity.primaryPort;
-
- setupPrefs();
-
- fakeUIResponse();
-
- testfun();
-}
diff --git a/toolkit/components/captivedetect/test/unit/test_abort.js b/toolkit/components/captivedetect/test/unit/test_abort.js
deleted file mode 100644
index f99805dfb..000000000
--- a/toolkit/components/captivedetect/test/unit/test_abort.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-'use strict';
-
-const kInterfaceName = 'wifi';
-
-var server;
-var step = 0;
-var loginFinished = false;
-
-function xhr_handler(metadata, response) {
- response.setStatusLine(metadata.httpVersion, 200, 'OK');
- response.setHeader('Cache-Control', 'no-cache', false);
- response.setHeader('Content-Type', 'text/plain', false);
- if (loginFinished) {
- response.write('true');
- } else {
- response.write('false');
- }
-}
-
-function fakeUIResponse() {
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic === 'captive-portal-login') {
- do_throw('should not receive captive-portal-login event');
- }
- }, 'captive-portal-login', false);
-}
-
-function test_abort() {
- do_test_pending();
-
- let callback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalCallback]),
- prepare: function prepare() {
- do_check_eq(++step, 1);
- gCaptivePortalDetector.finishPreparation(kInterfaceName);
- },
- complete: function complete(success) {
- do_throw('should not execute |complete| callback');
- },
- };
-
- gCaptivePortalDetector.checkCaptivePortal(kInterfaceName, callback);
- gCaptivePortalDetector.abort(kInterfaceName);
- gServer.stop(do_test_finished);
-}
-
-function run_test() {
- run_captivedetect_test(xhr_handler, fakeUIResponse, test_abort);
-}
diff --git a/toolkit/components/captivedetect/test/unit/test_abort_during_user_login.js b/toolkit/components/captivedetect/test/unit/test_abort_during_user_login.js
deleted file mode 100644
index ef98ac5ea..000000000
--- a/toolkit/components/captivedetect/test/unit/test_abort_during_user_login.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-'use strict';
-
-const kInterfaceName = 'wifi';
-
-var server;
-var step = 0;
-var loginFinished = false;
-
-function xhr_handler(metadata, response) {
- response.setStatusLine(metadata.httpVersion, 200, 'OK');
- response.setHeader('Cache-Control', 'no-cache', false);
- response.setHeader('Content-Type', 'text/plain', false);
- if (loginFinished) {
- response.write('true');
- } else {
- response.write('false');
- }
-}
-
-function fakeUIResponse() {
- let requestId;
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic === 'captive-portal-login') {
- let xhr = Cc['@mozilla.org/xmlextras/xmlhttprequest;1']
- .createInstance(Ci.nsIXMLHttpRequest);
- xhr.open('GET', gServerURL + kCanonicalSitePath, true);
- xhr.send();
- loginFinished = true;
- do_check_eq(++step, 2);
- requestId = JSON.parse(data).id;
- gCaptivePortalDetector.abort(kInterfaceName);
- }
- }, 'captive-portal-login', false);
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic === 'captive-portal-login-abort') {
- do_check_eq(++step, 3);
- do_check_eq(JSON.parse(data).id, requestId);
- gServer.stop(do_test_finished);
- }
- }, 'captive-portal-login-abort', false);
-}
-
-function test_abort() {
- do_test_pending();
-
- let callback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalCallback]),
- prepare: function prepare() {
- do_check_eq(++step, 1);
- gCaptivePortalDetector.finishPreparation(kInterfaceName);
- },
- complete: function complete(success) {
- do_throw('should not execute |complete| callback');
- },
- };
-
- gCaptivePortalDetector.checkCaptivePortal(kInterfaceName, callback);
-}
-
-function run_test() {
- run_captivedetect_test(xhr_handler, fakeUIResponse, test_abort);
-}
diff --git a/toolkit/components/captivedetect/test/unit/test_abort_ongoing_request.js b/toolkit/components/captivedetect/test/unit/test_abort_ongoing_request.js
deleted file mode 100644
index ad99903df..000000000
--- a/toolkit/components/captivedetect/test/unit/test_abort_ongoing_request.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-'use strict';
-
-const kInterfaceName = 'wifi';
-const kOtherInterfaceName = 'ril';
-
-var server;
-var step = 0;
-var loginFinished = false;
-
-function xhr_handler(metadata, response) {
- response.setStatusLine(metadata.httpVersion, 200, 'OK');
- response.setHeader('Cache-Control', 'no-cache', false);
- response.setHeader('Content-Type', 'text/plain', false);
- if (loginFinished) {
- response.write('true');
- } else {
- response.write('false');
- }
-}
-
-function fakeUIResponse() {
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic === 'captive-portal-login') {
- let xhr = Cc['@mozilla.org/xmlextras/xmlhttprequest;1']
- .createInstance(Ci.nsIXMLHttpRequest);
- xhr.open('GET', gServerURL + kCanonicalSitePath, true);
- xhr.send();
- loginFinished = true;
- do_check_eq(++step, 3);
- }
- }, 'captive-portal-login', false);
-}
-
-function test_multiple_requests_abort() {
- do_test_pending();
-
- let callback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalCallback]),
- prepare: function prepare() {
- do_check_eq(++step, 1);
- gCaptivePortalDetector.finishPreparation(kInterfaceName);
- },
- complete: function complete(success) {
- do_throw('should not execute |complete| callback for ' + kInterfaceName);
- },
- };
-
- let otherCallback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalCallback]),
- prepare: function prepare() {
- do_check_eq(++step, 2);
- gCaptivePortalDetector.finishPreparation(kOtherInterfaceName);
- },
- complete: function complete(success) {
- do_check_eq(++step, 4);
- do_check_true(success);
- gServer.stop(do_test_finished);
- }
- };
-
- gCaptivePortalDetector.checkCaptivePortal(kInterfaceName, callback);
- gCaptivePortalDetector.checkCaptivePortal(kOtherInterfaceName, otherCallback);
- gCaptivePortalDetector.abort(kInterfaceName);
-}
-
-function run_test() {
- run_captivedetect_test(xhr_handler, fakeUIResponse, test_multiple_requests_abort);
-}
diff --git a/toolkit/components/captivedetect/test/unit/test_abort_pending_request.js b/toolkit/components/captivedetect/test/unit/test_abort_pending_request.js
deleted file mode 100644
index ce36f1e79..000000000
--- a/toolkit/components/captivedetect/test/unit/test_abort_pending_request.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-'use strict';
-
-const kInterfaceName = 'wifi';
-const kOtherInterfaceName = 'ril';
-
-var server;
-var step = 0;
-var loginFinished = false;
-
-function xhr_handler(metadata, response) {
- response.setStatusLine(metadata.httpVersion, 200, 'OK');
- response.setHeader('Cache-Control', 'no-cache', false);
- response.setHeader('Content-Type', 'text/plain', false);
- if (loginFinished) {
- response.write('true');
- } else {
- response.write('false');
- }
-}
-
-function fakeUIResponse() {
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic === 'captive-portal-login') {
- let xhr = Cc['@mozilla.org/xmlextras/xmlhttprequest;1']
- .createInstance(Ci.nsIXMLHttpRequest);
- xhr.open('GET', gServerURL + kCanonicalSitePath, true);
- xhr.send();
- loginFinished = true;
- do_check_eq(++step, 2);
- }
- }, 'captive-portal-login', false);
-}
-
-function test_abort() {
- do_test_pending();
-
- let callback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalCallback]),
- prepare: function prepare() {
- do_check_eq(++step, 1);
- gCaptivePortalDetector.finishPreparation(kInterfaceName);
- },
- complete: function complete(success) {
- do_check_eq(++step, 3);
- do_check_true(success);
- gServer.stop(do_test_finished);
- },
- };
-
- let otherCallback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalCallback]),
- prepare: function prepare() {
- do_throw('should not execute |prepare| callback for ' + kOtherInterfaceName);
- },
- complete: function complete(success) {
- do_throw('should not execute |complete| callback for ' + kInterfaceName);
- }
- };
-
- gCaptivePortalDetector.checkCaptivePortal(kInterfaceName, callback);
- gCaptivePortalDetector.checkCaptivePortal(kOtherInterfaceName, otherCallback);
- gCaptivePortalDetector.abort(kOtherInterfaceName);
-}
-
-function run_test() {
- run_captivedetect_test(xhr_handler, fakeUIResponse, test_abort);
-}
diff --git a/toolkit/components/captivedetect/test/unit/test_captive_portal_found.js b/toolkit/components/captivedetect/test/unit/test_captive_portal_found.js
deleted file mode 100644
index 7fb7ba89e..000000000
--- a/toolkit/components/captivedetect/test/unit/test_captive_portal_found.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-'use strict';
-
-const kInterfaceName = 'wifi';
-
-var server;
-var step = 0;
-var loginFinished = false;
-
-function xhr_handler(metadata, response) {
- response.setStatusLine(metadata.httpVersion, 200, 'OK');
- response.setHeader('Cache-Control', 'no-cache', false);
- response.setHeader('Content-Type', 'text/plain', false);
- if (loginFinished) {
- response.write('true');
- } else {
- response.write('false');
- }
-}
-
-function fakeUIResponse() {
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic === 'captive-portal-login') {
- let xhr = Cc['@mozilla.org/xmlextras/xmlhttprequest;1']
- .createInstance(Ci.nsIXMLHttpRequest);
- xhr.open('GET', gServerURL + kCanonicalSitePath, true);
- xhr.send();
- loginFinished = true;
- do_check_eq(++step, 2);
- }
- }, 'captive-portal-login', false);
-
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic === 'captive-portal-login-success') {
- do_check_eq(++step, 4);
- gServer.stop(do_test_finished);
- }
- }, 'captive-portal-login-success', false);
-}
-
-function test_portal_found() {
- do_test_pending();
-
- let callback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalCallback]),
- prepare: function prepare() {
- do_check_eq(++step, 1);
- gCaptivePortalDetector.finishPreparation(kInterfaceName);
- },
- complete: function complete(success) {
- // Since this is a synchronous callback, it must happen before
- // 'captive-portal-login-success' is received.
- // (Check captivedetect.js::executeCallback
- do_check_eq(++step, 3);
- do_check_true(success);
- },
- };
-
- gCaptivePortalDetector.checkCaptivePortal(kInterfaceName, callback);
-}
-
-function run_test() {
- run_captivedetect_test(xhr_handler, fakeUIResponse, test_portal_found);
-}
diff --git a/toolkit/components/captivedetect/test/unit/test_captive_portal_found_303.js b/toolkit/components/captivedetect/test/unit/test_captive_portal_found_303.js
deleted file mode 100644
index 7064e12c9..000000000
--- a/toolkit/components/captivedetect/test/unit/test_captive_portal_found_303.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-'use strict';
-
-const kInterfaceName = 'wifi';
-
-var step = 0;
-var loginFinished = false;
-
-var gRedirectServer;
-var gRedirectServerURL;
-
-function xhr_handler(metadata, response) {
- if (loginFinished) {
- response.setStatusLine(metadata.httpVersion, 200, 'OK');
- response.setHeader('Cache-Control', 'no-cache', false);
- response.setHeader('Content-Type', 'text/plain', false);
- response.write('true');
- } else {
- response.setStatusLine(metadata.httpVersion, 303, "See Other");
- response.setHeader("Location", gRedirectServerURL, false);
- response.setHeader("Content-Type", "text/html", false);
- }
-}
-
-function fakeUIResponse() {
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic === 'captive-portal-login') {
- let xhr = Cc['@mozilla.org/xmlextras/xmlhttprequest;1']
- .createInstance(Ci.nsIXMLHttpRequest);
- xhr.open('GET', gServerURL + kCanonicalSitePath, true);
- xhr.send();
- loginFinished = true;
- do_check_eq(++step, 2);
- }
- }, 'captive-portal-login', false);
-
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic === 'captive-portal-login-success') {
- do_check_eq(++step, 4);
- gServer.stop(function () {
- gRedirectServer.stop(do_test_finished);
- });
- }
- }, 'captive-portal-login-success', false);
-}
-
-function test_portal_found() {
- do_test_pending();
-
- let callback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalCallback]),
- prepare: function prepare() {
- do_check_eq(++step, 1);
- gCaptivePortalDetector.finishPreparation(kInterfaceName);
- },
- complete: function complete(success) {
- do_check_eq(++step, 3);
- do_check_true(success);
- },
- };
-
- gCaptivePortalDetector.checkCaptivePortal(kInterfaceName, callback);
-}
-
-function run_test() {
- gRedirectServer = new HttpServer();
- gRedirectServer.start(-1);
- gRedirectServerURL = 'http://localhost:' + gRedirectServer.identity.primaryPort;
-
- run_captivedetect_test(xhr_handler, fakeUIResponse, test_portal_found);
-}
diff --git a/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found.js b/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found.js
deleted file mode 100644
index 1dc4fe009..000000000
--- a/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-'use strict';
-
-const kInterfaceName = 'wifi';
-
-var server;
-var step = 0;
-var attempt = 0;
-
-function xhr_handler(metadata, response) {
- dump('HTTP activity\n');
- response.setStatusLine(metadata.httpVersion, 200, 'OK');
- response.setHeader('Cache-Control', 'no-cache', false);
- response.setHeader('Content-Type', 'text/plain', false);
- response.write('true');
- attempt++;
-}
-
-function fakeUIResponse() {
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic == 'captive-portal-login') {
- do_throw('should not receive captive-portal-login event');
- }
- }, 'captive-portal-login', false);
-}
-
-function test_portal_not_found() {
- do_test_pending();
-
- let callback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalCallback]),
- prepare: function prepare() {
- do_check_eq(++step, 1);
- gCaptivePortalDetector.finishPreparation(kInterfaceName);
- },
- complete: function complete(success) {
- do_check_eq(++step, 2);
- do_check_true(success);
- do_check_eq(attempt, 1);
- gServer.stop(function() { dump('server stop\n'); do_test_finished(); });
- }
- };
-
- gCaptivePortalDetector.checkCaptivePortal(kInterfaceName, callback);
-}
-
-function run_test() {
- run_captivedetect_test(xhr_handler, fakeUIResponse, test_portal_not_found);
-}
diff --git a/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found_404.js b/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found_404.js
deleted file mode 100644
index 66bcdd077..000000000
--- a/toolkit/components/captivedetect/test/unit/test_captive_portal_not_found_404.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-'use strict';
-
-const kInterfaceName = 'wifi';
-
-var server;
-var step = 0;
-var loginFinished = false;
-var attempt = 0;
-
-function xhr_handler(metadata, response) {
- response.setStatusLine(metadata.httpVersion, 404, "Page not Found");
- attempt++;
-}
-
-function fakeUIResponse() {
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic === 'captive-portal-login') {
- do_throw('should not receive captive-portal-login event');
- }
- }, 'captive-portal-login', false);
-}
-
-function test_portal_not_found() {
- do_test_pending();
-
- let callback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalCallback]),
- prepare: function prepare() {
- do_check_eq(++step, 1);
- gCaptivePortalDetector.finishPreparation(kInterfaceName);
- },
- complete: function complete(success) {
- do_check_eq(++step, 2);
- do_check_false(success);
- do_check_eq(attempt, 6);
- gServer.stop(do_test_finished);
- },
- };
-
- gCaptivePortalDetector.checkCaptivePortal(kInterfaceName, callback);
-}
-
-function run_test() {
- run_captivedetect_test(xhr_handler, fakeUIResponse, test_portal_not_found);
-}
diff --git a/toolkit/components/captivedetect/test/unit/test_multiple_requests.js b/toolkit/components/captivedetect/test/unit/test_multiple_requests.js
deleted file mode 100644
index 11cf5e4b2..000000000
--- a/toolkit/components/captivedetect/test/unit/test_multiple_requests.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-'use strict';
-
-const kInterfaceName = 'wifi';
-const kOtherInterfaceName = 'ril';
-
-var server;
-var step = 0;
-var loginFinished = false;
-var loginSuccessCount = 0;
-
-function xhr_handler(metadata, response) {
- response.setStatusLine(metadata.httpVersion, 200, 'OK');
- response.setHeader('Cache-Control', 'no-cache', false);
- response.setHeader('Content-Type', 'text/plain', false);
- if (loginFinished) {
- response.write('true');
- } else {
- response.write('false');
- }
-}
-
-function fakeUIResponse() {
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic === 'captive-portal-login') {
- let xhr = Cc['@mozilla.org/xmlextras/xmlhttprequest;1']
- .createInstance(Ci.nsIXMLHttpRequest);
- xhr.open('GET', gServerURL + kCanonicalSitePath, true);
- xhr.send();
- loginFinished = true;
- do_check_eq(++step, 2);
- }
- }, 'captive-portal-login', false);
-
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic === 'captive-portal-login-success') {
- loginSuccessCount++;
- if (loginSuccessCount > 1) {
- throw "We should only receive 'captive-portal-login-success' once";
- }
- do_check_eq(++step, 4);
- }
- }, 'captive-portal-login-success', false);
-}
-
-function test_multiple_requests() {
- do_test_pending();
-
- let callback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalCallback]),
- prepare: function prepare() {
- do_check_eq(++step, 1);
- gCaptivePortalDetector.finishPreparation(kInterfaceName);
- },
- complete: function complete(success) {
- do_check_eq(++step, 3);
- do_check_true(success);
- },
- };
-
- let otherCallback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalCallback]),
- prepare: function prepare() {
- do_check_eq(++step, 5);
- gCaptivePortalDetector.finishPreparation(kOtherInterfaceName);
- },
- complete: function complete(success) {
- do_check_eq(++step, 6);
- do_check_true(success);
- gServer.stop(do_test_finished);
- }
- };
-
- gCaptivePortalDetector.checkCaptivePortal(kInterfaceName, callback);
- gCaptivePortalDetector.checkCaptivePortal(kOtherInterfaceName, otherCallback);
-}
-
-function run_test() {
- run_captivedetect_test(xhr_handler, fakeUIResponse, test_multiple_requests);
-}
diff --git a/toolkit/components/captivedetect/test/unit/test_user_cancel.js b/toolkit/components/captivedetect/test/unit/test_user_cancel.js
deleted file mode 100644
index a03876817..000000000
--- a/toolkit/components/captivedetect/test/unit/test_user_cancel.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-'use strict';
-
-const kInterfaceName = 'wifi';
-
-var server;
-var step = 0;
-
-function xhr_handler(metadata, response) {
- response.setStatusLine(metadata.httpVersion, 200, 'OK');
- response.setHeader('Cache-Control', 'no-cache', false);
- response.setHeader('Content-Type', 'text/plain', false);
- response.write('false');
-}
-
-function fakeUIResponse() {
- Services.obs.addObserver(function observe(subject, topic, data) {
- if (topic === 'captive-portal-login') {
- let xhr = Cc['@mozilla.org/xmlextras/xmlhttprequest;1']
- .createInstance(Ci.nsIXMLHttpRequest);
- xhr.open('GET', gServerURL + kCanonicalSitePath, true);
- xhr.send();
- do_check_eq(++step, 2);
- let details = JSON.parse(data);
- gCaptivePortalDetector.cancelLogin(details.id);
- }
- }, 'captive-portal-login', false);
-}
-
-function test_cancel() {
- do_test_pending();
-
- let callback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsICaptivePortalCallback]),
- prepare: function prepare() {
- do_check_eq(++step, 1);
- gCaptivePortalDetector.finishPreparation(kInterfaceName);
- },
- complete: function complete(success) {
- do_check_eq(++step, 3);
- do_check_false(success);
- gServer.stop(do_test_finished);
- },
- };
-
- gCaptivePortalDetector.checkCaptivePortal(kInterfaceName, callback);
-}
-
-function run_test() {
- run_captivedetect_test(xhr_handler, fakeUIResponse, test_cancel);
-}
diff --git a/toolkit/components/captivedetect/test/unit/xpcshell.ini b/toolkit/components/captivedetect/test/unit/xpcshell.ini
deleted file mode 100644
index 0f440c438..000000000
--- a/toolkit/components/captivedetect/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,15 +0,0 @@
-[DEFAULT]
-head = head_setprefs.js
-tail =
-
-[test_captive_portal_not_found.js]
-[test_captive_portal_not_found_404.js]
-[test_captive_portal_found.js]
-[test_captive_portal_found_303.js]
-[test_abort.js]
-[test_abort_during_user_login.js]
-[test_user_cancel.js]
-[test_multiple_requests.js]
-[test_abort_ongoing_request.js]
-[test_abort_pending_request.js]
-
diff --git a/toolkit/components/commandlines/moz.build b/toolkit/components/commandlines/moz.build
index 5798ccfcc..eb1303ff0 100644
--- a/toolkit/components/commandlines/moz.build
+++ b/toolkit/components/commandlines/moz.build
@@ -4,13 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
-
-if CONFIG['OS_ARCH'] == 'WINNT':
- XPCSHELL_TESTS_MANIFESTS += ['test/unit_win/xpcshell.ini']
-elif CONFIG['OS_ARCH'] != 'Darwin':
- XPCSHELL_TESTS_MANIFESTS += ['test/unit_unix/xpcshell.ini']
-
XPIDL_SOURCES += [
'nsICommandLine.idl',
'nsICommandLineHandler.idl',
@@ -20,11 +13,6 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'commandlines'
-SOURCES += [
- 'nsCommandLine.cpp',
-]
+SOURCES += ['nsCommandLine.cpp']
FINAL_LIBRARY = 'xul'
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Startup and Profile System')
diff --git a/toolkit/components/commandlines/test/unit/.eslintrc.js b/toolkit/components/commandlines/test/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/commandlines/test/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/commandlines/test/unit/data/test_bug410156.desktop b/toolkit/components/commandlines/test/unit/data/test_bug410156.desktop
deleted file mode 100644
index 1847cdd98..000000000
--- a/toolkit/components/commandlines/test/unit/data/test_bug410156.desktop
+++ /dev/null
@@ -1,7 +0,0 @@
-[Desktop Entry]
-Version=1.0
-Encoding=UTF-8
-Name=test_bug410156
-Type=Link
-URL=http://www.bug410156.com/
-Icon=gnome-fs-bookmark
diff --git a/toolkit/components/commandlines/test/unit/data/test_bug410156.url b/toolkit/components/commandlines/test/unit/data/test_bug410156.url
deleted file mode 100644
index 6920e1f77..000000000
--- a/toolkit/components/commandlines/test/unit/data/test_bug410156.url
+++ /dev/null
@@ -1,9 +0,0 @@
-[InternetShortcut]
-URL=http://www.bug410156.com/
-IDList=
-HotKey=0
-[{000214A0-0000-0000-C000-000000000046}]
-Prop3=19,2
-[InternetShortcut.A]
-[InternetShortcut.W]
-URL=http://www.bug410156.com/
diff --git a/toolkit/components/commandlines/test/unit/test_bug666224.js b/toolkit/components/commandlines/test/unit/test_bug666224.js
deleted file mode 100644
index 8d372097a..000000000
--- a/toolkit/components/commandlines/test/unit/test_bug666224.js
+++ /dev/null
@@ -1,6 +0,0 @@
-function run_test() {
- var cmdLine=Components.classes["@mozilla.org/toolkit/command-line;1"].createInstance(Components.interfaces.nsICommandLine);
- try {
- cmdLine.getArgument(cmdLine.length);
- } catch (e) {}
-}
diff --git a/toolkit/components/commandlines/test/unit/test_classinfo.js b/toolkit/components/commandlines/test/unit/test_classinfo.js
deleted file mode 100644
index a0fb1ff0a..000000000
--- a/toolkit/components/commandlines/test/unit/test_classinfo.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- var clClass = Components.classes["@mozilla.org/toolkit/command-line;1"];
- var commandLine = clClass.createInstance();
- do_check_true("length" in commandLine);
-}
diff --git a/toolkit/components/commandlines/test/unit/xpcshell.ini b/toolkit/components/commandlines/test/unit/xpcshell.ini
deleted file mode 100644
index 4939a3d64..000000000
--- a/toolkit/components/commandlines/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,10 +0,0 @@
-[DEFAULT]
-head =
-tail =
-skip-if = toolkit == 'android'
-support-files =
- data/test_bug410156.desktop
- data/test_bug410156.url
-
-[test_classinfo.js]
-[test_bug666224.js]
diff --git a/toolkit/components/commandlines/test/unit_unix/.eslintrc.js b/toolkit/components/commandlines/test/unit_unix/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/commandlines/test/unit_unix/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/commandlines/test/unit_unix/test_bug410156.js b/toolkit/components/commandlines/test/unit_unix/test_bug410156.js
deleted file mode 100644
index 06c95ac35..000000000
--- a/toolkit/components/commandlines/test/unit_unix/test_bug410156.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- var clClass = Components.classes["@mozilla.org/toolkit/command-line;1"];
- var commandLine = clClass.createInstance();
- var urlFile = do_get_file("../unit/data/test_bug410156.desktop");
- var uri = commandLine.resolveURI(urlFile.path);
- do_check_eq(uri.spec, "http://www.bug410156.com/");
-}
diff --git a/toolkit/components/commandlines/test/unit_unix/xpcshell.ini b/toolkit/components/commandlines/test/unit_unix/xpcshell.ini
deleted file mode 100644
index 41f71f48d..000000000
--- a/toolkit/components/commandlines/test/unit_unix/xpcshell.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[DEFAULT]
-head =
-tail =
-skip-if = toolkit == 'android'
-support-files =
- !/toolkit/components/commandlines/test/unit/data/test_bug410156.desktop
- !/toolkit/components/commandlines/test/unit/data/test_bug410156.url
-
-[test_bug410156.js]
diff --git a/toolkit/components/commandlines/test/unit_win/.eslintrc.js b/toolkit/components/commandlines/test/unit_win/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/commandlines/test/unit_win/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/commandlines/test/unit_win/test_bug410156.js b/toolkit/components/commandlines/test/unit_win/test_bug410156.js
deleted file mode 100644
index cc04426d6..000000000
--- a/toolkit/components/commandlines/test/unit_win/test_bug410156.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- var clClass = Components.classes["@mozilla.org/toolkit/command-line;1"];
- var commandLine = clClass.createInstance();
- var urlFile = do_get_file("../unit/data/test_bug410156.url");
- var uri = commandLine.resolveURI(urlFile.path);
- do_check_eq(uri.spec, "http://www.bug410156.com/");
-}
diff --git a/toolkit/components/commandlines/test/unit_win/xpcshell.ini b/toolkit/components/commandlines/test/unit_win/xpcshell.ini
deleted file mode 100644
index efc2cfccf..000000000
--- a/toolkit/components/commandlines/test/unit_win/xpcshell.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-head =
-tail =
-support-files =
- !/toolkit/components/commandlines/test/unit/data/test_bug410156.desktop
- !/toolkit/components/commandlines/test/unit/data/test_bug410156.url
-
-[test_bug410156.js]
diff --git a/toolkit/components/console/moz.build b/toolkit/components/console/moz.build
index d730b9aa3..e9545267f 100644
--- a/toolkit/components/console/moz.build
+++ b/toolkit/components/console/moz.build
@@ -4,8 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini']
-
EXTRA_COMPONENTS += [
'jsconsole-clhandler.js',
'jsconsole-clhandler.manifest',
diff --git a/toolkit/components/console/tests/chrome.ini b/toolkit/components/console/tests/chrome.ini
deleted file mode 100644
index 0480c3533..000000000
--- a/toolkit/components/console/tests/chrome.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[DEFAULT]
-
-[test_hugeURIs.xul]
diff --git a/toolkit/components/console/tests/test_hugeURIs.xul b/toolkit/components/console/tests/test_hugeURIs.xul
deleted file mode 100644
index 87a571e8d..000000000
--- a/toolkit/components/console/tests/test_hugeURIs.xul
+++ /dev/null
@@ -1,64 +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"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=796179
--->
-<window title="Mozilla Bug 796179"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="RunTest();">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <!-- Detect severe performance and memory issues when large amounts of errors
- are reported from CSS embedded in a file with a long data URI. Addressed
- by 786108 for issues internal to the style system and by 796179 for issues
- related to the error console. This error console test should finish quickly
- with those patches and run for a very long time or OOM otherwise. -->
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=796179"
- target="_blank">Mozilla Bug 796179</a>
- <div id="badSVG" style="max-width: 1; max-height: 1; overflow: hidden"></div>
- </body>
-
- <!-- display the error console so we can test its reaction to the test -->
- <iframe id="errorConsoleFrame" height="400" src="chrome://global/content/console.xul"></iframe>
-
- <!-- test code -->
- <script type="application/javascript">
- <![CDATA[
- function RunTest()
- {
- // Create the bad SVG and add it to the document.
- var img = new Array;
- img.push('<img src="data:image/svg+xml,');
- img.push(encodeURIComponent('<svg xmlns="http://www.w3.org/2000/svg" width="300px" height="300px">'));
-
- for (var i = 0 ; i < 10000 ; i++)
- img.push(encodeURIComponent('<circle cx="0" cy="0" r="1" style="xxx-invalid-property: 0;"/>'));
-
- img.push(encodeURIComponent('</svg>'));
- img.push('" />');
-
- document.getElementById('badSVG').innerHTML = img.join('');
-
- // We yield control of the thread, allowing the error console to render.
- // If we get control back without timing out or OOMing then the test passed.
- SimpleTest.waitForExplicitFinish();
- SimpleTest.executeSoon(function() {
- // Clean up.
- var elem = document.getElementById('errorConsoleFrame');
- elem.parentNode.removeChild(elem);
- elem = document.getElementById('badSVG');
- elem.parentNode.removeChild(elem);
- elem = null;
-
- // Finish the test with a pass.
- ok(true, 'Error console rendered OK.');
- SimpleTest.finish();
- }, 0);
- }
- ]]>
- </script>
-</window>
diff --git a/toolkit/components/contentprefs/moz.build b/toolkit/components/contentprefs/moz.build
index 24bb296f1..83074ed64 100644
--- a/toolkit/components/contentprefs/moz.build
+++ b/toolkit/components/contentprefs/moz.build
@@ -4,15 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPCSHELL_TESTS_MANIFESTS += [
- 'tests/unit/xpcshell.ini',
- 'tests/unit_cps2/xpcshell.ini',
-]
-
-MOCHITEST_MANIFESTS += [
- 'tests/mochitest/mochitest.ini'
-]
-
EXTRA_COMPONENTS += [
'nsContentPrefService.js',
'nsContentPrefService.manifest',
@@ -26,6 +17,3 @@ EXTRA_JS_MODULES += [
'ContentPrefStore.jsm',
'ContentPrefUtils.jsm',
]
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Preferences')
diff --git a/toolkit/components/contentprefs/tests/mochitest/.eslintrc.js b/toolkit/components/contentprefs/tests/mochitest/.eslintrc.js
deleted file mode 100644
index 64a4eda73..000000000
--- a/toolkit/components/contentprefs/tests/mochitest/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/mochitest.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/contentprefs/tests/mochitest/mochitest.ini b/toolkit/components/contentprefs/tests/mochitest/mochitest.ini
deleted file mode 100644
index ec4f05945..000000000
--- a/toolkit/components/contentprefs/tests/mochitest/mochitest.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[DEFAULT]
-
-[test_remoteContentPrefs.html]
-skip-if = toolkit == 'android' || e10s # bug 783513
diff --git a/toolkit/components/contentprefs/tests/mochitest/test_remoteContentPrefs.html b/toolkit/components/contentprefs/tests/mochitest/test_remoteContentPrefs.html
deleted file mode 100644
index d14e85a25..000000000
--- a/toolkit/components/contentprefs/tests/mochitest/test_remoteContentPrefs.html
+++ /dev/null
@@ -1,311 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for nsIContentPrefService2 in child processes</title>
- <script type="application/javascript"
- src="/tests/SimpleTest/SimpleTest.js">
- </script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
- <script type="application/javascript;version=1.8">
- "use strict";
-
- SimpleTest.waitForExplicitFinish();
-
- const childFrameURL =
- "data:text/html,<!DOCTYPE HTML><html><body></body></html>";
-
- function childFrameScript(isFramePrivate) {
- "use strict";
-
- function Tester(resultArray) {
- this.results = [];
- }
-
- Tester.prototype.is =
- function(a, b, note) {
- this.results.push([a === b, note + " (" + a + ", " + b + ")"]);
- };
- Tester.prototype.ok =
- function(b, note) {
- this.results.push([b != false, note]);
- };
-
- var cps = Components.classes["@mozilla.org/content-pref/service;1"]
- .getService(Components.interfaces.nsIContentPrefService2);
-
- let test = null;
- function* test1(message) {
- let tester = new Tester();
-
- tester.ok(cps !== null, "got the content pref service");
-
- cps.setGlobal("testing", 42, null, {
- handleCompletion: function(reason) {
- tester.is(reason, 0, "set a pref?");
- test.next();
- }
- });
-
- yield;
-
- let numResults = 0;
- cps.getGlobal("testing", null, {
- handleResult: function(pref) {
- numResults++;
- tester.is(pref.name, "testing", "pref has the right name");
- tester.is(pref.value, 42, "pref has the right value");
- },
-
- handleCompletion: function(reason) {
- tester.is(reason, 0, "get a pref?");
- tester.is(numResults, 1, "got the right number of prefs");
- tester.is(test.next().done, true, "done with test1");
- message.target.sendAsyncMessage("testRemoteContentPrefs:test1Finished",
- { results: tester.results });
- }
- });
-
- yield;
- }
-
- function* test2(message) {
- let tester = new Tester();
-
- let observer;
- let removed = false;
- cps.addObserverForName("testName", observer = {
- onContentPrefSet: function(group, name, value, isPrivate) {
- if (removed) {
- message.target.sendAsyncMessage("testRemoteContentPrefs:fail",
- { reason: "unexpected notification" });
- }
- tester.is(group, null, "group should be null");
- tester.is(name, "testName", "should only see testName");
- tester.is(value, 42, "value should be correct");
- tester.is(isPrivate, isFramePrivate, "privacy should match");
-
- message.target.sendAsyncMessage("testRemoteContentPrefs:test2poke2", {})
- },
-
- onContentPrefRemoved: function(group, name, isPrivate) {
- tester.is(group, null, "group should be null");
- tester.is(name, "testName");
- tester.is(isPrivate, isFramePrivate, "privacy should match");
- tester.is(test.next().done, true, "should be done with test2");
-
- cps.removeObserverForName("testName", observer);
- removed = true;
-
- message.target.sendAsyncMessage("testRemoteContentPrefs:test2Finished",
- { results: tester.results });
- }
- });
-
- message.target.sendAsyncMessage("testRemoteContentPrefs:test2poke", {});
- yield;
- }
-
- function* test3(message) {
- let tester = new Tester();
-
- cps.setGlobal("testName", 42, null, {
- handleCompletion: function(reason) {
- tester.is(reason, 0, "set a pref");
- cps.set("http://mochi.test", "testpref", "str", null, {
- handleCompletion: function(reason) {
- tester.is(reason, 0, "set a pref");
- test.next();
- }
- });
- }
- });
-
- yield;
-
- cps.removeByDomain("http://mochi.test", null, {
- handleCompletion: function(reason) {
- tester.is(reason, 0, "remove succeeded");
- cps.getByDomainAndName("http://mochi.test", "testpref", null, {
- handleResult: function() {
- message.target.sendAsyncMessage("testRemoteContentPrefs:fail",
- { reason: "got removed pref in test3" });
- },
- handleCompletion: function() {
- test.next();
- }
- });
- }
- });
-
- yield;
-
- message.target.sendAsyncMessage("testRemoteContentPrefs:test3Finished",
- { results: tester.results });
- }
-
- function* test4(message) {
- let tester = new Tester();
-
- let prefObserver = {
- onContentPrefSet: function(group, name, value, isPrivate) {
- test.next({ group: group, name: name, value: value, isPrivate: isPrivate });
- },
- onContentPrefRemoved: function(group, name, isPrivate) {
- test.next({ group: group, name: name, isPrivate: isPrivate });
- }
- };
-
- addMessageListener("testRemoteContentPrefs:prefResults", (msg) => {
- test.next(msg.data.results);
- });
-
- cps.addObserverForName("test", prefObserver);
-
- cps.set("http://mochi.test", "test", 42, { usePrivateBrowsing: true });
- let event = yield;
- tester.is(event.name, "test");
- tester.is(event.isPrivate, true);
-
- message.target.sendAsyncMessage("testRemoteContentPrefs:getPref",
- { group: "http://mochi.test", name: "test" });
-
- let results = yield;
- tester.is(results.length, 0, "should not have seen the pb pref");
-
- message.target.sendAsyncMessage("testRemoteContentPrefs:test4Finished",
- { results: tester.results });
- }
-
- addMessageListener("testRemoteContentPrefs:test1", function(message) {
- test = test1(message);
- test.next();
- });
- addMessageListener("testRemoteContentPrefs:test2", function(message) {
- test = test2(message);
- test.next();
- });
- addMessageListener("testRemoteContentPrefs:test3", function(message) {
- test = test3(message);
- test.next();
- });
- addMessageListener("testRemoteContentPrefs:test4", function(message) {
- test = test4(message);
- test.next();
- });
- }
-
- function processResults(results) {
- for (let i of results) {
- ok(...i);
- }
- }
-
- let test;
- function* testStructure(mm, isPrivate, callback) {
- let lastResult;
-
- function testDone(msg) {
- test.next(msg.data);
- }
-
- mm.addMessageListener("testRemoteContentPrefs:test1Finished", testDone);
- mm.addMessageListener("testRemoteContentPrefs:test2Finished", testDone);
- mm.addMessageListener("testRemoteContentPrefs:test3Finished", testDone);
- mm.addMessageListener("testRemoteContentPrefs:test4Finished", testDone);
-
- mm.addMessageListener("testRemoteContentPrefs:fail", function(msg) {
- ok(false, msg.data.reason);
- });
-
- mm.sendAsyncMessage("testRemoteContentPrefs:test1", {});
- lastResult = yield;
- processResults(lastResult.results);
-
- var cps = SpecialPowers.Cc["@mozilla.org/content-pref/service;1"]
- .getService(SpecialPowers.Ci.nsIContentPrefService2);
- mm.sendAsyncMessage("testRemoteContentPrefs:test2", {});
- mm.addMessageListener("testRemoteContentPrefs:test2poke", function() {
- cps.setGlobal("testName", 42, {usePrivateBrowsing: isPrivate});
- });
- mm.addMessageListener("testRemoteContentPrefs:test2poke2", function() {
- cps.removeGlobal("testName", {usePrivateBrowsing: isPrivate});
- });
-
- lastResult = yield;
- processResults(lastResult.results);
-
- mm.sendAsyncMessage("testRemoteContentPrefs:test3", {});
- lastResult = yield;
- processResults(lastResult.results);
-
- mm.addMessageListener("testRemoteContentPrefs:getPref", function(msg) {
- let results = [];
- cps.getByDomainAndName(msg.data.group, msg.data.name, null, {
- handleResult: function(pref) {
- results.push(pref);
- },
- handleCompletion: function(reason) {
- mm.sendAsyncMessage("testRemoteContentPrefs:prefResults",
- { results: results });
- }
- });
- });
-
- mm.sendAsyncMessage("testRemoteContentPrefs:test4", {});
- lastResult = yield;
- processResults(lastResult.results);
-
- document.getElementById('iframe').remove();
- setTimeout(callback, 0);
- }
-
- function runTest(isPrivate, callback) {
- info("testing with isPrivate=" + isPrivate);
- let iframe = document.createElement("iframe");
- SpecialPowers.wrap(iframe).mozbrowser = true;
- if (isPrivate) {
- SpecialPowers.wrap(iframe).mozprivatebrowsing = true;
- }
- iframe.id = "iframe";
- iframe.src = childFrameURL;
-
- iframe.addEventListener("mozbrowserloadend", function() {
- info("Got iframe load event.");
- let mm = SpecialPowers.getBrowserFrameMessageManager(iframe);
- mm.loadFrameScript("data:,(" + childFrameScript.toString() + ")(" + isPrivate + ");",
- false);
-
- test = testStructure(mm, isPrivate, callback);
- test.next();
- });
-
- document.body.appendChild(iframe);
- }
-
- function runTests() {
- info("Browser prefs set.");
- runTest(false, function() {
- runTest(true, function() {
- SimpleTest.finish();
- });
- });
- }
-
- addEventListener("load", function() {
- info("Got load event.");
-
- SpecialPowers.addPermission("browser", true, document);
- SpecialPowers.pushPrefEnv({
- "set": [
- ["dom.ipc.browser_frames.oop_by_default", true],
- ["dom.mozBrowserFramesEnabled", true],
- ["browser.pagethumbnails.capturing_disabled", true]
- ]
- }, runTests);
- });
- </script>
-</body>
-</html>
diff --git a/toolkit/components/contentprefs/tests/unit/.eslintrc.js b/toolkit/components/contentprefs/tests/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/contentprefs/tests/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/contentprefs/tests/unit/head_contentPrefs.js b/toolkit/components/contentprefs/tests/unit/head_contentPrefs.js
deleted file mode 100644
index 84ca1bebf..000000000
--- a/toolkit/components/contentprefs/tests/unit/head_contentPrefs.js
+++ /dev/null
@@ -1,162 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Inspired by the Places infrastructure in head_bookmarks.js
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-var Cu = Components.utils;
-
-Cu.import('resource://gre/modules/Services.jsm');
-Cu.import('resource://gre/modules/ContentPrefInstance.jsm');
-
-const CONTENT_PREFS_DB_FILENAME = "content-prefs.sqlite";
-const CONTENT_PREFS_BACKUP_DB_FILENAME = "content-prefs.sqlite.corrupt";
-
-var ContentPrefTest = {
- // Convenience Getters
-
- __dirSvc: null,
- get _dirSvc() {
- if (!this.__dirSvc)
- this.__dirSvc = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties);
- return this.__dirSvc;
- },
-
- __consoleSvc: null,
- get _consoleSvc() {
- if (!this.__consoleSvc)
- this.__consoleSvc = Cc["@mozilla.org/consoleservice;1"].
- getService(Ci.nsIConsoleService);
- return this.__consoleSvc;
- },
-
- __ioSvc: null,
- get _ioSvc() {
- if (!this.__ioSvc)
- this.__ioSvc = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
- return this.__ioSvc;
- },
-
-
- // nsISupports
-
- interfaces: [Ci.nsIDirectoryServiceProvider, Ci.nsISupports],
-
- QueryInterface: function ContentPrefTest_QueryInterface(iid) {
- if (!this.interfaces.some( function(v) { return iid.equals(v) } ))
- throw Cr.NS_ERROR_NO_INTERFACE;
- return this;
- },
-
-
- // nsIDirectoryServiceProvider
-
- getFile: function ContentPrefTest_getFile(property, persistent) {
- persistent.value = true;
-
- if (property == "ProfD")
- return this._dirSvc.get("CurProcD", Ci.nsIFile);
-
- // This causes extraneous errors to show up in the log when the directory
- // service asks us first for CurProcD and MozBinD. I wish there was a way
- // to suppress those errors.
- throw Cr.NS_ERROR_FAILURE;
- },
-
-
- // Utilities
-
- getURI: function ContentPrefTest_getURI(spec) {
- return this._ioSvc.newURI(spec, null, null);
- },
-
- /**
- * Get the profile directory.
- */
- getProfileDir: function ContentPrefTest_getProfileDir() {
- // do_get_profile can be only called from a parent process
- if (runningInParent) {
- return do_get_profile();
- }
- // if running in a content process, this just returns the path
- // profile was initialized in the ipc head file
- let env = Components.classes["@mozilla.org/process/environment;1"]
- .getService(Components.interfaces.nsIEnvironment);
- // the python harness sets this in the environment for us
- let profd = env.get("XPCSHELL_TEST_PROFILE_DIR");
- let file = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
- file.initWithPath(profd);
- return file;
- },
-
- /**
- * Delete the content pref service's persistent datastore. We do this before
- * and after running tests to make sure we start from scratch each time. We
- * also do it during the database creation, schema migration, and backup tests.
- */
- deleteDatabase: function ContentPrefTest_deleteDatabase() {
- var file = this.getProfileDir();
- file.append(CONTENT_PREFS_DB_FILENAME);
- if (file.exists())
- try { file.remove(false); } catch (e) { /* stupid windows box */ }
- return file;
- },
-
- /**
- * Delete the backup of the content pref service's persistent datastore.
- * We do this during the database creation, schema migration, and backup tests.
- */
- deleteBackupDatabase: function ContentPrefTest_deleteBackupDatabase() {
- var file = this.getProfileDir();
- file.append(CONTENT_PREFS_BACKUP_DB_FILENAME);
- if (file.exists())
- file.remove(false);
- return file;
- },
-
- /**
- * Log a message to the console and the test log.
- */
- log: function ContentPrefTest_log(message) {
- message = "*** ContentPrefTest: " + message;
- this._consoleSvc.logStringMessage(message);
- print(message);
- }
-
-};
-
-var gInPrivateBrowsing = false;
-function enterPBMode() {
- gInPrivateBrowsing = true;
-}
-function exitPBMode() {
- gInPrivateBrowsing = false;
- Services.obs.notifyObservers(null, "last-pb-context-exited", null);
-}
-
-ContentPrefTest.deleteDatabase();
-
-function inChildProcess() {
- var appInfo = Cc["@mozilla.org/xre/app-info;1"];
- if (!appInfo || appInfo.getService(Ci.nsIXULRuntime).processType ==
- Ci.nsIXULRuntime.PROCESS_TYPE_DEFAULT) {
- return false;
- }
- return true;
-}
-
-// Turn on logging for the content preferences service so we can troubleshoot
-// problems with the tests. Note that we cannot do this in a child process
-// without crashing (but we don't need it anyhow)
-if (!inChildProcess()) {
- var prefBranch = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
- prefBranch.setBoolPref("browser.preferences.content.log", true);
-}
-
diff --git a/toolkit/components/contentprefs/tests/unit/tail_contentPrefs.js b/toolkit/components/contentprefs/tests/unit/tail_contentPrefs.js
deleted file mode 100644
index f3c95dac8..000000000
--- a/toolkit/components/contentprefs/tests/unit/tail_contentPrefs.js
+++ /dev/null
@@ -1,6 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-ContentPrefTest.deleteDatabase();
-ContentPrefTest.__dirSvc = null;
diff --git a/toolkit/components/contentprefs/tests/unit/test_bug248970.js b/toolkit/components/contentprefs/tests/unit/test_bug248970.js
deleted file mode 100644
index 5f4aa25c5..000000000
--- a/toolkit/components/contentprefs/tests/unit/test_bug248970.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- let loadContext = { get usePrivateBrowsing() { return gInPrivateBrowsing; } };
-
- ContentPrefTest.deleteDatabase();
- var cp = new ContentPrefInstance(loadContext);
- do_check_neq(cp, null, "Retrieving the content prefs service failed");
-
- try {
- const uri1 = ContentPrefTest.getURI("http://www.example.com/");
- const uri2 = ContentPrefTest.getURI("http://www.anotherexample.com/");
- const pref_name = "browser.content.full-zoom";
- const zoomA = 1.5, zoomA_new = 0.8, zoomB = 1.3;
- // save Zoom-A
- cp.setPref(uri1, pref_name, zoomA);
- // make sure Zoom-A is retrievable
- do_check_eq(cp.getPref(uri1, pref_name), zoomA);
- // enter private browsing mode
- enterPBMode();
- // make sure Zoom-A is retrievable
- do_check_eq(cp.getPref(uri1, pref_name), zoomA);
- // save Zoom-B
- cp.setPref(uri2, pref_name, zoomB);
- // make sure Zoom-B is retrievable
- do_check_eq(cp.getPref(uri2, pref_name), zoomB);
- // update Zoom-A
- cp.setPref(uri1, pref_name, zoomA_new);
- // make sure Zoom-A has changed
- do_check_eq(cp.getPref(uri1, pref_name), zoomA_new);
- // exit private browsing mode
- exitPBMode();
- // make sure Zoom-A change has not persisted
- do_check_eq(cp.getPref(uri1, pref_name), zoomA);
- // make sure Zoom-B change has not persisted
- do_check_eq(cp.hasPref(uri2, pref_name), false);
- } catch (e) {
- do_throw("Unexpected exception: " + e);
- }
-}
diff --git a/toolkit/components/contentprefs/tests/unit/test_bug503971.js b/toolkit/components/contentprefs/tests/unit/test_bug503971.js
deleted file mode 100644
index ccfe1d02b..000000000
--- a/toolkit/components/contentprefs/tests/unit/test_bug503971.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- var cps = new ContentPrefInstance(null);
-
- var uri = ContentPrefTest.getURI("http://www.example.com/");
-
- do_check_thrown(function () { cps.setPref(uri, null, 8); });
- do_check_thrown(function () { cps.hasPref(uri, null); });
- do_check_thrown(function () { cps.getPref(uri, null); });
- do_check_thrown(function () { cps.removePref(uri, null); });
- do_check_thrown(function () { cps.getPrefsByName(null); });
- do_check_thrown(function () { cps.removePrefsByName(null); });
-
- do_check_thrown(function () { cps.setPref(uri, "", 21); });
- do_check_thrown(function () { cps.hasPref(uri, ""); });
- do_check_thrown(function () { cps.getPref(uri, ""); });
- do_check_thrown(function () { cps.removePref(uri, ""); });
- do_check_thrown(function () { cps.getPrefsByName(""); });
- do_check_thrown(function () { cps.removePrefsByName(""); });
-}
-
-function do_check_thrown (aCallback) {
- var exThrown = false;
- try {
- aCallback();
- do_throw("NS_ERROR_ILLEGAL_VALUE should have been thrown here");
- } catch (e) {
- do_check_eq(e.result, Cr.NS_ERROR_ILLEGAL_VALUE);
- exThrown = true;
- }
- do_check_true(exThrown);
-}
diff --git a/toolkit/components/contentprefs/tests/unit/test_bug679784.js b/toolkit/components/contentprefs/tests/unit/test_bug679784.js
deleted file mode 100644
index 97251d87b..000000000
--- a/toolkit/components/contentprefs/tests/unit/test_bug679784.js
+++ /dev/null
@@ -1,103 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-
-var prefObserver = {
- setCalledNum: 0,
- onContentPrefSet: function(aGroup, aName, aValue) {
- this.setCalledNum++;
- },
- removedCalledNum: 0,
- onContentPrefRemoved: function(aGroup, aName) {
- this.removedCalledNum++;
- }
-};
-
-function run_test() {
- let loadContext = { get usePrivateBrowsing() { return gInPrivateBrowsing; } };
-
- var cps = new ContentPrefInstance(loadContext);
- cps.removeGroupedPrefs();
-
- var uri = ContentPrefTest.getURI("http://www.example.com/");
- var group = cps.grouper.group(uri);
-
- // first, set a pref in normal mode
- cps.setPref(uri, "value", "foo");
- cps.setPref(null, "value-global", "foo-global");
-
- var num;
- cps.addObserver("value", prefObserver);
- cps.addObserver("value-global", prefObserver);
-
- enterPBMode();
-
- // test setPref
- num = prefObserver.setCalledNum;
- cps.setPref(uri, "value", "foo-private-browsing");
- do_check_eq(cps.hasPref(uri, "value"), true);
- do_check_eq(cps.getPref(uri, "value"), "foo-private-browsing");
- do_check_eq(prefObserver.setCalledNum, num + 1);
-
- num = prefObserver.setCalledNum;
- cps.setPref(null, "value-global", "foo-private-browsing-global");
- do_check_eq(cps.hasPref(null, "value-global"), true);
- do_check_eq(cps.getPref(null, "value-global"), "foo-private-browsing-global");
- do_check_eq(prefObserver.setCalledNum, num + 1);
-
- // test removePref
- num = prefObserver.removedCalledNum;
- cps.removePref(uri, "value");
- do_check_eq(cps.hasPref(uri, "value"), true);
- // fallback to non private mode value
- do_check_eq(cps.getPref(uri, "value"), "foo");
- do_check_eq(prefObserver.removedCalledNum, num + 1);
-
- num = prefObserver.removedCalledNum;
- cps.removePref(null, "value-global");
- do_check_eq(cps.hasPref(null, "value-global"), true);
- // fallback to non private mode value
- do_check_eq(cps.getPref(null, "value-global"), "foo-global") ;
- do_check_eq(prefObserver.removedCalledNum, num + 1);
-
- // test removeGroupedPrefs
- cps.setPref(uri, "value", "foo-private-browsing");
- cps.removeGroupedPrefs();
- do_check_eq(cps.hasPref(uri, "value"), false);
- do_check_eq(cps.getPref(uri, "value"), undefined);
-
- cps.setPref(null, "value-global", "foo-private-browsing-global");
- cps.removeGroupedPrefs();
- do_check_eq(cps.hasPref(null, "value-global"), true);
- do_check_eq(cps.getPref(null, "value-global"), "foo-private-browsing-global");
-
- // test removePrefsByName
- num = prefObserver.removedCalledNum;
- cps.setPref(uri, "value", "foo-private-browsing");
- cps.removePrefsByName("value");
- do_check_eq(cps.hasPref(uri, "value"), false);
- do_check_eq(cps.getPref(uri, "value"), undefined);
- do_check_true(prefObserver.removedCalledNum > num);
-
- num = prefObserver.removedCalledNum;
- cps.setPref(null, "value-global", "foo-private-browsing");
- cps.removePrefsByName("value-global");
- do_check_eq(cps.hasPref(null, "value-global"), false);
- do_check_eq(cps.getPref(null, "value-global"), undefined);
- do_check_true(prefObserver.removedCalledNum > num);
-
- // test getPrefs
- cps.setPref(uri, "value", "foo-private-browsing");
- do_check_eq(cps.getPrefs(uri).getProperty("value"), "foo-private-browsing");
-
- cps.setPref(null, "value-global", "foo-private-browsing-global");
- do_check_eq(cps.getPrefs(null).getProperty("value-global"), "foo-private-browsing-global");
-
- // test getPrefsByName
- do_check_eq(cps.getPrefsByName("value").getProperty(group), "foo-private-browsing");
- do_check_eq(cps.getPrefsByName("value-global").getProperty(null), "foo-private-browsing-global");
-
- cps.removeObserver("value", prefObserver);
- cps.removeObserver("value-global", prefObserver);
-}
diff --git a/toolkit/components/contentprefs/tests/unit/test_contentPrefs.js b/toolkit/components/contentprefs/tests/unit/test_contentPrefs.js
deleted file mode 100644
index f7e99ea9d..000000000
--- a/toolkit/components/contentprefs/tests/unit/test_contentPrefs.js
+++ /dev/null
@@ -1,463 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- // Database Creation, Schema Migration, and Backup
-
- // Note: in these tests we use createInstance instead of getService
- // so we can instantiate the service multiple times and make it run
- // its database initialization code each time.
-
- // Create a new database.
- {
- ContentPrefTest.deleteDatabase();
-
- // Get the service and make sure it has a ready database connection.
- let cps = Cc["@mozilla.org/content-pref/service;1"].
- createInstance(Ci.nsIContentPrefService);
- do_check_true(cps.DBConnection.connectionReady);
- cps.DBConnection.close();
- }
-
- // Open an existing database.
- {
- let dbFile = ContentPrefTest.deleteDatabase();
-
- let cps = Cc["@mozilla.org/content-pref/service;1"].
- createInstance(Ci.nsIContentPrefService);
- cps.DBConnection.close();
- do_check_true(dbFile.exists());
-
- // Get the service and make sure it has a ready database connection.
- cps = Cc["@mozilla.org/content-pref/service;1"].
- createInstance(Ci.nsIContentPrefService);
- do_check_true(cps.DBConnection.connectionReady);
- cps.DBConnection.close();
- }
-
- // Open an empty database.
- {
- let dbFile = ContentPrefTest.deleteDatabase();
-
- // Create an empty database.
- let dbService = Cc["@mozilla.org/storage/service;1"].
- getService(Ci.mozIStorageService);
- let dbConnection = dbService.openDatabase(dbFile);
- do_check_eq(dbConnection.schemaVersion, 0);
- dbConnection.close();
- do_check_true(dbFile.exists());
-
- // Get the service and make sure it has created the schema.
- let cps = Cc["@mozilla.org/content-pref/service;1"].
- createInstance(Ci.nsIContentPrefService);
- do_check_neq(cps.DBConnection.schemaVersion, 0);
- cps.DBConnection.close();
- }
-
- // Open a corrupted database.
- {
- let dbFile = ContentPrefTest.deleteDatabase();
- let backupDBFile = ContentPrefTest.deleteBackupDatabase();
-
- // Create a corrupted database.
- let foStream = Cc["@mozilla.org/network/file-output-stream;1"].
- createInstance(Ci.nsIFileOutputStream);
- foStream.init(dbFile, 0x02 | 0x08 | 0x20, 0o666, 0);
- let garbageData = "garbage that makes SQLite think the file is corrupted";
- foStream.write(garbageData, garbageData.length);
- foStream.close();
-
- // Get the service and make sure it backs up and recreates the database.
- let cps = Cc["@mozilla.org/content-pref/service;1"].
- createInstance(Ci.nsIContentPrefService);
- do_check_true(backupDBFile.exists());
- do_check_true(cps.DBConnection.connectionReady);
-
- cps.DBConnection.close();
- }
-
- // Open a database with a corrupted schema.
- {
- let dbFile = ContentPrefTest.deleteDatabase();
- let backupDBFile = ContentPrefTest.deleteBackupDatabase();
-
- // Create an empty database and set the schema version to a number
- // that will trigger a schema migration that will fail.
- let dbService = Cc["@mozilla.org/storage/service;1"].
- getService(Ci.mozIStorageService);
- let dbConnection = dbService.openDatabase(dbFile);
- dbConnection.schemaVersion = -1;
- dbConnection.close();
- do_check_true(dbFile.exists());
-
- // Get the service and make sure it backs up and recreates the database.
- let cps = Cc["@mozilla.org/content-pref/service;1"].
- createInstance(Ci.nsIContentPrefService);
- do_check_true(backupDBFile.exists());
- do_check_true(cps.DBConnection.connectionReady);
-
- cps.DBConnection.close();
- }
-
-
- // Now get the content pref service for real for use by the rest of the tests.
- let cps = new ContentPrefInstance(null);
-
- var uri = ContentPrefTest.getURI("http://www.example.com/");
-
- // Make sure disk synchronization checking is turned off by default.
- var statement = cps.DBConnection.createStatement("PRAGMA synchronous");
- statement.executeStep();
- do_check_eq(0, statement.getInt32(0));
-
- // Nonexistent Pref
-
- do_check_eq(cps.getPref(uri, "test.nonexistent.getPref"), undefined);
- do_check_eq(cps.setPref(uri, "test.nonexistent.setPref", 5), undefined);
- do_check_false(cps.hasPref(uri, "test.nonexistent.hasPref"));
- do_check_eq(cps.removePref(uri, "test.nonexistent.removePref"), undefined);
-
-
- // Existing Pref
-
- cps.setPref(uri, "test.existing", 5);
-
- // getPref should return the pref value
- do_check_eq(cps.getPref(uri, "test.existing"), 5);
-
- // setPref should return undefined and change the value of the pref
- do_check_eq(cps.setPref(uri, "test.existing", 6), undefined);
- do_check_eq(cps.getPref(uri, "test.existing"), 6);
-
- // hasPref should return true
- do_check_true(cps.hasPref(uri, "test.existing"));
-
- // removePref should return undefined and remove the pref
- do_check_eq(cps.removePref(uri, "test.existing"), undefined);
- do_check_false(cps.hasPref(uri, "test.existing"));
-
-
- // Round-Trip Data Integrity
-
- // Make sure pref values remain the same from setPref to getPref.
-
- cps.setPref(uri, "test.data-integrity.integer", 5);
- do_check_eq(cps.getPref(uri, "test.data-integrity.integer"), 5);
-
- cps.setPref(uri, "test.data-integrity.float", 5.5);
- do_check_eq(cps.getPref(uri, "test.data-integrity.float"), 5.5);
-
- cps.setPref(uri, "test.data-integrity.boolean", true);
- do_check_eq(cps.getPref(uri, "test.data-integrity.boolean"), true);
-
- cps.setPref(uri, "test.data-integrity.string", "test");
- do_check_eq(cps.getPref(uri, "test.data-integrity.string"), "test");
-
- cps.setPref(uri, "test.data-integrity.null", null);
- do_check_eq(cps.getPref(uri, "test.data-integrity.null"), null);
-
- // XXX Test arbitrary binary data.
-
- // Make sure hasPref and removePref work on all data types.
-
- do_check_true(cps.hasPref(uri, "test.data-integrity.integer"));
- do_check_true(cps.hasPref(uri, "test.data-integrity.float"));
- do_check_true(cps.hasPref(uri, "test.data-integrity.boolean"));
- do_check_true(cps.hasPref(uri, "test.data-integrity.string"));
- do_check_true(cps.hasPref(uri, "test.data-integrity.null"));
-
- do_check_eq(cps.removePref(uri, "test.data-integrity.integer"), undefined);
- do_check_eq(cps.removePref(uri, "test.data-integrity.float"), undefined);
- do_check_eq(cps.removePref(uri, "test.data-integrity.boolean"), undefined);
- do_check_eq(cps.removePref(uri, "test.data-integrity.string"), undefined);
- do_check_eq(cps.removePref(uri, "test.data-integrity.null"), undefined);
-
- do_check_false(cps.hasPref(uri, "test.data-integrity.integer"));
- do_check_false(cps.hasPref(uri, "test.data-integrity.float"));
- do_check_false(cps.hasPref(uri, "test.data-integrity.boolean"));
- do_check_false(cps.hasPref(uri, "test.data-integrity.string"));
- do_check_false(cps.hasPref(uri, "test.data-integrity.null"));
-
-
- // getPrefs
-
- cps.setPref(uri, "test.getPrefs.a", 1);
- cps.setPref(uri, "test.getPrefs.b", 2);
- cps.setPref(uri, "test.getPrefs.c", 3);
-
- var prefs = cps.getPrefs(uri);
- do_check_true(prefs.hasKey("test.getPrefs.a"));
- do_check_eq(prefs.get("test.getPrefs.a"), 1);
- do_check_true(prefs.hasKey("test.getPrefs.b"));
- do_check_eq(prefs.get("test.getPrefs.b"), 2);
- do_check_true(prefs.hasKey("test.getPrefs.c"));
- do_check_eq(prefs.get("test.getPrefs.c"), 3);
-
-
- // Site-Specificity
-
- {
- // These are all different sites, and setting a pref for one of them
- // shouldn't set it for the others.
- let uri1 = ContentPrefTest.getURI("http://www.domain1.com/");
- let uri2 = ContentPrefTest.getURI("http://foo.domain1.com/");
- let uri3 = ContentPrefTest.getURI("http://domain1.com/");
- let uri4 = ContentPrefTest.getURI("http://www.domain2.com/");
-
- cps.setPref(uri1, "test.site-specificity.uri1", 5);
- do_check_false(cps.hasPref(uri2, "test.site-specificity.uri1"));
- do_check_false(cps.hasPref(uri3, "test.site-specificity.uri1"));
- do_check_false(cps.hasPref(uri4, "test.site-specificity.uri1"));
-
- cps.setPref(uri2, "test.site-specificity.uri2", 5);
- do_check_false(cps.hasPref(uri1, "test.site-specificity.uri2"));
- do_check_false(cps.hasPref(uri3, "test.site-specificity.uri2"));
- do_check_false(cps.hasPref(uri4, "test.site-specificity.uri2"));
-
- cps.setPref(uri3, "test.site-specificity.uri3", 5);
- do_check_false(cps.hasPref(uri1, "test.site-specificity.uri3"));
- do_check_false(cps.hasPref(uri2, "test.site-specificity.uri3"));
- do_check_false(cps.hasPref(uri4, "test.site-specificity.uri3"));
-
- cps.setPref(uri4, "test.site-specificity.uri4", 5);
- do_check_false(cps.hasPref(uri1, "test.site-specificity.uri4"));
- do_check_false(cps.hasPref(uri2, "test.site-specificity.uri4"));
- do_check_false(cps.hasPref(uri3, "test.site-specificity.uri4"));
- }
-
- // Observers
-
- var specificObserver = {
- interfaces: [Ci.nsIContentPrefObserver, Ci.nsISupports],
-
- QueryInterface: function ContentPrefTest_QueryInterface(iid) {
- if (!this.interfaces.some( function(v) { return iid.equals(v) } ))
- throw Cr.NS_ERROR_NO_INTERFACE;
- return this;
- },
-
- numTimesSetCalled: 0,
- onContentPrefSet: function specificObserver_onContentPrefSet(group, name, value) {
- ++this.numTimesSetCalled;
- do_check_eq(group, "www.example.com");
- do_check_eq(name, "test.observer.1");
- do_check_eq(value, "test value");
- },
-
- numTimesRemovedCalled: 0,
- onContentPrefRemoved: function specificObserver_onContentPrefRemoved(group, name) {
- ++this.numTimesRemovedCalled;
- do_check_eq(group, "www.example.com");
- do_check_eq(name, "test.observer.1");
- }
-
- };
-
- var genericObserver = {
- interfaces: [Ci.nsIContentPrefObserver, Ci.nsISupports],
-
- QueryInterface: function ContentPrefTest_QueryInterface(iid) {
- if (!this.interfaces.some( function(v) { return iid.equals(v) } ))
- throw Cr.NS_ERROR_NO_INTERFACE;
- return this;
- },
-
- numTimesSetCalled: 0,
- onContentPrefSet: function genericObserver_onContentPrefSet(group, name, value, isPrivate) {
- ++this.numTimesSetCalled;
- do_check_eq(group, "www.example.com");
- if (name == "test.observer.private")
- do_check_true(isPrivate);
- else if (name == "test.observer.normal")
- do_check_false(isPrivate);
- else if (name != "test.observer.1" && name != "test.observer.2")
- do_throw("genericObserver.onContentPrefSet: " +
- "name not in (test.observer.(1|2|normal|private))");
- do_check_eq(value, "test value");
- },
-
- numTimesRemovedCalled: 0,
- onContentPrefRemoved: function genericObserver_onContentPrefRemoved(group, name, isPrivate) {
- ++this.numTimesRemovedCalled;
- do_check_eq(group, "www.example.com");
- if (name == "test.observer.private")
- do_check_true(isPrivate);
- else if (name == "test.observer.normal")
- do_check_false(isPrivate);
- if (name != "test.observer.1" && name != "test.observer.2" &&
- name != "test.observer.normal" && name != "test.observer.private") {
- do_throw("genericObserver.onContentPrefSet: " +
- "name not in (test.observer.(1|2|normal|private))");
- }
- }
-
- };
-
- // Make sure we can add observers, observers get notified about changes,
- // specific observers only get notified about changes to the specific setting,
- // and generic observers get notified about changes to all settings.
- cps.addObserver("test.observer.1", specificObserver);
- cps.addObserver(null, genericObserver);
- cps.setPref(uri, "test.observer.1", "test value");
- cps.setPref(uri, "test.observer.2", "test value");
- cps.removePref(uri, "test.observer.1");
- cps.removePref(uri, "test.observer.2");
- do_check_eq(specificObserver.numTimesSetCalled, 1);
- do_check_eq(genericObserver.numTimesSetCalled, 2);
- do_check_eq(specificObserver.numTimesRemovedCalled, 1);
- do_check_eq(genericObserver.numTimesRemovedCalled, 2);
-
- // Make sure information about private context is properly
- // retrieved by the observer.
- cps.setPref(uri, "test.observer.private", "test value", {usePrivateBrowsing: true});
- cps.setPref(uri, "test.observer.normal", "test value", {usePrivateBrowsing: false});
- cps.removePref(uri, "test.observer.private");
- cps.removePref(uri, "test.observer.normal");
-
- // Make sure we can remove observers and they don't get notified
- // about changes anymore.
- cps.removeObserver("test.observer.1", specificObserver);
- cps.removeObserver(null, genericObserver);
- cps.setPref(uri, "test.observer.1", "test value");
- cps.removePref(uri, "test.observer.1", "test value");
- do_check_eq(specificObserver.numTimesSetCalled, 1);
- do_check_eq(genericObserver.numTimesSetCalled, 4);
- do_check_eq(specificObserver.numTimesRemovedCalled, 1);
- do_check_eq(genericObserver.numTimesRemovedCalled, 3);
-
-
- // Get/Remove Prefs By Name
-
- {
- var anObserver = {
- interfaces: [Ci.nsIContentPrefObserver, Ci.nsISupports],
-
- QueryInterface: function ContentPrefTest_QueryInterface(iid) {
- if (!this.interfaces.some( function(v) { return iid.equals(v) } ))
- throw Cr.NS_ERROR_NO_INTERFACE;
- return this;
- },
-
- onContentPrefSet: function anObserver_onContentPrefSet(group, name, value) {
- },
-
- expectedDomains: [],
- numTimesRemovedCalled: 0,
- onContentPrefRemoved: function anObserver_onContentPrefRemoved(group, name) {
- ++this.numTimesRemovedCalled;
-
- // remove the domain from the list of expected domains
- var index = this.expectedDomains.indexOf(group);
- do_check_true(index >= 0);
- this.expectedDomains.splice(index, 1);
- }
- };
-
- let uri1 = ContentPrefTest.getURI("http://www.domain1.com/");
- let uri2 = ContentPrefTest.getURI("http://foo.domain1.com/");
- let uri3 = ContentPrefTest.getURI("http://domain1.com/");
- let uri4 = ContentPrefTest.getURI("http://www.domain2.com/");
-
- cps.setPref(uri1, "test.byname.1", 1);
- cps.setPref(uri1, "test.byname.2", 2);
- cps.setPref(uri2, "test.byname.1", 4);
- cps.setPref(uri3, "test.byname.3", 8);
- cps.setPref(uri4, "test.byname.1", 16);
- cps.setPref(null, "test.byname.1", 32);
- cps.setPref(null, "test.byname.2", false);
-
- function enumerateAndCheck(testName, expectedSum, expectedDomains) {
- var prefsByName = cps.getPrefsByName(testName);
- var enumerator = prefsByName.enumerator;
- var sum = 0;
- while (enumerator.hasMoreElements()) {
- var property = enumerator.getNext().QueryInterface(Components.interfaces.nsIProperty);
- sum += parseInt(property.value);
-
- // remove the domain from the list of expected domains
- var index = expectedDomains.indexOf(property.name);
- do_check_true(index >= 0);
- expectedDomains.splice(index, 1);
- }
- do_check_eq(sum, expectedSum);
- // check all domains have been removed from the array
- do_check_eq(expectedDomains.length, 0);
- }
-
- enumerateAndCheck("test.byname.1", 53,
- ["foo.domain1.com", null, "www.domain1.com", "www.domain2.com"]);
- enumerateAndCheck("test.byname.2", 2, ["www.domain1.com", null]);
- enumerateAndCheck("test.byname.3", 8, ["domain1.com"]);
-
- cps.addObserver("test.byname.1", anObserver);
- anObserver.expectedDomains = ["foo.domain1.com", null, "www.domain1.com", "www.domain2.com"];
-
- cps.removePrefsByName("test.byname.1");
- do_check_false(cps.hasPref(uri1, "test.byname.1"));
- do_check_false(cps.hasPref(uri2, "test.byname.1"));
- do_check_false(cps.hasPref(uri3, "test.byname.1"));
- do_check_false(cps.hasPref(uri4, "test.byname.1"));
- do_check_false(cps.hasPref(null, "test.byname.1"));
- do_check_true(cps.hasPref(uri1, "test.byname.2"));
- do_check_true(cps.hasPref(uri3, "test.byname.3"));
-
- do_check_eq(anObserver.numTimesRemovedCalled, 4);
- do_check_eq(anObserver.expectedDomains.length, 0);
-
- cps.removeObserver("test.byname.1", anObserver);
-
- // Clean up after ourselves
- cps.removePref(uri1, "test.byname.2");
- cps.removePref(uri3, "test.byname.3");
- cps.removePref(null, "test.byname.2");
- }
-
-
- // Clear Private Data Pref Removal
-
- {
- let uri1 = ContentPrefTest.getURI("http://www.domain1.com/");
- let uri2 = ContentPrefTest.getURI("http://www.domain2.com/");
- let uri3 = ContentPrefTest.getURI("http://www.domain3.com/");
-
- let dbConnection = cps.DBConnection;
-
- let prefCount = dbConnection.createStatement("SELECT COUNT(*) AS count FROM prefs");
-
- let groupCount = dbConnection.createStatement("SELECT COUNT(*) AS count FROM groups");
-
- // Add some prefs for multiple domains.
- cps.setPref(uri1, "test.removeAllGroups", 1);
- cps.setPref(uri2, "test.removeAllGroups", 2);
- cps.setPref(uri3, "test.removeAllGroups", 3);
-
- // Add a global pref.
- cps.setPref(null, "test.removeAllGroups", 1);
-
- // Make sure there are some prefs and groups in the database.
- prefCount.executeStep();
- do_check_true(prefCount.row.count > 0);
- prefCount.reset();
- groupCount.executeStep();
- do_check_true(groupCount.row.count > 0);
- groupCount.reset();
-
- // Remove all prefs and groups from the database using the same routine
- // the Clear Private Data dialog uses.
- cps.removeGroupedPrefs();
-
- // Make sure there are no longer any groups in the database and the only pref
- // is the global one.
- prefCount.executeStep();
- do_check_true(prefCount.row.count == 1);
- prefCount.reset();
- groupCount.executeStep();
- do_check_true(groupCount.row.count == 0);
- groupCount.reset();
- let globalPref = dbConnection.createStatement("SELECT groupID FROM prefs");
- globalPref.executeStep();
- do_check_true(globalPref.row.groupID == null);
- globalPref.reset();
- }
-}
diff --git a/toolkit/components/contentprefs/tests/unit/test_contentPrefsCache.js b/toolkit/components/contentprefs/tests/unit/test_contentPrefsCache.js
deleted file mode 100644
index 38a2faddc..000000000
--- a/toolkit/components/contentprefs/tests/unit/test_contentPrefsCache.js
+++ /dev/null
@@ -1,244 +0,0 @@
-/*
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-var cps = new ContentPrefInstance(null);
-
-function run_test() {
- testCacheWorks("test1.example.com", "test-pref1");
- testHasCachedPrefFunction("test2.example.com", "test-pref2");
- testSetCaches("test3.example.com", "test-pref3");
- testGetCaches("test4.example.com", "test-pref4");
- testRemovePrefs("test5.example.com", "test-pref5");
- testTypeConversions("test6.example.com", "test-pref6");
- testNonExistingPrefCachesAsUndefined("test7.example.com", "test-pref7");
- testCacheEviction("test8.example.com", "test-pref8");
-}
-
-function testCacheWorks(uri, prefName) {
- const CACHED_VALUE = 3;
- const NEW_VALUE = 5;
-
- cps.setPref(uri, prefName, CACHED_VALUE);
- do_check_eq(cps.getPref(uri, prefName), CACHED_VALUE);
-
- // Now change the value directly through the DB and check
- // that the cached value is different
-
- let groupId = selectValue("SELECT id FROM groups WHERE name = :param1", "id", uri);
- let settingId = selectValue("SELECT id FROM settings WHERE name = :param1", "id", prefName);
- let prefId = selectValue("SELECT id FROM prefs WHERE groupID = :param1 AND settingID = :param2",
- "id", groupId, settingId);
-
- let stmt = cps.DBConnection.createStatement("UPDATE prefs SET value = :value WHERE id = :id");
- stmt.params.value = NEW_VALUE;
- stmt.params.id = prefId;
- stmt.execute();
-
- let dbValue = selectValue("SELECT value FROM prefs WHERE id = :param1", "value", prefId);
- let cacheValue = cps.getPref(uri, prefName);
-
- do_check_eq(dbValue, NEW_VALUE);
- do_check_eq(cacheValue, CACHED_VALUE);
- do_check_neq(cacheValue, dbValue);
-
- do_test_pending();
- cps.getPref(uri, prefName, function (value) {
- do_check_eq(dbValue, NEW_VALUE);
- do_check_eq(value, CACHED_VALUE);
- do_check_neq(value, dbValue);
- do_test_finished();
- });
-}
-
-function testHasCachedPrefFunction(uri, prefName) {
- const STARTING_VALUE = 3;
- const NEW_VALUE = 5;
-
- do_check_false(isCached(uri, prefName));
-
- cps.setPref(uri, prefName, STARTING_VALUE);
-
- let groupId = selectValue("SELECT id FROM groups WHERE name = :param1", "id", uri);
- let settingId = selectValue("SELECT id FROM settings WHERE name = :param1", "id", prefName);
- let prefId = selectValue("SELECT id FROM prefs WHERE groupID = :param1 AND settingID = :param2",
- "id", groupId, settingId);
-
- do_check_neq(prefId, undefined);
-
- let originalValue = selectValue("SELECT value FROM prefs WHERE id = :param1", "value", prefId);
- do_check_eq(originalValue, STARTING_VALUE);
-
- let stmt = cps.DBConnection.createStatement("UPDATE prefs SET value = :value WHERE id = :id");
- stmt.params.value = NEW_VALUE;
- stmt.params.id = prefId;
- stmt.execute();
-
- let newValue = selectValue("SELECT value FROM prefs WHERE id = :param1", "value", prefId);
- do_check_eq(newValue, NEW_VALUE);
-
- let cachedValue = cps.getPref(uri, prefName);
- do_check_eq(cachedValue, STARTING_VALUE);
- do_check_true(isCached(uri, prefName));
-}
-
-function testSetCaches(uri, prefName) {
- cps.setPref(uri, prefName, 0);
- do_check_true(isCached(uri, prefName));
-}
-
-function testRemovePrefs(uri, prefName) {
-
- /* removePref */
- cps.setPref("www1." + uri, prefName, 1);
-
- do_check_eq(cps.getPref("www1." + uri, prefName), 1);
-
- cps.removePref("www1." + uri, prefName);
-
- do_check_false(isCached("www1." + uri, prefName));
- do_check_false(cps.hasPref("www1." + uri, prefName));
- do_check_neq(cps.getPref("www1." + uri, prefName), 1);
-
- /* removeGroupedPrefs */
- cps.setPref("www2." + uri, prefName, 2);
- cps.setPref("www3." + uri, prefName, 3);
-
- do_check_eq(cps.getPref("www2." + uri, prefName), 2);
- do_check_eq(cps.getPref("www3." + uri, prefName), 3);
-
- cps.removeGroupedPrefs();
-
- do_check_false(isCached("www2." + uri, prefName));
- do_check_false(isCached("www3." + uri, prefName));
- do_check_false(cps.hasPref("www2." + uri, prefName));
- do_check_false(cps.hasPref("www3." + uri, prefName));
- do_check_neq(cps.getPref("www2." + uri, prefName), 2);
- do_check_neq(cps.getPref("www3." + uri, prefName), 3);
-
- /* removePrefsByName */
- cps.setPref("www4." + uri, prefName, 4);
- cps.setPref("www5." + uri, prefName, 5);
-
- do_check_eq(cps.getPref("www4." + uri, prefName), 4);
- do_check_eq(cps.getPref("www5." + uri, prefName), 5);
-
- cps.removePrefsByName(prefName);
-
- do_check_false(isCached("www4." + uri, prefName));
- do_check_false(isCached("www5." + uri, prefName));
- do_check_false(cps.hasPref("www4." + uri, prefName));
- do_check_false(cps.hasPref("www5." + uri, prefName));
- do_check_neq(cps.getPref("www4." + uri, prefName), 4);
- do_check_neq(cps.getPref("www5." + uri, prefName), 5);
-}
-
-function testGetCaches(uri, prefName) {
- const VALUE = 4;
-
- let insertGroup = cps.DBConnection.createStatement("INSERT INTO groups (name) VALUES (:name)");
- insertGroup.params.name = uri;
- insertGroup.execute();
- let groupId = cps.DBConnection.lastInsertRowID;
-
- let insertSetting = cps.DBConnection.createStatement("INSERT INTO settings (name) VALUES (:name)");
- insertSetting.params.name = prefName;
- insertSetting.execute();
- let settingId = cps.DBConnection.lastInsertRowID;
-
- let insertPref = cps.DBConnection.createStatement(`
- INSERT INTO prefs (groupID, settingID, value)
- VALUES (:groupId, :settingId, :value)
- `);
- insertPref.params.groupId = groupId;
- insertPref.params.settingId = settingId;
- insertPref.params.value = VALUE;
- insertPref.execute();
- let prefId = cps.DBConnection.lastInsertRowID;
-
- let dbValue = selectValue("SELECT value FROM prefs WHERE id = :param1", "value", prefId);
-
- // First access from service should hit the DB
- let svcValue = cps.getPref(uri, prefName);
-
- // Second time should get the value from cache
- let cacheValue = cps.getPref(uri, prefName);
-
- do_check_eq(VALUE, dbValue);
- do_check_eq(VALUE, svcValue);
- do_check_eq(VALUE, cacheValue);
-
- do_check_true(isCached(uri, prefName));
-}
-
-function testTypeConversions(uri, prefName) {
- let value;
-
- cps.setPref(uri, prefName, true);
- value = cps.getPref(uri, prefName);
- do_check_true(value === 1);
-
- cps.setPref(uri, prefName, false);
- value = cps.getPref(uri, prefName);
- do_check_true(value === 0);
-
- cps.setPref(uri, prefName, null);
- value = cps.getPref(uri, prefName);
- do_check_true(value === null);
-
- cps.setPref(uri, prefName, undefined);
- value = cps.getPref(uri, prefName);
- do_check_true(value === null);
-}
-
-function testNonExistingPrefCachesAsUndefined(uri, prefName) {
-
- do_check_false(isCached(uri, prefName));
-
- // Cache the pref
- let value = cps.getPref(uri, prefName);
- do_check_true(value === undefined);
-
- do_check_true(isCached(uri, prefName));
-
- // Cached pref
- value = cps.getPref(uri, prefName);
- do_check_true(value === undefined);
-}
-
-function testCacheEviction(uri, prefName) {
-
- cps.setPref(uri, prefName, 5);
- do_check_eq(cps.getPref(uri, prefName), 5);
- do_check_true(isCached(uri, prefName));
-
- // try to evict value from cache by adding various other entries
- const ENTRIES_TO_ADD = 200;
- for (let i = 0; i < ENTRIES_TO_ADD; i++) {
- let uriToAdd = "www" + i + uri;
- cps.setPref(uriToAdd, prefName, 0);
- }
-
- do_check_false(isCached(uri, prefName));
-
-}
-
-function selectValue(stmt, columnName, param1, param2) {
- stmt = cps.DBConnection.createStatement(stmt);
- if (param1)
- stmt.params.param1 = param1;
-
- if (param2)
- stmt.params.param2 = param2;
-
- stmt.executeStep();
- let val = stmt.row[columnName];
- stmt.reset();
- stmt.finalize();
- return val;
-}
-
-function isCached(uri, prefName) {
- return cps.hasCachedPref(uri, prefName);
-}
diff --git a/toolkit/components/contentprefs/tests/unit/test_getPrefAsync.js b/toolkit/components/contentprefs/tests/unit/test_getPrefAsync.js
deleted file mode 100644
index 27d239f79..000000000
--- a/toolkit/components/contentprefs/tests/unit/test_getPrefAsync.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-var cps = new ContentPrefInstance(null);
-var uri = ContentPrefTest.getURI("http://www.example.com/");
-
-function run_test() {
- do_test_pending();
-
- cps.setPref(uri, "asynctest", "pie");
- do_check_eq(cps.getPref(uri, "asynctest"), "pie");
-
- cps.getPref(uri, "asynctest", function(aValue) {
- do_check_eq(aValue, "pie");
- testCallbackObj();
- });
-}
-
-function testCallbackObj() {
- cps.getPref(uri, "asynctest", {
- onResult: function(aValue) {
- do_check_eq(aValue, "pie");
- cps.removePref(uri, "asynctest");
- testNoResult();
- }
- });
-}
-
-function testNoResult() {
- cps.getPref(uri, "asynctest", function(aValue) {
- do_check_eq(aValue, undefined);
- do_test_finished();
- });
-}
diff --git a/toolkit/components/contentprefs/tests/unit/test_stringGroups.js b/toolkit/components/contentprefs/tests/unit/test_stringGroups.js
deleted file mode 100644
index afce3b64a..000000000
--- a/toolkit/components/contentprefs/tests/unit/test_stringGroups.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
-
- var cps = new ContentPrefInstance(null);
-
- // Make sure disk synchronization checking is turned off by default.
- var statement = cps.DBConnection.createStatement("PRAGMA synchronous");
- statement.executeStep();
- do_check_eq(0, statement.getInt32(0));
-
- // These are the different types of aGroup arguments we'll test.
- var anObject = {"foo":"bar"}; // a simple object
- var uri = ContentPrefTest.getURI("http://www.example.com/"); // nsIURI
- var stringURI = "www.example.com"; // typeof = "string"
- var stringObjectURI = new String("www.example.com"); // typeof = "object"
-
- {
- // First check that all the methods work or don't work.
- function simple_test_methods(aGroup, shouldThrow) {
- var prefName = "test.pref.0";
- var prefValue = Math.floor(Math.random() * 100);
-
- if (shouldThrow) {
- do_check_thrown(function () { cps.getPref(aGroup, prefName); });
- do_check_thrown(function () { cps.setPref(aGroup, prefName, prefValue); });
- do_check_thrown(function () { cps.hasPref(aGroup, prefName); });
- do_check_thrown(function () { cps.removePref(aGroup, prefName); });
- do_check_thrown(function () { cps.getPrefs(aGroup); });
- } else {
- do_check_eq(cps.setPref(aGroup, prefName, prefValue), undefined);
- do_check_true(cps.hasPref(aGroup, prefName));
- do_check_eq(cps.getPref(aGroup, prefName), prefValue);
- do_check_eq(cps.removePref(aGroup, prefName), undefined);
- do_check_false(cps.hasPref(aGroup, prefName));
- }
- }
-
- simple_test_methods(cps, true); // arbitrary nsISupports object, should throw too
- simple_test_methods(anObject, true);
- simple_test_methods(uri, false);
- simple_test_methods(stringURI, false);
- simple_test_methods(stringObjectURI, false);
- }
-
- {
- // Now we'll check that each argument produces the same result.
- function complex_test_methods(aGroup) {
- var prefName = "test.pref.1";
- var prefValue = Math.floor(Math.random() * 100);
-
- do_check_eq(cps.setPref(aGroup, prefName, prefValue), undefined);
-
- do_check_true(cps.hasPref(uri, prefName));
- do_check_true(cps.hasPref(stringURI, prefName));
- do_check_true(cps.hasPref(stringObjectURI, prefName));
-
- do_check_eq(cps.getPref(uri, prefName), prefValue);
- do_check_eq(cps.getPref(stringURI, prefName), prefValue);
- do_check_eq(cps.getPref(stringObjectURI, prefName), prefValue);
-
- do_check_eq(cps.removePref(aGroup, prefName), undefined);
-
- do_check_false(cps.hasPref(uri, prefName));
- do_check_false(cps.hasPref(stringURI, prefName));
- do_check_false(cps.hasPref(stringObjectURI, prefName));
- }
-
- complex_test_methods(uri);
- complex_test_methods(stringURI);
- complex_test_methods(stringObjectURI);
- }
-
- {
- // test getPrefs returns the same prefs
- do_check_eq(cps.setPref(stringObjectURI, "test.5", 5), undefined);
- do_check_eq(cps.setPref(stringURI, "test.2", 2), undefined);
- do_check_eq(cps.setPref(uri, "test.1", 1), undefined);
-
- enumerateAndCheck(cps.getPrefs(uri), 8, ["test.1", "test.2", "test.5"]);
- enumerateAndCheck(cps.getPrefs(stringURI), 8, ["test.1", "test.2", "test.5"]);
- enumerateAndCheck(cps.getPrefs(stringObjectURI), 8, ["test.1", "test.2", "test.5"]);
-
- do_check_eq(cps.setPref(uri, "test.4", 4), undefined);
- do_check_eq(cps.setPref(stringObjectURI, "test.0", 0), undefined);
-
- enumerateAndCheck(cps.getPrefs(uri), 12, ["test.0", "test.1", "test.2", "test.4", "test.5"]);
- enumerateAndCheck(cps.getPrefs(stringURI), 12, ["test.0", "test.1", "test.2", "test.4", "test.5"]);
- enumerateAndCheck(cps.getPrefs(stringObjectURI), 12, ["test.0", "test.1", "test.2", "test.4", "test.5"]);
-
- do_check_eq(cps.setPref(stringURI, "test.3", 3), undefined);
-
- enumerateAndCheck(cps.getPrefs(uri), 15, ["test.0", "test.1", "test.2", "test.3", "test.4", "test.5"]);
- enumerateAndCheck(cps.getPrefs(stringURI), 15, ["test.0", "test.1", "test.2", "test.3", "test.4", "test.5"]);
- enumerateAndCheck(cps.getPrefs(stringObjectURI), 15, ["test.0", "test.1", "test.2", "test.3", "test.4", "test.5"]);
- }
-}
-
-function do_check_thrown (aCallback) {
- var exThrown = false;
- try {
- aCallback();
- do_throw("NS_ERROR_ILLEGAL_VALUE should have been thrown here");
- } catch (e) {
- do_check_eq(e.result, Cr.NS_ERROR_ILLEGAL_VALUE);
- exThrown = true;
- }
- do_check_true(exThrown);
-}
-
-function enumerateAndCheck(prefs, expectedSum, expectedNames) {
- var enumerator = prefs.enumerator;
- var sum = 0;
- while (enumerator.hasMoreElements()) {
- var property = enumerator.getNext().QueryInterface(Components.interfaces.nsIProperty);
- sum += parseInt(property.value);
-
- // remove the pref name from the list of expected names
- var index = expectedNames.indexOf(property.name);
- do_check_true(index >= 0);
- expectedNames.splice(index, 1);
- }
- do_check_eq(sum, expectedSum);
- // check all pref names have been removed from the array
- do_check_eq(expectedNames.length, 0);
-}
diff --git a/toolkit/components/contentprefs/tests/unit/test_unusedGroupsAndSettings.js b/toolkit/components/contentprefs/tests/unit/test_unusedGroupsAndSettings.js
deleted file mode 100644
index 24a86bcc0..000000000
--- a/toolkit/components/contentprefs/tests/unit/test_unusedGroupsAndSettings.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var cps = new ContentPrefInstance(null);
-
-function run_test() {
- var uri1 = ContentPrefTest.getURI("http://www.domain1.com/");
- var uri2 = ContentPrefTest.getURI("http://foo.domain1.com/");
- var uri3 = ContentPrefTest.getURI("http://domain1.com/");
- var uri4 = ContentPrefTest.getURI("http://www.domain2.com/");
-
- cps.setPref(uri1, "one", 1);
- cps.setPref(uri1, "two", 2);
- cps.setPref(uri2, "one", 4);
- cps.setPref(uri3, "three", 8);
- cps.setPref(uri4, "two", 16);
-
- cps.removePref(uri3, "three"); // uri3 should be removed now
- checkForUnusedGroups();
- checkForUnusedSettings();
-
- cps.removePrefsByName("two"); // uri4 should be removed now
- checkForUnusedGroups();
- checkForUnusedSettings();
-
- cps.removeGroupedPrefs();
- checkForUnusedGroups();
- checkForUnusedSettings();
-}
-
-function checkForUnusedGroups() {
- var stmt = cps.DBConnection.createStatement(`
- SELECT COUNT(*) AS count FROM groups
- WHERE id NOT IN (SELECT DISTINCT groupID FROM prefs)
- `);
- stmt.executeStep();
- do_check_eq(0, stmt.row.count);
- stmt.reset();
- stmt.finalize();
-}
-
-function checkForUnusedSettings() {
- var stmt = cps.DBConnection.createStatement(`
- SELECT COUNT(*) AS count FROM settings
- WHERE id NOT IN (SELECT DISTINCT settingID FROM prefs)
- `);
- stmt.executeStep();
- do_check_eq(0, stmt.row.count);
- stmt.reset();
- stmt.finalize();
-}
diff --git a/toolkit/components/contentprefs/tests/unit/xpcshell.ini b/toolkit/components/contentprefs/tests/unit/xpcshell.ini
deleted file mode 100644
index cbae178b1..000000000
--- a/toolkit/components/contentprefs/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,12 +0,0 @@
-[DEFAULT]
-head = head_contentPrefs.js
-tail = tail_contentPrefs.js
-
-[test_bug248970.js]
-[test_bug503971.js]
-[test_bug679784.js]
-[test_contentPrefs.js]
-[test_contentPrefsCache.js]
-[test_getPrefAsync.js]
-[test_stringGroups.js]
-[test_unusedGroupsAndSettings.js]
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/.eslintrc.js b/toolkit/components/contentprefs/tests/unit_cps2/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/AsyncRunner.jsm b/toolkit/components/contentprefs/tests/unit_cps2/AsyncRunner.jsm
deleted file mode 100644
index ac878c28c..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/AsyncRunner.jsm
+++ /dev/null
@@ -1,69 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var EXPORTED_SYMBOLS = [
- "AsyncRunner",
-];
-
-const { interfaces: Ci, classes: Cc } = Components;
-
-function AsyncRunner(callbacks) {
- this._callbacks = callbacks;
- this._iteratorQueue = [];
-
- // This catches errors reported to the console, e.g., via Cu.reportError.
- Cc["@mozilla.org/consoleservice;1"].
- getService(Ci.nsIConsoleService).
- registerListener(this);
-}
-
-AsyncRunner.prototype = {
-
- appendIterator: function AR_appendIterator(iter) {
- this._iteratorQueue.push(iter);
- },
-
- next: function AR_next(arg) {
- if (!this._iteratorQueue.length) {
- this.destroy();
- this._callbacks.done();
- return;
- }
-
- try {
- var { done, value } = this._iteratorQueue[0].next(arg);
- if (done) {
- this._iteratorQueue.shift();
- this.next();
- return;
- }
- }
- catch (err) {
- this._callbacks.error(err);
- }
-
- // val is truthy => call next
- // val is an iterator => prepend it to the queue and start on it
- if (value) {
- if (typeof(value) != "boolean")
- this._iteratorQueue.unshift(value);
- this.next();
- }
- },
-
- destroy: function AR_destroy() {
- Cc["@mozilla.org/consoleservice;1"].
- getService(Ci.nsIConsoleService).
- unregisterListener(this);
- this.destroy = function AR_alreadyDestroyed() {};
- },
-
- observe: function AR_consoleServiceListener(msg) {
- if (msg instanceof Ci.nsIScriptError &&
- !(msg.flags & Ci.nsIScriptError.warningFlag))
- {
- this._callbacks.consoleError(msg);
- }
- },
-};
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/head.js b/toolkit/components/contentprefs/tests/unit_cps2/head.js
deleted file mode 100644
index b86abe208..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/head.js
+++ /dev/null
@@ -1,401 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var { interfaces: Ci, classes: Cc, results: Cr, utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-var cps;
-var asyncRunner;
-var next;
-
-(function init() {
- // There has to be a profile directory before the CPS service is gotten.
- do_get_profile();
-})();
-
-function runAsyncTests(tests, dontResetBefore = false) {
- do_test_pending();
-
- cps = Cc["@mozilla.org/content-pref/service;1"].
- getService(Ci.nsIContentPrefService2);
-
- let s = {};
- Cu.import("resource://test/AsyncRunner.jsm", s);
- asyncRunner = new s.AsyncRunner({
- done: do_test_finished,
- error: function (err) {
- // xpcshell test functions like equal throw NS_ERROR_ABORT on
- // failure. Ignore those and catch only uncaught exceptions.
- if (err !== Cr.NS_ERROR_ABORT) {
- if (err.stack) {
- err = err + "\n\nTraceback (most recent call first):\n" + err.stack +
- "\nUseless do_throw stack:";
- }
- do_throw(err);
- }
- },
- consoleError: function (scriptErr) {
- // Previously, this code checked for console errors related to the test,
- // and treated them as failures. This was problematic, because our current
- // very-broken exception reporting machinery in XPCWrappedJSClass reports
- // errors to the console even if there's actually JS on the stack above
- // that will catch them. And a lot of the tests here intentionally trigger
- // error conditions on the JS-implemented XPCOM component (see erroneous()
- // in test_getSubdomains.js, for example). In the old world, we got lucky,
- // and the errors were never reported to the console due to happenstantial
- // JSContext reasons that aren't really worth going into.
- //
- // So. We make sure to dump this stuff so that it shows up in the logs, but
- // don't turn them into duplicate failures of the exception that was already
- // propagated to the caller.
- dump("AsyncRunner.jsm observed console error: " + scriptErr + "\n");
- }
- });
-
- next = asyncRunner.next.bind(asyncRunner);
-
- do_register_cleanup(function () {
- asyncRunner.destroy();
- asyncRunner = null;
- });
-
- tests.forEach(function (test) {
- function* gen() {
- do_print("Running " + test.name);
- yield test();
- yield reset();
- }
- asyncRunner.appendIterator(gen());
- });
-
- // reset() ends up calling asyncRunner.next(), starting the tests.
- if (dontResetBefore) {
- next();
- } else {
- reset();
- }
-}
-
-function makeCallback(callbacks, success = null) {
- callbacks = callbacks || {};
- if (!callbacks.handleError) {
- callbacks.handleError = function (error) {
- do_throw("handleError call was not expected, error: " + error);
- };
- }
- if (!callbacks.handleResult) {
- callbacks.handleResult = function() {
- do_throw("handleResult call was not expected");
- };
- }
- if (!callbacks.handleCompletion)
- callbacks.handleCompletion = function (reason) {
- equal(reason, Ci.nsIContentPrefCallback2.COMPLETE_OK);
- if (success) {
- success();
- } else {
- next();
- }
- };
- return callbacks;
-}
-
-function do_check_throws(fn) {
- let threw = false;
- try {
- fn();
- }
- catch (err) {
- threw = true;
- }
- ok(threw);
-}
-
-function sendMessage(msg, callback) {
- let obj = callback || {};
- let ref = Cu.getWeakReference(obj);
- cps.QueryInterface(Ci.nsIObserver).observe(ref, "test:" + msg, null);
- return "value" in obj ? obj.value : undefined;
-}
-
-function reset() {
- sendMessage("reset", next);
-}
-
-function setWithDate(group, name, val, timestamp, context) {
- function updateDate() {
- let db = sendMessage("db");
- let stmt = db.createAsyncStatement(`
- UPDATE prefs SET timestamp = :timestamp
- WHERE
- settingID = (SELECT id FROM settings WHERE name = :name)
- AND groupID = (SELECT id FROM groups WHERE name = :group)
- `);
- stmt.params.timestamp = timestamp / 1000;
- stmt.params.name = name;
- stmt.params.group = group;
-
- stmt.executeAsync({
- handleCompletion: function (reason) {
- next();
- },
- handleError: function (err) {
- do_throw(err);
- }
- });
- stmt.finalize();
- }
-
- cps.set(group, name, val, context, makeCallback(null, updateDate));
-}
-
-function getDate(group, name, context) {
- let db = sendMessage("db");
- let stmt = db.createAsyncStatement(`
- SELECT timestamp FROM prefs
- WHERE
- settingID = (SELECT id FROM settings WHERE name = :name)
- AND groupID = (SELECT id FROM groups WHERE name = :group)
- `);
- stmt.params.name = name;
- stmt.params.group = group;
-
- let res;
- stmt.executeAsync({
- handleResult: function (results) {
- let row = results.getNextRow();
- res = row.getResultByName("timestamp");
- },
- handleCompletion: function (reason) {
- next(res * 1000);
- },
- handleError: function (err) {
- do_throw(err);
- }
- });
- stmt.finalize();
-}
-
-function set(group, name, val, context) {
- cps.set(group, name, val, context, makeCallback());
-}
-
-function setGlobal(name, val, context) {
- cps.setGlobal(name, val, context, makeCallback());
-}
-
-function prefOK(actual, expected, strict) {
- ok(actual instanceof Ci.nsIContentPref);
- equal(actual.domain, expected.domain);
- equal(actual.name, expected.name);
- if (strict)
- strictEqual(actual.value, expected.value);
- else
- equal(actual.value, expected.value);
-}
-
-function* getOK(args, expectedVal, expectedGroup, strict) {
- if (args.length == 2)
- args.push(undefined);
- let expectedPrefs = expectedVal === undefined ? [] :
- [{ domain: expectedGroup || args[0],
- name: args[1],
- value: expectedVal }];
- yield getOKEx("getByDomainAndName", args, expectedPrefs, strict);
-}
-
-function* getSubdomainsOK(args, expectedGroupValPairs) {
- if (args.length == 2)
- args.push(undefined);
- let expectedPrefs = expectedGroupValPairs.map(function ([group, val]) {
- return { domain: group, name: args[1], value: val };
- });
- yield getOKEx("getBySubdomainAndName", args, expectedPrefs);
-}
-
-function* getGlobalOK(args, expectedVal) {
- if (args.length == 1)
- args.push(undefined);
- let expectedPrefs = expectedVal === undefined ? [] :
- [{ domain: null, name: args[0], value: expectedVal }];
- yield getOKEx("getGlobal", args, expectedPrefs);
-}
-
-function* getOKEx(methodName, args, expectedPrefs, strict, context) {
- let actualPrefs = [];
- args.push(makeCallback({
- handleResult: pref => actualPrefs.push(pref)
- }));
- yield cps[methodName].apply(cps, args);
- arraysOfArraysOK([actualPrefs], [expectedPrefs], function (actual, expected) {
- prefOK(actual, expected, strict);
- });
-}
-
-function getCachedOK(args, expectedIsCached, expectedVal, expectedGroup,
- strict) {
- if (args.length == 2)
- args.push(undefined);
- let expectedPref = !expectedIsCached ? null : {
- domain: expectedGroup || args[0],
- name: args[1],
- value: expectedVal
- };
- getCachedOKEx("getCachedByDomainAndName", args, expectedPref, strict);
-}
-
-function getCachedSubdomainsOK(args, expectedGroupValPairs) {
- if (args.length == 2)
- args.push(undefined);
- let len = {};
- args.push(len);
- let actualPrefs = cps.getCachedBySubdomainAndName.apply(cps, args);
- actualPrefs = actualPrefs.sort(function (a, b) {
- return a.domain.localeCompare(b.domain);
- });
- equal(actualPrefs.length, len.value);
- let expectedPrefs = expectedGroupValPairs.map(function ([group, val]) {
- return { domain: group, name: args[1], value: val };
- });
- arraysOfArraysOK([actualPrefs], [expectedPrefs], prefOK);
-}
-
-function getCachedGlobalOK(args, expectedIsCached, expectedVal) {
- if (args.length == 1)
- args.push(undefined);
- let expectedPref = !expectedIsCached ? null : {
- domain: null,
- name: args[0],
- value: expectedVal
- };
- getCachedOKEx("getCachedGlobal", args, expectedPref);
-}
-
-function getCachedOKEx(methodName, args, expectedPref, strict) {
- let actualPref = cps[methodName].apply(cps, args);
- if (expectedPref)
- prefOK(actualPref, expectedPref, strict);
- else
- strictEqual(actualPref, null);
-}
-
-function arraysOK(actual, expected, cmp) {
- if (actual.length != expected.length) {
- do_throw("Length is not equal: " + JSON.stringify(actual) + "==" + JSON.stringify(expected));
- } else {
- actual.forEach(function (actualElt, j) {
- let expectedElt = expected[j];
- cmp(actualElt, expectedElt);
- });
- }
-}
-
-function arraysOfArraysOK(actual, expected, cmp) {
- cmp = cmp || equal;
- arraysOK(actual, expected, function (act, exp) {
- arraysOK(act, exp, cmp)
- });
-}
-
-function dbOK(expectedRows) {
- let db = sendMessage("db");
- let stmt = db.createAsyncStatement(`
- SELECT groups.name AS grp, settings.name AS name, prefs.value AS value
- FROM prefs
- LEFT JOIN groups ON groups.id = prefs.groupID
- LEFT JOIN settings ON settings.id = prefs.settingID
- UNION
-
- /*
- These second two SELECTs get the rows of the groups and settings tables
- that aren't referenced by the prefs table. Neither should return any
- rows if the component is working properly.
- */
- SELECT groups.name AS grp, NULL AS name, NULL AS value
- FROM groups
- WHERE id NOT IN (
- SELECT DISTINCT groupID
- FROM prefs
- WHERE groupID NOTNULL
- )
- UNION
- SELECT NULL AS grp, settings.name AS name, NULL AS value
- FROM settings
- WHERE id NOT IN (
- SELECT DISTINCT settingID
- FROM prefs
- WHERE settingID NOTNULL
- )
-
- ORDER BY value ASC, grp ASC, name ASC
- `);
-
- let actualRows = [];
- let cols = ["grp", "name", "value"];
-
- db.executeAsync([stmt], 1, {
- handleCompletion: function (reason) {
- arraysOfArraysOK(actualRows, expectedRows);
- next();
- },
- handleResult: function (results) {
- let row = null;
- while (row = results.getNextRow()) {
- actualRows.push(cols.map(c => row.getResultByName(c)));
- }
- },
- handleError: function (err) {
- do_throw(err);
- }
- });
- stmt.finalize();
-}
-
-function on(event, names, dontRemove) {
- let args = {
- reset: function () {
- for (let prop in this) {
- if (Array.isArray(this[prop]))
- this[prop].splice(0, this[prop].length);
- }
- },
- };
-
- let observers = {};
-
- names.forEach(function (name) {
- let obs = {};
- ["onContentPrefSet", "onContentPrefRemoved"].forEach(function (meth) {
- obs[meth] = () => do_throw(meth + " should not be called");
- });
- obs["onContentPref" + event] = function () {
- args[name].push(Array.slice(arguments));
- };
- observers[name] = obs;
- args[name] = [];
- args[name].observer = obs;
- cps.addObserverForName(name, obs);
- });
-
- do_execute_soon(function () {
- if (!dontRemove)
- names.forEach(n => cps.removeObserverForName(n, observers[n]));
- next(args);
- });
-}
-
-function schemaVersionIs(expectedVersion) {
- let db = sendMessage("db");
- equal(db.schemaVersion, expectedVersion);
-}
-
-function wait() {
- do_execute_soon(next);
-}
-
-function observerArgsOK(actualArgs, expectedArgs) {
- notEqual(actualArgs, undefined);
- arraysOfArraysOK(actualArgs, expectedArgs);
-}
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/test_extractDomain.js b/toolkit/components/contentprefs/tests/unit_cps2/test_extractDomain.js
deleted file mode 100644
index 2ec3d6878..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/test_extractDomain.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- let tests = {
- "http://example.com": "example.com",
- "http://example.com/": "example.com",
- "http://example.com/foo/bar/baz": "example.com",
- "http://subdomain.example.com/foo/bar/baz": "subdomain.example.com",
- "http://qix.quux.example.com/foo/bar/baz": "qix.quux.example.com",
- "file:///home/foo/bar": "file:///home/foo/bar",
- "not a url": "not a url",
- };
- let cps = Cc["@mozilla.org/content-pref/service;1"].
- getService(Ci.nsIContentPrefService2);
- for (let url in tests) {
- do_check_eq(cps.extractDomain(url), tests[url]);
- }
-}
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/test_getCached.js b/toolkit/components/contentprefs/tests/unit_cps2/test_getCached.js
deleted file mode 100644
index 33a965b7f..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/test_getCached.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- runAsyncTests(tests);
-}
-
-var tests = [
-
- function* nonexistent() {
- getCachedOK(["a.com", "foo"], false, undefined);
- getCachedGlobalOK(["foo"], false, undefined);
- yield true;
- },
-
- function* isomorphicDomains() {
- yield set("a.com", "foo", 1);
- getCachedOK(["a.com", "foo"], true, 1);
- getCachedOK(["http://a.com/huh", "foo"], true, 1, "a.com");
- },
-
- function* names() {
- yield set("a.com", "foo", 1);
- getCachedOK(["a.com", "foo"], true, 1);
-
- yield set("a.com", "bar", 2);
- getCachedOK(["a.com", "foo"], true, 1);
- getCachedOK(["a.com", "bar"], true, 2);
-
- yield setGlobal("foo", 3);
- getCachedOK(["a.com", "foo"], true, 1);
- getCachedOK(["a.com", "bar"], true, 2);
- getCachedGlobalOK(["foo"], true, 3);
-
- yield setGlobal("bar", 4);
- getCachedOK(["a.com", "foo"], true, 1);
- getCachedOK(["a.com", "bar"], true, 2);
- getCachedGlobalOK(["foo"], true, 3);
- getCachedGlobalOK(["bar"], true, 4);
- },
-
- function* subdomains() {
- yield set("a.com", "foo", 1);
- yield set("b.a.com", "foo", 2);
- getCachedOK(["a.com", "foo"], true, 1);
- getCachedOK(["b.a.com", "foo"], true, 2);
- },
-
- function* privateBrowsing() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield set("b.com", "foo", 5);
-
- let context = { usePrivateBrowsing: true };
- yield set("a.com", "foo", 6, context);
- yield setGlobal("foo", 7, context);
- getCachedOK(["a.com", "foo", context], true, 6);
- getCachedOK(["a.com", "bar", context], true, 2);
- getCachedGlobalOK(["foo", context], true, 7);
- getCachedGlobalOK(["bar", context], true, 4);
- getCachedOK(["b.com", "foo", context], true, 5);
-
- getCachedOK(["a.com", "foo"], true, 1);
- getCachedOK(["a.com", "bar"], true, 2);
- getCachedGlobalOK(["foo"], true, 3);
- getCachedGlobalOK(["bar"], true, 4);
- getCachedOK(["b.com", "foo"], true, 5);
- },
-
- function* erroneous() {
- do_check_throws(() => cps.getCachedByDomainAndName(null, "foo", null));
- do_check_throws(() => cps.getCachedByDomainAndName("", "foo", null));
- do_check_throws(() => cps.getCachedByDomainAndName("a.com", "", null));
- do_check_throws(() => cps.getCachedByDomainAndName("a.com", null, null));
- do_check_throws(() => cps.getCachedGlobal("", null));
- do_check_throws(() => cps.getCachedGlobal(null, null));
- yield true;
- },
-
- function* casts() {
- // SQLite casts booleans to integers. This makes sure the values stored in
- // the cache are the same as the casted values in the database.
-
- yield set("a.com", "foo", false);
- yield getOK(["a.com", "foo"], 0, "a.com", true);
- getCachedOK(["a.com", "foo"], true, 0, "a.com", true);
-
- yield set("a.com", "bar", true);
- yield getOK(["a.com", "bar"], 1, "a.com", true);
- getCachedOK(["a.com", "bar"], true, 1, "a.com", true);
- },
-];
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/test_getCachedSubdomains.js b/toolkit/components/contentprefs/tests/unit_cps2/test_getCachedSubdomains.js
deleted file mode 100644
index 9f2599708..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/test_getCachedSubdomains.js
+++ /dev/null
@@ -1,186 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- runAsyncTests(tests);
-}
-
-var tests = [
-
- function* nonexistent() {
- getCachedSubdomainsOK(["a.com", "foo"], []);
- yield true;
- },
-
- function* isomorphicDomains() {
- yield set("a.com", "foo", 1);
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", 1]]);
- getCachedSubdomainsOK(["http://a.com/huh", "foo"], [["a.com", 1]]);
- },
-
- function* names() {
- yield set("a.com", "foo", 1);
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", 1]]);
-
- yield set("a.com", "bar", 2);
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", 1]]);
- getCachedSubdomainsOK(["a.com", "bar"], [["a.com", 2]]);
-
- yield setGlobal("foo", 3);
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", 1]]);
- getCachedSubdomainsOK(["a.com", "bar"], [["a.com", 2]]);
- getCachedGlobalOK(["foo"], true, 3);
-
- yield setGlobal("bar", 4);
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", 1]]);
- getCachedSubdomainsOK(["a.com", "bar"], [["a.com", 2]]);
- getCachedGlobalOK(["foo"], true, 3);
- getCachedGlobalOK(["bar"], true, 4);
- },
-
- function* subdomains() {
- yield set("a.com", "foo", 1);
- yield set("b.a.com", "foo", 2);
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", 1], ["b.a.com", 2]]);
- getCachedSubdomainsOK(["b.a.com", "foo"], [["b.a.com", 2]]);
- },
-
- function* populateViaGet() {
- yield cps.getByDomainAndName("a.com", "foo", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", undefined]]);
-
- yield cps.getGlobal("foo", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", undefined]]);
- getCachedGlobalOK(["foo"], true, undefined);
- },
-
- function* populateViaGetSubdomains() {
- yield cps.getBySubdomainAndName("a.com", "foo", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", undefined]]);
- },
-
- function* populateViaRemove() {
- yield cps.removeByDomainAndName("a.com", "foo", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", undefined]]);
-
- yield cps.removeBySubdomainAndName("b.com", "foo", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", undefined]]);
- getCachedSubdomainsOK(["b.com", "foo"], [["b.com", undefined]]);
-
- yield cps.removeGlobal("foo", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", undefined]]);
- getCachedSubdomainsOK(["b.com", "foo"], [["b.com", undefined]]);
- getCachedGlobalOK(["foo"], true, undefined);
-
- yield set("a.com", "foo", 1);
- yield cps.removeByDomainAndName("a.com", "foo", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", undefined]]);
- getCachedSubdomainsOK(["b.com", "foo"], [["b.com", undefined]]);
- getCachedGlobalOK(["foo"], true, undefined);
-
- yield set("a.com", "foo", 2);
- yield set("b.a.com", "foo", 3);
- yield cps.removeBySubdomainAndName("a.com", "foo", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"],
- [["a.com", undefined], ["b.a.com", undefined]]);
- getCachedSubdomainsOK(["b.com", "foo"], [["b.com", undefined]]);
- getCachedGlobalOK(["foo"], true, undefined);
- getCachedSubdomainsOK(["b.a.com", "foo"], [["b.a.com", undefined]]);
-
- yield setGlobal("foo", 4);
- yield cps.removeGlobal("foo", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"],
- [["a.com", undefined], ["b.a.com", undefined]]);
- getCachedSubdomainsOK(["b.com", "foo"], [["b.com", undefined]]);
- getCachedGlobalOK(["foo"], true, undefined);
- getCachedSubdomainsOK(["b.a.com", "foo"], [["b.a.com", undefined]]);
- },
-
- function* populateViaRemoveByDomain() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield set("b.a.com", "foo", 3);
- yield set("b.a.com", "bar", 4);
- yield cps.removeByDomain("a.com", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"],
- [["a.com", undefined], ["b.a.com", 3]]);
- getCachedSubdomainsOK(["a.com", "bar"],
- [["a.com", undefined], ["b.a.com", 4]]);
-
- yield set("a.com", "foo", 5);
- yield set("a.com", "bar", 6);
- yield cps.removeBySubdomain("a.com", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"],
- [["a.com", undefined], ["b.a.com", undefined]]);
- getCachedSubdomainsOK(["a.com", "bar"],
- [["a.com", undefined], ["b.a.com", undefined]]);
-
- yield setGlobal("foo", 7);
- yield setGlobal("bar", 8);
- yield cps.removeAllGlobals(null, makeCallback());
- getCachedGlobalOK(["foo"], true, undefined);
- getCachedGlobalOK(["bar"], true, undefined);
- },
-
- function* populateViaRemoveAllDomains() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield set("b.com", "foo", 3);
- yield set("b.com", "bar", 4);
- yield cps.removeAllDomains(null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", undefined]]);
- getCachedSubdomainsOK(["a.com", "bar"], [["a.com", undefined]]);
- getCachedSubdomainsOK(["b.com", "foo"], [["b.com", undefined]]);
- getCachedSubdomainsOK(["b.com", "bar"], [["b.com", undefined]]);
- },
-
- function* populateViaRemoveByName() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield cps.removeByName("foo", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", undefined]]);
- getCachedSubdomainsOK(["a.com", "bar"], [["a.com", 2]]);
- getCachedGlobalOK(["foo"], true, undefined);
- getCachedGlobalOK(["bar"], true, 4);
-
- yield cps.removeByName("bar", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", undefined]]);
- getCachedSubdomainsOK(["a.com", "bar"], [["a.com", undefined]]);
- getCachedGlobalOK(["foo"], true, undefined);
- getCachedGlobalOK(["bar"], true, undefined);
- },
-
- function* privateBrowsing() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield set("b.com", "foo", 5);
-
- let context = { usePrivateBrowsing: true };
- yield set("a.com", "foo", 6, context);
- yield setGlobal("foo", 7, context);
- getCachedSubdomainsOK(["a.com", "foo", context], [["a.com", 6]]);
- getCachedSubdomainsOK(["a.com", "bar", context], [["a.com", 2]]);
- getCachedGlobalOK(["foo", context], true, 7);
- getCachedGlobalOK(["bar", context], true, 4);
- getCachedSubdomainsOK(["b.com", "foo", context], [["b.com", 5]]);
-
- getCachedSubdomainsOK(["a.com", "foo"], [["a.com", 1]]);
- getCachedSubdomainsOK(["a.com", "bar"], [["a.com", 2]]);
- getCachedGlobalOK(["foo"], true, 3);
- getCachedGlobalOK(["bar"], true, 4);
- getCachedSubdomainsOK(["b.com", "foo"], [["b.com", 5]]);
- },
-
- function* erroneous() {
- do_check_throws(() => cps.getCachedBySubdomainAndName(null, "foo", null));
- do_check_throws(() => cps.getCachedBySubdomainAndName("", "foo", null));
- do_check_throws(() => cps.getCachedBySubdomainAndName("a.com", "", null));
- do_check_throws(() => cps.getCachedBySubdomainAndName("a.com", null, null));
- yield true;
- },
-];
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/test_getSubdomains.js b/toolkit/components/contentprefs/tests/unit_cps2/test_getSubdomains.js
deleted file mode 100644
index d08d6fe69..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/test_getSubdomains.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- runAsyncTests(tests);
-}
-
-var tests = [
-
- function* get_nonexistent() {
- yield getSubdomainsOK(["a.com", "foo"], []);
- },
-
- function* isomorphicDomains() {
- yield set("a.com", "foo", 1);
- yield getSubdomainsOK(["a.com", "foo"], [["a.com", 1]]);
- yield getSubdomainsOK(["http://a.com/huh", "foo"], [["a.com", 1]]);
- },
-
- function* names() {
- yield set("a.com", "foo", 1);
- yield getSubdomainsOK(["a.com", "foo"], [["a.com", 1]]);
-
- yield set("a.com", "bar", 2);
- yield getSubdomainsOK(["a.com", "foo"], [["a.com", 1]]);
- yield getSubdomainsOK(["a.com", "bar"], [["a.com", 2]]);
-
- yield setGlobal("foo", 3);
- yield getSubdomainsOK(["a.com", "foo"], [["a.com", 1]]);
- yield getSubdomainsOK(["a.com", "bar"], [["a.com", 2]]);
- },
-
- function* subdomains() {
- yield set("a.com", "foo", 1);
- yield set("b.a.com", "foo", 2);
- yield getSubdomainsOK(["a.com", "foo"], [["a.com", 1], ["b.a.com", 2]]);
- yield getSubdomainsOK(["b.a.com", "foo"], [["b.a.com", 2]]);
- },
-
- function* privateBrowsing() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield set("b.com", "foo", 5);
-
- let context = { usePrivateBrowsing: true };
- yield set("a.com", "foo", 6, context);
- yield setGlobal("foo", 7, context);
- yield getSubdomainsOK(["a.com", "foo", context], [["a.com", 6]]);
- yield getSubdomainsOK(["a.com", "bar", context], [["a.com", 2]]);
- yield getSubdomainsOK(["b.com", "foo", context], [["b.com", 5]]);
-
- yield getSubdomainsOK(["a.com", "foo"], [["a.com", 1]]);
- yield getSubdomainsOK(["a.com", "bar"], [["a.com", 2]]);
- yield getSubdomainsOK(["b.com", "foo"], [["b.com", 5]]);
- },
-
- function* erroneous() {
- do_check_throws(() => cps.getBySubdomainAndName(null, "foo", null, {}));
- do_check_throws(() => cps.getBySubdomainAndName("", "foo", null, {}));
- do_check_throws(() => cps.getBySubdomainAndName("a.com", "", null, {}));
- do_check_throws(() => cps.getBySubdomainAndName("a.com", null, null, {}));
- do_check_throws(() => cps.getBySubdomainAndName("a.com", "foo", null, null));
- yield true;
- },
-];
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/test_migrationToSchema4.js b/toolkit/components/contentprefs/tests/unit_cps2/test_migrationToSchema4.js
deleted file mode 100644
index 85d23e355..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/test_migrationToSchema4.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Dump of version we migrate from
-var schema_version3 = `
-PRAGMA foreign_keys=OFF;
-BEGIN TRANSACTION;
- CREATE TABLE groups (id INTEGER PRIMARY KEY, name TEXT NOT NULL);
- INSERT INTO "groups" VALUES(1,'foo.com');
- INSERT INTO "groups" VALUES(2,'bar.com');
-
- CREATE TABLE settings (id INTEGER PRIMARY KEY, name TEXT NOT NULL);
- INSERT INTO "settings" VALUES(1,'zoom-setting');
- INSERT INTO "settings" VALUES(2,'dir-setting');
-
- CREATE TABLE prefs (id INTEGER PRIMARY KEY, groupID INTEGER REFERENCES groups(id), settingID INTEGER NOT NULL REFERENCES settings(id), value BLOB);
- INSERT INTO "prefs" VALUES(1,1,1,0.5);
- INSERT INTO "prefs" VALUES(2,1,2,'/download/dir');
- INSERT INTO "prefs" VALUES(3,2,1,0.3);
- INSERT INTO "prefs" VALUES(4,NULL,1,0.1);
-
- CREATE INDEX groups_idx ON groups(name);
- CREATE INDEX settings_idx ON settings(name);
- CREATE INDEX prefs_idx ON prefs(groupID, settingID);
-COMMIT;`;
-
-function prepareVersion3Schema(callback) {
- var dirService = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties);
-
- var dbFile = dirService.get("ProfD", Ci.nsIFile);
- dbFile.append("content-prefs.sqlite");
-
- var dbService = Cc["@mozilla.org/storage/service;1"].
- getService(Ci.mozIStorageService);
- ok(!dbFile.exists(), "Db should not exist yet.");
-
- var dbConnection = dbService.openDatabase(dbFile);
- equal(dbConnection.schemaVersion, 0);
-
- dbConnection.executeSimpleSQL(schema_version3);
- dbConnection.schemaVersion = 3;
-
- dbConnection.close();
-}
-
-function run_test() {
- prepareVersion3Schema();
- runAsyncTests(tests, true);
-}
-
-
-// WARNING: Database will reset after every test. This limitation comes from
-// the fact that we ContentPrefService constructor is run only once per test file
-// and so migration will be run only once.
-var tests = [
- function* testMigration() {
- // Test migrated db content.
- schemaVersionIs(4);
- let dbExpectedState = [
- [null, "zoom-setting", 0.1],
- ["bar.com", "zoom-setting", 0.3],
- ["foo.com", "zoom-setting", 0.5],
- ["foo.com", "dir-setting", "/download/dir"],
- ];
- yield dbOK(dbExpectedState);
-
- // Migrated fields should have timestamp set to 0.
- yield cps.removeAllDomainsSince(1000, null, makeCallback());
- yield dbOK(dbExpectedState);
-
- yield cps.removeAllDomainsSince(0, null, makeCallback());
- yield dbOK([[null, "zoom-setting", 0.1]]);
-
- // Test that dates are present after migration (column is added).
- const timestamp = 1234;
- yield setWithDate("a.com", "pref-name", "val", timestamp);
- let actualTimestamp = yield getDate("a.com", "pref-name");
- equal(actualTimestamp, timestamp);
- }
-];
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/test_observers.js b/toolkit/components/contentprefs/tests/unit_cps2/test_observers.js
deleted file mode 100644
index c48918cd9..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/test_observers.js
+++ /dev/null
@@ -1,178 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-let global = this;
-
-function run_test() {
- var allTests = [];
- for (var i = 0; i < tests.length; i++) {
- // Generate two wrappers of each test function that invoke the original test with an
- // appropriate privacy context.
- var pub = eval('var f = function* ' + tests[i].name + '() { yield tests[' + i + ']({ usePrivateBrowsing: false }); }; f');
- var priv = eval('var f = function* ' + tests[i].name + '_private() { yield tests[' + i + ']({ usePrivateBrowsing: true }); }; f');
- allTests.push(pub);
- allTests.push(priv);
- }
- allTests = allTests.concat(specialTests);
- runAsyncTests(allTests);
-}
-
-var tests = [
-
- function* observerForName_set(context) {
- yield set("a.com", "foo", 1, context);
- let args = yield on("Set", ["foo", null, "bar"]);
- observerArgsOK(args.foo, [["a.com", "foo", 1, context.usePrivateBrowsing]]);
- observerArgsOK(args.null, [["a.com", "foo", 1, context.usePrivateBrowsing]]);
- observerArgsOK(args.bar, []);
-
- yield setGlobal("foo", 2, context);
- args = yield on("Set", ["foo", null, "bar"]);
- observerArgsOK(args.foo, [[null, "foo", 2, context.usePrivateBrowsing]]);
- observerArgsOK(args.null, [[null, "foo", 2, context.usePrivateBrowsing]]);
- observerArgsOK(args.bar, []);
- },
-
- function* observerForName_remove(context) {
- yield set("a.com", "foo", 1, context);
- yield setGlobal("foo", 2, context);
-
- yield cps.removeByDomainAndName("a.com", "bogus", context, makeCallback());
- let args = yield on("Removed", ["foo", null, "bar"]);
- observerArgsOK(args.foo, []);
- observerArgsOK(args.null, []);
- observerArgsOK(args.bar, []);
-
- yield cps.removeByDomainAndName("a.com", "foo", context, makeCallback());
- args = yield on("Removed", ["foo", null, "bar"]);
- observerArgsOK(args.foo, [["a.com", "foo", context.usePrivateBrowsing]]);
- observerArgsOK(args.null, [["a.com", "foo", context.usePrivateBrowsing]]);
- observerArgsOK(args.bar, []);
-
- yield cps.removeGlobal("foo", context, makeCallback());
- args = yield on("Removed", ["foo", null, "bar"]);
- observerArgsOK(args.foo, [[null, "foo", context.usePrivateBrowsing]]);
- observerArgsOK(args.null, [[null, "foo", context.usePrivateBrowsing]]);
- observerArgsOK(args.bar, []);
- },
-
- function* observerForName_removeByDomain(context) {
- yield set("a.com", "foo", 1, context);
- yield set("b.a.com", "bar", 2, context);
- yield setGlobal("foo", 3, context);
-
- yield cps.removeByDomain("bogus", context, makeCallback());
- let args = yield on("Removed", ["foo", null, "bar"]);
- observerArgsOK(args.foo, []);
- observerArgsOK(args.null, []);
- observerArgsOK(args.bar, []);
-
- yield cps.removeBySubdomain("a.com", context, makeCallback());
- args = yield on("Removed", ["foo", null, "bar"]);
- observerArgsOK(args.foo, [["a.com", "foo", context.usePrivateBrowsing]]);
- observerArgsOK(args.null, [["a.com", "foo", context.usePrivateBrowsing], ["b.a.com", "bar", context.usePrivateBrowsing]]);
- observerArgsOK(args.bar, [["b.a.com", "bar", context.usePrivateBrowsing]]);
-
- yield cps.removeAllGlobals(context, makeCallback());
- args = yield on("Removed", ["foo", null, "bar"]);
- observerArgsOK(args.foo, [[null, "foo", context.usePrivateBrowsing]]);
- observerArgsOK(args.null, [[null, "foo", context.usePrivateBrowsing]]);
- observerArgsOK(args.bar, []);
- },
-
- function* observerForName_removeAllDomains(context) {
- yield set("a.com", "foo", 1, context);
- yield setGlobal("foo", 2, context);
- yield set("b.com", "bar", 3, context);
-
- yield cps.removeAllDomains(context, makeCallback());
- let args = yield on("Removed", ["foo", null, "bar"]);
- observerArgsOK(args.foo, [["a.com", "foo", context.usePrivateBrowsing]]);
- observerArgsOK(args.null, [["a.com", "foo", context.usePrivateBrowsing], ["b.com", "bar", context.usePrivateBrowsing]]);
- observerArgsOK(args.bar, [["b.com", "bar", context.usePrivateBrowsing]]);
- },
-
- function* observerForName_removeByName(context) {
- yield set("a.com", "foo", 1, context);
- yield set("a.com", "bar", 2, context);
- yield setGlobal("foo", 3, context);
-
- yield cps.removeByName("bogus", context, makeCallback());
- let args = yield on("Removed", ["foo", null, "bar"]);
- observerArgsOK(args.foo, []);
- observerArgsOK(args.null, []);
- observerArgsOK(args.bar, []);
-
- yield cps.removeByName("foo", context, makeCallback());
- args = yield on("Removed", ["foo", null, "bar"]);
- observerArgsOK(args.foo, [["a.com", "foo", context.usePrivateBrowsing], [null, "foo", context.usePrivateBrowsing]]);
- observerArgsOK(args.null, [["a.com", "foo", context.usePrivateBrowsing], [null, "foo", context.usePrivateBrowsing]]);
- observerArgsOK(args.bar, []);
- },
-
- function* removeObserverForName(context) {
- let args = yield on("Set", ["foo", null, "bar"], true);
-
- cps.removeObserverForName("foo", args.foo.observer);
- yield set("a.com", "foo", 1, context);
- yield wait();
- observerArgsOK(args.foo, []);
- observerArgsOK(args.null, [["a.com", "foo", 1, context.usePrivateBrowsing]]);
- observerArgsOK(args.bar, []);
- args.reset();
-
- cps.removeObserverForName(null, args.null.observer);
- yield set("a.com", "foo", 2, context);
- yield wait();
- observerArgsOK(args.foo, []);
- observerArgsOK(args.null, []);
- observerArgsOK(args.bar, []);
- args.reset();
- },
-];
-
-// These tests are for functionality that doesn't behave the same way in private and public
-// contexts, so the expected results cannot be automatically generated like the previous tests.
-var specialTests = [
- function* observerForName_removeAllDomainsSince() {
- yield setWithDate("a.com", "foo", 1, 100, null);
- yield setWithDate("b.com", "foo", 2, 200, null);
- yield setWithDate("c.com", "foo", 3, 300, null);
-
- yield setWithDate("a.com", "bar", 1, 0, null);
- yield setWithDate("b.com", "bar", 2, 100, null);
- yield setWithDate("c.com", "bar", 3, 200, null);
- yield setGlobal("foo", 2, null);
-
- yield cps.removeAllDomainsSince(200, null, makeCallback());
-
- let args = yield on("Removed", ["foo", "bar", null]);
-
- observerArgsOK(args.foo, [["b.com", "foo", false], ["c.com", "foo", false]]);
- observerArgsOK(args.bar, [["c.com", "bar", false]]);
- observerArgsOK(args.null, [["b.com", "foo", false], ["c.com", "bar", false], ["c.com", "foo", false]]);
- },
-
- function* observerForName_removeAllDomainsSince_private() {
- let context = {usePrivateBrowsing: true};
- yield setWithDate("a.com", "foo", 1, 100, context);
- yield setWithDate("b.com", "foo", 2, 200, context);
- yield setWithDate("c.com", "foo", 3, 300, context);
-
- yield setWithDate("a.com", "bar", 1, 0, context);
- yield setWithDate("b.com", "bar", 2, 100, context);
- yield setWithDate("c.com", "bar", 3, 200, context);
- yield setGlobal("foo", 2, context);
-
- yield cps.removeAllDomainsSince(200, context, makeCallback());
-
- let args = yield on("Removed", ["foo", "bar", null]);
-
- observerArgsOK(args.foo, [["a.com", "foo", true], ["b.com", "foo", true], ["c.com", "foo", true]]);
- observerArgsOK(args.bar, [["a.com", "bar", true], ["b.com", "bar", true], ["c.com", "bar", true]]);
- observerArgsOK(args.null, [["a.com", "foo", true], ["a.com", "bar", true],
- ["b.com", "foo", true], ["b.com", "bar", true],
- ["c.com", "foo", true], ["c.com", "bar", true]]);
- },
-];
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/test_remove.js b/toolkit/components/contentprefs/tests/unit_cps2/test_remove.js
deleted file mode 100644
index 9853293fc..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/test_remove.js
+++ /dev/null
@@ -1,222 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- runAsyncTests(tests);
-}
-
-var tests = [
-
- function* nonexistent() {
- yield set("a.com", "foo", 1);
- yield setGlobal("foo", 2);
-
- yield cps.removeByDomainAndName("a.com", "bogus", null, makeCallback());
- yield dbOK([
- ["a.com", "foo", 1],
- [null, "foo", 2],
- ]);
- yield getOK(["a.com", "foo"], 1);
- yield getGlobalOK(["foo"], 2);
-
- yield cps.removeBySubdomainAndName("a.com", "bogus", null, makeCallback());
- yield dbOK([
- ["a.com", "foo", 1],
- [null, "foo", 2],
- ]);
- yield getOK(["a.com", "foo"], 1);
- yield getGlobalOK(["foo"], 2);
-
- yield cps.removeGlobal("bogus", null, makeCallback());
- yield dbOK([
- ["a.com", "foo", 1],
- [null, "foo", 2],
- ]);
- yield getOK(["a.com", "foo"], 1);
- yield getGlobalOK(["foo"], 2);
-
- yield cps.removeByDomainAndName("bogus", "bogus", null, makeCallback());
- yield dbOK([
- ["a.com", "foo", 1],
- [null, "foo", 2],
- ]);
- yield getOK(["a.com", "foo"], 1);
- yield getGlobalOK(["foo"], 2);
- },
-
- function* isomorphicDomains() {
- yield set("a.com", "foo", 1);
- yield cps.removeByDomainAndName("a.com", "foo", null, makeCallback());
- yield dbOK([]);
- yield getOK(["a.com", "foo"], undefined);
-
- yield set("a.com", "foo", 2);
- yield cps.removeByDomainAndName("http://a.com/huh", "foo", null,
- makeCallback());
- yield dbOK([]);
- yield getOK(["a.com", "foo"], undefined);
- },
-
- function* names() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
-
- yield cps.removeByDomainAndName("a.com", "foo", null, makeCallback());
- yield dbOK([
- ["a.com", "bar", 2],
- [null, "foo", 3],
- [null, "bar", 4],
- ]);
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], 2);
- yield getGlobalOK(["foo"], 3);
- yield getGlobalOK(["bar"], 4);
-
- yield cps.removeGlobal("foo", null, makeCallback());
- yield dbOK([
- ["a.com", "bar", 2],
- [null, "bar", 4],
- ]);
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], 2);
- yield getGlobalOK(["foo"], undefined);
- yield getGlobalOK(["bar"], 4);
-
- yield cps.removeByDomainAndName("a.com", "bar", null, makeCallback());
- yield dbOK([
- [null, "bar", 4],
- ]);
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], undefined);
- yield getGlobalOK(["foo"], undefined);
- yield getGlobalOK(["bar"], 4);
-
- yield cps.removeGlobal("bar", null, makeCallback());
- yield dbOK([
- ]);
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], undefined);
- yield getGlobalOK(["foo"], undefined);
- yield getGlobalOK(["bar"], undefined);
- },
-
- function* subdomains() {
- yield set("a.com", "foo", 1);
- yield set("b.a.com", "foo", 2);
- yield cps.removeByDomainAndName("a.com", "foo", null, makeCallback());
- yield dbOK([
- ["b.a.com", "foo", 2],
- ]);
- yield getSubdomainsOK(["a.com", "foo"], [["b.a.com", 2]]);
- yield getSubdomainsOK(["b.a.com", "foo"], [["b.a.com", 2]]);
-
- yield set("a.com", "foo", 3);
- yield cps.removeBySubdomainAndName("a.com", "foo", null, makeCallback());
- yield dbOK([
- ]);
- yield getSubdomainsOK(["a.com", "foo"], []);
- yield getSubdomainsOK(["b.a.com", "foo"], []);
-
- yield set("a.com", "foo", 4);
- yield set("b.a.com", "foo", 5);
- yield cps.removeByDomainAndName("b.a.com", "foo", null, makeCallback());
- yield dbOK([
- ["a.com", "foo", 4],
- ]);
- yield getSubdomainsOK(["a.com", "foo"], [["a.com", 4]]);
- yield getSubdomainsOK(["b.a.com", "foo"], []);
-
- yield set("b.a.com", "foo", 6);
- yield cps.removeBySubdomainAndName("b.a.com", "foo", null, makeCallback());
- yield dbOK([
- ["a.com", "foo", 4],
- ]);
- yield getSubdomainsOK(["a.com", "foo"], [["a.com", 4]]);
- yield getSubdomainsOK(["b.a.com", "foo"], []);
- },
-
- function* privateBrowsing() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield setGlobal("qux", 5);
- yield set("b.com", "foo", 6);
- yield set("b.com", "bar", 7);
-
- let context = { usePrivateBrowsing: true };
- yield set("a.com", "foo", 8, context);
- yield setGlobal("foo", 9, context);
- yield cps.removeByDomainAndName("a.com", "foo", context, makeCallback());
- yield cps.removeGlobal("foo", context, makeCallback());
- yield cps.removeGlobal("qux", context, makeCallback());
- yield cps.removeByDomainAndName("b.com", "foo", context, makeCallback());
- yield dbOK([
- ["a.com", "bar", 2],
- [null, "bar", 4],
- ["b.com", "bar", 7],
- ]);
- yield getOK(["a.com", "foo", context], undefined);
- yield getOK(["a.com", "bar", context], 2);
- yield getGlobalOK(["foo", context], undefined);
- yield getGlobalOK(["bar", context], 4);
- yield getGlobalOK(["qux", context], undefined);
- yield getOK(["b.com", "foo", context], undefined);
- yield getOK(["b.com", "bar", context], 7);
-
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], 2);
- yield getGlobalOK(["foo"], undefined);
- yield getGlobalOK(["bar"], 4);
- yield getGlobalOK(["qux"], undefined);
- yield getOK(["b.com", "foo"], undefined);
- yield getOK(["b.com", "bar"], 7);
- },
-
- function* erroneous() {
- do_check_throws(() => cps.removeByDomainAndName(null, "foo", null));
- do_check_throws(() => cps.removeByDomainAndName("", "foo", null));
- do_check_throws(() => cps.removeByDomainAndName("a.com", "foo", null,
- "bogus"));
- do_check_throws(() => cps.removeBySubdomainAndName(null, "foo",
- null));
- do_check_throws(() => cps.removeBySubdomainAndName("", "foo", null));
- do_check_throws(() => cps.removeBySubdomainAndName("a.com", "foo",
- null, "bogus"));
- do_check_throws(() => cps.removeGlobal("", null));
- do_check_throws(() => cps.removeGlobal(null, null));
- do_check_throws(() => cps.removeGlobal("foo", null, "bogus"));
- yield true;
- },
-
- function* removeByDomainAndName_invalidateCache() {
- yield set("a.com", "foo", 1);
- getCachedOK(["a.com", "foo"], true, 1);
- cps.removeByDomainAndName("a.com", "foo", null, makeCallback());
- getCachedOK(["a.com", "foo"], false);
- yield;
- },
-
- function* removeBySubdomainAndName_invalidateCache() {
- yield set("a.com", "foo", 1);
- yield set("b.a.com", "foo", 2);
- getCachedSubdomainsOK(["a.com", "foo"], [
- ["a.com", 1],
- ["b.a.com", 2],
- ]);
- cps.removeBySubdomainAndName("a.com", "foo", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"], []);
- yield;
- },
-
- function* removeGlobal_invalidateCache() {
- yield setGlobal("foo", 1);
- getCachedGlobalOK(["foo"], true, 1);
- cps.removeGlobal("foo", null, makeCallback());
- getCachedGlobalOK(["foo"], false);
- yield;
- },
-];
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/test_removeAllDomains.js b/toolkit/components/contentprefs/tests/unit_cps2/test_removeAllDomains.js
deleted file mode 100644
index 63e1b0552..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/test_removeAllDomains.js
+++ /dev/null
@@ -1,87 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- runAsyncTests(tests);
-}
-
-var tests = [
-
- function* nonexistent() {
- yield setGlobal("foo", 1);
- yield cps.removeAllDomains(null, makeCallback());
- yield dbOK([
- [null, "foo", 1],
- ]);
- yield getGlobalOK(["foo"], 1);
- },
-
- function* domains() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield set("b.com", "foo", 5);
- yield set("b.com", "bar", 6);
-
- yield cps.removeAllDomains(null, makeCallback());
- yield dbOK([
- [null, "foo", 3],
- [null, "bar", 4],
- ]);
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], undefined);
- yield getGlobalOK(["foo"], 3);
- yield getGlobalOK(["bar"], 4);
- yield getOK(["b.com", "foo"], undefined);
- yield getOK(["b.com", "bar"], undefined);
- },
-
- function* privateBrowsing() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield set("b.com", "foo", 5);
-
- let context = { usePrivateBrowsing: true };
- yield set("a.com", "foo", 6, context);
- yield setGlobal("foo", 7, context);
- yield cps.removeAllDomains(context, makeCallback());
- yield dbOK([
- [null, "foo", 3],
- [null, "bar", 4],
- ]);
- yield getOK(["a.com", "foo", context], undefined);
- yield getOK(["a.com", "bar", context], undefined);
- yield getGlobalOK(["foo", context], 7);
- yield getGlobalOK(["bar", context], 4);
- yield getOK(["b.com", "foo", context], undefined);
-
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], undefined);
- yield getGlobalOK(["foo"], 3);
- yield getGlobalOK(["bar"], 4);
- yield getOK(["b.com", "foo"], undefined);
- },
-
- function* erroneous() {
- do_check_throws(() => cps.removeAllDomains(null, "bogus"));
- yield true;
- },
-
- function* invalidateCache() {
- yield set("a.com", "foo", 1);
- yield set("b.com", "bar", 2);
- yield setGlobal("baz", 3);
- getCachedOK(["a.com", "foo"], true, 1);
- getCachedOK(["b.com", "bar"], true, 2);
- getCachedGlobalOK(["baz"], true, 3);
- cps.removeAllDomains(null, makeCallback());
- getCachedOK(["a.com", "foo"], false);
- getCachedOK(["b.com", "bar"], false);
- getCachedGlobalOK(["baz"], true, 3);
- yield;
- },
-];
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/test_removeAllDomainsSince.js b/toolkit/components/contentprefs/tests/unit_cps2/test_removeAllDomainsSince.js
deleted file mode 100644
index fa0bf31c3..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/test_removeAllDomainsSince.js
+++ /dev/null
@@ -1,111 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- runAsyncTests(tests);
-}
-
-var tests = [
-
- function* nonexistent() {
- yield setGlobal("foo", 1);
- yield cps.removeAllDomainsSince(0, null, makeCallback());
- yield getGlobalOK(["foo"], 1);
- },
-
- function* domainsAll() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield set("b.com", "foo", 5);
- yield set("b.com", "bar", 6);
-
- yield cps.removeAllDomainsSince(0, null, makeCallback());
- yield dbOK([
- [null, "foo", 3],
- [null, "bar", 4],
- ]);
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], undefined);
- yield getGlobalOK(["foo"], 3);
- yield getGlobalOK(["bar"], 4);
- yield getOK(["b.com", "foo"], undefined);
- yield getOK(["b.com", "bar"], undefined);
- },
-
- function* domainsWithDate() {
- yield setWithDate("a.com", "foobar", 0, 0);
- yield setWithDate("a.com", "foo", 1, 1000);
- yield setWithDate("a.com", "bar", 2, 4000);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield setWithDate("b.com", "foo", 5, 2000);
- yield setWithDate("b.com", "bar", 6, 3000);
- yield setWithDate("b.com", "foobar", 7, 1000);
-
- yield cps.removeAllDomainsSince(2000, null, makeCallback());
- yield dbOK([
- ["a.com", "foobar", 0],
- ["a.com", "foo", 1],
- [null, "foo", 3],
- [null, "bar", 4],
- ["b.com", "foobar", 7],
- ]);
- },
-
- function* privateBrowsing() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield set("b.com", "foo", 5);
-
- let context = { usePrivateBrowsing: true };
- yield set("a.com", "foo", 6, context);
- yield setGlobal("foo", 7, context);
- yield cps.removeAllDomainsSince(0, context, makeCallback());
- yield dbOK([
- [null, "foo", 3],
- [null, "bar", 4],
- ]);
- yield getOK(["a.com", "foo", context], undefined);
- yield getOK(["a.com", "bar", context], undefined);
- yield getGlobalOK(["foo", context], 7);
- yield getGlobalOK(["bar", context], 4);
- yield getOK(["b.com", "foo", context], undefined);
-
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], undefined);
- yield getGlobalOK(["foo"], 3);
- yield getGlobalOK(["bar"], 4);
- yield getOK(["b.com", "foo"], undefined);
- },
-
- function* erroneous() {
- do_check_throws(() => cps.removeAllDomainsSince(null, "bogus"));
- yield true;
- },
-
- function* invalidateCache() {
- yield setWithDate("a.com", "foobar", 0, 0);
- yield setWithDate("a.com", "foo", 1, 1000);
- yield setWithDate("a.com", "bar", 2, 4000);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield setWithDate("b.com", "foo", 5, 2000);
- yield setWithDate("b.com", "bar", 6, 3000);
- yield setWithDate("b.com", "foobar", 7, 1000);
- cps.removeAllDomainsSince(0, null, makeCallback());
- getCachedOK(["a.com", "foobar"], false);
- getCachedOK(["a.com", "foo"], false);
- getCachedOK(["a.com", "bar"], false);
- getCachedGlobalOK(["foo"], true, 3);
- getCachedGlobalOK(["bar"], true, 4);
- getCachedOK(["b.com", "foo"], false);
- getCachedOK(["b.com", "bar"], false);
- getCachedOK(["b.com", "foobar"], false);
- yield true;
- },
-];
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/test_removeByDomain.js b/toolkit/components/contentprefs/tests/unit_cps2/test_removeByDomain.js
deleted file mode 100644
index 1cf6bd8f2..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/test_removeByDomain.js
+++ /dev/null
@@ -1,199 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- runAsyncTests(tests);
-}
-
-var tests = [
-
- function* nonexistent() {
- yield set("a.com", "foo", 1);
- yield setGlobal("foo", 2);
-
- yield cps.removeByDomain("bogus", null, makeCallback());
- yield dbOK([
- ["a.com", "foo", 1],
- [null, "foo", 2],
- ]);
- yield getOK(["a.com", "foo"], 1);
- yield getGlobalOK(["foo"], 2);
-
- yield cps.removeBySubdomain("bogus", null, makeCallback());
- yield dbOK([
- ["a.com", "foo", 1],
- [null, "foo", 2],
- ]);
- yield getOK(["a.com", "foo"], 1);
- yield getGlobalOK(["foo"], 2);
- },
-
- function* isomorphicDomains() {
- yield set("a.com", "foo", 1);
- yield cps.removeByDomain("a.com", null, makeCallback());
- yield dbOK([]);
- yield getOK(["a.com", "foo"], undefined);
-
- yield set("a.com", "foo", 2);
- yield cps.removeByDomain("http://a.com/huh", null, makeCallback());
- yield dbOK([]);
- yield getOK(["a.com", "foo"], undefined);
- },
-
- function* domains() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield set("b.com", "foo", 5);
- yield set("b.com", "bar", 6);
-
- yield cps.removeByDomain("a.com", null, makeCallback());
- yield dbOK([
- [null, "foo", 3],
- [null, "bar", 4],
- ["b.com", "foo", 5],
- ["b.com", "bar", 6],
- ]);
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], undefined);
- yield getGlobalOK(["foo"], 3);
- yield getGlobalOK(["bar"], 4);
- yield getOK(["b.com", "foo"], 5);
- yield getOK(["b.com", "bar"], 6);
-
- yield cps.removeAllGlobals(null, makeCallback());
- yield dbOK([
- ["b.com", "foo", 5],
- ["b.com", "bar", 6],
- ]);
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], undefined);
- yield getGlobalOK(["foo"], undefined);
- yield getGlobalOK(["bar"], undefined);
- yield getOK(["b.com", "foo"], 5);
- yield getOK(["b.com", "bar"], 6);
-
- yield cps.removeByDomain("b.com", null, makeCallback());
- yield dbOK([
- ]);
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], undefined);
- yield getGlobalOK(["foo"], undefined);
- yield getGlobalOK(["bar"], undefined);
- yield getOK(["b.com", "foo"], undefined);
- yield getOK(["b.com", "bar"], undefined);
- },
-
- function* subdomains() {
- yield set("a.com", "foo", 1);
- yield set("b.a.com", "foo", 2);
- yield cps.removeByDomain("a.com", null, makeCallback());
- yield dbOK([
- ["b.a.com", "foo", 2],
- ]);
- yield getSubdomainsOK(["a.com", "foo"], [["b.a.com", 2]]);
- yield getSubdomainsOK(["b.a.com", "foo"], [["b.a.com", 2]]);
-
- yield set("a.com", "foo", 3);
- yield cps.removeBySubdomain("a.com", null, makeCallback());
- yield dbOK([
- ]);
- yield getSubdomainsOK(["a.com", "foo"], []);
- yield getSubdomainsOK(["b.a.com", "foo"], []);
-
- yield set("a.com", "foo", 4);
- yield set("b.a.com", "foo", 5);
- yield cps.removeByDomain("b.a.com", null, makeCallback());
- yield dbOK([
- ["a.com", "foo", 4],
- ]);
- yield getSubdomainsOK(["a.com", "foo"], [["a.com", 4]]);
- yield getSubdomainsOK(["b.a.com", "foo"], []);
-
- yield set("b.a.com", "foo", 6);
- yield cps.removeBySubdomain("b.a.com", null, makeCallback());
- yield dbOK([
- ["a.com", "foo", 4],
- ]);
- yield getSubdomainsOK(["a.com", "foo"], [["a.com", 4]]);
- yield getSubdomainsOK(["b.a.com", "foo"], []);
- },
-
- function* privateBrowsing() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield set("b.com", "foo", 5);
-
- let context = { usePrivateBrowsing: true };
- yield set("a.com", "foo", 6, context);
- yield set("b.com", "foo", 7, context);
- yield setGlobal("foo", 8, context);
- yield cps.removeByDomain("a.com", context, makeCallback());
- yield getOK(["b.com", "foo", context], 7);
- yield getGlobalOK(["foo", context], 8);
- yield cps.removeAllGlobals(context, makeCallback());
- yield dbOK([
- ["b.com", "foo", 5],
- ]);
- yield getOK(["a.com", "foo", context], undefined);
- yield getOK(["a.com", "bar", context], undefined);
- yield getGlobalOK(["foo", context], undefined);
- yield getGlobalOK(["bar", context], undefined);
- yield getOK(["b.com", "foo", context], 5);
-
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], undefined);
- yield getGlobalOK(["foo"], undefined);
- yield getGlobalOK(["bar"], undefined);
- yield getOK(["b.com", "foo"], 5);
- },
-
- function* erroneous() {
- do_check_throws(() => cps.removeByDomain(null, null));
- do_check_throws(() => cps.removeByDomain("", null));
- do_check_throws(() => cps.removeByDomain("a.com", null, "bogus"));
- do_check_throws(() => cps.removeBySubdomain(null, null));
- do_check_throws(() => cps.removeBySubdomain("", null));
- do_check_throws(() => cps.removeBySubdomain("a.com", null, "bogus"));
- do_check_throws(() => cps.removeAllGlobals(null, "bogus"));
- yield true;
- },
-
- function* removeByDomain_invalidateCache() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- getCachedOK(["a.com", "foo"], true, 1);
- getCachedOK(["a.com", "bar"], true, 2);
- cps.removeByDomain("a.com", null, makeCallback());
- getCachedOK(["a.com", "foo"], false);
- getCachedOK(["a.com", "bar"], false);
- yield;
- },
-
- function* removeBySubdomain_invalidateCache() {
- yield set("a.com", "foo", 1);
- yield set("b.a.com", "foo", 2);
- getCachedSubdomainsOK(["a.com", "foo"], [
- ["a.com", 1],
- ["b.a.com", 2],
- ]);
- cps.removeBySubdomain("a.com", null, makeCallback());
- getCachedSubdomainsOK(["a.com", "foo"], []);
- yield;
- },
-
- function* removeAllGlobals_invalidateCache() {
- yield setGlobal("foo", 1);
- yield setGlobal("bar", 2);
- getCachedGlobalOK(["foo"], true, 1);
- getCachedGlobalOK(["bar"], true, 2);
- cps.removeAllGlobals(null, makeCallback());
- getCachedGlobalOK(["foo"], false);
- getCachedGlobalOK(["bar"], false);
- yield;
- },
-];
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/test_removeByName.js b/toolkit/components/contentprefs/tests/unit_cps2/test_removeByName.js
deleted file mode 100644
index fa04656e2..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/test_removeByName.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- runAsyncTests(tests);
-}
-
-var tests = [
-
- function* nonexistent() {
- yield set("a.com", "foo", 1);
- yield setGlobal("foo", 2);
-
- yield cps.removeByName("bogus", null, makeCallback());
- yield dbOK([
- ["a.com", "foo", 1],
- [null, "foo", 2],
- ]);
- yield getOK(["a.com", "foo"], 1);
- yield getGlobalOK(["foo"], 2);
- },
-
- function* names() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield set("b.com", "foo", 5);
- yield set("b.com", "bar", 6);
-
- yield cps.removeByName("foo", null, makeCallback());
- yield dbOK([
- ["a.com", "bar", 2],
- [null, "bar", 4],
- ["b.com", "bar", 6],
- ]);
- yield getOK(["a.com", "foo"], undefined);
- yield getOK(["a.com", "bar"], 2);
- yield getGlobalOK(["foo"], undefined);
- yield getGlobalOK(["bar"], 4);
- yield getOK(["b.com", "foo"], undefined);
- yield getOK(["b.com", "bar"], 6);
- },
-
- function* privateBrowsing() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield set("b.com", "foo", 5);
- yield set("b.com", "bar", 6);
-
- let context = { usePrivateBrowsing: true };
- yield set("a.com", "foo", 7, context);
- yield setGlobal("foo", 8, context);
- yield set("b.com", "bar", 9, context);
- yield cps.removeByName("bar", context, makeCallback());
- yield dbOK([
- ["a.com", "foo", 1],
- [null, "foo", 3],
- ["b.com", "foo", 5],
- ]);
- yield getOK(["a.com", "foo", context], 7);
- yield getOK(["a.com", "bar", context], undefined);
- yield getGlobalOK(["foo", context], 8);
- yield getGlobalOK(["bar", context], undefined);
- yield getOK(["b.com", "foo", context], 5);
- yield getOK(["b.com", "bar", context], undefined);
-
- yield getOK(["a.com", "foo"], 1);
- yield getOK(["a.com", "bar"], undefined);
- yield getGlobalOK(["foo"], 3);
- yield getGlobalOK(["bar"], undefined);
- yield getOK(["b.com", "foo"], 5);
- yield getOK(["b.com", "bar"], undefined);
- },
-
- function* erroneous() {
- do_check_throws(() => cps.removeByName("", null));
- do_check_throws(() => cps.removeByName(null, null));
- do_check_throws(() => cps.removeByName("foo", null, "bogus"));
- yield true;
- },
-
- function* invalidateCache() {
- yield set("a.com", "foo", 1);
- yield set("b.com", "foo", 2);
- getCachedOK(["a.com", "foo"], true, 1);
- getCachedOK(["b.com", "foo"], true, 2);
- cps.removeByName("foo", null, makeCallback());
- getCachedOK(["a.com", "foo"], false);
- getCachedOK(["b.com", "foo"], false);
- yield;
- },
-];
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/test_service.js b/toolkit/components/contentprefs/tests/unit_cps2/test_service.js
deleted file mode 100644
index 75292063e..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/test_service.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- let serv = Cc["@mozilla.org/content-pref/service;1"].
- getService(Ci.nsIContentPrefService2);
- do_check_eq(serv.QueryInterface(Ci.nsIContentPrefService2), serv);
- do_check_eq(serv.QueryInterface(Ci.nsISupports), serv);
- let val = serv.QueryInterface(Ci.nsIContentPrefService);
- do_check_true(val instanceof Ci.nsIContentPrefService);
-}
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/test_setGet.js b/toolkit/components/contentprefs/tests/unit_cps2/test_setGet.js
deleted file mode 100644
index b10a05bbc..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/test_setGet.js
+++ /dev/null
@@ -1,206 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- runAsyncTests(tests);
-}
-
-var tests = [
-
- function* get_nonexistent() {
- yield getOK(["a.com", "foo"], undefined);
- yield getGlobalOK(["foo"], undefined);
- },
-
- function* isomorphicDomains() {
- yield set("a.com", "foo", 1);
- yield dbOK([
- ["a.com", "foo", 1],
- ]);
- yield getOK(["a.com", "foo"], 1);
- yield getOK(["http://a.com/huh", "foo"], 1, "a.com");
-
- yield set("http://a.com/huh", "foo", 2);
- yield dbOK([
- ["a.com", "foo", 2],
- ]);
- yield getOK(["a.com", "foo"], 2);
- yield getOK(["http://a.com/yeah", "foo"], 2, "a.com");
- },
-
- function* names() {
- yield set("a.com", "foo", 1);
- yield dbOK([
- ["a.com", "foo", 1],
- ]);
- yield getOK(["a.com", "foo"], 1);
-
- yield set("a.com", "bar", 2);
- yield dbOK([
- ["a.com", "foo", 1],
- ["a.com", "bar", 2],
- ]);
- yield getOK(["a.com", "foo"], 1);
- yield getOK(["a.com", "bar"], 2);
-
- yield setGlobal("foo", 3);
- yield dbOK([
- ["a.com", "foo", 1],
- ["a.com", "bar", 2],
- [null, "foo", 3],
- ]);
- yield getOK(["a.com", "foo"], 1);
- yield getOK(["a.com", "bar"], 2);
- yield getGlobalOK(["foo"], 3);
-
- yield setGlobal("bar", 4);
- yield dbOK([
- ["a.com", "foo", 1],
- ["a.com", "bar", 2],
- [null, "foo", 3],
- [null, "bar", 4],
- ]);
- yield getOK(["a.com", "foo"], 1);
- yield getOK(["a.com", "bar"], 2);
- yield getGlobalOK(["foo"], 3);
- yield getGlobalOK(["bar"], 4);
- },
-
- function* subdomains() {
- yield set("a.com", "foo", 1);
- yield set("b.a.com", "foo", 2);
- yield dbOK([
- ["a.com", "foo", 1],
- ["b.a.com", "foo", 2],
- ]);
- yield getOK(["a.com", "foo"], 1);
- yield getOK(["b.a.com", "foo"], 2);
- },
-
- function* privateBrowsing() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield setGlobal("foo", 3);
- yield setGlobal("bar", 4);
- yield set("b.com", "foo", 5);
-
- let context = { usePrivateBrowsing: true };
- yield set("a.com", "foo", 6, context);
- yield setGlobal("foo", 7, context);
- yield dbOK([
- ["a.com", "foo", 1],
- ["a.com", "bar", 2],
- [null, "foo", 3],
- [null, "bar", 4],
- ["b.com", "foo", 5],
- ]);
- yield getOK(["a.com", "foo", context], 6, "a.com");
- yield getOK(["a.com", "bar", context], 2);
- yield getGlobalOK(["foo", context], 7);
- yield getGlobalOK(["bar", context], 4);
- yield getOK(["b.com", "foo", context], 5);
-
- yield getOK(["a.com", "foo"], 1);
- yield getOK(["a.com", "bar"], 2);
- yield getGlobalOK(["foo"], 3);
- yield getGlobalOK(["bar"], 4);
- yield getOK(["b.com", "foo"], 5);
- },
-
- function* set_erroneous() {
- do_check_throws(() => cps.set(null, "foo", 1, null));
- do_check_throws(() => cps.set("", "foo", 1, null));
- do_check_throws(() => cps.set("a.com", "", 1, null));
- do_check_throws(() => cps.set("a.com", null, 1, null));
- do_check_throws(() => cps.set("a.com", "foo", undefined, null));
- do_check_throws(() => cps.set("a.com", "foo", 1, null, "bogus"));
- do_check_throws(() => cps.setGlobal("", 1, null));
- do_check_throws(() => cps.setGlobal(null, 1, null));
- do_check_throws(() => cps.setGlobal("foo", undefined, null));
- do_check_throws(() => cps.setGlobal("foo", 1, null, "bogus"));
- yield true;
- },
-
- function* get_erroneous() {
- do_check_throws(() => cps.getByDomainAndName(null, "foo", null, {}));
- do_check_throws(() => cps.getByDomainAndName("", "foo", null, {}));
- do_check_throws(() => cps.getByDomainAndName("a.com", "", null, {}));
- do_check_throws(() => cps.getByDomainAndName("a.com", null, null, {}));
- do_check_throws(() => cps.getByDomainAndName("a.com", "foo", null, null));
- do_check_throws(() => cps.getGlobal("", null, {}));
- do_check_throws(() => cps.getGlobal(null, null, {}));
- do_check_throws(() => cps.getGlobal("foo", null, null));
- yield true;
- },
-
- function* set_invalidateCache() {
- // (1) Set a pref and wait for it to finish.
- yield set("a.com", "foo", 1);
-
- // (2) It should be cached.
- getCachedOK(["a.com", "foo"], true, 1);
-
- // (3) Set the pref to a new value but don't wait for it to finish.
- cps.set("a.com", "foo", 2, null, {
- handleCompletion: function () {
- // (6) The pref should be cached after setting it.
- getCachedOK(["a.com", "foo"], true, 2);
- },
- });
-
- // (4) Group "a.com" and name "foo" should no longer be cached.
- getCachedOK(["a.com", "foo"], false);
-
- // (5) Call getByDomainAndName.
- var fetchedPref;
- cps.getByDomainAndName("a.com", "foo", null, {
- handleResult: function (pref) {
- fetchedPref = pref;
- },
- handleCompletion: function () {
- // (7) Finally, this callback should be called after set's above.
- do_check_true(!!fetchedPref);
- do_check_eq(fetchedPref.value, 2);
- next();
- },
- });
-
- yield;
- },
-
- function* get_nameOnly() {
- yield set("a.com", "foo", 1);
- yield set("a.com", "bar", 2);
- yield set("b.com", "foo", 3);
- yield setGlobal("foo", 4);
-
- yield getOKEx("getByName", ["foo", undefined], [
- {"domain": "a.com", "name": "foo", "value": 1},
- {"domain": "b.com", "name": "foo", "value": 3},
- {"domain": null, "name": "foo", "value": 4}
- ]);
-
- let context = { usePrivateBrowsing: true };
- yield set("b.com", "foo", 5, context);
-
- yield getOKEx("getByName", ["foo", context], [
- {"domain": "a.com", "name": "foo", "value": 1},
- {"domain": null, "name": "foo", "value": 4},
- {"domain": "b.com", "name": "foo", "value": 5}
- ]);
- },
-
- function* setSetsCurrentDate() {
- // Because Date.now() is not guaranteed to be monotonically increasing
- // we just do here rough sanity check with one minute tolerance.
- const MINUTE = 60 * 1000;
- let now = Date.now();
- let start = now - MINUTE;
- let end = now + MINUTE;
- yield set("a.com", "foo", 1);
- let timestamp = yield getDate("a.com", "foo");
- ok(start <= timestamp, "Timestamp is not too early (" + start + "<=" + timestamp + ").");
- ok(timestamp <= end, "Timestamp is not too late (" + timestamp + "<=" + end + ").");
- },
-];
diff --git a/toolkit/components/contentprefs/tests/unit_cps2/xpcshell.ini b/toolkit/components/contentprefs/tests/unit_cps2/xpcshell.ini
deleted file mode 100644
index bdbcaf8fd..000000000
--- a/toolkit/components/contentprefs/tests/unit_cps2/xpcshell.ini
+++ /dev/null
@@ -1,19 +0,0 @@
-[DEFAULT]
-head = head.js
-tail =
-skip-if = toolkit == 'android'
-support-files = AsyncRunner.jsm
-
-[test_service.js]
-[test_setGet.js]
-[test_getSubdomains.js]
-[test_remove.js]
-[test_removeByDomain.js]
-[test_removeAllDomains.js]
-[test_removeByName.js]
-[test_getCached.js]
-[test_getCachedSubdomains.js]
-[test_observers.js]
-[test_extractDomain.js]
-[test_migrationToSchema4.js]
-[test_removeAllDomainsSince.js]
diff --git a/toolkit/components/contextualidentity/moz.build b/toolkit/components/contextualidentity/moz.build
index 9188421f9..524d5e779 100644
--- a/toolkit/components/contextualidentity/moz.build
+++ b/toolkit/components/contextualidentity/moz.build
@@ -4,8 +4,4 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-EXTRA_JS_MODULES += [
- 'ContextualIdentityService.jsm',
-]
-
-XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
+EXTRA_JS_MODULES += ['ContextualIdentityService.jsm']
diff --git a/toolkit/components/contextualidentity/tests/unit/test_basic.js b/toolkit/components/contextualidentity/tests/unit/test_basic.js
deleted file mode 100644
index 4d17b9a26..000000000
--- a/toolkit/components/contextualidentity/tests/unit/test_basic.js
+++ /dev/null
@@ -1,67 +0,0 @@
-"use strict";
-
-do_get_profile();
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Cu.import("resource://gre/modules/ContextualIdentityService.jsm");
-
-const TEST_STORE_FILE_NAME = "test-containers.json";
-
-let cis;
-
-// Basic tests
-add_task(function() {
- ok(!!ContextualIdentityService, "ContextualIdentityService exists");
-
- cis = ContextualIdentityService.createNewInstanceForTesting(TEST_STORE_FILE_NAME);
- ok(!!cis, "We have our instance of ContextualIdentityService");
-
- equal(cis.getIdentities().length, 4, "By default, 4 containers.");
- equal(cis.getIdentityFromId(0), null, "No identity with id 0");
-
- ok(!!cis.getIdentityFromId(1), "Identity 1 exists");
- ok(!!cis.getIdentityFromId(2), "Identity 2 exists");
- ok(!!cis.getIdentityFromId(3), "Identity 3 exists");
- ok(!!cis.getIdentityFromId(4), "Identity 4 exists");
-});
-
-// Create a new identity
-add_task(function() {
- equal(cis.getIdentities().length, 4, "By default, 4 containers.");
-
- let identity = cis.create("New Container", "Icon", "Color");
- ok(!!identity, "New container created");
- equal(identity.name, "New Container", "Name matches");
- equal(identity.icon, "Icon", "Icon matches");
- equal(identity.color, "Color", "Color matches");
-
- equal(cis.getIdentities().length, 5, "Expected 5 containers.");
-
- ok(!!cis.getIdentityFromId(identity.userContextId), "Identity exists");
- equal(cis.getIdentityFromId(identity.userContextId).name, "New Container", "Identity name is OK");
- equal(cis.getIdentityFromId(identity.userContextId).icon, "Icon", "Identity icon is OK");
- equal(cis.getIdentityFromId(identity.userContextId).color, "Color", "Identity color is OK");
- equal(cis.getUserContextLabel(identity.userContextId), "New Container", "Identity label is OK");
-
- // Remove an identity
- equal(cis.remove(-1), false, "cis.remove() returns false if identity doesn't exist.");
- equal(cis.remove(1), true, "cis.remove() returns true if identity exists.");
-
- equal(cis.getIdentities().length, 4, "Expected 4 containers.");
-});
-
-// Update an identity
-add_task(function() {
- ok(!!cis.getIdentityFromId(2), "Identity 2 exists");
-
- equal(cis.update(-1, "Container", "Icon", "Color"), false, "Update returns false if the identity doesn't exist");
-
- equal(cis.update(2, "Container", "Icon", "Color"), true, "Update returns true if everything is OK");
-
- ok(!!cis.getIdentityFromId(2), "Identity exists");
- equal(cis.getIdentityFromId(2).name, "Container", "Identity name is OK");
- equal(cis.getIdentityFromId(2).icon, "Icon", "Identity icon is OK");
- equal(cis.getIdentityFromId(2).color, "Color", "Identity color is OK");
- equal(cis.getUserContextLabel(2), "Container", "Identity label is OK");
-});
diff --git a/toolkit/components/contextualidentity/tests/unit/xpcshell.ini b/toolkit/components/contextualidentity/tests/unit/xpcshell.ini
deleted file mode 100644
index b45ff2c30..000000000
--- a/toolkit/components/contextualidentity/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[DEFAULT]
-
-[test_basic.js]
diff --git a/toolkit/components/crashes/moz.build b/toolkit/components/crashes/moz.build
index 5a36a3cd3..6efad5964 100644
--- a/toolkit/components/crashes/moz.build
+++ b/toolkit/components/crashes/moz.build
@@ -19,13 +19,8 @@ TESTING_JS_MODULES += [
'CrashManagerTest.jsm',
]
-XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
-
XPIDL_MODULE = 'toolkit_crashservice'
XPIDL_SOURCES += [
'nsICrashService.idl',
]
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Breakpad Integration')
diff --git a/toolkit/components/crashes/tests/xpcshell/.eslintrc.js b/toolkit/components/crashes/tests/xpcshell/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/crashes/tests/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/crashes/tests/xpcshell/test_crash_manager.js b/toolkit/components/crashes/tests/xpcshell/test_crash_manager.js
deleted file mode 100644
index 9844e78c4..000000000
--- a/toolkit/components/crashes/tests/xpcshell/test_crash_manager.js
+++ /dev/null
@@ -1,494 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-var bsp = Cu.import("resource://gre/modules/CrashManager.jsm", this);
-Cu.import("resource://gre/modules/Promise.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm", this);
-Cu.import("resource://gre/modules/osfile.jsm", this);
-Cu.import("resource://gre/modules/TelemetryEnvironment.jsm", this);
-
-Cu.import("resource://testing-common/CrashManagerTest.jsm", this);
-Cu.import("resource://testing-common/TelemetryArchiveTesting.jsm", this);
-
-const DUMMY_DATE = new Date(Date.now() - 10 * 24 * 60 * 60 * 1000);
-DUMMY_DATE.setMilliseconds(0);
-
-const DUMMY_DATE_2 = new Date(Date.now() - 20 * 24 * 60 * 60 * 1000);
-DUMMY_DATE_2.setMilliseconds(0);
-
-function run_test() {
- do_get_profile();
- configureLogging();
- TelemetryArchiveTesting.setup();
- run_next_test();
-}
-
-add_task(function* test_constructor_ok() {
- let m = new CrashManager({
- pendingDumpsDir: "/foo",
- submittedDumpsDir: "/bar",
- eventsDirs: [],
- storeDir: "/baz",
- });
- Assert.ok(m, "CrashManager can be created.");
-});
-
-add_task(function* test_constructor_invalid() {
- Assert.throws(() => {
- new CrashManager({foo: true});
- });
-});
-
-add_task(function* test_get_manager() {
- let m = yield getManager();
- Assert.ok(m, "CrashManager obtained.");
-
- yield m.createDummyDump(true);
- yield m.createDummyDump(false);
-});
-
-// Unsubmitted dump files on disk are detected properly.
-add_task(function* test_pending_dumps() {
- let m = yield getManager();
- let now = Date.now();
- let ids = [];
- const COUNT = 5;
-
- for (let i = 0; i < COUNT; i++) {
- ids.push(yield m.createDummyDump(false, new Date(now - i * 86400000)));
- }
- yield m.createIgnoredDumpFile("ignored", false);
-
- let entries = yield m.pendingDumps();
- Assert.equal(entries.length, COUNT, "proper number detected.");
-
- for (let entry of entries) {
- Assert.equal(typeof(entry), "object", "entry is an object");
- Assert.ok("id" in entry, "id in entry");
- Assert.ok("path" in entry, "path in entry");
- Assert.ok("date" in entry, "date in entry");
- Assert.notEqual(ids.indexOf(entry.id), -1, "ID is known");
- }
-
- for (let i = 0; i < COUNT; i++) {
- Assert.equal(entries[i].id, ids[COUNT-i-1], "Entries sorted by mtime");
- }
-});
-
-// Submitted dump files on disk are detected properly.
-add_task(function* test_submitted_dumps() {
- let m = yield getManager();
- let COUNT = 5;
-
- for (let i = 0; i < COUNT; i++) {
- yield m.createDummyDump(true);
- }
- yield m.createIgnoredDumpFile("ignored", true);
-
- let entries = yield m.submittedDumps();
- Assert.equal(entries.length, COUNT, "proper number detected.");
-
- let hrID = yield m.createDummyDump(true, new Date(), true);
- entries = yield m.submittedDumps();
- Assert.equal(entries.length, COUNT + 1, "hr- in filename detected.");
-
- let gotIDs = new Set(entries.map(e => e.id));
- Assert.ok(gotIDs.has(hrID));
-});
-
-// The store should expire after inactivity.
-add_task(function* test_store_expires() {
- let m = yield getManager();
-
- Object.defineProperty(m, "STORE_EXPIRATION_MS", {
- value: 250,
- });
-
- let store = yield m._getStore();
- Assert.ok(store);
- Assert.equal(store, m._store);
-
- yield sleep(300);
- Assert.ok(!m._store, "Store has gone away.");
-});
-
-// Ensure discovery of unprocessed events files works.
-add_task(function* test_unprocessed_events_files() {
- let m = yield getManager();
- yield m.createEventsFile("1", "test.1", new Date(), "foo", 0);
- yield m.createEventsFile("2", "test.1", new Date(), "bar", 0);
- yield m.createEventsFile("1", "test.1", new Date(), "baz", 1);
-
- let paths = yield m._getUnprocessedEventsFiles();
- Assert.equal(paths.length, 3);
-});
-
-// Ensure only 1 aggregateEventsFiles() is allowed at a time.
-add_task(function* test_aggregate_events_locking() {
- let m = yield getManager();
-
- let p1 = m.aggregateEventsFiles();
- let p2 = m.aggregateEventsFiles();
-
- Assert.strictEqual(p1, p2, "Same promise should be returned.");
-});
-
-// Malformed events files should be deleted.
-add_task(function* test_malformed_files_deleted() {
- let m = yield getManager();
-
- yield m.createEventsFile("1", "crash.main.1", new Date(), "foo\nbar");
-
- let count = yield m.aggregateEventsFiles();
- Assert.equal(count, 1);
- let crashes = yield m.getCrashes();
- Assert.equal(crashes.length, 0);
-
- count = yield m.aggregateEventsFiles();
- Assert.equal(count, 0);
-});
-
-// Unknown event types should be ignored.
-add_task(function* test_aggregate_ignore_unknown_events() {
- let m = yield getManager();
-
- yield m.createEventsFile("1", "crash.main.2", DUMMY_DATE, "id1");
- yield m.createEventsFile("2", "foobar.1", new Date(), "dummy");
-
- let count = yield m.aggregateEventsFiles();
- Assert.equal(count, 2);
-
- count = yield m.aggregateEventsFiles();
- Assert.equal(count, 1);
-
- count = yield m.aggregateEventsFiles();
- Assert.equal(count, 1);
-});
-
-add_task(function* test_prune_old() {
- let m = yield getManager();
- let oldDate = new Date(Date.now() - 86400000);
- let newDate = new Date(Date.now() - 10000);
- yield m.createEventsFile("1", "crash.main.2", oldDate, "id1");
- yield m.addCrash(m.PROCESS_TYPE_PLUGIN, m.CRASH_TYPE_CRASH, "id2", newDate);
-
- yield m.aggregateEventsFiles();
-
- let crashes = yield m.getCrashes();
- Assert.equal(crashes.length, 2);
-
- yield m.pruneOldCrashes(new Date(oldDate.getTime() + 10000));
-
- crashes = yield m.getCrashes();
- Assert.equal(crashes.length, 1, "Old crash has been pruned.");
-
- let c = crashes[0];
- Assert.equal(c.id, "id2", "Proper crash was pruned.");
-
- // We can't test exact boundary conditions because dates from filesystem
- // don't have same guarantees as JS dates.
- yield m.pruneOldCrashes(new Date(newDate.getTime() + 5000));
- crashes = yield m.getCrashes();
- Assert.equal(crashes.length, 0);
-});
-
-add_task(function* test_schedule_maintenance() {
- let m = yield getManager();
- yield m.createEventsFile("1", "crash.main.2", DUMMY_DATE, "id1");
-
- let oldDate = new Date(Date.now() - m.PURGE_OLDER_THAN_DAYS * 2 * 24 * 60 * 60 * 1000);
- yield m.createEventsFile("2", "crash.main.2", oldDate, "id2");
-
- yield m.scheduleMaintenance(25);
- let crashes = yield m.getCrashes();
- Assert.equal(crashes.length, 1);
- Assert.equal(crashes[0].id, "id1");
-});
-
-add_task(function* test_main_crash_event_file() {
- let ac = new TelemetryArchiveTesting.Checker();
- yield ac.promiseInit();
- let theEnvironment = TelemetryEnvironment.currentEnvironment;
- let sessionId = "be66af2f-2ee5-4330-ae95-44462dfbdf0c";
- let stackTraces = { status: "OK" };
-
- // To test proper escaping, add data to the environment with an embedded
- // double-quote
- theEnvironment.testValue = "MyValue\"";
-
- let m = yield getManager();
- const fileContent = "id1\nk1=v1\nk2=v2\n" +
- "TelemetryEnvironment=" + JSON.stringify(theEnvironment) + "\n" +
- "TelemetrySessionId=" + sessionId + "\n" +
- "StackTraces=" + JSON.stringify(stackTraces) + "\n";
-
- yield m.createEventsFile("1", "crash.main.2", DUMMY_DATE, fileContent);
- let count = yield m.aggregateEventsFiles();
- Assert.equal(count, 1);
-
- let crashes = yield m.getCrashes();
- Assert.equal(crashes.length, 1);
- Assert.equal(crashes[0].id, "id1");
- Assert.equal(crashes[0].type, "main-crash");
- Assert.equal(crashes[0].metadata.k1, "v1");
- Assert.equal(crashes[0].metadata.k2, "v2");
- Assert.ok(crashes[0].metadata.TelemetryEnvironment);
- Assert.equal(Object.getOwnPropertyNames(crashes[0].metadata).length, 5);
- Assert.equal(crashes[0].metadata.TelemetrySessionId, sessionId);
- Assert.ok(crashes[0].metadata.StackTraces);
- Assert.deepEqual(crashes[0].crashDate, DUMMY_DATE);
-
- let found = yield ac.promiseFindPing("crash", [
- [["payload", "hasCrashEnvironment"], true],
- [["payload", "metadata", "k1"], "v1"],
- [["payload", "crashId"], "1"],
- [["payload", "stackTraces", "status"], "OK"],
- [["payload", "sessionId"], sessionId],
- ]);
- Assert.ok(found, "Telemetry ping submitted for found crash");
- Assert.deepEqual(found.environment, theEnvironment, "The saved environment should be present");
-
- count = yield m.aggregateEventsFiles();
- Assert.equal(count, 0);
-});
-
-add_task(function* test_main_crash_event_file_noenv() {
- let ac = new TelemetryArchiveTesting.Checker();
- yield ac.promiseInit();
-
- let m = yield getManager();
- yield m.createEventsFile("1", "crash.main.2", DUMMY_DATE, "id1\nk1=v3\nk2=v2");
- let count = yield m.aggregateEventsFiles();
- Assert.equal(count, 1);
-
- let crashes = yield m.getCrashes();
- Assert.equal(crashes.length, 1);
- Assert.equal(crashes[0].id, "id1");
- Assert.equal(crashes[0].type, "main-crash");
- Assert.deepEqual(crashes[0].metadata, { k1: "v3", k2: "v2"});
- Assert.deepEqual(crashes[0].crashDate, DUMMY_DATE);
-
- let found = yield ac.promiseFindPing("crash", [
- [["payload", "hasCrashEnvironment"], false],
- [["payload", "metadata", "k1"], "v3"],
- ]);
- Assert.ok(found, "Telemetry ping submitted for found crash");
- Assert.ok(found.environment, "There is an environment");
-
- count = yield m.aggregateEventsFiles();
- Assert.equal(count, 0);
-});
-
-add_task(function* test_crash_submission_event_file() {
- let m = yield getManager();
- yield m.createEventsFile("1", "crash.main.2", DUMMY_DATE, "crash1");
- yield m.createEventsFile("1-submission", "crash.submission.1", DUMMY_DATE_2,
- "crash1\nfalse\n");
-
- // The line below has been intentionally commented out to make sure that
- // the crash record is created when one does not exist.
- // yield m.createEventsFile("2", "crash.main.1", DUMMY_DATE, "crash2");
- yield m.createEventsFile("2-submission", "crash.submission.1", DUMMY_DATE_2,
- "crash2\ntrue\nbp-2");
- let count = yield m.aggregateEventsFiles();
- Assert.equal(count, 3);
-
- let crashes = yield m.getCrashes();
- Assert.equal(crashes.length, 2);
-
- let map = new Map(crashes.map(crash => [crash.id, crash]));
-
- let crash1 = map.get("crash1");
- Assert.ok(!!crash1);
- Assert.equal(crash1.remoteID, null);
- let crash2 = map.get("crash2");
- Assert.ok(!!crash2);
- Assert.equal(crash2.remoteID, "bp-2");
-
- Assert.equal(crash1.submissions.size, 1);
- let submission = crash1.submissions.values().next().value;
- Assert.equal(submission.result, m.SUBMISSION_RESULT_FAILED);
- Assert.equal(submission.requestDate.getTime(), DUMMY_DATE_2.getTime());
- Assert.equal(submission.responseDate.getTime(), DUMMY_DATE_2.getTime());
-
- Assert.equal(crash2.submissions.size, 1);
- submission = crash2.submissions.values().next().value;
- Assert.equal(submission.result, m.SUBMISSION_RESULT_OK);
- Assert.equal(submission.requestDate.getTime(), DUMMY_DATE_2.getTime());
- Assert.equal(submission.responseDate.getTime(), DUMMY_DATE_2.getTime());
-
- count = yield m.aggregateEventsFiles();
- Assert.equal(count, 0);
-});
-
-add_task(function* test_multiline_crash_id_rejected() {
- let m = yield getManager();
- yield m.createEventsFile("1", "crash.main.1", DUMMY_DATE, "id1\nid2");
- yield m.aggregateEventsFiles();
- let crashes = yield m.getCrashes();
- Assert.equal(crashes.length, 0);
-});
-
-// Main process crashes should be remembered beyond the high water mark.
-add_task(function* test_high_water_mark() {
- let m = yield getManager();
-
- let store = yield m._getStore();
-
- for (let i = 0; i < store.HIGH_WATER_DAILY_THRESHOLD + 1; i++) {
- yield m.createEventsFile("m" + i, "crash.main.2", DUMMY_DATE, "m" + i);
- }
-
- let count = yield m.aggregateEventsFiles();
- Assert.equal(count, bsp.CrashStore.prototype.HIGH_WATER_DAILY_THRESHOLD + 1);
-
- // Need to fetch again in case the first one was garbage collected.
- store = yield m._getStore();
-
- Assert.equal(store.crashesCount, store.HIGH_WATER_DAILY_THRESHOLD + 1);
-});
-
-add_task(function* test_addCrash() {
- let m = yield getManager();
-
- let crashes = yield m.getCrashes();
- Assert.equal(crashes.length, 0);
-
- yield m.addCrash(m.PROCESS_TYPE_MAIN, m.CRASH_TYPE_CRASH,
- "main-crash", DUMMY_DATE);
- yield m.addCrash(m.PROCESS_TYPE_MAIN, m.CRASH_TYPE_HANG,
- "main-hang", DUMMY_DATE);
- yield m.addCrash(m.PROCESS_TYPE_CONTENT, m.CRASH_TYPE_CRASH,
- "content-crash", DUMMY_DATE);
- yield m.addCrash(m.PROCESS_TYPE_CONTENT, m.CRASH_TYPE_HANG,
- "content-hang", DUMMY_DATE);
- yield m.addCrash(m.PROCESS_TYPE_PLUGIN, m.CRASH_TYPE_CRASH,
- "plugin-crash", DUMMY_DATE);
- yield m.addCrash(m.PROCESS_TYPE_PLUGIN, m.CRASH_TYPE_HANG,
- "plugin-hang", DUMMY_DATE);
- yield m.addCrash(m.PROCESS_TYPE_GMPLUGIN, m.CRASH_TYPE_CRASH,
- "gmplugin-crash", DUMMY_DATE);
- yield m.addCrash(m.PROCESS_TYPE_GPU, m.CRASH_TYPE_CRASH,
- "gpu-crash", DUMMY_DATE);
-
- yield m.addCrash(m.PROCESS_TYPE_MAIN, m.CRASH_TYPE_CRASH,
- "changing-item", DUMMY_DATE);
- yield m.addCrash(m.PROCESS_TYPE_CONTENT, m.CRASH_TYPE_HANG,
- "changing-item", DUMMY_DATE_2);
-
- crashes = yield m.getCrashes();
- Assert.equal(crashes.length, 9);
-
- let map = new Map(crashes.map(crash => [crash.id, crash]));
-
- let crash = map.get("main-crash");
- Assert.ok(!!crash);
- Assert.equal(crash.crashDate, DUMMY_DATE);
- Assert.equal(crash.type, m.PROCESS_TYPE_MAIN + "-" + m.CRASH_TYPE_CRASH);
- Assert.ok(crash.isOfType(m.PROCESS_TYPE_MAIN, m.CRASH_TYPE_CRASH));
-
- crash = map.get("main-hang");
- Assert.ok(!!crash);
- Assert.equal(crash.crashDate, DUMMY_DATE);
- Assert.equal(crash.type, m.PROCESS_TYPE_MAIN + "-" + m.CRASH_TYPE_HANG);
- Assert.ok(crash.isOfType(m.PROCESS_TYPE_MAIN, m.CRASH_TYPE_HANG));
-
- crash = map.get("content-crash");
- Assert.ok(!!crash);
- Assert.equal(crash.crashDate, DUMMY_DATE);
- Assert.equal(crash.type, m.PROCESS_TYPE_CONTENT + "-" + m.CRASH_TYPE_CRASH);
- Assert.ok(crash.isOfType(m.PROCESS_TYPE_CONTENT, m.CRASH_TYPE_CRASH));
-
- crash = map.get("content-hang");
- Assert.ok(!!crash);
- Assert.equal(crash.crashDate, DUMMY_DATE);
- Assert.equal(crash.type, m.PROCESS_TYPE_CONTENT + "-" + m.CRASH_TYPE_HANG);
- Assert.ok(crash.isOfType(m.PROCESS_TYPE_CONTENT, m.CRASH_TYPE_HANG));
-
- crash = map.get("plugin-crash");
- Assert.ok(!!crash);
- Assert.equal(crash.crashDate, DUMMY_DATE);
- Assert.equal(crash.type, m.PROCESS_TYPE_PLUGIN + "-" + m.CRASH_TYPE_CRASH);
- Assert.ok(crash.isOfType(m.PROCESS_TYPE_PLUGIN, m.CRASH_TYPE_CRASH));
-
- crash = map.get("plugin-hang");
- Assert.ok(!!crash);
- Assert.equal(crash.crashDate, DUMMY_DATE);
- Assert.equal(crash.type, m.PROCESS_TYPE_PLUGIN + "-" + m.CRASH_TYPE_HANG);
- Assert.ok(crash.isOfType(m.PROCESS_TYPE_PLUGIN, m.CRASH_TYPE_HANG));
-
- crash = map.get("gmplugin-crash");
- Assert.ok(!!crash);
- Assert.equal(crash.crashDate, DUMMY_DATE);
- Assert.equal(crash.type, m.PROCESS_TYPE_GMPLUGIN + "-" + m.CRASH_TYPE_CRASH);
- Assert.ok(crash.isOfType(m.PROCESS_TYPE_GMPLUGIN, m.CRASH_TYPE_CRASH));
-
- crash = map.get("gpu-crash");
- Assert.ok(!!crash);
- Assert.equal(crash.crashDate, DUMMY_DATE);
- Assert.equal(crash.type, m.PROCESS_TYPE_GPU+ "-" + m.CRASH_TYPE_CRASH);
- Assert.ok(crash.isOfType(m.PROCESS_TYPE_GPU, m.CRASH_TYPE_CRASH));
-
- crash = map.get("changing-item");
- Assert.ok(!!crash);
- Assert.equal(crash.crashDate, DUMMY_DATE_2);
- Assert.equal(crash.type, m.PROCESS_TYPE_CONTENT + "-" + m.CRASH_TYPE_HANG);
- Assert.ok(crash.isOfType(m.PROCESS_TYPE_CONTENT, m.CRASH_TYPE_HANG));
-});
-
-add_task(function* test_generateSubmissionID() {
- let m = yield getManager();
-
- const SUBMISSION_ID_REGEX =
- /^(sub-[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})$/i;
- let id = m.generateSubmissionID();
- Assert.ok(SUBMISSION_ID_REGEX.test(id));
-});
-
-add_task(function* test_addSubmissionAttemptAndResult() {
- let m = yield getManager();
-
- let crashes = yield m.getCrashes();
- Assert.equal(crashes.length, 0);
-
- yield m.addCrash(m.PROCESS_TYPE_MAIN, m.CRASH_TYPE_CRASH,
- "main-crash", DUMMY_DATE);
- yield m.addSubmissionAttempt("main-crash", "submission", DUMMY_DATE);
- yield m.addSubmissionResult("main-crash", "submission", DUMMY_DATE_2,
- m.SUBMISSION_RESULT_OK);
-
- crashes = yield m.getCrashes();
- Assert.equal(crashes.length, 1);
-
- let submissions = crashes[0].submissions;
- Assert.ok(!!submissions);
-
- let submission = submissions.get("submission");
- Assert.ok(!!submission);
- Assert.equal(submission.requestDate.getTime(), DUMMY_DATE.getTime());
- Assert.equal(submission.responseDate.getTime(), DUMMY_DATE_2.getTime());
- Assert.equal(submission.result, m.SUBMISSION_RESULT_OK);
-});
-
-add_task(function* test_setCrashClassifications() {
- let m = yield getManager();
-
- yield m.addCrash(m.PROCESS_TYPE_MAIN, m.CRASH_TYPE_CRASH,
- "main-crash", DUMMY_DATE);
- yield m.setCrashClassifications("main-crash", ["a"]);
- let classifications = (yield m.getCrashes())[0].classifications;
- Assert.ok(classifications.indexOf("a") != -1);
-});
-
-add_task(function* test_setRemoteCrashID() {
- let m = yield getManager();
-
- yield m.addCrash(m.PROCESS_TYPE_MAIN, m.CRASH_TYPE_CRASH,
- "main-crash", DUMMY_DATE);
- yield m.setRemoteCrashID("main-crash", "bp-1");
- Assert.equal((yield m.getCrashes())[0].remoteID, "bp-1");
-});
diff --git a/toolkit/components/crashes/tests/xpcshell/test_crash_service.js b/toolkit/components/crashes/tests/xpcshell/test_crash_service.js
deleted file mode 100644
index c207057e0..000000000
--- a/toolkit/components/crashes/tests/xpcshell/test_crash_service.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://testing-common/AppData.jsm", this);
-var bsp = Cu.import("resource://gre/modules/CrashManager.jsm", this);
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_instantiation() {
- Assert.ok(!bsp.gCrashManager, "CrashManager global instance not initially defined.");
-
- do_get_profile();
- yield makeFakeAppDir();
-
- // Fake profile creation.
- Cc["@mozilla.org/crashservice;1"]
- .getService(Ci.nsIObserver)
- .observe(null, "profile-after-change", null);
-
- Assert.ok(bsp.gCrashManager, "Profile creation makes it available.");
- Assert.ok(Services.crashmanager, "CrashManager available via Services.");
- Assert.strictEqual(bsp.gCrashManager, Services.crashmanager,
- "The objects are the same.");
-});
diff --git a/toolkit/components/crashes/tests/xpcshell/test_crash_store.js b/toolkit/components/crashes/tests/xpcshell/test_crash_store.js
deleted file mode 100644
index 12b180e91..000000000
--- a/toolkit/components/crashes/tests/xpcshell/test_crash_store.js
+++ /dev/null
@@ -1,587 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * This file tests the CrashStore type in CrashManager.jsm.
- */
-
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-var bsp = Cu.import("resource://gre/modules/CrashManager.jsm", this);
-Cu.import("resource://gre/modules/osfile.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm", this);
-
-const DUMMY_DATE = new Date(Date.now() - 10 * 24 * 60 * 60 * 1000);
-DUMMY_DATE.setMilliseconds(0);
-
-const DUMMY_DATE_2 = new Date(Date.now() - 5 * 24 * 60 * 60 * 1000);
-DUMMY_DATE_2.setMilliseconds(0);
-
-const {
- PROCESS_TYPE_MAIN,
- PROCESS_TYPE_CONTENT,
- PROCESS_TYPE_PLUGIN,
- PROCESS_TYPE_GMPLUGIN,
- PROCESS_TYPE_GPU,
- CRASH_TYPE_CRASH,
- CRASH_TYPE_HANG,
- SUBMISSION_RESULT_OK,
- SUBMISSION_RESULT_FAILED,
-} = CrashManager.prototype;
-
-const CrashStore = bsp.CrashStore;
-
-var STORE_DIR_COUNT = 0;
-
-function getStore() {
- return Task.spawn(function* () {
- let storeDir = do_get_tempdir().path;
- storeDir = OS.Path.join(storeDir, "store-" + STORE_DIR_COUNT++);
-
- yield OS.File.makeDir(storeDir, {unixMode: OS.Constants.libc.S_IRWXU});
-
- let s = new CrashStore(storeDir);
- yield s.load();
-
- return s;
- });
-}
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_constructor() {
- let s = new CrashStore("/some/path");
- Assert.ok(s instanceof CrashStore);
-});
-
-add_task(function* test_add_crash() {
- let s = yield getStore();
-
- Assert.equal(s.crashesCount, 0);
- let d = new Date(Date.now() - 5000);
- Assert.ok(s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "id1", d));
-
- Assert.equal(s.crashesCount, 1);
-
- let crashes = s.crashes;
- Assert.equal(crashes.length, 1);
- let c = crashes[0];
-
- Assert.equal(c.id, "id1", "ID set properly.");
- Assert.equal(c.crashDate.getTime(), d.getTime(), "Date set.");
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "id2", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-});
-
-add_task(function* test_reset() {
- let s = yield getStore();
-
- Assert.ok(s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "id1", DUMMY_DATE));
- Assert.equal(s.crashes.length, 1);
- s.reset();
- Assert.equal(s.crashes.length, 0);
-});
-
-add_task(function* test_save_load() {
- let s = yield getStore();
-
- yield s.save();
-
- let d1 = new Date();
- let d2 = new Date(d1.getTime() - 10000);
- Assert.ok(s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "id1", d1));
- Assert.ok(s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "id2", d2));
- Assert.ok(s.addSubmissionAttempt("id1", "sub1", d1));
- Assert.ok(s.addSubmissionResult("id1", "sub1", d2, SUBMISSION_RESULT_OK));
- Assert.ok(s.setRemoteCrashID("id1", "bp-1"));
-
- yield s.save();
-
- yield s.load();
- Assert.ok(!s.corruptDate);
- let crashes = s.crashes;
-
- Assert.equal(crashes.length, 2);
- let c = s.getCrash("id1");
- Assert.equal(c.crashDate.getTime(), d1.getTime());
- Assert.equal(c.remoteID, "bp-1");
-
- Assert.ok(!!c.submissions);
- let submission = c.submissions.get("sub1");
- Assert.ok(!!submission);
- Assert.equal(submission.requestDate.getTime(), d1.getTime());
- Assert.equal(submission.responseDate.getTime(), d2.getTime());
- Assert.equal(submission.result, SUBMISSION_RESULT_OK);
-});
-
-add_task(function* test_corrupt_json() {
- let s = yield getStore();
-
- let buffer = new TextEncoder().encode("{bad: json-file");
- yield OS.File.writeAtomic(s._storePath, buffer, {compression: "lz4"});
-
- yield s.load();
- Assert.ok(s.corruptDate, "Corrupt date is defined.");
-
- let date = s.corruptDate;
- yield s.save();
- s._data = null;
- yield s.load();
- Assert.ok(s.corruptDate);
- Assert.equal(date.getTime(), s.corruptDate.getTime());
-});
-
-add_task(function* test_add_main_crash() {
- let s = yield getStore();
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 1);
-
- let c = s.crashes[0];
- Assert.ok(c.crashDate);
- Assert.equal(c.type, PROCESS_TYPE_MAIN + "-" + CRASH_TYPE_CRASH);
- Assert.ok(c.isOfType(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH));
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "id2", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- // Duplicate.
- Assert.ok(
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "id3", new Date(),
- { OOMAllocationSize: 1048576 })
- );
- Assert.equal(s.crashesCount, 3);
- Assert.deepEqual(s.crashes[2].metadata, { OOMAllocationSize: 1048576 });
-
- let crashes = s.getCrashesOfType(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH);
- Assert.equal(crashes.length, 3);
-});
-
-add_task(function* test_add_main_hang() {
- let s = yield getStore();
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_HANG, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 1);
-
- let c = s.crashes[0];
- Assert.ok(c.crashDate);
- Assert.equal(c.type, PROCESS_TYPE_MAIN + "-" + CRASH_TYPE_HANG);
- Assert.ok(c.isOfType(PROCESS_TYPE_MAIN, CRASH_TYPE_HANG));
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_HANG, "id2", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_HANG, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- let crashes = s.getCrashesOfType(PROCESS_TYPE_MAIN, CRASH_TYPE_HANG);
- Assert.equal(crashes.length, 2);
-});
-
-add_task(function* test_add_content_crash() {
- let s = yield getStore();
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_CRASH, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 1);
-
- let c = s.crashes[0];
- Assert.ok(c.crashDate);
- Assert.equal(c.type, PROCESS_TYPE_CONTENT + "-" + CRASH_TYPE_CRASH);
- Assert.ok(c.isOfType(PROCESS_TYPE_CONTENT, CRASH_TYPE_CRASH));
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_CRASH, "id2", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_CRASH, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- let crashes = s.getCrashesOfType(PROCESS_TYPE_CONTENT, CRASH_TYPE_CRASH);
- Assert.equal(crashes.length, 2);
-});
-
-add_task(function* test_add_content_hang() {
- let s = yield getStore();
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_HANG, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 1);
-
- let c = s.crashes[0];
- Assert.ok(c.crashDate);
- Assert.equal(c.type, PROCESS_TYPE_CONTENT + "-" + CRASH_TYPE_HANG);
- Assert.ok(c.isOfType(PROCESS_TYPE_CONTENT, CRASH_TYPE_HANG));
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_HANG, "id2", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_HANG, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- let crashes = s.getCrashesOfType(PROCESS_TYPE_CONTENT, CRASH_TYPE_HANG);
- Assert.equal(crashes.length, 2);
-});
-
-add_task(function* test_add_plugin_crash() {
- let s = yield getStore();
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_CRASH, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 1);
-
- let c = s.crashes[0];
- Assert.ok(c.crashDate);
- Assert.equal(c.type, PROCESS_TYPE_PLUGIN + "-" + CRASH_TYPE_CRASH);
- Assert.ok(c.isOfType(PROCESS_TYPE_PLUGIN, CRASH_TYPE_CRASH));
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_CRASH, "id2", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_CRASH, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- let crashes = s.getCrashesOfType(PROCESS_TYPE_PLUGIN, CRASH_TYPE_CRASH);
- Assert.equal(crashes.length, 2);
-});
-
-add_task(function* test_add_plugin_hang() {
- let s = yield getStore();
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_HANG, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 1);
-
- let c = s.crashes[0];
- Assert.ok(c.crashDate);
- Assert.equal(c.type, PROCESS_TYPE_PLUGIN + "-" + CRASH_TYPE_HANG);
- Assert.ok(c.isOfType(PROCESS_TYPE_PLUGIN, CRASH_TYPE_HANG));
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_HANG, "id2", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_HANG, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- let crashes = s.getCrashesOfType(PROCESS_TYPE_PLUGIN, CRASH_TYPE_HANG);
- Assert.equal(crashes.length, 2);
-});
-
-add_task(function* test_add_gmplugin_crash() {
- let s = yield getStore();
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_GMPLUGIN, CRASH_TYPE_CRASH, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 1);
-
- let c = s.crashes[0];
- Assert.ok(c.crashDate);
- Assert.equal(c.type, PROCESS_TYPE_GMPLUGIN + "-" + CRASH_TYPE_CRASH);
- Assert.ok(c.isOfType(PROCESS_TYPE_GMPLUGIN, CRASH_TYPE_CRASH));
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_GMPLUGIN, CRASH_TYPE_CRASH, "id2", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_GMPLUGIN, CRASH_TYPE_CRASH, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- let crashes = s.getCrashesOfType(PROCESS_TYPE_GMPLUGIN, CRASH_TYPE_CRASH);
- Assert.equal(crashes.length, 2);
-});
-
-add_task(function* test_add_gpu_crash() {
- let s = yield getStore();
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_GPU, CRASH_TYPE_CRASH, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 1);
-
- let c = s.crashes[0];
- Assert.ok(c.crashDate);
- Assert.equal(c.type, PROCESS_TYPE_GPU + "-" + CRASH_TYPE_CRASH);
- Assert.ok(c.isOfType(PROCESS_TYPE_GPU, CRASH_TYPE_CRASH));
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_GPU, CRASH_TYPE_CRASH, "id2", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_GPU, CRASH_TYPE_CRASH, "id1", new Date())
- );
- Assert.equal(s.crashesCount, 2);
-
- let crashes = s.getCrashesOfType(PROCESS_TYPE_GPU, CRASH_TYPE_CRASH);
- Assert.equal(crashes.length, 2);
-});
-
-add_task(function* test_add_mixed_types() {
- let s = yield getStore();
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "mcrash", new Date()) &&
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_HANG, "mhang", new Date()) &&
- s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_CRASH, "ccrash", new Date()) &&
- s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_HANG, "chang", new Date()) &&
- s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_CRASH, "pcrash", new Date()) &&
- s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_HANG, "phang", new Date()) &&
- s.addCrash(PROCESS_TYPE_GMPLUGIN, CRASH_TYPE_CRASH, "gmpcrash", new Date()) &&
- s.addCrash(PROCESS_TYPE_GPU, CRASH_TYPE_CRASH, "gpucrash", new Date())
- );
-
- Assert.equal(s.crashesCount, 8);
-
- yield s.save();
-
- s._data.crashes.clear();
- Assert.equal(s.crashesCount, 0);
-
- yield s.load();
-
- Assert.equal(s.crashesCount, 8);
-
- let crashes = s.getCrashesOfType(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH);
- Assert.equal(crashes.length, 1);
- crashes = s.getCrashesOfType(PROCESS_TYPE_MAIN, CRASH_TYPE_HANG);
- Assert.equal(crashes.length, 1);
- crashes = s.getCrashesOfType(PROCESS_TYPE_CONTENT, CRASH_TYPE_CRASH);
- Assert.equal(crashes.length, 1);
- crashes = s.getCrashesOfType(PROCESS_TYPE_CONTENT, CRASH_TYPE_HANG);
- Assert.equal(crashes.length, 1);
- crashes = s.getCrashesOfType(PROCESS_TYPE_PLUGIN, CRASH_TYPE_CRASH);
- Assert.equal(crashes.length, 1);
- crashes = s.getCrashesOfType(PROCESS_TYPE_PLUGIN, CRASH_TYPE_HANG);
- Assert.equal(crashes.length, 1);
- crashes = s.getCrashesOfType(PROCESS_TYPE_GMPLUGIN, CRASH_TYPE_CRASH);
- Assert.equal(crashes.length, 1);
- crashes = s.getCrashesOfType(PROCESS_TYPE_GPU, CRASH_TYPE_CRASH);
- Assert.equal(crashes.length, 1);
-});
-
-// Crashes added beyond the high water mark behave properly.
-add_task(function* test_high_water() {
- let s = yield getStore();
-
- let d1 = new Date(2014, 0, 1, 0, 0, 0);
- let d2 = new Date(2014, 0, 2, 0, 0, 0);
-
- let i = 0;
- for (; i < s.HIGH_WATER_DAILY_THRESHOLD; i++) {
- Assert.ok(
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "mc1" + i, d1) &&
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "mc2" + i, d2) &&
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_HANG, "mh1" + i, d1) &&
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_HANG, "mh2" + i, d2) &&
-
- s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_CRASH, "cc1" + i, d1) &&
- s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_CRASH, "cc2" + i, d2) &&
- s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_HANG, "ch1" + i, d1) &&
- s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_HANG, "ch2" + i, d2) &&
-
- s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_CRASH, "pc1" + i, d1) &&
- s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_CRASH, "pc2" + i, d2) &&
- s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_HANG, "ph1" + i, d1) &&
- s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_HANG, "ph2" + i, d2)
- );
- }
-
- Assert.ok(
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "mc1" + i, d1) &&
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "mc2" + i, d2) &&
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_HANG, "mh1" + i, d1) &&
- s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_HANG, "mh2" + i, d2)
- );
-
- Assert.ok(!s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_CRASH, "cc1" + i, d1));
- Assert.ok(!s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_CRASH, "cc2" + i, d2));
- Assert.ok(!s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_HANG, "ch1" + i, d1));
- Assert.ok(!s.addCrash(PROCESS_TYPE_CONTENT, CRASH_TYPE_HANG, "ch2" + i, d2));
-
- Assert.ok(!s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_CRASH, "pc1" + i, d1));
- Assert.ok(!s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_CRASH, "pc2" + i, d2));
- Assert.ok(!s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_HANG, "ph1" + i, d1));
- Assert.ok(!s.addCrash(PROCESS_TYPE_PLUGIN, CRASH_TYPE_HANG, "ph2" + i, d2));
-
- // We preserve main process crashes and hangs. Content and plugin crashes and
- // hangs beyond should be discarded.
- Assert.equal(s.crashesCount, 12 * s.HIGH_WATER_DAILY_THRESHOLD + 4);
-
- let crashes = s.getCrashesOfType(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH);
- Assert.equal(crashes.length, 2 * s.HIGH_WATER_DAILY_THRESHOLD + 2);
- crashes = s.getCrashesOfType(PROCESS_TYPE_MAIN, CRASH_TYPE_HANG);
- Assert.equal(crashes.length, 2 * s.HIGH_WATER_DAILY_THRESHOLD + 2);
-
- crashes = s.getCrashesOfType(PROCESS_TYPE_CONTENT, CRASH_TYPE_CRASH);
- Assert.equal(crashes.length, 2 * s.HIGH_WATER_DAILY_THRESHOLD);
- crashes = s.getCrashesOfType(PROCESS_TYPE_CONTENT, CRASH_TYPE_HANG);
- Assert.equal(crashes.length, 2 * s.HIGH_WATER_DAILY_THRESHOLD);
-
- crashes = s.getCrashesOfType(PROCESS_TYPE_PLUGIN, CRASH_TYPE_CRASH);
- Assert.equal(crashes.length, 2 * s.HIGH_WATER_DAILY_THRESHOLD);
- crashes = s.getCrashesOfType(PROCESS_TYPE_PLUGIN, CRASH_TYPE_HANG);
- Assert.equal(crashes.length, 2 * s.HIGH_WATER_DAILY_THRESHOLD);
-
- // But raw counts should be preserved.
- let day1 = bsp.dateToDays(d1);
- let day2 = bsp.dateToDays(d2);
- Assert.ok(s._countsByDay.has(day1));
- Assert.ok(s._countsByDay.has(day2));
-
- Assert.equal(s._countsByDay.get(day1).
- get(PROCESS_TYPE_MAIN + "-" + CRASH_TYPE_CRASH),
- s.HIGH_WATER_DAILY_THRESHOLD + 1);
- Assert.equal(s._countsByDay.get(day1).
- get(PROCESS_TYPE_MAIN + "-" + CRASH_TYPE_HANG),
- s.HIGH_WATER_DAILY_THRESHOLD + 1);
-
- Assert.equal(s._countsByDay.get(day1).
- get(PROCESS_TYPE_CONTENT + "-" + CRASH_TYPE_CRASH),
- s.HIGH_WATER_DAILY_THRESHOLD + 1);
- Assert.equal(s._countsByDay.get(day1).
- get(PROCESS_TYPE_CONTENT + "-" + CRASH_TYPE_HANG),
- s.HIGH_WATER_DAILY_THRESHOLD + 1);
-
- Assert.equal(s._countsByDay.get(day1).
- get(PROCESS_TYPE_PLUGIN + "-" + CRASH_TYPE_CRASH),
- s.HIGH_WATER_DAILY_THRESHOLD + 1);
- Assert.equal(s._countsByDay.get(day1).
- get(PROCESS_TYPE_PLUGIN + "-" + CRASH_TYPE_HANG),
- s.HIGH_WATER_DAILY_THRESHOLD + 1);
-
- yield s.save();
- yield s.load();
-
- Assert.ok(s._countsByDay.has(day1));
- Assert.ok(s._countsByDay.has(day2));
-
- Assert.equal(s._countsByDay.get(day1).
- get(PROCESS_TYPE_MAIN + "-" + CRASH_TYPE_CRASH),
- s.HIGH_WATER_DAILY_THRESHOLD + 1);
- Assert.equal(s._countsByDay.get(day1).
- get(PROCESS_TYPE_MAIN + "-" + CRASH_TYPE_HANG),
- s.HIGH_WATER_DAILY_THRESHOLD + 1);
-
- Assert.equal(s._countsByDay.get(day1).
- get(PROCESS_TYPE_CONTENT + "-" + CRASH_TYPE_CRASH),
- s.HIGH_WATER_DAILY_THRESHOLD + 1);
- Assert.equal(s._countsByDay.get(day1).
- get(PROCESS_TYPE_CONTENT + "-" + CRASH_TYPE_HANG),
- s.HIGH_WATER_DAILY_THRESHOLD + 1);
-
- Assert.equal(s._countsByDay.get(day1).
- get(PROCESS_TYPE_PLUGIN + "-" + CRASH_TYPE_CRASH),
- s.HIGH_WATER_DAILY_THRESHOLD + 1);
- Assert.equal(s._countsByDay.get(day1).
- get(PROCESS_TYPE_PLUGIN + "-" + CRASH_TYPE_HANG),
- s.HIGH_WATER_DAILY_THRESHOLD + 1);
-});
-
-add_task(function* test_addSubmission() {
- let s = yield getStore();
-
- Assert.ok(s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "crash1",
- DUMMY_DATE));
-
- Assert.ok(s.addSubmissionAttempt("crash1", "sub1", DUMMY_DATE));
-
- let crash = s.getCrash("crash1");
- let submission = crash.submissions.get("sub1");
- Assert.ok(!!submission);
- Assert.equal(submission.requestDate.getTime(), DUMMY_DATE.getTime());
- Assert.equal(submission.responseDate, null);
- Assert.equal(submission.result, null);
-
- Assert.ok(s.addSubmissionResult("crash1", "sub1", DUMMY_DATE_2,
- SUBMISSION_RESULT_FAILED));
-
- crash = s.getCrash("crash1");
- Assert.equal(crash.submissions.size, 1);
- submission = crash.submissions.get("sub1");
- Assert.ok(!!submission);
- Assert.equal(submission.requestDate.getTime(), DUMMY_DATE.getTime());
- Assert.equal(submission.responseDate.getTime(), DUMMY_DATE_2.getTime());
- Assert.equal(submission.result, SUBMISSION_RESULT_FAILED);
-
- Assert.ok(s.addSubmissionAttempt("crash1", "sub2", DUMMY_DATE));
- Assert.ok(s.addSubmissionResult("crash1", "sub2", DUMMY_DATE_2,
- SUBMISSION_RESULT_OK));
-
- Assert.equal(crash.submissions.size, 2);
- submission = crash.submissions.get("sub2");
- Assert.ok(!!submission);
- Assert.equal(submission.result, SUBMISSION_RESULT_OK);
-});
-
-add_task(function* test_setCrashClassification() {
- let s = yield getStore();
-
- Assert.ok(s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "crash1",
- new Date()));
- let classifications = s.crashes[0].classifications;
- Assert.ok(!!classifications);
- Assert.equal(classifications.length, 0);
-
- Assert.ok(s.setCrashClassifications("crash1", ["foo", "bar"]));
- classifications = s.crashes[0].classifications;
- Assert.equal(classifications.length, 2);
- Assert.ok(classifications.indexOf("foo") != -1);
- Assert.ok(classifications.indexOf("bar") != -1);
-});
-
-add_task(function* test_setRemoteCrashID() {
- let s = yield getStore();
-
- Assert.ok(s.addCrash(PROCESS_TYPE_MAIN, CRASH_TYPE_CRASH, "crash1",
- new Date()));
- Assert.equal(s.crashes[0].remoteID, null);
- Assert.ok(s.setRemoteCrashID("crash1", "bp-1"));
- Assert.equal(s.crashes[0].remoteID, "bp-1");
-});
-
diff --git a/toolkit/components/crashes/tests/xpcshell/xpcshell.ini b/toolkit/components/crashes/tests/xpcshell/xpcshell.ini
deleted file mode 100644
index 5cb8a69d5..000000000
--- a/toolkit/components/crashes/tests/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-head =
-tail =
-skip-if = toolkit == 'android'
-
-[test_crash_manager.js]
-[test_crash_service.js]
-[test_crash_store.js]
diff --git a/toolkit/components/crashmonitor/moz.build b/toolkit/components/crashmonitor/moz.build
index 4656f6ab8..51f7b0d8c 100644
--- a/toolkit/components/crashmonitor/moz.build
+++ b/toolkit/components/crashmonitor/moz.build
@@ -4,8 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
-
EXTRA_JS_MODULES += [
'CrashMonitor.jsm',
]
diff --git a/toolkit/components/crashmonitor/test/unit/.eslintrc.js b/toolkit/components/crashmonitor/test/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/crashmonitor/test/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/crashmonitor/test/unit/head.js b/toolkit/components/crashmonitor/test/unit/head.js
deleted file mode 100644
index 6d7d50d0c..000000000
--- a/toolkit/components/crashmonitor/test/unit/head.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-
-var sessionCheckpointsPath;
-
-/**
- * Start the tasks of the different tests
- */
-function run_test()
-{
- do_get_profile();
- sessionCheckpointsPath = OS.Path.join(OS.Constants.Path.profileDir,
- "sessionCheckpoints.json");
- Components.utils.import("resource://gre/modules/CrashMonitor.jsm");
- run_next_test();
-}
diff --git a/toolkit/components/crashmonitor/test/unit/test_init.js b/toolkit/components/crashmonitor/test/unit/test_init.js
deleted file mode 100644
index d72f46aca..000000000
--- a/toolkit/components/crashmonitor/test/unit/test_init.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test that calling |init| twice throws an error
- */
-add_task(function test_init() {
- CrashMonitor.init();
- try {
- CrashMonitor.init();
- do_check_true(false);
- } catch (ex) {
- do_check_true(true);
- }
-});
diff --git a/toolkit/components/crashmonitor/test/unit/test_invalid_file.js b/toolkit/components/crashmonitor/test/unit/test_invalid_file.js
deleted file mode 100644
index cc55a2755..000000000
--- a/toolkit/components/crashmonitor/test/unit/test_invalid_file.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test with sessionCheckpoints.json containing invalid data
- */
-add_task(function* test_invalid_file() {
- // Write bogus data to checkpoint file
- let data = "1234";
- yield OS.File.writeAtomic(sessionCheckpointsPath, data,
- {tmpPath: sessionCheckpointsPath + ".tmp"});
-
- // An invalid file will cause |init| to return null
- let status = yield CrashMonitor.init();
- do_check_true(status === null ? true : false);
-
- // and |previousCheckpoints| will be null
- let checkpoints = yield CrashMonitor.previousCheckpoints;
- do_check_true(checkpoints === null ? true : false);
-});
diff --git a/toolkit/components/crashmonitor/test/unit/test_invalid_json.js b/toolkit/components/crashmonitor/test/unit/test_invalid_json.js
deleted file mode 100644
index f3b05208a..000000000
--- a/toolkit/components/crashmonitor/test/unit/test_invalid_json.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test with sessionCheckpoints.json containing invalid JSON data
- */
-add_task(function* test_invalid_file() {
- // Write bogus data to checkpoint file
- let data = "[}";
- yield OS.File.writeAtomic(sessionCheckpointsPath, data,
- {tmpPath: sessionCheckpointsPath + ".tmp"});
-
- CrashMonitor.init();
- let checkpoints = yield CrashMonitor.previousCheckpoints;
- do_check_eq(checkpoints, null);
-});
diff --git a/toolkit/components/crashmonitor/test/unit/test_missing_file.js b/toolkit/components/crashmonitor/test/unit/test_missing_file.js
deleted file mode 100644
index 9ce31da95..000000000
--- a/toolkit/components/crashmonitor/test/unit/test_missing_file.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test with non-existing sessionCheckpoints.json
- */
-add_task(function* test_missing_file() {
- CrashMonitor.init();
- let checkpoints = yield CrashMonitor.previousCheckpoints;
- do_check_eq(checkpoints, null);
-});
diff --git a/toolkit/components/crashmonitor/test/unit/test_register.js b/toolkit/components/crashmonitor/test/unit/test_register.js
deleted file mode 100644
index 33c73a5ae..000000000
--- a/toolkit/components/crashmonitor/test/unit/test_register.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test that CrashMonitor.jsm is correctly loaded from XPCOM component
- */
-add_task(function test_register() {
- let cm = Components.classes["@mozilla.org/toolkit/crashmonitor;1"]
- .createInstance(Components.interfaces.nsIObserver);
-
- // Send "profile-after-change" to trigger the initialization
- cm.observe(null, "profile-after-change", null);
-
- // If CrashMonitor was initialized properly a new call to |init|
- // should fail
- try {
- CrashMonitor.init();
- do_check_true(false);
- } catch (ex) {
- do_check_true(true);
- }
-});
diff --git a/toolkit/components/crashmonitor/test/unit/test_valid_file.js b/toolkit/components/crashmonitor/test/unit/test_valid_file.js
deleted file mode 100644
index d2f214cc0..000000000
--- a/toolkit/components/crashmonitor/test/unit/test_valid_file.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test with sessionCheckpoints.json containing valid data
- */
-add_task(function* test_valid_file() {
- // Write valid data to checkpoint file
- let data = JSON.stringify({"final-ui-startup": true});
- yield OS.File.writeAtomic(sessionCheckpointsPath, data,
- {tmpPath: sessionCheckpointsPath + ".tmp"});
-
- CrashMonitor.init();
- let checkpoints = yield CrashMonitor.previousCheckpoints;
-
- do_check_true(checkpoints["final-ui-startup"]);
- do_check_eq(Object.keys(checkpoints).length, 1);
-});
diff --git a/toolkit/components/crashmonitor/test/unit/xpcshell.ini b/toolkit/components/crashmonitor/test/unit/xpcshell.ini
deleted file mode 100644
index cd86b2535..000000000
--- a/toolkit/components/crashmonitor/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,11 +0,0 @@
-[DEFAULT]
-head = head.js
-tail =
-skip-if = toolkit == 'android'
-
-[test_init.js]
-[test_valid_file.js]
-[test_invalid_file.js]
-[test_invalid_json.js]
-[test_missing_file.js]
-[test_register.js]
diff --git a/toolkit/components/ctypes/moz.build b/toolkit/components/ctypes/moz.build
index c79110eeb..3270ce1d1 100644
--- a/toolkit/components/ctypes/moz.build
+++ b/toolkit/components/ctypes/moz.build
@@ -4,21 +4,10 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-TEST_DIRS += ['tests']
+LOCAL_INCLUDES += ['/js/xpconnect/loader']
-SOURCES += [
- 'ctypes.cpp',
-]
+SOURCES += ['ctypes.cpp']
-LOCAL_INCLUDES += [
- '/js/xpconnect/loader',
-]
-
-EXTRA_JS_MODULES += [
- 'ctypes.jsm',
-]
+EXTRA_JS_MODULES += ['ctypes.jsm']
FINAL_LIBRARY = 'xul'
-
-with Files('**'):
- BUG_COMPONENT = ('Core', 'js-ctypes')
diff --git a/toolkit/components/ctypes/tests/chrome/.eslintrc.js b/toolkit/components/ctypes/tests/chrome/.eslintrc.js
deleted file mode 100644
index 8c0f4f574..000000000
--- a/toolkit/components/ctypes/tests/chrome/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/ctypes/tests/chrome/chrome.ini b/toolkit/components/ctypes/tests/chrome/chrome.ini
deleted file mode 100644
index e34866be2..000000000
--- a/toolkit/components/ctypes/tests/chrome/chrome.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-skip-if = os == 'android'
-support-files =
- xpcshellTestHarnessAdaptor.js
- ctypes_worker.js
- ../unit/test_jsctypes.js
-
-[test_ctypes.xul]
diff --git a/toolkit/components/ctypes/tests/chrome/ctypes_worker.js b/toolkit/components/ctypes/tests/chrome/ctypes_worker.js
deleted file mode 100644
index ff128a758..000000000
--- a/toolkit/components/ctypes/tests/chrome/ctypes_worker.js
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-importScripts("xpcshellTestHarnessAdaptor.js");
-
-onmessage = function(event) {
- _WORKINGDIR_ = event.data.dir;
- _OS_ = event.data.os;
- importScripts("test_jsctypes.js");
- run_test();
- postMessage("Done!");
-}
diff --git a/toolkit/components/ctypes/tests/chrome/test_ctypes.xul b/toolkit/components/ctypes/tests/chrome/test_ctypes.xul
deleted file mode 100644
index bbe7fb0c9..000000000
--- a/toolkit/components/ctypes/tests/chrome/test_ctypes.xul
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<window title="DOM Worker Threads Test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="test();">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/chrome-harness.js"/>
-
- <script type="application/javascript">
- <![CDATA[
- Components.utils.import("resource://gre/modules/ctypes.jsm");
-
- CTYPES_TEST_LIB = ctypes.libraryName("jsctypes-test");
- CTYPES_UNICODE_LIB = ctypes.libraryName("jsctyp\u00E8s-t\u00EB\u00DFt");
-
- /*
- * input: string of the url where we are running from
- * return: nsILocalFile
- */
- function getCurrentDir(path) {
- var rootDir = getRootDirectory(window.location.href);
- var jar = getJar(rootDir);
-
- if (jar) {
- return extractJarToTmp(jar);
- } else {
- return getLocalDir(path);
- }
- }
-
- function getLocalDir(path) {
- let dir = Components.classes["@mozilla.org/file/directory_service;1"]
- .getService(Components.interfaces.nsIProperties)
- .get("CurWorkD", Components.interfaces.nsILocalFile);
- path = location.pathname;
- path = path.slice("content/".length,
- -1 * "/test_ctypes.xul".length);
- let components = path.split("/");
- for (let part in components) {
- dir.append(components[part]);
- }
- return dir;
- }
-
- function setupLibs(path) {
- let libFile = path.clone();
- libFile.append(CTYPES_TEST_LIB);
- ok(libFile.exists(), "ctypes test library doesn't exist!?");
-
- libFile.copyTo(null, CTYPES_UNICODE_LIB);
- }
-
- function cleanupLibs(path) {
- let unicodeFile = path.clone();
- unicodeFile.append(CTYPES_UNICODE_LIB);
- ok(unicodeFile.exists(), "ctypes unicode test library doesn't exist!?");
- unicodeFile.remove(false);
- }
-
- function test()
- {
- SimpleTest.waitForExplicitFinish();
-
- var dir = getCurrentDir(location.path);
- ok(dir.exists() && dir.isDirectory(), "Chrome test dir doesn't exist?!");
- setupLibs(dir);
-
- var worker = new ChromeWorker("ctypes_worker.js");
- worker.onmessage = function(event) {
- is(event.data, "Done!", "Wrong message!");
- cleanupLibs(dir);
- SimpleTest.finish();
- }
- worker.onerror = function(event) {
- if (event.message == "uncaught exception: 7.5 million years for that?" ||
- event.message == "uncaught exception: Just following orders, sir!") {
- // We throw those on purpose in the worker, so ignore them.
- return true;
- }
- ok(false, "Worker had an error: " + event.message);
- worker.terminate();
- cleanupLibs(dir);
- SimpleTest.finish();
- }
-
- worker.postMessage({dir: dir.path, os: Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULRuntime).OS});
- }
-
- ]]>
- </script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display:none;"></div>
- <pre id="test"></pre>
- </body>
- <label id="test-result"/>
-</window>
diff --git a/toolkit/components/ctypes/tests/chrome/xpcshellTestHarnessAdaptor.js b/toolkit/components/ctypes/tests/chrome/xpcshellTestHarnessAdaptor.js
deleted file mode 100644
index eec85025b..000000000
--- a/toolkit/components/ctypes/tests/chrome/xpcshellTestHarnessAdaptor.js
+++ /dev/null
@@ -1,100 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var _WORKINGDIR_ = null;
-var _OS_ = null;
-
-var Components = {
- classes: { },
- interfaces: { },
- stack: {
- caller: null
- },
- utils: {
- import: function() { }
- }
-};
-
-function do_throw(message, stack) {
- do_print("error: " + message);
- do_print("stack: " + (stack ? stack : new Error().stack));
- throw message;
-}
-
-function do_check_neq(left, right, stack) {
- if (left == right) {
- var text = "do_check_neq failed";
- try {
- text += ": " + left + " == " + right;
- } catch (e) {
- }
- do_throw(text, stack);
- }
-}
-
-function do_check_eq(left, right, stack) {
- if (left != right) {
- var text = "do_check_eq failed";
- try {
- text += ": " + left + " != " + right;
- } catch (e) {
- }
- do_throw(text, stack);
- }
-}
-
-function do_check_true(condition, stack) {
- do_check_eq(condition, true, stack);
-}
-
-function do_check_false(condition, stack) {
- do_check_eq(condition, false, stack);
-}
-
-function do_print(text) {
- dump("INFO: " + text + "\n");
-}
-
-function FileFaker(path) {
- this._path = path;
-}
-FileFaker.prototype = {
- get path() {
- return this._path;
- },
- get parent() {
- let lastSlash = this._path.lastIndexOf("/");
- if (lastSlash == -1) {
- return "";
- }
- this._path = this._path.substring(0, lastSlash);
- return this;
- },
- append: function(leaf) {
- this._path = this._path + "/" + leaf;
- }
-};
-
-function do_get_file(path, allowNonexistent) {
- if (!_WORKINGDIR_) {
- do_throw("No way to fake files if working directory is unknown!");
- }
-
- let lf = new FileFaker(_WORKINGDIR_);
- let bits = path.split("/");
- for (let i = 0; i < bits.length; i++) {
- if (bits[i]) {
- if (bits[i] == "..")
- lf = lf.parent;
- else
- lf.append(bits[i]);
- }
- }
- return lf;
-}
-
-function get_os() {
- return _OS_;
-}
diff --git a/toolkit/components/ctypes/tests/jsctypes-test-errno.cpp b/toolkit/components/ctypes/tests/jsctypes-test-errno.cpp
deleted file mode 100644
index 83a29e632..000000000
--- a/toolkit/components/ctypes/tests/jsctypes-test-errno.cpp
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdio.h>
-#include <errno.h>
-#if defined(XP_WIN)
-#include <windows.h>
-#endif // defined(XP_WIN)
-
-#include "jsctypes-test-errno.h"
-
-
-
-#define FAIL \
-{ \
- fprintf(stderr, "Assertion failed at line %i\n", __LINE__); \
- (*(int*)nullptr)++; \
-}
-
-
-void set_errno(int status)
-{
- errno = status;
-}
-int get_errno()
-{
- return errno;
-}
-
-#if defined(XP_WIN)
-void set_last_error(int status)
-{
- SetLastError((int)status);
-}
-int get_last_error()
-{
- return (int)GetLastError();
-}
-#endif // defined(XP_WIN)
diff --git a/toolkit/components/ctypes/tests/jsctypes-test-errno.h b/toolkit/components/ctypes/tests/jsctypes-test-errno.h
deleted file mode 100644
index 4d11b905b..000000000
--- a/toolkit/components/ctypes/tests/jsctypes-test-errno.h
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/Attributes.h"
-#include "mozilla/Types.h"
-
-#define EXPORT_CDECL(type) MOZ_EXPORT type
-
-MOZ_BEGIN_EXTERN_C
-
- EXPORT_CDECL(void) set_errno(int status);
- EXPORT_CDECL(int) get_errno();
-
-#if defined(XP_WIN)
- EXPORT_CDECL(void) set_last_error(int status);
- EXPORT_CDECL(int) get_last_error();
-#endif // defined(XP_WIN)
-
-MOZ_END_EXTERN_C
diff --git a/toolkit/components/ctypes/tests/jsctypes-test-finalizer.cpp b/toolkit/components/ctypes/tests/jsctypes-test-finalizer.cpp
deleted file mode 100644
index 009ba917a..000000000
--- a/toolkit/components/ctypes/tests/jsctypes-test-finalizer.cpp
+++ /dev/null
@@ -1,323 +0,0 @@
-#include "errno.h"
-
-#include "jsctypes-test.h"
-#include "jsctypes-test-finalizer.h"
-
-/**
- * Shared infrastructure
- */
-
-
-/**
- * An array of integers representing resources.
- * - 0: unacquired
- * - 1: acquired
- * - < 0: error, resource has been released several times.
- */
-int *gFinalizerTestResources = nullptr;
-char **gFinalizerTestNames = nullptr;
-size_t gFinalizerTestSize;
-
-void
-test_finalizer_start(size_t size)
-{
- gFinalizerTestResources = new int[size];
- gFinalizerTestNames = new char*[size];
- gFinalizerTestSize = size;
- for (size_t i = 0; i < size; ++i) {
- gFinalizerTestResources[i] = 0;
- gFinalizerTestNames[i] = nullptr;
- }
-}
-
-void
-test_finalizer_stop()
-{
- delete[] gFinalizerTestResources;
-}
-
-/**
- * Check if an acquired resource has been released
- */
-bool
-test_finalizer_resource_is_acquired(size_t i)
-{
- return gFinalizerTestResources[i] == 1;
-}
-// Resource type: size_t
-
-// Acquire resource i
-size_t
-test_finalizer_acq_size_t(size_t i)
-{
- gFinalizerTestResources[i] = 1;
- return i;
-}
-
-// Release resource i
-void
-test_finalizer_rel_size_t(size_t i)
-{
- if (--gFinalizerTestResources[i] < 0) {
- MOZ_CRASH("Assertion failed");
- }
-}
-
-size_t
-test_finalizer_rel_size_t_return_size_t(size_t i)
-{
- if (-- gFinalizerTestResources[i] < 0) {
- MOZ_CRASH("Assertion failed");
- }
- return i;
-}
-
-myRECT
-test_finalizer_rel_size_t_return_struct_t(size_t i)
-{
- if (-- gFinalizerTestResources[i] < 0) {
- MOZ_CRASH("Assertion failed");
- }
- const int32_t narrowed = (int32_t)i;
- myRECT result = { narrowed, narrowed, narrowed, narrowed };
- return result;
-}
-
-bool
-test_finalizer_cmp_size_t(size_t a, size_t b)
-{
- return a==b;
-}
-
-// Resource type: int32_t
-
-// Acquire resource i
-int32_t
-test_finalizer_acq_int32_t(size_t i)
-{
- gFinalizerTestResources[i] = 1;
- return i;
-}
-
-// Release resource i
-void
-test_finalizer_rel_int32_t(int32_t i)
-{
- if (--gFinalizerTestResources[i] < 0) {
- MOZ_CRASH("Assertion failed");
- }
-}
-
-bool
-test_finalizer_cmp_int32_t(int32_t a, int32_t b)
-{
- return a==b;
-}
-
-// Resource type: int64_t
-
-// Acquire resource i
-int64_t
-test_finalizer_acq_int64_t(size_t i)
-{
- gFinalizerTestResources[i] = 1;
- return i;
-}
-
-// Release resource i
-void
-test_finalizer_rel_int64_t(int64_t i)
-{
- if (-- gFinalizerTestResources[i] < 0) {
- MOZ_CRASH("Assertion failed");
- }
-}
-
-bool
-test_finalizer_cmp_int64_t(int64_t a, int64_t b)
-{
- return a==b;
-}
-
-// Resource type: void*
-
-// Acquire resource i
-void*
-test_finalizer_acq_ptr_t(size_t i)
-{
- gFinalizerTestResources[i] = 1;
- return (void*)&gFinalizerTestResources[i];
-}
-
-// Release resource i
-void
-test_finalizer_rel_ptr_t(void *i)
-{
- int *as_int = (int*)i;
- -- (*as_int);
- if (*as_int < 0) {
- MOZ_CRASH("Assertion failed");
- }
-}
-
-bool
-test_finalizer_cmp_ptr_t(void *a, void *b)
-{
- return a==b;
-}
-
-// Resource type: int32_t*
-
-// Acquire resource i
-int32_t*
-test_finalizer_acq_int32_ptr_t(size_t i)
-{
- gFinalizerTestResources[i] = 1;
- return (int32_t*)&gFinalizerTestResources[i];
-}
-
-// Release resource i
-void
-test_finalizer_rel_int32_ptr_t(int32_t *i)
-{
- -- (*i);
- if (*i < 0) {
- MOZ_CRASH("Assertion failed");
- }
-}
-
-bool
-test_finalizer_cmp_int32_ptr_t(int32_t *a, int32_t *b)
-{
- return a==b;
-}
-
-// Resource type: nullptr
-
-// Acquire resource i
-void*
-test_finalizer_acq_null_t(size_t i)
-{
- gFinalizerTestResources[0] = 1;//Always index 0
- return nullptr;
-}
-
-// Release resource i
-void
-test_finalizer_rel_null_t(void *i)
-{
- if (i != nullptr) {
- MOZ_CRASH("Assertion failed");
- }
- gFinalizerTestResources[0] --;
-}
-
-bool
-test_finalizer_null_resource_is_acquired(size_t)
-{
- return gFinalizerTestResources[0] == 1;
-}
-
-bool
-test_finalizer_cmp_null_t(void *a, void *b)
-{
- return a==b;
-}
-
-// Resource type: char*
-
-// Acquire resource i
-char*
-test_finalizer_acq_string_t(int i)
-{
- gFinalizerTestResources[i] = 1;
- if (!gFinalizerTestNames[i]) {
- char* buf = new char[12];
- snprintf(buf, 12, "%d", i);
- gFinalizerTestNames[i] = buf;
- return buf;
- }
- return gFinalizerTestNames[i];
-}
-
-// Release resource i
-void
-test_finalizer_rel_string_t(char *i)
-{
- int index = atoi(i);
- if (index < 0 || index >= (int)gFinalizerTestSize) {
- MOZ_CRASH("Assertion failed");
- }
- gFinalizerTestResources[index] --;
-}
-
-bool
-test_finalizer_string_resource_is_acquired(size_t i)
-{
- return gFinalizerTestResources[i] == 1;
-}
-
-bool
-test_finalizer_cmp_string_t(char *a, char *b)
-{
- return !strncmp(a, b, 10);
-}
-
-// Resource type: myRECT
-
-// Acquire resource i
-myRECT
-test_finalizer_acq_struct_t(int i)
-{
- gFinalizerTestResources[i] = 1;
- myRECT result = { i, i, i, i };
- return result;
-}
-
-// Release resource i
-void
-test_finalizer_rel_struct_t(myRECT i)
-{
- int index = i.top;
- if (index < 0 || index >= (int)gFinalizerTestSize) {
- MOZ_CRASH("Assertion failed");
- }
- gFinalizerTestResources[index] --;
-}
-
-bool
-test_finalizer_struct_resource_is_acquired(myRECT i)
-{
- int index = i.top;
- if (index < 0 || index >= (int)gFinalizerTestSize) {
- MOZ_CRASH("Assertion failed");
- }
- return gFinalizerTestResources[index] == 1;
-}
-
-bool
-test_finalizer_cmp_struct_t(myRECT a, myRECT b)
-{
- return a.top == b.top;
-}
-
-// Support for checking that we reject nullptr finalizer
-afun* test_finalizer_rel_null_function()
-{
- return nullptr;
-}
-
-void
-test_finalizer_rel_size_t_set_errno(size_t i)
-{
- if (-- gFinalizerTestResources[i] < 0) {
- MOZ_CRASH("Assertion failed");
- }
- errno = 10;
-}
-
-void
-reset_errno()
-{
- errno = 0;
-}
diff --git a/toolkit/components/ctypes/tests/jsctypes-test-finalizer.h b/toolkit/components/ctypes/tests/jsctypes-test-finalizer.h
deleted file mode 100644
index f942e7f44..000000000
--- a/toolkit/components/ctypes/tests/jsctypes-test-finalizer.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/Attributes.h"
-#include "mozilla/Types.h"
-
-#define EXPORT_CDECL(type) MOZ_EXPORT type
-
-MOZ_BEGIN_EXTERN_C
-
- EXPORT_CDECL(void) test_finalizer_start(size_t size);
- EXPORT_CDECL(void) test_finalizer_stop();
- EXPORT_CDECL(bool) test_finalizer_resource_is_acquired(size_t i);
-
- EXPORT_CDECL(size_t) test_finalizer_acq_size_t(size_t i);
- EXPORT_CDECL(void) test_finalizer_rel_size_t(size_t i);
- EXPORT_CDECL(size_t) test_finalizer_rel_size_t_return_size_t(size_t i);
- EXPORT_CDECL(myRECT) test_finalizer_rel_size_t_return_struct_t(size_t i);
- EXPORT_CDECL(bool) test_finalizer_cmp_size_t(size_t a, size_t b);
-
- EXPORT_CDECL(int32_t) test_finalizer_acq_int32_t(size_t i);
- EXPORT_CDECL(void) test_finalizer_rel_int32_t(int32_t i);
- EXPORT_CDECL(bool) test_finalizer_cmp_int32_t(int32_t a, int32_t b);
-
- EXPORT_CDECL(int64_t) test_finalizer_acq_int64_t(size_t i);
- EXPORT_CDECL(void) test_finalizer_rel_int64_t(int64_t i);
- EXPORT_CDECL(bool) test_finalizer_cmp_int64_t(int64_t a, int64_t b);
-
- EXPORT_CDECL(void*) test_finalizer_acq_ptr_t(size_t i);
- EXPORT_CDECL(void) test_finalizer_rel_ptr_t(void *i);
- EXPORT_CDECL(bool) test_finalizer_cmp_ptr_t(void *a, void *b);
-
- EXPORT_CDECL(int32_t*) test_finalizer_acq_int32_ptr_t(size_t i);
- EXPORT_CDECL(void) test_finalizer_rel_int32_ptr_t(int32_t *i);
- EXPORT_CDECL(bool) test_finalizer_cmp_int32_ptr_t(int32_t *a, int32_t *b);
-
- EXPORT_CDECL(char*) test_finalizer_acq_string_t(int i);
- EXPORT_CDECL(void) test_finalizer_rel_string_t(char *i);
- EXPORT_CDECL(bool) test_finalizer_cmp_string_t(char *a, char *b);
-
- EXPORT_CDECL(void*) test_finalizer_acq_null_t(size_t i);
- EXPORT_CDECL(void) test_finalizer_rel_null_t(void *i);
- EXPORT_CDECL(bool) test_finalizer_cmp_null_t(void *a, void *b);
- EXPORT_CDECL(bool) test_finalizer_null_resource_is_acquired(size_t i);
-
- EXPORT_CDECL(myRECT) test_finalizer_acq_struct_t(int i);
- EXPORT_CDECL(void) test_finalizer_rel_struct_t(myRECT i);
- EXPORT_CDECL(bool) test_finalizer_cmp_struct_t(myRECT a, myRECT b);
-
- typedef void (*afun)(size_t);
- EXPORT_CDECL(afun*) test_finalizer_rel_null_function();
-
- EXPORT_CDECL(void) test_finalizer_rel_size_t_set_errno(size_t i);
- EXPORT_CDECL(void) reset_errno();
-
-MOZ_END_EXTERN_C
diff --git a/toolkit/components/ctypes/tests/jsctypes-test.cpp b/toolkit/components/ctypes/tests/jsctypes-test.cpp
deleted file mode 100644
index d0e84a66c..000000000
--- a/toolkit/components/ctypes/tests/jsctypes-test.cpp
+++ /dev/null
@@ -1,394 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "jsctypes-test.h"
-#include <math.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include "typedefs.h"
-
-template <typename T> struct ValueTraits {
- static T literal() { return static_cast<T>(109.25); }
- static T sum(T a, T b) { return a + b; }
- static T sum_many(
- T a, T b, T c, T d, T e, T f, T g, T h, T i,
- T j, T k, T l, T m, T n, T o, T p, T q, T r)
- {
- return a + b + c + d + e + f + g + h + i + j + k + l + m + n + o + p + q + r;
- }
-};
-
-template <> struct ValueTraits<bool> {
- typedef bool T;
- static T literal() { return true; }
- static T sum(T a, T b) { return a || b; }
- static T sum_many(
- T a, T b, T c, T d, T e, T f, T g, T h, T i,
- T j, T k, T l, T m, T n, T o, T p, T q, T r)
- {
- return a || b || c || d || e || f || g || h || i ||
- j || k || l || m || n || o || p || q || r;
- }
-};
-
-void
-test_void_t_cdecl()
-{
- // do nothing
- return;
-}
-
-// The "AndUnderscore" bit here is an unfortunate hack: the first argument to
-// DEFINE_CDECL_FUNCTIONS and DEFINE_STDCALL_FUNCTIONS, in addition to being a
-// type, may also be a *macro* on NetBSD -- #define int8_t __int8_t and so on.
-// See <http://mail-index.netbsd.org/tech-toolchain/2014/12/18/msg002479.html>.
-// And unfortunately, passing that macro as an argument to this macro causes it
-// to be expanded -- producing get___int8_t_cdecl() and so on. Concatenating
-// int8_t with _ slightly muddies this code but inhibits expansion. See also
-// bug 1113379.
-#define FUNCTION_TESTS(nameAndUnderscore, type, ffiType, suffix) \
-type ABI \
-get_##nameAndUnderscore##suffix() \
-{ \
- return ValueTraits<type>::literal(); \
-} \
- \
-type ABI \
-set_##nameAndUnderscore##suffix(type x) \
-{ \
- return x; \
-} \
- \
-type ABI \
-sum_##nameAndUnderscore##suffix(type x, type y) \
-{ \
- return ValueTraits<type>::sum(x, y); \
-} \
- \
-type ABI \
-sum_alignb_##nameAndUnderscore##suffix(char a, type x, char b, type y, char c)\
-{ \
- return ValueTraits<type>::sum(x, y); \
-} \
- \
-type ABI \
-sum_alignf_##nameAndUnderscore##suffix(float a, type x, float b, type y, float c)\
-{ \
- return ValueTraits<type>::sum(x, y); \
-} \
- \
-type ABI \
-sum_many_##nameAndUnderscore##suffix( \
- type a, type b, type c, type d, type e, type f, type g, type h, type i, \
- type j, type k, type l, type m, type n, type o, type p, type q, type r) \
-{ \
- return ValueTraits<type>::sum_many(a, b, c, d, e, f, g, h, i, \
- j, k, l, m, n, o, p, q, r); \
-}
-
-#define ABI /* cdecl */
-#define DEFINE_CDECL_FUNCTIONS(x, y, z) FUNCTION_TESTS(x##_, y, z, cdecl)
-CTYPES_FOR_EACH_TYPE(DEFINE_CDECL_FUNCTIONS)
-#undef DEFINE_CDECL_FUNCTIONS
-#undef ABI
-
-#if defined(_WIN32)
-
-void NS_STDCALL
-test_void_t_stdcall()
-{
- // do nothing
- return;
-}
-
-#define ABI NS_STDCALL
-#define DEFINE_STDCALL_FUNCTIONS(x, y, z) FUNCTION_TESTS(x##_, y, z, stdcall)
-CTYPES_FOR_EACH_TYPE(DEFINE_STDCALL_FUNCTIONS)
-#undef DEFINE_STDCALL_FUNCTIONS
-#undef ABI
-
-#endif /* defined(_WIN32) */
-
-#define DEFINE_CDECL_TYPE_STATS(name, type, ffiType) \
-struct align_##name { \
- char x; \
- type y; \
-}; \
-struct nested_##name { \
- char a; \
- align_##name b; \
- char c; \
-}; \
- \
-void \
-get_##name##_stats(size_t* align, size_t* size, size_t* nalign, size_t* nsize, \
- size_t offsets[]) \
-{ \
- *align = offsetof(align_##name, y); \
- *size = sizeof(align_##name); \
- *nalign = offsetof(nested_##name, b); \
- *nsize = sizeof(nested_##name); \
- offsets[0] = offsetof(align_##name, y); \
- offsets[1] = offsetof(nested_##name, b); \
- offsets[2] = offsetof(nested_##name, c); \
-}
-CTYPES_FOR_EACH_TYPE(DEFINE_CDECL_TYPE_STATS)
-#undef DEFINE_CDECL_TYPE_STATS
-
-template <typename T>
-int32_t StrLen(const T* string)
-{
- const T *end;
- for (end = string; *end; ++end);
- return end - string;
-}
-
-int32_t
-test_ansi_len(const char* string)
-{
- return StrLen(string);
-}
-
-int32_t
-test_wide_len(const char16_t* string)
-{
- return StrLen(string);
-}
-
-const char *
-test_ansi_ret()
-{
- return "success";
-}
-
-const char16_t *
-test_wide_ret()
-{
- static const char16_t kSuccess[] = {'s', 'u', 'c', 'c', 'e', 's', 's', '\0'};
- return kSuccess;
-}
-
-char *
-test_ansi_echo(const char* string)
-{
- return (char*)string;
-}
-
-int32_t
-test_pt_in_rect(myRECT rc, myPOINT pt)
-{
- if (pt.x < rc.left || pt.x > rc.right)
- return 0;
- if (pt.y < rc.bottom || pt.y > rc.top)
- return 0;
- return 1;
-}
-
-void
-test_init_pt(myPOINT* pt, int32_t x, int32_t y)
-{
- pt->x = x;
- pt->y = y;
-}
-
-int32_t
-test_nested_struct(NESTED n)
-{
- return int32_t(n.n1 + n.n2 + n.inner.i1 + n.inner.i2 + n.inner.i3 + n.n3 + n.n4);
-}
-
-myPOINT
-test_struct_return(myRECT r)
-{
- myPOINT p;
- p.x = r.left; p.y = r.top;
- return p;
-}
-
-myRECT
-test_large_struct_return(myRECT a, myRECT b)
-{
- myRECT r;
- r.left = a.left; r.right = a.right;
- r.top = b.top; r.bottom = b.bottom;
- return r;
-}
-
-ONE_BYTE
-test_1_byte_struct_return(myRECT r)
-{
- ONE_BYTE s;
- s.a = r.top;
- return s;
-}
-
-TWO_BYTE
-test_2_byte_struct_return(myRECT r)
-{
- TWO_BYTE s;
- s.a = r.top;
- s.b = r.left;
- return s;
-}
-
-THREE_BYTE
-test_3_byte_struct_return(myRECT r)
-{
- THREE_BYTE s;
- s.a = r.top;
- s.b = r.left;
- s.c = r.bottom;
- return s;
-}
-
-FOUR_BYTE
-test_4_byte_struct_return(myRECT r)
-{
- FOUR_BYTE s;
- s.a = r.top;
- s.b = r.left;
- s.c = r.bottom;
- s.d = r.right;
- return s;
-}
-
-FIVE_BYTE
-test_5_byte_struct_return(myRECT r)
-{
- FIVE_BYTE s;
- s.a = r.top;
- s.b = r.left;
- s.c = r.bottom;
- s.d = r.right;
- s.e = r.top;
- return s;
-}
-
-SIX_BYTE
-test_6_byte_struct_return(myRECT r)
-{
- SIX_BYTE s;
- s.a = r.top;
- s.b = r.left;
- s.c = r.bottom;
- s.d = r.right;
- s.e = r.top;
- s.f = r.left;
- return s;
-}
-
-SEVEN_BYTE
-test_7_byte_struct_return(myRECT r)
-{
- SEVEN_BYTE s;
- s.a = r.top;
- s.b = r.left;
- s.c = r.bottom;
- s.d = r.right;
- s.e = r.top;
- s.f = r.left;
- s.g = r.bottom;
- return s;
-}
-
-void *
-test_fnptr()
-{
- return (void*)(uintptr_t)test_ansi_len;
-}
-
-int32_t
-test_closure_cdecl(int8_t i, test_func_ptr f)
-{
- return f(i);
-}
-
-#if defined(_WIN32)
-int32_t
-test_closure_stdcall(int8_t i, test_func_ptr_stdcall f)
-{
- return f(i);
-}
-#endif /* defined(_WIN32) */
-
-template <typename T> struct PromotedTraits {
- typedef T type;
-};
-#define DECL_PROMOTED(FROM, TO) \
- template <> struct PromotedTraits<FROM> { \
- typedef TO type; \
- }
-DECL_PROMOTED(bool, int);
-DECL_PROMOTED(char, int);
-DECL_PROMOTED(short, int);
-
-int32_t
-test_sum_va_cdecl(uint8_t n, ...)
-{
- va_list list;
- int32_t sum = 0;
- va_start(list, n);
- for (uint8_t i = 0; i < n; ++i)
- sum += va_arg(list, PromotedTraits<int32_t>::type);
- va_end(list);
- return sum;
-}
-
-uint8_t
-test_count_true_va_cdecl(uint8_t n, ...)
-{
- va_list list;
- uint8_t count = 0;
- va_start(list, n);
- for (uint8_t i = 0; i < n; ++i)
- if (va_arg(list, PromotedTraits<bool>::type))
- count += 1;
- va_end(list);
- return count;
-}
-
-void
-test_add_char_short_int_va_cdecl(uint32_t* result, ...)
-{
- va_list list;
- va_start(list, result);
- *result += va_arg(list, PromotedTraits<char>::type);
- *result += va_arg(list, PromotedTraits<short>::type);
- *result += va_arg(list, PromotedTraits<int>::type);
- va_end(list);
-}
-
-int32_t*
-test_vector_add_va_cdecl(uint8_t num_vecs,
- uint8_t vec_len,
- int32_t* result, ...)
-{
- va_list list;
- va_start(list, result);
- uint8_t i;
- for (i = 0; i < vec_len; ++i)
- result[i] = 0;
- for (i = 0; i < num_vecs; ++i) {
- int32_t* vec = va_arg(list, int32_t*);
- for (uint8_t j = 0; j < vec_len; ++j)
- result[j] += vec[j];
- }
- va_end(list);
- return result;
-}
-
-myRECT data_rect = { -1, -2, 3, 4 };
-
-TestClass::TestClass(int32_t a)
-{
- mInt =a;
-}
-
-int32_t
-TestClass::Add(int32_t aOther)
-{
- mInt += aOther;
- return mInt;
-}
diff --git a/toolkit/components/ctypes/tests/jsctypes-test.h b/toolkit/components/ctypes/tests/jsctypes-test.h
deleted file mode 100644
index 14eb8c915..000000000
--- a/toolkit/components/ctypes/tests/jsctypes-test.h
+++ /dev/null
@@ -1,197 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef jsctypes_test_h
-#define jsctypes_test_h
-
-#include "mozilla/Attributes.h"
-#include "mozilla/Types.h"
-#include "jspubtd.h"
-#include "typedefs.h"
-
-#define EXPORT_CDECL(type) MOZ_EXPORT type
-#if defined(_WIN32)
-#if defined(_WIN64)
-#define NS_STDCALL
-#else
-#define NS_STDCALL __stdcall
-#endif
-#define EXPORT_STDCALL(type) MOZ_EXPORT type NS_STDCALL
-#endif
-
-MOZ_BEGIN_EXTERN_C
-
- EXPORT_CDECL(void) test_void_t_cdecl();
-
- EXPORT_CDECL(void*) get_voidptr_t_cdecl();
- EXPORT_CDECL(void*) set_voidptr_t_cdecl(void*);
-
-#define DECLARE_CDECL_FUNCTIONS(name, type, ffiType) \
- EXPORT_CDECL(type) get_##name##_cdecl(); \
- EXPORT_CDECL(type) set_##name##_cdecl(type); \
- EXPORT_CDECL(type) sum_##name##_cdecl(type, type); \
- EXPORT_CDECL(type) sum_alignb_##name##_cdecl(char, type, char, type, char); \
- EXPORT_CDECL(type) sum_alignf_##name##_cdecl( \
- float, type, float, type, float); \
- EXPORT_CDECL(type) sum_many_##name##_cdecl( \
- type, type, type, type, type, type, type, type, type, \
- type, type, type, type, type, type, type, type, type); \
- \
- EXPORT_CDECL(void) get_##name##_stats(size_t* align, size_t* size, \
- size_t* nalign, size_t* nsize, \
- size_t offsets[]);
- CTYPES_FOR_EACH_TYPE(DECLARE_CDECL_FUNCTIONS)
-#undef DECLARE_CDECL_FUNCTIONS
-
-#if defined(_WIN32)
- EXPORT_STDCALL(void) test_void_t_stdcall();
-
- EXPORT_STDCALL(void*) get_voidptr_t_stdcall();
- EXPORT_STDCALL(void*) set_voidptr_t_stdcall(void*);
-
-#define DECLARE_STDCALL_FUNCTIONS(name, type, ffiType) \
- EXPORT_STDCALL(type) get_##name##_stdcall(); \
- EXPORT_STDCALL(type) set_##name##_stdcall(type); \
- EXPORT_STDCALL(type) sum_##name##_stdcall(type, type); \
- EXPORT_STDCALL(type) sum_alignb_##name##_stdcall( \
- char, type, char, type, char); \
- EXPORT_STDCALL(type) sum_alignf_##name##_stdcall( \
- float, type, float, type, float); \
- EXPORT_STDCALL(type) sum_many_##name##_stdcall( \
- type, type, type, type, type, type, type, type, type, \
- type, type, type, type, type, type, type, type, type);
- CTYPES_FOR_EACH_TYPE(DECLARE_STDCALL_FUNCTIONS)
-#undef DECLARE_STDCALL_FUNCTIONS
-
-#endif /* defined(_WIN32) */
-
- MOZ_EXPORT int32_t test_ansi_len(const char*);
- MOZ_EXPORT int32_t test_wide_len(const char16_t*);
- MOZ_EXPORT const char* test_ansi_ret();
- MOZ_EXPORT const char16_t* test_wide_ret();
- MOZ_EXPORT char* test_ansi_echo(const char*);
-
- struct ONE_BYTE {
- char a;
- };
-
- struct TWO_BYTE {
- char a;
- char b;
- };
-
- struct THREE_BYTE {
- char a;
- char b;
- char c;
- };
-
- struct FOUR_BYTE {
- char a;
- char b;
- char c;
- char d;
- };
-
- struct FIVE_BYTE {
- char a;
- char b;
- char c;
- char d;
- char e;
- };
-
- struct SIX_BYTE {
- char a;
- char b;
- char c;
- char d;
- char e;
- char f;
- };
-
- struct SEVEN_BYTE {
- char a;
- char b;
- char c;
- char d;
- char e;
- char f;
- char g;
- };
-
- struct myPOINT {
- int32_t x;
- int32_t y;
- };
-
- struct myRECT {
- int32_t top;
- int32_t left;
- int32_t bottom;
- int32_t right;
- };
-
- struct INNER {
- uint8_t i1;
- int64_t i2;
- uint8_t i3;
- };
-
- struct NESTED {
- int32_t n1;
- int16_t n2;
- INNER inner;
- int64_t n3;
- int32_t n4;
- };
-
- MOZ_EXPORT int32_t test_pt_in_rect(myRECT, myPOINT);
- MOZ_EXPORT void test_init_pt(myPOINT* pt, int32_t x, int32_t y);
-
- MOZ_EXPORT int32_t test_nested_struct(NESTED);
- MOZ_EXPORT myPOINT test_struct_return(myRECT);
- MOZ_EXPORT myRECT test_large_struct_return(myRECT, myRECT);
- MOZ_EXPORT ONE_BYTE test_1_byte_struct_return(myRECT);
- MOZ_EXPORT TWO_BYTE test_2_byte_struct_return(myRECT);
- MOZ_EXPORT THREE_BYTE test_3_byte_struct_return(myRECT);
- MOZ_EXPORT FOUR_BYTE test_4_byte_struct_return(myRECT);
- MOZ_EXPORT FIVE_BYTE test_5_byte_struct_return(myRECT);
- MOZ_EXPORT SIX_BYTE test_6_byte_struct_return(myRECT);
- MOZ_EXPORT SEVEN_BYTE test_7_byte_struct_return(myRECT);
-
- MOZ_EXPORT void * test_fnptr();
-
- typedef int32_t (* test_func_ptr)(int8_t);
- MOZ_EXPORT int32_t test_closure_cdecl(int8_t, test_func_ptr);
-#if defined(_WIN32)
- typedef int32_t (NS_STDCALL * test_func_ptr_stdcall)(int8_t);
- MOZ_EXPORT int32_t test_closure_stdcall(int8_t, test_func_ptr_stdcall);
-#endif /* defined(_WIN32) */
-
- MOZ_EXPORT int32_t test_callme(int8_t);
- MOZ_EXPORT void* test_getfn();
-
- EXPORT_CDECL(int32_t) test_sum_va_cdecl(uint8_t n, ...);
- EXPORT_CDECL(uint8_t) test_count_true_va_cdecl(uint8_t n, ...);
- EXPORT_CDECL(void) test_add_char_short_int_va_cdecl(uint32_t* result, ...);
- EXPORT_CDECL(int32_t*) test_vector_add_va_cdecl(uint8_t num_vecs,
- uint8_t vec_len,
- int32_t* result, ...);
-
- MOZ_EXPORT extern myRECT data_rect;
-
-MOZ_END_EXTERN_C
-
-class MOZ_EXPORT TestClass final {
-public:
- explicit TestClass(int32_t);
- int32_t Add(int32_t);
-
-private:
- int32_t mInt;
-};
-
-#endif
diff --git a/toolkit/components/ctypes/tests/moz.build b/toolkit/components/ctypes/tests/moz.build
deleted file mode 100644
index 22cbe4edc..000000000
--- a/toolkit/components/ctypes/tests/moz.build
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DIST_INSTALL = False
-
-XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
-MOCHITEST_CHROME_MANIFESTS += ['chrome/chrome.ini']
-
-UNIFIED_SOURCES += [
- 'jsctypes-test-errno.cpp',
- 'jsctypes-test-finalizer.cpp',
- 'jsctypes-test.cpp',
-]
-
-SharedLibrary('jsctypes-test')
-
-LOCAL_INCLUDES += [
- '/js/src/ctypes',
-]
-
-# Don't use STL wrappers here (i.e. wrapped <new>); they require mozalloc.
-DISABLE_STL_WRAPPING = True
-
-if CONFIG['COMPILE_ENVIRONMENT']:
- shared_library = '!%sjsctypes-test%s' % (CONFIG['DLL_PREFIX'], CONFIG['DLL_SUFFIX'])
- TEST_HARNESS_FILES.xpcshell.toolkit.components.ctypes.tests.unit += [shared_library]
- TEST_HARNESS_FILES.testing.mochitest.chrome.toolkit.components.ctypes.tests.chrome += [shared_library]
diff --git a/toolkit/components/ctypes/tests/unit/.eslintrc.js b/toolkit/components/ctypes/tests/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/ctypes/tests/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/ctypes/tests/unit/head.js b/toolkit/components/ctypes/tests/unit/head.js
deleted file mode 100644
index e95b949b6..000000000
--- a/toolkit/components/ctypes/tests/unit/head.js
+++ /dev/null
@@ -1,128 +0,0 @@
-try {
- // We might be running without privileges, in which case it's up to the
- // harness to give us the 'ctypes' object.
- Components.utils.import("resource://gre/modules/ctypes.jsm");
-} catch (e) {
-}
-
-function open_ctypes_test_lib()
-{
- return ctypes.open(do_get_file(ctypes.libraryName("jsctypes-test")).path);
-}
-
-/**
- * A weak set of CDataFinalizer values that need to be cleaned up before
- * proceeding to the next test.
- */
-function ResourceCleaner() {
- this._map = new WeakMap();
-}
-ResourceCleaner.prototype = {
- add: function ResourceCleaner_add(v) {
- this._map.set(v);
- return v;
- },
- cleanup: function ResourceCleaner_cleanup() {
- let keys = ThreadSafeChromeUtils.nondeterministicGetWeakMapKeys(this._map);
- keys.forEach((function cleaner(k) {
- try {
- k.dispose();
- } catch (x) {
- // This can fail if |forget|/|dispose| has been called manually
- // during the test. This is normal.
- }
- this._map.delete(k);
- }).bind(this));
- }
-};
-
-/**
- * Simple wrapper for tests that require cleanup.
- */
-function ResourceTester(start, stop) {
- this._start = start;
- this._stop = stop;
-}
-ResourceTester.prototype = {
- launch: function(size, test, args) {
- trigger_gc();
- let cleaner = new ResourceCleaner();
- this._start(size);
- try {
- test(size, args, cleaner);
- } catch (x) {
- cleaner.cleanup();
- this._stop();
- throw x;
- }
- trigger_gc();
- cleaner.cleanup();
- this._stop();
- }
-};
-
-function structural_check_eq(a, b) {
- // 1. If objects can be "toSource()-ed", use this.
-
- let result;
- let finished = false;
- let asource, bsource;
- try {
- asource = a.toSource();
- bsource = b.toSource();
- finished = true;
- } catch (x) {
- }
- if (finished) {
- do_check_eq(asource, bsource);
- return;
- }
-
- // 2. Otherwise, perform slower comparison
-
- try {
- structural_check_eq_aux(a, b);
- result = true;
- } catch (x) {
- dump(x);
- result = false;
- }
- do_check_true(result);
-}
-function structural_check_eq_aux(a, b) {
- let ak;
- try {
- ak = Object.keys(a);
- } catch (x) {
- if (a != b) {
- throw new Error("Distinct values "+a, b);
- }
- return;
- }
- ak.forEach(
- function(k) {
- let av = a[k];
- let bv = b[k];
- structural_check_eq_aux(av, bv);
- }
- );
-}
-
-function trigger_gc() {
- dump("Triggering garbage-collection");
- Components.utils.forceGC();
-}
-
-function must_throw(f) {
- let has_thrown = false;
- try {
- f();
- } catch (x) {
- has_thrown = true;
- }
- do_check_true(has_thrown);
-}
-
-function get_os() {
- return Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULRuntime).OS;
-}
diff --git a/toolkit/components/ctypes/tests/unit/test_errno.js b/toolkit/components/ctypes/tests/unit/test_errno.js
deleted file mode 100644
index 6bf6b4b05..000000000
--- a/toolkit/components/ctypes/tests/unit/test_errno.js
+++ /dev/null
@@ -1,69 +0,0 @@
-Components.utils.import("resource://gre/modules/ctypes.jsm");
-
-// Scope used to relaunch the tests with |ctypes| opened in a limited scope.
-var scope = {};
-var ctypes = ctypes;
-
-function run_test()
-{
- // Launch the test with regular loading of ctypes.jsm
- main_test();
-
- // Relaunch the test with exotic loading of ctypes.jsm
- Components.utils.unload("resource://gre/modules/ctypes.jsm");
- Components.utils.import("resource://gre/modules/ctypes.jsm", scope);
- ctypes = scope.ctypes;
- main_test();
-}
-
-function main_test()
-{
- "use strict";
- let library = open_ctypes_test_lib();
- let set_errno = library.declare("set_errno", ctypes.default_abi,
- ctypes.void_t,
- ctypes.int);
- let get_errno = library.declare("get_errno", ctypes.default_abi,
- ctypes.int);
-
- for (let i = 50; i >= 0; --i) {
- set_errno(i);
- let status = ctypes.errno;
- do_check_eq(status, i);
-
- status = get_errno();
- do_check_eq(status, 0);
-
- status = ctypes.errno;
- do_check_eq(status, 0);
- }
-
- let set_last_error, get_last_error;
- try { // The following test is Windows-specific
- set_last_error = library.declare("set_last_error", ctypes.default_abi,
- ctypes.void_t,
- ctypes.int);
- get_last_error = library.declare("get_last_error", ctypes.default_abi,
- ctypes.int);
-
- } catch (x) {
- do_check_eq(ctypes.winLastError, undefined);
- }
-
- if (set_last_error) {
- do_check_neq(ctypes.winLastError, undefined);
- for (let i = 0; i < 50; ++i) {
- set_last_error(i);
- let status = ctypes.winLastError;
- do_check_eq(status, i);
-
- status = get_last_error();
- do_check_eq(status, 0);
-
- status = ctypes.winLastError;
- do_check_eq(status, 0);
- }
- }
-
- library.close();
-}
diff --git a/toolkit/components/ctypes/tests/unit/test_finalizer.js b/toolkit/components/ctypes/tests/unit/test_finalizer.js
deleted file mode 100644
index adfb4c4b4..000000000
--- a/toolkit/components/ctypes/tests/unit/test_finalizer.js
+++ /dev/null
@@ -1,452 +0,0 @@
-var TEST_SIZE = 100;
-
-function run_test()
-{
- let library = open_ctypes_test_lib();
-
- let start = library.declare("test_finalizer_start", ctypes.default_abi,
- ctypes.void_t,
- ctypes.size_t);
- let stop = library.declare("test_finalizer_stop", ctypes.default_abi,
- ctypes.void_t);
- let status = library.declare("test_finalizer_resource_is_acquired",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.size_t);
- let released = function released(value, witness) {
- return witness == undefined;
- };
-
- let samples = [];
- samples.push(
- {
- name: "size_t",
- acquire: library.declare("test_finalizer_acq_size_t",
- ctypes.default_abi,
- ctypes.size_t,
- ctypes.size_t),
- release: library.declare("test_finalizer_rel_size_t",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.size_t),
- compare: library.declare("test_finalizer_cmp_size_t",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.size_t,
- ctypes.size_t),
- status: status,
- released: released
- });
- samples.push(
- {
- name: "size_t",
- acquire: library.declare("test_finalizer_acq_size_t",
- ctypes.default_abi,
- ctypes.size_t,
- ctypes.size_t),
- release: library.declare("test_finalizer_rel_size_t_set_errno",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.size_t),
- compare: library.declare("test_finalizer_cmp_size_t",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.size_t,
- ctypes.size_t),
- status: status,
- released: released
- });
- samples.push(
- {
- name: "int32_t",
- acquire: library.declare("test_finalizer_acq_int32_t",
- ctypes.default_abi,
- ctypes.int32_t,
- ctypes.size_t),
- release: library.declare("test_finalizer_rel_int32_t",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.int32_t),
- compare: library.declare("test_finalizer_cmp_int32_t",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.int32_t,
- ctypes.int32_t),
- status: status,
- released: released
- }
- );
- samples.push(
- {
- name: "int64_t",
- acquire: library.declare("test_finalizer_acq_int64_t",
- ctypes.default_abi,
- ctypes.int64_t,
- ctypes.size_t),
- release: library.declare("test_finalizer_rel_int64_t",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.int64_t),
- compare: library.declare("test_finalizer_cmp_int64_t",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.int64_t,
- ctypes.int64_t),
- status: status,
- released: released
- }
- );
- samples.push(
- {
- name: "ptr",
- acquire: library.declare("test_finalizer_acq_ptr_t",
- ctypes.default_abi,
- ctypes.PointerType(ctypes.void_t),
- ctypes.size_t),
- release: library.declare("test_finalizer_rel_ptr_t",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.PointerType(ctypes.void_t)),
- compare: library.declare("test_finalizer_cmp_ptr_t",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.void_t.ptr,
- ctypes.void_t.ptr),
- status: status,
- released: released
- }
- );
- samples.push(
- {
- name: "string",
- acquire: library.declare("test_finalizer_acq_string_t",
- ctypes.default_abi,
- ctypes.char.ptr,
- ctypes.int),
- release: library.declare("test_finalizer_rel_string_t",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.char.ptr),
- compare: library.declare("test_finalizer_cmp_string_t",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.char.ptr,
- ctypes.char.ptr),
- status: status,
- released: released
- }
- );
- const rect_t = new ctypes.StructType("myRECT",
- [{ top : ctypes.int32_t },
- { left : ctypes.int32_t },
- { bottom: ctypes.int32_t },
- { right : ctypes.int32_t }]);
- samples.push(
- {
- name: "struct",
- acquire: library.declare("test_finalizer_acq_struct_t",
- ctypes.default_abi,
- rect_t,
- ctypes.int),
- release: library.declare("test_finalizer_rel_struct_t",
- ctypes.default_abi,
- ctypes.void_t,
- rect_t),
- compare: library.declare("test_finalizer_cmp_struct_t",
- ctypes.default_abi,
- ctypes.bool,
- rect_t,
- rect_t),
- status: status,
- released: released
- }
- );
- samples.push(
- {
- name: "size_t, release returns size_t",
- acquire: library.declare("test_finalizer_acq_size_t",
- ctypes.default_abi,
- ctypes.size_t,
- ctypes.size_t),
- release: library.declare("test_finalizer_rel_size_t_return_size_t",
- ctypes.default_abi,
- ctypes.size_t,
- ctypes.size_t),
- compare: library.declare("test_finalizer_cmp_size_t",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.size_t,
- ctypes.size_t),
- status: status,
- released: function released_eq(i, witness) {
- return i == witness;
- }
- }
- );
- samples.push(
- {
- name: "size_t, release returns myRECT",
- acquire: library.declare("test_finalizer_acq_size_t",
- ctypes.default_abi,
- ctypes.size_t,
- ctypes.size_t),
- release: library.declare("test_finalizer_rel_size_t_return_struct_t",
- ctypes.default_abi,
- rect_t,
- ctypes.size_t),
- compare: library.declare("test_finalizer_cmp_size_t",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.size_t,
- ctypes.size_t),
- status: status,
- released: function released_rect_eq(i, witness) {
- return witness.top == i
- && witness.bottom == i
- && witness.left == i
- && witness.right == i;
- }
- }
- );
- samples.push(
- {
- name: "using null",
- acquire: library.declare("test_finalizer_acq_null_t",
- ctypes.default_abi,
- ctypes.PointerType(ctypes.void_t),
- ctypes.size_t),
- release: library.declare("test_finalizer_rel_null_t",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.PointerType(ctypes.void_t)),
- status: library.declare("test_finalizer_null_resource_is_acquired",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.size_t),
- compare: library.declare("test_finalizer_cmp_null_t",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.void_t.ptr,
- ctypes.void_t.ptr),
- released: released
- }
- );
-
- let tester = new ResourceTester(start, stop);
- samples.forEach(
- function run_sample(sample) {
- dump("Executing finalization test for data " + sample.name + "\n");
- tester.launch(TEST_SIZE, test_executing_finalizers, sample);
- tester.launch(TEST_SIZE, test_do_not_execute_finalizers_on_referenced_stuff, sample);
- tester.launch(TEST_SIZE, test_executing_dispose, sample);
- tester.launch(TEST_SIZE, test_executing_forget, sample);
- tester.launch(TEST_SIZE, test_result_dispose, sample);
- dump("Successfully completed finalization test for data " + sample.name + "\n");
- }
- );
-
- /*
- * Following test deactivated: Cycle collection never takes place
- * (see bug 727371)
- tester.launch(TEST_SIZE, test_cycles, samples[0]);
- */
- dump("Successfully completed all finalization tests\n");
- library.close();
-}
-
-// If only I could have Promises to test this :)
-// There is only so much we can do at this stage,
-// if we want to avoid tests overlapping.
-function test_cycles(size, tc) {
- // Now, restart this with unreferenced cycles
- for (i = 0; i < size/2; ++i) {
- let a = {
- a: ctypes.CDataFinalizer(tc.acquire(i*2), tc.release),
- b: {
- b: ctypes.CDataFinalizer(tc.acquire(i*2+1), tc.release)
- }
- };
- a.b.a = a;
- }
- do_test_pending();
-
- Components.utils.schedulePreciseGC(
- function after_gc() {
- // Check that _something_ has been finalized
- do_check_true(count_finalized(size, tc) > 0);
- do_test_finished();
- }
- );
-
- do_timeout(10000, do_throw);
-}
-
-
-function count_finalized(size, tc) {
- let finalizedItems = 0;
- for (let i = 0; i < size; ++i) {
- if (!tc.status(i)) {
- ++finalizedItems;
- }
- }
- return finalizedItems;
-}
-
-/**
- * Test:
- * - that (some) finalizers are executed;
- * - that no finalizer is executed twice (this is done on the C side).
- */
-function test_executing_finalizers(size, tc, cleanup)
-{
- dump("test_executing_finalizers " + tc.name + "\n");
- // Allocate |size| items without references
- for (let i = 0; i < size; ++i) {
- cleanup.add(ctypes.CDataFinalizer(tc.acquire(i), tc.release));
- }
- trigger_gc(); // This should trigger some finalizations, hopefully all
-
- // Check that _something_ has been finalized
- do_check_true(count_finalized(size, tc) > 0);
-}
-
-/**
- * Check that
- * - |dispose| returns the proper result
- */
-function test_result_dispose(size, tc, cleanup) {
- dump("test_result_dispose " + tc.name + "\n");
- let ref = [];
- // Allocate |size| items with references
- for (let i = 0; i < size; ++i) {
- let value = ctypes.CDataFinalizer(tc.acquire(i), tc.release);
- cleanup.add(value);
- ref.push(value);
- }
- do_check_eq(count_finalized(size, tc), 0);
-
- for (i = 0; i < size; ++i) {
- let witness = ref[i].dispose();
- ref[i] = null;
- if (!tc.released(i, witness)) {
- do_print("test_result_dispose failure at index "+i);
- do_check_true(false);
- }
- }
-
- do_check_eq(count_finalized(size, tc), size);
-}
-
-
-/**
- * Check that
- * - |dispose| is executed properly
- * - finalizers are not executed after |dispose|
- */
-function test_executing_dispose(size, tc, cleanup)
-{
- dump("test_executing_dispose " + tc.name + "\n");
- let ref = [];
- // Allocate |size| items with references
- for (let i = 0; i < size; ++i) {
- let value = ctypes.CDataFinalizer(tc.acquire(i), tc.release);
- cleanup.add(value);
- ref.push(value);
- }
- do_check_eq(count_finalized(size, tc), 0);
-
- // Dispose of everything and make sure that everything has been cleaned up
- ref.forEach(
- function dispose(v) {
- v.dispose();
- }
- );
- do_check_eq(count_finalized(size, tc), size);
-
- // Remove references
- ref = [];
-
- // Re-acquire data and make sure that everything has been reinialized
- for (i = 0; i < size; ++i) {
- tc.acquire(i);
- }
-
- do_check_eq(count_finalized(size, tc), 0);
-
-
- // Attempt to trigger finalizations, ensure that they do not take place
- trigger_gc();
-
- do_check_eq(count_finalized(size, tc), 0);
-}
-
-
-/**
- * Check that
- * - |forget| does not dispose
- * - |forget| has the right content
- * - finalizers are not executed after |forget|
- */
-function test_executing_forget(size, tc, cleanup)
-{
- dump("test_executing_forget " + tc.name + "\n");
- let ref = [];
- // Allocate |size| items with references
- for (let i = 0; i < size; ++i) {
- let original = tc.acquire(i);
- let finalizer = ctypes.CDataFinalizer(original, tc.release);
- ref.push(
- {
- original: original,
- finalizer: finalizer
- }
- );
- cleanup.add(finalizer);
- do_check_true(tc.compare(original, finalizer));
- }
- do_check_eq(count_finalized(size, tc), 0);
-
- // Forget everything, making sure that we recover the original info
- ref.forEach(
- function compare_original_to_recovered(v) {
- let original = v.original;
- let recovered = v.finalizer.forget();
- // Note: Cannot use do_check_eq on Uint64 et al.
- do_check_true(tc.compare(original, recovered));
- do_check_eq(original.constructor, recovered.constructor);
- }
- );
-
- // Also make sure that we have not performed any clean up
- do_check_eq(count_finalized(size, tc), 0);
-
- // Remove references
- ref = [];
-
- // Attempt to trigger finalizations, ensure that they have no effect
- trigger_gc();
-
- do_check_eq(count_finalized(size, tc), 0);
-}
-
-
-/**
- * Check that finalizers are not executed
- */
-function test_do_not_execute_finalizers_on_referenced_stuff(size, tc, cleanup)
-{
- dump("test_do_not_execute_finalizers_on_referenced_stuff " + tc.name + "\n");
-
- let ref = [];
- // Allocate |size| items without references
- for (let i = 0; i < size; ++i) {
- let value = ctypes.CDataFinalizer(tc.acquire(i), tc.release);
- cleanup.add(value);
- ref.push(value);
- }
- trigger_gc(); // This might trigger some finalizations, but it should not
-
- // Check that _nothing_ has been finalized
- do_check_eq(count_finalized(size, tc), 0);
-}
-
diff --git a/toolkit/components/ctypes/tests/unit/test_finalizer_shouldaccept.js b/toolkit/components/ctypes/tests/unit/test_finalizer_shouldaccept.js
deleted file mode 100644
index f683008e4..000000000
--- a/toolkit/components/ctypes/tests/unit/test_finalizer_shouldaccept.js
+++ /dev/null
@@ -1,174 +0,0 @@
-try {
- // We might be running without privileges, in which case it's up to the
- // harness to give us the 'ctypes' object.
- Components.utils.import("resource://gre/modules/ctypes.jsm");
-} catch (e) {
-}
-
-var acquire, dispose, reset_errno, dispose_errno,
- acquire_ptr, dispose_ptr,
- acquire_void_ptr, dispose_void_ptr,
- acquire_string, dispose_string;
-
-function run_test()
-{
- let library = open_ctypes_test_lib();
-
- let start = library.declare("test_finalizer_start", ctypes.default_abi,
- ctypes.void_t,
- ctypes.size_t);
- let stop = library.declare("test_finalizer_stop", ctypes.default_abi,
- ctypes.void_t);
- let tester = new ResourceTester(start, stop);
- acquire = library.declare("test_finalizer_acq_size_t",
- ctypes.default_abi,
- ctypes.size_t,
- ctypes.size_t);
- dispose = library.declare("test_finalizer_rel_size_t",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.size_t);
- reset_errno = library.declare("reset_errno",
- ctypes.default_abi,
- ctypes.void_t);
- dispose_errno = library.declare("test_finalizer_rel_size_t_set_errno",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.size_t);
- acquire_ptr = library.declare("test_finalizer_acq_int32_ptr_t",
- ctypes.default_abi,
- ctypes.int32_t.ptr,
- ctypes.size_t);
- dispose_ptr = library.declare("test_finalizer_rel_int32_ptr_t",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.int32_t.ptr);
- acquire_string = library.declare("test_finalizer_acq_string_t",
- ctypes.default_abi,
- ctypes.char.ptr,
- ctypes.size_t);
- dispose_string = library.declare("test_finalizer_rel_string_t",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.char.ptr);
-
- tester.launch(10, test_to_string);
- tester.launch(10, test_to_source);
- tester.launch(10, test_to_int);
- tester.launch(10, test_errno);
- tester.launch(10, test_to_pointer);
- tester.launch(10, test_readstring);
-}
-
-/**
- * Check that toString succeeds before/after forget/dispose.
- */
-function test_to_string()
-{
- do_print("Starting test_to_string");
- let a = ctypes.CDataFinalizer(acquire(0), dispose);
- do_check_eq(a.toString(), "0");
-
- a.forget();
- do_check_eq(a.toString(), "[CDataFinalizer - empty]");
-
- a = ctypes.CDataFinalizer(acquire(0), dispose);
- a.dispose();
- do_check_eq(a.toString(), "[CDataFinalizer - empty]");
-}
-
-/**
- * Check that toSource succeeds before/after forget/dispose.
- */
-function test_to_source()
-{
- do_print("Starting test_to_source");
- let value = acquire(0);
- let a = ctypes.CDataFinalizer(value, dispose);
- do_check_eq(a.toSource(),
- "ctypes.CDataFinalizer("
- + ctypes.size_t(value).toSource()
- +", "
- +dispose.toSource()
- +")");
- value = null;
-
- a.forget();
- do_check_eq(a.toSource(), "ctypes.CDataFinalizer()");
-
- a = ctypes.CDataFinalizer(acquire(0), dispose);
- a.dispose();
- do_check_eq(a.toSource(), "ctypes.CDataFinalizer()");
-}
-
-/**
- * Test conversion to int32
- */
-function test_to_int()
-{
- let value = 2;
- let wrapped, converted, finalizable;
- wrapped = ctypes.int32_t(value);
- finalizable = ctypes.CDataFinalizer(acquire(value), dispose);
- converted = ctypes.int32_t(finalizable);
-
- structural_check_eq(converted, wrapped);
- structural_check_eq(converted, ctypes.int32_t(finalizable.forget()));
-
- finalizable = ctypes.CDataFinalizer(acquire(value), dispose);
- wrapped = ctypes.int64_t(value);
- converted = ctypes.int64_t(finalizable);
- structural_check_eq(converted, wrapped);
- finalizable.dispose();
-}
-
-/**
- * Test that dispose can change errno but finalization cannot
- */
-function test_errno(size, tc, cleanup)
-{
- reset_errno();
- do_check_eq(ctypes.errno, 0);
-
- let finalizable = ctypes.CDataFinalizer(acquire(3), dispose_errno);
- finalizable.dispose();
- do_check_eq(ctypes.errno, 10);
- reset_errno();
-
- do_check_eq(ctypes.errno, 0);
- for (let i = 0; i < size; ++i) {
- finalizable = ctypes.CDataFinalizer(acquire(i), dispose_errno);
- cleanup.add(finalizable);
- }
-
- trigger_gc();
- do_check_eq(ctypes.errno, 0);
-}
-
-/**
- * Check that a finalizable of a pointer can be used as a pointer
- */
-function test_to_pointer()
-{
- let ptr = ctypes.int32_t(2).address();
- let finalizable = ctypes.CDataFinalizer(ptr, dispose_ptr);
- let unwrapped = ctypes.int32_t.ptr(finalizable);
-
- do_check_eq(""+ptr, ""+unwrapped);
-
- finalizable.forget(); // Do not dispose: This is not a real pointer.
-}
-
-/**
- * Test that readstring can be applied to a finalizer
- */
-function test_readstring(size)
-{
- for (let i = 0; i < size; ++i) {
- let acquired = acquire_string(i);
- let finalizable = ctypes.CDataFinalizer(acquired,
- dispose_string);
- do_check_eq(finalizable.readString(), acquired.readString());
- finalizable.dispose();
- }
-}
diff --git a/toolkit/components/ctypes/tests/unit/test_finalizer_shouldfail.js b/toolkit/components/ctypes/tests/unit/test_finalizer_shouldfail.js
deleted file mode 100644
index ffbe1b613..000000000
--- a/toolkit/components/ctypes/tests/unit/test_finalizer_shouldfail.js
+++ /dev/null
@@ -1,176 +0,0 @@
-try {
- // We might be running without privileges, in which case it's up to the
- // harness to give us the 'ctypes' object.
- Components.utils.import("resource://gre/modules/ctypes.jsm");
-} catch (e) {
-}
-
-var acquire, dispose, null_dispose, compare, dispose_64;
-
-function run_test()
-{
- let library = open_ctypes_test_lib();
-
- let start = library.declare("test_finalizer_start", ctypes.default_abi,
- ctypes.void_t,
- ctypes.size_t);
- let stop = library.declare("test_finalizer_stop", ctypes.default_abi,
- ctypes.void_t);
- let tester = new ResourceTester(start, stop);
- acquire = library.declare("test_finalizer_acq_size_t",
- ctypes.default_abi,
- ctypes.size_t,
- ctypes.size_t);
- dispose = library.declare("test_finalizer_rel_size_t",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.size_t);
- compare = library.declare("test_finalizer_cmp_size_t",
- ctypes.default_abi,
- ctypes.bool,
- ctypes.size_t,
- ctypes.size_t);
-
- dispose_64 = library.declare("test_finalizer_rel_int64_t",
- ctypes.default_abi,
- ctypes.void_t,
- ctypes.int64_t);
-
- let type_afun = ctypes.FunctionType(ctypes.default_abi,
- ctypes.void_t,
- [ctypes.size_t]).ptr;
-
- let null_dispose_maker =
- library.declare("test_finalizer_rel_null_function",
- ctypes.default_abi,
- type_afun
- );
- null_dispose = null_dispose_maker();
-
- tester.launch(10, test_double_dispose);
- tester.launch(10, test_finalize_bad_construction);
- tester.launch(10, test_null_dispose);
- tester.launch(10, test_pass_disposed);
- tester.launch(10, test_wrong_type);
-}
-
-
-/**
- * Testing construction of finalizers with wrong arguments.
- */
-function test_finalize_bad_construction() {
- // First argument does not match second
- must_throw(function() { ctypes.CDataFinalizer({}, dispose); });
- must_throw(function() { ctypes.CDataFinalizer(dispose, dispose); });
-
- // Not enough arguments
- must_throw(function() { ctypes.CDataFinalizer(init(0)); });
-
- // Too many arguments
- must_throw(function() { ctypes.CDataFinalizer(init(0), dispose, dispose); });
-
- // Second argument is null
- must_throw(function() { ctypes.CDataFinalizer(init(0), null); });
-
- // Second argument is undefined
- must_throw(function() {
- let a;
- ctypes.CDataFinalizer(init(0), a);
- });
-
-}
-
-/**
- * Test that forget/dispose can only take place once.
- */
-function test_double_dispose() {
- function test_one_combination(i, a, b) {
- let v = ctypes.CDataFinalizer(acquire(i), dispose);
- a(v);
- must_throw(function() { b(v); } );
- }
-
- let call_dispose = function(v) {
- v.dispose();
- };
- let call_forget = function(v) {
- v.forget();
- };
-
- test_one_combination(0, call_dispose, call_dispose);
- test_one_combination(1, call_dispose, call_forget);
- test_one_combination(2, call_forget, call_dispose);
- test_one_combination(3, call_forget, call_forget);
-}
-
-
-/**
- * Test that nothing (too) bad happens when the finalizer is NULL
- */
-function test_null_dispose()
-{
- let exception;
-
- exception = false;
- try {
- ctypes.CDataFinalizer(acquire(0), null_dispose);
- } catch (x) {
- exception = true;
- }
- do_check_true(exception);
-}
-
-/**
- * Test that conversion of a disposed/forgotten CDataFinalizer to a C
- * value fails nicely.
- */
-function test_pass_disposed()
-{
- let exception, v;
-
- exception = false;
- v = ctypes.CDataFinalizer(acquire(0), dispose);
- do_check_true(compare(v, 0));
- v.forget();
-
- try {
- compare(v, 0);
- } catch (x) {
- exception = true;
- }
- do_check_true(exception);
-
- exception = false;
- v = ctypes.CDataFinalizer(acquire(0), dispose);
- do_check_true(compare(v, 0));
- v.dispose();
-
- try {
- compare(v, 0);
- } catch (x) {
- exception = true;
- }
- do_check_true(exception);
-
- exception = false;
- try {
- ctypes.int32_t(ctypes.CDataFinalizer(v, dispose));
- } catch (x) {
- exception = true;
- }
- do_check_true(exception);
-}
-
-function test_wrong_type()
-{
- let int32_v = ctypes.int32_t(99);
- let exception;
- try {
- ctypes.CDataFinalizer(int32_v, dispose_64);
- } catch (x) {
- exception = x;
- }
-
- do_check_true(!!exception);
- do_check_eq(exception.constructor.name, "TypeError");
-}
diff --git a/toolkit/components/ctypes/tests/unit/test_jsctypes.js b/toolkit/components/ctypes/tests/unit/test_jsctypes.js
deleted file mode 100644
index ec35ee18e..000000000
--- a/toolkit/components/ctypes/tests/unit/test_jsctypes.js
+++ /dev/null
@@ -1,2808 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-try {
- // We might be running without privileges, in which case it's up to the
- // harness to give us the 'ctypes' object.
- Components.utils.import("resource://gre/modules/ctypes.jsm");
-} catch (e) {
-}
-
-CTYPES_TEST_LIB = ctypes.libraryName("jsctypes-test");
-CTYPES_UNICODE_LIB = ctypes.libraryName("jsctyp\u00E8s-t\u00EB\u00DFt");
-
-function do_check_throws(f, type, stack)
-{
- if (!stack) {
- try {
- // We might not have a 'Components' object.
- stack = Components.stack.caller;
- } catch (e) {
- }
- }
-
- try {
- f();
- } catch (exc) {
- if (exc.constructor.name === type.name) {
- do_check_true(true);
- return;
- }
- do_throw("expected " + type.name + " exception, caught " + exc, stack);
- }
- do_throw("expected " + type.name + " exception, none thrown", stack);
-}
-
-function run_test()
-{
- // Test ctypes.CType and ctypes.CData are set up correctly.
- run_abstract_class_tests();
-
- // open the library
- let libfile = do_get_file(CTYPES_TEST_LIB);
- let library = ctypes.open(libfile.path);
-
- // Make sure we can call a function in the library.
- run_void_tests(library);
-
- // Test Int64 and UInt64.
- run_Int64_tests();
- run_UInt64_tests();
-
- // Test the basic bool, integer, and float types.
- run_bool_tests(library);
-
- run_integer_tests(library, ctypes.int8_t, "int8_t", 1, true, [-0x80, 0x7f]);
- run_integer_tests(library, ctypes.int16_t, "int16_t", 2, true, [-0x8000, 0x7fff]);
- run_integer_tests(library, ctypes.int32_t, "int32_t", 4, true, [-0x80000000, 0x7fffffff]);
- run_integer_tests(library, ctypes.uint8_t, "uint8_t", 1, false, [0, 0xff]);
- run_integer_tests(library, ctypes.uint16_t, "uint16_t", 2, false, [0, 0xffff]);
- run_integer_tests(library, ctypes.uint32_t, "uint32_t", 4, false, [0, 0xffffffff]);
- run_integer_tests(library, ctypes.short, "short", 2, true, [-0x8000, 0x7fff]);
- run_integer_tests(library, ctypes.unsigned_short, "unsigned_short", 2, false, [0, 0xffff]);
- run_integer_tests(library, ctypes.int, "int", 4, true, [-0x80000000, 0x7fffffff]);
- run_integer_tests(library, ctypes.unsigned_int, "unsigned_int", 4, false, [0, 0xffffffff]);
- run_integer_tests(library, ctypes.unsigned, "unsigned_int", 4, false, [0, 0xffffffff]);
-
- run_float_tests(library, ctypes.float32_t, "float32_t", 4);
- run_float_tests(library, ctypes.float64_t, "float64_t", 8);
- run_float_tests(library, ctypes.float, "float", 4);
- run_float_tests(library, ctypes.double, "double", 8);
-
- // Test the wrapped integer types.
- s64limits = ["-9223372036854775808", "9223372036854775807",
- "-9223372036854775809", "9223372036854775808"];
- u64limits = ["0", "18446744073709551615", "-1", "18446744073709551616"];
-
- run_wrapped_integer_tests(library, ctypes.int64_t, "int64_t", 8, true,
- ctypes.Int64, "ctypes.Int64", s64limits);
- run_wrapped_integer_tests(library, ctypes.uint64_t, "uint64_t", 8, false,
- ctypes.UInt64, "ctypes.UInt64", u64limits);
- run_wrapped_integer_tests(library, ctypes.long_long, "long_long", 8, true,
- ctypes.Int64, "ctypes.Int64", s64limits);
- run_wrapped_integer_tests(library, ctypes.unsigned_long_long, "unsigned_long_long", 8, false,
- ctypes.UInt64, "ctypes.UInt64", u64limits);
-
- s32limits = [-0x80000000, 0x7fffffff, -0x80000001, 0x80000000];
- u32limits = [0, 0xffffffff, -1, 0x100000000];
-
- let slimits, ulimits;
- if (ctypes.long.size == 8) {
- slimits = s64limits;
- ulimits = u64limits;
- } else if (ctypes.long.size == 4) {
- slimits = s32limits;
- ulimits = u32limits;
- } else {
- do_throw("ctypes.long is not 4 or 8 bytes");
- }
-
- run_wrapped_integer_tests(library, ctypes.long, "long", ctypes.long.size, true,
- ctypes.Int64, "ctypes.Int64", slimits);
- run_wrapped_integer_tests(library, ctypes.unsigned_long, "unsigned_long", ctypes.long.size, false,
- ctypes.UInt64, "ctypes.UInt64", ulimits);
-
- if (ctypes.size_t.size == 8) {
- slimits = s64limits;
- ulimits = u64limits;
- } else if (ctypes.size_t.size == 4) {
- slimits = s32limits;
- ulimits = u32limits;
- } else {
- do_throw("ctypes.size_t is not 4 or 8 bytes");
- }
-
- run_wrapped_integer_tests(library, ctypes.size_t, "size_t", ctypes.size_t.size, false,
- ctypes.UInt64, "ctypes.UInt64", ulimits);
- run_wrapped_integer_tests(library, ctypes.ssize_t, "ssize_t", ctypes.size_t.size, true,
- ctypes.Int64, "ctypes.Int64", slimits);
- run_wrapped_integer_tests(library, ctypes.uintptr_t, "uintptr_t", ctypes.size_t.size, false,
- ctypes.UInt64, "ctypes.UInt64", ulimits);
- run_wrapped_integer_tests(library, ctypes.intptr_t, "intptr_t", ctypes.size_t.size, true,
- ctypes.Int64, "ctypes.Int64", slimits);
-
- if (ctypes.off_t.size == 8) {
- slimits = s64limits;
- ulimits = u64limits;
- } else if (ctypes.off_t.size == 4) {
- slimits = s32limits;
- ulimits = u32limits;
- } else {
- do_throw("ctypes.off_t is not 4 or 8 bytes");
- }
- run_wrapped_integer_tests(library, ctypes.off_t, "off_t", ctypes.off_t.size, true,
- ctypes.Int64, "ctypes.Int64", slimits);
-
- // Test the character types.
- run_char_tests(library, ctypes.char, "char", 1, true, [-0x80, 0x7f]);
- run_char_tests(library, ctypes.signed_char, "signed_char", 1, true, [-0x80, 0x7f]);
- run_char_tests(library, ctypes.unsigned_char, "unsigned_char", 1, false, [0, 0xff]);
- run_char16_tests(library, ctypes.char16_t, "char16_t", [0, 0xffff]);
-
- // Test the special types.
- run_StructType_tests();
- run_PointerType_tests();
- run_FunctionType_tests();
- run_ArrayType_tests();
-
- // Check that types print properly.
- run_type_toString_tests();
-
- // Test the 'name' and 'toSource' of a long typename.
- let ptrTo_ptrTo_arrayOf4_ptrTo_int32s =
- new ctypes.PointerType(
- new ctypes.PointerType(
- new ctypes.ArrayType(
- new ctypes.PointerType(ctypes.int32_t), 4)));
- do_check_eq(ptrTo_ptrTo_arrayOf4_ptrTo_int32s.name, "int32_t*(**)[4]");
-
- let source_t = new ctypes.StructType("source",
- [{ a: ptrTo_ptrTo_arrayOf4_ptrTo_int32s }, { b: ctypes.int64_t }]);
- do_check_eq(source_t.toSource(),
- 'ctypes.StructType("source", [{ "a": ctypes.int32_t.ptr.array(4).ptr.ptr }, ' +
- '{ "b": ctypes.int64_t }])');
-
- // Test ctypes.cast.
- run_cast_tests();
-
- run_string_tests(library);
- run_readstring_tests(library);
- run_struct_tests(library);
- run_function_tests(library);
- run_closure_tests(library);
- run_variadic_tests(library);
- run_static_data_tests(library);
- run_cpp_class_tests(library);
-
- // test library.close
- let test_void_t = library.declare("test_void_t_cdecl", ctypes.default_abi, ctypes.void_t);
- library.close();
- do_check_throws(function() { test_void_t(); }, Error);
- do_check_throws(function() {
- library.declare("test_void_t_cdecl", ctypes.default_abi, ctypes.void_t);
- }, Error);
-
- // test that library functions throw when bound to other objects
- library = ctypes.open(libfile.path);
- let obj = {};
- obj.declare = library.declare;
- do_check_throws(function () { run_void_tests(obj); }, Error);
- obj.close = library.close;
- do_check_throws(function () { obj.close(); }, Error);
-
- // test that functions work as properties of other objects
- let getter = library.declare("get_int8_t_cdecl", ctypes.default_abi, ctypes.int8_t);
- do_check_eq(getter(), 109);
- obj.t = getter;
- do_check_eq(obj.t(), 109);
-
- // bug 521937
- do_check_throws(function () { let nolib = ctypes.open("notfoundlibrary.dll"); nolib.close(); }, Error);
-
- // bug 522360
- do_check_eq(run_load_system_library(), true);
-
- // Test loading a library with a unicode name (bug 589413). Note that nsIFile
- // implementations are not available in some harnesses; if not, the harness
- // should take care of the copy for us.
- let unicodefile = do_get_file(CTYPES_UNICODE_LIB, true);
- let copy = libfile.copyTo instanceof Function;
- if (copy)
- libfile.copyTo(null, unicodefile.leafName);
- library = ctypes.open(unicodefile.path);
- run_void_tests(library);
- library.close();
- if (copy)
- unicodefile.remove(false);
-}
-
-function run_abstract_class_tests()
-{
- // Test that ctypes.CType is an abstract constructor that throws.
- do_check_throws(function() { ctypes.CType(); }, TypeError);
- do_check_throws(function() { new ctypes.CType() }, TypeError);
-
- do_check_true(ctypes.CType.hasOwnProperty("prototype"));
- do_check_throws(function() { ctypes.CType.prototype(); }, TypeError);
- do_check_throws(function() { new ctypes.CType.prototype() }, TypeError);
-
- do_check_true(ctypes.CType.prototype.hasOwnProperty("constructor"));
- do_check_true(ctypes.CType.prototype.constructor === ctypes.CType);
-
- // Check that ctypes.CType.prototype has the correct properties and functions.
- do_check_true(ctypes.CType.prototype.hasOwnProperty("name"));
- do_check_true(ctypes.CType.prototype.hasOwnProperty("size"));
- do_check_true(ctypes.CType.prototype.hasOwnProperty("ptr"));
- do_check_true(ctypes.CType.prototype.hasOwnProperty("array"));
- do_check_true(ctypes.CType.prototype.hasOwnProperty("toString"));
- do_check_true(ctypes.CType.prototype.hasOwnProperty("toSource"));
-
- // Make sure we can access 'prototype' on a CTypeProto.
- do_check_true(ctypes.CType.prototype.prototype === ctypes.CData.prototype);
-
- // Check that the shared properties and functions on ctypes.CType.prototype throw.
- do_check_throws(function() { ctypes.CType.prototype.name; }, TypeError);
- do_check_throws(function() { ctypes.CType.prototype.size; }, TypeError);
- do_check_throws(function() { ctypes.CType.prototype.ptr; }, TypeError);
- do_check_throws(function() { ctypes.CType.prototype.array(); }, TypeError);
-
-
- // toString and toSource are called by the web console during inspection,
- // so we don't want them to throw.
- do_check_eq(typeof ctypes.CType.prototype.toString(), 'string');
- do_check_eq(typeof ctypes.CType.prototype.toSource(), 'string');
-
- // Test that ctypes.CData is an abstract constructor that throws.
- do_check_throws(function() { ctypes.CData(); }, TypeError);
- do_check_throws(function() { new ctypes.CData() }, TypeError);
-
- do_check_true(ctypes.CData.__proto__ === ctypes.CType.prototype);
- do_check_true(ctypes.CData instanceof ctypes.CType);
-
- do_check_true(ctypes.CData.hasOwnProperty("prototype"));
- do_check_true(ctypes.CData.prototype.hasOwnProperty("constructor"));
- do_check_true(ctypes.CData.prototype.constructor === ctypes.CData);
-
- // Check that ctypes.CData.prototype has the correct properties and functions.
- do_check_true(ctypes.CData.prototype.hasOwnProperty("value"));
- do_check_true(ctypes.CData.prototype.hasOwnProperty("address"));
- do_check_true(ctypes.CData.prototype.hasOwnProperty("readString"));
- do_check_true(ctypes.CData.prototype.hasOwnProperty("toString"));
- do_check_true(ctypes.CData.prototype.hasOwnProperty("toSource"));
-
- // Check that the shared properties and functions on ctypes.CData.prototype throw.
- do_check_throws(function() { ctypes.CData.prototype.value; }, TypeError);
- do_check_throws(function() { ctypes.CData.prototype.value = null; }, TypeError);
- do_check_throws(function() { ctypes.CData.prototype.address(); }, TypeError);
- do_check_throws(function() { ctypes.CData.prototype.readString(); }, TypeError);
-
- // toString and toSource are called by the web console during inspection,
- // so we don't want them to throw.
- do_check_eq(ctypes.CData.prototype.toString(), '[CData proto object]');
- do_check_eq(ctypes.CData.prototype.toSource(), '[CData proto object]');
-}
-
-function run_Int64_tests() {
- do_check_throws(function() { ctypes.Int64(); }, TypeError);
-
- do_check_true(ctypes.Int64.hasOwnProperty("prototype"));
- do_check_true(ctypes.Int64.prototype.hasOwnProperty("constructor"));
- do_check_true(ctypes.Int64.prototype.constructor === ctypes.Int64);
-
- // Check that ctypes.Int64 and ctypes.Int64.prototype have the correct
- // properties and functions.
- do_check_true(ctypes.Int64.hasOwnProperty("compare"));
- do_check_true(ctypes.Int64.hasOwnProperty("lo"));
- do_check_true(ctypes.Int64.hasOwnProperty("hi"));
- do_check_true(ctypes.Int64.hasOwnProperty("join"));
- do_check_true(ctypes.Int64.prototype.hasOwnProperty("toString"));
- do_check_true(ctypes.Int64.prototype.hasOwnProperty("toSource"));
-
- // Check that the shared functions on ctypes.Int64.prototype throw.
- do_check_throws(function() { ctypes.Int64.prototype.toString(); }, TypeError);
- do_check_throws(function() { ctypes.Int64.prototype.toSource(); }, TypeError);
-
- let int64 = ctypes.Int64(0);
- do_check_true(int64.__proto__ === ctypes.Int64.prototype);
- do_check_true(int64 instanceof ctypes.Int64);
-
- // Test Int64.toString([radix]).
- do_check_eq(int64.toString(), "0");
- for (let radix = 2; radix <= 36; ++radix)
- do_check_eq(int64.toString(radix), "0");
- do_check_throws(function() { int64.toString(0); }, RangeError);
- do_check_throws(function() { int64.toString(1); }, RangeError);
- do_check_throws(function() { int64.toString(37); }, RangeError);
- do_check_throws(function() { int64.toString(10, 2); }, TypeError);
-
- // Test Int64.toSource().
- do_check_eq(int64.toSource(), "ctypes.Int64(\"0\")");
- do_check_throws(function() { int64.toSource(10); }, TypeError);
-
- int64 = ctypes.Int64("0x28590a1c921def71");
- do_check_eq(int64.toString(), int64.toString(10));
- do_check_eq(int64.toString(10), "2907366152271163249");
- do_check_eq(int64.toString(16), "28590a1c921def71");
- do_check_eq(int64.toString(2), "10100001011001000010100001110010010010000111011110111101110001");
- do_check_eq(int64.toSource(), "ctypes.Int64(\"" + int64.toString(10) + "\")");
-
- int64 = ctypes.Int64("-0x28590a1c921def71");
- do_check_eq(int64.toString(), int64.toString(10));
- do_check_eq(int64.toString(10), "-2907366152271163249");
- do_check_eq(int64.toString(16), "-28590a1c921def71");
- do_check_eq(int64.toString(2), "-10100001011001000010100001110010010010000111011110111101110001");
- do_check_eq(int64.toSource(), "ctypes.Int64(\"" + int64.toString(10) + "\")");
-
- int64 = ctypes.Int64("-0X28590A1c921DEf71");
- do_check_eq(int64.toString(), int64.toString(10));
- do_check_eq(int64.toString(10), "-2907366152271163249");
- do_check_eq(int64.toString(16), "-28590a1c921def71");
- do_check_eq(int64.toString(2), "-10100001011001000010100001110010010010000111011110111101110001");
- do_check_eq(int64.toSource(), "ctypes.Int64(\"" + int64.toString(10) + "\")");
-
- // Test Int64(primitive double) constructor.
- int64 = ctypes.Int64(-0);
- do_check_eq(int64.toString(), "0");
-
- int64 = ctypes.Int64(0x7ffffffffffff000);
- do_check_eq(int64.toString(), int64.toString(10));
- do_check_eq(int64.toString(10), "9223372036854771712");
- do_check_eq(int64.toString(16), "7ffffffffffff000");
- do_check_eq(int64.toString(2), "111111111111111111111111111111111111111111111111111000000000000");
-
- int64 = ctypes.Int64(-0x8000000000000000);
- do_check_eq(int64.toString(), int64.toString(10));
- do_check_eq(int64.toString(10), "-9223372036854775808");
- do_check_eq(int64.toString(16), "-8000000000000000");
- do_check_eq(int64.toString(2), "-1000000000000000000000000000000000000000000000000000000000000000");
-
- // Test Int64(string) constructor.
- int64 = ctypes.Int64("0x7fffffffffffffff");
- do_check_eq(int64.toString(), int64.toString(10));
- do_check_eq(int64.toString(10), "9223372036854775807");
- do_check_eq(int64.toString(16), "7fffffffffffffff");
- do_check_eq(int64.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
-
- int64 = ctypes.Int64("-0x8000000000000000");
- do_check_eq(int64.toString(), int64.toString(10));
- do_check_eq(int64.toString(10), "-9223372036854775808");
- do_check_eq(int64.toString(16), "-8000000000000000");
- do_check_eq(int64.toString(2), "-1000000000000000000000000000000000000000000000000000000000000000");
-
- int64 = ctypes.Int64("9223372036854775807");
- do_check_eq(int64.toString(), int64.toString(10));
- do_check_eq(int64.toString(10), "9223372036854775807");
- do_check_eq(int64.toString(16), "7fffffffffffffff");
- do_check_eq(int64.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
-
- int64 = ctypes.Int64("-9223372036854775808");
- do_check_eq(int64.toString(), int64.toString(10));
- do_check_eq(int64.toString(10), "-9223372036854775808");
- do_check_eq(int64.toString(16), "-8000000000000000");
- do_check_eq(int64.toString(2), "-1000000000000000000000000000000000000000000000000000000000000000");
-
- // Test Int64(other Int64) constructor.
- int64 = ctypes.Int64(ctypes.Int64(0));
- do_check_eq(int64.toString(), "0");
-
- int64 = ctypes.Int64(ctypes.Int64("0x7fffffffffffffff"));
- do_check_eq(int64.toString(), int64.toString(10));
- do_check_eq(int64.toString(10), "9223372036854775807");
- do_check_eq(int64.toString(16), "7fffffffffffffff");
- do_check_eq(int64.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
-
- int64 = ctypes.Int64(ctypes.Int64("-0x8000000000000000"));
- do_check_eq(int64.toString(), int64.toString(10));
- do_check_eq(int64.toString(10), "-9223372036854775808");
- do_check_eq(int64.toString(16), "-8000000000000000");
- do_check_eq(int64.toString(2), "-1000000000000000000000000000000000000000000000000000000000000000");
-
- // Test Int64(other UInt64) constructor.
- int64 = ctypes.Int64(ctypes.UInt64(0));
- do_check_eq(int64.toString(), "0");
-
- int64 = ctypes.Int64(ctypes.UInt64("0x7fffffffffffffff"));
- do_check_eq(int64.toString(), int64.toString(10));
- do_check_eq(int64.toString(10), "9223372036854775807");
- do_check_eq(int64.toString(16), "7fffffffffffffff");
- do_check_eq(int64.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
-
- let vals = [-0x8000000000001000, 0x8000000000000000,
- ctypes.UInt64("0x8000000000000000"),
- Infinity, -Infinity, NaN, 0.1,
- 5.68e21, null, undefined, "", {}, [], new Number(16),
- {toString: function () { return 7; }},
- {valueOf: function () { return 7; }}];
- for (let i = 0; i < vals.length; i++)
- do_check_throws(function () { ctypes.Int64(vals[i]); }, TypeError);
-
- vals = ["-0x8000000000000001", "0x8000000000000000"];
- for (let i = 0; i < vals.length; i++)
- do_check_throws(function () { ctypes.Int64(vals[i]); }, RangeError);
-
- // Test ctypes.Int64.compare.
- do_check_eq(ctypes.Int64.compare(ctypes.Int64(5), ctypes.Int64(5)), 0);
- do_check_eq(ctypes.Int64.compare(ctypes.Int64(5), ctypes.Int64(4)), 1);
- do_check_eq(ctypes.Int64.compare(ctypes.Int64(4), ctypes.Int64(5)), -1);
- do_check_eq(ctypes.Int64.compare(ctypes.Int64(-5), ctypes.Int64(-5)), 0);
- do_check_eq(ctypes.Int64.compare(ctypes.Int64(-5), ctypes.Int64(-4)), -1);
- do_check_eq(ctypes.Int64.compare(ctypes.Int64(-4), ctypes.Int64(-5)), 1);
- do_check_throws(function() { ctypes.Int64.compare(ctypes.Int64(4), ctypes.UInt64(4)); }, TypeError);
- do_check_throws(function() { ctypes.Int64.compare(4, 5); }, TypeError);
-
- // Test ctypes.Int64.{lo,hi}.
- do_check_eq(ctypes.Int64.lo(ctypes.Int64(0x28590a1c921de000)), 0x921de000);
- do_check_eq(ctypes.Int64.hi(ctypes.Int64(0x28590a1c921de000)), 0x28590a1c);
- do_check_eq(ctypes.Int64.lo(ctypes.Int64(-0x28590a1c921de000)), 0x6de22000);
- do_check_eq(ctypes.Int64.hi(ctypes.Int64(-0x28590a1c921de000)), -0x28590a1d);
- do_check_throws(function() { ctypes.Int64.lo(ctypes.UInt64(0)); }, TypeError);
- do_check_throws(function() { ctypes.Int64.hi(ctypes.UInt64(0)); }, TypeError);
- do_check_throws(function() { ctypes.Int64.lo(0); }, TypeError);
- do_check_throws(function() { ctypes.Int64.hi(0); }, TypeError);
-
- // Test ctypes.Int64.join.
- do_check_eq(ctypes.Int64.join(0, 0).toString(), "0");
- do_check_eq(ctypes.Int64.join(0x28590a1c, 0x921de000).toString(16), "28590a1c921de000");
- do_check_eq(ctypes.Int64.join(-0x28590a1d, 0x6de22000).toString(16), "-28590a1c921de000");
- do_check_eq(ctypes.Int64.join(0x7fffffff, 0xffffffff).toString(16), "7fffffffffffffff");
- do_check_eq(ctypes.Int64.join(-0x80000000, 0x00000000).toString(16), "-8000000000000000");
- do_check_throws(function() { ctypes.Int64.join(-0x80000001, 0); }, TypeError);
- do_check_throws(function() { ctypes.Int64.join(0x80000000, 0); }, TypeError);
- do_check_throws(function() { ctypes.Int64.join(0, -0x1); }, TypeError);
- do_check_throws(function() { ctypes.Int64.join(0, 0x800000000); }, TypeError);
-}
-
-function run_UInt64_tests() {
- do_check_throws(function() { ctypes.UInt64(); }, TypeError);
-
- do_check_true(ctypes.UInt64.hasOwnProperty("prototype"));
- do_check_true(ctypes.UInt64.prototype.hasOwnProperty("constructor"));
- do_check_true(ctypes.UInt64.prototype.constructor === ctypes.UInt64);
-
- // Check that ctypes.UInt64 and ctypes.UInt64.prototype have the correct
- // properties and functions.
- do_check_true(ctypes.UInt64.hasOwnProperty("compare"));
- do_check_true(ctypes.UInt64.hasOwnProperty("lo"));
- do_check_true(ctypes.UInt64.hasOwnProperty("hi"));
- do_check_true(ctypes.UInt64.hasOwnProperty("join"));
- do_check_true(ctypes.UInt64.prototype.hasOwnProperty("toString"));
- do_check_true(ctypes.UInt64.prototype.hasOwnProperty("toSource"));
-
- // Check that the shared functions on ctypes.UInt64.prototype throw.
- do_check_throws(function() { ctypes.UInt64.prototype.toString(); }, TypeError);
- do_check_throws(function() { ctypes.UInt64.prototype.toSource(); }, TypeError);
-
- let uint64 = ctypes.UInt64(0);
- do_check_true(uint64.__proto__ === ctypes.UInt64.prototype);
- do_check_true(uint64 instanceof ctypes.UInt64);
-
- // Test UInt64.toString([radix]).
- do_check_eq(uint64.toString(), "0");
- for (let radix = 2; radix <= 36; ++radix)
- do_check_eq(uint64.toString(radix), "0");
- do_check_throws(function() { uint64.toString(0); }, RangeError);
- do_check_throws(function() { uint64.toString(1); }, RangeError);
- do_check_throws(function() { uint64.toString(37); }, RangeError);
- do_check_throws(function() { uint64.toString(10, 2); }, TypeError);
-
- // Test UInt64.toSource().
- do_check_eq(uint64.toSource(), "ctypes.UInt64(\"0\")");
- do_check_throws(function() { uint64.toSource(10); }, TypeError);
-
- uint64 = ctypes.UInt64("0x28590a1c921def71");
- do_check_eq(uint64.toString(), uint64.toString(10));
- do_check_eq(uint64.toString(10), "2907366152271163249");
- do_check_eq(uint64.toString(16), "28590a1c921def71");
- do_check_eq(uint64.toString(2), "10100001011001000010100001110010010010000111011110111101110001");
- do_check_eq(uint64.toSource(), "ctypes.UInt64(\"" + uint64.toString(10) + "\")");
-
- uint64 = ctypes.UInt64("0X28590A1c921DEf71");
- do_check_eq(uint64.toString(), uint64.toString(10));
- do_check_eq(uint64.toString(10), "2907366152271163249");
- do_check_eq(uint64.toString(16), "28590a1c921def71");
- do_check_eq(uint64.toString(2), "10100001011001000010100001110010010010000111011110111101110001");
- do_check_eq(uint64.toSource(), "ctypes.UInt64(\"" + uint64.toString(10) + "\")");
-
- // Test UInt64(primitive double) constructor.
- uint64 = ctypes.UInt64(-0);
- do_check_eq(uint64.toString(), "0");
-
- uint64 = ctypes.UInt64(0xfffffffffffff000);
- do_check_eq(uint64.toString(), uint64.toString(10));
- do_check_eq(uint64.toString(10), "18446744073709547520");
- do_check_eq(uint64.toString(16), "fffffffffffff000");
- do_check_eq(uint64.toString(2), "1111111111111111111111111111111111111111111111111111000000000000");
-
- // Test UInt64(string) constructor.
- uint64 = ctypes.UInt64("0xffffffffffffffff");
- do_check_eq(uint64.toString(), uint64.toString(10));
- do_check_eq(uint64.toString(10), "18446744073709551615");
- do_check_eq(uint64.toString(16), "ffffffffffffffff");
- do_check_eq(uint64.toString(2), "1111111111111111111111111111111111111111111111111111111111111111");
-
- uint64 = ctypes.UInt64("0x0");
- do_check_eq(uint64.toString(), uint64.toString(10));
- do_check_eq(uint64.toString(10), "0");
- do_check_eq(uint64.toString(16), "0");
- do_check_eq(uint64.toString(2), "0");
-
- uint64 = ctypes.UInt64("18446744073709551615");
- do_check_eq(uint64.toString(), uint64.toString(10));
- do_check_eq(uint64.toString(10), "18446744073709551615");
- do_check_eq(uint64.toString(16), "ffffffffffffffff");
- do_check_eq(uint64.toString(2), "1111111111111111111111111111111111111111111111111111111111111111");
-
- uint64 = ctypes.UInt64("0");
- do_check_eq(uint64.toString(), "0");
-
- // Test UInt64(other UInt64) constructor.
- uint64 = ctypes.UInt64(ctypes.UInt64(0));
- do_check_eq(uint64.toString(), "0");
-
- uint64 = ctypes.UInt64(ctypes.UInt64("0xffffffffffffffff"));
- do_check_eq(uint64.toString(), uint64.toString(10));
- do_check_eq(uint64.toString(10), "18446744073709551615");
- do_check_eq(uint64.toString(16), "ffffffffffffffff");
- do_check_eq(uint64.toString(2), "1111111111111111111111111111111111111111111111111111111111111111");
-
- uint64 = ctypes.UInt64(ctypes.UInt64("0x0"));
- do_check_eq(uint64.toString(), "0");
-
- // Test UInt64(other Int64) constructor.
- uint64 = ctypes.UInt64(ctypes.Int64(0));
- do_check_eq(uint64.toString(), "0");
-
- uint64 = ctypes.UInt64(ctypes.Int64("0x7fffffffffffffff"));
- do_check_eq(uint64.toString(), uint64.toString(10));
- do_check_eq(uint64.toString(10), "9223372036854775807");
- do_check_eq(uint64.toString(16), "7fffffffffffffff");
- do_check_eq(uint64.toString(2), "111111111111111111111111111111111111111111111111111111111111111");
-
- let vals = [-1, 0x10000000000000000, "-1", "-0x1",
- ctypes.Int64("-1"), Infinity, -Infinity, NaN, 0.1,
- 5.68e21, null, undefined, "", {}, [], new Number(16),
- {toString: function () { return 7; }},
- {valueOf: function () { return 7; }}];
- for (let i = 0; i < vals.length; i++)
- do_check_throws(function () { ctypes.UInt64(vals[i]); }, TypeError);
-
- vals = ["0x10000000000000000"];
- for (let i = 0; i < vals.length; i++)
- do_check_throws(function () { ctypes.UInt64(vals[i]); }, RangeError);
-
- // Test ctypes.UInt64.compare.
- do_check_eq(ctypes.UInt64.compare(ctypes.UInt64(5), ctypes.UInt64(5)), 0);
- do_check_eq(ctypes.UInt64.compare(ctypes.UInt64(5), ctypes.UInt64(4)), 1);
- do_check_eq(ctypes.UInt64.compare(ctypes.UInt64(4), ctypes.UInt64(5)), -1);
- do_check_throws(function() { ctypes.UInt64.compare(ctypes.UInt64(4), ctypes.Int64(4)); }, TypeError);
- do_check_throws(function() { ctypes.UInt64.compare(4, 5); }, TypeError);
-
- // Test ctypes.UInt64.{lo,hi}.
- do_check_eq(ctypes.UInt64.lo(ctypes.UInt64(0x28590a1c921de000)), 0x921de000);
- do_check_eq(ctypes.UInt64.hi(ctypes.UInt64(0x28590a1c921de000)), 0x28590a1c);
- do_check_eq(ctypes.UInt64.lo(ctypes.UInt64(0xa8590a1c921de000)), 0x921de000);
- do_check_eq(ctypes.UInt64.hi(ctypes.UInt64(0xa8590a1c921de000)), 0xa8590a1c);
- do_check_throws(function() { ctypes.UInt64.lo(ctypes.Int64(0)); }, TypeError);
- do_check_throws(function() { ctypes.UInt64.hi(ctypes.Int64(0)); }, TypeError);
- do_check_throws(function() { ctypes.UInt64.lo(0); }, TypeError);
- do_check_throws(function() { ctypes.UInt64.hi(0); }, TypeError);
-
- // Test ctypes.UInt64.join.
- do_check_eq(ctypes.UInt64.join(0, 0).toString(), "0");
- do_check_eq(ctypes.UInt64.join(0x28590a1c, 0x921de000).toString(16), "28590a1c921de000");
- do_check_eq(ctypes.UInt64.join(0xa8590a1c, 0x921de000).toString(16), "a8590a1c921de000");
- do_check_eq(ctypes.UInt64.join(0xffffffff, 0xffffffff).toString(16), "ffffffffffffffff");
- do_check_eq(ctypes.UInt64.join(0, 0).toString(16), "0");
- do_check_throws(function() { ctypes.UInt64.join(-0x1, 0); }, TypeError);
- do_check_throws(function() { ctypes.UInt64.join(0x100000000, 0); }, TypeError);
- do_check_throws(function() { ctypes.UInt64.join(0, -0x1); }, TypeError);
- do_check_throws(function() { ctypes.UInt64.join(0, 0x1000000000); }, TypeError);
-}
-
-function run_basic_abi_tests(library, t, name, toprimitive,
- get_test, set_tests, sum_tests, sum_many_tests) {
- // Test the function call ABI for calls involving the type.
- function declare_fn_cdecl(fn_t, prefix) {
- return library.declare(prefix + name + "_cdecl", fn_t);
- }
- run_single_abi_tests(declare_fn_cdecl, ctypes.default_abi, t,
- toprimitive, get_test, set_tests, sum_tests, sum_many_tests);
-
- if ("winLastError" in ctypes) {
- function declare_fn_stdcall(fn_t, prefix) {
- return library.declare(prefix + name + "_stdcall", fn_t);
- }
- run_single_abi_tests(declare_fn_stdcall, ctypes.stdcall_abi, t,
- toprimitive, get_test, set_tests, sum_tests, sum_many_tests);
-
- // Check that declaring a WINAPI function gets the right symbol name.
- let libuser32 = ctypes.open("user32.dll");
- let charupper = libuser32.declare("CharUpperA",
- ctypes.winapi_abi,
- ctypes.char.ptr,
- ctypes.char.ptr);
- let hello = ctypes.char.array()("hello!");
- do_check_eq(charupper(hello).readString(), "HELLO!");
- }
-
- // Check the alignment of the type, and its behavior in a struct,
- // against what C says.
- check_struct_stats(library, t);
-
- // Check the ToSource functions defined in the namespace ABI
- do_check_eq(ctypes.default_abi.toSource(), "ctypes.default_abi");
-
- let exn;
- try {
- ctypes.default_abi.toSource.call(null);
- } catch (x) {
- exn = x;
- }
- do_check_true(!!exn); // Check that some exception was raised
-}
-
-function run_single_abi_tests(decl, abi, t, toprimitive,
- get_test, set_tests, sum_tests, sum_many_tests) {
- let getter_t = ctypes.FunctionType(abi, t).ptr;
- let getter = decl(getter_t, "get_");
- do_check_eq(toprimitive(getter()), get_test);
-
- let setter_t = ctypes.FunctionType(abi, t, [t]).ptr;
- let setter = decl(setter_t, "set_");
- for (let i of set_tests)
- do_check_eq(toprimitive(setter(i)), i);
-
- let sum_t = ctypes.FunctionType(abi, t, [t, t]).ptr;
- let sum = decl(sum_t, "sum_");
- for (let a of sum_tests)
- do_check_eq(toprimitive(sum(a[0], a[1])), a[2]);
-
- let sum_alignb_t = ctypes.FunctionType(abi, t,
- [ctypes.char, t, ctypes.char, t, ctypes.char]).ptr;
- let sum_alignb = decl(sum_alignb_t, "sum_alignb_");
- let sum_alignf_t = ctypes.FunctionType(abi, t,
- [ctypes.float, t, ctypes.float, t, ctypes.float]).ptr;
- let sum_alignf = decl(sum_alignf_t, "sum_alignf_");
- for (let a of sum_tests) {
- do_check_eq(toprimitive(sum_alignb(0, a[0], 0, a[1], 0)), a[2]);
- do_check_eq(toprimitive(sum_alignb(1, a[0], 1, a[1], 1)), a[2]);
- do_check_eq(toprimitive(sum_alignf(0, a[0], 0, a[1], 0)), a[2]);
- do_check_eq(toprimitive(sum_alignf(1, a[0], 1, a[1], 1)), a[2]);
- }
-
- let sum_many_t = ctypes.FunctionType(abi, t,
- [t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t, t]).ptr;
- let sum_many = decl(sum_many_t, "sum_many_");
- for (let a of sum_many_tests)
- do_check_eq(
- toprimitive(sum_many(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7],
- a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15],
- a[16], a[17])), a[18]);
-}
-
-function check_struct_stats(library, t) {
- let s_t = ctypes.StructType("s_t", [{ x: ctypes.char }, { y: t }]);
- let n_t = ctypes.StructType("n_t", [{ a: ctypes.char }, { b: s_t }, { c: ctypes.char }]);
- let get_stats = library.declare("get_" + t.name + "_stats",
- ctypes.default_abi, ctypes.void_t,
- ctypes.size_t.ptr, ctypes.size_t.ptr, ctypes.size_t.ptr, ctypes.size_t.ptr,
- ctypes.size_t.array());
-
- let align = ctypes.size_t();
- let size = ctypes.size_t();
- let nalign = ctypes.size_t();
- let nsize = ctypes.size_t();
- let offsets = ctypes.size_t.array(3)();
- get_stats(align.address(), size.address(), nalign.address(), nsize.address(),
- offsets);
-
- do_check_eq(size.value, s_t.size);
- do_check_eq(align.value, s_t.size - t.size);
- do_check_eq(align.value, offsetof(s_t, "y"));
- do_check_eq(nsize.value, n_t.size);
- do_check_eq(nalign.value, offsetof(n_t, "b"));
- do_check_eq(offsets[0], offsetof(s_t, "y"));
- do_check_eq(offsets[1], offsetof(n_t, "b"));
- do_check_eq(offsets[2], offsetof(n_t, "c"));
-}
-
-// Determine the offset, in bytes, of 'member' within 'struct'.
-function offsetof(struct, member) {
- let instance = struct();
- let memberptr = ptrValue(instance.addressOfField(member));
- let chararray = ctypes.cast(instance, ctypes.char.array(struct.size));
- let offset = 0;
- while (memberptr != ptrValue(chararray.addressOfElement(offset)))
- ++offset;
- return offset;
-}
-
-// Test the class and prototype hierarchy for a given basic type 't'.
-function run_basic_class_tests(t)
-{
- do_check_true(t.__proto__ === ctypes.CType.prototype);
- do_check_true(t instanceof ctypes.CType);
-
- do_check_true(t.prototype.__proto__ === ctypes.CData.prototype);
- do_check_true(t.prototype instanceof ctypes.CData);
- do_check_true(t.prototype.constructor === t);
-
- // Check that the shared properties and functions on 't.prototype' throw.
- do_check_throws(function() { t.prototype.value; }, TypeError);
- do_check_throws(function() { t.prototype.value = null; }, TypeError);
- do_check_throws(function() { t.prototype.address(); }, TypeError);
- do_check_throws(function() { t.prototype.readString(); }, TypeError);
-
- // toString and toSource are called by the web console during inspection,
- // so we don't want them to throw.
- do_check_eq(t.prototype.toString(), '[CData proto object]');
- do_check_eq(t.prototype.toSource(), '[CData proto object]');
-
- // Test that an instance 'd' of 't' is a CData.
- let d = t();
- do_check_true(d.__proto__ === t.prototype);
- do_check_true(d instanceof t);
- do_check_true(d.constructor === t);
-}
-
-function run_bool_tests(library) {
- let t = ctypes.bool;
- run_basic_class_tests(t);
-
- let name = "bool";
- do_check_eq(t.name, name);
- do_check_true(t.size == 1 || t.size == 4);
-
- do_check_eq(t.toString(), "type " + name);
- do_check_eq(t.toSource(), "ctypes." + name);
- do_check_true(t.ptr === ctypes.PointerType(t));
- do_check_eq(t.array().name, name + "[]");
- do_check_eq(t.array(5).name, name + "[5]");
-
- let d = t();
- do_check_eq(d.value, 0);
- d.value = 1;
- do_check_eq(d.value, 1);
- d.value = -0;
- do_check_eq(1/d.value, 1/0);
- d.value = false;
- do_check_eq(d.value, 0);
- d.value = true;
- do_check_eq(d.value, 1);
- d = new t(1);
- do_check_eq(d.value, 1);
-
- // don't convert anything else
- let vals = [-1, 2, Infinity, -Infinity, NaN, 0.1,
- ctypes.Int64(0), ctypes.UInt64(0),
- null, undefined, "", "0", {}, [], new Number(16),
- {toString: function () { return 7; }},
- {valueOf: function () { return 7; }}];
- for (let i = 0; i < vals.length; i++)
- do_check_throws(function () { d.value = vals[i]; }, TypeError);
-
- do_check_true(d.address().constructor === t.ptr);
- do_check_eq(d.address().contents, d.value);
- do_check_eq(d.toSource(), "ctypes." + name + "(" + d.value + ")");
- do_check_eq(d.toSource(), d.toString());
-
- // Test the function call ABI for calls involving the type,
- // and check the alignment of the type against what C says.
- function toprimitive(a) { return a; }
- run_basic_abi_tests(library, t, name, toprimitive,
- true,
- [ false, true ],
- [ [ false, false, false ], [ false, true, true ],
- [ true, false, true ], [true, true, true ] ],
- [ [ false, false, false, false, false, false, false, false, false,
- false, false, false, false, false, false, false, false, false,
- false ],
- [ true, true, true, true, true, true, true, true, true,
- true, true, true, true, true, true, true, true, true,
- true ] ]);
-}
-
-function run_integer_tests(library, t, name, size, signed, limits) {
- run_basic_class_tests(t);
-
- do_check_eq(t.name, name);
- do_check_eq(t.size, size);
-
- do_check_eq(t.toString(), "type " + name);
- do_check_eq(t.toSource(), "ctypes." + name);
- do_check_true(t.ptr === ctypes.PointerType(t));
- do_check_eq(t.array().name, name + "[]");
- do_check_eq(t.array(5).name, name + "[5]");
-
- // Check the alignment of the type, and its behavior in a struct,
- // against what C says.
- check_struct_stats(library, t);
-
- let d = t();
- do_check_eq(d.value, 0);
- d.value = 5;
- do_check_eq(d.value, 5);
- d = t(10);
- do_check_eq(d.value, 10);
- if (signed) {
- d.value = -10;
- do_check_eq(d.value, -10);
- }
- d = new t(20);
- do_check_eq(d.value, 20);
-
- d.value = ctypes.Int64(5);
- do_check_eq(d.value, 5);
- if (signed) {
- d.value = ctypes.Int64(-5);
- do_check_eq(d.value, -5);
- }
- d.value = ctypes.UInt64(5);
- do_check_eq(d.value, 5);
-
- d.value = limits[0];
- do_check_eq(d.value, limits[0]);
- d.value = limits[1];
- do_check_eq(d.value, limits[1]);
- d.value = 0;
- do_check_eq(d.value, 0);
- d.value = -0;
- do_check_eq(1/d.value, 1/0);
- d.value = false;
- do_check_eq(d.value, 0);
- d.value = true;
- do_check_eq(d.value, 1);
-
- // don't convert anything else
- let vals = [limits[0] - 1, limits[1] + 1, Infinity, -Infinity, NaN, 0.1,
- null, undefined, "", "0", {}, [], new Number(16),
- {toString: function () { return 7; }},
- {valueOf: function () { return 7; }}];
- for (let i = 0; i < vals.length; i++)
- do_check_throws(function () { d.value = vals[i]; }, TypeError);
-
- do_check_true(d.address().constructor === t.ptr);
- do_check_eq(d.address().contents, d.value);
- do_check_eq(d.toSource(), "ctypes." + name + "(" + d.value + ")");
- do_check_eq(d.toSource(), d.toString());
-
- // Test the function call ABI for calls involving the type,
- // and check the alignment of the type against what C says.
- function toprimitive(a) { return a; }
- run_basic_abi_tests(library, t, name, toprimitive,
- 109,
- [ 0, limits[0], limits[1] ],
- [ [ 0, 0, 0 ], [ 0, 1, 1 ], [ 1, 0, 1 ], [ 1, 1, 2 ],
- [ limits[0], 1, limits[0] + 1 ],
- [ limits[1], 1, limits[0] ] ],
- [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0 ],
- [ 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 18 ] ]);
-}
-
-function run_float_tests(library, t, name, size) {
- run_basic_class_tests(t);
-
- do_check_eq(t.name, name);
- do_check_eq(t.size, size);
-
- do_check_eq(t.toString(), "type " + name);
- do_check_eq(t.toSource(), "ctypes." + name);
- do_check_true(t.ptr === ctypes.PointerType(t));
- do_check_eq(t.array().name, name + "[]");
- do_check_eq(t.array(5).name, name + "[5]");
-
- let d = t();
- do_check_eq(d.value, 0);
- d.value = 5;
- do_check_eq(d.value, 5);
- d.value = 5.25;
- do_check_eq(d.value, 5.25);
- d = t(10);
- do_check_eq(d.value, 10);
- d.value = -10;
- do_check_eq(d.value, -10);
- d = new t(20);
- do_check_eq(d.value, 20);
-
- do_check_throws(function() { d.value = ctypes.Int64(5); }, TypeError);
- do_check_throws(function() { d.value = ctypes.Int64(-5); }, TypeError);
- do_check_throws(function() { d.value = ctypes.UInt64(5); }, TypeError);
-
- if (size == 4) {
- d.value = 0x7fffff;
- do_check_eq(d.value, 0x7fffff);
-
- // allow values that can't be represented precisely as a float
- d.value = 0xffffffff;
- let delta = 1 - d.value/0xffffffff;
- do_check_true(delta != 0);
- do_check_true(delta > -0.01 && delta < 0.01);
- d.value = 1 + 1/0x80000000;
- do_check_eq(d.value, 1);
- } else {
- d.value = 0xfffffffffffff000;
- do_check_eq(d.value, 0xfffffffffffff000);
-
- do_check_throws(function() { d.value = ctypes.Int64("0x7fffffffffffffff"); }, TypeError);
- }
-
- d.value = Infinity;
- do_check_eq(d.value, Infinity);
- d.value = -Infinity;
- do_check_eq(d.value, -Infinity);
- d.value = NaN;
- do_check_true(isNaN(d.value));
- d.value = 0;
- do_check_eq(d.value, 0);
- d.value = -0;
- do_check_eq(1/d.value, 1/-0);
-
- // don't convert anything else
- let vals = [true, false, null, undefined, "", "0", {}, [], new Number(16),
- {toString: function () { return 7; }},
- {valueOf: function () { return 7; }}];
- for (let i = 0; i < vals.length; i++)
- do_check_throws(function () { d.value = vals[i]; }, TypeError);
-
- // Check that values roundtrip through toSource() correctly.
- function test_roundtrip(tFn, val)
- {
- let f1 = tFn(val);
- eval("var f2 = " + f1.toSource());
- do_check_eq(f1.value, f2.value);
- }
- vals = [Infinity, -Infinity, -0, 0, 1, -1, 1/3, -1/3, 1/4, -1/4,
- 1e-14, -1e-14, 0xfffffffffffff000, -0xfffffffffffff000];
- for (let i = 0; i < vals.length; i++)
- test_roundtrip(t, vals[i]);
- do_check_eq(t(NaN).toSource(), t.toSource() + "(NaN)");
-
- do_check_true(d.address().constructor === t.ptr);
- do_check_eq(d.address().contents, d.value);
- do_check_eq(d.toSource(), "ctypes." + name + "(" + d.value + ")");
- do_check_eq(d.toSource(), d.toString());
-
- // Test the function call ABI for calls involving the type,
- // and check the alignment of the type against what C says.
- let operand = [];
- if (size == 4) {
- operand[0] = 503859.75;
- operand[1] = 1012385.25;
- operand[2] = 1516245;
- } else {
- operand[0] = 501823873859.75;
- operand[1] = 171290577385.25;
- operand[2] = 673114451245;
- }
- function toprimitive(a) { return a; }
- run_basic_abi_tests(library, t, name, toprimitive,
- 109.25,
- [ 0, operand[0], operand[1] ],
- [ [ 0, 0, 0 ], [ 0, 1, 1 ], [ 1, 0, 1 ], [ 1, 1, 2 ],
- [ operand[0], operand[1], operand[2] ] ],
- [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0 ],
- [ 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 18 ] ]);
-}
-
-function run_wrapped_integer_tests(library, t, name, size, signed, w, wname, limits) {
- run_basic_class_tests(t);
-
- do_check_eq(t.name, name);
- do_check_eq(t.size, size);
-
- do_check_eq(t.toString(), "type " + name);
- do_check_eq(t.toSource(), "ctypes." + name);
- do_check_true(t.ptr === ctypes.PointerType(t));
- do_check_eq(t.array().name, name + "[]");
- do_check_eq(t.array(5).name, name + "[5]");
-
- let d = t();
- do_check_true(d.value instanceof w);
- do_check_eq(d.value, 0);
- d.value = 5;
- do_check_eq(d.value, 5);
- d = t(10);
- do_check_eq(d.value, 10);
- if (signed) {
- d.value = -10;
- do_check_eq(d.value, -10);
- }
- d = new t(20);
- do_check_eq(d.value, 20);
-
- d.value = ctypes.Int64(5);
- do_check_eq(d.value, 5);
- if (signed) {
- d.value = ctypes.Int64(-5);
- do_check_eq(d.value, -5);
- }
- d.value = ctypes.UInt64(5);
- do_check_eq(d.value, 5);
-
- d.value = w(limits[0]);
- do_check_eq(d.value, limits[0]);
- d.value = w(limits[1]);
- do_check_eq(d.value, limits[1]);
- d.value = 0;
- do_check_eq(d.value, 0);
- d.value = -0;
- do_check_eq(1/d.value, 1/0);
- d.value = false;
- do_check_eq(d.value, 0);
- d.value = true;
- do_check_eq(d.value, 1);
-
- // don't convert anything else
- let vals = [limits[2], limits[3], Infinity, -Infinity, NaN, 0.1,
- null, undefined, "", "0", {}, [], new Number(16),
- {toString: function () { return 7; }},
- {valueOf: function () { return 7; }}];
- for (let i = 0; i < vals.length; i++)
- do_check_throws(function () { d.value = vals[i]; }, TypeError);
-
- do_check_true(d.address().constructor === t.ptr);
- do_check_eq(d.address().contents.toString(), d.value.toString());
- do_check_eq(d.toSource(), "ctypes." + name + "(" + wname + "(\"" + d.value + "\"))");
- do_check_eq(d.toSource(), d.toString());
-
- // Test the function call ABI for calls involving the type,
- // and check the alignment of the type against what C says.
- function toprimitive(a) { return a.toString(); }
- run_basic_abi_tests(library, t, name, toprimitive,
- 109,
- [ 0, w(limits[0]), w(limits[1]) ],
- [ [ 0, 0, 0 ], [ 0, 1, 1 ], [ 1, 0, 1 ], [ 1, 1, 2 ],
- signed ? [ w(limits[0]), -1, w(limits[1]) ]
- : [ w(limits[1]), 1, w(limits[0]) ] ],
- [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0 ],
- [ 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 18 ] ]);
-}
-
-function run_char_tests(library, t, name, size, signed, limits) {
- run_basic_class_tests(t);
-
- do_check_eq(t.name, name);
- do_check_eq(t.size, size);
-
- do_check_eq(t.toString(), "type " + name);
- do_check_eq(t.toSource(), "ctypes." + name);
- do_check_true(t.ptr === ctypes.PointerType(t));
- do_check_eq(t.array().name, name + "[]");
- do_check_eq(t.array(5).name, name + "[5]");
-
- let d = t();
- do_check_eq(d.value, 0);
- d.value = 5;
- do_check_eq(d.value, 5);
- d = t(10);
- do_check_eq(d.value, 10);
- if (signed) {
- d.value = -10;
- do_check_eq(d.value, -10);
- } else {
- do_check_throws(function() { d.value = -10; }, TypeError);
- }
- d = new t(20);
- do_check_eq(d.value, 20);
-
- function toprimitive(a) { return a; }
-
- d.value = ctypes.Int64(5);
- do_check_eq(d.value, 5);
- if (signed) {
- d.value = ctypes.Int64(-10);
- do_check_eq(d.value, -10);
- }
- d.value = ctypes.UInt64(5);
- do_check_eq(d.value, 5);
-
- d.value = limits[0];
- do_check_eq(d.value, limits[0]);
- d.value = limits[1];
- do_check_eq(d.value, limits[1]);
- d.value = 0;
- do_check_eq(d.value, 0);
- d.value = -0;
- do_check_eq(1/d.value, 1/0);
- d.value = false;
- do_check_eq(d.value, 0);
- d.value = true;
- do_check_eq(d.value, 1);
-
- do_check_throws(function() { d.value = "5"; }, TypeError);
-
- // don't convert anything else
- let vals = [limits[0] - 1, limits[1] + 1, Infinity, -Infinity, NaN, 0.1,
- null, undefined, "", "aa", {}, [], new Number(16),
- {toString: function () { return 7; }},
- {valueOf: function () { return 7; }}];
- for (let i = 0; i < vals.length; i++)
- do_check_throws(function () { d.value = vals[i]; }, TypeError);
-
- do_check_true(d.address().constructor === t.ptr);
- do_check_eq(d.address().contents, 1);
- do_check_eq(d.toSource(), "ctypes." + name + "(" + d.value + ")");
- do_check_eq(d.toSource(), d.toString());
-
- // Test string autoconversion (and lack thereof).
- let literal = "autoconverted";
- let s = t.array()(literal);
- do_check_eq(s.readString(), literal);
- do_check_eq(s.constructor.length, literal.length + 1);
- s = t.array(50)(literal);
- do_check_eq(s.readString(), literal);
- do_check_throws(function() { t.array(3)(literal); }, TypeError);
-
- do_check_throws(function() { t.ptr(literal); }, TypeError);
- let p = t.ptr(s);
- do_check_eq(p.readString(), literal);
-
- // Test the function call ABI for calls involving the type,
- // and check the alignment of the type against what C says.
- run_basic_abi_tests(library, t, name, toprimitive,
- 109,
- [ 0, limits[0], limits[1] ],
- [ [ 0, 0, 0 ], [ 0, 1, 1 ], [ 1, 0, 1 ], [ 1, 1, 2 ],
- [ limits[0], 1, limits[0] + 1 ],
- [ limits[1], 1, limits[0] ] ],
- [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0 ],
- [ 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 18 ] ]);
-}
-
-function run_char16_tests(library, t, name, limits) {
- run_basic_class_tests(t);
-
- do_check_eq(t.name, name);
- do_check_eq(t.size, 2);
-
- do_check_eq(t.toString(), "type " + name);
- do_check_eq(t.toSource(), "ctypes." + name);
- do_check_true(t.ptr === ctypes.PointerType(t));
- do_check_eq(t.array().name, name + "[]");
- do_check_eq(t.array(5).name, name + "[5]");
-
- function toprimitive(a) { return a.charCodeAt(0); }
-
- let d = t();
- do_check_eq(d.value.length, 1);
- do_check_eq(toprimitive(d.value), 0);
- d.value = 5;
- do_check_eq(d.value.length, 1);
- do_check_eq(toprimitive(d.value), 5);
- d = t(10);
- do_check_eq(toprimitive(d.value), 10);
- do_check_throws(function() { d.value = -10; }, TypeError);
- d = new t(20);
- do_check_eq(toprimitive(d.value), 20);
-
- d.value = ctypes.Int64(5);
- do_check_eq(d.value.charCodeAt(0), 5);
- do_check_throws(function() { d.value = ctypes.Int64(-10); }, TypeError);
- d.value = ctypes.UInt64(5);
- do_check_eq(d.value.charCodeAt(0), 5);
-
- d.value = limits[0];
- do_check_eq(toprimitive(d.value), limits[0]);
- d.value = limits[1];
- do_check_eq(toprimitive(d.value), limits[1]);
- d.value = 0;
- do_check_eq(toprimitive(d.value), 0);
- d.value = -0;
- do_check_eq(1/toprimitive(d.value), 1/0);
- d.value = false;
- do_check_eq(toprimitive(d.value), 0);
- d.value = true;
- do_check_eq(toprimitive(d.value), 1);
-
- d.value = "\0";
- do_check_eq(toprimitive(d.value), 0);
- d.value = "a";
- do_check_eq(d.value, "a");
-
- // don't convert anything else
- let vals = [limits[0] - 1, limits[1] + 1, Infinity, -Infinity, NaN, 0.1,
- null, undefined, "", "aa", {}, [], new Number(16),
- {toString: function () { return 7; }},
- {valueOf: function () { return 7; }}];
- for (let i = 0; i < vals.length; i++)
- do_check_throws(function () { d.value = vals[i]; }, TypeError);
-
- do_check_true(d.address().constructor === t.ptr);
- do_check_eq(d.address().contents, "a");
- do_check_eq(d.toSource(), "ctypes." + name + "(\"" + d.value + "\")");
- do_check_eq(d.toSource(), d.toString());
-
- // Test string autoconversion (and lack thereof).
- let literal = "autoconverted";
- let s = t.array()(literal);
- do_check_eq(s.readString(), literal);
- do_check_eq(s.constructor.length, literal.length + 1);
- s = t.array(50)(literal);
- do_check_eq(s.readString(), literal);
- do_check_throws(function() { t.array(3)(literal); }, TypeError);
-
- do_check_throws(function() { t.ptr(literal); }, TypeError);
- let p = t.ptr(s);
- do_check_eq(p.readString(), literal);
-
- // Test the function call ABI for calls involving the type,
- // and check the alignment of the type against what C says.
- run_basic_abi_tests(library, t, name, toprimitive,
- 109,
- [ 0, limits[0], limits[1] ],
- [ [ 0, 0, 0 ], [ 0, 1, 1 ], [ 1, 0, 1 ], [ 1, 1, 2 ],
- [ limits[0], 1, limits[0] + 1 ],
- [ limits[1], 1, limits[0] ] ],
- [ [ 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0, 0, 0,
- 0 ],
- [ 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 1, 1, 1, 1, 1, 1, 1, 1, 1,
- 18 ] ]);
-}
-
-// Test the class and prototype hierarchy for a given type constructor 'c'.
-function run_type_ctor_class_tests(c, t, t2, props=[], fns=[], instanceProps=[], instanceFns=[], specialProps=[])
-{
- do_check_true(c.prototype.__proto__ === ctypes.CType.prototype);
- do_check_true(c.prototype instanceof ctypes.CType);
- do_check_true(c.prototype.constructor === c);
-
- // Check that 'c.prototype' has the correct properties and functions.
- for (let p of props)
- do_check_true(c.prototype.hasOwnProperty(p));
- for (let f of fns)
- do_check_true(c.prototype.hasOwnProperty(f));
-
- // Check that the shared properties and functions on 'c.prototype' throw.
- for (let p of props)
- do_check_throws(function() { c.prototype[p]; }, TypeError);
- for (let f of fns)
- do_check_throws(function() { c.prototype[f](); }, TypeError);
-
- do_check_true(t.__proto__ === c.prototype);
- do_check_true(t instanceof c);
-
- // 't.prototype.__proto__' is the common ancestor of all types constructed
- // from 'c'; while not available from 'c' directly, it should be identically
- // equal to 't2.prototype.__proto__' where 't2' is a different CType
- // constructed from 'c'.
- do_check_true(t.prototype.__proto__ === t2.prototype.__proto__);
- if (t instanceof ctypes.FunctionType)
- do_check_true(t.prototype.__proto__.__proto__ === ctypes.PointerType.prototype.prototype);
- else
- do_check_true(t.prototype.__proto__.__proto__ === ctypes.CData.prototype);
- do_check_true(t.prototype instanceof ctypes.CData);
- do_check_true(t.prototype.constructor === t);
-
- // Check that 't.prototype.__proto__' has the correct properties and
- // functions.
- for (let p of instanceProps)
- do_check_true(t.prototype.__proto__.hasOwnProperty(p));
- for (let f of instanceFns)
- do_check_true(t.prototype.__proto__.hasOwnProperty(f));
-
- // Check that the shared properties and functions on 't.prototype.__proto__'
- // (and thus also 't.prototype') throw.
- for (let p of instanceProps) {
- do_check_throws(function() { t.prototype.__proto__[p]; }, TypeError);
- do_check_throws(function() { t.prototype[p]; }, TypeError);
- }
- for (let f of instanceFns) {
- do_check_throws(function() { t.prototype.__proto__[f]() }, TypeError);
- do_check_throws(function() { t.prototype[f]() }, TypeError);
- }
-
- // Check that 't.prototype' has the correct special properties.
- for (let p of specialProps)
- do_check_true(t.prototype.hasOwnProperty(p));
-
- // Check that the shared special properties on 't.prototype' throw.
- for (let p of specialProps)
- do_check_throws(function() { t.prototype[p]; }, TypeError);
-
- // Make sure we can access 'prototype' on a CTypeProto.
- if (t instanceof ctypes.FunctionType)
- do_check_true(Object.getPrototypeOf(c.prototype.prototype) === ctypes.PointerType.prototype.prototype);
- else
- do_check_true(Object.getPrototypeOf(c.prototype.prototype) === ctypes.CType.prototype.prototype);
-
- // Test that an instance 'd' of 't' is a CData.
- if (t.__proto__ != ctypes.FunctionType.prototype) {
- let d = t();
- do_check_true(d.__proto__ === t.prototype);
- do_check_true(d instanceof t);
- do_check_true(d.constructor === t);
- }
-}
-
-function run_StructType_tests() {
- run_type_ctor_class_tests(ctypes.StructType,
- ctypes.StructType("s", [{"a": ctypes.int32_t}, {"b": ctypes.int64_t}]),
- ctypes.StructType("t", [{"c": ctypes.int32_t}, {"d": ctypes.int64_t}]),
- [ "fields" ], [ "define" ], [], [ "addressOfField" ], [ "a", "b" ]);
-
- do_check_throws(function() { ctypes.StructType(); }, TypeError);
- do_check_throws(function() { ctypes.StructType("a", [], 5); }, TypeError);
- do_check_throws(function() { ctypes.StructType(null, []); }, TypeError);
- do_check_throws(function() { ctypes.StructType("a", null); }, TypeError);
-
- // Check that malformed descriptors are an error.
- do_check_throws(function() {
- ctypes.StructType("a", [{"x":ctypes.int32_t}, {"x":ctypes.int8_t}]);
- }, TypeError);
- do_check_throws(function() {
- ctypes.StructType("a", [5]);
- }, TypeError);
- do_check_throws(function() {
- ctypes.StructType("a", [{}]);
- }, TypeError);
- do_check_throws(function() {
- ctypes.StructType("a", [{5:ctypes.int32_t}]);
- }, TypeError);
- do_check_throws(function() {
- ctypes.StructType("a", [{"5":ctypes.int32_t}]);
- }, TypeError);
- do_check_throws(function() {
- ctypes.StructType("a", [{"x":5}]);
- }, TypeError);
- do_check_throws(function() {
- ctypes.StructType("a", [{"x":ctypes.int32_t()}]);
- }, TypeError);
-
- // Check that opaque structs work.
- let opaque_t = ctypes.StructType("a");
- do_check_eq(opaque_t.name, "a");
- do_check_eq(opaque_t.toString(), "type a");
- do_check_eq(opaque_t.toSource(), 'ctypes.StructType("a")');
- do_check_true(opaque_t.prototype === undefined);
- do_check_true(opaque_t.fields === undefined);
- do_check_true(opaque_t.size === undefined);
- do_check_throws(function() { opaque_t(); }, Error);
- let opaqueptr_t = opaque_t.ptr;
- do_check_true(opaqueptr_t.targetType === opaque_t);
- do_check_eq(opaqueptr_t.name, "a*");
- do_check_eq(opaqueptr_t.toString(), "type a*");
- do_check_eq(opaqueptr_t.toSource(), 'ctypes.StructType("a").ptr');
-
- // Check that type checking works with opaque structs.
- let opaqueptr = opaqueptr_t();
- opaqueptr.value = opaqueptr_t(1);
- do_check_eq(ptrValue(opaqueptr), 1);
- do_check_throws(function() {
- opaqueptr.value = ctypes.StructType("a").ptr();
- }, TypeError);
-
- // Check that 'define' works.
- do_check_throws(function() { opaque_t.define(); }, TypeError);
- do_check_throws(function() { opaque_t.define([], 0); }, TypeError);
- do_check_throws(function() { opaque_t.define([{}]); }, TypeError);
- do_check_throws(function() { opaque_t.define([{ a: 0 }]); }, TypeError);
- do_check_throws(function() {
- opaque_t.define([{ a: ctypes.int32_t, b: ctypes.int64_t }]);
- }, TypeError);
- do_check_throws(function() {
- opaque_t.define([{ a: ctypes.int32_t }, { b: 0 }]);
- }, TypeError);
- do_check_false(opaque_t.hasOwnProperty("prototype"));
-
- // Check that circular references work with opaque structs...
- // but not crazy ones.
- do_check_throws(function() { opaque_t.define([{ b: opaque_t }]); }, TypeError);
- let circular_t = ctypes.StructType("circular", [{ a: opaqueptr_t }]);
- opaque_t.define([{ b: circular_t }]);
- let opaque = opaque_t();
- let circular = circular_t(opaque.address());
- opaque.b = circular;
- do_check_eq(circular.a.toSource(), opaque.address().toSource());
- do_check_eq(opaque.b.toSource(), circular.toSource());
-
- // Check that attempting to redefine a struct fails and if attempted, the
- // original definition is preserved.
- do_check_throws(function() {
- opaque_t.define([{ c: ctypes.int32_t.array(8) }]);
- }, Error);
- do_check_eq(opaque_t.size, circular_t.size);
- do_check_true(opaque_t.prototype.hasOwnProperty("b"));
- do_check_false(opaque_t.prototype.hasOwnProperty("c"));
-
- // StructType size, alignment, and offset calculations have already been
- // checked for each basic type. We do not need to check them again.
- let name = "g_t";
- let g_t = ctypes.StructType(name, [{ a: ctypes.int32_t }, { b: ctypes.double }]);
- do_check_eq(g_t.name, name);
-
- do_check_eq(g_t.toString(), "type " + name);
- do_check_eq(g_t.toSource(),
- "ctypes.StructType(\"g_t\", [{ \"a\": ctypes.int32_t }, { \"b\": ctypes.double }])");
- do_check_true(g_t.ptr === ctypes.PointerType(g_t));
- do_check_eq(g_t.array().name, name + "[]");
- do_check_eq(g_t.array(5).name, name + "[5]");
-
- let s_t = new ctypes.StructType("s_t", [{ a: ctypes.int32_t }, { b: g_t }, { c: ctypes.int8_t }]);
-
- let fields = [{ a: ctypes.int32_t }, { b: ctypes.int8_t }, { c: g_t }, { d: ctypes.int8_t }];
- let t_t = new ctypes.StructType("t_t", fields);
- do_check_eq(t_t.fields.length, 4);
- do_check_true(t_t.fields[0].a === ctypes.int32_t);
- do_check_true(t_t.fields[1].b === ctypes.int8_t);
- do_check_true(t_t.fields[2].c === g_t);
- do_check_true(t_t.fields[3].d === ctypes.int8_t);
-/* disabled temporarily per bug 598225.
- do_check_throws(function() { t_t.fields.z = 0; }, Error);
- do_check_throws(function() { t_t.fields[4] = 0; }, Error);
- do_check_throws(function() { t_t.fields[4].a = 0; }, Error);
- do_check_throws(function() { t_t.fields[4].e = 0; }, Error);
-*/
-
- // Check that struct size bounds work, and that large, but not illegal, sizes
- // are OK.
- if (ctypes.size_t.size == 4) {
- // Test 1: overflow struct size + field padding + field size.
- let large_t = ctypes.StructType("large_t",
- [{"a": ctypes.int8_t.array(0xffffffff)}]);
- do_check_eq(large_t.size, 0xffffffff);
- do_check_throws(function() {
- ctypes.StructType("large_t", [{"a": large_t}, {"b": ctypes.int8_t}]);
- }, RangeError);
-
- // Test 2: overflow struct size + struct tail padding.
- // To do this, we use a struct with maximum size and alignment 2.
- large_t = ctypes.StructType("large_t",
- [{"a": ctypes.int16_t.array(0xfffffffe / 2)}]);
- do_check_eq(large_t.size, 0xfffffffe);
- do_check_throws(function() {
- ctypes.StructType("large_t", [{"a": large_t}, {"b": ctypes.int8_t}]);
- }, RangeError);
-
- } else {
- // Test 1: overflow struct size when converting from size_t to jsdouble.
- let large_t = ctypes.StructType("large_t",
- [{"a": ctypes.int8_t.array(0xfffffffffffff800)}]);
- do_check_eq(large_t.size, 0xfffffffffffff800);
- do_check_throws(function() {
- ctypes.StructType("large_t", [{"a": large_t}, {"b": ctypes.int8_t}]);
- }, RangeError);
- let small_t = ctypes.int8_t.array(0x400);
- do_check_throws(function() {
- ctypes.StructType("large_t", [{"a": large_t}, {"b": small_t}]);
- }, RangeError);
-
- large_t = ctypes.StructType("large_t",
- [{"a": ctypes.int8_t.array(0x1fffffffffffff)}]);
- do_check_eq(large_t.size, 0x1fffffffffffff);
- do_check_throws(function() {
- ctypes.StructType("large_t", [{"a": large_t.array(2)}, {"b": ctypes.int8_t}]);
- }, RangeError);
-
- // Test 2: overflow struct size + field padding + field size.
- large_t = ctypes.int8_t.array(0xfffffffffffff800);
- small_t = ctypes.int8_t.array(0x800);
- do_check_throws(function() {
- ctypes.StructType("large_t", [{"a": large_t}, {"b": small_t}]);
- }, RangeError);
-
- // Test 3: overflow struct size + struct tail padding.
- // To do this, we use a struct with maximum size and alignment 2.
- large_t = ctypes.StructType("large_t",
- [{"a": ctypes.int16_t.array(0xfffffffffffff000 / 2)}]);
- do_check_eq(large_t.size, 0xfffffffffffff000);
- small_t = ctypes.int8_t.array(0xfff);
- do_check_throws(function() {
- ctypes.StructType("large_t", [{"a": large_t}, {"b": small_t}]);
- }, RangeError);
- }
-
- let g = g_t();
- do_check_eq(g.a, 0);
- do_check_eq(g.b, 0);
- g = new g_t(1, 2);
- do_check_eq(g.a, 1);
- do_check_eq(g.b, 2);
- do_check_throws(function() { g_t(1); }, TypeError);
- do_check_throws(function() { g_t(1, 2, 3); }, TypeError);
-
- for (let field in g)
- do_check_true(field == "a" || field == "b");
-
- let g_a = g.address();
- do_check_true(g_a.constructor === g_t.ptr);
- do_check_eq(g_a.contents.a, g.a);
-
- let s = new s_t(3, g, 10);
- do_check_eq(s.a, 3);
- s.a = 4;
- do_check_eq(s.a, 4);
- do_check_eq(s.b.a, 1);
- do_check_eq(s.b.b, 2);
- do_check_eq(s.c, 10);
- let g2 = s.b;
- do_check_eq(g2.a, 1);
- g2.a = 7;
- do_check_eq(g2.a, 7);
- do_check_eq(s.b.a, 7);
-
- g_a = s.addressOfField("b");
- do_check_true(g_a.constructor === g_t.ptr);
- do_check_eq(g_a.contents.a, s.b.a);
- do_check_throws(function() { s.addressOfField(); }, TypeError);
- do_check_throws(function() { s.addressOfField("d"); }, TypeError);
- do_check_throws(function() { s.addressOfField("a", 2); }, TypeError);
-
- do_check_eq(s.toSource(), "s_t(4, {\"a\": 7, \"b\": 2}, 10)");
- do_check_eq(s.toSource(), s.toString());
- eval("var s2 = " + s.toSource());
- do_check_true(s2.constructor === s_t);
- do_check_eq(s.b.b, s2.b.b);
-
- // Test that structs can be set from an object using 'value'.
- do_check_throws(function() { s.value; }, TypeError);
- let s_init = { "a": 2, "b": { "a": 9, "b": 5 }, "c": 13 };
- s.value = s_init;
- do_check_eq(s.b.a, 9);
- do_check_eq(s.c, 13);
- do_check_throws(function() { s.value = 5; }, TypeError);
- do_check_throws(function() { s.value = ctypes.int32_t(); }, TypeError);
- do_check_throws(function() { s.value = {}; }, TypeError);
- do_check_throws(function() { s.value = { "a": 2 }; }, TypeError);
- do_check_throws(function() { s.value = { "a": 2, "b": 5, "c": 10 }; }, TypeError);
- do_check_throws(function() {
- s.value = { "5": 2, "b": { "a": 9, "b": 5 }, "c": 13 };
- }, TypeError);
- do_check_throws(function() {
- s.value = { "a": 2, "b": { "a": 9, "b": 5 }, "c": 13, "d": 17 };
- }, TypeError);
- do_check_throws(function() {
- s.value = { "a": 2, "b": { "a": 9, "b": 5, "e": 9 }, "c": 13 };
- }, TypeError);
-
- // Test that structs can be constructed similarly through ExplicitConvert,
- // and that the single-field case is disambiguated correctly.
- s = s_t(s_init);
- do_check_eq(s.b.a, 9);
- do_check_eq(s.c, 13);
- let v_t = ctypes.StructType("v_t", [{ "x": ctypes.int32_t }]);
- let v = v_t({ "x": 5 });
- do_check_eq(v.x, 5);
- v = v_t(8);
- do_check_eq(v.x, 8);
- let w_t = ctypes.StructType("w_t", [{ "y": v_t }]);
- do_check_throws(function() { w_t(9); }, TypeError);
- let w = w_t({ "x": 3 });
- do_check_eq(w.y.x, 3);
- w = w_t({ "y": { "x": 19 } });
- do_check_eq(w.y.x, 19);
- let u_t = ctypes.StructType("u_t", [{ "z": ctypes.ArrayType(ctypes.int32_t, 3) }]);
- let u = u_t([1, 2, 3]);
- do_check_eq(u.z[1], 2);
- u = u_t({ "z": [4, 5, 6] });
- do_check_eq(u.z[1], 5);
-
- // Check that the empty struct has size 1.
- let z_t = ctypes.StructType("z_t", []);
- do_check_eq(z_t.size, 1);
- do_check_eq(z_t.fields.length, 0);
-
- // Check that structs containing arrays of undefined or zero length
- // are illegal, but arrays of defined length work.
- do_check_throws(function() {
- ctypes.StructType("z_t", [{ a: ctypes.int32_t.array() }]);
- }, TypeError);
- do_check_throws(function() {
- ctypes.StructType("z_t", [{ a: ctypes.int32_t.array(0) }]);
- }, TypeError);
- z_t = ctypes.StructType("z_t", [{ a: ctypes.int32_t.array(6) }]);
- do_check_eq(z_t.size, ctypes.int32_t.size * 6);
- let z = z_t([1, 2, 3, 4, 5, 6]);
- do_check_eq(z.a[3], 4);
-}
-
-function ptrValue(p) {
- return ctypes.cast(p, ctypes.uintptr_t).value.toString();
-}
-
-function run_PointerType_tests() {
- run_type_ctor_class_tests(ctypes.PointerType,
- ctypes.PointerType(ctypes.int32_t), ctypes.PointerType(ctypes.int64_t),
- [ "targetType" ], [], [ "contents" ], [ "isNull", "increment", "decrement" ], []);
-
- do_check_throws(function() { ctypes.PointerType(); }, TypeError);
- do_check_throws(function() { ctypes.PointerType(ctypes.int32_t, 5); }, TypeError);
- do_check_throws(function() { ctypes.PointerType(null); }, TypeError);
- do_check_throws(function() { ctypes.PointerType(ctypes.int32_t()); }, TypeError);
- do_check_throws(function() { ctypes.PointerType("void"); }, TypeError);
-
- let name = "g_t";
- let g_t = ctypes.StructType(name, [{ a: ctypes.int32_t }, { b: ctypes.double }]);
- let g = g_t(1, 2);
-
- let p_t = ctypes.PointerType(g_t);
- do_check_eq(p_t.name, name + "*");
- do_check_eq(p_t.size, ctypes.uintptr_t.size);
- do_check_true(p_t.targetType === g_t);
- do_check_true(p_t === g_t.ptr);
-
- do_check_eq(p_t.toString(), "type " + name + "*");
- do_check_eq(p_t.toSource(),
- "ctypes.StructType(\"g_t\", [{ \"a\": ctypes.int32_t }, { \"b\": ctypes.double }]).ptr");
- do_check_true(p_t.ptr === ctypes.PointerType(p_t));
- do_check_eq(p_t.array().name, name + "*[]");
- do_check_eq(p_t.array(5).name, name + "*[5]");
-
- // Test ExplicitConvert.
- let p = p_t();
- do_check_throws(function() { p.value; }, TypeError);
- do_check_eq(ptrValue(p), 0);
- do_check_throws(function() { p.contents; }, TypeError);
- do_check_throws(function() { p.contents = g; }, TypeError);
- p = p_t(5);
- do_check_eq(ptrValue(p), 5);
- p = p_t(ctypes.UInt64(10));
- do_check_eq(ptrValue(p), 10);
-
- // Test ImplicitConvert.
- p.value = null;
- do_check_eq(ptrValue(p), 0);
- do_check_throws(function() { p.value = 5; }, TypeError);
-
- // Test opaque pointers.
- let f_t = ctypes.StructType("FILE").ptr;
- do_check_eq(f_t.name, "FILE*");
- do_check_eq(f_t.toSource(), 'ctypes.StructType("FILE").ptr');
- let f = new f_t();
- do_check_throws(function() { f.contents; }, TypeError);
- do_check_throws(function() { f.contents = 0; }, TypeError);
- f = f_t(5);
- do_check_throws(function() { f.contents = 0; }, TypeError);
- do_check_eq(f.toSource(), 'FILE.ptr(ctypes.UInt64("0x5"))');
-
- do_check_throws(function() { f_t(p); }, TypeError);
- do_check_throws(function() { f.value = p; }, TypeError);
- do_check_throws(function() { p.value = f; }, TypeError);
-
- // Test void pointers.
- let v_t = ctypes.PointerType(ctypes.void_t);
- do_check_true(v_t === ctypes.voidptr_t);
- let v = v_t(p);
- do_check_eq(ptrValue(v), ptrValue(p));
-
- // Test 'contents'.
- let int32_t = ctypes.int32_t(9);
- p = int32_t.address();
- do_check_eq(p.contents, int32_t.value);
- p.contents = ctypes.int32_t(12);
- do_check_eq(int32_t.value, 12);
-
- // Test 'isNull'.
- let n = f_t(0);
- do_check_true(n.isNull() === true);
- n = p.address();
- do_check_true(n.isNull() === false);
-
- // Test 'increment'/'decrement'.
- g_t = ctypes.StructType("g_t", [{ a: ctypes.int32_t }, { b: ctypes.double }]);
- let a_t = ctypes.ArrayType(g_t, 2);
- let a = new a_t();
- a[0] = g_t(1, 2);
- a[1] = g_t(2, 4);
- let a_p = a.addressOfElement(0).increment();
- do_check_eq(a_p.contents.a, 2);
- do_check_eq(a_p.contents.b, 4);
- a_p = a_p.decrement();
- do_check_eq(a_p.contents.a, 1);
- do_check_eq(a_p.contents.b, 2);
-
- // Check that pointers to arrays of undefined or zero length are legal,
- // but that the former cannot be dereferenced.
- let z_t = ctypes.int32_t.array().ptr;
- do_check_eq(ptrValue(z_t()), 0);
- do_check_throws(function() { z_t().contents }, TypeError);
- z_t = ctypes.int32_t.array(0).ptr;
- do_check_eq(ptrValue(z_t()), 0);
- let z = ctypes.int32_t.array(0)().address();
- do_check_eq(z.contents.length, 0);
-
- // TODO: Somehow, somewhere we should check that:
- //
- // (a) ArrayBuffer and TypedArray can be passed by pointer to a C function
- // (b) SharedArrayBuffer and TypedArray on SAB can NOT be passed in that
- // way (at least not at the moment).
-
- // Set up conversion tests on AB, SAB, TA
- let c_arraybuffer = new ArrayBuffer(256);
- let typed_array_samples =
- [
- [new Int8Array(c_arraybuffer), ctypes.int8_t],
- [new Uint8Array(c_arraybuffer), ctypes.uint8_t],
- [new Int16Array(c_arraybuffer), ctypes.int16_t],
- [new Uint16Array(c_arraybuffer), ctypes.uint16_t],
- [new Int32Array(c_arraybuffer), ctypes.int32_t],
- [new Uint32Array(c_arraybuffer), ctypes.uint32_t],
- [new Float32Array(c_arraybuffer), ctypes.float32_t],
- [new Float64Array(c_arraybuffer), ctypes.float64_t]
- ];
-
- if (typeof SharedArrayBuffer !== "undefined") {
- let c_shared_arraybuffer = new SharedArrayBuffer(256);
- typed_array_samples.push([new Int8Array(c_shared_arraybuffer), ctypes.int8_t],
- [new Uint8Array(c_shared_arraybuffer), ctypes.uint8_t],
- [new Int16Array(c_shared_arraybuffer), ctypes.int16_t],
- [new Uint16Array(c_shared_arraybuffer), ctypes.uint16_t],
- [new Int32Array(c_shared_arraybuffer), ctypes.int32_t],
- [new Uint32Array(c_shared_arraybuffer), ctypes.uint32_t],
- [new Float32Array(c_shared_arraybuffer), ctypes.float32_t],
- [new Float64Array(c_shared_arraybuffer), ctypes.float64_t])
- }
-
- // Check that you can convert (Shared)ArrayBuffer or typed array to a C array
- for (let i = 0; i < typed_array_samples.length; ++i) {
- for (let j = 0; j < typed_array_samples.length; ++j) {
- let view = typed_array_samples[i][0];
- let item_type = typed_array_samples[j][1];
- let number_of_items = c_arraybuffer.byteLength / item_type.size;
- let array_type = item_type.array(number_of_items);
-
- // Int8Array on unshared memory is interconvertible with Int8Array on
- // shared memory, etc.
- if (i % 8 != j % 8) {
- do_print("Checking that typed array " + (view.constructor.name) +
- " can NOT be converted to " + item_type + " array");
- do_check_throws(function() { array_type(view); }, TypeError);
- } else {
- do_print("Checking that typed array " + (view.constructor.name) +
- " can be converted to " + item_type + " array");
-
- // Convert ArrayBuffer to array of the right size and check contents
- c_array = array_type(c_arraybuffer);
- for (let k = 0; k < number_of_items; ++k) {
- do_check_eq(c_array[k], view[k]);
- }
-
- // Convert typed array to array of the right size and check contents
- c_array = array_type(view);
- for (let k = 0; k < number_of_items; ++k) {
- do_check_eq(c_array[k], view[k]);
- }
-
- // Convert typed array to array of wrong size, ensure that it fails
- let array_type_too_large = item_type.array(number_of_items + 1);
- let array_type_too_small = item_type.array(number_of_items - 1);
-
- do_check_throws(function() { array_type_too_large(c_arraybuffer); }, TypeError);
- do_check_throws(function() { array_type_too_small(c_arraybuffer); }, TypeError);
- do_check_throws(function() { array_type_too_large(view); }, TypeError);
- do_check_throws(function() { array_type_too_small(view); }, TypeError);
-
- // Convert subarray of typed array to array of right size and check contents
- c_array = array_type_too_small(view.subarray(1));
- for (let k = 1; k < number_of_items; ++k) {
- do_check_eq(c_array[k - 1], view[k]);
- }
- }
- }
- }
-
- // Check that you can't use a (Shared)ArrayBuffer or a typed array as a pointer
- for (let i = 0; i < typed_array_samples.length; ++i) {
- for (let j = 0; j < typed_array_samples.length; ++j) {
- let view = typed_array_samples[i][0];
- let item_type = typed_array_samples[j][1];
-
- do_print("Checking that typed array " + (view.constructor.name) +
- " can NOT be converted to " + item_type + " pointer/array");
- do_check_throws(function() { item_type.ptr(c_arraybuffer); }, TypeError);
- do_check_throws(function() { item_type.ptr(view); }, TypeError);
- do_check_throws(function() { ctypes.voidptr_t(c_arraybuffer); }, TypeError);
- do_check_throws(function() { ctypes.voidptr_t(view); }, TypeError);
- }
- }
-}
-
-function run_FunctionType_tests() {
- run_type_ctor_class_tests(ctypes.FunctionType,
- ctypes.FunctionType(ctypes.default_abi, ctypes.void_t),
- ctypes.FunctionType(ctypes.default_abi, ctypes.void_t, [ ctypes.int32_t ]),
- [ "abi", "returnType", "argTypes", "isVariadic" ],
- undefined, undefined, undefined, undefined);
-
- do_check_throws(function() { ctypes.FunctionType(); }, TypeError);
- do_check_throws(function() {
- ctypes.FunctionType(ctypes.default_abi, ctypes.void_t, [ ctypes.void_t ]);
- }, TypeError);
- do_check_throws(function() {
- ctypes.FunctionType(ctypes.default_abi, ctypes.void_t, [ ctypes.void_t ], 5);
- }, TypeError);
- do_check_throws(function() {
- ctypes.FunctionType(ctypes.default_abi, ctypes.void_t, ctypes.void_t);
- }, TypeError);
- do_check_throws(function() {
- ctypes.FunctionType(ctypes.default_abi, ctypes.void_t, null);
- }, TypeError);
- do_check_throws(function() {
- ctypes.FunctionType(ctypes.default_abi, ctypes.int32_t());
- }, TypeError);
- do_check_throws(function() {
- ctypes.FunctionType(ctypes.void_t, ctypes.void_t);
- }, Error);
-
- let g_t = ctypes.StructType("g_t", [{ a: ctypes.int32_t }, { b: ctypes.double }]);
-
- let f_t = ctypes.FunctionType(ctypes.default_abi, g_t);
- let name = "g_t()";
- do_check_eq(f_t.name, name);
- do_check_eq(f_t.size, undefined);
- do_check_true(f_t.abi === ctypes.default_abi);
- do_check_true(f_t.returnType === g_t);
- do_check_true(f_t.argTypes.length == 0);
-
- do_check_eq(f_t.toString(), "type " + name);
- do_check_eq(f_t.toSource(),
- "ctypes.FunctionType(ctypes.default_abi, g_t)");
-
- let fp_t = f_t.ptr;
- name = "g_t(*)()";
- do_check_eq(fp_t.name, name);
- do_check_eq(fp_t.size, ctypes.uintptr_t.size);
-
- do_check_eq(fp_t.toString(), "type " + name);
- do_check_eq(fp_t.toSource(),
- "ctypes.FunctionType(ctypes.default_abi, g_t).ptr");
-
- // Check that constructing a FunctionType CData directly throws.
- do_check_throws(function() { f_t(); }, TypeError);
-
- // Test ExplicitConvert.
- let f = fp_t();
- do_check_throws(function() { f.value; }, TypeError);
- do_check_eq(ptrValue(f), 0);
- f = fp_t(5);
- do_check_eq(ptrValue(f), 5);
- f = fp_t(ctypes.UInt64(10));
- do_check_eq(ptrValue(f), 10);
-
- // Test ImplicitConvert.
- f.value = null;
- do_check_eq(ptrValue(f), 0);
- do_check_throws(function() { f.value = 5; }, TypeError);
- do_check_eq(f.toSource(),
- 'ctypes.FunctionType(ctypes.default_abi, g_t).ptr(ctypes.UInt64("0x0"))');
-
- // Test ImplicitConvert from a function pointer of different type.
- let f2_t = ctypes.FunctionType(ctypes.default_abi, g_t, [ ctypes.int32_t ]);
- let f2 = f2_t.ptr();
- do_check_throws(function() { f.value = f2; }, TypeError);
- do_check_throws(function() { f2.value = f; }, TypeError);
-
- // Test that converting to a voidptr_t works.
- let v = ctypes.voidptr_t(f2);
- do_check_eq(v.toSource(), 'ctypes.voidptr_t(ctypes.UInt64("0x0"))');
-
- // Test some more complex names.
- do_check_eq(fp_t.array().name, "g_t(*[])()");
- do_check_eq(fp_t.array().ptr.name, "g_t(*(*)[])()");
-
- let f3_t = ctypes.FunctionType(ctypes.default_abi,
- ctypes.char.ptr.array().ptr).ptr.ptr.array(8).array();
- do_check_eq(f3_t.name, "char*(*(**[][8])())[]");
-
- if ("winLastError" in ctypes) {
- f3_t = ctypes.FunctionType(ctypes.stdcall_abi,
- ctypes.char.ptr.array().ptr).ptr.ptr.array(8).array();
- do_check_eq(f3_t.name, "char*(*(__stdcall**[][8])())[]");
- f3_t = ctypes.FunctionType(ctypes.winapi_abi,
- ctypes.char.ptr.array().ptr).ptr.ptr.array(8).array();
- do_check_eq(f3_t.name, "char*(*(WINAPI**[][8])())[]");
- }
-
- let f4_t = ctypes.FunctionType(ctypes.default_abi,
- ctypes.char.ptr.array().ptr, [ ctypes.int32_t, fp_t ]);
- do_check_true(f4_t.argTypes.length == 2);
- do_check_true(f4_t.argTypes[0] === ctypes.int32_t);
- do_check_true(f4_t.argTypes[1] === fp_t);
-/* disabled temporarily per bug 598225.
- do_check_throws(function() { f4_t.argTypes.z = 0; }, Error);
- do_check_throws(function() { f4_t.argTypes[0] = 0; }, Error);
-*/
-
- let t4_t = f4_t.ptr.ptr.array(8).array();
- do_check_eq(t4_t.name, "char*(*(**[][8])(int32_t, g_t(*)()))[]");
-
- // Not available in a Worker
- if ("@mozilla.org/systemprincipal;1" in Components.classes) {
- var sp = Components.classes["@mozilla.org/systemprincipal;1"].
- createInstance(Components.interfaces.nsIPrincipal);
- var s = new Components.utils.Sandbox(sp);
- s.ctypes = ctypes;
- s.do_check_eq = do_check_eq;
- s.do_check_true = do_check_true;
- Components.utils.evalInSandbox("var f5_t = ctypes.FunctionType(ctypes.default_abi, ctypes.int, [ctypes.int]);", s);
- Components.utils.evalInSandbox("do_check_eq(f5_t.toSource(), 'ctypes.FunctionType(ctypes.default_abi, ctypes.int, [ctypes.int])');", s);
- Components.utils.evalInSandbox("do_check_eq(f5_t.name, 'int(int)');", s);
- Components.utils.evalInSandbox("function f5(aArg) { return 5; };", s);
- Components.utils.evalInSandbox("var f = f5_t.ptr(f5);", s);
- Components.utils.evalInSandbox("do_check_true(f(6) == 5);", s);
- }
-}
-
-function run_ArrayType_tests() {
- run_type_ctor_class_tests(ctypes.ArrayType,
- ctypes.ArrayType(ctypes.int32_t, 10), ctypes.ArrayType(ctypes.int64_t),
- [ "elementType", "length" ], [], [ "length" ], [ "addressOfElement" ]);
-
- do_check_throws(function() { ctypes.ArrayType(); }, TypeError);
- do_check_throws(function() { ctypes.ArrayType(null); }, TypeError);
- do_check_throws(function() { ctypes.ArrayType(ctypes.int32_t, 1, 5); }, TypeError);
- do_check_throws(function() { ctypes.ArrayType(ctypes.int32_t, -1); }, TypeError);
-
- let name = "g_t";
- let g_t = ctypes.StructType(name, [{ a: ctypes.int32_t }, { b: ctypes.double }]);
- let g = g_t(1, 2);
-
- let a_t = ctypes.ArrayType(g_t, 10);
- do_check_eq(a_t.name, name + "[10]");
- do_check_eq(a_t.length, 10);
- do_check_eq(a_t.size, g_t.size * 10);
- do_check_true(a_t.elementType === g_t);
-
- do_check_eq(a_t.toString(), "type " + name + "[10]");
- do_check_eq(a_t.toSource(),
- "ctypes.StructType(\"g_t\", [{ \"a\": ctypes.int32_t }, { \"b\": ctypes.double }]).array(10)");
- do_check_eq(a_t.array().name, name + "[][10]");
- do_check_eq(a_t.array(5).name, name + "[5][10]");
- do_check_throws(function() { ctypes.int32_t.array().array(); }, Error);
-
- let a = new a_t();
- do_check_eq(a[0].a, 0);
- do_check_eq(a[0].b, 0);
- a[0] = g;
- do_check_eq(a[0].a, 1);
- do_check_eq(a[0].b, 2);
- do_check_throws(function() { a[-1]; }, TypeError);
- do_check_eq(a[9].a, 0);
- do_check_throws(function() { a[10]; }, RangeError);
-
- do_check_eq(a[ctypes.Int64(0)].a, 1);
- do_check_eq(a[ctypes.UInt64(0)].b, 2);
-
- let a_p = a.addressOfElement(0);
- do_check_true(a_p.constructor.targetType === g_t);
- do_check_true(a_p.constructor === g_t.ptr);
- do_check_eq(a_p.contents.a, a[0].a);
- do_check_eq(a_p.contents.b, a[0].b);
- a_p.contents.a = 5;
- do_check_eq(a[0].a, 5);
-
- let a2_t = ctypes.ArrayType(g_t);
- do_check_eq(a2_t.name, "g_t[]");
- do_check_eq(a2_t.length, undefined);
- do_check_eq(a2_t.size, undefined);
- let a2 = new a2_t(5);
- do_check_eq(a2.constructor.length, 5);
- do_check_eq(a2.length, 5);
- do_check_eq(a2.constructor.size, g_t.size * 5);
- do_check_throws(function() { new a2_t(); }, TypeError);
- do_check_throws(function() { ctypes.ArrayType(ctypes.ArrayType(g_t)); }, Error);
- do_check_throws(function() { ctypes.ArrayType(ctypes.ArrayType(g_t), 5); }, Error);
-
- let b_t = ctypes.int8_t.array(ctypes.UInt64(0xffff));
- do_check_eq(b_t.length, 0xffff);
- b_t = ctypes.int8_t.array(ctypes.Int64(0xffff));
- do_check_eq(b_t.length, 0xffff);
-
- // Check that array size bounds work, and that large, but not illegal, sizes
- // are OK.
- if (ctypes.size_t.size == 4) {
- do_check_throws(function() {
- ctypes.ArrayType(ctypes.int8_t, 0x100000000);
- }, TypeError);
- do_check_throws(function() {
- ctypes.ArrayType(ctypes.int16_t, 0x80000000);
- }, RangeError);
-
- let large_t = ctypes.int8_t.array(0x80000000);
- do_check_throws(function() { large_t.array(2); }, RangeError);
-
- } else {
- do_check_throws(function() {
- ctypes.ArrayType(ctypes.int8_t, ctypes.UInt64("0xffffffffffffffff"));
- }, TypeError);
- do_check_throws(function() {
- ctypes.ArrayType(ctypes.int16_t, ctypes.UInt64("0x8000000000000000"));
- }, RangeError);
-
- let large_t = ctypes.int8_t.array(0x8000000000000000);
- do_check_throws(function() { large_t.array(2); }, RangeError);
- }
-
- // Test that arrays ImplicitConvert to pointers.
- let b = ctypes.int32_t.array(10)();
- let p = ctypes.int32_t.ptr();
- p.value = b;
- do_check_eq(ptrValue(b.addressOfElement(0)), ptrValue(p));
- p = ctypes.voidptr_t();
- p.value = b;
- do_check_eq(ptrValue(b.addressOfElement(0)), ptrValue(p));
-
- // Test that arrays can be constructed through ImplicitConvert.
- let c_t = ctypes.int32_t.array(6);
- let c = c_t();
- c.value = [1, 2, 3, 4, 5, 6];
- do_check_eq(c.toSource(), "ctypes.int32_t.array(6)([1, 2, 3, 4, 5, 6])");
- do_check_eq(c.toSource(), c.toString());
- eval("var c2 = " + c.toSource());
- do_check_eq(c2.constructor.name, "int32_t[6]");
- do_check_eq(c2.length, 6);
- do_check_eq(c2[3], c[3]);
-
- c.value = c;
- do_check_eq(c[3], 4);
- do_check_throws(function() { c.value; }, TypeError);
- do_check_throws(function() { c.value = [1, 2, 3, 4, 5]; }, TypeError);
- do_check_throws(function() { c.value = [1, 2, 3, 4, 5, 6, 7]; }, TypeError);
- do_check_throws(function() { c.value = [1, 2, 7.4, 4, 5, 6]; }, TypeError);
- do_check_throws(function() { c.value = []; }, TypeError);
-}
-
-function run_type_toString_tests() {
- var c = ctypes;
-
- // Figure out whether we can create functions with ctypes.stdcall_abi and ctypes.winapi_abi.
- var haveStdCallABI;
- try {
- c.FunctionType(c.stdcall_abi, c.int);
- haveStdCallABI = true;
- } catch (x) {
- haveStdCallABI = false;
- }
-
- var haveWinAPIABI;
- try {
- c.FunctionType(c.winapi_abi, c.int);
- haveWinAPIABI = true;
- } catch (x) {
- haveWinAPIABI = false;
- }
-
- do_check_eq(c.char.toString(), "type char");
- do_check_eq(c.short.toString(), "type short");
- do_check_eq(c.int.toString(), "type int");
- do_check_eq(c.long.toString(), "type long");
- do_check_eq(c.long_long.toString(), "type long_long");
- do_check_eq(c.ssize_t.toString(), "type ssize_t");
- do_check_eq(c.int8_t.toString(), "type int8_t");
- do_check_eq(c.int16_t.toString(), "type int16_t");
- do_check_eq(c.int32_t.toString(), "type int32_t");
- do_check_eq(c.int64_t.toString(), "type int64_t");
- do_check_eq(c.intptr_t.toString(), "type intptr_t");
-
- do_check_eq(c.unsigned_char.toString(), "type unsigned_char");
- do_check_eq(c.unsigned_short.toString(), "type unsigned_short");
- do_check_eq(c.unsigned_int.toString(), "type unsigned_int");
- do_check_eq(c.unsigned_long.toString(), "type unsigned_long");
- do_check_eq(c.unsigned_long_long.toString(), "type unsigned_long_long");
- do_check_eq(c.size_t.toString(), "type size_t");
- do_check_eq(c.uint8_t.toString(), "type uint8_t");
- do_check_eq(c.uint16_t.toString(), "type uint16_t");
- do_check_eq(c.uint32_t.toString(), "type uint32_t");
- do_check_eq(c.uint64_t.toString(), "type uint64_t");
- do_check_eq(c.uintptr_t.toString(), "type uintptr_t");
-
- do_check_eq(c.float.toString(), "type float");
- do_check_eq(c.double.toString(), "type double");
- do_check_eq(c.bool.toString(), "type bool");
- do_check_eq(c.void_t.toString(), "type void");
- do_check_eq(c.voidptr_t.toString(), "type void*");
- do_check_eq(c.char16_t.toString(), "type char16_t");
-
- var simplestruct = c.StructType("simplestruct", [{"smitty":c.voidptr_t}]);
- do_check_eq(simplestruct.toString(), "type simplestruct");
-
- // One type modifier, int base type.
- do_check_eq(c.int.ptr.toString(), "type int*");
- do_check_eq(c.ArrayType(c.int).toString(), "type int[]");
- do_check_eq(c.ArrayType(c.int, 4).toString(), "type int[4]");
- do_check_eq(c.FunctionType(c.default_abi, c.int).toString(), "type int()");
- do_check_eq(c.FunctionType(c.default_abi, c.int, [c.bool]).toString(), "type int(bool)");
- do_check_eq(c.FunctionType(c.default_abi, c.int, [c.bool, c.short]).toString(),
- "type int(bool, short)");
- if (haveStdCallABI)
- do_check_eq(c.FunctionType(c.stdcall_abi, c.int).toString(), "type int __stdcall()");
- if (haveWinAPIABI)
- do_check_eq(c.FunctionType(c.winapi_abi, c.int).toString(), "type int WINAPI()");
-
- // One type modifier, struct base type.
- do_check_eq(simplestruct.ptr.toString(), "type simplestruct*");
- do_check_eq(c.ArrayType(simplestruct).toString(), "type simplestruct[]");
- do_check_eq(c.ArrayType(simplestruct, 4).toString(), "type simplestruct[4]");
- do_check_eq(c.FunctionType(c.default_abi, simplestruct).toString(), "type simplestruct()");
-
- // Two levels of type modifiers, int base type.
- do_check_eq(c.int.ptr.ptr.toString(), "type int**");
- do_check_eq(c.ArrayType(c.int.ptr).toString(), "type int*[]");
- do_check_eq(c.FunctionType(c.default_abi, c.int.ptr).toString(), "type int*()");
-
- do_check_eq(c.ArrayType(c.int).ptr.toString(), "type int(*)[]");
- do_check_eq(c.ArrayType(c.ArrayType(c.int, 4)).toString(), "type int[][4]");
- // Functions can't return arrays.
-
- do_check_eq(c.FunctionType(c.default_abi, c.int).ptr.toString(), "type int(*)()");
- // You can't have an array of functions.
- // Functions can't return functions.
-
- // We don't try all the permissible three-deep combinations, but this is fun.
- do_check_eq(c.FunctionType(c.default_abi, c.FunctionType(c.default_abi, c.int).ptr).toString(),
- "type int(*())()");
-}
-
-function run_cast_tests() {
- // Test casting between basic types.
- let i = ctypes.int32_t();
- let j = ctypes.cast(i, ctypes.int16_t);
- do_check_eq(ptrValue(i.address()), ptrValue(j.address()));
- do_check_eq(i.value, j.value);
- let k = ctypes.cast(i, ctypes.uint32_t);
- do_check_eq(ptrValue(i.address()), ptrValue(k.address()));
- do_check_eq(i.value, k.value);
-
- // Test casting to a type of undefined or larger size.
- do_check_throws(function() { ctypes.cast(i, ctypes.void_t); }, TypeError);
- do_check_throws(function() { ctypes.cast(i, ctypes.int32_t.array()); }, TypeError);
- do_check_throws(function() { ctypes.cast(i, ctypes.int64_t); }, TypeError);
-
- // Test casting between special types.
- let g_t = ctypes.StructType("g_t", [{ a: ctypes.int32_t }, { b: ctypes.double }]);
- let a_t = ctypes.ArrayType(g_t, 4);
- let f_t = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t).ptr;
-
- let a = a_t();
- a[0] = { a: 5, b: 7.5 };
- let g = ctypes.cast(a, g_t);
- do_check_eq(ptrValue(a.address()), ptrValue(g.address()));
- do_check_eq(a[0].a, g.a);
-
- let a2 = ctypes.cast(g, g_t.array(1));
- do_check_eq(ptrValue(a2.address()), ptrValue(g.address()));
- do_check_eq(a2[0].a, g.a);
-
- let p = g.address();
- let ip = ctypes.cast(p, ctypes.int32_t.ptr);
- do_check_eq(ptrValue(ip), ptrValue(p));
- do_check_eq(ptrValue(ip.address()), ptrValue(p.address()));
- do_check_eq(ip.contents, g.a);
-
- let f = f_t(0x5);
- let f2 = ctypes.cast(f, ctypes.voidptr_t);
- do_check_eq(ptrValue(f2), ptrValue(f));
- do_check_eq(ptrValue(f2.address()), ptrValue(f.address()));
-}
-
-function run_void_tests(library) {
- let test_void_t = library.declare("test_void_t_cdecl", ctypes.default_abi, ctypes.void_t);
- do_check_eq(test_void_t(), undefined);
-
- // Test that library.declare throws with void function args.
- do_check_throws(function() {
- library.declare("test_void_t_cdecl", ctypes.default_abi, ctypes.void_t, ctypes.void_t);
- }, TypeError);
-
- if ("winLastError" in ctypes) {
- test_void_t = library.declare("test_void_t_stdcall", ctypes.stdcall_abi, ctypes.void_t);
- do_check_eq(test_void_t(), undefined);
-
- // Check that WINAPI symbol lookup for a regular stdcall function fails on
- // Win32 (it's all the same on Win64 though).
- if (ctypes.voidptr_t.size == 4) {
- do_check_throws(function() {
- library.declare("test_void_t_stdcall", ctypes.winapi_abi, ctypes.void_t);
- }, Error);
- }
- }
-}
-
-function run_string_tests(library) {
- let test_ansi_len = library.declare("test_ansi_len", ctypes.default_abi, ctypes.int32_t, ctypes.char.ptr);
- do_check_eq(test_ansi_len(""), 0);
- do_check_eq(test_ansi_len("hello world"), 11);
-
- // don't convert anything else to a string
- let vals = [true, 0, 1/3, undefined, {}, {toString: function () { return "bad"; }}, []];
- for (let i = 0; i < vals.length; i++)
- do_check_throws(function() { test_ansi_len(vals[i]); }, TypeError);
-
- let test_wide_len = library.declare("test_wide_len", ctypes.default_abi, ctypes.int32_t, ctypes.char16_t.ptr);
- do_check_eq(test_wide_len("hello world"), 11);
-
- let test_ansi_ret = library.declare("test_ansi_ret", ctypes.default_abi, ctypes.char.ptr);
- do_check_eq(test_ansi_ret().readString(), "success");
-
- let test_wide_ret = library.declare("test_wide_ret", ctypes.default_abi, ctypes.char16_t.ptr);
- do_check_eq(test_wide_ret().readString(), "success");
-
- let test_ansi_echo = library.declare("test_ansi_echo", ctypes.default_abi, ctypes.char.ptr, ctypes.char.ptr);
- // We cannot pass a string literal directly into test_ansi_echo, since the
- // conversion to ctypes.char.ptr is only valid for the duration of the ffi
- // call. The escaped pointer that's returned will point to freed memory.
- let arg = ctypes.char.array()("anybody in there?");
- do_check_eq(test_ansi_echo(arg).readString(), "anybody in there?");
- do_check_eq(ptrValue(test_ansi_echo(null)), 0);
-}
-
-function run_readstring_tests(library) {
- // ASCII decode test, "hello world"
- let ascii_string = ctypes.unsigned_char.array(12)();
- ascii_string[0] = 0x68;
- ascii_string[1] = 0x65;
- ascii_string[2] = 0x6C;
- ascii_string[3] = 0x6C;
- ascii_string[4] = 0x6F;
- ascii_string[5] = 0x20;
- ascii_string[6] = 0x77;
- ascii_string[7] = 0x6F;
- ascii_string[8] = 0x72;
- ascii_string[9] = 0x6C;
- ascii_string[10] = 0x64;
- ascii_string[11] = 0;
- do_check_eq("hello world", ascii_string.readStringReplaceMalformed());
-
- // UTF-8 decode test, "U+AC00 U+B098 U+B2E4"
- let utf8_string = ctypes.unsigned_char.array(10)();
- utf8_string[0] = 0xEA;
- utf8_string[1] = 0xB0;
- utf8_string[2] = 0x80;
- utf8_string[3] = 0xEB;
- utf8_string[4] = 0x82;
- utf8_string[5] = 0x98;
- utf8_string[6] = 0xEB;
- utf8_string[7] = 0x8B;
- utf8_string[8] = 0xA4;
- utf8_string[9] = 0x00;
- let utf8_result = utf8_string.readStringReplaceMalformed();
- do_check_eq(0xAC00, utf8_result.charCodeAt(0));
- do_check_eq(0xB098, utf8_result.charCodeAt(1));
- do_check_eq(0xB2E4, utf8_result.charCodeAt(2));
-
- // KS5601 decode test, invalid encoded byte should be replaced with U+FFFD
- let ks5601_string = ctypes.unsigned_char.array(7)();
- ks5601_string[0] = 0xB0;
- ks5601_string[1] = 0xA1;
- ks5601_string[2] = 0xB3;
- ks5601_string[3] = 0xAA;
- ks5601_string[4] = 0xB4;
- ks5601_string[5] = 0xD9;
- ks5601_string[6] = 0x00;
- let ks5601_result = ks5601_string.readStringReplaceMalformed();
- do_check_eq(0xFFFD, ks5601_result.charCodeAt(0));
- do_check_eq(0xFFFD, ks5601_result.charCodeAt(1));
- do_check_eq(0xFFFD, ks5601_result.charCodeAt(2));
- do_check_eq(0xFFFD, ks5601_result.charCodeAt(3));
- do_check_eq(0xFFFD, ks5601_result.charCodeAt(4));
- do_check_eq(0xFFFD, ks5601_result.charCodeAt(5));
-
- // Mixed decode test, "test" + "U+AC00 U+B098 U+B2E4" + "test"
- // invalid encoded byte should be replaced with U+FFFD
- let mixed_string = ctypes.unsigned_char.array(15)();
- mixed_string[0] = 0x74;
- mixed_string[1] = 0x65;
- mixed_string[2] = 0x73;
- mixed_string[3] = 0x74;
- mixed_string[4] = 0xB0;
- mixed_string[5] = 0xA1;
- mixed_string[6] = 0xB3;
- mixed_string[7] = 0xAA;
- mixed_string[8] = 0xB4;
- mixed_string[9] = 0xD9;
- mixed_string[10] = 0x74;
- mixed_string[11] = 0x65;
- mixed_string[12] = 0x73;
- mixed_string[13] = 0x74;
- mixed_string[14] = 0x00;
- let mixed_result = mixed_string.readStringReplaceMalformed();
- do_check_eq(0x74, mixed_result.charCodeAt(0));
- do_check_eq(0x65, mixed_result.charCodeAt(1));
- do_check_eq(0x73, mixed_result.charCodeAt(2));
- do_check_eq(0x74, mixed_result.charCodeAt(3));
- do_check_eq(0xFFFD, mixed_result.charCodeAt(4));
- do_check_eq(0xFFFD, mixed_result.charCodeAt(5));
- do_check_eq(0xFFFD, mixed_result.charCodeAt(6));
- do_check_eq(0xFFFD, mixed_result.charCodeAt(7));
- do_check_eq(0xFFFD, mixed_result.charCodeAt(8));
- do_check_eq(0xFFFD, mixed_result.charCodeAt(9));
- do_check_eq(0x74, mixed_result.charCodeAt(10));
- do_check_eq(0x65, mixed_result.charCodeAt(11));
- do_check_eq(0x73, mixed_result.charCodeAt(12));
- do_check_eq(0x74, mixed_result.charCodeAt(13));
-
- // Test of all posible invalid encoded sequence
- let invalid_string = ctypes.unsigned_char.array(27)();
- invalid_string[0] = 0x80; // 10000000
- invalid_string[1] = 0xD0; // 11000000 01110100
- invalid_string[2] = 0x74;
- invalid_string[3] = 0xE0; // 11100000 01110100
- invalid_string[4] = 0x74;
- invalid_string[5] = 0xE0; // 11100000 10100000 01110100
- invalid_string[6] = 0xA0;
- invalid_string[7] = 0x74;
- invalid_string[8] = 0xE0; // 11100000 10000000 01110100
- invalid_string[9] = 0x80;
- invalid_string[10] = 0x74;
- invalid_string[11] = 0xF0; // 11110000 01110100
- invalid_string[12] = 0x74;
- invalid_string[13] = 0xF0; // 11110000 10010000 01110100
- invalid_string[14] = 0x90;
- invalid_string[15] = 0x74;
- invalid_string[16] = 0xF0; // 11110000 10010000 10000000 01110100
- invalid_string[17] = 0x90;
- invalid_string[18] = 0x80;
- invalid_string[19] = 0x74;
- invalid_string[20] = 0xF0; // 11110000 10000000 10000000 01110100
- invalid_string[21] = 0x80;
- invalid_string[22] = 0x80;
- invalid_string[23] = 0x74;
- invalid_string[24] = 0xF0; // 11110000 01110100
- invalid_string[25] = 0x74;
- invalid_string[26] = 0x00;
- let invalid_result = invalid_string.readStringReplaceMalformed();
- do_check_eq(0xFFFD, invalid_result.charCodeAt(0)); // 10000000
- do_check_eq(0xFFFD, invalid_result.charCodeAt(1)); // 11000000 01110100
- do_check_eq(0x74, invalid_result.charCodeAt(2));
- do_check_eq(0xFFFD, invalid_result.charCodeAt(3)); // 11100000 01110100
- do_check_eq(0x74, invalid_result.charCodeAt(4));
- do_check_eq(0xFFFD, invalid_result.charCodeAt(5)); // 11100000 10100000 01110100
- do_check_eq(0x74, invalid_result.charCodeAt(6));
- do_check_eq(0xFFFD, invalid_result.charCodeAt(7)); // 11100000 10000000 01110100
- do_check_eq(0xFFFD, invalid_result.charCodeAt(8));
- do_check_eq(0x74, invalid_result.charCodeAt(9));
- do_check_eq(0xFFFD, invalid_result.charCodeAt(10)); // 11110000 01110100
- do_check_eq(0x74, invalid_result.charCodeAt(11));
- do_check_eq(0xFFFD, invalid_result.charCodeAt(12)); // 11110000 10010000 01110100
- do_check_eq(0x74, invalid_result.charCodeAt(13));
- do_check_eq(0xFFFD, invalid_result.charCodeAt(14)); // 11110000 10010000 10000000 01110100
- do_check_eq(0x74, invalid_result.charCodeAt(15));
- do_check_eq(0xFFFD, invalid_result.charCodeAt(16)); // 11110000 10000000 10000000 01110100
- do_check_eq(0xFFFD, invalid_result.charCodeAt(17));
- do_check_eq(0xFFFD, invalid_result.charCodeAt(18));
- do_check_eq(0x74, invalid_result.charCodeAt(19));
- do_check_eq(0xFFFD, invalid_result.charCodeAt(20)); // 11110000 01110100
- do_check_eq(0x74, invalid_result.charCodeAt(21));
-
- // Test decoding of UTF-8 and CESU-8
- let utf8_cesu8_string = ctypes.unsigned_char.array(10)();
- utf8_cesu8_string[0] = 0xF0; // U+10400 in UTF-8
- utf8_cesu8_string[1] = 0x90;
- utf8_cesu8_string[2] = 0x90;
- utf8_cesu8_string[3] = 0x80;
- utf8_cesu8_string[4] = 0xED; // U+10400 in CESU-8
- utf8_cesu8_string[5] = 0xA0;
- utf8_cesu8_string[6] = 0x81;
- utf8_cesu8_string[7] = 0xED;
- utf8_cesu8_string[8] = 0xB0;
- utf8_cesu8_string[9] = 0x80;
- let utf8_cesu8_result = utf8_cesu8_string.readStringReplaceMalformed();
- do_check_eq(0xD801, utf8_cesu8_result.charCodeAt(0));
- do_check_eq(0xDC00, utf8_cesu8_result.charCodeAt(1));
- do_check_eq(0xFFFD, utf8_cesu8_result.charCodeAt(2));
- do_check_eq(0xFFFD, utf8_cesu8_result.charCodeAt(3));
-}
-
-function run_struct_tests(library) {
- const point_t = new ctypes.StructType("myPOINT",
- [{ x: ctypes.int32_t },
- { y: ctypes.int32_t }]);
- const rect_t = new ctypes.StructType("myRECT",
- [{ top : ctypes.int32_t },
- { left : ctypes.int32_t },
- { bottom: ctypes.int32_t },
- { right : ctypes.int32_t }]);
-
- let test_pt_in_rect = library.declare("test_pt_in_rect", ctypes.default_abi, ctypes.int32_t, rect_t, point_t);
- let rect = new rect_t(10, 5, 5, 10);
- let pt1 = new point_t(6, 6);
- do_check_eq(test_pt_in_rect(rect, pt1), 1);
- let pt2 = new point_t(2, 2);
- do_check_eq(test_pt_in_rect(rect, pt2), 0);
-
- const inner_t = new ctypes.StructType("INNER",
- [{ i1: ctypes.uint8_t },
- { i2: ctypes.int64_t },
- { i3: ctypes.uint8_t }]);
- const nested_t = new ctypes.StructType("NESTED",
- [{ n1 : ctypes.int32_t },
- { n2 : ctypes.int16_t },
- { inner: inner_t },
- { n3 : ctypes.int64_t },
- { n4 : ctypes.int32_t }]);
-
- let test_nested_struct = library.declare("test_nested_struct", ctypes.default_abi, ctypes.int32_t, nested_t);
- let inner = new inner_t(161, 523412, 43);
- let nested = new nested_t(13155, 1241, inner, 24512115, 1234111);
- // add up all the numbers and make sure the C function agrees
- do_check_eq(test_nested_struct(nested), 26284238);
-
- // test returning a struct by value
- let test_struct_return = library.declare("test_struct_return", ctypes.default_abi, point_t, rect_t);
- let ret = test_struct_return(rect);
- do_check_eq(ret.x, rect.left);
- do_check_eq(ret.y, rect.top);
-
- // struct parameter ABI depends on size; test returning a large struct by value
- test_struct_return = library.declare("test_large_struct_return", ctypes.default_abi, rect_t, rect_t, rect_t);
- ret = test_struct_return(rect_t(1, 2, 3, 4), rect_t(5, 6, 7, 8));
- do_check_eq(ret.left, 2);
- do_check_eq(ret.right, 4);
- do_check_eq(ret.top, 5);
- do_check_eq(ret.bottom, 7);
-
- // ... and tests structs < 8 bytes in size
- for (let i = 1; i < 8; ++i)
- run_small_struct_test(library, rect_t, i);
-
- // test passing a struct by pointer
- let test_init_pt = library.declare("test_init_pt", ctypes.default_abi, ctypes.void_t, point_t.ptr, ctypes.int32_t, ctypes.int32_t);
- test_init_pt(pt1.address(), 9, 10);
- do_check_eq(pt1.x, 9);
- do_check_eq(pt1.y, 10);
-}
-
-function run_small_struct_test(library, rect_t, bytes)
-{
- let fields = [];
- for (let i = 0; i < bytes; ++i) {
- let field = {};
- field["f" + i] = ctypes.uint8_t;
- fields.push(field);
- }
- const small_t = new ctypes.StructType("SMALL", fields);
-
- let test_small_struct_return = library.declare("test_" + bytes + "_byte_struct_return", ctypes.default_abi, small_t, rect_t);
- let ret = test_small_struct_return(rect_t(1, 7, 13, 45));
-
- let exp = [1, 7, 13, 45];
- let j = 0;
- for (let i = 0; i < bytes; ++i) {
- do_check_eq(ret["f" + i], exp[j]);
- if (++j == 4)
- j = 0;
- }
-}
-
-function run_function_tests(library)
-{
- let test_ansi_len = library.declare("test_ansi_len", ctypes.default_abi,
- ctypes.int32_t, ctypes.char.ptr);
- let fn_t = ctypes.FunctionType(ctypes.default_abi, ctypes.int32_t,
- [ ctypes.char.ptr ]).ptr;
-
- let test_fnptr = library.declare("test_fnptr", ctypes.default_abi, fn_t);
-
- // Test that the value handed back by test_fnptr matches the function pointer
- // for test_ansi_len itself.
- let ptr = test_fnptr();
- do_check_eq(ptrValue(test_ansi_len), ptrValue(ptr));
-
- // Test that we can call ptr().
- do_check_eq(ptr("function pointers rule!"), 23);
-
- // Test that we can call via call and apply
- do_check_eq(ptr.call(null, "function pointers rule!"), 23);
- do_check_eq(ptr.apply(null, ["function pointers rule!"]), 23);
-
- // Test that we cannot call non-function pointers via call and apply
- let p_t = ctypes.PointerType(ctypes.int32_t);
- let p = p_t();
- do_check_throws(function() { p.call(null, "woo"); }, TypeError);
- do_check_throws(function() { p.apply(null, ["woo"]); }, TypeError);
-
- // Test the function pointers still behave as regular pointers
- do_check_false(ptr.isNull(), "PointerType methods should still be valid");
-
- // Test that library.declare() returns data of type FunctionType.ptr, and that
- // it is immutable.
- do_check_true(test_ansi_len.constructor.targetType.__proto__ ===
- ctypes.FunctionType.prototype);
- do_check_eq(test_ansi_len.constructor.toSource(),
- "ctypes.FunctionType(ctypes.default_abi, ctypes.int32_t, [ctypes.char.ptr]).ptr");
-/* disabled temporarily per bug 598225.
- do_check_throws(function() { test_ansi_len.value = null; }, Error);
- do_check_eq(ptrValue(test_ansi_len), ptrValue(ptr));
-*/
-
- // Test that the library.declare(name, functionType) form works.
- let test_ansi_len_2 = library.declare("test_ansi_len", fn_t);
- do_check_true(test_ansi_len_2.constructor === fn_t);
- do_check_eq(ptrValue(test_ansi_len), ptrValue(test_ansi_len_2));
-/* disabled temporarily per bug 598225.
- do_check_throws(function() { test_ansi_len_2.value = null; }, Error);
- do_check_eq(ptrValue(test_ansi_len_2), ptrValue(ptr));
-*/
-}
-
-function run_closure_tests(library)
-{
- run_single_closure_tests(library, ctypes.default_abi, "cdecl");
- if ("winLastError" in ctypes) {
- run_single_closure_tests(library, ctypes.stdcall_abi, "stdcall");
-
- // Check that attempting to construct a ctypes.winapi_abi closure throws.
- function closure_fn()
- {
- return 1;
- }
- let fn_t = ctypes.FunctionType(ctypes.winapi_abi, ctypes.int32_t, []).ptr;
- do_check_throws(function() { fn_t(closure_fn) }, Error);
- }
-}
-
-function run_single_closure_tests(library, abi, suffix)
-{
- let b = 23;
-
- function closure_fn(i)
- {
- if (i == 42)
- throw "7.5 million years for that?";
- return "a" in this ? i + this.a : i + b;
- }
-
- do_check_eq(closure_fn(7), 7 + b);
- let thisobj = { a: 5 };
- do_check_eq(closure_fn.call(thisobj, 7), 7 + thisobj.a);
-
- // Construct a closure, and call it ourselves.
- let fn_t = ctypes.FunctionType(abi, ctypes.int32_t, [ ctypes.int8_t ]).ptr;
- let closure = fn_t(closure_fn);
- do_check_eq(closure(-17), -17 + b);
-
- // Have C code call it.
- let test_closure = library.declare("test_closure_" + suffix,
- ctypes.default_abi, ctypes.int32_t, ctypes.int8_t, fn_t);
- do_check_eq(test_closure(-52, closure), -52 + b);
-
- // Do the same, but specify 'this'.
- let closure2 = fn_t(closure_fn, thisobj);
- do_check_eq(closure2(-17), -17 + thisobj.a);
- do_check_eq(test_closure(-52, closure2), -52 + thisobj.a);
-
- // Specify an error sentinel, and have the JS code throw (see bug 599791).
- let closure3 = fn_t(closure_fn, null, 54);
- do_check_eq(closure3(42), 54);
- do_check_eq(test_closure(42, closure3), 54);
-
- // Check what happens when the return type is bigger than a word.
- var fn_64_t = ctypes.FunctionType(ctypes.default_abi, ctypes.uint64_t, [ctypes.bool]).ptr;
- var bignum1 = ctypes.UInt64.join(0xDEADBEEF, 0xBADF00D);
- var bignum2 = ctypes.UInt64.join(0xDEFEC8ED, 0xD15EA5E);
- function closure_fn_64(fail)
- {
- if (fail)
- throw "Just following orders, sir!";
- return bignum1;
- }
- var closure64 = fn_64_t(closure_fn_64, null, bignum2);
- do_check_eq(ctypes.UInt64.compare(closure64(false), bignum1), 0);
- do_check_eq(ctypes.UInt64.compare(closure64(true), bignum2), 0);
-
- // Test a callback that returns void (see bug 682504).
- var fn_v_t = ctypes.FunctionType(ctypes.default_abi, ctypes.void_t, []).ptr;
- fn_v_t(function() {})(); // Don't crash
-
- // Code evaluated in a sandbox uses (and pushes) a separate JSContext.
- // Make sure that we don't run into an assertion caused by a cx stack
- // mismatch with the cx stashed in the closure.
- try {
- var sb = Components.utils.Sandbox("http://www.example.com");
- sb.fn = fn_v_t(function() { sb.foo = {}; });
- Components.utils.evalInSandbox("fn();", sb);
- } catch (e) {} // Components not available in workers.
-
- // Make sure that a void callback can't return an error sentinel.
- var sentinelThrew = false;
- try {
- fn_v_t(function() {}, null, -1);
- } catch (e) {
- sentinelThrew = true;
- }
- do_check_true(sentinelThrew);
-}
-
-function run_variadic_tests(library) {
- let sum_va_type = ctypes.FunctionType(ctypes.default_abi,
- ctypes.int32_t,
- [ctypes.uint8_t, "..."]).ptr,
- sum_va = library.declare("test_sum_va_cdecl", ctypes.default_abi, ctypes.int32_t,
- ctypes.uint8_t, "...");
-
- do_check_eq(sum_va_type.toSource(),
- 'ctypes.FunctionType(ctypes.default_abi, ctypes.int32_t, [ctypes.uint8_t, "..."]).ptr');
- do_check_eq(sum_va.constructor.name, "int32_t(*)(uint8_t, ...)");
- do_check_true(sum_va.constructor.targetType.isVariadic);
-
- do_check_eq(sum_va(3,
- ctypes.int32_t(1),
- ctypes.int32_t(2),
- ctypes.int32_t(3)),
- 6);
-
- do_check_throws(function() {
- ctypes.FunctionType(ctypes.default_abi, ctypes.bool,
- [ctypes.bool, "...", ctypes.bool]);
- }, Error);
-
- do_check_throws(function() {
- ctypes.FunctionType(ctypes.default_abi, ctypes.bool, ["..."]);
- }, Error);
-
- if ("winLastError" in ctypes) {
- do_check_throws(function() {
- ctypes.FunctionType(ctypes.stdcall_abi, ctypes.bool,
- [ctypes.bool, "..."]);
- }, Error);
- do_check_throws(function() {
- ctypes.FunctionType(ctypes.winapi_abi, ctypes.bool,
- [ctypes.bool, "..."]);
- }, Error);
- }
-
- do_check_throws(function() {
- // No variadic closure callbacks allowed.
- sum_va_type(function() {});
- }, Error);
-
- let count_true_va = library.declare("test_sum_va_cdecl", ctypes.default_abi, ctypes.uint8_t,
- ctypes.uint8_t, "...");
- do_check_eq(count_true_va(8,
- ctypes.bool(false),
- ctypes.bool(false),
- ctypes.bool(false),
- ctypes.bool(true),
- ctypes.bool(true),
- ctypes.bool(false),
- ctypes.bool(true),
- ctypes.bool(true)),
- 4);
-
- let add_char_short_int_va = library.declare("test_add_char_short_int_va_cdecl",
- ctypes.default_abi, ctypes.void_t,
- ctypes.uint32_t.ptr, "..."),
- result = ctypes.uint32_t(3);
-
- add_char_short_int_va(result.address(),
- ctypes.char(5),
- ctypes.short(7),
- ctypes.uint32_t(11));
-
- do_check_eq(result.value, 3 + 5 + 7 + 11);
-
- result = ctypes.int32_t.array(3)([1, 1, 1]),
- v1 = ctypes.int32_t.array(4)([1, 2, 3, 5]),
- v2 = ctypes.int32_t.array(3)([7, 11, 13]),
- vector_add_va = library.declare("test_vector_add_va_cdecl",
- ctypes.default_abi, ctypes.int32_t.ptr,
- ctypes.uint8_t, ctypes.uint8_t, "..."),
- // Note that vector_add_va zeroes out result first.
- vec_sum = vector_add_va(2, 3, result, v1, v2);
- do_check_eq(vec_sum.contents, 8);
- do_check_eq(result[0], 8);
- do_check_eq(result[1], 13);
- do_check_eq(result[2], 16);
-
- do_check_true(!!(sum_va_type().value = sum_va_type()));
- let sum_notva_type = ctypes.FunctionType(sum_va_type.targetType.abi,
- sum_va_type.targetType.returnType,
- [ctypes.uint8_t]).ptr;
- do_check_throws(function() {
- sum_va_type().value = sum_notva_type();
- }, TypeError);
-}
-
-function run_static_data_tests(library)
-{
- const rect_t = new ctypes.StructType("myRECT",
- [{ top : ctypes.int32_t },
- { left : ctypes.int32_t },
- { bottom: ctypes.int32_t },
- { right : ctypes.int32_t }]);
-
- let data_rect = library.declare("data_rect", rect_t);
-
- // Test reading static data.
- do_check_true(data_rect.constructor === rect_t);
- do_check_eq(data_rect.top, -1);
- do_check_eq(data_rect.left, -2);
- do_check_eq(data_rect.bottom, 3);
- do_check_eq(data_rect.right, 4);
-
- // Test writing.
- data_rect.top = 9;
- data_rect.left = 8;
- data_rect.bottom = -11;
- data_rect.right = -12;
- do_check_eq(data_rect.top, 9);
- do_check_eq(data_rect.left, 8);
- do_check_eq(data_rect.bottom, -11);
- do_check_eq(data_rect.right, -12);
-
- // Make sure it's been written, not copied.
- let data_rect_2 = library.declare("data_rect", rect_t);
- do_check_eq(data_rect_2.top, 9);
- do_check_eq(data_rect_2.left, 8);
- do_check_eq(data_rect_2.bottom, -11);
- do_check_eq(data_rect_2.right, -12);
- do_check_eq(ptrValue(data_rect.address()), ptrValue(data_rect_2.address()));
-}
-
-function run_cpp_class_tests(library)
-{
- // try the gcc mangling, unless we're using MSVC.
- let OS = get_os();
- let ctor_symbol;
- let add_symbol;
- let abi;
- if (OS == "WINNT") {
- // for compatibility for Win32 vs Win64
- abi = ctypes.thiscall_abi;
- if (ctypes.size_t.size == 8) {
- ctor_symbol = '??0TestClass@@QEAA@H@Z';
- add_symbol = '?Add@TestClass@@QEAAHH@Z';
- } else {
- ctor_symbol = '??0TestClass@@QAE@H@Z';
- add_symbol = '?Add@TestClass@@QAEHH@Z';
- }
- } else {
- abi = ctypes.default_abi;
- ctor_symbol = "_ZN9TestClassC1Ei";
- add_symbol = "_ZN9TestClass3AddEi";
- }
-
- let test_class_ctor = library.declare(ctor_symbol, abi, ctypes.void_t,
- ctypes.int32_t.ptr, ctypes.int32_t);
- let i = ctypes.int32_t();
- test_class_ctor(i.address(), 8);
- do_check_eq(i.value, 8);
-
- let test_class_add = library.declare(add_symbol, abi, ctypes.int32_t,
- ctypes.int32_t.ptr, ctypes.int32_t);
- let j = test_class_add(i.address(), 5);
- do_check_eq(j, 13);
- do_check_eq(i.value, 13);
-}
-
-// bug 522360 - try loading system library without full path
-function run_load_system_library()
-{
- let syslib;
- let OS = get_os();
- if (OS == "WINNT") {
- syslib = ctypes.open("user32.dll");
- } else if (OS == "Darwin") {
- syslib = ctypes.open("libm.dylib");
- } else if (OS == "Linux" || OS == "Android" || OS.match(/BSD$/)) {
- try {
- syslib = ctypes.open("libm.so");
- } catch (e) {
- // limb.so wasn't available, try libm.so.6 instead
- syslib = ctypes.open("libm.so.6");
- }
- } else {
- do_throw("please add a system library for this test");
- }
- syslib.close();
- return true;
-}
diff --git a/toolkit/components/ctypes/tests/unit/xpcshell.ini b/toolkit/components/ctypes/tests/unit/xpcshell.ini
deleted file mode 100644
index 8920d4f9b..000000000
--- a/toolkit/components/ctypes/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,13 +0,0 @@
-[DEFAULT]
-head = head.js
-tail =
-skip-if = toolkit == 'android'
-
-[test_errno.js]
-
-[test_finalizer.js]
-[test_finalizer_shouldfail.js]
-[test_finalizer_shouldaccept.js]
-[test_jsctypes.js]
-# Bug 676989: test fails consistently on Android
-fail-if = os == "android"
diff --git a/toolkit/components/downloads/moz.build b/toolkit/components/downloads/moz.build
index e611f4010..b6f68e5fb 100644
--- a/toolkit/components/downloads/moz.build
+++ b/toolkit/components/downloads/moz.build
@@ -4,23 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-with Files('*'):
- BUG_COMPONENT = ('Toolkit', 'Download Manager')
-
-with Files('ApplicationReputation.*'):
- BUG_COMPONENT = ('Toolkit', 'Safe Browsing')
-
-with Files('chromium/*'):
- BUG_COMPONENT = ('Toolkit', 'Safe Browsing')
-
-with Files('generate_csd.sh'):
- BUG_COMPONENT = ('Toolkit', 'Safe Browsing')
-
-with Files('nsIApplicationReputation.idl'):
- BUG_COMPONENT = ('Toolkit', 'Safe Browsing')
-
-XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
-
XPIDL_SOURCES += [
'nsIApplicationReputation.idl',
'nsIDownload.idl',
@@ -31,14 +14,10 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'downloads'
-UNIFIED_SOURCES += [
- 'nsDownloadManager.cpp'
-]
+UNIFIED_SOURCES += ['nsDownloadManager.cpp']
# SQLFunctions.cpp cannot be built in unified mode because of Windows headers.
-SOURCES += [
- 'SQLFunctions.cpp',
-]
+SOURCES += ['SQLFunctions.cpp']
if CONFIG['MOZ_URL_CLASSIFIER']:
UNIFIED_SOURCES += [
@@ -49,9 +28,7 @@ if CONFIG['MOZ_URL_CLASSIFIER']:
if CONFIG['OS_ARCH'] == 'WINNT':
# Can't build unified because we need CreateEvent which some IPC code
# included in LoadContext ends up undefining.
- SOURCES += [
- 'nsDownloadScanner.cpp',
- ]
+ SOURCES += ['nsDownloadScanner.cpp']
# The Communicator Downloads Manager uses its own DownloadManagerUI
# component and it can't be guaranteed that its implimentation will override
diff --git a/toolkit/components/downloads/nsDownloadManager.cpp b/toolkit/components/downloads/nsDownloadManager.cpp
index ab984c5f2..587c1ac8a 100644
--- a/toolkit/components/downloads/nsDownloadManager.cpp
+++ b/toolkit/components/downloads/nsDownloadManager.cpp
@@ -61,10 +61,6 @@
#include <CoreFoundation/CoreFoundation.h>
#endif
-#ifdef MOZ_WIDGET_ANDROID
-#include "FennecJNIWrappers.h"
-#endif
-
#ifdef MOZ_WIDGET_GTK
#include <gtk/gtk.h>
#endif
@@ -1421,19 +1417,6 @@ nsDownloadManager::GetDefaultDownloadsDirectory(nsIFile **aResult)
}
}
#elif defined(XP_UNIX)
-#if defined(MOZ_WIDGET_ANDROID)
- // Android doesn't have a $HOME directory, and by default we only have
- // write access to /data/data/org.mozilla.{$APP} and /sdcard
- char* downloadDirPath = getenv("DOWNLOADS_DIRECTORY");
- if (downloadDirPath) {
- rv = NS_NewNativeLocalFile(nsDependentCString(downloadDirPath),
- true, getter_AddRefs(downloadDir));
- NS_ENSURE_SUCCESS(rv, rv);
- }
- else {
- rv = NS_ERROR_FAILURE;
- }
-#else
rv = dirService->Get(NS_UNIX_DEFAULT_DOWNLOAD_DIR,
NS_GET_IID(nsIFile),
getter_AddRefs(downloadDir));
@@ -1446,7 +1429,6 @@ nsDownloadManager::GetDefaultDownloadsDirectory(nsIFile **aResult)
rv = downloadDir->Append(folderName);
NS_ENSURE_SUCCESS(rv, rv);
}
-#endif
#else
rv = dirService->Get(NS_OS_HOME_DIR,
NS_GET_IID(nsIFile),
@@ -1847,6 +1829,9 @@ nsDownloadManager::RetryDownload(nsDownload* dl)
return rv;
}
+ rv = NotifyDownloadRemoval(dl);
+ NS_ENSURE_SUCCESS(rv, rv);
+
// reset time and download progress
dl->SetStartTime(PR_Now());
dl->SetProgressBytes(0, -1);
@@ -2685,14 +2670,6 @@ nsDownload::SetState(DownloadState aState)
case nsIDownloadManager::DOWNLOAD_DIRTY:
case nsIDownloadManager::DOWNLOAD_CANCELED:
case nsIDownloadManager::DOWNLOAD_FAILED:
-#ifdef ANDROID
- // If we still have a temp file, remove it
- bool tempExists;
- if (mTempFile && NS_SUCCEEDED(mTempFile->Exists(&tempExists)) && tempExists) {
- nsresult rv = mTempFile->Remove(false);
- NS_ENSURE_SUCCESS(rv, rv);
- }
-#endif
// Transfers are finished, so break the reference cycle
Finalize();
@@ -2770,7 +2747,7 @@ nsDownload::SetState(DownloadState aState)
}
}
-#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID) || defined(MOZ_WIDGET_GTK)
+#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
nsCOMPtr<nsIFileURL> fileURL = do_QueryInterface(mTarget);
nsCOMPtr<nsIFile> file;
nsAutoString path;
@@ -2780,27 +2757,13 @@ nsDownload::SetState(DownloadState aState)
file &&
NS_SUCCEEDED(file->GetPath(path))) {
-#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_ANDROID)
+#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
// On Windows and Gtk, add the download to the system's "recent documents"
// list, with a pref to disable.
{
bool addToRecentDocs = true;
if (pref)
pref->GetBoolPref(PREF_BDM_ADDTORECENTDOCS, &addToRecentDocs);
-#ifdef MOZ_WIDGET_ANDROID
- if (addToRecentDocs) {
- nsCOMPtr<nsIMIMEInfo> mimeInfo;
- nsAutoCString contentType;
- GetMIMEInfo(getter_AddRefs(mimeInfo));
-
- if (mimeInfo)
- mimeInfo->GetMIMEType(contentType);
-
- if (jni::IsFennec()) {
- java::DownloadsIntegration::ScanMedia(path, NS_ConvertUTF8toUTF16(contentType));
- }
- }
-#else
if (addToRecentDocs && !mPrivate) {
#ifdef XP_WIN
::SHAddToRecentDocs(SHARD_PATHW, path.get());
@@ -2815,7 +2778,6 @@ nsDownload::SetState(DownloadState aState)
}
#endif
}
-#endif
#ifdef MOZ_ENABLE_GIO
// Use GIO to store the source URI for later display in the file manager.
GFile* gio_file = g_file_new_for_path(NS_ConvertUTF16toUTF8(path).get());
@@ -3124,7 +3086,7 @@ nsDownload::OnStateChange(nsIWebProgress *aWebProgress,
#else
(void)SetState(nsIDownloadManager::DOWNLOAD_FINISHED);
#endif
- } else {
+ } else if (aStatus != NS_BINDING_ABORTED) {
// We failed for some unknown reason -- fail with a generic message
(void)FailDownload(aStatus, nullptr);
}
diff --git a/toolkit/components/downloads/test/unit/.eslintrc.js b/toolkit/components/downloads/test/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/downloads/test/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/downloads/test/unit/data/block_digest.chunk b/toolkit/components/downloads/test/unit/data/block_digest.chunk
deleted file mode 100644
index 34c47c4bb..000000000
--- a/toolkit/components/downloads/test/unit/data/block_digest.chunk
+++ /dev/null
@@ -1,2 +0,0 @@
-a:5:32:37
-,AÎJ,AÎJ„ä8æW´bbòñ_e‹;OÏÏ„CVù  \ No newline at end of file
diff --git a/toolkit/components/downloads/test/unit/data/digest.chunk b/toolkit/components/downloads/test/unit/data/digest.chunk
deleted file mode 100644
index b1fbb4667..000000000
--- a/toolkit/components/downloads/test/unit/data/digest.chunk
+++ /dev/null
@@ -1,3 +0,0 @@
-a:5:32:64
-“Ê_Há^˜aÍ7ÂÙ]´=#ÌnmåÃøún‹æo—ÌQ‰÷ãÍ
-‡É@.R0ðD©7Y4±íËퟆËS$³8 \ No newline at end of file
diff --git a/toolkit/components/downloads/test/unit/data/signed_win.exe b/toolkit/components/downloads/test/unit/data/signed_win.exe
deleted file mode 100644
index de3bb40e8..000000000
--- a/toolkit/components/downloads/test/unit/data/signed_win.exe
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/downloads/test/unit/head_download_manager.js b/toolkit/components/downloads/test/unit/head_download_manager.js
deleted file mode 100644
index 1e8248071..000000000
--- a/toolkit/components/downloads/test/unit/head_download_manager.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// This file tests the download manager backend
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-do_get_profile();
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://testing-common/httpd.js");
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-
-function createURI(aObj)
-{
- var ios = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
- return (aObj instanceof Ci.nsIFile) ? ios.newFileURI(aObj) :
- ios.newURI(aObj, null, null);
-}
diff --git a/toolkit/components/downloads/test/unit/tail_download_manager.js b/toolkit/components/downloads/test/unit/tail_download_manager.js
deleted file mode 100644
index 4043f31b9..000000000
--- a/toolkit/components/downloads/test/unit/tail_download_manager.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Provides infrastructure for automated download components tests.
- */
-
-"use strict";
-
-// Termination functions common to all tests
-
-add_task(function* test_common_terminate()
-{
- // Stop the HTTP server. We must do this inside a task in "tail.js" until the
- // xpcshell testing framework supports asynchronous termination functions.
- let deferred = Promise.defer();
- gHttpServer.stop(deferred.resolve);
- yield deferred.promise;
-});
-
diff --git a/toolkit/components/downloads/test/unit/test_app_rep.js b/toolkit/components/downloads/test/unit/test_app_rep.js
deleted file mode 100644
index 636a71e78..000000000
--- a/toolkit/components/downloads/test/unit/test_app_rep.js
+++ /dev/null
@@ -1,342 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import('resource://gre/modules/NetUtil.jsm');
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const gAppRep = Cc["@mozilla.org/downloads/application-reputation-service;1"].
- getService(Ci.nsIApplicationReputationService);
-var gHttpServ = null;
-var gTables = {};
-
-var ALLOW_LIST = 0;
-var BLOCK_LIST = 1;
-var NO_LIST = 2;
-
-var whitelistedURI = createURI("http://foo:bar@whitelisted.com/index.htm#junk");
-var exampleURI = createURI("http://user:password@example.com/i.html?foo=bar");
-var blocklistedURI = createURI("http://baz:qux@blocklisted.com?xyzzy");
-
-const appRepURLPref = "browser.safebrowsing.downloads.remote.url";
-
-function readFileToString(aFilename) {
- let f = do_get_file(aFilename);
- let stream = Cc["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Ci.nsIFileInputStream);
- stream.init(f, -1, 0, 0);
- let buf = NetUtil.readInputStreamToString(stream, stream.available());
- return buf;
-}
-
-// Registers a table for which to serve update chunks. Returns a promise that
-// resolves when that chunk has been downloaded.
-function registerTableUpdate(aTable, aFilename) {
- // If we haven't been given an update for this table yet, add it to the map
- if (!(aTable in gTables)) {
- gTables[aTable] = [];
- }
-
- // The number of chunks associated with this table.
- let numChunks = gTables[aTable].length + 1;
- let redirectPath = "/" + aTable + "-" + numChunks;
- let redirectUrl = "localhost:4444" + redirectPath;
-
- // Store redirect url for that table so we can return it later when we
- // process an update request.
- gTables[aTable].push(redirectUrl);
-
- gHttpServ.registerPathHandler(redirectPath, function(request, response) {
- do_print("Mock safebrowsing server handling request for " + redirectPath);
- let contents = readFileToString(aFilename);
- do_print("Length of " + aFilename + ": " + contents.length);
- response.setHeader("Content-Type",
- "application/vnd.google.safebrowsing-update", false);
- response.setStatusLine(request.httpVersion, 200, "OK");
- response.bodyOutputStream.write(contents, contents.length);
- });
-}
-
-add_task(function* test_setup() {
- // Set up a local HTTP server to return bad verdicts.
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- // Ensure safebrowsing is enabled for this test, even if the app
- // doesn't have it enabled.
- Services.prefs.setBoolPref("browser.safebrowsing.malware.enabled", true);
- Services.prefs.setBoolPref("browser.safebrowsing.downloads.enabled", true);
- do_register_cleanup(function() {
- Services.prefs.clearUserPref("browser.safebrowsing.malware.enabled");
- Services.prefs.clearUserPref("browser.safebrowsing.downloads.enabled");
- });
-
- // Set block and allow tables explicitly, since the allowlist is normally
- // disabled on non-Windows platforms.
- Services.prefs.setCharPref("urlclassifier.downloadBlockTable",
- "goog-badbinurl-shavar");
- Services.prefs.setCharPref("urlclassifier.downloadAllowTable",
- "goog-downloadwhite-digest256");
- do_register_cleanup(function() {
- Services.prefs.clearUserPref("urlclassifier.downloadBlockTable");
- Services.prefs.clearUserPref("urlclassifier.downloadAllowTable");
- });
-
- gHttpServ = new HttpServer();
- gHttpServ.registerDirectory("/", do_get_cwd());
- gHttpServ.registerPathHandler("/download", function(request, response) {
- do_throw("This test should never make a remote lookup");
- });
- gHttpServ.start(4444);
-});
-
-function run_test() {
- run_next_test();
-}
-
-function check_telemetry(aCount,
- aShouldBlockCount,
- aListCounts) {
- let count = Cc["@mozilla.org/base/telemetry;1"]
- .getService(Ci.nsITelemetry)
- .getHistogramById("APPLICATION_REPUTATION_COUNT")
- .snapshot();
- do_check_eq(count.counts[1], aCount);
- let local = Cc["@mozilla.org/base/telemetry;1"]
- .getService(Ci.nsITelemetry)
- .getHistogramById("APPLICATION_REPUTATION_LOCAL")
- .snapshot();
- do_check_eq(local.counts[ALLOW_LIST], aListCounts[ALLOW_LIST],
- "Allow list counts don't match");
- do_check_eq(local.counts[BLOCK_LIST], aListCounts[BLOCK_LIST],
- "Block list counts don't match");
- do_check_eq(local.counts[NO_LIST], aListCounts[NO_LIST],
- "No list counts don't match");
-
- let shouldBlock = Cc["@mozilla.org/base/telemetry;1"]
- .getService(Ci.nsITelemetry)
- .getHistogramById("APPLICATION_REPUTATION_SHOULD_BLOCK")
- .snapshot();
- // SHOULD_BLOCK = true
- do_check_eq(shouldBlock.counts[1], aShouldBlockCount);
- // Sanity check that SHOULD_BLOCK total adds up to the COUNT.
- do_check_eq(shouldBlock.counts[0] + shouldBlock.counts[1], aCount);
-}
-
-function get_telemetry_counts() {
- let count = Cc["@mozilla.org/base/telemetry;1"]
- .getService(Ci.nsITelemetry)
- .getHistogramById("APPLICATION_REPUTATION_COUNT")
- .snapshot();
- let local = Cc["@mozilla.org/base/telemetry;1"]
- .getService(Ci.nsITelemetry)
- .getHistogramById("APPLICATION_REPUTATION_LOCAL")
- .snapshot();
- let shouldBlock = Cc["@mozilla.org/base/telemetry;1"]
- .getService(Ci.nsITelemetry)
- .getHistogramById("APPLICATION_REPUTATION_SHOULD_BLOCK")
- .snapshot();
- return { total: count.counts[1],
- shouldBlock: shouldBlock.counts[1],
- listCounts: local.counts };
-}
-
-add_test(function test_nullSourceURI() {
- let counts = get_telemetry_counts();
- gAppRep.queryReputation({
- // No source URI
- fileSize: 12,
- }, function onComplete(aShouldBlock, aStatus) {
- do_check_eq(Cr.NS_ERROR_UNEXPECTED, aStatus);
- do_check_false(aShouldBlock);
- check_telemetry(counts.total + 1, counts.shouldBlock, counts.listCounts);
- run_next_test();
- });
-});
-
-add_test(function test_nullCallback() {
- let counts = get_telemetry_counts();
- try {
- gAppRep.queryReputation({
- sourceURI: createURI("http://example.com"),
- fileSize: 12,
- }, null);
- do_throw("Callback cannot be null");
- } catch (ex) {
- if (ex.result != Cr.NS_ERROR_INVALID_POINTER)
- throw ex;
- // We don't even increment the count here, because there's no callback.
- check_telemetry(counts.total, counts.shouldBlock, counts.listCounts);
- run_next_test();
- }
-});
-
-// Set up the local whitelist.
-add_test(function test_local_list() {
- // Construct a response with redirect urls.
- function processUpdateRequest() {
- let response = "n:1000\n";
- for (let table in gTables) {
- response += "i:" + table + "\n";
- for (let i = 0; i < gTables[table].length; ++i) {
- response += "u:" + gTables[table][i] + "\n";
- }
- }
- do_print("Returning update response: " + response);
- return response;
- }
- gHttpServ.registerPathHandler("/downloads", function(request, response) {
- let blob = processUpdateRequest();
- response.setHeader("Content-Type",
- "application/vnd.google.safebrowsing-update", false);
- response.setStatusLine(request.httpVersion, 200, "OK");
- response.bodyOutputStream.write(blob, blob.length);
- });
-
- let streamUpdater = Cc["@mozilla.org/url-classifier/streamupdater;1"]
- .getService(Ci.nsIUrlClassifierStreamUpdater);
-
- // Load up some update chunks for the safebrowsing server to serve.
- // This chunk contains the hash of blocklisted.com/.
- registerTableUpdate("goog-badbinurl-shavar", "data/block_digest.chunk");
- // This chunk contains the hash of whitelisted.com/.
- registerTableUpdate("goog-downloadwhite-digest256", "data/digest.chunk");
-
- // Download some updates, and don't continue until the downloads are done.
- function updateSuccess(aEvent) {
- // Timeout of n:1000 is constructed in processUpdateRequest above and
- // passed back in the callback in nsIUrlClassifierStreamUpdater on success.
- do_check_eq("1000", aEvent);
- do_print("All data processed");
- run_next_test();
- }
- // Just throw if we ever get an update or download error.
- function handleError(aEvent) {
- do_throw("We didn't download or update correctly: " + aEvent);
- }
- streamUpdater.downloadUpdates(
- "goog-downloadwhite-digest256,goog-badbinurl-shavar",
- "goog-downloadwhite-digest256,goog-badbinurl-shavar;\n",
- true, // isPostRequest.
- "http://localhost:4444/downloads",
- updateSuccess, handleError, handleError);
-});
-
-add_test(function test_unlisted() {
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- let counts = get_telemetry_counts();
- let listCounts = counts.listCounts;
- listCounts[NO_LIST]++;
- gAppRep.queryReputation({
- sourceURI: exampleURI,
- fileSize: 12,
- }, function onComplete(aShouldBlock, aStatus) {
- do_check_eq(Cr.NS_OK, aStatus);
- do_check_false(aShouldBlock);
- check_telemetry(counts.total + 1, counts.shouldBlock, listCounts);
- run_next_test();
- });
-});
-
-add_test(function test_non_uri() {
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- let counts = get_telemetry_counts();
- let listCounts = counts.listCounts;
- // No listcount is incremented, since the sourceURI is not an nsIURL
- let source = NetUtil.newURI("data:application/octet-stream,ABC");
- do_check_false(source instanceof Ci.nsIURL);
- gAppRep.queryReputation({
- sourceURI: source,
- fileSize: 12,
- }, function onComplete(aShouldBlock, aStatus) {
- do_check_eq(Cr.NS_OK, aStatus);
- do_check_false(aShouldBlock);
- check_telemetry(counts.total + 1, counts.shouldBlock, listCounts);
- run_next_test();
- });
-});
-
-add_test(function test_local_blacklist() {
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- let counts = get_telemetry_counts();
- let listCounts = counts.listCounts;
- listCounts[BLOCK_LIST]++;
- gAppRep.queryReputation({
- sourceURI: blocklistedURI,
- fileSize: 12,
- }, function onComplete(aShouldBlock, aStatus) {
- do_check_eq(Cr.NS_OK, aStatus);
- do_check_true(aShouldBlock);
- check_telemetry(counts.total + 1, counts.shouldBlock + 1, listCounts);
- run_next_test();
- });
-});
-
-add_test(function test_referer_blacklist() {
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- let counts = get_telemetry_counts();
- let listCounts = counts.listCounts;
- listCounts[BLOCK_LIST]++;
- gAppRep.queryReputation({
- sourceURI: exampleURI,
- referrerURI: blocklistedURI,
- fileSize: 12,
- }, function onComplete(aShouldBlock, aStatus) {
- do_check_eq(Cr.NS_OK, aStatus);
- do_check_true(aShouldBlock);
- check_telemetry(counts.total + 1, counts.shouldBlock + 1, listCounts);
- run_next_test();
- });
-});
-
-add_test(function test_blocklist_trumps_allowlist() {
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- let counts = get_telemetry_counts();
- let listCounts = counts.listCounts;
- listCounts[BLOCK_LIST]++;
- gAppRep.queryReputation({
- sourceURI: whitelistedURI,
- referrerURI: blocklistedURI,
- fileSize: 12,
- }, function onComplete(aShouldBlock, aStatus) {
- do_check_eq(Cr.NS_OK, aStatus);
- do_check_true(aShouldBlock);
- check_telemetry(counts.total + 1, counts.shouldBlock + 1, listCounts);
- run_next_test();
- });
-});
-
-add_test(function test_redirect_on_blocklist() {
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- let counts = get_telemetry_counts();
- let listCounts = counts.listCounts;
- listCounts[BLOCK_LIST]++;
- listCounts[ALLOW_LIST]++;
- let secman = Services.scriptSecurityManager;
- let badRedirects = Cc["@mozilla.org/array;1"]
- .createInstance(Ci.nsIMutableArray);
- badRedirects.appendElement(secman.createCodebasePrincipal(exampleURI, {}),
- false);
- badRedirects.appendElement(secman.createCodebasePrincipal(blocklistedURI, {}),
- false);
- badRedirects.appendElement(secman.createCodebasePrincipal(whitelistedURI, {}),
- false);
- gAppRep.queryReputation({
- sourceURI: whitelistedURI,
- referrerURI: exampleURI,
- redirects: badRedirects,
- fileSize: 12,
- }, function onComplete(aShouldBlock, aStatus) {
- do_check_eq(Cr.NS_OK, aStatus);
- do_check_true(aShouldBlock);
- check_telemetry(counts.total + 1, counts.shouldBlock + 1, listCounts);
- run_next_test();
- });
-});
diff --git a/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js b/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js
deleted file mode 100644
index 7f94d1520..000000000
--- a/toolkit/components/downloads/test/unit/test_app_rep_maclinux.js
+++ /dev/null
@@ -1,303 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests signature extraction using Windows Authenticode APIs of
- * downloaded files.
- */
-
-// Globals
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-
-const gAppRep = Cc["@mozilla.org/downloads/application-reputation-service;1"].
- getService(Ci.nsIApplicationReputationService);
-var gStillRunning = true;
-var gTables = {};
-var gHttpServer = null;
-
-const appRepURLPref = "browser.safebrowsing.downloads.remote.url";
-const remoteEnabledPref = "browser.safebrowsing.downloads.remote.enabled";
-
-function readFileToString(aFilename) {
- let f = do_get_file(aFilename);
- let stream = Cc["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Ci.nsIFileInputStream);
- stream.init(f, -1, 0, 0);
- let buf = NetUtil.readInputStreamToString(stream, stream.available());
- return buf;
-}
-
-function registerTableUpdate(aTable, aFilename) {
- // If we haven't been given an update for this table yet, add it to the map
- if (!(aTable in gTables)) {
- gTables[aTable] = [];
- }
-
- // The number of chunks associated with this table.
- let numChunks = gTables[aTable].length + 1;
- let redirectPath = "/" + aTable + "-" + numChunks;
- let redirectUrl = "localhost:4444" + redirectPath;
-
- // Store redirect url for that table so we can return it later when we
- // process an update request.
- gTables[aTable].push(redirectUrl);
-
- gHttpServer.registerPathHandler(redirectPath, function(request, response) {
- do_print("Mock safebrowsing server handling request for " + redirectPath);
- let contents = readFileToString(aFilename);
- do_print("Length of " + aFilename + ": " + contents.length);
- response.setHeader("Content-Type",
- "application/vnd.google.safebrowsing-update", false);
- response.setStatusLine(request.httpVersion, 200, "OK");
- response.bodyOutputStream.write(contents, contents.length);
- });
-}
-
-// Tests
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function test_setup()
-{
- // Wait 10 minutes, that is half of the external xpcshell timeout.
- do_timeout(10 * 60 * 1000, function() {
- if (gStillRunning) {
- do_throw("Test timed out.");
- }
- });
- // Set up a local HTTP server to return bad verdicts.
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- // Ensure safebrowsing is enabled for this test, even if the app
- // doesn't have it enabled.
- Services.prefs.setBoolPref("browser.safebrowsing.malware.enabled", true);
- Services.prefs.setBoolPref("browser.safebrowsing.downloads.enabled", true);
- // Set block table explicitly, no need for the allow table though
- Services.prefs.setCharPref("urlclassifier.downloadBlockTable",
- "goog-badbinurl-shavar");
- // SendRemoteQueryInternal needs locale preference.
- let locale = Services.prefs.getCharPref("general.useragent.locale");
- Services.prefs.setCharPref("general.useragent.locale", "en-US");
-
- do_register_cleanup(function() {
- Services.prefs.clearUserPref("browser.safebrowsing.malware.enabled");
- Services.prefs.clearUserPref("browser.safebrowsing.downloads.enabled");
- Services.prefs.clearUserPref("urlclassifier.downloadBlockTable");
- Services.prefs.setCharPref("general.useragent.locale", locale);
- });
-
- gHttpServer = new HttpServer();
- gHttpServer.registerDirectory("/", do_get_cwd());
-
- function createVerdict(aShouldBlock) {
- // We can't programmatically create a protocol buffer here, so just
- // hardcode some already serialized ones.
- let blob = String.fromCharCode(parseInt(0x08, 16));
- if (aShouldBlock) {
- // A safe_browsing::ClientDownloadRequest with a DANGEROUS verdict
- blob += String.fromCharCode(parseInt(0x01, 16));
- } else {
- // A safe_browsing::ClientDownloadRequest with a SAFE verdict
- blob += String.fromCharCode(parseInt(0x00, 16));
- }
- return blob;
- }
-
- gHttpServer.registerPathHandler("/throw", function(request, response) {
- do_throw("We shouldn't be getting here");
- });
-
- gHttpServer.registerPathHandler("/download", function(request, response) {
- do_print("Querying remote server for verdict");
- response.setHeader("Content-Type", "application/octet-stream", false);
- let buf = NetUtil.readInputStreamToString(
- request.bodyInputStream,
- request.bodyInputStream.available());
- do_print("Request length: " + buf.length);
- // A garbage response. By default this produces NS_CANNOT_CONVERT_DATA as
- // the callback status.
- let blob = "this is not a serialized protocol buffer (the length doesn't match our hard-coded values)";
- // We can't actually parse the protocol buffer here, so just switch on the
- // length instead of inspecting the contents.
- if (buf.length == 67) {
- // evil.com
- blob = createVerdict(true);
- } else if (buf.length == 73) {
- // mozilla.com
- blob = createVerdict(false);
- }
- response.bodyOutputStream.write(blob, blob.length);
- });
-
- gHttpServer.start(4444);
-});
-
-// Construct a response with redirect urls.
-function processUpdateRequest() {
- let response = "n:1000\n";
- for (let table in gTables) {
- response += "i:" + table + "\n";
- for (let i = 0; i < gTables[table].length; ++i) {
- response += "u:" + gTables[table][i] + "\n";
- }
- }
- do_print("Returning update response: " + response);
- return response;
-}
-
-// Set up the local whitelist.
-function waitForUpdates() {
- let deferred = Promise.defer();
- gHttpServer.registerPathHandler("/downloads", function(request, response) {
- let blob = processUpdateRequest();
- response.setHeader("Content-Type",
- "application/vnd.google.safebrowsing-update", false);
- response.setStatusLine(request.httpVersion, 200, "OK");
- response.bodyOutputStream.write(blob, blob.length);
- });
-
- let streamUpdater = Cc["@mozilla.org/url-classifier/streamupdater;1"]
- .getService(Ci.nsIUrlClassifierStreamUpdater);
-
- // Load up some update chunks for the safebrowsing server to serve. This
- // particular chunk contains the hash of whitelisted.com/ and
- // sb-ssl.google.com/safebrowsing/csd/certificate/.
- registerTableUpdate("goog-downloadwhite-digest256", "data/digest.chunk");
-
- // Resolve the promise once processing the updates is complete.
- function updateSuccess(aEvent) {
- // Timeout of n:1000 is constructed in processUpdateRequest above and
- // passed back in the callback in nsIUrlClassifierStreamUpdater on success.
- do_check_eq("1000", aEvent);
- do_print("All data processed");
- deferred.resolve(true);
- }
- // Just throw if we ever get an update or download error.
- function handleError(aEvent) {
- do_throw("We didn't download or update correctly: " + aEvent);
- deferred.reject();
- }
- streamUpdater.downloadUpdates(
- "goog-downloadwhite-digest256",
- "goog-downloadwhite-digest256;\n",
- true,
- "http://localhost:4444/downloads",
- updateSuccess, handleError, handleError);
- return deferred.promise;
-}
-
-function promiseQueryReputation(query, expectedShouldBlock) {
- let deferred = Promise.defer();
- function onComplete(aShouldBlock, aStatus) {
- do_check_eq(Cr.NS_OK, aStatus);
- do_check_eq(aShouldBlock, expectedShouldBlock);
- deferred.resolve(true);
- }
- gAppRep.queryReputation(query, onComplete);
- return deferred.promise;
-}
-
-add_task(function* ()
-{
- // Wait for Safebrowsing local list updates to complete.
- yield waitForUpdates();
-});
-
-add_task(function* test_blocked_binary()
-{
- // We should reach the remote server for a verdict.
- Services.prefs.setBoolPref(remoteEnabledPref,
- true);
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- // evil.com should return a malware verdict from the remote server.
- yield promiseQueryReputation({sourceURI: createURI("http://evil.com"),
- suggestedFileName: "noop.bat",
- fileSize: 12}, true);
-});
-
-add_task(function* test_non_binary()
-{
- // We should not reach the remote server for a verdict for non-binary files.
- Services.prefs.setBoolPref(remoteEnabledPref,
- true);
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/throw");
- yield promiseQueryReputation({sourceURI: createURI("http://evil.com"),
- suggestedFileName: "noop.txt",
- fileSize: 12}, false);
-});
-
-add_task(function* test_good_binary()
-{
- // We should reach the remote server for a verdict.
- Services.prefs.setBoolPref(remoteEnabledPref,
- true);
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- // mozilla.com should return a not-guilty verdict from the remote server.
- yield promiseQueryReputation({sourceURI: createURI("http://mozilla.com"),
- suggestedFileName: "noop.bat",
- fileSize: 12}, false);
-});
-
-add_task(function* test_disabled()
-{
- // Explicitly disable remote checks
- Services.prefs.setBoolPref(remoteEnabledPref,
- false);
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/throw");
- let query = {sourceURI: createURI("http://example.com"),
- suggestedFileName: "noop.bat",
- fileSize: 12};
- let deferred = Promise.defer();
- gAppRep.queryReputation(query,
- function onComplete(aShouldBlock, aStatus) {
- // We should be getting NS_ERROR_NOT_AVAILABLE if the service is disabled
- do_check_eq(Cr.NS_ERROR_NOT_AVAILABLE, aStatus);
- do_check_false(aShouldBlock);
- deferred.resolve(true);
- }
- );
- yield deferred.promise;
-});
-
-add_task(function* test_disabled_through_lists()
-{
- Services.prefs.setBoolPref(remoteEnabledPref,
- false);
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- Services.prefs.setCharPref("urlclassifier.downloadBlockTable", "");
- let query = {sourceURI: createURI("http://example.com"),
- suggestedFileName: "noop.bat",
- fileSize: 12};
- let deferred = Promise.defer();
- gAppRep.queryReputation(query,
- function onComplete(aShouldBlock, aStatus) {
- // We should be getting NS_ERROR_NOT_AVAILABLE if the service is disabled
- do_check_eq(Cr.NS_ERROR_NOT_AVAILABLE, aStatus);
- do_check_false(aShouldBlock);
- deferred.resolve(true);
- }
- );
- yield deferred.promise;
-});
-add_task(function* test_teardown()
-{
- gStillRunning = false;
-});
diff --git a/toolkit/components/downloads/test/unit/test_app_rep_windows.js b/toolkit/components/downloads/test/unit/test_app_rep_windows.js
deleted file mode 100644
index 4ff772e61..000000000
--- a/toolkit/components/downloads/test/unit/test_app_rep_windows.js
+++ /dev/null
@@ -1,434 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests signature extraction using Windows Authenticode APIs of
- * downloaded files.
- */
-
-// Globals
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-
-const BackgroundFileSaverOutputStream = Components.Constructor(
- "@mozilla.org/network/background-file-saver;1?mode=outputstream",
- "nsIBackgroundFileSaver");
-
-const StringInputStream = Components.Constructor(
- "@mozilla.org/io/string-input-stream;1",
- "nsIStringInputStream",
- "setData");
-
-const TEST_FILE_NAME_1 = "test-backgroundfilesaver-1.txt";
-
-const gAppRep = Cc["@mozilla.org/downloads/application-reputation-service;1"].
- getService(Ci.nsIApplicationReputationService);
-var gStillRunning = true;
-var gTables = {};
-var gHttpServer = null;
-
-const appRepURLPref = "browser.safebrowsing.downloads.remote.url";
-const remoteEnabledPref = "browser.safebrowsing.downloads.remote.enabled";
-
-/**
- * Returns a reference to a temporary file. If the file is then created, it
- * will be removed when tests in this file finish.
- */
-function getTempFile(aLeafName) {
- let file = FileUtils.getFile("TmpD", [aLeafName]);
- do_register_cleanup(function GTF_cleanup() {
- if (file.exists()) {
- file.remove(false);
- }
- });
- return file;
-}
-
-function readFileToString(aFilename) {
- let f = do_get_file(aFilename);
- let stream = Cc["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Ci.nsIFileInputStream);
- stream.init(f, -1, 0, 0);
- let buf = NetUtil.readInputStreamToString(stream, stream.available());
- return buf;
-}
-
-/**
- * Waits for the given saver object to complete.
- *
- * @param aSaver
- * The saver, with the output stream or a stream listener implementation.
- * @param aOnTargetChangeFn
- * Optional callback invoked with the target file name when it changes.
- *
- * @return {Promise}
- * @resolves When onSaveComplete is called with a success code.
- * @rejects With an exception, if onSaveComplete is called with a failure code.
- */
-function promiseSaverComplete(aSaver, aOnTargetChangeFn) {
- let deferred = Promise.defer();
- aSaver.observer = {
- onTargetChange: function BFSO_onSaveComplete(unused, aTarget)
- {
- if (aOnTargetChangeFn) {
- aOnTargetChangeFn(aTarget);
- }
- },
- onSaveComplete: function BFSO_onSaveComplete(unused, aStatus)
- {
- if (Components.isSuccessCode(aStatus)) {
- deferred.resolve();
- } else {
- deferred.reject(new Components.Exception("Saver failed.", aStatus));
- }
- },
- };
- return deferred.promise;
-}
-
-/**
- * Feeds a string to a BackgroundFileSaverOutputStream.
- *
- * @param aSourceString
- * The source data to copy.
- * @param aSaverOutputStream
- * The BackgroundFileSaverOutputStream to feed.
- * @param aCloseWhenDone
- * If true, the output stream will be closed when the copy finishes.
- *
- * @return {Promise}
- * @resolves When the copy completes with a success code.
- * @rejects With an exception, if the copy fails.
- */
-function promiseCopyToSaver(aSourceString, aSaverOutputStream, aCloseWhenDone) {
- let deferred = Promise.defer();
- let inputStream = new StringInputStream(aSourceString, aSourceString.length);
- let copier = Cc["@mozilla.org/network/async-stream-copier;1"]
- .createInstance(Ci.nsIAsyncStreamCopier);
- copier.init(inputStream, aSaverOutputStream, null, false, true, 0x8000, true,
- aCloseWhenDone);
- copier.asyncCopy({
- onStartRequest: function () { },
- onStopRequest: function (aRequest, aContext, aStatusCode)
- {
- if (Components.isSuccessCode(aStatusCode)) {
- deferred.resolve();
- } else {
- deferred.reject(new Components.Exception(aResult));
- }
- },
- }, null);
- return deferred.promise;
-}
-
-// Registers a table for which to serve update chunks.
-function registerTableUpdate(aTable, aFilename) {
- // If we haven't been given an update for this table yet, add it to the map
- if (!(aTable in gTables)) {
- gTables[aTable] = [];
- }
-
- // The number of chunks associated with this table.
- let numChunks = gTables[aTable].length + 1;
- let redirectPath = "/" + aTable + "-" + numChunks;
- let redirectUrl = "localhost:4444" + redirectPath;
-
- // Store redirect url for that table so we can return it later when we
- // process an update request.
- gTables[aTable].push(redirectUrl);
-
- gHttpServer.registerPathHandler(redirectPath, function(request, response) {
- do_print("Mock safebrowsing server handling request for " + redirectPath);
- let contents = readFileToString(aFilename);
- do_print("Length of " + aFilename + ": " + contents.length);
- response.setHeader("Content-Type",
- "application/vnd.google.safebrowsing-update", false);
- response.setStatusLine(request.httpVersion, 200, "OK");
- response.bodyOutputStream.write(contents, contents.length);
- });
-}
-
-// Tests
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_setup()
-{
- // Wait 10 minutes, that is half of the external xpcshell timeout.
- do_timeout(10 * 60 * 1000, function() {
- if (gStillRunning) {
- do_throw("Test timed out.");
- }
- });
- // Set up a local HTTP server to return bad verdicts.
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- // Ensure safebrowsing is enabled for this test, even if the app
- // doesn't have it enabled.
- Services.prefs.setBoolPref("browser.safebrowsing.malware.enabled", true);
- Services.prefs.setBoolPref("browser.safebrowsing.downloads.enabled", true);
- // Set block and allow tables explicitly, since the allowlist is normally
- // disabled on comm-central.
- Services.prefs.setCharPref("urlclassifier.downloadBlockTable",
- "goog-badbinurl-shavar");
- Services.prefs.setCharPref("urlclassifier.downloadAllowTable",
- "goog-downloadwhite-digest256");
- // SendRemoteQueryInternal needs locale preference.
- let locale = Services.prefs.getCharPref("general.useragent.locale");
- Services.prefs.setCharPref("general.useragent.locale", "en-US");
-
- do_register_cleanup(function() {
- Services.prefs.clearUserPref("browser.safebrowsing.malware.enabled");
- Services.prefs.clearUserPref("browser.safebrowsing.downloads.enabled");
- Services.prefs.clearUserPref("urlclassifier.downloadBlockTable");
- Services.prefs.clearUserPref("urlclassifier.downloadAllowTable");
- Services.prefs.setCharPref("general.useragent.locale", locale);
- });
-
- gHttpServer = new HttpServer();
- gHttpServer.registerDirectory("/", do_get_cwd());
-
- function createVerdict(aShouldBlock) {
- // We can't programmatically create a protocol buffer here, so just
- // hardcode some already serialized ones.
- let blob = String.fromCharCode(parseInt(0x08, 16));
- if (aShouldBlock) {
- // A safe_browsing::ClientDownloadRequest with a DANGEROUS verdict
- blob += String.fromCharCode(parseInt(0x01, 16));
- } else {
- // A safe_browsing::ClientDownloadRequest with a SAFE verdict
- blob += String.fromCharCode(parseInt(0x00, 16));
- }
- return blob;
- }
-
- gHttpServer.registerPathHandler("/throw", function(request, response) {
- do_throw("We shouldn't be getting here");
- });
-
- gHttpServer.registerPathHandler("/download", function(request, response) {
- do_print("Querying remote server for verdict");
- response.setHeader("Content-Type", "application/octet-stream", false);
- let buf = NetUtil.readInputStreamToString(
- request.bodyInputStream,
- request.bodyInputStream.available());
- do_print("Request length: " + buf.length);
- // A garbage response. By default this produces NS_CANNOT_CONVERT_DATA as
- // the callback status.
- let blob = "this is not a serialized protocol buffer (the length doesn't match our hard-coded values)";
- // We can't actually parse the protocol buffer here, so just switch on the
- // length instead of inspecting the contents.
- if (buf.length == 67) {
- // evil.com
- blob = createVerdict(true);
- } else if (buf.length == 73) {
- // mozilla.com
- blob = createVerdict(false);
- }
- response.bodyOutputStream.write(blob, blob.length);
- });
-
- gHttpServer.start(4444);
-});
-
-// Construct a response with redirect urls.
-function processUpdateRequest() {
- let response = "n:1000\n";
- for (let table in gTables) {
- response += "i:" + table + "\n";
- for (let i = 0; i < gTables[table].length; ++i) {
- response += "u:" + gTables[table][i] + "\n";
- }
- }
- do_print("Returning update response: " + response);
- return response;
-}
-
-// Set up the local whitelist.
-function waitForUpdates() {
- let deferred = Promise.defer();
- gHttpServer.registerPathHandler("/downloads", function(request, response) {
- let blob = processUpdateRequest();
- response.setHeader("Content-Type",
- "application/vnd.google.safebrowsing-update", false);
- response.setStatusLine(request.httpVersion, 200, "OK");
- response.bodyOutputStream.write(blob, blob.length);
- });
-
- let streamUpdater = Cc["@mozilla.org/url-classifier/streamupdater;1"]
- .getService(Ci.nsIUrlClassifierStreamUpdater);
-
- // Load up some update chunks for the safebrowsing server to serve. This
- // particular chunk contains the hash of whitelisted.com/ and
- // sb-ssl.google.com/safebrowsing/csd/certificate/.
- registerTableUpdate("goog-downloadwhite-digest256", "data/digest.chunk");
-
- // Resolve the promise once processing the updates is complete.
- function updateSuccess(aEvent) {
- // Timeout of n:1000 is constructed in processUpdateRequest above and
- // passed back in the callback in nsIUrlClassifierStreamUpdater on success.
- do_check_eq("1000", aEvent);
- do_print("All data processed");
- deferred.resolve(true);
- }
- // Just throw if we ever get an update or download error.
- function handleError(aEvent) {
- do_throw("We didn't download or update correctly: " + aEvent);
- deferred.reject();
- }
- streamUpdater.downloadUpdates(
- "goog-downloadwhite-digest256",
- "goog-downloadwhite-digest256;\n",
- true,
- "http://localhost:4444/downloads",
- updateSuccess, handleError, handleError);
- return deferred.promise;
-}
-
-function promiseQueryReputation(query, expectedShouldBlock) {
- let deferred = Promise.defer();
- function onComplete(aShouldBlock, aStatus) {
- do_check_eq(Cr.NS_OK, aStatus);
- do_check_eq(aShouldBlock, expectedShouldBlock);
- deferred.resolve(true);
- }
- gAppRep.queryReputation(query, onComplete);
- return deferred.promise;
-}
-
-add_task(function* ()
-{
- // Wait for Safebrowsing local list updates to complete.
- yield waitForUpdates();
-});
-
-add_task(function* test_signature_whitelists()
-{
- // We should never get to the remote server.
- Services.prefs.setBoolPref(remoteEnabledPref,
- true);
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/throw");
-
- // Use BackgroundFileSaver to extract the signature on Windows.
- let destFile = getTempFile(TEST_FILE_NAME_1);
-
- let data = readFileToString("data/signed_win.exe");
- let saver = new BackgroundFileSaverOutputStream();
- let completionPromise = promiseSaverComplete(saver);
- saver.enableSignatureInfo();
- saver.setTarget(destFile, false);
- yield promiseCopyToSaver(data, saver, true);
-
- saver.finish(Cr.NS_OK);
- yield completionPromise;
-
- // Clean up.
- destFile.remove(false);
-
- // evil.com is not on the allowlist, but this binary is signed by an entity
- // whose certificate information is on the allowlist.
- yield promiseQueryReputation({sourceURI: createURI("http://evil.com"),
- signatureInfo: saver.signatureInfo,
- fileSize: 12}, false);
-});
-
-add_task(function* test_blocked_binary()
-{
- // We should reach the remote server for a verdict.
- Services.prefs.setBoolPref(remoteEnabledPref,
- true);
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- // evil.com should return a malware verdict from the remote server.
- yield promiseQueryReputation({sourceURI: createURI("http://evil.com"),
- suggestedFileName: "noop.bat",
- fileSize: 12}, true);
-});
-
-add_task(function* test_non_binary()
-{
- // We should not reach the remote server for a verdict for non-binary files.
- Services.prefs.setBoolPref(remoteEnabledPref,
- true);
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/throw");
- yield promiseQueryReputation({sourceURI: createURI("http://evil.com"),
- suggestedFileName: "noop.txt",
- fileSize: 12}, false);
-});
-
-add_task(function* test_good_binary()
-{
- // We should reach the remote server for a verdict.
- Services.prefs.setBoolPref(remoteEnabledPref,
- true);
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- // mozilla.com should return a not-guilty verdict from the remote server.
- yield promiseQueryReputation({sourceURI: createURI("http://mozilla.com"),
- suggestedFileName: "noop.bat",
- fileSize: 12}, false);
-});
-
-add_task(function* test_disabled()
-{
- // Explicitly disable remote checks
- Services.prefs.setBoolPref(remoteEnabledPref,
- false);
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/throw");
- let query = {sourceURI: createURI("http://example.com"),
- suggestedFileName: "noop.bat",
- fileSize: 12};
- let deferred = Promise.defer();
- gAppRep.queryReputation(query,
- function onComplete(aShouldBlock, aStatus) {
- // We should be getting NS_ERROR_NOT_AVAILABLE if the service is disabled
- do_check_eq(Cr.NS_ERROR_NOT_AVAILABLE, aStatus);
- do_check_false(aShouldBlock);
- deferred.resolve(true);
- }
- );
- yield deferred.promise;
-});
-
-add_task(function* test_disabled_through_lists()
-{
- Services.prefs.setBoolPref(remoteEnabledPref,
- false);
- Services.prefs.setCharPref(appRepURLPref,
- "http://localhost:4444/download");
- Services.prefs.setCharPref("urlclassifier.downloadBlockTable", "");
- let query = {sourceURI: createURI("http://example.com"),
- suggestedFileName: "noop.bat",
- fileSize: 12};
- let deferred = Promise.defer();
- gAppRep.queryReputation(query,
- function onComplete(aShouldBlock, aStatus) {
- // We should be getting NS_ERROR_NOT_AVAILABLE if the service is disabled
- do_check_eq(Cr.NS_ERROR_NOT_AVAILABLE, aStatus);
- do_check_false(aShouldBlock);
- deferred.resolve(true);
- }
- );
- yield deferred.promise;
-});
-add_task(function* test_teardown()
-{
- gStillRunning = false;
-});
diff --git a/toolkit/components/downloads/test/unit/xpcshell.ini b/toolkit/components/downloads/test/unit/xpcshell.ini
deleted file mode 100644
index 68b6e1fc3..000000000
--- a/toolkit/components/downloads/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,14 +0,0 @@
-[DEFAULT]
-head = head_download_manager.js
-tail = tail_download_manager.js
-skip-if = toolkit == 'android'
-support-files =
- data/digest.chunk
- data/block_digest.chunk
- data/signed_win.exe
-
-[test_app_rep.js]
-[test_app_rep_windows.js]
-skip-if = os != "win"
-[test_app_rep_maclinux.js]
-skip-if = os == "win"
diff --git a/toolkit/components/exthelper/moz.build b/toolkit/components/exthelper/moz.build
index 975030a35..d7429e2d5 100644
--- a/toolkit/components/exthelper/moz.build
+++ b/toolkit/components/exthelper/moz.build
@@ -4,9 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPIDL_SOURCES += [
- 'extIApplication.idl',
-]
+XPIDL_SOURCES += ['extIApplication.idl']
XPIDL_MODULE = 'exthelper'
diff --git a/toolkit/components/feeds/moz.build b/toolkit/components/feeds/moz.build
index de5e0aa96..fdc4e2708 100644
--- a/toolkit/components/feeds/moz.build
+++ b/toolkit/components/feeds/moz.build
@@ -4,8 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
-
XPIDL_SOURCES += [
'nsIFeed.idl',
'nsIFeedContainer.idl',
@@ -25,7 +23,3 @@ EXTRA_COMPONENTS += [
'FeedProcessor.js',
'FeedProcessor.manifest',
]
-
-XPCSHELL_TESTS_MANIFESTS += [
- 'test/xpcshell.ini'
-]
diff --git a/toolkit/components/feeds/test/.eslintrc.js b/toolkit/components/feeds/test/.eslintrc.js
deleted file mode 100644
index 89764b551..000000000
--- a/toolkit/components/feeds/test/.eslintrc.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/chrome.eslintrc.js",
- "../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/feeds/test/chrome.ini b/toolkit/components/feeds/test/chrome.ini
deleted file mode 100644
index 6745fa9a5..000000000
--- a/toolkit/components/feeds/test/chrome.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[DEFAULT]
-
-[test_bug675492.xul]
diff --git a/toolkit/components/feeds/test/head.js b/toolkit/components/feeds/test/head.js
deleted file mode 100644
index 65aa64b94..000000000
--- a/toolkit/components/feeds/test/head.js
+++ /dev/null
@@ -1,80 +0,0 @@
-"use strict";
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-function readTestData(testFile) {
- var testcase = {};
-
- // Got a feed file, now we need to parse out the Description and Expect headers.
- var istream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream);
- try {
- istream.init(testFile, 0x01, parseInt("0444", 8), 0);
- istream.QueryInterface(Ci.nsILineInputStream);
-
- var hasmore = false;
- do {
- var line = {};
- hasmore = istream.readLine(line);
-
- if (line.value.indexOf('Description:') > -1) {
- testcase.desc = line.value.substring(line.value.indexOf(':')+1).trim();
- }
-
- if (line.value.indexOf('Expect:') > -1) {
- testcase.expect = line.value.substring(line.value.indexOf(':')+1).trim();
- }
-
- if (line.value.indexOf('Base:') > -1) {
- testcase.base = NetUtil.newURI(line.value.substring(line.value.indexOf(':')+1).trim());
- }
-
- if (testcase.expect && testcase.desc) {
- testcase.path = 'xml/' + testFile.parent.leafName + '/' + testFile.leafName;
- testcase.file = testFile;
- break;
- }
-
- } while (hasmore);
-
- } catch (e) {
- Assert.ok(false, "FAILED! Error reading testFile case in file " + testFile.leafName + " ---- " + e);
- } finally {
- istream.close();
- }
-
- return testcase;
-}
-
-function iterateDir(dir, recurse, callback) {
- do_print("Iterate " + dir.leafName);
- let entries = dir.directoryEntries;
-
- // Loop over everything in this dir. If its a dir
- while (entries.hasMoreElements()) {
- let entry = entries.getNext();
- entry.QueryInterface(Ci.nsILocalFile);
-
- if (entry.isDirectory()) {
- if (recurse) {
- iterateDir(entry, recurse, callback);
- }
- } else {
- callback(entry);
- }
- }
-}
-
-function isIID(a, iid) {
- try {
- a.QueryInterface(iid);
- return true;
- } catch (e) { }
-
- return false;
-}
diff --git a/toolkit/components/feeds/test/test_bug675492.xul b/toolkit/components/feeds/test/test_bug675492.xul
deleted file mode 100644
index b1c52d11a..000000000
--- a/toolkit/components/feeds/test/test_bug675492.xul
+++ /dev/null
@@ -1,31 +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"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=675492
--->
-<window title="Mozilla Bug 675492"
- 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="application/javascript" src="chrome://mochikit/content/chrome-harness.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=675492"
- target="_blank">Mozilla Bug 675492</a>
- </body>
-
- <!-- test code goes here -->
- <script type="application/javascript">
- <![CDATA[
-
- /** Test for Bug 675492 **/
-
- Components
- .classes["@mozilla.org/parserutils;1"]
- .getService(Components.interfaces.nsIParserUtils)
- .parseFragment("<p>test</p>", 0, false, null, document.createElementNS("http://www.w3.org/1999/xhtml", "body"));
- ok(true, "No crash!");
- ]]>
- </script>
-</window>
diff --git a/toolkit/components/feeds/test/test_xml.js b/toolkit/components/feeds/test/test_xml.js
deleted file mode 100644
index 5bc0d759d..000000000
--- a/toolkit/components/feeds/test/test_xml.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* test_xml.js
- * This file sets up the unit test environment by building an array of files
- * to be tested. It assumes it lives in a folder adjacent to the a folder
- * called 'xml', where the testcases live.
- *
- * The directory layout looks something like this:
- *
- * tests/test_xml.js*
- * |
- * - head.js
- * |
- * - xml/ -- rss1/...
- * |
- * -- rss2/...
- * |
- * -- atom/testcase.xml
- *
- * To add more tests, just include the file in the xml subfolder and add its name to xpcshell.ini
- */
-
-"use strict";
-
-// Listens to feeds being loaded. Runs the tests built into the feed afterwards to veryify they
-// were parsed correctly.
-function FeedListener(testcase) {
- this.testcase = testcase;
-}
-
-FeedListener.prototype = {
- handleResult: function(result) {
- var feed = result.doc;
- try {
- do_print("Testing feed " + this.testcase.file.path);
- Assert.ok(isIID(feed, Ci.nsIFeed), "Has feed interface");
-
- if (!eval(this.testcase.expect)) {
- Assert.ok(false, "expect failed for " + this.testcase.desc);
- } else {
- Assert.ok(true, "expect passed for " + this.testcase.desc);
- }
- } catch (e) {
- Assert.ok(false, "expect failed for " + this.testcase.desc + " ---- " + e.message);
- }
-
- run_next_test();
- }
-}
-
-function createTest(data) {
- return function() {
- var uri;
-
- if (data.base == null) {
- uri = NetUtil.newURI('http://example.org/' + data.path);
- } else {
- uri = data.base;
- }
-
- do_print("Testing " + data.file.leafName);
-
- var parser = Cc["@mozilla.org/feed-processor;1"].createInstance(Ci.nsIFeedProcessor);
- var stream = Cc["@mozilla.org/network/file-input-stream;1"].createInstance(Ci.nsIFileInputStream);
- stream.init(data.file, 0x01, parseInt("0444", 8), 0);
- parser.listener = new FeedListener(data);
-
- try {
- parser.parseFromStream(stream, uri);
- } catch (e) {
- Assert.ok(false, "parse failed for " + data.file.leafName + " ---- " + e.message);
- // If the parser failed, the listener won't be notified, run the next test here.
- run_next_test();
- } finally {
- stream.close();
- }
- }
-}
-
-function run_test() {
- // Get the 'xml' directory in here
- var topDir = Services.dirsvc.get("CurWorkD", Ci.nsIFile);
- topDir.append("xml");
-
- // Every file in the test dir contains an encapulated RSS "test". Iterate through
- // them all and add them to the test runner.
- iterateDir(topDir, true, file => {
- var data = readTestData(file);
- add_test(createTest(data));
- });
-
- // Now run!
- run_next_test();
-}
diff --git a/toolkit/components/feeds/test/xml/rfc4287/author_namespaces.xml b/toolkit/components/feeds/test/xml/rfc4287/author_namespaces.xml
deleted file mode 100644
index 3b2ad74ff..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/author_namespaces.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-Description: Ensure unknown NS element in atom:author doesn't cause exception
-Expect: var mCService = Components.classes['@mozilla.org/consoleservice;1'].getService(Components.interfaces.nsIConsoleService); var msg = mCService.getMessageArray()[0]; if(msg){msg = msg.message}; ((msg + "").indexOf("prefix has no properties") == -1);
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-
- <author>
- <name>Sam Ruby</name>
- <method xmlns="http://www.intertwingly.net/blog/">excerpt</method>
- <email>rubys@intertwingly.net</email>
- <uri>.</uri>
- </author>
-
-</feed>
-
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_author.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_author.xml
deleted file mode 100644
index 2757148c4..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_author.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom author name works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).authors.queryElementAt(0, Components.interfaces.nsIFeedPerson).name=='John Doe Entry';
-
--->
-
-<feed xmlns="http://www.w3.org/2005/Atom">
-
- <title>Example Feed</title>
- <link href="http://example.org/"/>
- <updated>2003-12-13T18:30:02Z</updated>
- <author>
- <name>John Doe</name>
- </author>
- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
-
- <entry>
- <title>Atom-Powered Robots Run Amok</title>
- <link href="http://example.org/2003/12/13/atom03"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- <updated>2003-12-13T18:30:02Z</updated>
- <summary>Some text.</summary>
- <author>
- <name>John Doe Entry</name>
- </author>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_content.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_content.xml
deleted file mode 100644
index 6bb9b210f..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_content.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry summary works
-Expect: feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).content.plainText() == "test content";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://www.example.org"
- foo:quux="quuux">
-
- <title>hmm</title>
-
- <author>
- <email>hmm@example.com</email>
- <name>foo</name>
- </author>
- <generator version="1.1" uri="http://example.org">Hmm</generator>
- <author>
- <email>bar@example.com</email>
- <name>foo</name>
- </author>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
-
-
- <entry></entry>
-
- <entry foo:bar="baz">
- <title>test</title>
- <content>test content</content>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_content_encoded.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_content_encoded.xml
deleted file mode 100644
index df09317f7..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_content_encoded.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry content:encoded and xhtml works
-Expect: var content = feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).content.plainText(); content == "should appear";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://www.example.org"
- foo:quux="quuux"
- xmlns:content="http://purl.org/rss/1.0/modules/content/">
-
- <title>hmm</title>
-
- <author>
- <email>hmm@example.com</email>
- <name>foo</name>
- </author>
- <generator version="1.1" uri="http://example.org">Hmm</generator>
- <author>
- <email>bar@example.com</email>
- <name>foo</name>
- </author>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
-
-
- <entry></entry>
-
- <entry foo:bar="baz">
- <title>test</title>
- <summary type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <b>test</b> content
- </div>
- </summary>
- <content:encoded>
- should appear
- </content:encoded>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_content_html.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_content_html.xml
deleted file mode 100644
index 08974c35f..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_content_html.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry content html works
-Expect: var content = feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).content.plainText(); content == "test content";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://www.example.org"
- foo:quux="quuux">
-
- <title>hmm</title>
-
- <author>
- <email>hmm@example.com</email>
- <name>foo</name>
- </author>
- <generator version="1.1" uri="http://example.org">Hmm</generator>
- <author>
- <email>bar@example.com</email>
- <name>foo</name>
- </author>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
-
-
- <entry></entry>
-
- <entry foo:bar="baz">
- <title>test</title>
- <content type="html">&lt;b>test&lt;/b> content</content>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_content_xhtml.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_content_xhtml.xml
deleted file mode 100644
index dea4902bb..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_content_xhtml.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry content xhtml works
-Expect: feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).content.plainText() == "test content";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://www.example.org"
- foo:quux="quuux">
-
- <title>hmm</title>
-
- <author>
- <email>hmm@example.com</email>
- <name>foo</name>
- </author>
- <generator version="1.1" uri="http://example.org">Hmm</generator>
- <author>
- <email>bar@example.com</email>
- <name>foo</name>
- </author>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
-
-
- <entry></entry>
-
- <entry foo:bar="baz">
- <title>test</title>
- <content type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <b>test</b> content
- </div>
- </content>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_content_xhtml_with_markup.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_content_xhtml_with_markup.xml
deleted file mode 100644
index 8cadef75e..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_content_xhtml_with_markup.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry content xhtml works
-Expect: var content = feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).content.text; content == "<b>test</b> content";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://www.example.org"
- foo:quux="quuux">
-
- <title>hmm</title>
-
- <author>
- <email>hmm@example.com</email>
- <name>foo</name>
- </author>
- <generator version="1.1" uri="http://example.org">Hmm</generator>
- <author>
- <email>bar@example.com</email>
- <name>foo</name>
- </author>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
-
-
- <entry></entry>
-
- <entry foo:bar="baz">
- <title>test</title>
- <content type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <b>test</b> content
- </div>
- </content>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_contributor.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_contributor.xml
deleted file mode 100644
index bb85bf230..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_contributor.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom author name works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).contributors.queryElementAt(0, Components.interfaces.nsIFeedPerson).name=='John Doe Entry';
-
--->
-
-<feed xmlns="http://www.w3.org/2005/Atom">
-
- <title>Example Feed</title>
- <link href="http://example.org/"/>
- <updated>2003-12-13T18:30:02Z</updated>
- <author>
- <name>John Doe</name>
- </author>
- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
-
- <entry>
- <title>Atom-Powered Robots Run Amok</title>
- <link href="http://example.org/2003/12/13/atom03"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- <updated>2003-12-13T18:30:02Z</updated>
- <summary>Some text.</summary>
- <contributor>
- <name>John Doe Entry</name>
- </contributor>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_html_cdata.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_html_cdata.xml
deleted file mode 100644
index 38a31ca10..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_html_cdata.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: HTML title w/ CDATA
-Expect: var title = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).title.plainText(); title == "<title>";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-<id>http://atomtests.philringnalda.com/tests/item/title/html-cdata.atom</id>
-<title>Atom item title html cdata</title>
-<updated>2005-12-18T00:13:00Z</updated>
-<author>
- <name>Phil Ringnalda</name>
- <uri>http://weblog.philringnalda.com/</uri>
-</author>
-<link rel="self" href="http://atomtests.philringnalda.com/tests/item/title/html-cdata.atom"/>
-<entry>
- <id>http://atomtests.philringnalda.com/tests/item/title/html-cdata.atom/1</id>
- <title type="html"><![CDATA[&lt;title>]]></title>
- <updated>2005-12-18T00:13:00Z</updated>
- <summary>An item with a type="html" title consisting of a less-than
-character, the word 'title' and a greater-than character, where
-the character entity reference for the less-than is escaped by being
-in a CDATA section.</summary>
- <link href="http://atomtests.philringnalda.com/alt/title-title.html"/>
- <category term="item title"/>
-</entry>
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_id.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_id.xml
deleted file mode 100644
index 8513b6894..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_id.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry id
-Expect: feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).id == "http://foo.example.com/hmm/ok,2006,07,11";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://www.example.org"
- foo:quux="quuux">
-
- <title>hmm</title>
-
- <author>
- <email>hmm@example.com</email>
- <name>foo</name>
- </author>
- <generator version="1.1" uri="http://example.org">Hmm</generator>
- <author>
- <email>bar@example.com</email>
- <name>foo</name>
- </author>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
-
-
- <entry></entry>
-
- <entry foo:bar="baz">
- <title>test</title>
- <id>http://foo.example.com/hmm/ok,2006,07,11</id>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_link_2alts.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_link_2alts.xml
deleted file mode 100644
index c7cebe4cd..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_link_2alts.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry with random link relations
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == "http://www.snellspace.com/public/linktests/alternate";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/</id>
- <title>Atom Link Tests</title>
- <updated>2005-01-18T15:10:00Z</updated>
- <author><name>James Snell</name></author>
- <link href="http://www.intertwingly.net/wiki/pie/LinkConformanceTests" />
- <link rel="self" href="http://www.snellspace.com/public/linktests.xml" />
-
- <entry>
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/2</id>
- <title>Two alternate links</title>
- <updated>2005-01-18T15:00:02Z</updated>
- <summary>The aggregator should pick either the second or third link below as the alternate</summary>
-
- <link rel="ALTERNATE" href="http://www.snellspace.com/public/linktests/wrong" />
- <link href="http://www.snellspace.com/public/linktests/alternate" />
- <link type="text/plain" href="http://www.snellspace.com/public/linktests/alternate2" />
- <link rel="ALTERNATE" href="http://www.snellspace.com/public/linktests/wrong" />
- </entry>
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_link_2alts_allcore.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_link_2alts_allcore.xml
deleted file mode 100644
index 56675b1a9..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_link_2alts_allcore.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry with random link relations
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == "http://www.snellspace.com/public/linktests/alternate";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/</id>
- <title>Atom Link Tests</title>
- <updated>2005-01-18T15:10:00Z</updated>
- <author><name>James Snell</name></author>
- <link href="http://www.intertwingly.net/wiki/pie/LinkConformanceTests" />
- <link rel="self" href="http://www.snellspace.com/public/linktests.xml" />
-
- <entry>
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/3</id>
- <title>One of each core link rel type</title>
-
- <updated>2005-01-18T15:00:03Z</updated>
- <summary>The aggregator should pick the first link as the alternate</summary>
- <link href="http://www.snellspace.com/public/linktests/alternate" />
- <link rel="enclosure" href="http://www.snellspace.com/public/linktests/enclosure" length="19" />
- <link rel="related" href="http://www.snellspace.com/public/linktests/related" />
- <link rel="self" href="http://www.snellspace.com/public/linktests/self" />
- <link rel="via" href="http://www.snellspace.com/public/linktests/via" />
- </entry>
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_link_2alts_allcore2.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_link_2alts_allcore2.xml
deleted file mode 100644
index b5b73cfe0..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_link_2alts_allcore2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry with random link relations
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == "http://www.snellspace.com/public/linktests/alternate";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/</id>
- <title>Atom Link Tests</title>
- <updated>2005-01-18T15:10:00Z</updated>
- <author><name>James Snell</name></author>
- <link href="http://www.intertwingly.net/wiki/pie/LinkConformanceTests" />
- <link rel="self" href="http://www.snellspace.com/public/linktests.xml" />
-
-
-
- <entry>
-
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/4</id>
- <title>One of each core link rel type + An additional alternate link</title>
- <updated>2005-01-18T15:00:04Z</updated>
- <summary>The aggregator should pick either the first or last links as the alternate. First link is likely better.</summary>
- <link href="http://www.snellspace.com/public/linktests/alternate" />
- <link rel="enclosure" href="http://www.snellspace.com/public/linktests/enclosure" length="19" />
- <link rel="related" href="http://www.snellspace.com/public/linktests/related" />
-
- <link rel="self" href="http://www.snellspace.com/public/linktests/self" />
- <link rel="via" href="http://www.snellspace.com/public/linktests/via" />
- <link rel="alternate" type="text/plain" href="http://www.snellspace.com/public/linktests/alternate2" />
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_link_IANA.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_link_IANA.xml
deleted file mode 100644
index af6563f2e..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_link_IANA.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry with IANA URI link relations
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == "http://www.snellspace.com/public/alternate";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/</id>
- <title>Atom Link Tests</title>
- <updated>2005-01-18T15:10:00Z</updated>
- <author><name>James Snell</name></author>
- <link href="http://www.intertwingly.net/wiki/pie/LinkConformanceTests" />
- <link rel="self" href="http://www.snellspace.com/public/linktests.xml" />
-
- <entry>
- <id>tag:example.org,2006:/linkreltest/1</id>
- <title>Does your reader support http://www.iana.org/assignments/relation/alternate properly? </title>
- <updated>2006-04-25T12:12:12Z</updated>
- <link rel="http://example.org/random"
- href="http://www.snellspace.com/public/random" />
- <link rel="http://www.iana.org/assignments/relation/alternate"
- href="http://www.snellspace.com/public/alternate" />
- <link rel="http://example.org/random"
- href="http://www.snellspace.com/public/random" />
- <content>This entry uses link/@rel="http://www.iana.org/assignments/relation/alternate".</content>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_link_alt_extension.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_link_alt_extension.xml
deleted file mode 100644
index e37421864..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_link_alt_extension.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry with random link relations
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == "http://www.snellspace.com/public/linktests/alternate";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/</id>
- <title>Atom Link Tests</title>
- <updated>2005-01-18T15:10:00Z</updated>
- <author><name>James Snell</name></author>
- <link href="http://www.intertwingly.net/wiki/pie/LinkConformanceTests" />
- <link rel="self" href="http://www.snellspace.com/public/linktests.xml" />
- <entry>
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/5</id>
- <title>Entry with a link relation registered by an extension</title>
- <updated>2005-01-18T15:00:05Z</updated>
- <summary>The aggregator should ignore the license link without throwing any errors. The first link should be picked as the alternate.</summary>
- <link href="http://www.snellspace.com/public/linktests/alternate" />
- <link rel="payment" href="http://www.example.org/payment" />
- </entry>
-
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_link_enclosure.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_link_enclosure.xml
deleted file mode 100644
index b76c111c9..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_link_enclosure.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item enclosure works
-Expect: var links = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('links'); links.QueryInterface(Components.interfaces.nsIArray); var link = links.queryElementAt(0, Components.interfaces.nsIPropertyBag2); ((link.getProperty('length') == '24986239') && (link.getProperty('type') == 'audio/mpeg') && (link.getProperty('href') == 'http://dallas.example.com/joebob_050689.mp3') && (feed.type == 1) && (feed.enclosureCount == 1));
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/</id>
- <title>Atom Link Tests</title>
- <updated>2005-01-18T15:10:00Z</updated>
- <author><name>James Snell</name></author>
- <link href="http://www.intertwingly.net/wiki/pie/LinkConformanceTests" />
- <link rel="self" href="http://www.snellspace.com/public/linktests.xml" />
-
-
-
- <entry>
-
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/4</id>
- <title>One of each core link rel type + An additional alternate link</title>
- <updated>2005-01-18T15:00:04Z</updated>
- <summary>The aggregator should pick either the first or last links as the alternate. First link is likely better.</summary>
- <link rel="enclosure" length="24986239" type="audio/mpeg" href="http://dallas.example.com/joebob_050689.mp3" />
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_link_enclosure_populate_enclosures.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_link_enclosure_populate_enclosures.xml
deleted file mode 100644
index 8453c6e9c..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_link_enclosure_populate_enclosures.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item enclosure added to enclosures
-Expect: var encs = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).enclosures; encs.QueryInterface(Components.interfaces.nsIArray); var enc = encs.queryElementAt(0, Components.interfaces.nsIPropertyBag2); ((enc.getProperty('length') == '24986239') && (enc.getProperty('type') == 'audio/mpeg') && (enc.getProperty('url') == 'http://dallas.example.com/joebob_050689.mp3'));
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/</id>
- <title>Atom Link Tests</title>
- <updated>2005-01-18T15:10:00Z</updated>
- <author><name>James Snell</name></author>
- <link href="http://www.intertwingly.net/wiki/pie/LinkConformanceTests" />
- <link rel="self" href="http://www.snellspace.com/public/linktests.xml" />
-
-
-
- <entry>
-
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/4</id>
- <title>One of each core link rel type + An additional alternate link</title>
- <updated>2005-01-18T15:00:04Z</updated>
- <summary>The aggregator should pick either the first or last links as the alternate. First link is likely better.</summary>
- <link rel="enclosure" length="24986239" type="audio/mpeg" href="http://dallas.example.com/joebob_050689.mp3" />
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_link_otherURI_alt.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_link_otherURI_alt.xml
deleted file mode 100644
index 3dc0c8dd6..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_link_otherURI_alt.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry with random link relations
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == "http://www.snellspace.com/public/linktests/alternate";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/</id>
- <title>Atom Link Tests</title>
- <updated>2005-01-18T15:10:00Z</updated>
- <author><name>James Snell</name></author>
- <link href="http://www.intertwingly.net/wiki/pie/LinkConformanceTests" />
- <link rel="self" href="http://www.snellspace.com/public/linktests.xml" />
-
- <entry>
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/6</id>
- <title>Entry with a link relation identified by URI</title>
- <updated>2005-01-18T15:00:06Z</updated>
- <summary>The aggregator should ignore the second link without throwing any errors. The first link should be picked as the alternate.</summary>
- <link href="http://www.snellspace.com/public/linktests/alternate" />
- <link rel="http://example.org" href="http://www.snellspace.com/public/linktests/example" />
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_link_payment_alt.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_link_payment_alt.xml
deleted file mode 100644
index 51e1524b4..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_link_payment_alt.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry with random link relations
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == "http://www.snellspace.com/public/linktests/alternate";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/</id>
- <title>Atom Link Tests</title>
- <updated>2005-01-18T15:10:00Z</updated>
- <author><name>James Snell</name></author>
- <link href="http://www.intertwingly.net/wiki/pie/LinkConformanceTests" />
- <link rel="self" href="http://www.snellspace.com/public/linktests.xml" />
-
-
- <entry>
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/5</id>
- <title>Entry with a link relation registered by an extension</title>
- <updated>2005-01-18T15:00:05Z</updated>
- <summary>The aggregator should ignore the license link without throwing any errors. The first link should be picked as the alternate.</summary>
- <link href="http://www.snellspace.com/public/linktests/alternate" />
- <link rel="payment" href="http://www.example.org/payment" />
- </entry>
-
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_link_random.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_link_random.xml
deleted file mode 100644
index cb370e516..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_link_random.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry with random link relations
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == "http://www.snellspace.com/public/linktests/alternate";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/</id>
- <title>Atom Link Tests</title>
- <updated>2005-01-18T15:10:00Z</updated>
- <author><name>James Snell</name></author>
- <link href="http://www.intertwingly.net/wiki/pie/LinkConformanceTests" />
- <link rel="self" href="http://www.snellspace.com/public/linktests.xml" />
-
- <entry>
- <id>tag:snellspace.com,2006:/atom/conformance/linktest/1</id>
- <title>Just a single Alternate Link</title>
- <updated>2005-01-18T15:00:01Z</updated>
- <summary>The aggregator should pick the second link as the alternate</summary>
- <link rel="http://example.org/random"
- href="http://www.snellspace.com/public/wrong" />
- <link href="http://www.snellspace.com/public/linktests/alternate" />
- <link rel="http://example.org/random"
- href="http://www.snellspace.com/public/wrong" />
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_published.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_published.xml
deleted file mode 100644
index 1112729e2..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_published.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom published works
-Expect: var entry = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry); entry.published == 'Tue, 09 Dec 2003 18:30:02 GMT'
-
--->
-
-<feed xmlns="http://www.w3.org/2005/Atom">
-
- <title>Example Feed</title>
- <link href="http://example.org/"/>
- <updated>2003-12-13T18:30:02Z</updated>
- <author>
- <name>John Doe</name>
- </author>
- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
-
- <entry>
- <title>Atom-Powered Robots Run Amok</title>
- <link href="http://example.org/2003/12/13/atom03"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- <updated>2003-12-13T18:30:02Z</updated>
- <published>2003-12-09T18:30:02Z</published>
- <summary>Some text.</summary>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_rights_normalized.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_rights_normalized.xml
deleted file mode 100644
index 1474e5f84..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_rights_normalized.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry rights works normalized
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).rights.plainText() == "test rights"
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <title type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> title</div>
- </title>
- <entry>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> rights</div>
- </rights>
- </entry>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_summary.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_summary.xml
deleted file mode 100644
index b245cb380..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_summary.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry summary xhtml works
-Expect: feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).summary.plainText() == "test summary";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://www.example.org"
- foo:quux="quuux"
- xmlns:content="http://purl.org/rss/1.0/modules/content/">
-
- <title>hmm</title>
-
- <author>
- <email>hmm@example.com</email>
- <name>foo</name>
- </author>
- <generator version="1.1" uri="http://example.org">Hmm</generator>
- <author>
- <email>bar@example.com</email>
- <name>foo</name>
- </author>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
-
-
- <entry></entry>
-
- <entry foo:bar="baz">
- <title>test</title>
- <summary type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <b>test</b> summary
- </div>
- </summary>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_title.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_title.xml
deleted file mode 100644
index c118e7472..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_title.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom feed and entry with random attributes works
-Expect: feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).title.text == "test";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://www.example.org"
- foo:quux="quuux">
-
- <title>hmm</title>
-
- <author>
- <email>hmm@example.com</email>
- <name>foo</name>
- </author>
- <generator version="1.1" uri="http://example.org">Hmm</generator>
- <author>
- <email>bar@example.com</email>
- <name>foo</name>
- </author>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
-
-
- <entry></entry>
-
- <entry foo:bar="baz">
- <title>test</title>
-
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_title_normalized.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_title_normalized.xml
deleted file mode 100644
index 19e2ac1a6..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_title_normalized.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry title normalized
-Expect: feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).title.text == "test";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://www.example.org"
- foo:quux="quuux">
-
- <title>hmm</title>
-
- <author>
- <email>hmm@example.com</email>
- <name>foo</name>
- </author>
- <generator version="1.1" uri="http://example.org">Hmm</generator>
- <author>
- <email>bar@example.com</email>
- <name>foo</name>
- </author>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
-
-
- <entry></entry>
-
- <entry foo:bar="baz">
- <title>test</title>
-
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_updated.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_updated.xml
deleted file mode 100644
index 4aed7e9c7..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_updated.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom updated works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).updated == 'Sat, 13 Dec 2003 18:30:02 GMT'
-
--->
-
-<feed xmlns="http://www.w3.org/2005/Atom">
-
- <title>Example Feed</title>
- <link href="http://example.org/"/>
- <updated>2003-12-13T18:30:02Z</updated>
- <author>
- <name>John Doe</name>
- </author>
- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
-
- <entry>
- <title>Atom-Powered Robots Run Amok</title>
- <link href="http://example.org/2003/12/13/atom03"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- <updated>2003-12-13T18:30:02Z</updated>
- <summary>Some text.</summary>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_w_content_encoded.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_w_content_encoded.xml
deleted file mode 100644
index 58f94c6c1..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_w_content_encoded.xml
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry content:encoded and xhtml works
-Expect: var content = feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).content.text; content == "<b>test</b> content";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://www.example.org"
- foo:quux="quuux"
- xmlns:content="http://purl.org/rss/1.0/modules/content/">
-
- <title>hmm</title>
-
- <author>
- <email>hmm@example.com</email>
- <name>foo</name>
- </author>
- <generator version="1.1" uri="http://example.org">Hmm</generator>
- <author>
- <email>bar@example.com</email>
- <name>foo</name>
- </author>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
-
-
- <entry></entry>
-
- <entry foo:bar="baz">
- <title>test</title>
- <content type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <b>test</b> content
- </div>
- </content>
- <content:encoded>
- shouldn't appear
- </content:encoded>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_xhtml_baseURI_with_amp.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_xhtml_baseURI_with_amp.xml
deleted file mode 100644
index 20819cecd..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_xhtml_baseURI_with_amp.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry content xhtml works with a base URI that contains an ampersand.
-Base: http://www.travellerspoint.com/photo_gallery_feed.cfm?tags=Canada&onlyShowFeatured=true
-Expect: var frag = null; var content = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).content; var parser = Components.classes["@mozilla.org/xmlextras/domparser;1"].createInstance(Components.interfaces.nsIDOMParser); var doc = parser.parseFromString("<div/>", "text/xml"); frag = content.createDocumentFragment(doc.documentElement); notEqual(frag, null, "frag is not null"); true;
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://www.example.org"
- foo:quux="quuux">
-
- <title>hmm</title>
-
- <author>
- <email>hmm@example.com</email>
- <name>foo</name>
- </author>
- <generator version="1.1" uri="http://example.org">Hmm</generator>
- <author>
- <email>bar@example.com</email>
- <name>foo</name>
- </author>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
-
- <entry foo:bar="baz">
- <title>test</title>
- <content type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <b>test</b> content
- </div>
- </content>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_xmlBase.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_xmlBase.xml
deleted file mode 100644
index 1656e2174..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_xmlBase.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry with xml:base
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == "http://www.example.org/foo";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <id>tag:example.com,2006:/atom/conformance/linktest/</id>
- <title>Atom Link Tests</title>
- <updated>2005-06-18T6:23:00Z</updated>
- <link href="http://www.example.org" />
-
- <entry xml:base="http://www.example.org">
- <id>tag:example.org,2006:/linkreltest/1</id>
- <title>Does your reader support xml:base properly? </title>
- <updated>2006-06-23T12:12:12Z</updated>
- <link href="foo"/>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/entry_xmlBase_on_link.xml b/toolkit/components/feeds/test/xml/rfc4287/entry_xmlBase_on_link.xml
deleted file mode 100644
index 0ead14255..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/entry_xmlBase_on_link.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry with xml:base
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == "http://www.example.org/bar/foo";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-
- <id>tag:example.com,2006:/atom/conformance/linktest/</id>
- <title>Atom Link Tests</title>
- <updated>2005-06-18T16:13:00Z</updated>
- <link href="http://www.example.org" />
-
- <entry xml:base="http://www.example.org">
- <id>tag:example.org,2006:/linkreltest/1</id>
- <title>Does your reader support xml:base properly? </title>
- <updated>2006-06-23T12:12:12Z</updated>
- <link xml:base="/bar/" href="foo"/>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_atom_rights_xhtml.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_atom_rights_xhtml.xml
deleted file mode 100644
index 83add3265..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_atom_rights_xhtml.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom rights works with HTML
-Expect: feed.fields.getProperty('atom:rights') != null
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <title type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> title</div>
- </title>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
- <summary type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><div><div>test</div> summary</div></div>
- </summary>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_author.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_author.xml
deleted file mode 100644
index 790027ee3..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_author.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom author count works
-Expect: feed.authors.length == 1;
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-<title>test title</title>
-<author>
-</author>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_author2.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_author2.xml
deleted file mode 100644
index eae8292fa..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_author2.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom author count works
-Expect: feed.authors.length == 2
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-<title>test title</title>
-<author>
-</author>
-<author>
-</author>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_author_email.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_author_email.xml
deleted file mode 100644
index 95abdbc8e..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_author_email.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom author name works
-Expect: feed.authors.queryElementAt(0, Components.interfaces.nsIFeedPerson).email=='hmm@example.com';
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-<title>test title</title>
-<author>
-<email>hmm@example.com</email>
-<name>foo</name>
-</author>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_author_email_2.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_author_email_2.xml
deleted file mode 100644
index 71cace773..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_author_email_2.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom author name works
-Expect: feed.authors.queryElementAt(1, Components.interfaces.nsIFeedPerson).email=='bar@example.com';
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-<title>test title</title>
-<author>
-<email>hmm@example.com</email>
-<name>foo</name>
-</author>
-<author>
-<email>bar@example.com</email>
-<name>foo</name>
-</author>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_author_name.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_author_name.xml
deleted file mode 100644
index 2df46f8d5..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_author_name.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom author name works
-Expect: feed.authors.queryElementAt(0, Components.interfaces.nsIFeedPerson).name=='foo';
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-<title>test title</title>
-<author>
-<name>foo</name>
-</author>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_author_surrounded.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_author_surrounded.xml
deleted file mode 100644
index b15278f91..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_author_surrounded.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom author name works
-Expect: feed.authors.queryElementAt(0, Components.interfaces.nsIFeedPerson).name=='John Doe';
-
--->
-
-<feed xmlns="http://www.w3.org/2005/Atom">
-
- <title>Example Feed</title>
- <link href="http://example.org/"/>
- <updated>2003-12-13T18:30:02Z</updated>
- <author>
- <name>John Doe</name>
- </author>
- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
-
- <entry>
- <title>Atom-Powered Robots Run Amok</title>
- <link href="http://example.org/2003/12/13/atom03"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- <updated>2003-12-13T18:30:02Z</updated>
- <summary>Some text.</summary>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_author_uri.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_author_uri.xml
deleted file mode 100644
index 44149036c..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_author_uri.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom author uri works
-Expect: feed.authors.queryElementAt(1, Components.interfaces.nsIFeedPerson).uri.spec =='http://example.com/';
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-<title>test title</title>
-<author>
-<email>hmm@example.com</email>
-<name>foo</name>
-<uri>http://example.org</uri>
-</author>
-<author>
-<email>bar@example.com</email>
-<name>foo</name>
-<uri>http://example.com/</uri>
-</author>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_comment_rss_extra_att.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_comment_rss_extra_att.xml
deleted file mode 100644
index 795d3f6ad..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_comment_rss_extra_att.xml
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: wfw works with extra attribute
-Expect: feed.fields.getProperty('wfw:commentRss') == 'http://example.org'
-
--->
-
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://example.org"
- xmlns:bla="http://wellformedweb.org/CommentAPI/">
-
- <title>Example Feed</title>
- <link href="http://example.org/"/>
- <updated>2003-12-13T18:30:02Z</updated>
- <author>
- <name>John Doe</name>
- </author>
- <id foo:bar="baz">urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
- <bla:commentRss hmm="yeah">http://example.org</bla:commentRss>
- <entry>
- <title>Atom-Powered Robots Run Amok</title>
- <link href="http://example.org/2003/12/13/atom03"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- <updated>2003-12-13T18:30:02Z</updated>
- <summary>Some text.</summary>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_contributor.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_contributor.xml
deleted file mode 100644
index abb50c154..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_contributor.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom contributor uri works
-Expect: feed.contributors.queryElementAt(1, Components.interfaces.nsIFeedPerson).uri.spec=='http://example.com/';
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <title>test title</title>
- <contributor>
- <email>hmm@example.com</email>
- <name>foo</name>
- <uri>http://example.org</uri>
- </contributor>
- <contributor>
- <email>bar@example.com</email>
- <name>foo</name>
- <uri>http://example.com</uri>
- </contributor>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_entry_count.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_entry_count.xml
deleted file mode 100644
index 53028d3d1..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_entry_count.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom entry count works
-Expect: feed.items.length == 3
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <title>test title</title>
- <logo>http://example.org/logo.jpg</logo>
- <entry></entry>
- <entry></entry>
- <entry></entry>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_generator.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_generator.xml
deleted file mode 100644
index 5112775b9..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_generator.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom generator works
-Expect: feed.generator.agent == 'Hmm';
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-
-<author>
-<email>hmm@example.com</email>
-<name>foo</name>
-</author>
-
-
- <generator>Hmm</generator>
-
-<author>
-<email>bar@example.com</email>
-<name>foo</name>
-</author>
-
-
- <title type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> title</div>
- </title>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
- <summary type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><div><div>test</div> summary</div></div>
- </summary>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_generator_uri.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_generator_uri.xml
deleted file mode 100644
index a4b8c735c..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_generator_uri.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom generator works
-Expect: feed.generator.uri.spec == 'http://example.org/';
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-
-<author>
-<email>hmm@example.com</email>
-<name>foo</name>
-</author>
-
-
- <generator uri="http://example.org">Hmm</generator>
-
-<author>
-<email>bar@example.com</email>
-<name>foo</name>
-</author>
-
-
- <title type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> title</div>
- </title>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
- <summary type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><div><div>test</div> summary</div></div>
- </summary>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_generator_uri_xmlbase.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_generator_uri_xmlbase.xml
deleted file mode 100644
index 54191b50e..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_generator_uri_xmlbase.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom generator works
-Expect: feed.generator.uri.spec == 'http://example.org/gen/';
-
--->
-<feed xml:base="http://example.org/" xmlns="http://www.w3.org/2005/Atom">
-
-<author>
-<email>hmm@example.com</email>
-<name>foo</name>
-</author>
-
-
- <generator uri="/gen/">Hmm</generator>
-
-<author>
-<email>bar@example.com</email>
-<name>foo</name>
-</author>
-
-
- <title type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> title</div>
- </title>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
- <summary type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><div><div>test</div> summary</div></div>
- </summary>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_generator_version.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_generator_version.xml
deleted file mode 100644
index 845ce7504..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_generator_version.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom generator works
-Expect: feed.generator.version == "1.1"
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-
-<author>
-<email>hmm@example.com</email>
-<name>foo</name>
-</author>
-
-
- <generator version="1.1" uri="http://example.org">Hmm</generator>
-
-<author>
-<email>bar@example.com</email>
-<name>foo</name>
-</author>
-
-
- <title type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> title</div>
- </title>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
- <summary type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><div><div>test</div> summary</div></div>
- </summary>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_icon.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_icon.xml
deleted file mode 100644
index 017aafbad..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_icon.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom icon works
-Expect: feed.fields.getProperty('atom:icon') == 'http://example.org/favicon.ico'
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <title>test title</title>
- <icon>http://example.org/favicon.ico</icon>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_id.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_id.xml
deleted file mode 100644
index 6c538e801..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_id.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom author name works
-Expect: feed.fields.getProperty('atom:id') == 'urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6' && feed.id == 'urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6'
-
--->
-
-<feed xmlns="http://www.w3.org/2005/Atom">
-
- <title>Example Feed</title>
- <link href="http://example.org/"/>
- <updated>2003-12-13T18:30:02Z</updated>
- <author>
- <name>John Doe</name>
- </author>
- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
-
- <entry>
- <title>Atom-Powered Robots Run Amok</title>
- <link href="http://example.org/2003/12/13/atom03"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- <updated>2003-12-13T18:30:02Z</updated>
- <summary>Some text.</summary>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_id_extra_att.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_id_extra_att.xml
deleted file mode 100644
index ef718463b..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_id_extra_att.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom feed id works with extra attribute
-Expect: feed.fields.getProperty('atom:id') == 'urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6'
-
--->
-
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://example.org">
-
- <title>Example Feed</title>
- <link href="http://example.org/"/>
- <updated>2003-12-13T18:30:02Z</updated>
- <author>
- <name>John Doe</name>
- </author>
- <id foo:bar="baz">urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
-
- <entry>
- <title>Atom-Powered Robots Run Amok</title>
- <link href="http://example.org/2003/12/13/atom03"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- <updated>2003-12-13T18:30:02Z</updated>
- <summary>Some text.</summary>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_logo.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_logo.xml
deleted file mode 100644
index 2a90fe22b..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_logo.xml
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom logo works
-Expect: feed.image.getProperty('url') == 'http://example.org/logo.jpg'
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <title>test title</title>
- <logo xml:base="http://example.org/">logo.jpg</logo>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_random_attributes_on_feed_and_entry.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_random_attributes_on_feed_and_entry.xml
deleted file mode 100644
index a4c5633e2..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_random_attributes_on_feed_and_entry.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom feed and entry with random attributes works
-Expect: feed.title.text == "hmm" && feed.items.length == 2
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom"
- xmlns:foo="http://www.example.org"
- foo:quux="quuux">
-
- <title>hmm</title>
-
- <author>
- <email>hmm@example.com</email>
- <name>foo</name>
- </author>
- <generator version="1.1" uri="http://example.org">Hmm</generator>
- <author>
- <email>bar@example.com</email>
- <name>foo</name>
- </author>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><i>test</i> rights</div>
- </rights>
-
- <entry foo:bar="baz"></entry>
- <entry></entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_rights_normalized.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_rights_normalized.xml
deleted file mode 100644
index b7ef46047..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_rights_normalized.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom rights works normalized
-Expect: feed.rights.plainText() == "test rights"
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <title type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> title</div>
- </title>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> rights</div>
- </rights>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_rights_xhtml.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_rights_xhtml.xml
deleted file mode 100644
index 422c6fb49..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_rights_xhtml.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom rights works
-Expect: feed.fields.getProperty('atom:rights') != null
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <title type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> title</div>
- </title>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> rights</div>
- </rights>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_rights_xhtml_nested_divs.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_rights_xhtml_nested_divs.xml
deleted file mode 100644
index ebad24ac3..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_rights_xhtml_nested_divs.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom rights works with nested divs
-Expect: feed.fields.getProperty('atom:rights') != null
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <title type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> title</div>
- </title>
- <rights type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><div><div>test</div> rights</div></div>
- </rights>
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_subtitle.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_subtitle.xml
deleted file mode 100644
index 096061399..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_subtitle.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom subtitle works
-Expect: var sub = feed.subtitle.text; sub == '<b>test</b> subtitle';
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <subtitle type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> subtitle</div>
- </subtitle>
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_tantek_title.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_tantek_title.xml
deleted file mode 100644
index cba9a4918..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_tantek_title.xml
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-Description: XHTML title with apos
-Expect: feed.title.plainText() == "Tantek's Updates"
--->
-<feed xml:lang="en-US"
- xmlns="http://www.w3.org/2005/Atom">
- <title type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">Tantek's Updates</div>
- </title>
- <link href="http://tantek.com/"
- rel="alternate" title="Tantek's Posts" type="text/html"/>
- <link href="http://tantek.com/updates.atom"
- rel="self" />
- <id>http://tantek.com/updates.atom</id>
- <author>
- <name>Tantek</name>
- <uri>http://tantek.com/</uri>
- </author>
- <updated>2006-05-02T20:13:00-07:00</updated>
- <entry>
- <updated>2006-04-22T00:00:00-07:00</updated>
- <published>2006-04-22T00:00:00-07:00</published>
- <link href="http://www.makezine.com/faire/"
- rel="alternate" title="Make Faire" type="text/html"/>
- <id>http://www.makezine.com/faire/</id>
- <title>Make Faire</title>
- <content type="xhtml" xml:space="preserve">
- <div xmlns="http://www.w3.org/1999/xhtml">
- <div class="vevent">
- <a class="url" href="http://www.makezine.com/faire/">
- <abbr class="dtstart" title="20060422">
- 4/22</abbr>-<abbr class="dtend" title="20060424">23</abbr>
-
- <span class="summary">
- Make Faire
- </span> @
- <span class="location">
- San Mateo Fairgrounds
- </span>
- </a>
- </div>
- </div>
- </content>
- </entry>
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_title.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_title.xml
deleted file mode 100644
index 6e0cea003..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_title.xml
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom title works
-Expect: feed.title.text == 'test title'
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-<title>test title</title>
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_title_full_feed.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_title_full_feed.xml
deleted file mode 100644
index cef3f84a3..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_title_full_feed.xml
+++ /dev/null
@@ -1,936 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!--
-Description: Feed title works with full entry
-Expect: feed.title.text == 'ongoing'
--->
-<feed xmlns='http://www.w3.org/2005/Atom'
- xml:base='http://www.tbray.org/ongoing/ongoing.atom'
- xml:lang='en-us'>
- <title>ongoing</title>
- <id>http://www.tbray.org/ongoing/</id>
- <link href='./' />
- <link rel='self' href='' />
- <logo>rsslogo.jpg</logo>
- <icon>/favicon.ico</icon>
- <updated>2006-04-26T20:10:25-08:00</updated>
- <author><name>Tim Bray</name></author>
- <subtitle>ongoing fragmented essay by Tim Bray</subtitle>
- <rights>All content written by Tim Bray and photos by Tim Bray Copyright Tim Bray, some rights reserved, see /ongoing/misc/Copyright</rights>
- <generator uri='/misc/Colophon'>Generated from XML source code using Perl, Expat, XML::Parser, Emacs, Mysql, and ImageMagick. Industrial strength technology, baby.</generator>
-
-<entry xml:base='When/200x/2006/04/26/'>
- <title>Spring in White on White</title>
- <link href='Spring-in-White-on-White' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/26/Spring-in-White-on-White</id>
- <published>2006-04-26T13:00:00-08:00</published>
- <updated>2006-04-26T20:10:16-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='Arts/Photos' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Arts' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Photos' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Garden' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Garden' />
- <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Most people would generally prefer a climate where it&#x2019;s bright and warm most of the time. But for Canadians and others who live where it&#x2019;s not, there are compensations, and one is the experience of spring. I have a picture.</div></summary>
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>Most people would generally prefer a climate where it’s bright
-and warm most of the time. But for Canadians and others who live where it’s
-not, there are compensations, and one is the experience of
-spring. I have a picture.</p>
-<img src="IMGP3247.png" alt="Pear blossoms against cherry blossoms" />
-<div class="caption"><p>The blossoms are pear in the foreground, cherry behind.</p></div>
-<p>After all the months of 50° North Latitude winter—icy-sharp in most
-of Canada, wet and dark here in Vancouver—the soul, the spirit, and the
-libido all spring to life when the sun comes back. We’ve had a solid year of
-crappy weather, but this last Saturday through Monday were solidly summery,
-bright
-and warm; and in this season the days are already long and each gets
-longer so fast you can feel it.</p>
-<p>On the back porch, our pear tree’s branches were silhouetted against the
-neighbors’ big wild old cherry; the cherry yields no edible fruit but who
-cares, it’s beautiful
-tree any time of year.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/26/'>
- <title>Scott</title>
- <link href='Scott' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/26/Scott</id>
- <published>2006-04-26T13:00:00-08:00</published>
- <updated>2006-04-26T20:06:50-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='Business/Sun' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Business' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Sun' />
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>I’ve been watching our internal leadership conference and spending quite a
-bit of time talking in the virtual hallways, and I’ve been surprised at
-the intensity of feeling about Mr. McNealy. Yes, there are those
-here saying “About bloody time, now we can make some progress†but there’s a
-much bigger group that is genuinely emotional about this transition.
-Maybe it’s a function of seniority: I never met nor corresponded with Scott, and
-he hasn’t been
-much of a presence in the company’s conversation in the time I’ve been here.
-But there are a lot of smart, seasoned, unsentimental people making it clear
-that
-he’s been a major force in their lives, at a more personal level than I’m
-used to hearing when people speak about executives. I guess also that to a
-lot of people, Sun’s vision, for which Scott gets some of the credit, was a
-radical and wonderful thing. I first used Unix in 1979 and quit a nice
-big-company job
-to become a VAX-bsd sysadmin in 1983, so I’ve always kind of
-lived inside that vision.
-But I’ll tell you one thing, what I’ve been hearing the last couple of days
-makes me really regret that I didn’t get to know Scott.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/26/'>
- <title>Jacobs, Pictures, Spartans</title>
- <link href='Jane-Jacobs' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/26/Jane-Jacobs</id>
- <published>2006-04-26T13:00:00-08:00</published>
- <updated>2006-04-26T17:28:59-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Arts/Photos' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Arts' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Photos' />
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p><a href="http://en.wikipedia.org/wiki/Jane_Jacobs">Jane Jacobs</a> died;
-the city I live in, Vancouver, is pretty solidly Jacobsian both in its current
-shape and its planning dogma. By choosing to live here I’m empirically a
-fan. Oddly, few have remarked how great Jacobs
-<em>looked</em>; her face commanded the eye. Which leads me Alex
-Waterhouse-Hayward’s wonderful
-<a href="http://www.alexwaterhousehayward.com/blog/2006/04/jane-jacobs-viveca-lindfors_26.html">Jane Jacobs &amp; Viveca Lindfors</a>;
-surprising portraits and thoughts on decoration. W-H’s blog has become one of
-only two or three that I
-stab at excitedly whenever I see something new. For example, see
-<a href="http://www.alexwaterhousehayward.com/blog/archives/2006_04_01_archive.html#114476408248660848">Sex Crimes, Homicide and Drugs</a>
-and yes, that’s what it’s about.
-Staying with the death-and-betrayal theme, and apparently (but not really)
-shifting back 2&#xbd; millennia, see John Cowan’s
-<a href="http://recycledknowledge.blogspot.com/2006/04/war-after-simonides.html">The
-War (after Simonides)</a>, being careful to look closely at the links.
-I’ve
-<a href="http://www.tbray.org/ongoing/When/200x/2003/03/24/Herodotus">written</a>
-about those same wars.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/25/'>
- <title>LAMP and MARS</title>
- <link href='Scaling-Rails' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/25/Scaling-Rails</id>
- <published>2006-04-25T13:00:00-08:00</published>
- <updated>2006-04-26T07:24:06-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Web' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Web' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Sun' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Sun' />
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>At
-<a href="/ongoing/When/200x/2006/04/13/RoR">that Rails conference</a>, when I
-was
-<a href="http://blog.garbledygook.com/2006/04/17/ruby-on-rails-podcast-tim-bray-ruby-on-rails-podcast/">talking</a>
-to
-<a href="http://jroller.com/page/obie">Obie Fernandez</a>, he asked, more or
-less “How can Sun love us? We’re not Java†and I said, more or less, “Hey,
-you’re programmers, you write software and there have to be computers to run
-it, we sell computers, why wouldn’t we love you?†Anyhow, we touched on
-parallelism a bit and I talked up the
-<a href="http://www.sun.com/processors/UltraSPARC-T1/">T1</a>;
-Obie took that ball and
-<a href="http://jroller.com/page/obie?entry=will_ultrasparc_t1_emerge_as">ran with it</a>,
-saying all sorts of positive things about synergy between Rails’
-shared-nothing architecture and our multicore systems. Yeah, well, good in
-theory, but I’m too old to make that kind of prediction without running some
-tests. Hah, it turns out that
-<a href="http://joyent.com/">Joyent</a> has been
-<a href="http://scalewithrails.com/">doing that</a>, and have
-<a href="http://scalewithrails.com/downloads/ScaleWithRails-April2006.pdf">76
-PDF slides</a> on the subject.
-If you care about big-system scaling issues, read the whole thing; a little
-long, but amusing and with hardly any bullet lists. If you’re a Sun
-shareholder looking for a pick-me up, check out slides 40-41, 49, and 52-74.
-Oh, I gather that the T1, Solaris, and ZFS are OK for Java too.
-<i>[Update: The title was just “SAMRâ€, as in LAMP with two new letters.
-Enough people didn’t get it that I was forced to think about it, and MARS
-works better anyhow.]</i></p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/25/'>
- <title>Real-Time Journalism</title>
- <link href='Talk-With-Berlind' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/25/Talk-With-Berlind</id>
- <published>2006-04-25T13:00:00-08:00</published>
- <updated>2006-04-26T06:40:19-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World/Journalism' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Journalism' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Syndication' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Syndication' />
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>I got email late yesterday from
-<a href="http://blogs.zdnet.com/bio.php#berlind">David Berlind</a>: “Hey, can
-I call you for a minute?†He wanted commentary on
-<a href="http://blogs.zdnet.com/BTL/?p=2906">a story he was writing</a> that I
-think is about the potential for intellectual-property lock-ins on RSS and Atom
-extensions. I say “I think is about†because the headline is “Will or could
-RSS get forked?â€. After a few minutes’ chat, David asked if he could record
-for a podcast, and even though I only had a cellphone, the audio came out OK.
-The conversation was rhythmic: David brought up a succession of potential
-issues and answered each along the lines of “Yes, it’s reasonable to worry
-about that, but in this
-case I don’t see any particular problems.â€
-Plus I emitted a mercifully-brief rant on the difference between protocols,
-data, and software.
-On the one hand, I thought David could have been a
-little clearer that I was pushing back against the thrust of his story, but on
-the other hand he included the whole conversation right
-there in the piece, so anyone who actually cares can listen and find out what
-I actually said, not what I think I said nor what David reported I said.
-I find this raw barely-intermediated journalism (we
-talk on the phone this afternoon, it’s on the Web in hours) a little
-shocking still.
-On balance, it’s better than the way we used to do things.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/24/'>
- <title>The Transition Explained</title>
- <link href='CEO-Transition' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/24/CEO-Transition</id>
- <published>2006-04-24T13:00:00-08:00</published>
- <updated>2006-04-24T16:49:05-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='Business/Sun' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Business' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Sun' />
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>It’s not that complicated, really.
-Bloggers are
-<a href="http://www.sun.com/2006-0418/js/index.jsp">taking over the world</a>.
-Resistance is futile; you will be assimilated.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/24/'>
- <title>5&#x272d;&#x266b;: One More Cup of Coffee</title>
- <link href='One-More-Cup-Of-Coffee' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/24/One-More-Cup-Of-Coffee</id>
- <published>2006-04-24T13:00:00-08:00</published>
- <updated>2006-04-24T13:00:00-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='Arts/Music/Recordings' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Arts' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Music' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Recordings' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Arts/Music/5 Stars' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='5 Stars' />
- <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>I&#x2019;m not really a <a href='http://en.wikipedia.org/wiki/Bob_Dylan'>Bob Dylan</a> fan. A voice like that, and a tunesmithing talent like that, come along only a few times per century, but he&#x2019;s still kind of irritating. That aside, the song <cite>One More Cup of Coffee</cite>, from the 1976 album <a href='http://en.wikipedia.org/wiki/Desire_%28album%29'>Desire</a>, can&#x2019;t be ignored; wonderful tune, wonderful orchestration, wonderful performance. <i>(&#x201c;5&#x272d;&#x266b;&#x201d; series introduction <a href='/ongoing/When/200x/2006/01/23/5-Star-Music'>here</a>; with <a href='/ongoing/When/200x/2006/01/23/5-Star-Music#p-1'>an explanation</a> of why the title may look broken.)</i></div></summary>
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>I’m not really a
-<a href="http://en.wikipedia.org/wiki/Bob_Dylan">Bob Dylan</a> fan. A voice
-like that, and a tunesmithing talent like that, come along only a few times
-per century, but he’s still kind of irritating.
-That aside, the song <cite>One More Cup of Coffee</cite>, from the 1976 album
-<a href="http://en.wikipedia.org/wiki/Desire_%28album%29">Desire</a>, can’t be
-ignored; wonderful tune, wonderful orchestration, wonderful performance.
-<i>(“5✭♫†series introduction <a href="/ongoing/When/200x/2006/01/23/5-Star-Music">here</a>;
-with <a href="/ongoing/When/200x/2006/01/23/5-Star-Music#p-1">an
-explanation</a> of why the title may look broken.)</i></p>
-<img src="Desire.png" class="inline" alt="Desire, by Bob Dylan" />
-<h2 id='p-1'>The Context</h2>
-<p>Nothing I can possibly write will add any wisdom to the
-millions of words, some 90% of them in excess of needs, written on the subject
-of this particular person.</p>
-<p>A personal statement: Bob Dylan has long irritated me for, during the first
-thirty years or
-so of his career, never having given a straight answer to a straight question,
-and for writing songs with dozens of boring verses. But they’ll still be
-listening
-to lots of his performances long after I’m dead, and in recent years he’s
-become a better, more direct, interview.</p>
-<p>My taste in Dylan is a little unusual: once you get past <cite>One More Cup
-of Coffee</cite>, my favorites would be <cite>Baby Let Me Follow You
-Down</cite> (from the <cite>Last Waltz</cite> soundtrack) and
-<cite>Crash on the Levee (Down in the Flood)</cite> from
-<a href="http://en.wikipedia.org/wiki/The_Basement_Tapes">The Basement
-Tapes</a>.</p>
-<p><cite>Desire</cite>, the record, is hit and miss. <cite>Joey</cite>,
-glorification of the life of some mafioso, is flawed in concept
-and unlistenable in execution. <cite>Hurricane</cite>, whatever you think
-about
-<a href="http://en.wikipedia.org/wiki/Rubin_Carter">Mr. Carter</a>, that song
-rocks; and <cite>Isis</cite> hits pretty hard too.</p>
-<h2 id='p-2'>The Music</h2>
-<p>Is there anything in <cite>One More Cup of Coffee</cite> that’s not
-perfect? Well yes, in the verses, the
-lyrics on occasion drag (“He oversees his kingdom / So no stranger does
-intrude / His voice it trembles as he calls out / For another plate of foodâ€).
-But apart from that, the sentiment is compelling,
-<a href="http://en.wikipedia.org/wiki/Scarlet_Rivera">Scarlet Rivera’s</a>
-violin is beautifully scored and played, the tune is to die for, and the
-backing vocals are by Emmylou Harris, who you can bet is going to be here in
-the 5-✭ series one of these days.
-And while there’s not much middle ground on the subject of Dylan’s singing, if
-you like it, you’ll <em>really</em> like this song.</p>
-<p>Listen to the choruses: Bob and Emmylou veer wildly around the rhythm, then
-coalesce on the beat when it matters, and they’re making it
-up as they go along, they’re wholly inhabiting the moment, and it’s
-quite, quite perfect.</p>
-<h2 id='p-3'>Sampling It</h2>
-<p>Oh yeah, it’s out there. And there’s a live version too; but the smart
-thing would be to go buy the un-compressed un-DRM’ed shiny round silver
-version of <cite>Desire</cite>; it’s a keeper.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/24/'>
- <title>Atomic Monday</title>
- <link href='Atomic-Monday' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/24/Atomic-Monday</id>
- <published>2006-04-24T13:00:00-08:00</published>
- <updated>2006-04-24T00:44:06-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Syndication' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Syndication' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Atom' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Atom' />
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>First of all, implementors of anything Atom-related need to spend some time
-<a href="http://golem.ph.utexas.edu/~distler/blog/archives/000793.html">chez
-Jacques Distler</a>; in particular, the conversation that plays out in the
-comments. Second, there’s this piece of software called
-<a href="http://www.planetplanet.org/">Planet Planet</a> that allows you to
-make an aggregate web page by reading lots of feeds; for example, see
-<a href="http://www.planetapache.org/">Planet Apache</a> or
-<a href="http://planetsun.org/">Planet Sun</a>.
-Sam Ruby decided that its Atom support needed some work, so
-<a href="http://www.intertwingly.net/blog/2006/04/23/Adding-Atom-support-to-PlanetPlanet">he did
-it</a>. Now, here’s the exciting part: he pinged me over the weekend and said
-“Hey, look at this†wanting to show me his cleverly-Atomized
-Planet Intertwingly feed.
-I looked at it in
-<a href="http://ranchero.com/netnewswire/">NetNewsWire</a> and was puzzled for
-a moment; some but not all of the
-things in the feed were highlighted as unread, even though this was the first
-time I’d seen it. Then the light went on.
-This
-is Atom doing <em>exactly what we went to all that trouble to make it do</em>.
-NetNewsWire has good Atom support and, because Atom entries all have unique
-IDs and timestamps, it can
-tell that it’s seen lots of those entries before in other feeds that I
-subscribe to. That’s how I found Jacques’ piece. This is huge; anyone who
-uses synthetic or aggregated feeds knows that dupes are a big problem, showing
-up all over the place.
-No longer, Atom makes that problem go away.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/22/'>
- <title>Hyatt on the High-Res Web</title>
- <link href='High-Res-Web' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/22/High-Res-Web</id>
- <published>2006-04-22T13:00:00-08:00</published>
- <updated>2006-04-23T17:12:18-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Web' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Web' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Presentation' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Presentation' />
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>Check out Dave Hyatt’s
-<a href="http://webkit.opendarwin.org/blog/?p=55">excellent write-up</a> on
-designing and rendering Web pages so they take advantage of the
-higher-resolution screens that <em>may</em> be coming our way.
-I emphasize “may†because I’ve seen how slowly we’ve picked up pixels over
-the years. The first really substantial screen I ever worked on was a
-1988-vintage Sun workstation with about a million pixels. The Mac on my
-lap right now, which has 125 times as much memory as that workstation, has
-only 1.38 million pixels.
-Anyhow, Hyatt has some smart things to say on the issues,
-which are trickier than you might think. I suspect that sometime in a couple of
-years, if I still care about <span class='o'>ongoing</span>, I’m going to
-have to go back and reprocess all the images so that higher-res versions are
-available for those who have the screens and don’t mind downloading bigger
-files.
-Anyhow, Dave’s piece may be slightly misleading in that he talks about SVG
-as though
-it’s something coming in the future. Not so, check out
-<a href="http://zcorpan.1go.dk/sandbox/svg/atom/.xml">this nifty SVG Atom
-logo</a>, which works fine in all the Mozilla browsers I have here.
-Load it up, resize the window, and watch what happens. Then do a “view
-sourceâ€.
-<i>[Update:
-<a href="http://blog.codedread.com">Jeff Schiller</a> writes to tell me that
-Opera 9 does SVG (and Opera 8 “SVG Tinyâ€) too.]
-[<a href="http://www.freeke.org/ffg">Dave Walker</a> writes: Though the shipping version of Safari doesn’t support SVG,
-<a href="http://nightly.webkit.org/builds/Latest-WebKit-SVN.dmg">the
-nightlies</a> do.]
-[<a href="http://www.davelemen.com/archives/2006/04/is_it_time_for_jpeg_2000_to_go_mainstream.html">Dave Lemen</a>
-points to
-<a href="http://en.wikipedia.org/wiki/JPEG-2000">JPEG 2000</a> as possibly
-useful in a high-res context.]</i></p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/23/'>
- <title>Wrong About the Infield Fly Rule</title>
- <link href='Wrong-About-the-Infield-Fly-Rule' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/23/Wrong-About-the-Infield-Fly-Rule</id>
- <published>2006-04-23T13:00:00-08:00</published>
- <updated>2006-04-23T15:02:41-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World/Family' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Family' />
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>My brother
-<a href="http://takingalongview.blogspot.com/">Rob</a> is really taking to
-this blogging medium. Check out his recent
-<a href="http://takingalongview.blogspot.com/2006/04/credo.html">Credo</a>,
-and also the only instance I’ve seen of
-<a href="http://takingalongview.blogspot.com/2006/04/ode-to-96-chevy-lumina.html">Anglo-Saxon alliterative poetry</a>
-applied to a mini-van.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2004/12/12/'>
- <title>Statistics</title>
- <link href='BMS' />
- <id>http://www.tbray.org/ongoing/When/200x/2004/12/12/BMS</id>
- <published>2004-12-12T12:00:00-08:00</published>
- <updated>2006-04-23T10:10:02-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Publishing' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Publishing' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Web' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Web' />
- <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Almost every Sunday I grab the week&#x2019;s <span class="o">ongoing</span> logfiles and update my numbers. I find it interesting and maybe others will too, so this entry is now the charts&#x2019; permanent home. I&#x2019;ll update it most weeks, probably. <i>[Updated: 2006/04/23.]</i></div></summary>
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>Almost every Sunday I grab the week’s <span class='o'>ongoing</span>
-logfiles and update my numbers.
-I find it interesting
-and maybe others will too, so
-this entry is now the charts’ permanent home. I’ll update it most weeks,
-probably.
-<i>[Updated: 2006/04/23.]</i></p>
-<img src="Browser-Market-Share.png" alt="Browser market shares at ‘ongoing’" />
-<div class="caption"><p>Browsers visiting <span class='o'>ongoing</span>,
-percent.</p></div>
-<img src="Browsers-via-search.png" alt="Browser market shares at ‘ongoing’, visitors via search engines" />
-<div class="caption"><p>Browsers visiting <span class='o'>ongoing</span> via
-search engines, percent.</p></div>
-<img src="Search-Engines.png" alt="Search engine market shares at ‘ongoing’" />
-<div class="caption"><p>Search referrals to <span
-class='o'>ongoing</span> .</p></div>
-<img src="Feeds.png" alt="RSS and Atom feed fetches" />
-<div class="caption"><p>Fetches of the RSS 2.0 and Atom 1.0 feeds.</p></div>
-<p>The notes on usage and source code will return in coming weeks when I get
-the cycles to rewrite this whole article.</p>
-<h2 id='p-1'>What a “Hit†Means</h2>
-<p>I recently
-<a href="/ongoing/When/200x/2006/02/07/Thumbnail">updated</a> the
-<a href="/ongoing/misc/Colophon"><span class='o'>ongoing</span> software</a>
-(but haven’t updated the Colophon I see, oops).
-Anyhow, the <code>XMLHttpRequest</code> now issued by each page seems to be a
-pretty reliable counter of the number of actual browsers with humans behind
-them reading the pages. I checked against
-<a href="/ongoing/When/200x/2005/12/04/Google-Analytics">Google Analytics</a>
-and the numbers agreed to within a dozen or two on days with 5,000 to 10,000
-page views; interestingly, Google Analytics was always 10 or 20 views
-higher.</p>
-<p>Anyhow, do <em>not</em> conclude that now I know how many people are
-reading whatever it is I write here; because I publish lots of short pieces
-that are all there in my RSS feed, and anyone reading my Atom feed gets the
-full content of everything.
-I and I have <em>no #&amp;*!$ idea</em> how many people look at my feeds.</p>
-<p>By the way, this was the first time in weeks and weeks that I’d looked at the
-Analytics numbers, and they showed almost exactly zero change from the report
-linked above. So I’m going to turn them off; they’re a little too intrusive
-and I think may be slowing page loads.</p>
-<p>Anyhow, I ran some detailed statistics on the traffic for Wednesday,
-February 8th, 2006.</p>
-<table cellspacing="3" cellpadding="2" class="wltable">
-<tr valign="top"><td>Total connections to the server</td><td align="right">180,428</td></tr>
-<tr valign="top"><td>Total successful GET transactions</td><td align="right">155,507</td></tr>
-<tr valign="top"><td>Total fetches of the RSS and Atom feeds</td><td align="right">88,450</td></tr>
-<tr valign="top"><td>Total GET transactions that actually fetched data (i.e. status code
-200 as opposed to 304)</td><td align="right">87,271</td></tr>
-<tr valign="top"><td>Total GETs of actual ongoing pages (i.e. not CSS, js, or
-images)</td><td align="right">18,444</td></tr>
-<tr valign="top"><td>Actual human page-views</td><td align="right">6,348</td>
-</tr>
-</table>
-<p>So, there you have it. Doing a bit of rounding, if you take the 180K
-transactions and subtract the 90K feed fetches and the 6000 actual human page
-views, you’re left with 84,000 or so “Web overhead†transactions, mostly
-stylesheets and graphics and so on.
-For every human who viewed a page, it was fetched almost twice again by
-various kinds of robots and non-browser automated agents.</p>
-<p>It’s amazing that the whole thing works at all.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/18/'>
- <title>XML Automaton</title>
- <link href='XML-Grammar' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/18/XML-Grammar</id>
- <published>2006-04-18T13:00:00-08:00</published>
- <updated>2006-04-23T08:25:56-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/XML' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='XML' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Coding' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Coding' />
- <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>In December of 1996 I released a piece of software called <a href='http://www.textuality.com/Lark/'>Lark</a>, which was the world&#x2019;s first <a href='http://www.w3.org/TR/REC-xml/#dt-xml-proc'>XML Processor</a> (as the term is defined in the <a href='http://www.w3.org/TR/REC-xml/'>XML Specification</a>). It was successful, but I stopped maintaining it in 1998 because lots of other smart people, and some big companies like Microsoft, were shipping perfectly good processors. I never <em>quite</em> open-sourced it, holding back one clever bit in the moronic idea that I could make money out of Lark somehow. The magic sauce is a finite state machine that can be used to parse XML 1.0. Recently, someone out there needed one of those, so I thought I&#x2019;d publish it, with some commentary on Lark&#x2019;s construction and an amusing anecdote about the name. I doubt there are more than twelve people on the planet who care about this kind of parsing arcana. <i>[Rick Jelliffe <a href='http://www.oreillynet.com/xml/blog/2006/04/xml_in_xml.html'>has upgraded</a> the machine].</i></div></summary>
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>In December of 1996 I released a piece of software called
-<a href="http://www.textuality.com/Lark/">Lark</a>, which was
-the world’s first
-<a href="http://www.w3.org/TR/REC-xml/#dt-xml-proc">XML Processor</a> (as the
-term is defined in the
-<a href="http://www.w3.org/TR/REC-xml/">XML Specification</a>).
-It was successful, but I stopped maintaining it in 1998 because lots of other
-smart people, and some big companies like Microsoft, were shipping perfectly
-good processors. I never <em>quite</em> open-sourced it, holding back one
-clever bit in the moronic idea that I could make money out of Lark somehow.
-The magic sauce is a finite state machine that can be used to parse XML 1.0.
-Recently, someone out there needed one of those, so I thought I’d publish
-it, with some commentary on Lark’s construction and an amusing anecdote about
-the name.
-I doubt there are more than twelve people on the planet who care about
-this kind of parsing arcana.
-<i>[Rick Jelliffe
-<a href="http://www.oreillynet.com/xml/blog/2006/04/xml_in_xml.html">has
-upgraded</a> the machine].</i></p>
-<h2 id='p-1'>Why “Lark�</h2>
-<p><a href="http://www.laurenwood.org/anyway/">Lauren</a> and I went to
-Australia in late 1996 to visit her mother and to get married, which we
-did on November 30th. Forty-eight hours later, Lauren twisted her knee
-badly enough that she was pretty well
-confined to a sofa for the rest of our Australian vacation.</p>
-<p>So I broke out my computer and finished the work I’d already started on my
-XML processor, and decided to call it Lark for <b>La</b>uren’s <b>R</b>ight
-<b>K</b>nee.</p>
-<h2 id='p-2'>How Lark Worked</h2>
-<p>Lark was a pure
-<a href="http://en.wikipedia.org/wiki/Deterministic_finite_state_machine">deterministic
-finite automaton</a> (DFA)
-parser, with a little teeny state stack.
-Some of its transitions were labeled with named “events†that would provoke
-the parser to do something if, for example, it had just recognized a start tag
-or whatever.</p>
-<p>DFA-driven parsers are a common enough design pattern, although I think
-Lark is the only example in the XML space.
-There are well-known parser generators such as
-<a href="http://en.wikipedia.org/wiki/Yacc">yacc</a>,
-<a href="http://en.wikipedia.org/wiki/GNU_bison">GNU bison</a>, and
-<a href="https://javacc.dev.java.net/">javacc</a>,
-usually used in combination with lexical scanners such as
-<a href="http://en.wikipedia.org/wiki/Flex_lexical_analyser">flex</a> so that
-you can write your grammar in terms of tokens not characters.
-Also, they handle LALR langauges, so the parsing technique is quite a bit
-richer than a pure state machine.</p>
-<p>I thought I had a better idea. The grammar of XML is simple
-enough, and the syntax characters few enough, that I thought I could just
-write down the state machine by hand.
-So that’s what I did, inventing a special-purpose DFA-description
-language for the purpose.</p>
-<p>Then I had a file called <code>Lark.jin</code> which was really a Java
-program that used the state machine to parse XML. The transition “eventsâ€
-in the machine were mapped to <code>case</code> labels in a huge
-<code>switch</code> construct. Then there was a horrible, <em>horrible</em>
-Perl program that read the <code>Lark.jin</code> and the automaton,
-generated the DFA tables in Java syntax, inserted them into the code and
-produced <code>Lark.java</code>, which you actually compiled
-to make the parser.</p>
-<p>So while Java doesn’t have a preprocessor, Lark did, which made quite a few
-things easier.</p>
-<p>There were a lot of tricks; some of the state transitions
-weren’t on characters, they were on XML character classes such as
-<code>NameChar</code> and so on.
-This made the automaton easier to write, and in fact, to keep the class files
-small, the character-class transitions persisted into the Java form, and the
-real DFA was built at startup time.
-These days, quick startup might be more important than <code>.class</code>
-file size.</p>
-<h2 id='p-3'>What Was Good</h2>
-<p>It was <em>damn</em> fast. James Clark managed to hand-craft a
-Java-language XML parser called
-<a href="http://jclark.com/xml/xp/index.html">XP</a> that was a little faster
-than Lark, but he did that by clever I/O buffering, and I was determined to
-leapfrog him by improving my I/O.</p>
-<p>This was before the time of standardized XML APIs, but Lark had a stream API
-that influenced SAX, and a DOM-like tree API; both worked just fine.
-Lark is one of very few parsers ever to have survived the
-<a href="http://www.securityfocus.com/archive/1/303509/2002-12-13/2002-12-19/0">billion
-laughs attack</a>.</p>
-<p>Lark was put into production in quite a few deployments, and the flow of
-bug reports slowed to a trickle.
-Then in 1998 I noticed that IBM and Microsoft and BEA and everyone else
-were building XML Processors, so I decided that it wasn’t worthwhile
-maintaining mine.</p>
-<h2 id='p-4'>What Was Bad</h2>
-<p>I never got around to teaching it namespaces, which means it wouldn’t be
-real useful today.</p>
-<p>It had one serious bug that would have been real work to fix and since
-nobody ever encountered it in practice, I kept putting it off and never did.
-If you had an internal parsed entity reference in an attribute value and the
-replacement text included the attribute delimiter (<code>'</code> or
-<code>"</code>), it would scream and claim you had a busted XML document.</p>
-<h2 id='p-5'>That Automaton</h2>
-<p>What happened was,
-<a href="http://www.oreillynet.com/pub/au/1712">Rick Jelliffe</a>, who is a
-Good Person, was
-<a href="http://www.stylusstudio.com/xmldev/200604/post30110.html">looking for
-a FSM for XML</a> and I eventually noticed, and so I sent him mine.</p>
-<p>There’s no reason whatsoever to keep it a secret:
-<a href="/ongoing/code/lark/com/textuality/autom.txt">here it is</a>.
-Be warned: it’s ugly.</p>
-<p>Fortunately, there were only 227 states and 8732 transitions, so the state
-number fit into a
-byte; that and the associated event index pack into a short.
-To make things even tighter, the transitions were only keyed by characters up
-to 127, as in 7-bit ASCII.
-Characters higher than that can’t be XML syntax characters, so we’re only
-interested whether they fall into classes like <code>NameChar</code> and
-<code>NameStartChar</code> and so on. A 64K <code>byte[]</code> array takes
-care of that, each byte having a class bitmask.</p>
-<p>As a result of all this jiggery-pokery, the DFA ends up, believe it
-or not, constituting a <code>short[227][128]</code>.</p>
-<p>Here’s a typical chunk of the automaton:</p>
-<pre><code>1. # in Start tag GI
-2. State StagGI BustedMarkup {in element type}
-3. T $NameC StagGI
-4. T $S InStag !EndGI
-5. T > InDoc !EndGI !ReportSTag
-6. T / EmptyClose !EndGI</code></pre>
-<p>This state, called <code>StagGI</code>, is the state where we’re actually
-reading the name of a tag, we got here by seeing a <code>&lt;</code> followed
-by a <code>NameStart</code> character.<br/>
-Line 1 is a comment.<br/>
-In line 2 we name the state, and support error reporting, providing the name
-of another state to fall back into in case of error, and in the curly braces,
-some text to help build an error message.<br/>
-Line 3 says that if we see a valid XML Name character, we just stay in this
-state.<br/>
-Line 4 says that if we see an XML space character, we move to state
-<code>InStag</code> and process an <code>EndGI</code> event, which would stash
-the characters in the start tag.<br/>And so on.</p>
-<h2 id='p-6'>Other Hackery</h2>
-<p>An early cut of Lark used String and StringBuffer objects to hold all the
-bits and pieces of the XML. This might be a viable strategy today, but in
-1996’s Java it was painfully slow.
-So the code goes to heroic lengths to live in the land of character arrays at
-all times, making Strings only when a client program asks for one through the
-API. The performance difference was mind-boggling.</p>
-<h2 id='p-7'>An Evil Idea</h2>
-<p>If you look at the automaton, and the Lark code, at least half—I’d bet
-three quarters—is there to deal with parsing the DTD and then dealing with
-entity wrangling.
-A whole bunch more is there to support DOM-building and walking.</p>
-<p>I bet if I went through and simply removed support for anything coming out
-of the <code>&lt;!DOCTYPE></code>, including all entity processing,
-then discarded
-the DOM stuff, then added namespace support and SAX and StAX APIs, it would be
-less than half its current size.
-Then if I reworked the I/O, knowing what I know now and stealing some tricks
-that James Clark uses in
-<a href="http://expat.sourceforge.net/">expat</a>, I bet it would
-be the fastest Java XML parser on the planet for XML docs without a
-DOCTYPE; by a wide margin. It’s hard to beat a DFA.</p>
-<p>And it would still be fully XML 1.0 compliant. Because (snicker) this is
-Java, and your basic core Java now includes an XML parser, so I could simply
-instrument Larkette to buffer the prologue and if it saw a DOCTYPE with an
-internal subset, defer to Java’s built-in parser.</p>
-<p>I’ll probably never do it. But the thought brings a smile to my face.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/22/'>
- <title>Just A Kid</title>
- <link href='Just-a-Kid' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/22/Just-a-Kid</id>
- <published>2006-04-22T13:00:00-08:00</published>
- <updated>2006-04-22T13:37:58-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World/Food and Drink' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Food and Drink' />
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>Last weekend, Lauren felt like cooking up home-made Easter eggs, so
-the shopping list included “chocolate chips (large bag)â€. I was heading down
-the bulk-foods aisle and realized one of the vertical acrylic bins was full of
-them. Someone had been sloppy, and there was a little heap of chocolate chips
-on the shelf underneath it. For a second, I flashed into pure eight-year-old
-mode, thinking “Holy cow, there’s a <em>whole bin</em> full of chocolate
-chips, and more just lying there!†I popped a few in my mouth and they were
-excellent; semi-sweet, dark, strong, and firm. I was still in the state that
-Buddhists don’t mean when they say “Child’s Mindâ€, thinking “I
-can get as many as I want!†The list did say “large bag†after all, so I put
-a bag under the spout and gleefully jammed the lever <em>all the way
-over</em>. At home, Lauren said “You went overboard, a bit, didn’t you?â€
-and now we have a plastic canister-full in the pantry which should last us
-into 2007. It’s a good feeling.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/22/'>
- <title>Goddess</title>
- <link href='Goddess' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/22/Goddess</id>
- <published>2006-04-22T13:00:00-08:00</published>
- <updated>2006-04-22T12:25:59-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World/Family' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Family' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Microsoft' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Microsoft' />
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>That would be my wife
-<a href="http://www.laurenwood.org/anyway/">Lauren</a>. After
-<a href="/ongoing/When/200x/2006/04/16/Mad-at-Microsoft">I b0rked</a> our
-Win2K gamebox, I tried re-installing the OS and eventually reduced it to
-complete brick-ness, it recognized neither the video adapter nor the network
-card. So Lauren brushed me aside and started wrestling with the problem, and
-to make a long story short, it almost completely works again. At one point
-she seemed nearly infinite in her capabilities, sitting in front of the
-computer wrangling software updates while knitting baby stuff and looking up
-words in a German dictionary for the kid’s homework. Some of the German nouns
-and muttered curses at the Windows install sounded remarkably like each other.
-Why would anyone not marry a geek? The only problem is that Win2K won’t
-auto-switch resolutions to play games any more, it gets the frequency wrong
-and the LCD goes pear-shaped, you have to hand-select the frequency and
-switch into the right resolution first. LazyWeb?</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/21/'>
- <title>Routing Around Spotlight</title>
- <link href='Routing-Around-Spotlight' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/21/Routing-Around-Spotlight</id>
- <published>2006-04-21T13:00:00-08:00</published>
- <updated>2006-04-21T23:16:25-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Mac OS X/Gripes' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Mac OS X' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Gripes' />
- <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Herewith two hideously ugly little shell scripts for use when Spotlight refuses to search your mail. Spotlight is a flawed v1.0 implementation of a really good idea and will, I&#x2019;m sure, be debugged in a near-future release. <i>[Update: The LazyWeb is educating me... these are moving targets.]</i></div></summary>
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>Herewith two hideously ugly little shell scripts for use when Spotlight
-refuses to search your mail.
-Spotlight is a flawed v1.0 implementation of a really good idea and will, I’m
-sure, be debugged in a near-future release.
-<i>[Update: The LazyWeb is educating me... these are moving targets.]</i></p>
-<p>My problem is that whereas Mail.app will search my To/From/Subject
-lines (slowly, and with a
-<a href="/ongoing/When/200x/2005/11/20/UnTiger">really irritating GUI</a>),
-the “Entire Message†option just doesn’t work, it returns instantly with no
-results. Yes, I’ve read the hints about making Spotlight re-index,
-but it just flatly refuses to work for me. Mind you, I have a lot of
-email, but still, it should at least try.</p>
-<p>It turns out I had never really figured out the <code>-print0</code> and
-<code>-0</code> idioms that a lot of the shell-command stalwarts now have.
-Thanks to Malcolm Tredinnick for raising my consciousness.</p>
-<p>This lives in <code>$HOME/bin</code> under the name
-<code>mailgrep</code>:</p>
-<pre><code>#!/bin/sh
-find $HOME/Library/Mail/IMAP* -name '*.emlx' -print0 | \
- xargs -0 fgrep -i $@</code></pre>
-<p>Isn’t <code>xargs</code> a funny command? I’ve discovered that it’s nearly
-impossible to describe what does, and then why what it does is necessary, but
-there are just a whole bunch of places where you’d be lost without it.</p>
-<p>This lives in <code>$HOME/bin/mailview</code>:</p>
-<pre><code>#!/bin/sh
-find $HOME/Library/Mail/IMAP* -name '*.emlx' -print0 | \
- xargs -0 fgrep -i -l -Z $@ | \
- xargs -0 open</code></pre>
-<p>The first cut of this dodged <code>xargs</code> and used an
-incredibly-inefficient and slow chain of <code>-exec</code> arguments to open
-the files one at a time with
-<code>view</code> (aka <code>vim</code>), to work around
-a well-known <code>vim</code> misfeature; it complained about the input
-not being a terminal and left my Terminal.app keystrokes borked.</p>
-<p>But Malcolm, confirming my belief in the broken-ness of <code>vim</code>,
-said “Oh, *that* ‘view’. I thought it was some sexy Mac ‘view my email’ appâ€.
-D’oh, of course; the magic OS X <code>open</code> command does just the right
-thing.
-Erm, you might want to run <code>mailgrep</code> before you run
-<code>mailview</code>; I’m not sure what would happen if you asked OS X to
-open three or four thousand email messages at once.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/21/'>
- <title>FSS: Pink Flowers</title>
- <link href='Dracon-Help' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/21/Dracon-Help</id>
- <published>2006-04-21T13:00:00-08:00</published>
- <updated>2006-04-21T17:19:27-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='Arts/Photos' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Arts' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Photos' />
- <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Friday Slide Scan #28 is two Eighties florals, one interior, one exterior. With a confession.</div></summary>
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>Friday Slide Scan #28 is two Eighties florals, one interior, one
-exterior. With a confession.</p>
-<p>First some spring flowers fallen from a tree, just as now in our front
-yard, at dusk.</p>
-<img src="0506.png" alt="Fallen pink treeflowers on grass at dusk" />
-<p>I’m not sure what these are, but look at the light in the center. Rewards
-enlarging.</p>
-<img src="0713.png" alt="Flowers in shadow with light in background" />
-<p>Here’s the confession. Sometimes on Fridays when I’m feeling kinda
-burned-out, I knock off work and do these slide scans in the office, because
-this is where I have the
-<a href="http://www.tbray.org/ongoing/When/200x/2004/04/14/MineIsBigger">big
-screen</a>.
-Blowing these pictures up to mega-huge, picking away at the old-slide crud and
-scanning artifacts, tinkering with the colour balance, and listening; I never
-play music while I’m writing or coding seriously, but I play it real loud while
-photo-editing. It’s all pretty well pure pleasure; you just can’t imagine
-how good that second one above looks at near-native size.
-It reconstitutes the part of my mind that I earn my living with; that’s my
-story and I’m sticking to it.</p>
-<p>Images in the Friday Slide Scans are from 35mm slides taken between 1953
-and 2003 by (in rough chronological order)
-<a href="http://www.textuality.com/BillBray/">Bill Bray</a>,
-<a href="/ongoing/When/200x/2004/08/11/MomsGarden">Jean Bray</a>, Tim Bray, Cath
-Bray, and
-<a href="http://www.laurenwood.org/anyway/">Lauren Wood</a>; when I know
-exactly who took one, I’ll say; in this case, at least one is by Cath Bray.
-Most but not all of the slides were on Kodachrome; they were digitized using
-a Nikon CoolScan 4000 ED scanner and cleaned up by a combination of the Nikon
-scanning software and PhotoShop Elements.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/20/'>
- <title>Spring Pix</title>
- <link href='Spring-Pix' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/20/Spring-Pix</id>
- <published>2006-04-20T13:00:00-08:00</published>
- <updated>2006-04-20T23:07:10-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World/Places/Vancouver' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Places' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Vancouver' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Arts/Photos' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Arts' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Photos' />
- <summary type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>Three pictures around Vancouver; one of a fresh green springtime tree, two of rotten old buildings being torn down.</div></summary>
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>Three pictures around Vancouver; one of a fresh green springtime tree, two
-of rotten old buildings being torn down.</p>
-<p>There’s nothing quite as fresh as just-sprouted deciduous leaves;
-another few weeks and this tree will be just a tree.</p>
-<img src="IMG_4656.png" alt="Sunlit fresh young leaves" />
-<p>I have a thing about demolition.
-The first is a rotten dingy old one-story on Main Street near 23rd, the second
-is an unlovely grey mid-rise being torn down to build still more condos at
-Homer and Helmcken.</p>
-<img src="IMG_4665.png" alt="Demolition site on Main Street, Vancouver" />
-<img src="IMG_4671.png" alt="Demolition site at Homer and Helmcken, Vancouver" />
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/20/'>
- <title>Totten&#x2019;s Trip</title>
- <link href='Totten-on-Iraq' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/20/Totten-on-Iraq</id>
- <published>2006-04-20T13:00:00-08:00</published>
- <updated>2006-04-20T21:05:22-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World/Places/Middle East' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Places' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Middle East' />
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p><a href="http://www.michaeltotten.com/">Michael J. Totten</a> is a
-journalist and blogger who’s back and forth to the
-Middle East and writes about it, quite well in my opinion; he supports this by
-freelancing and with his blog’s tip jar. He gets lots of
-link love from the right-wing blogosphere, which is puzzling because Totten is
-balanced and clear-eyed and doesn’t seem to have any particular axe to grind.
-Recently, he and a friend were
-<a href="http://www.michaeltotten.com/archives/001117.html">having fun in
-Istanbul</a> and, on a random drive out into the country, decided on impulse to
-keep going, all the way across Turkey and into Iraq; into the Kurdish
-mini-state in Iraq’s north, to
-be precise. It makes a heck of a story, with lots of pictures, in six parts:
-<a href="http://www.michaeltotten.com/archives/001119.html">I</a>,
-<a href="http://www.michaeltotten.com/archives/001120.html">II</a>,
-<a href="http://www.michaeltotten.com/archives/001121.html">III</a>,
-<a href="http://www.michaeltotten.com/archives/001124.html">IV</a>,
-<a href="http://www.michaeltotten.com/archives/001126.html">V</a>, and
-<a href="http://www.michaeltotten.com/archives/001127.html">VI</a>.
-</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/19/'>
- <title>The Cost of AJAX</title>
- <link href='The-Cost-of-AJAX' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/19/The-Cost-of-AJAX</id>
- <published>2006-04-19T13:00:00-08:00</published>
- <updated>2006-04-20T00:37:46-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology/Web' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Technology' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Web' />
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>James Governor
-<a href="http://www.redmonk.com/jgovernor/archives/001526.html">relays a
-question</a> that sounds important
-but I think is actively dangerous: do AJAX apps present more of
-a server-side load? The question is dangerous because it’s meaningless and
-unanswerable. Your typical Web page will, in the process of
-loading, call back to the server for a bunch of stylesheets and graphics and
-scripts and so on: for example, this <span class='o'>ongoing</span> page calls
-out to three different graphics, one stylesheet, and one JavaScript file.
-It also has one “AJAXy†XMLHttpRequest call.
-From the server’s point of view, those are all just requests to dereference
-one URI or another. In the case
-of <span class='o'>ongoing</span>, the AJAX request is for a static file less
-than 200 bytes in size (i.e. cheap).
-On the other hand, it could have been for something that required a
-complex outer join on two ten-million-row tables (i.e. <em>very</em>
-expensive). And one of the virtues of
-the Web Architecture is that it hides those differences, the “U†in URI stands
-for “Uniformâ€, it’s a Uniform interface to a resource on the Web that could
-be, well, anything.
-So saying “AJAX is expensive†(or that it’s cheap) is like saying “A mountain
-bike is slower than a battle tank†(or that it’s faster).
-The truth depends on what you’re doing with it.
-In the case of web sites, it depends on how many fetches you do and
-where you have to go to get the data to satisfy them.
-<span class='o'>ongoing</span> is a pretty quick web site, even though it runs
-on a fairly modest server, but
-that has nothing to do with AJAX-or-not; it’s because of the particular way
-I’ve set up the Web resources that make the pages here.
-I’ve
-<a href="/ongoing/When/200x/2006/02/14/AJAX-Performance">argued elsewhere</a>
-that AJAX can be a performance win, system-wide; but that argument too is
-contingent on context, lots of context.</p>
-</div></content></entry>
-
-<entry xml:base='When/200x/2006/04/18/'>
- <title>Hao Wu and Graham McMynn</title>
- <link href='Hao-Wu' />
- <id>http://www.tbray.org/ongoing/When/200x/2006/04/18/Hao-Wu</id>
- <published>2006-04-18T13:00:00-08:00</published>
- <updated>2006-04-18T22:00:40-08:00</updated>
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World/Places/China' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Places' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='China' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='The World/Politics' />
- <category scheme='http://www.tbray.org/ongoing/What/' term='Politics' />
-<content type='xhtml'><div xmlns='http://www.w3.org/1999/xhtml'>
-<p>Graham McMynn is a teenager who was kidnapped in Vancouver on April 4th and
-freed, in a large, noisy, and
-<a href="http://www.cbc.ca/story/news/national/2006/04/12/bcabduction060412.html">newsworthy</a>
-police operation, on April 12th.
-<a href="http://en.wikipedia.org/wiki/Hao_Wu">Hao Wu</a> is a Chinese
-film-maker and
-<a href="http://beijingorbust.blogspot.com/">blogger</a> who was kidnapped in
-Beijing on February 22nd in a
-small, quiet police operation not intended to be newsworthy, and who has not
-been freed.
-Read about it
-<a href="http://spaces.msn.com/wuhaofamily/">here</a>,
-<a href="http://ethanzuckerman.com/haowu/">here</a>, and
-<a href="http://rconversation.blogs.com/rconversation/freehaowu/index.html">here</a>.
-Making noise about it <em>might</em> influence the government of China to
-moderate its actions against Mr. Wu, and can’t do any harm.
-Mr. McMynn’s kidnappers were a gaggle of small-time hoodlums, one of whom was
-out on bail while awaiting trial for another kidnapping (!).
-Mr. Wu’s were police.
-In a civilized country, the function of the police force is to deter such
-people and arrest them. A nation where they are the same people? Nobody
-could call it “civilizedâ€.</p>
-</div></content></entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_title_xhtml.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_title_xhtml.xml
deleted file mode 100644
index 0b4d21b96..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_title_xhtml.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom title works
-Expect: feed.title.plainText() == 'test title'
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
- <title type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml"><b>test</b> title</div>
- </title>
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_title_xhtml_entities.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_title_xhtml_entities.xml
deleted file mode 100644
index aaf982acf..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_title_xhtml_entities.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom summary with entities works
-Expect: feed.subtitle.text == '&quot;test&quot; &amp; &apos;title&apos; &amp; &lt;ok&gt;'
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-<subtitle type="xhtml">
- <div xmlns="http://www.w3.org/1999/xhtml">
- "test&quot; &amp; &apos;title' &amp; &lt;ok>
- </div>
-</subtitle>
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_updated.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_updated.xml
deleted file mode 100644
index f425674f2..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_updated.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: raw atom updated works
-Expect: feed.fields.getProperty('atom:updated') == '2003-12-13T18:30:02Z'
-
--->
-
-<feed xmlns="http://www.w3.org/2005/Atom">
-
- <title>Example Feed</title>
- <link href="http://example.org/"/>
- <updated>2003-12-13T18:30:02Z</updated>
- <author>
- <name>John Doe</name>
- </author>
- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
-
- <entry>
- <title>Atom-Powered Robots Run Amok</title>
- <link href="http://example.org/2003/12/13/atom03"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- <updated>2003-12-13T18:30:02Z</updated>
- <summary>Some text.</summary>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_updated_invalid.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_updated_invalid.xml
deleted file mode 100644
index 560d756b9..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_updated_invalid.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: non-date atom updated should produce null feed.updated
-Expect: feed.updated == null
-
--->
-
-<feed xmlns="http://www.w3.org/2005/Atom">
-
- <title>Example Feed</title>
- <link href="http://example.org/"/>
- <updated>2003I'mNotADate</updated>
- <author>
- <name>John Doe</name>
- </author>
- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
-
- <entry>
- <title>Atom-Powered Robots Run Amok</title>
- <link href="http://example.org/2003/12/13/atom03"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- <updated>2003-12-13T18:30:02Z</updated>
- <summary>Some text.</summary>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_updated_normalized.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_updated_normalized.xml
deleted file mode 100644
index 71fa1d03d..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_updated_normalized.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom updated works
-Expect: feed.updated == 'Sat, 13 Dec 2003 18:30:02 GMT'
-
--->
-
-<feed xmlns="http://www.w3.org/2005/Atom">
-
- <title>Example Feed</title>
- <link href="http://example.org/"/>
- <updated>2003-12-13T18:30:02Z</updated>
- <author>
- <name>John Doe</name>
- </author>
- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
-
- <entry>
- <title>Atom-Powered Robots Run Amok</title>
- <link href="http://example.org/2003/12/13/atom03"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- <updated>2003-12-13T18:30:02Z</updated>
- <summary>Some text.</summary>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_version.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_version.xml
deleted file mode 100644
index a703f506f..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_version.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 Version works
-Expect: result.version == 'atom'
--->
-<feed xmlns="http://www.w3.org/2005/Atom">
-
-</feed> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rfc4287/feed_xmlBase.xml b/toolkit/components/feeds/test/xml/rfc4287/feed_xmlBase.xml
deleted file mode 100644
index d5760e333..000000000
--- a/toolkit/components/feeds/test/xml/rfc4287/feed_xmlBase.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: atom feed with xml:base
-Expect: feed.link.spec == "http://www.example.com/foo/bar/baz";
-
--->
-<feed xmlns="http://www.w3.org/2005/Atom"
- xml:base="http://www.example.com/foo/bar/">
-
- <id>tag:example.com,2006:/atom/conformance/linktest/</id>
- <title>Atom Link Tests</title>
- <updated>2005-06-18T16:13:00Z</updated>
- <link href="baz" />
-
- <entry xml:base="http://www.example.org">
- <id>tag:example.org,2006:/linkreltest/1</id>
- <title>Does your reader support xml:base properly? </title>
- <updated>2006-06-23T12:12:12Z</updated>
- <link xml:base="/bar/" href="foo"/>
- </entry>
-
-</feed>
diff --git a/toolkit/components/feeds/test/xml/rss09x/rss090.xml b/toolkit/components/feeds/test/xml/rss09x/rss090.xml
deleted file mode 100644
index 783c018f4..000000000
--- a/toolkit/components/feeds/test/xml/rss09x/rss090.xml
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
-Description: RSS 0.90 works
-Expect: feed.title.plainText() == "Mozilla Dot Org" && result.version == "rss090"
-
--->
-<!-- The very first RSS file, circa 1999 -->
-<rdf:RDF
-xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-xmlns="http://my.netscape.com/rdf/simple/0.9/">
-
- <channel>
- <title>Mozilla Dot Org</title>
- <link>http://www.mozilla.org</link>
- <description>the Mozilla Organization web site</description>
- </channel>
-
- <image>
- <title>Mozilla</title>
- <url>http://www.mozilla.org/images/moz.gif</url>
- <link>http://www.mozilla.org</link>
- </image>
-
- <item>
- <title>New Status Updates</title>
- <link>http://www.mozilla.org/status/</link>
- </item>
-
- <item>
- <title>Bugzilla Reorganized</title>
- <link>http://www.mozilla.org/bugs/</link>
- </item>
-
- <item>
- <title>Mozilla Party, 2.0!</title>
- <link>http://www.mozilla.org/party/1999/</link>
- </item>
-
- <item>
- <title>Unix Platform Parity</title>
- <link>http://www.mozilla.org/build/unix.html</link>
- </item>
-
- <item>
- <title>NPL 1.0M published</title>
- <link>http://www.mozilla.org/NPL/NPL-1.0M.html</link>
- </item>
-
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss09x/rss091.xml b/toolkit/components/feeds/test/xml/rss09x/rss091.xml
deleted file mode 100644
index 6749fc49e..000000000
--- a/toolkit/components/feeds/test/xml/rss09x/rss091.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE rss SYSTEM "http://my.netscape.com/publish/formats/rss-0.91.dtd">
-<!--
-
-Description: RSS 0.91 works
-Expect: feed.title.plainText() == "Scripting News" && result.version == "rss091"
-
--->
-<rss version="0.91">
- <channel>
- <language>en</language>
- <description>
- News and commentary from the cross-platform scripting community.
- </description>
- <link>http://www.scripting.com/</link>
- <title>Scripting News</title>
- <image>
- <link>http://www.scripting.com/</link>
- <title>Scripting News</title>
- <url>http://www.scripting.com/gifs/tinyScriptingNews.gif</url>
- </image>
- <item>
- <title>stuff</title>
- <link>http://bar.example.com</link>
- <description>This is an article about some stuff</description>
- </item>
- </channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss09x/rss091_withNS.xml b/toolkit/components/feeds/test/xml/rss09x/rss091_withNS.xml
deleted file mode 100644
index 9ab2c3bf7..000000000
--- a/toolkit/components/feeds/test/xml/rss09x/rss091_withNS.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE rss SYSTEM "http://my.netscape.com/publish/formats/rss-0.91.dtd">
-<!--
-
-Description: RSS 0.91 works
-Expect: feed.title.plainText() == "Scripting News" && result.version == "rss091"
-
--->
-<rss version="0.91" xmlns="http://backend.userland.com/RsS2">
- <channel>
- <language>en</language>
- <description>
- News and commentary from the cross-platform scripting community.
- </description>
- <link>http://www.scripting.com/</link>
- <title>Scripting News</title>
- <image>
- <link>http://www.scripting.com/</link>
- <title>Scripting News</title>
- <url>http://www.scripting.com/gifs/tinyScriptingNews.gif</url>
- </image>
- <item>
- <title>stuff</title>
- <link>http://bar.example.com</link>
- <description>This is an article about some stuff</description>
- </item>
- </channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss09x/rss092.xml b/toolkit/components/feeds/test/xml/rss09x/rss092.xml
deleted file mode 100644
index ed68bd64f..000000000
--- a/toolkit/components/feeds/test/xml/rss09x/rss092.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
-Description: RSS 0.92 works
-Expect: feed.title.plainText() == "Scripting News" && result.version == "rss092"
-
--->
-<rss version="0.92">
- <channel>
- <language>en</language>
- <description>
- News and commentary from the cross-platform scripting community.
- </description>
- <link>http://www.scripting.com/</link>
- <title>Scripting News</title>
- <image>
- <link>http://www.scripting.com/</link>
- <title>Scripting News</title>
- <url>http://www.scripting.com/gifs/tinyScriptingNews.gif</url>
- </image>
- <item>
- <title>stuff</title>
- <link>http://bar.example.com</link>
- <description>This is an article about some stuff</description>
- </item>
- </channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss09x/rss093.xml b/toolkit/components/feeds/test/xml/rss09x/rss093.xml
deleted file mode 100644
index f1bb81ddf..000000000
--- a/toolkit/components/feeds/test/xml/rss09x/rss093.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
-Description: RSS 0.93 works
-Expect: feed.title.plainText() == "Scripting News" && result.version == "rss093"
-
--->
-<rss version="0.93">
- <channel>
- <language>en</language>
- <description>
- News and commentary from the cross-platform scripting community.
- </description>
- <link>http://www.scripting.com/</link>
- <title>Scripting News</title>
- <image>
- <link>http://www.scripting.com/</link>
- <title>Scripting News</title>
- <url>http://www.scripting.com/gifs/tinyScriptingNews.gif</url>
- </image>
- <item>
- <title>stuff</title>
- <link>http://bar.example.com</link>
- <description>This is an article about some stuff</description>
- </item>
- </channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss09x/rss094.xml b/toolkit/components/feeds/test/xml/rss09x/rss094.xml
deleted file mode 100644
index 1c2b17a24..000000000
--- a/toolkit/components/feeds/test/xml/rss09x/rss094.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
-Description: RSS 0.94 works
-Expect: feed.title.plainText() == "Scripting News" && result.version == "rss094"
-
--->
-<rss version="0.94">
- <channel>
- <language>en</language>
- <description>
- News and commentary from the cross-platform scripting community.
- </description>
- <link>http://www.scripting.com/</link>
- <title>Scripting News</title>
- <image>
- <link>http://www.scripting.com/</link>
- <title>Scripting News</title>
- <url>http://www.scripting.com/gifs/tinyScriptingNews.gif</url>
- </image>
- <item>
- <title>stuff</title>
- <link>http://bar.example.com</link>
- <description>This is an article about some stuff</description>
- </item>
- </channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss09x/rssUnknown.xml b/toolkit/components/feeds/test/xml/rss09x/rssUnknown.xml
deleted file mode 100644
index 653b574d0..000000000
--- a/toolkit/components/feeds/test/xml/rss09x/rssUnknown.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
-Description: RSS unknown version works
-Expect: feed.title.plainText() == "Scripting News" && result.version == "rssUnknown"
-
--->
-<rss version="0.95">
- <channel>
- <language>en</language>
- <description>
- News and commentary from the cross-platform scripting community.
- </description>
- <link>http://www.scripting.com/</link>
- <title>Scripting News</title>
- <image>
- <link>http://www.scripting.com/</link>
- <title>Scripting News</title>
- <url>http://www.scripting.com/gifs/tinyScriptingNews.gif</url>
- </image>
- <item>
- <title>stuff</title>
- <link>http://bar.example.com</link>
- <description>This is an article about some stuff</description>
- </item>
- </channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_bogus_title.xml b/toolkit/components/feeds/test/xml/rss1/feed_bogus_title.xml
deleted file mode 100644
index a28952495..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_bogus_title.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ bogus title element
-Expect: feed.title.text == 'Correct Title'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
-
-
-
- <title>Bogus</title>
-
-
-
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Correct Title</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
-
-
-
- <title>Bogus</title>
-
-
-
- <item>
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet.
- </dc:description>
- </item>
- <item>
- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet 2.
- </dc:description>
- <title>XML: A Disruptive Technology</title>
- </item>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_description.xml b/toolkit/components/feeds/test/xml/rss1/feed_description.xml
deleted file mode 100644
index 109b8f949..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_description.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed description works
-Expect: feed.fields.getProperty('rss1:description') == 'a description'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
->
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <description>a description</description>
- </channel>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_description_normalized.xml b/toolkit/components/feeds/test/xml/rss1/feed_description_normalized.xml
deleted file mode 100644
index 44154b9f1..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_description_normalized.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed description works normalized
-Expect: feed.subtitle.text == 'a description'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
->
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <description>a description</description>
- </channel>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_description_with_dc.xml b/toolkit/components/feeds/test/xml/rss1/feed_description_with_dc.xml
deleted file mode 100644
index 4e5b1637a..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_description_with_dc.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed description works normalized
-Expect: feed.subtitle.text == 'a description'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'
->
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- <description>a description</description>
- </channel>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_description_with_dc_only.xml b/toolkit/components/feeds/test/xml/rss1/feed_description_with_dc_only.xml
deleted file mode 100644
index fa1ecd59a..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_description_with_dc_only.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed description works normalized
-Expect: feed.subtitle.plainText() == 'another description'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_generator.xml b/toolkit/components/feeds/test/xml/rss1/feed_generator.xml
deleted file mode 100644
index 07ec85321..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_generator.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-
-<!--
-
-Description: RSS1 generator
-Expect: feed.generator.agent == "http://Orchard.SourceForge.net/1.2/"
-
--->
-
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:admin="http://webns.net/mvcb/"
- xmlns="http://purl.org/rss/1.0/">
-
- <channel rdf:about="http://meerkat.oreillynet.com/?_fl=rss1.0">
- <title>Meerkat</title>
- <link>http://meerkat.oreillynet.com</link>
- <description>Meerkat: An Open Wire Service</description>
- <admin:errorReportsTo rdf:resource="mailto:channel-owner@acme.orgs"/>
- <admin:generatorAgent rdf:resource="http://Orchard.SourceForge.net/1.2/"/>
-
- <image rdf:resource="http://meerkat.oreillynet.com/icons/meerkat-powered.jpg" />
-
- <items>
- <rdf:Seq>
- <rdf:li rdf:resource="http://c.moreover.com/click/here.pl?r123" />
- </rdf:Seq>
- </items>
-
- <textinput rdf:resource="http://meerkat.oreillynet.com/" />
-
- </channel>
-
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_id.xml b/toolkit/components/feeds/test/xml/rss1/feed_id.xml
deleted file mode 100644
index 8f118102a..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_id.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ feed rdf:about
-Expect: feed.id == 'http://www.xml.com/xml/news.rss'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item rdf:about="http://example.com/hmm">
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical
- infrastructure of the Internet.
- </dc:description>
- </item>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_image.xml b/toolkit/components/feeds/test/xml/rss1/feed_image.xml
deleted file mode 100644
index c293acc3f..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_image.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ image
-Expect: ((feed.image.getProperty('rss1:link') == 'http://www.xml.com') && (feed.image.getProperty('rss1:url') == 'http://xml.com/universal/images/xml_tiny.gif'))
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
-
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- <textInput rdf:resource="http://www.google.com"/>
- </channel>
-
- <image rdf:about="http://xml.com/universal/images/xml_tiny.gif">
- <title>XML.com</title>
- <link>http://www.xml.com</link>
- <url>http://xml.com/universal/images/xml_tiny.gif</url>
- </image>
-
- <item>
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical
- infrastructure of the Internet.
- </dc:description>
- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>
- </item>
-
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_items_length_zero.xml b/toolkit/components/feeds/test/xml/rss1/feed_items_length_zero.xml
deleted file mode 100644
index a935b9ad9..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_items_length_zero.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ zero items count
-Expect: feed.items.length == 0
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_link.xml b/toolkit/components/feeds/test/xml/rss1/feed_link.xml
deleted file mode 100644
index f304a63e8..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_link.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed title works normalized
-Expect: feed.fields.getProperty('rss1:link') == 'http://xml.com/pub'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
->
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- </channel>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_link_normalized.xml b/toolkit/components/feeds/test/xml/rss1/feed_link_normalized.xml
deleted file mode 100644
index ba9674746..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_link_normalized.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed link works normalized
-Expect: feed.link.spec == 'http://xml.com/pub'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
->
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- </channel>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_textInput.xml b/toolkit/components/feeds/test/xml/rss1/feed_textInput.xml
deleted file mode 100644
index ea5639477..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_textInput.xml
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ textinput
-Expect: feed.textInput.getProperty('rdf:about') == 'http://search.xml.com'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
-
- <textinput rdf:about="http://search.xml.com">
- <title>Search XML.com</title>
- <description>Search XML.com's XML collection</description>
- <name>s</name>
- <link>http://search.xml.com</link>
- </textinput>
-
- <item>
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical
- infrastructure of the Internet.
- </dc:description>
- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>
- </item>
- <item>
-
- </item>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_title.xml b/toolkit/components/feeds/test/xml/rss1/feed_title.xml
deleted file mode 100644
index 121545d38..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_title.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed title works
-Expect: feed.fields.getProperty('rss1:title') == 'Test'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
->
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- </channel>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_title_extra_att.xml b/toolkit/components/feeds/test/xml/rss1/feed_title_extra_att.xml
deleted file mode 100644
index b24550696..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_title_extra_att.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed title works
-Expect: feed.fields.getProperty('rss1:title') == 'Test'
-
--->
-<rdf:RDF
- xmlns:foo="http://example.org"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
->
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title foo:bar="baz">Test</title>
- </channel>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_title_normalized.xml b/toolkit/components/feeds/test/xml/rss1/feed_title_normalized.xml
deleted file mode 100644
index 5bd6ccefd..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_title_normalized.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed title works normalized
-Expect: feed.title.plainText() == 'Test'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
->
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- </channel>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_updated.xml b/toolkit/components/feeds/test/xml/rss1/feed_updated.xml
deleted file mode 100644
index 4aed87e98..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_updated.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed updated
-Expect: feed.updated == 'Sat, 07 Sep 2002 00:00:01 GMT'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- <dc:date>Sat, 07 Sep 2002 00:00:01 GMT</dc:date>
- </channel>
- <item rdf:about="http://example.com/hmm">
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical
- infrastructure of the Internet.
- </dc:description>
- </item>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_updated_dctermsmodified.xml b/toolkit/components/feeds/test/xml/rss1/feed_updated_dctermsmodified.xml
deleted file mode 100644
index 24b9fc92c..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_updated_dctermsmodified.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed updated
-Expect: feed.updated == 'Sat, 07 Sep 2002 00:00:01 GMT'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'
- xmlns:dcterms='http://purl.org/dc/terms/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- <dcterms:modified>Sat, 07 Sep 2002 00:00:01 GMT</dcterms:modified>
- </channel>
- <item rdf:about="http://example.com/hmm">
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical
- infrastructure of the Internet.
- </dc:description>
- </item>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/feed_version.xml b/toolkit/components/feeds/test/xml/rss1/feed_version.xml
deleted file mode 100644
index 8147a970c..000000000
--- a/toolkit/components/feeds/test/xml/rss1/feed_version.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 Version works
-Expect: result.version == 'rss1'
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
->
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- </channel>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/full_feed.xml b/toolkit/components/feeds/test/xml/rss1/full_feed.xml
deleted file mode 100644
index 7dae34c85..000000000
--- a/toolkit/components/feeds/test/xml/rss1/full_feed.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<!--
-
-Description: atom generator works
-Expect: result.bozo == true && feed.items.length == 1
-
--->
-<rdf:RDF
-xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-xmlns:dc="http://purl.org/dc/elements/1.1/"
-xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
-xmlns:admin="http://webns.net/mvcb/"
-xmlns:cc="http://web.resource.org/cc/"
-xmlns="http://purl.org/rss/1.0/">
-
-<channel rdf:about="http://example.org/">
-<title>fooo</title>
-<link>http://weblogs.example.org/</link>
-<description>fooooooo</description>
-<dc:language>en-us</dc:language>
-<dc:creator></dc:creator>
-<dc:date>2006-04-10T08:38:18-08:00</dc:date>
-<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=3.2" />
-
-
-<items>
-<rdf:Seq>
-<rdf:li rdf:resource="http://weblogs.example.org/archives/009698.html" />
-</rdf:Seq>
-
-</items>
-
-</channel>
-<item rdf:about="http://weblogs.example.org/archives/009698.html">
-<title>Come From?</title>
-<link>http://example.org/009698.html</link>
-<description><![CDATA[
- %G–%@ much of the code
-]]></description>
-<dc:date>2006-02-06T10:19:03-08:00</dc:date>
-</item>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/full_feed_not_bozo.xml b/toolkit/components/feeds/test/xml/rss1/full_feed_not_bozo.xml
deleted file mode 100644
index 61ae8a220..000000000
--- a/toolkit/components/feeds/test/xml/rss1/full_feed_not_bozo.xml
+++ /dev/null
@@ -1,354 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: Full RSS1 feed not bozo
-Expect: result.bozo == false
-
--->
-<rdf:RDF
-xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-xmlns:dc="http://purl.org/dc/elements/1.1/"
-xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
-xmlns:admin="http://webns.net/mvcb/"
-xmlns:cc="http://web.resource.org/cc/"
-xmlns="http://purl.org/rss/1.0/">
-
-<channel rdf:about="http://weblogs.mozillazine.org/ben/">
-<title>Inside Firefox</title>
-<link>http://weblogs.mozillazine.org/ben/</link>
-<description>The Inside Track on Firefox Development</description>
-<dc:language>en-us</dc:language>
-<dc:creator></dc:creator>
-<dc:date>2006-04-26T14:34:49-08:00</dc:date>
-<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=3.2" />
-
-
-<items>
-<rdf:Seq><rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/010115.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/010109.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/010075.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/010074.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/010073.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/010040.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/010030.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/010011.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/009965.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/009964.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/009943.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/009924.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/009914.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/009804.html" />
-<rdf:li rdf:resource="http://weblogs.mozillazine.org/ben/archives/009774.html" />
-</rdf:Seq>
-</items>
-
-</channel>
-
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/010115.html">
-<title>Firefox 2 Is Cool</title>
-<link>http://weblogs.mozillazine.org/ben/archives/010115.html</link>
-<description><![CDATA[<p>A lot of people read my previous post and came to a very reasonable conclusion: "If you take Places out of Firefox 2, shouldn't it be called Firefox 1.6?"</p>
-
-<p>I don't agree that Places was the one and only thing that sold Firefox 2 though. I took a look through the <a href="http://wiki.mozilla.org/Firefox2/Requirements">Firefox 2 Requirements</a> page to look at some of the other stuff that's going on. Reading that document, I think I can see now why people are down in the dumps about no-places Firefox 2. I don't think that document necessarily does the best possible job of capturing the excitement I have about some of the Firefox 2 features we're pursuing. </p>
-
-<p>For the past week or so, I've been toting around a printout of another document, which I wrote because I wanted to convey some of the vision I have of the Firefox 2 product as a whole - a more holistic view as it were. </p>
-
-<h3>Safer, Faster, Better</h3>
-
-<p>If you take a look at the black buttons stacked in the right column of this page, you'll see that one of them reads "Safer, Faster, Better." I don't knowwho came up with that one but it's a good tag line. It has a certain cadence about it. People have attached lots of these to Firefox in the past - "Take Back the Web" was the one I came up with, there's "Rediscover the Web", the FirefoxFlicks project has yielded a few good ones too - I like "<a href="http://www.firefoxflicks.com/flick/index.php?sort=new&id=21122&c=false">Web For All</a>". But "Safer, Faster, Better" is not just a tag line, it can also map into a set of themes for product development. </p>
-
-<p>So, taking a look at the Requirements page, I attempted to do that. My document wasn't a comprehensive collection of everything on that page, I was focused more on the things immediately visible to most users. I guess my problem with the Requirements page has always been its very engineering/technical focus. The result of this is that the priority of items tend to reflect how difficult something is to implement, or where it lies in the development cycle, not necessarily the impact on the user. What I ended up with I guess is a sort of "Shadow PRD" that reflects what I personally thought was cool about Firefox 2, and what I wanted to get out of it. </p>
-
-<p>A copy of the document is <a href="http://www.bengoodger.com/software/mb/2.0/firefox2-vision.html">here</a>. <br />
-Some notes:</p>
-
-<ul>
- <li>Assume the scratched out section for "Retracing Your Steps" will be part
- of a future release.
- <li>The priorities shown are my opinion, and relate to potential impact on
- the user.
- <li>The document does not represent all of the work being done, just a
- readily marketable subset.
-</ul>
-
-<p>All in all, I think there's easily enough here to justify a "2" designation. That's just my opinion though. I also think whole numbers are probably easier for the general populace to understand than decimals. </p>
-
-<p>Firefox has never been about date driven development (within reason). The changes with Places should not be seen as a change in this sentiment. What we're about is high quality software development with real advantages to <br />
-users, and I think that with the updated plan we're still on a trajectory that supports and encourages that, perhaps more firmly now than before.</p>
-
-<p>And that's it from today's "Ben waits for the tinderboxen to clear" report. </p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-04-26T14:34:49-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/010109.html">
-<title>Firefox 2 Content Update</title>
-<link>http://weblogs.mozillazine.org/ben/archives/010109.html</link>
-<description><![CDATA[<p>When we began work on Firefox 2, we decided to focus on a development branch, a continuation of the Mozilla 1.8 branch. The reason for doing this was that there was to be a lot of significant architectural changes going on on the trunk, with the prospect of a new rendering back end, a rearchitecture of reflow in layout, and various other things. Shipping a Firefox 2 release in 2006 off of this code did not seem possible. </p>
-
-<p>As a result, we decided to pursue a release focused on application level improvements, on a separate branch. Going into it, we knew the perils of multi-branch development. We knew the divergences that would inevitably form between branch and trunk. We had experience from the painful development of Firefox 1.0 on the Aviary branch. We resolved to be more methodical about our commits, but we knew to expect some pain. The goal was to produce a high value release in short enough time so that we could all return to the trunk and help build new features that utilize the back end being developed there, to help shake them out. </p>
-
-<p>Late last year, we put together a list of things to pursue for the Firefox 2 release. A month or so ago, we got together as a group and formalized this more in a <a href="http://wiki.mozilla.org/Firefox2/Requirements">Firefox 2 PRD</a>. We had scheduled four major pre-release milestones, two alphas and two betas. We have already shipped one alpha. The intent of the second is to be "Feature Complete".</p>
-
-<p>The people driving the various sub-projects on the Requirements list get together weekly to check status. As the weeks have gone by, it has become clear to us that the most complex feature on the plan is Places. It is easily an order of magnitude more complex than anything else on the plan. Places is a great feature and it has been exciting watching its capabilities grow. We are looking forward to the capabilities that it will expose. What we have learned though is that the work required to complete Places is probably too substantial to gate the Firefox 2 release. It falls more into the "significant rearchitecture" category of feature that's generally been targeted at Firefox 3.</p>
-
-<p>What we have decided to do is as follows:</p>
-
-<ul>
-<li>We will disable places on the 1.8 branch, reverting the user interface and back end to Firefox 1.x functionality.
-<li>We will continue to aggressively develop the capabilities of Places on the 1.9 trunk. Places will remain enabled here.
-</ul>
-
-<p>We think this is a good decision for two reasons:</p>
-
-<ul>
-<li>It reduces the pressure on the Places team to deliver a lot of bug fixes and additional features on the very immediate timeframe required by the Firefox 2 testing releases. It is my opinion that doing so would impact the quality of the feature, if we did not add at least a couple more alpha cycles to the process. This decision provides us with an opportunity to really make the architecture and user interface of Places reach their full potential.
-<li>It allows us as a group to circle around and consider the content of the Firefox 2 release holistically, identify high impact at risk areas and spend some more time on them. One of those for me was Feed Handling.
-</ul>
-
-<p>Michael Schroepfer of the Mozilla Corporation has a <a href="http://groups.google.com/group/mozilla.dev.planning/browse_frm/thread/4b8e7bafecccbc10/8997efd5d5d5f03f">newsgroup posting</a> with additional information. His thread is also the most appropriate forum for discussion of this topic. </p>
-
-<p>I have been working on refining some of the messaging surrounding feature content and prioritization on the PRD. I will post the initial results of that here soon.</p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-04-24T09:30:54-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/010075.html">
-<title>Did I Mention...</title>
-<link>http://weblogs.mozillazine.org/ben/archives/010075.html</link>
-<description><![CDATA[<p>... that I hate this computer?</p>
-
-<p>While I'm at it... the up arrow key cap fell off after about three weeks, in early 2004. About six months later I lost the little rubber membrane thing that made it slightly easier to push the arrow. Since then, I've been typing by pushing down on the little connection thingy on the keyboard tray. </p>
-
-<p>It's been shedding pieces of plastic too. I've never dropped the computer once, but pieces of the shell have begun to snap off. </p>
-
-<p>When I first got it, when the secondary battery was in place, when the primary drained the machine would hibernate, even though the secondary was present! Pretty awful bug to ship with. There was never a solution that I could find. Speaking of batteries, the primary battery is pretty much toast... it won't go for more than 5 minutes before shutting down. It began doing this at around the 12-18 month mark. And the battery light permanently flashes orange whenever the system is on. </p>
-
-<p>Why don't I call the hotline? I guess I'll have to, before my warranty runs out. I don't because it usually involves 45 minutes on hold or explaining to someone who only has a script to read from that the issue involving a missing up arrow doesn't require restarting Windows or running some stupid diagnostic tool. I could have paid more for "premium support" at build-time but I found that concept sort of insulting: why should I have to pay extra to speak to someone who is smart and doesn't think I'm a moron?</p>
-
-<p>And I don't want a Thinkpad either. I hate those computers. They have old-fashioned 4:3 displays, and the function key and left Ctrl key are reversed. I know I could map them differently but why would I? Why couldn't IBM just have designed the product correctly in the first place? Oh, and I'd sooner drink paint than run the awful IBM access connections software to connect to a wireless network, or deal with the fact that the Num Lock key seems to reset to ON every time the system is rebooted.</p>
-
-<p>Why doesn't someone make the perfect laptop? I'd be interested to hear from someone how long the compile times are for FirefoxDebug on a 2.16GHz MacBook Pro...</p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-04-16T19:11:28-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/010074.html">
-<title>I Hate This Computer</title>
-<link>http://weblogs.mozillazine.org/ben/archives/010074.html</link>
-<description><![CDATA[<p>I have been fighting with this computer for the past few days to do a build with a few patches applied. </p>
-
-<p>First, I managed to get a certain distance with a branch build, compiling with Visual C++ 6.0. But soon I realized there were too many dependencies that were trunk specific, so I had to build trunk. About a quarter of the way through my build died, of course, compiling from the same shell, wrong version of VC6.0 for Cairo/Thebes. </p>
-
-<p>Starting over again with the VC7 tools, another failure towards the end. Some sort of cyclic dependency check error. Clobber and restart. Now I forgot one of my patches had a configure change, and the process begins anew, I have effectively clobbered. </p>
-
-<p><a href="http://weblogs.mozillazine.org/ben/archives/2003_12.html">When I bought this machine</a>, a Dell Precision M60 with a Pentium M 1.7GHz processor, a 7200rpm disk and a gig of RAM, it could compile Firefox start to stop in 21 minutes. Now it takes over an hour.</p>
-
-<p>The situation is better on my Google-supplied workstation, but for how long? Over time, Windows reaches a point of being completely useless for anything aside from the most basic activities. What's the effect? I had planned to work both days this weekend on Firefox 2 features. Instead I spent the whole time fighting one of the most frustrating fights possible, and have achieved nothing. I hate Windows. I hate this computer.</p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-04-16T18:58:02-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/010073.html">
-<title>Miscommunications</title>
-<link>http://weblogs.mozillazine.org/ben/archives/010073.html</link>
-<description><![CDATA[<p>My laptop was running pretty slowly yesterday so I decided to scan the Add/Remove Programs list to clear out the cruft. Things were really chugging along. I sequentially uninstalled several pieces of software, and the process was very dissatisfying. I became more and more enfuriated at my computer as it proceeded. Here are some of the nuisances:</p>
-
-<ul>
-<li>I could only remove one thing at a time.
-<li>Many pieces of software used the Windows Installer system which seemed to take forever and report very inconsistent progress (I know, Firefox isn't the best at this in its installer, either)
-<li>Most annoyingly, the uninstaller apps all reported themselves as performing a variety of actions that I never requested, as explanations for what they were doing during long periods of inactivity and progress-bar freeze. Common excuses were "Windows is Configuring <blah>" and "InstallShield is preparing a report on <bleh>".
-</ul>
-
-<p>You know, I never <strong>asked</strong> for blah to be "configured." I never asked for a report on bleh (What am I, a manager? Where is the report anyway? Does it have the appropriate cover sheet?) <strong>I just want the software gone</strong>. I'm getting really tired of excuses from software like this. Windows software seems to be getting worse and worse. On Mac, the typical way to remove a program is to drag it into the trash can. I can even do that to several programs at once! I do however have to be able to afford a Mac (I can, I have one). Many folk aren't as fortunate as I. </p>
-
-<p>As a side note, I read an interesting article in Forbes a few weeks ago criticizing Microsoft for its delays shipping Vista, and asking why wouldn't you just side-step all the trouble and buy a Mac, since the odds were good many people would have to upgrade their PC anyway just to get the whiz-bang in Vista. The article side-swiped open source desktop initiatives, asking where the viable free alternative was. I think that was an interesting point, and especially so since the capabilities of Linux systems have come an awesome distance in the past few years but there have been few distributions or desktop environments that IMO make the most of all of those.</p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-04-16T18:05:04-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/010040.html">
-<title>Firefox Version Numbers</title>
-<link>http://weblogs.mozillazine.org/ben/archives/010040.html</link>
-<description><![CDATA[<p>Mike Beltzner <a href="http://www.beltzner.ca/mike/archives/2006/04/10/when_3_is_less_than_2.html">explains</a> Firefox version numbering. i.e. Firefox 3 RTM is not "out".</p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-04-10T08:38:18-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/010030.html">
-<title>Our Next Challenge?</title>
-<link>http://weblogs.mozillazine.org/ben/archives/010030.html</link>
-<description><![CDATA[<p>The past year or so has been interesting. In this time, I've been able to meet a lot of new people and learn a lot of new things. Most importantly is that for the first time in as long as I can remember, I have had a chance to see the Mozilla project from the outside, as it would appear to someone who was trying to build on Mozilla technology or contribute directly to a project, but was not part of Netscape "back in the day" or an employee of the Mozilla Foundation/Corporation itself. </p>
-
-<p>It's been an illuminating experience. From a technical perspective, it helped highlight APIs that I had developed without a clear understanding of how they would be used. The Extension Installation API was one example of this, and we were able to make some great improvements to it in 2005.</p>
-
-<p>But perhaps more importantly it has shed some light on how people perceive Mozilla as an open source project. These perceptions are not the sort of things people express explicitly. You have to notice them.</p>
-
-<h3>The Difficulty of Involvement</h3>
-
-<p>This is sort of the uber-perception. I think some of the reasons for this include the following:</p>
-
-<h3>Where is the Discussion?</h3>
-
-<p>Which newsgroup/mailing list/IRC channel/wiki/talk page/bug/forum page do I need to track in order to know what's going on in a specific area? The answer is unsatisfactorily complex.</p>
-
-<p>The traditional method of joining a project in the OSS world (where you join lists and IRC channels and lurk for a while, gradually ramping up your contributions) scales uneasily to a project the size of Mozilla. The amount of data a mere mortal would have to absorb in order to be productive quickly is staggering. I have in the past jocularly referred to it as the "learning wall". I wonder how many people just give up. </p>
-
-<h3>Madness to Method?</h3>
-
-<p>As a large project, Mozilla has thousands of source files across hundreds of directories. One of my coworkers here at Google commented that he tried to find something as simple as the browser window code a couple of years ago and couldn't, because it lived under the thoughtfully named "xpfe". </p>
-
-<p>There's not a huge amount of documentation - and I'm not just talking about public API docs. I'm talking about the much needed diagrams that show how the various building blocks fit together, and in-code documentation for pretty much anything that isn't intuitive (which is a lot). I've written as little of this as anyone else.</p>
-
-<h3>Tone</h3>
-
-<p>In the past, I have not done the best I could to establish a tone for discourse that is conducive to productive development. My tendency was to snap when provoked. I made two mistakes of judgement here, one was ignoring the effect that this sort of thing would have on those watching, aside from the victim. The other was to think that regardless of the tone set by my actions, we as a group could work through any negative effects. Any work we relied on others for we could do ourselves. Or we could hire through it.</p>
-
-<h3>The Joy of Code</h3>
-
-<p>The flaw with this is that when your project's contributions come solely from companies, for better or for worse the activities of those paid contributors will align in some way with the interests of those companies. What this does not always allow for is the pursuit of the sort of improvements that are outside the scope of these interests. Such things often include raising general code quality, speculative feature development, feature polish and detail etc. I don't mean to say that companies are <em>against</em> these things, but they're often not the primary concern during a release crunch. And what companies like to have is shipping software. </p>
-
-<p>Alternately, even in the absence of corporate support, if there is not enough redundancy that the same set of folk has to do the grunt work over and over, the risk of burnout is high.</p>
-
-<p>I feel this because I have been incredibly "plan" focused over the past few years, formally during my time at Netscape and less formally but no less importantly during the run up to Firefox 1.0 and 1.5. What I notice is that I no longer have time to work on the sort of interesting side projects that I used to enjoy doing when I was first starting out. </p>
-
-<p>For example, about six years ago I discovered a bug in the Bookmarks menu shortly after scrolling was implemented. When you moused into a submenu for a folder that was in the scrolled section, the sub menu popup was pushed off the bottom of the screen. I took a couple of days to learn the menu positioning code and fix the math error that was causing the bug. The exercise was good for me in a number of ways: I learned more about another section of the code, my general expertise was raised, and well.. I fixed the bug that was bothering<br />
-me.</p>
-
-<p>I think we need to have a project that is accessible to volunteers for this reason. We also need to provide a way to allow those volunteers to grow if they want to, so that if you're one of the folk at the center you can have a chance to step aside for a moment and take a breather and code for the pure joy of it. </p>
-
-<p>Full time paid contributors will always be a part of Open Source development. But I don't think release-focused agendas will ever be a substitute for the passion of folk who participate because of the joy of exploration and of contribution. </p>
-
-<h3>Looking Outward, Looking Forward</h3>
-
-<p>As a project, we have made overtures towards being a more inclusive lot. For some of the reasons I've listed here, I think as a project we're still more inward looking than outward. How many of us have thought about what we want to be doing in 5 years? Will we always be doing this? Will our roles remain the same? My opinion is that it's fast becoming time for us to start considering making personal sacrifices in our short term conveniences to make the project more accessible to new people. Do I know what we need to do? Not exactly. But I have some ideas: find ways to make our discussions, our public faces, and our code more accessible.</p>
-
-<p>With Firefox we did an excellent job of building a world class product that people wanted to use. We have a new challenge now, one that is larger and scope and in the long run in my opinion considerably more important because the long term success of products like Firefox depend on it. How will we grow a world class development community? How will we ensure that the freedoms we enjoy are protected, forever?</p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-04-07T09:22:59-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/010011.html">
-<title>Congrats Relicensing Project!</title>
-<link>http://weblogs.mozillazine.org/ben/archives/010011.html</link>
-<description><![CDATA[<p><a href="http://weblogs.mozillazine.org/gerv/archives/2006/03/relicensing_complete.html">Gerv announces</a> that the Relicensing project is complete. Congrats Gerv and everyone else who doggedly pursued this over the years. Part of Mozilla's mission is preserving choice, and making our code available under a variety of flexible licenses helps ensure that by allowing other projects to make use of it. This was a formidable task and a great accomplishment. </p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-04-04T07:15:22-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/009965.html">
-<title>Producing Open Source Software</title>
-<link>http://weblogs.mozillazine.org/ben/archives/009965.html</link>
-<description><![CDATA[<p>I've been reading Karl Fogel's excellent <a href="http://www.producingoss.com/">Producing Open Source Software</a>. </p>
-
-<p>Karl's book is very well written, nice and compact (272 pages), and contains useful information for anyone doing anything in the Open Source world: both developers and managers. </p>
-
-<p>It will help people new to Open Source get a better understanding of how OSS projects are run. It will help people familiar with Open Source to get a better understanding of how to contribute more effectively.</p>
-
-<p>It's definitely a "must read."</p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-03-26T15:03:52-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/009964.html">
-<title>Writing for Busy People</title>
-<link>http://weblogs.mozillazine.org/ben/archives/009964.html</link>
-<description><![CDATA[<p>Back when I was in <a href="http://www2.ece.auckland.ac.nz/">University</a>, many of the lecturers stressed time and time again the importance of succinct, well organized writing. They said over and over that this was the best way to have your thoughts read and understood by decision makers. In fact, they scared us by saying that 70% of us would become managers sooner or later!</p>
-
-<p>Well, I can tell you that's sage advice. It's great when people make contributions in the form of ideas and proposals, but it's even better when they're written for busy people. Here are some examples:</p>
-
-<ul>
- <li>Making important points up front
- <li>Clear taxonomy of headings, and lots of them
- <li>Writing clearly and succinctly
- <li>No long, unbroken paragraphs or tracts of text.
- <li>Preferring bulleted lists with clear points to paragraphs.
- <li>Use of emphasis in formatting to make important things clear
-</ul>
-
-<p>These days, I find I don't have a lot of time to read everything carefully, so the better structured a document is, the more I get out of it. I frequently find I miss entire subsections or points of documents, even when there's relatively little text, because of incomplete organization. My eyes definitely glaze over when i see a large block of unbroken text with few headings. At the very least, it'd be very helpful if folk would structure their thoughts into: "Problem" and "Proposed Solution". </p>
-
-<p>Before you post, stop and think if you've written something in a way that'll allow others to get the most out of it. Communicating your ideas effectively means you may get a clearer and quicker response from other people. </p>]]></description>
-<dc:subject>Editorial</dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-03-26T14:48:04-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/009943.html">
-<title>Step 2: Ask Questions</title>
-<link>http://weblogs.mozillazine.org/ben/archives/009943.html</link>
-<description><![CDATA[<p>A healthy project is one where active contributors are always evaluating the project's progress, making sure it is headed in the right direction (usually stated in the project mission or goals). </p>
-
-<p>I think we could be better at this in Mozilla. I'm not suggesting people be assholes or anything, but I think some more pan-project analysis would be useful. </p>
-
-<p>Historically, I can point at a couple of groups of people who have attempted to do something like this. The <code>drivers@</code> group is one that looked beyond individual modules within Gecko to make sure that the right thing for the shipping products as a whole happened. The Firefox team is another example. By taking a holistic view, user experience was enhanced. </p>
-
-<p>I think contributors should not be afraid to poke their nose in other parts of the project and see how things are going. Ask questions. Learn more. Get involved in governance and management. If things don't seem intuitive, or a little arbitrary, ask, rather than assume it's for a good reason. One of the benefits of having an open, referencable set of discussion forums means that once you've answered a question once on the public forums, when someone else asks you can just give them a URL. </p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-03-22T17:27:14-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/009924.html">
-<title>Step 1: Public Discussions</title>
-<link>http://weblogs.mozillazine.org/ben/archives/009924.html</link>
-<description><![CDATA[<p>The first step on the pathway to open source project happiness is to have our discussions in the public. </p>
-
-<p>One of the things people have (rightly) criticized about Firefox and Mozilla development in the past is that too much happens mysteriously, behind closed doors. This was for a number of reasons that sounded sufficient at the time - it was expedient, people were sitting within shouting distance, mental laziness, etc. </p>
-
-<p>What poor communication breeds is a lack of understanding of procedures, priorities and such like. A healthy project is one where the contributors understanding where things are headed, and what parts they can play. It is one where newcomers can visit the project website and within the space of a few minutes get a decent understanding of how things work, and find out opportunities for them to participate. </p>
-
-<p>People don't want to contribute to projects where things happen "magically". I've learned this lesson in the past. </p>
-
-<p>To this end, I've been encouraging everyone to have public discussions on the <a href="https://lists.mozilla.org/listinfo">Mozilla Newsgroups/Mailing Lists</a>. For Firefox, the list is dev-apps-firefox@, and the newsgroup is mozilla.dev.apps.firefox. They are mirrored through <a href="http://groups.google.com/group/mozilla.dev.apps.firefox">Google Groups</a> for ease of browsing. We're planning on improving the theme for Firefox2, and rather than pursue this effort in a walled garden like last time, we're going to proceed in dev-themes@/mozilla.dev.themes. Come on over and join in!</p>
-
-<p>At the same time, we've been encouraging other projects to use the newsgroups/lists too. Decisions made in private email, IRC (which isn't archived anywhere) even in public bugs etc make it very difficult for people who aren't central to the project to find out more or participate. I think we should strive to strike a better balance between convenience and accessibility/referencability. </p>
-
-<p>On top of this, there is a need to make the contact portions of the web site more accurate, relevant and easy to find, so people can easily find the list they want, and the person or group to contact. </p>
-
-<p>We've been having discussions about all of this in <a href="http://groups.google.com/group/mozilla.dev.general">mozilla.dev.general</a>, in <a href="http://groups.google.com/group/mozilla.dev.general/browse_thread/thread/899917f713861f06/4ae6d094ffee5ae7">these</a> <a href="http://groups.google.com/group/mozilla.dev.general/browse_thread/thread/5d1bf2bbc769919d/210246003f1f6fea">threads</a>. Rather than talk in a vacuum of only ourselves, I really hope that those of you that have experienced difficulty in the past in some of these areas will come forward and contribute to the discussion. </p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-03-20T09:23:24-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/009914.html">
-<title>Reflection</title>
-<link>http://weblogs.mozillazine.org/ben/archives/009914.html</link>
-<description><![CDATA[<p>I've been doing a bit of it lately. All manner of topics. We recently moved and things have been chaotic so it's been nice to take the time to think. I've had a chance to look at how far we've come, and form some ideas about what we might need to do to go the right places. </p>
-
-<p>The past couple of years have brought some immense highs, and some considerable angst. With success has come the realization that true now as ever: the spirit of open source is expressed through the creative freedom of the many. The surest way to navigate the murky waters of increased attention and marketshare and such like is, as Leslie has been saying for some time, to keep your karma clean. Do the right thing, not only in technical matters but also relationships. </p>
-
-<p>For the Mozilla project, what we need to do (I think) is:</p>
-
-<ul>
- <li>Better define the things that are important to us. The things that define who we are. Impart the positive aspects of open development culture and practice on everyone involved because they're effective, and as a safeguard against recurrence of some of the <a href="http://weblogs.mozillazine.org/ben/archives/009698.html">troubles of the past</a>.
- <li>Engage the community more effectively. Create and maintain an infrastructure of open communication to remove the "mystery" behind the decision making process. Organize our contributor materials better to make the project more accessible to newcomers. These are just a couple of examples.
-</ul>
-
-<p>For my part, I'm starting out this year by doing things <a href="http://www.producingoss.com/">a little differently</a>. I think we need to grow more as a project. I'm hopeful that I'll be able to achieve some positive change. </p>
-
-<p>I understand that this post might seem a little abstract. I think what I'm saying might become a bit more clear after I talk about some tangible efforts, which I will do in future entries.</p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-03-19T02:00:07-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/009804.html">
-<title>Bye Bye Blackberry?</title>
-<link>http://weblogs.mozillazine.org/ben/archives/009804.html</link>
-<description><![CDATA[<p><a href="http://news.com.com/Bye-bye%2C+BlackBerry+-+page+2/2100-1047_3-6042308-2.html?tag=st.num">Bye Bye, Blackberry?</a></p>
-
-<p>I cannot believe people are discussing life without these things. It's like this: I have a patent on television. I don't plan on doing anything with it, but I'm going to shut TV down for all of you, and you're going to sit about and think about life without TV? What's wrong with people?! Is this the world we all want to live in, where people without the interest or capability to pursue technology can hold everyone else captive? That's not the world I want to live in. <br />
-</p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-02-24T10:57:32-08:00</dc:date>
-</item>
-<item rdf:about="http://weblogs.mozillazine.org/ben/archives/009774.html">
-<title>More on Memory</title>
-<link>http://weblogs.mozillazine.org/ben/archives/009774.html</link>
-<description><![CDATA[<p>Firefox's caching behavior is just one area of memory usage. I'm really glad that there's been such a lot of discussion in the previous post I made, since many people have raised specific issues, bugs have been filed, and people are looking at the things people are reporting. This sort of feedback system is one of the things that makes the open development model great. Firefox 2 will be much better because of your help!</p>]]></description>
-<dc:subject></dc:subject>
-<dc:creator>ben</dc:creator>
-<dc:date>2006-02-17T23:44:03-08:00</dc:date>
-</item>
-
-
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/full_feed_unknown_extension.xml b/toolkit/components/feeds/test/xml/rss1/full_feed_unknown_extension.xml
deleted file mode 100644
index c2c875b14..000000000
--- a/toolkit/components/feeds/test/xml/rss1/full_feed_unknown_extension.xml
+++ /dev/null
@@ -1,55 +0,0 @@
-<!--
-
-Description: rss1 unknown elements does not cause error
-Expect: feed.items.length == 1
-
--->
-<rdf:RDF
-xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
-xmlns:dc="http://purl.org/dc/elements/1.1/"
-xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
-xmlns:admin="http://webns.net/mvcb/"
-xmlns:cc="http://web.resource.org/cc/"
-xmlns="http://purl.org/rss/1.0/">
-
-<channel rdf:about="http://example.org/">
-<title>fooo</title>
-<link>http://weblogs.example.org/</link>
-<description>fooooooo</description>
-<dc:language>en-us</dc:language>
-<dc:creator></dc:creator>
-<dc:date>2006-04-10T08:38:18-08:00</dc:date>
-<admin:generatorAgent rdf:resource="http://www.movabletype.org/?v=3.2" />
-
-
-
-
-
-
-
-<foo:bar xmlns:foo="http://example.org">baz</foo:bar>
-
-
-
-
-
-
-
-
-
-
-<items>
-<rdf:Seq>
-<rdf:li rdf:resource="http://weblogs.example.org/archives/009698.html" />
-</rdf:Seq>
-
-</items>
-
-</channel>
-<item rdf:about="http://weblogs.example.org/archives/009698.html">
-<title>Come From?</title>
-<link>http://example.org/009698.html</link>
-<description><![CDATA[much of the code]]></description>
-<dc:date>2006-02-06T10:19:03-08:00</dc:date>
-</item>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/item_2_dc_description.xml b/toolkit/components/feeds/test/xml/rss1/item_2_dc_description.xml
deleted file mode 100644
index 03a4bb548..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_2_dc_description.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ item 2 dc:description
-Expect: feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).fields.getProperty('dc:description') == 'XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet 2.'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item>
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet.
- </dc:description>
- <!-- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>-->
- </item>
- <item>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet 2.
- </dc:description>
- <title>XML: A Disruptive Technology</title>
- </item>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/item_2_dc_publisher.xml b/toolkit/components/feeds/test/xml/rss1/item_2_dc_publisher.xml
deleted file mode 100644
index d21734d6f..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_2_dc_publisher.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ item 2 dc:publisher
-Expect: feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).fields.getProperty('dc:publisher') == 'The O\'Reilly Network'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item>
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet.
- </dc:description>
- <!--
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>-->
- </item>
- <item>
- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet 2.
- </dc:description>
- <title>XML: A Disruptive Technology</title>
- </item>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/item_2_dc_publisher_extra_att_invalid_rdf.xml b/toolkit/components/feeds/test/xml/rss1/item_2_dc_publisher_extra_att_invalid_rdf.xml
deleted file mode 100644
index dac0d1dc8..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_2_dc_publisher_extra_att_invalid_rdf.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ item 2 dc:publisher
-Expect: feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).fields.getProperty('dc:publisher') == 'The O\'Reilly Network'
-
--->
-<rdf:RDF
- xmlns:foo="http://example.org"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item>
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet.
- </dc:description>
- <!--
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>-->
- </item>
- <item>
- <dc:publisher foo:bar="baz">The O'Reilly Network</dc:publisher>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet 2.
- </dc:description>
- <title>XML: A Disruptive Technology</title>
- </item>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/item_count.xml b/toolkit/components/feeds/test/xml/rss1/item_count.xml
deleted file mode 100644
index 69520fb14..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_count.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ 1 item count
-Expect: feed.items.length == 2
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item>
- <!-- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical
- infrastructure of the Internet.
- </dc:description>
- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>-->
- </item>
- <item>
-
- </item>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/item_dc_creator.xml b/toolkit/components/feeds/test/xml/rss1/item_dc_creator.xml
deleted file mode 100644
index 71ecd6d77..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_dc_creator.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ item dc:description
-Expect: var author = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).authors.queryElementAt(0, Components.interfaces.nsIFeedPerson); (author.name == "Simon St.Laurent" && author.email == "simonstl@simonstl.com")
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item>
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet.
- </dc:description>
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>
- </item>
- <item>
- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet 2.
- </dc:description>
- <title>XML: A Disruptive Technology</title>
- </item>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/item_dc_description.xml b/toolkit/components/feeds/test/xml/rss1/item_dc_description.xml
deleted file mode 100644
index 3d7880e8c..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_dc_description.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ item dc:description
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('dc:description') == 'XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet.'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item>
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet.
- </dc:description>
- <!--
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>-->
- </item>
- <item>
- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet 2.
- </dc:description>
- <title>XML: A Disruptive Technology</title>
- </item>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/item_dc_description_normalized.xml b/toolkit/components/feeds/test/xml/rss1/item_dc_description_normalized.xml
deleted file mode 100644
index d57477a99..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_dc_description_normalized.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ item dc:description
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary.plainText() == 'XML is...'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item>
- <dc:description>XML is...</dc:description>
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet.
- </description>
-
- <!--
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>-->
- </item>
- <item>
- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet 2.
- </dc:description>
- <title>XML: A Disruptive Technology</title>
- </item>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/item_description.xml b/toolkit/components/feeds/test/xml/rss1/item_description.xml
deleted file mode 100644
index db4a0137f..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_description.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ item desc normalized
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary.plainText() == 'XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet.'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item>
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <description>
- XML is placing increasingly heavy loads on the existing technical infrastructure of the Internet.
- </description>
- <!-- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>-->
- </item>
- <item>
-
- </item>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/item_id.xml b/toolkit/components/feeds/test/xml/rss1/item_id.xml
deleted file mode 100644
index 50048b0a3..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_id.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ item rdf:about
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).id == 'http://example.com/hmm'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item rdf:about="http://example.com/hmm">
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical
- infrastructure of the Internet.
- </dc:description>
- <!-- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>-->
- </item>
- <item>
-
- </item>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/item_link.xml b/toolkit/components/feeds/test/xml/rss1/item_link.xml
deleted file mode 100644
index 8ead15fb6..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_link.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ item link
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('rss1:link') == 'http://c.moreover.com/click/here.pl?r123'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item>
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical
- infrastructure of the Internet.
- </dc:description>
- <!-- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>-->
- </item>
- <item>
-
- </item>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/item_link_normalized.xml b/toolkit/components/feeds/test/xml/rss1/item_link_normalized.xml
deleted file mode 100644
index dbf9749ac..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_link_normalized.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ item link
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == 'http://c.moreover.com/click/here.pl?r123'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item>
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical
- infrastructure of the Internet.
- </dc:description>
- <!-- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>-->
- </item>
- <item>
-
- </item>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/item_title.xml b/toolkit/components/feeds/test/xml/rss1/item_title.xml
deleted file mode 100644
index b4d4b8e3e..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_title.xml
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ item title
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('rss1:title') == 'XML: A Disruptive Technology'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item>
- <title>XML: A Disruptive Technology</title>
- <!-- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical
- infrastructure of the Internet.
- </dc:description>
- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:subject>XML</dc:subject>-->
- </item>
- <item>
-
- </item>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss1/item_title_normalized.xml b/toolkit/components/feeds/test/xml/rss1/item_title_normalized.xml
deleted file mode 100644
index a9270982f..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_title_normalized.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ item title normalized
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).title.text == 'XML: A Disruptive Technology'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item>
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical
- infrastructure of the Internet.
- </dc:description>
- <!-- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>-->
- </item>
- <item>
-
- </item>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/item_updated_dcterms.xml b/toolkit/components/feeds/test/xml/rss1/item_updated_dcterms.xml
deleted file mode 100644
index d8f15ee32..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_updated_dcterms.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed updated
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).updated == 'Sat, 07 Sep 2002 00:00:01 GMT'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'
- xmlns:dcterms='http://purl.org/dc/terms/'>
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- <dcterms:modified>Sat, 07 Sep 2002 00:00:01 GMT</dcterms:modified>
- </channel>
- <item rdf:about="http://example.com/hmm">
- <title>XML: A Disruptive Technology</title>
- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical
- infrastructure of the Internet.
- </dc:description>
- <dcterms:modified>Sat, 07 Sep 2002 00:00:01 GMT</dcterms:modified>
- </item>
-</rdf:RDF>
diff --git a/toolkit/components/feeds/test/xml/rss1/item_wiki_importance_extra_att.xml b/toolkit/components/feeds/test/xml/rss1/item_wiki_importance_extra_att.xml
deleted file mode 100644
index 49ba579dd..000000000
--- a/toolkit/components/feeds/test/xml/rss1/item_wiki_importance_extra_att.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: RSS1 feed w/ item wiki:importance with extra attribute
-Expect: feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).fields.getProperty('wiki:importance') == 'major'
-
--->
-<rdf:RDF
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns="http://purl.org/rss/1.0/"
- xmlns:dc='http://purl.org/dc/elements/1.1/'
- xmlns:w="http://purl.org/rss/1.0/modules/wiki/"
- xmlns:foo="http://example.org">
- <channel rdf:about="http://www.xml.com/xml/news.rss">
- <title>Test</title>
- <link>http://xml.com/pub</link>
- <dc:description>another description</dc:description>
- </channel>
- <item>
- <title>XML: A Disruptive Technology</title>
- <!-- <link>http://c.moreover.com/click/here.pl?r123</link>
- <dc:description>
- XML is placing increasingly heavy loads on the existing technical
- infrastructure of the Internet.
- </dc:description>
- <dc:publisher>The O'Reilly Network</dc:publisher>
- <dc:creator>Simon St.Laurent (mailto:simonstl@simonstl.com)</dc:creator>
- <dc:rights>Copyright &#169; 2000 O'Reilly &amp; Associates, Inc.</dc:rights>
- <dc:subject>XML</dc:subject>-->
- </item>
- <item>
- <w:importance foo:bar="baz">major</w:importance>
- </item>
-</rdf:RDF> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_category.xml b/toolkit/components/feeds/test/xml/rss2/feed_category.xml
deleted file mode 100644
index 553825995..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_category.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel category works
-Expect: feed.categories.queryElementAt(0, Components.interfaces.nsIPropertyBag).getProperty('term') == 'hmm'
-
--->
-<rss version="2.0" >
-<channel>
-<category>hmm</category>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_category_count.xml b/toolkit/components/feeds/test/xml/rss2/feed_category_count.xml
deleted file mode 100644
index 881c6e0d9..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_category_count.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel category works w/ domain
-Expect: feed.categories.length == 4
-
--->
-<rss version="2.0" >
-<channel>
-<category>hmm0</category>
-<category>hmm1</category>
-<category domain="http://example.org">hmm2</category>
-<category>hmm3</category>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_cloud.xml b/toolkit/components/feeds/test/xml/rss2/feed_cloud.xml
deleted file mode 100644
index caa033548..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_cloud.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel cloud works
-Expect: ((feed.cloud.getProperty('domain')=="rpc.sys.com") && (feed.cloud.getProperty('port')=="80") && (feed.cloud.getProperty('path')=="/RPC2") && (feed.cloud.getProperty('registerProcedure')=="pingMe") && (feed.cloud.getProperty('protocol')=="soap"))
-
--->
-<rss version="2.0" >
-<channel>
-<cloud domain="rpc.sys.com" port="80" path="/RPC2" registerProcedure="pingMe" protocol="soap"/>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_copyright.xml b/toolkit/components/feeds/test/xml/rss2/feed_copyright.xml
deleted file mode 100644
index 2d00e7a14..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_copyright.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel copyright works
-Expect: feed.fields.getProperty('copyright') == 'copyright 2006'
-
--->
-<rss version="2.0" >
-<channel>
-<copyright>copyright 2006</copyright>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_copyright_linebreak.xml b/toolkit/components/feeds/test/xml/rss2/feed_copyright_linebreak.xml
deleted file mode 100644
index 4b9ca5e71..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_copyright_linebreak.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel copyright works
-Expect: feed.fields.getProperty('copyright') == 'copyright 2005'
-
--->
-<rss version="2.0" >
-<channel>
-<copyright>copyright 2005
-
-
-</copyright>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_data_outside_channel.xml b/toolkit/components/feeds/test/xml/rss2/feed_data_outside_channel.xml
deleted file mode 100644
index bf212760d..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_data_outside_channel.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel copyright works
-Expect: feed.fields.getProperty('copyright') == 'copyright 2006'
-
--->
-<rss version="2.0" >
-<dc:creator xmlns:dc="http://example.org">heynow</dc:creator>
-<channel>
-<copyright>copyright 2006</copyright>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_dc_contributor.xml b/toolkit/components/feeds/test/xml/rss2/feed_dc_contributor.xml
deleted file mode 100644
index cfb514ccd..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_dc_contributor.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel copyright works
-Expect: feed.contributors.queryElementAt(0, Components.interfaces.nsIFeedPerson).name == 'them';
-
--->
-<rss version="2.0" >
-<channel xmlns:dc="http://purl.org/dc/elements/1.1/">
-<copyright>copyright 2006</copyright>
-<dc:creator>me</dc:creator>
-<dc:contributor>them</dc:contributor>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_dc_creator.xml b/toolkit/components/feeds/test/xml/rss2/feed_dc_creator.xml
deleted file mode 100644
index 8ed1aff7f..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_dc_creator.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel copyright works
-Expect: feed.authors.queryElementAt(0, Components.interfaces.nsIFeedPerson).name == 'me'
-
--->
-<rss version="2.0" >
-<channel xmlns:dc="http://purl.org/dc/elements/1.1/">
-<copyright>copyright 2006</copyright>
-<dc:creator>me</dc:creator>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_description.xml b/toolkit/components/feeds/test/xml/rss2/feed_description.xml
deleted file mode 100644
index 11463dfe0..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_description.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel description works
-Expect: var desc = feed.fields.getProperty('description'); desc == 'test';
-
--->
-<rss version="2.0" >
-<channel>
-<description>test</description>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_description_html.xml b/toolkit/components/feeds/test/xml/rss2/feed_description_html.xml
deleted file mode 100644
index ecb544f6c..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_description_html.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel description works w/html
-Expect: feed.fields.getProperty('description') == '<b>test</b>'
-
--->
-<rss version="2.0" >
-<channel>
-<description>&lt;b>test&lt;/b></description>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_description_html_cdata.xml b/toolkit/components/feeds/test/xml/rss2/feed_description_html_cdata.xml
deleted file mode 100644
index 45ee9e92b..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_description_html_cdata.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel description works w/ html & CDATA
-Expect: feed.fields.getProperty('description') == '<b>test</b>'
-
--->
-<rss version="2.0" >
-<channel>
-<description><![CDATA[<b>test</b>]]></description>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_docs.xml b/toolkit/components/feeds/test/xml/rss2/feed_docs.xml
deleted file mode 100644
index 20323b22f..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_docs.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel docs works
-Expect: feed.fields.getProperty('docs') == 'http://example.org'
-
--->
-<rss version="2.0" >
-<channel>
-<docs>http://example.org</docs>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_generator.xml b/toolkit/components/feeds/test/xml/rss2/feed_generator.xml
deleted file mode 100644
index 91ba579b4..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_generator.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel generator works
-Expect: feed.generator.agent == 'a generator used to make feeds'
-
--->
-<rss version="2.0" >
-<channel>
-<generator>a generator used to make feeds</generator>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_image_desc.xml b/toolkit/components/feeds/test/xml/rss2/feed_image_desc.xml
deleted file mode 100644
index 7f665641b..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_image_desc.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel image description and required fields work
-Expect: ((feed.image.getProperty('title') == 'A picture') && (feed.image.getProperty('link') == 'http://example.org') && (feed.image.getProperty('url') == 'http://example.org/a.jpg') && (feed.image.getProperty('description') == 'Yo!'))
-
--->
-<rss version="2.0" >
-<channel>
-<image>
- <link>http://example.org</link>
- <title>A picture</title>
- <url>http://example.org/a.jpg</url>
- <description>Yo!</description>
-</image>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_image_desc_width_height.xml b/toolkit/components/feeds/test/xml/rss2/feed_image_desc_width_height.xml
deleted file mode 100644
index 2be53e86c..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_image_desc_width_height.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel image required fields work
-Expect: ((feed.image.getProperty('title') == 'A picture') && (feed.image.getProperty('link') == 'http://example.org') && (feed.image.getProperty('url') == 'http://example.org/a.jpg') && (feed.image.getProperty('description') == 'Yo!') && (feed.image.getProperty('width') == '42') && (feed.image.getProperty('height') == '43'))
-
--->
-<rss version="2.0" >
-<channel>
-<image>
- <link>http://example.org</link>
- <title>A picture</title>
- <url>http://example.org/a.jpg</url>
- <description>Yo!</description>
- <width>42</width>
- <height>43</height>
-</image>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_image_required.xml b/toolkit/components/feeds/test/xml/rss2/feed_image_required.xml
deleted file mode 100644
index 9035523a1..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_image_required.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel image required fields work
-Expect: ((feed.image.getProperty('title') == 'A picture') && (feed.image.getProperty('link') == 'http://example.org') && (feed.image.getProperty('url') == 'http://example.org/a.jpg'))
-
--->
-<rss version="2.0" >
-<channel>
-<image>
- <link>http://example.org</link>
- <title>A picture</title>
- <url>http://example.org/a.jpg</url>
-</image>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_language.xml b/toolkit/components/feeds/test/xml/rss2/feed_language.xml
deleted file mode 100644
index d4047a99f..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_language.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel language works
-Expect: feed.fields.getProperty('language') == 'en-us'
-
--->
-<rss version="2.0" >
-<channel>
-<language>en-us</language>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_lastBuildDate.xml b/toolkit/components/feeds/test/xml/rss2/feed_lastBuildDate.xml
deleted file mode 100644
index fee9ff582..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_lastBuildDate.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel lastBuildDate works
-Expect: feed.fields.getProperty('lastBuildDate') == 'Sat, 07 Sep 2002 00:00:01 GMT'
-
--->
-<rss version="2.0" >
-<channel>
-<lastBuildDate>Sat, 07 Sep 2002 00:00:01 GMT</lastBuildDate>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_linebreak_link.xml b/toolkit/components/feeds/test/xml/rss2/feed_linebreak_link.xml
deleted file mode 100644
index 1af6550f9..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_linebreak_link.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel link works w/ line break
-Expect: feed.link.spec == 'http://mozilla.org/'
-
--->
-<rss version="2.0" >
-<channel>
-<link>
-http://mozilla.org/
-</link>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_link.xml b/toolkit/components/feeds/test/xml/rss2/feed_link.xml
deleted file mode 100644
index a4874e9ca..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_link.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel link works
-Expect: feed.link.spec == 'http://mozilla.org/'
-
--->
-<rss version="2.0" >
-<channel>
-<link>http://mozilla.org/</link>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_link_cdata.xml b/toolkit/components/feeds/test/xml/rss2/feed_link_cdata.xml
deleted file mode 100644
index 5031ac1c3..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_link_cdata.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel link works w/ CDATA
-Expect: feed.link.spec == 'http://mozilla.org/'
-
--->
-<rss version="2.0" >
-<channel>
-<link>
- <![CDATA[http://mozilla.org/]]>
-</link>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_managingEditor.xml b/toolkit/components/feeds/test/xml/rss2/feed_managingEditor.xml
deleted file mode 100644
index 3f7060449..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_managingEditor.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel managingEditor works
-Expect: feed.authors.queryElementAt(0, Components.interfaces.nsIFeedPerson).email == 'example@example.com'
-
--->
-<rss version="2.0" >
-<channel>
-<managingEditor>example@example.com</managingEditor>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_managingEditor_extra_att.xml b/toolkit/components/feeds/test/xml/rss2/feed_managingEditor_extra_att.xml
deleted file mode 100644
index 017a4595f..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_managingEditor_extra_att.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel managingEditor works
-Expect: feed.authors.queryElementAt(0, Components.interfaces.nsIFeedPerson).email == 'example@example.com'
-
--->
-<rss version="2.0" >
-<channel>
-<managingEditor foo:bar="baz" xmlns:foo="http://example.org">example@example.com</managingEditor>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_multiple_categories.xml b/toolkit/components/feeds/test/xml/rss2/feed_multiple_categories.xml
deleted file mode 100644
index 538362b6a..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_multiple_categories.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel category works
-Expect: feed.categories.queryElementAt(2, Components.interfaces.nsIPropertyBag).getProperty('term') == 'hmm2'
-
--->
-<rss version="2.0" >
-<channel>
-<category>hmm0</category>
-<category>hmm1</category>
-<category>hmm2</category>
-<category>hmm3</category>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_pubDate.xml b/toolkit/components/feeds/test/xml/rss2/feed_pubDate.xml
deleted file mode 100644
index 42cea6832..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_pubDate.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel pubDate works
-Expect: feed.fields.getProperty('pubDate') == 'Sat, 07 Sep 2002 00:00:01 GMT'
-
--->
-<rss version="2.0" >
-<channel>
-<pubDate>Sat, 07 Sep 2002 00:00:01 GMT</pubDate>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_invalid.xml b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_invalid.xml
deleted file mode 100644
index 48cce256a..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_invalid.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: non-RFC822 date should produce null feed.updated
-Expect: feed.updated == null
-
--->
-<rss version="2.0" >
-<channel>
-<pubDate>Satmonkey, 07 Sepmonkey 2002 00:00:01 GMT</pubDate>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_1.xml b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_1.xml
deleted file mode 100644
index 846ef22a6..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: Test whether date parsing handles partly-abbreviated dates.
-Expect: feed.updated == 'Tue, 25 Apr 2006 08:00:00 GMT'
-
--->
-<rss version="2.0" >
-<channel>
-<pubDate>Tues, 25 Apri 2006 08:00:00 GMT</pubDate>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_2.xml b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_2.xml
deleted file mode 100644
index d1ee96f36..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_nonRFC822_2.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: Test whether date parsing handles unabbreviated dates.
-Expect: feed.updated == 'Sat, 25 Nov 2006 00:12:45 GMT'
-
--->
-<rss version="2.0" >
-<channel>
-<pubDate>Saturday 25 November 2006 10:12:45 +1000</pubDate>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_timezoneZ.xml b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_timezoneZ.xml
deleted file mode 100644
index b31ed5c56..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_timezoneZ.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: Test whether date parsing handles "Z" as a timezone in RFC822.
-Expect: feed.updated == 'Tue, 25 Apr 2006 08:00:00 GMT'
-
--->
-<rss version="2.0" >
-<channel>
-<pubDate>Tue, 25 Apr 2006 08:00:00 Z</pubDate>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_utc.xml b/toolkit/components/feeds/test/xml/rss2/feed_pubDate_utc.xml
deleted file mode 100644
index 8eff56046..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_pubDate_utc.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: Test whether date parsing handles 'UTC' as a timezone.
-Expect: feed.updated == 'Mon, 16 Apr 2007 03:12:45 GMT'
-
--->
-<rss version="2.0" >
-<channel>
-<pubDate>Monday, 16 April 2007 03:12:45 UTC</pubDate>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_rating.xml b/toolkit/components/feeds/test/xml/rss2/feed_rating.xml
deleted file mode 100644
index dd5f8f9e5..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_rating.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel rating works
-Expect: feed.fields.getProperty('rating') == '(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l by "webmaster@example.com" on "2006.01.29T10:09-0800" r (n 0 s 0 v 0 l 0))'
-
--->
-<rss version="2.0" >
-<channel>
-<rating>(PICS-1.1 "http://www.rsac.org/ratingsv01.html" l by "webmaster@example.com" on "2006.01.29T10:09-0800" r (n 0 s 0 v 0 l 0))</rating>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_single_quote_stylesheet_pi.xml b/toolkit/components/feeds/test/xml/rss2/feed_single_quote_stylesheet_pi.xml
deleted file mode 100644
index 10141fe7e..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_single_quote_stylesheet_pi.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<!--
-
-Description: stylesheets with single quoted attributes work. Bug 352549.
-Base: http://www.penny-arcade.com/rss.xml
-Expect: result.stylesheet.spec == "http://www.penny-arcade.com/stylesheets/rss-display.xsl"
-
--->
-<?xml-stylesheet type='text/xsl' href='/stylesheets/rss-display.xsl' version='1.0'?>
-<rss version="2.0">
-<channel>
-<title>Penny-Arcade</title>
-<link>http://www.penny-arcade.com/</link>
-<language>en-us</language>
-
-<copyright>Copyright 1999 - 2006 Penny Arcade, Inc.</copyright>
-<image>
-<url>http://www.penny-arcade.com/images/rss-logo.png</url>
-<title>Penny-Arcade Logo</title>
-<link>http://www.penny-arcade.com/</link>
-<width>144</width>
-
-<height>82</height>
-</image>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_skipDays.xml b/toolkit/components/feeds/test/xml/rss2/feed_skipDays.xml
deleted file mode 100644
index 8c6ffa9e4..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_skipDays.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel skipDays works
-Expect: ((feed.skipDays.queryElementAt(0, Components.interfaces.nsISupportsString) == 'Sunday') && (feed.skipDays.queryElementAt(1, Components.interfaces.nsISupportsString) == 'Monday'))
-
--->
-<rss version="2.0" >
-<channel>
-<skipDays>
- <day>Sunday</day>
- <day>Monday</day>
-</skipDays>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_skipHours.xml b/toolkit/components/feeds/test/xml/rss2/feed_skipHours.xml
deleted file mode 100644
index a20372eda..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_skipHours.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel skipHours works
-Expect: ((feed.skipHours.queryElementAt(0, Components.interfaces.nsISupportsString) == '0') && (feed.skipHours.queryElementAt(4, Components.interfaces.nsISupportsString) == '23'))
-
--->
-<rss version="2.0" >
-<channel>
-<skipHours>
- <hour>0</hour>
- <hour>1</hour>
- <hour>2</hour>
- <hour>22</hour>
- <hour>23</hour>
-</skipHours>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_subtitle.xml b/toolkit/components/feeds/test/xml/rss2/feed_subtitle.xml
deleted file mode 100644
index a98a3c19e..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_subtitle.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel description works
-Expect: feed.subtitle.text == 'test'
-
--->
-<rss version="2.0" >
-<channel>
-<description>test</description>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_subtitle_html.xml b/toolkit/components/feeds/test/xml/rss2/feed_subtitle_html.xml
deleted file mode 100644
index fca819d36..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_subtitle_html.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel description works
-Expect: feed.subtitle.plainText() == '<i><b>test</b></i>'
-
--->
-<rss version="2.0" >
-<channel>
-<description><![CDATA[<i><b>test</b></i>]]></description>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_subtitle_markup_stripped.xml b/toolkit/components/feeds/test/xml/rss2/feed_subtitle_markup_stripped.xml
deleted file mode 100644
index 54f6a623c..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_subtitle_markup_stripped.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel description markup is not HTML
-Expect: feed.subtitle.plainText() == '<i><b>test</b></i>'
-
--->
-<rss version="2.0" >
-<channel>
-<description><![CDATA[<i><b>test</b></i>]]></description>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_textinput.xml b/toolkit/components/feeds/test/xml/rss2/feed_textinput.xml
deleted file mode 100644
index 4617d62bc..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_textinput.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel textInput works
-Expect: ((feed.textInput.getProperty('description') == 'Your aggregator supports the textInput element. What software are you using?') && (feed.textInput.getProperty('link') == 'http://www.cadenhead.org/textinput.php') && (feed.textInput.getProperty('name') == 'query') && (feed.textInput.getProperty('title') == 'TextInput Inquiry'))
-
--->
-<rss version="2.0" >
-<channel>
-<textInput>
- <description>Your aggregator supports the textInput element. What software are you using?</description>
- <link>http://www.cadenhead.org/textinput.php</link>
- <name>query</name>
- <title>TextInput Inquiry</title>
-</textInput>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_title.xml b/toolkit/components/feeds/test/xml/rss2/feed_title.xml
deleted file mode 100644
index 1f7d63ad2..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_title.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel title works
-Expect: feed.title.plainText() == 'test title'
-
--->
-<rss version="2.0" >
-<channel>
-<title>test title</title>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_title_cdata_mixed.xml b/toolkit/components/feeds/test/xml/rss2/feed_title_cdata_mixed.xml
deleted file mode 100644
index 19ef62915..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_title_cdata_mixed.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel title works w/ funky CDATA title
-Expect: feed.title.plainText() == 'test title'
-
--->
-<rss version="2.0" >
-<channel>
-<title>test t<![CDATA[it]]>le</title>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_title_nesting.xml b/toolkit/components/feeds/test/xml/rss2/feed_title_nesting.xml
deleted file mode 100644
index 82492cef7..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_title_nesting.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel title works w/ nested title
-Expect: feed.title.text == 'test title'
-
--->
-<rss version="2.0" >
-<channel>
-<title>test title</title>
-<bogus><title>bogus title</title></bogus>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_ttl.xml b/toolkit/components/feeds/test/xml/rss2/feed_ttl.xml
deleted file mode 100644
index 57158aff4..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_ttl.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel ttl works
-Expect: feed.fields.getProperty('ttl') == '60'
-
--->
-<rss version="2.0" >
-<channel>
-<ttl>60</ttl>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_updated.xml b/toolkit/components/feeds/test/xml/rss2/feed_updated.xml
deleted file mode 100644
index c9e75e360..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_updated.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel pubDate works
-Expect: feed.updated == 'Sat, 07 Sep 2002 00:00:01 GMT'
-
--->
-<rss version="2.0" >
-<channel>
-<pubDate>Sat, 07 Sep 2002 00:00:01 GMT</pubDate>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_updated_dcdate.xml b/toolkit/components/feeds/test/xml/rss2/feed_updated_dcdate.xml
deleted file mode 100644
index aa69e7800..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_updated_dcdate.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel pubDate works
-Expect: feed.updated == 'Sat, 07 Sep 2002 00:00:01 GMT'
-
--->
-<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
-<channel>
-<dc:date>Sat, 07 Sep 2002 00:00:01 GMT</dc:date>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate.xml b/toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate.xml
deleted file mode 100644
index 2fb24a7ec..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel lastBuildDate works
-Expect: feed.updated == 'Sat, 07 Sep 2002 00:00:01 GMT'
-
--->
-<rss version="2.0" >
-<channel>
-<lastBuildDate>Sat, 07 Sep 2002 00:00:01 GMT</lastBuildDate>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate_priority.xml b/toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate_priority.xml
deleted file mode 100644
index 24f024005..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_updated_lastBuildDate_priority.xml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel lastBuildDate trumps pubDate
-Expect: feed.updated == 'Sat, 07 Sep 2002 00:00:01 GMT'
-
--->
-<rss version="2.0" >
-<channel>
-<pubDate>Sun, 08 Sep 2002 00:00:01 GMT</pubDate>
-<lastBuildDate>Sat, 07 Sep 2002 00:00:01 GMT</lastBuildDate>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_webMaster.xml b/toolkit/components/feeds/test/xml/rss2/feed_webMaster.xml
deleted file mode 100644
index 887894983..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_webMaster.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel webMaster works
-Expect: feed.fields.getProperty('webMaster') == 'example@example.com'
-
--->
-<rss version="2.0" >
-<channel>
-<webMaster>example@example.com</webMaster>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_wfw_commentapi.xml b/toolkit/components/feeds/test/xml/rss2/feed_wfw_commentapi.xml
deleted file mode 100644
index af725064e..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_wfw_commentapi.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel copyright works
-Expect: feed.fields.getProperty('wfw:comment') == 'http://example.org'
-
--->
-<rss xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0" >
-<channel xmlns:dc="http://purl.org/dc/elements/1.1/">
-<wfw:comment>http://example.org</wfw:comment>
-<copyright>copyright 2006</copyright>
-<dc:creator>me</dc:creator>
-<dc:contributor>them</dc:contributor>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_wfw_commentrss.xml b/toolkit/components/feeds/test/xml/rss2/feed_wfw_commentrss.xml
deleted file mode 100644
index fb1d89609..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_wfw_commentrss.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel copyright works
-Expect: feed.fields.getProperty('wfw:commentRss') == 'http://example.org'
-
--->
-<rss xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0" >
-<channel xmlns:dc="http://purl.org/dc/elements/1.1/">
-<copyright>copyright 2006</copyright>
-<dc:creator>me</dc:creator>
-<wfw:commentRss>http://example.org</wfw:commentRss>
-<dc:contributor>them</dc:contributor>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_wiki.xml b/toolkit/components/feeds/test/xml/rss2/feed_wiki.xml
deleted file mode 100644
index b8cb783b0..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_wiki.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel unusual prefixed ext works
-Expect: feed.fields.getProperty('wiki:version') == '1'
-
--->
-<rss
-xmlns:w='http://purl.org/rss/1.0/modules/wiki/'
-xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0" >
-<channel xmlns:dc="http://purl.org/dc/elements/1.1/">
-<copyright>copyright 2006</copyright>
-<dc:creator>me</dc:creator>
-<w:version>1</w:version>
-<wfw:commentRss>http://example.org</wfw:commentRss>
-<dc:contributor>them</dc:contributor>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/feed_wiki_unusual_prefix.xml b/toolkit/components/feeds/test/xml/rss2/feed_wiki_unusual_prefix.xml
deleted file mode 100644
index b8cb783b0..000000000
--- a/toolkit/components/feeds/test/xml/rss2/feed_wiki_unusual_prefix.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel unusual prefixed ext works
-Expect: feed.fields.getProperty('wiki:version') == '1'
-
--->
-<rss
-xmlns:w='http://purl.org/rss/1.0/modules/wiki/'
-xmlns:wfw="http://wellformedweb.org/CommentAPI/" version="2.0" >
-<channel xmlns:dc="http://purl.org/dc/elements/1.1/">
-<copyright>copyright 2006</copyright>
-<dc:creator>me</dc:creator>
-<w:version>1</w:version>
-<wfw:commentRss>http://example.org</wfw:commentRss>
-<dc:contributor>them</dc:contributor>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/item_author.xml b/toolkit/components/feeds/test/xml/rss2/item_author.xml
deleted file mode 100644
index ad0c97e2a..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_author.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item author works
-Expect: var authors = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).authors; var author = authors.queryElementAt(0, Components.interfaces.nsIFeedPerson); ((author.name == 'Joe Bob Briggs'));
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<title>test</title>
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_category.xml b/toolkit/components/feeds/test/xml/rss2/item_category.xml
deleted file mode 100644
index 4795e00bb..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_category.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item category works
-Expect: var cats = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('categories'); cats.QueryInterface(Components.interfaces.nsIArray); var cat = cats.queryElementAt(0, Components.interfaces.nsIPropertyBag); ((cat.getProperty('domain') == 'foo') && (cat.getProperty('term') == 'bar'));
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<title>test</title>
-<category domain="foo">bar</category>
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_comments.xml b/toolkit/components/feeds/test/xml/rss2/item_comments.xml
deleted file mode 100644
index da1cccc82..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_comments.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item comments works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('comments') == 'http://example.org'
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-<title>test</title>
-<!--<author>jbb@dallas.example.com (Joe Bob Briggs)</author>-->
-<comments>http://example.org</comments>
-
-<category domain="foo">bar</category>
-
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_content_encoded.xml b/toolkit/components/feeds/test/xml/rss2/item_content_encoded.xml
deleted file mode 100644
index 6611375b6..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_content_encoded.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item title works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).content.plainText() == 'foobar'
-
--->
-<rss version="2.0" >
-<channel>
-<item xmlns:c="http://purl.org/rss/1.0/modules/content/">
- <title>test</title>
- <c:encoded>foobar</c:encoded>
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_count.xml b/toolkit/components/feeds/test/xml/rss2/item_count.xml
deleted file mode 100644
index a69cbc979..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_count.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: items length is correct
-Expect: feed.items.length == 1
-
--->
-<rss version="2.0"
- xmlns:dc="http://purl.org/dc/elements/1.1/">
-
-<channel>
-<title>Items Test</title>
-<link>http://mozilla.org/</link>
-<description></description>
-
-<dc:language>en-us</dc:language>
-<dc:creator>sayrer@gmail.com</dc:creator>
-<dc:date>2005-12-07T14:48:03-05:00</dc:date>
-
-<item>
-<title>Is the date right?</title>
-<link>http://example.org/dc_date.html</link>
-</item>
-
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/item_count2.xml b/toolkit/components/feeds/test/xml/rss2/item_count2.xml
deleted file mode 100644
index 27df0a932..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_count2.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: items length is correct
-Expect: feed.items.length == 2
-
--->
-<rss version="2.0"
- xmlns:dc="http://purl.org/dc/elements/1.1/">
-
-<channel>
-<title>Items Test</title>
-<link>http://mozilla.org/</link>
-<description></description>
-
-<dc:language>en-us</dc:language>
-<dc:creator>sayrer@gmail.com</dc:creator>
-<dc:date>2005-12-07T14:48:03-05:00</dc:date>
-
-<item>
-<title>Is the date right?</title>
-<link>http://example.org/dc_date.html</link>
-</item>
-<item>
-<title>Is the date right?</title>
-<link>http://example.org/dc_date.html</link>
-</item>
-
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/item_description.xml b/toolkit/components/feeds/test/xml/rss2/item_description.xml
deleted file mode 100644
index 7416d48e6..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_description.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item desc encoded works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary.text == 'I\'m headed for France. I wasn\'t gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.'
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-<comments>http://example.org</comments>
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<title>test</title>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_description_2.xml b/toolkit/components/feeds/test/xml/rss2/item_description_2.xml
deleted file mode 100644
index 427726868..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_description_2.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item desc encoded works
-Expect: feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).summary.text == 'I\'m headed for France. I wasn\'t gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.'
-
--->
-<rss version="2.0" >
-<channel>
-<item>
- <description>hmmm</description>
-</item>
-<item>
-<comments>http://example.org</comments>
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<title>test</title>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_description_cdata.xml b/toolkit/components/feeds/test/xml/rss2/item_description_cdata.xml
deleted file mode 100644
index ef3926f87..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_description_cdata.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item desc CDATA works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary.text == 'I\'m headed for France. I wasn\'t gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.'
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-
-<category domain="foo">bar</category>
-<description><![CDATA[I'm headed for France. I wasn't gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.]]></description>
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_description_decode_entities.xml b/toolkit/components/feeds/test/xml/rss2/item_description_decode_entities.xml
deleted file mode 100644
index e259354dc..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_description_decode_entities.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-
-Description: item desc encoded, double-escaped entity
-Expect: var summary = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary; summary.plainText() == "test D\u00e9sol\u00e9e";
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-<comments>http://example.org</comments>
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<title>test</title>
-<category domain="foo">bar</category>
-
-<description>
- &lt;b>test D&amp;eacute;sol&amp;eacute;e&lt;/b>
-</description>
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_description_normalized.xml b/toolkit/components/feeds/test/xml/rss2/item_description_normalized.xml
deleted file mode 100644
index 9819deb36..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_description_normalized.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item desc encoded, normalied works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary.text == 'I\'m headed for France. I wasn\'t gonna go this year, but then last week <a href="http://www.imdb.com/title/tt0086525/">Valley Girl</a> came out and I said to myself, Joe Bob, you gotta get out of the country for a while.'
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-<comments>http://example.org</comments>
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<title>test</title>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_description_normalized_nohtml.xml b/toolkit/components/feeds/test/xml/rss2/item_description_normalized_nohtml.xml
deleted file mode 100644
index 0a34a008d..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_description_normalized_nohtml.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item desc encoded, normalized works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary.plainText() == 'I\'m headed for France. I wasn\'t gonna go this year, but then last week Valley Girl came out and I said to myself, Joe Bob, you gotta get out of the country for a while.'
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-<comments>http://example.org</comments>
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<title>test</title>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_enclosure.xml b/toolkit/components/feeds/test/xml/rss2/item_enclosure.xml
deleted file mode 100644
index 2e38a370a..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_enclosure.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item enclosure works
-Expect: var enc = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('enclosure'); enc.QueryInterface(Components.interfaces.nsIPropertyBag); ((enc.getProperty('length') == '24986239') && (enc.getProperty('type') == 'audio/mpeg') && (enc.getProperty('url') == 'http://dallas.example.com/joebob_050689.mp3') && (feed.type == 1) && (feed.enclosureCount == 1));
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates.xml b/toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates.xml
deleted file mode 100644
index a9bcd2cc9..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: feed with duplicate enclosures on a single item
-Expect: ((feed.type == 4) && (feed.enclosureCount == 1));
-
--->
-<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" >
-<channel>
-
-<item>
-<enclosure length="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_050689.mpeg" />
-<media:content fileSize="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_050689.mpeg" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test audio</title>
-
-<category domain="foo">bar</category>
-
-<description>Listen to the words that are coming out of my mouth.</description>
-</item>
-
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates2.xml b/toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates2.xml
deleted file mode 100644
index 51f7caba9..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_enclosure_duplicates2.xml
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: feed with duplicate enclosures on a single item with different data available
-Expect: var enc = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('enclosure'); enc.QueryInterface(Components.interfaces.nsIPropertyBag); ((enc.getProperty('length') == '24986239') && (enc.getProperty('type') == 'video/mpeg') && (feed.type == 4) && (feed.enclosureCount == 1) );
-
--->
-<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" >
-<channel>
-
-<item>
-<enclosure url="http://dallas.example.com/joebob_050689.mpeg" />
-<media:content fileSize="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_050689.mpeg" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test audio</title>
-
-<category domain="foo">bar</category>
-
-<description>Listen to the words that are coming out of my mouth.</description>
-</item>
-
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed.xml b/toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed.xml
deleted file mode 100644
index 7b49e4d74..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: feed with different kinds of enclosures that should be TYPE_FEED (0)
-Expect: ((feed.type == 0) && (feed.enclosureCount == 2));
-
--->
-<rss version="2.0" >
-<channel>
-
-<item>
-<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test audio</title>
-
-<category domain="foo">bar</category>
-
-<description>Listen to the words that are coming out of my mouth.</description>
-</item>
-
-<item>
-<enclosure length="3000000" type="video/mpeg" url="http://dallas.example.com/joebob_pants.mpeg" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test video</title>
-
-<category domain="foo">bar</category>
-
-<description>Look into my eyes....</description>
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed2.xml b/toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed2.xml
deleted file mode 100644
index a54a40559..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_enclosure_mixed2.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: feed that doesn't have at least one enclosure per entry should be TYPE_FEED (0)
-Expect: ((feed.type == 0) && (feed.enclosureCount == 1));
-
--->
-<rss version="2.0" >
-<channel>
-
-<item>
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>no video this week!</title>
-
-<category domain="foo">bar</category>
-
-<description>I'm on a trip to the moon this week for this year's Spaceshot Vlogger
-conference. No video this week!</description>
-</item>
-
-<item>
-<enclosure length="3000000" type="video/mpeg" url="http://dallas.example.com/joebob_pants.mpeg" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>orange keyboard</title>
-
-<category domain="foo">bar</category>
-
-<description>Crazy things happen when you paint your keyboard orange.</description>
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid.xml b/toolkit/components/feeds/test/xml/rss2/item_guid.xml
deleted file mode 100644
index 2e7f551ef..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_guid.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item guid works
-Expect: var guid = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('guid'); guid.QueryInterface(Components.interfaces.nsIPropertyBag2); guid.getProperty('guid') == 'asdf';
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-<guid>asdf</guid>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_bogus_url.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_bogus_url.xml
deleted file mode 100644
index 2f1b67ced..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_guid_bogus_url.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item copes with bogus guid
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link == null;
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-<guid isPermaLink="true">xorg</guid>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink.xml
deleted file mode 100644
index c64341427..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item guid works
-Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link.spec == 'http://www.example.org/';
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<title>test</title>
-<guid isPermaLink="true">http://www.example.org/</guid>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_default.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_default.xml
deleted file mode 100644
index 7d6ae7958..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_default.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item guid works
-Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link.spec == 'http://www.example.org/';
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<title>test</title>
-<guid>http://www.example.org/</guid>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false.xml
deleted file mode 100644
index c2a1ad867..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item guid should not map to link when isPermaLink=false
-Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link == null;
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<title>test</title>
-<guid isPermaLink="false">http://www.example.org/</guid>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false_uppercase.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false_uppercase.xml
deleted file mode 100644
index 9ff2505c4..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_false_uppercase.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item guid should not map to link when isPermaLink=FaLsE
-Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link == null;
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<title>test</title>
-<guid isPermaLink="FaLsE">http://www.example.org/</guid>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_true_uppercase.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_true_uppercase.xml
deleted file mode 100644
index bc4fdc0e9..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_true_uppercase.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item guid should map to link when isPermaLink=TrUe
-Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link.spec == "http://www.example.org/";
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<title>test</title>
-<guid isPermaLink="TrUe">http://www.example.org/</guid>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_unknown_value.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_unknown_value.xml
deleted file mode 100644
index 4dce8c390..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_guid_isPermaLink_unknown_value.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item guid should map to link when isPermaLink=meatcake or other unknown values
-Expect: var link = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link; link.spec == "http://www.example.org/";
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<title>test</title>
-<guid isPermaLink="meatcake">http://www.example.org/</guid>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_normalized.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_normalized.xml
deleted file mode 100644
index e4ac97862..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_guid_normalized.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item guid works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).id == 'asdf';
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-<guid>asdf</guid>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_guid_with_link.xml b/toolkit/components/feeds/test/xml/rss2/item_guid_with_link.xml
deleted file mode 100644
index d2d3daca5..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_guid_with_link.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item prefers link to guid
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == 'http://link.example.org/';
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-<guid isPermaLink="true">http://www.example.org</guid>
-<link>http://link.example.org/</link>
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_link.xml b/toolkit/components/feeds/test/xml/rss2/item_link.xml
deleted file mode 100644
index c89f71e77..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_link.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item comments works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('link') == 'http://dallas.example.com/1983/05/06/joebob.htm'
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-<title>test</title>
-<!--<author>jbb@dallas.example.com (Joe Bob Briggs)</author>-->
-<comments>http://example.org</comments>
-<link>http://dallas.example.com/1983/05/06/joebob.htm</link>
-<category domain="foo">bar</category>
-
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_link_normalized.xml b/toolkit/components/feeds/test/xml/rss2/item_link_normalized.xml
deleted file mode 100644
index 876d7613c..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_link_normalized.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item link normalized works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).link.spec == 'http://dallas.example.com/1983/05/06/joebob.htm'
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-<title>test</title>
-<!--<author>jbb@dallas.example.com (Joe Bob Briggs)</author>-->
-<comments>http://example.org</comments>
-<link>http://dallas.example.com/1983/05/06/joebob.htm</link>
-<category domain="foo">bar</category>
-
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_plain_desc.xml b/toolkit/components/feeds/test/xml/rss2/item_plain_desc.xml
deleted file mode 100644
index ffb4226f1..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_plain_desc.xml
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item desc plain text works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).summary.text == "I'm headed for France. I wasn't gonna go this year, but then last week \"Valley Girl\" came out and I said to myself, Joe Bob, you gotta get out of the country for a while."
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-
-<category domain="foo">bar</category>
-<description>I'm headed for France. I wasn't gonna go this year, but then last week "Valley Girl" came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_populated_enclosures.xml b/toolkit/components/feeds/test/xml/rss2/item_populated_enclosures.xml
deleted file mode 100644
index 0a7d60df6..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_populated_enclosures.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item enclosure is added to enclosures array
-Expect: var encs = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).enclosures; encs.QueryInterface(Components.interfaces.nsIArray); var enc = encs.queryElementAt(0, Components.interfaces.nsIPropertyBag2); ((enc.getProperty('length') == '24986239') && (enc.getProperty('type') == 'audio/mpeg') && (enc.getProperty('url') == 'http://dallas.example.com/joebob_050689.mp3'));
-
--->
-<rss version="2.0" >
-<channel>
-<item>
-
-<enclosure length="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_pubDate.xml b/toolkit/components/feeds/test/xml/rss2/item_pubDate.xml
deleted file mode 100644
index acb4abdcc..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_pubDate.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: entry pubDate works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).published == 'Tue, 02 Sep 2003 00:00:01 GMT'
-
--->
-<rss version="2.0" xmlns:dcterms="http://purl.org/dc/terms/">
-<channel>
-<item>
-<pubDate>Tue, 02 Sep 2003 00:00:01 GMT</pubDate>
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_published.xml b/toolkit/components/feeds/test/xml/rss2/item_published.xml
deleted file mode 100644
index 86bf55602..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_published.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: entry published works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).published == 'Sat, 07 Sep 2002 00:00:01 GMT'
-
--->
-<rss version="2.0" xmlns:dcterms="http://purl.org/dc/terms/">
-<channel>
-<item>
-<dcterms:issued>Sat, 07 Sep 2002 00:00:01 GMT</dcterms:issued>
-</item>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/item_title.xml b/toolkit/components/feeds/test/xml/rss2/item_title.xml
deleted file mode 100644
index 0126d7da0..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_title.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item title works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('title') == 'test'
-
--->
-<rss version="2.0" >
-<channel>
-<item>
- <title>test</title>
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_title_normalized.xml b/toolkit/components/feeds/test/xml/rss2/item_title_normalized.xml
deleted file mode 100644
index 51de0f7e2..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_title_normalized.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: item title works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).title.text == 'test'
-
--->
-<rss version="2.0" >
-<channel>
-<item>
- <title>test</title>
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/item_updated_dcdate.xml b/toolkit/components/feeds/test/xml/rss2/item_updated_dcdate.xml
deleted file mode 100644
index dc20cdbc0..000000000
--- a/toolkit/components/feeds/test/xml/rss2/item_updated_dcdate.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: channel pubDate works
-Expect: feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).updated == 'Sat, 07 Sep 2002 00:00:01 GMT'
-
--->
-<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
-<channel>
-<item>
-<dc:date>Sat, 07 Sep 2002 00:00:01 GMT</dc:date>
-</item>
-</channel>
-</rss> \ No newline at end of file
diff --git a/toolkit/components/feeds/test/xml/rss2/items_2_titles.xml b/toolkit/components/feeds/test/xml/rss2/items_2_titles.xml
deleted file mode 100644
index 3a0d1eb67..000000000
--- a/toolkit/components/feeds/test/xml/rss2/items_2_titles.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: 2 items title works
-Expect: ((feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).title.text == 'test') && (feed.items.queryElementAt(1, Components.interfaces.nsIFeedEntry).title.text == 'test #2'))
-
--->
-<rss version="2.0" >
-<channel>
-<item>
- <title>test</title>
-</item>
-<item>
- <title>test #2</title>
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_content.xml b/toolkit/components/feeds/test/xml/rss2/mrss_content.xml
deleted file mode 100644
index 62a47cdef..000000000
--- a/toolkit/components/feeds/test/xml/rss2/mrss_content.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: mrss content works
-Expect: var enc = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getPropertyAsInterface('mediacontent', Components.interfaces.nsIArray).queryElementAt(0, Components.interfaces.nsIPropertyBag); Assert.equal(enc.getProperty('fileSize'), '24986239', 'file size is correct'); Assert.equal(enc.getProperty('type'), 'video/mpeg', 'type is correct'); Assert.equal(enc.getProperty('url'), 'http://dallas.example.com/joebob_050689.mpeg', 'url is correct'); Assert.equal(feed.type, 4, 'Feed type is correct'); Assert.equal(feed.enclosureCount,1, 'Enclosure count is correct'); true;
-
--->
-<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" >
-<channel>
-<item>
-
-<media:content fileSize="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_050689.mpeg" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_content2.xml b/toolkit/components/feeds/test/xml/rss2/mrss_content2.xml
deleted file mode 100644
index a0d740e69..000000000
--- a/toolkit/components/feeds/test/xml/rss2/mrss_content2.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: mrss content with a thumbnail
-Expect: var enc = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getPropertyAsInterface('mediacontent', Components.interfaces.nsIArray).queryElementAt(0, Components.interfaces.nsIPropertyBag); Assert.equal(enc.getProperty('fileSize'), '24986239', 'file size is correct'); Assert.equal(enc.getProperty('type'), 'video/mpeg', 'type is correct'); Assert.equal(enc.getProperty('url'), 'http://dallas.example.com/joebob_050689.mpeg', 'url is correct'); Assert.equal(feed.type, 0, 'Feed type is correct'); Assert.equal(feed.enclosureCount,2, 'Enclosure count is correct'); true;
-
--->
-<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" >
-<channel>
-<item>
-
-<media:content fileSize="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_050689.mpeg" />
-<media:thumbnail url="http://dallas.example.com/joebob_050689.jpg" width="75" height="50"/>
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_content_429049.xml b/toolkit/components/feeds/test/xml/rss2/mrss_content_429049.xml
deleted file mode 100644
index d13efc94c..000000000
--- a/toolkit/components/feeds/test/xml/rss2/mrss_content_429049.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: this tests bug 429049. the item with a valid url is added to the enclosures array and the item with an empty url does not.
-Expect: var encs = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).enclosures; encs.QueryInterface(Components.interfaces.nsIArray); (encs.length == 1);
-
--->
-<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" >
-<channel>
-
-<item>
-<media:content fileSize="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-
-<category domain="foo">bar</category>
-<description>no description</description>
-</item>
-
-<item>
-<media:content url="" height="" width=""></media:content>
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test empty</title>
-
-<category domain="foo">bar</category>
-<description>no description</description>
-</item>
-
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_content_multiple.xml b/toolkit/components/feeds/test/xml/rss2/mrss_content_multiple.xml
deleted file mode 100644
index c391efdd2..000000000
--- a/toolkit/components/feeds/test/xml/rss2/mrss_content_multiple.xml
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: mrss content with multiple media:content items works
-Expect: var mcs = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('mediacontent'); mcs.QueryInterface(Components.interfaces.nsIArray); var enc1 = mcs.queryElementAt(0, Components.interfaces.nsIPropertyBag); var enc2 = mcs.queryElementAt(1, Components.interfaces.nsIPropertyBag); ((enc1.getProperty('fileSize') == '24986239') && (enc1.getProperty('type') == 'video/mpeg') && (enc1.getProperty('url') == 'http://dallas.example.com/joebob_1.mpeg') && (enc2.getProperty('fileSize') == '30000000') && (enc2.getProperty('type') == 'video/mpeg') && (enc2.getProperty('url') == 'http://dallas.example.com/joebob_2.mpeg') && (feed.type == 4) && (feed.enclosureCount == 2));
-
--->
-<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" >
-<channel>
-<item>
-
-<media:content fileSize="24986239" type="video/mpeg" url="http://dallas.example.com/joebob_1.mpeg" />
-<media:content fileSize="30000000" type="video/mpeg" url="http://dallas.example.com/joebob_2.mpeg" />
-
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while. Two videos of that.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_content_populate_enclosure.xml b/toolkit/components/feeds/test/xml/rss2/mrss_content_populate_enclosure.xml
deleted file mode 100644
index f0718655f..000000000
--- a/toolkit/components/feeds/test/xml/rss2/mrss_content_populate_enclosure.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: mrss content added to enclosures array
-Expect: var encs = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).enclosures; encs.QueryInterface(Components.interfaces.nsIArray); var enc = encs.queryElementAt(0, Components.interfaces.nsIPropertyBag); ((enc.getProperty('length') == '24986239') && (enc.getProperty('type') == 'audio/mpeg') && (enc.getProperty('url') == 'http://dallas.example.com/joebob_050689.mp3') && (feed.type == 1) && (feed.enclosureCount == 1));
-
--->
-<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" >
-<channel>
-<item>
-
-<media:content fileSize="24986239" type="audio/mpeg" url="http://dallas.example.com/joebob_050689.mp3" />
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_group_content.xml b/toolkit/components/feeds/test/xml/rss2/mrss_group_content.xml
deleted file mode 100644
index da2ddb29c..000000000
--- a/toolkit/components/feeds/test/xml/rss2/mrss_group_content.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: mrss group content works
-Expect: var mg = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).fields.getProperty('mediagroup'); mg.QueryInterface(Components.interfaces.nsIPropertyBag); var mcs = mg.getProperty("mediacontent"); mcs.QueryInterface(Components.interfaces.nsIArray); var mc1 = mcs.queryElementAt(0, Components.interfaces.nsIPropertyBag); var mc2 = mcs.queryElementAt(1, Components.interfaces.nsIPropertyBag); ((mc1.getProperty('fileSize') == '400') && (mc1.getProperty('type') == 'audio/mpeg') && (mc1.getProperty('url') == 'http://dallas.example.com/joebob_050689_2.mp3') && (mc2.getProperty('fileSize') == '200') && (mc2.getProperty('type') == 'audio/mpeg') && (mc2.getProperty('url') == 'http://dallas.example.com/joebob_050689_1.mp3'));
-
--->
-<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" >
-<channel>
-<item>
-
-<media:group>
- <media:content fileSize="400" type="audio/mpeg" url="http://dallas.example.com/joebob_050689_2.mp3" />
- <media:content fileSize="200" type="audio/mpeg" url="http://dallas.example.com/joebob_050689_1.mp3" />
-</media:group>
-
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xml/rss2/mrss_group_content_populate_enclosure.xml b/toolkit/components/feeds/test/xml/rss2/mrss_group_content_populate_enclosure.xml
deleted file mode 100644
index f7b9ebabf..000000000
--- a/toolkit/components/feeds/test/xml/rss2/mrss_group_content_populate_enclosure.xml
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<!--
-
-Description: mrss group content works
-Expect: var encs = feed.items.queryElementAt(0, Components.interfaces.nsIFeedEntry).enclosures; encs.QueryInterface(Components.interfaces.nsIArray); var enc1 = encs.queryElementAt(0, Components.interfaces.nsIPropertyBag); var enc2 = encs.queryElementAt(1, Components.interfaces.nsIPropertyBag); ((enc1.getProperty('length') == '400') && (enc1.getProperty('type') == 'audio/mpeg') && (enc1.getProperty('url') == 'http://dallas.example.com/joebob_050689_2.mp3') && (enc2.getProperty('length') == '200') && (enc2.getProperty('type') == 'audio/mpeg') && (enc2.getProperty('url') == 'http://dallas.example.com/joebob_050689_1.mp3'));
-
-
--->
-<rss xmlns:media="http://search.yahoo.com/mrss" version="2.0" >
-<channel>
-<item>
-
-<media:group>
- <media:content fileSize="400" type="audio/mpeg" url="http://dallas.example.com/joebob_050689_2.mp3" />
- <media:content fileSize="200" type="audio/mpeg" url="http://dallas.example.com/joebob_050689_1.mp3" />
-</media:group>
-
-<author>jbb@dallas.example.com (Joe Bob Briggs)</author>
-<comments>http://example.org</comments>
-<title>test</title>
-
-<category domain="foo">bar</category>
-
-<description>I'm headed for France. I wasn't gonna go this year, but then last week &lt;a href="http://www.imdb.com/title/tt0086525/"&gt;Valley Girl&lt;/a&gt; came out and I said to myself, Joe Bob, you gotta get out of the country for a while.</description></item>
-</channel>
-</rss>
diff --git a/toolkit/components/feeds/test/xpcshell.ini b/toolkit/components/feeds/test/xpcshell.ini
deleted file mode 100644
index fbed5e559..000000000
--- a/toolkit/components/feeds/test/xpcshell.ini
+++ /dev/null
@@ -1,209 +0,0 @@
-[DEFAULT]
-head = head.js
-tail =
-skip-if = toolkit == 'android'
-support-files =
- xml/rfc4287/author_namespaces.xml
- xml/rfc4287/entry_link_IANA.xml
- xml/rfc4287/feed_author_email_2.xml
- xml/rfc4287/feed_logo.xml
- xml/rfc4287/entry_author.xml
- xml/rfc4287/entry_link_otherURI_alt.xml
- xml/rfc4287/feed_author_email.xml
- xml/rfc4287/feed_random_attributes_on_feed_and_entry.xml
- xml/rfc4287/entry_content_encoded.xml
- xml/rfc4287/entry_link_payment_alt.xml
- xml/rfc4287/feed_author_name.xml
- xml/rfc4287/feed_rights_normalized.xml
- xml/rfc4287/entry_content_html.xml
- xml/rfc4287/entry_link_random.xml
- xml/rfc4287/feed_author_surrounded.xml
- xml/rfc4287/feed_rights_xhtml_nested_divs.xml
- xml/rfc4287/entry_content_xhtml_with_markup.xml
- xml/rfc4287/entry_published.xml
- xml/rfc4287/feed_author_uri.xml
- xml/rfc4287/feed_rights_xhtml.xml
- xml/rfc4287/entry_content_xhtml.xml
- xml/rfc4287/entry_rights_normalized.xml
- xml/rfc4287/feed_author.xml
- xml/rfc4287/feed_subtitle.xml
- xml/rfc4287/entry_content.xml
- xml/rfc4287/entry_summary.xml
- xml/rfc4287/feed_comment_rss_extra_att.xml
- xml/rfc4287/feed_tantek_title.xml
- xml/rfc4287/entry_contributor.xml
- xml/rfc4287/entry_title_normalized.xml
- xml/rfc4287/feed_contributor.xml
- xml/rfc4287/feed_title_full_feed.xml
- xml/rfc4287/entry_html_cdata.xml
- xml/rfc4287/entry_title.xml
- xml/rfc4287/feed_entry_count.xml
- xml/rfc4287/feed_title_xhtml_entities.xml
- xml/rfc4287/entry_id.xml
- xml/rfc4287/entry_updated.xml
- xml/rfc4287/feed_generator_uri.xml
- xml/rfc4287/feed_title_xhtml.xml
- xml/rfc4287/entry_link_2alts_allcore2.xml
- xml/rfc4287/entry_w_content_encoded.xml
- xml/rfc4287/feed_generator_uri_xmlbase.xml
- xml/rfc4287/feed_title.xml
- xml/rfc4287/entry_link_2alts_allcore.xml
- xml/rfc4287/entry_xhtml_baseURI_with_amp.xml
- xml/rfc4287/feed_generator_version.xml
- xml/rfc4287/feed_updated_invalid.xml
- xml/rfc4287/entry_link_2alts.xml
- xml/rfc4287/entry_xmlBase_on_link.xml
- xml/rfc4287/feed_generator.xml
- xml/rfc4287/feed_updated_normalized.xml
- xml/rfc4287/entry_link_alt_extension.xml
- xml/rfc4287/entry_xmlBase.xml
- xml/rfc4287/feed_icon.xml
- xml/rfc4287/feed_updated.xml
- xml/rfc4287/entry_link_enclosure_populate_enclosures.xml
- xml/rfc4287/feed_atom_rights_xhtml.xml
- xml/rfc4287/feed_id_extra_att.xml
- xml/rfc4287/feed_version.xml
- xml/rfc4287/entry_link_enclosure.xml
- xml/rfc4287/feed_author2.xml
- xml/rfc4287/feed_id.xml
- xml/rfc4287/feed_xmlBase.xml
- xml/rss09x/rss090.xml
- xml/rss09x/rss091_withNS.xml
- xml/rss09x/rss091.xml
- xml/rss09x/rss092.xml
- xml/rss09x/rss093.xml
- xml/rss09x/rss094.xml
- xml/rss09x/rssUnknown.xml
- xml/rss1/feed_bogus_title.xml
- xml/rss1/feed_description_normalized.xml
- xml/rss1/feed_description_with_dc_only.xml
- xml/rss1/feed_description_with_dc.xml
- xml/rss1/feed_description.xml
- xml/rss1/feed_generator.xml
- xml/rss1/feed_id.xml
- xml/rss1/feed_image.xml
- xml/rss1/feed_items_length_zero.xml
- xml/rss1/feed_link_normalized.xml
- xml/rss1/feed_link.xml
- xml/rss1/feed_textInput.xml
- xml/rss1/feed_title_extra_att.xml
- xml/rss1/feed_title_normalized.xml
- xml/rss1/feed_title.xml
- xml/rss1/feed_updated_dctermsmodified.xml
- xml/rss1/feed_updated.xml
- xml/rss1/feed_version.xml
- xml/rss1/full_feed_not_bozo.xml
- xml/rss1/full_feed_unknown_extension.xml
- xml/rss1/full_feed.xml
- xml/rss1/item_2_dc_description.xml
- xml/rss1/item_2_dc_publisher_extra_att_invalid_rdf.xml
- xml/rss1/item_2_dc_publisher.xml
- xml/rss1/item_count.xml
- xml/rss1/item_dc_creator.xml
- xml/rss1/item_dc_description_normalized.xml
- xml/rss1/item_dc_description.xml
- xml/rss1/item_description.xml
- xml/rss1/item_id.xml
- xml/rss1/item_link_normalized.xml
- xml/rss1/item_link.xml
- xml/rss1/item_title_normalized.xml
- xml/rss1/item_title.xml
- xml/rss1/item_updated_dcterms.xml
- xml/rss1/item_wiki_importance_extra_att.xml
- xml/rss2/feed_category_count.xml
- xml/rss2/feed_category.xml
- xml/rss2/feed_cloud.xml
- xml/rss2/feed_copyright_linebreak.xml
- xml/rss2/feed_copyright.xml
- xml/rss2/feed_data_outside_channel.xml
- xml/rss2/feed_dc_contributor.xml
- xml/rss2/feed_dc_creator.xml
- xml/rss2/feed_description_html_cdata.xml
- xml/rss2/feed_description_html.xml
- xml/rss2/feed_description.xml
- xml/rss2/feed_docs.xml
- xml/rss2/feed_generator.xml
- xml/rss2/feed_image_desc_width_height.xml
- xml/rss2/feed_image_desc.xml
- xml/rss2/feed_image_required.xml
- xml/rss2/feed_language.xml
- xml/rss2/feed_lastBuildDate.xml
- xml/rss2/feed_linebreak_link.xml
- xml/rss2/feed_link_cdata.xml
- xml/rss2/feed_link.xml
- xml/rss2/feed_managingEditor_extra_att.xml
- xml/rss2/feed_managingEditor.xml
- xml/rss2/feed_multiple_categories.xml
- xml/rss2/feed_pubDate_invalid.xml
- xml/rss2/feed_pubDate_nonRFC822_1.xml
- xml/rss2/feed_pubDate_nonRFC822_2.xml
- xml/rss2/feed_pubDate_timezoneZ.xml
- xml/rss2/feed_pubDate_utc.xml
- xml/rss2/feed_pubDate.xml
- xml/rss2/feed_rating.xml
- xml/rss2/feed_single_quote_stylesheet_pi.xml
- xml/rss2/feed_skipDays.xml
- xml/rss2/feed_skipHours.xml
- xml/rss2/feed_subtitle_html.xml
- xml/rss2/feed_subtitle_markup_stripped.xml
- xml/rss2/feed_subtitle.xml
- xml/rss2/feed_textinput.xml
- xml/rss2/feed_title_cdata_mixed.xml
- xml/rss2/feed_title_nesting.xml
- xml/rss2/feed_title.xml
- xml/rss2/feed_ttl.xml
- xml/rss2/feed_updated_dcdate.xml
- xml/rss2/feed_updated_lastBuildDate_priority.xml
- xml/rss2/feed_updated_lastBuildDate.xml
- xml/rss2/feed_updated.xml
- xml/rss2/feed_webMaster.xml
- xml/rss2/feed_wfw_commentapi.xml
- xml/rss2/feed_wfw_commentrss.xml
- xml/rss2/feed_wiki_unusual_prefix.xml
- xml/rss2/feed_wiki.xml
- xml/rss2/item_author.xml
- xml/rss2/item_category.xml
- xml/rss2/item_comments.xml
- xml/rss2/item_content_encoded.xml
- xml/rss2/item_count2.xml
- xml/rss2/item_count.xml
- xml/rss2/item_description_2.xml
- xml/rss2/item_description_cdata.xml
- xml/rss2/item_description_decode_entities.xml
- xml/rss2/item_description_normalized_nohtml.xml
- xml/rss2/item_description_normalized.xml
- xml/rss2/item_description.xml
- xml/rss2/item_enclosure_duplicates2.xml
- xml/rss2/item_enclosure_duplicates.xml
- xml/rss2/item_enclosure_mixed2.xml
- xml/rss2/item_enclosure_mixed.xml
- xml/rss2/item_enclosure.xml
- xml/rss2/item_guid_bogus_url.xml
- xml/rss2/item_guid_isPermaLink_default.xml
- xml/rss2/item_guid_isPermaLink_false_uppercase.xml
- xml/rss2/item_guid_isPermaLink_false.xml
- xml/rss2/item_guid_isPermaLink_true_uppercase.xml
- xml/rss2/item_guid_isPermaLink_unknown_value.xml
- xml/rss2/item_guid_isPermaLink.xml
- xml/rss2/item_guid_normalized.xml
- xml/rss2/item_guid_with_link.xml
- xml/rss2/item_guid.xml
- xml/rss2/item_link_normalized.xml
- xml/rss2/item_link.xml
- xml/rss2/item_plain_desc.xml
- xml/rss2/item_populated_enclosures.xml
- xml/rss2/item_pubDate.xml
- xml/rss2/item_published.xml
- xml/rss2/items_2_titles.xml
- xml/rss2/item_title_normalized.xml
- xml/rss2/item_title.xml
- xml/rss2/item_updated_dcdate.xml
- xml/rss2/mrss_content_429049.xml
- xml/rss2/mrss_content_multiple.xml
- xml/rss2/mrss_content_populate_enclosure.xml
- xml/rss2/mrss_content.xml
- xml/rss2/mrss_content2.xml
- xml/rss2/mrss_group_content_populate_enclosure.xml
- xml/rss2/mrss_group_content.xml
-
-[test_xml.js]
diff --git a/toolkit/components/filepicker/moz.build b/toolkit/components/filepicker/moz.build
index 0990cb00f..961912068 100644
--- a/toolkit/components/filepicker/moz.build
+++ b/toolkit/components/filepicker/moz.build
@@ -4,22 +4,16 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+XPIDL_SOURCES += ['nsIFileView.idl']
+
XPIDL_MODULE = 'filepicker'
-XPIDL_SOURCES += [
- 'nsIFileView.idl',
-]
-SOURCES += [
- 'nsFileView.cpp',
-]
-EXTRA_COMPONENTS += [
- 'nsFilePicker.js',
-]
-EXTRA_PP_COMPONENTS += [
- 'nsFilePicker.manifest',
-]
-XPCSHELL_TESTS_MANIFESTS += [
- 'test/unit/xpcshell.ini',
-]
+
+SOURCES += ['nsFileView.cpp']
+
+EXTRA_COMPONENTS += ['nsFilePicker.js']
+
+EXTRA_PP_COMPONENTS += ['nsFilePicker.manifest']
+
FINAL_LIBRARY = 'xul'
JAR_MANIFESTS += ['jar.mn']
diff --git a/toolkit/components/filepicker/test/unit/.eslintrc.js b/toolkit/components/filepicker/test/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/filepicker/test/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/filepicker/test/unit/test_filecomplete.js b/toolkit/components/filepicker/test/unit/test_filecomplete.js
deleted file mode 100644
index d1e18d533..000000000
--- a/toolkit/components/filepicker/test/unit/test_filecomplete.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Start by getting an empty directory.
-var dir = do_get_profile();
-dir.append("temp");
-dir.create(dir.DIRECTORY_TYPE, -1);
-var path = dir.path + "/";
-
-// Now create some sample entries.
-var file = dir.clone();
-file.append("test_file");
-file.create(file.NORMAL_FILE_TYPE, -1);
-file = dir.clone();
-file.append("other_file");
-file.create(file.NORMAL_FILE_TYPE, -1);
-dir.append("test_dir");
-dir.create(dir.DIRECTORY_TYPE, -1);
-
-var gListener = {
- onSearchResult: function(aSearch, aResult) {
- // Check that we got same search string back.
- do_check_eq(aResult.searchString, "test");
- // Check that the search succeeded.
- do_check_eq(aResult.searchResult, aResult.RESULT_SUCCESS);
- // Check that we got two results.
- do_check_eq(aResult.matchCount, 2);
- // Check that the first result is the directory we created.
- do_check_eq(aResult.getValueAt(0), "test_dir");
- // Check that the first result has directory style.
- do_check_eq(aResult.getStyleAt(0), "directory");
- // Check that the second result is the file we created.
- do_check_eq(aResult.getValueAt(1), "test_file");
- // Check that the second result has file style.
- do_check_eq(aResult.getStyleAt(1), "file");
- }
-};
-
-function run_test()
-{
- Components.classes["@mozilla.org/autocomplete/search;1?name=file"]
- .getService(Components.interfaces.nsIAutoCompleteSearch)
- .startSearch("test", path, null, gListener);
-}
diff --git a/toolkit/components/filepicker/test/unit/xpcshell.ini b/toolkit/components/filepicker/test/unit/xpcshell.ini
deleted file mode 100644
index 1a0a002dc..000000000
--- a/toolkit/components/filepicker/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[DEFAULT]
-head =
-tail =
-skip-if = toolkit == 'android'
-
-[test_filecomplete.js]
-skip-if = os != 'linux'
diff --git a/toolkit/components/filewatcher/moz.build b/toolkit/components/filewatcher/moz.build
index 5ce94b5d2..948a67bf9 100644
--- a/toolkit/components/filewatcher/moz.build
+++ b/toolkit/components/filewatcher/moz.build
@@ -4,20 +4,14 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
+XPIDL_MODULE = 'toolkit_filewatcher'
+
+XPIDL_SOURCES += ['nsINativeFileWatcher.idl']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
EXPORTS += ['NativeFileWatcherWin.h']
- UNIFIED_SOURCES += [
- 'NativeFileWatcherWin.cpp',
- ]
+ UNIFIED_SOURCES += ['NativeFileWatcherWin.cpp']
else:
EXPORTS += ['NativeFileWatcherNotSupported.h']
-XPIDL_MODULE = 'toolkit_filewatcher'
-
-XPIDL_SOURCES += [
- 'nsINativeFileWatcher.idl',
-]
-
FINAL_LIBRARY = 'xul'
diff --git a/toolkit/components/filewatcher/tests/xpcshell/.eslintrc.js b/toolkit/components/filewatcher/tests/xpcshell/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/filewatcher/tests/xpcshell/head.js b/toolkit/components/filewatcher/tests/xpcshell/head.js
deleted file mode 100644
index 73f8ac4f5..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/head.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/osfile.jsm", this);
-Cu.import("resource://gre/modules/Promise.jsm", this);
-
-function makeWatcher() {
- let watcher =
- Cc['@mozilla.org/toolkit/filewatcher/native-file-watcher;1']
- .getService(Ci.nsINativeFileWatcherService);
- return watcher;
-}
-
-function promiseAddPath(watcher, resource, onChange=null, onError=null) {
- return new Promise(resolve =>
- watcher.addPath(resource, onChange, onError, resolve)
- );
-}
-
-function promiseRemovePath(watcher, resource, onChange=null, onError=null) {
- return new Promise(resolve =>
- watcher.removePath(resource, onChange, onError, resolve)
- );
-}
diff --git a/toolkit/components/filewatcher/tests/xpcshell/test_arguments.js b/toolkit/components/filewatcher/tests/xpcshell/test_arguments.js
deleted file mode 100644
index 7e62b1cb6..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/test_arguments.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-function run_test() {
- // Set up profile. We will use profile path create some test files.
- do_get_profile();
-
- // Start executing the tests.
- run_next_test();
-}
-
-/**
- * Test for addPath usage with null arguments.
- */
-add_task(function* test_null_args_addPath() {
-
- let watcher = makeWatcher();
- let testPath = 'someInvalidPath';
-
- // Define a dummy callback function. In this test no callback is
- // expected to be called.
- let dummyFunc = function(changed) {
- do_throw("Not expected in this test.");
- };
-
- // Check for error when passing a null first argument
- try {
- watcher.addPath(testPath, null, dummyFunc);
- } catch (ex) {
- if (ex.result != Cr.NS_ERROR_NULL_POINTER)
- throw ex;
- do_print("Initialisation thrown NS_ERROR_NULL_POINTER as expected.");
- }
-
- // Check for error when passing both null arguments
- try {
- watcher.addPath(testPath, null, null);
- } catch (ex) {
- if (ex.result != Cr.NS_ERROR_NULL_POINTER)
- throw ex;
- do_print("Initialisation thrown NS_ERROR_NULL_POINTER as expected.");
- }
-});
-
-/**
- * Test for removePath usage with null arguments.
- */
-add_task(function* test_null_args_removePath() {
-
- let watcher = makeWatcher();
- let testPath = 'someInvalidPath';
-
- // Define a dummy callback function. In this test no callback is
- // expected to be called.
- let dummyFunc = function(changed) {
- do_throw("Not expected in this test.");
- };
-
- // Check for error when passing a null first argument
- try {
- watcher.removePath(testPath, null, dummyFunc);
- } catch (ex) {
- if (ex.result != Cr.NS_ERROR_NULL_POINTER)
- throw ex;
- do_print("Initialisation thrown NS_ERROR_NULL_POINTER as expected.");
- }
-
- // Check for error when passing both null arguments
- try {
- watcher.removePath(testPath, null, null);
- } catch (ex) {
- if (ex.result != Cr.NS_ERROR_NULL_POINTER)
- throw ex;
- do_print("Initialisation thrown NS_ERROR_NULL_POINTER as expected.");
- }
-});
diff --git a/toolkit/components/filewatcher/tests/xpcshell/test_no_error_callback.js b/toolkit/components/filewatcher/tests/xpcshell/test_no_error_callback.js
deleted file mode 100644
index e5ceb33e5..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/test_no_error_callback.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-function run_test() {
- // Set up profile. We will use profile path create some test files.
- do_get_profile();
-
- // Start executing the tests.
- run_next_test();
-}
-
-/**
- * Test the component behaves correctly when no error callback is
- * provided and an error occurs.
- */
-add_task(function* test_error_with_no_error_callback() {
-
- let watcher = makeWatcher();
- let testPath = 'someInvalidPath';
-
- // Define a dummy callback function. In this test no callback is
- // expected to be called.
- let dummyFunc = function(changed) {
- do_throw("Not expected in this test.");
- };
-
- // We don't pass an error callback and try to watch an invalid
- // path.
- watcher.addPath(testPath, dummyFunc);
-});
-
-/**
- * Test the component behaves correctly when no error callback is
- * provided (no error should occur).
- */
-add_task(function* test_watch_single_path_file_creation_no_error_cb() {
-
- // Create and watch a sub-directory of the profile directory so we don't
- // catch notifications we're not interested in (i.e. "startupCache").
- let watchedDir = OS.Path.join(OS.Constants.Path.profileDir, "filewatcher_playground");
- yield OS.File.makeDir(watchedDir);
-
- let tempFileName = "test_filecreation.tmp";
-
- // Instantiate and initialize the native watcher.
- let watcher = makeWatcher();
- let deferred = Promise.defer();
-
- // Watch the profile directory but do not pass an error callback.
- yield promiseAddPath(watcher, watchedDir, deferred.resolve);
-
- // Create a file within the watched directory.
- let tmpFilePath = OS.Path.join(watchedDir, tempFileName);
- yield OS.File.writeAtomic(tmpFilePath, "some data");
-
- // Wait until the watcher informs us that the file was created.
- let changed = yield deferred.promise;
- do_check_eq(changed, tmpFilePath);
-
- // Remove the watch and free the associated memory (we need to
- // reuse 'deferred.resolve' to unregister).
- watcher.removePath(watchedDir, deferred.resolve);
-
- // Remove the test directory and all of its content.
- yield OS.File.removeDir(watchedDir);
-});
diff --git a/toolkit/components/filewatcher/tests/xpcshell/test_remove_non_watched.js b/toolkit/components/filewatcher/tests/xpcshell/test_remove_non_watched.js
deleted file mode 100644
index 1375584a3..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/test_remove_non_watched.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-function run_test() {
- // Set up profile. We will use profile path create some test files.
- do_get_profile();
-
- // Start executing the tests.
- run_next_test();
-}
-
-/**
- * Test removing non watched path
- */
-add_task(function* test_remove_not_watched() {
- let nonExistingDir =
- OS.Path.join(OS.Constants.Path.profileDir, "absolutelyNotExisting");
-
- // Instantiate the native watcher.
- let watcher = makeWatcher();
-
- // Try to un-watch a path which wasn't being watched.
- watcher.removePath(
- nonExistingDir,
- function(changed) {
- do_throw("No change is expected in this test.");
- },
- function(xpcomError, osError) {
- // When removing a resource which wasn't being watched, it should silently
- // ignore the request.
- do_throw("Unexpected exception: "
- + xpcomError + " (XPCOM) "
- + osError + " (OS Error)");
- }
- );
-});
diff --git a/toolkit/components/filewatcher/tests/xpcshell/test_shared_callback.js b/toolkit/components/filewatcher/tests/xpcshell/test_shared_callback.js
deleted file mode 100644
index 482ba6b8b..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/test_shared_callback.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-function run_test() {
- // Set up profile. We will use profile path create some test files.
- do_get_profile();
-
- // Start executing the tests.
- run_next_test();
-}
-
-/**
- * Test the watcher correctly handles two watches sharing the same
- * change callback.
- */
-add_task(function* test_watch_with_shared_callback() {
-
- // Create and watch two sub-directories of the profile directory so we don't
- // catch notifications we're not interested in (i.e. "startupCache").
- let watchedDirs =
- [
- OS.Path.join(OS.Constants.Path.profileDir, "filewatcher_playground"),
- OS.Path.join(OS.Constants.Path.profileDir, "filewatcher_playground2")
- ];
-
- yield OS.File.makeDir(watchedDirs[0]);
- yield OS.File.makeDir(watchedDirs[1]);
-
- let tempFileName = "test_filecreation.tmp";
-
- // Instantiate and initialize the native watcher.
- let watcher = makeWatcher();
- let deferred = Promise.defer();
-
- // Watch both directories using the same callbacks.
- yield promiseAddPath(watcher, watchedDirs[0], deferred.resolve, deferred.reject);
- yield promiseAddPath(watcher, watchedDirs[1], deferred.resolve, deferred.reject);
-
- // Remove the watch for the first directory, but keep watching
- // for changes in the second: we need to make sure the callback
- // survives the removal of the first watch.
- watcher.removePath(watchedDirs[0], deferred.resolve, deferred.reject);
-
- // Create a file within the watched directory.
- let tmpFilePath = OS.Path.join(watchedDirs[1], tempFileName);
- yield OS.File.writeAtomic(tmpFilePath, "some data");
-
- // Wait until the watcher informs us that the file was created.
- let changed = yield deferred.promise;
- do_check_eq(changed, tmpFilePath);
-
- // Remove the watch and free the associated memory (we need to
- // reuse 'deferred.resolve' and 'deferred.reject' to unregister).
- watcher.removePath(watchedDirs[1], deferred.resolve, deferred.reject);
-
- // Remove the test directories and all of their content.
- yield OS.File.removeDir(watchedDirs[0]);
- yield OS.File.removeDir(watchedDirs[1]);
-});
diff --git a/toolkit/components/filewatcher/tests/xpcshell/test_watch_directory_creation_single.js b/toolkit/components/filewatcher/tests/xpcshell/test_watch_directory_creation_single.js
deleted file mode 100644
index a434ec751..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/test_watch_directory_creation_single.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-function run_test() {
- // Set up profile. We will use profile path create some test files
- do_get_profile();
-
- // Start executing the tests
- run_next_test();
-}
-
-/**
- * Tests that the watcher correctly notifies of a directory creation when watching
- * a single path.
- */
-add_task(function* test_watch_single_path_directory_creation() {
-
- // Create and watch a sub-directory of the profile directory so we don't
- // catch notifications we're not interested in (i.e. "startupCache").
- let watchedDir = OS.Path.join(OS.Constants.Path.profileDir, "filewatcher_playground");
- yield OS.File.makeDir(watchedDir);
-
- let tmpDirPath = OS.Path.join(watchedDir, "testdir");
-
- // Instantiate and initialize the native watcher.
- let watcher = makeWatcher();
- let deferred = Promise.defer();
-
- // Add the profile directory to the watch list and wait for the file watcher
- // to start watching.
- yield promiseAddPath(watcher, watchedDir, deferred.resolve, deferred.reject);
-
- // Once ready, create a directory within the watched directory.
- yield OS.File.makeDir(tmpDirPath);
-
- // Wait until the watcher informs us that the file has changed.
- let changed = yield deferred.promise;
- do_check_eq(changed, tmpDirPath);
-
- // Remove the watch and free the associated memory (we need to
- // reuse 'deferred.resolve' and 'deferred.reject' to unregister).
- yield promiseRemovePath(watcher, watchedDir, deferred.resolve, deferred.reject);
-
- // Clean up the test directory.
- yield OS.File.removeDir(watchedDir);
-});
diff --git a/toolkit/components/filewatcher/tests/xpcshell/test_watch_directory_deletion_single.js b/toolkit/components/filewatcher/tests/xpcshell/test_watch_directory_deletion_single.js
deleted file mode 100644
index 2c74a9361..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/test_watch_directory_deletion_single.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-function run_test() {
- // Set up profile. We will use profile path create some test files.
- do_get_profile();
-
- // Start executing the tests.
- run_next_test();
-}
-
-/**
- * Tests that the watcher correctly notifies of a directory deletion when watching
- * a single path.
- */
-add_task(function* test_watch_single_path_directory_deletion() {
-
- let watchedDir = OS.Constants.Path.profileDir;
- let tempDirName = "test";
- let tmpDirPath = OS.Path.join(watchedDir, tempDirName);
-
- // Instantiate and initialize the native watcher.
- let watcher = makeWatcher();
- let deferred = Promise.defer();
-
- // Create a directory within the watched directory.
- yield OS.File.makeDir(tmpDirPath);
-
- // Add the profile directory to the watch list and wait for the file watcher
- // to start watching it.
- yield promiseAddPath(watcher, watchedDir, deferred.resolve, deferred.reject);
-
- // Remove the directory.
- OS.File.removeDir(tmpDirPath);
-
- // Wait until the watcher informs us that the file has changed.
- let changed = yield deferred.promise;
- do_check_eq(changed, tmpDirPath);
-
- // Remove the watch and free the associated memory (we need to
- // reuse 'deferred.resolve' and 'deferred.reject' to unregister).
- yield promiseRemovePath(watcher, watchedDir, deferred.resolve, deferred.reject);
-});
diff --git a/toolkit/components/filewatcher/tests/xpcshell/test_watch_file_creation_single.js b/toolkit/components/filewatcher/tests/xpcshell/test_watch_file_creation_single.js
deleted file mode 100644
index 9f87793f4..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/test_watch_file_creation_single.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-function run_test() {
- // Set up profile. We will use profile path create some test files.
- do_get_profile();
-
- // Start executing the tests.
- run_next_test();
-}
-
-/**
- * Test the watcher correctly notifies of a file creation when watching
- * a single path.
- */
-add_task(function* test_watch_single_path_file_creation() {
-
- // Create and watch a sub-directory of the profile directory so we don't
- // catch notifications we're not interested in (i.e. "startupCache").
- let watchedDir = OS.Path.join(OS.Constants.Path.profileDir, "filewatcher_playground");
- yield OS.File.makeDir(watchedDir);
-
- let tempFileName = "test_filecreation.tmp";
-
- // Instantiate and initialize the native watcher.
- let watcher = makeWatcher();
- let deferred = Promise.defer();
-
- let tmpFilePath = OS.Path.join(watchedDir, tempFileName);
-
- // Add the profile directory to the watch list and wait for the file watcher
- // to start watching.
- yield promiseAddPath(watcher, watchedDir, deferred.resolve, deferred.reject);
-
- // create the file within the watched directory.
- yield OS.File.writeAtomic(tmpFilePath, "some data");
-
- // Wait until the watcher informs us that the file was created.
- let changed = yield deferred.promise;
- do_check_eq(changed, tmpFilePath);
-
- // Remove the watch and free the associated memory (we need to
- // reuse 'deferred.resolve' and 'deferred.reject' to unregister).
- yield promiseRemovePath(watcher, watchedDir, deferred.resolve, deferred.reject);
-
- // Remove the test directory and all of its content.
- yield OS.File.removeDir(watchedDir);
-});
diff --git a/toolkit/components/filewatcher/tests/xpcshell/test_watch_file_deletion_single.js b/toolkit/components/filewatcher/tests/xpcshell/test_watch_file_deletion_single.js
deleted file mode 100644
index 97d2d61bc..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/test_watch_file_deletion_single.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-function run_test() {
- // Set up profile. We will use profile path create some test files.
- do_get_profile();
-
- // Start executing the tests.
- run_next_test();
-}
-/**
- * Test the watcher correctly notifies of a file deletion when watching
- * a single path.
- */
-add_task(function* test_watch_single_path_file_deletion() {
-
- // Create and watch a sub-directory of the profile directory so we don't
- // catch notifications we're not interested in (i.e. "startupCache").
- let watchedDir = OS.Path.join(OS.Constants.Path.profileDir, "filewatcher_playground");
- yield OS.File.makeDir(watchedDir);
-
- let tempFileName = "test_filedeletion.tmp";
-
- // Instantiate and initialize the native watcher.
- let watcher = makeWatcher();
- let deferred = Promise.defer();
-
- // Create a file within the directory to be watched. We do this
- // before watching the directory so we do not get the creation notification.
- let tmpFilePath = OS.Path.join(watchedDir, tempFileName);
- yield OS.File.writeAtomic(tmpFilePath, "some data");
-
- // Add the profile directory to the watch list and wait for the file watcher
- // to start watching it.
- yield promiseAddPath(watcher, watchedDir, deferred.resolve, deferred.reject);
-
- // Remove the file we created (should trigger a notification).
- do_print('Removing ' + tmpFilePath);
- yield OS.File.remove(tmpFilePath);
-
- // Wait until the watcher informs us that the file was deleted.
- let changed = yield deferred.promise;
- do_check_eq(changed, tmpFilePath);
-
- // Remove the watch and free the associated memory (we need to
- // reuse 'deferred.resolve' and 'deferred.reject' to unregister).
- yield promiseRemovePath(watcher, watchedDir, deferred.resolve, deferred.reject);
-
- // Remove the test directory and all of its content.
- yield OS.File.removeDir(watchedDir);
-});
diff --git a/toolkit/components/filewatcher/tests/xpcshell/test_watch_file_modification_single.js b/toolkit/components/filewatcher/tests/xpcshell/test_watch_file_modification_single.js
deleted file mode 100644
index ba25fdff6..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/test_watch_file_modification_single.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-function run_test() {
- // Set up profile. We will use profile path create some test files
- do_get_profile();
-
- // Start executing the tests
- run_next_test();
-}
-
-/**
- * Tests that the watcher correctly notifies of a file modification when watching
- * a single path.
- */
-add_task(function* test_watch_single_path_file_modification() {
-
- // Create and watch a sub-directory of the profile directory so we don't
- // catch notifications we're not interested in (i.e. "startupCache").
- let watchedDir = OS.Path.join(OS.Constants.Path.profileDir, "filewatcher_playground");
- yield OS.File.makeDir(watchedDir);
-
- let tempFileName = "test_filemodification.tmp";
-
- // Instantiate and initialize the native watcher.
- let watcher = makeWatcher();
- let deferred = Promise.defer();
-
- // Create a file within the directory to be watched. We do this
- // before watching the directory so we do not get the creation notification.
- let tmpFilePath = OS.Path.join(watchedDir, tempFileName);
- yield OS.File.writeAtomic(tmpFilePath, "some data");
-
- // Add the profile directory to the watch list and wait for the file watcher
- // to start watching it.
- yield promiseAddPath(watcher, watchedDir, deferred.resolve, deferred.reject);
-
- // Once ready, modify the file to trigger the notification.
- yield OS.File.writeAtomic(tmpFilePath, "some new data");
-
- // Wait until the watcher informs us that the file has changed.
- let changed = yield deferred.promise;
- do_check_eq(changed, tmpFilePath);
-
- // Remove the watch and free the associated memory (we need to
- // reuse 'deferred.resolve' and 'deferred.reject' to unregister).
- yield promiseRemovePath(watcher, watchedDir, deferred.resolve, deferred.reject);
-
- // Remove the test directory and all of its content.
- yield OS.File.removeDir(watchedDir);
-});
diff --git a/toolkit/components/filewatcher/tests/xpcshell/test_watch_many_changes.js b/toolkit/components/filewatcher/tests/xpcshell/test_watch_many_changes.js
deleted file mode 100644
index c236c6e1d..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/test_watch_many_changes.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-function run_test() {
- // Set up profile. We will use profile path create some test files
- do_get_profile();
-
- // Start executing the tests
- run_next_test();
-}
-
-/**
- * Test that we correctly handle watching directories when hundreds of files
- * change simultaneously.
- */
-add_task(function* test_fill_notification_buffer() {
-
- // Create and watch a sub-directory of the profile directory so we don't
- // catch notifications we're not interested in (i.e. "startupCache").
- let watchedDir = OS.Path.join(OS.Constants.Path.profileDir, "filewatcher_playground");
- yield OS.File.makeDir(watchedDir);
-
- // The number of files to create.
- let numberOfFiles = 100;
- let fileNameBase = "testFile";
-
- // This will be used to keep track of the number of changes within the watched
- // directory.
- let detectedChanges = 0;
-
- // We expect at least the following notifications for each file:
- // - File creation
- // - File deletion
- let expectedChanges = numberOfFiles * 2;
-
- // Instantiate the native watcher.
- let watcher = makeWatcher();
- let deferred = Promise.defer();
-
- // Initialise the change callback.
- let changeCallback = function(changed) {
- do_print(changed + " has changed.");
-
- detectedChanges += 1;
-
- // Resolve the promise if we get all the expected changes.
- if (detectedChanges >= expectedChanges) {
- deferred.resolve();
- }
- };
-
- // Add the profile directory to the watch list and wait for the file watcher
- // to start watching it.
- yield promiseAddPath(watcher, watchedDir, changeCallback, deferred.reject);
-
- // Create and then remove the files within the watched directory.
- for (let i = 0; i < numberOfFiles; i++) {
- let tmpFilePath = OS.Path.join(watchedDir, fileNameBase + i);
- yield OS.File.writeAtomic(tmpFilePath, "test content");
- yield OS.File.remove(tmpFilePath);
- }
-
- // Wait until the watcher informs us that all the files were
- // created, modified and removed.
- yield deferred.promise;
-
- // Remove the watch and free the associated memory (we need to
- // reuse 'changeCallback' and 'errorCallback' to unregister).
- yield promiseRemovePath(watcher, watchedDir, changeCallback, deferred.reject);
-});
diff --git a/toolkit/components/filewatcher/tests/xpcshell/test_watch_multi_paths.js b/toolkit/components/filewatcher/tests/xpcshell/test_watch_multi_paths.js
deleted file mode 100644
index c55b262f1..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/test_watch_multi_paths.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-function run_test() {
- // Set up profile. We will use profile path create some test files
- do_get_profile();
-
- // Start executing the tests
- run_next_test();
-}
-
-/**
- * Tests the watcher by watching several resources.
- * This test creates the specified number of directory inside the profile
- * directory, adds each one of them to the watched list the creates
- * a file in them in order to trigger the notification.
- * The test keeps track of the number of times the changes callback is
- * called in order to verify the success of the test.
- */
-add_task(function* test_watch_multi_paths() {
-
- // The number of resources to watch. We expect changes for
- // creating a file within each directory.
- let resourcesToWatch = 5;
- let watchedDir = OS.Constants.Path.profileDir;
-
- // The directories to be watched will be created with.
- let tempDirNameBase = "FileWatcher_Test_";
- let tempFileName = "test.tmp";
-
- // Instantiate the native watcher.
- let watcher = makeWatcher();
-
- // This will be used to keep track of the number of changes within the watched
- // resources.
- let detectedChanges = 0;
- let watchedResources = 0;
- let unwatchedResources = 0;
-
- let deferredChanges = Promise.defer();
- let deferredSuccesses = Promise.defer();
- let deferredShutdown = Promise.defer();
-
- // Define the change callback function.
- let changeCallback = function(changed) {
- do_print(changed + " has changed.");
-
- detectedChanges += 1;
-
- // Resolve the promise if we get all the expected changes.
- if (detectedChanges === resourcesToWatch) {
- deferredChanges.resolve();
- }
- };
-
- // Define the watch success callback function.
- let watchSuccessCallback = function(resourcePath) {
- do_print(resourcePath + " is being watched.");
-
- watchedResources += 1;
-
- // Resolve the promise when all the resources are being
- // watched.
- if (watchedResources === resourcesToWatch) {
- deferredSuccesses.resolve();
- }
- };
-
- // Define the watch success callback function.
- let unwatchSuccessCallback = function(resourcePath) {
- do_print(resourcePath + " is being un-watched.");
-
- unwatchedResources += 1;
-
- // Resolve the promise when all the resources are being
- // watched.
- if (unwatchedResources === resourcesToWatch) {
- deferredShutdown.resolve();
- }
- };
-
- // Create the directories and add them to the watched resources list.
- for (let i = 0; i < resourcesToWatch; i++) {
- let tmpSubDirPath = OS.Path.join(watchedDir, tempDirNameBase + i);
- do_print("Creating the " + tmpSubDirPath + " directory.");
- yield OS.File.makeDir(tmpSubDirPath);
- watcher.addPath(tmpSubDirPath, changeCallback, deferredChanges.reject, watchSuccessCallback);
- }
-
- // Wait until the watcher informs us that all the desired resources
- // are being watched.
- yield deferredSuccesses.promise;
-
- // Create a file within each watched directory.
- for (let i = 0; i < resourcesToWatch; i++) {
- let tmpFilePath = OS.Path.join(watchedDir, tempDirNameBase + i, tempFileName);
- yield OS.File.writeAtomic(tmpFilePath, "test content");
- }
-
- // Wait until the watcher informs us that all the files were created.
- yield deferredChanges.promise;
-
- // Remove the directories we have created.
- for (let i = 0; i < resourcesToWatch; i++) {
- let tmpSubDirPath = OS.Path.join(watchedDir, tempDirNameBase + i);
- watcher.removePath(tmpSubDirPath, changeCallback, deferredChanges.reject, unwatchSuccessCallback);
- }
-
- // Wait until the watcher un-watches the resources.
- yield deferredShutdown.promise;
-});
diff --git a/toolkit/components/filewatcher/tests/xpcshell/test_watch_recursively.js b/toolkit/components/filewatcher/tests/xpcshell/test_watch_recursively.js
deleted file mode 100644
index 13a3de8d3..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/test_watch_recursively.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-function run_test() {
- // Set up profile. We will use profile path create some test files.
- do_get_profile();
-
- // Start executing the tests.
- run_next_test();
-}
-
-/**
- * Test the watcher correctly notifies of a file creation in a subdirectory
- * of the watched sub-directory (recursion).
- */
-add_task(function* test_watch_recursively() {
-
- // Create and watch a sub-directory of the profile directory so we don't
- // catch notifications we're not interested in (i.e. "startupCache").
- let watchedDir = OS.Path.join(OS.Constants.Path.profileDir, "filewatcher_playground");
- yield OS.File.makeDir(watchedDir);
-
- // We need at least 2 levels of directories to test recursion.
- let subdirectory = OS.Path.join(watchedDir, "level1");
- yield OS.File.makeDir(subdirectory);
-
- let tempFileName = "test_filecreation.tmp";
-
- // Instantiate and initialize the native watcher.
- let watcher = makeWatcher();
- let deferred = Promise.defer();
-
- let tmpFilePath = OS.Path.join(subdirectory, tempFileName);
-
- // Add the profile directory to the watch list and wait for the file watcher
- // to start watching it.
- yield promiseAddPath(watcher, watchedDir, deferred.resolve, deferred.reject);
-
- // Create a file within the subdirectory of the watched directory.
- yield OS.File.writeAtomic(tmpFilePath, "some data");
-
- // Wait until the watcher informs us that the file was created.
- let changed = yield deferred.promise;
- do_check_eq(changed, tmpFilePath);
-
- // Remove the watch and free the associated memory (we need to
- // reuse 'deferred.resolve' and 'deferred.reject' to unregister).
- yield promiseRemovePath(watcher, watchedDir, deferred.resolve, deferred.reject);
-
- // Remove the test directory and all of its content.
- yield OS.File.removeDir(watchedDir);
-});
diff --git a/toolkit/components/filewatcher/tests/xpcshell/test_watch_resource.js b/toolkit/components/filewatcher/tests/xpcshell/test_watch_resource.js
deleted file mode 100644
index fffdff24b..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/test_watch_resource.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-function run_test() {
- // Set up profile. We will use profile path create some test files
- do_get_profile();
-
- // Start executing the tests
- run_next_test();
-}
-
-/**
- * Test watching non-existing path
- */
-add_task(function* test_watching_non_existing() {
- let notExistingDir =
- OS.Path.join(OS.Constants.Path.profileDir, "absolutelyNotExisting");
-
- // Instantiate the native watcher.
- let watcher = makeWatcher();
- let deferred = Promise.defer();
-
- // Try watch a path which doesn't exist.
- watcher.addPath(notExistingDir, deferred.reject, deferred.resolve);
-
- // Wait until the watcher informs us that there was an error.
- let error = yield deferred.promise;
- do_check_eq(error, Components.results.NS_ERROR_FILE_NOT_FOUND);
-});
diff --git a/toolkit/components/filewatcher/tests/xpcshell/xpcshell.ini b/toolkit/components/filewatcher/tests/xpcshell/xpcshell.ini
deleted file mode 100644
index d6cc968eb..000000000
--- a/toolkit/components/filewatcher/tests/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,18 +0,0 @@
-[DEFAULT]
-head = head.js
-tail =
-skip-if = os != "win"
-
-[test_arguments.js]
-[test_no_error_callback.js]
-[test_remove_non_watched.js]
-[test_shared_callback.js]
-[test_watch_file_creation_single.js]
-[test_watch_file_deletion_single.js]
-[test_watch_file_modification_single.js]
-[test_watch_directory_creation_single.js]
-[test_watch_directory_deletion_single.js]
-[test_watch_many_changes.js]
-[test_watch_multi_paths.js]
-[test_watch_recursively.js]
-[test_watch_resource.js]
diff --git a/toolkit/components/formautofill/moz.build b/toolkit/components/formautofill/moz.build
index 2c2179f81..3dfc58281 100644
--- a/toolkit/components/formautofill/moz.build
+++ b/toolkit/components/formautofill/moz.build
@@ -4,22 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-if CONFIG['NIGHTLY_BUILD']:
- BROWSER_CHROME_MANIFESTS += [
- 'test/browser/browser.ini',
- ]
-
- MOCHITEST_CHROME_MANIFESTS += [
- 'test/chrome/chrome.ini',
- ]
-
-XPCSHELL_TESTS_MANIFESTS += [
- 'test/xpcshell/xpcshell.ini',
-]
-
-XPIDL_SOURCES += [
- 'nsIFormAutofillContentService.idl',
-]
+XPIDL_SOURCES += ['nsIFormAutofillContentService.idl']
XPIDL_MODULE = 'toolkit_formautofill'
@@ -28,9 +13,7 @@ EXTRA_COMPONENTS += [
'FormAutofillStartup.js',
]
-EXTRA_PP_COMPONENTS += [
- 'formautofill.manifest',
-]
+EXTRA_PP_COMPONENTS += ['formautofill.manifest']
EXTRA_JS_MODULES += [
'content/RequestAutocompleteUI.jsm',
@@ -38,9 +21,4 @@ EXTRA_JS_MODULES += [
'FormAutofillIntegration.jsm',
]
-JAR_MANIFESTS += [
- 'jar.mn',
-]
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Form Manager')
+JAR_MANIFESTS += ['jar.mn']
diff --git a/toolkit/components/formautofill/test/browser/.eslintrc.js b/toolkit/components/formautofill/test/browser/.eslintrc.js
deleted file mode 100644
index 7c8021192..000000000
--- a/toolkit/components/formautofill/test/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/formautofill/test/browser/browser.ini b/toolkit/components/formautofill/test/browser/browser.ini
deleted file mode 100644
index dff9c3381..000000000
--- a/toolkit/components/formautofill/test/browser/browser.ini
+++ /dev/null
@@ -1,10 +0,0 @@
-[DEFAULT]
-# The following files starting with ".." are installed in the current folder.
-support-files =
- ../head_common.js
- ../loader_common.js
- head.js
- loader.js
-
-[browser_infrastructure.js]
-[browser_ui_requestAutocomplete.js]
diff --git a/toolkit/components/formautofill/test/browser/browser_infrastructure.js b/toolkit/components/formautofill/test/browser/browser_infrastructure.js
deleted file mode 100644
index af27cfdb5..000000000
--- a/toolkit/components/formautofill/test/browser/browser_infrastructure.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Tests the local testing infrastructure.
- */
-
-"use strict";
-
-/**
- * Tests the truth assertion function.
- */
-add_task(function* test_assert_truth() {
- Assert.ok(1 != 2);
-});
-
-/**
- * Tests the equality assertion function.
- */
-add_task(function* test_assert_equality() {
- Assert.equal(1 + 1, 2);
-});
-
-/**
- * Uses some of the utility functions provided by the framework.
- */
-add_task(function* test_utility_functions() {
- // The "print" function is useful to log information that is not known before.
- let randomString = "R" + Math.floor(Math.random() * 10);
- Output.print("The random contents will be '" + randomString + "'.");
-
- // Create the text file with the random contents.
- let path = yield TestUtils.getTempFile("test-infrastructure.txt");
- yield OS.File.writeAtomic(path, new TextEncoder().encode(randomString));
-
- // Test a few utility functions.
- yield TestUtils.waitForTick();
- yield TestUtils.waitMs(50);
-
- let promiseMyNotification = TestUtils.waitForNotification("my-topic");
- Services.obs.notifyObservers(null, "my-topic", "");
- yield promiseMyNotification;
-
- // Check the file size. The file will be deleted automatically later.
- Assert.equal((yield OS.File.stat(path)).size, randomString.length);
-});
-
-add_task(terminationTaskFn);
diff --git a/toolkit/components/formautofill/test/browser/browser_ui_requestAutocomplete.js b/toolkit/components/formautofill/test/browser/browser_ui_requestAutocomplete.js
deleted file mode 100644
index 2a7b58f12..000000000
--- a/toolkit/components/formautofill/test/browser/browser_ui_requestAutocomplete.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Tests the requestAutocomplete user interface.
- */
-
-"use strict";
-
-/**
- * Open the requestAutocomplete UI and test that selecting a profile results in
- * the correct data being sent back to the opener.
- */
-add_task(function* test_select_profile() {
- // Request an e-mail address.
- let { uiWindow, promiseResult } = yield FormAutofillTest.showUI(
- TestData.requestEmailOnly);
-
- // Accept the dialog.
- let acceptButton = uiWindow.document.getElementById("accept");
- EventUtils.synthesizeMouseAtCenter(acceptButton, {}, uiWindow);
-
- let result = yield promiseResult;
- Assert.equal(result.fields.length, 1);
- Assert.equal(result.fields[0].section, "");
- Assert.equal(result.fields[0].addressType, "");
- Assert.equal(result.fields[0].contactType, "");
- Assert.equal(result.fields[0].fieldName, "email");
- Assert.equal(result.fields[0].value, "email@example.org");
-});
-
-/**
- * Open the requestAutocomplete UI and cancel the dialog.
- */
-add_task(function* test_cancel() {
- // Request an e-mail address.
- let { uiWindow, promiseResult } = yield FormAutofillTest.showUI(
- TestData.requestEmailOnly);
-
- // Cancel the dialog.
- let acceptButton = uiWindow.document.getElementById("cancel");
- EventUtils.synthesizeMouseAtCenter(acceptButton, {}, uiWindow);
-
- let result = yield promiseResult;
- Assert.ok(result.canceled);
-});
-
-add_task(terminationTaskFn);
diff --git a/toolkit/components/formautofill/test/browser/head.js b/toolkit/components/formautofill/test/browser/head.js
deleted file mode 100644
index 882f3fd5e..000000000
--- a/toolkit/components/formautofill/test/browser/head.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Initialization specific to Form Autofill mochitest-browser tests.
- */
-
-"use strict";
-
-// We cannot start initialization from "loader.js" like we do in the xpcshell
-// and mochitest-chrome frameworks, thus we load the script here.
-Services.scriptloader.loadSubScript(getRootDirectory(gTestPath) + "loader.js",
- this);
-
-// The testing framework is fully initialized at this point, you can add
-// mochitest-browser specific test initialization here. If you need shared
-// functions or initialization that are not specific to mochitest-browser,
-// consider adding them to "head_common.js" in the parent folder instead.
diff --git a/toolkit/components/formautofill/test/browser/loader.js b/toolkit/components/formautofill/test/browser/loader.js
deleted file mode 100644
index bfd5b9ee0..000000000
--- a/toolkit/components/formautofill/test/browser/loader.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Infrastructure for the mochitest-browser tests located in this folder.
- *
- * See "loader_common.js" in the parent folder for a general overview.
- *
- * Unless you are adding new features to the framework, you shouldn't have to
- * modify this file. Use "head_common.js" or "head.js" for shared code.
- */
-
-"use strict";
-
-Services.scriptloader.loadSubScript(getRootDirectory(gTestPath) +
- "loader_common.js", this);
-
-// Define output functions so they look the same across all frameworks.
-var Output = {
- print: info,
-};
-
-// Define assertion functions so they look the same across all frameworks.
-var Assert = {
- ok: _mochitestAssert.ok,
- equal: _mochitestAssert.equal,
-};
-
-// Define task registration functions, see description in "loader_common.js".
-var add_task_in_parent_process = add_task;
-var add_task_in_child_process = function () {};
-var add_task_in_both_processes = add_task;
-
-Services.scriptloader.loadSubScript(getRootDirectory(gTestPath) +
- "head_common.js", this);
-
-// Reminder: unless you are adding new features to the framework, you shouldn't
-// have to modify this file. Use "head_common.js" or "head.js" for shared code.
diff --git a/toolkit/components/formautofill/test/chrome/.eslintrc.js b/toolkit/components/formautofill/test/chrome/.eslintrc.js
deleted file mode 100644
index 8c0f4f574..000000000
--- a/toolkit/components/formautofill/test/chrome/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/formautofill/test/chrome/chrome.ini b/toolkit/components/formautofill/test/chrome/chrome.ini
deleted file mode 100644
index 67b7869af..000000000
--- a/toolkit/components/formautofill/test/chrome/chrome.ini
+++ /dev/null
@@ -1,17 +0,0 @@
-[DEFAULT]
-# The following files starting with ".." are installed in the current folder.
-support-files =
- ../head_common.js
- ../loader_common.js
- head.js
- test_infrastructure.js
- test_requestAutocomplete_cancel.js
- loader_parent.js
- loader.js
-
-# For each test defined below, the associated JavaScript file must be declared
-# in the list above. This is required because a "support-files" declaration on
-# the individual test would override the global list instead of adding entries.
-
-[test_infrastructure.html]
-[test_requestAutocomplete_cancel.html]
diff --git a/toolkit/components/formautofill/test/chrome/head.js b/toolkit/components/formautofill/test/chrome/head.js
deleted file mode 100644
index 4110d5e7c..000000000
--- a/toolkit/components/formautofill/test/chrome/head.js
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Initialization specific to Form Autofill mochitest-chrome tests.
- *
- * This file is loaded by "loader.js".
- */
-
-"use strict";
-
-// The testing framework is fully initialized at this point, you can add
-// mochitest-chrome specific test initialization here. If you need shared
-// functions or initialization that are not specific to mochitest-chrome,
-// consider adding them to "head_common.js" in the parent folder instead.
diff --git a/toolkit/components/formautofill/test/chrome/loader.js b/toolkit/components/formautofill/test/chrome/loader.js
deleted file mode 100644
index 25b0e6ea3..000000000
--- a/toolkit/components/formautofill/test/chrome/loader.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Infrastructure for the mochitest-chrome tests located in this folder.
- *
- * See "loader_common.js" in the parent folder for a general overview.
- *
- * Unless you are adding new features to the framework, you shouldn't have to
- * modify this file. Use "head_common.js" or "head.js" for shared code.
- */
-
-"use strict";
-
-var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-
-Services.scriptloader.loadSubScript(
- "chrome://mochikit/content/tests/SimpleTest/SimpleTest.js", this);
-
-var sharedUrl = SimpleTest.getTestFileURL("loader_common.js");
-Services.scriptloader.loadSubScript(sharedUrl, this);
-
-var parentScript = SpecialPowers.loadChromeScript(
- SimpleTest.getTestFileURL("loader_parent.js"));
-
-// Replace the extension of the loaded HTML file with ".js"
-var testUrl = location.href.replace(/\.\w+$/, ".js");
-
-// Start loading the test script in the parent process.
-var promiseParentInitFinished = new Promise(function (resolve) {
- parentScript.addMessageListener("finish_load_in_parent", resolve);
-});
-parentScript.sendAsyncMessage("start_load_in_parent", { testUrl: testUrl });
-
-// Define output functions so they look the same across all frameworks.
-var Output = {
- print: info,
-};
-
-// Define assertion functions so they look the same across all frameworks.
-var Assert = {
- ok: _mochitestAssert.ok,
- equal: _mochitestAssert.equal,
-};
-
-var executeSoon = SimpleTest.executeSoon;
-
-var gTestTasks = [];
-
-// Define task registration functions, see description in "loader_common.js".
-function add_task(taskFn) {
- gTestTasks.push([taskFn, "content", taskFn.name]);
-}
-function add_task_in_parent_process(taskFn, taskIdOverride) {
- let taskId = taskIdOverride || getTaskId(Components.stack.caller);
- gTestTasks.push([taskFn, "parent", taskId]);
-}
-function add_task_in_both_processes(taskFn) {
- // We need to define a task ID based on our direct caller.
- add_task_in_parent_process(taskFn, getTaskId(Components.stack.caller));
- add_task(taskFn);
-}
-var add_task_in_child_process = add_task;
-
-window.addEventListener("load", function onLoad() {
- window.removeEventListener("load", onLoad);
-
- Task.spawn(function* () {
- try {
- for (let [taskFn, taskType, taskId] of gTestTasks) {
- if (taskType == "content") {
- // This is a normal task executed in the current process.
- info("Running " + taskFn.name);
- yield Task.spawn(taskFn);
- } else {
- // This is a task executed in the parent process.
- info("Running task in parent process: " + taskFn.name);
- let promiseFinished = new Promise(function (resolve) {
- parentScript.addMessageListener("finish_task_" + taskId, resolve);
- });
- parentScript.sendAsyncMessage("start_task_" + taskId);
- yield promiseFinished;
- info("Finished task in parent process: " + taskFn.name);
- }
- }
- } catch (ex) {
- ok(false, ex);
- }
-
- SimpleTest.finish();
- });
-});
-
-// Wait for the test script to be loaded in the parent process. This means that
-// test tasks are registered and ready, but have not been executed yet.
-add_task(function* wait_loading_in_parent_process() {
- yield promiseParentInitFinished;
-});
-
-var headUrl = SimpleTest.getTestFileURL("head_common.js");
-Services.scriptloader.loadSubScript(headUrl, this);
-
-Output.print("Loading test file: " + testUrl);
-Services.scriptloader.loadSubScript(testUrl, this);
-
-// Register the execution of termination tasks after all other tasks.
-add_task(terminationTaskFn);
-add_task_in_parent_process(terminationTaskFn, terminationTaskFn.name);
-
-SimpleTest.waitForExplicitFinish();
-
-// Reminder: unless you are adding new features to the framework, you shouldn't
-// have to modify this file. Use "head_common.js" or "head.js" for shared code.
diff --git a/toolkit/components/formautofill/test/chrome/loader_parent.js b/toolkit/components/formautofill/test/chrome/loader_parent.js
deleted file mode 100644
index bf823218e..000000000
--- a/toolkit/components/formautofill/test/chrome/loader_parent.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Infrastructure for the mochitest-chrome tests located in this folder, always
- * executed in the parent process.
- *
- * See "loader_common.js" in the parent folder for a general overview.
- *
- * Unless you are adding new features to the framework, you shouldn't have to
- * modify this file. Use "head_common.js" or "head.js" for shared code.
- */
-
-"use strict";
-
-var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-
-var sharedUrl = "chrome://mochitests/content/chrome/" +
- "toolkit/components/formautofill/test/chrome/loader_common.js";
-Services.scriptloader.loadSubScript(sharedUrl, this);
-
-// Define output functions so they look the same across all frameworks. Since
-// we don't have an output function available here, we report as TEST-PASS.
-var Output = {
- print: message => assert.ok(true, message),
-};
-
-// Define assertion functions so they look the same across all frameworks.
-var Assert = {
- ok: assert.ok,
- equal: assert.equal,
-};
-
-// Define task registration functions, see description in "loader_common.js".
-function add_task_in_parent_process(taskFn, taskIdOverride) {
- let taskId = taskIdOverride || getTaskId(Components.stack.caller);
- Output.print("Registering in the parent process: " + taskId);
- addMessageListener("start_task_" + taskId, function () {
- Task.spawn(function* () {
- try {
- Output.print("Running in the parent process " + taskId);
- yield Task.spawn(taskFn);
- } catch (ex) {
- assert.ok(false, ex);
- }
-
- sendAsyncMessage("finish_task_" + taskId, {});
- });
- });
-}
-var add_task = function () {};
-var add_task_in_child_process = function () {};
-var add_task_in_both_processes = add_task_in_parent_process;
-
-// We need to wait for the child process to send us the path of the test file
-// to load before we can actually start loading it.
-var context = this;
-addMessageListener("start_load_in_parent", function (message) {
- Output.print("Starting loading infrastructure in parent process.");
- let headUrl = "chrome://mochitests/content/chrome/" +
- "toolkit/components/formautofill/test/chrome/head_common.js";
- Services.scriptloader.loadSubScript(headUrl, context);
-
- Services.scriptloader.loadSubScript(message.testUrl, context);
-
- // Register the execution of termination tasks after all other tasks.
- add_task_in_parent_process(terminationTaskFn, terminationTaskFn.name);
-
- Output.print("Finished loading infrastructure in parent process.");
- sendAsyncMessage("finish_load_in_parent", {});
-});
-
-// Reminder: unless you are adding new features to the framework, you shouldn't
-// have to modify this file. Use "head_common.js" or "head.js" for shared code.
diff --git a/toolkit/components/formautofill/test/chrome/test_infrastructure.html b/toolkit/components/formautofill/test/chrome/test_infrastructure.html
deleted file mode 100644
index 54f417f77..000000000
--- a/toolkit/components/formautofill/test/chrome/test_infrastructure.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"></head><body>
-<script type="application/javascript;version=1.7" src="loader.js"></script>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-
-<p id="paragraph">Paragraph contents.</p>
-
-</body></html>
diff --git a/toolkit/components/formautofill/test/chrome/test_infrastructure.js b/toolkit/components/formautofill/test/chrome/test_infrastructure.js
deleted file mode 100644
index c3b0b43ff..000000000
--- a/toolkit/components/formautofill/test/chrome/test_infrastructure.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Tests the local testing infrastructure.
- */
-
-"use strict";
-
-/**
- * Tests the truth assertion function.
- */
-add_task(function* test_assert_truth() {
- Assert.ok(1 != 2);
-});
-
-/**
- * Tests the equality assertion function.
- */
-add_task(function* test_assert_equality() {
- Assert.equal(1 + 1, 2);
-});
-
-/**
- * Uses some of the utility functions provided by the framework.
- */
-add_task(function* test_utility_functions() {
- // The "print" function is useful to log information that is not known before.
- let randomString = "R" + Math.floor(Math.random() * 10);
- Output.print("The random contents will be '" + randomString + "'.");
-
- // Create the text file with the random contents.
- let path = yield TestUtils.getTempFile("test-infrastructure.txt");
- yield OS.File.writeAtomic(path, new TextEncoder().encode(randomString));
-
- // Test a few utility functions.
- yield TestUtils.waitForTick();
- yield TestUtils.waitMs(50);
-
- let promiseMyNotification = TestUtils.waitForNotification("my-topic");
- Services.obs.notifyObservers(null, "my-topic", "");
- yield promiseMyNotification;
-
- // Check the file size. The file will be deleted automatically later.
- Assert.equal((yield OS.File.stat(path)).size, randomString.length);
-});
-
-/**
- * This type of test has access to the content declared above.
- */
-add_task(function* test_content() {
- Assert.equal($("paragraph").innerHTML, "Paragraph contents.");
-
- let promiseMyEvent = TestUtils.waitForEvent($("paragraph"), "MyEvent");
-
- let event = document.createEvent("CustomEvent");
- event.initCustomEvent("MyEvent", true, false, {});
- $("paragraph").dispatchEvent(event);
-
- yield promiseMyEvent;
-});
diff --git a/toolkit/components/formautofill/test/chrome/test_requestAutocomplete_cancel.html b/toolkit/components/formautofill/test/chrome/test_requestAutocomplete_cancel.html
deleted file mode 100644
index 8ae7ffd4b..000000000
--- a/toolkit/components/formautofill/test/chrome/test_requestAutocomplete_cancel.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"></head><body>
-<script type="application/javascript;version=1.7" src="loader.js"></script>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-
-<form id="form">
-</form>
-
-</body></html>
diff --git a/toolkit/components/formautofill/test/chrome/test_requestAutocomplete_cancel.js b/toolkit/components/formautofill/test/chrome/test_requestAutocomplete_cancel.js
deleted file mode 100644
index 1ee12bd9a..000000000
--- a/toolkit/components/formautofill/test/chrome/test_requestAutocomplete_cancel.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Tests the response sent when requestAutocomplete is canceled by the user.
- */
-
-"use strict";
-
-/**
- * The requestAutocomplete UI will not be displayed during these tests.
- */
-add_task_in_parent_process(function* test_cancel_init() {
- FormAutofillTest.requestAutocompleteResponse = { canceled: true };
-});
-
-/**
- * Tests the case where the feature is canceled.
- */
-add_task(function* test_cancel() {
- let promise = TestUtils.waitForEvent($("form"), "autocompleteerror");
- $("form").requestAutocomplete();
- let errorEvent = yield promise;
-
- Assert.equal(errorEvent.reason, "cancel");
-});
diff --git a/toolkit/components/formautofill/test/head_common.js b/toolkit/components/formautofill/test/head_common.js
deleted file mode 100644
index 82b87e4a6..000000000
--- a/toolkit/components/formautofill/test/head_common.js
+++ /dev/null
@@ -1,245 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Initialization of Form Autofill tests shared between all frameworks.
- *
- * A copy of this file is installed in each of the framework subfolders, this
- * means it becomes a sibling of the test files in the final layout. This is
- * determined by how manifest "support-files" installation works.
- */
-
-"use strict";
-
-// The requestAutocomplete framework is available at this point, you can add
-// mochitest-chrome specific test initialization here. If you need shared
-// functions or initialization that are not specific to mochitest-chrome,
-// consider adding them to "head_common.js" in the parent folder instead.
-
-XPCOMUtils.defineLazyModuleGetter(this, "DownloadPaths",
- "resource://gre/modules/DownloadPaths.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FormAutofill",
- "resource://gre/modules/FormAutofill.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-
-/* --- Global helpers --- */
-
-// Some of these functions are already implemented in other parts of the source
-// tree, see bug 946708 about sharing more code.
-
-var TestUtils = {
- /**
- * Waits for at least one tick of the event loop. This means that all pending
- * events at the time of this call will have been processed. Other events may
- * be processed before the returned promise is resolved.
- *
- * @return {Promise}
- * @resolves When pending events have been processed.
- * @rejects Never.
- */
- waitForTick: function () {
- return new Promise(resolve => executeSoon(resolve));
- },
-
- /**
- * Waits for the specified timeout.
- *
- * @param aTimeMs
- * Minimum time to wait from the moment of this call, in milliseconds.
- * The actual wait may be longer, due to system timer resolution and
- * pending events being processed before the promise is resolved.
- *
- * @return {Promise}
- * @resolves When the specified time has passed.
- * @rejects Never.
- */
- waitMs: function (aTimeMs) {
- return new Promise(resolve => setTimeout(resolve, aTimeMs));
- },
-
- /**
- * Allows waiting for an observer notification once.
- *
- * @param aTopic
- * Notification topic to observe.
- *
- * @return {Promise}
- * @resolves The array [aSubject, aData] from the observed notification.
- * @rejects Never.
- */
- waitForNotification: function (aTopic) {
- Output.print("Waiting for notification: '" + aTopic + "'.");
-
- return new Promise(resolve => Services.obs.addObserver(
- function observe(aSubject, aTopic, aData) {
- Services.obs.removeObserver(observe, aTopic);
- resolve([aSubject, aData]);
- }, aTopic, false));
- },
-
- /**
- * Waits for a DOM event on the specified target.
- *
- * @param aTarget
- * The DOM EventTarget on which addEventListener should be called.
- * @param aEventName
- * String with the name of the event.
- * @param aUseCapture
- * This parameter is passed to the addEventListener call.
- *
- * @return {Promise}
- * @resolves The arguments from the observed event.
- * @rejects Never.
- */
- waitForEvent: function (aTarget, aEventName, aUseCapture = false) {
- Output.print("Waiting for event: '" + aEventName + "' on " + aTarget + ".");
-
- return new Promise(resolve => aTarget.addEventListener(aEventName,
- function onEvent(...aArgs) {
- aTarget.removeEventListener(aEventName, onEvent, aUseCapture);
- resolve(...aArgs);
- }, aUseCapture));
- },
-
- // While the previous test file should have deleted all the temporary files it
- // used, on Windows these might still be pending deletion on the physical file
- // system. Thus, start from a new base number every time, to make a collision
- // with a file that is still pending deletion highly unlikely.
- _fileCounter: Math.floor(Math.random() * 1000000),
-
- /**
- * Returns a reference to a temporary file, that is guaranteed not to exist,
- * and to have never been created before.
- *
- * @param aLeafName
- * Suggested leaf name for the file to be created.
- *
- * @return {Promise}
- * @resolves Path of a non-existent file in a temporary directory.
- *
- * @note It is not enough to delete the file if it exists, or to delete the
- * file after calling nsIFile.createUnique, because on Windows the
- * delete operation in the file system may still be pending, preventing
- * a new file with the same name to be created.
- */
- getTempFile: Task.async(function* (aLeafName) {
- // Prepend a serial number to the extension in the suggested leaf name.
- let [base, ext] = DownloadPaths.splitBaseNameAndExtension(aLeafName);
- let leafName = base + "-" + this._fileCounter + ext;
- this._fileCounter++;
-
- // Get a file reference under the temporary directory for this test file.
- let path = OS.Path.join(OS.Constants.Path.tmpDir, leafName);
- Assert.ok(!(yield OS.File.exists(path)));
-
- // Ensure the file is deleted whe the test terminates.
- add_termination_task(function* () {
- if (yield OS.File.exists(path)) {
- yield OS.File.remove(path);
- }
- });
-
- return path;
- }),
-};
-
-/* --- Local helpers --- */
-
-var FormAutofillTest = {
- /**
- * Stores the response that the next call to the mock requestAutocomplete UI
- * will return to the requester, or null to enable displaying the default UI.
- */
- requestAutocompleteResponse: null,
-
- /**
- * Displays the requestAutocomplete user interface using the specified data.
- *
- * @param aFormAutofillData
- * Serializable object containing the set of requested fields.
- *
- * @return {Promise}
- * @resolves An object with the following properties:
- * {
- * uiWindow: Reference to the initialized window.
- * promiseResult: Promise resolved by the UI when it closes.
- * }
- */
- showUI: Task.async(function* (aFormAutofillData) {
- Output.print("Opening UI with data: " + JSON.stringify(aFormAutofillData));
-
- // Wait for the initialization event before opening the window.
- let promiseUIWindow =
- TestUtils.waitForNotification("formautofill-window-initialized");
- let ui = yield FormAutofill.integration.createRequestAutocompleteUI(
- aFormAutofillData);
- let promiseResult = ui.show();
-
- // The window is the subject of the observer notification.
- return {
- uiWindow: (yield promiseUIWindow)[0],
- promiseResult: promiseResult,
- };
- }),
-};
-
-var TestData = {
- /**
- * Autofill UI request for the e-mail field only.
- */
- get requestEmailOnly() {
- return {
- sections: [{
- name: "",
- addressSections: [{
- addressType: "",
- fields: [{
- fieldName: "email",
- contactType: "",
- }],
- }],
- }],
- };
- },
-};
-
-/* --- Initialization and termination functions common to all tests --- */
-
-add_task_in_parent_process(function* () {
- // If required, we return a mock response instead of displaying the UI.
- let mockIntegrationFn = base => ({
- createRequestAutocompleteUI: Task.async(function* () {
- // Call the base method to display the UI if override is not requested.
- if (FormAutofillTest.requestAutocompleteResponse === null) {
- return yield base.createRequestAutocompleteUI.apply(this, arguments);
- }
-
- // Return a mock RequestAutocompleteUI object.
- return {
- show: Task.async(function* () {
- let response = FormAutofillTest.requestAutocompleteResponse;
- Output.print("Mock UI response: " + JSON.stringify(response));
- return response;
- }),
- };
- }),
- });
-
- FormAutofill.registerIntegration(mockIntegrationFn);
- add_termination_task(function* () {
- FormAutofill.unregisterIntegration(mockIntegrationFn);
- });
-});
-
-add_task_in_both_processes(function* () {
- // We must manually enable the feature while testing.
- Services.prefs.setBoolPref("dom.forms.requestAutocomplete", true);
- add_termination_task(function* () {
- Services.prefs.clearUserPref("dom.forms.requestAutocomplete");
- });
-});
diff --git a/toolkit/components/formautofill/test/loader_common.js b/toolkit/components/formautofill/test/loader_common.js
deleted file mode 100644
index 340586b65..000000000
--- a/toolkit/components/formautofill/test/loader_common.js
+++ /dev/null
@@ -1,120 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Infrastructure common to the test frameworks located in subfolders.
- *
- * A copy of this file is installed in each of the framework subfolders, this
- * means it becomes a sibling of the test files in the final layout. This is
- * determined by how manifest "support-files" installation works.
- *
- * Unless you are adding new features to the framework, you shouldn't have to
- * modify this file. Use "head_common.js" or the "head.js" file of each
- * framework for shared code.
- */
-
-"use strict";
-
-/*
- * --------------------
- * FRAMEWORK OVERVIEW
- * --------------------
- *
- * This framework is designed in such a way that test can be written in similar
- * ways in the xpcshell, mochitest-chrome, and mochitest-browser frameworks,
- * both when tests are running in the parent process or in a content process.
- *
- * There are some basic self-documenting assertion and output functions:
- *
- * Assert.ok(actualValue);
- * Assert.is(actualValue, expectedValue);
- * Output.print(string);
- *
- * Test cases and initialization functions are declared in shared head files
- * ("head_common.js" and "head.js") as well as individual test files. When
- * tests run in an Elecrolysis (e10s) environment, they are executed in both
- * processes at first. Normally, at this point only the registration of test
- * cases happen. When everything has finished loading, tests are started and
- * appropriately synchronized between processes.
- *
- * Tests can be declared using the add_task syntax:
- *
- * add_task(function* test_something () { ... });
- * This adds a test either in the parent process or child process:
- * - Parent: xpcshell, mochitest-chrome --disable-e10s, mochitest-browser
- * - Child: mochitest-chrome with e10s
- * In the future, these might run in the child process for "xpcshell".
- *
- * add_task_in_parent_process(function* test_something () { ... });
- * This test runs in the parent process, but the child process will wait for
- * its completion before continuing with the next task. This wait currently
- * happens only in mochitest-chrome with e10s, in other frameworks that run
- * only in the parent process this is the same as a normal add_task.
- *
- * add_task_in_child_process(function* test_something () { ... });
- * This test runs only in the child process. This means that the test is not
- * run unless this is an e10s test, currently mochitest-chrome with e10s.
- *
- * add_task_in_both_processes(function* test_something () { ... });
- * Useful for initialization that must be done both in the parent and the
- * child, like setting preferences.
- *
- * add_termination_task(function* () { ... });
- * Registers a new asynchronous termination task. This is executed after all
- * test cases in the file finished, and always in the same process where the
- * termination task is registered.
- */
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-
-var gTerminationTasks = [];
-
-/**
- * None of the testing frameworks support asynchronous termination functions, so
- * this task must be registered later, after the other "add_task" calls.
- *
- * Even xpcshell doesn't support calling "add_task" in the "tail.js" file,
- * because it registers the task but does not wait for its termination,
- * potentially leading to intermittent failures in subsequent tests.
- */
-function* terminationTaskFn() {
- for (let taskFn of gTerminationTasks) {
- try {
- yield Task.spawn(taskFn);
- } catch (ex) {
- Output.print(ex);
- Assert.ok(false);
- }
- }
-}
-
-function add_termination_task(taskFn) {
- gTerminationTasks.push(taskFn);
-}
-
-/**
- * Returns a unique identifier used for synchronizing the given test task
- * between the parent and child processes.
- */
-function getTaskId(stackFrame) {
- return stackFrame.filename + ":" + stackFrame.lineNumber;
-}
-
-// This is a shared helper for mochitest-chrome and mochitest-browser.
-var _mochitestAssert = {
- ok: function (actual) {
- let stack = Components.stack.caller;
- ok(actual, "[" + stack.name + " : " + stack.lineNumber + "] " + actual +
- " == true");
- },
- equal: function (actual, expected) {
- let stack = Components.stack.caller;
- is(actual, expected, "[" + stack.name + " : " + stack.lineNumber + "] " +
- actual + " == " + expected);
- },
-};
-
-// Reminder: unless you are adding new features to the framework, you shouldn't
-// have to modify this file. Use "head_common.js" or "head.js" for shared code.
diff --git a/toolkit/components/formautofill/test/xpcshell/.eslintrc.js b/toolkit/components/formautofill/test/xpcshell/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/formautofill/test/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/formautofill/test/xpcshell/head.js b/toolkit/components/formautofill/test/xpcshell/head.js
deleted file mode 100644
index 1cee023f2..000000000
--- a/toolkit/components/formautofill/test/xpcshell/head.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Initialization specific to Form Autofill xpcshell tests.
- *
- * This file is loaded by "loader.js".
- */
-
-"use strict";
-
-// The testing framework is fully initialized at this point, you can add
-// xpcshell specific test initialization here. If you need shared functions or
-// initialization that are not specific to xpcshell, consider adding them to
-// "head_common.js" in the parent folder instead.
-
-add_task_in_parent_process(function* test_xpcshell_initialize_profile() {
- // We need to send the profile-after-change notification manually to the
- // startup component to ensure it has been initialized.
- Cc["@mozilla.org/formautofill/startup;1"]
- .getService(Ci.nsIObserver)
- .observe(null, "profile-after-change", "");
-});
diff --git a/toolkit/components/formautofill/test/xpcshell/loader.js b/toolkit/components/formautofill/test/xpcshell/loader.js
deleted file mode 100644
index 449989c8a..000000000
--- a/toolkit/components/formautofill/test/xpcshell/loader.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Infrastructure for the xpcshell tests located in this folder.
- *
- * See "loader_common.js" in the parent folder for a general overview.
- *
- * Unless you are adding new features to the framework, you shouldn't have to
- * modify this file. Use "head_common.js" or "head.js" for shared code.
- */
-
-"use strict";
-
-var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-
-Services.scriptloader.loadSubScript(
- Services.io.newFileURI(do_get_file("loader_common.js")).spec, this);
-
-// Define output functions so they look the same across all frameworks.
-var Output = {
- print: do_print,
-};
-
-var executeSoon = do_execute_soon;
-var setTimeout = (fn, delay) => do_timeout(delay, fn);
-
-// Define task registration functions, see description in "loader_common.js".
-var add_task_in_parent_process = add_task;
-var add_task_in_child_process = function () {};
-var add_task_in_both_processes = add_task;
-
-Services.scriptloader.loadSubScript(
- Services.io.newFileURI(do_get_file("head_common.js")).spec, this);
-
-// Tests are always run asynchronously and with the profile loaded.
-function run_test() {
- do_get_profile();
- run_next_test();
-}
-
-// Reminder: unless you are adding new features to the framework, you shouldn't
-// have to modify this file. Use "head_common.js" or "head.js" for shared code.
diff --git a/toolkit/components/formautofill/test/xpcshell/test_infrastructure.js b/toolkit/components/formautofill/test/xpcshell/test_infrastructure.js
deleted file mode 100644
index af27cfdb5..000000000
--- a/toolkit/components/formautofill/test/xpcshell/test_infrastructure.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Tests the local testing infrastructure.
- */
-
-"use strict";
-
-/**
- * Tests the truth assertion function.
- */
-add_task(function* test_assert_truth() {
- Assert.ok(1 != 2);
-});
-
-/**
- * Tests the equality assertion function.
- */
-add_task(function* test_assert_equality() {
- Assert.equal(1 + 1, 2);
-});
-
-/**
- * Uses some of the utility functions provided by the framework.
- */
-add_task(function* test_utility_functions() {
- // The "print" function is useful to log information that is not known before.
- let randomString = "R" + Math.floor(Math.random() * 10);
- Output.print("The random contents will be '" + randomString + "'.");
-
- // Create the text file with the random contents.
- let path = yield TestUtils.getTempFile("test-infrastructure.txt");
- yield OS.File.writeAtomic(path, new TextEncoder().encode(randomString));
-
- // Test a few utility functions.
- yield TestUtils.waitForTick();
- yield TestUtils.waitMs(50);
-
- let promiseMyNotification = TestUtils.waitForNotification("my-topic");
- Services.obs.notifyObservers(null, "my-topic", "");
- yield promiseMyNotification;
-
- // Check the file size. The file will be deleted automatically later.
- Assert.equal((yield OS.File.stat(path)).size, randomString.length);
-});
-
-add_task(terminationTaskFn);
diff --git a/toolkit/components/formautofill/test/xpcshell/test_integration.js b/toolkit/components/formautofill/test/xpcshell/test_integration.js
deleted file mode 100644
index 7707f3880..000000000
--- a/toolkit/components/formautofill/test/xpcshell/test_integration.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Tests overriding the FormAutofillIntegration module functions.
- */
-
-"use strict";
-
-/**
- * The requestAutocomplete UI will not be displayed during these tests.
- */
-add_task_in_parent_process(function* test_initialize() {
- FormAutofillTest.requestAutocompleteResponse = { canceled: true };
-});
-
-/**
- * Registers and unregisters an integration override function.
- */
-add_task(function* test_integration_override() {
- let overrideCalled = false;
-
- let newIntegrationFn = base => ({
- createRequestAutocompleteUI: Task.async(function* () {
- overrideCalled = true;
- return yield base.createRequestAutocompleteUI.apply(this, arguments);
- }),
- });
-
- FormAutofill.registerIntegration(newIntegrationFn);
- try {
- let ui = yield FormAutofill.integration.createRequestAutocompleteUI({});
- let result = yield ui.show();
- Assert.ok(result.canceled);
- } finally {
- FormAutofill.unregisterIntegration(newIntegrationFn);
- }
-
- Assert.ok(overrideCalled);
-});
-
-/**
- * Registers an integration override function that throws an exception, and
- * ensures that this does not block other functions from being registered.
- */
-add_task(function* test_integration_override_error() {
- let overrideCalled = false;
-
- let errorIntegrationFn = base => { throw "Expected error." };
-
- let newIntegrationFn = base => ({
- createRequestAutocompleteUI: Task.async(function* () {
- overrideCalled = true;
- return yield base.createRequestAutocompleteUI.apply(this, arguments);
- }),
- });
-
- FormAutofill.registerIntegration(errorIntegrationFn);
- FormAutofill.registerIntegration(newIntegrationFn);
- try {
- let ui = yield FormAutofill.integration.createRequestAutocompleteUI({});
- let result = yield ui.show();
- Assert.ok(result.canceled);
- } finally {
- FormAutofill.unregisterIntegration(errorIntegrationFn);
- FormAutofill.unregisterIntegration(newIntegrationFn);
- }
-
- Assert.ok(overrideCalled);
-});
-
-add_task(terminationTaskFn);
diff --git a/toolkit/components/formautofill/test/xpcshell/xpcshell.ini b/toolkit/components/formautofill/test/xpcshell/xpcshell.ini
deleted file mode 100644
index 711c03399..000000000
--- a/toolkit/components/formautofill/test/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,12 +0,0 @@
-[DEFAULT]
-head = loader.js head.js
-tail =
-skip-if = toolkit == 'android'
-# The following files starting with ".." are installed in the current folder.
-# However, they cannot be referenced directly in the "head" directive above.
-support-files =
- ../head_common.js
- ../loader_common.js
-
-[test_infrastructure.js]
-[test_integration.js]
diff --git a/toolkit/components/jsdownloads/moz.build b/toolkit/components/jsdownloads/moz.build
index 62f08b160..56566bc97 100644
--- a/toolkit/components/jsdownloads/moz.build
+++ b/toolkit/components/jsdownloads/moz.build
@@ -4,15 +4,4 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-with Files('*'):
- BUG_COMPONENT = ('Toolkit', 'Download Manager')
-
DIRS += ['public', 'src']
-
-XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
-BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
-
-TEST_HARNESS_FILES.xpcshell.toolkit.components.jsdownloads.test.data += [
- 'test/data/empty.txt',
- 'test/data/source.txt',
-]
diff --git a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
index a6875ec48..7656128d2 100644
--- a/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadIntegration.jsm
@@ -28,8 +28,7 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
"resource://gre/modules/AsyncShutdown.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
+
XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
"resource://gre/modules/DeferredTask.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
@@ -71,10 +70,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "gMIMEService",
XPCOMUtils.defineLazyServiceGetter(this, "gExternalProtocolService",
"@mozilla.org/uriloader/external-protocol-service;1",
"nsIExternalProtocolService");
-#ifdef MOZ_WIDGET_ANDROID
-XPCOMUtils.defineLazyModuleGetter(this, "RuntimePermissions",
- "resource://gre/modules/RuntimePermissions.jsm");
-#endif
XPCOMUtils.defineLazyGetter(this, "gParentalControlsService", function() {
if ("@mozilla.org/parental-controls-service;1" in Cc) {
@@ -300,14 +295,10 @@ this.DownloadIntegration = {
aDownload.hasBlockedData) {
return true;
}
-#if defined(MOZ_WIDGET_ANDROID)
- // On Android we store all history.
- return true;
-#else
+
// On Desktop, stopped downloads for which we don't need to track the
// presence of a ".part" file are only retained in the browser history.
return false;
-#endif
},
/**
@@ -333,16 +324,8 @@ this.DownloadIntegration = {
} else {
directoryPath = this._getDirectory("DfltDwnld");
}
+
#elifdef XP_UNIX
-#ifdef MOZ_WIDGET_ANDROID
- // Android doesn't have a $HOME directory, and by default we only have
- // write access to /data/data/org.mozilla.{$APP} and /sdcard
- directoryPath = gEnvironment.get("DOWNLOADS_DIRECTORY");
- if (!directoryPath) {
- throw new Components.Exception("DOWNLOADS_DIRECTORY is not set.",
- Cr.NS_ERROR_FILE_UNRECOGNIZED_PATH);
- }
-#else
// For Linux, use XDG download dir, with a fallback to Home/Downloads
// if the XDG user dirs are disabled.
try {
@@ -350,7 +333,6 @@ this.DownloadIntegration = {
} catch(e) {
directoryPath = yield this._createDownloadsDirectory("Home");
}
-#endif
#else
directoryPath = yield this._createDownloadsDirectory("Home");
#endif
@@ -404,8 +386,6 @@ this.DownloadIntegration = {
let directoryPath = null;
#ifdef XP_MACOSX
directoryPath = yield this.getPreferredDownloadsDirectory();
-#elifdef MOZ_WIDGET_ANDROID
- directoryPath = yield this.getSystemDownloadsDirectory();
#else
directoryPath = this._getDirectory("TmpD");
#endif
@@ -444,12 +424,7 @@ this.DownloadIntegration = {
* @resolves The boolean indicates to block downloads or not.
*/
shouldBlockForRuntimePermissions() {
-#ifdef MOZ_WIDGET_ANDROID
- return RuntimePermissions.waitForPermissions(RuntimePermissions.WRITE_EXTERNAL_STORAGE)
- .then(permissionGranted => !permissionGranted);
-#else
return Promise.resolve(false);
-#endif
},
/**
@@ -696,8 +671,11 @@ this.DownloadIntegration = {
fileExtension = match[1];
}
- let isWindowsExe = AppConstants.platform == "win" &&
- fileExtension.toLowerCase() == "exe";
+#ifdef XP_WIN
+ let isWindowsExe = fileExtension.toLowerCase() == "exe";
+#else
+ let isWindowsExe = false;
+#endif
// Ask for confirmation if the file is executable, except for .exe on
// Windows where the operating system will show the prompt based on the
diff --git a/toolkit/components/jsdownloads/src/DownloadPlatform.cpp b/toolkit/components/jsdownloads/src/DownloadPlatform.cpp
index d91124ee6..66ad2b8fa 100644
--- a/toolkit/components/jsdownloads/src/DownloadPlatform.cpp
+++ b/toolkit/components/jsdownloads/src/DownloadPlatform.cpp
@@ -30,10 +30,6 @@
#include "../../../../xpcom/io/CocoaFileUtils.h"
#endif
-#ifdef MOZ_WIDGET_ANDROID
-#include "FennecJNIWrappers.h"
-#endif
-
#ifdef MOZ_WIDGET_GTK
#include <gtk/gtk.h>
#endif
@@ -101,21 +97,15 @@ CFURLRef CreateCFURLFromNSIURI(nsIURI *aURI) {
nsresult DownloadPlatform::DownloadDone(nsIURI* aSource, nsIURI* aReferrer, nsIFile* aTarget,
const nsACString& aContentType, bool aIsPrivate)
{
-#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_ANDROID) \
- || defined(MOZ_WIDGET_GTK)
+#if defined(XP_WIN) || defined(XP_MACOSX) || defined(MOZ_WIDGET_GTK)
nsAutoString path;
if (aTarget && NS_SUCCEEDED(aTarget->GetPath(path))) {
-#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_ANDROID)
+#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK)
// On Windows and Gtk, add the download to the system's "recent documents"
// list, with a pref to disable.
{
bool addToRecentDocs = Preferences::GetBool(PREF_BDM_ADDTORECENTDOCS);
-#ifdef MOZ_WIDGET_ANDROID
- if (jni::IsFennec() && addToRecentDocs) {
- java::DownloadsIntegration::ScanMedia(path, aContentType);
- }
-#else
if (addToRecentDocs && !aIsPrivate) {
#ifdef XP_WIN
::SHAddToRecentDocs(SHARD_PATHW, path.get());
@@ -130,7 +120,7 @@ nsresult DownloadPlatform::DownloadDone(nsIURI* aSource, nsIURI* aReferrer, nsIF
}
#endif
}
-#endif
+
#ifdef MOZ_ENABLE_GIO
// Use GIO to store the source URI for later display in the file manager.
GFile* gio_file = g_file_new_for_path(NS_ConvertUTF16toUTF8(path).get());
diff --git a/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm b/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm
index ce165205b..d4ce248e3 100644
--- a/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm
+++ b/toolkit/components/jsdownloads/src/DownloadUIHelper.jsm
@@ -22,7 +22,6 @@ const Cu = Components.utils;
const Cr = Components.results;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "OS",
"resource://gre/modules/osfile.jsm");
@@ -186,17 +185,17 @@ this.DownloadPrompter.prototype = {
switch (aPromptType) {
case this.ON_QUIT:
title = s.quitCancelDownloadsAlertTitle;
- if (AppConstants.platform != "macosx") {
- message = aDownloadsCount > 1
- ? s.quitCancelDownloadsAlertMsgMultiple(aDownloadsCount)
- : s.quitCancelDownloadsAlertMsg;
- cancelButton = s.dontQuitButtonWin;
- } else {
- message = aDownloadsCount > 1
- ? s.quitCancelDownloadsAlertMsgMacMultiple(aDownloadsCount)
- : s.quitCancelDownloadsAlertMsgMac;
- cancelButton = s.dontQuitButtonMac;
- }
+#ifdef XP_MACOSX
+ message = aDownloadsCount > 1
+ ? s.quitCancelDownloadsAlertMsgMacMultiple(aDownloadsCount)
+ : s.quitCancelDownloadsAlertMsgMac;
+ cancelButton = s.dontQuitButtonMac;
+#else
+ message = aDownloadsCount > 1
+ ? s.quitCancelDownloadsAlertMsgMultiple(aDownloadsCount)
+ : s.quitCancelDownloadsAlertMsg;
+ cancelButton = s.dontQuitButtonWin;
+#endif
break;
case this.ON_OFFLINE:
title = s.offlineCancelDownloadsAlertTitle;
diff --git a/toolkit/components/jsdownloads/src/moz.build b/toolkit/components/jsdownloads/src/moz.build
index 87abed62e..ac3768208 100644
--- a/toolkit/components/jsdownloads/src/moz.build
+++ b/toolkit/components/jsdownloads/src/moz.build
@@ -19,11 +19,11 @@ EXTRA_JS_MODULES += [
'DownloadList.jsm',
'Downloads.jsm',
'DownloadStore.jsm',
- 'DownloadUIHelper.jsm',
]
EXTRA_PP_JS_MODULES += [
'DownloadIntegration.jsm',
+ 'DownloadUIHelper.jsm',
]
FINAL_LIBRARY = 'xul'
diff --git a/toolkit/components/jsdownloads/test/browser/.eslintrc.js b/toolkit/components/jsdownloads/test/browser/.eslintrc.js
deleted file mode 100644
index 7c8021192..000000000
--- a/toolkit/components/jsdownloads/test/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/jsdownloads/test/browser/browser.ini b/toolkit/components/jsdownloads/test/browser/browser.ini
deleted file mode 100644
index 131fc4ec8..000000000
--- a/toolkit/components/jsdownloads/test/browser/browser.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[DEFAULT]
-support-files =
- head.js
- testFile.html
-
-[browser_DownloadPDFSaver.js]
-skip-if = os != "win"
diff --git a/toolkit/components/jsdownloads/test/browser/browser_DownloadPDFSaver.js b/toolkit/components/jsdownloads/test/browser/browser_DownloadPDFSaver.js
deleted file mode 100644
index 80ed9665a..000000000
--- a/toolkit/components/jsdownloads/test/browser/browser_DownloadPDFSaver.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the PDF download saver, and tests using a window as a
- * source for the copy download saver.
- */
-
-"use strict";
-
-/**
- * Helper function to make sure a window reference exists on the download source.
- */
-function* test_download_windowRef(aTab, aDownload) {
- ok(aDownload.source.windowRef, "Download source had a window reference");
- ok(aDownload.source.windowRef instanceof Ci.xpcIJSWeakReference, "Download window reference is a weak ref");
- is(aDownload.source.windowRef.get(), aTab.linkedBrowser.contentWindow, "Download window exists during test");
-}
-
-/**
- * Helper function to check the state of a completed download.
- */
-function* test_download_state_complete(aTab, aDownload, aPrivate, aCanceled) {
- ok(aDownload.source, "Download has a source");
- is(aDownload.source.url, aTab.linkedBrowser.contentWindow.location, "Download source has correct url");
- is(aDownload.source.isPrivate, aPrivate, "Download source has correct private state");
- ok(aDownload.stopped, "Download is stopped");
- is(aCanceled, aDownload.canceled, "Download has correct canceled state");
- is(!aCanceled, aDownload.succeeded, "Download has correct succeeded state");
- is(aDownload.error, null, "Download error is not defined");
-}
-
-function* test_createDownload_common(aPrivate, aType) {
- let win = yield BrowserTestUtils.openNewBrowserWindow({ private : aPrivate});
-
- let tab = yield BrowserTestUtils.openNewForegroundTab(win.gBrowser, getRootDirectory(gTestPath) + "testFile.html");
- let download = yield Downloads.createDownload({
- source: tab.linkedBrowser.contentWindow,
- target: { path: getTempFile(TEST_TARGET_FILE_NAME_PDF).path },
- saver: { type: aType }
- });
-
- yield test_download_windowRef(tab, download);
- yield download.start();
-
- yield test_download_state_complete(tab, download, aPrivate, false);
- if (aType == "pdf") {
- let signature = yield OS.File.read(download.target.path,
- { bytes: 4, encoding: "us-ascii" });
- is(signature, "%PDF", "File exists and signature matches");
- } else {
- ok((yield OS.File.exists(download.target.path)), "File exists");
- }
-
- win.gBrowser.removeTab(tab);
- win.close()
-}
-
-add_task(function* test_createDownload_pdf_private() {
- yield test_createDownload_common(true, "pdf");
-});
-add_task(function* test_createDownload_pdf_not_private() {
- yield test_createDownload_common(false, "pdf");
-});
-
-// Even for the copy saver, using a window should produce valid results
-add_task(function* test_createDownload_copy_private() {
- yield test_createDownload_common(true, "copy");
-});
-add_task(function* test_createDownload_copy_not_private() {
- yield test_createDownload_common(false, "copy");
-});
-
-add_task(function* test_cancel_pdf_download() {
- let tab = gBrowser.addTab(getRootDirectory(gTestPath) + "testFile.html");
- yield promiseBrowserLoaded(tab.linkedBrowser);
-
- let download = yield Downloads.createDownload({
- source: tab.linkedBrowser.contentWindow,
- target: { path: getTempFile(TEST_TARGET_FILE_NAME_PDF).path },
- saver: "pdf",
- });
-
- yield test_download_windowRef(tab, download);
- download.start().catch(() => {});
-
- // Immediately cancel the download to test that it is erased correctly.
- yield download.cancel();
- yield test_download_state_complete(tab, download, false, true);
-
- let exists = yield OS.File.exists(download.target.path)
- ok(!exists, "Target file does not exist");
-
- gBrowser.removeTab(tab);
-});
diff --git a/toolkit/components/jsdownloads/test/browser/head.js b/toolkit/components/jsdownloads/test/browser/head.js
deleted file mode 100644
index 769aaacb3..000000000
--- a/toolkit/components/jsdownloads/test/browser/head.js
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Provides infrastructure for automated download components tests.
- */
-
-"use strict";
-
-// Globals
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "DownloadPaths",
- "resource://gre/modules/DownloadPaths.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
- "resource://gre/modules/Downloads.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "HttpServer",
- "resource://testing-common/httpd.js");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-
-const TEST_TARGET_FILE_NAME_PDF = "test-download.pdf";
-
-// Support functions
-
-// While the previous test file should have deleted all the temporary files it
-// used, on Windows these might still be pending deletion on the physical file
-// system. Thus, start from a new base number every time, to make a collision
-// with a file that is still pending deletion highly unlikely.
-var gFileCounter = Math.floor(Math.random() * 1000000);
-
-/**
- * Returns a reference to a temporary file, that is guaranteed not to exist, and
- * to have never been created before.
- *
- * @param aLeafName
- * Suggested leaf name for the file to be created.
- *
- * @return nsIFile pointing to a non-existent file in a temporary directory.
- *
- * @note It is not enough to delete the file if it exists, or to delete the file
- * after calling nsIFile.createUnique, because on Windows the delete
- * operation in the file system may still be pending, preventing a new
- * file with the same name to be created.
- */
-function getTempFile(aLeafName)
-{
- // Prepend a serial number to the extension in the suggested leaf name.
- let [base, ext] = DownloadPaths.splitBaseNameAndExtension(aLeafName);
- let leafName = base + "-" + gFileCounter + ext;
- gFileCounter++;
-
- // Get a file reference under the temporary directory for this test file.
- let file = FileUtils.getFile("TmpD", [leafName]);
- ok(!file.exists(), "Temp file does not exist");
-
- registerCleanupFunction(function () {
- if (file.exists()) {
- file.remove(false);
- }
- });
-
- return file;
-}
-
-function promiseBrowserLoaded(browser) {
- return new Promise(resolve => {
- browser.addEventListener("load", function onLoad(event) {
- if (event.target == browser.contentDocument) {
- browser.removeEventListener("load", onLoad, true);
- resolve();
- }
- }, true);
- });
-}
diff --git a/toolkit/components/jsdownloads/test/browser/testFile.html b/toolkit/components/jsdownloads/test/browser/testFile.html
deleted file mode 100644
index ee413514b..000000000
--- a/toolkit/components/jsdownloads/test/browser/testFile.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Test Save as PDF</title>
- </head>
- <body>
- <p>Save me as a PDF!</p>
- </body>
-</html>
diff --git a/toolkit/components/jsdownloads/test/data/.eslintrc.js b/toolkit/components/jsdownloads/test/data/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/jsdownloads/test/data/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/jsdownloads/test/data/empty.txt b/toolkit/components/jsdownloads/test/data/empty.txt
deleted file mode 100644
index e69de29bb..000000000
--- a/toolkit/components/jsdownloads/test/data/empty.txt
+++ /dev/null
diff --git a/toolkit/components/jsdownloads/test/data/source.txt b/toolkit/components/jsdownloads/test/data/source.txt
deleted file mode 100644
index 2156cb8c0..000000000
--- a/toolkit/components/jsdownloads/test/data/source.txt
+++ /dev/null
@@ -1 +0,0 @@
-This test string is downloaded. \ No newline at end of file
diff --git a/toolkit/components/jsdownloads/test/unit/.eslintrc.js b/toolkit/components/jsdownloads/test/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/jsdownloads/test/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/jsdownloads/test/unit/common_test_Download.js b/toolkit/components/jsdownloads/test/unit/common_test_Download.js
deleted file mode 100644
index 42d4c5682..000000000
--- a/toolkit/components/jsdownloads/test/unit/common_test_Download.js
+++ /dev/null
@@ -1,2432 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This script is loaded by "test_DownloadCore.js" and "test_DownloadLegacy.js"
- * with different values of the gUseLegacySaver variable, to apply tests to both
- * the "copy" and "legacy" saver implementations.
- */
-
-"use strict";
-
-// Globals
-
-const kDeleteTempFileOnExit = "browser.helperApps.deleteTempFileOnExit";
-
-/**
- * Creates and starts a new download, using either DownloadCopySaver or
- * DownloadLegacySaver based on the current test run.
- *
- * @return {Promise}
- * @resolves The newly created Download object. The download may be in progress
- * or already finished. The promiseDownloadStopped function can be
- * used to wait for completion.
- * @rejects JavaScript exception.
- */
-function promiseStartDownload(aSourceUrl) {
- if (gUseLegacySaver) {
- return promiseStartLegacyDownload(aSourceUrl);
- }
-
- return promiseNewDownload(aSourceUrl).then(download => {
- download.start().catch(() => {});
- return download;
- });
-}
-
-/**
- * Creates and starts a new download, configured to keep partial data, and
- * returns only when the first part of "interruptible_resumable.txt" has been
- * saved to disk. You must call "continueResponses" to allow the interruptible
- * request to continue.
- *
- * This function uses either DownloadCopySaver or DownloadLegacySaver based on
- * the current test run.
- *
- * @return {Promise}
- * @resolves The newly created Download object, still in progress.
- * @rejects JavaScript exception.
- */
-function promiseStartDownload_tryToKeepPartialData() {
- return Task.spawn(function* () {
- mustInterruptResponses();
-
- // Start a new download and configure it to keep partially downloaded data.
- let download;
- if (!gUseLegacySaver) {
- let targetFilePath = getTempFile(TEST_TARGET_FILE_NAME).path;
- download = yield Downloads.createDownload({
- source: httpUrl("interruptible_resumable.txt"),
- target: { path: targetFilePath,
- partFilePath: targetFilePath + ".part" },
- });
- download.tryToKeepPartialData = true;
- download.start().catch(() => {});
- } else {
- // Start a download using nsIExternalHelperAppService, that is configured
- // to keep partially downloaded data by default.
- download = yield promiseStartExternalHelperAppServiceDownload();
- }
-
- yield promiseDownloadMidway(download);
- yield promisePartFileReady(download);
-
- return download;
- });
-}
-
-/**
- * This function should be called after the progress notification for a download
- * is received, and waits for the worker thread of BackgroundFileSaver to
- * receive the data to be written to the ".part" file on disk.
- *
- * @return {Promise}
- * @resolves When the ".part" file has been written to disk.
- * @rejects JavaScript exception.
- */
-function promisePartFileReady(aDownload) {
- return Task.spawn(function* () {
- // We don't have control over the file output code in BackgroundFileSaver.
- // After we receive the download progress notification, we may only check
- // that the ".part" file has been created, while its size cannot be
- // determined because the file is currently open.
- try {
- do {
- yield promiseTimeout(50);
- } while (!(yield OS.File.exists(aDownload.target.partFilePath)));
- } catch (ex) {
- if (!(ex instanceof OS.File.Error)) {
- throw ex;
- }
- // This indicates that the file has been created and cannot be accessed.
- // The specific error might vary with the platform.
- do_print("Expected exception while checking existence: " + ex.toString());
- // Wait some more time to allow the write to complete.
- yield promiseTimeout(100);
- }
- });
-}
-
-/**
- * Checks that the actual data written to disk matches the expected data as well
- * as the properties of the given DownloadTarget object.
- *
- * @param downloadTarget
- * The DownloadTarget object whose details have to be verified.
- * @param expectedContents
- * String containing the octets that are expected in the file.
- *
- * @return {Promise}
- * @resolves When the properties have been verified.
- * @rejects JavaScript exception.
- */
-var promiseVerifyTarget = Task.async(function* (downloadTarget,
- expectedContents) {
- yield promiseVerifyContents(downloadTarget.path, expectedContents);
- do_check_true(downloadTarget.exists);
- do_check_eq(downloadTarget.size, expectedContents.length);
-});
-
-/**
- * Waits for an attempt to launch a file, and returns the nsIMIMEInfo used for
- * the launch, or null if the file was launched with the default handler.
- */
-function waitForFileLaunched() {
- return new Promise(resolve => {
- let waitFn = base => ({
- launchFile(file, mimeInfo) {
- Integration.downloads.unregister(waitFn);
- if (!mimeInfo ||
- mimeInfo.preferredAction == Ci.nsIMIMEInfo.useSystemDefault) {
- resolve(null);
- } else {
- resolve(mimeInfo);
- }
- return Promise.resolve();
- },
- });
- Integration.downloads.register(waitFn);
- });
-}
-
-/**
- * Waits for an attempt to show the directory where a file is located, and
- * returns the path of the file.
- */
-function waitForDirectoryShown() {
- return new Promise(resolve => {
- let waitFn = base => ({
- showContainingDirectory(path) {
- Integration.downloads.unregister(waitFn);
- resolve(path);
- return Promise.resolve();
- },
- });
- Integration.downloads.register(waitFn);
- });
-}
-
-// Tests
-
-/**
- * Executes a download and checks its basic properties after construction.
- * The download is started by constructing the simplest Download object with
- * the "copy" saver, or using the legacy nsITransfer interface.
- */
-add_task(function* test_basic()
-{
- let targetFile = getTempFile(TEST_TARGET_FILE_NAME);
-
- let download;
- if (!gUseLegacySaver) {
- // When testing DownloadCopySaver, we have control over the download, thus
- // we can check its basic properties before it starts.
- download = yield Downloads.createDownload({
- source: { url: httpUrl("source.txt") },
- target: { path: targetFile.path },
- saver: { type: "copy" },
- });
-
- do_check_eq(download.source.url, httpUrl("source.txt"));
- do_check_eq(download.target.path, targetFile.path);
-
- yield download.start();
- } else {
- // When testing DownloadLegacySaver, the download is already started when it
- // is created, thus we must check its basic properties while in progress.
- download = yield promiseStartLegacyDownload(null,
- { targetFile: targetFile });
-
- do_check_eq(download.source.url, httpUrl("source.txt"));
- do_check_eq(download.target.path, targetFile.path);
-
- yield promiseDownloadStopped(download);
- }
-
- // Check additional properties on the finished download.
- do_check_true(download.source.referrer === null);
-
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT);
-});
-
-/**
- * Executes a download with the tryToKeepPartialData property set, and ensures
- * that the file is saved correctly. When testing DownloadLegacySaver, the
- * download is executed using the nsIExternalHelperAppService component.
- */
-add_task(function* test_basic_tryToKeepPartialData()
-{
- let download = yield promiseStartDownload_tryToKeepPartialData();
- continueResponses();
- yield promiseDownloadStopped(download);
-
- // The target file should now have been created, and the ".part" file deleted.
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT + TEST_DATA_SHORT);
- do_check_false(yield OS.File.exists(download.target.partFilePath));
- do_check_eq(32, download.saver.getSha256Hash().length);
-});
-
-/**
- * Tests the permissions of the final target file once the download finished.
- */
-add_task(function* test_unix_permissions()
-{
- // This test is only executed on some Desktop systems.
- if (Services.appinfo.OS != "Darwin" && Services.appinfo.OS != "Linux" &&
- Services.appinfo.OS != "WINNT") {
- do_print("Skipping test.");
- return;
- }
-
- let launcherPath = getTempFile("app-launcher").path;
-
- for (let autoDelete of [false, true]) {
- for (let isPrivate of [false, true]) {
- for (let launchWhenSucceeded of [false, true]) {
- do_print("Checking " + JSON.stringify({ autoDelete,
- isPrivate,
- launchWhenSucceeded }));
-
- Services.prefs.setBoolPref(kDeleteTempFileOnExit, autoDelete);
-
- let download;
- if (!gUseLegacySaver) {
- download = yield Downloads.createDownload({
- source: { url: httpUrl("source.txt"), isPrivate },
- target: getTempFile(TEST_TARGET_FILE_NAME).path,
- launchWhenSucceeded,
- launcherPath,
- });
- yield download.start();
- } else {
- download = yield promiseStartLegacyDownload(httpUrl("source.txt"), {
- isPrivate,
- launchWhenSucceeded,
- launcherPath: launchWhenSucceeded && launcherPath,
- });
- yield promiseDownloadStopped(download);
- }
-
- let isTemporary = launchWhenSucceeded && (autoDelete || isPrivate);
- let stat = yield OS.File.stat(download.target.path);
- if (Services.appinfo.OS == "WINNT") {
- // On Windows
- // Temporary downloads should be read-only
- do_check_eq(stat.winAttributes.readOnly, isTemporary ? true : false);
- } else {
- // On Linux, Mac
- // Temporary downloads should be read-only and not accessible to other
- // users, while permanently downloaded files should be readable and
- // writable as specified by the system umask.
- do_check_eq(stat.unixMode,
- isTemporary ? 0o400 : (0o666 & ~OS.Constants.Sys.umask));
- }
- }
- }
- }
-
- // Clean up the changes to the preference.
- Services.prefs.clearUserPref(kDeleteTempFileOnExit);
-});
-
-/**
- * Checks the referrer for downloads.
- */
-add_task(function* test_referrer()
-{
- let sourcePath = "/test_referrer.txt";
- let sourceUrl = httpUrl("test_referrer.txt");
- let targetPath = getTempFile(TEST_TARGET_FILE_NAME).path;
-
- function cleanup() {
- gHttpServer.registerPathHandler(sourcePath, null);
- }
- do_register_cleanup(cleanup);
-
- gHttpServer.registerPathHandler(sourcePath, function (aRequest, aResponse) {
- aResponse.setHeader("Content-Type", "text/plain", false);
-
- do_check_true(aRequest.hasHeader("Referer"));
- do_check_eq(aRequest.getHeader("Referer"), TEST_REFERRER_URL);
- });
- let download = yield Downloads.createDownload({
- source: { url: sourceUrl, referrer: TEST_REFERRER_URL },
- target: targetPath,
- });
- do_check_eq(download.source.referrer, TEST_REFERRER_URL);
- yield download.start();
-
- download = yield Downloads.createDownload({
- source: { url: sourceUrl, referrer: TEST_REFERRER_URL,
- isPrivate: true },
- target: targetPath,
- });
- do_check_eq(download.source.referrer, TEST_REFERRER_URL);
- yield download.start();
-
- // Test the download still works for non-HTTP channel with referrer.
- sourceUrl = "data:text/html,<html><body></body></html>";
- download = yield Downloads.createDownload({
- source: { url: sourceUrl, referrer: TEST_REFERRER_URL },
- target: targetPath,
- });
- do_check_eq(download.source.referrer, TEST_REFERRER_URL);
- yield download.start();
-
- cleanup();
-});
-
-/**
- * Checks the adjustChannel callback for downloads.
- */
-add_task(function* test_adjustChannel()
-{
- const sourcePath = "/test_post.txt";
- const sourceUrl = httpUrl("test_post.txt");
- const targetPath = getTempFile(TEST_TARGET_FILE_NAME).path;
- const customHeader = { name: "X-Answer", value: "42" };
- const postData = "Don't Panic";
-
- function cleanup() {
- gHttpServer.registerPathHandler(sourcePath, null);
- }
- do_register_cleanup(cleanup);
-
- gHttpServer.registerPathHandler(sourcePath, aRequest => {
- do_check_eq(aRequest.method, "POST");
-
- do_check_true(aRequest.hasHeader(customHeader.name));
- do_check_eq(aRequest.getHeader(customHeader.name), customHeader.value);
-
- const stream = aRequest.bodyInputStream;
- const body = NetUtil.readInputStreamToString(stream, stream.available());
- do_check_eq(body, postData);
- });
-
- function adjustChannel(channel) {
- channel.QueryInterface(Ci.nsIHttpChannel);
- channel.setRequestHeader(customHeader.name, customHeader.value, false);
-
- const stream = Cc["@mozilla.org/io/string-input-stream;1"]
- .createInstance(Ci.nsIStringInputStream);
- stream.setData(postData, postData.length);
-
- channel.QueryInterface(Ci.nsIUploadChannel2);
- channel.explicitSetUploadStream(stream, null, -1, "POST", false);
-
- return Promise.resolve();
- }
-
- const download = yield Downloads.createDownload({
- source: { url: sourceUrl, adjustChannel },
- target: targetPath,
- });
- do_check_eq(download.source.adjustChannel, adjustChannel);
- do_check_eq(download.toSerializable(), null);
- yield download.start();
-
- cleanup();
-});
-
-/**
- * Checks initial and final state and progress for a successful download.
- */
-add_task(function* test_initial_final_state()
-{
- let download;
- if (!gUseLegacySaver) {
- // When testing DownloadCopySaver, we have control over the download, thus
- // we can check its state before it starts.
- download = yield promiseNewDownload();
-
- do_check_true(download.stopped);
- do_check_false(download.succeeded);
- do_check_false(download.canceled);
- do_check_true(download.error === null);
- do_check_eq(download.progress, 0);
- do_check_true(download.startTime === null);
- do_check_false(download.target.exists);
- do_check_eq(download.target.size, 0);
-
- yield download.start();
- } else {
- // When testing DownloadLegacySaver, the download is already started when it
- // is created, thus we cannot check its initial state.
- download = yield promiseStartLegacyDownload();
- yield promiseDownloadStopped(download);
- }
-
- do_check_true(download.stopped);
- do_check_true(download.succeeded);
- do_check_false(download.canceled);
- do_check_true(download.error === null);
- do_check_eq(download.progress, 100);
- do_check_true(isValidDate(download.startTime));
- do_check_true(download.target.exists);
- do_check_eq(download.target.size, TEST_DATA_SHORT.length);
-});
-
-/**
- * Checks the notification of the final download state.
- */
-add_task(function* test_final_state_notified()
-{
- mustInterruptResponses();
-
- let download = yield promiseStartDownload(httpUrl("interruptible.txt"));
-
- let onchangeNotified = false;
- let lastNotifiedStopped;
- let lastNotifiedProgress;
- download.onchange = function () {
- onchangeNotified = true;
- lastNotifiedStopped = download.stopped;
- lastNotifiedProgress = download.progress;
- };
-
- // Allow the download to complete.
- let promiseAttempt = download.start();
- continueResponses();
- yield promiseAttempt;
-
- // The view should have been notified before the download completes.
- do_check_true(onchangeNotified);
- do_check_true(lastNotifiedStopped);
- do_check_eq(lastNotifiedProgress, 100);
-});
-
-/**
- * Checks intermediate progress for a successful download.
- */
-add_task(function* test_intermediate_progress()
-{
- mustInterruptResponses();
-
- let download = yield promiseStartDownload(httpUrl("interruptible.txt"));
-
- yield promiseDownloadMidway(download);
-
- do_check_true(download.hasProgress);
- do_check_eq(download.currentBytes, TEST_DATA_SHORT.length);
- do_check_eq(download.totalBytes, TEST_DATA_SHORT.length * 2);
-
- // The final file size should not be computed for in-progress downloads.
- do_check_false(download.target.exists);
- do_check_eq(download.target.size, 0);
-
- // Continue after the first chunk of data is fully received.
- continueResponses();
- yield promiseDownloadStopped(download);
-
- do_check_true(download.stopped);
- do_check_eq(download.progress, 100);
-
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT + TEST_DATA_SHORT);
-});
-
-/**
- * Downloads a file with a "Content-Length" of 0 and checks the progress.
- */
-add_task(function* test_empty_progress()
-{
- let download = yield promiseStartDownload(httpUrl("empty.txt"));
- yield promiseDownloadStopped(download);
-
- do_check_true(download.stopped);
- do_check_true(download.hasProgress);
- do_check_eq(download.progress, 100);
- do_check_eq(download.currentBytes, 0);
- do_check_eq(download.totalBytes, 0);
-
- // We should have received the content type even for an empty file.
- do_check_eq(download.contentType, "text/plain");
-
- do_check_eq((yield OS.File.stat(download.target.path)).size, 0);
- do_check_true(download.target.exists);
- do_check_eq(download.target.size, 0);
-});
-
-/**
- * Downloads a file with a "Content-Length" of 0 with the tryToKeepPartialData
- * property set, and ensures that the file is saved correctly.
- */
-add_task(function* test_empty_progress_tryToKeepPartialData()
-{
- // Start a new download and configure it to keep partially downloaded data.
- let download;
- if (!gUseLegacySaver) {
- let targetFilePath = getTempFile(TEST_TARGET_FILE_NAME).path;
- download = yield Downloads.createDownload({
- source: httpUrl("empty.txt"),
- target: { path: targetFilePath,
- partFilePath: targetFilePath + ".part" },
- });
- download.tryToKeepPartialData = true;
- download.start().catch(() => {});
- } else {
- // Start a download using nsIExternalHelperAppService, that is configured
- // to keep partially downloaded data by default.
- download = yield promiseStartExternalHelperAppServiceDownload(
- httpUrl("empty.txt"));
- }
- yield promiseDownloadStopped(download);
-
- // The target file should now have been created, and the ".part" file deleted.
- do_check_eq((yield OS.File.stat(download.target.path)).size, 0);
- do_check_true(download.target.exists);
- do_check_eq(download.target.size, 0);
-
- do_check_false(yield OS.File.exists(download.target.partFilePath));
- do_check_eq(32, download.saver.getSha256Hash().length);
-});
-
-/**
- * Downloads an empty file with no "Content-Length" and checks the progress.
- */
-add_task(function* test_empty_noprogress()
-{
- let sourcePath = "/test_empty_noprogress.txt";
- let sourceUrl = httpUrl("test_empty_noprogress.txt");
- let deferRequestReceived = Promise.defer();
-
- // Register an interruptible handler that notifies us when the request occurs.
- function cleanup() {
- gHttpServer.registerPathHandler(sourcePath, null);
- }
- do_register_cleanup(cleanup);
-
- registerInterruptibleHandler(sourcePath,
- function firstPart(aRequest, aResponse) {
- aResponse.setHeader("Content-Type", "text/plain", false);
- deferRequestReceived.resolve();
- }, function secondPart(aRequest, aResponse) { });
-
- // Start the download, without allowing the request to finish.
- mustInterruptResponses();
- let download;
- if (!gUseLegacySaver) {
- // When testing DownloadCopySaver, we have control over the download, thus
- // we can hook its onchange callback that will be notified when the
- // download starts.
- download = yield promiseNewDownload(sourceUrl);
-
- download.onchange = function () {
- if (!download.stopped) {
- do_check_false(download.hasProgress);
- do_check_eq(download.currentBytes, 0);
- do_check_eq(download.totalBytes, 0);
- }
- };
-
- download.start().catch(() => {});
- } else {
- // When testing DownloadLegacySaver, the download is already started when it
- // is created, and it may have already made all needed property change
- // notifications, thus there is no point in checking the onchange callback.
- download = yield promiseStartLegacyDownload(sourceUrl);
- }
-
- // Wait for the request to be received by the HTTP server, but don't allow the
- // request to finish yet. Before checking the download state, wait for the
- // events to be processed by the client.
- yield deferRequestReceived.promise;
- yield promiseExecuteSoon();
-
- // Check that this download has no progress report.
- do_check_false(download.stopped);
- do_check_false(download.hasProgress);
- do_check_eq(download.currentBytes, 0);
- do_check_eq(download.totalBytes, 0);
-
- // Now allow the response to finish.
- continueResponses();
- yield promiseDownloadStopped(download);
-
- // We should have received the content type even if no progress is reported.
- do_check_eq(download.contentType, "text/plain");
-
- // Verify the state of the completed download.
- do_check_true(download.stopped);
- do_check_false(download.hasProgress);
- do_check_eq(download.progress, 100);
- do_check_eq(download.currentBytes, 0);
- do_check_eq(download.totalBytes, 0);
- do_check_true(download.target.exists);
- do_check_eq(download.target.size, 0);
-
- do_check_eq((yield OS.File.stat(download.target.path)).size, 0);
-});
-
-/**
- * Calls the "start" method two times before the download is finished.
- */
-add_task(function* test_start_twice()
-{
- mustInterruptResponses();
-
- let download;
- if (!gUseLegacySaver) {
- // When testing DownloadCopySaver, we have control over the download, thus
- // we can start the download later during the test.
- download = yield promiseNewDownload(httpUrl("interruptible.txt"));
- } else {
- // When testing DownloadLegacySaver, the download is already started when it
- // is created. Effectively, we are starting the download three times.
- download = yield promiseStartLegacyDownload(httpUrl("interruptible.txt"));
- }
-
- // Call the start method two times.
- let promiseAttempt1 = download.start();
- let promiseAttempt2 = download.start();
-
- // Allow the download to finish.
- continueResponses();
-
- // Both promises should now be resolved.
- yield promiseAttempt1;
- yield promiseAttempt2;
-
- do_check_true(download.stopped);
- do_check_true(download.succeeded);
- do_check_false(download.canceled);
- do_check_true(download.error === null);
-
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT + TEST_DATA_SHORT);
-});
-
-/**
- * Cancels a download and verifies that its state is reported correctly.
- */
-add_task(function* test_cancel_midway()
-{
- mustInterruptResponses();
-
- // In this test case, we execute different checks that are only possible with
- // DownloadCopySaver or DownloadLegacySaver respectively.
- let download;
- let options = {};
- if (!gUseLegacySaver) {
- download = yield promiseNewDownload(httpUrl("interruptible.txt"));
- } else {
- download = yield promiseStartLegacyDownload(httpUrl("interruptible.txt"),
- options);
- }
-
- // Cancel the download after receiving the first part of the response.
- let deferCancel = Promise.defer();
- let onchange = function () {
- if (!download.stopped && !download.canceled && download.progress == 50) {
- // Cancel the download immediately during the notification.
- deferCancel.resolve(download.cancel());
-
- // The state change happens immediately after calling "cancel", but
- // temporary files or part files may still exist at this point.
- do_check_true(download.canceled);
- }
- };
-
- // Register for the notification, but also call the function directly in
- // case the download already reached the expected progress. This may happen
- // when using DownloadLegacySaver.
- download.onchange = onchange;
- onchange();
-
- let promiseAttempt;
- if (!gUseLegacySaver) {
- promiseAttempt = download.start();
- }
-
- // Wait on the promise returned by the "cancel" method to ensure that the
- // cancellation process finished and temporary files were removed.
- yield deferCancel.promise;
-
- if (gUseLegacySaver) {
- // The nsIWebBrowserPersist instance should have been canceled now.
- do_check_eq(options.outPersist.result, Cr.NS_ERROR_ABORT);
- }
-
- do_check_true(download.stopped);
- do_check_true(download.canceled);
- do_check_true(download.error === null);
- do_check_false(download.target.exists);
- do_check_eq(download.target.size, 0);
-
- do_check_false(yield OS.File.exists(download.target.path));
-
- // Progress properties are not reset by canceling.
- do_check_eq(download.progress, 50);
- do_check_eq(download.totalBytes, TEST_DATA_SHORT.length * 2);
- do_check_eq(download.currentBytes, TEST_DATA_SHORT.length);
-
- if (!gUseLegacySaver) {
- // The promise returned by "start" should have been rejected meanwhile.
- try {
- yield promiseAttempt;
- do_throw("The download should have been canceled.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error)) {
- throw ex;
- }
- do_check_false(ex.becauseSourceFailed);
- do_check_false(ex.becauseTargetFailed);
- }
- }
-});
-
-/**
- * Cancels a download while keeping partially downloaded data, and verifies that
- * both the target file and the ".part" file are deleted.
- */
-add_task(function* test_cancel_midway_tryToKeepPartialData()
-{
- let download = yield promiseStartDownload_tryToKeepPartialData();
-
- do_check_true(yield OS.File.exists(download.target.path));
- do_check_true(yield OS.File.exists(download.target.partFilePath));
-
- yield download.cancel();
- yield download.removePartialData();
-
- do_check_true(download.stopped);
- do_check_true(download.canceled);
- do_check_true(download.error === null);
-
- do_check_false(yield OS.File.exists(download.target.path));
- do_check_false(yield OS.File.exists(download.target.partFilePath));
-});
-
-/**
- * Cancels a download right after starting it.
- */
-add_task(function* test_cancel_immediately()
-{
- mustInterruptResponses();
-
- let download = yield promiseStartDownload(httpUrl("interruptible.txt"));
-
- let promiseAttempt = download.start();
- do_check_false(download.stopped);
-
- let promiseCancel = download.cancel();
- do_check_true(download.canceled);
-
- // At this point, we don't know whether the download has already stopped or
- // is still waiting for cancellation. We can wait on the promise returned
- // by the "start" method to know for sure.
- try {
- yield promiseAttempt;
- do_throw("The download should have been canceled.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error)) {
- throw ex;
- }
- do_check_false(ex.becauseSourceFailed);
- do_check_false(ex.becauseTargetFailed);
- }
-
- do_check_true(download.stopped);
- do_check_true(download.canceled);
- do_check_true(download.error === null);
-
- do_check_false(yield OS.File.exists(download.target.path));
-
- // Check that the promise returned by the "cancel" method has been resolved.
- yield promiseCancel;
-});
-
-/**
- * Cancels and restarts a download sequentially.
- */
-add_task(function* test_cancel_midway_restart()
-{
- mustInterruptResponses();
-
- let download = yield promiseStartDownload(httpUrl("interruptible.txt"));
-
- // The first time, cancel the download midway.
- yield promiseDownloadMidway(download);
- yield download.cancel();
-
- do_check_true(download.stopped);
-
- // The second time, we'll provide the entire interruptible response.
- continueResponses();
- download.onchange = null;
- let promiseAttempt = download.start();
-
- // Download state should have already been reset.
- do_check_false(download.stopped);
- do_check_false(download.canceled);
- do_check_true(download.error === null);
-
- // For the following test, we rely on the network layer reporting its progress
- // asynchronously. Otherwise, there is nothing stopping the restarted
- // download from reaching the same progress as the first request already.
- do_check_eq(download.progress, 0);
- do_check_eq(download.totalBytes, 0);
- do_check_eq(download.currentBytes, 0);
-
- yield promiseAttempt;
-
- do_check_true(download.stopped);
- do_check_true(download.succeeded);
- do_check_false(download.canceled);
- do_check_true(download.error === null);
-
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT + TEST_DATA_SHORT);
-});
-
-/**
- * Cancels a download and restarts it from where it stopped.
- */
-add_task(function* test_cancel_midway_restart_tryToKeepPartialData()
-{
- let download = yield promiseStartDownload_tryToKeepPartialData();
- yield download.cancel();
-
- do_check_true(download.stopped);
- do_check_true(download.hasPartialData);
-
- // The target file should not exist, but we should have kept the partial data.
- do_check_false(yield OS.File.exists(download.target.path));
- yield promiseVerifyContents(download.target.partFilePath, TEST_DATA_SHORT);
- do_check_false(download.target.exists);
- do_check_eq(download.target.size, 0);
-
- // Verify that the server sent the response from the start.
- do_check_eq(gMostRecentFirstBytePos, 0);
-
- // The second time, we'll request and obtain the second part of the response,
- // but we still stop when half of the remaining progress is reached.
- let deferMidway = Promise.defer();
- download.onchange = function () {
- if (!download.stopped && !download.canceled &&
- download.currentBytes == Math.floor(TEST_DATA_SHORT.length * 3 / 2)) {
- download.onchange = null;
- deferMidway.resolve();
- }
- };
-
- mustInterruptResponses();
- let promiseAttempt = download.start();
-
- // Continue when the number of bytes we received is correct, then check that
- // progress is at about 75 percent. The exact figure may vary because of
- // rounding issues, since the total number of bytes in the response might not
- // be a multiple of four.
- yield deferMidway.promise;
- do_check_true(download.progress > 72 && download.progress < 78);
-
- // Now we allow the download to finish.
- continueResponses();
- yield promiseAttempt;
-
- // Check that the server now sent the second part only.
- do_check_eq(gMostRecentFirstBytePos, TEST_DATA_SHORT.length);
-
- // The target file should now have been created, and the ".part" file deleted.
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT + TEST_DATA_SHORT);
- do_check_false(yield OS.File.exists(download.target.partFilePath));
-});
-
-/**
- * Cancels a download while keeping partially downloaded data, then removes the
- * data and restarts the download from the beginning.
- */
-add_task(function* test_cancel_midway_restart_removePartialData()
-{
- let download = yield promiseStartDownload_tryToKeepPartialData();
- yield download.cancel();
-
- do_check_true(download.hasPartialData);
- yield promiseVerifyContents(download.target.partFilePath, TEST_DATA_SHORT);
- do_check_false(download.target.exists);
- do_check_eq(download.target.size, 0);
-
- yield download.removePartialData();
-
- do_check_false(download.hasPartialData);
- do_check_false(yield OS.File.exists(download.target.partFilePath));
- do_check_false(download.target.exists);
- do_check_eq(download.target.size, 0);
-
- // The second time, we'll request and obtain the entire response again.
- continueResponses();
- yield download.start();
-
- // Verify that the server sent the response from the start.
- do_check_eq(gMostRecentFirstBytePos, 0);
-
- // The target file should now have been created, and the ".part" file deleted.
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT + TEST_DATA_SHORT);
- do_check_false(yield OS.File.exists(download.target.partFilePath));
-});
-
-/**
- * Cancels a download while keeping partially downloaded data, then removes the
- * data and restarts the download from the beginning without keeping the partial
- * data anymore.
- */
-add_task(function* test_cancel_midway_restart_tryToKeepPartialData_false()
-{
- let download = yield promiseStartDownload_tryToKeepPartialData();
- yield download.cancel();
-
- download.tryToKeepPartialData = false;
-
- // The above property change does not affect existing partial data.
- do_check_true(download.hasPartialData);
- yield promiseVerifyContents(download.target.partFilePath, TEST_DATA_SHORT);
-
- yield download.removePartialData();
- do_check_false(yield OS.File.exists(download.target.partFilePath));
-
- // Restart the download from the beginning.
- mustInterruptResponses();
- download.start().catch(() => {});
-
- yield promiseDownloadMidway(download);
- yield promisePartFileReady(download);
-
- // While the download is in progress, we should still have a ".part" file.
- do_check_false(download.hasPartialData);
- do_check_true(yield OS.File.exists(download.target.partFilePath));
-
- // On Unix, verify that the file with the partially downloaded data is not
- // accessible by other users on the system.
- if (Services.appinfo.OS == "Darwin" || Services.appinfo.OS == "Linux") {
- do_check_eq((yield OS.File.stat(download.target.partFilePath)).unixMode,
- 0o600);
- }
-
- yield download.cancel();
-
- // The ".part" file should be deleted now that the download is canceled.
- do_check_false(download.hasPartialData);
- do_check_false(yield OS.File.exists(download.target.partFilePath));
-
- // The third time, we'll request and obtain the entire response again.
- continueResponses();
- yield download.start();
-
- // Verify that the server sent the response from the start.
- do_check_eq(gMostRecentFirstBytePos, 0);
-
- // The target file should now have been created, and the ".part" file deleted.
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT + TEST_DATA_SHORT);
- do_check_false(yield OS.File.exists(download.target.partFilePath));
-});
-
-/**
- * Cancels a download right after starting it, then restarts it immediately.
- */
-add_task(function* test_cancel_immediately_restart_immediately()
-{
- mustInterruptResponses();
-
- let download = yield promiseStartDownload(httpUrl("interruptible.txt"));
- let promiseAttempt = download.start();
-
- do_check_false(download.stopped);
-
- download.cancel();
- do_check_true(download.canceled);
-
- let promiseRestarted = download.start();
- do_check_false(download.stopped);
- do_check_false(download.canceled);
- do_check_true(download.error === null);
-
- // For the following test, we rely on the network layer reporting its progress
- // asynchronously. Otherwise, there is nothing stopping the restarted
- // download from reaching the same progress as the first request already.
- do_check_eq(download.hasProgress, false);
- do_check_eq(download.progress, 0);
- do_check_eq(download.totalBytes, 0);
- do_check_eq(download.currentBytes, 0);
-
- // Ensure the next request is now allowed to complete, regardless of whether
- // the canceled request was received by the server or not.
- continueResponses();
- try {
- yield promiseAttempt;
- // If we get here, it means that the first attempt actually succeeded. In
- // fact, this could be a valid outcome, because the cancellation request may
- // not have been processed in time before the download finished.
- do_print("The download should have been canceled.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error)) {
- throw ex;
- }
- do_check_false(ex.becauseSourceFailed);
- do_check_false(ex.becauseTargetFailed);
- }
-
- yield promiseRestarted;
-
- do_check_true(download.stopped);
- do_check_true(download.succeeded);
- do_check_false(download.canceled);
- do_check_true(download.error === null);
-
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT + TEST_DATA_SHORT);
-});
-
-/**
- * Cancels a download midway, then restarts it immediately.
- */
-add_task(function* test_cancel_midway_restart_immediately()
-{
- mustInterruptResponses();
-
- let download = yield promiseStartDownload(httpUrl("interruptible.txt"));
- let promiseAttempt = download.start();
-
- // The first time, cancel the download midway.
- yield promiseDownloadMidway(download);
- download.cancel();
- do_check_true(download.canceled);
-
- let promiseRestarted = download.start();
- do_check_false(download.stopped);
- do_check_false(download.canceled);
- do_check_true(download.error === null);
-
- // For the following test, we rely on the network layer reporting its progress
- // asynchronously. Otherwise, there is nothing stopping the restarted
- // download from reaching the same progress as the first request already.
- do_check_eq(download.hasProgress, false);
- do_check_eq(download.progress, 0);
- do_check_eq(download.totalBytes, 0);
- do_check_eq(download.currentBytes, 0);
-
- // The second request is allowed to complete.
- continueResponses();
- try {
- yield promiseAttempt;
- do_throw("The download should have been canceled.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error)) {
- throw ex;
- }
- do_check_false(ex.becauseSourceFailed);
- do_check_false(ex.becauseTargetFailed);
- }
-
- yield promiseRestarted;
-
- do_check_true(download.stopped);
- do_check_true(download.succeeded);
- do_check_false(download.canceled);
- do_check_true(download.error === null);
-
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT + TEST_DATA_SHORT);
-});
-
-/**
- * Calls the "cancel" method on a successful download.
- */
-add_task(function* test_cancel_successful()
-{
- let download = yield promiseStartDownload();
- yield promiseDownloadStopped(download);
-
- // The cancel method should succeed with no effect.
- yield download.cancel();
-
- do_check_true(download.stopped);
- do_check_true(download.succeeded);
- do_check_false(download.canceled);
- do_check_true(download.error === null);
-
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT);
-});
-
-/**
- * Calls the "cancel" method two times in a row.
- */
-add_task(function* test_cancel_twice()
-{
- mustInterruptResponses();
-
- let download = yield promiseStartDownload(httpUrl("interruptible.txt"));
-
- let promiseAttempt = download.start();
- do_check_false(download.stopped);
-
- let promiseCancel1 = download.cancel();
- do_check_true(download.canceled);
- let promiseCancel2 = download.cancel();
-
- try {
- yield promiseAttempt;
- do_throw("The download should have been canceled.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error)) {
- throw ex;
- }
- do_check_false(ex.becauseSourceFailed);
- do_check_false(ex.becauseTargetFailed);
- }
-
- // Both promises should now be resolved.
- yield promiseCancel1;
- yield promiseCancel2;
-
- do_check_true(download.stopped);
- do_check_false(download.succeeded);
- do_check_true(download.canceled);
- do_check_true(download.error === null);
-
- do_check_false(yield OS.File.exists(download.target.path));
-});
-
-/**
- * Checks the "refresh" method for succeeded downloads.
- */
-add_task(function* test_refresh_succeeded()
-{
- let download = yield promiseStartDownload();
- yield promiseDownloadStopped(download);
-
- // The DownloadTarget properties should be the same after calling "refresh".
- yield download.refresh();
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT);
-
- // If the file is removed, only the "exists" property should change, and the
- // "size" property should keep its previous value.
- yield OS.File.move(download.target.path, download.target.path + ".old");
- yield download.refresh();
- do_check_false(download.target.exists);
- do_check_eq(download.target.size, TEST_DATA_SHORT.length);
-
- // The DownloadTarget properties should be restored when the file is put back.
- yield OS.File.move(download.target.path + ".old", download.target.path);
- yield download.refresh();
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT);
-});
-
-/**
- * Checks that a download cannot be restarted after the "finalize" method.
- */
-add_task(function* test_finalize()
-{
- mustInterruptResponses();
-
- let download = yield promiseStartDownload(httpUrl("interruptible.txt"));
-
- let promiseFinalized = download.finalize();
-
- try {
- yield download.start();
- do_throw("It should not be possible to restart after finalization.");
- } catch (ex) { }
-
- yield promiseFinalized;
-
- do_check_true(download.stopped);
- do_check_false(download.succeeded);
- do_check_true(download.canceled);
- do_check_true(download.error === null);
-
- do_check_false(yield OS.File.exists(download.target.path));
-});
-
-/**
- * Checks that the "finalize" method can remove partially downloaded data.
- */
-add_task(function* test_finalize_tryToKeepPartialData()
-{
- // Check finalization without removing partial data.
- let download = yield promiseStartDownload_tryToKeepPartialData();
- yield download.finalize();
-
- do_check_true(download.hasPartialData);
- do_check_true(yield OS.File.exists(download.target.partFilePath));
-
- // Clean up.
- yield download.removePartialData();
-
- // Check finalization while removing partial data.
- download = yield promiseStartDownload_tryToKeepPartialData();
- yield download.finalize(true);
-
- do_check_false(download.hasPartialData);
- do_check_false(yield OS.File.exists(download.target.partFilePath));
-});
-
-/**
- * Checks that whenSucceeded returns a promise that is resolved after a restart.
- */
-add_task(function* test_whenSucceeded_after_restart()
-{
- mustInterruptResponses();
-
- let promiseSucceeded;
-
- let download;
- if (!gUseLegacySaver) {
- // When testing DownloadCopySaver, we have control over the download, thus
- // we can verify getting a reference before the first download attempt.
- download = yield promiseNewDownload(httpUrl("interruptible.txt"));
- promiseSucceeded = download.whenSucceeded();
- download.start().catch(() => {});
- } else {
- // When testing DownloadLegacySaver, the download is already started when it
- // is created, thus we cannot get the reference before the first attempt.
- download = yield promiseStartLegacyDownload(httpUrl("interruptible.txt"));
- promiseSucceeded = download.whenSucceeded();
- }
-
- // Cancel the first download attempt.
- yield download.cancel();
-
- // The second request is allowed to complete.
- continueResponses();
- download.start().catch(() => {});
-
- // Wait for the download to finish by waiting on the whenSucceeded promise.
- yield promiseSucceeded;
-
- do_check_true(download.stopped);
- do_check_true(download.succeeded);
- do_check_false(download.canceled);
- do_check_true(download.error === null);
-
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT + TEST_DATA_SHORT);
-});
-
-/**
- * Ensures download error details are reported on network failures.
- */
-add_task(function* test_error_source()
-{
- let serverSocket = startFakeServer();
- try {
- let sourceUrl = "http://localhost:" + serverSocket.port + "/source.txt";
-
- let download;
- try {
- if (!gUseLegacySaver) {
- // When testing DownloadCopySaver, we want to check that the promise
- // returned by the "start" method is rejected.
- download = yield promiseNewDownload(sourceUrl);
-
- do_check_true(download.error === null);
-
- yield download.start();
- } else {
- // When testing DownloadLegacySaver, we cannot be sure whether we are
- // testing the promise returned by the "start" method or we are testing
- // the "error" property checked by promiseDownloadStopped. This happens
- // because we don't have control over when the download is started.
- download = yield promiseStartLegacyDownload(sourceUrl);
- yield promiseDownloadStopped(download);
- }
- do_throw("The download should have failed.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error) || !ex.becauseSourceFailed) {
- throw ex;
- }
- // A specific error object is thrown when reading from the source fails.
- }
-
- // Check the properties now that the download stopped.
- do_check_true(download.stopped);
- do_check_false(download.canceled);
- do_check_true(download.error !== null);
- do_check_true(download.error.becauseSourceFailed);
- do_check_false(download.error.becauseTargetFailed);
-
- do_check_false(yield OS.File.exists(download.target.path));
- do_check_false(download.target.exists);
- do_check_eq(download.target.size, 0);
- } finally {
- serverSocket.close();
- }
-});
-
-/**
- * Ensures a download error is reported when receiving less bytes than what was
- * specified in the Content-Length header.
- */
-add_task(function* test_error_source_partial()
-{
- let sourceUrl = httpUrl("shorter-than-content-length-http-1-1.txt");
-
- let enforcePref = Services.prefs.getBoolPref("network.http.enforce-framing.http1");
- Services.prefs.setBoolPref("network.http.enforce-framing.http1", true);
-
- function cleanup() {
- Services.prefs.setBoolPref("network.http.enforce-framing.http1", enforcePref);
- }
- do_register_cleanup(cleanup);
-
- let download;
- try {
- if (!gUseLegacySaver) {
- // When testing DownloadCopySaver, we want to check that the promise
- // returned by the "start" method is rejected.
- download = yield promiseNewDownload(sourceUrl);
-
- do_check_true(download.error === null);
-
- yield download.start();
- } else {
- // When testing DownloadLegacySaver, we cannot be sure whether we are
- // testing the promise returned by the "start" method or we are testing
- // the "error" property checked by promiseDownloadStopped. This happens
- // because we don't have control over when the download is started.
- download = yield promiseStartLegacyDownload(sourceUrl);
- yield promiseDownloadStopped(download);
- }
- do_throw("The download should have failed.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error) || !ex.becauseSourceFailed) {
- throw ex;
- }
- // A specific error object is thrown when reading from the source fails.
- }
-
- // Check the properties now that the download stopped.
- do_check_true(download.stopped);
- do_check_false(download.canceled);
- do_check_true(download.error !== null);
- do_check_true(download.error.becauseSourceFailed);
- do_check_false(download.error.becauseTargetFailed);
- do_check_eq(download.error.result, Cr.NS_ERROR_NET_PARTIAL_TRANSFER);
-
- do_check_false(yield OS.File.exists(download.target.path));
- do_check_false(download.target.exists);
- do_check_eq(download.target.size, 0);
-});
-
-/**
- * Ensures download error details are reported on local writing failures.
- */
-add_task(function* test_error_target()
-{
- // Create a file without write access permissions before downloading.
- let targetFile = getTempFile(TEST_TARGET_FILE_NAME);
- targetFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0);
- try {
- let download;
- try {
- if (!gUseLegacySaver) {
- // When testing DownloadCopySaver, we want to check that the promise
- // returned by the "start" method is rejected.
- download = yield Downloads.createDownload({
- source: httpUrl("source.txt"),
- target: targetFile,
- });
- yield download.start();
- } else {
- // When testing DownloadLegacySaver, we cannot be sure whether we are
- // testing the promise returned by the "start" method or we are testing
- // the "error" property checked by promiseDownloadStopped. This happens
- // because we don't have control over when the download is started.
- download = yield promiseStartLegacyDownload(null,
- { targetFile: targetFile });
- yield promiseDownloadStopped(download);
- }
- do_throw("The download should have failed.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error) || !ex.becauseTargetFailed) {
- throw ex;
- }
- // A specific error object is thrown when writing to the target fails.
- }
-
- // Check the properties now that the download stopped.
- do_check_true(download.stopped);
- do_check_false(download.canceled);
- do_check_true(download.error !== null);
- do_check_true(download.error.becauseTargetFailed);
- do_check_false(download.error.becauseSourceFailed);
- } finally {
- // Restore the default permissions to allow deleting the file on Windows.
- if (targetFile.exists()) {
- targetFile.permissions = FileUtils.PERMS_FILE;
- targetFile.remove(false);
- }
- }
-});
-
-/**
- * Restarts a failed download.
- */
-add_task(function* test_error_restart()
-{
- let download;
-
- // Create a file without write access permissions before downloading.
- let targetFile = getTempFile(TEST_TARGET_FILE_NAME);
- targetFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0);
- try {
- // Use DownloadCopySaver or DownloadLegacySaver based on the test run,
- // specifying the target file we created.
- if (!gUseLegacySaver) {
- download = yield Downloads.createDownload({
- source: httpUrl("source.txt"),
- target: targetFile,
- });
- download.start().catch(() => {});
- } else {
- download = yield promiseStartLegacyDownload(null,
- { targetFile: targetFile });
- }
- yield promiseDownloadStopped(download);
- do_throw("The download should have failed.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error) || !ex.becauseTargetFailed) {
- throw ex;
- }
- // A specific error object is thrown when writing to the target fails.
- } finally {
- // Restore the default permissions to allow deleting the file on Windows.
- if (targetFile.exists()) {
- targetFile.permissions = FileUtils.PERMS_FILE;
-
- // Also for Windows, rename the file before deleting. This makes the
- // current file name available immediately for a new file, while deleting
- // in place prevents creation of a file with the same name for some time.
- targetFile.moveTo(null, targetFile.leafName + ".delete.tmp");
- targetFile.remove(false);
- }
- }
-
- // Restart the download and wait for completion.
- yield download.start();
-
- do_check_true(download.stopped);
- do_check_true(download.succeeded);
- do_check_false(download.canceled);
- do_check_true(download.error === null);
- do_check_eq(download.progress, 100);
-
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT);
-});
-
-/**
- * Executes download in both public and private modes.
- */
-add_task(function* test_public_and_private()
-{
- let sourcePath = "/test_public_and_private.txt";
- let sourceUrl = httpUrl("test_public_and_private.txt");
- let testCount = 0;
-
- // Apply pref to allow all cookies.
- Services.prefs.setIntPref("network.cookie.cookieBehavior", 0);
-
- function cleanup() {
- Services.prefs.clearUserPref("network.cookie.cookieBehavior");
- Services.cookies.removeAll();
- gHttpServer.registerPathHandler(sourcePath, null);
- }
- do_register_cleanup(cleanup);
-
- gHttpServer.registerPathHandler(sourcePath, function (aRequest, aResponse) {
- aResponse.setHeader("Content-Type", "text/plain", false);
-
- if (testCount == 0) {
- // No cookies should exist for first public download.
- do_check_false(aRequest.hasHeader("Cookie"));
- aResponse.setHeader("Set-Cookie", "foobar=1", false);
- testCount++;
- } else if (testCount == 1) {
- // The cookie should exists for second public download.
- do_check_true(aRequest.hasHeader("Cookie"));
- do_check_eq(aRequest.getHeader("Cookie"), "foobar=1");
- testCount++;
- } else if (testCount == 2) {
- // No cookies should exist for first private download.
- do_check_false(aRequest.hasHeader("Cookie"));
- }
- });
-
- let targetFile = getTempFile(TEST_TARGET_FILE_NAME);
- yield Downloads.fetch(sourceUrl, targetFile);
- yield Downloads.fetch(sourceUrl, targetFile);
-
- if (!gUseLegacySaver) {
- let download = yield Downloads.createDownload({
- source: { url: sourceUrl, isPrivate: true },
- target: targetFile,
- });
- yield download.start();
- } else {
- let download = yield promiseStartLegacyDownload(sourceUrl,
- { isPrivate: true });
- yield promiseDownloadStopped(download);
- }
-
- cleanup();
-});
-
-/**
- * Checks the startTime gets updated even after a restart.
- */
-add_task(function* test_cancel_immediately_restart_and_check_startTime()
-{
- let download = yield promiseStartDownload();
-
- let startTime = download.startTime;
- do_check_true(isValidDate(download.startTime));
-
- yield download.cancel();
- do_check_eq(download.startTime.getTime(), startTime.getTime());
-
- // Wait for a timeout.
- yield promiseTimeout(10);
-
- yield download.start();
- do_check_true(download.startTime.getTime() > startTime.getTime());
-});
-
-/**
- * Executes download with content-encoding.
- */
-add_task(function* test_with_content_encoding()
-{
- let sourcePath = "/test_with_content_encoding.txt";
- let sourceUrl = httpUrl("test_with_content_encoding.txt");
-
- function cleanup() {
- gHttpServer.registerPathHandler(sourcePath, null);
- }
- do_register_cleanup(cleanup);
-
- gHttpServer.registerPathHandler(sourcePath, function (aRequest, aResponse) {
- aResponse.setHeader("Content-Type", "text/plain", false);
- aResponse.setHeader("Content-Encoding", "gzip", false);
- aResponse.setHeader("Content-Length",
- "" + TEST_DATA_SHORT_GZIP_ENCODED.length, false);
-
- let bos = new BinaryOutputStream(aResponse.bodyOutputStream);
- bos.writeByteArray(TEST_DATA_SHORT_GZIP_ENCODED,
- TEST_DATA_SHORT_GZIP_ENCODED.length);
- });
-
- let download = yield promiseStartDownload(sourceUrl);
- yield promiseDownloadStopped(download);
-
- do_check_eq(download.progress, 100);
- do_check_eq(download.totalBytes, TEST_DATA_SHORT_GZIP_ENCODED.length);
-
- // Ensure the content matches the decoded test data.
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT);
-
- cleanup();
-});
-
-/**
- * Checks that the file is not decoded if the extension matches the encoding.
- */
-add_task(function* test_with_content_encoding_ignore_extension()
-{
- let sourcePath = "/test_with_content_encoding_ignore_extension.gz";
- let sourceUrl = httpUrl("test_with_content_encoding_ignore_extension.gz");
-
- function cleanup() {
- gHttpServer.registerPathHandler(sourcePath, null);
- }
- do_register_cleanup(cleanup);
-
- gHttpServer.registerPathHandler(sourcePath, function (aRequest, aResponse) {
- aResponse.setHeader("Content-Type", "text/plain", false);
- aResponse.setHeader("Content-Encoding", "gzip", false);
- aResponse.setHeader("Content-Length",
- "" + TEST_DATA_SHORT_GZIP_ENCODED.length, false);
-
- let bos = new BinaryOutputStream(aResponse.bodyOutputStream);
- bos.writeByteArray(TEST_DATA_SHORT_GZIP_ENCODED,
- TEST_DATA_SHORT_GZIP_ENCODED.length);
- });
-
- let download = yield promiseStartDownload(sourceUrl);
- yield promiseDownloadStopped(download);
-
- do_check_eq(download.progress, 100);
- do_check_eq(download.totalBytes, TEST_DATA_SHORT_GZIP_ENCODED.length);
- do_check_eq(download.target.size, TEST_DATA_SHORT_GZIP_ENCODED.length);
-
- // Ensure the content matches the encoded test data. We convert the data to a
- // string before executing the content check.
- yield promiseVerifyTarget(download.target,
- String.fromCharCode.apply(String, TEST_DATA_SHORT_GZIP_ENCODED));
-
- cleanup();
-});
-
-/**
- * Cancels and restarts a download sequentially with content-encoding.
- */
-add_task(function* test_cancel_midway_restart_with_content_encoding()
-{
- mustInterruptResponses();
-
- let download = yield promiseStartDownload(httpUrl("interruptible_gzip.txt"));
-
- // The first time, cancel the download midway.
- let deferCancel = Promise.defer();
- let onchange = function () {
- if (!download.stopped && !download.canceled &&
- download.currentBytes == TEST_DATA_SHORT_GZIP_ENCODED_FIRST.length) {
- deferCancel.resolve(download.cancel());
- }
- };
-
- // Register for the notification, but also call the function directly in
- // case the download already reached the expected progress.
- download.onchange = onchange;
- onchange();
-
- yield deferCancel.promise;
-
- do_check_true(download.stopped);
-
- // The second time, we'll provide the entire interruptible response.
- continueResponses();
- download.onchange = null;
- yield download.start();
-
- do_check_eq(download.progress, 100);
- do_check_eq(download.totalBytes, TEST_DATA_SHORT_GZIP_ENCODED.length);
-
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT);
-});
-
-/**
- * Download with parental controls enabled.
- */
-add_task(function* test_blocked_parental_controls()
-{
- let blockFn = base => ({
- shouldBlockForParentalControls: () => Promise.resolve(true),
- });
-
- Integration.downloads.register(blockFn);
- function cleanup() {
- Integration.downloads.unregister(blockFn);
- }
- do_register_cleanup(cleanup);
-
- let download;
- try {
- if (!gUseLegacySaver) {
- // When testing DownloadCopySaver, we want to check that the promise
- // returned by the "start" method is rejected.
- download = yield promiseNewDownload();
- yield download.start();
- } else {
- // When testing DownloadLegacySaver, we cannot be sure whether we are
- // testing the promise returned by the "start" method or we are testing
- // the "error" property checked by promiseDownloadStopped. This happens
- // because we don't have control over when the download is started.
- download = yield promiseStartLegacyDownload();
- yield promiseDownloadStopped(download);
- }
- do_throw("The download should have blocked.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error) || !ex.becauseBlocked) {
- throw ex;
- }
- do_check_true(ex.becauseBlockedByParentalControls);
- do_check_true(download.error.becauseBlockedByParentalControls);
- }
-
- // Now that the download stopped, the target file should not exist.
- do_check_false(yield OS.File.exists(download.target.path));
-
- cleanup();
-});
-
-/**
- * Test a download that will be blocked by Windows parental controls by
- * resulting in an HTTP status code of 450.
- */
-add_task(function* test_blocked_parental_controls_httpstatus450()
-{
- let download;
- try {
- if (!gUseLegacySaver) {
- download = yield promiseNewDownload(httpUrl("parentalblocked.zip"));
- yield download.start();
- }
- else {
- download = yield promiseStartLegacyDownload(httpUrl("parentalblocked.zip"));
- yield promiseDownloadStopped(download);
- }
- do_throw("The download should have blocked.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error) || !ex.becauseBlocked) {
- throw ex;
- }
- do_check_true(ex.becauseBlockedByParentalControls);
- do_check_true(download.error.becauseBlockedByParentalControls);
- do_check_true(download.stopped);
- }
-
- do_check_false(yield OS.File.exists(download.target.path));
-});
-
-/**
- * Download with runtime permissions
- */
-add_task(function* test_blocked_runtime_permissions()
-{
- let blockFn = base => ({
- shouldBlockForRuntimePermissions: () => Promise.resolve(true),
- });
-
- Integration.downloads.register(blockFn);
- function cleanup() {
- Integration.downloads.unregister(blockFn);
- }
- do_register_cleanup(cleanup);
-
- let download;
- try {
- if (!gUseLegacySaver) {
- // When testing DownloadCopySaver, we want to check that the promise
- // returned by the "start" method is rejected.
- download = yield promiseNewDownload();
- yield download.start();
- } else {
- // When testing DownloadLegacySaver, we cannot be sure whether we are
- // testing the promise returned by the "start" method or we are testing
- // the "error" property checked by promiseDownloadStopped. This happens
- // because we don't have control over when the download is started.
- download = yield promiseStartLegacyDownload();
- yield promiseDownloadStopped(download);
- }
- do_throw("The download should have blocked.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error) || !ex.becauseBlocked) {
- throw ex;
- }
- do_check_true(ex.becauseBlockedByRuntimePermissions);
- do_check_true(download.error.becauseBlockedByRuntimePermissions);
- }
-
- // Now that the download stopped, the target file should not exist.
- do_check_false(yield OS.File.exists(download.target.path));
-
- cleanup();
-});
-
-/**
- * Check that DownloadCopySaver can always retrieve the hash.
- * DownloadLegacySaver can only retrieve the hash when
- * nsIExternalHelperAppService is invoked.
- */
-add_task(function* test_getSha256Hash()
-{
- if (!gUseLegacySaver) {
- let download = yield promiseStartDownload(httpUrl("source.txt"));
- yield promiseDownloadStopped(download);
- do_check_true(download.stopped);
- do_check_eq(32, download.saver.getSha256Hash().length);
- }
-});
-
-/**
- * Create a download which will be reputation blocked.
- *
- * @param options
- * {
- * keepPartialData: bool,
- * keepBlockedData: bool,
- * }
- * @return {Promise}
- * @resolves The reputation blocked download.
- * @rejects JavaScript exception.
- */
-var promiseBlockedDownload = Task.async(function* (options) {
- let blockFn = base => ({
- shouldBlockForReputationCheck: () => Promise.resolve({
- shouldBlock: true,
- verdict: Downloads.Error.BLOCK_VERDICT_UNCOMMON,
- }),
- shouldKeepBlockedData: () => Promise.resolve(options.keepBlockedData),
- });
-
- Integration.downloads.register(blockFn);
- function cleanup() {
- Integration.downloads.unregister(blockFn);
- }
- do_register_cleanup(cleanup);
-
- let download;
-
- try {
- if (options.keepPartialData) {
- download = yield promiseStartDownload_tryToKeepPartialData();
- continueResponses();
- } else if (gUseLegacySaver) {
- download = yield promiseStartLegacyDownload();
- } else {
- download = yield promiseNewDownload();
- yield download.start();
- do_throw("The download should have blocked.");
- }
-
- yield promiseDownloadStopped(download);
- do_throw("The download should have blocked.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error) || !ex.becauseBlocked) {
- throw ex;
- }
- do_check_true(ex.becauseBlockedByReputationCheck);
- do_check_eq(ex.reputationCheckVerdict,
- Downloads.Error.BLOCK_VERDICT_UNCOMMON);
- do_check_true(download.error.becauseBlockedByReputationCheck);
- do_check_eq(download.error.reputationCheckVerdict,
- Downloads.Error.BLOCK_VERDICT_UNCOMMON);
- }
-
- do_check_true(download.stopped);
- do_check_false(download.succeeded);
- do_check_false(yield OS.File.exists(download.target.path));
-
- cleanup();
- return download;
-});
-
-/**
- * Checks that application reputation blocks the download and the target file
- * does not exist.
- */
-add_task(function* test_blocked_applicationReputation()
-{
- let download = yield promiseBlockedDownload({
- keepPartialData: false,
- keepBlockedData: false,
- });
-
- // Now that the download is blocked, the target file should not exist.
- do_check_false(yield OS.File.exists(download.target.path));
- do_check_false(download.target.exists);
- do_check_eq(download.target.size, 0);
-
- // There should also be no blocked data in this case
- do_check_false(download.hasBlockedData);
-});
-
-/**
- * Checks that if a download restarts while processing an application reputation
- * request, the status is handled correctly.
- */
-add_task(function* test_blocked_applicationReputation_race()
-{
- let isFirstShouldBlockCall = true;
-
- let blockFn = base => ({
- shouldBlockForReputationCheck(download) {
- if (isFirstShouldBlockCall) {
- isFirstShouldBlockCall = false;
-
- // 2. Cancel and restart the download before the first attempt has a
- // chance to finish.
- download.cancel();
- download.removePartialData();
- download.start();
-
- // 3. Allow the first attempt to finish with a blocked response.
- return Promise.resolve({
- shouldBlock: true,
- verdict: Downloads.Error.BLOCK_VERDICT_UNCOMMON,
- });
- }
-
- // 4/5. Don't block the download the second time. The race condition would
- // occur with the first attempt regardless of whether the second one
- // is blocked, but not blocking here makes the test simpler.
- return Promise.resolve({
- shouldBlock: false,
- verdict: "",
- });
- },
- shouldKeepBlockedData: () => Promise.resolve(true),
- });
-
- Integration.downloads.register(blockFn);
- function cleanup() {
- Integration.downloads.unregister(blockFn);
- }
- do_register_cleanup(cleanup);
-
- let download;
-
- try {
- // 1. Start the download and get a reference to the promise asociated with
- // the first attempt, before allowing the response to continue.
- download = yield promiseStartDownload_tryToKeepPartialData();
- let firstAttempt = promiseDownloadStopped(download);
- continueResponses();
-
- // 4/5. Wait for the first attempt to be completed. The result of this
- // should appear as a cancellation.
- yield firstAttempt;
-
- do_throw("The first attempt should have been canceled.");
- } catch (ex) {
- // The "becauseBlocked" property should be false.
- if (!(ex instanceof Downloads.Error) || ex.becauseBlocked) {
- throw ex;
- }
- }
-
- // 6. Wait for the second attempt to be completed.
- yield promiseDownloadStopped(download);
-
- // 7. At this point, "hasBlockedData" should be false.
- do_check_false(download.hasBlockedData);
-
- cleanup();
-});
-
-/**
- * Checks that application reputation blocks the download but maintains the
- * blocked data, which will be deleted when the block is confirmed.
- */
-add_task(function* test_blocked_applicationReputation_confirmBlock()
-{
- let download = yield promiseBlockedDownload({
- keepPartialData: true,
- keepBlockedData: true,
- });
-
- do_check_true(download.hasBlockedData);
- do_check_true(yield OS.File.exists(download.target.partFilePath));
-
- yield download.confirmBlock();
-
- // After confirming the block the download should be in a failed state and
- // have no downloaded data left on disk.
- do_check_true(download.stopped);
- do_check_false(download.succeeded);
- do_check_false(download.hasBlockedData);
- do_check_false(yield OS.File.exists(download.target.partFilePath));
- do_check_false(yield OS.File.exists(download.target.path));
- do_check_false(download.target.exists);
- do_check_eq(download.target.size, 0);
-});
-
-/**
- * Checks that application reputation blocks the download but maintains the
- * blocked data, which will be used to complete the download when unblocking.
- */
-add_task(function* test_blocked_applicationReputation_unblock()
-{
- let download = yield promiseBlockedDownload({
- keepPartialData: true,
- keepBlockedData: true,
- });
-
- do_check_true(download.hasBlockedData);
- do_check_true(yield OS.File.exists(download.target.partFilePath));
-
- yield download.unblock();
-
- // After unblocking the download should have succeeded and be
- // present at the final path.
- do_check_true(download.stopped);
- do_check_true(download.succeeded);
- do_check_false(download.hasBlockedData);
- do_check_false(yield OS.File.exists(download.target.partFilePath));
- yield promiseVerifyTarget(download.target, TEST_DATA_SHORT + TEST_DATA_SHORT);
-
- // The only indication the download was previously blocked is the
- // existence of the error, so we make sure it's still set.
- do_check_true(download.error instanceof Downloads.Error);
- do_check_true(download.error.becauseBlocked);
- do_check_true(download.error.becauseBlockedByReputationCheck);
-});
-
-/**
- * Check that calling cancel on a blocked download will not cause errors
- */
-add_task(function* test_blocked_applicationReputation_cancel()
-{
- let download = yield promiseBlockedDownload({
- keepPartialData: true,
- keepBlockedData: true,
- });
-
- // This call should succeed on a blocked download.
- yield download.cancel();
-
- // Calling cancel should not have changed the current state, the download
- // should still be blocked.
- do_check_true(download.error.becauseBlockedByReputationCheck);
- do_check_true(download.stopped);
- do_check_false(download.succeeded);
- do_check_true(download.hasBlockedData);
-});
-
-/**
- * Checks that unblock and confirmBlock cannot race on a blocked download
- */
-add_task(function* test_blocked_applicationReputation_decisionRace()
-{
- let download = yield promiseBlockedDownload({
- keepPartialData: true,
- keepBlockedData: true,
- });
-
- let unblockPromise = download.unblock();
- let confirmBlockPromise = download.confirmBlock();
-
- yield confirmBlockPromise.then(() => {
- do_throw("confirmBlock should have failed.");
- }, () => {});
-
- yield unblockPromise;
-
- // After unblocking the download should have succeeded and be
- // present at the final path.
- do_check_true(download.stopped);
- do_check_true(download.succeeded);
- do_check_false(download.hasBlockedData);
- do_check_false(yield OS.File.exists(download.target.partFilePath));
- do_check_true(yield OS.File.exists(download.target.path));
-
- download = yield promiseBlockedDownload({
- keepPartialData: true,
- keepBlockedData: true,
- });
-
- confirmBlockPromise = download.confirmBlock();
- unblockPromise = download.unblock();
-
- yield unblockPromise.then(() => {
- do_throw("unblock should have failed.");
- }, () => {});
-
- yield confirmBlockPromise;
-
- // After confirming the block the download should be in a failed state and
- // have no downloaded data left on disk.
- do_check_true(download.stopped);
- do_check_false(download.succeeded);
- do_check_false(download.hasBlockedData);
- do_check_false(yield OS.File.exists(download.target.partFilePath));
- do_check_false(yield OS.File.exists(download.target.path));
- do_check_false(download.target.exists);
- do_check_eq(download.target.size, 0);
-});
-
-/**
- * Checks that unblocking a blocked download fails if the blocked data has been
- * removed.
- */
-add_task(function* test_blocked_applicationReputation_unblock()
-{
- let download = yield promiseBlockedDownload({
- keepPartialData: true,
- keepBlockedData: true,
- });
-
- do_check_true(download.hasBlockedData);
- do_check_true(yield OS.File.exists(download.target.partFilePath));
-
- // Remove the blocked data without telling the download.
- yield OS.File.remove(download.target.partFilePath);
-
- let unblockPromise = download.unblock();
- yield unblockPromise.then(() => {
- do_throw("unblock should have failed.");
- }, () => {});
-
- // Even though unblocking failed the download state should have been updated
- // to reflect the lack of blocked data.
- do_check_false(download.hasBlockedData);
- do_check_true(download.stopped);
- do_check_false(download.succeeded);
- do_check_false(download.target.exists);
- do_check_eq(download.target.size, 0);
-});
-
-/**
- * download.showContainingDirectory() action
- */
-add_task(function* test_showContainingDirectory() {
- let targetPath = getTempFile(TEST_TARGET_FILE_NAME).path;
-
- let download = yield Downloads.createDownload({
- source: { url: httpUrl("source.txt") },
- target: ""
- });
-
- let promiseDirectoryShown = waitForDirectoryShown();
- yield download.showContainingDirectory();
- let path = yield promiseDirectoryShown;
- try {
- new FileUtils.File(path);
- do_throw("Should have failed because of an invalid path.");
- } catch (ex) {
- if (!(ex instanceof Components.Exception)) {
- throw ex;
- }
- // Invalid paths on Windows are reported with NS_ERROR_FAILURE,
- // but with NS_ERROR_FILE_UNRECOGNIZED_PATH on Mac/Linux
- let validResult = ex.result == Cr.NS_ERROR_FILE_UNRECOGNIZED_PATH ||
- ex.result == Cr.NS_ERROR_FAILURE;
- do_check_true(validResult);
- }
-
- download = yield Downloads.createDownload({
- source: { url: httpUrl("source.txt") },
- target: targetPath
- });
-
- promiseDirectoryShown = waitForDirectoryShown();
- download.showContainingDirectory();
- yield promiseDirectoryShown;
-});
-
-/**
- * download.launch() action
- */
-add_task(function* test_launch() {
- let customLauncher = getTempFile("app-launcher");
-
- // Test both with and without setting a custom application.
- for (let launcherPath of [null, customLauncher.path]) {
- let download;
- if (!gUseLegacySaver) {
- // When testing DownloadCopySaver, we have control over the download, thus
- // we can test that file is not launched if download.succeeded is not set.
- download = yield Downloads.createDownload({
- source: httpUrl("source.txt"),
- target: getTempFile(TEST_TARGET_FILE_NAME).path,
- launcherPath: launcherPath,
- launchWhenSucceeded: true
- });
-
- try {
- yield download.launch();
- do_throw("Can't launch download file as it has not completed yet");
- } catch (ex) {
- do_check_eq(ex.message,
- "launch can only be called if the download succeeded");
- }
-
- yield download.start();
- } else {
- // When testing DownloadLegacySaver, the download is already started when
- // it is created, thus we don't test calling "launch" before starting.
- download = yield promiseStartLegacyDownload(
- httpUrl("source.txt"),
- { launcherPath: launcherPath,
- launchWhenSucceeded: true });
- yield promiseDownloadStopped(download);
- }
-
- do_check_true(download.launchWhenSucceeded);
-
- let promiseFileLaunched = waitForFileLaunched();
- download.launch();
- let result = yield promiseFileLaunched;
-
- // Verify that the results match the test case.
- if (!launcherPath) {
- // This indicates that the default handler has been chosen.
- do_check_true(result === null);
- } else {
- // Check the nsIMIMEInfo instance that would have been used for launching.
- do_check_eq(result.preferredAction, Ci.nsIMIMEInfo.useHelperApp);
- do_check_true(result.preferredApplicationHandler
- .QueryInterface(Ci.nsILocalHandlerApp)
- .executable.equals(customLauncher));
- }
- }
-});
-
-/**
- * Test passing an invalid path as the launcherPath property.
- */
-add_task(function* test_launcherPath_invalid() {
- let download = yield Downloads.createDownload({
- source: { url: httpUrl("source.txt") },
- target: { path: getTempFile(TEST_TARGET_FILE_NAME).path },
- launcherPath: " "
- });
-
- let promiseDownloadLaunched = new Promise(resolve => {
- let waitFn = base => ({
- __proto__: base,
- launchDownload() {
- Integration.downloads.unregister(waitFn);
- let superPromise = super.launchDownload(...arguments);
- resolve(superPromise);
- return superPromise;
- },
- });
- Integration.downloads.register(waitFn);
- });
-
- yield download.start();
- try {
- download.launch();
- yield promiseDownloadLaunched;
- do_throw("Can't launch file with invalid custom launcher")
- } catch (ex) {
- if (!(ex instanceof Components.Exception)) {
- throw ex;
- }
- // Invalid paths on Windows are reported with NS_ERROR_FAILURE,
- // but with NS_ERROR_FILE_UNRECOGNIZED_PATH on Mac/Linux
- let validResult = ex.result == Cr.NS_ERROR_FILE_UNRECOGNIZED_PATH ||
- ex.result == Cr.NS_ERROR_FAILURE;
- do_check_true(validResult);
- }
-});
-
-/**
- * Tests that download.launch() is automatically called after
- * the download finishes if download.launchWhenSucceeded = true
- */
-add_task(function* test_launchWhenSucceeded() {
- let customLauncher = getTempFile("app-launcher");
-
- // Test both with and without setting a custom application.
- for (let launcherPath of [null, customLauncher.path]) {
- let promiseFileLaunched = waitForFileLaunched();
-
- if (!gUseLegacySaver) {
- let download = yield Downloads.createDownload({
- source: httpUrl("source.txt"),
- target: getTempFile(TEST_TARGET_FILE_NAME).path,
- launchWhenSucceeded: true,
- launcherPath: launcherPath,
- });
- yield download.start();
- } else {
- let download = yield promiseStartLegacyDownload(
- httpUrl("source.txt"),
- { launcherPath: launcherPath,
- launchWhenSucceeded: true });
- yield promiseDownloadStopped(download);
- }
-
- let result = yield promiseFileLaunched;
-
- // Verify that the results match the test case.
- if (!launcherPath) {
- // This indicates that the default handler has been chosen.
- do_check_true(result === null);
- } else {
- // Check the nsIMIMEInfo instance that would have been used for launching.
- do_check_eq(result.preferredAction, Ci.nsIMIMEInfo.useHelperApp);
- do_check_true(result.preferredApplicationHandler
- .QueryInterface(Ci.nsILocalHandlerApp)
- .executable.equals(customLauncher));
- }
- }
-});
-
-/**
- * Tests that the proper content type is set for a normal download.
- */
-add_task(function* test_contentType() {
- let download = yield promiseStartDownload(httpUrl("source.txt"));
- yield promiseDownloadStopped(download);
-
- do_check_eq("text/plain", download.contentType);
-});
-
-/**
- * Tests that the serialization/deserialization of the startTime Date
- * object works correctly.
- */
-add_task(function* test_toSerializable_startTime()
-{
- let download1 = yield promiseStartDownload(httpUrl("source.txt"));
- yield promiseDownloadStopped(download1);
-
- let serializable = download1.toSerializable();
- let reserialized = JSON.parse(JSON.stringify(serializable));
-
- let download2 = yield Downloads.createDownload(reserialized);
-
- do_check_eq(download1.startTime.constructor.name, "Date");
- do_check_eq(download2.startTime.constructor.name, "Date");
- do_check_eq(download1.startTime.toJSON(), download2.startTime.toJSON());
-});
-
-/**
- * Checks that downloads are added to browsing history when they start.
- */
-add_task(function* test_history()
-{
- mustInterruptResponses();
-
- // We will wait for the visit to be notified during the download.
- yield PlacesTestUtils.clearHistory();
- let promiseVisit = promiseWaitForVisit(httpUrl("interruptible.txt"));
-
- // Start a download that is not allowed to finish yet.
- let download = yield promiseStartDownload(httpUrl("interruptible.txt"));
-
- // The history notifications should be received before the download completes.
- let [time, transitionType] = yield promiseVisit;
- do_check_eq(time, download.startTime.getTime() * 1000);
- do_check_eq(transitionType, Ci.nsINavHistoryService.TRANSITION_DOWNLOAD);
-
- // Restart and complete the download after clearing history.
- yield PlacesTestUtils.clearHistory();
- download.cancel();
- continueResponses();
- yield download.start();
-
- // The restart should not have added a new history visit.
- do_check_false(yield promiseIsURIVisited(httpUrl("interruptible.txt")));
-});
-
-/**
- * Checks that downloads started by nsIHelperAppService are added to the
- * browsing history when they start.
- */
-add_task(function* test_history_tryToKeepPartialData()
-{
- // We will wait for the visit to be notified during the download.
- yield PlacesTestUtils.clearHistory();
- let promiseVisit =
- promiseWaitForVisit(httpUrl("interruptible_resumable.txt"));
-
- // Start a download that is not allowed to finish yet.
- let beforeStartTimeMs = Date.now();
- let download = yield promiseStartDownload_tryToKeepPartialData();
-
- // The history notifications should be received before the download completes.
- let [time, transitionType] = yield promiseVisit;
- do_check_eq(transitionType, Ci.nsINavHistoryService.TRANSITION_DOWNLOAD);
-
- // The time set by nsIHelperAppService may be different than the start time in
- // the download object, thus we only check that it is a meaningful time. Note
- // that we subtract one second from the earliest time to account for rounding.
- do_check_true(time >= beforeStartTimeMs * 1000 - 1000000);
-
- // Complete the download before finishing the test.
- continueResponses();
- yield promiseDownloadStopped(download);
-});
-
-/**
- * Tests that the temp download files are removed on exit and exiting private
- * mode after they have been launched.
- */
-add_task(function* test_launchWhenSucceeded_deleteTempFileOnExit() {
- let customLauncherPath = getTempFile("app-launcher").path;
- let autoDeleteTargetPathOne = getTempFile(TEST_TARGET_FILE_NAME).path;
- let autoDeleteTargetPathTwo = getTempFile(TEST_TARGET_FILE_NAME).path;
- let noAutoDeleteTargetPath = getTempFile(TEST_TARGET_FILE_NAME).path;
-
- let autoDeleteDownloadOne = yield Downloads.createDownload({
- source: { url: httpUrl("source.txt"), isPrivate: true },
- target: autoDeleteTargetPathOne,
- launchWhenSucceeded: true,
- launcherPath: customLauncherPath,
- });
- yield autoDeleteDownloadOne.start();
-
- Services.prefs.setBoolPref(kDeleteTempFileOnExit, true);
- let autoDeleteDownloadTwo = yield Downloads.createDownload({
- source: httpUrl("source.txt"),
- target: autoDeleteTargetPathTwo,
- launchWhenSucceeded: true,
- launcherPath: customLauncherPath,
- });
- yield autoDeleteDownloadTwo.start();
-
- Services.prefs.setBoolPref(kDeleteTempFileOnExit, false);
- let noAutoDeleteDownload = yield Downloads.createDownload({
- source: httpUrl("source.txt"),
- target: noAutoDeleteTargetPath,
- launchWhenSucceeded: true,
- launcherPath: customLauncherPath,
- });
- yield noAutoDeleteDownload.start();
-
- Services.prefs.clearUserPref(kDeleteTempFileOnExit);
-
- do_check_true(yield OS.File.exists(autoDeleteTargetPathOne));
- do_check_true(yield OS.File.exists(autoDeleteTargetPathTwo));
- do_check_true(yield OS.File.exists(noAutoDeleteTargetPath));
-
- // Simulate leaving private browsing mode
- Services.obs.notifyObservers(null, "last-pb-context-exited", null);
- do_check_false(yield OS.File.exists(autoDeleteTargetPathOne));
-
- // Simulate browser shutdown
- let expire = Cc["@mozilla.org/uriloader/external-helper-app-service;1"]
- .getService(Ci.nsIObserver);
- expire.observe(null, "profile-before-change", null);
- do_check_false(yield OS.File.exists(autoDeleteTargetPathTwo));
- do_check_true(yield OS.File.exists(noAutoDeleteTargetPath));
-});
diff --git a/toolkit/components/jsdownloads/test/unit/head.js b/toolkit/components/jsdownloads/test/unit/head.js
deleted file mode 100644
index f322244c4..000000000
--- a/toolkit/components/jsdownloads/test/unit/head.js
+++ /dev/null
@@ -1,843 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Provides infrastructure for automated download components tests.
- */
-
-"use strict";
-
-// Globals
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/Integration.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "DownloadPaths",
- "resource://gre/modules/DownloadPaths.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Downloads",
- "resource://gre/modules/Downloads.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "HttpServer",
- "resource://testing-common/httpd.js");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
- "resource://testing-common/PlacesTestUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
- "resource://gre/modules/PlacesUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "MockRegistrar",
- "resource://testing-common/MockRegistrar.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "gExternalHelperAppService",
- "@mozilla.org/uriloader/external-helper-app-service;1",
- Ci.nsIExternalHelperAppService);
-
-Integration.downloads.defineModuleGetter(this, "DownloadIntegration",
- "resource://gre/modules/DownloadIntegration.jsm");
-
-const ServerSocket = Components.Constructor(
- "@mozilla.org/network/server-socket;1",
- "nsIServerSocket",
- "init");
-const BinaryOutputStream = Components.Constructor(
- "@mozilla.org/binaryoutputstream;1",
- "nsIBinaryOutputStream",
- "setOutputStream")
-
-XPCOMUtils.defineLazyServiceGetter(this, "gMIMEService",
- "@mozilla.org/mime;1",
- "nsIMIMEService");
-
-const TEST_TARGET_FILE_NAME = "test-download.txt";
-const TEST_STORE_FILE_NAME = "test-downloads.json";
-
-const TEST_REFERRER_URL = "http://www.example.com/referrer.html";
-
-const TEST_DATA_SHORT = "This test string is downloaded.";
-// Generate using gzipCompressString in TelemetryController.jsm.
-const TEST_DATA_SHORT_GZIP_ENCODED_FIRST = [
- 31, 139, 8, 0, 0, 0, 0, 0, 0, 3, 11, 201, 200, 44, 86, 40, 73, 45, 46, 81, 40, 46, 41, 202, 204
-];
-const TEST_DATA_SHORT_GZIP_ENCODED_SECOND = [
- 75, 87, 0, 114, 83, 242, 203, 243, 114, 242, 19, 83, 82, 83, 244, 0, 151, 222, 109, 43, 31, 0, 0, 0
-];
-const TEST_DATA_SHORT_GZIP_ENCODED =
- TEST_DATA_SHORT_GZIP_ENCODED_FIRST.concat(TEST_DATA_SHORT_GZIP_ENCODED_SECOND);
-
-/**
- * All the tests are implemented with add_task, this starts them automatically.
- */
-function run_test()
-{
- do_get_profile();
- run_next_test();
-}
-
-// Support functions
-
-/**
- * HttpServer object initialized before tests start.
- */
-var gHttpServer;
-
-/**
- * Given a file name, returns a string containing an URI that points to the file
- * on the currently running instance of the test HTTP server.
- */
-function httpUrl(aFileName) {
- return "http://localhost:" + gHttpServer.identity.primaryPort + "/" +
- aFileName;
-}
-
-// While the previous test file should have deleted all the temporary files it
-// used, on Windows these might still be pending deletion on the physical file
-// system. Thus, start from a new base number every time, to make a collision
-// with a file that is still pending deletion highly unlikely.
-var gFileCounter = Math.floor(Math.random() * 1000000);
-
-/**
- * Returns a reference to a temporary file, that is guaranteed not to exist, and
- * to have never been created before.
- *
- * @param aLeafName
- * Suggested leaf name for the file to be created.
- *
- * @return nsIFile pointing to a non-existent file in a temporary directory.
- *
- * @note It is not enough to delete the file if it exists, or to delete the file
- * after calling nsIFile.createUnique, because on Windows the delete
- * operation in the file system may still be pending, preventing a new
- * file with the same name to be created.
- */
-function getTempFile(aLeafName)
-{
- // Prepend a serial number to the extension in the suggested leaf name.
- let [base, ext] = DownloadPaths.splitBaseNameAndExtension(aLeafName);
- let leafName = base + "-" + gFileCounter + ext;
- gFileCounter++;
-
- // Get a file reference under the temporary directory for this test file.
- let file = FileUtils.getFile("TmpD", [leafName]);
- do_check_false(file.exists());
-
- do_register_cleanup(function () {
- try {
- file.remove(false)
- } catch (e) {
- if (!(e instanceof Components.Exception &&
- (e.result == Cr.NS_ERROR_FILE_ACCESS_DENIED ||
- e.result == Cr.NS_ERROR_FILE_TARGET_DOES_NOT_EXIST ||
- e.result == Cr.NS_ERROR_FILE_NOT_FOUND))) {
- throw e;
- }
- // On Windows, we may get an access denied error if the file existed before,
- // and was recently deleted.
- // Don't bother checking file.exists() as that may also cause an access
- // denied error.
- }
- });
-
- return file;
-}
-
-/**
- * Waits for pending events to be processed.
- *
- * @return {Promise}
- * @resolves When pending events have been processed.
- * @rejects Never.
- */
-function promiseExecuteSoon()
-{
- let deferred = Promise.defer();
- do_execute_soon(deferred.resolve);
- return deferred.promise;
-}
-
-/**
- * Waits for a pending events to be processed after a timeout.
- *
- * @return {Promise}
- * @resolves When pending events have been processed.
- * @rejects Never.
- */
-function promiseTimeout(aTime)
-{
- let deferred = Promise.defer();
- do_timeout(aTime, deferred.resolve);
- return deferred.promise;
-}
-
-/**
- * Waits for a new history visit to be notified for the specified URI.
- *
- * @param aUrl
- * String containing the URI that will be visited.
- *
- * @return {Promise}
- * @resolves Array [aTime, aTransitionType] from nsINavHistoryObserver.onVisit.
- * @rejects Never.
- */
-function promiseWaitForVisit(aUrl)
-{
- let deferred = Promise.defer();
-
- let uri = NetUtil.newURI(aUrl);
-
- PlacesUtils.history.addObserver({
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver]),
- onBeginUpdateBatch: function () {},
- onEndUpdateBatch: function () {},
- onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID,
- aTransitionType, aGUID, aHidden) {
- if (aURI.equals(uri)) {
- PlacesUtils.history.removeObserver(this);
- deferred.resolve([aTime, aTransitionType]);
- }
- },
- onTitleChanged: function () {},
- onDeleteURI: function () {},
- onClearHistory: function () {},
- onPageChanged: function () {},
- onDeleteVisits: function () {},
- }, false);
-
- return deferred.promise;
-}
-
-/**
- * Check browsing history to see whether the given URI has been visited.
- *
- * @param aUrl
- * String containing the URI that will be visited.
- *
- * @return {Promise}
- * @resolves Boolean indicating whether the URI has been visited.
- * @rejects JavaScript exception.
- */
-function promiseIsURIVisited(aUrl) {
- let deferred = Promise.defer();
-
- PlacesUtils.asyncHistory.isURIVisited(NetUtil.newURI(aUrl),
- function (aURI, aIsVisited) {
- deferred.resolve(aIsVisited);
- });
-
- return deferred.promise;
-}
-
-/**
- * Creates a new Download object, setting a temporary file as the target.
- *
- * @param aSourceUrl
- * String containing the URI for the download source, or null to use
- * httpUrl("source.txt").
- *
- * @return {Promise}
- * @resolves The newly created Download object.
- * @rejects JavaScript exception.
- */
-function promiseNewDownload(aSourceUrl) {
- return Downloads.createDownload({
- source: aSourceUrl || httpUrl("source.txt"),
- target: getTempFile(TEST_TARGET_FILE_NAME),
- });
-}
-
-/**
- * Starts a new download using the nsIWebBrowserPersist interface, and controls
- * it using the legacy nsITransfer interface.
- *
- * @param aSourceUrl
- * String containing the URI for the download source, or null to use
- * httpUrl("source.txt").
- * @param aOptions
- * An optional object used to control the behavior of this function.
- * You may pass an object with a subset of the following fields:
- * {
- * isPrivate: Boolean indicating whether the download originated from a
- * private window.
- * targetFile: nsIFile for the target, or null to use a temporary file.
- * outPersist: Receives a reference to the created nsIWebBrowserPersist
- * instance.
- * launchWhenSucceeded: Boolean indicating whether the target should
- * be launched when it has completed successfully.
- * launcherPath: String containing the path of the custom executable to
- * use to launch the target of the download.
- * }
- *
- * @return {Promise}
- * @resolves The Download object created as a consequence of controlling the
- * download through the legacy nsITransfer interface.
- * @rejects Never. The current test fails in case of exceptions.
- */
-function promiseStartLegacyDownload(aSourceUrl, aOptions) {
- let sourceURI = NetUtil.newURI(aSourceUrl || httpUrl("source.txt"));
- let targetFile = (aOptions && aOptions.targetFile)
- || getTempFile(TEST_TARGET_FILE_NAME);
-
- let persist = Cc["@mozilla.org/embedding/browser/nsWebBrowserPersist;1"]
- .createInstance(Ci.nsIWebBrowserPersist);
- if (aOptions) {
- aOptions.outPersist = persist;
- }
-
- let fileExtension = null, mimeInfo = null;
- let match = sourceURI.path.match(/\.([^.\/]+)$/);
- if (match) {
- fileExtension = match[1];
- }
-
- if (fileExtension) {
- try {
- mimeInfo = gMIMEService.getFromTypeAndExtension(null, fileExtension);
- mimeInfo.preferredAction = Ci.nsIMIMEInfo.saveToDisk;
- } catch (ex) { }
- }
-
- if (aOptions && aOptions.launcherPath) {
- do_check_true(mimeInfo != null);
-
- let localHandlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"]
- .createInstance(Ci.nsILocalHandlerApp);
- localHandlerApp.executable = new FileUtils.File(aOptions.launcherPath);
-
- mimeInfo.preferredApplicationHandler = localHandlerApp;
- mimeInfo.preferredAction = Ci.nsIMIMEInfo.useHelperApp;
- }
-
- if (aOptions && aOptions.launchWhenSucceeded) {
- do_check_true(mimeInfo != null);
-
- mimeInfo.preferredAction = Ci.nsIMIMEInfo.useHelperApp;
- }
-
- // Apply decoding if required by the "Content-Encoding" header.
- persist.persistFlags &= ~Ci.nsIWebBrowserPersist.PERSIST_FLAGS_NO_CONVERSION;
- persist.persistFlags |=
- Ci.nsIWebBrowserPersist.PERSIST_FLAGS_AUTODETECT_APPLY_CONVERSION;
-
- let transfer = Cc["@mozilla.org/transfer;1"].createInstance(Ci.nsITransfer);
-
- let deferred = Promise.defer();
-
- Downloads.getList(Downloads.ALL).then(function (aList) {
- // Temporarily register a view that will get notified when the download we
- // are controlling becomes visible in the list of downloads.
- aList.addView({
- onDownloadAdded: function (aDownload) {
- aList.removeView(this).then(null, do_report_unexpected_exception);
-
- // Remove the download to keep the list empty for the next test. This
- // also allows the caller to register the "onchange" event directly.
- let promise = aList.remove(aDownload);
-
- // When the download object is ready, make it available to the caller.
- promise.then(() => deferred.resolve(aDownload),
- do_report_unexpected_exception);
- },
- }).then(null, do_report_unexpected_exception);
-
- let isPrivate = aOptions && aOptions.isPrivate;
-
- // Initialize the components so they reference each other. This will cause
- // the Download object to be created and added to the public downloads.
- transfer.init(sourceURI, NetUtil.newURI(targetFile), null, mimeInfo, null,
- null, persist, isPrivate);
- persist.progressListener = transfer;
-
- // Start the actual download process.
- persist.savePrivacyAwareURI(sourceURI, null, null, 0, null, null, targetFile,
- isPrivate);
- }.bind(this)).then(null, do_report_unexpected_exception);
-
- return deferred.promise;
-}
-
-/**
- * Starts a new download using the nsIHelperAppService interface, and controls
- * it using the legacy nsITransfer interface. The source of the download will
- * be "interruptible_resumable.txt" and partially downloaded data will be kept.
- *
- * @param aSourceUrl
- * String containing the URI for the download source, or null to use
- * httpUrl("interruptible_resumable.txt").
- *
- * @return {Promise}
- * @resolves The Download object created as a consequence of controlling the
- * download through the legacy nsITransfer interface.
- * @rejects Never. The current test fails in case of exceptions.
- */
-function promiseStartExternalHelperAppServiceDownload(aSourceUrl) {
- let sourceURI = NetUtil.newURI(aSourceUrl ||
- httpUrl("interruptible_resumable.txt"));
-
- let deferred = Promise.defer();
-
- Downloads.getList(Downloads.PUBLIC).then(function (aList) {
- // Temporarily register a view that will get notified when the download we
- // are controlling becomes visible in the list of downloads.
- aList.addView({
- onDownloadAdded: function (aDownload) {
- aList.removeView(this).then(null, do_report_unexpected_exception);
-
- // Remove the download to keep the list empty for the next test. This
- // also allows the caller to register the "onchange" event directly.
- let promise = aList.remove(aDownload);
-
- // When the download object is ready, make it available to the caller.
- promise.then(() => deferred.resolve(aDownload),
- do_report_unexpected_exception);
- },
- }).then(null, do_report_unexpected_exception);
-
- let channel = NetUtil.newChannel({
- uri: sourceURI,
- loadUsingSystemPrincipal: true
- });
-
- // Start the actual download process.
- channel.asyncOpen2({
- contentListener: null,
-
- onStartRequest: function (aRequest, aContext)
- {
- let requestChannel = aRequest.QueryInterface(Ci.nsIChannel);
- this.contentListener = gExternalHelperAppService.doContent(
- requestChannel.contentType, aRequest, null, true);
- this.contentListener.onStartRequest(aRequest, aContext);
- },
-
- onStopRequest: function (aRequest, aContext, aStatusCode)
- {
- this.contentListener.onStopRequest(aRequest, aContext, aStatusCode);
- },
-
- onDataAvailable: function (aRequest, aContext, aInputStream, aOffset,
- aCount)
- {
- this.contentListener.onDataAvailable(aRequest, aContext, aInputStream,
- aOffset, aCount);
- },
- });
- }.bind(this)).then(null, do_report_unexpected_exception);
-
- return deferred.promise;
-}
-
-/**
- * Waits for a download to reach half of its progress, in case it has not
- * reached the expected progress already.
- *
- * @param aDownload
- * The Download object to wait upon.
- *
- * @return {Promise}
- * @resolves When the download has reached half of its progress.
- * @rejects Never.
- */
-function promiseDownloadMidway(aDownload) {
- let deferred = Promise.defer();
-
- // Wait for the download to reach half of its progress.
- let onchange = function () {
- if (!aDownload.stopped && !aDownload.canceled && aDownload.progress == 50) {
- aDownload.onchange = null;
- deferred.resolve();
- }
- };
-
- // Register for the notification, but also call the function directly in
- // case the download already reached the expected progress.
- aDownload.onchange = onchange;
- onchange();
-
- return deferred.promise;
-}
-
-/**
- * Waits for a download to finish, in case it has not finished already.
- *
- * @param aDownload
- * The Download object to wait upon.
- *
- * @return {Promise}
- * @resolves When the download has finished successfully.
- * @rejects JavaScript exception if the download failed.
- */
-function promiseDownloadStopped(aDownload) {
- if (!aDownload.stopped) {
- // The download is in progress, wait for the current attempt to finish and
- // report any errors that may occur.
- return aDownload.start();
- }
-
- if (aDownload.succeeded) {
- return Promise.resolve();
- }
-
- // The download failed or was canceled.
- return Promise.reject(aDownload.error || new Error("Download canceled."));
-}
-
-/**
- * Returns a new public or private DownloadList object.
- *
- * @param aIsPrivate
- * True for the private list, false or undefined for the public list.
- *
- * @return {Promise}
- * @resolves The newly created DownloadList object.
- * @rejects JavaScript exception.
- */
-function promiseNewList(aIsPrivate)
-{
- // We need to clear all the internal state for the list and summary objects,
- // since all the objects are interdependent internally.
- Downloads._promiseListsInitialized = null;
- Downloads._lists = {};
- Downloads._summaries = {};
-
- return Downloads.getList(aIsPrivate ? Downloads.PRIVATE : Downloads.PUBLIC);
-}
-
-/**
- * Ensures that the given file contents are equal to the given string.
- *
- * @param aPath
- * String containing the path of the file whose contents should be
- * verified.
- * @param aExpectedContents
- * String containing the octets that are expected in the file.
- *
- * @return {Promise}
- * @resolves When the operation completes.
- * @rejects Never.
- */
-function promiseVerifyContents(aPath, aExpectedContents)
-{
- return Task.spawn(function* () {
- let file = new FileUtils.File(aPath);
-
- if (!(yield OS.File.exists(aPath))) {
- do_throw("File does not exist: " + aPath);
- }
-
- if ((yield OS.File.stat(aPath)).size == 0) {
- do_throw("File is empty: " + aPath);
- }
-
- let deferred = Promise.defer();
- NetUtil.asyncFetch(
- { uri: NetUtil.newURI(file), loadUsingSystemPrincipal: true },
- function(aInputStream, aStatus) {
- do_check_true(Components.isSuccessCode(aStatus));
- let contents = NetUtil.readInputStreamToString(aInputStream,
- aInputStream.available());
- if (contents.length > TEST_DATA_SHORT.length * 2 ||
- /[^\x20-\x7E]/.test(contents)) {
- // Do not print the entire content string to the test log.
- do_check_eq(contents.length, aExpectedContents.length);
- do_check_true(contents == aExpectedContents);
- } else {
- // Print the string if it is short and made of printable characters.
- do_check_eq(contents, aExpectedContents);
- }
- deferred.resolve();
- });
-
- yield deferred.promise;
- });
-}
-
-/**
- * Starts a socket listener that closes each incoming connection.
- *
- * @returns nsIServerSocket that listens for connections. Call its "close"
- * method to stop listening and free the server port.
- */
-function startFakeServer()
-{
- let serverSocket = new ServerSocket(-1, true, -1);
- serverSocket.asyncListen({
- onSocketAccepted: function (aServ, aTransport) {
- aTransport.close(Cr.NS_BINDING_ABORTED);
- },
- onStopListening: function () { },
- });
- return serverSocket;
-}
-
-/**
- * This is an internal reference that should not be used directly by tests.
- */
-var _gDeferResponses = Promise.defer();
-
-/**
- * Ensures that all the interruptible requests started after this function is
- * called won't complete until the continueResponses function is called.
- *
- * Normally, the internal HTTP server returns all the available data as soon as
- * a request is received. In order for some requests to be served one part at a
- * time, special interruptible handlers are registered on the HTTP server. This
- * allows testing events or actions that need to happen in the middle of a
- * download.
- *
- * For example, the handler accessible at the httpUri("interruptible.txt")
- * address returns the TEST_DATA_SHORT text, then it may block until the
- * continueResponses method is called. At this point, the handler sends the
- * TEST_DATA_SHORT text again to complete the response.
- *
- * If an interruptible request is started before the function is called, it may
- * or may not be blocked depending on the actual sequence of events.
- */
-function mustInterruptResponses()
-{
- // If there are pending blocked requests, allow them to complete. This is
- // done to prevent requests from being blocked forever, but should not affect
- // the test logic, since previously started requests should not be monitored
- // on the client side anymore.
- _gDeferResponses.resolve();
-
- do_print("Interruptible responses will be blocked midway.");
- _gDeferResponses = Promise.defer();
-}
-
-/**
- * Allows all the current and future interruptible requests to complete.
- */
-function continueResponses()
-{
- do_print("Interruptible responses are now allowed to continue.");
- _gDeferResponses.resolve();
-}
-
-/**
- * Registers an interruptible response handler.
- *
- * @param aPath
- * Path passed to nsIHttpServer.registerPathHandler.
- * @param aFirstPartFn
- * This function is called when the response is received, with the
- * aRequest and aResponse arguments of the server.
- * @param aSecondPartFn
- * This function is called with the aRequest and aResponse arguments of
- * the server, when the continueResponses function is called.
- */
-function registerInterruptibleHandler(aPath, aFirstPartFn, aSecondPartFn)
-{
- gHttpServer.registerPathHandler(aPath, function (aRequest, aResponse) {
- do_print("Interruptible request started.");
-
- // Process the first part of the response.
- aResponse.processAsync();
- aFirstPartFn(aRequest, aResponse);
-
- // Wait on the current deferred object, then finish the request.
- _gDeferResponses.promise.then(function RIH_onSuccess() {
- aSecondPartFn(aRequest, aResponse);
- aResponse.finish();
- do_print("Interruptible request finished.");
- }).then(null, Cu.reportError);
- });
-}
-
-/**
- * Ensure the given date object is valid.
- *
- * @param aDate
- * The date object to be checked. This value can be null.
- */
-function isValidDate(aDate) {
- return aDate && aDate.getTime && !isNaN(aDate.getTime());
-}
-
-/**
- * Position of the first byte served by the "interruptible_resumable.txt"
- * handler during the most recent response.
- */
-var gMostRecentFirstBytePos;
-
-// Initialization functions common to all tests
-
-add_task(function test_common_initialize()
-{
- // Start the HTTP server.
- gHttpServer = new HttpServer();
- gHttpServer.registerDirectory("/", do_get_file("../data"));
- gHttpServer.start(-1);
- do_register_cleanup(() => {
- return new Promise(resolve => {
- // Ensure all the pending HTTP requests have a chance to finish.
- continueResponses();
- // Stop the HTTP server, calling resolve when it's done.
- gHttpServer.stop(resolve);
- });
- });
-
- // Cache locks might prevent concurrent requests to the same resource, and
- // this may block tests that use the interruptible handlers.
- Services.prefs.setBoolPref("browser.cache.disk.enable", false);
- Services.prefs.setBoolPref("browser.cache.memory.enable", false);
- do_register_cleanup(function () {
- Services.prefs.clearUserPref("browser.cache.disk.enable");
- Services.prefs.clearUserPref("browser.cache.memory.enable");
- });
-
- registerInterruptibleHandler("/interruptible.txt",
- function firstPart(aRequest, aResponse) {
- aResponse.setHeader("Content-Type", "text/plain", false);
- aResponse.setHeader("Content-Length", "" + (TEST_DATA_SHORT.length * 2),
- false);
- aResponse.write(TEST_DATA_SHORT);
- }, function secondPart(aRequest, aResponse) {
- aResponse.write(TEST_DATA_SHORT);
- });
-
- registerInterruptibleHandler("/interruptible_resumable.txt",
- function firstPart(aRequest, aResponse) {
- aResponse.setHeader("Content-Type", "text/plain", false);
-
- // Determine if only part of the data should be sent.
- let data = TEST_DATA_SHORT + TEST_DATA_SHORT;
- if (aRequest.hasHeader("Range")) {
- var matches = aRequest.getHeader("Range")
- .match(/^\s*bytes=(\d+)?-(\d+)?\s*$/);
- var firstBytePos = (matches[1] === undefined) ? 0 : matches[1];
- var lastBytePos = (matches[2] === undefined) ? data.length - 1
- : matches[2];
- if (firstBytePos >= data.length) {
- aResponse.setStatusLine(aRequest.httpVersion, 416,
- "Requested Range Not Satisfiable");
- aResponse.setHeader("Content-Range", "*/" + data.length, false);
- aResponse.finish();
- return;
- }
-
- aResponse.setStatusLine(aRequest.httpVersion, 206, "Partial Content");
- aResponse.setHeader("Content-Range", firstBytePos + "-" +
- lastBytePos + "/" +
- data.length, false);
-
- data = data.substring(firstBytePos, lastBytePos + 1);
-
- gMostRecentFirstBytePos = firstBytePos;
- } else {
- gMostRecentFirstBytePos = 0;
- }
-
- aResponse.setHeader("Content-Length", "" + data.length, false);
-
- aResponse.write(data.substring(0, data.length / 2));
-
- // Store the second part of the data on the response object, so that it
- // can be used by the secondPart function.
- aResponse.secondPartData = data.substring(data.length / 2);
- }, function secondPart(aRequest, aResponse) {
- aResponse.write(aResponse.secondPartData);
- });
-
- registerInterruptibleHandler("/interruptible_gzip.txt",
- function firstPart(aRequest, aResponse) {
- aResponse.setHeader("Content-Type", "text/plain", false);
- aResponse.setHeader("Content-Encoding", "gzip", false);
- aResponse.setHeader("Content-Length", "" + TEST_DATA_SHORT_GZIP_ENCODED.length);
-
- let bos = new BinaryOutputStream(aResponse.bodyOutputStream);
- bos.writeByteArray(TEST_DATA_SHORT_GZIP_ENCODED_FIRST,
- TEST_DATA_SHORT_GZIP_ENCODED_FIRST.length);
- }, function secondPart(aRequest, aResponse) {
- let bos = new BinaryOutputStream(aResponse.bodyOutputStream);
- bos.writeByteArray(TEST_DATA_SHORT_GZIP_ENCODED_SECOND,
- TEST_DATA_SHORT_GZIP_ENCODED_SECOND.length);
- });
-
- gHttpServer.registerPathHandler("/shorter-than-content-length-http-1-1.txt",
- function (aRequest, aResponse) {
- aResponse.processAsync();
- aResponse.setStatusLine("1.1", 200, "OK");
- aResponse.setHeader("Content-Type", "text/plain", false);
- aResponse.setHeader("Content-Length", "" + (TEST_DATA_SHORT.length * 2),
- false);
- aResponse.write(TEST_DATA_SHORT);
- aResponse.finish();
- });
-
- // This URL will emulate being blocked by Windows Parental controls
- gHttpServer.registerPathHandler("/parentalblocked.zip",
- function (aRequest, aResponse) {
- aResponse.setStatusLine(aRequest.httpVersion, 450,
- "Blocked by Windows Parental Controls");
- });
-
- // During unit tests, most of the functions that require profile access or
- // operating system features will be disabled. Individual tests may override
- // them again to check for specific behaviors.
- Integration.downloads.register(base => ({
- __proto__: base,
- loadPublicDownloadListFromStore: () => Promise.resolve(),
- shouldKeepBlockedData: () => Promise.resolve(false),
- shouldBlockForParentalControls: () => Promise.resolve(false),
- shouldBlockForRuntimePermissions: () => Promise.resolve(false),
- shouldBlockForReputationCheck: () => Promise.resolve({
- shouldBlock: false,
- verdict: "",
- }),
- confirmLaunchExecutable: () => Promise.resolve(),
- launchFile: () => Promise.resolve(),
- showContainingDirectory: () => Promise.resolve(),
- // This flag allows re-enabling the default observers during their tests.
- allowObservers: false,
- addListObservers() {
- return this.allowObservers ? super.addListObservers(...arguments)
- : Promise.resolve();
- },
- // This flag allows re-enabling the download directory logic for its tests.
- _allowDirectories: false,
- set allowDirectories(value) {
- this._allowDirectories = value;
- // We have to invalidate the previously computed directory path.
- this._downloadsDirectory = null;
- },
- _getDirectory(name) {
- return super._getDirectory(this._allowDirectories ? name : "TmpD");
- },
- }));
-
- // Make sure that downloads started using nsIExternalHelperAppService are
- // saved to disk without asking for a destination interactively.
- let mock = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIHelperAppLauncherDialog]),
- promptForSaveToFileAsync(aLauncher,
- aWindowContext,
- aDefaultFileName,
- aSuggestedFileExtension,
- aForcePrompt) {
- // The dialog should create the empty placeholder file.
- let file = getTempFile(TEST_TARGET_FILE_NAME);
- file.create(Ci.nsIFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE);
- aLauncher.saveDestinationAvailable(file);
- },
- };
-
- let cid = MockRegistrar.register("@mozilla.org/helperapplauncherdialog;1", mock);
- do_register_cleanup(() => {
- MockRegistrar.unregister(cid);
- });
-});
diff --git a/toolkit/components/jsdownloads/test/unit/test_DownloadCore.js b/toolkit/components/jsdownloads/test/unit/test_DownloadCore.js
deleted file mode 100644
index 6e32c63d3..000000000
--- a/toolkit/components/jsdownloads/test/unit/test_DownloadCore.js
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the main download interfaces using DownloadCopySaver.
- */
-
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "DownloadError",
- "resource://gre/modules/DownloadCore.jsm");
-
-// Execution of common tests
-
-var gUseLegacySaver = false;
-
-var scriptFile = do_get_file("common_test_Download.js");
-Services.scriptloader.loadSubScript(NetUtil.newURI(scriptFile).spec);
-
-// Tests
-
-/**
- * Tests the DownloadError object.
- */
-add_task(function test_DownloadError()
-{
- let error = new DownloadError({ result: Cr.NS_ERROR_NOT_RESUMABLE,
- message: "Not resumable."});
- do_check_eq(error.result, Cr.NS_ERROR_NOT_RESUMABLE);
- do_check_eq(error.message, "Not resumable.");
- do_check_false(error.becauseSourceFailed);
- do_check_false(error.becauseTargetFailed);
- do_check_false(error.becauseBlocked);
- do_check_false(error.becauseBlockedByParentalControls);
-
- error = new DownloadError({ message: "Unknown error."});
- do_check_eq(error.result, Cr.NS_ERROR_FAILURE);
- do_check_eq(error.message, "Unknown error.");
-
- error = new DownloadError({ result: Cr.NS_ERROR_NOT_RESUMABLE });
- do_check_eq(error.result, Cr.NS_ERROR_NOT_RESUMABLE);
- do_check_true(error.message.indexOf("Exception") > 0);
-
- // becauseSourceFailed will be set, but not the unknown property.
- error = new DownloadError({ message: "Unknown error.",
- becauseSourceFailed: true,
- becauseUnknown: true });
- do_check_true(error.becauseSourceFailed);
- do_check_false("becauseUnknown" in error);
-
- error = new DownloadError({ result: Cr.NS_ERROR_MALFORMED_URI,
- inferCause: true });
- do_check_eq(error.result, Cr.NS_ERROR_MALFORMED_URI);
- do_check_true(error.becauseSourceFailed);
- do_check_false(error.becauseTargetFailed);
- do_check_false(error.becauseBlocked);
- do_check_false(error.becauseBlockedByParentalControls);
-
- // This test does not set inferCause, so becauseSourceFailed will not be set.
- error = new DownloadError({ result: Cr.NS_ERROR_MALFORMED_URI });
- do_check_eq(error.result, Cr.NS_ERROR_MALFORMED_URI);
- do_check_false(error.becauseSourceFailed);
-
- error = new DownloadError({ result: Cr.NS_ERROR_FILE_INVALID_PATH,
- inferCause: true });
- do_check_eq(error.result, Cr.NS_ERROR_FILE_INVALID_PATH);
- do_check_false(error.becauseSourceFailed);
- do_check_true(error.becauseTargetFailed);
- do_check_false(error.becauseBlocked);
- do_check_false(error.becauseBlockedByParentalControls);
-
- error = new DownloadError({ becauseBlocked: true });
- do_check_eq(error.message, "Download blocked.");
- do_check_false(error.becauseSourceFailed);
- do_check_false(error.becauseTargetFailed);
- do_check_true(error.becauseBlocked);
- do_check_false(error.becauseBlockedByParentalControls);
-
- error = new DownloadError({ becauseBlockedByParentalControls: true });
- do_check_eq(error.message, "Download blocked.");
- do_check_false(error.becauseSourceFailed);
- do_check_false(error.becauseTargetFailed);
- do_check_true(error.becauseBlocked);
- do_check_true(error.becauseBlockedByParentalControls);
-});
diff --git a/toolkit/components/jsdownloads/test/unit/test_DownloadImport.js b/toolkit/components/jsdownloads/test/unit/test_DownloadImport.js
deleted file mode 100644
index 388870f00..000000000
--- a/toolkit/components/jsdownloads/test/unit/test_DownloadImport.js
+++ /dev/null
@@ -1,701 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the DownloadImport object.
- */
-
-"use strict";
-
-// Globals
-
-XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
- "resource://gre/modules/Sqlite.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "DownloadImport",
- "resource://gre/modules/DownloadImport.jsm");
-
-// Importable states
-const DOWNLOAD_NOTSTARTED = -1;
-const DOWNLOAD_DOWNLOADING = 0;
-const DOWNLOAD_PAUSED = 4;
-const DOWNLOAD_QUEUED = 5;
-
-// Non importable states
-const DOWNLOAD_FAILED = 2;
-const DOWNLOAD_CANCELED = 3;
-const DOWNLOAD_BLOCKED_PARENTAL = 6;
-const DOWNLOAD_SCANNING = 7;
-const DOWNLOAD_DIRTY = 8;
-const DOWNLOAD_BLOCKED_POLICY = 9;
-
-// The TEST_DATA_TAINTED const is a version of TEST_DATA_SHORT in which the
-// beginning of the data was changed (with the TEST_DATA_REPLACEMENT value).
-// We use this to test that the entityID is properly imported and the download
-// can be resumed from where it was paused.
-// For simplification purposes, the test requires that TEST_DATA_SHORT and
-// TEST_DATA_TAINTED have the same length.
-const TEST_DATA_REPLACEMENT = "-changed- ";
-const TEST_DATA_TAINTED = TEST_DATA_REPLACEMENT +
- TEST_DATA_SHORT.substr(TEST_DATA_REPLACEMENT.length);
-const TEST_DATA_LENGTH = TEST_DATA_SHORT.length;
-
-// The length of the partial file that we'll write to disk as an existing
-// ongoing download.
-const TEST_DATA_PARTIAL_LENGTH = TEST_DATA_REPLACEMENT.length;
-
-// The value of the "maxBytes" column stored in the DB about the downloads.
-// It's intentionally different than TEST_DATA_LENGTH to test that each value
-// is seen when expected.
-const MAXBYTES_IN_DB = TEST_DATA_LENGTH - 10;
-
-var gDownloadsRowToImport;
-var gDownloadsRowNonImportable;
-
-/**
- * Creates a database with an empty moz_downloads table and leaves an
- * open connection to it.
- *
- * @param aPath
- * String containing the path of the database file to be created.
- * @param aSchemaVersion
- * Number with the version of the database schema to set.
- *
- * @return {Promise}
- * @resolves The open connection to the database.
- * @rejects If an error occurred during the database creation.
- */
-function promiseEmptyDatabaseConnection({aPath, aSchemaVersion}) {
- return Task.spawn(function* () {
- let connection = yield Sqlite.openConnection({ path: aPath });
-
- yield connection.execute("CREATE TABLE moz_downloads ("
- + "id INTEGER PRIMARY KEY,"
- + "name TEXT,"
- + "source TEXT,"
- + "target TEXT,"
- + "tempPath TEXT,"
- + "startTime INTEGER,"
- + "endTime INTEGER,"
- + "state INTEGER,"
- + "referrer TEXT,"
- + "entityID TEXT,"
- + "currBytes INTEGER NOT NULL DEFAULT 0,"
- + "maxBytes INTEGER NOT NULL DEFAULT -1,"
- + "mimeType TEXT,"
- + "preferredApplication TEXT,"
- + "preferredAction INTEGER NOT NULL DEFAULT 0,"
- + "autoResume INTEGER NOT NULL DEFAULT 0,"
- + "guid TEXT)");
-
- yield connection.setSchemaVersion(aSchemaVersion);
-
- return connection;
- });
-}
-
-/**
- * Inserts a new entry in the database with the given columns' values.
- *
- * @param aConnection
- * The database connection.
- * @param aDownloadRow
- * An object representing the values for each column of the row
- * being inserted.
- *
- * @return {Promise}
- * @resolves When the operation completes.
- * @rejects If there's an error inserting the row.
- */
-function promiseInsertRow(aConnection, aDownloadRow) {
- // We can't use the aDownloadRow obj directly in the execute statement
- // because the obj bind code in Sqlite.jsm doesn't allow objects
- // with extra properties beyond those being binded. So we might as well
- // use an array as it is simpler.
- let values = [
- aDownloadRow.source, aDownloadRow.target, aDownloadRow.tempPath,
- aDownloadRow.startTime.getTime() * 1000, aDownloadRow.state,
- aDownloadRow.referrer, aDownloadRow.entityID, aDownloadRow.maxBytes,
- aDownloadRow.mimeType, aDownloadRow.preferredApplication,
- aDownloadRow.preferredAction, aDownloadRow.autoResume
- ];
-
- return aConnection.execute("INSERT INTO moz_downloads ("
- + "name, source, target, tempPath, startTime,"
- + "endTime, state, referrer, entityID, currBytes,"
- + "maxBytes, mimeType, preferredApplication,"
- + "preferredAction, autoResume, guid)"
- + "VALUES ("
- + "'', ?, ?, ?, ?, " // name,
- + "0, ?, ?, ?, 0, " // endTime, currBytes
- + " ?, ?, ?, " //
- + " ?, ?, '')", // and guid are not imported
- values);
-}
-
-/**
- * Retrieves the number of rows in the moz_downloads table of the
- * database.
- *
- * @param aConnection
- * The database connection.
- *
- * @return {Promise}
- * @resolves With the number of rows.
- * @rejects Never.
- */
-function promiseTableCount(aConnection) {
- return aConnection.execute("SELECT COUNT(*) FROM moz_downloads")
- .then(res => res[0].getResultByName("COUNT(*)"))
- .then(null, Cu.reportError);
-}
-
-/**
- * Briefly opens a network channel to a given URL to retrieve
- * the entityID of this url, as generated by the network code.
- *
- * @param aUrl
- * The URL to retrieve the entityID.
- *
- * @return {Promise}
- * @resolves The EntityID of the given URL.
- * @rejects When there's a problem accessing the URL.
- */
-function promiseEntityID(aUrl) {
- let deferred = Promise.defer();
- let entityID = "";
- let channel = NetUtil.newChannel({
- uri: NetUtil.newURI(aUrl),
- loadUsingSystemPrincipal: true
- });
-
- channel.asyncOpen2({
- onStartRequest: function (aRequest) {
- if (aRequest instanceof Ci.nsIResumableChannel) {
- entityID = aRequest.entityID;
- }
- aRequest.cancel(Cr.NS_BINDING_ABORTED);
- },
-
- onStopRequest: function (aRequest, aContext, aStatusCode) {
- if (aStatusCode == Cr.NS_BINDING_ABORTED) {
- deferred.resolve(entityID);
- } else {
- deferred.reject("Unexpected status code received");
- }
- },
-
- onDataAvailable: function () {}
- });
-
- return deferred.promise;
-}
-
-/**
- * Gets a file path to a temporary writeable download target, in the
- * correct format as expected to be stored in the downloads database,
- * which is file:///absolute/path/to/file
- *
- * @param aLeafName
- * A hint leaf name for the file.
- *
- * @return String The path to the download target.
- */
-function getDownloadTarget(aLeafName) {
- return NetUtil.newURI(getTempFile(aLeafName)).spec;
-}
-
-/**
- * Generates a temporary partial file to use as an in-progress
- * download. The file is written to disk with a part of the total expected
- * download content pre-written.
- *
- * @param aLeafName
- * A hint leaf name for the file.
- * @param aTainted
- * A boolean value. When true, the partial content of the file
- * will be different from the expected content of the original source
- * file. See the declaration of TEST_DATA_TAINTED for more information.
- *
- * @return {Promise}
- * @resolves When the operation completes, and returns a string with the path
- * to the generated file.
- * @rejects If there's an error writing the file.
- */
-function getPartialFile(aLeafName, aTainted = false) {
- let tempDownload = getTempFile(aLeafName);
- let partialContent = aTainted
- ? TEST_DATA_TAINTED.substr(0, TEST_DATA_PARTIAL_LENGTH)
- : TEST_DATA_SHORT.substr(0, TEST_DATA_PARTIAL_LENGTH);
-
- return OS.File.writeAtomic(tempDownload.path, partialContent,
- { tmpPath: tempDownload.path + ".tmp",
- flush: true })
- .then(() => tempDownload.path);
-}
-
-/**
- * Generates a Date object to be used as the startTime for the download rows
- * in the DB. A date that is obviously different from the current time is
- * generated to make sure this stored data and a `new Date()` can't collide.
- *
- * @param aOffset
- * A offset from the base generated date is used to differentiate each
- * row in the database.
- *
- * @return A Date object.
- */
-function getStartTime(aOffset) {
- return new Date(1000000 + (aOffset * 10000));
-}
-
-/**
- * Performs various checks on an imported Download object to make sure
- * all properties are properly set as expected from the import procedure.
- *
- * @param aDownload
- * The Download object to be checked.
- * @param aDownloadRow
- * An object that represents a row from the original database table,
- * with extra properties describing expected values that are not
- * explictly part of the database.
- *
- * @return {Promise}
- * @resolves When the operation completes
- * @rejects Never
- */
-function checkDownload(aDownload, aDownloadRow) {
- return Task.spawn(function*() {
- do_check_eq(aDownload.source.url, aDownloadRow.source);
- do_check_eq(aDownload.source.referrer, aDownloadRow.referrer);
-
- do_check_eq(aDownload.target.path,
- NetUtil.newURI(aDownloadRow.target)
- .QueryInterface(Ci.nsIFileURL).file.path);
-
- do_check_eq(aDownload.target.partFilePath, aDownloadRow.tempPath);
-
- if (aDownloadRow.expectedResume) {
- do_check_true(!aDownload.stopped || aDownload.succeeded);
- yield promiseDownloadStopped(aDownload);
-
- do_check_true(aDownload.succeeded);
- do_check_eq(aDownload.progress, 100);
- // If the download has resumed, a new startTime will be set.
- // By calling toJSON we're also testing that startTime is a Date object.
- do_check_neq(aDownload.startTime.toJSON(),
- aDownloadRow.startTime.toJSON());
- } else {
- do_check_false(aDownload.succeeded);
- do_check_eq(aDownload.startTime.toJSON(),
- aDownloadRow.startTime.toJSON());
- }
-
- do_check_eq(aDownload.stopped, true);
-
- let serializedSaver = aDownload.saver.toSerializable();
- if (typeof(serializedSaver) == "object") {
- do_check_eq(serializedSaver.type, "copy");
- } else {
- do_check_eq(serializedSaver, "copy");
- }
-
- if (aDownloadRow.entityID) {
- do_check_eq(aDownload.saver.entityID, aDownloadRow.entityID);
- }
-
- do_check_eq(aDownload.currentBytes, aDownloadRow.expectedCurrentBytes);
- do_check_eq(aDownload.totalBytes, aDownloadRow.expectedTotalBytes);
-
- if (aDownloadRow.expectedContent) {
- let fileToCheck = aDownloadRow.expectedResume
- ? aDownload.target.path
- : aDownload.target.partFilePath;
- yield promiseVerifyContents(fileToCheck, aDownloadRow.expectedContent);
- }
-
- do_check_eq(aDownload.contentType, aDownloadRow.expectedContentType);
- do_check_eq(aDownload.launcherPath, aDownloadRow.preferredApplication);
-
- do_check_eq(aDownload.launchWhenSucceeded,
- aDownloadRow.preferredAction != Ci.nsIMIMEInfo.saveToDisk);
- });
-}
-
-// Preparation tasks
-
-/**
- * Prepares the list of downloads to be added to the database that should
- * be imported by the import procedure.
- */
-add_task(function* prepareDownloadsToImport() {
-
- let sourceUrl = httpUrl("source.txt");
- let sourceEntityId = yield promiseEntityID(sourceUrl);
-
- gDownloadsRowToImport = [
- // Paused download with autoResume and a partial file. By
- // setting the correct entityID the download can resume from
- // where it stopped, and to test that this works properly we
- // intentionally set different data in the beginning of the
- // partial file to make sure it was not replaced.
- {
- source: sourceUrl,
- target: getDownloadTarget("inprogress1.txt"),
- tempPath: yield getPartialFile("inprogress1.txt.part", true),
- startTime: getStartTime(1),
- state: DOWNLOAD_PAUSED,
- referrer: httpUrl("referrer1"),
- entityID: sourceEntityId,
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "mimeType1",
- preferredAction: Ci.nsIMIMEInfo.saveToDisk,
- preferredApplication: "prerredApplication1",
- autoResume: 1,
-
- // Even though the information stored in the DB said
- // maxBytes was MAXBYTES_IN_DB, the download turned out to be
- // a different length. Here we make sure the totalBytes property
- // was correctly set with the actual value. The same consideration
- // applies to the contentType.
- expectedCurrentBytes: TEST_DATA_LENGTH,
- expectedTotalBytes: TEST_DATA_LENGTH,
- expectedResume: true,
- expectedContentType: "text/plain",
- expectedContent: TEST_DATA_TAINTED,
- },
-
- // Paused download with autoResume and a partial file,
- // but missing entityID. This means that the download will
- // start from beginning, and the entire original content of the
- // source file should replace the different data that was stored
- // in the partial file.
- {
- source: sourceUrl,
- target: getDownloadTarget("inprogress2.txt"),
- tempPath: yield getPartialFile("inprogress2.txt.part", true),
- startTime: getStartTime(2),
- state: DOWNLOAD_PAUSED,
- referrer: httpUrl("referrer2"),
- entityID: "",
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "mimeType2",
- preferredAction: Ci.nsIMIMEInfo.saveToDisk,
- preferredApplication: "prerredApplication2",
- autoResume: 1,
-
- expectedCurrentBytes: TEST_DATA_LENGTH,
- expectedTotalBytes: TEST_DATA_LENGTH,
- expectedResume: true,
- expectedContentType: "text/plain",
- expectedContent: TEST_DATA_SHORT
- },
-
- // Paused download with no autoResume and a partial file.
- {
- source: sourceUrl,
- target: getDownloadTarget("inprogress3.txt"),
- tempPath: yield getPartialFile("inprogress3.txt.part"),
- startTime: getStartTime(3),
- state: DOWNLOAD_PAUSED,
- referrer: httpUrl("referrer3"),
- entityID: "",
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "mimeType3",
- preferredAction: Ci.nsIMIMEInfo.saveToDisk,
- preferredApplication: "prerredApplication3",
- autoResume: 0,
-
- // Since this download has not been resumed, the actual data
- // about its total size and content type is not known.
- // Therefore, we're going by the information imported from the DB.
- expectedCurrentBytes: TEST_DATA_PARTIAL_LENGTH,
- expectedTotalBytes: MAXBYTES_IN_DB,
- expectedResume: false,
- expectedContentType: "mimeType3",
- expectedContent: TEST_DATA_SHORT.substr(0, TEST_DATA_PARTIAL_LENGTH),
- },
-
- // Paused download with autoResume and no partial file.
- {
- source: sourceUrl,
- target: getDownloadTarget("inprogress4.txt"),
- tempPath: "",
- startTime: getStartTime(4),
- state: DOWNLOAD_PAUSED,
- referrer: httpUrl("referrer4"),
- entityID: "",
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "text/plain",
- preferredAction: Ci.nsIMIMEInfo.useHelperApp,
- preferredApplication: "prerredApplication4",
- autoResume: 1,
-
- expectedCurrentBytes: TEST_DATA_LENGTH,
- expectedTotalBytes: TEST_DATA_LENGTH,
- expectedResume: true,
- expectedContentType: "text/plain",
- expectedContent: TEST_DATA_SHORT
- },
-
- // Paused download with no autoResume and no partial file.
- {
- source: sourceUrl,
- target: getDownloadTarget("inprogress5.txt"),
- tempPath: "",
- startTime: getStartTime(5),
- state: DOWNLOAD_PAUSED,
- referrer: httpUrl("referrer4"),
- entityID: "",
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "text/plain",
- preferredAction: Ci.nsIMIMEInfo.useSystemDefault,
- preferredApplication: "prerredApplication5",
- autoResume: 0,
-
- expectedCurrentBytes: 0,
- expectedTotalBytes: MAXBYTES_IN_DB,
- expectedResume: false,
- expectedContentType: "text/plain",
- },
-
- // Queued download with no autoResume and no partial file.
- // Even though autoResume=0, queued downloads always autoResume.
- {
- source: sourceUrl,
- target: getDownloadTarget("inprogress6.txt"),
- tempPath: "",
- startTime: getStartTime(6),
- state: DOWNLOAD_QUEUED,
- referrer: httpUrl("referrer6"),
- entityID: "",
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "text/plain",
- preferredAction: Ci.nsIMIMEInfo.useHelperApp,
- preferredApplication: "prerredApplication6",
- autoResume: 0,
-
- expectedCurrentBytes: TEST_DATA_LENGTH,
- expectedTotalBytes: TEST_DATA_LENGTH,
- expectedResume: true,
- expectedContentType: "text/plain",
- expectedContent: TEST_DATA_SHORT
- },
-
- // Notstarted download with no autoResume and no partial file.
- // Even though autoResume=0, notstarted downloads always autoResume.
- {
- source: sourceUrl,
- target: getDownloadTarget("inprogress7.txt"),
- tempPath: "",
- startTime: getStartTime(7),
- state: DOWNLOAD_NOTSTARTED,
- referrer: httpUrl("referrer7"),
- entityID: "",
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "text/plain",
- preferredAction: Ci.nsIMIMEInfo.useHelperApp,
- preferredApplication: "prerredApplication7",
- autoResume: 0,
-
- expectedCurrentBytes: TEST_DATA_LENGTH,
- expectedTotalBytes: TEST_DATA_LENGTH,
- expectedResume: true,
- expectedContentType: "text/plain",
- expectedContent: TEST_DATA_SHORT
- },
-
- // Downloading download with no autoResume and a partial file.
- // Even though autoResume=0, downloading downloads always autoResume.
- {
- source: sourceUrl,
- target: getDownloadTarget("inprogress8.txt"),
- tempPath: yield getPartialFile("inprogress8.txt.part", true),
- startTime: getStartTime(8),
- state: DOWNLOAD_DOWNLOADING,
- referrer: httpUrl("referrer8"),
- entityID: sourceEntityId,
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "text/plain",
- preferredAction: Ci.nsIMIMEInfo.saveToDisk,
- preferredApplication: "prerredApplication8",
- autoResume: 0,
-
- expectedCurrentBytes: TEST_DATA_LENGTH,
- expectedTotalBytes: TEST_DATA_LENGTH,
- expectedResume: true,
- expectedContentType: "text/plain",
- expectedContent: TEST_DATA_TAINTED
- },
- ];
-});
-
-/**
- * Prepares the list of downloads to be added to the database that should
- * *not* be imported by the import procedure.
- */
-add_task(function* prepareNonImportableDownloads()
-{
- gDownloadsRowNonImportable = [
- // Download with no source (should never happen in normal circumstances).
- {
- source: "",
- target: "nonimportable1.txt",
- tempPath: "",
- startTime: getStartTime(1),
- state: DOWNLOAD_PAUSED,
- referrer: "",
- entityID: "",
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "mimeType1",
- preferredAction: Ci.nsIMIMEInfo.saveToDisk,
- preferredApplication: "prerredApplication1",
- autoResume: 1
- },
-
- // state = DOWNLOAD_FAILED
- {
- source: httpUrl("source.txt"),
- target: "nonimportable2.txt",
- tempPath: "",
- startTime: getStartTime(2),
- state: DOWNLOAD_FAILED,
- referrer: "",
- entityID: "",
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "mimeType2",
- preferredAction: Ci.nsIMIMEInfo.saveToDisk,
- preferredApplication: "prerredApplication2",
- autoResume: 1
- },
-
- // state = DOWNLOAD_CANCELED
- {
- source: httpUrl("source.txt"),
- target: "nonimportable3.txt",
- tempPath: "",
- startTime: getStartTime(3),
- state: DOWNLOAD_CANCELED,
- referrer: "",
- entityID: "",
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "mimeType3",
- preferredAction: Ci.nsIMIMEInfo.saveToDisk,
- preferredApplication: "prerredApplication3",
- autoResume: 1
- },
-
- // state = DOWNLOAD_BLOCKED_PARENTAL
- {
- source: httpUrl("source.txt"),
- target: "nonimportable4.txt",
- tempPath: "",
- startTime: getStartTime(4),
- state: DOWNLOAD_BLOCKED_PARENTAL,
- referrer: "",
- entityID: "",
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "mimeType4",
- preferredAction: Ci.nsIMIMEInfo.saveToDisk,
- preferredApplication: "prerredApplication4",
- autoResume: 1
- },
-
- // state = DOWNLOAD_SCANNING
- {
- source: httpUrl("source.txt"),
- target: "nonimportable5.txt",
- tempPath: "",
- startTime: getStartTime(5),
- state: DOWNLOAD_SCANNING,
- referrer: "",
- entityID: "",
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "mimeType5",
- preferredAction: Ci.nsIMIMEInfo.saveToDisk,
- preferredApplication: "prerredApplication5",
- autoResume: 1
- },
-
- // state = DOWNLOAD_DIRTY
- {
- source: httpUrl("source.txt"),
- target: "nonimportable6.txt",
- tempPath: "",
- startTime: getStartTime(6),
- state: DOWNLOAD_DIRTY,
- referrer: "",
- entityID: "",
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "mimeType6",
- preferredAction: Ci.nsIMIMEInfo.saveToDisk,
- preferredApplication: "prerredApplication6",
- autoResume: 1
- },
-
- // state = DOWNLOAD_BLOCKED_POLICY
- {
- source: httpUrl("source.txt"),
- target: "nonimportable7.txt",
- tempPath: "",
- startTime: getStartTime(7),
- state: DOWNLOAD_BLOCKED_POLICY,
- referrer: "",
- entityID: "",
- maxBytes: MAXBYTES_IN_DB,
- mimeType: "mimeType7",
- preferredAction: Ci.nsIMIMEInfo.saveToDisk,
- preferredApplication: "prerredApplication7",
- autoResume: 1
- },
- ];
-});
-
-// Test
-
-/**
- * Creates a temporary Sqlite database with download data and perform an
- * import of that data to the new Downloads API to verify that the import
- * worked correctly.
- */
-add_task(function* test_downloadImport()
-{
- let connection = null;
- let downloadsSqlite = getTempFile("downloads.sqlite").path;
-
- try {
- // Set up the database.
- connection = yield promiseEmptyDatabaseConnection({
- aPath: downloadsSqlite,
- aSchemaVersion: 9
- });
-
- // Insert both the importable and non-importable
- // downloads together.
- for (let downloadRow of gDownloadsRowToImport) {
- yield promiseInsertRow(connection, downloadRow);
- }
-
- for (let downloadRow of gDownloadsRowNonImportable) {
- yield promiseInsertRow(connection, downloadRow);
- }
-
- // Check that every item was inserted.
- do_check_eq((yield promiseTableCount(connection)),
- gDownloadsRowToImport.length +
- gDownloadsRowNonImportable.length);
- } finally {
- // Close the connection so that DownloadImport can open it.
- yield connection.close();
- }
-
- // Import items.
- let list = yield promiseNewList(false);
- yield new DownloadImport(list, downloadsSqlite).import();
- let items = yield list.getAll();
-
- do_check_eq(items.length, gDownloadsRowToImport.length);
-
- for (let i = 0; i < gDownloadsRowToImport.length; i++) {
- yield checkDownload(items[i], gDownloadsRowToImport[i]);
- }
-})
diff --git a/toolkit/components/jsdownloads/test/unit/test_DownloadIntegration.js b/toolkit/components/jsdownloads/test/unit/test_DownloadIntegration.js
deleted file mode 100644
index 31dd7c7a4..000000000
--- a/toolkit/components/jsdownloads/test/unit/test_DownloadIntegration.js
+++ /dev/null
@@ -1,432 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the DownloadIntegration object.
- */
-
-"use strict";
-
-// Globals
-
-/**
- * Notifies the prompt observers and verify the expected downloads count.
- *
- * @param aIsPrivate
- * Flag to know is test private observers.
- * @param aExpectedCount
- * the expected downloads count for quit and offline observers.
- * @param aExpectedPBCount
- * the expected downloads count for private browsing observer.
- */
-function notifyPromptObservers(aIsPrivate, aExpectedCount, aExpectedPBCount) {
- let cancelQuit = Cc["@mozilla.org/supports-PRBool;1"].
- createInstance(Ci.nsISupportsPRBool);
-
- // Notify quit application requested observer.
- DownloadIntegration._testPromptDownloads = -1;
- Services.obs.notifyObservers(cancelQuit, "quit-application-requested", null);
- do_check_eq(DownloadIntegration._testPromptDownloads, aExpectedCount);
-
- // Notify offline requested observer.
- DownloadIntegration._testPromptDownloads = -1;
- Services.obs.notifyObservers(cancelQuit, "offline-requested", null);
- do_check_eq(DownloadIntegration._testPromptDownloads, aExpectedCount);
-
- if (aIsPrivate) {
- // Notify last private browsing requested observer.
- DownloadIntegration._testPromptDownloads = -1;
- Services.obs.notifyObservers(cancelQuit, "last-pb-context-exiting", null);
- do_check_eq(DownloadIntegration._testPromptDownloads, aExpectedPBCount);
- }
-
- delete DownloadIntegration._testPromptDownloads;
-}
-
-// Tests
-
-/**
- * Allows re-enabling the real download directory logic during one test.
- */
-function allowDirectoriesInTest() {
- DownloadIntegration.allowDirectories = true;
- function cleanup() {
- DownloadIntegration.allowDirectories = false;
- }
- do_register_cleanup(cleanup);
- return cleanup;
-}
-
-XPCOMUtils.defineLazyGetter(this, "gStringBundle", function() {
- return Services.strings.
- createBundle("chrome://mozapps/locale/downloads/downloads.properties");
-});
-
-/**
- * Tests that getSystemDownloadsDirectory returns an existing directory or
- * creates a new directory depending on the platform. Instead of the real
- * directory, this test is executed in the temporary directory so we can safely
- * delete the created folder to check whether it is created again.
- */
-add_task(function* test_getSystemDownloadsDirectory_exists_or_creates()
-{
- let tempDir = Services.dirsvc.get("TmpD", Ci.nsIFile);
- let downloadDir;
-
- // OSX / Linux / Windows but not XP/2k
- if (Services.appinfo.OS == "Darwin" ||
- Services.appinfo.OS == "Linux" ||
- (Services.appinfo.OS == "WINNT" &&
- parseFloat(Services.sysinfo.getProperty("version")) >= 6)) {
- downloadDir = yield DownloadIntegration.getSystemDownloadsDirectory();
- do_check_eq(downloadDir, tempDir.path);
- do_check_true(yield OS.File.exists(downloadDir));
-
- let info = yield OS.File.stat(downloadDir);
- do_check_true(info.isDir);
- } else {
- let targetPath = OS.Path.join(tempDir.path,
- gStringBundle.GetStringFromName("downloadsFolder"));
- try {
- yield OS.File.removeEmptyDir(targetPath);
- } catch (e) {}
- downloadDir = yield DownloadIntegration.getSystemDownloadsDirectory();
- do_check_eq(downloadDir, targetPath);
- do_check_true(yield OS.File.exists(downloadDir));
-
- let info = yield OS.File.stat(downloadDir);
- do_check_true(info.isDir);
- yield OS.File.removeEmptyDir(targetPath);
- }
-});
-
-/**
- * Tests that the real directory returned by getSystemDownloadsDirectory is not
- * the one that is used during unit tests. Since this is the actual downloads
- * directory of the operating system, we don't try to delete it afterwards.
- */
-add_task(function* test_getSystemDownloadsDirectory_real()
-{
- let fakeDownloadDir = yield DownloadIntegration.getSystemDownloadsDirectory();
-
- let cleanup = allowDirectoriesInTest();
- let realDownloadDir = yield DownloadIntegration.getSystemDownloadsDirectory();
- cleanup();
-
- do_check_neq(fakeDownloadDir, realDownloadDir);
-});
-
-/**
- * Tests that the getPreferredDownloadsDirectory returns a valid download
- * directory string path.
- */
-add_task(function* test_getPreferredDownloadsDirectory()
-{
- let cleanupDirectories = allowDirectoriesInTest();
-
- let folderListPrefName = "browser.download.folderList";
- let dirPrefName = "browser.download.dir";
- function cleanupPrefs() {
- Services.prefs.clearUserPref(folderListPrefName);
- Services.prefs.clearUserPref(dirPrefName);
- }
- do_register_cleanup(cleanupPrefs);
-
- // Should return the system downloads directory.
- Services.prefs.setIntPref(folderListPrefName, 1);
- let systemDir = yield DownloadIntegration.getSystemDownloadsDirectory();
- let downloadDir = yield DownloadIntegration.getPreferredDownloadsDirectory();
- do_check_neq(downloadDir, "");
- do_check_eq(downloadDir, systemDir);
-
- // Should return the desktop directory.
- Services.prefs.setIntPref(folderListPrefName, 0);
- downloadDir = yield DownloadIntegration.getPreferredDownloadsDirectory();
- do_check_neq(downloadDir, "");
- do_check_eq(downloadDir, Services.dirsvc.get("Desk", Ci.nsIFile).path);
-
- // Should return the system downloads directory because the dir preference
- // is not set.
- Services.prefs.setIntPref(folderListPrefName, 2);
- downloadDir = yield DownloadIntegration.getPreferredDownloadsDirectory();
- do_check_neq(downloadDir, "");
- do_check_eq(downloadDir, systemDir);
-
- // Should return the directory which is listed in the dir preference.
- let time = (new Date()).getTime();
- let tempDir = Services.dirsvc.get("TmpD", Ci.nsIFile);
- tempDir.append(time);
- Services.prefs.setComplexValue("browser.download.dir", Ci.nsIFile, tempDir);
- downloadDir = yield DownloadIntegration.getPreferredDownloadsDirectory();
- do_check_neq(downloadDir, "");
- do_check_eq(downloadDir, tempDir.path);
- do_check_true(yield OS.File.exists(downloadDir));
- yield OS.File.removeEmptyDir(tempDir.path);
-
- // Should return the system downloads directory beacause the path is invalid
- // in the dir preference.
- tempDir = Services.dirsvc.get("TmpD", Ci.nsIFile);
- tempDir.append("dir_not_exist");
- tempDir.append(time);
- Services.prefs.setComplexValue("browser.download.dir", Ci.nsIFile, tempDir);
- downloadDir = yield DownloadIntegration.getPreferredDownloadsDirectory();
- do_check_eq(downloadDir, systemDir);
-
- // Should return the system downloads directory because the folderList
- // preference is invalid
- Services.prefs.setIntPref(folderListPrefName, 999);
- downloadDir = yield DownloadIntegration.getPreferredDownloadsDirectory();
- do_check_eq(downloadDir, systemDir);
-
- cleanupPrefs();
- cleanupDirectories();
-});
-
-/**
- * Tests that the getTemporaryDownloadsDirectory returns a valid download
- * directory string path.
- */
-add_task(function* test_getTemporaryDownloadsDirectory()
-{
- let cleanup = allowDirectoriesInTest();
-
- let downloadDir = yield DownloadIntegration.getTemporaryDownloadsDirectory();
- do_check_neq(downloadDir, "");
-
- if ("nsILocalFileMac" in Ci) {
- let preferredDownloadDir = yield DownloadIntegration.getPreferredDownloadsDirectory();
- do_check_eq(downloadDir, preferredDownloadDir);
- } else {
- let tempDir = Services.dirsvc.get("TmpD", Ci.nsIFile);
- do_check_eq(downloadDir, tempDir.path);
- }
-
- cleanup();
-});
-
-// Tests DownloadObserver
-
-/**
- * Re-enables the default observers for the following tests.
- *
- * This takes effect the first time a DownloadList object is created, and lasts
- * until this test file has completed.
- */
-add_task(function* test_observers_setup()
-{
- DownloadIntegration.allowObservers = true;
- do_register_cleanup(function () {
- DownloadIntegration.allowObservers = false;
- });
-});
-
-/**
- * Tests notifications prompts when observers are notified if there are public
- * and private active downloads.
- */
-add_task(function* test_notifications()
-{
- for (let isPrivate of [false, true]) {
- mustInterruptResponses();
-
- let list = yield promiseNewList(isPrivate);
- let download1 = yield promiseNewDownload(httpUrl("interruptible.txt"));
- let download2 = yield promiseNewDownload(httpUrl("interruptible.txt"));
- let download3 = yield promiseNewDownload(httpUrl("interruptible.txt"));
- let promiseAttempt1 = download1.start();
- let promiseAttempt2 = download2.start();
- download3.start().catch(() => {});
-
- // Add downloads to list.
- yield list.add(download1);
- yield list.add(download2);
- yield list.add(download3);
- // Cancel third download
- yield download3.cancel();
-
- notifyPromptObservers(isPrivate, 2, 2);
-
- // Allow the downloads to complete.
- continueResponses();
- yield promiseAttempt1;
- yield promiseAttempt2;
-
- // Clean up.
- yield list.remove(download1);
- yield list.remove(download2);
- yield list.remove(download3);
- }
-});
-
-/**
- * Tests that notifications prompts observers are not notified if there are no
- * public or private active downloads.
- */
-add_task(function* test_no_notifications()
-{
- for (let isPrivate of [false, true]) {
- let list = yield promiseNewList(isPrivate);
- let download1 = yield promiseNewDownload(httpUrl("interruptible.txt"));
- let download2 = yield promiseNewDownload(httpUrl("interruptible.txt"));
- download1.start().catch(() => {});
- download2.start().catch(() => {});
-
- // Add downloads to list.
- yield list.add(download1);
- yield list.add(download2);
-
- yield download1.cancel();
- yield download2.cancel();
-
- notifyPromptObservers(isPrivate, 0, 0);
-
- // Clean up.
- yield list.remove(download1);
- yield list.remove(download2);
- }
-});
-
-/**
- * Tests notifications prompts when observers are notified if there are public
- * and private active downloads at the same time.
- */
-add_task(function* test_mix_notifications()
-{
- mustInterruptResponses();
-
- let publicList = yield promiseNewList();
- let privateList = yield Downloads.getList(Downloads.PRIVATE);
- let download1 = yield promiseNewDownload(httpUrl("interruptible.txt"));
- let download2 = yield promiseNewDownload(httpUrl("interruptible.txt"));
- let promiseAttempt1 = download1.start();
- let promiseAttempt2 = download2.start();
-
- // Add downloads to lists.
- yield publicList.add(download1);
- yield privateList.add(download2);
-
- notifyPromptObservers(true, 2, 1);
-
- // Allow the downloads to complete.
- continueResponses();
- yield promiseAttempt1;
- yield promiseAttempt2;
-
- // Clean up.
- yield publicList.remove(download1);
- yield privateList.remove(download2);
-});
-
-/**
- * Tests suspending and resuming as well as going offline and then online again.
- * The downloads should stop when suspending and start again when resuming.
- */
-add_task(function* test_suspend_resume()
-{
- // The default wake delay is 10 seconds, so set the wake delay to be much
- // faster for these tests.
- Services.prefs.setIntPref("browser.download.manager.resumeOnWakeDelay", 5);
-
- let addDownload = function(list)
- {
- return Task.spawn(function* () {
- let download = yield promiseNewDownload(httpUrl("interruptible.txt"));
- download.start().catch(() => {});
- list.add(download);
- return download;
- });
- }
-
- let publicList = yield promiseNewList();
- let privateList = yield promiseNewList(true);
-
- let download1 = yield addDownload(publicList);
- let download2 = yield addDownload(publicList);
- let download3 = yield addDownload(privateList);
- let download4 = yield addDownload(privateList);
- let download5 = yield addDownload(publicList);
-
- // First, check that the downloads are all canceled when going to sleep.
- Services.obs.notifyObservers(null, "sleep_notification", null);
- do_check_true(download1.canceled);
- do_check_true(download2.canceled);
- do_check_true(download3.canceled);
- do_check_true(download4.canceled);
- do_check_true(download5.canceled);
-
- // Remove a download. It should not be started again.
- publicList.remove(download5);
- do_check_true(download5.canceled);
-
- // When waking up again, the downloads start again after the wake delay. To be
- // more robust, don't check after a delay but instead just wait for the
- // downloads to finish.
- Services.obs.notifyObservers(null, "wake_notification", null);
- yield download1.whenSucceeded();
- yield download2.whenSucceeded();
- yield download3.whenSucceeded();
- yield download4.whenSucceeded();
-
- // Downloads should no longer be canceled. However, as download5 was removed
- // from the public list, it will not be restarted.
- do_check_false(download1.canceled);
- do_check_true(download5.canceled);
-
- // Create four new downloads and check for going offline and then online again.
-
- download1 = yield addDownload(publicList);
- download2 = yield addDownload(publicList);
- download3 = yield addDownload(privateList);
- download4 = yield addDownload(privateList);
-
- // Going offline should cancel the downloads.
- Services.obs.notifyObservers(null, "network:offline-about-to-go-offline", null);
- do_check_true(download1.canceled);
- do_check_true(download2.canceled);
- do_check_true(download3.canceled);
- do_check_true(download4.canceled);
-
- // Going back online should start the downloads again.
- Services.obs.notifyObservers(null, "network:offline-status-changed", "online");
- yield download1.whenSucceeded();
- yield download2.whenSucceeded();
- yield download3.whenSucceeded();
- yield download4.whenSucceeded();
-
- Services.prefs.clearUserPref("browser.download.manager.resumeOnWakeDelay");
-});
-
-/**
- * Tests both the downloads list and the in-progress downloads are clear when
- * private browsing observer is notified.
- */
-add_task(function* test_exit_private_browsing()
-{
- mustInterruptResponses();
-
- let privateList = yield promiseNewList(true);
- let download1 = yield promiseNewDownload(httpUrl("source.txt"));
- let download2 = yield promiseNewDownload(httpUrl("interruptible.txt"));
- let promiseAttempt1 = download1.start();
- download2.start();
-
- // Add downloads to list.
- yield privateList.add(download1);
- yield privateList.add(download2);
-
- // Complete the download.
- yield promiseAttempt1;
-
- do_check_eq((yield privateList.getAll()).length, 2);
-
- // Simulate exiting the private browsing.
- yield new Promise(resolve => {
- DownloadIntegration._testResolveClearPrivateList = resolve;
- Services.obs.notifyObservers(null, "last-pb-context-exited", null);
- });
- delete DownloadIntegration._testResolveClearPrivateList;
-
- do_check_eq((yield privateList.getAll()).length, 0);
-
- continueResponses();
-});
diff --git a/toolkit/components/jsdownloads/test/unit/test_DownloadLegacy.js b/toolkit/components/jsdownloads/test/unit/test_DownloadLegacy.js
deleted file mode 100644
index dc6c18623..000000000
--- a/toolkit/components/jsdownloads/test/unit/test_DownloadLegacy.js
+++ /dev/null
@@ -1,17 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the integration with legacy interfaces for downloads.
- */
-
-"use strict";
-
-// Execution of common tests
-
-var gUseLegacySaver = true;
-
-var scriptFile = do_get_file("common_test_Download.js");
-Services.scriptloader.loadSubScript(NetUtil.newURI(scriptFile).spec);
diff --git a/toolkit/components/jsdownloads/test/unit/test_DownloadList.js b/toolkit/components/jsdownloads/test/unit/test_DownloadList.js
deleted file mode 100644
index 71e880741..000000000
--- a/toolkit/components/jsdownloads/test/unit/test_DownloadList.js
+++ /dev/null
@@ -1,564 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the DownloadList object.
- */
-
-"use strict";
-
-// Globals
-
-/**
- * Returns a PRTime in the past usable to add expirable visits.
- *
- * @note Expiration ignores any visit added in the last 7 days, but it's
- * better be safe against DST issues, by going back one day more.
- */
-function getExpirablePRTime()
-{
- let dateObj = new Date();
- // Normalize to midnight
- dateObj.setHours(0);
- dateObj.setMinutes(0);
- dateObj.setSeconds(0);
- dateObj.setMilliseconds(0);
- dateObj = new Date(dateObj.getTime() - 8 * 86400000);
- return dateObj.getTime() * 1000;
-}
-
-/**
- * Adds an expirable history visit for a download.
- *
- * @param aSourceUrl
- * String containing the URI for the download source, or null to use
- * httpUrl("source.txt").
- *
- * @return {Promise}
- * @rejects JavaScript exception.
- */
-function promiseExpirableDownloadVisit(aSourceUrl)
-{
- let deferred = Promise.defer();
- PlacesUtils.asyncHistory.updatePlaces(
- {
- uri: NetUtil.newURI(aSourceUrl || httpUrl("source.txt")),
- visits: [{
- transitionType: Ci.nsINavHistoryService.TRANSITION_DOWNLOAD,
- visitDate: getExpirablePRTime(),
- }]
- },
- {
- handleError: function handleError(aResultCode, aPlaceInfo) {
- let ex = new Components.Exception("Unexpected error in adding visits.",
- aResultCode);
- deferred.reject(ex);
- },
- handleResult: function () {},
- handleCompletion: function handleCompletion() {
- deferred.resolve();
- }
- });
- return deferred.promise;
-}
-
-// Tests
-
-/**
- * Checks the testing mechanism used to build different download lists.
- */
-add_task(function* test_construction()
-{
- let downloadListOne = yield promiseNewList();
- let downloadListTwo = yield promiseNewList();
- let privateDownloadListOne = yield promiseNewList(true);
- let privateDownloadListTwo = yield promiseNewList(true);
-
- do_check_neq(downloadListOne, downloadListTwo);
- do_check_neq(privateDownloadListOne, privateDownloadListTwo);
- do_check_neq(downloadListOne, privateDownloadListOne);
-});
-
-/**
- * Checks the methods to add and retrieve items from the list.
- */
-add_task(function* test_add_getAll()
-{
- let list = yield promiseNewList();
-
- let downloadOne = yield promiseNewDownload();
- yield list.add(downloadOne);
-
- let itemsOne = yield list.getAll();
- do_check_eq(itemsOne.length, 1);
- do_check_eq(itemsOne[0], downloadOne);
-
- let downloadTwo = yield promiseNewDownload();
- yield list.add(downloadTwo);
-
- let itemsTwo = yield list.getAll();
- do_check_eq(itemsTwo.length, 2);
- do_check_eq(itemsTwo[0], downloadOne);
- do_check_eq(itemsTwo[1], downloadTwo);
-
- // The first snapshot should not have been modified.
- do_check_eq(itemsOne.length, 1);
-});
-
-/**
- * Checks the method to remove items from the list.
- */
-add_task(function* test_remove()
-{
- let list = yield promiseNewList();
-
- yield list.add(yield promiseNewDownload());
- yield list.add(yield promiseNewDownload());
-
- let items = yield list.getAll();
- yield list.remove(items[0]);
-
- // Removing an item that was never added should not raise an error.
- yield list.remove(yield promiseNewDownload());
-
- items = yield list.getAll();
- do_check_eq(items.length, 1);
-});
-
-/**
- * Tests that the "add", "remove", and "getAll" methods on the global
- * DownloadCombinedList object combine the contents of the global DownloadList
- * objects for public and private downloads.
- */
-add_task(function* test_DownloadCombinedList_add_remove_getAll()
-{
- let publicList = yield promiseNewList();
- let privateList = yield Downloads.getList(Downloads.PRIVATE);
- let combinedList = yield Downloads.getList(Downloads.ALL);
-
- let publicDownload = yield promiseNewDownload();
- let privateDownload = yield Downloads.createDownload({
- source: { url: httpUrl("source.txt"), isPrivate: true },
- target: getTempFile(TEST_TARGET_FILE_NAME).path,
- });
-
- yield publicList.add(publicDownload);
- yield privateList.add(privateDownload);
-
- do_check_eq((yield combinedList.getAll()).length, 2);
-
- yield combinedList.remove(publicDownload);
- yield combinedList.remove(privateDownload);
-
- do_check_eq((yield combinedList.getAll()).length, 0);
-
- yield combinedList.add(publicDownload);
- yield combinedList.add(privateDownload);
-
- do_check_eq((yield publicList.getAll()).length, 1);
- do_check_eq((yield privateList.getAll()).length, 1);
- do_check_eq((yield combinedList.getAll()).length, 2);
-
- yield publicList.remove(publicDownload);
- yield privateList.remove(privateDownload);
-
- do_check_eq((yield combinedList.getAll()).length, 0);
-});
-
-/**
- * Checks that views receive the download add and remove notifications, and that
- * adding and removing views works as expected, both for a normal and a combined
- * list.
- */
-add_task(function* test_notifications_add_remove()
-{
- for (let isCombined of [false, true]) {
- // Force creating a new list for both the public and combined cases.
- let list = yield promiseNewList();
- if (isCombined) {
- list = yield Downloads.getList(Downloads.ALL);
- }
-
- let downloadOne = yield promiseNewDownload();
- let downloadTwo = yield Downloads.createDownload({
- source: { url: httpUrl("source.txt"), isPrivate: true },
- target: getTempFile(TEST_TARGET_FILE_NAME).path,
- });
- yield list.add(downloadOne);
- yield list.add(downloadTwo);
-
- // Check that we receive add notifications for existing elements.
- let addNotifications = 0;
- let viewOne = {
- onDownloadAdded: function (aDownload) {
- // The first download to be notified should be the first that was added.
- if (addNotifications == 0) {
- do_check_eq(aDownload, downloadOne);
- } else if (addNotifications == 1) {
- do_check_eq(aDownload, downloadTwo);
- }
- addNotifications++;
- },
- };
- yield list.addView(viewOne);
- do_check_eq(addNotifications, 2);
-
- // Check that we receive add notifications for new elements.
- yield list.add(yield promiseNewDownload());
- do_check_eq(addNotifications, 3);
-
- // Check that we receive remove notifications.
- let removeNotifications = 0;
- let viewTwo = {
- onDownloadRemoved: function (aDownload) {
- do_check_eq(aDownload, downloadOne);
- removeNotifications++;
- },
- };
- yield list.addView(viewTwo);
- yield list.remove(downloadOne);
- do_check_eq(removeNotifications, 1);
-
- // We should not receive remove notifications after the view is removed.
- yield list.removeView(viewTwo);
- yield list.remove(downloadTwo);
- do_check_eq(removeNotifications, 1);
-
- // We should not receive add notifications after the view is removed.
- yield list.removeView(viewOne);
- yield list.add(yield promiseNewDownload());
- do_check_eq(addNotifications, 3);
- }
-});
-
-/**
- * Checks that views receive the download change notifications, both for a
- * normal and a combined list.
- */
-add_task(function* test_notifications_change()
-{
- for (let isCombined of [false, true]) {
- // Force creating a new list for both the public and combined cases.
- let list = yield promiseNewList();
- if (isCombined) {
- list = yield Downloads.getList(Downloads.ALL);
- }
-
- let downloadOne = yield promiseNewDownload();
- let downloadTwo = yield Downloads.createDownload({
- source: { url: httpUrl("source.txt"), isPrivate: true },
- target: getTempFile(TEST_TARGET_FILE_NAME).path,
- });
- yield list.add(downloadOne);
- yield list.add(downloadTwo);
-
- // Check that we receive change notifications.
- let receivedOnDownloadChanged = false;
- yield list.addView({
- onDownloadChanged: function (aDownload) {
- do_check_eq(aDownload, downloadOne);
- receivedOnDownloadChanged = true;
- },
- });
- yield downloadOne.start();
- do_check_true(receivedOnDownloadChanged);
-
- // We should not receive change notifications after a download is removed.
- receivedOnDownloadChanged = false;
- yield list.remove(downloadTwo);
- yield downloadTwo.start();
- do_check_false(receivedOnDownloadChanged);
- }
-});
-
-/**
- * Checks that the reference to "this" is correct in the view callbacks.
- */
-add_task(function* test_notifications_this()
-{
- let list = yield promiseNewList();
-
- // Check that we receive change notifications.
- let receivedOnDownloadAdded = false;
- let receivedOnDownloadChanged = false;
- let receivedOnDownloadRemoved = false;
- let view = {
- onDownloadAdded: function () {
- do_check_eq(this, view);
- receivedOnDownloadAdded = true;
- },
- onDownloadChanged: function () {
- // Only do this check once.
- if (!receivedOnDownloadChanged) {
- do_check_eq(this, view);
- receivedOnDownloadChanged = true;
- }
- },
- onDownloadRemoved: function () {
- do_check_eq(this, view);
- receivedOnDownloadRemoved = true;
- },
- };
- yield list.addView(view);
-
- let download = yield promiseNewDownload();
- yield list.add(download);
- yield download.start();
- yield list.remove(download);
-
- // Verify that we executed the checks.
- do_check_true(receivedOnDownloadAdded);
- do_check_true(receivedOnDownloadChanged);
- do_check_true(receivedOnDownloadRemoved);
-});
-
-/**
- * Checks that download is removed on history expiration.
- */
-add_task(function* test_history_expiration()
-{
- mustInterruptResponses();
-
- function cleanup() {
- Services.prefs.clearUserPref("places.history.expiration.max_pages");
- }
- do_register_cleanup(cleanup);
-
- // Set max pages to 0 to make the download expire.
- Services.prefs.setIntPref("places.history.expiration.max_pages", 0);
-
- let list = yield promiseNewList();
- let downloadOne = yield promiseNewDownload();
- let downloadTwo = yield promiseNewDownload(httpUrl("interruptible.txt"));
-
- let deferred = Promise.defer();
- let removeNotifications = 0;
- let downloadView = {
- onDownloadRemoved: function (aDownload) {
- if (++removeNotifications == 2) {
- deferred.resolve();
- }
- },
- };
- yield list.addView(downloadView);
-
- // Work with one finished download and one canceled download.
- yield downloadOne.start();
- downloadTwo.start().catch(() => {});
- yield downloadTwo.cancel();
-
- // We must replace the visits added while executing the downloads with visits
- // that are older than 7 days, otherwise they will not be expired.
- yield PlacesTestUtils.clearHistory();
- yield promiseExpirableDownloadVisit();
- yield promiseExpirableDownloadVisit(httpUrl("interruptible.txt"));
-
- // After clearing history, we can add the downloads to be removed to the list.
- yield list.add(downloadOne);
- yield list.add(downloadTwo);
-
- // Force a history expiration.
- Cc["@mozilla.org/places/expiration;1"]
- .getService(Ci.nsIObserver).observe(null, "places-debug-start-expiration", -1);
-
- // Wait for both downloads to be removed.
- yield deferred.promise;
-
- cleanup();
-});
-
-/**
- * Checks all downloads are removed after clearing history.
- */
-add_task(function* test_history_clear()
-{
- let list = yield promiseNewList();
- let downloadOne = yield promiseNewDownload();
- let downloadTwo = yield promiseNewDownload();
- yield list.add(downloadOne);
- yield list.add(downloadTwo);
-
- let deferred = Promise.defer();
- let removeNotifications = 0;
- let downloadView = {
- onDownloadRemoved: function (aDownload) {
- if (++removeNotifications == 2) {
- deferred.resolve();
- }
- },
- };
- yield list.addView(downloadView);
-
- yield downloadOne.start();
- yield downloadTwo.start();
-
- yield PlacesTestUtils.clearHistory();
-
- // Wait for the removal notifications that may still be pending.
- yield deferred.promise;
-});
-
-/**
- * Tests the removeFinished method to ensure that it only removes
- * finished downloads.
- */
-add_task(function* test_removeFinished()
-{
- let list = yield promiseNewList();
- let downloadOne = yield promiseNewDownload();
- let downloadTwo = yield promiseNewDownload();
- let downloadThree = yield promiseNewDownload();
- let downloadFour = yield promiseNewDownload();
- yield list.add(downloadOne);
- yield list.add(downloadTwo);
- yield list.add(downloadThree);
- yield list.add(downloadFour);
-
- let deferred = Promise.defer();
- let removeNotifications = 0;
- let downloadView = {
- onDownloadRemoved: function (aDownload) {
- do_check_true(aDownload == downloadOne ||
- aDownload == downloadTwo ||
- aDownload == downloadThree);
- do_check_true(removeNotifications < 3);
- if (++removeNotifications == 3) {
- deferred.resolve();
- }
- },
- };
- yield list.addView(downloadView);
-
- // Start three of the downloads, but don't start downloadTwo, then set
- // downloadFour to have partial data. All downloads except downloadFour
- // should be removed.
- yield downloadOne.start();
- yield downloadThree.start();
- yield downloadFour.start();
- downloadFour.hasPartialData = true;
-
- list.removeFinished();
- yield deferred.promise;
-
- let downloads = yield list.getAll()
- do_check_eq(downloads.length, 1);
-});
-
-/**
- * Tests the global DownloadSummary objects for the public, private, and
- * combined download lists.
- */
-add_task(function* test_DownloadSummary()
-{
- mustInterruptResponses();
-
- let publicList = yield promiseNewList();
- let privateList = yield Downloads.getList(Downloads.PRIVATE);
-
- let publicSummary = yield Downloads.getSummary(Downloads.PUBLIC);
- let privateSummary = yield Downloads.getSummary(Downloads.PRIVATE);
- let combinedSummary = yield Downloads.getSummary(Downloads.ALL);
-
- // Add a public download that has succeeded.
- let succeededPublicDownload = yield promiseNewDownload();
- yield succeededPublicDownload.start();
- yield publicList.add(succeededPublicDownload);
-
- // Add a public download that has been canceled midway.
- let canceledPublicDownload =
- yield promiseNewDownload(httpUrl("interruptible.txt"));
- canceledPublicDownload.start().catch(() => {});
- yield promiseDownloadMidway(canceledPublicDownload);
- yield canceledPublicDownload.cancel();
- yield publicList.add(canceledPublicDownload);
-
- // Add a public download that is in progress.
- let inProgressPublicDownload =
- yield promiseNewDownload(httpUrl("interruptible.txt"));
- inProgressPublicDownload.start().catch(() => {});
- yield promiseDownloadMidway(inProgressPublicDownload);
- yield publicList.add(inProgressPublicDownload);
-
- // Add a private download that is in progress.
- let inProgressPrivateDownload = yield Downloads.createDownload({
- source: { url: httpUrl("interruptible.txt"), isPrivate: true },
- target: getTempFile(TEST_TARGET_FILE_NAME).path,
- });
- inProgressPrivateDownload.start().catch(() => {});
- yield promiseDownloadMidway(inProgressPrivateDownload);
- yield privateList.add(inProgressPrivateDownload);
-
- // Verify that the summary includes the total number of bytes and the
- // currently transferred bytes only for the downloads that are not stopped.
- // For simplicity, we assume that after a download is added to the list, its
- // current state is immediately propagated to the summary object, which is
- // true in the current implementation, though it is not guaranteed as all the
- // download operations may happen asynchronously.
- do_check_false(publicSummary.allHaveStopped);
- do_check_eq(publicSummary.progressTotalBytes, TEST_DATA_SHORT.length * 2);
- do_check_eq(publicSummary.progressCurrentBytes, TEST_DATA_SHORT.length);
-
- do_check_false(privateSummary.allHaveStopped);
- do_check_eq(privateSummary.progressTotalBytes, TEST_DATA_SHORT.length * 2);
- do_check_eq(privateSummary.progressCurrentBytes, TEST_DATA_SHORT.length);
-
- do_check_false(combinedSummary.allHaveStopped);
- do_check_eq(combinedSummary.progressTotalBytes, TEST_DATA_SHORT.length * 4);
- do_check_eq(combinedSummary.progressCurrentBytes, TEST_DATA_SHORT.length * 2);
-
- yield inProgressPublicDownload.cancel();
-
- // Stopping the download should have excluded it from the summary.
- do_check_true(publicSummary.allHaveStopped);
- do_check_eq(publicSummary.progressTotalBytes, 0);
- do_check_eq(publicSummary.progressCurrentBytes, 0);
-
- do_check_false(privateSummary.allHaveStopped);
- do_check_eq(privateSummary.progressTotalBytes, TEST_DATA_SHORT.length * 2);
- do_check_eq(privateSummary.progressCurrentBytes, TEST_DATA_SHORT.length);
-
- do_check_false(combinedSummary.allHaveStopped);
- do_check_eq(combinedSummary.progressTotalBytes, TEST_DATA_SHORT.length * 2);
- do_check_eq(combinedSummary.progressCurrentBytes, TEST_DATA_SHORT.length);
-
- yield inProgressPrivateDownload.cancel();
-
- // All the downloads should be stopped now.
- do_check_true(publicSummary.allHaveStopped);
- do_check_eq(publicSummary.progressTotalBytes, 0);
- do_check_eq(publicSummary.progressCurrentBytes, 0);
-
- do_check_true(privateSummary.allHaveStopped);
- do_check_eq(privateSummary.progressTotalBytes, 0);
- do_check_eq(privateSummary.progressCurrentBytes, 0);
-
- do_check_true(combinedSummary.allHaveStopped);
- do_check_eq(combinedSummary.progressTotalBytes, 0);
- do_check_eq(combinedSummary.progressCurrentBytes, 0);
-});
-
-/**
- * Checks that views receive the summary change notification. This is tested on
- * the combined summary when adding a public download, as we assume that if we
- * pass the test in this case we will also pass it in the others.
- */
-add_task(function* test_DownloadSummary_notifications()
-{
- let list = yield promiseNewList();
- let summary = yield Downloads.getSummary(Downloads.ALL);
-
- let download = yield promiseNewDownload();
- yield list.add(download);
-
- // Check that we receive change notifications.
- let receivedOnSummaryChanged = false;
- yield summary.addView({
- onSummaryChanged: function () {
- receivedOnSummaryChanged = true;
- },
- });
- yield download.start();
- do_check_true(receivedOnSummaryChanged);
-});
diff --git a/toolkit/components/jsdownloads/test/unit/test_DownloadStore.js b/toolkit/components/jsdownloads/test/unit/test_DownloadStore.js
deleted file mode 100644
index 3a23dfbe3..000000000
--- a/toolkit/components/jsdownloads/test/unit/test_DownloadStore.js
+++ /dev/null
@@ -1,315 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the DownloadStore object.
- */
-
-"use strict";
-
-// Globals
-
-XPCOMUtils.defineLazyModuleGetter(this, "DownloadStore",
- "resource://gre/modules/DownloadStore.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm")
-
-/**
- * Returns a new DownloadList object with an associated DownloadStore.
- *
- * @param aStorePath
- * String pointing to the file to be associated with the DownloadStore,
- * or undefined to use a non-existing temporary file. In this case, the
- * temporary file is deleted when the test file execution finishes.
- *
- * @return {Promise}
- * @resolves Array [ Newly created DownloadList , associated DownloadStore ].
- * @rejects JavaScript exception.
- */
-function promiseNewListAndStore(aStorePath)
-{
- return promiseNewList().then(function (aList) {
- let path = aStorePath || getTempFile(TEST_STORE_FILE_NAME).path;
- let store = new DownloadStore(aList, path);
- return [aList, store];
- });
-}
-
-// Tests
-
-/**
- * Saves downloads to a file, then reloads them.
- */
-add_task(function* test_save_reload()
-{
- let [listForSave, storeForSave] = yield promiseNewListAndStore();
- let [listForLoad, storeForLoad] = yield promiseNewListAndStore(
- storeForSave.path);
-
- listForSave.add(yield promiseNewDownload(httpUrl("source.txt")));
- listForSave.add(yield Downloads.createDownload({
- source: { url: httpUrl("empty.txt"),
- referrer: TEST_REFERRER_URL },
- target: getTempFile(TEST_TARGET_FILE_NAME),
- }));
-
- // This PDF download should not be serialized because it never succeeds.
- let pdfDownload = yield Downloads.createDownload({
- source: { url: httpUrl("empty.txt"),
- referrer: TEST_REFERRER_URL },
- target: getTempFile(TEST_TARGET_FILE_NAME),
- saver: "pdf",
- });
- listForSave.add(pdfDownload);
-
- // If we used a callback to adjust the channel, the download should
- // not be serialized because we can't recreate it across sessions.
- let adjustedDownload = yield Downloads.createDownload({
- source: { url: httpUrl("empty.txt"),
- adjustChannel: () => Promise.resolve() },
- target: getTempFile(TEST_TARGET_FILE_NAME),
- });
- listForSave.add(adjustedDownload);
-
- let legacyDownload = yield promiseStartLegacyDownload();
- yield legacyDownload.cancel();
- listForSave.add(legacyDownload);
-
- yield storeForSave.save();
- yield storeForLoad.load();
-
- // Remove the PDF and adjusted downloads because they should not appear here.
- listForSave.remove(adjustedDownload);
- listForSave.remove(pdfDownload);
-
- let itemsForSave = yield listForSave.getAll();
- let itemsForLoad = yield listForLoad.getAll();
-
- do_check_eq(itemsForSave.length, itemsForLoad.length);
-
- // Downloads should be reloaded in the same order.
- for (let i = 0; i < itemsForSave.length; i++) {
- // The reloaded downloads are different objects.
- do_check_neq(itemsForSave[i], itemsForLoad[i]);
-
- // The reloaded downloads have the same properties.
- do_check_eq(itemsForSave[i].source.url,
- itemsForLoad[i].source.url);
- do_check_eq(itemsForSave[i].source.referrer,
- itemsForLoad[i].source.referrer);
- do_check_eq(itemsForSave[i].target.path,
- itemsForLoad[i].target.path);
- do_check_eq(itemsForSave[i].saver.toSerializable(),
- itemsForLoad[i].saver.toSerializable());
- }
-});
-
-/**
- * Checks that saving an empty list deletes any existing file.
- */
-add_task(function* test_save_empty()
-{
- let [, store] = yield promiseNewListAndStore();
-
- let createdFile = yield OS.File.open(store.path, { create: true });
- yield createdFile.close();
-
- yield store.save();
-
- do_check_false(yield OS.File.exists(store.path));
-
- // If the file does not exist, saving should not generate exceptions.
- yield store.save();
-});
-
-/**
- * Checks that loading from a missing file results in an empty list.
- */
-add_task(function* test_load_empty()
-{
- let [list, store] = yield promiseNewListAndStore();
-
- do_check_false(yield OS.File.exists(store.path));
-
- yield store.load();
-
- let items = yield list.getAll();
- do_check_eq(items.length, 0);
-});
-
-/**
- * Loads downloads from a string in a predefined format. The purpose of this
- * test is to verify that the JSON format used in previous versions can be
- * loaded, assuming the file is reloaded on the same platform.
- */
-add_task(function* test_load_string_predefined()
-{
- let [list, store] = yield promiseNewListAndStore();
-
- // The platform-dependent file name should be generated dynamically.
- let targetPath = getTempFile(TEST_TARGET_FILE_NAME).path;
- let filePathLiteral = JSON.stringify(targetPath);
- let sourceUriLiteral = JSON.stringify(httpUrl("source.txt"));
- let emptyUriLiteral = JSON.stringify(httpUrl("empty.txt"));
- let referrerUriLiteral = JSON.stringify(TEST_REFERRER_URL);
-
- let string = "{\"list\":[{\"source\":" + sourceUriLiteral + "," +
- "\"target\":" + filePathLiteral + "}," +
- "{\"source\":{\"url\":" + emptyUriLiteral + "," +
- "\"referrer\":" + referrerUriLiteral + "}," +
- "\"target\":" + filePathLiteral + "}]}";
-
- yield OS.File.writeAtomic(store.path,
- new TextEncoder().encode(string),
- { tmpPath: store.path + ".tmp" });
-
- yield store.load();
-
- let items = yield list.getAll();
-
- do_check_eq(items.length, 2);
-
- do_check_eq(items[0].source.url, httpUrl("source.txt"));
- do_check_eq(items[0].target.path, targetPath);
-
- do_check_eq(items[1].source.url, httpUrl("empty.txt"));
- do_check_eq(items[1].source.referrer, TEST_REFERRER_URL);
- do_check_eq(items[1].target.path, targetPath);
-});
-
-/**
- * Loads downloads from a well-formed JSON string containing unrecognized data.
- */
-add_task(function* test_load_string_unrecognized()
-{
- let [list, store] = yield promiseNewListAndStore();
-
- // The platform-dependent file name should be generated dynamically.
- let targetPath = getTempFile(TEST_TARGET_FILE_NAME).path;
- let filePathLiteral = JSON.stringify(targetPath);
- let sourceUriLiteral = JSON.stringify(httpUrl("source.txt"));
-
- let string = "{\"list\":[{\"source\":null," +
- "\"target\":null}," +
- "{\"source\":{\"url\":" + sourceUriLiteral + "}," +
- "\"target\":{\"path\":" + filePathLiteral + "}," +
- "\"saver\":{\"type\":\"copy\"}}]}";
-
- yield OS.File.writeAtomic(store.path,
- new TextEncoder().encode(string),
- { tmpPath: store.path + ".tmp" });
-
- yield store.load();
-
- let items = yield list.getAll();
-
- do_check_eq(items.length, 1);
-
- do_check_eq(items[0].source.url, httpUrl("source.txt"));
- do_check_eq(items[0].target.path, targetPath);
-});
-
-/**
- * Loads downloads from a malformed JSON string.
- */
-add_task(function* test_load_string_malformed()
-{
- let [list, store] = yield promiseNewListAndStore();
-
- let string = "{\"list\":[{\"source\":null,\"target\":null}," +
- "{\"source\":{\"url\":\"about:blank\"}}}";
-
- yield OS.File.writeAtomic(store.path, new TextEncoder().encode(string),
- { tmpPath: store.path + ".tmp" });
-
- try {
- yield store.load();
- do_throw("Exception expected when JSON data is malformed.");
- } catch (ex) {
- if (ex.name != "SyntaxError") {
- throw ex;
- }
- do_print("The expected SyntaxError exception was thrown.");
- }
-
- let items = yield list.getAll();
-
- do_check_eq(items.length, 0);
-});
-
-/**
- * Saves downloads with unknown properties to a file and then reloads
- * them to ensure that these properties are preserved.
- */
-add_task(function* test_save_reload_unknownProperties()
-{
- let [listForSave, storeForSave] = yield promiseNewListAndStore();
- let [listForLoad, storeForLoad] = yield promiseNewListAndStore(
- storeForSave.path);
-
- let download1 = yield promiseNewDownload(httpUrl("source.txt"));
- // startTime should be ignored as it is a known property, and error
- // is ignored by serialization
- download1._unknownProperties = { peanut: "butter",
- orange: "marmalade",
- startTime: 77,
- error: { message: "Passed" } };
- listForSave.add(download1);
-
- let download2 = yield promiseStartLegacyDownload();
- yield download2.cancel();
- download2._unknownProperties = { number: 5, object: { test: "string" } };
- listForSave.add(download2);
-
- let download3 = yield Downloads.createDownload({
- source: { url: httpUrl("empty.txt"),
- referrer: TEST_REFERRER_URL,
- source1: "download3source1",
- source2: "download3source2" },
- target: { path: getTempFile(TEST_TARGET_FILE_NAME).path,
- target1: "download3target1",
- target2: "download3target2" },
- saver : { type: "copy",
- saver1: "download3saver1",
- saver2: "download3saver2" },
- });
- listForSave.add(download3);
-
- yield storeForSave.save();
- yield storeForLoad.load();
-
- let itemsForSave = yield listForSave.getAll();
- let itemsForLoad = yield listForLoad.getAll();
-
- do_check_eq(itemsForSave.length, itemsForLoad.length);
-
- do_check_eq(Object.keys(itemsForLoad[0]._unknownProperties).length, 2);
- do_check_eq(itemsForLoad[0]._unknownProperties.peanut, "butter");
- do_check_eq(itemsForLoad[0]._unknownProperties.orange, "marmalade");
- do_check_false("startTime" in itemsForLoad[0]._unknownProperties);
- do_check_false("error" in itemsForLoad[0]._unknownProperties);
-
- do_check_eq(Object.keys(itemsForLoad[1]._unknownProperties).length, 2);
- do_check_eq(itemsForLoad[1]._unknownProperties.number, 5);
- do_check_eq(itemsForLoad[1]._unknownProperties.object.test, "string");
-
- do_check_eq(Object.keys(itemsForLoad[2].source._unknownProperties).length, 2);
- do_check_eq(itemsForLoad[2].source._unknownProperties.source1,
- "download3source1");
- do_check_eq(itemsForLoad[2].source._unknownProperties.source2,
- "download3source2");
-
- do_check_eq(Object.keys(itemsForLoad[2].target._unknownProperties).length, 2);
- do_check_eq(itemsForLoad[2].target._unknownProperties.target1,
- "download3target1");
- do_check_eq(itemsForLoad[2].target._unknownProperties.target2,
- "download3target2");
-
- do_check_eq(Object.keys(itemsForLoad[2].saver._unknownProperties).length, 2);
- do_check_eq(itemsForLoad[2].saver._unknownProperties.saver1,
- "download3saver1");
- do_check_eq(itemsForLoad[2].saver._unknownProperties.saver2,
- "download3saver2");
-});
diff --git a/toolkit/components/jsdownloads/test/unit/test_Downloads.js b/toolkit/components/jsdownloads/test/unit/test_Downloads.js
deleted file mode 100644
index 2027beee1..000000000
--- a/toolkit/components/jsdownloads/test/unit/test_Downloads.js
+++ /dev/null
@@ -1,194 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the functions located directly in the "Downloads" object.
- */
-
-"use strict";
-
-// Tests
-
-/**
- * Tests that the createDownload function exists and can be called. More
- * detailed tests are implemented separately for the DownloadCore module.
- */
-add_task(function* test_createDownload()
-{
- // Creates a simple Download object without starting the download.
- yield Downloads.createDownload({
- source: { url: "about:blank" },
- target: { path: getTempFile(TEST_TARGET_FILE_NAME).path },
- saver: { type: "copy" },
- });
-});
-
-/**
- * Tests createDownload for private download.
- */
-add_task(function* test_createDownload_private()
-{
- let download = yield Downloads.createDownload({
- source: { url: "about:blank", isPrivate: true },
- target: { path: getTempFile(TEST_TARGET_FILE_NAME).path },
- saver: { type: "copy" }
- });
- do_check_true(download.source.isPrivate);
-});
-
-/**
- * Tests createDownload for normal (public) download.
- */
-add_task(function* test_createDownload_public()
-{
- let tempPath = getTempFile(TEST_TARGET_FILE_NAME).path;
- let download = yield Downloads.createDownload({
- source: { url: "about:blank", isPrivate: false },
- target: { path: tempPath },
- saver: { type: "copy" }
- });
- do_check_false(download.source.isPrivate);
-
- download = yield Downloads.createDownload({
- source: { url: "about:blank" },
- target: { path: tempPath },
- saver: { type: "copy" }
- });
- do_check_false(download.source.isPrivate);
-});
-
-/**
- * Tests createDownload for a pdf saver throws if only given a url.
- */
-add_task(function* test_createDownload_pdf()
-{
- let download = yield Downloads.createDownload({
- source: { url: "about:blank" },
- target: { path: getTempFile(TEST_TARGET_FILE_NAME).path },
- saver: { type: "pdf" },
- });
-
- try {
- yield download.start();
- do_throw("The download should have failed.");
- } catch (ex) {
- if (!(ex instanceof Downloads.Error) || !ex.becauseSourceFailed) {
- throw ex;
- }
- }
-
- do_check_false(download.succeeded);
- do_check_true(download.stopped);
- do_check_false(download.canceled);
- do_check_true(download.error !== null);
- do_check_true(download.error.becauseSourceFailed);
- do_check_false(download.error.becauseTargetFailed);
- do_check_false(yield OS.File.exists(download.target.path));
-});
-
-/**
- * Tests "fetch" with nsIURI and nsIFile as arguments.
- */
-add_task(function* test_fetch_uri_file_arguments()
-{
- let targetFile = getTempFile(TEST_TARGET_FILE_NAME);
- yield Downloads.fetch(NetUtil.newURI(httpUrl("source.txt")), targetFile);
- yield promiseVerifyContents(targetFile.path, TEST_DATA_SHORT);
-});
-
-/**
- * Tests "fetch" with DownloadSource and DownloadTarget as arguments.
- */
-add_task(function* test_fetch_object_arguments()
-{
- let targetPath = getTempFile(TEST_TARGET_FILE_NAME).path;
- yield Downloads.fetch({ url: httpUrl("source.txt") }, { path: targetPath });
- yield promiseVerifyContents(targetPath, TEST_DATA_SHORT);
-});
-
-/**
- * Tests "fetch" with string arguments.
- */
-add_task(function* test_fetch_string_arguments()
-{
- let targetPath = getTempFile(TEST_TARGET_FILE_NAME).path;
- yield Downloads.fetch(httpUrl("source.txt"), targetPath);
- yield promiseVerifyContents(targetPath, TEST_DATA_SHORT);
-
- targetPath = getTempFile(TEST_TARGET_FILE_NAME).path;
- yield Downloads.fetch(new String(httpUrl("source.txt")),
- new String(targetPath));
- yield promiseVerifyContents(targetPath, TEST_DATA_SHORT);
-});
-
-/**
- * Tests that the getList function returns the same list when called multiple
- * times with the same argument, but returns different lists when called with
- * different arguments. More detailed tests are implemented separately for the
- * DownloadList module.
- */
-add_task(function* test_getList()
-{
- let publicListOne = yield Downloads.getList(Downloads.PUBLIC);
- let privateListOne = yield Downloads.getList(Downloads.PRIVATE);
-
- let publicListTwo = yield Downloads.getList(Downloads.PUBLIC);
- let privateListTwo = yield Downloads.getList(Downloads.PRIVATE);
-
- do_check_eq(publicListOne, publicListTwo);
- do_check_eq(privateListOne, privateListTwo);
-
- do_check_neq(publicListOne, privateListOne);
-});
-
-/**
- * Tests that the getSummary function returns the same summary when called
- * multiple times with the same argument, but returns different summaries when
- * called with different arguments. More detailed tests are implemented
- * separately for the DownloadSummary object in the DownloadList module.
- */
-add_task(function* test_getSummary()
-{
- let publicSummaryOne = yield Downloads.getSummary(Downloads.PUBLIC);
- let privateSummaryOne = yield Downloads.getSummary(Downloads.PRIVATE);
-
- let publicSummaryTwo = yield Downloads.getSummary(Downloads.PUBLIC);
- let privateSummaryTwo = yield Downloads.getSummary(Downloads.PRIVATE);
-
- do_check_eq(publicSummaryOne, publicSummaryTwo);
- do_check_eq(privateSummaryOne, privateSummaryTwo);
-
- do_check_neq(publicSummaryOne, privateSummaryOne);
-});
-
-/**
- * Tests that the getSystemDownloadsDirectory returns a non-empty download
- * directory string.
- */
-add_task(function* test_getSystemDownloadsDirectory()
-{
- let downloadDir = yield Downloads.getSystemDownloadsDirectory();
- do_check_neq(downloadDir, "");
-});
-
-/**
- * Tests that the getPreferredDownloadsDirectory returns a non-empty download
- * directory string.
- */
-add_task(function* test_getPreferredDownloadsDirectory()
-{
- let downloadDir = yield Downloads.getPreferredDownloadsDirectory();
- do_check_neq(downloadDir, "");
-});
-
-/**
- * Tests that the getTemporaryDownloadsDirectory returns a non-empty download
- * directory string.
- */
-add_task(function* test_getTemporaryDownloadsDirectory()
-{
- let downloadDir = yield Downloads.getTemporaryDownloadsDirectory();
- do_check_neq(downloadDir, "");
-});
diff --git a/toolkit/components/jsdownloads/test/unit/test_PrivateTemp.js b/toolkit/components/jsdownloads/test/unit/test_PrivateTemp.js
deleted file mode 100644
index 1308e9782..000000000
--- a/toolkit/components/jsdownloads/test/unit/test_PrivateTemp.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-/*
- * The temporary directory downloads saves to, should be only readable
- * for the current user.
- */
-add_task(function* test_private_temp() {
-
- let download = yield promiseStartExternalHelperAppServiceDownload(
- httpUrl("empty.txt"));
-
- yield promiseDownloadStopped(download);
-
- var targetFile = Cc['@mozilla.org/file/local;1'].createInstance(Ci.nsIFile);
- targetFile.initWithPath(download.target.path);
-
- // 488 is the decimal value of 0o700.
- equal(targetFile.parent.permissions, 448);
-});
diff --git a/toolkit/components/jsdownloads/test/unit/xpcshell.ini b/toolkit/components/jsdownloads/test/unit/xpcshell.ini
deleted file mode 100644
index 8de554540..000000000
--- a/toolkit/components/jsdownloads/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,19 +0,0 @@
-[DEFAULT]
-head = head.js
-tail =
-skip-if = toolkit == 'android'
-
-# Note: The "tail.js" file is not defined in the "tail" key because it calls
-# the "add_test_task" function, that does not work properly in tail files.
-support-files =
- common_test_Download.js
-
-[test_DownloadCore.js]
-[test_DownloadImport.js]
-[test_DownloadIntegration.js]
-[test_DownloadLegacy.js]
-[test_DownloadList.js]
-[test_Downloads.js]
-[test_DownloadStore.js]
-[test_PrivateTemp.js]
-skip-if = os != 'linux'
diff --git a/toolkit/components/lz4/moz.build b/toolkit/components/lz4/moz.build
index a70185930..b94e937de 100644
--- a/toolkit/components/lz4/moz.build
+++ b/toolkit/components/lz4/moz.build
@@ -4,15 +4,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
-
EXTRA_JS_MODULES += [
'lz4.js',
'lz4_internal.js',
]
-SOURCES += [
- 'lz4.cpp',
-]
+SOURCES += ['lz4.cpp']
FINAL_LIBRARY = 'xul'
diff --git a/toolkit/components/lz4/tests/xpcshell/.eslintrc.js b/toolkit/components/lz4/tests/xpcshell/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/lz4/tests/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/lz4/tests/xpcshell/data/chrome.manifest b/toolkit/components/lz4/tests/xpcshell/data/chrome.manifest
deleted file mode 100644
index e2f9a9d8e..000000000
--- a/toolkit/components/lz4/tests/xpcshell/data/chrome.manifest
+++ /dev/null
@@ -1 +0,0 @@
-content test_lz4 ./
diff --git a/toolkit/components/lz4/tests/xpcshell/data/compression.lz b/toolkit/components/lz4/tests/xpcshell/data/compression.lz
deleted file mode 100644
index a354edc03..000000000
--- a/toolkit/components/lz4/tests/xpcshell/data/compression.lz
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/lz4/tests/xpcshell/data/worker_lz4.js b/toolkit/components/lz4/tests/xpcshell/data/worker_lz4.js
deleted file mode 100644
index 47e3ea369..000000000
--- a/toolkit/components/lz4/tests/xpcshell/data/worker_lz4.js
+++ /dev/null
@@ -1,146 +0,0 @@
-importScripts("resource://gre/modules/workers/require.js");
-importScripts("resource://gre/modules/osfile.jsm");
-
-
-function do_print(x) {
- // self.postMessage({kind: "do_print", args: [x]});
- dump("TEST-INFO: " + x + "\n");
-}
-
-function do_check_true(x) {
- self.postMessage({kind: "do_check_true", args: [!!x]});
- if (x) {
- dump("TEST-PASS: " + x + "\n");
- } else {
- throw new Error("do_check_true failed");
- }
-}
-
-function do_check_eq(a, b) {
- let result = a == b;
- self.postMessage({kind: "do_check_true", args: [result]});
- if (!result) {
- throw new Error("do_check_eq failed " + a + " != " + b);
- }
-}
-
-function do_test_complete() {
- self.postMessage({kind: "do_test_complete", args:[]});
-}
-
-self.onmessage = function() {
- try {
- run_test();
- } catch (ex) {
- let {message, moduleStack, moduleName, lineNumber} = ex;
- let error = new Error(message, moduleName, lineNumber);
- error.stack = moduleStack;
- dump("Uncaught error: " + error + "\n");
- dump("Full stack: " + moduleStack + "\n");
- throw error;
- }
-};
-
-var Lz4;
-var Internals;
-function test_import() {
- Lz4 = require("resource://gre/modules/lz4.js");
- Internals = require("resource://gre/modules/lz4_internal.js");
-}
-
-function test_bound() {
- for (let k of ["compress", "decompress", "maxCompressedSize"]) {
- try {
- do_print("Checking the existence of " + k + "\n");
- do_check_true(!!Internals[k]);
- do_print(k + " exists");
- } catch (ex) {
- // Ignore errors
- do_print(k + " doesn't exist!");
- }
- }
-}
-
-function test_reference_file() {
- do_print("Decompress reference file");
- let path = OS.Path.join("data", "compression.lz");
- let data = OS.File.read(path);
- let decompressed = Lz4.decompressFileContent(data);
- let text = (new TextDecoder()).decode(decompressed);
- do_check_eq(text, "Hello, lz4");
-}
-
-function compare_arrays(a, b) {
- return Array.prototype.join.call(a) == Array.prototype.join.call(a);
-}
-
-function run_rawcompression(name, array) {
- do_print("Raw compression test " + name);
- let length = array.byteLength;
- let compressedArray = new Uint8Array(Internals.maxCompressedSize(length));
- let compressedBytes = Internals.compress(array, length, compressedArray);
- compressedArray = new Uint8Array(compressedArray.buffer, 0, compressedBytes);
- do_print("Raw compressed: " + length + " into " + compressedBytes);
-
- let decompressedArray = new Uint8Array(length);
- let decompressedBytes = new ctypes.size_t();
- let success = Internals.decompress(compressedArray, compressedBytes,
- decompressedArray, length,
- decompressedBytes.address());
- do_print("Raw decompression success? " + success);
- do_print("Raw decompression size: " + decompressedBytes.value);
- do_check_true(compare_arrays(array, decompressedArray));
-}
-
-function run_filecompression(name, array) {
- do_print("File compression test " + name);
- let compressed = Lz4.compressFileContent(array);
- do_print("Compressed " + array.byteLength + " bytes into " + compressed.byteLength);
-
- let decompressed = Lz4.decompressFileContent(compressed);
- do_print("Decompressed " + compressed.byteLength + " bytes into " + decompressed.byteLength);
- do_check_true(compare_arrays(array, decompressed));
-}
-
-function run_faileddecompression(name, array) {
- do_print("invalid decompression test " + name);
-
- // Ensure that raw decompression doesn't segfault
- let length = 1 << 14;
- let decompressedArray = new Uint8Array(length);
- let decompressedBytes = new ctypes.size_t();
- Internals.decompress(array, array.byteLength,
- decompressedArray, length,
- decompressedBytes.address());
-
- // File decompression should fail with an acceptable exception
- let exn = null;
- try {
- Lz4.decompressFileContent(array);
- } catch (ex) {
- exn = ex;
- }
- do_check_true(exn);
- if (array.byteLength < 10) {
- do_check_true(exn.becauseLZNoHeader);
- } else {
- do_check_true(exn.becauseLZWrongMagicNumber);
- }
-}
-
-function run_test() {
- test_import();
- test_bound();
- test_reference_file();
- for (let length of [0, 1, 1024]) {
- let array = new Uint8Array(length);
- for (let i = 0; i < length; ++i) {
- array[i] = i % 256;
- }
- let name = length + " bytes";
- run_rawcompression(name, array);
- run_filecompression(name, array);
- run_faileddecompression(name, array);
- }
- do_test_complete();
-}
diff --git a/toolkit/components/lz4/tests/xpcshell/test_lz4.js b/toolkit/components/lz4/tests/xpcshell/test_lz4.js
deleted file mode 100644
index 8a8fc0b21..000000000
--- a/toolkit/components/lz4/tests/xpcshell/test_lz4.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Components.utils.import("resource://gre/modules/Promise.jsm");
-
-var WORKER_SOURCE_URI = "chrome://test_lz4/content/worker_lz4.js";
-do_load_manifest("data/chrome.manifest");
-
-function run_test() {
- run_next_test();
-}
-
-
-add_task(function() {
- let worker = new ChromeWorker(WORKER_SOURCE_URI);
- let deferred = Promise.defer();
- worker.onmessage = function(event) {
- let data = event.data;
- switch (data.kind) {
- case "do_check_true":
- try {
- do_check_true(data.args[0]);
- } catch (ex) {
- // Ignore errors
- }
- return;
- case "do_test_complete":
- deferred.resolve();
- worker.terminate();
- break;
- case "do_print":
- do_print(data.args[0]);
- }
- };
- worker.onerror = function(event) {
- let error = new Error(event.message, event.filename, event.lineno);
- worker.terminate();
- deferred.reject(error);
- };
- worker.postMessage("START");
- return deferred.promise;
-});
-
diff --git a/toolkit/components/lz4/tests/xpcshell/test_lz4_sync.js b/toolkit/components/lz4/tests/xpcshell/test_lz4_sync.js
deleted file mode 100644
index 61605373b..000000000
--- a/toolkit/components/lz4/tests/xpcshell/test_lz4_sync.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-const Cu = Components.utils;
-Cu.import("resource://gre/modules/lz4.js");
-Cu.import("resource://gre/modules/osfile.jsm");
-
-function run_test() {
- run_next_test();
-}
-
-function compare_arrays(a, b) {
- return Array.prototype.join.call(a) == Array.prototype.join.call(a);
-}
-
-add_task(function*() {
- let path = OS.Path.join("data", "compression.lz");
- let data = yield OS.File.read(path);
- let decompressed = Lz4.decompressFileContent(data);
- let text = (new TextDecoder()).decode(decompressed);
- do_check_eq(text, "Hello, lz4");
-});
-
-add_task(function*() {
- for (let length of [0, 1, 1024]) {
- let array = new Uint8Array(length);
- for (let i = 0; i < length; ++i) {
- array[i] = i % 256;
- }
-
- let compressed = Lz4.compressFileContent(array);
- do_print("Compressed " + array.byteLength + " bytes into " +
- compressed.byteLength);
-
- let decompressed = Lz4.decompressFileContent(compressed);
- do_print("Decompressed " + compressed.byteLength + " bytes into " +
- decompressed.byteLength);
-
- do_check_true(compare_arrays(array, decompressed));
- }
-});
diff --git a/toolkit/components/lz4/tests/xpcshell/xpcshell.ini b/toolkit/components/lz4/tests/xpcshell/xpcshell.ini
deleted file mode 100644
index e457f29b2..000000000
--- a/toolkit/components/lz4/tests/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,11 +0,0 @@
-[DEFAULT]
-head =
-tail =
-skip-if = toolkit == 'android'
-support-files =
- data/worker_lz4.js
- data/chrome.manifest
- data/compression.lz
-
-[test_lz4.js]
-[test_lz4_sync.js]
diff --git a/toolkit/components/mediasniffer/moz.build b/toolkit/components/mediasniffer/moz.build
index d4f935f56..21be451dd 100644
--- a/toolkit/components/mediasniffer/moz.build
+++ b/toolkit/components/mediasniffer/moz.build
@@ -4,11 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
-
-EXPORTS += [
- 'nsMediaSniffer.h',
-]
+EXPORTS += ['nsMediaSniffer.h']
UNIFIED_SOURCES += [
'mp3sniff.c',
@@ -17,6 +13,3 @@ UNIFIED_SOURCES += [
]
FINAL_LIBRARY = 'xul'
-
-with Files('**'):
- BUG_COMPONENT = ('Core', 'Video/Audio')
diff --git a/toolkit/components/mediasniffer/test/unit/.eslintrc.js b/toolkit/components/mediasniffer/test/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/mediasniffer/test/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/mediasniffer/test/unit/data/bug1079747.mp4 b/toolkit/components/mediasniffer/test/unit/data/bug1079747.mp4
deleted file mode 100644
index f00731d7e..000000000
--- a/toolkit/components/mediasniffer/test/unit/data/bug1079747.mp4
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/mediasniffer/test/unit/data/detodos.mp3 b/toolkit/components/mediasniffer/test/unit/data/detodos.mp3
deleted file mode 100644
index 12e3f89c2..000000000
--- a/toolkit/components/mediasniffer/test/unit/data/detodos.mp3
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/mediasniffer/test/unit/data/ff-inst.exe b/toolkit/components/mediasniffer/test/unit/data/ff-inst.exe
deleted file mode 100644
index 0f02f36e1..000000000
--- a/toolkit/components/mediasniffer/test/unit/data/ff-inst.exe
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/mediasniffer/test/unit/data/file.mkv b/toolkit/components/mediasniffer/test/unit/data/file.mkv
deleted file mode 100644
index 4618cda03..000000000
--- a/toolkit/components/mediasniffer/test/unit/data/file.mkv
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/mediasniffer/test/unit/data/file.webm b/toolkit/components/mediasniffer/test/unit/data/file.webm
deleted file mode 100644
index 7bc738b8b..000000000
--- a/toolkit/components/mediasniffer/test/unit/data/file.webm
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/mediasniffer/test/unit/data/fl10.mp2 b/toolkit/components/mediasniffer/test/unit/data/fl10.mp2
deleted file mode 100644
index bf84d7367..000000000
--- a/toolkit/components/mediasniffer/test/unit/data/fl10.mp2
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/mediasniffer/test/unit/data/he_free.mp3 b/toolkit/components/mediasniffer/test/unit/data/he_free.mp3
deleted file mode 100644
index e3da8e6a7..000000000
--- a/toolkit/components/mediasniffer/test/unit/data/he_free.mp3
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/mediasniffer/test/unit/data/id3tags.mp3 b/toolkit/components/mediasniffer/test/unit/data/id3tags.mp3
deleted file mode 100644
index 23091e666..000000000
--- a/toolkit/components/mediasniffer/test/unit/data/id3tags.mp3
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/mediasniffer/test/unit/data/notags-bad.mp3 b/toolkit/components/mediasniffer/test/unit/data/notags-bad.mp3
deleted file mode 100644
index 5ad89786f..000000000
--- a/toolkit/components/mediasniffer/test/unit/data/notags-bad.mp3
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/mediasniffer/test/unit/data/notags-scan.mp3 b/toolkit/components/mediasniffer/test/unit/data/notags-scan.mp3
deleted file mode 100644
index 949b7c468..000000000
--- a/toolkit/components/mediasniffer/test/unit/data/notags-scan.mp3
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/mediasniffer/test/unit/data/notags.mp3 b/toolkit/components/mediasniffer/test/unit/data/notags.mp3
deleted file mode 100644
index c7db94361..000000000
--- a/toolkit/components/mediasniffer/test/unit/data/notags.mp3
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/mediasniffer/test/unit/test_mediasniffer.js b/toolkit/components/mediasniffer/test/unit/test_mediasniffer.js
deleted file mode 100644
index b26d554a8..000000000
--- a/toolkit/components/mediasniffer/test/unit/test_mediasniffer.js
+++ /dev/null
@@ -1,105 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-const PATH = "/file.meh";
-var httpserver = new HttpServer();
-
-// Each time, the data consist in a string that should be sniffed as Ogg.
-const data = "OggS\0meeeh.";
-var testRan = 0;
-
-// If the content-type is not present, or if it's application/octet-stream, it
-// should be sniffed to application/ogg by the media sniffer. Otherwise, it
-// should not be changed.
-const tests = [
- // Those three first case are the case of a media loaded in a media element.
- // All three should be sniffed.
- { contentType: "",
- expectedContentType: "application/ogg",
- flags: Ci.nsIChannel.LOAD_CALL_CONTENT_SNIFFERS | Ci.nsIChannel.LOAD_MEDIA_SNIFFER_OVERRIDES_CONTENT_TYPE },
- { contentType: "application/octet-stream",
- expectedContentType: "application/ogg",
- flags: Ci.nsIChannel.LOAD_CALL_CONTENT_SNIFFERS | Ci.nsIChannel.LOAD_MEDIA_SNIFFER_OVERRIDES_CONTENT_TYPE },
- { contentType: "application/something",
- expectedContentType: "application/ogg",
- flags: Ci.nsIChannel.LOAD_CALL_CONTENT_SNIFFERS | Ci.nsIChannel.LOAD_MEDIA_SNIFFER_OVERRIDES_CONTENT_TYPE },
- // This last cases test the case of a channel opened while allowing content
- // sniffers to override the content-type, like in the docshell.
- { contentType: "application/octet-stream",
- expectedContentType: "application/ogg",
- flags: Ci.nsIChannel.LOAD_CALL_CONTENT_SNIFFERS },
- { contentType: "",
- expectedContentType: "application/ogg",
- flags: Ci.nsIChannel.LOAD_CALL_CONTENT_SNIFFERS },
- { contentType: "application/something",
- expectedContentType: "application/something",
- flags: Ci.nsIChannel.LOAD_CALL_CONTENT_SNIFFERS },
-];
-
-// A basic listener that reads checks the if we sniffed properly.
-var listener = {
- onStartRequest: function(request, context) {
- do_check_eq(request.QueryInterface(Ci.nsIChannel).contentType,
- tests[testRan].expectedContentType);
- },
-
- onDataAvailable: function(request, context, stream, offset, count) {
- try {
- var bis = Components.classes["@mozilla.org/binaryinputstream;1"]
- .createInstance(Components.interfaces.nsIBinaryInputStream);
- bis.setInputStream(stream);
- bis.readByteArray(bis.available());
- } catch (ex) {
- do_throw("Error in onDataAvailable: " + ex);
- }
- },
-
- onStopRequest: function(request, context, status) {
- testRan++;
- runNext();
- }
-};
-
-function setupChannel(url, flags)
-{
- let uri = "http://localhost:" +
- httpserver.identity.primaryPort + url;
- var chan = NetUtil.newChannel({
- uri: uri,
- loadUsingSystemPrincipal: true,
- contentPolicyType: Ci.nsIContentPolicy.TYPE_MEDIA
- });
- chan.loadFlags |= flags;
- var httpChan = chan.QueryInterface(Components.interfaces.nsIHttpChannel);
- return httpChan;
-}
-
-function runNext() {
- if (testRan == tests.length) {
- do_test_finished();
- return;
- }
- var channel = setupChannel(PATH, tests[testRan].flags);
- httpserver.registerPathHandler(PATH, function(request, response) {
- response.setHeader("Content-Type", tests[testRan].contentType, false);
- response.bodyOutputStream.write(data, data.length);
- });
- channel.asyncOpen2(listener);
-}
-
-function run_test() {
- httpserver.start(-1);
- do_test_pending();
- try {
- runNext();
- } catch (e) {
- print("ERROR - " + e + "\n");
- }
-}
diff --git a/toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js b/toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js
deleted file mode 100644
index ce30a5c1b..000000000
--- a/toolkit/components/mediasniffer/test/unit/test_mediasniffer_ext.js
+++ /dev/null
@@ -1,122 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cc = Components.classes;
-var CC = Components.Constructor;
-
-var BinaryOutputStream = CC("@mozilla.org/binaryoutputstream;1",
- "nsIBinaryOutputStream",
- "setOutputStream");
-
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-var httpserver = new HttpServer();
-
-var testRan = 0;
-
-// The tests files we want to test, and the type we should have after sniffing.
-const tests = [
- // Real webm and mkv files truncated to 512 bytes.
- { path: "data/file.webm", expected: "video/webm" },
- { path: "data/file.mkv", expected: "application/octet-stream" },
- // MP3 files with and without id3 headers truncated to 512 bytes.
- // NB these have 208/209 byte frames, but mp3 can require up to
- // 1445 bytes to detect with our method.
- { path: "data/id3tags.mp3", expected: "audio/mpeg" },
- { path: "data/notags.mp3", expected: "audio/mpeg" },
- // MPEG-2 mp3 files.
- { path: "data/detodos.mp3", expected: "audio/mpeg" },
- // Padding bit flipped in the first header: sniffing should fail.
- { path: "data/notags-bad.mp3", expected: "application/octet-stream" },
- // Garbage before header: sniffing should fail.
- { path: "data/notags-scan.mp3", expected: "application/octet-stream" },
- // VBR from the layer III test patterns. We can't sniff this.
- { path: "data/he_free.mp3", expected: "application/octet-stream" },
- // Make sure we reject mp2, which has a similar header.
- { path: "data/fl10.mp2", expected: "application/octet-stream" },
- // Truncated ff installer regression test for bug 875769.
- { path: "data/ff-inst.exe", expected: "application/octet-stream" },
- // MP4 with invalid box size (0) for "ftyp".
- { path: "data/bug1079747.mp4", expected: "application/octet-stream" },
-];
-
-// A basic listener that reads checks the if we sniffed properly.
-var listener = {
- onStartRequest: function(request, context) {
- do_print("Sniffing " + tests[testRan].path);
- do_check_eq(request.QueryInterface(Ci.nsIChannel).contentType, tests[testRan].expected);
- },
-
- onDataAvailable: function(request, context, stream, offset, count) {
- try {
- var bis = Components.classes["@mozilla.org/binaryinputstream;1"]
- .createInstance(Components.interfaces.nsIBinaryInputStream);
- bis.setInputStream(stream);
- bis.readByteArray(bis.available());
- } catch (ex) {
- do_throw("Error in onDataAvailable: " + ex);
- }
- },
-
- onStopRequest: function(request, context, status) {
- testRan++;
- runNext();
- }
-};
-
-function setupChannel(url) {
- var chan = NetUtil.newChannel({
- uri: "http://localhost:" + httpserver.identity.primaryPort + url,
- loadUsingSystemPrincipal: true,
- contentPolicyType: Ci.nsIContentPolicy.TYPE_MEDIA
- });
- var httpChan = chan.QueryInterface(Components.interfaces.nsIHttpChannel);
- return httpChan;
-}
-
-function runNext() {
- if (testRan == tests.length) {
- do_test_finished();
- return;
- }
- var channel = setupChannel("/");
- channel.asyncOpen2(listener);
-}
-
-function getFileContents(aFile) {
- var fileStream = Cc["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Ci.nsIFileInputStream);
- fileStream.init(aFile, 1, -1, null);
- var bis = Components.classes["@mozilla.org/binaryinputstream;1"]
- .createInstance(Components.interfaces.nsIBinaryInputStream);
- bis.setInputStream(fileStream);
-
- var data = bis.readByteArray(bis.available());
-
- return data;
-}
-
-function handler(metadata, response) {
- response.setStatusLine(metadata.httpVersion, 200, "OK");
- // Send an empty Content-Type, so we are guaranteed to sniff.
- response.setHeader("Content-Type", "", false);
- var body = getFileContents(do_get_file(tests[testRan].path));
- var bos = new BinaryOutputStream(response.bodyOutputStream);
- bos.writeByteArray(body, body.length);
-}
-
-function run_test() {
- // We use a custom handler so we can change the header to force sniffing.
- httpserver.registerPathHandler("/", handler);
- httpserver.start(-1);
- do_test_pending();
- try {
- runNext();
- } catch (e) {
- print("ERROR - " + e + "\n");
- }
-}
diff --git a/toolkit/components/mediasniffer/test/unit/xpcshell.ini b/toolkit/components/mediasniffer/test/unit/xpcshell.ini
deleted file mode 100644
index 5ab4763f9..000000000
--- a/toolkit/components/mediasniffer/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,19 +0,0 @@
-[DEFAULT]
-head =
-tail =
-skip-if = toolkit == 'android'
-support-files =
- data/bug1079747.mp4
- data/detodos.mp3
- data/ff-inst.exe
- data/file.mkv
- data/file.webm
- data/fl10.mp2
- data/he_free.mp3
- data/id3tags.mp3
- data/notags-bad.mp3
- data/notags-scan.mp3
- data/notags.mp3
-
-[test_mediasniffer.js]
-[test_mediasniffer_ext.js]
diff --git a/toolkit/components/microformats/manifest.ini b/toolkit/components/microformats/manifest.ini
deleted file mode 100644
index 24dbcb1ca..000000000
--- a/toolkit/components/microformats/manifest.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[DEFAULT]
-run-if = buildapp == 'browser'
-
-[test/marionette/test_standards.py]
-[test/marionette/test_modules.py]
-[test/marionette/test_interface.py]
-
diff --git a/toolkit/components/microformats/moz.build b/toolkit/components/microformats/moz.build
index 39cefe4c8..ca91e2c46 100644
--- a/toolkit/components/microformats/moz.build
+++ b/toolkit/components/microformats/moz.build
@@ -4,9 +4,4 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-EXTRA_JS_MODULES += [
- 'microformat-shiv.js'
-]
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Microformats')
+EXTRA_JS_MODULES += ['microformat-shiv.js']
diff --git a/toolkit/components/microformats/test/interface-tests/count-test.js b/toolkit/components/microformats/test/interface-tests/count-test.js
deleted file mode 100644
index baac56c2b..000000000
--- a/toolkit/components/microformats/test/interface-tests/count-test.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
-Unit test for count
-*/
-
-assert = chai.assert;
-
-
-describe('Microformat.count', function() {
-
- it('count', function(){
-
- var doc,
- node,
- result;
-
- var html = '<a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a><a class="h-card" href="http://janedoe.net"><span class="p-name">Jane</span></a><a class="h-event" href="http://janedoe.net"><span class="p-name">Event</span><span class="dt-start">2015-07-01</span></a>';
-
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = html;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- };
-
- result = Microformats.count(options);
- assert.deepEqual( result, {'h-event': 1,'h-card': 2} );
-
- });
-
-
- it('count rels', function(){
-
- var doc,
- node,
- result;
-
- var html = '<link href="http://glennjones.net/notes/atom" rel="notes alternate" title="Notes" type="application/atom+xml" /><a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a><a class="h-card" href="http://janedoe.net"><span class="p-name">Jane</span></a><a class="h-event" href="http://janedoe.net"><span class="p-name">Event</span><span class="dt-start">2015-07-01</span></a>';
-
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = html;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- };
-
- result = Microformats.count(options);
- assert.deepEqual( result, {'h-event': 1,'h-card': 2, 'rels': 1} );
-
- });
-
-
- it('count - no results', function(){
-
- var doc,
- node,
- result;
-
- var html = '<span class="p-name">Jane</span>';
-
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = html;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- };
-
- result = Microformats.count(options);
- assert.deepEqual( result, {} );
-
- });
-
-
-
- it('count - no options', function(){
-
- var result;
-
- result = Microformats.count({});
- assert.deepEqual( result, {} );
-
- });
-
-
- it('count - options.html', function(){
-
- var options = {},
- result;
-
- options.html = '<a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a><a class="h-card" href="http://janedoe.net"><span class="p-name">Jane</span></a><a class="h-event" href="http://janedoe.net"><span class="p-name">Event</span><span class="dt-start">2015-07-01</span></a>';
-
- result = Microformats.count(options);
- assert.deepEqual( result, {'h-event': 1,'h-card': 2} );
-
- });
-
-
-
- });
diff --git a/toolkit/components/microformats/test/interface-tests/experimental-test.js b/toolkit/components/microformats/test/interface-tests/experimental-test.js
deleted file mode 100644
index 4d32b83c0..000000000
--- a/toolkit/components/microformats/test/interface-tests/experimental-test.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
-Unit test for get
-*/
-
-assert = chai.assert;
-
-
-describe('experimental', function() {
-
- it('h-geo - geo data writen as lat;lon', function(){
-
- var expected = {
- 'items': [{
- 'type': ['h-geo'],
- 'properties': {
- 'name': ['30.267991;-97.739568'],
- 'latitude': [30.267991],
- 'longitude': [-97.739568]
- }
- }],
- 'rels': {},
- 'rel-urls': {}
- },
- options = {
- 'html': '<div class="h-geo">30.267991;-97.739568</div>',
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5',
- 'parseLatLonGeo': true
- };
-
- var result = Microformats.get(options);
- assert.deepEqual( result, expected );
-
- });
-
-
-});
diff --git a/toolkit/components/microformats/test/interface-tests/get-test.js b/toolkit/components/microformats/test/interface-tests/get-test.js
deleted file mode 100644
index 098ff4e3d..000000000
--- a/toolkit/components/microformats/test/interface-tests/get-test.js
+++ /dev/null
@@ -1,605 +0,0 @@
-/*
-Unit test for get
-*/
-
-assert = chai.assert;
-
-
-describe('Microformat.get', function() {
-
-
- var expected = {
- 'items': [{
- 'type': ['h-card'],
- 'properties': {
- 'name': ['Glenn Jones'],
- 'url': ['http://glennjones.net']
- }
- }],
- 'rels': {
- 'bookmark': ['http://glennjones.net'],
- 'alternate': ['http://example.com/fr'],
- 'home': ['http://example.com/fr']
- },
- 'rel-urls': {
- 'http://glennjones.net': {
- 'text': 'Glenn Jones',
- 'rels': ['bookmark']
- },
- 'http://example.com/fr': {
- 'media': 'handheld',
- 'hreflang': 'fr',
- 'text': 'French mobile homepage',
- 'rels': ['alternate', 'home']
- }
- }
- },
- html = '<div class="h-card"><a class="p-name u-url" rel="bookmark" href="http://glennjones.net">Glenn Jones</a></div><a rel="alternate home" href="http://example.com/fr" media="handheld" hreflang="fr">French mobile homepage</a>';
-
-
-
-
-
- it('get - no options.node parse this document', function(){
- var result;
-
- result = Microformats.get({});
- assert.deepEqual( result.items, [] );
- });
-
-
- it('get - standard', function(){
-
- var doc,
- node,
- options,
- result;
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = html;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.deepEqual( result, expected );
-
- });
-
-
- it('get - doc pass to node', function(){
-
- var doc,
- node,
- options,
- result;
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = html;
- doc.body.appendChild(node);
-
- options ={
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.deepEqual( result, expected );
-
- });
-
-
- it('get - pass base tag', function(){
-
- var doc,
- node,
- options,
- result;
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = html + '<base href="http://example.com">';
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.deepEqual( result, expected );
-
- });
-
-
- it('get - pass no document', function(){
-
- var doc,
- node,
- options,
- parser,
- result;
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = html + '<base href="http://example.com">';
- doc.body.appendChild(node);
-
- options ={
- 'node': doc,
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.deepEqual( result, expected );
-
- });
-
-
- it('get - textFormat: normalised', function(){
-
- var doc,
- node,
- options,
- result;
-
- var altHTML = '<a class="h-card" href="http://glennjones.net">\n';
- altHTML += ' <span class="p-given-name">Glenn</span>\n';
- altHTML += ' <span class="p-family-name">Jones</span>\n';
- altHTML += '</a>\n';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'textFormat': 'normalised',
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.equal( result.items[0].properties.name[0], 'Glenn Jones' );
-
- });
-
-
- it('get - textFormat: whitespace', function(){
-
- var doc,
- node,
- options,
- parser,
- result;
-
- var altHTML = '<a class="h-card" href="http://glennjones.net">\n';
- altHTML += ' <span class="p-given-name">Glenn</span>\n';
- altHTML += ' <span class="p-family-name">Jones</span>\n';
- altHTML += '</a>\n';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'textFormat': 'whitespace',
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.equal( result.items[0].properties.name[0], '\n Glenn\n Jones\n' );
-
- });
-
-
-
- it('get - textFormat: whitespacetrimmed', function(){
-
- var doc,
- node,
- options,
- result;
-
- var altHTML = '<a class="h-card" href="http://glennjones.net">\n';
- altHTML += ' <span class="p-given-name">Glenn</span>\n';
- altHTML += ' <span class="p-family-name">Jones</span>\n';
- altHTML += '</a>\n';
-
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'textFormat': 'whitespacetrimmed',
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.equal( result.items[0].properties.name[0], 'Glenn\n Jones' );
-
- });
-
-
- it('get - dateFormat: auto', function(){
-
- var doc,
- node,
- options,
- result;
-
- var altHTML = '<div class="h-event"><span class="p-name">Pub</span><span class="dt-start">2015-07-01t17:30z</span></div>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'dateFormat': 'auto'
- };
-
- result = Microformats.get(options);
- assert.equal( result.items[0].properties.start[0], '2015-07-01t17:30z' );
-
- });
-
-
- it('get - dateFormat: w3c', function(){
-
- var doc,
- node,
- options,
- result;
-
- var altHTML = '<div class="h-event"><span class="p-name">Pub</span><span class="dt-start">2015-07-01t17:30z</span></div>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'dateFormat': 'w3c'
- };
-
- result = Microformats.get(options);
- assert.equal( result.items[0].properties.start[0], '2015-07-01T17:30Z' );
-
- });
-
-
- it('get - dateFormat: html5', function(){
-
- var doc,
- node,
- options,
- result;
-
- var altHTML = '<div class="h-event"><span class="p-name">Pub</span><span class="dt-start">2015-07-01t17:30z</span></div>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.equal( result.items[0].properties.start[0], '2015-07-01 17:30Z' );
-
- });
-
-
-
- it('get - dateFormat: rfc3339', function(){
-
- var doc,
- node,
- options,
-
- result;
-
- var altHTML = '<div class="h-event"><span class="p-name">Pub</span><span class="dt-start">2015-07-01t17:30z</span></div>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'dateFormat': 'rfc3339'
- };
-
- result = Microformats.get(options);
- assert.equal( result.items[0].properties.start[0], '20150701T1730Z' );
-
- });
-
-
-
- it('get - filters h-card', function(){
-
- var doc,
- node,
- options,
- parser,
- result;
-
- var altHTML = '<div class="h-event"><span class="p-name">Pub</span><span class="dt-start">2015-07-01t17:30z</span></div><a class="h-card" href="http://glennjones.net">Glenn Jones</a>';
- var altExpected = {
- 'items': [{
- 'type': ['h-card'],
- 'properties': {
- 'name': ['Glenn Jones'],
- 'url': ['http://glennjones.net']
- }
- }],
- 'rels': {},
- 'rel-urls': {}
- }
-
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
-
- // filter as an array
- options ={
- 'node': node,
- 'filters': ['h-card'],
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.deepEqual( result, altExpected );
-
- // filter as an string
- options ={
- 'node': node,
- 'filters': 'h-card',
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.deepEqual( result, altExpected );
- });
-
-
- it('get - filters h-event', function(){
-
- var doc,
- node,
- options,
- result;
-
- var altHTML = '<div class="h-event"><span class="p-name">Pub</span><span class="dt-start">2015-07-01t17:30z</span></div><a class="h-card" href="http://glennjones.net">Glenn Jones</a>';
- var altExpected = {
- 'items': [{
- 'type': ['h-event'],
- 'properties': {
- 'name': ['Pub'],
- 'start': ['2015-07-01 17:30Z']
- }
- }],
- 'rels': {},
- 'rel-urls': {}
- }
-
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'filters': ['h-event'],
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.deepEqual( result, altExpected );
-
- });
-
-
- it('get - filters h-card and h-event', function(){
-
- var doc,
- node,
- options,
- result;
-
- var altHTML = '<div class="h-event"><span class="p-name">Pub</span><span class="dt-start">2015-07-01t17:30z</span></div><a class="h-card" href="http://glennjones.net">Glenn Jones</a>';
- var altExpected = {
- 'items': [{
- 'type': ['h-event'],
- 'properties': {
- 'name': ['Pub'],
- 'start': ['2015-07-01 17:30Z']
- }
- },
- {
- 'type': ['h-card'],
- 'properties': {
- 'name': ['Glenn Jones'],
- 'url': ['http://glennjones.net']
- }
- }],
- 'rels': {},
- 'rel-urls': {}
- }
-
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'filter': ['h-event'],
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.deepEqual( result, altExpected );
-
- });
-
-
- it('get - filters h-card no result', function(){
-
- var doc,
- node,
- options,
- result;
-
- var altHTML = '<div class="h-event"><span class="p-name">Pub</span><span class="dt-start">2015-07-01t17:30z</span></div>';
- var altExpected = {
- 'items': [],
- 'rels': {},
- 'rel-urls': {}
- }
-
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'filters': ['h-card'],
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.deepEqual( result, altExpected );
-
- });
-
-
- it('get - filters h-card match v1 format', function(){
-
- var doc,
- node,
- options,
- parser,
- result;
-
- var altHTML = '<a class="vcard" href="http://glennjones.net"><span class="fn">Glenn Jones</span></a>';
- var altExpected = {
- 'items': [{
- 'type': ['h-card'],
- 'properties': {
- 'name': ['Glenn Jones']
- }
- }],
- 'rels': {},
- 'rel-urls': {}
- }
-
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'filter': ['h-card'],
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.deepEqual( result, altExpected );
-
- });
-
-
- it('get - add new v1 format through options', function(){
-
- var doc,
- node,
- options,
- result;
-
- var altHTML = '<div class="hpayment">£<span class="amount">36.78</span></div>';
- var altExpected = {
- 'items': [{
- 'type': ['h-payment'],
- 'properties': {
- 'amount': ['36.78']
- }
- }],
- 'rels': {},
- 'rel-urls': {}
- };
- var v1Definition = {
- root: 'hpayment',
- name: 'h-payment',
- properties: {
- 'amount': {}
- }
- };
-
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
-
- options ={
- 'node': node,
- 'maps': v1Definition,
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.deepEqual( result, altExpected );
-
- });
-
-
- it('get - options.html', function(){
-
- var options,
- result;
-
- options ={
- 'html': html,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
-
- result = Microformats.get(options);
- assert.deepEqual( result, expected );
-
- });
-
-
-
-
-
-});
diff --git a/toolkit/components/microformats/test/interface-tests/getParent-test.js b/toolkit/components/microformats/test/interface-tests/getParent-test.js
deleted file mode 100644
index 56ccbb2ba..000000000
--- a/toolkit/components/microformats/test/interface-tests/getParent-test.js
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
-Unit test for getParent
-*/
-
-assert = chai.assert;
-
-
-describe('Microformat.getParent', function() {
-
- var HTML = '<div class="h-event"><span class="p-name">Pub</span><span class="dt-start">2015-07-01t17:30z</span></div>';
- var emptyExpected = {
- "items": [],
- "rels": {},
- "rel-urls": {}
- };
- var expected = {
- "items": [
- {
- "type": [
- "h-event"
- ],
- "properties": {
- "name": [
- "Pub"
- ],
- "start": [
- "2015-07-01 17:30Z"
- ]
- }
- }
- ],
- "rels": {},
- "rel-urls": {}
- };
- var options = {'dateFormat': 'html5'};
-
-
-
-
- it('getParent with parent', function(){
-
- var doc,
- node,
- span,
- result;
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = HTML;
- doc.body.appendChild(node);
- span = doc.querySelector('.dt-start');
-
- result = Microformats.getParent(span,options);
- assert.deepEqual( result, expected );
-
- });
-
-
-
- it('getParent without parent', function(){
-
- var doc,
- node,
- parser,
- result;
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = HTML;
- doc.body.appendChild(node);
-
- result = Microformats.getParent(node,options);
- assert.deepEqual( result, emptyExpected );
-
- });
-
-
- it('getParent found with option.filters', function(){
-
- var doc,
- node,
- span,
- result;
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = HTML;
- doc.body.appendChild(node);
- span = doc.querySelector('.dt-start');
-
- result = Microformats.getParent( span, {'filters': ['h-event'], 'dateFormat': 'html5'} );
- assert.deepEqual( result, expected );
-
- });
-
-
- it('getParent not found with option.filters', function(){
-
- var doc,
- node,
- span,
- result;
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = HTML;
- doc.body.appendChild(node);
- span = doc.querySelector('.dt-start');
-
- result = Microformats.getParent( span, {'filters': ['h-card'], 'dateFormat': 'html5'} );
- assert.deepEqual( result, emptyExpected );
-
- });
-
-
- it('getParent use option.filters to up through h-*', function(){
-
- var doc,
- node,
- span,
- result;
-
- var altHTML = '<div class="h-entry"><h1 class="p-name">test</h1><div class="e-content">this</div><a class="p-author h-card" href="http://glennjones.net"><span class="p-name">Glenn Jones</span></a><span class="dt-publish">2015-07-01t17:30z</span></div>';
- var altExpected = {
- "items": [
- {
- "type": [
- "h-entry"
- ],
- "properties": {
- "name": [
- "test"
- ],
- "content": [
- {
- "value": "this",
- "html": "this"
- }
- ],
- "author": [
- {
- "value": "Glenn Jones",
- "type": [
- "h-card"
- ],
- "properties": {
- "name": [
- "Glenn Jones"
- ],
- "url": [
- "http://glennjones.net"
- ]
- }
- }
- ],
- "publish": [
- "2015-07-01 17:30Z"
- ]
- }
- }
- ],
- "rels": {},
- "rel-urls": {}
- };
-
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
- span = doc.querySelector('.h-card .p-name');
-
- result = Microformats.getParent( span, {'filters': ['h-entry'], 'dateFormat': 'html5'} );
- assert.deepEqual( result, altExpected );
-
- });
-
-
- it('getParent stop at first h-* parent', function(){
-
- var doc,
- node,
- span,
- result;
-
- var altHTML = '<div class="h-entry"><h1 class="p-name">test</h1><div class="e-content">this</div><a class="p-author h-card" href="http://glennjones.net"><span class="p-name">Glenn Jones</span></a><span class="dt-publish">2015-07-01t17:30z</span></div>';
- var altExpected = {
- "items": [
- {
- "type": [
- "h-card"
- ],
- "properties": {
- "name": [
- "Glenn Jones"
- ],
- "url": [
- "http://glennjones.net"
- ]
- }
- }
- ],
- "rels": {},
- "rel-urls": {}
- };
-
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- node.innerHTML = altHTML;
- doc.body.appendChild(node);
- span = doc.querySelector('.h-card .p-name');
-
- result = Microformats.getParent( span, options );
- assert.deepEqual( result, altExpected );
-
- });
-
-
-});
diff --git a/toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js b/toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js
deleted file mode 100644
index 98c79a855..000000000
--- a/toolkit/components/microformats/test/interface-tests/hasMicroformats-test.js
+++ /dev/null
@@ -1,185 +0,0 @@
-/*
-Unit test for hasMicroformat
-*/
-
-assert = chai.assert;
-
-
-describe('Microformat.hasMicroformats', function() {
-
- it('true - v2 on node', function(){
-
- var doc,
- node;
-
- var html = '<a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isTrue( Microformats.hasMicroformats( node ) );
-
- });
-
-
- it('true - v1 on node', function(){
-
- var doc,
- node;
-
- var html = '<a class="vcard" href="http://glennjones.net"><span class="fn">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isTrue( Microformats.hasMicroformats( node ) );
-
- });
-
-
- it('true - v2 filter on node', function(){
-
- var doc,
- node;
-
- var html = '<a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isTrue( Microformats.hasMicroformats( node, {'filters': ['h-card']} ) );
-
- });
-
-
- it('true - v1 filter on node', function(){
-
- var doc,
- node;
-
- var html = '<a class="vcard" href="http://glennjones.net"><span class="fn">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isTrue( Microformats.hasMicroformats( node, {'filters': ['h-card']} ) );
-
- });
-
-
- it('false - v2 filter on node', function(){
-
- var doc,
- node;
-
- var html = '<a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isFalse( Microformats.hasMicroformats( node, {'filters': ['h-entry']} ) );
-
- });
-
-
-
- it('false - property', function(){
-
- var doc,
- node,
- parser;
-
- var html = '<span class="p-name">Glenn</span>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'span' );
-
- assert.isFalse( Microformats.hasMicroformats( node ) );
-
- });
-
-
- it('false - no class', function(){
-
- var doc,
- node,
- parser;
-
- var html = '<span>Glenn</span>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'span' );
-
- assert.isFalse( Microformats.hasMicroformats( node ) );
-
- });
-
-
- it('false - no node', function(){
- assert.isFalse( Microformats.hasMicroformats( ) );
- });
-
-
- it('false - undefined node', function(){
- assert.isFalse( Microformats.hasMicroformats( undefined ) );
- });
-
-
- it('true - child', function(){
-
- var doc,
- node;
-
- var html = '<section><div><a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a></div></section>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
-
- assert.isTrue( Microformats.hasMicroformats( node ) );
-
- });
-
-
-
- it('true - document', function(){
-
- var doc,
- node;
-
- var html = '<html><head></head><body><section><div><a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a></div></section></body></html>';
-
- var dom = new DOMParser();
- doc = dom.parseFromString( html, 'text/html' );
-
- assert.isTrue( Microformats.hasMicroformats( doc ) );
-
- });
-
-
-
-
-
- });
diff --git a/toolkit/components/microformats/test/interface-tests/index.html b/toolkit/components/microformats/test/interface-tests/index.html
deleted file mode 100644
index 61759790e..000000000
--- a/toolkit/components/microformats/test/interface-tests/index.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<html><head><title>Mocha</title>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" href="../static/css/mocha.css" />
-<script src="../static/javascript/chai.js"></script>
-<script src="../static/javascript/mocha.js"></script>
-<link rel="stylesheet" href="../static/css/mocha-custom.css" />
-<link rel="icon" type="image/png" id="favicon" href="chrome://branding/content/icon32.png"/>
-
-<script src="../static/javascript/DOMParser.js"></script>
-
-<script data-cover src="../../microformat-shiv.js"></script>
-
-<script>
-var uncaughtError;
-
-window.addEventListener("error", function(error) {
-uncaughtError = error;
-});
-
-var consoleWarn = console.warn;
-var caughtWarnings = [];
-
-console.warn = function() {
-var args = Array.slice(arguments);
-caughtWarnings.push(args);
-consoleWarn.apply(console, args);
-};
-</script>
-
-<script>
-chai.config.includeStack = true;
-mocha.setup({ui: 'bdd', timeout: 10000});
-</script>
-
-
-<script src="../interface-tests/get-test.js"></script>
-<script src="../interface-tests/getParent-test.js"></script>
-<script src="../interface-tests/count-test.js"></script>
-<script src="../interface-tests/isMicroformat-test.js"></script>
-<script src="../interface-tests/hasMicroformats-test.js"></script>
-
-<script src="../interface-tests/experimental-test.js"></script>
-
-</head><body>
-<h3 class="capitalize">Microformats-shiv: interface tests</h3>
-<div id="mocha"></div>
-</body>
-<script>
-describe("Uncaught Error Check", function() {
-it("should load the tests without errors", function() {
-chai.expect(uncaughtError && uncaughtError.message).to.be.undefined;
-});
-});
-
-describe("Unexpected Warnings Check", function() {
-it("should long only the warnings we expect", function() {
-chai.expect(caughtWarnings.length).to.eql(0);
-});
-});
-
-mocha.run(function () {
-var completeNode = document.createElement("p");
-completeNode.setAttribute("id", "complete");
-completeNode.appendChild(document.createTextNode("Complete"));
-document.getElementById("mocha").appendChild(completeNode);
-});
-
-</script>
-</body></html>
diff --git a/toolkit/components/microformats/test/interface-tests/isMicroformat-test.js b/toolkit/components/microformats/test/interface-tests/isMicroformat-test.js
deleted file mode 100644
index 7081b2880..000000000
--- a/toolkit/components/microformats/test/interface-tests/isMicroformat-test.js
+++ /dev/null
@@ -1,146 +0,0 @@
-/*
-Unit test for isMicroformat
-*/
-
-assert = chai.assert;
-
-
-describe('Microformat.isMicroformat', function() {
-
- it('true - v2', function(){
-
- var doc,
- node;
-
- var html = '<a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isTrue( Microformats.isMicroformat( node ) );
-
- });
-
-
- it('true - v1', function(){
-
- var doc,
- node;
-
- var html = '<a class="vcard" href="http://glennjones.net"><span class="fn">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isTrue( Microformats.isMicroformat( node ) );
-
- });
-
-
- it('true - v2 filter', function(){
-
- var doc,
- node;
-
- var html = '<a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isTrue( Microformats.isMicroformat( node, {'filters': ['h-card']} ) );
-
- });
-
-
- it('true - v1 filter', function(){
-
- var doc,
- node;
-
- var html = '<a class="vcard" href="http://glennjones.net"><span class="fn">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isTrue( Microformats.isMicroformat( node, {'filters': ['h-card']} ) );
-
- });
-
-
- it('false - v2 filter', function(){
-
- var doc,
- node;
-
- var html = '<a class="h-card" href="http://glennjones.net"><span class="p-name">Glenn</span></a>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'a' );
-
- assert.isFalse( Microformats.isMicroformat( node, {'filters': ['h-entry']} ) );
-
- });
-
-
-
- it('false - property', function(){
-
- var doc,
- node;
-
- var html = '<span class="p-name">Glenn</span>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'span' );
-
- assert.isFalse( Microformats.isMicroformat( node ) );
-
- });
-
-
- it('false - no class', function(){
-
- var doc,
- node;
-
- var html = '<span>Glenn</span>';
-
- doc = document.implementation.createHTMLDocument('New Document');
- node = document.createElement('div');
- doc.body.appendChild( node );
- node.innerHTML = html;
- node = doc.querySelector( 'span' );
-
- assert.isFalse( Microformats.isMicroformat( node ) );
-
- });
-
-
- it('false - no node', function(){
- assert.isFalse( Microformats.isMicroformat( ) );
- });
-
-
- it('false - undefined node', function(){
- assert.isFalse( Microformats.isMicroformat( undefined ) );
- });
-
- });
diff --git a/toolkit/components/microformats/test/lib/dates.js b/toolkit/components/microformats/test/lib/dates.js
deleted file mode 100644
index 6d6129b08..000000000
--- a/toolkit/components/microformats/test/lib/dates.js
+++ /dev/null
@@ -1,268 +0,0 @@
-/*!
- dates
- These functions are based on microformats implied rules for parsing date fragments from text.
- They are not generalist date utilities and should only be used with the isodate.js module of this library.
-
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
- Dependencies utilities.js, isodate.js
-*/
-
-
-var Modules = (function (modules) {
-
- modules.dates = {
-
-
- /**
- * does text contain am
- *
- * @param {String} text
- * @return {Boolean}
- */
- hasAM: function( text ) {
- text = text.toLowerCase();
- return(text.indexOf('am') > -1 || text.indexOf('a.m.') > -1);
- },
-
-
- /**
- * does text contain pm
- *
- * @param {String} text
- * @return {Boolean}
- */
- hasPM: function( text ) {
- text = text.toLowerCase();
- return(text.indexOf('pm') > -1 || text.indexOf('p.m.') > -1);
- },
-
-
- /**
- * remove am and pm from text and return it
- *
- * @param {String} text
- * @return {String}
- */
- removeAMPM: function( text ) {
- return text.replace('pm', '').replace('p.m.', '').replace('am', '').replace('a.m.', '');
- },
-
-
- /**
- * simple test of whether ISO date string is a duration i.e. PY17M or PW12
- *
- * @param {String} text
- * @return {Boolean}
- */
- isDuration: function( text ) {
- if(modules.utils.isString( text )){
- text = text.toLowerCase();
- if(modules.utils.startWith(text, 'p') ){
- return true;
- }
- }
- return false;
- },
-
-
- /**
- * is text a time or timezone
- * i.e. HH-MM-SS or z+-HH-MM-SS 08:43 | 15:23:00:0567 | 10:34pm | 10:34 p.m. | +01:00:00 | -02:00 | z15:00 | 0843
- *
- * @param {String} text
- * @return {Boolean}
- */
- isTime: function( text ) {
- if(modules.utils.isString(text)){
- text = text.toLowerCase();
- text = modules.utils.trim( text );
- // start with timezone char
- if( text.match(':') && ( modules.utils.startWith(text, 'z') || modules.utils.startWith(text, '-') || modules.utils.startWith(text, '+') )) {
- return true;
- }
- // has ante meridiem or post meridiem
- if( text.match(/^[0-9]/) &&
- ( this.hasAM(text) || this.hasPM(text) )) {
- return true;
- }
- // contains time delimiter but not datetime delimiter
- if( text.match(':') && !text.match(/t|\s/) ) {
- return true;
- }
-
- // if it's a number of 2, 4 or 6 chars
- if(modules.utils.isNumber(text)){
- if(text.length === 2 || text.length === 4 || text.length === 6){
- return true;
- }
- }
- }
- return false;
- },
-
-
- /**
- * parses a time from text and returns 24hr time string
- * i.e. 5:34am = 05:34:00 and 1:52:04p.m. = 13:52:04
- *
- * @param {String} text
- * @return {String}
- */
- parseAmPmTime: function( text ) {
- var out = text,
- times = [];
-
- // if the string has a text : or am or pm
- if(modules.utils.isString(out)) {
- //text = text.toLowerCase();
- text = text.replace(/[ ]+/g, '');
-
- if(text.match(':') || this.hasAM(text) || this.hasPM(text)) {
-
- if(text.match(':')) {
- times = text.split(':');
- } else {
- // single number text i.e. 5pm
- times[0] = text;
- times[0] = this.removeAMPM(times[0]);
- }
-
- // change pm hours to 24hr number
- if(this.hasPM(text)) {
- if(times[0] < 12) {
- times[0] = parseInt(times[0], 10) + 12;
- }
- }
-
- // add leading zero's where needed
- if(times[0] && times[0].length === 1) {
- times[0] = '0' + times[0];
- }
-
- // rejoin text elements together
- if(times[0]) {
- text = times.join(':');
- }
- }
- }
-
- // remove am/pm strings
- return this.removeAMPM(text);
- },
-
-
- /**
- * overlays a time on a date to return the union of the two
- *
- * @param {String} date
- * @param {String} time
- * @param {String} format ( Modules.ISODate profile format )
- * @return {Object} Modules.ISODate
- */
- dateTimeUnion: function(date, time, format) {
- var isodate = new modules.ISODate(date, format),
- isotime = new modules.ISODate();
-
- isotime.parseTime(this.parseAmPmTime(time), format);
- if(isodate.hasFullDate() && isotime.hasTime()) {
- isodate.tH = isotime.tH;
- isodate.tM = isotime.tM;
- isodate.tS = isotime.tS;
- isodate.tD = isotime.tD;
- return isodate;
- } else {
- if(isodate.hasFullDate()){
- return isodate;
- }
- return new modules.ISODate();
- }
- },
-
-
- /**
- * concatenate an array of date and time text fragments to create an ISODate object
- * used for microformat value and value-title rules
- *
- * @param {Array} arr ( Array of Strings )
- * @param {String} format ( Modules.ISODate profile format )
- * @return {Object} Modules.ISODate
- */
- concatFragments: function (arr, format) {
- var out = new modules.ISODate(),
- i = 0,
- value = '';
-
- // if the fragment already contains a full date just return it once
- if(arr[0].toUpperCase().match('T')) {
- return new modules.ISODate(arr[0], format);
- }else{
- for(i = 0; i < arr.length; i++) {
- value = arr[i];
-
- // date pattern
- if( value.charAt(4) === '-' && out.hasFullDate() === false ){
- out.parseDate(value);
- }
-
- // time pattern
- if( (value.indexOf(':') > -1 || modules.utils.isNumber( this.parseAmPmTime(value) )) && out.hasTime() === false ) {
- // split time and timezone
- var items = this.splitTimeAndZone(value);
- value = items[0];
-
- // parse any use of am/pm
- value = this.parseAmPmTime(value);
- out.parseTime(value);
-
- // parse any timezone
- if(items.length > 1){
- out.parseTimeZone(items[1], format);
- }
- }
-
- // timezone pattern
- if(value.charAt(0) === '-' || value.charAt(0) === '+' || value.toUpperCase() === 'Z') {
- if( out.hasTimeZone() === false ){
- out.parseTimeZone(value);
- }
- }
-
- }
- return out;
-
- }
- },
-
-
- /**
- * parses text by splitting it into an array of time and timezone strings
- *
- * @param {String} text
- * @return {Array} Modules.ISODate
- */
- splitTimeAndZone: function ( text ){
- var out = [text],
- chars = ['-','+','z','Z'],
- i = chars.length;
-
- while (i--) {
- if(text.indexOf(chars[i]) > -1){
- out[0] = text.slice( 0, text.indexOf(chars[i]) );
- out.push( text.slice( text.indexOf(chars[i]) ) );
- break;
- }
- }
- return out;
- }
-
- };
-
-
- return modules;
-
-} (Modules || {}));
-
-
-
-
diff --git a/toolkit/components/microformats/test/lib/domparser.js b/toolkit/components/microformats/test/lib/domparser.js
deleted file mode 100644
index bc342634a..000000000
--- a/toolkit/components/microformats/test/lib/domparser.js
+++ /dev/null
@@ -1,103 +0,0 @@
-
-// Based on https://gist.github.com/1129031 By Eli Grey, http://eligrey.com - Public domain.
-
-// DO NOT use https://developer.mozilla.org/en-US/docs/Web/API/DOMParser example polyfill
-// as it does not work with earlier versions of Chrome
-
-
-(function(DOMParser) {
- 'use strict';
-
- var DOMParser_proto;
- var real_parseFromString;
- var textHTML; // Flag for text/html support
- var textXML; // Flag for text/xml support
- var htmlElInnerHTML; // Flag for support for setting html element's innerHTML
-
- // Stop here if DOMParser not defined
- if (!DOMParser) {
- return;
- }
-
- // Firefox, Opera and IE throw errors on unsupported types
- try {
- // WebKit returns null on unsupported types
- textHTML = !!(new DOMParser()).parseFromString('', 'text/html');
-
- } catch (er) {
- textHTML = false;
- }
-
- // If text/html supported, don't need to do anything.
- if (textHTML) {
- return;
- }
-
- // Next try setting innerHTML of a created document
- // IE 9 and lower will throw an error (can't set innerHTML of its HTML element)
- try {
- var doc = document.implementation.createHTMLDocument('');
- doc.documentElement.innerHTML = '<title></title><div></div>';
- htmlElInnerHTML = true;
-
- } catch (er) {
- htmlElInnerHTML = false;
- }
-
- // If if that failed, try text/xml
- if (!htmlElInnerHTML) {
-
- try {
- textXML = !!(new DOMParser()).parseFromString('', 'text/xml');
-
- } catch (er) {
- textHTML = false;
- }
- }
-
- // Mess with DOMParser.prototype (less than optimal...) if one of the above worked
- // Assume can write to the prototype, if not, make this a stand alone function
- if (DOMParser.prototype && (htmlElInnerHTML || textXML)) {
- DOMParser_proto = DOMParser.prototype;
- real_parseFromString = DOMParser_proto.parseFromString;
-
- DOMParser_proto.parseFromString = function (markup, type) {
-
- // Only do this if type is text/html
- if (/^\s*text\/html\s*(?:;|$)/i.test(type)) {
- var doc, doc_el, first_el;
-
- // Use innerHTML if supported
- if (htmlElInnerHTML) {
- doc = document.implementation.createHTMLDocument('');
- doc_el = doc.documentElement;
- doc_el.innerHTML = markup;
- first_el = doc_el.firstElementChild;
-
- // Otherwise use XML method
- } else if (textXML) {
-
- // Make sure markup is wrapped in HTML tags
- // Should probably allow for a DOCTYPE
- if (!(/^<html.*html>$/i.test(markup))) {
- markup = '<html>' + markup + '<\/html>';
- }
- doc = (new DOMParser()).parseFromString(markup, 'text/xml');
- doc_el = doc.documentElement;
- first_el = doc_el.firstElementChild;
- }
-
- // Is this an entire document or a fragment?
- if (doc_el.childElementCount === 1 && first_el.localName.toLowerCase() === 'html') {
- doc.replaceChild(first_el, doc_el);
- }
-
- return doc;
-
- // If not text/html, send as-is to host method
- } else {
- return real_parseFromString.apply(this, arguments);
- }
- };
- }
-}(DOMParser));
diff --git a/toolkit/components/microformats/test/lib/domutils.js b/toolkit/components/microformats/test/lib/domutils.js
deleted file mode 100644
index 57269de97..000000000
--- a/toolkit/components/microformats/test/lib/domutils.js
+++ /dev/null
@@ -1,611 +0,0 @@
-/*
- dom utilities
- The purpose of this module is to abstract DOM functions away from the main parsing modules of the library.
- It was created so the file can be replaced in node.js environment to make use of different types of light weight node.js DOM's
- such as 'cherrio.js'. It also contains a number of DOM utilities which are used throughout the parser such as: 'getDescendant'
-
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
- Dependencies utilities.js
-
-*/
-
-
-var Modules = (function (modules) {
-
- modules.domUtils = {
-
- // blank objects for DOM
- document: null,
- rootNode: null,
-
-
- /**
- * gets DOMParser object
- *
- * @return {Object || undefined}
- */
- getDOMParser: function () {
- if (typeof DOMParser === undefined) {
- try {
- return Components.classes["@mozilla.org/xmlextras/domparser;1"]
- .createInstance(Components.interfaces.nsIDOMParser);
- } catch (e) {
- return undefined;
- }
- } else {
- return new DOMParser();
- }
- },
-
-
- /**
- * configures what are the base DOM objects for parsing
- *
- * @param {Object} options
- * @return {DOM Node} node
- */
- getDOMContext: function( options ){
-
- // if a node is passed
- if(options.node){
- this.rootNode = options.node;
- }
-
-
- // if a html string is passed
- if(options.html){
- //var domParser = new DOMParser();
- var domParser = this.getDOMParser();
- this.rootNode = domParser.parseFromString( options.html, 'text/html' );
- }
-
-
- // find top level document from rootnode
- if(this.rootNode !== null){
- if(this.rootNode.nodeType === 9){
- this.document = this.rootNode;
- this.rootNode = modules.domUtils.querySelector(this.rootNode, 'html');
- }else{
- // if it's DOM node get parent DOM Document
- this.document = modules.domUtils.ownerDocument(this.rootNode);
- }
- }
-
-
- // use global document object
- if(!this.rootNode && document){
- this.rootNode = modules.domUtils.querySelector(document, 'html');
- this.document = document;
- }
-
-
- if(this.rootNode && this.document){
- return {document: this.document, rootNode: this.rootNode};
- }
-
- return {document: null, rootNode: null};
- },
-
-
-
- /**
- * gets the first DOM node
- *
- * @param {Dom Document}
- * @return {DOM Node} node
- */
- getTopMostNode: function( node ){
- //var doc = this.ownerDocument(node);
- //if(doc && doc.nodeType && doc.nodeType === 9 && doc.documentElement){
- // return doc.documentElement;
- //}
- return node;
- },
-
-
-
- /**
- * abstracts DOM ownerDocument
- *
- * @param {DOM Node} node
- * @return {Dom Document}
- */
- ownerDocument: function(node){
- return node.ownerDocument;
- },
-
-
- /**
- * abstracts DOM textContent
- *
- * @param {DOM Node} node
- * @return {String}
- */
- textContent: function(node){
- if(node.textContent){
- return node.textContent;
- }else if(node.innerText){
- return node.innerText;
- }
- return '';
- },
-
-
- /**
- * abstracts DOM innerHTML
- *
- * @param {DOM Node} node
- * @return {String}
- */
- innerHTML: function(node){
- return node.innerHTML;
- },
-
-
- /**
- * abstracts DOM hasAttribute
- *
- * @param {DOM Node} node
- * @param {String} attributeName
- * @return {Boolean}
- */
- hasAttribute: function(node, attributeName) {
- return node.hasAttribute(attributeName);
- },
-
-
- /**
- * does an attribute contain a value
- *
- * @param {DOM Node} node
- * @param {String} attributeName
- * @param {String} value
- * @return {Boolean}
- */
- hasAttributeValue: function(node, attributeName, value) {
- return (this.getAttributeList(node, attributeName).indexOf(value) > -1);
- },
-
-
- /**
- * abstracts DOM getAttribute
- *
- * @param {DOM Node} node
- * @param {String} attributeName
- * @return {String || null}
- */
- getAttribute: function(node, attributeName) {
- return node.getAttribute(attributeName);
- },
-
-
- /**
- * abstracts DOM setAttribute
- *
- * @param {DOM Node} node
- * @param {String} attributeName
- * @param {String} attributeValue
- */
- setAttribute: function(node, attributeName, attributeValue){
- node.setAttribute(attributeName, attributeValue);
- },
-
-
- /**
- * abstracts DOM removeAttribute
- *
- * @param {DOM Node} node
- * @param {String} attributeName
- */
- removeAttribute: function(node, attributeName) {
- node.removeAttribute(attributeName);
- },
-
-
- /**
- * abstracts DOM getElementById
- *
- * @param {DOM Node || DOM Document} node
- * @param {String} id
- * @return {DOM Node}
- */
- getElementById: function(docNode, id) {
- return docNode.querySelector( '#' + id );
- },
-
-
- /**
- * abstracts DOM querySelector
- *
- * @param {DOM Node || DOM Document} node
- * @param {String} selector
- * @return {DOM Node}
- */
- querySelector: function(docNode, selector) {
- return docNode.querySelector( selector );
- },
-
-
- /**
- * get value of a Node attribute as an array
- *
- * @param {DOM Node} node
- * @param {String} attributeName
- * @return {Array}
- */
- getAttributeList: function(node, attributeName) {
- var out = [],
- attList;
-
- attList = node.getAttribute(attributeName);
- if(attList && attList !== '') {
- if(attList.indexOf(' ') > -1) {
- out = attList.split(' ');
- } else {
- out.push(attList);
- }
- }
- return out;
- },
-
-
- /**
- * gets all child nodes with a given attribute
- *
- * @param {DOM Node} node
- * @param {String} attributeName
- * @return {NodeList}
- */
- getNodesByAttribute: function(node, attributeName) {
- var selector = '[' + attributeName + ']';
- return node.querySelectorAll(selector);
- },
-
-
- /**
- * gets all child nodes with a given attribute containing a given value
- *
- * @param {DOM Node} node
- * @param {String} attributeName
- * @return {DOM NodeList}
- */
- getNodesByAttributeValue: function(rootNode, name, value) {
- var arr = [],
- x = 0,
- i,
- out = [];
-
- arr = this.getNodesByAttribute(rootNode, name);
- if(arr) {
- i = arr.length;
- while(x < i) {
- if(this.hasAttributeValue(arr[x], name, value)) {
- out.push(arr[x]);
- }
- x++;
- }
- }
- return out;
- },
-
-
- /**
- * gets attribute value from controlled list of tags
- *
- * @param {Array} tagNames
- * @param {String} attributeName
- * @return {String || null}
- */
- getAttrValFromTagList: function(node, tagNames, attributeName) {
- var i = tagNames.length;
-
- while(i--) {
- if(node.tagName.toLowerCase() === tagNames[i]) {
- var attrValue = this.getAttribute(node, attributeName);
- if(attrValue && attrValue !== '') {
- return attrValue;
- }
- }
- }
- return null;
- },
-
-
- /**
- * get node if it has no siblings. CSS equivalent is :only-child
- *
- * @param {DOM Node} rootNode
- * @param {Array} tagNames
- * @return {DOM Node || null}
- */
- getSingleDescendant: function(node){
- return this.getDescendant( node, null, false );
- },
-
-
- /**
- * get node if it has no siblings of the same type. CSS equivalent is :only-of-type
- *
- * @param {DOM Node} rootNode
- * @param {Array} tagNames
- * @return {DOM Node || null}
- */
- getSingleDescendantOfType: function(node, tagNames){
- return this.getDescendant( node, tagNames, true );
- },
-
-
- /**
- * get child node limited by presence of siblings - either CSS :only-of-type or :only-child
- *
- * @param {DOM Node} rootNode
- * @param {Array} tagNames
- * @return {DOM Node || null}
- */
- getDescendant: function( node, tagNames, onlyOfType ){
- var i = node.children.length,
- countAll = 0,
- countOfType = 0,
- child,
- out = null;
-
- while(i--) {
- child = node.children[i];
- if(child.nodeType === 1) {
- if(tagNames){
- // count just only-of-type
- if(this.hasTagName(child, tagNames)){
- out = child;
- countOfType++;
- }
- }else{
- // count all elements
- out = child;
- countAll++;
- }
- }
- }
- if(onlyOfType === true){
- return (countOfType === 1)? out : null;
- }else{
- return (countAll === 1)? out : null;
- }
- },
-
-
- /**
- * is a node one of a list of tags
- *
- * @param {DOM Node} rootNode
- * @param {Array} tagNames
- * @return {Boolean}
- */
- hasTagName: function(node, tagNames){
- var i = tagNames.length;
- while(i--) {
- if(node.tagName.toLowerCase() === tagNames[i]) {
- return true;
- }
- }
- return false;
- },
-
-
- /**
- * abstracts DOM appendChild
- *
- * @param {DOM Node} node
- * @param {DOM Node} childNode
- * @return {DOM Node}
- */
- appendChild: function(node, childNode){
- return node.appendChild(childNode);
- },
-
-
- /**
- * abstracts DOM removeChild
- *
- * @param {DOM Node} childNode
- * @return {DOM Node || null}
- */
- removeChild: function(childNode){
- if (childNode.parentNode) {
- return childNode.parentNode.removeChild(childNode);
- }else{
- return null;
- }
- },
-
-
- /**
- * abstracts DOM cloneNode
- *
- * @param {DOM Node} node
- * @return {DOM Node}
- */
- clone: function(node) {
- var newNode = node.cloneNode(true);
- newNode.removeAttribute('id');
- return newNode;
- },
-
-
- /**
- * gets the text of a node
- *
- * @param {DOM Node} node
- * @return {String}
- */
- getElementText: function( node ){
- if(node && node.data){
- return node.data;
- }else{
- return '';
- }
- },
-
-
- /**
- * gets the attributes of a node - ordered by sequence in html
- *
- * @param {DOM Node} node
- * @return {Array}
- */
- getOrderedAttributes: function( node ){
- var nodeStr = node.outerHTML,
- attrs = [];
-
- for (var i = 0; i < node.attributes.length; i++) {
- var attr = node.attributes[i];
- attr.indexNum = nodeStr.indexOf(attr.name);
-
- attrs.push( attr );
- }
- return attrs.sort( modules.utils.sortObjects( 'indexNum' ) );
- },
-
-
- /**
- * decodes html entities in given text
- *
- * @param {DOM Document} doc
- * @param String} text
- * @return {String}
- */
- decodeEntities: function( doc, text ){
- //return text;
- return doc.createTextNode( text ).nodeValue;
- },
-
-
- /**
- * clones a DOM document
- *
- * @param {DOM Document} document
- * @return {DOM Document}
- */
- cloneDocument: function( document ){
- var newNode,
- newDocument = null;
-
- if( this.canCloneDocument( document )){
- newDocument = document.implementation.createHTMLDocument('');
- newNode = newDocument.importNode( document.documentElement, true );
- newDocument.replaceChild(newNode, newDocument.querySelector('html'));
- }
- return (newNode && newNode.nodeType && newNode.nodeType === 1)? newDocument : document;
- },
-
-
- /**
- * can environment clone a DOM document
- *
- * @param {DOM Document} document
- * @return {Boolean}
- */
- canCloneDocument: function( document ){
- return (document && document.importNode && document.implementation && document.implementation.createHTMLDocument);
- },
-
-
- /**
- * get the child index of a node. Used to create a node path
- *
- * @param {DOM Node} node
- * @return {Int}
- */
- getChildIndex: function (node) {
- var parent = node.parentNode,
- i = -1,
- child;
- while (parent && (child = parent.childNodes[++i])){
- if (child === node){
- return i;
- }
- }
- return -1;
- },
-
-
- /**
- * get a node's path
- *
- * @param {DOM Node} node
- * @return {Array}
- */
- getNodePath: function (node) {
- var parent = node.parentNode,
- path = [],
- index = this.getChildIndex(node);
-
- if(parent && (path = this.getNodePath(parent))){
- if(index > -1){
- path.push(index);
- }
- }
- return path;
- },
-
-
- /**
- * get a node from a path.
- *
- * @param {DOM document} document
- * @param {Array} path
- * @return {DOM Node}
- */
- getNodeByPath: function (document, path) {
- var node = document.documentElement,
- i = 0,
- index;
- while ((index = path[++i]) > -1){
- node = node.childNodes[index];
- }
- return node;
- },
-
-
- /**
- * get an array/nodeList of child nodes
- *
- * @param {DOM node} node
- * @return {Array}
- */
- getChildren: function( node ){
- return node.children;
- },
-
-
- /**
- * create a node
- *
- * @param {String} tagName
- * @return {DOM node}
- */
- createNode: function( tagName ){
- return this.document.createElement(tagName);
- },
-
-
- /**
- * create a node with text content
- *
- * @param {String} tagName
- * @param {String} text
- * @return {DOM node}
- */
- createNodeWithText: function( tagName, text ){
- var node = this.document.createElement(tagName);
- node.innerHTML = text;
- return node;
- }
-
-
-
- };
-
- return modules;
-
-} (Modules || {}));
diff --git a/toolkit/components/microformats/test/lib/html.js b/toolkit/components/microformats/test/lib/html.js
deleted file mode 100644
index ab150d91e..000000000
--- a/toolkit/components/microformats/test/lib/html.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/*
- html
- Extracts a HTML string from DOM nodes. Was created to get around the issue of not being able to exclude the content
- of nodes with the 'data-include' attribute. DO NOT replace with functions such as innerHTML as it will break a
- number of microformat include patterns.
-
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-node/master/license.txt
- Dependencies utilities.js, domutils.js
-*/
-
-
-var Modules = (function (modules) {
-
- modules.html = {
-
- // elements which are self-closing
- selfClosingElt: ['area', 'base', 'br', 'col', 'hr', 'img', 'input', 'link', 'meta', 'param', 'command', 'keygen', 'source'],
-
-
- /**
- * parse the html string from DOM Node
- *
- * @param {DOM Node} node
- * @return {String}
- */
- parse: function( node ){
- var out = '',
- j = 0;
-
- // we do not want the outer container
- if(node.childNodes && node.childNodes.length > 0){
- for (j = 0; j < node.childNodes.length; j++) {
- var text = this.walkTreeForHtml( node.childNodes[j] );
- if(text !== undefined){
- out += text;
- }
- }
- }
-
- return out;
- },
-
-
- /**
- * walks the DOM tree parsing the html string from the nodes
- *
- * @param {DOM Document} doc
- * @param {DOM Node} node
- * @return {String}
- */
- walkTreeForHtml: function( node ) {
- var out = '',
- j = 0;
-
- // if node is a text node get its text
- if(node.nodeType && node.nodeType === 3){
- out += modules.domUtils.getElementText( node );
- }
-
-
- // exclude text which has been added with include pattern -
- if(node.nodeType && node.nodeType === 1 && modules.domUtils.hasAttribute(node, 'data-include') === false){
-
- // begin tag
- out += '<' + node.tagName.toLowerCase();
-
- // add attributes
- var attrs = modules.domUtils.getOrderedAttributes(node);
- for (j = 0; j < attrs.length; j++) {
- out += ' ' + attrs[j].name + '=' + '"' + attrs[j].value + '"';
- }
-
- if(this.selfClosingElt.indexOf(node.tagName.toLowerCase()) === -1){
- out += '>';
- }
-
- // get the text of the child nodes
- if(node.childNodes && node.childNodes.length > 0){
-
- for (j = 0; j < node.childNodes.length; j++) {
- var text = this.walkTreeForHtml( node.childNodes[j] );
- if(text !== undefined){
- out += text;
- }
- }
- }
-
- // end tag
- if(this.selfClosingElt.indexOf(node.tagName.toLowerCase()) > -1){
- out += ' />';
- }else{
- out += '</' + node.tagName.toLowerCase() + '>';
- }
- }
-
- return (out === '')? undefined : out;
- }
-
-
- };
-
-
- return modules;
-
-} (Modules || {}));
-
diff --git a/toolkit/components/microformats/test/lib/isodate.js b/toolkit/components/microformats/test/lib/isodate.js
deleted file mode 100644
index 30f35f35d..000000000
--- a/toolkit/components/microformats/test/lib/isodate.js
+++ /dev/null
@@ -1,481 +0,0 @@
-/*!
- iso date
- This module was built for the exact needs of parsing ISO dates to the microformats standard.
-
- * Parses and builds ISO dates to the W3C note, HTML5 or RFC3339 profiles.
- * Also allows for profile detection using 'auto'
- * Outputs to the same level of specificity of date and time that was input
-
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
- */
-
-
-
-var Modules = (function (modules) {
-
-
- /**
- * constructor
- * parses text to find just the date element of an ISO date/time string i.e. 2008-05-01
- *
- * @param {String} dateString
- * @param {String} format
- * @return {String}
- */
- modules.ISODate = function ( dateString, format ) {
- this.clear();
-
- this.format = (format)? format : 'auto'; // auto or W3C or RFC3339 or HTML5
- this.setFormatSep();
-
- // optional should be full iso date/time string
- if(arguments[0]) {
- this.parse(dateString, format);
- }
- };
-
-
- modules.ISODate.prototype = {
-
-
- /**
- * clear all states
- *
- */
- clear: function(){
- this.clearDate();
- this.clearTime();
- this.clearTimeZone();
- this.setAutoProfileState();
- },
-
-
- /**
- * clear date states
- *
- */
- clearDate: function(){
- this.dY = -1;
- this.dM = -1;
- this.dD = -1;
- this.dDDD = -1;
- },
-
-
- /**
- * clear time states
- *
- */
- clearTime: function(){
- this.tH = -1;
- this.tM = -1;
- this.tS = -1;
- this.tD = -1;
- },
-
-
- /**
- * clear timezone states
- *
- */
- clearTimeZone: function(){
- this.tzH = -1;
- this.tzM = -1;
- this.tzPN = '+';
- this.z = false;
- },
-
-
- /**
- * resets the auto profile state
- *
- */
- setAutoProfileState: function(){
- this.autoProfile = {
- sep: 'T',
- dsep: '-',
- tsep: ':',
- tzsep: ':',
- tzZulu: 'Z'
- };
- },
-
-
- /**
- * parses text to find ISO date/time string i.e. 2008-05-01T15:45:19Z
- *
- * @param {String} dateString
- * @param {String} format
- * @return {String}
- */
- parse: function( dateString, format ) {
- this.clear();
-
- var parts = [],
- tzArray = [],
- position = 0,
- datePart = '',
- timePart = '',
- timeZonePart = '';
-
- if(format){
- this.format = format;
- }
-
-
-
- // discover date time separtor for auto profile
- // Set to 'T' by default
- if(dateString.indexOf('t') > -1) {
- this.autoProfile.sep = 't';
- }
- if(dateString.indexOf('z') > -1) {
- this.autoProfile.tzZulu = 'z';
- }
- if(dateString.indexOf('Z') > -1) {
- this.autoProfile.tzZulu = 'Z';
- }
- if(dateString.toUpperCase().indexOf('T') === -1) {
- this.autoProfile.sep = ' ';
- }
-
-
- dateString = dateString.toUpperCase().replace(' ','T');
-
- // break on 'T' divider or space
- if(dateString.indexOf('T') > -1) {
- parts = dateString.split('T');
- datePart = parts[0];
- timePart = parts[1];
-
- // zulu UTC
- if(timePart.indexOf( 'Z' ) > -1) {
- this.z = true;
- }
-
- // timezone
- if(timePart.indexOf( '+' ) > -1 || timePart.indexOf( '-' ) > -1) {
- tzArray = timePart.split( 'Z' ); // incase of incorrect use of Z
- timePart = tzArray[0];
- timeZonePart = tzArray[1];
-
- // timezone
- if(timePart.indexOf( '+' ) > -1 || timePart.indexOf( '-' ) > -1) {
- position = 0;
-
- if(timePart.indexOf( '+' ) > -1) {
- position = timePart.indexOf( '+' );
- } else {
- position = timePart.indexOf( '-' );
- }
-
- timeZonePart = timePart.substring( position, timePart.length );
- timePart = timePart.substring( 0, position );
- }
- }
-
- } else {
- datePart = dateString;
- }
-
- if(datePart !== '') {
- this.parseDate( datePart );
- if(timePart !== '') {
- this.parseTime( timePart );
- if(timeZonePart !== '') {
- this.parseTimeZone( timeZonePart );
- }
- }
- }
- return this.toString( format );
- },
-
-
- /**
- * parses text to find just the date element of an ISO date/time string i.e. 2008-05-01
- *
- * @param {String} dateString
- * @param {String} format
- * @return {String}
- */
- parseDate: function( dateString, format ) {
- this.clearDate();
-
- var parts = [];
-
- // discover timezone separtor for auto profile // default is ':'
- if(dateString.indexOf('-') === -1) {
- this.autoProfile.tsep = '';
- }
-
- // YYYY-DDD
- parts = dateString.match( /(\d\d\d\d)-(\d\d\d)/ );
- if(parts) {
- if(parts[1]) {
- this.dY = parts[1];
- }
- if(parts[2]) {
- this.dDDD = parts[2];
- }
- }
-
- if(this.dDDD === -1) {
- // YYYY-MM-DD ie 2008-05-01 and YYYYMMDD ie 20080501
- parts = dateString.match( /(\d\d\d\d)?-?(\d\d)?-?(\d\d)?/ );
- if(parts[1]) {
- this.dY = parts[1];
- }
- if(parts[2]) {
- this.dM = parts[2];
- }
- if(parts[3]) {
- this.dD = parts[3];
- }
- }
- return this.toString(format);
- },
-
-
- /**
- * parses text to find just the time element of an ISO date/time string i.e. 13:30:45
- *
- * @param {String} timeString
- * @param {String} format
- * @return {String}
- */
- parseTime: function( timeString, format ) {
- this.clearTime();
- var parts = [];
-
- // discover date separtor for auto profile // default is ':'
- if(timeString.indexOf(':') === -1) {
- this.autoProfile.tsep = '';
- }
-
- // finds timezone HH:MM:SS and HHMMSS ie 13:30:45, 133045 and 13:30:45.0135
- parts = timeString.match( /(\d\d)?:?(\d\d)?:?(\d\d)?.?([0-9]+)?/ );
- if(parts[1]) {
- this.tH = parts[1];
- }
- if(parts[2]) {
- this.tM = parts[2];
- }
- if(parts[3]) {
- this.tS = parts[3];
- }
- if(parts[4]) {
- this.tD = parts[4];
- }
- return this.toTimeString(format);
- },
-
-
- /**
- * parses text to find just the time element of an ISO date/time string i.e. +08:00
- *
- * @param {String} timeString
- * @param {String} format
- * @return {String}
- */
- parseTimeZone: function( timeString, format ) {
- this.clearTimeZone();
- var parts = [];
-
- if(timeString.toLowerCase() === 'z'){
- this.z = true;
- // set case for z
- this.autoProfile.tzZulu = (timeString === 'z')? 'z' : 'Z';
- }else{
-
- // discover timezone separtor for auto profile // default is ':'
- if(timeString.indexOf(':') === -1) {
- this.autoProfile.tzsep = '';
- }
-
- // finds timezone +HH:MM and +HHMM ie +13:30 and +1330
- parts = timeString.match( /([\-\+]{1})?(\d\d)?:?(\d\d)?/ );
- if(parts[1]) {
- this.tzPN = parts[1];
- }
- if(parts[2]) {
- this.tzH = parts[2];
- }
- if(parts[3]) {
- this.tzM = parts[3];
- }
-
-
- }
- this.tzZulu = 'z';
- return this.toTimeString( format );
- },
-
-
- /**
- * returns ISO date/time string in W3C Note, RFC 3339, HTML5, or auto profile
- *
- * @param {String} format
- * @return {String}
- */
- toString: function( format ) {
- var output = '';
-
- if(format){
- this.format = format;
- }
- this.setFormatSep();
-
- if(this.dY > -1) {
- output = this.dY;
- if(this.dM > 0 && this.dM < 13) {
- output += this.dsep + this.dM;
- if(this.dD > 0 && this.dD < 32) {
- output += this.dsep + this.dD;
- if(this.tH > -1 && this.tH < 25) {
- output += this.sep + this.toTimeString( format );
- }
- }
- }
- if(this.dDDD > -1) {
- output += this.dsep + this.dDDD;
- }
- } else if(this.tH > -1) {
- output += this.toTimeString( format );
- }
-
- return output;
- },
-
-
- /**
- * returns just the time string element of an ISO date/time
- * in W3C Note, RFC 3339, HTML5, or auto profile
- *
- * @param {String} format
- * @return {String}
- */
- toTimeString: function( format ) {
- var out = '';
-
- if(format){
- this.format = format;
- }
- this.setFormatSep();
-
- // time can only be created with a full date
- if(this.tH) {
- if(this.tH > -1 && this.tH < 25) {
- out += this.tH;
- if(this.tM > -1 && this.tM < 61){
- out += this.tsep + this.tM;
- if(this.tS > -1 && this.tS < 61){
- out += this.tsep + this.tS;
- if(this.tD > -1){
- out += '.' + this.tD;
- }
- }
- }
-
-
-
- // time zone offset
- if(this.z) {
- out += this.tzZulu;
- } else {
- if(this.tzH && this.tzH > -1 && this.tzH < 25) {
- out += this.tzPN + this.tzH;
- if(this.tzM > -1 && this.tzM < 61){
- out += this.tzsep + this.tzM;
- }
- }
- }
- }
- }
- return out;
- },
-
-
- /**
- * set the current profile to W3C Note, RFC 3339, HTML5, or auto profile
- *
- */
- setFormatSep: function() {
- switch( this.format.toLowerCase() ) {
- case 'rfc3339':
- this.sep = 'T';
- this.dsep = '';
- this.tsep = '';
- this.tzsep = '';
- this.tzZulu = 'Z';
- break;
- case 'w3c':
- this.sep = 'T';
- this.dsep = '-';
- this.tsep = ':';
- this.tzsep = ':';
- this.tzZulu = 'Z';
- break;
- case 'html5':
- this.sep = ' ';
- this.dsep = '-';
- this.tsep = ':';
- this.tzsep = ':';
- this.tzZulu = 'Z';
- break;
- default:
- // auto - defined by format of input string
- this.sep = this.autoProfile.sep;
- this.dsep = this.autoProfile.dsep;
- this.tsep = this.autoProfile.tsep;
- this.tzsep = this.autoProfile.tzsep;
- this.tzZulu = this.autoProfile.tzZulu;
- }
- },
-
-
- /**
- * does current data contain a full date i.e. 2015-03-23
- *
- * @return {Boolean}
- */
- hasFullDate: function() {
- return(this.dY !== -1 && this.dM !== -1 && this.dD !== -1);
- },
-
-
- /**
- * does current data contain a minimum date which is just a year number i.e. 2015
- *
- * @return {Boolean}
- */
- hasDate: function() {
- return(this.dY !== -1);
- },
-
-
- /**
- * does current data contain a minimum time which is just a hour number i.e. 13
- *
- * @return {Boolean}
- */
- hasTime: function() {
- return(this.tH !== -1);
- },
-
- /**
- * does current data contain a minimum timezone i.e. -1 || +1 || z
- *
- * @return {Boolean}
- */
- hasTimeZone: function() {
- return(this.tzH !== -1);
- }
-
- };
-
- modules.ISODate.prototype.constructor = modules.ISODate;
-
- return modules;
-
-} (Modules || {}));
diff --git a/toolkit/components/microformats/test/lib/living-standard.js b/toolkit/components/microformats/test/lib/living-standard.js
deleted file mode 100644
index e2b063573..000000000
--- a/toolkit/components/microformats/test/lib/living-standard.js
+++ /dev/null
@@ -1 +0,0 @@
- modules.livingStandard = '2015-09-25T12:26:04Z';
diff --git a/toolkit/components/microformats/test/lib/maps/h-adr.js b/toolkit/components/microformats/test/lib/maps/h-adr.js
deleted file mode 100644
index aa3a695c5..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-adr.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-adr'] = {
- root: 'adr',
- name: 'h-adr',
- properties: {
- 'post-office-box': {},
- 'street-address': {},
- 'extended-address': {},
- 'locality': {},
- 'region': {},
- 'postal-code': {},
- 'country-name': {}
- }
- };
-
- return modules;
-
-} (Modules || {}));
-
-
-
diff --git a/toolkit/components/microformats/test/lib/maps/h-card.js b/toolkit/components/microformats/test/lib/maps/h-card.js
deleted file mode 100644
index 124750a37..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-card.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-card'] = {
- root: 'vcard',
- name: 'h-card',
- properties: {
- 'fn': {
- 'map': 'p-name'
- },
- 'adr': {
- 'map': 'p-adr',
- 'uf': ['h-adr']
- },
- 'agent': {
- 'uf': ['h-card']
- },
- 'bday': {
- 'map': 'dt-bday'
- },
- 'class': {},
- 'category': {
- 'map': 'p-category',
- 'relAlt': ['tag']
- },
- 'email': {
- 'map': 'u-email'
- },
- 'geo': {
- 'map': 'p-geo',
- 'uf': ['h-geo']
- },
- 'key': {
- 'map': 'u-key'
- },
- 'label': {},
- 'logo': {
- 'map': 'u-logo'
- },
- 'mailer': {},
- 'honorific-prefix': {},
- 'given-name': {},
- 'additional-name': {},
- 'family-name': {},
- 'honorific-suffix': {},
- 'nickname': {},
- 'note': {}, // could be html i.e. e-note
- 'org': {},
- 'p-organization-name': {},
- 'p-organization-unit': {},
- 'photo': {
- 'map': 'u-photo'
- },
- 'rev': {
- 'map': 'dt-rev'
- },
- 'role': {},
- 'sequence': {},
- 'sort-string': {},
- 'sound': {
- 'map': 'u-sound'
- },
- 'title': {
- 'map': 'p-job-title'
- },
- 'tel': {},
- 'tz': {},
- 'uid': {
- 'map': 'u-uid'
- },
- 'url': {
- 'map': 'u-url'
- }
- }
- };
-
- return modules;
-
-} (Modules || {}));
-
diff --git a/toolkit/components/microformats/test/lib/maps/h-entry.js b/toolkit/components/microformats/test/lib/maps/h-entry.js
deleted file mode 100644
index b82c4c2d9..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-entry.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-entry'] = {
- root: 'hentry',
- name: 'h-entry',
- properties: {
- 'entry-title': {
- 'map': 'p-name'
- },
- 'entry-summary': {
- 'map': 'p-summary'
- },
- 'entry-content': {
- 'map': 'e-content'
- },
- 'published': {
- 'map': 'dt-published'
- },
- 'updated': {
- 'map': 'dt-updated'
- },
- 'author': {
- 'uf': ['h-card']
- },
- 'category': {
- 'map': 'p-category',
- 'relAlt': ['tag']
- },
- 'geo': {
- 'map': 'p-geo',
- 'uf': ['h-geo']
- },
- 'latitude': {},
- 'longitude': {},
- 'url': {
- 'map': 'u-url',
- 'relAlt': ['bookmark']
- }
- }
- };
-
- return modules;
-
-} (Modules || {}));
-
diff --git a/toolkit/components/microformats/test/lib/maps/h-event.js b/toolkit/components/microformats/test/lib/maps/h-event.js
deleted file mode 100644
index 6599d4549..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-event.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-event'] = {
- root: 'vevent',
- name: 'h-event',
- properties: {
- 'summary': {
- 'map': 'p-name'
- },
- 'dtstart': {
- 'map': 'dt-start'
- },
- 'dtend': {
- 'map': 'dt-end'
- },
- 'description': {},
- 'url': {
- 'map': 'u-url'
- },
- 'category': {
- 'map': 'p-category',
- 'relAlt': ['tag']
- },
- 'location': {
- 'uf': ['h-card']
- },
- 'geo': {
- 'uf': ['h-geo']
- },
- 'latitude': {},
- 'longitude': {},
- 'duration': {
- 'map': 'dt-duration'
- },
- 'contact': {
- 'uf': ['h-card']
- },
- 'organizer': {
- 'uf': ['h-card']},
- 'attendee': {
- 'uf': ['h-card']},
- 'uid': {
- 'map': 'u-uid'
- },
- 'attach': {
- 'map': 'u-attach'
- },
- 'status': {},
- 'rdate': {},
- 'rrule': {}
- }
- };
-
- return modules;
-
-} (Modules || {}));
-
diff --git a/toolkit/components/microformats/test/lib/maps/h-feed.js b/toolkit/components/microformats/test/lib/maps/h-feed.js
deleted file mode 100644
index f68022856..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-feed.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-feed'] = {
- root: 'hfeed',
- name: 'h-feed',
- properties: {
- 'category': {
- 'map': 'p-category',
- 'relAlt': ['tag']
- },
- 'summary': {
- 'map': 'p-summary'
- },
- 'author': {
- 'uf': ['h-card']
- },
- 'url': {
- 'map': 'u-url'
- },
- 'photo': {
- 'map': 'u-photo'
- },
- }
- };
-
- return modules;
-
-} (Modules || {}));
-
diff --git a/toolkit/components/microformats/test/lib/maps/h-geo.js b/toolkit/components/microformats/test/lib/maps/h-geo.js
deleted file mode 100644
index fabb86f07..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-geo.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-geo'] = {
- root: 'geo',
- name: 'h-geo',
- properties: {
- 'latitude': {},
- 'longitude': {}
- }
- };
-
- return modules;
-
-} (Modules || {}));
-
diff --git a/toolkit/components/microformats/test/lib/maps/h-item.js b/toolkit/components/microformats/test/lib/maps/h-item.js
deleted file mode 100644
index 471a8454e..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-item.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-item'] = {
- root: 'item',
- name: 'h-item',
- subTree: false,
- properties: {
- 'fn': {
- 'map': 'p-name'
- },
- 'url': {
- 'map': 'u-url'
- },
- 'photo': {
- 'map': 'u-photo'
- }
- }
- };
-
- return modules;
-
-} (Modules || {}));
-
diff --git a/toolkit/components/microformats/test/lib/maps/h-listing.js b/toolkit/components/microformats/test/lib/maps/h-listing.js
deleted file mode 100644
index 94783d9ee..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-listing.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-listing'] = {
- root: 'hlisting',
- name: 'h-listing',
- properties: {
- 'version': {},
- 'lister': {
- 'uf': ['h-card']
- },
- 'dtlisted': {
- 'map': 'dt-listed'
- },
- 'dtexpired': {
- 'map': 'dt-expired'
- },
- 'location': {},
- 'price': {},
- 'item': {
- 'uf': ['h-card','a-adr','h-geo']
- },
- 'summary': {
- 'map': 'p-name'
- },
- 'description': {
- 'map': 'e-description'
- },
- 'listing': {}
- }
- };
-
- return modules;
-
-} (Modules || {}));
diff --git a/toolkit/components/microformats/test/lib/maps/h-news.js b/toolkit/components/microformats/test/lib/maps/h-news.js
deleted file mode 100644
index 362a5a570..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-news.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-news'] = {
- root: 'hnews',
- name: 'h-news',
- properties: {
- 'entry': {
- 'uf': ['h-entry']
- },
- 'geo': {
- 'uf': ['h-geo']
- },
- 'latitude': {},
- 'longitude': {},
- 'source-org': {
- 'uf': ['h-card']
- },
- 'dateline': {
- 'uf': ['h-card']
- },
- 'item-license': {
- 'map': 'u-item-license'
- },
- 'principles': {
- 'map': 'u-principles',
- 'relAlt': ['principles']
- }
- }
- };
-
- return modules;
-
-} (Modules || {}));
-
-
diff --git a/toolkit/components/microformats/test/lib/maps/h-org.js b/toolkit/components/microformats/test/lib/maps/h-org.js
deleted file mode 100644
index d1b4e8245..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-org.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-org'] = {
- root: 'h-x-org', // drop this from v1 as it causes issue with fn org hcard pattern
- name: 'h-org',
- childStructure: true,
- properties: {
- 'organization-name': {},
- 'organization-unit': {}
- }
- };
-
- return modules;
-
-} (Modules || {}));
-
-
diff --git a/toolkit/components/microformats/test/lib/maps/h-product.js b/toolkit/components/microformats/test/lib/maps/h-product.js
deleted file mode 100644
index 18f8eb51a..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-product.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-product'] = {
- root: 'hproduct',
- name: 'h-product',
- properties: {
- 'brand': {
- 'uf': ['h-card']
- },
- 'category': {
- 'map': 'p-category',
- 'relAlt': ['tag']
- },
- 'price': {},
- 'description': {
- 'map': 'e-description'
- },
- 'fn': {
- 'map': 'p-name'
- },
- 'photo': {
- 'map': 'u-photo'
- },
- 'url': {
- 'map': 'u-url'
- },
- 'review': {
- 'uf': ['h-review', 'h-review-aggregate']
- },
- 'listing': {
- 'uf': ['h-listing']
- },
- 'identifier': {
- 'map': 'u-identifier'
- }
- }
- };
-
- return modules;
-
-} (Modules || {}));
-
diff --git a/toolkit/components/microformats/test/lib/maps/h-recipe.js b/toolkit/components/microformats/test/lib/maps/h-recipe.js
deleted file mode 100644
index e3901ea3e..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-recipe.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-recipe'] = {
- root: 'hrecipe',
- name: 'h-recipe',
- properties: {
- 'fn': {
- 'map': 'p-name'
- },
- 'ingredient': {
- 'map': 'e-ingredient'
- },
- 'yield': {},
- 'instructions': {
- 'map': 'e-instructions'
- },
- 'duration': {
- 'map': 'dt-duration'
- },
- 'photo': {
- 'map': 'u-photo'
- },
- 'summary': {},
- 'author': {
- 'uf': ['h-card']
- },
- 'published': {
- 'map': 'dt-published'
- },
- 'nutrition': {},
- 'category': {
- 'map': 'p-category',
- 'relAlt': ['tag']
- },
- }
- };
-
- return modules;
-
-} (Modules || {}));
diff --git a/toolkit/components/microformats/test/lib/maps/h-resume.js b/toolkit/components/microformats/test/lib/maps/h-resume.js
deleted file mode 100644
index d6a46cc88..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-resume.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-resume'] = {
- root: 'hresume',
- name: 'h-resume',
- properties: {
- 'summary': {},
- 'contact': {
- 'uf': ['h-card']
- },
- 'education': {
- 'uf': ['h-card', 'h-event']
- },
- 'experience': {
- 'uf': ['h-card', 'h-event']
- },
- 'skill': {},
- 'affiliation': {
- 'uf': ['h-card']
- }
- }
- };
-
- return modules;
-
-} (Modules || {}));
-
diff --git a/toolkit/components/microformats/test/lib/maps/h-review-aggregate.js b/toolkit/components/microformats/test/lib/maps/h-review-aggregate.js
deleted file mode 100644
index 4b6027cbf..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-review-aggregate.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-review-aggregate'] = {
- root: 'hreview-aggregate',
- name: 'h-review-aggregate',
- properties: {
- 'summary': {
- 'map': 'p-name'
- },
- 'item': {
- 'map': 'p-item',
- 'uf': ['h-item', 'h-geo', 'h-adr', 'h-card', 'h-event', 'h-product']
- },
- 'rating': {},
- 'average': {},
- 'best': {},
- 'worst': {},
- 'count': {},
- 'votes': {},
- 'category': {
- 'map': 'p-category',
- 'relAlt': ['tag']
- },
- 'url': {
- 'map': 'u-url',
- 'relAlt': ['self', 'bookmark']
- }
- }
- };
-
- return modules;
-
-} (Modules || {}));
diff --git a/toolkit/components/microformats/test/lib/maps/h-review.js b/toolkit/components/microformats/test/lib/maps/h-review.js
deleted file mode 100644
index 83f4c24bc..000000000
--- a/toolkit/components/microformats/test/lib/maps/h-review.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.maps = (modules.maps)? modules.maps : {};
-
- modules.maps['h-review'] = {
- root: 'hreview',
- name: 'h-review',
- properties: {
- 'summary': {
- 'map': 'p-name'
- },
- 'description': {
- 'map': 'e-description'
- },
- 'item': {
- 'map': 'p-item',
- 'uf': ['h-item', 'h-geo', 'h-adr', 'h-card', 'h-event', 'h-product']
- },
- 'reviewer': {
- 'uf': ['h-card']
- },
- 'dtreviewer': {
- 'map': 'dt-reviewer'
- },
- 'rating': {},
- 'best': {},
- 'worst': {},
- 'category': {
- 'map': 'p-category',
- 'relAlt': ['tag']
- },
- 'url': {
- 'map': 'u-url',
- 'relAlt': ['self', 'bookmark']
- }
- }
- };
-
- return modules;
-
-} (Modules || {}));
diff --git a/toolkit/components/microformats/test/lib/maps/rel.js b/toolkit/components/microformats/test/lib/maps/rel.js
deleted file mode 100644
index 8accf8009..000000000
--- a/toolkit/components/microformats/test/lib/maps/rel.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.rels = {
- // xfn
- 'friend': [ 'yes','external'],
- 'acquaintance': [ 'yes','external'],
- 'contact': [ 'yes','external'],
- 'met': [ 'yes','external'],
- 'co-worker': [ 'yes','external'],
- 'colleague': [ 'yes','external'],
- 'co-resident': [ 'yes','external'],
- 'neighbor': [ 'yes','external'],
- 'child': [ 'yes','external'],
- 'parent': [ 'yes','external'],
- 'sibling': [ 'yes','external'],
- 'spouse': [ 'yes','external'],
- 'kin': [ 'yes','external'],
- 'muse': [ 'yes','external'],
- 'crush': [ 'yes','external'],
- 'date': [ 'yes','external'],
- 'sweetheart': [ 'yes','external'],
- 'me': [ 'yes','external'],
-
- // other rel=*
- 'license': [ 'yes','yes'],
- 'nofollow': [ 'no','external'],
- 'tag': [ 'no','yes'],
- 'self': [ 'no','external'],
- 'bookmark': [ 'no','external'],
- 'author': [ 'no','external'],
- 'home': [ 'no','external'],
- 'directory': [ 'no','external'],
- 'enclosure': [ 'no','external'],
- 'pronunciation': [ 'no','external'],
- 'payment': [ 'no','external'],
- 'principles': [ 'no','external']
-
- };
-
- return modules;
-
-} (Modules || {}));
diff --git a/toolkit/components/microformats/test/lib/parser-implied.js b/toolkit/components/microformats/test/lib/parser-implied.js
deleted file mode 100644
index 7f67a2ca1..000000000
--- a/toolkit/components/microformats/test/lib/parser-implied.js
+++ /dev/null
@@ -1,439 +0,0 @@
-/*!
- Parser implied
- All the functions that deal with microformats implied rules
-
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
- Dependencies dates.js, domutils.js, html.js, isodate,js, text.js, utilities.js, url.js
-*/
-
-var Modules = (function (modules) {
-
- // check parser module is loaded
- if(modules.Parser){
-
- /**
- * applies "implied rules" microformat output structure i.e. feed-title, name, photo, url and date
- *
- * @param {DOM Node} node
- * @param {Object} uf (microformat output structure)
- * @param {Object} parentClasses (classes structure)
- * @param {Boolean} impliedPropertiesByVersion
- * @return {Object}
- */
- modules.Parser.prototype.impliedRules = function(node, uf, parentClasses) {
- var typeVersion = (uf.typeVersion)? uf.typeVersion: 'v2';
-
- // TEMP: override to allow v1 implied properties while spec changes
- if(this.options.impliedPropertiesByVersion === false){
- typeVersion = 'v2';
- }
-
- if(node && uf && uf.properties) {
- uf = this.impliedBackwardComp( node, uf, parentClasses );
- if(typeVersion === 'v2'){
- uf = this.impliedhFeedTitle( uf );
- uf = this.impliedName( node, uf );
- uf = this.impliedPhoto( node, uf );
- uf = this.impliedUrl( node, uf );
- }
- uf = this.impliedValue( node, uf, parentClasses );
- uf = this.impliedDate( uf );
-
- // TEMP: flagged while spec changes are put forward
- if(this.options.parseLatLonGeo === true){
- uf = this.impliedGeo( uf );
- }
- }
-
- return uf;
- };
-
-
- /**
- * apply implied name rule
- *
- * @param {DOM Node} node
- * @param {Object} uf
- * @return {Object}
- */
- modules.Parser.prototype.impliedName = function(node, uf) {
- // implied name rule
- /*
- img.h-x[alt] <img class="h-card" src="glenn.htm" alt="Glenn Jones"></a>
- area.h-x[alt] <area class="h-card" href="glenn.htm" alt="Glenn Jones"></area>
- abbr.h-x[title] <abbr class="h-card" title="Glenn Jones"GJ</abbr>
-
- .h-x>img:only-child[alt]:not[.h-*] <div class="h-card"><a src="glenn.htm" alt="Glenn Jones"></a></div>
- .h-x>area:only-child[alt]:not[.h-*] <div class="h-card"><area href="glenn.htm" alt="Glenn Jones"></area></div>
- .h-x>abbr:only-child[title] <div class="h-card"><abbr title="Glenn Jones">GJ</abbr></div>
-
- .h-x>:only-child>img:only-child[alt]:not[.h-*] <div class="h-card"><span><img src="jane.html" alt="Jane Doe"/></span></div>
- .h-x>:only-child>area:only-child[alt]:not[.h-*] <div class="h-card"><span><area href="jane.html" alt="Jane Doe"></area></span></div>
- .h-x>:only-child>abbr:only-child[title] <div class="h-card"><span><abbr title="Jane Doe">JD</abbr></span></div>
- */
- var name,
- value;
-
- if(!uf.properties.name) {
- value = this.getImpliedProperty(node, ['img', 'area', 'abbr'], this.getNameAttr);
- var textFormat = this.options.textFormat;
- // if no value for tags/properties use text
- if(!value) {
- name = [modules.text.parse(this.document, node, textFormat)];
- }else{
- name = [modules.text.parseText(this.document, value, textFormat)];
- }
- if(name && name[0] !== ''){
- uf.properties.name = name;
- }
- }
-
- return uf;
- };
-
-
- /**
- * apply implied photo rule
- *
- * @param {DOM Node} node
- * @param {Object} uf
- * @return {Object}
- */
- modules.Parser.prototype.impliedPhoto = function(node, uf) {
- // implied photo rule
- /*
- img.h-x[src] <img class="h-card" alt="Jane Doe" src="jane.jpeg"/>
- object.h-x[data] <object class="h-card" data="jane.jpeg"/>Jane Doe</object>
- .h-x>img[src]:only-of-type:not[.h-*] <div class="h-card"><img alt="Jane Doe" src="jane.jpeg"/></div>
- .h-x>object[data]:only-of-type:not[.h-*] <div class="h-card"><object data="jane.jpeg"/>Jane Doe</object></div>
- .h-x>:only-child>img[src]:only-of-type:not[.h-*] <div class="h-card"><span><img alt="Jane Doe" src="jane.jpeg"/></span></div>
- .h-x>:only-child>object[data]:only-of-type:not[.h-*] <div class="h-card"><span><object data="jane.jpeg"/>Jane Doe</object></span></div>
- */
- var value;
- if(!uf.properties.photo) {
- value = this.getImpliedProperty(node, ['img', 'object'], this.getPhotoAttr);
- if(value) {
- // relative to absolute URL
- if(value && value !== '' && this.options.baseUrl !== '' && value.indexOf('://') === -1) {
- value = modules.url.resolve(value, this.options.baseUrl);
- }
- uf.properties.photo = [modules.utils.trim(value)];
- }
- }
- return uf;
- };
-
-
- /**
- * apply implied URL rule
- *
- * @param {DOM Node} node
- * @param {Object} uf
- * @return {Object}
- */
- modules.Parser.prototype.impliedUrl = function(node, uf) {
- // implied URL rule
- /*
- a.h-x[href] <a class="h-card" href="glenn.html">Glenn</a>
- area.h-x[href] <area class="h-card" href="glenn.html">Glenn</area>
- .h-x>a[href]:only-of-type:not[.h-*] <div class="h-card" ><a href="glenn.html">Glenn</a><p>...</p></div>
- .h-x>area[href]:only-of-type:not[.h-*] <div class="h-card" ><area href="glenn.html">Glenn</area><p>...</p></div>
- */
- var value;
- if(!uf.properties.url) {
- value = this.getImpliedProperty(node, ['a', 'area'], this.getURLAttr);
- if(value) {
- // relative to absolute URL
- if(value && value !== '' && this.options.baseUrl !== '' && value.indexOf('://') === -1) {
- value = modules.url.resolve(value, this.options.baseUrl);
- }
- uf.properties.url = [modules.utils.trim(value)];
- }
- }
- return uf;
- };
-
-
- /**
- * apply implied date rule - if there is a time only property try to concat it with any date property
- *
- * @param {DOM Node} node
- * @param {Object} uf
- * @return {Object}
- */
- modules.Parser.prototype.impliedDate = function(uf) {
- // implied date rule
- // http://microformats.org/wiki/value-class-pattern#microformats2_parsers
- // http://microformats.org/wiki/microformats2-parsing-issues#implied_date_for_dt_properties_both_mf2_and_backcompat
- var newDate;
- if(uf.times.length > 0 && uf.dates.length > 0) {
- newDate = modules.dates.dateTimeUnion(uf.dates[0][1], uf.times[0][1], this.options.dateFormat);
- uf.properties[this.removePropPrefix(uf.times[0][0])][0] = newDate.toString(this.options.dateFormat);
- }
- // clean-up object
- delete uf.times;
- delete uf.dates;
- return uf;
- };
-
-
- /**
- * get an implied property value from pre-defined tag/attriubte combinations
- *
- * @param {DOM Node} node
- * @param {String} tagList (Array of tags from which an implied value can be pulled)
- * @param {String} getAttrFunction (Function which can extract implied value)
- * @return {String || null}
- */
- modules.Parser.prototype.getImpliedProperty = function(node, tagList, getAttrFunction) {
- // i.e. img.h-card
- var value = getAttrFunction(node),
- descendant,
- child;
-
- if(!value) {
- // i.e. .h-card>img:only-of-type:not(.h-card)
- descendant = modules.domUtils.getSingleDescendantOfType( node, tagList);
- if(descendant && this.hasHClass(descendant) === false){
- value = getAttrFunction(descendant);
- }
- if(node.children.length > 0 ){
- // i.e. .h-card>:only-child>img:only-of-type:not(.h-card)
- child = modules.domUtils.getSingleDescendant(node);
- if(child && this.hasHClass(child) === false){
- descendant = modules.domUtils.getSingleDescendantOfType(child, tagList);
- if(descendant && this.hasHClass(descendant) === false){
- value = getAttrFunction(descendant);
- }
- }
- }
- }
-
- return value;
- };
-
-
- /**
- * get an implied name value from a node
- *
- * @param {DOM Node} node
- * @return {String || null}
- */
- modules.Parser.prototype.getNameAttr = function(node) {
- var value = modules.domUtils.getAttrValFromTagList(node, ['img','area'], 'alt');
- if(!value) {
- value = modules.domUtils.getAttrValFromTagList(node, ['abbr'], 'title');
- }
- return value;
- };
-
-
- /**
- * get an implied photo value from a node
- *
- * @param {DOM Node} node
- * @return {String || null}
- */
- modules.Parser.prototype.getPhotoAttr = function(node) {
- var value = modules.domUtils.getAttrValFromTagList(node, ['img'], 'src');
- if(!value && modules.domUtils.hasAttributeValue(node, 'class', 'include') === false) {
- value = modules.domUtils.getAttrValFromTagList(node, ['object'], 'data');
- }
- return value;
- };
-
-
- /**
- * get an implied photo value from a node
- *
- * @param {DOM Node} node
- * @return {String || null}
- */
- modules.Parser.prototype.getURLAttr = function(node) {
- var value = null;
- if(modules.domUtils.hasAttributeValue(node, 'class', 'include') === false){
-
- value = modules.domUtils.getAttrValFromTagList(node, ['a'], 'href');
- if(!value) {
- value = modules.domUtils.getAttrValFromTagList(node, ['area'], 'href');
- }
-
- }
- return value;
- };
-
-
- /**
- *
- *
- * @param {DOM Node} node
- * @param {Object} uf
- * @return {Object}
- */
- modules.Parser.prototype.impliedValue = function(node, uf, parentClasses){
-
- // intersection of implied name and implied value rules
- if(uf.properties.name) {
- if(uf.value && parentClasses.root.length > 0 && parentClasses.properties.length === 1){
- uf = this.getAltValue(uf, parentClasses.properties[0][0], 'p-name', uf.properties.name[0]);
- }
- }
-
- // intersection of implied URL and implied value rules
- if(uf.properties.url) {
- if(parentClasses && parentClasses.root.length === 1 && parentClasses.properties.length === 1){
- uf = this.getAltValue(uf, parentClasses.properties[0][0], 'u-url', uf.properties.url[0]);
- }
- }
-
- // apply alt value
- if(uf.altValue !== null){
- uf.value = uf.altValue.value;
- }
- delete uf.altValue;
-
-
- return uf;
- };
-
-
- /**
- * get alt value based on rules about parent property prefix
- *
- * @param {Object} uf
- * @param {String} parentPropertyName
- * @param {String} propertyName
- * @param {String} value
- * @return {Object}
- */
- modules.Parser.prototype.getAltValue = function(uf, parentPropertyName, propertyName, value){
- if(uf.value && !uf.altValue){
- // first p-name of the h-* child
- if(modules.utils.startWith(parentPropertyName,'p-') && propertyName === 'p-name'){
- uf.altValue = {name: propertyName, value: value};
- }
- // if it's an e-* property element
- if(modules.utils.startWith(parentPropertyName,'e-') && modules.utils.startWith(propertyName,'e-')){
- uf.altValue = {name: propertyName, value: value};
- }
- // if it's an u-* property element
- if(modules.utils.startWith(parentPropertyName,'u-') && propertyName === 'u-url'){
- uf.altValue = {name: propertyName, value: value};
- }
- }
- return uf;
- };
-
-
- /**
- * if a h-feed does not have a title use the title tag of a page
- *
- * @param {Object} uf
- * @return {Object}
- */
- modules.Parser.prototype.impliedhFeedTitle = function( uf ){
- if(uf.type && uf.type.indexOf('h-feed') > -1){
- // has no name property
- if(uf.properties.name === undefined || uf.properties.name[0] === '' ){
- // use the text from the title tag
- var title = modules.domUtils.querySelector(this.document, 'title');
- if(title){
- uf.properties.name = [modules.domUtils.textContent(title)];
- }
- }
- }
- return uf;
- };
-
-
-
- /**
- * implied Geo from pattern <abbr class="p-geo" title="37.386013;-122.082932">
- *
- * @param {Object} uf
- * @return {Object}
- */
- modules.Parser.prototype.impliedGeo = function( uf ){
- var geoPair,
- parts,
- longitude,
- latitude,
- valid = true;
-
- if(uf.type && uf.type.indexOf('h-geo') > -1){
-
- // has no latitude or longitude property
- if(uf.properties.latitude === undefined || uf.properties.longitude === undefined ){
-
- geoPair = (uf.properties.name)? uf.properties.name[0] : null;
- geoPair = (!geoPair && uf.properties.value)? uf.properties.value : geoPair;
-
- if(geoPair){
- // allow for the use of a ';' as in microformats and also ',' as in Geo URL
- geoPair = geoPair.replace(';',',');
-
- // has sep char
- if(geoPair.indexOf(',') > -1 ){
- parts = geoPair.split(',');
-
- // only correct if we have two or more parts
- if(parts.length > 1){
-
- // latitude no value outside the range -90 or 90
- latitude = parseFloat( parts[0] );
- if(modules.utils.isNumber(latitude) && latitude > 90 || latitude < -90){
- valid = false;
- }
-
- // longitude no value outside the range -180 to 180
- longitude = parseFloat( parts[1] );
- if(modules.utils.isNumber(longitude) && longitude > 180 || longitude < -180){
- valid = false;
- }
-
- if(valid){
- uf.properties.latitude = [latitude];
- uf.properties.longitude = [longitude];
- }
- }
-
- }
- }
- }
- }
- return uf;
- };
-
-
- /**
- * if a backwards compat built structure has no properties add name through this.impliedName
- *
- * @param {Object} uf
- * @return {Object}
- */
- modules.Parser.prototype.impliedBackwardComp = function(node, uf, parentClasses){
-
- // look for pattern in parent classes like "p-geo h-geo"
- // these are structures built from backwards compat parsing of geo
- if(parentClasses.root.length === 1 && parentClasses.properties.length === 1) {
- if(parentClasses.root[0].replace('h-','') === this.removePropPrefix(parentClasses.properties[0][0])) {
-
- // if microformat has no properties apply the impliedName rule to get value from containing node
- // this will get value from html such as <abbr class="geo" title="30.267991;-97.739568">Brighton</abbr>
- if( modules.utils.hasProperties(uf.properties) === false ){
- uf = this.impliedName( node, uf );
- }
- }
- }
-
- return uf;
- };
-
-
-
- }
-
- return modules;
-
-} (Modules || {}));
diff --git a/toolkit/components/microformats/test/lib/parser-includes.js b/toolkit/components/microformats/test/lib/parser-includes.js
deleted file mode 100644
index f0967710d..000000000
--- a/toolkit/components/microformats/test/lib/parser-includes.js
+++ /dev/null
@@ -1,150 +0,0 @@
-/*!
- Parser includes
- All the functions that deal with microformats v1 include rules
-
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
- Dependencies dates.js, domutils.js, html.js, isodate,js, text.js, utilities.js
-*/
-
-
-var Modules = (function (modules) {
-
- // check parser module is loaded
- if(modules.Parser){
-
-
- /**
- * appends clones of include Nodes into the DOM structure
- *
- * @param {DOM node} rootNode
- */
- modules.Parser.prototype.addIncludes = function(rootNode) {
- this.addAttributeIncludes(rootNode, 'itemref');
- this.addAttributeIncludes(rootNode, 'headers');
- this.addClassIncludes(rootNode);
- };
-
-
- /**
- * appends clones of include Nodes into the DOM structure for attribute based includes
- *
- * @param {DOM node} rootNode
- * @param {String} attributeName
- */
- modules.Parser.prototype.addAttributeIncludes = function(rootNode, attributeName) {
- var arr,
- idList,
- i,
- x,
- z,
- y;
-
- arr = modules.domUtils.getNodesByAttribute(rootNode, attributeName);
- x = 0;
- i = arr.length;
- while(x < i) {
- idList = modules.domUtils.getAttributeList(arr[x], attributeName);
- if(idList) {
- z = 0;
- y = idList.length;
- while(z < y) {
- this.apppendInclude(arr[x], idList[z]);
- z++;
- }
- }
- x++;
- }
- };
-
-
- /**
- * appends clones of include Nodes into the DOM structure for class based includes
- *
- * @param {DOM node} rootNode
- */
- modules.Parser.prototype.addClassIncludes = function(rootNode) {
- var id,
- arr,
- x = 0,
- i;
-
- arr = modules.domUtils.getNodesByAttributeValue(rootNode, 'class', 'include');
- i = arr.length;
- while(x < i) {
- id = modules.domUtils.getAttrValFromTagList(arr[x], ['a'], 'href');
- if(!id) {
- id = modules.domUtils.getAttrValFromTagList(arr[x], ['object'], 'data');
- }
- this.apppendInclude(arr[x], id);
- x++;
- }
- };
-
-
- /**
- * appends a clone of an include into another Node using Id
- *
- * @param {DOM node} rootNode
- * @param {Stringe} id
- */
- modules.Parser.prototype.apppendInclude = function(node, id){
- var include,
- clone;
-
- id = modules.utils.trim(id.replace('#', ''));
- include = modules.domUtils.getElementById(this.document, id);
- if(include) {
- clone = modules.domUtils.clone(include);
- this.markIncludeChildren(clone);
- modules.domUtils.appendChild(node, clone);
- }
- };
-
-
- /**
- * adds an attribute marker to all the child microformat roots
- *
- * @param {DOM node} rootNode
- */
- modules.Parser.prototype.markIncludeChildren = function(rootNode) {
- var arr,
- x,
- i;
-
- // loop the array and add the attribute
- arr = this.findRootNodes(rootNode);
- x = 0;
- i = arr.length;
- modules.domUtils.setAttribute(rootNode, 'data-include', 'true');
- modules.domUtils.setAttribute(rootNode, 'style', 'display:none');
- while(x < i) {
- modules.domUtils.setAttribute(arr[x], 'data-include', 'true');
- x++;
- }
- };
-
-
- /**
- * removes all appended include clones from DOM
- *
- * @param {DOM node} rootNode
- */
- modules.Parser.prototype.removeIncludes = function(rootNode){
- var arr,
- i;
-
- // remove all the items that were added as includes
- arr = modules.domUtils.getNodesByAttribute(rootNode, 'data-include');
- i = arr.length;
- while(i--) {
- modules.domUtils.removeChild(rootNode,arr[i]);
- }
- };
-
-
- }
-
- return modules;
-
-} (Modules || {}));
diff --git a/toolkit/components/microformats/test/lib/parser-rels.js b/toolkit/components/microformats/test/lib/parser-rels.js
deleted file mode 100644
index 63ef67446..000000000
--- a/toolkit/components/microformats/test/lib/parser-rels.js
+++ /dev/null
@@ -1,200 +0,0 @@
-/*!
- Parser rels
- All the functions that deal with microformats v2 rel structures
-
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
- Dependencies dates.js, domutils.js, html.js, isodate,js, text.js, utilities.js, url.js
-*/
-
-
-var Modules = (function (modules) {
-
- // check parser module is loaded
- if(modules.Parser){
-
- /**
- * finds rel=* structures
- *
- * @param {DOM node} rootNode
- * @return {Object}
- */
- modules.Parser.prototype.findRels = function(rootNode) {
- var out = {
- 'items': [],
- 'rels': {},
- 'rel-urls': {}
- },
- x,
- i,
- y,
- z,
- relList,
- items,
- item,
- value,
- arr;
-
- arr = modules.domUtils.getNodesByAttribute(rootNode, 'rel');
- x = 0;
- i = arr.length;
- while(x < i) {
- relList = modules.domUtils.getAttribute(arr[x], 'rel');
-
- if(relList) {
- items = relList.split(' ');
-
-
- // add rels
- z = 0;
- y = items.length;
- while(z < y) {
- item = modules.utils.trim(items[z]);
-
- // get rel value
- value = modules.domUtils.getAttrValFromTagList(arr[x], ['a', 'area'], 'href');
- if(!value) {
- value = modules.domUtils.getAttrValFromTagList(arr[x], ['link'], 'href');
- }
-
- // create the key
- if(!out.rels[item]) {
- out.rels[item] = [];
- }
-
- if(typeof this.options.baseUrl === 'string' && typeof value === 'string') {
-
- var resolved = modules.url.resolve(value, this.options.baseUrl);
- // do not add duplicate rels - based on resolved URLs
- if(out.rels[item].indexOf(resolved) === -1){
- out.rels[item].push( resolved );
- }
- }
- z++;
- }
-
-
- var url = null;
- if(modules.domUtils.hasAttribute(arr[x], 'href')){
- url = modules.domUtils.getAttribute(arr[x], 'href');
- if(url){
- url = modules.url.resolve(url, this.options.baseUrl );
- }
- }
-
-
- // add to rel-urls
- var relUrl = this.getRelProperties(arr[x]);
- relUrl.rels = items;
- // // do not add duplicate rel-urls - based on resolved URLs
- if(url && out['rel-urls'][url] === undefined){
- out['rel-urls'][url] = relUrl;
- }
-
-
- }
- x++;
- }
- return out;
- };
-
-
- /**
- * gets the properties of a rel=*
- *
- * @param {DOM node} node
- * @return {Object}
- */
- modules.Parser.prototype.getRelProperties = function(node){
- var obj = {};
-
- if(modules.domUtils.hasAttribute(node, 'media')){
- obj.media = modules.domUtils.getAttribute(node, 'media');
- }
- if(modules.domUtils.hasAttribute(node, 'type')){
- obj.type = modules.domUtils.getAttribute(node, 'type');
- }
- if(modules.domUtils.hasAttribute(node, 'hreflang')){
- obj.hreflang = modules.domUtils.getAttribute(node, 'hreflang');
- }
- if(modules.domUtils.hasAttribute(node, 'title')){
- obj.title = modules.domUtils.getAttribute(node, 'title');
- }
- if(modules.utils.trim(this.getPValue(node, false)) !== ''){
- obj.text = this.getPValue(node, false);
- }
-
- return obj;
- };
-
-
- /**
- * finds any alt rel=* mappings for a given node/microformat
- *
- * @param {DOM node} node
- * @param {String} ufName
- * @return {String || undefined}
- */
- modules.Parser.prototype.findRelImpied = function(node, ufName) {
- var out,
- map,
- i;
-
- map = this.getMapping(ufName);
- if(map) {
- for(var key in map.properties) {
- if (map.properties.hasOwnProperty(key)) {
- var prop = map.properties[key],
- propName = (prop.map) ? prop.map : 'p-' + key,
- relCount = 0;
-
- // is property an alt rel=* mapping
- if(prop.relAlt && modules.domUtils.hasAttribute(node, 'rel')) {
- i = prop.relAlt.length;
- while(i--) {
- if(modules.domUtils.hasAttributeValue(node, 'rel', prop.relAlt[i])) {
- relCount++;
- }
- }
- if(relCount === prop.relAlt.length) {
- out = propName;
- }
- }
- }
- }
- }
- return out;
- };
-
-
- /**
- * returns whether a node or its children has rel=* microformat
- *
- * @param {DOM node} node
- * @return {Boolean}
- */
- modules.Parser.prototype.hasRel = function(node) {
- return (this.countRels(node) > 0);
- };
-
-
- /**
- * returns the number of rel=* microformats
- *
- * @param {DOM node} node
- * @return {Int}
- */
- modules.Parser.prototype.countRels = function(node) {
- if(node){
- return modules.domUtils.getNodesByAttribute(node, 'rel').length;
- }
- return 0;
- };
-
-
-
- }
-
- return modules;
-
-} (Modules || {}));
diff --git a/toolkit/components/microformats/test/lib/parser.js b/toolkit/components/microformats/test/lib/parser.js
deleted file mode 100644
index 062ec9f0e..000000000
--- a/toolkit/components/microformats/test/lib/parser.js
+++ /dev/null
@@ -1,1453 +0,0 @@
-/*!
- Parser
-
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
- Dependencies dates.js, domutils.js, html.js, isodate,js, text.js, utilities.js, url.js
-*/
-
-
-var Modules = (function (modules) {
-
-
- /**
- * constructor
- *
- */
- modules.Parser = function () {
- this.rootPrefix = 'h-';
- this.propertyPrefixes = ['p-', 'dt-', 'u-', 'e-'];
- this.excludeTags = ['br', 'hr'];
- };
-
-
- // create objects incase the v1 map modules don't load
- modules.maps = (modules.maps)? modules.maps : {};
- modules.rels = (modules.rels)? modules.rels : {};
-
-
- modules.Parser.prototype = {
-
- init: function(){
- this.rootNode = null;
- this.document = null;
- this.options = {
- 'baseUrl': '',
- 'filters': [],
- 'textFormat': 'whitespacetrimmed',
- 'dateFormat': 'auto', // html5 for testing
- 'overlappingVersions': false,
- 'impliedPropertiesByVersion': true,
- 'parseLatLonGeo': false
- };
- this.rootID = 0;
- this.errors = [];
- this.noContentErr = 'No options.node or options.html was provided and no document object could be found.';
- },
-
-
- /**
- * internal parse function
- *
- * @param {Object} options
- * @return {Object}
- */
- get: function(options) {
- var out = this.formatEmpty(),
- data = [],
- rels;
-
- this.init();
- options = (options)? options : {};
- this.mergeOptions(options);
- this.getDOMContext( options );
-
- // if we do not have any context create error
- if(!this.rootNode || !this.document){
- this.errors.push(this.noContentErr);
- }else{
-
- // only parse h-* microformats if we need to
- // this is added to speed up parsing
- if(this.hasMicroformats(this.rootNode, options)){
- this.prepareDOM( options );
-
- if(this.options.filters.length > 0){
- // parse flat list of items
- var newRootNode = this.findFilterNodes(this.rootNode, this.options.filters);
- data = this.walkRoot(newRootNode);
- }else{
- // parse whole document from root
- data = this.walkRoot(this.rootNode);
- }
-
- out.items = data;
- // don't clear-up DOM if it was cloned
- if(modules.domUtils.canCloneDocument(this.document) === false){
- this.clearUpDom(this.rootNode);
- }
- }
-
- // find any rels
- if(this.findRels){
- rels = this.findRels(this.rootNode);
- out.rels = rels.rels;
- out['rel-urls'] = rels['rel-urls'];
- }
-
- }
-
- if(this.errors.length > 0){
- return this.formatError();
- }
- return out;
- },
-
-
- /**
- * parse to get parent microformat of passed node
- *
- * @param {DOM Node} node
- * @param {Object} options
- * @return {Object}
- */
- getParent: function(node, options) {
- this.init();
- options = (options)? options : {};
-
- if(node){
- return this.getParentTreeWalk(node, options);
- }else{
- this.errors.push(this.noContentErr);
- return this.formatError();
- }
- },
-
-
- /**
- * get the count of microformats
- *
- * @param {DOM Node} rootNode
- * @return {Int}
- */
- count: function( options ) {
- var out = {},
- items,
- classItems,
- x,
- i;
-
- this.init();
- options = (options)? options : {};
- this.getDOMContext( options );
-
- // if we do not have any context create error
- if(!this.rootNode || !this.document){
- return {'errors': [this.noContentErr]};
- }else{
-
- items = this.findRootNodes( this.rootNode, true );
- i = items.length;
- while(i--) {
- classItems = modules.domUtils.getAttributeList(items[i], 'class');
- x = classItems.length;
- while(x--) {
- // find v2 names
- if(modules.utils.startWith( classItems[x], 'h-' )){
- this.appendCount(classItems[x], 1, out);
- }
- // find v1 names
- for(var key in modules.maps) {
- // dont double count if v1 and v2 roots are present
- if(modules.maps[key].root === classItems[x] && classItems.indexOf(key) === -1) {
- this.appendCount(key, 1, out);
- }
- }
- }
- }
- var relCount = this.countRels( this.rootNode );
- if(relCount > 0){
- out.rels = relCount;
- }
-
- return out;
- }
- },
-
-
- /**
- * does a node have a class that marks it as a microformats root
- *
- * @param {DOM Node} node
- * @param {Objecte} options
- * @return {Boolean}
- */
- isMicroformat: function( node, options ) {
- var classes,
- i;
-
- if(!node){
- return false;
- }
-
- // if documemt gets topmost node
- node = modules.domUtils.getTopMostNode( node );
-
- // look for h-* microformats
- classes = this.getUfClassNames(node);
- if(options && options.filters && modules.utils.isArray(options.filters)){
- i = options.filters.length;
- while(i--) {
- if(classes.root.indexOf(options.filters[i]) > -1){
- return true;
- }
- }
- return false;
- }else{
- return (classes.root.length > 0);
- }
- },
-
-
- /**
- * does a node or its children have microformats
- *
- * @param {DOM Node} node
- * @param {Objecte} options
- * @return {Boolean}
- */
- hasMicroformats: function( node, options ) {
- var items,
- i;
-
- if(!node){
- return false;
- }
-
- // if browser based documemt get topmost node
- node = modules.domUtils.getTopMostNode( node );
-
- // returns all microformat roots
- items = this.findRootNodes( node, true );
- if(options && options.filters && modules.utils.isArray(options.filters)){
- i = items.length;
- while(i--) {
- if( this.isMicroformat( items[i], options ) ){
- return true;
- }
- }
- return false;
- }else{
- return (items.length > 0);
- }
- },
-
-
- /**
- * add a new v1 mapping object to parser
- *
- * @param {Array} maps
- */
- add: function( maps ){
- maps.forEach(function(map){
- if(map && map.root && map.name && map.properties){
- modules.maps[map.name] = JSON.parse(JSON.stringify(map));
- }
- });
- },
-
-
- /**
- * internal parse to get parent microformats by walking up the tree
- *
- * @param {DOM Node} node
- * @param {Object} options
- * @param {Int} recursive
- * @return {Object}
- */
- getParentTreeWalk: function (node, options, recursive) {
- options = (options)? options : {};
-
- // recursive calls
- if (recursive === undefined) {
- if (node.parentNode && node.nodeName !== 'HTML'){
- return this.getParentTreeWalk(node.parentNode, options, true);
- }else{
- return this.formatEmpty();
- }
- }
- if (node !== null && node !== undefined && node.parentNode) {
- if (this.isMicroformat( node, options )) {
- // if we have a match return microformat
- options.node = node;
- return this.get( options );
- }else{
- return this.getParentTreeWalk(node.parentNode, options, true);
- }
- }else{
- return this.formatEmpty();
- }
- },
-
-
-
- /**
- * configures what are the base DOM objects for parsing
- *
- * @param {Object} options
- */
- getDOMContext: function( options ){
- var nodes = modules.domUtils.getDOMContext( options );
- this.rootNode = nodes.rootNode;
- this.document = nodes.document;
- },
-
-
- /**
- * prepares DOM before the parse begins
- *
- * @param {Object} options
- * @return {Boolean}
- */
- prepareDOM: function( options ){
- var baseTag,
- href;
-
- // use current document to define baseUrl, try/catch needed for IE10+ error
- try {
- if (!options.baseUrl && this.document && this.document.location) {
- this.options.baseUrl = this.document.location.href;
- }
- } catch (e) {
- // there is no alt action
- }
-
-
- // find base tag to set baseUrl
- baseTag = modules.domUtils.querySelector(this.document,'base');
- if(baseTag) {
- href = modules.domUtils.getAttribute(baseTag, 'href');
- if(href){
- this.options.baseUrl = href;
- }
- }
-
- // get path to rootNode
- // then clone document
- // then reset the rootNode to its cloned version in a new document
- var path,
- newDocument,
- newRootNode;
-
- path = modules.domUtils.getNodePath(this.rootNode);
- newDocument = modules.domUtils.cloneDocument(this.document);
- newRootNode = modules.domUtils.getNodeByPath(newDocument, path);
-
- // check results as early IE fails
- if(newDocument && newRootNode){
- this.document = newDocument;
- this.rootNode = newRootNode;
- }
-
- // add includes
- if(this.addIncludes){
- this.addIncludes( this.document );
- }
-
- return (this.rootNode && this.document);
- },
-
-
- /**
- * returns an empty structure with errors
- *
- * @return {Object}
- */
- formatError: function(){
- var out = this.formatEmpty();
- out.errors = this.errors;
- return out;
- },
-
-
- /**
- * returns an empty structure
- *
- * @return {Object}
- */
- formatEmpty: function(){
- return {
- 'items': [],
- 'rels': {},
- 'rel-urls': {}
- };
- },
-
-
- // find microformats of a given type and return node structures
- findFilterNodes: function(rootNode, filters) {
- var newRootNode = modules.domUtils.createNode('div'),
- items = this.findRootNodes(rootNode, true),
- i = 0,
- x = 0,
- y = 0;
-
- if(items){
- i = items.length;
- while(x < i) {
- // add v1 names
- y = filters.length;
- while (y--) {
- if(this.getMapping(filters[y])){
- var v1Name = this.getMapping(filters[y]).root;
- filters.push(v1Name);
- }
- }
- // append matching nodes into newRootNode
- y = filters.length;
- while (y--) {
- if(modules.domUtils.hasAttributeValue(items[x], 'class', filters[y])){
- var clone = modules.domUtils.clone(items[x]);
- modules.domUtils.appendChild(newRootNode, clone);
- break;
- }
- }
- x++;
- }
- }
-
- return newRootNode;
- },
-
-
- /**
- * appends data to output object for count
- *
- * @param {string} name
- * @param {Int} count
- * @param {Object}
- */
- appendCount: function(name, count, out){
- if(out[name]){
- out[name] = out[name] + count;
- }else{
- out[name] = count;
- }
- },
-
-
- /**
- * is the microformats type in the filter list
- *
- * @param {Object} uf
- * @param {Array} filters
- * @return {Boolean}
- */
- shouldInclude: function(uf, filters) {
- var i;
-
- if(modules.utils.isArray(filters) && filters.length > 0) {
- i = filters.length;
- while(i--) {
- if(uf.type[0] === filters[i]) {
- return true;
- }
- }
- return false;
- } else {
- return true;
- }
- },
-
-
- /**
- * finds all microformat roots in a rootNode
- *
- * @param {DOM Node} rootNode
- * @param {Boolean} includeRoot
- * @return {Array}
- */
- findRootNodes: function(rootNode, includeRoot) {
- var arr = null,
- out = [],
- classList = [],
- items,
- x,
- i,
- y,
- key;
-
-
- // build an array of v1 root names
- for(key in modules.maps) {
- if (modules.maps.hasOwnProperty(key)) {
- classList.push(modules.maps[key].root);
- }
- }
-
- // get all elements that have a class attribute
- includeRoot = (includeRoot) ? includeRoot : false;
- if(includeRoot && rootNode.parentNode) {
- arr = modules.domUtils.getNodesByAttribute(rootNode.parentNode, 'class');
- } else {
- arr = modules.domUtils.getNodesByAttribute(rootNode, 'class');
- }
-
- // loop elements that have a class attribute
- x = 0;
- i = arr.length;
- while(x < i) {
-
- items = modules.domUtils.getAttributeList(arr[x], 'class');
-
- // loop classes on an element
- y = items.length;
- while(y--) {
- // match v1 root names
- if(classList.indexOf(items[y]) > -1) {
- out.push(arr[x]);
- break;
- }
-
- // match v2 root name prefix
- if(modules.utils.startWith(items[y], 'h-')) {
- out.push(arr[x]);
- break;
- }
- }
-
- x++;
- }
- return out;
- },
-
-
- /**
- * starts the tree walk to find microformats
- *
- * @param {DOM Node} node
- * @return {Array}
- */
- walkRoot: function(node){
- var context = this,
- children = [],
- child,
- classes,
- items = [],
- out = [];
-
- classes = this.getUfClassNames(node);
- // if it is a root microformat node
- if(classes && classes.root.length > 0){
- items = this.walkTree(node);
-
- if(items.length > 0){
- out = out.concat(items);
- }
- }else{
- // check if there are children and one of the children has a root microformat
- children = modules.domUtils.getChildren( node );
- if(children && children.length > 0 && this.findRootNodes(node, true).length > -1){
- for (var i = 0; i < children.length; i++) {
- child = children[i];
- items = context.walkRoot(child);
- if(items.length > 0){
- out = out.concat(items);
- }
- }
- }
- }
- return out;
- },
-
-
- /**
- * starts the tree walking for a single microformat
- *
- * @param {DOM Node} node
- * @return {Array}
- */
- walkTree: function(node) {
- var classes,
- out = [],
- obj,
- itemRootID;
-
- // loop roots found on one element
- classes = this.getUfClassNames(node);
- if(classes && classes.root.length && classes.root.length > 0){
-
- this.rootID++;
- itemRootID = this.rootID;
- obj = this.createUfObject(classes.root, classes.typeVersion);
-
- this.walkChildren(node, obj, classes.root, itemRootID, classes);
- if(this.impliedRules){
- this.impliedRules(node, obj, classes);
- }
- out.push( this.cleanUfObject(obj) );
-
-
- }
- return out;
- },
-
-
- /**
- * finds child properties of microformat
- *
- * @param {DOM Node} node
- * @param {Object} out
- * @param {String} ufName
- * @param {Int} rootID
- * @param {Object} parentClasses
- */
- walkChildren: function(node, out, ufName, rootID, parentClasses) {
- var context = this,
- children = [],
- rootItem,
- itemRootID,
- value,
- propertyName,
- propertyVersion,
- i,
- x,
- y,
- z,
- child;
-
- children = modules.domUtils.getChildren( node );
-
- y = 0;
- z = children.length;
- while(y < z) {
- child = children[y];
-
- // get microformat classes for this single element
- var classes = context.getUfClassNames(child, ufName);
-
- // a property which is a microformat
- if(classes.root.length > 0 && classes.properties.length > 0 && !child.addedAsRoot) {
- // create object with type, property and value
- rootItem = context.createUfObject(
- classes.root,
- classes.typeVersion,
- modules.text.parse(this.document, child, context.options.textFormat)
- );
-
- // add the microformat as an array of properties
- propertyName = context.removePropPrefix(classes.properties[0][0]);
-
- // modifies value with "implied value rule"
- if(parentClasses && parentClasses.root.length === 1 && parentClasses.properties.length === 1){
- if(context.impliedValueRule){
- out = context.impliedValueRule(out, parentClasses.properties[0][0], classes.properties[0][0], value);
- }
- }
-
- if(out.properties[propertyName]) {
- out.properties[propertyName].push(rootItem);
- } else {
- out.properties[propertyName] = [rootItem];
- }
-
- context.rootID++;
- // used to stop duplication in heavily nested structures
- child.addedAsRoot = true;
-
-
- x = 0;
- i = rootItem.type.length;
- itemRootID = context.rootID;
- while(x < i) {
- context.walkChildren(child, rootItem, rootItem.type, itemRootID, classes);
- x++;
- }
- if(this.impliedRules){
- context.impliedRules(child, rootItem, classes);
- }
- this.cleanUfObject(rootItem);
-
- }
-
- // a property which is NOT a microformat and has not been used for a given root element
- if(classes.root.length === 0 && classes.properties.length > 0) {
-
- x = 0;
- i = classes.properties.length;
- while(x < i) {
-
- value = context.getValue(child, classes.properties[x][0], out);
- propertyName = context.removePropPrefix(classes.properties[x][0]);
- propertyVersion = classes.properties[x][1];
-
- // modifies value with "implied value rule"
- if(parentClasses && parentClasses.root.length === 1 && parentClasses.properties.length === 1){
- if(context.impliedValueRule){
- out = context.impliedValueRule(out, parentClasses.properties[0][0], classes.properties[x][0], value);
- }
- }
-
- // if we have not added this value into a property with the same name already
- if(!context.hasRootID(child, rootID, propertyName)) {
- // check the root and property is the same version or if overlapping versions are allowed
- if( context.isAllowedPropertyVersion( out.typeVersion, propertyVersion ) ){
- // add the property as an array of properties
- if(out.properties[propertyName]) {
- out.properties[propertyName].push(value);
- } else {
- out.properties[propertyName] = [value];
- }
- // add rootid to node so we can track its use
- context.appendRootID(child, rootID, propertyName);
- }
- }
-
- x++;
- }
-
- context.walkChildren(child, out, ufName, rootID, classes);
- }
-
- // if the node has no microformat classes, see if its children have
- if(classes.root.length === 0 && classes.properties.length === 0) {
- context.walkChildren(child, out, ufName, rootID, classes);
- }
-
- // if the node is a child root add it to the children tree
- if(classes.root.length > 0 && classes.properties.length === 0) {
-
- // create object with type, property and value
- rootItem = context.createUfObject(
- classes.root,
- classes.typeVersion,
- modules.text.parse(this.document, child, context.options.textFormat)
- );
-
- // add the microformat as an array of properties
- if(!out.children){
- out.children = [];
- }
-
- if(!context.hasRootID(child, rootID, 'child-root')) {
- out.children.push( rootItem );
- context.appendRootID(child, rootID, 'child-root');
- context.rootID++;
- }
-
- x = 0;
- i = rootItem.type.length;
- itemRootID = context.rootID;
- while(x < i) {
- context.walkChildren(child, rootItem, rootItem.type, itemRootID, classes);
- x++;
- }
- if(this.impliedRules){
- context.impliedRules(child, rootItem, classes);
- }
- context.cleanUfObject( rootItem );
-
- }
-
-
-
- y++;
- }
-
- },
-
-
-
-
- /**
- * gets the value of a property from a node
- *
- * @param {DOM Node} node
- * @param {String} className
- * @param {Object} uf
- * @return {String || Object}
- */
- getValue: function(node, className, uf) {
- var value = '';
-
- if(modules.utils.startWith(className, 'p-')) {
- value = this.getPValue(node, true);
- }
-
- if(modules.utils.startWith(className, 'e-')) {
- value = this.getEValue(node);
- }
-
- if(modules.utils.startWith(className, 'u-')) {
- value = this.getUValue(node, true);
- }
-
- if(modules.utils.startWith(className, 'dt-')) {
- value = this.getDTValue(node, className, uf, true);
- }
- return value;
- },
-
-
- /**
- * gets the value of a node which contains a 'p-' property
- *
- * @param {DOM Node} node
- * @param {Boolean} valueParse
- * @return {String}
- */
- getPValue: function(node, valueParse) {
- var out = '';
- if(valueParse) {
- out = this.getValueClass(node, 'p');
- }
-
- if(!out && valueParse) {
- out = this.getValueTitle(node);
- }
-
- if(!out) {
- out = modules.domUtils.getAttrValFromTagList(node, ['abbr'], 'title');
- }
-
- if(!out) {
- out = modules.domUtils.getAttrValFromTagList(node, ['data','input'], 'value');
- }
-
- if(node.name === 'br' || node.name === 'hr') {
- out = '';
- }
-
- if(!out) {
- out = modules.domUtils.getAttrValFromTagList(node, ['img', 'area'], 'alt');
- }
-
- if(!out) {
- out = modules.text.parse(this.document, node, this.options.textFormat);
- }
-
- return(out) ? out : '';
- },
-
-
- /**
- * gets the value of a node which contains the 'e-' property
- *
- * @param {DOM Node} node
- * @return {Object}
- */
- getEValue: function(node) {
-
- var out = {value: '', html: ''};
-
- this.expandURLs(node, 'src', this.options.baseUrl);
- this.expandURLs(node, 'href', this.options.baseUrl);
-
- out.value = modules.text.parse(this.document, node, this.options.textFormat);
- out.html = modules.html.parse(node);
-
- return out;
- },
-
-
- /**
- * gets the value of a node which contains the 'u-' property
- *
- * @param {DOM Node} node
- * @param {Boolean} valueParse
- * @return {String}
- */
- getUValue: function(node, valueParse) {
- var out = '';
- if(valueParse) {
- out = this.getValueClass(node, 'u');
- }
-
- if(!out && valueParse) {
- out = this.getValueTitle(node);
- }
-
- if(!out) {
- out = modules.domUtils.getAttrValFromTagList(node, ['a', 'area'], 'href');
- }
-
- if(!out) {
- out = modules.domUtils.getAttrValFromTagList(node, ['img','audio','video','source'], 'src');
- }
-
- if(!out) {
- out = modules.domUtils.getAttrValFromTagList(node, ['object'], 'data');
- }
-
- // if we have no protocol separator, turn relative url to absolute url
- if(out && out !== '' && out.indexOf('://') === -1) {
- out = modules.url.resolve(out, this.options.baseUrl);
- }
-
- if(!out) {
- out = modules.domUtils.getAttrValFromTagList(node, ['abbr'], 'title');
- }
-
- if(!out) {
- out = modules.domUtils.getAttrValFromTagList(node, ['data','input'], 'value');
- }
-
- if(!out) {
- out = modules.text.parse(this.document, node, this.options.textFormat);
- }
-
- return(out) ? out : '';
- },
-
-
- /**
- * gets the value of a node which contains the 'dt-' property
- *
- * @param {DOM Node} node
- * @param {String} className
- * @param {Object} uf
- * @param {Boolean} valueParse
- * @return {String}
- */
- getDTValue: function(node, className, uf, valueParse) {
- var out = '';
-
- if(valueParse) {
- out = this.getValueClass(node, 'dt');
- }
-
- if(!out && valueParse) {
- out = this.getValueTitle(node);
- }
-
- if(!out) {
- out = modules.domUtils.getAttrValFromTagList(node, ['time', 'ins', 'del'], 'datetime');
- }
-
- if(!out) {
- out = modules.domUtils.getAttrValFromTagList(node, ['abbr'], 'title');
- }
-
- if(!out) {
- out = modules.domUtils.getAttrValFromTagList(node, ['data', 'input'], 'value');
- }
-
- if(!out) {
- out = modules.text.parse(this.document, node, this.options.textFormat);
- }
-
- if(out) {
- if(modules.dates.isDuration(out)) {
- // just duration
- return out;
- } else if(modules.dates.isTime(out)) {
- // just time or time+timezone
- if(uf) {
- uf.times.push([className, modules.dates.parseAmPmTime(out, this.options.dateFormat)]);
- }
- return modules.dates.parseAmPmTime(out, this.options.dateFormat);
- } else {
- // returns a date - microformat profile
- if(uf) {
- uf.dates.push([className, new modules.ISODate(out).toString( this.options.dateFormat )]);
- }
- return new modules.ISODate(out).toString( this.options.dateFormat );
- }
- } else {
- return '';
- }
- },
-
-
- /**
- * appends a new rootid to a given node
- *
- * @param {DOM Node} node
- * @param {String} id
- * @param {String} propertyName
- */
- appendRootID: function(node, id, propertyName) {
- if(this.hasRootID(node, id, propertyName) === false){
- var rootids = [];
- if(modules.domUtils.hasAttribute(node,'rootids')){
- rootids = modules.domUtils.getAttributeList(node,'rootids');
- }
- rootids.push('id' + id + '-' + propertyName);
- modules.domUtils.setAttribute(node, 'rootids', rootids.join(' '));
- }
- },
-
-
- /**
- * does a given node already have a rootid
- *
- * @param {DOM Node} node
- * @param {String} id
- * @param {String} propertyName
- * @return {Boolean}
- */
- hasRootID: function(node, id, propertyName) {
- var rootids = [];
- if(!modules.domUtils.hasAttribute(node,'rootids')){
- return false;
- } else {
- rootids = modules.domUtils.getAttributeList(node, 'rootids');
- return (rootids.indexOf('id' + id + '-' + propertyName) > -1);
- }
- },
-
-
-
- /**
- * gets the text of any child nodes with a class value
- *
- * @param {DOM Node} node
- * @param {String} propertyName
- * @return {String || null}
- */
- getValueClass: function(node, propertyType) {
- var context = this,
- children = [],
- out = [],
- child,
- x,
- i;
-
- children = modules.domUtils.getChildren( node );
-
- x = 0;
- i = children.length;
- while(x < i) {
- child = children[x];
- var value = null;
- if(modules.domUtils.hasAttributeValue(child, 'class', 'value')) {
- switch(propertyType) {
- case 'p':
- value = context.getPValue(child, false);
- break;
- case 'u':
- value = context.getUValue(child, false);
- break;
- case 'dt':
- value = context.getDTValue(child, '', null, false);
- break;
- }
- if(value) {
- out.push(modules.utils.trim(value));
- }
- }
- x++;
- }
- if(out.length > 0) {
- if(propertyType === 'p') {
- return modules.text.parseText( this.document, out.join(' '), this.options.textFormat);
- }
- if(propertyType === 'u') {
- return out.join('');
- }
- if(propertyType === 'dt') {
- return modules.dates.concatFragments(out,this.options.dateFormat).toString(this.options.dateFormat);
- }
- } else {
- return null;
- }
- },
-
-
- /**
- * returns a single string of the 'title' attr from all
- * the child nodes with the class 'value-title'
- *
- * @param {DOM Node} node
- * @return {String}
- */
- getValueTitle: function(node) {
- var out = [],
- items,
- i,
- x;
-
- items = modules.domUtils.getNodesByAttributeValue(node, 'class', 'value-title');
- x = 0;
- i = items.length;
- while(x < i) {
- if(modules.domUtils.hasAttribute(items[x], 'title')) {
- out.push(modules.domUtils.getAttribute(items[x], 'title'));
- }
- x++;
- }
- return out.join('');
- },
-
-
- /**
- * finds out whether a node has h-* class v1 and v2
- *
- * @param {DOM Node} node
- * @return {Boolean}
- */
- hasHClass: function(node){
- var classes = this.getUfClassNames(node);
- if(classes.root && classes.root.length > 0){
- return true;
- }else{
- return false;
- }
- },
-
-
- /**
- * get both the root and property class names from a node
- *
- * @param {DOM Node} node
- * @param {Array} ufNameArr
- * @return {Object}
- */
- getUfClassNames: function(node, ufNameArr) {
- var context = this,
- out = {
- 'root': [],
- 'properties': []
- },
- classNames,
- key,
- items,
- item,
- i,
- x,
- z,
- y,
- map,
- prop,
- propName,
- v2Name,
- impiedRel,
- ufName;
-
- // don't get classes from excluded list of tags
- if(modules.domUtils.hasTagName(node, this.excludeTags) === false){
-
- // find classes for node
- classNames = modules.domUtils.getAttribute(node, 'class');
- if(classNames) {
- items = classNames.split(' ');
- x = 0;
- i = items.length;
- while(x < i) {
-
- item = modules.utils.trim(items[x]);
-
- // test for root prefix - v2
- if(modules.utils.startWith(item, context.rootPrefix)) {
- if(out.root.indexOf(item) === -1){
- out.root.push(item);
- }
- out.typeVersion = 'v2';
- }
-
- // test for property prefix - v2
- z = context.propertyPrefixes.length;
- while(z--) {
- if(modules.utils.startWith(item, context.propertyPrefixes[z])) {
- out.properties.push([item,'v2']);
- }
- }
-
- // test for mapped root classnames v1
- for(key in modules.maps) {
- if(modules.maps.hasOwnProperty(key)) {
- // only add a root once
- if(modules.maps[key].root === item && out.root.indexOf(key) === -1) {
- // if root map has subTree set to true
- // test to see if we should create a property or root
- if(modules.maps[key].subTree) {
- out.properties.push(['p-' + modules.maps[key].root, 'v1']);
- } else {
- out.root.push(key);
- if(!out.typeVersion){
- out.typeVersion = 'v1';
- }
- }
- }
- }
- }
-
-
- // test for mapped property classnames v1
- if(ufNameArr){
- for (var a = 0; a < ufNameArr.length; a++) {
- ufName = ufNameArr[a];
- // get mapped property v1 microformat
- map = context.getMapping(ufName);
- if(map) {
- for(key in map.properties) {
- if (map.properties.hasOwnProperty(key)) {
-
- prop = map.properties[key];
- propName = (prop.map) ? prop.map : 'p-' + key;
-
- if(key === item) {
- if(prop.uf) {
- // loop all the classList make sure
- // 1. this property is a root
- // 2. that there is not already an equivalent v2 property i.e. url and u-url on the same element
- y = 0;
- while(y < i) {
- v2Name = context.getV2RootName(items[y]);
- // add new root
- if(prop.uf.indexOf(v2Name) > -1 && out.root.indexOf(v2Name) === -1) {
- out.root.push(v2Name);
- out.typeVersion = 'v1';
- }
- y++;
- }
- //only add property once
- if(out.properties.indexOf(propName) === -1) {
- out.properties.push([propName,'v1']);
- }
- } else {
- if(out.properties.indexOf(propName) === -1) {
- out.properties.push([propName,'v1']);
- }
- }
- }
- }
-
- }
- }
- }
-
- }
-
- x++;
-
- }
- }
- }
-
-
- // finds any alt rel=* mappings for a given node/microformat
- if(ufNameArr && this.findRelImpied){
- for (var b = 0; b < ufNameArr.length; b++) {
- ufName = ufNameArr[b];
- impiedRel = this.findRelImpied(node, ufName);
- if(impiedRel && out.properties.indexOf(impiedRel) === -1) {
- out.properties.push([impiedRel, 'v1']);
- }
- }
- }
-
-
- //if(out.root.length === 1 && out.properties.length === 1) {
- // if(out.root[0].replace('h-','') === this.removePropPrefix(out.properties[0][0])) {
- // out.typeVersion = 'v2';
- // }
- //}
-
- return out;
- },
-
-
- /**
- * given a v1 or v2 root name, return mapping object
- *
- * @param {String} name
- * @return {Object || null}
- */
- getMapping: function(name) {
- var key;
- for(key in modules.maps) {
- if(modules.maps[key].root === name || key === name) {
- return modules.maps[key];
- }
- }
- return null;
- },
-
-
- /**
- * given a v1 root name returns a v2 root name i.e. vcard >>> h-card
- *
- * @param {String} name
- * @return {String || null}
- */
- getV2RootName: function(name) {
- var key;
- for(key in modules.maps) {
- if(modules.maps[key].root === name) {
- return key;
- }
- }
- return null;
- },
-
-
- /**
- * whether a property is the right microformats version for its root type
- *
- * @param {String} typeVersion
- * @param {String} propertyVersion
- * @return {Boolean}
- */
- isAllowedPropertyVersion: function(typeVersion, propertyVersion){
- if(this.options.overlappingVersions === true){
- return true;
- }else{
- return (typeVersion === propertyVersion);
- }
- },
-
-
- /**
- * creates a blank microformats object
- *
- * @param {String} name
- * @param {String} value
- * @return {Object}
- */
- createUfObject: function(names, typeVersion, value) {
- var out = {};
-
- // is more than just whitespace
- if(value && modules.utils.isOnlyWhiteSpace(value) === false) {
- out.value = value;
- }
- // add type i.e. ["h-card", "h-org"]
- if(modules.utils.isArray(names)) {
- out.type = names;
- } else {
- out.type = [names];
- }
- out.properties = {};
- // metadata properties for parsing
- out.typeVersion = typeVersion;
- out.times = [];
- out.dates = [];
- out.altValue = null;
-
- return out;
- },
-
-
- /**
- * removes unwanted microformats property before output
- *
- * @param {Object} microformat
- */
- cleanUfObject: function( microformat ) {
- delete microformat.times;
- delete microformat.dates;
- delete microformat.typeVersion;
- delete microformat.altValue;
- return microformat;
- },
-
-
-
- /**
- * removes microformat property prefixes from text
- *
- * @param {String} text
- * @return {String}
- */
- removePropPrefix: function(text) {
- var i;
-
- i = this.propertyPrefixes.length;
- while(i--) {
- var prefix = this.propertyPrefixes[i];
- if(modules.utils.startWith(text, prefix)) {
- text = text.substr(prefix.length);
- }
- }
- return text;
- },
-
-
- /**
- * expands all relative URLs to absolute ones where it can
- *
- * @param {DOM Node} node
- * @param {String} attrName
- * @param {String} baseUrl
- */
- expandURLs: function(node, attrName, baseUrl){
- var i,
- nodes,
- attr;
-
- nodes = modules.domUtils.getNodesByAttribute(node, attrName);
- i = nodes.length;
- while (i--) {
- try{
- // the url parser can blow up if the format is not right
- attr = modules.domUtils.getAttribute(nodes[i], attrName);
- if(attr && attr !== '' && baseUrl !== '' && attr.indexOf('://') === -1) {
- //attr = urlParser.resolve(baseUrl, attr);
- attr = modules.url.resolve(attr, baseUrl);
- modules.domUtils.setAttribute(nodes[i], attrName, attr);
- }
- }catch(err){
- // do nothing - convert only the urls we can, leave the rest as they are
- }
- }
- },
-
-
-
- /**
- * merges passed and default options -single level clone of properties
- *
- * @param {Object} options
- */
- mergeOptions: function(options) {
- var key;
- for(key in options) {
- if(options.hasOwnProperty(key)) {
- this.options[key] = options[key];
- }
- }
- },
-
-
- /**
- * removes all rootid attributes
- *
- * @param {DOM Node} rootNode
- */
- removeRootIds: function(rootNode){
- var arr,
- i;
-
- arr = modules.domUtils.getNodesByAttribute(rootNode, 'rootids');
- i = arr.length;
- while(i--) {
- modules.domUtils.removeAttribute(arr[i],'rootids');
- }
- },
-
-
- /**
- * removes all changes made to the DOM
- *
- * @param {DOM Node} rootNode
- */
- clearUpDom: function(rootNode){
- if(this.removeIncludes){
- this.removeIncludes(rootNode);
- }
- this.removeRootIds(rootNode);
- }
-
-
- };
-
-
- modules.Parser.prototype.constructor = modules.Parser;
-
- return modules;
-
-} (Modules || {}));
-
-
-
diff --git a/toolkit/components/microformats/test/lib/text.js b/toolkit/components/microformats/test/lib/text.js
deleted file mode 100644
index fe94dae0a..000000000
--- a/toolkit/components/microformats/test/lib/text.js
+++ /dev/null
@@ -1,151 +0,0 @@
-/*
- text
- Extracts text string from DOM nodes. Was created to extract text in a whitespace-normalized form.
- It works like a none-CSS aware version of IE's innerText function. DO NOT replace this module
- with functions such as textContent as it will reduce the quality of data provided to the API user.
-
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
- Dependencies utilities.js, domutils.js
-*/
-
-
-var Modules = (function (modules) {
-
-
- modules.text = {
-
- // normalised or whitespace or whitespacetrimmed
- textFormat: 'whitespacetrimmed',
-
- // block level tags, used to add line returns
- blockLevelTags: ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'p', 'hr', 'pre', 'table',
- 'address', 'article', 'aside', 'blockquote', 'caption', 'col', 'colgroup', 'dd', 'div',
- 'dt', 'dir', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'header', 'hgroup', 'hr',
- 'li', 'map', 'menu', 'nav', 'optgroup', 'option', 'section', 'tbody', 'testarea',
- 'tfoot', 'th', 'thead', 'tr', 'td', 'ul', 'ol', 'dl', 'details'],
-
- // tags to exclude
- excludeTags: ['noframe', 'noscript', 'template', 'script', 'style', 'frames', 'frameset'],
-
-
- /**
- * parses the text from the DOM Node
- *
- * @param {DOM Node} node
- * @param {String} textFormat
- * @return {String}
- */
- parse: function(doc, node, textFormat){
- var out;
- this.textFormat = (textFormat)? textFormat : this.textFormat;
- if(this.textFormat === 'normalised'){
- out = this.walkTreeForText( node );
- if(out !== undefined){
- return this.normalise( doc, out );
- }else{
- return '';
- }
- }else{
- return this.formatText( doc, modules.domUtils.textContent(node), this.textFormat );
- }
- },
-
-
- /**
- * parses the text from a html string
- *
- * @param {DOM Document} doc
- * @param {String} text
- * @param {String} textFormat
- * @return {String}
- */
- parseText: function( doc, text, textFormat ){
- var node = modules.domUtils.createNodeWithText( 'div', text );
- return this.parse( doc, node, textFormat );
- },
-
-
- /**
- * parses the text from a html string - only for whitespace or whitespacetrimmed formats
- *
- * @param {String} text
- * @param {String} textFormat
- * @return {String}
- */
- formatText: function( doc, text, textFormat ){
- this.textFormat = (textFormat)? textFormat : this.textFormat;
- if(text){
- var out = '',
- regex = /(<([^>]+)>)/ig;
-
- out = text.replace(regex, '');
- if(this.textFormat === 'whitespacetrimmed') {
- out = modules.utils.trimWhitespace( out );
- }
-
- //return entities.decode( out, 2 );
- return modules.domUtils.decodeEntities( doc, out );
- }else{
- return '';
- }
- },
-
-
- /**
- * normalises whitespace in given text
- *
- * @param {String} text
- * @return {String}
- */
- normalise: function( doc, text ){
- text = text.replace( /&nbsp;/g, ' ') ; // exchanges html entity for space into space char
- text = modules.utils.collapseWhiteSpace( text ); // removes linefeeds, tabs and addtional spaces
- text = modules.domUtils.decodeEntities( doc, text ); // decode HTML entities
- text = text.replace( '–', '-' ); // correct dash decoding
- return modules.utils.trim( text );
- },
-
-
- /**
- * walks DOM tree parsing the text from DOM Nodes
- *
- * @param {DOM Node} node
- * @return {String}
- */
- walkTreeForText: function( node ) {
- var out = '',
- j = 0;
-
- if(node.tagName && this.excludeTags.indexOf( node.tagName.toLowerCase() ) > -1){
- return out;
- }
-
- // if node is a text node get its text
- if(node.nodeType && node.nodeType === 3){
- out += modules.domUtils.getElementText( node );
- }
-
- // get the text of the child nodes
- if(node.childNodes && node.childNodes.length > 0){
- for (j = 0; j < node.childNodes.length; j++) {
- var text = this.walkTreeForText( node.childNodes[j] );
- if(text !== undefined){
- out += text;
- }
- }
- }
-
- // if it's a block level tag add an additional space at the end
- if(node.tagName && this.blockLevelTags.indexOf( node.tagName.toLowerCase() ) !== -1){
- out += ' ';
- }
-
- return (out === '')? undefined : out ;
- }
-
- };
-
- return modules;
-
-} (Modules || {}));
diff --git a/toolkit/components/microformats/test/lib/url.js b/toolkit/components/microformats/test/lib/url.js
deleted file mode 100644
index 81ed9f29e..000000000
--- a/toolkit/components/microformats/test/lib/url.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- url
- Where possible use the modern window.URL API if its not available use the DOMParser method.
-
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
-
- modules.url = {
-
-
- /**
- * creates DOM objects needed to resolve URLs
- */
- init: function(){
- //this._domParser = new DOMParser();
- this._domParser = modules.domUtils.getDOMParser();
- // do not use a head tag it does not work with IE9
- this._html = '<base id="base" href=""></base><a id="link" href=""></a>';
- this._nodes = this._domParser.parseFromString( this._html, 'text/html' );
- this._baseNode = modules.domUtils.getElementById(this._nodes,'base');
- this._linkNode = modules.domUtils.getElementById(this._nodes,'link');
- },
-
-
- /**
- * resolves url to absolute version using baseUrl
- *
- * @param {String} url
- * @param {String} baseUrl
- * @return {String}
- */
- resolve: function(url, baseUrl) {
- // use modern URL web API where we can
- if(modules.utils.isString(url) && modules.utils.isString(baseUrl) && url.indexOf('://') === -1){
- // this try catch is required as IE has an URL object but no constuctor support
- // http://glennjones.net/articles/the-problem-with-window-url
- try {
- var resolved = new URL(url, baseUrl).toString();
- // deal with early Webkit not throwing an error - for Safari
- if(resolved === '[object URL]'){
- resolved = URI.resolve(baseUrl, url);
- }
- return resolved;
- }catch(e){
- // otherwise fallback to DOM
- if(this._domParser === undefined){
- this.init();
- }
-
- // do not use setAttribute it does not work with IE9
- this._baseNode.href = baseUrl;
- this._linkNode.href = url;
-
- // dont use getAttribute as it returns orginal value not resolved
- return this._linkNode.href;
- }
- }else{
- if(modules.utils.isString(url)){
- return url;
- }
- return '';
- }
- },
-
- };
-
- return modules;
-
-} (Modules || {}));
diff --git a/toolkit/components/microformats/test/lib/utilities.js b/toolkit/components/microformats/test/lib/utilities.js
deleted file mode 100644
index c54714811..000000000
--- a/toolkit/components/microformats/test/lib/utilities.js
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
- Utilities
-
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var Modules = (function (modules) {
-
- modules.utils = {
-
- /**
- * is the object a string
- *
- * @param {Object} obj
- * @return {Boolean}
- */
- isString: function( obj ) {
- return typeof( obj ) === 'string';
- },
-
- /**
- * is the object a number
- *
- * @param {Object} obj
- * @return {Boolean}
- */
- isNumber: function( obj ) {
- return !isNaN(parseFloat( obj )) && isFinite( obj );
- },
-
-
- /**
- * is the object an array
- *
- * @param {Object} obj
- * @return {Boolean}
- */
- isArray: function( obj ) {
- return obj && !( obj.propertyIsEnumerable( 'length' ) ) && typeof obj === 'object' && typeof obj.length === 'number';
- },
-
-
- /**
- * is the object a function
- *
- * @param {Object} obj
- * @return {Boolean}
- */
- isFunction: function(obj) {
- return !!(obj && obj.constructor && obj.call && obj.apply);
- },
-
-
- /**
- * does the text start with a test string
- *
- * @param {String} text
- * @param {String} test
- * @return {Boolean}
- */
- startWith: function( text, test ) {
- return(text.indexOf(test) === 0);
- },
-
-
- /**
- * removes spaces at front and back of text
- *
- * @param {String} text
- * @return {String}
- */
- trim: function( text ) {
- if(text && this.isString(text)){
- return (text.trim())? text.trim() : text.replace(/^\s+|\s+$/g, '');
- }else{
- return '';
- }
- },
-
-
- /**
- * replaces a character in text
- *
- * @param {String} text
- * @param {Int} index
- * @param {String} character
- * @return {String}
- */
- replaceCharAt: function( text, index, character ) {
- if(text && text.length > index){
- return text.substr(0, index) + character + text.substr(index+character.length);
- }else{
- return text;
- }
- },
-
-
- /**
- * removes whitespace, tabs and returns from start and end of text
- *
- * @param {String} text
- * @return {String}
- */
- trimWhitespace: function( text ){
- if(text && text.length){
- var i = text.length,
- x = 0;
-
- // turn all whitespace chars at end into spaces
- while (i--) {
- if(this.isOnlyWhiteSpace(text[i])){
- text = this.replaceCharAt( text, i, ' ' );
- }else{
- break;
- }
- }
-
- // turn all whitespace chars at start into spaces
- i = text.length;
- while (x < i) {
- if(this.isOnlyWhiteSpace(text[x])){
- text = this.replaceCharAt( text, i, ' ' );
- }else{
- break;
- }
- x++;
- }
- }
- return this.trim(text);
- },
-
-
- /**
- * does text only contain whitespace characters
- *
- * @param {String} text
- * @return {Boolean}
- */
- isOnlyWhiteSpace: function( text ){
- return !(/[^\t\n\r ]/.test( text ));
- },
-
-
- /**
- * removes whitespace from text (leaves a single space)
- *
- * @param {String} text
- * @return {Sring}
- */
- collapseWhiteSpace: function( text ){
- return text.replace(/[\t\n\r ]+/g, ' ');
- },
-
-
- /**
- * does an object have any of its own properties
- *
- * @param {Object} obj
- * @return {Boolean}
- */
- hasProperties: function( obj ) {
- var key;
- for(key in obj) {
- if( obj.hasOwnProperty( key ) ) {
- return true;
- }
- }
- return false;
- },
-
-
- /**
- * a sort function - to sort objects in an array by a given property
- *
- * @param {String} property
- * @param {Boolean} reverse
- * @return {Int}
- */
- sortObjects: function(property, reverse) {
- reverse = (reverse) ? -1 : 1;
- return function (a, b) {
- a = a[property];
- b = b[property];
- if (a < b) {
- return reverse * -1;
- }
- if (a > b) {
- return reverse * 1;
- }
- return 0;
- };
- }
-
- };
-
- return modules;
-
-} (Modules || {}));
-
-
-
-
-
-
-
diff --git a/toolkit/components/microformats/test/lib/version.js b/toolkit/components/microformats/test/lib/version.js
deleted file mode 100644
index 371272cff..000000000
--- a/toolkit/components/microformats/test/lib/version.js
+++ /dev/null
@@ -1 +0,0 @@
- modules.version = '1.4.0';
diff --git a/toolkit/components/microformats/test/marionette/microformats_tester.py b/toolkit/components/microformats/test/marionette/microformats_tester.py
deleted file mode 100644
index 69fcb60ba..000000000
--- a/toolkit/components/microformats/test/marionette/microformats_tester.py
+++ /dev/null
@@ -1,170 +0,0 @@
-import threading
-import SimpleHTTPServer
-import SocketServer
-import BaseHTTPServer
-import urllib
-import urlparse
-import os
-import posixpath
-
-from marionette_driver.errors import NoSuchElementException
-from marionette_harness import MarionetteTestCase
-
-DEBUG = True
-
-# Example taken from mozilla-central/browser/components/loop/
-
-# XXX Once we're on a branch with bug 993478 landed, we may want to get
-# rid of this HTTP server and just use the built-in one from Marionette,
-# since there will less code to maintain, and it will be faster. We'll
-# need to consider whether this code wants to be shared with WebDriver tests
-# for other browsers, though.
-
-class ThreadingSimpleServer(SocketServer.ThreadingMixIn,
- BaseHTTPServer.HTTPServer):
- pass
-
-
-class HttpRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler, object):
- def __init__(self, *args):
- # set root to toolkit/components/microformats/
- self.root = os.path.dirname(os.path.dirname(os.path.dirname(os.path.normpath(__file__))))
- super(HttpRequestHandler, self).__init__(*args)
-
- def log_message(self, format, *args, **kwargs):
- if DEBUG:
- super(HttpRequestHandler, self).log_message(format, *args, **kwargs)
-
- def translate_path(self, path):
- """Translate a /-separated PATH to the local filename syntax.
-
- Components that mean special things to the local file system
- (e.g. drive or directory names) are ignored. (XXX They should
- probably be diagnosed.)
-
- """
- # abandon query parameters
- path = path.split('?',1)[0]
- path = path.split('#',1)[0]
- # Don't forget explicit trailing slash when normalizing. Issue17324
- trailing_slash = path.rstrip().endswith('/')
- path = posixpath.normpath(urllib.unquote(path))
- words = path.split('/')
- words = filter(None, words)
- path = self.root
- for word in words:
- drive, word = os.path.splitdrive(word)
- head, word = os.path.split(word)
- if word in (os.curdir, os.pardir): continue
- path = os.path.join(path, word)
- if trailing_slash:
- path += '/'
- return path
-
-class BaseTestFrontendUnits(MarionetteTestCase):
-
- @classmethod
- def setUpClass(cls):
- super(BaseTestFrontendUnits, cls).setUpClass()
-
- # Port 0 means to select an arbitrary unused port
- cls.server = ThreadingSimpleServer(('', 0), HttpRequestHandler)
- cls.ip, cls.port = cls.server.server_address
-
- cls.server_thread = threading.Thread(target=cls.server.serve_forever)
- cls.server_thread.daemon = False
- cls.server_thread.start()
-
- @classmethod
- def tearDownClass(cls):
- cls.server.shutdown()
- cls.server_thread.join()
-
- # make sure everything gets GCed so it doesn't interfere with the next
- # test class. Even though this is class-static, each subclass gets
- # its own instance of this stuff.
- cls.server_thread = None
- cls.server = None
-
- def setUp(self):
- super(BaseTestFrontendUnits, self).setUp()
-
- # Unfortunately, enforcing preferences currently comes with the side
- # effect of launching and restarting the browser before running the
- # real functional tests. Bug 1048554 has been filed to track this.
- #
- # Note: when e10s is enabled by default, this pref can go away. The automatic
- # restart will also go away if this is still the only pref set here.
- self.marionette.enforce_gecko_prefs({
- "browser.tabs.remote.autostart": True
- })
-
- # This extends the timeout for find_element. We need this as the tests
- # take an amount of time to run after loading, which we have to wait for.
- self.marionette.timeout.implicit = 120
-
- self.marionette.timeout.page_load = 120
-
- # srcdir_path should be the directory relative to this file.
- def set_server_prefix(self, srcdir_path):
- self.server_prefix = urlparse.urljoin("http://localhost:" + str(self.port),
- srcdir_path)
-
- def check_page(self, page):
-
- self.marionette.navigate(urlparse.urljoin(self.server_prefix, page))
- try:
- self.marionette.find_element("id", 'complete')
- except NoSuchElementException:
- fullPageUrl = urlparse.urljoin(self.relPath, page)
-
- details = "%s: 1 failure encountered\n%s" % \
- (fullPageUrl,
- self.get_failure_summary(
- fullPageUrl, "Waiting for Completion",
- "Could not find the test complete indicator"))
-
- raise AssertionError(details)
-
- fail_node = self.marionette.find_element("css selector",
- '.failures > em')
- if fail_node.text == "0":
- return
-
- # This may want to be in a more general place triggerable by an env
- # var some day if it ends up being something we need often:
- #
- # If you have browser-based unit tests which work when loaded manually
- # but not from marionette, uncomment the two lines below to break
- # on failing tests, so that the browsers won't be torn down, and you
- # can use the browser debugging facilities to see what's going on.
- #from ipdb import set_trace
- #set_trace()
-
- raise AssertionError(self.get_failure_details(page))
-
- def get_failure_summary(self, fullPageUrl, testName, testError):
- return "TEST-UNEXPECTED-FAIL | %s | %s - %s" % (fullPageUrl, testName, testError)
-
- def get_failure_details(self, page):
- fail_nodes = self.marionette.find_elements("css selector",
- '.test.fail')
- fullPageUrl = urlparse.urljoin(self.relPath, page)
-
- details = ["%s: %d failure(s) encountered:" % (fullPageUrl, len(fail_nodes))]
-
- for node in fail_nodes:
- errorText = node.find_element("css selector", '.error').text
-
- # We have to work our own failure message here, as we could be reporting multiple failures.
- # XXX Ideally we'd also give the full test tree for <test name> - that requires walking
- # up the DOM tree.
-
- # Format: TEST-UNEXPECTED-FAIL | <filename> | <test name> - <test error>
- details.append(
- self.get_failure_summary(page,
- node.find_element("tag name", 'h2').text.split("\n")[0],
- errorText.split("\n")[0]))
- details.append(
- errorText)
- return "\n".join(details)
diff --git a/toolkit/components/microformats/test/marionette/test_interface.py b/toolkit/components/microformats/test/marionette/test_interface.py
deleted file mode 100644
index aa34ef1c2..000000000
--- a/toolkit/components/microformats/test/marionette/test_interface.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# Code example copied from mozilla-central/browser/components/loop/
-# need to get this dir in the path so that we make the import work
-import os
-import sys
-sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'marionette'))
-
-from microformats_tester import BaseTestFrontendUnits
-
-
-class TestInterfaceUnits(BaseTestFrontendUnits):
-
- def setUp(self):
- super(TestInterfaceUnits, self).setUp()
- self.set_server_prefix("/test/interface-tests/")
-
- def test_units(self):
- self.check_page("index.html")
diff --git a/toolkit/components/microformats/test/marionette/test_modules.py b/toolkit/components/microformats/test/marionette/test_modules.py
deleted file mode 100644
index f2291259c..000000000
--- a/toolkit/components/microformats/test/marionette/test_modules.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# Code example copied from mozilla-central/browser/components/loop/
-# need to get this dir in the path so that we make the import work
-import os
-import sys
-sys.path.append(os.path.join(os.path.dirname(__file__), '..', 'marionette'))
-
-from microformats_tester import BaseTestFrontendUnits
-
-
-class TestModulesUnits(BaseTestFrontendUnits):
-
- def setUp(self):
- super(TestModulesUnits, self).setUp()
- self.set_server_prefix("/test/module-tests/")
-
- def test_units(self):
- self.check_page("index.html")
diff --git a/toolkit/components/microformats/test/marionette/test_standards.py b/toolkit/components/microformats/test/marionette/test_standards.py
deleted file mode 100644
index ec688fe78..000000000
--- a/toolkit/components/microformats/test/marionette/test_standards.py
+++ /dev/null
@@ -1,17 +0,0 @@
-# Code example copied from mozilla-central/browser/components/loop/
-# need to get this dir in the path so that we make the import work
-import os
-import sys
-sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '..', 'marionette')))
-
-from microformats_tester import BaseTestFrontendUnits
-
-
-class TestStandardsUnits(BaseTestFrontendUnits):
-
- def setUp(self):
- super(TestStandardsUnits, self).setUp()
- self.set_server_prefix("/test/standards-tests/")
-
- def test_units(self):
- self.check_page("index.html")
diff --git a/toolkit/components/microformats/test/module-tests/dates-test.js b/toolkit/components/microformats/test/module-tests/dates-test.js
deleted file mode 100644
index e5e034190..000000000
--- a/toolkit/components/microformats/test/module-tests/dates-test.js
+++ /dev/null
@@ -1,113 +0,0 @@
-/*
-Unit test for dates
-*/
-
-assert = chai.assert;
-
-// Tests the private Modules.dates object
-// Modules.dates is unit tested as it has an interface access by other modules
-
-
-describe('Modules.dates', function() {
-
-
- it('hasAM', function(){
- assert.isTrue( Modules.dates.hasAM( '5am' ) );
- assert.isTrue( Modules.dates.hasAM( '5AM' ) );
- assert.isTrue( Modules.dates.hasAM( '5 am' ) );
- assert.isTrue( Modules.dates.hasAM( '5a.m.' ) );
- assert.isTrue( Modules.dates.hasAM( '5:20 a.m.' ) );
- assert.isFalse( Modules.dates.hasAM( '5pm' ) );
- });
-
-
- it('hasPM', function(){
- assert.isTrue( Modules.dates.hasPM( '5pm' ) );
- assert.isTrue( Modules.dates.hasPM( '5PM' ) );
- assert.isTrue( Modules.dates.hasPM( '5 pm' ) );
- assert.isTrue( Modules.dates.hasPM( '5p.m.' ) );
- assert.isTrue( Modules.dates.hasPM( '5:20 p.m.' ) );
- assert.isFalse( Modules.dates.hasPM( '5am' ) );
- });
-
-
- it('removeAMPM', function(){
- assert.equal( Modules.dates.removeAMPM( '5pm' ), '5' );
- assert.equal( Modules.dates.removeAMPM( '5 pm' ), '5 ' );
- assert.equal( Modules.dates.removeAMPM( '5p.m.' ), '5' );
- assert.equal( Modules.dates.removeAMPM( '5am' ), '5' );
- assert.equal( Modules.dates.removeAMPM( '5a.m.' ), '5' );
- assert.equal( Modules.dates.removeAMPM( '5' ), '5' );
- });
-
-
- it('isDuration', function(){
- assert.isTrue( Modules.dates.isDuration( 'PY17M' ) );
- assert.isTrue( Modules.dates.isDuration( 'PW12' ) );
- assert.isTrue( Modules.dates.isDuration( 'P0.5Y' ) );
- assert.isTrue( Modules.dates.isDuration( 'P3Y6M4DT12H30M5S' ) );
- assert.isFalse( Modules.dates.isDuration( '2015-01-23T13:45' ) );
- assert.isFalse( Modules.dates.isDuration( '2015-01-23 13:45' ) );
- assert.isFalse( Modules.dates.isDuration( '20150123T1345' ) );
- });
-
-
- it('isTime', function(){
- assert.isTrue( Modules.dates.isTime( '8:43' ) );
- assert.isTrue( Modules.dates.isTime( '08:43' ) );
- assert.isTrue( Modules.dates.isTime( '15:23:00:0567' ) );
- assert.isTrue( Modules.dates.isTime( '10:34pm' ) );
- assert.isTrue( Modules.dates.isTime( '10:34 p.m.' ) );
- assert.isTrue( Modules.dates.isTime( '+01:00:00' ) );
- assert.isTrue( Modules.dates.isTime( '-02:00' ) );
- assert.isTrue( Modules.dates.isTime( 'z15:00' ) );
- assert.isTrue( Modules.dates.isTime( '0843' ) );
- assert.isFalse( Modules.dates.isTime( 'P3Y6M4DT12H30M5S' ) );
- assert.isFalse( Modules.dates.isTime( '2015-01-23T13:45' ) );
- assert.isFalse( Modules.dates.isTime( '2015-01-23 13:45' ) );
- assert.isFalse( Modules.dates.isTime( '20150123T1345' ) );
- assert.isFalse( Modules.dates.isTime( 'abc' ) );
- assert.isFalse( Modules.dates.isTime( '12345' ) );
- });
-
-
- it('parseAmPmTime', function(){
- assert.equal( Modules.dates.parseAmPmTime( '5am' ), '05' );
- assert.equal( Modules.dates.parseAmPmTime( '12pm' ), '12' );
- assert.equal( Modules.dates.parseAmPmTime( '5a.m.' ), '05' );
- assert.equal( Modules.dates.parseAmPmTime( '5pm' ), '17' );
- assert.equal( Modules.dates.parseAmPmTime( '5:34pm' ), '17:34' );
- assert.equal( Modules.dates.parseAmPmTime( '5:04pm' ), '17:04' );
- assert.equal( Modules.dates.parseAmPmTime( '05:34:00' ), '05:34:00' );
- assert.equal( Modules.dates.parseAmPmTime( '05:34:00' ), '05:34:00' );
- assert.equal( Modules.dates.parseAmPmTime( '1:52:04pm' ), '13:52:04' );
- });
-
-
- it('dateTimeUnion', function(){
- assert.equal( Modules.dates.dateTimeUnion( '2015-01-23', '05:34:00', 'HTML5' ).toString('HTML5'), '2015-01-23 05:34:00' );
- assert.equal( Modules.dates.dateTimeUnion( '2015-01-23', '05:34', 'HTML5' ).toString('HTML5'), '2015-01-23 05:34' );
- assert.equal( Modules.dates.dateTimeUnion( '2015-01-23', '05', 'HTML5' ).toString('HTML5'), '2015-01-23 05' );
- assert.equal( Modules.dates.dateTimeUnion( '2009-06-26T19:00', '2200', 'HTML5' ).toString('HTML5'), '2009-06-26 22:00' );
-
- assert.equal( Modules.dates.dateTimeUnion( '2015-01-23', '', 'HTML5' ).toString('HTML5'), '2015-01-23' );
- assert.equal( Modules.dates.dateTimeUnion( '', '', 'HTML5' ).toString('HTML5'), '' );
- });
-
-
- it('concatFragments', function(){
- assert.equal( Modules.dates.concatFragments( ['2015-01-23', '05:34:00'], 'HTML5' ).toString('HTML5'), '2015-01-23 05:34:00' );
- assert.equal( Modules.dates.concatFragments( ['05:34:00', '2015-01-23'], 'HTML5' ).toString('HTML5'), '2015-01-23 05:34:00' );
- assert.equal( Modules.dates.concatFragments( ['2015-01-23T05:34:00'], 'HTML5' ).toString('HTML5'), '2015-01-23 05:34:00' );
- assert.equal( Modules.dates.concatFragments( ['2015-01-23', '05:34:00', 'z'], 'HTML5' ).toString('HTML5'), '2015-01-23 05:34:00Z' );
- assert.equal( Modules.dates.concatFragments( ['2015-01-23', '05:34', '-01'], 'HTML5' ).toString('HTML5'), '2015-01-23 05:34-01' );
- assert.equal( Modules.dates.concatFragments( ['2015-01-23', '05:34', '-01:00'], 'HTML5' ).toString('HTML5'), '2015-01-23 05:34-01:00' );
- assert.equal( Modules.dates.concatFragments( ['2015-01-23', '05:34-01:00'], 'HTML5' ).toString('HTML5'), '2015-01-23 05:34-01:00' );
-
- });
-
-
-
-
-
-});
diff --git a/toolkit/components/microformats/test/module-tests/domutils-test.js b/toolkit/components/microformats/test/module-tests/domutils-test.js
deleted file mode 100644
index 5d3f036a9..000000000
--- a/toolkit/components/microformats/test/module-tests/domutils-test.js
+++ /dev/null
@@ -1,206 +0,0 @@
-/*
-Unit test for domutils
-*/
-
-assert = chai.assert;
-
-
-// Tests the private Modules.domUtils object
-// Modules.domUtils is unit tested as it has an interface access by other modules
-
-
-describe('Modules.domutils', function() {
-
-
- it('ownerDocument', function(){
- var node = document.createElement('div');
- assert.equal( Modules.domUtils.ownerDocument( node ).nodeType, 9);
- });
-
-
- it('innerHTML', function(){
- var html = '<a href="http://glennjones.net">Glenn Jones</a>',
- node = document.createElement('div');
-
- node.innerHTML = html;
- assert.equal( Modules.domUtils.innerHTML( node ), html );
- });
-
-
- it('hasAttribute', function(){
- var node = document.createElement('a');
-
- node.href = 'http://glennjones.net';
- assert.isTrue( Modules.domUtils.hasAttribute( node, 'href' ) );
- assert.isFalse( Modules.domUtils.hasAttribute( node, 'class' ) );
- });
-
-
- it('hasAttributeValue', function(){
- var node = document.createElement('a');
-
- node.href = 'http://glennjones.net';
- assert.isTrue( Modules.domUtils.hasAttributeValue( node, 'href', 'http://glennjones.net' ) );
- assert.isFalse( Modules.domUtils.hasAttributeValue( node, 'href', 'http://example.net' ) );
- assert.isFalse( Modules.domUtils.hasAttributeValue( node, 'class', 'test' ) );
- });
-
-
- it('getAttribute', function(){
- var node = document.createElement('a');
-
- node.href = 'http://glennjones.net';
- assert.equal( Modules.domUtils.getAttribute( node, 'href' ), 'http://glennjones.net' );
- });
-
-
- it('setAttribute', function(){
- var node = document.createElement('a');
-
- Modules.domUtils.setAttribute(node, 'href', 'http://glennjones.net')
- assert.equal( Modules.domUtils.getAttribute( node, 'href' ), 'http://glennjones.net' );
- });
-
-
- it('removeAttribute', function(){
- var node = document.createElement('a');
-
- node.href = 'http://glennjones.net';
- Modules.domUtils.removeAttribute(node, 'href')
- assert.isFalse( Modules.domUtils.hasAttribute( node, 'href' ) );
- });
-
-
- it('getAttributeList', function(){
- var node = document.createElement('a');
-
- node.rel = 'next';
- assert.deepEqual( Modules.domUtils.getAttributeList( node, 'rel'), ['next'] );
- node.rel = 'next bookmark';
- assert.deepEqual( Modules.domUtils.getAttributeList( node, 'rel'), ['next','bookmark'] );
- });
-
-
- it('hasAttributeValue', function(){
- var node = document.createElement('a');
-
- node.href = 'http://glennjones.net';
- node.rel = 'next bookmark';
- assert.isTrue( Modules.domUtils.hasAttributeValue( node, 'href', 'http://glennjones.net' ) );
- assert.isFalse( Modules.domUtils.hasAttributeValue( node, 'href', 'http://codebits.glennjones.net' ) );
- assert.isFalse( Modules.domUtils.hasAttributeValue( node, 'class', 'p-name' ) );
- assert.isTrue( Modules.domUtils.hasAttributeValue( node, 'rel', 'bookmark' ) );
- assert.isFalse( Modules.domUtils.hasAttributeValue( node, 'rel', 'previous' ) );
- });
-
-
- it('getNodesByAttribute', function(){
- var node = document.createElement('ul');
- node.innerHTML = '<li class="h-card">one</li><li>two</li><li class="h-card">three</li>';
-
- assert.equal( Modules.domUtils.getNodesByAttribute( node, 'class' ).length, 2 );
- assert.equal( Modules.domUtils.getNodesByAttribute( node, 'href' ).length, 0 );
- });
-
-
- it('getNodesByAttributeValue', function(){
- var node = document.createElement('ul');
- node.innerHTML = '<li class="h-card">one</li><li>two</li><li class="h-card">three</li><li class="p-name">four</li>';
-
- assert.equal( Modules.domUtils.getNodesByAttributeValue( node, 'class', 'h-card' ).length, 2 );
- assert.equal( Modules.domUtils.getNodesByAttributeValue( node, 'class', 'p-name' ).length, 1 );
- assert.equal( Modules.domUtils.getNodesByAttributeValue( node, 'class', 'u-url' ).length, 0 );
- });
-
-
- it('getAttrValFromTagList', function(){
- var node = document.createElement('a');
-
- node.href = 'http://glennjones.net';
-
- assert.equal( Modules.domUtils.getAttrValFromTagList( node, ['a','area'], 'href' ), 'http://glennjones.net' );
- assert.equal( Modules.domUtils.getAttrValFromTagList( node, ['a','area'], 'class' ), null );
- assert.equal( Modules.domUtils.getAttrValFromTagList( node, ['p'], 'href' ), null );
- });
-
-
- it('getSingleDescendant', function(){
- var html = '<a class="u-url" href="http://glennjones.net">Glenn Jones</a>',
- node = document.createElement('div');
-
- node.innerHTML = html,
-
- // one instance of a element
- assert.equal( Modules.domUtils.getSingleDescendant( node ).outerHTML, html );
-
- // two instances of a element
- node.appendChild(document.createElement('a'));
- assert.equal( Modules.domUtils.getSingleDescendant( node ), null );
-
- });
-
-
- it('getSingleDescendantOfType', function(){
- var html = '<a class="u-url" href="http://glennjones.net">Glenn Jones</a>',
- node = document.createElement('div');
-
- node.innerHTML = html,
-
- // one instance of a element
- assert.equal( Modules.domUtils.getSingleDescendantOfType( node, ['a', 'link']).outerHTML, html );
- assert.equal( Modules.domUtils.getSingleDescendantOfType( node, ['img','area']), null );
-
- node.appendChild(document.createElement('p'));
- assert.equal( Modules.domUtils.getSingleDescendantOfType( node, ['a', 'link']).outerHTML, html );
-
- // two instances of a element
- node.appendChild(document.createElement('a'));
- assert.equal( Modules.domUtils.getSingleDescendantOfType( node, ['a', 'link']), null );
-
- });
-
-
- it('appendChild', function(){
- var node = document.createElement('div'),
- child = document.createElement('a');
-
- Modules.domUtils.appendChild( node, child );
- assert.equal( node.innerHTML, '<a></a>' );
- });
-
-
- it('removeChild', function(){
- var node = document.createElement('div'),
- child = document.createElement('a');
-
- node.appendChild(child)
-
- assert.equal( node.innerHTML, '<a></a>' );
- Modules.domUtils.removeChild( child );
- assert.equal( node.innerHTML, '' );
- });
-
-
- it('clone', function(){
- var node = document.createElement('div');
-
- node.innerHTML = 'text content';
- assert.equal( Modules.domUtils.clone( node ).outerHTML, '<div>text content</div>' );
- });
-
-
- it('getElementText', function(){
- assert.equal( Modules.domUtils.getElementText( {} ), '' );
- });
-
-
- it('getNodePath', function(){
- var node = document.createElement('ul');
- node.innerHTML = '<div><ul><li class="h-card">one</li><li>two</li><li class="h-card">three</li><li class="p-name">four</li></ul></div>';
- var child = node.querySelector('.p-name');
-
- assert.deepEqual( Modules.domUtils.getNodePath( child ), [0,0,3] );
- });
-
-
-});
diff --git a/toolkit/components/microformats/test/module-tests/html-test.js b/toolkit/components/microformats/test/module-tests/html-test.js
deleted file mode 100644
index cd06c7b7f..000000000
--- a/toolkit/components/microformats/test/module-tests/html-test.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
-Unit test for html
-*/
-
-assert = chai.assert;
-
-// Tests the private Modules.html object
-// Modules.html is unit tested as it has an interface access by other modules
-
-describe('Modules.html', function() {
-
-
- it('parse', function(){
- var html = '<a href="http://glennjones.net">Glenn Jones</a>',
- bloghtml = '<section id="content" class="body"><ol id="posts-list" class="h-feed"><li><article class="h-entry"><header><h2 class="p-namee"><a href="#" rel="bookmark" title="Permalink to this POST TITLE">This be the title</a></h2></header><footer class="post-info"><abbr class="dt-published" title="2005-10-10T14:07:00-07:00">10th October 2005</abbr><address class="h-card p-author">By <a class="u-url p-name" href="#">Enrique Ramírez</a></address></footer><div class="e-content"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque venenatis nunc vitae libero iaculis elementum. Nullam et justo <a href="#">non sapien</a> dapibus blandit nec et leo. Ut ut malesuada tellus.</p></div></article></li></ol></section>',
- node = document.createElement('div');
-
- node.innerHTML = html;
- assert.equal(Modules.html.parse( node ), html );
-
- // make sure excludes 'data-include' marked items
- var child = document.createElement('p');
- child.setAttribute('data-include', 'true');
- node.appendChild(child);
- assert.equal( Modules.html.parse( node ), html );
-
- node = document.createElement('div');
- node.innerHTML = bloghtml;
- assert.equal( Modules.html.parse( node ), bloghtml );
-
- node = document.createElement('div');
- assert.equal( Modules.html.parse( node ), '' );
-
- child = document.createElement('br');
- node.appendChild(child);
- assert.equal( Modules.html.parse( node ), '<br />' );
-
- node = document.createComment('test comment');
- assert.equal( Modules.html.parse( node ), '' );
-
- });
-
-
-
-
-
-
-
-
-});
diff --git a/toolkit/components/microformats/test/module-tests/index.html b/toolkit/components/microformats/test/module-tests/index.html
deleted file mode 100644
index 0eb3c2040..000000000
--- a/toolkit/components/microformats/test/module-tests/index.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<html><head><title>Mocha</title>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" href="../static/css/mocha.css" />
-<script src="../static/javascript/chai.js"></script>
-<script src="../static/javascript/mocha.js"></script>
-<link rel="stylesheet" href="../static/css/mocha-custom.css" />
-<link rel="icon" type="image/png" id="favicon" href="chrome://branding/content/icon32.png"/>
-<script src="../static/javascript/DOMParser.js"></script>
-
-<script data-cover src="../lib/utilities.js"></script>
-<script data-cover src="../lib/domutils.js"></script>
-<script data-cover src="../lib/url.js"></script>
-<script data-cover src="../lib/html.js"></script>
-<script data-cover src="../lib/text.js"></script>
-<script data-cover src="../lib/dates.js"></script>
-<script data-cover src="../lib/isodate.js"></script>
-
-<script>
-var uncaughtError;
-
-window.addEventListener("error", function(error) {
-uncaughtError = error;
-});
-
-var consoleWarn = console.warn;
-var caughtWarnings = [];
-
-console.warn = function() {
-var args = Array.slice(arguments);
-caughtWarnings.push(args);
-consoleWarn.apply(console, args);
-};
-</script>
-
-<script>
-chai.config.includeStack = true;
-mocha.setup({ui: 'bdd', timeout: 10000});
-</script>
-
-
-<script src="../module-tests/dates-test.js"></script>
-<script src="../module-tests/domUtils-test.js"></script>
-<script src="../module-tests/html-test.js"></script>
-<script src="../module-tests/isodate-test.js"></script>
-<script src="../module-tests/text-test.js"></script>
-
-<script src="../module-tests/url-test.js"></script>
-
-<script src="../module-tests/utilities-test.js"></script>
-
-</head><body>
-<h3 class="capitalize">Microformats-shiv: module tests</h3>
-<div id="mocha"></div>
-</body>
-<script>
-describe("Uncaught Error Check", function() {
-it("should load the tests without errors", function() {
-chai.expect(uncaughtError && uncaughtError.message).to.be.undefined;
-});
-});
-
-describe("Unexpected Warnings Check", function() {
-it("should long only the warnings we expect", function() {
-chai.expect(caughtWarnings.length).to.eql(0);
-});
-});
-
-mocha.run(function () {
-var completeNode = document.createElement("p");
-completeNode.setAttribute("id", "complete");
-completeNode.appendChild(document.createTextNode("Complete"));
-document.getElementById("mocha").appendChild(completeNode);
-});
-
-</script>
-</body></html>
diff --git a/toolkit/components/microformats/test/module-tests/isodate-test.js b/toolkit/components/microformats/test/module-tests/isodate-test.js
deleted file mode 100644
index 5f081f81c..000000000
--- a/toolkit/components/microformats/test/module-tests/isodate-test.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
-Unit test for dates
-*/
-
-assert = chai.assert;
-
-
-// Tests private Modules.ISODate object
-// Modules.ISODate is unit tested as it has an interface access by other modules
-
-
-describe('Modules.ISODates', function() {
-
-
-
- it('constructor', function(){
- assert.equal( new Modules.ISODate().toString('auto'), '' );
- assert.equal( new Modules.ISODate('2015-01-23T05:34:00', 'html5').toString('html5'), '2015-01-23 05:34:00' );
- assert.equal( new Modules.ISODate('2015-01-23T05:34:00', 'w3c').toString('w3c'), '2015-01-23T05:34:00' );
- assert.equal( new Modules.ISODate('2015-01-23T05:34:00', 'html5').toString('rfc3339'), '20150123T053400' );
- assert.equal( new Modules.ISODate('2015-01-23T05:34:00', 'auto').toString('auto'), '2015-01-23T05:34:00' );
- });
-
-
- it('parse', function(){
- assert.equal( new Modules.ISODate().parse('2015-01-23T05:34:00', 'html5').toString('html5'), '2015-01-23 05:34:00' );
- assert.equal( new Modules.ISODate().parse('2015-01-23T05:34:00', 'auto').toString('auto'), '2015-01-23T05:34:00' );
- assert.equal( new Modules.ISODate().parse('2015-01-23t05:34:00', 'auto').toString('auto'), '2015-01-23t05:34:00' );
-
- assert.equal( new Modules.ISODate().parse('2015-01-23t05:34:00Z', 'auto').toString('auto'), '2015-01-23t05:34:00Z' );
- assert.equal( new Modules.ISODate().parse('2015-01-23t05:34:00z', 'auto').toString('auto'), '2015-01-23t05:34:00z' );
- assert.equal( new Modules.ISODate().parse('2015-01-23 05:34:00Z', 'auto').toString('auto'), '2015-01-23 05:34:00Z' );
- assert.equal( new Modules.ISODate().parse('2015-01-23 05:34', 'auto').toString('auto'), '2015-01-23 05:34' );
- assert.equal( new Modules.ISODate().parse('2015-01-23 05', 'auto').toString('auto'), '2015-01-23 05' );
-
- assert.equal( new Modules.ISODate().parse('2015-01-23 05:34+01:00', 'auto').toString('auto'), '2015-01-23 05:34+01:00' );
- assert.equal( new Modules.ISODate().parse('2015-01-23 05:34-01:00', 'auto').toString('auto'), '2015-01-23 05:34-01:00' );
- assert.equal( new Modules.ISODate().parse('2015-01-23 05:34-01', 'auto').toString('auto'), '2015-01-23 05:34-01' );
-
-
- assert.equal( new Modules.ISODate().parse('2015-01-23', 'auto').toString('auto'), '2015-01-23' );
- // TODO support for importing rfc3339 profile dates
- // assert.equal( new Modules.ISODate().parse('20150123t0534', 'auto').toString('auto'), '2015-01-23 05:34' );
- });
-
-
- it('parseDate', function(){
- assert.equal( new Modules.ISODate().parseDate('2015-01-23T05:34:00', 'html5'), '2015-01-23' );
- assert.equal( new Modules.ISODate().parseDate('2015-01-23', 'auto'), '2015-01-23' );
- assert.equal( new Modules.ISODate().parseDate('2015-01', 'auto'), '2015-01' );
- assert.equal( new Modules.ISODate().parseDate('2015', 'auto'), '2015' );
- assert.equal( new Modules.ISODate().parseDate('2015-134', 'auto'), '2015-134' );
- });
-
-
- it('parseTime', function(){
- assert.equal( new Modules.ISODate().parseTime('05:34:00.1267', 'html5'), '05:34:00.1267' );
- assert.equal( new Modules.ISODate().parseTime('05:34:00', 'html5'), '05:34:00' );
- assert.equal( new Modules.ISODate().parseTime('05:34', 'html5'), '05:34' );
- assert.equal( new Modules.ISODate().parseTime('05', 'html5'), '05' );
- });
-
- it('parseTimeZone', function(){
- var date = new Modules.ISODate();
- date.parseTime('14:00');
- assert.equal( date.parseTimeZone('-01:00', 'auto'), '14:00-01:00' );
-
- date.clear();
- date.parseTime('14:00');
- assert.equal( date.parseTimeZone('-01', 'auto'), '14:00-01' );
-
- date.clear();
- date.parseTime('14:00');
- assert.equal( date.parseTimeZone('+01:00', 'auto').toString('auto'), '14:00+01:00' );
-
- date.clear();
- date.parseTime('15:00');
- assert.equal( date.parseTimeZone('Z', 'auto').toString('auto'), '15:00Z' );
-
- date.clear();
- date.parseTime('16:00');
- assert.equal( date.parseTimeZone('z', 'auto'), '16:00z' );
-
- });
-
-
-
- it('toString', function(){
- var date = new Modules.ISODate();
- date.parseTime('05:34:00.1267');
-
- assert.equal( date.toString('html5'), '05:34:00.1267' );
- });
-
-
- it('toTimeString', function(){
- var date = new Modules.ISODate();
- date.parseTime('05:34:00.1267');
-
- assert.equal( date.toTimeString('html5'), '05:34:00.1267' );
- });
-
-
- it('hasFullDate', function(){
- var dateEmpty = new Modules.ISODate(),
- date = new Modules.ISODate('2015-01-23T05:34:00');
-
- assert.isFalse( dateEmpty.hasFullDate() );
- assert.isTrue( date.hasFullDate() );
- });
-
-
- it('hasDate', function(){
- var dateEmpty = new Modules.ISODate(),
- date = new Modules.ISODate('2015-01-23');
-
- assert.isFalse( dateEmpty.hasDate() );
- assert.isTrue( date.hasDate() );
- });
-
-
- it('hasTime', function(){
- var dateEmpty = new Modules.ISODate(),
- date = new Modules.ISODate();
-
- date.parseTime('12:34');
-
- assert.isFalse( dateEmpty.hasTime() );
- assert.isTrue( date.hasTime() );
- });
-
-
- it('hasTimeZone', function(){
- var dateEmpty = new Modules.ISODate(),
- date = new Modules.ISODate();
-
- date.parseTime('12:34'),
- date.parseTimeZone('-01:00');
-
- assert.isFalse( dateEmpty.hasTimeZone() );
- assert.isTrue( date.hasTimeZone() );
- });
-
-
-});
diff --git a/toolkit/components/microformats/test/module-tests/text-test.js b/toolkit/components/microformats/test/module-tests/text-test.js
deleted file mode 100644
index f1f2e775c..000000000
--- a/toolkit/components/microformats/test/module-tests/text-test.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
-Unit test for text
-*/
-
-assert = chai.assert;
-
-// Tests the private Modules.text object
-// Modules.text is unit tested as it has an interface access by other modules
-
-
-describe('Modules.text', function() {
-
-
- it('parse', function(){
- var html = '\n <a href="http://glennjones.net">Glenn\n Jones \n</a> \n',
- node = document.createElement('div');
-
- node.innerHTML = html;
- assert.equal( Modules.text.parse( document, node, 'whitespacetrimmed' ), 'Glenn\n Jones' );
- assert.equal( Modules.text.parse( document, node, 'whitespace' ), '\n Glenn\n Jones \n \n' );
- assert.equal( Modules.text.parse( document, node, 'normalised' ), 'Glenn Jones' );
-
- // exclude tags
- node.innerHTML = '<script>test</script>text';
- assert.equal( Modules.text.parse( document, node, 'normalised' ), 'text' );
-
- // block level
- node.innerHTML = '<p>test</p>text';
- //assert.equal( Modules.text.parse( document, node, 'normalised' ), 'test text' );
-
- // node with no text data
- node = document.createComment('test comment');
- assert.equal( Modules.text.parse( document, node, 'normalised' ), '' );
-
- });
-
-
- it('parseText', function(){
- var text = '\n <a href="http://glennjones.net">Glenn\n Jones \n</a> \n';
-
- // create DOM context first
- Modules.domUtils.getDOMContext( {} );
-
- assert.equal( Modules.text.parseText( document, text, 'whitespacetrimmed' ), 'Glenn\n Jones' );
- assert.equal( Modules.text.parseText( document, text, 'whitespace' ), '\n Glenn\n Jones \n \n' );
- assert.equal( Modules.text.parseText( document, text, 'normalised' ), 'Glenn Jones' );
- });
-
-
- it('formatText', function(){
- assert.equal( Modules.text.formatText( document, null, 'whitespacetrimmed' ), '' );
- });
-
-
-
-});
diff --git a/toolkit/components/microformats/test/module-tests/url-test.js b/toolkit/components/microformats/test/module-tests/url-test.js
deleted file mode 100644
index 788e8fdb5..000000000
--- a/toolkit/components/microformats/test/module-tests/url-test.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-Unit test for url
-*/
-
-assert = chai.assert;
-
-
-// Tests the private Modules.url object
-// Modules.url is unit tested as it has an interface access by other modules
-
-
-describe('Modules.url', function() {
-
- it('resolve', function(){
- assert.equal( Modules.url.resolve( 'docs/index.html', 'http://example.org' ), 'http://example.org/docs/index.html' );
- assert.equal( Modules.url.resolve( '../index.html', 'http://example.org/docs/' ), 'http://example.org/index.html' );
- assert.equal( Modules.url.resolve( '/', 'http://example.org/' ), 'http://example.org/' );
- assert.equal( Modules.url.resolve( 'http://glennjones.net/', 'http://example.org/' ), 'http://glennjones.net/' );
-
- assert.equal( Modules.url.resolve( undefined, 'http://example.org/' ), '' );
- assert.equal( Modules.url.resolve( undefined, undefined ), '' );
- assert.equal( Modules.url.resolve( 'http://glennjones.net/', undefined ), 'http://glennjones.net/' );
- });
-
-});
diff --git a/toolkit/components/microformats/test/module-tests/utilities-test.js b/toolkit/components/microformats/test/module-tests/utilities-test.js
deleted file mode 100644
index b37236a6b..000000000
--- a/toolkit/components/microformats/test/module-tests/utilities-test.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
-Unit test for utilities
-*/
-
-assert = chai.assert;
-
-// Tests the private Modules.utils object
-// Modules.utils is unit tested as it has an interface access by other modules
-
-
-describe('Modules.utilities', function() {
-
-
- it('isString', function(){
- assert.isTrue( Modules.utils.isString( 'abc' ) );
- assert.isFalse( Modules.utils.isString( 123 ) );
- assert.isFalse( Modules.utils.isString( 1.23 ) );
- assert.isFalse( Modules.utils.isString( {'abc': 'abc'} ) );
- assert.isFalse( Modules.utils.isString( ['abc'] ) );
- assert.isFalse( Modules.utils.isString( true ) );
- });
-
-
- it('isArray', function(){
- assert.isTrue( Modules.utils.isArray( ['abc'] ) );
- assert.isFalse( Modules.utils.isArray( 123 ) );
- assert.isFalse( Modules.utils.isArray( 1.23 ) );
- assert.isFalse( Modules.utils.isArray( 'abc' ) );
- assert.isFalse( Modules.utils.isArray( {'abc': 'abc'} ) );
- assert.isFalse( Modules.utils.isArray( true ) );
- });
-
-
- it('isNumber', function(){
- assert.isTrue( Modules.utils.isNumber( 123 ) );
- assert.isTrue( Modules.utils.isNumber( 1.23 ) );
- assert.isFalse( Modules.utils.isNumber( 'abc' ) );
- assert.isFalse( Modules.utils.isNumber( {'abc': 'abc'} ) );
- assert.isFalse( Modules.utils.isNumber( ['abc'] ) );
- assert.isFalse( Modules.utils.isNumber( true ) );
- });
-
-
- it('startWith', function(){
- assert.isTrue( Modules.utils.startWith( 'p-name', 'p-' ) );
- assert.isFalse( Modules.utils.startWith( 'p-name', 'name' ) );
- assert.isFalse( Modules.utils.startWith( 'p-name', 'u-' ) );
- });
-
-
- it('trim', function(){
- assert.equal( Modules.utils.trim( ' Glenn Jones ' ), 'Glenn Jones' );
- assert.equal( Modules.utils.trim( 'Glenn Jones' ), 'Glenn Jones' );
- assert.equal( Modules.utils.trim( undefined ), '' );
- });
-
-
- it('replaceCharAt', function(){
- assert.equal( Modules.utils.replaceCharAt( 'Glenn Jones', 5, '-' ), 'Glenn-Jones' );
- assert.equal( Modules.utils.replaceCharAt( 'Glenn Jones', 50, '-' ), 'Glenn Jones' );
- });
-
-
- it('isOnlyWhiteSpace', function(){
- assert.isTrue( Modules.utils.isOnlyWhiteSpace( ' ') );
- assert.isTrue( Modules.utils.isOnlyWhiteSpace( ' \n\r') );
- assert.isFalse( Modules.utils.isOnlyWhiteSpace( ' text\n\r') );
- });
-
-
- it('collapseWhiteSpace', function(){
- assert.equal( Modules.utils.collapseWhiteSpace( ' '), ' ' );
- assert.equal( Modules.utils.collapseWhiteSpace( ' \n\r'), ' ' );
- assert.equal( Modules.utils.collapseWhiteSpace( ' text\n\r'), ' text ' );
- });
-
-
- it('hasProperties', function(){
- assert.isTrue( Modules.utils.hasProperties( {name: 'glennjones'} ) );
- assert.isFalse( Modules.utils.hasProperties( {} ) );
- });
-
-
- it('sortObjects', function(){
- var arr = [{'name': 'one'},{'name': 'two'},{'name': 'three'},{'name': 'three'}];
-
- assert.deepEqual( arr.sort( Modules.utils.sortObjects( 'name', true ) ), [{"name":"two"},{"name":"three"},{'name': 'three'},{"name":"one"}] );
- assert.deepEqual( arr.sort( Modules.utils.sortObjects( 'name', false ) ), [{"name":"one"},{"name":"three"},{'name': 'three'},{"name":"two"}] );
- });
-
-
-
-});
diff --git a/toolkit/components/microformats/test/standards-tests/index.html b/toolkit/components/microformats/test/standards-tests/index.html
deleted file mode 100644
index 47f89f988..000000000
--- a/toolkit/components/microformats/test/standards-tests/index.html
+++ /dev/null
@@ -1,179 +0,0 @@
-<html><head><title>Mocha</title>
-<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
-<link rel="stylesheet" href="../static/css/mocha.css" />
-<script src="../static/javascript/chai.js"></script>
-<script src="../static/javascript/mocha.js"></script>
-<link rel="stylesheet" href="../static/css/mocha-custom.css" />
-<link rel="icon" type="image/png" id="favicon" href="chrome://branding/content/icon32.png"/>
-
-<script src="../static/javascript/DOMParser.js"></script>
-
-<script data-cover src="../../microformat-shiv.js"></script>
-
-<script>
-var uncaughtError;
-
-window.addEventListener("error", function(error) {
-uncaughtError = error;
-});
-
-var consoleWarn = console.warn;
-var caughtWarnings = [];
-
-console.warn = function() {
-var args = Array.slice(arguments);
-caughtWarnings.push(args);
-consoleWarn.apply(console, args);
-};
-</script>
-
-<script>
-chai.config.includeStack = true;
-mocha.setup({ui: 'bdd', timeout: 10000});
-</script>
-
-<script src="../standards-tests/mf-mixed-h-card-mixedpropertries.js"></script>
-<script src="../standards-tests/mf-mixed-h-card-tworoots.js"></script>
-<script src="../standards-tests/mf-mixed-h-entry-mixedroots.js"></script>
-<script src="../standards-tests/mf-mixed-h-resume-mixedroots.js"></script>
-<script src="../standards-tests/mf-v1-adr-simpleproperties.js"></script>
-<script src="../standards-tests/mf-v1-geo-abbrpattern.js"></script>
-<script src="../standards-tests/mf-v1-geo-hidden.js"></script>
-<script src="../standards-tests/mf-v1-geo-simpleproperties.js"></script>
-<script src="../standards-tests/mf-v1-geo-valuetitleclass.js"></script>
-<script src="../standards-tests/mf-v1-hcalendar-ampm.js"></script>
-<script src="../standards-tests/mf-v1-hcalendar-attendees.js"></script>
-<script src="../standards-tests/mf-v1-hcalendar-combining.js"></script>
-<script src="../standards-tests/mf-v1-hcalendar-concatenate.js"></script>
-<script src="../standards-tests/mf-v1-hcalendar-time.js"></script>
-<script src="../standards-tests/mf-v1-hcard-email.js"></script>
-<script src="../standards-tests/mf-v1-hcard-format.js"></script>
-<script src="../standards-tests/mf-v1-hcard-hyperlinkedphoto.js"></script>
-<script src="../standards-tests/mf-v1-hcard-justahyperlink.js"></script>
-<script src="../standards-tests/mf-v1-hcard-justaname.js"></script>
-<script src="../standards-tests/mf-v1-hcard-multiple.js"></script>
-<script src="../standards-tests/mf-v1-hcard-name.js"></script>
-<script src="../standards-tests/mf-v1-hcard-single.js"></script>
-<script src="../standards-tests/mf-v1-hentry-summarycontent.js"></script>
-<script src="../standards-tests/mf-v1-hfeed-simple.js"></script>
-<script src="../standards-tests/mf-v1-hnews-all.js"></script>
-<script src="../standards-tests/mf-v1-hnews-minimum.js"></script>
-<script src="../standards-tests/mf-v1-hproduct-aggregate.js"></script>
-<script src="../standards-tests/mf-v1-hproduct-simpleproperties.js"></script>
-<script src="../standards-tests/mf-v1-hresume-affiliation.js"></script>
-<script src="../standards-tests/mf-v1-hresume-contact.js"></script>
-<script src="../standards-tests/mf-v1-hresume-education.js"></script>
-<script src="../standards-tests/mf-v1-hresume-skill.js"></script>
-<script src="../standards-tests/mf-v1-hresume-work.js"></script>
-<script src="../standards-tests/mf-v1-hreview-item.js"></script>
-<script src="../standards-tests/mf-v1-hreview-vcard.js"></script>
-<script src="../standards-tests/mf-v1-hreview-aggregate-hcard.js"></script>
-<script src="../standards-tests/mf-v1-hreview-aggregate-justahyperlink.js"></script>
-<script src="../standards-tests/mf-v1-hreview-aggregate-vevent.js"></script>
-<script src="../standards-tests/mf-v1-includes-hcarditemref.js"></script>
-<script src="../standards-tests/mf-v1-includes-heventitemref.js"></script>
-<script src="../standards-tests/mf-v1-includes-hyperlink.js"></script>
-<script src="../standards-tests/mf-v1-includes-object.js"></script>
-<script src="../standards-tests/mf-v1-includes-table.js"></script>
-<script src="../standards-tests/mf-v2-h-adr-geo.js"></script>
-<script src="../standards-tests/mf-v2-h-adr-geourl.js"></script>
-<script src="../standards-tests/mf-v2-h-adr-justaname.js"></script>
-<script src="../standards-tests/mf-v2-h-adr-simpleproperties.js"></script>
-<script src="../standards-tests/mf-v2-h-as-note-note.js"></script>
-<script src="../standards-tests/mf-v2-h-card-baseurl.js"></script>
-<script src="../standards-tests/mf-v2-h-card-childimplied.js"></script>
-<script src="../standards-tests/mf-v2-h-card-extendeddescription.js"></script>
-<script src="../standards-tests/mf-v2-h-card-hcard.js"></script>
-<script src="../standards-tests/mf-v2-h-card-horghcard.js"></script>
-<script src="../standards-tests/mf-v2-h-card-hyperlinkedphoto.js"></script>
-<script src="../standards-tests/mf-v2-h-card-impliedname.js"></script>
-<script src="../standards-tests/mf-v2-h-card-impliedphoto.js"></script>
-<script src="../standards-tests/mf-v2-h-card-impliedurl.js"></script>
-<script src="../standards-tests/mf-v2-h-card-justahyperlink.js"></script>
-<script src="../standards-tests/mf-v2-h-card-justaname.js"></script>
-<script src="../standards-tests/mf-v2-h-card-nested.js"></script>
-<script src="../standards-tests/mf-v2-h-card-p-property.js"></script>
-<script src="../standards-tests/mf-v2-h-card-relativeurls.js"></script>
-<script src="../standards-tests/mf-v2-h-entry-impliedvalue-nested.js"></script>
-<script src="../standards-tests/mf-v2-h-entry-justahyperlink.js"></script>
-<script src="../standards-tests/mf-v2-h-entry-justaname.js"></script>
-<script src="../standards-tests/mf-v2-h-entry-summarycontent.js"></script>
-<script src="../standards-tests/mf-v2-h-entry-u-property.js"></script>
-<script src="../standards-tests/mf-v2-h-entry-urlincontent.js"></script>
-<script src="../standards-tests/mf-v2-h-event-ampm.js"></script>
-<script src="../standards-tests/mf-v2-h-event-attendees.js"></script>
-<script src="../standards-tests/mf-v2-h-event-combining.js"></script>
-<script src="../standards-tests/mf-v2-h-event-concatenate.js"></script>
-<script src="../standards-tests/mf-v2-h-event-dates.js"></script>
-<script src="../standards-tests/mf-v2-h-event-dt-property.js"></script>
-<script src="../standards-tests/mf-v2-h-event-justahyperlink.js"></script>
-<script src="../standards-tests/mf-v2-h-event-justaname.js"></script>
-<script src="../standards-tests/mf-v2-h-event-time.js"></script>
-<script src="../standards-tests/mf-v2-h-feed-implied-title.js"></script>
-<script src="../standards-tests/mf-v2-h-feed-simple.js"></script>
-<script src="../standards-tests/mf-v2-h-geo-abbrpattern.js"></script>
-<script src="../standards-tests/mf-v2-h-geo-altitude.js"></script>
-<script src="../standards-tests/mf-v2-h-geo-hidden.js"></script>
-<script src="../standards-tests/mf-v2-h-geo-justaname.js"></script>
-<script src="../standards-tests/mf-v2-h-geo-simpleproperties.js"></script>
-<script src="../standards-tests/mf-v2-h-geo-valuetitleclass.js"></script>
-<script src="../standards-tests/mf-v2-h-news-all.js"></script>
-<script src="../standards-tests/mf-v2-h-news-minimum.js"></script>
-<script src="../standards-tests/mf-v2-h-org-hyperlink.js"></script>
-<script src="../standards-tests/mf-v2-h-org-simple.js"></script>
-<script src="../standards-tests/mf-v2-h-org-simpleproperties.js"></script>
-<script src="../standards-tests/mf-v2-h-product-aggregate.js"></script>
-<script src="../standards-tests/mf-v2-h-product-justahyperlink.js"></script>
-<script src="../standards-tests/mf-v2-h-product-justaname.js"></script>
-<script src="../standards-tests/mf-v2-h-product-simpleproperties.js"></script>
-<script src="../standards-tests/mf-v2-h-recipe-all.js"></script>
-<script src="../standards-tests/mf-v2-h-recipe-minimum.js"></script>
-<script src="../standards-tests/mf-v2-h-resume-affiliation.js"></script>
-<script src="../standards-tests/mf-v2-h-resume-contact.js"></script>
-<script src="../standards-tests/mf-v2-h-resume-education.js"></script>
-<script src="../standards-tests/mf-v2-h-resume-justaname.js"></script>
-<script src="../standards-tests/mf-v2-h-resume-skill.js"></script>
-<script src="../standards-tests/mf-v2-h-resume-work.js"></script>
-<script src="../standards-tests/mf-v2-h-review-hyperlink.js"></script>
-<script src="../standards-tests/mf-v2-h-review-implieditem.js"></script>
-<script src="../standards-tests/mf-v2-h-review-item.js"></script>
-<script src="../standards-tests/mf-v2-h-review-justaname.js"></script>
-<script src="../standards-tests/mf-v2-h-review-photo.js"></script>
-<script src="../standards-tests/mf-v2-h-review-vcard.js"></script>
-<script src="../standards-tests/mf-v2-h-review-aggregate-hevent.js"></script>
-<script src="../standards-tests/mf-v2-h-review-aggregate-justahyperlink.js"></script>
-<script src="../standards-tests/mf-v2-h-review-aggregate-simpleproperties.js"></script>
-<script src="../standards-tests/mf-v2-rel-duplicate-rels.js"></script>
-<script src="../standards-tests/mf-v2-rel-license.js"></script>
-<script src="../standards-tests/mf-v2-rel-nofollow.js"></script>
-<script src="../standards-tests/mf-v2-rel-rel-urls.js"></script>
-<script src="../standards-tests/mf-v2-rel-varying-text-duplicate-rels.js"></script>
-<script src="../standards-tests/mf-v2-rel-xfn-all.js"></script>
-<script src="../standards-tests/mf-v2-rel-xfn-elsewhere.js"></script>
-</head><body>
-<h3 class="capitalize">Microformats-shiv: standards tests</h3>
-<p>Standards tests built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST). Downloaded from github repo: microformats/tests version v0.1.24</p>
-<div id="mocha"></div>
-</body>
-<script>
-describe("Uncaught Error Check", function() {
-it("should load the tests without errors", function() {
-chai.expect(uncaughtError && uncaughtError.message).to.be.undefined;
-});
-});
-
-describe("Unexpected Warnings Check", function() {
-it("should long only the warnings we expect", function() {
-chai.expect(caughtWarnings.length).to.eql(0);
-});
-});
-
-mocha.run(function () {
-var completeNode = document.createElement("p");
-completeNode.setAttribute("id", "complete");
-completeNode.appendChild(document.createTextNode("Complete"));
-document.getElementById("mocha").appendChild(completeNode);
-});
-
-</script>
-</body></html>
diff --git a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-mixedpropertries.js b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-mixedpropertries.js
deleted file mode 100644
index db99dc92a..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-mixedpropertries.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-mixed/h-card/mixedpropertries
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<div class=\"h-card\">\n <p>\n <a class=\"p-name p-org u-url\" href=\"http://mozilla.org/\">Mozilla Foundation</a>\n <img class=\"logo\" src=\"../logo.jpg\"/>\n </p>\n <p class=\"adr\">\n <span class=\"street-address\">665 3rd St.</span> \n <span class=\"extended-address\">Suite 207</span> \n <span class=\"locality\">San Francisco</span>, \n <span class=\"region\">CA</span> \n <span class=\"postal-code\">94107</span> \n <span class=\"p-country-name\">U.S.A.</span> \n </p>\n</div>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["Mozilla Foundation"],"org":["Mozilla Foundation"],"url":["http://mozilla.org/"],"adr":[{"value":"665 3rd St. \n Suite 207 \n San Francisco, \n CA \n 94107 \n U.S.A.","type":["h-adr"],"properties":{"street-address":["665 3rd St."],"extended-address":["Suite 207"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94107"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('mixedpropertries', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-tworoots.js b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-tworoots.js
deleted file mode 100644
index be43abcd8..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-card-tworoots.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-mixed/h-card/tworoots
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<p class=\"h-card vcard\">Frances Berriman</p>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["Frances Berriman"]}}],"rels":{},"rel-urls":{}};
-
- it('tworoots', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-entry-mixedroots.js b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-entry-mixedroots.js
deleted file mode 100644
index 705ffeebf..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-entry-mixedroots.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-mixed/h-entry/mixedroots
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-entry', function() {
- var htmlFragment = "<!-- simplified version of http://aaronparecki.com/notes/2013/10/18/2/realtimeconf-mapattack -->\n<base href=\"http://aaronparecki.com/\" />\n\n<div class=\"h-entry\">\n <div class=\"h-card vcard author p-author\">\n <img class=\"photo logo u-photo u-logo\" src=\"https://aaronparecki.com/images/aaronpk.png\" alt=\"Aaron Parecki\"/>\n <a href=\"https://aaronparecki.com/\" rel=\"author\" class=\"u-url u-uid url\">aaronparecki.com</a>\n <a class=\"p-name fn value\" href=\"https://aaronparecki.com/\">Aaron Parecki</a>\n <a href=\"https://plus.google.com/117847912875913905493\" rel=\"author\" class=\"google-profile\">Aaron Parecki</a>\n </div>\n <div class=\"entry-content e-content p-name\">Did you play\n <a href=\"http://twitter.com/playmapattack\">@playmapattack</a>at\n <a href=\"/tag/realtimeconf\">#<span class=\"p-category\">realtimeconf</span></a>? Here is some more info about how we built it!\n <a href=\"http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/\"><span class=\"protocol\">http://</span>pdx.esri.com/blog/2013/10/17/introducting-mapattack/</a>\n </div>\n</div>";
- var expected = {"items":[{"type":["h-entry"],"properties":{"author":[{"value":"aaronparecki.com\n Aaron Parecki\n Aaron Parecki","type":["h-card"],"properties":{"photo":["https://aaronparecki.com/images/aaronpk.png"],"logo":["https://aaronparecki.com/images/aaronpk.png"],"url":["https://aaronparecki.com/"],"uid":["https://aaronparecki.com/"],"name":["Aaron Parecki"]}}],"content":[{"value":"Did you play\n @playmapattackat\n #realtimeconf? Here is some more info about how we built it!\n http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/","html":"Did you play\n <a href=\"http://twitter.com/playmapattack\">@playmapattack</a>at\n <a href=\"http://aaronparecki.com/tag/realtimeconf\">#<span class=\"p-category\">realtimeconf</span></a>? Here is some more info about how we built it!\n <a href=\"http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/\"><span class=\"protocol\">http://</span>pdx.esri.com/blog/2013/10/17/introducting-mapattack/</a>\n "}],"name":["Did you play\n @playmapattackat\n #realtimeconf? Here is some more info about how we built it!\n http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/"],"category":["realtimeconf"]}}],"rels":{"author":["https://aaronparecki.com/","https://plus.google.com/117847912875913905493"]},"rel-urls":{"https://aaronparecki.com/":{"text":"aaronparecki.com","rels":["author"]},"https://plus.google.com/117847912875913905493":{"text":"Aaron Parecki","rels":["author"]}}};
-
- it('mixedroots', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-resume-mixedroots.js b/toolkit/components/microformats/test/standards-tests/mf-mixed-h-resume-mixedroots.js
deleted file mode 100644
index 5147866c6..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-mixed-h-resume-mixedroots.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-mixed/h-resume/mixedroots
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-resume', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<div class=\"h-resume\">\n <div class=\"p-contact vcard\">\n <p class=\"fn\">Tim Berners-Lee</p>\n <p class=\"title\">Director of the World Wide Web Foundation</p>\n </div>\n <p class=\"p-summary\">Invented the World Wide Web.</p><hr />\n <div class=\"p-experience vevent vcard\">\n <p class=\"title\">Director</p>\n <p><a class=\"fn org summary url\" href=\"http://www.webfoundation.org/\">World Wide Web Foundation</a></p>\n <p>\n <time class=\"dtstart\" datetime=\"2009-01-18\">Jan 2009</time> – Present\n <time class=\"duration\" datetime=\"P2Y11M\">(2 years 11 month)</time>\n </p>\n </div>\n</div>";
- var expected = {"items":[{"type":["h-resume"],"properties":{"contact":[{"value":"Tim Berners-Lee","type":["h-card"],"properties":{"name":["Tim Berners-Lee"],"job-title":["Director of the World Wide Web Foundation"]}}],"summary":["Invented the World Wide Web."],"experience":[{"value":"World Wide Web Foundation","type":["h-event","h-card"],"properties":{"job-title":["Director"],"name":["World Wide Web Foundation"],"org":["World Wide Web Foundation"],"url":["http://www.webfoundation.org/"],"start":["2009-01-18"],"duration":["P2Y11M"]}}],"name":["Tim Berners-Lee\n Director of the World Wide Web Foundation\n \n Invented the World Wide Web.\n \n Director\n World Wide Web Foundation\n \n Jan 2009 – Present\n (2 years 11 month)"]}}],"rels":{},"rel-urls":{}};
-
- it('mixedroots', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-adr-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v1-adr-simpleproperties.js
deleted file mode 100644
index 09a346e0c..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-adr-simpleproperties.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/adr/simpleproperties
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('adr', function() {
- var htmlFragment = "<p class=\"adr\">\n <span class=\"street-address\">665 3rd St.</span> \n <span class=\"extended-address\">Suite 207</span> \n <span class=\"locality\">San Francisco</span>, \n <span class=\"region\">CA</span> \n <span class=\"postal-code\">94107</span> \n <span class=\"country-name\">U.S.A.</span> \n</p>";
- var expected = {"items":[{"type":["h-adr"],"properties":{"street-address":["665 3rd St."],"extended-address":["Suite 207"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94107"],"country-name":["U.S.A."]}}],"rels":{},"rel-urls":{}};
-
- it('simpleproperties', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-abbrpattern.js b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-abbrpattern.js
deleted file mode 100644
index 090e98bb9..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-abbrpattern.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/geo/abbrpattern
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('geo', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<p class=\"geo\">\n <abbr class=\"latitude\" title=\"37.408183\">N 37° 24.491</abbr>, \n <abbr class=\"longitude\" title=\"-122.13855\">W 122° 08.313</abbr>\n</p>";
- var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["37.408183"],"longitude":["-122.13855"]}}],"rels":{},"rel-urls":{}};
-
- it('abbrpattern', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-hidden.js b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-hidden.js
deleted file mode 100644
index d67a03b4f..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-hidden.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/geo/hidden
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('geo', function() {
- var htmlFragment = "<p>\n <span class=\"geo\">The Bricklayer's Arms\n <span class=\"latitude\">\n <span class=\"value-title\" title=\"51.513458\"> </span> \n </span>\n <span class=\"longitude\">\n <span class=\"value-title\" title=\"-0.14812\"> </span>\n </span>\n </span>\n</p>";
- var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["51.513458"],"longitude":["-0.14812"]}}],"rels":{},"rel-urls":{}};
-
- it('hidden', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-simpleproperties.js
deleted file mode 100644
index 82cd7d3d9..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-simpleproperties.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/geo/simpleproperties
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('geo', function() {
- var htmlFragment = "We are meeting at \n<span class=\"geo\"> \n <span>The Bricklayer's Arms</span>\n (Geo: <span class=\"latitude\">51.513458</span>:\n <span class=\"longitude\">-0.14812</span>)\n</span>";
- var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["51.513458"],"longitude":["-0.14812"]}}],"rels":{},"rel-urls":{}};
-
- it('simpleproperties', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-valuetitleclass.js b/toolkit/components/microformats/test/standards-tests/mf-v1-geo-valuetitleclass.js
deleted file mode 100644
index 196e07f7d..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-geo-valuetitleclass.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/geo/valuetitleclass
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('geo', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<p>\n <span class=\"geo\">\n <span class=\"latitude\">\n <span class=\"value-title\" title=\"51.513458\">N 51° 51.345</span>, \n </span>\n <span class=\"longitude\">\n <span class=\"value-title\" title=\"-0.14812\">W -0° 14.812</span>\n </span>\n </span>\n</p>";
- var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["51.513458"],"longitude":["-0.14812"]}}],"rels":{},"rel-urls":{}};
-
- it('valuetitleclass', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-ampm.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-ampm.js
deleted file mode 100644
index 5da5fd7df..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-ampm.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hcalendar/ampm
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hcalendar', function() {
- var htmlFragment = "<div class=\"vevent\">\n <span class=\"summary\">The 4th Microformat party</span> will be on \n <ul>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00:00pm \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00:00am \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00pm \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07pm \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">7pm \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">7:00pm \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00p.m. \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00PM \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">7:00am \n </span></li>\n </ul>\n</div>";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00:00","2009-06-26 07:00:00","2009-06-26 19:00","2009-06-26 19","2009-06-26 19","2009-06-26 19:00","2009-06-26 19:00","2009-06-26 19:00","2009-06-26 07:00"]}}],"rels":{},"rel-urls":{}};
-
- it('ampm', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-attendees.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-attendees.js
deleted file mode 100644
index ca28ad431..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-attendees.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hcalendar/attendees
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hcalendar', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<div class=\"vevent\">\n <span class=\"summary\">CPJ Online Press Freedom Summit</span>\n (<time class=\"dtstart\" datetime=\"2012-10-10\">10 Nov 2012</time>) in\n <span class=\"location\">San Francisco</span>.\n Attendees:\n <ul>\n <li class=\"attendee vcard\"><span class=\"fn\">Brian Warner</span></li>\n <li class=\"attendee vcard\"><span class=\"fn\">Kyle Machulis</span></li>\n <li class=\"attendee vcard\"><span class=\"fn\">Tantek Çelik</span></li>\n <li class=\"attendee vcard\"><span class=\"fn\">Sid Sutter</span></li>\n </ul>\n</div>\n";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["CPJ Online Press Freedom Summit"],"start":["2012-10-10"],"location":["San Francisco"],"attendee":[{"value":"Brian Warner","type":["h-card"],"properties":{"name":["Brian Warner"]}},{"value":"Kyle Machulis","type":["h-card"],"properties":{"name":["Kyle Machulis"]}},{"value":"Tantek Çelik","type":["h-card"],"properties":{"name":["Tantek Çelik"]}},{"value":"Sid Sutter","type":["h-card"],"properties":{"name":["Sid Sutter"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('attendees', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-combining.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-combining.js
deleted file mode 100644
index 7e5a361b1..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-combining.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hcalendar/combining
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hcalendar', function() {
- var htmlFragment = "<div class=\"vevent\">\n <a class=\"summary url\" href=\"http://indiewebcamp.com/2012\">\n IndieWebCamp 2012\n </a>\n from <time class=\"dtstart\">2012-06-30</time> \n to <time class=\"dtend\">2012-07-01</time> at \n <span class=\"location vcard\">\n <a class=\"fn org url\" href=\"http://geoloqi.com/\">Geoloqi</a>, \n <span class=\"adr\">\n <span class=\"street-address\">920 SW 3rd Ave. Suite 400</span>, \n <span class=\"locality\">Portland</span>, \n <abbr class=\"region\" title=\"Oregon\">OR</abbr>\n </span>\n </span>\n</div>";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["IndieWebCamp 2012"],"url":["http://indiewebcamp.com/2012"],"start":["2012-06-30"],"end":["2012-07-01"],"location":[{"value":"Geoloqi","type":["h-card"],"properties":{"name":["Geoloqi"],"org":["Geoloqi"],"url":["http://geoloqi.com/"],"adr":[{"value":"920 SW 3rd Ave. Suite 400, \n Portland, \n OR","type":["h-adr"],"properties":{"street-address":["920 SW 3rd Ave. Suite 400"],"locality":["Portland"],"region":["Oregon"]}}]}}]}}],"rels":{},"rel-urls":{}};
-
- it('combining', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-concatenate.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-concatenate.js
deleted file mode 100644
index d17914e1c..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-concatenate.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hcalendar/concatenate
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hcalendar', function() {
- var htmlFragment = "<div class=\"vevent\">\n <span class=\"summary\">The 4th Microformat party</span> will be on \n <span class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00</time></span> to \n <span class=\"dtend\"><time class=\"value\">22:00</time></span>.\n</div>";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00"],"end":["2009-06-26 22:00"]}}],"rels":{},"rel-urls":{}};
-
- it('concatenate', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-time.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-time.js
deleted file mode 100644
index edb26d6ad..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcalendar-time.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hcalendar/time
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hcalendar', function() {
- var htmlFragment = "<div class=\"vevent\">\n <span class=\"summary\">The 4th Microformat party</span> will be on \n <ul>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00-08:00</time> \n </li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00-0800</time> \n </li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00+0800</time> \n </li> \n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00Z</time> \n </li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00</time> \n </li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00-08:00</time> \n </li> \n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00+08:00</time> \n </li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00z</time> \n </li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00</time> \n </li> \n <li>\n <time class=\"dtend\" datetime=\"2013-034\">3 February 2013</time>\n </li> \n </ul>\n</div>";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00:00-08:00","2009-06-26 19:00:00-08:00","2009-06-26 19:00:00+08:00","2009-06-26 19:00:00Z","2009-06-26 19:00:00","2009-06-26 19:00-08:00","2009-06-26 19:00+08:00","2009-06-26 19:00Z","2009-06-26 19:00"],"end":["2013-034"]}}],"rels":{},"rel-urls":{}};
-
- it('time', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-email.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-email.js
deleted file mode 100644
index 48660ffb1..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-email.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hcard/email
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hcard', function() {
- var htmlFragment = "<div class=\"vcard\">\n <span class=\"fn\">John Doe</span> \n <ul>\n <li><a class=\"email\" href=\"mailto:john@example.com\">notthis@example.com</a></li>\n <li>\n <span class=\"email\">\n <span class=\"type\">internet</span> \n <a class=\"value\" href=\"mailto:john@example.com\">notthis@example.com</a>\n </span>\n </li> \n <li><a class=\"email\" href=\"mailto:john@example.com?subject=parser-test\">notthis@example.com</a></li>\n <li class=\"email\">john@example.com</li>\n </ul>\n</div>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["John Doe"],"email":["mailto:john@example.com","mailto:john@example.com","mailto:john@example.com?subject=parser-test","john@example.com"]}}],"rels":{},"rel-urls":{}};
-
- it('email', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-format.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-format.js
deleted file mode 100644
index eb539fd87..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-format.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hcard/format
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hcard', function() {
- var htmlFragment = "<p class=\"vcard\">\n <span class=\"profile-name fn n\">\n <span class=\" given-name \">John</span> \n <span class=\"FAMILY-NAME\">Doe</span> \n </span>\n</p>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["John \n Doe"],"given-name":["John"]}}],"rels":{},"rel-urls":{}};
-
- it('format', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-hyperlinkedphoto.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-hyperlinkedphoto.js
deleted file mode 100644
index 7f348b4a8..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-hyperlinkedphoto.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hcard/hyperlinkedphoto
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hcard', function() {
- var htmlFragment = "<a class=\"vcard\" href=\"http://rohit.khare.org/\">\n <img alt=\"Rohit Khare\" src=\"images/photo.gif\" />\n</a>";
- var expected = {"items":[{"type":["h-card"],"properties":{}}],"rels":{},"rel-urls":{}};
-
- it('hyperlinkedphoto', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justahyperlink.js
deleted file mode 100644
index e320f0f8a..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justahyperlink.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hcard/justahyperlink
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hcard', function() {
- var htmlFragment = "<a class=\"vcard\" href=\"http://benward.me/\">Ben Ward</a>";
- var expected = {"items":[{"type":["h-card"],"properties":{}}],"rels":{},"rel-urls":{}};
-
- it('justahyperlink', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justaname.js
deleted file mode 100644
index ba2a6d47d..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-justaname.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hcard/justaname
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hcard', function() {
- var htmlFragment = "<p class=\"vcard\">Frances Berriman</p>";
- var expected = {"items":[{"type":["h-card"],"properties":{}}],"rels":{},"rel-urls":{}};
-
- it('justaname', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-multiple.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-multiple.js
deleted file mode 100644
index 058e5e2ae..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-multiple.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hcard/multiple
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hcard', function() {
- var htmlFragment = "<base href=\"http://example.com\">\n <div class=\"vcard\">\n \n <div class=\"fn n\"><span class=\"given-name\">John</span> <span class=\"family-name\">Doe</span></div>\n <a class=\"sound\" href=\"http://www.madgex.com/johndoe.mpeg\">Pronunciation of my name</a>\n <div><img class=\"photo\" src=\"images/photo.gif\" alt=\"Photo of John Doe\" /></div>\n\n <p>Nicknames:</p>\n <ul>\n <li class=\"nickname\">Man with no name</li>\n <li class=\"nickname\">Lost boy</li>\n </ul>\n\n <p>About:</p>\n <p class=\"note\">John Doe is one of those names you always have issues with.</p>\n <p class=\"note\">It can be a real problem booking a hotel room with the name John Doe.</p>\n\n <p>Companies:</p>\n <div>\n <img class=\"logo\" src=\"images/logo.gif\" alt=\"Madgex company logo\" />\n <img class=\"logo\" src=\"images/logo.gif\" alt=\"Web Feet Media company logo\" />\n </div>\n <ul>\n <li><a class=\"url org\" href=\"http://www.madgex.com/\">Madgex</a> <span class=\"title\">Creative Director</span></li>\n <li><a class=\"url org\" href=\"http://www.webfeetmedia.com/\">Web Feet Media Ltd</a> <span class=\"title\">Owner</span></li>\n </ul>\n \n <p>Tags: \n <a rel=\"tag\" class=\"category\" href=\"http://en.wikipedia.org/wiki/design\">design</a>, \n <a rel=\"tag\" class=\"category\" href=\"http://en.wikipedia.org/wiki/development\">development</a> and\n <a rel=\"tag\" class=\"category\" href=\"http://en.wikipedia.org/wiki/web\">web</a>\n </p>\n \n <p>Phone numbers:</p>\n <ul>\n <li class=\"tel\">\n <span class=\"type\">Work</span> (<span class=\"type\">pref</span>erred):\n <span class=\"value\">+1 415 555 100</span>\n </li>\n <li class=\"tel\"><span class=\"type\">Home</span>: <span class=\"value\">+1 415 555 200</span></li>\n <li class=\"tel\"><span class=\"type\">Postal</span>: <span class=\"value\">+1 415 555 300</span></li>\n </ul>\n \n <p>Emails:</p>\n <ul>\n <li><a class=\"email\" href=\"mailto:john.doe@madgex.com\">John Doe at Madgex</a></li>\n <li><a class=\"email\" href=\"mailto:john.doe@webfeetmedia.com\">John Doe at Web Feet Media</a></li>\n </ul>\n <p>John Doe uses <span class=\"mailer\">PigeonMail 2.1</span> or <span class=\"mailer\">Outlook 2007</span> for email.</p>\n\n <p>Addresses:</p>\n <ul>\n <li class=\"label\">\n <span class=\"adr\">\n <span class=\"type\">Work</span>: \n <span class=\"street-address\">North Street</span>, \n <span class=\"locality\">Brighton</span>, \n <span class=\"country-name\">United Kingdom</span>\n </span>\n \n </li>\n <li class=\"label\">\n <span class=\"adr\">\n <span class=\"type\">Home</span>: \n <span class=\"street-address\">West Street</span>, \n <span class=\"locality\">Brighton</span>, \n <span class=\"country-name\">United Kingdom</span>\n </span>\n </li>\n </ul>\n \n <p>In emergency contact: <span class=\"agent\">Jane Doe</span> or <span class=\"agent vcard\"><span class=\"fn\">Dave Doe</span></span>.</p>\n <p>Key: <span class=\"key\">hd02$Gfu*d%dh87KTa2=23934532479</span></p>\n</div>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["John Doe"],"given-name":["John"],"family-name":["Doe"],"sound":["http://www.madgex.com/johndoe.mpeg"],"photo":["http://example.com/images/photo.gif"],"nickname":["Man with no name","Lost boy"],"note":["John Doe is one of those names you always have issues with.","It can be a real problem booking a hotel room with the name John Doe."],"logo":["http://example.com/images/logo.gif","http://example.com/images/logo.gif"],"url":["http://www.madgex.com/","http://www.webfeetmedia.com/"],"org":["Madgex","Web Feet Media Ltd"],"job-title":["Creative Director","Owner"],"category":["design","development","web"],"tel":["+1 415 555 100","+1 415 555 200","+1 415 555 300"],"email":["mailto:john.doe@madgex.com","mailto:john.doe@webfeetmedia.com"],"mailer":["PigeonMail 2.1","Outlook 2007"],"label":["Work: \n North Street, \n Brighton, \n United Kingdom","Home: \n West Street, \n Brighton, \n United Kingdom"],"adr":[{"value":"Work: \n North Street, \n Brighton, \n United Kingdom","type":["h-adr"],"properties":{"street-address":["North Street"],"locality":["Brighton"],"country-name":["United Kingdom"]}},{"value":"Home: \n West Street, \n Brighton, \n United Kingdom","type":["h-adr"],"properties":{"street-address":["West Street"],"locality":["Brighton"],"country-name":["United Kingdom"]}}],"agent":["Jane Doe",{"value":"Dave Doe","type":["h-card"],"properties":{"name":["Dave Doe"]}}],"key":["hd02$Gfu*d%dh87KTa2=23934532479"]}}],"rels":{"tag":["http://en.wikipedia.org/wiki/design","http://en.wikipedia.org/wiki/development","http://en.wikipedia.org/wiki/web"]},"rel-urls":{"http://en.wikipedia.org/wiki/design":{"text":"design","rels":["tag"]},"http://en.wikipedia.org/wiki/development":{"text":"development","rels":["tag"]},"http://en.wikipedia.org/wiki/web":{"text":"web","rels":["tag"]}}};
-
- it('multiple', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-name.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-name.js
deleted file mode 100644
index ef75899cf..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-name.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hcard/name
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hcard', function() {
- var htmlFragment = "<base href=\"http://example.com\">\n<div class=\"vcard\">\n <div class=\"name\">\n <span class=\"honorific-prefix\">Dr</span> \n <span class=\"given-name\">John</span> \n <abbr class=\"additional-name\" title=\"Peter\">P</abbr> \n <span class=\"family-name\">Doe</span> \n <data class=\"honorific-suffix\" value=\"MSc\"></data>\n <img class=\"photo honorific-suffix\" src=\"images/logo.gif\" alt=\"PHD\" />\n </div>\n</div>";
- var expected = {"items":[{"type":["h-card"],"properties":{"honorific-prefix":["Dr"],"given-name":["John"],"additional-name":["Peter"],"family-name":["Doe"],"honorific-suffix":["MSc","PHD"],"photo":["http://example.com/images/logo.gif"]}}],"rels":{},"rel-urls":{}};
-
- it('name', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-single.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-single.js
deleted file mode 100644
index a7ef7628b..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hcard-single.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hcard/single
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hcard', function() {
- var htmlFragment = "<div class=\"vcard\">\n \n <div class=\"fn n\"><span class=\"given-name sort-string\">John</span> Doe</div>\n <div>Birthday: <abbr class=\"bday\" title=\"2000-01-01T00:00:00-08:00\">January 1st, 2000</abbr></div>\n <div>Role: <span class=\"role\">Designer</span></div>\n <div>Location: <abbr class=\"geo\" title=\"30.267991;-97.739568\">Brighton</abbr></div>\n <div>Time zone: <abbr class=\"tz\" title=\"-05:00\">Eastern Standard Time</abbr></div>\n \n <div>Profile details:\n <div>Profile id: <span class=\"uid\">http://example.com/profiles/johndoe</span></div>\n <div>Details are: <span class=\"class\">Public</span></div>\n <div>Last updated: <abbr class=\"rev\" title=\"2008-01-01T13:45:00\">January 1st, 2008 - 13:45</abbr></div>\n </div>\n </div>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["John Doe"],"given-name":["John"],"sort-string":["John"],"bday":["2000-01-01 00:00:00-08:00"],"role":["Designer"],"geo":[{"value":"30.267991;-97.739568","type":["h-geo"],"properties":{"name":["30.267991;-97.739568"]}}],"tz":["-05:00"],"uid":["http://example.com/profiles/johndoe"],"class":["Public"],"rev":["2008-01-01 13:45:00"]}}],"rels":{},"rel-urls":{}};
-
- it('single', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hentry-summarycontent.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hentry-summarycontent.js
deleted file mode 100644
index 5280efb04..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hentry-summarycontent.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hentry/summarycontent
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hentry', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<div class=\"hentry\">\n <h1><a class=\"entry-title\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n <div class=\"entry-content\">\n <p class=\"entry-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n </div> \n <p>Updated \n <time class=\"updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time> by\n <span class=\"author vcard\"><a class=\"fn url\" href=\"http://tantek.com/\">Tantek</a></span>\n </p>\n</div>";
- var expected = {"items":[{"type":["h-entry"],"properties":{"name":["microformats.org at 7"],"content":[{"value":"Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second†\n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service","html":"\n <p class=\"entry-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n "}],"summary":["Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities."],"updated":["2012-06-25 17:08:26"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('summarycontent', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hfeed-simple.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hfeed-simple.js
deleted file mode 100644
index 4c8294d49..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hfeed-simple.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hfeed/simple
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hfeed', function() {
- var htmlFragment = "<section class=\"hfeed\">\n\t<h1 class=\"name\">Microformats blog</h1>\n\t<span class=\"author vcard\"><a class=\"fn url\" href=\"http://tantek.com/\">Tantek</a></span>\n\t<a class=\"url\" href=\"http://microformats.org/blog\">permlink</a>\n\t<img class=\"photo\" src=\"photo.jpeg\"/>\n\t<p>\n\t\tTags: <a rel=\"tag\" href=\"tags/microformats\">microformats</a>, \n\t\t<a rel=\"tag\" href=\"tags/html\">html</a>\n\t</p>\n\t\n\t<div class=\"hentry\">\n\t <h1><a class=\"entry-title\" rel=\"bookmark\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n\t <div class=\"entry-content\">\n\t <p class=\"entry-summary\">Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.</p>\n\t\n\t <p>The microformats tagline “humans first, machines second†\n\t forms the basis of many of our \n\t <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service </p>\n\t </div> \n\t <p>Updated \n\t <time class=\"updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time>\n\t </p>\n\t</div>\n\t\n</section>";
- var expected = {"items":[{"type":["h-feed"],"properties":{"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}],"url":["http://microformats.org/blog"],"photo":["http://example.com/photo.jpeg"],"category":["microformats","html"]},"children":[{"value":"microformats.org at 7\n\t \n\t Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.\n\t\n\t The microformats tagline “humans first, machines second†\n\t forms the basis of many of our \n\t principles, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service \n\t \n\t Updated \n\t June 25th, 2012","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.\n\t\n\t The microformats tagline “humans first, machines second†\n\t forms the basis of many of our \n\t principles, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service","html":"\n\t <p class=\"entry-summary\">Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.</p>\n\t\n\t <p>The microformats tagline “humans first, machines second†\n\t forms the basis of many of our \n\t <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service </p>\n\t "}],"summary":["Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities."],"updated":["2012-06-25 17:08:26"]}}]}],"rels":{"tag":["http://example.com/tags/microformats","http://example.com/tags/html"],"bookmark":["http://microformats.org/2012/06/25/microformats-org-at-7"]},"rel-urls":{"http://example.com/tags/microformats":{"text":"microformats","rels":["tag"]},"http://example.com/tags/html":{"text":"html","rels":["tag"]},"http://microformats.org/2012/06/25/microformats-org-at-7":{"text":"microformats.org at 7","rels":["bookmark"]}}};
-
- it('simple', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-all.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-all.js
deleted file mode 100644
index 82eb37b95..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-all.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hnews/all
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hnews', function() {
- var htmlFragment = "<div class=\"hnews\">\n <div class=\"entry hentry\">\n <h1><a class=\"entry-title\" rel=\"bookmark\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n <div class=\"entry-content\">\n <p class=\"entry-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n </div> \n <p>Updated \n <time class=\"updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time> by\n <span class=\"author vcard\"><a class=\"fn url\" href=\"http://tantek.com/\">Tantek</a></span>\n </p>\n </div>\n\n <p>\n <span class=\"dateline vcard\">\n <span class=\"adr\">\n <span class=\"locality\">San Francisco</span>, \n <span class=\"region\">CA</span> \n </span>\n </span>\n (Geo: <span class=\"geo\">37.774921;-122.445202</span>) \n <span class=\"source-org vcard\">\n <a class=\"fn org url\" href=\"http://microformats.org/\">microformats.org</a>\n </span>\n </p>\n <p>\n <a rel=\"principles\" href=\"http://microformats.org/wiki/Category:public_domain_license\">Publishing policy</a>\n </p>\n</div>";
- var expected = {"items":[{"type":["h-news"],"properties":{"entry":[{"value":"microformats.org at 7","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second†\n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service","html":"\n <p class=\"entry-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n "}],"summary":["Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities."],"updated":["2012-06-25 17:08:26"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}]}}],"dateline":[{"value":"San Francisco, \n CA","type":["h-card"],"properties":{"adr":[{"value":"San Francisco, \n CA","type":["h-adr"],"properties":{"locality":["San Francisco"],"region":["CA"]}}]}}],"geo":[{"value":"37.774921;-122.445202","type":["h-geo"],"properties":{"name":["37.774921;-122.445202"]}}],"source-org":[{"value":"microformats.org","type":["h-card"],"properties":{"name":["microformats.org"],"org":["microformats.org"],"url":["http://microformats.org/"]}}],"principles":["http://microformats.org/wiki/Category:public_domain_license"]}}],"rels":{"bookmark":["http://microformats.org/2012/06/25/microformats-org-at-7"],"principles":["http://microformats.org/wiki/Category:public_domain_license"]},"rel-urls":{"http://microformats.org/2012/06/25/microformats-org-at-7":{"text":"microformats.org at 7","rels":["bookmark"]},"http://microformats.org/wiki/Category:public_domain_license":{"text":"Publishing policy","rels":["principles"]}}};
-
- it('all', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-minimum.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-minimum.js
deleted file mode 100644
index 5faf13d7b..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hnews-minimum.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hnews/minimum
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hnews', function() {
- var htmlFragment = "<div class=\"hnews\">\n <div class=\"entry hentry\">\n <h1><a class=\"entry-title\" rel=\"bookmark\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n <div class=\"entry-content\">\n <p class=\"entry-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n </div> \n <p>Updated \n <time class=\"updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time> by\n <span class=\"author vcard\"><a class=\"fn url\" href=\"http://tantek.com/\">Tantek</a></span>\n </p>\n </div>\n\n <p class=\"source-org vcard\">\n <a class=\"fn org url\" href=\"http://microformats.org/\">microformats.org</a> \n </p>\n</div>";
- var expected = {"items":[{"type":["h-news"],"properties":{"entry":[{"value":"microformats.org at 7","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second†\n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service","html":"\n <p class=\"entry-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n "}],"summary":["Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities."],"updated":["2012-06-25 17:08:26"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}]}}],"source-org":[{"value":"microformats.org","type":["h-card"],"properties":{"name":["microformats.org"],"org":["microformats.org"],"url":["http://microformats.org/"]}}]}}],"rels":{"bookmark":["http://microformats.org/2012/06/25/microformats-org-at-7"]},"rel-urls":{"http://microformats.org/2012/06/25/microformats-org-at-7":{"text":"microformats.org at 7","rels":["bookmark"]}}};
-
- it('minimum', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-aggregate.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-aggregate.js
deleted file mode 100644
index 7171bc726..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-aggregate.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hproduct/aggregate
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hproduct', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<div class=\"hproduct\">\n <h2 class=\"fn\">Raspberry Pi</h2>\n <img class=\"photo\" src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg\" />\n <p class=\"description\">The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.</p>\n <a class=\"url\" href=\"http://www.raspberrypi.org/\">More info about the Raspberry Pi</a>\n <p class=\"price\">£29.95</p>\n <p class=\"review hreview-aggregate\">\n <span class=\"rating\">\n <span class=\"average value\">9.2</span> out of \n <span class=\"best\">10</span> \n based on <span class=\"count\">178</span> reviews\n </span>\n </p>\n <p>Categories: \n <a rel=\"tag\" href=\"http://en.wikipedia.org/wiki/computer\" class=\"category\">Computer</a>, \n <a rel=\"tag\" href=\"http://en.wikipedia.org/wiki/education\" class=\"category\">Education</a>\n </p>\n <p class=\"brand vcard\">From: \n <span class=\"fn org\">The Raspberry Pi Foundation</span> - \n <span class=\"adr\">\n <span class=\"locality\">Cambridge</span> \n <span class=\"country-name\">UK</span>\n </span>\n </p>\n</div>";
- var expected = {"items":[{"type":["h-product"],"properties":{"name":["Raspberry Pi"],"photo":["http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg"],"description":[{"value":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.","html":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming."}],"url":["http://www.raspberrypi.org/"],"price":["£29.95"],"review":[{"value":"9.2 out of \n 10 \n based on 178 reviews","type":["h-review-aggregate"],"properties":{"rating":["9.2"],"average":["9.2"],"best":["10"],"count":["178"]}}],"category":["Computer","Education"],"brand":[{"value":"The Raspberry Pi Foundation","type":["h-card"],"properties":{"name":["The Raspberry Pi Foundation"],"org":["The Raspberry Pi Foundation"],"adr":[{"value":"Cambridge \n UK","type":["h-adr"],"properties":{"locality":["Cambridge"],"country-name":["UK"]}}]}}]}}],"rels":{"tag":["http://en.wikipedia.org/wiki/computer","http://en.wikipedia.org/wiki/education"]},"rel-urls":{"http://en.wikipedia.org/wiki/computer":{"text":"Computer","rels":["tag"]},"http://en.wikipedia.org/wiki/education":{"text":"Education","rels":["tag"]}}};
-
- it('aggregate', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-simpleproperties.js
deleted file mode 100644
index 7ec61f27b..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hproduct-simpleproperties.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hproduct/simpleproperties
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hproduct', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<div class=\"hproduct\">\n <h2 class=\"fn\">Raspberry Pi</h2>\n <img class=\"photo\" src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg\" />\n <p class=\"description\">The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.</p>\n <a class=\"url\" href=\"http://www.raspberrypi.org/\">More info about the Raspberry Pi</a>\n <p class=\"price\">£29.95</p>\n <p class=\"review hreview\"><span class=\"rating\">4.5</span> out of 5</p>\n <p>Categories: \n <a rel=\"tag\" href=\"http://en.wikipedia.org/wiki/computer\" class=\"category\">Computer</a>, \n <a rel=\"tag\" href=\"http://en.wikipedia.org/wiki/education\" class=\"category\">Education</a>\n </p>\n</div>";
- var expected = {"items":[{"type":["h-product"],"properties":{"name":["Raspberry Pi"],"photo":["http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg"],"description":[{"value":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.","html":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming."}],"url":["http://www.raspberrypi.org/"],"price":["£29.95"],"category":["Computer","Education"],"review":[{"value":"4.5 out of 5","type":["h-review"],"properties":{"rating":["4.5"]}}]}}],"rels":{"tag":["http://en.wikipedia.org/wiki/computer","http://en.wikipedia.org/wiki/education"]},"rel-urls":{"http://en.wikipedia.org/wiki/computer":{"text":"Computer","rels":["tag"]},"http://en.wikipedia.org/wiki/education":{"text":"Education","rels":["tag"]}}};
-
- it('simpleproperties', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-affiliation.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-affiliation.js
deleted file mode 100644
index d580d68db..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-affiliation.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hresume/affiliation
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hresume', function() {
- var htmlFragment = "<div class=\"hresume\">\n <p>\n <span class=\"contact vcard\"><span class=\"fn\">Tim Berners-Lee</span></span>, \n <span class=\"summary\">invented the World Wide Web</span>.\n </p>\n Belongs to following groups:\n <p> \n <a class=\"affiliation vcard\" href=\"http://www.w3.org/\">\n <img class=\"fn photo\" alt=\"W3C\" src=\"http://www.w3.org/Icons/WWW/w3c_home_nb.png\" />\n </a>\n </p> \n</div>";
- var expected = {"items":[{"type":["h-resume"],"properties":{"contact":[{"value":"Tim Berners-Lee","type":["h-card"],"properties":{"name":["Tim Berners-Lee"]}}],"summary":["invented the World Wide Web"],"affiliation":[{"type":["h-card"],"properties":{"name":["W3C"],"photo":["http://www.w3.org/Icons/WWW/w3c_home_nb.png"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('affiliation', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-contact.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-contact.js
deleted file mode 100644
index 595087af4..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-contact.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hresume/contact
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hresume', function() {
- var htmlFragment = "<div class=\"hresume\">\n <div class=\"contact vcard\">\n <p class=\"fn\">Tim Berners-Lee</p>\n <p class=\"org\">MIT</p>\n <p class=\"adr\">\n <span class=\"street-address\">32 Vassar Street</span>, \n <span class=\"extended-address\">Room 32-G524</span>, \n <span class=\"locality\">Cambridge</span>, \n <span class=\"region\">MA</span> \n <span class=\"postal-code\">02139</span>, \n <span class=\"country-name\">USA</span>. \n (<span class=\"type\">Work</span>)\n </p>\n <p>Tel:<span class=\"tel\">+1 (617) 253 5702</span></p>\n <p>Email:<a class=\"email\" href=\"mailto:timbl@w3.org\">timbl@w3.org</a></p>\n </div>\n <p class=\"summary\">Invented the World Wide Web.</p>\n</div>";
- var expected = {"items":[{"type":["h-resume"],"properties":{"contact":[{"value":"Tim Berners-Lee","type":["h-card"],"properties":{"name":["Tim Berners-Lee"],"org":["MIT"],"adr":[{"value":"32 Vassar Street, \n Room 32-G524, \n Cambridge, \n MA \n 02139, \n USA. \n (Work)","type":["h-adr"],"properties":{"street-address":["32 Vassar Street"],"extended-address":["Room 32-G524"],"locality":["Cambridge"],"region":["MA"],"postal-code":["02139"],"country-name":["USA"]}}],"tel":["+1 (617) 253 5702"],"email":["mailto:timbl@w3.org"]}}],"summary":["Invented the World Wide Web."]}}],"rels":{},"rel-urls":{}};
-
- it('contact', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-education.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-education.js
deleted file mode 100644
index 7a0114f53..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-education.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hresume/education
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hresume', function() {
- var htmlFragment = "<div class=\"hresume\">\n <div class=\"contact vcard\">\n <p class=\"fn\">Tim Berners-Lee</p>\n <p class=\"title\">Director of the World Wide Web Foundation</p>\n </div>\n <p class=\"summary\">Invented the World Wide Web.</p><hr />\n <p class=\"education vevent vcard\">\n <span class=\"fn summary org\">The Queen's College, Oxford University</span>, \n <span class=\"description\">BA Hons (I) Physics</span> \n <time class=\"dtstart\" datetime=\"1973-09\">1973</time> –\n <time class=\"dtend\" datetime=\"1976-06\">1976</time>\n </p>\n</div>";
- var expected = {"items":[{"type":["h-resume"],"properties":{"contact":[{"value":"Tim Berners-Lee","type":["h-card"],"properties":{"name":["Tim Berners-Lee"],"job-title":["Director of the World Wide Web Foundation"]}}],"summary":["Invented the World Wide Web."],"education":[{"value":"The Queen's College, Oxford University","type":["h-event","h-card"],"properties":{"name":["The Queen's College, Oxford University"],"org":["The Queen's College, Oxford University"],"description":["BA Hons (I) Physics"],"start":["1973-09"],"end":["1976-06"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('education', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-skill.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-skill.js
deleted file mode 100644
index b08256700..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-skill.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hresume/skill
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hresume', function() {
- var htmlFragment = "<div class=\"hresume\"> \n <p>\n <span class=\"contact vcard\"><span class=\"fn\">Tim Berners-Lee</span></span>, \n <span class=\"summary\">invented the World Wide Web</span>.\n </p>\n Skills: \n <ul>\n <li><a class=\"skill\" rel=\"tag\" href=\"http://example.com/skills/informationsystems\">information systems</a></li>\n <li><a class=\"skill\" rel=\"tag\" href=\"http://example.com/skills/advocacy\">advocacy</a></li>\n <li><a class=\"skill\" rel=\"tag\" href=\"http://example.com/skills/leadership\">leadership</a></li>\n </ul>\n</div>";
- var expected = {"items":[{"type":["h-resume"],"properties":{"contact":[{"value":"Tim Berners-Lee","type":["h-card"],"properties":{"name":["Tim Berners-Lee"]}}],"summary":["invented the World Wide Web"],"skill":["information systems","advocacy","leadership"]}}],"rels":{"tag":["http://example.com/skills/informationsystems","http://example.com/skills/advocacy","http://example.com/skills/leadership"]},"rel-urls":{"http://example.com/skills/informationsystems":{"text":"information systems","rels":["tag"]},"http://example.com/skills/advocacy":{"text":"advocacy","rels":["tag"]},"http://example.com/skills/leadership":{"text":"leadership","rels":["tag"]}}};
-
- it('skill', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-work.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-work.js
deleted file mode 100644
index 4ece3a389..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hresume-work.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hresume/work
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hresume', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<div class=\"hresume\">\n <div class=\"contact vcard\">\n <p class=\"fn\">Tim Berners-Lee</p>\n <p class=\"title\">Director of the World Wide Web Foundation</p>\n </div>\n <p class=\"summary\">Invented the World Wide Web.</p><hr />\n <div class=\"experience vevent vcard\">\n <p class=\"title\">Director</p>\n <p><a class=\"fn summary org url\" href=\"http://www.webfoundation.org/\">World Wide Web Foundation</a></p>\n <p>\n <time class=\"dtstart\" datetime=\"2009-01-18\">Jan 2009</time> – Present\n <time class=\"duration\" datetime=\"P2Y11M\">(2 years 11 month)</time>\n </p>\n </div>\n</div>";
- var expected = {"items":[{"type":["h-resume"],"properties":{"contact":[{"value":"Tim Berners-Lee","type":["h-card"],"properties":{"name":["Tim Berners-Lee"],"job-title":["Director of the World Wide Web Foundation"]}}],"summary":["Invented the World Wide Web."],"experience":[{"value":"World Wide Web Foundation","type":["h-event","h-card"],"properties":{"job-title":["Director"],"name":["World Wide Web Foundation"],"org":["World Wide Web Foundation"],"url":["http://www.webfoundation.org/"],"start":["2009-01-18"],"duration":["P2Y11M"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('work', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-hcard.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-hcard.js
deleted file mode 100644
index 6cdf65484..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-hcard.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hreview-aggregate/hcard
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hreview-aggregate', function() {
- var htmlFragment = "<div class=\"hreview-aggregate\">\n <div class=\"item vcard\">\n <h3 class=\"fn org\">Mediterranean Wraps</h3> \n <p>\n <span class=\"adr\">\n <span class=\"street-address\">433 S California Ave</span>, \n <span class=\"locality\">Palo Alto</span>, \n <span class=\"region\">CA</span></span> - \n \n <span class=\"tel\">(650) 321-8189</span>\n </p>\n </div> \n <p class=\"rating\">\n <span class=\"average value\">9.2</span> out of \n <span class=\"best\">10</span> \n based on <span class=\"count\">17</span> reviews\n </p>\n</div>";
- var expected = {"items":[{"type":["h-review-aggregate"],"properties":{"item":[{"value":"Mediterranean Wraps","type":["h-item","h-card"],"properties":{"name":["Mediterranean Wraps"],"org":["Mediterranean Wraps"],"adr":[{"value":"433 S California Ave, \n Palo Alto, \n CA","type":["h-adr"],"properties":{"street-address":["433 S California Ave"],"locality":["Palo Alto"],"region":["CA"]}}],"tel":["(650) 321-8189"]}}],"rating":["9.2"],"average":["9.2"],"best":["10"],"count":["17"]}}],"rels":{},"rel-urls":{}};
-
- it('hcard', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-justahyperlink.js
deleted file mode 100644
index 56d106fdb..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-justahyperlink.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hreview-aggregate/justahyperlink
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hreview-aggregate', function() {
- var htmlFragment = "<p class=\"hreview-aggregate\">\n <span class=\"item\">\n <a class=\"fn url\" href=\"http://example.com/mediterraneanwraps\">Mediterranean Wraps</a>\n </span> - Rated: \n <span class=\"rating\">4.5</span> out of 5 (<span class=\"count\">6</span> reviews)\n</p>";
- var expected = {"items":[{"type":["h-review-aggregate"],"properties":{"item":[{"value":"Mediterranean Wraps","type":["h-item"],"properties":{"name":["Mediterranean Wraps"],"url":["http://example.com/mediterraneanwraps"]}}],"rating":["4.5"],"count":["6"]}}],"rels":{},"rel-urls":{}};
-
- it('justahyperlink', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-vevent.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-vevent.js
deleted file mode 100644
index 896bbdc1d..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-aggregate-vevent.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hreview-aggregate/vevent
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hreview-aggregate', function() {
- var htmlFragment = "<div class=\"hreview-aggregate\">\n <div class=\"item vevent\">\n <h3 class=\"summary\">Fullfrontal</h3>\n <p class=\"description\">A one day JavaScript Conference held in Brighton</p>\n <p><time class=\"dtstart\" datetime=\"2012-11-09\">9th November 2012</time></p> \n </div> \n \n <p class=\"rating\">\n <span class=\"average value\">9.9</span> out of \n <span class=\"best\">10</span> \n based on <span class=\"count\">62</span> reviews\n </p>\n</div>";
- var expected = {"items":[{"type":["h-review-aggregate"],"properties":{"item":[{"value":"Fullfrontal","type":["h-item","h-event"],"properties":{"name":["Fullfrontal"],"description":["A one day JavaScript Conference held in Brighton"],"start":["2012-11-09"]}}],"rating":["9.9"],"average":["9.9"],"best":["10"],"count":["62"]}}],"rels":{},"rel-urls":{}};
-
- it('vevent', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-item.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-item.js
deleted file mode 100644
index 4a00ac46a..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-item.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hreview/item
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hreview', function() {
- var htmlFragment = "<base href=\"http://example.com\">\n<div class=\"hreview\">\n <p class=\"item\">\n <img class=\"photo\" src=\"images/photo.gif\" />\n <a class=\"fn url\" href=\"http://example.com/crepeoncole\">Crepes on Cole</a>\n </p>\n <p><span class=\"rating\">5</span> out of 5 stars</p>\n</div>";
- var expected = {"items":[{"type":["h-review"],"properties":{"item":[{"value":"Crepes on Cole","type":["h-item"],"properties":{"photo":["http://example.com/images/photo.gif"],"name":["Crepes on Cole"],"url":["http://example.com/crepeoncole"]}}],"rating":["5"]}}],"rels":{},"rel-urls":{}};
-
- it('item', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-vcard.js b/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-vcard.js
deleted file mode 100644
index d59decb7f..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-hreview-vcard.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/hreview/vcard
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('hreview', function() {
- var htmlFragment = "<div class=\"hreview\">\n <span><span class=\"rating\">5</span> out of 5 stars</span>\n <h4 class=\"summary\">Crepes on Cole is awesome</h4>\n <span class=\"reviewer vcard\">\n Reviewer: <span class=\"fn\">Tantek</span> - \n </span>\n <time class=\"reviewed\" datetime=\"2005-04-18\">April 18, 2005</time>\n <div class=\"description\">\n <p class=\"item vcard\">\n <span class=\"fn org\">Crepes on Cole</span> is one of the best little \n creperies in <span class=\"adr\"><span class=\"locality\">San Francisco</span></span>.\n Excellent food and service. Plenty of tables in a variety of sizes \n for parties large and small. Window seating makes for excellent \n people watching to/from the N-Judah which stops right outside. \n I've had many fun social gatherings here, as well as gotten \n plenty of work done thanks to neighborhood WiFi.\n </p>\n </div>\n <p>Visit date: <span>April 2005</span></p>\n <p>Food eaten: <a rel=\"tag\" href=\"http://en.wikipedia.org/wiki/crepe\">crepe</a></p>\n <p>Permanent link for review: <a rel=\"self bookmark\" href=\"http://example.com/crepe\">http://example.com/crepe</a></p>\n <p><a rel=\"license\" href=\"http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License\">Creative Commons Attribution-ShareAlike License</a></p>\n</div>";
- var expected = {"items":[{"type":["h-review"],"properties":{"rating":["5"],"name":["Crepes on Cole is awesome"],"reviewer":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"]}}],"description":[{"value":"Crepes on Cole is one of the best little \n creperies in San Francisco.\n Excellent food and service. Plenty of tables in a variety of sizes \n for parties large and small. Window seating makes for excellent \n people watching to/from the N-Judah which stops right outside. \n I've had many fun social gatherings here, as well as gotten \n plenty of work done thanks to neighborhood WiFi.","html":"\n <p class=\"item vcard\">\n <span class=\"fn org\">Crepes on Cole</span> is one of the best little \n creperies in <span class=\"adr\"><span class=\"locality\">San Francisco</span></span>.\n Excellent food and service. Plenty of tables in a variety of sizes \n for parties large and small. Window seating makes for excellent \n people watching to/from the N-Judah which stops right outside. \n I've had many fun social gatherings here, as well as gotten \n plenty of work done thanks to neighborhood WiFi.\n </p>\n "}],"item":[{"value":"Crepes on Cole","type":["h-item","h-card"],"properties":{"name":["Crepes on Cole"],"org":["Crepes on Cole"],"adr":[{"value":"San Francisco","type":["h-adr"],"properties":{"locality":["San Francisco"]}}]}}],"category":["crepe"],"url":["http://example.com/crepe"]}}],"rels":{"tag":["http://en.wikipedia.org/wiki/crepe"],"self":["http://example.com/crepe"],"bookmark":["http://example.com/crepe"],"license":["http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License"]},"rel-urls":{"http://en.wikipedia.org/wiki/crepe":{"text":"crepe","rels":["tag"]},"http://example.com/crepe":{"text":"http://example.com/crepe","rels":["self","bookmark"]},"http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License":{"text":"Creative Commons Attribution-ShareAlike License","rels":["license"]}}};
-
- it('vcard', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hcarditemref.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hcarditemref.js
deleted file mode 100644
index 5ffa373d7..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hcarditemref.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/includes/hcarditemref
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('includes', function() {
- var htmlFragment = "<div class=\"vcard\" itemref=\"mozilla-org mozilla-adr\">\n <span class=\"name\">Brendan Eich</span>\n</div>\n<div class=\"vcard\" itemref=\"mozilla-org mozilla-adr\">\n <span class=\"name\">Mitchell Baker</span>\n</div>\n\n<p id=\"mozilla-org\" class=\"org\">Mozilla</p>\n<p id=\"mozilla-adr\" class=\"adr\">\n <span class=\"street-address\">665 3rd St.</span> \n <span class=\"extended-address\">Suite 207</span> \n <span class=\"locality\">San Francisco</span>, \n <span class=\"region\">CA</span> \n <span class=\"postal-code\">94107</span> \n <span class=\"country-name\">U.S.A.</span> \n</p>";
- var expected = {"items":[{"type":["h-card"],"properties":{"org":["Mozilla"],"adr":[{"value":"665 3rd St. \n Suite 207 \n San Francisco, \n CA \n 94107 \n U.S.A.","type":["h-adr"],"properties":{"street-address":["665 3rd St."],"extended-address":["Suite 207"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94107"],"country-name":["U.S.A."]}}]}},{"type":["h-card"],"properties":{"org":["Mozilla"],"adr":[{"value":"665 3rd St. \n Suite 207 \n San Francisco, \n CA \n 94107 \n U.S.A.","type":["h-adr"],"properties":{"street-address":["665 3rd St."],"extended-address":["Suite 207"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94107"],"country-name":["U.S.A."]}}]}},{"type":["h-adr"],"properties":{"street-address":["665 3rd St."],"extended-address":["Suite 207"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94107"],"country-name":["U.S.A."]}}],"rels":{},"rel-urls":{}};
-
- it('hcarditemref', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-heventitemref.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-heventitemref.js
deleted file mode 100644
index b3a16025b..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-heventitemref.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/includes/heventitemref
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('includes', function() {
- var htmlFragment = "<div class=\"vevent\" itemref=\"io-session07\">\n <span class=\"name\">Monetizing Android Apps</span> - spaekers: \n <span class=\"speaker\">Chrix Finne</span>, \n <span class=\"speaker\">Kenneth Lui</span> - \n <span itemref=\"io-location\" class=\"location adr\">\n <span class=\"extended-address\">Room 10</span>\n </span> \n</div>\n<div class=\"vevent\" itemref=\"io-session07\">\n <span class=\"name\">New Low-Level Media APIs in Android</span> - spaekers: \n <span class=\"speaker\">Dave Burke</span> -\n <span itemref=\"io-location\" class=\"location adr\">\n <span class=\"extended-address\">Room 11</span>\n </span> \n</div>\n\n<p id=\"io-session07\">\n Session 01 is between: \n <time class=\"dtstart\" datetime=\"2012-06-27T15:45:00-0800\">3:45PM</time> to \n <time class=\"dtend\" datetime=\"2012-06-27T16:45:00-0800\">4:45PM</time> \n</p> \n<p id=\"io-location\">\n <span class=\"extended-address\">Moscone Center</span>, \n <span class=\"locality\">San Francisco</span> \n</p>";
- var expected = {"items":[{"type":["h-event"],"properties":{"location":[{"value":"Room 10\n \n Moscone Center, \n San Francisco","type":["h-adr"],"properties":{"extended-address":["Room 10","Moscone Center"],"locality":["San Francisco"]}}],"start":["2012-06-27 15:45:00-08:00"],"end":["2012-06-27 16:45:00-08:00"]}},{"type":["h-event"],"properties":{"location":[{"value":"Room 11\n \n Moscone Center, \n San Francisco","type":["h-adr"],"properties":{"extended-address":["Room 11","Moscone Center"],"locality":["San Francisco"]}}],"start":["2012-06-27 15:45:00-08:00"],"end":["2012-06-27 16:45:00-08:00"]}}],"rels":{},"rel-urls":{}};
-
- it('heventitemref', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hyperlink.js
deleted file mode 100644
index 3a789bb1b..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-hyperlink.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/includes/hyperlink
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('includes', function() {
- var htmlFragment = "<div class=\"vcard\">\n <span class=\"name\">Ben Ward</span>\n <a class=\"include\" href=\"#twitter\">Twitter</a>\n</div>\n<div class=\"vcard\">\n <span class=\"name\">Dan Webb</span>\n <a class=\"include\" href=\"#twitter\">Twitter</a>\n</div>\n\n<div id=\"twitter\">\n <p class=\"org\">Twitter</p>\n <p class=\"adr\">\n <span class=\"street-address\">1355 Market St</span>,\n <span class=\"locality\">San Francisco</span>, \n <span class=\"region\">CA</span>\n <span class=\"postal-code\">94103</span>\n </p>\n</div>";
- var expected = {"items":[{"type":["h-card"],"properties":{"org":["Twitter"],"adr":[{"value":"1355 Market St,\n San Francisco, \n CA\n 94103","type":["h-adr"],"properties":{"street-address":["1355 Market St"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94103"]}}]}},{"type":["h-card"],"properties":{"org":["Twitter"],"adr":[{"value":"1355 Market St,\n San Francisco, \n CA\n 94103","type":["h-adr"],"properties":{"street-address":["1355 Market St"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94103"]}}]}},{"type":["h-adr"],"properties":{"street-address":["1355 Market St"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94103"]}}],"rels":{},"rel-urls":{}};
-
- it('hyperlink', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-object.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-object.js
deleted file mode 100644
index 3bc15bd45..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-object.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/includes/object
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('includes', function() {
- var htmlFragment = "<div class=\"vevent\">\n <span class=\"name\">HTML5 & CSS3 latest features in action!</span> - \n <span class=\"speaker\">David Rousset</span> -\n <time class=\"dtstart\" datetime=\"2012-10-30T11:45:00-08:00\">Tue 11:45am</time>\n <object data=\"#buildconf\" class=\"include\" type=\"text/html\" height=\"0\" width=\"0\"></object>\n</div>\n<div class=\"vevent\">\n <span class=\"name\">Building High-Performing JavaScript for Modern Engines</span> -\n <span class=\"speaker\">John-David Dalton</span> and \n <span class=\"speaker\">Amanda Silver</span> -\n <time class=\"dtstart\" datetime=\"2012-10-31T11:15:00-08:00\">Wed 11:15am</time>\n <object data=\"#buildconf\" class=\"include\" type=\"text/html\" height=\"0\" width=\"0\"></object>\n</div>\n\n\n<div id=\"buildconf\">\n <p class=\"summary\">Build Conference</p>\n <p class=\"location adr\">\n <span class=\"locality\">Redmond</span>, \n <span class=\"region\">Washington</span>, \n <span class=\"country-name\">USA</span>\n </p>\n</div>";
- var expected = {"items":[{"type":["h-event"],"properties":{"start":["2012-10-30 11:45:00-08:00"],"name":["Build Conference"],"location":[{"value":"Redmond, \n Washington, \n USA","type":["h-adr"],"properties":{"locality":["Redmond"],"region":["Washington"],"country-name":["USA"]}}]}},{"type":["h-event"],"properties":{"start":["2012-10-31 11:15:00-08:00"],"name":["Build Conference"],"location":[{"value":"Redmond, \n Washington, \n USA","type":["h-adr"],"properties":{"locality":["Redmond"],"region":["Washington"],"country-name":["USA"]}}]}},{"type":["h-adr"],"properties":{"locality":["Redmond"],"region":["Washington"],"country-name":["USA"]}}],"rels":{},"rel-urls":{}};
-
- it('object', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-table.js b/toolkit/components/microformats/test/standards-tests/mf-v1-includes-table.js
deleted file mode 100644
index a0d3ef55c..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v1-includes-table.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v1/includes/table
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('includes', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<table>\n <tr>\n <th id=\"org\"><a class=\"url org\" href=\"http://dev.opera.com/\">Opera</a></th>\n </tr>\n <tr>\n <td class=\"vcard\" headers=\"org\"><span class=\"fn\">Chris Mills</span></td>\n </tr>\n <tr>\n <td class=\"vcard\" headers=\"org\"><span class=\"fn\">Erik Möller</span></td>\n </tr>\n </table>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["Chris Mills"],"url":["http://dev.opera.com/"],"org":["Opera"]}},{"type":["h-card"],"properties":{"name":["Erik Möller"],"url":["http://dev.opera.com/"],"org":["Opera"]}}],"rels":{},"rel-urls":{}};
-
- it('table', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geo.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geo.js
deleted file mode 100644
index 8ed7d747d..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geo.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-adr/geo
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-adr', function() {
- var htmlFragment = "<p class=\"h-adr\">\n <span class=\"p-name\">Bricklayer's Arms</span>\n <span class=\"p-label\"> \n <span class=\"p-street-address\">3 Charlotte Road</span>, \n <span class=\"p-locality\">City of London</span>, \n <span class=\"p-postal-code\">EC2A 3PE</span>, \n <span class=\"p-country-name\">UK</span> \n </span> – \n Geo:(<span class=\"p-geo\">51.526421;-0.081067</span>) \n</p>";
- var expected = {"items":[{"type":["h-adr"],"properties":{"name":["Bricklayer's Arms"],"label":["3 Charlotte Road, \n City of London, \n EC2A 3PE, \n UK"],"street-address":["3 Charlotte Road"],"locality":["City of London"],"postal-code":["EC2A 3PE"],"country-name":["UK"],"geo":["51.526421;-0.081067"]}}],"rels":{},"rel-urls":{}};
-
- it('geo', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geourl.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geourl.js
deleted file mode 100644
index b97e76f60..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-geourl.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-adr/geourl
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-adr', function() {
- var htmlFragment = "<p class=\"h-adr\">\n <a class=\"p-name u-geo\" href=\"geo:51.526421;-0.081067;crs=wgs84;u=40\">Bricklayer's Arms</a>, \n <span class=\"p-locality\">London</span> \n</p>";
- var expected = {"items":[{"type":["h-adr"],"properties":{"name":["Bricklayer's Arms"],"geo":["geo:51.526421;-0.081067;crs=wgs84;u=40"],"locality":["London"],"url":["geo:51.526421;-0.081067;crs=wgs84;u=40"]}}],"rels":{},"rel-urls":{}};
-
- it('geourl', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-justaname.js
deleted file mode 100644
index c943fbafc..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-justaname.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-adr/justaname
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-adr', function() {
- var htmlFragment = "<p class=\"h-adr\">665 3rd St. Suite 207 San Francisco, CA 94107 U.S.A.</p>";
- var expected = {"items":[{"type":["h-adr"],"properties":{"name":["665 3rd St. Suite 207 San Francisco, CA 94107 U.S.A."]}}],"rels":{},"rel-urls":{}};
-
- it('justaname', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-simpleproperties.js
deleted file mode 100644
index 084dac440..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-adr-simpleproperties.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-adr/simpleproperties
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-adr', function() {
- var htmlFragment = "<p class=\"h-adr\">\n <span class=\"p-street-address\">665 3rd St.</span> \n <span class=\"p-extended-address\">Suite 207</span> \n <span class=\"p-locality\">San Francisco</span>, \n <span class=\"p-region\">CA</span> \n <span class=\"p-postal-code\">94107</span> \n <span class=\"p-country-name\">U.S.A.</span> \n</p>";
- var expected = {"items":[{"type":["h-adr"],"properties":{"street-address":["665 3rd St."],"extended-address":["Suite 207"],"locality":["San Francisco"],"region":["CA"],"postal-code":["94107"],"country-name":["U.S.A."],"name":["665 3rd St. \n Suite 207 \n San Francisco, \n CA \n 94107 \n U.S.A."]}}],"rels":{},"rel-urls":{}};
-
- it('simpleproperties', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js
deleted file mode 100644
index 7e0ac260c..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-as-note-note.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-as-note/note
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-as-note', function() {
- var htmlFragment = "<!-- http://tantek.com/2015/152/t2/proud-withknown-indieweb-user-empathy -->\n<base href=\"http://tantek.com/\" />\n\n<li class=\"h-entry hentry h-as-note\">\n <div>\n <ul>\n <li>\n <a href=\"152/t1/congrats-fellow-elected-w3cab-members\" id=\"previtem\" title=\"View the previous (older) item in the stream.\"\n rel=\"prev\"><abbr title=\"Previous\">â†</abbr></a>\n </li>\n <li>\n <a href=\"152/t3/going-indiewebcamp-2015-portland\" id=\"nextitem\" title=\"View the next (newer) item in the stream\" rel=\"next\"><abbr title=\"Next\">→</abbr></a>\n </li>\n </ul>\n </div>\n <div>In reply to:\n <p>\n <a class=\"u-in-reply-to h-cite\" rel=\"in-reply-to\" href=\"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far\">http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far</a>\n </p>\n <p>\n <a class=\"u-in-reply-to h-cite\" rel=\"in-reply-to\" href=\"https://twitter.com/benwerd/status/604733231284383744\">https://twitter.com/benwerd/status/604733231284383744</a>\n </p>\n <hr>\n </div>\n <a href=\"../\" class=\"p-author h-card\" rel=\"author\" title=\"Tantek Çelik\"><img src=\"/images/photo.gif\" alt=\"Tantek Çelik\"></a>\n <p class=\"p-name entry-title e-content entry-content article\">\n <a class=\"auto-link h-x-username\" href=\"https://twitter.com/benwerd\">@benwerd</a>\n <a class=\"auto-link h-x-username\" href=\"https://twitter.com/erinjo\">@erinjo</a>also proud of you &amp;\n <a class=\"auto-link h-x-username\" href=\"https://twitter.com/withknown\">@withknown</a>— so much #indieweb &amp; especially user empathy. Keep up the great work!</p>\n <span>\n <span class=\"dt-published published dt-updated updated\">\n <time class=\"value\" datetime=\"22:20-0700\">22:20</time>on\n <time class=\"value\">2015-06-01</time>\n </span>\n <span class=\"lt\">(ttk.me t4bT2)</span>using\n <span class=\"using\">BBEdit</span>\n </span>\n <div>\n <form action=\"http://tantek.com/2015/152/t2/proud-withknown-indieweb-user-empathy\">\n <div>\n <label>\n <span class=\"lt\">URL:</span>\n <input class=\"u-url url u-uid uid bookmark\" type=\"url\" size=\"70\" style=\"max-width:100%\" value=\"http://tantek.com/2015/152/t2/proud-withknown-indieweb-user-empathy\">\n </label>\n </div>\n </form>\n </div>\n <div>\n <a class=\"u-syndication\" rel=\"syndication\" style=\"float:right;\" href=\"https://twitter.com/t/status/605604965566906369\">\n <img src=\"/images/photo.gif\" style=\"vertical-align:-30%\" alt=\"\"> \n View \n Conversation\n on Twitter\n</a>\n </div>\n</li>";
- var expected = {"items":[{"type":["h-entry","h-as-note"],"properties":{"in-reply-to":[{"value":"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far","type":["h-cite"],"properties":{"name":["http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far"],"url":["http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far"]}},{"value":"https://twitter.com/benwerd/status/604733231284383744","type":["h-cite"],"properties":{"name":["https://twitter.com/benwerd/status/604733231284383744"],"url":["https://twitter.com/benwerd/status/604733231284383744"]}}],"author":[{"type":["h-card"],"properties":{"name":["Tantek Çelik"],"photo":["http://tantek.com/images/photo.gif"],"url":["http://tantek.com/"]}}],"name":["@benwerd\n @erinjoalso proud of you &\n @withknown— so much #indieweb & especially user empathy. Keep up the great work!"],"content":[{"value":"@benwerd\n @erinjoalso proud of you &\n @withknown— so much #indieweb & especially user empathy. Keep up the great work!","html":"\n <a class=\"auto-link h-x-username\" href=\"https://twitter.com/benwerd\">@benwerd</a>\n <a class=\"auto-link h-x-username\" href=\"https://twitter.com/erinjo\">@erinjo</a>also proud of you &\n <a class=\"auto-link h-x-username\" href=\"https://twitter.com/withknown\">@withknown</a>— so much #indieweb & especially user empathy. Keep up the great work!"}],"published":["2015-06-01 22:20-07:00"],"updated":["2015-06-01 22:20-07:00"],"url":["http://tantek.com/2015/152/t2/proud-withknown-indieweb-user-empathy"],"uid":["http://tantek.com/2015/152/t2/proud-withknown-indieweb-user-empathy"],"syndication":["https://twitter.com/t/status/605604965566906369"]},"children":[{"value":"@benwerd","type":["h-x-username"],"properties":{"name":["@benwerd"],"url":["https://twitter.com/benwerd"]}},{"value":"@erinjo","type":["h-x-username"],"properties":{"name":["@erinjo"],"url":["https://twitter.com/erinjo"]}},{"value":"@withknown","type":["h-x-username"],"properties":{"name":["@withknown"],"url":["https://twitter.com/withknown"]}}]}],"rels":{"prev":["http://tantek.com/152/t1/congrats-fellow-elected-w3cab-members"],"next":["http://tantek.com/152/t3/going-indiewebcamp-2015-portland"],"in-reply-to":["http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far","https://twitter.com/benwerd/status/604733231284383744"],"author":["http://tantek.com/"],"syndication":["https://twitter.com/t/status/605604965566906369"]},"rel-urls":{"http://tantek.com/152/t1/congrats-fellow-elected-w3cab-members":{"title":"View the previous (older) item in the stream.","text":"â†","rels":["prev"]},"http://tantek.com/152/t3/going-indiewebcamp-2015-portland":{"title":"View the next (newer) item in the stream","text":"→","rels":["next"]},"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far":{"text":"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far","rels":["in-reply-to"]},"https://twitter.com/benwerd/status/604733231284383744":{"text":"https://twitter.com/benwerd/status/604733231284383744","rels":["in-reply-to"]},"http://tantek.com/":{"title":"Tantek Çelik","rels":["author"]},"https://twitter.com/t/status/605604965566906369":{"text":"View \n Conversation\n on Twitter","rels":["syndication"]}}};
-
- it('note', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-baseurl.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-baseurl.js
deleted file mode 100644
index d098db392..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-baseurl.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/baseurl
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<base href=\"http://example.org\"/>\n<div class=\"h-card\">\n <a class=\"p-name u-url\" href=\"http://blog.lizardwrangler.com/\">Mitchell Baker</a> \n (<a class=\"p-org h-card\" href=\"bios/mitchell-baker/\">Mozilla Foundation</a>)\n <img class=\"u-photo\" src=\"images/photo.gif\"/>\n</div>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["Mitchell Baker"],"url":["http://blog.lizardwrangler.com/"],"org":[{"value":"Mozilla Foundation","type":["h-card"],"properties":{"name":["Mozilla Foundation"],"url":["http://example.org/bios/mitchell-baker/"]}}],"photo":["http://example.org/images/photo.gif"]}}],"rels":{},"rel-urls":{}};
-
- it('baseurl', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-childimplied.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-childimplied.js
deleted file mode 100644
index 3ab1fa8ca..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-childimplied.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/childimplied
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<a class=\"h-card\" href=\"http://people.opera.com/howcome/\" title=\"HÃ¥kon Wium Lie, CTO Opera\">\n <article>\n <h2 class=\"p-name\">HÃ¥kon Wium Lie</h2>\n <img src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/9/96/H%C3%A5kon-Wium-Lie-2009-03.jpg/215px-H%C3%A5kon-Wium-Lie-2009-03.jpg\" />\n </article>\n</a>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["HÃ¥kon Wium Lie"],"photo":["http://upload.wikimedia.org/wikipedia/commons/thumb/9/96/H%C3%A5kon-Wium-Lie-2009-03.jpg/215px-H%C3%A5kon-Wium-Lie-2009-03.jpg"],"url":["http://people.opera.com/howcome/"]}}],"rels":{},"rel-urls":{}};
-
- it('childimplied', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-extendeddescription.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-extendeddescription.js
deleted file mode 100644
index 8ee35b022..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-extendeddescription.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/extendeddescription
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<div class=\"h-card\">\n <img class=\"u-photo\" alt=\"photo of Mitchell\" src=\"http://blog.mozilla.org/press/files/2012/04/mitchell-baker.jpg\" />\n <p>\n <a class=\"p-name u-url\" href=\"http://blog.lizardwrangler.com/\">Mitchell Baker</a>\n (<a class=\"u-url\" href=\"https://twitter.com/MitchellBaker\">@MitchellBaker</a>)\n <span class=\"p-org\">Mozilla Foundation</span>\n </p>\n <p class=\"p-note\">Mitchell is responsible for setting the direction and scope of the Mozilla Foundation and its activities.</p>\n <p><span class=\"p-category\">Strategy</span> and <span class=\"p-category\">Leadership</span></p>\n</div>";
- var expected = {"items":[{"type":["h-card"],"properties":{"photo":["http://blog.mozilla.org/press/files/2012/04/mitchell-baker.jpg"],"url":["http://blog.lizardwrangler.com/","https://twitter.com/MitchellBaker"],"name":["Mitchell Baker"],"org":["Mozilla Foundation"],"note":["Mitchell is responsible for setting the direction and scope of the Mozilla Foundation and its activities."],"category":["Strategy","Leadership"]}}],"rels":{},"rel-urls":{}};
-
- it('extendeddescription', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hcard.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hcard.js
deleted file mode 100644
index 961381610..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hcard.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/hcard
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<div class=\"h-card\">\n <a class=\"p-name u-url\" href=\"http://blog.lizardwrangler.com/\">Mitchell Baker</a> \n (<a class=\"p-org h-card\" href=\"http://mozilla.org/\">Mozilla Foundation</a>)\n</div>";
- var expected = {"items":[{"type":["h-card"],"properties":{"url":["http://blog.lizardwrangler.com/"],"name":["Mitchell Baker"],"org":[{"value":"Mozilla Foundation","type":["h-card"],"properties":{"name":["Mozilla Foundation"],"url":["http://mozilla.org/"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('hcard', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-horghcard.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-horghcard.js
deleted file mode 100644
index bc6329ae6..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-horghcard.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/horghcard
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<div class=\"h-card\">\n <a class=\"p-name u-url\" href=\"http://blog.lizardwrangler.com/\">Mitchell Baker</a> \n (<a class=\"p-org h-card h-org\" href=\"http://mozilla.org/\">Mozilla Foundation</a>)\n</div>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["Mitchell Baker"],"url":["http://blog.lizardwrangler.com/"],"org":[{"value":"Mozilla Foundation","type":["h-card","h-org"],"properties":{"name":["Mozilla Foundation"],"url":["http://mozilla.org/"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('horghcard', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hyperlinkedphoto.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hyperlinkedphoto.js
deleted file mode 100644
index 70febcb84..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-hyperlinkedphoto.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/hyperlinkedphoto
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<a class=\"h-card\" href=\"http://rohit.khare.org/\">\n <img alt=\"Rohit Khare\" src=\"images/photo.gif\" />\n </a>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["Rohit Khare"],"photo":["http://example.com/images/photo.gif"],"url":["http://rohit.khare.org/"]}}],"rels":{},"rel-urls":{}};
-
- it('hyperlinkedphoto', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedname.js
deleted file mode 100644
index bcf45aecb..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedname.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/impliedname
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "\n<img class=\"h-card\" src=\"jane.html\" alt=\"Jane Doe\"/>\n<area class=\"h-card\" href=\"jane.html\" alt=\"Jane Doe\"></area>\n<abbr class=\"h-card\" title=\"Jane Doe\">JD</abbr>\n\n<div class=\"h-card\"><img src=\"jane.html\" alt=\"Jane Doe\"/></div>\n<div class=\"h-card\"><area href=\"jane.html\" alt=\"Jane Doe\"></area></div>\n<div class=\"h-card\"><abbr title=\"Jane Doe\">JD</abbr></div>\n\n<div class=\"h-card\"><span><img src=\"jane.html\" alt=\"Jane Doe\"/></span></div>\n<div class=\"h-card\"><span><area href=\"jane.html\" alt=\"Jane Doe\"></area></span></div>\n<div class=\"h-card\"><span><abbr title=\"Jane Doe\">JD</abbr></span></div>\n\n<div class=\"h-card\"><img class=\"h-card\" src=\"john.html\" alt=\"John Doe\"/>Name</div>\n<div class=\"h-card\"><span class=\"h-card\"><img src=\"john.html\" alt=\"John Doe\"/>Name</span></div>\n";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"]}},{"type":["h-card"],"properties":{"name":["Name"]},"children":[{"type":["h-card"],"properties":{"name":["John Doe"],"photo":["http://example.com/john.html"]}}]},{"type":["h-card"],"properties":{"name":["Name"]},"children":[{"value":"Name","type":["h-card"],"properties":{"name":["John Doe"],"photo":["http://example.com/john.html"]}}]}],"rels":{},"rel-urls":{}};
-
- it('impliedname', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedphoto.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedphoto.js
deleted file mode 100644
index 3248a1d0f..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedphoto.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/impliedphoto
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<img class=\"h-card\" alt=\"Jane Doe\" src=\"jane.jpeg\"/>\n<object class=\"h-card\" data=\"jane.jpeg\"/>Jane Doe</object>\n\n<div class=\"h-card\"><img alt=\"Jane Doe\" src=\"jane.jpeg\"/></div> \n<div class=\"h-card\"><object data=\"jane.jpeg\"/>Jane Doe</object></div> \n\n<div class=\"h-card\"><span><img alt=\"Jane Doe\" src=\"jane.jpeg\"/></span></div> \n<div class=\"h-card\"><span><object data=\"jane.jpeg\"/>Jane Doe</object></span></div> \n\n<div class=\"h-card\"><img class=\"h-card\" alt=\"Jane Doe\" src=\"jane.jpeg\"/>Jane Doe</div> \n<div class=\"h-card\"><span class=\"h-card\"><object data=\"jane.jpeg\"/>Jane Doe</object></span></div> ";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"]},"children":[{"type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}}]},{"type":["h-card"],"properties":{"name":["Jane Doe"]},"children":[{"value":"Jane Doe","type":["h-card"],"properties":{"name":["Jane Doe"],"photo":["http://example.com/jane.jpeg"]}}]}],"rels":{},"rel-urls":{}};
-
- it('impliedphoto', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedurl.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedurl.js
deleted file mode 100644
index 4034194ce..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-impliedurl.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/impliedurl
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<a class=\"h-card\" href=\"jane.html\">Jane Doe</a>\n<area class=\"h-card\" href=\"jane.html\" alt=\"Jane Doe\"/ >\n<div class=\"h-card\" ><a href=\"jane.html\">Jane Doe</a><p></p></div> \n<div class=\"h-card\" ><area href=\"jane.html\">Jane Doe</area><p></p></div>\n<div class=\"h-card\" ><a class=\"h-card\" href=\"jane.html\">Jane Doe</a><p></p></div> ";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}},{"type":["h-card"],"properties":{"name":["Jane Doe"]},"children":[{"value":"Jane Doe","type":["h-card"],"properties":{"name":["Jane Doe"],"url":["http://example.com/jane.html"]}}]}],"rels":{},"rel-urls":{}};
-
- it('impliedurl', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justahyperlink.js
deleted file mode 100644
index 5911cc00f..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justahyperlink.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/justahyperlink
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<a class=\"h-card\" href=\"http://benward.me/\">Ben Ward</a>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["Ben Ward"],"url":["http://benward.me/"]}}],"rels":{},"rel-urls":{}};
-
- it('justahyperlink', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justaname.js
deleted file mode 100644
index 4f239fab5..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-justaname.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/justaname
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<p class=\"h-card\">Frances Berriman</p>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["Frances Berriman"]}}],"rels":{},"rel-urls":{}};
-
- it('justaname', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-nested.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-nested.js
deleted file mode 100644
index da2336e29..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-nested.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/nested
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<div class=\"h-card\">\n <a class=\"p-name u-url\" href=\"http://blog.lizardwrangler.com/\">Mitchell Baker</a> \n (<a class=\"h-org h-card\" href=\"http://mozilla.org/\">Mozilla Foundation</a>)\n</div>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["Mitchell Baker"],"url":["http://blog.lizardwrangler.com/"]},"children":[{"value":"Mozilla Foundation","type":["h-org","h-card"],"properties":{"name":["Mozilla Foundation"],"url":["http://mozilla.org/"]}}]}],"rels":{},"rel-urls":{}};
-
- it('nested', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-p-property.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-p-property.js
deleted file mode 100644
index 0a365e34b..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-p-property.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/p-property
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<div class=\"h-card\">\n \n <span class=\"p-name\">\n <span class=\"p-given-name value\">John</span> \n <abbr class=\"p-additional-name\" title=\"Peter\">P</abbr> \n <span class=\"p-family-name value \">Doe</span> \n </span>\n <data class=\"p-honorific-suffix\" value=\"MSc\"></data>\n \n \n <br class=\"p-honorific-suffix\" />BSc<br />\n <hr class=\"p-honorific-suffix\" />BA\n \n \n <img class=\"p-honorific-suffix\" src=\"images/logo.gif\" alt=\"PHD\" />\n <img src=\"images/logo.gif\" alt=\"company logos\" usemap=\"#logomap\" />\n <map name=\"logomap\">\n <area class=\"p-org\" shape=\"rect\" coords=\"0,0,82,126\" href=\"madgex.htm\" alt=\"Madgex\" />\n <area class=\"p-org\" shape=\"circle\" coords=\"90,58,3\" href=\"mozilla.htm\" alt=\"Mozilla\" />\n </map>\n</div>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["John Doe"],"given-name":["John"],"additional-name":["Peter"],"family-name":["Doe"],"honorific-suffix":["MSc","PHD"],"org":["Madgex","Mozilla"]}}],"rels":{},"rel-urls":{}};
-
- it('p-property', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-relativeurls.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-relativeurls.js
deleted file mode 100644
index 712a8cf72..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-card-relativeurls.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-card/relativeurls
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-card', function() {
- var htmlFragment = "<base href=\"http://example.com\" >\n<div class=\"h-card\">\n <a class=\"p-name u-url\" href=\"http://blog.lizardwrangler.com/\">Mitchell Baker</a> \n (<a class=\"p-org h-card\" href=\"bios/mitchell-baker/\">Mozilla Foundation</a>)\n <img class=\"u-photo\" src=\"bios/mitchell-baker/picture.jpeg\"/>\n</div>";
- var expected = {"items":[{"type":["h-card"],"properties":{"name":["Mitchell Baker"],"url":["http://blog.lizardwrangler.com/"],"org":[{"value":"Mozilla Foundation","type":["h-card"],"properties":{"name":["Mozilla Foundation"],"url":["http://example.com/bios/mitchell-baker/"]}}],"photo":["http://example.com/bios/mitchell-baker/picture.jpeg"]}}],"rels":{},"rel-urls":{}};
-
- it('relativeurls', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-impliedvalue-nested.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-impliedvalue-nested.js
deleted file mode 100644
index e729b48b0..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-impliedvalue-nested.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-entry/impliedvalue-nested
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-entry', function() {
- var htmlFragment = "<div class=\"h-entry\">\n <div class=\"u-in-reply-to h-cite\">\n <span class=\"p-author h-card\">\n <span class=\"p-name\">Example Author</span>\n <a class=\"u-url\" href=\"http://example.com\">Home</a>\n </span>\n <a class=\"p-name u-url\" href=\"http://example.com/post\">Example Post</a>\n </div>\n</div>";
- var expected = {"items":[{"type":["h-entry"],"properties":{"in-reply-to":[{"type":["h-cite"],"properties":{"name":["Example Post"],"url":["http://example.com/post"],"author":[{"type":["h-card"],"properties":{"url":["http://example.com"],"name":["Example Author"]},"value":"Example Author"}]},"value":"http://example.com/post"}],"name":["Example Author\n Home\n \n Example Post"]}}],"rels":{},"rel-urls":{}};
-
- it('impliedvalue-nested', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justahyperlink.js
deleted file mode 100644
index 1e793e727..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justahyperlink.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-entry/justahyperlink
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-entry', function() {
- var htmlFragment = "<a class=\"h-entry\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a>";
- var expected = {"items":[{"type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"]}}],"rels":{},"rel-urls":{}};
-
- it('justahyperlink', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justaname.js
deleted file mode 100644
index f4d31bf87..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-justaname.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-entry/justaname
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-entry', function() {
- var htmlFragment = "<p class=\"h-entry\">microformats.org at 7</p>";
- var expected = {"items":[{"type":["h-entry"],"properties":{"name":["microformats.org at 7"]}}],"rels":{},"rel-urls":{}};
-
- it('justaname', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-summarycontent.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-summarycontent.js
deleted file mode 100644
index b697f6c7c..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-summarycontent.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-entry/summarycontent
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-entry', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<div class=\"h-entry\">\n <h1><a class=\"p-name u-url\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n <div class=\"e-content\">\n <p class=\"p-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n </div> \n <p>Updated \n <time class=\"dt-updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time> by\n <a class=\"p-author h-card\" href=\"http://tantek.com/\">Tantek</a>\n </p>\n</div>";
- var expected = {"items":[{"type":["h-entry"],"properties":{"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"name":["microformats.org at 7"],"content":[{"value":"Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second†\n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service","html":"\n <p class=\"p-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n "}],"summary":["Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities."],"updated":["2012-06-25 17:08:26"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('summarycontent', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-u-property.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-u-property.js
deleted file mode 100644
index 510f0aa90..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-u-property.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-entry/u-property
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-entry', function() {
- var htmlFragment = "<base href=\"http://example.com\">\n<div class=\"h-entry\">\n <p class=\"p-name\">microformats.org at 7</p>\n\n \n <p class=\"u-url\">\n <span class=\"value-title\" title=\"http://microformats.org/\"> </span>\n Article permalink\n </p>\n <p class=\"u-url\">\n <span class=\"value\">http://microformats.org/</span> - \n <span class=\"value\">2012/06/25/microformats-org-at-7</span> \n </p> \n\n <p><a class=\"u-url\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">Article permalink</a></p>\n\n <img src=\"images/logo.gif\" alt=\"company logos\" usemap=\"#logomap\" />\n <map name=\"logomap\">\n <area class=\"u-url\" shape=\"rect\" coords=\"0,0,82,126\" href=\"http://microformats.org/\" alt=\"microformats.org\" />\n </map>\n\n <img class=\"u-photo\" src=\"images/logo.gif\" alt=\"company logos\" />\n\n <object class=\"u-url\" data=\"http://microformats.org/wiki/microformats2-parsing\"></object>\n\n <abbr class=\"u-url\" title=\"http://microformats.org/wiki/value-class-pattern\">value-class-pattern</abbr> \n <data class=\"u-url\" value=\"http://microformats.org/wiki/\"></data>\n <p class=\"u-url\">http://microformats.org/discuss</p>\n</div>";
- var expected = {"items":[{"type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/","http://microformats.org/2012/06/25/microformats-org-at-7","http://microformats.org/2012/06/25/microformats-org-at-7","http://microformats.org/","http://microformats.org/wiki/microformats2-parsing","http://microformats.org/wiki/value-class-pattern","http://microformats.org/wiki/","http://microformats.org/discuss"],"photo":["http://example.com/images/logo.gif"]}}],"rels":{},"rel-urls":{}};
-
- it('u-property', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-urlincontent.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-urlincontent.js
deleted file mode 100644
index 295ac9925..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-entry-urlincontent.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-entry/urlincontent
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-entry', function() {
- var htmlFragment = "<div class=\"h-entry\">\n <h1><a class=\"p-name\">Expanding URLs within HTML content</a></h1>\n <div class=\"e-content\">\n <ul>\n <li><a href=\"http://www.w3.org/\">Should not change: http://www.w3.org/</a></li>\n <li><a href=\"http://example.com/\">Should not change: http://example.com/</a></li>\n <li><a href=\"test.html\">File relative: test.html = http://example.com/test.html</a></li>\n <li><a href=\"/test/test.html\">Directory relative: /test/test.html = http://example.com/test/test.html</a></li>\n <li><a href=\"/test.html\">Relative to root: /test.html = http://example.com/test.html</a></li>\n </ul>\n <img src=\"images/photo.gif\" />\n </div> \n</div>";
- var expected = {"items":[{"type":["h-entry"],"properties":{"name":["Expanding URLs within HTML content"],"content":[{"value":"Should not change: http://www.w3.org/\n Should not change: http://example.com/\n File relative: test.html = http://example.com/test.html\n Directory relative: /test/test.html = http://example.com/test/test.html\n Relative to root: /test.html = http://example.com/test.html","html":"\n <ul>\n <li><a href=\"http://www.w3.org/\">Should not change: http://www.w3.org/</a></li>\n <li><a href=\"http://example.com/\">Should not change: http://example.com/</a></li>\n <li><a href=\"http://example.com/test.html\">File relative: test.html = http://example.com/test.html</a></li>\n <li><a href=\"http://example.com/test/test.html\">Directory relative: /test/test.html = http://example.com/test/test.html</a></li>\n <li><a href=\"http://example.com/test.html\">Relative to root: /test.html = http://example.com/test.html</a></li>\n </ul>\n <img src=\"http://example.com/images/photo.gif\" />\n "}]}}],"rels":{},"rel-urls":{}};
-
- it('urlincontent', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-ampm.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-ampm.js
deleted file mode 100644
index 814c3c42e..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-ampm.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-event/ampm
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-event', function() {
- var htmlFragment = "<span class=\"h-event\">\n <span class=\"p-name\">The 4th Microformat party</span> will be on \n <ul>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00:00pm \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00:00am \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00pm \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07pm \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">7pm \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">7:00pm \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00p.m. \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00PM \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">7:00am \n </span></li>\n </ul>\n</span>";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00:00","2009-06-26 07:00:00","2009-06-26 19:00","2009-06-26 19","2009-06-26 19","2009-06-26 19:00","2009-06-26 19:00","2009-06-26 19:00","2009-06-26 07:00"]}}],"rels":{},"rel-urls":{}};
-
- it('ampm', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-attendees.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-attendees.js
deleted file mode 100644
index 2315dbe91..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-attendees.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-event/attendees
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-event', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<div class=\"h-event\">\n <span class=\"p-name\">CPJ Online Press Freedom Summit</span>\n (<time class=\"dt-start\" datetime=\"2012-10-10\">10 Nov 2012</time>) in\n <span class=\"p-location\">San Francisco</span>.\n Attendees:\n <ul>\n <li class=\"p-attendee h-card\">Brian Warner</li>\n <li class=\"p-attendee h-card\">Kyle Machulis</li>\n <li class=\"p-attendee h-card\">Tantek Çelik</li>\n <li class=\"p-attendee h-card\">Sid Sutter</li>\n </ul>\n</div>\n";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["CPJ Online Press Freedom Summit"],"start":["2012-10-10"],"location":["San Francisco"],"attendee":[{"value":"Brian Warner","type":["h-card"],"properties":{"name":["Brian Warner"]}},{"value":"Kyle Machulis","type":["h-card"],"properties":{"name":["Kyle Machulis"]}},{"value":"Tantek Çelik","type":["h-card"],"properties":{"name":["Tantek Çelik"]}},{"value":"Sid Sutter","type":["h-card"],"properties":{"name":["Sid Sutter"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('attendees', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-combining.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-combining.js
deleted file mode 100644
index e91b381ba..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-combining.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-event/combining
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-event', function() {
- var htmlFragment = "<div class=\"h-event\">\n <a class=\"p-name u-url\" href=\"http://indiewebcamp.com/2012\">\n IndieWebCamp 2012\n </a>\n from <time class=\"dt-start\">2012-06-30</time> \n to <time class=\"dt-end\">2012-07-01</time> at \n <span class=\"p-location h-card\">\n <a class=\"p-name p-org u-url\" href=\"http://geoloqi.com/\">Geoloqi</a>, \n <span class=\"p-street-address\">920 SW 3rd Ave. Suite 400</span>, \n <span class=\"p-locality\">Portland</span>, \n <abbr class=\"p-region\" title=\"Oregon\">OR</abbr>\n </span>\n</div>";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["IndieWebCamp 2012"],"url":["http://indiewebcamp.com/2012"],"start":["2012-06-30"],"end":["2012-07-01"],"location":[{"value":"Geoloqi","type":["h-card"],"properties":{"name":["Geoloqi"],"org":["Geoloqi"],"url":["http://geoloqi.com/"],"street-address":["920 SW 3rd Ave. Suite 400"],"locality":["Portland"],"region":["Oregon"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('combining', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-concatenate.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-concatenate.js
deleted file mode 100644
index 897210674..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-concatenate.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-event/concatenate
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-event', function() {
- var htmlFragment = "<span class=\"h-event\">\n <span class=\"p-name\">The 4th Microformat party</span> will be on \n <span class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00</time></span> to \n <span class=\"dt-end\"><time class=\"value\">22:00</time></span>.\n</span>";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00"],"end":["2009-06-26 22:00"]}}],"rels":{},"rel-urls":{}};
-
- it('concatenate', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dates.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dates.js
deleted file mode 100644
index c26b5bccc..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dates.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-event/dates
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-event', function() {
- var htmlFragment = "<section class=\"h-event\">\n\t<p><span class=\"p-name\">The 4th Microformat party</span> will be on:</p>\n\t<ul>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26T19:00-08:00\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26T19:00-08\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26T19:00-0800\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26T19:00+0800\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26T19:00+08:00\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26T19:00Z\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26t19:00-08:00\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26 19:00:00-08:00\">26 July</time></li>\n\t</ul>\n</section>";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00-08:00","2009-06-26 19:00-08","2009-06-26 19:00-08:00","2009-06-26 19:00+08:00","2009-06-26 19:00+08:00","2009-06-26 19:00Z","2009-06-26 19:00-08:00","2009-06-26 19:00:00-08:00"]}}],"rels":{},"rel-urls":{}};
-
- it('dates', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dt-property.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dt-property.js
deleted file mode 100644
index eb97beccb..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-dt-property.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-event/dt-property
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-event', function() {
- var htmlFragment = "<span class=\"h-event\">\n <span class=\"p-name\">The party</span> will be on \n \n <p class=\"dt-start\">\n <span class=\"value-title\" title=\"2013-03-14\"> </span>\n March 14th 2013\n </p>\n <p class=\"dt-start\">\n <time class=\"value\" datetime=\"2013-06-25\">25 July</time>, from\n <span class=\"value\">07:00:00am \n </span></p> \n \n <p>\n <time class=\"dt-start\" datetime=\"2013-06-26\">26 June</time>\n \n <ins class=\"dt-start\" datetime=\"2013-06-27\">Just added</ins>, \n <del class=\"dt-start\" datetime=\"2013-06-28\">Removed</del>\n </p>\n <abbr class=\"dt-start\" title=\"2013-06-29\">June 29</abbr> \n <data class=\"dt-start\" value=\"2013-07-01\"></data>\n <p class=\"dt-start\">2013-07-02</p>\n \n</span>";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["The party"],"start":["2013-03-14","2013-06-25 07:00:00","2013-06-26","2013-06-27","2013-06-28","2013-06-29","2013-07-01","2013-07-02"]}}],"rels":{},"rel-urls":{}};
-
- it('dt-property', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justahyperlink.js
deleted file mode 100644
index 26c835863..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justahyperlink.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-event/justahyperlink
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-event', function() {
- var htmlFragment = "<a class=\"h-event\" href=\"http://indiewebcamp.com/2012\">IndieWebCamp 2012</a>";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["IndieWebCamp 2012"],"url":["http://indiewebcamp.com/2012"]}}],"rels":{},"rel-urls":{}};
-
- it('justahyperlink', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justaname.js
deleted file mode 100644
index be3a5335d..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-justaname.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-event/justaname
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-event', function() {
- var htmlFragment = "<p class=\"h-event\">IndieWebCamp 2012</p>";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["IndieWebCamp 2012"]}}],"rels":{},"rel-urls":{}};
-
- it('justaname', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-time.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-time.js
deleted file mode 100644
index 243b518bf..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-event-time.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-event/time
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-event', function() {
- var htmlFragment = "<span class=\"h-event\">\n <span class=\"p-name\">The 4th Microformat party</span> will be on \n <ul>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00-08:00</time> \n </li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00-0800</time> \n </li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00+0800</time> \n </li> \n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00Z</time> \n </li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00</time> \n </li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00-08:00</time> \n </li> \n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00+08:00</time> \n </li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00Z</time> \n </li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00</time> \n </li> \n <li>\n <time class=\"dt-end\" datetime=\"2013-034\">3 February 2013</time>\n </li>\n <li>\n <time class=\"dt-end\" datetime=\"2013-06-27 15:34\">26 July 2013</time>\n </li> \n </ul>\n</span>";
- var expected = {"items":[{"type":["h-event"],"properties":{"name":["The 4th Microformat party"],"start":["2009-06-26 19:00:00-08:00","2009-06-26 19:00:00-08:00","2009-06-26 19:00:00+08:00","2009-06-26 19:00:00Z","2009-06-26 19:00:00","2009-06-26 19:00-08:00","2009-06-26 19:00+08:00","2009-06-26 19:00Z","2009-06-26 19:00"],"end":["2013-034","2013-06-27 15:34"]}}],"rels":{},"rel-urls":{}};
-
- it('time', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-implied-title.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-implied-title.js
deleted file mode 100644
index 30bbf52df..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-implied-title.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-feed/implied-title
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-feed', function() {
- var htmlFragment = "\n<html>\n\t<head>\n\t\t<title>microformats blog</title>\n\t</head>\n\t<body>\n\t<section class=\"h-feed\">\n\t\t\n\t\t<div class=\"h-entry\">\n\t\t <h1><a class=\"p-name u-url\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n\t\t <div class=\"e-content\">\n\t\t <p class=\"p-summary\">Last week the microformats.org community \n\t\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t\t San Francisco and recognized accomplishments, challenges, and \n\t\t opportunities.</p>\n\t\t\n\t\t <p>The microformats tagline “humans first, machines second†\n\t\t forms the basis of many of our \n\t\t <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n\t\t in that regard, we’d like to recognize a few people and \n\t\t thank them for their years of volunteer service </p>\n\t\t </div> \n\t\t <p>Updated \n\t\t <time class=\"dt-updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time>\n\t\t </p>\n\t\t</div>\n\t\t\n\t</section>\n\t</body>\n</html>";
- var expected = {"items":[{"type":["h-feed"],"properties":{"name":["microformats blog"]},"children":[{"value":"microformats.org at 7\n\t\t \n\t\t Last week the microformats.org community \n\t\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t\t San Francisco and recognized accomplishments, challenges, and \n\t\t opportunities.\n\t\t\n\t\t The microformats tagline “humans first, machines second†\n\t\t forms the basis of many of our \n\t\t principles, and \n\t\t in that regard, we’d like to recognize a few people and \n\t\t thank them for their years of volunteer service \n\t\t \n\t\t Updated \n\t\t June 25th, 2012","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n\t\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t\t San Francisco and recognized accomplishments, challenges, and \n\t\t opportunities.\n\t\t\n\t\t The microformats tagline “humans first, machines second†\n\t\t forms the basis of many of our \n\t\t principles, and \n\t\t in that regard, we’d like to recognize a few people and \n\t\t thank them for their years of volunteer service","html":"\n\t\t <p class=\"p-summary\">Last week the microformats.org community \n\t\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t\t San Francisco and recognized accomplishments, challenges, and \n\t\t opportunities.</p>\n\t\t\n\t\t <p>The microformats tagline “humans first, machines second†\n\t\t forms the basis of many of our \n\t\t <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n\t\t in that regard, we’d like to recognize a few people and \n\t\t thank them for their years of volunteer service </p>\n\t\t "}],"summary":["Last week the microformats.org community \n\t\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t\t San Francisco and recognized accomplishments, challenges, and \n\t\t opportunities."],"updated":["2012-06-25 17:08:26"]}}]}],"rels":{},"rel-urls":{}};
-
- it('implied-title', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-simple.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-simple.js
deleted file mode 100644
index c72b24140..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-feed-simple.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-feed/simple
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-feed', function() {
- var htmlFragment = "<section class=\"h-feed\">\n\t<h1 class=\"p-name\">Microformats blog</h1>\n\t<a class=\"p-author h-card\" href=\"http://tantek.com/\">Tantek</a>\n\t<a class=\"u-url\" href=\"http://microformats.org/blog\">permlink</a>\n\t<img class=\"u-photo\" src=\"photo.jpeg\"/>\n\t\n\t<div class=\"h-entry\">\n\t <h1><a class=\"p-name u-url\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n\t <div class=\"e-content\">\n\t <p class=\"p-summary\">Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.</p>\n\t\n\t <p>The microformats tagline “humans first, machines second†\n\t forms the basis of many of our \n\t <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service </p>\n\t </div> \n\t <p>Updated \n\t <time class=\"dt-updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time>\n\t </p>\n\t</div>\n\t\n</section>";
- var expected = {"items":[{"type":["h-feed"],"properties":{"name":["Microformats blog"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}],"url":["http://microformats.org/blog"],"photo":["http://example.com/photo.jpeg"]},"children":[{"value":"microformats.org at 7\n\t \n\t Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.\n\t\n\t The microformats tagline “humans first, machines second†\n\t forms the basis of many of our \n\t principles, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service \n\t \n\t Updated \n\t June 25th, 2012","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.\n\t\n\t The microformats tagline “humans first, machines second†\n\t forms the basis of many of our \n\t principles, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service","html":"\n\t <p class=\"p-summary\">Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.</p>\n\t\n\t <p>The microformats tagline “humans first, machines second†\n\t forms the basis of many of our \n\t <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service </p>\n\t "}],"summary":["Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities."],"updated":["2012-06-25 17:08:26"]}}]}],"rels":{},"rel-urls":{}};
-
- it('simple', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-abbrpattern.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-abbrpattern.js
deleted file mode 100644
index d26e9ed0d..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-abbrpattern.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-geo/abbrpattern
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-geo', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<p class=\"h-geo\">\n <abbr class=\"p-latitude\" title=\"37.408183\">N 37° 24.491</abbr>, \n <abbr class=\"p-longitude\" title=\"-122.13855\">W 122° 08.313</abbr>\n</p>";
- var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["37.408183"],"longitude":["-122.13855"],"name":["N 37° 24.491, \n W 122° 08.313"]}}],"rels":{},"rel-urls":{}};
-
- it('abbrpattern', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-altitude.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-altitude.js
deleted file mode 100644
index 45da683ff..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-altitude.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-geo/altitude
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-geo', function() {
- var htmlFragment = "<p>My favourite hill in the lakes is \n <span class=\"h-geo\">\n <span class=\"p-name\">Pen-y-ghent</span> \n (Geo: <span class=\"p-latitude\">54.155278</span>,\n <span class=\"p-longitude\">-2.249722</span>). It\n raises to <span class=\"p-altitude\">694</span>m.\n </span>\n</p>";
- var expected = {"items":[{"type":["h-geo"],"properties":{"name":["Pen-y-ghent"],"latitude":["54.155278"],"longitude":["-2.249722"],"altitude":["694"]}}],"rels":{},"rel-urls":{}};
-
- it('altitude', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-hidden.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-hidden.js
deleted file mode 100644
index 968ed1285..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-hidden.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-geo/hidden
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-geo', function() {
- var htmlFragment = "<p>\n <span class=\"h-geo\">The Bricklayer's Arms\n <span class=\"p-latitude\">\n <span class=\"value-title\" title=\"51.513458\"> </span> \n </span>\n <span class=\"p-longitude\">\n <span class=\"value-title\" title=\"-0.14812\"> </span>\n </span>\n </span>\n</p>";
- var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["51.513458"],"longitude":["-0.14812"],"name":["The Bricklayer's Arms"]}}],"rels":{},"rel-urls":{}};
-
- it('hidden', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-justaname.js
deleted file mode 100644
index 23c142462..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-justaname.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-geo/justaname
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-geo', function() {
- var htmlFragment = "<p>On my way to The Bricklayer's Arms\n (Geo: <span class=\"h-geo\">51.513458;-0.14812</span>)\n</p>";
- var expected = {"items":[{"type":["h-geo"],"properties":{"name":["51.513458;-0.14812"]}}],"rels":{},"rel-urls":{}};
-
- it('justaname', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-simpleproperties.js
deleted file mode 100644
index e9700a3e2..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-simpleproperties.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-geo/simpleproperties
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-geo', function() {
- var htmlFragment = "<p class=\"h-geo\">We are meeting at \n <span class=\"p-name\">The Bricklayer's Arms</span>\n (Geo: <span class=\"p-latitude\">51.513458</span>:\n <span class=\"p-longitude\">-0.14812</span>)\n</p>";
- var expected = {"items":[{"type":["h-geo"],"properties":{"name":["The Bricklayer's Arms"],"latitude":["51.513458"],"longitude":["-0.14812"]}}],"rels":{},"rel-urls":{}};
-
- it('simpleproperties', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-valuetitleclass.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-valuetitleclass.js
deleted file mode 100644
index 813d21592..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-geo-valuetitleclass.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-geo/valuetitleclass
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-geo', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<p>\n <span class=\"h-geo\">\n <span class=\"p-latitude\">\n <span class=\"value-title\" title=\"51.513458\">N 51° 51.345</span>, \n </span>\n <span class=\"p-longitude\">\n <span class=\"value-title\" title=\"-0.14812\">W -0° 14.812</span>\n </span>\n </span>\n</p>";
- var expected = {"items":[{"type":["h-geo"],"properties":{"latitude":["51.513458"],"longitude":["-0.14812"],"name":["N 51° 51.345, \n \n \n W -0° 14.812"]}}],"rels":{},"rel-urls":{}};
-
- it('valuetitleclass', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-all.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-all.js
deleted file mode 100644
index a7deb3f2f..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-all.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-news/all
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-news', function() {
- var htmlFragment = "<div class=\"h-news\">\n <div class=\"p-entry h-entry\">\n <h1><a class=\"p-name u-url\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n <div class=\"e-content\">\n <p class=\"p-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n </div> \n <p>Updated \n <time class=\"dt-updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time> by\n <a class=\"p-author h-card\" href=\"http://tantek.com/\">Tantek</a>\n </p>\n </div>\n\n <p>\n <span class=\"p-dateline h-adr\">\n <span class=\"p-locality\">San Francisco</span>, \n <span class=\"p-region\">CA</span> \n </span>\n (Geo: <span class=\"p-geo\">37.774921;-122.445202</span>) \n <span class=\"p-source-org h-card\">\n <a class=\"p-name u-url\" href=\"http://microformats.org/\">microformats.org</a>\n </span>\n </p>\n <p>\n <a class=\"u-principles\" href=\"http://microformats.org/wiki/Category:public_domain_license\">Publishing policy</a>\n </p>\n</div>";
- var expected = {"items":[{"type":["h-news"],"properties":{"entry":[{"value":"microformats.org at 7","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second†\n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service","html":"\n <p class=\"p-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n "}],"summary":["Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities."],"updated":["2012-06-25 17:08:26"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}]}}],"dateline":[{"value":"San Francisco, \n CA","type":["h-adr"],"properties":{"locality":["San Francisco"],"region":["CA"],"name":["San Francisco, \n CA"]}}],"geo":["37.774921;-122.445202"],"source-org":[{"value":"microformats.org","type":["h-card"],"properties":{"name":["microformats.org"],"url":["http://microformats.org/"]}}],"principles":["http://microformats.org/wiki/Category:public_domain_license"],"name":["microformats.org at 7\n \n Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second†\n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service \n \n Updated \n June 25th, 2012 by\n Tantek\n \n \n\n \n \n San Francisco, \n CA \n \n (Geo: 37.774921;-122.445202) \n \n microformats.org\n \n \n \n Publishing policy"]}}],"rels":{},"rel-urls":{}};
-
- it('all', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-minimum.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-minimum.js
deleted file mode 100644
index 4494cb8ab..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-news-minimum.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-news/minimum
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-news', function() {
- var htmlFragment = "<div class=\"h-news\">\n <div class=\"p-entry h-entry\">\n <h1><a class=\"p-name u-url\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n <div class=\"e-content\">\n <p class=\"p-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n </div> \n <p>Updated \n <time class=\"dt-updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time> by\n <a class=\"p-author h-card\" href=\"http://tantek.com/\">Tantek</a>\n </p>\n </div>\n <p>\n <a class=\"p-source-org h-card\" href=\"http://microformats.org/\">microformats.org</a> \n </p>\n</div>";
- var expected = {"items":[{"type":["h-news"],"properties":{"entry":[{"value":"microformats.org at 7","type":["h-entry"],"properties":{"name":["microformats.org at 7"],"url":["http://microformats.org/2012/06/25/microformats-org-at-7"],"content":[{"value":"Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second†\n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service","html":"\n <p class=\"p-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n "}],"summary":["Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities."],"updated":["2012-06-25 17:08:26"],"author":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"],"url":["http://tantek.com/"]}}]}}],"source-org":[{"value":"microformats.org","type":["h-card"],"properties":{"name":["microformats.org"],"url":["http://microformats.org/"]}}],"name":["microformats.org at 7\n \n Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.\n\n The microformats tagline “humans first, machines second†\n forms the basis of many of our \n principles, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service \n \n Updated \n June 25th, 2012 by\n Tantek\n \n \n \n microformats.org"]}}],"rels":{},"rel-urls":{}};
-
- it('minimum', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-hyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-hyperlink.js
deleted file mode 100644
index b7150aae4..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-hyperlink.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-org/hyperlink
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-org', function() {
- var htmlFragment = "<a class=\"h-org\" href=\"http://mozilla.org/\">Mozilla Foundation</a>";
- var expected = {"items":[{"type":["h-org"],"properties":{"name":["Mozilla Foundation"],"url":["http://mozilla.org/"]}}],"rels":{},"rel-urls":{}};
-
- it('hyperlink', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simple.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simple.js
deleted file mode 100644
index 4f5a75e88..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simple.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-org/simple
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-org', function() {
- var htmlFragment = "<span class=\"h-org\">Mozilla Foundation</span>";
- var expected = {"items":[{"type":["h-org"],"properties":{"name":["Mozilla Foundation"]}}],"rels":{},"rel-urls":{}};
-
- it('simple', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simpleproperties.js
deleted file mode 100644
index 5c7e939e6..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-org-simpleproperties.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-org/simpleproperties
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-org', function() {
- var htmlFragment = "<p class=\"h-org\">\n <span class=\"p-organization-name\">W3C</span> - \n <span class=\"p-organization-unit\">CSS Working Group</span>\n</p>";
- var expected = {"items":[{"type":["h-org"],"properties":{"organization-name":["W3C"],"organization-unit":["CSS Working Group"],"name":["W3C - \n CSS Working Group"]}}],"rels":{},"rel-urls":{}};
-
- it('simpleproperties', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-aggregate.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-aggregate.js
deleted file mode 100644
index b07d3f547..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-aggregate.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-product/aggregate
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-product', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<div class=\"h-product\">\n <h2 class=\"p-name\">Raspberry Pi</h2>\n <img class=\"u-photo\" src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg\" />\n <p class=\"e-description\">The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.</p>\n <a class=\"u-url\" href=\"http://www.raspberrypi.org/\">More info about the Raspberry Pi</a>\n <p class=\"p-price\">£29.95</p>\n <p class=\"p-review h-review-aggregate\">\n <span class=\"p-rating h-rating\">\n <span class=\"p-average\">9.2</span> out of \n <span class=\"p-best\">10</span> \n based on <span class=\"p-count\">178</span> reviews\n </span>\n </p>\n <p>Categories: <span class=\"p-category\">Computer</span>, <span class=\"p-category\">Education</span></p>\n <p class=\"p-brand h-card\">From: \n <span class=\"p-name p-org\">The Raspberry Pi Foundation</span> - \n <span class=\"p-locality\">Cambridge</span> \n <span class=\"p-country-name\">UK</span>\n </p>\n</div>";
- var expected = {"items":[{"type":["h-product"],"properties":{"name":["Raspberry Pi"],"photo":["http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg"],"description":[{"value":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.","html":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming."}],"url":["http://www.raspberrypi.org/"],"price":["£29.95"],"review":[{"value":"9.2 out of \n 10 \n based on 178 reviews","type":["h-review-aggregate"],"properties":{"rating":[{"value":"9.2 out of \n 10 \n based on 178 reviews","type":["h-rating"],"properties":{"average":["9.2"],"best":["10"],"count":["178"],"name":["9.2 out of \n 10 \n based on 178 reviews"]}}],"name":["9.2 out of \n 10 \n based on 178 reviews"]}}],"category":["Computer","Education"],"brand":[{"value":"The Raspberry Pi Foundation","type":["h-card"],"properties":{"name":["The Raspberry Pi Foundation"],"org":["The Raspberry Pi Foundation"],"locality":["Cambridge"],"country-name":["UK"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('aggregate', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justahyperlink.js
deleted file mode 100644
index cf2638e31..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justahyperlink.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-product/justahyperlink
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-product', function() {
- var htmlFragment = "<a class=\"h-product\" href=\"http://www.raspberrypi.org/\">Raspberry Pi</a>";
- var expected = {"items":[{"type":["h-product"],"properties":{"name":["Raspberry Pi"],"url":["http://www.raspberrypi.org/"]}}],"rels":{},"rel-urls":{}};
-
- it('justahyperlink', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justaname.js
deleted file mode 100644
index f946a10e0..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-justaname.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-product/justaname
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-product', function() {
- var htmlFragment = "<p class=\"h-product\">Raspberry Pi</p>";
- var expected = {"items":[{"type":["h-product"],"properties":{"name":["Raspberry Pi"]}}],"rels":{},"rel-urls":{}};
-
- it('justaname', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-simpleproperties.js
deleted file mode 100644
index 1c5467d51..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-product-simpleproperties.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-product/simpleproperties
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-product', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<div class=\"h-product\">\n <h2 class=\"p-name\">Raspberry Pi</h2>\n <img class=\"u-photo\" src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg\" />\n <p class=\"e-description\">The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.</p>\n <a class=\"u-url\" href=\"http://www.raspberrypi.org/\">More info about the Raspberry Pi</a>\n <p class=\"p-price\">£29.95</p>\n <p class=\"p-review h-review\"><span class=\"p-rating\">4.5</span> out of 5</p>\n <p>Categories: <span class=\"p-category\">Computer</span>, <span class=\"p-category\">Education</span></p>\n</div>";
- var expected = {"items":[{"type":["h-product"],"properties":{"name":["Raspberry Pi"],"photo":["http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg"],"description":[{"value":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.","html":"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming."}],"url":["http://www.raspberrypi.org/"],"price":["£29.95"],"category":["Computer","Education"],"review":[{"value":"4.5 out of 5","type":["h-review"],"properties":{"rating":["4.5"],"name":["4.5 out of 5"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('simpleproperties', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-all.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-all.js
deleted file mode 100644
index fa0e4cb37..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-all.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-recipe/all
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-recipe', function() {
- var htmlFragment = "<section class=\"h-recipe\">\n <h1 class=\"p-name\">Yorkshire Puddings</h1> \n <p class=\"p-summary\">Makes <span class=\"p-yield\">6 good sized Yorkshire puddings</span>, the way my mum taught me</p>\n\n\n <p><img class=\"u-photo\" src=\"http://codebits.glennjones.net/semantic/yorkshire-puddings.jpg\" /></p>\n\n <span class=\"p-review h-review-aggregate\">\n <span class=\"p-rating\">\n <span class=\"p-average\">4.5</span> stars out 5 based on </span>\n <span class=\"p-count\">35</span> reviews</span>\n \n \n\n <div id=\"ingredients-container\">\n <h3>Ingredients</h3>\n <ul>\n <li class=\"e-ingredient\">1 egg</li>\n <li class=\"e-ingredient\">75g plain flour</li>\n <li class=\"e-ingredient\">70ml milk</li>\n <li class=\"e-ingredient\">60ml water</li>\n <li class=\"e-ingredient\">Pinch of salt</li>\n </ul>\n </div>\n\n <h3>Time</h3>\n <ul>\n <li class=\"prepTime\">Preparation <span class=\"value-title\" title=\"PT0H10M\">10 mins</span></li>\n <li class=\"cookTime\">Cook <span class=\"value-title\" title=\"PT0H25M\">25 mins</span></li>\n </ul> \n\n\n <h3>Instructions</h3>\n <div class=\"e-instructions\">\n <ol>\n <li>Pre-heat oven to 230C or gas mark 8. Pour the vegetable oil evenly into 2 x 4-hole \n Yorkshire pudding tins and place in the oven to heat through.</li> \n \n <li>To make the batter, add all the flour into a bowl and beat in the eggs until smooth. \n Gradually add the milk and water while beating the mixture. It should be smooth and \n without lumps. Finally add a pinch of salt.</li>\n \n <li>Make sure the oil is piping hot before pouring the batter evenly into the tins. \n Place in the oven for 20-25 minutes until pudding have risen and look golden brown</li>\n </ol>\n </div>\n\n <h3>Nutrition</h3>\n <ul id=\"nutrition-list\">\n <li class=\"p-nutrition\">Calories: <span class=\"calories\">125</span></li>\n <li class=\"p-nutrition\">Fat: <span class=\"fat\">3.2g</span></li>\n <li class=\"p-nutrition\">Cholesterol: <span class=\"cholesterol\">77mg</span></li>\n </ul>\n <p>(Amount per pudding)</p>\n\n <p>\n Published on <time class=\"dt-published\" datetime=\"2011-10-27\">27 Oct 2011</time> by \n <span class=\"p-author h-card\">\n <a class=\"p-name u-url\" href=\"http://glennjones.net\">Glenn Jones</a>\n </span>\n </p>\n <a href=\"http://www.flickr.com/photos/dithie/4106528495/\">Photo by dithie</a>\n </section>";
- var expected = {"items":[{"type":["h-recipe"],"properties":{"name":["Yorkshire Puddings"],"summary":["Makes 6 good sized Yorkshire puddings, the way my mum taught me"],"yield":["6 good sized Yorkshire puddings"],"photo":["http://codebits.glennjones.net/semantic/yorkshire-puddings.jpg"],"review":[{"value":"4.5 stars out 5 based on \n 35 reviews","type":["h-review-aggregate"],"properties":{"rating":["4.5 stars out 5 based on"],"average":["4.5"],"count":["35"],"name":["4.5 stars out 5 based on \n 35 reviews"]}}],"ingredient":[{"value":"1 egg","html":"1 egg"},{"value":"75g plain flour","html":"75g plain flour"},{"value":"70ml milk","html":"70ml milk"},{"value":"60ml water","html":"60ml water"},{"value":"Pinch of salt","html":"Pinch of salt"}],"instructions":[{"value":"Pre-heat oven to 230C or gas mark 8. Pour the vegetable oil evenly into 2 x 4-hole \n Yorkshire pudding tins and place in the oven to heat through. \n \n To make the batter, add all the flour into a bowl and beat in the eggs until smooth. \n Gradually add the milk and water while beating the mixture. It should be smooth and \n without lumps. Finally add a pinch of salt.\n \n Make sure the oil is piping hot before pouring the batter evenly into the tins. \n Place in the oven for 20-25 minutes until pudding have risen and look golden brown","html":"\n <ol>\n <li>Pre-heat oven to 230C or gas mark 8. Pour the vegetable oil evenly into 2 x 4-hole \n Yorkshire pudding tins and place in the oven to heat through.</li> \n \n <li>To make the batter, add all the flour into a bowl and beat in the eggs until smooth. \n Gradually add the milk and water while beating the mixture. It should be smooth and \n without lumps. Finally add a pinch of salt.</li>\n \n <li>Make sure the oil is piping hot before pouring the batter evenly into the tins. \n Place in the oven for 20-25 minutes until pudding have risen and look golden brown</li>\n </ol>\n "}],"nutrition":["Calories: 125","Fat: 3.2g","Cholesterol: 77mg"],"published":["2011-10-27"],"author":[{"value":"Glenn Jones","type":["h-card"],"properties":{"name":["Glenn Jones"],"url":["http://glennjones.net"]}}],"url":["http://www.flickr.com/photos/dithie/4106528495/"]}}],"rels":{},"rel-urls":{}};
-
- it('all', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-minimum.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-minimum.js
deleted file mode 100644
index ac3d91dc7..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-recipe-minimum.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-recipe/minimum
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-recipe', function() {
- var htmlFragment = "<div class=\"h-recipe\"> \n <p class=\"p-name\">Toast</p>\n <ul>\n <li class=\"e-ingredient\">Slice of bread</li>\n <li class=\"e-ingredient\">Butter</li>\n </ul>\n</div>";
- var expected = {"items":[{"type":["h-recipe"],"properties":{"name":["Toast"],"ingredient":[{"value":"Slice of bread","html":"Slice of bread"},{"value":"Butter","html":"Butter"}]}}],"rels":{},"rel-urls":{}};
-
- it('minimum', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-affiliation.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-affiliation.js
deleted file mode 100644
index 73329d46c..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-affiliation.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-resume/affiliation
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-resume', function() {
- var htmlFragment = "<div class=\"h-resume\">\n <p>\n <span class=\"p-name\">Tim Berners-Lee</span>, \n <span class=\"p-summary\">invented the World Wide Web</span>. \n </p> \n Belongs to following groups:\n <p> \n <a class=\"p-affiliation h-card\" href=\"http://www.w3.org/\">\n <img class=\"p-name u-photo\" alt=\"W3C\" src=\"http://www.w3.org/Icons/WWW/w3c_home_nb.png\" />\n </a>\n </p> \n</div>";
- var expected = {"items":[{"type":["h-resume"],"properties":{"name":["Tim Berners-Lee"],"summary":["invented the World Wide Web"],"affiliation":[{"type":["h-card"],"properties":{"name":["W3C"],"photo":["http://www.w3.org/Icons/WWW/w3c_home_nb.png"],"url":["http://www.w3.org/"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('affiliation', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-contact.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-contact.js
deleted file mode 100644
index f2a1f76f7..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-contact.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-resume/contact
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-resume', function() {
- var htmlFragment = "<div class=\"h-resume\">\n <p class=\"p-name\">Tim Berners-Lee</p>\n <p class=\"p-summary\">Invented the World Wide Web.</p><hr />\n <div class=\"p-contact h-card\">\n <p class=\"p-name\">MIT</p>\n <p>\n <span class=\"p-street-address\">32 Vassar Street</span>, \n <span class=\"p-extended-address\">Room 32-G524</span>, \n <span class=\"p-locality\">Cambridge</span>, \n <span class=\"p-region\">MA</span> \n <span class=\"p-postal-code\">02139</span>, \n <span class=\"p-country-name\">USA</span>.\n </p>\n <p>Tel:<span class=\"p-tel\">+1 (617) 253 5702</span></p>\n <p>Email:<a class=\"u-email\" href=\"mailto:timbl@w3.org\">timbl@w3.org</a></p>\n </div>\n</div>";
- var expected = {"items":[{"type":["h-resume"],"properties":{"name":["Tim Berners-Lee"],"summary":["Invented the World Wide Web."],"contact":[{"value":"MIT","type":["h-card"],"properties":{"name":["MIT"],"street-address":["32 Vassar Street"],"extended-address":["Room 32-G524"],"locality":["Cambridge"],"region":["MA"],"postal-code":["02139"],"country-name":["USA"],"tel":["+1 (617) 253 5702"],"email":["mailto:timbl@w3.org"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('contact', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-education.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-education.js
deleted file mode 100644
index 5e3838434..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-education.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-resume/education
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-resume', function() {
- var htmlFragment = "<div class=\"h-resume\">\n <p class=\"p-name\">Tim Berners-Lee</p>\n <div class=\"p-contact h-card\">\n <p class=\"p-title\">Director of the World Wide Web Foundation</p>\n </div>\n <p class=\"p-summary\">Invented the World Wide Web.</p><hr />\n <p class=\"p-education h-event h-card\">\n <span class=\"p-name p-org\">The Queen's College, Oxford University</span>, \n <span class=\"p-description\">BA Hons (I) Physics</span> \n <time class=\"dt-start\" datetime=\"1973-09\">1973</time> –\n <time class=\"dt-end\" datetime=\"1976-06\">1976</time>\n </p>\n</div>";
- var expected = {"items":[{"type":["h-resume"],"properties":{"name":["Tim Berners-Lee"],"contact":[{"value":"Director of the World Wide Web Foundation","type":["h-card"],"properties":{"title":["Director of the World Wide Web Foundation"],"name":["Director of the World Wide Web Foundation"]}}],"summary":["Invented the World Wide Web."],"education":[{"value":"The Queen's College, Oxford University","type":["h-event","h-card"],"properties":{"name":["The Queen's College, Oxford University"],"org":["The Queen's College, Oxford University"],"description":["BA Hons (I) Physics"],"start":["1973-09"],"end":["1976-06"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('education', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-justaname.js
deleted file mode 100644
index 2357bf1a2..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-justaname.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-resume/justaname
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-resume', function() {
- var htmlFragment = "<p class=\"h-resume\">Tim Berners-Lee, invented the World Wide Web.</p>";
- var expected = {"items":[{"type":["h-resume"],"properties":{"name":["Tim Berners-Lee, invented the World Wide Web."]}}],"rels":{},"rel-urls":{}};
-
- it('justaname', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-skill.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-skill.js
deleted file mode 100644
index 60a983e04..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-skill.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-resume/skill
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-resume', function() {
- var htmlFragment = "<div class=\"h-resume\">\n <p>\n <span class=\"p-name\">Tim Berners-Lee</span>, \n <span class=\"p-summary\">invented the World Wide Web</span>.\n </p>\n Skills: \n <ul>\n <li class=\"p-skill\">information systems</li>\n <li class=\"p-skill\">advocacy</li>\n <li class=\"p-skill\">leadership</li>\n <ul> \n</ul></ul></div>";
- var expected = {"items":[{"type":["h-resume"],"properties":{"name":["Tim Berners-Lee"],"summary":["invented the World Wide Web"],"skill":["information systems","advocacy","leadership"]}}],"rels":{},"rel-urls":{}};
-
- it('skill', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-work.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-work.js
deleted file mode 100644
index d61ea3de5..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-resume-work.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-resume/work
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-resume', function() {
- var htmlFragment = "<meta charset=\"utf-8\">\n<div class=\"h-resume\">\n <p class=\"p-name\">Tim Berners-Lee</p>\n <div class=\"p-contact h-card\">\n <p class=\"p-title\">Director of the World Wide Web Foundation</p>\n </div>\n <p class=\"p-summary\">Invented the World Wide Web.</p><hr />\n <div class=\"p-experience h-event h-card\">\n <p class=\"p-title\">Director</p>\n <p><a class=\"p-name p-org u-url\" href=\"http://www.webfoundation.org/\">World Wide Web Foundation</a></p>\n <p>\n <time class=\"dt-start\" datetime=\"2009-01-18\">Jan 2009</time> – Present\n <time class=\"dt-duration\" datetime=\"P2Y11M\">(2 years 11 month)</time>\n </p>\n </div>\n</div>";
- var expected = {"items":[{"type":["h-resume"],"properties":{"name":["Tim Berners-Lee"],"contact":[{"value":"Director of the World Wide Web Foundation","type":["h-card"],"properties":{"title":["Director of the World Wide Web Foundation"],"name":["Director of the World Wide Web Foundation"]}}],"summary":["Invented the World Wide Web."],"experience":[{"value":"World Wide Web Foundation","type":["h-event","h-card"],"properties":{"title":["Director"],"name":["World Wide Web Foundation"],"org":["World Wide Web Foundation"],"url":["http://www.webfoundation.org/"],"start":["2009-01-18"],"duration":["P2Y11M"]}}]}}],"rels":{},"rel-urls":{}};
-
- it('work', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-hevent.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-hevent.js
deleted file mode 100644
index e698ee37a..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-hevent.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-review-aggregate/hevent
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-review-aggregate', function() {
- var htmlFragment = "<div class=\"h-review-aggregate\">\n <div class=\"p-item h-event\">\n <h3 class=\"p-name\">Fullfrontal</h3>\n <p class=\"p-description\">A one day JavaScript Conference held in Brighton</p>\n <p><time class=\"dt-start\" datetime=\"2012-11-09\">9th November 2012</time></p> \n </div> \n \n <p class=\"p-rating\">\n <span class=\"p-average value\">9.9</span> out of \n <span class=\"p-best\">10</span> \n based on <span class=\"p-count\">62</span> reviews\n </p>\n</div>";
- var expected = {"items":[{"type":["h-review-aggregate"],"properties":{"item":[{"value":"Fullfrontal","type":["h-event"],"properties":{"name":["Fullfrontal"],"description":["A one day JavaScript Conference held in Brighton"],"start":["2012-11-09"]}}],"rating":["9.9"],"average":["9.9"],"best":["10"],"count":["62"],"name":["Fullfrontal\n A one day JavaScript Conference held in Brighton\n 9th November 2012 \n \n \n \n 9.9 out of \n 10 \n based on 62 reviews"]}}],"rels":{},"rel-urls":{}};
-
- it('hevent', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-justahyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-justahyperlink.js
deleted file mode 100644
index 729fdfb2d..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-justahyperlink.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-review-aggregate/justahyperlink
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-review-aggregate', function() {
- var htmlFragment = "<div class=\"h-review-aggregate\">\n <h3 class=\"p-item h-item\">Mediterranean Wraps</h3>\n <span class=\"p-summary\">\n Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff.\n </span>\n <span class=\"p-rating\">4.5</span> out of 5 \n</div>";
- var expected = {"items":[{"type":["h-review-aggregate"],"properties":{"item":[{"value":"Mediterranean Wraps","type":["h-item"],"properties":{"name":["Mediterranean Wraps"]}}],"summary":["Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff."],"rating":["4.5"],"name":["Mediterranean Wraps\n \n Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff.\n \n 4.5 out of 5"]}}],"rels":{},"rel-urls":{}};
-
- it('justahyperlink', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-simpleproperties.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-simpleproperties.js
deleted file mode 100644
index d49cabb5f..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-aggregate-simpleproperties.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-review-aggregate/simpleproperties
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-review-aggregate', function() {
- var htmlFragment = "<div class=\"h-review-aggregate\">\n <div class=\"p-item h-card\">\n <h3 class=\"p-name\">Mediterranean Wraps</h3>\n <p>\n <span class=\"p-street-address\">433 S California Ave</span>, \n <span class=\"p-locality\">Palo Alto</span>, \n <span class=\"p-region\">CA</span> - \n <span class=\"p-tel\">(650) 321-8189</span>\n </p>\n </div> \n <span class=\"p-summary\">Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff.</span>\n <span class=\"p-rating\">\n <span class=\"p-average value\">9.2</span> out of \n <span class=\"p-best\">10</span> \n based on <span class=\"p-count\">17</span> reviews\n </span>\n</div>";
- var expected = {"items":[{"type":["h-review-aggregate"],"properties":{"item":[{"value":"Mediterranean Wraps","type":["h-card"],"properties":{"name":["Mediterranean Wraps"],"street-address":["433 S California Ave"],"locality":["Palo Alto"],"region":["CA"],"tel":["(650) 321-8189"]}}],"summary":["Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff."],"rating":["9.2"],"average":["9.2"],"best":["10"],"count":["17"],"name":["Mediterranean Wraps\n \n 433 S California Ave, \n Palo Alto, \n CA - \n (650) 321-8189\n \n \n Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff.\n \n 9.2 out of \n 10 \n based on 17 reviews"]}}],"rels":{},"rel-urls":{}};
-
- it('simpleproperties', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-hyperlink.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-hyperlink.js
deleted file mode 100644
index 3f547d7a9..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-hyperlink.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-review/hyperlink
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-review', function() {
- var htmlFragment = "<a class=\"h-review\" href=\"https://plus.google.com/116941523817079328322/about\">Crepes on Cole</a>";
- var expected = {"items":[{"type":["h-review"],"properties":{"name":["Crepes on Cole"],"url":["https://plus.google.com/116941523817079328322/about"]}}],"rels":{},"rel-urls":{}};
-
- it('hyperlink', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-implieditem.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-implieditem.js
deleted file mode 100644
index ecde19277..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-implieditem.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-review/implieditem
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-review', function() {
- var htmlFragment = "<div class=\"h-review\">\n <a class=\"p-item h-item\" href=\"http://example.com/crepeoncole\">Crepes on Cole</a>\n <p><span class=\"p-rating\">4.7</span> out of 5 stars</p>\n</div>";
- var expected = {"items":[{"type":["h-review"],"properties":{"item":[{"value":"Crepes on Cole","type":["h-item"],"properties":{"name":["Crepes on Cole"],"url":["http://example.com/crepeoncole"]}}],"rating":["4.7"],"name":["Crepes on Cole\n 4.7 out of 5 stars"]}}],"rels":{},"rel-urls":{}};
-
- it('implieditem', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-item.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-item.js
deleted file mode 100644
index d8aef51c8..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-item.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-review/item
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-review', function() {
- var htmlFragment = "<base href=\"http://example.com\" >\n<div class=\"h-review\">\n <p class=\"p-item h-item\">\n <img class=\"u-photo\" src=\"images/photo.gif\" />\n <a class=\"p-name u-url\" href=\"http://example.com/crepeoncole\">Crepes on Cole</a>\n </p>\n <p><span class=\"p-rating\">5</span> out of 5 stars</p>\n</div>";
- var expected = {"items":[{"type":["h-review"],"properties":{"item":[{"value":"Crepes on Cole","type":["h-item"],"properties":{"photo":["http://example.com/images/photo.gif"],"name":["Crepes on Cole"],"url":["http://example.com/crepeoncole"]}}],"rating":["5"],"name":["Crepes on Cole\n \n 5 out of 5 stars"]}}],"rels":{},"rel-urls":{}};
-
- it('item', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-justaname.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-justaname.js
deleted file mode 100644
index 89523e909..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-justaname.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-review/justaname
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-review', function() {
- var htmlFragment = "<p class=\"h-review\">Crepes on Cole</p>";
- var expected = {"items":[{"type":["h-review"],"properties":{"name":["Crepes on Cole"]}}],"rels":{},"rel-urls":{}};
-
- it('justaname', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-photo.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-photo.js
deleted file mode 100644
index ee0c41fe6..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-photo.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-review/photo
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-review', function() {
- var htmlFragment = "<base href=\"http://example.com\" ><img class=\"h-review\" src=\"images/photo.gif\" alt=\"Crepes on Cole\" />";
- var expected = {"items":[{"type":["h-review"],"properties":{"name":["Crepes on Cole"],"photo":["http://example.com/images/photo.gif"]}}],"rels":{},"rel-urls":{}};
-
- it('photo', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-vcard.js b/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-vcard.js
deleted file mode 100644
index 8411c4d2a..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-h-review-vcard.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/h-review/vcard
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('h-review', function() {
- var htmlFragment = "<div class=\"h-review\">\n <span><span class=\"p-rating\">5</span> out of 5 stars</span>\n <h4 class=\"p-name\">Crepes on Cole is awesome</h4>\n <span class=\"p-reviewer h-card\">\n Reviewer: <span class=\"p-name\">Tantek</span> - \n </span>\n <time class=\"dt-reviewed\" datetime=\"2005-04-18\">April 18, 2005</time>\n <div class=\"e-description\">\n <p class=\"p-item h-card\">\n <span class=\"p-name p-org\">Crepes on Cole</span> is one of the best little \n creperies in <span class=\"p-adr h-adr\"><span class=\"p-locality\">San Francisco</span></span>.\n Excellent food and service. Plenty of tables in a variety of sizes \n for parties large and small. Window seating makes for excellent \n people watching to/from the N-Judah which stops right outside. \n I've had many fun social gatherings here, as well as gotten \n plenty of work done thanks to neighborhood WiFi.\n </p>\n </div>\n <p>Visit date: <span>April 2005</span></p>\n <p>Food eaten: <a class=\"p-category\" href=\"http://en.wikipedia.org/wiki/crepe\">crepe</a></p>\n <p>Permanent link for review: <a class=\"u-url\" href=\"http://example.com/crepe\">http://example.com/crepe</a></p>\n <p><a rel=\"license\" href=\"http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License\">Creative Commons Attribution-ShareAlike License</a></p>\n</div>";
- var expected = {"items":[{"type":["h-review"],"properties":{"rating":["5"],"name":["Crepes on Cole is awesome"],"reviewer":[{"value":"Tantek","type":["h-card"],"properties":{"name":["Tantek"]}}],"reviewed":["2005-04-18"],"description":[{"value":"Crepes on Cole is one of the best little \n creperies in San Francisco.\n Excellent food and service. Plenty of tables in a variety of sizes \n for parties large and small. Window seating makes for excellent \n people watching to/from the N-Judah which stops right outside. \n I've had many fun social gatherings here, as well as gotten \n plenty of work done thanks to neighborhood WiFi.","html":"\n <p class=\"p-item h-card\">\n <span class=\"p-name p-org\">Crepes on Cole</span> is one of the best little \n creperies in <span class=\"p-adr h-adr\"><span class=\"p-locality\">San Francisco</span></span>.\n Excellent food and service. Plenty of tables in a variety of sizes \n for parties large and small. Window seating makes for excellent \n people watching to/from the N-Judah which stops right outside. \n I've had many fun social gatherings here, as well as gotten \n plenty of work done thanks to neighborhood WiFi.\n </p>\n "}],"item":[{"value":"Crepes on Cole","type":["h-card"],"properties":{"name":["Crepes on Cole"],"org":["Crepes on Cole"],"adr":[{"value":"San Francisco","type":["h-adr"],"properties":{"locality":["San Francisco"],"name":["San Francisco"]}}]}}],"category":["crepe"],"url":["http://example.com/crepe"]}}],"rels":{"license":["http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License"]},"rel-urls":{"http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License":{"text":"Creative Commons Attribution-ShareAlike License","rels":["license"]}}};
-
- it('vcard', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-duplicate-rels.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-duplicate-rels.js
deleted file mode 100644
index d65dfdf8b..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-duplicate-rels.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/rel/duplicate-rels
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('rel', function() {
- var htmlFragment = "<a href=\"http://ma.tt/2015/05/beethoven-mozart-bach/\" \n title=\"Permalink to Beethoven, Mozart, Bach\" rel=\"bookmark\">\n<time class=\"entry-date\" datetime=\"2015-05-31T22:42:00+00:00\">May 31, 2015</time></a></span>\n<a href=\"http://ma.tt/category/asides/\" rel=\"category tag\">Asides</a>\n<span class=\"author vcard\">\n<a class=\"url fn n\" href=\"http://ma.tt/author/saxmatt/\" \n title=\"View all posts by Matt\" rel=\"author\">Matt</a></span>\n<span class=\"date\"><a href=\"http://ma.tt/2015/06/jefferson-on-idleness/\" title=\"Permalink to Jefferson on Idleness\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"2015-06-02T21:26:00+00:00\">June 2, 2015</time></a></span>\n<span class=\"categories-links\"><a href=\"http://ma.tt/category/asides/\" rel=\"category tag\">Asides</a></span>\n<span class=\"author vcard\"><a class=\"url fn n\" href=\"http://ma.tt/author/saxmatt/\" title=\"View all posts by Matt\" rel=\"author\">Matt</a></span>\n";
- var expected = {"rels":{"bookmark":["http://ma.tt/2015/05/beethoven-mozart-bach/","http://ma.tt/2015/06/jefferson-on-idleness/"],"category":["http://ma.tt/category/asides/"],"tag":["http://ma.tt/category/asides/"],"author":["http://ma.tt/author/saxmatt/"]},"items":[{"type":["h-card"],"properties":{"url":["http://ma.tt/author/saxmatt/"],"name":["Matt"]}},{"type":["h-card"],"properties":{"url":["http://ma.tt/author/saxmatt/"],"name":["Matt"]}}],"rel-urls":{"http://ma.tt/category/asides/":{"rels":["category","tag"],"text":"Asides"},"http://ma.tt/author/saxmatt/":{"rels":["author"],"text":"Matt","title":"View all posts by Matt"},"http://ma.tt/2015/05/beethoven-mozart-bach/":{"rels":["bookmark"],"text":"May 31, 2015","title":"Permalink to Beethoven, Mozart, Bach"},"http://ma.tt/2015/06/jefferson-on-idleness/":{"rels":["bookmark"],"text":"June 2, 2015","title":"Permalink to Jefferson on Idleness"}}};
-
- it('duplicate-rels', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-license.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-license.js
deleted file mode 100644
index d5606f5a3..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-license.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/rel/license
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('rel', function() {
- var htmlFragment = "<a rel=\"license\" href=\"http://creativecommons.org/licenses/by/2.5/\">cc by 2.5</a>";
- var expected = {"items":[],"rels":{"license":["http://creativecommons.org/licenses/by/2.5/"]},"rel-urls":{"http://creativecommons.org/licenses/by/2.5/":{"text":"cc by 2.5","rels":["license"]}}};
-
- it('license', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-nofollow.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-nofollow.js
deleted file mode 100644
index 4332d3572..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-nofollow.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/rel/nofollow
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('rel', function() {
- var htmlFragment = "<a rel=\"nofollow\" href=\"http://microformats.org/wiki/microformats:copyrights\">Copyrights</a>";
- var expected = {"items":[],"rels":{"nofollow":["http://microformats.org/wiki/microformats:copyrights"]},"rel-urls":{"http://microformats.org/wiki/microformats:copyrights":{"text":"Copyrights","rels":["nofollow"]}}};
-
- it('nofollow', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-rel-urls.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-rel-urls.js
deleted file mode 100644
index 685532f44..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-rel-urls.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/rel/rel-urls
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('rel', function() {
- var htmlFragment = "<a rel=\"author\" href=\"http://example.com/a\">author a</a>\n<a rel=\"author\" href=\"http://example.com/b\">author b</a>\n<a rel=\"in-reply-to\" href=\"http://example.com/1\">post 1</a>\n<a rel=\"in-reply-to\" href=\"http://example.com/2\">post 2</a>\n<a rel=\"alternate home\"\n href=\"http://example.com/fr\"\n media=\"handheld\"\n hreflang=\"fr\">French mobile homepage</a>";
- var expected = {"items":[],"rels":{"author":["http://example.com/a","http://example.com/b"],"in-reply-to":["http://example.com/1","http://example.com/2"],"home":["http://example.com/fr"],"alternate":["http://example.com/fr"]},"rel-urls":{"http://example.com/a":{"rels":["author"],"text":"author a"},"http://example.com/b":{"rels":["author"],"text":"author b"},"http://example.com/1":{"rels":["in-reply-to"],"text":"post 1"},"http://example.com/2":{"rels":["in-reply-to"],"text":"post 2"},"http://example.com/fr":{"rels":["alternate","home"],"media":"handheld","hreflang":"fr","text":"French mobile homepage"}}};
-
- it('rel-urls', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-varying-text-duplicate-rels.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-varying-text-duplicate-rels.js
deleted file mode 100644
index 3b1b72f44..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-varying-text-duplicate-rels.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/rel/varying-text-duplicate-rels
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('rel', function() {
- var htmlFragment = "This is a contrived example - not found links like this in the wild:\n<a href=\"http://ma.tt/category/asides/\" rel=\"category tag\">Asides</a>\n<a href=\"http://ma.tt/category/asides/\" rel=\"category tag\">B-sides</a>\n<a href=\"http://ma.tt/category/asides/\" rel=\"category tag\">seasides</a>";
- var expected = {"rels":{"category":["http://ma.tt/category/asides/"],"tag":["http://ma.tt/category/asides/"]},"items":[],"rel-urls":{"http://ma.tt/category/asides/":{"rels":["category","tag"],"text":"Asides"}}};
-
- it('varying-text-duplicate-rels', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-all.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-all.js
deleted file mode 100644
index 3850ad564..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-all.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/rel/xfn-all
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('rel', function() {
- var htmlFragment = "<ul>\n <li><a rel=\"friend\" href=\"http://example.com/profile/jane\">jane</a></li>\n <li><a rel=\"acquaintance\" href=\"http://example.com/profile/jeo\">jeo</a></li>\n <li><a rel=\"contact\" href=\"http://example.com/profile/lily\">lily</a></li>\n <li><a rel=\"met\" href=\"http://example.com/profile/oliver\">oliver</a></li>\n <li><a rel=\"co-worker\" href=\"http://example.com/profile/emily\">emily</a></li>\n <li><a rel=\"colleague\" href=\"http://example.com/profile/jack\">jack</a></li>\n <li><a rel=\"neighbor\" href=\"http://example.com/profile/isabella\">isabella</a></li>\n <li><a rel=\"child\" href=\"http://example.com/profile/harry\">harry</a></li>\n <li><a rel=\"parent\" href=\"http://example.com/profile/sophia\">sophia</a></li>\n <li><a rel=\"sibling\" href=\"http://example.com/profile/charlie\">charlie</a></li>\n <li><a rel=\"spouse\" href=\"http://example.com/profile/olivia\">olivia</a></li>\n <li><a rel=\"kin\" href=\"http://example.com/profile/james\">james</a></li>\n <li><a rel=\"muse\" href=\"http://example.com/profile/ava\">ava</a></li>\n <li><a rel=\"crush\" href=\"http://example.com/profile/joshua\">joshua</a></li>\n <li><a rel=\"date\" href=\"http://example.com/profile/chloe\">chloe</a></li>\n <li><a rel=\"sweetheart\" href=\"http://example.com/profile/alfie\">alfie</a></li>\n <li><a rel=\"me\" href=\"http://example.com/profile/isla\">isla</a></li>\n</ul>";
- var expected = {"items":[],"rels":{"friend":["http://example.com/profile/jane"],"acquaintance":["http://example.com/profile/jeo"],"contact":["http://example.com/profile/lily"],"met":["http://example.com/profile/oliver"],"co-worker":["http://example.com/profile/emily"],"colleague":["http://example.com/profile/jack"],"neighbor":["http://example.com/profile/isabella"],"child":["http://example.com/profile/harry"],"parent":["http://example.com/profile/sophia"],"sibling":["http://example.com/profile/charlie"],"spouse":["http://example.com/profile/olivia"],"kin":["http://example.com/profile/james"],"muse":["http://example.com/profile/ava"],"crush":["http://example.com/profile/joshua"],"date":["http://example.com/profile/chloe"],"sweetheart":["http://example.com/profile/alfie"],"me":["http://example.com/profile/isla"]},"rel-urls":{"http://example.com/profile/jane":{"text":"jane","rels":["friend"]},"http://example.com/profile/jeo":{"text":"jeo","rels":["acquaintance"]},"http://example.com/profile/lily":{"text":"lily","rels":["contact"]},"http://example.com/profile/oliver":{"text":"oliver","rels":["met"]},"http://example.com/profile/emily":{"text":"emily","rels":["co-worker"]},"http://example.com/profile/jack":{"text":"jack","rels":["colleague"]},"http://example.com/profile/isabella":{"text":"isabella","rels":["neighbor"]},"http://example.com/profile/harry":{"text":"harry","rels":["child"]},"http://example.com/profile/sophia":{"text":"sophia","rels":["parent"]},"http://example.com/profile/charlie":{"text":"charlie","rels":["sibling"]},"http://example.com/profile/olivia":{"text":"olivia","rels":["spouse"]},"http://example.com/profile/james":{"text":"james","rels":["kin"]},"http://example.com/profile/ava":{"text":"ava","rels":["muse"]},"http://example.com/profile/joshua":{"text":"joshua","rels":["crush"]},"http://example.com/profile/chloe":{"text":"chloe","rels":["date"]},"http://example.com/profile/alfie":{"text":"alfie","rels":["sweetheart"]},"http://example.com/profile/isla":{"text":"isla","rels":["me"]}}};
-
- it('xfn-all', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-elsewhere.js b/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-elsewhere.js
deleted file mode 100644
index d982af5cc..000000000
--- a/toolkit/components/microformats/test/standards-tests/mf-v2-rel-xfn-elsewhere.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-Microformats Test Suite - Downloaded from github repo: microformats/tests version v0.1.24
-Mocha integration test from: microformats-v2/rel/xfn-elsewhere
-The test was built on Fri Sep 25 2015 13:26:26 GMT+0100 (BST)
-*/
-
-assert = chai.assert;
-
-
-describe('rel', function() {
- var htmlFragment = "<ul>\n <li><a rel=\"me\" href=\"http://twitter.com/glennjones\">twitter</a></li>\n <li><a rel=\"me\" href=\"http://delicious.com/glennjonesnet/\">delicious</a></li>\n <li><a rel=\"me\" href=\"https://plus.google.com/u/0/105161464208920272734/about\">google+</a></li>\n <li><a rel=\"me\" href=\"http://lanyrd.com/people/glennjones/\">lanyrd</a></li>\n <li><a rel=\"me\" href=\"http://github.com/glennjones\">github</a></li>\n <li><a rel=\"me\" href=\"http://www.flickr.com/photos/glennjonesnet/\">flickr</a></li>\n <li><a rel=\"me\" href=\"http://www.linkedin.com/in/glennjones\">linkedin</a></li>\n <li><a rel=\"me\" href=\"http://www.slideshare.net/glennjones/presentations\">slideshare</a></li>\n</ul>";
- var expected = {"items":[],"rels":{"me":["http://twitter.com/glennjones","http://delicious.com/glennjonesnet/","https://plus.google.com/u/0/105161464208920272734/about","http://lanyrd.com/people/glennjones/","http://github.com/glennjones","http://www.flickr.com/photos/glennjonesnet/","http://www.linkedin.com/in/glennjones","http://www.slideshare.net/glennjones/presentations"]},"rel-urls":{"http://twitter.com/glennjones":{"text":"twitter","rels":["me"]},"http://delicious.com/glennjonesnet/":{"text":"delicious","rels":["me"]},"https://plus.google.com/u/0/105161464208920272734/about":{"text":"google+","rels":["me"]},"http://lanyrd.com/people/glennjones/":{"text":"lanyrd","rels":["me"]},"http://github.com/glennjones":{"text":"github","rels":["me"]},"http://www.flickr.com/photos/glennjonesnet/":{"text":"flickr","rels":["me"]},"http://www.linkedin.com/in/glennjones":{"text":"linkedin","rels":["me"]},"http://www.slideshare.net/glennjones/presentations":{"text":"slideshare","rels":["me"]}}};
-
- it('xfn-elsewhere', function(){
- var doc, dom, node, options, parser, found;
- dom = new DOMParser();
- doc = dom.parseFromString( htmlFragment, 'text/html' );
- options ={
- 'document': doc,
- 'node': doc,
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5'
- };
- found = Microformats.get( options );
- assert.deepEqual(found, expected);
- });
-});
diff --git a/toolkit/components/microformats/test/static/count.html b/toolkit/components/microformats/test/static/count.html
deleted file mode 100644
index c367b29ea..000000000
--- a/toolkit/components/microformats/test/static/count.html
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
-
- <meta charset="UTF-8">
- <title>Count Microformats</title>
- <meta name="description" content="microformat-shiv - A light-weight cross browser javascript microformats 2 parser" />
-
- <link rel="stylesheet" href="css/testrunner.css">
- <link rel="stylesheet" href="css/prettify.css">
-
-
- <!-- loads Modules to help with debugging ie windows.Modules -->
- <script src="../../lib/utilities.js"></script>
- <script src="../../lib/domutils.js"></script>
- <script src="../../lib/url.js"></script>
- <script src="../../lib/html.js"></script>
- <script src="../../lib/text.js"></script>
- <script src="../../lib/dates.js"></script>
- <script src="../../lib/isodate.js"></script>
- <script src="../../lib/parser.js"></script>
- <script src="../../lib/parser-implied.js"></script>
- <script src="../../lib/parser-includes.js"></script>
- <script src="../../lib/parser-rels.js"></script>
-
- <script src="../../lib/maps/h-adr.js"></script>
- <script src="../../lib/maps/h-card.js"></script>
- <script src="../../lib/maps/h-entry.js"></script>
- <script src="../../lib/maps/h-event.js"></script>
- <script src="../../lib/maps/h-feed.js"></script>
- <script src="../../lib/maps/h-geo.js"></script>
- <script src="../../lib/maps/h-item.js"></script>
- <script src="../../lib/maps/h-listing.js"></script>
- <script src="../../lib/maps/h-news.js"></script>
- <script src="../../lib/maps/h-org.js"></script>
- <script src="../../lib/maps/h-product.js"></script>
- <script src="../../lib/maps/h-recipe.js"></script>
- <script src="../../lib/maps/h-resume.js"></script>
- <script src="../../lib/maps/h-review-aggregate.js"></script>
- <script src="../../lib/maps/h-review.js"></script>
- <script src="../../lib/maps/rel.js"></script>
-
-
- <script src="javascript/beautify.js"></script>
- <script src="javascript/prettify.js"></script>
-
- <script src="javascript/count.js"></script>
-
- </head>
-
- <body>
-
- <p>microformat-shiv</p>
- <h1>Count Microformats</h1>
- <p>Type or copy and paste the HTML you want to parse into the box below.</p>
-
- <form id="mf-form" class="tool-interface" method="get" action="">
- <p>
- <label for="html">HTML</label>
-<textarea id="html" name="html">&lt;a class="h-card" href="http://glennjones.net"&gt;
- &lt;span class="p-given-name"&gt;Glenn&lt;/span&gt;
- &lt;span class="p-family-name"&gt;Jones&lt;/span&gt;
-&lt;/a&gt;
-&lt;a class="h-card" href="http://janedoe.net"&gt;
- &lt;span class="p-given-name"&gt;Jane&lt;/span&gt;
- &lt;span class="p-family-name"&gt;Doe&lt;/span&gt;
-&lt;/a&gt;
-&lt;a class="h-event" href="http://janedoe.net"&gt;
- &lt;span class="p-name"&gt;Event&lt;/span&gt;
- &lt;span class="dt-start"&gt;2015-07-01&lt;/span&gt;
-&lt;/a&gt;
-</textarea>
- </p>
-
- <input class="button" value="Count" type="submit">
- </form>
-
- <h1>Parser JSON</h1>
- <div id="parser-json"><pre class="prettyprint"><code class="language-json"></code></pre></div>
-
-
-
- </body>
-</html> \ No newline at end of file
diff --git a/toolkit/components/microformats/test/static/css/mocha-custom.css b/toolkit/components/microformats/test/static/css/mocha-custom.css
deleted file mode 100644
index 30f07756b..000000000
--- a/toolkit/components/microformats/test/static/css/mocha-custom.css
+++ /dev/null
@@ -1,9 +0,0 @@
-
-body {
- font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
- padding: 60px 50px;
-}
-
-h3.capitalize {
- text-transform: capitalize;
-} \ No newline at end of file
diff --git a/toolkit/components/microformats/test/static/css/mocha.css b/toolkit/components/microformats/test/static/css/mocha.css
deleted file mode 100644
index 42b9798fa..000000000
--- a/toolkit/components/microformats/test/static/css/mocha.css
+++ /dev/null
@@ -1,270 +0,0 @@
-@charset "utf-8";
-
-body {
- margin:0;
-}
-
-#mocha {
- font: 20px/1.5 "Helvetica Neue", Helvetica, Arial, sans-serif;
- margin: 60px 50px;
-}
-
-#mocha ul,
-#mocha li {
- margin: 0;
- padding: 0;
-}
-
-#mocha ul {
- list-style: none;
-}
-
-#mocha h1,
-#mocha h2 {
- margin: 0;
-}
-
-#mocha h1 {
- margin-top: 15px;
- font-size: 1em;
- font-weight: 200;
-}
-
-#mocha h1 a {
- text-decoration: none;
- color: inherit;
-}
-
-#mocha h1 a:hover {
- text-decoration: underline;
-}
-
-#mocha .suite .suite h1 {
- margin-top: 0;
- font-size: .8em;
-}
-
-#mocha .hidden {
- display: none;
-}
-
-#mocha h2 {
- font-size: 12px;
- font-weight: normal;
- cursor: pointer;
-}
-
-#mocha .suite {
- margin-left: 15px;
-}
-
-#mocha .test {
- margin-left: 15px;
- overflow: hidden;
-}
-
-#mocha .test.pending:hover h2::after {
- content: '(pending)';
- font-family: arial, sans-serif;
-}
-
-#mocha .test.pass.medium .duration {
- background: #c09853;
-}
-
-#mocha .test.pass.slow .duration {
- background: #b94a48;
-}
-
-#mocha .test.pass::before {
- content: '✓';
- font-size: 12px;
- display: block;
- float: left;
- margin-right: 5px;
- color: #00d6b2;
-}
-
-#mocha .test.pass .duration {
- font-size: 9px;
- margin-left: 5px;
- padding: 2px 5px;
- color: #fff;
- -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
- -moz-box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
- box-shadow: inset 0 1px 1px rgba(0,0,0,.2);
- -webkit-border-radius: 5px;
- -moz-border-radius: 5px;
- -ms-border-radius: 5px;
- -o-border-radius: 5px;
- border-radius: 5px;
-}
-
-#mocha .test.pass.fast .duration {
- display: none;
-}
-
-#mocha .test.pending {
- color: #0b97c4;
-}
-
-#mocha .test.pending::before {
- content: 'â—¦';
- color: #0b97c4;
-}
-
-#mocha .test.fail {
- color: #c00;
-}
-
-#mocha .test.fail pre {
- color: black;
-}
-
-#mocha .test.fail::before {
- content: '✖';
- font-size: 12px;
- display: block;
- float: left;
- margin-right: 5px;
- color: #c00;
-}
-
-#mocha .test pre.error {
- color: #c00;
- max-height: 300px;
- overflow: auto;
-}
-
-/**
- * (1): approximate for browsers not supporting calc
- * (2): 42 = 2*15 + 2*10 + 2*1 (padding + margin + border)
- * ^^ seriously
- */
-#mocha .test pre {
- display: block;
- float: left;
- clear: left;
- font: 12px/1.5 monaco, monospace;
- margin: 5px;
- padding: 15px;
- border: 1px solid #eee;
- max-width: 85%; /*(1)*/
- max-width: calc(100% - 42px); /*(2)*/
- word-wrap: break-word;
- border-bottom-color: #ddd;
- -webkit-border-radius: 3px;
- -webkit-box-shadow: 0 1px 3px #eee;
- -moz-border-radius: 3px;
- -moz-box-shadow: 0 1px 3px #eee;
- border-radius: 3px;
-}
-
-#mocha .test h2 {
- position: relative;
-}
-
-#mocha .test a.replay {
- position: absolute;
- top: 3px;
- right: 0;
- text-decoration: none;
- vertical-align: middle;
- display: block;
- width: 15px;
- height: 15px;
- line-height: 15px;
- text-align: center;
- background: #eee;
- font-size: 15px;
- -moz-border-radius: 15px;
- border-radius: 15px;
- -webkit-transition: opacity 200ms;
- -moz-transition: opacity 200ms;
- transition: opacity 200ms;
- opacity: 0.3;
- color: #888;
-}
-
-#mocha .test:hover a.replay {
- opacity: 1;
-}
-
-#mocha-report.pass .test.fail {
- display: none;
-}
-
-#mocha-report.fail .test.pass {
- display: none;
-}
-
-#mocha-report.pending .test.pass,
-#mocha-report.pending .test.fail {
- display: none;
-}
-#mocha-report.pending .test.pass.pending {
- display: block;
-}
-
-#mocha-error {
- color: #c00;
- font-size: 1.5em;
- font-weight: 100;
- letter-spacing: 1px;
-}
-
-#mocha-stats {
- position: fixed;
- top: 15px;
- right: 10px;
- font-size: 12px;
- margin: 0;
- color: #888;
- z-index: 1;
-}
-
-#mocha-stats .progress {
- float: right;
- padding-top: 0;
-}
-
-#mocha-stats em {
- color: black;
-}
-
-#mocha-stats a {
- text-decoration: none;
- color: inherit;
-}
-
-#mocha-stats a:hover {
- border-bottom: 1px solid #eee;
-}
-
-#mocha-stats li {
- display: inline-block;
- margin: 0 5px;
- list-style: none;
- padding-top: 11px;
-}
-
-#mocha-stats canvas {
- width: 40px;
- height: 40px;
-}
-
-#mocha code .comment { color: #ddd; }
-#mocha code .init { color: #2f6fad; }
-#mocha code .string { color: #5890ad; }
-#mocha code .keyword { color: #8a6343; }
-#mocha code .number { color: #2f6fad; }
-
-@media screen and (max-device-width: 480px) {
- #mocha {
- margin: 60px 0px;
- }
-
- #mocha #stats {
- position: absolute;
- }
-}
diff --git a/toolkit/components/microformats/test/static/css/prettify.css b/toolkit/components/microformats/test/static/css/prettify.css
deleted file mode 100644
index 843e903e7..000000000
--- a/toolkit/components/microformats/test/static/css/prettify.css
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Pretty printing styles. Used with prettify.js. */
-
-.str { color: #85C5DC; }
-.kwd { color: #EDF0D1; }
-.com { color: #878989; }
-.typ { color: #F5896F; }
-.lit { color: #FFB17A; }
-.pun { color: #FFFFFF; }
-.pln { color: #FFFFFF; }
-.tag { color: #F5896F; }
-.atn { color: #F5896F; }
-.atv { color: #85C5DC; }
-.dec { color: #878989; }
-
-pre.prettyprint {
- background-color:#302F2D;
- border: none;
- line-height: normal;
- font-size: 100%;
- border-radius: 6px 6px 6px 6px;
- font-family: consolas,​'andale mono',​'courier new',​monospace;
- padding-top: 12px;
- overflow: hidden;
-}
-
-code{
- font-size: 13px;
- line-height: normal;
-}
-
-/* Specify class=linenums on a pre to get line numbering */
-ol.linenums { margin-top: 0; margin-bottom: 0 } /* IE indents via margin-left */
-li.L0,
-li.L1,
-li.L2,
-li.L3,
-li.L5,
-li.L6,
-li.L7,
-li.L8 { list-style-type: none }
-/* Alternate shading for lines */
-li.L1,
-li.L3,
-li.L5,
-li.L7,
-li.L9 { background: #eee }
-
-@media print {
- .str { color: #060; }
- .kwd { color: #006; font-weight: bold; }
- .com { color: #600; font-style: italic; }
- .typ { color: #404; font-weight: bold; }
- .lit { color: #044; }
- .pun { color: #440; }
- .pln { color: #000; }
- .tag { color: #006; font-weight: bold; }
- .atn { color: #404; }
- .atv { color: #060; }
-}
-
-
-/* correct additional line return at top of html diaplay*/
-code>:first-child{
- display: none;
-} \ No newline at end of file
diff --git a/toolkit/components/microformats/test/static/css/testrunner.css b/toolkit/components/microformats/test/static/css/testrunner.css
deleted file mode 100644
index 0064b139c..000000000
--- a/toolkit/components/microformats/test/static/css/testrunner.css
+++ /dev/null
@@ -1,367 +0,0 @@
-/*
-All content and code is released into the public domain
-http://en.wikipedia.org/wiki/public_domain
-
-Contributors
-Glenn Jones - http://glennjones.net/
-*/
-
-
-
-
-@import url(https://fonts.googleapis.com/css?family=Lato:300italic,700italic,300,700);
-
-body {
- padding:50px;
- font:1em "Helvetica Neue", Helvetica, Arial, sans-serif;
- color:#333;
- font-weight:300;
- border-top: 5px solid #302F2D;
- margin: 0;
-}
-
-h1, h2, h3, h4, h5, h6 {
- color:#222;
- font-weight: normal;
-}
-
-p, ul, ol, table, pre, dl {
- margin:0 0 20px;
-}
-
-h1, h2, h3 {
- margin-top: 50px;
- margin-bottom: 10px;
- font-family: Lato, "Helvetica Neue", Helvetica, Arial, sans-serif;
-}
-
-h1 {
- font-size: 2em;
-}
-
-h2, h3 {
- font-size: 1.5em;
-}
-
-/* the first h1 in a page */
-h1:first-of-type{
- margin-top: 0;
- font-weight: bold;
-}
-
-a {
- color: #39c;
- font-weight: 300;
- text-decoration: none;
-}
-
-a:hover {
- text-decoration: underline;
-}
-
-a[name]{
- color: #333;
-}
-
-a[name]:hover {
- text-decoration: none;
-}
-
-blockquote {
- border-left: 1px solid #e5e5e5;
- margin: 0;
- padding: 0 0 0 20px;
- font-style: italic;
-}
-
-code, pre {
- font-family: Monaco, Bitstream Vera Sans Mono, Lucida Console, Terminal;
- font-size: 12px;
- margin: 0;
-}
-
-pre {
- padding: 8px 15px;
- border-radius: 5px;
- border: 1px solid #e5e5e5;
- overflow-x: auto;
- color: #fff;
- margin: 0;
-}
-
-table {
- border-collapse: collapse;
-}
-
-th, td {
- text-align: left;
- padding: 2px 10px;
- border-bottom: 1px solid #e5e5e5;
- font-weight: 300;
-}
-
-th{
- background-color: #333;
- color:#fff;
-}
-
-td a{
- font-weight: 300;
-}
-
-dt {
- color:#444;
- font-weight:700;
-}
-
-img {
- max-width:100%;
-}
-
-li{
- padding: 0.25em 0 0.25em 0;
-}
-
-
-button, input[type="submit"], input[type="button"], .button {
- display: inline-block;
- padding-top: 0.4em;
- padding-right: 1em;
- padding-left: 1em;
- padding-bottom: 0.5em;
- margin-bottom: 0;
- font-weight: 200;
- font-size: 1rem;
- text-align: center;
- white-space: nowrap;
- cursor: pointer;
- background-image: none;
- border: 1px solid transparent;
- border-radius: 3px;
- background-color: #33a0e8;
- color: #fff;
- -webkit-user-select: none;
- -moz-user-select: none;
- -ms-user-select: none;
- -o-user-select: none;
- user-select: none;
-}
-
-select {
- height: 34px;
- padding: 6px 12px;
- font-size: 14px;
- line-height: 1.42857143;
- color: #555;
- background-color: #fff;
- background-image: none;
- border: 1px solid #ccc;
- border-radius: 4px;
- -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
- box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
- -webkit-transition: border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;
- -o-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
- transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
-}
-
-option {
- padding: 2em;
-}
-
-footer{
- margin-top: 8em;
- text-align: center;
-}
-
-
-/* The Magnificent Clearfix: Updated to prevent margin-collapsing on child elements.
- j.mp/bestclearfix */
-.clearfix:before, .clearfix:after { content: "\0020"; display: block; height: 0; overflow: hidden; }
-.clearfix:after { clear: both; }
-/* Fix clearfix: blueprintcss.lighthouseapp.com/projects/15318/tickets/5-extra-margin-padding-bottom-of-page */
-.clearfix { zoom: 1; }
-
-.test-counts{
- font-weight: 700;
- margin-bottom: 4em;
-}
-
-.test-detail{
- display:none;
-}
-
-.all-test-list, .test-result-list{
- list-style: none;
- margin: 0;
- padding: 0;
- display: block;
- float: left;
-}
-
-.all-test-list li .test-result-list li{
- padding: 0.2em 0 0.2em 0;
- white-space: nowrap;
- cursor: pointer;
-}
-
-.all-test-list li::hover, .test-result-list li::hover{
- text-decoration: underline;
-}
-
-.all-test-list li.test-error a, .test-result-list li.test-error a{
- color: red;
- text-decoration: underline;
-}
-
-.flexbox-container {
- display: -ms-flex;
- display: -webkit-flex;
- display: flex;
-}
-
-.flexbox-container > section {
- margin-bottom: 3em;
-}
-
-.flexbox-container > section:first-child {
- width: 20%;
- margin-right: 20px;
-}
-
-.flexbox-container > section:nth-child(2) {
- padding-left: 1em;
- width: 80%;
-}
-
-
-@media (max-width: 1400px) {
- .flexbox-container > section:first-child {
- width: 25%;
- }
-
- .flexbox-container > section:nth-child(2) {
- width: 75%;
- }
-}
-
-@media (max-width: 1200px) {
- .flexbox-container > section:first-child {
- width: 30%;
- }
-
- .flexbox-container > section:nth-child(2) {
- width: 70%;
- }
-}
-
-
-@media (max-width: 1000px) {
- .flexbox-container > section:first-child {
- width: 35%;
- }
-
- .flexbox-container > section:nth-child(2) {
- width: 65%;
- }
-}
-
-
-
-
-
-
-#test-status {
- margin-top: 0;
-}
-
-.test-passed{
- border-left: 10px solid green;
-}
-
-.test-failed{
- border-left: 10px solid red;
-}
-
-.differences-description{
- margin-top: 2em;
-}
-
-.differences-description li{
- padding: 0;
-}
-
-.failed{
- color: red;
-}
-
-#test-list-by-version section{
- width: 30%;
- margin-right: 20px;
-}
-
-.test-container{
- padding-left: 1em;
-}
-
-
-#textcontent-test textarea{
- font-size: 1em;
- min-height: 6em;
- min-width: 40em;
- padding: 0.5em;
-}
-
-#textcontent-test input{
- font-size: 1em;
-}
-
-
-/* Tool interface */
-
-.tool-interface input[type="text"], input[type="url"] {
- width: 20em;
- padding: 0.4em;
- border: 1px solid #999;
- border-radius: 0.4em;
- color: #333;
- font-size: 1em
-}
-
-.tool-interface label {
- display: inline-block;
- width: 5em;
-}
-
-.tool-interface select {
- padding: 0.2em;
- font-family: open_sansregular, calibri, arial, helvetica, 'lucida grande', 'lucida sans unicode', verdana, sans-serif;
-}
-
-.tool-interface option{
- padding: 0.2em;
-}
-
-.tool-interface textarea{
- width: 100%;
- height: 16em;
- border: 1px solid #999;
- border-radius: 0.4em;
- font-size: 1em;
- font-family: open_sansregular, calibri, arial, helvetica, 'lucida grande', 'lucida sans unicode', verdana, sans-serif;
-}
-
-.tool-interface .button{
- margin-left: 5.2em;
-}
-
-.tool-interface label.checkbox-label{
- width: auto;
-}
-
-.tool-interface .checkbox{
- margin-left: 5.2em;
-}
-
-select.indent {
- margin-left: 5em;
-}
diff --git a/toolkit/components/microformats/test/static/images/logo.gif b/toolkit/components/microformats/test/static/images/logo.gif
deleted file mode 100644
index 96c965e70..000000000
--- a/toolkit/components/microformats/test/static/images/logo.gif
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/microformats/test/static/images/photo.gif b/toolkit/components/microformats/test/static/images/photo.gif
deleted file mode 100644
index 96c965e70..000000000
--- a/toolkit/components/microformats/test/static/images/photo.gif
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/microformats/test/static/javascript/DOMParser.js b/toolkit/components/microformats/test/static/javascript/DOMParser.js
deleted file mode 100644
index fa26bcdfd..000000000
--- a/toolkit/components/microformats/test/static/javascript/DOMParser.js
+++ /dev/null
@@ -1,99 +0,0 @@
-
-// Based on https://gist.github.com/1129031 By Eli Grey, http://eligrey.com - Public domain.
-
-// DO NOT use https://developer.mozilla.org/en-US/docs/Web/API/DOMParser example polyfill
-// as it does not work with earliar version of chrome
-
-
-(function(DOMParser) {
- "use strict";
-
- var DOMParser_proto;
- var real_parseFromString;
- var textHTML; // Flag for text/html support
- var textXML; // Flag for text/xml support
- var htmlElInnerHTML; // Flag for support for setting html element's innerHTML
-
- // Stop here if DOMParser not defined
- if (!DOMParser) return;
-
- // Firefox, Opera and IE throw errors on unsupported types
- try {
- // WebKit returns null on unsupported types
- textHTML = !!(new DOMParser).parseFromString('', 'text/html');
-
- } catch (er) {
- textHTML = false;
- }
-
- // If text/html supported, don't need to do anything.
- if (textHTML) return;
-
- // Next try setting innerHTML of a created document
- // IE 9 and lower will throw an error (can't set innerHTML of its HTML element)
- try {
- var doc = document.implementation.createHTMLDocument('');
- doc.documentElement.innerHTML = '<title></title><div></div>';
- htmlElInnerHTML = true;
-
- } catch (er) {
- htmlElInnerHTML = false;
- }
-
- // If if that failed, try text/xml
- if (!htmlElInnerHTML) {
-
- try {
- textXML = !!(new DOMParser).parseFromString('', 'text/xml');
-
- } catch (er) {
- textHTML = false;
- }
- }
-
- // Mess with DOMParser.prototype (less than optimal...) if one of the above worked
- // Assume can write to the prototype, if not, make this a stand alone function
- if (DOMParser.prototype && (htmlElInnerHTML || textXML)) {
- DOMParser_proto = DOMParser.prototype;
- real_parseFromString = DOMParser_proto.parseFromString;
-
- DOMParser_proto.parseFromString = function (markup, type) {
-
- // Only do this if type is text/html
- if (/^\s*text\/html\s*(?:;|$)/i.test(type)) {
- var doc, doc_el, first_el;
-
- // Use innerHTML if supported
- if (htmlElInnerHTML) {
- doc = document.implementation.createHTMLDocument("");
- doc_el = doc.documentElement;
- doc_el.innerHTML = markup;
- first_el = doc_el.firstElementChild;
-
- // Otherwise use XML method
- } else if (textXML) {
-
- // Make sure markup is wrapped in HTML tags
- // Should probably allow for a DOCTYPE
- if (!(/^<html.*html>$/i.test(markup))) {
- markup = '<html>' + markup + '<\/html>';
- }
- doc = (new DOMParser).parseFromString(markup, 'text/xml');
- doc_el = doc.documentElement;
- first_el = doc_el.firstElementChild;
- }
-
- // Is this an entire document or a fragment?
- if (doc_el.childElementCount == 1 && first_el.localName.toLowerCase() == 'html') {
- doc.replaceChild(first_el, doc_el);
- }
-
- return doc;
-
- // If not text/html, send as-is to host method
- } else {
- return real_parseFromString.apply(this, arguments);
- }
- };
- }
-}(DOMParser));
diff --git a/toolkit/components/microformats/test/static/javascript/beautify.js b/toolkit/components/microformats/test/static/javascript/beautify.js
deleted file mode 100644
index 55d06cb08..000000000
--- a/toolkit/components/microformats/test/static/javascript/beautify.js
+++ /dev/null
@@ -1,518 +0,0 @@
-/*
-
- JS Beautifier
----------------
-
- Written by Einars "elfz" Lielmanis, <elfz@laacz.lv>
- http://elfz.laacz.lv/beautify/
-
- Originally converted to javascript by Vital, <vital76@gmail.com>
- http://my.opera.com/Vital/blog/2007/11/21/javascript-beautify-on-javascript-translated
-
-
- You are free to use this in any way you want, in case you find this useful or working for you.
-
- Usage:
- js_beautify(js_source_text);
-
-
-*/
-
-
-function js_beautify(js_source_text, indent_size, indent_character)
-{
-
- var input, output, token_text, last_type, current_mode, modes, indent_level, indent_string;
- var whitespace, wordchar, punct;
-
- indent_character = indent_character || ' ';
- indent_size = indent_size || 4;
-
- indent_string = '';
- while (indent_size--) indent_string += indent_character;
-
- input = js_source_text;
-
- last_word = ''; // last 'TK_WORD' passed
- last_type = 'TK_START_EXPR'; // last token type
- last_text = ''; // last token text
- output = '';
-
- whitespace = "\n\r\t ".split('');
- wordchar = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$'.split('');
- punct = '+ - * / % & ++ -- = += -= *= /= %= == === != !== > < >= <= >> << >>> >>>= >>= <<= && &= | || ! !! , : ? ^ ^= |='.split(' ');
-
- // words which should always start on new line.
- line_starters = 'continue,try,throw,return,var,if,switch,case,default,for,while,break,function'.split(',');
-
- // states showing if we are currently in expression (i.e. "if" case) - 'EXPRESSION', or in usual block (like, procedure), 'BLOCK'.
- // some formatting depends on that.
- current_mode = 'BLOCK';
- modes = [current_mode];
-
- indent_level = 0;
- parser_pos = 0; // parser position
- in_case = false; // flag for parser that case/default has been processed, and next colon needs special attention
- while (true) {
- var t = get_next_token(parser_pos);
- token_text = t[0];
- token_type = t[1];
- if (token_type == 'TK_EOF') {
- break;
- }
-
- switch (token_type) {
-
- case 'TK_START_EXPR':
-
- set_mode('EXPRESSION');
- if (last_type == 'TK_END_EXPR' || last_type == 'TK_START_EXPR') {
- // do nothing on (( and )( and ][ and ]( ..
- } else if (last_type != 'TK_WORD' && last_type != 'TK_OPERATOR') {
- print_space();
- } else if (in_array(last_word, line_starters) && last_word != 'function') {
- print_space();
- }
- print_token();
- break;
-
- case 'TK_END_EXPR':
-
- print_token();
- restore_mode();
- break;
-
- case 'TK_START_BLOCK':
-
- set_mode('BLOCK');
- if (last_type != 'TK_OPERATOR' && last_type != 'TK_START_EXPR') {
- if (last_type == 'TK_START_BLOCK') {
- print_newline();
- } else {
- print_space();
- }
- }
- print_token();
- indent();
- break;
-
- case 'TK_END_BLOCK':
-
- if (last_type == 'TK_END_EXPR') {
- unindent();
- print_newline();
- } else if (last_type == 'TK_END_BLOCK') {
- unindent();
- print_newline();
- } else if (last_type == 'TK_START_BLOCK') {
- // nothing
- unindent();
- } else {
- unindent();
- print_newline();
- }
- print_token();
- restore_mode();
- break;
-
- case 'TK_WORD':
-
- if (token_text == 'case' || token_text == 'default') {
- if (last_text == ':') {
- // switch cases following one another
- remove_indent();
- } else {
- // case statement starts in the same line where switch
- unindent();
- print_newline();
- indent();
- }
- print_token();
- in_case = true;
- break;
- }
-
- prefix = 'NONE';
- if (last_type == 'TK_END_BLOCK') {
- if (!in_array(token_text.toLowerCase(), ['else', 'catch', 'finally'])) {
- prefix = 'NEWLINE';
- } else {
- prefix = 'SPACE';
- print_space();
- }
- } else if (last_type == 'TK_END_COMMAND' && current_mode == 'BLOCK') {
- prefix = 'NEWLINE';
- } else if (last_type == 'TK_END_COMMAND' && current_mode == 'EXPRESSION') {
- prefix = 'SPACE';
- } else if (last_type == 'TK_WORD') {
- prefix = 'SPACE';
- } else if (last_type == 'TK_START_BLOCK') {
- prefix = 'NEWLINE';
- } else if (last_type == 'TK_END_EXPR') {
- print_space();
- prefix = 'NEWLINE';
- }
-
- if (in_array(token_text, line_starters) || prefix == 'NEWLINE') {
-
- if (last_text == 'else') {
- // no need to force newline on else break
- print_space();
- } else if ((last_type == 'TK_START_EXPR' || last_text == '=') && token_text == 'function') {
- // no need to force newline on 'function': (function
- // DONOTHING
- } else if (last_type == 'TK_WORD' && (last_text == 'return' || last_text == 'throw')) {
- // no newline between 'return nnn'
- print_space();
- } else
- if (last_type != 'TK_END_EXPR') {
- if ((last_type != 'TK_START_EXPR' || token_text != 'var') && last_text != ':') {
- // no need to force newline on 'var': for (var x = 0...)
- if (token_text == 'if' && last_type == 'TK_WORD' && last_word == 'else') {
- // no newline for } else if {
- print_space();
- } else {
- print_newline();
- }
- }
- }
- } else if (prefix == 'SPACE') {
- print_space();
- }
- print_token();
- last_word = token_text;
- break;
-
- case 'TK_END_COMMAND':
-
- print_token();
- break;
-
- case 'TK_STRING':
-
- if (last_type == 'TK_START_BLOCK' || last_type == 'TK_END_BLOCK') {
- print_newline();
- } else if (last_type == 'TK_WORD') {
- print_space();
- }
- print_token();
- break;
-
- case 'TK_OPERATOR':
- start_delim = true;
- end_delim = true;
-
- if (token_text == ':' && in_case) {
- print_token(); // colon really asks for separate treatment
- print_newline();
- break;
- }
-
- in_case = false;
-
- if (token_text == ',') {
- if (last_type == 'TK_END_BLOCK') {
- print_token();
- print_newline();
- } else {
- if (current_mode == 'BLOCK') {
- print_token();
- print_newline();
- } else {
- print_token();
- print_space();
- }
- }
- break;
- } else if (token_text == '--' || token_text == '++') { // unary operators special case
- if (last_text == ';') {
- // space for (;; ++i)
- start_delim = true;
- end_delim = false;
- } else {
- start_delim = false;
- end_delim = false;
- }
- } else if (token_text == '!' && last_type == 'TK_START_EXPR') {
- // special case handling: if (!a)
- start_delim = false;
- end_delim = false;
- } else if (last_type == 'TK_OPERATOR') {
- start_delim = false;
- end_delim = false;
- } else if (last_type == 'TK_END_EXPR') {
- start_delim = true;
- end_delim = true;
- } else if (token_text == '.') {
- // decimal digits or object.property
- start_delim = false;
- end_delim = false;
-
- } else if (token_text == ':') {
- // zz: xx
- // can't differentiate ternary op, so for now it's a ? b: c; without space before colon
- start_delim = false;
- }
- if (start_delim) {
- print_space();
- }
-
- print_token();
-
- if (end_delim) {
- print_space();
- }
- break;
-
- case 'TK_BLOCK_COMMENT':
-
- print_newline();
- print_token();
- print_newline();
- break;
-
- case 'TK_COMMENT':
-
- // print_newline();
- print_space();
- print_token();
- print_newline();
- break;
-
- case 'TK_UNKNOWN':
- print_token();
- break;
- }
-
- if (token_type != 'TK_COMMENT') {
- last_type = token_type;
- last_text = token_text;
- }
- }
-
- return output;
-
-
-
-
- function print_newline(ignore_repeated)
- {
- ignore_repeated = typeof ignore_repeated == 'undefined' ? true: ignore_repeated;
- output = output.replace(/[ \t]+$/, ''); // remove possible indent
- if (output == '') return; // no newline on start of file
- if (output.substr(output.length - 1) != "\n" || !ignore_repeated) {
- output += "\n";
- }
- for (var i = 0; i < indent_level; i++) {
- output += indent_string;
- }
- }
-
-
-
- function print_space()
- {
- if (output && output.substr(output.length - 1) != ' ' && output.substr(output.length - 1) != '\n') { // prevent occassional duplicate space
- output += ' ';
- }
- }
-
-
- function print_token()
- {
- output += token_text;
- }
-
- function indent()
- {
- indent_level++;
- }
-
-
- function unindent()
- {
- if (indent_level) {
- indent_level--;
- }
- }
-
-
- function remove_indent()
- {
- if (output.substr(output.length - indent_string.length) == indent_string) {
- output = output.substr(0, output.length - indent_string.length);
- }
- }
-
-
- function set_mode(mode)
- {
- modes.push(current_mode);
- current_mode = mode;
- }
-
-
- function restore_mode()
- {
- current_mode = modes.pop();
- }
-
-
-
- function get_next_token()
- {
- var n_newlines = 0;
- var c = '';
-
- do {
- if (parser_pos >= input.length) {
- return ['', 'TK_EOF'];
- }
- c = input.charAt(parser_pos);
-
- parser_pos += 1;
- if (c == "\n") {
- n_newlines += 1;
- }
- }
- while (in_array(c, whitespace));
-
- if (n_newlines > 1) {
- for (var i = 0; i < n_newlines; i++) {
- print_newline(i == 0);
- }
- }
- var wanted_newline = n_newlines == 1;
-
-
- if (in_array(c, wordchar)) {
- if (parser_pos < input.length) {
- while (in_array(input.charAt(parser_pos), wordchar)) {
- c += input.charAt(parser_pos);
- parser_pos += 1;
- if (parser_pos == input.length) break;
- }
- }
-
- // small and surprisingly unugly hack for 1E-10 representation
- if (parser_pos != input.length && c.match(/^[0-9]+[Ee]$/) && input.charAt(parser_pos) == '-') {
- parser_pos += 1;
-
- var t = get_next_token(parser_pos);
- next_word = t[0];
- next_type = t[1];
-
- c += '-' + next_word;
- return [c, 'TK_WORD'];
- }
-
- if (c == 'in') { // hack for 'in' operator
- return [c, 'TK_OPERATOR'];
- }
- return [c, 'TK_WORD'];
- }
-
- if (c == '(' || c == '[') {
- return [c, 'TK_START_EXPR'];
- }
-
- if (c == ')' || c == ']') {
- return [c, 'TK_END_EXPR'];
- }
-
- if (c == '{') {
- return [c, 'TK_START_BLOCK'];
- }
-
- if (c == '}') {
- return [c, 'TK_END_BLOCK'];
- }
-
- if (c == ';') {
- return [c, 'TK_END_COMMAND'];
- }
-
- if (c == '/') {
- // peek for comment /* ... */
- if (input.charAt(parser_pos) == '*') {
- comment = '';
- parser_pos += 1;
- if (parser_pos < input.length) {
- while (! (input.charAt(parser_pos) == '*' && input.charAt(parser_pos + 1) && input.charAt(parser_pos + 1) == '/') && parser_pos < input.length) {
- comment += input.charAt(parser_pos);
- parser_pos += 1;
- if (parser_pos >= input.length) break;
- }
- }
- parser_pos += 2;
- return ['/*' + comment + '*/', 'TK_BLOCK_COMMENT'];
- }
- // peek for comment // ...
- if (input.charAt(parser_pos) == '/') {
- comment = c;
- while (input.charAt(parser_pos) != "\x0d" && input.charAt(parser_pos) != "\x0a") {
- comment += input.charAt(parser_pos);
- parser_pos += 1;
- if (parser_pos >= input.length) break;
- }
- parser_pos += 1;
- if (wanted_newline) {
- print_newline();
- }
- return [comment, 'TK_COMMENT'];
- }
-
- }
-
- if (c == "'" || // string
- c == '"' || // string
- (c == '/' &&
- ((last_type == 'TK_WORD' && last_text == 'return') || (last_type == 'TK_START_EXPR' || last_type == 'TK_END_BLOCK' || last_type == 'TK_OPERATOR' || last_type == 'TK_EOF' || last_type == 'TK_END_COMMAND')))) { // regexp
- sep = c;
- c = '';
- esc = false;
-
- if (parser_pos < input.length) {
-
- while (esc || input.charAt(parser_pos) != sep) {
- c += input.charAt(parser_pos);
- if (!esc) {
- esc = input.charAt(parser_pos) == '\\';
- } else {
- esc = false;
- }
- parser_pos += 1;
- if (parser_pos >= input.length) break;
- }
-
- }
-
- parser_pos += 1;
- if (last_type == 'TK_END_COMMAND') {
- print_newline();
- }
- return [sep + c + sep, 'TK_STRING'];
- }
-
- if (in_array(c, punct)) {
- while (parser_pos < input.length && in_array(c + input.charAt(parser_pos), punct)) {
- c += input.charAt(parser_pos);
- parser_pos += 1;
- if (parser_pos >= input.length) break;
- }
- return [c, 'TK_OPERATOR'];
- }
-
- return [c, 'TK_UNKNOWN'];
- }
-
-
- function in_array(what, arr)
- {
- for (var i = 0; i < arr.length; i++)
- {
- if (arr[i] == what) return true;
- }
- return false;
- }
-}
diff --git a/toolkit/components/microformats/test/static/javascript/chai.js b/toolkit/components/microformats/test/static/javascript/chai.js
deleted file mode 100644
index bbdbe907b..000000000
--- a/toolkit/components/microformats/test/static/javascript/chai.js
+++ /dev/null
@@ -1,5351 +0,0 @@
-(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.chai = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-/*!
- * chai
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-var used = [];
-exports = module.exports = {};
-
-/*!
- * Chai version
- */
-
-exports.version = '3.0.0';
-
-/*!
- * Assertion Error
- */
-
-exports.AssertionError = require('assertion-error');
-
-/*!
- * Utils for plugins (not exported)
- */
-
-var util = require('./chai/utils');
-
-/**
- * # .use(function)
- *
- * Provides a way to extend the internals of Chai
- *
- * @param {Function}
- * @returns {this} for chaining
- * @api public
- */
-
-exports.use = function (fn) {
- if (!~used.indexOf(fn)) {
- fn(this, util);
- used.push(fn);
- }
-
- return this;
-};
-
-/*!
- * Utility Functions
- */
-
-exports.util = util;
-
-/*!
- * Configuration
- */
-
-var config = require('./chai/config');
-exports.config = config;
-
-/*!
- * Primary `Assertion` prototype
- */
-
-var assertion = require('./chai/assertion');
-exports.use(assertion);
-
-/*!
- * Core Assertions
- */
-
-var core = require('./chai/core/assertions');
-exports.use(core);
-
-/*!
- * Expect interface
- */
-
-var expect = require('./chai/interface/expect');
-exports.use(expect);
-
-/*!
- * Should interface
- */
-
-var should = require('./chai/interface/should');
-exports.use(should);
-
-/*!
- * Assert interface
- */
-
-var assert = require('./chai/interface/assert');
-exports.use(assert);
-
-},{"./chai/assertion":2,"./chai/config":3,"./chai/core/assertions":4,"./chai/interface/assert":5,"./chai/interface/expect":6,"./chai/interface/should":7,"./chai/utils":20,"assertion-error":28}],2:[function(require,module,exports){
-/*!
- * chai
- * http://chaijs.com
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-var config = require('./config');
-
-module.exports = function (_chai, util) {
- /*!
- * Module dependencies.
- */
-
- var AssertionError = _chai.AssertionError
- , flag = util.flag;
-
- /*!
- * Module export.
- */
-
- _chai.Assertion = Assertion;
-
- /*!
- * Assertion Constructor
- *
- * Creates object for chaining.
- *
- * @api private
- */
-
- function Assertion (obj, msg, stack) {
- flag(this, 'ssfi', stack || arguments.callee);
- flag(this, 'object', obj);
- flag(this, 'message', msg);
- }
-
- Object.defineProperty(Assertion, 'includeStack', {
- get: function() {
- console.warn('Assertion.includeStack is deprecated, use chai.config.includeStack instead.');
- return config.includeStack;
- },
- set: function(value) {
- console.warn('Assertion.includeStack is deprecated, use chai.config.includeStack instead.');
- config.includeStack = value;
- }
- });
-
- Object.defineProperty(Assertion, 'showDiff', {
- get: function() {
- console.warn('Assertion.showDiff is deprecated, use chai.config.showDiff instead.');
- return config.showDiff;
- },
- set: function(value) {
- console.warn('Assertion.showDiff is deprecated, use chai.config.showDiff instead.');
- config.showDiff = value;
- }
- });
-
- Assertion.addProperty = function (name, fn) {
- util.addProperty(this.prototype, name, fn);
- };
-
- Assertion.addMethod = function (name, fn) {
- util.addMethod(this.prototype, name, fn);
- };
-
- Assertion.addChainableMethod = function (name, fn, chainingBehavior) {
- util.addChainableMethod(this.prototype, name, fn, chainingBehavior);
- };
-
- Assertion.overwriteProperty = function (name, fn) {
- util.overwriteProperty(this.prototype, name, fn);
- };
-
- Assertion.overwriteMethod = function (name, fn) {
- util.overwriteMethod(this.prototype, name, fn);
- };
-
- Assertion.overwriteChainableMethod = function (name, fn, chainingBehavior) {
- util.overwriteChainableMethod(this.prototype, name, fn, chainingBehavior);
- };
-
- /**
- * ### .assert(expression, message, negateMessage, expected, actual, showDiff)
- *
- * Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass.
- *
- * @name assert
- * @param {Philosophical} expression to be tested
- * @param {String or Function} message or function that returns message to display if expression fails
- * @param {String or Function} negatedMessage or function that returns negatedMessage to display if negated expression fails
- * @param {Mixed} expected value (remember to check for negation)
- * @param {Mixed} actual (optional) will default to `this.obj`
- * @param {Boolean} showDiff (optional) when set to `true`, assert will display a diff in addition to the message if expression fails
- * @api private
- */
-
- Assertion.prototype.assert = function (expr, msg, negateMsg, expected, _actual, showDiff) {
- var ok = util.test(this, arguments);
- if (true !== showDiff) showDiff = false;
- if (true !== config.showDiff) showDiff = false;
-
- if (!ok) {
- msg = util.getMessage(this, arguments)
- var actual = util.getActual(this, arguments);
- throw new AssertionError(msg, {
- actual: actual
- , expected: expected
- , showDiff: showDiff
- }, (config.includeStack) ? this.assert : flag(this, 'ssfi'));
- }
- };
-
- /*!
- * ### ._obj
- *
- * Quick reference to stored `actual` value for plugin developers.
- *
- * @api private
- */
-
- Object.defineProperty(Assertion.prototype, '_obj',
- { get: function () {
- return flag(this, 'object');
- }
- , set: function (val) {
- flag(this, 'object', val);
- }
- });
-};
-
-},{"./config":3}],3:[function(require,module,exports){
-module.exports = {
-
- /**
- * ### config.includeStack
- *
- * User configurable property, influences whether stack trace
- * is included in Assertion error message. Default of false
- * suppresses stack trace in the error message.
- *
- * chai.config.includeStack = true; // enable stack on error
- *
- * @param {Boolean}
- * @api public
- */
-
- includeStack: false,
-
- /**
- * ### config.showDiff
- *
- * User configurable property, influences whether or not
- * the `showDiff` flag should be included in the thrown
- * AssertionErrors. `false` will always be `false`; `true`
- * will be true when the assertion has requested a diff
- * be shown.
- *
- * @param {Boolean}
- * @api public
- */
-
- showDiff: true,
-
- /**
- * ### config.truncateThreshold
- *
- * User configurable property, sets length threshold for actual and
- * expected values in assertion errors. If this threshold is exceeded, for
- * example for large data structures, the value is replaced with something
- * like `[ Array(3) ]` or `{ Object (prop1, prop2) }`.
- *
- * Set it to zero if you want to disable truncating altogether.
- *
- * This is especially userful when doing assertions on arrays: having this
- * set to a reasonable large value makes the failure messages readily
- * inspectable.
- *
- * chai.config.truncateThreshold = 0; // disable truncating
- *
- * @param {Number}
- * @api public
- */
-
- truncateThreshold: 40
-
-};
-
-},{}],4:[function(require,module,exports){
-/*!
- * chai
- * http://chaijs.com
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-module.exports = function (chai, _) {
- var Assertion = chai.Assertion
- , toString = Object.prototype.toString
- , flag = _.flag;
-
- /**
- * ### Language Chains
- *
- * The following are provided as chainable getters to
- * improve the readability of your assertions. They
- * do not provide testing capabilities unless they
- * have been overwritten by a plugin.
- *
- * **Chains**
- *
- * - to
- * - be
- * - been
- * - is
- * - that
- * - which
- * - and
- * - has
- * - have
- * - with
- * - at
- * - of
- * - same
- *
- * @name language chains
- * @api public
- */
-
- [ 'to', 'be', 'been'
- , 'is', 'and', 'has', 'have'
- , 'with', 'that', 'which', 'at'
- , 'of', 'same' ].forEach(function (chain) {
- Assertion.addProperty(chain, function () {
- return this;
- });
- });
-
- /**
- * ### .not
- *
- * Negates any of assertions following in the chain.
- *
- * expect(foo).to.not.equal('bar');
- * expect(goodFn).to.not.throw(Error);
- * expect({ foo: 'baz' }).to.have.property('foo')
- * .and.not.equal('bar');
- *
- * @name not
- * @api public
- */
-
- Assertion.addProperty('not', function () {
- flag(this, 'negate', true);
- });
-
- /**
- * ### .deep
- *
- * Sets the `deep` flag, later used by the `equal` and
- * `property` assertions.
- *
- * expect(foo).to.deep.equal({ bar: 'baz' });
- * expect({ foo: { bar: { baz: 'quux' } } })
- * .to.have.deep.property('foo.bar.baz', 'quux');
- *
- * `.deep.property` special characters can be escaped
- * by adding two slashes before the `.` or `[]`.
- *
- * var deepCss = { '.link': { '[target]': 42 }};
- * expect(deepCss).to.have.deep.property('\\.link.\\[target\\]', 42);
- *
- * @name deep
- * @api public
- */
-
- Assertion.addProperty('deep', function () {
- flag(this, 'deep', true);
- });
-
- /**
- * ### .any
- *
- * Sets the `any` flag, (opposite of the `all` flag)
- * later used in the `keys` assertion.
- *
- * expect(foo).to.have.any.keys('bar', 'baz');
- *
- * @name any
- * @api public
- */
-
- Assertion.addProperty('any', function () {
- flag(this, 'any', true);
- flag(this, 'all', false)
- });
-
-
- /**
- * ### .all
- *
- * Sets the `all` flag (opposite of the `any` flag)
- * later used by the `keys` assertion.
- *
- * expect(foo).to.have.all.keys('bar', 'baz');
- *
- * @name all
- * @api public
- */
-
- Assertion.addProperty('all', function () {
- flag(this, 'all', true);
- flag(this, 'any', false);
- });
-
- /**
- * ### .a(type)
- *
- * The `a` and `an` assertions are aliases that can be
- * used either as language chains or to assert a value's
- * type.
- *
- * // typeof
- * expect('test').to.be.a('string');
- * expect({ foo: 'bar' }).to.be.an('object');
- * expect(null).to.be.a('null');
- * expect(undefined).to.be.an('undefined');
- * expect(new Promise).to.be.a('promise');
- * expect(new Float32Array()).to.be.a('float32array');
- * expect(Symbol()).to.be.a('symbol');
- *
- * // es6 overrides
- * expect({[Symbol.toStringTag]:()=>'foo'}).to.be.a('foo');
- *
- * // language chain
- * expect(foo).to.be.an.instanceof(Foo);
- *
- * @name a
- * @alias an
- * @param {String} type
- * @param {String} message _optional_
- * @api public
- */
-
- function an (type, msg) {
- if (msg) flag(this, 'message', msg);
- type = type.toLowerCase();
- var obj = flag(this, 'object')
- , article = ~[ 'a', 'e', 'i', 'o', 'u' ].indexOf(type.charAt(0)) ? 'an ' : 'a ';
-
- this.assert(
- type === _.type(obj)
- , 'expected #{this} to be ' + article + type
- , 'expected #{this} not to be ' + article + type
- );
- }
-
- Assertion.addChainableMethod('an', an);
- Assertion.addChainableMethod('a', an);
-
- /**
- * ### .include(value)
- *
- * The `include` and `contain` assertions can be used as either property
- * based language chains or as methods to assert the inclusion of an object
- * in an array or a substring in a string. When used as language chains,
- * they toggle the `contains` flag for the `keys` assertion.
- *
- * expect([1,2,3]).to.include(2);
- * expect('foobar').to.contain('foo');
- * expect({ foo: 'bar', hello: 'universe' }).to.include.keys('foo');
- *
- * @name include
- * @alias contain
- * @alias includes
- * @alias contains
- * @param {Object|String|Number} obj
- * @param {String} message _optional_
- * @api public
- */
-
- function includeChainingBehavior () {
- flag(this, 'contains', true);
- }
-
- function include (val, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- var expected = false;
- if (_.type(obj) === 'array' && _.type(val) === 'object') {
- for (var i in obj) {
- if (_.eql(obj[i], val)) {
- expected = true;
- break;
- }
- }
- } else if (_.type(val) === 'object') {
- if (!flag(this, 'negate')) {
- for (var k in val) new Assertion(obj).property(k, val[k]);
- return;
- }
- var subset = {};
- for (k in val) subset[k] = obj[k];
- expected = _.eql(subset, val);
- } else {
- expected = obj && ~obj.indexOf(val);
- }
- this.assert(
- expected
- , 'expected #{this} to include ' + _.inspect(val)
- , 'expected #{this} to not include ' + _.inspect(val));
- }
-
- Assertion.addChainableMethod('include', include, includeChainingBehavior);
- Assertion.addChainableMethod('contain', include, includeChainingBehavior);
- Assertion.addChainableMethod('contains', include, includeChainingBehavior);
- Assertion.addChainableMethod('includes', include, includeChainingBehavior);
-
- /**
- * ### .ok
- *
- * Asserts that the target is truthy.
- *
- * expect('everthing').to.be.ok;
- * expect(1).to.be.ok;
- * expect(false).to.not.be.ok;
- * expect(undefined).to.not.be.ok;
- * expect(null).to.not.be.ok;
- *
- * @name ok
- * @api public
- */
-
- Assertion.addProperty('ok', function () {
- this.assert(
- flag(this, 'object')
- , 'expected #{this} to be truthy'
- , 'expected #{this} to be falsy');
- });
-
- /**
- * ### .true
- *
- * Asserts that the target is `true`.
- *
- * expect(true).to.be.true;
- * expect(1).to.not.be.true;
- *
- * @name true
- * @api public
- */
-
- Assertion.addProperty('true', function () {
- this.assert(
- true === flag(this, 'object')
- , 'expected #{this} to be true'
- , 'expected #{this} to be false'
- , this.negate ? false : true
- );
- });
-
- /**
- * ### .false
- *
- * Asserts that the target is `false`.
- *
- * expect(false).to.be.false;
- * expect(0).to.not.be.false;
- *
- * @name false
- * @api public
- */
-
- Assertion.addProperty('false', function () {
- this.assert(
- false === flag(this, 'object')
- , 'expected #{this} to be false'
- , 'expected #{this} to be true'
- , this.negate ? true : false
- );
- });
-
- /**
- * ### .null
- *
- * Asserts that the target is `null`.
- *
- * expect(null).to.be.null;
- * expect(undefined).to.not.be.null;
- *
- * @name null
- * @api public
- */
-
- Assertion.addProperty('null', function () {
- this.assert(
- null === flag(this, 'object')
- , 'expected #{this} to be null'
- , 'expected #{this} not to be null'
- );
- });
-
- /**
- * ### .undefined
- *
- * Asserts that the target is `undefined`.
- *
- * expect(undefined).to.be.undefined;
- * expect(null).to.not.be.undefined;
- *
- * @name undefined
- * @api public
- */
-
- Assertion.addProperty('undefined', function () {
- this.assert(
- undefined === flag(this, 'object')
- , 'expected #{this} to be undefined'
- , 'expected #{this} not to be undefined'
- );
- });
-
- /**
- * ### .exist
- *
- * Asserts that the target is neither `null` nor `undefined`.
- *
- * var foo = 'hi'
- * , bar = null
- * , baz;
- *
- * expect(foo).to.exist;
- * expect(bar).to.not.exist;
- * expect(baz).to.not.exist;
- *
- * @name exist
- * @api public
- */
-
- Assertion.addProperty('exist', function () {
- this.assert(
- null != flag(this, 'object')
- , 'expected #{this} to exist'
- , 'expected #{this} to not exist'
- );
- });
-
-
- /**
- * ### .empty
- *
- * Asserts that the target's length is `0`. For arrays and strings, it checks
- * the `length` property. For objects, it gets the count of
- * enumerable keys.
- *
- * expect([]).to.be.empty;
- * expect('').to.be.empty;
- * expect({}).to.be.empty;
- *
- * @name empty
- * @api public
- */
-
- Assertion.addProperty('empty', function () {
- var obj = flag(this, 'object')
- , expected = obj;
-
- if (Array.isArray(obj) || 'string' === typeof object) {
- expected = obj.length;
- } else if (typeof obj === 'object') {
- expected = Object.keys(obj).length;
- }
-
- this.assert(
- !expected
- , 'expected #{this} to be empty'
- , 'expected #{this} not to be empty'
- );
- });
-
- /**
- * ### .arguments
- *
- * Asserts that the target is an arguments object.
- *
- * function test () {
- * expect(arguments).to.be.arguments;
- * }
- *
- * @name arguments
- * @alias Arguments
- * @api public
- */
-
- function checkArguments () {
- var obj = flag(this, 'object')
- , type = Object.prototype.toString.call(obj);
- this.assert(
- '[object Arguments]' === type
- , 'expected #{this} to be arguments but got ' + type
- , 'expected #{this} to not be arguments'
- );
- }
-
- Assertion.addProperty('arguments', checkArguments);
- Assertion.addProperty('Arguments', checkArguments);
-
- /**
- * ### .equal(value)
- *
- * Asserts that the target is strictly equal (`===`) to `value`.
- * Alternately, if the `deep` flag is set, asserts that
- * the target is deeply equal to `value`.
- *
- * expect('hello').to.equal('hello');
- * expect(42).to.equal(42);
- * expect(1).to.not.equal(true);
- * expect({ foo: 'bar' }).to.not.equal({ foo: 'bar' });
- * expect({ foo: 'bar' }).to.deep.equal({ foo: 'bar' });
- *
- * @name equal
- * @alias equals
- * @alias eq
- * @alias deep.equal
- * @param {Mixed} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertEqual (val, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'deep')) {
- return this.eql(val);
- } else {
- this.assert(
- val === obj
- , 'expected #{this} to equal #{exp}'
- , 'expected #{this} to not equal #{exp}'
- , val
- , this._obj
- , true
- );
- }
- }
-
- Assertion.addMethod('equal', assertEqual);
- Assertion.addMethod('equals', assertEqual);
- Assertion.addMethod('eq', assertEqual);
-
- /**
- * ### .eql(value)
- *
- * Asserts that the target is deeply equal to `value`.
- *
- * expect({ foo: 'bar' }).to.eql({ foo: 'bar' });
- * expect([ 1, 2, 3 ]).to.eql([ 1, 2, 3 ]);
- *
- * @name eql
- * @alias eqls
- * @param {Mixed} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertEql(obj, msg) {
- if (msg) flag(this, 'message', msg);
- this.assert(
- _.eql(obj, flag(this, 'object'))
- , 'expected #{this} to deeply equal #{exp}'
- , 'expected #{this} to not deeply equal #{exp}'
- , obj
- , this._obj
- , true
- );
- }
-
- Assertion.addMethod('eql', assertEql);
- Assertion.addMethod('eqls', assertEql);
-
- /**
- * ### .above(value)
- *
- * Asserts that the target is greater than `value`.
- *
- * expect(10).to.be.above(5);
- *
- * Can also be used in conjunction with `length` to
- * assert a minimum length. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.above(2);
- * expect([ 1, 2, 3 ]).to.have.length.above(2);
- *
- * @name above
- * @alias gt
- * @alias greaterThan
- * @param {Number} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertAbove (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len > n
- , 'expected #{this} to have a length above #{exp} but got #{act}'
- , 'expected #{this} to not have a length above #{exp}'
- , n
- , len
- );
- } else {
- this.assert(
- obj > n
- , 'expected #{this} to be above ' + n
- , 'expected #{this} to be at most ' + n
- );
- }
- }
-
- Assertion.addMethod('above', assertAbove);
- Assertion.addMethod('gt', assertAbove);
- Assertion.addMethod('greaterThan', assertAbove);
-
- /**
- * ### .least(value)
- *
- * Asserts that the target is greater than or equal to `value`.
- *
- * expect(10).to.be.at.least(10);
- *
- * Can also be used in conjunction with `length` to
- * assert a minimum length. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.of.at.least(2);
- * expect([ 1, 2, 3 ]).to.have.length.of.at.least(3);
- *
- * @name least
- * @alias gte
- * @param {Number} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertLeast (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len >= n
- , 'expected #{this} to have a length at least #{exp} but got #{act}'
- , 'expected #{this} to have a length below #{exp}'
- , n
- , len
- );
- } else {
- this.assert(
- obj >= n
- , 'expected #{this} to be at least ' + n
- , 'expected #{this} to be below ' + n
- );
- }
- }
-
- Assertion.addMethod('least', assertLeast);
- Assertion.addMethod('gte', assertLeast);
-
- /**
- * ### .below(value)
- *
- * Asserts that the target is less than `value`.
- *
- * expect(5).to.be.below(10);
- *
- * Can also be used in conjunction with `length` to
- * assert a maximum length. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.below(4);
- * expect([ 1, 2, 3 ]).to.have.length.below(4);
- *
- * @name below
- * @alias lt
- * @alias lessThan
- * @param {Number} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertBelow (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len < n
- , 'expected #{this} to have a length below #{exp} but got #{act}'
- , 'expected #{this} to not have a length below #{exp}'
- , n
- , len
- );
- } else {
- this.assert(
- obj < n
- , 'expected #{this} to be below ' + n
- , 'expected #{this} to be at least ' + n
- );
- }
- }
-
- Assertion.addMethod('below', assertBelow);
- Assertion.addMethod('lt', assertBelow);
- Assertion.addMethod('lessThan', assertBelow);
-
- /**
- * ### .most(value)
- *
- * Asserts that the target is less than or equal to `value`.
- *
- * expect(5).to.be.at.most(5);
- *
- * Can also be used in conjunction with `length` to
- * assert a maximum length. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.of.at.most(4);
- * expect([ 1, 2, 3 ]).to.have.length.of.at.most(3);
- *
- * @name most
- * @alias lte
- * @param {Number} value
- * @param {String} message _optional_
- * @api public
- */
-
- function assertMost (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len <= n
- , 'expected #{this} to have a length at most #{exp} but got #{act}'
- , 'expected #{this} to have a length above #{exp}'
- , n
- , len
- );
- } else {
- this.assert(
- obj <= n
- , 'expected #{this} to be at most ' + n
- , 'expected #{this} to be above ' + n
- );
- }
- }
-
- Assertion.addMethod('most', assertMost);
- Assertion.addMethod('lte', assertMost);
-
- /**
- * ### .within(start, finish)
- *
- * Asserts that the target is within a range.
- *
- * expect(7).to.be.within(5,10);
- *
- * Can also be used in conjunction with `length` to
- * assert a length range. The benefit being a
- * more informative error message than if the length
- * was supplied directly.
- *
- * expect('foo').to.have.length.within(2,4);
- * expect([ 1, 2, 3 ]).to.have.length.within(2,4);
- *
- * @name within
- * @param {Number} start lowerbound inclusive
- * @param {Number} finish upperbound inclusive
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('within', function (start, finish, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object')
- , range = start + '..' + finish;
- if (flag(this, 'doLength')) {
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
- this.assert(
- len >= start && len <= finish
- , 'expected #{this} to have a length within ' + range
- , 'expected #{this} to not have a length within ' + range
- );
- } else {
- this.assert(
- obj >= start && obj <= finish
- , 'expected #{this} to be within ' + range
- , 'expected #{this} to not be within ' + range
- );
- }
- });
-
- /**
- * ### .instanceof(constructor)
- *
- * Asserts that the target is an instance of `constructor`.
- *
- * var Tea = function (name) { this.name = name; }
- * , Chai = new Tea('chai');
- *
- * expect(Chai).to.be.an.instanceof(Tea);
- * expect([ 1, 2, 3 ]).to.be.instanceof(Array);
- *
- * @name instanceof
- * @param {Constructor} constructor
- * @param {String} message _optional_
- * @alias instanceOf
- * @api public
- */
-
- function assertInstanceOf (constructor, msg) {
- if (msg) flag(this, 'message', msg);
- var name = _.getName(constructor);
- this.assert(
- flag(this, 'object') instanceof constructor
- , 'expected #{this} to be an instance of ' + name
- , 'expected #{this} to not be an instance of ' + name
- );
- }
-
- Assertion.addMethod('instanceof', assertInstanceOf);
- Assertion.addMethod('instanceOf', assertInstanceOf);
-
- /**
- * ### .property(name, [value])
- *
- * Asserts that the target has a property `name`, optionally asserting that
- * the value of that property is strictly equal to `value`.
- * If the `deep` flag is set, you can use dot- and bracket-notation for deep
- * references into objects and arrays.
- *
- * // simple referencing
- * var obj = { foo: 'bar' };
- * expect(obj).to.have.property('foo');
- * expect(obj).to.have.property('foo', 'bar');
- *
- * // deep referencing
- * var deepObj = {
- * green: { tea: 'matcha' }
- * , teas: [ 'chai', 'matcha', { tea: 'konacha' } ]
- * };
- *
- * expect(deepObj).to.have.deep.property('green.tea', 'matcha');
- * expect(deepObj).to.have.deep.property('teas[1]', 'matcha');
- * expect(deepObj).to.have.deep.property('teas[2].tea', 'konacha');
- *
- * You can also use an array as the starting point of a `deep.property`
- * assertion, or traverse nested arrays.
- *
- * var arr = [
- * [ 'chai', 'matcha', 'konacha' ]
- * , [ { tea: 'chai' }
- * , { tea: 'matcha' }
- * , { tea: 'konacha' } ]
- * ];
- *
- * expect(arr).to.have.deep.property('[0][1]', 'matcha');
- * expect(arr).to.have.deep.property('[1][2].tea', 'konacha');
- *
- * Furthermore, `property` changes the subject of the assertion
- * to be the value of that property from the original object. This
- * permits for further chainable assertions on that property.
- *
- * expect(obj).to.have.property('foo')
- * .that.is.a('string');
- * expect(deepObj).to.have.property('green')
- * .that.is.an('object')
- * .that.deep.equals({ tea: 'matcha' });
- * expect(deepObj).to.have.property('teas')
- * .that.is.an('array')
- * .with.deep.property('[2]')
- * .that.deep.equals({ tea: 'konacha' });
- *
- * Note that dots and bracket in `name` must be backslash-escaped when
- * the `deep` flag is set, while they must NOT be escaped when the `deep`
- * flag is not set.
- *
- * // simple referencing
- * var css = { '.link[target]': 42 };
- * expect(css).to.have.property('.link[target]', 42);
- *
- * // deep referencing
- * var deepCss = { '.link': { '[target]': 42 }};
- * expect(deepCss).to.have.deep.property('\\.link.\\[target\\]', 42);
- *
- * @name property
- * @alias deep.property
- * @param {String} name
- * @param {Mixed} value (optional)
- * @param {String} message _optional_
- * @returns value of property for chaining
- * @api public
- */
-
- Assertion.addMethod('property', function (name, val, msg) {
- if (msg) flag(this, 'message', msg);
-
- var isDeep = !!flag(this, 'deep')
- , descriptor = isDeep ? 'deep property ' : 'property '
- , negate = flag(this, 'negate')
- , obj = flag(this, 'object')
- , pathInfo = isDeep ? _.getPathInfo(name, obj) : null
- , hasProperty = isDeep
- ? pathInfo.exists
- : _.hasProperty(name, obj)
- , value = isDeep
- ? pathInfo.value
- : obj[name];
-
- if (negate && arguments.length > 1) {
- if (undefined === value) {
- msg = (msg != null) ? msg + ': ' : '';
- throw new Error(msg + _.inspect(obj) + ' has no ' + descriptor + _.inspect(name));
- }
- } else {
- this.assert(
- hasProperty
- , 'expected #{this} to have a ' + descriptor + _.inspect(name)
- , 'expected #{this} to not have ' + descriptor + _.inspect(name));
- }
-
- if (arguments.length > 1) {
- this.assert(
- val === value
- , 'expected #{this} to have a ' + descriptor + _.inspect(name) + ' of #{exp}, but got #{act}'
- , 'expected #{this} to not have a ' + descriptor + _.inspect(name) + ' of #{act}'
- , val
- , value
- );
- }
-
- flag(this, 'object', value);
- });
-
-
- /**
- * ### .ownProperty(name)
- *
- * Asserts that the target has an own property `name`.
- *
- * expect('test').to.have.ownProperty('length');
- *
- * @name ownProperty
- * @alias haveOwnProperty
- * @param {String} name
- * @param {String} message _optional_
- * @api public
- */
-
- function assertOwnProperty (name, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- this.assert(
- obj.hasOwnProperty(name)
- , 'expected #{this} to have own property ' + _.inspect(name)
- , 'expected #{this} to not have own property ' + _.inspect(name)
- );
- }
-
- Assertion.addMethod('ownProperty', assertOwnProperty);
- Assertion.addMethod('haveOwnProperty', assertOwnProperty);
-
- /**
- * ### .ownPropertyDescriptor(name[, descriptor[, message]])
- *
- * Asserts that the target has an own property descriptor `name`, that optionally matches `descriptor`.
- *
- * expect('test').to.have.ownPropertyDescriptor('length');
- * expect('test').to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 });
- * expect('test').not.to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 });
- * expect('test').ownPropertyDescriptor('length').to.have.property('enumerable', false);
- * expect('test').ownPropertyDescriptor('length').to.have.keys('value');
- *
- * @name ownPropertyDescriptor
- * @alias haveOwnPropertyDescriptor
- * @param {String} name
- * @param {Object} descriptor _optional_
- * @param {String} message _optional_
- * @api public
- */
-
- function assertOwnPropertyDescriptor (name, descriptor, msg) {
- if (typeof descriptor === 'string') {
- msg = descriptor;
- descriptor = null;
- }
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- var actualDescriptor = Object.getOwnPropertyDescriptor(Object(obj), name);
- if (actualDescriptor && descriptor) {
- this.assert(
- _.eql(descriptor, actualDescriptor)
- , 'expected the own property descriptor for ' + _.inspect(name) + ' on #{this} to match ' + _.inspect(descriptor) + ', got ' + _.inspect(actualDescriptor)
- , 'expected the own property descriptor for ' + _.inspect(name) + ' on #{this} to not match ' + _.inspect(descriptor)
- , descriptor
- , actualDescriptor
- , true
- );
- } else {
- this.assert(
- actualDescriptor
- , 'expected #{this} to have an own property descriptor for ' + _.inspect(name)
- , 'expected #{this} to not have an own property descriptor for ' + _.inspect(name)
- );
- }
- flag(this, 'object', actualDescriptor);
- }
-
- Assertion.addMethod('ownPropertyDescriptor', assertOwnPropertyDescriptor);
- Assertion.addMethod('haveOwnPropertyDescriptor', assertOwnPropertyDescriptor);
-
- /**
- * ### .length
- *
- * Sets the `doLength` flag later used as a chain precursor to a value
- * comparison for the `length` property.
- *
- * expect('foo').to.have.length.above(2);
- * expect([ 1, 2, 3 ]).to.have.length.above(2);
- * expect('foo').to.have.length.below(4);
- * expect([ 1, 2, 3 ]).to.have.length.below(4);
- * expect('foo').to.have.length.within(2,4);
- * expect([ 1, 2, 3 ]).to.have.length.within(2,4);
- *
- * *Deprecation notice:* Using `length` as an assertion will be deprecated
- * in version 2.4.0 and removed in 3.0.0. Code using the old style of
- * asserting for `length` property value using `length(value)` should be
- * switched to use `lengthOf(value)` instead.
- *
- * @name length
- * @api public
- */
-
- /**
- * ### .lengthOf(value[, message])
- *
- * Asserts that the target's `length` property has
- * the expected value.
- *
- * expect([ 1, 2, 3]).to.have.lengthOf(3);
- * expect('foobar').to.have.lengthOf(6);
- *
- * @name lengthOf
- * @param {Number} length
- * @param {String} message _optional_
- * @api public
- */
-
- function assertLengthChain () {
- flag(this, 'doLength', true);
- }
-
- function assertLength (n, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- new Assertion(obj, msg).to.have.property('length');
- var len = obj.length;
-
- this.assert(
- len == n
- , 'expected #{this} to have a length of #{exp} but got #{act}'
- , 'expected #{this} to not have a length of #{act}'
- , n
- , len
- );
- }
-
- Assertion.addChainableMethod('length', assertLength, assertLengthChain);
- Assertion.addMethod('lengthOf', assertLength);
-
- /**
- * ### .match(regexp)
- *
- * Asserts that the target matches a regular expression.
- *
- * expect('foobar').to.match(/^foo/);
- *
- * @name match
- * @alias matches
- * @param {RegExp} RegularExpression
- * @param {String} message _optional_
- * @api public
- */
- function assertMatch(re, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- this.assert(
- re.exec(obj)
- , 'expected #{this} to match ' + re
- , 'expected #{this} not to match ' + re
- );
- }
-
- Assertion.addMethod('match', assertMatch);
- Assertion.addMethod('matches', assertMatch);
-
- /**
- * ### .string(string)
- *
- * Asserts that the string target contains another string.
- *
- * expect('foobar').to.have.string('bar');
- *
- * @name string
- * @param {String} string
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('string', function (str, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- new Assertion(obj, msg).is.a('string');
-
- this.assert(
- ~obj.indexOf(str)
- , 'expected #{this} to contain ' + _.inspect(str)
- , 'expected #{this} to not contain ' + _.inspect(str)
- );
- });
-
-
- /**
- * ### .keys(key1, [key2], [...])
- *
- * Asserts that the target contains any or all of the passed-in keys.
- * Use in combination with `any`, `all`, `contains`, or `have` will affect
- * what will pass.
- *
- * When used in conjunction with `any`, at least one key that is passed
- * in must exist in the target object. This is regardless whether or not
- * the `have` or `contain` qualifiers are used. Note, either `any` or `all`
- * should be used in the assertion. If neither are used, the assertion is
- * defaulted to `all`.
- *
- * When both `all` and `contain` are used, the target object must have at
- * least all of the passed-in keys but may have more keys not listed.
- *
- * When both `all` and `have` are used, the target object must both contain
- * all of the passed-in keys AND the number of keys in the target object must
- * match the number of keys passed in (in other words, a target object must
- * have all and only all of the passed-in keys).
- *
- * expect({ foo: 1, bar: 2 }).to.have.any.keys('foo', 'baz');
- * expect({ foo: 1, bar: 2 }).to.have.any.keys('foo');
- * expect({ foo: 1, bar: 2 }).to.contain.any.keys('bar', 'baz');
- * expect({ foo: 1, bar: 2 }).to.contain.any.keys(['foo']);
- * expect({ foo: 1, bar: 2 }).to.contain.any.keys({'foo': 6});
- * expect({ foo: 1, bar: 2 }).to.have.all.keys(['bar', 'foo']);
- * expect({ foo: 1, bar: 2 }).to.have.all.keys({'bar': 6, 'foo': 7});
- * expect({ foo: 1, bar: 2, baz: 3 }).to.contain.all.keys(['bar', 'foo']);
- * expect({ foo: 1, bar: 2, baz: 3 }).to.contain.all.keys({'bar': 6});
- *
- *
- * @name keys
- * @alias key
- * @param {String...|Array|Object} keys
- * @api public
- */
-
- function assertKeys (keys) {
- var obj = flag(this, 'object')
- , str
- , ok = true
- , mixedArgsMsg = 'keys must be given single argument of Array|Object|String, or multiple String arguments';
-
- switch (_.type(keys)) {
- case "array":
- if (arguments.length > 1) throw (new Error(mixedArgsMsg));
- break;
- case "object":
- if (arguments.length > 1) throw (new Error(mixedArgsMsg));
- keys = Object.keys(keys);
- break;
- default:
- keys = Array.prototype.slice.call(arguments);
- }
-
- if (!keys.length) throw new Error('keys required');
-
- var actual = Object.keys(obj)
- , expected = keys
- , len = keys.length
- , any = flag(this, 'any')
- , all = flag(this, 'all');
-
- if (!any && !all) {
- all = true;
- }
-
- // Has any
- if (any) {
- var intersection = expected.filter(function(key) {
- return ~actual.indexOf(key);
- });
- ok = intersection.length > 0;
- }
-
- // Has all
- if (all) {
- ok = keys.every(function(key){
- return ~actual.indexOf(key);
- });
- if (!flag(this, 'negate') && !flag(this, 'contains')) {
- ok = ok && keys.length == actual.length;
- }
- }
-
- // Key string
- if (len > 1) {
- keys = keys.map(function(key){
- return _.inspect(key);
- });
- var last = keys.pop();
- if (all) {
- str = keys.join(', ') + ', and ' + last;
- }
- if (any) {
- str = keys.join(', ') + ', or ' + last;
- }
- } else {
- str = _.inspect(keys[0]);
- }
-
- // Form
- str = (len > 1 ? 'keys ' : 'key ') + str;
-
- // Have / include
- str = (flag(this, 'contains') ? 'contain ' : 'have ') + str;
-
- // Assertion
- this.assert(
- ok
- , 'expected #{this} to ' + str
- , 'expected #{this} to not ' + str
- , expected.slice(0).sort()
- , actual.sort()
- , true
- );
- }
-
- Assertion.addMethod('keys', assertKeys);
- Assertion.addMethod('key', assertKeys);
-
- /**
- * ### .throw(constructor)
- *
- * Asserts that the function target will throw a specific error, or specific type of error
- * (as determined using `instanceof`), optionally with a RegExp or string inclusion test
- * for the error's message.
- *
- * var err = new ReferenceError('This is a bad function.');
- * var fn = function () { throw err; }
- * expect(fn).to.throw(ReferenceError);
- * expect(fn).to.throw(Error);
- * expect(fn).to.throw(/bad function/);
- * expect(fn).to.not.throw('good function');
- * expect(fn).to.throw(ReferenceError, /bad function/);
- * expect(fn).to.throw(err);
- * expect(fn).to.not.throw(new RangeError('Out of range.'));
- *
- * Please note that when a throw expectation is negated, it will check each
- * parameter independently, starting with error constructor type. The appropriate way
- * to check for the existence of a type of error but for a message that does not match
- * is to use `and`.
- *
- * expect(fn).to.throw(ReferenceError)
- * .and.not.throw(/good function/);
- *
- * @name throw
- * @alias throws
- * @alias Throw
- * @param {ErrorConstructor} constructor
- * @param {String|RegExp} expected error message
- * @param {String} message _optional_
- * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
- * @returns error for chaining (null if no error)
- * @api public
- */
-
- function assertThrows (constructor, errMsg, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- new Assertion(obj, msg).is.a('function');
-
- var thrown = false
- , desiredError = null
- , name = null
- , thrownError = null;
-
- if (arguments.length === 0) {
- errMsg = null;
- constructor = null;
- } else if (constructor && (constructor instanceof RegExp || 'string' === typeof constructor)) {
- errMsg = constructor;
- constructor = null;
- } else if (constructor && constructor instanceof Error) {
- desiredError = constructor;
- constructor = null;
- errMsg = null;
- } else if (typeof constructor === 'function') {
- name = constructor.prototype.name || constructor.name;
- if (name === 'Error' && constructor !== Error) {
- name = (new constructor()).name;
- }
- } else {
- constructor = null;
- }
-
- try {
- obj();
- } catch (err) {
- // first, check desired error
- if (desiredError) {
- this.assert(
- err === desiredError
- , 'expected #{this} to throw #{exp} but #{act} was thrown'
- , 'expected #{this} to not throw #{exp}'
- , (desiredError instanceof Error ? desiredError.toString() : desiredError)
- , (err instanceof Error ? err.toString() : err)
- );
-
- flag(this, 'object', err);
- return this;
- }
-
- // next, check constructor
- if (constructor) {
- this.assert(
- err instanceof constructor
- , 'expected #{this} to throw #{exp} but #{act} was thrown'
- , 'expected #{this} to not throw #{exp} but #{act} was thrown'
- , name
- , (err instanceof Error ? err.toString() : err)
- );
-
- if (!errMsg) {
- flag(this, 'object', err);
- return this;
- }
- }
-
- // next, check message
- var message = 'error' === _.type(err) && "message" in err
- ? err.message
- : '' + err;
-
- if ((message != null) && errMsg && errMsg instanceof RegExp) {
- this.assert(
- errMsg.exec(message)
- , 'expected #{this} to throw error matching #{exp} but got #{act}'
- , 'expected #{this} to throw error not matching #{exp}'
- , errMsg
- , message
- );
-
- flag(this, 'object', err);
- return this;
- } else if ((message != null) && errMsg && 'string' === typeof errMsg) {
- this.assert(
- ~message.indexOf(errMsg)
- , 'expected #{this} to throw error including #{exp} but got #{act}'
- , 'expected #{this} to throw error not including #{act}'
- , errMsg
- , message
- );
-
- flag(this, 'object', err);
- return this;
- } else {
- thrown = true;
- thrownError = err;
- }
- }
-
- var actuallyGot = '';
- var expectedThrown = 'an error';
- if (name !== null) {
- expectedThrown = name;
- } else if (desiredError) {
- expectedThrown = '#{exp}'; //_.inspect(desiredError)
- }
-
- if (thrown) {
- actuallyGot = ' but #{act} was thrown'
- }
-
- this.assert(
- thrown === true
- , 'expected #{this} to throw ' + expectedThrown + actuallyGot
- , 'expected #{this} to not throw ' + expectedThrown + actuallyGot
- , (desiredError instanceof Error ? desiredError.toString() : desiredError)
- , (thrownError instanceof Error ? thrownError.toString() : thrownError)
- );
-
- flag(this, 'object', thrownError);
- }
-
- Assertion.addMethod('throw', assertThrows);
- Assertion.addMethod('throws', assertThrows);
- Assertion.addMethod('Throw', assertThrows);
-
- /**
- * ### .respondTo(method)
- *
- * Asserts that the object or class target will respond to a method.
- *
- * Klass.prototype.bar = function(){};
- * expect(Klass).to.respondTo('bar');
- * expect(obj).to.respondTo('bar');
- *
- * To check if a constructor will respond to a static function,
- * set the `itself` flag.
- *
- * Klass.baz = function(){};
- * expect(Klass).itself.to.respondTo('baz');
- *
- * @name respondTo
- * @param {String} method
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('respondTo', function (method, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object')
- , itself = flag(this, 'itself')
- , context = ('function' === _.type(obj) && !itself)
- ? obj.prototype[method]
- : obj[method];
-
- this.assert(
- 'function' === typeof context
- , 'expected #{this} to respond to ' + _.inspect(method)
- , 'expected #{this} to not respond to ' + _.inspect(method)
- );
- });
-
- /**
- * ### .itself
- *
- * Sets the `itself` flag, later used by the `respondTo` assertion.
- *
- * function Foo() {}
- * Foo.bar = function() {}
- * Foo.prototype.baz = function() {}
- *
- * expect(Foo).itself.to.respondTo('bar');
- * expect(Foo).itself.not.to.respondTo('baz');
- *
- * @name itself
- * @api public
- */
-
- Assertion.addProperty('itself', function () {
- flag(this, 'itself', true);
- });
-
- /**
- * ### .satisfy(method)
- *
- * Asserts that the target passes a given truth test.
- *
- * expect(1).to.satisfy(function(num) { return num > 0; });
- *
- * @name satisfy
- * @param {Function} matcher
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('satisfy', function (matcher, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
- var result = matcher(obj);
- this.assert(
- result
- , 'expected #{this} to satisfy ' + _.objDisplay(matcher)
- , 'expected #{this} to not satisfy' + _.objDisplay(matcher)
- , this.negate ? false : true
- , result
- );
- });
-
- /**
- * ### .closeTo(expected, delta)
- *
- * Asserts that the target is equal `expected`, to within a +/- `delta` range.
- *
- * expect(1.5).to.be.closeTo(1, 0.5);
- *
- * @name closeTo
- * @param {Number} expected
- * @param {Number} delta
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('closeTo', function (expected, delta, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
-
- new Assertion(obj, msg).is.a('number');
- if (_.type(expected) !== 'number' || _.type(delta) !== 'number') {
- throw new Error('the arguments to closeTo must be numbers');
- }
-
- this.assert(
- Math.abs(obj - expected) <= delta
- , 'expected #{this} to be close to ' + expected + ' +/- ' + delta
- , 'expected #{this} not to be close to ' + expected + ' +/- ' + delta
- );
- });
-
- function isSubsetOf(subset, superset, cmp) {
- return subset.every(function(elem) {
- if (!cmp) return superset.indexOf(elem) !== -1;
-
- return superset.some(function(elem2) {
- return cmp(elem, elem2);
- });
- })
- }
-
- /**
- * ### .members(set)
- *
- * Asserts that the target is a superset of `set`,
- * or that the target and `set` have the same strictly-equal (===) members.
- * Alternately, if the `deep` flag is set, set members are compared for deep
- * equality.
- *
- * expect([1, 2, 3]).to.include.members([3, 2]);
- * expect([1, 2, 3]).to.not.include.members([3, 2, 8]);
- *
- * expect([4, 2]).to.have.members([2, 4]);
- * expect([5, 2]).to.not.have.members([5, 2, 1]);
- *
- * expect([{ id: 1 }]).to.deep.include.members([{ id: 1 }]);
- *
- * @name members
- * @param {Array} set
- * @param {String} message _optional_
- * @api public
- */
-
- Assertion.addMethod('members', function (subset, msg) {
- if (msg) flag(this, 'message', msg);
- var obj = flag(this, 'object');
-
- new Assertion(obj).to.be.an('array');
- new Assertion(subset).to.be.an('array');
-
- var cmp = flag(this, 'deep') ? _.eql : undefined;
-
- if (flag(this, 'contains')) {
- return this.assert(
- isSubsetOf(subset, obj, cmp)
- , 'expected #{this} to be a superset of #{act}'
- , 'expected #{this} to not be a superset of #{act}'
- , obj
- , subset
- );
- }
-
- this.assert(
- isSubsetOf(obj, subset, cmp) && isSubsetOf(subset, obj, cmp)
- , 'expected #{this} to have the same members as #{act}'
- , 'expected #{this} to not have the same members as #{act}'
- , obj
- , subset
- );
- });
-
- /**
- * ### .change(function)
- *
- * Asserts that a function changes an object property
- *
- * var obj = { val: 10 };
- * var fn = function() { obj.val += 3 };
- * var noChangeFn = function() { return 'foo' + 'bar'; }
- * expect(fn).to.change(obj, 'val');
- * expect(noChangFn).to.not.change(obj, 'val')
- *
- * @name change
- * @alias changes
- * @alias Change
- * @param {String} object
- * @param {String} property name
- * @param {String} message _optional_
- * @api public
- */
-
- function assertChanges (object, prop, msg) {
- if (msg) flag(this, 'message', msg);
- var fn = flag(this, 'object');
- new Assertion(object, msg).to.have.property(prop);
- new Assertion(fn).is.a('function');
-
- var initial = object[prop];
- fn();
-
- this.assert(
- initial !== object[prop]
- , 'expected .' + prop + ' to change'
- , 'expected .' + prop + ' to not change'
- );
- }
-
- Assertion.addChainableMethod('change', assertChanges);
- Assertion.addChainableMethod('changes', assertChanges);
-
- /**
- * ### .increase(function)
- *
- * Asserts that a function increases an object property
- *
- * var obj = { val: 10 };
- * var fn = function() { obj.val = 15 };
- * expect(fn).to.increase(obj, 'val');
- *
- * @name increase
- * @alias increases
- * @alias Increase
- * @param {String} object
- * @param {String} property name
- * @param {String} message _optional_
- * @api public
- */
-
- function assertIncreases (object, prop, msg) {
- if (msg) flag(this, 'message', msg);
- var fn = flag(this, 'object');
- new Assertion(object, msg).to.have.property(prop);
- new Assertion(fn).is.a('function');
-
- var initial = object[prop];
- fn();
-
- this.assert(
- object[prop] - initial > 0
- , 'expected .' + prop + ' to increase'
- , 'expected .' + prop + ' to not increase'
- );
- }
-
- Assertion.addChainableMethod('increase', assertIncreases);
- Assertion.addChainableMethod('increases', assertIncreases);
-
- /**
- * ### .decrease(function)
- *
- * Asserts that a function decreases an object property
- *
- * var obj = { val: 10 };
- * var fn = function() { obj.val = 5 };
- * expect(fn).to.decrease(obj, 'val');
- *
- * @name decrease
- * @alias decreases
- * @alias Decrease
- * @param {String} object
- * @param {String} property name
- * @param {String} message _optional_
- * @api public
- */
-
- function assertDecreases (object, prop, msg) {
- if (msg) flag(this, 'message', msg);
- var fn = flag(this, 'object');
- new Assertion(object, msg).to.have.property(prop);
- new Assertion(fn).is.a('function');
-
- var initial = object[prop];
- fn();
-
- this.assert(
- object[prop] - initial < 0
- , 'expected .' + prop + ' to decrease'
- , 'expected .' + prop + ' to not decrease'
- );
- }
-
- Assertion.addChainableMethod('decrease', assertDecreases);
- Assertion.addChainableMethod('decreases', assertDecreases);
-
-};
-
-},{}],5:[function(require,module,exports){
-/*!
- * chai
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-
-module.exports = function (chai, util) {
-
- /*!
- * Chai dependencies.
- */
-
- var Assertion = chai.Assertion
- , flag = util.flag;
-
- /*!
- * Module export.
- */
-
- /**
- * ### assert(expression, message)
- *
- * Write your own test expressions.
- *
- * assert('foo' !== 'bar', 'foo is not bar');
- * assert(Array.isArray([]), 'empty arrays are arrays');
- *
- * @param {Mixed} expression to test for truthiness
- * @param {String} message to display on error
- * @name assert
- * @api public
- */
-
- var assert = chai.assert = function (express, errmsg) {
- var test = new Assertion(null, null, chai.assert);
- test.assert(
- express
- , errmsg
- , '[ negation message unavailable ]'
- );
- };
-
- /**
- * ### .fail(actual, expected, [message], [operator])
- *
- * Throw a failure. Node.js `assert` module-compatible.
- *
- * @name fail
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @param {String} operator
- * @api public
- */
-
- assert.fail = function (actual, expected, message, operator) {
- message = message || 'assert.fail()';
- throw new chai.AssertionError(message, {
- actual: actual
- , expected: expected
- , operator: operator
- }, assert.fail);
- };
-
- /**
- * ### .ok(object, [message])
- *
- * Asserts that `object` is truthy.
- *
- * assert.ok('everything', 'everything is ok');
- * assert.ok(false, 'this will fail');
- *
- * @name ok
- * @param {Mixed} object to test
- * @param {String} message
- * @api public
- */
-
- assert.ok = function (val, msg) {
- new Assertion(val, msg).is.ok;
- };
-
- /**
- * ### .notOk(object, [message])
- *
- * Asserts that `object` is falsy.
- *
- * assert.notOk('everything', 'this will fail');
- * assert.notOk(false, 'this will pass');
- *
- * @name notOk
- * @param {Mixed} object to test
- * @param {String} message
- * @api public
- */
-
- assert.notOk = function (val, msg) {
- new Assertion(val, msg).is.not.ok;
- };
-
- /**
- * ### .equal(actual, expected, [message])
- *
- * Asserts non-strict equality (`==`) of `actual` and `expected`.
- *
- * assert.equal(3, '3', '== coerces values to strings');
- *
- * @name equal
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.equal = function (act, exp, msg) {
- var test = new Assertion(act, msg, assert.equal);
-
- test.assert(
- exp == flag(test, 'object')
- , 'expected #{this} to equal #{exp}'
- , 'expected #{this} to not equal #{act}'
- , exp
- , act
- );
- };
-
- /**
- * ### .notEqual(actual, expected, [message])
- *
- * Asserts non-strict inequality (`!=`) of `actual` and `expected`.
- *
- * assert.notEqual(3, 4, 'these numbers are not equal');
- *
- * @name notEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.notEqual = function (act, exp, msg) {
- var test = new Assertion(act, msg, assert.notEqual);
-
- test.assert(
- exp != flag(test, 'object')
- , 'expected #{this} to not equal #{exp}'
- , 'expected #{this} to equal #{act}'
- , exp
- , act
- );
- };
-
- /**
- * ### .strictEqual(actual, expected, [message])
- *
- * Asserts strict equality (`===`) of `actual` and `expected`.
- *
- * assert.strictEqual(true, true, 'these booleans are strictly equal');
- *
- * @name strictEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.strictEqual = function (act, exp, msg) {
- new Assertion(act, msg).to.equal(exp);
- };
-
- /**
- * ### .notStrictEqual(actual, expected, [message])
- *
- * Asserts strict inequality (`!==`) of `actual` and `expected`.
- *
- * assert.notStrictEqual(3, '3', 'no coercion for strict equality');
- *
- * @name notStrictEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.notStrictEqual = function (act, exp, msg) {
- new Assertion(act, msg).to.not.equal(exp);
- };
-
- /**
- * ### .deepEqual(actual, expected, [message])
- *
- * Asserts that `actual` is deeply equal to `expected`.
- *
- * assert.deepEqual({ tea: 'green' }, { tea: 'green' });
- *
- * @name deepEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.deepEqual = function (act, exp, msg) {
- new Assertion(act, msg).to.eql(exp);
- };
-
- /**
- * ### .notDeepEqual(actual, expected, [message])
- *
- * Assert that `actual` is not deeply equal to `expected`.
- *
- * assert.notDeepEqual({ tea: 'green' }, { tea: 'jasmine' });
- *
- * @name notDeepEqual
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @api public
- */
-
- assert.notDeepEqual = function (act, exp, msg) {
- new Assertion(act, msg).to.not.eql(exp);
- };
-
- /**
- * ### .isTrue(value, [message])
- *
- * Asserts that `value` is true.
- *
- * var teaServed = true;
- * assert.isTrue(teaServed, 'the tea has been served');
- *
- * @name isTrue
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isAbove = function (val, abv, msg) {
- new Assertion(val, msg).to.be.above(abv);
- };
-
- /**
- * ### .isAbove(valueToCheck, valueToBeAbove, [message])
- *
- * Asserts `valueToCheck` is strictly greater than (>) `valueToBeAbove`
- *
- * assert.isAbove(5, 2, '5 is strictly greater than 2');
- *
- * @name isAbove
- * @param {Mixed} valueToCheck
- * @param {Mixed} valueToBeAbove
- * @param {String} message
- * @api public
- */
-
- assert.isBelow = function (val, blw, msg) {
- new Assertion(val, msg).to.be.below(blw);
- };
-
- /**
- * ### .isBelow(valueToCheck, valueToBeBelow, [message])
- *
- * Asserts `valueToCheck` is strictly less than (<) `valueToBeBelow`
- *
- * assert.isBelow(3, 6, '3 is strictly less than 6');
- *
- * @name isBelow
- * @param {Mixed} valueToCheck
- * @param {Mixed} valueToBeBelow
- * @param {String} message
- * @api public
- */
-
- assert.isTrue = function (val, msg) {
- new Assertion(val, msg).is['true'];
- };
-
- /**
- * ### .isFalse(value, [message])
- *
- * Asserts that `value` is false.
- *
- * var teaServed = false;
- * assert.isFalse(teaServed, 'no tea yet? hmm...');
- *
- * @name isFalse
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isFalse = function (val, msg) {
- new Assertion(val, msg).is['false'];
- };
-
- /**
- * ### .isNull(value, [message])
- *
- * Asserts that `value` is null.
- *
- * assert.isNull(err, 'there was no error');
- *
- * @name isNull
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNull = function (val, msg) {
- new Assertion(val, msg).to.equal(null);
- };
-
- /**
- * ### .isNotNull(value, [message])
- *
- * Asserts that `value` is not null.
- *
- * var tea = 'tasty chai';
- * assert.isNotNull(tea, 'great, time for tea!');
- *
- * @name isNotNull
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotNull = function (val, msg) {
- new Assertion(val, msg).to.not.equal(null);
- };
-
- /**
- * ### .isUndefined(value, [message])
- *
- * Asserts that `value` is `undefined`.
- *
- * var tea;
- * assert.isUndefined(tea, 'no tea defined');
- *
- * @name isUndefined
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isUndefined = function (val, msg) {
- new Assertion(val, msg).to.equal(undefined);
- };
-
- /**
- * ### .isDefined(value, [message])
- *
- * Asserts that `value` is not `undefined`.
- *
- * var tea = 'cup of chai';
- * assert.isDefined(tea, 'tea has been defined');
- *
- * @name isDefined
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isDefined = function (val, msg) {
- new Assertion(val, msg).to.not.equal(undefined);
- };
-
- /**
- * ### .isFunction(value, [message])
- *
- * Asserts that `value` is a function.
- *
- * function serveTea() { return 'cup of tea'; };
- * assert.isFunction(serveTea, 'great, we can have tea now');
- *
- * @name isFunction
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isFunction = function (val, msg) {
- new Assertion(val, msg).to.be.a('function');
- };
-
- /**
- * ### .isNotFunction(value, [message])
- *
- * Asserts that `value` is _not_ a function.
- *
- * var serveTea = [ 'heat', 'pour', 'sip' ];
- * assert.isNotFunction(serveTea, 'great, we have listed the steps');
- *
- * @name isNotFunction
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotFunction = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('function');
- };
-
- /**
- * ### .isObject(value, [message])
- *
- * Asserts that `value` is an object (as revealed by
- * `Object.prototype.toString`).
- *
- * var selection = { name: 'Chai', serve: 'with spices' };
- * assert.isObject(selection, 'tea selection is an object');
- *
- * @name isObject
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isObject = function (val, msg) {
- new Assertion(val, msg).to.be.a('object');
- };
-
- /**
- * ### .isNotObject(value, [message])
- *
- * Asserts that `value` is _not_ an object.
- *
- * var selection = 'chai'
- * assert.isNotObject(selection, 'tea selection is not an object');
- * assert.isNotObject(null, 'null is not an object');
- *
- * @name isNotObject
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotObject = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('object');
- };
-
- /**
- * ### .isArray(value, [message])
- *
- * Asserts that `value` is an array.
- *
- * var menu = [ 'green', 'chai', 'oolong' ];
- * assert.isArray(menu, 'what kind of tea do we want?');
- *
- * @name isArray
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isArray = function (val, msg) {
- new Assertion(val, msg).to.be.an('array');
- };
-
- /**
- * ### .isNotArray(value, [message])
- *
- * Asserts that `value` is _not_ an array.
- *
- * var menu = 'green|chai|oolong';
- * assert.isNotArray(menu, 'what kind of tea do we want?');
- *
- * @name isNotArray
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotArray = function (val, msg) {
- new Assertion(val, msg).to.not.be.an('array');
- };
-
- /**
- * ### .isString(value, [message])
- *
- * Asserts that `value` is a string.
- *
- * var teaOrder = 'chai';
- * assert.isString(teaOrder, 'order placed');
- *
- * @name isString
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isString = function (val, msg) {
- new Assertion(val, msg).to.be.a('string');
- };
-
- /**
- * ### .isNotString(value, [message])
- *
- * Asserts that `value` is _not_ a string.
- *
- * var teaOrder = 4;
- * assert.isNotString(teaOrder, 'order placed');
- *
- * @name isNotString
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotString = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('string');
- };
-
- /**
- * ### .isNumber(value, [message])
- *
- * Asserts that `value` is a number.
- *
- * var cups = 2;
- * assert.isNumber(cups, 'how many cups');
- *
- * @name isNumber
- * @param {Number} value
- * @param {String} message
- * @api public
- */
-
- assert.isNumber = function (val, msg) {
- new Assertion(val, msg).to.be.a('number');
- };
-
- /**
- * ### .isNotNumber(value, [message])
- *
- * Asserts that `value` is _not_ a number.
- *
- * var cups = '2 cups please';
- * assert.isNotNumber(cups, 'how many cups');
- *
- * @name isNotNumber
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotNumber = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('number');
- };
-
- /**
- * ### .isBoolean(value, [message])
- *
- * Asserts that `value` is a boolean.
- *
- * var teaReady = true
- * , teaServed = false;
- *
- * assert.isBoolean(teaReady, 'is the tea ready');
- * assert.isBoolean(teaServed, 'has tea been served');
- *
- * @name isBoolean
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isBoolean = function (val, msg) {
- new Assertion(val, msg).to.be.a('boolean');
- };
-
- /**
- * ### .isNotBoolean(value, [message])
- *
- * Asserts that `value` is _not_ a boolean.
- *
- * var teaReady = 'yep'
- * , teaServed = 'nope';
- *
- * assert.isNotBoolean(teaReady, 'is the tea ready');
- * assert.isNotBoolean(teaServed, 'has tea been served');
- *
- * @name isNotBoolean
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.isNotBoolean = function (val, msg) {
- new Assertion(val, msg).to.not.be.a('boolean');
- };
-
- /**
- * ### .typeOf(value, name, [message])
- *
- * Asserts that `value`'s type is `name`, as determined by
- * `Object.prototype.toString`.
- *
- * assert.typeOf({ tea: 'chai' }, 'object', 'we have an object');
- * assert.typeOf(['chai', 'jasmine'], 'array', 'we have an array');
- * assert.typeOf('tea', 'string', 'we have a string');
- * assert.typeOf(/tea/, 'regexp', 'we have a regular expression');
- * assert.typeOf(null, 'null', 'we have a null');
- * assert.typeOf(undefined, 'undefined', 'we have an undefined');
- *
- * @name typeOf
- * @param {Mixed} value
- * @param {String} name
- * @param {String} message
- * @api public
- */
-
- assert.typeOf = function (val, type, msg) {
- new Assertion(val, msg).to.be.a(type);
- };
-
- /**
- * ### .notTypeOf(value, name, [message])
- *
- * Asserts that `value`'s type is _not_ `name`, as determined by
- * `Object.prototype.toString`.
- *
- * assert.notTypeOf('tea', 'number', 'strings are not numbers');
- *
- * @name notTypeOf
- * @param {Mixed} value
- * @param {String} typeof name
- * @param {String} message
- * @api public
- */
-
- assert.notTypeOf = function (val, type, msg) {
- new Assertion(val, msg).to.not.be.a(type);
- };
-
- /**
- * ### .instanceOf(object, constructor, [message])
- *
- * Asserts that `value` is an instance of `constructor`.
- *
- * var Tea = function (name) { this.name = name; }
- * , chai = new Tea('chai');
- *
- * assert.instanceOf(chai, Tea, 'chai is an instance of tea');
- *
- * @name instanceOf
- * @param {Object} object
- * @param {Constructor} constructor
- * @param {String} message
- * @api public
- */
-
- assert.instanceOf = function (val, type, msg) {
- new Assertion(val, msg).to.be.instanceOf(type);
- };
-
- /**
- * ### .notInstanceOf(object, constructor, [message])
- *
- * Asserts `value` is not an instance of `constructor`.
- *
- * var Tea = function (name) { this.name = name; }
- * , chai = new String('chai');
- *
- * assert.notInstanceOf(chai, Tea, 'chai is not an instance of tea');
- *
- * @name notInstanceOf
- * @param {Object} object
- * @param {Constructor} constructor
- * @param {String} message
- * @api public
- */
-
- assert.notInstanceOf = function (val, type, msg) {
- new Assertion(val, msg).to.not.be.instanceOf(type);
- };
-
- /**
- * ### .include(haystack, needle, [message])
- *
- * Asserts that `haystack` includes `needle`. Works
- * for strings and arrays.
- *
- * assert.include('foobar', 'bar', 'foobar contains string "bar"');
- * assert.include([ 1, 2, 3 ], 3, 'array contains value');
- *
- * @name include
- * @param {Array|String} haystack
- * @param {Mixed} needle
- * @param {String} message
- * @api public
- */
-
- assert.include = function (exp, inc, msg) {
- new Assertion(exp, msg, assert.include).include(inc);
- };
-
- /**
- * ### .notInclude(haystack, needle, [message])
- *
- * Asserts that `haystack` does not include `needle`. Works
- * for strings and arrays.
- *
- * assert.notInclude('foobar', 'baz', 'string not include substring');
- * assert.notInclude([ 1, 2, 3 ], 4, 'array not include contain value');
- *
- * @name notInclude
- * @param {Array|String} haystack
- * @param {Mixed} needle
- * @param {String} message
- * @api public
- */
-
- assert.notInclude = function (exp, inc, msg) {
- new Assertion(exp, msg, assert.notInclude).not.include(inc);
- };
-
- /**
- * ### .match(value, regexp, [message])
- *
- * Asserts that `value` matches the regular expression `regexp`.
- *
- * assert.match('foobar', /^foo/, 'regexp matches');
- *
- * @name match
- * @param {Mixed} value
- * @param {RegExp} regexp
- * @param {String} message
- * @api public
- */
-
- assert.match = function (exp, re, msg) {
- new Assertion(exp, msg).to.match(re);
- };
-
- /**
- * ### .notMatch(value, regexp, [message])
- *
- * Asserts that `value` does not match the regular expression `regexp`.
- *
- * assert.notMatch('foobar', /^foo/, 'regexp does not match');
- *
- * @name notMatch
- * @param {Mixed} value
- * @param {RegExp} regexp
- * @param {String} message
- * @api public
- */
-
- assert.notMatch = function (exp, re, msg) {
- new Assertion(exp, msg).to.not.match(re);
- };
-
- /**
- * ### .property(object, property, [message])
- *
- * Asserts that `object` has a property named by `property`.
- *
- * assert.property({ tea: { green: 'matcha' }}, 'tea');
- *
- * @name property
- * @param {Object} object
- * @param {String} property
- * @param {String} message
- * @api public
- */
-
- assert.property = function (obj, prop, msg) {
- new Assertion(obj, msg).to.have.property(prop);
- };
-
- /**
- * ### .notProperty(object, property, [message])
- *
- * Asserts that `object` does _not_ have a property named by `property`.
- *
- * assert.notProperty({ tea: { green: 'matcha' }}, 'coffee');
- *
- * @name notProperty
- * @param {Object} object
- * @param {String} property
- * @param {String} message
- * @api public
- */
-
- assert.notProperty = function (obj, prop, msg) {
- new Assertion(obj, msg).to.not.have.property(prop);
- };
-
- /**
- * ### .deepProperty(object, property, [message])
- *
- * Asserts that `object` has a property named by `property`, which can be a
- * string using dot- and bracket-notation for deep reference.
- *
- * assert.deepProperty({ tea: { green: 'matcha' }}, 'tea.green');
- *
- * @name deepProperty
- * @param {Object} object
- * @param {String} property
- * @param {String} message
- * @api public
- */
-
- assert.deepProperty = function (obj, prop, msg) {
- new Assertion(obj, msg).to.have.deep.property(prop);
- };
-
- /**
- * ### .notDeepProperty(object, property, [message])
- *
- * Asserts that `object` does _not_ have a property named by `property`, which
- * can be a string using dot- and bracket-notation for deep reference.
- *
- * assert.notDeepProperty({ tea: { green: 'matcha' }}, 'tea.oolong');
- *
- * @name notDeepProperty
- * @param {Object} object
- * @param {String} property
- * @param {String} message
- * @api public
- */
-
- assert.notDeepProperty = function (obj, prop, msg) {
- new Assertion(obj, msg).to.not.have.deep.property(prop);
- };
-
- /**
- * ### .propertyVal(object, property, value, [message])
- *
- * Asserts that `object` has a property named by `property` with value given
- * by `value`.
- *
- * assert.propertyVal({ tea: 'is good' }, 'tea', 'is good');
- *
- * @name propertyVal
- * @param {Object} object
- * @param {String} property
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.propertyVal = function (obj, prop, val, msg) {
- new Assertion(obj, msg).to.have.property(prop, val);
- };
-
- /**
- * ### .propertyNotVal(object, property, value, [message])
- *
- * Asserts that `object` has a property named by `property`, but with a value
- * different from that given by `value`.
- *
- * assert.propertyNotVal({ tea: 'is good' }, 'tea', 'is bad');
- *
- * @name propertyNotVal
- * @param {Object} object
- * @param {String} property
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.propertyNotVal = function (obj, prop, val, msg) {
- new Assertion(obj, msg).to.not.have.property(prop, val);
- };
-
- /**
- * ### .deepPropertyVal(object, property, value, [message])
- *
- * Asserts that `object` has a property named by `property` with value given
- * by `value`. `property` can use dot- and bracket-notation for deep
- * reference.
- *
- * assert.deepPropertyVal({ tea: { green: 'matcha' }}, 'tea.green', 'matcha');
- *
- * @name deepPropertyVal
- * @param {Object} object
- * @param {String} property
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.deepPropertyVal = function (obj, prop, val, msg) {
- new Assertion(obj, msg).to.have.deep.property(prop, val);
- };
-
- /**
- * ### .deepPropertyNotVal(object, property, value, [message])
- *
- * Asserts that `object` has a property named by `property`, but with a value
- * different from that given by `value`. `property` can use dot- and
- * bracket-notation for deep reference.
- *
- * assert.deepPropertyNotVal({ tea: { green: 'matcha' }}, 'tea.green', 'konacha');
- *
- * @name deepPropertyNotVal
- * @param {Object} object
- * @param {String} property
- * @param {Mixed} value
- * @param {String} message
- * @api public
- */
-
- assert.deepPropertyNotVal = function (obj, prop, val, msg) {
- new Assertion(obj, msg).to.not.have.deep.property(prop, val);
- };
-
- /**
- * ### .lengthOf(object, length, [message])
- *
- * Asserts that `object` has a `length` property with the expected value.
- *
- * assert.lengthOf([1,2,3], 3, 'array has length of 3');
- * assert.lengthOf('foobar', 5, 'string has length of 6');
- *
- * @name lengthOf
- * @param {Mixed} object
- * @param {Number} length
- * @param {String} message
- * @api public
- */
-
- assert.lengthOf = function (exp, len, msg) {
- new Assertion(exp, msg).to.have.length(len);
- };
-
- /**
- * ### .throws(function, [constructor/string/regexp], [string/regexp], [message])
- *
- * Asserts that `function` will throw an error that is an instance of
- * `constructor`, or alternately that it will throw an error with message
- * matching `regexp`.
- *
- * assert.throw(fn, 'function throws a reference error');
- * assert.throw(fn, /function throws a reference error/);
- * assert.throw(fn, ReferenceError);
- * assert.throw(fn, ReferenceError, 'function throws a reference error');
- * assert.throw(fn, ReferenceError, /function throws a reference error/);
- *
- * @name throws
- * @alias throw
- * @alias Throw
- * @param {Function} function
- * @param {ErrorConstructor} constructor
- * @param {RegExp} regexp
- * @param {String} message
- * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
- * @api public
- */
-
- assert.Throw = function (fn, errt, errs, msg) {
- if ('string' === typeof errt || errt instanceof RegExp) {
- errs = errt;
- errt = null;
- }
-
- var assertErr = new Assertion(fn, msg).to.Throw(errt, errs);
- return flag(assertErr, 'object');
- };
-
- /**
- * ### .doesNotThrow(function, [constructor/regexp], [message])
- *
- * Asserts that `function` will _not_ throw an error that is an instance of
- * `constructor`, or alternately that it will not throw an error with message
- * matching `regexp`.
- *
- * assert.doesNotThrow(fn, Error, 'function does not throw');
- *
- * @name doesNotThrow
- * @param {Function} function
- * @param {ErrorConstructor} constructor
- * @param {RegExp} regexp
- * @param {String} message
- * @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
- * @api public
- */
-
- assert.doesNotThrow = function (fn, type, msg) {
- if ('string' === typeof type) {
- msg = type;
- type = null;
- }
-
- new Assertion(fn, msg).to.not.Throw(type);
- };
-
- /**
- * ### .operator(val1, operator, val2, [message])
- *
- * Compares two values using `operator`.
- *
- * assert.operator(1, '<', 2, 'everything is ok');
- * assert.operator(1, '>', 2, 'this will fail');
- *
- * @name operator
- * @param {Mixed} val1
- * @param {String} operator
- * @param {Mixed} val2
- * @param {String} message
- * @api public
- */
-
- assert.operator = function (val, operator, val2, msg) {
- var ok;
- switch(operator) {
- case '==':
- ok = val == val2;
- break;
- case '===':
- ok = val === val2;
- break;
- case '>':
- ok = val > val2;
- break;
- case '>=':
- ok = val >= val2;
- break;
- case '<':
- ok = val < val2;
- break;
- case '<=':
- ok = val <= val2;
- break;
- case '!=':
- ok = val != val2;
- break;
- case '!==':
- ok = val !== val2;
- break;
- default:
- throw new Error('Invalid operator "' + operator + '"');
- }
- var test = new Assertion(ok, msg);
- test.assert(
- true === flag(test, 'object')
- , 'expected ' + util.inspect(val) + ' to be ' + operator + ' ' + util.inspect(val2)
- , 'expected ' + util.inspect(val) + ' to not be ' + operator + ' ' + util.inspect(val2) );
- };
-
- /**
- * ### .closeTo(actual, expected, delta, [message])
- *
- * Asserts that the target is equal `expected`, to within a +/- `delta` range.
- *
- * assert.closeTo(1.5, 1, 0.5, 'numbers are close');
- *
- * @name closeTo
- * @param {Number} actual
- * @param {Number} expected
- * @param {Number} delta
- * @param {String} message
- * @api public
- */
-
- assert.closeTo = function (act, exp, delta, msg) {
- new Assertion(act, msg).to.be.closeTo(exp, delta);
- };
-
- /**
- * ### .sameMembers(set1, set2, [message])
- *
- * Asserts that `set1` and `set2` have the same members.
- * Order is not taken into account.
- *
- * assert.sameMembers([ 1, 2, 3 ], [ 2, 1, 3 ], 'same members');
- *
- * @name sameMembers
- * @param {Array} set1
- * @param {Array} set2
- * @param {String} message
- * @api public
- */
-
- assert.sameMembers = function (set1, set2, msg) {
- new Assertion(set1, msg).to.have.same.members(set2);
- }
-
- /**
- * ### .sameDeepMembers(set1, set2, [message])
- *
- * Asserts that `set1` and `set2` have the same members - using a deep equality checking.
- * Order is not taken into account.
- *
- * assert.sameDeepMembers([ {b: 3}, {a: 2}, {c: 5} ], [ {c: 5}, {b: 3}, {a: 2} ], 'same deep members');
- *
- * @name sameDeepMembers
- * @param {Array} set1
- * @param {Array} set2
- * @param {String} message
- * @api public
- */
-
- assert.sameDeepMembers = function (set1, set2, msg) {
- new Assertion(set1, msg).to.have.same.deep.members(set2);
- }
-
- /**
- * ### .includeMembers(superset, subset, [message])
- *
- * Asserts that `subset` is included in `superset`.
- * Order is not taken into account.
- *
- * assert.includeMembers([ 1, 2, 3 ], [ 2, 1 ], 'include members');
- *
- * @name includeMembers
- * @param {Array} superset
- * @param {Array} subset
- * @param {String} message
- * @api public
- */
-
- assert.includeMembers = function (superset, subset, msg) {
- new Assertion(superset, msg).to.include.members(subset);
- }
-
- /**
- * ### .changes(function, object, property)
- *
- * Asserts that a function changes the value of a property
- *
- * var obj = { val: 10 };
- * var fn = function() { obj.val = 22 };
- * assert.changes(fn, obj, 'val');
- *
- * @name changes
- * @param {Function} modifier function
- * @param {Object} object
- * @param {String} property name
- * @param {String} message _optional_
- * @api public
- */
-
- assert.changes = function (fn, obj, prop) {
- new Assertion(fn).to.change(obj, prop);
- }
-
- /**
- * ### .doesNotChange(function, object, property)
- *
- * Asserts that a function does not changes the value of a property
- *
- * var obj = { val: 10 };
- * var fn = function() { console.log('foo'); };
- * assert.doesNotChange(fn, obj, 'val');
- *
- * @name doesNotChange
- * @param {Function} modifier function
- * @param {Object} object
- * @param {String} property name
- * @param {String} message _optional_
- * @api public
- */
-
- assert.doesNotChange = function (fn, obj, prop) {
- new Assertion(fn).to.not.change(obj, prop);
- }
-
- /**
- * ### .increases(function, object, property)
- *
- * Asserts that a function increases an object property
- *
- * var obj = { val: 10 };
- * var fn = function() { obj.val = 13 };
- * assert.increases(fn, obj, 'val');
- *
- * @name increases
- * @param {Function} modifier function
- * @param {Object} object
- * @param {String} property name
- * @param {String} message _optional_
- * @api public
- */
-
- assert.increases = function (fn, obj, prop) {
- new Assertion(fn).to.increase(obj, prop);
- }
-
- /**
- * ### .doesNotIncrease(function, object, property)
- *
- * Asserts that a function does not increase object property
- *
- * var obj = { val: 10 };
- * var fn = function() { obj.val = 8 };
- * assert.doesNotIncrease(fn, obj, 'val');
- *
- * @name doesNotIncrease
- * @param {Function} modifier function
- * @param {Object} object
- * @param {String} property name
- * @param {String} message _optional_
- * @api public
- */
-
- assert.doesNotIncrease = function (fn, obj, prop) {
- new Assertion(fn).to.not.increase(obj, prop);
- }
-
- /**
- * ### .decreases(function, object, property)
- *
- * Asserts that a function decreases an object property
- *
- * var obj = { val: 10 };
- * var fn = function() { obj.val = 5 };
- * assert.decreases(fn, obj, 'val');
- *
- * @name decreases
- * @param {Function} modifier function
- * @param {Object} object
- * @param {String} property name
- * @param {String} message _optional_
- * @api public
- */
-
- assert.decreases = function (fn, obj, prop) {
- new Assertion(fn).to.decrease(obj, prop);
- }
-
- /**
- * ### .doesNotDecrease(function, object, property)
- *
- * Asserts that a function does not decreases an object property
- *
- * var obj = { val: 10 };
- * var fn = function() { obj.val = 15 };
- * assert.doesNotDecrease(fn, obj, 'val');
- *
- * @name doesNotDecrease
- * @param {Function} modifier function
- * @param {Object} object
- * @param {String} property name
- * @param {String} message _optional_
- * @api public
- */
-
- assert.doesNotDecrease = function (fn, obj, prop) {
- new Assertion(fn).to.not.decrease(obj, prop);
- }
-
- /*!
- * ### .ifError(object)
- *
- * Asserts if value is not a false value, and throws if it is a true value.
- * This is added to allow for chai to be a drop-in replacement for Node's
- * assert class.
- *
- * var err = new Error('I am a custom error');
- * assert.ifError(err); // Rethrows err!
- *
- * @name ifError
- * @param {Object} object
- * @api public
- */
-
- assert.ifError = function (val) {
- if (val) {
- throw(val);
- }
- };
-
- /*!
- * Aliases.
- */
-
- (function alias(name, as){
- assert[as] = assert[name];
- return alias;
- })('Throw', 'throw')('Throw', 'throws');
-};
-
-},{}],6:[function(require,module,exports){
-/*!
- * chai
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-module.exports = function (chai, util) {
- chai.expect = function (val, message) {
- return new chai.Assertion(val, message);
- };
-
- /**
- * ### .fail(actual, expected, [message], [operator])
- *
- * Throw a failure.
- *
- * @name fail
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @param {String} operator
- * @api public
- */
-
- chai.expect.fail = function (actual, expected, message, operator) {
- message = message || 'expect.fail()';
- throw new chai.AssertionError(message, {
- actual: actual
- , expected: expected
- , operator: operator
- }, chai.expect.fail);
- };
-};
-
-},{}],7:[function(require,module,exports){
-/*!
- * chai
- * Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-module.exports = function (chai, util) {
- var Assertion = chai.Assertion;
-
- function loadShould () {
- // explicitly define this method as function as to have it's name to include as `ssfi`
- function shouldGetter() {
- if (this instanceof String || this instanceof Number || this instanceof Boolean ) {
- return new Assertion(this.valueOf(), null, shouldGetter);
- }
- return new Assertion(this, null, shouldGetter);
- }
- function shouldSetter(value) {
- // See https://github.com/chaijs/chai/issues/86: this makes
- // `whatever.should = someValue` actually set `someValue`, which is
- // especially useful for `global.should = require('chai').should()`.
- //
- // Note that we have to use [[DefineProperty]] instead of [[Put]]
- // since otherwise we would trigger this very setter!
- Object.defineProperty(this, 'should', {
- value: value,
- enumerable: true,
- configurable: true,
- writable: true
- });
- }
- // modify Object.prototype to have `should`
- Object.defineProperty(Object.prototype, 'should', {
- set: shouldSetter
- , get: shouldGetter
- , configurable: true
- });
-
- var should = {};
-
- /**
- * ### .fail(actual, expected, [message], [operator])
- *
- * Throw a failure.
- *
- * @name fail
- * @param {Mixed} actual
- * @param {Mixed} expected
- * @param {String} message
- * @param {String} operator
- * @api public
- */
-
- should.fail = function (actual, expected, message, operator) {
- message = message || 'should.fail()';
- throw new chai.AssertionError(message, {
- actual: actual
- , expected: expected
- , operator: operator
- }, should.fail);
- };
-
- should.equal = function (val1, val2, msg) {
- new Assertion(val1, msg).to.equal(val2);
- };
-
- should.Throw = function (fn, errt, errs, msg) {
- new Assertion(fn, msg).to.Throw(errt, errs);
- };
-
- should.exist = function (val, msg) {
- new Assertion(val, msg).to.exist;
- }
-
- // negation
- should.not = {}
-
- should.not.equal = function (val1, val2, msg) {
- new Assertion(val1, msg).to.not.equal(val2);
- };
-
- should.not.Throw = function (fn, errt, errs, msg) {
- new Assertion(fn, msg).to.not.Throw(errt, errs);
- };
-
- should.not.exist = function (val, msg) {
- new Assertion(val, msg).to.not.exist;
- }
-
- should['throw'] = should['Throw'];
- should.not['throw'] = should.not['Throw'];
-
- return should;
- }
-
- chai.should = loadShould;
- chai.Should = loadShould;
-};
-
-},{}],8:[function(require,module,exports){
-/*!
- * Chai - addChainingMethod utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependencies
- */
-
-var transferFlags = require('./transferFlags');
-var flag = require('./flag');
-var config = require('../config');
-
-/*!
- * Module variables
- */
-
-// Check whether `__proto__` is supported
-var hasProtoSupport = '__proto__' in Object;
-
-// Without `__proto__` support, this module will need to add properties to a function.
-// However, some Function.prototype methods cannot be overwritten,
-// and there seems no easy cross-platform way to detect them (@see chaijs/chai/issues/69).
-var excludeNames = /^(?:length|name|arguments|caller)$/;
-
-// Cache `Function` properties
-var call = Function.prototype.call,
- apply = Function.prototype.apply;
-
-/**
- * ### addChainableMethod (ctx, name, method, chainingBehavior)
- *
- * Adds a method to an object, such that the method can also be chained.
- *
- * utils.addChainableMethod(chai.Assertion.prototype, 'foo', function (str) {
- * var obj = utils.flag(this, 'object');
- * new chai.Assertion(obj).to.be.equal(str);
- * });
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.addChainableMethod('foo', fn, chainingBehavior);
- *
- * The result can then be used as both a method assertion, executing both `method` and
- * `chainingBehavior`, or as a language chain, which only executes `chainingBehavior`.
- *
- * expect(fooStr).to.be.foo('bar');
- * expect(fooStr).to.be.foo.equal('foo');
- *
- * @param {Object} ctx object to which the method is added
- * @param {String} name of method to add
- * @param {Function} method function to be used for `name`, when called
- * @param {Function} chainingBehavior function to be called every time the property is accessed
- * @name addChainableMethod
- * @api public
- */
-
-module.exports = function (ctx, name, method, chainingBehavior) {
- if (typeof chainingBehavior !== 'function') {
- chainingBehavior = function () { };
- }
-
- var chainableBehavior = {
- method: method
- , chainingBehavior: chainingBehavior
- };
-
- // save the methods so we can overwrite them later, if we need to.
- if (!ctx.__methods) {
- ctx.__methods = {};
- }
- ctx.__methods[name] = chainableBehavior;
-
- Object.defineProperty(ctx, name,
- { get: function () {
- chainableBehavior.chainingBehavior.call(this);
-
- var assert = function assert() {
- var old_ssfi = flag(this, 'ssfi');
- if (old_ssfi && config.includeStack === false)
- flag(this, 'ssfi', assert);
- var result = chainableBehavior.method.apply(this, arguments);
- return result === undefined ? this : result;
- };
-
- // Use `__proto__` if available
- if (hasProtoSupport) {
- // Inherit all properties from the object by replacing the `Function` prototype
- var prototype = assert.__proto__ = Object.create(this);
- // Restore the `call` and `apply` methods from `Function`
- prototype.call = call;
- prototype.apply = apply;
- }
- // Otherwise, redefine all properties (slow!)
- else {
- var asserterNames = Object.getOwnPropertyNames(ctx);
- asserterNames.forEach(function (asserterName) {
- if (!excludeNames.test(asserterName)) {
- var pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
- Object.defineProperty(assert, asserterName, pd);
- }
- });
- }
-
- transferFlags(this, assert);
- return assert;
- }
- , configurable: true
- });
-};
-
-},{"../config":3,"./flag":11,"./transferFlags":27}],9:[function(require,module,exports){
-/*!
- * Chai - addMethod utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-var config = require('../config');
-
-/**
- * ### .addMethod (ctx, name, method)
- *
- * Adds a method to the prototype of an object.
- *
- * utils.addMethod(chai.Assertion.prototype, 'foo', function (str) {
- * var obj = utils.flag(this, 'object');
- * new chai.Assertion(obj).to.be.equal(str);
- * });
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.addMethod('foo', fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(fooStr).to.be.foo('bar');
- *
- * @param {Object} ctx object to which the method is added
- * @param {String} name of method to add
- * @param {Function} method function to be used for name
- * @name addMethod
- * @api public
- */
-var flag = require('./flag');
-
-module.exports = function (ctx, name, method) {
- ctx[name] = function () {
- var old_ssfi = flag(this, 'ssfi');
- if (old_ssfi && config.includeStack === false)
- flag(this, 'ssfi', ctx[name]);
- var result = method.apply(this, arguments);
- return result === undefined ? this : result;
- };
-};
-
-},{"../config":3,"./flag":11}],10:[function(require,module,exports){
-/*!
- * Chai - addProperty utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### addProperty (ctx, name, getter)
- *
- * Adds a property to the prototype of an object.
- *
- * utils.addProperty(chai.Assertion.prototype, 'foo', function () {
- * var obj = utils.flag(this, 'object');
- * new chai.Assertion(obj).to.be.instanceof(Foo);
- * });
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.addProperty('foo', fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(myFoo).to.be.foo;
- *
- * @param {Object} ctx object to which the property is added
- * @param {String} name of property to add
- * @param {Function} getter function to be used for name
- * @name addProperty
- * @api public
- */
-
-module.exports = function (ctx, name, getter) {
- Object.defineProperty(ctx, name,
- { get: function () {
- var result = getter.call(this);
- return result === undefined ? this : result;
- }
- , configurable: true
- });
-};
-
-},{}],11:[function(require,module,exports){
-/*!
- * Chai - flag utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### flag(object, key, [value])
- *
- * Get or set a flag value on an object. If a
- * value is provided it will be set, else it will
- * return the currently set value or `undefined` if
- * the value is not set.
- *
- * utils.flag(this, 'foo', 'bar'); // setter
- * utils.flag(this, 'foo'); // getter, returns `bar`
- *
- * @param {Object} object constructed Assertion
- * @param {String} key
- * @param {Mixed} value (optional)
- * @name flag
- * @api private
- */
-
-module.exports = function (obj, key, value) {
- var flags = obj.__flags || (obj.__flags = Object.create(null));
- if (arguments.length === 3) {
- flags[key] = value;
- } else {
- return flags[key];
- }
-};
-
-},{}],12:[function(require,module,exports){
-/*!
- * Chai - getActual utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * # getActual(object, [actual])
- *
- * Returns the `actual` value for an Assertion
- *
- * @param {Object} object (constructed Assertion)
- * @param {Arguments} chai.Assertion.prototype.assert arguments
- */
-
-module.exports = function (obj, args) {
- return args.length > 4 ? args[4] : obj._obj;
-};
-
-},{}],13:[function(require,module,exports){
-/*!
- * Chai - getEnumerableProperties utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### .getEnumerableProperties(object)
- *
- * This allows the retrieval of enumerable property names of an object,
- * inherited or not.
- *
- * @param {Object} object
- * @returns {Array}
- * @name getEnumerableProperties
- * @api public
- */
-
-module.exports = function getEnumerableProperties(object) {
- var result = [];
- for (var name in object) {
- result.push(name);
- }
- return result;
-};
-
-},{}],14:[function(require,module,exports){
-/*!
- * Chai - message composition utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependancies
- */
-
-var flag = require('./flag')
- , getActual = require('./getActual')
- , inspect = require('./inspect')
- , objDisplay = require('./objDisplay');
-
-/**
- * ### .getMessage(object, message, negateMessage)
- *
- * Construct the error message based on flags
- * and template tags. Template tags will return
- * a stringified inspection of the object referenced.
- *
- * Message template tags:
- * - `#{this}` current asserted object
- * - `#{act}` actual value
- * - `#{exp}` expected value
- *
- * @param {Object} object (constructed Assertion)
- * @param {Arguments} chai.Assertion.prototype.assert arguments
- * @name getMessage
- * @api public
- */
-
-module.exports = function (obj, args) {
- var negate = flag(obj, 'negate')
- , val = flag(obj, 'object')
- , expected = args[3]
- , actual = getActual(obj, args)
- , msg = negate ? args[2] : args[1]
- , flagMsg = flag(obj, 'message');
-
- if(typeof msg === "function") msg = msg();
- msg = msg || '';
- msg = msg
- .replace(/#{this}/g, objDisplay(val))
- .replace(/#{act}/g, objDisplay(actual))
- .replace(/#{exp}/g, objDisplay(expected));
-
- return flagMsg ? flagMsg + ': ' + msg : msg;
-};
-
-},{"./flag":11,"./getActual":12,"./inspect":21,"./objDisplay":22}],15:[function(require,module,exports){
-/*!
- * Chai - getName utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * # getName(func)
- *
- * Gets the name of a function, in a cross-browser way.
- *
- * @param {Function} a function (usually a constructor)
- */
-
-module.exports = function (func) {
- if (func.name) return func.name;
-
- var match = /^\s?function ([^(]*)\(/.exec(func);
- return match && match[1] ? match[1] : "";
-};
-
-},{}],16:[function(require,module,exports){
-/*!
- * Chai - getPathInfo utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-var hasProperty = require('./hasProperty');
-
-/**
- * ### .getPathInfo(path, object)
- *
- * This allows the retrieval of property info in an
- * object given a string path.
- *
- * The path info consists of an object with the
- * following properties:
- *
- * * parent - The parent object of the property referenced by `path`
- * * name - The name of the final property, a number if it was an array indexer
- * * value - The value of the property, if it exists, otherwise `undefined`
- * * exists - Whether the property exists or not
- *
- * @param {String} path
- * @param {Object} object
- * @returns {Object} info
- * @name getPathInfo
- * @api public
- */
-
-module.exports = function getPathInfo(path, obj) {
- var parsed = parsePath(path),
- last = parsed[parsed.length - 1];
-
- var info = {
- parent: parsed.length > 1 ? _getPathValue(parsed, obj, parsed.length - 1) : obj,
- name: last.p || last.i,
- value: _getPathValue(parsed, obj)
- };
- info.exists = hasProperty(info.name, info.parent);
-
- return info;
-};
-
-
-/*!
- * ## parsePath(path)
- *
- * Helper function used to parse string object
- * paths. Use in conjunction with `_getPathValue`.
- *
- * var parsed = parsePath('myobject.property.subprop');
- *
- * ### Paths:
- *
- * * Can be as near infinitely deep and nested
- * * Arrays are also valid using the formal `myobject.document[3].property`.
- * * Literal dots and brackets (not delimiter) must be backslash-escaped.
- *
- * @param {String} path
- * @returns {Object} parsed
- * @api private
- */
-
-function parsePath (path) {
- var str = path.replace(/([^\\])\[/g, '$1.[')
- , parts = str.match(/(\\\.|[^.]+?)+/g);
- return parts.map(function (value) {
- var re = /^\[(\d+)\]$/
- , mArr = re.exec(value);
- if (mArr) return { i: parseFloat(mArr[1]) };
- else return { p: value.replace(/\\([.\[\]])/g, '$1') };
- });
-}
-
-
-/*!
- * ## _getPathValue(parsed, obj)
- *
- * Helper companion function for `.parsePath` that returns
- * the value located at the parsed address.
- *
- * var value = getPathValue(parsed, obj);
- *
- * @param {Object} parsed definition from `parsePath`.
- * @param {Object} object to search against
- * @param {Number} object to search against
- * @returns {Object|Undefined} value
- * @api private
- */
-
-function _getPathValue (parsed, obj, index) {
- var tmp = obj
- , res;
-
- index = (index === undefined ? parsed.length : index);
-
- for (var i = 0, l = index; i < l; i++) {
- var part = parsed[i];
- if (tmp) {
- if ('undefined' !== typeof part.p)
- tmp = tmp[part.p];
- else if ('undefined' !== typeof part.i)
- tmp = tmp[part.i];
- if (i == (l - 1)) res = tmp;
- } else {
- res = undefined;
- }
- }
- return res;
-}
-
-},{"./hasProperty":19}],17:[function(require,module,exports){
-/*!
- * Chai - getPathValue utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * @see https://github.com/logicalparadox/filtr
- * MIT Licensed
- */
-
-var getPathInfo = require('./getPathInfo');
-
-/**
- * ### .getPathValue(path, object)
- *
- * This allows the retrieval of values in an
- * object given a string path.
- *
- * var obj = {
- * prop1: {
- * arr: ['a', 'b', 'c']
- * , str: 'Hello'
- * }
- * , prop2: {
- * arr: [ { nested: 'Universe' } ]
- * , str: 'Hello again!'
- * }
- * }
- *
- * The following would be the results.
- *
- * getPathValue('prop1.str', obj); // Hello
- * getPathValue('prop1.att[2]', obj); // b
- * getPathValue('prop2.arr[0].nested', obj); // Universe
- *
- * @param {String} path
- * @param {Object} object
- * @returns {Object} value or `undefined`
- * @name getPathValue
- * @api public
- */
-module.exports = function(path, obj) {
- var info = getPathInfo(path, obj);
- return info.value;
-};
-
-},{"./getPathInfo":16}],18:[function(require,module,exports){
-/*!
- * Chai - getProperties utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### .getProperties(object)
- *
- * This allows the retrieval of property names of an object, enumerable or not,
- * inherited or not.
- *
- * @param {Object} object
- * @returns {Array}
- * @name getProperties
- * @api public
- */
-
-module.exports = function getProperties(object) {
- var result = Object.getOwnPropertyNames(subject);
-
- function addProperty(property) {
- if (result.indexOf(property) === -1) {
- result.push(property);
- }
- }
-
- var proto = Object.getPrototypeOf(subject);
- while (proto !== null) {
- Object.getOwnPropertyNames(proto).forEach(addProperty);
- proto = Object.getPrototypeOf(proto);
- }
-
- return result;
-};
-
-},{}],19:[function(require,module,exports){
-/*!
- * Chai - hasProperty utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-var type = require('type-detect');
-
-/**
- * ### .hasProperty(object, name)
- *
- * This allows checking whether an object has
- * named property or numeric array index.
- *
- * Basically does the same thing as the `in`
- * operator but works properly with natives
- * and null/undefined values.
- *
- * var obj = {
- * arr: ['a', 'b', 'c']
- * , str: 'Hello'
- * }
- *
- * The following would be the results.
- *
- * hasProperty('str', obj); // true
- * hasProperty('constructor', obj); // true
- * hasProperty('bar', obj); // false
- *
- * hasProperty('length', obj.str); // true
- * hasProperty(1, obj.str); // true
- * hasProperty(5, obj.str); // false
- *
- * hasProperty('length', obj.arr); // true
- * hasProperty(2, obj.arr); // true
- * hasProperty(3, obj.arr); // false
- *
- * @param {Objuect} object
- * @param {String|Number} name
- * @returns {Boolean} whether it exists
- * @name getPathInfo
- * @api public
- */
-
-var literals = {
- 'number': Number
- , 'string': String
-};
-
-module.exports = function hasProperty(name, obj) {
- var ot = type(obj);
-
- // Bad Object, obviously no props at all
- if(ot === 'null' || ot === 'undefined')
- return false;
-
- // The `in` operator does not work with certain literals
- // box these before the check
- if(literals[ot] && typeof obj !== 'object')
- obj = new literals[ot](obj);
-
- return name in obj;
-};
-
-},{"type-detect":33}],20:[function(require,module,exports){
-/*!
- * chai
- * Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Main exports
- */
-
-exports = module.exports = {};
-
-/*!
- * test utility
- */
-
-exports.test = require('./test');
-
-/*!
- * type utility
- */
-
-exports.type = require('type-detect');
-
-/*!
- * message utility
- */
-
-exports.getMessage = require('./getMessage');
-
-/*!
- * actual utility
- */
-
-exports.getActual = require('./getActual');
-
-/*!
- * Inspect util
- */
-
-exports.inspect = require('./inspect');
-
-/*!
- * Object Display util
- */
-
-exports.objDisplay = require('./objDisplay');
-
-/*!
- * Flag utility
- */
-
-exports.flag = require('./flag');
-
-/*!
- * Flag transferring utility
- */
-
-exports.transferFlags = require('./transferFlags');
-
-/*!
- * Deep equal utility
- */
-
-exports.eql = require('deep-eql');
-
-/*!
- * Deep path value
- */
-
-exports.getPathValue = require('./getPathValue');
-
-/*!
- * Deep path info
- */
-
-exports.getPathInfo = require('./getPathInfo');
-
-/*!
- * Check if a property exists
- */
-
-exports.hasProperty = require('./hasProperty');
-
-/*!
- * Function name
- */
-
-exports.getName = require('./getName');
-
-/*!
- * add Property
- */
-
-exports.addProperty = require('./addProperty');
-
-/*!
- * add Method
- */
-
-exports.addMethod = require('./addMethod');
-
-/*!
- * overwrite Property
- */
-
-exports.overwriteProperty = require('./overwriteProperty');
-
-/*!
- * overwrite Method
- */
-
-exports.overwriteMethod = require('./overwriteMethod');
-
-/*!
- * Add a chainable method
- */
-
-exports.addChainableMethod = require('./addChainableMethod');
-
-/*!
- * Overwrite chainable method
- */
-
-exports.overwriteChainableMethod = require('./overwriteChainableMethod');
-
-
-},{"./addChainableMethod":8,"./addMethod":9,"./addProperty":10,"./flag":11,"./getActual":12,"./getMessage":14,"./getName":15,"./getPathInfo":16,"./getPathValue":17,"./hasProperty":19,"./inspect":21,"./objDisplay":22,"./overwriteChainableMethod":23,"./overwriteMethod":24,"./overwriteProperty":25,"./test":26,"./transferFlags":27,"deep-eql":29,"type-detect":33}],21:[function(require,module,exports){
-// This is (almost) directly from Node.js utils
-// https://github.com/joyent/node/blob/f8c335d0caf47f16d31413f89aa28eda3878e3aa/lib/util.js
-
-var getName = require('./getName');
-var getProperties = require('./getProperties');
-var getEnumerableProperties = require('./getEnumerableProperties');
-
-module.exports = inspect;
-
-/**
- * Echos the value of a value. Trys to print the value out
- * in the best way possible given the different types.
- *
- * @param {Object} obj The object to print out.
- * @param {Boolean} showHidden Flag that shows hidden (not enumerable)
- * properties of objects.
- * @param {Number} depth Depth in which to descend in object. Default is 2.
- * @param {Boolean} colors Flag to turn on ANSI escape codes to color the
- * output. Default is false (no coloring).
- */
-function inspect(obj, showHidden, depth, colors) {
- var ctx = {
- showHidden: showHidden,
- seen: [],
- stylize: function (str) { return str; }
- };
- return formatValue(ctx, obj, (typeof depth === 'undefined' ? 2 : depth));
-}
-
-// Returns true if object is a DOM element.
-var isDOMElement = function (object) {
- if (typeof HTMLElement === 'object') {
- return object instanceof HTMLElement;
- } else {
- return object &&
- typeof object === 'object' &&
- object.nodeType === 1 &&
- typeof object.nodeName === 'string';
- }
-};
-
-function formatValue(ctx, value, recurseTimes) {
- // Provide a hook for user-specified inspect functions.
- // Check that value is an object with an inspect function on it
- if (value && typeof value.inspect === 'function' &&
- // Filter out the util module, it's inspect function is special
- value.inspect !== exports.inspect &&
- // Also filter out any prototype objects using the circular check.
- !(value.constructor && value.constructor.prototype === value)) {
- var ret = value.inspect(recurseTimes);
- if (typeof ret !== 'string') {
- ret = formatValue(ctx, ret, recurseTimes);
- }
- return ret;
- }
-
- // Primitive types cannot have properties
- var primitive = formatPrimitive(ctx, value);
- if (primitive) {
- return primitive;
- }
-
- // If this is a DOM element, try to get the outer HTML.
- if (isDOMElement(value)) {
- if ('outerHTML' in value) {
- return value.outerHTML;
- // This value does not have an outerHTML attribute,
- // it could still be an XML element
- } else {
- // Attempt to serialize it
- try {
- if (document.xmlVersion) {
- var xmlSerializer = new XMLSerializer();
- return xmlSerializer.serializeToString(value);
- } else {
- // Firefox 11- do not support outerHTML
- // It does, however, support innerHTML
- // Use the following to render the element
- var ns = "http://www.w3.org/1999/xhtml";
- var container = document.createElementNS(ns, '_');
-
- container.appendChild(value.cloneNode(false));
- html = container.innerHTML
- .replace('><', '>' + value.innerHTML + '<');
- container.innerHTML = '';
- return html;
- }
- } catch (err) {
- // This could be a non-native DOM implementation,
- // continue with the normal flow:
- // printing the element as if it is an object.
- }
- }
- }
-
- // Look up the keys of the object.
- var visibleKeys = getEnumerableProperties(value);
- var keys = ctx.showHidden ? getProperties(value) : visibleKeys;
-
- // Some type of object without properties can be shortcutted.
- // In IE, errors have a single `stack` property, or if they are vanilla `Error`,
- // a `stack` plus `description` property; ignore those for consistency.
- if (keys.length === 0 || (isError(value) && (
- (keys.length === 1 && keys[0] === 'stack') ||
- (keys.length === 2 && keys[0] === 'description' && keys[1] === 'stack')
- ))) {
- if (typeof value === 'function') {
- var name = getName(value);
- var nameSuffix = name ? ': ' + name : '';
- return ctx.stylize('[Function' + nameSuffix + ']', 'special');
- }
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- }
- if (isDate(value)) {
- return ctx.stylize(Date.prototype.toUTCString.call(value), 'date');
- }
- if (isError(value)) {
- return formatError(value);
- }
- }
-
- var base = '', array = false, braces = ['{', '}'];
-
- // Make Array say that they are Array
- if (isArray(value)) {
- array = true;
- braces = ['[', ']'];
- }
-
- // Make functions say that they are functions
- if (typeof value === 'function') {
- name = getName(value);
- nameSuffix = name ? ': ' + name : '';
- base = ' [Function' + nameSuffix + ']';
- }
-
- // Make RegExps say that they are RegExps
- if (isRegExp(value)) {
- base = ' ' + RegExp.prototype.toString.call(value);
- }
-
- // Make dates with properties first say the date
- if (isDate(value)) {
- base = ' ' + Date.prototype.toUTCString.call(value);
- }
-
- // Make error with message first say the error
- if (isError(value)) {
- return formatError(value);
- }
-
- if (keys.length === 0 && (!array || value.length == 0)) {
- return braces[0] + base + braces[1];
- }
-
- if (recurseTimes < 0) {
- if (isRegExp(value)) {
- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
- } else {
- return ctx.stylize('[Object]', 'special');
- }
- }
-
- ctx.seen.push(value);
-
- var output;
- if (array) {
- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
- } else {
- output = keys.map(function(key) {
- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
- });
- }
-
- ctx.seen.pop();
-
- return reduceToSingleString(output, base, braces);
-}
-
-
-function formatPrimitive(ctx, value) {
- switch (typeof value) {
- case 'undefined':
- return ctx.stylize('undefined', 'undefined');
-
- case 'string':
- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
- .replace(/'/g, "\\'")
- .replace(/\\"/g, '"') + '\'';
- return ctx.stylize(simple, 'string');
-
- case 'number':
- if (value === 0 && (1/value) === -Infinity) {
- return ctx.stylize('-0', 'number');
- }
- return ctx.stylize('' + value, 'number');
-
- case 'boolean':
- return ctx.stylize('' + value, 'boolean');
- }
- // For some reason typeof null is "object", so special case here.
- if (value === null) {
- return ctx.stylize('null', 'null');
- }
-}
-
-
-function formatError(value) {
- return '[' + Error.prototype.toString.call(value) + ']';
-}
-
-
-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
- var output = [];
- for (var i = 0, l = value.length; i < l; ++i) {
- if (Object.prototype.hasOwnProperty.call(value, String(i))) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- String(i), true));
- } else {
- output.push('');
- }
- }
- keys.forEach(function(key) {
- if (!key.match(/^\d+$/)) {
- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
- key, true));
- }
- });
- return output;
-}
-
-
-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
- var name, str;
- if (value.__lookupGetter__) {
- if (value.__lookupGetter__(key)) {
- if (value.__lookupSetter__(key)) {
- str = ctx.stylize('[Getter/Setter]', 'special');
- } else {
- str = ctx.stylize('[Getter]', 'special');
- }
- } else {
- if (value.__lookupSetter__(key)) {
- str = ctx.stylize('[Setter]', 'special');
- }
- }
- }
- if (visibleKeys.indexOf(key) < 0) {
- name = '[' + key + ']';
- }
- if (!str) {
- if (ctx.seen.indexOf(value[key]) < 0) {
- if (recurseTimes === null) {
- str = formatValue(ctx, value[key], null);
- } else {
- str = formatValue(ctx, value[key], recurseTimes - 1);
- }
- if (str.indexOf('\n') > -1) {
- if (array) {
- str = str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n').substr(2);
- } else {
- str = '\n' + str.split('\n').map(function(line) {
- return ' ' + line;
- }).join('\n');
- }
- }
- } else {
- str = ctx.stylize('[Circular]', 'special');
- }
- }
- if (typeof name === 'undefined') {
- if (array && key.match(/^\d+$/)) {
- return str;
- }
- name = JSON.stringify('' + key);
- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
- name = name.substr(1, name.length - 2);
- name = ctx.stylize(name, 'name');
- } else {
- name = name.replace(/'/g, "\\'")
- .replace(/\\"/g, '"')
- .replace(/(^"|"$)/g, "'");
- name = ctx.stylize(name, 'string');
- }
- }
-
- return name + ': ' + str;
-}
-
-
-function reduceToSingleString(output, base, braces) {
- var numLinesEst = 0;
- var length = output.reduce(function(prev, cur) {
- numLinesEst++;
- if (cur.indexOf('\n') >= 0) numLinesEst++;
- return prev + cur.length + 1;
- }, 0);
-
- if (length > 60) {
- return braces[0] +
- (base === '' ? '' : base + '\n ') +
- ' ' +
- output.join(',\n ') +
- ' ' +
- braces[1];
- }
-
- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
-}
-
-function isArray(ar) {
- return Array.isArray(ar) ||
- (typeof ar === 'object' && objectToString(ar) === '[object Array]');
-}
-
-function isRegExp(re) {
- return typeof re === 'object' && objectToString(re) === '[object RegExp]';
-}
-
-function isDate(d) {
- return typeof d === 'object' && objectToString(d) === '[object Date]';
-}
-
-function isError(e) {
- return typeof e === 'object' && objectToString(e) === '[object Error]';
-}
-
-function objectToString(o) {
- return Object.prototype.toString.call(o);
-}
-
-},{"./getEnumerableProperties":13,"./getName":15,"./getProperties":18}],22:[function(require,module,exports){
-/*!
- * Chai - flag utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependancies
- */
-
-var inspect = require('./inspect');
-var config = require('../config');
-
-/**
- * ### .objDisplay (object)
- *
- * Determines if an object or an array matches
- * criteria to be inspected in-line for error
- * messages or should be truncated.
- *
- * @param {Mixed} javascript object to inspect
- * @name objDisplay
- * @api public
- */
-
-module.exports = function (obj) {
- var str = inspect(obj)
- , type = Object.prototype.toString.call(obj);
-
- if (config.truncateThreshold && str.length >= config.truncateThreshold) {
- if (type === '[object Function]') {
- return !obj.name || obj.name === ''
- ? '[Function]'
- : '[Function: ' + obj.name + ']';
- } else if (type === '[object Array]') {
- return '[ Array(' + obj.length + ') ]';
- } else if (type === '[object Object]') {
- var keys = Object.keys(obj)
- , kstr = keys.length > 2
- ? keys.splice(0, 2).join(', ') + ', ...'
- : keys.join(', ');
- return '{ Object (' + kstr + ') }';
- } else {
- return str;
- }
- } else {
- return str;
- }
-};
-
-},{"../config":3,"./inspect":21}],23:[function(require,module,exports){
-/*!
- * Chai - overwriteChainableMethod utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### overwriteChainableMethod (ctx, name, method, chainingBehavior)
- *
- * Overwites an already existing chainable method
- * and provides access to the previous function or
- * property. Must return functions to be used for
- * name.
- *
- * utils.overwriteChainableMethod(chai.Assertion.prototype, 'length',
- * function (_super) {
- * }
- * , function (_super) {
- * }
- * );
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.overwriteChainableMethod('foo', fn, fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(myFoo).to.have.length(3);
- * expect(myFoo).to.have.length.above(3);
- *
- * @param {Object} ctx object whose method / property is to be overwritten
- * @param {String} name of method / property to overwrite
- * @param {Function} method function that returns a function to be used for name
- * @param {Function} chainingBehavior function that returns a function to be used for property
- * @name overwriteChainableMethod
- * @api public
- */
-
-module.exports = function (ctx, name, method, chainingBehavior) {
- var chainableBehavior = ctx.__methods[name];
-
- var _chainingBehavior = chainableBehavior.chainingBehavior;
- chainableBehavior.chainingBehavior = function () {
- var result = chainingBehavior(_chainingBehavior).call(this);
- return result === undefined ? this : result;
- };
-
- var _method = chainableBehavior.method;
- chainableBehavior.method = function () {
- var result = method(_method).apply(this, arguments);
- return result === undefined ? this : result;
- };
-};
-
-},{}],24:[function(require,module,exports){
-/*!
- * Chai - overwriteMethod utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### overwriteMethod (ctx, name, fn)
- *
- * Overwites an already existing method and provides
- * access to previous function. Must return function
- * to be used for name.
- *
- * utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) {
- * return function (str) {
- * var obj = utils.flag(this, 'object');
- * if (obj instanceof Foo) {
- * new chai.Assertion(obj.value).to.equal(str);
- * } else {
- * _super.apply(this, arguments);
- * }
- * }
- * });
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.overwriteMethod('foo', fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(myFoo).to.equal('bar');
- *
- * @param {Object} ctx object whose method is to be overwritten
- * @param {String} name of method to overwrite
- * @param {Function} method function that returns a function to be used for name
- * @name overwriteMethod
- * @api public
- */
-
-module.exports = function (ctx, name, method) {
- var _method = ctx[name]
- , _super = function () { return this; };
-
- if (_method && 'function' === typeof _method)
- _super = _method;
-
- ctx[name] = function () {
- var result = method(_super).apply(this, arguments);
- return result === undefined ? this : result;
- }
-};
-
-},{}],25:[function(require,module,exports){
-/*!
- * Chai - overwriteProperty utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### overwriteProperty (ctx, name, fn)
- *
- * Overwites an already existing property getter and provides
- * access to previous value. Must return function to use as getter.
- *
- * utils.overwriteProperty(chai.Assertion.prototype, 'ok', function (_super) {
- * return function () {
- * var obj = utils.flag(this, 'object');
- * if (obj instanceof Foo) {
- * new chai.Assertion(obj.name).to.equal('bar');
- * } else {
- * _super.call(this);
- * }
- * }
- * });
- *
- *
- * Can also be accessed directly from `chai.Assertion`.
- *
- * chai.Assertion.overwriteProperty('foo', fn);
- *
- * Then can be used as any other assertion.
- *
- * expect(myFoo).to.be.ok;
- *
- * @param {Object} ctx object whose property is to be overwritten
- * @param {String} name of property to overwrite
- * @param {Function} getter function that returns a getter function to be used for name
- * @name overwriteProperty
- * @api public
- */
-
-module.exports = function (ctx, name, getter) {
- var _get = Object.getOwnPropertyDescriptor(ctx, name)
- , _super = function () {};
-
- if (_get && 'function' === typeof _get.get)
- _super = _get.get
-
- Object.defineProperty(ctx, name,
- { get: function () {
- var result = getter(_super).call(this);
- return result === undefined ? this : result;
- }
- , configurable: true
- });
-};
-
-},{}],26:[function(require,module,exports){
-/*!
- * Chai - test utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependancies
- */
-
-var flag = require('./flag');
-
-/**
- * # test(object, expression)
- *
- * Test and object for expression.
- *
- * @param {Object} object (constructed Assertion)
- * @param {Arguments} chai.Assertion.prototype.assert arguments
- */
-
-module.exports = function (obj, args) {
- var negate = flag(obj, 'negate')
- , expr = args[0];
- return negate ? !expr : expr;
-};
-
-},{"./flag":11}],27:[function(require,module,exports){
-/*!
- * Chai - transferFlags utility
- * Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/**
- * ### transferFlags(assertion, object, includeAll = true)
- *
- * Transfer all the flags for `assertion` to `object`. If
- * `includeAll` is set to `false`, then the base Chai
- * assertion flags (namely `object`, `ssfi`, and `message`)
- * will not be transferred.
- *
- *
- * var newAssertion = new Assertion();
- * utils.transferFlags(assertion, newAssertion);
- *
- * var anotherAsseriton = new Assertion(myObj);
- * utils.transferFlags(assertion, anotherAssertion, false);
- *
- * @param {Assertion} assertion the assertion to transfer the flags from
- * @param {Object} object the object to transfer the flags to; usually a new assertion
- * @param {Boolean} includeAll
- * @name transferFlags
- * @api private
- */
-
-module.exports = function (assertion, object, includeAll) {
- var flags = assertion.__flags || (assertion.__flags = Object.create(null));
-
- if (!object.__flags) {
- object.__flags = Object.create(null);
- }
-
- includeAll = arguments.length === 3 ? includeAll : true;
-
- for (var flag in flags) {
- if (includeAll ||
- (flag !== 'object' && flag !== 'ssfi' && flag != 'message')) {
- object.__flags[flag] = flags[flag];
- }
- }
-};
-
-},{}],28:[function(require,module,exports){
-/*!
- * assertion-error
- * Copyright(c) 2013 Jake Luer <jake@qualiancy.com>
- * MIT Licensed
- */
-
-/*!
- * Return a function that will copy properties from
- * one object to another excluding any originally
- * listed. Returned function will create a new `{}`.
- *
- * @param {String} excluded properties ...
- * @return {Function}
- */
-
-function exclude () {
- var excludes = [].slice.call(arguments);
-
- function excludeProps (res, obj) {
- Object.keys(obj).forEach(function (key) {
- if (!~excludes.indexOf(key)) res[key] = obj[key];
- });
- }
-
- return function extendExclude () {
- var args = [].slice.call(arguments)
- , i = 0
- , res = {};
-
- for (; i < args.length; i++) {
- excludeProps(res, args[i]);
- }
-
- return res;
- };
-}
-
-/*!
- * Primary Exports
- */
-
-module.exports = AssertionError;
-
-/**
- * ### AssertionError
- *
- * An extension of the JavaScript `Error` constructor for
- * assertion and validation scenarios.
- *
- * @param {String} message
- * @param {Object} properties to include (optional)
- * @param {callee} start stack function (optional)
- */
-
-function AssertionError (message, _props, ssf) {
- var extend = exclude('name', 'message', 'stack', 'constructor', 'toJSON')
- , props = extend(_props || {});
-
- // default values
- this.message = message || 'Unspecified AssertionError';
- this.showDiff = false;
-
- // copy from properties
- for (var key in props) {
- this[key] = props[key];
- }
-
- // capture stack trace
- ssf = ssf || arguments.callee;
- if (ssf && Error.captureStackTrace) {
- Error.captureStackTrace(this, ssf);
- } else {
- this.stack = new Error().stack;
- }
-}
-
-/*!
- * Inherit from Error.prototype
- */
-
-AssertionError.prototype = Object.create(Error.prototype);
-
-/*!
- * Statically set name
- */
-
-AssertionError.prototype.name = 'AssertionError';
-
-/*!
- * Ensure correct constructor
- */
-
-AssertionError.prototype.constructor = AssertionError;
-
-/**
- * Allow errors to be converted to JSON for static transfer.
- *
- * @param {Boolean} include stack (default: `true`)
- * @return {Object} object that can be `JSON.stringify`
- */
-
-AssertionError.prototype.toJSON = function (stack) {
- var extend = exclude('constructor', 'toJSON', 'stack')
- , props = extend({ name: this.name }, this);
-
- // include stack if exists and not turned off
- if (false !== stack && this.stack) {
- props.stack = this.stack;
- }
-
- return props;
-};
-
-},{}],29:[function(require,module,exports){
-module.exports = require('./lib/eql');
-
-},{"./lib/eql":30}],30:[function(require,module,exports){
-/*!
- * deep-eql
- * Copyright(c) 2013 Jake Luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Module dependencies
- */
-
-var type = require('type-detect');
-
-/*!
- * Buffer.isBuffer browser shim
- */
-
-var Buffer;
-try { Buffer = require('buffer').Buffer; }
-catch(ex) {
- Buffer = {};
- Buffer.isBuffer = function() { return false; }
-}
-
-/*!
- * Primary Export
- */
-
-module.exports = deepEqual;
-
-/**
- * Assert super-strict (egal) equality between
- * two objects of any type.
- *
- * @param {Mixed} a
- * @param {Mixed} b
- * @param {Array} memoised (optional)
- * @return {Boolean} equal match
- */
-
-function deepEqual(a, b, m) {
- if (sameValue(a, b)) {
- return true;
- } else if ('date' === type(a)) {
- return dateEqual(a, b);
- } else if ('regexp' === type(a)) {
- return regexpEqual(a, b);
- } else if (Buffer.isBuffer(a)) {
- return bufferEqual(a, b);
- } else if ('arguments' === type(a)) {
- return argumentsEqual(a, b, m);
- } else if (!typeEqual(a, b)) {
- return false;
- } else if (('object' !== type(a) && 'object' !== type(b))
- && ('array' !== type(a) && 'array' !== type(b))) {
- return sameValue(a, b);
- } else {
- return objectEqual(a, b, m);
- }
-}
-
-/*!
- * Strict (egal) equality test. Ensures that NaN always
- * equals NaN and `-0` does not equal `+0`.
- *
- * @param {Mixed} a
- * @param {Mixed} b
- * @return {Boolean} equal match
- */
-
-function sameValue(a, b) {
- if (a === b) return a !== 0 || 1 / a === 1 / b;
- return isNaN(a) && isNaN(b);
-}
-
-/*!
- * Compare the types of two given objects and
- * return if they are equal. Note that an Array
- * has a type of `array` (not `object`) and arguments
- * have a type of `arguments` (not `array`/`object`).
- *
- * @param {Mixed} a
- * @param {Mixed} b
- * @return {Boolean} result
- */
-
-function typeEqual(a, b) {
- return type(a) === type(b);
-}
-
-/*!
- * Compare two Date objects by asserting that
- * the time values are equal using `saveValue`.
- *
- * @param {Date} a
- * @param {Date} b
- * @return {Boolean} result
- */
-
-function dateEqual(a, b) {
- if ('date' !== type(b)) return false;
- return sameValue(a.getTime(), b.getTime());
-}
-
-/*!
- * Compare two regular expressions by converting them
- * to string and checking for `sameValue`.
- *
- * @param {RegExp} a
- * @param {RegExp} b
- * @return {Boolean} result
- */
-
-function regexpEqual(a, b) {
- if ('regexp' !== type(b)) return false;
- return sameValue(a.toString(), b.toString());
-}
-
-/*!
- * Assert deep equality of two `arguments` objects.
- * Unfortunately, these must be sliced to arrays
- * prior to test to ensure no bad behavior.
- *
- * @param {Arguments} a
- * @param {Arguments} b
- * @param {Array} memoize (optional)
- * @return {Boolean} result
- */
-
-function argumentsEqual(a, b, m) {
- if ('arguments' !== type(b)) return false;
- a = [].slice.call(a);
- b = [].slice.call(b);
- return deepEqual(a, b, m);
-}
-
-/*!
- * Get enumerable properties of a given object.
- *
- * @param {Object} a
- * @return {Array} property names
- */
-
-function enumerable(a) {
- var res = [];
- for (var key in a) res.push(key);
- return res;
-}
-
-/*!
- * Simple equality for flat iterable objects
- * such as Arrays or Node.js buffers.
- *
- * @param {Iterable} a
- * @param {Iterable} b
- * @return {Boolean} result
- */
-
-function iterableEqual(a, b) {
- if (a.length !== b.length) return false;
-
- var i = 0;
- var match = true;
-
- for (; i < a.length; i++) {
- if (a[i] !== b[i]) {
- match = false;
- break;
- }
- }
-
- return match;
-}
-
-/*!
- * Extension to `iterableEqual` specifically
- * for Node.js Buffers.
- *
- * @param {Buffer} a
- * @param {Mixed} b
- * @return {Boolean} result
- */
-
-function bufferEqual(a, b) {
- if (!Buffer.isBuffer(b)) return false;
- return iterableEqual(a, b);
-}
-
-/*!
- * Block for `objectEqual` ensuring non-existing
- * values don't get in.
- *
- * @param {Mixed} object
- * @return {Boolean} result
- */
-
-function isValue(a) {
- return a !== null && a !== undefined;
-}
-
-/*!
- * Recursively check the equality of two objects.
- * Once basic sameness has been established it will
- * defer to `deepEqual` for each enumerable key
- * in the object.
- *
- * @param {Mixed} a
- * @param {Mixed} b
- * @return {Boolean} result
- */
-
-function objectEqual(a, b, m) {
- if (!isValue(a) || !isValue(b)) {
- return false;
- }
-
- if (a.prototype !== b.prototype) {
- return false;
- }
-
- var i;
- if (m) {
- for (i = 0; i < m.length; i++) {
- if ((m[i][0] === a && m[i][1] === b)
- || (m[i][0] === b && m[i][1] === a)) {
- return true;
- }
- }
- } else {
- m = [];
- }
-
- try {
- var ka = enumerable(a);
- var kb = enumerable(b);
- } catch (ex) {
- return false;
- }
-
- ka.sort();
- kb.sort();
-
- if (!iterableEqual(ka, kb)) {
- return false;
- }
-
- m.push([ a, b ]);
-
- var key;
- for (i = ka.length - 1; i >= 0; i--) {
- key = ka[i];
- if (!deepEqual(a[key], b[key], m)) {
- return false;
- }
- }
-
- return true;
-}
-
-},{"buffer":undefined,"type-detect":31}],31:[function(require,module,exports){
-module.exports = require('./lib/type');
-
-},{"./lib/type":32}],32:[function(require,module,exports){
-/*!
- * type-detect
- * Copyright(c) 2013 jake luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Primary Exports
- */
-
-exports = module.exports = getType;
-
-/*!
- * Detectable javascript natives
- */
-
-var natives = {
- '[object Array]': 'array'
- , '[object RegExp]': 'regexp'
- , '[object Function]': 'function'
- , '[object Arguments]': 'arguments'
- , '[object Date]': 'date'
-};
-
-/**
- * ### typeOf (obj)
- *
- * Use several different techniques to determine
- * the type of object being tested.
- *
- *
- * @param {Mixed} object
- * @return {String} object type
- * @api public
- */
-
-function getType (obj) {
- var str = Object.prototype.toString.call(obj);
- if (natives[str]) return natives[str];
- if (obj === null) return 'null';
- if (obj === undefined) return 'undefined';
- if (obj === Object(obj)) return 'object';
- return typeof obj;
-}
-
-exports.Library = Library;
-
-/**
- * ### Library
- *
- * Create a repository for custom type detection.
- *
- * ```js
- * var lib = new type.Library;
- * ```
- *
- */
-
-function Library () {
- this.tests = {};
-}
-
-/**
- * #### .of (obj)
- *
- * Expose replacement `typeof` detection to the library.
- *
- * ```js
- * if ('string' === lib.of('hello world')) {
- * // ...
- * }
- * ```
- *
- * @param {Mixed} object to test
- * @return {String} type
- */
-
-Library.prototype.of = getType;
-
-/**
- * #### .define (type, test)
- *
- * Add a test to for the `.test()` assertion.
- *
- * Can be defined as a regular expression:
- *
- * ```js
- * lib.define('int', /^[0-9]+$/);
- * ```
- *
- * ... or as a function:
- *
- * ```js
- * lib.define('bln', function (obj) {
- * if ('boolean' === lib.of(obj)) return true;
- * var blns = [ 'yes', 'no', 'true', 'false', 1, 0 ];
- * if ('string' === lib.of(obj)) obj = obj.toLowerCase();
- * return !! ~blns.indexOf(obj);
- * });
- * ```
- *
- * @param {String} type
- * @param {RegExp|Function} test
- * @api public
- */
-
-Library.prototype.define = function (type, test) {
- if (arguments.length === 1) return this.tests[type];
- this.tests[type] = test;
- return this;
-};
-
-/**
- * #### .test (obj, test)
- *
- * Assert that an object is of type. Will first
- * check natives, and if that does not pass it will
- * use the user defined custom tests.
- *
- * ```js
- * assert(lib.test('1', 'int'));
- * assert(lib.test('yes', 'bln'));
- * ```
- *
- * @param {Mixed} object
- * @param {String} type
- * @return {Boolean} result
- * @api public
- */
-
-Library.prototype.test = function (obj, type) {
- if (type === getType(obj)) return true;
- var test = this.tests[type];
-
- if (test && 'regexp' === getType(test)) {
- return test.test(obj);
- } else if (test && 'function' === getType(test)) {
- return test(obj);
- } else {
- throw new ReferenceError('Type test "' + type + '" not defined or invalid.');
- }
-};
-
-},{}],33:[function(require,module,exports){
-arguments[4][31][0].apply(exports,arguments)
-},{"./lib/type":34,"dup":31}],34:[function(require,module,exports){
-/*!
- * type-detect
- * Copyright(c) 2013 jake luer <jake@alogicalparadox.com>
- * MIT Licensed
- */
-
-/*!
- * Primary Exports
- */
-
-exports = module.exports = getType;
-
-/**
- * ### typeOf (obj)
- *
- * Use several different techniques to determine
- * the type of object being tested.
- *
- *
- * @param {Mixed} object
- * @return {String} object type
- * @api public
- */
-var objectTypeRegexp = /^\[object (.*)\]$/;
-
-function getType(obj) {
- var type = Object.prototype.toString.call(obj).match(objectTypeRegexp)[1].toLowerCase();
- // Let "new String('')" return 'object'
- if (typeof Promise === 'function' && obj instanceof Promise) return 'promise';
- // PhantomJS has type "DOMWindow" for null
- if (obj === null) return 'null';
- // PhantomJS has type "DOMWindow" for undefined
- if (obj === undefined) return 'undefined';
- return type;
-}
-
-exports.Library = Library;
-
-/**
- * ### Library
- *
- * Create a repository for custom type detection.
- *
- * ```js
- * var lib = new type.Library;
- * ```
- *
- */
-
-function Library() {
- if (!(this instanceof Library)) return new Library();
- this.tests = {};
-}
-
-/**
- * #### .of (obj)
- *
- * Expose replacement `typeof` detection to the library.
- *
- * ```js
- * if ('string' === lib.of('hello world')) {
- * // ...
- * }
- * ```
- *
- * @param {Mixed} object to test
- * @return {String} type
- */
-
-Library.prototype.of = getType;
-
-/**
- * #### .define (type, test)
- *
- * Add a test to for the `.test()` assertion.
- *
- * Can be defined as a regular expression:
- *
- * ```js
- * lib.define('int', /^[0-9]+$/);
- * ```
- *
- * ... or as a function:
- *
- * ```js
- * lib.define('bln', function (obj) {
- * if ('boolean' === lib.of(obj)) return true;
- * var blns = [ 'yes', 'no', 'true', 'false', 1, 0 ];
- * if ('string' === lib.of(obj)) obj = obj.toLowerCase();
- * return !! ~blns.indexOf(obj);
- * });
- * ```
- *
- * @param {String} type
- * @param {RegExp|Function} test
- * @api public
- */
-
-Library.prototype.define = function(type, test) {
- if (arguments.length === 1) return this.tests[type];
- this.tests[type] = test;
- return this;
-};
-
-/**
- * #### .test (obj, test)
- *
- * Assert that an object is of type. Will first
- * check natives, and if that does not pass it will
- * use the user defined custom tests.
- *
- * ```js
- * assert(lib.test('1', 'int'));
- * assert(lib.test('yes', 'bln'));
- * ```
- *
- * @param {Mixed} object
- * @param {String} type
- * @return {Boolean} result
- * @api public
- */
-
-Library.prototype.test = function(obj, type) {
- if (type === getType(obj)) return true;
- var test = this.tests[type];
-
- if (test && 'regexp' === getType(test)) {
- return test.test(obj);
- } else if (test && 'function' === getType(test)) {
- return test(obj);
- } else {
- throw new ReferenceError('Type test "' + type + '" not defined or invalid.');
- }
-};
-
-},{}],35:[function(require,module,exports){
-module.exports = require('./lib/chai');
-
-},{"./lib/chai":1}]},{},[35])(35)
-});
diff --git a/toolkit/components/microformats/test/static/javascript/count.js b/toolkit/components/microformats/test/static/javascript/count.js
deleted file mode 100644
index 56a64c05e..000000000
--- a/toolkit/components/microformats/test/static/javascript/count.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/*!
- parse
- Used by http://localhost:3000/
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-window.onload = function() {
-
- var form;
- form= document.getElementById('mf-form');
-
- form.onsubmit = function(e){
- e.preventDefault();
-
- var html,
- doc,
- node,
- options,
- mfJSON,
- parserJSONElt;
-
- // get data from html
- html = document.getElementById('html').value;
- parserJSONElt = document.querySelector('#parser-json pre code')
-
- // createHTMLDocument is not well support below ie9
- doc = document.implementation.createHTMLDocument("New Document");
- node = document.createElement('div');
- node.innerHTML = html;
- doc.body.appendChild(node);
-
- options ={
- 'node': node
- };
-
- // parse direct into Modules to help debugging
- if(window.Modules){
- var parser = new Modules.Parser();
- mfJSON = parser.count(options);
- }else if(window.Microformats){
- mfJSON = Microformats.count(options);
- }
-
-
- // format output
- parserJSONElt.innerHTML = htmlEscape( js_beautify( JSON.stringify(mfJSON) ) );
- //prettyPrint();
-
- }
-
- function htmlEscape(str) {
- return String(str)
- .replace(/&/g, '&amp;')
- .replace(/"/g, '&quot;')
- .replace(/'/g, '&#39;')
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;');
- }
-
-
-};
diff --git a/toolkit/components/microformats/test/static/javascript/data.js b/toolkit/components/microformats/test/static/javascript/data.js
deleted file mode 100644
index 3f725c6db..000000000
--- a/toolkit/components/microformats/test/static/javascript/data.js
+++ /dev/null
@@ -1 +0,0 @@
-var testData = {"date":"2015-09-25T12:26:26.421Z","repo":"microformats/tests","version":"0.1.24","data":[{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Mozilla Foundation\"],\n \"org\": [\"Mozilla Foundation\"],\n \"url\": [\"http://mozilla.org/\"],\n \"adr\": [{\n \"value\": \"665 3rd St. \\n Suite 207 \\n San Francisco, \\n CA \\n 94107 \\n U.S.A.\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"665 3rd St.\"],\n \"extended-address\": [\"Suite 207\"],\n \"locality\": [\"San Francisco\"],\n \"region\": [\"CA\"],\n \"postal-code\": [\"94107\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-card\">\n <p>\n <a class=\"p-name p-org u-url\" href=\"http://mozilla.org/\">Mozilla Foundation</a>\n <img class=\"logo\" src=\"../logo.jpg\"/>\n </p>\n <p class=\"adr\">\n <span class=\"street-address\">665 3rd St.</span> \n <span class=\"extended-address\">Suite 207</span> \n <span class=\"locality\">San Francisco</span>, \n <span class=\"region\">CA</span> \n <span class=\"postal-code\">94107</span> \n <span class=\"p-country-name\">U.S.A.</span> \n </p>\n</div>","name":"mf-mixed-h-card-mixedpropertries"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Frances Berriman\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"h-card vcard\">Frances Berriman</p>","name":"mf-mixed-h-card-tworoots"},{"json":"\n{\n \"items\": [{\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"author\": [{\n \"value\": \"aaronparecki.com\\n Aaron Parecki\\n Aaron Parecki\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"photo\": [\"https://aaronparecki.com/images/aaronpk.png\"],\n \"logo\": [\"https://aaronparecki.com/images/aaronpk.png\"],\n \"url\": [\"https://aaronparecki.com/\"],\n \"uid\": [\"https://aaronparecki.com/\"],\n \"name\": [\"Aaron Parecki\"]\n }\n }],\n \"content\": [{\n \"value\": \"Did you play\\n @playmapattackat\\n #realtimeconf? Here is some more info about how we built it!\\n http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/\",\n \"html\": \"Did you play\\n <a href=\\\"http://twitter.com/playmapattack\\\">@playmapattack</a>at\\n <a href=\\\"http://aaronparecki.com/tag/realtimeconf\\\">#<span class=\\\"p-category\\\">realtimeconf</span></a>? Here is some more info about how we built it!\\n <a href=\\\"http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/\\\"><span class=\\\"protocol\\\">http://</span>pdx.esri.com/blog/2013/10/17/introducting-mapattack/</a>\\n \"\n }],\n \"name\": [\"Did you play\\n @playmapattackat\\n #realtimeconf? Here is some more info about how we built it!\\n http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/\"],\n \"category\": [\"realtimeconf\"]\n }\n }],\n \"rels\": {\n \"author\": [\"https://aaronparecki.com/\", \"https://plus.google.com/117847912875913905493\"]\n },\n \"rel-urls\": {\n \"https://aaronparecki.com/\": {\n \"text\": \"aaronparecki.com\",\n \"rels\": [\"author\"]\n },\n \"https://plus.google.com/117847912875913905493\": {\n \"text\": \"Aaron Parecki\",\n \"rels\": [\"author\"]\n }\n }\n}","html":"<!-- simplified version of http://aaronparecki.com/notes/2013/10/18/2/realtimeconf-mapattack -->\n<base href=\"http://aaronparecki.com/\" />\n\n<div class=\"h-entry\">\n <div class=\"h-card vcard author p-author\">\n <img class=\"photo logo u-photo u-logo\" src=\"https://aaronparecki.com/images/aaronpk.png\" alt=\"Aaron Parecki\"/>\n <a href=\"https://aaronparecki.com/\" rel=\"author\" class=\"u-url u-uid url\">aaronparecki.com</a>\n <a class=\"p-name fn value\" href=\"https://aaronparecki.com/\">Aaron Parecki</a>\n <a href=\"https://plus.google.com/117847912875913905493\" rel=\"author\" class=\"google-profile\">Aaron Parecki</a>\n </div>\n <div class=\"entry-content e-content p-name\">Did you play\n <a href=\"http://twitter.com/playmapattack\">@playmapattack</a>at\n <a href=\"/tag/realtimeconf\">#<span class=\"p-category\">realtimeconf</span></a>? Here is some more info about how we built it!\n <a href=\"http://pdx.esri.com/blog/2013/10/17/introducting-mapattack/\"><span class=\"protocol\">http://</span>pdx.esri.com/blog/2013/10/17/introducting-mapattack/</a>\n </div>\n</div>","name":"mf-mixed-h-entry-mixedroots"},{"json":"{\n \"items\": [{\n \"type\": [\"h-resume\"],\n \"properties\": {\n \"contact\": [{\n \"value\": \"Tim Berners-Lee\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tim Berners-Lee\"],\n \"job-title\": [\"Director of the World Wide Web Foundation\"]\n }\n }],\n \"summary\": [\"Invented the World Wide Web.\"],\n \"experience\": [{\n \"value\": \"World Wide Web Foundation\",\n \"type\": [\"h-event\", \"h-card\"],\n \"properties\": {\n \"job-title\": [\"Director\"],\n \"name\": [\"World Wide Web Foundation\"],\n \"org\": [\"World Wide Web Foundation\"],\n \"url\": [\"http://www.webfoundation.org/\"],\n \"start\": [\"2009-01-18\"],\n \"duration\": [\"P2Y11M\"]\n }\n }],\n \"name\": [\"Tim Berners-Lee\\n Director of the World Wide Web Foundation\\n \\n Invented the World Wide Web.\\n \\n Director\\n World Wide Web Foundation\\n \\n Jan 2009 – Present\\n (2 years 11 month)\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<div class=\"h-resume\">\n <div class=\"p-contact vcard\">\n <p class=\"fn\">Tim Berners-Lee</p>\n <p class=\"title\">Director of the World Wide Web Foundation</p>\n </div>\n <p class=\"p-summary\">Invented the World Wide Web.</p><hr />\n <div class=\"p-experience vevent vcard\">\n <p class=\"title\">Director</p>\n <p><a class=\"fn org summary url\" href=\"http://www.webfoundation.org/\">World Wide Web Foundation</a></p>\n <p>\n <time class=\"dtstart\" datetime=\"2009-01-18\">Jan 2009</time> – Present\n <time class=\"duration\" datetime=\"P2Y11M\">(2 years 11 month)</time>\n </p>\n </div>\n</div>","name":"mf-mixed-h-resume-mixedroots"},{"json":"{\n \"items\": [{\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"665 3rd St.\"],\n \"extended-address\": [\"Suite 207\"],\n \"locality\": [\"San Francisco\"],\n \"region\": [\"CA\"],\n \"postal-code\": [\"94107\"],\n \"country-name\": [\"U.S.A.\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"adr\">\n <span class=\"street-address\">665 3rd St.</span> \n <span class=\"extended-address\">Suite 207</span> \n <span class=\"locality\">San Francisco</span>, \n <span class=\"region\">CA</span> \n <span class=\"postal-code\">94107</span> \n <span class=\"country-name\">U.S.A.</span> \n</p>","name":"mf-v1-adr-simpleproperties"},{"json":"{\n \"items\": [{\n \"type\": [\"h-geo\"],\n \"properties\": {\n \"latitude\": [\"37.408183\"],\n \"longitude\": [\"-122.13855\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<p class=\"geo\">\n <abbr class=\"latitude\" title=\"37.408183\">N 37° 24.491</abbr>, \n <abbr class=\"longitude\" title=\"-122.13855\">W 122° 08.313</abbr>\n</p>","name":"mf-v1-geo-abbrpattern"},{"json":"{\n \"items\": [{\n \"type\": [\"h-geo\"],\n \"properties\": {\n \"latitude\": [\"51.513458\"],\n \"longitude\": [\"-0.14812\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p>\n <span class=\"geo\">The Bricklayer's Arms\n <span class=\"latitude\">\n <span class=\"value-title\" title=\"51.513458\"> </span> \n </span>\n <span class=\"longitude\">\n <span class=\"value-title\" title=\"-0.14812\"> </span>\n </span>\n </span>\n</p>","name":"mf-v1-geo-hidden"},{"json":"{\n \"items\": [{\n \"type\": [\"h-geo\"],\n \"properties\": {\n \"latitude\": [\"51.513458\"],\n \"longitude\": [\"-0.14812\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"We are meeting at \n<span class=\"geo\"> \n <span>The Bricklayer's Arms</span>\n (Geo: <span class=\"latitude\">51.513458</span>:\n <span class=\"longitude\">-0.14812</span>)\n</span>","name":"mf-v1-geo-simpleproperties"},{"json":"{\n \"items\": [{\n \"type\": [\"h-geo\"],\n \"properties\": {\n \"latitude\": [\"51.513458\"],\n \"longitude\": [\"-0.14812\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<p>\n <span class=\"geo\">\n <span class=\"latitude\">\n <span class=\"value-title\" title=\"51.513458\">N 51° 51.345</span>, \n </span>\n <span class=\"longitude\">\n <span class=\"value-title\" title=\"-0.14812\">W -0° 14.812</span>\n </span>\n </span>\n</p>","name":"mf-v1-geo-valuetitleclass"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"The 4th Microformat party\"],\n \"start\": [\n \"2009-06-26 19:00:00\", \n \"2009-06-26 07:00:00\", \n \"2009-06-26 19:00\", \n \"2009-06-26 19\", \n \"2009-06-26 19\", \n \"2009-06-26 19:00\", \n \"2009-06-26 19:00\", \n \"2009-06-26 19:00\", \n \"2009-06-26 07:00\"\n ]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"vevent\">\n <span class=\"summary\">The 4th Microformat party</span> will be on \n <ul>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00:00pm \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00:00am \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00pm \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07pm \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">7pm \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">7:00pm \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00p.m. \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00PM \n </span></li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">7:00am \n </span></li>\n </ul>\n</div>","name":"mf-v1-hcalendar-ampm"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"CPJ Online Press Freedom Summit\"],\n \"start\": [\"2012-10-10\"],\n \"location\": [\"San Francisco\"],\n \"attendee\": [{\n \"value\": \"Brian Warner\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Brian Warner\"]\n }\n }, {\n \"value\": \"Kyle Machulis\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Kyle Machulis\"]\n }\n }, {\n \"value\": \"Tantek Çelik\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tantek Çelik\"]\n }\n }, {\n \"value\": \"Sid Sutter\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Sid Sutter\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<div class=\"vevent\">\n <span class=\"summary\">CPJ Online Press Freedom Summit</span>\n (<time class=\"dtstart\" datetime=\"2012-10-10\">10 Nov 2012</time>) in\n <span class=\"location\">San Francisco</span>.\n Attendees:\n <ul>\n <li class=\"attendee vcard\"><span class=\"fn\">Brian Warner</span></li>\n <li class=\"attendee vcard\"><span class=\"fn\">Kyle Machulis</span></li>\n <li class=\"attendee vcard\"><span class=\"fn\">Tantek Çelik</span></li>\n <li class=\"attendee vcard\"><span class=\"fn\">Sid Sutter</span></li>\n </ul>\n</div>\n","name":"mf-v1-hcalendar-attendees"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"IndieWebCamp 2012\"],\n \"url\": [\"http://indiewebcamp.com/2012\"],\n \"start\": [\"2012-06-30\"],\n \"end\": [\"2012-07-01\"],\n \"location\": [{\n \"value\": \"Geoloqi\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Geoloqi\"],\n \"org\": [\"Geoloqi\"],\n \"url\": [\"http://geoloqi.com/\"],\n \"adr\": [{\n \"value\": \"920 SW 3rd Ave. Suite 400, \\n Portland, \\n OR\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"920 SW 3rd Ave. Suite 400\"],\n \"locality\": [\"Portland\"],\n \"region\": [\"Oregon\"]\n }\n }]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"vevent\">\n <a class=\"summary url\" href=\"http://indiewebcamp.com/2012\">\n IndieWebCamp 2012\n </a>\n from <time class=\"dtstart\">2012-06-30</time> \n to <time class=\"dtend\">2012-07-01</time> at \n <span class=\"location vcard\">\n <a class=\"fn org url\" href=\"http://geoloqi.com/\">Geoloqi</a>, \n <span class=\"adr\">\n <span class=\"street-address\">920 SW 3rd Ave. Suite 400</span>, \n <span class=\"locality\">Portland</span>, \n <abbr class=\"region\" title=\"Oregon\">OR</abbr>\n </span>\n </span>\n</div>","name":"mf-v1-hcalendar-combining"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"The 4th Microformat party\"],\n \"start\": [\"2009-06-26 19:00\"],\n \"end\": [\"2009-06-26 22:00\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"vevent\">\n <span class=\"summary\">The 4th Microformat party</span> will be on \n <span class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00</time></span> to \n <span class=\"dtend\"><time class=\"value\">22:00</time></span>.\n</div>","name":"mf-v1-hcalendar-concatenate"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"The 4th Microformat party\"],\n \"start\": [\n \"2009-06-26 19:00:00-08:00\", \n \"2009-06-26 19:00:00-08:00\", \n \"2009-06-26 19:00:00+08:00\", \n \"2009-06-26 19:00:00Z\", \n \"2009-06-26 19:00:00\", \n \"2009-06-26 19:00-08:00\", \n \"2009-06-26 19:00+08:00\", \n \"2009-06-26 19:00Z\", \n \"2009-06-26 19:00\"\n ],\n \"end\": [\"2013-034\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"vevent\">\n <span class=\"summary\">The 4th Microformat party</span> will be on \n <ul>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00-08:00</time> \n </li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00-0800</time> \n </li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00+0800</time> \n </li> \n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00Z</time> \n </li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00</time> \n </li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00-08:00</time> \n </li> \n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00+08:00</time> \n </li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00z</time> \n </li>\n <li class=\"dtstart\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00</time> \n </li> \n <li>\n <time class=\"dtend\" datetime=\"2013-034\">3 February 2013</time>\n </li> \n </ul>\n</div>","name":"mf-v1-hcalendar-time"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"John Doe\"],\n \"email\": [\"mailto:john@example.com\", \"mailto:john@example.com\", \"mailto:john@example.com?subject=parser-test\", \"john@example.com\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"vcard\">\n <span class=\"fn\">John Doe</span> \n <ul>\n <li><a class=\"email\" href=\"mailto:john@example.com\">notthis@example.com</a></li>\n <li>\n <span class=\"email\">\n <span class=\"type\">internet</span> \n <a class=\"value\" href=\"mailto:john@example.com\">notthis@example.com</a>\n </span>\n </li> \n <li><a class=\"email\" href=\"mailto:john@example.com?subject=parser-test\">notthis@example.com</a></li>\n <li class=\"email\">john@example.com</li>\n </ul>\n</div>","name":"mf-v1-hcard-email"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"John \\n Doe\"],\n \"given-name\": [\"John\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"vcard\">\n <span class=\"profile-name fn n\">\n <span class=\" given-name \">John</span> \n <span class=\"FAMILY-NAME\">Doe</span> \n </span>\n</p>","name":"mf-v1-hcard-format"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {}\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<a class=\"vcard\" href=\"http://rohit.khare.org/\">\n <img alt=\"Rohit Khare\" src=\"images/photo.gif\" />\n</a>","name":"mf-v1-hcard-hyperlinkedphoto"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {}\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<a class=\"vcard\" href=\"http://benward.me/\">Ben Ward</a>","name":"mf-v1-hcard-justahyperlink"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {}\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"vcard\">Frances Berriman</p>","name":"mf-v1-hcard-justaname"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"John Doe\"],\n \"given-name\": [\"John\"],\n \"family-name\": [\"Doe\"],\n \"sound\": [\"http://www.madgex.com/johndoe.mpeg\"],\n \"photo\": [\"http://example.com/images/photo.gif\"],\n \"nickname\": [\"Man with no name\", \"Lost boy\"],\n \"note\": [\"John Doe is one of those names you always have issues with.\", \"It can be a real problem booking a hotel room with the name John Doe.\"],\n \"logo\": [\"http://example.com/images/logo.gif\", \"http://example.com/images/logo.gif\"],\n \"url\": [\"http://www.madgex.com/\", \"http://www.webfeetmedia.com/\"],\n \"org\": [\"Madgex\", \"Web Feet Media Ltd\"],\n \"job-title\": [\"Creative Director\", \"Owner\"],\n \"category\": [\"design\", \"development\", \"web\"],\n \"tel\": [\"+1 415 555 100\", \"+1 415 555 200\", \"+1 415 555 300\"],\n \"email\": [\"mailto:john.doe@madgex.com\", \"mailto:john.doe@webfeetmedia.com\"],\n \"mailer\": [\"PigeonMail 2.1\", \"Outlook 2007\"],\n \"label\": [\"Work: \\n North Street, \\n Brighton, \\n United Kingdom\", \"Home: \\n West Street, \\n Brighton, \\n United Kingdom\"],\n \"adr\": [{\n \"value\": \"Work: \\n North Street, \\n Brighton, \\n United Kingdom\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"North Street\"],\n \"locality\": [\"Brighton\"],\n \"country-name\": [\"United Kingdom\"]\n }\n }, {\n \"value\": \"Home: \\n West Street, \\n Brighton, \\n United Kingdom\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"West Street\"],\n \"locality\": [\"Brighton\"],\n \"country-name\": [\"United Kingdom\"]\n }\n }],\n \"agent\": [\"Jane Doe\", {\n \"value\": \"Dave Doe\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Dave Doe\"]\n }\n }],\n \"key\": [\"hd02$Gfu*d%dh87KTa2=23934532479\"]\n }\n }],\n \"rels\": {\n \"tag\": [\"http://en.wikipedia.org/wiki/design\", \"http://en.wikipedia.org/wiki/development\", \"http://en.wikipedia.org/wiki/web\"]\n },\n \"rel-urls\": {\n \"http://en.wikipedia.org/wiki/design\": {\n \"text\": \"design\",\n \"rels\": [\"tag\"]\n },\n \"http://en.wikipedia.org/wiki/development\": {\n \"text\": \"development\",\n \"rels\": [\"tag\"]\n },\n \"http://en.wikipedia.org/wiki/web\": {\n \"text\": \"web\",\n \"rels\": [\"tag\"]\n }\n }\n}","html":"<base href=\"http://example.com\">\n <div class=\"vcard\">\n \n <div class=\"fn n\"><span class=\"given-name\">John</span> <span class=\"family-name\">Doe</span></div>\n <a class=\"sound\" href=\"http://www.madgex.com/johndoe.mpeg\">Pronunciation of my name</a>\n <div><img class=\"photo\" src=\"images/photo.gif\" alt=\"Photo of John Doe\" /></div>\n\n <p>Nicknames:</p>\n <ul>\n <li class=\"nickname\">Man with no name</li>\n <li class=\"nickname\">Lost boy</li>\n </ul>\n\n <p>About:</p>\n <p class=\"note\">John Doe is one of those names you always have issues with.</p>\n <p class=\"note\">It can be a real problem booking a hotel room with the name John Doe.</p>\n\n <p>Companies:</p>\n <div>\n <img class=\"logo\" src=\"images/logo.gif\" alt=\"Madgex company logo\" />\n <img class=\"logo\" src=\"images/logo.gif\" alt=\"Web Feet Media company logo\" />\n </div>\n <ul>\n <li><a class=\"url org\" href=\"http://www.madgex.com/\">Madgex</a> <span class=\"title\">Creative Director</span></li>\n <li><a class=\"url org\" href=\"http://www.webfeetmedia.com/\">Web Feet Media Ltd</a> <span class=\"title\">Owner</span></li>\n </ul>\n \n <p>Tags: \n <a rel=\"tag\" class=\"category\" href=\"http://en.wikipedia.org/wiki/design\">design</a>, \n <a rel=\"tag\" class=\"category\" href=\"http://en.wikipedia.org/wiki/development\">development</a> and\n <a rel=\"tag\" class=\"category\" href=\"http://en.wikipedia.org/wiki/web\">web</a>\n </p>\n \n <p>Phone numbers:</p>\n <ul>\n <li class=\"tel\">\n <span class=\"type\">Work</span> (<span class=\"type\">pref</span>erred):\n <span class=\"value\">+1 415 555 100</span>\n </li>\n <li class=\"tel\"><span class=\"type\">Home</span>: <span class=\"value\">+1 415 555 200</span></li>\n <li class=\"tel\"><span class=\"type\">Postal</span>: <span class=\"value\">+1 415 555 300</span></li>\n </ul>\n \n <p>Emails:</p>\n <ul>\n <li><a class=\"email\" href=\"mailto:john.doe@madgex.com\">John Doe at Madgex</a></li>\n <li><a class=\"email\" href=\"mailto:john.doe@webfeetmedia.com\">John Doe at Web Feet Media</a></li>\n </ul>\n <p>John Doe uses <span class=\"mailer\">PigeonMail 2.1</span> or <span class=\"mailer\">Outlook 2007</span> for email.</p>\n\n <p>Addresses:</p>\n <ul>\n <li class=\"label\">\n <span class=\"adr\">\n <span class=\"type\">Work</span>: \n <span class=\"street-address\">North Street</span>, \n <span class=\"locality\">Brighton</span>, \n <span class=\"country-name\">United Kingdom</span>\n </span>\n \n </li>\n <li class=\"label\">\n <span class=\"adr\">\n <span class=\"type\">Home</span>: \n <span class=\"street-address\">West Street</span>, \n <span class=\"locality\">Brighton</span>, \n <span class=\"country-name\">United Kingdom</span>\n </span>\n </li>\n </ul>\n \n <p>In emergency contact: <span class=\"agent\">Jane Doe</span> or <span class=\"agent vcard\"><span class=\"fn\">Dave Doe</span></span>.</p>\n <p>Key: <span class=\"key\">hd02$Gfu*d%dh87KTa2=23934532479</span></p>\n</div>","name":"mf-v1-hcard-multiple"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"honorific-prefix\": [\"Dr\"],\n \"given-name\": [\"John\"],\n \"additional-name\": [\"Peter\"],\n \"family-name\": [\"Doe\"],\n \"honorific-suffix\": [\"MSc\", \"PHD\"],\n \"photo\": [\"http://example.com/images/logo.gif\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<base href=\"http://example.com\">\n<div class=\"vcard\">\n <div class=\"name\">\n <span class=\"honorific-prefix\">Dr</span> \n <span class=\"given-name\">John</span> \n <abbr class=\"additional-name\" title=\"Peter\">P</abbr> \n <span class=\"family-name\">Doe</span> \n <data class=\"honorific-suffix\" value=\"MSc\"></data>\n <img class=\"photo honorific-suffix\" src=\"images/logo.gif\" alt=\"PHD\" />\n </div>\n</div>","name":"mf-v1-hcard-name"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"John Doe\"],\n \"given-name\": [\"John\"],\n \"sort-string\": [\"John\"],\n \"bday\": [\"2000-01-01 00:00:00-08:00\"],\n \"role\": [\"Designer\"],\n \"geo\": [{\n \"value\": \"30.267991;-97.739568\",\n \"type\": [\"h-geo\"],\n \"properties\": {\n \"name\": [\"30.267991;-97.739568\"]\n }\n }],\n \"tz\": [\"-05:00\"],\n \"uid\": [\"http://example.com/profiles/johndoe\"],\n \"class\": [\"Public\"],\n \"rev\": [\"2008-01-01 13:45:00\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"vcard\">\n \n <div class=\"fn n\"><span class=\"given-name sort-string\">John</span> Doe</div>\n <div>Birthday: <abbr class=\"bday\" title=\"2000-01-01T00:00:00-08:00\">January 1st, 2000</abbr></div>\n <div>Role: <span class=\"role\">Designer</span></div>\n <div>Location: <abbr class=\"geo\" title=\"30.267991;-97.739568\">Brighton</abbr></div>\n <div>Time zone: <abbr class=\"tz\" title=\"-05:00\">Eastern Standard Time</abbr></div>\n \n <div>Profile details:\n <div>Profile id: <span class=\"uid\">http://example.com/profiles/johndoe</span></div>\n <div>Details are: <span class=\"class\">Public</span></div>\n <div>Last updated: <abbr class=\"rev\" title=\"2008-01-01T13:45:00\">January 1st, 2008 - 13:45</abbr></div>\n </div>\n </div>","name":"mf-v1-hcard-single"},{"json":"{\n \"items\": [{\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"name\": [\"microformats.org at 7\"],\n \"content\": [{\n \"value\": \"Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\\n\\n The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n principles, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service\",\n \"html\": \"\\n <p class=\\\"entry-summary\\\">Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.</p>\\n\\n <p>The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n <a href=\\\"http://microformats.org/wiki/principles\\\">principles</a>, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service </p>\\n \"\n }],\n \"summary\": [\"Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\"],\n \"updated\": [\"2012-06-25 17:08:26\"],\n \"author\": [{\n \"value\": \"Tantek\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tantek\"],\n \"url\": [\"http://tantek.com/\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<div class=\"hentry\">\n <h1><a class=\"entry-title\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n <div class=\"entry-content\">\n <p class=\"entry-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n </div> \n <p>Updated \n <time class=\"updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time> by\n <span class=\"author vcard\"><a class=\"fn url\" href=\"http://tantek.com/\">Tantek</a></span>\n </p>\n</div>","name":"mf-v1-hentry-summarycontent"},{"json":"{\n \"items\": [{\n \"type\": [\"h-feed\"],\n \"properties\": {\n \"author\": [{\n \"value\": \"Tantek\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tantek\"],\n \"url\": [\"http://tantek.com/\"]\n }\n }],\n \"url\": [\"http://microformats.org/blog\"],\n \"photo\": [\"http://example.com/photo.jpeg\"],\n \"category\": [\"microformats\", \"html\"]\n },\n \"children\": [{\n \"value\": \"microformats.org at 7\\n\\t \\n\\t Last week the microformats.org community \\n\\t celebrated its 7th birthday at a gathering hosted by Mozilla in \\n\\t San Francisco and recognized accomplishments, challenges, and \\n\\t opportunities.\\n\\t\\n\\t The microformats tagline “humans first, machines second†\\n\\t forms the basis of many of our \\n\\t principles, and \\n\\t in that regard, we’d like to recognize a few people and \\n\\t thank them for their years of volunteer service \\n\\t \\n\\t Updated \\n\\t June 25th, 2012\",\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"name\": [\"microformats.org at 7\"],\n \"url\": [\"http://microformats.org/2012/06/25/microformats-org-at-7\"],\n \"content\": [{\n \"value\": \"Last week the microformats.org community \\n\\t celebrated its 7th birthday at a gathering hosted by Mozilla in \\n\\t San Francisco and recognized accomplishments, challenges, and \\n\\t opportunities.\\n\\t\\n\\t The microformats tagline “humans first, machines second†\\n\\t forms the basis of many of our \\n\\t principles, and \\n\\t in that regard, we’d like to recognize a few people and \\n\\t thank them for their years of volunteer service\",\n \"html\": \"\\n\\t <p class=\\\"entry-summary\\\">Last week the microformats.org community \\n\\t celebrated its 7th birthday at a gathering hosted by Mozilla in \\n\\t San Francisco and recognized accomplishments, challenges, and \\n\\t opportunities.</p>\\n\\t\\n\\t <p>The microformats tagline “humans first, machines second†\\n\\t forms the basis of many of our \\n\\t <a href=\\\"http://microformats.org/wiki/principles\\\">principles</a>, and \\n\\t in that regard, we’d like to recognize a few people and \\n\\t thank them for their years of volunteer service </p>\\n\\t \"\n }],\n \"summary\": [\"Last week the microformats.org community \\n\\t celebrated its 7th birthday at a gathering hosted by Mozilla in \\n\\t San Francisco and recognized accomplishments, challenges, and \\n\\t opportunities.\"],\n \"updated\": [\"2012-06-25 17:08:26\"]\n }\n }]\n }],\n \"rels\": {\n \"tag\": [\"http://example.com/tags/microformats\", \"http://example.com/tags/html\"],\n \"bookmark\": [\"http://microformats.org/2012/06/25/microformats-org-at-7\"]\n },\n \"rel-urls\": {\n \"http://example.com/tags/microformats\": {\n \"text\": \"microformats\",\n \"rels\": [\"tag\"]\n },\n \"http://example.com/tags/html\": {\n \"text\": \"html\",\n \"rels\": [\"tag\"]\n },\n \"http://microformats.org/2012/06/25/microformats-org-at-7\": {\n \"text\": \"microformats.org at 7\",\n \"rels\": [\"bookmark\"]\n }\n }\n}","html":"<section class=\"hfeed\">\n\t<h1 class=\"name\">Microformats blog</h1>\n\t<span class=\"author vcard\"><a class=\"fn url\" href=\"http://tantek.com/\">Tantek</a></span>\n\t<a class=\"url\" href=\"http://microformats.org/blog\">permlink</a>\n\t<img class=\"photo\" src=\"photo.jpeg\"/>\n\t<p>\n\t\tTags: <a rel=\"tag\" href=\"tags/microformats\">microformats</a>, \n\t\t<a rel=\"tag\" href=\"tags/html\">html</a>\n\t</p>\n\t\n\t<div class=\"hentry\">\n\t <h1><a class=\"entry-title\" rel=\"bookmark\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n\t <div class=\"entry-content\">\n\t <p class=\"entry-summary\">Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.</p>\n\t\n\t <p>The microformats tagline “humans first, machines second†\n\t forms the basis of many of our \n\t <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service </p>\n\t </div> \n\t <p>Updated \n\t <time class=\"updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time>\n\t </p>\n\t</div>\n\t\n</section>","name":"mf-v1-hfeed-simple"},{"json":"\n{\n \"items\": [{\n \"type\": [\"h-news\"],\n \"properties\": {\n \"entry\": [{\n \"value\": \"microformats.org at 7\",\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"name\": [\"microformats.org at 7\"],\n \"url\": [\"http://microformats.org/2012/06/25/microformats-org-at-7\"],\n \"content\": [{\n \"value\": \"Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\\n\\n The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n principles, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service\",\n \"html\": \"\\n <p class=\\\"entry-summary\\\">Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.</p>\\n\\n <p>The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n <a href=\\\"http://microformats.org/wiki/principles\\\">principles</a>, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service </p>\\n \"\n }],\n \"summary\": [\"Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\"],\n \"updated\": [\"2012-06-25 17:08:26\"],\n \"author\": [{\n \"value\": \"Tantek\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tantek\"],\n \"url\": [\"http://tantek.com/\"]\n }\n }]\n }\n }],\n \"dateline\": [{\n \"value\": \"San Francisco, \\n CA\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"adr\": [{\n \"value\": \"San Francisco, \\n CA\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"locality\": [\"San Francisco\"],\n \"region\": [\"CA\"]\n }\n }]\n }\n }],\n \"geo\": [{\n \"value\": \"37.774921;-122.445202\",\n \"type\": [\"h-geo\"],\n \"properties\": {\n \"name\": [\"37.774921;-122.445202\"]\n }\n }],\n \"source-org\": [{\n \"value\": \"microformats.org\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"microformats.org\"],\n \"org\": [\"microformats.org\"],\n \"url\": [\"http://microformats.org/\"]\n }\n }],\n \"principles\": [\"http://microformats.org/wiki/Category:public_domain_license\"]\n }\n }],\n \"rels\": {\n \"bookmark\": [\"http://microformats.org/2012/06/25/microformats-org-at-7\"],\n \"principles\": [\"http://microformats.org/wiki/Category:public_domain_license\"]\n },\n \"rel-urls\": {\n \"http://microformats.org/2012/06/25/microformats-org-at-7\": {\n \"text\": \"microformats.org at 7\",\n \"rels\": [\"bookmark\"]\n },\n \"http://microformats.org/wiki/Category:public_domain_license\": {\n \"text\": \"Publishing policy\",\n \"rels\": [\"principles\"]\n }\n }\n}","html":"<div class=\"hnews\">\n <div class=\"entry hentry\">\n <h1><a class=\"entry-title\" rel=\"bookmark\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n <div class=\"entry-content\">\n <p class=\"entry-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n </div> \n <p>Updated \n <time class=\"updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time> by\n <span class=\"author vcard\"><a class=\"fn url\" href=\"http://tantek.com/\">Tantek</a></span>\n </p>\n </div>\n\n <p>\n <span class=\"dateline vcard\">\n <span class=\"adr\">\n <span class=\"locality\">San Francisco</span>, \n <span class=\"region\">CA</span> \n </span>\n </span>\n (Geo: <span class=\"geo\">37.774921;-122.445202</span>) \n <span class=\"source-org vcard\">\n <a class=\"fn org url\" href=\"http://microformats.org/\">microformats.org</a>\n </span>\n </p>\n <p>\n <a rel=\"principles\" href=\"http://microformats.org/wiki/Category:public_domain_license\">Publishing policy</a>\n </p>\n</div>","name":"mf-v1-hnews-all"},{"json":"\n{\n \"items\": [{\n \"type\": [\"h-news\"],\n \"properties\": {\n \"entry\": [{\n \"value\": \"microformats.org at 7\",\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"name\": [\"microformats.org at 7\"],\n \"url\": [\"http://microformats.org/2012/06/25/microformats-org-at-7\"],\n \"content\": [{\n \"value\": \"Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\\n\\n The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n principles, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service\",\n \"html\": \"\\n <p class=\\\"entry-summary\\\">Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.</p>\\n\\n <p>The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n <a href=\\\"http://microformats.org/wiki/principles\\\">principles</a>, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service </p>\\n \"\n }],\n \"summary\": [\"Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\"],\n \"updated\": [\"2012-06-25 17:08:26\"],\n \"author\": [{\n \"value\": \"Tantek\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tantek\"],\n \"url\": [\"http://tantek.com/\"]\n }\n }]\n }\n }],\n \"source-org\": [{\n \"value\": \"microformats.org\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"microformats.org\"],\n \"org\": [\"microformats.org\"],\n \"url\": [\"http://microformats.org/\"]\n }\n }]\n }\n }],\n \"rels\": {\n \"bookmark\": [\"http://microformats.org/2012/06/25/microformats-org-at-7\"]\n },\n \"rel-urls\": {\n \"http://microformats.org/2012/06/25/microformats-org-at-7\": {\n \"text\": \"microformats.org at 7\",\n \"rels\": [\"bookmark\"]\n }\n }\n}","html":"<div class=\"hnews\">\n <div class=\"entry hentry\">\n <h1><a class=\"entry-title\" rel=\"bookmark\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n <div class=\"entry-content\">\n <p class=\"entry-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n </div> \n <p>Updated \n <time class=\"updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time> by\n <span class=\"author vcard\"><a class=\"fn url\" href=\"http://tantek.com/\">Tantek</a></span>\n </p>\n </div>\n\n <p class=\"source-org vcard\">\n <a class=\"fn org url\" href=\"http://microformats.org/\">microformats.org</a> \n </p>\n</div>","name":"mf-v1-hnews-minimum"},{"json":"{\n \"items\": [{\n \"type\": [\"h-product\"],\n \"properties\": {\n \"name\": [\"Raspberry Pi\"],\n \"photo\": [\"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg\"],\n \"description\": [{\n \"value\": \"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.\",\n \"html\": \"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.\"\n }],\n \"url\": [\"http://www.raspberrypi.org/\"],\n \"price\": [\"£29.95\"],\n \"review\": [{\n \"value\": \"9.2 out of \\n 10 \\n based on 178 reviews\",\n \"type\": [\"h-review-aggregate\"],\n \"properties\": {\n \"rating\": [\"9.2\"],\n \"average\": [\"9.2\"],\n \"best\": [\"10\"],\n \"count\": [\"178\"]\n }\n }],\n \"category\": [\"Computer\", \"Education\"],\n \"brand\": [{\n \"value\": \"The Raspberry Pi Foundation\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"The Raspberry Pi Foundation\"],\n \"org\": [\"The Raspberry Pi Foundation\"],\n \"adr\": [{\n \"value\": \"Cambridge \\n UK\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"locality\": [\"Cambridge\"],\n \"country-name\": [\"UK\"]\n }\n }]\n }\n }]\n }\n }],\n \"rels\": {\n \"tag\": [\"http://en.wikipedia.org/wiki/computer\", \"http://en.wikipedia.org/wiki/education\"]\n },\n \"rel-urls\": {\n \"http://en.wikipedia.org/wiki/computer\": {\n \"text\": \"Computer\",\n \"rels\": [\"tag\"]\n },\n \"http://en.wikipedia.org/wiki/education\": {\n \"text\": \"Education\",\n \"rels\": [\"tag\"]\n }\n }\n}","html":"<meta charset=\"utf-8\">\n<div class=\"hproduct\">\n <h2 class=\"fn\">Raspberry Pi</h2>\n <img class=\"photo\" src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg\" />\n <p class=\"description\">The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.</p>\n <a class=\"url\" href=\"http://www.raspberrypi.org/\">More info about the Raspberry Pi</a>\n <p class=\"price\">£29.95</p>\n <p class=\"review hreview-aggregate\">\n <span class=\"rating\">\n <span class=\"average value\">9.2</span> out of \n <span class=\"best\">10</span> \n based on <span class=\"count\">178</span> reviews\n </span>\n </p>\n <p>Categories: \n <a rel=\"tag\" href=\"http://en.wikipedia.org/wiki/computer\" class=\"category\">Computer</a>, \n <a rel=\"tag\" href=\"http://en.wikipedia.org/wiki/education\" class=\"category\">Education</a>\n </p>\n <p class=\"brand vcard\">From: \n <span class=\"fn org\">The Raspberry Pi Foundation</span> - \n <span class=\"adr\">\n <span class=\"locality\">Cambridge</span> \n <span class=\"country-name\">UK</span>\n </span>\n </p>\n</div>","name":"mf-v1-hproduct-aggregate"},{"json":"{\n \"items\": [{\n \"type\": [\"h-product\"],\n \"properties\": {\n \"name\": [\"Raspberry Pi\"],\n \"photo\": [\"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg\"],\n \"description\": [{\n \"value\": \"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.\",\n \"html\": \"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.\"\n }],\n \"url\": [\"http://www.raspberrypi.org/\"],\n \"price\": [\"£29.95\"],\n \"category\": [\"Computer\", \"Education\"],\n \"review\": [{\n \"value\": \"4.5 out of 5\",\n \"type\": [\"h-review\"],\n \"properties\": {\n \"rating\": [\"4.5\"]\n }\n }]\n }\n }],\n \"rels\": {\n \"tag\": [\"http://en.wikipedia.org/wiki/computer\", \"http://en.wikipedia.org/wiki/education\"]\n },\n \"rel-urls\": {\n \"http://en.wikipedia.org/wiki/computer\": {\n \"text\": \"Computer\",\n \"rels\": [\"tag\"]\n },\n \"http://en.wikipedia.org/wiki/education\": {\n \"text\": \"Education\",\n \"rels\": [\"tag\"]\n }\n }\n}","html":"<meta charset=\"utf-8\">\n<div class=\"hproduct\">\n <h2 class=\"fn\">Raspberry Pi</h2>\n <img class=\"photo\" src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg\" />\n <p class=\"description\">The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.</p>\n <a class=\"url\" href=\"http://www.raspberrypi.org/\">More info about the Raspberry Pi</a>\n <p class=\"price\">£29.95</p>\n <p class=\"review hreview\"><span class=\"rating\">4.5</span> out of 5</p>\n <p>Categories: \n <a rel=\"tag\" href=\"http://en.wikipedia.org/wiki/computer\" class=\"category\">Computer</a>, \n <a rel=\"tag\" href=\"http://en.wikipedia.org/wiki/education\" class=\"category\">Education</a>\n </p>\n</div>","name":"mf-v1-hproduct-simpleproperties"},{"json":"{\n \"items\": [{\n \"type\": [\"h-resume\"],\n \"properties\": {\n \"contact\": [{\n \"value\": \"Tim Berners-Lee\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tim Berners-Lee\"]\n }\n }],\n \"summary\": [\"invented the World Wide Web\"],\n \"affiliation\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"W3C\"],\n \"photo\": [\"http://www.w3.org/Icons/WWW/w3c_home_nb.png\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"hresume\">\n <p>\n <span class=\"contact vcard\"><span class=\"fn\">Tim Berners-Lee</span></span>, \n <span class=\"summary\">invented the World Wide Web</span>.\n </p>\n Belongs to following groups:\n <p> \n <a class=\"affiliation vcard\" href=\"http://www.w3.org/\">\n <img class=\"fn photo\" alt=\"W3C\" src=\"http://www.w3.org/Icons/WWW/w3c_home_nb.png\" />\n </a>\n </p> \n</div>","name":"mf-v1-hresume-affiliation"},{"json":"{\n \"items\": [{\n \"type\": [\"h-resume\"],\n \"properties\": {\n \"contact\": [{\n \"value\": \"Tim Berners-Lee\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tim Berners-Lee\"],\n \"org\": [\"MIT\"],\n \"adr\": [{\n \"value\": \"32 Vassar Street, \\n Room 32-G524, \\n Cambridge, \\n MA \\n 02139, \\n USA. \\n (Work)\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"32 Vassar Street\"],\n \"extended-address\": [\"Room 32-G524\"],\n \"locality\": [\"Cambridge\"],\n \"region\": [\"MA\"],\n \"postal-code\": [\"02139\"],\n \"country-name\": [\"USA\"]\n }\n }],\n \"tel\": [\"+1 (617) 253 5702\"],\n \"email\": [\"mailto:timbl@w3.org\"]\n }\n }],\n \"summary\": [\"Invented the World Wide Web.\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"hresume\">\n <div class=\"contact vcard\">\n <p class=\"fn\">Tim Berners-Lee</p>\n <p class=\"org\">MIT</p>\n <p class=\"adr\">\n <span class=\"street-address\">32 Vassar Street</span>, \n <span class=\"extended-address\">Room 32-G524</span>, \n <span class=\"locality\">Cambridge</span>, \n <span class=\"region\">MA</span> \n <span class=\"postal-code\">02139</span>, \n <span class=\"country-name\">USA</span>. \n (<span class=\"type\">Work</span>)\n </p>\n <p>Tel:<span class=\"tel\">+1 (617) 253 5702</span></p>\n <p>Email:<a class=\"email\" href=\"mailto:timbl@w3.org\">timbl@w3.org</a></p>\n </div>\n <p class=\"summary\">Invented the World Wide Web.</p>\n</div>","name":"mf-v1-hresume-contact"},{"json":"{\n \"items\": [{\n \"type\": [\"h-resume\"],\n \"properties\": {\n \"contact\": [{\n \"value\": \"Tim Berners-Lee\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tim Berners-Lee\"],\n \"job-title\": [\"Director of the World Wide Web Foundation\"]\n }\n }],\n \"summary\": [\"Invented the World Wide Web.\"],\n \"education\": [{\n \"value\": \"The Queen's College, Oxford University\",\n \"type\": [\"h-event\", \"h-card\"],\n \"properties\": {\n \"name\": [\"The Queen's College, Oxford University\"],\n \"org\": [\"The Queen's College, Oxford University\"],\n \"description\": [\"BA Hons (I) Physics\"],\n \"start\": [\"1973-09\"],\n \"end\": [\"1976-06\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"hresume\">\n <div class=\"contact vcard\">\n <p class=\"fn\">Tim Berners-Lee</p>\n <p class=\"title\">Director of the World Wide Web Foundation</p>\n </div>\n <p class=\"summary\">Invented the World Wide Web.</p><hr />\n <p class=\"education vevent vcard\">\n <span class=\"fn summary org\">The Queen's College, Oxford University</span>, \n <span class=\"description\">BA Hons (I) Physics</span> \n <time class=\"dtstart\" datetime=\"1973-09\">1973</time> –\n <time class=\"dtend\" datetime=\"1976-06\">1976</time>\n </p>\n</div>","name":"mf-v1-hresume-education"},{"json":"{\n \"items\": [{\n \"type\": [\"h-resume\"],\n \"properties\": {\n \"contact\": [{\n \"value\": \"Tim Berners-Lee\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tim Berners-Lee\"]\n }\n }],\n \"summary\": [\"invented the World Wide Web\"],\n \"skill\": [\"information systems\", \"advocacy\", \"leadership\"]\n }\n }],\n \"rels\": {\n \"tag\": [\"http://example.com/skills/informationsystems\", \"http://example.com/skills/advocacy\", \"http://example.com/skills/leadership\"]\n },\n \"rel-urls\": {\n \"http://example.com/skills/informationsystems\": {\n \"text\": \"information systems\",\n \"rels\": [\"tag\"]\n },\n \"http://example.com/skills/advocacy\": {\n \"text\": \"advocacy\",\n \"rels\": [\"tag\"]\n },\n \"http://example.com/skills/leadership\": {\n \"text\": \"leadership\",\n \"rels\": [\"tag\"]\n }\n }\n}","html":"<div class=\"hresume\"> \n <p>\n <span class=\"contact vcard\"><span class=\"fn\">Tim Berners-Lee</span></span>, \n <span class=\"summary\">invented the World Wide Web</span>.\n </p>\n Skills: \n <ul>\n <li><a class=\"skill\" rel=\"tag\" href=\"http://example.com/skills/informationsystems\">information systems</a></li>\n <li><a class=\"skill\" rel=\"tag\" href=\"http://example.com/skills/advocacy\">advocacy</a></li>\n <li><a class=\"skill\" rel=\"tag\" href=\"http://example.com/skills/leadership\">leadership</a></li>\n </ul>\n</div>","name":"mf-v1-hresume-skill"},{"json":"{\n \"items\": [{\n \"type\": [\"h-resume\"],\n \"properties\": {\n \"contact\": [{\n \"value\": \"Tim Berners-Lee\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tim Berners-Lee\"],\n \"job-title\": [\"Director of the World Wide Web Foundation\"]\n }\n }],\n \"summary\": [\"Invented the World Wide Web.\"],\n \"experience\": [{\n \"value\": \"World Wide Web Foundation\",\n \"type\": [\"h-event\", \"h-card\"],\n \"properties\": {\n \"job-title\": [\"Director\"],\n \"name\": [\"World Wide Web Foundation\"],\n \"org\": [\"World Wide Web Foundation\"],\n \"url\": [\"http://www.webfoundation.org/\"],\n \"start\": [\"2009-01-18\"],\n \"duration\": [\"P2Y11M\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<div class=\"hresume\">\n <div class=\"contact vcard\">\n <p class=\"fn\">Tim Berners-Lee</p>\n <p class=\"title\">Director of the World Wide Web Foundation</p>\n </div>\n <p class=\"summary\">Invented the World Wide Web.</p><hr />\n <div class=\"experience vevent vcard\">\n <p class=\"title\">Director</p>\n <p><a class=\"fn summary org url\" href=\"http://www.webfoundation.org/\">World Wide Web Foundation</a></p>\n <p>\n <time class=\"dtstart\" datetime=\"2009-01-18\">Jan 2009</time> – Present\n <time class=\"duration\" datetime=\"P2Y11M\">(2 years 11 month)</time>\n </p>\n </div>\n</div>","name":"mf-v1-hresume-work"},{"json":"{\n \"items\": [{\n \"type\": [\"h-review\"],\n \"properties\": {\n \"item\": [{\n \"value\": \"Crepes on Cole\",\n \"type\": [\"h-item\"],\n \"properties\": {\n \"photo\": [\"http://example.com/images/photo.gif\"],\n \"name\": [\"Crepes on Cole\"],\n \"url\": [\"http://example.com/crepeoncole\"]\n }\n }],\n \"rating\": [\"5\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<base href=\"http://example.com\">\n<div class=\"hreview\">\n <p class=\"item\">\n <img class=\"photo\" src=\"images/photo.gif\" />\n <a class=\"fn url\" href=\"http://example.com/crepeoncole\">Crepes on Cole</a>\n </p>\n <p><span class=\"rating\">5</span> out of 5 stars</p>\n</div>","name":"mf-v1-hreview-item"},{"json":"\n{\n \"items\": [{\n \"type\": [\"h-review\"],\n \"properties\": {\n \"rating\": [\"5\"],\n \"name\": [\"Crepes on Cole is awesome\"],\n \"reviewer\": [{\n \"value\": \"Tantek\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tantek\"]\n }\n }],\n \"description\": [{\n \"value\": \"Crepes on Cole is one of the best little \\n creperies in San Francisco.\\n Excellent food and service. Plenty of tables in a variety of sizes \\n for parties large and small. Window seating makes for excellent \\n people watching to/from the N-Judah which stops right outside. \\n I've had many fun social gatherings here, as well as gotten \\n plenty of work done thanks to neighborhood WiFi.\",\n \"html\": \"\\n <p class=\\\"item vcard\\\">\\n <span class=\\\"fn org\\\">Crepes on Cole</span> is one of the best little \\n creperies in <span class=\\\"adr\\\"><span class=\\\"locality\\\">San Francisco</span></span>.\\n Excellent food and service. Plenty of tables in a variety of sizes \\n for parties large and small. Window seating makes for excellent \\n people watching to/from the N-Judah which stops right outside. \\n I've had many fun social gatherings here, as well as gotten \\n plenty of work done thanks to neighborhood WiFi.\\n </p>\\n \"\n }],\n \"item\": [{\n \"value\": \"Crepes on Cole\",\n \"type\": [\"h-item\", \"h-card\"],\n \"properties\": {\n \"name\": [\"Crepes on Cole\"],\n \"org\": [\"Crepes on Cole\"],\n \"adr\": [{\n \"value\": \"San Francisco\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"locality\": [\"San Francisco\"]\n }\n }]\n }\n }],\n \"category\": [\"crepe\"],\n \"url\": [\"http://example.com/crepe\"]\n }\n }],\n \"rels\": {\n \"tag\": [\"http://en.wikipedia.org/wiki/crepe\"],\n \"self\": [\"http://example.com/crepe\"],\n \"bookmark\": [\"http://example.com/crepe\"],\n \"license\": [\"http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License\"]\n },\n \"rel-urls\": {\n \"http://en.wikipedia.org/wiki/crepe\": {\n \"text\": \"crepe\",\n \"rels\": [\"tag\"]\n },\n \"http://example.com/crepe\": {\n \"text\": \"http://example.com/crepe\",\n \"rels\": [\"self\", \"bookmark\"]\n },\n \"http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License\": {\n \"text\": \"Creative Commons Attribution-ShareAlike License\",\n \"rels\": [\"license\"]\n }\n }\n}","html":"<div class=\"hreview\">\n <span><span class=\"rating\">5</span> out of 5 stars</span>\n <h4 class=\"summary\">Crepes on Cole is awesome</h4>\n <span class=\"reviewer vcard\">\n Reviewer: <span class=\"fn\">Tantek</span> - \n </span>\n <time class=\"reviewed\" datetime=\"2005-04-18\">April 18, 2005</time>\n <div class=\"description\">\n <p class=\"item vcard\">\n <span class=\"fn org\">Crepes on Cole</span> is one of the best little \n creperies in <span class=\"adr\"><span class=\"locality\">San Francisco</span></span>.\n Excellent food and service. Plenty of tables in a variety of sizes \n for parties large and small. Window seating makes for excellent \n people watching to/from the N-Judah which stops right outside. \n I've had many fun social gatherings here, as well as gotten \n plenty of work done thanks to neighborhood WiFi.\n </p>\n </div>\n <p>Visit date: <span>April 2005</span></p>\n <p>Food eaten: <a rel=\"tag\" href=\"http://en.wikipedia.org/wiki/crepe\">crepe</a></p>\n <p>Permanent link for review: <a rel=\"self bookmark\" href=\"http://example.com/crepe\">http://example.com/crepe</a></p>\n <p><a rel=\"license\" href=\"http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License\">Creative Commons Attribution-ShareAlike License</a></p>\n</div>","name":"mf-v1-hreview-vcard"},{"json":"{\n \"items\": [{\n \"type\": [\"h-review-aggregate\"],\n \"properties\": {\n \"item\": [{\n \"value\": \"Mediterranean Wraps\",\n \"type\": [\"h-item\", \"h-card\"],\n \"properties\": {\n \"name\": [\"Mediterranean Wraps\"],\n \"org\": [\"Mediterranean Wraps\"],\n \"adr\": [{\n \"value\": \"433 S California Ave, \\n Palo Alto, \\n CA\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"433 S California Ave\"],\n \"locality\": [\"Palo Alto\"],\n \"region\": [\"CA\"]\n }\n }],\n \"tel\": [\"(650) 321-8189\"]\n }\n }],\n \"rating\": [\"9.2\"],\n \"average\": [\"9.2\"],\n \"best\": [\"10\"],\n \"count\": [\"17\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"hreview-aggregate\">\n <div class=\"item vcard\">\n <h3 class=\"fn org\">Mediterranean Wraps</h3> \n <p>\n <span class=\"adr\">\n <span class=\"street-address\">433 S California Ave</span>, \n <span class=\"locality\">Palo Alto</span>, \n <span class=\"region\">CA</span></span> - \n \n <span class=\"tel\">(650) 321-8189</span>\n </p>\n </div> \n <p class=\"rating\">\n <span class=\"average value\">9.2</span> out of \n <span class=\"best\">10</span> \n based on <span class=\"count\">17</span> reviews\n </p>\n</div>","name":"mf-v1-hreview-aggregate-hcard"},{"json":"{\n \"items\": [{\n \"type\": [\"h-review-aggregate\"],\n \"properties\": {\n \"item\": [{\n \"value\": \"Mediterranean Wraps\",\n \"type\": [\"h-item\"],\n \"properties\": {\n \"name\": [\"Mediterranean Wraps\"],\n \"url\": [\"http://example.com/mediterraneanwraps\"]\n }\n }],\n \"rating\": [\"4.5\"],\n \"count\": [\"6\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}\n","html":"<p class=\"hreview-aggregate\">\n <span class=\"item\">\n <a class=\"fn url\" href=\"http://example.com/mediterraneanwraps\">Mediterranean Wraps</a>\n </span> - Rated: \n <span class=\"rating\">4.5</span> out of 5 (<span class=\"count\">6</span> reviews)\n</p>","name":"mf-v1-hreview-aggregate-justahyperlink"},{"json":"{\n \"items\": [{\n \"type\": [\"h-review-aggregate\"],\n \"properties\": {\n \"item\": [{\n \"value\": \"Fullfrontal\",\n \"type\": [\"h-item\", \"h-event\"],\n \"properties\": {\n \"name\": [\"Fullfrontal\"],\n \"description\": [\"A one day JavaScript Conference held in Brighton\"],\n \"start\": [\"2012-11-09\"]\n }\n }],\n \"rating\": [\"9.9\"],\n \"average\": [\"9.9\"],\n \"best\": [\"10\"],\n \"count\": [\"62\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"hreview-aggregate\">\n <div class=\"item vevent\">\n <h3 class=\"summary\">Fullfrontal</h3>\n <p class=\"description\">A one day JavaScript Conference held in Brighton</p>\n <p><time class=\"dtstart\" datetime=\"2012-11-09\">9th November 2012</time></p> \n </div> \n \n <p class=\"rating\">\n <span class=\"average value\">9.9</span> out of \n <span class=\"best\">10</span> \n based on <span class=\"count\">62</span> reviews\n </p>\n</div>","name":"mf-v1-hreview-aggregate-vevent"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"org\": [\"Mozilla\"],\n \"adr\": [{\n \"value\": \"665 3rd St. \\n Suite 207 \\n San Francisco, \\n CA \\n 94107 \\n U.S.A.\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"665 3rd St.\"],\n \"extended-address\": [\"Suite 207\"],\n \"locality\": [\"San Francisco\"],\n \"region\": [\"CA\"],\n \"postal-code\": [\"94107\"],\n \"country-name\": [\"U.S.A.\"]\n }\n }]\n }\n }, {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"org\": [\"Mozilla\"],\n \"adr\": [{\n \"value\": \"665 3rd St. \\n Suite 207 \\n San Francisco, \\n CA \\n 94107 \\n U.S.A.\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"665 3rd St.\"],\n \"extended-address\": [\"Suite 207\"],\n \"locality\": [\"San Francisco\"],\n \"region\": [\"CA\"],\n \"postal-code\": [\"94107\"],\n \"country-name\": [\"U.S.A.\"]\n }\n }]\n }\n }, {\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"665 3rd St.\"],\n \"extended-address\": [\"Suite 207\"],\n \"locality\": [\"San Francisco\"],\n \"region\": [\"CA\"],\n \"postal-code\": [\"94107\"],\n \"country-name\": [\"U.S.A.\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"vcard\" itemref=\"mozilla-org mozilla-adr\">\n <span class=\"name\">Brendan Eich</span>\n</div>\n<div class=\"vcard\" itemref=\"mozilla-org mozilla-adr\">\n <span class=\"name\">Mitchell Baker</span>\n</div>\n\n<p id=\"mozilla-org\" class=\"org\">Mozilla</p>\n<p id=\"mozilla-adr\" class=\"adr\">\n <span class=\"street-address\">665 3rd St.</span> \n <span class=\"extended-address\">Suite 207</span> \n <span class=\"locality\">San Francisco</span>, \n <span class=\"region\">CA</span> \n <span class=\"postal-code\">94107</span> \n <span class=\"country-name\">U.S.A.</span> \n</p>","name":"mf-v1-includes-hcarditemref"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"location\": [{\n \"value\": \"Room 10\\n \\n Moscone Center, \\n San Francisco\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"extended-address\": [\"Room 10\", \"Moscone Center\"],\n \"locality\": [\"San Francisco\"]\n }\n }],\n \"start\": [\"2012-06-27 15:45:00-08:00\"],\n \"end\": [\"2012-06-27 16:45:00-08:00\"]\n }\n }, {\n \"type\": [\"h-event\"],\n \"properties\": {\n \"location\": [{\n \"value\": \"Room 11\\n \\n Moscone Center, \\n San Francisco\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"extended-address\": [\"Room 11\", \"Moscone Center\"],\n \"locality\": [\"San Francisco\"]\n }\n }],\n \"start\": [\"2012-06-27 15:45:00-08:00\"],\n \"end\": [\"2012-06-27 16:45:00-08:00\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"vevent\" itemref=\"io-session07\">\n <span class=\"name\">Monetizing Android Apps</span> - spaekers: \n <span class=\"speaker\">Chrix Finne</span>, \n <span class=\"speaker\">Kenneth Lui</span> - \n <span itemref=\"io-location\" class=\"location adr\">\n <span class=\"extended-address\">Room 10</span>\n </span> \n</div>\n<div class=\"vevent\" itemref=\"io-session07\">\n <span class=\"name\">New Low-Level Media APIs in Android</span> - spaekers: \n <span class=\"speaker\">Dave Burke</span> -\n <span itemref=\"io-location\" class=\"location adr\">\n <span class=\"extended-address\">Room 11</span>\n </span> \n</div>\n\n<p id=\"io-session07\">\n Session 01 is between: \n <time class=\"dtstart\" datetime=\"2012-06-27T15:45:00-0800\">3:45PM</time> to \n <time class=\"dtend\" datetime=\"2012-06-27T16:45:00-0800\">4:45PM</time> \n</p> \n<p id=\"io-location\">\n <span class=\"extended-address\">Moscone Center</span>, \n <span class=\"locality\">San Francisco</span> \n</p>","name":"mf-v1-includes-heventitemref"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"org\": [\"Twitter\"],\n \"adr\": [{\n \"value\": \"1355 Market St,\\n San Francisco, \\n CA\\n 94103\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"1355 Market St\"],\n \"locality\": [\"San Francisco\"],\n \"region\": [\"CA\"],\n \"postal-code\": [\"94103\"]\n }\n }]\n }\n }, {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"org\": [\"Twitter\"],\n \"adr\": [{\n \"value\": \"1355 Market St,\\n San Francisco, \\n CA\\n 94103\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"1355 Market St\"],\n \"locality\": [\"San Francisco\"],\n \"region\": [\"CA\"],\n \"postal-code\": [\"94103\"]\n }\n }]\n }\n }, {\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"1355 Market St\"],\n \"locality\": [\"San Francisco\"],\n \"region\": [\"CA\"],\n \"postal-code\": [\"94103\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"vcard\">\n <span class=\"name\">Ben Ward</span>\n <a class=\"include\" href=\"#twitter\">Twitter</a>\n</div>\n<div class=\"vcard\">\n <span class=\"name\">Dan Webb</span>\n <a class=\"include\" href=\"#twitter\">Twitter</a>\n</div>\n\n<div id=\"twitter\">\n <p class=\"org\">Twitter</p>\n <p class=\"adr\">\n <span class=\"street-address\">1355 Market St</span>,\n <span class=\"locality\">San Francisco</span>, \n <span class=\"region\">CA</span>\n <span class=\"postal-code\">94103</span>\n </p>\n</div>","name":"mf-v1-includes-hyperlink"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"start\": [\"2012-10-30 11:45:00-08:00\"],\n \"name\": [\"Build Conference\"],\n \"location\": [{\n \"value\": \"Redmond, \\n Washington, \\n USA\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"locality\": [\"Redmond\"],\n \"region\": [\"Washington\"],\n \"country-name\": [\"USA\"]\n }\n }]\n }\n }, {\n \"type\": [\"h-event\"],\n \"properties\": {\n \"start\": [\"2012-10-31 11:15:00-08:00\"],\n \"name\": [\"Build Conference\"],\n \"location\": [{\n \"value\": \"Redmond, \\n Washington, \\n USA\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"locality\": [\"Redmond\"],\n \"region\": [\"Washington\"],\n \"country-name\": [\"USA\"]\n }\n }]\n }\n }, {\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"locality\": [\"Redmond\"],\n \"region\": [\"Washington\"],\n \"country-name\": [\"USA\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"vevent\">\n <span class=\"name\">HTML5 & CSS3 latest features in action!</span> - \n <span class=\"speaker\">David Rousset</span> -\n <time class=\"dtstart\" datetime=\"2012-10-30T11:45:00-08:00\">Tue 11:45am</time>\n <object data=\"#buildconf\" class=\"include\" type=\"text/html\" height=\"0\" width=\"0\"></object>\n</div>\n<div class=\"vevent\">\n <span class=\"name\">Building High-Performing JavaScript for Modern Engines</span> -\n <span class=\"speaker\">John-David Dalton</span> and \n <span class=\"speaker\">Amanda Silver</span> -\n <time class=\"dtstart\" datetime=\"2012-10-31T11:15:00-08:00\">Wed 11:15am</time>\n <object data=\"#buildconf\" class=\"include\" type=\"text/html\" height=\"0\" width=\"0\"></object>\n</div>\n\n\n<div id=\"buildconf\">\n <p class=\"summary\">Build Conference</p>\n <p class=\"location adr\">\n <span class=\"locality\">Redmond</span>, \n <span class=\"region\">Washington</span>, \n <span class=\"country-name\">USA</span>\n </p>\n</div>","name":"mf-v1-includes-object"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Chris Mills\"],\n \"url\": [\"http://dev.opera.com/\"],\n \"org\": [\"Opera\"]\n }\n }, {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Erik Möller\"],\n \"url\": [\"http://dev.opera.com/\"],\n \"org\": [\"Opera\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<table>\n <tr>\n <th id=\"org\"><a class=\"url org\" href=\"http://dev.opera.com/\">Opera</a></th>\n </tr>\n <tr>\n <td class=\"vcard\" headers=\"org\"><span class=\"fn\">Chris Mills</span></td>\n </tr>\n <tr>\n <td class=\"vcard\" headers=\"org\"><span class=\"fn\">Erik Möller</span></td>\n </tr>\n </table>","name":"mf-v1-includes-table"},{"json":"{\n \"items\": [{\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"name\": [\"Bricklayer's Arms\"],\n \"label\": [\"3 Charlotte Road, \\n City of London, \\n EC2A 3PE, \\n UK\"],\n \"street-address\": [\"3 Charlotte Road\"],\n \"locality\": [\"City of London\"],\n \"postal-code\": [\"EC2A 3PE\"],\n \"country-name\": [\"UK\"],\n \"geo\": [\"51.526421;-0.081067\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"h-adr\">\n <span class=\"p-name\">Bricklayer's Arms</span>\n <span class=\"p-label\"> \n <span class=\"p-street-address\">3 Charlotte Road</span>, \n <span class=\"p-locality\">City of London</span>, \n <span class=\"p-postal-code\">EC2A 3PE</span>, \n <span class=\"p-country-name\">UK</span> \n </span> – \n Geo:(<span class=\"p-geo\">51.526421;-0.081067</span>) \n</p>","name":"mf-v2-h-adr-geo"},{"json":"{\n \"items\": [{\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"name\": [\"Bricklayer's Arms\"],\n \"geo\": [\"geo:51.526421;-0.081067;crs=wgs84;u=40\"],\n \"locality\": [\"London\"],\n \"url\": [\"geo:51.526421;-0.081067;crs=wgs84;u=40\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"h-adr\">\n <a class=\"p-name u-geo\" href=\"geo:51.526421;-0.081067;crs=wgs84;u=40\">Bricklayer's Arms</a>, \n <span class=\"p-locality\">London</span> \n</p>","name":"mf-v2-h-adr-geourl"},{"json":"{\n \"items\": [{\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"name\": [\"665 3rd St. Suite 207 San Francisco, CA 94107 U.S.A.\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"h-adr\">665 3rd St. Suite 207 San Francisco, CA 94107 U.S.A.</p>","name":"mf-v2-h-adr-justaname"},{"json":"{\n \"items\": [{\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"street-address\": [\"665 3rd St.\"],\n \"extended-address\": [\"Suite 207\"],\n \"locality\": [\"San Francisco\"],\n \"region\": [\"CA\"],\n \"postal-code\": [\"94107\"],\n \"country-name\": [\"U.S.A.\"],\n \"name\": [\"665 3rd St. \\n Suite 207 \\n San Francisco, \\n CA \\n 94107 \\n U.S.A.\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"h-adr\">\n <span class=\"p-street-address\">665 3rd St.</span> \n <span class=\"p-extended-address\">Suite 207</span> \n <span class=\"p-locality\">San Francisco</span>, \n <span class=\"p-region\">CA</span> \n <span class=\"p-postal-code\">94107</span> \n <span class=\"p-country-name\">U.S.A.</span> \n</p>","name":"mf-v2-h-adr-simpleproperties"},{"json":"{\n \"items\": [{\n \"type\": [\"h-entry\", \"h-as-note\"],\n \"properties\": {\n \"in-reply-to\": [{\n \"value\": \"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far\",\n \"type\": [\"h-cite\"],\n \"properties\": {\n \"name\": [\"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far\"],\n \"url\": [\"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far\"]\n }\n },\n {\n \"value\": \"https://twitter.com/benwerd/status/604733231284383744\",\n \"type\": [\"h-cite\"],\n \"properties\": {\n \"name\": [\"https://twitter.com/benwerd/status/604733231284383744\"],\n \"url\": [\"https://twitter.com/benwerd/status/604733231284383744\"]\n }\n }],\n \"author\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tantek Çelik\"],\n \"photo\": [\"http://tantek.com/images/photo.gif\"],\n \"url\": [\"http://tantek.com/\"]\n }\n }],\n \"name\": [\"@benwerd\\n @erinjoalso proud of you &\\n @withknown— so much #indieweb & especially user empathy. Keep up the great work!\"],\n \"content\": [{\n \"value\": \"@benwerd\\n @erinjoalso proud of you &\\n @withknown— so much #indieweb & especially user empathy. Keep up the great work!\",\n \"html\": \"\\n <a class=\\\"auto-link h-x-username\\\" href=\\\"https://twitter.com/benwerd\\\">@benwerd</a>\\n <a class=\\\"auto-link h-x-username\\\" href=\\\"https://twitter.com/erinjo\\\">@erinjo</a>also proud of you &\\n <a class=\\\"auto-link h-x-username\\\" href=\\\"https://twitter.com/withknown\\\">@withknown</a>— so much #indieweb & especially user empathy. Keep up the great work!\"\n }],\n \"published\": [\"2015-06-01 22:20-07:00\"],\n \"updated\": [\"2015-06-01 22:20-07:00\"],\n \"url\": [\"http://tantek.com/2015/152/t2/proud-withknown-indieweb-user-empathy\"],\n \"uid\": [\"http://tantek.com/2015/152/t2/proud-withknown-indieweb-user-empathy\"],\n \"syndication\": [\"https://twitter.com/t/status/605604965566906369\"]\n },\n \"children\": [{\n \"value\": \"@benwerd\",\n \"type\": [\"h-x-username\"],\n \"properties\": {\n \"name\": [\"@benwerd\"],\n \"url\": [\"https://twitter.com/benwerd\"]\n }\n },\n {\n \"value\": \"@erinjo\",\n \"type\": [\"h-x-username\"],\n \"properties\": {\n \"name\": [\"@erinjo\"],\n \"url\": [\"https://twitter.com/erinjo\"]\n }\n },\n {\n \"value\": \"@withknown\",\n \"type\": [\"h-x-username\"],\n \"properties\": {\n \"name\": [\"@withknown\"],\n \"url\": [\"https://twitter.com/withknown\"]\n }\n }]\n }],\n \"rels\": {\n \"prev\": [\"http://tantek.com/152/t1/congrats-fellow-elected-w3cab-members\"],\n \"next\": [\"http://tantek.com/152/t3/going-indiewebcamp-2015-portland\"],\n \"in-reply-to\": [\"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far\", \"https://twitter.com/benwerd/status/604733231284383744\"],\n \"author\": [\"http://tantek.com/\"],\n \"syndication\": [\"https://twitter.com/t/status/605604965566906369\"]\n },\n \"rel-urls\": {\n \"http://tantek.com/152/t1/congrats-fellow-elected-w3cab-members\": {\n \"title\": \"View the previous (older) item in the stream.\",\n \"text\": \"â†\",\n \"rels\": [\"prev\"]\n },\n \"http://tantek.com/152/t3/going-indiewebcamp-2015-portland\": {\n \"title\": \"View the next (newer) item in the stream\",\n \"text\": \"→\",\n \"rels\": [\"next\"]\n },\n \"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far\": {\n \"text\": \"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far\",\n \"rels\": [\"in-reply-to\"]\n },\n \"https://twitter.com/benwerd/status/604733231284383744\": {\n \"text\": \"https://twitter.com/benwerd/status/604733231284383744\",\n \"rels\": [\"in-reply-to\"]\n },\n \"http://tantek.com/\": {\n \"title\": \"Tantek Çelik\",\n \"rels\": [\"author\"]\n },\n \"https://twitter.com/t/status/605604965566906369\": {\n \"text\": \"View \\n Conversation\\n on Twitter\",\n \"rels\": [\"syndication\"]\n }\n }\n}","html":"<!-- http://tantek.com/2015/152/t2/proud-withknown-indieweb-user-empathy -->\n<base href=\"http://tantek.com/\" />\n\n<li class=\"h-entry hentry h-as-note\">\n <div>\n <ul>\n <li>\n <a href=\"152/t1/congrats-fellow-elected-w3cab-members\" id=\"previtem\" title=\"View the previous (older) item in the stream.\"\n rel=\"prev\"><abbr title=\"Previous\">â†</abbr></a>\n </li>\n <li>\n <a href=\"152/t3/going-indiewebcamp-2015-portland\" id=\"nextitem\" title=\"View the next (newer) item in the stream\" rel=\"next\"><abbr title=\"Next\">→</abbr></a>\n </li>\n </ul>\n </div>\n <div>In reply to:\n <p>\n <a class=\"u-in-reply-to h-cite\" rel=\"in-reply-to\" href=\"http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far\">http://werd.io/2015/im-super-proud-of-everything-weve-done-on-withknown-so-far</a>\n </p>\n <p>\n <a class=\"u-in-reply-to h-cite\" rel=\"in-reply-to\" href=\"https://twitter.com/benwerd/status/604733231284383744\">https://twitter.com/benwerd/status/604733231284383744</a>\n </p>\n <hr>\n </div>\n <a href=\"../\" class=\"p-author h-card\" rel=\"author\" title=\"Tantek Çelik\"><img src=\"/images/photo.gif\" alt=\"Tantek Çelik\"></a>\n <p class=\"p-name entry-title e-content entry-content article\">\n <a class=\"auto-link h-x-username\" href=\"https://twitter.com/benwerd\">@benwerd</a>\n <a class=\"auto-link h-x-username\" href=\"https://twitter.com/erinjo\">@erinjo</a>also proud of you &amp;\n <a class=\"auto-link h-x-username\" href=\"https://twitter.com/withknown\">@withknown</a>— so much #indieweb &amp; especially user empathy. Keep up the great work!</p>\n <span>\n <span class=\"dt-published published dt-updated updated\">\n <time class=\"value\" datetime=\"22:20-0700\">22:20</time>on\n <time class=\"value\">2015-06-01</time>\n </span>\n <span class=\"lt\">(ttk.me t4bT2)</span>using\n <span class=\"using\">BBEdit</span>\n </span>\n <div>\n <form action=\"http://tantek.com/2015/152/t2/proud-withknown-indieweb-user-empathy\">\n <div>\n <label>\n <span class=\"lt\">URL:</span>\n <input class=\"u-url url u-uid uid bookmark\" type=\"url\" size=\"70\" style=\"max-width:100%\" value=\"http://tantek.com/2015/152/t2/proud-withknown-indieweb-user-empathy\">\n </label>\n </div>\n </form>\n </div>\n <div>\n <a class=\"u-syndication\" rel=\"syndication\" style=\"float:right;\" href=\"https://twitter.com/t/status/605604965566906369\">\n <img src=\"/images/photo.gif\" style=\"vertical-align:-30%\" alt=\"\"> \n View \n Conversation\n on Twitter\n</a>\n </div>\n</li>","name":"mf-v2-h-as-note-note"},{"json":" {\n\t\"items\": [{\n \"type\": [\n \"h-card\"\n ],\n \"properties\": {\n \"name\": [\n \"Mitchell Baker\"\n ],\n \"url\": [\"http://blog.lizardwrangler.com/\"],\n \"org\": [{\n \"value\": \"Mozilla Foundation\",\n \"type\": [\n \"h-card\"\n ],\n \"properties\": {\n \"name\": [\"Mozilla Foundation\"],\n \"url\": [\"http://example.org/bios/mitchell-baker/\"]\n }\n }],\n \"photo\": [\"http://example.org/images/photo.gif\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}\n","html":"<base href=\"http://example.org\"/>\n<div class=\"h-card\">\n <a class=\"p-name u-url\" href=\"http://blog.lizardwrangler.com/\">Mitchell Baker</a> \n (<a class=\"p-org h-card\" href=\"bios/mitchell-baker/\">Mozilla Foundation</a>)\n <img class=\"u-photo\" src=\"images/photo.gif\"/>\n</div>","name":"mf-v2-h-card-baseurl"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"HÃ¥kon Wium Lie\"],\n \"photo\": [\"http://upload.wikimedia.org/wikipedia/commons/thumb/9/96/H%C3%A5kon-Wium-Lie-2009-03.jpg/215px-H%C3%A5kon-Wium-Lie-2009-03.jpg\"],\n \"url\": [\"http://people.opera.com/howcome/\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<a class=\"h-card\" href=\"http://people.opera.com/howcome/\" title=\"HÃ¥kon Wium Lie, CTO Opera\">\n <article>\n <h2 class=\"p-name\">HÃ¥kon Wium Lie</h2>\n <img src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/9/96/H%C3%A5kon-Wium-Lie-2009-03.jpg/215px-H%C3%A5kon-Wium-Lie-2009-03.jpg\" />\n </article>\n</a>","name":"mf-v2-h-card-childimplied"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"photo\": [\"http://blog.mozilla.org/press/files/2012/04/mitchell-baker.jpg\"],\n \"url\": [\"http://blog.lizardwrangler.com/\", \"https://twitter.com/MitchellBaker\"],\n \"name\": [\"Mitchell Baker\"],\n \"org\": [\"Mozilla Foundation\"],\n \"note\": [\"Mitchell is responsible for setting the direction and scope of the Mozilla Foundation and its activities.\"],\n \"category\": [\"Strategy\", \"Leadership\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-card\">\n <img class=\"u-photo\" alt=\"photo of Mitchell\" src=\"http://blog.mozilla.org/press/files/2012/04/mitchell-baker.jpg\" />\n <p>\n <a class=\"p-name u-url\" href=\"http://blog.lizardwrangler.com/\">Mitchell Baker</a>\n (<a class=\"u-url\" href=\"https://twitter.com/MitchellBaker\">@MitchellBaker</a>)\n <span class=\"p-org\">Mozilla Foundation</span>\n </p>\n <p class=\"p-note\">Mitchell is responsible for setting the direction and scope of the Mozilla Foundation and its activities.</p>\n <p><span class=\"p-category\">Strategy</span> and <span class=\"p-category\">Leadership</span></p>\n</div>","name":"mf-v2-h-card-extendeddescription"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"url\": [\"http://blog.lizardwrangler.com/\"],\n \"name\": [\"Mitchell Baker\"],\n \"org\": [{\n \"value\": \"Mozilla Foundation\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Mozilla Foundation\"],\n \"url\": [\"http://mozilla.org/\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-card\">\n <a class=\"p-name u-url\" href=\"http://blog.lizardwrangler.com/\">Mitchell Baker</a> \n (<a class=\"p-org h-card\" href=\"http://mozilla.org/\">Mozilla Foundation</a>)\n</div>","name":"mf-v2-h-card-hcard"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Mitchell Baker\"],\n \"url\": [\"http://blog.lizardwrangler.com/\"],\n \"org\": [{\n \"value\": \"Mozilla Foundation\",\n \"type\": [\"h-card\", \"h-org\"],\n \"properties\": {\n \"name\": [\"Mozilla Foundation\"],\n \"url\": [\"http://mozilla.org/\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-card\">\n <a class=\"p-name u-url\" href=\"http://blog.lizardwrangler.com/\">Mitchell Baker</a> \n (<a class=\"p-org h-card h-org\" href=\"http://mozilla.org/\">Mozilla Foundation</a>)\n</div>","name":"mf-v2-h-card-horghcard"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Rohit Khare\"],\n \"photo\": [\"http://example.com/images/photo.gif\"],\n \"url\": [\"http://rohit.khare.org/\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<a class=\"h-card\" href=\"http://rohit.khare.org/\">\n <img alt=\"Rohit Khare\" src=\"images/photo.gif\" />\n </a>","name":"mf-v2-h-card-hyperlinkedphoto"},{"json":"{ \n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"photo\": [\"http://example.com/jane.html\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"url\": [\"http://example.com/jane.html\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"photo\": [\"http://example.com/jane.html\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"url\": [\"http://example.com/jane.html\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"photo\": [\"http://example.com/jane.html\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"url\": [\"http://example.com/jane.html\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Name\"]\n },\n \"children\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"John Doe\"],\n \"photo\": [\"http://example.com/john.html\"]\n }\n }]\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Name\"]\n },\n \"children\": [{\n \"value\": \"Name\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"John Doe\"],\n \"photo\": [\"http://example.com/john.html\"]\n }\n }]\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"\n<img class=\"h-card\" src=\"jane.html\" alt=\"Jane Doe\"/>\n<area class=\"h-card\" href=\"jane.html\" alt=\"Jane Doe\"></area>\n<abbr class=\"h-card\" title=\"Jane Doe\">JD</abbr>\n\n<div class=\"h-card\"><img src=\"jane.html\" alt=\"Jane Doe\"/></div>\n<div class=\"h-card\"><area href=\"jane.html\" alt=\"Jane Doe\"></area></div>\n<div class=\"h-card\"><abbr title=\"Jane Doe\">JD</abbr></div>\n\n<div class=\"h-card\"><span><img src=\"jane.html\" alt=\"Jane Doe\"/></span></div>\n<div class=\"h-card\"><span><area href=\"jane.html\" alt=\"Jane Doe\"></area></span></div>\n<div class=\"h-card\"><span><abbr title=\"Jane Doe\">JD</abbr></span></div>\n\n<div class=\"h-card\"><img class=\"h-card\" src=\"john.html\" alt=\"John Doe\"/>Name</div>\n<div class=\"h-card\"><span class=\"h-card\"><img src=\"john.html\" alt=\"John Doe\"/>Name</span></div>\n","name":"mf-v2-h-card-impliedname"},{"json":" {\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"photo\": [\"http://example.com/jane.jpeg\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"photo\": [\"http://example.com/jane.jpeg\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"photo\": [\"http://example.com/jane.jpeg\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"photo\": [\"http://example.com/jane.jpeg\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"photo\": [\"http://example.com/jane.jpeg\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"photo\": [\"http://example.com/jane.jpeg\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"]\n },\n \"children\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"photo\": [\"http://example.com/jane.jpeg\"]\n }\n }]\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"]\n },\n \"children\": [{\n \"value\": \"Jane Doe\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"photo\": [\"http://example.com/jane.jpeg\"]\n }\n }]\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<img class=\"h-card\" alt=\"Jane Doe\" src=\"jane.jpeg\"/>\n<object class=\"h-card\" data=\"jane.jpeg\"/>Jane Doe</object>\n\n<div class=\"h-card\"><img alt=\"Jane Doe\" src=\"jane.jpeg\"/></div> \n<div class=\"h-card\"><object data=\"jane.jpeg\"/>Jane Doe</object></div> \n\n<div class=\"h-card\"><span><img alt=\"Jane Doe\" src=\"jane.jpeg\"/></span></div> \n<div class=\"h-card\"><span><object data=\"jane.jpeg\"/>Jane Doe</object></span></div> \n\n<div class=\"h-card\"><img class=\"h-card\" alt=\"Jane Doe\" src=\"jane.jpeg\"/>Jane Doe</div> \n<div class=\"h-card\"><span class=\"h-card\"><object data=\"jane.jpeg\"/>Jane Doe</object></span></div> ","name":"mf-v2-h-card-impliedphoto"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"url\": [\"http://example.com/jane.html\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"url\": [\"http://example.com/jane.html\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"url\": [\"http://example.com/jane.html\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"url\": [\"http://example.com/jane.html\"]\n }\n },\n {\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"]\n },\n \"children\": [{\n \"value\": \"Jane Doe\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Jane Doe\"],\n \"url\": [\"http://example.com/jane.html\"]\n }\n }]\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<a class=\"h-card\" href=\"jane.html\">Jane Doe</a>\n<area class=\"h-card\" href=\"jane.html\" alt=\"Jane Doe\"/ >\n<div class=\"h-card\" ><a href=\"jane.html\">Jane Doe</a><p></p></div> \n<div class=\"h-card\" ><area href=\"jane.html\">Jane Doe</area><p></p></div>\n<div class=\"h-card\" ><a class=\"h-card\" href=\"jane.html\">Jane Doe</a><p></p></div> ","name":"mf-v2-h-card-impliedurl"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Ben Ward\"],\n \"url\": [\"http://benward.me/\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<a class=\"h-card\" href=\"http://benward.me/\">Ben Ward</a>","name":"mf-v2-h-card-justahyperlink"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Frances Berriman\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"h-card\">Frances Berriman</p>","name":"mf-v2-h-card-justaname"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Mitchell Baker\"],\n \"url\": [\"http://blog.lizardwrangler.com/\"]\n },\n \"children\": [{\n \"value\": \"Mozilla Foundation\",\n \"type\": [\"h-org\", \"h-card\"],\n \"properties\": {\n \"name\": [\"Mozilla Foundation\"],\n \"url\": [\"http://mozilla.org/\"]\n }\n }]\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-card\">\n <a class=\"p-name u-url\" href=\"http://blog.lizardwrangler.com/\">Mitchell Baker</a> \n (<a class=\"h-org h-card\" href=\"http://mozilla.org/\">Mozilla Foundation</a>)\n</div>","name":"mf-v2-h-card-nested"},{"json":"{\n \"items\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"John Doe\"],\n \"given-name\": [\"John\"],\n \"additional-name\": [\"Peter\"],\n \"family-name\": [\"Doe\"],\n \"honorific-suffix\": [\"MSc\", \"PHD\"],\n \"org\": [\"Madgex\", \"Mozilla\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-card\">\n \n <span class=\"p-name\">\n <span class=\"p-given-name value\">John</span> \n <abbr class=\"p-additional-name\" title=\"Peter\">P</abbr> \n <span class=\"p-family-name value \">Doe</span> \n </span>\n <data class=\"p-honorific-suffix\" value=\"MSc\"></data>\n \n \n <br class=\"p-honorific-suffix\" />BSc<br />\n <hr class=\"p-honorific-suffix\" />BA\n \n \n <img class=\"p-honorific-suffix\" src=\"images/logo.gif\" alt=\"PHD\" />\n <img src=\"images/logo.gif\" alt=\"company logos\" usemap=\"#logomap\" />\n <map name=\"logomap\">\n <area class=\"p-org\" shape=\"rect\" coords=\"0,0,82,126\" href=\"madgex.htm\" alt=\"Madgex\" />\n <area class=\"p-org\" shape=\"circle\" coords=\"90,58,3\" href=\"mozilla.htm\" alt=\"Mozilla\" />\n </map>\n</div>","name":"mf-v2-h-card-p-property"},{"json":"\n {\n\t\"items\": [{\n \"type\": [\n \"h-card\"\n ],\n \"properties\": {\n \"name\": [\n \"Mitchell Baker\"\n ],\n \"url\": [\"http://blog.lizardwrangler.com/\"],\n \"org\": [\n {\n \"value\": \"Mozilla Foundation\",\n \"type\": [\n \"h-card\"\n ],\n \"properties\": {\n \"name\": [\"Mozilla Foundation\"],\n \"url\": [\"http://example.com/bios/mitchell-baker/\"]\n }\n }\n ],\n \"photo\": [\"http://example.com/bios/mitchell-baker/picture.jpeg\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}\n","html":"<base href=\"http://example.com\" >\n<div class=\"h-card\">\n <a class=\"p-name u-url\" href=\"http://blog.lizardwrangler.com/\">Mitchell Baker</a> \n (<a class=\"p-org h-card\" href=\"bios/mitchell-baker/\">Mozilla Foundation</a>)\n <img class=\"u-photo\" src=\"bios/mitchell-baker/picture.jpeg\"/>\n</div>","name":"mf-v2-h-card-relativeurls"},{"json":"{\n \"items\": [{\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"in-reply-to\": [{\n \"type\": [\"h-cite\"],\n \"properties\": {\n \"name\": [\"Example Post\"],\n \"url\": [\"http://example.com/post\"],\n\n \"author\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"url\": [\"http://example.com\"],\n \"name\": [\"Example Author\"]\n },\n \"value\": \"Example Author\"\n }]\n },\n \"value\": \"http://example.com/post\"\n }],\n \"name\": [\"Example Author\\n Home\\n \\n Example Post\"]\n }\n }],\n\t\"rels\": {},\n\t\"rel-urls\": {}\n}","html":"<div class=\"h-entry\">\n <div class=\"u-in-reply-to h-cite\">\n <span class=\"p-author h-card\">\n <span class=\"p-name\">Example Author</span>\n <a class=\"u-url\" href=\"http://example.com\">Home</a>\n </span>\n <a class=\"p-name u-url\" href=\"http://example.com/post\">Example Post</a>\n </div>\n</div>","name":"mf-v2-h-entry-impliedvalue-nested"},{"json":"{\n \"items\": [{\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"name\": [\"microformats.org at 7\"],\n \"url\": [\"http://microformats.org/2012/06/25/microformats-org-at-7\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<a class=\"h-entry\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a>","name":"mf-v2-h-entry-justahyperlink"},{"json":"{\n \"items\": [{\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"name\": [\"microformats.org at 7\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"h-entry\">microformats.org at 7</p>","name":"mf-v2-h-entry-justaname"},{"json":"{\n \"items\": [{\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"url\": [\"http://microformats.org/2012/06/25/microformats-org-at-7\"],\n \"name\": [\"microformats.org at 7\"],\n \"content\": [{\n \"value\": \"Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\\n\\n The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n principles, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service\",\n \"html\": \"\\n <p class=\\\"p-summary\\\">Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.</p>\\n\\n <p>The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n <a href=\\\"http://microformats.org/wiki/principles\\\">principles</a>, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service </p>\\n \"\n }],\n \"summary\": [\"Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\"],\n \"updated\": [\"2012-06-25 17:08:26\"],\n \"author\": [{\n \"value\": \"Tantek\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tantek\"],\n \"url\": [\"http://tantek.com/\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<div class=\"h-entry\">\n <h1><a class=\"p-name u-url\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n <div class=\"e-content\">\n <p class=\"p-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n </div> \n <p>Updated \n <time class=\"dt-updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time> by\n <a class=\"p-author h-card\" href=\"http://tantek.com/\">Tantek</a>\n </p>\n</div>","name":"mf-v2-h-entry-summarycontent"},{"json":"{\n \"items\": [{\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"name\": [\"microformats.org at 7\"],\n \"url\": [\"http://microformats.org/\", \"http://microformats.org/2012/06/25/microformats-org-at-7\", \"http://microformats.org/2012/06/25/microformats-org-at-7\", \"http://microformats.org/\", \"http://microformats.org/wiki/microformats2-parsing\", \"http://microformats.org/wiki/value-class-pattern\", \"http://microformats.org/wiki/\", \"http://microformats.org/discuss\"],\n \"photo\": [\"http://example.com/images/logo.gif\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<base href=\"http://example.com\">\n<div class=\"h-entry\">\n <p class=\"p-name\">microformats.org at 7</p>\n\n \n <p class=\"u-url\">\n <span class=\"value-title\" title=\"http://microformats.org/\"> </span>\n Article permalink\n </p>\n <p class=\"u-url\">\n <span class=\"value\">http://microformats.org/</span> - \n <span class=\"value\">2012/06/25/microformats-org-at-7</span> \n </p> \n\n <p><a class=\"u-url\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">Article permalink</a></p>\n\n <img src=\"images/logo.gif\" alt=\"company logos\" usemap=\"#logomap\" />\n <map name=\"logomap\">\n <area class=\"u-url\" shape=\"rect\" coords=\"0,0,82,126\" href=\"http://microformats.org/\" alt=\"microformats.org\" />\n </map>\n\n <img class=\"u-photo\" src=\"images/logo.gif\" alt=\"company logos\" />\n\n <object class=\"u-url\" data=\"http://microformats.org/wiki/microformats2-parsing\"></object>\n\n <abbr class=\"u-url\" title=\"http://microformats.org/wiki/value-class-pattern\">value-class-pattern</abbr> \n <data class=\"u-url\" value=\"http://microformats.org/wiki/\"></data>\n <p class=\"u-url\">http://microformats.org/discuss</p>\n</div>","name":"mf-v2-h-entry-u-property"},{"json":"{\n \"items\": [{\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"name\": [\"Expanding URLs within HTML content\"],\n \"content\": [{\n \"value\": \"Should not change: http://www.w3.org/\\n Should not change: http://example.com/\\n File relative: test.html = http://example.com/test.html\\n Directory relative: /test/test.html = http://example.com/test/test.html\\n Relative to root: /test.html = http://example.com/test.html\",\n \"html\": \"\\n <ul>\\n <li><a href=\\\"http://www.w3.org/\\\">Should not change: http://www.w3.org/</a></li>\\n <li><a href=\\\"http://example.com/\\\">Should not change: http://example.com/</a></li>\\n <li><a href=\\\"http://example.com/test.html\\\">File relative: test.html = http://example.com/test.html</a></li>\\n <li><a href=\\\"http://example.com/test/test.html\\\">Directory relative: /test/test.html = http://example.com/test/test.html</a></li>\\n <li><a href=\\\"http://example.com/test.html\\\">Relative to root: /test.html = http://example.com/test.html</a></li>\\n </ul>\\n <img src=\\\"http://example.com/images/photo.gif\\\" />\\n \"\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-entry\">\n <h1><a class=\"p-name\">Expanding URLs within HTML content</a></h1>\n <div class=\"e-content\">\n <ul>\n <li><a href=\"http://www.w3.org/\">Should not change: http://www.w3.org/</a></li>\n <li><a href=\"http://example.com/\">Should not change: http://example.com/</a></li>\n <li><a href=\"test.html\">File relative: test.html = http://example.com/test.html</a></li>\n <li><a href=\"/test/test.html\">Directory relative: /test/test.html = http://example.com/test/test.html</a></li>\n <li><a href=\"/test.html\">Relative to root: /test.html = http://example.com/test.html</a></li>\n </ul>\n <img src=\"images/photo.gif\" />\n </div> \n</div>","name":"mf-v2-h-entry-urlincontent"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"The 4th Microformat party\"],\n \"start\": [\n \"2009-06-26 19:00:00\", \n \"2009-06-26 07:00:00\", \n \"2009-06-26 19:00\", \n \"2009-06-26 19\", \n \"2009-06-26 19\", \n \"2009-06-26 19:00\", \n \"2009-06-26 19:00\", \n \"2009-06-26 19:00\", \n \"2009-06-26 07:00\"\n ]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<span class=\"h-event\">\n <span class=\"p-name\">The 4th Microformat party</span> will be on \n <ul>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00:00pm \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00:00am \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00pm \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07pm \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">7pm \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">7:00pm \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00p.m. \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">07:00PM \n </span></li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <span class=\"value\">7:00am \n </span></li>\n </ul>\n</span>","name":"mf-v2-h-event-ampm"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"CPJ Online Press Freedom Summit\"],\n \"start\": [\"2012-10-10\"],\n \"location\": [\"San Francisco\"],\n \"attendee\": [{\n \"value\": \"Brian Warner\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Brian Warner\"]\n }\n }, {\n \"value\": \"Kyle Machulis\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Kyle Machulis\"]\n }\n }, {\n \"value\": \"Tantek Çelik\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tantek Çelik\"]\n }\n }, {\n \"value\": \"Sid Sutter\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Sid Sutter\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<div class=\"h-event\">\n <span class=\"p-name\">CPJ Online Press Freedom Summit</span>\n (<time class=\"dt-start\" datetime=\"2012-10-10\">10 Nov 2012</time>) in\n <span class=\"p-location\">San Francisco</span>.\n Attendees:\n <ul>\n <li class=\"p-attendee h-card\">Brian Warner</li>\n <li class=\"p-attendee h-card\">Kyle Machulis</li>\n <li class=\"p-attendee h-card\">Tantek Çelik</li>\n <li class=\"p-attendee h-card\">Sid Sutter</li>\n </ul>\n</div>\n","name":"mf-v2-h-event-attendees"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"IndieWebCamp 2012\"],\n \"url\": [\"http://indiewebcamp.com/2012\"],\n \"start\": [\"2012-06-30\"],\n \"end\": [\"2012-07-01\"],\n \"location\": [{\n \"value\": \"Geoloqi\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Geoloqi\"],\n \"org\": [\"Geoloqi\"],\n \"url\": [\"http://geoloqi.com/\"],\n \"street-address\": [\"920 SW 3rd Ave. Suite 400\"],\n \"locality\": [\"Portland\"],\n \"region\": [\"Oregon\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-event\">\n <a class=\"p-name u-url\" href=\"http://indiewebcamp.com/2012\">\n IndieWebCamp 2012\n </a>\n from <time class=\"dt-start\">2012-06-30</time> \n to <time class=\"dt-end\">2012-07-01</time> at \n <span class=\"p-location h-card\">\n <a class=\"p-name p-org u-url\" href=\"http://geoloqi.com/\">Geoloqi</a>, \n <span class=\"p-street-address\">920 SW 3rd Ave. Suite 400</span>, \n <span class=\"p-locality\">Portland</span>, \n <abbr class=\"p-region\" title=\"Oregon\">OR</abbr>\n </span>\n</div>","name":"mf-v2-h-event-combining"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"The 4th Microformat party\"],\n \"start\": [\"2009-06-26 19:00\"],\n \"end\": [\"2009-06-26 22:00\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<span class=\"h-event\">\n <span class=\"p-name\">The 4th Microformat party</span> will be on \n <span class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00</time></span> to \n <span class=\"dt-end\"><time class=\"value\">22:00</time></span>.\n</span>","name":"mf-v2-h-event-concatenate"},{"json":"{\n \"items\": [\n {\n \"type\": [\n \"h-event\"\n ],\n \"properties\": {\n \"name\": [\n \"The 4th Microformat party\"\n ],\n \"start\": [\n \"2009-06-26 19:00-08:00\",\n \"2009-06-26 19:00-08\",\n \"2009-06-26 19:00-08:00\",\n \"2009-06-26 19:00+08:00\",\n \"2009-06-26 19:00+08:00\",\n \"2009-06-26 19:00Z\",\n \"2009-06-26 19:00-08:00\",\n \"2009-06-26 19:00:00-08:00\"\n ]\n }\n }\n ],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<section class=\"h-event\">\n\t<p><span class=\"p-name\">The 4th Microformat party</span> will be on:</p>\n\t<ul>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26T19:00-08:00\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26T19:00-08\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26T19:00-0800\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26T19:00+0800\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26T19:00+08:00\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26T19:00Z\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26t19:00-08:00\">26 July</time></li>\n\t\t<li><time class=\"dt-start\" datetime=\"2009-06-26 19:00:00-08:00\">26 July</time></li>\n\t</ul>\n</section>","name":"mf-v2-h-event-dates"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"The party\"],\n \"start\": [\n \"2013-03-14\", \n \"2013-06-25 07:00:00\", \n \"2013-06-26\", \n \"2013-06-27\", \n \"2013-06-28\", \n \"2013-06-29\", \n \"2013-07-01\", \n \"2013-07-02\"\n ]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<span class=\"h-event\">\n <span class=\"p-name\">The party</span> will be on \n \n <p class=\"dt-start\">\n <span class=\"value-title\" title=\"2013-03-14\"> </span>\n March 14th 2013\n </p>\n <p class=\"dt-start\">\n <time class=\"value\" datetime=\"2013-06-25\">25 July</time>, from\n <span class=\"value\">07:00:00am \n </span></p> \n \n <p>\n <time class=\"dt-start\" datetime=\"2013-06-26\">26 June</time>\n \n <ins class=\"dt-start\" datetime=\"2013-06-27\">Just added</ins>, \n <del class=\"dt-start\" datetime=\"2013-06-28\">Removed</del>\n </p>\n <abbr class=\"dt-start\" title=\"2013-06-29\">June 29</abbr> \n <data class=\"dt-start\" value=\"2013-07-01\"></data>\n <p class=\"dt-start\">2013-07-02</p>\n \n</span>","name":"mf-v2-h-event-dt-property"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"IndieWebCamp 2012\"],\n \"url\": [\"http://indiewebcamp.com/2012\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<a class=\"h-event\" href=\"http://indiewebcamp.com/2012\">IndieWebCamp 2012</a>","name":"mf-v2-h-event-justahyperlink"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"IndieWebCamp 2012\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"h-event\">IndieWebCamp 2012</p>","name":"mf-v2-h-event-justaname"},{"json":"{\n \"items\": [{\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"The 4th Microformat party\"],\n \"start\": [\n \"2009-06-26 19:00:00-08:00\", \n \"2009-06-26 19:00:00-08:00\", \n \"2009-06-26 19:00:00+08:00\", \n \"2009-06-26 19:00:00Z\", \n \"2009-06-26 19:00:00\", \n \"2009-06-26 19:00-08:00\", \n \"2009-06-26 19:00+08:00\", \n \"2009-06-26 19:00Z\", \n \"2009-06-26 19:00\"\n ],\n \"end\": [\n \"2013-034\", \n \"2013-06-27 15:34\"\n ]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<span class=\"h-event\">\n <span class=\"p-name\">The 4th Microformat party</span> will be on \n <ul>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00-08:00</time> \n </li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00-0800</time> \n </li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00+0800</time> \n </li> \n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00Z</time> \n </li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00:00</time> \n </li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00-08:00</time> \n </li> \n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00+08:00</time> \n </li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00Z</time> \n </li>\n <li class=\"dt-start\">\n <time class=\"value\" datetime=\"2009-06-26\">26 July</time>, from\n <time class=\"value\">19:00</time> \n </li> \n <li>\n <time class=\"dt-end\" datetime=\"2013-034\">3 February 2013</time>\n </li>\n <li>\n <time class=\"dt-end\" datetime=\"2013-06-27 15:34\">26 July 2013</time>\n </li> \n </ul>\n</span>","name":"mf-v2-h-event-time"},{"json":"{\n \"items\": [{\n \"type\": [\"h-feed\"],\n \"properties\": {\n \"name\": [\"microformats blog\"]\n },\n \"children\": [{\n \"value\": \"microformats.org at 7\\n\\t\\t \\n\\t\\t Last week the microformats.org community \\n\\t\\t celebrated its 7th birthday at a gathering hosted by Mozilla in \\n\\t\\t San Francisco and recognized accomplishments, challenges, and \\n\\t\\t opportunities.\\n\\t\\t\\n\\t\\t The microformats tagline “humans first, machines second†\\n\\t\\t forms the basis of many of our \\n\\t\\t principles, and \\n\\t\\t in that regard, we’d like to recognize a few people and \\n\\t\\t thank them for their years of volunteer service \\n\\t\\t \\n\\t\\t Updated \\n\\t\\t June 25th, 2012\",\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"name\": [\"microformats.org at 7\"],\n \"url\": [\"http://microformats.org/2012/06/25/microformats-org-at-7\"],\n \"content\": [{\n \"value\": \"Last week the microformats.org community \\n\\t\\t celebrated its 7th birthday at a gathering hosted by Mozilla in \\n\\t\\t San Francisco and recognized accomplishments, challenges, and \\n\\t\\t opportunities.\\n\\t\\t\\n\\t\\t The microformats tagline “humans first, machines second†\\n\\t\\t forms the basis of many of our \\n\\t\\t principles, and \\n\\t\\t in that regard, we’d like to recognize a few people and \\n\\t\\t thank them for their years of volunteer service\",\n \"html\": \"\\n\\t\\t <p class=\\\"p-summary\\\">Last week the microformats.org community \\n\\t\\t celebrated its 7th birthday at a gathering hosted by Mozilla in \\n\\t\\t San Francisco and recognized accomplishments, challenges, and \\n\\t\\t opportunities.</p>\\n\\t\\t\\n\\t\\t <p>The microformats tagline “humans first, machines second†\\n\\t\\t forms the basis of many of our \\n\\t\\t <a href=\\\"http://microformats.org/wiki/principles\\\">principles</a>, and \\n\\t\\t in that regard, we’d like to recognize a few people and \\n\\t\\t thank them for their years of volunteer service </p>\\n\\t\\t \"\n }],\n \"summary\": [\"Last week the microformats.org community \\n\\t\\t celebrated its 7th birthday at a gathering hosted by Mozilla in \\n\\t\\t San Francisco and recognized accomplishments, challenges, and \\n\\t\\t opportunities.\"],\n \"updated\": [\"2012-06-25 17:08:26\"]\n }\n }]\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"\n<html>\n\t<head>\n\t\t<title>microformats blog</title>\n\t</head>\n\t<body>\n\t<section class=\"h-feed\">\n\t\t\n\t\t<div class=\"h-entry\">\n\t\t <h1><a class=\"p-name u-url\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n\t\t <div class=\"e-content\">\n\t\t <p class=\"p-summary\">Last week the microformats.org community \n\t\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t\t San Francisco and recognized accomplishments, challenges, and \n\t\t opportunities.</p>\n\t\t\n\t\t <p>The microformats tagline “humans first, machines second†\n\t\t forms the basis of many of our \n\t\t <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n\t\t in that regard, we’d like to recognize a few people and \n\t\t thank them for their years of volunteer service </p>\n\t\t </div> \n\t\t <p>Updated \n\t\t <time class=\"dt-updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time>\n\t\t </p>\n\t\t</div>\n\t\t\n\t</section>\n\t</body>\n</html>","name":"mf-v2-h-feed-implied-title"},{"json":"{\n \"items\": [{\n \"type\": [\"h-feed\"],\n \"properties\": {\n \"name\": [\"Microformats blog\"],\n \"author\": [{\n \"value\": \"Tantek\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tantek\"],\n \"url\": [\"http://tantek.com/\"]\n }\n }],\n \"url\": [\"http://microformats.org/blog\"],\n \"photo\": [\"http://example.com/photo.jpeg\"]\n },\n \"children\": [{\n \"value\": \"microformats.org at 7\\n\\t \\n\\t Last week the microformats.org community \\n\\t celebrated its 7th birthday at a gathering hosted by Mozilla in \\n\\t San Francisco and recognized accomplishments, challenges, and \\n\\t opportunities.\\n\\t\\n\\t The microformats tagline “humans first, machines second†\\n\\t forms the basis of many of our \\n\\t principles, and \\n\\t in that regard, we’d like to recognize a few people and \\n\\t thank them for their years of volunteer service \\n\\t \\n\\t Updated \\n\\t June 25th, 2012\",\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"name\": [\"microformats.org at 7\"],\n \"url\": [\"http://microformats.org/2012/06/25/microformats-org-at-7\"],\n \"content\": [{\n \"value\": \"Last week the microformats.org community \\n\\t celebrated its 7th birthday at a gathering hosted by Mozilla in \\n\\t San Francisco and recognized accomplishments, challenges, and \\n\\t opportunities.\\n\\t\\n\\t The microformats tagline “humans first, machines second†\\n\\t forms the basis of many of our \\n\\t principles, and \\n\\t in that regard, we’d like to recognize a few people and \\n\\t thank them for their years of volunteer service\",\n \"html\": \"\\n\\t <p class=\\\"p-summary\\\">Last week the microformats.org community \\n\\t celebrated its 7th birthday at a gathering hosted by Mozilla in \\n\\t San Francisco and recognized accomplishments, challenges, and \\n\\t opportunities.</p>\\n\\t\\n\\t <p>The microformats tagline “humans first, machines second†\\n\\t forms the basis of many of our \\n\\t <a href=\\\"http://microformats.org/wiki/principles\\\">principles</a>, and \\n\\t in that regard, we’d like to recognize a few people and \\n\\t thank them for their years of volunteer service </p>\\n\\t \"\n }],\n \"summary\": [\"Last week the microformats.org community \\n\\t celebrated its 7th birthday at a gathering hosted by Mozilla in \\n\\t San Francisco and recognized accomplishments, challenges, and \\n\\t opportunities.\"],\n \"updated\": [\"2012-06-25 17:08:26\"]\n }\n }]\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<section class=\"h-feed\">\n\t<h1 class=\"p-name\">Microformats blog</h1>\n\t<a class=\"p-author h-card\" href=\"http://tantek.com/\">Tantek</a>\n\t<a class=\"u-url\" href=\"http://microformats.org/blog\">permlink</a>\n\t<img class=\"u-photo\" src=\"photo.jpeg\"/>\n\t\n\t<div class=\"h-entry\">\n\t <h1><a class=\"p-name u-url\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n\t <div class=\"e-content\">\n\t <p class=\"p-summary\">Last week the microformats.org community \n\t celebrated its 7th birthday at a gathering hosted by Mozilla in \n\t San Francisco and recognized accomplishments, challenges, and \n\t opportunities.</p>\n\t\n\t <p>The microformats tagline “humans first, machines second†\n\t forms the basis of many of our \n\t <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n\t in that regard, we’d like to recognize a few people and \n\t thank them for their years of volunteer service </p>\n\t </div> \n\t <p>Updated \n\t <time class=\"dt-updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time>\n\t </p>\n\t</div>\n\t\n</section>","name":"mf-v2-h-feed-simple"},{"json":"{\n \"items\": [{\n \"type\": [\"h-geo\"],\n \"properties\": {\n \"latitude\": [\"37.408183\"],\n \"longitude\": [\"-122.13855\"],\n \"name\": [\"N 37° 24.491, \\n W 122° 08.313\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<p class=\"h-geo\">\n <abbr class=\"p-latitude\" title=\"37.408183\">N 37° 24.491</abbr>, \n <abbr class=\"p-longitude\" title=\"-122.13855\">W 122° 08.313</abbr>\n</p>","name":"mf-v2-h-geo-abbrpattern"},{"json":"{\n \"items\": [{\n \"type\": [\"h-geo\"],\n \"properties\": {\n \"name\": [\"Pen-y-ghent\"],\n \"latitude\": [\"54.155278\"],\n \"longitude\": [\"-2.249722\"],\n \"altitude\": [\"694\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p>My favourite hill in the lakes is \n <span class=\"h-geo\">\n <span class=\"p-name\">Pen-y-ghent</span> \n (Geo: <span class=\"p-latitude\">54.155278</span>,\n <span class=\"p-longitude\">-2.249722</span>). It\n raises to <span class=\"p-altitude\">694</span>m.\n </span>\n</p>","name":"mf-v2-h-geo-altitude"},{"json":"{\n \"items\": [{\n \"type\": [\"h-geo\"],\n \"properties\": {\n \"latitude\": [\"51.513458\"],\n \"longitude\": [\"-0.14812\"],\n \"name\": [\"The Bricklayer's Arms\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p>\n <span class=\"h-geo\">The Bricklayer's Arms\n <span class=\"p-latitude\">\n <span class=\"value-title\" title=\"51.513458\"> </span> \n </span>\n <span class=\"p-longitude\">\n <span class=\"value-title\" title=\"-0.14812\"> </span>\n </span>\n </span>\n</p>","name":"mf-v2-h-geo-hidden"},{"json":"{\n \"items\": [{\n \"type\": [\"h-geo\"],\n \"properties\": {\n \"name\": [\"51.513458;-0.14812\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p>On my way to The Bricklayer's Arms\n (Geo: <span class=\"h-geo\">51.513458;-0.14812</span>)\n</p>","name":"mf-v2-h-geo-justaname"},{"json":"{\n \"items\": [{\n \"type\": [\"h-geo\"],\n \"properties\": {\n \"name\": [\"The Bricklayer's Arms\"],\n \"latitude\": [\"51.513458\"],\n \"longitude\": [\"-0.14812\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"h-geo\">We are meeting at \n <span class=\"p-name\">The Bricklayer's Arms</span>\n (Geo: <span class=\"p-latitude\">51.513458</span>:\n <span class=\"p-longitude\">-0.14812</span>)\n</p>","name":"mf-v2-h-geo-simpleproperties"},{"json":"{\n \"items\": [{\n \"type\": [\"h-geo\"],\n \"properties\": {\n \"latitude\": [\"51.513458\"],\n \"longitude\": [\"-0.14812\"],\n \"name\": [\"N 51° 51.345, \\n \\n \\n W -0° 14.812\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<p>\n <span class=\"h-geo\">\n <span class=\"p-latitude\">\n <span class=\"value-title\" title=\"51.513458\">N 51° 51.345</span>, \n </span>\n <span class=\"p-longitude\">\n <span class=\"value-title\" title=\"-0.14812\">W -0° 14.812</span>\n </span>\n </span>\n</p>","name":"mf-v2-h-geo-valuetitleclass"},{"json":"{\n \"items\": [{\n \"type\": [\"h-news\"],\n \"properties\": {\n \"entry\": [{\n \"value\": \"microformats.org at 7\",\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"name\": [\"microformats.org at 7\"],\n \"url\": [\"http://microformats.org/2012/06/25/microformats-org-at-7\"],\n \"content\": [{\n \"value\": \"Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\\n\\n The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n principles, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service\",\n \"html\": \"\\n <p class=\\\"p-summary\\\">Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.</p>\\n\\n <p>The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n <a href=\\\"http://microformats.org/wiki/principles\\\">principles</a>, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service </p>\\n \"\n }],\n \"summary\": [\"Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\"],\n \"updated\": [\"2012-06-25 17:08:26\"],\n \"author\": [{\n \"value\": \"Tantek\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tantek\"],\n \"url\": [\"http://tantek.com/\"]\n }\n }]\n }\n }],\n \"dateline\": [{\n \"value\": \"San Francisco, \\n CA\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"locality\": [\"San Francisco\"],\n \"region\": [\"CA\"],\n \"name\": [\"San Francisco, \\n CA\"]\n }\n }],\n \"geo\": [\"37.774921;-122.445202\"],\n \"source-org\": [{\n \"value\": \"microformats.org\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"microformats.org\"],\n \"url\": [\"http://microformats.org/\"]\n }\n }],\n \"principles\": [\"http://microformats.org/wiki/Category:public_domain_license\"],\n \"name\": [\"microformats.org at 7\\n \\n Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\\n\\n The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n principles, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service \\n \\n Updated \\n June 25th, 2012 by\\n Tantek\\n \\n \\n\\n \\n \\n San Francisco, \\n CA \\n \\n (Geo: 37.774921;-122.445202) \\n \\n microformats.org\\n \\n \\n \\n Publishing policy\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-news\">\n <div class=\"p-entry h-entry\">\n <h1><a class=\"p-name u-url\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n <div class=\"e-content\">\n <p class=\"p-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n </div> \n <p>Updated \n <time class=\"dt-updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time> by\n <a class=\"p-author h-card\" href=\"http://tantek.com/\">Tantek</a>\n </p>\n </div>\n\n <p>\n <span class=\"p-dateline h-adr\">\n <span class=\"p-locality\">San Francisco</span>, \n <span class=\"p-region\">CA</span> \n </span>\n (Geo: <span class=\"p-geo\">37.774921;-122.445202</span>) \n <span class=\"p-source-org h-card\">\n <a class=\"p-name u-url\" href=\"http://microformats.org/\">microformats.org</a>\n </span>\n </p>\n <p>\n <a class=\"u-principles\" href=\"http://microformats.org/wiki/Category:public_domain_license\">Publishing policy</a>\n </p>\n</div>","name":"mf-v2-h-news-all"},{"json":"{\n \"items\": [{\n \"type\": [\"h-news\"],\n \"properties\": {\n \"entry\": [{\n \"value\": \"microformats.org at 7\",\n \"type\": [\"h-entry\"],\n \"properties\": {\n \"name\": [\"microformats.org at 7\"],\n \"url\": [\"http://microformats.org/2012/06/25/microformats-org-at-7\"],\n \"content\": [{\n \"value\": \"Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\\n\\n The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n principles, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service\",\n \"html\": \"\\n <p class=\\\"p-summary\\\">Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.</p>\\n\\n <p>The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n <a href=\\\"http://microformats.org/wiki/principles\\\">principles</a>, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service </p>\\n \"\n }],\n \"summary\": [\"Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\"],\n \"updated\": [\"2012-06-25 17:08:26\"],\n \"author\": [{\n \"value\": \"Tantek\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tantek\"],\n \"url\": [\"http://tantek.com/\"]\n }\n }]\n }\n }],\n \"source-org\": [{\n \"value\": \"microformats.org\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"microformats.org\"],\n \"url\": [\"http://microformats.org/\"]\n }\n }],\n \"name\": [\"microformats.org at 7\\n \\n Last week the microformats.org community \\n celebrated its 7th birthday at a gathering hosted by Mozilla in \\n San Francisco and recognized accomplishments, challenges, and \\n opportunities.\\n\\n The microformats tagline “humans first, machines second†\\n forms the basis of many of our \\n principles, and \\n in that regard, we’d like to recognize a few people and \\n thank them for their years of volunteer service \\n \\n Updated \\n June 25th, 2012 by\\n Tantek\\n \\n \\n \\n microformats.org\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-news\">\n <div class=\"p-entry h-entry\">\n <h1><a class=\"p-name u-url\" href=\"http://microformats.org/2012/06/25/microformats-org-at-7\">microformats.org at 7</a></h1>\n <div class=\"e-content\">\n <p class=\"p-summary\">Last week the microformats.org community \n celebrated its 7th birthday at a gathering hosted by Mozilla in \n San Francisco and recognized accomplishments, challenges, and \n opportunities.</p>\n\n <p>The microformats tagline “humans first, machines second†\n forms the basis of many of our \n <a href=\"http://microformats.org/wiki/principles\">principles</a>, and \n in that regard, we’d like to recognize a few people and \n thank them for their years of volunteer service </p>\n </div> \n <p>Updated \n <time class=\"dt-updated\" datetime=\"2012-06-25T17:08:26\">June 25th, 2012</time> by\n <a class=\"p-author h-card\" href=\"http://tantek.com/\">Tantek</a>\n </p>\n </div>\n <p>\n <a class=\"p-source-org h-card\" href=\"http://microformats.org/\">microformats.org</a> \n </p>\n</div>","name":"mf-v2-h-news-minimum"},{"json":"{\n \"items\": [{\n \"type\": [\"h-org\"],\n \"properties\": {\n \"name\": [\"Mozilla Foundation\"],\n \"url\": [\"http://mozilla.org/\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<a class=\"h-org\" href=\"http://mozilla.org/\">Mozilla Foundation</a>","name":"mf-v2-h-org-hyperlink"},{"json":"{\n \"items\": [{\n \"type\": [\"h-org\"],\n \"properties\": {\n \"name\": [\"Mozilla Foundation\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<span class=\"h-org\">Mozilla Foundation</span>","name":"mf-v2-h-org-simple"},{"json":"{\n \"items\": [{\n \"type\": [\"h-org\"],\n \"properties\": {\n \"organization-name\": [\"W3C\"],\n \"organization-unit\": [\"CSS Working Group\"],\n \"name\": [\"W3C - \\n CSS Working Group\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"h-org\">\n <span class=\"p-organization-name\">W3C</span> - \n <span class=\"p-organization-unit\">CSS Working Group</span>\n</p>","name":"mf-v2-h-org-simpleproperties"},{"json":"{\n \"items\": [{\n \"type\": [\"h-product\"],\n \"properties\": {\n \"name\": [\"Raspberry Pi\"],\n \"photo\": [\"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg\"],\n \"description\": [{\n \"value\": \"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.\",\n \"html\": \"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.\"\n }],\n \"url\": [\"http://www.raspberrypi.org/\"],\n \"price\": [\"£29.95\"],\n \"review\": [{\n \"value\": \"9.2 out of \\n 10 \\n based on 178 reviews\",\n \"type\": [\"h-review-aggregate\"],\n \"properties\": {\n \"rating\": [{\n \"value\": \"9.2 out of \\n 10 \\n based on 178 reviews\",\n \"type\": [\"h-rating\"],\n \"properties\": {\n \"average\": [\"9.2\"],\n \"best\": [\"10\"],\n \"count\": [\"178\"],\n \"name\": [\"9.2 out of \\n 10 \\n based on 178 reviews\"]\n }\n }],\n \"name\": [\"9.2 out of \\n 10 \\n based on 178 reviews\"]\n }\n }],\n \"category\": [\"Computer\", \"Education\"],\n \"brand\": [{\n \"value\": \"The Raspberry Pi Foundation\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"The Raspberry Pi Foundation\"],\n \"org\": [\"The Raspberry Pi Foundation\"],\n \"locality\": [\"Cambridge\"],\n \"country-name\": [\"UK\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<div class=\"h-product\">\n <h2 class=\"p-name\">Raspberry Pi</h2>\n <img class=\"u-photo\" src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg\" />\n <p class=\"e-description\">The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.</p>\n <a class=\"u-url\" href=\"http://www.raspberrypi.org/\">More info about the Raspberry Pi</a>\n <p class=\"p-price\">£29.95</p>\n <p class=\"p-review h-review-aggregate\">\n <span class=\"p-rating h-rating\">\n <span class=\"p-average\">9.2</span> out of \n <span class=\"p-best\">10</span> \n based on <span class=\"p-count\">178</span> reviews\n </span>\n </p>\n <p>Categories: <span class=\"p-category\">Computer</span>, <span class=\"p-category\">Education</span></p>\n <p class=\"p-brand h-card\">From: \n <span class=\"p-name p-org\">The Raspberry Pi Foundation</span> - \n <span class=\"p-locality\">Cambridge</span> \n <span class=\"p-country-name\">UK</span>\n </p>\n</div>","name":"mf-v2-h-product-aggregate"},{"json":"{\n \"items\": [{\n \"type\": [\"h-product\"],\n \"properties\": {\n \"name\": [\"Raspberry Pi\"],\n \"url\": [\"http://www.raspberrypi.org/\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<a class=\"h-product\" href=\"http://www.raspberrypi.org/\">Raspberry Pi</a>","name":"mf-v2-h-product-justahyperlink"},{"json":"{\n \"items\": [{\n \"type\": [\"h-product\"],\n \"properties\": {\n \"name\": [\"Raspberry Pi\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"h-product\">Raspberry Pi</p>","name":"mf-v2-h-product-justaname"},{"json":"{\n \"items\": [{\n \"type\": [\"h-product\"],\n \"properties\": {\n \"name\": [\"Raspberry Pi\"],\n \"photo\": [\"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg\"],\n \"description\": [{\n \"value\": \"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.\",\n \"html\": \"The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.\"\n }],\n \"url\": [\"http://www.raspberrypi.org/\"],\n \"price\": [\"£29.95\"],\n \"category\": [\"Computer\", \"Education\"],\n \"review\": [{\n \"value\": \"4.5 out of 5\",\n \"type\": [\"h-review\"],\n \"properties\": {\n \"rating\": [\"4.5\"],\n \"name\": [\"4.5 out of 5\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<div class=\"h-product\">\n <h2 class=\"p-name\">Raspberry Pi</h2>\n <img class=\"u-photo\" src=\"http://upload.wikimedia.org/wikipedia/commons/thumb/3/3d/RaspberryPi.jpg/320px-RaspberryPi.jpg\" />\n <p class=\"e-description\">The Raspberry Pi is a credit-card sized computer that plugs into your TV and a keyboard. It’s a capable little PC which can be used for many of the things that your desktop PC does, like spreadsheets, word-processing and games. It also plays high-definition video. We want to see it being used by kids all over the world to learn programming.</p>\n <a class=\"u-url\" href=\"http://www.raspberrypi.org/\">More info about the Raspberry Pi</a>\n <p class=\"p-price\">£29.95</p>\n <p class=\"p-review h-review\"><span class=\"p-rating\">4.5</span> out of 5</p>\n <p>Categories: <span class=\"p-category\">Computer</span>, <span class=\"p-category\">Education</span></p>\n</div>","name":"mf-v2-h-product-simpleproperties"},{"json":"{\n \"items\": [{\n \"type\": [\"h-recipe\"],\n \"properties\": {\n \"name\": [\"Yorkshire Puddings\"],\n \"summary\": [\"Makes 6 good sized Yorkshire puddings, the way my mum taught me\"],\n \"yield\": [\"6 good sized Yorkshire puddings\"],\n \"photo\": [\"http://codebits.glennjones.net/semantic/yorkshire-puddings.jpg\"],\n \"review\": [{\n \"value\": \"4.5 stars out 5 based on \\n 35 reviews\",\n \"type\": [\"h-review-aggregate\"],\n \"properties\": {\n \"rating\": [\"4.5 stars out 5 based on\"],\n \"average\": [\"4.5\"],\n \"count\": [\"35\"],\n \"name\": [\"4.5 stars out 5 based on \\n 35 reviews\"]\n }\n }],\n \"ingredient\": [{\n \"value\": \"1 egg\",\n \"html\": \"1 egg\"\n }, {\n \"value\": \"75g plain flour\",\n \"html\": \"75g plain flour\"\n }, {\n \"value\": \"70ml milk\",\n \"html\": \"70ml milk\"\n }, {\n \"value\": \"60ml water\",\n \"html\": \"60ml water\"\n }, {\n \"value\": \"Pinch of salt\",\n \"html\": \"Pinch of salt\"\n }],\n \"instructions\": [{\n \"value\": \"Pre-heat oven to 230C or gas mark 8. Pour the vegetable oil evenly into 2 x 4-hole \\n Yorkshire pudding tins and place in the oven to heat through. \\n \\n To make the batter, add all the flour into a bowl and beat in the eggs until smooth. \\n Gradually add the milk and water while beating the mixture. It should be smooth and \\n without lumps. Finally add a pinch of salt.\\n \\n Make sure the oil is piping hot before pouring the batter evenly into the tins. \\n Place in the oven for 20-25 minutes until pudding have risen and look golden brown\",\n \"html\": \"\\n <ol>\\n <li>Pre-heat oven to 230C or gas mark 8. Pour the vegetable oil evenly into 2 x 4-hole \\n Yorkshire pudding tins and place in the oven to heat through.</li> \\n \\n <li>To make the batter, add all the flour into a bowl and beat in the eggs until smooth. \\n Gradually add the milk and water while beating the mixture. It should be smooth and \\n without lumps. Finally add a pinch of salt.</li>\\n \\n <li>Make sure the oil is piping hot before pouring the batter evenly into the tins. \\n Place in the oven for 20-25 minutes until pudding have risen and look golden brown</li>\\n </ol>\\n \"\n }],\n \"nutrition\": [\"Calories: 125\", \"Fat: 3.2g\", \"Cholesterol: 77mg\"],\n \"published\": [\"2011-10-27\"],\n \"author\": [{\n \"value\": \"Glenn Jones\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Glenn Jones\"],\n \"url\": [\"http://glennjones.net\"]\n }\n }],\n \"url\": [\"http://www.flickr.com/photos/dithie/4106528495/\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<section class=\"h-recipe\">\n <h1 class=\"p-name\">Yorkshire Puddings</h1> \n <p class=\"p-summary\">Makes <span class=\"p-yield\">6 good sized Yorkshire puddings</span>, the way my mum taught me</p>\n\n\n <p><img class=\"u-photo\" src=\"http://codebits.glennjones.net/semantic/yorkshire-puddings.jpg\" /></p>\n\n <span class=\"p-review h-review-aggregate\">\n <span class=\"p-rating\">\n <span class=\"p-average\">4.5</span> stars out 5 based on </span>\n <span class=\"p-count\">35</span> reviews</span>\n \n \n\n <div id=\"ingredients-container\">\n <h3>Ingredients</h3>\n <ul>\n <li class=\"e-ingredient\">1 egg</li>\n <li class=\"e-ingredient\">75g plain flour</li>\n <li class=\"e-ingredient\">70ml milk</li>\n <li class=\"e-ingredient\">60ml water</li>\n <li class=\"e-ingredient\">Pinch of salt</li>\n </ul>\n </div>\n\n <h3>Time</h3>\n <ul>\n <li class=\"prepTime\">Preparation <span class=\"value-title\" title=\"PT0H10M\">10 mins</span></li>\n <li class=\"cookTime\">Cook <span class=\"value-title\" title=\"PT0H25M\">25 mins</span></li>\n </ul> \n\n\n <h3>Instructions</h3>\n <div class=\"e-instructions\">\n <ol>\n <li>Pre-heat oven to 230C or gas mark 8. Pour the vegetable oil evenly into 2 x 4-hole \n Yorkshire pudding tins and place in the oven to heat through.</li> \n \n <li>To make the batter, add all the flour into a bowl and beat in the eggs until smooth. \n Gradually add the milk and water while beating the mixture. It should be smooth and \n without lumps. Finally add a pinch of salt.</li>\n \n <li>Make sure the oil is piping hot before pouring the batter evenly into the tins. \n Place in the oven for 20-25 minutes until pudding have risen and look golden brown</li>\n </ol>\n </div>\n\n <h3>Nutrition</h3>\n <ul id=\"nutrition-list\">\n <li class=\"p-nutrition\">Calories: <span class=\"calories\">125</span></li>\n <li class=\"p-nutrition\">Fat: <span class=\"fat\">3.2g</span></li>\n <li class=\"p-nutrition\">Cholesterol: <span class=\"cholesterol\">77mg</span></li>\n </ul>\n <p>(Amount per pudding)</p>\n\n <p>\n Published on <time class=\"dt-published\" datetime=\"2011-10-27\">27 Oct 2011</time> by \n <span class=\"p-author h-card\">\n <a class=\"p-name u-url\" href=\"http://glennjones.net\">Glenn Jones</a>\n </span>\n </p>\n <a href=\"http://www.flickr.com/photos/dithie/4106528495/\">Photo by dithie</a>\n </section>","name":"mf-v2-h-recipe-all"},{"json":"{\n \"items\": [{\n \"type\": [\"h-recipe\"],\n \"properties\": {\n \"name\": [\"Toast\"],\n \"ingredient\": [{\n \"value\": \"Slice of bread\",\n \"html\": \"Slice of bread\"\n }, {\n \"value\": \"Butter\",\n \"html\": \"Butter\"\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-recipe\"> \n <p class=\"p-name\">Toast</p>\n <ul>\n <li class=\"e-ingredient\">Slice of bread</li>\n <li class=\"e-ingredient\">Butter</li>\n </ul>\n</div>","name":"mf-v2-h-recipe-minimum"},{"json":"{\n \"items\": [{\n \"type\": [\"h-resume\"],\n \"properties\": {\n \"name\": [\"Tim Berners-Lee\"],\n \"summary\": [\"invented the World Wide Web\"],\n \"affiliation\": [{\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"W3C\"],\n \"photo\": [\"http://www.w3.org/Icons/WWW/w3c_home_nb.png\"],\n \"url\": [\"http://www.w3.org/\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-resume\">\n <p>\n <span class=\"p-name\">Tim Berners-Lee</span>, \n <span class=\"p-summary\">invented the World Wide Web</span>. \n </p> \n Belongs to following groups:\n <p> \n <a class=\"p-affiliation h-card\" href=\"http://www.w3.org/\">\n <img class=\"p-name u-photo\" alt=\"W3C\" src=\"http://www.w3.org/Icons/WWW/w3c_home_nb.png\" />\n </a>\n </p> \n</div>","name":"mf-v2-h-resume-affiliation"},{"json":"{\n \"items\": [{\n \"type\": [\"h-resume\"],\n \"properties\": {\n \"name\": [\"Tim Berners-Lee\"],\n \"summary\": [\"Invented the World Wide Web.\"],\n \"contact\": [{\n \"value\": \"MIT\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"MIT\"],\n \"street-address\": [\"32 Vassar Street\"],\n \"extended-address\": [\"Room 32-G524\"],\n \"locality\": [\"Cambridge\"],\n \"region\": [\"MA\"],\n \"postal-code\": [\"02139\"],\n \"country-name\": [\"USA\"],\n \"tel\": [\"+1 (617) 253 5702\"],\n \"email\": [\"mailto:timbl@w3.org\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-resume\">\n <p class=\"p-name\">Tim Berners-Lee</p>\n <p class=\"p-summary\">Invented the World Wide Web.</p><hr />\n <div class=\"p-contact h-card\">\n <p class=\"p-name\">MIT</p>\n <p>\n <span class=\"p-street-address\">32 Vassar Street</span>, \n <span class=\"p-extended-address\">Room 32-G524</span>, \n <span class=\"p-locality\">Cambridge</span>, \n <span class=\"p-region\">MA</span> \n <span class=\"p-postal-code\">02139</span>, \n <span class=\"p-country-name\">USA</span>.\n </p>\n <p>Tel:<span class=\"p-tel\">+1 (617) 253 5702</span></p>\n <p>Email:<a class=\"u-email\" href=\"mailto:timbl@w3.org\">timbl@w3.org</a></p>\n </div>\n</div>","name":"mf-v2-h-resume-contact"},{"json":"{\n \"items\": [{\n \"type\": [\"h-resume\"],\n \"properties\": {\n \"name\": [\"Tim Berners-Lee\"],\n \"contact\": [{\n \"value\": \"Director of the World Wide Web Foundation\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"title\": [\"Director of the World Wide Web Foundation\"],\n \"name\": [\"Director of the World Wide Web Foundation\"]\n }\n }],\n \"summary\": [\"Invented the World Wide Web.\"],\n \"education\": [{\n \"value\": \"The Queen's College, Oxford University\",\n \"type\": [\"h-event\", \"h-card\"],\n \"properties\": {\n \"name\": [\"The Queen's College, Oxford University\"],\n \"org\": [\"The Queen's College, Oxford University\"],\n \"description\": [\"BA Hons (I) Physics\"],\n \"start\": [\"1973-09\"],\n \"end\": [\"1976-06\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-resume\">\n <p class=\"p-name\">Tim Berners-Lee</p>\n <div class=\"p-contact h-card\">\n <p class=\"p-title\">Director of the World Wide Web Foundation</p>\n </div>\n <p class=\"p-summary\">Invented the World Wide Web.</p><hr />\n <p class=\"p-education h-event h-card\">\n <span class=\"p-name p-org\">The Queen's College, Oxford University</span>, \n <span class=\"p-description\">BA Hons (I) Physics</span> \n <time class=\"dt-start\" datetime=\"1973-09\">1973</time> –\n <time class=\"dt-end\" datetime=\"1976-06\">1976</time>\n </p>\n</div>","name":"mf-v2-h-resume-education"},{"json":"{\n \"items\": [{\n \"type\": [\"h-resume\"],\n \"properties\": {\n \"name\": [\"Tim Berners-Lee, invented the World Wide Web.\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"h-resume\">Tim Berners-Lee, invented the World Wide Web.</p>","name":"mf-v2-h-resume-justaname"},{"json":"{\n \"items\": [{\n \"type\": [\"h-resume\"],\n \"properties\": {\n \"name\": [\"Tim Berners-Lee\"],\n \"summary\": [\"invented the World Wide Web\"],\n \"skill\": [\"information systems\", \"advocacy\", \"leadership\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-resume\">\n <p>\n <span class=\"p-name\">Tim Berners-Lee</span>, \n <span class=\"p-summary\">invented the World Wide Web</span>.\n </p>\n Skills: \n <ul>\n <li class=\"p-skill\">information systems</li>\n <li class=\"p-skill\">advocacy</li>\n <li class=\"p-skill\">leadership</li>\n <ul> \n</ul></ul></div>","name":"mf-v2-h-resume-skill"},{"json":"{\n \"items\": [{\n \"type\": [\"h-resume\"],\n \"properties\": {\n \"name\": [\"Tim Berners-Lee\"],\n \"contact\": [{\n \"value\": \"Director of the World Wide Web Foundation\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"title\": [\"Director of the World Wide Web Foundation\"],\n \"name\": [\"Director of the World Wide Web Foundation\"]\n }\n }],\n \"summary\": [\"Invented the World Wide Web.\"],\n \"experience\": [{\n \"value\": \"World Wide Web Foundation\",\n \"type\": [\"h-event\", \"h-card\"],\n \"properties\": {\n \"title\": [\"Director\"],\n \"name\": [\"World Wide Web Foundation\"],\n \"org\": [\"World Wide Web Foundation\"],\n \"url\": [\"http://www.webfoundation.org/\"],\n \"start\": [\"2009-01-18\"],\n \"duration\": [\"P2Y11M\"]\n }\n }]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<meta charset=\"utf-8\">\n<div class=\"h-resume\">\n <p class=\"p-name\">Tim Berners-Lee</p>\n <div class=\"p-contact h-card\">\n <p class=\"p-title\">Director of the World Wide Web Foundation</p>\n </div>\n <p class=\"p-summary\">Invented the World Wide Web.</p><hr />\n <div class=\"p-experience h-event h-card\">\n <p class=\"p-title\">Director</p>\n <p><a class=\"p-name p-org u-url\" href=\"http://www.webfoundation.org/\">World Wide Web Foundation</a></p>\n <p>\n <time class=\"dt-start\" datetime=\"2009-01-18\">Jan 2009</time> – Present\n <time class=\"dt-duration\" datetime=\"P2Y11M\">(2 years 11 month)</time>\n </p>\n </div>\n</div>","name":"mf-v2-h-resume-work"},{"json":"{\n \"items\": [{\n \"type\": [\"h-review\"],\n \"properties\": {\n \"name\": [\"Crepes on Cole\"],\n \"url\": [\"https://plus.google.com/116941523817079328322/about\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<a class=\"h-review\" href=\"https://plus.google.com/116941523817079328322/about\">Crepes on Cole</a>","name":"mf-v2-h-review-hyperlink"},{"json":"{\n \"items\": [{\n \"type\": [\"h-review\"],\n \"properties\": {\n \"item\": [{\n \"value\": \"Crepes on Cole\",\n \"type\": [\"h-item\"],\n \"properties\": {\n \"name\": [\"Crepes on Cole\"],\n \"url\": [\"http://example.com/crepeoncole\"]\n }\n }],\n \"rating\": [\"4.7\"],\n \"name\": [\"Crepes on Cole\\n 4.7 out of 5 stars\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-review\">\n <a class=\"p-item h-item\" href=\"http://example.com/crepeoncole\">Crepes on Cole</a>\n <p><span class=\"p-rating\">4.7</span> out of 5 stars</p>\n</div>","name":"mf-v2-h-review-implieditem"},{"json":"{\n \"items\": [{\n \"type\": [\"h-review\"],\n \"properties\": {\n \"item\": [{\n \"value\": \"Crepes on Cole\",\n \"type\": [\"h-item\"],\n \"properties\": {\n \"photo\": [\"http://example.com/images/photo.gif\"],\n \"name\": [\"Crepes on Cole\"],\n \"url\": [\"http://example.com/crepeoncole\"]\n }\n }],\n \"rating\": [\"5\"],\n \"name\": [\"Crepes on Cole\\n \\n 5 out of 5 stars\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<base href=\"http://example.com\" >\n<div class=\"h-review\">\n <p class=\"p-item h-item\">\n <img class=\"u-photo\" src=\"images/photo.gif\" />\n <a class=\"p-name u-url\" href=\"http://example.com/crepeoncole\">Crepes on Cole</a>\n </p>\n <p><span class=\"p-rating\">5</span> out of 5 stars</p>\n</div>","name":"mf-v2-h-review-item"},{"json":"{\n \"items\": [{\n \"type\": [\"h-review\"],\n \"properties\": {\n \"name\": [\"Crepes on Cole\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<p class=\"h-review\">Crepes on Cole</p>","name":"mf-v2-h-review-justaname"},{"json":"{\n \"items\": [{\n \"type\": [\"h-review\"],\n \"properties\": {\n \"name\": [\"Crepes on Cole\"],\n \"photo\": [\"http://example.com/images/photo.gif\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<base href=\"http://example.com\" ><img class=\"h-review\" src=\"images/photo.gif\" alt=\"Crepes on Cole\" />","name":"mf-v2-h-review-photo"},{"json":"{\n \"items\": [{\n \"type\": [\"h-review\"],\n \"properties\": {\n \"rating\": [\"5\"],\n \"name\": [\"Crepes on Cole is awesome\"],\n \"reviewer\": [{\n \"value\": \"Tantek\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Tantek\"]\n }\n }],\n \"reviewed\": [\"2005-04-18\"],\n \"description\": [{\n \"value\": \"Crepes on Cole is one of the best little \\n creperies in San Francisco.\\n Excellent food and service. Plenty of tables in a variety of sizes \\n for parties large and small. Window seating makes for excellent \\n people watching to/from the N-Judah which stops right outside. \\n I've had many fun social gatherings here, as well as gotten \\n plenty of work done thanks to neighborhood WiFi.\",\n \"html\": \"\\n <p class=\\\"p-item h-card\\\">\\n <span class=\\\"p-name p-org\\\">Crepes on Cole</span> is one of the best little \\n creperies in <span class=\\\"p-adr h-adr\\\"><span class=\\\"p-locality\\\">San Francisco</span></span>.\\n Excellent food and service. Plenty of tables in a variety of sizes \\n for parties large and small. Window seating makes for excellent \\n people watching to/from the N-Judah which stops right outside. \\n I've had many fun social gatherings here, as well as gotten \\n plenty of work done thanks to neighborhood WiFi.\\n </p>\\n \"\n }],\n \"item\": [{\n \"value\": \"Crepes on Cole\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Crepes on Cole\"],\n \"org\": [\"Crepes on Cole\"],\n \"adr\": [{\n \"value\": \"San Francisco\",\n \"type\": [\"h-adr\"],\n \"properties\": {\n \"locality\": [\"San Francisco\"],\n \"name\": [\"San Francisco\"]\n }\n }]\n }\n }],\n \"category\": [\"crepe\"],\n \"url\": [\"http://example.com/crepe\"]\n }\n }],\n \"rels\": {\n \"license\": [\"http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License\"]\n },\n \"rel-urls\": {\n \"http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License\": {\n \"text\": \"Creative Commons Attribution-ShareAlike License\",\n \"rels\": [\"license\"]\n }\n }\n}","html":"<div class=\"h-review\">\n <span><span class=\"p-rating\">5</span> out of 5 stars</span>\n <h4 class=\"p-name\">Crepes on Cole is awesome</h4>\n <span class=\"p-reviewer h-card\">\n Reviewer: <span class=\"p-name\">Tantek</span> - \n </span>\n <time class=\"dt-reviewed\" datetime=\"2005-04-18\">April 18, 2005</time>\n <div class=\"e-description\">\n <p class=\"p-item h-card\">\n <span class=\"p-name p-org\">Crepes on Cole</span> is one of the best little \n creperies in <span class=\"p-adr h-adr\"><span class=\"p-locality\">San Francisco</span></span>.\n Excellent food and service. Plenty of tables in a variety of sizes \n for parties large and small. Window seating makes for excellent \n people watching to/from the N-Judah which stops right outside. \n I've had many fun social gatherings here, as well as gotten \n plenty of work done thanks to neighborhood WiFi.\n </p>\n </div>\n <p>Visit date: <span>April 2005</span></p>\n <p>Food eaten: <a class=\"p-category\" href=\"http://en.wikipedia.org/wiki/crepe\">crepe</a></p>\n <p>Permanent link for review: <a class=\"u-url\" href=\"http://example.com/crepe\">http://example.com/crepe</a></p>\n <p><a rel=\"license\" href=\"http://en.wikipedia.org/wiki/Wikipedia:Text_of_Creative_Commons_Attribution-ShareAlike_3.0_Unported_License\">Creative Commons Attribution-ShareAlike License</a></p>\n</div>","name":"mf-v2-h-review-vcard"},{"json":"{\n \"items\": [{\n \"type\": [\"h-review-aggregate\"],\n \"properties\": {\n \"item\": [{\n \"value\": \"Fullfrontal\",\n \"type\": [\"h-event\"],\n \"properties\": {\n \"name\": [\"Fullfrontal\"],\n \"description\": [\"A one day JavaScript Conference held in Brighton\"],\n \"start\": [\"2012-11-09\"]\n }\n }],\n \"rating\": [\"9.9\"],\n \"average\": [\"9.9\"],\n \"best\": [\"10\"],\n \"count\": [\"62\"],\n \"name\": [\"Fullfrontal\\n A one day JavaScript Conference held in Brighton\\n 9th November 2012 \\n \\n \\n \\n 9.9 out of \\n 10 \\n based on 62 reviews\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-review-aggregate\">\n <div class=\"p-item h-event\">\n <h3 class=\"p-name\">Fullfrontal</h3>\n <p class=\"p-description\">A one day JavaScript Conference held in Brighton</p>\n <p><time class=\"dt-start\" datetime=\"2012-11-09\">9th November 2012</time></p> \n </div> \n \n <p class=\"p-rating\">\n <span class=\"p-average value\">9.9</span> out of \n <span class=\"p-best\">10</span> \n based on <span class=\"p-count\">62</span> reviews\n </p>\n</div>","name":"mf-v2-h-review-aggregate-hevent"},{"json":"{\n \"items\": [{\n \"type\": [\"h-review-aggregate\"],\n \"properties\": {\n \"item\": [{\n \"value\": \"Mediterranean Wraps\",\n \"type\": [\"h-item\"],\n \"properties\": {\n \"name\": [\"Mediterranean Wraps\"]\n }\n }],\n \"summary\": [\"Customers flock to this small restaurant for their \\n tasty falafel and shawerma wraps and welcoming staff.\"],\n \"rating\": [\"4.5\"],\n \"name\": [\"Mediterranean Wraps\\n \\n Customers flock to this small restaurant for their \\n tasty falafel and shawerma wraps and welcoming staff.\\n \\n 4.5 out of 5\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-review-aggregate\">\n <h3 class=\"p-item h-item\">Mediterranean Wraps</h3>\n <span class=\"p-summary\">\n Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff.\n </span>\n <span class=\"p-rating\">4.5</span> out of 5 \n</div>","name":"mf-v2-h-review-aggregate-justahyperlink"},{"json":"{\n \"items\": [{\n \"type\": [\"h-review-aggregate\"],\n \"properties\": {\n \"item\": [{\n \"value\": \"Mediterranean Wraps\",\n \"type\": [\"h-card\"],\n \"properties\": {\n \"name\": [\"Mediterranean Wraps\"],\n \"street-address\": [\"433 S California Ave\"],\n \"locality\": [\"Palo Alto\"],\n \"region\": [\"CA\"],\n \"tel\": [\"(650) 321-8189\"]\n }\n }],\n \"summary\": [\"Customers flock to this small restaurant for their \\n tasty falafel and shawerma wraps and welcoming staff.\"],\n \"rating\": [\"9.2\"],\n \"average\": [\"9.2\"],\n \"best\": [\"10\"],\n \"count\": [\"17\"],\n \"name\": [\"Mediterranean Wraps\\n \\n 433 S California Ave, \\n Palo Alto, \\n CA - \\n (650) 321-8189\\n \\n \\n Customers flock to this small restaurant for their \\n tasty falafel and shawerma wraps and welcoming staff.\\n \\n 9.2 out of \\n 10 \\n based on 17 reviews\"]\n }\n }],\n \"rels\": {},\n \"rel-urls\": {}\n}","html":"<div class=\"h-review-aggregate\">\n <div class=\"p-item h-card\">\n <h3 class=\"p-name\">Mediterranean Wraps</h3>\n <p>\n <span class=\"p-street-address\">433 S California Ave</span>, \n <span class=\"p-locality\">Palo Alto</span>, \n <span class=\"p-region\">CA</span> - \n <span class=\"p-tel\">(650) 321-8189</span>\n </p>\n </div> \n <span class=\"p-summary\">Customers flock to this small restaurant for their \n tasty falafel and shawerma wraps and welcoming staff.</span>\n <span class=\"p-rating\">\n <span class=\"p-average value\">9.2</span> out of \n <span class=\"p-best\">10</span> \n based on <span class=\"p-count\">17</span> reviews\n </span>\n</div>","name":"mf-v2-h-review-aggregate-simpleproperties"},{"json":"{\n \"rels\": {\n \"bookmark\": [\n \"http://ma.tt/2015/05/beethoven-mozart-bach/\",\n \"http://ma.tt/2015/06/jefferson-on-idleness/\" \n ], \n \"category\": [\n \"http://ma.tt/category/asides/\"\n ], \n \"tag\": [\n \"http://ma.tt/category/asides/\"\n ], \n \"author\": [\n \"http://ma.tt/author/saxmatt/\"\n ]\n }, \n \"items\": [\n {\n \"type\": [\n \"h-card\"\n ], \n \"properties\": {\n \"url\": [\n \"http://ma.tt/author/saxmatt/\"\n ], \n \"name\": [\n \"Matt\"\n ]\n }\n }, \n {\n \"type\": [\n \"h-card\"\n ], \n \"properties\": {\n \"url\": [\n \"http://ma.tt/author/saxmatt/\"\n ], \n \"name\": [\n \"Matt\"\n ]\n }\n }\n ], \n \"rel-urls\": {\n \"http://ma.tt/category/asides/\": {\n \"rels\": [\n \"category\", \n \"tag\"\n ], \n \"text\": \"Asides\"\n }, \n \"http://ma.tt/author/saxmatt/\": {\n \"rels\": [\n \"author\"\n ], \n \"text\": \"Matt\", \n \"title\": \"View all posts by Matt\"\n }, \n \"http://ma.tt/2015/05/beethoven-mozart-bach/\": {\n \"rels\": [\n \"bookmark\"\n ], \n \"text\": \"May 31, 2015\", \n \"title\": \"Permalink to Beethoven, Mozart, Bach\"\n }, \n \"http://ma.tt/2015/06/jefferson-on-idleness/\": {\n \"rels\": [\n \"bookmark\"\n ], \n \"text\": \"June 2, 2015\", \n \"title\": \"Permalink to Jefferson on Idleness\"\n }\n }\n}","html":"<a href=\"http://ma.tt/2015/05/beethoven-mozart-bach/\" \n title=\"Permalink to Beethoven, Mozart, Bach\" rel=\"bookmark\">\n<time class=\"entry-date\" datetime=\"2015-05-31T22:42:00+00:00\">May 31, 2015</time></a></span>\n<a href=\"http://ma.tt/category/asides/\" rel=\"category tag\">Asides</a>\n<span class=\"author vcard\">\n<a class=\"url fn n\" href=\"http://ma.tt/author/saxmatt/\" \n title=\"View all posts by Matt\" rel=\"author\">Matt</a></span>\n<span class=\"date\"><a href=\"http://ma.tt/2015/06/jefferson-on-idleness/\" title=\"Permalink to Jefferson on Idleness\" rel=\"bookmark\"><time class=\"entry-date\" datetime=\"2015-06-02T21:26:00+00:00\">June 2, 2015</time></a></span>\n<span class=\"categories-links\"><a href=\"http://ma.tt/category/asides/\" rel=\"category tag\">Asides</a></span>\n<span class=\"author vcard\"><a class=\"url fn n\" href=\"http://ma.tt/author/saxmatt/\" title=\"View all posts by Matt\" rel=\"author\">Matt</a></span>\n","name":"mf-v2-rel-duplicate-rels"},{"json":"{\n \"items\": [],\n \"rels\": {\n \"license\": [\"http://creativecommons.org/licenses/by/2.5/\"]\n },\n \"rel-urls\": {\n \"http://creativecommons.org/licenses/by/2.5/\": {\n \"text\": \"cc by 2.5\",\n \"rels\": [\"license\"]\n }\n }\n}","html":"<a rel=\"license\" href=\"http://creativecommons.org/licenses/by/2.5/\">cc by 2.5</a>","name":"mf-v2-rel-license"},{"json":"{\n \"items\": [],\n \"rels\": {\n \"nofollow\": [\"http://microformats.org/wiki/microformats:copyrights\"]\n },\n \"rel-urls\": {\n \"http://microformats.org/wiki/microformats:copyrights\": {\n \"text\": \"Copyrights\",\n \"rels\": [\"nofollow\"]\n }\n }\n}","html":"<a rel=\"nofollow\" href=\"http://microformats.org/wiki/microformats:copyrights\">Copyrights</a>","name":"mf-v2-rel-nofollow"},{"json":"{\n \"items\": [],\n \"rels\": { \n \"author\": [ \"http://example.com/a\", \"http://example.com/b\" ],\n \"in-reply-to\": [ \"http://example.com/1\", \"http://example.com/2\" ], \n \"home\": [ \"http://example.com/fr\" ], \n \"alternate\": [ \"http://example.com/fr\" ] \n },\n \"rel-urls\": {\n \"http://example.com/a\": {\n \"rels\": [\"author\"], \n \"text\": \"author a\"\n },\n \"http://example.com/b\": {\n \"rels\": [\"author\"], \n \"text\": \"author b\"\n },\n \"http://example.com/1\": {\n \"rels\": [\"in-reply-to\"], \n \"text\": \"post 1\"\n },\n \"http://example.com/2\": {\n \"rels\": [\"in-reply-to\"], \n \"text\": \"post 2\"\n },\n \"http://example.com/fr\": {\n \"rels\": [\"alternate\", \"home\"],\n \"media\": \"handheld\", \n \"hreflang\": \"fr\", \n \"text\": \"French mobile homepage\"\n }\n }\n}","html":"<a rel=\"author\" href=\"http://example.com/a\">author a</a>\n<a rel=\"author\" href=\"http://example.com/b\">author b</a>\n<a rel=\"in-reply-to\" href=\"http://example.com/1\">post 1</a>\n<a rel=\"in-reply-to\" href=\"http://example.com/2\">post 2</a>\n<a rel=\"alternate home\"\n href=\"http://example.com/fr\"\n media=\"handheld\"\n hreflang=\"fr\">French mobile homepage</a>","name":"mf-v2-rel-rel-urls"},{"json":"{\n \"rels\": {\n \"category\": [\n \"http://ma.tt/category/asides/\"\n ], \n \"tag\": [\n \"http://ma.tt/category/asides/\"\n ]\n }, \n \"items\": [], \n \"rel-urls\": {\n \"http://ma.tt/category/asides/\": {\n \"rels\": [\n \"category\", \n \"tag\"\n ], \n \"text\": \"Asides\"\n }\n }\n}\n","html":"This is a contrived example - not found links like this in the wild:\n<a href=\"http://ma.tt/category/asides/\" rel=\"category tag\">Asides</a>\n<a href=\"http://ma.tt/category/asides/\" rel=\"category tag\">B-sides</a>\n<a href=\"http://ma.tt/category/asides/\" rel=\"category tag\">seasides</a>","name":"mf-v2-rel-varying-text-duplicate-rels"},{"json":"{\n \"items\": [],\n \"rels\": {\n \"friend\": [\"http://example.com/profile/jane\"],\n \"acquaintance\": [\"http://example.com/profile/jeo\"],\n \"contact\": [\"http://example.com/profile/lily\"],\n \"met\": [\"http://example.com/profile/oliver\"],\n \"co-worker\": [\"http://example.com/profile/emily\"],\n \"colleague\": [\"http://example.com/profile/jack\"],\n \"neighbor\": [\"http://example.com/profile/isabella\"],\n \"child\": [\"http://example.com/profile/harry\"],\n \"parent\": [\"http://example.com/profile/sophia\"],\n \"sibling\": [\"http://example.com/profile/charlie\"],\n \"spouse\": [\"http://example.com/profile/olivia\"],\n \"kin\": [\"http://example.com/profile/james\"],\n \"muse\": [\"http://example.com/profile/ava\"],\n \"crush\": [\"http://example.com/profile/joshua\"],\n \"date\": [\"http://example.com/profile/chloe\"],\n \"sweetheart\": [\"http://example.com/profile/alfie\"],\n \"me\": [\"http://example.com/profile/isla\"]\n },\n \"rel-urls\": {\n \"http://example.com/profile/jane\": {\n \"text\": \"jane\",\n \"rels\": [\"friend\"]\n },\n \"http://example.com/profile/jeo\": {\n \"text\": \"jeo\",\n \"rels\": [\"acquaintance\"]\n },\n \"http://example.com/profile/lily\": {\n \"text\": \"lily\",\n \"rels\": [\"contact\"]\n },\n \"http://example.com/profile/oliver\": {\n \"text\": \"oliver\",\n \"rels\": [\"met\"]\n },\n \"http://example.com/profile/emily\": {\n \"text\": \"emily\",\n \"rels\": [\"co-worker\"]\n },\n \"http://example.com/profile/jack\": {\n \"text\": \"jack\",\n \"rels\": [\"colleague\"]\n },\n \"http://example.com/profile/isabella\": {\n \"text\": \"isabella\",\n \"rels\": [\"neighbor\"]\n },\n \"http://example.com/profile/harry\": {\n \"text\": \"harry\",\n \"rels\": [\"child\"]\n },\n \"http://example.com/profile/sophia\": {\n \"text\": \"sophia\",\n \"rels\": [\"parent\"]\n },\n \"http://example.com/profile/charlie\": {\n \"text\": \"charlie\",\n \"rels\": [\"sibling\"]\n },\n \"http://example.com/profile/olivia\": {\n \"text\": \"olivia\",\n \"rels\": [\"spouse\"]\n },\n \"http://example.com/profile/james\": {\n \"text\": \"james\",\n \"rels\": [\"kin\"]\n },\n \"http://example.com/profile/ava\": {\n \"text\": \"ava\",\n \"rels\": [\"muse\"]\n },\n \"http://example.com/profile/joshua\": {\n \"text\": \"joshua\",\n \"rels\": [\"crush\"]\n },\n \"http://example.com/profile/chloe\": {\n \"text\": \"chloe\",\n \"rels\": [\"date\"]\n },\n \"http://example.com/profile/alfie\": {\n \"text\": \"alfie\",\n \"rels\": [\"sweetheart\"]\n },\n \"http://example.com/profile/isla\": {\n \"text\": \"isla\",\n \"rels\": [\"me\"]\n }\n }\n}\n","html":"<ul>\n <li><a rel=\"friend\" href=\"http://example.com/profile/jane\">jane</a></li>\n <li><a rel=\"acquaintance\" href=\"http://example.com/profile/jeo\">jeo</a></li>\n <li><a rel=\"contact\" href=\"http://example.com/profile/lily\">lily</a></li>\n <li><a rel=\"met\" href=\"http://example.com/profile/oliver\">oliver</a></li>\n <li><a rel=\"co-worker\" href=\"http://example.com/profile/emily\">emily</a></li>\n <li><a rel=\"colleague\" href=\"http://example.com/profile/jack\">jack</a></li>\n <li><a rel=\"neighbor\" href=\"http://example.com/profile/isabella\">isabella</a></li>\n <li><a rel=\"child\" href=\"http://example.com/profile/harry\">harry</a></li>\n <li><a rel=\"parent\" href=\"http://example.com/profile/sophia\">sophia</a></li>\n <li><a rel=\"sibling\" href=\"http://example.com/profile/charlie\">charlie</a></li>\n <li><a rel=\"spouse\" href=\"http://example.com/profile/olivia\">olivia</a></li>\n <li><a rel=\"kin\" href=\"http://example.com/profile/james\">james</a></li>\n <li><a rel=\"muse\" href=\"http://example.com/profile/ava\">ava</a></li>\n <li><a rel=\"crush\" href=\"http://example.com/profile/joshua\">joshua</a></li>\n <li><a rel=\"date\" href=\"http://example.com/profile/chloe\">chloe</a></li>\n <li><a rel=\"sweetheart\" href=\"http://example.com/profile/alfie\">alfie</a></li>\n <li><a rel=\"me\" href=\"http://example.com/profile/isla\">isla</a></li>\n</ul>","name":"mf-v2-rel-xfn-all"},{"json":"{\n \"items\": [],\n \"rels\": {\n \"me\": [\"http://twitter.com/glennjones\", \"http://delicious.com/glennjonesnet/\", \"https://plus.google.com/u/0/105161464208920272734/about\", \"http://lanyrd.com/people/glennjones/\", \"http://github.com/glennjones\", \"http://www.flickr.com/photos/glennjonesnet/\", \"http://www.linkedin.com/in/glennjones\", \"http://www.slideshare.net/glennjones/presentations\"]\n },\n \"rel-urls\": {\n \"http://twitter.com/glennjones\": {\n \"text\": \"twitter\",\n \"rels\": [\"me\"]\n },\n \"http://delicious.com/glennjonesnet/\": {\n \"text\": \"delicious\",\n \"rels\": [\"me\"]\n },\n \"https://plus.google.com/u/0/105161464208920272734/about\": {\n \"text\": \"google+\",\n \"rels\": [\"me\"]\n },\n \"http://lanyrd.com/people/glennjones/\": {\n \"text\": \"lanyrd\",\n \"rels\": [\"me\"]\n },\n \"http://github.com/glennjones\": {\n \"text\": \"github\",\n \"rels\": [\"me\"]\n },\n \"http://www.flickr.com/photos/glennjonesnet/\": {\n \"text\": \"flickr\",\n \"rels\": [\"me\"]\n },\n \"http://www.linkedin.com/in/glennjones\": {\n \"text\": \"linkedin\",\n \"rels\": [\"me\"]\n },\n \"http://www.slideshare.net/glennjones/presentations\": {\n \"text\": \"slideshare\",\n \"rels\": [\"me\"]\n }\n }\n}\n","html":"<ul>\n <li><a rel=\"me\" href=\"http://twitter.com/glennjones\">twitter</a></li>\n <li><a rel=\"me\" href=\"http://delicious.com/glennjonesnet/\">delicious</a></li>\n <li><a rel=\"me\" href=\"https://plus.google.com/u/0/105161464208920272734/about\">google+</a></li>\n <li><a rel=\"me\" href=\"http://lanyrd.com/people/glennjones/\">lanyrd</a></li>\n <li><a rel=\"me\" href=\"http://github.com/glennjones\">github</a></li>\n <li><a rel=\"me\" href=\"http://www.flickr.com/photos/glennjonesnet/\">flickr</a></li>\n <li><a rel=\"me\" href=\"http://www.linkedin.com/in/glennjones\">linkedin</a></li>\n <li><a rel=\"me\" href=\"http://www.slideshare.net/glennjones/presentations\">slideshare</a></li>\n</ul>","name":"mf-v2-rel-xfn-elsewhere"}]}
diff --git a/toolkit/components/microformats/test/static/javascript/deep-diff-0.3.1.min.js b/toolkit/components/microformats/test/static/javascript/deep-diff-0.3.1.min.js
deleted file mode 100644
index e200019c0..000000000
--- a/toolkit/components/microformats/test/static/javascript/deep-diff-0.3.1.min.js
+++ /dev/null
@@ -1,5 +0,0 @@
-/*!
- * deep-diff.
- * Licensed under the MIT License.
- */
-(function(e,t){"use strict";if(typeof define==="function"&&define.amd){define([],t)}else if(typeof exports==="object"){module.exports=t()}else{e.DeepDiff=t()}})(this,function(e){"use strict";var t,n,r=[];if(typeof global==="object"&&global){t=global}else if(typeof window!=="undefined"){t=window}else{t={}}n=t.DeepDiff;if(n){r.push(function(){if("undefined"!==typeof n&&t.DeepDiff===p){t.DeepDiff=n;n=e}})}function a(e,t){e.super_=t;e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:false,writable:true,configurable:true}})}function i(e,t){Object.defineProperty(this,"kind",{value:e,enumerable:true});if(t&&t.length){Object.defineProperty(this,"path",{value:t,enumerable:true})}}function f(e,t,n){f.super_.call(this,"E",e);Object.defineProperty(this,"lhs",{value:t,enumerable:true});Object.defineProperty(this,"rhs",{value:n,enumerable:true})}a(f,i);function u(e,t){u.super_.call(this,"N",e);Object.defineProperty(this,"rhs",{value:t,enumerable:true})}a(u,i);function l(e,t){l.super_.call(this,"D",e);Object.defineProperty(this,"lhs",{value:t,enumerable:true})}a(l,i);function s(e,t,n){s.super_.call(this,"A",e);Object.defineProperty(this,"index",{value:t,enumerable:true});Object.defineProperty(this,"item",{value:n,enumerable:true})}a(s,i);function h(e,t,n){var r=e.slice((n||t)+1||e.length);e.length=t<0?e.length+t:t;e.push.apply(e,r);return e}function c(e){var t=typeof e;if(t!=="object"){return t}if(e===Math){return"math"}else if(e===null){return"null"}else if(Array.isArray(e)){return"array"}else if(e instanceof Date){return"date"}else if(/^\/.*\//.test(e.toString())){return"regexp"}return"object"}function o(t,n,r,a,i,p,b){i=i||[];var d=i.slice(0);if(typeof p!=="undefined"){if(a&&a(d,p,{lhs:t,rhs:n})){return}d.push(p)}var v=typeof t;var y=typeof n;if(v==="undefined"){if(y!=="undefined"){r(new u(d,n))}}else if(y==="undefined"){r(new l(d,t))}else if(c(t)!==c(n)){r(new f(d,t,n))}else if(t instanceof Date&&n instanceof Date&&t-n!==0){r(new f(d,t,n))}else if(v==="object"&&t!==null&&n!==null){b=b||[];if(b.indexOf(t)<0){b.push(t);if(Array.isArray(t)){var k,m=t.length;for(k=0;k<t.length;k++){if(k>=n.length){r(new s(d,k,new l(e,t[k])))}else{o(t[k],n[k],r,a,d,k,b)}}while(k<n.length){r(new s(d,k,new u(e,n[k++])))}}else{var g=Object.keys(t);var w=Object.keys(n);g.forEach(function(i,f){var u=w.indexOf(i);if(u>=0){o(t[i],n[i],r,a,d,i,b);w=h(w,u)}else{o(t[i],e,r,a,d,i,b)}});w.forEach(function(t){o(e,n[t],r,a,d,t,b)})}b.length=b.length-1}}else if(t!==n){if(!(v==="number"&&isNaN(t)&&isNaN(n))){r(new f(d,t,n))}}}function p(t,n,r,a){a=a||[];o(t,n,function(e){if(e){a.push(e)}},r);return a.length?a:e}function b(e,t,n){if(n.path&&n.path.length){var r=e[t],a,i=n.path.length-1;for(a=0;a<i;a++){r=r[n.path[a]]}switch(n.kind){case"A":b(r[n.path[a]],n.index,n.item);break;case"D":delete r[n.path[a]];break;case"E":case"N":r[n.path[a]]=n.rhs;break}}else{switch(n.kind){case"A":b(e[t],n.index,n.item);break;case"D":e=h(e,t);break;case"E":case"N":e[t]=n.rhs;break}}return e}function d(e,t,n){if(e&&t&&n&&n.kind){var r=e,a=-1,i=n.path.length-1;while(++a<i){if(typeof r[n.path[a]]==="undefined"){r[n.path[a]]=typeof n.path[a]==="number"?[]:{}}r=r[n.path[a]]}switch(n.kind){case"A":b(r[n.path[a]],n.index,n.item);break;case"D":delete r[n.path[a]];break;case"E":case"N":r[n.path[a]]=n.rhs;break}}}function v(e,t,n){if(n.path&&n.path.length){var r=e[t],a,i=n.path.length-1;for(a=0;a<i;a++){r=r[n.path[a]]}switch(n.kind){case"A":v(r[n.path[a]],n.index,n.item);break;case"D":r[n.path[a]]=n.lhs;break;case"E":r[n.path[a]]=n.lhs;break;case"N":delete r[n.path[a]];break}}else{switch(n.kind){case"A":v(e[t],n.index,n.item);break;case"D":e[t]=n.lhs;break;case"E":e[t]=n.lhs;break;case"N":e=h(e,t);break}}return e}function y(e,t,n){if(e&&t&&n&&n.kind){var r=e,a,i;i=n.path.length-1;for(a=0;a<i;a++){if(typeof r[n.path[a]]==="undefined"){r[n.path[a]]={}}r=r[n.path[a]]}switch(n.kind){case"A":v(r[n.path[a]],n.index,n.item);break;case"D":r[n.path[a]]=n.lhs;break;case"E":r[n.path[a]]=n.lhs;break;case"N":delete r[n.path[a]];break}}}function k(e,t,n){if(e&&t){var r=function(r){if(!n||n(e,t,r)){d(e,t,r)}};o(e,t,r)}}Object.defineProperties(p,{diff:{value:p,enumerable:true},observableDiff:{value:o,enumerable:true},applyDiff:{value:k,enumerable:true},applyChange:{value:d,enumerable:true},revertChange:{value:y,enumerable:true},isConflict:{value:function(){return"undefined"!==typeof n},enumerable:true},noConflict:{value:function(){if(r){r.forEach(function(e){e()});r=null}return p},enumerable:true}});return p});
diff --git a/toolkit/components/microformats/test/static/javascript/mocha.js b/toolkit/components/microformats/test/static/javascript/mocha.js
deleted file mode 100644
index 100850e5d..000000000
--- a/toolkit/components/microformats/test/static/javascript/mocha.js
+++ /dev/null
@@ -1,6573 +0,0 @@
-(function(){
-
-// CommonJS require()
-
-function require(p){
- var path = require.resolve(p)
- , mod = require.modules[path];
- if (!mod) throw new Error('failed to require "' + p + '"');
- if (!mod.exports) {
- mod.exports = {};
- mod.call(mod.exports, mod, mod.exports, require.relative(path));
- }
- return mod.exports;
- }
-
-require.modules = {};
-
-require.resolve = function (path){
- var orig = path
- , reg = path + '.js'
- , index = path + '/index.js';
- return require.modules[reg] && reg
- || require.modules[index] && index
- || orig;
- };
-
-require.register = function (path, fn){
- require.modules[path] = fn;
- };
-
-require.relative = function (parent) {
- return function(p){
- if ('.' != p.charAt(0)) return require(p);
-
- var path = parent.split('/')
- , segs = p.split('/');
- path.pop();
-
- for (var i = 0; i < segs.length; i++) {
- var seg = segs[i];
- if ('..' == seg) path.pop();
- else if ('.' != seg) path.push(seg);
- }
-
- return require(path.join('/'));
- };
- };
-
-
-require.register("browser/debug.js", function(module, exports, require){
-module.exports = function(type){
- return function(){
- }
-};
-
-}); // module: browser/debug.js
-
-require.register("browser/diff.js", function(module, exports, require){
-/* See LICENSE file for terms of use */
-
-/*
- * Text diff implementation.
- *
- * This library supports the following APIS:
- * JsDiff.diffChars: Character by character diff
- * JsDiff.diffWords: Word (as defined by \b regex) diff which ignores whitespace
- * JsDiff.diffLines: Line based diff
- *
- * JsDiff.diffCss: Diff targeted at CSS content
- *
- * These methods are based on the implementation proposed in
- * "An O(ND) Difference Algorithm and its Variations" (Myers, 1986).
- * http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.4.6927
- */
-var JsDiff = (function() {
- /*jshint maxparams: 5*/
- function clonePath(path) {
- return { newPos: path.newPos, components: path.components.slice(0) };
- }
- function removeEmpty(array) {
- var ret = [];
- for (var i = 0; i < array.length; i++) {
- if (array[i]) {
- ret.push(array[i]);
- }
- }
- return ret;
- }
- function escapeHTML(s) {
- var n = s;
- n = n.replace(/&/g, '&amp;');
- n = n.replace(/</g, '&lt;');
- n = n.replace(/>/g, '&gt;');
- n = n.replace(/"/g, '&quot;');
-
- return n;
- }
-
- var Diff = function(ignoreWhitespace) {
- this.ignoreWhitespace = ignoreWhitespace;
- };
- Diff.prototype = {
- diff: function(oldString, newString) {
- // Handle the identity case (this is due to unrolling editLength == 0
- if (newString === oldString) {
- return [{ value: newString }];
- }
- if (!newString) {
- return [{ value: oldString, removed: true }];
- }
- if (!oldString) {
- return [{ value: newString, added: true }];
- }
-
- newString = this.tokenize(newString);
- oldString = this.tokenize(oldString);
-
- var newLen = newString.length, oldLen = oldString.length;
- var maxEditLength = newLen + oldLen;
- var bestPath = [{ newPos: -1, components: [] }];
-
- // Seed editLength = 0
- var oldPos = this.extractCommon(bestPath[0], newString, oldString, 0);
- if (bestPath[0].newPos+1 >= newLen && oldPos+1 >= oldLen) {
- return bestPath[0].components;
- }
-
- for (var editLength = 1; editLength <= maxEditLength; editLength++) {
- for (var diagonalPath = -1*editLength; diagonalPath <= editLength; diagonalPath+=2) {
- var basePath;
- var addPath = bestPath[diagonalPath-1],
- removePath = bestPath[diagonalPath+1];
- oldPos = (removePath ? removePath.newPos : 0) - diagonalPath;
- if (addPath) {
- // No one else is going to attempt to use this value, clear it
- bestPath[diagonalPath-1] = undefined;
- }
-
- var canAdd = addPath && addPath.newPos+1 < newLen;
- var canRemove = removePath && 0 <= oldPos && oldPos < oldLen;
- if (!canAdd && !canRemove) {
- bestPath[diagonalPath] = undefined;
- continue;
- }
-
- // Select the diagonal that we want to branch from. We select the prior
- // path whose position in the new string is the farthest from the origin
- // and does not pass the bounds of the diff graph
- if (!canAdd || (canRemove && addPath.newPos < removePath.newPos)) {
- basePath = clonePath(removePath);
- this.pushComponent(basePath.components, oldString[oldPos], undefined, true);
- } else {
- basePath = clonePath(addPath);
- basePath.newPos++;
- this.pushComponent(basePath.components, newString[basePath.newPos], true, undefined);
- }
-
- oldPos = this.extractCommon(basePath, newString, oldString, diagonalPath);
-
- if (basePath.newPos+1 >= newLen && oldPos+1 >= oldLen) {
- return basePath.components;
- } else {
- bestPath[diagonalPath] = basePath;
- }
- }
- }
- },
-
- pushComponent: function(components, value, added, removed) {
- var last = components[components.length-1];
- if (last && last.added === added && last.removed === removed) {
- // We need to clone here as the component clone operation is just
- // as shallow array clone
- components[components.length-1] =
- {value: this.join(last.value, value), added: added, removed: removed };
- } else {
- components.push({value: value, added: added, removed: removed });
- }
- },
- extractCommon: function(basePath, newString, oldString, diagonalPath) {
- var newLen = newString.length,
- oldLen = oldString.length,
- newPos = basePath.newPos,
- oldPos = newPos - diagonalPath;
- while (newPos+1 < newLen && oldPos+1 < oldLen && this.equals(newString[newPos+1], oldString[oldPos+1])) {
- newPos++;
- oldPos++;
-
- this.pushComponent(basePath.components, newString[newPos], undefined, undefined);
- }
- basePath.newPos = newPos;
- return oldPos;
- },
-
- equals: function(left, right) {
- var reWhitespace = /\S/;
- if (this.ignoreWhitespace && !reWhitespace.test(left) && !reWhitespace.test(right)) {
- return true;
- } else {
- return left === right;
- }
- },
- join: function(left, right) {
- return left + right;
- },
- tokenize: function(value) {
- return value;
- }
- };
-
- var CharDiff = new Diff();
-
- var WordDiff = new Diff(true);
- var WordWithSpaceDiff = new Diff();
- WordDiff.tokenize = WordWithSpaceDiff.tokenize = function(value) {
- return removeEmpty(value.split(/(\s+|\b)/));
- };
-
- var CssDiff = new Diff(true);
- CssDiff.tokenize = function(value) {
- return removeEmpty(value.split(/([{}:;,]|\s+)/));
- };
-
- var LineDiff = new Diff();
- LineDiff.tokenize = function(value) {
- var retLines = [],
- lines = value.split(/^/m);
-
- for(var i = 0; i < lines.length; i++) {
- var line = lines[i],
- lastLine = lines[i - 1];
-
- // Merge lines that may contain windows new lines
- if (line == '\n' && lastLine && lastLine[lastLine.length - 1] === '\r') {
- retLines[retLines.length - 1] += '\n';
- } else if (line) {
- retLines.push(line);
- }
- }
-
- return retLines;
- };
-
- return {
- Diff: Diff,
-
- diffChars: function(oldStr, newStr) { return CharDiff.diff(oldStr, newStr); },
- diffWords: function(oldStr, newStr) { return WordDiff.diff(oldStr, newStr); },
- diffWordsWithSpace: function(oldStr, newStr) { return WordWithSpaceDiff.diff(oldStr, newStr); },
- diffLines: function(oldStr, newStr) { return LineDiff.diff(oldStr, newStr); },
-
- diffCss: function(oldStr, newStr) { return CssDiff.diff(oldStr, newStr); },
-
- createPatch: function(fileName, oldStr, newStr, oldHeader, newHeader) {
- var ret = [];
-
- ret.push('Index: ' + fileName);
- ret.push('===================================================================');
- ret.push('--- ' + fileName + (typeof oldHeader === 'undefined' ? '' : '\t' + oldHeader));
- ret.push('+++ ' + fileName + (typeof newHeader === 'undefined' ? '' : '\t' + newHeader));
-
- var diff = LineDiff.diff(oldStr, newStr);
- if (!diff[diff.length-1].value) {
- diff.pop(); // Remove trailing newline add
- }
- diff.push({value: '', lines: []}); // Append an empty value to make cleanup easier
-
- function contextLines(lines) {
- return lines.map(function(entry) { return ' ' + entry; });
- }
- function eofNL(curRange, i, current) {
- var last = diff[diff.length-2],
- isLast = i === diff.length-2,
- isLastOfType = i === diff.length-3 && (current.added !== last.added || current.removed !== last.removed);
-
- // Figure out if this is the last line for the given file and missing NL
- if (!/\n$/.test(current.value) && (isLast || isLastOfType)) {
- curRange.push('\\ No newline at end of file');
- }
- }
-
- var oldRangeStart = 0, newRangeStart = 0, curRange = [],
- oldLine = 1, newLine = 1;
- for (var i = 0; i < diff.length; i++) {
- var current = diff[i],
- lines = current.lines || current.value.replace(/\n$/, '').split('\n');
- current.lines = lines;
-
- if (current.added || current.removed) {
- if (!oldRangeStart) {
- var prev = diff[i-1];
- oldRangeStart = oldLine;
- newRangeStart = newLine;
-
- if (prev) {
- curRange = contextLines(prev.lines.slice(-4));
- oldRangeStart -= curRange.length;
- newRangeStart -= curRange.length;
- }
- }
- curRange.push.apply(curRange, lines.map(function(entry) { return (current.added?'+':'-') + entry; }));
- eofNL(curRange, i, current);
-
- if (current.added) {
- newLine += lines.length;
- } else {
- oldLine += lines.length;
- }
- } else {
- if (oldRangeStart) {
- // Close out any changes that have been output (or join overlapping)
- if (lines.length <= 8 && i < diff.length-2) {
- // Overlapping
- curRange.push.apply(curRange, contextLines(lines));
- } else {
- // end the range and output
- var contextSize = Math.min(lines.length, 4);
- ret.push(
- '@@ -' + oldRangeStart + ',' + (oldLine-oldRangeStart+contextSize)
- + ' +' + newRangeStart + ',' + (newLine-newRangeStart+contextSize)
- + ' @@');
- ret.push.apply(ret, curRange);
- ret.push.apply(ret, contextLines(lines.slice(0, contextSize)));
- if (lines.length <= 4) {
- eofNL(ret, i, current);
- }
-
- oldRangeStart = 0; newRangeStart = 0; curRange = [];
- }
- }
- oldLine += lines.length;
- newLine += lines.length;
- }
- }
-
- return ret.join('\n') + '\n';
- },
-
- applyPatch: function(oldStr, uniDiff) {
- var diffstr = uniDiff.split('\n');
- var diff = [];
- var remEOFNL = false,
- addEOFNL = false;
-
- for (var i = (diffstr[0][0]==='I'?4:0); i < diffstr.length; i++) {
- if(diffstr[i][0] === '@') {
- var meh = diffstr[i].split(/@@ -(\d+),(\d+) \+(\d+),(\d+) @@/);
- diff.unshift({
- start:meh[3],
- oldlength:meh[2],
- oldlines:[],
- newlength:meh[4],
- newlines:[]
- });
- } else if(diffstr[i][0] === '+') {
- diff[0].newlines.push(diffstr[i].substr(1));
- } else if(diffstr[i][0] === '-') {
- diff[0].oldlines.push(diffstr[i].substr(1));
- } else if(diffstr[i][0] === ' ') {
- diff[0].newlines.push(diffstr[i].substr(1));
- diff[0].oldlines.push(diffstr[i].substr(1));
- } else if(diffstr[i][0] === '\\') {
- if (diffstr[i-1][0] === '+') {
- remEOFNL = true;
- } else if(diffstr[i-1][0] === '-') {
- addEOFNL = true;
- }
- }
- }
-
- var str = oldStr.split('\n');
- for (i = diff.length - 1; i >= 0; i--) {
- var d = diff[i];
- for (var j = 0; j < d.oldlength; j++) {
- if(str[d.start-1+j] !== d.oldlines[j]) {
- return false;
- }
- }
- Array.prototype.splice.apply(str,[d.start-1,+d.oldlength].concat(d.newlines));
- }
-
- if (remEOFNL) {
- while (!str[str.length-1]) {
- str.pop();
- }
- } else if (addEOFNL) {
- str.push('');
- }
- return str.join('\n');
- },
-
- convertChangesToXML: function(changes){
- var ret = [];
- for ( var i = 0; i < changes.length; i++) {
- var change = changes[i];
- if (change.added) {
- ret.push('<ins>');
- } else if (change.removed) {
- ret.push('<del>');
- }
-
- ret.push(escapeHTML(change.value));
-
- if (change.added) {
- ret.push('</ins>');
- } else if (change.removed) {
- ret.push('</del>');
- }
- }
- return ret.join('');
- },
-
- // See: http://code.google.com/p/google-diff-match-patch/wiki/API
- convertChangesToDMP: function(changes){
- var ret = [], change;
- for ( var i = 0; i < changes.length; i++) {
- change = changes[i];
- var order = 0;
- if (change.added) {
- order = 1;
- } else if (change.removed) {
- order = -1;
- }
- ret.push([order, change.value]);
- }
- return ret;
- }
- };
-})();
-
-if (typeof module !== 'undefined') {
- module.exports = JsDiff;
-}
-
-}); // module: browser/diff.js
-
-require.register("browser/escape-string-regexp.js", function(module, exports, require){
-'use strict';
-
-var matchOperatorsRe = /[|\\{}()[\]^$+*?.]/g;
-
-module.exports = function (str) {
- if (typeof str !== 'string') {
- throw new TypeError('Expected a string');
- }
-
- return str.replace(matchOperatorsRe, '\\$&');
-};
-
-}); // module: browser/escape-string-regexp.js
-
-require.register("browser/events.js", function(module, exports, require){
-/**
- * Module exports.
- */
-
-exports.EventEmitter = EventEmitter;
-
-/**
- * Check if `obj` is an array.
- */
-
-function isArray(obj) {
- return '[object Array]' == {}.toString.call(obj);
-}
-
-/**
- * Event emitter constructor.
- *
- * @api public
- */
-
-function EventEmitter(){}
-
-/**
- * Adds a listener.
- *
- * @api public
- */
-
-EventEmitter.prototype.on = function (name, fn) {
- if (!this.$events) {
- this.$events = {};
- }
-
- if (!this.$events[name]) {
- this.$events[name] = fn;
- } else if (isArray(this.$events[name])) {
- this.$events[name].push(fn);
- } else {
- this.$events[name] = [this.$events[name], fn];
- }
-
- return this;
-};
-
-EventEmitter.prototype.addListener = EventEmitter.prototype.on;
-
-/**
- * Adds a volatile listener.
- *
- * @api public
- */
-
-EventEmitter.prototype.once = function (name, fn) {
- var self = this;
-
- function on () {
- self.removeListener(name, on);
- fn.apply(this, arguments);
- }
-
- on.listener = fn;
- this.on(name, on);
-
- return this;
-};
-
-/**
- * Removes a listener.
- *
- * @api public
- */
-
-EventEmitter.prototype.removeListener = function (name, fn) {
- if (this.$events && this.$events[name]) {
- var list = this.$events[name];
-
- if (isArray(list)) {
- var pos = -1;
-
- for (var i = 0, l = list.length; i < l; i++) {
- if (list[i] === fn || (list[i].listener && list[i].listener === fn)) {
- pos = i;
- break;
- }
- }
-
- if (pos < 0) {
- return this;
- }
-
- list.splice(pos, 1);
-
- if (!list.length) {
- delete this.$events[name];
- }
- } else if (list === fn || (list.listener && list.listener === fn)) {
- delete this.$events[name];
- }
- }
-
- return this;
-};
-
-/**
- * Removes all listeners for an event.
- *
- * @api public
- */
-
-EventEmitter.prototype.removeAllListeners = function (name) {
- if (name === undefined) {
- this.$events = {};
- return this;
- }
-
- if (this.$events && this.$events[name]) {
- this.$events[name] = null;
- }
-
- return this;
-};
-
-/**
- * Gets all listeners for a certain event.
- *
- * @api public
- */
-
-EventEmitter.prototype.listeners = function (name) {
- if (!this.$events) {
- this.$events = {};
- }
-
- if (!this.$events[name]) {
- this.$events[name] = [];
- }
-
- if (!isArray(this.$events[name])) {
- this.$events[name] = [this.$events[name]];
- }
-
- return this.$events[name];
-};
-
-/**
- * Emits an event.
- *
- * @api public
- */
-
-EventEmitter.prototype.emit = function (name) {
- if (!this.$events) {
- return false;
- }
-
- var handler = this.$events[name];
-
- if (!handler) {
- return false;
- }
-
- var args = [].slice.call(arguments, 1);
-
- if ('function' == typeof handler) {
- handler.apply(this, args);
- } else if (isArray(handler)) {
- var listeners = handler.slice();
-
- for (var i = 0, l = listeners.length; i < l; i++) {
- listeners[i].apply(this, args);
- }
- } else {
- return false;
- }
-
- return true;
-};
-
-}); // module: browser/events.js
-
-require.register("browser/fs.js", function(module, exports, require){
-
-}); // module: browser/fs.js
-
-require.register("browser/glob.js", function(module, exports, require){
-
-}); // module: browser/glob.js
-
-require.register("browser/path.js", function(module, exports, require){
-
-}); // module: browser/path.js
-
-require.register("browser/progress.js", function(module, exports, require){
-/**
- * Expose `Progress`.
- */
-
-module.exports = Progress;
-
-/**
- * Initialize a new `Progress` indicator.
- */
-
-function Progress() {
- this.percent = 0;
- this.size(0);
- this.fontSize(11);
- this.font('helvetica, arial, sans-serif');
-}
-
-/**
- * Set progress size to `n`.
- *
- * @param {Number} n
- * @return {Progress} for chaining
- * @api public
- */
-
-Progress.prototype.size = function(n){
- this._size = n;
- return this;
-};
-
-/**
- * Set text to `str`.
- *
- * @param {String} str
- * @return {Progress} for chaining
- * @api public
- */
-
-Progress.prototype.text = function(str){
- this._text = str;
- return this;
-};
-
-/**
- * Set font size to `n`.
- *
- * @param {Number} n
- * @return {Progress} for chaining
- * @api public
- */
-
-Progress.prototype.fontSize = function(n){
- this._fontSize = n;
- return this;
-};
-
-/**
- * Set font `family`.
- *
- * @param {String} family
- * @return {Progress} for chaining
- */
-
-Progress.prototype.font = function(family){
- this._font = family;
- return this;
-};
-
-/**
- * Update percentage to `n`.
- *
- * @param {Number} n
- * @return {Progress} for chaining
- */
-
-Progress.prototype.update = function(n){
- this.percent = n;
- return this;
-};
-
-/**
- * Draw on `ctx`.
- *
- * @param {CanvasRenderingContext2d} ctx
- * @return {Progress} for chaining
- */
-
-Progress.prototype.draw = function(ctx){
- try {
- var percent = Math.min(this.percent, 100)
- , size = this._size
- , half = size / 2
- , x = half
- , y = half
- , rad = half - 1
- , fontSize = this._fontSize;
-
- ctx.font = fontSize + 'px ' + this._font;
-
- var angle = Math.PI * 2 * (percent / 100);
- ctx.clearRect(0, 0, size, size);
-
- // outer circle
- ctx.strokeStyle = '#9f9f9f';
- ctx.beginPath();
- ctx.arc(x, y, rad, 0, angle, false);
- ctx.stroke();
-
- // inner circle
- ctx.strokeStyle = '#eee';
- ctx.beginPath();
- ctx.arc(x, y, rad - 1, 0, angle, true);
- ctx.stroke();
-
- // text
- var text = this._text || (percent | 0) + '%'
- , w = ctx.measureText(text).width;
-
- ctx.fillText(
- text
- , x - w / 2 + 1
- , y + fontSize / 2 - 1);
- } catch (ex) {} //don't fail if we can't render progress
- return this;
-};
-
-}); // module: browser/progress.js
-
-require.register("browser/tty.js", function(module, exports, require){
-exports.isatty = function(){
- return true;
-};
-
-exports.getWindowSize = function(){
- if ('innerHeight' in global) {
- return [global.innerHeight, global.innerWidth];
- } else {
- // In a Web Worker, the DOM Window is not available.
- return [640, 480];
- }
-};
-
-}); // module: browser/tty.js
-
-require.register("context.js", function(module, exports, require){
-/**
- * Expose `Context`.
- */
-
-module.exports = Context;
-
-/**
- * Initialize a new `Context`.
- *
- * @api private
- */
-
-function Context(){}
-
-/**
- * Set or get the context `Runnable` to `runnable`.
- *
- * @param {Runnable} runnable
- * @return {Context}
- * @api private
- */
-
-Context.prototype.runnable = function(runnable){
- if (0 == arguments.length) return this._runnable;
- this.test = this._runnable = runnable;
- return this;
-};
-
-/**
- * Set test timeout `ms`.
- *
- * @param {Number} ms
- * @return {Context} self
- * @api private
- */
-
-Context.prototype.timeout = function(ms){
- if (arguments.length === 0) return this.runnable().timeout();
- this.runnable().timeout(ms);
- return this;
-};
-
-/**
- * Set test timeout `enabled`.
- *
- * @param {Boolean} enabled
- * @return {Context} self
- * @api private
- */
-
-Context.prototype.enableTimeouts = function (enabled) {
- this.runnable().enableTimeouts(enabled);
- return this;
-};
-
-
-/**
- * Set test slowness threshold `ms`.
- *
- * @param {Number} ms
- * @return {Context} self
- * @api private
- */
-
-Context.prototype.slow = function(ms){
- this.runnable().slow(ms);
- return this;
-};
-
-/**
- * Mark a test as skipped.
- *
- * @return {Context} self
- * @api private
- */
-
-Context.prototype.skip = function(){
- this.runnable().skip();
- return this;
-};
-
-/**
- * Inspect the context void of `._runnable`.
- *
- * @return {String}
- * @api private
- */
-
-Context.prototype.inspect = function(){
- return JSON.stringify(this, function(key, val){
- if ('_runnable' == key) return undefined;
- if ('test' == key) return undefined;
- return val;
- }, 2);
-};
-
-}); // module: context.js
-
-require.register("hook.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Runnable = require('./runnable');
-
-/**
- * Expose `Hook`.
- */
-
-module.exports = Hook;
-
-/**
- * Initialize a new `Hook` with the given `title` and callback `fn`.
- *
- * @param {String} title
- * @param {Function} fn
- * @api private
- */
-
-function Hook(title, fn) {
- Runnable.call(this, title, fn);
- this.type = 'hook';
-}
-
-/**
- * Inherit from `Runnable.prototype`.
- */
-
-function F(){}
-F.prototype = Runnable.prototype;
-Hook.prototype = new F;
-Hook.prototype.constructor = Hook;
-
-
-/**
- * Get or set the test `err`.
- *
- * @param {Error} err
- * @return {Error}
- * @api public
- */
-
-Hook.prototype.error = function(err){
- if (0 == arguments.length) {
- err = this._error;
- this._error = null;
- return err;
- }
-
- this._error = err;
-};
-
-}); // module: hook.js
-
-require.register("interfaces/bdd.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Suite = require('../suite')
- , Test = require('../test')
- , utils = require('../utils')
- , escapeRe = require('browser/escape-string-regexp');
-
-/**
- * BDD-style interface:
- *
- * describe('Array', function(){
- * describe('#indexOf()', function(){
- * it('should return -1 when not present', function(){
- *
- * });
- *
- * it('should return the index when present', function(){
- *
- * });
- * });
- * });
- *
- */
-
-module.exports = function(suite){
- var suites = [suite];
-
- suite.on('pre-require', function(context, file, mocha){
-
- var common = require('./common')(suites, context);
-
- context.before = common.before;
- context.after = common.after;
- context.beforeEach = common.beforeEach;
- context.afterEach = common.afterEach;
- context.run = mocha.options.delay && common.runWithSuite(suite);
- /**
- * Describe a "suite" with the given `title`
- * and callback `fn` containing nested suites
- * and/or tests.
- */
-
- context.describe = context.context = function(title, fn){
- var suite = Suite.create(suites[0], title);
- suite.file = file;
- suites.unshift(suite);
- fn.call(suite);
- suites.shift();
- return suite;
- };
-
- /**
- * Pending describe.
- */
-
- context.xdescribe =
- context.xcontext =
- context.describe.skip = function(title, fn){
- var suite = Suite.create(suites[0], title);
- suite.pending = true;
- suites.unshift(suite);
- fn.call(suite);
- suites.shift();
- };
-
- /**
- * Exclusive suite.
- */
-
- context.describe.only = function(title, fn){
- var suite = context.describe(title, fn);
- mocha.grep(suite.fullTitle());
- return suite;
- };
-
- /**
- * Describe a specification or test-case
- * with the given `title` and callback `fn`
- * acting as a thunk.
- */
-
- context.it = context.specify = function(title, fn){
- var suite = suites[0];
- if (suite.pending) fn = null;
- var test = new Test(title, fn);
- test.file = file;
- suite.addTest(test);
- return test;
- };
-
- /**
- * Exclusive test-case.
- */
-
- context.it.only = function(title, fn){
- var test = context.it(title, fn);
- var reString = '^' + escapeRe(test.fullTitle()) + '$';
- mocha.grep(new RegExp(reString));
- return test;
- };
-
- /**
- * Pending test case.
- */
-
- context.xit =
- context.xspecify =
- context.it.skip = function(title){
- context.it(title);
- };
-
- });
-};
-
-}); // module: interfaces/bdd.js
-
-require.register("interfaces/common.js", function(module, exports, require){
-/**
- * Functions common to more than one interface
- * @module lib/interfaces/common
- */
-
-'use strict';
-
-module.exports = function (suites, context) {
-
- return {
- /**
- * This is only present if flag --delay is passed into Mocha. It triggers
- * root suite execution. Returns a function which runs the root suite.
- */
- runWithSuite: function runWithSuite(suite) {
- return function run() {
- suite.run();
- };
- },
-
- /**
- * Execute before running tests.
- */
- before: function (name, fn) {
- suites[0].beforeAll(name, fn);
- },
-
- /**
- * Execute after running tests.
- */
- after: function (name, fn) {
- suites[0].afterAll(name, fn);
- },
-
- /**
- * Execute before each test case.
- */
- beforeEach: function (name, fn) {
- suites[0].beforeEach(name, fn);
- },
-
- /**
- * Execute after each test case.
- */
- afterEach: function (name, fn) {
- suites[0].afterEach(name, fn);
- },
-
- test: {
- /**
- * Pending test case.
- */
- skip: function (title) {
- context.test(title);
- }
- }
- }
-};
-
-}); // module: interfaces/common.js
-
-require.register("interfaces/exports.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Suite = require('../suite')
- , Test = require('../test');
-
-/**
- * TDD-style interface:
- *
- * exports.Array = {
- * '#indexOf()': {
- * 'should return -1 when the value is not present': function(){
- *
- * },
- *
- * 'should return the correct index when the value is present': function(){
- *
- * }
- * }
- * };
- *
- */
-
-module.exports = function(suite){
- var suites = [suite];
-
- suite.on('require', visit);
-
- function visit(obj, file) {
- var suite;
- for (var key in obj) {
- if ('function' == typeof obj[key]) {
- var fn = obj[key];
- switch (key) {
- case 'before':
- suites[0].beforeAll(fn);
- break;
- case 'after':
- suites[0].afterAll(fn);
- break;
- case 'beforeEach':
- suites[0].beforeEach(fn);
- break;
- case 'afterEach':
- suites[0].afterEach(fn);
- break;
- default:
- var test = new Test(key, fn);
- test.file = file;
- suites[0].addTest(test);
- }
- } else {
- suite = Suite.create(suites[0], key);
- suites.unshift(suite);
- visit(obj[key]);
- suites.shift();
- }
- }
- }
-};
-
-}); // module: interfaces/exports.js
-
-require.register("interfaces/index.js", function(module, exports, require){
-exports.bdd = require('./bdd');
-exports.tdd = require('./tdd');
-exports.qunit = require('./qunit');
-exports.exports = require('./exports');
-
-}); // module: interfaces/index.js
-
-require.register("interfaces/qunit.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Suite = require('../suite')
- , Test = require('../test')
- , escapeRe = require('browser/escape-string-regexp')
- , utils = require('../utils');
-
-/**
- * QUnit-style interface:
- *
- * suite('Array');
- *
- * test('#length', function(){
- * var arr = [1,2,3];
- * ok(arr.length == 3);
- * });
- *
- * test('#indexOf()', function(){
- * var arr = [1,2,3];
- * ok(arr.indexOf(1) == 0);
- * ok(arr.indexOf(2) == 1);
- * ok(arr.indexOf(3) == 2);
- * });
- *
- * suite('String');
- *
- * test('#length', function(){
- * ok('foo'.length == 3);
- * });
- *
- */
-
-module.exports = function(suite){
- var suites = [suite];
-
- suite.on('pre-require', function(context, file, mocha){
-
- var common = require('./common')(suites, context);
-
- context.before = common.before;
- context.after = common.after;
- context.beforeEach = common.beforeEach;
- context.afterEach = common.afterEach;
- context.run = mocha.options.delay && common.runWithSuite(suite);
- /**
- * Describe a "suite" with the given `title`.
- */
-
- context.suite = function(title){
- if (suites.length > 1) suites.shift();
- var suite = Suite.create(suites[0], title);
- suite.file = file;
- suites.unshift(suite);
- return suite;
- };
-
- /**
- * Exclusive test-case.
- */
-
- context.suite.only = function(title, fn){
- var suite = context.suite(title, fn);
- mocha.grep(suite.fullTitle());
- };
-
- /**
- * Describe a specification or test-case
- * with the given `title` and callback `fn`
- * acting as a thunk.
- */
-
- context.test = function(title, fn){
- var test = new Test(title, fn);
- test.file = file;
- suites[0].addTest(test);
- return test;
- };
-
- /**
- * Exclusive test-case.
- */
-
- context.test.only = function(title, fn){
- var test = context.test(title, fn);
- var reString = '^' + escapeRe(test.fullTitle()) + '$';
- mocha.grep(new RegExp(reString));
- };
-
- context.test.skip = common.test.skip;
-
- });
-};
-
-}); // module: interfaces/qunit.js
-
-require.register("interfaces/tdd.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Suite = require('../suite')
- , Test = require('../test')
- , escapeRe = require('browser/escape-string-regexp')
- , utils = require('../utils');
-
-/**
- * TDD-style interface:
- *
- * suite('Array', function(){
- * suite('#indexOf()', function(){
- * suiteSetup(function(){
- *
- * });
- *
- * test('should return -1 when not present', function(){
- *
- * });
- *
- * test('should return the index when present', function(){
- *
- * });
- *
- * suiteTeardown(function(){
- *
- * });
- * });
- * });
- *
- */
-
-module.exports = function(suite){
- var suites = [suite];
-
- suite.on('pre-require', function(context, file, mocha){
-
- var common = require('./common')(suites, context);
-
- context.setup = common.beforeEach;
- context.teardown = common.afterEach;
- context.suiteSetup = common.before;
- context.suiteTeardown = common.after;
- context.run = mocha.options.delay && common.runWithSuite(suite);
- /**
- * Describe a "suite" with the given `title`
- * and callback `fn` containing nested suites
- * and/or tests.
- */
-
- context.suite = function(title, fn){
- var suite = Suite.create(suites[0], title);
- suite.file = file;
- suites.unshift(suite);
- fn.call(suite);
- suites.shift();
- return suite;
- };
-
- /**
- * Pending suite.
- */
- context.suite.skip = function(title, fn) {
- var suite = Suite.create(suites[0], title);
- suite.pending = true;
- suites.unshift(suite);
- fn.call(suite);
- suites.shift();
- };
-
- /**
- * Exclusive test-case.
- */
-
- context.suite.only = function(title, fn){
- var suite = context.suite(title, fn);
- mocha.grep(suite.fullTitle());
- };
-
- /**
- * Describe a specification or test-case
- * with the given `title` and callback `fn`
- * acting as a thunk.
- */
-
- context.test = function(title, fn){
- var suite = suites[0];
- if (suite.pending) fn = null;
- var test = new Test(title, fn);
- test.file = file;
- suite.addTest(test);
- return test;
- };
-
- /**
- * Exclusive test-case.
- */
-
- context.test.only = function(title, fn){
- var test = context.test(title, fn);
- var reString = '^' + escapeRe(test.fullTitle()) + '$';
- mocha.grep(new RegExp(reString));
- };
-
- context.test.skip = common.test.skip;
- });
-};
-
-}); // module: interfaces/tdd.js
-
-require.register("mocha.js", function(module, exports, require){
-/*!
- * mocha
- * Copyright(c) 2011 TJ Holowaychuk <tj@vision-media.ca>
- * MIT Licensed
- */
-
-/**
- * Module dependencies.
- */
-
-var path = require('browser/path')
- , escapeRe = require('browser/escape-string-regexp')
- , utils = require('./utils');
-
-/**
- * Expose `Mocha`.
- */
-
-exports = module.exports = Mocha;
-
-/**
- * To require local UIs and reporters when running in node.
- */
-
-if (typeof process !== 'undefined' && typeof process.cwd === 'function') {
- var join = path.join
- , cwd = process.cwd();
- module.paths.push(cwd, join(cwd, 'node_modules'));
-}
-
-/**
- * Expose internals.
- */
-
-exports.utils = utils;
-exports.interfaces = require('./interfaces');
-exports.reporters = require('./reporters');
-exports.Runnable = require('./runnable');
-exports.Context = require('./context');
-exports.Runner = require('./runner');
-exports.Suite = require('./suite');
-exports.Hook = require('./hook');
-exports.Test = require('./test');
-
-/**
- * Return image `name` path.
- *
- * @param {String} name
- * @return {String}
- * @api private
- */
-
-function image(name) {
- return __dirname + '/../images/' + name + '.png';
-}
-
-/**
- * Setup mocha with `options`.
- *
- * Options:
- *
- * - `ui` name "bdd", "tdd", "exports" etc
- * - `reporter` reporter instance, defaults to `mocha.reporters.spec`
- * - `globals` array of accepted globals
- * - `timeout` timeout in milliseconds
- * - `bail` bail on the first test failure
- * - `slow` milliseconds to wait before considering a test slow
- * - `ignoreLeaks` ignore global leaks
- * - `fullTrace` display the full stack-trace on failing
- * - `grep` string or regexp to filter tests with
- *
- * @param {Object} options
- * @api public
- */
-
-function Mocha(options) {
- options = options || {};
- this.files = [];
- this.options = options;
- if (options.grep) this.grep(new RegExp(options.grep));
- if (options.fgrep) this.grep(options.fgrep);
- this.suite = new exports.Suite('', new exports.Context);
- this.ui(options.ui);
- this.bail(options.bail);
- this.reporter(options.reporter, options.reporterOptions);
- if (null != options.timeout) this.timeout(options.timeout);
- this.useColors(options.useColors);
- if (options.enableTimeouts !== null) this.enableTimeouts(options.enableTimeouts);
- if (options.slow) this.slow(options.slow);
-
- this.suite.on('pre-require', function (context) {
- exports.afterEach = context.afterEach || context.teardown;
- exports.after = context.after || context.suiteTeardown;
- exports.beforeEach = context.beforeEach || context.setup;
- exports.before = context.before || context.suiteSetup;
- exports.describe = context.describe || context.suite;
- exports.it = context.it || context.test;
- exports.setup = context.setup || context.beforeEach;
- exports.suiteSetup = context.suiteSetup || context.before;
- exports.suiteTeardown = context.suiteTeardown || context.after;
- exports.suite = context.suite || context.describe;
- exports.teardown = context.teardown || context.afterEach;
- exports.test = context.test || context.it;
- exports.run = context.run;
- });
-}
-
-/**
- * Enable or disable bailing on the first failure.
- *
- * @param {Boolean} [bail]
- * @api public
- */
-
-Mocha.prototype.bail = function(bail){
- if (0 == arguments.length) bail = true;
- this.suite.bail(bail);
- return this;
-};
-
-/**
- * Add test `file`.
- *
- * @param {String} file
- * @api public
- */
-
-Mocha.prototype.addFile = function(file){
- this.files.push(file);
- return this;
-};
-
-/**
- * Set reporter to `reporter`, defaults to "spec".
- *
- * @param {String|Function} reporter name or constructor
- * @param {Object} reporterOptions optional options
- * @api public
- */
-Mocha.prototype.reporter = function(reporter, reporterOptions){
- if ('function' == typeof reporter) {
- this._reporter = reporter;
- } else {
- reporter = reporter || 'spec';
- var _reporter;
- try { _reporter = require('./reporters/' + reporter); } catch (err) {}
- if (!_reporter) try { _reporter = require(reporter); } catch (err) {
- err.message.indexOf('Cannot find module') !== -1
- ? console.warn('"' + reporter + '" reporter not found')
- : console.warn('"' + reporter + '" reporter blew up with error:\n' + err.stack);
- }
- if (!_reporter && reporter === 'teamcity')
- console.warn('The Teamcity reporter was moved to a package named ' +
- 'mocha-teamcity-reporter ' +
- '(https://npmjs.org/package/mocha-teamcity-reporter).');
- if (!_reporter) throw new Error('invalid reporter "' + reporter + '"');
- this._reporter = _reporter;
- }
- this.options.reporterOptions = reporterOptions;
- return this;
-};
-
-/**
- * Set test UI `name`, defaults to "bdd".
- *
- * @param {String} bdd
- * @api public
- */
-
-Mocha.prototype.ui = function(name){
- name = name || 'bdd';
- this._ui = exports.interfaces[name];
- if (!this._ui) try { this._ui = require(name); } catch (err) {}
- if (!this._ui) throw new Error('invalid interface "' + name + '"');
- this._ui = this._ui(this.suite);
- return this;
-};
-
-/**
- * Load registered files.
- *
- * @api private
- */
-
-Mocha.prototype.loadFiles = function(fn){
- var self = this;
- var suite = this.suite;
- var pending = this.files.length;
- this.files.forEach(function(file){
- file = path.resolve(file);
- suite.emit('pre-require', global, file, self);
- suite.emit('require', require(file), file, self);
- suite.emit('post-require', global, file, self);
- --pending || (fn && fn());
- });
-};
-
-/**
- * Enable growl support.
- *
- * @api private
- */
-
-Mocha.prototype._growl = function(runner, reporter) {
- var notify = require('growl');
-
- runner.on('end', function(){
- var stats = reporter.stats;
- if (stats.failures) {
- var msg = stats.failures + ' of ' + runner.total + ' tests failed';
- notify(msg, { name: 'mocha', title: 'Failed', image: image('error') });
- } else {
- notify(stats.passes + ' tests passed in ' + stats.duration + 'ms', {
- name: 'mocha'
- , title: 'Passed'
- , image: image('ok')
- });
- }
- });
-};
-
-/**
- * Add regexp to grep, if `re` is a string it is escaped.
- *
- * @param {RegExp|String} re
- * @return {Mocha}
- * @api public
- */
-
-Mocha.prototype.grep = function(re){
- this.options.grep = 'string' == typeof re
- ? new RegExp(escapeRe(re))
- : re;
- return this;
-};
-
-/**
- * Invert `.grep()` matches.
- *
- * @return {Mocha}
- * @api public
- */
-
-Mocha.prototype.invert = function(){
- this.options.invert = true;
- return this;
-};
-
-/**
- * Ignore global leaks.
- *
- * @param {Boolean} ignore
- * @return {Mocha}
- * @api public
- */
-
-Mocha.prototype.ignoreLeaks = function(ignore){
- this.options.ignoreLeaks = !!ignore;
- return this;
-};
-
-/**
- * Enable global leak checking.
- *
- * @return {Mocha}
- * @api public
- */
-
-Mocha.prototype.checkLeaks = function(){
- this.options.ignoreLeaks = false;
- return this;
-};
-
-/**
- * Display long stack-trace on failing
- *
- * @return {Mocha}
- * @api public
- */
-
-Mocha.prototype.fullTrace = function() {
- this.options.fullStackTrace = true;
- return this;
-};
-
-/**
- * Enable growl support.
- *
- * @return {Mocha}
- * @api public
- */
-
-Mocha.prototype.growl = function(){
- this.options.growl = true;
- return this;
-};
-
-/**
- * Ignore `globals` array or string.
- *
- * @param {Array|String} globals
- * @return {Mocha}
- * @api public
- */
-
-Mocha.prototype.globals = function(globals){
- this.options.globals = (this.options.globals || []).concat(globals);
- return this;
-};
-
-/**
- * Emit color output.
- *
- * @param {Boolean} colors
- * @return {Mocha}
- * @api public
- */
-
-Mocha.prototype.useColors = function(colors){
- if (colors !== undefined) {
- this.options.useColors = colors;
- }
- return this;
-};
-
-/**
- * Use inline diffs rather than +/-.
- *
- * @param {Boolean} inlineDiffs
- * @return {Mocha}
- * @api public
- */
-
-Mocha.prototype.useInlineDiffs = function(inlineDiffs) {
- this.options.useInlineDiffs = arguments.length && inlineDiffs != undefined
- ? inlineDiffs
- : false;
- return this;
-};
-
-/**
- * Set the timeout in milliseconds.
- *
- * @param {Number} timeout
- * @return {Mocha}
- * @api public
- */
-
-Mocha.prototype.timeout = function(timeout){
- this.suite.timeout(timeout);
- return this;
-};
-
-/**
- * Set slowness threshold in milliseconds.
- *
- * @param {Number} slow
- * @return {Mocha}
- * @api public
- */
-
-Mocha.prototype.slow = function(slow){
- this.suite.slow(slow);
- return this;
-};
-
-/**
- * Enable timeouts.
- *
- * @param {Boolean} enabled
- * @return {Mocha}
- * @api public
- */
-
-Mocha.prototype.enableTimeouts = function(enabled) {
- this.suite.enableTimeouts(arguments.length && enabled !== undefined
- ? enabled
- : true);
- return this
-};
-
-/**
- * Makes all tests async (accepting a callback)
- *
- * @return {Mocha}
- * @api public
- */
-
-Mocha.prototype.asyncOnly = function(){
- this.options.asyncOnly = true;
- return this;
-};
-
-/**
- * Disable syntax highlighting (in browser).
- * @returns {Mocha}
- * @api public
- */
-Mocha.prototype.noHighlighting = function() {
- this.options.noHighlighting = true;
- return this;
-};
-
-/**
- * Delay root suite execution.
- * @returns {Mocha}
- * @api public
- */
-Mocha.prototype.delay = function delay() {
- this.options.delay = true;
- return this;
-};
-
-/**
- * Run tests and invoke `fn()` when complete.
- *
- * @param {Function} fn
- * @return {Runner}
- * @api public
- */
-Mocha.prototype.run = function(fn){
- if (this.files.length) this.loadFiles();
- var suite = this.suite;
- var options = this.options;
- options.files = this.files;
- var runner = new exports.Runner(suite, options.delay);
- var reporter = new this._reporter(runner, options);
- runner.ignoreLeaks = false !== options.ignoreLeaks;
- runner.fullStackTrace = options.fullStackTrace;
- runner.asyncOnly = options.asyncOnly;
- if (options.grep) runner.grep(options.grep, options.invert);
- if (options.globals) runner.globals(options.globals);
- if (options.growl) this._growl(runner, reporter);
- if (options.useColors !== undefined) {
- exports.reporters.Base.useColors = options.useColors;
- }
- exports.reporters.Base.inlineDiffs = options.useInlineDiffs;
-
- function done(failures) {
- if (reporter.done) {
- reporter.done(failures, fn);
- } else fn && fn(failures);
- }
-
- return runner.run(done);
-};
-
-}); // module: mocha.js
-
-require.register("ms.js", function(module, exports, require){
-/**
- * Helpers.
- */
-
-var s = 1000;
-var m = s * 60;
-var h = m * 60;
-var d = h * 24;
-var y = d * 365.25;
-
-/**
- * Parse or format the given `val`.
- *
- * Options:
- *
- * - `long` verbose formatting [false]
- *
- * @param {String|Number} val
- * @param {Object} options
- * @return {String|Number}
- * @api public
- */
-
-module.exports = function(val, options){
- options = options || {};
- if ('string' == typeof val) return parse(val);
- return options['long'] ? longFormat(val) : shortFormat(val);
-};
-
-/**
- * Parse the given `str` and return milliseconds.
- *
- * @param {String} str
- * @return {Number}
- * @api private
- */
-
-function parse(str) {
- var match = /^((?:\d+)?\.?\d+) *(ms|seconds?|s|minutes?|m|hours?|h|days?|d|years?|y)?$/i.exec(str);
- if (!match) return undefined;
- var n = parseFloat(match[1]);
- var type = (match[2] || 'ms').toLowerCase();
- switch (type) {
- case 'years':
- case 'year':
- case 'y':
- return n * y;
- case 'days':
- case 'day':
- case 'd':
- return n * d;
- case 'hours':
- case 'hour':
- case 'h':
- return n * h;
- case 'minutes':
- case 'minute':
- case 'm':
- return n * m;
- case 'seconds':
- case 'second':
- case 's':
- return n * s;
- case 'ms':
- return n;
- }
-}
-
-/**
- * Short format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function shortFormat(ms) {
- if (ms >= d) return Math.round(ms / d) + 'd';
- if (ms >= h) return Math.round(ms / h) + 'h';
- if (ms >= m) return Math.round(ms / m) + 'm';
- if (ms >= s) return Math.round(ms / s) + 's';
- return ms + 'ms';
-}
-
-/**
- * Long format for `ms`.
- *
- * @param {Number} ms
- * @return {String}
- * @api private
- */
-
-function longFormat(ms) {
- return plural(ms, d, 'day')
- || plural(ms, h, 'hour')
- || plural(ms, m, 'minute')
- || plural(ms, s, 'second')
- || ms + ' ms';
-}
-
-/**
- * Pluralization helper.
- */
-
-function plural(ms, n, name) {
- if (ms < n) return undefined;
- if (ms < n * 1.5) return Math.floor(ms / n) + ' ' + name;
- return Math.ceil(ms / n) + ' ' + name + 's';
-}
-
-}); // module: ms.js
-
-require.register("pending.js", function(module, exports, require){
-
-/**
- * Expose `Pending`.
- */
-
-module.exports = Pending;
-
-/**
- * Initialize a new `Pending` error with the given message.
- *
- * @param {String} message
- */
-
-function Pending(message) {
- this.message = message;
-}
-
-}); // module: pending.js
-
-require.register("reporters/base.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var tty = require('browser/tty')
- , diff = require('browser/diff')
- , ms = require('../ms')
- , utils = require('../utils')
- , supportsColor = process.env ? require('supports-color') : null;
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-var Date = global.Date
- , setTimeout = global.setTimeout
- , setInterval = global.setInterval
- , clearTimeout = global.clearTimeout
- , clearInterval = global.clearInterval;
-
-/**
- * Check if both stdio streams are associated with a tty.
- */
-
-var isatty = tty.isatty(1) && tty.isatty(2);
-
-/**
- * Expose `Base`.
- */
-
-exports = module.exports = Base;
-
-/**
- * Enable coloring by default, except in the browser interface.
- */
-
-exports.useColors = process.env
- ? (supportsColor || (process.env.MOCHA_COLORS !== undefined))
- : false;
-
-/**
- * Inline diffs instead of +/-
- */
-
-exports.inlineDiffs = false;
-
-/**
- * Default color map.
- */
-
-exports.colors = {
- 'pass': 90
- , 'fail': 31
- , 'bright pass': 92
- , 'bright fail': 91
- , 'bright yellow': 93
- , 'pending': 36
- , 'suite': 0
- , 'error title': 0
- , 'error message': 31
- , 'error stack': 90
- , 'checkmark': 32
- , 'fast': 90
- , 'medium': 33
- , 'slow': 31
- , 'green': 32
- , 'light': 90
- , 'diff gutter': 90
- , 'diff added': 42
- , 'diff removed': 41
-};
-
-/**
- * Default symbol map.
- */
-
-exports.symbols = {
- ok: '✓',
- err: '✖',
- dot: '․'
-};
-
-// With node.js on Windows: use symbols available in terminal default fonts
-if ('win32' == process.platform) {
- exports.symbols.ok = '\u221A';
- exports.symbols.err = '\u00D7';
- exports.symbols.dot = '.';
-}
-
-/**
- * Color `str` with the given `type`,
- * allowing colors to be disabled,
- * as well as user-defined color
- * schemes.
- *
- * @param {String} type
- * @param {String} str
- * @return {String}
- * @api private
- */
-
-var color = exports.color = function(type, str) {
- if (!exports.useColors) return String(str);
- return '\u001b[' + exports.colors[type] + 'm' + str + '\u001b[0m';
-};
-
-/**
- * Expose term window size, with some
- * defaults for when stderr is not a tty.
- */
-
-exports.window = {
- width: 75
-};
-if (isatty) {
- exports.window.width = process.stdout.getWindowSize
- ? process.stdout.getWindowSize(1)[0]
- : tty.getWindowSize()[1];
-}
-
-/**
- * Expose some basic cursor interactions
- * that are common among reporters.
- */
-
-exports.cursor = {
- hide: function(){
- isatty && process.stdout.write('\u001b[?25l');
- },
-
- show: function(){
- isatty && process.stdout.write('\u001b[?25h');
- },
-
- deleteLine: function(){
- isatty && process.stdout.write('\u001b[2K');
- },
-
- beginningOfLine: function(){
- isatty && process.stdout.write('\u001b[0G');
- },
-
- CR: function(){
- if (isatty) {
- exports.cursor.deleteLine();
- exports.cursor.beginningOfLine();
- } else {
- process.stdout.write('\r');
- }
- }
-};
-
-/**
- * Outut the given `failures` as a list.
- *
- * @param {Array} failures
- * @api public
- */
-
-exports.list = function(failures){
- console.log();
- failures.forEach(function(test, i){
- // format
- var fmt = color('error title', ' %s) %s:\n')
- + color('error message', ' %s')
- + color('error stack', '\n%s\n');
-
- // msg
- var err = test.err
- , message = err.message || ''
- , stack = err.stack || message
- , index = stack.indexOf(message)
- , actual = err.actual
- , expected = err.expected
- , escape = true;
- if (index === -1) {
- msg = message;
- } else {
- index += message.length;
- msg = stack.slice(0, index);
- // remove msg from stack
- stack = stack.slice(index + 1);
- }
-
- // uncaught
- if (err.uncaught) {
- msg = 'Uncaught ' + msg;
- }
- // explicitly show diff
- if (err.showDiff !== false && sameType(actual, expected)
- && expected !== undefined) {
-
- if ('string' !== typeof actual) {
- escape = false;
- err.actual = actual = utils.stringify(actual);
- err.expected = expected = utils.stringify(expected);
- }
-
- fmt = color('error title', ' %s) %s:\n%s') + color('error stack', '\n%s\n');
- var match = message.match(/^([^:]+): expected/);
- msg = '\n ' + color('error message', match ? match[1] : msg);
-
- if (exports.inlineDiffs) {
- msg += inlineDiff(err, escape);
- } else {
- msg += unifiedDiff(err, escape);
- }
- }
-
- // indent stack trace
- stack = stack.replace(/^/gm, ' ');
-
- console.log(fmt, (i + 1), test.fullTitle(), msg, stack);
- });
-};
-
-/**
- * Initialize a new `Base` reporter.
- *
- * All other reporters generally
- * inherit from this reporter, providing
- * stats such as test duration, number
- * of tests passed / failed etc.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function Base(runner) {
- var self = this
- , stats = this.stats = { suites: 0, tests: 0, passes: 0, pending: 0, failures: 0 }
- , failures = this.failures = [];
-
- if (!runner) return;
- this.runner = runner;
-
- runner.stats = stats;
-
- runner.on('start', function(){
- stats.start = new Date;
- });
-
- runner.on('suite', function(suite){
- stats.suites = stats.suites || 0;
- suite.root || stats.suites++;
- });
-
- runner.on('test end', function(test){
- stats.tests = stats.tests || 0;
- stats.tests++;
- });
-
- runner.on('pass', function(test){
- stats.passes = stats.passes || 0;
-
- var medium = test.slow() / 2;
- if (test.duration > test.slow()) {
- test.speed = 'slow';
- } else if (test.duration > medium) {
- test.speed = 'medium';
- } else {
- test.speed = 'fast';
- }
-
- stats.passes++;
- });
-
- runner.on('fail', function(test, err){
- stats.failures = stats.failures || 0;
- stats.failures++;
- test.err = err;
- failures.push(test);
- });
-
- runner.on('end', function(){
- stats.end = new Date;
- stats.duration = new Date - stats.start;
- });
-
- runner.on('pending', function(){
- stats.pending++;
- });
-}
-
-/**
- * Output common epilogue used by many of
- * the bundled reporters.
- *
- * @api public
- */
-
-Base.prototype.epilogue = function(){
- var stats = this.stats;
- var tests;
- var fmt;
-
- console.log();
-
- // passes
- fmt = color('bright pass', ' ')
- + color('green', ' %d passing')
- + color('light', ' (%s)');
-
- console.log(fmt,
- stats.passes || 0,
- ms(stats.duration));
-
- // pending
- if (stats.pending) {
- fmt = color('pending', ' ')
- + color('pending', ' %d pending');
-
- console.log(fmt, stats.pending);
- }
-
- // failures
- if (stats.failures) {
- fmt = color('fail', ' %d failing');
-
- console.log(fmt, stats.failures);
-
- Base.list(this.failures);
- console.log();
- }
-
- console.log();
-};
-
-/**
- * Pad the given `str` to `len`.
- *
- * @param {String} str
- * @param {String} len
- * @return {String}
- * @api private
- */
-
-function pad(str, len) {
- str = String(str);
- return Array(len - str.length + 1).join(' ') + str;
-}
-
-
-/**
- * Returns an inline diff between 2 strings with coloured ANSI output
- *
- * @param {Error} Error with actual/expected
- * @return {String} Diff
- * @api private
- */
-
-function inlineDiff(err, escape) {
- var msg = errorDiff(err, 'WordsWithSpace', escape);
-
- // linenos
- var lines = msg.split('\n');
- if (lines.length > 4) {
- var width = String(lines.length).length;
- msg = lines.map(function(str, i){
- return pad(++i, width) + ' |' + ' ' + str;
- }).join('\n');
- }
-
- // legend
- msg = '\n'
- + color('diff removed', 'actual')
- + ' '
- + color('diff added', 'expected')
- + '\n\n'
- + msg
- + '\n';
-
- // indent
- msg = msg.replace(/^/gm, ' ');
- return msg;
-}
-
-/**
- * Returns a unified diff between 2 strings
- *
- * @param {Error} Error with actual/expected
- * @return {String} Diff
- * @api private
- */
-
-function unifiedDiff(err, escape) {
- var indent = ' ';
- function cleanUp(line) {
- if (escape) {
- line = escapeInvisibles(line);
- }
- if (line[0] === '+') return indent + colorLines('diff added', line);
- if (line[0] === '-') return indent + colorLines('diff removed', line);
- if (line.match(/\@\@/)) return null;
- if (line.match(/\\ No newline/)) return null;
- else return indent + line;
- }
- function notBlank(line) {
- return line != null;
- }
- var msg = diff.createPatch('string', err.actual, err.expected);
- var lines = msg.split('\n').splice(4);
- return '\n '
- + colorLines('diff added', '+ expected') + ' '
- + colorLines('diff removed', '- actual')
- + '\n\n'
- + lines.map(cleanUp).filter(notBlank).join('\n');
-}
-
-/**
- * Return a character diff for `err`.
- *
- * @param {Error} err
- * @return {String}
- * @api private
- */
-
-function errorDiff(err, type, escape) {
- var actual = escape ? escapeInvisibles(err.actual) : err.actual;
- var expected = escape ? escapeInvisibles(err.expected) : err.expected;
- return diff['diff' + type](actual, expected).map(function(str){
- if (str.added) return colorLines('diff added', str.value);
- if (str.removed) return colorLines('diff removed', str.value);
- return str.value;
- }).join('');
-}
-
-/**
- * Returns a string with all invisible characters in plain text
- *
- * @param {String} line
- * @return {String}
- * @api private
- */
-function escapeInvisibles(line) {
- return line.replace(/\t/g, '<tab>')
- .replace(/\r/g, '<CR>')
- .replace(/\n/g, '<LF>\n');
-}
-
-/**
- * Color lines for `str`, using the color `name`.
- *
- * @param {String} name
- * @param {String} str
- * @return {String}
- * @api private
- */
-
-function colorLines(name, str) {
- return str.split('\n').map(function(str){
- return color(name, str);
- }).join('\n');
-}
-
-/**
- * Check that a / b have the same type.
- *
- * @param {Object} a
- * @param {Object} b
- * @return {Boolean}
- * @api private
- */
-
-function sameType(a, b) {
- a = Object.prototype.toString.call(a);
- b = Object.prototype.toString.call(b);
- return a == b;
-}
-
-}); // module: reporters/base.js
-
-require.register("reporters/doc.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base')
- , utils = require('../utils');
-
-/**
- * Expose `Doc`.
- */
-
-exports = module.exports = Doc;
-
-/**
- * Initialize a new `Doc` reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function Doc(runner) {
- Base.call(this, runner);
-
- var self = this
- , stats = this.stats
- , total = runner.total
- , indents = 2;
-
- function indent() {
- return Array(indents).join(' ');
- }
-
- runner.on('suite', function(suite){
- if (suite.root) return;
- ++indents;
- console.log('%s<section class="suite">', indent());
- ++indents;
- console.log('%s<h1>%s</h1>', indent(), utils.escape(suite.title));
- console.log('%s<dl>', indent());
- });
-
- runner.on('suite end', function(suite){
- if (suite.root) return;
- console.log('%s</dl>', indent());
- --indents;
- console.log('%s</section>', indent());
- --indents;
- });
-
- runner.on('pass', function(test){
- console.log('%s <dt>%s</dt>', indent(), utils.escape(test.title));
- var code = utils.escape(utils.clean(test.fn.toString()));
- console.log('%s <dd><pre><code>%s</code></pre></dd>', indent(), code);
- });
-
- runner.on('fail', function(test, err){
- console.log('%s <dt class="error">%s</dt>', indent(), utils.escape(test.title));
- var code = utils.escape(utils.clean(test.fn.toString()));
- console.log('%s <dd class="error"><pre><code>%s</code></pre></dd>', indent(), code);
- console.log('%s <dd class="error">%s</dd>', indent(), utils.escape(err));
- });
-}
-
-}); // module: reporters/doc.js
-
-require.register("reporters/dot.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base')
- , color = Base.color;
-
-/**
- * Expose `Dot`.
- */
-
-exports = module.exports = Dot;
-
-/**
- * Initialize a new `Dot` matrix test reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function Dot(runner) {
- Base.call(this, runner);
-
- var self = this
- , stats = this.stats
- , width = Base.window.width * .75 | 0
- , n = -1;
-
- runner.on('start', function(){
- process.stdout.write('\n');
- });
-
- runner.on('pending', function(test){
- if (++n % width == 0) process.stdout.write('\n ');
- process.stdout.write(color('pending', Base.symbols.dot));
- });
-
- runner.on('pass', function(test){
- if (++n % width == 0) process.stdout.write('\n ');
- if ('slow' == test.speed) {
- process.stdout.write(color('bright yellow', Base.symbols.dot));
- } else {
- process.stdout.write(color(test.speed, Base.symbols.dot));
- }
- });
-
- runner.on('fail', function(test, err){
- if (++n % width == 0) process.stdout.write('\n ');
- process.stdout.write(color('fail', Base.symbols.dot));
- });
-
- runner.on('end', function(){
- console.log();
- self.epilogue();
- });
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-
-function F(){}
-F.prototype = Base.prototype;
-Dot.prototype = new F;
-Dot.prototype.constructor = Dot;
-
-
-}); // module: reporters/dot.js
-
-require.register("reporters/html-cov.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var JSONCov = require('./json-cov')
- , fs = require('browser/fs');
-
-/**
- * Expose `HTMLCov`.
- */
-
-exports = module.exports = HTMLCov;
-
-/**
- * Initialize a new `JsCoverage` reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function HTMLCov(runner) {
- var jade = require('jade')
- , file = __dirname + '/templates/coverage.jade'
- , str = fs.readFileSync(file, 'utf8')
- , fn = jade.compile(str, { filename: file })
- , self = this;
-
- JSONCov.call(this, runner, false);
-
- runner.on('end', function(){
- process.stdout.write(fn({
- cov: self.cov
- , coverageClass: coverageClass
- }));
- });
-}
-
-/**
- * Return coverage class for `n`.
- *
- * @return {String}
- * @api private
- */
-
-function coverageClass(n) {
- if (n >= 75) return 'high';
- if (n >= 50) return 'medium';
- if (n >= 25) return 'low';
- return 'terrible';
-}
-
-}); // module: reporters/html-cov.js
-
-require.register("reporters/html.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base')
- , utils = require('../utils')
- , Progress = require('../browser/progress')
- , escape = utils.escape;
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-var Date = global.Date
- , setTimeout = global.setTimeout
- , setInterval = global.setInterval
- , clearTimeout = global.clearTimeout
- , clearInterval = global.clearInterval;
-
-/**
- * Expose `HTML`.
- */
-
-exports = module.exports = HTML;
-
-/**
- * Stats template.
- */
-
-var statsTemplate = '<ul id="mocha-stats">'
- + '<li class="progress"><canvas width="40" height="40"></canvas></li>'
- + '<li class="passes"><a href="#">passes:</a> <em>0</em></li>'
- + '<li class="failures"><a href="#">failures:</a> <em>0</em></li>'
- + '<li class="duration">duration: <em>0</em>s</li>'
- + '</ul>';
-
-/**
- * Initialize a new `HTML` reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function HTML(runner) {
- Base.call(this, runner);
-
- var self = this
- , stats = this.stats
- , total = runner.total
- , stat = fragment(statsTemplate)
- , items = stat.getElementsByTagName('li')
- , passes = items[1].getElementsByTagName('em')[0]
- , passesLink = items[1].getElementsByTagName('a')[0]
- , failures = items[2].getElementsByTagName('em')[0]
- , failuresLink = items[2].getElementsByTagName('a')[0]
- , duration = items[3].getElementsByTagName('em')[0]
- , canvas = stat.getElementsByTagName('canvas')[0]
- , report = fragment('<ul id="mocha-report"></ul>')
- , stack = [report]
- , progress
- , ctx
- , root = document.getElementById('mocha');
-
- if (canvas.getContext) {
- var ratio = window.devicePixelRatio || 1;
- canvas.style.width = canvas.width;
- canvas.style.height = canvas.height;
- canvas.width *= ratio;
- canvas.height *= ratio;
- ctx = canvas.getContext('2d');
- ctx.scale(ratio, ratio);
- progress = new Progress;
- }
-
- if (!root) return error('#mocha div missing, add it to your document');
-
- // pass toggle
- on(passesLink, 'click', function(){
- unhide();
- var name = /pass/.test(report.className) ? '' : ' pass';
- report.className = report.className.replace(/fail|pass/g, '') + name;
- if (report.className.trim()) hideSuitesWithout('test pass');
- });
-
- // failure toggle
- on(failuresLink, 'click', function(){
- unhide();
- var name = /fail/.test(report.className) ? '' : ' fail';
- report.className = report.className.replace(/fail|pass/g, '') + name;
- if (report.className.trim()) hideSuitesWithout('test fail');
- });
-
- root.appendChild(stat);
- root.appendChild(report);
-
- if (progress) progress.size(40);
-
- runner.on('suite', function(suite){
- if (suite.root) return;
-
- // suite
- var url = self.suiteURL(suite);
- var el = fragment('<li class="suite"><h1><a href="%s">%s</a></h1></li>', url, escape(suite.title));
-
- // container
- stack[0].appendChild(el);
- stack.unshift(document.createElement('ul'));
- el.appendChild(stack[0]);
- });
-
- runner.on('suite end', function(suite){
- if (suite.root) return;
- stack.shift();
- });
-
- runner.on('fail', function(test, err){
- if ('hook' == test.type) runner.emit('test end', test);
- });
-
- runner.on('test end', function(test){
- // TODO: add to stats
- var percent = stats.tests / this.total * 100 | 0;
- if (progress) progress.update(percent).draw(ctx);
-
- // update stats
- var ms = new Date - stats.start;
- text(passes, stats.passes);
- text(failures, stats.failures);
- text(duration, (ms / 1000).toFixed(2));
-
- // test
- if ('passed' == test.state) {
- var url = self.testURL(test);
- var el = fragment('<li class="test pass %e"><h2>%e<span class="duration">%ems</span> <a href="%s" class="replay">‣</a></h2></li>', test.speed, test.title, test.duration, url);
- } else if (test.pending) {
- el = fragment('<li class="test pass pending"><h2>%e</h2></li>', test.title);
- } else {
- el = fragment('<li class="test fail"><h2>%e <a href="%e" class="replay">‣</a></h2></li>', test.title, self.testURL(test));
- var str = test.err.stack || test.err.toString();
-
- // FF / Opera do not add the message
- if (!~str.indexOf(test.err.message)) {
- str = test.err.message + '\n' + str;
- }
-
- // <=IE7 stringifies to [Object Error]. Since it can be overloaded, we
- // check for the result of the stringifying.
- if ('[object Error]' == str) str = test.err.message;
-
- // Safari doesn't give you a stack. Let's at least provide a source line.
- if (!test.err.stack && test.err.sourceURL && test.err.line !== undefined) {
- str += "\n(" + test.err.sourceURL + ":" + test.err.line + ")";
- }
-
- el.appendChild(fragment('<pre class="error">%e</pre>', str));
- }
-
- // toggle code
- // TODO: defer
- if (!test.pending) {
- var h2 = el.getElementsByTagName('h2')[0];
-
- on(h2, 'click', function(){
- pre.style.display = 'none' == pre.style.display
- ? 'block'
- : 'none';
- });
-
- var pre = fragment('<pre><code>%e</code></pre>', utils.clean(test.fn.toString()));
- el.appendChild(pre);
- pre.style.display = 'none';
- }
-
- // Don't call .appendChild if #mocha-report was already .shift()'ed off the stack.
- if (stack[0]) stack[0].appendChild(el);
- });
-}
-
-/**
- * Makes a URL, preserving querystring ("search") parameters.
- * @param {string} s
- * @returns {string} your new URL
- */
-var makeUrl = function makeUrl(s) {
- var search = window.location.search;
-
- // Remove previous grep query parameter if present
- if (search) {
- search = search.replace(/[?&]grep=[^&\s]*/g, '').replace(/^&/, '?');
- }
-
- return window.location.pathname + (search ? search + '&' : '?' ) + 'grep=' + encodeURIComponent(s);
-};
-
-/**
- * Provide suite URL
- *
- * @param {Object} [suite]
- */
-HTML.prototype.suiteURL = function(suite){
- return makeUrl(suite.fullTitle());
-};
-
-/**
- * Provide test URL
- *
- * @param {Object} [test]
- */
-
-HTML.prototype.testURL = function(test){
- return makeUrl(test.fullTitle());
-};
-
-/**
- * Display error `msg`.
- */
-
-function error(msg) {
- document.body.appendChild(fragment('<div id="mocha-error">%s</div>', msg));
-}
-
-/**
- * Return a DOM fragment from `html`.
- */
-
-function fragment(html) {
- var args = arguments
- , div = document.createElement('div')
- , i = 1;
-
- div.innerHTML = html.replace(/%([se])/g, function(_, type){
- switch (type) {
- case 's': return String(args[i++]);
- case 'e': return escape(args[i++]);
- }
- });
-
- return div.firstChild;
-}
-
-/**
- * Check for suites that do not have elements
- * with `classname`, and hide them.
- */
-
-function hideSuitesWithout(classname) {
- var suites = document.getElementsByClassName('suite');
- for (var i = 0; i < suites.length; i++) {
- var els = suites[i].getElementsByClassName(classname);
- if (0 == els.length) suites[i].className += ' hidden';
- }
-}
-
-/**
- * Unhide .hidden suites.
- */
-
-function unhide() {
- var els = document.getElementsByClassName('suite hidden');
- for (var i = 0; i < els.length; ++i) {
- els[i].className = els[i].className.replace('suite hidden', 'suite');
- }
-}
-
-/**
- * Set `el` text to `str`.
- */
-
-function text(el, str) {
- if (el.textContent) {
- el.textContent = str;
- } else {
- el.innerText = str;
- }
-}
-
-/**
- * Listen on `event` with callback `fn`.
- */
-
-function on(el, event, fn) {
- if (el.addEventListener) {
- el.addEventListener(event, fn, false);
- } else {
- el.attachEvent('on' + event, fn);
- }
-}
-
-}); // module: reporters/html.js
-
-require.register("reporters/index.js", function(module, exports, require){
-exports.Base = require('./base');
-exports.Dot = require('./dot');
-exports.Doc = require('./doc');
-exports.TAP = require('./tap');
-exports.JSON = require('./json');
-exports.HTML = require('./html');
-exports.List = require('./list');
-exports.Min = require('./min');
-exports.Spec = require('./spec');
-exports.Nyan = require('./nyan');
-exports.XUnit = require('./xunit');
-exports.Markdown = require('./markdown');
-exports.Progress = require('./progress');
-exports.Landing = require('./landing');
-exports.JSONCov = require('./json-cov');
-exports.HTMLCov = require('./html-cov');
-exports.JSONStream = require('./json-stream');
-
-}); // module: reporters/index.js
-
-require.register("reporters/json-cov.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-
-/**
- * Expose `JSONCov`.
- */
-
-exports = module.exports = JSONCov;
-
-/**
- * Initialize a new `JsCoverage` reporter.
- *
- * @param {Runner} runner
- * @param {Boolean} output
- * @api public
- */
-
-function JSONCov(runner, output) {
- var self = this;
- output = 1 == arguments.length ? true : output;
-
- Base.call(this, runner);
-
- var tests = []
- , failures = []
- , passes = [];
-
- runner.on('test end', function(test){
- tests.push(test);
- });
-
- runner.on('pass', function(test){
- passes.push(test);
- });
-
- runner.on('fail', function(test){
- failures.push(test);
- });
-
- runner.on('end', function(){
- var cov = global._$jscoverage || {};
- var result = self.cov = map(cov);
- result.stats = self.stats;
- result.tests = tests.map(clean);
- result.failures = failures.map(clean);
- result.passes = passes.map(clean);
- if (!output) return;
- process.stdout.write(JSON.stringify(result, null, 2 ));
- });
-}
-
-/**
- * Map jscoverage data to a JSON structure
- * suitable for reporting.
- *
- * @param {Object} cov
- * @return {Object}
- * @api private
- */
-
-function map(cov) {
- var ret = {
- instrumentation: 'node-jscoverage'
- , sloc: 0
- , hits: 0
- , misses: 0
- , coverage: 0
- , files: []
- };
-
- for (var filename in cov) {
- var data = coverage(filename, cov[filename]);
- ret.files.push(data);
- ret.hits += data.hits;
- ret.misses += data.misses;
- ret.sloc += data.sloc;
- }
-
- ret.files.sort(function(a, b) {
- return a.filename.localeCompare(b.filename);
- });
-
- if (ret.sloc > 0) {
- ret.coverage = (ret.hits / ret.sloc) * 100;
- }
-
- return ret;
-}
-
-/**
- * Map jscoverage data for a single source file
- * to a JSON structure suitable for reporting.
- *
- * @param {String} filename name of the source file
- * @param {Object} data jscoverage coverage data
- * @return {Object}
- * @api private
- */
-
-function coverage(filename, data) {
- var ret = {
- filename: filename,
- coverage: 0,
- hits: 0,
- misses: 0,
- sloc: 0,
- source: {}
- };
-
- data.source.forEach(function(line, num){
- num++;
-
- if (data[num] === 0) {
- ret.misses++;
- ret.sloc++;
- } else if (data[num] !== undefined) {
- ret.hits++;
- ret.sloc++;
- }
-
- ret.source[num] = {
- source: line
- , coverage: data[num] === undefined
- ? ''
- : data[num]
- };
- });
-
- ret.coverage = ret.hits / ret.sloc * 100;
-
- return ret;
-}
-
-/**
- * Return a plain-object representation of `test`
- * free of cyclic properties etc.
- *
- * @param {Object} test
- * @return {Object}
- * @api private
- */
-
-function clean(test) {
- return {
- title: test.title
- , fullTitle: test.fullTitle()
- , duration: test.duration
- }
-}
-
-}); // module: reporters/json-cov.js
-
-require.register("reporters/json-stream.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base')
- , color = Base.color;
-
-/**
- * Expose `List`.
- */
-
-exports = module.exports = List;
-
-/**
- * Initialize a new `List` test reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function List(runner) {
- Base.call(this, runner);
-
- var self = this
- , stats = this.stats
- , total = runner.total;
-
- runner.on('start', function(){
- console.log(JSON.stringify(['start', { total: total }]));
- });
-
- runner.on('pass', function(test){
- console.log(JSON.stringify(['pass', clean(test)]));
- });
-
- runner.on('fail', function(test, err){
- test = clean(test);
- test.err = err.message;
- console.log(JSON.stringify(['fail', test]));
- });
-
- runner.on('end', function(){
- process.stdout.write(JSON.stringify(['end', self.stats]));
- });
-}
-
-/**
- * Return a plain-object representation of `test`
- * free of cyclic properties etc.
- *
- * @param {Object} test
- * @return {Object}
- * @api private
- */
-
-function clean(test) {
- return {
- title: test.title
- , fullTitle: test.fullTitle()
- , duration: test.duration
- }
-}
-
-}); // module: reporters/json-stream.js
-
-require.register("reporters/json.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base')
- , cursor = Base.cursor
- , color = Base.color;
-
-/**
- * Expose `JSON`.
- */
-
-exports = module.exports = JSONReporter;
-
-/**
- * Initialize a new `JSON` reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function JSONReporter(runner) {
- var self = this;
- Base.call(this, runner);
-
- var tests = []
- , pending = []
- , failures = []
- , passes = [];
-
- runner.on('test end', function(test){
- tests.push(test);
- });
-
- runner.on('pass', function(test){
- passes.push(test);
- });
-
- runner.on('fail', function(test){
- failures.push(test);
- });
-
- runner.on('pending', function(test){
- pending.push(test);
- });
-
- runner.on('end', function(){
- var obj = {
- stats: self.stats,
- tests: tests.map(clean),
- pending: pending.map(clean),
- failures: failures.map(clean),
- passes: passes.map(clean)
- };
-
- runner.testResults = obj;
-
- process.stdout.write(JSON.stringify(obj, null, 2));
- });
-}
-
-/**
- * Return a plain-object representation of `test`
- * free of cyclic properties etc.
- *
- * @param {Object} test
- * @return {Object}
- * @api private
- */
-
-function clean(test) {
- return {
- title: test.title,
- fullTitle: test.fullTitle(),
- duration: test.duration,
- err: errorJSON(test.err || {})
- }
-}
-
-/**
- * Transform `error` into a JSON object.
- * @param {Error} err
- * @return {Object}
- */
-
-function errorJSON(err) {
- var res = {};
- Object.getOwnPropertyNames(err).forEach(function(key) {
- res[key] = err[key];
- }, err);
- return res;
-}
-
-}); // module: reporters/json.js
-
-require.register("reporters/landing.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base')
- , cursor = Base.cursor
- , color = Base.color;
-
-/**
- * Expose `Landing`.
- */
-
-exports = module.exports = Landing;
-
-/**
- * Airplane color.
- */
-
-Base.colors.plane = 0;
-
-/**
- * Airplane crash color.
- */
-
-Base.colors['plane crash'] = 31;
-
-/**
- * Runway color.
- */
-
-Base.colors.runway = 90;
-
-/**
- * Initialize a new `Landing` reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function Landing(runner) {
- Base.call(this, runner);
-
- var self = this
- , stats = this.stats
- , width = Base.window.width * .75 | 0
- , total = runner.total
- , stream = process.stdout
- , plane = color('plane', '✈')
- , crashed = -1
- , n = 0;
-
- function runway() {
- var buf = Array(width).join('-');
- return ' ' + color('runway', buf);
- }
-
- runner.on('start', function(){
- stream.write('\n\n\n ');
- cursor.hide();
- });
-
- runner.on('test end', function(test){
- // check if the plane crashed
- var col = -1 == crashed
- ? width * ++n / total | 0
- : crashed;
-
- // show the crash
- if ('failed' == test.state) {
- plane = color('plane crash', '✈');
- crashed = col;
- }
-
- // render landing strip
- stream.write('\u001b['+(width+1)+'D\u001b[2A');
- stream.write(runway());
- stream.write('\n ');
- stream.write(color('runway', Array(col).join('â‹…')));
- stream.write(plane)
- stream.write(color('runway', Array(width - col).join('â‹…') + '\n'));
- stream.write(runway());
- stream.write('\u001b[0m');
- });
-
- runner.on('end', function(){
- cursor.show();
- console.log();
- self.epilogue();
- });
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-
-function F(){}
-F.prototype = Base.prototype;
-Landing.prototype = new F;
-Landing.prototype.constructor = Landing;
-
-
-}); // module: reporters/landing.js
-
-require.register("reporters/list.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base')
- , cursor = Base.cursor
- , color = Base.color;
-
-/**
- * Expose `List`.
- */
-
-exports = module.exports = List;
-
-/**
- * Initialize a new `List` test reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function List(runner) {
- Base.call(this, runner);
-
- var self = this
- , stats = this.stats
- , n = 0;
-
- runner.on('start', function(){
- console.log();
- });
-
- runner.on('test', function(test){
- process.stdout.write(color('pass', ' ' + test.fullTitle() + ': '));
- });
-
- runner.on('pending', function(test){
- var fmt = color('checkmark', ' -')
- + color('pending', ' %s');
- console.log(fmt, test.fullTitle());
- });
-
- runner.on('pass', function(test){
- var fmt = color('checkmark', ' '+Base.symbols.dot)
- + color('pass', ' %s: ')
- + color(test.speed, '%dms');
- cursor.CR();
- console.log(fmt, test.fullTitle(), test.duration);
- });
-
- runner.on('fail', function(test, err){
- cursor.CR();
- console.log(color('fail', ' %d) %s'), ++n, test.fullTitle());
- });
-
- runner.on('end', self.epilogue.bind(self));
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-
-function F(){}
-F.prototype = Base.prototype;
-List.prototype = new F;
-List.prototype.constructor = List;
-
-
-}); // module: reporters/list.js
-
-require.register("reporters/markdown.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base')
- , utils = require('../utils');
-
-/**
- * Constants
- */
-
-var SUITE_PREFIX = '$';
-
-/**
- * Expose `Markdown`.
- */
-
-exports = module.exports = Markdown;
-
-/**
- * Initialize a new `Markdown` reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function Markdown(runner) {
- Base.call(this, runner);
-
- var self = this
- , stats = this.stats
- , level = 0
- , buf = '';
-
- function title(str) {
- return Array(level).join('#') + ' ' + str;
- }
-
- function indent() {
- return Array(level).join(' ');
- }
-
- function mapTOC(suite, obj) {
- var ret = obj,
- key = SUITE_PREFIX + suite.title;
- obj = obj[key] = obj[key] || { suite: suite };
- suite.suites.forEach(function(suite){
- mapTOC(suite, obj);
- });
- return ret;
- }
-
- function stringifyTOC(obj, level) {
- ++level;
- var buf = '';
- var link;
- for (var key in obj) {
- if ('suite' == key) continue;
- if (key !== SUITE_PREFIX) {
- link = ' - [' + key.substring(1) + ']';
- link += '(#' + utils.slug(obj[key].suite.fullTitle()) + ')\n';
- buf += Array(level).join(' ') + link;
- }
- buf += stringifyTOC(obj[key], level);
- }
- return buf;
- }
-
- function generateTOC(suite) {
- var obj = mapTOC(suite, {});
- return stringifyTOC(obj, 0);
- }
-
- generateTOC(runner.suite);
-
- runner.on('suite', function(suite){
- ++level;
- var slug = utils.slug(suite.fullTitle());
- buf += '<a name="' + slug + '"></a>' + '\n';
- buf += title(suite.title) + '\n';
- });
-
- runner.on('suite end', function(suite){
- --level;
- });
-
- runner.on('pass', function(test){
- var code = utils.clean(test.fn.toString());
- buf += test.title + '.\n';
- buf += '\n```js\n';
- buf += code + '\n';
- buf += '```\n\n';
- });
-
- runner.on('end', function(){
- process.stdout.write('# TOC\n');
- process.stdout.write(generateTOC(runner.suite));
- process.stdout.write(buf);
- });
-}
-
-}); // module: reporters/markdown.js
-
-require.register("reporters/min.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-
-/**
- * Expose `Min`.
- */
-
-exports = module.exports = Min;
-
-/**
- * Initialize a new `Min` minimal test reporter (best used with --watch).
- *
- * @param {Runner} runner
- * @api public
- */
-
-function Min(runner) {
- Base.call(this, runner);
-
- runner.on('start', function(){
- // clear screen
- process.stdout.write('\u001b[2J');
- // set cursor position
- process.stdout.write('\u001b[1;3H');
- });
-
- runner.on('end', this.epilogue.bind(this));
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-
-function F(){}
-F.prototype = Base.prototype;
-Min.prototype = new F;
-Min.prototype.constructor = Min;
-
-
-}); // module: reporters/min.js
-
-require.register("reporters/nyan.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base');
-
-/**
- * Expose `Dot`.
- */
-
-exports = module.exports = NyanCat;
-
-/**
- * Initialize a new `Dot` matrix test reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function NyanCat(runner) {
- Base.call(this, runner);
- var self = this
- , stats = this.stats
- , width = Base.window.width * .75 | 0
- , rainbowColors = this.rainbowColors = self.generateColors()
- , colorIndex = this.colorIndex = 0
- , numerOfLines = this.numberOfLines = 4
- , trajectories = this.trajectories = [[], [], [], []]
- , nyanCatWidth = this.nyanCatWidth = 11
- , trajectoryWidthMax = this.trajectoryWidthMax = (width - nyanCatWidth)
- , scoreboardWidth = this.scoreboardWidth = 5
- , tick = this.tick = 0
- , n = 0;
-
- runner.on('start', function(){
- Base.cursor.hide();
- self.draw();
- });
-
- runner.on('pending', function(test){
- self.draw();
- });
-
- runner.on('pass', function(test){
- self.draw();
- });
-
- runner.on('fail', function(test, err){
- self.draw();
- });
-
- runner.on('end', function(){
- Base.cursor.show();
- for (var i = 0; i < self.numberOfLines; i++) write('\n');
- self.epilogue();
- });
-}
-
-/**
- * Draw the nyan cat
- *
- * @api private
- */
-
-NyanCat.prototype.draw = function(){
- this.appendRainbow();
- this.drawScoreboard();
- this.drawRainbow();
- this.drawNyanCat();
- this.tick = !this.tick;
-};
-
-/**
- * Draw the "scoreboard" showing the number
- * of passes, failures and pending tests.
- *
- * @api private
- */
-
-NyanCat.prototype.drawScoreboard = function(){
- var stats = this.stats;
-
- function draw(type, n) {
- write(' ');
- write(Base.color(type, n));
- write('\n');
- }
-
- draw('green', stats.passes);
- draw('fail', stats.failures);
- draw('pending', stats.pending);
- write('\n');
-
- this.cursorUp(this.numberOfLines);
-};
-
-/**
- * Append the rainbow.
- *
- * @api private
- */
-
-NyanCat.prototype.appendRainbow = function(){
- var segment = this.tick ? '_' : '-';
- var rainbowified = this.rainbowify(segment);
-
- for (var index = 0; index < this.numberOfLines; index++) {
- var trajectory = this.trajectories[index];
- if (trajectory.length >= this.trajectoryWidthMax) trajectory.shift();
- trajectory.push(rainbowified);
- }
-};
-
-/**
- * Draw the rainbow.
- *
- * @api private
- */
-
-NyanCat.prototype.drawRainbow = function(){
- var self = this;
-
- this.trajectories.forEach(function(line, index) {
- write('\u001b[' + self.scoreboardWidth + 'C');
- write(line.join(''));
- write('\n');
- });
-
- this.cursorUp(this.numberOfLines);
-};
-
-/**
- * Draw the nyan cat
- *
- * @api private
- */
-
-NyanCat.prototype.drawNyanCat = function() {
- var self = this;
- var startWidth = this.scoreboardWidth + this.trajectories[0].length;
- var dist = '\u001b[' + startWidth + 'C';
- var padding = '';
-
- write(dist);
- write('_,------,');
- write('\n');
-
- write(dist);
- padding = self.tick ? ' ' : ' ';
- write('_|' + padding + '/\\_/\\ ');
- write('\n');
-
- write(dist);
- padding = self.tick ? '_' : '__';
- var tail = self.tick ? '~' : '^';
- var face;
- write(tail + '|' + padding + this.face() + ' ');
- write('\n');
-
- write(dist);
- padding = self.tick ? ' ' : ' ';
- write(padding + '"" "" ');
- write('\n');
-
- this.cursorUp(this.numberOfLines);
-};
-
-/**
- * Draw nyan cat face.
- *
- * @return {String}
- * @api private
- */
-
-NyanCat.prototype.face = function() {
- var stats = this.stats;
- if (stats.failures) {
- return '( x .x)';
- } else if (stats.pending) {
- return '( o .o)';
- } else if(stats.passes) {
- return '( ^ .^)';
- } else {
- return '( - .-)';
- }
-};
-
-/**
- * Move cursor up `n`.
- *
- * @param {Number} n
- * @api private
- */
-
-NyanCat.prototype.cursorUp = function(n) {
- write('\u001b[' + n + 'A');
-};
-
-/**
- * Move cursor down `n`.
- *
- * @param {Number} n
- * @api private
- */
-
-NyanCat.prototype.cursorDown = function(n) {
- write('\u001b[' + n + 'B');
-};
-
-/**
- * Generate rainbow colors.
- *
- * @return {Array}
- * @api private
- */
-
-NyanCat.prototype.generateColors = function(){
- var colors = [];
-
- for (var i = 0; i < (6 * 7); i++) {
- var pi3 = Math.floor(Math.PI / 3);
- var n = (i * (1.0 / 6));
- var r = Math.floor(3 * Math.sin(n) + 3);
- var g = Math.floor(3 * Math.sin(n + 2 * pi3) + 3);
- var b = Math.floor(3 * Math.sin(n + 4 * pi3) + 3);
- colors.push(36 * r + 6 * g + b + 16);
- }
-
- return colors;
-};
-
-/**
- * Apply rainbow to the given `str`.
- *
- * @param {String} str
- * @return {String}
- * @api private
- */
-
-NyanCat.prototype.rainbowify = function(str){
- if (!Base.useColors)
- return str;
- var color = this.rainbowColors[this.colorIndex % this.rainbowColors.length];
- this.colorIndex += 1;
- return '\u001b[38;5;' + color + 'm' + str + '\u001b[0m';
-};
-
-/**
- * Stdout helper.
- */
-
-function write(string) {
- process.stdout.write(string);
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-
-function F(){}
-F.prototype = Base.prototype;
-NyanCat.prototype = new F;
-NyanCat.prototype.constructor = NyanCat;
-
-
-}); // module: reporters/nyan.js
-
-require.register("reporters/progress.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base')
- , cursor = Base.cursor
- , color = Base.color;
-
-/**
- * Expose `Progress`.
- */
-
-exports = module.exports = Progress;
-
-/**
- * General progress bar color.
- */
-
-Base.colors.progress = 90;
-
-/**
- * Initialize a new `Progress` bar test reporter.
- *
- * @param {Runner} runner
- * @param {Object} options
- * @api public
- */
-
-function Progress(runner, options) {
- Base.call(this, runner);
-
- options = options || {}
- var self = this
- , stats = this.stats
- , width = Base.window.width * .50 | 0
- , total = runner.total
- , complete = 0
- , max = Math.max
- , lastN = -1;
-
- // default chars
- options.open = options.open || '[';
- options.complete = options.complete || 'â–¬';
- options.incomplete = options.incomplete || Base.symbols.dot;
- options.close = options.close || ']';
- options.verbose = false;
-
- // tests started
- runner.on('start', function(){
- console.log();
- cursor.hide();
- });
-
- // tests complete
- runner.on('test end', function(){
- complete++;
- var incomplete = total - complete
- , percent = complete / total
- , n = width * percent | 0
- , i = width - n;
-
- if (lastN === n && !options.verbose) {
- // Don't re-render the line if it hasn't changed
- return;
- }
- lastN = n;
-
- cursor.CR();
- process.stdout.write('\u001b[J');
- process.stdout.write(color('progress', ' ' + options.open));
- process.stdout.write(Array(n).join(options.complete));
- process.stdout.write(Array(i).join(options.incomplete));
- process.stdout.write(color('progress', options.close));
- if (options.verbose) {
- process.stdout.write(color('progress', ' ' + complete + ' of ' + total));
- }
- });
-
- // tests are complete, output some stats
- // and the failures if any
- runner.on('end', function(){
- cursor.show();
- console.log();
- self.epilogue();
- });
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-
-function F(){}
-F.prototype = Base.prototype;
-Progress.prototype = new F;
-Progress.prototype.constructor = Progress;
-
-
-}); // module: reporters/progress.js
-
-require.register("reporters/spec.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base')
- , cursor = Base.cursor
- , color = Base.color;
-
-/**
- * Expose `Spec`.
- */
-
-exports = module.exports = Spec;
-
-/**
- * Initialize a new `Spec` test reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function Spec(runner) {
- Base.call(this, runner);
-
- var self = this
- , stats = this.stats
- , indents = 0
- , n = 0;
-
- function indent() {
- return Array(indents).join(' ')
- }
-
- runner.on('start', function(){
- console.log();
- });
-
- runner.on('suite', function(suite){
- ++indents;
- console.log(color('suite', '%s%s'), indent(), suite.title);
- });
-
- runner.on('suite end', function(suite){
- --indents;
- if (1 == indents) console.log();
- });
-
- runner.on('pending', function(test){
- var fmt = indent() + color('pending', ' - %s');
- console.log(fmt, test.title);
- });
-
- runner.on('pass', function(test){
- if ('fast' == test.speed) {
- var fmt = indent()
- + color('checkmark', ' ' + Base.symbols.ok)
- + color('pass', ' %s');
- cursor.CR();
- console.log(fmt, test.title);
- } else {
- fmt = indent()
- + color('checkmark', ' ' + Base.symbols.ok)
- + color('pass', ' %s')
- + color(test.speed, ' (%dms)');
- cursor.CR();
- console.log(fmt, test.title, test.duration);
- }
- });
-
- runner.on('fail', function(test, err){
- cursor.CR();
- console.log(indent() + color('fail', ' %d) %s'), ++n, test.title);
- });
-
- runner.on('end', self.epilogue.bind(self));
-}
-
-/**
- * Inherit from `Base.prototype`.
- */
-
-function F(){}
-F.prototype = Base.prototype;
-Spec.prototype = new F;
-Spec.prototype.constructor = Spec;
-
-
-}); // module: reporters/spec.js
-
-require.register("reporters/tap.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base')
- , cursor = Base.cursor
- , color = Base.color;
-
-/**
- * Expose `TAP`.
- */
-
-exports = module.exports = TAP;
-
-/**
- * Initialize a new `TAP` reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function TAP(runner) {
- Base.call(this, runner);
-
- var self = this
- , stats = this.stats
- , n = 1
- , passes = 0
- , failures = 0;
-
- runner.on('start', function(){
- var total = runner.grepTotal(runner.suite);
- console.log('%d..%d', 1, total);
- });
-
- runner.on('test end', function(){
- ++n;
- });
-
- runner.on('pending', function(test){
- console.log('ok %d %s # SKIP -', n, title(test));
- });
-
- runner.on('pass', function(test){
- passes++;
- console.log('ok %d %s', n, title(test));
- });
-
- runner.on('fail', function(test, err){
- failures++;
- console.log('not ok %d %s', n, title(test));
- if (err.stack) console.log(err.stack.replace(/^/gm, ' '));
- });
-
- runner.on('end', function(){
- console.log('# tests ' + (passes + failures));
- console.log('# pass ' + passes);
- console.log('# fail ' + failures);
- });
-}
-
-/**
- * Return a TAP-safe title of `test`
- *
- * @param {Object} test
- * @return {String}
- * @api private
- */
-
-function title(test) {
- return test.fullTitle().replace(/#/g, '');
-}
-
-}); // module: reporters/tap.js
-
-require.register("reporters/xunit.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Base = require('./base')
- , utils = require('../utils')
- , fs = require('browser/fs')
- , escape = utils.escape;
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-var Date = global.Date
- , setTimeout = global.setTimeout
- , setInterval = global.setInterval
- , clearTimeout = global.clearTimeout
- , clearInterval = global.clearInterval;
-
-/**
- * Expose `XUnit`.
- */
-
-exports = module.exports = XUnit;
-
-/**
- * Initialize a new `XUnit` reporter.
- *
- * @param {Runner} runner
- * @api public
- */
-
-function XUnit(runner, options) {
- Base.call(this, runner);
- var stats = this.stats
- , tests = []
- , self = this;
-
- if (options.reporterOptions && options.reporterOptions.output) {
- if (! fs.createWriteStream) {
- throw new Error('file output not supported in browser');
- }
- self.fileStream = fs.createWriteStream(options.reporterOptions.output);
- }
-
- runner.on('pending', function(test){
- tests.push(test);
- });
-
- runner.on('pass', function(test){
- tests.push(test);
- });
-
- runner.on('fail', function(test){
- tests.push(test);
- });
-
- runner.on('end', function(){
- self.write(tag('testsuite', {
- name: 'Mocha Tests'
- , tests: stats.tests
- , failures: stats.failures
- , errors: stats.failures
- , skipped: stats.tests - stats.failures - stats.passes
- , timestamp: (new Date).toUTCString()
- , time: (stats.duration / 1000) || 0
- }, false));
-
- tests.forEach(function(t) { self.test(t); });
- self.write('</testsuite>');
- });
-}
-
-/**
- * Override done to close the stream (if it's a file).
- */
-XUnit.prototype.done = function(failures, fn) {
- if (this.fileStream) {
- this.fileStream.end(function() {
- fn(failures);
- });
- } else {
- fn(failures);
- }
-};
-
-/**
- * Inherit from `Base.prototype`.
- */
-
-function F(){}
-F.prototype = Base.prototype;
-XUnit.prototype = new F;
-XUnit.prototype.constructor = XUnit;
-
-
-/**
- * Write out the given line
- */
-XUnit.prototype.write = function(line) {
- if (this.fileStream) {
- this.fileStream.write(line + '\n');
- } else {
- console.log(line);
- }
-};
-
-/**
- * Output tag for the given `test.`
- */
-
-XUnit.prototype.test = function(test, ostream) {
- var attrs = {
- classname: test.parent.fullTitle()
- , name: test.title
- , time: (test.duration / 1000) || 0
- };
-
- if ('failed' == test.state) {
- var err = test.err;
- this.write(tag('testcase', attrs, false, tag('failure', {}, false, cdata(escape(err.message) + "\n" + err.stack))));
- } else if (test.pending) {
- this.write(tag('testcase', attrs, false, tag('skipped', {}, true)));
- } else {
- this.write(tag('testcase', attrs, true) );
- }
-};
-
-/**
- * HTML tag helper.
- */
-
-function tag(name, attrs, close, content) {
- var end = close ? '/>' : '>'
- , pairs = []
- , tag;
-
- for (var key in attrs) {
- pairs.push(key + '="' + escape(attrs[key]) + '"');
- }
-
- tag = '<' + name + (pairs.length ? ' ' + pairs.join(' ') : '') + end;
- if (content) tag += content + '</' + name + end;
- return tag;
-}
-
-/**
- * Return cdata escaped CDATA `str`.
- */
-
-function cdata(str) {
- return '<![CDATA[' + escape(str) + ']]>';
-}
-
-}); // module: reporters/xunit.js
-
-require.register("runnable.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var EventEmitter = require('browser/events').EventEmitter
- , debug = require('browser/debug')('mocha:runnable')
- , Pending = require('./pending')
- , milliseconds = require('./ms')
- , utils = require('./utils');
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-var Date = global.Date
- , setTimeout = global.setTimeout
- , setInterval = global.setInterval
- , clearTimeout = global.clearTimeout
- , clearInterval = global.clearInterval;
-
-/**
- * Object#toString().
- */
-
-var toString = Object.prototype.toString;
-
-/**
- * Expose `Runnable`.
- */
-
-module.exports = Runnable;
-
-/**
- * Initialize a new `Runnable` with the given `title` and callback `fn`.
- *
- * @param {String} title
- * @param {Function} fn
- * @api private
- */
-
-function Runnable(title, fn) {
- this.title = title;
- this.fn = fn;
- this.async = fn && fn.length;
- this.sync = ! this.async;
- this._timeout = 2000;
- this._slow = 75;
- this._enableTimeouts = true;
- this.timedOut = false;
- this._trace = new Error('done() called multiple times')
-}
-
-/**
- * Inherit from `EventEmitter.prototype`.
- */
-
-function F(){}
-F.prototype = EventEmitter.prototype;
-Runnable.prototype = new F;
-Runnable.prototype.constructor = Runnable;
-
-
-/**
- * Set & get timeout `ms`.
- *
- * @param {Number|String} ms
- * @return {Runnable|Number} ms or self
- * @api private
- */
-
-Runnable.prototype.timeout = function(ms){
- if (0 == arguments.length) return this._timeout;
- if (ms === 0) this._enableTimeouts = false;
- if ('string' == typeof ms) ms = milliseconds(ms);
- debug('timeout %d', ms);
- this._timeout = ms;
- if (this.timer) this.resetTimeout();
- return this;
-};
-
-/**
- * Set & get slow `ms`.
- *
- * @param {Number|String} ms
- * @return {Runnable|Number} ms or self
- * @api private
- */
-
-Runnable.prototype.slow = function(ms){
- if (0 === arguments.length) return this._slow;
- if ('string' == typeof ms) ms = milliseconds(ms);
- debug('timeout %d', ms);
- this._slow = ms;
- return this;
-};
-
-/**
- * Set and & get timeout `enabled`.
- *
- * @param {Boolean} enabled
- * @return {Runnable|Boolean} enabled or self
- * @api private
- */
-
-Runnable.prototype.enableTimeouts = function(enabled){
- if (arguments.length === 0) return this._enableTimeouts;
- debug('enableTimeouts %s', enabled);
- this._enableTimeouts = enabled;
- return this;
-};
-
-/**
- * Halt and mark as pending.
- *
- * @api private
- */
-
-Runnable.prototype.skip = function(){
- throw new Pending();
-};
-
-/**
- * Return the full title generated by recursively
- * concatenating the parent's full title.
- *
- * @return {String}
- * @api public
- */
-
-Runnable.prototype.fullTitle = function(){
- return this.parent.fullTitle() + ' ' + this.title;
-};
-
-/**
- * Clear the timeout.
- *
- * @api private
- */
-
-Runnable.prototype.clearTimeout = function(){
- clearTimeout(this.timer);
-};
-
-/**
- * Inspect the runnable void of private properties.
- *
- * @return {String}
- * @api private
- */
-
-Runnable.prototype.inspect = function(){
- return JSON.stringify(this, function(key, val){
- if ('_' == key[0]) return undefined;
- if ('parent' == key) return '#<Suite>';
- if ('ctx' == key) return '#<Context>';
- return val;
- }, 2);
-};
-
-/**
- * Reset the timeout.
- *
- * @api private
- */
-
-Runnable.prototype.resetTimeout = function(){
- var self = this;
- var ms = this.timeout() || 1e9;
-
- if (!this._enableTimeouts) return;
- this.clearTimeout();
- this.timer = setTimeout(function(){
- if (!self._enableTimeouts) return;
- self.callback(new Error('timeout of ' + ms + 'ms exceeded. Ensure the done() callback is being called in this test.'));
- self.timedOut = true;
- }, ms);
-};
-
-/**
- * Whitelist these globals for this test run
- *
- * @api private
- */
-Runnable.prototype.globals = function(arr){
- var self = this;
- this._allowedGlobals = arr;
-};
-
-/**
- * Run the test and invoke `fn(err)`.
- *
- * @param {Function} fn
- * @api private
- */
-
-Runnable.prototype.run = function(fn){
- var self = this
- , start = new Date
- , ctx = this.ctx
- , finished
- , emitted;
-
- // Some times the ctx exists but it is not runnable
- if (ctx && ctx.runnable) ctx.runnable(this);
-
- // called multiple times
- function multiple(err) {
- if (emitted) return;
- emitted = true;
- self.emit('error', err || new Error('done() called multiple times; stacktrace may be inaccurate'));
- }
-
- // finished
- function done(err) {
- var ms = self.timeout();
- if (self.timedOut) return undefined;
- if (finished) return multiple(err || self._trace);
-
- // Discard the resolution if this test has already failed asynchronously
- if (self.state) return undefined;
-
- self.clearTimeout();
- self.duration = new Date - start;
- finished = true;
- if (!err && self.duration > ms && self._enableTimeouts) err = new Error('timeout of ' + ms + 'ms exceeded. Ensure the done() callback is being called in this test.');
- fn(err);
- }
-
- // for .resetTimeout()
- this.callback = done;
-
- // explicit async with `done` argument
- if (this.async) {
- this.resetTimeout();
-
- try {
- this.fn.call(ctx, function(err){
- if (err instanceof Error || toString.call(err) === "[object Error]") return done(err);
- if (null != err) {
- if (Object.prototype.toString.call(err) === '[object Object]') {
- return done(new Error('done() invoked with non-Error: ' + JSON.stringify(err)));
- } else {
- return done(new Error('done() invoked with non-Error: ' + err));
- }
- }
- done();
- });
- } catch (err) {
- done(utils.getError(err));
- }
- return undefined;
- }
-
- if (this.asyncOnly) {
- return done(new Error('--async-only option in use without declaring `done()`'));
- }
-
- // sync or promise-returning
- try {
- if (this.pending) {
- done();
- } else {
- callFn(this.fn);
- }
- } catch (err) {
- done(utils.getError(err));
- }
-
- function callFn(fn) {
- var result = fn.call(ctx);
- if (result && typeof result.then === 'function') {
- self.resetTimeout();
- result
- .then(function() {
- done()
- },
- function(reason) {
- done(reason || new Error('Promise rejected with no or falsy reason'))
- });
- } else {
- done();
- }
- }
-};
-
-}); // module: runnable.js
-
-require.register("runner.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var EventEmitter = require('browser/events').EventEmitter
- , debug = require('browser/debug')('mocha:runner')
- , Pending = require('./pending')
- , Test = require('./test')
- , utils = require('./utils')
- , filter = utils.filter
- , keys = utils.keys
- , type = utils.type
- , stringify = utils.stringify
- , stackFilter = utils.stackTraceFilter();
-
-/**
- * Non-enumerable globals.
- */
-
-var globals = [
- 'setTimeout',
- 'clearTimeout',
- 'setInterval',
- 'clearInterval',
- 'XMLHttpRequest',
- 'Date',
- 'setImmediate',
- 'clearImmediate'
-];
-
-/**
- * Expose `Runner`.
- */
-
-module.exports = Runner;
-
-/**
- * Initialize a `Runner` for the given `suite`.
- *
- * Events:
- *
- * - `start` execution started
- * - `end` execution complete
- * - `suite` (suite) test suite execution started
- * - `suite end` (suite) all tests (and sub-suites) have finished
- * - `test` (test) test execution started
- * - `test end` (test) test completed
- * - `hook` (hook) hook execution started
- * - `hook end` (hook) hook complete
- * - `pass` (test) test passed
- * - `fail` (test, err) test failed
- * - `pending` (test) test pending
- *
- * @param {Suite} suite Root suite
- * @param {boolean} [delay] Whether or not to delay execution of root suite
- * until ready.
- * @api public
- */
-
-function Runner(suite, delay) {
- var self = this;
- this._globals = [];
- this._abort = false;
- this._delay = delay;
- this.suite = suite;
- this.total = suite.total();
- this.failures = 0;
- this.on('test end', function(test){ self.checkGlobals(test); });
- this.on('hook end', function(hook){ self.checkGlobals(hook); });
- this.grep(/.*/);
- this.globals(this.globalProps().concat(extraGlobals()));
-}
-
-/**
- * Wrapper for setImmediate, process.nextTick, or browser polyfill.
- *
- * @param {Function} fn
- * @api private
- */
-
-Runner.immediately = global.setImmediate || process.nextTick;
-
-/**
- * Inherit from `EventEmitter.prototype`.
- */
-
-function F(){}
-F.prototype = EventEmitter.prototype;
-Runner.prototype = new F;
-Runner.prototype.constructor = Runner;
-
-
-/**
- * Run tests with full titles matching `re`. Updates runner.total
- * with number of tests matched.
- *
- * @param {RegExp} re
- * @param {Boolean} invert
- * @return {Runner} for chaining
- * @api public
- */
-
-Runner.prototype.grep = function(re, invert){
- debug('grep %s', re);
- this._grep = re;
- this._invert = invert;
- this.total = this.grepTotal(this.suite);
- return this;
-};
-
-/**
- * Returns the number of tests matching the grep search for the
- * given suite.
- *
- * @param {Suite} suite
- * @return {Number}
- * @api public
- */
-
-Runner.prototype.grepTotal = function(suite) {
- var self = this;
- var total = 0;
-
- suite.eachTest(function(test){
- var match = self._grep.test(test.fullTitle());
- if (self._invert) match = !match;
- if (match) total++;
- });
-
- return total;
-};
-
-/**
- * Return a list of global properties.
- *
- * @return {Array}
- * @api private
- */
-
-Runner.prototype.globalProps = function() {
- var props = utils.keys(global);
-
- // non-enumerables
- for (var i = 0; i < globals.length; ++i) {
- if (~utils.indexOf(props, globals[i])) continue;
- props.push(globals[i]);
- }
-
- return props;
-};
-
-/**
- * Allow the given `arr` of globals.
- *
- * @param {Array} arr
- * @return {Runner} for chaining
- * @api public
- */
-
-Runner.prototype.globals = function(arr){
- if (0 == arguments.length) return this._globals;
- debug('globals %j', arr);
- this._globals = this._globals.concat(arr);
- return this;
-};
-
-/**
- * Check for global variable leaks.
- *
- * @api private
- */
-
-Runner.prototype.checkGlobals = function(test){
- if (this.ignoreLeaks) return;
- var ok = this._globals;
-
- var globals = this.globalProps();
- var leaks;
-
- if (test) {
- ok = ok.concat(test._allowedGlobals || []);
- }
-
- if(this.prevGlobalsLength == globals.length) return;
- this.prevGlobalsLength = globals.length;
-
- leaks = filterLeaks(ok, globals);
- this._globals = this._globals.concat(leaks);
-
- if (leaks.length > 1) {
- this.fail(test, new Error('global leaks detected: ' + leaks.join(', ') + ''));
- } else if (leaks.length) {
- this.fail(test, new Error('global leak detected: ' + leaks[0]));
- }
-};
-
-/**
- * Fail the given `test`.
- *
- * @param {Test} test
- * @param {Error} err
- * @api private
- */
-
-Runner.prototype.fail = function(test, err) {
- ++this.failures;
- test.state = 'failed';
-
- if (!(err instanceof Error)) {
- err = new Error('the ' + type(err) + ' ' + stringify(err) + ' was thrown, throw an Error :)');
- }
-
- err.stack = (this.fullStackTrace || !err.stack)
- ? err.stack
- : stackFilter(err.stack);
-
- this.emit('fail', test, err);
-};
-
-/**
- * Fail the given `hook` with `err`.
- *
- * Hook failures work in the following pattern:
- * - If bail, then exit
- * - Failed `before` hook skips all tests in a suite and subsuites,
- * but jumps to corresponding `after` hook
- * - Failed `before each` hook skips remaining tests in a
- * suite and jumps to corresponding `after each` hook,
- * which is run only once
- * - Failed `after` hook does not alter
- * execution order
- * - Failed `after each` hook skips remaining tests in a
- * suite and subsuites, but executes other `after each`
- * hooks
- *
- * @param {Hook} hook
- * @param {Error} err
- * @api private
- */
-
-Runner.prototype.failHook = function(hook, err){
- this.fail(hook, err);
- if (this.suite.bail()) {
- this.emit('end');
- }
-};
-
-/**
- * Run hook `name` callbacks and then invoke `fn()`.
- *
- * @param {String} name
- * @param {Function} function
- * @api private
- */
-
-Runner.prototype.hook = function(name, fn){
- var suite = this.suite
- , hooks = suite['_' + name]
- , self = this
- , timer;
-
- function next(i) {
- var hook = hooks[i];
- if (!hook) return fn();
- self.currentRunnable = hook;
-
- hook.ctx.currentTest = self.test;
-
- self.emit('hook', hook);
-
- hook.on('error', function(err){
- self.failHook(hook, err);
- });
-
- hook.run(function(err){
- hook.removeAllListeners('error');
- var testError = hook.error();
- if (testError) self.fail(self.test, testError);
- if (err) {
- if (err instanceof Pending) {
- suite.pending = true;
- } else {
- self.failHook(hook, err);
-
- // stop executing hooks, notify callee of hook err
- return fn(err);
- }
- }
- self.emit('hook end', hook);
- delete hook.ctx.currentTest;
- next(++i);
- });
- }
-
- Runner.immediately(function(){
- next(0);
- });
-};
-
-/**
- * Run hook `name` for the given array of `suites`
- * in order, and callback `fn(err, errSuite)`.
- *
- * @param {String} name
- * @param {Array} suites
- * @param {Function} fn
- * @api private
- */
-
-Runner.prototype.hooks = function(name, suites, fn){
- var self = this
- , orig = this.suite;
-
- function next(suite) {
- self.suite = suite;
-
- if (!suite) {
- self.suite = orig;
- return fn();
- }
-
- self.hook(name, function(err){
- if (err) {
- var errSuite = self.suite;
- self.suite = orig;
- return fn(err, errSuite);
- }
-
- next(suites.pop());
- });
- }
-
- next(suites.pop());
-};
-
-/**
- * Run hooks from the top level down.
- *
- * @param {String} name
- * @param {Function} fn
- * @api private
- */
-
-Runner.prototype.hookUp = function(name, fn){
- var suites = [this.suite].concat(this.parents()).reverse();
- this.hooks(name, suites, fn);
-};
-
-/**
- * Run hooks from the bottom up.
- *
- * @param {String} name
- * @param {Function} fn
- * @api private
- */
-
-Runner.prototype.hookDown = function(name, fn){
- var suites = [this.suite].concat(this.parents());
- this.hooks(name, suites, fn);
-};
-
-/**
- * Return an array of parent Suites from
- * closest to furthest.
- *
- * @return {Array}
- * @api private
- */
-
-Runner.prototype.parents = function(){
- var suite = this.suite
- , suites = [];
- while (suite = suite.parent) suites.push(suite);
- return suites;
-};
-
-/**
- * Run the current test and callback `fn(err)`.
- *
- * @param {Function} fn
- * @api private
- */
-
-Runner.prototype.runTest = function(fn){
- var test = this.test
- , self = this;
-
- if (this.asyncOnly) test.asyncOnly = true;
-
- try {
- test.on('error', function(err){
- self.fail(test, err);
- });
- test.run(fn);
- } catch (err) {
- fn(err);
- }
-};
-
-/**
- * Run tests in the given `suite` and invoke
- * the callback `fn()` when complete.
- *
- * @param {Suite} suite
- * @param {Function} fn
- * @api private
- */
-
-Runner.prototype.runTests = function(suite, fn){
- var self = this
- , tests = suite.tests.slice()
- , test;
-
-
- function hookErr(err, errSuite, after) {
- // before/after Each hook for errSuite failed:
- var orig = self.suite;
-
- // for failed 'after each' hook start from errSuite parent,
- // otherwise start from errSuite itself
- self.suite = after ? errSuite.parent : errSuite;
-
- if (self.suite) {
- // call hookUp afterEach
- self.hookUp('afterEach', function(err2, errSuite2) {
- self.suite = orig;
- // some hooks may fail even now
- if (err2) return hookErr(err2, errSuite2, true);
- // report error suite
- fn(errSuite);
- });
- } else {
- // there is no need calling other 'after each' hooks
- self.suite = orig;
- fn(errSuite);
- }
- }
-
- function next(err, errSuite) {
- // if we bail after first err
- if (self.failures && suite._bail) return fn();
-
- if (self._abort) return fn();
-
- if (err) return hookErr(err, errSuite, true);
-
- // next test
- test = tests.shift();
-
- // all done
- if (!test) return fn();
-
- // grep
- var match = self._grep.test(test.fullTitle());
- if (self._invert) match = !match;
- if (!match) return next();
-
- // pending
- if (test.pending) {
- self.emit('pending', test);
- self.emit('test end', test);
- return next();
- }
-
- // execute test and hook(s)
- self.emit('test', self.test = test);
- self.hookDown('beforeEach', function(err, errSuite){
-
- if (suite.pending) {
- self.emit('pending', test);
- self.emit('test end', test);
- return next();
- }
- if (err) return hookErr(err, errSuite, false);
-
- self.currentRunnable = self.test;
- self.runTest(function(err){
- test = self.test;
-
- if (err) {
- if (err instanceof Pending) {
- self.emit('pending', test);
- } else {
- self.fail(test, err);
- }
- self.emit('test end', test);
-
- if (err instanceof Pending) {
- return next();
- }
-
- return self.hookUp('afterEach', next);
- }
-
- test.state = 'passed';
- self.emit('pass', test);
- self.emit('test end', test);
- self.hookUp('afterEach', next);
- });
- });
- }
-
- this.next = next;
- next();
-};
-
-/**
- * Run the given `suite` and invoke the
- * callback `fn()` when complete.
- *
- * @param {Suite} suite
- * @param {Function} fn
- * @api private
- */
-
-Runner.prototype.runSuite = function(suite, fn){
- var total = this.grepTotal(suite)
- , self = this
- , i = 0;
-
- debug('run suite %s', suite.fullTitle());
-
- if (!total) return fn();
-
- this.emit('suite', this.suite = suite);
-
- function next(errSuite) {
- if (errSuite) {
- // current suite failed on a hook from errSuite
- if (errSuite == suite) {
- // if errSuite is current suite
- // continue to the next sibling suite
- return done();
- } else {
- // errSuite is among the parents of current suite
- // stop execution of errSuite and all sub-suites
- return done(errSuite);
- }
- }
-
- if (self._abort) return done();
-
- var curr = suite.suites[i++];
- if (!curr) return done();
- self.runSuite(curr, next);
- }
-
- function done(errSuite) {
- self.suite = suite;
- self.hook('afterAll', function(){
- self.emit('suite end', suite);
- fn(errSuite);
- });
- }
-
- this.hook('beforeAll', function(err){
- if (err) return done();
- self.runTests(suite, next);
- });
-};
-
-/**
- * Handle uncaught exceptions.
- *
- * @param {Error} err
- * @api private
- */
-
-Runner.prototype.uncaught = function(err){
- if (err) {
- debug('uncaught exception %s', err !== function () {
- return this;
- }.call(err) ? err : ( err.message || err ));
- } else {
- debug('uncaught undefined exception');
- err = utils.undefinedError();
- }
- err.uncaught = true;
-
- var runnable = this.currentRunnable;
- if (!runnable) return;
-
- runnable.clearTimeout();
-
- // Ignore errors if complete
- if (runnable.state) return;
- this.fail(runnable, err);
-
- // recover from test
- if ('test' == runnable.type) {
- this.emit('test end', runnable);
- this.hookUp('afterEach', this.next);
- return;
- }
-
- // bail on hooks
- this.emit('end');
-};
-
-/**
- * Run the root suite and invoke `fn(failures)`
- * on completion.
- *
- * @param {Function} fn
- * @return {Runner} for chaining
- * @api public
- */
-
-Runner.prototype.run = function(fn){
- var self = this,
- rootSuite = this.suite;
-
- fn = fn || function(){};
-
- function uncaught(err){
- self.uncaught(err);
- }
-
- function start() {
- self.emit('start');
- self.runSuite(rootSuite, function(){
- debug('finished running');
- self.emit('end');
- });
- }
-
- debug('start');
-
- // callback
- this.on('end', function(){
- debug('end');
- process.removeListener('uncaughtException', uncaught);
- fn(self.failures);
- });
-
- // uncaught exception
- process.on('uncaughtException', uncaught);
-
- if (this._delay) {
- // for reporters, I guess.
- // might be nice to debounce some dots while we wait.
- this.emit('waiting', rootSuite);
- rootSuite.once('run', start);
- }
- else {
- start();
- }
-
- return this;
-};
-
-/**
- * Cleanly abort execution
- *
- * @return {Runner} for chaining
- * @api public
- */
-Runner.prototype.abort = function(){
- debug('aborting');
- this._abort = true;
-};
-
-/**
- * Filter leaks with the given globals flagged as `ok`.
- *
- * @param {Array} ok
- * @param {Array} globals
- * @return {Array}
- * @api private
- */
-
-function filterLeaks(ok, globals) {
- return filter(globals, function(key){
- // Firefox and Chrome exposes iframes as index inside the window object
- if (/^d+/.test(key)) return false;
-
- // in firefox
- // if runner runs in an iframe, this iframe's window.getInterface method not init at first
- // it is assigned in some seconds
- if (global.navigator && /^getInterface/.test(key)) return false;
-
- // an iframe could be approached by window[iframeIndex]
- // in ie6,7,8 and opera, iframeIndex is enumerable, this could cause leak
- if (global.navigator && /^\d+/.test(key)) return false;
-
- // Opera and IE expose global variables for HTML element IDs (issue #243)
- if (/^mocha-/.test(key)) return false;
-
- var matched = filter(ok, function(ok){
- if (~ok.indexOf('*')) return 0 == key.indexOf(ok.split('*')[0]);
- return key == ok;
- });
- return matched.length == 0 && (!global.navigator || 'onerror' !== key);
- });
-}
-
-/**
- * Array of globals dependent on the environment.
- *
- * @return {Array}
- * @api private
- */
-
-function extraGlobals() {
- if (typeof(process) === 'object' &&
- typeof(process.version) === 'string') {
-
- var nodeVersion = process.version.split('.').reduce(function(a, v) {
- return a << 8 | v;
- });
-
- // 'errno' was renamed to process._errno in v0.9.11.
-
- if (nodeVersion < 0x00090B) {
- return ['errno'];
- }
- }
-
- return [];
-}
-
-}); // module: runner.js
-
-require.register("suite.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var EventEmitter = require('browser/events').EventEmitter
- , debug = require('browser/debug')('mocha:suite')
- , milliseconds = require('./ms')
- , utils = require('./utils')
- , Hook = require('./hook');
-
-/**
- * Expose `Suite`.
- */
-
-exports = module.exports = Suite;
-
-/**
- * Create a new `Suite` with the given `title`
- * and parent `Suite`. When a suite with the
- * same title is already present, that suite
- * is returned to provide nicer reporter
- * and more flexible meta-testing.
- *
- * @param {Suite} parent
- * @param {String} title
- * @return {Suite}
- * @api public
- */
-
-exports.create = function(parent, title){
- var suite = new Suite(title, parent.ctx);
- suite.parent = parent;
- if (parent.pending) suite.pending = true;
- title = suite.fullTitle();
- parent.addSuite(suite);
- return suite;
-};
-
-/**
- * Initialize a new `Suite` with the given
- * `title` and `ctx`.
- *
- * @param {String} title
- * @param {Context} ctx
- * @api private
- */
-
-function Suite(title, parentContext) {
- this.title = title;
- var context = function() {};
- context.prototype = parentContext;
- this.ctx = new context();
- this.suites = [];
- this.tests = [];
- this.pending = false;
- this._beforeEach = [];
- this._beforeAll = [];
- this._afterEach = [];
- this._afterAll = [];
- this.root = !title;
- this._timeout = 2000;
- this._enableTimeouts = true;
- this._slow = 75;
- this._bail = false;
- this.delayed = false;
-}
-
-/**
- * Inherit from `EventEmitter.prototype`.
- */
-
-function F(){}
-F.prototype = EventEmitter.prototype;
-Suite.prototype = new F;
-Suite.prototype.constructor = Suite;
-
-
-/**
- * Return a clone of this `Suite`.
- *
- * @return {Suite}
- * @api private
- */
-
-Suite.prototype.clone = function(){
- var suite = new Suite(this.title);
- debug('clone');
- suite.ctx = this.ctx;
- suite.timeout(this.timeout());
- suite.enableTimeouts(this.enableTimeouts());
- suite.slow(this.slow());
- suite.bail(this.bail());
- return suite;
-};
-
-/**
- * Set timeout `ms` or short-hand such as "2s".
- *
- * @param {Number|String} ms
- * @return {Suite|Number} for chaining
- * @api private
- */
-
-Suite.prototype.timeout = function(ms){
- if (0 == arguments.length) return this._timeout;
- if (ms.toString() === '0') this._enableTimeouts = false;
- if ('string' == typeof ms) ms = milliseconds(ms);
- debug('timeout %d', ms);
- this._timeout = parseInt(ms, 10);
- return this;
-};
-
-/**
- * Set timeout `enabled`.
- *
- * @param {Boolean} enabled
- * @return {Suite|Boolean} self or enabled
- * @api private
- */
-
-Suite.prototype.enableTimeouts = function(enabled){
- if (arguments.length === 0) return this._enableTimeouts;
- debug('enableTimeouts %s', enabled);
- this._enableTimeouts = enabled;
- return this;
-};
-
-/**
- * Set slow `ms` or short-hand such as "2s".
- *
- * @param {Number|String} ms
- * @return {Suite|Number} for chaining
- * @api private
- */
-
-Suite.prototype.slow = function(ms){
- if (0 === arguments.length) return this._slow;
- if ('string' == typeof ms) ms = milliseconds(ms);
- debug('slow %d', ms);
- this._slow = ms;
- return this;
-};
-
-/**
- * Sets whether to bail after first error.
- *
- * @param {Boolean} bail
- * @return {Suite|Number} for chaining
- * @api private
- */
-
-Suite.prototype.bail = function(bail){
- if (0 == arguments.length) return this._bail;
- debug('bail %s', bail);
- this._bail = bail;
- return this;
-};
-
-/**
- * Run `fn(test[, done])` before running tests.
- *
- * @param {Function} fn
- * @return {Suite} for chaining
- * @api private
- */
-
-Suite.prototype.beforeAll = function(title, fn){
- if (this.pending) return this;
- if ('function' === typeof title) {
- fn = title;
- title = fn.name;
- }
- title = '"before all" hook' + (title ? ': ' + title : '');
-
- var hook = new Hook(title, fn);
- hook.parent = this;
- hook.timeout(this.timeout());
- hook.enableTimeouts(this.enableTimeouts());
- hook.slow(this.slow());
- hook.ctx = this.ctx;
- this._beforeAll.push(hook);
- this.emit('beforeAll', hook);
- return this;
-};
-
-/**
- * Run `fn(test[, done])` after running tests.
- *
- * @param {Function} fn
- * @return {Suite} for chaining
- * @api private
- */
-
-Suite.prototype.afterAll = function(title, fn){
- if (this.pending) return this;
- if ('function' === typeof title) {
- fn = title;
- title = fn.name;
- }
- title = '"after all" hook' + (title ? ': ' + title : '');
-
- var hook = new Hook(title, fn);
- hook.parent = this;
- hook.timeout(this.timeout());
- hook.enableTimeouts(this.enableTimeouts());
- hook.slow(this.slow());
- hook.ctx = this.ctx;
- this._afterAll.push(hook);
- this.emit('afterAll', hook);
- return this;
-};
-
-/**
- * Run `fn(test[, done])` before each test case.
- *
- * @param {Function} fn
- * @return {Suite} for chaining
- * @api private
- */
-
-Suite.prototype.beforeEach = function(title, fn){
- if (this.pending) return this;
- if ('function' === typeof title) {
- fn = title;
- title = fn.name;
- }
- title = '"before each" hook' + (title ? ': ' + title : '');
-
- var hook = new Hook(title, fn);
- hook.parent = this;
- hook.timeout(this.timeout());
- hook.enableTimeouts(this.enableTimeouts());
- hook.slow(this.slow());
- hook.ctx = this.ctx;
- this._beforeEach.push(hook);
- this.emit('beforeEach', hook);
- return this;
-};
-
-/**
- * Run `fn(test[, done])` after each test case.
- *
- * @param {Function} fn
- * @return {Suite} for chaining
- * @api private
- */
-
-Suite.prototype.afterEach = function(title, fn){
- if (this.pending) return this;
- if ('function' === typeof title) {
- fn = title;
- title = fn.name;
- }
- title = '"after each" hook' + (title ? ': ' + title : '');
-
- var hook = new Hook(title, fn);
- hook.parent = this;
- hook.timeout(this.timeout());
- hook.enableTimeouts(this.enableTimeouts());
- hook.slow(this.slow());
- hook.ctx = this.ctx;
- this._afterEach.push(hook);
- this.emit('afterEach', hook);
- return this;
-};
-
-/**
- * Add a test `suite`.
- *
- * @param {Suite} suite
- * @return {Suite} for chaining
- * @api private
- */
-
-Suite.prototype.addSuite = function(suite){
- suite.parent = this;
- suite.timeout(this.timeout());
- suite.enableTimeouts(this.enableTimeouts());
- suite.slow(this.slow());
- suite.bail(this.bail());
- this.suites.push(suite);
- this.emit('suite', suite);
- return this;
-};
-
-/**
- * Add a `test` to this suite.
- *
- * @param {Test} test
- * @return {Suite} for chaining
- * @api private
- */
-
-Suite.prototype.addTest = function(test){
- test.parent = this;
- test.timeout(this.timeout());
- test.enableTimeouts(this.enableTimeouts());
- test.slow(this.slow());
- test.ctx = this.ctx;
- this.tests.push(test);
- this.emit('test', test);
- return this;
-};
-
-/**
- * Return the full title generated by recursively
- * concatenating the parent's full title.
- *
- * @return {String}
- * @api public
- */
-
-Suite.prototype.fullTitle = function(){
- if (this.parent) {
- var full = this.parent.fullTitle();
- if (full) return full + ' ' + this.title;
- }
- return this.title;
-};
-
-/**
- * Return the total number of tests.
- *
- * @return {Number}
- * @api public
- */
-
-Suite.prototype.total = function(){
- return utils.reduce(this.suites, function(sum, suite){
- return sum + suite.total();
- }, 0) + this.tests.length;
-};
-
-/**
- * Iterates through each suite recursively to find
- * all tests. Applies a function in the format
- * `fn(test)`.
- *
- * @param {Function} fn
- * @return {Suite}
- * @api private
- */
-
-Suite.prototype.eachTest = function(fn){
- utils.forEach(this.tests, fn);
- utils.forEach(this.suites, function(suite){
- suite.eachTest(fn);
- });
- return this;
-};
-
-/**
- * This will run the root suite if we happen to be running in delayed mode.
- */
-Suite.prototype.run = function run() {
- if (this.root) {
- this.emit('run');
- }
-};
-
-}); // module: suite.js
-
-require.register("test.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var Runnable = require('./runnable');
-
-/**
- * Expose `Test`.
- */
-
-module.exports = Test;
-
-/**
- * Initialize a new `Test` with the given `title` and callback `fn`.
- *
- * @param {String} title
- * @param {Function} fn
- * @api private
- */
-
-function Test(title, fn) {
- Runnable.call(this, title, fn);
- this.pending = !fn;
- this.type = 'test';
-}
-
-/**
- * Inherit from `Runnable.prototype`.
- */
-
-function F(){}
-F.prototype = Runnable.prototype;
-Test.prototype = new F;
-Test.prototype.constructor = Test;
-
-
-}); // module: test.js
-
-require.register("utils.js", function(module, exports, require){
-/**
- * Module dependencies.
- */
-
-var fs = require('browser/fs')
- , path = require('browser/path')
- , basename = path.basename
- , exists = fs.existsSync || path.existsSync
- , glob = require('browser/glob')
- , join = path.join
- , debug = require('browser/debug')('mocha:watch');
-
-/**
- * Ignored directories.
- */
-
-var ignore = ['node_modules', '.git'];
-
-/**
- * Escape special characters in the given string of html.
- *
- * @param {String} html
- * @return {String}
- * @api private
- */
-
-exports.escape = function(html){
- return String(html)
- .replace(/&/g, '&amp;')
- .replace(/"/g, '&quot;')
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;');
-};
-
-/**
- * Array#forEach (<=IE8)
- *
- * @param {Array} array
- * @param {Function} fn
- * @param {Object} scope
- * @api private
- */
-
-exports.forEach = function(arr, fn, scope){
- for (var i = 0, l = arr.length; i < l; i++)
- fn.call(scope, arr[i], i);
-};
-
-/**
- * Array#map (<=IE8)
- *
- * @param {Array} array
- * @param {Function} fn
- * @param {Object} scope
- * @api private
- */
-
-exports.map = function(arr, fn, scope){
- var result = [];
- for (var i = 0, l = arr.length; i < l; i++)
- result.push(fn.call(scope, arr[i], i, arr));
- return result;
-};
-
-/**
- * Array#indexOf (<=IE8)
- *
- * @parma {Array} arr
- * @param {Object} obj to find index of
- * @param {Number} start
- * @api private
- */
-
-exports.indexOf = function(arr, obj, start){
- for (var i = start || 0, l = arr.length; i < l; i++) {
- if (arr[i] === obj)
- return i;
- }
- return -1;
-};
-
-/**
- * Array#reduce (<=IE8)
- *
- * @param {Array} array
- * @param {Function} fn
- * @param {Object} initial value
- * @api private
- */
-
-exports.reduce = function(arr, fn, val){
- var rval = val;
-
- for (var i = 0, l = arr.length; i < l; i++) {
- rval = fn(rval, arr[i], i, arr);
- }
-
- return rval;
-};
-
-/**
- * Array#filter (<=IE8)
- *
- * @param {Array} array
- * @param {Function} fn
- * @api private
- */
-
-exports.filter = function(arr, fn){
- var ret = [];
-
- for (var i = 0, l = arr.length; i < l; i++) {
- var val = arr[i];
- if (fn(val, i, arr)) ret.push(val);
- }
-
- return ret;
-};
-
-/**
- * Object.keys (<=IE8)
- *
- * @param {Object} obj
- * @return {Array} keys
- * @api private
- */
-
-exports.keys = Object.keys || function(obj) {
- var keys = []
- , has = Object.prototype.hasOwnProperty; // for `window` on <=IE8
-
- for (var key in obj) {
- if (has.call(obj, key)) {
- keys.push(key);
- }
- }
-
- return keys;
-};
-
-/**
- * Watch the given `files` for changes
- * and invoke `fn(file)` on modification.
- *
- * @param {Array} files
- * @param {Function} fn
- * @api private
- */
-
-exports.watch = function(files, fn){
- var options = { interval: 100 };
- files.forEach(function(file){
- debug('file %s', file);
- fs.watchFile(file, options, function(curr, prev){
- if (prev.mtime < curr.mtime) fn(file);
- });
- });
-};
-
-/**
- * Array.isArray (<=IE8)
- *
- * @param {Object} obj
- * @return {Boolean}
- * @api private
- */
-var isArray = Array.isArray || function (obj) {
- return '[object Array]' == {}.toString.call(obj);
-};
-
-/**
- * @description
- * Buffer.prototype.toJSON polyfill
- * @type {Function}
- */
-if(typeof Buffer !== 'undefined' && Buffer.prototype) {
- Buffer.prototype.toJSON = Buffer.prototype.toJSON || function () {
- return Array.prototype.slice.call(this, 0);
- };
-}
-
-/**
- * Ignored files.
- */
-
-function ignored(path){
- return !~ignore.indexOf(path);
-}
-
-/**
- * Lookup files in the given `dir`.
- *
- * @return {Array}
- * @api private
- */
-
-exports.files = function(dir, ext, ret){
- ret = ret || [];
- ext = ext || ['js'];
-
- var re = new RegExp('\\.(' + ext.join('|') + ')$');
-
- fs.readdirSync(dir)
- .filter(ignored)
- .forEach(function(path){
- path = join(dir, path);
- if (fs.statSync(path).isDirectory()) {
- exports.files(path, ext, ret);
- } else if (path.match(re)) {
- ret.push(path);
- }
- });
-
- return ret;
-};
-
-/**
- * Compute a slug from the given `str`.
- *
- * @param {String} str
- * @return {String}
- * @api private
- */
-
-exports.slug = function(str){
- return str
- .toLowerCase()
- .replace(/ +/g, '-')
- .replace(/[^-\w]/g, '');
-};
-
-/**
- * Strip the function definition from `str`,
- * and re-indent for pre whitespace.
- */
-
-exports.clean = function(str) {
- str = str
- .replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/^\uFEFF/, '')
- .replace(/^function *\(.*\)\s*{|\(.*\) *=> *{?/, '')
- .replace(/\s+\}$/, '');
-
- var spaces = str.match(/^\n?( *)/)[1].length
- , tabs = str.match(/^\n?(\t*)/)[1].length
- , re = new RegExp('^\n?' + (tabs ? '\t' : ' ') + '{' + (tabs ? tabs : spaces) + '}', 'gm');
-
- str = str.replace(re, '');
-
- return exports.trim(str);
-};
-
-/**
- * Trim the given `str`.
- *
- * @param {String} str
- * @return {String}
- * @api private
- */
-
-exports.trim = function(str){
- return str.replace(/^\s+|\s+$/g, '');
-};
-
-/**
- * Parse the given `qs`.
- *
- * @param {String} qs
- * @return {Object}
- * @api private
- */
-
-exports.parseQuery = function(qs){
- return exports.reduce(qs.replace('?', '').split('&'), function(obj, pair){
- var i = pair.indexOf('=')
- , key = pair.slice(0, i)
- , val = pair.slice(++i);
-
- obj[key] = decodeURIComponent(val);
- return obj;
- }, {});
-};
-
-/**
- * Highlight the given string of `js`.
- *
- * @param {String} js
- * @return {String}
- * @api private
- */
-
-function highlight(js) {
- return js
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;')
- .replace(/\/\/(.*)/gm, '<span class="comment">//$1</span>')
- .replace(/('.*?')/gm, '<span class="string">$1</span>')
- .replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
- .replace(/(\d+)/gm, '<span class="number">$1</span>')
- .replace(/\bnew[ \t]+(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>')
- .replace(/\b(function|new|throw|return|var|if|else)\b/gm, '<span class="keyword">$1</span>')
-}
-
-/**
- * Highlight the contents of tag `name`.
- *
- * @param {String} name
- * @api private
- */
-
-exports.highlightTags = function(name) {
- var code = document.getElementById('mocha').getElementsByTagName(name);
- for (var i = 0, len = code.length; i < len; ++i) {
- code[i].innerHTML = highlight(code[i].innerHTML);
- }
-};
-
-/**
- * If a value could have properties, and has none, this function is called, which returns
- * a string representation of the empty value.
- *
- * Functions w/ no properties return `'[Function]'`
- * Arrays w/ length === 0 return `'[]'`
- * Objects w/ no properties return `'{}'`
- * All else: return result of `value.toString()`
- *
- * @param {*} value Value to inspect
- * @param {string} [type] The type of the value, if known.
- * @returns {string}
- */
-var emptyRepresentation = function emptyRepresentation(value, type) {
- type = type || exports.type(value);
-
- switch(type) {
- case 'function':
- return '[Function]';
- case 'object':
- return '{}';
- case 'array':
- return '[]';
- default:
- return value.toString();
- }
-};
-
-/**
- * Takes some variable and asks `{}.toString()` what it thinks it is.
- * @param {*} value Anything
- * @example
- * type({}) // 'object'
- * type([]) // 'array'
- * type(1) // 'number'
- * type(false) // 'boolean'
- * type(Infinity) // 'number'
- * type(null) // 'null'
- * type(new Date()) // 'date'
- * type(/foo/) // 'regexp'
- * type('type') // 'string'
- * type(global) // 'global'
- * @api private
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString
- * @returns {string}
- */
-exports.type = function type(value) {
- if (typeof Buffer !== 'undefined' && Buffer.isBuffer(value)) {
- return 'buffer';
- }
- return Object.prototype.toString.call(value)
- .replace(/^\[.+\s(.+?)\]$/, '$1')
- .toLowerCase();
-};
-
-/**
- * @summary Stringify `value`.
- * @description Different behavior depending on type of value.
- * - If `value` is undefined or null, return `'[undefined]'` or `'[null]'`, respectively.
- * - If `value` is not an object, function or array, return result of `value.toString()` wrapped in double-quotes.
- * - If `value` is an *empty* object, function, or array, return result of function
- * {@link emptyRepresentation}.
- * - If `value` has properties, call {@link exports.canonicalize} on it, then return result of
- * JSON.stringify().
- *
- * @see exports.type
- * @param {*} value
- * @return {string}
- * @api private
- */
-
-exports.stringify = function(value) {
- var type = exports.type(value);
-
- if (!~exports.indexOf(['object', 'array', 'function'], type)) {
- if(type != 'buffer') {
- return jsonStringify(value);
- }
- var json = value.toJSON();
- // Based on the toJSON result
- return jsonStringify(json.data && json.type ? json.data : json, 2)
- .replace(/,(\n|$)/g, '$1');
- }
-
- for (var prop in value) {
- if (Object.prototype.hasOwnProperty.call(value, prop)) {
- return jsonStringify(exports.canonicalize(value), 2).replace(/,(\n|$)/g, '$1');
- }
- }
-
- return emptyRepresentation(value, type);
-};
-
-/**
- * @description
- * like JSON.stringify but more sense.
- * @param {Object} object
- * @param {Number=} spaces
- * @param {number=} depth
- * @returns {*}
- * @private
- */
-function jsonStringify(object, spaces, depth) {
- if(typeof spaces == 'undefined') return _stringify(object); // primitive types
-
- depth = depth || 1;
- var space = spaces * depth
- , str = isArray(object) ? '[' : '{'
- , end = isArray(object) ? ']' : '}'
- , length = object.length || exports.keys(object).length
- , repeat = function(s, n) { return new Array(n).join(s); }; // `.repeat()` polyfill
-
- function _stringify(val) {
- switch (exports.type(val)) {
- case 'null':
- case 'undefined':
- val = '[' + val + ']';
- break;
- case 'array':
- case 'object':
- val = jsonStringify(val, spaces, depth + 1);
- break;
- case 'boolean':
- case 'regexp':
- case 'number':
- val = val === 0 && (1/val) === -Infinity // `-0`
- ? '-0'
- : val.toString();
- break;
- case 'date':
- val = '[Date: ' + val.toISOString() + ']';
- break;
- case 'buffer':
- var json = val.toJSON();
- // Based on the toJSON result
- json = json.data && json.type ? json.data : json;
- val = '[Buffer: ' + jsonStringify(json, 2, depth + 1) + ']';
- break;
- default:
- val = (val == '[Function]' || val == '[Circular]')
- ? val
- : '"' + val + '"'; //string
- }
- return val;
- }
-
- for(var i in object) {
- if(!object.hasOwnProperty(i)) continue; // not my business
- --length;
- str += '\n ' + repeat(' ', space)
- + (isArray(object) ? '' : '"' + i + '": ') // key
- + _stringify(object[i]) // value
- + (length ? ',' : ''); // comma
- }
-
- return str + (str.length != 1 // [], {}
- ? '\n' + repeat(' ', --space) + end
- : end);
-}
-
-/**
- * Return if obj is a Buffer
- * @param {Object} arg
- * @return {Boolean}
- * @api private
- */
-exports.isBuffer = function (arg) {
- return typeof Buffer !== 'undefined' && Buffer.isBuffer(arg);
-};
-
-/**
- * @summary Return a new Thing that has the keys in sorted order. Recursive.
- * @description If the Thing...
- * - has already been seen, return string `'[Circular]'`
- * - is `undefined`, return string `'[undefined]'`
- * - is `null`, return value `null`
- * - is some other primitive, return the value
- * - is not a primitive or an `Array`, `Object`, or `Function`, return the value of the Thing's `toString()` method
- * - is a non-empty `Array`, `Object`, or `Function`, return the result of calling this function again.
- * - is an empty `Array`, `Object`, or `Function`, return the result of calling `emptyRepresentation()`
- *
- * @param {*} value Thing to inspect. May or may not have properties.
- * @param {Array} [stack=[]] Stack of seen values
- * @return {(Object|Array|Function|string|undefined)}
- * @see {@link exports.stringify}
- * @api private
- */
-
-exports.canonicalize = function(value, stack) {
- var canonicalizedObj,
- type = exports.type(value),
- prop,
- withStack = function withStack(value, fn) {
- stack.push(value);
- fn();
- stack.pop();
- };
-
- stack = stack || [];
-
- if (exports.indexOf(stack, value) !== -1) {
- return '[Circular]';
- }
-
- switch(type) {
- case 'undefined':
- case 'buffer':
- case 'null':
- canonicalizedObj = value;
- break;
- case 'array':
- withStack(value, function () {
- canonicalizedObj = exports.map(value, function (item) {
- return exports.canonicalize(item, stack);
- });
- });
- break;
- case 'function':
- for (prop in value) {
- canonicalizedObj = {};
- break;
- }
- if (!canonicalizedObj) {
- canonicalizedObj = emptyRepresentation(value, type);
- break;
- }
- /* falls through */
- case 'object':
- canonicalizedObj = canonicalizedObj || {};
- withStack(value, function () {
- exports.forEach(exports.keys(value).sort(), function (key) {
- canonicalizedObj[key] = exports.canonicalize(value[key], stack);
- });
- });
- break;
- case 'date':
- case 'number':
- case 'regexp':
- case 'boolean':
- canonicalizedObj = value;
- break;
- default:
- canonicalizedObj = value.toString();
- }
-
- return canonicalizedObj;
-};
-
-/**
- * Lookup file names at the given `path`.
- */
-exports.lookupFiles = function lookupFiles(path, extensions, recursive) {
- var files = [];
- var re = new RegExp('\\.(' + extensions.join('|') + ')$');
-
- if (!exists(path)) {
- if (exists(path + '.js')) {
- path += '.js';
- } else {
- files = glob.sync(path);
- if (!files.length) throw new Error("cannot resolve path (or pattern) '" + path + "'");
- return files;
- }
- }
-
- try {
- var stat = fs.statSync(path);
- if (stat.isFile()) return path;
- }
- catch (ignored) {
- return undefined;
- }
-
- fs.readdirSync(path).forEach(function(file) {
- file = join(path, file);
- try {
- var stat = fs.statSync(file);
- if (stat.isDirectory()) {
- if (recursive) {
- files = files.concat(lookupFiles(file, extensions, recursive));
- }
- return;
- }
- }
- catch (ignored) {
- return;
- }
- if (!stat.isFile() || !re.test(file) || basename(file)[0] === '.') return;
- files.push(file);
- });
-
- return files;
-};
-
-/**
- * Generate an undefined error with a message warning the user.
- *
- * @return {Error}
- */
-
-exports.undefinedError = function() {
- return new Error('Caught undefined error, did you throw without specifying what?');
-};
-
-/**
- * Generate an undefined error if `err` is not defined.
- *
- * @param {Error} err
- * @return {Error}
- */
-
-exports.getError = function(err) {
- return err || exports.undefinedError();
-};
-
-
-/**
- * @summary
- * This Filter based on `mocha-clean` module.(see: `github.com/rstacruz/mocha-clean`)
- * @description
- * When invoking this function you get a filter function that get the Error.stack as an input,
- * and return a prettify output.
- * (i.e: strip Mocha, node_modules, bower and componentJS from stack trace).
- * @returns {Function}
- */
-
-exports.stackTraceFilter = function() {
- var slash = '/'
- , is = typeof document === 'undefined'
- ? { node: true }
- : { browser: true }
- , cwd = is.node
- ? process.cwd() + slash
- : location.href.replace(/\/[^\/]*$/, '/');
-
- function isNodeModule (line) {
- return (~line.indexOf('node_modules'));
- }
-
- function isMochaInternal (line) {
- return (~line.indexOf('node_modules' + slash + 'mocha')) ||
- (~line.indexOf('components' + slash + 'mochajs')) ||
- (~line.indexOf('components' + slash + 'mocha'));
- }
-
- // node_modules, bower, componentJS
- function isBrowserModule(line) {
- return (~line.indexOf('node_modules')) ||
- (~line.indexOf('components'));
- }
-
- function isNodeInternal (line) {
- return (~line.indexOf('(timers.js:')) ||
- (~line.indexOf('(events.js:')) ||
- (~line.indexOf('(node.js:')) ||
- (~line.indexOf('(module.js:')) ||
- (~line.indexOf('GeneratorFunctionPrototype.next (native)')) ||
- false
- }
-
- return function(stack) {
- stack = stack.split('\n');
-
- stack = exports.reduce(stack, function(list, line) {
- if (is.node && (isNodeModule(line) ||
- isMochaInternal(line) ||
- isNodeInternal(line)))
- return list;
-
- if (is.browser && (isBrowserModule(line)))
- return list;
-
- // Clean up cwd(absolute)
- list.push(line.replace(cwd, ''));
- return list;
- }, []);
-
- return stack.join('\n');
- }
-};
-}); // module: utils.js
-// The global object is "self" in Web Workers.
-var global = (function() { return this; })();
-
-/**
- * Save timer references to avoid Sinon interfering (see GH-237).
- */
-
-var Date = global.Date;
-var setTimeout = global.setTimeout;
-var setInterval = global.setInterval;
-var clearTimeout = global.clearTimeout;
-var clearInterval = global.clearInterval;
-
-/**
- * Node shims.
- *
- * These are meant only to allow
- * mocha.js to run untouched, not
- * to allow running node code in
- * the browser.
- */
-
-var process = {};
-process.exit = function(status){};
-process.stdout = {};
-
-var uncaughtExceptionHandlers = [];
-
-var originalOnerrorHandler = global.onerror;
-
-/**
- * Remove uncaughtException listener.
- * Revert to original onerror handler if previously defined.
- */
-
-process.removeListener = function(e, fn){
- if ('uncaughtException' == e) {
- if (originalOnerrorHandler) {
- global.onerror = originalOnerrorHandler;
- } else {
- global.onerror = function() {};
- }
- var i = Mocha.utils.indexOf(uncaughtExceptionHandlers, fn);
- if (i != -1) { uncaughtExceptionHandlers.splice(i, 1); }
- }
-};
-
-/**
- * Implements uncaughtException listener.
- */
-
-process.on = function(e, fn){
- if ('uncaughtException' == e) {
- global.onerror = function(err, url, line){
- fn(new Error(err + ' (' + url + ':' + line + ')'));
- return true;
- };
- uncaughtExceptionHandlers.push(fn);
- }
-};
-
-/**
- * Expose mocha.
- */
-
-var Mocha = global.Mocha = require('mocha'),
- mocha = global.mocha = new Mocha({ reporter: 'html' });
-
-// The BDD UI is registered by default, but no UI will be functional in the
-// browser without an explicit call to the overridden `mocha.ui` (see below).
-// Ensure that this default UI does not expose its methods to the global scope.
-mocha.suite.removeAllListeners('pre-require');
-
-var immediateQueue = []
- , immediateTimeout;
-
-function timeslice() {
- var immediateStart = new Date().getTime();
- while (immediateQueue.length && (new Date().getTime() - immediateStart) < 100) {
- immediateQueue.shift()();
- }
- if (immediateQueue.length) {
- immediateTimeout = setTimeout(timeslice, 0);
- } else {
- immediateTimeout = null;
- }
-}
-
-/**
- * High-performance override of Runner.immediately.
- */
-
-Mocha.Runner.immediately = function(callback) {
- immediateQueue.push(callback);
- if (!immediateTimeout) {
- immediateTimeout = setTimeout(timeslice, 0);
- }
-};
-
-/**
- * Function to allow assertion libraries to throw errors directly into mocha.
- * This is useful when running tests in a browser because window.onerror will
- * only receive the 'message' attribute of the Error.
- */
-mocha.throwError = function(err) {
- Mocha.utils.forEach(uncaughtExceptionHandlers, function (fn) {
- fn(err);
- });
- throw err;
-};
-
-/**
- * Override ui to ensure that the ui functions are initialized.
- * Normally this would happen in Mocha.prototype.loadFiles.
- */
-
-mocha.ui = function(ui){
- Mocha.prototype.ui.call(this, ui);
- this.suite.emit('pre-require', global, null, this);
- return this;
-};
-
-/**
- * Setup mocha with the given setting options.
- */
-
-mocha.setup = function(opts){
- if ('string' == typeof opts) opts = { ui: opts };
- for (var opt in opts) this[opt](opts[opt]);
- return this;
-};
-
-/**
- * Run mocha, returning the Runner.
- */
-
-mocha.run = function(fn){
- var options = mocha.options;
- mocha.globals('location');
-
- var query = Mocha.utils.parseQuery(global.location.search || '');
- if (query.grep) mocha.grep(new RegExp(query.grep));
- if (query.fgrep) mocha.grep(query.fgrep);
- if (query.invert) mocha.invert();
-
- return Mocha.prototype.run.call(mocha, function(err){
- // The DOM Document is not available in Web Workers.
- var document = global.document;
- if (document && document.getElementById('mocha') && options.noHighlighting !== true) {
- Mocha.utils.highlightTags('code');
- }
- if (fn) fn(err);
- });
-};
-
-/**
- * Expose the process shim.
- */
-
-Mocha.process = process;
-})();
diff --git a/toolkit/components/microformats/test/static/javascript/parse.js b/toolkit/components/microformats/test/static/javascript/parse.js
deleted file mode 100644
index 588e403ee..000000000
--- a/toolkit/components/microformats/test/static/javascript/parse.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/*!
- parse
- Used by http://localhost:3000/
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-window.onload = function() {
-
- var form;
- form= document.getElementById('mf-form');
-
- form.onsubmit = function(e){
- e = (e)? e : window.event;
-
- if (e.preventDefault) {
- e.preventDefault();
- } else {
- event.returnValue = false;
- }
-
-
- var html,
- baseUrl,
- filter,
- collapsewhitespace,
- overlappingversions,
- impliedPropertiesByVersion,
- dateformatElt,
- dateformat,
- doc,
- node,
- options,
- mfJSON,
- parserJSONElt;
-
- // get data from html
- html = document.getElementById('html').value;
- baseUrl = document.getElementById('baseurl').value;
- filters = document.getElementById('filters').value;
- collapsewhitespace = document.getElementById('collapsewhitespace').checked;
- //overlappingversions = document.getElementById('overlappingversions').checked;
- //impliedPropertiesByVersion = document.getElementById('impliedPropertiesByVersion').checked;
- parseLatLonGeo = document.getElementById('parseLatLonGeo').checked;
- dateformatElt = document.getElementById("dateformat");
- dateformat = dateformatElt.options[dateformatElt.selectedIndex].value;
- parserJSONElt = document.querySelector('#parser-json pre code')
-
-
- var dom = new DOMParser();
- doc = dom.parseFromString( html, 'text/html' );
-
- options ={
- 'document': doc,
- 'node': doc,
- 'dateFormat': dateformat,
- 'parseLatLonGeo': false
- };
-
- if(baseUrl.trim() !== ''){
- options.baseUrl = baseUrl;
- }
-
- if(filters.trim() !== ''){
- if(filters.indexOf(',') > -1){
- options.filters = trimArrayItems(filters.split(','));
- }else{
- options.filters = [filters.trim()];
- }
- }
-
- if(collapsewhitespace === true){
- options.textFormat = 'normalised';
- }
-
- /*
- if(overlappingversions === true){
- options.overlappingVersions = false;
- }
-
- if(impliedPropertiesByVersion === true){
- options.impliedPropertiesByVersion = true;
- }
- */
-
- if(parseLatLonGeo === true){
- options.parseLatLonGeo = true
- }
-
- if(options.baseUrl){
- html = '<base href="' + baseUrl+ '">' + html;
- }
-
-
-
- // parse direct into Modules to help debugging
- if(window.Modules){
- var parser = new Modules.Parser();
- mfJSON = parser.get(options);
- }else if(window.Microformats){
- mfJSON = Microformats.get(options);
- }
-
-
- // format output
- parserJSONElt.innerHTML = htmlEscape( js_beautify( JSON.stringify(mfJSON) ) );
- //prettyPrint();
-
- }
-
-
-};
-
-
-
-
-
-function htmlEscape(str) {
- return String(str)
- .replace(/&/g, '&amp;')
- .replace(/"/g, '&quot;')
- .replace(/'/g, '&#39;')
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;');
-}
-
-
-function trimArrayItems( arr ){
- return arr.map(function(item){
- return item.trim();
- })
-}
-
diff --git a/toolkit/components/microformats/test/static/javascript/prettify.js b/toolkit/components/microformats/test/static/javascript/prettify.js
deleted file mode 100644
index 879dfd60f..000000000
--- a/toolkit/components/microformats/test/static/javascript/prettify.js
+++ /dev/null
@@ -1,1479 +0,0 @@
-// Copyright (C) 2006 Google Inc.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-
-/**
- * @fileoverview
- * some functions for browser-side pretty printing of code contained in html.
- *
- * <p>
- * For a fairly comprehensive set of languages see the
- * <a href="http://google-code-prettify.googlecode.com/svn/trunk/README.html#langs">README</a>
- * file that came with this source. At a minimum, the lexer should work on a
- * number of languages including C and friends, Java, Python, Bash, SQL, HTML,
- * XML, CSS, Javascript, and Makefiles. It works passably on Ruby, PHP and Awk
- * and a subset of Perl, but, because of commenting conventions, doesn't work on
- * Smalltalk, Lisp-like, or CAML-like languages without an explicit lang class.
- * <p>
- * Usage: <ol>
- * <li> include this source file in an html page via
- * {@code <script type="text/javascript" src="/path/to/prettify.js"></script>}
- * <li> define style rules. See the example page for examples.
- * <li> mark the {@code <pre>} and {@code <code>} tags in your source with
- * {@code class=prettyprint.}
- * You can also use the (html deprecated) {@code <xmp>} tag, but the pretty
- * printer needs to do more substantial DOM manipulations to support that, so
- * some css styles may not be preserved.
- * </ol>
- * That's it. I wanted to keep the API as simple as possible, so there's no
- * need to specify which language the code is in, but if you wish, you can add
- * another class to the {@code <pre>} or {@code <code>} element to specify the
- * language, as in {@code <pre class="prettyprint lang-java">}. Any class that
- * starts with "lang-" followed by a file extension, specifies the file type.
- * See the "lang-*.js" files in this directory for code that implements
- * per-language file handlers.
- * <p>
- * Change log:<br>
- * cbeust, 2006/08/22
- * <blockquote>
- * Java annotations (start with "@") are now captured as literals ("lit")
- * </blockquote>
- * @requires console
- */
-
-// JSLint declarations
-/*global console, document, navigator, setTimeout, window */
-
-/**
- * Split {@code prettyPrint} into multiple timeouts so as not to interfere with
- * UI events.
- * If set to {@code false}, {@code prettyPrint()} is synchronous.
- */
-window['PR_SHOULD_USE_CONTINUATION'] = true;
-
-(function () {
- // Keyword lists for various languages.
- // We use things that coerce to strings to make them compact when minified
- // and to defeat aggressive optimizers that fold large string constants.
- var FLOW_CONTROL_KEYWORDS = ["break,continue,do,else,for,if,return,while"];
- var C_KEYWORDS = [FLOW_CONTROL_KEYWORDS,"auto,case,char,const,default," +
- "double,enum,extern,float,goto,int,long,register,short,signed,sizeof," +
- "static,struct,switch,typedef,union,unsigned,void,volatile"];
- var COMMON_KEYWORDS = [C_KEYWORDS,"catch,class,delete,false,import," +
- "new,operator,private,protected,public,this,throw,true,try,typeof"];
- var CPP_KEYWORDS = [COMMON_KEYWORDS,"alignof,align_union,asm,axiom,bool," +
- "concept,concept_map,const_cast,constexpr,decltype," +
- "dynamic_cast,explicit,export,friend,inline,late_check," +
- "mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast," +
- "template,typeid,typename,using,virtual,where"];
- var JAVA_KEYWORDS = [COMMON_KEYWORDS,
- "abstract,boolean,byte,extends,final,finally,implements,import," +
- "instanceof,null,native,package,strictfp,super,synchronized,throws," +
- "transient"];
- var CSHARP_KEYWORDS = [JAVA_KEYWORDS,
- "as,base,by,checked,decimal,delegate,descending,dynamic,event," +
- "fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock," +
- "object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed," +
- "stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];
- var COFFEE_KEYWORDS = "all,and,by,catch,class,else,extends,false,finally," +
- "for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then," +
- "true,try,unless,until,when,while,yes";
- var JSCRIPT_KEYWORDS = [COMMON_KEYWORDS,
- "debugger,eval,export,function,get,null,set,undefined,var,with," +
- "Infinity,NaN"];
- var PERL_KEYWORDS = "caller,delete,die,do,dump,elsif,eval,exit,foreach,for," +
- "goto,if,import,last,local,my,next,no,our,print,package,redo,require," +
- "sub,undef,unless,until,use,wantarray,while,BEGIN,END";
- var PYTHON_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "and,as,assert,class,def,del," +
- "elif,except,exec,finally,from,global,import,in,is,lambda," +
- "nonlocal,not,or,pass,print,raise,try,with,yield," +
- "False,True,None"];
- var RUBY_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "alias,and,begin,case,class," +
- "def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo," +
- "rescue,retry,self,super,then,true,undef,unless,until,when,yield," +
- "BEGIN,END"];
- var SH_KEYWORDS = [FLOW_CONTROL_KEYWORDS, "case,done,elif,esac,eval,fi," +
- "function,in,local,set,then,until"];
- var ALL_KEYWORDS = [
- CPP_KEYWORDS, CSHARP_KEYWORDS, JSCRIPT_KEYWORDS, PERL_KEYWORDS +
- PYTHON_KEYWORDS, RUBY_KEYWORDS, SH_KEYWORDS];
- var C_TYPES = /^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;
-
- // token style names. correspond to css classes
- /**
- * token style for a string literal
- * @const
- */
- var PR_STRING = 'str';
- /**
- * token style for a keyword
- * @const
- */
- var PR_KEYWORD = 'kwd';
- /**
- * token style for a comment
- * @const
- */
- var PR_COMMENT = 'com';
- /**
- * token style for a type
- * @const
- */
- var PR_TYPE = 'typ';
- /**
- * token style for a literal value. e.g. 1, null, true.
- * @const
- */
- var PR_LITERAL = 'lit';
- /**
- * token style for a punctuation string.
- * @const
- */
- var PR_PUNCTUATION = 'pun';
- /**
- * token style for a punctuation string.
- * @const
- */
- var PR_PLAIN = 'pln';
-
- /**
- * token style for an sgml tag.
- * @const
- */
- var PR_TAG = 'tag';
- /**
- * token style for a markup declaration such as a DOCTYPE.
- * @const
- */
- var PR_DECLARATION = 'dec';
- /**
- * token style for embedded source.
- * @const
- */
- var PR_SOURCE = 'src';
- /**
- * token style for an sgml attribute name.
- * @const
- */
- var PR_ATTRIB_NAME = 'atn';
- /**
- * token style for an sgml attribute value.
- * @const
- */
- var PR_ATTRIB_VALUE = 'atv';
-
- /**
- * A class that indicates a section of markup that is not code, e.g. to allow
- * embedding of line numbers within code listings.
- * @const
- */
- var PR_NOCODE = 'nocode';
-
-
-
-/**
- * A set of tokens that can precede a regular expression literal in
- * javascript
- * http://web.archive.org/web/20070717142515/http://www.mozilla.org/js/language/js20/rationale/syntax.html
- * has the full list, but I've removed ones that might be problematic when
- * seen in languages that don't support regular expression literals.
- *
- * <p>Specifically, I've removed any keywords that can't precede a regexp
- * literal in a syntactically legal javascript program, and I've removed the
- * "in" keyword since it's not a keyword in many languages, and might be used
- * as a count of inches.
- *
- * <p>The link a above does not accurately describe EcmaScript rules since
- * it fails to distinguish between (a=++/b/i) and (a++/b/i) but it works
- * very well in practice.
- *
- * @private
- * @const
- */
-var REGEXP_PRECEDER_PATTERN = '(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*';
-
-// CAVEAT: this does not properly handle the case where a regular
-// expression immediately follows another since a regular expression may
-// have flags for case-sensitivity and the like. Having regexp tokens
-// adjacent is not valid in any language I'm aware of, so I'm punting.
-// TODO: maybe style special characters inside a regexp as punctuation.
-
-
- /**
- * Given a group of {@link RegExp}s, returns a {@code RegExp} that globally
- * matches the union of the sets of strings matched by the input RegExp.
- * Since it matches globally, if the input strings have a start-of-input
- * anchor (/^.../), it is ignored for the purposes of unioning.
- * @param {Array.<RegExp>} regexs non multiline, non-global regexs.
- * @return {RegExp} a global regex.
- */
- function combinePrefixPatterns(regexs) {
- var capturedGroupIndex = 0;
-
- var needToFoldCase = false;
- var ignoreCase = false;
- for (var i = 0, n = regexs.length; i < n; ++i) {
- var regex = regexs[i];
- if (regex.ignoreCase) {
- ignoreCase = true;
- } else if (/[a-z]/i.test(regex.source.replace(
- /\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi, ''))) {
- needToFoldCase = true;
- ignoreCase = false;
- break;
- }
- }
-
- var escapeCharToCodeUnit = {
- 'b': 8,
- 't': 9,
- 'n': 0xa,
- 'v': 0xb,
- 'f': 0xc,
- 'r': 0xd
- };
-
- function decodeEscape(charsetPart) {
- var cc0 = charsetPart.charCodeAt(0);
- if (cc0 !== 92 /* \\ */) {
- return cc0;
- }
- var c1 = charsetPart.charAt(1);
- cc0 = escapeCharToCodeUnit[c1];
- if (cc0) {
- return cc0;
- } else if ('0' <= c1 && c1 <= '7') {
- return parseInt(charsetPart.substring(1), 8);
- } else if (c1 === 'u' || c1 === 'x') {
- return parseInt(charsetPart.substring(2), 16);
- } else {
- return charsetPart.charCodeAt(1);
- }
- }
-
- function encodeEscape(charCode) {
- if (charCode < 0x20) {
- return (charCode < 0x10 ? '\\x0' : '\\x') + charCode.toString(16);
- }
- var ch = String.fromCharCode(charCode);
- if (ch === '\\' || ch === '-' || ch === '[' || ch === ']') {
- ch = '\\' + ch;
- }
- return ch;
- }
-
- function caseFoldCharset(charSet) {
- var charsetParts = charSet.substring(1, charSet.length - 1).match(
- new RegExp(
- '\\\\u[0-9A-Fa-f]{4}'
- + '|\\\\x[0-9A-Fa-f]{2}'
- + '|\\\\[0-3][0-7]{0,2}'
- + '|\\\\[0-7]{1,2}'
- + '|\\\\[\\s\\S]'
- + '|-'
- + '|[^-\\\\]',
- 'g'));
- var groups = [];
- var ranges = [];
- var inverse = charsetParts[0] === '^';
- for (var i = inverse ? 1 : 0, n = charsetParts.length; i < n; ++i) {
- var p = charsetParts[i];
- if (/\\[bdsw]/i.test(p)) { // Don't muck with named groups.
- groups.push(p);
- } else {
- var start = decodeEscape(p);
- var end;
- if (i + 2 < n && '-' === charsetParts[i + 1]) {
- end = decodeEscape(charsetParts[i + 2]);
- i += 2;
- } else {
- end = start;
- }
- ranges.push([start, end]);
- // If the range might intersect letters, then expand it.
- // This case handling is too simplistic.
- // It does not deal with non-latin case folding.
- // It works for latin source code identifiers though.
- if (!(end < 65 || start > 122)) {
- if (!(end < 65 || start > 90)) {
- ranges.push([Math.max(65, start) | 32, Math.min(end, 90) | 32]);
- }
- if (!(end < 97 || start > 122)) {
- ranges.push([Math.max(97, start) & ~32, Math.min(end, 122) & ~32]);
- }
- }
- }
- }
-
- // [[1, 10], [3, 4], [8, 12], [14, 14], [16, 16], [17, 17]]
- // -> [[1, 12], [14, 14], [16, 17]]
- ranges.sort(function (a, b) { return (a[0] - b[0]) || (b[1] - a[1]); });
- var consolidatedRanges = [];
- var lastRange = [NaN, NaN];
- for (i = 0; i < ranges.length; ++i) {
- var range = ranges[i];
- if (range[0] <= lastRange[1] + 1) {
- lastRange[1] = Math.max(lastRange[1], range[1]);
- } else {
- consolidatedRanges.push(lastRange = range);
- }
- }
-
- var out = ['['];
- if (inverse) { out.push('^'); }
- out.push.apply(out, groups);
- for (i = 0; i < consolidatedRanges.length; ++i) {
- range = consolidatedRanges[i];
- out.push(encodeEscape(range[0]));
- if (range[1] > range[0]) {
- if (range[1] + 1 > range[0]) { out.push('-'); }
- out.push(encodeEscape(range[1]));
- }
- }
- out.push(']');
- return out.join('');
- }
-
- function allowAnywhereFoldCaseAndRenumberGroups(regex) {
- // Split into character sets, escape sequences, punctuation strings
- // like ('(', '(?:', ')', '^'), and runs of characters that do not
- // include any of the above.
- var parts = regex.source.match(
- new RegExp(
- '(?:'
- + '\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]' // a character set
- + '|\\\\u[A-Fa-f0-9]{4}' // a unicode escape
- + '|\\\\x[A-Fa-f0-9]{2}' // a hex escape
- + '|\\\\[0-9]+' // a back-reference or octal escape
- + '|\\\\[^ux0-9]' // other escape sequence
- + '|\\(\\?[:!=]' // start of a non-capturing group
- + '|[\\(\\)\\^]' // start/emd of a group, or line start
- + '|[^\\x5B\\x5C\\(\\)\\^]+' // run of other characters
- + ')',
- 'g'));
- var n = parts.length;
-
- // Maps captured group numbers to the number they will occupy in
- // the output or to -1 if that has not been determined, or to
- // undefined if they need not be capturing in the output.
- var capturedGroups = [];
-
- // Walk over and identify back references to build the capturedGroups
- // mapping.
- for (var i = 0, groupIndex = 0; i < n; ++i) {
- var p = parts[i];
- if (p === '(') {
- // groups are 1-indexed, so max group index is count of '('
- ++groupIndex;
- } else if ('\\' === p.charAt(0)) {
- var decimalValue = +p.substring(1);
- if (decimalValue && decimalValue <= groupIndex) {
- capturedGroups[decimalValue] = -1;
- }
- }
- }
-
- // Renumber groups and reduce capturing groups to non-capturing groups
- // where possible.
- for (i = 1; i < capturedGroups.length; ++i) {
- if (-1 === capturedGroups[i]) {
- capturedGroups[i] = ++capturedGroupIndex;
- }
- }
- for (i = 0, groupIndex = 0; i < n; ++i) {
- p = parts[i];
- if (p === '(') {
- ++groupIndex;
- if (capturedGroups[groupIndex] === undefined) {
- parts[i] = '(?:';
- }
- } else if ('\\' === p.charAt(0)) {
- decimalValue = +p.substring(1);
- if (decimalValue && decimalValue <= groupIndex) {
- parts[i] = '\\' + capturedGroups[groupIndex];
- }
- }
- }
-
- // Remove any prefix anchors so that the output will match anywhere.
- // ^^ really does mean an anchored match though.
- for (i = 0, groupIndex = 0; i < n; ++i) {
- if ('^' === parts[i] && '^' !== parts[i + 1]) { parts[i] = ''; }
- }
-
- // Expand letters to groups to handle mixing of case-sensitive and
- // case-insensitive patterns if necessary.
- if (regex.ignoreCase && needToFoldCase) {
- for (i = 0; i < n; ++i) {
- p = parts[i];
- var ch0 = p.charAt(0);
- if (p.length >= 2 && ch0 === '[') {
- parts[i] = caseFoldCharset(p);
- } else if (ch0 !== '\\') {
- // TODO: handle letters in numeric escapes.
- parts[i] = p.replace(
- /[a-zA-Z]/g,
- function (ch) {
- var cc = ch.charCodeAt(0);
- return '[' + String.fromCharCode(cc & ~32, cc | 32) + ']';
- });
- }
- }
- }
-
- return parts.join('');
- }
-
- var rewritten = [];
- for (i = 0, n = regexs.length; i < n; ++i) {
- regex = regexs[i];
- if (regex.global || regex.multiline) { throw new Error('' + regex); }
- rewritten.push(
- '(?:' + allowAnywhereFoldCaseAndRenumberGroups(regex) + ')');
- }
-
- return new RegExp(rewritten.join('|'), ignoreCase ? 'gi' : 'g');
- }
-
-
- /**
- * Split markup into a string of source code and an array mapping ranges in
- * that string to the text nodes in which they appear.
- *
- * <p>
- * The HTML DOM structure:</p>
- * <pre>
- * (Element "p"
- * (Element "b"
- * (Text "print ")) ; #1
- * (Text "'Hello '") ; #2
- * (Element "br") ; #3
- * (Text " + 'World';")) ; #4
- * </pre>
- * <p>
- * corresponds to the HTML
- * {@code <p><b>print </b>'Hello '<br> + 'World';</p>}.</p>
- *
- * <p>
- * It will produce the output:</p>
- * <pre>
- * {
- * sourceCode: "print 'Hello '\n + 'World';",
- * // 1 2
- * // 012345678901234 5678901234567
- * spans: [0, #1, 6, #2, 14, #3, 15, #4]
- * }
- * </pre>
- * <p>
- * where #1 is a reference to the {@code "print "} text node above, and so
- * on for the other text nodes.
- * </p>
- *
- * <p>
- * The {@code} spans array is an array of pairs. Even elements are the start
- * indices of substrings, and odd elements are the text nodes (or BR elements)
- * that contain the text for those substrings.
- * Substrings continue until the next index or the end of the source.
- * </p>
- *
- * @param {Node} node an HTML DOM subtree containing source-code.
- * @return {Object} source code and the text nodes in which they occur.
- */
- function extractSourceSpans(node) {
- var nocode = /(?:^|\s)nocode(?:\s|$)/;
-
- var chunks = [];
- var length = 0;
- var spans = [];
- var k = 0;
-
- var whitespace;
- if (node.currentStyle) {
- whitespace = node.currentStyle.whiteSpace;
- } else if (window.getComputedStyle) {
- whitespace = document.defaultView.getComputedStyle(node, null)
- .getPropertyValue('white-space');
- }
- var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3);
-
- function walk(node) {
- switch (node.nodeType) {
- case 1: // Element
- if (nocode.test(node.className)) { return; }
- for (var child = node.firstChild; child; child = child.nextSibling) {
- walk(child);
- }
- var nodeName = node.nodeName;
- if ('BR' === nodeName || 'LI' === nodeName) {
- chunks[k] = '\n';
- spans[k << 1] = length++;
- spans[(k++ << 1) | 1] = node;
- }
- break;
- case 3: case 4: // Text
- var text = node.nodeValue;
- if (text.length) {
- if (!isPreformatted) {
- text = text.replace(/[ \t\r\n]+/g, ' ');
- } else {
- text = text.replace(/\r\n?/g, '\n'); // Normalize newlines.
- }
- // TODO: handle tabs here?
- chunks[k] = text;
- spans[k << 1] = length;
- length += text.length;
- spans[(k++ << 1) | 1] = node;
- }
- break;
- }
- }
-
- walk(node);
-
- return {
- sourceCode: chunks.join('').replace(/\n$/, ''),
- spans: spans
- };
- }
-
-
- /**
- * Apply the given language handler to sourceCode and add the resulting
- * decorations to out.
- * @param {number} basePos the index of sourceCode within the chunk of source
- * whose decorations are already present on out.
- */
- function appendDecorations(basePos, sourceCode, langHandler, out) {
- if (!sourceCode) { return; }
- var job = {
- sourceCode: sourceCode,
- basePos: basePos
- };
- langHandler(job);
- out.push.apply(out, job.decorations);
- }
-
- var notWs = /\S/;
-
- /**
- * Given an element, if it contains only one child element and any text nodes
- * it contains contain only space characters, return the sole child element.
- * Otherwise returns undefined.
- * <p>
- * This is meant to return the CODE element in {@code <pre><code ...>} when
- * there is a single child element that contains all the non-space textual
- * content, but not to return anything where there are multiple child elements
- * as in {@code <pre><code>...</code><code>...</code></pre>} or when there
- * is textual content.
- */
- function childContentWrapper(element) {
- var wrapper = undefined;
- for (var c = element.firstChild; c; c = c.nextSibling) {
- var type = c.nodeType;
- if (type === 1) {
- wrapper = wrapper ? element : c;
- } else if (type === 3) {
- wrapper = notWs.test(c.nodeValue) ? element : wrapper;
- }
- }
- return wrapper === element ? undefined : wrapper;
- }
-
- /** Given triples of [style, pattern, context] returns a lexing function,
- * The lexing function interprets the patterns to find token boundaries and
- * returns a decoration list of the form
- * [index_0, style_0, index_1, style_1, ..., index_n, style_n]
- * where index_n is an index into the sourceCode, and style_n is a style
- * constant like PR_PLAIN. index_n-1 <= index_n, and style_n-1 applies to
- * all characters in sourceCode[index_n-1:index_n].
- *
- * The stylePatterns is a list whose elements have the form
- * [style : string, pattern : RegExp, DEPRECATED, shortcut : string].
- *
- * Style is a style constant like PR_PLAIN, or can be a string of the
- * form 'lang-FOO', where FOO is a language extension describing the
- * language of the portion of the token in $1 after pattern executes.
- * E.g., if style is 'lang-lisp', and group 1 contains the text
- * '(hello (world))', then that portion of the token will be passed to the
- * registered lisp handler for formatting.
- * The text before and after group 1 will be restyled using this decorator
- * so decorators should take care that this doesn't result in infinite
- * recursion. For example, the HTML lexer rule for SCRIPT elements looks
- * something like ['lang-js', /<[s]cript>(.+?)<\/script>/]. This may match
- * '<script>foo()<\/script>', which would cause the current decorator to
- * be called with '<script>' which would not match the same rule since
- * group 1 must not be empty, so it would be instead styled as PR_TAG by
- * the generic tag rule. The handler registered for the 'js' extension would
- * then be called with 'foo()', and finally, the current decorator would
- * be called with '<\/script>' which would not match the original rule and
- * so the generic tag rule would identify it as a tag.
- *
- * Pattern must only match prefixes, and if it matches a prefix, then that
- * match is considered a token with the same style.
- *
- * Context is applied to the last non-whitespace, non-comment token
- * recognized.
- *
- * Shortcut is an optional string of characters, any of which, if the first
- * character, gurantee that this pattern and only this pattern matches.
- *
- * @param {Array} shortcutStylePatterns patterns that always start with
- * a known character. Must have a shortcut string.
- * @param {Array} fallthroughStylePatterns patterns that will be tried in
- * order if the shortcut ones fail. May have shortcuts.
- *
- * @return {function (Object)} a
- * function that takes source code and returns a list of decorations.
- */
- function createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns) {
- var shortcuts = {};
- var tokenizer;
- (function () {
- var allPatterns = shortcutStylePatterns.concat(fallthroughStylePatterns);
- var allRegexs = [];
- var regexKeys = {};
- for (var i = 0, n = allPatterns.length; i < n; ++i) {
- var patternParts = allPatterns[i];
- var shortcutChars = patternParts[3];
- if (shortcutChars) {
- for (var c = shortcutChars.length; --c >= 0;) {
- shortcuts[shortcutChars.charAt(c)] = patternParts;
- }
- }
- var regex = patternParts[1];
- var k = '' + regex;
- if (!regexKeys.hasOwnProperty(k)) {
- allRegexs.push(regex);
- regexKeys[k] = null;
- }
- }
- allRegexs.push(/[\0-\uffff]/);
- tokenizer = combinePrefixPatterns(allRegexs);
- })();
-
- var nPatterns = fallthroughStylePatterns.length;
-
- /**
- * Lexes job.sourceCode and produces an output array job.decorations of
- * style classes preceded by the position at which they start in
- * job.sourceCode in order.
- *
- * @param {Object} job an object like <pre>{
- * sourceCode: {string} sourceText plain text,
- * basePos: {int} position of job.sourceCode in the larger chunk of
- * sourceCode.
- * }</pre>
- */
- var decorate = function (job) {
- var sourceCode = job.sourceCode, basePos = job.basePos;
- /** Even entries are positions in source in ascending order. Odd enties
- * are style markers (e.g., PR_COMMENT) that run from that position until
- * the end.
- * @type {Array.<number|string>}
- */
- var decorations = [basePos, PR_PLAIN];
- var pos = 0; // index into sourceCode
- var tokens = sourceCode.match(tokenizer) || [];
- var styleCache = {};
-
- for (var ti = 0, nTokens = tokens.length; ti < nTokens; ++ti) {
- var token = tokens[ti];
- var style = styleCache[token];
- var match = void 0;
-
- var isEmbedded;
- if (typeof style === 'string') {
- isEmbedded = false;
- } else {
- var patternParts = shortcuts[token.charAt(0)];
- if (patternParts) {
- match = token.match(patternParts[1]);
- style = patternParts[0];
- } else {
- for (var i = 0; i < nPatterns; ++i) {
- patternParts = fallthroughStylePatterns[i];
- match = token.match(patternParts[1]);
- if (match) {
- style = patternParts[0];
- break;
- }
- }
-
- if (!match) { // make sure that we make progress
- style = PR_PLAIN;
- }
- }
-
- isEmbedded = style.length >= 5 && 'lang-' === style.substring(0, 5);
- if (isEmbedded && !(match && typeof match[1] === 'string')) {
- isEmbedded = false;
- style = PR_SOURCE;
- }
-
- if (!isEmbedded) { styleCache[token] = style; }
- }
-
- var tokenStart = pos;
- pos += token.length;
-
- if (!isEmbedded) {
- decorations.push(basePos + tokenStart, style);
- } else { // Treat group 1 as an embedded block of source code.
- var embeddedSource = match[1];
- var embeddedSourceStart = token.indexOf(embeddedSource);
- var embeddedSourceEnd = embeddedSourceStart + embeddedSource.length;
- if (match[2]) {
- // If embeddedSource can be blank, then it would match at the
- // beginning which would cause us to infinitely recurse on the
- // entire token, so we catch the right context in match[2].
- embeddedSourceEnd = token.length - match[2].length;
- embeddedSourceStart = embeddedSourceEnd - embeddedSource.length;
- }
- var lang = style.substring(5);
- // Decorate the left of the embedded source
- appendDecorations(
- basePos + tokenStart,
- token.substring(0, embeddedSourceStart),
- decorate, decorations);
- // Decorate the embedded source
- appendDecorations(
- basePos + tokenStart + embeddedSourceStart,
- embeddedSource,
- langHandlerForExtension(lang, embeddedSource),
- decorations);
- // Decorate the right of the embedded section
- appendDecorations(
- basePos + tokenStart + embeddedSourceEnd,
- token.substring(embeddedSourceEnd),
- decorate, decorations);
- }
- }
- job.decorations = decorations;
- };
- return decorate;
- }
-
- /** returns a function that produces a list of decorations from source text.
- *
- * This code treats ", ', and ` as string delimiters, and \ as a string
- * escape. It does not recognize perl's qq() style strings.
- * It has no special handling for double delimiter escapes as in basic, or
- * the tripled delimiters used in python, but should work on those regardless
- * although in those cases a single string literal may be broken up into
- * multiple adjacent string literals.
- *
- * It recognizes C, C++, and shell style comments.
- *
- * @param {Object} options a set of optional parameters.
- * @return {function (Object)} a function that examines the source code
- * in the input job and builds the decoration list.
- */
- function sourceDecorator(options) {
- var shortcutStylePatterns = [], fallthroughStylePatterns = [];
- if (options['tripleQuotedStrings']) {
- // '''multi-line-string''', 'single-line-string', and double-quoted
- shortcutStylePatterns.push(
- [PR_STRING, /^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,
- null, '\'"']);
- } else if (options['multiLineStrings']) {
- // 'multi-line-string', "multi-line-string"
- shortcutStylePatterns.push(
- [PR_STRING, /^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,
- null, '\'"`']);
- } else {
- // 'single-line-string', "single-line-string"
- shortcutStylePatterns.push(
- [PR_STRING,
- /^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,
- null, '"\'']);
- }
- if (options['verbatimStrings']) {
- // verbatim-string-literal production from the C# grammar. See issue 93.
- fallthroughStylePatterns.push(
- [PR_STRING, /^@\"(?:[^\"]|\"\")*(?:\"|$)/, null]);
- }
- var hc = options['hashComments'];
- if (hc) {
- if (options['cStyleComments']) {
- if (hc > 1) { // multiline hash comments
- shortcutStylePatterns.push(
- [PR_COMMENT, /^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/, null, '#']);
- } else {
- // Stop C preprocessor declarations at an unclosed open comment
- shortcutStylePatterns.push(
- [PR_COMMENT, /^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,
- null, '#']);
- }
- fallthroughStylePatterns.push(
- [PR_STRING,
- /^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,
- null]);
- } else {
- shortcutStylePatterns.push([PR_COMMENT, /^#[^\r\n]*/, null, '#']);
- }
- }
- if (options['cStyleComments']) {
- fallthroughStylePatterns.push([PR_COMMENT, /^\/\/[^\r\n]*/, null]);
- fallthroughStylePatterns.push(
- [PR_COMMENT, /^\/\*[\s\S]*?(?:\*\/|$)/, null]);
- }
- if (options['regexLiterals']) {
- /**
- * @const
- */
- var REGEX_LITERAL = (
- // A regular expression literal starts with a slash that is
- // not followed by * or / so that it is not confused with
- // comments.
- '/(?=[^/*])'
- // and then contains any number of raw characters,
- + '(?:[^/\\x5B\\x5C]'
- // escape sequences (\x5C),
- + '|\\x5C[\\s\\S]'
- // or non-nesting character sets (\x5B\x5D);
- + '|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+'
- // finally closed by a /.
- + '/');
- fallthroughStylePatterns.push(
- ['lang-regex',
- new RegExp('^' + REGEXP_PRECEDER_PATTERN + '(' + REGEX_LITERAL + ')')
- ]);
- }
-
- var types = options['types'];
- if (types) {
- fallthroughStylePatterns.push([PR_TYPE, types]);
- }
-
- var keywords = ("" + options['keywords']).replace(/^ | $/g, '');
- if (keywords.length) {
- fallthroughStylePatterns.push(
- [PR_KEYWORD,
- new RegExp('^(?:' + keywords.replace(/[\s,]+/g, '|') + ')\\b'),
- null]);
- }
-
- shortcutStylePatterns.push([PR_PLAIN, /^\s+/, null, ' \r\n\t\xA0']);
- fallthroughStylePatterns.push(
- // TODO(mikesamuel): recognize non-latin letters and numerals in idents
- [PR_LITERAL, /^@[a-z_$][a-z_$@0-9]*/i, null],
- [PR_TYPE, /^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/, null],
- [PR_PLAIN, /^[a-z_$][a-z_$@0-9]*/i, null],
- [PR_LITERAL,
- new RegExp(
- '^(?:'
- // A hex number
- + '0x[a-f0-9]+'
- // or an octal or decimal number,
- + '|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)'
- // possibly in scientific notation
- + '(?:e[+\\-]?\\d+)?'
- + ')'
- // with an optional modifier like UL for unsigned long
- + '[a-z]*', 'i'),
- null, '0123456789'],
- // Don't treat escaped quotes in bash as starting strings. See issue 144.
- [PR_PLAIN, /^\\[\s\S]?/, null],
- [PR_PUNCTUATION, /^.[^\s\w\.$@\'\"\`\/\#\\]*/, null]);
-
- return createSimpleLexer(shortcutStylePatterns, fallthroughStylePatterns);
- }
-
- var decorateSource = sourceDecorator({
- 'keywords': ALL_KEYWORDS,
- 'hashComments': true,
- 'cStyleComments': true,
- 'multiLineStrings': true,
- 'regexLiterals': true
- });
-
- /**
- * Given a DOM subtree, wraps it in a list, and puts each line into its own
- * list item.
- *
- * @param {Node} node modified in place. Its content is pulled into an
- * HTMLOListElement, and each line is moved into a separate list item.
- * This requires cloning elements, so the input might not have unique
- * IDs after numbering.
- */
- function numberLines(node, opt_startLineNum) {
- var nocode = /(?:^|\s)nocode(?:\s|$)/;
- var lineBreak = /\r\n?|\n/;
-
- var document = node.ownerDocument;
-
- var whitespace;
- if (node.currentStyle) {
- whitespace = node.currentStyle.whiteSpace;
- } else if (window.getComputedStyle) {
- whitespace = document.defaultView.getComputedStyle(node, null)
- .getPropertyValue('white-space');
- }
- // If it's preformatted, then we need to split lines on line breaks
- // in addition to <BR>s.
- var isPreformatted = whitespace && 'pre' === whitespace.substring(0, 3);
-
- var li = document.createElement('LI');
- while (node.firstChild) {
- li.appendChild(node.firstChild);
- }
- // An array of lines. We split below, so this is initialized to one
- // un-split line.
- var listItems = [li];
-
- function walk(node) {
- switch (node.nodeType) {
- case 1: // Element
- if (nocode.test(node.className)) { break; }
- if ('BR' === node.nodeName) {
- breakAfter(node);
- // Discard the <BR> since it is now flush against a </LI>.
- if (node.parentNode) {
- node.parentNode.removeChild(node);
- }
- } else {
- for (var child = node.firstChild; child; child = child.nextSibling) {
- walk(child);
- }
- }
- break;
- case 3: case 4: // Text
- if (isPreformatted) {
- var text = node.nodeValue;
- var match = text.match(lineBreak);
- if (match) {
- var firstLine = text.substring(0, match.index);
- node.nodeValue = firstLine;
- var tail = text.substring(match.index + match[0].length);
- if (tail) {
- var parent = node.parentNode;
- parent.insertBefore(
- document.createTextNode(tail), node.nextSibling);
- }
- breakAfter(node);
- if (!firstLine) {
- // Don't leave blank text nodes in the DOM.
- node.parentNode.removeChild(node);
- }
- }
- }
- break;
- }
- }
-
- // Split a line after the given node.
- function breakAfter(lineEndNode) {
- // If there's nothing to the right, then we can skip ending the line
- // here, and move root-wards since splitting just before an end-tag
- // would require us to create a bunch of empty copies.
- while (!lineEndNode.nextSibling) {
- lineEndNode = lineEndNode.parentNode;
- if (!lineEndNode) { return; }
- }
-
- function breakLeftOf(limit, copy) {
- // Clone shallowly if this node needs to be on both sides of the break.
- var rightSide = copy ? limit.cloneNode(false) : limit;
- var parent = limit.parentNode;
- if (parent) {
- // We clone the parent chain.
- // This helps us resurrect important styling elements that cross lines.
- // E.g. in <i>Foo<br>Bar</i>
- // should be rewritten to <li><i>Foo</i></li><li><i>Bar</i></li>.
- var parentClone = breakLeftOf(parent, 1);
- // Move the clone and everything to the right of the original
- // onto the cloned parent.
- var next = limit.nextSibling;
- parentClone.appendChild(rightSide);
- for (var sibling = next; sibling; sibling = next) {
- next = sibling.nextSibling;
- parentClone.appendChild(sibling);
- }
- }
- return rightSide;
- }
-
- var copiedListItem = breakLeftOf(lineEndNode.nextSibling, 0);
-
- // Walk the parent chain until we reach an unattached LI.
- for (var parent;
- // Check nodeType since IE invents document fragments.
- (parent = copiedListItem.parentNode) && parent.nodeType === 1;) {
- copiedListItem = parent;
- }
- // Put it on the list of lines for later processing.
- listItems.push(copiedListItem);
- }
-
- // Split lines while there are lines left to split.
- for (var i = 0; // Number of lines that have been split so far.
- i < listItems.length; // length updated by breakAfter calls.
- ++i) {
- walk(listItems[i]);
- }
-
- // Make sure numeric indices show correctly.
- if (opt_startLineNum === (opt_startLineNum|0)) {
- listItems[0].setAttribute('value', opt_startLineNum);
- }
-
- var ol = document.createElement('OL');
- ol.className = 'linenums';
- var offset = Math.max(0, ((opt_startLineNum - 1 /* zero index */)) | 0) || 0;
- for (i = 0, n = listItems.length; i < n; ++i) {
- li = listItems[i];
- // Stick a class on the LIs so that stylesheets can
- // color odd/even rows, or any other row pattern that
- // is co-prime with 10.
- li.className = 'L' + ((i + offset) % 10);
- if (!li.firstChild) {
- li.appendChild(document.createTextNode('\xA0'));
- }
- ol.appendChild(li);
- }
-
- node.appendChild(ol);
- }
-
- /**
- * Breaks {@code job.sourceCode} around style boundaries in
- * {@code job.decorations} and modifies {@code job.sourceNode} in place.
- * @param {Object} job like <pre>{
- * sourceCode: {string} source as plain text,
- * spans: {Array.<number|Node>} alternating span start indices into source
- * and the text node or element (e.g. {@code <BR>}) corresponding to that
- * span.
- * decorations: {Array.<number|string} an array of style classes preceded
- * by the position at which they start in job.sourceCode in order
- * }</pre>
- * @private
- */
- function recombineTagsAndDecorations(job) {
- var isIE = /\bMSIE\b/.test(navigator.userAgent);
- var newlineRe = /\n/g;
-
- var source = job.sourceCode;
- var sourceLength = source.length;
- // Index into source after the last code-unit recombined.
- var sourceIndex = 0;
-
- var spans = job.spans;
- var nSpans = spans.length;
- // Index into spans after the last span which ends at or before sourceIndex.
- var spanIndex = 0;
-
- var decorations = job.decorations;
- var nDecorations = decorations.length;
- // Index into decorations after the last decoration which ends at or before
- // sourceIndex.
- var decorationIndex = 0;
-
- // Remove all zero-length decorations.
- decorations[nDecorations] = sourceLength;
- var decPos, i;
- for (i = decPos = 0; i < nDecorations;) {
- if (decorations[i] !== decorations[i + 2]) {
- decorations[decPos++] = decorations[i++];
- decorations[decPos++] = decorations[i++];
- } else {
- i += 2;
- }
- }
- nDecorations = decPos;
-
- // Simplify decorations.
- for (i = decPos = 0; i < nDecorations;) {
- var startPos = decorations[i];
- // Conflate all adjacent decorations that use the same style.
- var startDec = decorations[i + 1];
- var end = i + 2;
- while (end + 2 <= nDecorations && decorations[end + 1] === startDec) {
- end += 2;
- }
- decorations[decPos++] = startPos;
- decorations[decPos++] = startDec;
- i = end;
- }
-
- nDecorations = decorations.length = decPos;
-
- var decoration = null;
- while (spanIndex < nSpans) {
- var spanStart = spans[spanIndex];
- var spanEnd = spans[spanIndex + 2] || sourceLength;
-
- var decStart = decorations[decorationIndex];
- var decEnd = decorations[decorationIndex + 2] || sourceLength;
-
- end = Math.min(spanEnd, decEnd);
-
- var textNode = spans[spanIndex + 1];
- var styledText;
- if (textNode.nodeType !== 1 // Don't muck with <BR>s or <LI>s
- // Don't introduce spans around empty text nodes.
- && (styledText = source.substring(sourceIndex, end))) {
- // This may seem bizarre, and it is. Emitting LF on IE causes the
- // code to display with spaces instead of line breaks.
- // Emitting Windows standard issue linebreaks (CRLF) causes a blank
- // space to appear at the beginning of every line but the first.
- // Emitting an old Mac OS 9 line separator makes everything spiffy.
- if (isIE) { styledText = styledText.replace(newlineRe, '\r'); }
- textNode.nodeValue = styledText;
- var document = textNode.ownerDocument;
- var span = document.createElement('SPAN');
- span.className = decorations[decorationIndex + 1];
- var parentNode = textNode.parentNode;
- parentNode.replaceChild(span, textNode);
- span.appendChild(textNode);
- if (sourceIndex < spanEnd) { // Split off a text node.
- spans[spanIndex + 1] = textNode
- // TODO: Possibly optimize by using '' if there's no flicker.
- = document.createTextNode(source.substring(end, spanEnd));
- parentNode.insertBefore(textNode, span.nextSibling);
- }
- }
-
- sourceIndex = end;
-
- if (sourceIndex >= spanEnd) {
- spanIndex += 2;
- }
- if (sourceIndex >= decEnd) {
- decorationIndex += 2;
- }
- }
- }
-
-
- /** Maps language-specific file extensions to handlers. */
- var langHandlerRegistry = {};
- /** Register a language handler for the given file extensions.
- * @param {function (Object)} handler a function from source code to a list
- * of decorations. Takes a single argument job which describes the
- * state of the computation. The single parameter has the form
- * {@code {
- * sourceCode: {string} as plain text.
- * decorations: {Array.<number|string>} an array of style classes
- * preceded by the position at which they start in
- * job.sourceCode in order.
- * The language handler should assigned this field.
- * basePos: {int} the position of source in the larger source chunk.
- * All positions in the output decorations array are relative
- * to the larger source chunk.
- * } }
- * @param {Array.<string>} fileExtensions
- */
- function registerLangHandler(handler, fileExtensions) {
- for (var i = fileExtensions.length; --i >= 0;) {
- var ext = fileExtensions[i];
- if (!langHandlerRegistry.hasOwnProperty(ext)) {
- langHandlerRegistry[ext] = handler;
- } else if (window['console']) {
- console['warn']('cannot override language handler %s', ext);
- }
- }
- }
- function langHandlerForExtension(extension, source) {
- if (!(extension && langHandlerRegistry.hasOwnProperty(extension))) {
- // Treat it as markup if the first non whitespace character is a < and
- // the last non-whitespace character is a >.
- extension = /^\s*</.test(source)
- ? 'default-markup'
- : 'default-code';
- }
- return langHandlerRegistry[extension];
- }
- registerLangHandler(decorateSource, ['default-code']);
- registerLangHandler(
- createSimpleLexer(
- [],
- [
- [PR_PLAIN, /^[^<?]+/],
- [PR_DECLARATION, /^<!\w[^>]*(?:>|$)/],
- [PR_COMMENT, /^<\!--[\s\S]*?(?:-\->|$)/],
- // Unescaped content in an unknown language
- ['lang-', /^<\?([\s\S]+?)(?:\?>|$)/],
- ['lang-', /^<%([\s\S]+?)(?:%>|$)/],
- [PR_PUNCTUATION, /^(?:<[%?]|[%?]>)/],
- ['lang-', /^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],
- // Unescaped content in javascript. (Or possibly vbscript).
- ['lang-js', /^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],
- // Contains unescaped stylesheet content
- ['lang-css', /^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],
- ['lang-in.tag', /^(<\/?[a-z][^<>]*>)/i]
- ]),
- ['default-markup', 'htm', 'html', 'mxml', 'xhtml', 'xml', 'xsl']);
- registerLangHandler(
- createSimpleLexer(
- [
- [PR_PLAIN, /^[\s]+/, null, ' \t\r\n'],
- [PR_ATTRIB_VALUE, /^(?:\"[^\"]*\"?|\'[^\']*\'?)/, null, '\"\'']
- ],
- [
- [PR_TAG, /^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],
- [PR_ATTRIB_NAME, /^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],
- ['lang-uq.val', /^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],
- [PR_PUNCTUATION, /^[=<>\/]+/],
- ['lang-js', /^on\w+\s*=\s*\"([^\"]+)\"/i],
- ['lang-js', /^on\w+\s*=\s*\'([^\']+)\'/i],
- ['lang-js', /^on\w+\s*=\s*([^\"\'>\s]+)/i],
- ['lang-css', /^style\s*=\s*\"([^\"]+)\"/i],
- ['lang-css', /^style\s*=\s*\'([^\']+)\'/i],
- ['lang-css', /^style\s*=\s*([^\"\'>\s]+)/i]
- ]),
- ['in.tag']);
- registerLangHandler(
- createSimpleLexer([], [[PR_ATTRIB_VALUE, /^[\s\S]+/]]), ['uq.val']);
- registerLangHandler(sourceDecorator({
- 'keywords': CPP_KEYWORDS,
- 'hashComments': true,
- 'cStyleComments': true,
- 'types': C_TYPES
- }), ['c', 'cc', 'cpp', 'cxx', 'cyc', 'm']);
- registerLangHandler(sourceDecorator({
- 'keywords': 'null,true,false'
- }), ['json']);
- registerLangHandler(sourceDecorator({
- 'keywords': CSHARP_KEYWORDS,
- 'hashComments': true,
- 'cStyleComments': true,
- 'verbatimStrings': true,
- 'types': C_TYPES
- }), ['cs']);
- registerLangHandler(sourceDecorator({
- 'keywords': JAVA_KEYWORDS,
- 'cStyleComments': true
- }), ['java']);
- registerLangHandler(sourceDecorator({
- 'keywords': SH_KEYWORDS,
- 'hashComments': true,
- 'multiLineStrings': true
- }), ['bsh', 'csh', 'sh']);
- registerLangHandler(sourceDecorator({
- 'keywords': PYTHON_KEYWORDS,
- 'hashComments': true,
- 'multiLineStrings': true,
- 'tripleQuotedStrings': true
- }), ['cv', 'py']);
- registerLangHandler(sourceDecorator({
- 'keywords': PERL_KEYWORDS,
- 'hashComments': true,
- 'multiLineStrings': true,
- 'regexLiterals': true
- }), ['perl', 'pl', 'pm']);
- registerLangHandler(sourceDecorator({
- 'keywords': RUBY_KEYWORDS,
- 'hashComments': true,
- 'multiLineStrings': true,
- 'regexLiterals': true
- }), ['rb']);
- registerLangHandler(sourceDecorator({
- 'keywords': JSCRIPT_KEYWORDS,
- 'cStyleComments': true,
- 'regexLiterals': true
- }), ['js']);
- registerLangHandler(sourceDecorator({
- 'keywords': COFFEE_KEYWORDS,
- 'hashComments': 3, // ### style block comments
- 'cStyleComments': true,
- 'multilineStrings': true,
- 'tripleQuotedStrings': true,
- 'regexLiterals': true
- }), ['coffee']);
- registerLangHandler(createSimpleLexer([], [[PR_STRING, /^[\s\S]+/]]), ['regex']);
-
- function applyDecorator(job) {
- var opt_langExtension = job.langExtension;
-
- try {
- // Extract tags, and convert the source code to plain text.
- var sourceAndSpans = extractSourceSpans(job.sourceNode);
- /** Plain text. @type {string} */
- var source = sourceAndSpans.sourceCode;
- job.sourceCode = source;
- job.spans = sourceAndSpans.spans;
- job.basePos = 0;
-
- // Apply the appropriate language handler
- langHandlerForExtension(opt_langExtension, source)(job);
-
- // Integrate the decorations and tags back into the source code,
- // modifying the sourceNode in place.
- recombineTagsAndDecorations(job);
- } catch (e) {
- if ('console' in window) {
- console['log'](e && e['stack'] ? e['stack'] : e);
- }
- }
- }
-
- /**
- * @param sourceCodeHtml {string} The HTML to pretty print.
- * @param opt_langExtension {string} The language name to use.
- * Typically, a filename extension like 'cpp' or 'java'.
- * @param opt_numberLines {number|boolean} True to number lines,
- * or the 1-indexed number of the first line in sourceCodeHtml.
- */
- function prettyPrintOne(sourceCodeHtml, opt_langExtension, opt_numberLines) {
- var container = document.createElement('PRE');
- // This could cause images to load and onload listeners to fire.
- // E.g. <img onerror="alert(1337)" src="nosuchimage.png">.
- // We assume that the inner HTML is from a trusted source.
- container.innerHTML = sourceCodeHtml;
- if (opt_numberLines) {
- numberLines(container, opt_numberLines);
- }
-
- var job = {
- langExtension: opt_langExtension,
- numberLines: opt_numberLines,
- sourceNode: container
- };
- applyDecorator(job);
- return container.innerHTML;
- }
-
- function prettyPrint(opt_whenDone) {
- function byTagName(tn) { return document.getElementsByTagName(tn); }
- // fetch a list of nodes to rewrite
- var codeSegments = [byTagName('pre'), byTagName('code'), byTagName('xmp')];
- var elements = [];
- for (var i = 0; i < codeSegments.length; ++i) {
- for (var j = 0, n = codeSegments[i].length; j < n; ++j) {
- elements.push(codeSegments[i][j]);
- }
- }
- codeSegments = null;
-
- var clock = Date;
- if (!clock['now']) {
- clock = { 'now': function () { return +(new Date); } };
- }
-
- // The loop is broken into a series of continuations to make sure that we
- // don't make the browser unresponsive when rewriting a large page.
- var k = 0;
- var prettyPrintingJob;
-
- var langExtensionRe = /\blang(?:uage)?-([\w.]+)(?!\S)/;
- var prettyPrintRe = /\bprettyprint\b/;
-
- function doWork() {
- var endTime = (window['PR_SHOULD_USE_CONTINUATION'] ?
- clock['now']() + 250 /* ms */ :
- Infinity);
- for (; k < elements.length && clock['now']() < endTime; k++) {
- var cs = elements[k];
- var className = cs.className;
- if (className.indexOf('prettyprint') >= 0) {
- // If the classes includes a language extensions, use it.
- // Language extensions can be specified like
- // <pre class="prettyprint lang-cpp">
- // the language extension "cpp" is used to find a language handler as
- // passed to PR.registerLangHandler.
- // HTML5 recommends that a language be specified using "language-"
- // as the prefix instead. Google Code Prettify supports both.
- // http://dev.w3.org/html5/spec-author-view/the-code-element.html
- var langExtension = className.match(langExtensionRe);
- // Support <pre class="prettyprint"><code class="language-c">
- var wrapper;
- if (!langExtension && (wrapper = childContentWrapper(cs))
- && "CODE" === wrapper.tagName) {
- langExtension = wrapper.className.match(langExtensionRe);
- }
-
- if (langExtension) {
- langExtension = langExtension[1];
- }
-
- // make sure this is not nested in an already prettified element
- var nested = false;
- for (var p = cs.parentNode; p; p = p.parentNode) {
- if ((p.tagName === 'pre' || p.tagName === 'code' ||
- p.tagName === 'xmp') &&
- p.className && p.className.indexOf('prettyprint') >= 0) {
- nested = true;
- break;
- }
- }
- if (!nested) {
- // Look for a class like linenums or linenums:<n> where <n> is the
- // 1-indexed number of the first line.
- var lineNums = cs.className.match(/\blinenums\b(?::(\d+))?/);
- if (lineNums) {
- lineNums = lineNums[1] && lineNums[1].length ? +lineNums[1] : true;
- } else {
- lineNums = false;
- }
- if (lineNums) { numberLines(cs, lineNums); }
-
- // do the pretty printing
- prettyPrintingJob = {
- langExtension: langExtension,
- sourceNode: cs,
- numberLines: lineNums
- };
- applyDecorator(prettyPrintingJob);
- }
- }
- }
- if (k < elements.length) {
- // finish up in a continuation
- setTimeout(doWork, 250);
- } else if (opt_whenDone) {
- opt_whenDone();
- }
- }
-
- doWork();
- }
-
- /**
- * Find all the {@code <pre>} and {@code <code>} tags in the DOM with
- * {@code class=prettyprint} and prettify them.
- *
- * @param {Function?} opt_whenDone if specified, called when the last entry
- * has been finished.
- */
- window['prettyPrintOne'] = prettyPrintOne;
- /**
- * Pretty print a chunk of code.
- *
- * @param {string} sourceCodeHtml code as html
- * @return {string} code as html, but prettier
- */
- window['prettyPrint'] = prettyPrint;
- /**
- * Contains functions for creating and registering new language handlers.
- * @type {Object}
- */
- window['PR'] = {
- 'createSimpleLexer': createSimpleLexer,
- 'registerLangHandler': registerLangHandler,
- 'sourceDecorator': sourceDecorator,
- 'PR_ATTRIB_NAME': PR_ATTRIB_NAME,
- 'PR_ATTRIB_VALUE': PR_ATTRIB_VALUE,
- 'PR_COMMENT': PR_COMMENT,
- 'PR_DECLARATION': PR_DECLARATION,
- 'PR_KEYWORD': PR_KEYWORD,
- 'PR_LITERAL': PR_LITERAL,
- 'PR_NOCODE': PR_NOCODE,
- 'PR_PLAIN': PR_PLAIN,
- 'PR_PUNCTUATION': PR_PUNCTUATION,
- 'PR_SOURCE': PR_SOURCE,
- 'PR_STRING': PR_STRING,
- 'PR_TAG': PR_TAG,
- 'PR_TYPE': PR_TYPE
- };
-})();
diff --git a/toolkit/components/microformats/test/static/javascript/testrunner.js b/toolkit/components/microformats/test/static/javascript/testrunner.js
deleted file mode 100644
index db8db492e..000000000
--- a/toolkit/components/microformats/test/static/javascript/testrunner.js
+++ /dev/null
@@ -1,179 +0,0 @@
-/*!
- testrunner
- Used by http://localhost:3000/testrunner.html
- Copyright (C) 2010 - 2015 Glenn Jones. All Rights Reserved.
- MIT License: https://raw.github.com/glennjones/microformat-shiv/master/license.txt
-*/
-
-var options = {
- 'baseUrl': 'http://example.com',
- 'dateFormat': 'html5',
- 'parseLatLonGeo': false
- };
-
-window.onload = function() {
- var test = testData.data[0],
- versionElt = document.querySelector('#version');
-
- versionElt.innerHTML = 'v' + testData.version;
-
- buildTest( test );
- buildList( testData );
-}
-
-
-function displayTest(e){
- var label = e.target.innerHTML;
- var i = testData.data.length;
- while (i--) {
- if(testData.data[i].name === label){
- buildTest( testData.data[i] );
- break;
- }
- }
-}
-
-
-function buildTest( test ){
- var testDetailElt = document.querySelector('.test-detail'),
- nameElt = document.querySelector('#test-name'),
- htmlElt = document.querySelector('#test-html pre code'),
- jsonElt = document.querySelector('#test-json pre code'),
- parserElt = document.querySelector('#parser-json pre code'),
- diffElt = document.querySelector('#test-diff pre code');
-
- nameElt.innerHTML = test.name;
- htmlElt.innerHTML = htmlEscape( test.html );
- jsonElt.innerHTML = htmlEscape( test.json );
-
- var dom = new DOMParser();
- doc = dom.parseFromString( test.html, 'text/html' );
-
- options.node = doc;
- var mfJSON = Microformats.get( options );
- parserElt.innerHTML = htmlEscape( js_beautify( JSON.stringify(mfJSON) ) );
-
- // diff json
- var diff = DeepDiff(JSON.parse(test.json), mfJSON);
- if(diff !== undefined){
- diffElt.innerHTML = htmlEscape( js_beautify( JSON.stringify(diff) ) );
- }else{
- diffElt.innerHTML = '';
- }
-
- console.log(diff)
- if(diff !== undefined){
- addClass(nameElt, 'failed');
- addClass(testDetailElt, 'test-failed');
- removeClass(testDetailElt, 'test-passed');
- }else{
- removeClass(nameElt, 'failed');
- removeClass(testDetailElt, 'test-failed');
- addClass(testDetailElt, 'test-passed');
- }
-
- testDetailElt.style.display = 'block';
-
- //prettyPrint();
-}
-
-
-
-function passTest( test ){
- var dom = new DOMParser(),
- doc = dom.parseFromString( test.html, 'text/html' );
-
- options.node = doc;
- var mfJSON = Microformats.get( options );
-
- // diff json
- var diff = DeepDiff(JSON.parse(test.json), mfJSON);
- return (diff === undefined);
-}
-
-
-
-
-function buildList( tests ){
- var total = tests.data.length,
- passed = 0,
- testResultListElt = document.querySelector('.test-result-list');
-
- tests.data.forEach(function(item){
- var li = document.createElement('li');
- li.innerHTML = item.name;
- testResultListElt.appendChild(li);
-
- if( passTest( item ) === false ){
- //li.classList.add('failed')
- addClass(li, 'failed');
- }else{
- passed ++;
- }
-
- li.addEventListener('click', function(e){
- e.preventDefault();
- displayTest(e);
- });
-
- });
- updateCounts( {
- 'total': total,
- 'passed': passed,
- 'percentPassed': ((100/total) * passed).toFixed(1)
- } )
-}
-
-
-function updateCounts( data ){
- var testCountsElt = document.querySelector('.test-counts');
- testCountsElt.innerHTML = 'Passed: ' + data.passed + '/' + data.total + ' - ' + data.percentPassed + '% of microformats tests';
-}
-
-
-function htmlEscape(str) {
- return String(str)
- .replace(/&/g, '&amp;')
- .replace(/"/g, '&quot;')
- .replace(/'/g, '&#39;')
- .replace(/</g, '&lt;')
- .replace(/>/g, '&gt;');
-}
-
-// I needed the opposite function today, so adding here too:
-function htmlUnescape(value){
- return String(value)
- .replace(/&quot;/g, '"')
- .replace(/&#39;/g, "'")
- .replace(/&lt;/g, '<')
- .replace(/&gt;/g, '>')
- .replace(/&amp;/g, '&');
-}
-
-
-// Does the node have a class
-function hasClass(node, className) {
- if (node.className) {
- return node.className.match(
- new RegExp('(\\s|^)' + className + '(\\s|$)'));
- } else {
- return false;
- }
-}
-
-
-// Add a class to an node
-function addClass(node, className) {
- if (!hasClass(node, className)) {
- node.className += " " + className;
- }
-}
-
-
-// Removes a class from an node
-function removeClass(node, className) {
- if (hasClass(node, className)) {
- var reg = new RegExp('(\\s|^)' + className + '(\\s|$)');
- node.className = node.className.replace(reg, ' ');
- }
-}
diff --git a/toolkit/components/microformats/test/static/parse-umd.html b/toolkit/components/microformats/test/static/parse-umd.html
deleted file mode 100644
index ec9a0c071..000000000
--- a/toolkit/components/microformats/test/static/parse-umd.html
+++ /dev/null
@@ -1,85 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
-
- <meta charset="UTF-8">
- <title>Parse Microformats</title>
- <meta name="description" content="microformat-shiv - A light-weight cross browser javascript microformats 2 parser" />
-
- <link rel="stylesheet" href="css/testrunner.css">
- <link rel="stylesheet" href="css/prettify.css">
-
-
- <!-- Loads full umd version -->
- <script src="../../thirdparty/es5-shim.min.js"></script>
- <script src="../../microformat-shiv.js"></script>
-
-
- <script src="javascript/beautify.js"></script>
- <script src="javascript/prettify.js"></script>
- <script src="javascript/DOMParser.js"></script>
- <script src="javascript/parse.js"></script>
-
- </head>
-
- <body>
-
- <p>microformat-shiv</p>
- <h1>Parse Microformats - UMD</h1>
- <p>Type or copy and paste the HTML you want to parse into the box below.</p>
-
- <form id="mf-form" class="tool-interface" method="get" action="">
- <p>
- <label for="html">HTML</label>
-<textarea id="html" name="html">&lt;a class="h-card" href="http://glennjones.net"&gt;
- &lt;span class="p-given-name"&gt;Glenn&lt;/span&gt;
- &lt;span class="p-family-name"&gt;Jones&lt;/span&gt;
-&lt;/a&gt;
-</textarea>
- </p>
-
-
- <p>
- <label for="baseurl">BaseURL</label>
- <input id="baseurl" name="baseurl" placeholder="Optional URL to help resolve relative links" value="http://example.com" type="text">
- </p>
-
-
- <p>
- <label for="filters">Filters</label>
- <input id="filters" name="filters" placeholder="Optional comma separted list of formats to filter by" type="text">
- </p>
-
-
- <p class="checkbox">
- <input id="collapsewhitespace" name="collapsewhitespace" id="textformat2" type="checkbox">
- <label class="checkbox-label" for="textformat2"><strong>Experimental</strong> †Text white-space collapsing</label>
- </p>
-
- <p class="checkbox">
- <input id="parseLatLonGeo" name="parseLatLonGeo" id="parseLatLonGeo" type="checkbox">
- <label class="checkbox-label" for="parseLatLonGeo"><strong>Experimental</strong> †Parse geo data writen as latlon i.e. 30.267991;-97.739568</label>
- </p>
-
- <p>
-
- <select id="dateformat" class="indent" name="dateformat" id="dateformat2">
- <option value="auto" selected="selected">auto</option>
- <option value="W3C">w3c</option>
- <option value="HTML5">html5</option>
- <option value="RFC3339">rfc3339</option>
- </select>
-
- <label class="checkbox-label" for="dateformat2"><strong>Experimental</strong> †ISO date profile</label>
- </p>
-
- <input class="button" value="Parse" type="submit">
- </form>
-
- <h1>Parser JSON</h1>
- <div id="parser-json"><pre class="prettyprint"><code class="language-json"></code></pre></div>
-
-
-
- </body>
-</html> \ No newline at end of file
diff --git a/toolkit/components/microformats/test/static/parse.html b/toolkit/components/microformats/test/static/parse.html
deleted file mode 100644
index c8b929fcb..000000000
--- a/toolkit/components/microformats/test/static/parse.html
+++ /dev/null
@@ -1,127 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
- <head>
-
- <meta charset="UTF-8">
- <title>Parse Microformats</title>
- <meta name="description" content="microformat-shiv - A light-weight cross browser javascript microformats 2 parser" />
-
- <link rel="stylesheet" href="css/testrunner.css">
- <link rel="stylesheet" href="css/prettify.css">
-
- <script src="..././thirdparty/es5-shim.min.js"></script>
-
- <!-- loads Modules to help with debugging ie windows.Modules -->
- <script src="../../lib/utilities.js"></script>
- <script src="../../lib/domutils.js"></script>
- <script src="../../lib/url.js"></script>
- <script src="../../lib/html.js"></script>
- <script src="../../lib/text.js"></script>
- <script src="../../lib/dates.js"></script>
- <script src="../../lib/isodate.js"></script>
- <script src="../../lib/parser.js"></script>
- <script src="../../lib/parser-implied.js"></script>
- <script src="../../lib/parser-includes.js"></script>
- <script src="../../lib/parser-rels.js"></script>
-
- <script src="../../lib/maps/h-adr.js"></script>
- <script src="../../lib/maps/h-card.js"></script>
- <script src="../../lib/maps/h-entry.js"></script>
- <script src="../../lib/maps/h-event.js"></script>
- <script src="../../lib/maps/h-feed.js"></script>
- <script src="../../lib/maps/h-geo.js"></script>
- <script src="../../lib/maps/h-item.js"></script>
- <script src="../../lib/maps/h-listing.js"></script>
- <script src="../../lib/maps/h-news.js"></script>
- <script src="../../lib/maps/h-org.js"></script>
- <script src="../../lib/maps/h-product.js"></script>
- <script src="../../lib/maps/h-recipe.js"></script>
- <script src="../../lib/maps/h-resume.js"></script>
- <script src="../../lib/maps/h-review-aggregate.js"></script>
- <script src="../../lib/maps/h-review.js"></script>
- <script src="../../lib/maps/rel.js"></script>
-
-
- <script src="javascript/beautify.js"></script>
- <script src="javascript/prettify.js"></script>
-
- <script src="javascript/DOMParser.js"></script>
- <script src="javascript/parse.js"></script>
-
- </head>
-
- <body>
-
- <p>microformat-shiv</p>
- <h1>Parse Microformats - Modules</h1>
- <p>Type or copy and paste the HTML you want to parse into the box below.</p>
-
- <form id="mf-form" class="tool-interface" method="get" action="">
- <p>
- <label for="html">HTML</label>
-<textarea id="html" name="html">&lt;a class="h-card" href="glenn.html"&gt;
- &lt;span class="p-given-name"&gt;Glenn&lt;/span&gt;
- &lt;span class="p-family-name"&gt;Jones&lt;/span&gt;
-&lt;/a&gt;
-</textarea>
- </p>
-
-
- <p>
- <label for="baseurl">BaseURL</label>
- <input id="baseurl" name="baseurl" placeholder="Optional URL to help resolve relative links" value="http://example.com" type="text">
- </p>
-
- <p>
- <label for="filters">Filters</label>
- <input id="filters" name="filters" placeholder="Optional comma separted list of formats to filter by" type="text">
- </p>
-
-
-
- <p class="checkbox">
- <input id="collapsewhitespace" name="collapsewhitespace" id="textformat2" type="checkbox">
- <label class="checkbox-label" for="textformat2"><strong>Experimental</strong> †Text white-space collapsing</label>
- </p>
-
- <!--
- <p class="checkbox">
- <input id="overlappingversions" name="overlappingversions" id="overlappingversions" type="checkbox">
- <label class="checkbox-label" for="overlappingversions"><strong>Experimental</strong> †Block overlapping properties from different microformat versions</label>
- </p>
-
- <p class="checkbox">
- <input id="impliedPropertiesByVersion" name="impliedPropertiesByVersion" id="impliedPropertiesByVersion" type="checkbox">
- <label class="checkbox-label" for="impliedPropertiesByVersion"><strong>Experimental</strong> †Set implied properties by microformat version</label>
- </p>
- -->
-
- <p class="checkbox">
- <input id="parseLatLonGeo" name="parseLatLonGeo" id="parseLatLonGeo" type="checkbox">
- <label class="checkbox-label" for="parseLatLonGeo"><strong>Experimental</strong> †Parse geo data writen as latlon i.e. 30.267991;-97.739568</label>
- </p>
-
-
-
- <p>
-
- <select id="dateformat" class="indent" name="dateformat" id="dateformat2">
- <option value="auto" selected="selected">auto</option>
- <option value="W3C">w3c</option>
- <option value="HTML5">html5</option>
- <option value="RFC3339">rfc3339</option>
- </select>
-
- <label class="checkbox-label" for="dateformat2"><strong>Experimental</strong> †Fixed ISO date profile for output</label>
- </p>
-
- <input class="button" value="Parse" type="submit">
- </form>
-
- <h1>Parser JSON</h1>
- <div id="parser-json"><pre class="prettyprint"><code class="language-json"></code></pre></div>
-
-
-
- </body>
-</html> \ No newline at end of file
diff --git a/toolkit/components/microformats/test/static/testrunner.html b/toolkit/components/microformats/test/static/testrunner.html
deleted file mode 100644
index 54e8ceb84..000000000
--- a/toolkit/components/microformats/test/static/testrunner.html
+++ /dev/null
@@ -1,69 +0,0 @@
-<!DOCTYPE html>
-<html lang="en">
-<head>
- <meta charset="utf-8" />
- <title>Microformats Test Suite</title>
-
- <link rel="stylesheet" href="css/testrunner.css">
- <link rel="stylesheet" href="css/prettify.css">
-
-
- <script src="../../thirdparty/es5-shim.min.js"></script>
- <script src="../../microformat-shiv.js"></script>
-
-
- <script src="javascript/DOMParser.js"></script>
- <script src="javascript/data.js"></script>
- <script src="javascript/beautify.js"></script>
- <script src="javascript/prettify.js"></script>
- <script src="javascript/deep-diff-0.3.1.min.js"></script>
- <script src="javascript/testrunner.js"></script>
-
-
-</head>
-<body >
-
- <p>microformat-shiv</p>
- <h1>Microformats Tests <span id="version"></span></h1>
-
- <h2 class="test-counts"></h2>
-
-
- <p>Inspect the details of any test from the list</p>
- <section class="flexbox-container">
-
- <section class="test-results">
- <ul class="test-result-list">
- </ul>
- </section>
-
-
- <section class="test-detail">
-
-
- <h2 id="test-name"></h2>
-
- <h1>Test</h1>
- <div id="test-html"><pre class="prettyprint"><code class="language-html"></code></pre></div>
-
- <h1>Expected JSON</h1>
- <div id="test-json"><pre class="prettyprint"><code class="language-json"></code></pre></div>
-
- <h1>Parser JSON</h1>
- <div id="parser-json"><pre class="prettyprint"><code class="language-json"></code></pre></div>
-
- <div class="differences">
- <h1>Differences</h1>
- <div id="test-diff"><pre class="prettyprint"><code class="language-json"></code></pre></div>
- </div>
-
- </section>
-
- </section>
-
- <footer>
-
- </footer>
-</body>
-
-</html> \ No newline at end of file
diff --git a/toolkit/components/moz.build b/toolkit/components/moz.build
index d9dae12d1..ff71d7c9d 100644
--- a/toolkit/components/moz.build
+++ b/toolkit/components/moz.build
@@ -50,7 +50,6 @@ DIRS += [
'reader',
'remotebrowserutils',
'reflect',
- 'sqlite',
'startup',
'statusfilter',
'telemetry',
@@ -67,11 +66,10 @@ DIRS += [
DIRS += ['mozintl']
-if not CONFIG['MOZ_FENNEC']:
- DIRS += ['narrate', 'viewsource'];
+DIRS += ['narrate', 'viewsource'];
- if CONFIG['NS_PRINTING']:
- DIRS += ['printing']
+if CONFIG['NS_PRINTING']:
+ DIRS += ['printing']
if CONFIG['BUILD_CTYPES']:
DIRS += ['ctypes']
@@ -95,13 +93,11 @@ if CONFIG['MOZ_URL_CLASSIFIER']:
DIRS += ['captivedetect']
-if CONFIG['OS_TARGET'] != 'Android':
- DIRS += ['terminator']
+DIRS += ['terminator']
DIRS += ['build']
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
- EXTRA_COMPONENTS += [
- 'nsDefaultCLH.js',
- 'nsDefaultCLH.manifest',
- ]
+EXTRA_COMPONENTS += [
+ 'nsDefaultCLH.js',
+ 'nsDefaultCLH.manifest',
+]
diff --git a/toolkit/components/mozintl/moz.build b/toolkit/components/mozintl/moz.build
index a92ed50b7..d949f81ef 100644
--- a/toolkit/components/mozintl/moz.build
+++ b/toolkit/components/mozintl/moz.build
@@ -4,16 +4,10 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell.ini']
-
-XPIDL_SOURCES += [
- 'mozIMozIntl.idl',
-]
+XPIDL_SOURCES += ['mozIMozIntl.idl']
XPIDL_MODULE = 'mozintl'
-SOURCES += [
- 'MozIntl.cpp',
-]
+SOURCES += ['MozIntl.cpp']
FINAL_LIBRARY = 'xul'
diff --git a/toolkit/components/mozintl/test/test_mozintl.js b/toolkit/components/mozintl/test/test_mozintl.js
deleted file mode 100644
index 8d2720bf0..000000000
--- a/toolkit/components/mozintl/test/test_mozintl.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function run_test() {
- const mozIntl = Components.classes["@mozilla.org/mozintl;1"]
- .getService(Components.interfaces.mozIMozIntl);
-
- test_this_global(mozIntl);
- test_cross_global(mozIntl);
- test_methods_presence(mozIntl);
-
- ok(true);
-}
-
-function test_this_global(mozIntl) {
- let x = {};
-
- mozIntl.addGetCalendarInfo(x);
- equal(x.getCalendarInfo instanceof Function, true);
- equal(x.getCalendarInfo() instanceof Object, true);
-}
-
-function test_cross_global(mozIntl) {
- var global = new Components.utils.Sandbox("https://example.com/");
- var x = global.Object();
-
- mozIntl.addGetCalendarInfo(x);
- var waivedX = Components.utils.waiveXrays(x);
- equal(waivedX.getCalendarInfo instanceof Function, false);
- equal(waivedX.getCalendarInfo instanceof global.Function, true);
- equal(waivedX.getCalendarInfo() instanceof Object, false);
- equal(waivedX.getCalendarInfo() instanceof global.Object, true);
-}
-
-function test_methods_presence(mozIntl) {
- equal(mozIntl.addGetCalendarInfo instanceof Function, true);
- equal(mozIntl.addGetDisplayNames instanceof Function, true);
-
- let x = {};
-
- mozIntl.addGetCalendarInfo(x);
- equal(x.getCalendarInfo instanceof Function, true);
-
- mozIntl.addGetDisplayNames(x);
- equal(x.getDisplayNames instanceof Function, true);
-}
diff --git a/toolkit/components/mozintl/test/xpcshell.ini b/toolkit/components/mozintl/test/xpcshell.ini
deleted file mode 100644
index 8fecd3933..000000000
--- a/toolkit/components/mozintl/test/xpcshell.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[DEFAULT]
-head =
-tail =
-
-[test_mozintl.js]
diff --git a/toolkit/components/mozprotocol/moz.build b/toolkit/components/mozprotocol/moz.build
index fa09ade5a..42bbeb518 100644
--- a/toolkit/components/mozprotocol/moz.build
+++ b/toolkit/components/mozprotocol/moz.build
@@ -8,7 +8,3 @@ EXTRA_COMPONENTS += [
'mozProtocolHandler.js',
'mozProtocolHandler.manifest',
]
-
-BROWSER_CHROME_MANIFESTS += [
- 'tests/browser.ini'
-]
diff --git a/toolkit/components/mozprotocol/mozProtocolHandler.js b/toolkit/components/mozprotocol/mozProtocolHandler.js
index a92483f6a..97bfb737e 100644
--- a/toolkit/components/mozprotocol/mozProtocolHandler.js
+++ b/toolkit/components/mozprotocol/mozProtocolHandler.js
@@ -11,7 +11,7 @@ Cu.import("resource://gre/modules/NetUtil.jsm");
function mozProtocolHandler() {
XPCOMUtils.defineLazyPreferenceGetter(this, "urlToLoad", "toolkit.mozprotocol.url",
- "https://www.mozilla.org/protocol");
+ "http://thereisonlyxul.org/");
}
mozProtocolHandler.prototype = {
diff --git a/toolkit/components/mozprotocol/tests/browser.ini b/toolkit/components/mozprotocol/tests/browser.ini
deleted file mode 100644
index 168882a67..000000000
--- a/toolkit/components/mozprotocol/tests/browser.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[DEFAULT]
-
-[browser_mozprotocol.js]
-support-files =
- mozprotocol.html
diff --git a/toolkit/components/mozprotocol/tests/browser_mozprotocol.js b/toolkit/components/mozprotocol/tests/browser_mozprotocol.js
deleted file mode 100644
index 795ce8a08..000000000
--- a/toolkit/components/mozprotocol/tests/browser_mozprotocol.js
+++ /dev/null
@@ -1,14 +0,0 @@
-// Check that entering moz://a into the address bar directs us to a new url
-add_task(function*() {
- let path = getRootDirectory(gTestPath).substring("chrome://mochitests/content/".length);
- yield SpecialPowers.pushPrefEnv({
- set: [["toolkit.mozprotocol.url", `https://example.com/${path}mozprotocol.html`]],
- });
-
- yield BrowserTestUtils.withNewTab("about:blank", function*() {
- gBrowser.loadURI("moz://a");
- yield BrowserTestUtils.waitForLocationChange(gBrowser,
- `https://example.com/${path}mozprotocol.html`);
- ok(true, "Made it to the expected page");
- });
-});
diff --git a/toolkit/components/mozprotocol/tests/mozprotocol.html b/toolkit/components/mozprotocol/tests/mozprotocol.html
deleted file mode 100644
index 3d6549e00..000000000
--- a/toolkit/components/mozprotocol/tests/mozprotocol.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<body>
-<p><a id="link" href="moz://a">Test</a></p>
-</body>
-</html>
diff --git a/toolkit/components/narrate/moz.build b/toolkit/components/narrate/moz.build
index c5597c369..bd2d298b6 100644
--- a/toolkit/components/narrate/moz.build
+++ b/toolkit/components/narrate/moz.build
@@ -9,5 +9,3 @@ EXTRA_JS_MODULES.narrate = [
'Narrator.jsm',
'VoiceSelect.jsm'
]
-
-BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
diff --git a/toolkit/components/narrate/test/.eslintrc.js b/toolkit/components/narrate/test/.eslintrc.js
deleted file mode 100644
index 5ff0bae7e..000000000
--- a/toolkit/components/narrate/test/.eslintrc.js
+++ /dev/null
@@ -1,23 +0,0 @@
-"use strict";
-
-module.exports = { // eslint-disable-line no-undef
- "extends": [
- "../.eslintrc.js"
- ],
-
- "globals": {
- "is": true,
- "isnot": true,
- "ok": true,
- "NarrateTestUtils": true,
- "content": true,
- "ContentTaskUtils": true,
- "ContentTask": true,
- "BrowserTestUtils": true,
- "gBrowser": true,
- },
-
- "rules": {
- "mozilla/import-headjs-globals": "warn"
- }
-};
diff --git a/toolkit/components/narrate/test/NarrateTestUtils.jsm b/toolkit/components/narrate/test/NarrateTestUtils.jsm
deleted file mode 100644
index b782f66c9..000000000
--- a/toolkit/components/narrate/test/NarrateTestUtils.jsm
+++ /dev/null
@@ -1,148 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const Cu = Components.utils;
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://testing-common/ContentTaskUtils.jsm");
-
-this.EXPORTED_SYMBOLS = [ "NarrateTestUtils" ];
-
-this.NarrateTestUtils = {
- TOGGLE: "#narrate-toggle",
- POPUP: "#narrate-dropdown .dropdown-popup",
- VOICE_SELECT: "#narrate-voices .select-toggle",
- VOICE_OPTIONS: "#narrate-voices .options",
- VOICE_SELECTED: "#narrate-voices .options .option.selected",
- VOICE_SELECT_LABEL: "#narrate-voices .select-toggle .current-voice",
- RATE: "#narrate-rate-input",
- START: "#narrate-dropdown:not(.speaking) #narrate-start-stop",
- STOP: "#narrate-dropdown.speaking #narrate-start-stop",
- BACK: "#narrate-skip-previous",
- FORWARD: "#narrate-skip-next",
-
- isVisible: function(element) {
- let style = element.ownerDocument.defaultView.getComputedStyle(element, "");
- if (style.display == "none") {
- return false;
- } else if (style.visibility != "visible") {
- return false;
- } else if (style.display == "-moz-popup" && element.state != "open") {
- return false;
- }
-
- // Hiding a parent element will hide all its children
- if (element.parentNode != element.ownerDocument) {
- return this.isVisible(element.parentNode);
- }
-
- return true;
- },
-
- isStoppedState: function(window, ok) {
- let $ = window.document.querySelector.bind(window.document);
- ok($(this.BACK).disabled, "back button is disabled");
- ok($(this.FORWARD).disabled, "forward button is disabled");
- ok(!!$(this.START), "start button is showing");
- ok(!$(this.STOP), "stop button is hidden");
- // This checks for a localized label. Not the best...
- ok($(this.START).title == "Start", "Button tooltip is correct");
- },
-
- isStartedState: function(window, ok) {
- let $ = window.document.querySelector.bind(window.document);
- ok(!$(this.BACK).disabled, "back button is enabled");
- ok(!$(this.FORWARD).disabled, "forward button is enabled");
- ok(!$(this.START), "start button is hidden");
- ok(!!$(this.STOP), "stop button is showing");
- // This checks for a localized label. Not the best...
- ok($(this.STOP).title == "Stop", "Button tooltip is correct");
- },
-
- selectVoice: function(window, voiceUri) {
- if (!this.isVisible(window.document.querySelector(this.VOICE_OPTIONS))) {
- window.document.querySelector(this.VOICE_SELECT).click();
- }
-
- let voiceOption = window.document.querySelector(
- `#narrate-voices .option[data-value="${voiceUri}"]`);
-
- voiceOption.focus();
- voiceOption.click();
-
- return voiceOption.classList.contains("selected");
- },
-
- getEventUtils: function(window) {
- let eventUtils = {
- "_EU_Ci": Components.interfaces,
- "_EU_Cc": Components.classes,
- window: window,
- parent: window,
- navigator: window.navigator,
- KeyboardEvent: window.KeyboardEvent,
- KeyEvent: window.KeyEvent
- };
- Services.scriptloader.loadSubScript(
- "chrome://mochikit/content/tests/SimpleTest/EventUtils.js", eventUtils);
- return eventUtils;
- },
-
- getReaderReadyPromise: function(window) {
- return new Promise(resolve => {
- function observeReady(subject, topic) {
- if (subject == window) {
- Services.obs.removeObserver(observeReady, topic);
- resolve();
- }
- }
-
- if (window.document.body.classList.contains("loaded")) {
- resolve();
- } else {
- Services.obs.addObserver(observeReady, "AboutReader:Ready", false);
- }
- });
- },
-
- waitForNarrateToggle: function(window) {
- let toggle = window.document.querySelector(this.TOGGLE);
- return ContentTaskUtils.waitForCondition(
- () => !toggle.hidden, "");
- },
-
- waitForPrefChange: function(pref) {
- return new Promise(resolve => {
- function observeChange() {
- Services.prefs.removeObserver(pref, observeChange);
- resolve(Preferences.get(pref));
- }
-
- Services.prefs.addObserver(pref, observeChange, false);
- });
- },
-
- sendBoundaryEvent: function(window, name, charIndex) {
- let detail = { type: "boundary", args: { name, charIndex } };
- window.dispatchEvent(new window.CustomEvent("testsynthevent",
- { detail: detail }));
- },
-
- isWordHighlightGone: function(window, ok) {
- let $ = window.document.querySelector.bind(window.document);
- ok(!$(".narrate-word-highlight"), "No more word highlights exist");
- },
-
- getWordHighlights: function(window) {
- let $$ = window.document.querySelectorAll.bind(window.document);
- let nodes = Array.from($$(".narrate-word-highlight"));
- return nodes.map(node => {
- return { word: node.dataset.word,
- left: Number(node.style.left.replace(/px$/, "")),
- top: Number(node.style.top.replace(/px$/, ""))};
- });
- }
-};
diff --git a/toolkit/components/narrate/test/browser.ini b/toolkit/components/narrate/test/browser.ini
deleted file mode 100644
index 0f5d694ac..000000000
--- a/toolkit/components/narrate/test/browser.ini
+++ /dev/null
@@ -1,12 +0,0 @@
-[DEFAULT]
-support-files =
- head.js
- NarrateTestUtils.jsm
- moby_dick.html
-
-[browser_narrate.js]
-[browser_narrate_disable.js]
-[browser_narrate_language.js]
-support-files = inferno.html
-[browser_voiceselect.js]
-[browser_word_highlight.js]
diff --git a/toolkit/components/narrate/test/browser_narrate.js b/toolkit/components/narrate/test/browser_narrate.js
deleted file mode 100644
index b4951ef9f..000000000
--- a/toolkit/components/narrate/test/browser_narrate.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* globals is, isnot, registerCleanupFunction, add_task */
-
-"use strict";
-
-registerCleanupFunction(teardown);
-
-add_task(function* testNarrate() {
- setup();
-
- yield spawnInNewReaderTab(TEST_ARTICLE, function* () {
- let TEST_VOICE = "urn:moz-tts:fake-indirect:teresa";
- let $ = content.document.querySelector.bind(content.document);
-
- yield NarrateTestUtils.waitForNarrateToggle(content);
-
- let popup = $(NarrateTestUtils.POPUP);
- ok(!NarrateTestUtils.isVisible(popup), "popup is initially hidden");
-
- let toggle = $(NarrateTestUtils.TOGGLE);
- toggle.click();
-
- ok(NarrateTestUtils.isVisible(popup), "popup toggled");
-
- let voiceOptions = $(NarrateTestUtils.VOICE_OPTIONS);
- ok(!NarrateTestUtils.isVisible(voiceOptions),
- "voice options are initially hidden");
-
- $(NarrateTestUtils.VOICE_SELECT).click();
- ok(NarrateTestUtils.isVisible(voiceOptions), "voice options pop up");
-
- let prefChanged = NarrateTestUtils.waitForPrefChange("narrate.voice");
- ok(NarrateTestUtils.selectVoice(content, TEST_VOICE),
- "test voice selected");
- yield prefChanged;
-
- ok(!NarrateTestUtils.isVisible(voiceOptions), "voice options hidden again");
-
- NarrateTestUtils.isStoppedState(content, ok);
-
- let promiseEvent = ContentTaskUtils.waitForEvent(content, "paragraphstart");
- $(NarrateTestUtils.START).click();
- let speechinfo = (yield promiseEvent).detail;
- is(speechinfo.voice, TEST_VOICE, "correct voice is being used");
- let paragraph = speechinfo.paragraph;
-
- NarrateTestUtils.isStartedState(content, ok);
-
- promiseEvent = ContentTaskUtils.waitForEvent(content, "paragraphstart");
- $(NarrateTestUtils.FORWARD).click();
- speechinfo = (yield promiseEvent).detail;
- is(speechinfo.voice, TEST_VOICE, "same voice is used");
- isnot(speechinfo.paragraph, paragraph, "next paragraph is being spoken");
-
- NarrateTestUtils.isStartedState(content, ok);
-
- promiseEvent = ContentTaskUtils.waitForEvent(content, "paragraphstart");
- $(NarrateTestUtils.BACK).click();
- speechinfo = (yield promiseEvent).detail;
- is(speechinfo.paragraph, paragraph, "first paragraph being spoken");
-
- NarrateTestUtils.isStartedState(content, ok);
-
- paragraph = speechinfo.paragraph;
- $(NarrateTestUtils.STOP).click();
- yield ContentTaskUtils.waitForCondition(
- () => !$(NarrateTestUtils.STOP), "transitioned to stopped state");
- NarrateTestUtils.isStoppedState(content, ok);
-
- promiseEvent = ContentTaskUtils.waitForEvent(content, "paragraphstart");
- $(NarrateTestUtils.START).click();
- speechinfo = (yield promiseEvent).detail;
- is(speechinfo.paragraph, paragraph, "read same paragraph again");
-
- NarrateTestUtils.isStartedState(content, ok);
-
- let eventUtils = NarrateTestUtils.getEventUtils(content);
-
- promiseEvent = ContentTaskUtils.waitForEvent(content, "paragraphstart");
- prefChanged = NarrateTestUtils.waitForPrefChange("narrate.rate");
- $(NarrateTestUtils.RATE).focus();
- eventUtils.sendKey("UP", content);
- let newspeechinfo = (yield promiseEvent).detail;
- is(newspeechinfo.paragraph, speechinfo.paragraph, "same paragraph");
- isnot(newspeechinfo.rate, speechinfo.rate, "rate changed");
- yield prefChanged;
-
- promiseEvent = ContentTaskUtils.waitForEvent(content, "paragraphend");
- $(NarrateTestUtils.STOP).click();
- yield promiseEvent;
-
- yield ContentTaskUtils.waitForCondition(
- () => !$(NarrateTestUtils.STOP), "transitioned to stopped state");
- NarrateTestUtils.isStoppedState(content, ok);
-
- promiseEvent = ContentTaskUtils.waitForEvent(content, "scroll");
- content.scrollBy(0, 10);
- yield promiseEvent;
- ok(!NarrateTestUtils.isVisible(popup), "popup is hidden after scroll");
-
- toggle.click();
- ok(NarrateTestUtils.isVisible(popup), "popup is toggled again");
-
- promiseEvent = ContentTaskUtils.waitForEvent(content, "paragraphstart");
- $(NarrateTestUtils.START).click();
- yield promiseEvent;
- NarrateTestUtils.isStartedState(content, ok);
-
- promiseEvent = ContentTaskUtils.waitForEvent(content, "scroll");
- content.scrollBy(0, -10);
- yield promiseEvent;
- ok(NarrateTestUtils.isVisible(popup), "popup stays visible after scroll");
-
- toggle.click();
- ok(!NarrateTestUtils.isVisible(popup), "popup is dismissed while speaking");
- NarrateTestUtils.isStartedState(content, ok);
-
- // Go forward all the way to the end of the article. We should eventually
- // stop.
- do {
- promiseEvent = Promise.race([
- ContentTaskUtils.waitForEvent(content, "paragraphstart"),
- ContentTaskUtils.waitForEvent(content, "paragraphsdone")]);
- $(NarrateTestUtils.FORWARD).click();
- } while ((yield promiseEvent).type == "paragraphstart");
-
- // This is to make sure we are not actively scrolling when the tab closes.
- content.scroll(0, 0);
-
- yield ContentTaskUtils.waitForCondition(
- () => !$(NarrateTestUtils.STOP), "transitioned to stopped state");
- NarrateTestUtils.isStoppedState(content, ok);
- });
-});
diff --git a/toolkit/components/narrate/test/browser_narrate_disable.js b/toolkit/components/narrate/test/browser_narrate_disable.js
deleted file mode 100644
index 264815fd1..000000000
--- a/toolkit/components/narrate/test/browser_narrate_disable.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* globals registerCleanupFunction, add_task */
-
-"use strict";
-
-const ENABLE_PREF = "narrate.enabled";
-
-registerCleanupFunction(() => {
- clearUserPref(ENABLE_PREF);
- teardown();
-});
-
-add_task(function* testNarratePref() {
- setup();
-
- yield spawnInNewReaderTab(TEST_ARTICLE, function() {
- is(content.document.querySelectorAll(NarrateTestUtils.TOGGLE).length, 1,
- "narrate is inserted by default");
- });
-
- setBoolPref(ENABLE_PREF, false);
-
- yield spawnInNewReaderTab(TEST_ARTICLE, function() {
- ok(!content.document.querySelector(NarrateTestUtils.TOGGLE),
- "narrate is disabled and is not in reader mode");
- });
-
- setBoolPref(ENABLE_PREF, true);
-
- yield spawnInNewReaderTab(TEST_ARTICLE, function() {
- is(content.document.querySelectorAll(NarrateTestUtils.TOGGLE).length, 1,
- "narrate is re-enabled and appears only once");
- });
-});
diff --git a/toolkit/components/narrate/test/browser_narrate_language.js b/toolkit/components/narrate/test/browser_narrate_language.js
deleted file mode 100644
index 2542a87d6..000000000
--- a/toolkit/components/narrate/test/browser_narrate_language.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* globals is, isnot, registerCleanupFunction, add_task */
-
-"use strict";
-
-registerCleanupFunction(teardown);
-
-add_task(function* testVoiceselectDropdownAutoclose() {
- setup("automatic", true);
-
- yield spawnInNewReaderTab(TEST_ARTICLE, function* () {
- let $ = content.document.querySelector.bind(content.document);
-
- yield NarrateTestUtils.waitForNarrateToggle(content);
-
- ok(!!$(".option[data-value='urn:moz-tts:fake-direct:bob']"),
- "Jamaican English voice available");
- ok(!!$(".option[data-value='urn:moz-tts:fake-direct:lenny']"),
- "Canadian English voice available");
- ok(!!$(".option[data-value='urn:moz-tts:fake-direct:amy']"),
- "British English voice available");
-
- ok(!$(".option[data-value='urn:moz-tts:fake-direct:celine']"),
- "Canadian French voice unavailable");
- ok(!$(".option[data-value='urn:moz-tts:fake-direct:julie']"),
- "Mexican Spanish voice unavailable");
-
- $(NarrateTestUtils.TOGGLE).click();
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.POPUP)),
- "popup is toggled");
-
- let prefChanged = NarrateTestUtils.waitForPrefChange(
- "narrate.voice", "getCharPref");
- NarrateTestUtils.selectVoice(content, "urn:moz-tts:fake-direct:lenny");
- let voicePref = JSON.parse(yield prefChanged);
- is(voicePref.en, "urn:moz-tts:fake-direct:lenny", "pref set correctly");
- });
-});
-
-add_task(function* testVoiceselectDropdownAutoclose() {
- setup("automatic", true);
-
- yield spawnInNewReaderTab(TEST_ITALIAN_ARTICLE, function* () {
- let $ = content.document.querySelector.bind(content.document);
-
- yield NarrateTestUtils.waitForNarrateToggle(content);
-
- ok(!!$(".option[data-value='urn:moz-tts:fake-indirect:zanetta']"),
- "Italian voice available");
- ok(!!$(".option[data-value='urn:moz-tts:fake-indirect:margherita']"),
- "Italian voice available");
-
- ok(!$(".option[data-value='urn:moz-tts:fake-direct:bob']"),
- "Jamaican English voice available");
- ok(!$(".option[data-value='urn:moz-tts:fake-direct:celine']"),
- "Canadian French voice unavailable");
- ok(!$(".option[data-value='urn:moz-tts:fake-direct:julie']"),
- "Mexican Spanish voice unavailable");
-
- $(NarrateTestUtils.TOGGLE).click();
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.POPUP)),
- "popup is toggled");
-
- let prefChanged = NarrateTestUtils.waitForPrefChange(
- "narrate.voice", "getCharPref");
- NarrateTestUtils.selectVoice(content, "urn:moz-tts:fake-indirect:zanetta");
- let voicePref = JSON.parse(yield prefChanged);
- is(voicePref.it, "urn:moz-tts:fake-indirect:zanetta", "pref set correctly");
- });
-});
diff --git a/toolkit/components/narrate/test/browser_voiceselect.js b/toolkit/components/narrate/test/browser_voiceselect.js
deleted file mode 100644
index 0de6528dd..000000000
--- a/toolkit/components/narrate/test/browser_voiceselect.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* globals registerCleanupFunction, add_task, is, isnot */
-
-"use strict";
-
-registerCleanupFunction(teardown);
-
-add_task(function* testVoiceselectDropdownAutoclose() {
- setup();
-
- yield spawnInNewReaderTab(TEST_ARTICLE, function* () {
- let $ = content.document.querySelector.bind(content.document);
-
- yield NarrateTestUtils.waitForNarrateToggle(content);
-
- $(NarrateTestUtils.TOGGLE).click();
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.POPUP)),
- "popup is toggled");
-
- ok(!NarrateTestUtils.isVisible($(NarrateTestUtils.VOICE_OPTIONS)),
- "voice options are initially hidden");
-
- $(NarrateTestUtils.VOICE_SELECT).click();
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.VOICE_OPTIONS)),
- "voice options are toggled");
-
- $(NarrateTestUtils.TOGGLE).click();
- // A focus will follow a real click.
- $(NarrateTestUtils.TOGGLE).focus();
- ok(!NarrateTestUtils.isVisible($(NarrateTestUtils.POPUP)),
- "narrate popup is dismissed");
-
- $(NarrateTestUtils.TOGGLE).click();
- // A focus will follow a real click.
- $(NarrateTestUtils.TOGGLE).focus();
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.POPUP)),
- "narrate popup is showing again");
- ok(!NarrateTestUtils.isVisible($(NarrateTestUtils.VOICE_OPTIONS)),
- "voice options are hidden after popup comes back");
- });
-});
-
-add_task(function* testVoiceselectLabelChange() {
- setup();
-
- yield spawnInNewReaderTab(TEST_ARTICLE, function* () {
- let $ = content.document.querySelector.bind(content.document);
-
- yield NarrateTestUtils.waitForNarrateToggle(content);
-
- $(NarrateTestUtils.TOGGLE).click();
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.POPUP)),
- "popup is toggled");
-
- ok(NarrateTestUtils.selectVoice(content, "urn:moz-tts:fake-direct:lenny"),
- "voice selected");
-
- let selectedOption = $(NarrateTestUtils.VOICE_SELECTED);
- let selectLabel = $(NarrateTestUtils.VOICE_SELECT_LABEL);
-
- is(selectedOption.textContent, selectLabel.textContent,
- "new label matches selected voice");
- });
-});
-
-add_task(function* testVoiceselectKeyboard() {
- setup();
-
- yield spawnInNewReaderTab(TEST_ARTICLE, function* () {
- let $ = content.document.querySelector.bind(content.document);
-
- yield NarrateTestUtils.waitForNarrateToggle(content);
-
- $(NarrateTestUtils.TOGGLE).click();
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.POPUP)),
- "popup is toggled");
-
- let eventUtils = NarrateTestUtils.getEventUtils(content);
-
- let firstValue = $(NarrateTestUtils.VOICE_SELECTED).dataset.value;
-
- ok(!NarrateTestUtils.isVisible($(NarrateTestUtils.VOICE_OPTIONS)),
- "voice options initially are hidden");
-
- $(NarrateTestUtils.VOICE_SELECT).focus();
-
- eventUtils.sendKey("DOWN", content);
-
- yield ContentTaskUtils.waitForCondition(
- () => $(NarrateTestUtils.VOICE_SELECTED).dataset.value != firstValue,
- "value changed after pressing DOWN key");
-
- eventUtils.sendKey("RETURN", content);
-
- ok(NarrateTestUtils.isVisible($(NarrateTestUtils.VOICE_OPTIONS)),
- "voice options showing after pressing RETURN");
-
- eventUtils.sendKey("UP", content);
-
- eventUtils.sendKey("RETURN", content);
-
- ok(!NarrateTestUtils.isVisible($(NarrateTestUtils.VOICE_OPTIONS)),
- "voice options hidden after pressing RETURN");
-
- yield ContentTaskUtils.waitForCondition(
- () => $(NarrateTestUtils.VOICE_SELECTED).dataset.value == firstValue,
- "value changed back to original after pressing RETURN");
- });
-});
diff --git a/toolkit/components/narrate/test/browser_word_highlight.js b/toolkit/components/narrate/test/browser_word_highlight.js
deleted file mode 100644
index bfdbcf48e..000000000
--- a/toolkit/components/narrate/test/browser_word_highlight.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* globals is, isnot, registerCleanupFunction, add_task */
-
-"use strict";
-
-registerCleanupFunction(teardown);
-
-add_task(function* testNarrate() {
- setup("urn:moz-tts:fake-indirect:teresa");
-
- yield spawnInNewReaderTab(TEST_ARTICLE, function* () {
- let $ = content.document.querySelector.bind(content.document);
-
- yield NarrateTestUtils.waitForNarrateToggle(content);
-
- let popup = $(NarrateTestUtils.POPUP);
- ok(!NarrateTestUtils.isVisible(popup), "popup is initially hidden");
-
- let toggle = $(NarrateTestUtils.TOGGLE);
- toggle.click();
-
- ok(NarrateTestUtils.isVisible(popup), "popup toggled");
-
- NarrateTestUtils.isStoppedState(content, ok);
-
- let promiseEvent = ContentTaskUtils.waitForEvent(content, "paragraphstart");
- $(NarrateTestUtils.START).click();
- let voice = (yield promiseEvent).detail.voice;
- is(voice, "urn:moz-tts:fake-indirect:teresa", "double-check voice");
-
- // Skip forward to first paragraph.
- let details;
- do {
- promiseEvent = ContentTaskUtils.waitForEvent(content, "paragraphstart");
- $(NarrateTestUtils.FORWARD).click();
- details = (yield promiseEvent).detail;
- } while (details.tag != "p");
-
- let boundaryPat = /(\s+)\S/g;
- let position = { left: 0, top: 0 };
- let text = details.paragraph;
- for (let res = boundaryPat.exec(text); res; res = boundaryPat.exec(text)) {
- promiseEvent = ContentTaskUtils.waitForEvent(content, "wordhighlight");
- NarrateTestUtils.sendBoundaryEvent(content, "word", res.index);
- let { start, end } = (yield promiseEvent).detail;
- let nodes = NarrateTestUtils.getWordHighlights(content);
- for (let node of nodes) {
- // Since this is English we can assume each word is to the right or
- // below the previous one.
- ok(node.left > position.left || node.top > position.top,
- "highlight position is moving");
- position = { left: node.left, top: node.top };
- }
- let wordFromOffset = text.substring(start, end);
- // XXX: Each node should contain the part of the word it highlights.
- // Right now, each node contains the entire word.
- let wordFromHighlight = nodes[0].word;
- is(wordFromOffset, wordFromHighlight, "Correct word is highlighted");
- }
-
- $(NarrateTestUtils.STOP).click();
- yield ContentTaskUtils.waitForCondition(
- () => !$(NarrateTestUtils.STOP), "transitioned to stopped state");
- NarrateTestUtils.isWordHighlightGone(content, ok);
- });
-});
diff --git a/toolkit/components/narrate/test/head.js b/toolkit/components/narrate/test/head.js
deleted file mode 100644
index 491a3da8d..000000000
--- a/toolkit/components/narrate/test/head.js
+++ /dev/null
@@ -1,87 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* exported teardown, setup, toggleExtension,
- spawnInNewReaderTab, TEST_ARTICLE, TEST_ITALIAN_ARTICLE */
-
-"use strict";
-
-const TEST_ARTICLE =
- "http://example.com/browser/toolkit/components/narrate/test/moby_dick.html";
-
-const TEST_ITALIAN_ARTICLE =
- "http://example.com/browser/toolkit/components/narrate/test/inferno.html";
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
- "resource://gre/modules/AddonManager.jsm");
-
-const TEST_PREFS = {
- "reader.parse-on-load.enabled": true,
- "media.webspeech.synth.enabled": true,
- "media.webspeech.synth.test": true,
- "narrate.enabled": true,
- "narrate.test": true,
- "narrate.voice": null,
- "narrate.filter-voices": false,
-};
-
-function setup(voiceUri = "automatic", filterVoices = false) {
- let prefs = Object.assign({}, TEST_PREFS, {
- "narrate.filter-voices": filterVoices,
- "narrate.voice": JSON.stringify({ en: voiceUri })
- });
-
- // Set required test prefs.
- Object.entries(prefs).forEach(([name, value]) => {
- switch (typeof value) {
- case "boolean":
- setBoolPref(name, value);
- break;
- case "string":
- setCharPref(name, value);
- break;
- }
- });
-}
-
-function teardown() {
- // Reset test prefs.
- Object.entries(TEST_PREFS).forEach(pref => {
- clearUserPref(pref[0]);
- });
-}
-
-function spawnInNewReaderTab(url, func) {
- return BrowserTestUtils.withNewTab(
- { gBrowser,
- url: `about:reader?url=${encodeURIComponent(url)}` },
- function* (browser) {
- yield ContentTask.spawn(browser, null, function* () {
- Components.utils.import("chrome://mochitests/content/browser/" +
- "toolkit/components/narrate/test/NarrateTestUtils.jsm");
-
- yield NarrateTestUtils.getReaderReadyPromise(content);
- });
-
- yield ContentTask.spawn(browser, null, func);
- });
-}
-
-function setBoolPref(name, value) {
- Services.prefs.setBoolPref(name, value);
-}
-
-function setCharPref(name, value) {
- Services.prefs.setCharPref(name, value);
-}
-
-function clearUserPref(name) {
- Services.prefs.clearUserPref(name);
-}
diff --git a/toolkit/components/narrate/test/inferno.html b/toolkit/components/narrate/test/inferno.html
deleted file mode 100644
index 58dfd24df..000000000
--- a/toolkit/components/narrate/test/inferno.html
+++ /dev/null
@@ -1,238 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Inferno - Canto I</title>
-</head>
-<body>
- <h1>Inferno</h1>
- <h2>Canto I: Dante nella selva oscura</h2>
- <p>
- Nel mezzo del cammin di nostra vita<br>
- mi ritrovai per una selva oscura,<br>
- ché la diritta via era smarrita.
- </p>
- <p>
- Ahi quanto a dir qual era è cosa dura<br>
- esta selva selvaggia e aspra e forte<br>
- che nel pensier rinova la paura!
- </p>
- <p>
- Tant' è amara che poco è più morte;<br>
- ma per trattar del ben ch'i' vi trovai,<br>
- dirò de l'altre cose ch'i' v'ho scorte.
- </p>
- <p>
- Io non so ben ridir com' i' v'intrai,<br>
- tant' era pien di sonno a quel punto<br>
- che la verace via abbandonai.
- </p>
- <p>
- Ma poi ch'i' fui al piè d'un colle giunto,<br>
- là dove terminava quella valle<br>
- che m'avea di paura il cor compunto,
- </p>
- <p>
- guardai in alto e vidi le sue spalle<br>
- vestite già de' raggi del pianeta<br>
- che mena dritto altrui per ogne calle.
- </p>
- <p>
- Allor fu la paura un poco queta,<br>
- che nel lago del cor m'era durata<br>
- la notte ch'i' passai con tanta pieta.
- </p>
- <p>
- E come quei che con lena affannata,<br>
- uscito fuor del pelago a la riva,<br>
- si volge a l'acqua perigliosa e guata,
- </p>
- <p>
- così l'animo mio, ch'ancor fuggiva,<br>
- si volse a retro a rimirar lo passo<br>
- che non lasciò già mai persona viva.
- </p>
- <p>
- Poi ch'èi posato un poco il corpo lasso,<br>
- ripresi via per la piaggia diserta,<br>
- sì che 'l piè fermo sempre era 'l più basso.
- </p>
- <p>
- Ed ecco, quasi al cominciar de l'erta,<br>
- una lonza leggiera e presta molto,<br>
- che di pel macolato era coverta;
- </p>
- <p>
- e non mi si partia dinanzi al volto,<br>
- anzi 'mpediva tanto il mio cammino,<br>
- ch'i' fui per ritornar più volte vòlto.
- </p>
- <p>
- Temp' era dal principio del mattino,<br>
- e 'l sol montava 'n sù con quelle stelle<br>
- ch'eran con lui quando l'amor divino
- </p>
- <p>
- mosse di prima quelle cose belle;<br>
- sì ch'a bene sperar m'era cagione<br>
- di quella fiera a la gaetta pelle
- </p>
- <p>
- l'ora del tempo e la dolce stagione;<br>
- ma non sì che paura non mi desse<br>
- la vista che m'apparve d'un leone.
- </p>
- <p>
- Questi parea che contra me venisse<br>
- con la test' alta e con rabbiosa fame,<br>
- sì che parea che l'aere ne tremesse.
- </p>
- <p>
- Ed una lupa, che di tutte brame<br>
- sembiava carca ne la sua magrezza,<br>
- e molte genti fé già viver grame,
- </p>
- <p>
- questa mi porse tanto di gravezza<br>
- con la paura ch'uscia di sua vista,<br>
- ch'io perdei la speranza de l'altezza.
- </p>
- <p>
- E qual è quei che volontieri acquista,<br>
- e giugne 'l tempo che perder lo face,<br>
- che 'n tutti suoi pensier piange e s'attrista;
- </p>
- <p>
- tal mi fece la bestia sanza pace,<br>
- che, venendomi 'ncontro, a poco a poco<br>
- mi ripigneva là dove 'l sol tace.
- </p>
- <p>
- Mentre ch'i' rovinava in basso loco,<br>
- dinanzi a li occhi mi si fu offerto<br>
- chi per lungo silenzio parea fioco.
- </p>
- <p>
- Quando vidi costui nel gran diserto,<br>
- «<em>Miserere</em> di me», gridai a lui,<br>
- «qual che tu sii, od ombra od omo certo!».
- </p>
- <p>
- Rispuosemi: «Non omo, omo già fui,<br>
- e li parenti miei furon lombardi,<br>
- mantoani per patrïa ambedui.
- </p>
- <p>
- Nacqui <em>sub Iulio</em>, ancor che fosse tardi,<br>
- e vissi a Roma sotto 'l buono Augusto<br>
- nel tempo de li dèi falsi e bugiardi.
- </p>
- <p>
- Poeta fui, e cantai di quel giusto<br>
- figliuol d'Anchise che venne di Troia,<br>
- poi che 'l superbo Ilïón fu combusto.
- </p>
- <p>
- Ma tu perché ritorni a tanta noia?<br>
- perché non sali il dilettoso monte<br>
- ch'è principio e cagion di tutta gioia?».
- </p>
- <p>
- «Or se' tu quel Virgilio e quella fonte<br>
- che spandi di parlar sì largo fiume?»,<br>
- rispuos' io lui con vergognosa fronte.
- </p>
- <p>
- «O de li altri poeti onore e lume,<br>
- vagliami 'l lungo studio e 'l grande amore<br>
- che m'ha fatto cercar lo tuo volume.
- </p>
- <p>
- Tu se' lo mio maestro e 'l mio autore,<br>
- tu se' solo colui da cu' io tolsi<br>
- lo bello stilo che m'ha fatto onore.
- </p>
- <p>
- Vedi la bestia per cu' io mi volsi;<br>
- aiutami da lei, famoso saggio,<br>
- ch'ella mi fa tremar le vene e i polsi».
- </p>
- <p>
- «A te convien tenere altro vïaggio»,<br>
- rispuose, poi che lagrimar mi vide,<br>
- «se vuo' campar d'esto loco selvaggio;
- </p>
- <p>
- ché questa bestia, per la qual tu gride,<br>
- non lascia altrui passar per la sua via,<br>
- ma tanto lo 'mpedisce che l'uccide;
- </p>
- <p>
- e ha natura sì malvagia e ria,<br>
- che mai non empie la bramosa voglia,<br>
- e dopo 'l pasto ha più fame che pria.
- </p>
- <p>
- Molti son li animali a cui s'ammoglia,<br>
- e più saranno ancora, infin che 'l veltro<br>
- verrà, che la farà morir con doglia.
- </p>
- <p>
- Questi non ciberà terra né peltro,<br>
- ma sapïenza, amore e virtute,<br>
- e sua nazion sarà tra feltro e feltro.
- </p>
- <p>
- Di quella umile Italia fia salute<br>
- per cui morì la vergine Cammilla,<br>
- Eurialo e Turno e Niso di ferute.
- </p>
- <p>
- Questi la caccerà per ogne villa,<br>
- fin che l'avrà rimessa ne lo 'nferno,<br>
- là onde 'nvidia prima dipartilla.
- </p>
- <p>
- Ond' io per lo tuo me' penso e discerno<br>
- che tu mi segui, e io sarò tua guida,<br>
- e trarrotti di qui per loco etterno;
- </p>
- <p>
- ove udirai le disperate strida,<br>
- vedrai li antichi spiriti dolenti,<br>
- ch'a la seconda morte ciascun grida;
- </p>
- <p>
- e vederai color che son contenti<br>
- nel foco, perché speran di venire<br>
- quando che sia a le beate genti.
- </p>
- <p>
- A le quai poi se tu vorrai salire,<br>
- anima fia a ciò più di me degna:<br>
- con lei ti lascerò nel mio partire;
- </p>
- <p>
- ché quello imperador che là sù regna,<br>
- perch' i' fu' ribellante a la sua legge,<br>
- non vuol che 'n sua città per me si vegna.
- </p>
- <p>
- In tutte parti impera e quivi regge;<br>
- quivi è la sua città e l'alto seggio:<br>
- oh felice colui cu' ivi elegge!».
- </p>
- <p>
- E io a lui: «Poeta, io ti richeggio<br>
- per quello Dio che tu non conoscesti,<br>
- a ciò ch'io fugga questo male e peggio,
- </p>
- <p>
- che tu mi meni là dov' or dicesti,<br>
- sì ch'io veggia la porta di san Pietro<br>
- e color cui tu fai cotanto mesti».
- </p>
- <p>
- Allor si mosse, e io li tenni dietro.
- </p>
-</body>
-</html>
diff --git a/toolkit/components/narrate/test/moby_dick.html b/toolkit/components/narrate/test/moby_dick.html
deleted file mode 100644
index 0beaa20fd..000000000
--- a/toolkit/components/narrate/test/moby_dick.html
+++ /dev/null
@@ -1,218 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Moby Dick - Chapter 1. Loomings</title>
-</head>
-<body>
- <h1>Moby Dick</h1>
- <h2>Chapter 1. Loomings</h2>
- <p>
- Call me Ishmael. <span>Some <span>years</span></span> ago—never mind how
- long precisely—having little or no money in my purse, and nothing particular
- to interest me on shore, I thought I would sail about a little and see the
- watery part of the world. It is a way I have of driving off the spleen and
- regulating the circulation. Whenever I find myself growing grim about the
- mouth; whenever it is a damp, drizzly November in my soul; whenever I find
- myself involuntarily pausing before coffin warehouses, and bringing up the
- rear of every funeral I meet; and especially whenever my hypos get such an
- upper hand of me, that it requires a strong moral principle to prevent me
- from deliberately stepping into the street, and methodically knocking
- people's hats off—then, I account it high time to get to sea as soon as I
- can. This is my substitute for pistol and ball. With a philosophical
- flourish Cato throws himself upon his sword; I quietly take to the ship.
- There is nothing surprising in this. If they but knew it, almost all men in
- their degree, some time or other, cherish very nearly the same feelings
- towards the ocean with me.
- </p>
- <p>
- There now is your insular city of the Manhattoes, belted round by wharves
- as Indian isles by coral reefs—commerce surrounds it with her surf.
- Right and left, the streets take you waterward. Its extreme downtown is
- the battery, where that noble mole is washed by waves, and cooled by
- breezes, which a few hours previous were out of sight of land. Look at the
- crowds of water-gazers there.
- </p>
- <p>
- Circumambulate the city of a dreamy Sabbath afternoon. Go from Corlears
- Hook to Coenties Slip, and from thence, by Whitehall, northward. What do
- you see?—Posted like silent sentinels all around the town, stand
- thousands upon thousands of mortal men fixed in ocean reveries. Some
- leaning against the spiles; some seated upon the pier-heads; some looking
- over the bulwarks of ships from China; some high aloft in the rigging, as
- if striving to get a still better seaward peep. But these are all
- landsmen; of week days pent up in lath and plaster—tied to counters,
- nailed to benches, clinched to desks. How then is this? Are the green
- fields gone? What do they here?
- </p>
- <p>
- But look! here come more crowds, pacing straight for the water, and
- seemingly bound for a dive. Strange! Nothing will content them but the
- extremest limit of the land; loitering under the shady lee of yonder
- warehouses will not suffice. No. They must get just as nigh the water as
- they possibly can without falling in. And there they stand—miles of
- them—leagues. Inlanders all, they come from lanes and alleys,
- streets and avenues—north, east, south, and west. Yet here they all
- unite. Tell me, does the magnetic virtue of the needles of the compasses
- of all those ships attract them thither?
- </p>
- <p>
- Once more. Say you are in the country; in some high land of lakes. Take
- almost any path you please, and ten to one it carries you down in a dale,
- and leaves you there by a pool in the stream. There is magic in it. Let
- the most absent-minded of men be plunged in his deepest reveries—stand
- that man on his legs, set his feet a-going, and he will infallibly lead
- you to water, if water there be in all that region. Should you ever be
- athirst in the great American desert, try this experiment, if your caravan
- happen to be supplied with a metaphysical professor. Yes, as every one
- knows, meditation and water are wedded for ever.
- </p>
- <p>
- But here is an artist. He desires to paint you the dreamiest, shadiest,
- quietest, most enchanting bit of romantic landscape in all the valley of
- the Saco. What is the chief element he employs? There stand his trees,
- each with a hollow trunk, as if a hermit and a crucifix were within; and
- here sleeps his meadow, and there sleep his cattle; and up from yonder
- cottage goes a sleepy smoke. Deep into distant woodlands winds a mazy way,
- reaching to overlapping spurs of mountains bathed in their hill-side blue.
- But though the picture lies thus tranced, and though this pine-tree shakes
- down its sighs like leaves upon this shepherd's head, yet all were vain,
- unless the shepherd's eye were fixed upon the magic stream before him. Go
- visit the Prairies in June, when for scores on scores of miles you wade
- knee-deep among Tiger-lilies—what is the one charm wanting?—Water—there
- is not a drop of water there! Were Niagara but a cataract of sand, would
- you travel your thousand miles to see it? Why did the poor poet of
- Tennessee, upon suddenly receiving two handfuls of silver, deliberate
- whether to buy him a coat, which he sadly needed, or invest his money in a
- pedestrian trip to Rockaway Beach? Why is almost every robust healthy boy
- with a robust healthy soul in him, at some time or other crazy to go to
- sea? Why upon your first voyage as a passenger, did you yourself feel such
- a mystical vibration, when first told that you and your ship were now out
- of sight of land? Why did the old Persians hold the sea holy? Why did the
- Greeks give it a separate deity, and own brother of Jove? Surely all this
- is not without meaning. And still deeper the meaning of that story of
- Narcissus, who because he could not grasp the tormenting, mild image he
- saw in the fountain, plunged into it and was drowned. But that same image,
- we ourselves see in all rivers and oceans. It is the image of the
- ungraspable phantom of life; and this is the key to it all.
- </p>
- <p>
- Now, when I say that I am in the habit of going to sea whenever I begin to
- grow hazy about the eyes, and begin to be over conscious of my lungs, I do
- not mean to have it inferred that I ever go to sea as a passenger. For to
- go as a passenger you must needs have a purse, and a purse is but a rag
- unless you have something in it. Besides, passengers get sea-sick—grow
- quarrelsome—don't sleep of nights—do not enjoy themselves
- much, as a general thing;—no, I never go as a passenger; nor, though
- I am something of a salt, do I ever go to sea as a Commodore, or a
- Captain, or a Cook. I abandon the glory and distinction of such offices to
- those who like them. For my part, I abominate all honourable respectable
- toils, trials, and tribulations of every kind whatsoever. It is quite as
- much as I can do to take care of myself, without taking care of ships,
- barques, brigs, schooners, and what not. And as for going as cook,—though
- I confess there is considerable glory in that, a cook being a sort of
- officer on ship-board—yet, somehow, I never fancied broiling fowls;—though
- once broiled, judiciously buttered, and judgmatically salted and peppered,
- there is no one who will speak more respectfully, not to say
- reverentially, of a broiled fowl than I will. It is out of the idolatrous
- dotings of the old Egyptians upon broiled ibis and roasted river horse,
- that you see the mummies of those creatures in their huge bake-houses the
- pyramids.
- </p>
- <p>
- No, when I go to sea, I go as a simple sailor, right before the mast,
- plumb down into the forecastle, aloft there to the royal mast-head. True,
- they rather order me about some, and make me jump from spar to spar, like
- a grasshopper in a May meadow. And at first, this sort of thing is
- unpleasant enough. It touches one's sense of honour, particularly if you
- come of an old established family in the land, the Van Rensselaers, or
- Randolphs, or Hardicanutes. And more than all, if just previous to putting
- your hand into the tar-pot, you have been lording it as a country
- schoolmaster, making the tallest boys stand in awe of you. The transition
- is a keen one, I assure you, from a schoolmaster to a sailor, and requires
- a strong decoction of Seneca and the Stoics to enable you to grin and bear
- it. But even this wears off in time.
- </p>
- <p>
- What of it, if some old hunks of a sea-captain orders me to get a broom
- and sweep down the decks? What does that indignity amount to, weighed, I
- mean, in the scales of the New Testament? Do you think the archangel
- Gabriel thinks anything the less of me, because I promptly and
- respectfully obey that old hunks in that particular instance? Who ain't a
- slave? Tell me that. Well, then, however the old sea-captains may order me
- about—however they may thump and punch me about, I have the
- satisfaction of knowing that it is all right; that everybody else is one
- way or other served in much the same way—either in a physical or
- metaphysical point of view, that is; and so the universal thump is passed
- round, and all hands should rub each other's shoulder-blades, and be
- content.
- </p>
- <p>
- Again, I always go to sea as a sailor, because they make a point of paying
- me for my trouble, whereas they never pay passengers a single penny that I
- ever heard of. On the contrary, passengers themselves must pay. And there
- is all the difference in the world between paying and being paid. The act
- of paying is perhaps the most uncomfortable infliction that the two
- orchard thieves entailed upon us. But <i>being paid</i>,—what will compare
- with it? The urbane activity with which a man receives money is really
- marvellous, considering that we so earnestly believe money to be the root
- of all earthly ills, and that on no account can a monied man enter heaven.
- Ah! how cheerfully we consign ourselves to perdition!
- </p>
- <p>
- Finally, I always go to sea as a sailor, because of the wholesome exercise
- and pure air of the fore-castle deck. For as in this world, head winds are
- far more prevalent than winds from astern (that is, if you never violate
- the Pythagorean maxim), so for the most part the Commodore on the
- quarter-deck gets his atmosphere at second hand from the sailors on the
- forecastle. He thinks he breathes it first; but not so. In much the same
- way do the commonalty lead their leaders in many other things, at the same
- time that the leaders little suspect it. But wherefore it was that after
- having repeatedly smelt the sea as a merchant sailor, I should now take it
- into my head to go on a whaling voyage; this the invisible police officer
- of the Fates, who has the constant surveillance of me, and secretly dogs
- me, and influences me in some unaccountable way—he can better answer
- than any one else. And, doubtless, my going on this whaling voyage, formed
- part of the grand programme of Providence that was drawn up a long time
- ago. It came in as a sort of brief interlude and solo between more
- extensive performances. I take it that this part of the bill must have run
- something like this:
- </p>
- <p>
- "<i>Grand Contested Election for the Presidency of the United States.</i>
- "WHALING VOYAGE BY ONE ISHMAEL. "BLOODY BATTLE IN AFFGHANISTAN."
- </p>
- <p>
- Though I cannot tell why it was exactly that those stage managers, the
- Fates, put me down for this shabby part of a whaling voyage, when others
- were set down for magnificent parts in high tragedies, and short and easy
- parts in genteel comedies, and jolly parts in farces—though I cannot
- tell why this was exactly; yet, now that I recall all the circumstances, I
- think I can see a little into the springs and motives which being
- cunningly presented to me under various disguises, induced me to set about
- performing the part I did, besides cajoling me into the delusion that it
- was a choice resulting from my own unbiased freewill and discriminating
- judgment.
- </p>
- <p>
- Chief among these motives was the overwhelming idea of the great whale
- himself. Such a portentous and mysterious monster roused all my curiosity.
- Then the wild and distant seas where he rolled his island bulk; the
- undeliverable, nameless perils of the whale; these, with all the attending
- marvels of a thousand Patagonian sights and sounds, helped to sway me to
- my wish. With other men, perhaps, such things would not have been
- inducements; but as for me, I am tormented with an everlasting itch for
- things remote. I love to sail forbidden seas, and land on barbarous
- coasts. Not ignoring what is good, I am quick to perceive a horror, and
- could still be social with it—would they let me—since it is
- but well to be on friendly terms with all the inmates of the place one
- lodges in.
- </p>
- <p>
- By reason of these things, then, the whaling voyage was welcome; the great
- flood-gates of the wonder-world swung open, and in the wild conceits that
- swayed me to my purpose, two and two there floated into my inmost soul,
- endless processions of the whale, and, mid most of them all, one grand
- hooded phantom, like a snow hill in the air.
- </p>
-</body>
-</html>
diff --git a/toolkit/components/osfile/modules/osfile_async_front.jsm b/toolkit/components/osfile/modules/osfile_async_front.jsm
index 9f3b7fb21..698ac8732 100644
--- a/toolkit/components/osfile/modules/osfile_async_front.jsm
+++ b/toolkit/components/osfile/modules/osfile_async_front.jsm
@@ -728,26 +728,19 @@ File.prototype = {
}
};
-
-if (SharedAll.Constants.Sys.Name != "Android") {
- /**
- * Set the last access and modification date of the file.
- * The time stamp resolution is 1 second at best, but might be worse
- * depending on the platform.
- *
- * WARNING: This method is not implemented on Android. On Android,
- * you should use File.setDates instead.
- *
- * @return {promise}
- * @rejects {TypeError}
- * @rejects {OS.File.Error}
- */
- File.prototype.setDates = function(accessDate, modificationDate) {
- return Scheduler.post("File_prototype_setDates",
- [this._fdmsg, accessDate, modificationDate], this);
- };
-}
-
+ /**
+ * Set the last access and modification date of the file.
+ * The time stamp resolution is 1 second at best, but might be worse
+ * depending on the platform.
+ *
+ * @return {promise}
+ * @rejects {TypeError}
+ * @rejects {OS.File.Error}
+ */
+File.prototype.setDates = function(accessDate, modificationDate) {
+ return Scheduler.post("File_prototype_setDates",
+ [this._fdmsg, accessDate, modificationDate], this);
+};
/**
* Open a file asynchronously.
diff --git a/toolkit/components/osfile/modules/osfile_unix_back.jsm b/toolkit/components/osfile/modules/osfile_unix_back.jsm
index 7c2c6f28d..4cc444567 100644
--- a/toolkit/components/osfile/modules/osfile_unix_back.jsm
+++ b/toolkit/components/osfile/modules/osfile_unix_back.jsm
@@ -372,14 +372,14 @@
// Two variants of |getwd| which allocate the memory
// dynamically.
- // Linux/Android version
+ // Linux version
libc.declareLazyFFI(SysFile, "get_current_dir_name",
"get_current_dir_name", ctypes.default_abi,
/*return*/ Type.out_path.releaseWithLazy(() =>
SysFile.free
));
- // MacOS/BSD version (will return NULL on Linux/Android)
+ // MacOS/BSD version (will return NULL on Linux)
libc.declareLazyFFI(SysFile, "getwd_auto",
"getwd", ctypes.default_abi,
/*return*/ Type.out_path.releaseWithLazy(() =>
@@ -520,13 +520,13 @@
/*fd_out*/ Type.fd,
/*off_out*/Type.off_t.in_ptr,
/*len*/ Type.size_t,
- /*flags*/ Type.unsigned_int); // Linux/Android-specific
+ /*flags*/ Type.unsigned_int); // Linux-specific
libc.declareLazyFFI(SysFile, "statfs",
"statfs", ctypes.default_abi,
/*return*/ Type.negativeone_or_nothing,
/*path*/ Type.path,
- /*buf*/ Type.statvfs.out_ptr); // Android,B2G
+ /*buf*/ Type.statvfs.out_ptr); // Other platforms
libc.declareLazyFFI(SysFile, "statvfs",
"statvfs", ctypes.default_abi,
diff --git a/toolkit/components/osfile/modules/osfile_unix_front.jsm b/toolkit/components/osfile/modules/osfile_unix_front.jsm
index bd60d4d84..4e41036df 100644
--- a/toolkit/components/osfile/modules/osfile_unix_front.jsm
+++ b/toolkit/components/osfile/modules/osfile_unix_front.jsm
@@ -204,10 +204,7 @@
* The time stamp resolution is 1 second at best, but might be worse
* depending on the platform.
*
- * WARNING: This method is not implemented on Android/B2G. On Android/B2G,
- * you should use File.setDates instead.
- *
- * @param {Date,number=} accessDate The last access date. If numeric,
+ * @param {Date,number=} accessDate The last access date. If numeric,
* milliseconds since epoch. If omitted or null, then the current date
* will be used.
* @param {Date,number=} modificationDate The last modification date. If
@@ -217,14 +214,12 @@
* @throws {TypeError} In case of invalid parameters.
* @throws {OS.File.Error} In case of I/O error.
*/
- if (SharedAll.Constants.Sys.Name != "Android") {
- File.prototype.setDates = function(accessDate, modificationDate) {
- let {value, ptr} = datesToTimevals(accessDate, modificationDate);
- throw_on_negative("setDates",
- UnixFile.futimes(this.fd, ptr),
- this._path);
- };
- }
+ File.prototype.setDates = function(accessDate, modificationDate) {
+ let {value, ptr} = datesToTimevals(accessDate, modificationDate);
+ throw_on_negative("setDates",
+ UnixFile.futimes(this.fd, ptr),
+ this._path);
+ };
/**
* Flushes the file's buffers and causes all buffered data
@@ -576,7 +571,7 @@
if (UnixFile.splice) {
const BUFSIZE = 1 << 17;
- // An implementation of |pump| using |splice| (for Linux/Android)
+ // An implementation of |pump| using |splice| (for Linux)
pump = function pump_splice(source, dest, options = {}) {
let nbytes = options.nbytes > 0 ? options.nbytes : Infinity;
let pipe = [];
diff --git a/toolkit/components/osfile/moz.build b/toolkit/components/osfile/moz.build
index d17da2d60..e407ea3c7 100644
--- a/toolkit/components/osfile/moz.build
+++ b/toolkit/components/osfile/moz.build
@@ -4,32 +4,16 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-DIRS += [
- 'modules',
-]
-
-MOCHITEST_CHROME_MANIFESTS += ['tests/mochi/chrome.ini']
-XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
-
-SOURCES += [
- 'NativeOSFileInternals.cpp',
-]
+DIRS += ['modules']
XPIDL_MODULE = 'toolkit_osfile'
-XPIDL_SOURCES += [
- 'nsINativeOSFileInternals.idl',
-]
+XPIDL_SOURCES += ['nsINativeOSFileInternals.idl']
-EXPORTS.mozilla += [
- 'NativeOSFileInternals.h',
-]
+EXPORTS.mozilla += ['NativeOSFileInternals.h']
-EXTRA_PP_JS_MODULES += [
- 'osfile.jsm',
-]
+SOURCES += ['NativeOSFileInternals.cpp']
-FINAL_LIBRARY = 'xul'
+EXTRA_PP_JS_MODULES += ['osfile.jsm']
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'OS.File')
+FINAL_LIBRARY = 'xul'
diff --git a/toolkit/components/osfile/tests/mochi/.eslintrc.js b/toolkit/components/osfile/tests/mochi/.eslintrc.js
deleted file mode 100644
index 8c0f4f574..000000000
--- a/toolkit/components/osfile/tests/mochi/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/osfile/tests/mochi/chrome.ini b/toolkit/components/osfile/tests/mochi/chrome.ini
deleted file mode 100644
index 1da463316..000000000
--- a/toolkit/components/osfile/tests/mochi/chrome.ini
+++ /dev/null
@@ -1,15 +0,0 @@
-[DEFAULT]
-skip-if = os == 'android'
-support-files =
- main_test_osfile_async.js
- worker_handler.js
- worker_test_osfile_comms.js
- worker_test_osfile_front.js
- worker_test_osfile_shared.js
- worker_test_osfile_unix.js
- worker_test_osfile_win.js
-
-[test_osfile_async.xul]
-[test_osfile_back.xul]
-[test_osfile_comms.xul]
-[test_osfile_front.xul]
diff --git a/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js b/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js
deleted file mode 100644
index b940a032a..000000000
--- a/toolkit/components/osfile/tests/mochi/main_test_osfile_async.js
+++ /dev/null
@@ -1,443 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Promise.jsm");
-Components.utils.import("resource://gre/modules/Task.jsm");
-Components.utils.import("resource://gre/modules/AsyncShutdown.jsm");
-
-// The following are used to compare against a well-tested reference
-// implementation of file I/O.
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-Components.utils.import("resource://gre/modules/FileUtils.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-var myok = ok;
-var myis = is;
-var myinfo = info;
-var myisnot = isnot;
-
-var isPromise = function ispromise(value) {
- return value != null && typeof value == "object" && "then" in value;
-};
-
-var maketest = function(prefix, test) {
- let utils = {
- ok: function ok(t, m) {
- myok(t, prefix + ": " + m);
- },
- is: function is(l, r, m) {
- myis(l, r, prefix + ": " + m);
- },
- isnot: function isnot(l, r, m) {
- myisnot(l, r, prefix + ": " + m);
- },
- info: function info(m) {
- myinfo(prefix + ": " + m);
- },
- fail: function fail(m) {
- utils.ok(false, m);
- },
- okpromise: function okpromise(t, m) {
- return t.then(
- function onSuccess() {
- util.ok(true, m);
- },
- function onFailure() {
- util.ok(false, m);
- }
- );
- }
- };
- return function runtest() {
- utils.info("Entering");
- try {
- let result = test.call(this, utils);
- if (!isPromise(result)) {
- throw new TypeError("The test did not return a promise");
- }
- utils.info("This was a promise");
- // The test returns a promise
- result = result.then(function test_complete() {
- utils.info("Complete");
- }, function catch_uncaught_errors(err) {
- utils.fail("Uncaught error " + err);
- if (err && typeof err == "object" && "message" in err) {
- utils.fail("(" + err.message + ")");
- }
- if (err && typeof err == "object" && "stack" in err) {
- utils.fail("at " + err.stack);
- }
- });
- return result;
- } catch (x) {
- utils.fail("Error " + x + " at " + x.stack);
- return null;
- }
- };
-};
-
-/**
- * Fetch asynchronously the contents of a file using xpcom.
- *
- * Used for comparing xpcom-based results to os.file-based results.
- *
- * @param {string} path The _absolute_ path to the file.
- * @return {promise}
- * @resolves {string} The contents of the file.
- */
-var reference_fetch_file = function reference_fetch_file(path, test) {
- test.info("Fetching file " + path);
- let promise = Promise.defer();
- let file = new FileUtils.File(path);
- NetUtil.asyncFetch({
- uri: NetUtil.newURI(file),
- loadUsingSystemPrincipal: true
- }, function(stream, status) {
- if (!Components.isSuccessCode(status)) {
- promise.reject(status);
- return;
- }
- let result, reject;
- try {
- result = NetUtil.readInputStreamToString(stream, stream.available());
- } catch (x) {
- reject = x;
- }
- stream.close();
- if (reject) {
- promise.reject(reject);
- } else {
- promise.resolve(result);
- }
- });
-
- return promise.promise;
-};
-
-/**
- * Compare asynchronously the contents two files using xpcom.
- *
- * Used for comparing xpcom-based results to os.file-based results.
- *
- * @param {string} a The _absolute_ path to the first file.
- * @param {string} b The _absolute_ path to the second file.
- *
- * @resolves {null}
- */
-var reference_compare_files = function reference_compare_files(a, b, test) {
- test.info("Comparing files " + a + " and " + b);
- let a_contents = yield reference_fetch_file(a, test);
- let b_contents = yield reference_fetch_file(b, test);
- is(a_contents, b_contents, "Contents of files " + a + " and " + b + " match");
-};
-
-var reference_dir_contents = function reference_dir_contents(path) {
- let result = [];
- let entries = new FileUtils.File(path).directoryEntries;
- while (entries.hasMoreElements()) {
- let entry = entries.getNext().QueryInterface(Components.interfaces.nsILocalFile);
- result.push(entry.path);
- }
- return result;
-};
-
-// Set/Unset OS.Shared.DEBUG, OS.Shared.TEST and a console listener.
-function toggleDebugTest (pref, consoleListener) {
- Services.prefs.setBoolPref("toolkit.osfile.log", pref);
- Services.prefs.setBoolPref("toolkit.osfile.log.redirect", pref);
- Services.console[pref ? "registerListener" : "unregisterListener"](
- consoleListener);
-}
-
-var test = maketest("Main", function main(test) {
- return Task.spawn(function() {
- SimpleTest.waitForExplicitFinish();
- yield test_stat();
- yield test_debug();
- yield test_info_features_detect();
- yield test_position();
- yield test_iter();
- yield test_exists();
- yield test_debug_test();
- info("Test is over");
- SimpleTest.finish();
- });
-});
-
-/**
- * A file that we know exists and that can be used for reading.
- */
-var EXISTING_FILE = OS.Path.join("chrome", "toolkit", "components",
- "osfile", "tests", "mochi", "main_test_osfile_async.js");
-
-/**
- * Test OS.File.stat and OS.File.prototype.stat
- */
-var test_stat = maketest("stat", function stat(test) {
- return Task.spawn(function() {
- // Open a file and stat it
- let file = yield OS.File.open(EXISTING_FILE);
- let stat1;
-
- try {
- test.info("Stating file");
- stat1 = yield file.stat();
- test.ok(true, "stat has worked " + stat1);
- test.ok(stat1, "stat is not empty");
- } finally {
- yield file.close();
- }
-
- // Stat the same file without opening it
- test.info("Stating a file without opening it");
- let stat2 = yield OS.File.stat(EXISTING_FILE);
- test.ok(true, "stat 2 has worked " + stat2);
- test.ok(stat2, "stat 2 is not empty");
- for (let key in stat2) {
- test.is("" + stat1[key], "" + stat2[key], "Stat field " + key + "is the same");
- }
- });
-});
-
-/**
- * Test feature detection using OS.File.Info.prototype on main thread
- */
-var test_info_features_detect = maketest("features_detect", function features_detect(test) {
- return Task.spawn(function() {
- if (OS.Constants.Win) {
- // see if winBirthDate is defined
- if ("winBirthDate" in OS.File.Info.prototype) {
- test.ok(true, "winBirthDate is defined");
- } else {
- test.fail("winBirthDate not defined though we are under Windows");
- }
- } else if (OS.Constants.libc) {
- // see if unixGroup is defined
- if ("unixGroup" in OS.File.Info.prototype) {
- test.ok(true, "unixGroup is defined");
- } else {
- test.fail("unixGroup is not defined though we are under Unix");
- }
- }
- });
-});
-
-/**
- * Test file.{getPosition, setPosition}
- */
-var test_position = maketest("position", function position(test) {
- return Task.spawn(function() {
- let file = yield OS.File.open(EXISTING_FILE);
-
- try {
- let view = yield file.read();
- test.info("First batch of content read");
- let CHUNK_SIZE = 178;// An arbitrary number of bytes to read from the file
- let pos = yield file.getPosition();
- test.info("Obtained position");
- test.is(pos, view.byteLength, "getPosition returned the end of the file");
- pos = yield file.setPosition(-CHUNK_SIZE, OS.File.POS_END);
- test.info("Changed position");
- test.is(pos, view.byteLength - CHUNK_SIZE, "setPosition returned the correct position");
-
- let view2 = yield file.read();
- test.info("Read the end of the file");
- for (let i = 0; i < CHUNK_SIZE; ++i) {
- if (view2[i] != view[i + view.byteLength - CHUNK_SIZE]) {
- test.is(view2[i], view[i], "setPosition put us in the right position");
- }
- }
- } finally {
- yield file.close();
- }
- });
-});
-
-/**
- * Test OS.File.prototype.{DirectoryIterator}
- */
-var test_iter = maketest("iter", function iter(test) {
- return Task.spawn(function() {
- let currentDir = yield OS.File.getCurrentDirectory();
-
- // Trivial walks through the directory
- test.info("Preparing iteration");
- let iterator = new OS.File.DirectoryIterator(currentDir);
- let temporary_file_name = OS.Path.join(currentDir, "empty-temporary-file.tmp");
- try {
- yield OS.File.remove(temporary_file_name);
- } catch (err) {
- // Ignore errors removing file
- }
- let allFiles1 = yield iterator.nextBatch();
- test.info("Obtained all files through nextBatch");
- test.isnot(allFiles1.length, 0, "There is at least one file");
- test.isnot(allFiles1[0].path, null, "Files have a path");
-
- // Ensure that we have the same entries with |reference_dir_contents|
- let referenceEntries = new Set();
- for (let entry of reference_dir_contents(currentDir)) {
- referenceEntries.add(entry);
- }
- test.is(referenceEntries.size, allFiles1.length, "All the entries in the directory have been listed");
- for (let entry of allFiles1) {
- test.ok(referenceEntries.has(entry.path), "File " + entry.path + " effectively exists");
- // Ensure that we have correct isDir and isSymLink
- // Current directory is {objdir}/_tests/testing/mochitest/, assume it has some dirs and symlinks.
- var f = new FileUtils.File(entry.path);
- test.is(entry.isDir, f.isDirectory(), "Get file " + entry.path + " isDir correctly");
- test.is(entry.isSymLink, f.isSymlink(), "Get file " + entry.path + " isSymLink correctly");
- }
-
- yield iterator.close();
- test.info("Closed iterator");
-
- test.info("Double closing DirectoryIterator");
- iterator = new OS.File.DirectoryIterator(currentDir);
- yield iterator.close();
- yield iterator.close(); //double closing |DirectoryIterator|
- test.ok(true, "|DirectoryIterator| was closed twice successfully");
-
- let allFiles2 = [];
- let i = 0;
- iterator = new OS.File.DirectoryIterator(currentDir);
- yield iterator.forEach(function(entry, index) {
- test.is(i++, index, "Getting the correct index");
- allFiles2.push(entry);
- });
- test.info("Obtained all files through forEach");
- is(allFiles1.length, allFiles2.length, "Both runs returned the same number of files");
- for (let i = 0; i < allFiles1.length; ++i) {
- if (allFiles1[i].path != allFiles2[i].path) {
- test.is(allFiles1[i].path, allFiles2[i].path, "Both runs return the same files");
- break;
- }
- }
-
- // Testing batch iteration + whether an iteration can be stopped early
- let BATCH_LENGTH = 10;
- test.info("Getting some files through nextBatch");
- yield iterator.close();
-
- iterator = new OS.File.DirectoryIterator(currentDir);
- let someFiles1 = yield iterator.nextBatch(BATCH_LENGTH);
- let someFiles2 = yield iterator.nextBatch(BATCH_LENGTH);
- yield iterator.close();
-
- iterator = new OS.File.DirectoryIterator(currentDir);
- yield iterator.forEach(function cb(entry, index, iterator) {
- if (index < BATCH_LENGTH) {
- test.is(entry.path, someFiles1[index].path, "Both runs return the same files (part 1)");
- } else if (index < 2*BATCH_LENGTH) {
- test.is(entry.path, someFiles2[index - BATCH_LENGTH].path, "Both runs return the same files (part 2)");
- } else if (index == 2 * BATCH_LENGTH) {
- test.info("Attempting to stop asynchronous forEach");
- return iterator.close();
- } else {
- test.fail("Can we stop an asynchronous forEach? " + index);
- }
- return null;
- });
- yield iterator.close();
-
- // Ensuring that we find new files if they appear
- let file = yield OS.File.open(temporary_file_name, { write: true } );
- file.close();
- iterator = new OS.File.DirectoryIterator(currentDir);
- try {
- let files = yield iterator.nextBatch();
- is(files.length, allFiles1.length + 1, "The directory iterator has noticed the new file");
- let exists = yield iterator.exists();
- test.ok(exists, "After nextBatch, iterator detects that the directory exists");
- } finally {
- yield iterator.close();
- }
-
- // Ensuring that opening a non-existing directory fails consistently
- // once iteration starts.
- try {
- iterator = null;
- iterator = new OS.File.DirectoryIterator("/I do not exist");
- let exists = yield iterator.exists();
- test.ok(!exists, "Before any iteration, iterator detects that the directory doesn't exist");
- let exn = null;
- try {
- yield iterator.next();
- } catch (ex if ex instanceof OS.File.Error && ex.becauseNoSuchFile) {
- exn = ex;
- let exists = yield iterator.exists();
- test.ok(!exists, "After one iteration, iterator detects that the directory doesn't exist");
- }
- test.ok(exn, "Iterating through a directory that does not exist has failed with becauseNoSuchFile");
- } finally {
- if (iterator) {
- iterator.close();
- }
- }
- test.ok(!!iterator, "The directory iterator for a non-existing directory was correctly created");
- });
-});
-
-/**
- * Test OS.File.prototype.{exists}
- */
-var test_exists = maketest("exists", function exists(test) {
- return Task.spawn(function() {
- let fileExists = yield OS.File.exists(EXISTING_FILE);
- test.ok(fileExists, "file exists");
- fileExists = yield OS.File.exists(EXISTING_FILE + ".tmp");
- test.ok(!fileExists, "file does not exists");
- });
-});
-
-/**
- * Test changes to OS.Shared.DEBUG flag.
- */
-var test_debug = maketest("debug", function debug(test) {
- return Task.spawn(function() {
- function testSetDebugPref (pref) {
- try {
- Services.prefs.setBoolPref("toolkit.osfile.log", pref);
- } catch (x) {
- test.fail("Setting OS.Shared.DEBUG to " + pref +
- " should not cause error.");
- } finally {
- test.is(OS.Shared.DEBUG, pref, "OS.Shared.DEBUG is set correctly.");
- }
- }
- testSetDebugPref(true);
- let workerDEBUG = yield OS.File.GET_DEBUG();
- test.is(workerDEBUG, true, "Worker's DEBUG is set.");
- testSetDebugPref(false);
- workerDEBUG = yield OS.File.GET_DEBUG();
- test.is(workerDEBUG, false, "Worker's DEBUG is unset.");
- });
-});
-
-/**
- * Test logging in the main thread with set OS.Shared.DEBUG and
- * OS.Shared.TEST flags.
- */
-var test_debug_test = maketest("debug_test", function debug_test(test) {
- return Task.spawn(function () {
- // Create a console listener.
- let consoleListener = {
- observe: function (aMessage) {
- // Ignore unexpected messages.
- if (!(aMessage instanceof Components.interfaces.nsIConsoleMessage)) {
- return;
- }
- if (aMessage.message.indexOf("TEST OS") < 0) {
- return;
- }
- test.ok(true, "DEBUG TEST messages are logged correctly.");
- }
- };
- toggleDebugTest(true, consoleListener);
- // Execution of OS.File.exist method will trigger OS.File.LOG several times.
- let fileExists = yield OS.File.exists(EXISTING_FILE);
- toggleDebugTest(false, consoleListener);
- });
-});
-
-
diff --git a/toolkit/components/osfile/tests/mochi/test_osfile_async.xul b/toolkit/components/osfile/tests/mochi/test_osfile_async.xul
deleted file mode 100644
index 1ef103f02..000000000
--- a/toolkit/components/osfile/tests/mochi/test_osfile_async.xul
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
--->
-<window title="Testing async I/O with OS.File"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="test();">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
- <script type="application/javascript"
- src="main_test_osfile_async.js"/>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display:none;"></div>
- <pre id="test"></pre>
- </body>
- <label id="test-result"/>
-</window>
diff --git a/toolkit/components/osfile/tests/mochi/test_osfile_back.xul b/toolkit/components/osfile/tests/mochi/test_osfile_back.xul
deleted file mode 100644
index b6af6303f..000000000
--- a/toolkit/components/osfile/tests/mochi/test_osfile_back.xul
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
--->
-<window title="Testing OS.File on a chrome worker thread"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="test();">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
- <script type="application/javascript"
- src="worker_handler.js"/>
- <script type="application/javascript">
- <![CDATA[
-
-let worker;
-
-function test() {
- ok(true, "test_osfile.xul: Starting test");
- if (navigator.platform.indexOf("Win") != -1) {
- ok(true, "test_osfile.xul: Using Windows test suite");
- worker = new ChromeWorker("worker_test_osfile_win.js");
- } else {
- ok(true, "test_osfile.xul: Using Unix test suite");
- worker = new ChromeWorker("worker_test_osfile_unix.js");
- }
- SimpleTest.waitForExplicitFinish();
- ok(true, "test_osfile.xul: Chrome worker created");
- dump("MAIN: go\n");
- worker_handler(worker);
- worker.postMessage(0);
- ok(true, "test_osfile.xul: Test in progress");
-};
-]]>
- </script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display:none;"></div>
- <pre id="test"></pre>
- </body>
- <label id="test-result"/>
-</window>
diff --git a/toolkit/components/osfile/tests/mochi/test_osfile_comms.xul b/toolkit/components/osfile/tests/mochi/test_osfile_comms.xul
deleted file mode 100644
index 88e474ce2..000000000
--- a/toolkit/components/osfile/tests/mochi/test_osfile_comms.xul
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
--->
-<window title="Testing OS.File on a chrome worker thread"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="test();">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
- <script type="application/javascript">
- <![CDATA[
-
-"use strict";
-
-let worker;
-
-let test = function test() {
- SimpleTest.info("test_osfile_comms.xul: Starting test");
- Components.utils.import("resource://gre/modules/ctypes.jsm");
- Components.utils.import("resource://gre/modules/osfile.jsm");
- worker = new ChromeWorker("worker_test_osfile_comms.js");
- SimpleTest.waitForExplicitFinish();
- try {
- worker.onerror = function onerror(error) {
- SimpleTest.ok(false, "received error "+error);
- }
- worker.onmessage = function onmessage(msg) {
- Components.utils.forceShrinkingGC();
- switch (msg.data.kind) {
- case "is":
- SimpleTest.ok(msg.data.outcome, msg.data.description +
- " ("+ msg.data.a + " ==? " + msg.data.b + ")" );
- return;
- case "isnot":
- SimpleTest.ok(msg.data.outcome, msg.data.description +
- " ("+ msg.data.a + " !=? " + msg.data.b + ")" );
- return;
- case "ok":
- SimpleTest.ok(msg.data.condition, msg.data.description);
- return;
- case "info":
- SimpleTest.info(msg.data.description);
- return;
- case "finish":
- SimpleTest.finish();
- return;
- case "value":
- SimpleTest.ok(true, "test_osfile_comms.xul: Received value " + JSON.stringify(msg.data.value));
- let type = eval(msg.data.typename);
- let check = eval(msg.data.check);
- let value = msg.data.value;
- let deserialized = type.fromMsg(value);
- check(deserialized, "Main thread test: ");
- return;
- default:
- SimpleTest.ok(false, "test_osfile_comms.xul: wrong message "+JSON.stringify(msg.data));
- return;
- }
- };
- worker.postMessage(0)
- ok(true, "Worker launched");
- } catch(x) {
- // As we have set |waitForExplicitFinish|, we add this fallback
- // in case of uncaught error, to ensure that the test does not
- // just freeze.
- ok(false, "Caught exception " + x + " at " + x.stack);
- SimpleTest.finish();
- }
-};
-
-]]>
- </script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display:none;"></div>
- <pre id="test"></pre>
- </body>
- <label id="test-result"/>
-</window>
diff --git a/toolkit/components/osfile/tests/mochi/test_osfile_front.xul b/toolkit/components/osfile/tests/mochi/test_osfile_front.xul
deleted file mode 100644
index 10d3fbd01..000000000
--- a/toolkit/components/osfile/tests/mochi/test_osfile_front.xul
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
--->
-<window title="Testing OS.File on a chrome worker thread"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="test();">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
- <script type="application/javascript"
- src="worker_handler.js"/>
- <script type="application/javascript">
- <![CDATA[
-
-let worker;
-let main = this;
-
-function test() {
- info("test_osfile_front.xul: Starting test");
-
- // Test the OS.File worker
-
- worker = new ChromeWorker("worker_test_osfile_front.js");
- SimpleTest.waitForExplicitFinish();
- info("test_osfile_front.xul: Chrome worker created");
- dump("MAIN: go\n");
- worker_handler(worker);
- worker.postMessage(0);
- ok(true, "test_osfile_front.xul: Test in progress");
-};
-]]>
- </script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display:none;"></div>
- <pre id="test"></pre>
- </body>
- <label id="test-result"/>
-</window>
diff --git a/toolkit/components/osfile/tests/mochi/worker_handler.js b/toolkit/components/osfile/tests/mochi/worker_handler.js
deleted file mode 100644
index 6c513e6ba..000000000
--- a/toolkit/components/osfile/tests/mochi/worker_handler.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function worker_handler(worker) {
- worker.onerror = function(error) {
- error.preventDefault();
- ok(false, "Worker error " + error.message);
- }
- worker.onmessage = function(msg) {
- ok(true, "MAIN: onmessage " + JSON.stringify(msg.data));
- switch (msg.data.kind) {
- case "is":
- SimpleTest.ok(msg.data.outcome, msg.data.description +
- "( "+ msg.data.a + " ==? " + msg.data.b + ")" );
- return;
- case "isnot":
- SimpleTest.ok(msg.data.outcome, msg.data.description +
- "( "+ msg.data.a + " !=? " + msg.data.b + ")" );
- return;
- case "ok":
- SimpleTest.ok(msg.data.condition, msg.data.description);
- return;
- case "info":
- SimpleTest.info(msg.data.description);
- return;
- case "finish":
- SimpleTest.finish();
- return;
- default:
- SimpleTest.ok(false, "test_osfile.xul: wrong message " + JSON.stringify(msg.data));
- return;
- }
- };
-}
diff --git a/toolkit/components/osfile/tests/mochi/worker_test_osfile_comms.js b/toolkit/components/osfile/tests/mochi/worker_test_osfile_comms.js
deleted file mode 100644
index 5e8bdd9ca..000000000
--- a/toolkit/components/osfile/tests/mochi/worker_test_osfile_comms.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-importScripts('worker_test_osfile_shared.js');
-
-// The set of samples for communications test. Declare as a global
-// variable to prevent this from being garbage-collected too early.
-var samples;
-
-self.onmessage = function(msg) {
- info("Initializing");
- self.onmessage = function on_unexpected_message(msg) {
- throw new Error("Unexpected message " + JSON.stringify(msg.data));
- };
- importScripts("resource://gre/modules/osfile.jsm");
- info("Initialization complete");
-
- samples = [
- { typename: "OS.Shared.Type.char.in_ptr",
- valuedescr: "String",
- value: "This is a test",
- type: OS.Shared.Type.char.in_ptr,
- check: function check_string(candidate, prefix) {
- is(candidate, "This is a test", prefix);
- }},
- { typename: "OS.Shared.Type.char.in_ptr",
- valuedescr: "Typed array",
- value: (function() {
- let view = new Uint8Array(15);
- for (let i = 0; i < 15; ++i) {
- view[i] = i;
- }
- return view;
- })(),
- type: OS.Shared.Type.char.in_ptr,
- check: function check_ArrayBuffer(candidate, prefix) {
- for (let i = 0; i < 15; ++i) {
- is(candidate[i], i % 256, prefix + "Checking that the contents of the ArrayBuffer were preserved");
- }
- }},
- { typename: "OS.Shared.Type.char.in_ptr",
- valuedescr: "Pointer",
- value: new OS.Shared.Type.char.in_ptr.implementation(1),
- type: OS.Shared.Type.char.in_ptr,
- check: function check_ptr(candidate, prefix) {
- let address = ctypes.cast(candidate, ctypes.uintptr_t).value.toString();
- is(address, "1", prefix + "Checking that the pointer address was preserved");
- }},
- { typename: "OS.Shared.Type.char.in_ptr",
- valuedescr: "C array",
- value: (function() {
- let buf = new (ctypes.ArrayType(ctypes.uint8_t, 15))();
- for (let i = 0; i < 15; ++i) {
- buf[i] = i % 256;
- }
- return buf;
- })(),
- type: OS.Shared.Type.char.in_ptr,
- check: function check_array(candidate, prefix) {
- let cast = ctypes.cast(candidate, ctypes.uint8_t.ptr);
- for (let i = 0; i < 15; ++i) {
- is(cast.contents, i % 256, prefix + "Checking that the contents of the C array were preserved, index " + i);
- cast = cast.increment();
- }
- }
- },
- { typename: "OS.File.Error",
- valuedescr: "OS Error",
- type: OS.File.Error,
- value: new OS.File.Error("foo", 1),
- check: function check_error(candidate, prefix) {
- ok(candidate instanceof OS.File.Error,
- prefix + "Error is an OS.File.Error");
- ok(candidate.unixErrno == 1 || candidate.winLastError == 1,
- prefix + "Error code is correct");
- try {
- let string = candidate.toString();
- info(prefix + ".toString() works " + string);
- } catch (x) {
- ok(false, prefix + ".toString() fails " + x);
- }
- }
- }
- ];
- samples.forEach(function test(sample) {
- let type = sample.type;
- let value = sample.value;
- let check = sample.check;
- info("Testing handling of type " + sample.typename + " communicating " + sample.valuedescr);
-
- // 1. Test serialization
- let serialized;
- let exn;
- try {
- serialized = type.toMsg(value);
- } catch (ex) {
- exn = ex;
- }
- is(exn, null, "Can I serialize the following value? " + value +
- " aka " + JSON.stringify(value));
- if (exn) {
- return;
- }
-
- if ("data" in serialized) {
- // Unwrap from `Meta`
- serialized = serialized.data;
- }
-
- // 2. Test deserialization
- let deserialized;
- try {
- deserialized = type.fromMsg(serialized);
- } catch (ex) {
- exn = ex;
- }
- is(exn, null, "Can I deserialize the following message? " + serialized
- + " aka " + JSON.stringify(serialized));
- if (exn) {
- return;
- }
-
- // 3. Local test deserialized value
- info("Running test on deserialized value " + deserialized +
- " aka " + JSON.stringify(deserialized));
- check(deserialized, "Local test: ");
-
- // 4. Test sending serialized
- info("Attempting to send message");
- try {
- self.postMessage({kind:"value",
- typename: sample.typename,
- value: serialized,
- check: check.toSource()});
- } catch (ex) {
- exn = ex;
- }
- is(exn, null, "Can I send the following message? " + serialized
- + " aka " + JSON.stringify(serialized));
- });
-
- finish();
- };
diff --git a/toolkit/components/osfile/tests/mochi/worker_test_osfile_front.js b/toolkit/components/osfile/tests/mochi/worker_test_osfile_front.js
deleted file mode 100644
index 29e613510..000000000
--- a/toolkit/components/osfile/tests/mochi/worker_test_osfile_front.js
+++ /dev/null
@@ -1,566 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-importScripts('worker_test_osfile_shared.js');
-importScripts("resource://gre/modules/workers/require.js");
-
-var SharedAll = require("resource://gre/modules/osfile/osfile_shared_allthreads.jsm");
-SharedAll.Config.DEBUG = true;
-
-function should_throw(f) {
- try {
- f();
- } catch (x) {
- return x;
- }
- return null;
-}
-
-self.onmessage = function onmessage_start(msg) {
- self.onmessage = function onmessage_ignored(msg) {
- log("ignored message " + JSON.stringify(msg.data));
- };
- try {
- test_init();
- test_open_existing_file();
- test_open_non_existing_file();
- test_flush_open_file();
- test_copy_existing_file();
- test_position();
- test_move_file();
- test_iter_dir();
- test_info();
- test_path();
- test_exists_file();
- test_remove_file();
- } catch (x) {
- log("Catching error: " + x);
- log("Stack: " + x.stack);
- log("Source: " + x.toSource());
- ok(false, x.toString() + "\n" + x.stack);
- }
- finish();
-};
-
-function test_init() {
- info("Starting test_init");
- importScripts("resource://gre/modules/osfile.jsm");
-}
-
-/**
- * Test that we can open an existing file.
- */
-function test_open_existing_file()
-{
- info("Starting test_open_existing");
- let file = OS.File.open("chrome/toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js");
- file.close();
-}
-
-/**
- * Test that opening a file that does not exist fails with the right error.
- */
-function test_open_non_existing_file()
-{
- info("Starting test_open_non_existing");
- let exn;
- try {
- let file = OS.File.open("/I do not exist");
- } catch (x) {
- exn = x;
- info("test_open_non_existing_file: Exception detail " + exn);
- }
- ok(!!exn, "test_open_non_existing_file: Exception was raised ");
- ok(exn instanceof OS.File.Error, "test_open_non_existing_file: Exception was a OS.File.Error");
- ok(exn.becauseNoSuchFile, "test_open_non_existing_file: Exception confirms that the file does not exist");
-}
-
-/**
- * Test that to ensure that |foo.flush()| does not
- * cause an error, where |foo| is an open file.
- */
-function test_flush_open_file()
-{
- info("Starting test_flush_open_file");
- let tmp = "test_flush.tmp";
- let file = OS.File.open(tmp, {create: true, write: true});
- file.flush();
- file.close();
- OS.File.remove(tmp);
-}
-
-/**
- * Utility function for comparing two files (or a prefix of two files).
- *
- * This function returns nothing but fails of both files (or prefixes)
- * are not identical.
- *
- * @param {string} test The name of the test (used for logging).
- * @param {string} sourcePath The name of the first file.
- * @param {string} destPath The name of the second file.
- * @param {number=} prefix If specified, only compare the |prefix|
- * first bytes of |sourcePath| and |destPath|.
- */
-function compare_files(test, sourcePath, destPath, prefix)
-{
- info(test + ": Comparing " + sourcePath + " and " + destPath);
- let source = OS.File.open(sourcePath);
- let dest = OS.File.open(destPath);
- info("Files are open");
- let sourceResult, destResult;
- try {
- if (prefix != undefined) {
- sourceResult = source.read(prefix);
- destResult = dest.read(prefix);
- } else {
- sourceResult = source.read();
- destResult = dest.read();
- }
- is(sourceResult.length, destResult.length, test + ": Both files have the same size");
- for (let i = 0; i < sourceResult.length; ++i) {
- if (sourceResult[i] != destResult[i]) {
- is(sourceResult[i] != destResult[i], test + ": Comparing char " + i);
- break;
- }
- }
- } finally {
- source.close();
- dest.close();
- }
- info(test + ": Comparison complete");
-}
-
-/**
- * Test that copying a file using |copy| works.
- */
-function test_copy_existing_file()
-{
- let src_file_name =
- OS.Path.join("chrome", "toolkit", "components", "osfile", "tests", "mochi",
- "worker_test_osfile_front.js");
- let tmp_file_name = "test_osfile_front.tmp";
- info("Starting test_copy_existing");
- OS.File.copy(src_file_name, tmp_file_name);
-
- info("test_copy_existing: Copy complete");
- compare_files("test_copy_existing", src_file_name, tmp_file_name);
-
- // Create a bogus file with arbitrary content, then attempt to overwrite
- // it with |copy|.
- let dest = OS.File.open(tmp_file_name, {trunc: true});
- let buf = new Uint8Array(50);
- dest.write(buf);
- dest.close();
-
- OS.File.copy(src_file_name, tmp_file_name);
-
- compare_files("test_copy_existing 2", src_file_name, tmp_file_name);
-
- // Attempt to overwrite with noOverwrite
- let exn;
- try {
- OS.File.copy(src_file_name, tmp_file_name, {noOverwrite: true});
- } catch(x) {
- exn = x;
- }
- ok(!!exn, "test_copy_existing: noOverwrite prevents overwriting existing files");
-
- info("test_copy_existing: Cleaning up");
- OS.File.remove(tmp_file_name);
-}
-
-/**
- * Test that moving a file works.
- */
-function test_move_file()
-{
- info("test_move_file: Starting");
- // 1. Copy file into a temporary file
- let src_file_name =
- OS.Path.join("chrome", "toolkit", "components", "osfile", "tests", "mochi",
- "worker_test_osfile_front.js");
- let tmp_file_name = "test_osfile_front.tmp";
- let tmp2_file_name = "test_osfile_front.tmp2";
- OS.File.copy(src_file_name, tmp_file_name);
-
- info("test_move_file: Copy complete");
-
- // 2. Move
- OS.File.move(tmp_file_name, tmp2_file_name);
-
- info("test_move_file: Move complete");
-
- // 3. Check that destination exists
- compare_files("test_move_file", src_file_name, tmp2_file_name);
-
- // 4. Check that original file does not exist anymore
- let exn;
- try {
- OS.File.open(tmp_file_name);
- } catch (x) {
- exn = x;
- }
- ok(!!exn, "test_move_file: Original file has been removed");
-
- info("test_move_file: Cleaning up");
- OS.File.remove(tmp2_file_name);
-}
-
-function test_iter_dir()
-{
- info("test_iter_dir: Starting");
-
- // Create a file, to be sure that it exists
- let tmp_file_name = "test_osfile_front.tmp";
- let tmp_file = OS.File.open(tmp_file_name, {write: true, trunc:true});
- tmp_file.close();
-
- let parent = OS.File.getCurrentDirectory();
- info("test_iter_dir: directory " + parent);
- let iterator = new OS.File.DirectoryIterator(parent);
- info("test_iter_dir: iterator created");
- let encountered_tmp_file = false;
- for (let entry in iterator) {
- // Checking that |name| can be decoded properly
- info("test_iter_dir: encountering entry " + entry.name);
-
- if (entry.name == tmp_file_name) {
- encountered_tmp_file = true;
- isnot(entry.isDir, "test_iter_dir: The temporary file is not a directory");
- isnot(entry.isSymLink, "test_iter_dir: The temporary file is not a link");
- }
-
- let file;
- let success = true;
- try {
- file = OS.File.open(entry.path);
- } catch (x) {
- if (x.becauseNoSuchFile) {
- success = false;
- }
- }
- if (file) {
- file.close();
- }
- ok(success, "test_iter_dir: Entry " + entry.path + " exists");
-
- if (OS.Win) {
- // We assume that the files are at least as recent as 2009.
- // Since this test was written in 2011 and some of our packaging
- // sets dates arbitrarily to 2010, this should be safe.
- let year = new Date().getFullYear();
- let creation = entry.winCreationDate;
- ok(creation, "test_iter_dir: Windows creation date exists: " + creation);
- ok(creation.getFullYear() >= 2009 && creation.getFullYear() <= year, "test_iter_dir: consistent creation date");
-
- let lastWrite = entry.winLastWriteDate;
- ok(lastWrite, "test_iter_dir: Windows lastWrite date exists: " + lastWrite);
- ok(lastWrite.getFullYear() >= 2009 && lastWrite.getFullYear() <= year, "test_iter_dir: consistent lastWrite date");
-
- let lastAccess = entry.winLastAccessDate;
- ok(lastAccess, "test_iter_dir: Windows lastAccess date exists: " + lastAccess);
- ok(lastAccess.getFullYear() >= 2009 && lastAccess.getFullYear() <= year, "test_iter_dir: consistent lastAccess date");
- }
-
- }
- ok(encountered_tmp_file, "test_iter_dir: We have found the temporary file");
-
- info("test_iter_dir: Cleaning up");
- iterator.close();
-
- // Testing nextBatch()
- iterator = new OS.File.DirectoryIterator(parent);
- let allentries = [];
- for (let x in iterator) {
- allentries.push(x);
- }
- iterator.close();
-
- ok(allentries.length >= 14, "test_iter_dir: Meta-check: the test directory should contain at least 14 items");
-
- iterator = new OS.File.DirectoryIterator(parent);
- let firstten = iterator.nextBatch(10);
- is(firstten.length, 10, "test_iter_dir: nextBatch(10) returns 10 items");
- for (let i = 0; i < firstten.length; ++i) {
- is(allentries[i].path, firstten[i].path, "test_iter_dir: Checking that batch returns the correct entries");
- }
- let nextthree = iterator.nextBatch(3);
- is(nextthree.length, 3, "test_iter_dir: nextBatch(3) returns 3 items");
- for (let i = 0; i < nextthree.length; ++i) {
- is(allentries[i + firstten.length].path, nextthree[i].path, "test_iter_dir: Checking that batch 2 returns the correct entries");
- }
- let everythingelse = iterator.nextBatch();
- ok(everythingelse.length >= 1, "test_iter_dir: nextBatch() returns at least one item");
- for (let i = 0; i < everythingelse.length; ++i) {
- is(allentries[i + firstten.length + nextthree.length].path, everythingelse[i].path, "test_iter_dir: Checking that batch 3 returns the correct entries");
- }
- is(iterator.nextBatch().length, 0, "test_iter_dir: Once there is nothing left, nextBatch returns an empty array");
- iterator.close();
-
- iterator = new OS.File.DirectoryIterator(parent);
- iterator.close();
- is(iterator.nextBatch().length, 0, "test_iter_dir: nextBatch on closed iterator returns an empty array");
-
- iterator = new OS.File.DirectoryIterator(parent);
- let allentries2 = iterator.nextBatch();
- is(allentries.length, allentries2.length, "test_iter_dir: Checking that getBatch(null) returns the right number of entries");
- for (let i = 0; i < allentries.length; ++i) {
- is(allentries[i].path, allentries2[i].path, "test_iter_dir: Checking that getBatch(null) returns everything in the right order");
- }
- iterator.close();
-
- // Test forEach
- iterator = new OS.File.DirectoryIterator(parent);
- let index = 0;
- iterator.forEach(
- function cb(entry, aIndex, aIterator) {
- is(index, aIndex, "test_iter_dir: Checking that forEach index is correct");
- ok(iterator == aIterator, "test_iter_dir: Checking that right iterator is passed");
- if (index < 10) {
- is(allentries[index].path, entry.path, "test_iter_dir: Checking that forEach entry is correct");
- } else if (index == 10) {
- iterator.close();
- } else {
- ok(false, "test_iter_dir: Checking that forEach can be stopped early");
- }
- ++index;
- });
- iterator.close();
-
- //test for prototype |OS.File.DirectoryIterator.unixAsFile|
- if ("unixAsFile" in OS.File.DirectoryIterator.prototype) {
- info("testing property unixAsFile");
- let path = OS.Path.join("chrome", "toolkit", "components", "osfile", "tests", "mochi");
- iterator = new OS.File.DirectoryIterator(path);
-
- let dir_file = iterator.unixAsFile();// return |File|
- let stat0 = dir_file.stat();
- let stat1 = OS.File.stat(path);
-
- let unix_info_to_string = function unix_info_to_string(info) {
- return "| " + info.unixMode + " | " + info.unixOwner + " | " + info.unixGroup + " | " + info.creationDate + " | " + info.lastModificationDate + " | " + info.lastAccessDate + " | " + info.size + " |";
- };
-
- let s0_string = unix_info_to_string(stat0);
- let s1_string = unix_info_to_string(stat1);
-
- ok(stat0.isDir, "unixAsFile returned a directory");
- is(s0_string, s1_string, "unixAsFile returned the correct file");
- dir_file.close();
- iterator.close();
- }
- info("test_iter_dir: Complete");
-}
-
-function test_position() {
- info("test_position: Starting");
-
- ok("POS_START" in OS.File, "test_position: POS_START exists");
- ok("POS_CURRENT" in OS.File, "test_position: POS_CURRENT exists");
- ok("POS_END" in OS.File, "test_position: POS_END exists");
-
- let ARBITRARY_POSITION = 321;
- let src_file_name =
- OS.Path.join("chrome", "toolkit", "components", "osfile", "tests", "mochi",
- "worker_test_osfile_front.js");
-
- let file = OS.File.open(src_file_name);
- is(file.getPosition(), 0, "test_position: Initial position is 0");
-
- let size = 0 + file.stat().size; // Hack: We can remove this 0 + once 776259 has landed
-
- file.setPosition(ARBITRARY_POSITION, OS.File.POS_START);
- is(file.getPosition(), ARBITRARY_POSITION, "test_position: Setting position from start");
-
- file.setPosition(0, OS.File.POS_START);
- is(file.getPosition(), 0, "test_position: Setting position from start back to 0");
-
- file.setPosition(ARBITRARY_POSITION);
- is(file.getPosition(), ARBITRARY_POSITION, "test_position: Setting position without argument");
-
- file.setPosition(-ARBITRARY_POSITION, OS.File.POS_END);
- is(file.getPosition(), size - ARBITRARY_POSITION, "test_position: Setting position from end");
-
- file.setPosition(ARBITRARY_POSITION, OS.File.POS_CURRENT);
- is(file.getPosition(), size, "test_position: Setting position from current");
-
- file.close();
- info("test_position: Complete");
-}
-
-function test_info() {
- info("test_info: Starting");
-
- let filename = "test_info.tmp";
- let size = 261;// An arbitrary file length
- let start = new Date();
-
- // Cleanup any leftover from previous tests
- try {
- OS.File.remove(filename);
- info("test_info: Cleaned up previous garbage");
- } catch (x) {
- if (!x.becauseNoSuchFile) {
- throw x;
- }
- info("test_info: No previous garbage");
- }
-
- let file = OS.File.open(filename, {trunc: true});
- let buf = new ArrayBuffer(size);
- file._write(buf, size);
- file.close();
-
- // Test OS.File.stat on new file
- let stat = OS.File.stat(filename);
- ok(!!stat, "test_info: info acquired");
- ok(!stat.isDir, "test_info: file is not a directory");
- is(stat.isSymLink, false, "test_info: file is not a link");
- is(stat.size.toString(), size, "test_info: correct size");
-
- let stop = new Date();
-
- // We round down/up by 1s as file system precision is lower than
- // Date precision (no clear specifications about that, but it seems
- // that this can be a little over 1 second under ext3 and 2 seconds
- // under FAT).
- let SLOPPY_FILE_SYSTEM_ADJUSTMENT = 3000;
- let startMs = start.getTime() - SLOPPY_FILE_SYSTEM_ADJUSTMENT;
- let stopMs = stop.getTime() + SLOPPY_FILE_SYSTEM_ADJUSTMENT;
- info("Testing stat with bounds [ " + startMs + ", " + stopMs +" ]");
-
- (function() {
- let birth;
- if ("winBirthDate" in stat) {
- birth = stat.winBirthDate;
- } else if ("macBirthDate" in stat) {
- birth = stat.macBirthDate;
- } else {
- ok(true, "Skipping birthdate test");
- return;
- }
- ok(birth.getTime() <= stopMs,
- "test_info: platformBirthDate is consistent");
- // Note: Previous versions of this test checked whether the file
- // has been created after the start of the test. Unfortunately,
- // this sometimes failed under Windows, in specific circumstances:
- // if the file has been removed at the start of the test and
- // recreated immediately, the Windows file system detects this and
- // decides that the file was actually truncated rather than
- // recreated, hence that it should keep its previous creation
- // date. Debugging hilarity ensues.
- });
-
- let change = stat.lastModificationDate;
- info("Testing lastModificationDate: " + change);
- ok(change.getTime() >= startMs && change.getTime() <= stopMs,
- "test_info: lastModificationDate is consistent");
-
- // Test OS.File.prototype.stat on new file
- file = OS.File.open(filename);
- try {
- stat = file.stat();
- } finally {
- file.close();
- }
-
- ok(!!stat, "test_info: info acquired 2");
- ok(!stat.isDir, "test_info: file is not a directory 2");
- ok(!stat.isSymLink, "test_info: file is not a link 2");
- is(stat.size.toString(), size, "test_info: correct size 2");
-
- stop = new Date();
-
- // Round up/down as above
- startMs = start.getTime() - SLOPPY_FILE_SYSTEM_ADJUSTMENT;
- stopMs = stop.getTime() + SLOPPY_FILE_SYSTEM_ADJUSTMENT;
- info("Testing stat 2 with bounds [ " + startMs + ", " + stopMs +" ]");
-
- let access = stat.lastAccessDate;
- info("Testing lastAccessDate: " + access);
- ok(access.getTime() >= startMs && access.getTime() <= stopMs,
- "test_info: lastAccessDate is consistent");
-
- change = stat.lastModificationDate;
- info("Testing lastModificationDate 2: " + change);
- ok(change.getTime() >= startMs && change.getTime() <= stopMs,
- "test_info: lastModificationDate 2 is consistent");
-
- // Test OS.File.stat on directory
- stat = OS.File.stat(OS.File.getCurrentDirectory());
- ok(!!stat, "test_info: info on directory acquired");
- ok(stat.isDir, "test_info: directory is a directory");
-
- info("test_info: Complete");
-}
-
-// Note that most of the features of path are tested in
-// worker_test_osfile_{unix, win}.js
-function test_path()
-{
- info("test_path: starting");
- let abcd = OS.Path.join("a", "b", "c", "d");
- is(OS.Path.basename(abcd), "d", "basename of a/b/c/d");
-
- let abc = OS.Path.join("a", "b", "c");
- is(OS.Path.dirname(abcd), abc, "dirname of a/b/c/d");
-
- let abdotsc = OS.Path.join("a", "b", "..", "c");
- is(OS.Path.normalize(abdotsc), OS.Path.join("a", "c"), "normalize a/b/../c");
-
- let adotsdotsdots = OS.Path.join("a", "..", "..", "..");
- is(OS.Path.normalize(adotsdotsdots), OS.Path.join("..", ".."), "normalize a/../../..");
-
- info("test_path: Complete");
-}
-
-/**
- * Test the file |exists| method.
- */
-function test_exists_file()
-{
- let file_name = OS.Path.join("chrome", "toolkit", "components" ,"osfile",
- "tests", "mochi", "test_osfile_front.xul");
- info("test_exists_file: starting");
- ok(OS.File.exists(file_name), "test_exists_file: file exists (OS.File.exists)");
- ok(!OS.File.exists(file_name + ".tmp"), "test_exists_file: file does not exists (OS.File.exists)");
-
- let dir_name = OS.Path.join("chrome", "toolkit", "components" ,"osfile",
- "tests", "mochi");
- ok(OS.File.exists(dir_name), "test_exists_file: directory exists");
- ok(!OS.File.exists(dir_name) + ".tmp", "test_exists_file: directory does not exist");
-
- info("test_exists_file: complete");
-}
-
-/**
- * Test the file |remove| method.
- */
-function test_remove_file()
-{
- let absent_file_name = "test_osfile_front_absent.tmp";
-
- // Check that removing absent files is handled correctly
- let exn = should_throw(function() {
- OS.File.remove(absent_file_name, {ignoreAbsent: false});
- });
- ok(!!exn, "test_remove_file: throws if there is no such file");
-
- exn = should_throw(function() {
- OS.File.remove(absent_file_name, {ignoreAbsent: true});
- OS.File.remove(absent_file_name);
- });
- ok(!exn, "test_remove_file: ignoreAbsent works");
-
- if (OS.Win) {
- let file_name = "test_osfile_front_file_to_remove.tmp";
- let file = OS.File.open(file_name, {write: true});
- file.close();
- ok(OS.File.exists(file_name), "test_remove_file: test file exists");
- OS.Win.File.SetFileAttributes(file_name,
- OS.Constants.Win.FILE_ATTRIBUTE_READONLY);
- OS.File.remove(file_name);
- ok(!OS.File.exists(file_name),
- "test_remove_file: test file has been removed");
- }
-}
diff --git a/toolkit/components/osfile/tests/mochi/worker_test_osfile_shared.js b/toolkit/components/osfile/tests/mochi/worker_test_osfile_shared.js
deleted file mode 100644
index da82d4b0a..000000000
--- a/toolkit/components/osfile/tests/mochi/worker_test_osfile_shared.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function log(text) {
- dump("WORKER " + text + "\n");
-}
-
-function send(message) {
- self.postMessage(message);
-}
-
-function finish() {
- send({kind: "finish"});
-}
-
-function ok(condition, description) {
- send({kind: "ok", condition: !!condition, description: "" + description});
-}
-
-function is(a, b, description) {
- let outcome = a == b; // Need to decide outcome here, as not everything can be serialized
- send({kind: "is", outcome: outcome, description: "" + description, a: "" + a, b: "" + b});
-}
-
-function isnot(a, b, description) {
- let outcome = a != b; // Need to decide outcome here, as not everything can be serialized
- send({kind: "isnot", outcome: outcome, description: "" + description, a: "" + a, b: "" + b});
-}
-
-function info(description) {
- send({kind: "info", description: "" + description});
-}
diff --git a/toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js b/toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js
deleted file mode 100644
index 9fe2d0b4e..000000000
--- a/toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js
+++ /dev/null
@@ -1,201 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-importScripts('worker_test_osfile_shared.js');
-
-self.onmessage = function(msg) {
- log("received message "+JSON.stringify(msg.data));
- self.onmessage = function(msg) {
- log("ignored message "+JSON.stringify(msg.data));
- };
- test_init();
- test_getcwd();
- test_open_close();
- test_create_file();
- test_access();
- test_read_write();
- test_passing_undefined();
- finish();
-};
-
-function test_init() {
- info("Starting test_init");
- importScripts("resource://gre/modules/osfile.jsm");
-}
-
-function test_open_close() {
- info("Starting test_open_close");
- is(typeof OS.Unix.File.open, "function", "OS.Unix.File.open is a function");
- let file = OS.Unix.File.open("chrome/toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js", OS.Constants.libc.O_RDONLY, 0);
- isnot(file, -1, "test_open_close: opening succeeded");
- info("Close: "+OS.Unix.File.close.toSource());
- let result = OS.Unix.File.close(file);
- is(result, 0, "test_open_close: close succeeded");
-
- file = OS.Unix.File.open("/i do not exist", OS.Constants.libc.O_RDONLY, 0);
- is(file, -1, "test_open_close: opening of non-existing file failed");
- is(ctypes.errno, OS.Constants.libc.ENOENT, "test_open_close: error is ENOENT");
-}
-
-function test_create_file()
-{
- info("Starting test_create_file");
- let file = OS.Unix.File.open("test.tmp", OS.Constants.libc.O_RDWR
- | OS.Constants.libc.O_CREAT
- | OS.Constants.libc.O_TRUNC,
- OS.Constants.libc.S_IRWXU);
- isnot(file, -1, "test_create_file: file created");
- OS.Unix.File.close(file);
-}
-
-function test_access()
-{
- info("Starting test_access");
- let file = OS.Unix.File.open("test1.tmp", OS.Constants.libc.O_RDWR
- | OS.Constants.libc.O_CREAT
- | OS.Constants.libc.O_TRUNC,
- OS.Constants.libc.S_IRWXU);
- let result = OS.Unix.File.access("test1.tmp", OS.Constants.libc.R_OK | OS.Constants.libc.W_OK | OS.Constants.libc.X_OK | OS.Constants.libc.F_OK);
- is(result, 0, "first call to access() succeeded");
- OS.Unix.File.close(file);
-
- file = OS.Unix.File.open("test1.tmp", OS.Constants.libc.O_WRONLY
- | OS.Constants.libc.O_CREAT
- | OS.Constants.libc.O_TRUNC,
- OS.Constants.libc.S_IWUSR);
-
- info("test_access: preparing second call to access()");
- result = OS.Unix.File.access("test2.tmp", OS.Constants.libc.R_OK
- | OS.Constants.libc.W_OK
- | OS.Constants.libc.X_OK
- | OS.Constants.libc.F_OK);
- is(result, -1, "test_access: second call to access() failed as expected");
- is(ctypes.errno, OS.Constants.libc.ENOENT, "This is the correct error");
- OS.Unix.File.close(file);
-}
-
-function test_getcwd()
-{
- let array = new (ctypes.ArrayType(ctypes.char, 32768))();
- let path = OS.Unix.File.getcwd(array, array.length);
- if (ctypes.char.ptr(path).isNull()) {
- ok(false, "test_get_cwd: getcwd returned null, errno: " + ctypes.errno);
- }
- let path2;
- if (OS.Unix.File.get_current_dir_name) {
- path2 = OS.Unix.File.get_current_dir_name();
- } else {
- path2 = OS.Unix.File.getwd_auto(null);
- }
- if (ctypes.char.ptr(path2).isNull()) {
- ok(false, "test_get_cwd: getwd_auto/get_current_dir_name returned null, errno: " + ctypes.errno);
- }
- is(path.readString(), path2.readString(), "test_get_cwd: getcwd and getwd return the same path");
-}
-
-function test_read_write()
-{
- let output_name = "osfile_copy.tmp";
- // Copy file
- let input = OS.Unix.File.open(
- "chrome/toolkit/components/osfile/tests/mochi/worker_test_osfile_unix.js",
- OS.Constants.libc.O_RDONLY, 0);
- isnot(input, -1, "test_read_write: input file opened");
- let output = OS.Unix.File.open("osfile_copy.tmp", OS.Constants.libc.O_RDWR
- | OS.Constants.libc.O_CREAT
- | OS.Constants.libc.O_TRUNC,
- OS.Constants.libc.S_IRWXU);
- isnot(output, -1, "test_read_write: output file opened");
-
- let array = new (ctypes.ArrayType(ctypes.char, 4096))();
- let bytes = -1;
- let total = 0;
- while (true) {
- bytes = OS.Unix.File.read(input, array, 4096);
- ok(bytes != undefined, "test_read_write: bytes is defined");
- isnot(bytes, -1, "test_read_write: no read error");
- let write_from = 0;
- if (bytes == 0) {
- break;
- }
- while (bytes > 0) {
- let ptr = array.addressOfElement(write_from);
- // Note: |write| launches an exception in case of error
- let written = OS.Unix.File.write(output, array, bytes);
- isnot(written, -1, "test_read_write: no write error");
- write_from += written;
- bytes -= written;
- }
- total += write_from;
- }
- info("test_read_write: copy complete " + total);
-
- // Compare files
- let result;
- info("SEEK_SET: " + OS.Constants.libc.SEEK_SET);
- info("Input: " + input + "(" + input.toSource() + ")");
- info("Output: " + output + "(" + output.toSource() + ")");
- result = OS.Unix.File.lseek(input, 0, OS.Constants.libc.SEEK_SET);
- info("Result of lseek: " + result);
- isnot(result, -1, "test_read_write: input seek succeeded " + ctypes.errno);
- result = OS.Unix.File.lseek(output, 0, OS.Constants.libc.SEEK_SET);
- isnot(result, -1, "test_read_write: output seek succeeded " + ctypes.errno);
-
- let array2 = new (ctypes.ArrayType(ctypes.char, 4096))();
- let bytes2 = -1;
- let pos = 0;
- while (true) {
- bytes = OS.Unix.File.read(input, array, 4096);
- isnot(bytes, -1, "test_read_write: input read succeeded");
- bytes2 = OS.Unix.File.read(output, array2, 4096);
- isnot(bytes, -1, "test_read_write: output read succeeded");
- is(bytes > 0, bytes2 > 0, "Both files contain data or neither does "+bytes+", "+bytes2);
- if (bytes == 0) {
- break;
- }
- if (bytes != bytes2) {
- // This would be surprising, but theoretically possible with a
- // remote file system, I believe.
- bytes = Math.min(bytes, bytes2);
- pos += bytes;
- result = OS.Unix.File.lseek(input, pos, OS.Constants.libc.SEEK_SET);
- isnot(result, -1, "test_read_write: input seek succeeded");
- result = OS.Unix.File.lseek(output, pos, OS.Constants.libc.SEEK_SET);
- isnot(result, -1, "test_read_write: output seek succeeded");
- } else {
- pos += bytes;
- }
- for (let i = 0; i < bytes; ++i) {
- if (array[i] != array2[i]) {
- ok(false, "Files do not match at position " + i
- + " ("+array[i] + "/"+array2[i] + ")");
- }
- }
- }
- info("test_read_write test complete");
- result = OS.Unix.File.close(input);
- isnot(result, -1, "test_read_write: input close succeeded");
- result = OS.Unix.File.close(output);
- isnot(result, -1, "test_read_write: output close succeeded");
- result = OS.Unix.File.unlink(output_name);
- isnot(result, -1, "test_read_write: input remove succeeded");
- info("test_read_write cleanup complete");
-}
-
-function test_passing_undefined()
-{
- info("Testing that an exception gets thrown when an FFI function is passed undefined");
- let exceptionRaised = false;
-
- try {
- let file = OS.Unix.File.open(undefined, OS.Constants.libc.O_RDWR
- | OS.Constants.libc.O_CREAT
- | OS.Constants.libc.O_TRUNC,
- OS.Constants.libc.S_IRWXU);
- } catch(e if e instanceof TypeError && e.message.indexOf("open") > -1) {
- exceptionRaised = true;
- }
-
- ok(exceptionRaised, "test_passing_undefined: exception gets thrown")
-}
-
diff --git a/toolkit/components/osfile/tests/mochi/worker_test_osfile_win.js b/toolkit/components/osfile/tests/mochi/worker_test_osfile_win.js
deleted file mode 100644
index f41fdecfe..000000000
--- a/toolkit/components/osfile/tests/mochi/worker_test_osfile_win.js
+++ /dev/null
@@ -1,211 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-importScripts('worker_test_osfile_shared.js');
-
-self.onmessage = function(msg) {
- self.onmessage = function(msg) {
- log("ignored message "+JSON.stringify(msg.data));
- };
-
- test_init();
- test_GetCurrentDirectory();
- test_OpenClose();
- test_CreateFile();
- test_ReadWrite();
- test_passing_undefined();
- finish();
-};
-
-function test_init() {
- info("Starting test_init");
- importScripts("resource://gre/modules/osfile.jsm");
-}
-
-function test_OpenClose() {
- info("Starting test_OpenClose");
- is(typeof OS.Win.File.CreateFile, "function", "OS.Win.File.CreateFile is a function");
- is(OS.Win.File.CloseHandle(OS.Constants.Win.INVALID_HANDLE_VALUE), true, "CloseHandle returns true given the invalid handle");
- is(OS.Win.File.FindClose(OS.Constants.Win.INVALID_HANDLE_VALUE), true, "FindClose returns true given the invalid handle");
- isnot(OS.Constants.Win.GENERIC_READ, undefined, "GENERIC_READ exists");
- isnot(OS.Constants.Win.FILE_SHARE_READ, undefined, "FILE_SHARE_READ exists");
- isnot(OS.Constants.Win.FILE_ATTRIBUTE_NORMAL, undefined, "FILE_ATTRIBUTE_NORMAL exists");
- let file = OS.Win.File.CreateFile(
- "chrome\\toolkit\\components\\osfile\\tests\\mochi\\worker_test_osfile_win.js",
- OS.Constants.Win.GENERIC_READ,
- 0,
- null,
- OS.Constants.Win.OPEN_EXISTING,
- 0,
- null);
- info("test_OpenClose: Passed open");
- isnot(file, OS.Constants.Win.INVALID_HANDLE_VALUE, "test_OpenClose: file opened");
- let result = OS.Win.File.CloseHandle(file);
- isnot(result, 0, "test_OpenClose: close succeeded");
-
- file = OS.Win.File.CreateFile(
- "\\I do not exist",
- OS.Constants.Win.GENERIC_READ,
- OS.Constants.Win.FILE_SHARE_READ,
- null,
- OS.Constants.Win.OPEN_EXISTING,
- OS.Constants.Win.FILE_ATTRIBUTE_NORMAL,
- null);
- is(file, OS.Constants.Win.INVALID_HANDLE_VALUE, "test_OpenClose: cannot open non-existing file");
- is(ctypes.winLastError, OS.Constants.Win.ERROR_FILE_NOT_FOUND, "test_OpenClose: error is ERROR_FILE_NOT_FOUND");
-}
-
-function test_CreateFile()
-{
- info("Starting test_CreateFile");
- let file = OS.Win.File.CreateFile(
- "test.tmp",
- OS.Constants.Win.GENERIC_READ | OS.Constants.Win.GENERIC_WRITE,
- OS.Constants.Win.FILE_SHARE_READ | OS.Constants.FILE_SHARE_WRITE,
- null,
- OS.Constants.Win.CREATE_ALWAYS,
- OS.Constants.Win.FILE_ATTRIBUTE_NORMAL,
- null);
- isnot(file, OS.Constants.Win.INVALID_HANDLE_VALUE, "test_CreateFile: opening succeeded");
- let result = OS.Win.File.CloseHandle(file);
- isnot(result, 0, "test_CreateFile: close succeeded");
-}
-
-function test_GetCurrentDirectory()
-{
- let array = new (ctypes.ArrayType(ctypes.char16_t, 4096))();
- let result = OS.Win.File.GetCurrentDirectory(4096, array);
- ok(result < array.length, "test_GetCurrentDirectory: length sufficient");
- ok(result > 0, "test_GetCurrentDirectory: length != 0");
-}
-
-function test_ReadWrite()
-{
- info("Starting test_ReadWrite");
- let output_name = "osfile_copy.tmp";
- // Copy file
- let input = OS.Win.File.CreateFile(
- "chrome\\toolkit\\components\\osfile\\tests\\mochi\\worker_test_osfile_win.js",
- OS.Constants.Win.GENERIC_READ,
- 0,
- null,
- OS.Constants.Win.OPEN_EXISTING,
- 0,
- null);
- isnot(input, OS.Constants.Win.INVALID_HANDLE_VALUE, "test_ReadWrite: input file opened");
- let output = OS.Win.File.CreateFile(
- "osfile_copy.tmp",
- OS.Constants.Win.GENERIC_READ | OS.Constants.Win.GENERIC_WRITE,
- 0,
- null,
- OS.Constants.Win.CREATE_ALWAYS,
- OS.Constants.Win.FILE_ATTRIBUTE_NORMAL,
- null);
- isnot(output, OS.Constants.Win.INVALID_HANDLE_VALUE, "test_ReadWrite: output file opened");
- let array = new (ctypes.ArrayType(ctypes.char, 4096))();
- let bytes_read = new ctypes.uint32_t(0);
- let bytes_read_ptr = bytes_read.address();
- log("We have a pointer for bytes read: "+bytes_read_ptr);
- let bytes_written = new ctypes.uint32_t(0);
- let bytes_written_ptr = bytes_written.address();
- log("We have a pointer for bytes written: "+bytes_written_ptr);
- log("test_ReadWrite: buffer and pointers ready");
- let result;
- while (true) {
- log("test_ReadWrite: reading");
- result = OS.Win.File.ReadFile(input, array, 4096, bytes_read_ptr, null);
- isnot (result, 0, "test_ReadWrite: read success");
- let write_from = 0;
- let bytes_left = bytes_read;
- log("test_ReadWrite: read chunk complete " + bytes_left.value);
- if (bytes_left.value == 0) {
- break;
- }
- while (bytes_left.value > 0) {
- log("test_ReadWrite: writing "+bytes_left.value);
- let ptr = array.addressOfElement(write_from);
- // Note: |WriteFile| launches an exception in case of error
- result = OS.Win.File.WriteFile(output, array, bytes_left, bytes_written_ptr, null);
- isnot (result, 0, "test_ReadWrite: write success");
- write_from += bytes_written;
- bytes_left -= bytes_written;
- }
- }
- info("test_ReadWrite: copy complete");
-
- // Compare files
- result = OS.Win.File.SetFilePointer(input, 0, null, OS.Constants.Win.FILE_BEGIN);
- isnot (result, OS.Constants.Win.INVALID_SET_FILE_POINTER, "test_ReadWrite: input reset");
-
- result = OS.Win.File.SetFilePointer(output, 0, null, OS.Constants.Win.FILE_BEGIN);
- isnot (result, OS.Constants.Win.INVALID_SET_FILE_POINTER, "test_ReadWrite: output reset");
-
- let array2 = new (ctypes.ArrayType(ctypes.char, 4096))();
- let bytes_read2 = new ctypes.uint32_t(0);
- let bytes_read2_ptr = bytes_read2.address();
- let pos = 0;
- while (true) {
- result = OS.Win.File.ReadFile(input, array, 4096, bytes_read_ptr, null);
- isnot(result, 0, "test_ReadWrite: input read succeeded");
-
- result = OS.Win.File.ReadFile(output, array2, 4096, bytes_read2_ptr, null);
- isnot(result, 0, "test_ReadWrite: output read succeeded");
-
- is(bytes_read.value > 0, bytes_read2.value > 0,
- "Both files contain data or neither does " + bytes_read.value + ", " + bytes_read2.value);
- if (bytes_read.value == 0) {
- break;
- }
- let bytes;
- if (bytes_read.value != bytes_read2.value) {
- // This would be surprising, but theoretically possible with a
- // remote file system, I believe.
- bytes = Math.min(bytes_read.value, bytes_read2.value);
- pos += bytes;
- result = OS.Win.File.SetFilePointer(input, pos, null, OS.Constants.Win.FILE_BEGIN);
- isnot(result, 0, "test_ReadWrite: input seek succeeded");
-
- result = OS.Win.File.SetFilePointer(output, pos, null, OS.Constants.Win.FILE_BEGIN);
- isnot(result, 0, "test_ReadWrite: output seek succeeded");
-
- } else {
- bytes = bytes_read.value;
- pos += bytes;
- }
- for (let i = 0; i < bytes; ++i) {
- if (array[i] != array2[i]) {
- ok(false, "Files do not match at position " + i
- + " ("+array[i] + "/"+array2[i] + ")");
- }
- }
- }
- info("test_ReadWrite test complete");
- result = OS.Win.File.CloseHandle(input);
- isnot(result, 0, "test_ReadWrite: inpout close succeeded");
- result = OS.Win.File.CloseHandle(output);
- isnot(result, 0, "test_ReadWrite: outpout close succeeded");
- result = OS.Win.File.DeleteFile(output_name);
- isnot(result, 0, "test_ReadWrite: output remove succeeded");
- info("test_ReadWrite cleanup complete");
-}
-
-function test_passing_undefined()
-{
- info("Testing that an exception gets thrown when an FFI function is passed undefined");
- let exceptionRaised = false;
-
- try {
- let file = OS.Win.File.CreateFile(
- undefined,
- OS.Constants.Win.GENERIC_READ,
- 0,
- null,
- OS.Constants.Win.OPEN_EXISTING,
- 0,
- null);
- } catch(e if e instanceof TypeError && e.message.indexOf("CreateFile") > -1) {
- exceptionRaised = true;
- }
-
- ok(exceptionRaised, "test_passing_undefined: exception gets thrown")
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/.eslintrc.js b/toolkit/components/osfile/tests/xpcshell/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/osfile/tests/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/osfile/tests/xpcshell/head.js b/toolkit/components/osfile/tests/xpcshell/head.js
deleted file mode 100644
index eef29962a..000000000
--- a/toolkit/components/osfile/tests/xpcshell/head.js
+++ /dev/null
@@ -1,99 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var {utils: Cu, interfaces: Ci} = Components;
-
-var {XPCOMUtils} = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
-
-// Bug 1014484 can only be reproduced by loading OS.File first from the
-// CommonJS loader, so we do not want OS.File to be loaded eagerly for
-// all the tests in this directory.
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-
-var {Promise} = Cu.import("resource://gre/modules/Promise.jsm", {});
-var {Task} = Cu.import("resource://gre/modules/Task.jsm", {});
-
-Services.prefs.setBoolPref("toolkit.osfile.log", true);
-
-/**
- * As add_task, but execute the test both with native operations and
- * without.
- */
-function add_test_pair(generator) {
- add_task(function*() {
- do_print("Executing test " + generator.name + " with native operations");
- Services.prefs.setBoolPref("toolkit.osfile.native", true);
- return Task.spawn(generator);
- });
- add_task(function*() {
- do_print("Executing test " + generator.name + " without native operations");
- Services.prefs.setBoolPref("toolkit.osfile.native", false);
- return Task.spawn(generator);
- });
-}
-
-/**
- * Fetch asynchronously the contents of a file using xpcom.
- *
- * Used for comparing xpcom-based results to os.file-based results.
- *
- * @param {string} path The _absolute_ path to the file.
- * @return {promise}
- * @resolves {string} The contents of the file.
- */
-function reference_fetch_file(path, test) {
- do_print("Fetching file " + path);
- let deferred = Promise.defer();
- let file = new FileUtils.File(path);
- NetUtil.asyncFetch({
- uri: NetUtil.newURI(file),
- loadUsingSystemPrincipal: true
- }, function(stream, status) {
- if (!Components.isSuccessCode(status)) {
- deferred.reject(status);
- return;
- }
- let result, reject;
- try {
- result = NetUtil.readInputStreamToString(stream, stream.available());
- } catch (x) {
- reject = x;
- }
- stream.close();
- if (reject) {
- deferred.reject(reject);
- } else {
- deferred.resolve(result);
- }
- });
-
- return deferred.promise;
-};
-
-/**
- * Compare asynchronously the contents two files using xpcom.
- *
- * Used for comparing xpcom-based results to os.file-based results.
- *
- * @param {string} a The _absolute_ path to the first file.
- * @param {string} b The _absolute_ path to the second file.
- *
- * @resolves {null}
- */
-function reference_compare_files(a, b, test) {
- return Task.spawn(function*() {
- do_print("Comparing files " + a + " and " + b);
- let a_contents = yield reference_fetch_file(a, test);
- let b_contents = yield reference_fetch_file(b, test);
- do_check_eq(a_contents, b_contents);
- });
-};
diff --git a/toolkit/components/osfile/tests/xpcshell/test_available_free_space.js b/toolkit/components/osfile/tests/xpcshell/test_available_free_space.js
deleted file mode 100644
index 08e67763b..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_available_free_space.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-do_register_cleanup(function() {
- Services.prefs.setBoolPref("toolkit.osfile.log", false);
-});
-
-function run_test() {
- Services.prefs.setBoolPref("toolkit.osfile.log", true);
-
- run_next_test();
-}
-
-/**
- * Test OS.File.getAvailableFreeSpace
- */
-add_task(function() {
- // Set up profile. We will use profile path to query for available free
- // space.
- do_get_profile();
-
- let dir = OS.Constants.Path.profileDir;
-
- // Sanity checking for the test
- do_check_true((yield OS.File.exists(dir)));
-
- // Query for available bytes for user
- let availableBytes = yield OS.File.getAvailableFreeSpace(dir);
-
- do_check_true(!!availableBytes);
- do_check_true(availableBytes > 0);
-});
diff --git a/toolkit/components/osfile/tests/xpcshell/test_compression.js b/toolkit/components/osfile/tests/xpcshell/test_compression.js
deleted file mode 100644
index b40235615..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_compression.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-
-function run_test() {
- do_test_pending();
- run_next_test();
-}
-
-add_task(function test_compress_lz4() {
- let path = OS.Path.join(OS.Constants.Path.tmpDir, "compression.lz");
- let length = 1024;
- let array = new Uint8Array(length);
- for (let i = 0; i < array.byteLength; ++i) {
- array[i] = i;
- }
- let arrayAsString = Array.prototype.join.call(array);
-
- do_print("Writing data with lz4 compression");
- let bytes = yield OS.File.writeAtomic(path, array, { compression: "lz4" });
- do_print("Compressed " + length + " bytes into " + bytes);
-
- do_print("Reading back with lz4 decompression");
- let decompressed = yield OS.File.read(path, { compression: "lz4" });
- do_print("Decompressed into " + decompressed.byteLength + " bytes");
- do_check_eq(arrayAsString, Array.prototype.join.call(decompressed));
-});
-
-add_task(function test_uncompressed() {
- do_print("Writing data without compression");
- let path = OS.Path.join(OS.Constants.Path.tmpDir, "no_compression.tmp");
- let array = new Uint8Array(1024);
- for (let i = 0; i < array.byteLength; ++i) {
- array[i] = i;
- }
- let bytes = yield OS.File.writeAtomic(path, array); // No compression
-
- let exn;
- // Force decompression, reading should fail
- try {
- yield OS.File.read(path, { compression: "lz4" });
- } catch (ex) {
- exn = ex;
- }
- do_check_true(!!exn);
- // Check the exception message (and that it contains the file name)
- do_check_true(exn.message.indexOf(`Invalid header (no magic number) - Data: ${ path }`) != -1);
-});
-
-add_task(function test_no_header() {
- let path = OS.Path.join(OS.Constants.Path.tmpDir, "no_header.tmp");
- let array = new Uint8Array(8).fill(0,0); // Small array with no header
-
- do_print("Writing data with no header");
-
- let bytes = yield OS.File.writeAtomic(path, array); // No compression
- let exn;
- // Force decompression, reading should fail
- try {
- yield OS.File.read(path, { compression: "lz4" });
- } catch (ex) {
- exn = ex;
- }
- do_check_true(!!exn);
- // Check the exception message (and that it contains the file name)
- do_check_true(exn.message.indexOf(`Buffer is too short (no header) - Data: ${ path }`) != -1);
-});
-
-add_task(function test_invalid_content() {
- let path = OS.Path.join(OS.Constants.Path.tmpDir, "invalid_content.tmp");
- let arr1 = new Uint8Array([109, 111, 122, 76, 122, 52, 48, 0]);
- let arr2 = new Uint8Array(248).fill(1,0);
-
- let array = new Uint8Array(arr1.length + arr2.length);
- array.set(arr1);
- array.set(arr2, arr1.length);
-
- do_print("Writing invalid data (with a valid header and only ones after that)");
-
- let bytes = yield OS.File.writeAtomic(path, array); // No compression
- let exn;
- // Force decompression, reading should fail
- try {
- yield OS.File.read(path, { compression: "lz4" });
- } catch (ex) {
- exn = ex;
- }
- do_check_true(!!exn);
- // Check the exception message (and that it contains the file name)
- do_check_true(exn.message.indexOf(`Invalid content: Decompression stopped at 0 - Data: ${ path }`) != -1);
-});
-
-add_task(function() {
- do_test_finished();
-}); \ No newline at end of file
diff --git a/toolkit/components/osfile/tests/xpcshell/test_constants.js b/toolkit/components/osfile/tests/xpcshell/test_constants.js
deleted file mode 100644
index 5b91484bd..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_constants.js
+++ /dev/null
@@ -1,26 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm", this);
-
-function run_test() {
- run_next_test();
-}
-
-// Test that OS.Constants is defined correctly.
-add_task(function* check_definition() {
- do_check_true(OS.Constants!=null);
- do_check_true(!!OS.Constants.Win || !!OS.Constants.libc);
- do_check_true(OS.Constants.Path!=null);
- do_check_true(OS.Constants.Sys!=null);
- //check system name
- do_check_eq(Services.appinfo.OS, OS.Constants.Sys.Name);
-
- //check if using DEBUG build
- if (Components.classes["@mozilla.org/xpcom/debug;1"].getService(Components.interfaces.nsIDebug2).isDebugBuild == true) {
- do_check_true(OS.Constants.Sys.DEBUG);
- } else {
- do_check_true(typeof(OS.Constants.Sys.DEBUG) == 'undefined');
- }
-});
diff --git a/toolkit/components/osfile/tests/xpcshell/test_creationDate.js b/toolkit/components/osfile/tests/xpcshell/test_creationDate.js
deleted file mode 100644
index 9c4fa1dfc..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_creationDate.js
+++ /dev/null
@@ -1,31 +0,0 @@
-"use strict";
-
-function run_test() {
- do_test_pending();
- run_next_test();
-}
-
-/**
- * Test to ensure that deprecation warning is issued on use
- * of creationDate.
- */
-add_task(function test_deprecatedCreationDate () {
- let deferred = Promise.defer();
- let consoleListener = {
- observe: function (aMessage) {
- if(aMessage.message.indexOf("Field 'creationDate' is deprecated.") > -1) {
- do_print("Deprecation message printed");
- do_check_true(true);
- Services.console.unregisterListener(consoleListener);
- deferred.resolve();
- }
- }
- };
- let currentDir = yield OS.File.getCurrentDirectory();
- let path = OS.Path.join(currentDir, "test_creationDate.js");
-
- Services.console.registerListener(consoleListener);
- (yield OS.File.stat(path)).creationDate;
-});
-
-add_task(do_test_finished);
diff --git a/toolkit/components/osfile/tests/xpcshell/test_duration.js b/toolkit/components/osfile/tests/xpcshell/test_duration.js
deleted file mode 100644
index 305c03da8..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_duration.js
+++ /dev/null
@@ -1,91 +0,0 @@
-var {OS} = Components.utils.import("resource://gre/modules/osfile.jsm", {});
-var {Services} = Components.utils.import("resource://gre/modules/Services.jsm", {});
-
-/**
- * Test optional duration reporting that can be used for telemetry.
- */
-add_task(function* duration() {
- Services.prefs.setBoolPref("toolkit.osfile.log", true);
- // Options structure passed to a OS.File copy method.
- let copyOptions = {
- // This field should be overridden with the actual duration
- // measurement.
- outExecutionDuration: null
- };
- let currentDir = yield OS.File.getCurrentDirectory();
- let pathSource = OS.Path.join(currentDir, "test_duration.js");
- let copyFile = pathSource + ".bak";
- function testOptions(options, name) {
- do_print("Checking outExecutionDuration for operation: " + name);
- do_print(name + ": Gathered method duration time: " +
- options.outExecutionDuration + "ms");
- // Making sure that duration was updated.
- do_check_eq(typeof options.outExecutionDuration, "number");
- do_check_true(options.outExecutionDuration >= 0);
- };
- // Testing duration of OS.File.copy.
- yield OS.File.copy(pathSource, copyFile, copyOptions);
- testOptions(copyOptions, "OS.File.copy");
- yield OS.File.remove(copyFile);
-
- // Trying an operation where options are cloned.
- let pathDest = OS.Path.join(OS.Constants.Path.tmpDir,
- "osfile async test read writeAtomic.tmp");
- let tmpPath = pathDest + ".tmp";
- let readOptions = {
- outExecutionDuration: null
- };
- let contents = yield OS.File.read(pathSource, undefined, readOptions);
- testOptions(readOptions, "OS.File.read");
- // Options structure passed to a OS.File writeAtomic method.
- let writeAtomicOptions = {
- // This field should be first initialized with the actual
- // duration measurement then progressively incremented.
- outExecutionDuration: null,
- tmpPath: tmpPath
- };
- yield OS.File.writeAtomic(pathDest, contents, writeAtomicOptions);
- testOptions(writeAtomicOptions, "OS.File.writeAtomic");
- yield OS.File.remove(pathDest);
-
- do_print("Ensuring that we can use outExecutionDuration to accumulate durations");
-
- let ARBITRARY_BASE_DURATION = 5;
- copyOptions = {
- // This field should now be incremented with the actual duration
- // measurement.
- outExecutionDuration: ARBITRARY_BASE_DURATION
- };
- let backupDuration = ARBITRARY_BASE_DURATION;
- // Testing duration of OS.File.copy.
- yield OS.File.copy(pathSource, copyFile, copyOptions);
-
- do_check_true(copyOptions.outExecutionDuration >= backupDuration);
-
- backupDuration = copyOptions.outExecutionDuration;
- yield OS.File.remove(copyFile, copyOptions);
- do_check_true(copyOptions.outExecutionDuration >= backupDuration);
-
- // Trying an operation where options are cloned.
- // Options structure passed to a OS.File writeAtomic method.
- writeAtomicOptions = {
- // This field should be overridden with the actual duration
- // measurement.
- outExecutionDuration: copyOptions.outExecutionDuration,
- tmpPath: tmpPath
- };
- backupDuration = writeAtomicOptions.outExecutionDuration;
-
- yield OS.File.writeAtomic(pathDest, contents, writeAtomicOptions);
- do_check_true(copyOptions.outExecutionDuration >= backupDuration);
- OS.File.remove(pathDest);
-
- // Testing an operation that doesn't take arguments at all
- let file = yield OS.File.open(pathSource);
- yield file.stat();
- yield file.close();
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_exception.js b/toolkit/components/osfile/tests/xpcshell/test_exception.js
deleted file mode 100644
index 1282adb3e..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_exception.js
+++ /dev/null
@@ -1,89 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Test that functions throw the appropriate exceptions.
- */
-
-"use strict";
-
-var EXISTING_FILE = do_get_file("xpcshell.ini").path;
-
-
-// Tests on |open|
-
-add_test_pair(function test_typeerror() {
- let exn;
- try {
- let fd = yield OS.File.open("/tmp", {no_such_key: 1});
- do_print("Fd: " + fd);
- } catch (ex) {
- exn = ex;
- }
- do_print("Exception: " + exn);
- do_check_true(exn.constructor.name == "TypeError");
-});
-
-// Tests on |read|
-
-add_test_pair(function* test_bad_encoding() {
- do_print("Testing with a wrong encoding");
- try {
- yield OS.File.read(EXISTING_FILE, { encoding: "baby-speak-encoded" });
- do_throw("Should have thrown with an ex.becauseInvalidArgument");
- } catch (ex if ex.becauseInvalidArgument) {
- do_print("Wrong encoding caused the correct exception");
- }
-
- try {
- yield OS.File.read(EXISTING_FILE, { encoding: 4 });
- do_throw("Should have thrown a TypeError");
- } catch (ex if ex.constructor.name == "TypeError") {
- // Note that TypeError doesn't carry across compartments
- do_print("Non-string encoding caused the correct exception");
- }
- });
-
-add_test_pair(function* test_bad_compression() {
- do_print("Testing with a non-existing compression");
- try {
- yield OS.File.read(EXISTING_FILE, { compression: "mmmh-crunchy" });
- do_throw("Should have thrown with an ex.becauseInvalidArgument");
- } catch (ex if ex.becauseInvalidArgument) {
- do_print("Wrong encoding caused the correct exception");
- }
-
- do_print("Testing with a bad type for option compression");
- try {
- yield OS.File.read(EXISTING_FILE, { compression: 5 });
- do_throw("Should have thrown a TypeError");
- } catch (ex if ex.constructor.name == "TypeError") {
- // Note that TypeError doesn't carry across compartments
- do_print("Non-string encoding caused the correct exception");
- }
-});
-
-add_test_pair(function* test_bad_bytes() {
- do_print("Testing with a bad type for option bytes");
- try {
- yield OS.File.read(EXISTING_FILE, { bytes: "five" });
- do_throw("Should have thrown a TypeError");
- } catch (ex if ex.constructor.name == "TypeError") {
- // Note that TypeError doesn't carry across compartments
- do_print("Non-number bytes caused the correct exception");
- }
-});
-
-add_test_pair(function* read_non_existent() {
- do_print("Testing with a non-existent file");
- try {
- yield OS.File.read("I/do/not/exist");
- do_throw("Should have thrown with an ex.becauseNoSuchFile");
- } catch (ex if ex.becauseNoSuchFile) {
- do_print("Correct exceptions");
- }
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_file_URL_conversion.js b/toolkit/components/osfile/tests/xpcshell/test_file_URL_conversion.js
deleted file mode 100644
index 3ec42065b..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_file_URL_conversion.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- Components.utils.import("resource://gre/modules/Services.jsm");
- Components.utils.import("resource://gre/modules/osfile.jsm");
- Components.utils.import("resource://gre/modules/FileUtils.jsm");
-
- let isWindows = ("@mozilla.org/windows-registry-key;1" in Components.classes);
-
- // Test cases for filePathToURI
- let paths = isWindows ? [
- 'C:\\',
- 'C:\\test',
- 'C:\\test\\',
- 'C:\\test%2f',
- 'C:\\test\\test\\test',
- 'C:\\test;+%',
- 'C:\\test?action=index\\',
- 'C:\\test\ test',
- '\\\\C:\\a\\b\\c',
- '\\\\Server\\a\\b\\c',
-
- // note that per http://support.microsoft.com/kb/177506 (under more info),
- // the following characters are allowed on Windows:
- 'C:\\char^',
- 'C:\\char&',
- 'C:\\char\'',
- 'C:\\char@',
- 'C:\\char{',
- 'C:\\char}',
- 'C:\\char[',
- 'C:\\char]',
- 'C:\\char,',
- 'C:\\char$',
- 'C:\\char=',
- 'C:\\char!',
- 'C:\\char-',
- 'C:\\char#',
- 'C:\\char(',
- 'C:\\char)',
- 'C:\\char%',
- 'C:\\char.',
- 'C:\\char+',
- 'C:\\char~',
- 'C:\\char_'
- ] : [
- '/',
- '/test',
- '/test/',
- '/test%2f',
- '/test/test/test',
- '/test;+%',
- '/test?action=index/',
- '/test\ test',
- '/punctuation/;,/?:@&=+$-_.!~*\'()[]"#',
- '/CasePreserving'
- ];
-
- // some additional URIs to test, beyond those generated from paths
- let uris = isWindows ? [
- 'file:///C:/test/',
- 'file://localhost/C:/test',
- 'file:///c:/test/test.txt',
- //'file:///C:/foo%2f', // trailing, encoded slash
- 'file:///C:/%3f%3F',
- 'file:///C:/%3b%3B',
- 'file:///C:/%3c%3C', // not one of the special-cased ? or ;
- 'file:///C:/%78', // 'x', not usually uri encoded
- 'file:///C:/test#frag', // a fragment identifier
- 'file:///C:/test?action=index' // an actual query component
- ] : [
- 'file:///test/',
- 'file://localhost/test',
- 'file:///test/test.txt',
- 'file:///foo%2f', // trailing, encoded slash
- 'file:///%3f%3F',
- 'file:///%3b%3B',
- 'file:///%3c%3C', // not one of the special-cased ? or ;
- 'file:///%78', // 'x', not usually uri encoded
- 'file:///test#frag', // a fragment identifier
- 'file:///test?action=index' // an actual query component
- ];
-
- for (let path of paths) {
- // convert that to a uri using FileUtils and Services, which toFileURI is trying to model
- let file = FileUtils.File(path);
- let uri = Services.io.newFileURI(file).spec;
- do_check_eq(uri, OS.Path.toFileURI(path));
-
- // keep the resulting URI to try the reverse, except for "C:\" for which the
- // behavior of nsIFileURL and OS.File is inconsistent
- if (path != "C:\\") {
- uris.push(uri);
- }
- }
-
- for (let uri of uris) {
- // convert URIs to paths with nsIFileURI, which fromFileURI is trying to model
- let path = Services.io.newURI(uri, null, null).QueryInterface(Components.interfaces.nsIFileURL).file.path;
- do_check_eq(path, OS.Path.fromFileURI(uri));
- }
-
- // check that non-file URLs aren't allowed
- let thrown = false;
- try {
- OS.Path.fromFileURI('http://test.com')
- } catch (e) {
- do_check_eq(e.message, "fromFileURI expects a file URI");
- thrown = true;
- }
- do_check_true(thrown);
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_loader.js b/toolkit/components/osfile/tests/xpcshell/test_loader.js
deleted file mode 100644
index dcfa819be..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_loader.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-/**
- * Test that OS.File can be loaded using the CommonJS loader.
- */
-
-var { Loader } = Components.utils.import('resource://gre/modules/commonjs/toolkit/loader.js', {});
-
-function run_test() {
- run_next_test();
-}
-
-
-add_task(function*() {
- let dataDir = Services.io.newFileURI(do_get_file("test_loader/", true)).spec + "/";
- let loader = Loader.Loader({
- paths: {'': dataDir }
- });
-
- let require = Loader.Require(loader, Loader.Module('module_test_loader', 'foo'));
- do_print("Require is ready");
- try {
- require('module_test_loader');
- } catch (error) {
- dump('Bootstrap error: ' +
- (error.message ? error.message : String(error)) + '\n' +
- (error.stack || error.fileName + ': ' + error.lineNumber) + '\n');
-
- throw error;
- }
-
- do_print("Require has worked");
-});
-
diff --git a/toolkit/components/osfile/tests/xpcshell/test_loader/module_test_loader.js b/toolkit/components/osfile/tests/xpcshell/test_loader/module_test_loader.js
deleted file mode 100644
index 18356d6ad..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_loader/module_test_loader.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Load OS.File from a module loaded with the CommonJS/addon-sdk loader
-
-var {Cu} = require("chrome");
-Cu.import('resource://gre/modules/osfile.jsm');
diff --git a/toolkit/components/osfile/tests/xpcshell/test_logging.js b/toolkit/components/osfile/tests/xpcshell/test_logging.js
deleted file mode 100644
index 133909e0b..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_logging.js
+++ /dev/null
@@ -1,74 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-/**
- * Tests logging by passing OS.Shared.LOG both an object with its own
- * toString method, and one with the default.
- */
-function run_test() {
- do_test_pending();
- let messageCount = 0;
-
- do_print("Test starting");
-
- // Create a console listener.
- let consoleListener = {
- observe: function (aMessage) {
- //Ignore unexpected messages.
- if (!(aMessage instanceof Components.interfaces.nsIConsoleMessage)) {
- return;
- }
- // This is required, as printing to the |Services.console|
- // while in the observe function causes an exception.
- do_execute_soon(function() {
- do_print("Observing message " + aMessage.message);
- if (aMessage.message.indexOf("TEST OS") < 0) {
- return;
- }
-
- ++messageCount;
- if(messageCount == 1) {
- do_check_eq(aMessage.message, "TEST OS {\"name\":\"test\"}\n");
- }
- if(messageCount == 2) {
- do_check_eq(aMessage.message, "TEST OS name is test\n");
- toggleConsoleListener(false);
- do_test_finished();
- }
- });
- }
- };
-
- // Set/Unset the console listener.
- function toggleConsoleListener (pref) {
- do_print("Setting console listener: " + pref);
- Services.prefs.setBoolPref("toolkit.osfile.log", pref);
- Services.prefs.setBoolPref("toolkit.osfile.log.redirect", pref);
- Services.console[pref ? "registerListener" : "unregisterListener"](
- consoleListener);
- }
-
- toggleConsoleListener(true);
-
- let objectDefault = {name: "test"};
- let CustomToString = function() {
- this.name = "test";
- };
- CustomToString.prototype.toString = function() {
- return "name is " + this.name;
- };
- let objectCustom = new CustomToString();
-
- do_print(OS.Shared.LOG.toSource());
-
- do_print("Logging 1");
- OS.Shared.LOG(objectDefault);
-
- do_print("Logging 2");
- OS.Shared.LOG(objectCustom);
- // Once both messages are observed OS.Shared.DEBUG, and OS.Shared.TEST
- // are reset to false.
-}
-
diff --git a/toolkit/components/osfile/tests/xpcshell/test_makeDir.js b/toolkit/components/osfile/tests/xpcshell/test_makeDir.js
deleted file mode 100644
index 5b9740a7f..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_makeDir.js
+++ /dev/null
@@ -1,142 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-var Path = OS.Path;
-var profileDir;
-
-do_register_cleanup(function() {
- Services.prefs.setBoolPref("toolkit.osfile.log", false);
-});
-
-function run_test() {
- run_next_test();
-}
-
-/**
- * Test OS.File.makeDir
- */
-
-add_task(function init() {
- // Set up profile. We create the directory in the profile, because the profile
- // is removed after every test run.
- do_get_profile();
- profileDir = OS.Constants.Path.profileDir;
- Services.prefs.setBoolPref("toolkit.osfile.log", true);
-});
-
-/**
- * Basic use
- */
-
-add_task(function* test_basic() {
- let dir = Path.join(profileDir, "directory");
-
- // Sanity checking for the test
- do_check_false((yield OS.File.exists(dir)));
-
- // Make a directory
- yield OS.File.makeDir(dir);
-
- //check if the directory exists
- yield OS.File.stat(dir);
-
- // Make a directory that already exists, this should succeed
- yield OS.File.makeDir(dir);
-
- // Make a directory with ignoreExisting
- yield OS.File.makeDir(dir, {ignoreExisting: true});
-
- // Make a directory with ignoreExisting false
- let exception = null;
- try {
- yield OS.File.makeDir(dir, {ignoreExisting: false});
- } catch (ex) {
- exception = ex;
- }
-
- do_check_true(!!exception);
- do_check_true(exception instanceof OS.File.Error);
- do_check_true(exception.becauseExists);
-});
-
-// Make a root directory that already exists
-add_task(function* test_root() {
- if (OS.Constants.Win) {
- yield OS.File.makeDir("C:");
- yield OS.File.makeDir("C:\\");
- } else {
- yield OS.File.makeDir("/");
- }
-});
-
-/**
- * Creating subdirectories
- */
-add_task(function test_option_from() {
- let dir = Path.join(profileDir, "a", "b", "c");
-
- // Sanity checking for the test
- do_check_false((yield OS.File.exists(dir)));
-
- // Make a directory
- yield OS.File.makeDir(dir, {from: profileDir});
-
- //check if the directory exists
- yield OS.File.stat(dir);
-
- // Make a directory that already exists, this should succeed
- yield OS.File.makeDir(dir);
-
- // Make a directory with ignoreExisting
- yield OS.File.makeDir(dir, {ignoreExisting: true});
-
- // Make a directory with ignoreExisting false
- let exception = null;
- try {
- yield OS.File.makeDir(dir, {ignoreExisting: false});
- } catch (ex) {
- exception = ex;
- }
-
- do_check_true(!!exception);
- do_check_true(exception instanceof OS.File.Error);
- do_check_true(exception.becauseExists);
-
- // Make a directory without |from| and fail
- let dir2 = Path.join(profileDir, "g", "h", "i");
- exception = null;
- try {
- yield OS.File.makeDir(dir2);
- } catch (ex) {
- exception = ex;
- }
-
- do_check_true(!!exception);
- do_check_true(exception instanceof OS.File.Error);
- do_check_true(exception.becauseNoSuchFile);
-
- // Test edge cases on paths
-
- let dir3 = Path.join(profileDir, "d", "", "e", "f");
- do_check_false((yield OS.File.exists(dir3)));
- yield OS.File.makeDir(dir3, {from: profileDir});
- do_check_true((yield OS.File.exists(dir3)));
-
- let dir4;
- if (OS.Constants.Win) {
- // Test that we can create a directory recursively even
- // if we have too many "\\".
- dir4 = profileDir + "\\\\g";
- } else {
- dir4 = profileDir + "////g";
- }
- do_check_false((yield OS.File.exists(dir4)));
- yield OS.File.makeDir(dir4, {from: profileDir});
- do_check_true((yield OS.File.exists(dir4)));
-});
diff --git a/toolkit/components/osfile/tests/xpcshell/test_open.js b/toolkit/components/osfile/tests/xpcshell/test_open.js
deleted file mode 100644
index 78772ad09..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_open.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-
-function run_test() {
- run_next_test();
-}
-
-/**
- * Test OS.File.open for reading:
- * - with an existing file (should succeed);
- * - with a non-existing file (should fail);
- * - with inconsistent arguments (should fail).
- */
-add_task(function() {
- // Attempt to open a file that does not exist, ensure that it yields the
- // appropriate error.
- try {
- let fd = yield OS.File.open(OS.Path.join(".", "This file does not exist"));
- do_check_true(false, "File opening 1 succeeded (it should fail)");
- } catch (err if err instanceof OS.File.Error && err.becauseNoSuchFile) {
- do_print("File opening 1 failed " + err);
- }
-
- // Attempt to open a file with the wrong args, so that it fails before
- // serialization, ensure that it yields the appropriate error.
- do_print("Attempting to open a file with wrong arguments");
- try {
- let fd = yield OS.File.open(1, 2, 3);
- do_check_true(false, "File opening 2 succeeded (it should fail)" + fd);
- } catch (err) {
- do_print("File opening 2 failed " + err);
- do_check_false(err instanceof OS.File.Error,
- "File opening 2 returned something that is not a file error");
- do_check_true(err.constructor.name == "TypeError",
- "File opening 2 returned a TypeError");
- }
-
- // Attempt to open a file correctly
- do_print("Attempting to open a file correctly");
- let openedFile = yield OS.File.open(OS.Path.join(do_get_cwd().path, "test_open.js"));
- do_print("File opened correctly");
-
- do_print("Attempting to close a file correctly");
- yield openedFile.close();
-
- do_print("Attempting to close a file again");
- yield openedFile.close();
-});
-
-/**
- * Test the error thrown by OS.File.open when attempting to open a directory
- * that does not exist.
- */
-add_task(function test_error_attributes () {
-
- let dir = OS.Path.join(do_get_profile().path, "test_osfileErrorAttrs");
- let fpath = OS.Path.join(dir, "test_error_attributes.txt");
-
- try {
- yield OS.File.open(fpath, {truncate: true}, {});
- do_check_true(false, "Opening path suceeded (it should fail) " + fpath);
- } catch (err) {
- do_check_true(err instanceof OS.File.Error);
- do_check_true(err.becauseNoSuchFile);
- }
-});
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_async.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_async.js
deleted file mode 100644
index 0f86b2ea8..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async.js
+++ /dev/null
@@ -1,16 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-
-/**
- * A trivial test ensuring that we can call osfile from xpcshell.
- * (see bug 808161)
- */
-
-function run_test() {
- do_test_pending();
- OS.File.getCurrentDirectory().then(
- do_test_finished,
- do_test_finished
- );
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_append.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_append.js
deleted file mode 100644
index 0aef2c58a..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_append.js
+++ /dev/null
@@ -1,122 +0,0 @@
-"use strict";
-
-do_print("starting tests");
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Task.jsm");
-
-/**
- * A test to check that the |append| mode flag is correctly implemented.
- * (see bug 925865)
- */
-
-function setup_mode(mode) {
- // Complete mode.
- let realMode = {
- read: true,
- write: true
- };
- for (let k in mode) {
- realMode[k] = mode[k];
- }
- return realMode;
-}
-
-// Test append mode.
-function test_append(mode) {
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_async_append.tmp");
-
- // Clear any left-over files from previous runs.
- try {
- yield OS.File.remove(path);
- } catch (ex if ex.becauseNoSuchFile) {
- // ignore
- }
-
- try {
- mode = setup_mode(mode);
- mode.append = true;
- if (mode.trunc) {
- // Pre-fill file with some data to see if |trunc| actually works.
- yield OS.File.writeAtomic(path, new Uint8Array(500));
- }
- let file = yield OS.File.open(path, mode);
- try {
- yield file.write(new Uint8Array(1000));
- yield file.setPosition(0, OS.File.POS_START);
- yield file.read(100);
- // Should be at offset 100, length 1000 now.
- yield file.write(new Uint8Array(100));
- // Should be at offset 1100, length 1100 now.
- let stat = yield file.stat();
- do_check_eq(1100, stat.size);
- } finally {
- yield file.close();
- }
- } catch(ex) {
- try {
- yield OS.File.remove(path);
- } catch (ex if ex.becauseNoSuchFile) {
- // ignore.
- }
- }
-}
-
-// Test no-append mode.
-function test_no_append(mode) {
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_async_noappend.tmp");
-
- // Clear any left-over files from previous runs.
- try {
- yield OS.File.remove(path);
- } catch (ex if ex.becauseNoSuchFile) {
- // ignore
- }
-
- try {
- mode = setup_mode(mode);
- mode.append = false;
- if (mode.trunc) {
- // Pre-fill file with some data to see if |trunc| actually works.
- yield OS.File.writeAtomic(path, new Uint8Array(500));
- }
- let file = yield OS.File.open(path, mode);
- try {
- yield file.write(new Uint8Array(1000));
- yield file.setPosition(0, OS.File.POS_START);
- yield file.read(100);
- // Should be at offset 100, length 1000 now.
- yield file.write(new Uint8Array(100));
- // Should be at offset 200, length 1000 now.
- let stat = yield file.stat();
- do_check_eq(1000, stat.size);
- } finally {
- yield file.close();
- }
- } finally {
- try {
- yield OS.File.remove(path);
- } catch (ex if ex.becauseNoSuchFile) {
- // ignore.
- }
- }
-}
-
-var test_flags = [
- {},
- {create:true},
- {trunc:true}
-];
-function run_test() {
- do_test_pending();
-
- for (let t of test_flags) {
- add_task(test_append.bind(null, t));
- add_task(test_no_append.bind(null, t));
- }
- add_task(do_test_finished);
-
- run_next_test();
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_bytes.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_bytes.js
deleted file mode 100644
index 68fa9152c..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_bytes.js
+++ /dev/null
@@ -1,39 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Task.jsm");
-
-function run_test() {
- do_test_pending();
- run_next_test();
-}
-
-/**
- * Test to ensure that {bytes:} in options to |write| is correctly
- * preserved.
- */
-add_task(function* test_bytes() {
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_async_bytes.tmp");
- let file = yield OS.File.open(path, {trunc: true, read: true, write: true});
- try {
- try {
- // 1. Test write, by supplying {bytes:} options smaller than the actual
- // buffer.
- yield file.write(new Uint8Array(2048), {bytes: 1024});
- do_check_eq((yield file.stat()).size, 1024);
-
- // 2. Test that passing nullish values for |options| still works.
- yield file.setPosition(0, OS.File.POS_END);
- yield file.write(new Uint8Array(1024), null);
- yield file.write(new Uint8Array(1024), undefined);
- do_check_eq((yield file.stat()).size, 3072);
- } finally {
- yield file.close();
- }
- } finally {
- yield OS.File.remove(path);
- }
-});
-
-add_task(do_test_finished);
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_copy.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_copy.js
deleted file mode 100644
index 9c52c8a80..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_copy.js
+++ /dev/null
@@ -1,113 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/FileUtils.jsm");
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/Promise.jsm");
-Components.utils.import("resource://gre/modules/Task.jsm");
-
-function run_test() {
- do_test_pending();
- run_next_test();
-}
-
-/**
- * A file that we know exists and that can be used for reading.
- */
-var EXISTING_FILE = "test_osfile_async_copy.js";
-
-/**
- * Fetch asynchronously the contents of a file using xpcom.
- *
- * Used for comparing xpcom-based results to os.file-based results.
- *
- * @param {string} path The _absolute_ path to the file.
- * @return {promise}
- * @resolves {string} The contents of the file.
- */
-var reference_fetch_file = function reference_fetch_file(path) {
- let promise = Promise.defer();
- let file = new FileUtils.File(path);
- NetUtil.asyncFetch({
- uri: NetUtil.newURI(file),
- loadUsingSystemPrincipal: true
- }, function(stream, status) {
- if (!Components.isSuccessCode(status)) {
- promise.reject(status);
- return;
- }
- let result, reject;
- try {
- result = NetUtil.readInputStreamToString(stream, stream.available());
- } catch (x) {
- reject = x;
- }
- stream.close();
- if (reject) {
- promise.reject(reject);
- } else {
- promise.resolve(result);
- }
- });
-
- return promise.promise;
-};
-
-/**
- * Compare asynchronously the contents two files using xpcom.
- *
- * Used for comparing xpcom-based results to os.file-based results.
- *
- * @param {string} a The _absolute_ path to the first file.
- * @param {string} b The _absolute_ path to the second file.
- *
- * @resolves {null}
- */
-var reference_compare_files = function reference_compare_files(a, b) {
- let a_contents = yield reference_fetch_file(a);
- let b_contents = yield reference_fetch_file(b);
- // Not using do_check_eq to avoid dumping the whole file to the log.
- // It is OK to === compare here, as both variables contain a string.
- do_check_true(a_contents === b_contents);
-};
-
-/**
- * Test to ensure that OS.File.copy works.
- */
-function test_copymove(options = {}) {
- let source = OS.Path.join((yield OS.File.getCurrentDirectory()),
- EXISTING_FILE);
- let dest = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_async_copy_dest.tmp");
- let dest2 = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_async_copy_dest2.tmp");
- try {
- // 1. Test copy.
- yield OS.File.copy(source, dest, options);
- yield reference_compare_files(source, dest);
- // 2. Test subsequent move.
- yield OS.File.move(dest, dest2);
- yield reference_compare_files(source, dest2);
- // 3. Check that the moved file was really moved.
- do_check_eq((yield OS.File.exists(dest)), false);
- } finally {
- try {
- yield OS.File.remove(dest);
- } catch (ex if ex.becauseNoSuchFile) {
- // ignore
- }
- try {
- yield OS.File.remove(dest2);
- } catch (ex if ex.becauseNoSuchFile) {
- // ignore
- }
- }
-}
-
-// Regular copy test.
-add_task(test_copymove);
-// Userland copy test.
-add_task(test_copymove.bind(null, {unixUserland: true}));
-
-add_task(do_test_finished);
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_flush.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_flush.js
deleted file mode 100644
index 9ed087f4e..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_flush.js
+++ /dev/null
@@ -1,30 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Task.jsm");
-
-function run_test() {
- do_test_pending();
- run_next_test();
-}
-
-/**
- * Test to ensure that |File.prototype.flush| is available in the async API.
- */
-
-add_task(function test_flush() {
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_async_flush.tmp");
- let file = yield OS.File.open(path, {trunc: true, write: true});
- try {
- try {
- yield file.flush();
- } finally {
- yield file.close();
- }
- } finally {
- yield OS.File.remove(path);
- }
-});
-
-add_task(do_test_finished);
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_largefiles.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_largefiles.js
deleted file mode 100644
index a9ac776b0..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_largefiles.js
+++ /dev/null
@@ -1,153 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/ctypes.jsm");
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Task.jsm");
-
-/**
- * A test to check that .getPosition/.setPosition work with large files.
- * (see bug 952997)
- */
-
-// Test setPosition/getPosition.
-function test_setPosition(forward, current, backward) {
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_async_largefiles.tmp");
-
- // Clear any left-over files from previous runs.
- try {
- yield OS.File.remove(path);
- } catch (ex if ex.becauseNoSuchFile) {
- // ignore
- }
-
- try {
- let file = yield OS.File.open(path, {write:true, append:false});
- try {
- let pos = 0;
-
- // 1. seek forward from start
- do_print("Moving forward: " + forward);
- yield file.setPosition(forward, OS.File.POS_START);
- pos += forward;
- do_check_eq((yield file.getPosition()), pos);
-
- // 2. seek forward from current position
- do_print("Moving current: " + current);
- yield file.setPosition(current, OS.File.POS_CURRENT);
- pos += current;
- do_check_eq((yield file.getPosition()), pos);
-
- // 3. seek backward from current position
- do_print("Moving current backward: " + backward);
- yield file.setPosition(-backward, OS.File.POS_CURRENT);
- pos -= backward;
- do_check_eq((yield file.getPosition()), pos);
-
- } finally {
- yield file.setPosition(0, OS.File.POS_START);
- yield file.close();
- }
- } catch(ex) {
- try {
- yield OS.File.remove(path);
- } catch (ex if ex.becauseNoSuchFile) {
- // ignore.
- }
- do_throw(ex);
- }
-}
-
-// Test setPosition/getPosition expected failures.
-function test_setPosition_failures() {
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_async_largefiles.tmp");
-
- // Clear any left-over files from previous runs.
- try {
- yield OS.File.remove(path);
- } catch (ex if ex.becauseNoSuchFile) {
- // ignore
- }
-
- try {
- let file = yield OS.File.open(path, {write:true, append:false});
- try {
- let pos = 0;
-
- // 1. Use an invalid position value
- try {
- yield file.setPosition(0.5, OS.File.POS_START);
- do_throw("Shouldn't have succeeded");
- } catch (ex) {
- do_check_true(ex.toString().includes("can't pass"));
- }
- // Since setPosition should have bailed, it shouldn't have moved the
- // file pointer at all.
- do_check_eq((yield file.getPosition()), 0);
-
- // 2. Use an invalid position value
- try {
- yield file.setPosition(0xffffffff + 0.5, OS.File.POS_START);
- do_throw("Shouldn't have succeeded");
- } catch (ex) {
- do_check_true(ex.toString().includes("can't pass"));
- }
- // Since setPosition should have bailed, it shouldn't have moved the
- // file pointer at all.
- do_check_eq((yield file.getPosition()), 0);
-
- // 3. Use a position that cannot be represented as a double
- try {
- // Not all numbers after 9007199254740992 can be represented as a
- // double. E.g. in js 9007199254740992 + 1 == 9007199254740992
- yield file.setPosition(9007199254740992, OS.File.POS_START);
- yield file.setPosition(1, OS.File.POS_CURRENT);
- do_throw("Shouldn't have succeeded");
- } catch (ex) {
- do_print(ex.toString());
- do_check_true(!!ex);
- }
-
- } finally {
- yield file.setPosition(0, OS.File.POS_START);
- yield file.close();
- try {
- yield OS.File.remove(path);
- } catch (ex if ex.becauseNoSuchFile) {
- // ignore.
- }
- }
- } catch(ex) {
- do_throw(ex);
- }
-}
-
-function run_test() {
- // First verify stuff works for small values.
- add_task(test_setPosition.bind(null, 0, 100, 50));
- add_task(test_setPosition.bind(null, 1000, 100, 50));
- add_task(test_setPosition.bind(null, 1000, -100, -50));
-
- if (OS.Constants.Win || ctypes.off_t.size >= 8) {
- // Now verify stuff still works for large values.
- // 1. Multiple small seeks, which add up to > MAXINT32
- add_task(test_setPosition.bind(null, 0x7fffffff, 0x7fffffff, 0));
- // 2. Plain large seek, that should end up at 0 again.
- // 0xffffffff also happens to be the INVALID_SET_FILE_POINTER value on
- // Windows, so this also tests the error handling
- add_task(test_setPosition.bind(null, 0, 0xffffffff, 0xffffffff));
- // 3. Multiple large seeks that should end up > MAXINT32.
- add_task(test_setPosition.bind(null, 0xffffffff, 0xffffffff, 0xffffffff));
- // 5. Multiple large seeks with negative offsets.
- add_task(test_setPosition.bind(null, 0xffffffff, -0x7fffffff, 0x7fffffff));
-
- // 6. Check failures
- add_task(test_setPosition_failures);
- }
-
- run_next_test();
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setDates.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setDates.js
deleted file mode 100644
index 6a5ecd5e3..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setDates.js
+++ /dev/null
@@ -1,211 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Task.jsm");
-
-/**
- * A test to ensure that OS.File.setDates and OS.File.prototype.setDates are
- * working correctly.
- * (see bug 924916)
- */
-
-function run_test() {
- run_next_test();
-}
-
-// Non-prototypical tests, operating on path names.
-add_task(function* test_nonproto() {
- // First, create a file we can mess with.
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_async_setDates_nonproto.tmp");
- yield OS.File.writeAtomic(path, new Uint8Array(1));
-
- try {
- // 1. Try to set some well known dates.
- // We choose multiples of 2000ms, because the time stamp resolution of
- // the underlying OS might not support something more precise.
- const accDate = 2000;
- const modDate = 4000;
- {
- yield OS.File.setDates(path, accDate, modDate);
- let stat = yield OS.File.stat(path);
- do_check_eq(accDate, stat.lastAccessDate.getTime());
- do_check_eq(modDate, stat.lastModificationDate.getTime());
- }
-
- // 2.1 Try to omit modificationDate (which should then default to
- // |Date.now()|, expect for resolution differences).
- {
- yield OS.File.setDates(path, accDate);
- let stat = yield OS.File.stat(path);
- do_check_eq(accDate, stat.lastAccessDate.getTime());
- do_check_neq(modDate, stat.lastModificationDate.getTime());
- }
-
- // 2.2 Try to omit accessDate as well (which should then default to
- // |Date.now()|, expect for resolution differences).
- {
- yield OS.File.setDates(path);
- let stat = yield OS.File.stat(path);
- do_check_neq(accDate, stat.lastAccessDate.getTime());
- do_check_neq(modDate, stat.lastModificationDate.getTime());
- }
-
- // 3. Repeat 1., but with Date objects this time
- {
- yield OS.File.setDates(path, new Date(accDate), new Date(modDate));
- let stat = yield OS.File.stat(path);
- do_check_eq(accDate, stat.lastAccessDate.getTime());
- do_check_eq(modDate, stat.lastModificationDate.getTime());
- }
-
- // 4. Check that invalid params will cause an exception/rejection.
- {
- for (let p of ["invalid", new Uint8Array(1), NaN]) {
- try {
- yield OS.File.setDates(path, p, modDate);
- do_throw("Invalid access date should have thrown for: " + p);
- } catch (ex) {
- let stat = yield OS.File.stat(path);
- do_check_eq(accDate, stat.lastAccessDate.getTime());
- do_check_eq(modDate, stat.lastModificationDate.getTime());
- }
- try {
- yield OS.File.setDates(path, accDate, p);
- do_throw("Invalid modification date should have thrown for: " + p);
- } catch (ex) {
- let stat = yield OS.File.stat(path);
- do_check_eq(accDate, stat.lastAccessDate.getTime());
- do_check_eq(modDate, stat.lastModificationDate.getTime());
- }
- try {
- yield OS.File.setDates(path, p, p);
- do_throw("Invalid dates should have thrown for: " + p);
- } catch (ex) {
- let stat = yield OS.File.stat(path);
- do_check_eq(accDate, stat.lastAccessDate.getTime());
- do_check_eq(modDate, stat.lastModificationDate.getTime());
- }
- }
- }
- } finally {
- // Remove the temp file again
- yield OS.File.remove(path);
- }
-});
-
-// Prototypical tests, operating on |File| handles.
-add_task(function* test_proto() {
- if (OS.Constants.Sys.Name == "Android") {
- do_print("File.prototype.setDates is not implemented for Android");
- do_check_eq(OS.File.prototype.setDates, undefined);
- return;
- }
-
- // First, create a file we can mess with.
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_async_setDates_proto.tmp");
- yield OS.File.writeAtomic(path, new Uint8Array(1));
-
- try {
- let fd = yield OS.File.open(path, {write: true});
-
- try {
- // 1. Try to set some well known dates.
- // We choose multiples of 2000ms, because the time stamp resolution of
- // the underlying OS might not support something more precise.
- const accDate = 2000;
- const modDate = 4000;
- {
- yield fd.setDates(accDate, modDate);
- let stat = yield fd.stat();
- do_check_eq(accDate, stat.lastAccessDate.getTime());
- do_check_eq(modDate, stat.lastModificationDate.getTime());
- }
-
- // 2.1 Try to omit modificationDate (which should then default to
- // |Date.now()|, expect for resolution differences).
- {
- yield fd.setDates(accDate);
- let stat = yield fd.stat();
- do_check_eq(accDate, stat.lastAccessDate.getTime());
- do_check_neq(modDate, stat.lastModificationDate.getTime());
- }
-
- // 2.2 Try to omit accessDate as well (which should then default to
- // |Date.now()|, expect for resolution differences).
- {
- yield fd.setDates();
- let stat = yield fd.stat();
- do_check_neq(accDate, stat.lastAccessDate.getTime());
- do_check_neq(modDate, stat.lastModificationDate.getTime());
- }
-
- // 3. Repeat 1., but with Date objects this time
- {
- yield fd.setDates(new Date(accDate), new Date(modDate));
- let stat = yield fd.stat();
- do_check_eq(accDate, stat.lastAccessDate.getTime());
- do_check_eq(modDate, stat.lastModificationDate.getTime());
- }
-
- // 4. Check that invalid params will cause an exception/rejection.
- {
- for (let p of ["invalid", new Uint8Array(1), NaN]) {
- try {
- yield fd.setDates(p, modDate);
- do_throw("Invalid access date should have thrown for: " + p);
- } catch (ex) {
- let stat = yield fd.stat();
- do_check_eq(accDate, stat.lastAccessDate.getTime());
- do_check_eq(modDate, stat.lastModificationDate.getTime());
- }
- try {
- yield fd.setDates(accDate, p);
- do_throw("Invalid modification date should have thrown for: " + p);
- } catch (ex) {
- let stat = yield fd.stat();
- do_check_eq(accDate, stat.lastAccessDate.getTime());
- do_check_eq(modDate, stat.lastModificationDate.getTime());
- }
- try {
- yield fd.setDates(p, p);
- do_throw("Invalid dates should have thrown for: " + p);
- } catch (ex) {
- let stat = yield fd.stat();
- do_check_eq(accDate, stat.lastAccessDate.getTime());
- do_check_eq(modDate, stat.lastModificationDate.getTime());
- }
- }
- }
- } finally {
- yield fd.close();
- }
- } finally {
- // Remove the temp file again
- yield OS.File.remove(path);
- }
-});
-
-// Tests setting dates on directories.
-add_task(function* test_dirs() {
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_async_setDates_dir");
- yield OS.File.makeDir(path);
-
- try {
- // 1. Try to set some well known dates.
- // We choose multiples of 2000ms, because the time stamp resolution of
- // the underlying OS might not support something more precise.
- const accDate = 2000;
- const modDate = 4000;
- {
- yield OS.File.setDates(path, accDate, modDate);
- let stat = yield OS.File.stat(path);
- do_check_eq(accDate, stat.lastAccessDate.getTime());
- do_check_eq(modDate, stat.lastModificationDate.getTime());
- }
- } finally {
- yield OS.File.removeEmptyDir(path);
- }
-});
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPermissions.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPermissions.js
deleted file mode 100644
index ab8bf7dd9..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_async_setPermissions.js
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-/**
- * A test to ensure that OS.File.setPermissions and
- * OS.File.prototype.setPermissions are all working correctly.
- * (see bug 1001849)
- * These functions are currently Unix-specific. The manifest skips
- * the test on Windows.
- */
-
-/**
- * Helper function for test logging: prints a POSIX file permission mode as an
- * octal number, with a leading '0' per C (not JS) convention. When the
- * numeric value is 0o777 or lower, it is padded on the left with zeroes to
- * four digits wide.
- * Sample outputs: 0022, 0644, 04755.
- */
-function format_mode(mode) {
- if (mode <= 0o777) {
- return ("0000" + mode.toString(8)).slice(-4);
- } else {
- return "0" + mode.toString(8);
- }
-}
-
-const _umask = OS.Constants.Sys.umask;
-do_print("umask: " + format_mode(_umask));
-
-/**
- * Compute the mode that a file should have after applying the umask,
- * whatever it happens to be.
- */
-function apply_umask(mode) {
- return mode & ~_umask;
-}
-
-// Sequence of setPermission parameters and expected file mode. The first test
-// checks the permissions when the file is first created.
-var testSequence = [
- [null, apply_umask(0o600)],
- [{ unixMode: 0o4777 }, apply_umask(0o4777)],
- [{ unixMode: 0o4777, unixHonorUmask: false }, 0o4777],
- [{ unixMode: 0o4777, unixHonorUmask: true }, apply_umask(0o4777)],
- [undefined, apply_umask(0o600)],
- [{ unixMode: 0o666 }, apply_umask(0o666)],
- [{ unixMode: 0o600 }, apply_umask(0o600)],
- [{ unixMode: 0 }, 0],
- [{}, apply_umask(0o600)],
-];
-
-// Test application to paths.
-add_task(function* test_path_setPermissions() {
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_async_setPermissions_path.tmp");
- yield OS.File.writeAtomic(path, new Uint8Array(1));
-
- try {
- for (let [options, expectedMode] of testSequence) {
- if (options !== null) {
- do_print("Setting permissions to " + JSON.stringify(options));
- yield OS.File.setPermissions(path, options);
- }
-
- let stat = yield OS.File.stat(path);
- do_check_eq(format_mode(stat.unixMode), format_mode(expectedMode));
- }
- } finally {
- yield OS.File.remove(path);
- }
-});
-
-// Test application to open files.
-add_task(function* test_file_setPermissions() {
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_async_setPermissions_file.tmp");
- yield OS.File.writeAtomic(path, new Uint8Array(1));
-
- try {
- let fd = yield OS.File.open(path, { write: true });
- try {
- for (let [options, expectedMode] of testSequence) {
- if (options !== null) {
- do_print("Setting permissions to " + JSON.stringify(options));
- yield fd.setPermissions(options);
- }
-
- let stat = yield fd.stat();
- do_check_eq(format_mode(stat.unixMode), format_mode(expectedMode));
- }
- } finally {
- yield fd.close();
- }
- } finally {
- yield OS.File.remove(path);
- }
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_closed.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_closed.js
deleted file mode 100644
index 5740f7f1a..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_closed.js
+++ /dev/null
@@ -1,48 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Task.jsm");
-
-function run_test() {
- do_test_pending();
- run_next_test();
-}
-
-add_task(function test_closed() {
- OS.Shared.DEBUG = true;
- let currentDir = yield OS.File.getCurrentDirectory();
- do_print("Open a file, ensure that we can call stat()");
- let path = OS.Path.join(currentDir, "test_osfile_closed.js");
- let file = yield OS.File.open(path);
- yield file.stat();
- do_check_true(true);
-
- yield file.close();
-
- do_print("Ensure that we cannot stat() on closed file");
- let exn;
- try {
- yield file.stat();
- } catch (ex) {
- exn = ex;
- }
- do_print("Ensure that this raises the correct error");
- do_check_true(!!exn);
- do_check_true(exn instanceof OS.File.Error);
- do_check_true(exn.becauseClosed);
-
- do_print("Ensure that we cannot read() on closed file");
- exn = null;
- try {
- yield file.read();
- } catch (ex) {
- exn = ex;
- }
- do_print("Ensure that this raises the correct error");
- do_check_true(!!exn);
- do_check_true(exn instanceof OS.File.Error);
- do_check_true(exn.becauseClosed);
-
-});
-
-add_task(do_test_finished);
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_error.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_error.js
deleted file mode 100644
index a1c319eca..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_error.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var {OS: {File, Path, Constants}} = Components.utils.import("resource://gre/modules/osfile.jsm", {});
-Components.utils.import("resource://gre/modules/Task.jsm");
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* testFileError_with_writeAtomic() {
- let DEFAULT_CONTENTS = "default contents" + Math.random();
- let path = Path.join(Constants.Path.tmpDir,
- "testFileError.tmp");
- yield File.remove(path);
- yield File.writeAtomic(path, DEFAULT_CONTENTS);
- let exception;
- try {
- yield File.writeAtomic(path, DEFAULT_CONTENTS, { noOverwrite: true });
- } catch (ex) {
- exception = ex;
- }
- do_check_true(exception instanceof File.Error);
- do_check_true(exception.path == path);
-});
-
-add_task(function* testFileError_with_makeDir() {
- let path = Path.join(Constants.Path.tmpDir,
- "directory");
- yield File.removeDir(path);
- yield File.makeDir(path);
- let exception;
- try {
- yield File.makeDir(path, { ignoreExisting: false });
- } catch (ex) {
- exception = ex;
- }
- do_check_true(exception instanceof File.Error);
- do_check_true(exception.path == path);
-});
-
-add_task(function* testFileError_with_move() {
- let DEFAULT_CONTENTS = "default contents" + Math.random();
- let sourcePath = Path.join(Constants.Path.tmpDir,
- "src.tmp");
- let destPath = Path.join(Constants.Path.tmpDir,
- "dest.tmp");
- yield File.remove(sourcePath);
- yield File.remove(destPath);
- yield File.writeAtomic(sourcePath, DEFAULT_CONTENTS);
- yield File.writeAtomic(destPath, DEFAULT_CONTENTS);
- let exception;
- try {
- yield File.move(sourcePath, destPath, { noOverwrite: true });
- } catch (ex) {
- exception = ex;
- }
- do_print(exception);
- do_check_true(exception instanceof File.Error);
- do_check_true(exception.path == sourcePath);
-});
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_kill.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_kill.js
deleted file mode 100644
index e32c37224..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_kill.js
+++ /dev/null
@@ -1,100 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-
-// We want the actual global to get at the internals since Scheduler is not
-// exported.
-var AsyncFrontGlobal = Components.utils.import(
- "resource://gre/modules/osfile/osfile_async_front.jsm",
- null);
-var Scheduler = AsyncFrontGlobal.Scheduler;
-
-/**
- * Verify that Scheduler.kill() interacts with other OS.File requests correctly,
- * and that no requests are lost. This is relevant because on B2G we
- * auto-kill the worker periodically, making it very possible for valid requests
- * to be interleaved with the automatic kill().
- *
- * This test is being created with the fix for Bug 1125989 where `kill` queue
- * management was found to be buggy. It is a glass-box test that explicitly
- * re-creates the observed failure situation; it is not guaranteed to prevent
- * all future regressions. The following is a detailed explanation of the test
- * for your benefit if this test ever breaks or you are wondering what was the
- * point of all this. You might want to skim the code below first.
- *
- * OS.File maintains a `queue` of operations to be performed. This queue is
- * nominally implemented as a chain of promises. Every time a new job is
- * OS.File.push()ed, it effectively becomes the new `queue` promise. (An
- * extra promise is interposed with a rejection handler to avoid the rejection
- * cascading, but that does not matter for our purposes.)
- *
- * The flaw in `kill` was that it would wait for the `queue` to complete before
- * replacing `queue`. As a result, another OS.File operation could use `push`
- * (by way of OS.File.post()) to also use .then() on the same `queue` promise.
- * Accordingly, assuming that promise was not yet resolved (due to a pending
- * OS.File request), when it was resolved, both the task scheduled in `kill`
- * and in `post` would be triggered. Both of those tasks would run until
- * encountering a call to worker.post().
- *
- * Re-creating this race is not entirely trivial because of the large number of
- * promises used by the code causing control flow to repeatedly be deferred. In
- * a slightly simpler world we could run the follwing in the same turn of the
- * event loop and trigger the problem.
- * - any OS.File request
- * - Scheduler.kill()
- * - any OS.File request
- *
- * However, we need the Scheduler.kill task to reach the point where it is
- * waiting on the same `queue` that another task has been scheduled against.
- * Since the `kill` task yields on the `killQueue` promise prior to yielding
- * on `queue`, however, some turns of the event loop are required. Happily,
- * for us, as discussed above, the problem triggers when we have two promises
- * scheduled on the `queue`, so we can just wait to schedule the second OS.File
- * request on the queue. (Note that because of the additional then() added to
- * eat rejections, there is an important difference between the value of
- * `queue` and the value returned by the first OS.File request.)
- */
-add_task(function* test_kill_race() {
- // Ensure the worker has been created and that SET_DEBUG has taken effect.
- // We have chosen OS.File.exists for our tests because it does not trigger
- // a rejection and we absolutely do not care what the operation is other
- // than it does not invoke a native fast-path.
- yield OS.File.exists('foo.foo');
-
- do_print('issuing first request');
- let firstRequest = OS.File.exists('foo.bar');
- let secondRequest;
- let secondResolved = false;
-
- // As noted in our big block comment, we want to wait to schedule the
- // second request so that it races `kill`'s call to `worker.post`. Having
- // ourselves wait on the same promise, `queue`, and registering ourselves
- // before we issue the kill request means we will get run before the `kill`
- // task resumes and allow us to precisely create the desired race.
- Scheduler.queue.then(function() {
- do_print('issuing second request');
- secondRequest = OS.File.exists('foo.baz');
- secondRequest.then(function() {
- secondResolved = true;
- });
- });
-
- do_print('issuing kill request');
- let killRequest = Scheduler.kill({ reset: true, shutdown: false });
-
- // Wait on the killRequest so that we can schedule a new OS.File request
- // after it completes...
- yield killRequest;
- // ...because our ordering guarantee ensures that there is at most one
- // worker (and this usage here should not be vulnerable even with the
- // bug present), so when this completes the secondRequest has either been
- // resolved or lost.
- yield OS.File.exists('foo.goz');
-
- ok(secondResolved,
- 'The second request was resolved so we avoided the bug. Victory!');
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_win_async_setPermissions.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_win_async_setPermissions.js
deleted file mode 100644
index 990d722f5..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_win_async_setPermissions.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-/**
- * A test to ensure that OS.File.setPermissions and
- * OS.File.prototype.setPermissions are all working correctly.
- * (see bug 1022816)
- * The manifest tests on Windows.
- */
-
-// Sequence of setPermission parameters.
-var testSequence = [
- [ { winAttributes: { readOnly: true, system: true, hidden: true } },
- { readOnly: true, system: true, hidden: true } ],
- [ { winAttributes: { readOnly: false } },
- { readOnly: false, system: true, hidden: true } ],
- [ { winAttributes: { system: false } },
- { readOnly: false, system: false, hidden: true } ],
- [ { winAttributes: { hidden: false } },
- { readOnly: false, system: false, hidden: false } ],
- [ { winAttributes: {readOnly: true, system: false, hidden: false} },
- { readOnly: true, system: false, hidden: false } ],
- [ { winAttributes: {readOnly: false, system: true, hidden: false} },
- { readOnly: false, system: true, hidden: false } ],
- [ { winAttributes: {readOnly: false, system: false, hidden: true} },
- { readOnly: false, system: false, hidden: true } ],
-];
-
-// Test application to paths.
-add_task(function* test_path_setPermissions() {
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_win_async_setPermissions_path.tmp");
- yield OS.File.writeAtomic(path, new Uint8Array(1));
-
- try {
- for (let [options, attributesExpected] of testSequence) {
- if (options !== null) {
- do_print("Setting permissions to " + JSON.stringify(options));
- yield OS.File.setPermissions(path, options);
- }
-
- let stat = yield OS.File.stat(path);
- do_print("Got stat winAttributes: " + JSON.stringify(stat.winAttributes));
-
- do_check_eq(stat.winAttributes.readOnly, attributesExpected.readOnly);
- do_check_eq(stat.winAttributes.system, attributesExpected.system);
- do_check_eq(stat.winAttributes.hidden, attributesExpected.hidden);
-
- }
- } finally {
- yield OS.File.remove(path);
- }
-});
-
-// Test application to open files.
-add_task(function* test_file_setPermissions() {
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_win_async_setPermissions_file.tmp");
- yield OS.File.writeAtomic(path, new Uint8Array(1));
-
- try {
- let fd = yield OS.File.open(path, { write: true });
- try {
- for (let [options, attributesExpected] of testSequence) {
- if (options !== null) {
- do_print("Setting permissions to " + JSON.stringify(options));
- yield fd.setPermissions(options);
- }
-
- let stat = yield fd.stat();
- do_print("Got stat winAttributes: " + JSON.stringify(stat.winAttributes));
- do_check_eq(stat.winAttributes.readOnly, attributesExpected.readOnly);
- do_check_eq(stat.winAttributes.system, attributesExpected.system);
- do_check_eq(stat.winAttributes.hidden, attributesExpected.hidden);
- }
- } finally {
- yield fd.close();
- }
- } finally {
- yield OS.File.remove(path);
- }
-});
-
-// Test application to Check setPermissions on a non-existant file path.
-add_task(function* test_non_existant_file_path_setPermissions() {
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_win_async_setPermissions_path.tmp");
- Assert.rejects(OS.File.setPermissions(path, {winAttributes: {readOnly: true}}),
- /The system cannot find the file specified/,
- "setPermissions failed as expected on a non-existant file path");
-});
-
-// Test application to Check setPermissions on a invalid file handle.
-add_task(function* test_closed_file_handle_setPermissions() {
- let path = OS.Path.join(OS.Constants.Path.tmpDir,
- "test_osfile_win_async_setPermissions_path.tmp");
- yield OS.File.writeAtomic(path, new Uint8Array(1));
-
- try {
- let fd = yield OS.File.open(path, { write: true });
- yield fd.close();
- Assert.rejects(fd.setPermissions(path, {winAttributes: {readOnly: true}}),
- /The handle is invalid/,
- "setPermissions failed as expected on a invalid file handle");
- } finally {
- yield OS.File.remove(path);
- }
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_writeAtomic_backupTo_option.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_writeAtomic_backupTo_option.js
deleted file mode 100644
index adf345b0c..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_writeAtomic_backupTo_option.js
+++ /dev/null
@@ -1,143 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var {OS: {File, Path, Constants}} = Components.utils.import("resource://gre/modules/osfile.jsm", {});
-Components.utils.import("resource://gre/modules/Task.jsm");
-
-/**
- * Remove all temporary files and back up files, including
- * test_backupTo_option_with_tmpPath.tmp
- * test_backupTo_option_with_tmpPath.tmp.backup
- * test_backupTo_option_without_tmpPath.tmp
- * test_backupTo_option_without_tmpPath.tmp.backup
- * test_non_backupTo_option.tmp
- * test_non_backupTo_option.tmp.backup
- * test_backupTo_option_without_destination_file.tmp
- * test_backupTo_option_without_destination_file.tmp.backup
- * test_backupTo_option_with_backup_file.tmp
- * test_backupTo_option_with_backup_file.tmp.backup
- */
-function clearFiles() {
- return Task.spawn(function () {
- let files = ["test_backupTo_option_with_tmpPath.tmp",
- "test_backupTo_option_without_tmpPath.tmp",
- "test_non_backupTo_option.tmp",
- "test_backupTo_option_without_destination_file.tmp",
- "test_backupTo_option_with_backup_file.tmp"];
- for (let file of files) {
- let path = Path.join(Constants.Path.tmpDir, file);
- yield File.remove(path);
- yield File.remove(path + ".backup");
- }
- });
-}
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* init() {
- yield clearFiles();
-});
-
-/**
- * test when
- * |backupTo| specified
- * |tmpPath| specified
- * destination file exists
- * @result destination file will be backed up
- */
-add_task(function* test_backupTo_option_with_tmpPath() {
- let DEFAULT_CONTENTS = "default contents" + Math.random();
- let WRITE_CONTENTS = "abc" + Math.random();
- let path = Path.join(Constants.Path.tmpDir,
- "test_backupTo_option_with_tmpPath.tmp");
- yield File.writeAtomic(path, DEFAULT_CONTENTS);
- yield File.writeAtomic(path, WRITE_CONTENTS, { tmpPath: path + ".tmp",
- backupTo: path + ".backup" });
- do_check_true((yield File.exists(path + ".backup")));
- let contents = yield File.read(path + ".backup");
- do_check_eq(DEFAULT_CONTENTS, (new TextDecoder()).decode(contents));
-});
-
-/**
- * test when
- * |backupTo| specified
- * |tmpPath| not specified
- * destination file exists
- * @result destination file will be backed up
- */
-add_task(function* test_backupTo_option_without_tmpPath() {
- let DEFAULT_CONTENTS = "default contents" + Math.random();
- let WRITE_CONTENTS = "abc" + Math.random();
- let path = Path.join(Constants.Path.tmpDir,
- "test_backupTo_option_without_tmpPath.tmp");
- yield File.writeAtomic(path, DEFAULT_CONTENTS);
- yield File.writeAtomic(path, WRITE_CONTENTS, { backupTo: path + ".backup" });
- do_check_true((yield File.exists(path + ".backup")));
- let contents = yield File.read(path + ".backup");
- do_check_eq(DEFAULT_CONTENTS, (new TextDecoder()).decode(contents));
-});
-
-/**
- * test when
- * |backupTo| not specified
- * |tmpPath| not specified
- * destination file exists
- * @result destination file will not be backed up
- */
-add_task(function* test_non_backupTo_option() {
- let DEFAULT_CONTENTS = "default contents" + Math.random();
- let WRITE_CONTENTS = "abc" + Math.random();
- let path = Path.join(Constants.Path.tmpDir,
- "test_non_backupTo_option.tmp");
- yield File.writeAtomic(path, DEFAULT_CONTENTS);
- yield File.writeAtomic(path, WRITE_CONTENTS);
- do_check_false((yield File.exists(path + ".backup")));
-});
-
-/**
- * test when
- * |backupTo| specified
- * |tmpPath| not specified
- * destination file not exists
- * @result no back up file exists
- */
-add_task(function* test_backupTo_option_without_destination_file() {
- let DEFAULT_CONTENTS = "default contents" + Math.random();
- let WRITE_CONTENTS = "abc" + Math.random();
- let path = Path.join(Constants.Path.tmpDir,
- "test_backupTo_option_without_destination_file.tmp");
- yield File.remove(path);
- yield File.writeAtomic(path, WRITE_CONTENTS, { backupTo: path + ".backup" });
- do_check_false((yield File.exists(path + ".backup")));
-});
-
-/**
- * test when
- * |backupTo| specified
- * |tmpPath| not specified
- * backup file exists
- * destination file exists
- * @result destination file will be backed up
- */
-add_task(function* test_backupTo_option_with_backup_file() {
- let DEFAULT_CONTENTS = "default contents" + Math.random();
- let WRITE_CONTENTS = "abc" + Math.random();
- let path = Path.join(Constants.Path.tmpDir,
- "test_backupTo_option_with_backup_file.tmp");
- yield File.writeAtomic(path, DEFAULT_CONTENTS);
-
- yield File.writeAtomic(path + ".backup", new Uint8Array(1000));
-
- yield File.writeAtomic(path, WRITE_CONTENTS, { backupTo: path + ".backup" });
- do_check_true((yield File.exists(path + ".backup")));
- let contents = yield File.read(path + ".backup");
- do_check_eq(DEFAULT_CONTENTS, (new TextDecoder()).decode(contents));
-});
-
-add_task(function* cleanup() {
- yield clearFiles();
-});
diff --git a/toolkit/components/osfile/tests/xpcshell/test_osfile_writeAtomic_zerobytes.js b/toolkit/components/osfile/tests/xpcshell/test_osfile_writeAtomic_zerobytes.js
deleted file mode 100644
index a32a690e6..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_osfile_writeAtomic_zerobytes.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-var SHARED_PATH;
-
-add_task(function* init() {
- do_get_profile();
- SHARED_PATH = OS.Path.join(OS.Constants.Path.profileDir, "test_osfile_write_zerobytes.tmp");
-});
-
-add_test_pair(function* test_osfile_writeAtomic_zerobytes() {
- let encoder = new TextEncoder();
- let string1 = "";
- let outbin = encoder.encode(string1);
- yield OS.File.writeAtomic(SHARED_PATH, outbin);
-
- let decoder = new TextDecoder();
- let bin = yield OS.File.read(SHARED_PATH);
- let string2 = decoder.decode(bin);
- // Checking if writeAtomic supports writing encoded zero-byte strings
- Assert.equal(string2, string1, "Read the expected (empty) string.");
-});
-
-function run_test() {
- run_next_test();
-} \ No newline at end of file
diff --git a/toolkit/components/osfile/tests/xpcshell/test_path.js b/toolkit/components/osfile/tests/xpcshell/test_path.js
deleted file mode 100644
index 76a507ee3..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_path.js
+++ /dev/null
@@ -1,159 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/Services.jsm", this);
-Services.prefs.setBoolPref("toolkit.osfile.test.syslib_necessary", false);
- // We don't need libc/kernel32.dll for this test
-
-var ImportWin = {};
-var ImportUnix = {};
-Components.utils.import("resource://gre/modules/osfile/ospath_win.jsm", ImportWin);
-Components.utils.import("resource://gre/modules/osfile/ospath_unix.jsm", ImportUnix);
-
-var Win = ImportWin;
-var Unix = ImportUnix;
-
-function do_check_fail(f)
-{
- try {
- let result = f();
- do_print("Failed do_check_fail: " + result);
- do_check_true(false);
- } catch (ex) {
- do_check_true(true);
- }
-};
-
-function run_test()
-{
- do_print("Testing Windows paths");
-
- do_print("Backslash-separated, no drive");
- do_check_eq(Win.basename("a\\b"), "b");
- do_check_eq(Win.basename("a\\b\\"), "");
- do_check_eq(Win.basename("abc"), "abc");
- do_check_eq(Win.dirname("a\\b"), "a");
- do_check_eq(Win.dirname("a\\b\\"), "a\\b");
- do_check_eq(Win.dirname("a\\\\\\\\b"), "a");
- do_check_eq(Win.dirname("abc"), ".");
- do_check_eq(Win.normalize("\\a\\b\\c"), "\\a\\b\\c");
- do_check_eq(Win.normalize("\\a\\b\\\\\\\\c"), "\\a\\b\\c");
- do_check_eq(Win.normalize("\\a\\b\\c\\\\\\"), "\\a\\b\\c");
- do_check_eq(Win.normalize("\\a\\b\\c\\..\\..\\..\\d\\e\\f"), "\\d\\e\\f");
- do_check_eq(Win.normalize("a\\b\\c\\..\\..\\..\\d\\e\\f"), "d\\e\\f");
- do_check_fail(() => Win.normalize("\\a\\b\\c\\..\\..\\..\\..\\d\\e\\f"));
-
- do_check_eq(Win.join("\\tmp", "foo", "bar"), "\\tmp\\foo\\bar", "join \\tmp,foo,bar");
- do_check_eq(Win.join("\\tmp", "\\foo", "bar"), "\\foo\\bar", "join \\tmp,\\foo,bar");
- do_check_eq(Win.winGetDrive("\\tmp"), null);
- do_check_eq(Win.winGetDrive("\\tmp\\a\\b\\c\\d\\e"), null);
- do_check_eq(Win.winGetDrive("\\"), null);
-
-
- do_print("Backslash-separated, with a drive");
- do_check_eq(Win.basename("c:a\\b"), "b");
- do_check_eq(Win.basename("c:a\\b\\"), "");
- do_check_eq(Win.basename("c:abc"), "abc");
- do_check_eq(Win.dirname("c:a\\b"), "c:a");
- do_check_eq(Win.dirname("c:a\\b\\"), "c:a\\b");
- do_check_eq(Win.dirname("c:a\\\\\\\\b"), "c:a");
- do_check_eq(Win.dirname("c:abc"), "c:");
- let options = {
- winNoDrive: true
- };
- do_check_eq(Win.dirname("c:a\\b", options), "a");
- do_check_eq(Win.dirname("c:a\\b\\", options), "a\\b");
- do_check_eq(Win.dirname("c:a\\\\\\\\b", options), "a");
- do_check_eq(Win.dirname("c:abc", options), ".");
- do_check_eq(Win.join("c:", "abc"), "c:\\abc", "join c:,abc");
-
- do_check_eq(Win.normalize("c:"), "c:\\");
- do_check_eq(Win.normalize("c:\\"), "c:\\");
- do_check_eq(Win.normalize("c:\\a\\b\\c"), "c:\\a\\b\\c");
- do_check_eq(Win.normalize("c:\\a\\b\\\\\\\\c"), "c:\\a\\b\\c");
- do_check_eq(Win.normalize("c:\\\\\\\\a\\b\\c"), "c:\\a\\b\\c");
- do_check_eq(Win.normalize("c:\\a\\b\\c\\\\\\"), "c:\\a\\b\\c");
- do_check_eq(Win.normalize("c:\\a\\b\\c\\..\\..\\..\\d\\e\\f"), "c:\\d\\e\\f");
- do_check_eq(Win.normalize("c:a\\b\\c\\..\\..\\..\\d\\e\\f"), "c:\\d\\e\\f");
- do_check_fail(() => Win.normalize("c:\\a\\b\\c\\..\\..\\..\\..\\d\\e\\f"));
-
- do_check_eq(Win.join("c:\\", "foo"), "c:\\foo", "join c:\,foo");
- do_check_eq(Win.join("c:\\tmp", "foo", "bar"), "c:\\tmp\\foo\\bar", "join c:\\tmp,foo,bar");
- do_check_eq(Win.join("c:\\tmp", "\\foo", "bar"), "c:\\foo\\bar", "join c:\\tmp,\\foo,bar");
- do_check_eq(Win.join("c:\\tmp", "c:\\foo", "bar"), "c:\\foo\\bar", "join c:\\tmp,c:\\foo,bar");
- do_check_eq(Win.join("c:\\tmp", "c:foo", "bar"), "c:\\foo\\bar", "join c:\\tmp,c:foo,bar");
- do_check_eq(Win.winGetDrive("c:"), "c:");
- do_check_eq(Win.winGetDrive("c:\\"), "c:");
- do_check_eq(Win.winGetDrive("c:abc"), "c:");
- do_check_eq(Win.winGetDrive("c:abc\\d\\e\\f\\g"), "c:");
- do_check_eq(Win.winGetDrive("c:\\abc"), "c:");
- do_check_eq(Win.winGetDrive("c:\\abc\\d\\e\\f\\g"), "c:");
-
- do_print("Forwardslash-separated, no drive");
- do_check_eq(Win.normalize("/a/b/c"), "\\a\\b\\c");
- do_check_eq(Win.normalize("/a/b////c"), "\\a\\b\\c");
- do_check_eq(Win.normalize("/a/b/c///"), "\\a\\b\\c");
- do_check_eq(Win.normalize("/a/b/c/../../../d/e/f"), "\\d\\e\\f");
- do_check_eq(Win.normalize("a/b/c/../../../d/e/f"), "d\\e\\f");
-
- do_print("Forwardslash-separated, with a drive");
- do_check_eq(Win.normalize("c:/"), "c:\\");
- do_check_eq(Win.normalize("c:/a/b/c"), "c:\\a\\b\\c");
- do_check_eq(Win.normalize("c:/a/b////c"), "c:\\a\\b\\c");
- do_check_eq(Win.normalize("c:////a/b/c"), "c:\\a\\b\\c");
- do_check_eq(Win.normalize("c:/a/b/c///"), "c:\\a\\b\\c");
- do_check_eq(Win.normalize("c:/a/b/c/../../../d/e/f"), "c:\\d\\e\\f");
- do_check_eq(Win.normalize("c:a/b/c/../../../d/e/f"), "c:\\d\\e\\f");
-
- do_print("Backslash-separated, UNC-style");
- do_check_eq(Win.basename("\\\\a\\b"), "b");
- do_check_eq(Win.basename("\\\\a\\b\\"), "");
- do_check_eq(Win.basename("\\\\abc"), "");
- do_check_eq(Win.dirname("\\\\a\\b"), "\\\\a");
- do_check_eq(Win.dirname("\\\\a\\b\\"), "\\\\a\\b");
- do_check_eq(Win.dirname("\\\\a\\\\\\\\b"), "\\\\a");
- do_check_eq(Win.dirname("\\\\abc"), "\\\\abc");
- do_check_eq(Win.normalize("\\\\a\\b\\c"), "\\\\a\\b\\c");
- do_check_eq(Win.normalize("\\\\a\\b\\\\\\\\c"), "\\\\a\\b\\c");
- do_check_eq(Win.normalize("\\\\a\\b\\c\\\\\\"), "\\\\a\\b\\c");
- do_check_eq(Win.normalize("\\\\a\\b\\c\\..\\..\\d\\e\\f"), "\\\\a\\d\\e\\f");
- do_check_fail(() => Win.normalize("\\\\a\\b\\c\\..\\..\\..\\d\\e\\f"));
-
- do_check_eq(Win.join("\\\\a\\tmp", "foo", "bar"), "\\\\a\\tmp\\foo\\bar");
- do_check_eq(Win.join("\\\\a\\tmp", "\\foo", "bar"), "\\\\a\\foo\\bar");
- do_check_eq(Win.join("\\\\a\\tmp", "\\\\foo\\", "bar"), "\\\\foo\\bar");
- do_check_eq(Win.winGetDrive("\\\\"), null);
- do_check_eq(Win.winGetDrive("\\\\c"), "\\\\c");
- do_check_eq(Win.winGetDrive("\\\\c\\abc"), "\\\\c");
-
- do_print("Testing unix paths");
- do_check_eq(Unix.basename("a/b"), "b");
- do_check_eq(Unix.basename("a/b/"), "");
- do_check_eq(Unix.basename("abc"), "abc");
- do_check_eq(Unix.dirname("a/b"), "a");
- do_check_eq(Unix.dirname("a/b/"), "a/b");
- do_check_eq(Unix.dirname("a////b"), "a");
- do_check_eq(Unix.dirname("abc"), ".");
- do_check_eq(Unix.normalize("/a/b/c"), "/a/b/c");
- do_check_eq(Unix.normalize("/a/b////c"), "/a/b/c");
- do_check_eq(Unix.normalize("////a/b/c"), "/a/b/c");
- do_check_eq(Unix.normalize("/a/b/c///"), "/a/b/c");
- do_check_eq(Unix.normalize("/a/b/c/../../../d/e/f"), "/d/e/f");
- do_check_eq(Unix.normalize("a/b/c/../../../d/e/f"), "d/e/f");
- do_check_fail(() => Unix.normalize("/a/b/c/../../../../d/e/f"));
-
- do_check_eq(Unix.join("/tmp", "foo", "bar"), "/tmp/foo/bar", "join /tmp,foo,bar");
- do_check_eq(Unix.join("/tmp", "/foo", "bar"), "/foo/bar", "join /tmp,/foo,bar");
-
- do_print("Testing the presence of ospath.jsm");
- let Scope = {};
- try {
- Components.utils.import("resource://gre/modules/osfile/ospath.jsm", Scope);
- } catch (ex) {
- // Can't load ospath
- }
- do_check_true(!!Scope.basename);
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_path_constants.js b/toolkit/components/osfile/tests/xpcshell/test_path_constants.js
deleted file mode 100644
index 9b9868bb2..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_path_constants.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-Cu.import("resource://gre/modules/ctypes.jsm", this);
-Cu.import("resource://testing-common/AppData.jsm", this);
-
-
-function run_test() {
- run_next_test();
-}
-
-function compare_paths(ospath, key) {
- let file;
- try {
- file = Services.dirsvc.get(key, Components.interfaces.nsIFile);
- } catch(ex) {}
-
- if (file) {
- do_check_true(!!ospath);
- do_check_eq(ospath, file.path);
- } else {
- do_print("WARNING: " + key + " is not defined. Test may not be testing anything!");
- do_check_false(!!ospath);
- }
-}
-
-// Some path constants aren't set up until the profile is available. This
-// test verifies that behavior.
-add_task(function* test_before_after_profile() {
- do_check_null(OS.Constants.Path.profileDir);
- do_check_null(OS.Constants.Path.localProfileDir);
- do_check_null(OS.Constants.Path.userApplicationDataDir);
-
- do_get_profile();
- do_check_true(!!OS.Constants.Path.profileDir);
- do_check_true(!!OS.Constants.Path.localProfileDir);
-
- // UAppData is still null because the xpcshell profile doesn't set it up.
- // This test is mostly here to fail in case behavior of do_get_profile() ever
- // changes. We want to know if our assumptions no longer hold!
- do_check_null(OS.Constants.Path.userApplicationDataDir);
-
- yield makeFakeAppDir();
- do_check_true(!!OS.Constants.Path.userApplicationDataDir);
-
- // FUTURE: verify AppData too (bug 964291).
-});
-
-// Test simple paths
-add_task(function* test_simple_paths() {
- do_check_true(!!OS.Constants.Path.tmpDir);
- compare_paths(OS.Constants.Path.tmpDir, "TmpD");
-
-});
-
-// Test presence of paths that only exist on Desktop platforms
-add_task(function* test_desktop_paths() {
- if (OS.Constants.Sys.Name == "Android") {
- return;
- }
- do_check_true(!!OS.Constants.Path.desktopDir);
- do_check_true(!!OS.Constants.Path.homeDir);
-
- compare_paths(OS.Constants.Path.homeDir, "Home");
- compare_paths(OS.Constants.Path.desktopDir, "Desk");
- compare_paths(OS.Constants.Path.userApplicationDataDir, "UAppData");
-
- compare_paths(OS.Constants.Path.winAppDataDir, "AppData");
- compare_paths(OS.Constants.Path.winStartMenuProgsDir, "Progs");
-
- compare_paths(OS.Constants.Path.macUserLibDir, "ULibDir");
- compare_paths(OS.Constants.Path.macLocalApplicationsDir, "LocApp");
- compare_paths(OS.Constants.Path.macTrashDir, "Trsh");
-});
-
-// Open libxul
-add_task(function* test_libxul() {
- ctypes.open(OS.Constants.Path.libxul);
- do_print("Linked to libxul");
-});
diff --git a/toolkit/components/osfile/tests/xpcshell/test_queue.js b/toolkit/components/osfile/tests/xpcshell/test_queue.js
deleted file mode 100644
index c9d23eabc..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_queue.js
+++ /dev/null
@@ -1,38 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-
-function run_test() {
- run_next_test();
-}
-
-// Check if Scheduler.queue returned by OS.File.queue is resolved initially.
-add_task(function* check_init() {
- yield OS.File.queue;
- do_print("Function resolved");
-});
-
-// Check if Scheduler.queue returned by OS.File.queue is resolved
-// after an operation is successful.
-add_task(function* check_success() {
- do_print("Attempting to open a file correctly");
- let openedFile = yield OS.File.open(OS.Path.join(do_get_cwd().path, "test_queue.js"));
- do_print("File opened correctly");
- yield OS.File.queue;
- do_print("Function resolved");
-});
-
-// Check if Scheduler.queue returned by OS.File.queue is resolved
-// after an operation fails.
-add_task(function* check_failure() {
- let exception;
- try {
- do_print("Attempting to open a non existing file");
- yield OS.File.open(OS.Path.join(".", "Bigfoot"));
- } catch (err) {
- exception = err;
- yield OS.File.queue;
- }
- do_check_true(exception!=null);
- do_print("Function resolved");
-}); \ No newline at end of file
diff --git a/toolkit/components/osfile/tests/xpcshell/test_read_write.js b/toolkit/components/osfile/tests/xpcshell/test_read_write.js
deleted file mode 100644
index 00235ed8c..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_read_write.js
+++ /dev/null
@@ -1,103 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var {utils: Cu} = Components;
-
-var SHARED_PATH;
-
-var EXISTING_FILE = do_get_file("xpcshell.ini").path;
-
-add_task(function* init() {
- do_get_profile();
- SHARED_PATH = OS.Path.join(OS.Constants.Path.profileDir, "test_osfile_read.tmp");
-});
-
-
-// Check that OS.File.read() is executed after the previous operation
-add_test_pair(function* ordering() {
- let string1 = "Initial state " + Math.random();
- let string2 = "After writing " + Math.random();
- yield OS.File.writeAtomic(SHARED_PATH, string1);
- OS.File.writeAtomic(SHARED_PATH, string2);
- let string3 = yield OS.File.read(SHARED_PATH, { encoding: "utf-8" });
- do_check_eq(string3, string2);
-});
-
-add_test_pair(function* read_write_all() {
- let DEST_PATH = SHARED_PATH + Math.random();
- let TMP_PATH = DEST_PATH + ".tmp";
-
- let test_with_options = function(options, suffix) {
- return Task.spawn(function*() {
- do_print("Running test read_write_all with options " + JSON.stringify(options));
- let TEST = "read_write_all " + suffix;
-
- let optionsBackup = JSON.parse(JSON.stringify(options));
-
- // Check that read + writeAtomic performs a correct copy
- let currentDir = yield OS.File.getCurrentDirectory();
- let pathSource = OS.Path.join(currentDir, EXISTING_FILE);
- let contents = yield OS.File.read(pathSource);
- do_check_true(!!contents); // Content is not empty
- let bytesRead = contents.byteLength;
-
- let bytesWritten = yield OS.File.writeAtomic(DEST_PATH, contents, options);
- do_check_eq(bytesRead, bytesWritten); // Correct number of bytes written
-
- // Check that options are not altered
- do_check_eq(JSON.stringify(options), JSON.stringify(optionsBackup));
- yield reference_compare_files(pathSource, DEST_PATH, TEST);
-
- // Check that temporary file was removed or never created exist
- do_check_false(new FileUtils.File(TMP_PATH).exists());
-
- // Check that writeAtomic fails if noOverwrite is true and the destination
- // file already exists!
- contents = new Uint8Array(300);
- let view = new Uint8Array(contents.buffer, 10, 200);
- try {
- let opt = JSON.parse(JSON.stringify(options));
- opt.noOverwrite = true;
- yield OS.File.writeAtomic(DEST_PATH, view, opt);
- do_throw("With noOverwrite, writeAtomic should have refused to overwrite file (" + suffix + ")");
- } catch (err if err instanceof OS.File.Error && err.becauseExists) {
- do_print("With noOverwrite, writeAtomic correctly failed (" + suffix + ")");
- }
- yield reference_compare_files(pathSource, DEST_PATH, TEST);
-
- // Check that temporary file was removed or never created
- do_check_false(new FileUtils.File(TMP_PATH).exists());
-
- // Now write a subset
- let START = 10;
- let LENGTH = 100;
- contents = new Uint8Array(300);
- for (var i = 0; i < contents.byteLength; i++)
- contents[i] = i % 256;
- view = new Uint8Array(contents.buffer, START, LENGTH);
- bytesWritten = yield OS.File.writeAtomic(DEST_PATH, view, options);
- do_check_eq(bytesWritten, LENGTH);
-
- let array2 = yield OS.File.read(DEST_PATH);
- do_check_eq(LENGTH, array2.length);
- for (var i = 0; i < LENGTH; i++)
- do_check_eq(array2[i], (i + START) % 256);
-
- // Cleanup.
- yield OS.File.remove(DEST_PATH);
- yield OS.File.remove(TMP_PATH);
- });
- };
-
- yield test_with_options({tmpPath: TMP_PATH}, "Renaming, not flushing");
- yield test_with_options({tmpPath: TMP_PATH, flush: true}, "Renaming, flushing");
- yield test_with_options({}, "Not renaming, not flushing");
- yield test_with_options({flush: true}, "Not renaming, flushing");
-});
-
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_remove.js b/toolkit/components/osfile/tests/xpcshell/test_remove.js
deleted file mode 100644
index c8dc33054..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_remove.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Task.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-do_register_cleanup(function() {
- Services.prefs.setBoolPref("toolkit.osfile.log", false);
-});
-
-function run_test() {
- Services.prefs.setBoolPref("toolkit.osfile.log", true);
- run_next_test();
-}
-
-add_task(function* test_ignoreAbsent() {
- let absent_file_name = "test_osfile_front_absent.tmp";
-
- // Removing absent files should throw if "ignoreAbsent" is true.
- yield Assert.rejects(OS.File.remove(absent_file_name, {ignoreAbsent: false}),
- "OS.File.remove throws if there is no such file.");
-
- // Removing absent files should not throw if "ignoreAbsent" is true or not
- // defined.
- let exception = null;
- try {
- yield OS.File.remove(absent_file_name, {ignoreAbsent: true});
- yield OS.File.remove(absent_file_name);
- } catch (ex) {
- exception = ex;
- }
- Assert.ok(!exception, "OS.File.remove should not throw when not requested.");
-});
-
-add_task(function* test_ignoreAbsent_directory_missing() {
- let absent_file_name = OS.Path.join("absent_parent", "test.tmp");
-
- // Removing absent files should throw if "ignoreAbsent" is true.
- yield Assert.rejects(OS.File.remove(absent_file_name, {ignoreAbsent: false}),
- "OS.File.remove throws if there is no such file.");
-
- // Removing files from absent directories should not throw if "ignoreAbsent"
- // is true or not defined.
- let exception = null;
- try {
- yield OS.File.remove(absent_file_name, {ignoreAbsent: true});
- yield OS.File.remove(absent_file_name);
- } catch (ex) {
- exception = ex;
- }
- Assert.ok(!exception, "OS.File.remove should not throw when not requested.");
-});
diff --git a/toolkit/components/osfile/tests/xpcshell/test_removeDir.js b/toolkit/components/osfile/tests/xpcshell/test_removeDir.js
deleted file mode 100644
index 41ad0eb8c..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_removeDir.js
+++ /dev/null
@@ -1,177 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Task.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-do_register_cleanup(function() {
- Services.prefs.setBoolPref("toolkit.osfile.log", false);
-});
-
-function run_test() {
- Services.prefs.setBoolPref("toolkit.osfile.log", true);
-
- run_next_test();
-}
-
-add_task(function() {
- // Set up profile. We create the directory in the profile, because the profile
- // is removed after every test run.
- do_get_profile();
-
- let file = OS.Path.join(OS.Constants.Path.profileDir, "file");
- let dir = OS.Path.join(OS.Constants.Path.profileDir, "directory");
- let file1 = OS.Path.join(dir, "file1");
- let file2 = OS.Path.join(dir, "file2");
- let subDir = OS.Path.join(dir, "subdir");
- let fileInSubDir = OS.Path.join(subDir, "file");
-
- // Sanity checking for the test
- do_check_false((yield OS.File.exists(dir)));
-
- // Remove non-existent directory
- let exception = null;
- try {
- yield OS.File.removeDir(dir, {ignoreAbsent: false});
- } catch (ex) {
- exception = ex;
- }
-
- do_check_true(!!exception);
- do_check_true(exception instanceof OS.File.Error);
-
- // Remove non-existent directory with ignoreAbsent
- yield OS.File.removeDir(dir, {ignoreAbsent: true});
- yield OS.File.removeDir(dir);
-
- // Remove file with ignoreAbsent: false
- yield OS.File.writeAtomic(file, "content", { tmpPath: file + ".tmp" });
- exception = null;
- try {
- yield OS.File.removeDir(file, {ignoreAbsent: false});
- } catch (ex) {
- exception = ex;
- }
-
- do_check_true(!!exception);
- do_check_true(exception instanceof OS.File.Error);
-
- // Remove empty directory
- yield OS.File.makeDir(dir);
- yield OS.File.removeDir(dir);
- do_check_false((yield OS.File.exists(dir)));
-
- // Remove directory that contains one file
- yield OS.File.makeDir(dir);
- yield OS.File.writeAtomic(file1, "content", { tmpPath: file1 + ".tmp" });
- yield OS.File.removeDir(dir);
- do_check_false((yield OS.File.exists(dir)));
-
- // Remove directory that contains multiple files
- yield OS.File.makeDir(dir);
- yield OS.File.writeAtomic(file1, "content", { tmpPath: file1 + ".tmp" });
- yield OS.File.writeAtomic(file2, "content", { tmpPath: file2 + ".tmp" });
- yield OS.File.removeDir(dir);
- do_check_false((yield OS.File.exists(dir)));
-
- // Remove directory that contains a file and a directory
- yield OS.File.makeDir(dir);
- yield OS.File.writeAtomic(file1, "content", { tmpPath: file1 + ".tmp" });
- yield OS.File.makeDir(subDir);
- yield OS.File.writeAtomic(fileInSubDir, "content", { tmpPath: fileInSubDir + ".tmp" });
- yield OS.File.removeDir(dir);
- do_check_false((yield OS.File.exists(dir)));
-});
-
-add_task(function* test_unix_symlink() {
- // Windows does not implement OS.File.unixSymLink()
- if (OS.Constants.Win) {
- return;
- }
-
- // Android / B2G file systems typically don't support symlinks.
- if (OS.Constants.Sys.Name == "Android") {
- return;
- }
-
- let file = OS.Path.join(OS.Constants.Path.profileDir, "file");
- let dir = OS.Path.join(OS.Constants.Path.profileDir, "directory");
- let file1 = OS.Path.join(dir, "file1");
-
- // This test will create the following directory structure:
- // <profileDir>/file (regular file)
- // <profileDir>/file.link => file (symlink)
- // <profileDir>/directory (directory)
- // <profileDir>/linkdir => directory (directory)
- // <profileDir>/directory/file1 (regular file)
- // <profileDir>/directory3 (directory)
- // <profileDir>/directory3/file3 (directory)
- // <profileDir>/directory/link2 => ../directory3 (regular file)
-
- // Sanity checking for the test
- do_check_false((yield OS.File.exists(dir)));
-
- yield OS.File.writeAtomic(file, "content", { tmpPath: file + ".tmp" });
- do_check_true((yield OS.File.exists(file)));
- let info = yield OS.File.stat(file, {unixNoFollowingLinks: true});
- do_check_false(info.isDir);
- do_check_false(info.isSymLink);
-
- yield OS.File.unixSymLink(file, file + ".link");
- do_check_true((yield OS.File.exists(file + ".link")));
- info = yield OS.File.stat(file + ".link", {unixNoFollowingLinks: true});
- do_check_false(info.isDir);
- do_check_true(info.isSymLink);
- info = yield OS.File.stat(file + ".link");
- do_check_false(info.isDir);
- do_check_false(info.isSymLink);
- yield OS.File.remove(file + ".link");
- do_check_false((yield OS.File.exists(file + ".link")));
-
- yield OS.File.makeDir(dir);
- do_check_true((yield OS.File.exists(dir)));
- info = yield OS.File.stat(dir, {unixNoFollowingLinks: true});
- do_check_true(info.isDir);
- do_check_false(info.isSymLink);
-
- let link = OS.Path.join(OS.Constants.Path.profileDir, "linkdir");
-
- yield OS.File.unixSymLink(dir, link);
- do_check_true((yield OS.File.exists(link)));
- info = yield OS.File.stat(link, {unixNoFollowingLinks: true});
- do_check_false(info.isDir);
- do_check_true(info.isSymLink);
- info = yield OS.File.stat(link);
- do_check_true(info.isDir);
- do_check_false(info.isSymLink);
-
- let dir3 = OS.Path.join(OS.Constants.Path.profileDir, "directory3");
- let file3 = OS.Path.join(dir3, "file3");
- let link2 = OS.Path.join(dir, "link2");
-
- yield OS.File.writeAtomic(file1, "content", { tmpPath: file1 + ".tmp" });
- do_check_true((yield OS.File.exists(file1)));
- yield OS.File.makeDir(dir3);
- do_check_true((yield OS.File.exists(dir3)));
- yield OS.File.writeAtomic(file3, "content", { tmpPath: file3 + ".tmp" });
- do_check_true((yield OS.File.exists(file3)));
- yield OS.File.unixSymLink("../directory3", link2);
- do_check_true((yield OS.File.exists(link2)));
-
- yield OS.File.removeDir(link);
- do_check_false((yield OS.File.exists(link)));
- do_check_true((yield OS.File.exists(file1)));
- yield OS.File.removeDir(dir);
- do_check_false((yield OS.File.exists(dir)));
- do_check_true((yield OS.File.exists(file3)));
- yield OS.File.removeDir(dir3);
- do_check_false((yield OS.File.exists(dir3)));
-
- // This task will be executed only on Unix-like systems.
- // Please do not add tests independent to operating systems here
- // or implement symlink() on Windows.
-});
diff --git a/toolkit/components/osfile/tests/xpcshell/test_removeEmptyDir.js b/toolkit/components/osfile/tests/xpcshell/test_removeEmptyDir.js
deleted file mode 100644
index 95f8d5cd1..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_removeEmptyDir.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-do_register_cleanup(function() {
- Services.prefs.setBoolPref("toolkit.osfile.log", false);
-});
-
-function run_test() {
- Services.prefs.setBoolPref("toolkit.osfile.log", true);
-
- run_next_test();
-}
-
-/**
- * Test OS.File.removeEmptyDir
- */
-add_task(function() {
- // Set up profile. We create the directory in the profile, because the profile
- // is removed after every test run.
- do_get_profile();
-
- let dir = OS.Path.join(OS.Constants.Path.profileDir, "directory");
-
- // Sanity checking for the test
- do_check_false((yield OS.File.exists(dir)));
-
- // Remove non-existent directory
- yield OS.File.removeEmptyDir(dir);
-
- // Remove non-existent directory with ignoreAbsent
- yield OS.File.removeEmptyDir(dir, {ignoreAbsent: true});
-
- // Remove non-existent directory with ignoreAbsent false
- let exception = null;
- try {
- yield OS.File.removeEmptyDir(dir, {ignoreAbsent: false});
- } catch (ex) {
- exception = ex;
- }
-
- do_check_true(!!exception);
- do_check_true(exception instanceof OS.File.Error);
- do_check_true(exception.becauseNoSuchFile);
-
- // Remove empty directory
- yield OS.File.makeDir(dir);
- yield OS.File.removeEmptyDir(dir);
- do_check_false((yield OS.File.exists(dir)));
-});
diff --git a/toolkit/components/osfile/tests/xpcshell/test_reset.js b/toolkit/components/osfile/tests/xpcshell/test_reset.js
deleted file mode 100644
index f1e1b14d1..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_reset.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var Path = OS.Constants.Path;
-
-add_task(function* init() {
- do_get_profile();
-});
-
-add_task(function* reset_before_launching() {
- do_print("Reset without launching OS.File, it shouldn't break");
- yield OS.File.resetWorker();
-});
-
-add_task(function* transparent_reset() {
- for (let i = 1; i < 3; ++i) {
- do_print("Do stome stuff before and after " + i + " reset(s), " +
- "it shouldn't break");
- let CONTENT = "some content " + i;
- let path = OS.Path.join(Path.profileDir, "tmp");
- yield OS.File.writeAtomic(path, CONTENT);
- for (let j = 0; j < i; ++j) {
- yield OS.File.resetWorker();
- }
- let data = yield OS.File.read(path);
- let string = (new TextDecoder()).decode(data);
- do_check_eq(string, CONTENT);
- }
-});
-
-add_task(function* file_open_cannot_reset() {
- let TEST_FILE = OS.Path.join(Path.profileDir, "tmp-" + Math.random());
- do_print("Leaking file descriptor " + TEST_FILE + ", we shouldn't be able to reset");
- let openedFile = yield OS.File.open(TEST_FILE, { create: true} );
- let thrown = false;
- try {
- yield OS.File.resetWorker();
- } catch (ex if ex.message.indexOf(OS.Path.basename(TEST_FILE)) != -1 ) {
- thrown = true;
- }
- do_check_true(thrown);
-
- do_print("Closing the file, we should now be able to reset");
- yield openedFile.close();
- yield OS.File.resetWorker();
-});
-
-add_task(function* dir_open_cannot_reset() {
- let TEST_DIR = yield OS.File.getCurrentDirectory();
- do_print("Leaking directory " + TEST_DIR + ", we shouldn't be able to reset");
- let iterator = new OS.File.DirectoryIterator(TEST_DIR);
- let thrown = false;
- try {
- yield OS.File.resetWorker();
- } catch (ex if ex.message.indexOf(OS.Path.basename(TEST_DIR)) != -1 ) {
- thrown = true;
- }
- do_check_true(thrown);
-
- do_print("Closing the directory, we should now be able to reset");
- yield iterator.close();
- yield OS.File.resetWorker();
-});
-
-add_task(function* race_against_itself() {
- do_print("Attempt to get resetWorker() to race against itself");
- // Arbitrary operation, just to wake up the worker
- try {
- yield OS.File.read("/foo");
- } catch (ex) {
- }
-
- let all = [];
- for (let i = 0; i < 100; ++i) {
- all.push(OS.File.resetWorker());
- }
-
- yield Promise.all(all);
-});
-
-
-add_task(function* finish_with_a_reset() {
- do_print("Reset without waiting for the result");
- // Arbitrary operation, just to wake up the worker
- try {
- yield OS.File.read("/foo");
- } catch (ex) {
- }
- // Now reset
- /*don't yield*/ OS.File.resetWorker();
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_shutdown.js b/toolkit/components/osfile/tests/xpcshell/test_shutdown.js
deleted file mode 100644
index 667965d9e..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_shutdown.js
+++ /dev/null
@@ -1,98 +0,0 @@
-Components.utils.import("resource://gre/modules/Services.jsm", this);
-Components.utils.import("resource://gre/modules/Promise.jsm", this);
-Components.utils.import("resource://gre/modules/Task.jsm", this);
-Components.utils.import("resource://gre/modules/osfile.jsm", this);
-
-add_task(function init() {
- do_get_profile();
-});
-
-/**
- * Test logging of file descriptors leaks.
- */
-add_task(function system_shutdown() {
-
- // Test that unclosed files cause warnings
- // Test that unclosed directories cause warnings
- // Test that closed files do not cause warnings
- // Test that closed directories do not cause warnings
- function testLeaksOf(resource, topic) {
- return Task.spawn(function() {
- let deferred = Promise.defer();
-
- // Register observer
- Services.prefs.setBoolPref("toolkit.asyncshutdown.testing", true);
- Services.prefs.setBoolPref("toolkit.osfile.log", true);
- Services.prefs.setBoolPref("toolkit.osfile.log.redirect", true);
- Services.prefs.setCharPref("toolkit.osfile.test.shutdown.observer", topic);
-
- let observer = function(aMessage) {
- try {
- do_print("Got message: " + aMessage);
- if (!(aMessage instanceof Components.interfaces.nsIConsoleMessage)) {
- return;
- }
- let message = aMessage.message;
- do_print("Got message: " + message);
- if (message.indexOf("TEST OS Controller WARNING") < 0) {
- return;
- }
- do_print("Got message: " + message + ", looking for resource " + resource);
- if (message.indexOf(resource) < 0) {
- return;
- }
- do_print("Resource: " + resource + " found");
- do_execute_soon(deferred.resolve);
- } catch (ex) {
- do_execute_soon(function() {
- deferred.reject(ex);
- });
- }
- };
- Services.console.registerListener(observer);
- Services.obs.notifyObservers(null, topic, null);
- do_timeout(1000, function() {
- do_print("Timeout while waiting for resource: " + resource);
- deferred.reject("timeout");
- });
-
- let resolved = false;
- try {
- yield deferred.promise;
- resolved = true;
- } catch (ex if ex == "timeout") {
- resolved = false;
- }
- Services.console.unregisterListener(observer);
- Services.prefs.clearUserPref("toolkit.osfile.log");
- Services.prefs.clearUserPref("toolkit.osfile.log.redirect");
- Services.prefs.clearUserPref("toolkit.osfile.test.shutdown.observer");
- Services.prefs.clearUserPref("toolkit.async_shutdown.testing", true);
-
- throw new Task.Result(resolved);
- });
- }
-
- let TEST_DIR = OS.Path.join((yield OS.File.getCurrentDirectory()), "..");
- do_print("Testing for leaks of directory iterator " + TEST_DIR);
- let iterator = new OS.File.DirectoryIterator(TEST_DIR);
- do_print("At this stage, we leak the directory");
- do_check_true((yield testLeaksOf(TEST_DIR, "test.shutdown.dir.leak")));
- yield iterator.close();
- do_print("At this stage, we don't leak the directory anymore");
- do_check_false((yield testLeaksOf(TEST_DIR, "test.shutdown.dir.noleak")));
-
- let TEST_FILE = OS.Path.join(OS.Constants.Path.profileDir, "test");
- do_print("Testing for leaks of file descriptor: " + TEST_FILE);
- let openedFile = yield OS.File.open(TEST_FILE, { create: true} );
- do_print("At this stage, we leak the file");
- do_check_true((yield testLeaksOf(TEST_FILE, "test.shutdown.file.leak")));
- yield openedFile.close();
- do_print("At this stage, we don't leak the file anymore");
- do_check_false((yield testLeaksOf(TEST_FILE, "test.shutdown.file.leak.2")));
-});
-
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_telemetry.js b/toolkit/components/osfile/tests/xpcshell/test_telemetry.js
deleted file mode 100644
index dc5104443..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_telemetry.js
+++ /dev/null
@@ -1,63 +0,0 @@
-"use strict";
-
-var {OS: {File, Path, Constants}} = Components.utils.import("resource://gre/modules/osfile.jsm", {});
-var {Services} = Components.utils.import("resource://gre/modules/Services.jsm", {});
-
-// Ensure that we have a profile but that the OS.File worker is not launched
-add_task(function* init() {
- do_get_profile();
- yield File.resetWorker();
-});
-
-function getCount(histogram) {
- if (histogram == null) {
- return 0;
- }
-
- let total = 0;
- for (let i of histogram.counts) {
- total += i;
- }
- return total;
-}
-
-// Ensure that launching the OS.File worker adds data to the relevant
-// histograms
-add_task(function* test_startup() {
- let LAUNCH = "OSFILE_WORKER_LAUNCH_MS";
- let READY = "OSFILE_WORKER_READY_MS";
-
- let before = Services.telemetry.histogramSnapshots;
-
- // Launch the OS.File worker
- yield File.getCurrentDirectory();
-
- let after = Services.telemetry.histogramSnapshots;
-
-
- do_print("Ensuring that we have recorded measures for histograms");
- do_check_eq(getCount(after[LAUNCH]), getCount(before[LAUNCH]) + 1);
- do_check_eq(getCount(after[READY]), getCount(before[READY]) + 1);
-
- do_print("Ensuring that launh <= ready");
- do_check_true(after[LAUNCH].sum <= after[READY].sum);
-});
-
-// Ensure that calling writeAtomic adds data to the relevant histograms
-add_task(function* test_writeAtomic() {
- let LABEL = "OSFILE_WRITEATOMIC_JANK_MS";
-
- let before = Services.telemetry.histogramSnapshots;
-
- // Perform a write.
- let path = Path.join(Constants.Path.profileDir, "test_osfile_telemetry.tmp");
- yield File.writeAtomic(path, LABEL, { tmpPath: path + ".tmp" } );
-
- let after = Services.telemetry.histogramSnapshots;
-
- do_check_eq(getCount(after[LABEL]), getCount(before[LABEL]) + 1);
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/osfile/tests/xpcshell/test_unique.js b/toolkit/components/osfile/tests/xpcshell/test_unique.js
deleted file mode 100644
index 8aa81b803..000000000
--- a/toolkit/components/osfile/tests/xpcshell/test_unique.js
+++ /dev/null
@@ -1,88 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/osfile.jsm");
-Components.utils.import("resource://gre/modules/Task.jsm");
-
-function run_test() {
- do_get_profile();
- run_next_test();
-}
-
-function testFiles(filename) {
- return Task.spawn(function() {
- const MAX_TRIES = 10;
- let profileDir = OS.Constants.Path.profileDir;
- let path = OS.Path.join(profileDir, filename);
-
- // Ensure that openUnique() uses the file name if there is no file with that name already.
- let openedFile = yield OS.File.openUnique(path);
- do_print("\nCreate new file: " + openedFile.path);
- yield openedFile.file.close();
- let exists = yield OS.File.exists(openedFile.path);
- do_check_true(exists);
- do_check_eq(path, openedFile.path);
- let fileInfo = yield OS.File.stat(openedFile.path);
- do_check_true(fileInfo.size == 0);
-
- // Ensure that openUnique() creates a new file name using a HEX number, as the original name is already taken.
- openedFile = yield OS.File.openUnique(path);
- do_print("\nCreate unique HEX file: " + openedFile.path);
- yield openedFile.file.close();
- exists = yield OS.File.exists(openedFile.path);
- do_check_true(exists);
- fileInfo = yield OS.File.stat(openedFile.path);
- do_check_true(fileInfo.size == 0);
-
- // Ensure that openUnique() generates different file names each time, using the HEX number algorithm
- let filenames = new Set();
- for (let i=0; i < MAX_TRIES; i++) {
- openedFile = yield OS.File.openUnique(path);
- yield openedFile.file.close();
- filenames.add(openedFile.path);
- }
-
- do_check_eq(filenames.size, MAX_TRIES);
-
- // Ensure that openUnique() creates a new human readable file name using, as the original name is already taken.
- openedFile = yield OS.File.openUnique(path, {humanReadable : true});
- do_print("\nCreate unique Human Readable file: " + openedFile.path);
- yield openedFile.file.close();
- exists = yield OS.File.exists(openedFile.path);
- do_check_true(exists);
- fileInfo = yield OS.File.stat(openedFile.path);
- do_check_true(fileInfo.size == 0);
-
- // Ensure that openUnique() generates different human readable file names each time
- filenames = new Set();
- for (let i=0; i < MAX_TRIES; i++) {
- openedFile = yield OS.File.openUnique(path, {humanReadable : true});
- yield openedFile.file.close();
- filenames.add(openedFile.path);
- }
-
- do_check_eq(filenames.size, MAX_TRIES);
-
- let exn;
- try {
- for (let i=0; i < 100; i++) {
- openedFile = yield OS.File.openUnique(path, {humanReadable : true});
- yield openedFile.file.close();
- }
- } catch (ex) {
- exn = ex;
- }
-
- do_print("Ensure that this raises the correct error");
- do_check_true(!!exn);
- do_check_true(exn instanceof OS.File.Error);
- do_check_true(exn.becauseExists);
- });
-}
-
-add_task(function test_unique() {
- OS.Shared.DEBUG = true;
- // Tests files with extension
- yield testFiles("dummy_unique_file.txt");
- // Tests files with no extension
- yield testFiles("dummy_unique_file_no_ext");
-});
diff --git a/toolkit/components/osfile/tests/xpcshell/xpcshell.ini b/toolkit/components/osfile/tests/xpcshell/xpcshell.ini
deleted file mode 100644
index 58b106d3d..000000000
--- a/toolkit/components/osfile/tests/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,51 +0,0 @@
-[DEFAULT]
-head = head.js
-tail =
-
-support-files =
- test_loader/module_test_loader.js
-
-[test_available_free_space.js]
-[test_compression.js]
-[test_constants.js]
-[test_creationDate.js]
-[test_duration.js]
-[test_exception.js]
-[test_file_URL_conversion.js]
-[test_loader.js]
-[test_logging.js]
-[test_makeDir.js]
-[test_open.js]
-[test_osfile_async.js]
-[test_osfile_async_append.js]
-[test_osfile_async_bytes.js]
-[test_osfile_async_copy.js]
-[test_osfile_async_flush.js]
-[test_osfile_async_largefiles.js]
-[test_osfile_async_setDates.js]
-# Unimplemented on Windows (bug 1022816).
-# Spurious failure on Android test farm due to non-POSIX behavior of
-# filesystem backing /mnt/sdcard (not worth trying to fix).
-[test_osfile_async_setPermissions.js]
-skip-if = os == "win" || os == "android"
-[test_osfile_closed.js]
-[test_osfile_error.js]
-[test_osfile_kill.js]
-# Windows test
-[test_osfile_win_async_setPermissions.js]
-skip-if = os != "win"
-[test_osfile_writeAtomic_backupTo_option.js]
-[test_osfile_writeAtomic_zerobytes.js]
-[test_path.js]
-[test_path_constants.js]
-[test_queue.js]
-[test_read_write.js]
-requesttimeoutfactor = 4
-[test_remove.js]
-[test_removeDir.js]
-requesttimeoutfactor = 4
-[test_removeEmptyDir.js]
-[test_reset.js]
-[test_shutdown.js]
-[test_telemetry.js]
-[test_unique.js]
diff --git a/toolkit/components/parentalcontrols/moz.build b/toolkit/components/parentalcontrols/moz.build
index 083312fef..17db8aaee 100644
--- a/toolkit/components/parentalcontrols/moz.build
+++ b/toolkit/components/parentalcontrols/moz.build
@@ -4,28 +4,16 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPIDL_SOURCES += [
- 'nsIParentalControlsService.idl',
-]
+XPIDL_SOURCES += ['nsIParentalControlsService.idl']
XPIDL_MODULE = 'parentalcontrols'
if not CONFIG['MOZ_DISABLE_PARENTAL_CONTROLS']:
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
- SOURCES += [
- 'nsParentalControlsServiceWin.cpp',
- ]
+ SOURCES += ['nsParentalControlsServiceWin.cpp']
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
- UNIFIED_SOURCES += [
- 'nsParentalControlsServiceCocoa.mm',
- ]
- elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- UNIFIED_SOURCES += [
- 'nsParentalControlsServiceAndroid.cpp',
- ]
+ UNIFIED_SOURCES += ['nsParentalControlsServiceCocoa.mm']
else:
- SOURCES += [
- 'nsParentalControlsServiceDefault.cpp',
- ]
+ SOURCES += ['nsParentalControlsServiceDefault.cpp']
FINAL_LIBRARY = 'xul'
diff --git a/toolkit/components/parentalcontrols/nsParentalControlsServiceAndroid.cpp b/toolkit/components/parentalcontrols/nsParentalControlsServiceAndroid.cpp
deleted file mode 100644
index 364749000..000000000
--- a/toolkit/components/parentalcontrols/nsParentalControlsServiceAndroid.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode:nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsParentalControlsService.h"
-#include "nsString.h"
-#include "nsIFile.h"
-#include "FennecJNIWrappers.h"
-
-namespace java = mozilla::java;
-
-NS_IMPL_ISUPPORTS(nsParentalControlsService, nsIParentalControlsService)
-
-nsParentalControlsService::nsParentalControlsService() :
- mEnabled(false)
-{
- if (mozilla::jni::IsFennec()) {
- mEnabled = java::Restrictions::IsUserRestricted();
- }
-}
-
-nsParentalControlsService::~nsParentalControlsService()
-{
-}
-
-NS_IMETHODIMP
-nsParentalControlsService::GetParentalControlsEnabled(bool *aResult)
-{
- *aResult = mEnabled;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsParentalControlsService::GetBlockFileDownloadsEnabled(bool *aResult)
-{
- // NOTE: isAllowed returns the opposite intention, so we need to flip it
- bool res;
- IsAllowed(nsIParentalControlsService::DOWNLOAD, NULL, &res);
- *aResult = !res;
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsParentalControlsService::GetLoggingEnabled(bool *aResult)
-{
- // Android doesn't currently have any method of logging restricted actions.
- *aResult = false;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsParentalControlsService::Log(int16_t aEntryType,
- bool aBlocked,
- nsIURI *aSource,
- nsIFile *aTarget)
-{
- return NS_ERROR_NOT_AVAILABLE;
-}
-
-NS_IMETHODIMP
-nsParentalControlsService::RequestURIOverride(nsIURI *aTarget,
- nsIInterfaceRequestor *aWindowContext,
- bool *_retval)
-{
- return NS_ERROR_NOT_AVAILABLE;
-}
-
-NS_IMETHODIMP
-nsParentalControlsService::RequestURIOverrides(nsIArray *aTargets,
- nsIInterfaceRequestor *aWindowContext,
- bool *_retval)
-{
- return NS_ERROR_NOT_AVAILABLE;
-}
-
-NS_IMETHODIMP
-nsParentalControlsService::IsAllowed(int16_t aAction,
- nsIURI *aUri,
- bool *_retval)
-{
- nsresult rv = NS_OK;
- *_retval = true;
-
- if (!mEnabled) {
- return rv;
- }
-
- if (mozilla::jni::IsFennec()) {
- nsAutoCString url;
- if (aUri) {
- rv = aUri->GetSpec(url);
- NS_ENSURE_SUCCESS(rv, rv);
- }
-
- *_retval = java::Restrictions::IsAllowed(aAction,
- NS_ConvertUTF8toUTF16(url));
- return rv;
- }
-
- return NS_ERROR_NOT_AVAILABLE;
-}
diff --git a/toolkit/components/passwordmgr/OSCrypto.jsm b/toolkit/components/passwordmgr/OSCrypto.jsm
index 04254f66f..3d2b27c4e 100644
--- a/toolkit/components/passwordmgr/OSCrypto.jsm
+++ b/toolkit/components/passwordmgr/OSCrypto.jsm
@@ -8,15 +8,14 @@
"use strict";
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
this.EXPORTED_SYMBOLS = ["OSCrypto"];
var OSCrypto = {};
-if (AppConstants.platform == "win") {
- Services.scriptloader.loadSubScript("resource://gre/modules/OSCrypto_win.js", this);
-} else {
- throw new Error("OSCrypto.jsm isn't supported on this platform");
-}
+#ifdef XP_WIN
+Services.scriptloader.loadSubScript("resource://gre/modules/OSCrypto_win.js", this);
+#else
+throw new Error("OSCrypto.jsm isn't supported on this platform");
+#endif
diff --git a/toolkit/components/passwordmgr/content/passwordManager.js b/toolkit/components/passwordmgr/content/passwordManager.js
index 327ebbdf8..662f21279 100644
--- a/toolkit/components/passwordmgr/content/passwordManager.js
+++ b/toolkit/components/passwordmgr/content/passwordManager.js
@@ -5,7 +5,6 @@
/** * =================== SAVED SIGNONS CODE =================== ***/
const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
@@ -486,9 +485,13 @@ function HandleSignonKeyPress(e) {
if (signonsTree.getAttribute("editing")) {
return;
}
+
+#ifdef XP_MACOSX
if (e.keyCode == KeyboardEvent.DOM_VK_DELETE ||
- (AppConstants.platform == "macosx" &&
- e.keyCode == KeyboardEvent.DOM_VK_BACK_SPACE)) {
+ e.keyCode == KeyboardEvent.DOM_VK_BACK_SPACE) {
+#else
+ if (e.keyCode == KeyboardEvent.DOM_VK_DELETE) {
+#endif
DeleteSignon();
}
}
diff --git a/toolkit/components/passwordmgr/moz.build b/toolkit/components/passwordmgr/moz.build
index e54e6ba2d..79777a981 100644
--- a/toolkit/components/passwordmgr/moz.build
+++ b/toolkit/components/passwordmgr/moz.build
@@ -7,17 +7,6 @@
if CONFIG['MOZ_PHOENIX']:
DEFINES['MOZ_BUILD_APP_IS_BROWSER'] = True
-MOCHITEST_MANIFESTS += ['test/mochitest.ini', 'test/mochitest/mochitest.ini']
-MOCHITEST_CHROME_MANIFESTS += ['test/chrome/chrome.ini']
-BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
-XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
-
-TESTING_JS_MODULES += [
- # Make this file available from the "resource:" URI of the test environment.
- 'test/browser/form_basic.html',
- 'test/LoginTestUtils.jsm',
-]
-
XPIDL_SOURCES += [
'nsILoginInfo.idl',
'nsILoginManager.idl',
@@ -34,10 +23,7 @@ EXTRA_COMPONENTS += [
'nsLoginInfo.js',
'nsLoginManager.js',
'nsLoginManagerPrompter.js',
-]
-
-EXTRA_PP_COMPONENTS += [
- 'passwordmgr.manifest',
+ 'passwordmgr.manifest'
]
EXTRA_JS_MODULES += [
@@ -46,21 +32,18 @@ EXTRA_JS_MODULES += [
'LoginManagerContent.jsm',
'LoginManagerParent.jsm',
'LoginRecipes.jsm',
- 'OSCrypto.jsm',
]
-if CONFIG['OS_TARGET'] == 'Android':
- EXTRA_COMPONENTS += [
- 'storage-mozStorage.js',
- ]
-else:
- EXTRA_COMPONENTS += [
- 'storage-json.js',
- ]
- EXTRA_JS_MODULES += [
- 'LoginImport.jsm',
- 'LoginStore.jsm',
- ]
+EXTRA_PP_JS_MODULES += ['OSCrypto.jsm']
+
+EXTRA_COMPONENTS += [
+ 'storage-json.js',
+]
+
+EXTRA_JS_MODULES += [
+ 'LoginImport.jsm',
+ 'LoginStore.jsm',
+]
if CONFIG['OS_TARGET'] == 'WINNT':
EXTRA_JS_MODULES += [
@@ -73,6 +56,3 @@ if CONFIG['MOZ_PHOENIX']:
]
JAR_MANIFESTS += ['jar.mn']
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Password Manager')
diff --git a/toolkit/components/passwordmgr/nsLoginManager.js b/toolkit/components/passwordmgr/nsLoginManager.js
index 514351fa5..84b0319cb 100644
--- a/toolkit/components/passwordmgr/nsLoginManager.js
+++ b/toolkit/components/passwordmgr/nsLoginManager.js
@@ -8,7 +8,6 @@ const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
const PERMISSION_SAVE_LOGINS = "login-saving";
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Timer.jsm");
@@ -113,12 +112,8 @@ LoginManager.prototype = {
_initStorage() {
- let contractID;
- if (AppConstants.platform == "android") {
- contractID = "@mozilla.org/login-manager/storage/mozStorage;1";
- } else {
- contractID = "@mozilla.org/login-manager/storage/json;1";
- }
+ let contractID = "@mozilla.org/login-manager/storage/json;1";
+
try {
let catMan = Cc["@mozilla.org/categorymanager;1"].
getService(Ci.nsICategoryManager);
diff --git a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
index c4be39e31..5fb1ee83e 100644
--- a/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
+++ b/toolkit/components/passwordmgr/nsLoginManagerPrompter.js
@@ -19,8 +19,7 @@ const LoginInfo =
const BRAND_BUNDLE = "chrome://branding/locale/brand.properties";
/**
- * Constants for password prompt telemetry.
- * Mirrored in mobile/android/components/LoginManagerPrompter.js */
+ * Constants for password prompt telemetry. */
const PROMPT_DISPLAYED = 0;
const PROMPT_ADD_OR_UPDATE = 1;
diff --git a/toolkit/components/passwordmgr/passwordmgr.manifest b/toolkit/components/passwordmgr/passwordmgr.manifest
index 72e9ccffb..c2c37ebff 100644
--- a/toolkit/components/passwordmgr/passwordmgr.manifest
+++ b/toolkit/components/passwordmgr/passwordmgr.manifest
@@ -6,12 +6,7 @@ component {8aa66d77-1bbb-45a6-991e-b8f47751c291} nsLoginManagerPrompter.js
contract @mozilla.org/login-manager/prompter;1 {8aa66d77-1bbb-45a6-991e-b8f47751c291}
component {0f2f347c-1e4f-40cc-8efd-792dea70a85e} nsLoginInfo.js
contract @mozilla.org/login-manager/loginInfo;1 {0f2f347c-1e4f-40cc-8efd-792dea70a85e}
-#ifdef ANDROID
-component {8c2023b9-175c-477e-9761-44ae7b549756} storage-mozStorage.js
-contract @mozilla.org/login-manager/storage/mozStorage;1 {8c2023b9-175c-477e-9761-44ae7b549756}
-#else
component {c00c432d-a0c9-46d7-bef6-9c45b4d07341} storage-json.js
contract @mozilla.org/login-manager/storage/json;1 {c00c432d-a0c9-46d7-bef6-9c45b4d07341}
-#endif
component {dc6c2976-0f73-4f1f-b9ff-3d72b4e28309} crypto-SDR.js
contract @mozilla.org/login-manager/crypto/SDR;1 {dc6c2976-0f73-4f1f-b9ff-3d72b4e28309} \ No newline at end of file
diff --git a/toolkit/components/passwordmgr/storage-mozStorage.js b/toolkit/components/passwordmgr/storage-mozStorage.js
deleted file mode 100644
index 9da244f7a..000000000
--- a/toolkit/components/passwordmgr/storage-mozStorage.js
+++ /dev/null
@@ -1,1262 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-const DB_VERSION = 6; // The database schema version
-const PERMISSION_SAVE_LOGINS = "login-saving";
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/Promise.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
- "resource://gre/modules/LoginHelper.jsm");
-
-/**
- * Object that manages a database transaction properly so consumers don't have
- * to worry about it throwing.
- *
- * @param aDatabase
- * The mozIStorageConnection to start a transaction on.
- */
-function Transaction(aDatabase) {
- this._db = aDatabase;
-
- this._hasTransaction = false;
- try {
- this._db.beginTransaction();
- this._hasTransaction = true;
- } catch (e) { /* om nom nom exceptions */ }
-}
-
-Transaction.prototype = {
- commit : function() {
- if (this._hasTransaction)
- this._db.commitTransaction();
- },
-
- rollback : function() {
- if (this._hasTransaction)
- this._db.rollbackTransaction();
- },
-};
-
-
-function LoginManagerStorage_mozStorage() { }
-
-LoginManagerStorage_mozStorage.prototype = {
-
- classID : Components.ID("{8c2023b9-175c-477e-9761-44ae7b549756}"),
- QueryInterface : XPCOMUtils.generateQI([Ci.nsILoginManagerStorage,
- Ci.nsIInterfaceRequestor]),
- getInterface : function(aIID) {
- if (aIID.equals(Ci.nsIVariant)) {
- // Allows unwrapping the JavaScript object for regression tests.
- return this;
- }
-
- if (aIID.equals(Ci.mozIStorageConnection)) {
- return this._dbConnection;
- }
-
- throw new Components.Exception("Interface not available", Cr.NS_ERROR_NO_INTERFACE);
- },
-
- __crypto : null, // nsILoginManagerCrypto service
- get _crypto() {
- if (!this.__crypto)
- this.__crypto = Cc["@mozilla.org/login-manager/crypto/SDR;1"].
- getService(Ci.nsILoginManagerCrypto);
- return this.__crypto;
- },
-
- __profileDir: null, // nsIFile for the user's profile dir
- get _profileDir() {
- if (!this.__profileDir)
- this.__profileDir = Services.dirsvc.get("ProfD", Ci.nsIFile);
- return this.__profileDir;
- },
-
- __storageService: null, // Storage service for using mozStorage
- get _storageService() {
- if (!this.__storageService)
- this.__storageService = Cc["@mozilla.org/storage/service;1"].
- getService(Ci.mozIStorageService);
- return this.__storageService;
- },
-
- __uuidService: null,
- get _uuidService() {
- if (!this.__uuidService)
- this.__uuidService = Cc["@mozilla.org/uuid-generator;1"].
- getService(Ci.nsIUUIDGenerator);
- return this.__uuidService;
- },
-
-
- // The current database schema.
- _dbSchema: {
- tables: {
- moz_logins: "id INTEGER PRIMARY KEY," +
- "hostname TEXT NOT NULL," +
- "httpRealm TEXT," +
- "formSubmitURL TEXT," +
- "usernameField TEXT NOT NULL," +
- "passwordField TEXT NOT NULL," +
- "encryptedUsername TEXT NOT NULL," +
- "encryptedPassword TEXT NOT NULL," +
- "guid TEXT," +
- "encType INTEGER," +
- "timeCreated INTEGER," +
- "timeLastUsed INTEGER," +
- "timePasswordChanged INTEGER," +
- "timesUsed INTEGER",
- // Changes must be reflected in this._dbAreExpectedColumnsPresent(),
- // this._searchLogins(), and this.modifyLogin().
-
- moz_disabledHosts: "id INTEGER PRIMARY KEY," +
- "hostname TEXT UNIQUE ON CONFLICT REPLACE",
-
- moz_deleted_logins: "id INTEGER PRIMARY KEY," +
- "guid TEXT," +
- "timeDeleted INTEGER",
- },
- indices: {
- moz_logins_hostname_index: {
- table: "moz_logins",
- columns: ["hostname"]
- },
- moz_logins_hostname_formSubmitURL_index: {
- table: "moz_logins",
- columns: ["hostname", "formSubmitURL"]
- },
- moz_logins_hostname_httpRealm_index: {
- table: "moz_logins",
- columns: ["hostname", "httpRealm"]
- },
- moz_logins_guid_index: {
- table: "moz_logins",
- columns: ["guid"]
- },
- moz_logins_encType_index: {
- table: "moz_logins",
- columns: ["encType"]
- }
- }
- },
- _dbConnection : null, // The database connection
- _dbStmts : null, // Database statements for memoization
-
- _signonsFile : null, // nsIFile for "signons.sqlite"
-
-
- /*
- * Internal method used by regression tests only. It overrides the default
- * database location.
- */
- initWithFile : function(aDBFile) {
- if (aDBFile)
- this._signonsFile = aDBFile;
-
- this.initialize();
- },
-
-
- initialize : function () {
- this._dbStmts = {};
-
- let isFirstRun;
- try {
- // Force initialization of the crypto module.
- // See bug 717490 comment 17.
- this._crypto;
-
- // If initWithFile is calling us, _signonsFile may already be set.
- if (!this._signonsFile) {
- // Initialize signons.sqlite
- this._signonsFile = this._profileDir.clone();
- this._signonsFile.append("signons.sqlite");
- }
- this.log("Opening database at " + this._signonsFile.path);
-
- // Initialize the database (create, migrate as necessary)
- isFirstRun = this._dbInit();
-
- this._initialized = true;
-
- return Promise.resolve();
- } catch (e) {
- this.log("Initialization failed: " + e);
- // If the import fails on first run, we want to delete the db
- if (isFirstRun && e == "Import failed")
- this._dbCleanup(false);
- throw new Error("Initialization failed");
- }
- },
-
-
- /**
- * Internal method used by regression tests only. It is called before
- * replacing this storage module with a new instance.
- */
- terminate : function () {
- return Promise.resolve();
- },
-
-
- addLogin : function (login) {
- // Throws if there are bogus values.
- LoginHelper.checkLoginValues(login);
-
- let [encUsername, encPassword, encType] = this._encryptLogin(login);
-
- // Clone the login, so we don't modify the caller's object.
- let loginClone = login.clone();
-
- // Initialize the nsILoginMetaInfo fields, unless the caller gave us values
- loginClone.QueryInterface(Ci.nsILoginMetaInfo);
- if (loginClone.guid) {
- if (!this._isGuidUnique(loginClone.guid))
- throw new Error("specified GUID already exists");
- } else {
- loginClone.guid = this._uuidService.generateUUID().toString();
- }
-
- // Set timestamps
- let currentTime = Date.now();
- if (!loginClone.timeCreated)
- loginClone.timeCreated = currentTime;
- if (!loginClone.timeLastUsed)
- loginClone.timeLastUsed = currentTime;
- if (!loginClone.timePasswordChanged)
- loginClone.timePasswordChanged = currentTime;
- if (!loginClone.timesUsed)
- loginClone.timesUsed = 1;
-
- let query =
- "INSERT INTO moz_logins " +
- "(hostname, httpRealm, formSubmitURL, usernameField, " +
- "passwordField, encryptedUsername, encryptedPassword, " +
- "guid, encType, timeCreated, timeLastUsed, timePasswordChanged, " +
- "timesUsed) " +
- "VALUES (:hostname, :httpRealm, :formSubmitURL, :usernameField, " +
- ":passwordField, :encryptedUsername, :encryptedPassword, " +
- ":guid, :encType, :timeCreated, :timeLastUsed, " +
- ":timePasswordChanged, :timesUsed)";
-
- let params = {
- hostname: loginClone.hostname,
- httpRealm: loginClone.httpRealm,
- formSubmitURL: loginClone.formSubmitURL,
- usernameField: loginClone.usernameField,
- passwordField: loginClone.passwordField,
- encryptedUsername: encUsername,
- encryptedPassword: encPassword,
- guid: loginClone.guid,
- encType: encType,
- timeCreated: loginClone.timeCreated,
- timeLastUsed: loginClone.timeLastUsed,
- timePasswordChanged: loginClone.timePasswordChanged,
- timesUsed: loginClone.timesUsed
- };
-
- let stmt;
- try {
- stmt = this._dbCreateStatement(query, params);
- stmt.execute();
- } catch (e) {
- this.log("addLogin failed: " + e.name + " : " + e.message);
- throw new Error("Couldn't write to database, login not added.");
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
-
- // Send a notification that a login was added.
- LoginHelper.notifyStorageChanged("addLogin", loginClone);
- return loginClone;
- },
-
-
- removeLogin : function (login) {
- let [idToDelete, storedLogin] = this._getIdForLogin(login);
- if (!idToDelete)
- throw new Error("No matching logins");
-
- // Execute the statement & remove from DB
- let query = "DELETE FROM moz_logins WHERE id = :id";
- let params = { id: idToDelete };
- let stmt;
- let transaction = new Transaction(this._dbConnection);
- try {
- stmt = this._dbCreateStatement(query, params);
- stmt.execute();
- this.storeDeletedLogin(storedLogin);
- transaction.commit();
- } catch (e) {
- this.log("_removeLogin failed: " + e.name + " : " + e.message);
- transaction.rollback();
- throw new Error("Couldn't write to database, login not removed.");
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
- LoginHelper.notifyStorageChanged("removeLogin", storedLogin);
- },
-
- modifyLogin : function (oldLogin, newLoginData) {
- let [idToModify, oldStoredLogin] = this._getIdForLogin(oldLogin);
- if (!idToModify)
- throw new Error("No matching logins");
-
- let newLogin = LoginHelper.buildModifiedLogin(oldStoredLogin, newLoginData);
-
- // Check if the new GUID is duplicate.
- if (newLogin.guid != oldStoredLogin.guid &&
- !this._isGuidUnique(newLogin.guid)) {
- throw new Error("specified GUID already exists");
- }
-
- // Look for an existing entry in case key properties changed.
- if (!newLogin.matches(oldLogin, true)) {
- let logins = this.findLogins({}, newLogin.hostname,
- newLogin.formSubmitURL,
- newLogin.httpRealm);
-
- if (logins.some(login => newLogin.matches(login, true)))
- throw new Error("This login already exists.");
- }
-
- // Get the encrypted value of the username and password.
- let [encUsername, encPassword, encType] = this._encryptLogin(newLogin);
-
- let query =
- "UPDATE moz_logins " +
- "SET hostname = :hostname, " +
- "httpRealm = :httpRealm, " +
- "formSubmitURL = :formSubmitURL, " +
- "usernameField = :usernameField, " +
- "passwordField = :passwordField, " +
- "encryptedUsername = :encryptedUsername, " +
- "encryptedPassword = :encryptedPassword, " +
- "guid = :guid, " +
- "encType = :encType, " +
- "timeCreated = :timeCreated, " +
- "timeLastUsed = :timeLastUsed, " +
- "timePasswordChanged = :timePasswordChanged, " +
- "timesUsed = :timesUsed " +
- "WHERE id = :id";
-
- let params = {
- id: idToModify,
- hostname: newLogin.hostname,
- httpRealm: newLogin.httpRealm,
- formSubmitURL: newLogin.formSubmitURL,
- usernameField: newLogin.usernameField,
- passwordField: newLogin.passwordField,
- encryptedUsername: encUsername,
- encryptedPassword: encPassword,
- guid: newLogin.guid,
- encType: encType,
- timeCreated: newLogin.timeCreated,
- timeLastUsed: newLogin.timeLastUsed,
- timePasswordChanged: newLogin.timePasswordChanged,
- timesUsed: newLogin.timesUsed
- };
-
- let stmt;
- try {
- stmt = this._dbCreateStatement(query, params);
- stmt.execute();
- } catch (e) {
- this.log("modifyLogin failed: " + e.name + " : " + e.message);
- throw new Error("Couldn't write to database, login not modified.");
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
-
- LoginHelper.notifyStorageChanged("modifyLogin", [oldStoredLogin, newLogin]);
- },
-
-
- /**
- * Returns an array of nsILoginInfo.
- */
- getAllLogins : function (count) {
- let [logins, ids] = this._searchLogins({});
-
- // decrypt entries for caller.
- logins = this._decryptLogins(logins);
-
- this.log("_getAllLogins: returning " + logins.length + " logins.");
- if (count)
- count.value = logins.length; // needed for XPCOM
- return logins;
- },
-
-
- /**
- * Public wrapper around _searchLogins to convert the nsIPropertyBag to a
- * JavaScript object and decrypt the results.
- *
- * @return {nsILoginInfo[]} which are decrypted.
- */
- searchLogins : function(count, matchData) {
- let realMatchData = {};
- let options = {};
- // Convert nsIPropertyBag to normal JS object
- let propEnum = matchData.enumerator;
- while (propEnum.hasMoreElements()) {
- let prop = propEnum.getNext().QueryInterface(Ci.nsIProperty);
- switch (prop.name) {
- // Some property names aren't field names but are special options to affect the search.
- case "schemeUpgrades": {
- options[prop.name] = prop.value;
- break;
- }
- default: {
- realMatchData[prop.name] = prop.value;
- break;
- }
- }
- }
-
- let [logins, ids] = this._searchLogins(realMatchData, options);
-
- // Decrypt entries found for the caller.
- logins = this._decryptLogins(logins);
-
- count.value = logins.length; // needed for XPCOM
- return logins;
- },
-
-
- /**
- * Private method to perform arbitrary searches on any field. Decryption is
- * left to the caller.
- *
- * Returns [logins, ids] for logins that match the arguments, where logins
- * is an array of encrypted nsLoginInfo and ids is an array of associated
- * ids in the database.
- */
- _searchLogins : function (matchData, aOptions = {
- schemeUpgrades: false,
- }) {
- let conditions = [], params = {};
-
- for (let field in matchData) {
- let value = matchData[field];
- let condition = "";
- switch (field) {
- case "formSubmitURL":
- if (value != null) {
- // Historical compatibility requires this special case
- condition = "formSubmitURL = '' OR ";
- }
- // Fall through
- case "hostname":
- if (value != null) {
- condition += `${field} = :${field}`;
- params[field] = value;
- let valueURI;
- try {
- if (aOptions.schemeUpgrades && (valueURI = Services.io.newURI(value, null, null)) &&
- valueURI.scheme == "https") {
- condition += ` OR ${field} = :http${field}`;
- params["http" + field] = "http://" + valueURI.hostPort;
- }
- } catch (ex) {
- // newURI will throw for some values
- // but those URLs wouldn't support upgrades anyways.
- }
- break;
- }
- // Fall through
- // Normal cases.
- case "httpRealm":
- case "id":
- case "usernameField":
- case "passwordField":
- case "encryptedUsername":
- case "encryptedPassword":
- case "guid":
- case "encType":
- case "timeCreated":
- case "timeLastUsed":
- case "timePasswordChanged":
- case "timesUsed":
- if (value == null) {
- condition = field + " isnull";
- } else {
- condition = field + " = :" + field;
- params[field] = value;
- }
- break;
- // Fail if caller requests an unknown property.
- default:
- throw new Error("Unexpected field: " + field);
- }
- if (condition) {
- conditions.push(condition);
- }
- }
-
- // Build query
- let query = "SELECT * FROM moz_logins";
- if (conditions.length) {
- conditions = conditions.map(c => "(" + c + ")");
- query += " WHERE " + conditions.join(" AND ");
- }
-
- let stmt;
- let logins = [], ids = [];
- try {
- stmt = this._dbCreateStatement(query, params);
- // We can't execute as usual here, since we're iterating over rows
- while (stmt.executeStep()) {
- // Create the new nsLoginInfo object, push to array
- let login = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login.init(stmt.row.hostname, stmt.row.formSubmitURL,
- stmt.row.httpRealm, stmt.row.encryptedUsername,
- stmt.row.encryptedPassword, stmt.row.usernameField,
- stmt.row.passwordField);
- // set nsILoginMetaInfo values
- login.QueryInterface(Ci.nsILoginMetaInfo);
- login.guid = stmt.row.guid;
- login.timeCreated = stmt.row.timeCreated;
- login.timeLastUsed = stmt.row.timeLastUsed;
- login.timePasswordChanged = stmt.row.timePasswordChanged;
- login.timesUsed = stmt.row.timesUsed;
- logins.push(login);
- ids.push(stmt.row.id);
- }
- } catch (e) {
- this.log("_searchLogins failed: " + e.name + " : " + e.message);
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
-
- this.log("_searchLogins: returning " + logins.length + " logins");
- return [logins, ids];
- },
-
- /**
- * Moves a login to the deleted logins table
- */
- storeDeletedLogin : function(aLogin) {
- let stmt = null;
- try {
- this.log("Storing " + aLogin.guid + " in deleted passwords\n");
- let query = "INSERT INTO moz_deleted_logins (guid, timeDeleted) VALUES (:guid, :timeDeleted)";
- let params = { guid: aLogin.guid,
- timeDeleted: Date.now() };
- let stmt = this._dbCreateStatement(query, params);
- stmt.execute();
- } catch (ex) {
- throw ex;
- } finally {
- if (stmt)
- stmt.reset();
- }
- },
-
-
- /**
- * Removes all logins from storage.
- */
- removeAllLogins : function () {
- this.log("Removing all logins");
- let query;
- let stmt;
- let transaction = new Transaction(this._dbConnection);
-
- // Disabled hosts kept, as one presumably doesn't want to erase those.
- // TODO: Add these items to the deleted items table once we've sorted
- // out the issues from bug 756701
- query = "DELETE FROM moz_logins";
- try {
- stmt = this._dbCreateStatement(query);
- stmt.execute();
- transaction.commit();
- } catch (e) {
- this.log("_removeAllLogins failed: " + e.name + " : " + e.message);
- transaction.rollback();
- throw new Error("Couldn't write to database");
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
-
- LoginHelper.notifyStorageChanged("removeAllLogins", null);
- },
-
-
- findLogins : function (count, hostname, formSubmitURL, httpRealm) {
- let loginData = {
- hostname: hostname,
- formSubmitURL: formSubmitURL,
- httpRealm: httpRealm
- };
- let matchData = { };
- for (let field of ["hostname", "formSubmitURL", "httpRealm"])
- if (loginData[field] != '')
- matchData[field] = loginData[field];
- let [logins, ids] = this._searchLogins(matchData);
-
- // Decrypt entries found for the caller.
- logins = this._decryptLogins(logins);
-
- this.log("_findLogins: returning " + logins.length + " logins");
- count.value = logins.length; // needed for XPCOM
- return logins;
- },
-
-
- countLogins : function (hostname, formSubmitURL, httpRealm) {
-
- let _countLoginsHelper = (hostname, formSubmitURL, httpRealm) => {
- // Do checks for null and empty strings, adjust conditions and params
- let [conditions, params] =
- this._buildConditionsAndParams(hostname, formSubmitURL, httpRealm);
-
- let query = "SELECT COUNT(1) AS numLogins FROM moz_logins";
- if (conditions.length) {
- conditions = conditions.map(c => "(" + c + ")");
- query += " WHERE " + conditions.join(" AND ");
- }
-
- let stmt, numLogins;
- try {
- stmt = this._dbCreateStatement(query, params);
- stmt.executeStep();
- numLogins = stmt.row.numLogins;
- } catch (e) {
- this.log("_countLogins failed: " + e.name + " : " + e.message);
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
- return numLogins;
- };
-
- let resultLogins = _countLoginsHelper(hostname, formSubmitURL, httpRealm);
- this.log("_countLogins: counted logins: " + resultLogins);
- return resultLogins;
- },
-
-
- get uiBusy() {
- return this._crypto.uiBusy;
- },
-
-
- get isLoggedIn() {
- return this._crypto.isLoggedIn;
- },
-
-
- /**
- * Returns an array with two items: [id, login]. If the login was not
- * found, both items will be null. The returned login contains the actual
- * stored login (useful for looking at the actual nsILoginMetaInfo values).
- */
- _getIdForLogin : function (login) {
- let matchData = { };
- for (let field of ["hostname", "formSubmitURL", "httpRealm"])
- if (login[field] != '')
- matchData[field] = login[field];
- let [logins, ids] = this._searchLogins(matchData);
-
- let id = null;
- let foundLogin = null;
-
- // The specified login isn't encrypted, so we need to ensure
- // the logins we're comparing with are decrypted. We decrypt one entry
- // at a time, lest _decryptLogins return fewer entries and screw up
- // indices between the two.
- for (let i = 0; i < logins.length; i++) {
- let [decryptedLogin] = this._decryptLogins([logins[i]]);
-
- if (!decryptedLogin || !decryptedLogin.equals(login))
- continue;
-
- // We've found a match, set id and break
- foundLogin = decryptedLogin;
- id = ids[i];
- break;
- }
-
- return [id, foundLogin];
- },
-
-
- /**
- * Adjusts the WHERE conditions and parameters for statements prior to the
- * statement being created. This fixes the cases where nulls are involved
- * and the empty string is supposed to be a wildcard match
- */
- _buildConditionsAndParams : function (hostname, formSubmitURL, httpRealm) {
- let conditions = [], params = {};
-
- if (hostname == null) {
- conditions.push("hostname isnull");
- } else if (hostname != '') {
- conditions.push("hostname = :hostname");
- params["hostname"] = hostname;
- }
-
- if (formSubmitURL == null) {
- conditions.push("formSubmitURL isnull");
- } else if (formSubmitURL != '') {
- conditions.push("formSubmitURL = :formSubmitURL OR formSubmitURL = ''");
- params["formSubmitURL"] = formSubmitURL;
- }
-
- if (httpRealm == null) {
- conditions.push("httpRealm isnull");
- } else if (httpRealm != '') {
- conditions.push("httpRealm = :httpRealm");
- params["httpRealm"] = httpRealm;
- }
-
- return [conditions, params];
- },
-
-
- /**
- * Checks to see if the specified GUID already exists.
- */
- _isGuidUnique : function (guid) {
- let query = "SELECT COUNT(1) AS numLogins FROM moz_logins WHERE guid = :guid";
- let params = { guid: guid };
-
- let stmt, numLogins;
- try {
- stmt = this._dbCreateStatement(query, params);
- stmt.executeStep();
- numLogins = stmt.row.numLogins;
- } catch (e) {
- this.log("_isGuidUnique failed: " + e.name + " : " + e.message);
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
-
- return (numLogins == 0);
- },
-
-
- /**
- * Returns the encrypted username, password, and encrypton type for the specified
- * login. Can throw if the user cancels a master password entry.
- */
- _encryptLogin : function (login) {
- let encUsername = this._crypto.encrypt(login.username);
- let encPassword = this._crypto.encrypt(login.password);
- let encType = this._crypto.defaultEncType;
-
- return [encUsername, encPassword, encType];
- },
-
-
- /**
- * Decrypts username and password fields in the provided array of
- * logins.
- *
- * The entries specified by the array will be decrypted, if possible.
- * An array of successfully decrypted logins will be returned. The return
- * value should be given to external callers (since still-encrypted
- * entries are useless), whereas internal callers generally don't want
- * to lose unencrypted entries (eg, because the user clicked Cancel
- * instead of entering their master password)
- */
- _decryptLogins : function (logins) {
- let result = [];
-
- for (let login of logins) {
- try {
- login.username = this._crypto.decrypt(login.username);
- login.password = this._crypto.decrypt(login.password);
- } catch (e) {
- // If decryption failed (corrupt entry?), just skip it.
- // Rethrow other errors (like canceling entry of a master pw)
- if (e.result == Cr.NS_ERROR_FAILURE)
- continue;
- throw e;
- }
- result.push(login);
- }
-
- return result;
- },
-
-
- // Database Creation & Access
-
- /**
- * Creates a statement, wraps it, and then does parameter replacement
- * Returns the wrapped statement for execution. Will use memoization
- * so that statements can be reused.
- */
- _dbCreateStatement : function (query, params) {
- let wrappedStmt = this._dbStmts[query];
- // Memoize the statements
- if (!wrappedStmt) {
- this.log("Creating new statement for query: " + query);
- wrappedStmt = this._dbConnection.createStatement(query);
- this._dbStmts[query] = wrappedStmt;
- }
- // Replace parameters, must be done 1 at a time
- if (params)
- for (let i in params)
- wrappedStmt.params[i] = params[i];
- return wrappedStmt;
- },
-
-
- /**
- * Attempts to initialize the database. This creates the file if it doesn't
- * exist, performs any migrations, etc. Return if this is the first run.
- */
- _dbInit : function () {
- this.log("Initializing Database");
- let isFirstRun = false;
- try {
- this._dbConnection = this._storageService.openDatabase(this._signonsFile);
- // Get the version of the schema in the file. It will be 0 if the
- // database has not been created yet.
- let version = this._dbConnection.schemaVersion;
- if (version == 0) {
- this._dbCreate();
- isFirstRun = true;
- } else if (version != DB_VERSION) {
- this._dbMigrate(version);
- }
- } catch (e) {
- if (e.result == Cr.NS_ERROR_FILE_CORRUPTED) {
- // Database is corrupted, so we backup the database, then throw
- // causing initialization to fail and a new db to be created next use
- this._dbCleanup(true);
- }
- throw e;
- }
-
- Services.obs.addObserver(this, "profile-before-change", false);
- return isFirstRun;
- },
-
- observe: function (subject, topic, data) {
- switch (topic) {
- case "profile-before-change":
- Services.obs.removeObserver(this, "profile-before-change");
- this._dbClose();
- break;
- }
- },
-
- _dbCreate: function () {
- this.log("Creating Database");
- this._dbCreateSchema();
- this._dbConnection.schemaVersion = DB_VERSION;
- },
-
-
- _dbCreateSchema : function () {
- this._dbCreateTables();
- this._dbCreateIndices();
- },
-
-
- _dbCreateTables : function () {
- this.log("Creating Tables");
- for (let name in this._dbSchema.tables)
- this._dbConnection.createTable(name, this._dbSchema.tables[name]);
- },
-
-
- _dbCreateIndices : function () {
- this.log("Creating Indices");
- for (let name in this._dbSchema.indices) {
- let index = this._dbSchema.indices[name];
- let statement = "CREATE INDEX IF NOT EXISTS " + name + " ON " + index.table +
- "(" + index.columns.join(", ") + ")";
- this._dbConnection.executeSimpleSQL(statement);
- }
- },
-
-
- _dbMigrate : function (oldVersion) {
- this.log("Attempting to migrate from version " + oldVersion);
-
- if (oldVersion > DB_VERSION) {
- this.log("Downgrading to version " + DB_VERSION);
- // User's DB is newer. Sanity check that our expected columns are
- // present, and if so mark the lower version and merrily continue
- // on. If the columns are borked, something is wrong so blow away
- // the DB and start from scratch. [Future incompatible upgrades
- // should swtich to a different table or file.]
-
- if (!this._dbAreExpectedColumnsPresent())
- throw Components.Exception("DB is missing expected columns",
- Cr.NS_ERROR_FILE_CORRUPTED);
-
- // Change the stored version to the current version. If the user
- // runs the newer code again, it will see the lower version number
- // and re-upgrade (to fixup any entries the old code added).
- this._dbConnection.schemaVersion = DB_VERSION;
- return;
- }
-
- // Upgrade to newer version...
-
- let transaction = new Transaction(this._dbConnection);
-
- try {
- for (let v = oldVersion + 1; v <= DB_VERSION; v++) {
- this.log("Upgrading to version " + v + "...");
- let migrateFunction = "_dbMigrateToVersion" + v;
- this[migrateFunction]();
- }
- } catch (e) {
- this.log("Migration failed: " + e);
- transaction.rollback();
- throw e;
- }
-
- this._dbConnection.schemaVersion = DB_VERSION;
- transaction.commit();
- this.log("DB migration completed.");
- },
-
-
- /**
- * Version 2 adds a GUID column. Existing logins are assigned a random GUID.
- */
- _dbMigrateToVersion2 : function () {
- // Check to see if GUID column already exists, add if needed
- let query;
- if (!this._dbColumnExists("guid")) {
- query = "ALTER TABLE moz_logins ADD COLUMN guid TEXT";
- this._dbConnection.executeSimpleSQL(query);
-
- query = "CREATE INDEX IF NOT EXISTS moz_logins_guid_index ON moz_logins (guid)";
- this._dbConnection.executeSimpleSQL(query);
- }
-
- // Get a list of IDs for existing logins
- let ids = [];
- query = "SELECT id FROM moz_logins WHERE guid isnull";
- let stmt;
- try {
- stmt = this._dbCreateStatement(query);
- while (stmt.executeStep())
- ids.push(stmt.row.id);
- } catch (e) {
- this.log("Failed getting IDs: " + e);
- throw e;
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
-
- // Generate a GUID for each login and update the DB.
- query = "UPDATE moz_logins SET guid = :guid WHERE id = :id";
- for (let id of ids) {
- let params = {
- id: id,
- guid: this._uuidService.generateUUID().toString()
- };
-
- try {
- stmt = this._dbCreateStatement(query, params);
- stmt.execute();
- } catch (e) {
- this.log("Failed setting GUID: " + e);
- throw e;
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
- }
- },
-
-
- /**
- * Version 3 adds a encType column.
- */
- _dbMigrateToVersion3 : function () {
- // Check to see if encType column already exists, add if needed
- let query;
- if (!this._dbColumnExists("encType")) {
- query = "ALTER TABLE moz_logins ADD COLUMN encType INTEGER";
- this._dbConnection.executeSimpleSQL(query);
-
- query = "CREATE INDEX IF NOT EXISTS " +
- "moz_logins_encType_index ON moz_logins (encType)";
- this._dbConnection.executeSimpleSQL(query);
- }
-
- // Get a list of existing logins
- let logins = [];
- let stmt;
- query = "SELECT id, encryptedUsername, encryptedPassword " +
- "FROM moz_logins WHERE encType isnull";
- try {
- stmt = this._dbCreateStatement(query);
- while (stmt.executeStep()) {
- let params = { id: stmt.row.id };
- // We will tag base64 logins correctly, but no longer support their use.
- if (stmt.row.encryptedUsername.charAt(0) == '~' ||
- stmt.row.encryptedPassword.charAt(0) == '~')
- params.encType = Ci.nsILoginManagerCrypto.ENCTYPE_BASE64;
- else
- params.encType = Ci.nsILoginManagerCrypto.ENCTYPE_SDR;
- logins.push(params);
- }
- } catch (e) {
- this.log("Failed getting logins: " + e);
- throw e;
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
-
- // Determine encryption type for each login and update the DB.
- query = "UPDATE moz_logins SET encType = :encType WHERE id = :id";
- for (let params of logins) {
- try {
- stmt = this._dbCreateStatement(query, params);
- stmt.execute();
- } catch (e) {
- this.log("Failed setting encType: " + e);
- throw e;
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
- }
- },
-
-
- /**
- * Version 4 adds timeCreated, timeLastUsed, timePasswordChanged,
- * and timesUsed columns
- */
- _dbMigrateToVersion4 : function () {
- let query;
- // Add the new columns, if needed.
- for (let column of ["timeCreated", "timeLastUsed", "timePasswordChanged", "timesUsed"]) {
- if (!this._dbColumnExists(column)) {
- query = "ALTER TABLE moz_logins ADD COLUMN " + column + " INTEGER";
- this._dbConnection.executeSimpleSQL(query);
- }
- }
-
- // Get a list of IDs for existing logins.
- let ids = [];
- let stmt;
- query = "SELECT id FROM moz_logins WHERE timeCreated isnull OR " +
- "timeLastUsed isnull OR timePasswordChanged isnull OR timesUsed isnull";
- try {
- stmt = this._dbCreateStatement(query);
- while (stmt.executeStep())
- ids.push(stmt.row.id);
- } catch (e) {
- this.log("Failed getting IDs: " + e);
- throw e;
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
-
- // Initialize logins with current time.
- query = "UPDATE moz_logins SET timeCreated = :initTime, timeLastUsed = :initTime, " +
- "timePasswordChanged = :initTime, timesUsed = 1 WHERE id = :id";
- let params = {
- id: null,
- initTime: Date.now()
- };
- for (let id of ids) {
- params.id = id;
- try {
- stmt = this._dbCreateStatement(query, params);
- stmt.execute();
- } catch (e) {
- this.log("Failed setting timestamps: " + e);
- throw e;
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
- }
- },
-
-
- /**
- * Version 5 adds the moz_deleted_logins table
- */
- _dbMigrateToVersion5 : function () {
- if (!this._dbConnection.tableExists("moz_deleted_logins")) {
- this._dbConnection.createTable("moz_deleted_logins", this._dbSchema.tables.moz_deleted_logins);
- }
- },
-
- /**
- * Version 6 migrates all the hosts from
- * moz_disabledHosts to the permission manager.
- */
- _dbMigrateToVersion6 : function () {
- let disabledHosts = [];
- let query = "SELECT hostname FROM moz_disabledHosts";
- let stmt;
-
- try {
- stmt = this._dbCreateStatement(query);
-
- while (stmt.executeStep()) {
- disabledHosts.push(stmt.row.hostname);
- }
-
- for (let host of disabledHosts) {
- try {
- let uri = Services.io.newURI(host, null, null);
- Services.perms.add(uri, PERMISSION_SAVE_LOGINS, Services.perms.DENY_ACTION);
- } catch (e) {
- Cu.reportError(e);
- }
- }
- } catch (e) {
- this.log(`_dbMigrateToVersion6 failed: ${e.name} : ${e.message}`);
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
-
- query = "DELETE FROM moz_disabledHosts";
- this._dbConnection.executeSimpleSQL(query);
- },
-
- /**
- * Sanity check to ensure that the columns this version of the code expects
- * are present in the DB we're using.
- */
- _dbAreExpectedColumnsPresent : function () {
- let query = "SELECT " +
- "id, " +
- "hostname, " +
- "httpRealm, " +
- "formSubmitURL, " +
- "usernameField, " +
- "passwordField, " +
- "encryptedUsername, " +
- "encryptedPassword, " +
- "guid, " +
- "encType, " +
- "timeCreated, " +
- "timeLastUsed, " +
- "timePasswordChanged, " +
- "timesUsed " +
- "FROM moz_logins";
- try {
- let stmt = this._dbConnection.createStatement(query);
- // (no need to execute statement, if it compiled we're good)
- stmt.finalize();
- } catch (e) {
- return false;
- }
-
- query = "SELECT " +
- "id, " +
- "hostname " +
- "FROM moz_disabledHosts";
- try {
- let stmt = this._dbConnection.createStatement(query);
- // (no need to execute statement, if it compiled we're good)
- stmt.finalize();
- } catch (e) {
- return false;
- }
-
- this.log("verified that expected columns are present in DB.");
- return true;
- },
-
-
- /**
- * Checks to see if the named column already exists.
- */
- _dbColumnExists : function (columnName) {
- let query = "SELECT " + columnName + " FROM moz_logins";
- try {
- let stmt = this._dbConnection.createStatement(query);
- // (no need to execute statement, if it compiled we're good)
- stmt.finalize();
- return true;
- } catch (e) {
- return false;
- }
- },
-
- _dbClose : function () {
- this.log("Closing the DB connection.");
- // Finalize all statements to free memory, avoid errors later
- for (let query in this._dbStmts) {
- let stmt = this._dbStmts[query];
- stmt.finalize();
- }
- this._dbStmts = {};
-
- if (this._dbConnection !== null) {
- try {
- this._dbConnection.close();
- } catch (e) {
- Components.utils.reportError(e);
- }
- }
- this._dbConnection = null;
- },
-
- /**
- * Called when database creation fails. Finalizes database statements,
- * closes the database connection, deletes the database file.
- */
- _dbCleanup : function (backup) {
- this.log("Cleaning up DB file - close & remove & backup=" + backup);
-
- // Create backup file
- if (backup) {
- let backupFile = this._signonsFile.leafName + ".corrupt";
- this._storageService.backupDatabaseFile(this._signonsFile, backupFile);
- }
-
- this._dbClose();
- this._signonsFile.remove(false);
- }
-
-}; // end of nsLoginManagerStorage_mozStorage implementation
-
-XPCOMUtils.defineLazyGetter(this.LoginManagerStorage_mozStorage.prototype, "log", () => {
- let logger = LoginHelper.createLogger("Login storage");
- return logger.log.bind(logger);
-});
-
-var component = [LoginManagerStorage_mozStorage];
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory(component);
diff --git a/toolkit/components/passwordmgr/test/.eslintrc.js b/toolkit/components/passwordmgr/test/.eslintrc.js
deleted file mode 100644
index ca626f31c..000000000
--- a/toolkit/components/passwordmgr/test/.eslintrc.js
+++ /dev/null
@@ -1,13 +0,0 @@
-"use strict";
-
-module.exports = { // eslint-disable-line no-undef
- "extends": [
- "../../../../testing/mochitest/mochitest.eslintrc.js",
- "../../../../testing/mochitest/chrome.eslintrc.js"
- ],
- "rules": {
- "brace-style": "off",
- "no-undef": "off",
- "no-unused-vars": "off",
- },
-};
diff --git a/toolkit/components/passwordmgr/test/LoginTestUtils.jsm b/toolkit/components/passwordmgr/test/LoginTestUtils.jsm
deleted file mode 100644
index 2fd8a31a3..000000000
--- a/toolkit/components/passwordmgr/test/LoginTestUtils.jsm
+++ /dev/null
@@ -1,295 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Shared functions generally available for testing login components.
- */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = [
- "LoginTestUtils",
-];
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-Cu.import("resource://testing-common/TestUtils.jsm");
-
-const LoginInfo =
- Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- "nsILoginInfo", "init");
-
-// For now, we need consumers to provide a reference to Assert.jsm.
-var Assert = null;
-
-this.LoginTestUtils = {
- set Assert(assert) {
- Assert = assert; // eslint-disable-line no-native-reassign
- },
-
- /**
- * Forces the storage module to save all data, and the Login Manager service
- * to replace the storage module with a newly initialized instance.
- */
- * reloadData() {
- Services.obs.notifyObservers(null, "passwordmgr-storage-replace", null);
- yield TestUtils.topicObserved("passwordmgr-storage-replace-complete");
- },
-
- /**
- * Erases all the data stored by the Login Manager service.
- */
- clearData() {
- Services.logins.removeAllLogins();
- for (let hostname of Services.logins.getAllDisabledHosts()) {
- Services.logins.setLoginSavingEnabled(hostname, true);
- }
- },
-
- /**
- * Checks that the currently stored list of nsILoginInfo matches the provided
- * array. The comparison uses the "equals" method of nsILoginInfo, that does
- * not include nsILoginMetaInfo properties in the test.
- */
- checkLogins(expectedLogins) {
- this.assertLoginListsEqual(Services.logins.getAllLogins(), expectedLogins);
- },
-
- /**
- * Checks that the two provided arrays of nsILoginInfo have the same length,
- * and every login in "expected" is also found in "actual". The comparison
- * uses the "equals" method of nsILoginInfo, that does not include
- * nsILoginMetaInfo properties in the test.
- */
- assertLoginListsEqual(actual, expected) {
- Assert.equal(expected.length, actual.length);
- Assert.ok(expected.every(e => actual.some(a => a.equals(e))));
- },
-
- /**
- * Checks that the two provided arrays of strings contain the same values,
- * maybe in a different order, case-sensitively.
- */
- assertDisabledHostsEqual(actual, expected) {
- Assert.deepEqual(actual.sort(), expected.sort());
- },
-
- /**
- * Checks whether the given time, expressed as the number of milliseconds
- * since January 1, 1970, 00:00:00 UTC, falls within 30 seconds of now.
- */
- assertTimeIsAboutNow(timeMs) {
- Assert.ok(Math.abs(timeMs - Date.now()) < 30000);
- },
-};
-
-/**
- * This object contains functions that return new instances of nsILoginInfo for
- * every call. The returned instances can be compared using their "equals" or
- * "matches" methods, or modified for the needs of the specific test being run.
- *
- * Any modification to the test data requires updating the tests accordingly, in
- * particular the search tests.
- */
-this.LoginTestUtils.testData = {
- /**
- * Returns a new nsILoginInfo for use with form submits.
- *
- * @param modifications
- * Each property of this object replaces the property of the same name
- * in the returned nsILoginInfo or nsILoginMetaInfo.
- */
- formLogin(modifications) {
- let loginInfo = new LoginInfo("http://www3.example.com",
- "http://www.example.com", null,
- "the username", "the password",
- "form_field_username", "form_field_password");
- loginInfo.QueryInterface(Ci.nsILoginMetaInfo);
- if (modifications) {
- for (let [name, value] of Object.entries(modifications)) {
- loginInfo[name] = value;
- }
- }
- return loginInfo;
- },
-
- /**
- * Returns a new nsILoginInfo for use with HTTP authentication.
- *
- * @param modifications
- * Each property of this object replaces the property of the same name
- * in the returned nsILoginInfo or nsILoginMetaInfo.
- */
- authLogin(modifications) {
- let loginInfo = new LoginInfo("http://www.example.org", null,
- "The HTTP Realm", "the username",
- "the password", "", "");
- loginInfo.QueryInterface(Ci.nsILoginMetaInfo);
- if (modifications) {
- for (let [name, value] of Object.entries(modifications)) {
- loginInfo[name] = value;
- }
- }
- return loginInfo;
- },
-
- /**
- * Returns an array of typical nsILoginInfo that could be stored in the
- * database.
- */
- loginList() {
- return [
- // --- Examples of form logins (subdomains of example.com) ---
-
- // Simple form login with named fields for username and password.
- new LoginInfo("http://www.example.com", "http://www.example.com", null,
- "the username", "the password for www.example.com",
- "form_field_username", "form_field_password"),
-
- // Different schemes are treated as completely different sites.
- new LoginInfo("https://www.example.com", "https://www.example.com", null,
- "the username", "the password for https",
- "form_field_username", "form_field_password"),
-
- // Subdomains are treated as completely different sites.
- new LoginInfo("https://example.com", "https://example.com", null,
- "the username", "the password for example.com",
- "form_field_username", "form_field_password"),
-
- // Forms found on the same host, but with different hostnames in the
- // "action" attribute, are handled independently.
- new LoginInfo("http://www3.example.com", "http://www.example.com", null,
- "the username", "the password",
- "form_field_username", "form_field_password"),
- new LoginInfo("http://www3.example.com", "https://www.example.com", null,
- "the username", "the password",
- "form_field_username", "form_field_password"),
- new LoginInfo("http://www3.example.com", "http://example.com", null,
- "the username", "the password",
- "form_field_username", "form_field_password"),
-
- // It is not possible to store multiple passwords for the same username,
- // however multiple passwords can be stored when the usernames differ.
- // An empty username is a valid case and different from the others.
- new LoginInfo("http://www4.example.com", "http://www4.example.com", null,
- "username one", "password one",
- "form_field_username", "form_field_password"),
- new LoginInfo("http://www4.example.com", "http://www4.example.com", null,
- "username two", "password two",
- "form_field_username", "form_field_password"),
- new LoginInfo("http://www4.example.com", "http://www4.example.com", null,
- "", "password three",
- "form_field_username", "form_field_password"),
-
- // Username and passwords fields in forms may have no "name" attribute.
- new LoginInfo("http://www5.example.com", "http://www5.example.com", null,
- "multi username", "multi password", "", ""),
-
- // Forms with PIN-type authentication will typically have no username.
- new LoginInfo("http://www6.example.com", "http://www6.example.com", null,
- "", "12345", "", "form_field_password"),
-
- // --- Examples of authentication logins (subdomains of example.org) ---
-
- // Simple HTTP authentication login.
- new LoginInfo("http://www.example.org", null, "The HTTP Realm",
- "the username", "the password", "", ""),
-
- // Simple FTP authentication login.
- new LoginInfo("ftp://ftp.example.org", null, "ftp://ftp.example.org",
- "the username", "the password", "", ""),
-
- // Multiple HTTP authentication logins can be stored for different realms.
- new LoginInfo("http://www2.example.org", null, "The HTTP Realm",
- "the username", "the password", "", ""),
- new LoginInfo("http://www2.example.org", null, "The HTTP Realm Other",
- "the username other", "the password other", "", ""),
-
- // --- Both form and authentication logins (example.net) ---
-
- new LoginInfo("http://example.net", "http://example.net", null,
- "the username", "the password",
- "form_field_username", "form_field_password"),
- new LoginInfo("http://example.net", "http://www.example.net", null,
- "the username", "the password",
- "form_field_username", "form_field_password"),
- new LoginInfo("http://example.net", "http://www.example.net", null,
- "username two", "the password",
- "form_field_username", "form_field_password"),
- new LoginInfo("http://example.net", null, "The HTTP Realm",
- "the username", "the password", "", ""),
- new LoginInfo("http://example.net", null, "The HTTP Realm Other",
- "username two", "the password", "", ""),
- new LoginInfo("ftp://example.net", null, "ftp://example.net",
- "the username", "the password", "", ""),
-
- // --- Examples of logins added by extensions (chrome scheme) ---
-
- new LoginInfo("chrome://example_extension", null, "Example Login One",
- "the username", "the password one", "", ""),
- new LoginInfo("chrome://example_extension", null, "Example Login Two",
- "the username", "the password two", "", ""),
- ];
- },
-};
-
-this.LoginTestUtils.recipes = {
- getRecipeParent() {
- let { LoginManagerParent } = Cu.import("resource://gre/modules/LoginManagerParent.jsm", {});
- if (!LoginManagerParent.recipeParentPromise) {
- return null;
- }
- return LoginManagerParent.recipeParentPromise.then((recipeParent) => {
- return recipeParent;
- });
- },
-};
-
-this.LoginTestUtils.masterPassword = {
- masterPassword: "omgsecret!",
-
- _set(enable) {
- let oldPW, newPW;
- if (enable) {
- oldPW = "";
- newPW = this.masterPassword;
- } else {
- oldPW = this.masterPassword;
- newPW = "";
- }
-
- let secmodDB = Cc["@mozilla.org/security/pkcs11moduledb;1"]
- .getService(Ci.nsIPKCS11ModuleDB);
- let slot = secmodDB.findSlotByName("");
- if (!slot) {
- throw new Error("Can't find slot");
- }
-
- // Set master password. Note that this does not log you in, so the next
- // invocation of pwmgr can trigger a MP prompt.
- let pk11db = Cc["@mozilla.org/security/pk11tokendb;1"]
- .getService(Ci.nsIPK11TokenDB);
- let token = pk11db.findTokenByName("");
- if (slot.status == Ci.nsIPKCS11Slot.SLOT_UNINITIALIZED) {
- dump("MP initialized to " + newPW + "\n");
- token.initPassword(newPW);
- } else {
- token.checkPassword(oldPW);
- dump("MP change from " + oldPW + " to " + newPW + "\n");
- token.changePassword(oldPW, newPW);
- }
- },
-
- enable() {
- this._set(true);
- },
-
- disable() {
- this._set(false);
- },
-};
diff --git a/toolkit/components/passwordmgr/test/authenticate.sjs b/toolkit/components/passwordmgr/test/authenticate.sjs
deleted file mode 100644
index 42edc3220..000000000
--- a/toolkit/components/passwordmgr/test/authenticate.sjs
+++ /dev/null
@@ -1,228 +0,0 @@
-function handleRequest(request, response)
-{
- try {
- reallyHandleRequest(request, response);
- } catch (e) {
- response.setStatusLine("1.0", 200, "AlmostOK");
- response.write("Error handling request: " + e);
- }
-}
-
-
-function reallyHandleRequest(request, response) {
- var match;
- var requestAuth = true, requestProxyAuth = true;
-
- // Allow the caller to drive how authentication is processed via the query.
- // Eg, http://localhost:8888/authenticate.sjs?user=foo&realm=bar
- // The extra ? allows the user/pass/realm checks to succeed if the name is
- // at the beginning of the query string.
- var query = "?" + request.queryString;
-
- var expected_user = "", expected_pass = "", realm = "mochitest";
- var proxy_expected_user = "", proxy_expected_pass = "", proxy_realm = "mochi-proxy";
- var huge = false, plugin = false, anonymous = false, formauth = false;
- var authHeaderCount = 1;
- // user=xxx
- match = /[^_]user=([^&]*)/.exec(query);
- if (match)
- expected_user = match[1];
-
- // pass=xxx
- match = /[^_]pass=([^&]*)/.exec(query);
- if (match)
- expected_pass = match[1];
-
- // realm=xxx
- match = /[^_]realm=([^&]*)/.exec(query);
- if (match)
- realm = match[1];
-
- // proxy_user=xxx
- match = /proxy_user=([^&]*)/.exec(query);
- if (match)
- proxy_expected_user = match[1];
-
- // proxy_pass=xxx
- match = /proxy_pass=([^&]*)/.exec(query);
- if (match)
- proxy_expected_pass = match[1];
-
- // proxy_realm=xxx
- match = /proxy_realm=([^&]*)/.exec(query);
- if (match)
- proxy_realm = match[1];
-
- // huge=1
- match = /huge=1/.exec(query);
- if (match)
- huge = true;
-
- // plugin=1
- match = /plugin=1/.exec(query);
- if (match)
- plugin = true;
-
- // multiple=1
- match = /multiple=([^&]*)/.exec(query);
- if (match)
- authHeaderCount = match[1]+0;
-
- // anonymous=1
- match = /anonymous=1/.exec(query);
- if (match)
- anonymous = true;
-
- // formauth=1
- match = /formauth=1/.exec(query);
- if (match)
- formauth = true;
-
- // Look for an authentication header, if any, in the request.
- //
- // EG: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
- //
- // This test only supports Basic auth. The value sent by the client is
- // "username:password", obscured with base64 encoding.
-
- var actual_user = "", actual_pass = "", authHeader, authPresent = false;
- if (request.hasHeader("Authorization")) {
- authPresent = true;
- authHeader = request.getHeader("Authorization");
- match = /Basic (.+)/.exec(authHeader);
- if (match.length != 2)
- throw new Error("Couldn't parse auth header: " + authHeader);
-
- var userpass = base64ToString(match[1]); // no atob() :-(
- match = /(.*):(.*)/.exec(userpass);
- if (match.length != 3)
- throw new Error("Couldn't decode auth header: " + userpass);
- actual_user = match[1];
- actual_pass = match[2];
- }
-
- var proxy_actual_user = "", proxy_actual_pass = "";
- if (request.hasHeader("Proxy-Authorization")) {
- authHeader = request.getHeader("Proxy-Authorization");
- match = /Basic (.+)/.exec(authHeader);
- if (match.length != 2)
- throw new Error("Couldn't parse auth header: " + authHeader);
-
- var userpass = base64ToString(match[1]); // no atob() :-(
- match = /(.*):(.*)/.exec(userpass);
- if (match.length != 3)
- throw new Error("Couldn't decode auth header: " + userpass);
- proxy_actual_user = match[1];
- proxy_actual_pass = match[2];
- }
-
- // Don't request authentication if the credentials we got were what we
- // expected.
- if (expected_user == actual_user &&
- expected_pass == actual_pass) {
- requestAuth = false;
- }
- if (proxy_expected_user == proxy_actual_user &&
- proxy_expected_pass == proxy_actual_pass) {
- requestProxyAuth = false;
- }
-
- if (anonymous) {
- if (authPresent) {
- response.setStatusLine("1.0", 400, "Unexpected authorization header found");
- } else {
- response.setStatusLine("1.0", 200, "Authorization header not found");
- }
- } else {
- if (requestProxyAuth) {
- response.setStatusLine("1.0", 407, "Proxy authentication required");
- for (i = 0; i < authHeaderCount; ++i)
- response.setHeader("Proxy-Authenticate", "basic realm=\"" + proxy_realm + "\"", true);
- } else if (requestAuth) {
- if (formauth && authPresent)
- response.setStatusLine("1.0", 403, "Form authentication required");
- else
- response.setStatusLine("1.0", 401, "Authentication required");
- for (i = 0; i < authHeaderCount; ++i)
- response.setHeader("WWW-Authenticate", "basic realm=\"" + realm + "\"", true);
- } else {
- response.setStatusLine("1.0", 200, "OK");
- }
- }
-
- response.setHeader("Content-Type", "application/xhtml+xml", false);
- response.write("<html xmlns='http://www.w3.org/1999/xhtml'>");
- response.write("<p>Login: <span id='ok'>" + (requestAuth ? "FAIL" : "PASS") + "</span></p>\n");
- response.write("<p>Proxy: <span id='proxy'>" + (requestProxyAuth ? "FAIL" : "PASS") + "</span></p>\n");
- response.write("<p>Auth: <span id='auth'>" + authHeader + "</span></p>\n");
- response.write("<p>User: <span id='user'>" + actual_user + "</span></p>\n");
- response.write("<p>Pass: <span id='pass'>" + actual_pass + "</span></p>\n");
-
- if (huge) {
- response.write("<div style='display: none'>");
- for (i = 0; i < 100000; i++) {
- response.write("123456789\n");
- }
- response.write("</div>");
- response.write("<span id='footnote'>This is a footnote after the huge content fill</span>");
- }
-
- if (plugin) {
- response.write("<embed id='embedtest' style='width: 400px; height: 100px;' " +
- "type='application/x-test'></embed>\n");
- }
-
- response.write("</html>");
-}
-
-
-// base64 decoder
-//
-// Yoinked from extensions/xml-rpc/src/nsXmlRpcClient.js because btoa()
-// doesn't seem to exist. :-(
-/* Convert Base64 data to a string */
-const toBinaryTable = [
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
- 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
- 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
- -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
- 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
-];
-const base64Pad = '=';
-
-function base64ToString(data) {
-
- var result = '';
- var leftbits = 0; // number of bits decoded, but yet to be appended
- var leftdata = 0; // bits decoded, but yet to be appended
-
- // Convert one by one.
- for (var i = 0; i < data.length; i++) {
- var c = toBinaryTable[data.charCodeAt(i) & 0x7f];
- var padding = (data[i] == base64Pad);
- // Skip illegal characters and whitespace
- if (c == -1) continue;
-
- // Collect data into leftdata, update bitcount
- leftdata = (leftdata << 6) | c;
- leftbits += 6;
-
- // If we have 8 or more bits, append 8 bits to the result
- if (leftbits >= 8) {
- leftbits -= 8;
- // Append if not padding.
- if (!padding)
- result += String.fromCharCode((leftdata >> leftbits) & 0xff);
- leftdata &= (1 << leftbits) - 1;
- }
- }
-
- // If there are any bits left, the base64 string was corrupted
- if (leftbits)
- throw Components.Exception('Corrupted base64 string');
-
- return result;
-}
diff --git a/toolkit/components/passwordmgr/test/blank.html b/toolkit/components/passwordmgr/test/blank.html
deleted file mode 100644
index 81ddc2235..000000000
--- a/toolkit/components/passwordmgr/test/blank.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta charset="utf-8">
- </head>
- <body>
- </body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/.eslintrc.js b/toolkit/components/passwordmgr/test/browser/.eslintrc.js
deleted file mode 100644
index 7c8021192..000000000
--- a/toolkit/components/passwordmgr/test/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/passwordmgr/test/browser/authenticate.sjs b/toolkit/components/passwordmgr/test/browser/authenticate.sjs
deleted file mode 100644
index fe2d2423c..000000000
--- a/toolkit/components/passwordmgr/test/browser/authenticate.sjs
+++ /dev/null
@@ -1,110 +0,0 @@
-function handleRequest(request, response)
-{
- var match;
- var requestAuth = true;
-
- // Allow the caller to drive how authentication is processed via the query.
- // Eg, http://localhost:8888/authenticate.sjs?user=foo&realm=bar
- // The extra ? allows the user/pass/realm checks to succeed if the name is
- // at the beginning of the query string.
- var query = "?" + request.queryString;
-
- var expected_user = "test", expected_pass = "testpass", realm = "mochitest";
-
- // Look for an authentication header, if any, in the request.
- //
- // EG: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
- //
- // This test only supports Basic auth. The value sent by the client is
- // "username:password", obscured with base64 encoding.
-
- var actual_user = "", actual_pass = "", authHeader, authPresent = false;
- if (request.hasHeader("Authorization")) {
- authPresent = true;
- authHeader = request.getHeader("Authorization");
- match = /Basic (.+)/.exec(authHeader);
- if (match.length != 2)
- throw new Error("Couldn't parse auth header: " + authHeader);
-
- var userpass = base64ToString(match[1]); // no atob() :-(
- match = /(.*):(.*)/.exec(userpass);
- if (match.length != 3)
- throw new Error("Couldn't decode auth header: " + userpass);
- actual_user = match[1];
- actual_pass = match[2];
- }
-
- // Don't request authentication if the credentials we got were what we
- // expected.
- if (expected_user == actual_user &&
- expected_pass == actual_pass) {
- requestAuth = false;
- }
-
- if (requestAuth) {
- response.setStatusLine("1.0", 401, "Authentication required");
- response.setHeader("WWW-Authenticate", "basic realm=\"" + realm + "\"", true);
- } else {
- response.setStatusLine("1.0", 200, "OK");
- }
-
- response.setHeader("Content-Type", "application/xhtml+xml", false);
- response.write("<html xmlns='http://www.w3.org/1999/xhtml'>");
- response.write("<p>Login: <span id='ok'>" + (requestAuth ? "FAIL" : "PASS") + "</span></p>\n");
- response.write("<p>Auth: <span id='auth'>" + authHeader + "</span></p>\n");
- response.write("<p>User: <span id='user'>" + actual_user + "</span></p>\n");
- response.write("<p>Pass: <span id='pass'>" + actual_pass + "</span></p>\n");
- response.write("</html>");
-}
-
-
-// base64 decoder
-//
-// Yoinked from extensions/xml-rpc/src/nsXmlRpcClient.js because btoa()
-// doesn't seem to exist. :-(
-/* Convert Base64 data to a string */
-const toBinaryTable = [
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
- 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
- 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
- -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
- 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
-];
-const base64Pad = '=';
-
-function base64ToString(data) {
-
- var result = '';
- var leftbits = 0; // number of bits decoded, but yet to be appended
- var leftdata = 0; // bits decoded, but yet to be appended
-
- // Convert one by one.
- for (var i = 0; i < data.length; i++) {
- var c = toBinaryTable[data.charCodeAt(i) & 0x7f];
- var padding = (data[i] == base64Pad);
- // Skip illegal characters and whitespace
- if (c == -1) continue;
-
- // Collect data into leftdata, update bitcount
- leftdata = (leftdata << 6) | c;
- leftbits += 6;
-
- // If we have 8 or more bits, append 8 bits to the result
- if (leftbits >= 8) {
- leftbits -= 8;
- // Append if not padding.
- if (!padding)
- result += String.fromCharCode((leftdata >> leftbits) & 0xff);
- leftdata &= (1 << leftbits) - 1;
- }
- }
-
- // If there are any bits left, the base64 string was corrupted
- if (leftbits)
- throw Components.Exception('Corrupted base64 string');
-
- return result;
-}
diff --git a/toolkit/components/passwordmgr/test/browser/browser.ini b/toolkit/components/passwordmgr/test/browser/browser.ini
deleted file mode 100644
index b17591436..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser.ini
+++ /dev/null
@@ -1,72 +0,0 @@
-[DEFAULT]
-support-files =
- ../formsubmit.sjs
- authenticate.sjs
- form_basic.html
- form_basic_iframe.html
- formless_basic.html
- form_same_origin_action.html
- form_cross_origin_secure_action.html
- head.js
- insecure_test.html
- insecure_test_subframe.html
- multiple_forms.html
- streamConverter_content.sjs
-
-[browser_autocomplete_insecure_warning.js]
-support-files =
- form_cross_origin_insecure_action.html
-[browser_capture_doorhanger.js]
-support-files =
- subtst_notifications_1.html
- subtst_notifications_2.html
- subtst_notifications_2pw_0un.html
- subtst_notifications_2pw_1un_1text.html
- subtst_notifications_3.html
- subtst_notifications_4.html
- subtst_notifications_5.html
- subtst_notifications_6.html
- subtst_notifications_8.html
- subtst_notifications_9.html
- subtst_notifications_10.html
- subtst_notifications_change_p.html
-[browser_capture_doorhanger_httpsUpgrade.js]
-support-files =
- subtst_notifications_1.html
- subtst_notifications_8.html
-[browser_capture_doorhanger_window_open.js]
-support-files =
- subtst_notifications_11.html
- subtst_notifications_11_popup.html
-skip-if = os == "linux" # Bug 1312981, bug 1313136
-[browser_context_menu_autocomplete_interaction.js]
-[browser_username_select_dialog.js]
-support-files =
- subtst_notifications_change_p.html
-[browser_DOMFormHasPassword.js]
-[browser_DOMInputPasswordAdded.js]
-[browser_exceptions_dialog.js]
-[browser_formless_submit_chrome.js]
-[browser_hasInsecureLoginForms.js]
-[browser_hasInsecureLoginForms_streamConverter.js]
-[browser_http_autofill.js]
-[browser_insecurePasswordConsoleWarning.js]
-support-files =
- form_cross_origin_insecure_action.html
-[browser_master_password_autocomplete.js]
-[browser_notifications.js]
-[browser_notifications_username.js]
-[browser_notifications_password.js]
-[browser_notifications_2.js]
-skip-if = os == "linux" # Bug 1272849 Main action button disabled state intermittent
-[browser_passwordmgr_editing.js]
-skip-if = os == "linux"
-[browser_context_menu.js]
-[browser_context_menu_iframe.js]
-[browser_passwordmgr_contextmenu.js]
-subsuite = clipboard
-[browser_passwordmgr_fields.js]
-[browser_passwordmgr_observers.js]
-[browser_passwordmgr_sort.js]
-[browser_passwordmgr_switchtab.js]
-[browser_passwordmgrdlg.js]
diff --git a/toolkit/components/passwordmgr/test/browser/browser_DOMFormHasPassword.js b/toolkit/components/passwordmgr/test/browser/browser_DOMFormHasPassword.js
deleted file mode 100644
index 80a0dd903..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_DOMFormHasPassword.js
+++ /dev/null
@@ -1,94 +0,0 @@
-const ids = {
- INPUT_ID: "input1",
- FORM1_ID: "form1",
- FORM2_ID: "form2",
- CHANGE_INPUT_ID: "input2",
-};
-
-function task(contentIds) {
- let resolve;
- let promise = new Promise(r => { resolve = r; });
-
- function unexpectedContentEvent(evt) {
- ok(false, "Received a " + evt.type + " event on content");
- }
-
- var gDoc = null;
-
- addEventListener("load", tabLoad, true);
-
- function tabLoad() {
- if (content.location.href == "about:blank")
- return;
- removeEventListener("load", tabLoad, true);
-
- gDoc = content.document;
- gDoc.addEventListener("DOMFormHasPassword", unexpectedContentEvent, false);
- gDoc.defaultView.setTimeout(test_inputAdd, 0);
- }
-
- function test_inputAdd() {
- addEventListener("DOMFormHasPassword", test_inputAddHandler, false);
- let input = gDoc.createElementNS("http://www.w3.org/1999/xhtml", "input");
- input.setAttribute("type", "password");
- input.setAttribute("id", contentIds.INPUT_ID);
- input.setAttribute("data-test", "unique-attribute");
- gDoc.getElementById(contentIds.FORM1_ID).appendChild(input);
- }
-
- function test_inputAddHandler(evt) {
- removeEventListener(evt.type, test_inputAddHandler, false);
- is(evt.target.id, contentIds.FORM1_ID,
- evt.type + " event targets correct form element (added password element)");
- gDoc.defaultView.setTimeout(test_inputChangeForm, 0);
- }
-
- function test_inputChangeForm() {
- addEventListener("DOMFormHasPassword", test_inputChangeFormHandler, false);
- let input = gDoc.getElementById(contentIds.INPUT_ID);
- input.setAttribute("form", contentIds.FORM2_ID);
- }
-
- function test_inputChangeFormHandler(evt) {
- removeEventListener(evt.type, test_inputChangeFormHandler, false);
- is(evt.target.id, contentIds.FORM2_ID,
- evt.type + " event targets correct form element (changed form)");
- gDoc.defaultView.setTimeout(test_inputChangesType, 0);
- }
-
- function test_inputChangesType() {
- addEventListener("DOMFormHasPassword", test_inputChangesTypeHandler, false);
- let input = gDoc.getElementById(contentIds.CHANGE_INPUT_ID);
- input.setAttribute("type", "password");
- }
-
- function test_inputChangesTypeHandler(evt) {
- removeEventListener(evt.type, test_inputChangesTypeHandler, false);
- is(evt.target.id, contentIds.FORM1_ID,
- evt.type + " event targets correct form element (changed type)");
- gDoc.defaultView.setTimeout(finish, 0);
- }
-
- function finish() {
- gDoc.removeEventListener("DOMFormHasPassword", unexpectedContentEvent, false);
- resolve();
- }
-
- return promise;
-}
-
-add_task(function* () {
- let tab = gBrowser.selectedTab = gBrowser.addTab();
-
- let promise = ContentTask.spawn(tab.linkedBrowser, ids, task);
- tab.linkedBrowser.loadURI("data:text/html;charset=utf-8," +
- "<html><body>" +
- "<form id='" + ids.FORM1_ID + "'>" +
- "<input id='" + ids.CHANGE_INPUT_ID + "'></form>" +
- "<form id='" + ids.FORM2_ID + "'></form>" +
- "</body></html>");
- yield promise;
-
- ok(true, "Test completed");
- gBrowser.removeCurrentTab();
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_DOMInputPasswordAdded.js b/toolkit/components/passwordmgr/test/browser/browser_DOMInputPasswordAdded.js
deleted file mode 100644
index f54892e19..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_DOMInputPasswordAdded.js
+++ /dev/null
@@ -1,99 +0,0 @@
-const consts = {
- HTML_NS: "http://www.w3.org/1999/xhtml",
-
- INPUT_ID: "input1",
- FORM1_ID: "form1",
- FORM2_ID: "form2",
- CHANGE_INPUT_ID: "input2",
- BODY_INPUT_ID: "input3",
-};
-
-function task(contentConsts) {
- let resolve;
- let promise = new Promise(r => { resolve = r; });
-
- function unexpectedContentEvent(evt) {
- Assert.ok(false, "Received a " + evt.type + " event on content");
- }
-
- var gDoc = null;
-
- addEventListener("load", tabLoad, true);
-
- function tabLoad() {
- removeEventListener("load", tabLoad, true);
- gDoc = content.document;
- // These events shouldn't escape to content.
- gDoc.addEventListener("DOMInputPasswordAdded", unexpectedContentEvent, false);
- gDoc.defaultView.setTimeout(test_inputAdd, 0);
- }
-
- function test_inputAdd() {
- addEventListener("DOMInputPasswordAdded", test_inputAddHandler, false);
- let input = gDoc.createElementNS(contentConsts.HTML_NS, "input");
- input.setAttribute("type", "password");
- input.setAttribute("id", contentConsts.INPUT_ID);
- input.setAttribute("data-test", "unique-attribute");
- gDoc.getElementById(contentConsts.FORM1_ID).appendChild(input);
- info("Done appending the input element");
- }
-
- function test_inputAddHandler(evt) {
- removeEventListener(evt.type, test_inputAddHandler, false);
- Assert.equal(evt.target.id, contentConsts.INPUT_ID,
- evt.type + " event targets correct input element (added password element)");
- gDoc.defaultView.setTimeout(test_inputAddOutsideForm, 0);
- }
-
- function test_inputAddOutsideForm() {
- addEventListener("DOMInputPasswordAdded", test_inputAddOutsideFormHandler, false);
- let input = gDoc.createElementNS(contentConsts.HTML_NS, "input");
- input.setAttribute("type", "password");
- input.setAttribute("id", contentConsts.BODY_INPUT_ID);
- input.setAttribute("data-test", "unique-attribute");
- gDoc.body.appendChild(input);
- info("Done appending the input element to the body");
- }
-
- function test_inputAddOutsideFormHandler(evt) {
- removeEventListener(evt.type, test_inputAddOutsideFormHandler, false);
- Assert.equal(evt.target.id, contentConsts.BODY_INPUT_ID,
- evt.type + " event targets correct input element (added password element outside form)");
- gDoc.defaultView.setTimeout(test_inputChangesType, 0);
- }
-
- function test_inputChangesType() {
- addEventListener("DOMInputPasswordAdded", test_inputChangesTypeHandler, false);
- let input = gDoc.getElementById(contentConsts.CHANGE_INPUT_ID);
- input.setAttribute("type", "password");
- }
-
- function test_inputChangesTypeHandler(evt) {
- removeEventListener(evt.type, test_inputChangesTypeHandler, false);
- Assert.equal(evt.target.id, contentConsts.CHANGE_INPUT_ID,
- evt.type + " event targets correct input element (changed type)");
- gDoc.defaultView.setTimeout(completeTest, 0);
- }
-
- function completeTest() {
- Assert.ok(true, "Test completed");
- gDoc.removeEventListener("DOMInputPasswordAdded", unexpectedContentEvent, false);
- resolve();
- }
-
- return promise;
-}
-
-add_task(function* () {
- let tab = gBrowser.selectedTab = gBrowser.addTab();
- let promise = ContentTask.spawn(tab.linkedBrowser, consts, task);
- tab.linkedBrowser.loadURI("data:text/html;charset=utf-8," +
- "<html><body>" +
- "<form id='" + consts.FORM1_ID + "'>" +
- "<input id='" + consts.CHANGE_INPUT_ID + "'></form>" +
- "<form id='" + consts.FORM2_ID + "'></form>" +
- "</body></html>");
- yield promise;
- gBrowser.removeCurrentTab();
-});
-
diff --git a/toolkit/components/passwordmgr/test/browser/browser_autocomplete_insecure_warning.js b/toolkit/components/passwordmgr/test/browser/browser_autocomplete_insecure_warning.js
deleted file mode 100644
index 6aa8e5cf7..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_autocomplete_insecure_warning.js
+++ /dev/null
@@ -1,41 +0,0 @@
-"use strict";
-
-const EXPECTED_SUPPORT_URL = Services.urlFormatter.formatURLPref("app.support.baseURL") +
- "insecure-password";
-
-add_task(function* test_clickInsecureFieldWarning() {
- let url = "https://example.com" + DIRECTORY_PATH + "form_cross_origin_insecure_action.html";
-
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url,
- }, function*(browser) {
- let popup = document.getElementById("PopupAutoComplete");
- ok(popup, "Got popup");
-
- let promiseShown = BrowserTestUtils.waitForEvent(popup, "popupshown");
-
- yield SimpleTest.promiseFocus(browser);
- info("content window focused");
-
- // Focus the username field to open the popup.
- yield ContentTask.spawn(browser, null, function openAutocomplete() {
- content.document.getElementById("form-basic-username").focus();
- });
-
- yield promiseShown;
- ok(promiseShown, "autocomplete shown");
-
- let warningItem = document.getAnonymousElementByAttribute(popup, "type", "insecureWarning");
- ok(warningItem, "Got warning richlistitem");
-
- yield BrowserTestUtils.waitForCondition(() => !warningItem.collapsed, "Wait for warning to show");
-
- info("Clicking on warning");
- let supportTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, EXPECTED_SUPPORT_URL);
- EventUtils.synthesizeMouseAtCenter(warningItem, {});
- let supportTab = yield supportTabPromise;
- ok(supportTab, "Support tab opened");
- yield BrowserTestUtils.removeTab(supportTab);
- });
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_capture_doorhanger.js b/toolkit/components/passwordmgr/test/browser/browser_capture_doorhanger.js
deleted file mode 100644
index b6bfdbf50..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_capture_doorhanger.js
+++ /dev/null
@@ -1,600 +0,0 @@
-/*
- * Test capture popup notifications
- */
-
-const BRAND_BUNDLE = Services.strings.createBundle("chrome://branding/locale/brand.properties");
-const BRAND_SHORT_NAME = BRAND_BUNDLE.GetStringFromName("brandShortName");
-
-let nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
-let login1 = new nsLoginInfo("http://example.com", "http://example.com", null,
- "notifyu1", "notifyp1", "user", "pass");
-let login2 = new nsLoginInfo("http://example.com", "http://example.com", null,
- "", "notifyp1", "", "pass");
-let login1B = new nsLoginInfo("http://example.com", "http://example.com", null,
- "notifyu1B", "notifyp1B", "user", "pass");
-let login2B = new nsLoginInfo("http://example.com", "http://example.com", null,
- "", "notifyp1B", "", "pass");
-
-requestLongerTimeout(2);
-
-add_task(function* setup() {
- // Load recipes for this test.
- let recipeParent = yield LoginManagerParent.recipeParentPromise;
- yield recipeParent.load({
- siteRecipes: [{
- hosts: ["example.org"],
- usernameSelector: "#user",
- passwordSelector: "#pass",
- }],
- });
-});
-
-add_task(function* test_remember_opens() {
- yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(notif, "got notification popup");
- notif.remove();
- });
-});
-
-add_task(function* test_clickNever() {
- yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(notif, "got notification popup");
- is(true, Services.logins.getLoginSavingEnabled("http://example.com"),
- "Checking for login saving enabled");
-
- yield* checkDoorhangerUsernamePassword("notifyu1", "notifyp1");
- clickDoorhangerButton(notif, NEVER_BUTTON);
- });
-
- is(Services.logins.getAllLogins().length, 0, "Should not have any logins yet");
-
- info("Make sure Never took effect");
- yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(!notif, "checking for no notification popup");
- is(false, Services.logins.getLoginSavingEnabled("http://example.com"),
- "Checking for login saving disabled");
- Services.logins.setLoginSavingEnabled("http://example.com", true);
- });
-
- is(Services.logins.getAllLogins().length, 0, "Should not have any logins yet");
-});
-
-add_task(function* test_clickRemember() {
- yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(notif, "got notification popup");
-
- is(Services.logins.getAllLogins().length, 0, "Should not have any logins yet");
-
- yield* checkDoorhangerUsernamePassword("notifyu1", "notifyp1");
- clickDoorhangerButton(notif, REMEMBER_BUTTON);
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1", "Check the username used on the new entry");
- is(login.password, "notifyp1", "Check the password used on the new entry");
- is(login.timesUsed, 1, "Check times used on new entry");
-
- info("Make sure Remember took effect and we don't prompt for an existing login");
- yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(!notif, "checking for no notification popup");
- });
-
- logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1", "Check the username used");
- is(login.password, "notifyp1", "Check the password used");
- is(login.timesUsed, 2, "Check times used incremented");
-
- checkOnlyLoginWasUsedTwice({ justChanged: false });
-
- // remove that login
- Services.logins.removeLogin(login1);
-});
-
-/* signons.rememberSignons pref tests... */
-
-add_task(function* test_rememberSignonsFalse() {
- info("Make sure we don't prompt with rememberSignons=false");
- Services.prefs.setBoolPref("signon.rememberSignons", false);
-
- yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(!notif, "checking for no notification popup");
- });
-
- is(Services.logins.getAllLogins().length, 0, "Should not have any logins yet");
-});
-
-add_task(function* test_rememberSignonsTrue() {
- info("Make sure we prompt with rememberSignons=true");
- Services.prefs.setBoolPref("signon.rememberSignons", true);
-
- yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(notif, "got notification popup");
- notif.remove();
- });
-
- is(Services.logins.getAllLogins().length, 0, "Should not have any logins yet");
-});
-
-/* autocomplete=off tests... */
-
-add_task(function* test_autocompleteOffUsername() {
- info("Check for notification popup when autocomplete=off present on username");
-
- yield testSubmittingLoginForm("subtst_notifications_2.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(notif, "checking for notification popup");
- notif.remove();
- });
-
- is(Services.logins.getAllLogins().length, 0, "Should not have any logins yet");
-});
-
-add_task(function* test_autocompleteOffPassword() {
- info("Check for notification popup when autocomplete=off present on password");
-
- yield testSubmittingLoginForm("subtst_notifications_3.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(notif, "checking for notification popup");
- notif.remove();
- });
-
- is(Services.logins.getAllLogins().length, 0, "Should not have any logins yet");
-});
-
-add_task(function* test_autocompleteOffForm() {
- info("Check for notification popup when autocomplete=off present on form");
-
- yield testSubmittingLoginForm("subtst_notifications_4.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(notif, "checking for notification popup");
- notif.remove();
- });
-
- is(Services.logins.getAllLogins().length, 0, "Should not have any logins yet");
-});
-
-
-add_task(function* test_noPasswordField() {
- info("Check for no notification popup when no password field present");
-
- yield testSubmittingLoginForm("subtst_notifications_5.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "null", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(!notif, "checking for no notification popup");
- });
-
- is(Services.logins.getAllLogins().length, 0, "Should not have any logins yet");
-});
-
-add_task(function* test_pwOnlyLoginMatchesForm() {
- info("Check for update popup when existing pw-only login matches form.");
- Services.logins.addLogin(login2);
-
- yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-change");
- ok(notif, "checking for notification popup");
- notif.remove();
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "", "Check the username");
- is(login.password, "notifyp1", "Check the password");
- is(login.timesUsed, 1, "Check times used");
-
- Services.logins.removeLogin(login2);
-});
-
-add_task(function* test_pwOnlyFormMatchesLogin() {
- info("Check for no notification popup when pw-only form matches existing login.");
- Services.logins.addLogin(login1);
-
- yield testSubmittingLoginForm("subtst_notifications_6.html", function*(fieldValues) {
- is(fieldValues.username, "null", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(!notif, "checking for no notification popup");
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1", "Check the username");
- is(login.password, "notifyp1", "Check the password");
- is(login.timesUsed, 2, "Check times used");
-
- Services.logins.removeLogin(login1);
-});
-
-add_task(function* test_pwOnlyFormDoesntMatchExisting() {
- info("Check for notification popup when pw-only form doesn't match existing login.");
- Services.logins.addLogin(login1B);
-
- yield testSubmittingLoginForm("subtst_notifications_6.html", function*(fieldValues) {
- is(fieldValues.username, "null", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(notif, "got notification popup");
- notif.remove();
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1B", "Check the username unchanged");
- is(login.password, "notifyp1B", "Check the password unchanged");
- is(login.timesUsed, 1, "Check times used");
-
- Services.logins.removeLogin(login1B);
-});
-
-add_task(function* test_changeUPLoginOnUPForm_dont() {
- info("Check for change-password popup, u+p login on u+p form. (not changed)");
- Services.logins.addLogin(login1);
-
- yield testSubmittingLoginForm("subtst_notifications_8.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "pass2", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-change");
- ok(notif, "got notification popup");
-
- yield* checkDoorhangerUsernamePassword("notifyu1", "pass2");
- clickDoorhangerButton(notif, DONT_CHANGE_BUTTON);
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1", "Check the username unchanged");
- is(login.password, "notifyp1", "Check the password unchanged");
- is(login.timesUsed, 1, "Check times used");
-
- Services.logins.removeLogin(login1);
-});
-
-add_task(function* test_changeUPLoginOnUPForm_change() {
- info("Check for change-password popup, u+p login on u+p form.");
- Services.logins.addLogin(login1);
-
- yield testSubmittingLoginForm("subtst_notifications_8.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "pass2", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-change");
- ok(notif, "got notification popup");
-
- yield* checkDoorhangerUsernamePassword("notifyu1", "pass2");
- clickDoorhangerButton(notif, CHANGE_BUTTON);
-
- ok(!getCaptureDoorhanger("password-change"), "popup should be gone");
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1", "Check the username unchanged");
- is(login.password, "pass2", "Check the password changed");
- is(login.timesUsed, 2, "Check times used");
-
- checkOnlyLoginWasUsedTwice({ justChanged: true });
-
- // cleanup
- login1.password = "pass2";
- Services.logins.removeLogin(login1);
- login1.password = "notifyp1";
-});
-
-add_task(function* test_changePLoginOnUPForm() {
- info("Check for change-password popup, p-only login on u+p form.");
- Services.logins.addLogin(login2);
-
- yield testSubmittingLoginForm("subtst_notifications_9.html", function*(fieldValues) {
- is(fieldValues.username, "", "Checking submitted username");
- is(fieldValues.password, "pass2", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-change");
- ok(notif, "got notification popup");
-
- yield* checkDoorhangerUsernamePassword("", "pass2");
- clickDoorhangerButton(notif, CHANGE_BUTTON);
-
- ok(!getCaptureDoorhanger("password-change"), "popup should be gone");
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "", "Check the username unchanged");
- is(login.password, "pass2", "Check the password changed");
- is(login.timesUsed, 2, "Check times used");
-
- // no cleanup -- saved password to be used in the next test.
-});
-
-add_task(function* test_changePLoginOnPForm() {
- info("Check for change-password popup, p-only login on p-only form.");
-
- yield testSubmittingLoginForm("subtst_notifications_10.html", function*(fieldValues) {
- is(fieldValues.username, "null", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-change");
- ok(notif, "got notification popup");
-
- yield* checkDoorhangerUsernamePassword("", "notifyp1");
- clickDoorhangerButton(notif, CHANGE_BUTTON);
-
- ok(!getCaptureDoorhanger("password-change"), "popup should be gone");
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "", "Check the username unchanged");
- is(login.password, "notifyp1", "Check the password changed");
- is(login.timesUsed, 3, "Check times used");
-
- Services.logins.removeLogin(login2);
-});
-
-add_task(function* test_checkUPSaveText() {
- info("Check text on a user+pass notification popup");
-
- yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(notif, "got notification popup");
- // Check the text, which comes from the localized saveLoginText string.
- let notificationText = notif.message;
- let expectedText = "Would you like " + BRAND_SHORT_NAME + " to remember this login?";
- is(expectedText, notificationText, "Checking text: " + notificationText);
- notif.remove();
- });
-
- is(Services.logins.getAllLogins().length, 0, "Should not have any logins yet");
-});
-
-add_task(function* test_checkPSaveText() {
- info("Check text on a pass-only notification popup");
-
- yield testSubmittingLoginForm("subtst_notifications_6.html", function*(fieldValues) {
- is(fieldValues.username, "null", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(notif, "got notification popup");
- // Check the text, which comes from the localized saveLoginTextNoUser string.
- let notificationText = notif.message;
- let expectedText = "Would you like " + BRAND_SHORT_NAME + " to remember this password?";
- is(expectedText, notificationText, "Checking text: " + notificationText);
- notif.remove();
- });
-
- is(Services.logins.getAllLogins().length, 0, "Should not have any logins yet");
-});
-
-add_task(function* test_capture2pw0un() {
- info("Check for notification popup when a form with 2 password fields (no username) " +
- "is submitted and there are no saved logins.");
-
- yield testSubmittingLoginForm("subtst_notifications_2pw_0un.html", function*(fieldValues) {
- is(fieldValues.username, "null", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(notif, "got notification popup");
- notif.remove();
- });
-
- is(Services.logins.getAllLogins().length, 0, "Should not have any logins yet");
-});
-
-add_task(function* test_change2pw0unExistingDifferentUP() {
- info("Check for notification popup when a form with 2 password fields (no username) " +
- "is submitted and there is a saved login with a username and different password.");
-
- Services.logins.addLogin(login1B);
-
- yield testSubmittingLoginForm("subtst_notifications_2pw_0un.html", function*(fieldValues) {
- is(fieldValues.username, "null", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-change");
- ok(notif, "got notification popup");
- notif.remove();
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1B", "Check the username unchanged");
- is(login.password, "notifyp1B", "Check the password unchanged");
- is(login.timesUsed, 1, "Check times used");
-
- Services.logins.removeLogin(login1B);
-});
-
-add_task(function* test_change2pw0unExistingDifferentP() {
- info("Check for notification popup when a form with 2 password fields (no username) " +
- "is submitted and there is a saved login with no username and different password.");
-
- Services.logins.addLogin(login2B);
-
- yield testSubmittingLoginForm("subtst_notifications_2pw_0un.html", function*(fieldValues) {
- is(fieldValues.username, "null", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-change");
- ok(notif, "got notification popup");
- notif.remove();
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "", "Check the username unchanged");
- is(login.password, "notifyp1B", "Check the password unchanged");
- is(login.timesUsed, 1, "Check times used");
-
- Services.logins.removeLogin(login2B);
-});
-
-add_task(function* test_change2pw0unExistingWithSameP() {
- info("Check for no notification popup when a form with 2 password fields (no username) " +
- "is submitted and there is a saved login with a username and the same password.");
-
- Services.logins.addLogin(login2);
-
- yield testSubmittingLoginForm("subtst_notifications_2pw_0un.html", function*(fieldValues) {
- is(fieldValues.username, "null", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-change");
- ok(!notif, "checking for no notification popup");
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "", "Check the username unchanged");
- is(login.password, "notifyp1", "Check the password unchanged");
- is(login.timesUsed, 2, "Check times used incremented");
-
- checkOnlyLoginWasUsedTwice({ justChanged: false });
-
- Services.logins.removeLogin(login2);
-});
-
-add_task(function* test_changeUPLoginOnPUpdateForm() {
- info("Check for change-password popup, u+p login on password update form.");
- Services.logins.addLogin(login1);
-
- yield testSubmittingLoginForm("subtst_notifications_change_p.html", function*(fieldValues) {
- is(fieldValues.username, "null", "Checking submitted username");
- is(fieldValues.password, "pass2", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-change");
- ok(notif, "got notification popup");
-
- yield* checkDoorhangerUsernamePassword("notifyu1", "pass2");
- clickDoorhangerButton(notif, CHANGE_BUTTON);
-
- ok(!getCaptureDoorhanger("password-change"), "popup should be gone");
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1", "Check the username unchanged");
- is(login.password, "pass2", "Check the password changed");
- is(login.timesUsed, 2, "Check times used");
-
- checkOnlyLoginWasUsedTwice({ justChanged: true });
-
- // cleanup
- login1.password = "pass2";
- Services.logins.removeLogin(login1);
- login1.password = "notifyp1";
-});
-
-add_task(function* test_recipeCaptureFields_NewLogin() {
- info("Check that we capture the proper fields when a field recipe is in use.");
-
- yield testSubmittingLoginForm("subtst_notifications_2pw_1un_1text.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(notif, "got notification popup");
-
- // Sanity check, no logins should exist yet.
- let logins = Services.logins.getAllLogins();
- is(logins.length, 0, "Should not have any logins yet");
-
- yield* checkDoorhangerUsernamePassword("notifyu1", "notifyp1");
- clickDoorhangerButton(notif, REMEMBER_BUTTON);
-
- }, "http://example.org"); // The recipe is for example.org
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1", "Check the username unchanged");
- is(login.password, "notifyp1", "Check the password unchanged");
- is(login.timesUsed, 1, "Check times used");
-});
-
-add_task(function* test_recipeCaptureFields_ExistingLogin() {
- info("Check that we capture the proper fields when a field recipe is in use " +
- "and there is a matching login");
-
- yield testSubmittingLoginForm("subtst_notifications_2pw_1un_1text.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(!notif, "checking for no notification popup");
- }, "http://example.org");
-
- checkOnlyLoginWasUsedTwice({ justChanged: false });
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1", "Check the username unchanged");
- is(login.password, "notifyp1", "Check the password unchanged");
- is(login.timesUsed, 2, "Check times used incremented");
-
- Services.logins.removeAllLogins();
-});
-
-add_task(function* test_noShowPasswordOnDismissal() {
- info("Check for no Show Password field when the doorhanger is dismissed");
-
- yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
- info("Opening popup");
- let notif = getCaptureDoorhanger("password-save");
- let { panel } = PopupNotifications;
-
- info("Hiding popup.");
- let promiseHidden = BrowserTestUtils.waitForEvent(panel, "popuphidden");
- panel.hidePopup();
- yield promiseHidden;
-
- info("Clicking on anchor to reshow popup.");
- let promiseShown = BrowserTestUtils.waitForEvent(panel, "popupshown");
- notif.anchorElement.click();
- yield promiseShown;
-
- let passwordVisiblityToggle = panel.querySelector("#password-notification-visibilityToggle");
- is(passwordVisiblityToggle.hidden, true, "Check that the Show Password field is Hidden");
- });
-});
-
-// TODO:
-// * existing login test, form has different password --> change password, no save prompt
diff --git a/toolkit/components/passwordmgr/test/browser/browser_capture_doorhanger_httpsUpgrade.js b/toolkit/components/passwordmgr/test/browser/browser_capture_doorhanger_httpsUpgrade.js
deleted file mode 100644
index 9be0aa631..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_capture_doorhanger_httpsUpgrade.js
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * Test capture popup notifications with HTTPS upgrades
- */
-
-let nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
-let login1 = new nsLoginInfo("http://example.com", "http://example.com", null,
- "notifyu1", "notifyp1", "user", "pass");
-let login1HTTPS = new nsLoginInfo("https://example.com", "https://example.com", null,
- "notifyu1", "notifyp1", "user", "pass");
-
-add_task(function* test_httpsUpgradeCaptureFields_noChange() {
- info("Check that we don't prompt to remember when capturing an upgraded login with no change");
- Services.logins.addLogin(login1);
- // Sanity check the HTTP login exists.
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should have the HTTP login");
-
- yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(!notif, "checking for no notification popup");
- }, "https://example.com"); // This is HTTPS whereas the saved login is HTTP
-
- logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login still");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.hostname, "http://example.com", "Check the hostname is unchanged");
- is(login.username, "notifyu1", "Check the username is unchanged");
- is(login.password, "notifyp1", "Check the password is unchanged");
- is(login.timesUsed, 2, "Check times used increased");
-
- Services.logins.removeLogin(login1);
-});
-
-add_task(function* test_httpsUpgradeCaptureFields_changePW() {
- info("Check that we prompt to change when capturing an upgraded login with a new PW");
- Services.logins.addLogin(login1);
- // Sanity check the HTTP login exists.
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should have the HTTP login");
-
- yield testSubmittingLoginForm("subtst_notifications_8.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "pass2", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-change");
- ok(notif, "checking for a change popup");
-
- yield* checkDoorhangerUsernamePassword("notifyu1", "pass2");
- clickDoorhangerButton(notif, CHANGE_BUTTON);
-
- ok(!getCaptureDoorhanger("password-change"), "popup should be gone");
- }, "https://example.com"); // This is HTTPS whereas the saved login is HTTP
-
- checkOnlyLoginWasUsedTwice({ justChanged: true });
- logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login still");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.hostname, "https://example.com", "Check the hostname is upgraded");
- is(login.formSubmitURL, "https://example.com", "Check the formSubmitURL is upgraded");
- is(login.username, "notifyu1", "Check the username is unchanged");
- is(login.password, "pass2", "Check the password changed");
- is(login.timesUsed, 2, "Check times used increased");
-
- Services.logins.removeAllLogins();
-});
-
-add_task(function* test_httpsUpgradeCaptureFields_captureMatchingHTTP() {
- info("Capture a new HTTP login which matches a stored HTTPS one.");
- Services.logins.addLogin(login1HTTPS);
-
- yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(notif, "got notification popup");
-
- is(Services.logins.getAllLogins().length, 1, "Should only have the HTTPS login");
-
- yield* checkDoorhangerUsernamePassword("notifyu1", "notifyp1");
- clickDoorhangerButton(notif, REMEMBER_BUTTON);
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 2, "Should have both HTTP and HTTPS logins");
- for (let login of logins) {
- login = login.QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1", "Check the username used on the new entry");
- is(login.password, "notifyp1", "Check the password used on the new entry");
- is(login.timesUsed, 1, "Check times used on entry");
- }
-
- info("Make sure Remember took effect and we don't prompt for an existing HTTP login");
- yield testSubmittingLoginForm("subtst_notifications_1.html", function*(fieldValues) {
- is(fieldValues.username, "notifyu1", "Checking submitted username");
- is(fieldValues.password, "notifyp1", "Checking submitted password");
- let notif = getCaptureDoorhanger("password-save");
- ok(!notif, "checking for no notification popup");
- });
-
- logins = Services.logins.getAllLogins();
- is(logins.length, 2, "Should have both HTTP and HTTPS still");
-
- let httpsLogins = LoginHelper.searchLoginsWithObject({
- hostname: "https://example.com",
- });
- is(httpsLogins.length, 1, "Check https logins count");
- let httpsLogin = httpsLogins[0].QueryInterface(Ci.nsILoginMetaInfo);
- ok(httpsLogin.equals(login1HTTPS), "Check HTTPS login didn't change");
- is(httpsLogin.timesUsed, 1, "Check times used");
-
- let httpLogins = LoginHelper.searchLoginsWithObject({
- hostname: "http://example.com",
- });
- is(httpLogins.length, 1, "Check http logins count");
- let httpLogin = httpLogins[0].QueryInterface(Ci.nsILoginMetaInfo);
- ok(httpLogin.equals(login1), "Check HTTP login is as expected");
- is(httpLogin.timesUsed, 2, "Check times used increased");
-
- Services.logins.removeLogin(login1);
- Services.logins.removeLogin(login1HTTPS);
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_capture_doorhanger_window_open.js b/toolkit/components/passwordmgr/test/browser/browser_capture_doorhanger_window_open.js
deleted file mode 100644
index 1bcfec5eb..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_capture_doorhanger_window_open.js
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Test capture popup notifications in content opened by window.open
- */
-
-let nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
-let login1 = new nsLoginInfo("http://mochi.test:8888", "http://mochi.test:8888", null,
- "notifyu1", "notifyp1", "user", "pass");
-let login2 = new nsLoginInfo("http://mochi.test:8888", "http://mochi.test:8888", null,
- "notifyu2", "notifyp2", "user", "pass");
-
-
-function withTestTabUntilStorageChange(aPageFile, aTaskFn) {
- function storageChangedObserved(subject, data) {
- // Watch for actions triggered from a doorhanger (not cleanup tasks with removeLogin)
- if (data == "removeLogin") {
- return false;
- }
- return true;
- }
-
- let storageChangedPromised = TestUtils.topicObserved("passwordmgr-storage-changed",
- storageChangedObserved);
- return BrowserTestUtils.withNewTab({
- gBrowser,
- url: "http://mochi.test:8888" + DIRECTORY_PATH + aPageFile,
- }, function*(browser) {
- ok(true, "loaded " + aPageFile);
- info("running test case task");
- yield* aTaskFn();
- info("waiting for storage change");
- yield storageChangedPromised;
- });
-}
-
-add_task(function* setup() {
- yield SimpleTest.promiseFocus(window);
-});
-
-add_task(function* test_saveChromeHiddenAutoClose() {
- let notifShownPromise = BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown");
- // query arguments are: username, password, features, auto-close (delimited by '|')
- let url = "subtst_notifications_11.html?notifyu1|notifyp1|" +
- "menubar=no,toolbar=no,location=no|autoclose";
- yield withTestTabUntilStorageChange(url, function*() {
- info("waiting for popupshown");
- yield notifShownPromise;
- // the popup closes and the doorhanger should appear in the opener
- let popup = getCaptureDoorhanger("password-save");
- ok(popup, "got notification popup");
- yield* checkDoorhangerUsernamePassword("notifyu1", "notifyp1");
- // Sanity check, no logins should exist yet.
- let logins = Services.logins.getAllLogins();
- is(logins.length, 0, "Should not have any logins yet");
-
- clickDoorhangerButton(popup, REMEMBER_BUTTON);
- });
- // Check result of clicking Remember
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.timesUsed, 1, "Check times used on new entry");
- is(login.username, "notifyu1", "Check the username used on the new entry");
- is(login.password, "notifyp1", "Check the password used on the new entry");
-});
-
-add_task(function* test_changeChromeHiddenAutoClose() {
- let notifShownPromise = BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown");
- let url = "subtst_notifications_11.html?notifyu1|pass2|menubar=no,toolbar=no,location=no|autoclose";
- yield withTestTabUntilStorageChange(url, function*() {
- info("waiting for popupshown");
- yield notifShownPromise;
- let popup = getCaptureDoorhanger("password-change");
- ok(popup, "got notification popup");
- yield* checkDoorhangerUsernamePassword("notifyu1", "pass2");
- clickDoorhangerButton(popup, CHANGE_BUTTON);
- });
-
- // Check to make sure we updated the password, timestamps and use count for
- // the login being changed with this form.
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1", "Check the username");
- is(login.password, "pass2", "Check password changed");
- is(login.timesUsed, 2, "check .timesUsed incremented on change");
- ok(login.timeCreated < login.timeLastUsed, "timeLastUsed bumped");
- ok(login.timeLastUsed == login.timePasswordChanged, "timeUsed == timeChanged");
-
- login1.password = "pass2";
- Services.logins.removeLogin(login1);
- login1.password = "notifyp1";
-});
-
-add_task(function* test_saveChromeVisibleSameWindow() {
- // This test actually opens a new tab in the same window with default browser settings.
- let url = "subtst_notifications_11.html?notifyu2|notifyp2||";
- let notifShownPromise = BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown");
- yield withTestTabUntilStorageChange(url, function*() {
- yield notifShownPromise;
- let popup = getCaptureDoorhanger("password-save");
- ok(popup, "got notification popup");
- yield* checkDoorhangerUsernamePassword("notifyu2", "notifyp2");
- clickDoorhangerButton(popup, REMEMBER_BUTTON);
- yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
- });
-
- // Check result of clicking Remember
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login now");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu2", "Check the username used on the new entry");
- is(login.password, "notifyp2", "Check the password used on the new entry");
- is(login.timesUsed, 1, "Check times used on new entry");
-});
-
-add_task(function* test_changeChromeVisibleSameWindow() {
- let url = "subtst_notifications_11.html?notifyu2|pass2||";
- let notifShownPromise = BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown");
- yield withTestTabUntilStorageChange(url, function*() {
- yield notifShownPromise;
- let popup = getCaptureDoorhanger("password-change");
- ok(popup, "got notification popup");
- yield* checkDoorhangerUsernamePassword("notifyu2", "pass2");
- clickDoorhangerButton(popup, CHANGE_BUTTON);
- yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
- });
-
- // Check to make sure we updated the password, timestamps and use count for
- // the login being changed with this form.
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should have 1 login");
- let login = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu2", "Check the username");
- is(login.password, "pass2", "Check password changed");
- is(login.timesUsed, 2, "check .timesUsed incremented on change");
- ok(login.timeCreated < login.timeLastUsed, "timeLastUsed bumped");
- ok(login.timeLastUsed == login.timePasswordChanged, "timeUsed == timeChanged");
-
- // cleanup
- login2.password = "pass2";
- Services.logins.removeLogin(login2);
- login2.password = "notifyp2";
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_context_menu.js b/toolkit/components/passwordmgr/test/browser/browser_context_menu.js
deleted file mode 100644
index 6cfcaa7c2..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_context_menu.js
+++ /dev/null
@@ -1,432 +0,0 @@
-/*
- * Test the password manager context menu.
- */
-
-/* eslint no-shadow:"off" */
-
-"use strict";
-
-// The hostname for the test URIs.
-const TEST_HOSTNAME = "https://example.com";
-const MULTIPLE_FORMS_PAGE_PATH = "/browser/toolkit/components/passwordmgr/test/browser/multiple_forms.html";
-
-const CONTEXT_MENU = document.getElementById("contentAreaContextMenu");
-const POPUP_HEADER = document.getElementById("fill-login");
-
-/**
- * Initialize logins needed for the tests and disable autofill
- * for login forms for easier testing of manual fill.
- */
-add_task(function* test_initialize() {
- Services.prefs.setBoolPref("signon.autofillForms", false);
- registerCleanupFunction(() => {
- Services.prefs.clearUserPref("signon.autofillForms");
- Services.prefs.clearUserPref("signon.schemeUpgrades");
- });
- for (let login of loginList()) {
- Services.logins.addLogin(login);
- }
-});
-
-/**
- * Check if the context menu is populated with the right
- * menuitems for the target password input field.
- */
-add_task(function* test_context_menu_populate_password_noSchemeUpgrades() {
- Services.prefs.setBoolPref("signon.schemeUpgrades", false);
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: TEST_HOSTNAME + MULTIPLE_FORMS_PAGE_PATH,
- }, function* (browser) {
- yield openPasswordContextMenu(browser, "#test-password-1");
-
- // Check the content of the password manager popup
- let popupMenu = document.getElementById("fill-login-popup");
- checkMenu(popupMenu, 2);
-
- CONTEXT_MENU.hidePopup();
- });
-});
-
-/**
- * Check if the context menu is populated with the right
- * menuitems for the target password input field.
- */
-add_task(function* test_context_menu_populate_password_schemeUpgrades() {
- Services.prefs.setBoolPref("signon.schemeUpgrades", true);
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: TEST_HOSTNAME + MULTIPLE_FORMS_PAGE_PATH,
- }, function* (browser) {
- yield openPasswordContextMenu(browser, "#test-password-1");
-
- // Check the content of the password manager popup
- let popupMenu = document.getElementById("fill-login-popup");
- checkMenu(popupMenu, 3);
-
- CONTEXT_MENU.hidePopup();
- });
-});
-
-/**
- * Check if the context menu is populated with the right menuitems
- * for the target username field with a password field present.
- */
-add_task(function* test_context_menu_populate_username_with_password_noSchemeUpgrades() {
- Services.prefs.setBoolPref("signon.schemeUpgrades", false);
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: TEST_HOSTNAME + "/browser/toolkit/components/" +
- "passwordmgr/test/browser/multiple_forms.html",
- }, function* (browser) {
- yield openPasswordContextMenu(browser, "#test-username-2");
-
- // Check the content of the password manager popup
- let popupMenu = document.getElementById("fill-login-popup");
- checkMenu(popupMenu, 2);
-
- CONTEXT_MENU.hidePopup();
- });
-});
-/**
- * Check if the context menu is populated with the right menuitems
- * for the target username field with a password field present.
- */
-add_task(function* test_context_menu_populate_username_with_password_schemeUpgrades() {
- Services.prefs.setBoolPref("signon.schemeUpgrades", true);
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: TEST_HOSTNAME + "/browser/toolkit/components/" +
- "passwordmgr/test/browser/multiple_forms.html",
- }, function* (browser) {
- yield openPasswordContextMenu(browser, "#test-username-2");
-
- // Check the content of the password manager popup
- let popupMenu = document.getElementById("fill-login-popup");
- checkMenu(popupMenu, 3);
-
- CONTEXT_MENU.hidePopup();
- });
-});
-
-/**
- * Check if the password field is correctly filled when one
- * login menuitem is clicked.
- */
-add_task(function* test_context_menu_password_fill() {
- Services.prefs.setBoolPref("signon.schemeUpgrades", true);
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: TEST_HOSTNAME + MULTIPLE_FORMS_PAGE_PATH,
- }, function* (browser) {
- let formDescriptions = yield ContentTask.spawn(browser, {}, function*() {
- let forms = Array.from(content.document.getElementsByClassName("test-form"));
- return forms.map((f) => f.getAttribute("description"));
- });
-
- for (let description of formDescriptions) {
- info("Testing form: " + description);
-
- let passwordInputIds = yield ContentTask.spawn(browser, {description}, function*({description}) {
- let formElement = content.document.querySelector(`[description="${description}"]`);
- let passwords = Array.from(formElement.querySelectorAll("input[type='password']"));
- return passwords.map((p) => p.id);
- });
-
- for (let inputId of passwordInputIds) {
- info("Testing password field: " + inputId);
-
- // Synthesize a right mouse click over the username input element.
- yield openPasswordContextMenu(browser, "#" + inputId, function*() {
- let inputDisabled = yield ContentTask
- .spawn(browser, {inputId}, function*({inputId}) {
- let input = content.document.getElementById(inputId);
- return input.disabled || input.readOnly;
- });
-
- // If the password field is disabled or read-only, we want to see
- // the disabled Fill Password popup header.
- if (inputDisabled) {
- Assert.ok(!POPUP_HEADER.hidden, "Popup menu is not hidden.");
- Assert.ok(POPUP_HEADER.disabled, "Popup menu is disabled.");
- CONTEXT_MENU.hidePopup();
- }
-
- return !inputDisabled;
- });
-
- if (CONTEXT_MENU.state != "open") {
- continue;
- }
-
- // The only field affected by the password fill
- // should be the target password field itself.
- yield assertContextMenuFill(browser, description, null, inputId, 1);
- yield ContentTask.spawn(browser, {inputId}, function*({inputId}) {
- let passwordField = content.document.getElementById(inputId);
- Assert.equal(passwordField.value, "password1", "Check upgraded login was actually used");
- });
-
- CONTEXT_MENU.hidePopup();
- }
- }
- });
-});
-
-/**
- * Check if the form is correctly filled when one
- * username context menu login menuitem is clicked.
- */
-add_task(function* test_context_menu_username_login_fill() {
- Services.prefs.setBoolPref("signon.schemeUpgrades", true);
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: TEST_HOSTNAME + MULTIPLE_FORMS_PAGE_PATH,
- }, function* (browser) {
-
- let formDescriptions = yield ContentTask.spawn(browser, {}, function*() {
- let forms = Array.from(content.document.getElementsByClassName("test-form"));
- return forms.map((f) => f.getAttribute("description"));
- });
-
- for (let description of formDescriptions) {
- info("Testing form: " + description);
- let usernameInputIds = yield ContentTask
- .spawn(browser, {description}, function*({description}) {
- let formElement = content.document.querySelector(`[description="${description}"]`);
- let inputs = Array.from(formElement.querySelectorAll("input[type='text']"));
- return inputs.map((p) => p.id);
- });
-
- for (let inputId of usernameInputIds) {
- info("Testing username field: " + inputId);
-
- // Synthesize a right mouse click over the username input element.
- yield openPasswordContextMenu(browser, "#" + inputId, function*() {
- let headerHidden = POPUP_HEADER.hidden;
- let headerDisabled = POPUP_HEADER.disabled;
-
- let data = {description, inputId, headerHidden, headerDisabled};
- let shouldContinue = yield ContentTask.spawn(browser, data, function*(data) {
- let {description, inputId, headerHidden, headerDisabled} = data;
- let formElement = content.document.querySelector(`[description="${description}"]`);
- let usernameField = content.document.getElementById(inputId);
- // We always want to check if the first password field is filled,
- // since this is the current behavior from the _fillForm function.
- let passwordField = formElement.querySelector("input[type='password']");
-
- // If we don't want to see the actual popup menu,
- // check if the popup is hidden or disabled.
- if (!passwordField || usernameField.disabled || usernameField.readOnly ||
- passwordField.disabled || passwordField.readOnly) {
- if (!passwordField) {
- Assert.ok(headerHidden, "Popup menu is hidden.");
- } else {
- Assert.ok(!headerHidden, "Popup menu is not hidden.");
- Assert.ok(headerDisabled, "Popup menu is disabled.");
- }
- return false;
- }
- return true;
- });
-
- if (!shouldContinue) {
- CONTEXT_MENU.hidePopup();
- }
-
- return shouldContinue;
- });
-
- if (CONTEXT_MENU.state != "open") {
- continue;
- }
-
- let passwordFieldId = yield ContentTask
- .spawn(browser, {description}, function*({description}) {
- let formElement = content.document.querySelector(`[description="${description}"]`);
- return formElement.querySelector("input[type='password']").id;
- });
-
- // We shouldn't change any field that's not the target username field or the first password field
- yield assertContextMenuFill(browser, description, inputId, passwordFieldId, 1);
-
- yield ContentTask.spawn(browser, {passwordFieldId}, function*({passwordFieldId}) {
- let passwordField = content.document.getElementById(passwordFieldId);
- if (!passwordField.hasAttribute("expectedFail")) {
- Assert.equal(passwordField.value, "password1", "Check upgraded login was actually used");
- }
- });
-
- CONTEXT_MENU.hidePopup();
- }
- }
- });
-});
-
-/**
- * Synthesize mouse clicks to open the password manager context menu popup
- * for a target password input element.
- *
- * assertCallback should return true if we should continue or else false.
- */
-function* openPasswordContextMenu(browser, passwordInput, assertCallback = null) {
- // Synthesize a right mouse click over the password input element.
- let contextMenuShownPromise = BrowserTestUtils.waitForEvent(CONTEXT_MENU, "popupshown");
- let eventDetails = {type: "contextmenu", button: 2};
- BrowserTestUtils.synthesizeMouseAtCenter(passwordInput, eventDetails, browser);
- yield contextMenuShownPromise;
-
- if (assertCallback) {
- let shouldContinue = yield assertCallback();
- if (!shouldContinue) {
- return;
- }
- }
-
- // Synthesize a mouse click over the fill login menu header.
- let popupShownPromise = BrowserTestUtils.waitForEvent(POPUP_HEADER, "popupshown");
- EventUtils.synthesizeMouseAtCenter(POPUP_HEADER, {});
- yield popupShownPromise;
-}
-
-/**
- * Verify that only the expected form fields are filled.
- */
-function* assertContextMenuFill(browser, formId, usernameFieldId, passwordFieldId, loginIndex) {
- let popupMenu = document.getElementById("fill-login-popup");
- let unchangedSelector = `[description="${formId}"] input:not(#${passwordFieldId})`;
-
- if (usernameFieldId) {
- unchangedSelector += `:not(#${usernameFieldId})`;
- }
-
- yield ContentTask.spawn(browser, {unchangedSelector}, function*({unchangedSelector}) {
- let unchangedFields = content.document.querySelectorAll(unchangedSelector);
-
- // Store the value of fields that should remain unchanged.
- if (unchangedFields.length) {
- for (let field of unchangedFields) {
- field.setAttribute("original-value", field.value);
- }
- }
- });
-
- // Execute the default command of the specified login menuitem found in the context menu.
- let loginItem = popupMenu.getElementsByClassName("context-login-item")[loginIndex];
-
- // Find the used login by it's username (Use only unique usernames in this test).
- let {username, password} = getLoginFromUsername(loginItem.label);
-
- let data = {username, password, usernameFieldId, passwordFieldId, formId, unchangedSelector};
- let continuePromise = ContentTask.spawn(browser, data, function*(data) {
- let {username, password, usernameFieldId, passwordFieldId, formId, unchangedSelector} = data;
- let form = content.document.querySelector(`[description="${formId}"]`);
- yield ContentTaskUtils.waitForEvent(form, "input", "Username input value changed");
-
- if (usernameFieldId) {
- let usernameField = content.document.getElementById(usernameFieldId);
-
- // If we have an username field, check if it's correctly filled
- if (usernameField.getAttribute("expectedFail") == null) {
- Assert.equal(username, usernameField.value, "Username filled and correct.");
- }
- }
-
- if (passwordFieldId) {
- let passwordField = content.document.getElementById(passwordFieldId);
-
- // If we have a password field, check if it's correctly filled
- if (passwordField && passwordField.getAttribute("expectedFail") == null) {
- Assert.equal(password, passwordField.value, "Password filled and correct.");
- }
- }
-
- let unchangedFields = content.document.querySelectorAll(unchangedSelector);
-
- // Check that all fields that should not change have the same value as before.
- if (unchangedFields.length) {
- Assert.ok(() => {
- for (let field of unchangedFields) {
- if (field.value != field.getAttribute("original-value")) {
- return false;
- }
- }
- return true;
- }, "Other fields were not changed.");
- }
- });
-
- loginItem.doCommand();
-
- return continuePromise;
-}
-
-/**
- * Check if every login that matches the page hostname are available at the context menu.
- * @param {Element} contextMenu
- * @param {Number} expectedCount - Number of logins expected in the context menu. Used to ensure
-* we continue testing something useful.
- */
-function checkMenu(contextMenu, expectedCount) {
- let logins = loginList().filter(login => {
- return LoginHelper.isOriginMatching(login.hostname, TEST_HOSTNAME, {
- schemeUpgrades: Services.prefs.getBoolPref("signon.schemeUpgrades"),
- });
- });
- // Make an array of menuitems for easier comparison.
- let menuitems = [...CONTEXT_MENU.getElementsByClassName("context-login-item")];
- Assert.equal(menuitems.length, expectedCount, "Expected number of menu items");
- Assert.ok(logins.every(l => menuitems.some(m => l.username == m.label)), "Every login have an item at the menu.");
-}
-
-/**
- * Search for a login by it's username.
- *
- * Only unique login/hostname combinations should be used at this test.
- */
-function getLoginFromUsername(username) {
- return loginList().find(login => login.username == username);
-}
-
-/**
- * List of logins used for the test.
- *
- * We should only use unique usernames in this test,
- * because we need to search logins by username. There is one duplicate u+p combo
- * in order to test de-duping in the menu.
- */
-function loginList() {
- return [
- LoginTestUtils.testData.formLogin({
- hostname: "https://example.com",
- formSubmitURL: "https://example.com",
- username: "username",
- password: "password",
- }),
- // Same as above but HTTP in order to test de-duping.
- LoginTestUtils.testData.formLogin({
- hostname: "http://example.com",
- formSubmitURL: "http://example.com",
- username: "username",
- password: "password",
- }),
- LoginTestUtils.testData.formLogin({
- hostname: "http://example.com",
- formSubmitURL: "http://example.com",
- username: "username1",
- password: "password1",
- }),
- LoginTestUtils.testData.formLogin({
- hostname: "https://example.com",
- formSubmitURL: "https://example.com",
- username: "username2",
- password: "password2",
- }),
- LoginTestUtils.testData.formLogin({
- hostname: "http://example.org",
- formSubmitURL: "http://example.org",
- username: "username-cross-origin",
- password: "password-cross-origin",
- }),
- ];
-}
diff --git a/toolkit/components/passwordmgr/test/browser/browser_context_menu_autocomplete_interaction.js b/toolkit/components/passwordmgr/test/browser/browser_context_menu_autocomplete_interaction.js
deleted file mode 100644
index 1b37e3f79..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_context_menu_autocomplete_interaction.js
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Test the password manager context menu interaction with autocomplete.
- */
-
-"use strict";
-
-const TEST_HOSTNAME = "https://example.com";
-const BASIC_FORM_PAGE_PATH = DIRECTORY_PATH + "form_basic.html";
-
-var gUnexpectedIsTODO = false;
-
-/**
- * Initialize logins needed for the tests and disable autofill
- * for login forms for easier testing of manual fill.
- */
-add_task(function* test_initialize() {
- let autocompletePopup = document.getElementById("PopupAutoComplete");
- Services.prefs.setBoolPref("signon.autofillForms", false);
- registerCleanupFunction(() => {
- Services.prefs.clearUserPref("signon.autofillForms");
- autocompletePopup.removeEventListener("popupshowing", autocompleteUnexpectedPopupShowing);
- });
- for (let login of loginList()) {
- Services.logins.addLogin(login);
- }
- autocompletePopup.addEventListener("popupshowing", autocompleteUnexpectedPopupShowing);
-});
-
-add_task(function* test_context_menu_username() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: TEST_HOSTNAME + BASIC_FORM_PAGE_PATH,
- }, function* (browser) {
- yield openContextMenu(browser, "#form-basic-username");
-
- let contextMenu = document.getElementById("contentAreaContextMenu");
- Assert.equal(contextMenu.state, "open", "Context menu opened");
- contextMenu.hidePopup();
- });
-});
-
-add_task(function* test_context_menu_password() {
- gUnexpectedIsTODO = true;
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: TEST_HOSTNAME + BASIC_FORM_PAGE_PATH,
- }, function* (browser) {
- yield openContextMenu(browser, "#form-basic-password");
-
- let contextMenu = document.getElementById("contentAreaContextMenu");
- Assert.equal(contextMenu.state, "open", "Context menu opened");
- contextMenu.hidePopup();
- });
-});
-
-function autocompleteUnexpectedPopupShowing(event) {
- if (gUnexpectedIsTODO) {
- todo(false, "Autocomplete shouldn't appear");
- } else {
- Assert.ok(false, "Autocomplete shouldn't appear");
- }
- event.target.hidePopup();
-}
-
-/**
- * Synthesize mouse clicks to open the context menu popup
- * for a target login input element.
- */
-function* openContextMenu(browser, loginInput) {
- // First synthesize a mousedown. We need this to get the focus event with the "contextmenu" event.
- let eventDetails1 = {type: "mousedown", button: 2};
- BrowserTestUtils.synthesizeMouseAtCenter(loginInput, eventDetails1, browser);
-
- // Then synthesize the contextmenu click over the input element.
- let contextMenuShownPromise = BrowserTestUtils.waitForEvent(window, "popupshown");
- let eventDetails = {type: "contextmenu", button: 2};
- BrowserTestUtils.synthesizeMouseAtCenter(loginInput, eventDetails, browser);
- yield contextMenuShownPromise;
-
- // Wait to see which popups are shown.
- yield new Promise(resolve => setTimeout(resolve, 1000));
-}
-
-function loginList() {
- return [
- LoginTestUtils.testData.formLogin({
- hostname: "https://example.com",
- formSubmitURL: "https://example.com",
- username: "username",
- password: "password",
- }),
- LoginTestUtils.testData.formLogin({
- hostname: "https://example.com",
- formSubmitURL: "https://example.com",
- username: "username2",
- password: "password2",
- }),
- ];
-}
diff --git a/toolkit/components/passwordmgr/test/browser/browser_context_menu_iframe.js b/toolkit/components/passwordmgr/test/browser/browser_context_menu_iframe.js
deleted file mode 100644
index c5219789d..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_context_menu_iframe.js
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Test the password manager context menu.
- */
-
-"use strict";
-
-const TEST_HOSTNAME = "https://example.com";
-
-// Test with a page that only has a form within an iframe, not in the top-level document
-const IFRAME_PAGE_PATH = "/browser/toolkit/components/passwordmgr/test/browser/form_basic_iframe.html";
-
-/**
- * Initialize logins needed for the tests and disable autofill
- * for login forms for easier testing of manual fill.
- */
-add_task(function* test_initialize() {
- Services.prefs.setBoolPref("signon.autofillForms", false);
- registerCleanupFunction(() => {
- Services.prefs.clearUserPref("signon.autofillForms");
- Services.prefs.clearUserPref("signon.schemeUpgrades");
- });
- for (let login of loginList()) {
- Services.logins.addLogin(login);
- }
-});
-
-/**
- * Check if the password field is correctly filled when it's in an iframe.
- */
-add_task(function* test_context_menu_iframe_fill() {
- Services.prefs.setBoolPref("signon.schemeUpgrades", true);
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: TEST_HOSTNAME + IFRAME_PAGE_PATH
- }, function* (browser) {
- function getPasswordInput() {
- let frame = content.document.getElementById("test-iframe");
- return frame.contentDocument.getElementById("form-basic-password");
- }
-
- let contextMenuShownPromise = BrowserTestUtils.waitForEvent(window, "popupshown");
- let eventDetails = {type: "contextmenu", button: 2};
-
- // To click at the right point we have to take into account the iframe offset.
- // Synthesize a right mouse click over the password input element.
- BrowserTestUtils.synthesizeMouseAtCenter(getPasswordInput, eventDetails, browser);
- yield contextMenuShownPromise;
-
- // Synthesize a mouse click over the fill login menu header.
- let popupHeader = document.getElementById("fill-login");
- let popupShownPromise = BrowserTestUtils.waitForEvent(popupHeader, "popupshown");
- EventUtils.synthesizeMouseAtCenter(popupHeader, {});
- yield popupShownPromise;
-
- let popupMenu = document.getElementById("fill-login-popup");
-
- // Stores the original value of username
- function promiseFrameInputValue(name) {
- return ContentTask.spawn(browser, name, function(inputname) {
- let iframe = content.document.getElementById("test-iframe");
- let input = iframe.contentDocument.getElementById(inputname);
- return input.value;
- });
- }
- let usernameOriginalValue = yield promiseFrameInputValue("form-basic-username");
-
- // Execute the command of the first login menuitem found at the context menu.
- let passwordChangedPromise = ContentTask.spawn(browser, null, function* () {
- let frame = content.document.getElementById("test-iframe");
- let passwordInput = frame.contentDocument.getElementById("form-basic-password");
- yield ContentTaskUtils.waitForEvent(passwordInput, "input");
- });
-
- let firstLoginItem = popupMenu.getElementsByClassName("context-login-item")[0];
- firstLoginItem.doCommand();
-
- yield passwordChangedPromise;
-
- // Find the used login by it's username.
- let login = getLoginFromUsername(firstLoginItem.label);
- let passwordValue = yield promiseFrameInputValue("form-basic-password");
- is(login.password, passwordValue, "Password filled and correct.");
-
- let usernameNewValue = yield promiseFrameInputValue("form-basic-username");
- is(usernameOriginalValue,
- usernameNewValue,
- "Username value was not changed.");
-
- let contextMenu = document.getElementById("contentAreaContextMenu");
- contextMenu.hidePopup();
- });
-});
-
-/**
- * Search for a login by it's username.
- *
- * Only unique login/hostname combinations should be used at this test.
- */
-function getLoginFromUsername(username) {
- return loginList().find(login => login.username == username);
-}
-
-/**
- * List of logins used for the test.
- *
- * We should only use unique usernames in this test,
- * because we need to search logins by username. There is one duplicate u+p combo
- * in order to test de-duping in the menu.
- */
-function loginList() {
- return [
- LoginTestUtils.testData.formLogin({
- hostname: "https://example.com",
- formSubmitURL: "https://example.com",
- username: "username",
- password: "password",
- }),
- // Same as above but HTTP in order to test de-duping.
- LoginTestUtils.testData.formLogin({
- hostname: "http://example.com",
- formSubmitURL: "http://example.com",
- username: "username",
- password: "password",
- }),
- LoginTestUtils.testData.formLogin({
- hostname: "http://example.com",
- formSubmitURL: "http://example.com",
- username: "username1",
- password: "password1",
- }),
- LoginTestUtils.testData.formLogin({
- hostname: "https://example.com",
- formSubmitURL: "https://example.com",
- username: "username2",
- password: "password2",
- }),
- LoginTestUtils.testData.formLogin({
- hostname: "http://example.org",
- formSubmitURL: "http://example.org",
- username: "username-cross-origin",
- password: "password-cross-origin",
- }),
- ];
-}
diff --git a/toolkit/components/passwordmgr/test/browser/browser_exceptions_dialog.js b/toolkit/components/passwordmgr/test/browser/browser_exceptions_dialog.js
deleted file mode 100644
index 09fbe0eea..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_exceptions_dialog.js
+++ /dev/null
@@ -1,56 +0,0 @@
-
-"use strict";
-
-const LOGIN_HOST = "http://example.com";
-
-function openExceptionsDialog() {
- return window.openDialog(
- "chrome://browser/content/preferences/permissions.xul",
- "Toolkit:PasswordManagerExceptions", "",
- {
- blockVisible: true,
- sessionVisible: false,
- allowVisible: false,
- hideStatusColumn: true,
- prefilledHost: "",
- permissionType: "login-saving"
- }
- );
-}
-
-function countDisabledHosts(dialog) {
- let doc = dialog.document;
- let rejectsTree = doc.getElementById("permissionsTree");
-
- return rejectsTree.view.rowCount;
-}
-
-function promiseStorageChanged(expectedData) {
- function observer(subject, data) {
- return data == expectedData && subject.QueryInterface(Ci.nsISupportsString).data == LOGIN_HOST;
- }
-
- return TestUtils.topicObserved("passwordmgr-storage-changed", observer);
-}
-
-add_task(function* test_disable() {
- let dialog = openExceptionsDialog();
- let promiseChanged = promiseStorageChanged("hostSavingDisabled");
-
- yield BrowserTestUtils.waitForEvent(dialog, "load");
- Services.logins.setLoginSavingEnabled(LOGIN_HOST, false);
- yield promiseChanged;
- is(countDisabledHosts(dialog), 1, "Verify disabled host added");
- yield BrowserTestUtils.closeWindow(dialog);
-});
-
-add_task(function* test_enable() {
- let dialog = openExceptionsDialog();
- let promiseChanged = promiseStorageChanged("hostSavingEnabled");
-
- yield BrowserTestUtils.waitForEvent(dialog, "load");
- Services.logins.setLoginSavingEnabled(LOGIN_HOST, true);
- yield promiseChanged;
- is(countDisabledHosts(dialog), 0, "Verify disabled host removed");
- yield BrowserTestUtils.closeWindow(dialog);
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_formless_submit_chrome.js b/toolkit/components/passwordmgr/test/browser/browser_formless_submit_chrome.js
deleted file mode 100644
index c6d9ce50a..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_formless_submit_chrome.js
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * Test that browser chrome UI interactions don't trigger a capture doorhanger.
- */
-
-"use strict";
-
-function* fillTestPage(aBrowser) {
- yield ContentTask.spawn(aBrowser, null, function*() {
- content.document.getElementById("form-basic-username").value = "my_username";
- content.document.getElementById("form-basic-password").value = "my_password";
- });
- info("fields filled");
-}
-
-function* withTestPage(aTaskFn) {
- return BrowserTestUtils.withNewTab({
- gBrowser,
- url: "https://example.com" + DIRECTORY_PATH + "formless_basic.html",
- }, function*(aBrowser) {
- info("tab opened");
- yield fillTestPage(aBrowser);
- yield* aTaskFn(aBrowser);
-
- // Give a chance for the doorhanger to appear
- yield new Promise(resolve => SimpleTest.executeSoon(resolve));
- ok(!getCaptureDoorhanger("any"), "No doorhanger should be present");
- });
-}
-
-add_task(function* setup() {
- yield SimpleTest.promiseFocus(window);
-});
-
-add_task(function* test_urlbar_new_URL() {
- yield withTestPage(function*(aBrowser) {
- gURLBar.value = "";
- let focusPromise = BrowserTestUtils.waitForEvent(gURLBar, "focus");
- gURLBar.focus();
- yield focusPromise;
- info("focused");
- EventUtils.sendString("http://mochi.test:8888/");
- EventUtils.synthesizeKey("VK_RETURN", {});
- yield BrowserTestUtils.browserLoaded(aBrowser, false, "http://mochi.test:8888/");
- });
-});
-
-add_task(function* test_urlbar_fragment_enter() {
- yield withTestPage(function*(aBrowser) {
- gURLBar.focus();
- EventUtils.synthesizeKey("VK_RIGHT", {});
- EventUtils.sendString("#fragment");
- EventUtils.synthesizeKey("VK_RETURN", {});
- });
-});
-
-add_task(function* test_backButton_forwardButton() {
- yield withTestPage(function*(aBrowser) {
- // Load a new page in the tab so we can test going back
- aBrowser.loadURI("https://example.com" + DIRECTORY_PATH + "formless_basic.html?second");
- yield BrowserTestUtils.browserLoaded(aBrowser, false,
- "https://example.com" + DIRECTORY_PATH +
- "formless_basic.html?second");
- yield fillTestPage(aBrowser);
-
- let forwardButton = document.getElementById("forward-button");
- // We need to wait for the forward button transition to complete before we
- // can click it, so we hook up a listener to wait for it to be ready.
- let forwardTransitionPromise = BrowserTestUtils.waitForEvent(forwardButton, "transitionend");
-
- let backPromise = BrowserTestUtils.browserStopped(aBrowser);
- EventUtils.synthesizeMouseAtCenter(document.getElementById("back-button"), {});
- yield backPromise;
-
- // Give a chance for the doorhanger to appear
- yield new Promise(resolve => SimpleTest.executeSoon(resolve));
- ok(!getCaptureDoorhanger("any"), "No doorhanger should be present");
-
- // Now go forward again after filling
- yield fillTestPage(aBrowser);
-
- yield forwardTransitionPromise;
- info("transition done");
- yield BrowserTestUtils.waitForCondition(() => {
- return forwardButton.disabled == false;
- });
- let forwardPromise = BrowserTestUtils.browserStopped(aBrowser);
- info("click the forward button");
- EventUtils.synthesizeMouseAtCenter(forwardButton, {});
- yield forwardPromise;
- });
-});
-
-
-add_task(function* test_reloadButton() {
- yield withTestPage(function*(aBrowser) {
- let reloadButton = document.getElementById("urlbar-reload-button");
- let loadPromise = BrowserTestUtils.browserLoaded(aBrowser, false,
- "https://example.com" + DIRECTORY_PATH +
- "formless_basic.html");
-
- yield BrowserTestUtils.waitForCondition(() => {
- return reloadButton.disabled == false;
- });
- EventUtils.synthesizeMouseAtCenter(reloadButton, {});
- yield loadPromise;
- });
-});
-
-add_task(function* test_back_keyboard_shortcut() {
- if (Services.prefs.getIntPref("browser.backspace_action") != 0) {
- ok(true, "Skipped testing backspace to go back since it's disabled");
- return;
- }
- yield withTestPage(function*(aBrowser) {
- // Load a new page in the tab so we can test going back
- aBrowser.loadURI("https://example.com" + DIRECTORY_PATH + "formless_basic.html?second");
- yield BrowserTestUtils.browserLoaded(aBrowser, false,
- "https://example.com" + DIRECTORY_PATH +
- "formless_basic.html?second");
- yield fillTestPage(aBrowser);
-
- let backPromise = BrowserTestUtils.browserStopped(aBrowser);
- EventUtils.synthesizeKey("VK_BACK_SPACE", {});
- yield backPromise;
- });
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms.js b/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms.js
deleted file mode 100644
index 039312b7d..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Cu.import("resource://gre/modules/LoginManagerParent.jsm", this);
-
-const testUrlPath =
- "://example.com/browser/toolkit/components/passwordmgr/test/browser/";
-
-/**
- * Waits for the given number of occurrences of InsecureLoginFormsStateChange
- * on the given browser element.
- */
-function waitForInsecureLoginFormsStateChange(browser, count) {
- return BrowserTestUtils.waitForEvent(browser, "InsecureLoginFormsStateChange",
- false, () => --count == 0);
-}
-
-/**
- * Checks that hasInsecureLoginForms is true for a simple HTTP page and false
- * for a simple HTTPS page.
- */
-add_task(function* test_simple() {
- for (let scheme of ["http", "https"]) {
- let tab = gBrowser.addTab(scheme + testUrlPath + "form_basic.html");
- let browser = tab.linkedBrowser;
- yield Promise.all([
- BrowserTestUtils.switchTab(gBrowser, tab),
- BrowserTestUtils.browserLoaded(browser),
- // One event is triggered by pageshow and one by DOMFormHasPassword.
- waitForInsecureLoginFormsStateChange(browser, 2),
- ]);
-
- Assert.equal(LoginManagerParent.hasInsecureLoginForms(browser),
- scheme == "http");
-
- gBrowser.removeTab(tab);
- }
-});
-
-/**
- * Checks that hasInsecureLoginForms is true if a password field is present in
- * an HTTP page loaded as a subframe of a top-level HTTPS page, when mixed
- * active content blocking is disabled.
- *
- * When the subframe is navigated to an HTTPS page, hasInsecureLoginForms should
- * be set to false.
- *
- * Moving back in history should set hasInsecureLoginForms to true again.
- */
-add_task(function* test_subframe_navigation() {
- yield new Promise(resolve => SpecialPowers.pushPrefEnv({
- "set": [["security.mixed_content.block_active_content", false]],
- }, resolve));
-
- // Load the page with the subframe in a new tab.
- let tab = gBrowser.addTab("https" + testUrlPath + "insecure_test.html");
- let browser = tab.linkedBrowser;
- yield Promise.all([
- BrowserTestUtils.switchTab(gBrowser, tab),
- BrowserTestUtils.browserLoaded(browser),
- // Two events are triggered by pageshow and one by DOMFormHasPassword.
- waitForInsecureLoginFormsStateChange(browser, 3),
- ]);
-
- Assert.ok(LoginManagerParent.hasInsecureLoginForms(browser));
-
- // Navigate the subframe to a secure page.
- let promiseSubframeReady = Promise.all([
- BrowserTestUtils.browserLoaded(browser, true),
- // One event is triggered by pageshow and one by DOMFormHasPassword.
- waitForInsecureLoginFormsStateChange(browser, 2),
- ]);
- yield ContentTask.spawn(browser, null, function* () {
- content.document.getElementById("test-iframe")
- .contentDocument.getElementById("test-link").click();
- });
- yield promiseSubframeReady;
-
- Assert.ok(!LoginManagerParent.hasInsecureLoginForms(browser));
-
- // Navigate back to the insecure page. We only have to wait for the
- // InsecureLoginFormsStateChange event that is triggered by pageshow.
- let promise = waitForInsecureLoginFormsStateChange(browser, 1);
- yield ContentTask.spawn(browser, null, function* () {
- content.document.getElementById("test-iframe")
- .contentWindow.history.back();
- });
- yield promise;
-
- Assert.ok(LoginManagerParent.hasInsecureLoginForms(browser));
-
- gBrowser.removeTab(tab);
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js b/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js
deleted file mode 100644
index 2dbffb9cc..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_hasInsecureLoginForms_streamConverter.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Cu.import("resource://gre/modules/LoginManagerParent.jsm", this);
-
-function* registerConverter() {
- Cu.import("resource://gre/modules/Services.jsm", this);
- Cu.import("resource://gre/modules/NetUtil.jsm", this);
-
- /**
- * Converts the "test/content" MIME type, served by the test over HTTP, to an
- * HTML viewer page containing the "form_basic.html" code. The viewer is
- * served from a "resource:" URI while keeping the "resource:" principal.
- */
- function TestStreamConverter() {}
-
- TestStreamConverter.prototype = {
- classID: Components.ID("{5f01d6ef-c090-45a4-b3e5-940d64713eb7}"),
- contractID: "@mozilla.org/streamconv;1?from=test/content&to=*/*",
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsIRequestObserver,
- Ci.nsIStreamListener,
- Ci.nsIStreamConverter,
- ]),
-
- // nsIStreamConverter
- convert() {},
-
- // nsIStreamConverter
- asyncConvertData(aFromType, aToType, aListener, aCtxt) {
- this.listener = aListener;
- },
-
- // nsIRequestObserver
- onStartRequest(aRequest, aContext) {
- let channel = NetUtil.newChannel({
- uri: "resource://testing-common/form_basic.html",
- loadUsingSystemPrincipal: true,
- });
- channel.originalURI = aRequest.QueryInterface(Ci.nsIChannel).URI;
- channel.loadGroup = aRequest.loadGroup;
- channel.owner = Services.scriptSecurityManager
- .createCodebasePrincipal(channel.URI, {});
- // In this test, we pass the new channel to the listener but don't fire a
- // redirect notification, even if it would be required. This keeps the
- // test code simpler and doesn't impact the principal check we're testing.
- channel.asyncOpen2(this.listener);
- },
-
- // nsIRequestObserver
- onStopRequest() {},
-
- // nsIStreamListener
- onDataAvailable() {},
- };
-
- let factory = XPCOMUtils._getFactory(TestStreamConverter);
- let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
- registrar.registerFactory(TestStreamConverter.prototype.classID, "",
- TestStreamConverter.prototype.contractID, factory);
- this.cleanupFunction = function () {
- registrar.unregisterFactory(TestStreamConverter.prototype.classID, factory);
- };
-}
-
-/**
- * Waits for the given number of occurrences of InsecureLoginFormsStateChange
- * on the given browser element.
- */
-function waitForInsecureLoginFormsStateChange(browser, count) {
- return BrowserTestUtils.waitForEvent(browser, "InsecureLoginFormsStateChange",
- false, () => --count == 0);
-}
-
-/**
- * Checks that hasInsecureLoginForms is false for a viewer served internally
- * using a "resource:" URI.
- */
-add_task(function* test_streamConverter() {
- let originalBrowser = gBrowser.selectedTab.linkedBrowser;
-
- yield ContentTask.spawn(originalBrowser, null, registerConverter);
-
- let tab = gBrowser.addTab("http://example.com/browser/toolkit/components/" +
- "passwordmgr/test/browser/streamConverter_content.sjs",
- { relatedBrowser: originalBrowser.linkedBrowser });
- let browser = tab.linkedBrowser;
- yield Promise.all([
- BrowserTestUtils.switchTab(gBrowser, tab),
- BrowserTestUtils.browserLoaded(browser),
- // One event is triggered by pageshow and one by DOMFormHasPassword.
- waitForInsecureLoginFormsStateChange(browser, 2),
- ]);
-
- Assert.ok(!LoginManagerParent.hasInsecureLoginForms(browser));
-
- yield BrowserTestUtils.removeTab(tab);
-
- yield ContentTask.spawn(originalBrowser, null, function* () {
- this.cleanupFunction();
- });
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_http_autofill.js b/toolkit/components/passwordmgr/test/browser/browser_http_autofill.js
deleted file mode 100644
index beb928a34..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_http_autofill.js
+++ /dev/null
@@ -1,78 +0,0 @@
-const TEST_URL_PATH = "://example.org/browser/toolkit/components/passwordmgr/test/browser/";
-
-add_task(function* setup() {
- let login = LoginTestUtils.testData.formLogin({
- hostname: "http://example.org",
- formSubmitURL: "http://example.org",
- username: "username",
- password: "password",
- });
- Services.logins.addLogin(login);
- login = LoginTestUtils.testData.formLogin({
- hostname: "http://example.org",
- formSubmitURL: "http://another.domain",
- username: "username",
- password: "password",
- });
- Services.logins.addLogin(login);
- yield SpecialPowers.pushPrefEnv({ "set": [["signon.autofillForms.http", false]] });
-});
-
-add_task(function* test_http_autofill() {
- for (let scheme of ["http", "https"]) {
- let tab = yield BrowserTestUtils
- .openNewForegroundTab(gBrowser, `${scheme}${TEST_URL_PATH}form_basic.html`);
-
- let [username, password] = yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
- let doc = content.document;
- let contentUsername = doc.getElementById("form-basic-username").value;
- let contentPassword = doc.getElementById("form-basic-password").value;
- return [contentUsername, contentPassword];
- });
-
- is(username, scheme == "http" ? "" : "username", "Username filled correctly");
- is(password, scheme == "http" ? "" : "password", "Password filled correctly");
-
- gBrowser.removeTab(tab);
- }
-});
-
-add_task(function* test_iframe_in_http_autofill() {
- for (let scheme of ["http", "https"]) {
- let tab = yield BrowserTestUtils
- .openNewForegroundTab(gBrowser, `${scheme}${TEST_URL_PATH}form_basic_iframe.html`);
-
- let [username, password] = yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
- let doc = content.document;
- let iframe = doc.getElementById("test-iframe");
- let contentUsername = iframe.contentWindow.document.getElementById("form-basic-username").value;
- let contentPassword = iframe.contentWindow.document.getElementById("form-basic-password").value;
- return [contentUsername, contentPassword];
- });
-
- is(username, scheme == "http" ? "" : "username", "Username filled correctly");
- is(password, scheme == "http" ? "" : "password", "Password filled correctly");
-
- gBrowser.removeTab(tab);
- }
-});
-
-add_task(function* test_http_action_autofill() {
- for (let type of ["insecure", "secure"]) {
- let tab = yield BrowserTestUtils
- .openNewForegroundTab(gBrowser, `https${TEST_URL_PATH}form_cross_origin_${type}_action.html`);
-
- let [username, password] = yield ContentTask.spawn(gBrowser.selectedBrowser, null, function* () {
- let doc = content.document;
- let contentUsername = doc.getElementById("form-basic-username").value;
- let contentPassword = doc.getElementById("form-basic-password").value;
- return [contentUsername, contentPassword];
- });
-
- is(username, type == "insecure" ? "" : "username", "Username filled correctly");
- is(password, type == "insecure" ? "" : "password", "Password filled correctly");
-
- gBrowser.removeTab(tab);
- }
-});
-
diff --git a/toolkit/components/passwordmgr/test/browser/browser_insecurePasswordConsoleWarning.js b/toolkit/components/passwordmgr/test/browser/browser_insecurePasswordConsoleWarning.js
deleted file mode 100644
index f16ae1b98..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_insecurePasswordConsoleWarning.js
+++ /dev/null
@@ -1,94 +0,0 @@
-"use strict";
-
-const WARNING_PATTERN = [{
- key: "INSECURE_FORM_ACTION",
- msg: 'JavaScript Warning: "Password fields present in a form with an insecure (http://) form action. This is a security risk that allows user login credentials to be stolen."'
-}, {
- key: "INSECURE_PAGE",
- msg: 'JavaScript Warning: "Password fields present on an insecure (http://) page. This is a security risk that allows user login credentials to be stolen."'
-}];
-
-add_task(function* testInsecurePasswordWarning() {
- let warningPatternHandler;
-
- function messageHandler(msgObj) {
- function findWarningPattern(msg) {
- return WARNING_PATTERN.find(patternPair => {
- return msg.indexOf(patternPair.msg) !== -1;
- });
- }
-
- let warning = findWarningPattern(msgObj.message);
-
- // Only handle the insecure password related warning messages.
- if (warning) {
- // Prevent any unexpected or redundant matched warning message coming after
- // the test case is ended.
- ok(warningPatternHandler, "Invoke a valid warning message handler");
- warningPatternHandler(warning, msgObj.message);
- }
- }
- Services.console.registerListener(messageHandler);
- registerCleanupFunction(function() {
- Services.console.unregisterListener(messageHandler);
- });
-
- for (let [origin, testFile, expectWarnings] of [
- ["http://127.0.0.1", "form_basic.html", []],
- ["http://127.0.0.1", "formless_basic.html", []],
- ["http://example.com", "form_basic.html", ["INSECURE_PAGE"]],
- ["http://example.com", "formless_basic.html", ["INSECURE_PAGE"]],
- ["https://example.com", "form_basic.html", []],
- ["https://example.com", "formless_basic.html", []],
-
- // For a form with customized action link in the same origin.
- ["http://127.0.0.1", "form_same_origin_action.html", []],
- ["http://example.com", "form_same_origin_action.html", ["INSECURE_PAGE"]],
- ["https://example.com", "form_same_origin_action.html", []],
-
- // For a form with an insecure (http) customized action link.
- ["http://127.0.0.1", "form_cross_origin_insecure_action.html", ["INSECURE_FORM_ACTION"]],
- ["http://example.com", "form_cross_origin_insecure_action.html", ["INSECURE_PAGE"]],
- ["https://example.com", "form_cross_origin_insecure_action.html", ["INSECURE_FORM_ACTION"]],
-
- // For a form with a secure (https) customized action link.
- ["http://127.0.0.1", "form_cross_origin_secure_action.html", []],
- ["http://example.com", "form_cross_origin_secure_action.html", ["INSECURE_PAGE"]],
- ["https://example.com", "form_cross_origin_secure_action.html", []],
- ]) {
- let testURL = origin + DIRECTORY_PATH + testFile;
- let promiseConsoleMessages = new Promise(resolve => {
- warningPatternHandler = function (warning, originMessage) {
- ok(warning, "Handling a warning pattern");
- let fullMessage = `[${warning.msg} {file: "${testURL}" line: 0 column: 0 source: "0"}]`;
- is(originMessage, fullMessage, "Message full matched:" + originMessage);
-
- let index = expectWarnings.indexOf(warning.key);
- isnot(index, -1, "Found warning: " + warning.key + " for URL:" + testURL);
- if (index !== -1) {
- // Remove the shown message.
- expectWarnings.splice(index, 1);
- }
- if (expectWarnings.length === 0) {
- info("All warnings are shown for URL:" + testURL);
- resolve();
- }
- };
- });
-
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: testURL
- }, function*() {
- if (expectWarnings.length === 0) {
- info("All warnings are shown for URL:" + testURL);
- return Promise.resolve();
- }
- return promiseConsoleMessages;
- });
-
- // Remove warningPatternHandler to stop handling the matched warning pattern
- // and the task should not get any warning anymore.
- warningPatternHandler = null;
- }
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_master_password_autocomplete.js b/toolkit/components/passwordmgr/test/browser/browser_master_password_autocomplete.js
deleted file mode 100644
index f3bc62b0a..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_master_password_autocomplete.js
+++ /dev/null
@@ -1,59 +0,0 @@
-const HOST = "https://example.com";
-const URL = HOST + "/browser/toolkit/components/passwordmgr/test/browser/form_basic.html";
-const TIMEOUT_PREF = "signon.masterPasswordReprompt.timeout_ms";
-
-// Waits for the master password prompt and cancels it.
-function waitForDialog() {
- let dialogShown = TestUtils.topicObserved("common-dialog-loaded");
- return dialogShown.then(function([subject]) {
- let dialog = subject.Dialog;
- is(dialog.args.title, "Password Required");
- dialog.ui.button1.click();
- });
-}
-
-// Test that autocomplete does not trigger a master password prompt
-// for a certain time after it was cancelled.
-add_task(function* test_mpAutocompleteTimeout() {
- let login = LoginTestUtils.testData.formLogin({
- hostname: "https://example.com",
- formSubmitURL: "https://example.com",
- username: "username",
- password: "password",
- });
- Services.logins.addLogin(login);
- LoginTestUtils.masterPassword.enable();
-
- registerCleanupFunction(function() {
- LoginTestUtils.masterPassword.disable();
- Services.logins.removeAllLogins();
- });
-
- // Set master password prompt timeout to 3s.
- // If this test goes intermittent, you likely have to increase this value.
- yield SpecialPowers.pushPrefEnv({set: [[TIMEOUT_PREF, 3000]]});
-
- // Wait for initial master password dialog after opening the tab.
- let dialogShown = waitForDialog();
-
- yield BrowserTestUtils.withNewTab(URL, function*(browser) {
- yield dialogShown;
-
- yield ContentTask.spawn(browser, null, function*() {
- // Focus the password field to trigger autocompletion.
- content.document.getElementById("form-basic-password").focus();
- });
-
- // Wait 4s, dialog should not have been shown
- // (otherwise the code below will not work).
- yield new Promise((c) => setTimeout(c, 4000));
-
- dialogShown = waitForDialog();
- yield ContentTask.spawn(browser, null, function*() {
- // Re-focus the password field to trigger autocompletion.
- content.document.getElementById("form-basic-username").focus();
- content.document.getElementById("form-basic-password").focus();
- });
- yield dialogShown;
- });
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_notifications.js b/toolkit/components/passwordmgr/test/browser/browser_notifications.js
deleted file mode 100644
index 4fb012f14..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_notifications.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * Test that the doorhanger notification for password saving is populated with
- * the correct values in various password capture cases.
- */
-add_task(function* test_save_change() {
- let testCases = [{
- username: "username",
- password: "password",
- }, {
- username: "",
- password: "password",
- }, {
- username: "username",
- oldPassword: "password",
- password: "newPassword",
- }, {
- username: "",
- oldPassword: "password",
- password: "newPassword",
- }];
-
- for (let { username, oldPassword, password } of testCases) {
- // Add a login for the origin of the form if testing a change notification.
- if (oldPassword) {
- Services.logins.addLogin(LoginTestUtils.testData.formLogin({
- hostname: "https://example.com",
- formSubmitURL: "https://example.com",
- username,
- password: oldPassword,
- }));
- }
-
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "https://example.com/browser/toolkit/components/" +
- "passwordmgr/test/browser/form_basic.html",
- }, function* (browser) {
- // Submit the form in the content page with the credentials from the test
- // case. This will cause the doorhanger notification to be displayed.
- let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
- "popupshown",
- (event) => event.target == PopupNotifications.panel);
- yield ContentTask.spawn(browser, [username, password],
- function* ([contentUsername, contentPassword]) {
- let doc = content.document;
- doc.getElementById("form-basic-username").value = contentUsername;
- doc.getElementById("form-basic-password").value = contentPassword;
- doc.getElementById("form-basic").submit();
- });
- yield promiseShown;
- let notificationElement = PopupNotifications.panel.childNodes[0];
- // Style flush to make sure binding is attached
- notificationElement.querySelector("#password-notification-password").clientTop;
-
- // Check the actual content of the popup notification.
- Assert.equal(notificationElement.querySelector("#password-notification-username")
- .value, username);
- Assert.equal(notificationElement.querySelector("#password-notification-password")
- .value, password);
-
- // Simulate the action on the notification to request the login to be
- // saved, and wait for the data to be updated or saved based on the type
- // of operation we expect.
- let expectedNotification = oldPassword ? "modifyLogin" : "addLogin";
- let promiseLogin = TestUtils.topicObserved("passwordmgr-storage-changed",
- (_, data) => data == expectedNotification);
- notificationElement.button.doCommand();
- let [result] = yield promiseLogin;
-
- // Check that the values in the database match the expected values.
- let login = oldPassword ? result.QueryInterface(Ci.nsIArray)
- .queryElementAt(1, Ci.nsILoginInfo)
- : result.QueryInterface(Ci.nsILoginInfo);
- Assert.equal(login.username, username);
- Assert.equal(login.password, password);
- });
-
- // Clean up the database before the next test case is executed.
- Services.logins.removeAllLogins();
- }
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_notifications_2.js b/toolkit/components/passwordmgr/test/browser/browser_notifications_2.js
deleted file mode 100644
index 48c73b0e6..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_notifications_2.js
+++ /dev/null
@@ -1,125 +0,0 @@
-add_task(function* setup() {
- yield SpecialPowers.pushPrefEnv({"set": [
- ["signon.rememberSignons.visibilityToggle", true]
- ]});
-});
-
-/**
- * Test that the doorhanger main action button is disabled
- * when the password field is empty.
- *
- * Also checks that submiting an empty password throws an error.
- */
-add_task(function* test_empty_password() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "https://example.com/browser/toolkit/components/" +
- "passwordmgr/test/browser/form_basic.html",
- }, function* (browser) {
- // Submit the form in the content page with the credentials from the test
- // case. This will cause the doorhanger notification to be displayed.
- let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
- "popupshown",
- (event) => event.target == PopupNotifications.panel);
- yield ContentTask.spawn(browser, null,
- function* () {
- let doc = content.document;
- doc.getElementById("form-basic-username").value = "username";
- doc.getElementById("form-basic-password").value = "p";
- doc.getElementById("form-basic").submit();
- });
- yield promiseShown;
-
- let notificationElement = PopupNotifications.panel.childNodes[0];
- let passwordTextbox = notificationElement.querySelector("#password-notification-password");
- let toggleCheckbox = notificationElement.querySelector("#password-notification-visibilityToggle");
-
- // Synthesize input to empty the field
- passwordTextbox.focus();
- yield EventUtils.synthesizeKey("VK_RIGHT", {});
- yield EventUtils.synthesizeKey("VK_BACK_SPACE", {});
-
- let mainActionButton = document.getAnonymousElementByAttribute(notificationElement.button, "anonid", "button");
- Assert.ok(mainActionButton.disabled, "Main action button is disabled");
-
- // Makes sure submiting an empty password throws an error
- Assert.throws(notificationElement.button.doCommand(),
- "Can't add a login with a null or empty password.",
- "Should fail for an empty password");
- });
-});
-
-/**
- * Test that the doorhanger password field shows plain or * text
- * when the checkbox is checked.
- */
-add_task(function* test_toggle_password() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "https://example.com/browser/toolkit/components/" +
- "passwordmgr/test/browser/form_basic.html",
- }, function* (browser) {
- // Submit the form in the content page with the credentials from the test
- // case. This will cause the doorhanger notification to be displayed.
- let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
- "popupshown",
- (event) => event.target == PopupNotifications.panel);
- yield ContentTask.spawn(browser, null,
- function* () {
- let doc = content.document;
- doc.getElementById("form-basic-username").value = "username";
- doc.getElementById("form-basic-password").value = "p";
- doc.getElementById("form-basic").submit();
- });
- yield promiseShown;
-
- let notificationElement = PopupNotifications.panel.childNodes[0];
- let passwordTextbox = notificationElement.querySelector("#password-notification-password");
- let toggleCheckbox = notificationElement.querySelector("#password-notification-visibilityToggle");
-
- yield EventUtils.synthesizeMouseAtCenter(toggleCheckbox, {});
- Assert.ok(toggleCheckbox.checked);
- Assert.equal(passwordTextbox.type, "", "Password textbox changed to plain text");
-
- yield EventUtils.synthesizeMouseAtCenter(toggleCheckbox, {});
- Assert.ok(!toggleCheckbox.checked);
- Assert.equal(passwordTextbox.type, "password", "Password textbox changed to * text");
- });
-});
-
-/**
- * Test that the doorhanger password toggle checkbox is disabled
- * when the master password is set.
- */
-add_task(function* test_checkbox_disabled_if_has_master_password() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "https://example.com/browser/toolkit/components/" +
- "passwordmgr/test/browser/form_basic.html",
- }, function* (browser) {
- // Submit the form in the content page with the credentials from the test
- // case. This will cause the doorhanger notification to be displayed.
- let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
- "popupshown",
- (event) => event.target == PopupNotifications.panel);
-
- LoginTestUtils.masterPassword.enable();
-
- yield ContentTask.spawn(browser, null, function* () {
- let doc = content.document;
- doc.getElementById("form-basic-username").value = "username";
- doc.getElementById("form-basic-password").value = "p";
- doc.getElementById("form-basic").submit();
- });
- yield promiseShown;
-
- let notificationElement = PopupNotifications.panel.childNodes[0];
- let passwordTextbox = notificationElement.querySelector("#password-notification-password");
- let toggleCheckbox = notificationElement.querySelector("#password-notification-visibilityToggle");
-
- Assert.equal(passwordTextbox.type, "password", "Password textbox should show * text");
- Assert.ok(toggleCheckbox.getAttribute("hidden"), "checkbox is hidden when master password is set");
- });
-
- LoginTestUtils.masterPassword.disable();
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_notifications_password.js b/toolkit/components/passwordmgr/test/browser/browser_notifications_password.js
deleted file mode 100644
index 8ac49dac5..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_notifications_password.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/**
- * Test changing the password inside the doorhanger notification for passwords.
- *
- * We check the following cases:
- * - Editing the password of a new login.
- * - Editing the password of an existing login.
- * - Changing both username and password to an existing login.
- * - Changing the username to an existing login.
- * - Editing username to an empty one and a new password.
- *
- * If both the username and password matches an already existing login, we should not
- * update it's password, but only it's usage timestamp and count.
- */
-add_task(function* test_edit_password() {
- let testCases = [{
- usernameInPage: "username",
- passwordInPage: "password",
- passwordChangedTo: "newPassword",
- timesUsed: 1,
- }, {
- usernameInPage: "username",
- usernameInPageExists: true,
- passwordInPage: "password",
- passwordInStorage: "oldPassword",
- passwordChangedTo: "newPassword",
- timesUsed: 2,
- }, {
- usernameInPage: "username",
- usernameChangedTo: "newUsername",
- usernameChangedToExists: true,
- passwordInPage: "password",
- passwordChangedTo: "newPassword",
- timesUsed: 2,
- }, {
- usernameInPage: "username",
- usernameChangedTo: "newUsername",
- usernameChangedToExists: true,
- passwordInPage: "password",
- passwordChangedTo: "password",
- timesUsed: 2,
- checkPasswordNotUpdated: true,
- }, {
- usernameInPage: "newUsername",
- usernameChangedTo: "",
- usernameChangedToExists: true,
- passwordInPage: "password",
- passwordChangedTo: "newPassword",
- timesUsed: 2,
- }];
-
- for (let testCase of testCases) {
- info("Test case: " + JSON.stringify(testCase));
-
- // Create the pre-existing logins when needed.
- if (testCase.usernameInPageExists) {
- Services.logins.addLogin(LoginTestUtils.testData.formLogin({
- hostname: "https://example.com",
- formSubmitURL: "https://example.com",
- username: testCase.usernameInPage,
- password: testCase.passwordInStorage,
- }));
- }
-
- if (testCase.usernameChangedToExists) {
- Services.logins.addLogin(LoginTestUtils.testData.formLogin({
- hostname: "https://example.com",
- formSubmitURL: "https://example.com",
- username: testCase.usernameChangedTo,
- password: testCase.passwordChangedTo,
- }));
- }
-
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "https://example.com/browser/toolkit/components/" +
- "passwordmgr/test/browser/form_basic.html",
- }, function* (browser) {
- // Submit the form in the content page with the credentials from the test
- // case. This will cause the doorhanger notification to be displayed.
- let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
- "popupshown",
- (event) => event.target == PopupNotifications.panel);
- yield ContentTask.spawn(browser, testCase,
- function* (contentTestCase) {
- let doc = content.document;
- doc.getElementById("form-basic-username").value = contentTestCase.usernameInPage;
- doc.getElementById("form-basic-password").value = contentTestCase.passwordInPage;
- doc.getElementById("form-basic").submit();
- });
- yield promiseShown;
- let notificationElement = PopupNotifications.panel.childNodes[0];
- // Style flush to make sure binding is attached
- notificationElement.querySelector("#password-notification-password").clientTop;
-
- // Modify the username in the dialog if requested.
- if (testCase.usernameChangedTo) {
- notificationElement.querySelector("#password-notification-username")
- .value = testCase.usernameChangedTo;
- }
-
- // Modify the password in the dialog if requested.
- if (testCase.passwordChangedTo) {
- notificationElement.querySelector("#password-notification-password")
- .value = testCase.passwordChangedTo;
- }
-
- // We expect a modifyLogin notification if the final username used by the
- // dialog exists in the logins database, otherwise an addLogin one.
- let expectModifyLogin = typeof testCase.usernameChangedTo !== "undefined"
- ? testCase.usernameChangedToExists
- : testCase.usernameInPageExists;
-
- // Simulate the action on the notification to request the login to be
- // saved, and wait for the data to be updated or saved based on the type
- // of operation we expect.
- let expectedNotification = expectModifyLogin ? "modifyLogin" : "addLogin";
- let promiseLogin = TestUtils.topicObserved("passwordmgr-storage-changed",
- (_, data) => data == expectedNotification);
- notificationElement.button.doCommand();
- let [result] = yield promiseLogin;
-
- // Check that the values in the database match the expected values.
- let login = expectModifyLogin ? result.QueryInterface(Ci.nsIArray)
- .queryElementAt(1, Ci.nsILoginInfo)
- : result.QueryInterface(Ci.nsILoginInfo);
-
- Assert.equal(login.username, testCase.usernameChangedTo ||
- testCase.usernameInPage);
- Assert.equal(login.password, testCase.passwordChangedTo ||
- testCase.passwordInPage);
-
- let meta = login.QueryInterface(Ci.nsILoginMetaInfo);
- Assert.equal(meta.timesUsed, testCase.timesUsed);
-
- // Check that the password was not updated if the user is empty
- if (testCase.checkPasswordNotUpdated) {
- Assert.ok(meta.timeLastUsed > meta.timeCreated);
- Assert.ok(meta.timeCreated == meta.timePasswordChanged);
- }
- });
-
- // Clean up the database before the next test case is executed.
- Services.logins.removeAllLogins();
- }
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_notifications_username.js b/toolkit/components/passwordmgr/test/browser/browser_notifications_username.js
deleted file mode 100644
index 2c9ea2607..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_notifications_username.js
+++ /dev/null
@@ -1,119 +0,0 @@
-/**
- * Test changing the username inside the doorhanger notification for passwords.
- *
- * We have to test combination of existing and non-existing logins both for
- * the original one from the webpage and the final one used by the dialog.
- *
- * We also check switching to and from empty usernames.
- */
-add_task(function* test_edit_username() {
- let testCases = [{
- usernameInPage: "username",
- usernameChangedTo: "newUsername",
- }, {
- usernameInPage: "username",
- usernameInPageExists: true,
- usernameChangedTo: "newUsername",
- }, {
- usernameInPage: "username",
- usernameChangedTo: "newUsername",
- usernameChangedToExists: true,
- }, {
- usernameInPage: "username",
- usernameInPageExists: true,
- usernameChangedTo: "newUsername",
- usernameChangedToExists: true,
- }, {
- usernameInPage: "",
- usernameChangedTo: "newUsername",
- }, {
- usernameInPage: "newUsername",
- usernameChangedTo: "",
- }, {
- usernameInPage: "",
- usernameChangedTo: "newUsername",
- usernameChangedToExists: true,
- }, {
- usernameInPage: "newUsername",
- usernameChangedTo: "",
- usernameChangedToExists: true,
- }];
-
- for (let testCase of testCases) {
- info("Test case: " + JSON.stringify(testCase));
-
- // Create the pre-existing logins when needed.
- if (testCase.usernameInPageExists) {
- Services.logins.addLogin(LoginTestUtils.testData.formLogin({
- hostname: "https://example.com",
- formSubmitURL: "https://example.com",
- username: testCase.usernameInPage,
- password: "old password",
- }));
- }
-
- if (testCase.usernameChangedToExists) {
- Services.logins.addLogin(LoginTestUtils.testData.formLogin({
- hostname: "https://example.com",
- formSubmitURL: "https://example.com",
- username: testCase.usernameChangedTo,
- password: "old password",
- }));
- }
-
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "https://example.com/browser/toolkit/components/" +
- "passwordmgr/test/browser/form_basic.html",
- }, function* (browser) {
- // Submit the form in the content page with the credentials from the test
- // case. This will cause the doorhanger notification to be displayed.
- let promiseShown = BrowserTestUtils.waitForEvent(PopupNotifications.panel,
- "popupshown",
- (event) => event.target == PopupNotifications.panel);
- yield ContentTask.spawn(browser, testCase.usernameInPage,
- function* (usernameInPage) {
- let doc = content.document;
- doc.getElementById("form-basic-username").value = usernameInPage;
- doc.getElementById("form-basic-password").value = "password";
- doc.getElementById("form-basic").submit();
- });
- yield promiseShown;
- let notificationElement = PopupNotifications.panel.childNodes[0];
- // Style flush to make sure binding is attached
- notificationElement.querySelector("#password-notification-password").clientTop;
-
- // Modify the username in the dialog if requested.
- if (testCase.usernameChangedTo) {
- notificationElement.querySelector("#password-notification-username")
- .value = testCase.usernameChangedTo;
- }
-
- // We expect a modifyLogin notification if the final username used by the
- // dialog exists in the logins database, otherwise an addLogin one.
- let expectModifyLogin = testCase.usernameChangedTo
- ? testCase.usernameChangedToExists
- : testCase.usernameInPageExists;
-
- // Simulate the action on the notification to request the login to be
- // saved, and wait for the data to be updated or saved based on the type
- // of operation we expect.
- let expectedNotification = expectModifyLogin ? "modifyLogin" : "addLogin";
- let promiseLogin = TestUtils.topicObserved("passwordmgr-storage-changed",
- (_, data) => data == expectedNotification);
- notificationElement.button.doCommand();
- let [result] = yield promiseLogin;
-
- // Check that the values in the database match the expected values.
- let login = expectModifyLogin ? result.QueryInterface(Ci.nsIArray)
- .queryElementAt(1, Ci.nsILoginInfo)
- : result.QueryInterface(Ci.nsILoginInfo);
- Assert.equal(login.username, testCase.usernameChangedTo ||
- testCase.usernameInPage);
- Assert.equal(login.password, "password");
- });
-
- // Clean up the database before the next test case is executed.
- Services.logins.removeAllLogins();
- }
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_contextmenu.js b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_contextmenu.js
deleted file mode 100644
index ece2b731f..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_contextmenu.js
+++ /dev/null
@@ -1,100 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function test() {
- waitForExplicitFinish();
-
- Services.logins.removeAllLogins();
-
- // Add some initial logins
- let urls = [
- "http://example.com/",
- "http://mozilla.org/",
- "http://spreadfirefox.com/",
- "https://support.mozilla.org/",
- "http://hg.mozilla.org/"
- ];
- let nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
- let logins = [
- new nsLoginInfo(urls[0], urls[0], null, "", "o hai", "u1", "p1"),
- new nsLoginInfo(urls[1], urls[1], null, "ehsan", "coded", "u2", "p2"),
- new nsLoginInfo(urls[2], urls[2], null, "this", "awesome", "u3", "p3"),
- new nsLoginInfo(urls[3], urls[3], null, "array of", "logins", "u4", "p4"),
- new nsLoginInfo(urls[4], urls[4], null, "then", "i wrote the test", "u5", "p5")
- ];
- logins.forEach(login => Services.logins.addLogin(login));
-
- // Open the password manager dialog
- const PWMGR_DLG = "chrome://passwordmgr/content/passwordManager.xul";
- let pwmgrdlg = window.openDialog(PWMGR_DLG, "Toolkit:PasswordManager", "");
- SimpleTest.waitForFocus(doTest, pwmgrdlg);
-
- // Test if "Copy Username" and "Copy Password" works
- function doTest() {
- let doc = pwmgrdlg.document;
- let selection = doc.getElementById("signonsTree").view.selection;
- let menuitem = doc.getElementById("context-copyusername");
-
- function copyField() {
- info("Select all");
- selection.selectAll();
- assertMenuitemEnabled("copyusername", false);
- assertMenuitemEnabled("editusername", false);
- assertMenuitemEnabled("copypassword", false);
- assertMenuitemEnabled("editpassword", false);
-
- info("Select the first row (with an empty username)");
- selection.select(0);
- assertMenuitemEnabled("copyusername", false, "empty username");
- assertMenuitemEnabled("editusername", true);
- assertMenuitemEnabled("copypassword", true);
- assertMenuitemEnabled("editpassword", false, "password column hidden");
-
- info("Clear the selection");
- selection.clearSelection();
- assertMenuitemEnabled("copyusername", false);
- assertMenuitemEnabled("editusername", false);
- assertMenuitemEnabled("copypassword", false);
- assertMenuitemEnabled("editpassword", false);
-
- info("Select the third row and making the password column visible");
- selection.select(2);
- doc.getElementById("passwordCol").hidden = false;
- assertMenuitemEnabled("copyusername", true);
- assertMenuitemEnabled("editusername", true);
- assertMenuitemEnabled("copypassword", true);
- assertMenuitemEnabled("editpassword", true, "password column visible");
- menuitem.doCommand();
- }
-
- function assertMenuitemEnabled(idSuffix, expected, reason = "") {
- doc.defaultView.UpdateContextMenu();
- let actual = !doc.getElementById("context-" + idSuffix).getAttribute("disabled");
- is(actual, expected, idSuffix + " should be " + (expected ? "enabled" : "disabled") +
- (reason ? ": " + reason : ""));
- }
-
- function cleanUp() {
- Services.ww.registerNotification(function (aSubject, aTopic, aData) {
- Services.ww.unregisterNotification(arguments.callee);
- Services.logins.removeAllLogins();
- doc.getElementById("passwordCol").hidden = true;
- finish();
- });
- pwmgrdlg.close();
- }
-
- function testPassword() {
- info("Testing Copy Password");
- waitForClipboard("coded", function copyPassword() {
- menuitem = doc.getElementById("context-copypassword");
- menuitem.doCommand();
- }, cleanUp, cleanUp);
- }
-
- info("Testing Copy Username");
- waitForClipboard("ehsan", copyField, testPassword, testPassword);
- }
-}
diff --git a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_editing.js b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_editing.js
deleted file mode 100644
index 2b2e42273..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_editing.js
+++ /dev/null
@@ -1,126 +0,0 @@
-const { ContentTaskUtils } = Cu.import("resource://testing-common/ContentTaskUtils.jsm", {});
-const PWMGR_DLG = "chrome://passwordmgr/content/passwordManager.xul";
-
-var doc;
-var pwmgr;
-var pwmgrdlg;
-var signonsTree;
-
-function addLogin(site, username, password) {
- let nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
- let login = new nsLoginInfo(site, site, null, username, password, "u", "p");
- Services.logins.addLogin(login);
-}
-
-function getUsername(row) {
- return signonsTree.view.getCellText(row, signonsTree.columns.getNamedColumn("userCol"));
-}
-
-function getPassword(row) {
- return signonsTree.view.getCellText(row, signonsTree.columns.getNamedColumn("passwordCol"));
-}
-
-function synthesizeDblClickOnCell(aTree, column, row) {
- let tbo = aTree.treeBoxObject;
- let rect = tbo.getCoordsForCellItem(row, aTree.columns[column], "text");
- let x = rect.x + rect.width / 2;
- let y = rect.y + rect.height / 2;
- // Simulate the double click.
- EventUtils.synthesizeMouse(aTree.body, x, y, { clickCount: 2 },
- aTree.ownerDocument.defaultView);
-}
-
-function* togglePasswords() {
- pwmgrdlg.document.querySelector("#togglePasswords").doCommand();
- yield new Promise(resolve => waitForFocus(resolve, pwmgrdlg));
-}
-
-function* editUsernamePromises(site, oldUsername, newUsername) {
- is(Services.logins.findLogins({}, site, "", "").length, 1, "Correct login found");
- let login = Services.logins.findLogins({}, site, "", "")[0];
- is(login.username, oldUsername, "Correct username saved");
- is(getUsername(0), oldUsername, "Correct username shown");
- synthesizeDblClickOnCell(signonsTree, 1, 0);
- yield ContentTaskUtils.waitForCondition(() => signonsTree.getAttribute("editing"),
- "Waiting for editing");
-
- EventUtils.sendString(newUsername, pwmgrdlg);
- let signonsIntro = doc.querySelector("#signonsIntro");
- EventUtils.sendMouseEvent({type: "click"}, signonsIntro, pwmgrdlg);
- yield ContentTaskUtils.waitForCondition(() => !signonsTree.getAttribute("editing"),
- "Waiting for editing to stop");
-
- is(Services.logins.findLogins({}, site, "", "").length, 1, "Correct login replaced");
- login = Services.logins.findLogins({}, site, "", "")[0];
- is(login.username, newUsername, "Correct username updated");
- is(getUsername(0), newUsername, "Correct username shown after the update");
-}
-
-function* editPasswordPromises(site, oldPassword, newPassword) {
- is(Services.logins.findLogins({}, site, "", "").length, 1, "Correct login found");
- let login = Services.logins.findLogins({}, site, "", "")[0];
- is(login.password, oldPassword, "Correct password saved");
- is(getPassword(0), oldPassword, "Correct password shown");
-
- synthesizeDblClickOnCell(signonsTree, 2, 0);
- yield ContentTaskUtils.waitForCondition(() => signonsTree.getAttribute("editing"),
- "Waiting for editing");
-
- EventUtils.sendString(newPassword, pwmgrdlg);
- let signonsIntro = doc.querySelector("#signonsIntro");
- EventUtils.sendMouseEvent({type: "click"}, signonsIntro, pwmgrdlg);
- yield ContentTaskUtils.waitForCondition(() => !signonsTree.getAttribute("editing"),
- "Waiting for editing to stop");
-
- is(Services.logins.findLogins({}, site, "", "").length, 1, "Correct login replaced");
- login = Services.logins.findLogins({}, site, "", "")[0];
- is(login.password, newPassword, "Correct password updated");
- is(getPassword(0), newPassword, "Correct password shown after the update");
-}
-
-add_task(function* test_setup() {
- registerCleanupFunction(function() {
- Services.logins.removeAllLogins();
- });
-
- Services.logins.removeAllLogins();
- // Open the password manager dialog.
- pwmgrdlg = window.openDialog(PWMGR_DLG, "Toolkit:PasswordManager", "");
-
- Services.ww.registerNotification(function (aSubject, aTopic, aData) {
- if (aTopic == "domwindowopened") {
- let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
- SimpleTest.waitForFocus(function() {
- EventUtils.sendKey("RETURN", win);
- }, win);
- } else if (aSubject.location == pwmgrdlg.location && aTopic == "domwindowclosed") {
- // Unregister ourself.
- Services.ww.unregisterNotification(arguments.callee);
- }
- });
-
- yield new Promise((resolve) => {
- SimpleTest.waitForFocus(() => {
- doc = pwmgrdlg.document;
- signonsTree = doc.querySelector("#signonsTree");
- resolve();
- }, pwmgrdlg);
- });
-});
-
-add_task(function* test_edit_multiple_logins() {
- function* testLoginChange(site, oldUsername, oldPassword, newUsername, newPassword) {
- addLogin(site, oldUsername, oldPassword);
- yield* editUsernamePromises(site, oldUsername, newUsername);
- yield* togglePasswords();
- yield* editPasswordPromises(site, oldPassword, newPassword);
- yield* togglePasswords();
- }
-
- yield* testLoginChange("http://c.tn/", "userC", "passC", "usernameC", "passwordC");
- yield* testLoginChange("http://b.tn/", "userB", "passB", "usernameB", "passwordB");
- yield* testLoginChange("http://a.tn/", "userA", "passA", "usernameA", "passwordA");
-
- pwmgrdlg.close();
-});
diff --git a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_fields.js b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_fields.js
deleted file mode 100644
index 95bcee9ed..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_fields.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function test() {
- waitForExplicitFinish();
-
- let pwmgr = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
- pwmgr.removeAllLogins();
-
- // add login data
- let nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
- let login = new nsLoginInfo("http://example.com/", "http://example.com/", null,
- "user", "password", "u1", "p1");
- pwmgr.addLogin(login);
-
- // Open the password manager dialog
- const PWMGR_DLG = "chrome://passwordmgr/content/passwordManager.xul";
- let pwmgrdlg = window.openDialog(PWMGR_DLG, "Toolkit:PasswordManager", "");
- SimpleTest.waitForFocus(doTest, pwmgrdlg);
-
- function doTest() {
- let doc = pwmgrdlg.document;
-
- let signonsTree = doc.querySelector("#signonsTree");
- is(signonsTree.view.rowCount, 1, "One entry in the passwords list");
-
- is(signonsTree.view.getCellText(0, signonsTree.columns.getNamedColumn("siteCol")),
- "http://example.com/",
- "Correct website saved");
-
- is(signonsTree.view.getCellText(0, signonsTree.columns.getNamedColumn("userCol")),
- "user",
- "Correct user saved");
-
- let timeCreatedCol = doc.getElementById("timeCreatedCol");
- is(timeCreatedCol.getAttribute("hidden"), "true",
- "Time created column is not displayed");
-
-
- let timeLastUsedCol = doc.getElementById("timeLastUsedCol");
- is(timeLastUsedCol.getAttribute("hidden"), "true",
- "Last Used column is not displayed");
-
- let timePasswordChangedCol = doc.getElementById("timePasswordChangedCol");
- is(timePasswordChangedCol.getAttribute("hidden"), "",
- "Last Changed column is displayed");
-
- // cleanup
- Services.ww.registerNotification(function (aSubject, aTopic, aData) {
- if (aSubject.location == pwmgrdlg.location && aTopic == "domwindowclosed") {
- // unregister ourself
- Services.ww.unregisterNotification(arguments.callee);
-
- pwmgr.removeAllLogins();
-
- finish();
- }
- });
-
- pwmgrdlg.close();
- }
-}
diff --git a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_observers.js b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_observers.js
deleted file mode 100644
index 1dc7076aa..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_observers.js
+++ /dev/null
@@ -1,129 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function test() {
- waitForExplicitFinish();
-
- const LOGIN_HOST = "http://example.com";
- const LOGIN_COUNT = 5;
-
- let nsLoginInfo = new Components.Constructor(
- "@mozilla.org/login-manager/loginInfo;1", Ci.nsILoginInfo, "init");
- let pmDialog = window.openDialog(
- "chrome://passwordmgr/content/passwordManager.xul",
- "Toolkit:PasswordManager", "");
-
- let logins = [];
- let loginCounter = 0;
- let loginOrder = null;
- let modifiedLogin;
- let testNumber = 0;
- let testObserver = {
- observe: function (subject, topic, data) {
- if (topic == "passwordmgr-dialog-updated") {
- switch (testNumber) {
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- is(countLogins(), loginCounter, "Verify login added");
- ok(getLoginOrder().startsWith(loginOrder), "Verify login order");
- runNextTest();
- break;
- case 6:
- is(countLogins(), loginCounter, "Verify login count");
- is(getLoginOrder(), loginOrder, "Verify login order");
- is(getLoginPassword(), "newpassword0", "Verify login modified");
- runNextTest();
- break;
- case 7:
- is(countLogins(), loginCounter, "Verify login removed");
- ok(loginOrder.endsWith(getLoginOrder()), "Verify login order");
- runNextTest();
- break;
- case 8:
- is(countLogins(), 0, "Verify all logins removed");
- runNextTest();
- break;
- }
- }
- }
- };
-
- SimpleTest.waitForFocus(startTest, pmDialog);
-
- function createLogins() {
- let login;
- for (let i = 0; i < LOGIN_COUNT; i++) {
- login = new nsLoginInfo(LOGIN_HOST + "?n=" + i, LOGIN_HOST + "?n=" + i,
- null, "user" + i, "password" + i, "u" + i, "p" + i);
- logins.push(login);
- }
- modifiedLogin = new nsLoginInfo(LOGIN_HOST + "?n=0", LOGIN_HOST + "?n=0",
- null, "user0", "newpassword0", "u0", "p0");
- is(logins.length, LOGIN_COUNT, "Verify logins created");
- }
-
- function countLogins() {
- let doc = pmDialog.document;
- let signonsTree = doc.getElementById("signonsTree");
- return signonsTree.view.rowCount;
- }
-
- function getLoginOrder() {
- let doc = pmDialog.document;
- let signonsTree = doc.getElementById("signonsTree");
- let column = signonsTree.columns[0]; // host column
- let order = [];
- for (let i = 0; i < signonsTree.view.rowCount; i++) {
- order.push(signonsTree.view.getCellText(i, column));
- }
- return order.join(',');
- }
-
- function getLoginPassword() {
- let doc = pmDialog.document;
- let loginsTree = doc.getElementById("signonsTree");
- let column = loginsTree.columns[2]; // password column
- return loginsTree.view.getCellText(0, column);
- }
-
- function startTest() {
- Services.obs.addObserver(
- testObserver, "passwordmgr-dialog-updated", false);
- is(countLogins(), 0, "Verify starts with 0 logins");
- createLogins();
- runNextTest();
- }
-
- function runNextTest() {
- switch (++testNumber) {
- case 1: // add the logins
- for (let i = 0; i < logins.length; i++) {
- loginCounter++;
- loginOrder = getLoginOrder();
- Services.logins.addLogin(logins[i]);
- }
- break;
- case 6: // modify a login
- loginOrder = getLoginOrder();
- Services.logins.modifyLogin(logins[0], modifiedLogin);
- break;
- case 7: // remove a login
- loginCounter--;
- loginOrder = getLoginOrder();
- Services.logins.removeLogin(modifiedLogin);
- break;
- case 8: // remove all logins
- Services.logins.removeAllLogins();
- break;
- case 9: // finish
- Services.obs.removeObserver(
- testObserver, "passwordmgr-dialog-updated", false);
- pmDialog.close();
- finish();
- break;
- }
- }
-}
diff --git a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js
deleted file mode 100644
index 83272a9c4..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_sort.js
+++ /dev/null
@@ -1,208 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function test() {
- waitForExplicitFinish();
-
- let pwmgr = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
- pwmgr.removeAllLogins();
-
- // Add some initial logins
- let urls = [
- "http://example.com/",
- "http://example.org/",
- "http://mozilla.com/",
- "http://mozilla.org/",
- "http://spreadfirefox.com/",
- "http://planet.mozilla.org/",
- "https://developer.mozilla.org/",
- "http://hg.mozilla.org/",
- "http://dxr.mozilla.org/",
- "http://feeds.mozilla.org/",
- ];
- let users = [
- "user",
- "username",
- "ehsan",
- "ehsan",
- "john",
- "what?",
- "really?",
- "you sure?",
- "my user name",
- "my username",
- ];
- let pwds = [
- "password",
- "password",
- "mypass",
- "mypass",
- "smith",
- "very secret",
- "super secret",
- "absolutely",
- "mozilla",
- "mozilla.com",
- ];
- let nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
- for (let i = 0; i < 10; i++)
- pwmgr.addLogin(new nsLoginInfo(urls[i], urls[i], null, users[i], pwds[i],
- "u" + (i + 1), "p" + (i + 1)));
-
- // Open the password manager dialog
- const PWMGR_DLG = "chrome://passwordmgr/content/passwordManager.xul";
- let pwmgrdlg = window.openDialog(PWMGR_DLG, "Toolkit:PasswordManager", "");
- SimpleTest.waitForFocus(doTest, pwmgrdlg);
-
- // the meat of the test
- function doTest() {
- let doc = pwmgrdlg.document;
- let win = doc.defaultView;
- let sTree = doc.getElementById("signonsTree");
- let filter = doc.getElementById("filter");
- let siteCol = doc.getElementById("siteCol");
- let userCol = doc.getElementById("userCol");
- let passwordCol = doc.getElementById("passwordCol");
-
- let toggleCalls = 0;
- function toggleShowPasswords(func) {
- let toggleButton = doc.getElementById("togglePasswords");
- let showMode = (toggleCalls++ % 2) == 0;
-
- // only watch for a confirmation dialog every other time being called
- if (showMode) {
- Services.ww.registerNotification(function (aSubject, aTopic, aData) {
- if (aTopic == "domwindowclosed")
- Services.ww.unregisterNotification(arguments.callee);
- else if (aTopic == "domwindowopened") {
- let targetWin = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
- SimpleTest.waitForFocus(function() {
- EventUtils.sendKey("RETURN", targetWin);
- }, targetWin);
- }
- });
- }
-
- Services.obs.addObserver(function (aSubject, aTopic, aData) {
- if (aTopic == "passwordmgr-password-toggle-complete") {
- Services.obs.removeObserver(arguments.callee, aTopic);
- func();
- }
- }, "passwordmgr-password-toggle-complete", false);
-
- EventUtils.synthesizeMouse(toggleButton, 1, 1, {}, win);
- }
-
- function clickCol(col) {
- EventUtils.synthesizeMouse(col, 20, 1, {}, win);
- setTimeout(runNextTest, 0);
- }
-
- function setFilter(string) {
- filter.value = string;
- filter.doCommand();
- setTimeout(runNextTest, 0);
- }
-
- function checkSortMarkers(activeCol) {
- let isOk = true;
- let col = null;
- let hasAttr = false;
- let treecols = activeCol.parentNode;
- for (let i = 0; i < treecols.childNodes.length; i++) {
- col = treecols.childNodes[i];
- if (col.nodeName != "treecol")
- continue;
- hasAttr = col.hasAttribute("sortDirection");
- isOk &= col == activeCol ? hasAttr : !hasAttr;
- }
- ok(isOk, "Only " + activeCol.id + " has a sort marker");
- }
-
- function checkSortDirection(col, ascending) {
- checkSortMarkers(col);
- let direction = ascending ? "ascending" : "descending";
- is(col.getAttribute("sortDirection"), direction,
- col.id + ": sort direction is " + direction);
- }
-
- function checkColumnEntries(aCol, expectedValues) {
- let actualValues = getColumnEntries(aCol);
- is(actualValues.length, expectedValues.length, "Checking length of expected column");
- for (let i = 0; i < expectedValues.length; i++)
- is(actualValues[i], expectedValues[i], "Checking column entry #" + i);
- }
-
- function getColumnEntries(aCol) {
- let entries = [];
- let column = sTree.columns[aCol];
- let numRows = sTree.view.rowCount;
- for (let i = 0; i < numRows; i++)
- entries.push(sTree.view.getCellText(i, column));
- return entries;
- }
-
- let testCounter = 0;
- let expectedValues;
- function runNextTest() {
- switch (testCounter++) {
- case 0:
- expectedValues = urls.slice().sort();
- checkColumnEntries(0, expectedValues);
- checkSortDirection(siteCol, true);
- // Toggle sort direction on Host column
- clickCol(siteCol);
- break;
- case 1:
- expectedValues.reverse();
- checkColumnEntries(0, expectedValues);
- checkSortDirection(siteCol, false);
- // Sort by Username
- clickCol(userCol);
- break;
- case 2:
- expectedValues = users.slice().sort();
- checkColumnEntries(1, expectedValues);
- checkSortDirection(userCol, true);
- // Sort by Password
- clickCol(passwordCol);
- break;
- case 3:
- expectedValues = pwds.slice().sort();
- checkColumnEntries(2, expectedValues);
- checkSortDirection(passwordCol, true);
- // Set filter
- setFilter("moz");
- break;
- case 4:
- expectedValues = [ "absolutely", "mozilla", "mozilla.com",
- "mypass", "mypass", "super secret",
- "very secret" ];
- checkColumnEntries(2, expectedValues);
- checkSortDirection(passwordCol, true);
- // Reset filter
- setFilter("");
- break;
- case 5:
- expectedValues = pwds.slice().sort();
- checkColumnEntries(2, expectedValues);
- checkSortDirection(passwordCol, true);
- // cleanup
- Services.ww.registerNotification(function (aSubject, aTopic, aData) {
- // unregister ourself
- Services.ww.unregisterNotification(arguments.callee);
-
- pwmgr.removeAllLogins();
- finish();
- });
- pwmgrdlg.close();
- }
- }
-
- // Toggle Show Passwords to display Password column, then start tests
- toggleShowPasswords(runNextTest);
- }
-}
diff --git a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_switchtab.js b/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_switchtab.js
deleted file mode 100644
index bd4f265b5..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgr_switchtab.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const PROMPT_URL = "chrome://global/content/commonDialog.xul";
-var { interfaces: Ci } = Components;
-
-function test() {
- waitForExplicitFinish();
-
- let tab = gBrowser.addTab();
- isnot(tab, gBrowser.selectedTab, "New tab shouldn't be selected");
-
- let listener = {
- onOpenWindow: function(window) {
- var domwindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindow);
- waitForFocus(() => {
- is(domwindow.document.location.href, PROMPT_URL, "Should have seen a prompt window");
- is(domwindow.args.promptType, "promptUserAndPass", "Should be an authenticate prompt");
-
- is(gBrowser.selectedTab, tab, "Should have selected the new tab");
-
- domwindow.document.documentElement.cancelDialog();
- }, domwindow);
- },
-
- onCloseWindow: function() {
- }
- };
-
- Services.wm.addListener(listener);
- registerCleanupFunction(() => {
- Services.wm.removeListener(listener);
- gBrowser.removeTab(tab);
- });
-
- tab.linkedBrowser.addEventListener("load", () => {
- finish();
- }, true);
- tab.linkedBrowser.loadURI("http://example.com/browser/toolkit/components/passwordmgr/test/browser/authenticate.sjs");
-}
diff --git a/toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js b/toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js
deleted file mode 100644
index 57cfa9f83..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_passwordmgrdlg.js
+++ /dev/null
@@ -1,192 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function test() {
- waitForExplicitFinish();
-
- let pwmgr = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
- pwmgr.removeAllLogins();
-
- // Add some initial logins
- let urls = [
- "http://example.com/",
- "http://example.org/",
- "http://mozilla.com/",
- "http://mozilla.org/",
- "http://spreadfirefox.com/",
- "http://planet.mozilla.org/",
- "https://developer.mozilla.org/",
- "http://hg.mozilla.org/",
- "http://dxr.mozilla.org/",
- "http://feeds.mozilla.org/",
- ];
- let nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
- let logins = [
- new nsLoginInfo(urls[0], urls[0], null, "user", "password", "u1", "p1"),
- new nsLoginInfo(urls[1], urls[1], null, "username", "password", "u2", "p2"),
- new nsLoginInfo(urls[2], urls[2], null, "ehsan", "mypass", "u3", "p3"),
- new nsLoginInfo(urls[3], urls[3], null, "ehsan", "mypass", "u4", "p4"),
- new nsLoginInfo(urls[4], urls[4], null, "john", "smith", "u5", "p5"),
- new nsLoginInfo(urls[5], urls[5], null, "what?", "very secret", "u6", "p6"),
- new nsLoginInfo(urls[6], urls[6], null, "really?", "super secret", "u7", "p7"),
- new nsLoginInfo(urls[7], urls[7], null, "you sure?", "absolutely", "u8", "p8"),
- new nsLoginInfo(urls[8], urls[8], null, "my user name", "mozilla", "u9", "p9"),
- new nsLoginInfo(urls[9], urls[9], null, "my username", "mozilla.com", "u10", "p10"),
- ];
- logins.forEach(login => pwmgr.addLogin(login));
-
- // Open the password manager dialog
- const PWMGR_DLG = "chrome://passwordmgr/content/passwordManager.xul";
- let pwmgrdlg = window.openDialog(PWMGR_DLG, "Toolkit:PasswordManager", "");
- SimpleTest.waitForFocus(doTest, pwmgrdlg);
-
- // the meat of the test
- function doTest() {
- let doc = pwmgrdlg.document;
- let win = doc.defaultView;
- let filter = doc.getElementById("filter");
- let tree = doc.getElementById("signonsTree");
- let view = tree.view;
-
- is(filter.value, "", "Filter box should initially be empty");
- is(view.rowCount, 10, "There should be 10 passwords initially");
-
- // Prepare a set of tests
- // filter: the text entered in the filter search box
- // count: the number of logins which should match the respective filter
- // count2: the number of logins which should match the respective filter
- // if the passwords are being shown as well
- // Note: if a test doesn't have count2 set, count is used instead.
- let tests = [
- {filter: "pass", count: 0, count2: 4},
- {filter: "", count: 10}, // test clearing the filter
- {filter: "moz", count: 7},
- {filter: "mozi", count: 7},
- {filter: "mozil", count: 7},
- {filter: "mozill", count: 7},
- {filter: "mozilla", count: 7},
- {filter: "mozilla.com", count: 1, count2: 2},
- {filter: "user", count: 4},
- {filter: "user ", count: 1},
- {filter: " user", count: 2},
- {filter: "http", count: 10},
- {filter: "https", count: 1},
- {filter: "secret", count: 0, count2: 2},
- {filter: "secret!", count: 0},
- ];
-
- let toggleCalls = 0;
- function toggleShowPasswords(func) {
- let toggleButton = doc.getElementById("togglePasswords");
- let showMode = (toggleCalls++ % 2) == 0;
-
- // only watch for a confirmation dialog every other time being called
- if (showMode) {
- Services.ww.registerNotification(function (aSubject, aTopic, aData) {
- if (aTopic == "domwindowclosed")
- Services.ww.unregisterNotification(arguments.callee);
- else if (aTopic == "domwindowopened") {
- let targetWin = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
- SimpleTest.waitForFocus(function() {
- EventUtils.sendKey("RETURN", targetWin);
- }, targetWin);
- }
- });
- }
-
- Services.obs.addObserver(function (aSubject, aTopic, aData) {
- if (aTopic == "passwordmgr-password-toggle-complete") {
- Services.obs.removeObserver(arguments.callee, aTopic);
- func();
- }
- }, "passwordmgr-password-toggle-complete", false);
-
- EventUtils.synthesizeMouse(toggleButton, 1, 1, {}, win);
- }
-
- function runTests(mode, endFunction) {
- let testCounter = 0;
-
- function setFilter(string) {
- filter.value = string;
- filter.doCommand();
- }
-
- function runOneTest(testCase) {
- function tester() {
- is(view.rowCount, expected, expected + " logins should match '" + testCase.filter + "'");
- }
-
- let expected;
- switch (mode) {
- case 1: // without showing passwords
- expected = testCase.count;
- break;
- case 2: // showing passwords
- expected = ("count2" in testCase) ? testCase.count2 : testCase.count;
- break;
- case 3: // toggle
- expected = testCase.count;
- tester();
- toggleShowPasswords(function () {
- expected = ("count2" in testCase) ? testCase.count2 : testCase.count;
- tester();
- toggleShowPasswords(proceed);
- });
- return;
- }
- tester();
- proceed();
- }
-
- function proceed() {
- // run the next test if necessary or proceed with the tests
- if (testCounter != tests.length)
- runNextTest();
- else
- endFunction();
- }
-
- function runNextTest() {
- let testCase = tests[testCounter++];
- setFilter(testCase.filter);
- setTimeout(runOneTest, 0, testCase);
- }
-
- runNextTest();
- }
-
- function step1() {
- runTests(1, step2);
- }
-
- function step2() {
- toggleShowPasswords(function() {
- runTests(2, step3);
- });
- }
-
- function step3() {
- toggleShowPasswords(function() {
- runTests(3, lastStep);
- });
- }
-
- function lastStep() {
- // cleanup
- Services.ww.registerNotification(function (aSubject, aTopic, aData) {
- // unregister ourself
- Services.ww.unregisterNotification(arguments.callee);
-
- pwmgr.removeAllLogins();
- finish();
- });
- pwmgrdlg.close();
- }
-
- step1();
- }
-}
diff --git a/toolkit/components/passwordmgr/test/browser/browser_username_select_dialog.js b/toolkit/components/passwordmgr/test/browser/browser_username_select_dialog.js
deleted file mode 100644
index 8df89b510..000000000
--- a/toolkit/components/passwordmgr/test/browser/browser_username_select_dialog.js
+++ /dev/null
@@ -1,144 +0,0 @@
-/*
- * Test username selection dialog, on password update from a p-only form,
- * when there are multiple saved logins on the domain.
- */
-
-// Copied from prompt_common.js. TODO: share the code.
-function getSelectDialogDoc() {
- // Trudge through all the open windows, until we find the one
- // that has selectDialog.xul loaded.
- var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
- getService(Ci.nsIWindowMediator);
- // var enumerator = wm.getEnumerator("navigator:browser");
- var enumerator = wm.getXULWindowEnumerator(null);
-
- while (enumerator.hasMoreElements()) {
- var win = enumerator.getNext();
- var windowDocShell = win.QueryInterface(Ci.nsIXULWindow).docShell;
-
- var containedDocShells = windowDocShell.getDocShellEnumerator(
- Ci.nsIDocShellTreeItem.typeChrome,
- Ci.nsIDocShell.ENUMERATE_FORWARDS);
- while (containedDocShells.hasMoreElements()) {
- // Get the corresponding document for this docshell
- var childDocShell = containedDocShells.getNext();
- // We don't want it if it's not done loading.
- if (childDocShell.busyFlags != Ci.nsIDocShell.BUSY_FLAGS_NONE)
- continue;
- var childDoc = childDocShell.QueryInterface(Ci.nsIDocShell)
- .contentViewer
- .DOMDocument;
-
- if (childDoc.location.href == "chrome://global/content/selectDialog.xul")
- return childDoc;
- }
- }
-
- return null;
-}
-
-let nsLoginInfo = new Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
-let login1 = new nsLoginInfo("http://example.com", "http://example.com", null,
- "notifyu1", "notifyp1", "user", "pass");
-let login1B = new nsLoginInfo("http://example.com", "http://example.com", null,
- "notifyu1B", "notifyp1B", "user", "pass");
-
-add_task(function* test_changeUPLoginOnPUpdateForm_accept() {
- info("Select an u+p login from multiple logins, on password update form, and accept.");
- Services.logins.addLogin(login1);
- Services.logins.addLogin(login1B);
-
- yield testSubmittingLoginForm("subtst_notifications_change_p.html", function*(fieldValues) {
- is(fieldValues.username, "null", "Checking submitted username");
- is(fieldValues.password, "pass2", "Checking submitted password");
-
- yield ContentTaskUtils.waitForCondition(() => {
- return getSelectDialogDoc();
- }, "Wait for selection dialog to be accessible.");
-
- let doc = getSelectDialogDoc();
- let dialog = doc.getElementsByTagName("dialog")[0];
- let listbox = doc.getElementById("list");
-
- is(listbox.selectedIndex, 0, "Checking selected index");
- is(listbox.itemCount, 2, "Checking selected length");
- ['notifyu1', 'notifyu1B'].forEach((username, i) => {
- is(listbox.getItemAtIndex(i).label, username, "Check username selection on dialog");
- });
-
- dialog.acceptDialog();
-
- yield ContentTaskUtils.waitForCondition(() => {
- return !getSelectDialogDoc();
- }, "Wait for selection dialog to disappear.");
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 2, "Should have 2 logins");
-
- let login = SpecialPowers.wrap(logins[0]).QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1", "Check the username unchanged");
- is(login.password, "pass2", "Check the password changed");
- is(login.timesUsed, 2, "Check times used");
-
- login = SpecialPowers.wrap(logins[1]).QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1B", "Check the username unchanged");
- is(login.password, "notifyp1B", "Check the password unchanged");
- is(login.timesUsed, 1, "Check times used");
-
- // cleanup
- login1.password = "pass2";
- Services.logins.removeLogin(login1);
- login1.password = "notifyp1";
-
- Services.logins.removeLogin(login1B);
-});
-
-add_task(function* test_changeUPLoginOnPUpdateForm_cancel() {
- info("Select an u+p login from multiple logins, on password update form, and cancel.");
- Services.logins.addLogin(login1);
- Services.logins.addLogin(login1B);
-
- yield testSubmittingLoginForm("subtst_notifications_change_p.html", function*(fieldValues) {
- is(fieldValues.username, "null", "Checking submitted username");
- is(fieldValues.password, "pass2", "Checking submitted password");
-
- yield ContentTaskUtils.waitForCondition(() => {
- return getSelectDialogDoc();
- }, "Wait for selection dialog to be accessible.");
-
- let doc = getSelectDialogDoc();
- let dialog = doc.getElementsByTagName("dialog")[0];
- let listbox = doc.getElementById("list");
-
- is(listbox.selectedIndex, 0, "Checking selected index");
- is(listbox.itemCount, 2, "Checking selected length");
- ['notifyu1', 'notifyu1B'].forEach((username, i) => {
- is(listbox.getItemAtIndex(i).label, username, "Check username selection on dialog");
- });
-
- dialog.cancelDialog();
-
- yield ContentTaskUtils.waitForCondition(() => {
- return !getSelectDialogDoc();
- }, "Wait for selection dialog to disappear.");
- });
-
- let logins = Services.logins.getAllLogins();
- is(logins.length, 2, "Should have 2 logins");
-
- let login = SpecialPowers.wrap(logins[0]).QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1", "Check the username unchanged");
- is(login.password, "notifyp1", "Check the password unchanged");
- is(login.timesUsed, 1, "Check times used");
-
- login = SpecialPowers.wrap(logins[1]).QueryInterface(Ci.nsILoginMetaInfo);
- is(login.username, "notifyu1B", "Check the username unchanged");
- is(login.password, "notifyp1B", "Check the password unchanged");
- is(login.timesUsed, 1, "Check times used");
-
- // cleanup
- Services.logins.removeLogin(login1);
- Services.logins.removeLogin(login1B);
-});
diff --git a/toolkit/components/passwordmgr/test/browser/form_autofocus_js.html b/toolkit/components/passwordmgr/test/browser/form_autofocus_js.html
deleted file mode 100644
index 76056e375..000000000
--- a/toolkit/components/passwordmgr/test/browser/form_autofocus_js.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"></head>
-<body onload="document.getElementById('form-basic-username').focus();">
-<!-- Username field is focused by js onload -->
-<form id="form-basic">
- <input id="form-basic-username" name="username">
- <input id="form-basic-password" name="password" type="password">
- <input id="form-basic-submit" type="submit">
-</form>
-
-</body></html>
diff --git a/toolkit/components/passwordmgr/test/browser/form_basic.html b/toolkit/components/passwordmgr/test/browser/form_basic.html
deleted file mode 100644
index df2083a93..000000000
--- a/toolkit/components/passwordmgr/test/browser/form_basic.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"></head><body>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-
-<!-- Simplest form with username and password fields. -->
-<form id="form-basic">
- <input id="form-basic-username" name="username">
- <input id="form-basic-password" name="password" type="password">
- <input id="form-basic-submit" type="submit">
-</form>
-
-</body></html>
diff --git a/toolkit/components/passwordmgr/test/browser/form_basic_iframe.html b/toolkit/components/passwordmgr/test/browser/form_basic_iframe.html
deleted file mode 100644
index 616f56947..000000000
--- a/toolkit/components/passwordmgr/test/browser/form_basic_iframe.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<html>
-
-<head>
- <meta charset="utf-8">
-</head>
-
-<body>
- <!-- Form in an iframe -->
- <iframe src="https://example.org/browser/toolkit/components/passwordmgr/test/browser/form_basic.html" id="test-iframe"></iframe>
-</body>
-
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/form_cross_origin_insecure_action.html b/toolkit/components/passwordmgr/test/browser/form_cross_origin_insecure_action.html
deleted file mode 100644
index e8aa8b215..000000000
--- a/toolkit/components/passwordmgr/test/browser/form_cross_origin_insecure_action.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"></head><body>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-
-<!-- Simplest form with username and password fields. -->
-<form id="form-basic" action="http://another.domain/custom_action.html">
- <input id="form-basic-username" name="username">
- <input id="form-basic-password" name="password" type="password">
- <input id="form-basic-submit" type="submit">
-</form>
-
-</body></html>
diff --git a/toolkit/components/passwordmgr/test/browser/form_cross_origin_secure_action.html b/toolkit/components/passwordmgr/test/browser/form_cross_origin_secure_action.html
deleted file mode 100644
index 892a9f6f6..000000000
--- a/toolkit/components/passwordmgr/test/browser/form_cross_origin_secure_action.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"></head><body>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-
-<!-- Simplest form with username and password fields. -->
-<form id="form-basic" action="https://another.domain/custom_action.html">
- <input id="form-basic-username" name="username">
- <input id="form-basic-password" name="password" type="password">
- <input id="form-basic-submit" type="submit">
-</form>
-
-</body></html>
diff --git a/toolkit/components/passwordmgr/test/browser/form_same_origin_action.html b/toolkit/components/passwordmgr/test/browser/form_same_origin_action.html
deleted file mode 100644
index 8f0c9a14e..000000000
--- a/toolkit/components/passwordmgr/test/browser/form_same_origin_action.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"></head><body>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-
-<!-- Simplest form with username and password fields. -->
-<form id="form-basic" action="./custom_action.html">
- <input id="form-basic-username" name="username">
- <input id="form-basic-password" name="password" type="password">
- <input id="form-basic-submit" type="submit">
-</form>
-
-</body></html>
diff --git a/toolkit/components/passwordmgr/test/browser/formless_basic.html b/toolkit/components/passwordmgr/test/browser/formless_basic.html
deleted file mode 100644
index 2f4c5de52..000000000
--- a/toolkit/components/passwordmgr/test/browser/formless_basic.html
+++ /dev/null
@@ -1,18 +0,0 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"></head><body>
-
-<!-- Simplest form with username and password fields. -->
- <input id="form-basic-username" name="username">
- <input id="form-basic-password" name="password" type="password">
- <input id="form-basic-submit" type="submit">
-
- <button id="add">Add input[type=password]</button>
-
- <script>
- document.getElementById("add").addEventListener("click", function () {
- var node = document.createElement("input");
- node.setAttribute("type", "password");
- document.querySelector("body").appendChild(node);
- });
- </script>
-
-</body></html>
diff --git a/toolkit/components/passwordmgr/test/browser/head.js b/toolkit/components/passwordmgr/test/browser/head.js
deleted file mode 100644
index 926cb6616..000000000
--- a/toolkit/components/passwordmgr/test/browser/head.js
+++ /dev/null
@@ -1,137 +0,0 @@
-const DIRECTORY_PATH = "/browser/toolkit/components/passwordmgr/test/browser/";
-
-Cu.import("resource://testing-common/LoginTestUtils.jsm", this);
-Cu.import("resource://testing-common/ContentTaskUtils.jsm", this);
-
-registerCleanupFunction(function* cleanup_removeAllLoginsAndResetRecipes() {
- Services.logins.removeAllLogins();
-
- let recipeParent = LoginTestUtils.recipes.getRecipeParent();
- if (!recipeParent) {
- // No need to reset the recipes if the recipe module wasn't even loaded.
- return;
- }
- yield recipeParent.then(recipeParentResult => recipeParentResult.reset());
-});
-
-/**
- * Loads a test page in `DIRECTORY_URL` which automatically submits to formsubmit.sjs and returns a
- * promise resolving with the field values when the optional `aTaskFn` is done.
- *
- * @param {String} aPageFile - test page file name which auto-submits to formsubmit.sjs
- * @param {Function} aTaskFn - task which can be run before the tab closes.
- * @param {String} [aOrigin="http://example.com"] - origin of the server to use
- * to load `aPageFile`.
- */
-function testSubmittingLoginForm(aPageFile, aTaskFn, aOrigin = "http://example.com") {
- return BrowserTestUtils.withNewTab({
- gBrowser,
- url: aOrigin + DIRECTORY_PATH + aPageFile,
- }, function*(browser) {
- ok(true, "loaded " + aPageFile);
- let fieldValues = yield ContentTask.spawn(browser, undefined, function*() {
- yield ContentTaskUtils.waitForCondition(() => {
- return content.location.pathname.endsWith("/formsubmit.sjs") &&
- content.document.readyState == "complete";
- }, "Wait for form submission load (formsubmit.sjs)");
- let username = content.document.getElementById("user").textContent;
- let password = content.document.getElementById("pass").textContent;
- return {
- username,
- password,
- };
- });
- ok(true, "form submission loaded");
- if (aTaskFn) {
- yield* aTaskFn(fieldValues);
- }
- return fieldValues;
- });
-}
-
-function checkOnlyLoginWasUsedTwice({ justChanged }) {
- // Check to make sure we updated the timestamps and use count on the
- // existing login that was submitted for the test.
- let logins = Services.logins.getAllLogins();
- is(logins.length, 1, "Should only have 1 login");
- ok(logins[0] instanceof Ci.nsILoginMetaInfo, "metainfo QI");
- is(logins[0].timesUsed, 2, "check .timesUsed for existing login submission");
- ok(logins[0].timeCreated < logins[0].timeLastUsed, "timeLastUsed bumped");
- if (justChanged) {
- is(logins[0].timeLastUsed, logins[0].timePasswordChanged, "timeLastUsed == timePasswordChanged");
- } else {
- is(logins[0].timeCreated, logins[0].timePasswordChanged, "timeChanged not updated");
- }
-}
-
-// Begin popup notification (doorhanger) functions //
-
-const REMEMBER_BUTTON = 0;
-const NEVER_BUTTON = 1;
-
-const CHANGE_BUTTON = 0;
-const DONT_CHANGE_BUTTON = 1;
-
-/**
- * Checks if we have a password capture popup notification
- * of the right type and with the right label.
- *
- * @param {String} aKind The desired `passwordNotificationType`
- * @param {Object} [popupNotifications = PopupNotifications]
- * @return the found password popup notification.
- */
-function getCaptureDoorhanger(aKind, popupNotifications = PopupNotifications) {
- ok(true, "Looking for " + aKind + " popup notification");
- let notification = popupNotifications.getNotification("password");
- if (notification) {
- is(notification.options.passwordNotificationType, aKind, "Notification type matches.");
- if (aKind == "password-change") {
- is(notification.mainAction.label, "Update", "Main action label matches update doorhanger.");
- } else if (aKind == "password-save") {
- is(notification.mainAction.label, "Remember", "Main action label matches save doorhanger.");
- }
- }
- return notification;
-}
-
-/**
- * Clicks the specified popup notification button.
- *
- * @param {Element} aPopup Popup Notification element
- * @param {Number} aButtonIndex Number indicating which button to click.
- * See the constants in this file.
- */
-function clickDoorhangerButton(aPopup, aButtonIndex) {
- ok(true, "Looking for action at index " + aButtonIndex);
-
- let notifications = aPopup.owner.panel.childNodes;
- ok(notifications.length > 0, "at least one notification displayed");
- ok(true, notifications.length + " notification(s)");
- let notification = notifications[0];
-
- if (aButtonIndex == 0) {
- ok(true, "Triggering main action");
- notification.button.doCommand();
- } else if (aButtonIndex <= aPopup.secondaryActions.length) {
- ok(true, "Triggering secondary action " + aButtonIndex);
- notification.childNodes[aButtonIndex].doCommand();
- }
-}
-
-/**
- * Checks the doorhanger's username and password.
- *
- * @param {String} username The username.
- * @param {String} password The password.
- */
-function* checkDoorhangerUsernamePassword(username, password) {
- yield BrowserTestUtils.waitForCondition(() => {
- return document.getElementById("password-notification-username").value == username;
- }, "Wait for nsLoginManagerPrompter writeDataToUI()");
- is(document.getElementById("password-notification-username").value, username,
- "Check doorhanger username");
- is(document.getElementById("password-notification-password").value, password,
- "Check doorhanger password");
-}
-
-// End popup notification (doorhanger) functions //
diff --git a/toolkit/components/passwordmgr/test/browser/insecure_test.html b/toolkit/components/passwordmgr/test/browser/insecure_test.html
deleted file mode 100644
index fedea1428..000000000
--- a/toolkit/components/passwordmgr/test/browser/insecure_test.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"></head><body>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-
-<!-- This frame is initially loaded over HTTP. -->
-<iframe id="test-iframe"
- src="http://example.org/browser/toolkit/components/passwordmgr/test/browser/insecure_test_subframe.html"/>
-
-</body></html>
diff --git a/toolkit/components/passwordmgr/test/browser/insecure_test_subframe.html b/toolkit/components/passwordmgr/test/browser/insecure_test_subframe.html
deleted file mode 100644
index 3f01e36a6..000000000
--- a/toolkit/components/passwordmgr/test/browser/insecure_test_subframe.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"></head><body>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-
-<form>
- <input name="password" type="password">
-</form>
-
-<!-- Link to reload this page over HTTPS. -->
-<a id="test-link"
- href="https://example.org/browser/toolkit/components/passwordmgr/test/browser/insecure_test_subframe.html">HTTPS</a>
-
-</body></html>
diff --git a/toolkit/components/passwordmgr/test/browser/multiple_forms.html b/toolkit/components/passwordmgr/test/browser/multiple_forms.html
deleted file mode 100644
index 3f64f8993..000000000
--- a/toolkit/components/passwordmgr/test/browser/multiple_forms.html
+++ /dev/null
@@ -1,129 +0,0 @@
-<!DOCTYPE html><html><head><meta charset="utf-8"></head><body>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-
-
-<form class="test-form"
- description="Password only form">
- <input id='test-password-1' type='password' name='pname' value=''>
- <input type='submit'>Submit</input>
-</form>
-
-
-<form class="test-form"
- description="Username only form">
- <input id='test-username-1' type='text' name='uname' value=''>
- <input type='submit'>Submit</input>
-</form>
-
-
-<form class="test-form"
- description="Simple username and password blank form">
- <input id='test-username-2' type='text' name='uname' value=''>
- <input id='test-password-2' type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-
-<form class="test-form"
- description="Simple username and password form, prefilled username">
- <input id='test-username-3' type='text' name='uname' value='testuser'>
- <input id='test-password-3' type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-
-<form class="test-form"
- description="Simple username and password form, prefilled username and password">
- <input id='test-username-4' type='text' name='uname' value='testuser'>
- <input id='test-password-4' type='password' name='pname' value='testpass'>
- <button type='submit'>Submit</button>
-</form>
-
-
-<form class="test-form"
- description="One username and two passwords empty form">
- <input id='test-username-5' type='text' name='uname'>
- <input id='test-password-5' type='password' name='pname'>
- <input id='test-password2-5' type='password' name='pname2'>
- <button type='submit'>Submit</button>
-</form>
-
-
-<form class="test-form"
- description="One username and two passwords form, fields prefiled">
- <input id='test-username-6' type='text' name='uname' value="testuser">
- <input id='test-password-6' type='password' name='pname' value="testpass">
- <input id='test-password2-6' type='password' name='pname2' value="testpass">
- <button type='submit'>Submit</button>
-</form>
-
-
-<div class="test-form"
- description="Username and password fields with no form">
- <input id='test-username-7' type='text' name='uname' value="testuser">
- <input id='test-password-7' type='password' name='pname' value="testpass">
-</div>
-
-
-<form class="test-form"
- description="Simple username and password blank form, with disabled password">
- <input id='test-username-8' type='text' name='uname' value=''>
- <input id='test-password-8' type='password' name='pname' value='' disabled>
- <button type='submit'>Submit</button>
-</form>
-
-
-<form class="test-form"
- description="Simple username and password blank form, with disabled username">
- <input id='test-username-9' type='text' name='uname' value='' disabled>
- <input id='test-password-9' type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-
-<form class="test-form"
- description="Simple username and password blank form, with readonly password">
- <input id='test-username-10' type='text' name='uname' value=''>
- <input id='test-password-10' type='password' name='pname' value='' readonly>
- <button type='submit'>Submit</button>
-</form>
-
-
-<form class="test-form"
- description="Simple username and password blank form, with readonly username">
- <input id='test-username-11' type='text' name='uname' value='' readonly>
- <input id='test-password-11' type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-
-<form class="test-form"
- description="Two username and one passwords form, fields prefiled">
- <input id='test-username-12' type='text' name='uname' value="testuser">
- <input id='test-username2-12' type='text' name='uname2' value="testuser">
- <input id='test-password-12' type='password' name='pname' value="testpass">
- <button type='submit'>Submit</button>
-</form>
-
-
-<form class="test-form"
- description="Two username and one passwords form, one disabled username field">
- <input id='test-username-13' type='text' name='uname'>
- <input id='test-username2-13' type='text' name='uname2' disabled>
- <input id='test-password-13' type='password' name='pname'>
- <button type='submit'>Submit</button>
-</form>
-
-
-<div class="test-form"
- description="Second username and password fields with no form">
- <input id='test-username-14' type='text' name='uname'>
- <input id='test-password-14' type='password' name='pname' expectedFail>
-</div>
-
-<!-- Form in an iframe -->
-<iframe src="https://example.org/browser/toolkit/components/passwordmgr/test/browser/form_basic.html" id="test-iframe"></iframe>
-
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/streamConverter_content.sjs b/toolkit/components/passwordmgr/test/browser/streamConverter_content.sjs
deleted file mode 100644
index 84c75437e..000000000
--- a/toolkit/components/passwordmgr/test/browser/streamConverter_content.sjs
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function handleRequest(request, response) {
- response.setHeader("Content-Type", "test/content", false);
-}
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_1.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_1.html
deleted file mode 100644
index b96faf2ee..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_1.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications - Basic 1un 1pw</title>
-</head>
-<body>
-<h2>Subtest 1</h2>
-<form id="form" action="formsubmit.sjs">
- <input id="user" name="user">
- <input id="pass" name="pass" type="password">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- userField.value = "notifyu1";
- passField.value = "notifyp1";
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var userField = document.getElementById("user");
-var passField = document.getElementById("pass");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_10.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_10.html
deleted file mode 100644
index 2dc96b4fd..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_10.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications</title>
-</head>
-<body>
-<h2>Subtest 10</h2>
-<form id="form" action="formsubmit.sjs">
- <input id="pass" name="pass" type="password">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- passField.value = "notifyp1";
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var userField = document.getElementById("user");
-var passField = document.getElementById("pass");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_11.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_11.html
deleted file mode 100644
index cf3df5275..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_11.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications - Popup Windows</title>
-</head>
-<body>
-<h2>Subtest 11 (popup windows)</h2>
-<script>
-
-// Ignore the '?' and split on |
-[username, password, features, autoClose] = window.location.search.substring(1).split('|');
-
-var url = "subtst_notifications_11_popup.html?" + username + "|" + password;
-var popupWin = window.open(url, "subtst_11", features);
-
-// Popup window will call this function on form submission.
-function formSubmitted() {
- if (autoClose)
- popupWin.close();
-}
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_11_popup.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_11_popup.html
deleted file mode 100644
index 2e8e4135c..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_11_popup.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications</title>
-</head>
-<body>
-<h2>Subtest 11</h2>
-<form id="form" action="formsubmit.sjs">
- <input id="user" name="user">
- <input id="pass" name="pass" type="password">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- // Get the password from the query string (exclude '?').
- [username, password] = window.location.search.substring(1).split('|');
- userField.value = username;
- passField.value = password;
- form.submit();
- window.opener.formSubmitted();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var userField = document.getElementById("user");
-var passField = document.getElementById("pass");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_2.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_2.html
deleted file mode 100644
index 72651d6c1..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_2.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications - autocomplete=off on the username field</title>
-</head>
-<body>
-<h2>Subtest 2</h2>
-(username autocomplete=off)
-<form id="form" action="formsubmit.sjs">
- <input id="user" name="user" autocomplete="off">
- <input id="pass" name="pass" type="password">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- userField.value = "notifyu1";
- passField.value = "notifyp1";
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var userField = document.getElementById("user");
-var passField = document.getElementById("pass");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_2pw_0un.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_2pw_0un.html
deleted file mode 100644
index 7ddbf0851..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_2pw_0un.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications with 2 password fields and no username</title>
-</head>
-<body>
-<h2>Subtest 24</h2>
-<form id="form" action="formsubmit.sjs">
- <input id="pass1" name="pass1" type="password" value="staticpw">
- <input id="pass" name="pass" type="password">
- <button type="submit">Submit</button>
-</form>
-
-<script>
-function submitForm() {
- pass.value = "notifyp1";
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var pass = document.getElementById("pass");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_2pw_1un_1text.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_2pw_1un_1text.html
deleted file mode 100644
index 893f18724..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_2pw_1un_1text.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications with 2 password fields and 1 username field and one other text field before the first password field</title>
-</head>
-<body>
-<h2>1 username field followed by a text field followed by 2 username fields</h2>
-<form id="form" action="formsubmit.sjs">
- <input id="user" name="user" value="staticpw">
- <input id="city" name="city" value="city">
- <input id="pass" name="pass" type="password">
- <input id="pin" name="pin" type="password" value="static-pin">
- <button type="submit">Submit</button>
-</form>
-
-<script>
-function submitForm() {
- userField.value = "notifyu1";
- passField.value = "notifyp1";
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var userField = document.getElementById("user");
-var passField = document.getElementById("pass");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_3.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_3.html
deleted file mode 100644
index 291e735d0..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_3.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications - autocomplete=off on the password field</title>
-</head>
-<body>
-<h2>Subtest 3</h2>
-(password autocomplete=off)
-<form id="form" action="formsubmit.sjs">
- <input id="user" name="user">
- <input id="pass" name="pass" type="password" autocomplete="off">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- userField.value = "notifyu1";
- passField.value = "notifyp1";
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var userField = document.getElementById("user");
-var passField = document.getElementById("pass");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_4.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_4.html
deleted file mode 100644
index 63df3a42d..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_4.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8" >
- <title>Subtest for Login Manager notifications</title>
-</head>
-<body>
-<h2>Subtest 4</h2>
-(form autocomplete=off)
-<form id="form" action="formsubmit.sjs" autocomplete="off">
- <input id="user" name="user">
- <input id="pass" name="pass" type="password">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- userField.value = "notifyu1";
- passField.value = "notifyp1";
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var userField = document.getElementById("user");
-var passField = document.getElementById("pass");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_5.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_5.html
deleted file mode 100644
index 72a3df95f..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_5.html
+++ /dev/null
@@ -1,26 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications - Form with only a username field</title>
-</head>
-<body>
-<h2>Subtest 5</h2>
-<form id="form" action="formsubmit.sjs">
- <input id="user" name="user">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- userField.value = "notifyu1";
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var userField = document.getElementById("user");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_6.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_6.html
deleted file mode 100644
index 47e23e972..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_6.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications</title>
-</head>
-<body>
-<h2>Subtest 6</h2>
-(password-only form)
-<form id="form" action="formsubmit.sjs">
- <input id="pass" name="pass" type="password">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- passField.value = "notifyp1";
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var passField = document.getElementById("pass");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_8.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_8.html
deleted file mode 100644
index abeea4262..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_8.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications</title>
-</head>
-<body>
-<h2>Subtest 8</h2>
-<form id="form" action="formsubmit.sjs">
- <input id="user" name="user">
- <input id="pass" name="pass" type="password">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- userField.value = "notifyu1";
- passField.value = "pass2";
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var userField = document.getElementById("user");
-var passField = document.getElementById("pass");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_9.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_9.html
deleted file mode 100644
index c6f741068..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_9.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications</title>
-</head>
-<body>
-<h2>Subtest 9</h2>
-<form id="form" action="formsubmit.sjs">
- <input id="user" name="user">
- <input id="pass" name="pass" type="password">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- userField.value = "";
- passField.value = "pass2";
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var userField = document.getElementById("user");
-var passField = document.getElementById("pass");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/browser/subtst_notifications_change_p.html b/toolkit/components/passwordmgr/test/browser/subtst_notifications_change_p.html
deleted file mode 100644
index d74f3bcdf..000000000
--- a/toolkit/components/passwordmgr/test/browser/subtst_notifications_change_p.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications</title>
-</head>
-<body>
-<h2>Change password</h2>
-<form id="form" action="formsubmit.sjs">
- <input id="pass_current" name="pass_current" type="password" value="notifyp1">
- <input id="pass" name="pass" type="password">
- <input id="pass_confirm" name="pass_confirm" type="password">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- passField.value = "pass2";
- passConfirmField.value = "pass2";
-
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var userField = document.getElementById("user");
-var passField = document.getElementById("pass");
-var passConfirmField = document.getElementById("pass_confirm");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/chrome/chrome.ini b/toolkit/components/passwordmgr/test/chrome/chrome.ini
deleted file mode 100644
index 093b87b7d..000000000
--- a/toolkit/components/passwordmgr/test/chrome/chrome.ini
+++ /dev/null
@@ -1,13 +0,0 @@
-[DEFAULT]
-skip-if = os == 'android'
-
-[test_privbrowsing_perwindowpb.html]
-skip-if = true # Bug 1173337
-support-files =
- ../formsubmit.sjs
- notification_common.js
- privbrowsing_perwindowpb_iframe.html
- subtst_privbrowsing_1.html
- subtst_privbrowsing_2.html
- subtst_privbrowsing_3.html
- subtst_privbrowsing_4.html
diff --git a/toolkit/components/passwordmgr/test/chrome/notification_common.js b/toolkit/components/passwordmgr/test/chrome/notification_common.js
deleted file mode 100644
index e8a52929d..000000000
--- a/toolkit/components/passwordmgr/test/chrome/notification_common.js
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Initialization: for each test, remove any prior notifications.
- */
-function cleanUpPopupNotifications() {
- var container = getPopupNotifications(window.top);
- var notes = container._currentNotifications;
- info(true, "Removing " + notes.length + " popup notifications.");
- for (var i = notes.length - 1; i >= 0; i--) {
- notes[i].remove();
- }
-}
-cleanUpPopupNotifications();
-
-/*
- * getPopupNotifications
- *
- * Fetches the popup notification for the specified window.
- */
-function getPopupNotifications(aWindow) {
- var Ci = SpecialPowers.Ci;
- var Cc = SpecialPowers.Cc;
- ok(Ci != null, "Access Ci");
- ok(Cc != null, "Access Cc");
-
- var chromeWin = SpecialPowers.wrap(aWindow)
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell)
- .chromeEventHandler.ownerDocument.defaultView;
-
- var popupNotifications = chromeWin.PopupNotifications;
- return popupNotifications;
-}
-
-
-/**
- * Checks if we have a password popup notification
- * of the right type and with the right label.
- *
- * @deprecated Write a browser-chrome test instead and use the fork of this method there.
- * @returns the found password popup notification.
- */
-function getPopup(aPopupNote, aKind) {
- ok(true, "Looking for " + aKind + " popup notification");
- var notification = aPopupNote.getNotification("password");
- if (notification) {
- is(notification.options.passwordNotificationType, aKind, "Notification type matches.");
- if (aKind == "password-change") {
- is(notification.mainAction.label, "Update", "Main action label matches update doorhanger.");
- } else if (aKind == "password-save") {
- is(notification.mainAction.label, "Remember", "Main action label matches save doorhanger.");
- }
- }
- return notification;
-}
-
-
-/**
- * @deprecated - Use a browser chrome test instead.
- *
- * Clicks the specified popup notification button.
- */
-function clickPopupButton(aPopup, aButtonIndex) {
- ok(true, "Looking for action at index " + aButtonIndex);
-
- var notifications = SpecialPowers.wrap(aPopup.owner).panel.childNodes;
- ok(notifications.length > 0, "at least one notification displayed");
- ok(true, notifications.length + " notifications");
- var notification = notifications[0];
-
- if (aButtonIndex == 0) {
- ok(true, "Triggering main action");
- notification.button.doCommand();
- } else if (aButtonIndex <= aPopup.secondaryActions.length) {
- var index = aButtonIndex;
- ok(true, "Triggering secondary action " + index);
- notification.childNodes[index].doCommand();
- }
-}
-
-const kRememberButton = 0;
-const kNeverButton = 1;
-
-const kChangeButton = 0;
-const kDontChangeButton = 1;
-
-function dumpNotifications() {
- try {
- // PopupNotifications
- var container = getPopupNotifications(window.top);
- ok(true, "is popup panel open? " + container.isPanelOpen);
- var notes = container._currentNotifications;
- ok(true, "Found " + notes.length + " popup notifications.");
- for (let i = 0; i < notes.length; i++) {
- ok(true, "#" + i + ": " + notes[i].id);
- }
-
- // Notification bars
- var chromeWin = SpecialPowers.wrap(window.top)
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell)
- .chromeEventHandler.ownerDocument.defaultView;
- var nb = chromeWin.getNotificationBox(window.top);
- notes = nb.allNotifications;
- ok(true, "Found " + notes.length + " notification bars.");
- for (let i = 0; i < notes.length; i++) {
- ok(true, "#" + i + ": " + notes[i].getAttribute("value"));
- }
- } catch (e) { todo(false, "WOAH! " + e); }
-}
diff --git a/toolkit/components/passwordmgr/test/chrome/privbrowsing_perwindowpb_iframe.html b/toolkit/components/passwordmgr/test/chrome/privbrowsing_perwindowpb_iframe.html
deleted file mode 100644
index 2efdab265..000000000
--- a/toolkit/components/passwordmgr/test/chrome/privbrowsing_perwindowpb_iframe.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
-</head>
-<body>
-<iframe id="iframe"></iframe>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_1.html b/toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_1.html
deleted file mode 100644
index 8c7202dd0..000000000
--- a/toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_1.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications (private browsing)</title>
-</head>
-<body>
-<h2>Subtest 1</h2>
-<!--
- Make sure that the password-save notification appears outside of
- the private mode, but not inside it.
--->
-<form id="form" action="formsubmit.sjs">
- <input id="user" name="user" type="text">
- <input id="pass" name="pass" type="password">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- userField.value = "notifyu1";
- passField.value = "notifyp1";
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var userField = document.getElementById("user");
-var passField = document.getElementById("pass");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_2.html b/toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_2.html
deleted file mode 100644
index bf3b85159..000000000
--- a/toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_2.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications (private browsing)</title>
-</head>
-<body>
-<h2>Subtest 2</h2>
-<!--
- Make sure that the password-change notification appears outside of
- the private mode, but not inside it.
--->
-<form id="form" action="formsubmit.sjs">
- <input id="pass" name="pass" type="password">
- <input id="newpass" name="newpass" type="password">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- passField.value = "notifyp1";
- passField2.value = "notifyp2";
- form.submit();
-}
-
-window.onload = submitForm;
-var form = document.getElementById("form");
-var passField = document.getElementById("pass");
-var passField2 = document.getElementById("newpass");
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_3.html b/toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_3.html
deleted file mode 100644
index e88a302e0..000000000
--- a/toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_3.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications (private browsing)</title>
-</head>
-<body>
-<h2>Subtest 3</h2>
-<!--
- Make sure that the user/pass fields are auto-filled outside of
- the private mode, but not inside it.
--->
-<form id="form" action="formsubmit.sjs">
- <input id="user" name="user" type="text">
- <input id="pass" name="pass" type="password">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function submitForm() {
- form.submit();
-}
-
-var form = document.getElementById("form");
-window.addEventListener('message', () => { submitForm(); });
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_4.html b/toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_4.html
deleted file mode 100644
index 184142743..000000000
--- a/toolkit/components/passwordmgr/test/chrome/subtst_privbrowsing_4.html
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Subtest for Login Manager notifications (private browsing)</title>
- <script type="text/javascript" src="pwmgr_common.js"></script>
-</head>
-<body>
-<h2>Subtest 4</h2>
-<!--
- Make sure that the user/pass fields have manual filling enabled
- in private mode.
--->
-<form id="form" action="formsubmit.sjs">
- <input id="user" name="user" type="text">
- <input id="pass" name="pass" type="password">
- <button type='submit'>Submit</button>
-</form>
-
-<script>
-function startAutocomplete() {
- userField.focus();
- doKey("down");
- setTimeout(submitForm, 100);
-}
-
-function submitForm() {
- doKey("down");
- doKey("return");
- setTimeout(function() { form.submit(); }, 100);
-}
-
-var form = document.getElementById("form");
-var userField = document.getElementById("user");
-
-window.addEventListener('message', () => { startAutocomplete(); });
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/chrome/test_privbrowsing_perwindowpb.html b/toolkit/components/passwordmgr/test/chrome/test_privbrowsing_perwindowpb.html
deleted file mode 100644
index 6b7d4abb3..000000000
--- a/toolkit/components/passwordmgr/test/chrome/test_privbrowsing_perwindowpb.html
+++ /dev/null
@@ -1,322 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=248970
--->
-<head>
- <meta charset="utf-8">
- <title>Test for Private Browsing</title>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="notification_common.js"></script>
- <link rel="stylesheet" type="text/css"
- href="chrome://mochikit/content/tests/SimpleTest/test.css">
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=248970">Mozilla Bug 248970</a>
-<p id="display"></p>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Bug 248970 **/
-// based on test_notifications.html
-
-const Ci = SpecialPowers.Ci;
-const Cc = SpecialPowers.Cc;
-const Cr = SpecialPowers.Cr;
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-var testpath = "/chrome/toolkit/components/passwordmgr/test/chrome/";
-var prefix = "http://test2.example.com" + testpath;
-var subtests = [
- "subtst_privbrowsing_1.html", // 1
- "subtst_privbrowsing_1.html", // 2
- "subtst_privbrowsing_1.html", // 3
- "subtst_privbrowsing_2.html", // 4
- "subtst_privbrowsing_2.html", // 5
- "subtst_privbrowsing_2.html", // 6
- "subtst_privbrowsing_3.html", // 7
- "subtst_privbrowsing_3.html", // 8
- "subtst_privbrowsing_4.html", // 9
- "subtst_privbrowsing_3.html" // 10
- ];
-var observer;
-
-var testNum = 0;
-function loadNextTest() {
- // run the initialization code for each test
- switch (++ testNum) {
- case 1:
- popupNotifications = normalWindowPopupNotifications;
- iframe = normalWindowIframe;
- break;
-
- case 2:
- popupNotifications = privateWindowPopupNotifications;
- iframe = privateWindowIframe;
- break;
-
- case 3:
- popupNotifications = normalWindowPopupNotifications;
- iframe = normalWindowIframe;
- break;
-
- case 4:
- pwmgr.addLogin(login);
- break;
-
- case 5:
- popupNotifications = privateWindowPopupNotifications;
- iframe = privateWindowIframe;
- break;
-
- case 6:
- popupNotifications = normalWindowPopupNotifications;
- iframe = normalWindowIframe;
- break;
-
- case 7:
- pwmgr.addLogin(login);
- break;
-
- case 8:
- popupNotifications = privateWindowPopupNotifications;
- iframe = privateWindowIframe;
- break;
-
- case 9:
- break;
-
- case 10:
- popupNotifications = normalWindowPopupNotifications;
- iframe = normalWindowIframe;
- break;
-
- default:
- ok(false, "Unexpected call to loadNextTest for test #" + testNum);
- }
-
- if (testNum === 7) {
- observer = SpecialPowers.wrapCallback(function(subject, topic, data) {
- SimpleTest.executeSoon(() => { iframe.contentWindow.postMessage("go", "*"); });
- });
- SpecialPowers.addObserver(observer, "passwordmgr-processed-form", false);
- }
-
- ok(true, "Starting test #" + testNum);
- iframe.src = prefix + subtests[testNum - 1];
-}
-
-function checkTest() {
- var popup;
- var gotUser;
- var gotPass;
-
- switch (testNum) {
- case 1:
- // run outside of private mode, popup notification should appear
- popup = getPopup(popupNotifications, "password-save");
- ok(popup, "got popup notification");
- popup.remove();
- break;
-
- case 2:
- // run inside of private mode, popup notification should not appear
- popup = getPopup(popupNotifications, "password-save");
- ok(!popup, "checking for no popup notification");
- break;
-
- case 3:
- // run outside of private mode, popup notification should appear
- popup = getPopup(popupNotifications, "password-save");
- ok(popup, "got popup notification");
- popup.remove();
- break;
-
- case 4:
- // run outside of private mode, popup notification should appear
- popup = getPopup(popupNotifications, "password-change");
- ok(popup, "got popup notification");
- popup.remove();
- break;
-
- case 5:
- // run inside of private mode, popup notification should not appear
- popup = getPopup(popupNotifications, "password-change");
- ok(!popup, "checking for no popup notification");
- break;
-
- case 6:
- // run outside of private mode, popup notification should appear
- popup = getPopup(popupNotifications, "password-change");
- ok(popup, "got popup notification");
- popup.remove();
- pwmgr.removeLogin(login);
- break;
-
- case 7:
- // verify that the user/pass pair was autofilled
- gotUser = iframe.contentDocument.getElementById("user").textContent;
- gotPass = iframe.contentDocument.getElementById("pass").textContent;
- is(gotUser, "notifyu1", "Checking submitted username");
- is(gotPass, "notifyp1", "Checking submitted password");
- break;
-
- case 8:
- // verify that the user/pass pair was not autofilled
- gotUser = iframe.contentDocument.getElementById("user").textContent;
- gotPass = iframe.contentDocument.getElementById("pass").textContent;
- is(gotUser, "", "Checking submitted username");
- is(gotPass, "", "Checking submitted password");
- break;
-
- case 9:
- // verify that the user/pass pair was available for autocomplete
- gotUser = iframe.contentDocument.getElementById("user").textContent;
- gotPass = iframe.contentDocument.getElementById("pass").textContent;
- is(gotUser, "notifyu1", "Checking submitted username");
- is(gotPass, "notifyp1", "Checking submitted password");
- break;
-
- case 10:
- // verify that the user/pass pair was autofilled
- gotUser = iframe.contentDocument.getElementById("user").textContent;
- gotPass = iframe.contentDocument.getElementById("pass").textContent;
- is(gotUser, "notifyu1", "Checking submitted username");
- is(gotPass, "notifyp1", "Checking submitted password");
- pwmgr.removeLogin(login);
- break;
-
- default:
- ok(false, "Unexpected call to checkTest for test #" + testNum);
-
- }
-}
-
-var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShellTreeItem)
- .rootTreeItem
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindow);
-var contentPage = "http://mochi.test:8888/chrome/toolkit/components/passwordmgr/test/chrome/privbrowsing_perwindowpb_iframe.html";
-var testWindows = [];
-
-function whenDelayedStartupFinished(aWindow, aCallback) {
- Services.obs.addObserver(function obs(aSubject, aTopic) {
- if (aWindow == aSubject) {
- Services.obs.removeObserver(obs, aTopic);
- setTimeout(aCallback, 0);
- }
- }, "browser-delayed-startup-finished", false);
-}
-
-function testOnWindow(aIsPrivate, aCallback) {
- var win = mainWindow.OpenBrowserWindow({private: aIsPrivate});
- win.addEventListener("load", function onLoad() {
- win.removeEventListener("load", onLoad, false);
- whenDelayedStartupFinished(win, function() {
- win.addEventListener("DOMContentLoaded", function onInnerLoad() {
- if (win.content.location.href != contentPage) {
- win.gBrowser.loadURI(contentPage);
- return;
- }
- win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
-
- win.content.addEventListener('load', function innerLoad2() {
- win.content.removeEventListener('load', innerLoad2, false);
- testWindows.push(win);
- SimpleTest.executeSoon(function() { aCallback(win); });
- }, false, true);
- }, true);
- SimpleTest.executeSoon(function() { win.gBrowser.loadURI(contentPage); });
- });
- }, true);
-}
-
-var ignoreLoad = false;
-function handleLoad(aEvent) {
- // ignore every other load event ... We get one for loading the subtest (which
- // we want to ignore), and another when the subtest's form submits itself
- // (which we want to handle, to start the next test).
- ignoreLoad = !ignoreLoad;
- if (ignoreLoad) {
- ok(true, "Ignoring load of subtest #" + testNum);
- return;
- }
- ok(true, "Processing submission of subtest #" + testNum);
-
- checkTest();
-
- if (testNum < subtests.length) {
- loadNextTest();
- } else {
- ok(true, "private browsing notification tests finished.");
-
- testWindows.forEach(function(aWin) {
- aWin.close();
- });
-
- SpecialPowers.removeObserver(observer, "passwordmgr-processed-form");
- SimpleTest.finish();
- }
-}
-
-var pwmgr = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
-ok(pwmgr != null, "Access pwmgr");
-
-// We need to make sure no logins have been stored by previous tests
-// for forms in |url|, otherwise the change password notification
-// would turn into a prompt, and the test will fail.
-var url = "http://test2.example.com";
-is(pwmgr.countLogins(url, "", null), 0, "No logins should be stored for " + url);
-
-var nsLoginInfo = new SpecialPowers.wrap(SpecialPowers.Components).Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
-var login = new nsLoginInfo(url, url, null, "notifyu1", "notifyp1", "user", "pass");
-
-var normalWindow;
-var privateWindow;
-
-var iframe;
-var normalWindowIframe;
-var privateWindowIframe;
-
-var popupNotifications;
-var normalWindowPopupNotifications;
-var privateWindowPopupNotifications;
-
-testOnWindow(false, function(aWin) {
- var selectedBrowser = aWin.gBrowser.selectedBrowser;
- normalWindowIframe = selectedBrowser.contentDocument.getElementById("iframe");
- normalWindowIframe.onload = handleLoad;
- selectedBrowser.focus();
-
- normalWindowPopupNotifications = getPopupNotifications(selectedBrowser.contentWindow.top);
- ok(normalWindowPopupNotifications, "Got popupNotifications in normal window");
- // ignore the first load for this window;
- ignoreLoad = false;
-
- testOnWindow(true, function(aPrivateWin) {
- selectedBrowser = aPrivateWin.gBrowser.selectedBrowser;
- privateWindowIframe = selectedBrowser.contentDocument.getElementById("iframe");
- privateWindowIframe.onload = handleLoad;
- selectedBrowser.focus();
-
- privateWindowPopupNotifications = getPopupNotifications(selectedBrowser.contentWindow.top);
- ok(privateWindowPopupNotifications, "Got popupNotifications in private window");
- // ignore the first load for this window;
- ignoreLoad = false;
-
- SimpleTest.executeSoon(loadNextTest);
- });
-});
-
-SimpleTest.waitForExplicitFinish();
-</script>
-</pre>
-</body>
-</html>
-
diff --git a/toolkit/components/passwordmgr/test/chrome_timeout.js b/toolkit/components/passwordmgr/test/chrome_timeout.js
deleted file mode 100644
index 9049d0bea..000000000
--- a/toolkit/components/passwordmgr/test/chrome_timeout.js
+++ /dev/null
@@ -1,11 +0,0 @@
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-addMessageListener('setTimeout', msg => {
- let timer = Cc['@mozilla.org/timer;1'].createInstance(Ci.nsITimer);
- timer.init(_ => {
- sendAsyncMessage('timeout');
- }, msg.delay, Ci.nsITimer.TYPE_ONE_SHOT);
-});
-
-sendAsyncMessage('ready');
diff --git a/toolkit/components/passwordmgr/test/formsubmit.sjs b/toolkit/components/passwordmgr/test/formsubmit.sjs
deleted file mode 100644
index 4b4a387f7..000000000
--- a/toolkit/components/passwordmgr/test/formsubmit.sjs
+++ /dev/null
@@ -1,37 +0,0 @@
-function handleRequest(request, response)
-{
- try {
- reallyHandleRequest(request, response);
- } catch (e) {
- response.setStatusLine("1.0", 200, "AlmostOK");
- response.write("Error handling request: " + e);
- }
-}
-
-
-function reallyHandleRequest(request, response) {
- var match;
- var requestAuth = true;
-
- // XXX I bet this doesn't work for POST requests.
- var query = request.queryString;
-
- var user = null, pass = null;
- // user=xxx
- match = /user=([^&]*)/.exec(query);
- if (match)
- user = match[1];
-
- // pass=xxx
- match = /pass=([^&]*)/.exec(query);
- if (match)
- pass = match[1];
-
- response.setStatusLine("1.0", 200, "OK");
-
- response.setHeader("Content-Type", "application/xhtml+xml", false);
- response.write("<html xmlns='http://www.w3.org/1999/xhtml'>");
- response.write("<p>User: <span id='user'>" + user + "</span></p>\n");
- response.write("<p>Pass: <span id='pass'>" + pass + "</span></p>\n");
- response.write("</html>");
-}
diff --git a/toolkit/components/passwordmgr/test/mochitest.ini b/toolkit/components/passwordmgr/test/mochitest.ini
deleted file mode 100644
index 640f5c256..000000000
--- a/toolkit/components/passwordmgr/test/mochitest.ini
+++ /dev/null
@@ -1,20 +0,0 @@
-[DEFAULT]
-skip-if = e10s
-support-files =
- authenticate.sjs
- blank.html
- formsubmit.sjs
- prompt_common.js
- pwmgr_common.js
- subtst_master_pass.html
- subtst_prompt_async.html
- chrome_timeout.js
-
-[test_master_password.html]
-skip-if = toolkit == 'android' # Tests desktop prompts
-[test_prompt_async.html]
-skip-if = toolkit == 'android' # Tests desktop prompts
-[test_xhr.html]
-skip-if = toolkit == 'android' # Tests desktop prompts
-[test_xml_load.html]
-skip-if = toolkit == 'android' # Tests desktop prompts
diff --git a/toolkit/components/passwordmgr/test/mochitest/auth2/authenticate.sjs b/toolkit/components/passwordmgr/test/mochitest/auth2/authenticate.sjs
deleted file mode 100644
index d2f650013..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/auth2/authenticate.sjs
+++ /dev/null
@@ -1,220 +0,0 @@
-function handleRequest(request, response)
-{
- try {
- reallyHandleRequest(request, response);
- } catch (e) {
- response.setStatusLine("1.0", 200, "AlmostOK");
- response.write("Error handling request: " + e);
- }
-}
-
-
-function reallyHandleRequest(request, response) {
- var match;
- var requestAuth = true, requestProxyAuth = true;
-
- // Allow the caller to drive how authentication is processed via the query.
- // Eg, http://localhost:8888/authenticate.sjs?user=foo&realm=bar
- // The extra ? allows the user/pass/realm checks to succeed if the name is
- // at the beginning of the query string.
- var query = "?" + request.queryString;
-
- var expected_user = "", expected_pass = "", realm = "mochitest";
- var proxy_expected_user = "", proxy_expected_pass = "", proxy_realm = "mochi-proxy";
- var huge = false, plugin = false, anonymous = false;
- var authHeaderCount = 1;
- // user=xxx
- match = /[^_]user=([^&]*)/.exec(query);
- if (match)
- expected_user = match[1];
-
- // pass=xxx
- match = /[^_]pass=([^&]*)/.exec(query);
- if (match)
- expected_pass = match[1];
-
- // realm=xxx
- match = /[^_]realm=([^&]*)/.exec(query);
- if (match)
- realm = match[1];
-
- // proxy_user=xxx
- match = /proxy_user=([^&]*)/.exec(query);
- if (match)
- proxy_expected_user = match[1];
-
- // proxy_pass=xxx
- match = /proxy_pass=([^&]*)/.exec(query);
- if (match)
- proxy_expected_pass = match[1];
-
- // proxy_realm=xxx
- match = /proxy_realm=([^&]*)/.exec(query);
- if (match)
- proxy_realm = match[1];
-
- // huge=1
- match = /huge=1/.exec(query);
- if (match)
- huge = true;
-
- // plugin=1
- match = /plugin=1/.exec(query);
- if (match)
- plugin = true;
-
- // multiple=1
- match = /multiple=([^&]*)/.exec(query);
- if (match)
- authHeaderCount = match[1]+0;
-
- // anonymous=1
- match = /anonymous=1/.exec(query);
- if (match)
- anonymous = true;
-
- // Look for an authentication header, if any, in the request.
- //
- // EG: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
- //
- // This test only supports Basic auth. The value sent by the client is
- // "username:password", obscured with base64 encoding.
-
- var actual_user = "", actual_pass = "", authHeader, authPresent = false;
- if (request.hasHeader("Authorization")) {
- authPresent = true;
- authHeader = request.getHeader("Authorization");
- match = /Basic (.+)/.exec(authHeader);
- if (match.length != 2)
- throw new Error("Couldn't parse auth header: " + authHeader);
-
- var userpass = base64ToString(match[1]); // no atob() :-(
- match = /(.*):(.*)/.exec(userpass);
- if (match.length != 3)
- throw new Error("Couldn't decode auth header: " + userpass);
- actual_user = match[1];
- actual_pass = match[2];
- }
-
- var proxy_actual_user = "", proxy_actual_pass = "";
- if (request.hasHeader("Proxy-Authorization")) {
- authHeader = request.getHeader("Proxy-Authorization");
- match = /Basic (.+)/.exec(authHeader);
- if (match.length != 2)
- throw new Error("Couldn't parse auth header: " + authHeader);
-
- var userpass = base64ToString(match[1]); // no atob() :-(
- match = /(.*):(.*)/.exec(userpass);
- if (match.length != 3)
- throw new Error("Couldn't decode auth header: " + userpass);
- proxy_actual_user = match[1];
- proxy_actual_pass = match[2];
- }
-
- // Don't request authentication if the credentials we got were what we
- // expected.
- if (expected_user == actual_user &&
- expected_pass == actual_pass) {
- requestAuth = false;
- }
- if (proxy_expected_user == proxy_actual_user &&
- proxy_expected_pass == proxy_actual_pass) {
- requestProxyAuth = false;
- }
-
- if (anonymous) {
- if (authPresent) {
- response.setStatusLine("1.0", 400, "Unexpected authorization header found");
- } else {
- response.setStatusLine("1.0", 200, "Authorization header not found");
- }
- } else {
- if (requestProxyAuth) {
- response.setStatusLine("1.0", 407, "Proxy authentication required");
- for (i = 0; i < authHeaderCount; ++i)
- response.setHeader("Proxy-Authenticate", "basic realm=\"" + proxy_realm + "\"", true);
- } else if (requestAuth) {
- response.setStatusLine("1.0", 401, "Authentication required");
- for (i = 0; i < authHeaderCount; ++i)
- response.setHeader("WWW-Authenticate", "basic realm=\"" + realm + "\"", true);
- } else {
- response.setStatusLine("1.0", 200, "OK");
- }
- }
-
- response.setHeader("Content-Type", "application/xhtml+xml", false);
- response.write("<html xmlns='http://www.w3.org/1999/xhtml'>");
- response.write("<p>Login: <span id='ok'>" + (requestAuth ? "FAIL" : "PASS") + "</span></p>\n");
- response.write("<p>Proxy: <span id='proxy'>" + (requestProxyAuth ? "FAIL" : "PASS") + "</span></p>\n");
- response.write("<p>Auth: <span id='auth'>" + authHeader + "</span></p>\n");
- response.write("<p>User: <span id='user'>" + actual_user + "</span></p>\n");
- response.write("<p>Pass: <span id='pass'>" + actual_pass + "</span></p>\n");
-
- if (huge) {
- response.write("<div style='display: none'>");
- for (i = 0; i < 100000; i++) {
- response.write("123456789\n");
- }
- response.write("</div>");
- response.write("<span id='footnote'>This is a footnote after the huge content fill</span>");
- }
-
- if (plugin) {
- response.write("<embed id='embedtest' style='width: 400px; height: 100px;' " +
- "type='application/x-test'></embed>\n");
- }
-
- response.write("</html>");
-}
-
-
-// base64 decoder
-//
-// Yoinked from extensions/xml-rpc/src/nsXmlRpcClient.js because btoa()
-// doesn't seem to exist. :-(
-/* Convert Base64 data to a string */
-const toBinaryTable = [
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
- 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
- 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
- -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
- 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
-];
-const base64Pad = '=';
-
-function base64ToString(data) {
-
- var result = '';
- var leftbits = 0; // number of bits decoded, but yet to be appended
- var leftdata = 0; // bits decoded, but yet to be appended
-
- // Convert one by one.
- for (var i = 0; i < data.length; i++) {
- var c = toBinaryTable[data.charCodeAt(i) & 0x7f];
- var padding = (data[i] == base64Pad);
- // Skip illegal characters and whitespace
- if (c == -1) continue;
-
- // Collect data into leftdata, update bitcount
- leftdata = (leftdata << 6) | c;
- leftbits += 6;
-
- // If we have 8 or more bits, append 8 bits to the result
- if (leftbits >= 8) {
- leftbits -= 8;
- // Append if not padding.
- if (!padding)
- result += String.fromCharCode((leftdata >> leftbits) & 0xff);
- leftdata &= (1 << leftbits) - 1;
- }
- }
-
- // If there are any bits left, the base64 string was corrupted
- if (leftbits)
- throw Components.Exception('Corrupted base64 string');
-
- return result;
-}
diff --git a/toolkit/components/passwordmgr/test/mochitest/mochitest.ini b/toolkit/components/passwordmgr/test/mochitest/mochitest.ini
deleted file mode 100644
index a4170d7e0..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/mochitest.ini
+++ /dev/null
@@ -1,69 +0,0 @@
-[DEFAULT]
-support-files =
- ../../../prompts/test/chromeScript.js
- ../../../prompts/test/prompt_common.js
- ../../../satchel/test/parent_utils.js
- ../../../satchel/test/satchel_common.js
- ../authenticate.sjs
- ../blank.html
- ../browser/form_autofocus_js.html
- ../browser/form_basic.html
- ../browser/form_cross_origin_secure_action.html
- ../pwmgr_common.js
- auth2/authenticate.sjs
-
-[test_autocomplete_https_upgrade.html]
-skip-if = toolkit == 'android' # autocomplete
-[test_autofill_https_upgrade.html]
-skip-if = toolkit == 'android' # Bug 1259768
-[test_autofill_password-only.html]
-[test_autofocus_js.html]
-skip-if = toolkit == 'android' # autocomplete
-[test_basic_form.html]
-[test_basic_form_0pw.html]
-[test_basic_form_1pw.html]
-[test_basic_form_1pw_2.html]
-[test_basic_form_2pw_1.html]
-[test_basic_form_2pw_2.html]
-[test_basic_form_3pw_1.html]
-[test_basic_form_autocomplete.html]
-skip-if = toolkit == 'android' # android:autocomplete.
-[test_insecure_form_field_autocomplete.html]
-skip-if = toolkit == 'android' # android:autocomplete.
-[test_password_field_autocomplete.html]
-skip-if = toolkit == 'android' # android:autocomplete.
-[test_insecure_form_field_no_saved_login.html]
-skip-if = toolkit == 'android' || os == 'linux' # android:autocomplete., linux: bug 1325778
-[test_basic_form_html5.html]
-[test_basic_form_pwevent.html]
-[test_basic_form_pwonly.html]
-[test_bug_627616.html]
-skip-if = toolkit == 'android' # Tests desktop prompts
-[test_bug_776171.html]
-[test_case_differences.html]
-skip-if = toolkit == 'android' # autocomplete
-[test_form_action_1.html]
-[test_form_action_2.html]
-[test_form_action_javascript.html]
-[test_formless_autofill.html]
-[test_formless_submit.html]
-[test_formless_submit_navigation.html]
-[test_formless_submit_navigation_negative.html]
-[test_input_events.html]
-[test_input_events_for_identical_values.html]
-[test_maxlength.html]
-[test_passwords_in_type_password.html]
-[test_prompt.html]
-skip-if = os == "linux" || toolkit == 'android' # Tests desktop prompts
-[test_prompt_http.html]
-skip-if = os == "linux" || toolkit == 'android' # Tests desktop prompts
-[test_prompt_noWindow.html]
-skip-if = e10s || toolkit == 'android' # Tests desktop prompts. e10s: bug 1217876
-[test_prompt_promptAuth.html]
-skip-if = os == "linux" || toolkit == 'android' # Tests desktop prompts
-[test_prompt_promptAuth_proxy.html]
-skip-if = e10s || os == "linux" || toolkit == 'android' # Tests desktop prompts
-[test_recipe_login_fields.html]
-[test_username_focus.html]
-skip-if = toolkit == 'android' # android:autocomplete.
-[test_xhr_2.html]
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_https_upgrade.html b/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_https_upgrade.html
deleted file mode 100644
index 7d5725322..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_autocomplete_https_upgrade.html
+++ /dev/null
@@ -1,218 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test autocomplete on an HTTPS page using upgraded HTTP logins</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<script>
-const chromeScript = runChecksAfterCommonInit(false);
-
-runInParent(function addLogins() {
- const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
- Cu.import("resource://gre/modules/Services.jsm");
-
- // Create some logins just for this form, since we'll be deleting them.
- let nsLoginInfo = Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
-
- // We have two actual HTTPS to avoid autofill before the schemeUpgrades pref flips to true.
- let login0 = new nsLoginInfo("https://example.org", "https://example.org", null,
- "name", "pass", "uname", "pword");
-
- let login1 = new nsLoginInfo("https://example.org", "https://example.org", null,
- "name1", "pass1", "uname", "pword");
-
- // Same as above but HTTP instead of HTTPS (to test de-duping)
- let login2 = new nsLoginInfo("http://example.org", "http://example.org", null,
- "name1", "passHTTP", "uname", "pword");
-
- // Different HTTP login to upgrade with secure formSubmitURL
- let login3 = new nsLoginInfo("http://example.org", "https://example.org", null,
- "name2", "passHTTPtoHTTPS", "uname", "pword");
-
- try {
- Services.logins.addLogin(login0);
- Services.logins.addLogin(login1);
- Services.logins.addLogin(login2);
- Services.logins.addLogin(login3);
- } catch (e) {
- assert.ok(false, "addLogin threw: " + e);
- }
-});
-</script>
-<p id="display"></p>
-
-<!-- we presumably can't hide the content for this test. -->
-<div id="content">
- <iframe src="https://example.org/tests/toolkit/components/passwordmgr/test/mochitest/form_basic.html"></iframe>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-const shiftModifier = SpecialPowers.Ci.nsIDOMEvent.SHIFT_MASK;
-
-let iframe = SpecialPowers.wrap(document.getElementsByTagName("iframe")[0]);
-let iframeDoc;
-let uname;
-let pword;
-
-// Restore the form to the default state.
-function restoreForm() {
- pword.focus();
- uname.value = "";
- pword.value = "";
- uname.focus();
-}
-
-// Check for expected username/password in form.
-function checkACForm(expectedUsername, expectedPassword) {
- let formID = uname.parentNode.id;
- is(uname.value, expectedUsername, "Checking " + formID + " username");
- is(pword.value, expectedPassword, "Checking " + formID + " password");
-}
-
-add_task(function* setup() {
- yield SpecialPowers.pushPrefEnv({"set": [["signon.schemeUpgrades", true]]});
-
- yield new Promise(resolve => {
- iframe.addEventListener("load", function onLoad() {
- iframe.removeEventListener("load", onLoad);
- resolve();
- });
- });
-
- iframeDoc = iframe.contentDocument;
- uname = iframeDoc.getElementById("form-basic-username");
- pword = iframeDoc.getElementById("form-basic-password");
-});
-
-add_task(function* test_empty_first_entry() {
- // Make sure initial form is empty.
- checkACForm("", "");
- // Trigger autocomplete popup
- restoreForm();
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup is initially closed");
- let shownPromise = promiseACShown();
- doKey("down");
- let results = yield shownPromise;
- popupState = yield getPopupState();
- is(popupState.selectedIndex, -1, "Check no entries are selected");
- checkArrayValues(results, ["name", "name1", "name2"], "initial");
-
- // Check first entry
- let index0Promise = notifySelectedIndex(0);
- doKey("down");
- yield index0Promise;
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("name", "pass");
-});
-
-add_task(function* test_empty_second_entry() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
- doKey("down"); // first
- doKey("down"); // second
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("name1", "pass1");
-});
-
-add_task(function* test_search() {
- restoreForm();
- let shownPromise = promiseACShown();
- // We need to blur for the autocomplete controller to notice the forced value below.
- uname.blur();
- uname.value = "name";
- uname.focus();
- sendChar("1");
- doKey("down"); // open
- let results = yield shownPromise;
- checkArrayValues(results, ["name1"], "check result deduping for 'name1'");
- doKey("down"); // first
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("name1", "pass1");
-
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup is now closed");
-});
-
-add_task(function* test_delete_first_entry() {
- restoreForm();
- uname.focus();
- let shownPromise = promiseACShown();
- doKey("down");
- yield shownPromise;
-
- let index0Promise = notifySelectedIndex(0);
- doKey("down");
- yield index0Promise;
-
- let deletionPromise = promiseStorageChanged(["removeLogin"]);
- // On OS X, shift-backspace and shift-delete work, just delete does not.
- // On Win/Linux, shift-backspace does not work, delete and shift-delete do.
- doKey("delete", shiftModifier);
- yield deletionPromise;
- checkACForm("", "");
-
- let results = yield notifyMenuChanged(2, "name1");
-
- checkArrayValues(results, ["name1", "name2"], "two should remain after deleting the first");
- let popupState = yield getPopupState();
- is(popupState.open, true, "Check popup stays open after deleting");
- doKey("escape");
- popupState = yield getPopupState();
- is(popupState.open, false, "Check popup closed upon ESC");
-});
-
-add_task(function* test_delete_duplicate_entry() {
- restoreForm();
- uname.focus();
- let shownPromise = promiseACShown();
- doKey("down");
- yield shownPromise;
-
- let index0Promise = notifySelectedIndex(0);
- doKey("down");
- yield index0Promise;
-
- let deletionPromise = promiseStorageChanged(["removeLogin"]);
- // On OS X, shift-backspace and shift-delete work, just delete does not.
- // On Win/Linux, shift-backspace does not work, delete and shift-delete do.
- doKey("delete", shiftModifier);
- yield deletionPromise;
- checkACForm("", "");
-
- is(LoginManager.countLogins("http://example.org", "http://example.org", null), 1,
- "Check that the HTTP login remains");
- is(LoginManager.countLogins("https://example.org", "https://example.org", null), 0,
- "Check that the HTTPS login was deleted");
-
- // Two menu items should remain as the HTTPS login should have been deleted but
- // the HTTP would remain.
- let results = yield notifyMenuChanged(1, "name2");
-
- checkArrayValues(results, ["name2"], "one should remain after deleting the HTTPS name1");
- let popupState = yield getPopupState();
- is(popupState.open, true, "Check popup stays open after deleting");
- doKey("escape");
- popupState = yield getPopupState();
- is(popupState.open, false, "Check popup closed upon ESC");
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_autofill_https_upgrade.html b/toolkit/components/passwordmgr/test/mochitest/test_autofill_https_upgrade.html
deleted file mode 100644
index ee1424002..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_autofill_https_upgrade.html
+++ /dev/null
@@ -1,117 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test autocomplete on an HTTPS page using upgraded HTTP logins</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<script>
-const MISSING_ACTION_PATH = TESTS_DIR + "mochitest/form_basic.html";
-const CROSS_ORIGIN_SECURE_PATH = TESTS_DIR + "mochitest/form_cross_origin_secure_action.html";
-
-const chromeScript = runChecksAfterCommonInit(false);
-
-let nsLoginInfo = SpecialPowers.wrap(SpecialPowers.Components).Constructor("@mozilla.org/login-manager/loginInfo;1",
-SpecialPowers.Ci.nsILoginInfo,
-"init");
-</script>
-<p id="display"></p>
-
-<!-- we presumably can't hide the content for this test. -->
-<div id="content">
- <iframe></iframe>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-let iframe = SpecialPowers.wrap(document.getElementsByTagName("iframe")[0]);
-
-// Check for expected username/password in form.
-function checkACForm(expectedUsername, expectedPassword) {
- let iframeDoc = iframe.contentDocument;
- let uname = iframeDoc.getElementById("form-basic-username");
- let pword = iframeDoc.getElementById("form-basic-password");
- let formID = uname.parentNode.id;
- is(uname.value, expectedUsername, "Checking " + formID + " username");
- is(pword.value, expectedPassword, "Checking " + formID + " password");
-}
-function* prepareLoginsAndProcessForm(url, logins = []) {
- LoginManager.removeAllLogins();
-
- let dates = Date.now();
- for (let login of logins) {
- SpecialPowers.do_QueryInterface(login, SpecialPowers.Ci.nsILoginMetaInfo);
- // Force all dates to be the same so they don't affect things like deduping.
- login.timeCreated = login.timePasswordChanged = login.timeLastUsed = dates;
- LoginManager.addLogin(login);
- }
-
- iframe.src = url;
- yield promiseFormsProcessed();
-}
-
-add_task(function* setup() {
- yield SpecialPowers.pushPrefEnv({"set": [["signon.schemeUpgrades", true]]});
-});
-
-add_task(function* test_simpleNoDupesNoAction() {
- yield prepareLoginsAndProcessForm("https://example.com" + MISSING_ACTION_PATH, [
- new nsLoginInfo("http://example.com", "http://example.com", null,
- "name2", "pass2", "uname", "pword"),
- ]);
-
- checkACForm("name2", "pass2");
-});
-
-add_task(function* test_simpleNoDupesUpgradeOriginAndAction() {
- yield prepareLoginsAndProcessForm("https://example.com" + CROSS_ORIGIN_SECURE_PATH, [
- new nsLoginInfo("http://example.com", "http://another.domain", null,
- "name2", "pass2", "uname", "pword"),
- ]);
-
- checkACForm("name2", "pass2");
-});
-
-add_task(function* test_simpleNoDupesUpgradeOriginOnly() {
- yield prepareLoginsAndProcessForm("https://example.com" + CROSS_ORIGIN_SECURE_PATH, [
- new nsLoginInfo("http://example.com", "https://another.domain", null,
- "name2", "pass2", "uname", "pword"),
- ]);
-
- checkACForm("name2", "pass2");
-});
-
-add_task(function* test_simpleNoDupesUpgradeActionOnly() {
- yield prepareLoginsAndProcessForm("https://example.com" + CROSS_ORIGIN_SECURE_PATH, [
- new nsLoginInfo("https://example.com", "http://another.domain", null,
- "name2", "pass2", "uname", "pword"),
- ]);
-
- checkACForm("name2", "pass2");
-});
-
-add_task(function* test_dedupe() {
- yield prepareLoginsAndProcessForm("https://example.com" + MISSING_ACTION_PATH, [
- new nsLoginInfo("https://example.com", "https://example.com", null,
- "name1", "passHTTPStoHTTPS", "uname", "pword"),
- new nsLoginInfo("http://example.com", "http://example.com", null,
- "name1", "passHTTPtoHTTP", "uname", "pword"),
- new nsLoginInfo("http://example.com", "https://example.com", null,
- "name1", "passHTTPtoHTTPS", "uname", "pword"),
- new nsLoginInfo("https://example.com", "http://example.com", null,
- "name1", "passHTTPStoHTTP", "uname", "pword"),
- ]);
-
- checkACForm("name1", "passHTTPStoHTTPS");
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_autofill_password-only.html b/toolkit/components/passwordmgr/test/mochitest/test_autofill_password-only.html
deleted file mode 100644
index 983356371..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_autofill_password-only.html
+++ /dev/null
@@ -1,143 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test password-only forms should prefer a password-only login when present</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: Bug 444968
-<script>
-let pwmgrCommonScript = runInParent(SimpleTest.getTestFileURL("pwmgr_common.js"));
-pwmgrCommonScript.sendSyncMessage("setupParent", { selfFilling: true });
-
-SimpleTest.waitForExplicitFinish();
-
-let chromeScript = runInParent(function chromeSetup() {
- const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
- let pwmgr = Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
-
- let login1A = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- let login1B = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- let login2A = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- let login2B = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- let login2C = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
-
- login1A.init("http://mochi.test:8888", "http://bug444968-1", null,
- "testuser1A", "testpass1A", "", "");
- login1B.init("http://mochi.test:8888", "http://bug444968-1", null,
- "", "testpass1B", "", "");
-
- login2A.init("http://mochi.test:8888", "http://bug444968-2", null,
- "testuser2A", "testpass2A", "", "");
- login2B.init("http://mochi.test:8888", "http://bug444968-2", null,
- "", "testpass2B", "", "");
- login2C.init("http://mochi.test:8888", "http://bug444968-2", null,
- "testuser2C", "testpass2C", "", "");
-
- pwmgr.addLogin(login1A);
- pwmgr.addLogin(login1B);
- pwmgr.addLogin(login2A);
- pwmgr.addLogin(login2B);
- pwmgr.addLogin(login2C);
-
- addMessageListener("removeLogins", function removeLogins() {
- pwmgr.removeLogin(login1A);
- pwmgr.removeLogin(login1B);
- pwmgr.removeLogin(login2A);
- pwmgr.removeLogin(login2B);
- pwmgr.removeLogin(login2C);
- });
-});
-
-SimpleTest.registerCleanupFunction(() => chromeScript.sendSyncMessage("removeLogins"));
-
-registerRunTests();
-</script>
-
-<p id="display"></p>
-<div id="content" style="display: none">
- <!-- first 3 forms have matching user+pass and pass-only logins -->
-
- <!-- user+pass form. -->
- <form id="form1" action="http://bug444968-1">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- password-only form. -->
- <form id="form2" action="http://bug444968-1">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- user+pass form, username prefilled -->
- <form id="form3" action="http://bug444968-1">
- <input type="text" name="uname" value="testuser1A">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
-
- <!-- next 4 forms have matching user+pass (2x) and pass-only (1x) logins -->
-
- <!-- user+pass form. -->
- <form id="form4" action="http://bug444968-2">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- password-only form. -->
- <form id="form5" action="http://bug444968-2">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- user+pass form, username prefilled -->
- <form id="form6" action="http://bug444968-2">
- <input type="text" name="uname" value="testuser2A">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- user+pass form, username prefilled -->
- <form id="form7" action="http://bug444968-2">
- <input type="text" name="uname" value="testuser2C">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/* Test for Login Manager: 444968 (password-only forms should prefer a
- * password-only login when present )
- */
-function startTest() {
- checkForm(1, "testuser1A", "testpass1A");
- checkForm(2, "testpass1B");
- checkForm(3, "testuser1A", "testpass1A");
-
- checkUnmodifiedForm(4); // 2 logins match
- checkForm(5, "testpass2B");
- checkForm(6, "testuser2A", "testpass2A");
- checkForm(7, "testuser2C", "testpass2C");
-
- SimpleTest.finish();
-}
-
-window.addEventListener("runTests", startTest);
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_autofocus_js.html b/toolkit/components/passwordmgr/test/mochitest/test_autofocus_js.html
deleted file mode 100644
index 2ce3293dd..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_autofocus_js.html
+++ /dev/null
@@ -1,115 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test login autocomplete is activated when focused by js on load</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<script>
-const chromeScript = runChecksAfterCommonInit(false);
-
-runInParent(function addLogins() {
- const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
- Cu.import("resource://gre/modules/Services.jsm");
-
- // Create some logins just for this form, since we'll be deleting them.
- let nsLoginInfo = Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
-
- let login0 = new nsLoginInfo("https://example.org", "https://example.org", null,
- "name", "pass", "uname", "pword");
-
- let login1 = new nsLoginInfo("https://example.org", "https://example.org", null,
- "name1", "pass1", "uname", "pword");
-
- try {
- Services.logins.addLogin(login0);
- Services.logins.addLogin(login1);
- } catch (e) {
- assert.ok(false, "addLogin threw: " + e);
- }
-});
-</script>
-<p id="display"></p>
-
-<div id="content">
- <iframe src="https://example.org/tests/toolkit/components/passwordmgr/test/mochitest/form_autofocus_js.html"></iframe>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-let iframe = SpecialPowers.wrap(document.getElementsByTagName("iframe")[0]);
-let iframeDoc;
-
-add_task(function* setup() {
- yield new Promise(resolve => {
- iframe.addEventListener("load", function onLoad() {
- iframe.removeEventListener("load", onLoad);
- resolve();
- });
- });
-
- iframeDoc = iframe.contentDocument;
-
- SimpleTest.requestFlakyTimeout("Giving a chance for the unexpected popupshown to occur");
-});
-
-add_task(function* test_initial_focus() {
- let results = yield notifyMenuChanged(2, "name");
- checkArrayValues(results, ["name", "name1"], "Two results");
- doKey("down");
- doKey("return");
- yield promiseFormsProcessed();
- is(iframeDoc.getElementById("form-basic-password").value, "pass", "Check first password filled");
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup is now closed");
-});
-
-// This depends on the filling from the previous test.
-add_task(function* test_not_reopened_if_filled() {
- listenForUnexpectedPopupShown();
- let usernameField = iframeDoc.getElementById("form-basic-username");
- usernameField.focus();
- info("Waiting to see if a popupshown occurs");
- yield new Promise(resolve => setTimeout(resolve, 1000));
-
- // cleanup
- gPopupShownExpected = true;
- iframeDoc.getElementById("form-basic-submit").focus();
-});
-
-add_task(function* test_reopened_after_edit_not_matching_saved() {
- let usernameField = iframeDoc.getElementById("form-basic-username");
- usernameField.value = "nam";
- let shownPromise = promiseACShown();
- usernameField.focus();
- yield shownPromise;
- iframeDoc.getElementById("form-basic-submit").focus();
-});
-
-add_task(function* test_not_reopened_after_selecting() {
- let formFillController = SpecialPowers.Cc["@mozilla.org/satchel/form-fill-controller;1"].
- getService(SpecialPowers.Ci.nsIFormFillController);
- let usernameField = iframeDoc.getElementById("form-basic-username");
- usernameField.value = "";
- iframeDoc.getElementById("form-basic-password").value = "";
- listenForUnexpectedPopupShown();
- formFillController.markAsLoginManagerField(usernameField);
- info("Waiting to see if a popupshown occurs");
- yield new Promise(resolve => setTimeout(resolve, 1000));
-
- // Cleanup
- gPopupShownExpected = true;
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_basic_form.html b/toolkit/components/passwordmgr/test/mochitest/test_basic_form.html
deleted file mode 100644
index 3c38343a5..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_basic_form.html
+++ /dev/null
@@ -1,44 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test basic autofill</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: simple form fill
-
-<script>
-runChecksAfterCommonInit(startTest);
-
-/** Test for Login Manager: form fill, multiple forms. **/
-
-function startTest() {
- is($_(1, "uname").value, "testuser", "Checking for filled username");
- is($_(1, "pword").value, "testpass", "Checking for filled password");
-
- SimpleTest.finish();
-}
-</script>
-
-<p id="display"></p>
-
-<div id="content" style="display: none">
-
- <form id="form1" action="formtest.js">
- <p>This is form 1.</p>
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
-</div>
-
-<pre id="test"></pre>
-</body>
-</html>
-
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_0pw.html b/toolkit/components/passwordmgr/test/mochitest/test_basic_form_0pw.html
deleted file mode 100644
index 0b416673b..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_0pw.html
+++ /dev/null
@@ -1,72 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test forms with no password fields</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: forms with no password fields
-<p id="display"></p>
-
-<div id="content" style="display: none">
-
- <!-- Form with no user field or password field -->
- <form id="form1" action="formtest.js">
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Form with no user field or password field, but one other field -->
- <form id="form2" action="formtest.js">
- <input type="checkbox">
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Form with no user field or password field, but one other field -->
- <form id="form3" action="formtest.js">
- <input type="checkbox" name="uname" value="">
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Form with a text field, but no password field -->
- <form id="form4" action="formtest.js">
- <input type="text" name="yyyyy">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Form with a user field, but no password field -->
- <form id="form5" action="formtest.js">
- <input type="text" name="uname">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: form fill, no password fields. **/
-
-function startTest() {
- is($_(3, "uname").value, "", "Checking for unfilled checkbox (form 3)");
- is($_(4, "yyyyy").value, "", "Checking for unfilled text field (form 4)");
- is($_(5, "uname").value, "", "Checking for unfilled text field (form 5)");
-
- SimpleTest.finish();
-}
-
-runChecksAfterCommonInit(startTest);
-</script>
-</pre>
-</body>
-</html>
-
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_1pw.html b/toolkit/components/passwordmgr/test/mochitest/test_basic_form_1pw.html
deleted file mode 100644
index 3937fad4b..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_1pw.html
+++ /dev/null
@@ -1,167 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test autofill for forms with 1 password field</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: forms with 1 password field
-<script>
-runChecksAfterCommonInit(() => startTest());
-</script>
-<p id="display"></p>
-
-<div id="content" style="display: none">
-
-<!-- no username fields -->
-
-<form id='form1' action='formtest.js'> 1
- <!-- Blank, so fill in the password -->
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form2' action='formtest.js'> 2
- <!-- Already contains the password, so nothing to do. -->
- <input type='password' name='pname' value='testpass'>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form3' action='formtest.js'> 3
- <!-- Contains unknown password, so don't change it -->
- <input type='password' name='pname' value='xxxxxxxx'>
- <button type='submit'>Submit</button>
-</form>
-
-
-<!-- username fields -->
-
-<form id='form4' action='formtest.js'> 4
- <!-- Blanks, so fill in login -->
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form5' action='formtest.js'> 5
- <!-- Username already set, so fill in password -->
- <input type='text' name='uname' value='testuser'>
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form6' action='formtest.js'> 6
- <!-- Unknown username, so don't fill in password -->
- <input type='text' name='uname' value='xxxxxxxx'>
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form7' action='formtest.js'> 7
- <!-- Password already set, could fill in username but that's weird so we don't -->
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value='testpass'>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form8' action='formtest.js'> 8
- <!-- Unknown password, so don't fill in a username -->
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value='xxxxxxxx'>
- <button type='submit'>Submit</button>
-</form>
-
-
-
-<!-- extra text fields -->
-
-<form id='form9' action='formtest.js'> 9
- <!-- text field _after_ password should never be treated as a username field -->
- <input type='password' name='pname' value=''>
- <input type='text' name='uname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form10' action='formtest.js'> 10
- <!-- only the first text field before the password should be for username -->
- <input type='text' name='other' value=''>
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form11' action='formtest.js'> 11
- <!-- variation just to make sure extra text field is still ignored -->
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value=''>
- <input type='text' name='other' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-
-
-<!-- same as last bunch, but with xxxx in the extra field. -->
-
-<form id='form12' action='formtest.js'> 12
- <!-- text field _after_ password should never be treated as a username field -->
- <input type='password' name='pname' value=''>
- <input type='text' name='uname' value='xxxxxxxx'>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form13' action='formtest.js'> 13
- <!-- only the first text field before the password should be for username -->
- <input type='text' name='other' value='xxxxxxxx'>
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form14' action='formtest.js'> 14
- <!-- variation just to make sure extra text field is still ignored -->
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value=''>
- <input type='text' name='other' value='xxxxxxxx'>
- <button type='submit'>Submit</button>
-</form>
-
-
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: simple form fill **/
-
-function startTest() {
- var f = 1;
-
- // 1-3
- checkForm(f++, "testpass");
- checkForm(f++, "testpass");
- checkForm(f++, "xxxxxxxx");
-
- // 4-8
- checkForm(f++, "testuser", "testpass");
- checkForm(f++, "testuser", "testpass");
- checkForm(f++, "xxxxxxxx", "");
- checkForm(f++, "", "testpass");
- checkForm(f++, "", "xxxxxxxx");
-
- // 9-14
- checkForm(f++, "testpass", "");
- checkForm(f++, "", "testuser", "testpass");
- checkForm(f++, "testuser", "testpass", "");
- checkForm(f++, "testpass", "xxxxxxxx");
- checkForm(f++, "xxxxxxxx", "testuser", "testpass");
- checkForm(f++, "testuser", "testpass", "xxxxxxxx");
-
- SimpleTest.finish();
-}
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_1pw_2.html b/toolkit/components/passwordmgr/test/mochitest/test_basic_form_1pw_2.html
deleted file mode 100644
index 0f6566b9c..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_1pw_2.html
+++ /dev/null
@@ -1,109 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test forms with 1 password field, part 2</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: forms with 1 password field, part 2
-<script>
-runChecksAfterCommonInit(() => startTest());
-</script>
-<p id="display"></p>
-
-<div id="content" style="display: none">
-
-<form id='form1' action='formtest.js'> 1
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form2' action='formtest.js'> 2
- <input type='password' name='pname' value='' disabled>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form3' action='formtest.js'> 3
- <input type='password' name='pname' value='' readonly>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form4' action='formtest.js'> 4
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form5' action='formtest.js'> 5
- <input type='text' name='uname' value='' disabled>
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form6' action='formtest.js'> 6
- <input type='text' name='uname' value='' readonly>
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form7' action='formtest.js'> 7
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value='' disabled>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form8' action='formtest.js'> 8
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value='' readonly>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form9' action='formtest.js'> 9
- <input type='text' name='uname' value='TESTUSER'>
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form10' action='formtest.js'> 10
- <input type='text' name='uname' value='TESTUSER' readonly>
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form11' action='formtest.js'> 11
- <input type='text' name='uname' value='TESTUSER' disabled>
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: simple form fill, part 2 **/
-
-function startTest() {
- var f;
-
- // Test various combinations of disabled/readonly inputs
- checkForm(1, "testpass"); // control
- checkUnmodifiedForm(2);
- checkUnmodifiedForm(3);
- checkForm(4, "testuser", "testpass"); // control
- for (f = 5; f <= 8; f++) { checkUnmodifiedForm(f); }
- // Test case-insensitive comparison of username field
- checkForm(9, "testuser", "testpass");
- checkForm(10, "TESTUSER", "testpass");
- checkForm(11, "TESTUSER", "testpass");
-
- SimpleTest.finish();
-}
-</script>
-</pre>
-</body>
-</html>
-
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_2pw_1.html b/toolkit/components/passwordmgr/test/mochitest/test_basic_form_2pw_1.html
deleted file mode 100644
index 128ffca7c..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_2pw_1.html
+++ /dev/null
@@ -1,187 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test autofill for forms with 2 password fields</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: forms with 2 password fields
-<script>
-runChecksAfterCommonInit(() => startTest());
-</script>
-<p id="display"></p>
-
-<div id="content" style="display: none">
-
-
-<!-- no username fields -->
-
-<form id='form1' action='formtest.js'> 1
- <!-- simple form, fill in first pw -->
- <input type='password' name='pname' value=''>
- <input type='password' name='qname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form2' action='formtest.js'> 2
- <!-- same but reverse pname and qname, field names are ignored. -->
- <input type='password' name='qname' value=''>
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form3' action='formtest.js'> 3
- <!-- text field after password fields should be ignored, no username. -->
- <input type='password' name='pname' value=''>
- <input type='password' name='qname' value=''>
- <input type='text' name='uname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form4' action='formtest.js'> 4
- <!-- nothing to do, password already present -->
- <input type='password' name='pname' value='testpass'>
- <input type='password' name='qname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form5' action='formtest.js'> 5
- <!-- don't clobber an existing unrecognized password -->
- <input type='password' name='pname' value='xxxxxxxx'>
- <input type='password' name='qname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form6' action='formtest.js'> 6
- <!-- fill in first field, 2nd field shouldn't be touched anyway. -->
- <input type='password' name='pname' value=''>
- <input type='password' name='qname' value='xxxxxxxx'>
- <button type='submit'>Submit</button>
-</form>
-
-
-
-<!-- with username fields -->
-
-
-
-<form id='form7' action='formtest.js'> 7
- <!-- simple form, should fill in username and first pw -->
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value=''>
- <input type='password' name='qname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form8' action='formtest.js'> 8
- <!-- reverse pname and qname, field names are ignored. -->
- <input type='text' name='uname' value=''>
- <input type='password' name='qname' value=''>
- <input type='password' name='pname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form9' action='formtest.js'> 9
- <!-- username already filled, so just fill first password -->
- <input type='text' name='uname' value='testuser'>
- <input type='password' name='pname' value=''>
- <input type='password' name='qname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form10' action='formtest.js'> 10
- <!-- unknown username, don't fill in a password -->
- <input type='text' name='uname' value='xxxxxxxx'>
- <input type='password' name='pname' value=''>
- <input type='password' name='qname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form11' action='formtest.js'> 11
- <!-- don't clobber unknown password -->
- <input type='text' name='uname' value='testuser'>
- <input type='password' name='pname' value='xxxxxxxx'>
- <input type='password' name='qname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form12' action='formtest.js'> 12
- <!-- fill in 1st pass, don't clobber 2nd pass -->
- <input type='text' name='uname' value='testuser'>
- <input type='password' name='pname' value=''>
- <input type='password' name='qname' value='xxxxxxxx'>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form13' action='formtest.js'> 13
- <!-- nothing to do, user and pass prefilled. life is easy. -->
- <input type='text' name='uname' value='testuser'>
- <input type='password' name='pname' value='testpass'>
- <input type='password' name='qname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form14' action='formtest.js'> 14
- <!-- shouldn't fill in username because 1st pw field is unknown. -->
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value='xxxxxxxx'>
- <input type='password' name='qname' value='testpass'>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form15' action='formtest.js'> 15
- <!-- textfield in the middle of pw fields should be ignored -->
- <input type='password' name='pname' value=''>
- <input type='text' name='uname' value=''>
- <input type='password' name='qname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-<form id='form16' action='formtest.js'> 16
- <!-- same, and don't clobber existing unknown password -->
- <input type='password' name='pname' value='xxxxxxxx'>
- <input type='text' name='uname' value=''>
- <input type='password' name='qname' value=''>
- <button type='submit'>Submit</button>
-</form>
-
-
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: simple form fill **/
-
-function startTest() {
- var f = 1;
-
- // 1-6 no username
- checkForm(f++, "testpass", "");
- checkForm(f++, "testpass", "");
- checkForm(f++, "testpass", "", "");
- checkForm(f++, "testpass", "");
- checkForm(f++, "xxxxxxxx", "");
- checkForm(f++, "testpass", "xxxxxxxx");
-
- // 7-15 with username
- checkForm(f++, "testuser", "testpass", "");
- checkForm(f++, "testuser", "testpass", "");
- checkForm(f++, "testuser", "testpass", "");
- checkForm(f++, "xxxxxxxx", "", "");
- checkForm(f++, "testuser", "xxxxxxxx", "");
- checkForm(f++, "testuser", "testpass", "xxxxxxxx");
- checkForm(f++, "testuser", "testpass", "");
- checkForm(f++, "", "xxxxxxxx", "testpass");
- checkForm(f++, "testpass", "", "");
- checkForm(f++, "xxxxxxxx", "", "");
-
- SimpleTest.finish();
-}
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_2pw_2.html b/toolkit/components/passwordmgr/test/mochitest/test_basic_form_2pw_2.html
deleted file mode 100644
index eba811cf9..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_2pw_2.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for form fill with 2 password fields</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: form fill, 2 password fields
-<p id="display"></p>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: form fill, 2 password fields **/
-
-/*
- * If a form has two password fields, other things may be going on....
- *
- * 1 - The user might be creating a new login (2nd field for typo checking)
- * 2 - The user is changing a password (old and new password each have field)
- *
- * This test is for case #1.
- */
-
-var numSubmittedForms = 0;
-var numStartingLogins = 0;
-
-function startTest() {
- // Check for unfilled forms
- is($_(1, "uname").value, "", "Checking username 1");
- is($_(1, "pword").value, "", "Checking password 1A");
- is($_(1, "qword").value, "", "Checking password 1B");
-
- // Fill in the username and password fields, for account creation.
- // Form 1
- $_(1, "uname").value = "newuser1";
- $_(1, "pword").value = "newpass1";
- $_(1, "qword").value = "newpass1";
-
- var button = getFormSubmitButton(1);
-
- todo(false, "form submission disabled, can't auto-accept dialog yet");
- SimpleTest.finish();
-}
-
-
-// Called by each form's onsubmit handler.
-function checkSubmit(formNum) {
- numSubmittedForms++;
-
- // End the test at the last form.
- if (formNum == 999) {
- is(numSubmittedForms, 999, "Ensuring all forms submitted for testing.");
-
- var numEndingLogins = LoginManager.countLogins("", "", "");
-
- ok(numEndingLogins > 0, "counting logins at end");
- is(numStartingLogins, numEndingLogins + 222, "counting logins at end");
-
- SimpleTest.finish();
- return false; // return false to cancel current form submission
- }
-
- // submit the next form.
- var button = getFormSubmitButton(formNum + 1);
- button.click();
-
- return false; // return false to cancel current form submission
-}
-
-
-function getFormSubmitButton(formNum) {
- var form = $("form" + formNum); // by id, not name
- ok(form != null, "getting form " + formNum);
-
- // we can't just call form.submit(), because that doesn't seem to
- // invoke the form onsubmit handler.
- var button = form.firstChild;
- while (button && button.type != "submit") { button = button.nextSibling; }
- ok(button != null, "getting form submit button");
-
- return button;
-}
-
-runChecksAfterCommonInit(startTest);
-
-</script>
-</pre>
-<div id="content" style="display: none">
- <form id="form1" onsubmit="return checkSubmit(1)" action="http://newuser.com">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <input type="password" name="qword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
-</div>
-
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_3pw_1.html b/toolkit/components/passwordmgr/test/mochitest/test_basic_form_3pw_1.html
deleted file mode 100644
index 30b5a319f..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_3pw_1.html
+++ /dev/null
@@ -1,177 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test autofill for forms with 3 password fields</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: forms with 3 password fields (form filling)
-<script>
-runChecksAfterCommonInit(() => startTest());
-</script>
-<p id="display"></p>
-
-<div id="content" style="display: none">
- <p>The next three forms are <b>user/pass/passB/passC</b>, as all-empty, preuser(only), and preuser/pass</p>
- <form id="form1" action="formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <input type="password" name="qword">
- <input type="password" name="rword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <form id="form2" action="formtest.js">
- <input type="text" name="uname" value="testuser">
- <input type="password" name="pword">
- <input type="password" name="qword">
- <input type="password" name="rword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <form id="form3" action="formtest.js">
- <input type="text" name="uname" value="testuser">
- <input type="password" name="pword" value="testpass">
- <input type="password" name="qword">
- <input type="password" name="rword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
-
- <p>The next three forms are <b>user/passB/pass/passC</b>, as all-empty, preuser(only), and preuser/pass</p>
- <form id="form4" action="formtest.js">
- <input type="text" name="uname">
- <input type="password" name="qword">
- <input type="password" name="pword">
- <input type="password" name="rword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <form id="form5" action="formtest.js">
- <input type="text" name="uname" value="testuser">
- <input type="password" name="qword">
- <input type="password" name="pword">
- <input type="password" name="rword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <form id="form6" action="formtest.js">
- <input type="text" name="uname" value="testuser">
- <input type="password" name="qword">
- <input type="password" name="pword" value="testpass">
- <input type="password" name="rword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <p>The next three forms are <b>user/passB/passC/pass</b>, as all-empty, preuser(only), and preuser/pass</p>
- <form id="form7" action="formtest.js">
- <input type="text" name="uname">
- <input type="password" name="qword">
- <input type="password" name="rword">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <form id="form8" action="formtest.js">
- <input type="text" name="uname" value="testuser">
- <input type="password" name="qword">
- <input type="password" name="rword">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <form id="form9" action="formtest.js">
- <input type="text" name="uname" value="testuser">
- <input type="password" name="qword">
- <input type="password" name="rword">
- <input type="password" name="pword" value="testpass">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: form fill, 3 password fields **/
-
-// Test to make sure 3-password forms are filled properly.
-
-function startTest() {
- // Check form 1
- is($_(1, "uname").value, "testuser", "Checking username 1");
- is($_(1, "pword").value, "testpass", "Checking password 1");
- is($_(1, "qword").value, "", "Checking password 1 (q)");
- is($_(1, "rword").value, "", "Checking password 1 (r)");
- // Check form 2
- is($_(2, "uname").value, "testuser", "Checking username 2");
- is($_(2, "pword").value, "testpass", "Checking password 2");
- is($_(2, "qword").value, "", "Checking password 2 (q)");
- is($_(2, "rword").value, "", "Checking password 2 (r)");
- // Check form 3
- is($_(3, "uname").value, "testuser", "Checking username 3");
- is($_(3, "pword").value, "testpass", "Checking password 3");
- is($_(3, "qword").value, "", "Checking password 3 (q)");
- is($_(3, "rword").value, "", "Checking password 3 (r)");
-
- // Check form 4
- is($_(4, "uname").value, "testuser", "Checking username 4");
- todo_is($_(4, "qword").value, "", "Checking password 4 (q)");
- todo_is($_(4, "pword").value, "testpass", "Checking password 4");
- is($_(4, "rword").value, "", "Checking password 4 (r)");
- // Check form 5
- is($_(5, "uname").value, "testuser", "Checking username 5");
- todo_is($_(5, "qword").value, "", "Checking password 5 (q)");
- todo_is($_(5, "pword").value, "testpass", "Checking password 5");
- is($_(5, "rword").value, "", "Checking password 5 (r)");
- // Check form 6
- is($_(6, "uname").value, "testuser", "Checking username 6");
- todo_is($_(6, "qword").value, "", "Checking password 6 (q)");
- is($_(6, "pword").value, "testpass", "Checking password 6");
- is($_(6, "rword").value, "", "Checking password 6 (r)");
-
- // Check form 7
- is($_(7, "uname").value, "testuser", "Checking username 7");
- todo_is($_(7, "qword").value, "", "Checking password 7 (q)");
- is($_(7, "rword").value, "", "Checking password 7 (r)");
- todo_is($_(7, "pword").value, "testpass", "Checking password 7");
- // Check form 8
- is($_(8, "uname").value, "testuser", "Checking username 8");
- todo_is($_(8, "qword").value, "", "Checking password 8 (q)");
- is($_(8, "rword").value, "", "Checking password 8 (r)");
- todo_is($_(8, "pword").value, "testpass", "Checking password 8");
- // Check form 9
- is($_(9, "uname").value, "testuser", "Checking username 9");
- todo_is($_(9, "qword").value, "", "Checking password 9 (q)");
- is($_(9, "rword").value, "", "Checking password 9 (r)");
- is($_(9, "pword").value, "testpass", "Checking password 9");
-
- // TODO: as with the 2-password cases, add tests to check for creating new
- // logins and changing passwords.
- SimpleTest.finish();
-}
-</script>
-</pre>
-</body>
-</html>
-
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_autocomplete.html b/toolkit/components/passwordmgr/test/mochitest/test_basic_form_autocomplete.html
deleted file mode 100644
index 0eee8e696..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_autocomplete.html
+++ /dev/null
@@ -1,859 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test basic login autocomplete</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: multiple login autocomplete
-
-<script>
-var chromeScript = runChecksAfterCommonInit();
-
-var setupScript = runInParent(function setup() {
- const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
- Cu.import("resource://gre/modules/Services.jsm");
-
- // Create some logins just for this form, since we'll be deleting them.
- var nsLoginInfo = Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
- assert.ok(nsLoginInfo != null, "nsLoginInfo constructor");
-
- // login0 has no username, so should be filtered out from the autocomplete list.
- var login0 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "", "user0pass", "", "pword");
-
- var login1 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "tempuser1", "temppass1", "uname", "pword");
-
- var login2 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "testuser2", "testpass2", "uname", "pword");
-
- var login3 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "testuser3", "testpass3", "uname", "pword");
-
- var login4 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "zzzuser4", "zzzpass4", "uname", "pword");
-
- // login 5 only used in the single-user forms
- var login5 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete2", null,
- "singleuser5", "singlepass5", "uname", "pword");
-
- var login6A = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete3", null,
- "form7user1", "form7pass1", "uname", "pword");
- var login6B = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete3", null,
- "form7user2", "form7pass2", "uname", "pword");
-
- var login7 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete4", null,
- "form8user", "form8pass", "uname", "pword");
-
- var login8A = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete5", null,
- "form9userAB", "form9pass", "uname", "pword");
- var login8B = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete5", null,
- "form9userAAB", "form9pass", "uname", "pword");
- var login8C = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete5", null,
- "form9userAABzz", "form9pass", "uname", "pword");
-
- var login10 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete7", null,
- "testuser10", "testpass10", "uname", "pword");
-
-
- // try/catch in case someone runs the tests manually, twice.
- try {
- Services.logins.addLogin(login0);
- Services.logins.addLogin(login1);
- Services.logins.addLogin(login2);
- Services.logins.addLogin(login3);
- Services.logins.addLogin(login4);
- Services.logins.addLogin(login5);
- Services.logins.addLogin(login6A);
- Services.logins.addLogin(login6B);
- Services.logins.addLogin(login7);
- Services.logins.addLogin(login8A);
- Services.logins.addLogin(login8B);
- // login8C is added later
- Services.logins.addLogin(login10);
- } catch (e) {
- assert.ok(false, "addLogin threw: " + e);
- }
-
- addMessageListener("addLogin", loginVariableName => {
- let login = eval(loginVariableName);
- assert.ok(!!login, "Login to add is defined: " + loginVariableName);
- Services.logins.addLogin(login);
- });
- addMessageListener("removeLogin", loginVariableName => {
- let login = eval(loginVariableName);
- assert.ok(!!login, "Login to delete is defined: " + loginVariableName);
- Services.logins.removeLogin(login);
- });
-});
-</script>
-<p id="display"></p>
-
-<!-- we presumably can't hide the content for this test. -->
-<div id="content">
-
- <!-- form1 tests multiple matching logins -->
- <form id="form1" action="http://autocomplete:8888/formtest.js" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- other forms test single logins, with autocomplete=off set -->
- <form id="form2" action="http://autocomplete2" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword" autocomplete="off">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form3" action="http://autocomplete2" onsubmit="return false;">
- <input type="text" name="uname" autocomplete="off">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form4" action="http://autocomplete2" onsubmit="return false;" autocomplete="off">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form5" action="http://autocomplete2" onsubmit="return false;">
- <input type="text" name="uname" autocomplete="off">
- <input type="password" name="pword" autocomplete="off">
- <button type="submit">Submit</button>
- </form>
-
- <!-- control -->
- <form id="form6" action="http://autocomplete2" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- This form will be manipulated to insert a different username field. -->
- <form id="form7" action="http://autocomplete3" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- test for no autofill after onblur with blank username -->
- <form id="form8" action="http://autocomplete4" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- test autocomplete dropdown -->
- <form id="form9" action="http://autocomplete5" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- test for onUsernameInput recipe testing -->
- <form id="form11" action="http://autocomplete7" onsubmit="return false;">
- <input type="text" name="1">
- <input type="text" name="2">
- <button type="submit">Submit</button>
- </form>
-
- <!-- tests <form>-less autocomplete -->
- <div id="form12">
- <input type="text" name="uname" id="uname">
- <input type="password" name="pword" id="pword">
- <button type="submit">Submit</button>
- </div>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: multiple login autocomplete. **/
-
-var uname = $_(1, "uname");
-var pword = $_(1, "pword");
-const shiftModifier = SpecialPowers.Ci.nsIDOMEvent.SHIFT_MASK;
-
-// Restore the form to the default state.
-function restoreForm() {
- uname.value = "";
- pword.value = "";
- uname.focus();
-}
-
-// Check for expected username/password in form.
-function checkACForm(expectedUsername, expectedPassword) {
- var formID = uname.parentNode.id;
- is(uname.value, expectedUsername, "Checking " + formID + " username is: " + expectedUsername);
- is(pword.value, expectedPassword, "Checking " + formID + " password is: " + expectedPassword);
-}
-
-function sendFakeAutocompleteEvent(element) {
- var acEvent = document.createEvent("HTMLEvents");
- acEvent.initEvent("DOMAutoComplete", true, false);
- element.dispatchEvent(acEvent);
-}
-
-function spinEventLoop() {
- return Promise.resolve();
-}
-
-add_task(function* setup() {
- yield SpecialPowers.pushPrefEnv({"set": [["security.insecure_field_warning.contextual.enabled", false],
- ["signon.autofillForms.http", true]]});
- listenForUnexpectedPopupShown();
-});
-
-add_task(function* test_form1_initial_empty() {
- yield SimpleTest.promiseFocus(window);
-
- // Make sure initial form is empty.
- checkACForm("", "");
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup is initially closed");
-});
-
-add_task(function* test_form1_menuitems() {
- yield SimpleTest.promiseFocus(window);
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- let results = yield shownPromise;
-
- let popupState = yield getPopupState();
- is(popupState.selectedIndex, -1, "Check no entries are selected upon opening");
-
- let expectedMenuItems = ["tempuser1",
- "testuser2",
- "testuser3",
- "zzzuser4"];
- checkArrayValues(results, expectedMenuItems, "Check all menuitems are displayed correctly.");
-
- checkACForm("", ""); // value shouldn't update just by selecting
- doKey("return"); // not "enter"!
- yield spinEventLoop(); // let focus happen
- checkACForm("", "");
-});
-
-add_task(function* test_form1_first_entry() {
- yield SimpleTest.promiseFocus(window);
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- let popupState = yield getPopupState();
- is(popupState.selectedIndex, -1, "Check no entries are selected upon opening");
-
- doKey("down"); // first
- checkACForm("", ""); // value shouldn't update just by selecting
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("tempuser1", "temppass1");
-});
-
-add_task(function* test_form1_second_entry() {
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // first
- doKey("down"); // second
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("testuser2", "testpass2");
-});
-
-add_task(function* test_form1_third_entry() {
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // first
- doKey("down"); // second
- doKey("down"); // third
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("testuser3", "testpass3");
-});
-
-add_task(function* test_form1_fourth_entry() {
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // first
- doKey("down"); // second
- doKey("down"); // third
- doKey("down"); // fourth
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("zzzuser4", "zzzpass4");
-});
-
-add_task(function* test_form1_wraparound_first_entry() {
- // Trigger autocomplete popup
- restoreForm();
- yield spinEventLoop(); // let focus happen
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // first
- doKey("down"); // second
- doKey("down"); // third
- doKey("down"); // fourth
- doKey("down"); // deselects
- doKey("down"); // first
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("tempuser1", "temppass1");
-});
-
-add_task(function* test_form1_wraparound_up_last_entry() {
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("up"); // last (fourth)
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("zzzuser4", "zzzpass4");
-});
-
-add_task(function* test_form1_wraparound_down_up_up() {
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // select first entry
- doKey("up"); // selects nothing!
- doKey("up"); // select last entry
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("zzzuser4", "zzzpass4");
-});
-
-add_task(function* test_form1_wraparound_up_last() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down");
- doKey("up"); // deselects
- doKey("up"); // last entry
- doKey("up");
- doKey("up");
- doKey("up"); // first entry
- doKey("up"); // deselects
- doKey("up"); // last entry
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("zzzuser4", "zzzpass4");
-});
-
-add_task(function* test_form1_fill_username_without_autofill_right() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Set first entry w/o triggering autocomplete
- doKey("down"); // first
- doKey("right");
- yield spinEventLoop();
- checkACForm("tempuser1", ""); // empty password
-});
-
-add_task(function* test_form1_fill_username_without_autofill_left() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Set first entry w/o triggering autocomplete
- doKey("down"); // first
- doKey("left");
- checkACForm("tempuser1", ""); // empty password
-});
-
-add_task(function* test_form1_pageup_first() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Check first entry (page up)
- doKey("down"); // first
- doKey("down"); // second
- doKey("page_up"); // first
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("tempuser1", "temppass1");
-});
-
-add_task(function* test_form1_pagedown_last() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- /* test 13 */
- // Check last entry (page down)
- doKey("down"); // first
- doKey("page_down"); // last
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("zzzuser4", "zzzpass4");
-});
-
-add_task(function* test_form1_untrusted_event() {
- restoreForm();
- yield spinEventLoop();
-
- // Send a fake (untrusted) event.
- checkACForm("", "");
- uname.value = "zzzuser4";
- sendFakeAutocompleteEvent(uname);
- yield spinEventLoop();
- checkACForm("zzzuser4", "");
-});
-
-add_task(function* test_form1_delete() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // XXX tried sending character "t" before/during dropdown to test
- // filtering, but had no luck. Seemed like the character was getting lost.
- // Setting uname.value didn't seem to work either. This works with a human
- // driver, so I'm not sure what's up.
-
- // Delete the first entry (of 4), "tempuser1"
- doKey("down");
- var numLogins;
- numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
- is(numLogins, 5, "Correct number of logins before deleting one");
-
- let countChangedPromise = notifyMenuChanged(3);
- var deletionPromise = promiseStorageChanged(["removeLogin"]);
- // On OS X, shift-backspace and shift-delete work, just delete does not.
- // On Win/Linux, shift-backspace does not work, delete and shift-delete do.
- doKey("delete", shiftModifier);
- yield deletionPromise;
-
- checkACForm("", "");
- numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
- is(numLogins, 4, "Correct number of logins after deleting one");
- yield countChangedPromise;
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("testuser2", "testpass2");
-});
-
-add_task(function* test_form1_first_after_deletion() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Check the new first entry (of 3)
- doKey("down");
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("testuser2", "testpass2");
-});
-
-add_task(function* test_form1_delete_second() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Delete the second entry (of 3), "testuser3"
- doKey("down");
- doKey("down");
- doKey("delete", shiftModifier);
- checkACForm("", "");
- numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
- is(numLogins, 3, "Correct number of logins after deleting one");
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("zzzuser4", "zzzpass4");
-});
-
-add_task(function* test_form1_first_after_deletion2() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Check the new first entry (of 2)
- doKey("down");
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("testuser2", "testpass2");
-});
-
-add_task(function* test_form1_delete_last() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- /* test 54 */
- // Delete the last entry (of 2), "zzzuser4"
- doKey("down");
- doKey("down");
- doKey("delete", shiftModifier);
- checkACForm("", "");
- numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
- is(numLogins, 2, "Correct number of logins after deleting one");
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("testuser2", "testpass2");
-});
-
-add_task(function* test_form1_first_after_3_deletions() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Check the only remaining entry
- doKey("down");
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("testuser2", "testpass2");
-});
-
-add_task(function* test_form1_check_only_entry_remaining() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- /* test 56 */
- // Delete the only remaining entry, "testuser2"
- doKey("down");
- doKey("delete", shiftModifier);
- checkACForm("", "");
- numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
- is(numLogins, 1, "Correct number of logins after deleting one");
-
- // remove the login that's not shown in the list.
- setupScript.sendSyncMessage("removeLogin", "login0");
-});
-
-/* Tests for single-user forms for ignoring autocomplete=off */
-add_task(function* test_form2() {
- // Turn our attention to form2
- uname = $_(2, "uname");
- pword = $_(2, "pword");
- checkACForm("singleuser5", "singlepass5");
-
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Check first entry
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("singleuser5", "singlepass5");
-});
-
-add_task(function* test_form3() {
- uname = $_(3, "uname");
- pword = $_(3, "pword");
- checkACForm("singleuser5", "singlepass5");
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Check first entry
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("singleuser5", "singlepass5");
-});
-
-add_task(function* test_form4() {
- uname = $_(4, "uname");
- pword = $_(4, "pword");
- checkACForm("singleuser5", "singlepass5");
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Check first entry
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("singleuser5", "singlepass5");
-});
-
-add_task(function* test_form5() {
- uname = $_(5, "uname");
- pword = $_(5, "pword");
- checkACForm("singleuser5", "singlepass5");
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Check first entry
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("singleuser5", "singlepass5");
-});
-
-add_task(function* test_form6() {
- // (this is a control, w/o autocomplete=off, to ensure the login
- // that was being suppressed would have been filled in otherwise)
- uname = $_(6, "uname");
- pword = $_(6, "pword");
- checkACForm("singleuser5", "singlepass5");
-});
-
-add_task(function* test_form6_changeUsername() {
- // Test that the password field remains filled in after changing
- // the username.
- uname.focus();
- doKey("right");
- sendChar("X");
- // Trigger the 'blur' event on uname
- pword.focus();
- yield spinEventLoop();
- checkACForm("singleuser5X", "singlepass5");
-
- setupScript.sendSyncMessage("removeLogin", "login5");
-});
-
-add_task(function* test_form7() {
- uname = $_(7, "uname");
- pword = $_(7, "pword");
- checkACForm("", "");
-
- // Insert a new username field into the form. We'll then make sure
- // that invoking the autocomplete doesn't try to fill the form.
- var newField = document.createElement("input");
- newField.setAttribute("type", "text");
- newField.setAttribute("name", "uname2");
- pword.parentNode.insertBefore(newField, pword);
- is($_(7, "uname2").value, "", "Verifying empty uname2");
-
- // Delete login6B. It was created just to prevent filling in a login
- // automatically, removing it makes it more likely that we'll catch a
- // future regression with form filling here.
- setupScript.sendSyncMessage("removeLogin", "login6B");
-});
-
-add_task(function* test_form7_2() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Check first entry
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- // The form changes, so we expect the old username field to get the
- // selected autocomplete value, but neither the new username field nor
- // the password field should have any values filled in.
- yield spinEventLoop();
- checkACForm("form7user1", "");
- is($_(7, "uname2").value, "", "Verifying empty uname2");
- restoreForm(); // clear field, so reloading test doesn't fail
-
- setupScript.sendSyncMessage("removeLogin", "login6A");
-});
-
-add_task(function* test_form8() {
- uname = $_(8, "uname");
- pword = $_(8, "pword");
- checkACForm("form8user", "form8pass");
- restoreForm();
-});
-
-add_task(function* test_form8_blur() {
- checkACForm("", "");
- // Focus the previous form to trigger a blur.
- $_(7, "uname").focus();
-});
-
-add_task(function* test_form8_2() {
- checkACForm("", "");
- restoreForm();
-});
-
-add_task(function* test_form8_3() {
- checkACForm("", "");
- setupScript.sendSyncMessage("removeLogin", "login7");
-});
-
-add_task(function* test_form9_filtering() {
- // Turn our attention to form9 to test the dropdown - bug 497541
- uname = $_(9, "uname");
- pword = $_(9, "pword");
- uname.focus();
- let shownPromise = promiseACShown();
- sendString("form9userAB");
- yield shownPromise;
-
- checkACForm("form9userAB", "");
- uname.focus();
- doKey("left");
- shownPromise = promiseACShown();
- sendChar("A");
- let results = yield shownPromise;
-
- checkACForm("form9userAAB", "");
- checkArrayValues(results, ["form9userAAB"], "Check dropdown is updated after inserting 'A'");
- doKey("down");
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("form9userAAB", "form9pass");
-});
-
-add_task(function* test_form9_autocomplete_cache() {
- // Note that this addLogin call will only be seen by the autocomplete
- // attempt for the sendChar if we do not successfully cache the
- // autocomplete results.
- setupScript.sendSyncMessage("addLogin", "login8C");
- uname.focus();
- let promise0 = notifyMenuChanged(0);
- sendChar("z");
- yield promise0;
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup shouldn't open");
-
- // check that empty results are cached - bug 496466
- promise0 = notifyMenuChanged(0);
- sendChar("z");
- yield promise0;
- popupState = yield getPopupState();
- is(popupState.open, false, "Check popup stays closed due to cached empty result");
-});
-
-add_task(function* test_form11_recipes() {
- yield loadRecipes({
- siteRecipes: [{
- "hosts": ["mochi.test:8888"],
- "usernameSelector": "input[name='1']",
- "passwordSelector": "input[name='2']"
- }],
- });
- uname = $_(11, "1");
- pword = $_(11, "2");
-
- // First test DOMAutocomplete
- // Switch the password field to type=password so _fillForm marks the username
- // field for autocomplete.
- pword.type = "password";
- yield promiseFormsProcessed();
- restoreForm();
- checkACForm("", "");
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("testuser10", "testpass10");
-
- // Now test recipes with blur on the username field.
- restoreForm();
- checkACForm("", "");
- uname.value = "testuser10";
- checkACForm("testuser10", "");
- doKey("tab");
- yield promiseFormsProcessed();
- checkACForm("testuser10", "testpass10");
- yield resetRecipes();
-});
-
-add_task(function* test_form12_formless() {
- // Test form-less autocomplete
- uname = $_(12, "uname");
- pword = $_(12, "pword");
- restoreForm();
- checkACForm("", "");
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Trigger autocomplete
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- let processedPromise = promiseFormsProcessed();
- doKey("return"); // not "enter"!
- yield processedPromise;
- checkACForm("testuser", "testpass");
-});
-
-add_task(function* test_form12_open_on_trusted_focus() {
- uname = $_(12, "uname");
- pword = $_(12, "pword");
- uname.value = "";
- pword.value = "";
-
- // Move focus to the password field so we can test the first click on the
- // username field.
- pword.focus();
- checkACForm("", "");
- const firePrivEventPromise = new Promise((resolve) => {
- uname.addEventListener("click", (e) => {
- ok(e.isTrusted, "Ensure event is trusted");
- resolve();
- });
- });
- const shownPromise = promiseACShown();
- synthesizeMouseAtCenter(uname, {});
- yield firePrivEventPromise;
- yield shownPromise;
- doKey("down");
- const processedPromise = promiseFormsProcessed();
- doKey("return"); // not "enter"!
- yield processedPromise;
- checkACForm("testuser", "testpass");
-});
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_html5.html b/toolkit/components/passwordmgr/test/mochitest/test_basic_form_html5.html
deleted file mode 100644
index 40e322afd..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_html5.html
+++ /dev/null
@@ -1,164 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for html5 input types (email, tel, url, etc.)</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: html5 input types (email, tel, url, etc.)
-<script>
-runChecksAfterCommonInit(() => startTest());
-
-runInParent(function setup() {
- const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
- let pwmgr = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
-
- login1 = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login2 = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login3 = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login4 = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
-
- login1.init("http://mochi.test:8888", "http://bug600551-1", null,
- "testuser@example.com", "testpass1", "", "");
- login2.init("http://mochi.test:8888", "http://bug600551-2", null,
- "555-555-5555", "testpass2", "", "");
- login3.init("http://mochi.test:8888", "http://bug600551-3", null,
- "http://mozilla.org", "testpass3", "", "");
- login4.init("http://mochi.test:8888", "http://bug600551-4", null,
- "123456789", "testpass4", "", "");
-
- pwmgr.addLogin(login1);
- pwmgr.addLogin(login2);
- pwmgr.addLogin(login3);
- pwmgr.addLogin(login4);
-});
-</script>
-
-<p id="display"></p>
-<div id="content" style="display: none">
-
- <form id="form1" action="http://bug600551-1">
- <input type="email" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form2" action="http://bug600551-2">
- <input type="tel" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form3" action="http://bug600551-3">
- <input type="url" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form4" action="http://bug600551-4">
- <input type="number" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- The following forms should not be filled with usernames -->
- <form id="form5" action="formtest.js">
- <input type="search" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form6" action="formtest.js">
- <input type="datetime" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form7" action="formtest.js">
- <input type="date" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form8" action="formtest.js">
- <input type="month" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form9" action="formtest.js">
- <input type="week" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form10" action="formtest.js">
- <input type="time" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form11" action="formtest.js">
- <input type="datetime-local" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form12" action="formtest.js">
- <input type="range" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form13" action="formtest.js">
- <input type="color" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
-
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/* Test for Login Manager: 600551
- (Password manager not working with input type=email)
- */
-function startTest() {
- checkForm(1, "testuser@example.com", "testpass1");
- checkForm(2, "555-555-5555", "testpass2");
- checkForm(3, "http://mozilla.org", "testpass3");
- checkForm(4, "123456789", "testpass4");
-
- is($_(5, "uname").value, "", "type=search should not be considered a username");
-
- is($_(6, "uname").value, "", "type=datetime should not be considered a username");
-
- is($_(7, "uname").value, "", "type=date should not be considered a username");
-
- is($_(8, "uname").value, "", "type=month should not be considered a username");
-
- is($_(9, "uname").value, "", "type=week should not be considered a username");
-
- is($_(10, "uname").value, "", "type=time should not be considered a username");
-
- is($_(11, "uname").value, "", "type=datetime-local should not be considered a username");
-
- is($_(12, "uname").value, "50", "type=range should not be considered a username");
-
- is($_(13, "uname").value, "#000000", "type=color should not be considered a username");
-
- SimpleTest.finish();
-}
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_pwevent.html b/toolkit/components/passwordmgr/test/mochitest/test_basic_form_pwevent.html
deleted file mode 100644
index e0a2883c8..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_pwevent.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=355063
--->
-<head>
- <meta charset="utf-8"/>
- <title>Test for Bug 355063</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <script type="application/javascript">
- /** Test for Bug 355063 **/
-
- runChecksAfterCommonInit(function startTest() {
- info("startTest");
- // Password Manager's own listener should always have been added first, so
- // the test's listener should be called after the pwmgr's listener fills in
- // a login.
- //
- SpecialPowers.addChromeEventListener("DOMFormHasPassword", function eventFired() {
- SpecialPowers.removeChromeEventListener("DOMFormHasPassword", eventFired);
- var passField = $("p1");
- passField.addEventListener("input", checkForm);
- });
- addForm();
- });
-
- function addForm() {
- info("addForm");
- var c = document.getElementById("content");
- c.innerHTML = "<form id=form1>form1: <input id=u1><input type=password id=p1></form><br>";
- }
-
- function checkForm() {
- info("checkForm");
- var userField = document.getElementById("u1");
- var passField = document.getElementById("p1");
- is(userField.value, "testuser", "checking filled username");
- is(passField.value, "testpass", "checking filled password");
-
- SimpleTest.finish();
- }
-</script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=355063">Mozilla Bug 355063</a>
-<p id="display"></p>
-<div id="content">
-forms go here!
-</div>
-<pre id="test">
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_pwonly.html b/toolkit/components/passwordmgr/test/mochitest/test_basic_form_pwonly.html
deleted file mode 100644
index 40fec8c46..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_basic_form_pwonly.html
+++ /dev/null
@@ -1,213 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test forms and logins without a username</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: forms and logins without a username.
-<script>
-runChecksAfterCommonInit(() => startTest());
-runInParent(() => {
- const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
- var pwmgr = Cc["@mozilla.org/login-manager;1"]
- .getService(Ci.nsILoginManager);
-
- var nsLoginInfo = Components.Constructor("@mozilla.org/login-manager/loginInfo;1", Ci.nsILoginInfo);
-
- // pwlogin1 uses a unique formSubmitURL, to check forms where no other logins
- // will apply. pwlogin2 uses the normal formSubmitURL, so that we can test
- // forms with a mix of username and non-username logins that might apply.
- //
- // Note: pwlogin2 is deleted at the end of the test.
-
- pwlogin1 = new nsLoginInfo();
- pwlogin2 = new nsLoginInfo();
-
- pwlogin1.init("http://mochi.test:8888", "http://mochi.test:1111", null,
- "", "1234", "uname", "pword");
-
- pwlogin2.init("http://mochi.test:8888", "http://mochi.test:8888", null,
- "", "1234", "uname", "pword");
-
-
- pwmgr.addLogin(pwlogin1);
- pwmgr.addLogin(pwlogin2);
-});
-</script>
-<p id="display"></p>
-
-<div id="content" style="display: none">
-
-
-<!-- simple form: no username field, 1 password field -->
-<form id='form1' action='http://mochi.test:1111/formtest.js'> 1
- <input type='password' name='pname' value=''>
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-<!-- simple form: no username field, 2 password fields -->
-<form id='form2' action='http://mochi.test:1111/formtest.js'> 2
- <input type='password' name='pname1' value=''>
- <input type='password' name='pname2' value=''>
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-<!-- simple form: no username field, 3 password fields -->
-<form id='form3' action='http://mochi.test:1111/formtest.js'> 3
- <input type='password' name='pname1' value=''>
- <input type='password' name='pname2' value=''>
- <input type='password' name='pname3' value=''>
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-<!-- 4 password fields, should be ignored. -->
-<form id='form4' action='http://mochi.test:1111/formtest.js'> 4
- <input type='password' name='pname1' value=''>
- <input type='password' name='pname2' value=''>
- <input type='password' name='pname3' value=''>
- <input type='password' name='pname4' value=''>
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-
-
-<!-- 1 username field -->
-<form id='form5' action='http://mochi.test:1111/formtest.js'> 5
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value=''>
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-
-<!-- 1 username field, with a value set -->
-<form id='form6' action='http://mochi.test:1111/formtest.js'> 6
- <input type='text' name='uname' value='someuser'>
- <input type='password' name='pname' value=''>
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-
-
-<!--
-(The following forms have 2 potentially-matching logins, on is
-password-only, the other is username+password)
--->
-
-
-
-<!-- 1 username field, with value set. Fill in the matching U+P login -->
-<form id='form7' action='formtest.js'> 7
- <input type='text' name='uname' value='testuser'>
- <input type='password' name='pname' value=''>
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-<!-- 1 username field, with value set. Don't fill in U+P login-->
-<form id='form8' action='formtest.js'> 8
- <input type='text' name='uname' value='someuser'>
- <input type='password' name='pname' value=''>
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-
-
-<!-- 1 username field, too small for U+P login -->
-<form id='form9' action='formtest.js'> 9
- <input type='text' name='uname' value='' maxlength="4">
- <input type='password' name='pname' value=''>
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-<!-- 1 username field, too small for U+P login -->
-<form id='form10' action='formtest.js'> 10
- <input type='text' name='uname' value='' maxlength="0">
- <input type='password' name='pname' value=''>
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-<!-- 1 username field, too small for U+P login -->
-<form id='form11' action='formtest.js'> 11
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value='' maxlength="4">
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-<!-- 1 username field, too small for either login -->
-<form id='form12' action='formtest.js'> 12
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value='' maxlength="1">
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-<!-- 1 username field, too small for either login -->
-<form id='form13' action='formtest.js'> 13
- <input type='text' name='uname' value=''>
- <input type='password' name='pname' value='' maxlength="0">
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-
-
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: password-only logins **/
-function startTest() {
-
- checkForm(1, "1234");
- checkForm(2, "1234", "");
- checkForm(3, "1234", "", "");
- checkUnmodifiedForm(4);
-
- checkForm(5, "", "1234");
- checkForm(6, "someuser", "");
-
- checkForm(7, "testuser", "testpass");
- checkForm(8, "someuser", "");
-
- checkForm(9, "", "1234");
- checkForm(10, "", "1234");
- checkForm(11, "", "1234");
-
- checkUnmodifiedForm(12);
- checkUnmodifiedForm(13);
-
- SimpleTest.finish();
-}
-</script>
-</pre>
-</body>
-</html>
-
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html b/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html
deleted file mode 100644
index ad4a41cdb..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_bug_627616.html
+++ /dev/null
@@ -1,145 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test bug 627616 related to proxy authentication</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<script class="testbody" type="text/javascript">
- SimpleTest.waitForExplicitFinish();
-
- var Ci = SpecialPowers.Ci;
-
- function makeXHR(expectedStatus, expectedText, extra) {
- var xhr = new XMLHttpRequest();
- xhr.open("GET", "authenticate.sjs?" +
- "proxy_user=proxy_user&" +
- "proxy_pass=proxy_pass&" +
- "proxy_realm=proxy_realm&" +
- "user=user1name&" +
- "pass=user1pass&" +
- "realm=mochirealm&" +
- extra || "");
- xhr.onloadend = function() {
- is(xhr.status, expectedStatus, "xhr.status");
- is(xhr.statusText, expectedText, "xhr.statusText");
- runNextTest();
- };
- return xhr;
- }
-
- function testNonAnonymousCredentials() {
- var xhr = makeXHR(200, "OK");
- xhr.send();
- }
-
- function testAnonymousCredentials() {
- // Test that an anonymous request correctly performs proxy authentication
- var xhr = makeXHR(401, "Authentication required");
- SpecialPowers.wrap(xhr).channel.loadFlags |= Ci.nsIChannel.LOAD_ANONYMOUS;
- xhr.send();
- }
-
- function testAnonymousNoAuth() {
- // Next, test that an anonymous request still does not include any non-proxy
- // authentication headers.
- var xhr = makeXHR(200, "Authorization header not found", "anonymous=1");
- SpecialPowers.wrap(xhr).channel.loadFlags |= Ci.nsIChannel.LOAD_ANONYMOUS;
- xhr.send();
- }
-
- var gExpectedDialogs = 0;
- var gCurrentTest;
- function runNextTest() {
- is(gExpectedDialogs, 0, "received expected number of auth dialogs");
- mm.sendAsyncMessage("prepareForNextTest");
- mm.addMessageListener("prepareForNextTestDone", function prepared(msg) {
- mm.removeMessageListener("prepareForNextTestDone", prepared);
- if (pendingTests.length > 0) {
- ({expectedDialogs: gExpectedDialogs,
- test: gCurrentTest} = pendingTests.shift());
- gCurrentTest.call(this);
- } else {
- mm.sendAsyncMessage("cleanup");
- mm.addMessageListener("cleanupDone", () => {
- // mm.destroy() is called as a cleanup function by runInParent(), no
- // need to do it here.
- SimpleTest.finish();
- });
- }
- });
- }
-
- var pendingTests = [{expectedDialogs: 2, test: testNonAnonymousCredentials},
- {expectedDialogs: 1, test: testAnonymousCredentials},
- {expectedDialogs: 0, test: testAnonymousNoAuth}];
-
- let mm = runInParent(() => {
- const { classes: parentCc, interfaces: parentCi, utils: parentCu } = Components;
-
- parentCu.import("resource://gre/modules/Services.jsm");
- parentCu.import("resource://gre/modules/NetUtil.jsm");
- parentCu.import("resource://gre/modules/Timer.jsm");
- parentCu.import("resource://gre/modules/XPCOMUtils.jsm");
-
- let channel = NetUtil.newChannel({
- uri: "http://example.com",
- loadUsingSystemPrincipal: true
- });
-
- let pps = parentCc["@mozilla.org/network/protocol-proxy-service;1"].
- getService(parentCi.nsIProtocolProxyService);
- pps.asyncResolve(channel, 0, {
- onProxyAvailable(req, uri, pi, status) {
- let mozproxy = "moz-proxy://" + pi.host + ":" + pi.port;
- let login = parentCc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(parentCi.nsILoginInfo);
- login.init(mozproxy, null, "proxy_realm", "proxy_user", "proxy_pass",
- "", "");
- Services.logins.addLogin(login);
-
- let login2 = parentCc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(parentCi.nsILoginInfo);
- login2.init("http://mochi.test:8888", null, "mochirealm", "user1name",
- "user1pass", "", "");
- Services.logins.addLogin(login2);
-
- sendAsyncMessage("setupDone");
- },
- QueryInterface: XPCOMUtils.generateQI([parentCi.nsIProtocolProxyCallback]),
- });
-
- addMessageListener("prepareForNextTest", message => {
- parentCc["@mozilla.org/network/http-auth-manager;1"].
- getService(parentCi.nsIHttpAuthManager).
- clearAll();
- sendAsyncMessage("prepareForNextTestDone");
- });
-
- let dialogObserverTopic = "common-dialog-loaded";
-
- function dialogObserver(subj, topic, data) {
- subj.Dialog.ui.prompt.document.documentElement.acceptDialog();
- sendAsyncMessage("promptAccepted");
- }
-
- Services.obs.addObserver(dialogObserver, dialogObserverTopic, false);
-
- addMessageListener("cleanup", message => {
- Services.obs.removeObserver(dialogObserver, dialogObserverTopic);
- sendAsyncMessage("cleanupDone");
- });
- });
-
- mm.addMessageListener("promptAccepted", msg => {
- gExpectedDialogs--;
- });
- mm.addMessageListener("setupDone", msg => {
- runNextTest();
- });
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_bug_776171.html b/toolkit/components/passwordmgr/test/mochitest/test_bug_776171.html
deleted file mode 100644
index 4ad08bee2..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_bug_776171.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=776171
--->
-<head>
- <meta charset="utf-8">
- <title>Test for Bug 776171 related to HTTP auth</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body onload="startTest()">
-<script class="testbody" type="text/javascript">
-
-/**
- * This test checks we correctly ignore authentication entry
- * for a subpath and use creds from the URL when provided when XHR
- * is used with filled user name and password.
- *
- * 1. connect auth2/authenticate.sjs that expects user1:pass1 password
- * 2. connect a dummy URL at the same path
- * 3. connect authenticate.sjs that again expects user1:pass1 password
- * in this case, however, we have an entry without an identity
- * for this path (that is a parent for auth2 path in the first step)
- */
-
-SimpleTest.waitForExplicitFinish();
-
-function doxhr(URL, user, pass, next) {
- var xhr = new XMLHttpRequest();
- if (user && pass)
- xhr.open("POST", URL, true, user, pass);
- else
- xhr.open("POST", URL, true);
- xhr.onload = function() {
- is(xhr.status, 200, "Got status 200");
- next();
- };
- xhr.onerror = function() {
- ok(false, "request passed");
- finishTest();
- };
- xhr.send();
-}
-
-function startTest() {
- doxhr("auth2/authenticate.sjs?user=user1&pass=pass1&realm=realm1", "user1", "pass1", function() {
- doxhr("auth2", null, null, function() {
- doxhr("authenticate.sjs?user=user1&pass=pass1&realm=realm1", "user1", "pass1", SimpleTest.finish);
- });
- });
-}
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_case_differences.html b/toolkit/components/passwordmgr/test/mochitest/test_case_differences.html
deleted file mode 100644
index 316f59da7..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_case_differences.html
+++ /dev/null
@@ -1,147 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test autocomplete due to multiple matching logins</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: autocomplete due to multiple matching logins
-
-<script>
-runChecksAfterCommonInit(false);
-
-SpecialPowers.loadChromeScript(function addLogins() {
- const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
- Cu.import("resource://gre/modules/Services.jsm");
-
- // Create some logins just for this form, since we'll be deleting them.
- var nsLoginInfo = Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
-
- var login0 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "name", "pass", "uname", "pword");
-
- var login1 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "Name", "Pass", "uname", "pword");
-
- var login2 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "USER", "PASS", "uname", "pword");
-
- try {
- Services.logins.addLogin(login0);
- Services.logins.addLogin(login1);
- Services.logins.addLogin(login2);
- } catch (e) {
- assert.ok(false, "addLogin threw: " + e);
- }
-});
-</script>
-<p id="display"></p>
-
-<!-- we presumably can't hide the content for this test. -->
-<div id="content">
-
- <!-- form1 tests multiple matching logins -->
- <form id="form1" action="http://autocomplete:8888/formtest.js" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: autocomplete due to multiple matching logins **/
-
-var uname = $_(1, "uname");
-var pword = $_(1, "pword");
-
-// Restore the form to the default state.
-function restoreForm() {
- uname.value = "";
- pword.value = "";
- uname.focus();
-}
-
-// Check for expected username/password in form.
-function checkACForm(expectedUsername, expectedPassword) {
- var formID = uname.parentNode.id;
- is(uname.value, expectedUsername, "Checking " + formID + " username");
- is(pword.value, expectedPassword, "Checking " + formID + " password");
-}
-
-add_task(function* test_empty_first_entry() {
- /* test 1 */
- // Make sure initial form is empty.
- checkACForm("", "");
- // Trigger autocomplete popup
- restoreForm();
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup is initially closed");
- let shownPromise = promiseACShown();
- doKey("down");
- let results = yield shownPromise;
- popupState = yield getPopupState();
- is(popupState.selectedIndex, -1, "Check no entries are selected");
- checkArrayValues(results, ["name", "Name", "USER"], "initial");
-
- // Check first entry
- let index0Promise = notifySelectedIndex(0);
- doKey("down");
- yield index0Promise;
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("name", "pass");
-});
-
-add_task(function* test_empty_second_entry() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
- doKey("down"); // first
- doKey("down"); // second
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("Name", "Pass");
-});
-
-add_task(function* test_empty_third_entry() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
- doKey("down"); // first
- doKey("down"); // second
- doKey("down"); // third
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("USER", "PASS");
-});
-
-add_task(function* test_preserve_matching_username_case() {
- restoreForm();
- uname.value = "user";
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Check that we don't clobber user-entered text when tabbing away
- // (even with no autocomplete entry selected)
- doKey("tab");
- yield promiseFormsProcessed();
- checkACForm("user", "PASS");
-});
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_form_action_1.html b/toolkit/components/passwordmgr/test/mochitest/test_form_action_1.html
deleted file mode 100644
index 430081b3a..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_form_action_1.html
+++ /dev/null
@@ -1,137 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for considering form action</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: Bug 360493
-<script>
-runChecksAfterCommonInit(() => startTest());
-</script>
-<p id="display"></p>
-<div id="content" style="display: none">
-
- <!-- normal form with normal relative action. -->
- <form id="form1" action="formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- fully specify the action URL -->
- <form id="form2" action="http://mochi.test:8888/tests/toolkit/components/passwordmgr/test/formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- fully specify the action URL, and change the path -->
- <form id="form3" action="http://mochi.test:8888/zomg/wtf/bbq/passwordmgr/test/formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- fully specify the action URL, and change the path and filename -->
- <form id="form4" action="http://mochi.test:8888/zomg/wtf/bbq/passwordmgr/test/not_a_test.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- specify the action URL relative to the current document-->
- <form id="form5" action="./formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- specify the action URL relative to the current server -->
- <form id="form6" action="/tests/toolkit/components/passwordmgr/test/formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Change the method from get to post -->
- <form id="form7" action="formtest.js" method="POST">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Blank action URL specified -->
- <form id="form8" action="">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- |action| attribute entirely missing -->
- <form id="form9" >
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- action url as javascript -->
- <form id="form10" action="javascript:alert('this form is not submitted so this alert should not be invoked');">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- TODO: action=IP.ADDRESS instead of HOSTNAME? -->
- <!-- TODO: test with |base href="http://othersite//"| ? -->
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: 360493 (Cross-Site Forms + Password
- Manager = Security Failure) **/
-
-// This test is designed to make sure variations on the form's |action|
-// and |method| continue to work with the fix for 360493.
-
-function startTest() {
- for (var i = 1; i <= 9; i++) {
- // Check form i
- is($_(i, "uname").value, "testuser", "Checking for filled username " + i);
- is($_(i, "pword").value, "testpass", "Checking for filled password " + i);
- }
-
- // The login's formSubmitURL isn't "javascript:", so don't fill it in.
- isnot($_(10, "uname"), "testuser", "Checking username w/ JS action URL");
- isnot($_(10, "pword"), "testpass", "Checking password w/ JS action URL");
-
- SimpleTest.finish();
-}
-</script>
-</pre>
-</body>
-</html>
-
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_form_action_2.html b/toolkit/components/passwordmgr/test/mochitest/test_form_action_2.html
deleted file mode 100644
index 0f0056de0..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_form_action_2.html
+++ /dev/null
@@ -1,170 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for considering form action</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: Bug 360493
-<script>
-runChecksAfterCommonInit(() => startTest());
-</script>
-<p id="display"></p>
-<div id="content" style="display: none">
-
- <!-- The tests in this page exercise things that shouldn't work. -->
-
- <!-- Change port # of action URL from 8888 to 7777 -->
- <form id="form1" action="http://localhost:7777/tests/toolkit/components/passwordmgr/test/formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- No port # in action URL -->
- <form id="form2" action="http://localhost/tests/toolkit/components/passwordmgr/test/formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Change protocol from http:// to ftp://, include the expected 8888 port # -->
- <form id="form3" action="ftp://localhost:8888/tests/toolkit/components/passwordmgr/test/formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Change protocol from http:// to ftp://, no port # specified -->
- <form id="form4" action="ftp://localhost/tests/toolkit/components/passwordmgr/test/formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Try a weird URL. -->
- <form id="form5" action="about:blank">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Try a weird URL. (If the normal embedded action URL doesn't work, that should mean other URLs won't either) -->
- <form id="form6" action="view-source:http://localhost:8888/tests/toolkit/components/passwordmgr/test/formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Try a weird URL. -->
- <form id="form7" action="view-source:formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Action URL points to a different host (this is the archetypical exploit) -->
- <form id="form8" action="http://www.cnn.com/">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Action URL points to a different host, user field prefilled -->
- <form id="form9" action="http://www.cnn.com/">
- <input type="text" name="uname" value="testuser">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- Try wrapping a evil form around a good form, to see if we can confuse the parser. -->
- <form id="form10-A" action="http://www.cnn.com/">
- <form id="form10-B" action="formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit (inner)</button>
- <button type="reset"> Reset (inner)</button>
- </form>
- <button type="submit" id="neutered_submit10">Submit (outer)</button>
- <button type="reset">Reset (outer)</button>
- </form>
-
- <!-- Try wrapping a good form around an evil form, to see if we can confuse the parser. -->
- <form id="form11-A" action="formtest.js">
- <form id="form11-B" action="http://www.cnn.com/">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit (inner)</button>
- <button type="reset"> Reset (inner)</button>
- </form>
- <button type="submit" id="neutered_submit11">Submit (outer)</button>
- <button type="reset">Reset (outer)</button>
- </form>
-
-<!-- TODO: probably should have some accounts which have no port # in the action url. JS too. And different host/proto. -->
-<!-- TODO: www.site.com vs. site.com? -->
-<!-- TODO: foo.site.com vs. bar.site.com? -->
-
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: 360493 (Cross-Site Forms + Password Manager = Security Failure) **/
-
-function startTest() {
- for (var i = 1; i <= 8; i++) {
- // Check form i
- is($_(i, "uname").value, "", "Checking for unfilled username " + i);
- is($_(i, "pword").value, "", "Checking for unfilled password " + i);
- }
-
- is($_(9, "uname").value, "testuser", "Checking for unmodified username 9");
- is($_(9, "pword").value, "", "Checking for unfilled password 9");
-
- is($_("10-A", "uname").value, "", "Checking for unfilled username 10A");
- is($_("10-A", "pword").value, "", "Checking for unfilled password 10A");
-
- // The DOM indicates this form could be filled, as the evil inner form
- // is discarded. And yet pwmgr seems not to fill it. Not sure why.
- todo(false, "Mangled form combo not being filled when maybe it could be?");
- is($_("11-A", "uname").value, "testuser", "Checking filled username 11A");
- is($_("11-A", "pword").value, "testpass", "Checking filled password 11A");
-
- // Verify this by making sure there are no extra forms in the document, and
- // that the submit button for the neutered forms don't do anything.
- // If the test finds extra forms the submit() causes the test to timeout, then
- // there may be a security issue.
- is(document.forms.length, 11, "Checking for unexpected forms");
- $("neutered_submit10").click();
- $("neutered_submit11").click();
-
- SimpleTest.finish();
-}
-</script>
-</pre>
-</body>
-</html>
-
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_form_action_javascript.html b/toolkit/components/passwordmgr/test/mochitest/test_form_action_javascript.html
deleted file mode 100644
index d37e92c40..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_form_action_javascript.html
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test forms with a JS submit action</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: form with JS submit action
-<script>
-runChecksAfterCommonInit(() => startTest());
-
-runInParent(function setup() {
- const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
- Cu.import("resource://gre/modules/Services.jsm");
-
- let jslogin = Cc["@mozilla.org/login-manager/loginInfo;1"].createInstance(Ci.nsILoginInfo);
- jslogin.init("http://mochi.test:8888", "javascript:", null,
- "jsuser", "jspass123", "uname", "pword");
- Services.logins.addLogin(jslogin);
-});
-
-/** Test for Login Manager: JS action URL **/
-
-function startTest() {
- checkForm(1, "jsuser", "jspass123");
-
- SimpleTest.finish();
-}
-</script>
-
-<p id="display"></p>
-
-<div id="content" style="display: none">
-
-
-<form id='form1' action='javascript:alert("never shows")'> 1
- <input name="uname">
- <input name="pword" type="password">
-
- <button type='submit'>Submit</button>
- <button type='reset'> Reset </button>
-</form>
-
-</div>
-
-<pre id="test"></pre>
-</body>
-</html>
-
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_formless_autofill.html b/toolkit/components/passwordmgr/test/mochitest/test_formless_autofill.html
deleted file mode 100644
index 6263c818d..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_formless_autofill.html
+++ /dev/null
@@ -1,147 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test autofilling of fields outside of a form</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<script type="application/javascript;version=1.8">
-let chromeScript = runInParent(SimpleTest.getTestFileURL("pwmgr_common.js"));
-
-document.addEventListener("DOMContentLoaded", () => {
- document.getElementById("loginFrame").addEventListener("load", (evt) => {
- // Tell the parent to setup test logins.
- chromeScript.sendAsyncMessage("setupParent", { selfFilling: true });
- });
-});
-
-let doneSetupPromise = new Promise(resolve => {
- // When the setup is done, load a recipe for this test.
- chromeScript.addMessageListener("doneSetup", function doneSetup() {
- resolve();
- });
-});
-
-add_task(function* setup() {
- info("Waiting for loads and setup");
- yield doneSetupPromise;
-
- yield loadRecipes({
- siteRecipes: [{
- hosts: ["mochi.test:8888"],
- usernameSelector: "input[name='recipeuname']",
- passwordSelector: "input[name='recipepword']",
- }],
- });
-});
-
-
-const DEFAULT_ORIGIN = "http://mochi.test:8888";
-const TESTCASES = [
- {
- // Inputs
- document: `<input type=password>`,
-
- // Expected outputs
- expectedInputValues: ["testpass"],
- },
- {
- document: `<input>
- <input type=password>`,
- expectedInputValues: ["testuser", "testpass"],
- },
- {
- document: `<input>
- <input type=password>
- <input type=password>`,
- expectedInputValues: ["testuser", "testpass", ""],
- },
- {
- document: `<input>
- <input type=password>
- <input type=password>
- <input type=password>`,
- expectedInputValues: ["testuser", "testpass", "", ""],
- },
- {
- document: `<input>
- <input type=password form="form1">
- <input type=password>
- <form id="form1">
- <input>
- <input type=password>
- </form>`,
- expectedFormCount: 2,
- expectedInputValues: ["testuser", "testpass", "testpass", "", ""],
- },
- {
- document: `<!-- formless password field selector recipe test -->
- <input>
- <input type=password>
- <input>
- <input type=password name="recipepword">`,
- expectedInputValues: ["", "", "testuser", "testpass"],
- },
- {
- document: `<!-- formless username and password field selector recipe test -->
- <input name="recipeuname">
- <input>
- <input type=password>
- <input type=password name="recipepword">`,
- expectedInputValues: ["testuser", "", "", "testpass"],
- },
- {
- document: `<!-- form and formless recipe field selector test -->
- <input name="recipeuname">
- <input>
- <input type=password form="form1"> <!-- not filled since recipe affects both FormLikes -->
- <input type=password>
- <input type=password name="recipepword">
- <form id="form1">
- <input>
- <input type=password>
- </form>`,
- expectedFormCount: 2,
- expectedInputValues: ["testuser", "", "", "", "testpass", "", ""],
- },
-];
-
-add_task(function* test() {
- let loginFrame = document.getElementById("loginFrame");
- let frameDoc = loginFrame.contentWindow.document;
-
- for (let tc of TESTCASES) {
- info("Starting testcase: " + JSON.stringify(tc));
-
- let numFormLikesExpected = tc.expectedFormCount || 1;
-
- let processedFormPromise = promiseFormsProcessed(numFormLikesExpected);
-
- frameDoc.documentElement.innerHTML = tc.document;
- info("waiting for " + numFormLikesExpected + " processed form(s)");
- yield processedFormPromise;
-
- let testInputs = frameDoc.documentElement.querySelectorAll("input");
- is(testInputs.length, tc.expectedInputValues.length, "Check number of inputs");
- for (let i = 0; i < tc.expectedInputValues.length; i++) {
- let expectedValue = tc.expectedInputValues[i];
- is(testInputs[i].value, expectedValue,
- "Check expected input value " + i + ": " + expectedValue);
- }
- }
-});
-
-</script>
-
-<p id="display"></p>
-
-<div id="content">
- <iframe id="loginFrame" src="http://mochi.test:8888/tests/toolkit/components/passwordmgr/test/blank.html"></iframe>
-</div>
-<pre id="test"></pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit.html b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit.html
deleted file mode 100644
index 468da1e7f..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit.html
+++ /dev/null
@@ -1,183 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test capturing of fields outside of a form</title>
- <script src="/tests/SimpleTest/SimpleTest.js"></script>
- <script src="/tests/SimpleTest/SpawnTask.js"></script>
- <script src="pwmgr_common.js"></script>
- <link rel="stylesheet" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<script type="application/javascript;version=1.8">
-const LMCBackstagePass = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerContent.jsm");
-const { LoginManagerContent, LoginFormFactory } = LMCBackstagePass;
-
-let chromeScript = runInParent(SimpleTest.getTestFileURL("pwmgr_common.js"));
-
-let loadPromise = new Promise(resolve => {
- document.addEventListener("DOMContentLoaded", () => {
- document.getElementById("loginFrame").addEventListener("load", (evt) => {
- resolve();
- });
- });
-});
-
-add_task(function* setup() {
- info("Waiting for page and frame loads");
- yield loadPromise;
-
- yield loadRecipes({
- siteRecipes: [{
- hosts: ["mochi.test:8888"],
- usernameSelector: "input[name='recipeuname']",
- passwordSelector: "input[name='recipepword']",
- }],
- });
-});
-
-const DEFAULT_ORIGIN = "http://mochi.test:8888";
-const TESTCASES = [
- {
- // Inputs
- document: `<input type=password value="pass1">`,
- inputIndexForFormLike: 0,
-
- // Expected outputs similar to RemoteLogins:onFormSubmit
- hostname: DEFAULT_ORIGIN,
- formSubmitURL: DEFAULT_ORIGIN,
- usernameFieldValue: null,
- newPasswordFieldValue: "pass1",
- oldPasswordFieldValue: null,
- },
- {
- document: `<input value="user1">
- <input type=password value="pass1">`,
- inputIndexForFormLike: 0,
- hostname: DEFAULT_ORIGIN,
- formSubmitURL: DEFAULT_ORIGIN,
- usernameFieldValue: "user1",
- newPasswordFieldValue: "pass1",
- oldPasswordFieldValue: null,
- },
- {
- document: `<input value="user1">
- <input type=password value="pass1">`,
- inputIndexForFormLike: 1,
- hostname: DEFAULT_ORIGIN,
- formSubmitURL: DEFAULT_ORIGIN,
- usernameFieldValue: "user1",
- newPasswordFieldValue: "pass1",
- oldPasswordFieldValue: null,
- },
- {
- document: `<input value="user1">
- <input type=password value="pass1">
- <input type=password value="pass2">`,
- inputIndexForFormLike: 2,
- hostname: DEFAULT_ORIGIN,
- formSubmitURL: DEFAULT_ORIGIN,
- usernameFieldValue: "user1",
- newPasswordFieldValue: "pass2",
- oldPasswordFieldValue: "pass1",
- },
- {
- document: `<input value="user1">
- <input type=password value="pass1">
- <input type=password value="pass2">
- <input type=password value="pass2">`,
- inputIndexForFormLike: 3,
- hostname: DEFAULT_ORIGIN,
- formSubmitURL: DEFAULT_ORIGIN,
- usernameFieldValue: "user1",
- newPasswordFieldValue: "pass2",
- oldPasswordFieldValue: "pass1",
- },
- {
- document: `<input value="user1">
- <input type=password value="user2" form="form1">
- <input type=password value="pass1">
- <form id="form1">
- <input value="user3">
- <input type=password value="pass2">
- </form>`,
- inputIndexForFormLike: 2,
- hostname: DEFAULT_ORIGIN,
- formSubmitURL: DEFAULT_ORIGIN,
- usernameFieldValue: "user1",
- newPasswordFieldValue: "pass1",
- oldPasswordFieldValue: null,
- },
- {
- document: `<!-- recipe field override -->
- <input name="recipeuname" value="username from recipe">
- <input value="default field username">
- <input type=password value="pass1">
- <input name="recipepword" type=password value="pass2">`,
- inputIndexForFormLike: 2,
- hostname: DEFAULT_ORIGIN,
- formSubmitURL: DEFAULT_ORIGIN,
- usernameFieldValue: "username from recipe",
- newPasswordFieldValue: "pass2",
- oldPasswordFieldValue: null,
- },
-];
-
-function getSubmitMessage() {
- info("getSubmitMessage");
- return new Promise((resolve, reject) => {
- chromeScript.addMessageListener("formSubmissionProcessed", function processed(...args) {
- info("got formSubmissionProcessed");
- chromeScript.removeMessageListener("formSubmissionProcessed", processed);
- resolve(...args);
- });
- });
-}
-
-add_task(function* test() {
- let loginFrame = document.getElementById("loginFrame");
- let frameDoc = loginFrame.contentWindow.document;
-
- for (let tc of TESTCASES) {
- info("Starting testcase: " + JSON.stringify(tc));
- frameDoc.documentElement.innerHTML = tc.document;
- let inputForFormLike = frameDoc.querySelectorAll("input")[tc.inputIndexForFormLike];
-
- let formLike = LoginFormFactory.createFromField(inputForFormLike);
-
- info("Calling _onFormSubmit with FormLike");
- let processedPromise = getSubmitMessage();
- LoginManagerContent._onFormSubmit(formLike);
-
- let submittedResult = yield processedPromise;
-
- // Check data sent via RemoteLogins:onFormSubmit
- is(submittedResult.hostname, tc.hostname, "Check hostname");
- is(submittedResult.formSubmitURL, tc.formSubmitURL, "Check formSubmitURL");
-
- if (tc.usernameFieldValue === null) {
- is(submittedResult.usernameField, tc.usernameFieldValue, "Check usernameField");
- } else {
- is(submittedResult.usernameField.value, tc.usernameFieldValue, "Check usernameField");
- }
-
- is(submittedResult.newPasswordField.value, tc.newPasswordFieldValue, "Check newPasswordFieldValue");
-
- if (tc.oldPasswordFieldValue === null) {
- is(submittedResult.oldPasswordField, tc.oldPasswordFieldValue, "Check oldPasswordFieldValue");
- } else {
- is(submittedResult.oldPasswordField.value, tc.oldPasswordFieldValue, "Check oldPasswordFieldValue");
- }
- }
-});
-
-</script>
-
-<p id="display"></p>
-
-<div id="content">
- <iframe id="loginFrame" src="http://mochi.test:8888/tests/toolkit/components/passwordmgr/test/blank.html"></iframe>
-</div>
-<pre id="test"></pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation.html b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation.html
deleted file mode 100644
index b07d0886c..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation.html
+++ /dev/null
@@ -1,191 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test capturing of fields outside of a form due to navigation</title>
- <script src="/tests/SimpleTest/SimpleTest.js"></script>
- <script src="/tests/SimpleTest/SpawnTask.js"></script>
- <script src="pwmgr_common.js"></script>
- <link rel="stylesheet" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<script type="application/javascript;version=1.8">
-const LMCBackstagePass = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerContent.jsm");
-const { LoginManagerContent, LoginFormFactory } = LMCBackstagePass;
-
-let chromeScript = runInParent(SimpleTest.getTestFileURL("pwmgr_common.js"));
-
-let loadPromise = new Promise(resolve => {
- document.addEventListener("DOMContentLoaded", () => {
- document.getElementById("loginFrame").addEventListener("load", (evt) => {
- resolve();
- });
- });
-});
-
-add_task(function* setup() {
- yield SpecialPowers.pushPrefEnv({
- set: [
- ["signon.formlessCapture.enabled", true],
- ],
- });
-
- info("Waiting for page and frame loads");
- yield loadPromise;
-
- yield loadRecipes({
- siteRecipes: [{
- hosts: ["test1.mochi.test:8888"],
- usernameSelector: "input[name='recipeuname']",
- passwordSelector: "input[name='recipepword']",
- }],
- });
-});
-
-const DEFAULT_ORIGIN = "http://test1.mochi.test:8888";
-const SCRIPTS = {
- PUSHSTATE: `history.pushState({}, "Pushed state", "?pushed");`,
- WINDOW_LOCATION: `window.location = "data:text/html;charset=utf-8,window.location";`,
-};
-const TESTCASES = [
- {
- // Inputs
- document: `<input type=password value="pass1">`,
-
- // Expected outputs similar to RemoteLogins:onFormSubmit
- hostname: DEFAULT_ORIGIN,
- formSubmitURL: DEFAULT_ORIGIN,
- usernameFieldValue: null,
- newPasswordFieldValue: "pass1",
- oldPasswordFieldValue: null,
- },
- {
- document: `<input value="user1">
- <input type=password value="pass1">`,
-
- hostname: DEFAULT_ORIGIN,
- formSubmitURL: DEFAULT_ORIGIN,
- usernameFieldValue: "user1",
- newPasswordFieldValue: "pass1",
- oldPasswordFieldValue: null,
- },
- {
- document: `<input value="user1">
- <input type=password value="pass1">
- <input type=password value="pass2">`,
-
- hostname: DEFAULT_ORIGIN,
- formSubmitURL: DEFAULT_ORIGIN,
- usernameFieldValue: "user1",
- newPasswordFieldValue: "pass2",
- oldPasswordFieldValue: "pass1",
- },
- {
- document: `<input value="user1">
- <input type=password value="pass1">
- <input type=password value="pass2">
- <input type=password value="pass2">`,
-
- hostname: DEFAULT_ORIGIN,
- formSubmitURL: DEFAULT_ORIGIN,
- usernameFieldValue: "user1",
- newPasswordFieldValue: "pass2",
- oldPasswordFieldValue: "pass1",
- },
- {
- document: `<input value="user1">
- <input type=password value="user2" form="form1">
- <input type=password value="pass1">
- <form id="form1">
- <input value="user3">
- <input type=password value="pass2">
- </form>`,
-
- hostname: DEFAULT_ORIGIN,
- formSubmitURL: DEFAULT_ORIGIN,
- usernameFieldValue: "user1",
- newPasswordFieldValue: "pass1",
- oldPasswordFieldValue: null,
- },
- {
- document: `<!-- recipe field override -->
- <input name="recipeuname" value="username from recipe">
- <input value="default field username">
- <input type=password value="pass1">
- <input name="recipepword" type=password value="pass2">`,
-
- hostname: DEFAULT_ORIGIN,
- formSubmitURL: DEFAULT_ORIGIN,
- usernameFieldValue: "username from recipe",
- newPasswordFieldValue: "pass2",
- oldPasswordFieldValue: null,
- },
-];
-
-function getSubmitMessage() {
- info("getSubmitMessage");
- return new Promise((resolve, reject) => {
- chromeScript.addMessageListener("formSubmissionProcessed", function processed(...args) {
- info("got formSubmissionProcessed");
- chromeScript.removeMessageListener("formSubmissionProcessed", processed);
- resolve(...args);
- });
- });
-}
-
-add_task(function* test() {
- let loginFrame = document.getElementById("loginFrame");
-
- for (let tc of TESTCASES) {
- for (let scriptName of Object.keys(SCRIPTS)) {
- info("Starting testcase with script " + scriptName + ": " + JSON.stringify(tc));
- let loadedPromise = new Promise((resolve) => {
- loginFrame.addEventListener("load", function frameLoaded() {
- loginFrame.removeEventListener("load", frameLoaded);
- resolve();
- });
- });
- loginFrame.src = DEFAULT_ORIGIN + "/tests/toolkit/components/passwordmgr/test/mochitest/blank.html";
- yield loadedPromise;
-
- let frameDoc = SpecialPowers.wrap(loginFrame.contentWindow).document;
- frameDoc.documentElement.innerHTML = tc.document;
- // Wait for the form to be processed before trying to submit.
- yield promiseFormsProcessed();
- let processedPromise = getSubmitMessage();
- info("Running " + scriptName + " script to cause a submission");
- frameDoc.defaultView.eval(SCRIPTS[scriptName]);
-
- let submittedResult = yield processedPromise;
-
- // Check data sent via RemoteLogins:onFormSubmit
- is(submittedResult.hostname, tc.hostname, "Check hostname");
- is(submittedResult.formSubmitURL, tc.formSubmitURL, "Check formSubmitURL");
-
- if (tc.usernameFieldValue === null) {
- is(submittedResult.usernameField, tc.usernameFieldValue, "Check usernameField");
- } else {
- is(submittedResult.usernameField.value, tc.usernameFieldValue, "Check usernameField");
- }
-
- is(submittedResult.newPasswordField.value, tc.newPasswordFieldValue, "Check newPasswordFieldValue");
-
- if (tc.oldPasswordFieldValue === null) {
- is(submittedResult.oldPasswordField, tc.oldPasswordFieldValue, "Check oldPasswordFieldValue");
- } else {
- is(submittedResult.oldPasswordField.value, tc.oldPasswordFieldValue, "Check oldPasswordFieldValue");
- }
- }
- }
-});
-
-</script>
-
-<p id="display"></p>
-
-<div id="content">
- <iframe id="loginFrame" src="http://test1.mochi.test:8888/tests/toolkit/components/passwordmgr/test/mochitest/blank.html"></iframe>
-</div>
-<pre id="test"></pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation_negative.html b/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation_negative.html
deleted file mode 100644
index 4283f128c..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_formless_submit_navigation_negative.html
+++ /dev/null
@@ -1,121 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test no capturing of fields outside of a form due to navigation</title>
- <script src="/tests/SimpleTest/SimpleTest.js"></script>
- <script src="/tests/SimpleTest/SpawnTask.js"></script>
- <script src="pwmgr_common.js"></script>
- <link rel="stylesheet" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<script type="application/javascript;version=1.8">
-const LMCBackstagePass = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerContent.jsm");
-const { LoginManagerContent, LoginFormFactory } = LMCBackstagePass;
-
-SimpleTest.requestFlakyTimeout("Testing that a message doesn't arrive");
-
-let chromeScript = runInParent(SimpleTest.getTestFileURL("pwmgr_common.js"));
-
-let loadPromise = new Promise(resolve => {
- document.addEventListener("DOMContentLoaded", () => {
- document.getElementById("loginFrame").addEventListener("load", (evt) => {
- resolve();
- });
- });
-});
-
-function submissionProcessed(...args) {
- ok(false, "No formSubmissionProcessed should occur in this test");
- info("got: " + JSON.stringify(args));
-}
-
-add_task(function* setup() {
- yield SpecialPowers.pushPrefEnv({
- set: [
- ["signon.formlessCapture.enabled", true],
- ],
- });
-
- info("Waiting for page and frame loads");
- yield loadPromise;
-
- chromeScript.addMessageListener("formSubmissionProcessed", submissionProcessed);
-
- SimpleTest.registerCleanupFunction(() => {
- chromeScript.removeMessageListener("formSubmissionProcessed", submissionProcessed);
- });
-});
-
-const DEFAULT_ORIGIN = "http://test1.mochi.test:8888";
-const SCRIPTS = {
- PUSHSTATE: `history.pushState({}, "Pushed state", "?pushed");`,
- WINDOW_LOCATION: `window.location = "data:text/html;charset=utf-8,window.location";`,
- WINDOW_LOCATION_RELOAD: `window.location.reload();`,
- HISTORY_BACK: `history.back();`,
- HISTORY_GO_MINUS1: `history.go(-1);`,
-};
-const TESTCASES = [
- // Begin test cases that shouldn't trigger capture.
- {
- // For now we don't trigger upon navigation if <form> is used.
- document: `<form><input type=password value="pass1"></form>`,
- },
- {
- // Empty password field
- document: `<input type=password value="">`,
- },
- {
- // Test with an input that would normally be captured but with SCRIPTS that
- // shouldn't trigger capture.
- document: `<input type=password value="pass2">`,
- wouldCapture: true,
- },
-];
-
-add_task(function* test() {
- let loginFrame = document.getElementById("loginFrame");
-
- for (let tc of TESTCASES) {
- for (let scriptName of Object.keys(SCRIPTS)) {
- if (tc.wouldCapture && ["PUSHSTATE", "WINDOW_LOCATION"].includes(scriptName)) {
- // Don't run scripts that should actually capture for this testcase.
- continue;
- }
-
- info("Starting testcase with script " + scriptName + ": " + JSON.stringify(tc));
- let loadedPromise = new Promise((resolve) => {
- loginFrame.addEventListener("load", function frameLoaded() {
- loginFrame.removeEventListener("load", frameLoaded);
- resolve();
- });
- });
- loginFrame.src = DEFAULT_ORIGIN + "/tests/toolkit/components/passwordmgr/test/mochitest/blank.html";
- yield loadedPromise;
-
- let frameDoc = SpecialPowers.wrap(loginFrame.contentWindow).document;
- frameDoc.documentElement.innerHTML = tc.document;
-
- // Wait for the form to be processed before trying to submit.
- yield promiseFormsProcessed();
-
- info("Running " + scriptName + " script to check for a submission");
- frameDoc.defaultView.eval(SCRIPTS[scriptName]);
-
- // Wait for 5000ms to see if the promise above resolves.
- yield new Promise(resolve => setTimeout(resolve, 5000));
- ok(true, "Done waiting for captures");
- }
- }
-});
-
-</script>
-
-<p id="display"></p>
-
-<div id="content">
- <iframe id="loginFrame" src="http://test1.mochi.test:8888/tests/toolkit/components/passwordmgr/test/mochitest/blank.html"></iframe>
-</div>
-<pre id="test"></pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_input_events.html b/toolkit/components/passwordmgr/test/mochitest/test_input_events.html
deleted file mode 100644
index 0e77956d8..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_input_events.html
+++ /dev/null
@@ -1,96 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for input events in Login Manager</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body onload="onNewEvent(event)">
-Login Manager test: input events should fire.
-
-<script>
-runChecksAfterCommonInit();
-
-SimpleTest.requestFlakyTimeout("untriaged");
-
-/** Test for Login Manager: form fill, should get input events. **/
-
-var usernameInputFired = false;
-var passwordInputFired = false;
-var usernameChangeFired = false;
-var passwordChangeFired = false;
-var onloadFired = false;
-
-function onNewEvent(e) {
- info("Got " + e.type + " event.");
- if (e.type == "load") {
- onloadFired = true;
- } else if (e.type == "input") {
- if (e.target.name == "uname") {
- is(e.target.value, "testuser", "Should get 'testuser' as username");
- ok(!usernameInputFired, "Should not have gotten an input event for the username field yet.");
- usernameInputFired = true;
- } else if (e.target.name == "pword") {
- is(e.target.value, "testpass", "Should get 'testpass' as password");
- ok(!passwordInputFired, "Should not have gotten an input event for the password field yet.");
- passwordInputFired = true;
- }
- } else if (e.type == "change") {
- if (e.target.name == "uname") {
- is(e.target.value, "testuser", "Should get 'testuser' as username");
- ok(usernameInputFired, "Should get input event before change event for username field.");
- ok(!usernameChangeFired, "Should not have gotten a change event for the username field yet.");
- usernameChangeFired = true;
- } else if (e.target.name == "pword") {
- is(e.target.value, "testpass", "Should get 'testpass' as password");
- ok(passwordInputFired, "Should get input event before change event for password field.");
- ok(!passwordChangeFired, "Should not have gotten a change event for the password field yet.");
- passwordChangeFired = true;
- }
- }
- if (onloadFired && usernameInputFired && passwordInputFired && usernameChangeFired && passwordChangeFired) {
- ok(true, "All events fired as expected, we're done.");
- SimpleTest.finish();
- }
-}
-
-SimpleTest.registerCleanupFunction(function cleanup() {
- clearTimeout(timeout);
- $_(1, "uname").removeAttribute("oninput");
- $_(1, "pword").removeAttribute("oninput");
- $_(1, "uname").removeAttribute("onchange");
- $_(1, "pword").removeAttribute("onchange");
- document.body.removeAttribute("onload");
-});
-
-var timeout = setTimeout(function() {
- ok(usernameInputFired, "Username input event should have fired by now.");
- ok(passwordInputFired, "Password input event should have fired by now.");
- ok(usernameChangeFired, "Username change event should have fired by now.");
- ok(passwordChangeFired, "Password change event should have fired by now.");
- ok(onloadFired, "Window load event should have fired by now.");
- ok(false, "Not all events fired yet.");
- SimpleTest.finish();
-}, 10000);
-
-</script>
-
-<p id="display"></p>
-
-<div id="content" style="display: none">
-
- <form id="form1" action="formtest.js">
- <p>This is form 1.</p>
- <input type="text" name="uname" oninput="onNewEvent(event)" onchange="onNewEvent(event)">
- <input type="password" name="pword" oninput="onNewEvent(event)" onchange="onNewEvent(event)">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
-</div>
-<pre id="test"></pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_input_events_for_identical_values.html b/toolkit/components/passwordmgr/test/mochitest/test_input_events_for_identical_values.html
deleted file mode 100644
index d058a87f9..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_input_events_for_identical_values.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for input events in Login Manager when username/password are filled in already</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body onload="onNewEvent(event)">
-Login Manager test: input events should fire.
-
-<script>
-runChecksAfterCommonInit();
-
-SimpleTest.requestFlakyTimeout("untriaged");
-
-/** Test for Login Manager: form fill when form is already filled, should not get input events. **/
-
-var onloadFired = false;
-
-function onNewEvent(e) {
- console.error("Got " + e.type + " event.");
- if (e.type == "load") {
- onloadFired = true;
- $_(1, "uname").focus();
- sendKey("Tab");
- } else {
- ok(false, "Got an input event for " + e.target.name + " field, which shouldn't happen.");
- }
-}
-</script>
-
-<p id="display"></p>
-
-<div id="content">
-
- <form id="form1" action="formtest.js">
- <p>This is form 1.</p>
- <input type="text" name="uname" oninput="onNewEvent(event)" value="testuser">
- <input type="password" name="pword" oninput="onNewEvent(event)" onfocus="setTimeout(function() { SimpleTest.finish() }, 1000);" value="testpass">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
-</div>
-<pre id="test"></pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_autocomplete.html b/toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_autocomplete.html
deleted file mode 100644
index c5d0a44fa..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_autocomplete.html
+++ /dev/null
@@ -1,861 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test insecure form field autocomplete</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-
-<script>
-var chromeScript = runChecksAfterCommonInit();
-
-var setupScript = runInParent(function setup() {
- const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
- Cu.import("resource://gre/modules/Services.jsm");
-
- // Create some logins just for this form, since we'll be deleting them.
- var nsLoginInfo = Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
- assert.ok(nsLoginInfo != null, "nsLoginInfo constructor");
-
- // login0 has no username, so should be filtered out from the autocomplete list.
- var login0 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "", "user0pass", "", "pword");
-
- var login1 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "tempuser1", "temppass1", "uname", "pword");
-
- var login2 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "testuser2", "testpass2", "uname", "pword");
-
- var login3 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "testuser3", "testpass3", "uname", "pword");
-
- var login4 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "zzzuser4", "zzzpass4", "uname", "pword");
-
- // login 5 only used in the single-user forms
- var login5 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete2", null,
- "singleuser5", "singlepass5", "uname", "pword");
-
- var login6A = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete3", null,
- "form7user1", "form7pass1", "uname", "pword");
- var login6B = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete3", null,
- "form7user2", "form7pass2", "uname", "pword");
-
- var login7 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete4", null,
- "form8user", "form8pass", "uname", "pword");
-
- var login8A = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete5", null,
- "form9userAB", "form9pass", "uname", "pword");
- var login8B = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete5", null,
- "form9userAAB", "form9pass", "uname", "pword");
- var login8C = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete5", null,
- "form9userAABzz", "form9pass", "uname", "pword");
-
- var login10 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete7", null,
- "testuser10", "testpass10", "uname", "pword");
-
-
- // try/catch in case someone runs the tests manually, twice.
- try {
- Services.logins.addLogin(login0);
- Services.logins.addLogin(login1);
- Services.logins.addLogin(login2);
- Services.logins.addLogin(login3);
- Services.logins.addLogin(login4);
- Services.logins.addLogin(login5);
- Services.logins.addLogin(login6A);
- Services.logins.addLogin(login6B);
- Services.logins.addLogin(login7);
- Services.logins.addLogin(login8A);
- Services.logins.addLogin(login8B);
- // login8C is added later
- Services.logins.addLogin(login10);
- } catch (e) {
- assert.ok(false, "addLogin threw: " + e);
- }
-
- addMessageListener("addLogin", loginVariableName => {
- let login = eval(loginVariableName);
- assert.ok(!!login, "Login to add is defined: " + loginVariableName);
- Services.logins.addLogin(login);
- });
- addMessageListener("removeLogin", loginVariableName => {
- let login = eval(loginVariableName);
- assert.ok(!!login, "Login to delete is defined: " + loginVariableName);
- Services.logins.removeLogin(login);
- });
-});
-</script>
-<p id="display"></p>
-
-<!-- we presumably can't hide the content for this test. -->
-<div id="content">
-
- <!-- form1 tests multiple matching logins -->
- <form id="form1" action="http://autocomplete:8888/formtest.js" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- other forms test single logins, with autocomplete=off set -->
- <form id="form2" action="http://autocomplete2" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword" autocomplete="off">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form3" action="http://autocomplete2" onsubmit="return false;">
- <input type="text" name="uname" autocomplete="off">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form4" action="http://autocomplete2" onsubmit="return false;" autocomplete="off">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form5" action="http://autocomplete2" onsubmit="return false;">
- <input type="text" name="uname" autocomplete="off">
- <input type="password" name="pword" autocomplete="off">
- <button type="submit">Submit</button>
- </form>
-
- <!-- control -->
- <form id="form6" action="http://autocomplete2" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- This form will be manipulated to insert a different username field. -->
- <form id="form7" action="http://autocomplete3" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- test for no autofill after onblur with blank username -->
- <form id="form8" action="http://autocomplete4" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- test autocomplete dropdown -->
- <form id="form9" action="http://autocomplete5" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- test for onUsernameInput recipe testing -->
- <form id="form11" action="http://autocomplete7" onsubmit="return false;">
- <input type="text" name="1">
- <input type="text" name="2">
- <button type="submit">Submit</button>
- </form>
-
- <!-- tests <form>-less autocomplete -->
- <div id="form12">
- <input type="text" name="uname" id="uname">
- <input type="password" name="pword" id="pword">
- <button type="submit">Submit</button>
- </div>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: multiple login autocomplete. **/
-
-var uname = $_(1, "uname");
-var pword = $_(1, "pword");
-const shiftModifier = SpecialPowers.Ci.nsIDOMEvent.SHIFT_MASK;
-
-// Restore the form to the default state.
-function restoreForm() {
- uname.value = "";
- pword.value = "";
- uname.focus();
-}
-
-// Check for expected username/password in form.
-function checkACForm(expectedUsername, expectedPassword) {
- var formID = uname.parentNode.id;
- is(uname.value, expectedUsername, "Checking " + formID + " username is: " + expectedUsername);
- is(pword.value, expectedPassword, "Checking " + formID + " password is: " + expectedPassword);
-}
-
-function sendFakeAutocompleteEvent(element) {
- var acEvent = document.createEvent("HTMLEvents");
- acEvent.initEvent("DOMAutoComplete", true, false);
- element.dispatchEvent(acEvent);
-}
-
-function spinEventLoop() {
- return Promise.resolve();
-}
-
-add_task(function* setup() {
- yield SpecialPowers.pushPrefEnv({"set": [["security.insecure_field_warning.contextual.enabled", true],
- ["signon.autofillForms.http", true]]});
- listenForUnexpectedPopupShown();
-});
-
-add_task(function* test_form1_initial_empty() {
- yield SimpleTest.promiseFocus(window);
-
- // Make sure initial form is empty.
- checkACForm("", "");
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup is initially closed");
-});
-
-add_task(function* test_form1_warning_entry() {
- yield SimpleTest.promiseFocus(window);
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- let results = yield shownPromise;
-
- let popupState = yield getPopupState();
- is(popupState.selectedIndex, -1, "Check no entries are selected upon opening");
-
- let expectedMenuItems = ["This connection is not secure. Logins entered here could be compromised. Learn More",
- "tempuser1",
- "testuser2",
- "testuser3",
- "zzzuser4"];
- checkArrayValues(results, expectedMenuItems, "Check all menuitems are displayed correctly.");
-
- doKey("down"); // select insecure warning
- checkACForm("", ""); // value shouldn't update just by selecting
- doKey("return"); // not "enter"!
- yield spinEventLoop(); // let focus happen
- checkACForm("", "");
-});
-
-add_task(function* test_form1_first_entry() {
- yield SimpleTest.promiseFocus(window);
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- let popupState = yield getPopupState();
- is(popupState.selectedIndex, -1, "Check no entries are selected upon opening");
-
- doKey("down"); // skip insecure warning
- doKey("down"); // first
- checkACForm("", ""); // value shouldn't update just by selecting
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("tempuser1", "temppass1");
-});
-
-add_task(function* test_form1_second_entry() {
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- doKey("down"); // first
- doKey("down"); // second
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("testuser2", "testpass2");
-});
-
-add_task(function* test_form1_third_entry() {
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- doKey("down"); // first
- doKey("down"); // second
- doKey("down"); // third
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("testuser3", "testpass3");
-});
-
-add_task(function* test_form1_fourth_entry() {
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- doKey("down"); // first
- doKey("down"); // second
- doKey("down"); // third
- doKey("down"); // fourth
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("zzzuser4", "zzzpass4");
-});
-
-add_task(function* test_form1_wraparound_first_entry() {
- // Trigger autocomplete popup
- restoreForm();
- yield spinEventLoop(); // let focus happen
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- doKey("down"); // first
- doKey("down"); // second
- doKey("down"); // third
- doKey("down"); // fourth
- doKey("down"); // deselects
- doKey("down"); // skip insecure warning
- doKey("down"); // first
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("tempuser1", "temppass1");
-});
-
-add_task(function* test_form1_wraparound_up_last_entry() {
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("up"); // last (fourth)
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("zzzuser4", "zzzpass4");
-});
-
-add_task(function* test_form1_wraparound_down_up_up() {
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // select first entry
- doKey("up"); // selects nothing!
- doKey("up"); // select last entry
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("zzzuser4", "zzzpass4");
-});
-
-add_task(function* test_form1_wraparound_up_last() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down");
- doKey("up"); // deselects
- doKey("up"); // last entry
- doKey("up");
- doKey("up");
- doKey("up"); // skip insecure warning
- doKey("up"); // first entry
- doKey("up"); // deselects
- doKey("up"); // last entry
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("zzzuser4", "zzzpass4");
-});
-
-add_task(function* test_form1_fill_username_without_autofill_right() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Set first entry w/o triggering autocomplete
- doKey("down"); // skip insecure warning
- doKey("down"); // first
- doKey("right");
- yield spinEventLoop();
- checkACForm("tempuser1", ""); // empty password
-});
-
-add_task(function* test_form1_fill_username_without_autofill_left() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Set first entry w/o triggering autocomplete
- doKey("down"); // skip insecure warning
- doKey("down"); // first
- doKey("left");
- checkACForm("tempuser1", ""); // empty password
-});
-
-add_task(function* test_form1_pageup_first() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // Check first entry (page up)
- doKey("down"); // first
- doKey("down"); // second
- doKey("page_up"); // first
- doKey("down"); // skip insecure warning
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("tempuser1", "temppass1");
-});
-
-add_task(function* test_form1_pagedown_last() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // test 13
- // Check last entry (page down)
- doKey("down"); // first
- doKey("page_down"); // last
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("zzzuser4", "zzzpass4");
-});
-
-add_task(function* test_form1_untrusted_event() {
- restoreForm();
- yield spinEventLoop();
-
- // Send a fake (untrusted) event.
- checkACForm("", "");
- uname.value = "zzzuser4";
- sendFakeAutocompleteEvent(uname);
- yield spinEventLoop();
- checkACForm("zzzuser4", "");
-});
-
-add_task(function* test_form1_delete() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- // XXX tried sending character "t" before/during dropdown to test
- // filtering, but had no luck. Seemed like the character was getting lost.
- // Setting uname.value didn't seem to work either. This works with a human
- // driver, so I'm not sure what's up.
-
- doKey("down"); // skip insecure warning
- // Delete the first entry (of 4), "tempuser1"
- doKey("down");
- var numLogins;
- numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
- is(numLogins, 5, "Correct number of logins before deleting one");
-
- let countChangedPromise = notifyMenuChanged(4);
- var deletionPromise = promiseStorageChanged(["removeLogin"]);
- // On OS X, shift-backspace and shift-delete work, just delete does not.
- // On Win/Linux, shift-backspace does not work, delete and shift-delete do.
- doKey("delete", shiftModifier);
- yield deletionPromise;
-
- checkACForm("", "");
- numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
- is(numLogins, 4, "Correct number of logins after deleting one");
- yield countChangedPromise;
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("testuser2", "testpass2");
-});
-
-add_task(function* test_form1_first_after_deletion() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- // Check the new first entry (of 3)
- doKey("down");
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("testuser2", "testpass2");
-});
-
-add_task(function* test_form1_delete_second() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- // Delete the second entry (of 3), "testuser3"
- doKey("down");
- doKey("down");
- doKey("delete", shiftModifier);
- checkACForm("", "");
- numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
- is(numLogins, 3, "Correct number of logins after deleting one");
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("zzzuser4", "zzzpass4");
-});
-
-add_task(function* test_form1_first_after_deletion2() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- // Check the new first entry (of 2)
- doKey("down");
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("testuser2", "testpass2");
-});
-
-add_task(function* test_form1_delete_last() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- // test 54
- // Delete the last entry (of 2), "zzzuser4"
- doKey("down");
- doKey("down");
- doKey("delete", shiftModifier);
- checkACForm("", "");
- numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
- is(numLogins, 2, "Correct number of logins after deleting one");
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("testuser2", "testpass2");
-});
-
-add_task(function* test_form1_first_after_3_deletions() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- // Check the only remaining entry
- doKey("down");
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("testuser2", "testpass2");
-});
-
-add_task(function* test_form1_check_only_entry_remaining() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- // test 56
- // Delete the only remaining entry, "testuser2"
- doKey("down");
- doKey("delete", shiftModifier);
- checkACForm("", "");
- numLogins = LoginManager.countLogins("http://mochi.test:8888", "http://autocomplete:8888", null);
- is(numLogins, 1, "Correct number of logins after deleting one");
-
- // remove the login that's not shown in the list.
- setupScript.sendSyncMessage("removeLogin", "login0");
-});
-
-// Tests for single-user forms for ignoring autocomplete=off
-add_task(function* test_form2() {
- // Turn our attention to form2
- uname = $_(2, "uname");
- pword = $_(2, "pword");
- checkACForm("singleuser5", "singlepass5");
-
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- // Check first entry
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("singleuser5", "singlepass5");
-});
-
-add_task(function* test_form3() {
- uname = $_(3, "uname");
- pword = $_(3, "pword");
- checkACForm("singleuser5", "singlepass5");
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- // Check first entry
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("singleuser5", "singlepass5");
-});
-
-add_task(function* test_form4() {
- uname = $_(4, "uname");
- pword = $_(4, "pword");
- checkACForm("singleuser5", "singlepass5");
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- // Check first entry
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("singleuser5", "singlepass5");
-});
-
-add_task(function* test_form5() {
- uname = $_(5, "uname");
- pword = $_(5, "pword");
- checkACForm("singleuser5", "singlepass5");
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- // Check first entry
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("singleuser5", "singlepass5");
-});
-
-add_task(function* test_form6() {
- // (this is a control, w/o autocomplete=off, to ensure the login
- // that was being suppressed would have been filled in otherwise)
- uname = $_(6, "uname");
- pword = $_(6, "pword");
- checkACForm("singleuser5", "singlepass5");
-});
-
-add_task(function* test_form6_changeUsername() {
- // Test that the password field remains filled in after changing
- // the username.
- uname.focus();
- doKey("right");
- sendChar("X");
- // Trigger the 'blur' event on uname
- pword.focus();
- yield spinEventLoop();
- checkACForm("singleuser5X", "singlepass5");
-
- setupScript.sendSyncMessage("removeLogin", "login5");
-});
-
-add_task(function* test_form7() {
- uname = $_(7, "uname");
- pword = $_(7, "pword");
- checkACForm("", "");
-
- // Insert a new username field into the form. We'll then make sure
- // that invoking the autocomplete doesn't try to fill the form.
- var newField = document.createElement("input");
- newField.setAttribute("type", "text");
- newField.setAttribute("name", "uname2");
- pword.parentNode.insertBefore(newField, pword);
- is($_(7, "uname2").value, "", "Verifying empty uname2");
-
- // Delete login6B. It was created just to prevent filling in a login
- // automatically, removing it makes it more likely that we'll catch a
- // future regression with form filling here.
- setupScript.sendSyncMessage("removeLogin", "login6B");
-});
-
-add_task(function* test_form7_2() {
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- // Check first entry
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- // The form changes, so we expect the old username field to get the
- // selected autocomplete value, but neither the new username field nor
- // the password field should have any values filled in.
- yield spinEventLoop();
- checkACForm("form7user1", "");
- is($_(7, "uname2").value, "", "Verifying empty uname2");
- restoreForm(); // clear field, so reloading test doesn't fail
-
- setupScript.sendSyncMessage("removeLogin", "login6A");
-});
-
-add_task(function* test_form8() {
- uname = $_(8, "uname");
- pword = $_(8, "pword");
- checkACForm("form8user", "form8pass");
- restoreForm();
-});
-
-add_task(function* test_form8_blur() {
- checkACForm("", "");
- // Focus the previous form to trigger a blur.
- $_(7, "uname").focus();
-});
-
-add_task(function* test_form8_2() {
- checkACForm("", "");
- restoreForm();
-});
-
-add_task(function* test_form8_3() {
- checkACForm("", "");
- setupScript.sendSyncMessage("removeLogin", "login7");
-});
-
-add_task(function* test_form9_filtering() {
- // Turn our attention to form9 to test the dropdown - bug 497541
- uname = $_(9, "uname");
- pword = $_(9, "pword");
- uname.focus();
- let shownPromise = promiseACShown();
- sendString("form9userAB");
- yield shownPromise;
-
- checkACForm("form9userAB", "");
- uname.focus();
- doKey("left");
- shownPromise = promiseACShown();
- sendChar("A");
- let results = yield shownPromise;
-
- checkACForm("form9userAAB", "");
- checkArrayValues(results, ["This connection is not secure. Logins entered here could be compromised. Learn More", "form9userAAB"],
- "Check dropdown is updated after inserting 'A'");
- doKey("down"); // skip insecure warning
- doKey("down");
- doKey("return");
- yield promiseFormsProcessed();
- checkACForm("form9userAAB", "form9pass");
-});
-
-add_task(function* test_form9_autocomplete_cache() {
- // Note that this addLogin call will only be seen by the autocomplete
- // attempt for the sendChar if we do not successfully cache the
- // autocomplete results.
- setupScript.sendSyncMessage("addLogin", "login8C");
- uname.focus();
- let promise0 = notifyMenuChanged(1);
- let shownPromise = promiseACShown();
- sendChar("z");
- yield promise0;
- yield shownPromise;
- let popupState = yield getPopupState();
- is(popupState.open, true, "Check popup should open");
-
- // check that empty results are cached - bug 496466
- promise0 = notifyMenuChanged(1);
- sendChar("z");
- yield promise0;
- popupState = yield getPopupState();
- is(popupState.open, true, "Check popup stays opened due to cached empty result");
-});
-
-add_task(function* test_form11_recipes() {
- yield loadRecipes({
- siteRecipes: [{
- "hosts": ["mochi.test:8888"],
- "usernameSelector": "input[name='1']",
- "passwordSelector": "input[name='2']"
- }],
- });
- uname = $_(11, "1");
- pword = $_(11, "2");
-
- // First test DOMAutocomplete
- // Switch the password field to type=password so _fillForm marks the username
- // field for autocomplete.
- pword.type = "password";
- yield promiseFormsProcessed();
- restoreForm();
- checkACForm("", "");
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- doKey("return"); // not "enter"!
- yield promiseFormsProcessed();
- checkACForm("testuser10", "testpass10");
-
- // Now test recipes with blur on the username field.
- restoreForm();
- checkACForm("", "");
- uname.value = "testuser10";
- checkACForm("testuser10", "");
- doKey("tab");
- yield promiseFormsProcessed();
- checkACForm("testuser10", "testpass10");
- yield resetRecipes();
-});
-
-add_task(function* test_form12_formless() {
- // Test form-less autocomplete
- uname = $_(12, "uname");
- pword = $_(12, "pword");
- restoreForm();
- checkACForm("", "");
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- doKey("down"); // skip insecure warning
- // Trigger autocomplete
- doKey("down");
- checkACForm("", ""); // value shouldn't update
- let processedPromise = promiseFormsProcessed();
- doKey("return"); // not "enter"!
- yield processedPromise;
- checkACForm("testuser", "testpass");
-});
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_no_saved_login.html b/toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_no_saved_login.html
deleted file mode 100644
index c3a894958..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_insecure_form_field_no_saved_login.html
+++ /dev/null
@@ -1,103 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test basic login, contextual inscure password warning without saved logins</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: contextual inscure password warning without saved logins
-
-<script>
-let chromeScript = runChecksAfterCommonInit();
-</script>
-<p id="display"></p>
-
-<!-- we presumably can't hide the content for this test. -->
-<div id="content">
-
- <form id="form1" action="http://autocomplete:8888/formtest.js" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: contextual inscure password warning without saved logins. **/
-
-// Set to pref before the document loads.
-SpecialPowers.setBoolPref(
- "security.insecure_field_warning.contextual.enabled", true);
-
-SimpleTest.registerCleanupFunction(() => {
- SpecialPowers.clearUserPref(
- "security.insecure_field_warning.contextual.enabled");
-});
-
-let uname = $_(1, "uname");
-let pword = $_(1, "pword");
-const shiftModifier = SpecialPowers.Ci.nsIDOMEvent.SHIFT_MASK;
-
-// Restore the form to the default state.
-function restoreForm() {
- uname.value = "";
- pword.value = "";
- uname.focus();
-}
-
-// Check for expected username/password in form.
-function checkACForm(expectedUsername, expectedPassword) {
- let formID = uname.parentNode.id;
- is(uname.value, expectedUsername, "Checking " + formID + " username is: " + expectedUsername);
- is(pword.value, expectedPassword, "Checking " + formID + " password is: " + expectedPassword);
-}
-
-function spinEventLoop() {
- return Promise.resolve();
-}
-
-add_task(function* setup() {
- listenForUnexpectedPopupShown();
-});
-
-add_task(function* test_form1_initial_empty() {
- yield SimpleTest.promiseFocus(window);
-
- // Make sure initial form is empty.
- checkACForm("", "");
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup is initially closed");
-});
-
-add_task(function* test_form1_warning_entry() {
- yield SimpleTest.promiseFocus(window);
- // Trigger autocomplete popup
- restoreForm();
- let shownPromise = promiseACShown();
- doKey("down"); // open
- yield shownPromise;
-
- let popupState = yield getPopupState();
- is(popupState.open, true, "Check popup is opened");
- is(popupState.selectedIndex, -1, "Check no entries are selected upon opening");
-
- doKey("down"); // select insecure warning
- checkACForm("", ""); // value shouldn't update just by selecting
- doKey("return"); // not "enter"!
- yield spinEventLoop(); // let focus happen
- checkACForm("", "");
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_maxlength.html b/toolkit/components/passwordmgr/test/mochitest/test_maxlength.html
deleted file mode 100644
index 2b6da33ec..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_maxlength.html
+++ /dev/null
@@ -1,137 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for maxlength attributes</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: Bug 391514
-<script>
-runChecksAfterCommonInit(() => startTest());
-</script>
-<p id="display"></p>
-<div id="content" style="display: none">
- <!-- normal form. -->
- <form id="form1" action="formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- limited username -->
- <form id="form2" action="formtest.js">
- <input type="text" name="uname" maxlength="4">
- <input type="password" name="pword">
- </form>
-
- <!-- limited password -->
- <form id="form3" action="formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword" maxlength="4">
- </form>
-
- <!-- limited username and password -->
- <form id="form4" action="formtest.js">
- <input type="text" name="uname" maxlength="4">
- <input type="password" name="pword" maxlength="4">
- </form>
-
-
- <!-- limited username -->
- <form id="form5" action="formtest.js">
- <input type="text" name="uname" maxlength="0">
- <input type="password" name="pword">
- </form>
-
- <!-- limited password -->
- <form id="form6" action="formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword" maxlength="0">
- </form>
-
- <!-- limited username and password -->
- <form id="form7" action="formtest.js">
- <input type="text" name="uname" maxlength="0">
- <input type="password" name="pword" maxlength="0">
- </form>
-
-
- <!-- limited, but ok, username -->
- <form id="form8" action="formtest.js">
- <input type="text" name="uname" maxlength="999">
- <input type="password" name="pword">
- </form>
-
- <!-- limited, but ok, password -->
- <form id="form9" action="formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword" maxlength="999">
- </form>
-
- <!-- limited, but ok, username and password -->
- <form id="form10" action="formtest.js">
- <input type="text" name="uname" maxlength="999">
- <input type="password" name="pword" maxlength="999">
- </form>
-
-
- <!-- limited, but ok, username -->
- <!-- (note that filled values are exactly 8 characters) -->
- <form id="form11" action="formtest.js">
- <input type="text" name="uname" maxlength="8">
- <input type="password" name="pword">
- </form>
-
- <!-- limited, but ok, password -->
- <!-- (note that filled values are exactly 8 characters) -->
- <form id="form12" action="formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword" maxlength="8">
- </form>
-
- <!-- limited, but ok, username and password -->
- <!-- (note that filled values are exactly 8 characters) -->
- <form id="form13" action="formtest.js">
- <input type="text" name="uname" maxlength="8">
- <input type="password" name="pword" maxlength="8">
- </form>
-
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/* Test for Login Manager: 391514 (Login Manager gets confused with
- * password/PIN on usaa.com)
- */
-
-function startTest() {
- var i;
-
- is($_(1, "uname").value, "testuser", "Checking for filled username 1");
- is($_(1, "pword").value, "testpass", "Checking for filled password 1");
-
- for (i = 2; i < 8; i++) {
- is($_(i, "uname").value, "", "Checking for unfilled username " + i);
- is($_(i, "pword").value, "", "Checking for unfilled password " + i);
- }
-
- for (i = 8; i < 14; i++) {
- is($_(i, "uname").value, "testuser", "Checking for filled username " + i);
- is($_(i, "pword").value, "testpass", "Checking for filled password " + i);
- }
-
- // Note that tests 11-13 are limited to exactly the expected value.
- // Assert this lest someone change the login we're testing with.
- is($_(11, "uname").value.length, 8, "asserting test assumption is valid.");
-
- SimpleTest.finish();
-}
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html b/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html
deleted file mode 100644
index 443c8a5e9..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_password_field_autocomplete.html
+++ /dev/null
@@ -1,291 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test basic login autocomplete</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: multiple login autocomplete
-
-<script>
-var chromeScript = runChecksAfterCommonInit();
-
-var setupScript = runInParent(function setup() {
- const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
- Cu.import("resource://gre/modules/Services.jsm");
-
- // Create some logins just for this form, since we'll be deleting them.
- var nsLoginInfo = Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
- assert.ok(nsLoginInfo != null, "nsLoginInfo constructor");
-
- // login0 has no username, so should be filtered out from the autocomplete list.
- var login0 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "", "user0pass", "", "pword");
-
- var login1 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "tempuser1", "temppass1", "uname", "pword");
-
- var login2 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "testuser2", "testpass2", "uname", "pword");
-
- var login3 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "testuser3", "testpass3", "uname", "pword");
-
- var login4 = new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "zzzuser4", "zzzpass4", "uname", "pword");
-
-
- // try/catch in case someone runs the tests manually, twice.
- try {
- Services.logins.addLogin(login0);
- Services.logins.addLogin(login1);
- Services.logins.addLogin(login2);
- Services.logins.addLogin(login3);
- Services.logins.addLogin(login4);
- } catch (e) {
- assert.ok(false, "addLogin threw: " + e);
- }
-
- addMessageListener("addLogin", loginVariableName => {
- let login = eval(loginVariableName);
- assert.ok(!!login, "Login to add is defined: " + loginVariableName);
- Services.logins.addLogin(login);
- });
- addMessageListener("removeLogin", loginVariableName => {
- let login = eval(loginVariableName);
- assert.ok(!!login, "Login to delete is defined: " + loginVariableName);
- Services.logins.removeLogin(login);
- });
-});
-</script>
-<p id="display"></p>
-
-<!-- we presumably can't hide the content for this test. -->
-<div id="content">
-
- <!-- form1 tests multiple matching logins -->
- <form id="form1" action="http://autocomplete:8888/formtest.js" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form2" action="http://autocomplete:8888/formtest.js" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword" readonly="true">
- <button type="submit">Submit</button>
- </form>
-
- <form id="form3" action="http://autocomplete:8888/formtest.js" onsubmit="return false;">
- <input type="text" name="uname">
- <input type="password" name="pword" disabled="true">
- <button type="submit">Submit</button>
- </form>
-
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: multiple login autocomplete. **/
-
-var uname = $_(1, "uname");
-var pword = $_(1, "pword");
-const shiftModifier = SpecialPowers.Ci.nsIDOMEvent.SHIFT_MASK;
-
-// Restore the form to the default state.
-function* reinitializeForm(index) {
- // Using innerHTML is for creating the autocomplete popup again, so the
- // preference value will be applied to the constructor of
- // UserAutoCompleteResult.
- let form = document.getElementById("form" + index);
- let temp = form.innerHTML;
- form.innerHTML = "";
- form.innerHTML = temp;
-
- yield new Promise(resolve => {
- let observer = SpecialPowers.wrapCallback(() => {
- SpecialPowers.removeObserver(observer, "passwordmgr-processed-form");
- resolve();
- });
- SpecialPowers.addObserver(observer, "passwordmgr-processed-form", false);
- });
-
- yield SimpleTest.promiseFocus(window);
-
- uname = $_(index, "uname");
- pword = $_(index, "pword");
- uname.value = "";
- pword.value = "";
- pword.focus();
-}
-
-function generateDateString(date) {
- let dateAndTimeFormatter = new Intl.DateTimeFormat(undefined,
- { day: "numeric", month: "short", year: "numeric" });
- return dateAndTimeFormatter.format(date);
-}
-
-const DATE_NOW_STRING = generateDateString(new Date());
-
-// Check for expected username/password in form.
-function checkACFormPasswordField(expectedPassword) {
- var formID = uname.parentNode.id;
- is(pword.value, expectedPassword, "Checking " + formID + " password is: " + expectedPassword);
-}
-
-function spinEventLoop() {
- return Promise.resolve();
-}
-
-add_task(function* setup() {
- listenForUnexpectedPopupShown();
-});
-
-add_task(function* test_form1_initial_empty() {
- yield SimpleTest.promiseFocus(window);
-
- // Make sure initial form is empty.
- checkACFormPasswordField("");
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup is initially closed");
-});
-
-add_task(function* test_form2_password_readonly() {
- yield SpecialPowers.pushPrefEnv({"set": [
- ["security.insecure_field_warning.contextual.enabled", true],
- ["signon.autofillForms.http", true]
- ]});
- yield reinitializeForm(2);
-
- // Trigger autocomplete popup
- doKey("down"); // open
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup is closed for a readonly field.");
-});
-
-add_task(function* test_form3_password_disabled() {
- yield SpecialPowers.pushPrefEnv({"set": [
- ["security.insecure_field_warning.contextual.enabled", true],
- ["signon.autofillForms.http", true]
- ]});
- yield reinitializeForm(3);
-
- // Trigger autocomplete popup
- doKey("down"); // open
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup is closed for a disabled field.");
-});
-
-add_task(function* test_form1_enabledInsecureFieldWarning_enabledInsecureAutoFillForm() {
- yield SpecialPowers.pushPrefEnv({"set": [
- ["security.insecure_field_warning.contextual.enabled", true],
- ["signon.autofillForms.http", true]
- ]});
- yield reinitializeForm(1);
- // Trigger autocomplete popup
- let shownPromise = promiseACShown();
- doKey("down"); // open
- let results = yield shownPromise;
-
- let popupState = yield getPopupState();
- is(popupState.selectedIndex, -1, "Check no entries are selected upon opening");
-
- let expectedMenuItems = ["This connection is not secure. Logins entered here could be compromised. Learn More",
- "No username (" + DATE_NOW_STRING + ")",
- "tempuser1",
- "testuser2",
- "testuser3",
- "zzzuser4"];
- checkArrayValues(results, expectedMenuItems, "Check all menuitems are displayed correctly.");
-
- doKey("down"); // select insecure warning
- checkACFormPasswordField(""); // value shouldn't update just by selecting
- doKey("return"); // not "enter"!
- yield spinEventLoop(); // let focus happen
- checkACFormPasswordField("");
-});
-
-add_task(function* test_form1_disabledInsecureFieldWarning_enabledInsecureAutoFillForm() {
- yield SpecialPowers.pushPrefEnv({"set": [
- ["security.insecure_field_warning.contextual.enabled", false],
- ["signon.autofillForms.http", true]
- ]});
- yield reinitializeForm(1);
-
- // Trigger autocomplete popup
- let shownPromise = promiseACShown();
- doKey("down"); // open
- let results = yield shownPromise;
-
- let popupState = yield getPopupState();
- is(popupState.selectedIndex, -1, "Check no entries are selected upon opening");
-
- let expectedMenuItems = ["No username (" + DATE_NOW_STRING + ")",
- "tempuser1",
- "testuser2",
- "testuser3",
- "zzzuser4"];
- checkArrayValues(results, expectedMenuItems, "Check all menuitems are displayed correctly.");
-
- doKey("down"); // select first item
- checkACFormPasswordField(""); // value shouldn't update just by selecting
- doKey("return"); // not "enter"!
- yield spinEventLoop(); // let focus happen
- checkACFormPasswordField("user0pass");
-});
-
-add_task(function* test_form1_enabledInsecureFieldWarning_disabledInsecureAutoFillForm() {
- yield SpecialPowers.pushPrefEnv({"set": [
- ["security.insecure_field_warning.contextual.enabled", true],
- ["signon.autofillForms.http", false]
- ]});
- yield reinitializeForm(1);
-
- // Trigger autocomplete popup
- let shownPromise = promiseACShown();
- doKey("down"); // open
- let results = yield shownPromise;
-
- let popupState = yield getPopupState();
- is(popupState.selectedIndex, -1, "Check no entries are selected upon opening");
-
- let expectedMenuItems = ["This connection is not secure. Logins entered here could be compromised. Learn More",
- "No username (" + DATE_NOW_STRING + ")",
- "tempuser1",
- "testuser2",
- "testuser3",
- "zzzuser4"];
- checkArrayValues(results, expectedMenuItems, "Check all menuitems are displayed correctly.");
-
- doKey("down"); // select insecure warning
- checkACFormPasswordField(""); // value shouldn't update just by selecting
- doKey("return"); // not "enter"!
- yield spinEventLoop(); // let focus happen
- checkACFormPasswordField("");
-});
-
-add_task(function* test_form1_disabledInsecureFieldWarning_disabledInsecureAutoFillForm() {
- yield SpecialPowers.pushPrefEnv({"set": [
- ["security.insecure_field_warning.contextual.enabled", false],
- ["signon.autofillForms.http", false]
- ]});
- yield reinitializeForm(1);
-
- // Trigger autocomplete popup
- doKey("down"); // open
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup is closed with no AutoFillForms.");
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_passwords_in_type_password.html b/toolkit/components/passwordmgr/test/mochitest/test_passwords_in_type_password.html
deleted file mode 100644
index e107cebe6..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_passwords_in_type_password.html
+++ /dev/null
@@ -1,122 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test that passwords only get filled in type=password</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: Bug 242956
-<script>
-runChecksAfterCommonInit(() => startTest());
-</script>
-<p id="display"></p>
-<div id="content" style="display: none">
- <!-- pword is not a type=password input -->
- <form id="form1" action="formtest.js">
- <input type="text" name="uname">
- <input type="text" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- uname is not a type=text input -->
- <form id="form2" action="formtest.js">
- <input type="password" name="uname">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- two "pword" inputs, (text + password) -->
- <form id="form3" action="formtest.js">
- <input type="text" name="uname">
- <input type="text" name="pword">
- <input type="password" name="qword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- same thing, different order -->
- <form id="form4" action="formtest.js">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <input type="text" name="qword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- uname is not a type=text input (try a checkbox just for variety) -->
- <form id="form5" action="formtest.js">
- <input type="checkbox" name="uname" value="">
- <input type="password" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- pword is not a type=password input (try a checkbox just for variety) -->
- <form id="form6" action="formtest.js">
- <input type="text" name="uname">
- <input type="checkbox" name="pword" value="">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
- <!-- pword is not a type=password input -->
- <form id="form7" action="formtest.js">
- <input type="text" name="uname" value="testuser">
- <input type="text" name="pword">
-
- <button type="submit">Submit</button>
- <button type="reset"> Reset </button>
- </form>
-
-
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: 242956 (Stored password is inserted into a
- readable text input on a second page) **/
-
-// Make sure that pwmgr only puts passwords into type=password <input>s.
-// Might as well test the converse, too (username in password field).
-
-function startTest() {
- is($_(1, "uname").value, "", "Checking for unfilled username 1");
- is($_(1, "pword").value, "", "Checking for unfilled password 1");
-
- is($_(2, "uname").value, "testpass", "Checking for password not username 2");
- is($_(2, "pword").value, "", "Checking for unfilled password 2");
-
- is($_(3, "uname").value, "", "Checking for unfilled username 3");
- is($_(3, "pword").value, "testuser", "Checking for unfilled password 3");
- is($_(3, "qword").value, "testpass", "Checking for unfilled qassword 3");
-
- is($_(4, "uname").value, "testuser", "Checking for password not username 4");
- is($_(4, "pword").value, "testpass", "Checking for unfilled password 4");
- is($_(4, "qword").value, "", "Checking for unfilled qassword 4");
-
- is($_(5, "uname").value, "", "Checking for unfilled username 5");
- is($_(5, "pword").value, "testpass", "Checking for filled password 5");
-
- is($_(6, "uname").value, "", "Checking for unfilled username 6");
- is($_(6, "pword").value, "", "Checking for unfilled password 6");
-
- is($_(7, "uname").value, "testuser", "Checking for unmodified username 7");
- is($_(7, "pword").value, "", "Checking for unfilled password 7");
-
- SimpleTest.finish();
-}
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_prompt.html b/toolkit/components/passwordmgr/test/mochitest/test_prompt.html
deleted file mode 100644
index 1050ab66b..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_prompt.html
+++ /dev/null
@@ -1,705 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test prompter.{prompt,promptPassword,promptUsernameAndPassword}</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content" style="display: none">
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-var state, action;
-var uname = { value: null };
-var pword = { value: null };
-var result = { value: null };
-var isOk;
-
-// Force parent to not look for tab-modal prompts, as they're not used for auth prompts.
-isTabModal = false;
-
-let prompterParent = runInParent(() => {
- const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
- const promptFac = Cc["@mozilla.org/passwordmanager/authpromptfactory;1"].
- getService(Ci.nsIPromptFactory);
-
- Cu.import("resource://gre/modules/Services.jsm");
- let chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
- let prompter1 = promptFac.getPrompt(chromeWin, Ci.nsIAuthPrompt);
-
- addMessageListener("proxyPrompter", function onMessage(msg) {
- let rv = prompter1[msg.methodName](...msg.args);
- return {
- rv,
- // Send the args back to content so out/inout args can be checked.
- args: msg.args,
- };
- });
-});
-
-let prompter1 = new PrompterProxy(prompterParent);
-
-const defaultTitle = "the title";
-const defaultMsg = "the message";
-
-function initLogins() {
- const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
- var login1, login2A, login2B, login2C, login2D, login2E;
- var pwmgr = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
-
- login1 = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login2A = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login2B = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login2C = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login2D = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login2E = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
-
- login1.init("http://example.com", null, "http://example.com",
- "", "examplepass", "", "");
- login2A.init("http://example2.com", null, "http://example2.com",
- "user1name", "user1pass", "", "");
- login2B.init("http://example2.com", null, "http://example2.com",
- "user2name", "user2pass", "", "");
- login2C.init("http://example2.com", null, "http://example2.com",
- "user3.name@host", "user3pass", "", "");
- login2D.init("http://example2.com", null, "http://example2.com",
- "100@beef", "user3pass", "", "");
- login2E.init("http://example2.com", null, "http://example2.com",
- "100%beef", "user3pass", "", "");
-
- pwmgr.addLogin(login1);
- pwmgr.addLogin(login2A);
- pwmgr.addLogin(login2B);
- pwmgr.addLogin(login2C);
- pwmgr.addLogin(login2D);
- pwmgr.addLogin(login2E);
-}
-
-add_task(function* setup() {
- runInParent(initLogins);
-});
-
-add_task(function* test_prompt_accept() {
- state = {
- msg : "the message",
- title : "the title",
- textValue : "abc",
- passValue : "",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : true,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- textField : "xyz",
- };
- promptDone = handlePrompt(state, action);
- isOk = prompter1.prompt(defaultTitle, defaultMsg, "http://example.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, "abc", result);
- yield promptDone;
-
- ok(isOk, "Checking dialog return value (accept)");
- is(result.value, "xyz", "Checking prompt() returned value");
-});
-
-add_task(function* test_prompt_cancel() {
- state = {
- msg : "the message",
- title : "the title",
- textValue : "abc",
- passValue : "",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : true,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "cancel",
- };
- promptDone = handlePrompt(state, action);
- isOk = prompter1.prompt(defaultTitle, defaultMsg, "http://example.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, "abc", result);
- yield promptDone;
- ok(!isOk, "Checking dialog return value (cancel)");
-});
-
-add_task(function* test_promptPassword_defaultAccept() {
- // Default password provided, existing logins are ignored.
- state = {
- msg : "the message",
- title : "the title",
- textValue : "",
- passValue : "inputpw",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "passField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- passField : "secret",
- };
- pword.value = "inputpw";
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://example.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- is(pword.value, "secret", "Checking returned password");
-});
-
-add_task(function* test_promptPassword_defaultCancel() {
- // Default password provided, existing logins are ignored.
- state = {
- msg : "the message",
- title : "the title",
- textValue : "",
- passValue : "inputpw",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "passField",
- defButton : "button0",
- };
- action = {
- buttonClick : "cancel",
- };
- pword.value = "inputpw";
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://example.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
- yield promptDone;
- ok(!isOk, "Checking dialog return value (cancel)");
-});
-
-add_task(function* test_promptPassword_emptyAccept() {
- // No default password provided, realm does not match existing login.
- state = {
- msg : "the message",
- title : "the title",
- textValue : "",
- passValue : "",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "passField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- passField : "secret",
- };
- pword.value = null;
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://nonexample.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- is(pword.value, "secret", "Checking returned password");
-});
-
-add_task(function* test_promptPassword_saved() {
- // No default password provided, matching login is returned w/o prompting.
- pword.value = null;
- isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://example.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
- ok(isOk, "Checking dialog return value (accept)");
- is(pword.value, "examplepass", "Checking returned password");
-});
-
-add_task(function* test_promptPassword_noMatchingPasswordForEmptyUN() {
- // No default password provided, none of the logins from this host are
- // password-only so the user is prompted.
- state = {
- msg : "the message",
- title : "the title",
- textValue : "",
- passValue : "",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "passField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- passField : "secret",
- };
- pword.value = null;
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://example2.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- is(pword.value, "secret", "Checking returned password");
-});
-
-add_task(function* test_promptPassword_matchingPWForUN() {
- // No default password provided, matching login is returned w/o prompting.
- pword.value = null;
- isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://user1name@example2.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
- ok(isOk, "Checking dialog return value (accept)");
- is(pword.value, "user1pass", "Checking returned password");
-});
-
-add_task(function* test_promptPassword_matchingPWForUN2() {
- // No default password provided, matching login is returned w/o prompting.
- pword.value = null;
- isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://user2name@example2.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
- ok(isOk, "Checking dialog return value (accept)");
- is(pword.value, "user2pass", "Checking returned password");
-});
-
-add_task(function* test_promptPassword_matchingPWForUN3() {
- // No default password provided, matching login is returned w/o prompting.
- pword.value = null;
- isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://user3%2Ename%40host@example2.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
- ok(isOk, "Checking dialog return value (accept)");
- is(pword.value, "user3pass", "Checking returned password");
-});
-
-add_task(function* test_promptPassword_extraAt() {
- // No default password provided, matching login is returned w/o prompting.
- pword.value = null;
- isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://100@beef@example2.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
- ok(isOk, "Checking dialog return value (accept)");
- is(pword.value, "user3pass", "Checking returned password");
-});
-
-add_task(function* test_promptPassword_usernameEncoding() {
- // No default password provided, matching login is returned w/o prompting.
- pword.value = null;
- isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "http://100%25beef@example2.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
- ok(isOk, "Checking dialog return value (accept)");
- is(pword.value, "user3pass", "Checking returned password");
-
- // XXX test saving a password with Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY
-});
-
-add_task(function* test_promptPassword_realm() {
- // We don't pre-fill or save for NS_GetAuthKey-generated realms, but we should still prompt
- state = {
- msg : "the message",
- title : "the title",
- textValue : "",
- passValue : "",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "passField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- passField : "fill2pass",
- };
- pword.value = null;
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "example2.com:80 (somerealm)",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- is(pword.value, "fill2pass", "Checking returned password");
-});
-
-add_task(function* test_promptPassword_realm2() {
- // We don't pre-fill or save for NS_GetAuthKey-generated realms, but we should still prompt
- state = {
- msg : "the message",
- title : "the title",
- textValue : "",
- passValue : "",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "passField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- passField : "fill2pass",
- };
- pword.value = null;
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptPassword(defaultTitle, defaultMsg, "example2.com:80 (somerealm)",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- is(pword.value, "fill2pass", "Checking returned password");
-});
-
-add_task(function* test_promptUsernameAndPassword_accept() {
- state = {
- msg : "the message",
- title : "the title",
- textValue : "inuser",
- passValue : "inpass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- textField : "outuser",
- passField : "outpass",
- };
- uname.value = "inuser";
- pword.value = "inpass";
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://nonexample.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, uname, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- is(uname.value, "outuser", "Checking returned username");
- is(pword.value, "outpass", "Checking returned password");
-});
-
-add_task(function* test_promptUsernameAndPassword_cancel() {
- state = {
- msg : "the message",
- title : "the title",
- textValue : "inuser",
- passValue : "inpass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "cancel",
- };
- uname.value = "inuser";
- pword.value = "inpass";
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://nonexample.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, uname, pword);
- yield promptDone;
- ok(!isOk, "Checking dialog return value (cancel)");
-});
-
-add_task(function* test_promptUsernameAndPassword_autofill() {
- // test filling in existing password-only login
- state = {
- msg : "the message",
- title : "the title",
- textValue : "",
- passValue : "examplepass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : false,
- checkMsg : "Use Password Manager to remember this password.",
- checked : true,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- };
- uname.value = null;
- pword.value = null;
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- is(uname.value, "", "Checking returned username");
- is(pword.value, "examplepass", "Checking returned password");
-});
-
-add_task(function* test_promptUsernameAndPassword_multipleExisting() {
- // test filling in existing login (undetermined from multiple selection)
- // user2name/user2pass would also be valid to fill here.
- state = {
- msg : "the message",
- title : "the title",
- textValue : "user1name",
- passValue : "user1pass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : false,
- checkMsg : "Use Password Manager to remember this password.",
- checked : true,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- };
- uname.value = null;
- pword.value = null;
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example2.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- ok(uname.value == "user1name" || uname.value == "user2name", "Checking returned username");
- ok(pword.value == "user1pass" || uname.value == "user2pass", "Checking returned password");
-});
-
-add_task(function* test_promptUsernameAndPassword_multipleExisting1() {
- // test filling in existing login (user1 from multiple selection)
- state = {
- msg : "the message",
- title : "the title",
- textValue : "user1name",
- passValue : "user1pass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : false,
- checkMsg : "Use Password Manager to remember this password.",
- checked : true,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- };
- uname.value = "user1name";
- pword.value = null;
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example2.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- is(uname.value, "user1name", "Checking returned username");
- is(pword.value, "user1pass", "Checking returned password");
-});
-
-add_task(function* test_promptUsernameAndPassword_multipleExisting2() {
- // test filling in existing login (user2 from multiple selection)
- state = {
- msg : "the message",
- title : "the title",
- textValue : "user2name",
- passValue : "user2pass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : false,
- checkMsg : "Use Password Manager to remember this password.",
- checked : true,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- };
- uname.value = "user2name";
- pword.value = null;
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example2.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- is(uname.value, "user2name", "Checking returned username");
- is(pword.value, "user2pass", "Checking returned password");
-});
-
-add_task(function* test_promptUsernameAndPassword_passwordChange() {
- // test changing password
- state = {
- msg : "the message",
- title : "the title",
- textValue : "user2name",
- passValue : "user2pass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : false,
- checkMsg : "Use Password Manager to remember this password.",
- checked : true,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- passField : "NEWuser2pass",
- };
- uname.value = "user2name";
- pword.value = null;
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example2.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- is(uname.value, "user2name", "Checking returned username");
- is(pword.value, "NEWuser2pass", "Checking returned password");
-});
-
-add_task(function* test_promptUsernameAndPassword_changePasswordBack() {
- // test changing password (back to original value)
- state = {
- msg : "the message",
- title : "the title",
- textValue : "user2name",
- passValue : "NEWuser2pass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : false,
- checkMsg : "Use Password Manager to remember this password.",
- checked : true,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- passField : "user2pass",
- };
- uname.value = "user2name";
- pword.value = null;
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "http://example2.com",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- is(uname.value, "user2name", "Checking returned username");
- is(pword.value, "user2pass", "Checking returned password");
-});
-
-add_task(function* test_promptUsernameAndPassword_realm() {
- // We don't pre-fill or save for NS_GetAuthKey-generated realms, but we should still prompt
- state = {
- msg : "the message",
- title : "the title",
- textValue : "",
- passValue : "",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- textField : "fill2user",
- passField : "fill2pass",
- };
- uname.value = null;
- pword.value = null;
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "example2.com:80 (somerealm)",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_NEVER, uname, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- is(uname.value, "fill2user", "Checking returned username");
- is(pword.value, "fill2pass", "Checking returned password");
-});
-
-add_task(function* test_promptUsernameAndPassword_realm2() {
- // We don't pre-fill or save for NS_GetAuthKey-generated realms, but we should still prompt
- state = {
- msg : "the message",
- title : "the title",
- textValue : "",
- passValue : "",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- textField : "fill2user",
- passField : "fill2pass",
- };
- uname.value = null;
- pword.value = null;
- promptDone = handlePrompt(state, action);
- isOk = prompter1.promptUsernameAndPassword(defaultTitle, defaultMsg, "example2.com:80 (somerealm)",
- Ci.nsIAuthPrompt.SAVE_PASSWORD_PERMANENTLY, uname, pword);
- yield promptDone;
- ok(isOk, "Checking dialog return value (accept)");
- is(uname.value, "fill2user", "Checking returned username");
- is(pword.value, "fill2pass", "Checking returned password");
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_prompt_http.html b/toolkit/components/passwordmgr/test/mochitest/test_prompt_http.html
deleted file mode 100644
index 0dc8fdf9c..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_prompt_http.html
+++ /dev/null
@@ -1,362 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test HTTP auth prompts by loading authenticate.sjs</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content" style="display: none">
- <iframe id="iframe"></iframe>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-var iframe = document.getElementById("iframe");
-
-// Force parent to not look for tab-modal prompts, as they're not used for auth prompts.
-isTabModal = false;
-
-const AUTHENTICATE_PATH = new URL("authenticate.sjs", window.location.href).pathname;
-
-let chromeScript = runInParent(SimpleTest.getTestFileURL("pwmgr_common.js"));
-
-runInParent(() => {
- const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
- Cu.import("resource://gre/modules/Services.jsm");
-
- let pwmgr = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
-
- let login3A, login3B, login4;
- login3A = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login3B = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login4 = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- let httpUpgradeLogin = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- let httpsDowngradeLogin = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- let dedupeHttpUpgradeLogin = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- let dedupeHttpsUpgradeLogin = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
-
-
- login3A.init("http://mochi.test:8888", null, "mochitest",
- "mochiuser1", "mochipass1", "", "");
- login3B.init("http://mochi.test:8888", null, "mochitest2",
- "mochiuser2", "mochipass2", "", "");
- login4.init("http://mochi.test:8888", null, "mochitest3",
- "mochiuser3", "mochipass3-old", "", "");
- // Logins to test scheme upgrades (allowed) and downgrades (disallowed)
- httpUpgradeLogin.init("http://example.com", null, "schemeUpgrade",
- "httpUser", "httpPass", "", "");
- httpsDowngradeLogin.init("https://example.com", null, "schemeDowngrade",
- "httpsUser", "httpsPass", "", "");
- // HTTP and HTTPS version of the same domain and realm but with different passwords.
- dedupeHttpUpgradeLogin.init("http://example.org", null, "schemeUpgradeDedupe",
- "dedupeUser", "httpPass", "", "");
- dedupeHttpsUpgradeLogin.init("https://example.org", null, "schemeUpgradeDedupe",
- "dedupeUser", "httpsPass", "", "");
-
-
- pwmgr.addLogin(login3A);
- pwmgr.addLogin(login3B);
- pwmgr.addLogin(login4);
- pwmgr.addLogin(httpUpgradeLogin);
- pwmgr.addLogin(httpsDowngradeLogin);
- pwmgr.addLogin(dedupeHttpUpgradeLogin);
- pwmgr.addLogin(dedupeHttpsUpgradeLogin);
-});
-
-add_task(function* test_iframe() {
- let state = {
- msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitestâ€",
- title : "Authentication Required",
- textValue : "mochiuser1",
- passValue : "mochipass1",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- let action = {
- buttonClick : "ok",
- };
- promptDone = handlePrompt(state, action);
-
- // The following tests are driven by iframe loads
-
- var iframeLoaded = onloadPromiseFor("iframe");
- iframe.src = "authenticate.sjs?user=mochiuser1&pass=mochipass1";
- yield promptDone;
- yield iframeLoaded;
- checkEchoedAuthInfo({user: "mochiuser1", pass: "mochipass1"},
- iframe.contentDocument);
-
- state = {
- msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest2â€",
- title : "Authentication Required",
- textValue : "mochiuser2",
- passValue : "mochipass2",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- };
- promptDone = handlePrompt(state, action);
- // We've already authenticated to this host:port. For this next
- // request, the existing auth should be sent, we'll get a 401 reply,
- // and we should prompt for new auth.
- iframeLoaded = onloadPromiseFor("iframe");
- iframe.src = "authenticate.sjs?user=mochiuser2&pass=mochipass2&realm=mochitest2";
- yield promptDone;
- yield iframeLoaded;
- checkEchoedAuthInfo({user: "mochiuser2", pass: "mochipass2"},
- iframe.contentDocument);
-
- // Now make a load that requests the realm from test 1000. It was
- // already provided there, so auth will *not* be prompted for -- the
- // networking layer already knows it!
- iframeLoaded = onloadPromiseFor("iframe");
- iframe.src = "authenticate.sjs?user=mochiuser1&pass=mochipass1";
- yield iframeLoaded;
- checkEchoedAuthInfo({user: "mochiuser1", pass: "mochipass1"},
- iframe.contentDocument);
-
- // Same realm we've already authenticated to, but with a different
- // expected password (to trigger an auth prompt, and change-password
- // popup notification).
- state = {
- msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitestâ€",
- title : "Authentication Required",
- textValue : "mochiuser1",
- passValue : "mochipass1",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- passField : "mochipass1-new",
- };
- promptDone = handlePrompt(state, action);
- iframeLoaded = onloadPromiseFor("iframe");
- let promptShownPromise = promisePromptShown("passwordmgr-prompt-change");
- iframe.src = "authenticate.sjs?user=mochiuser1&pass=mochipass1-new";
- yield promptDone;
- yield iframeLoaded;
- checkEchoedAuthInfo({user: "mochiuser1", pass: "mochipass1-new"},
- iframe.contentDocument);
- yield promptShownPromise;
-
- // Same as last test, but for a realm we haven't already authenticated
- // to (but have an existing saved login for, so that we'll trigger
- // a change-password popup notification.
- state = {
- msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest3â€",
- title : "Authentication Required",
- textValue : "mochiuser3",
- passValue : "mochipass3-old",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- passField : "mochipass3-new",
- };
- promptDone = handlePrompt(state, action);
- iframeLoaded = onloadPromiseFor("iframe");
- promptShownPromise = promisePromptShown("passwordmgr-prompt-change");
- iframe.src = "authenticate.sjs?user=mochiuser3&pass=mochipass3-new&realm=mochitest3";
- yield promptDone;
- yield iframeLoaded;
- checkEchoedAuthInfo({user: "mochiuser3", pass: "mochipass3-new"},
- iframe.contentDocument);
- yield promptShownPromise;
-
- // Housekeeping: Delete login4 to test the save prompt in the next test.
- runInParent(() => {
- const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
- Cu.import("resource://gre/modules/Services.jsm");
-
- var tmpLogin = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- tmpLogin.init("http://mochi.test:8888", null, "mochitest3",
- "mochiuser3", "mochipass3-old", "", "");
- Services.logins.removeLogin(tmpLogin);
-
- // Clear cached auth from this subtest, and avoid leaking due to bug 459620.
- var authMgr = Cc['@mozilla.org/network/http-auth-manager;1'].
- getService(Ci.nsIHttpAuthManager);
- authMgr.clearAll();
- });
-
- state = {
- msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitest3â€",
- title : "Authentication Required",
- textValue : "",
- passValue : "",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- textField : "mochiuser3",
- passField : "mochipass3-old",
- };
- // Trigger a new prompt, so we can test adding a new login.
- promptDone = handlePrompt(state, action);
-
- iframeLoaded = onloadPromiseFor("iframe");
- promptShownPromise = promisePromptShown("passwordmgr-prompt-save");
- iframe.src = "authenticate.sjs?user=mochiuser3&pass=mochipass3-old&realm=mochitest3";
- yield promptDone;
- yield iframeLoaded;
- checkEchoedAuthInfo({user: "mochiuser3", pass: "mochipass3-old"},
- iframe.contentDocument);
- yield promptShownPromise;
-});
-
-add_task(function* test_schemeUpgrade() {
- let state = {
- msg : "https://example.com is requesting your username and password. " +
- "WARNING: Your password will not be sent to the website you are currently visiting!",
- title : "Authentication Required",
- textValue : "httpUser",
- passValue : "httpPass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- let action = {
- buttonClick : "ok",
- };
- let promptDone = handlePrompt(state, action);
-
- // The following tests are driven by iframe loads
-
- let iframeLoaded = onloadPromiseFor("iframe");
- iframe.src = "https://example.com" + AUTHENTICATE_PATH +
- "?user=httpUser&pass=httpPass&realm=schemeUpgrade";
- yield promptDone;
- yield iframeLoaded;
- checkEchoedAuthInfo({user: "httpUser", pass: "httpPass"},
- SpecialPowers.wrap(iframe).contentDocument);
-});
-
-add_task(function* test_schemeDowngrade() {
- let state = {
- msg : "http://example.com is requesting your username and password. " +
- "WARNING: Your password will not be sent to the website you are currently visiting!",
- title : "Authentication Required",
- textValue : "", // empty because we shouldn't downgrade
- passValue : "",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- let action = {
- buttonClick : "cancel",
- };
- let promptDone = handlePrompt(state, action);
-
- // The following tests are driven by iframe loads
-
- let iframeLoaded = onloadPromiseFor("iframe");
- iframe.src = "http://example.com" + AUTHENTICATE_PATH +
- "?user=unused&pass=unused&realm=schemeDowngrade";
- yield promptDone;
- yield iframeLoaded;
-});
-
-add_task(function* test_schemeUpgrade_dedupe() {
- let state = {
- msg : "https://example.org is requesting your username and password. " +
- "WARNING: Your password will not be sent to the website you are currently visiting!",
- title : "Authentication Required",
- textValue : "dedupeUser",
- passValue : "httpsPass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- let action = {
- buttonClick : "ok",
- };
- let promptDone = handlePrompt(state, action);
-
- // The following tests are driven by iframe loads
-
- let iframeLoaded = onloadPromiseFor("iframe");
- iframe.src = "https://example.org" + AUTHENTICATE_PATH +
- "?user=dedupeUser&pass=httpsPass&realm=schemeUpgradeDedupe";
- yield promptDone;
- yield iframeLoaded;
- checkEchoedAuthInfo({user: "dedupeUser", pass: "httpsPass"},
- SpecialPowers.wrap(iframe).contentDocument);
-});
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_prompt_noWindow.html b/toolkit/components/passwordmgr/test/mochitest/test_prompt_noWindow.html
deleted file mode 100644
index 92af172ca..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_prompt_noWindow.html
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test HTTP auth prompts by loading authenticate.sjs with no window</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content" style="display: none">
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-// Force parent to not look for tab-modal prompts, as they're not used for auth prompts.
-isTabModal = false;
-
-let chromeScript = runInParent(SimpleTest.getTestFileURL("pwmgr_common.js"));
-
-runInParent(() => {
- const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
- Cu.import("resource://gre/modules/Services.jsm");
-
- let login = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login.init("http://mochi.test:8888", null, "mochitest",
- "mochiuser1", "mochipass1", "", "");
- Services.logins.addLogin(login);
-});
-
-add_task(function* test_sandbox_xhr() {
- let state = {
- msg : "http://mochi.test:8888 is requesting your username and password. The site says: “mochitestâ€",
- title : "Authentication Required",
- textValue : "mochiuser1",
- passValue : "mochipass1",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- let action = {
- buttonClick : "ok",
- };
- let promptDone = handlePrompt(state, action);
-
- let url = new URL("authenticate.sjs?user=mochiuser1&pass=mochipass1", window.location.href);
- let sandboxConstructor = SpecialPowers.Cu.Sandbox;
- let sandbox = new sandboxConstructor(this, {wantXrays: true});
- function sandboxedRequest(sandboxedUrl) {
- let req = SpecialPowers.Cc["@mozilla.org/xmlextras/xmlhttprequest;1"]
- .createInstance(SpecialPowers.Ci.nsIXMLHttpRequest);
- req.open("GET", sandboxedUrl, true);
- req.send(null);
- }
-
- let loginModifiedPromise = promiseStorageChanged(["modifyLogin"]);
- sandbox.sandboxedRequest = sandboxedRequest(url);
- info("send the XHR request in the sandbox");
- SpecialPowers.Cu.evalInSandbox("sandboxedRequest;", sandbox);
-
- yield promptDone;
- info("prompt shown, waiting for metadata updates");
- // Ensure the timeLastUsed and timesUsed metadata are updated.
- yield loginModifiedPromise;
-});
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_prompt_promptAuth.html b/toolkit/components/passwordmgr/test/mochitest/test_prompt_promptAuth.html
deleted file mode 100644
index 36f53a54a..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_prompt_promptAuth.html
+++ /dev/null
@@ -1,406 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test promptAuth prompts</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content" style="display: none">
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-var state, action;
-var isOk;
-
-var level = Ci.nsIAuthPrompt2.LEVEL_NONE;
-var authinfo = {
- username : "",
- password : "",
- domain : "",
-
- flags : Ci.nsIAuthInformation.AUTH_HOST,
- authenticationScheme : "basic",
- realm : ""
-};
-
-// Force parent to not look for tab-modal prompts, as they're not used for auth prompts.
-isTabModal = false;
-
-let chromeScript = runInParent(SimpleTest.getTestFileURL("pwmgr_common.js"));
-
-let prompterParent = runInParent(() => {
- const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
- const promptFac = Cc["@mozilla.org/passwordmanager/authpromptfactory;1"].
- getService(Ci.nsIPromptFactory);
-
- Cu.import("resource://gre/modules/Services.jsm");
- let chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
- let prompter2 = promptFac.getPrompt(chromeWin, Ci.nsIAuthPrompt2);
-
- let ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
- let channels = {};
- channels.channel1 = ioService.newChannel2("http://example.com",
- null,
- null,
- null, // aLoadingNode
- Services.
- scriptSecurityManager.getSystemPrincipal(),
- null, // aTriggeringPrincipal
- Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
- Ci.nsIContentPolicy.TYPE_OTHER);
-
- channels.channel2 = ioService.newChannel2("http://example2.com",
- null,
- null,
- null, // aLoadingNode
- Services.
- scriptSecurityManager.getSystemPrincipal(),
- null, // aTriggeringPrincipal
- Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
- Ci.nsIContentPolicy.TYPE_OTHER);
-
- addMessageListener("proxyPrompter", function onMessage(msg) {
- let args = [...msg.args];
- let channelName = args.shift();
- // Replace the channel name string (arg. 0) with the channel by that name.
- args.unshift(channels[channelName]);
-
- let rv = prompter2[msg.methodName](...args);
- return {
- rv,
- // Send the args back to content so out/inout args can be checked.
- args: msg.args,
- };
- });
-
- Cu.import("resource://gre/modules/Services.jsm");
-
- let pwmgr = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
-
- let login1, login2A, login2B, login2C, login2D, login2E;
- login1 = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login2A = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login2B = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login2C = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login2D = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login2E = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
-
- login1.init("http://example.com", null, "http://example.com",
- "", "examplepass", "", "");
- login2A.init("http://example2.com", null, "http://example2.com",
- "user1name", "user1pass", "", "");
- login2B.init("http://example2.com", null, "http://example2.com",
- "user2name", "user2pass", "", "");
- login2C.init("http://example2.com", null, "http://example2.com",
- "user3.name@host", "user3pass", "", "");
- login2D.init("http://example2.com", null, "http://example2.com",
- "100@beef", "user3pass", "", "");
- login2E.init("http://example2.com", null, "http://example2.com",
- "100%beef", "user3pass", "", "");
-
- pwmgr.addLogin(login1);
- pwmgr.addLogin(login2A);
- pwmgr.addLogin(login2B);
- pwmgr.addLogin(login2C);
- pwmgr.addLogin(login2D);
- pwmgr.addLogin(login2E);
-});
-
-let prompter2 = new PrompterProxy(prompterParent);
-
-add_task(function* test_accept() {
- state = {
- msg : "http://example.com is requesting your username and password. The site says: “some realmâ€",
- title : "Authentication Required",
- textValue : "inuser",
- passValue : "inpass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- textField : "outuser",
- passField : "outpass",
- };
- authinfo.username = "inuser";
- authinfo.password = "inpass";
- authinfo.realm = "some realm";
-
- promptDone = handlePrompt(state, action);
- // Since prompter2 is actually a proxy to send a message to a chrome script and
- // we can't send a channel in a message, we instead send the channel name that
- // already exists in the chromeScript.
- isOk = prompter2.promptAuth("channel1", level, authinfo);
- yield promptDone;
-
- ok(isOk, "Checking dialog return value (accept)");
- is(authinfo.username, "outuser", "Checking returned username");
- is(authinfo.password, "outpass", "Checking returned password");
-});
-
-add_task(function* test_cancel() {
- state = {
- msg : "http://example.com is requesting your username and password. The site says: “some realmâ€",
- title : "Authentication Required",
- textValue : "outuser",
- passValue : "outpass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "cancel",
- };
- promptDone = handlePrompt(state, action);
- isOk = prompter2.promptAuth("channel1", level, authinfo);
- yield promptDone;
-
- ok(!isOk, "Checking dialog return value (cancel)");
-});
-
-add_task(function* test_pwonly() {
- // test filling in password-only login
- state = {
- msg : "http://example.com is requesting your username and password. The site says: “http://example.comâ€",
- title : "Authentication Required",
- textValue : "",
- passValue : "examplepass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- };
- authinfo.username = "";
- authinfo.password = "";
- authinfo.realm = "http://example.com";
-
- promptDone = handlePrompt(state, action);
- isOk = prompter2.promptAuth("channel1", level, authinfo);
- yield promptDone;
-
- ok(isOk, "Checking dialog return value (accept)");
- is(authinfo.username, "", "Checking returned username");
- is(authinfo.password, "examplepass", "Checking returned password");
-});
-
-add_task(function* test_multipleExisting() {
- // test filling in existing login (undetermined from multiple selection)
- // user2name/user2pass would also be valid to fill here.
- state = {
- msg : "http://example2.com is requesting your username and password. The site says: “http://example2.comâ€",
- title : "Authentication Required",
- textValue : "user1name",
- passValue : "user1pass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- };
- authinfo.username = "";
- authinfo.password = "";
- authinfo.realm = "http://example2.com";
-
- promptDone = handlePrompt(state, action);
- isOk = prompter2.promptAuth("channel2", level, authinfo);
- yield promptDone;
-
- ok(isOk, "Checking dialog return value (accept)");
- ok(authinfo.username == "user1name" || authinfo.username == "user2name", "Checking returned username");
- ok(authinfo.password == "user1pass" || authinfo.password == "user2pass", "Checking returned password");
-});
-
-add_task(function* test_multipleExisting2() {
- // test filling in existing login (undetermined --> user1)
- // user2name/user2pass would also be valid to fill here.
- state = {
- msg : "http://example2.com is requesting your username and password. The site says: “http://example2.comâ€",
- title : "Authentication Required",
- textValue : "user1name",
- passValue : "user1pass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- // enter one of the known logins, test 504+505 exercise the two possible states.
- action = {
- buttonClick : "ok",
- textField : "user1name",
- passField : "user1pass",
- };
- authinfo.username = "";
- authinfo.password = "";
- authinfo.realm = "http://example2.com";
-
- promptDone = handlePrompt(state, action);
- isOk = prompter2.promptAuth("channel2", level, authinfo);
- yield promptDone;
-
- ok(isOk, "Checking dialog return value (accept)");
- is(authinfo.username, "user1name", "Checking returned username");
- is(authinfo.password, "user1pass", "Checking returned password");
-});
-
-add_task(function* test_multipleExisting3() {
- // test filling in existing login (undetermined --> user2)
- // user2name/user2pass would also be valid to fill here.
- state = {
- msg : "http://example2.com is requesting your username and password. The site says: “http://example2.comâ€",
- title : "Authentication Required",
- textValue : "user1name",
- passValue : "user1pass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- // enter one of the known logins, test 504+505 exercise the two possible states.
- action = {
- buttonClick : "ok",
- textField : "user2name",
- passField : "user2pass",
- };
- authinfo.username = "";
- authinfo.password = "";
- authinfo.realm = "http://example2.com";
-
- promptDone = handlePrompt(state, action);
- isOk = prompter2.promptAuth("channel2", level, authinfo);
- yield promptDone;
-
- ok(isOk, "Checking dialog return value (accept)");
- is(authinfo.username, "user2name", "Checking returned username");
- is(authinfo.password, "user2pass", "Checking returned password");
-});
-
-add_task(function* test_changingMultiple() {
- // test changing a password (undetermined --> user2 w/ newpass)
- // user2name/user2pass would also be valid to fill here.
- state = {
- msg : "http://example2.com is requesting your username and password. The site says: “http://example2.comâ€",
- title : "Authentication Required",
- textValue : "user1name",
- passValue : "user1pass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- // force to user2, and change the password
- action = {
- buttonClick : "ok",
- textField : "user2name",
- passField : "NEWuser2pass",
- };
- authinfo.username = "";
- authinfo.password = "";
- authinfo.realm = "http://example2.com";
-
- promptDone = handlePrompt(state, action);
- isOk = prompter2.promptAuth("channel2", level, authinfo);
- yield promptDone;
-
- ok(isOk, "Checking dialog return value (accept)");
- is(authinfo.username, "user2name", "Checking returned username");
- is(authinfo.password, "NEWuser2pass", "Checking returned password");
-});
-
-add_task(function* test_changingMultiple2() {
- // test changing a password (undetermined --> user2 w/ origpass)
- // user2name/user2pass would also be valid to fill here.
- state = {
- msg : "http://example2.com is requesting your username and password. The site says: “http://example2.comâ€",
- title : "Authentication Required",
- textValue : "user1name",
- passValue : "user1pass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- // force to user2, and change the password back
- action = {
- buttonClick : "ok",
- textField : "user2name",
- passField : "user2pass",
- };
- authinfo.username = "";
- authinfo.password = "";
- authinfo.realm = "http://example2.com";
-
- promptDone = handlePrompt(state, action);
- isOk = prompter2.promptAuth("channel2", level, authinfo);
- yield promptDone;
-
- ok(isOk, "Checking dialog return value (accept)");
- is(authinfo.username, "user2name", "Checking returned username");
- is(authinfo.password, "user2pass", "Checking returned password");
-});
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_prompt_promptAuth_proxy.html b/toolkit/components/passwordmgr/test/mochitest/test_prompt_promptAuth_proxy.html
deleted file mode 100644
index 95dd4c7bc..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_prompt_promptAuth_proxy.html
+++ /dev/null
@@ -1,264 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test promptAuth proxy prompts</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content" style="display: none">
- <iframe id="iframe"></iframe>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-var state, action;
-var pwmgr;
-var proxyLogin;
-var isOk;
-var mozproxy, proxiedHost = "http://mochi.test:8888";
-var proxyChannel;
-var systemPrincipal = SpecialPowers.Services.scriptSecurityManager.getSystemPrincipal();
-var ioService = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
-
-var prefs = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
-
-var level = Ci.nsIAuthPrompt2.LEVEL_NONE;
-
-var proxyAuthinfo = {
- username : "",
- password : "",
- domain : "",
-
- flags : Ci.nsIAuthInformation.AUTH_PROXY,
- authenticationScheme : "basic",
- realm : ""
-};
-
-// Force parent to not look for tab-modal prompts, as they're not used for auth prompts.
-isTabModal = false;
-
-const Cc_promptFac = Cc["@mozilla.org/passwordmanager/authpromptfactory;1"];
-ok(Cc_promptFac != null, "Access Cc[@mozilla.org/passwordmanager/authpromptfactory;1]");
-
-const Ci_promptFac = Ci.nsIPromptFactory;
-ok(Ci_promptFac != null, "Access Ci.nsIPromptFactory");
-
-const promptFac = Cc_promptFac.getService(Ci_promptFac);
-ok(promptFac != null, "promptFac getService()");
-
-var prompter2 = promptFac.getPrompt(window, Ci.nsIAuthPrompt2);
-
-function initLogins(pi) {
- pwmgr = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
-
- mozproxy = "moz-proxy://" + SpecialPowers.wrap(pi).host + ":" +
- SpecialPowers.wrap(pi).port;
-
- proxyLogin = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
-
- proxyLogin.init(mozproxy, null, "Proxy Realm",
- "proxuser", "proxpass", "", "");
-
- pwmgr.addLogin(proxyLogin);
-}
-
-var startupCompleteResolver;
-var startupComplete = new Promise(resolve => startupCompleteResolver = resolve);
-
-function proxyChannelListener() { }
-proxyChannelListener.prototype = {
- onStartRequest: function(request, context) {
- startupCompleteResolver();
- },
- onStopRequest: function(request, context, status) { }
-};
-
-var resolveCallback = SpecialPowers.wrapCallbackObject({
- QueryInterface : function (iid) {
- const interfaces = [Ci.nsIProtocolProxyCallback, Ci.nsISupports];
-
- if (!interfaces.some( function(v) { return iid.equals(v); } ))
- throw SpecialPowers.Cr.NS_ERROR_NO_INTERFACE;
- return this;
- },
-
- onProxyAvailable : function (req, uri, pi, status) {
- initLogins(pi);
-
- // I'm cheating a bit here... We should probably do some magic foo to get
- // something implementing nsIProxiedProtocolHandler and then call
- // NewProxiedChannel(), so we have something that's definately a proxied
- // channel. But Mochitests use a proxy for a number of hosts, so just
- // requesting a normal channel will give us a channel that's proxied.
- // The proxyChannel needs to move to at least on-modify-request to
- // have valid ProxyInfo, but we use OnStartRequest during startup()
- // for simplicity.
- proxyChannel = ioService.newChannel2(proxiedHost,
- null,
- null,
- null, // aLoadingNode
- systemPrincipal,
- null, // aTriggeringPrincipal
- Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
- Ci.nsIContentPolicy.TYPE_OTHER);
- proxyChannel.asyncOpen2(SpecialPowers.wrapCallbackObject(new proxyChannelListener()));
- }
-});
-
-function startup() {
- // Need to allow for arbitrary network servers defined in PAC instead of a hardcoded moz-proxy.
- var ios = SpecialPowers.Cc["@mozilla.org/network/io-service;1"].
- getService(SpecialPowers.Ci.nsIIOService);
-
- var pps = SpecialPowers.Cc["@mozilla.org/network/protocol-proxy-service;1"].getService();
-
- var channel = ios.newChannel2("http://example.com",
- null,
- null,
- null, // aLoadingNode
- systemPrincipal,
- null, // aTriggeringPrincipal
- Ci.nsILoadInfo.SEC_ALLOW_CROSS_ORIGIN_DATA_IS_NULL,
- Ci.nsIContentPolicy.TYPE_OTHER);
- pps.asyncResolve(channel, 0, resolveCallback);
-}
-
-startup();
-
-add_task(function* setup() {
- info("Waiting for startup to complete...");
- yield startupComplete;
-});
-
-add_task(function* test_noAutologin() {
- // test proxy login (default = no autologin), make sure it prompts.
- state = {
- msg : "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password. The site says: “Proxy Realmâ€",
- title : "Authentication Required",
- textValue : "proxuser",
- passValue : "proxpass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- };
- proxyAuthinfo.username = "";
- proxyAuthinfo.password = "";
- proxyAuthinfo.realm = "Proxy Realm";
- proxyAuthinfo.flags = Ci.nsIAuthInformation.AUTH_PROXY;
-
- var time1 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
- promptDone = handlePrompt(state, action);
- isOk = prompter2.promptAuth(proxyChannel, level, proxyAuthinfo);
- yield promptDone;
- var time2 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
-
- ok(isOk, "Checking dialog return value (accept)");
- isnot(time1, time2, "Checking that timeLastUsed was updated");
- is(proxyAuthinfo.username, "proxuser", "Checking returned username");
- is(proxyAuthinfo.password, "proxpass", "Checking returned password");
-});
-
-add_task(function* test_autologin() {
- // test proxy login (with autologin)
-
- // Enable the autologin pref.
- prefs.setBoolPref("signon.autologin.proxy", true);
-
- proxyAuthinfo.username = "";
- proxyAuthinfo.password = "";
- proxyAuthinfo.realm = "Proxy Realm";
- proxyAuthinfo.flags = Ci.nsIAuthInformation.AUTH_PROXY;
-
- time1 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
- isOk = prompter2.promptAuth(proxyChannel, level, proxyAuthinfo);
- time2 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
-
- ok(isOk, "Checking dialog return value (accept)");
- isnot(time1, time2, "Checking that timeLastUsed was updated");
- is(proxyAuthinfo.username, "proxuser", "Checking returned username");
- is(proxyAuthinfo.password, "proxpass", "Checking returned password");
-});
-
-add_task(function* test_autologin_incorrect() {
- // test proxy login (with autologin), ensure it prompts after a failed auth.
- state = {
- msg : "The proxy moz-proxy://127.0.0.1:8888 is requesting a username and password. The site says: “Proxy Realmâ€",
- title : "Authentication Required",
- textValue : "proxuser",
- passValue : "proxpass",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- };
-
- proxyAuthinfo.username = "";
- proxyAuthinfo.password = "";
- proxyAuthinfo.realm = "Proxy Realm";
- proxyAuthinfo.flags = (Ci.nsIAuthInformation.AUTH_PROXY | Ci.nsIAuthInformation.PREVIOUS_FAILED);
-
- time1 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
- promptDone = handlePrompt(state, action);
- isOk = prompter2.promptAuth(proxyChannel, level, proxyAuthinfo);
- yield promptDone;
- time2 = pwmgr.findLogins({}, mozproxy, null, "Proxy Realm")[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
-
- ok(isOk, "Checking dialog return value (accept)");
- isnot(time1, time2, "Checking that timeLastUsed was updated");
- is(proxyAuthinfo.username, "proxuser", "Checking returned username");
- is(proxyAuthinfo.password, "proxpass", "Checking returned password");
-});
-
-add_task(function* test_autologin_private() {
- // test proxy login (with autologin), ensure it prompts in Private Browsing mode.
- state = {
- msg : "the message",
- title : "the title",
- textValue : "proxuser",
- passValue : "proxpass",
- };
- action = {
- buttonClick : "ok",
- };
-
- proxyAuthinfo.username = "";
- proxyAuthinfo.password = "";
- proxyAuthinfo.realm = "Proxy Realm";
- proxyAuthinfo.flags = Ci.nsIAuthInformation.AUTH_PROXY;
-
- prefs.clearUserPref("signon.autologin.proxy");
-
- // XXX check for and kill popup notification??
- // XXX check for checkbox / checkstate on old prompts?
- // XXX check NTLM domain stuff
-});
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_recipe_login_fields.html b/toolkit/components/passwordmgr/test/mochitest/test_recipe_login_fields.html
deleted file mode 100644
index 943bffc52..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_recipe_login_fields.html
+++ /dev/null
@@ -1,145 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for recipes overriding login fields</title>
- <script src="/tests/SimpleTest/SimpleTest.js"></script>
- <script src="/tests/SimpleTest/SpawnTask.js"></script>
- <script src="pwmgr_common.js"></script>
- <link rel="stylesheet" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<script>
-var chromeScript = runChecksAfterCommonInit();
-
-let fillPromiseResolvers = [];
-
-function waitForFills(fillCount) {
- let promises = [];
- while (fillCount--) {
- let promise = new Promise(resolve => fillPromiseResolvers.push(resolve));
- promises.push(promise);
- }
-
- return Promise.all(promises);
-}
-
-add_task(function* setup() {
- if (document.readyState !== "complete") {
- yield new Promise((resolve) => {
- document.onreadystatechange = () => {
- if (document.readyState !== "complete") {
- return;
- }
- document.onreadystatechange = null;
- resolve();
- };
- });
- }
-
- document.getElementById("content")
- .addEventListener("input", function handleInputEvent(evt) {
- let resolve = fillPromiseResolvers.shift();
- if (!resolve) {
- ok(false, "Too many fills");
- return;
- }
-
- resolve(evt.target);
- });
-});
-
-add_task(function* loadUsernamePasswordSelectorRecipes() {
- yield loadRecipes({
- siteRecipes: [{
- hosts: ["mochi.test:8888"],
- usernameSelector: "input[name='uname1']",
- passwordSelector: "input[name='pword2']",
- }],
- });
-});
-
-add_task(function* testOverriddingFields() {
- // Insert the form dynamically so autofill is triggered after setup above.
- document.getElementById("content").innerHTML = `
- <!-- form with recipe for the username and password -->
- <form id="form1">
- <input type="text" name="uname1" data-expected="true">
- <input type="text" name="uname2" data-expected="false">
- <input type="password" name="pword1" data-expected="false">
- <input type="password" name="pword2" data-expected="true">
- </form>`;
-
- let elements = yield waitForFills(2);
- for (let element of elements) {
- is(element.dataset.expected, "true", `${element.name} was filled`);
- }
-});
-
-add_task(function* testDefaultHeuristics() {
- // Insert the form dynamically so autofill is triggered after setup above.
- document.getElementById("content").innerHTML = `
- <!-- Fallback to the default heuristics since the selectors don't match -->
- <form id="form2">
- <input type="text" name="uname3" data-expected="false">
- <input type="text" name="uname4" data-expected="true">
- <input type="password" name="pword3" data-expected="true">
- <input type="password" name="pword4" data-expected="false">
- </form>`;
-
- let elements = yield waitForFills(2);
- for (let element of elements) {
- is(element.dataset.expected, "true", `${element.name} was filled`);
- }
-});
-
-add_task(function* loadNotUsernameSelectorRecipes() {
- yield resetRecipes();
- yield loadRecipes({
- siteRecipes: [{
- hosts: ["mochi.test:8888"],
- notUsernameSelector: "input[name='not_uname1']"
- }],
- });
-});
-
-add_task(function* testNotUsernameField() {
- document.getElementById("content").innerHTML = `
- <!-- The field matching notUsernameSelector should be skipped -->
- <form id="form3">
- <input type="text" name="uname5" data-expected="true">
- <input type="text" name="not_uname1" data-expected="false">
- <input type="password" name="pword5" data-expected="true">
- </form>`;
-
- let elements = yield waitForFills(2);
- for (let element of elements) {
- is(element.dataset.expected, "true", `${element.name} was filled`);
- }
-});
-
-add_task(function* testNotUsernameFieldNoUsername() {
- document.getElementById("content").innerHTML = `
- <!-- The field matching notUsernameSelector should be skipped.
- No username field should be found and filled in this case -->
- <form id="form4">
- <input type="text" name="not_uname1" data-expected="false">
- <input type="password" name="pword6" data-expected="true">
- </form>`;
-
- let elements = yield waitForFills(1);
- for (let element of elements) {
- is(element.dataset.expected, "true", `${element.name} was filled`);
- }
-});
-
-</script>
-
-<p id="display"></p>
-
-<div id="content">
- // Forms are inserted dynamically
-</div>
-<pre id="test"></pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_username_focus.html b/toolkit/components/passwordmgr/test/mochitest/test_username_focus.html
deleted file mode 100644
index c93c1e9c9..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_username_focus.html
+++ /dev/null
@@ -1,263 +0,0 @@
-
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test interaction between autocomplete and focus on username fields</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<script>
-let pwmgrCommonScript = runInParent(SimpleTest.getTestFileURL("pwmgr_common.js"));
-
-let readyPromise = registerRunTests();
-let chromeScript = runInParent(function chromeSetup() {
- const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
- let pwmgr = Cc["@mozilla.org/login-manager;1"].getService(Ci.nsILoginManager);
-
- let login1A = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- let login1B = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- let login2A = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- let login2B = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- let login2C = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
-
- login1A.init("http://mochi.test:8888", "http://username-focus-1", null,
- "testuser1A", "testpass1A", "", "");
-
- login2A.init("http://mochi.test:8888", "http://username-focus-2", null,
- "testuser2A", "testpass2A", "", "");
- login2B.init("http://mochi.test:8888", "http://username-focus-2", null,
- "testuser2B", "testpass2B", "", "");
-
- pwmgr.addLogin(login1A);
- pwmgr.addLogin(login2A);
- pwmgr.addLogin(login2B);
-});
-</script>
-
-<p id="display"></p>
-<div id="content">
- <!-- first 3 forms have a matching user+pass login -->
-
- <!-- user+pass form. -->
- <form id="form-autofilled" action="http://username-focus-1">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit" name="submit">Submit</button>
- </form>
-
- <!-- user+pass form, username prefilled -->
- <form id="form-autofilled-prefilled-un" action="http://username-focus-1">
- <input type="text" name="uname" value="testuser1A">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- user+pass form. -->
- <form id="form-autofilled-focused-dynamic" action="http://username-focus-1">
- <input type="text" name="uname">
- <input type="not-yet-password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
-
- <!-- next 5 forms have matching user+pass (2x) logins -->
-
- <!-- user+pass form. -->
- <form id="form-multiple" action="http://username-focus-2">
- <input type="text" name="uname">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- user+pass form dynamic with existing focus -->
- <form id="form-multiple-dynamic" action="http://username-focus-2">
- <input type="text" name="uname">
- <input type="not-yet-password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- user+pass form, username prefilled -->
- <form id="form-multiple-prefilled-un1" action="http://username-focus-2">
- <input type="text" name="uname" value="testuser2A">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- user+pass form, different username prefilled -->
- <form id="form-multiple-prefilled-un2" action="http://username-focus-2">
- <input type="text" name="uname" value="testuser2B">
- <input type="password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
- <!-- user+pass form, username prefilled with existing focus -->
- <form id="form-multiple-prefilled-focused-dynamic" action="http://username-focus-2">
- <input type="text" name="uname" value="testuser2B">
- <input type="not-yet-password" name="pword">
- <button type="submit">Submit</button>
- </form>
-
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-function removeFocus() {
- $_("-autofilled", "submit").focus();
-}
-
-add_task(function* setup() {
- yield SpecialPowers.pushPrefEnv({"set": [
- ["security.insecure_field_warning.contextual.enabled", false],
- ]});
-
- ok(readyPromise, "check promise is available");
- yield readyPromise;
-});
-
-add_task(function* test_autofilled() {
- let usernameField = $_("-autofilled", "uname");
- info("Username and password already filled so don't show autocomplete");
- let noPopupPromise = promiseNoUnexpectedPopupShown();
- usernameField.focus();
- yield noPopupPromise;
-
- removeFocus();
- usernameField.value = "testuser";
- info("Focus when we don't have an exact match");
- shownPromise = promiseACShown();
- usernameField.focus();
- yield shownPromise;
-});
-
-add_task(function* test_autofilled_prefilled_un() {
- let usernameField = $_("-autofilled-prefilled-un", "uname");
- info("Username and password already filled so don't show autocomplete");
- let noPopupPromise = promiseNoUnexpectedPopupShown();
- usernameField.focus();
- yield noPopupPromise;
-
- removeFocus();
- usernameField.value = "testuser";
- info("Focus when we don't have an exact match");
- shownPromise = promiseACShown();
- usernameField.focus();
- yield shownPromise;
-});
-
-add_task(function* test_autofilled_focused_dynamic() {
- let usernameField = $_("-autofilled-focused-dynamic", "uname");
- let passwordField = $_("-autofilled-focused-dynamic", "pword");
- info("Username and password will be filled while username focused");
- let noPopupPromise = promiseNoUnexpectedPopupShown();
- usernameField.focus();
- yield noPopupPromise;
- info("triggering autofill");
- noPopupPromise = promiseNoUnexpectedPopupShown();
- passwordField.type = "password";
- yield noPopupPromise;
-
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup is closed");
-
- removeFocus();
- passwordField.value = "test";
- info("Focus when we don't have an exact match");
- shownPromise = promiseACShown();
- usernameField.focus();
- yield shownPromise;
-});
-
-// Begin testing forms that have multiple saved logins
-
-add_task(function* test_multiple() {
- let usernameField = $_("-multiple", "uname");
- info("Fields not filled due to multiple so autocomplete upon focus");
- shownPromise = promiseACShown();
- usernameField.focus();
- yield shownPromise;
-});
-
-add_task(function* test_multiple_dynamic() {
- let usernameField = $_("-multiple-dynamic", "uname");
- let passwordField = $_("-multiple-dynamic", "pword");
- info("Fields not filled but username is focused upon marking so open");
- let noPopupPromise = promiseNoUnexpectedPopupShown();
- usernameField.focus();
- yield noPopupPromise;
-
- info("triggering _fillForm code");
- let shownPromise = promiseACShown();
- passwordField.type = "password";
- yield shownPromise;
-});
-
-add_task(function* test_multiple_prefilled_un1() {
- let usernameField = $_("-multiple-prefilled-un1", "uname");
- info("Username and password already filled so don't show autocomplete");
- let noPopupPromise = promiseNoUnexpectedPopupShown();
- usernameField.focus();
- yield noPopupPromise;
-
- removeFocus();
- usernameField.value = "testuser";
- info("Focus when we don't have an exact match");
- shownPromise = promiseACShown();
- usernameField.focus();
- yield shownPromise;
-});
-
-add_task(function* test_multiple_prefilled_un2() {
- let usernameField = $_("-multiple-prefilled-un2", "uname");
- info("Username and password already filled so don't show autocomplete");
- let noPopupPromise = promiseNoUnexpectedPopupShown();
- usernameField.focus();
- yield noPopupPromise;
-
- removeFocus();
- usernameField.value = "testuser";
- info("Focus when we don't have an exact match");
- shownPromise = promiseACShown();
- usernameField.focus();
- yield shownPromise;
-});
-
-add_task(function* test_multiple_prefilled_focused_dynamic() {
- let usernameField = $_("-multiple-prefilled-focused-dynamic", "uname");
- let passwordField = $_("-multiple-prefilled-focused-dynamic", "pword");
- info("Username and password will be filled while username focused");
- let noPopupPromise = promiseNoUnexpectedPopupShown();
- usernameField.focus();
- yield noPopupPromise;
- info("triggering autofill");
- noPopupPromise = promiseNoUnexpectedPopupShown();
- passwordField.type = "password";
- yield noPopupPromise;
-
- let popupState = yield getPopupState();
- is(popupState.open, false, "Check popup is closed");
-
- removeFocus();
- passwordField.value = "test";
- info("Focus when we don't have an exact match");
- shownPromise = promiseACShown();
- usernameField.focus();
- yield shownPromise;
-});
-
-add_task(function* cleanup() {
- removeFocus();
-});
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/mochitest/test_xhr_2.html b/toolkit/components/passwordmgr/test/mochitest/test_xhr_2.html
deleted file mode 100644
index fa8357792..000000000
--- a/toolkit/components/passwordmgr/test/mochitest/test_xhr_2.html
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=654348
--->
-<head>
- <meta charset="utf-8">
- <title>Test XHR auth with user and pass arguments</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body onload="startTest()">
-<script class="testbody" type="text/javascript">
-
-/**
- * This test checks we correctly ignore authentication entry
- * for a subpath and use creds from the URL when provided when XHR
- * is used with filled user name and password.
- *
- * 1. connect authenticate.sjs that excepts user1:pass1 password
- * 2. connect authenticate.sjs that this time expects differentuser2:pass2 password
- * we must use the creds that are provided to the xhr witch are different and expected
- */
-
-function doxhr(URL, user, pass, code, next) {
- var xhr = new XMLHttpRequest();
- if (user && pass)
- xhr.open("POST", URL, true, user, pass);
- else
- xhr.open("POST", URL, true);
- xhr.onload = function() {
- is(xhr.status, code, "expected response code " + code);
- next();
- };
- xhr.onerror = function() {
- ok(false, "request passed");
- finishTest();
- };
- xhr.send();
-}
-
-function startTest() {
- doxhr("authenticate.sjs?user=dummy&pass=pass1&realm=realm1&formauth=1", "dummy", "dummy", 403, function() {
- doxhr("authenticate.sjs?user=dummy&pass=pass1&realm=realm1&formauth=1", "dummy", "pass1", 200, finishTest);
- });
-}
-
-function finishTest() {
- SimpleTest.finish();
-}
-
-</script>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/prompt_common.js b/toolkit/components/passwordmgr/test/prompt_common.js
deleted file mode 100644
index 267e697ae..000000000
--- a/toolkit/components/passwordmgr/test/prompt_common.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * NOTE:
- * This file is currently only being used for tests which haven't been
- * fixed to work with e10s. Favor using the `prompt_common.js` file that
- * is in `toolkit/components/prompts/test/` instead.
- */
-
-var Ci = SpecialPowers.Ci;
-ok(Ci != null, "Access Ci");
-var Cc = SpecialPowers.Cc;
-ok(Cc != null, "Access Cc");
-
-var didDialog;
-
-var timer; // keep in outer scope so it's not GC'd before firing
-function startCallbackTimer() {
- didDialog = false;
-
- // Delay before the callback twiddles the prompt.
- const dialogDelay = 10;
-
- // Use a timer to invoke a callback to twiddle the authentication dialog
- timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
- timer.init(observer, dialogDelay, Ci.nsITimer.TYPE_ONE_SHOT);
-}
-
-
-var observer = SpecialPowers.wrapCallbackObject({
- QueryInterface : function (iid) {
- const interfaces = [Ci.nsIObserver,
- Ci.nsISupports, Ci.nsISupportsWeakReference];
-
- if (!interfaces.some( function(v) { return iid.equals(v); } ))
- throw SpecialPowers.Components.results.NS_ERROR_NO_INTERFACE;
- return this;
- },
-
- observe : function (subject, topic, data) {
- var doc = getDialogDoc();
- if (doc)
- handleDialog(doc, testNum);
- else
- startCallbackTimer(); // try again in a bit
- }
-});
-
-function getDialogDoc() {
- // Find the <browser> which contains notifyWindow, by looking
- // through all the open windows and all the <browsers> in each.
- var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
- getService(Ci.nsIWindowMediator);
- // var enumerator = wm.getEnumerator("navigator:browser");
- var enumerator = wm.getXULWindowEnumerator(null);
-
- while (enumerator.hasMoreElements()) {
- var win = enumerator.getNext();
- var windowDocShell = win.QueryInterface(Ci.nsIXULWindow).docShell;
-
- var containedDocShells = windowDocShell.getDocShellEnumerator(
- Ci.nsIDocShellTreeItem.typeChrome,
- Ci.nsIDocShell.ENUMERATE_FORWARDS);
- while (containedDocShells.hasMoreElements()) {
- // Get the corresponding document for this docshell
- var childDocShell = containedDocShells.getNext();
- // We don't want it if it's not done loading.
- if (childDocShell.busyFlags != Ci.nsIDocShell.BUSY_FLAGS_NONE)
- continue;
- var childDoc = childDocShell.QueryInterface(Ci.nsIDocShell)
- .contentViewer
- .DOMDocument;
-
- // ok(true, "Got window: " + childDoc.location.href);
- if (childDoc.location.href == "chrome://global/content/commonDialog.xul")
- return childDoc;
- }
- }
-
- return null;
-}
diff --git a/toolkit/components/passwordmgr/test/pwmgr_common.js b/toolkit/components/passwordmgr/test/pwmgr_common.js
deleted file mode 100644
index fa7c4fd85..000000000
--- a/toolkit/components/passwordmgr/test/pwmgr_common.js
+++ /dev/null
@@ -1,509 +0,0 @@
-const TESTS_DIR = "/tests/toolkit/components/passwordmgr/test/";
-
-/**
- * Returns the element with the specified |name| attribute.
- */
-function $_(formNum, name) {
- var form = document.getElementById("form" + formNum);
- if (!form) {
- logWarning("$_ couldn't find requested form " + formNum);
- return null;
- }
-
- var element = form.children.namedItem(name);
- if (!element) {
- logWarning("$_ couldn't find requested element " + name);
- return null;
- }
-
- // Note that namedItem is a bit stupid, and will prefer an
- // |id| attribute over a |name| attribute when looking for
- // the element. Login Mananger happens to use .namedItem
- // anyway, but let's rigorously check it here anyway so
- // that we don't end up with tests that mistakenly pass.
-
- if (element.getAttribute("name") != name) {
- logWarning("$_ got confused.");
- return null;
- }
-
- return element;
-}
-
-/**
- * Check a form for expected values. If an argument is null, a field's
- * expected value will be the default value.
- *
- * <form id="form#">
- * checkForm(#, "foo");
- */
-function checkForm(formNum, val1, val2, val3) {
- var e, form = document.getElementById("form" + formNum);
- ok(form, "Locating form " + formNum);
-
- var numToCheck = arguments.length - 1;
-
- if (!numToCheck--)
- return;
- e = form.elements[0];
- if (val1 == null)
- is(e.value, e.defaultValue, "Test default value of field " + e.name +
- " in form " + formNum);
- else
- is(e.value, val1, "Test value of field " + e.name +
- " in form " + formNum);
-
-
- if (!numToCheck--)
- return;
- e = form.elements[1];
- if (val2 == null)
- is(e.value, e.defaultValue, "Test default value of field " + e.name +
- " in form " + formNum);
- else
- is(e.value, val2, "Test value of field " + e.name +
- " in form " + formNum);
-
-
- if (!numToCheck--)
- return;
- e = form.elements[2];
- if (val3 == null)
- is(e.value, e.defaultValue, "Test default value of field " + e.name +
- " in form " + formNum);
- else
- is(e.value, val3, "Test value of field " + e.name +
- " in form " + formNum);
-}
-
-/**
- * Check a form for unmodified values from when page was loaded.
- *
- * <form id="form#">
- * checkUnmodifiedForm(#);
- */
-function checkUnmodifiedForm(formNum) {
- var form = document.getElementById("form" + formNum);
- ok(form, "Locating form " + formNum);
-
- for (var i = 0; i < form.elements.length; i++) {
- var ele = form.elements[i];
-
- // No point in checking form submit/reset buttons.
- if (ele.type == "submit" || ele.type == "reset")
- continue;
-
- is(ele.value, ele.defaultValue, "Test to default value of field " +
- ele.name + " in form " + formNum);
- }
-}
-
-/**
- * Mochitest gives us a sendKey(), but it's targeted to a specific element.
- * This basically sends an untargeted key event, to whatever's focused.
- */
-function doKey(aKey, modifier) {
- var keyName = "DOM_VK_" + aKey.toUpperCase();
- var key = KeyEvent[keyName];
-
- // undefined --> null
- if (!modifier)
- modifier = null;
-
- // Window utils for sending fake sey events.
- var wutils = SpecialPowers.wrap(window).
- QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor).
- getInterface(SpecialPowers.Ci.nsIDOMWindowUtils);
-
- if (wutils.sendKeyEvent("keydown", key, 0, modifier)) {
- wutils.sendKeyEvent("keypress", key, 0, modifier);
- }
- wutils.sendKeyEvent("keyup", key, 0, modifier);
-}
-
-/**
- * Init with a common login
- * If selfFilling is true or non-undefined, fires an event at the page so that
- * the test can start checking filled-in values. Tests that check observer
- * notifications might be confused by this.
- */
-function commonInit(selfFilling) {
- var pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"].
- getService(SpecialPowers.Ci.nsILoginManager);
- ok(pwmgr != null, "Access LoginManager");
-
- // Check that initial state has no logins
- var logins = pwmgr.getAllLogins();
- is(logins.length, 0, "Not expecting logins to be present");
- var disabledHosts = pwmgr.getAllDisabledHosts();
- if (disabledHosts.length) {
- ok(false, "Warning: wasn't expecting disabled hosts to be present.");
- for (var host of disabledHosts)
- pwmgr.setLoginSavingEnabled(host, true);
- }
-
- // Add a login that's used in multiple tests
- var login = SpecialPowers.Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(SpecialPowers.Ci.nsILoginInfo);
- login.init("http://mochi.test:8888", "http://mochi.test:8888", null,
- "testuser", "testpass", "uname", "pword");
- pwmgr.addLogin(login);
-
- // Last sanity check
- logins = pwmgr.getAllLogins();
- is(logins.length, 1, "Checking for successful init login");
- disabledHosts = pwmgr.getAllDisabledHosts();
- is(disabledHosts.length, 0, "Checking for no disabled hosts");
-
- if (selfFilling)
- return;
-
- if (this.sendAsyncMessage) {
- sendAsyncMessage("registerRunTests");
- } else {
- registerRunTests();
- }
-}
-
-function registerRunTests() {
- return new Promise(resolve => {
- // We provide a general mechanism for our tests to know when they can
- // safely run: we add a final form that we know will be filled in, wait
- // for the login manager to tell us that it's filled in and then continue
- // with the rest of the tests.
- window.addEventListener("DOMContentLoaded", (event) => {
- var form = document.createElement('form');
- form.id = 'observerforcer';
- var username = document.createElement('input');
- username.name = 'testuser';
- form.appendChild(username);
- var password = document.createElement('input');
- password.name = 'testpass';
- password.type = 'password';
- form.appendChild(password);
-
- var observer = SpecialPowers.wrapCallback(function(subject, topic, data) {
- var formLikeRoot = subject.QueryInterface(SpecialPowers.Ci.nsIDOMNode);
- if (formLikeRoot.id !== 'observerforcer')
- return;
- SpecialPowers.removeObserver(observer, "passwordmgr-processed-form");
- formLikeRoot.remove();
- SimpleTest.executeSoon(() => {
- var runTestEvent = new Event("runTests");
- window.dispatchEvent(runTestEvent);
- resolve();
- });
- });
- SpecialPowers.addObserver(observer, "passwordmgr-processed-form", false);
-
- document.body.appendChild(form);
- });
- });
-}
-
-const masterPassword = "omgsecret!";
-
-function enableMasterPassword() {
- setMasterPassword(true);
-}
-
-function disableMasterPassword() {
- setMasterPassword(false);
-}
-
-function setMasterPassword(enable) {
- var oldPW, newPW;
- if (enable) {
- oldPW = "";
- newPW = masterPassword;
- } else {
- oldPW = masterPassword;
- newPW = "";
- }
- // Set master password. Note that this does not log you in, so the next
- // invocation of pwmgr can trigger a MP prompt.
-
- var pk11db = Cc["@mozilla.org/security/pk11tokendb;1"].getService(Ci.nsIPK11TokenDB);
- var token = pk11db.findTokenByName("");
- info("MP change from " + oldPW + " to " + newPW);
- token.changePassword(oldPW, newPW);
-}
-
-function logoutMasterPassword() {
- var sdr = Cc["@mozilla.org/security/sdr;1"].getService(Ci.nsISecretDecoderRing);
- sdr.logoutAndTeardown();
-}
-
-function dumpLogins(pwmgr) {
- var logins = pwmgr.getAllLogins();
- ok(true, "----- dumpLogins: have " + logins.length + " logins. -----");
- for (var i = 0; i < logins.length; i++)
- dumpLogin("login #" + i + " --- ", logins[i]);
-}
-
-function dumpLogin(label, login) {
- var loginText = "";
- loginText += "host: ";
- loginText += login.hostname;
- loginText += " / formURL: ";
- loginText += login.formSubmitURL;
- loginText += " / realm: ";
- loginText += login.httpRealm;
- loginText += " / user: ";
- loginText += login.username;
- loginText += " / pass: ";
- loginText += login.password;
- loginText += " / ufield: ";
- loginText += login.usernameField;
- loginText += " / pfield: ";
- loginText += login.passwordField;
- ok(true, label + loginText);
-}
-
-function getRecipeParent() {
- var { LoginManagerParent } = SpecialPowers.Cu.import("resource://gre/modules/LoginManagerParent.jsm", {});
- if (!LoginManagerParent.recipeParentPromise) {
- return null;
- }
- return LoginManagerParent.recipeParentPromise.then((recipeParent) => {
- return SpecialPowers.wrap(recipeParent);
- });
-}
-
-/**
- * Resolves when a specified number of forms have been processed.
- */
-function promiseFormsProcessed(expectedCount = 1) {
- var processedCount = 0;
- return new Promise((resolve, reject) => {
- function onProcessedForm(subject, topic, data) {
- processedCount++;
- if (processedCount == expectedCount) {
- SpecialPowers.removeObserver(onProcessedForm, "passwordmgr-processed-form");
- resolve(SpecialPowers.Cu.waiveXrays(subject), data);
- }
- }
- SpecialPowers.addObserver(onProcessedForm, "passwordmgr-processed-form", false);
- });
-}
-
-function loadRecipes(recipes) {
- info("Loading recipes");
- return new Promise(resolve => {
- chromeScript.addMessageListener("loadedRecipes", function loaded() {
- chromeScript.removeMessageListener("loadedRecipes", loaded);
- resolve(recipes);
- });
- chromeScript.sendAsyncMessage("loadRecipes", recipes);
- });
-}
-
-function resetRecipes() {
- info("Resetting recipes");
- return new Promise(resolve => {
- chromeScript.addMessageListener("recipesReset", function reset() {
- chromeScript.removeMessageListener("recipesReset", reset);
- resolve();
- });
- chromeScript.sendAsyncMessage("resetRecipes");
- });
-}
-
-function promiseStorageChanged(expectedChangeTypes) {
- return new Promise((resolve, reject) => {
- function onStorageChanged({ topic, data }) {
- let changeType = expectedChangeTypes.shift();
- is(data, changeType, "Check expected passwordmgr-storage-changed type");
- if (expectedChangeTypes.length === 0) {
- chromeScript.removeMessageListener("storageChanged", onStorageChanged);
- resolve();
- }
- }
- chromeScript.addMessageListener("storageChanged", onStorageChanged);
- });
-}
-
-function promisePromptShown(expectedTopic) {
- return new Promise((resolve, reject) => {
- function onPromptShown({ topic, data }) {
- is(topic, expectedTopic, "Check expected prompt topic");
- chromeScript.removeMessageListener("promptShown", onPromptShown);
- resolve();
- }
- chromeScript.addMessageListener("promptShown", onPromptShown);
- });
-}
-
-/**
- * Run a function synchronously in the parent process and destroy it in the test cleanup function.
- * @param {Function|String} aFunctionOrURL - either a function that will be stringified and run
- * or the URL to a JS file.
- * @return {Object} - the return value of loadChromeScript providing message-related methods.
- * @see loadChromeScript in specialpowersAPI.js
- */
-function runInParent(aFunctionOrURL) {
- let chromeScript = SpecialPowers.loadChromeScript(aFunctionOrURL);
- SimpleTest.registerCleanupFunction(() => {
- chromeScript.destroy();
- });
- return chromeScript;
-}
-
-/**
- * Run commonInit synchronously in the parent then run the test function after the runTests event.
- *
- * @param {Function} aFunction The test function to run
- */
-function runChecksAfterCommonInit(aFunction = null) {
- SimpleTest.waitForExplicitFinish();
- let pwmgrCommonScript = runInParent(SimpleTest.getTestFileURL("pwmgr_common.js"));
- if (aFunction) {
- window.addEventListener("runTests", aFunction);
- pwmgrCommonScript.addMessageListener("registerRunTests", () => registerRunTests());
- }
- pwmgrCommonScript.sendSyncMessage("setupParent");
- return pwmgrCommonScript;
-}
-
-// Code to run when loaded as a chrome script in tests via loadChromeScript
-if (this.addMessageListener) {
- const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
- var SpecialPowers = { Cc, Ci, Cr, Cu, };
- var ok, is;
- // Ignore ok/is in commonInit since they aren't defined in a chrome script.
- ok = is = () => {}; // eslint-disable-line no-native-reassign
-
- Cu.import("resource://gre/modules/LoginHelper.jsm");
- Cu.import("resource://gre/modules/LoginManagerParent.jsm");
- Cu.import("resource://gre/modules/Services.jsm");
- Cu.import("resource://gre/modules/Task.jsm");
-
- function onStorageChanged(subject, topic, data) {
- sendAsyncMessage("storageChanged", {
- topic,
- data,
- });
- }
- Services.obs.addObserver(onStorageChanged, "passwordmgr-storage-changed", false);
-
- function onPrompt(subject, topic, data) {
- sendAsyncMessage("promptShown", {
- topic,
- data,
- });
- }
- Services.obs.addObserver(onPrompt, "passwordmgr-prompt-change", false);
- Services.obs.addObserver(onPrompt, "passwordmgr-prompt-save", false);
-
- addMessageListener("setupParent", ({selfFilling = false} = {selfFilling: false}) => {
- // Force LoginManagerParent to init for the tests since it's normally delayed
- // by apps such as on Android.
- LoginManagerParent.init();
-
- commonInit(selfFilling);
- sendAsyncMessage("doneSetup");
- });
-
- addMessageListener("loadRecipes", Task.async(function*(recipes) {
- var recipeParent = yield LoginManagerParent.recipeParentPromise;
- yield recipeParent.load(recipes);
- sendAsyncMessage("loadedRecipes", recipes);
- }));
-
- addMessageListener("resetRecipes", Task.async(function*() {
- let recipeParent = yield LoginManagerParent.recipeParentPromise;
- yield recipeParent.reset();
- sendAsyncMessage("recipesReset");
- }));
-
- addMessageListener("proxyLoginManager", msg => {
- // Recreate nsILoginInfo objects from vanilla JS objects.
- let recreatedArgs = msg.args.map((arg, index) => {
- if (msg.loginInfoIndices.includes(index)) {
- return LoginHelper.vanillaObjectToLogin(arg);
- }
-
- return arg;
- });
-
- let rv = Services.logins[msg.methodName](...recreatedArgs);
- if (rv instanceof Ci.nsILoginInfo) {
- rv = LoginHelper.loginToVanillaObject(rv);
- }
- return rv;
- });
-
- var globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessageListenerManager);
- globalMM.addMessageListener("RemoteLogins:onFormSubmit", function onFormSubmit(message) {
- sendAsyncMessage("formSubmissionProcessed", message.data, message.objects);
- });
-} else {
- // Code to only run in the mochitest pages (not in the chrome script).
- SpecialPowers.pushPrefEnv({"set": [["signon.autofillForms.http", true],
- ["security.insecure_field_warning.contextual.enabled", false]]
- });
-
- SimpleTest.registerCleanupFunction(() => {
- SpecialPowers.popPrefEnv();
- runInParent(function cleanupParent() {
- const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
- Cu.import("resource://gre/modules/Services.jsm");
- Cu.import("resource://gre/modules/LoginManagerParent.jsm");
-
- // Remove all logins and disabled hosts
- Services.logins.removeAllLogins();
-
- let disabledHosts = Services.logins.getAllDisabledHosts();
- disabledHosts.forEach(host => Services.logins.setLoginSavingEnabled(host, true));
-
- let authMgr = Cc["@mozilla.org/network/http-auth-manager;1"].
- getService(Ci.nsIHttpAuthManager);
- authMgr.clearAll();
-
- if (LoginManagerParent._recipeManager) {
- LoginManagerParent._recipeManager.reset();
- }
-
- // Cleanup PopupNotifications (if on a relevant platform)
- let chromeWin = Services.wm.getMostRecentWindow("navigator:browser");
- if (chromeWin && chromeWin.PopupNotifications) {
- let notes = chromeWin.PopupNotifications._currentNotifications;
- if (notes.length > 0) {
- dump("Removing " + notes.length + " popup notifications.\n");
- }
- for (let note of notes) {
- note.remove();
- }
- }
- });
- });
-
-
- let { LoginHelper } = SpecialPowers.Cu.import("resource://gre/modules/LoginHelper.jsm", {});
- /**
- * Proxy for Services.logins (nsILoginManager).
- * Only supports arguments which support structured clone plus {nsILoginInfo}
- * Assumes properties are methods.
- */
- this.LoginManager = new Proxy({}, {
- get(target, prop, receiver) {
- return (...args) => {
- let loginInfoIndices = [];
- let cloneableArgs = args.map((val, index) => {
- if (SpecialPowers.call_Instanceof(val, SpecialPowers.Ci.nsILoginInfo)) {
- loginInfoIndices.push(index);
- return LoginHelper.loginToVanillaObject(val);
- }
-
- return val;
- });
-
- return chromeScript.sendSyncMessage("proxyLoginManager", {
- args: cloneableArgs,
- loginInfoIndices,
- methodName: prop,
- })[0][0];
- };
- },
- });
-}
diff --git a/toolkit/components/passwordmgr/test/subtst_master_pass.html b/toolkit/components/passwordmgr/test/subtst_master_pass.html
deleted file mode 100644
index 20211866a..000000000
--- a/toolkit/components/passwordmgr/test/subtst_master_pass.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<h2>MP subtest</h2>
-This form triggers a MP and gets filled in.<br>
-<form>
-Username: <input type="text" id="userfield" name="u"><br>
-Password: <input type="password" id="passfield" name="p"><br>
-<script>
- // Only notify when we fill in the password field.
- document.getElementById("passfield").addEventListener("input", function() {
- parent.postMessage("filled", "*");
- });
-</script>
-</form>
diff --git a/toolkit/components/passwordmgr/test/subtst_prompt_async.html b/toolkit/components/passwordmgr/test/subtst_prompt_async.html
deleted file mode 100644
index f60f63814..000000000
--- a/toolkit/components/passwordmgr/test/subtst_prompt_async.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Multiple auth request</title>
-</head>
-<body>
- <iframe id="iframe1" src="http://example.com/tests/toolkit/components/passwordmgr/test/authenticate.sjs?r=1&user=user3name&pass=user3pass&realm=mochirealm3&proxy_user=proxy_user2&proxy_pass=proxy_pass2&proxy_realm=proxy_realm2"></iframe>
- <iframe id="iframe2" src="http://example.com/tests/toolkit/components/passwordmgr/test/authenticate.sjs?r=2&user=user3name&pass=user3pass&realm=mochirealm3&proxy_user=proxy_user2&proxy_pass=proxy_pass2&proxy_realm=proxy_realm2"></iframe>
- <iframe id="iframe3" src="http://example.com/tests/toolkit/components/passwordmgr/test/authenticate.sjs?r=3&user=user3name&pass=user3pass&realm=mochirealm3&proxy_user=proxy_user2&proxy_pass=proxy_pass2&proxy_realm=proxy_realm2"></iframe>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/test_master_password.html b/toolkit/components/passwordmgr/test/test_master_password.html
deleted file mode 100644
index c8884811f..000000000
--- a/toolkit/components/passwordmgr/test/test_master_password.html
+++ /dev/null
@@ -1,308 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for master password</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: master password.
-<script>
-"use strict";
-
-commonInit();
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestFlakyTimeout("untriaged");
-
-var pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"]
- .getService(SpecialPowers.Ci.nsILoginManager);
-var pwcrypt = SpecialPowers.Cc["@mozilla.org/login-manager/crypto/SDR;1"]
- .getService(Ci.nsILoginManagerCrypto);
-
-var nsLoginInfo = new SpecialPowers.wrap(SpecialPowers.Components).Constructor("@mozilla.org/login-manager/loginInfo;1", Ci.nsILoginInfo);
-
-var exampleCom = "http://example.com/tests/toolkit/components/passwordmgr/test/";
-var exampleOrg = "http://example.org/tests/toolkit/components/passwordmgr/test/";
-
-var login1 = new nsLoginInfo();
-var login2 = new nsLoginInfo();
-
-login1.init("http://example.com", "http://example.com", null,
- "user1", "pass1", "uname", "pword");
-login2.init("http://example.org", "http://example.org", null,
- "user2", "pass2", "uname", "pword");
-
-pwmgr.addLogin(login1);
-pwmgr.addLogin(login2);
-</script>
-
-<p id="display"></p>
-
-<div id="content" style="display: none">
-<iframe id="iframe1"></iframe>
-<iframe id="iframe2"></iframe>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-var testNum = 1;
-var iframe1 = document.getElementById("iframe1");
-var iframe2 = document.getElementById("iframe2");
-
-// A couple of tests have to wait until the password manager gets around to
-// filling in the password in the subtest (after we dismiss the master
-// password dialog). In order to accomplish this, the test waits for an event
-// and then posts a message back up to us telling us to continue.
-var continuation = null;
-addEventListener("message", () => {
- if (continuation) {
- var c = continuation;
- continuation = null;
- c();
- }
-});
-
-/*
- * handleDialog
- *
- * Invoked a short period of time after calling startCallbackTimer(), and
- * allows testing the actual auth dialog while it's being displayed. Tests
- * should call startCallbackTimer() each time the auth dialog is expected (the
- * timer is a one-shot).
- */
-function handleDialog(doc, testNumber) {
- ok(true, "handleDialog running for test " + testNumber);
-
- var clickOK = true;
- var doNothing = false;
- var passfield = doc.getElementById("password1Textbox");
- var dialog = doc.getElementById("commonDialog");
-
- switch (testNumber) {
- case 1:
- is(passfield.getAttribute("value"), "", "Checking empty prompt");
- passfield.setAttribute("value", masterPassword);
- is(passfield.getAttribute("value"), masterPassword, "Checking filled prompt");
- break;
-
- case 2:
- clickOK = false;
- break;
-
- case 3:
- is(passfield.getAttribute("value"), "", "Checking empty prompt");
- passfield.setAttribute("value", masterPassword);
- break;
-
- case 4:
- doNothing = true;
- break;
-
- case 5:
- is(passfield.getAttribute("value"), "", "Checking empty prompt");
- passfield.setAttribute("value", masterPassword);
- break;
-
- default:
- ok(false, "Uhh, unhandled switch for testNum #" + testNumber);
- break;
- }
-
- didDialog = true;
-
- if (!doNothing) {
- SpecialPowers.addObserver(outerWindowObserver, "outer-window-destroyed", false);
- if (clickOK)
- dialog.acceptDialog();
- else
- dialog.cancelDialog();
- }
-
- ok(true, "handleDialog done for test " + testNumber);
-
- if (testNumber == 4)
- checkTest4A();
-}
-
-var outerWindowObserver = {
- observe: function(id) {
- SpecialPowers.removeObserver(outerWindowObserver, "outer-window-destroyed");
- var func;
- if (testNum == 1)
- func = startTest2;
- else if (testNum == 2)
- func = startTest3;
-
- // For tests 3 and 4C, we use the 'continuation' mechanism, described
- // above.
- if (func)
- setTimeout(func, 300);
- }
-};
-
-
-function startTest1() {
- ok(pwcrypt.isLoggedIn, "should be initially logged in (no MP)");
- enableMasterPassword();
- ok(!pwcrypt.isLoggedIn, "should be logged out after setting MP");
-
- // --- Test 1 ---
- // Trigger a MP prompt via the API
- startCallbackTimer();
- var logins = pwmgr.getAllLogins();
- ok(didDialog, "handleDialog was invoked");
- is(logins.length, 3, "expected number of logins");
-
- ok(pwcrypt.isLoggedIn, "should be logged in after MP prompt");
- logoutMasterPassword();
- ok(!pwcrypt.isLoggedIn, "should be logged out");
-}
-
-function startTest2() {
- // Try again but click cancel.
- testNum++;
- startCallbackTimer();
- var failedAsExpected = false;
- logins = null;
- try {
- logins = pwmgr.getAllLogins();
- } catch (e) { failedAsExpected = true; }
- ok(didDialog, "handleDialog was invoked");
- ok(failedAsExpected, "getAllLogins should have thrown");
- is(logins, null, "shouldn't have gotten logins");
- ok(!pwcrypt.isLoggedIn, "should still be logged out");
-}
-
-function startTest3() {
- // Load a single iframe to trigger a MP
- testNum++;
- iframe1.src = exampleCom + "subtst_master_pass.html";
- continuation = checkTest3;
- startCallbackTimer();
-}
-
-function checkTest3() {
- ok(true, "checkTest3 starting");
- ok(didDialog, "handleDialog was invoked");
-
- // check contents of iframe1 fields
- var u = SpecialPowers.wrap(iframe1).contentDocument.getElementById("userfield");
- var p = SpecialPowers.wrap(iframe1).contentDocument.getElementById("passfield");
- is(u.value, "user1", "checking expected user to have been filled in");
- is(p.value, "pass1", "checking expected pass to have been filled in");
-
- ok(pwcrypt.isLoggedIn, "should be logged in");
- logoutMasterPassword();
- ok(!pwcrypt.isLoggedIn, "should be logged out");
-
-
- // --- Test 4 ---
- // first part of loading 2 MP-triggering iframes
- testNum++;
- iframe1.src = exampleOrg + "subtst_master_pass.html";
- // start the callback, but we'll not enter the MP, just call checkTest4A
- startCallbackTimer();
-}
-
-function checkTest4A() {
- ok(true, "checkTest4A starting");
- ok(didDialog, "handleDialog was invoked");
-
- // check contents of iframe1 fields
- var u = SpecialPowers.wrap(iframe1).contentDocument.getElementById("userfield");
- var p = SpecialPowers.wrap(iframe1).contentDocument.getElementById("passfield");
- is(u.value, "", "checking expected empty user");
- is(p.value, "", "checking expected empty pass");
-
-
- ok(!pwcrypt.isLoggedIn, "should be logged out");
-
- // XXX check that there's 1 MP window open
-
- // Load another iframe with a login form
- // This should detect that there's already a pending MP prompt, and not
- // put up a second one. The load event will fire (note that when pwmgr is
- // driven from DOMContentLoaded, if that blocks due to prompting for a MP,
- // the load even will also be blocked until the prompt is dismissed).
- iframe2.onload = checkTest4B_delay;
- iframe2.src = exampleCom + "subtst_master_pass.html";
-}
-
-function checkTest4B_delay() {
- // Testing a negative, wait a little to give the login manager a chance to
- // (incorrectly) fill in the form. Note, we cannot use setTimeout()
- // here because the modal window suspends all window timers. Instead we
- // must use a chrome script to use nsITimer directly.
- let chromeURL = SimpleTest.getTestFileURL("chrome_timeout.js");
- let script = SpecialPowers.loadChromeScript(chromeURL);
- script.addMessageListener('ready', _ => {
- script.sendAsyncMessage('setTimeout', { delay: 500 });
- });
- script.addMessageListener('timeout', checkTest4B);
-}
-
-function checkTest4B() {
- ok(true, "checkTest4B starting");
- // iframe2 should load without having triggered a MP prompt (because one
- // is already waiting)
-
- // check contents of iframe2 fields
- var u = SpecialPowers.wrap(iframe2).contentDocument.getElementById("userfield");
- var p = SpecialPowers.wrap(iframe2).contentDocument.getElementById("passfield");
- is(u.value, "", "checking expected empty user");
- is(p.value, "", "checking expected empty pass");
-
- // XXX check that there's 1 MP window open
- ok(!pwcrypt.isLoggedIn, "should be logged out");
-
- continuation = checkTest4C;
-
- // Ok, now enter the MP. The MP prompt is already up, but we'll just reuse startCallBackTimer.
- // --- Test 5 ---
- testNum++;
- startCallbackTimer();
-}
-
-function checkTest4C() {
- ok(true, "checkTest4C starting");
- ok(didDialog, "handleDialog was invoked");
-
- // We shouldn't have to worry about iframe1's load event racing with
- // filling of iframe2's data. We notify observers synchronously, so
- // iframe2's observer will process iframe2 before iframe1 even finishes
- // processing the form (which is blocking its load event).
- ok(pwcrypt.isLoggedIn, "should be logged in");
-
- // check contents of iframe1 fields
- var u = SpecialPowers.wrap(iframe1).contentDocument.getElementById("userfield");
- var p = SpecialPowers.wrap(iframe1).contentDocument.getElementById("passfield");
- is(u.value, "user2", "checking expected user to have been filled in");
- is(p.value, "pass2", "checking expected pass to have been filled in");
-
- // check contents of iframe2 fields
- u = SpecialPowers.wrap(iframe2).contentDocument.getElementById("userfield");
- p = SpecialPowers.wrap(iframe2).contentDocument.getElementById("passfield");
- is(u.value, "user1", "checking expected user to have been filled in");
- is(p.value, "pass1", "checking expected pass to have been filled in");
-
- SimpleTest.finish();
-}
-
-// XXX do a test5ABC with clicking cancel?
-
-SimpleTest.registerCleanupFunction(function finishTest() {
- disableMasterPassword();
-
- pwmgr.removeLogin(login1);
- pwmgr.removeLogin(login2);
-});
-
-window.addEventListener("runTests", startTest1);
-</script>
-</pre>
-</body>
-</html>
-
diff --git a/toolkit/components/passwordmgr/test/test_prompt_async.html b/toolkit/components/passwordmgr/test/test_prompt_async.html
deleted file mode 100644
index 38b34679a..000000000
--- a/toolkit/components/passwordmgr/test/test_prompt_async.html
+++ /dev/null
@@ -1,540 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for Async Auth Prompt</title>
- <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-
- <script class="testbody" type="text/javascript">
- SimpleTest.waitForExplicitFinish();
- SimpleTest.requestFlakyTimeout("untriaged");
-
- const { NetUtil } = SpecialPowers.Cu.import('resource://gre/modules/NetUtil.jsm');
-
- var prefs = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
- prefs.setIntPref("network.auth.subresource-http-auth-allow", 2);
- // Class monitoring number of open dialog windows
- // It checks there is always open just a single dialog per application
- function dialogMonitor() {
- var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
- .getService(Ci.nsIObserverService);
- observerService.addObserver(this, "domwindowopened", false);
- observerService.addObserver(this, "domwindowclosed", false);
- }
-
- /*
- * As documented in Bug 718543, checking equality of objects pulled
- * from SpecialPowers-wrapped objects is unreliable. Because of that,
- * `dialogMonitor` now tracks the number of open windows rather than
- * specific window objects.
- *
- * NB: Because the constructor (above) adds |this| directly as an observer,
- * we need to do SpecialPowers.wrapCallbackObject directly on the prototype.
- */
- dialogMonitor.prototype = SpecialPowers.wrapCallbackObject({
- windowsOpen : 0,
- windowsRegistered : 0,
-
- QueryInterface : function (iid) {
- const interfaces = [Ci.nsIObserver, Ci.nsISupports];
-
- if (!interfaces.some( function(v) { return iid.equals(v); } ))
- throw SpecialPowers.Cr.NS_ERROR_NO_INTERFACE;
- return this;
- },
-
- observe: function(subject, topic, data) {
- if (topic === "domwindowopened") {
- this.windowsOpen++;
- this.windowsRegistered++;
- return;
- }
- if (topic === "domwindowclosed") {
- this.windowsOpen--;
- return;
- }
- },
-
- shutdown: function() {
- var observerService = SpecialPowers.Cc["@mozilla.org/observer-service;1"]
- .getService(Ci.nsIObserverService);
- observerService.removeObserver(this, "domwindowopened");
- observerService.removeObserver(this, "domwindowclosed");
- },
-
- reset: function() {
- this.windowsOpen = 0;
- this.windowsRegistered = 0;
- }
- });
-
- var monitor = new dialogMonitor();
-
- var pwmgr, logins = [];
-
- function initLogins(pi) {
- pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"]
- .getService(Ci.nsILoginManager);
-
- function addLogin(host, realm, user, pass) {
- var login = SpecialPowers.Cc["@mozilla.org/login-manager/loginInfo;1"]
- .createInstance(Ci.nsILoginInfo);
- login.init(host, null, realm, user, pass, "", "");
- pwmgr.addLogin(login);
- logins.push(login);
- }
-
- var mozproxy = "moz-proxy://" +
- SpecialPowers.wrap(pi).host + ":" +
- SpecialPowers.wrap(pi).port;
-
- addLogin(mozproxy, "proxy_realm",
- "proxy_user", "proxy_pass");
- addLogin(mozproxy, "proxy_realm2",
- "proxy_user2", "proxy_pass2");
- addLogin(mozproxy, "proxy_realm3",
- "proxy_user3", "proxy_pass3");
- addLogin(mozproxy, "proxy_realm4",
- "proxy_user4", "proxy_pass4");
- addLogin(mozproxy, "proxy_realm5",
- "proxy_user5", "proxy_pass5");
- addLogin("http://example.com", "mochirealm",
- "user1name", "user1pass");
- addLogin("http://example.org", "mochirealm2",
- "user2name", "user2pass");
- addLogin("http://example.com", "mochirealm3",
- "user3name", "user3pass");
- addLogin("http://example.com", "mochirealm4",
- "user4name", "user4pass");
- addLogin("http://example.com", "mochirealm5",
- "user5name", "user5pass");
- addLogin("http://example.com", "mochirealm6",
- "user6name", "user6pass");
- }
-
- function finishTest() {
- ok(true, "finishTest removing testing logins...");
- for (i in logins)
- pwmgr.removeLogin(logins[i]);
-
- var authMgr = SpecialPowers.Cc['@mozilla.org/network/http-auth-manager;1']
- .getService(Ci.nsIHttpAuthManager);
- authMgr.clearAll();
-
- monitor.shutdown();
- SimpleTest.finish();
- }
-
- var resolveCallback = SpecialPowers.wrapCallbackObject({
- QueryInterface : function (iid) {
- const interfaces = [Ci.nsIProtocolProxyCallback, Ci.nsISupports];
-
- if (!interfaces.some( function(v) { return iid.equals(v); } ))
- throw SpecialPowers.Cr.NS_ERROR_NO_INTERFACE;
- return this;
- },
-
- onProxyAvailable : function (req, uri, pi, status) {
- initLogins(pi);
- doTest(testNum);
- }
- });
-
- function startup() {
- // Need to allow for arbitrary network servers defined in PAC instead of a hardcoded moz-proxy.
- var channel = NetUtil.newChannel({
- uri: "http://example.com",
- loadUsingSystemPrincipal: true
- });
-
- var pps = SpecialPowers.Cc["@mozilla.org/network/protocol-proxy-service;1"]
- .getService();
-
- pps.asyncResolve(channel, 0, resolveCallback);
- }
-
- // --------------- Test loop spin ----------------
- var testNum = 1;
- var iframe1;
- var iframe2a;
- var iframe2b;
- window.onload = function () {
- iframe1 = document.getElementById("iframe1");
- iframe2a = document.getElementById("iframe2a");
- iframe2b = document.getElementById("iframe2b");
- iframe1.onload = onFrameLoad;
- iframe2a.onload = onFrameLoad;
- iframe2b.onload = onFrameLoad;
-
- startup();
- };
-
- var expectedLoads;
- var expectedDialogs;
- function onFrameLoad()
- {
- if (--expectedLoads == 0) {
- // All pages expected to load has loaded, continue with the next test
- ok(true, "Expected frames loaded");
-
- doCheck(testNum);
- monitor.reset();
-
- testNum++;
- doTest(testNum);
- }
- }
-
- function doTest(testNumber)
- {
- /*
- * These contentDocument variables are located here,
- * rather than in the global scope, because SpecialPowers threw
- * errors (complaining that the objects were deleted)
- * when these were in the global scope.
- */
- var iframe1Doc = SpecialPowers.wrap(iframe1).contentDocument;
- var iframe2aDoc = SpecialPowers.wrap(iframe2a).contentDocument;
- var iframe2bDoc = SpecialPowers.wrap(iframe2b).contentDocument;
- var exampleCom = "http://example.com/tests/toolkit/components/passwordmgr/test/";
- var exampleOrg = "http://example.org/tests/toolkit/components/passwordmgr/test/";
-
- switch (testNumber)
- {
- case 1:
- // Load through a single proxy with authentication required 3 different
- // pages, first with one login, other two with their own different login.
- // We expect to show just a single dialog for proxy authentication and
- // then two dialogs to authenticate to login 1 and then login 2.
- ok(true, "doTest testNum 1");
- expectedLoads = 3;
- expectedDialogs = 3;
- iframe1.src = exampleCom + "authenticate.sjs?" +
- "r=1&" +
- "user=user1name&" +
- "pass=user1pass&" +
- "realm=mochirealm&" +
- "proxy_user=proxy_user&" +
- "proxy_pass=proxy_pass&" +
- "proxy_realm=proxy_realm";
- iframe2a.src = exampleOrg + "authenticate.sjs?" +
- "r=2&" +
- "user=user2name&" +
- "pass=user2pass&" +
- "realm=mochirealm2&" +
- "proxy_user=proxy_user&" +
- "proxy_pass=proxy_pass&" +
- "proxy_realm=proxy_realm";
- iframe2b.src = exampleOrg + "authenticate.sjs?" +
- "r=3&" +
- "user=user2name&" +
- "pass=user2pass&" +
- "realm=mochirealm2&" +
- "proxy_user=proxy_user&" +
- "proxy_pass=proxy_pass&" +
- "proxy_realm=proxy_realm";
- break;
-
- case 2:
- // Load an iframe with 3 subpages all requiring the same login through
- // anuthenticated proxy. We expect 2 dialogs, proxy authentication
- // and web authentication.
- ok(true, "doTest testNum 2");
- expectedLoads = 3;
- expectedDialogs = 2;
- iframe1.src = exampleCom + "subtst_prompt_async.html";
- iframe2a.src = "about:blank";
- iframe2b.src = "about:blank";
- break;
-
- case 3:
- // Load in the iframe page through unauthenticated proxy
- // and discard the proxy authentication. We expect to see
- // unauthenticated page content and just a single dialog.
- ok(true, "doTest testNum 3");
- expectedLoads = 1;
- expectedDialogs = 1;
- iframe1.src = exampleCom + "authenticate.sjs?" +
- "user=user4name&" +
- "pass=user4pass&" +
- "realm=mochirealm4&" +
- "proxy_user=proxy_user3&" +
- "proxy_pass=proxy_pass3&" +
- "proxy_realm=proxy_realm3";
- break;
-
- case 4:
- // Reload the frame from previous step and pass the proxy authentication
- // but cancel the WWW authentication. We should get the proxy=ok and WWW=fail
- // content as a result.
- ok(true, "doTest testNum 4");
- expectedLoads = 1;
- expectedDialogs = 2;
- iframe1.src = exampleCom + "authenticate.sjs?" +
- "user=user4name&" +
- "pass=user4pass&" +
- "realm=mochirealm4&" +
- "proxy_user=proxy_user3&" +
- "proxy_pass=proxy_pass3&" +
- "proxy_realm=proxy_realm3";
-
-
- break;
-
- case 5:
- // Same as the previous two steps but let the server generate
- // huge content load to check http channel is capable to handle
- // case when auth dialog is canceled or accepted before unauthenticated
- // content data is load from the server. (This would be better to
- // implement using delay of server response).
- ok(true, "doTest testNum 5");
- expectedLoads = 1;
- expectedDialogs = 1;
- iframe1.src = exampleCom + "authenticate.sjs?" +
- "user=user5name&" +
- "pass=user5pass&" +
- "realm=mochirealm5&" +
- "proxy_user=proxy_user4&" +
- "proxy_pass=proxy_pass4&" +
- "proxy_realm=proxy_realm4&" +
- "huge=1";
- break;
-
- case 6:
- // Reload the frame from the previous step and let the proxy
- // authentication pass but WWW fail. We expect two dialogs
- // and an unathenticated page content load.
- ok(true, "doTest testNum 6");
- expectedLoads = 1;
- expectedDialogs = 2;
- iframe1.src = exampleCom + "authenticate.sjs?" +
- "user=user5name&" +
- "pass=user5pass&" +
- "realm=mochirealm5&" +
- "proxy_user=proxy_user4&" +
- "proxy_pass=proxy_pass4&" +
- "proxy_realm=proxy_realm4&" +
- "huge=1";
- break;
-
- case 7:
- // Reload again and let pass all authentication dialogs.
- // Check we get the authenticated content not broken by
- // the unauthenticated content.
- ok(true, "doTest testNum 7");
- expectedLoads = 1;
- expectedDialogs = 1;
- iframe1Doc.location.reload();
- break;
-
- case 8:
- // Check we proccess all challenges sent by server when
- // user cancels prompts
- ok(true, "doTest testNum 8");
- expectedLoads = 1;
- expectedDialogs = 5;
- iframe1.src = exampleCom + "authenticate.sjs?" +
- "user=user6name&" +
- "pass=user6pass&" +
- "realm=mochirealm6&" +
- "proxy_user=proxy_user5&" +
- "proxy_pass=proxy_pass5&" +
- "proxy_realm=proxy_realm5&" +
- "huge=1&" +
- "multiple=3";
- break;
-
- case 9:
- finishTest();
- return;
- }
-
- startCallbackTimer();
- }
-
- function handleDialog(doc, testNumber)
- {
- var dialog = doc.getElementById("commonDialog");
-
- switch (testNumber)
- {
- case 1:
- case 2:
- dialog.acceptDialog();
- break;
-
- case 3:
- dialog.cancelDialog();
- setTimeout(onFrameLoad, 10); // there are no successful frames for test 3
- break;
-
- case 4:
- if (expectedDialogs == 2)
- dialog.acceptDialog();
- else
- dialog.cancelDialog();
- break;
-
- case 5:
- dialog.cancelDialog();
- setTimeout(onFrameLoad, 10); // there are no successful frames for test 5
- break;
-
- case 6:
- if (expectedDialogs == 2)
- dialog.acceptDialog();
- else
- dialog.cancelDialog();
- break;
-
- case 7:
- dialog.acceptDialog();
- break;
-
- case 8:
- if (expectedDialogs == 3 || expectedDialogs == 1)
- dialog.acceptDialog();
- else
- dialog.cancelDialog();
- break;
-
- default:
- ok(false, "Unhandled testNum " + testNumber + " in handleDialog");
- }
-
- if (--expectedDialogs > 0)
- startCallbackTimer();
- }
-
- function doCheck(testNumber)
- {
- var iframe1Doc = SpecialPowers.wrap(iframe1).contentDocument;
- var iframe2aDoc = SpecialPowers.wrap(iframe2a).contentDocument;
- var iframe2bDoc = SpecialPowers.wrap(iframe2b).contentDocument;
- var authok1;
- var proxyok1;
- var footnote;
- switch (testNumber)
- {
- case 1:
- ok(true, "doCheck testNum 1");
- is(monitor.windowsRegistered, 3, "Registered 3 open dialogs");
-
- authok1 = iframe1Doc.getElementById("ok").textContent;
- proxyok1 = iframe1Doc.getElementById("proxy").textContent;
-
- var authok2a = iframe2aDoc.getElementById("ok").textContent;
- var proxyok2a = iframe2aDoc.getElementById("proxy").textContent;
-
- var authok2b = iframe2bDoc.getElementById("ok").textContent;
- var proxyok2b = iframe2bDoc.getElementById("proxy").textContent;
-
- is(authok1, "PASS", "WWW Authorization OK, frame1");
- is(authok2a, "PASS", "WWW Authorization OK, frame2a");
- is(authok2b, "PASS", "WWW Authorization OK, frame2b");
- is(proxyok1, "PASS", "Proxy Authorization OK, frame1");
- is(proxyok2a, "PASS", "Proxy Authorization OK, frame2a");
- is(proxyok2b, "PASS", "Proxy Authorization OK, frame2b");
- break;
-
- case 2:
- is(monitor.windowsRegistered, 2, "Registered 2 open dialogs");
- ok(true, "doCheck testNum 2");
-
- function checkIframe(frame) {
- var doc = SpecialPowers.wrap(frame).contentDocument;
-
- var authok = doc.getElementById("ok").textContent;
- var proxyok = doc.getElementById("proxy").textContent;
-
- is(authok, "PASS", "WWW Authorization OK, " + frame.id);
- is(proxyok, "PASS", "Proxy Authorization OK, " + frame.id);
- }
-
- checkIframe(iframe1Doc.getElementById("iframe1"));
- checkIframe(iframe1Doc.getElementById("iframe2"));
- checkIframe(iframe1Doc.getElementById("iframe3"));
- break;
-
- case 3:
- ok(true, "doCheck testNum 3");
- is(monitor.windowsRegistered, 1, "Registered 1 open dialog");
-
- // ensure that the page content is not displayed on failed proxy auth
- is(iframe1Doc.getElementById("ok"), null, "frame did not load");
- break;
-
- case 4:
- ok(true, "doCheck testNum 4");
- is(monitor.windowsRegistered, 2, "Registered 2 open dialogs");
- authok1 = iframe1Doc.getElementById("ok").textContent;
- proxyok1 = iframe1Doc.getElementById("proxy").textContent;
-
- is(authok1, "FAIL", "WWW Authorization FAILED, frame1");
- is(proxyok1, "PASS", "Proxy Authorization OK, frame1");
- break;
-
- case 5:
- ok(true, "doCheck testNum 5");
- is(monitor.windowsRegistered, 1, "Registered 1 open dialog");
-
- // ensure that the page content is not displayed on failed proxy auth
- is(iframe1Doc.getElementById("footnote"), null, "frame did not load");
- break;
-
- case 6:
- ok(true, "doCheck testNum 6");
- is(monitor.windowsRegistered, 2, "Registered 2 open dialogs");
- authok1 = iframe1Doc.getElementById("ok").textContent;
- proxyok1 = iframe1Doc.getElementById("proxy").textContent;
- footnote = iframe1Doc.getElementById("footnote").textContent;
-
- is(authok1, "FAIL", "WWW Authorization FAILED, frame1");
- is(proxyok1, "PASS", "Proxy Authorization OK, frame1");
- is(footnote, "This is a footnote after the huge content fill",
- "Footnote present and loaded completely");
- break;
-
- case 7:
- ok(true, "doCheck testNum 7");
- is(monitor.windowsRegistered, 1, "Registered 1 open dialogs");
- authok1 = iframe1Doc.getElementById("ok").textContent;
- proxyok1 = iframe1Doc.getElementById("proxy").textContent;
- footnote = iframe1Doc.getElementById("footnote").textContent;
-
- is(authok1, "PASS", "WWW Authorization OK, frame1");
- is(proxyok1, "PASS", "Proxy Authorization OK, frame1");
- is(footnote, "This is a footnote after the huge content fill",
- "Footnote present and loaded completely");
- break;
-
- case 8:
- ok(true, "doCheck testNum 8");
- is(monitor.windowsRegistered, 5, "Registered 5 open dialogs");
- authok1 = iframe1Doc.getElementById("ok").textContent;
- proxyok1 = iframe1Doc.getElementById("proxy").textContent;
- footnote = iframe1Doc.getElementById("footnote").textContent;
-
- is(authok1, "PASS", "WWW Authorization OK, frame1");
- is(proxyok1, "PASS", "Proxy Authorization OK, frame1");
- is(footnote, "This is a footnote after the huge content fill",
- "Footnote present and loaded completely");
- break;
-
- default:
- ok(false, "Unhandled testNum " + testNumber + " in doCheck");
- }
- }
-
- </script>
-</head>
-<body>
- <iframe id="iframe1"></iframe>
- <iframe id="iframe2a"></iframe>
- <iframe id="iframe2b"></iframe>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/test_xhr.html b/toolkit/components/passwordmgr/test/test_xhr.html
deleted file mode 100644
index 296371685..000000000
--- a/toolkit/components/passwordmgr/test/test_xhr.html
+++ /dev/null
@@ -1,201 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for XHR prompts</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: XHR prompt
-<p id="display"></p>
-
-<div id="content" style="display: none">
- <iframe id="iframe"></iframe>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: XHR prompts. **/
-var pwmgr, login1, login2;
-
-function initLogins() {
- pwmgr = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
-
- login1 = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login2 = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
-
- login1.init("http://mochi.test:8888", null, "xhr",
- "xhruser1", "xhrpass1", "", "");
- login2.init("http://mochi.test:8888", null, "xhr2",
- "xhruser2", "xhrpass2", "", "");
-
- pwmgr.addLogin(login1);
- pwmgr.addLogin(login2);
-}
-
-function finishTest() {
- ok(true, "finishTest removing testing logins...");
- pwmgr.removeLogin(login1);
- pwmgr.removeLogin(login2);
-
- SimpleTest.finish();
-}
-
-function handleDialog(doc, testNum) {
- ok(true, "handleDialog running for test " + testNum);
-
- var clickOK = true;
- var userfield = doc.getElementById("loginTextbox");
- var passfield = doc.getElementById("password1Textbox");
- var username = userfield.getAttribute("value");
- var password = passfield.getAttribute("value");
- var dialog = doc.getElementById("commonDialog");
-
- switch (testNum) {
- case 1:
- is(username, "xhruser1", "Checking provided username");
- is(password, "xhrpass1", "Checking provided password");
- break;
-
- case 2:
- is(username, "xhruser2", "Checking provided username");
- is(password, "xhrpass2", "Checking provided password");
-
- // Check that the dialog is modal, chrome and dependent;
- // We can't just check window.opener because that'll be
- // a content window, which therefore isn't exposed (it'll lie and
- // be null).
- var win = doc.defaultView;
- var Ci = SpecialPowers.Ci;
- var treeOwner = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation).
- QueryInterface(Ci.nsIDocShellTreeItem).treeOwner;
- treeOwner.QueryInterface(Ci.nsIInterfaceRequestor);
- var flags = treeOwner.getInterface(Ci.nsIXULWindow).chromeFlags;
- var wbc = treeOwner.getInterface(Ci.nsIWebBrowserChrome);
- info("Flags: " + flags);
- ok((flags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_CHROME) != 0,
- "Dialog should be opened as chrome");
- ok((flags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_DIALOG) != 0,
- "Dialog should be opened as a dialog");
- ok((flags & Ci.nsIWebBrowserChrome.CHROME_DEPENDENT) != 0,
- "Dialog should be opened as dependent.");
- ok(wbc.isWindowModal(), "Dialog should be modal");
-
- // Check that the right tab is focused:
- var browserWin = SpecialPowers.Services.wm.getMostRecentWindow("navigator:browser");
- var spec = browserWin.gBrowser.selectedBrowser.currentURI.spec;
- ok(spec.startsWith("http://mochi.test:8888"),
- "Tab with remote URI (rather than about:blank) should be focused (" + spec + ")");
-
-
- break;
-
- default:
- ok(false, "Uhh, unhandled switch for testNum #" + testNum);
- break;
- }
-
- // Explicitly cancel the dialog and report a fail in this failure
- // case, rather than letting the dialog get stuck due to an auth
- // failure and having the test timeout.
- if (!username && !password) {
- ok(false, "No values prefilled");
- clickOK = false;
- }
-
- if (clickOK)
- dialog.acceptDialog();
- else
- dialog.cancelDialog();
-
- ok(true, "handleDialog done");
- didDialog = true;
-}
-
-var newWin;
-function xhrLoad(xmlDoc) {
- ok(true, "xhrLoad running for test " + testNum);
-
- // The server echos back the user/pass it received.
- var username = xmlDoc.getElementById("user").textContent;
- var password = xmlDoc.getElementById("pass").textContent;
- var authok = xmlDoc.getElementById("ok").textContent;
-
-
- switch (testNum) {
- case 1:
- is(username, "xhruser1", "Checking provided username");
- is(password, "xhrpass1", "Checking provided password");
- break;
-
- case 2:
- is(username, "xhruser2", "Checking provided username");
- is(password, "xhrpass2", "Checking provided password");
-
- newWin.close();
- break;
-
- default:
- ok(false, "Uhh, unhandled switch for testNum #" + testNum);
- break;
- }
-
- doTest();
-}
-
-function doTest() {
- switch (++testNum) {
- case 1:
- startCallbackTimer();
- makeRequest("authenticate.sjs?user=xhruser1&pass=xhrpass1&realm=xhr");
- break;
-
- case 2:
- // Test correct parenting, by opening another tab in the foreground,
- // and making sure the prompt re-focuses the original tab when shown:
- newWin = window.open();
- newWin.focus();
- startCallbackTimer();
- makeRequest("authenticate.sjs?user=xhruser2&pass=xhrpass2&realm=xhr2");
- break;
-
- default:
- finishTest();
- }
-}
-
-function makeRequest(uri) {
- var request = new XMLHttpRequest();
- request.open("GET", uri, true);
- request.onreadystatechange = function () {
- if (request.readyState == 4)
- xhrLoad(request.responseXML);
- };
- request.send(null);
-}
-
-
-initLogins();
-
-// clear plain HTTP auth sessions before the test, to allow
-// running them more than once.
-var authMgr = SpecialPowers.Cc['@mozilla.org/network/http-auth-manager;1']
- .getService(SpecialPowers.Ci.nsIHttpAuthManager);
-authMgr.clearAll();
-
-// start the tests
-testNum = 0;
-doTest();
-
-SimpleTest.waitForExplicitFinish();
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/test_xml_load.html b/toolkit/components/passwordmgr/test/test_xml_load.html
deleted file mode 100644
index 5672c7117..000000000
--- a/toolkit/components/passwordmgr/test/test_xml_load.html
+++ /dev/null
@@ -1,191 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test XML document prompts</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="pwmgr_common.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Login Manager test: XML prompt
-<p id="display"></p>
-
-<div id="content" style="display: none">
- <iframe id="iframe"></iframe>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Login Manager: XML prompts. **/
-var pwmgr, login1, login2;
-
-function initLogins() {
- pwmgr = SpecialPowers.Cc["@mozilla.org/login-manager;1"]
- .getService(Ci.nsILoginManager);
-
- login1 = SpecialPowers.Cc["@mozilla.org/login-manager/loginInfo;1"]
- .createInstance(Ci.nsILoginInfo);
- login2 = SpecialPowers.Cc["@mozilla.org/login-manager/loginInfo;1"]
- .createInstance(Ci.nsILoginInfo);
-
- login1.init("http://mochi.test:8888", null, "xml",
- "xmluser1", "xmlpass1", "", "");
- login2.init("http://mochi.test:8888", null, "xml2",
- "xmluser2", "xmlpass2", "", "");
-
- pwmgr.addLogin(login1);
- pwmgr.addLogin(login2);
-}
-
-function handleDialog(doc, testNum) {
- ok(true, "handleDialog running for test " + testNum);
-
- var clickOK = true;
- var userfield = doc.getElementById("loginTextbox");
- var passfield = doc.getElementById("password1Textbox");
- var username = userfield.getAttribute("value");
- var password = passfield.getAttribute("value");
- var dialog = doc.getElementById("commonDialog");
-
- switch (testNum) {
- case 1:
- is(username, "xmluser1", "Checking provided username");
- is(password, "xmlpass1", "Checking provided password");
- break;
-
- case 2:
- is(username, "xmluser2", "Checking provided username");
- is(password, "xmlpass2", "Checking provided password");
-
- // Check that the dialog is modal, chrome and dependent;
- // We can't just check window.opener because that'll be
- // a content window, which therefore isn't exposed (it'll lie and
- // be null).
- var win = doc.defaultView;
- var Ci = SpecialPowers.Ci;
- var treeOwner = win.QueryInterface(Ci.nsIInterfaceRequestor).getInterface(Ci.nsIWebNavigation).
- QueryInterface(Ci.nsIDocShellTreeItem).treeOwner;
- treeOwner.QueryInterface(Ci.nsIInterfaceRequestor);
- var flags = treeOwner.getInterface(Ci.nsIXULWindow).chromeFlags;
- var wbc = treeOwner.getInterface(Ci.nsIWebBrowserChrome);
- info("Flags: " + flags);
- ok((flags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_CHROME) != 0,
- "Dialog should be opened as chrome");
- ok((flags & Ci.nsIWebBrowserChrome.CHROME_OPENAS_DIALOG) != 0,
- "Dialog should be opened as a dialog");
- ok((flags & Ci.nsIWebBrowserChrome.CHROME_DEPENDENT) != 0,
- "Dialog should be opened as dependent.");
- ok(wbc.isWindowModal(), "Dialog should be modal");
-
- // Check that the right tab is focused:
- var browserWin = SpecialPowers.Services.wm.getMostRecentWindow("navigator:browser");
- var spec = browserWin.gBrowser.selectedBrowser.currentURI.spec;
- ok(spec.startsWith("http://mochi.test:8888"),
- "Tab with remote URI (rather than about:blank) should be focused (" + spec + ")");
-
- break;
-
- default:
- ok(false, "Uhh, unhandled switch for testNum #" + testNum);
- break;
- }
-
- // Explicitly cancel the dialog and report a fail in this failure
- // case, rather than letting the dialog get stuck due to an auth
- // failure and having the test timeout.
- if (!username && !password) {
- ok(false, "No values prefilled");
- clickOK = false;
- }
-
- if (clickOK)
- dialog.acceptDialog();
- else
- dialog.cancelDialog();
-
- ok(true, "handleDialog done");
- didDialog = true;
-}
-
-var newWin;
-function xmlLoad(responseDoc) {
- ok(true, "xmlLoad running for test " + testNum);
-
- // The server echos back the user/pass it received.
- var username = responseDoc.getElementById("user").textContent;
- var password = responseDoc.getElementById("pass").textContent;
- var authok = responseDoc.getElementById("ok").textContent;
-
- switch (testNum) {
- case 1:
- is(username, "xmluser1", "Checking provided username");
- is(password, "xmlpass1", "Checking provided password");
- break;
-
- case 2:
- is(username, "xmluser2", "Checking provided username");
- is(password, "xmlpass2", "Checking provided password");
-
- newWin.close();
- break;
-
- default:
- ok(false, "Uhh, unhandled switch for testNum #" + testNum);
- break;
- }
-
- doTest();
-}
-
-function doTest() {
- switch (++testNum) {
- case 1:
- startCallbackTimer();
- makeRequest("authenticate.sjs?user=xmluser1&pass=xmlpass1&realm=xml");
- break;
-
- case 2:
- // Test correct parenting, by opening another tab in the foreground,
- // and making sure the prompt re-focuses the original tab when shown:
- newWin = window.open();
- newWin.focus();
- startCallbackTimer();
- makeRequest("authenticate.sjs?user=xmluser2&pass=xmlpass2&realm=xml2");
- break;
-
- default:
- SimpleTest.finish();
- }
-}
-
-function makeRequest(uri) {
- var xmlDoc = document.implementation.createDocument("", "test", null);
-
- function documentLoaded(e) {
- xmlLoad(xmlDoc);
- }
- xmlDoc.addEventListener("load", documentLoaded, false);
- xmlDoc.load(uri);
-}
-
-
-initLogins();
-
-// clear plain HTTP auth sessions before the test, to allow
-// running them more than once.
-var authMgr = SpecialPowers.Cc['@mozilla.org/network/http-auth-manager;1']
- .getService(SpecialPowers.Ci.nsIHttpAuthManager);
-authMgr.clearAll();
-
-// start the tests
-testNum = 0;
-doTest();
-
-SimpleTest.waitForExplicitFinish();
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/passwordmgr/test/unit/.eslintrc.js b/toolkit/components/passwordmgr/test/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/passwordmgr/test/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/passwordmgr/test/unit/data/corruptDB.sqlite b/toolkit/components/passwordmgr/test/unit/data/corruptDB.sqlite
deleted file mode 100644
index b234246ca..000000000
--- a/toolkit/components/passwordmgr/test/unit/data/corruptDB.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/passwordmgr/test/unit/data/key3.db b/toolkit/components/passwordmgr/test/unit/data/key3.db
deleted file mode 100644
index a83a0a577..000000000
--- a/toolkit/components/passwordmgr/test/unit/data/key3.db
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/passwordmgr/test/unit/data/signons-v1.sqlite b/toolkit/components/passwordmgr/test/unit/data/signons-v1.sqlite
deleted file mode 100644
index fe030b61f..000000000
--- a/toolkit/components/passwordmgr/test/unit/data/signons-v1.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/passwordmgr/test/unit/data/signons-v1v2.sqlite b/toolkit/components/passwordmgr/test/unit/data/signons-v1v2.sqlite
deleted file mode 100644
index 729512a12..000000000
--- a/toolkit/components/passwordmgr/test/unit/data/signons-v1v2.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/passwordmgr/test/unit/data/signons-v2.sqlite b/toolkit/components/passwordmgr/test/unit/data/signons-v2.sqlite
deleted file mode 100644
index a6c72b31e..000000000
--- a/toolkit/components/passwordmgr/test/unit/data/signons-v2.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/passwordmgr/test/unit/data/signons-v2v3.sqlite b/toolkit/components/passwordmgr/test/unit/data/signons-v2v3.sqlite
deleted file mode 100644
index 359df5d31..000000000
--- a/toolkit/components/passwordmgr/test/unit/data/signons-v2v3.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/passwordmgr/test/unit/data/signons-v3.sqlite b/toolkit/components/passwordmgr/test/unit/data/signons-v3.sqlite
deleted file mode 100644
index 918f4142f..000000000
--- a/toolkit/components/passwordmgr/test/unit/data/signons-v3.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/passwordmgr/test/unit/data/signons-v3v4.sqlite b/toolkit/components/passwordmgr/test/unit/data/signons-v3v4.sqlite
deleted file mode 100644
index e06c33aae..000000000
--- a/toolkit/components/passwordmgr/test/unit/data/signons-v3v4.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/passwordmgr/test/unit/data/signons-v4.sqlite b/toolkit/components/passwordmgr/test/unit/data/signons-v4.sqlite
deleted file mode 100644
index 227c09c81..000000000
--- a/toolkit/components/passwordmgr/test/unit/data/signons-v4.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/passwordmgr/test/unit/data/signons-v4v5.sqlite b/toolkit/components/passwordmgr/test/unit/data/signons-v4v5.sqlite
deleted file mode 100644
index 4534cf255..000000000
--- a/toolkit/components/passwordmgr/test/unit/data/signons-v4v5.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/passwordmgr/test/unit/data/signons-v5v6.sqlite b/toolkit/components/passwordmgr/test/unit/data/signons-v5v6.sqlite
deleted file mode 100644
index eb4ee6d01..000000000
--- a/toolkit/components/passwordmgr/test/unit/data/signons-v5v6.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/passwordmgr/test/unit/data/signons-v999-2.sqlite b/toolkit/components/passwordmgr/test/unit/data/signons-v999-2.sqlite
deleted file mode 100644
index e09c4f710..000000000
--- a/toolkit/components/passwordmgr/test/unit/data/signons-v999-2.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/passwordmgr/test/unit/data/signons-v999.sqlite b/toolkit/components/passwordmgr/test/unit/data/signons-v999.sqlite
deleted file mode 100644
index 0328a1a02..000000000
--- a/toolkit/components/passwordmgr/test/unit/data/signons-v999.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/passwordmgr/test/unit/head.js b/toolkit/components/passwordmgr/test/unit/head.js
deleted file mode 100644
index baf958ab4..000000000
--- a/toolkit/components/passwordmgr/test/unit/head.js
+++ /dev/null
@@ -1,135 +0,0 @@
-/**
- * Provides infrastructure for automated login components tests.
- */
-
-"use strict";
-
-// Globals
-
-let { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/LoginRecipes.jsm");
-Cu.import("resource://gre/modules/LoginHelper.jsm");
-Cu.import("resource://testing-common/MockDocument.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "DownloadPaths",
- "resource://gre/modules/DownloadPaths.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-
-const LoginInfo =
- Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- "nsILoginInfo", "init");
-
-// Import LoginTestUtils.jsm as LoginTestUtils.
-XPCOMUtils.defineLazyModuleGetter(this, "LoginTestUtils",
- "resource://testing-common/LoginTestUtils.jsm");
-LoginTestUtils.Assert = Assert;
-const TestData = LoginTestUtils.testData;
-const newPropertyBag = LoginHelper.newPropertyBag;
-
-/**
- * All the tests are implemented with add_task, this starts them automatically.
- */
-function run_test()
-{
- do_get_profile();
- run_next_test();
-}
-
-// Global helpers
-
-// Some of these functions are already implemented in other parts of the source
-// tree, see bug 946708 about sharing more code.
-
-// While the previous test file should have deleted all the temporary files it
-// used, on Windows these might still be pending deletion on the physical file
-// system. Thus, start from a new base number every time, to make a collision
-// with a file that is still pending deletion highly unlikely.
-let gFileCounter = Math.floor(Math.random() * 1000000);
-
-/**
- * Returns a reference to a temporary file, that is guaranteed not to exist, and
- * to have never been created before.
- *
- * @param aLeafName
- * Suggested leaf name for the file to be created.
- *
- * @return nsIFile pointing to a non-existent file in a temporary directory.
- *
- * @note It is not enough to delete the file if it exists, or to delete the file
- * after calling nsIFile.createUnique, because on Windows the delete
- * operation in the file system may still be pending, preventing a new
- * file with the same name to be created.
- */
-function getTempFile(aLeafName)
-{
- // Prepend a serial number to the extension in the suggested leaf name.
- let [base, ext] = DownloadPaths.splitBaseNameAndExtension(aLeafName);
- let leafName = base + "-" + gFileCounter + ext;
- gFileCounter++;
-
- // Get a file reference under the temporary directory for this test file.
- let file = FileUtils.getFile("TmpD", [leafName]);
- do_check_false(file.exists());
-
- do_register_cleanup(function () {
- if (file.exists()) {
- file.remove(false);
- }
- });
-
- return file;
-}
-
-const RecipeHelpers = {
- initNewParent() {
- return (new LoginRecipesParent({ defaults: null })).initializationPromise;
- },
-};
-
-// Initialization functions common to all tests
-
-add_task(function* test_common_initialize()
-{
- // Before initializing the service for the first time, we should copy the key
- // file required to decrypt the logins contained in the SQLite databases used
- // by migration tests. This file is not required for the other tests.
- yield OS.File.copy(do_get_file("data/key3.db").path,
- OS.Path.join(OS.Constants.Path.profileDir, "key3.db"));
-
- // Ensure that the service and the storage module are initialized.
- yield Services.logins.initializationPromise;
-
- // Ensure that every test file starts with an empty database.
- LoginTestUtils.clearData();
-
- // Clean up after every test.
- do_register_cleanup(() => LoginTestUtils.clearData());
-});
-
-/**
- * Compare two FormLike to see if they represent the same information. Elements
- * are compared using their @id attribute.
- */
-function formLikeEqual(a, b) {
- Assert.strictEqual(Object.keys(a).length, Object.keys(b).length,
- "Check the formLikes have the same number of properties");
-
- for (let propName of Object.keys(a)) {
- if (propName == "elements") {
- Assert.strictEqual(a.elements.length, b.elements.length, "Check element count");
- for (let i = 0; i < a.elements.length; i++) {
- Assert.strictEqual(a.elements[i].id, b.elements[i].id, "Check element " + i + " id");
- }
- continue;
- }
- Assert.strictEqual(a[propName], b[propName], "Compare formLike " + propName + " property");
- }
-}
diff --git a/toolkit/components/passwordmgr/test/unit/test_OSCrypto_win.js b/toolkit/components/passwordmgr/test/unit/test_OSCrypto_win.js
deleted file mode 100644
index 94d2e50c0..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_OSCrypto_win.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/**
- * Tests the OSCrypto object.
- */
-
-"use strict";
-
-// Globals
-
-XPCOMUtils.defineLazyModuleGetter(this, "OSCrypto",
- "resource://gre/modules/OSCrypto.jsm");
-
-var crypto = new OSCrypto();
-
-// Tests
-
-add_task(function test_getIELoginHash()
-{
- do_check_eq(crypto.getIELoginHash("https://bugzilla.mozilla.org/page.cgi"),
- "4A66FE96607885790F8E67B56EEE52AB539BAFB47D");
-
- do_check_eq(crypto.getIELoginHash("https://github.com/login"),
- "0112F7DCE67B8579EA01367678AA44AB9868B5A143");
-
- do_check_eq(crypto.getIELoginHash("https://login.live.com/login.srf"),
- "FBF92E5D804C82717A57856533B779676D92903688");
-
- do_check_eq(crypto.getIELoginHash("https://preview.c9.io/riadh/w1/pass.1.html"),
- "6935CF27628830605927F86AB53831016FC8973D1A");
-
-
- do_check_eq(crypto.getIELoginHash("https://reviewboard.mozilla.org/account/login/"),
- "09141FD287E2E59A8B1D3BB5671537FD3D6B61337A");
-
- do_check_eq(crypto.getIELoginHash("https://www.facebook.com/"),
- "EF44D3E034009CB0FD1B1D81A1FF3F3335213BD796");
-
-});
-
-add_task(function test_decryptData_encryptData()
-{
- function decryptEncryptTest(key) {
- do_check_eq(crypto.decryptData(crypto.encryptData("", key), key),
- "");
-
- do_check_eq(crypto.decryptData(crypto.encryptData("secret", key), key),
- "secret");
-
- do_check_eq(crypto.decryptData(crypto.encryptData("https://www.mozilla.org", key),
- key),
- "https://www.mozilla.org");
-
- do_check_eq(crypto.decryptData(crypto.encryptData("https://reviewboard.mozilla.org", key),
- key),
- "https://reviewboard.mozilla.org");
-
- do_check_eq(crypto.decryptData(crypto.encryptData("https://bugzilla.mozilla.org/page.cgi",
- key),
- key),
- "https://bugzilla.mozilla.org/page.cgi");
- }
-
- let keys = [null, "a", "keys", "abcdedf", "pass", "https://bugzilla.mozilla.org/page.cgi",
- "https://login.live.com/login.srf"];
- for (let key of keys) {
- decryptEncryptTest(key);
- }
- let url = "https://twitter.com/";
- let value = [1, 0, 0, 0, 208, 140, 157, 223, 1, 21, 209, 17, 140, 122, 0, 192, 79, 194, 151, 235, 1, 0, 0, 0, 254, 58, 230, 75, 132, 228, 181, 79, 184, 160, 37, 106, 201, 29, 42, 152, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 16, 102, 0, 0, 0, 1, 0, 0, 32, 0, 0, 0, 90, 136, 17, 124, 122, 57, 178, 24, 34, 86, 209, 198, 184, 107, 58, 58, 32, 98, 61, 239, 129, 101, 56, 239, 114, 159, 139, 165, 183, 40, 183, 85, 0, 0, 0, 0, 14, 128, 0, 0, 0, 2, 0, 0, 32, 0, 0, 0, 147, 170, 34, 21, 53, 227, 191, 6, 201, 84, 106, 31, 57, 227, 46, 127, 219, 199, 80, 142, 37, 104, 112, 223, 26, 165, 223, 55, 176, 89, 55, 37, 112, 0, 0, 0, 98, 70, 221, 109, 5, 152, 46, 11, 190, 213, 226, 58, 244, 20, 180, 217, 63, 155, 227, 132, 7, 151, 235, 6, 37, 232, 176, 182, 141, 191, 251, 50, 20, 123, 53, 11, 247, 233, 112, 121, 130, 27, 168, 68, 92, 144, 192, 7, 12, 239, 53, 217, 253, 155, 54, 109, 236, 216, 225, 245, 79, 234, 165, 225, 104, 36, 77, 13, 195, 237, 143, 165, 100, 107, 230, 70, 54, 19, 179, 35, 8, 101, 93, 202, 121, 210, 222, 28, 93, 122, 36, 84, 185, 249, 238, 3, 102, 149, 248, 94, 137, 16, 192, 22, 251, 220, 22, 223, 16, 58, 104, 187, 64, 0, 0, 0, 70, 72, 15, 119, 144, 66, 117, 203, 190, 82, 131, 46, 111, 130, 238, 191, 170, 63, 186, 117, 46, 88, 171, 3, 94, 146, 75, 86, 243, 159, 63, 195, 149, 25, 105, 141, 42, 217, 108, 18, 63, 62, 98, 182, 241, 195, 12, 216, 152, 230, 176, 253, 202, 129, 41, 185, 135, 111, 226, 92, 27, 78, 27, 198];
-
- let arr1 = crypto.arrayToString(value);
- let arr2 = crypto.stringToArray(crypto.decryptData(crypto.encryptData(arr1, url), url));
- for (let i = 0; i < arr1.length; i++) {
- do_check_eq(arr2[i], value[i]);
- }
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_context_menu.js b/toolkit/components/passwordmgr/test/unit/test_context_menu.js
deleted file mode 100644
index 722c13e15..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_context_menu.js
+++ /dev/null
@@ -1,165 +0,0 @@
-/*
- * Test the password manager context menu.
- */
-
-"use strict";
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/LoginManagerContextMenu.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "_stringBundle", function() {
- return Services.strings.
- createBundle("chrome://passwordmgr/locale/passwordmgr.properties");
-});
-
-/**
- * Prepare data for the following tests.
- */
-add_task(function* test_initialize() {
- for (let login of loginList()) {
- Services.logins.addLogin(login);
- }
-});
-
-/**
- * Tests if the LoginManagerContextMenu returns the correct login items.
- */
-add_task(function* test_contextMenuAddAndRemoveLogins() {
- const DOCUMENT_CONTENT = "<form><input id='pw' type=password></form>";
- const INPUT_QUERY = "input[type='password']";
-
- let testHostnames = [
- "http://www.example.com",
- "http://www2.example.com",
- "http://www3.example.com",
- "http://empty.example.com",
- ];
-
- for (let hostname of testHostnames) {
- do_print("test for hostname: " + hostname);
- // Get expected logins for this test.
- let logins = getExpectedLogins(hostname);
-
- // Create the logins menuitems fragment.
- let {fragment, document} = createLoginsFragment(hostname, DOCUMENT_CONTENT, INPUT_QUERY);
-
- if (!logins.length) {
- Assert.ok(fragment === null, "Null returned. No logins where found.");
- continue;
- }
- let items = [...fragment.querySelectorAll("menuitem")];
-
- // Check if the items are those expected to be listed.
- Assert.ok(checkLoginItems(logins, items), "All expected logins found.");
- document.body.appendChild(fragment);
-
- // Try to clear the fragment.
- LoginManagerContextMenu.clearLoginsFromMenu(document);
- Assert.equal(fragment.querySelectorAll("menuitem").length, 0, "All items correctly cleared.");
- }
-
- Services.logins.removeAllLogins();
-});
-
-/**
- * Create a fragment with a menuitem for each login.
- */
-function createLoginsFragment(url, content, elementQuery) {
- const CHROME_URL = "chrome://mock-chrome";
-
- // Create a mock document.
- let document = MockDocument.createTestDocument(CHROME_URL, content);
- let inputElement = document.querySelector(elementQuery);
- MockDocument.mockOwnerDocumentProperty(inputElement, document, url);
-
- // We also need a simple mock Browser object for this test.
- let browser = {
- ownerDocument: document
- };
-
- let URI = Services.io.newURI(url, null, null);
- return {
- document,
- fragment: LoginManagerContextMenu.addLoginsToMenu(inputElement, browser, URI),
- };
-}
-
-/**
- * Check if every login have it's corresponding menuitem.
- * Duplicates and empty usernames have a date appended.
- */
-function checkLoginItems(logins, items) {
- function findDuplicates(unfilteredLoginList) {
- var seen = new Set();
- var duplicates = new Set();
- for (let login of unfilteredLoginList) {
- if (seen.has(login.username)) {
- duplicates.add(login.username);
- }
- seen.add(login.username);
- }
- return duplicates;
- }
- let duplicates = findDuplicates(logins);
-
- let dateAndTimeFormatter = new Intl.DateTimeFormat(undefined,
- { day: "numeric", month: "short", year: "numeric" });
- for (let login of logins) {
- if (login.username && !duplicates.has(login.username)) {
- // If login is not duplicate and we can't find an item for it, fail.
- if (!items.find(item => item.label == login.username)) {
- return false;
- }
- continue;
- }
-
- let meta = login.QueryInterface(Ci.nsILoginMetaInfo);
- let time = dateAndTimeFormatter.format(new Date(meta.timePasswordChanged));
- // If login is duplicate, check if we have a login item with appended date.
- if (login.username && !items.find(item => item.label == login.username + " (" + time + ")")) {
- return false;
- }
- // If login is empty, check if we have a login item with appended date.
- if (!login.username &&
- !items.find(item => item.label == _stringBundle.GetStringFromName("noUsername") + " (" + time + ")")) {
- return false;
- }
- }
- return true;
-}
-
-/**
- * Gets the list of expected logins for a hostname.
- */
-function getExpectedLogins(hostname) {
- return Services.logins.getAllLogins().filter(entry => entry["hostname"] === hostname);
-}
-
-function loginList() {
- return [
- new LoginInfo("http://www.example.com", "http://www.example.com", null,
- "username1", "password",
- "form_field_username", "form_field_password"),
-
- new LoginInfo("http://www.example.com", "http://www.example.com", null,
- "username2", "password",
- "form_field_username", "form_field_password"),
-
- new LoginInfo("http://www2.example.com", "http://www.example.com", null,
- "username", "password",
- "form_field_username", "form_field_password"),
- new LoginInfo("http://www2.example.com", "http://www2.example.com", null,
- "username", "password2",
- "form_field_username", "form_field_password"),
- new LoginInfo("http://www2.example.com", "http://www2.example.com", null,
- "username2", "password2",
- "form_field_username", "form_field_password"),
-
- new LoginInfo("http://www3.example.com", "http://www.example.com", null,
- "", "password",
- "form_field_username", "form_field_password"),
- new LoginInfo("http://www3.example.com", "http://www3.example.com", null,
- "", "password2",
- "form_field_username", "form_field_password"),
- ];
-}
diff --git a/toolkit/components/passwordmgr/test/unit/test_dedupeLogins.js b/toolkit/components/passwordmgr/test/unit/test_dedupeLogins.js
deleted file mode 100644
index d688a6dbf..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_dedupeLogins.js
+++ /dev/null
@@ -1,284 +0,0 @@
-/*
- * Test LoginHelper.dedupeLogins
- */
-
-"use strict";
-
-Cu.import("resource://gre/modules/LoginHelper.jsm");
-
-const DOMAIN1_HTTP_TO_HTTP_U1_P1 = TestData.formLogin({
- timePasswordChanged: 3000,
- timeLastUsed: 2000,
-});
-const DOMAIN1_HTTP_TO_HTTP_U1_P2 = TestData.formLogin({
- password: "password two",
-});
-const DOMAIN1_HTTP_TO_HTTP_U2_P2 = TestData.formLogin({
- password: "password two",
- username: "username two",
-});
-const DOMAIN1_HTTPS_TO_HTTPS_U1_P1 = TestData.formLogin({
- formSubmitURL: "http://www.example.com",
- hostname: "https://www3.example.com",
- timePasswordChanged: 4000,
- timeLastUsed: 1000,
-});
-const DOMAIN1_HTTPS_TO_EMPTY_U1_P1 = TestData.formLogin({
- formSubmitURL: "",
- hostname: "https://www3.example.com",
-});
-const DOMAIN1_HTTPS_TO_EMPTYU_P1 = TestData.formLogin({
- hostname: "https://www3.example.com",
- username: "",
-});
-const DOMAIN1_HTTP_AUTH = TestData.authLogin({
- hostname: "http://www3.example.com",
-});
-const DOMAIN1_HTTPS_AUTH = TestData.authLogin({
- hostname: "https://www3.example.com",
-});
-
-
-add_task(function test_dedupeLogins() {
- // [description, expectedOutput, dedupe arg. 0, dedupe arg 1, ...]
- let testcases = [
- [
- "exact dupes",
- [DOMAIN1_HTTP_TO_HTTP_U1_P1],
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P1],
- undefined,
- [], // force no resolveBy logic to test behavior of preferring the first..
- ],
- [
- "default uniqueKeys is un + pw",
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P2],
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P2],
- undefined,
- [],
- ],
- [
- "same usernames, different passwords, dedupe username only",
- [DOMAIN1_HTTP_TO_HTTP_U1_P1],
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P2],
- ["username"],
- [],
- ],
- [
- "same un+pw, different scheme",
- [DOMAIN1_HTTP_TO_HTTP_U1_P1],
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- undefined,
- [],
- ],
- [
- "same un+pw, different scheme, reverse order",
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P1],
- undefined,
- [],
- ],
- [
- "same un+pw, different scheme, include hostname",
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- ["hostname", "username", "password"],
- [],
- ],
- [
- "empty username is not deduped with non-empty",
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTPS_TO_EMPTYU_P1],
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTPS_TO_EMPTYU_P1],
- undefined,
- [],
- ],
- [
- "empty username is deduped with same passwords",
- [DOMAIN1_HTTPS_TO_EMPTYU_P1],
- [DOMAIN1_HTTPS_TO_EMPTYU_P1, DOMAIN1_HTTP_TO_HTTP_U1_P1],
- ["password"],
- [],
- ],
- [
- "mix of form and HTTP auth",
- [DOMAIN1_HTTP_TO_HTTP_U1_P1],
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTP_AUTH],
- undefined,
- [],
- ],
- ];
-
- for (let tc of testcases) {
- let description = tc.shift();
- let expected = tc.shift();
- let actual = LoginHelper.dedupeLogins(...tc);
- Assert.strictEqual(actual.length, expected.length, `Check: ${description}`);
- for (let [i, login] of expected.entries()) {
- Assert.strictEqual(actual[i], login, `Check index ${i}`);
- }
- }
-});
-
-
-add_task(function* test_dedupeLogins_resolveBy() {
- Assert.ok(DOMAIN1_HTTP_TO_HTTP_U1_P1.timeLastUsed > DOMAIN1_HTTPS_TO_HTTPS_U1_P1.timeLastUsed,
- "Sanity check timeLastUsed difference");
- Assert.ok(DOMAIN1_HTTP_TO_HTTP_U1_P1.timePasswordChanged < DOMAIN1_HTTPS_TO_HTTPS_U1_P1.timePasswordChanged,
- "Sanity check timePasswordChanged difference");
-
- let testcases = [
- [
- "default resolveBy is timeLastUsed",
- [DOMAIN1_HTTP_TO_HTTP_U1_P1],
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P1],
- ],
- [
- "default resolveBy is timeLastUsed, reversed input",
- [DOMAIN1_HTTP_TO_HTTP_U1_P1],
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- ],
- [
- "resolveBy timeLastUsed + timePasswordChanged",
- [DOMAIN1_HTTP_TO_HTTP_U1_P1],
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P1],
- undefined,
- ["timeLastUsed", "timePasswordChanged"],
- ],
- [
- "resolveBy timeLastUsed + timePasswordChanged, reversed input",
- [DOMAIN1_HTTP_TO_HTTP_U1_P1],
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- undefined,
- ["timeLastUsed", "timePasswordChanged"],
- ],
- [
- "resolveBy timePasswordChanged",
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P1],
- undefined,
- ["timePasswordChanged"],
- ],
- [
- "resolveBy timePasswordChanged, reversed",
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- undefined,
- ["timePasswordChanged"],
- ],
- [
- "resolveBy timePasswordChanged + timeLastUsed",
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P1],
- undefined,
- ["timePasswordChanged", "timeLastUsed"],
- ],
- [
- "resolveBy timePasswordChanged + timeLastUsed, reversed",
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- undefined,
- ["timePasswordChanged", "timeLastUsed"],
- ],
- [
- "resolveBy scheme + timePasswordChanged, prefer HTTP",
- [DOMAIN1_HTTP_TO_HTTP_U1_P1],
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P1],
- undefined,
- ["scheme", "timePasswordChanged"],
- DOMAIN1_HTTP_TO_HTTP_U1_P1.hostname,
- ],
- [
- "resolveBy scheme + timePasswordChanged, prefer HTTP, reversed input",
- [DOMAIN1_HTTP_TO_HTTP_U1_P1],
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- undefined,
- ["scheme", "timePasswordChanged"],
- DOMAIN1_HTTP_TO_HTTP_U1_P1.hostname,
- ],
- [
- "resolveBy scheme + timePasswordChanged, prefer HTTPS",
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P1],
- undefined,
- ["scheme", "timePasswordChanged"],
- DOMAIN1_HTTPS_TO_HTTPS_U1_P1.hostname,
- ],
- [
- "resolveBy scheme + timePasswordChanged, prefer HTTPS, reversed input",
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- [DOMAIN1_HTTP_TO_HTTP_U1_P1, DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- undefined,
- ["scheme", "timePasswordChanged"],
- DOMAIN1_HTTPS_TO_HTTPS_U1_P1.hostname,
- ],
- [
- "resolveBy scheme HTTP auth",
- [DOMAIN1_HTTPS_AUTH],
- [DOMAIN1_HTTP_AUTH, DOMAIN1_HTTPS_AUTH],
- undefined,
- ["scheme"],
- DOMAIN1_HTTPS_AUTH.hostname,
- ],
- [
- "resolveBy scheme HTTP auth, reversed input",
- [DOMAIN1_HTTPS_AUTH],
- [DOMAIN1_HTTPS_AUTH, DOMAIN1_HTTP_AUTH],
- undefined,
- ["scheme"],
- DOMAIN1_HTTPS_AUTH.hostname,
- ],
- [
- "resolveBy scheme, empty form submit URL",
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1],
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1, DOMAIN1_HTTPS_TO_EMPTY_U1_P1],
- undefined,
- ["scheme"],
- DOMAIN1_HTTPS_TO_HTTPS_U1_P1.hostname,
- ],
- ];
-
- for (let tc of testcases) {
- let description = tc.shift();
- let expected = tc.shift();
- let actual = LoginHelper.dedupeLogins(...tc);
- Assert.strictEqual(actual.length, expected.length, `Check: ${description}`);
- for (let [i, login] of expected.entries()) {
- Assert.strictEqual(actual[i], login, `Check index ${i}`);
- }
- }
-
-});
-
-add_task(function* test_dedupeLogins_preferredOriginMissing() {
- let testcases = [
- [
- "resolveBy scheme + timePasswordChanged, missing preferredOrigin",
- /preferredOrigin/,
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P1],
- undefined,
- ["scheme", "timePasswordChanged"],
- ],
- [
- "resolveBy timePasswordChanged + scheme, missing preferredOrigin",
- /preferredOrigin/,
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P1],
- undefined,
- ["timePasswordChanged", "scheme"],
- ],
- [
- "resolveBy scheme + timePasswordChanged, empty preferredOrigin",
- /preferredOrigin/,
- [DOMAIN1_HTTPS_TO_HTTPS_U1_P1, DOMAIN1_HTTP_TO_HTTP_U1_P1],
- undefined,
- ["scheme", "timePasswordChanged"],
- "",
- ],
- ];
-
- for (let tc of testcases) {
- let description = tc.shift();
- let expectedException = tc.shift();
- Assert.throws(() => {
- LoginHelper.dedupeLogins(...tc);
- }, expectedException, `Check: ${description}`);
- }
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_disabled_hosts.js b/toolkit/components/passwordmgr/test/unit/test_disabled_hosts.js
deleted file mode 100644
index ff3b7e868..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_disabled_hosts.js
+++ /dev/null
@@ -1,196 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests getLoginSavingEnabled, setLoginSavingEnabled, and getAllDisabledHosts.
- */
-
-"use strict";
-
-// Tests
-
-/**
- * Tests setLoginSavingEnabled and getAllDisabledHosts.
- */
-add_task(function test_setLoginSavingEnabled_getAllDisabledHosts()
-{
- // Add some disabled hosts, and verify that different schemes for the same
- // domain are considered different hosts.
- let hostname1 = "http://disabled1.example.com";
- let hostname2 = "http://disabled2.example.com";
- let hostname3 = "https://disabled2.example.com";
- Services.logins.setLoginSavingEnabled(hostname1, false);
- Services.logins.setLoginSavingEnabled(hostname2, false);
- Services.logins.setLoginSavingEnabled(hostname3, false);
-
- LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(),
- [hostname1, hostname2, hostname3]);
-
- // Adding the same host twice should not result in an error.
- Services.logins.setLoginSavingEnabled(hostname2, false);
- LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(),
- [hostname1, hostname2, hostname3]);
-
- // Removing a disabled host should work.
- Services.logins.setLoginSavingEnabled(hostname2, true);
- LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(),
- [hostname1, hostname3]);
-
- // Removing the last disabled host should work.
- Services.logins.setLoginSavingEnabled(hostname1, true);
- Services.logins.setLoginSavingEnabled(hostname3, true);
- LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(),
- []);
-});
-
-/**
- * Tests setLoginSavingEnabled and getLoginSavingEnabled.
- */
-add_task(function test_setLoginSavingEnabled_getLoginSavingEnabled()
-{
- let hostname1 = "http://disabled.example.com";
- let hostname2 = "https://disabled.example.com";
-
- // Hosts should not be disabled by default.
- do_check_true(Services.logins.getLoginSavingEnabled(hostname1));
- do_check_true(Services.logins.getLoginSavingEnabled(hostname2));
-
- // Test setting initial values.
- Services.logins.setLoginSavingEnabled(hostname1, false);
- Services.logins.setLoginSavingEnabled(hostname2, true);
- do_check_false(Services.logins.getLoginSavingEnabled(hostname1));
- do_check_true(Services.logins.getLoginSavingEnabled(hostname2));
-
- // Test changing values.
- Services.logins.setLoginSavingEnabled(hostname1, true);
- Services.logins.setLoginSavingEnabled(hostname2, false);
- do_check_true(Services.logins.getLoginSavingEnabled(hostname1));
- do_check_false(Services.logins.getLoginSavingEnabled(hostname2));
-
- // Clean up.
- Services.logins.setLoginSavingEnabled(hostname2, true);
-});
-
-/**
- * Tests setLoginSavingEnabled with invalid NUL characters in the hostname.
- */
-add_task(function test_setLoginSavingEnabled_invalid_characters()
-{
- let hostname = "http://null\0X.example.com";
- Assert.throws(() => Services.logins.setLoginSavingEnabled(hostname, false),
- /Invalid hostname/);
-
- // Verify that no data was stored by the previous call.
- LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(),
- []);
-});
-
-/**
- * Tests different values of the "signon.rememberSignons" property.
- */
-add_task(function test_rememberSignons()
-{
- let hostname1 = "http://example.com";
- let hostname2 = "http://localhost";
-
- // The default value for the preference should be true.
- do_check_true(Services.prefs.getBoolPref("signon.rememberSignons"));
-
- // Hosts should not be disabled by default.
- Services.logins.setLoginSavingEnabled(hostname1, false);
- do_check_false(Services.logins.getLoginSavingEnabled(hostname1));
- do_check_true(Services.logins.getLoginSavingEnabled(hostname2));
-
- // Disable storage of saved passwords globally.
- Services.prefs.setBoolPref("signon.rememberSignons", false);
- do_register_cleanup(
- () => Services.prefs.clearUserPref("signon.rememberSignons"));
-
- // All hosts should now appear disabled.
- do_check_false(Services.logins.getLoginSavingEnabled(hostname1));
- do_check_false(Services.logins.getLoginSavingEnabled(hostname2));
-
- // The list of disabled hosts should be unaltered.
- LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(),
- [hostname1]);
-
- // Changing values with the preference set should work.
- Services.logins.setLoginSavingEnabled(hostname1, true);
- Services.logins.setLoginSavingEnabled(hostname2, false);
-
- // All hosts should still appear disabled.
- do_check_false(Services.logins.getLoginSavingEnabled(hostname1));
- do_check_false(Services.logins.getLoginSavingEnabled(hostname2));
-
- // The list of disabled hosts should have been changed.
- LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(),
- [hostname2]);
-
- // Enable storage of saved passwords again.
- Services.prefs.setBoolPref("signon.rememberSignons", true);
-
- // Hosts should now appear enabled as requested.
- do_check_true(Services.logins.getLoginSavingEnabled(hostname1));
- do_check_false(Services.logins.getLoginSavingEnabled(hostname2));
-
- // Clean up.
- Services.logins.setLoginSavingEnabled(hostname2, true);
- LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(),
- []);
-});
-
-/**
- * Tests storing disabled hosts with non-ASCII characters where IDN is supported.
- */
-add_task(function* test_storage_setLoginSavingEnabled_nonascii_IDN_is_supported()
-{
- let hostname = "http://大.net";
- let encoding = "http://xn--pss.net";
-
- // Test adding disabled host with nonascii URL (http://大.net).
- Services.logins.setLoginSavingEnabled(hostname, false);
- yield* LoginTestUtils.reloadData();
- Assert.equal(Services.logins.getLoginSavingEnabled(hostname), false);
- Assert.equal(Services.logins.getLoginSavingEnabled(encoding), false);
- LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(), [hostname]);
-
- LoginTestUtils.clearData();
-
- // Test adding disabled host with IDN ("http://xn--pss.net").
- Services.logins.setLoginSavingEnabled(encoding, false);
- yield* LoginTestUtils.reloadData();
- Assert.equal(Services.logins.getLoginSavingEnabled(hostname), false);
- Assert.equal(Services.logins.getLoginSavingEnabled(encoding), false);
- LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(), [hostname]);
-
- LoginTestUtils.clearData();
-});
-
-/**
- * Tests storing disabled hosts with non-ASCII characters where IDN is not supported.
- */
-add_task(function* test_storage_setLoginSavingEnabled_nonascii_IDN_not_supported()
-{
- let hostname = "http://√.com";
- let encoding = "http://xn--19g.com";
-
- // Test adding disabled host with nonascii URL (http://√.com).
- Services.logins.setLoginSavingEnabled(hostname, false);
- yield* LoginTestUtils.reloadData();
- Assert.equal(Services.logins.getLoginSavingEnabled(hostname), false);
- Assert.equal(Services.logins.getLoginSavingEnabled(encoding), false);
- LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(), [encoding]);
-
- LoginTestUtils.clearData();
-
- // Test adding disabled host with IDN ("http://xn--19g.com").
- Services.logins.setLoginSavingEnabled(encoding, false);
- yield* LoginTestUtils.reloadData();
- Assert.equal(Services.logins.getLoginSavingEnabled(hostname), false);
- Assert.equal(Services.logins.getLoginSavingEnabled(encoding), false);
- LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(), [encoding]);
-
- LoginTestUtils.clearData();
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_getFormFields.js b/toolkit/components/passwordmgr/test/unit/test_getFormFields.js
deleted file mode 100644
index 46912ab8f..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_getFormFields.js
+++ /dev/null
@@ -1,147 +0,0 @@
-/*
- * Test for LoginManagerContent._getFormFields.
- */
-
-"use strict";
-
-// Services.prefs.setBoolPref("signon.debug", true);
-
-Cu.importGlobalProperties(["URL"]);
-
-const LMCBackstagePass = Cu.import("resource://gre/modules/LoginManagerContent.jsm");
-const { LoginManagerContent, LoginFormFactory } = LMCBackstagePass;
-const TESTCASES = [
- {
- description: "1 password field outside of a <form>",
- document: `<input id="pw1" type=password>`,
- returnedFieldIDs: [null, "pw1", null],
- skipEmptyFields: undefined,
- },
- {
- description: "1 text field outside of a <form> without a password field",
- document: `<input id="un1">`,
- returnedFieldIDs: [null, null, null],
- skipEmptyFields: undefined,
- },
- {
- description: "1 username & password field outside of a <form>",
- document: `<input id="un1">
- <input id="pw1" type=password>`,
- returnedFieldIDs: ["un1", "pw1", null],
- skipEmptyFields: undefined,
- },
- {
- description: "1 username & password field in a <form>",
- document: `<form>
- <input id="un1">
- <input id="pw1" type=password>
- </form>`,
- returnedFieldIDs: ["un1", "pw1", null],
- skipEmptyFields: undefined,
- },
- {
- description: "4 empty password fields outside of a <form>",
- document: `<input id="pw1" type=password>
- <input id="pw2" type=password>
- <input id="pw3" type=password>
- <input id="pw4" type=password>`,
- returnedFieldIDs: [null, null, null],
- skipEmptyFields: undefined,
- },
- {
- description: "4 password fields outside of a <form> (1 empty, 3 full) with skipEmpty",
- document: `<input id="pw1" type=password>
- <input id="pw2" type=password value="pass2">
- <input id="pw3" type=password value="pass3">
- <input id="pw4" type=password value="pass4">`,
- returnedFieldIDs: [null, null, null],
- skipEmptyFields: true,
- },
- {
- description: "Form with 1 password field",
- document: `<form><input id="pw1" type=password></form>`,
- returnedFieldIDs: [null, "pw1", null],
- skipEmptyFields: undefined,
- },
- {
- description: "Form with 2 password fields",
- document: `<form><input id="pw1" type=password><input id='pw2' type=password></form>`,
- returnedFieldIDs: [null, "pw1", null],
- skipEmptyFields: undefined,
- },
- {
- description: "1 password field in a form, 1 outside (not processed)",
- document: `<form><input id="pw1" type=password></form><input id="pw2" type=password>`,
- returnedFieldIDs: [null, "pw1", null],
- skipEmptyFields: undefined,
- },
- {
- description: "1 password field in a form, 1 text field outside (not processed)",
- document: `<form><input id="pw1" type=password></form><input>`,
- returnedFieldIDs: [null, "pw1", null],
- skipEmptyFields: undefined,
- },
- {
- description: "1 text field in a form, 1 password field outside (not processed)",
- document: `<form><input></form><input id="pw1" type=password>`,
- returnedFieldIDs: [null, null, null],
- skipEmptyFields: undefined,
- },
- {
- description: "2 password fields outside of a <form> with 1 linked via @form",
- document: `<input id="pw1" type=password><input id="pw2" type=password form='form1'>
- <form id="form1"></form>`,
- returnedFieldIDs: [null, "pw1", null],
- skipEmptyFields: undefined,
- },
- {
- description: "2 password fields outside of a <form> with 1 linked via @form + skipEmpty",
- document: `<input id="pw1" type=password><input id="pw2" type=password form="form1">
- <form id="form1"></form>`,
- returnedFieldIDs: [null, null, null],
- skipEmptyFields: true,
- },
- {
- description: "2 password fields outside of a <form> with 1 linked via @form + skipEmpty with 1 empty",
- document: `<input id="pw1" type=password value="pass1"><input id="pw2" type=password form="form1">
- <form id="form1"></form>`,
- returnedFieldIDs: [null, "pw1", null],
- skipEmptyFields: true,
- },
-];
-
-for (let tc of TESTCASES) {
- do_print("Sanity checking the testcase: " + tc.description);
-
- (function() {
- let testcase = tc;
- add_task(function*() {
- do_print("Starting testcase: " + testcase.description);
- let document = MockDocument.createTestDocument("http://localhost:8080/test/",
- testcase.document);
-
- let input = document.querySelector("input");
- MockDocument.mockOwnerDocumentProperty(input, document, "http://localhost:8080/test/");
-
- let formLike = LoginFormFactory.createFromField(input);
-
- let actual = LoginManagerContent._getFormFields(formLike,
- testcase.skipEmptyFields,
- new Set());
-
- Assert.strictEqual(testcase.returnedFieldIDs.length, 3,
- "_getFormFields returns 3 elements");
-
- for (let i = 0; i < testcase.returnedFieldIDs.length; i++) {
- let expectedID = testcase.returnedFieldIDs[i];
- if (expectedID === null) {
- Assert.strictEqual(actual[i], expectedID,
- "Check returned field " + i + " is null");
- } else {
- Assert.strictEqual(actual[i].id, expectedID,
- "Check returned field " + i + " ID");
- }
- }
- });
- })();
-}
diff --git a/toolkit/components/passwordmgr/test/unit/test_getPasswordFields.js b/toolkit/components/passwordmgr/test/unit/test_getPasswordFields.js
deleted file mode 100644
index 08fa422ab..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_getPasswordFields.js
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Test for LoginManagerContent._getPasswordFields using LoginFormFactory.
- */
-
-"use strict";
-
-const LMCBackstagePass = Cu.import("resource://gre/modules/LoginManagerContent.jsm");
-const { LoginManagerContent, LoginFormFactory } = LMCBackstagePass;
-const TESTCASES = [
- {
- description: "Empty document",
- document: ``,
- returnedFieldIDsByFormLike: [],
- skipEmptyFields: undefined,
- },
- {
- description: "Non-password input with no <form> present",
- document: `<input>`,
- // Only the IDs of password fields should be in this array
- returnedFieldIDsByFormLike: [[]],
- skipEmptyFields: undefined,
- },
- {
- description: "1 password field outside of a <form>",
- document: `<input id="pw1" type=password>`,
- returnedFieldIDsByFormLike: [["pw1"]],
- skipEmptyFields: undefined,
- },
- {
- description: "4 empty password fields outside of a <form>",
- document: `<input id="pw1" type=password>
- <input id="pw2" type=password>
- <input id="pw3" type=password>
- <input id="pw4" type=password>`,
- returnedFieldIDsByFormLike: [[]],
- skipEmptyFields: undefined,
- },
- {
- description: "4 password fields outside of a <form> (1 empty, 3 full) with skipEmpty",
- document: `<input id="pw1" type=password>
- <input id="pw2" type=password value="pass2">
- <input id="pw3" type=password value="pass3">
- <input id="pw4" type=password value="pass4">`,
- returnedFieldIDsByFormLike: [["pw2", "pw3", "pw4"]],
- skipEmptyFields: true,
- },
- {
- description: "Form with 1 password field",
- document: `<form><input id="pw1" type=password></form>`,
- returnedFieldIDsByFormLike: [["pw1"]],
- skipEmptyFields: undefined,
- },
- {
- description: "Form with 2 password fields",
- document: `<form><input id="pw1" type=password><input id='pw2' type=password></form>`,
- returnedFieldIDsByFormLike: [["pw1", "pw2"]],
- skipEmptyFields: undefined,
- },
- {
- description: "1 password field in a form, 1 outside",
- document: `<form><input id="pw1" type=password></form><input id="pw2" type=password>`,
- returnedFieldIDsByFormLike: [["pw1"], ["pw2"]],
- skipEmptyFields: undefined,
- },
- {
- description: "2 password fields outside of a <form> with 1 linked via @form",
- document: `<input id="pw1" type=password><input id="pw2" type=password form='form1'>
- <form id="form1"></form>`,
- returnedFieldIDsByFormLike: [["pw1"], ["pw2"]],
- skipEmptyFields: undefined,
- },
- {
- description: "2 password fields outside of a <form> with 1 linked via @form + skipEmpty",
- document: `<input id="pw1" type=password><input id="pw2" type=password form="form1">
- <form id="form1"></form>`,
- returnedFieldIDsByFormLike: [[], []],
- skipEmptyFields: true,
- },
- {
- description: "skipEmptyFields should also skip white-space only fields",
- document: `<input id="pw-space" type=password value=" ">
- <input id="pw-tab" type=password value=" ">
- <input id="pw-newline" type=password form="form1" value="
-">
- <form id="form1"></form>`,
- returnedFieldIDsByFormLike: [[], []],
- skipEmptyFields: true,
- },
- {
- description: "2 password fields outside of a <form> with 1 linked via @form + skipEmpty with 1 empty",
- document: `<input id="pw1" type=password value=" pass1 "><input id="pw2" type=password form="form1">
- <form id="form1"></form>`,
- returnedFieldIDsByFormLike: [["pw1"], []],
- skipEmptyFields: true,
- },
-];
-
-for (let tc of TESTCASES) {
- do_print("Sanity checking the testcase: " + tc.description);
-
- (function() {
- let testcase = tc;
- add_task(function*() {
- do_print("Starting testcase: " + testcase.description);
- let document = MockDocument.createTestDocument("http://localhost:8080/test/",
- testcase.document);
-
- let mapRootElementToFormLike = new Map();
- for (let input of document.querySelectorAll("input")) {
- let formLike = LoginFormFactory.createFromField(input);
- let existingFormLike = mapRootElementToFormLike.get(formLike.rootElement);
- if (!existingFormLike) {
- mapRootElementToFormLike.set(formLike.rootElement, formLike);
- continue;
- }
-
- // If the formLike is already present, ensure that the properties are the same.
- do_print("Checking if the new FormLike for the same root has the same properties");
- formLikeEqual(formLike, existingFormLike);
- }
-
- Assert.strictEqual(mapRootElementToFormLike.size, testcase.returnedFieldIDsByFormLike.length,
- "Check the correct number of different formLikes were returned");
-
- let formLikeIndex = -1;
- for (let formLikeFromInput of mapRootElementToFormLike.values()) {
- formLikeIndex++;
- let pwFields = LoginManagerContent._getPasswordFields(formLikeFromInput,
- testcase.skipEmptyFields);
-
- if (formLikeFromInput.rootElement instanceof Ci.nsIDOMHTMLFormElement) {
- let formLikeFromForm = LoginFormFactory.createFromForm(formLikeFromInput.rootElement);
- do_print("Checking that the FormLike created for the <form> matches" +
- " the one from a password field");
- formLikeEqual(formLikeFromInput, formLikeFromForm);
- }
-
-
- if (testcase.returnedFieldIDsByFormLike[formLikeIndex].length === 0) {
- Assert.strictEqual(pwFields, null,
- "If no password fields were found null should be returned");
- } else {
- Assert.strictEqual(pwFields.length,
- testcase.returnedFieldIDsByFormLike[formLikeIndex].length,
- "Check the # of password fields for formLike #" + formLikeIndex);
- }
-
- for (let i = 0; i < testcase.returnedFieldIDsByFormLike[formLikeIndex].length; i++) {
- let expectedID = testcase.returnedFieldIDsByFormLike[formLikeIndex][i];
- Assert.strictEqual(pwFields[i].element.id, expectedID,
- "Check password field " + i + " ID");
- }
- }
- });
- })();
-}
diff --git a/toolkit/components/passwordmgr/test/unit/test_getPasswordOrigin.js b/toolkit/components/passwordmgr/test/unit/test_getPasswordOrigin.js
deleted file mode 100644
index f2773ec62..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_getPasswordOrigin.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Test for LoginUtils._getPasswordOrigin
- */
-
-"use strict";
-
-const LMCBackstagePass = Cu.import("resource://gre/modules/LoginManagerContent.jsm");
-const TESTCASES = [
- ["javascript:void(0);", null],
- ["javascript:void(0);", "javascript:", true],
- ["chrome://MyAccount", null],
- ["data:text/html,example", null],
- ["http://username:password@example.com:80/foo?bar=baz#fragment", "http://example.com", true],
- ["http://127.0.0.1:80/foo", "http://127.0.0.1"],
- ["http://[::1]:80/foo", "http://[::1]"],
- ["http://example.com:8080/foo", "http://example.com:8080"],
- ["http://127.0.0.1:8080/foo", "http://127.0.0.1:8080", true],
- ["http://[::1]:8080/foo", "http://[::1]:8080"],
- ["https://example.com:443/foo", "https://example.com"],
- ["https://[::1]:443/foo", "https://[::1]"],
- ["https://[::1]:8443/foo", "https://[::1]:8443"],
- ["ftp://username:password@[::1]:2121/foo", "ftp://[::1]:2121"],
-];
-
-for (let [input, expected, allowJS] of TESTCASES) {
- let actual = LMCBackstagePass.LoginUtils._getPasswordOrigin(input, allowJS);
- Assert.strictEqual(actual, expected, "Checking: " + input);
-}
diff --git a/toolkit/components/passwordmgr/test/unit/test_isOriginMatching.js b/toolkit/components/passwordmgr/test/unit/test_isOriginMatching.js
deleted file mode 100644
index 660910dff..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_isOriginMatching.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * Test LoginHelper.isOriginMatching
- */
-
-"use strict";
-
-Cu.import("resource://gre/modules/LoginHelper.jsm");
-
-add_task(function test_isOriginMatching() {
- let testcases = [
- // Index 0 holds the expected return value followed by arguments to isOriginMatching.
- [true, "http://example.com", "http://example.com"],
- [true, "http://example.com:8080", "http://example.com:8080"],
- [true, "https://example.com", "https://example.com"],
- [true, "https://example.com:8443", "https://example.com:8443"],
- [false, "http://example.com", "http://mozilla.org"],
- [false, "http://example.com", "http://example.com:8080"],
- [false, "https://example.com", "http://example.com"],
- [false, "https://example.com", "https://mozilla.org"],
- [false, "http://example.com", "http://sub.example.com"],
- [false, "https://example.com", "https://sub.example.com"],
- [false, "http://example.com", "https://example.com:8443"],
- [false, "http://example.com:8080", "http://example.com:8081"],
- [false, "http://example.com", ""],
- [false, "", "http://example.com"],
- [true, "http://example.com", "https://example.com", { schemeUpgrades: true }],
- [true, "https://example.com", "https://example.com", { schemeUpgrades: true }],
- [true, "http://example.com:8080", "http://example.com:8080", { schemeUpgrades: true }],
- [true, "https://example.com:8443", "https://example.com:8443", { schemeUpgrades: true }],
- [false, "https://example.com", "http://example.com", { schemeUpgrades: true }], // downgrade
- [false, "http://example.com:8080", "https://example.com", { schemeUpgrades: true }], // port mismatch
- [false, "http://example.com", "https://example.com:8443", { schemeUpgrades: true }], // port mismatch
- [false, "http://sub.example.com", "http://example.com", { schemeUpgrades: true }],
- ];
- for (let tc of testcases) {
- let expected = tc.shift();
- Assert.strictEqual(LoginHelper.isOriginMatching(...tc), expected,
- "Check " + JSON.stringify(tc));
- }
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_legacy_empty_formSubmitURL.js b/toolkit/components/passwordmgr/test/unit/test_legacy_empty_formSubmitURL.js
deleted file mode 100644
index 4e16aa267..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_legacy_empty_formSubmitURL.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the legacy case of a login store containing entries that have an empty
- * string in the formSubmitURL field.
- *
- * In normal conditions, for the purpose of login autocomplete, HTML forms are
- * identified using both the prePath of the URI on which they are located, and
- * the prePath of the URI where the data will be submitted. This is represented
- * by the hostname and formSubmitURL properties of the stored nsILoginInfo.
- *
- * When a new login for use in forms is saved (after the user replies to the
- * password prompt), it is always stored with both the hostname and the
- * formSubmitURL (that will be equal to the hostname when the form has no
- * "action" attribute).
- *
- * When the same form is displayed again, the password is autocompleted. If
- * there is another form on the same site that submits to a different site, it
- * is considered a different form, so the password is not autocompleted, but a
- * new password can be stored for the other form.
- *
- * However, the login database might contain data for an nsILoginInfo that has a
- * valid hostname, but an empty formSubmitURL. This means that the login
- * applies to all forms on the site, regardless of where they submit data to.
- *
- * A site can have at most one such login, and in case it is present, then it is
- * not possible to store separate logins for forms on the same site that submit
- * data to different sites.
- *
- * The only way to have such condition is to be using logins that were initially
- * saved by a very old version of the browser, or because of data manually added
- * by an extension in an old version.
- */
-
-"use strict";
-
-// Tests
-
-/**
- * Adds a login with an empty formSubmitURL, then it verifies that no other
- * form logins can be added for the same host.
- */
-add_task(function test_addLogin_wildcard()
-{
- let loginInfo = TestData.formLogin({ hostname: "http://any.example.com",
- formSubmitURL: "" });
- Services.logins.addLogin(loginInfo);
-
- // Normal form logins cannot be added anymore.
- loginInfo = TestData.formLogin({ hostname: "http://any.example.com" });
- Assert.throws(() => Services.logins.addLogin(loginInfo), /already exists/);
-
- // Authentication logins can still be added.
- loginInfo = TestData.authLogin({ hostname: "http://any.example.com" });
- Services.logins.addLogin(loginInfo);
-
- // Form logins can be added for other hosts.
- loginInfo = TestData.formLogin({ hostname: "http://other.example.com" });
- Services.logins.addLogin(loginInfo);
-});
-
-/**
- * Verifies that findLogins, searchLogins, and countLogins include all logins
- * that have an empty formSubmitURL in the store, even when a formSubmitURL is
- * specified.
- */
-add_task(function test_search_all_wildcard()
-{
- // Search a given formSubmitURL on any host.
- let matchData = newPropertyBag({ formSubmitURL: "http://www.example.com" });
- do_check_eq(Services.logins.searchLogins({}, matchData).length, 2);
-
- do_check_eq(Services.logins.findLogins({}, "", "http://www.example.com",
- null).length, 2);
-
- do_check_eq(Services.logins.countLogins("", "http://www.example.com",
- null), 2);
-
- // Restrict the search to one host.
- matchData.setProperty("hostname", "http://any.example.com");
- do_check_eq(Services.logins.searchLogins({}, matchData).length, 1);
-
- do_check_eq(Services.logins.findLogins({}, "http://any.example.com",
- "http://www.example.com",
- null).length, 1);
-
- do_check_eq(Services.logins.countLogins("http://any.example.com",
- "http://www.example.com",
- null), 1);
-});
-
-/**
- * Verifies that specifying an empty string for formSubmitURL in searchLogins
- * includes only logins that have an empty formSubmitURL in the store.
- */
-add_task(function test_searchLogins_wildcard()
-{
- let logins = Services.logins.searchLogins({},
- newPropertyBag({ formSubmitURL: "" }));
-
- let loginInfo = TestData.formLogin({ hostname: "http://any.example.com",
- formSubmitURL: "" });
- LoginTestUtils.assertLoginListsEqual(logins, [loginInfo]);
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_legacy_validation.js b/toolkit/components/passwordmgr/test/unit/test_legacy_validation.js
deleted file mode 100644
index 709bc9818..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_legacy_validation.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the legacy validation made when storing nsILoginInfo or disabled hosts.
- *
- * These rules exist because of limitations of the "signons.txt" storage file,
- * that is not used anymore. They are still enforced by the Login Manager
- * service, despite these values can now be safely stored in the back-end.
- */
-
-"use strict";
-
-// Tests
-
-/**
- * Tests legacy validation with addLogin.
- */
-add_task(function test_addLogin_invalid_characters_legacy()
-{
- // Test newlines and carriage returns in properties that contain URLs.
- for (let testValue of ["http://newline\n.example.com",
- "http://carriagereturn.example.com\r"]) {
- let loginInfo = TestData.formLogin({ hostname: testValue });
- Assert.throws(() => Services.logins.addLogin(loginInfo),
- /login values can't contain newlines/);
-
- loginInfo = TestData.formLogin({ formSubmitURL: testValue });
- Assert.throws(() => Services.logins.addLogin(loginInfo),
- /login values can't contain newlines/);
-
- loginInfo = TestData.authLogin({ httpRealm: testValue });
- Assert.throws(() => Services.logins.addLogin(loginInfo),
- /login values can't contain newlines/);
- }
-
- // Test newlines and carriage returns in form field names.
- for (let testValue of ["newline_field\n", "carriagereturn\r_field"]) {
- let loginInfo = TestData.formLogin({ usernameField: testValue });
- Assert.throws(() => Services.logins.addLogin(loginInfo),
- /login values can't contain newlines/);
-
- loginInfo = TestData.formLogin({ passwordField: testValue });
- Assert.throws(() => Services.logins.addLogin(loginInfo),
- /login values can't contain newlines/);
- }
-
- // Test a single dot as the value of usernameField and formSubmitURL.
- let loginInfo = TestData.formLogin({ usernameField: "." });
- Assert.throws(() => Services.logins.addLogin(loginInfo),
- /login values can't be periods/);
-
- loginInfo = TestData.formLogin({ formSubmitURL: "." });
- Assert.throws(() => Services.logins.addLogin(loginInfo),
- /login values can't be periods/);
-
- // Test the sequence " (" inside the value of the "hostname" property.
- loginInfo = TestData.formLogin({ hostname: "http://parens (.example.com" });
- Assert.throws(() => Services.logins.addLogin(loginInfo),
- /bad parens in hostname/);
-});
-
-/**
- * Tests legacy validation with setLoginSavingEnabled.
- */
-add_task(function test_setLoginSavingEnabled_invalid_characters_legacy()
-{
- for (let hostname of ["http://newline\n.example.com",
- "http://carriagereturn.example.com\r",
- "."]) {
- Assert.throws(() => Services.logins.setLoginSavingEnabled(hostname, false),
- /Invalid hostname/);
- }
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_logins_change.js b/toolkit/components/passwordmgr/test/unit/test_logins_change.js
deleted file mode 100644
index 79c6d2f54..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_logins_change.js
+++ /dev/null
@@ -1,384 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests methods that add, remove, and modify logins.
- */
-
-"use strict";
-
-// Globals
-
-/**
- * Verifies that the specified login is considered invalid by addLogin and by
- * modifyLogin with both nsILoginInfo and nsIPropertyBag arguments.
- *
- * This test requires that the login store is empty.
- *
- * @param aLoginInfo
- * nsILoginInfo corresponding to an invalid login.
- * @param aExpectedError
- * This argument is passed to the "Assert.throws" test to determine which
- * error is expected from the modification functions.
- */
-function checkLoginInvalid(aLoginInfo, aExpectedError)
-{
- // Try to add the new login, and verify that no data is stored.
- Assert.throws(() => Services.logins.addLogin(aLoginInfo), aExpectedError);
- LoginTestUtils.checkLogins([]);
-
- // Add a login for the modification tests.
- let testLogin = TestData.formLogin({ hostname: "http://modify.example.com" });
- Services.logins.addLogin(testLogin);
-
- // Try to modify the existing login using nsILoginInfo and nsIPropertyBag.
- Assert.throws(() => Services.logins.modifyLogin(testLogin, aLoginInfo),
- aExpectedError);
- Assert.throws(() => Services.logins.modifyLogin(testLogin, newPropertyBag({
- hostname: aLoginInfo.hostname,
- formSubmitURL: aLoginInfo.formSubmitURL,
- httpRealm: aLoginInfo.httpRealm,
- username: aLoginInfo.username,
- password: aLoginInfo.password,
- usernameField: aLoginInfo.usernameField,
- passwordField: aLoginInfo.passwordField,
- })), aExpectedError);
-
- // Verify that no data was stored by the previous calls.
- LoginTestUtils.checkLogins([testLogin]);
- Services.logins.removeLogin(testLogin);
-}
-
-/**
- * Verifies that two objects are not the same instance
- * but have equal attributes.
- *
- * @param {Object} objectA
- * An object to compare.
- *
- * @param {Object} objectB
- * Another object to compare.
- *
- * @param {string[]} attributes
- * Attributes to compare.
- *
- * @return true if all passed attributes are equal for both objects, false otherwise.
- */
-function compareAttributes(objectA, objectB, attributes) {
- // If it's the same object, we want to return false.
- if (objectA == objectB) {
- return false;
- }
- return attributes.every(attr => objectA[attr] == objectB[attr]);
-}
-
-// Tests
-
-/**
- * Tests that adding logins to the database works.
- */
-add_task(function test_addLogin_removeLogin()
-{
- // Each login from the test data should be valid and added to the list.
- for (let loginInfo of TestData.loginList()) {
- Services.logins.addLogin(loginInfo);
- }
- LoginTestUtils.checkLogins(TestData.loginList());
-
- // Trying to add each login again should result in an error.
- for (let loginInfo of TestData.loginList()) {
- Assert.throws(() => Services.logins.addLogin(loginInfo), /already exists/);
- }
-
- // Removing each login should succeed.
- for (let loginInfo of TestData.loginList()) {
- Services.logins.removeLogin(loginInfo);
- }
-
- LoginTestUtils.checkLogins([]);
-});
-
-/**
- * Tests invalid combinations of httpRealm and formSubmitURL.
- *
- * For an nsILoginInfo to be valid for storage, one of the two properties should
- * be strictly equal to null, and the other must not be null or an empty string.
- *
- * The legacy case of an empty string in formSubmitURL and a null value in
- * httpRealm is also supported for storage at the moment.
- */
-add_task(function test_invalid_httpRealm_formSubmitURL()
-{
- // httpRealm === null, formSubmitURL === null
- checkLoginInvalid(TestData.formLogin({ formSubmitURL: null }),
- /without a httpRealm or formSubmitURL/);
-
- // httpRealm === "", formSubmitURL === null
- checkLoginInvalid(TestData.authLogin({ httpRealm: "" }),
- /without a httpRealm or formSubmitURL/);
-
- // httpRealm === null, formSubmitURL === ""
- // This is not enforced for now.
- // checkLoginInvalid(TestData.formLogin({ formSubmitURL: "" }),
- // /without a httpRealm or formSubmitURL/);
-
- // httpRealm === "", formSubmitURL === ""
- checkLoginInvalid(TestData.formLogin({ formSubmitURL: "", httpRealm: "" }),
- /both a httpRealm and formSubmitURL/);
-
- // !!httpRealm, !!formSubmitURL
- checkLoginInvalid(TestData.formLogin({ httpRealm: "The HTTP Realm" }),
- /both a httpRealm and formSubmitURL/);
-
- // httpRealm === "", !!formSubmitURL
- checkLoginInvalid(TestData.formLogin({ httpRealm: "" }),
- /both a httpRealm and formSubmitURL/);
-
- // !!httpRealm, formSubmitURL === ""
- checkLoginInvalid(TestData.authLogin({ formSubmitURL: "" }),
- /both a httpRealm and formSubmitURL/);
-});
-
-/**
- * Tests null or empty values in required login properties.
- */
-add_task(function test_missing_properties()
-{
- checkLoginInvalid(TestData.formLogin({ hostname: null }),
- /null or empty hostname/);
-
- checkLoginInvalid(TestData.formLogin({ hostname: "" }),
- /null or empty hostname/);
-
- checkLoginInvalid(TestData.formLogin({ username: null }),
- /null username/);
-
- checkLoginInvalid(TestData.formLogin({ password: null }),
- /null or empty password/);
-
- checkLoginInvalid(TestData.formLogin({ password: "" }),
- /null or empty password/);
-});
-
-/**
- * Tests invalid NUL characters in nsILoginInfo properties.
- */
-add_task(function test_invalid_characters()
-{
- let loginList = [
- TestData.authLogin({ hostname: "http://null\0X.example.com" }),
- TestData.authLogin({ httpRealm: "realm\0" }),
- TestData.formLogin({ formSubmitURL: "http://null\0X.example.com" }),
- TestData.formLogin({ usernameField: "field\0_null" }),
- TestData.formLogin({ usernameField: ".\0" }), // Special single dot case
- TestData.formLogin({ passwordField: "field\0_null" }),
- TestData.formLogin({ username: "user\0name" }),
- TestData.formLogin({ password: "pass\0word" }),
- ];
- for (let loginInfo of loginList) {
- checkLoginInvalid(loginInfo, /login values can't contain nulls/);
- }
-});
-
-/**
- * Tests removing a login that does not exists.
- */
-add_task(function test_removeLogin_nonexisting()
-{
- Assert.throws(() => Services.logins.removeLogin(TestData.formLogin()),
- /No matching logins/);
-});
-
-/**
- * Tests removing all logins at once.
- */
-add_task(function test_removeAllLogins()
-{
- for (let loginInfo of TestData.loginList()) {
- Services.logins.addLogin(loginInfo);
- }
- Services.logins.removeAllLogins();
- LoginTestUtils.checkLogins([]);
-
- // The function should also work when there are no logins to delete.
- Services.logins.removeAllLogins();
-});
-
-/**
- * Tests the modifyLogin function with an nsILoginInfo argument.
- */
-add_task(function test_modifyLogin_nsILoginInfo()
-{
- let loginInfo = TestData.formLogin();
- let updatedLoginInfo = TestData.formLogin({
- username: "new username",
- password: "new password",
- usernameField: "new_form_field_username",
- passwordField: "new_form_field_password",
- });
- let differentLoginInfo = TestData.authLogin();
-
- // Trying to modify a login that does not exist should throw.
- Assert.throws(() => Services.logins.modifyLogin(loginInfo, updatedLoginInfo),
- /No matching logins/);
-
- // Add the first form login, then modify it to match the second.
- Services.logins.addLogin(loginInfo);
- Services.logins.modifyLogin(loginInfo, updatedLoginInfo);
-
- // The data should now match the second login.
- LoginTestUtils.checkLogins([updatedLoginInfo]);
- Assert.throws(() => Services.logins.modifyLogin(loginInfo, updatedLoginInfo),
- /No matching logins/);
-
- // The login can be changed to have a different type and hostname.
- Services.logins.modifyLogin(updatedLoginInfo, differentLoginInfo);
- LoginTestUtils.checkLogins([differentLoginInfo]);
-
- // It is now possible to add a login with the old type and hostname.
- Services.logins.addLogin(loginInfo);
- LoginTestUtils.checkLogins([loginInfo, differentLoginInfo]);
-
- // Modifying a login to match an existing one should not be possible.
- Assert.throws(
- () => Services.logins.modifyLogin(loginInfo, differentLoginInfo),
- /already exists/);
- LoginTestUtils.checkLogins([loginInfo, differentLoginInfo]);
-
- LoginTestUtils.clearData();
-});
-
-/**
- * Tests the modifyLogin function with an nsIPropertyBag argument.
- */
-add_task(function test_modifyLogin_nsIProperyBag()
-{
- let loginInfo = TestData.formLogin();
- let updatedLoginInfo = TestData.formLogin({
- username: "new username",
- password: "new password",
- usernameField: "",
- passwordField: "new_form_field_password",
- });
- let differentLoginInfo = TestData.authLogin();
- let differentLoginProperties = newPropertyBag({
- hostname: differentLoginInfo.hostname,
- formSubmitURL: differentLoginInfo.formSubmitURL,
- httpRealm: differentLoginInfo.httpRealm,
- username: differentLoginInfo.username,
- password: differentLoginInfo.password,
- usernameField: differentLoginInfo.usernameField,
- passwordField: differentLoginInfo.passwordField,
- });
-
- // Trying to modify a login that does not exist should throw.
- Assert.throws(() => Services.logins.modifyLogin(loginInfo, newPropertyBag()),
- /No matching logins/);
-
- // Add the first form login, then modify it to match the second, changing
- // only some of its properties and checking the behavior with an empty string.
- Services.logins.addLogin(loginInfo);
- Services.logins.modifyLogin(loginInfo, newPropertyBag({
- username: "new username",
- password: "new password",
- usernameField: "",
- passwordField: "new_form_field_password",
- }));
-
- // The data should now match the second login.
- LoginTestUtils.checkLogins([updatedLoginInfo]);
- Assert.throws(() => Services.logins.modifyLogin(loginInfo, newPropertyBag()),
- /No matching logins/);
-
- // It is also possible to provide no properties to be modified.
- Services.logins.modifyLogin(updatedLoginInfo, newPropertyBag());
-
- // Specifying a null property for a required value should throw.
- Assert.throws(() => Services.logins.modifyLogin(loginInfo, newPropertyBag({
- usernameField: null,
- })));
-
- // The login can be changed to have a different type and hostname.
- Services.logins.modifyLogin(updatedLoginInfo, differentLoginProperties);
- LoginTestUtils.checkLogins([differentLoginInfo]);
-
- // It is now possible to add a login with the old type and hostname.
- Services.logins.addLogin(loginInfo);
- LoginTestUtils.checkLogins([loginInfo, differentLoginInfo]);
-
- // Modifying a login to match an existing one should not be possible.
- Assert.throws(
- () => Services.logins.modifyLogin(loginInfo, differentLoginProperties),
- /already exists/);
- LoginTestUtils.checkLogins([loginInfo, differentLoginInfo]);
-
- LoginTestUtils.clearData();
-});
-
-/**
- * Tests the login deduplication function.
- */
-add_task(function test_deduplicate_logins() {
- // Different key attributes combinations and the amount of unique
- // results expected for the TestData login list.
- let keyCombinations = [
- {
- keyset: ["username", "password"],
- results: 13,
- },
- {
- keyset: ["hostname", "username"],
- results: 17,
- },
- {
- keyset: ["hostname", "username", "password"],
- results: 18,
- },
- {
- keyset: ["hostname", "username", "password", "formSubmitURL"],
- results: 23,
- },
- ];
-
- let logins = TestData.loginList();
-
- for (let testCase of keyCombinations) {
- // Deduplicate the logins using the current testcase keyset.
- let deduped = LoginHelper.dedupeLogins(logins, testCase.keyset);
- Assert.equal(deduped.length, testCase.results, "Correct amount of results.");
-
- // Checks that every login after deduping is unique.
- Assert.ok(deduped.every(loginA =>
- deduped.every(loginB => !compareAttributes(loginA, loginB, testCase.keyset))
- ), "Every login is unique.");
- }
-});
-
-/**
- * Ensure that the login deduplication function keeps the most recent login.
- */
-add_task(function test_deduplicate_keeps_most_recent() {
- // Logins to deduplicate.
- let logins = [
- TestData.formLogin({timeLastUsed: Date.UTC(2004, 11, 4, 0, 0, 0)}),
- TestData.formLogin({formSubmitURL: "http://example.com", timeLastUsed: Date.UTC(2015, 11, 4, 0, 0, 0)}),
- ];
-
- // Deduplicate the logins.
- let deduped = LoginHelper.dedupeLogins(logins);
- Assert.equal(deduped.length, 1, "Deduplicated the logins array.");
-
- // Verify that the remaining login have the most recent date.
- let loginTimeLastUsed = deduped[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
- Assert.equal(loginTimeLastUsed, Date.UTC(2015, 11, 4, 0, 0, 0), "Most recent login was kept.");
-
- // Deduplicate the reverse logins array.
- deduped = LoginHelper.dedupeLogins(logins.reverse());
- Assert.equal(deduped.length, 1, "Deduplicated the reversed logins array.");
-
- // Verify that the remaining login have the most recent date.
- loginTimeLastUsed = deduped[0].QueryInterface(Ci.nsILoginMetaInfo).timeLastUsed;
- Assert.equal(loginTimeLastUsed, Date.UTC(2015, 11, 4, 0, 0, 0), "Most recent login was kept.");
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_logins_decrypt_failure.js b/toolkit/components/passwordmgr/test/unit/test_logins_decrypt_failure.js
deleted file mode 100644
index ffbedb4de..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_logins_decrypt_failure.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the case where there are logins that cannot be decrypted.
- */
-
-"use strict";
-
-// Globals
-
-/**
- * Resets the token used to decrypt logins. This is equivalent to resetting the
- * master password when it is not known.
- */
-function resetMasterPassword()
-{
- let token = Cc["@mozilla.org/security/pk11tokendb;1"]
- .getService(Ci.nsIPK11TokenDB).getInternalKeyToken();
- token.reset();
- token.changePassword("", "");
-}
-
-// Tests
-
-/**
- * Resets the master password after some logins were added to the database.
- */
-add_task(function test_logins_decrypt_failure()
-{
- let logins = TestData.loginList();
- for (let loginInfo of logins) {
- Services.logins.addLogin(loginInfo);
- }
-
- // This makes the existing logins non-decryptable.
- resetMasterPassword();
-
- // These functions don't see the non-decryptable entries anymore.
- do_check_eq(Services.logins.getAllLogins().length, 0);
- do_check_eq(Services.logins.findLogins({}, "", "", "").length, 0);
- do_check_eq(Services.logins.searchLogins({}, newPropertyBag()).length, 0);
- Assert.throws(() => Services.logins.modifyLogin(logins[0], newPropertyBag()),
- /No matching logins/);
- Assert.throws(() => Services.logins.removeLogin(logins[0]),
- /No matching logins/);
-
- // The function that counts logins sees the non-decryptable entries also.
- do_check_eq(Services.logins.countLogins("", "", ""), logins.length);
-
- // Equivalent logins can be added.
- for (let loginInfo of logins) {
- Services.logins.addLogin(loginInfo);
- }
- LoginTestUtils.checkLogins(logins);
- do_check_eq(Services.logins.countLogins("", "", ""), logins.length * 2);
-
- // Finding logins doesn't return the non-decryptable duplicates.
- do_check_eq(Services.logins.findLogins({}, "http://www.example.com",
- "", "").length, 1);
- let matchData = newPropertyBag({ hostname: "http://www.example.com" });
- do_check_eq(Services.logins.searchLogins({}, matchData).length, 1);
-
- // Removing single logins does not remove non-decryptable logins.
- for (let loginInfo of TestData.loginList()) {
- Services.logins.removeLogin(loginInfo);
- }
- do_check_eq(Services.logins.getAllLogins().length, 0);
- do_check_eq(Services.logins.countLogins("", "", ""), logins.length);
-
- // Removing all logins removes the non-decryptable entries also.
- Services.logins.removeAllLogins();
- do_check_eq(Services.logins.getAllLogins().length, 0);
- do_check_eq(Services.logins.countLogins("", "", ""), 0);
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_logins_metainfo.js b/toolkit/components/passwordmgr/test/unit/test_logins_metainfo.js
deleted file mode 100644
index 38344aa7d..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_logins_metainfo.js
+++ /dev/null
@@ -1,284 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the handling of nsILoginMetaInfo by methods that add, remove, modify,
- * and find logins.
- */
-
-"use strict";
-
-// Globals
-
-XPCOMUtils.defineLazyServiceGetter(this, "gUUIDGenerator",
- "@mozilla.org/uuid-generator;1",
- "nsIUUIDGenerator");
-
-var gLooksLikeUUIDRegex = /^\{\w{8}-\w{4}-\w{4}-\w{4}-\w{12}\}$/;
-
-/**
- * Retrieves the only login among the current data that matches the hostname of
- * the given nsILoginInfo. In case there is more than one login for the
- * hostname, the test fails.
- */
-function retrieveLoginMatching(aLoginInfo)
-{
- let logins = Services.logins.findLogins({}, aLoginInfo.hostname, "", "");
- do_check_eq(logins.length, 1);
- return logins[0].QueryInterface(Ci.nsILoginMetaInfo);
-}
-
-/**
- * Checks that the nsILoginInfo and nsILoginMetaInfo properties of two different
- * login instances are equal.
- */
-function assertMetaInfoEqual(aActual, aExpected)
-{
- do_check_neq(aActual, aExpected);
-
- // Check the nsILoginInfo properties.
- do_check_true(aActual.equals(aExpected));
-
- // Check the nsILoginMetaInfo properties.
- do_check_eq(aActual.guid, aExpected.guid);
- do_check_eq(aActual.timeCreated, aExpected.timeCreated);
- do_check_eq(aActual.timeLastUsed, aExpected.timeLastUsed);
- do_check_eq(aActual.timePasswordChanged, aExpected.timePasswordChanged);
- do_check_eq(aActual.timesUsed, aExpected.timesUsed);
-}
-
-/**
- * nsILoginInfo instances with or without nsILoginMetaInfo properties.
- */
-var gLoginInfo1;
-var gLoginInfo2;
-var gLoginInfo3;
-
-/**
- * nsILoginInfo instances reloaded with all the nsILoginMetaInfo properties.
- * These are often used to provide the reference values to test against.
- */
-var gLoginMetaInfo1;
-var gLoginMetaInfo2;
-var gLoginMetaInfo3;
-
-// Tests
-
-/**
- * Prepare the test objects that will be used by the following tests.
- */
-add_task(function test_initialize()
-{
- // Use a reference time from ten minutes ago to initialize one instance of
- // nsILoginMetaInfo, to test that reference times are updated when needed.
- let baseTimeMs = Date.now() - 600000;
-
- gLoginInfo1 = TestData.formLogin();
- gLoginInfo2 = TestData.formLogin({
- hostname: "http://other.example.com",
- guid: gUUIDGenerator.generateUUID().toString(),
- timeCreated: baseTimeMs,
- timeLastUsed: baseTimeMs + 2,
- timePasswordChanged: baseTimeMs + 1,
- timesUsed: 2,
- });
- gLoginInfo3 = TestData.authLogin();
-});
-
-/**
- * Tests the behavior of addLogin with regard to metadata. The logins added
- * here are also used by the following tests.
- */
-add_task(function test_addLogin_metainfo()
-{
- // Add a login without metadata to the database.
- Services.logins.addLogin(gLoginInfo1);
-
- // The object provided to addLogin should not have been modified.
- do_check_eq(gLoginInfo1.guid, null);
- do_check_eq(gLoginInfo1.timeCreated, 0);
- do_check_eq(gLoginInfo1.timeLastUsed, 0);
- do_check_eq(gLoginInfo1.timePasswordChanged, 0);
- do_check_eq(gLoginInfo1.timesUsed, 0);
-
- // A login with valid metadata should have been stored.
- gLoginMetaInfo1 = retrieveLoginMatching(gLoginInfo1);
- do_check_true(gLooksLikeUUIDRegex.test(gLoginMetaInfo1.guid));
- let creationTime = gLoginMetaInfo1.timeCreated;
- LoginTestUtils.assertTimeIsAboutNow(creationTime);
- do_check_eq(gLoginMetaInfo1.timeLastUsed, creationTime);
- do_check_eq(gLoginMetaInfo1.timePasswordChanged, creationTime);
- do_check_eq(gLoginMetaInfo1.timesUsed, 1);
-
- // Add a login without metadata to the database.
- let originalLogin = gLoginInfo2.clone().QueryInterface(Ci.nsILoginMetaInfo);
- Services.logins.addLogin(gLoginInfo2);
-
- // The object provided to addLogin should not have been modified.
- assertMetaInfoEqual(gLoginInfo2, originalLogin);
-
- // A login with the provided metadata should have been stored.
- gLoginMetaInfo2 = retrieveLoginMatching(gLoginInfo2);
- assertMetaInfoEqual(gLoginMetaInfo2, gLoginInfo2);
-
- // Add an authentication login to the database before continuing.
- Services.logins.addLogin(gLoginInfo3);
- gLoginMetaInfo3 = retrieveLoginMatching(gLoginInfo3);
- LoginTestUtils.checkLogins([gLoginInfo1, gLoginInfo2, gLoginInfo3]);
-});
-
-/**
- * Tests that adding a login with a duplicate GUID throws an exception.
- */
-add_task(function test_addLogin_metainfo_duplicate()
-{
- let loginInfo = TestData.formLogin({
- hostname: "http://duplicate.example.com",
- guid: gLoginMetaInfo2.guid,
- });
- Assert.throws(() => Services.logins.addLogin(loginInfo),
- /specified GUID already exists/);
-
- // Verify that no data was stored by the previous call.
- LoginTestUtils.checkLogins([gLoginInfo1, gLoginInfo2, gLoginInfo3]);
-});
-
-/**
- * Tests that the existing metadata is not changed when modifyLogin is called
- * with an nsILoginInfo argument.
- */
-add_task(function test_modifyLogin_nsILoginInfo_metainfo_ignored()
-{
- let newLoginInfo = gLoginInfo1.clone().QueryInterface(Ci.nsILoginMetaInfo);
- newLoginInfo.guid = gUUIDGenerator.generateUUID().toString();
- newLoginInfo.timeCreated = Date.now();
- newLoginInfo.timeLastUsed = Date.now();
- newLoginInfo.timePasswordChanged = Date.now();
- newLoginInfo.timesUsed = 12;
- Services.logins.modifyLogin(gLoginInfo1, newLoginInfo);
-
- newLoginInfo = retrieveLoginMatching(gLoginInfo1);
- assertMetaInfoEqual(newLoginInfo, gLoginMetaInfo1);
-});
-
-/**
- * Tests the modifyLogin function with an nsIProperyBag argument.
- */
-add_task(function test_modifyLogin_nsIProperyBag_metainfo()
-{
- // Use a new reference time that is two minutes from now.
- let newTimeMs = Date.now() + 120000;
- let newUUIDValue = gUUIDGenerator.generateUUID().toString();
-
- // Check that properties are changed as requested.
- Services.logins.modifyLogin(gLoginInfo1, newPropertyBag({
- guid: newUUIDValue,
- timeCreated: newTimeMs,
- timeLastUsed: newTimeMs + 2,
- timePasswordChanged: newTimeMs + 1,
- timesUsed: 2,
- }));
-
- gLoginMetaInfo1 = retrieveLoginMatching(gLoginInfo1);
- do_check_eq(gLoginMetaInfo1.guid, newUUIDValue);
- do_check_eq(gLoginMetaInfo1.timeCreated, newTimeMs);
- do_check_eq(gLoginMetaInfo1.timeLastUsed, newTimeMs + 2);
- do_check_eq(gLoginMetaInfo1.timePasswordChanged, newTimeMs + 1);
- do_check_eq(gLoginMetaInfo1.timesUsed, 2);
-
- // Check that timePasswordChanged is updated when changing the password.
- let originalLogin = gLoginInfo2.clone().QueryInterface(Ci.nsILoginMetaInfo);
- Services.logins.modifyLogin(gLoginInfo2, newPropertyBag({
- password: "new password",
- }));
- gLoginInfo2.password = "new password";
-
- gLoginMetaInfo2 = retrieveLoginMatching(gLoginInfo2);
- do_check_eq(gLoginMetaInfo2.password, gLoginInfo2.password);
- do_check_eq(gLoginMetaInfo2.timeCreated, originalLogin.timeCreated);
- do_check_eq(gLoginMetaInfo2.timeLastUsed, originalLogin.timeLastUsed);
- LoginTestUtils.assertTimeIsAboutNow(gLoginMetaInfo2.timePasswordChanged);
-
- // Check that timePasswordChanged is not set to the current time when changing
- // the password and specifying a new value for the property at the same time.
- Services.logins.modifyLogin(gLoginInfo2, newPropertyBag({
- password: "other password",
- timePasswordChanged: newTimeMs,
- }));
- gLoginInfo2.password = "other password";
-
- gLoginMetaInfo2 = retrieveLoginMatching(gLoginInfo2);
- do_check_eq(gLoginMetaInfo2.password, gLoginInfo2.password);
- do_check_eq(gLoginMetaInfo2.timeCreated, originalLogin.timeCreated);
- do_check_eq(gLoginMetaInfo2.timeLastUsed, originalLogin.timeLastUsed);
- do_check_eq(gLoginMetaInfo2.timePasswordChanged, newTimeMs);
-
- // Check the special timesUsedIncrement property.
- Services.logins.modifyLogin(gLoginInfo2, newPropertyBag({
- timesUsedIncrement: 2,
- }));
-
- gLoginMetaInfo2 = retrieveLoginMatching(gLoginInfo2);
- do_check_eq(gLoginMetaInfo2.timeCreated, originalLogin.timeCreated);
- do_check_eq(gLoginMetaInfo2.timeLastUsed, originalLogin.timeLastUsed);
- do_check_eq(gLoginMetaInfo2.timePasswordChanged, newTimeMs);
- do_check_eq(gLoginMetaInfo2.timesUsed, 4);
-});
-
-/**
- * Tests that modifying a login to a duplicate GUID throws an exception.
- */
-add_task(function test_modifyLogin_nsIProperyBag_metainfo_duplicate()
-{
- Assert.throws(() => Services.logins.modifyLogin(gLoginInfo1, newPropertyBag({
- guid: gLoginInfo2.guid,
- })), /specified GUID already exists/);
- LoginTestUtils.checkLogins([gLoginInfo1, gLoginInfo2, gLoginInfo3]);
-});
-
-/**
- * Tests searching logins using nsILoginMetaInfo properties.
- */
-add_task(function test_searchLogins_metainfo()
-{
- // Find by GUID.
- let logins = Services.logins.searchLogins({}, newPropertyBag({
- guid: gLoginMetaInfo1.guid,
- }));
- do_check_eq(logins.length, 1);
- let foundLogin = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- assertMetaInfoEqual(foundLogin, gLoginMetaInfo1);
-
- // Find by timestamp.
- logins = Services.logins.searchLogins({}, newPropertyBag({
- timePasswordChanged: gLoginMetaInfo2.timePasswordChanged,
- }));
- do_check_eq(logins.length, 1);
- foundLogin = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- assertMetaInfoEqual(foundLogin, gLoginMetaInfo2);
-
- // Find using two properties at the same time.
- logins = Services.logins.searchLogins({}, newPropertyBag({
- guid: gLoginMetaInfo3.guid,
- timePasswordChanged: gLoginMetaInfo3.timePasswordChanged,
- }));
- do_check_eq(logins.length, 1);
- foundLogin = logins[0].QueryInterface(Ci.nsILoginMetaInfo);
- assertMetaInfoEqual(foundLogin, gLoginMetaInfo3);
-});
-
-/**
- * Tests that the default nsILoginManagerStorage module attached to the Login
- * Manager service is able to save and reload nsILoginMetaInfo properties.
- */
-add_task(function* test_storage_metainfo()
-{
- yield* LoginTestUtils.reloadData();
- LoginTestUtils.checkLogins([gLoginInfo1, gLoginInfo2, gLoginInfo3]);
-
- assertMetaInfoEqual(retrieveLoginMatching(gLoginInfo1), gLoginMetaInfo1);
- assertMetaInfoEqual(retrieveLoginMatching(gLoginInfo2), gLoginMetaInfo2);
- assertMetaInfoEqual(retrieveLoginMatching(gLoginInfo3), gLoginMetaInfo3);
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_logins_search.js b/toolkit/components/passwordmgr/test/unit/test_logins_search.js
deleted file mode 100644
index 730771981..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_logins_search.js
+++ /dev/null
@@ -1,220 +0,0 @@
-/*
- * Tests methods that find specific logins in the store (findLogins,
- * searchLogins, and countLogins).
- *
- * The getAllLogins method is not tested explicitly here, because it is used by
- * all tests to verify additions, removals and modifications to the login store.
- */
-
-"use strict";
-
-// Globals
-
-/**
- * Returns a list of new nsILoginInfo objects that are a subset of the test
- * data, built to match the specified query.
- *
- * @param aQuery
- * Each property and value of this object restricts the search to those
- * entries from the test data that match the property exactly.
- */
-function buildExpectedLogins(aQuery)
-{
- return TestData.loginList().filter(
- entry => Object.keys(aQuery).every(name => entry[name] === aQuery[name]));
-}
-
-/**
- * Tests the searchLogins function.
- *
- * @param aQuery
- * Each property and value of this object is translated to an entry in
- * the nsIPropertyBag parameter of searchLogins.
- * @param aExpectedCount
- * Number of logins from the test data that should be found. The actual
- * list of logins is obtained using the buildExpectedLogins helper, and
- * this value is just used to verify that modifications to the test data
- * don't make the current test meaningless.
- */
-function checkSearchLogins(aQuery, aExpectedCount)
-{
- do_print("Testing searchLogins for " + JSON.stringify(aQuery));
-
- let expectedLogins = buildExpectedLogins(aQuery);
- do_check_eq(expectedLogins.length, aExpectedCount);
-
- let outCount = {};
- let logins = Services.logins.searchLogins(outCount, newPropertyBag(aQuery));
- do_check_eq(outCount.value, expectedLogins.length);
- LoginTestUtils.assertLoginListsEqual(logins, expectedLogins);
-}
-
-/**
- * Tests findLogins, searchLogins, and countLogins with the same query.
- *
- * @param aQuery
- * The "hostname", "formSubmitURL", and "httpRealm" properties of this
- * object are passed as parameters to findLogins and countLogins. The
- * same object is then passed to the checkSearchLogins function.
- * @param aExpectedCount
- * Number of logins from the test data that should be found. The actual
- * list of logins is obtained using the buildExpectedLogins helper, and
- * this value is just used to verify that modifications to the test data
- * don't make the current test meaningless.
- */
-function checkAllSearches(aQuery, aExpectedCount)
-{
- do_print("Testing all search functions for " + JSON.stringify(aQuery));
-
- let expectedLogins = buildExpectedLogins(aQuery);
- do_check_eq(expectedLogins.length, aExpectedCount);
-
- // The findLogins and countLogins functions support wildcard matches by
- // specifying empty strings as parameters, while searchLogins requires
- // omitting the property entirely.
- let hostname = ("hostname" in aQuery) ? aQuery.hostname : "";
- let formSubmitURL = ("formSubmitURL" in aQuery) ? aQuery.formSubmitURL : "";
- let httpRealm = ("httpRealm" in aQuery) ? aQuery.httpRealm : "";
-
- // Test findLogins.
- let outCount = {};
- let logins = Services.logins.findLogins(outCount, hostname, formSubmitURL,
- httpRealm);
- do_check_eq(outCount.value, expectedLogins.length);
- LoginTestUtils.assertLoginListsEqual(logins, expectedLogins);
-
- // Test countLogins.
- let count = Services.logins.countLogins(hostname, formSubmitURL, httpRealm);
- do_check_eq(count, expectedLogins.length);
-
- // Test searchLogins.
- checkSearchLogins(aQuery, aExpectedCount);
-}
-
-// Tests
-
-/**
- * Prepare data for the following tests.
- */
-add_task(function test_initialize()
-{
- for (let login of TestData.loginList()) {
- Services.logins.addLogin(login);
- }
-});
-
-/**
- * Tests findLogins, searchLogins, and countLogins with basic queries.
- */
-add_task(function test_search_all_basic()
-{
- // Find all logins, using no filters in the search functions.
- checkAllSearches({}, 23);
-
- // Find all form logins, then all authentication logins.
- checkAllSearches({ httpRealm: null }, 14);
- checkAllSearches({ formSubmitURL: null }, 9);
-
- // Find all form logins on one host, then all authentication logins.
- checkAllSearches({ hostname: "http://www4.example.com",
- httpRealm: null }, 3);
- checkAllSearches({ hostname: "http://www2.example.org",
- formSubmitURL: null }, 2);
-
- // Verify that scheme and subdomain are distinct in the hostname.
- checkAllSearches({ hostname: "http://www.example.com" }, 1);
- checkAllSearches({ hostname: "https://www.example.com" }, 1);
- checkAllSearches({ hostname: "https://example.com" }, 1);
- checkAllSearches({ hostname: "http://www3.example.com" }, 3);
-
- // Verify that scheme and subdomain are distinct in formSubmitURL.
- checkAllSearches({ formSubmitURL: "http://www.example.com" }, 2);
- checkAllSearches({ formSubmitURL: "https://www.example.com" }, 2);
- checkAllSearches({ formSubmitURL: "http://example.com" }, 1);
-
- // Find by formSubmitURL on a single host.
- checkAllSearches({ hostname: "http://www3.example.com",
- formSubmitURL: "http://www.example.com" }, 1);
- checkAllSearches({ hostname: "http://www3.example.com",
- formSubmitURL: "https://www.example.com" }, 1);
- checkAllSearches({ hostname: "http://www3.example.com",
- formSubmitURL: "http://example.com" }, 1);
-
- // Find by httpRealm on all hosts.
- checkAllSearches({ httpRealm: "The HTTP Realm" }, 3);
- checkAllSearches({ httpRealm: "ftp://ftp.example.org" }, 1);
- checkAllSearches({ httpRealm: "The HTTP Realm Other" }, 2);
-
- // Find by httpRealm on a single host.
- checkAllSearches({ hostname: "http://example.net",
- httpRealm: "The HTTP Realm" }, 1);
- checkAllSearches({ hostname: "http://example.net",
- httpRealm: "The HTTP Realm Other" }, 1);
- checkAllSearches({ hostname: "ftp://example.net",
- httpRealm: "ftp://example.net" }, 1);
-});
-
-/**
- * Tests searchLogins with advanced queries.
- */
-add_task(function test_searchLogins()
-{
- checkSearchLogins({ usernameField: "form_field_username" }, 12);
- checkSearchLogins({ passwordField: "form_field_password" }, 13);
-
- // Find all logins with an empty usernameField, including for authentication.
- checkSearchLogins({ usernameField: "" }, 11);
-
- // Find form logins with an empty usernameField.
- checkSearchLogins({ httpRealm: null,
- usernameField: "" }, 2);
-
- // Find logins with an empty usernameField on one host.
- checkSearchLogins({ hostname: "http://www6.example.com",
- usernameField: "" }, 1);
-});
-
-/**
- * Tests searchLogins with invalid arguments.
- */
-add_task(function test_searchLogins_invalid()
-{
- Assert.throws(() => Services.logins.searchLogins({},
- newPropertyBag({ username: "value" })),
- /Unexpected field/);
-});
-
-/**
- * Tests that matches are case-sensitive, compare the full field value, and are
- * strict when interpreting the prePath of URIs.
- */
-add_task(function test_search_all_full_case_sensitive()
-{
- checkAllSearches({ hostname: "http://www.example.com" }, 1);
- checkAllSearches({ hostname: "http://www.example.com/" }, 0);
- checkAllSearches({ hostname: "example.com" }, 0);
-
- checkAllSearches({ formSubmitURL: "http://www.example.com" }, 2);
- checkAllSearches({ formSubmitURL: "http://www.example.com/" }, 0);
- checkAllSearches({ formSubmitURL: "http://" }, 0);
- checkAllSearches({ formSubmitURL: "example.com" }, 0);
-
- checkAllSearches({ httpRealm: "The HTTP Realm" }, 3);
- checkAllSearches({ httpRealm: "The http Realm" }, 0);
- checkAllSearches({ httpRealm: "The HTTP" }, 0);
- checkAllSearches({ httpRealm: "Realm" }, 0);
-});
-
-/**
- * Tests findLogins, searchLogins, and countLogins with queries that should
- * return no values.
- */
-add_task(function test_search_all_empty()
-{
- checkAllSearches({ hostname: "http://nonexistent.example.com" }, 0);
- checkAllSearches({ formSubmitURL: "http://www.example.com",
- httpRealm: "The HTTP Realm" }, 0);
-
- checkSearchLogins({ hostname: "" }, 0);
- checkSearchLogins({ id: "1000" }, 0);
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_maybeImportLogin.js b/toolkit/components/passwordmgr/test/unit/test_maybeImportLogin.js
deleted file mode 100644
index 19175df59..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_maybeImportLogin.js
+++ /dev/null
@@ -1,169 +0,0 @@
-"use strict";
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/LoginHelper.jsm");
-
-const HOST1 = "https://www.example.com/";
-const HOST2 = "https://www.mozilla.org/";
-
-const USER1 = "myuser";
-const USER2 = "anotheruser";
-
-const PASS1 = "mypass";
-const PASS2 = "anotherpass";
-const PASS3 = "yetanotherpass";
-
-add_task(function test_new_logins() {
- let importedLogin = LoginHelper.maybeImportLogin({
- username: USER1,
- password: PASS1,
- hostname: HOST1,
- formSubmitURL: HOST1,
- });
- Assert.ok(importedLogin, "Return value should indicate imported login.");
- let matchingLogins = LoginHelper.searchLoginsWithObject({hostname: HOST1});
- Assert.equal(matchingLogins.length, 1, `There should be 1 login for ${HOST1}`);
-
- importedLogin = LoginHelper.maybeImportLogin({
- username: USER1,
- password: PASS1,
- hostname: HOST2,
- formSubmitURL: HOST2,
- });
-
- Assert.ok(importedLogin, "Return value should indicate another imported login.");
- matchingLogins = LoginHelper.searchLoginsWithObject({hostname: HOST1});
- Assert.equal(matchingLogins.length, 1, `There should still be 1 login for ${HOST1}`);
-
- matchingLogins = LoginHelper.searchLoginsWithObject({hostname: HOST2});
- Assert.equal(matchingLogins.length, 1, `There should also be 1 login for ${HOST2}`);
- Assert.equal(Services.logins.getAllLogins().length, 2, "There should be 2 logins in total");
- Services.logins.removeAllLogins();
-});
-
-add_task(function test_duplicate_logins() {
- let importedLogin = LoginHelper.maybeImportLogin({
- username: USER1,
- password: PASS1,
- hostname: HOST1,
- formSubmitURL: HOST1,
- });
- Assert.ok(importedLogin, "Return value should indicate imported login.");
- let matchingLogins = LoginHelper.searchLoginsWithObject({hostname: HOST1});
- Assert.equal(matchingLogins.length, 1, `There should be 1 login for ${HOST1}`);
-
- importedLogin = LoginHelper.maybeImportLogin({
- username: USER1,
- password: PASS1,
- hostname: HOST1,
- formSubmitURL: HOST1,
- });
- Assert.ok(!importedLogin, "Return value should indicate no new login was imported.");
- matchingLogins = LoginHelper.searchLoginsWithObject({hostname: HOST1});
- Assert.equal(matchingLogins.length, 1, `There should still be 1 login for ${HOST1}`);
- Services.logins.removeAllLogins();
-});
-
-add_task(function test_different_passwords() {
- let importedLogin = LoginHelper.maybeImportLogin({
- username: USER1,
- password: PASS1,
- hostname: HOST1,
- formSubmitURL: HOST1,
- timeCreated: new Date(Date.now() - 1000),
- });
- Assert.ok(importedLogin, "Return value should indicate imported login.");
- let matchingLogins = LoginHelper.searchLoginsWithObject({hostname: HOST1});
- Assert.equal(matchingLogins.length, 1, `There should be 1 login for ${HOST1}`);
-
- // This item will be newer, so its password should take precedence.
- importedLogin = LoginHelper.maybeImportLogin({
- username: USER1,
- password: PASS2,
- hostname: HOST1,
- formSubmitURL: HOST1,
- timeCreated: new Date(),
- });
- Assert.ok(!importedLogin, "Return value should not indicate imported login (as we updated an existing one).");
- matchingLogins = LoginHelper.searchLoginsWithObject({hostname: HOST1});
- Assert.equal(matchingLogins.length, 1, `There should still be 1 login for ${HOST1}`);
- Assert.equal(matchingLogins[0].password, PASS2, "We should have updated the password for this login.");
-
- // Now try to update with an older password:
- importedLogin = LoginHelper.maybeImportLogin({
- username: USER1,
- password: PASS3,
- hostname: HOST1,
- formSubmitURL: HOST1,
- timeCreated: new Date(Date.now() - 1000000),
- });
- Assert.ok(!importedLogin, "Return value should not indicate imported login (as we didn't update anything).");
- matchingLogins = LoginHelper.searchLoginsWithObject({hostname: HOST1});
- Assert.equal(matchingLogins.length, 1, `There should still be 1 login for ${HOST1}`);
- Assert.equal(matchingLogins[0].password, PASS2, "We should NOT have updated the password for this login.");
-
- Services.logins.removeAllLogins();
-});
-
-add_task(function test_different_usernames() {
- let importedLogin = LoginHelper.maybeImportLogin({
- username: USER1,
- password: PASS1,
- hostname: HOST1,
- formSubmitURL: HOST1,
- });
- Assert.ok(importedLogin, "Return value should indicate imported login.");
- let matchingLogins = LoginHelper.searchLoginsWithObject({hostname: HOST1});
- Assert.equal(matchingLogins.length, 1, `There should be 1 login for ${HOST1}`);
-
- importedLogin = LoginHelper.maybeImportLogin({
- username: USER2,
- password: PASS1,
- hostname: HOST1,
- formSubmitURL: HOST1,
- });
- Assert.ok(importedLogin, "Return value should indicate another imported login.");
- matchingLogins = LoginHelper.searchLoginsWithObject({hostname: HOST1});
- Assert.equal(matchingLogins.length, 2, `There should now be 2 logins for ${HOST1}`);
-
- Services.logins.removeAllLogins();
-});
-
-add_task(function test_different_targets() {
- let importedLogin = LoginHelper.maybeImportLogin({
- username: USER1,
- password: PASS1,
- hostname: HOST1,
- formSubmitURL: HOST1,
- });
- Assert.ok(importedLogin, "Return value should indicate imported login.");
- let matchingLogins = LoginHelper.searchLoginsWithObject({hostname: HOST1});
- Assert.equal(matchingLogins.length, 1, `There should be 1 login for ${HOST1}`);
-
- // Not passing either a formSubmitURL or a httpRealm should be treated as
- // the same as the previous login
- importedLogin = LoginHelper.maybeImportLogin({
- username: USER1,
- password: PASS1,
- hostname: HOST1,
- });
- Assert.ok(!importedLogin, "Return value should NOT indicate imported login " +
- "(because a missing formSubmitURL and httpRealm should be duped to the existing login).");
- matchingLogins = LoginHelper.searchLoginsWithObject({hostname: HOST1});
- Assert.equal(matchingLogins.length, 1, `There should still be 1 login for ${HOST1}`);
- Assert.equal(matchingLogins[0].formSubmitURL, HOST1, "The form submission URL should have been kept.");
-
- importedLogin = LoginHelper.maybeImportLogin({
- username: USER1,
- password: PASS1,
- hostname: HOST1,
- httpRealm: HOST1,
- });
- Assert.ok(importedLogin, "Return value should indicate another imported login " +
- "as an httpRealm login shouldn't be duped.");
- matchingLogins = LoginHelper.searchLoginsWithObject({hostname: HOST1});
- Assert.equal(matchingLogins.length, 2, `There should now be 2 logins for ${HOST1}`);
-
- Services.logins.removeAllLogins();
-});
-
diff --git a/toolkit/components/passwordmgr/test/unit/test_module_LoginImport.js b/toolkit/components/passwordmgr/test/unit/test_module_LoginImport.js
deleted file mode 100644
index b8793e1bd..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_module_LoginImport.js
+++ /dev/null
@@ -1,243 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the LoginImport object.
- */
-
-"use strict";
-
-// Globals
-
-Cu.import("resource://gre/modules/Task.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
- "resource://gre/modules/LoginHelper.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "LoginImport",
- "resource://gre/modules/LoginImport.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "LoginStore",
- "resource://gre/modules/LoginStore.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
- "resource://gre/modules/Sqlite.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this, "gLoginManagerCrypto",
- "@mozilla.org/login-manager/crypto/SDR;1",
- "nsILoginManagerCrypto");
-XPCOMUtils.defineLazyServiceGetter(this, "gUUIDGenerator",
- "@mozilla.org/uuid-generator;1",
- "nsIUUIDGenerator");
-
-/**
- * Creates empty login data tables in the given SQLite connection, resembling
- * the most recent schema version (excluding indices).
- */
-function promiseCreateDatabaseSchema(aConnection)
-{
- return Task.spawn(function* () {
- yield aConnection.setSchemaVersion(5);
- yield aConnection.execute("CREATE TABLE moz_logins (" +
- "id INTEGER PRIMARY KEY," +
- "hostname TEXT NOT NULL," +
- "httpRealm TEXT," +
- "formSubmitURL TEXT," +
- "usernameField TEXT NOT NULL," +
- "passwordField TEXT NOT NULL," +
- "encryptedUsername TEXT NOT NULL," +
- "encryptedPassword TEXT NOT NULL," +
- "guid TEXT," +
- "encType INTEGER," +
- "timeCreated INTEGER," +
- "timeLastUsed INTEGER," +
- "timePasswordChanged INTEGER," +
- "timesUsed INTEGER)");
- yield aConnection.execute("CREATE TABLE moz_disabledHosts (" +
- "id INTEGER PRIMARY KEY," +
- "hostname TEXT UNIQUE)");
- yield aConnection.execute("CREATE TABLE moz_deleted_logins (" +
- "id INTEGER PRIMARY KEY," +
- "guid TEXT," +
- "timeDeleted INTEGER)");
- });
-}
-
-/**
- * Inserts a new entry in the database resembling the given nsILoginInfo object.
- */
-function promiseInsertLoginInfo(aConnection, aLoginInfo)
-{
- aLoginInfo.QueryInterface(Ci.nsILoginMetaInfo);
-
- // We can't use the aLoginInfo object directly in the execute statement
- // because the bind code in Sqlite.jsm doesn't allow objects with extra
- // properties beyond those being binded. So we might as well use an array as
- // it is simpler.
- let values = [
- aLoginInfo.hostname,
- aLoginInfo.httpRealm,
- aLoginInfo.formSubmitURL,
- aLoginInfo.usernameField,
- aLoginInfo.passwordField,
- gLoginManagerCrypto.encrypt(aLoginInfo.username),
- gLoginManagerCrypto.encrypt(aLoginInfo.password),
- aLoginInfo.guid,
- aLoginInfo.encType,
- aLoginInfo.timeCreated,
- aLoginInfo.timeLastUsed,
- aLoginInfo.timePasswordChanged,
- aLoginInfo.timesUsed,
- ];
-
- return aConnection.execute("INSERT INTO moz_logins (hostname, " +
- "httpRealm, formSubmitURL, usernameField, " +
- "passwordField, encryptedUsername, " +
- "encryptedPassword, guid, encType, timeCreated, " +
- "timeLastUsed, timePasswordChanged, timesUsed) " +
- "VALUES (?" + ",?".repeat(12) + ")", values);
-}
-
-/**
- * Inserts a new disabled host entry in the database.
- */
-function promiseInsertDisabledHost(aConnection, aHostname)
-{
- return aConnection.execute("INSERT INTO moz_disabledHosts (hostname) " +
- "VALUES (?)", [aHostname]);
-}
-
-// Tests
-
-/**
- * Imports login data from a SQLite file constructed using the test data.
- */
-add_task(function* test_import()
-{
- let store = new LoginStore(getTempFile("test-import.json").path);
- let loginsSqlite = getTempFile("test-logins.sqlite").path;
-
- // Prepare the logins to be imported, including the nsILoginMetaInfo data.
- let loginList = TestData.loginList();
- for (let loginInfo of loginList) {
- loginInfo.QueryInterface(Ci.nsILoginMetaInfo);
- loginInfo.guid = gUUIDGenerator.generateUUID().toString();
- loginInfo.timeCreated = Date.now();
- loginInfo.timeLastUsed = Date.now();
- loginInfo.timePasswordChanged = Date.now();
- loginInfo.timesUsed = 1;
- }
-
- // Create and populate the SQLite database first.
- let connection = yield Sqlite.openConnection({ path: loginsSqlite });
- try {
- yield promiseCreateDatabaseSchema(connection);
- for (let loginInfo of loginList) {
- yield promiseInsertLoginInfo(connection, loginInfo);
- }
- yield promiseInsertDisabledHost(connection, "http://www.example.com");
- yield promiseInsertDisabledHost(connection, "https://www.example.org");
- } finally {
- yield connection.close();
- }
-
- // The "load" method must be called before importing data.
- yield store.load();
- yield new LoginImport(store, loginsSqlite).import();
-
- // Verify that every login in the test data has a matching imported row.
- do_check_eq(loginList.length, store.data.logins.length);
- do_check_true(loginList.every(function (loginInfo) {
- return store.data.logins.some(function (loginDataItem) {
- let username = gLoginManagerCrypto.decrypt(loginDataItem.encryptedUsername);
- let password = gLoginManagerCrypto.decrypt(loginDataItem.encryptedPassword);
- return loginDataItem.hostname == loginInfo.hostname &&
- loginDataItem.httpRealm == loginInfo.httpRealm &&
- loginDataItem.formSubmitURL == loginInfo.formSubmitURL &&
- loginDataItem.usernameField == loginInfo.usernameField &&
- loginDataItem.passwordField == loginInfo.passwordField &&
- username == loginInfo.username &&
- password == loginInfo.password &&
- loginDataItem.guid == loginInfo.guid &&
- loginDataItem.encType == loginInfo.encType &&
- loginDataItem.timeCreated == loginInfo.timeCreated &&
- loginDataItem.timeLastUsed == loginInfo.timeLastUsed &&
- loginDataItem.timePasswordChanged == loginInfo.timePasswordChanged &&
- loginDataItem.timesUsed == loginInfo.timesUsed;
- });
- }));
-
- // Verify that disabled hosts have been imported.
- do_check_eq(store.data.disabledHosts.length, 2);
- do_check_true(store.data.disabledHosts.indexOf("http://www.example.com") != -1);
- do_check_true(store.data.disabledHosts.indexOf("https://www.example.org") != -1);
-});
-
-/**
- * Tests imports of NULL values due to a downgraded database.
- */
-add_task(function* test_import_downgraded()
-{
- let store = new LoginStore(getTempFile("test-import-downgraded.json").path);
- let loginsSqlite = getTempFile("test-logins-downgraded.sqlite").path;
-
- // Create and populate the SQLite database first.
- let connection = yield Sqlite.openConnection({ path: loginsSqlite });
- try {
- yield promiseCreateDatabaseSchema(connection);
- yield connection.setSchemaVersion(3);
- yield promiseInsertLoginInfo(connection, TestData.formLogin({
- guid: gUUIDGenerator.generateUUID().toString(),
- timeCreated: null,
- timeLastUsed: null,
- timePasswordChanged: null,
- timesUsed: 0,
- }));
- } finally {
- yield connection.close();
- }
-
- // The "load" method must be called before importing data.
- yield store.load();
- yield new LoginImport(store, loginsSqlite).import();
-
- // Verify that the missing metadata was generated correctly.
- let loginItem = store.data.logins[0];
- let creationTime = loginItem.timeCreated;
- LoginTestUtils.assertTimeIsAboutNow(creationTime);
- do_check_eq(loginItem.timeLastUsed, creationTime);
- do_check_eq(loginItem.timePasswordChanged, creationTime);
- do_check_eq(loginItem.timesUsed, 1);
-});
-
-/**
- * Verifies that importing from a SQLite file with database version 2 fails.
- */
-add_task(function* test_import_v2()
-{
- let store = new LoginStore(getTempFile("test-import-v2.json").path);
- let loginsSqlite = do_get_file("data/signons-v2.sqlite").path;
-
- // The "load" method must be called before importing data.
- yield store.load();
- try {
- yield new LoginImport(store, loginsSqlite).import();
- do_throw("The operation should have failed.");
- } catch (ex) { }
-});
-
-/**
- * Imports login data from a SQLite file, with database version 3.
- */
-add_task(function* test_import_v3()
-{
- let store = new LoginStore(getTempFile("test-import-v3.json").path);
- let loginsSqlite = do_get_file("data/signons-v3.sqlite").path;
-
- // The "load" method must be called before importing data.
- yield store.load();
- yield new LoginImport(store, loginsSqlite).import();
-
- // We only execute basic integrity checks.
- do_check_eq(store.data.logins[0].usernameField, "u1");
- do_check_eq(store.data.disabledHosts.length, 0);
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_module_LoginStore.js b/toolkit/components/passwordmgr/test/unit/test_module_LoginStore.js
deleted file mode 100644
index 335eb601b..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_module_LoginStore.js
+++ /dev/null
@@ -1,206 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the LoginStore object.
- */
-
-"use strict";
-
-// Globals
-
-XPCOMUtils.defineLazyModuleGetter(this, "LoginStore",
- "resource://gre/modules/LoginStore.jsm");
-
-const TEST_STORE_FILE_NAME = "test-logins.json";
-
-// Tests
-
-/**
- * Saves login data to a file, then reloads it.
- */
-add_task(function* test_save_reload()
-{
- let storeForSave = new LoginStore(getTempFile(TEST_STORE_FILE_NAME).path);
-
- // The "load" method must be called before preparing the data to be saved.
- yield storeForSave.load();
-
- let rawLoginData = {
- id: storeForSave.data.nextId++,
- hostname: "http://www.example.com",
- httpRealm: null,
- formSubmitURL: "http://www.example.com/submit-url",
- usernameField: "field_" + String.fromCharCode(533, 537, 7570, 345),
- passwordField: "field_" + String.fromCharCode(421, 259, 349, 537),
- encryptedUsername: "(test)",
- encryptedPassword: "(test)",
- guid: "(test)",
- encType: Ci.nsILoginManagerCrypto.ENCTYPE_SDR,
- timeCreated: Date.now(),
- timeLastUsed: Date.now(),
- timePasswordChanged: Date.now(),
- timesUsed: 1,
- };
- storeForSave.data.logins.push(rawLoginData);
-
- storeForSave.data.disabledHosts.push("http://www.example.org");
-
- yield storeForSave._save();
-
- // Test the asynchronous initialization path.
- let storeForLoad = new LoginStore(storeForSave.path);
- yield storeForLoad.load();
-
- do_check_eq(storeForLoad.data.logins.length, 1);
- do_check_matches(storeForLoad.data.logins[0], rawLoginData);
- do_check_eq(storeForLoad.data.disabledHosts.length, 1);
- do_check_eq(storeForLoad.data.disabledHosts[0], "http://www.example.org");
-
- // Test the synchronous initialization path.
- storeForLoad = new LoginStore(storeForSave.path);
- storeForLoad.ensureDataReady();
-
- do_check_eq(storeForLoad.data.logins.length, 1);
- do_check_matches(storeForLoad.data.logins[0], rawLoginData);
- do_check_eq(storeForLoad.data.disabledHosts.length, 1);
- do_check_eq(storeForLoad.data.disabledHosts[0], "http://www.example.org");
-});
-
-/**
- * Checks that loading from a missing file results in empty arrays.
- */
-add_task(function* test_load_empty()
-{
- let store = new LoginStore(getTempFile(TEST_STORE_FILE_NAME).path);
-
- do_check_false(yield OS.File.exists(store.path));
-
- yield store.load();
-
- do_check_false(yield OS.File.exists(store.path));
-
- do_check_eq(store.data.logins.length, 0);
- do_check_eq(store.data.disabledHosts.length, 0);
-});
-
-/**
- * Checks that saving empty data still overwrites any existing file.
- */
-add_task(function* test_save_empty()
-{
- let store = new LoginStore(getTempFile(TEST_STORE_FILE_NAME).path);
-
- yield store.load();
-
- let createdFile = yield OS.File.open(store.path, { create: true });
- yield createdFile.close();
-
- yield store._save();
-
- do_check_true(yield OS.File.exists(store.path));
-});
-
-/**
- * Loads data from a string in a predefined format. The purpose of this test is
- * to verify that the JSON format used in previous versions can be loaded.
- */
-add_task(function* test_load_string_predefined()
-{
- let store = new LoginStore(getTempFile(TEST_STORE_FILE_NAME).path);
-
- let string = "{\"logins\":[{" +
- "\"id\":1," +
- "\"hostname\":\"http://www.example.com\"," +
- "\"httpRealm\":null," +
- "\"formSubmitURL\":\"http://www.example.com/submit-url\"," +
- "\"usernameField\":\"usernameField\"," +
- "\"passwordField\":\"passwordField\"," +
- "\"encryptedUsername\":\"(test)\"," +
- "\"encryptedPassword\":\"(test)\"," +
- "\"guid\":\"(test)\"," +
- "\"encType\":1," +
- "\"timeCreated\":1262304000000," +
- "\"timeLastUsed\":1262390400000," +
- "\"timePasswordChanged\":1262476800000," +
- "\"timesUsed\":1}],\"disabledHosts\":[" +
- "\"http://www.example.org\"]}";
-
- yield OS.File.writeAtomic(store.path,
- new TextEncoder().encode(string),
- { tmpPath: store.path + ".tmp" });
-
- yield store.load();
-
- do_check_eq(store.data.logins.length, 1);
- do_check_matches(store.data.logins[0], {
- id: 1,
- hostname: "http://www.example.com",
- httpRealm: null,
- formSubmitURL: "http://www.example.com/submit-url",
- usernameField: "usernameField",
- passwordField: "passwordField",
- encryptedUsername: "(test)",
- encryptedPassword: "(test)",
- guid: "(test)",
- encType: Ci.nsILoginManagerCrypto.ENCTYPE_SDR,
- timeCreated: 1262304000000,
- timeLastUsed: 1262390400000,
- timePasswordChanged: 1262476800000,
- timesUsed: 1,
- });
-
- do_check_eq(store.data.disabledHosts.length, 1);
- do_check_eq(store.data.disabledHosts[0], "http://www.example.org");
-});
-
-/**
- * Loads login data from a malformed JSON string.
- */
-add_task(function* test_load_string_malformed()
-{
- let store = new LoginStore(getTempFile(TEST_STORE_FILE_NAME).path);
-
- let string = "{\"logins\":[{\"hostname\":\"http://www.example.com\"," +
- "\"id\":1,";
-
- yield OS.File.writeAtomic(store.path, new TextEncoder().encode(string),
- { tmpPath: store.path + ".tmp" });
-
- yield store.load();
-
- // A backup file should have been created.
- do_check_true(yield OS.File.exists(store.path + ".corrupt"));
- yield OS.File.remove(store.path + ".corrupt");
-
- // The store should be ready to accept new data.
- do_check_eq(store.data.logins.length, 0);
- do_check_eq(store.data.disabledHosts.length, 0);
-});
-
-/**
- * Loads login data from a malformed JSON string, using the synchronous
- * initialization path.
- */
-add_task(function* test_load_string_malformed_sync()
-{
- let store = new LoginStore(getTempFile(TEST_STORE_FILE_NAME).path);
-
- let string = "{\"logins\":[{\"hostname\":\"http://www.example.com\"," +
- "\"id\":1,";
-
- yield OS.File.writeAtomic(store.path, new TextEncoder().encode(string),
- { tmpPath: store.path + ".tmp" });
-
- store.ensureDataReady();
-
- // A backup file should have been created.
- do_check_true(yield OS.File.exists(store.path + ".corrupt"));
- yield OS.File.remove(store.path + ".corrupt");
-
- // The store should be ready to accept new data.
- do_check_eq(store.data.logins.length, 0);
- do_check_eq(store.data.disabledHosts.length, 0);
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_notifications.js b/toolkit/components/passwordmgr/test/unit/test_notifications.js
deleted file mode 100644
index 41caa2c1b..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_notifications.js
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Tests notifications dispatched when modifying stored logins.
- */
-
-var expectedNotification;
-var expectedData;
-
-var TestObserver = {
- QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
-
- observe : function (subject, topic, data) {
- do_check_eq(topic, "passwordmgr-storage-changed");
- do_check_eq(data, expectedNotification);
-
- switch (data) {
- case "addLogin":
- do_check_true(subject instanceof Ci.nsILoginInfo);
- do_check_true(subject instanceof Ci.nsILoginMetaInfo);
- do_check_true(expectedData.equals(subject)); // nsILoginInfo.equals()
- break;
- case "modifyLogin":
- do_check_true(subject instanceof Ci.nsIArray);
- do_check_eq(subject.length, 2);
- var oldLogin = subject.queryElementAt(0, Ci.nsILoginInfo);
- var newLogin = subject.queryElementAt(1, Ci.nsILoginInfo);
- do_check_true(expectedData[0].equals(oldLogin)); // nsILoginInfo.equals()
- do_check_true(expectedData[1].equals(newLogin));
- break;
- case "removeLogin":
- do_check_true(subject instanceof Ci.nsILoginInfo);
- do_check_true(subject instanceof Ci.nsILoginMetaInfo);
- do_check_true(expectedData.equals(subject)); // nsILoginInfo.equals()
- break;
- case "removeAllLogins":
- do_check_eq(subject, null);
- break;
- case "hostSavingEnabled":
- case "hostSavingDisabled":
- do_check_true(subject instanceof Ci.nsISupportsString);
- do_check_eq(subject.data, expectedData);
- break;
- default:
- do_throw("Unhandled notification: " + data + " / " + topic);
- }
-
- expectedNotification = null; // ensure a duplicate is flagged as unexpected.
- expectedData = null;
- }
-};
-
-add_task(function test_notifications()
-{
-
-try {
-
-var testnum = 0;
-var testdesc = "Setup of nsLoginInfo test-users";
-
-var testuser1 = new LoginInfo("http://testhost1", "", null,
- "dummydude", "itsasecret", "put_user_here", "put_pw_here");
-
-var testuser2 = new LoginInfo("http://testhost2", "", null,
- "dummydude2", "itsasecret2", "put_user2_here", "put_pw2_here");
-
-Services.obs.addObserver(TestObserver, "passwordmgr-storage-changed", false);
-
-
-/* ========== 1 ========== */
-testnum = 1;
-testdesc = "Initial connection to storage module";
-
-/* ========== 2 ========== */
-testnum++;
-testdesc = "addLogin";
-
-expectedNotification = "addLogin";
-expectedData = testuser1;
-Services.logins.addLogin(testuser1);
-LoginTestUtils.checkLogins([testuser1]);
-do_check_eq(expectedNotification, null); // check that observer got a notification
-
-/* ========== 3 ========== */
-testnum++;
-testdesc = "modifyLogin";
-
-expectedNotification = "modifyLogin";
-expectedData = [testuser1, testuser2];
-Services.logins.modifyLogin(testuser1, testuser2);
-do_check_eq(expectedNotification, null);
-LoginTestUtils.checkLogins([testuser2]);
-
-/* ========== 4 ========== */
-testnum++;
-testdesc = "removeLogin";
-
-expectedNotification = "removeLogin";
-expectedData = testuser2;
-Services.logins.removeLogin(testuser2);
-do_check_eq(expectedNotification, null);
-LoginTestUtils.checkLogins([]);
-
-/* ========== 5 ========== */
-testnum++;
-testdesc = "removeAllLogins";
-
-expectedNotification = "removeAllLogins";
-expectedData = null;
-Services.logins.removeAllLogins();
-do_check_eq(expectedNotification, null);
-LoginTestUtils.checkLogins([]);
-
-/* ========== 6 ========== */
-testnum++;
-testdesc = "removeAllLogins (again)";
-
-expectedNotification = "removeAllLogins";
-expectedData = null;
-Services.logins.removeAllLogins();
-do_check_eq(expectedNotification, null);
-LoginTestUtils.checkLogins([]);
-
-/* ========== 7 ========== */
-testnum++;
-testdesc = "setLoginSavingEnabled / false";
-
-expectedNotification = "hostSavingDisabled";
-expectedData = "http://site.com";
-Services.logins.setLoginSavingEnabled("http://site.com", false);
-do_check_eq(expectedNotification, null);
-LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(),
- ["http://site.com"]);
-
-/* ========== 8 ========== */
-testnum++;
-testdesc = "setLoginSavingEnabled / false (again)";
-
-expectedNotification = "hostSavingDisabled";
-expectedData = "http://site.com";
-Services.logins.setLoginSavingEnabled("http://site.com", false);
-do_check_eq(expectedNotification, null);
-LoginTestUtils.assertDisabledHostsEqual(Services.logins.getAllDisabledHosts(),
- ["http://site.com"]);
-
-/* ========== 9 ========== */
-testnum++;
-testdesc = "setLoginSavingEnabled / true";
-
-expectedNotification = "hostSavingEnabled";
-expectedData = "http://site.com";
-Services.logins.setLoginSavingEnabled("http://site.com", true);
-do_check_eq(expectedNotification, null);
-LoginTestUtils.checkLogins([]);
-
-/* ========== 10 ========== */
-testnum++;
-testdesc = "setLoginSavingEnabled / true (again)";
-
-expectedNotification = "hostSavingEnabled";
-expectedData = "http://site.com";
-Services.logins.setLoginSavingEnabled("http://site.com", true);
-do_check_eq(expectedNotification, null);
-LoginTestUtils.checkLogins([]);
-
-Services.obs.removeObserver(TestObserver, "passwordmgr-storage-changed");
-
-LoginTestUtils.clearData();
-
-} catch (e) {
- throw new Error("FAILED in test #" + testnum + " -- " + testdesc + ": " + e);
-}
-
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_recipes_add.js b/toolkit/components/passwordmgr/test/unit/test_recipes_add.js
deleted file mode 100644
index ef5086c3b..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_recipes_add.js
+++ /dev/null
@@ -1,177 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests adding and retrieving LoginRecipes in the parent process.
- */
-
-"use strict";
-
-add_task(function* test_init() {
- let parent = new LoginRecipesParent({ defaults: null });
- let initPromise1 = parent.initializationPromise;
- let initPromise2 = parent.initializationPromise;
- Assert.strictEqual(initPromise1, initPromise2, "Check that the same promise is returned");
-
- let recipesParent = yield initPromise1;
- Assert.ok(recipesParent instanceof LoginRecipesParent, "Check init return value");
- Assert.strictEqual(recipesParent._recipesByHost.size, 0, "Initially 0 recipes");
-});
-
-add_task(function* test_get_missing_host() {
- let recipesParent = yield RecipeHelpers.initNewParent();
- let exampleRecipes = recipesParent.getRecipesForHost("example.invalid");
- Assert.strictEqual(exampleRecipes.size, 0, "Check recipe count for example.invalid");
-
-});
-
-add_task(function* test_add_get_simple_host() {
- let recipesParent = yield RecipeHelpers.initNewParent();
- Assert.strictEqual(recipesParent._recipesByHost.size, 0, "Initially 0 recipes");
- recipesParent.add({
- hosts: ["example.com"],
- });
- Assert.strictEqual(recipesParent._recipesByHost.size, 1,
- "Check number of hosts after the addition");
-
- let exampleRecipes = recipesParent.getRecipesForHost("example.com");
- Assert.strictEqual(exampleRecipes.size, 1, "Check recipe count for example.com");
- let recipe = [...exampleRecipes][0];
- Assert.strictEqual(typeof(recipe), "object", "Check recipe type");
- Assert.strictEqual(recipe.hosts.length, 1, "Check that one host is present");
- Assert.strictEqual(recipe.hosts[0], "example.com", "Check the one host");
-});
-
-add_task(function* test_add_get_non_standard_port_host() {
- let recipesParent = yield RecipeHelpers.initNewParent();
- recipesParent.add({
- hosts: ["example.com:8080"],
- });
- Assert.strictEqual(recipesParent._recipesByHost.size, 1,
- "Check number of hosts after the addition");
-
- let exampleRecipes = recipesParent.getRecipesForHost("example.com:8080");
- Assert.strictEqual(exampleRecipes.size, 1, "Check recipe count for example.com:8080");
- let recipe = [...exampleRecipes][0];
- Assert.strictEqual(typeof(recipe), "object", "Check recipe type");
- Assert.strictEqual(recipe.hosts.length, 1, "Check that one host is present");
- Assert.strictEqual(recipe.hosts[0], "example.com:8080", "Check the one host");
-});
-
-add_task(function* test_add_multiple_hosts() {
- let recipesParent = yield RecipeHelpers.initNewParent();
- recipesParent.add({
- hosts: ["example.com", "foo.invalid"],
- });
- Assert.strictEqual(recipesParent._recipesByHost.size, 2,
- "Check number of hosts after the addition");
-
- let exampleRecipes = recipesParent.getRecipesForHost("example.com");
- Assert.strictEqual(exampleRecipes.size, 1, "Check recipe count for example.com");
- let recipe = [...exampleRecipes][0];
- Assert.strictEqual(typeof(recipe), "object", "Check recipe type");
- Assert.strictEqual(recipe.hosts.length, 2, "Check that two hosts are present");
- Assert.strictEqual(recipe.hosts[0], "example.com", "Check the first host");
- Assert.strictEqual(recipe.hosts[1], "foo.invalid", "Check the second host");
-
- let fooRecipes = recipesParent.getRecipesForHost("foo.invalid");
- Assert.strictEqual(fooRecipes.size, 1, "Check recipe count for foo.invalid");
- let fooRecipe = [...fooRecipes][0];
- Assert.strictEqual(fooRecipe, recipe, "Check that the recipe is shared");
- Assert.strictEqual(typeof(fooRecipe), "object", "Check recipe type");
- Assert.strictEqual(fooRecipe.hosts.length, 2, "Check that two hosts are present");
- Assert.strictEqual(fooRecipe.hosts[0], "example.com", "Check the first host");
- Assert.strictEqual(fooRecipe.hosts[1], "foo.invalid", "Check the second host");
-});
-
-add_task(function* test_add_pathRegex() {
- let recipesParent = yield RecipeHelpers.initNewParent();
- recipesParent.add({
- hosts: ["example.com"],
- pathRegex: /^\/mypath\//,
- });
- Assert.strictEqual(recipesParent._recipesByHost.size, 1,
- "Check number of hosts after the addition");
-
- let exampleRecipes = recipesParent.getRecipesForHost("example.com");
- Assert.strictEqual(exampleRecipes.size, 1, "Check recipe count for example.com");
- let recipe = [...exampleRecipes][0];
- Assert.strictEqual(typeof(recipe), "object", "Check recipe type");
- Assert.strictEqual(recipe.hosts.length, 1, "Check that one host is present");
- Assert.strictEqual(recipe.hosts[0], "example.com", "Check the one host");
- Assert.strictEqual(recipe.pathRegex.toString(), "/^\\/mypath\\//", "Check the pathRegex");
-});
-
-add_task(function* test_add_selectors() {
- let recipesParent = yield RecipeHelpers.initNewParent();
- recipesParent.add({
- hosts: ["example.com"],
- usernameSelector: "#my-username",
- passwordSelector: "#my-form > input.password",
- });
- Assert.strictEqual(recipesParent._recipesByHost.size, 1,
- "Check number of hosts after the addition");
-
- let exampleRecipes = recipesParent.getRecipesForHost("example.com");
- Assert.strictEqual(exampleRecipes.size, 1, "Check recipe count for example.com");
- let recipe = [...exampleRecipes][0];
- Assert.strictEqual(typeof(recipe), "object", "Check recipe type");
- Assert.strictEqual(recipe.hosts.length, 1, "Check that one host is present");
- Assert.strictEqual(recipe.hosts[0], "example.com", "Check the one host");
- Assert.strictEqual(recipe.usernameSelector, "#my-username", "Check the usernameSelector");
- Assert.strictEqual(recipe.passwordSelector, "#my-form > input.password", "Check the passwordSelector");
-});
-
-/* Begin checking errors with add */
-
-add_task(function* test_add_missing_prop() {
- let recipesParent = yield RecipeHelpers.initNewParent();
- Assert.throws(() => recipesParent.add({}), /required/, "Some properties are required");
-});
-
-add_task(function* test_add_unknown_prop() {
- let recipesParent = yield RecipeHelpers.initNewParent();
- Assert.throws(() => recipesParent.add({
- unknownProp: true,
- }), /supported/, "Unknown properties should cause an error to help with typos");
-});
-
-add_task(function* test_add_invalid_hosts() {
- let recipesParent = yield RecipeHelpers.initNewParent();
- Assert.throws(() => recipesParent.add({
- hosts: 404,
- }), /array/, "hosts should be an array");
-});
-
-add_task(function* test_add_empty_host_array() {
- let recipesParent = yield RecipeHelpers.initNewParent();
- Assert.throws(() => recipesParent.add({
- hosts: [],
- }), /array/, "hosts should be a non-empty array");
-});
-
-add_task(function* test_add_pathRegex_non_regexp() {
- let recipesParent = yield RecipeHelpers.initNewParent();
- Assert.throws(() => recipesParent.add({
- hosts: ["example.com"],
- pathRegex: "foo",
- }), /regular expression/, "pathRegex should be a RegExp");
-});
-
-add_task(function* test_add_usernameSelector_non_string() {
- let recipesParent = yield RecipeHelpers.initNewParent();
- Assert.throws(() => recipesParent.add({
- hosts: ["example.com"],
- usernameSelector: 404,
- }), /string/, "usernameSelector should be a string");
-});
-
-add_task(function* test_add_passwordSelector_non_string() {
- let recipesParent = yield RecipeHelpers.initNewParent();
- Assert.throws(() => recipesParent.add({
- hosts: ["example.com"],
- passwordSelector: 404,
- }), /string/, "passwordSelector should be a string");
-});
-
-/* End checking errors with add */
diff --git a/toolkit/components/passwordmgr/test/unit/test_recipes_content.js b/toolkit/components/passwordmgr/test/unit/test_recipes_content.js
deleted file mode 100644
index 3d3751452..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_recipes_content.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Test filtering recipes in LoginRecipesContent.
- */
-
-"use strict";
-
-Cu.importGlobalProperties(["URL"]);
-
-add_task(function* test_getFieldOverrides() {
- let recipes = new Set([
- { // path doesn't match but otherwise good
- hosts: ["example.com:8080"],
- passwordSelector: "#password",
- pathRegex: /^\/$/,
- usernameSelector: ".username",
- },
- { // match with no field overrides
- hosts: ["example.com:8080"],
- },
- { // best match (field selectors + path match)
- description: "best match",
- hosts: ["a.invalid", "example.com:8080", "other.invalid"],
- passwordSelector: "#password",
- pathRegex: /^\/first\/second\/$/,
- usernameSelector: ".username",
- },
- ]);
-
- let form = MockDocument.createTestDocument("http://localhost:8080/first/second/", "<form>").
- forms[0];
- let override = LoginRecipesContent.getFieldOverrides(recipes, form);
- Assert.strictEqual(override.description, "best match",
- "Check the best field override recipe was returned");
- Assert.strictEqual(override.usernameSelector, ".username", "Check usernameSelector");
- Assert.strictEqual(override.passwordSelector, "#password", "Check passwordSelector");
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_removeLegacySignonFiles.js b/toolkit/components/passwordmgr/test/unit/test_removeLegacySignonFiles.js
deleted file mode 100644
index 51a107170..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_removeLegacySignonFiles.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * Tests the LoginHelper object.
- */
-
-"use strict";
-
-
-Cu.import("resource://gre/modules/Task.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
- "resource://gre/modules/LoginHelper.jsm");
-
-
-function* createSignonFile(singon) {
- let {file, pref} = singon;
-
- if (pref) {
- Services.prefs.setCharPref(pref, file);
- }
-
- yield OS.File.writeAtomic(
- OS.Path.join(OS.Constants.Path.profileDir, file), new Uint8Array(1));
-}
-
-function* isSignonClear(singon) {
- const {file, pref} = singon;
- const fileExists = yield OS.File.exists(
- OS.Path.join(OS.Constants.Path.profileDir, file));
-
- if (pref) {
- try {
- Services.prefs.getCharPref(pref);
- return false;
- } catch (e) {}
- }
-
- return !fileExists;
-}
-
-add_task(function* test_remove_lagecy_signonfile() {
- // In the last test case, signons3.txt being deleted even when
- // it doesn't exist.
- const signonsSettings = [[
- { file: "signons.txt" },
- { file: "signons2.txt" },
- { file: "signons3.txt" }
- ], [
- { file: "signons.txt", pref: "signon.SignonFileName" },
- { file: "signons2.txt", pref: "signon.SignonFileName2" },
- { file: "signons3.txt", pref: "signon.SignonFileName3" }
- ], [
- { file: "signons2.txt" },
- { file: "singons.txt", pref: "signon.SignonFileName" },
- { file: "customized2.txt", pref: "signon.SignonFileName2" },
- { file: "customized3.txt", pref: "signon.SignonFileName3" }
- ]];
-
- for (let setting of signonsSettings) {
- for (let singon of setting) {
- yield createSignonFile(singon);
- }
-
- LoginHelper.removeLegacySignonFiles();
-
- for (let singon of setting) {
- equal(yield isSignonClear(singon), true);
- }
- }
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_search_schemeUpgrades.js b/toolkit/components/passwordmgr/test/unit/test_search_schemeUpgrades.js
deleted file mode 100644
index 3406becff..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_search_schemeUpgrades.js
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * Test Services.logins.searchLogins with the `schemeUpgrades` property.
- */
-
-const HTTP3_ORIGIN = "http://www3.example.com";
-const HTTPS_ORIGIN = "https://www.example.com";
-const HTTP_ORIGIN = "http://www.example.com";
-
-/**
- * Returns a list of new nsILoginInfo objects that are a subset of the test
- * data, built to match the specified query.
- *
- * @param {Object} aQuery
- * Each property and value of this object restricts the search to those
- * entries from the test data that match the property exactly.
- */
-function buildExpectedLogins(aQuery) {
- return TestData.loginList().filter(
- entry => Object.keys(aQuery).every(name => {
- if (name == "schemeUpgrades") {
- return true;
- }
- if (["hostname", "formSubmitURL"].includes(name)) {
- return LoginHelper.isOriginMatching(entry[name], aQuery[name], {
- schemeUpgrades: aQuery.schemeUpgrades,
- });
- }
- return entry[name] === aQuery[name];
- }));
-}
-
-/**
- * Tests the searchLogins function.
- *
- * @param {Object} aQuery
- * Each property and value of this object is translated to an entry in
- * the nsIPropertyBag parameter of searchLogins.
- * @param {Number} aExpectedCount
- * Number of logins from the test data that should be found. The actual
- * list of logins is obtained using the buildExpectedLogins helper, and
- * this value is just used to verify that modifications to the test data
- * don't make the current test meaningless.
- */
-function checkSearch(aQuery, aExpectedCount) {
- do_print("Testing searchLogins for " + JSON.stringify(aQuery));
-
- let expectedLogins = buildExpectedLogins(aQuery);
- do_check_eq(expectedLogins.length, aExpectedCount);
-
- let outCount = {};
- let logins = Services.logins.searchLogins(outCount, newPropertyBag(aQuery));
- do_check_eq(outCount.value, expectedLogins.length);
- LoginTestUtils.assertLoginListsEqual(logins, expectedLogins);
-}
-
-/**
- * Prepare data for the following tests.
- */
-add_task(function test_initialize() {
- for (let login of TestData.loginList()) {
- Services.logins.addLogin(login);
- }
-});
-
-/**
- * Tests searchLogins with the `schemeUpgrades` property
- */
-add_task(function test_search_schemeUpgrades_hostname() {
- // Hostname-only
- checkSearch({
- hostname: HTTPS_ORIGIN,
- }, 1);
- checkSearch({
- hostname: HTTPS_ORIGIN,
- schemeUpgrades: false,
- }, 1);
- checkSearch({
- hostname: HTTPS_ORIGIN,
- schemeUpgrades: undefined,
- }, 1);
- checkSearch({
- hostname: HTTPS_ORIGIN,
- schemeUpgrades: true,
- }, 2);
-});
-
-/**
- * Same as above but replacing hostname with formSubmitURL.
- */
-add_task(function test_search_schemeUpgrades_formSubmitURL() {
- checkSearch({
- formSubmitURL: HTTPS_ORIGIN,
- }, 2);
- checkSearch({
- formSubmitURL: HTTPS_ORIGIN,
- schemeUpgrades: false,
- }, 2);
- checkSearch({
- formSubmitURL: HTTPS_ORIGIN,
- schemeUpgrades: undefined,
- }, 2);
- checkSearch({
- formSubmitURL: HTTPS_ORIGIN,
- schemeUpgrades: true,
- }, 4);
-});
-
-
-add_task(function test_search_schemeUpgrades_hostname_formSubmitURL() {
- checkSearch({
- formSubmitURL: HTTPS_ORIGIN,
- hostname: HTTPS_ORIGIN,
- }, 1);
- checkSearch({
- formSubmitURL: HTTPS_ORIGIN,
- hostname: HTTPS_ORIGIN,
- schemeUpgrades: false,
- }, 1);
- checkSearch({
- formSubmitURL: HTTPS_ORIGIN,
- hostname: HTTPS_ORIGIN,
- schemeUpgrades: undefined,
- }, 1);
- checkSearch({
- formSubmitURL: HTTPS_ORIGIN,
- hostname: HTTPS_ORIGIN,
- schemeUpgrades: true,
- }, 2);
- checkSearch({
- formSubmitURL: HTTPS_ORIGIN,
- hostname: HTTPS_ORIGIN,
- schemeUpgrades: true,
- usernameField: "form_field_username",
- }, 2);
- checkSearch({
- formSubmitURL: HTTPS_ORIGIN,
- hostname: HTTPS_ORIGIN,
- passwordField: "form_field_password",
- schemeUpgrades: true,
- usernameField: "form_field_username",
- }, 2);
- checkSearch({
- formSubmitURL: HTTPS_ORIGIN,
- hostname: HTTPS_ORIGIN,
- httpRealm: null,
- passwordField: "form_field_password",
- schemeUpgrades: true,
- usernameField: "form_field_username",
- }, 2);
-});
-
-/**
- * HTTP submitting to HTTPS
- */
-add_task(function test_http_to_https() {
- checkSearch({
- formSubmitURL: HTTPS_ORIGIN,
- hostname: HTTP3_ORIGIN,
- httpRealm: null,
- schemeUpgrades: false,
- }, 1);
- checkSearch({
- formSubmitURL: HTTPS_ORIGIN,
- hostname: HTTP3_ORIGIN,
- httpRealm: null,
- schemeUpgrades: true,
- }, 2);
-});
-
-/**
- * schemeUpgrades shouldn't cause downgrades
- */
-add_task(function test_search_schemeUpgrades_downgrade() {
- checkSearch({
- formSubmitURL: HTTP_ORIGIN,
- hostname: HTTP_ORIGIN,
- }, 1);
- do_print("The same number should be found with schemeUpgrades since we're searching for HTTP");
- checkSearch({
- formSubmitURL: HTTP_ORIGIN,
- hostname: HTTP_ORIGIN,
- schemeUpgrades: true,
- }, 1);
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_storage.js b/toolkit/components/passwordmgr/test/unit/test_storage.js
deleted file mode 100644
index d65516d9b..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_storage.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests that the default nsILoginManagerStorage module attached to the Login
- * Manager service is able to save and reload nsILoginInfo properties correctly,
- * even when they include special characters.
- */
-
-"use strict";
-
-// Globals
-
-function* reloadAndCheckLoginsGen(aExpectedLogins)
-{
- yield LoginTestUtils.reloadData();
- LoginTestUtils.checkLogins(aExpectedLogins);
- LoginTestUtils.clearData();
-}
-
-// Tests
-
-/**
- * Tests addLogin with valid non-ASCII characters.
- */
-add_task(function* test_storage_addLogin_nonascii()
-{
- let hostname = "http://" + String.fromCharCode(355) + ".example.com";
-
- // Store the strings "user" and "pass" using similarly looking glyphs.
- let loginInfo = TestData.formLogin({
- hostname: hostname,
- formSubmitURL: hostname,
- username: String.fromCharCode(533, 537, 7570, 345),
- password: String.fromCharCode(421, 259, 349, 537),
- usernameField: "field_" + String.fromCharCode(533, 537, 7570, 345),
- passwordField: "field_" + String.fromCharCode(421, 259, 349, 537),
- });
- Services.logins.addLogin(loginInfo);
- yield* reloadAndCheckLoginsGen([loginInfo]);
-
- // Store the string "test" using similarly looking glyphs.
- loginInfo = TestData.authLogin({
- httpRealm: String.fromCharCode(355, 277, 349, 357),
- });
- Services.logins.addLogin(loginInfo);
- yield* reloadAndCheckLoginsGen([loginInfo]);
-});
-
-/**
- * Tests addLogin with newline characters in the username and password.
- */
-add_task(function* test_storage_addLogin_newlines()
-{
- let loginInfo = TestData.formLogin({
- username: "user\r\nname",
- password: "password\r\n",
- });
- Services.logins.addLogin(loginInfo);
- yield* reloadAndCheckLoginsGen([loginInfo]);
-});
-
-/**
- * Tests addLogin with a single dot in fields where it is allowed.
- *
- * These tests exist to verify the legacy "signons.txt" storage format.
- */
-add_task(function* test_storage_addLogin_dot()
-{
- let loginInfo = TestData.formLogin({ hostname: ".", passwordField: "." });
- Services.logins.addLogin(loginInfo);
- yield* reloadAndCheckLoginsGen([loginInfo]);
-
- loginInfo = TestData.authLogin({ httpRealm: "." });
- Services.logins.addLogin(loginInfo);
- yield* reloadAndCheckLoginsGen([loginInfo]);
-});
-
-/**
- * Tests addLogin with parentheses in hostnames.
- *
- * These tests exist to verify the legacy "signons.txt" storage format.
- */
-add_task(function* test_storage_addLogin_parentheses()
-{
- let loginList = [
- TestData.authLogin({ httpRealm: "(realm" }),
- TestData.authLogin({ httpRealm: "realm)" }),
- TestData.authLogin({ httpRealm: "(realm)" }),
- TestData.authLogin({ httpRealm: ")realm(" }),
- TestData.authLogin({ hostname: "http://parens(.example.com" }),
- TestData.authLogin({ hostname: "http://parens).example.com" }),
- TestData.authLogin({ hostname: "http://parens(example).example.com" }),
- TestData.authLogin({ hostname: "http://parens)example(.example.com" }),
- ];
- for (let loginInfo of loginList) {
- Services.logins.addLogin(loginInfo);
- }
- yield* reloadAndCheckLoginsGen(loginList);
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_storage_mozStorage.js b/toolkit/components/passwordmgr/test/unit/test_storage_mozStorage.js
deleted file mode 100644
index 8eab6efe5..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_storage_mozStorage.js
+++ /dev/null
@@ -1,507 +0,0 @@
-/*
- * This test interfaces directly with the mozStorage password storage module,
- * bypassing the normal password manager usage.
- */
-
-
-const ENCTYPE_BASE64 = 0;
-const ENCTYPE_SDR = 1;
-const PERMISSION_SAVE_LOGINS = "login-saving";
-
-// Current schema version used by storage-mozStorage.js. This will need to be
-// kept in sync with the version there (or else the tests fail).
-const CURRENT_SCHEMA = 6;
-
-function* copyFile(aLeafName)
-{
- yield OS.File.copy(OS.Path.join(do_get_file("data").path, aLeafName),
- OS.Path.join(OS.Constants.Path.profileDir, aLeafName));
-}
-
-function openDB(aLeafName)
-{
- var dbFile = new FileUtils.File(OS.Constants.Path.profileDir);
- dbFile.append(aLeafName);
-
- return Services.storage.openDatabase(dbFile);
-}
-
-function deleteFile(pathname, filename)
-{
- var file = new FileUtils.File(pathname);
- file.append(filename);
-
- // Suppress failures, this happens in the mozstorage tests on Windows
- // because the module may still be holding onto the DB. (We don't
- // have a way to explicitly shutdown/GC the module).
- try {
- if (file.exists())
- file.remove(false);
- } catch (e) {}
-}
-
-function reloadStorage(aInputPathName, aInputFileName)
-{
- var inputFile = null;
- if (aInputFileName) {
- inputFile = Cc["@mozilla.org/file/local;1"].
- createInstance(Ci.nsILocalFile);
- inputFile.initWithPath(aInputPathName);
- inputFile.append(aInputFileName);
- }
-
- let storage = Cc["@mozilla.org/login-manager/storage/mozStorage;1"]
- .createInstance(Ci.nsILoginManagerStorage);
- storage.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIVariant)
- .initWithFile(inputFile);
-
- return storage;
-}
-
-function checkStorageData(storage, ref_disabledHosts, ref_logins)
-{
- LoginTestUtils.assertLoginListsEqual(storage.getAllLogins(), ref_logins);
- LoginTestUtils.assertDisabledHostsEqual(getAllDisabledHostsFromPermissionManager(),
- ref_disabledHosts);
-}
-
-function getAllDisabledHostsFromPermissionManager() {
- let disabledHosts = [];
- let enumerator = Services.perms.enumerator;
-
- while (enumerator.hasMoreElements()) {
- let perm = enumerator.getNext();
- if (perm.type == PERMISSION_SAVE_LOGINS && perm.capability == Services.perms.DENY_ACTION) {
- disabledHosts.push(perm.principal.URI.prePath);
- }
- }
-
- return disabledHosts;
-}
-
-function setLoginSavingEnabled(origin, enabled) {
- let uri = Services.io.newURI(origin, null, null);
-
- if (enabled) {
- Services.perms.remove(uri, PERMISSION_SAVE_LOGINS);
- } else {
- Services.perms.add(uri, PERMISSION_SAVE_LOGINS, Services.perms.DENY_ACTION);
- }
-}
-
-add_task(function* test_execute()
-{
-
-const OUTDIR = OS.Constants.Path.profileDir;
-
-try {
-
-var isGUID = /^\{[0-9a-f\d]{8}-[0-9a-f\d]{4}-[0-9a-f\d]{4}-[0-9a-f\d]{4}-[0-9a-f\d]{12}\}$/;
-function getGUIDforID(conn, id) {
- var stmt = conn.createStatement("SELECT guid from moz_logins WHERE id = " + id);
- stmt.executeStep();
- var guid = stmt.getString(0);
- stmt.finalize();
- return guid;
-}
-
-function getEncTypeForID(conn, id) {
- var stmt = conn.createStatement("SELECT encType from moz_logins WHERE id = " + id);
- stmt.executeStep();
- var encType = stmt.row.encType;
- stmt.finalize();
- return encType;
-}
-
-function getAllDisabledHostsFromMozStorage(conn) {
- let disabledHosts = [];
- let stmt = conn.createStatement("SELECT hostname from moz_disabledHosts");
-
- while (stmt.executeStep()) {
- disabledHosts.push(stmt.row.hostname);
- }
-
- return disabledHosts;
-}
-
-var storage;
-var dbConnection;
-var testnum = 0;
-var testdesc = "Setup of nsLoginInfo test-users";
-var nsLoginInfo = new Components.Constructor(
- "@mozilla.org/login-manager/loginInfo;1",
- Components.interfaces.nsILoginInfo);
-do_check_true(nsLoginInfo != null);
-
-var testuser1 = new nsLoginInfo;
-testuser1.init("http://test.com", "http://test.com", null,
- "testuser1", "testpass1", "u1", "p1");
-var testuser1B = new nsLoginInfo;
-testuser1B.init("http://test.com", "http://test.com", null,
- "testuser1B", "testpass1B", "u1", "p1");
-var testuser2 = new nsLoginInfo;
-testuser2.init("http://test.org", "http://test.org", null,
- "testuser2", "testpass2", "u2", "p2");
-var testuser3 = new nsLoginInfo;
-testuser3.init("http://test.gov", "http://test.gov", null,
- "testuser3", "testpass3", "u3", "p3");
-var testuser4 = new nsLoginInfo;
-testuser4.init("http://test.gov", "http://test.gov", null,
- "testuser1", "testpass2", "u4", "p4");
-var testuser5 = new nsLoginInfo;
-testuser5.init("http://test.gov", "http://test.gov", null,
- "testuser2", "testpass1", "u5", "p5");
-
-
-/* ========== 1 ========== */
-testnum++;
-testdesc = "Test downgrade from v999 storage";
-
-yield* copyFile("signons-v999.sqlite");
-// Verify the schema version in the test file.
-dbConnection = openDB("signons-v999.sqlite");
-do_check_eq(999, dbConnection.schemaVersion);
-dbConnection.close();
-
-storage = reloadStorage(OUTDIR, "signons-v999.sqlite");
-setLoginSavingEnabled("https://disabled.net", false);
-checkStorageData(storage, ["https://disabled.net"], [testuser1]);
-
-// Check to make sure we downgraded the schema version.
-dbConnection = openDB("signons-v999.sqlite");
-do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
-dbConnection.close();
-
-deleteFile(OUTDIR, "signons-v999.sqlite");
-
-/* ========== 2 ========== */
-testnum++;
-testdesc = "Test downgrade from incompat v999 storage";
-// This file has a testuser999/testpass999, but is missing an expected column
-
-var origFile = OS.Path.join(OUTDIR, "signons-v999-2.sqlite");
-var failFile = OS.Path.join(OUTDIR, "signons-v999-2.sqlite.corrupt");
-
-// Make sure we always start clean in a clean state.
-yield* copyFile("signons-v999-2.sqlite");
-yield OS.File.remove(failFile);
-
-Assert.throws(() => reloadStorage(OUTDIR, "signons-v999-2.sqlite"),
- /Initialization failed/);
-
-// Check to ensure the DB file was renamed to .corrupt.
-do_check_false(yield OS.File.exists(origFile));
-do_check_true(yield OS.File.exists(failFile));
-
-yield OS.File.remove(failFile);
-
-/* ========== 3 ========== */
-testnum++;
-testdesc = "Test upgrade from v1->v2 storage";
-
-yield* copyFile("signons-v1.sqlite");
-// Sanity check the test file.
-dbConnection = openDB("signons-v1.sqlite");
-do_check_eq(1, dbConnection.schemaVersion);
-dbConnection.close();
-
-storage = reloadStorage(OUTDIR, "signons-v1.sqlite");
-checkStorageData(storage, ["https://disabled.net"], [testuser1, testuser2]);
-
-// Check to see that we added a GUIDs to the logins.
-dbConnection = openDB("signons-v1.sqlite");
-do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
-var guid = getGUIDforID(dbConnection, 1);
-do_check_true(isGUID.test(guid));
-guid = getGUIDforID(dbConnection, 2);
-do_check_true(isGUID.test(guid));
-dbConnection.close();
-
-deleteFile(OUTDIR, "signons-v1.sqlite");
-
-/* ========== 4 ========== */
-testnum++;
-testdesc = "Test upgrade v2->v1 storage";
-// This is the case where a v2 DB has been accessed with v1 code, and now we
-// are upgrading it again. Any logins added by the v1 code must be properly
-// upgraded.
-
-yield* copyFile("signons-v1v2.sqlite");
-// Sanity check the test file.
-dbConnection = openDB("signons-v1v2.sqlite");
-do_check_eq(1, dbConnection.schemaVersion);
-dbConnection.close();
-
-storage = reloadStorage(OUTDIR, "signons-v1v2.sqlite");
-checkStorageData(storage, ["https://disabled.net"], [testuser1, testuser2, testuser3]);
-
-// While we're here, try modifying a login, to ensure that doing so doesn't
-// change the existing GUID.
-storage.modifyLogin(testuser1, testuser1B);
-checkStorageData(storage, ["https://disabled.net"], [testuser1B, testuser2, testuser3]);
-
-// Check the GUIDs. Logins 1 and 2 should retain their original GUID, login 3
-// should have one created (because it didn't have one previously).
-dbConnection = openDB("signons-v1v2.sqlite");
-do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
-guid = getGUIDforID(dbConnection, 1);
-do_check_eq("{655c7358-f1d6-6446-adab-53f98ac5d80f}", guid);
-guid = getGUIDforID(dbConnection, 2);
-do_check_eq("{13d9bfdc-572a-4d4e-9436-68e9803e84c1}", guid);
-guid = getGUIDforID(dbConnection, 3);
-do_check_true(isGUID.test(guid));
-dbConnection.close();
-
-deleteFile(OUTDIR, "signons-v1v2.sqlite");
-
-/* ========== 5 ========== */
-testnum++;
-testdesc = "Test upgrade from v2->v3 storage";
-
-yield* copyFile("signons-v2.sqlite");
-// Sanity check the test file.
-dbConnection = openDB("signons-v2.sqlite");
-do_check_eq(2, dbConnection.schemaVersion);
-
-storage = reloadStorage(OUTDIR, "signons-v2.sqlite");
-
-// Check to see that we added the correct encType to the logins.
-do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
-var encTypes = [ENCTYPE_BASE64, ENCTYPE_SDR, ENCTYPE_BASE64, ENCTYPE_BASE64];
-for (let i = 0; i < encTypes.length; i++)
- do_check_eq(encTypes[i], getEncTypeForID(dbConnection, i + 1));
-dbConnection.close();
-
-// There are 4 logins, but 3 will be invalid because we can no longer decrypt
-// base64-encoded items. (testuser1/4/5)
-checkStorageData(storage, ["https://disabled.net"],
- [testuser2]);
-
-deleteFile(OUTDIR, "signons-v2.sqlite");
-
-/* ========== 6 ========== */
-testnum++;
-testdesc = "Test upgrade v3->v2 storage";
-// This is the case where a v3 DB has been accessed with v2 code, and now we
-// are upgrading it again. Any logins added by the v2 code must be properly
-// upgraded.
-
-yield* copyFile("signons-v2v3.sqlite");
-// Sanity check the test file.
-dbConnection = openDB("signons-v2v3.sqlite");
-do_check_eq(2, dbConnection.schemaVersion);
-encTypes = [ENCTYPE_BASE64, ENCTYPE_SDR, ENCTYPE_BASE64, ENCTYPE_BASE64, null];
-for (let i = 0; i < encTypes.length; i++)
- do_check_eq(encTypes[i], getEncTypeForID(dbConnection, i + 1));
-
-// Reload storage, check that the new login now has encType=1, others untouched
-storage = reloadStorage(OUTDIR, "signons-v2v3.sqlite");
-do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
-
-encTypes = [ENCTYPE_BASE64, ENCTYPE_SDR, ENCTYPE_BASE64, ENCTYPE_BASE64, ENCTYPE_SDR];
-for (let i = 0; i < encTypes.length; i++)
- do_check_eq(encTypes[i], getEncTypeForID(dbConnection, i + 1));
-
-// Sanity check that the data gets migrated
-// There are 5 logins, but 3 will be invalid because we can no longer decrypt
-// base64-encoded items. (testuser1/4/5). We no longer reencrypt with SDR.
-checkStorageData(storage, ["https://disabled.net"], [testuser2, testuser3]);
-encTypes = [ENCTYPE_BASE64, ENCTYPE_SDR, ENCTYPE_BASE64, ENCTYPE_BASE64, ENCTYPE_SDR];
-for (let i = 0; i < encTypes.length; i++)
- do_check_eq(encTypes[i], getEncTypeForID(dbConnection, i + 1));
-dbConnection.close();
-
-deleteFile(OUTDIR, "signons-v2v3.sqlite");
-
-
-/* ========== 7 ========== */
-testnum++;
-testdesc = "Test upgrade from v3->v4 storage";
-
-yield* copyFile("signons-v3.sqlite");
-// Sanity check the test file.
-dbConnection = openDB("signons-v3.sqlite");
-do_check_eq(3, dbConnection.schemaVersion);
-
-storage = reloadStorage(OUTDIR, "signons-v3.sqlite");
-do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
-
-// Remove old entry from permission manager.
-setLoginSavingEnabled("https://disabled.net", true);
-
-// Check that timestamps and counts were initialized correctly
-checkStorageData(storage, [], [testuser1, testuser2]);
-
-var logins = storage.getAllLogins();
-for (var i = 0; i < 2; i++) {
- do_check_true(logins[i] instanceof Ci.nsILoginMetaInfo);
- do_check_eq(1, logins[i].timesUsed);
- LoginTestUtils.assertTimeIsAboutNow(logins[i].timeCreated);
- LoginTestUtils.assertTimeIsAboutNow(logins[i].timeLastUsed);
- LoginTestUtils.assertTimeIsAboutNow(logins[i].timePasswordChanged);
-}
-
-/* ========== 8 ========== */
-testnum++;
-testdesc = "Test upgrade from v3->v4->v3 storage";
-
-yield* copyFile("signons-v3v4.sqlite");
-// Sanity check the test file.
-dbConnection = openDB("signons-v3v4.sqlite");
-do_check_eq(3, dbConnection.schemaVersion);
-
-storage = reloadStorage(OUTDIR, "signons-v3v4.sqlite");
-do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
-
-// testuser1 already has timestamps, testuser2 does not.
-checkStorageData(storage, [], [testuser1, testuser2]);
-
-logins = storage.getAllLogins();
-
-var t1, t2;
-if (logins[0].username == "testuser1") {
- t1 = logins[0];
- t2 = logins[1];
-} else {
- t1 = logins[1];
- t2 = logins[0];
-}
-
-do_check_true(t1 instanceof Ci.nsILoginMetaInfo);
-do_check_true(t2 instanceof Ci.nsILoginMetaInfo);
-
-do_check_eq(9, t1.timesUsed);
-do_check_eq(1262049951275, t1.timeCreated);
-do_check_eq(1262049951275, t1.timeLastUsed);
-do_check_eq(1262049951275, t1.timePasswordChanged);
-
-do_check_eq(1, t2.timesUsed);
-LoginTestUtils.assertTimeIsAboutNow(t2.timeCreated);
-LoginTestUtils.assertTimeIsAboutNow(t2.timeLastUsed);
-LoginTestUtils.assertTimeIsAboutNow(t2.timePasswordChanged);
-
-
-/* ========== 9 ========== */
-testnum++;
-testdesc = "Test upgrade from v4 storage";
-
-yield* copyFile("signons-v4.sqlite");
-// Sanity check the test file.
-dbConnection = openDB("signons-v4.sqlite");
-do_check_eq(4, dbConnection.schemaVersion);
-do_check_false(dbConnection.tableExists("moz_deleted_logins"));
-
-storage = reloadStorage(OUTDIR, "signons-v4.sqlite");
-do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
-do_check_true(dbConnection.tableExists("moz_deleted_logins"));
-
-
-/* ========== 10 ========== */
-testnum++;
-testdesc = "Test upgrade from v4->v5->v4 storage";
-
-yield copyFile("signons-v4v5.sqlite");
-// Sanity check the test file.
-dbConnection = openDB("signons-v4v5.sqlite");
-do_check_eq(4, dbConnection.schemaVersion);
-do_check_true(dbConnection.tableExists("moz_deleted_logins"));
-
-storage = reloadStorage(OUTDIR, "signons-v4v5.sqlite");
-do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
-do_check_true(dbConnection.tableExists("moz_deleted_logins"));
-
-/* ========== 11 ========== */
-testnum++;
-testdesc = "Test upgrade from v5->v6 storage";
-
-yield* copyFile("signons-v5v6.sqlite");
-
-// Sanity check the test file.
-dbConnection = openDB("signons-v5v6.sqlite");
-do_check_eq(5, dbConnection.schemaVersion);
-do_check_true(dbConnection.tableExists("moz_disabledHosts"));
-
-// Initial disabled hosts inside signons-v5v6.sqlite
-var disabledHosts = [
- "http://disabled1.example.com",
- "http://大.net",
- "http://xn--19g.com"
-];
-
-LoginTestUtils.assertDisabledHostsEqual(disabledHosts, getAllDisabledHostsFromMozStorage(dbConnection));
-
-// Reload storage
-storage = reloadStorage(OUTDIR, "signons-v5v6.sqlite");
-do_check_eq(CURRENT_SCHEMA, dbConnection.schemaVersion);
-
-// moz_disabledHosts should now be empty after migration.
-LoginTestUtils.assertDisabledHostsEqual([], getAllDisabledHostsFromMozStorage(dbConnection));
-
-// Get all the other hosts currently saved in the permission manager.
-let hostsInPermissionManager = getAllDisabledHostsFromPermissionManager();
-
-// All disabledHosts should have migrated to the permission manager
-LoginTestUtils.assertDisabledHostsEqual(disabledHosts, hostsInPermissionManager);
-
-// Remove all disabled hosts from the permission manager before test ends
-for (let host of disabledHosts) {
- setLoginSavingEnabled(host, true);
-}
-
-/* ========== 12 ========== */
-testnum++;
-testdesc = "Create nsILoginInfo instances for testing with";
-
-testuser1 = new nsLoginInfo;
-testuser1.init("http://dummyhost.mozilla.org", "", null,
- "dummydude", "itsasecret", "put_user_here", "put_pw_here");
-
-
-/*
- * ---------------------- DB Corruption ----------------------
- * Try to initialize with a corrupt database file. This should create a backup
- * file, then upon next use create a new database file.
- */
-
-/* ========== 13 ========== */
-testnum++;
-testdesc = "Corrupt database and backup";
-
-const filename = "signons-c.sqlite";
-const filepath = OS.Path.join(OS.Constants.Path.profileDir, filename);
-
-yield OS.File.copy(do_get_file("data/corruptDB.sqlite").path, filepath);
-
-// will init mozStorage module with corrupt database, init should fail
-Assert.throws(
- () => reloadStorage(OS.Constants.Path.profileDir, filename),
- /Initialization failed/);
-
-// check that the backup file exists
-do_check_true(yield OS.File.exists(filepath + ".corrupt"));
-
-// check that the original corrupt file has been deleted
-do_check_false(yield OS.File.exists(filepath));
-
-// initialize the storage module again
-storage = reloadStorage(OS.Constants.Path.profileDir, filename);
-
-// use the storage module again, should work now
-storage.addLogin(testuser1);
-checkStorageData(storage, [], [testuser1]);
-
-// check the file exists
-var file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
-file.initWithPath(OS.Constants.Path.profileDir);
-file.append(filename);
-do_check_true(file.exists());
-
-deleteFile(OS.Constants.Path.profileDir, filename + ".corrupt");
-deleteFile(OS.Constants.Path.profileDir, filename);
-
-} catch (e) {
- throw new Error("FAILED in test #" + testnum + " -- " + testdesc + ": " + e);
-}
-
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_telemetry.js b/toolkit/components/passwordmgr/test/unit/test_telemetry.js
deleted file mode 100644
index 1d8f80226..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_telemetry.js
+++ /dev/null
@@ -1,187 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Tests the statistics and other counters reported through telemetry.
- */
-
-"use strict";
-
-// Globals
-
-const MS_PER_DAY = 24 * 60 * 60 * 1000;
-
-// To prevent intermittent failures when the test is executed at a time that is
-// very close to a day boundary, we make it deterministic by using a static
-// reference date for all the time-based statistics.
-const gReferenceTimeMs = new Date("2000-01-01T00:00:00").getTime();
-
-// Returns a milliseconds value to use with nsILoginMetaInfo properties, falling
-// approximately in the middle of the specified number of days before the
-// reference time, where zero days indicates a time within the past 24 hours.
-var daysBeforeMs = days => gReferenceTimeMs - (days + 0.5) * MS_PER_DAY;
-
-/**
- * Contains metadata that will be attached to test logins in order to verify
- * that the statistics collection is working properly. Most properties of the
- * logins are initialized to the default test values already.
- *
- * If you update this data or any of the telemetry histograms it checks, you'll
- * probably need to update the expected statistics in the test below.
- */
-const StatisticsTestData = [
- {
- timeLastUsed: daysBeforeMs(0),
- },
- {
- timeLastUsed: daysBeforeMs(1),
- },
- {
- timeLastUsed: daysBeforeMs(7),
- formSubmitURL: null,
- httpRealm: "The HTTP Realm",
- },
- {
- username: "",
- timeLastUsed: daysBeforeMs(7),
- },
- {
- username: "",
- timeLastUsed: daysBeforeMs(30),
- },
- {
- username: "",
- timeLastUsed: daysBeforeMs(31),
- },
- {
- timeLastUsed: daysBeforeMs(365),
- },
- {
- username: "",
- timeLastUsed: daysBeforeMs(366),
- },
- {
- // If the login was saved in the future, it is ignored for statistiscs.
- timeLastUsed: daysBeforeMs(-1),
- },
- {
- timeLastUsed: daysBeforeMs(1000),
- },
-];
-
-/**
- * Triggers the collection of those statistics that are not accumulated each
- * time an action is taken, but are a static snapshot of the current state.
- */
-function triggerStatisticsCollection() {
- Services.obs.notifyObservers(null, "gather-telemetry", "" + gReferenceTimeMs);
-}
-
-/**
- * Tests the telemetry histogram with the given ID contains only the specified
- * non-zero ranges, expressed in the format { range1: value1, range2: value2 }.
- */
-function testHistogram(histogramId, expectedNonZeroRanges) {
- let snapshot = Services.telemetry.getHistogramById(histogramId).snapshot();
-
- // Compute the actual ranges in the format { range1: value1, range2: value2 }.
- let actualNonZeroRanges = {};
- for (let [index, range] of snapshot.ranges.entries()) {
- let value = snapshot.counts[index];
- if (value > 0) {
- actualNonZeroRanges[range] = value;
- }
- }
-
- // These are stringified to visualize the differences between the values.
- do_print("Testing histogram: " + histogramId);
- do_check_eq(JSON.stringify(actualNonZeroRanges),
- JSON.stringify(expectedNonZeroRanges));
-}
-
-// Tests
-
-/**
- * Enable local telemetry recording for the duration of the tests, and prepare
- * the test data that will be used by the following tests.
- */
-add_task(function test_initialize() {
- let oldCanRecord = Services.telemetry.canRecordExtended;
- Services.telemetry.canRecordExtended = true;
- do_register_cleanup(function () {
- Services.telemetry.canRecordExtended = oldCanRecord;
- });
-
- let uniqueNumber = 1;
- for (let loginModifications of StatisticsTestData) {
- loginModifications.hostname = `http://${uniqueNumber++}.example.com`;
- Services.logins.addLogin(TestData.formLogin(loginModifications));
- }
-});
-
-/**
- * Tests the collection of statistics related to login metadata.
- */
-add_task(function test_logins_statistics() {
- // Repeat the operation twice to test that histograms are not accumulated.
- for (let repeating of [false, true]) {
- triggerStatisticsCollection();
-
- // Should record 1 in the bucket corresponding to the number of passwords.
- testHistogram("PWMGR_NUM_SAVED_PASSWORDS",
- { 10: 1 });
-
- // Should record 1 in the bucket corresponding to the number of passwords.
- testHistogram("PWMGR_NUM_HTTPAUTH_PASSWORDS",
- { 1: 1 });
-
- // For each saved login, should record 1 in the bucket corresponding to the
- // age in days since the login was last used.
- testHistogram("PWMGR_LOGIN_LAST_USED_DAYS",
- { 0: 1, 1: 1, 7: 2, 29: 2, 356: 2, 750: 1 });
-
- // Should record the number of logins without a username in bucket 0, and
- // the number of logins with a username in bucket 1.
- testHistogram("PWMGR_USERNAME_PRESENT",
- { 0: 4, 1: 6 });
- }
-});
-
-/**
- * Tests the collection of statistics related to hosts for which passowrd saving
- * has been explicitly disabled.
- */
-add_task(function test_disabledHosts_statistics() {
- // Should record 1 in the bucket corresponding to the number of sites for
- // which password saving is disabled.
- Services.logins.setLoginSavingEnabled("http://www.example.com", false);
- triggerStatisticsCollection();
- testHistogram("PWMGR_BLOCKLIST_NUM_SITES", { 1: 1 });
-
- Services.logins.setLoginSavingEnabled("http://www.example.com", true);
- triggerStatisticsCollection();
- testHistogram("PWMGR_BLOCKLIST_NUM_SITES", { 0: 1 });
-});
-
-/**
- * Tests the collection of statistics related to general settings.
- */
-add_task(function test_settings_statistics() {
- let oldRememberSignons = Services.prefs.getBoolPref("signon.rememberSignons");
- do_register_cleanup(function () {
- Services.prefs.setBoolPref("signon.rememberSignons", oldRememberSignons);
- });
-
- // Repeat the operation twice per value to test that histograms are reset.
- for (let remember of [false, true, false, true]) {
- // This change should be observed immediately by the login service.
- Services.prefs.setBoolPref("signon.rememberSignons", remember);
-
- triggerStatisticsCollection();
-
- // Should record 1 in either bucket 0 or bucket 1 based on the preference.
- testHistogram("PWMGR_SAVING_ENABLED", remember ? { 1: 1 } : { 0: 1 });
- }
-});
diff --git a/toolkit/components/passwordmgr/test/unit/test_user_autocomplete_result.js b/toolkit/components/passwordmgr/test/unit/test_user_autocomplete_result.js
deleted file mode 100644
index e1d250a76..000000000
--- a/toolkit/components/passwordmgr/test/unit/test_user_autocomplete_result.js
+++ /dev/null
@@ -1,488 +0,0 @@
-XPCOMUtils.defineLazyModuleGetter(this, "LoginHelper",
- "resource://gre/modules/LoginHelper.jsm");
-Cu.import("resource://gre/modules/LoginManagerContent.jsm");
-var nsLoginInfo = Components.Constructor("@mozilla.org/login-manager/loginInfo;1",
- Ci.nsILoginInfo, "init");
-
-const PREF_INSECURE_FIELD_WARNING_ENABLED = "security.insecure_field_warning.contextual.enabled";
-const PREF_INSECURE_AUTOFILLFORMS_ENABLED = "signon.autofillForms.http";
-
-let matchingLogins = [];
-matchingLogins.push(new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "", "emptypass1", "uname", "pword"));
-
-matchingLogins.push(new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "tempuser1", "temppass1", "uname", "pword"));
-
-matchingLogins.push(new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "testuser2", "testpass2", "uname", "pword"));
-
-matchingLogins.push(new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "testuser3", "testpass3", "uname", "pword"));
-
-matchingLogins.push(new nsLoginInfo("http://mochi.test:8888", "http://autocomplete:8888", null,
- "zzzuser4", "zzzpass4", "uname", "pword"));
-
-let meta = matchingLogins[0].QueryInterface(Ci.nsILoginMetaInfo);
-let dateAndTimeFormatter = new Intl.DateTimeFormat(undefined,
- { day: "numeric", month: "short", year: "numeric" });
-let time = dateAndTimeFormatter.format(new Date(meta.timePasswordChanged));
-const LABEL_NO_USERNAME = "No username (" + time + ")";
-
-let expectedResults = [
- {
- insecureFieldWarningEnabled: true,
- insecureAutoFillFormsEnabled: true,
- isSecure: true,
- isPasswordField: false,
- matchingLogins: matchingLogins,
- items: [{
- value: "",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "tempuser1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testuser2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testuser3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzuser4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: true,
- insecureAutoFillFormsEnabled: true,
- isSecure: false,
- isPasswordField: false,
- matchingLogins: matchingLogins,
- items: [{
- value: "",
- label: "This connection is not secure. Logins entered here could be compromised. Learn More",
- style: "insecureWarning"
- }, {
- value: "",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "tempuser1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testuser2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testuser3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzuser4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: true,
- insecureAutoFillFormsEnabled: true,
- isSecure: true,
- isPasswordField: true,
- matchingLogins: matchingLogins,
- items: [{
- value: "emptypass1",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "temppass1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testpass2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testpass3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzpass4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: true,
- insecureAutoFillFormsEnabled: true,
- isSecure: false,
- isPasswordField: true,
- matchingLogins: matchingLogins,
- items: [{
- value: "",
- label: "This connection is not secure. Logins entered here could be compromised. Learn More",
- style: "insecureWarning"
- }, {
- value: "emptypass1",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "temppass1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testpass2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testpass3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzpass4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: false,
- insecureAutoFillFormsEnabled: true,
- isSecure: true,
- isPasswordField: false,
- matchingLogins: matchingLogins,
- items: [{
- value: "",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "tempuser1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testuser2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testuser3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzuser4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: false,
- insecureAutoFillFormsEnabled: true,
- isSecure: false,
- isPasswordField: false,
- matchingLogins: matchingLogins,
- items: [{
- value: "",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "tempuser1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testuser2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testuser3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzuser4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: false,
- insecureAutoFillFormsEnabled: true,
- isSecure: true,
- isPasswordField: true,
- matchingLogins: matchingLogins,
- items: [{
- value: "emptypass1",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "temppass1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testpass2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testpass3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzpass4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: false,
- insecureAutoFillFormsEnabled: true,
- isSecure: false,
- isPasswordField: true,
- matchingLogins: matchingLogins,
- items: [{
- value: "emptypass1",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "temppass1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testpass2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testpass3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzpass4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: true,
- insecureAutoFillFormsEnabled: false,
- isSecure: true,
- isPasswordField: false,
- matchingLogins: matchingLogins,
- items: [{
- value: "",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "tempuser1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testuser2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testuser3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzuser4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: true,
- insecureAutoFillFormsEnabled: false,
- isSecure: false,
- isPasswordField: false,
- matchingLogins: matchingLogins,
- items: [{
- value: "",
- label: "This connection is not secure. Logins entered here could be compromised. Learn More",
- style: "insecureWarning"
- }, {
- value: "",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "tempuser1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testuser2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testuser3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzuser4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: true,
- insecureAutoFillFormsEnabled: false,
- isSecure: true,
- isPasswordField: true,
- matchingLogins: matchingLogins,
- items: [{
- value: "emptypass1",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "temppass1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testpass2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testpass3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzpass4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: true,
- insecureAutoFillFormsEnabled: false,
- isSecure: false,
- isPasswordField: true,
- matchingLogins: matchingLogins,
- items: [{
- value: "",
- label: "This connection is not secure. Logins entered here could be compromised. Learn More",
- style: "insecureWarning"
- }, {
- value: "emptypass1",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "temppass1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testpass2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testpass3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzpass4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: false,
- insecureAutoFillFormsEnabled: false,
- isSecure: true,
- isPasswordField: false,
- matchingLogins: matchingLogins,
- items: [{
- value: "",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "tempuser1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testuser2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testuser3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzuser4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: false,
- insecureAutoFillFormsEnabled: false,
- isSecure: false,
- isPasswordField: false,
- matchingLogins: matchingLogins,
- items: []
- },
- {
- insecureFieldWarningEnabled: false,
- insecureAutoFillFormsEnabled: false,
- isSecure: true,
- isPasswordField: true,
- matchingLogins: matchingLogins,
- items: [{
- value: "emptypass1",
- label: LABEL_NO_USERNAME,
- style: "login",
- }, {
- value: "temppass1",
- label: "tempuser1",
- style: "login",
- }, {
- value: "testpass2",
- label: "testuser2",
- style: "login",
- }, {
- value: "testpass3",
- label: "testuser3",
- style: "login",
- }, {
- value: "zzzpass4",
- label: "zzzuser4",
- style: "login",
- }]
- },
- {
- insecureFieldWarningEnabled: false,
- insecureAutoFillFormsEnabled: false,
- isSecure: false,
- isPasswordField: true,
- matchingLogins: matchingLogins,
- items: []
- },
-];
-
-add_task(function* test_all_patterns() {
- LoginHelper.createLogger("UserAutoCompleteResult");
- expectedResults.forEach(pattern => {
- Services.prefs.setBoolPref(PREF_INSECURE_FIELD_WARNING_ENABLED,
- pattern.insecureFieldWarningEnabled);
- Services.prefs.setBoolPref(PREF_INSECURE_AUTOFILLFORMS_ENABLED,
- pattern.insecureAutoFillFormsEnabled);
- let actual = new UserAutoCompleteResult("", pattern.matchingLogins,
- {
- isSecure: pattern.isSecure,
- isPasswordField: pattern.isPasswordField
- });
- pattern.items.forEach((item, index) => {
- equal(actual.getValueAt(index), item.value);
- equal(actual.getLabelAt(index), item.label);
- equal(actual.getStyleAt(index), item.style);
- });
-
- if (pattern.items.length != 0) {
- Assert.throws(() => actual.getValueAt(pattern.items.length),
- /Index out of range\./);
-
- Assert.throws(() => actual.getLabelAt(pattern.items.length),
- /Index out of range\./);
-
- Assert.throws(() => actual.removeValueAt(pattern.items.length, true),
- /Index out of range\./);
- }
- });
-});
diff --git a/toolkit/components/passwordmgr/test/unit/xpcshell.ini b/toolkit/components/passwordmgr/test/unit/xpcshell.ini
deleted file mode 100644
index 8f8c92a28..000000000
--- a/toolkit/components/passwordmgr/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,46 +0,0 @@
-[DEFAULT]
-head = head.js
-tail =
-support-files = data/**
-
-# Test JSON file access and import from SQLite, not applicable to Android.
-[test_module_LoginImport.js]
-skip-if = os == "android"
-[test_module_LoginStore.js]
-skip-if = os == "android"
-[test_removeLegacySignonFiles.js]
-skip-if = os == "android"
-
-# Test SQLite database backup and migration, applicable to Android only.
-[test_storage_mozStorage.js]
-skip-if = true || os != "android" # Bug 1171687: Needs fixing on Android
-
-# The following tests apply to any storage back-end.
-[test_context_menu.js]
-skip-if = os == "android" # The context menu isn't used on Android.
-# LoginManagerContextMenu is only included for MOZ_BUILD_APP == 'browser'.
-run-if = buildapp == "browser"
-[test_dedupeLogins.js]
-[test_disabled_hosts.js]
-[test_getFormFields.js]
-[test_getPasswordFields.js]
-[test_getPasswordOrigin.js]
-[test_isOriginMatching.js]
-[test_legacy_empty_formSubmitURL.js]
-[test_legacy_validation.js]
-[test_logins_change.js]
-[test_logins_decrypt_failure.js]
-skip-if = os == "android" # Bug 1171687: Needs fixing on Android
-[test_user_autocomplete_result.js]
-skip-if = os == "android"
-[test_logins_metainfo.js]
-[test_logins_search.js]
-[test_maybeImportLogin.js]
-[test_notifications.js]
-[test_OSCrypto_win.js]
-skip-if = os != "win"
-[test_recipes_add.js]
-[test_recipes_content.js]
-[test_search_schemeUpgrades.js]
-[test_storage.js]
-[test_telemetry.js]
diff --git a/toolkit/components/perf/chrome.ini b/toolkit/components/perf/chrome.ini
deleted file mode 100644
index eaa3c2401..000000000
--- a/toolkit/components/perf/chrome.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[DEFAULT]
-
-[test_pm.xul]
diff --git a/toolkit/components/perf/moz.build b/toolkit/components/perf/moz.build
index d153244c5..378d18feb 100644
--- a/toolkit/components/perf/moz.build
+++ b/toolkit/components/perf/moz.build
@@ -17,5 +17,3 @@ FINAL_LIBRARY = 'xul'
LOCAL_INCLUDES += [
'/js/xpconnect/loader',
]
-
-MOCHITEST_CHROME_MANIFESTS += ['chrome.ini']
diff --git a/toolkit/components/perf/test_pm.xul b/toolkit/components/perf/test_pm.xul
deleted file mode 100644
index 7dbf27b92..000000000
--- a/toolkit/components/perf/test_pm.xul
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<window title="Performance measurement tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="test()">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
- <script type="application/javascript"><![CDATA[
-function test()
-{
- SimpleTest.waitForExplicitFinish();
-
- Components.utils.import("resource://gre/modules/PerfMeasurement.jsm");
- let pm = new PerfMeasurement(PerfMeasurement.ALL);
- if (pm.eventsMeasured == 0) {
- todo(false, "stub, skipping test");
- } else {
- pm.start();
- for (let i = 0; i < 10000; i++) ;
- pm.stop();
-
- events = ["cpu_cycles", "instructions", "cache_references", "cache_misses",
- "branch_instructions", "branch_misses", "bus_cycles", "page_faults",
- "major_page_faults", "context_switches", "cpu_migrations"];
-
- for (var i = 0; i < events.length; i++) {
- var e = events[i];
- ((pm.eventsMeasured & PerfMeasurement[e.toUpperCase()]) ? isnot : todo_is)(pm[e], -1, e);
- }
- }
- SimpleTest.finish();
-}
-]]></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display:none;"></div>
- <pre id="test"></pre>
- </body>
- <label id="test-result"/>
-</window>
diff --git a/toolkit/components/perfmonitoring/moz.build b/toolkit/components/perfmonitoring/moz.build
index 1effe5f00..53c73803e 100644
--- a/toolkit/components/perfmonitoring/moz.build
+++ b/toolkit/components/perfmonitoring/moz.build
@@ -4,10 +4,16 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
-
XPIDL_MODULE = 'toolkit_perfmonitoring'
+XPIDL_SOURCES += ['nsIPerformanceStats.idl']
+
+EXPORTS += ['nsPerformanceStats.h']
+
+LOCAL_INCLUDES += ['/dom/base']
+
+UNIFIED_SOURCES += ['nsPerformanceStats.cpp']
+
EXTRA_JS_MODULES += [
'AddonWatcher.jsm',
'PerformanceStats-content.js',
@@ -16,20 +22,4 @@ EXTRA_JS_MODULES += [
'PerformanceWatcher.jsm',
]
-XPIDL_SOURCES += [
- 'nsIPerformanceStats.idl',
-]
-
-UNIFIED_SOURCES += [
- 'nsPerformanceStats.cpp'
-]
-
-EXPORTS += [
- 'nsPerformanceStats.h'
-]
-
-LOCAL_INCLUDES += [
- '/dom/base',
-]
-
FINAL_LIBRARY = 'xul'
diff --git a/toolkit/components/perfmonitoring/tests/browser/.eslintrc.js b/toolkit/components/perfmonitoring/tests/browser/.eslintrc.js
deleted file mode 100644
index 7c8021192..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser.ini b/toolkit/components/perfmonitoring/tests/browser/browser.ini
deleted file mode 100644
index 7f4ac8514..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser.ini
+++ /dev/null
@@ -1,15 +0,0 @@
-[DEFAULT]
-head = head.js
-tags = addons
-support-files =
- browser_Addons_sample.xpi
- browser_compartments.html
- browser_compartments_frame.html
- browser_compartments_script.js
-
-[browser_AddonWatcher.js]
-[browser_compartments.js]
-skip-if = os == "linux" && !debug && e10s # Bug 1230018
-[browser_addonPerformanceAlerts.js]
-[browser_addonPerformanceAlerts_2.js]
-[browser_webpagePerformanceAlerts.js]
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_AddonWatcher.js b/toolkit/components/perfmonitoring/tests/browser/browser_AddonWatcher.js
deleted file mode 100644
index b4e80faa7..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_AddonWatcher.js
+++ /dev/null
@@ -1,151 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Tests for AddonWatcher.jsm
-
-"use strict";
-
-requestLongerTimeout(2);
-
-Cu.import("resource://gre/modules/Promise.jsm", this);
-Cu.import("resource://gre/modules/AddonManager.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-
-const ADDON_URL = "http://example.com/browser/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample.xpi";
-const ADDON_ID = "addonwatcher-test@mozilla.com";
-
-add_task(function* init() {
- info("Installing test add-on");
- let installer = yield new Promise(resolve => AddonManager.getInstallForURL(ADDON_URL, resolve, "application/x-xpinstall"));
- if (installer.error) {
- throw installer.error;
- }
- let installed = new Promise((resolve, reject) => installer.addListener({
- onInstallEnded: (_, addon) => resolve(addon),
- onInstallFailed: reject,
- onDownloadFailed: reject
- }));
-
- // We also need to wait for the add-on to report that it's ready
- // to be used in the test.
- let ready = TestUtils.topicObserved("test-addonwatcher-ready");
- installer.install();
-
- info("Waiting for installation to terminate");
- let addon = yield installed;
-
- yield ready;
-
- registerCleanupFunction(() => {
- info("Uninstalling test add-on");
- addon.uninstall()
- });
-
- Preferences.set("browser.addon-watch.warmup-ms", 0);
- Preferences.set("browser.addon-watch.freeze-threshold-micros", 0);
- Preferences.set("browser.addon-watch.jank-threshold-micros", 0);
- Preferences.set("browser.addon-watch.occurrences-between-alerts", 0);
- Preferences.set("browser.addon-watch.delay-between-alerts-ms", 0);
- Preferences.set("browser.addon-watch.delay-between-freeze-alerts-ms", 0);
- Preferences.set("browser.addon-watch.max-simultaneous-reports", 10000);
- Preferences.set("browser.addon-watch.deactivate-after-idle-ms", 100000000);
- registerCleanupFunction(() => {
- for (let k of [
- "browser.addon-watch.warmup-ms",
- "browser.addon-watch.freeze-threshold-micros",
- "browser.addon-watch.jank-threshold-micros",
- "browser.addon-watch.occurrences-between-alerts",
- "browser.addon-watch.delay-between-alerts-ms",
- "browser.addon-watch.delay-between-freeze-alerts-ms",
- "browser.addon-watch.max-simultaneous-reports",
- "browser.addon-watch.deactivate-after-idle-ms"
- ]) {
- Preferences.reset(k);
- }
- });
-
- let oldCanRecord = Services.telemetry.canRecordExtended;
- Services.telemetry.canRecordExtended = true;
- AddonWatcher.init();
-
- registerCleanupFunction(function () {
- AddonWatcher.paused = true;
- Services.telemetry.canRecordExtended = oldCanRecord;
- });
-});
-
-// Utility function to burn some resource, trigger a reaction of the add-on watcher
-// and check both its notification and telemetry.
-let burn_rubber = Task.async(function*({histogramName, topic, expectedMinSum}) {
- let detected = false;
- let observer = (_, topic, id) => {
- Assert.equal(id, ADDON_ID, "The add-on watcher has detected the misbehaving addon");
- detected = true;
- };
-
- try {
- info("Preparing add-on watcher");
-
- Services.obs.addObserver(observer, AddonWatcher.TOPIC_SLOW_ADDON_DETECTED, false);
-
- let histogram = Services.telemetry.getKeyedHistogramById(histogramName);
- histogram.clear();
- let snap1 = histogram.snapshot(ADDON_ID);
- Assert.equal(snap1.sum, 0, `Histogram ${histogramName} is initially empty for the add-on`);
-
- let histogramUpdated = false;
- do {
- info(`Burning some CPU with ${topic}. This should cause an add-on watcher notification`);
- yield new Promise(resolve => setTimeout(resolve, 100));
- Services.obs.notifyObservers(null, topic, "");
- yield new Promise(resolve => setTimeout(resolve, 100));
-
- let snap2 = histogram.snapshot(ADDON_ID);
- histogramUpdated = snap2.sum > 0;
- info(`For the moment, histogram ${histogramName} shows ${snap2.sum} => ${histogramUpdated}`);
- info(`For the moment, we have ${detected?"":"NOT "}detected the slow add-on`);
- } while (!histogramUpdated || !detected);
-
- let snap3 = histogram.snapshot(ADDON_ID);
- Assert.ok(snap3.sum >= expectedMinSum, `Histogram ${histogramName} recorded a gravity of ${snap3.sum}, expecting at least ${expectedMinSum}.`);
- } finally {
- Services.obs.removeObserver(observer, AddonWatcher.TOPIC_SLOW_ADDON_DETECTED);
- }
-});
-
-// Test that burning CPU will cause the add-on watcher to notice that
-// the add-on is misbehaving.
-add_task(function* test_burn_CPU() {
- yield burn_rubber({
- histogramName: "PERF_MONITORING_SLOW_ADDON_JANK_US",
- topic: "test-addonwatcher-burn-some-cpu",
- expectedMinSum: 7,
- });
-});
-
-// Test that burning content CPU will cause the add-on watcher to notice that
-// the add-on is misbehaving.
-/*
-Blocked by bug 1227283.
-add_task(function* test_burn_content_CPU() {
- yield burn_rubber({
- histogramName: "PERF_MONITORING_SLOW_ADDON_JANK_US",
- topic: "test-addonwatcher-burn-some-content-cpu",
- expectedMinSum: 7,
- });
-});
-*/
-
-// Test that burning CPOW will cause the add-on watcher to notice that
-// the add-on is misbehaving.
-add_task(function* test_burn_CPOW() {
- if (!gMultiProcessBrowser) {
- info("This is a single-process Firefox, we can't test for CPOW");
- return;
- }
- yield burn_rubber({
- histogramName: "PERF_MONITORING_SLOW_ADDON_CPOW_US",
- topic: "test-addonwatcher-burn-some-cpow",
- expectedMinSum: 400,
- });
-});
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample.xpi b/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample.xpi
deleted file mode 100644
index ae5bcc5ff..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample.xpi
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/bootstrap.js b/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/bootstrap.js
deleted file mode 100644
index 9a5575827..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/bootstrap.js
+++ /dev/null
@@ -1,105 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Sample for browser_AddonWatcher.js
-
-"use strict";
-
-const {utils: Cu, classes: Cc, interfaces: Ci} = Components;
-
-const TOPIC_BURNCPU = "test-addonwatcher-burn-some-cpu";
-const TOPIC_BURNCPOW = "test-addonwatcher-burn-some-cpow";
-const TOPIC_BURNCONTENTCPU = "test-addonwatcher-burn-some-content-cpu";
-const TOPIC_READY = "test-addonwatcher-ready";
-
-const MESSAGE_BURNCPOW = "test-addonwatcher-cpow:init";
-const URL_FRAMESCRIPT = "chrome://addonwatcher-test/content/framescript.js";
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-const { setTimeout } = Cu.import("resource://gre/modules/Timer.jsm", {});
-Cu.import("resource://gre/modules/Task.jsm", this);
-
-let globalMM = Cc["@mozilla.org/globalmessagemanager;1"]
- .getService(Ci.nsIMessageListenerManager);
-
-/**
- * Spend some time using CPU.
- */
-function burnCPU() {
- let ignored = [];
- let start = Date.now();
- let i = 0;
- while (Date.now() - start < 1000) {
- ignored[i++ % 2] = i;
- }
-}
-
-/**
- * Spend some time in CPOW.
- */
-function burnCPOW() {
- gBurnCPOW();
-}
-let gBurnCPOW = null;
-
-function burnContentCPU() {
- setTimeout(() => { try {
- gBurnContentCPU()
- } catch (ex) {
- dump(`test-addon error: ${ex}\n`);
- } }, 0);
-}
-let gBurnContentCPU = null;
-
-let gTab = null;
-let gTabBrowser = null;
-
-function startup() {
- Services.obs.addObserver(burnCPU, TOPIC_BURNCPU, false);
- Services.obs.addObserver(burnCPOW, TOPIC_BURNCPOW, false);
- Services.obs.addObserver(burnContentCPU, TOPIC_BURNCONTENTCPU, false);
-
- let windows = Services.wm.getEnumerator("navigator:browser");
- let win = windows.getNext();
- gTabBrowser = win.gBrowser;
- gTab = gTabBrowser.addTab("about:robots");
- gBurnContentCPU = function() {
- gTab.linkedBrowser.messageManager.sendAsyncMessage("test-addonwatcher-burn-some-content-cpu", {});
- }
-
- gTab.linkedBrowser.messageManager.loadFrameScript(URL_FRAMESCRIPT, false);
- globalMM.loadFrameScript(URL_FRAMESCRIPT, false);
-
- if (Services.appinfo.browserTabsRemoteAutostart) {
- // This profile has e10s enabled, which means we'll want to
- // test CPOW traffic.
- globalMM.addMessageListener("test-addonwatcher-cpow:init", function waitForCPOW(msg) {
- if (Components.utils.isCrossProcessWrapper(msg.objects.burnCPOW)) {
- gBurnCPOW = msg.objects.burnCPOW;
- globalMM.removeMessageListener("test-addonwatcher-cpow:init", waitForCPOW);
- Services.obs.notifyObservers(null, TOPIC_READY, null);
- } else {
- Cu.reportError("test-addonwatcher-cpow:init didn't give us a CPOW! Expect timeouts.");
- }
- });
- } else {
- // e10s is not enabled, so a CPOW is not necessary - we can report ready
- // right away.
- Services.obs.notifyObservers(null, TOPIC_READY, null);
- }
-}
-
-function shutdown() {
- Services.obs.removeObserver(burnCPU, TOPIC_BURNCPU);
- Services.obs.removeObserver(burnCPOW, TOPIC_BURNCPOW);
- Services.obs.removeObserver(burnContentCPU, TOPIC_BURNCONTENTCPU);
- gTabBrowser.removeTab(gTab);
-}
-
-function install() {
- // Nothing to do
-}
-
-function uninstall() {
- // Nothing to do
-}
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/build.sh b/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/build.sh
deleted file mode 100644
index 28d52ea3a..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/build.sh
+++ /dev/null
@@ -1,4 +0,0 @@
-echo "Rebuilding browser_Addons_sample.xpi..."
-zip -r ../browser_Addons_sample.xpi .
-echo "
-Done! Don't forget to sign it: https://wiki.mozilla.org/EngineeringProductivity/HowTo/SignExtensions" \ No newline at end of file
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/chrome.manifest b/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/chrome.manifest
deleted file mode 100644
index 9f53da861..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/chrome.manifest
+++ /dev/null
@@ -1 +0,0 @@
-content addonwatcher-test content/
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/content/framescript.js b/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/content/framescript.js
deleted file mode 100644
index e7ebc2a61..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/content/framescript.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-function burnCPOW(msg) {
- dump(`Addon: content burnCPU start ${Math.sin(Math.random())}\n`);
- let start = content.performance.now();
- let ignored = [];
- while (content.performance.now() - start < 5000) {
- ignored[ignored.length % 2] = ignored.length;
- }
- dump(`Addon: content burnCPU done: ${content.performance.now() - start}\n`);
-}
-
-if (Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT) {
- sendAsyncMessage("test-addonwatcher-cpow:init", {}, {burnCPOW});
-}
-
-addMessageListener("test-addonwatcher-burn-some-content-cpu", burnCPOW);
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/install.rdf b/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/install.rdf
deleted file mode 100644
index cae10ace6..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_Addons_sample/install.rdf
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
- <Description about="urn:mozilla:install-manifest">
- <em:id>addonwatcher-test@mozilla.com</em:id>
- <em:version>1.1</em:version>
-
- <em:targetApplication>
- <Description>
- <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:minVersion>0.3</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <em:targetApplication>
- <Description>
- <em:id>toolkit@mozilla.org</em:id>
- <em:minVersion>1</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <em:bootstrap>true</em:bootstrap>
-
- <em:name>Sample for browser_AddonWatcher.js</em:name>
-
- </Description>
-</RDF>
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_addonPerformanceAlerts.js b/toolkit/components/perfmonitoring/tests/browser/browser_addonPerformanceAlerts.js
deleted file mode 100644
index af78f0074..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_addonPerformanceAlerts.js
+++ /dev/null
@@ -1,91 +0,0 @@
-"use strict";
-
-/**
- * Tests for PerformanceWatcher watching slow addons.
- */
-
-add_task(function* init() {
- // Get rid of buffering.
- let service = Cc["@mozilla.org/toolkit/performance-stats-service;1"].getService(
- Ci.nsIPerformanceStatsService);
- let oldDelay = service.jankAlertBufferingDelay;
-
- service.jankAlertBufferingDelay = 0 /* ms */;
- registerCleanupFunction(() => {
- info("Cleanup");
- service.jankAlertBufferingDelay = oldDelay;
- });
-});
-
-add_task(function* test_install_addon_then_watch_it() {
- for (let topic of ["burnCPU", "promiseBurnContentCPU", "promiseBurnCPOW"]) {
- info(`Starting subtest ${topic}`);
- info("Spawning fake add-on, making sure that the compartment is initialized");
- let addon = new AddonBurner();
- yield addon.promiseInitialized;
- addon.burnCPU();
-
- info(`Check that burning CPU triggers the real listener, but not the fake listener ${topic}`);
- let realListener = new AddonListener(addon.addonId, (group, details) => {
- if (group.addonId == addon.addonId) {
- return details.highestJank;
- }
- throw new Error(`I shouldn't have been called with addon ${group.addonId}`);
- });
- let fakeListener = new AddonListener(addon.addonId + "-fake-" + Math.random(), group => true); // This listener should never be triggered.
- let universalListener = new AddonListener("*", alerts => {
- info(`AddonListener: received alerts ${JSON.stringify(alerts)}`);
- let alert = alerts.find(({source}) => {
- return source.addonId == addon.addonId;
- });
- if (alert) {
- info(`AddonListener: I found an alert for ${addon.addonId}`);
- return alert.details.highestJank;
- }
- info(`AddonListener: I didn't find any alert for ${addon.addonId}`);
- return null;
- });
-
- // Waiting a little – listeners are buffered.
- yield new Promise(resolve => setTimeout(resolve, 100));
- yield addon.run(topic, 10, realListener);
- // Waiting a little – listeners are buffered.
- yield new Promise(resolve => setTimeout(resolve, 100));
-
- Assert.ok(realListener.triggered, `1. The real listener was triggered ${topic}`);
- Assert.ok(universalListener.triggered, `1. The universal listener was triggered ${topic}`);
- Assert.ok(!fakeListener.triggered, `1. The fake listener was not triggered ${topic}`);
- Assert.ok(realListener.result >= addon.jankThreshold, `1. jank is at least ${addon.jankThreshold/1000}ms (${realListener.result/1000}ms) ${topic}`);
-
- info(`Attempting to remove a performance listener incorrectly, check that this does not hurt our real listener ${topic}`);
- Assert.throws(() => PerformanceWatcher.removePerformanceListener({addonId: addon.addonId}, () => {}));
- Assert.throws(() => PerformanceWatcher.removePerformanceListener({addonId: addon.addonId + "-unbound-id-" + Math.random()}, realListener.listener));
-
- yield addon.run(topic, 10, realListener);
- // Waiting a little – listeners are buffered.
- yield new Promise(resolve => setTimeout(resolve, 300));
-
- Assert.ok(realListener.triggered, `2. The real listener was triggered ${topic}`);
- Assert.ok(universalListener.triggered, `2. The universal listener was triggered ${topic}`);
- Assert.ok(!fakeListener.triggered, `2. The fake listener was not triggered ${topic}`);
- Assert.ok(realListener.result >= 200000, `2. jank is at least 300ms (${realListener.result/1000}ms) ${topic}`);
-
- info(`Attempting to remove correctly, check if the listener is still triggered ${topic}`);
- realListener.unregister();
- yield addon.run(topic, 3, realListener);
- Assert.ok(!realListener.triggered, `3. After being unregistered, the real listener was not triggered ${topic}`);
- Assert.ok(universalListener.triggered, `3. The universal listener is still triggered ${topic}`);
-
- info("Unregistering universal listener");
- // Waiting a little – listeners are buffered.
- yield new Promise(resolve => setTimeout(resolve, 100));
- universalListener.unregister();
- // Waiting a little – listeners are buffered.
- yield new Promise(resolve => setTimeout(resolve, 100));
- yield addon.run(topic, 3, realListener);
- Assert.ok(!universalListener.triggered, `4. After being unregistered, the universal listener is not triggered ${topic}`);
-
- fakeListener.unregister();
- addon.dispose();
- }
-});
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_addonPerformanceAlerts_2.js b/toolkit/components/perfmonitoring/tests/browser/browser_addonPerformanceAlerts_2.js
deleted file mode 100644
index d39c38b1f..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_addonPerformanceAlerts_2.js
+++ /dev/null
@@ -1,25 +0,0 @@
-"use strict";
-
-/**
- * Tests for PerformanceWatcher watching slow addons.
- */
-
-add_task(function* test_watch_addon_then_install_it() {
- for (let topic of ["burnCPU", "promiseBurnContentCPU", "promiseBurnCPOW"]) {
- let addonId = "addon:test_watch_addons_before_installing" + Math.random();
- let realListener = new AddonListener(addonId, (group, details) => {
- if (group.addonId == addonId) {
- return details.highestJank;
- }
- throw new Error(`I shouldn't have been called with addon ${group.addonId}`);
- });
-
- info("Now install the add-on, *after* having installed the listener");
- let addon = new AddonBurner(addonId);
-
- Assert.ok((yield addon.run(topic, 10, realListener)), `5. The real listener was triggered ${topic}`);
- Assert.ok(realListener.result >= addon.jankThreshold, `5. jank is at least ${addon.jankThreshold/1000}ms (${realListener.result}µs) ${topic}`);
- realListener.unregister();
- addon.dispose();
- }
-});
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_compartments.html b/toolkit/components/perfmonitoring/tests/browser/browser_compartments.html
deleted file mode 100644
index d7ee6c418..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_compartments.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>
- Main frame for test browser_compartments.js
- </title>
-</head>
-<body>
-Main frame.
-
-<iframe src="browser_compartments_frame.html?frame=1">
- Subframe 1
-</iframe>
-
-<iframe src="browser_compartments_frame.html?frame=2">
- Subframe 2.
-</iframe>
-
-</body>
-</html>
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_compartments.js b/toolkit/components/perfmonitoring/tests/browser/browser_compartments.js
deleted file mode 100644
index f04fefb33..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_compartments.js
+++ /dev/null
@@ -1,312 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-/**
- * Test that we see jank that takes place in a webpage,
- * and that jank from several iframes are actually charged
- * to the top window.
- */
-Cu.import("resource://gre/modules/PerformanceStats.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://testing-common/ContentTask.jsm", this);
-
-
-const URL = "http://example.com/browser/toolkit/components/perfmonitoring/tests/browser/browser_compartments.html?test=" + Math.random();
-const PARENT_TITLE = `Main frame for test browser_compartments.js ${Math.random()}`;
-const FRAME_TITLE = `Subframe for test browser_compartments.js ${Math.random()}`;
-
-const PARENT_PID = Services.appinfo.processID;
-
-// This function is injected as source as a frameScript
-function frameScript() {
- try {
- "use strict";
-
- const { utils: Cu, classes: Cc, interfaces: Ci } = Components;
- Cu.import("resource://gre/modules/PerformanceStats.jsm");
- Cu.import("resource://gre/modules/Services.jsm");
-
- // Make sure that the stopwatch is now active.
- let monitor = PerformanceStats.getMonitor(["jank", "cpow", "ticks", "compartments"]);
-
- addMessageListener("compartments-test:getStatistics", () => {
- try {
- monitor.promiseSnapshot().then(snapshot => {
- sendAsyncMessage("compartments-test:getStatistics", {snapshot, pid: Services.appinfo.processID});
- });
- } catch (ex) {
- Cu.reportError("Error in content (getStatistics): " + ex);
- Cu.reportError(ex.stack);
- }
- });
-
- addMessageListener("compartments-test:setTitles", titles => {
- try {
- content.document.title = titles.data.parent;
- for (let i = 0; i < content.frames.length; ++i) {
- content.frames[i].postMessage({title: titles.data.frames}, "*");
- }
- console.log("content", "Done setting titles", content.document.title);
- sendAsyncMessage("compartments-test:setTitles");
- } catch (ex) {
- Cu.reportError("Error in content (setTitles): " + ex);
- Cu.reportError(ex.stack);
- }
- });
- } catch (ex) {
- Cu.reportError("Error in content (setup): " + ex);
- Cu.reportError(ex.stack);
- }
-}
-
-// A variant of `Assert` that doesn't spam the logs
-// in case of success.
-var SilentAssert = {
- equal: function(a, b, msg) {
- if (a == b) {
- return;
- }
- Assert.equal(a, b, msg);
- },
- notEqual: function(a, b, msg) {
- if (a != b) {
- return;
- }
- Assert.notEqual(a, b, msg);
- },
- ok: function(a, msg) {
- if (a) {
- return;
- }
- Assert.ok(a, msg);
- },
- leq: function(a, b, msg) {
- this.ok(a <= b, `${msg}: ${a} <= ${b}`);
- }
-};
-
-var isShuttingDown = false;
-function monotinicity_tester(source, testName) {
- // In the background, check invariants:
- // - numeric data can only ever increase;
- // - the name, addonId, isSystem of a component never changes;
- // - the name, addonId, isSystem of the process data;
- // - there is at most one component with a combination of `name` and `addonId`;
- // - types, etc.
- let previous = {
- processData: null,
- componentsMap: new Map(),
- };
-
- let sanityCheck = function(prev, next) {
- if (prev == null) {
- return;
- }
- for (let k of ["groupId", "addonId", "isSystem"]) {
- SilentAssert.equal(prev[k], next[k], `Sanity check (${testName}): ${k} hasn't changed (${prev.name}).`);
- }
- for (let [probe, k] of [
- ["jank", "totalUserTime"],
- ["jank", "totalSystemTime"],
- ["cpow", "totalCPOWTime"],
- ["ticks", "ticks"]
- ]) {
- SilentAssert.equal(typeof next[probe][k], "number", `Sanity check (${testName}): ${k} is a number.`);
- SilentAssert.leq(prev[probe][k], next[probe][k], `Sanity check (${testName}): ${k} is monotonic.`);
- SilentAssert.leq(0, next[probe][k], `Sanity check (${testName}): ${k} is >= 0.`)
- }
- SilentAssert.equal(prev.jank.durations.length, next.jank.durations.length);
- for (let i = 0; i < next.jank.durations.length; ++i) {
- SilentAssert.ok(typeof next.jank.durations[i] == "number" && next.jank.durations[i] >= 0,
- `Sanity check (${testName}): durations[${i}] is a non-negative number.`);
- SilentAssert.leq(prev.jank.durations[i], next.jank.durations[i],
- `Sanity check (${testName}): durations[${i}] is monotonic.`);
- }
- for (let i = 0; i < next.jank.durations.length - 1; ++i) {
- SilentAssert.leq(next.jank.durations[i + 1], next.jank.durations[i],
- `Sanity check (${testName}): durations[${i}] >= durations[${i + 1}].`)
- }
- };
- let iteration = 0;
- let frameCheck = Task.async(function*() {
- if (isShuttingDown) {
- window.clearInterval(interval);
- return;
- }
- let name = `${testName}: ${iteration++}`;
- let result = yield source();
- if (!result) {
- // This can happen at the end of the test when we attempt
- // to communicate too late with the content process.
- window.clearInterval(interval);
- return;
- }
- let {pid, snapshot} = result;
-
- // Sanity check on the process data.
- sanityCheck(previous.processData, snapshot.processData);
- SilentAssert.equal(snapshot.processData.isSystem, true);
- SilentAssert.equal(snapshot.processData.name, "<process>");
- SilentAssert.equal(snapshot.processData.addonId, "");
- SilentAssert.equal(snapshot.processData.processId, pid);
- previous.procesData = snapshot.processData;
-
- // Sanity check on components data.
- let map = new Map();
- for (let item of snapshot.componentsData) {
- for (let [probe, k] of [
- ["jank", "totalUserTime"],
- ["jank", "totalSystemTime"],
- ["cpow", "totalCPOWTime"]
- ]) {
- // Note that we cannot expect components data to be always smaller
- // than process data, as `getrusage` & co are not monotonic.
- SilentAssert.leq(item[probe][k], 3 * snapshot.processData[probe][k],
- `Sanity check (${name}): ${k} of component is not impossibly larger than that of process`);
- }
-
- let isCorrectPid = (item.processId == pid && !item.isChildProcess)
- || (item.processId != pid && item.isChildProcess);
- SilentAssert.ok(isCorrectPid, `Pid check (${name}): the item comes from the right process`);
-
- let key = item.groupId;
- if (map.has(key)) {
- let old = map.get(key);
- Assert.ok(false, `Component ${key} has already been seen. Latest: ${item.addonId||item.name}, previous: ${old.addonId||old.name}`);
- }
- map.set(key, item);
- }
- for (let item of snapshot.componentsData) {
- if (!item.parentId) {
- continue;
- }
- let parent = map.get(item.parentId);
- SilentAssert.ok(parent, `The parent exists ${item.parentId}`);
-
- for (let [probe, k] of [
- ["jank", "totalUserTime"],
- ["jank", "totalSystemTime"],
- ["cpow", "totalCPOWTime"]
- ]) {
- // Note that we cannot expect components data to be always smaller
- // than parent data, as `getrusage` & co are not monotonic.
- SilentAssert.leq(item[probe][k], 2 * parent[probe][k],
- `Sanity check (${testName}): ${k} of component is not impossibly larger than that of parent`);
- }
- }
- for (let [key, item] of map) {
- sanityCheck(previous.componentsMap.get(key), item);
- previous.componentsMap.set(key, item);
- }
- });
- let interval = window.setInterval(frameCheck, 300);
- registerCleanupFunction(() => {
- window.clearInterval(interval);
- });
-}
-
-add_task(function* test() {
- let monitor = PerformanceStats.getMonitor(["jank", "cpow", "ticks"]);
-
- info("Extracting initial state");
- let stats0 = yield monitor.promiseSnapshot();
- Assert.notEqual(stats0.componentsData.length, 0, "There is more than one component");
- Assert.ok(!stats0.componentsData.find(stat => stat.name.indexOf(URL) != -1),
- "The url doesn't appear yet");
-
- let newTab = gBrowser.addTab();
- let browser = newTab.linkedBrowser;
- // Setup monitoring in the tab
- info("Setting up monitoring in the tab");
- yield ContentTask.spawn(newTab.linkedBrowser, null, frameScript);
-
- info("Opening URL");
- newTab.linkedBrowser.loadURI(URL);
-
- if (Services.sysinfo.getPropertyAsAString("name") == "Windows_NT") {
- info("Deactivating sanity checks under Windows (bug 1151240)");
- } else {
- info("Setting up sanity checks");
- monotinicity_tester(() => monitor.promiseSnapshot().then(snapshot => ({snapshot, pid: PARENT_PID})), "parent process");
- monotinicity_tester(() => promiseContentResponseOrNull(browser, "compartments-test:getStatistics", null), "content process" );
- }
-
- let skipTotalUserTime = hasLowPrecision();
-
-
- while (true) {
- yield new Promise(resolve => setTimeout(resolve, 100));
-
- // We may have race conditions with DOM loading.
- // Don't waste too much brainpower here, let's just ask
- // repeatedly for the title to be changed, until this works.
- info("Setting titles");
- yield promiseContentResponse(browser, "compartments-test:setTitles", {
- parent: PARENT_TITLE,
- frames: FRAME_TITLE
- });
- info("Titles set");
-
- let {snapshot: stats} = (yield promiseContentResponse(browser, "compartments-test:getStatistics", null));
-
- // Attach titles to components.
- let titles = [];
- let map = new Map();
- let windows = Services.wm.getEnumerator("navigator:browser");
- while (windows.hasMoreElements()) {
- let window = windows.getNext();
- let tabbrowser = window.gBrowser;
- for (let browser of tabbrowser.browsers) {
- let id = browser.outerWindowID; // May be `null` if the browser isn't loaded yet
- if (id != null) {
- map.set(id, browser);
- }
- }
- }
- for (let stat of stats.componentsData) {
- if (!stat.windowId) {
- continue;
- }
- let browser = map.get(stat.windowId);
- if (!browser) {
- continue;
- }
- let title = browser.contentTitle;
- if (title) {
- stat.title = title;
- titles.push(title);
- }
- }
-
- // While the webpage consists in three compartments, we should see only
- // one `PerformanceData` in `componentsData`. Its `name` is undefined
- // (could be either the main frame or one of its subframes), but its
- // `title` should be the title of the main frame.
- info(`Searching for frame title '${FRAME_TITLE}' in ${JSON.stringify(titles)} (I hope not to find it)`);
- Assert.ok(!titles.includes(FRAME_TITLE), "Searching by title, the frames don't show up in the list of components");
-
- info(`Searching for window title '${PARENT_TITLE}' in ${JSON.stringify(titles)} (I hope to find it)`);
- let parent = stats.componentsData.find(x => x.title == PARENT_TITLE);
- if (!parent) {
- info("Searching by title, we didn't find the main frame");
- continue;
- }
- info("Found the main frame");
-
- if (skipTotalUserTime) {
- info("Not looking for total user time on this platform, we're done");
- break;
- } else if (parent.jank.totalUserTime > 1000) {
- info("Enough CPU time detected, we're done");
- break;
- } else {
- info(`Not enough CPU time detected: ${parent.jank.totalUserTime}`);
- }
- }
- isShuttingDown = true;
-
- // Cleanup
- gBrowser.removeTab(newTab, {skipPermitUnload: true});
-});
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_compartments_frame.html b/toolkit/components/perfmonitoring/tests/browser/browser_compartments_frame.html
deleted file mode 100644
index 69edfe871..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_compartments_frame.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>
- Subframe for test browser_compartments.html (do not change this title)
- </title>
- <script src="browser_compartments_script.js"></script>
-</head>
-<body>
-Subframe loaded.
-</body>
-</html>
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_compartments_script.js b/toolkit/components/perfmonitoring/tests/browser/browser_compartments_script.js
deleted file mode 100644
index 3d5f7114f..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_compartments_script.js
+++ /dev/null
@@ -1,29 +0,0 @@
-
-var carryOn = true;
-
-window.addEventListener("message", e => {
- console.log("frame content", "message", e);
- if ("title" in e.data) {
- document.title = e.data.title;
- }
- if ("stop" in e.data) {
- carryOn = false;
- }
-});
-
-// Use some CPU.
-var interval = window.setInterval(() => {
- if (!carryOn) {
- window.clearInterval(interval);
- return;
- }
-
- // Compute an arbitrary value, print it out to make sure that the JS
- // engine doesn't discard all our computation.
- var date = Date.now();
- var array = [];
- var i = 0;
- while (Date.now() - date <= 100) {
- array[i%2] = i++;
- }
-}, 300);
diff --git a/toolkit/components/perfmonitoring/tests/browser/browser_webpagePerformanceAlerts.js b/toolkit/components/perfmonitoring/tests/browser/browser_webpagePerformanceAlerts.js
deleted file mode 100644
index eb908c8db..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/browser_webpagePerformanceAlerts.js
+++ /dev/null
@@ -1,111 +0,0 @@
-"use strict";
-
-/**
- * Tests for PerformanceWatcher watching slow web pages.
- */
-
- /**
- * Simulate a slow webpage.
- */
-function WebpageBurner() {
- CPUBurner.call(this, "http://example.com/browser/toolkit/components/perfmonitoring/tests/browser/browser_compartments.html?test=" + Math.random(), 300000);
-}
-WebpageBurner.prototype = Object.create(CPUBurner.prototype);
-WebpageBurner.prototype.promiseBurnContentCPU = function() {
- return promiseContentResponse(this._browser, "test-performance-watcher:burn-content-cpu", {});
-};
-
-function WebpageListener(windowId, accept) {
- info(`Creating WebpageListener for ${windowId}`);
- AlertListener.call(this, accept, {
- register: () => PerformanceWatcher.addPerformanceListener({windowId}, this.listener),
- unregister: () => PerformanceWatcher.removePerformanceListener({windowId}, this.listener)
- });
-}
-WebpageListener.prototype = Object.create(AlertListener.prototype);
-
-add_task(function* init() {
- // Get rid of buffering.
- let service = Cc["@mozilla.org/toolkit/performance-stats-service;1"].getService(
- Ci.nsIPerformanceStatsService);
- let oldDelay = service.jankAlertBufferingDelay;
-
- service.jankAlertBufferingDelay = 0 /* ms */;
- registerCleanupFunction(() => {
- info("Cleanup");
- service.jankAlertBufferingDelay = oldDelay;
- });
-});
-
-add_task(function* test_open_window_then_watch_it() {
- let burner = new WebpageBurner();
- yield burner.promiseInitialized;
- yield burner.promiseBurnContentCPU();
-
- info(`Check that burning CPU triggers the real listener, but not the fake listener`);
- let realListener = new WebpageListener(burner.windowId, (group, details) => {
- info(`test: realListener for ${burner.tab.linkedBrowser.outerWindowID}: ${group}, ${details}\n`);
- Assert.equal(group.windowId, burner.windowId, "We should not receive data meant for another group");
- return details;
- }); // This listener should be triggered.
-
- info(`Creating fake burner`);
- let otherTab = gBrowser.addTab();
- yield BrowserTestUtils.browserLoaded(otherTab.linkedBrowser);
- info(`Check that burning CPU triggers the real listener, but not the fake listener`);
- let fakeListener = new WebpageListener(otherTab.linkedBrowser.outerWindowID, group => group.windowId == burner.windowId); // This listener should never be triggered.
- let universalListener = new WebpageListener(0, alerts =>
- alerts.find(alert => alert.source.windowId == burner.windowId)
- );
-
- // Waiting a little – listeners are buffered.
- yield new Promise(resolve => setTimeout(resolve, 100));
-
- yield burner.run("promiseBurnContentCPU", 20, realListener);
- Assert.ok(realListener.triggered, `1. The real listener was triggered`);
- Assert.ok(universalListener.triggered, `1. The universal listener was triggered`);
- Assert.ok(!fakeListener.triggered, `1. The fake listener was not triggered`);
-
- if (realListener.result) {
- Assert.ok(realListener.result.highestJank >= 300, `1. jank is at least 300ms (${realListener.result.highestJank}ms)`);
- }
-
- info(`Attempting to remove a performance listener incorrectly, check that this does not hurt our real listener`);
- Assert.throws(() => PerformanceWatcher.removePerformanceListener({addonId: addon.addonId}, () => {}));
- Assert.throws(() => PerformanceWatcher.removePerformanceListener({addonId: addon.addonId + "-unbound-id-" + Math.random()}, realListener.listener));
-
- // Waiting a little – listeners are buffered.
- yield new Promise(resolve => setTimeout(resolve, 100));
- yield burner.run("promiseBurnContentCPU", 20, realListener);
- // Waiting a little – listeners are buffered.
- yield new Promise(resolve => setTimeout(resolve, 100));
-
- Assert.ok(realListener.triggered, `2. The real listener was triggered`);
- Assert.ok(universalListener.triggered, `2. The universal listener was triggered`);
- Assert.ok(!fakeListener.triggered, `2. The fake listener was not triggered`);
- if (realListener.result) {
- Assert.ok(realListener.result.highestJank >= 300, `2. jank is at least 300ms (${realListener.jank}ms)`);
- }
-
- info(`Attempting to remove correctly, check if the listener is still triggered`);
- // Waiting a little – listeners are buffered.
- yield new Promise(resolve => setTimeout(resolve, 100));
- realListener.unregister();
-
- // Waiting a little – listeners are buffered.
- yield new Promise(resolve => setTimeout(resolve, 100));
- yield burner.run("promiseBurnContentCPU", 3, realListener);
- Assert.ok(!realListener.triggered, `3. After being unregistered, the real listener was not triggered`);
- Assert.ok(universalListener.triggered, `3. The universal listener is still triggered`);
-
- universalListener.unregister();
-
- // Waiting a little – listeners are buffered.
- yield new Promise(resolve => setTimeout(resolve, 100));
- yield burner.run("promiseBurnContentCPU", 3, realListener);
- Assert.ok(!universalListener.triggered, `4. After being unregistered, the universal listener is not triggered`);
-
- fakeListener.unregister();
- burner.dispose();
- gBrowser.removeTab(otherTab);
-});
diff --git a/toolkit/components/perfmonitoring/tests/browser/head.js b/toolkit/components/perfmonitoring/tests/browser/head.js
deleted file mode 100644
index 92258fd1b..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/head.js
+++ /dev/null
@@ -1,287 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var { utils: Cu, interfaces: Ci, classes: Cc } = Components;
-
-Cu.import("resource://gre/modules/Promise.jsm", this);
-Cu.import("resource://gre/modules/AddonManager.jsm", this);
-Cu.import("resource://gre/modules/AddonWatcher.jsm", this);
-Cu.import("resource://gre/modules/PerformanceWatcher.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://testing-common/ContentTaskUtils.jsm", this);
-
-/**
- * Base class for simulating slow addons/webpages.
- */
-function CPUBurner(url, jankThreshold) {
- info(`CPUBurner: Opening tab for ${url}\n`);
- this.url = url;
- this.tab = gBrowser.addTab(url);
- this.jankThreshold = jankThreshold;
- let browser = this.tab.linkedBrowser;
- this._browser = browser;
- ContentTask.spawn(this._browser, null, CPUBurner.frameScript);
- this.promiseInitialized = BrowserTestUtils.browserLoaded(browser);
-}
-CPUBurner.prototype = {
- get windowId() {
- return this._browser.outerWindowID;
- },
- /**
- * Burn CPU until it triggers a listener with the specified jank threshold.
- */
- run: Task.async(function*(burner, max, listener) {
- listener.reset();
- for (let i = 0; i < max; ++i) {
- yield new Promise(resolve => setTimeout(resolve, 50));
- try {
- yield this[burner]();
- } catch (ex) {
- return false;
- }
- if (listener.triggered && listener.result >= this.jankThreshold) {
- return true;
- }
- }
- return false;
- }),
- dispose: function() {
- info(`CPUBurner: Closing tab for ${this.url}\n`);
- gBrowser.removeTab(this.tab);
- }
-};
-// This function is injected in all frames
-CPUBurner.frameScript = function() {
- try {
- "use strict";
-
- const { utils: Cu, classes: Cc, interfaces: Ci } = Components;
- let sandboxes = new Map();
- let getSandbox = function(addonId) {
- let sandbox = sandboxes.get(addonId);
- if (!sandbox) {
- sandbox = Components.utils.Sandbox(Services.scriptSecurityManager.getSystemPrincipal(), { addonId });
- sandboxes.set(addonId, sandbox);
- }
- return sandbox;
- };
-
- let burnCPU = function() {
- var start = Date.now();
- var ignored = [];
- while (Date.now() - start < 500) {
- ignored[ignored.length % 2] = ignored.length;
- }
- };
- let burnCPUInSandbox = function(addonId) {
- let sandbox = getSandbox(addonId);
- Cu.evalInSandbox(burnCPU.toSource() + "()", sandbox);
- };
-
- {
- let topic = "test-performance-watcher:burn-content-cpu";
- addMessageListener(topic, function(msg) {
- try {
- if (msg.data && msg.data.addonId) {
- burnCPUInSandbox(msg.data.addonId);
- } else {
- burnCPU();
- }
- sendAsyncMessage(topic, {});
- } catch (ex) {
- dump(`This is the content attempting to burn CPU: error ${ex}\n`);
- dump(`${ex.stack}\n`);
- }
- });
- }
-
- // Bind the function to the global context or it might be GC'd during test
- // causing failures (bug 1230027)
- this.burnCPOWInSandbox = function(addonId) {
- try {
- burnCPUInSandbox(addonId);
- } catch (ex) {
- dump(`This is the addon attempting to burn CPOW: error ${ex}\n`);
- dump(`${ex.stack}\n`);
- }
- }
-
- sendAsyncMessage("test-performance-watcher:cpow-init", {}, {
- burnCPOWInSandbox: this.burnCPOWInSandbox
- });
-
- } catch (ex) {
- Cu.reportError("This is the addon: error " + ex);
- Cu.reportError(ex.stack);
- }
-};
-
-/**
- * Base class for listening to slow group alerts
- */
-function AlertListener(accept, {register, unregister}) {
- this.listener = (...args) => {
- if (this._unregistered) {
- throw new Error("Listener was unregistered");
- }
- let result = accept(...args);
- if (!result) {
- return;
- }
- this.result = result;
- this.triggered = true;
- return;
- };
- this.triggered = false;
- this.result = null;
- this._unregistered = false;
- this._unregister = unregister;
- registerCleanupFunction(() => {
- this.unregister();
- });
- register();
-}
-AlertListener.prototype = {
- unregister: function() {
- this.reset();
- if (this._unregistered) {
- info(`head.js: No need to unregister, we're already unregistered.\n`);
- return;
- }
- info(`head.js: Unregistering listener.\n`);
- this._unregistered = true;
- this._unregister();
- info(`head.js: Unregistration complete.\n`);
- },
- reset: function() {
- this.triggered = false;
- this.result = null;
- },
-};
-
-/**
- * Simulate a slow add-on.
- */
-function AddonBurner(addonId = "fake add-on id: " + Math.random()) {
- this.jankThreshold = 200000;
- CPUBurner.call(this, `http://example.com/?uri=${addonId}`, this.jankThreshold);
- this._addonId = addonId;
- this._sandbox = Components.utils.Sandbox(Services.scriptSecurityManager.getSystemPrincipal(), { addonId: this._addonId });
- this._CPOWBurner = null;
-
- this._promiseCPOWBurner = new Promise(resolve => {
- this._browser.messageManager.addMessageListener("test-performance-watcher:cpow-init", msg => {
- // Note that we cannot resolve Promises with CPOWs now that they
- // have been outlawed in bug 1233497, so we stash it in the
- // AddonBurner instance instead.
- this._CPOWBurner = msg.objects.burnCPOWInSandbox;
- resolve();
- });
- });
-}
-AddonBurner.prototype = Object.create(CPUBurner.prototype);
-Object.defineProperty(AddonBurner.prototype, "addonId", {
- get: function() {
- return this._addonId;
- }
-});
-
-/**
- * Simulate slow code being executed by the add-on in the chrome.
- */
-AddonBurner.prototype.burnCPU = function() {
- Cu.evalInSandbox(AddonBurner.burnCPU.toSource() + "()", this._sandbox);
-};
-
-/**
- * Simulate slow code being executed by the add-on in a CPOW.
- */
-AddonBurner.prototype.promiseBurnCPOW = Task.async(function*() {
- yield this._promiseCPOWBurner;
- ok(this._CPOWBurner, "Got the CPOW burner");
- let burner = this._CPOWBurner;
- info("Parent: Preparing to burn CPOW");
- try {
- yield burner(this._addonId);
- info("Parent: Done burning CPOW");
- } catch (ex) {
- info(`Parent: Error burning CPOW: ${ex}\n`);
- info(ex.stack + "\n");
- }
-});
-
-/**
- * Simulate slow code being executed by the add-on in the content.
- */
-AddonBurner.prototype.promiseBurnContentCPU = function() {
- return promiseContentResponse(this._browser, "test-performance-watcher:burn-content-cpu", {addonId: this._addonId});
-};
-AddonBurner.burnCPU = function() {
- var start = Date.now();
- var ignored = [];
- while (Date.now() - start < 500) {
- ignored[ignored.length % 2] = ignored.length;
- }
-};
-
-
-function AddonListener(addonId, accept) {
- let target = {addonId};
- AlertListener.call(this, accept, {
- register: () => {
- info(`AddonListener: registering ${JSON.stringify(target, null, "\t")}`);
- PerformanceWatcher.addPerformanceListener({addonId}, this.listener);
- },
- unregister: () => {
- info(`AddonListener: unregistering ${JSON.stringify(target, null, "\t")}`);
- PerformanceWatcher.removePerformanceListener({addonId}, this.listener);
- }
- });
-}
-AddonListener.prototype = Object.create(AlertListener.prototype);
-
-function promiseContentResponse(browser, name, message) {
- let mm = browser.messageManager;
- let promise = new Promise(resolve => {
- function removeListener() {
- mm.removeMessageListener(name, listener);
- }
-
- function listener(msg) {
- removeListener();
- resolve(msg.data);
- }
-
- mm.addMessageListener(name, listener);
- registerCleanupFunction(removeListener);
- });
- mm.sendAsyncMessage(name, message);
- return promise;
-}
-function promiseContentResponseOrNull(browser, name, message) {
- if (!browser.messageManager) {
- return null;
- }
- return promiseContentResponse(browser, name, message);
-}
-
-/**
- * `true` if we are running an OS in which the OS performance
- * clock has a low precision and might unpredictably
- * never be updated during the execution of the test.
- */
-function hasLowPrecision() {
- let [sysName, sysVersion] = [Services.sysinfo.getPropertyAsAString("name"), Services.sysinfo.getPropertyAsDouble("version")];
- info(`Running ${sysName} version ${sysVersion}`);
-
- if (sysName == "Windows_NT" && sysVersion < 6) {
- info("Running old Windows, need to deactivate tests due to bad precision.");
- return true;
- }
- if (sysName == "Linux" && sysVersion <= 2.6) {
- info("Running old Linux, need to deactivate tests due to bad precision.");
- return true;
- }
- info("This platform has good precision.")
- return false;
-}
diff --git a/toolkit/components/perfmonitoring/tests/browser/install.rdf b/toolkit/components/perfmonitoring/tests/browser/install.rdf
deleted file mode 100644
index 65add014f..000000000
--- a/toolkit/components/perfmonitoring/tests/browser/install.rdf
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
- <Description about="urn:mozilla:install-manifest">
- <em:id>addonwatcher-test@mozilla.com</em:id>
- <em:version>1.0</em:version>
-
- <em:targetApplication>
- <Description>
- <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id>
- <em:minVersion>0.3</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <em:targetApplication>
- <Description>
- <em:id>toolkit@mozilla.org</em:id>
- <em:minVersion>1</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <em:bootstrap>true</em:bootstrap>
-
- <em:name>Sample for browser_AddonWatcher.js</em:name>
-
- </Description>
-</RDF>
diff --git a/toolkit/components/places/PlacesUtils.jsm b/toolkit/components/places/PlacesUtils.jsm
index 5f6e81f18..259fb7aa7 100644
--- a/toolkit/components/places/PlacesUtils.jsm
+++ b/toolkit/components/places/PlacesUtils.jsm
@@ -30,7 +30,6 @@ const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
Cu.importGlobalProperties(["URL"]);
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Services",
"resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
@@ -64,7 +63,11 @@ const MIN_TRANSACTIONS_FOR_BATCH = 5;
// On Mac OSX, the transferable system converts "\r\n" to "\n\n", where
// we really just want "\n". On other platforms, the transferable system
// converts "\r\n" to "\n".
-const NEWLINE = AppConstants.platform == "macosx" ? "\n" : "\r\n";
+#ifdef XP_MACOSX
+const NEWLINE = "\n";
+#else
+const NEWLINE = "\r\n";
+#endif
function QI_node(aNode, aIID) {
var result = null;
diff --git a/toolkit/components/places/moz.build b/toolkit/components/places/moz.build
index 85e1e93e1..0d0ea7768 100644
--- a/toolkit/components/places/moz.build
+++ b/toolkit/components/places/moz.build
@@ -4,9 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-if CONFIG['MOZ_PLACES']:
- TEST_DIRS += ['tests']
-
XPIDL_SOURCES += [
'nsINavHistoryService.idl',
]
@@ -72,9 +69,10 @@ if CONFIG['MOZ_PLACES']:
'PlacesSearchAutocompleteProvider.jsm',
'PlacesSyncUtils.jsm',
'PlacesTransactions.jsm',
- 'PlacesUtils.jsm',
]
+ EXTRA_PP_JS_MODULES += ['PlacesUtils.jsm']
+
EXTRA_COMPONENTS += [
'ColorAnalyzer.js',
'nsLivemarkService.js',
@@ -92,8 +90,5 @@ if CONFIG['MOZ_PLACES']:
include('/ipc/chromium/chromium-config.mozbuild')
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Places')
-
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wno-error=shadow']
diff --git a/toolkit/components/places/tests/.eslintrc.js b/toolkit/components/places/tests/.eslintrc.js
deleted file mode 100644
index d5283c966..000000000
--- a/toolkit/components/places/tests/.eslintrc.js
+++ /dev/null
@@ -1,9 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/mochitest.eslintrc.js",
- "../../../../testing/mochitest/chrome.eslintrc.js",
- "../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/places/tests/PlacesTestUtils.jsm b/toolkit/components/places/tests/PlacesTestUtils.jsm
deleted file mode 100644
index 36e425cae..000000000
--- a/toolkit/components/places/tests/PlacesTestUtils.jsm
+++ /dev/null
@@ -1,163 +0,0 @@
-"use strict";
-
-this.EXPORTED_SYMBOLS = [
- "PlacesTestUtils",
-];
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Cu.importGlobalProperties(["URL"]);
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesUtils",
- "resource://gre/modules/PlacesUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-
-this.PlacesTestUtils = Object.freeze({
- /**
- * Asynchronously adds visits to a page.
- *
- * @param aPlaceInfo
- * Can be an nsIURI, in such a case a single LINK visit will be added.
- * Otherwise can be an object describing the visit to add, or an array
- * of these objects:
- * { uri: nsIURI of the page,
- * [optional] transition: one of the TRANSITION_* from nsINavHistoryService,
- * [optional] title: title of the page,
- * [optional] visitDate: visit date, either in microseconds from the epoch or as a date object
- * [optional] referrer: nsIURI of the referrer for this visit
- * }
- *
- * @return {Promise}
- * @resolves When all visits have been added successfully.
- * @rejects JavaScript exception.
- */
- addVisits: Task.async(function* (placeInfo) {
- let places = [];
- let infos = [];
-
- if (placeInfo instanceof Ci.nsIURI ||
- placeInfo instanceof URL ||
- typeof placeInfo == "string") {
- places.push({ uri: placeInfo });
- }
- else if (Array.isArray(placeInfo)) {
- places = places.concat(placeInfo);
- } else if (typeof placeInfo == "object" && placeInfo.uri) {
- places.push(placeInfo)
- } else {
- throw new Error("Unsupported type passed to addVisits");
- }
-
- // Create a PageInfo for each entry.
- for (let place of places) {
- let info = {url: place.uri};
- info.title = (typeof place.title === "string") ? place.title : "test visit for " + info.url.spec ;
- if (typeof place.referrer == "string") {
- place.referrer = NetUtil.newURI(place.referrer);
- } else if (place.referrer && place.referrer instanceof URL) {
- place.referrer = NetUtil.newURI(place.referrer.href);
- }
- let visitDate = place.visitDate;
- if (visitDate) {
- if (!(visitDate instanceof Date)) {
- visitDate = PlacesUtils.toDate(visitDate);
- }
- } else {
- visitDate = new Date();
- }
- info.visits = [{
- transition: place.transition,
- date: visitDate,
- referrer: place.referrer
- }];
- infos.push(info);
- }
- return PlacesUtils.history.insertMany(infos);
- }),
-
- /**
- * Clear all history.
- *
- * @return {Promise}
- * @resolves When history was cleared successfully.
- * @rejects JavaScript exception.
- */
- clearHistory() {
- let expirationFinished = new Promise(resolve => {
- Services.obs.addObserver(function observe(subj, topic, data) {
- Services.obs.removeObserver(observe, topic);
- resolve();
- }, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false);
- });
-
- return Promise.all([expirationFinished, PlacesUtils.history.clear()]);
- },
-
- /**
- * Waits for all pending async statements on the default connection.
- *
- * @return {Promise}
- * @resolves When all pending async statements finished.
- * @rejects Never.
- *
- * @note The result is achieved by asynchronously executing a query requiring
- * a write lock. Since all statements on the same connection are
- * serialized, the end of this write operation means that all writes are
- * complete. Note that WAL makes so that writers don't block readers, but
- * this is a problem only across different connections.
- */
- promiseAsyncUpdates() {
- return PlacesUtils.withConnectionWrapper("promiseAsyncUpdates", Task.async(function* (db) {
- try {
- yield db.executeCached("BEGIN EXCLUSIVE");
- yield db.executeCached("COMMIT");
- } catch (ex) {
- // If we fail to start a transaction, it's because there is already one.
- // In such a case we should not try to commit the existing transaction.
- }
- }));
- },
-
- /**
- * Asynchronously checks if an address is found in the database.
- * @param aURI
- * nsIURI or address to look for.
- *
- * @return {Promise}
- * @resolves Returns true if the page is found.
- * @rejects JavaScript exception.
- */
- isPageInDB: Task.async(function* (aURI) {
- let url = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.executeCached(
- "SELECT id FROM moz_places WHERE url_hash = hash(:url) AND url = :url",
- { url });
- return rows.length > 0;
- }),
-
- /**
- * Asynchronously checks how many visits exist for a specified page.
- * @param aURI
- * nsIURI or address to look for.
- *
- * @return {Promise}
- * @resolves Returns the number of visits found.
- * @rejects JavaScript exception.
- */
- visitsInDB: Task.async(function* (aURI) {
- let url = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.executeCached(
- `SELECT count(*) FROM moz_historyvisits v
- JOIN moz_places h ON h.id = v.place_id
- WHERE url_hash = hash(:url) AND url = :url`,
- { url });
- return rows[0].getResultByIndex(0);
- })
-});
diff --git a/toolkit/components/places/tests/bookmarks/.eslintrc.js b/toolkit/components/places/tests/bookmarks/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/places/tests/bookmarks/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/places/tests/bookmarks/head_bookmarks.js b/toolkit/components/places/tests/bookmarks/head_bookmarks.js
deleted file mode 100644
index 842a66b31..000000000
--- a/toolkit/components/places/tests/bookmarks/head_bookmarks.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cr = Components.results;
-var Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-// Import common head.
-{
- let commonFile = do_get_file("../head_common.js", false);
- let uri = Services.io.newFileURI(commonFile);
- Services.scriptloader.loadSubScript(uri.spec, this);
-}
-
-// Put any other stuff relative to this test folder below.
diff --git a/toolkit/components/places/tests/bookmarks/test_1016953-renaming-uncompressed.js b/toolkit/components/places/tests/bookmarks/test_1016953-renaming-uncompressed.js
deleted file mode 100644
index b6982987b..000000000
--- a/toolkit/components/places/tests/bookmarks/test_1016953-renaming-uncompressed.js
+++ /dev/null
@@ -1,103 +0,0 @@
-function run_test() {
- run_next_test();
-}
-
-/* Bug 1016953 - When a previous bookmark backup exists with the same hash
-regardless of date, an automatic backup should attempt to either rename it to
-today's date if the backup was for an old date or leave it alone if it was for
-the same date. However if the file ext was json it will accidentally rename it
-to jsonlz4 while keeping the json contents
-*/
-
-add_task(function* test_same_date_same_hash() {
- // If old file has been created on the same date and has the same hash
- // the file should be left alone
- let backupFolder = yield PlacesBackups.getBackupFolder();
- // Save to profile dir to obtain hash and nodeCount to append to filename
- let tempPath = OS.Path.join(OS.Constants.Path.profileDir,
- "bug10169583_bookmarks.json");
- let {count, hash} = yield BookmarkJSONUtils.exportToFile(tempPath);
-
- // Save JSON file in backup folder with hash appended
- let dateObj = new Date();
- let filename = "bookmarks-" + PlacesBackups.toISODateString(dateObj) + "_" +
- count + "_" + hash + ".json";
- let backupFile = OS.Path.join(backupFolder, filename);
- yield OS.File.move(tempPath, backupFile);
-
- // Force a compressed backup which fallbacks to rename
- yield PlacesBackups.create();
- let mostRecentBackupFile = yield PlacesBackups.getMostRecentBackup();
- // check to ensure not renamed to jsonlz4
- Assert.equal(mostRecentBackupFile, backupFile);
- // inspect contents and check if valid json
- let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
- createInstance(Ci.nsIScriptableUnicodeConverter);
- converter.charset = "UTF-8";
- let result = yield OS.File.read(mostRecentBackupFile);
- let jsonString = converter.convertFromByteArray(result, result.length);
- do_print("Check is valid JSON");
- JSON.parse(jsonString);
-
- // Cleanup
- yield OS.File.remove(backupFile);
- yield OS.File.remove(tempPath);
- PlacesBackups._backupFiles = null; // To force re-cache of backupFiles
-});
-
-add_task(function* test_same_date_diff_hash() {
- // If the old file has been created on the same date, but has a different hash
- // the existing file should be overwritten with the newer compressed version
- let backupFolder = yield PlacesBackups.getBackupFolder();
- let tempPath = OS.Path.join(OS.Constants.Path.profileDir,
- "bug10169583_bookmarks.json");
- let {count} = yield BookmarkJSONUtils.exportToFile(tempPath);
- let dateObj = new Date();
- let filename = "bookmarks-" + PlacesBackups.toISODateString(dateObj) + "_" +
- count + "_" + "differentHash==" + ".json";
- let backupFile = OS.Path.join(backupFolder, filename);
- yield OS.File.move(tempPath, backupFile);
- yield PlacesBackups.create(); // Force compressed backup
- mostRecentBackupFile = yield PlacesBackups.getMostRecentBackup();
-
- // Decode lz4 compressed file to json and check if json is valid
- let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
- createInstance(Ci.nsIScriptableUnicodeConverter);
- converter.charset = "UTF-8";
- let result = yield OS.File.read(mostRecentBackupFile, { compression: "lz4" });
- let jsonString = converter.convertFromByteArray(result, result.length);
- do_print("Check is valid JSON");
- JSON.parse(jsonString);
-
- // Cleanup
- yield OS.File.remove(mostRecentBackupFile);
- yield OS.File.remove(tempPath);
- PlacesBackups._backupFiles = null; // To force re-cache of backupFiles
-});
-
-add_task(function* test_diff_date_same_hash() {
- // If the old file has been created on an older day but has the same hash
- // it should be renamed with today's date without altering the contents.
- let backupFolder = yield PlacesBackups.getBackupFolder();
- let tempPath = OS.Path.join(OS.Constants.Path.profileDir,
- "bug10169583_bookmarks.json");
- let {count, hash} = yield BookmarkJSONUtils.exportToFile(tempPath);
- let oldDate = new Date(2014, 1, 1);
- let curDate = new Date();
- let oldFilename = "bookmarks-" + PlacesBackups.toISODateString(oldDate) + "_" +
- count + "_" + hash + ".json";
- let newFilename = "bookmarks-" + PlacesBackups.toISODateString(curDate) + "_" +
- count + "_" + hash + ".json";
- let backupFile = OS.Path.join(backupFolder, oldFilename);
- let newBackupFile = OS.Path.join(backupFolder, newFilename);
- yield OS.File.move(tempPath, backupFile);
-
- // Ensure file has been renamed correctly
- yield PlacesBackups.create();
- let mostRecentBackupFile = yield PlacesBackups.getMostRecentBackup();
- Assert.equal(mostRecentBackupFile, newBackupFile);
-
- // Cleanup
- yield OS.File.remove(mostRecentBackupFile);
- yield OS.File.remove(tempPath);
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_1017502-bookmarks_foreign_count.js b/toolkit/components/places/tests/bookmarks/test_1017502-bookmarks_foreign_count.js
deleted file mode 100644
index 13755e576..000000000
--- a/toolkit/components/places/tests/bookmarks/test_1017502-bookmarks_foreign_count.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Bug 1017502 - Add a foreign_count column to moz_places
-This tests, tests the triggers that adjust the foreign_count when a bookmark is
-added or removed and also the maintenance task to fix wrong counts.
-*/
-
-const T_URI = NetUtil.newURI("https://www.mozilla.org/firefox/nightly/firstrun/");
-
-function* getForeignCountForURL(conn, url) {
- yield PlacesTestUtils.promiseAsyncUpdates();
- url = url instanceof Ci.nsIURI ? url.spec : url;
- let rows = yield conn.executeCached(
- `SELECT foreign_count FROM moz_places WHERE url_hash = hash(:t_url)
- AND url = :t_url`, { t_url: url });
- return rows[0].getResultByName("foreign_count");
-}
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* add_remove_change_bookmark_test() {
- let conn = yield PlacesUtils.promiseDBConnection();
-
- // Simulate a visit to the url
- yield PlacesTestUtils.addVisits(T_URI);
- Assert.equal((yield getForeignCountForURL(conn, T_URI)), 0);
-
- // Add 1st bookmark which should increment foreign_count by 1
- let id1 = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- T_URI, PlacesUtils.bookmarks.DEFAULT_INDEX, "First Run");
- Assert.equal((yield getForeignCountForURL(conn, T_URI)), 1);
-
- // Add 2nd bookmark
- let id2 = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.bookmarksMenuFolderId,
- T_URI, PlacesUtils.bookmarks.DEFAULT_INDEX, "First Run");
- Assert.equal((yield getForeignCountForURL(conn, T_URI)), 2);
-
- // Remove 2nd bookmark which should decrement foreign_count by 1
- PlacesUtils.bookmarks.removeItem(id2);
- Assert.equal((yield getForeignCountForURL(conn, T_URI)), 1);
-
- // Change first bookmark's URI
- const URI2 = NetUtil.newURI("http://www.mozilla.org");
- PlacesUtils.bookmarks.changeBookmarkURI(id1, URI2);
- // Check foreign count for original URI
- Assert.equal((yield getForeignCountForURL(conn, T_URI)), 0);
- // Check foreign count for new URI
- Assert.equal((yield getForeignCountForURL(conn, URI2)), 1);
-
- // Cleanup - Remove changed bookmark
- let id = PlacesUtils.bookmarks.getBookmarkIdsForURI(URI2);
- PlacesUtils.bookmarks.removeItem(id);
- Assert.equal((yield getForeignCountForURL(conn, URI2)), 0);
-
-});
-
-add_task(function* maintenance_foreign_count_test() {
- let conn = yield PlacesUtils.promiseDBConnection();
-
- // Simulate a visit to the url
- yield PlacesTestUtils.addVisits(T_URI);
-
- // Adjust the foreign_count for the added entry to an incorrect value
- let deferred = Promise.defer();
- let stmt = DBConn().createAsyncStatement(
- `UPDATE moz_places SET foreign_count = 10 WHERE url_hash = hash(:t_url)
- AND url = :t_url `);
- stmt.params.t_url = T_URI.spec;
- stmt.executeAsync({
- handleCompletion: function() {
- deferred.resolve();
- }
- });
- stmt.finalize();
- yield deferred.promise;
- Assert.equal((yield getForeignCountForURL(conn, T_URI)), 10);
-
- // Run maintenance
- Components.utils.import("resource://gre/modules/PlacesDBUtils.jsm");
- let promiseMaintenanceFinished =
- promiseTopicObserved("places-maintenance-finished");
- PlacesDBUtils.maintenanceOnIdle();
- yield promiseMaintenanceFinished;
-
- // Check if the foreign_count has been adjusted to the correct value
- Assert.equal((yield getForeignCountForURL(conn, T_URI)), 0);
-});
-
-add_task(function* add_remove_tags_test() {
- let conn = yield PlacesUtils.promiseDBConnection();
-
- yield PlacesTestUtils.addVisits(T_URI);
- Assert.equal((yield getForeignCountForURL(conn, T_URI)), 0);
-
- // Check foreign count incremented by 1 for a single tag
- PlacesUtils.tagging.tagURI(T_URI, ["test tag"]);
- Assert.equal((yield getForeignCountForURL(conn, T_URI)), 1);
-
- // Check foreign count is incremented by 2 for two tags
- PlacesUtils.tagging.tagURI(T_URI, ["one", "two"]);
- Assert.equal((yield getForeignCountForURL(conn, T_URI)), 3);
-
- // Check foreign count is set to 0 when all tags are removed
- PlacesUtils.tagging.untagURI(T_URI, ["test tag", "one", "two"]);
- Assert.equal((yield getForeignCountForURL(conn, T_URI)), 0);
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_1129529.js b/toolkit/components/places/tests/bookmarks/test_1129529.js
deleted file mode 100644
index da1ff708f..000000000
--- a/toolkit/components/places/tests/bookmarks/test_1129529.js
+++ /dev/null
@@ -1,76 +0,0 @@
-var now = Date.now() * 1000;
-
-// Test that importing bookmark data where a bookmark has a tag longer than 100
-// chars imports everything except the tags for that bookmark.
-add_task(function* () {
- let aData = {
- guid: "root________",
- index: 0,
- id: 1,
- type: "text/x-moz-place-container",
- dateAdded: now,
- lastModified: now,
- root: "placesRoot",
- children: [{
- guid: "unfiled_____",
- index: 0,
- id: 2,
- type: "text/x-moz-place-container",
- dateAdded: now,
- lastModified: now,
- root: "unfiledBookmarksFolder",
- children: [
- {
- guid: "___guid1____",
- index: 0,
- id: 3,
- charset: "UTF-8",
- tags: "tag0",
- type: "text/x-moz-place",
- dateAdded: now,
- lastModified: now,
- uri: "http://test0.com/"
- },
- {
- guid: "___guid2____",
- index: 1,
- id: 4,
- charset: "UTF-8",
- tags: "tag1," + "a" + "0123456789".repeat(10), // 101 chars
- type: "text/x-moz-place",
- dateAdded: now,
- lastModified: now,
- uri: "http://test1.com/"
- },
- {
- guid: "___guid3____",
- index: 2,
- id: 5,
- charset: "UTF-8",
- tags: "tag2",
- type: "text/x-moz-place",
- dateAdded: now,
- lastModified: now,
- uri: "http://test2.com/"
- }
- ]
- }]
- };
-
- let contentType = "application/json";
- let uri = "data:" + contentType + "," + JSON.stringify(aData);
- yield BookmarkJSONUtils.importFromURL(uri, false);
-
- let [bookmarks] = yield PlacesBackups.getBookmarksTree();
- let unsortedBookmarks = bookmarks.children[2].children;
- Assert.equal(unsortedBookmarks.length, 3);
-
- for (let i = 0; i < unsortedBookmarks.length; ++i) {
- let bookmark = unsortedBookmarks[i];
- Assert.equal(bookmark.charset, "UTF-8");
- Assert.equal(bookmark.dateAdded, now);
- Assert.equal(bookmark.lastModified, now);
- Assert.equal(bookmark.uri, "http://test" + i + ".com/");
- Assert.equal(bookmark.tags, "tag" + i);
- }
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_384228.js b/toolkit/components/places/tests/bookmarks/test_384228.js
deleted file mode 100644
index 9a52c9746..000000000
--- a/toolkit/components/places/tests/bookmarks/test_384228.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * test querying for bookmarks in multiple folders.
- */
-add_task(function* search_bookmark_in_folder() {
- let testFolder1 = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "bug 384228 test folder 1"
- });
- Assert.equal(testFolder1.index, 0);
-
- let testFolder2 = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "bug 384228 test folder 2"
- });
- Assert.equal(testFolder2.index, 1);
-
- let testFolder3 = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "bug 384228 test folder 3"
- });
- Assert.equal(testFolder3.index, 2);
-
- let b1 = yield PlacesUtils.bookmarks.insert({
- parentGuid: testFolder1.guid,
- url: "http://foo.tld/",
- title: "title b1 (folder 1)"
- });
- Assert.equal(b1.index, 0);
-
- let b2 = yield PlacesUtils.bookmarks.insert({
- parentGuid: testFolder1.guid,
- url: "http://foo.tld/",
- title: "title b2 (folder 1)"
- });
- Assert.equal(b2.index, 1);
-
- let b3 = yield PlacesUtils.bookmarks.insert({
- parentGuid: testFolder2.guid,
- url: "http://foo.tld/",
- title: "title b3 (folder 2)"
- });
- Assert.equal(b3.index, 0);
-
- let b4 = yield PlacesUtils.bookmarks.insert({
- parentGuid: testFolder3.guid,
- url: "http://foo.tld/",
- title: "title b4 (folder 3)"
- });
- Assert.equal(b4.index, 0);
-
- // also test recursive search
- let testFolder1_1 = yield PlacesUtils.bookmarks.insert({
- parentGuid: testFolder1.guid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "bug 384228 test folder 1.1"
- });
- Assert.equal(testFolder1_1.index, 2);
-
- let b5 = yield PlacesUtils.bookmarks.insert({
- parentGuid: testFolder1_1.guid,
- url: "http://foo.tld/",
- title: "title b5 (folder 1.1)"
- });
- Assert.equal(b5.index, 0);
-
-
- // query folder 1, folder 2 and get 4 bookmarks
- let folderIds = [];
- folderIds.push(yield PlacesUtils.promiseItemId(testFolder1.guid));
- folderIds.push(yield PlacesUtils.promiseItemId(testFolder2.guid));
-
- let hs = PlacesUtils.history;
- let options = hs.getNewQueryOptions();
- let query = hs.getNewQuery();
- query.searchTerms = "title";
- options.queryType = options.QUERY_TYPE_BOOKMARKS;
- query.setFolders(folderIds, folderIds.length);
- let rootNode = hs.executeQuery(query, options).root;
- rootNode.containerOpen = true;
-
- // should not match item from folder 3
- Assert.equal(rootNode.childCount, 4);
- Assert.equal(rootNode.getChild(0).bookmarkGuid, b1.guid);
- Assert.equal(rootNode.getChild(1).bookmarkGuid, b2.guid);
- Assert.equal(rootNode.getChild(2).bookmarkGuid, b3.guid);
- Assert.equal(rootNode.getChild(3).bookmarkGuid, b5.guid);
-
- rootNode.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_385829.js b/toolkit/components/places/tests/bookmarks/test_385829.js
deleted file mode 100644
index 63beee5f3..000000000
--- a/toolkit/components/places/tests/bookmarks/test_385829.js
+++ /dev/null
@@ -1,182 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-add_task(function* search_bookmark_by_lastModified_dateDated() {
- // test search on folder with various sorts and max results
- // see bug #385829 for more details
- let folder = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "bug 385829 test"
- });
-
- let now = new Date();
- // ensure some unique values for date added and last modified
- // for date added: b1 < b2 < b3 < b4
- // for last modified: b1 > b2 > b3 > b4
- let b1 = yield PlacesUtils.bookmarks.insert({
- parentGuid: folder.guid,
- url: "http://a1.com/",
- title: "1 title",
- dateAdded: new Date(now.getTime() + 1000)
- });
- let b2 = yield PlacesUtils.bookmarks.insert({
- parentGuid: folder.guid,
- url: "http://a2.com/",
- title: "2 title",
- dateAdded: new Date(now.getTime() + 2000)
- });
- let b3 = yield PlacesUtils.bookmarks.insert({
- parentGuid: folder.guid,
- url: "http://a3.com/",
- title: "3 title",
- dateAdded: new Date(now.getTime() + 3000)
- });
- let b4 = yield PlacesUtils.bookmarks.insert({
- parentGuid: folder.guid,
- url: "http://a4.com/",
- title: "4 title",
- dateAdded: new Date(now.getTime() + 4000)
- });
-
- // make sure lastModified is larger than dateAdded
- let modifiedTime = new Date(now.getTime() + 5000);
- yield PlacesUtils.bookmarks.update({
- guid: b1.guid,
- lastModified: new Date(modifiedTime.getTime() + 4000)
- });
- yield PlacesUtils.bookmarks.update({
- guid: b2.guid,
- lastModified: new Date(modifiedTime.getTime() + 3000)
- });
- yield PlacesUtils.bookmarks.update({
- guid: b3.guid,
- lastModified: new Date(modifiedTime.getTime() + 2000)
- });
- yield PlacesUtils.bookmarks.update({
- guid: b4.guid,
- lastModified: new Date(modifiedTime.getTime() + 1000)
- });
-
- let hs = PlacesUtils.history;
- let options = hs.getNewQueryOptions();
- let query = hs.getNewQuery();
- options.queryType = options.QUERY_TYPE_BOOKMARKS;
- options.maxResults = 3;
- let folderIds = [];
- folderIds.push(yield PlacesUtils.promiseItemId(folder.guid));
- query.setFolders(folderIds, 1);
-
- let result = hs.executeQuery(query, options);
- let rootNode = result.root;
- rootNode.containerOpen = true;
-
- // test SORT_BY_DATEADDED_ASCENDING (live update)
- result.sortingMode = options.SORT_BY_DATEADDED_ASCENDING;
- Assert.equal(rootNode.childCount, 3);
- Assert.equal(rootNode.getChild(0).bookmarkGuid, b1.guid);
- Assert.equal(rootNode.getChild(1).bookmarkGuid, b2.guid);
- Assert.equal(rootNode.getChild(2).bookmarkGuid, b3.guid);
- Assert.ok(rootNode.getChild(0).dateAdded <
- rootNode.getChild(1).dateAdded);
- Assert.ok(rootNode.getChild(1).dateAdded <
- rootNode.getChild(2).dateAdded);
-
- // test SORT_BY_DATEADDED_DESCENDING (live update)
- result.sortingMode = options.SORT_BY_DATEADDED_DESCENDING;
- Assert.equal(rootNode.childCount, 3);
- Assert.equal(rootNode.getChild(0).bookmarkGuid, b3.guid);
- Assert.equal(rootNode.getChild(1).bookmarkGuid, b2.guid);
- Assert.equal(rootNode.getChild(2).bookmarkGuid, b1.guid);
- Assert.ok(rootNode.getChild(0).dateAdded >
- rootNode.getChild(1).dateAdded);
- Assert.ok(rootNode.getChild(1).dateAdded >
- rootNode.getChild(2).dateAdded);
-
- // test SORT_BY_LASTMODIFIED_ASCENDING (live update)
- result.sortingMode = options.SORT_BY_LASTMODIFIED_ASCENDING;
- Assert.equal(rootNode.childCount, 3);
- Assert.equal(rootNode.getChild(0).bookmarkGuid, b3.guid);
- Assert.equal(rootNode.getChild(1).bookmarkGuid, b2.guid);
- Assert.equal(rootNode.getChild(2).bookmarkGuid, b1.guid);
- Assert.ok(rootNode.getChild(0).lastModified <
- rootNode.getChild(1).lastModified);
- Assert.ok(rootNode.getChild(1).lastModified <
- rootNode.getChild(2).lastModified);
-
- // test SORT_BY_LASTMODIFIED_DESCENDING (live update)
- result.sortingMode = options.SORT_BY_LASTMODIFIED_DESCENDING;
-
- Assert.equal(rootNode.childCount, 3);
- Assert.equal(rootNode.getChild(0).bookmarkGuid, b1.guid);
- Assert.equal(rootNode.getChild(1).bookmarkGuid, b2.guid);
- Assert.equal(rootNode.getChild(2).bookmarkGuid, b3.guid);
- Assert.ok(rootNode.getChild(0).lastModified >
- rootNode.getChild(1).lastModified);
- Assert.ok(rootNode.getChild(1).lastModified >
- rootNode.getChild(2).lastModified);
- rootNode.containerOpen = false;
-
- // test SORT_BY_DATEADDED_ASCENDING
- options.sortingMode = options.SORT_BY_DATEADDED_ASCENDING;
- result = hs.executeQuery(query, options);
- rootNode = result.root;
- rootNode.containerOpen = true;
- Assert.equal(rootNode.childCount, 3);
- Assert.equal(rootNode.getChild(0).bookmarkGuid, b1.guid);
- Assert.equal(rootNode.getChild(1).bookmarkGuid, b2.guid);
- Assert.equal(rootNode.getChild(2).bookmarkGuid, b3.guid);
- Assert.ok(rootNode.getChild(0).dateAdded <
- rootNode.getChild(1).dateAdded);
- Assert.ok(rootNode.getChild(1).dateAdded <
- rootNode.getChild(2).dateAdded);
- rootNode.containerOpen = false;
-
- // test SORT_BY_DATEADDED_DESCENDING
- options.sortingMode = options.SORT_BY_DATEADDED_DESCENDING;
- result = hs.executeQuery(query, options);
- rootNode = result.root;
- rootNode.containerOpen = true;
- Assert.equal(rootNode.childCount, 3);
- Assert.equal(rootNode.getChild(0).bookmarkGuid, b4.guid);
- Assert.equal(rootNode.getChild(1).bookmarkGuid, b3.guid);
- Assert.equal(rootNode.getChild(2).bookmarkGuid, b2.guid);
- Assert.ok(rootNode.getChild(0).dateAdded >
- rootNode.getChild(1).dateAdded);
- Assert.ok(rootNode.getChild(1).dateAdded >
- rootNode.getChild(2).dateAdded);
- rootNode.containerOpen = false;
-
- // test SORT_BY_LASTMODIFIED_ASCENDING
- options.sortingMode = options.SORT_BY_LASTMODIFIED_ASCENDING;
- result = hs.executeQuery(query, options);
- rootNode = result.root;
- rootNode.containerOpen = true;
- Assert.equal(rootNode.childCount, 3);
- Assert.equal(rootNode.getChild(0).bookmarkGuid, b4.guid);
- Assert.equal(rootNode.getChild(1).bookmarkGuid, b3.guid);
- Assert.equal(rootNode.getChild(2).bookmarkGuid, b2.guid);
- Assert.ok(rootNode.getChild(0).lastModified <
- rootNode.getChild(1).lastModified);
- Assert.ok(rootNode.getChild(1).lastModified <
- rootNode.getChild(2).lastModified);
- rootNode.containerOpen = false;
-
- // test SORT_BY_LASTMODIFIED_DESCENDING
- options.sortingMode = options.SORT_BY_LASTMODIFIED_DESCENDING;
- result = hs.executeQuery(query, options);
- rootNode = result.root;
- rootNode.containerOpen = true;
- Assert.equal(rootNode.childCount, 3);
- Assert.equal(rootNode.getChild(0).bookmarkGuid, b1.guid);
- Assert.equal(rootNode.getChild(1).bookmarkGuid, b2.guid);
- Assert.equal(rootNode.getChild(2).bookmarkGuid, b3.guid);
- Assert.ok(rootNode.getChild(0).lastModified >
- rootNode.getChild(1).lastModified);
- Assert.ok(rootNode.getChild(1).lastModified >
- rootNode.getChild(2).lastModified);
- rootNode.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_388695.js b/toolkit/components/places/tests/bookmarks/test_388695.js
deleted file mode 100644
index 4e313c52f..000000000
--- a/toolkit/components/places/tests/bookmarks/test_388695.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Get bookmark service
-try {
- var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-} catch (ex) {
- do_throw("Could not get nav-bookmarks-service\n");
-}
-
-var gTestRoot;
-var gURI;
-var gItemId1;
-var gItemId2;
-
-// main
-function run_test() {
- gURI = uri("http://foo.tld.com/");
- gTestRoot = bmsvc.createFolder(bmsvc.placesRoot, "test folder",
- bmsvc.DEFAULT_INDEX);
-
- // test getBookmarkIdsForURI
- // getBookmarkIdsForURI sorts by the most recently added/modified (descending)
- //
- // we cannot rely on dateAdded growing when doing so in a simple iteration,
- // see PR_Now() documentation
- do_test_pending();
-
- gItemId1 = bmsvc.insertBookmark(gTestRoot, gURI, bmsvc.DEFAULT_INDEX, "");
- do_timeout(100, phase2);
-}
-
-function phase2() {
- gItemId2 = bmsvc.insertBookmark(gTestRoot, gURI, bmsvc.DEFAULT_INDEX, "");
- var b = bmsvc.getBookmarkIdsForURI(gURI);
- do_check_eq(b[0], gItemId2);
- do_check_eq(b[1], gItemId1);
- do_timeout(100, phase3);
-}
-
-function phase3() {
- // trigger last modified change
- bmsvc.setItemTitle(gItemId1, "");
- var b = bmsvc.getBookmarkIdsForURI(gURI);
- do_check_eq(b[0], gItemId1);
- do_check_eq(b[1], gItemId2);
- do_test_finished();
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_393498.js b/toolkit/components/places/tests/bookmarks/test_393498.js
deleted file mode 100644
index 601f77a0a..000000000
--- a/toolkit/components/places/tests/bookmarks/test_393498.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var observer = {
- __proto__: NavBookmarkObserver.prototype,
-
- onItemAdded: function (id, folder, index) {
- this._itemAddedId = id;
- this._itemAddedParent = folder;
- this._itemAddedIndex = index;
- },
- onItemChanged: function (id, property, isAnnotationProperty, value) {
- this._itemChangedId = id;
- this._itemChangedProperty = property;
- this._itemChanged_isAnnotationProperty = isAnnotationProperty;
- this._itemChangedValue = value;
- }
-};
-PlacesUtils.bookmarks.addObserver(observer, false);
-
-do_register_cleanup(function () {
- PlacesUtils.bookmarks.removeObserver(observer);
-});
-
-function run_test() {
- // We set times in the past to workaround a timing bug due to virtual
- // machines and the skew between PR_Now() and Date.now(), see bug 427142 and
- // bug 858377 for details.
- const PAST_PRTIME = (Date.now() - 86400000) * 1000;
-
- // Insert a new bookmark.
- let testFolder = PlacesUtils.bookmarks.createFolder(
- PlacesUtils.placesRootId, "test Folder",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- let bookmarkId = PlacesUtils.bookmarks.insertBookmark(
- testFolder, uri("http://google.com/"),
- PlacesUtils.bookmarks.DEFAULT_INDEX, "");
-
- // Sanity check.
- do_check_true(observer.itemChangedProperty === undefined);
-
- // Set dateAdded in the past and verify the bookmarks cache.
- PlacesUtils.bookmarks.setItemDateAdded(bookmarkId, PAST_PRTIME);
- do_check_eq(observer._itemChangedProperty, "dateAdded");
- do_check_eq(observer._itemChangedValue, PAST_PRTIME);
- let dateAdded = PlacesUtils.bookmarks.getItemDateAdded(bookmarkId);
- do_check_eq(dateAdded, PAST_PRTIME);
-
- // After just inserting, modified should be the same as dateAdded.
- do_check_eq(PlacesUtils.bookmarks.getItemLastModified(bookmarkId), dateAdded);
-
- // Set lastModified in the past and verify the bookmarks cache.
- PlacesUtils.bookmarks.setItemLastModified(bookmarkId, PAST_PRTIME);
- do_check_eq(observer._itemChangedProperty, "lastModified");
- do_check_eq(observer._itemChangedValue, PAST_PRTIME);
- do_check_eq(PlacesUtils.bookmarks.getItemLastModified(bookmarkId),
- PAST_PRTIME);
-
- // Set bookmark title
- PlacesUtils.bookmarks.setItemTitle(bookmarkId, "Google");
-
- // Test notifications.
- do_check_eq(observer._itemChangedId, bookmarkId);
- do_check_eq(observer._itemChangedProperty, "title");
- do_check_eq(observer._itemChangedValue, "Google");
-
- // Check lastModified has been updated.
- is_time_ordered(PAST_PRTIME,
- PlacesUtils.bookmarks.getItemLastModified(bookmarkId));
-
- // Check that node properties are updated.
- let root = PlacesUtils.getFolderContents(testFolder).root;
- do_check_eq(root.childCount, 1);
- let childNode = root.getChild(0);
-
- // confirm current dates match node properties
- do_check_eq(PlacesUtils.bookmarks.getItemDateAdded(bookmarkId),
- childNode.dateAdded);
- do_check_eq(PlacesUtils.bookmarks.getItemLastModified(bookmarkId),
- childNode.lastModified);
-
- // Test live update of lastModified when setting title.
- PlacesUtils.bookmarks.setItemLastModified(bookmarkId, PAST_PRTIME);
- PlacesUtils.bookmarks.setItemTitle(bookmarkId, "Google");
-
- // Check lastModified has been updated.
- is_time_ordered(PAST_PRTIME, childNode.lastModified);
- // Test that node value matches db value.
- do_check_eq(PlacesUtils.bookmarks.getItemLastModified(bookmarkId),
- childNode.lastModified);
-
- // Test live update of the exposed date apis.
- PlacesUtils.bookmarks.setItemDateAdded(bookmarkId, PAST_PRTIME);
- do_check_eq(childNode.dateAdded, PAST_PRTIME);
- PlacesUtils.bookmarks.setItemLastModified(bookmarkId, PAST_PRTIME);
- do_check_eq(childNode.lastModified, PAST_PRTIME);
-
- root.containerOpen = false;
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_395101.js b/toolkit/components/places/tests/bookmarks/test_395101.js
deleted file mode 100644
index a507e7361..000000000
--- a/toolkit/components/places/tests/bookmarks/test_395101.js
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Get bookmark service
-try {
- var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].getService(Ci.nsINavBookmarksService);
-} catch (ex) {
- do_throw("Could not get nav-bookmarks-service\n");
-}
-
-// Get history service
-try {
- var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsINavHistoryService);
-} catch (ex) {
- do_throw("Could not get history service\n");
-}
-
-// Get tagging service
-try {
- var tagssvc = Cc["@mozilla.org/browser/tagging-service;1"].
- getService(Ci.nsITaggingService);
-} catch (ex) {
- do_throw("Could not get tagging service\n");
-}
-
-// get bookmarks root id
-var root = bmsvc.bookmarksMenuFolder;
-
-// main
-function run_test() {
- // test searching for tagged bookmarks
-
- // test folder
- var folder = bmsvc.createFolder(root, "bug 395101 test", bmsvc.DEFAULT_INDEX);
-
- // create a bookmark
- var testURI = uri("http://a1.com");
- var b1 = bmsvc.insertBookmark(folder, testURI,
- bmsvc.DEFAULT_INDEX, "1 title");
-
- // tag the bookmarked URI
- tagssvc.tagURI(testURI, ["elephant", "walrus", "giraffe", "turkey", "hiPPo", "BABOON", "alf"]);
-
- // search for the bookmark, using a tag
- var query = histsvc.getNewQuery();
- query.searchTerms = "elephant";
- var options = histsvc.getNewQueryOptions();
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
- query.setFolders([folder], 1);
-
- var result = histsvc.executeQuery(query, options);
- var rootNode = result.root;
- rootNode.containerOpen = true;
-
- do_check_eq(rootNode.childCount, 1);
- do_check_eq(rootNode.getChild(0).itemId, b1);
- rootNode.containerOpen = false;
-
- // partial matches are okay
- query.searchTerms = "wal";
- result = histsvc.executeQuery(query, options);
- rootNode = result.root;
- rootNode.containerOpen = true;
- do_check_eq(rootNode.childCount, 1);
- rootNode.containerOpen = false;
-
- // case insensitive search term
- query.searchTerms = "WALRUS";
- result = histsvc.executeQuery(query, options);
- rootNode = result.root;
- rootNode.containerOpen = true;
- do_check_eq(rootNode.childCount, 1);
- do_check_eq(rootNode.getChild(0).itemId, b1);
- rootNode.containerOpen = false;
-
- // case insensitive tag
- query.searchTerms = "baboon";
- result = histsvc.executeQuery(query, options);
- rootNode = result.root;
- rootNode.containerOpen = true;
- do_check_eq(rootNode.childCount, 1);
- do_check_eq(rootNode.getChild(0).itemId, b1);
- rootNode.containerOpen = false;
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_395593.js b/toolkit/components/places/tests/bookmarks/test_395593.js
deleted file mode 100644
index 46d8f5b80..000000000
--- a/toolkit/components/places/tests/bookmarks/test_395593.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-
-var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-
-function check_queries_results(aQueries, aOptions, aExpectedItemIds) {
- var result = hs.executeQueries(aQueries, aQueries.length, aOptions);
- var root = result.root;
- root.containerOpen = true;
-
- // Dump found nodes.
- for (let i = 0; i < root.childCount; i++) {
- dump("nodes[" + i + "]: " + root.getChild(0).title + "\n");
- }
-
- do_check_eq(root.childCount, aExpectedItemIds.length);
- for (let i = 0; i < root.childCount; i++) {
- do_check_eq(root.getChild(i).itemId, aExpectedItemIds[i]);
- }
-
- root.containerOpen = false;
-}
-
-// main
-function run_test() {
- var id1 = bs.insertBookmark(bs.bookmarksMenuFolder, uri("http://foo.tld"),
- bs.DEFAULT_INDEX, "123 0");
- var id2 = bs.insertBookmark(bs.bookmarksMenuFolder, uri("http://foo.tld"),
- bs.DEFAULT_INDEX, "456");
- var id3 = bs.insertBookmark(bs.bookmarksMenuFolder, uri("http://foo.tld"),
- bs.DEFAULT_INDEX, "123 456");
- var id4 = bs.insertBookmark(bs.bookmarksMenuFolder, uri("http://foo.tld"),
- bs.DEFAULT_INDEX, "789 456");
-
- /**
- * All of the query objects are ORed together. Within a query, all the terms
- * are ANDed together. See nsINavHistory.idl.
- */
- var queries = [];
- queries.push(hs.getNewQuery());
- queries.push(hs.getNewQuery());
- var options = hs.getNewQueryOptions();
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
-
- // Test 1
- dump("Test searching for 123 OR 789\n");
- queries[0].searchTerms = "123";
- queries[1].searchTerms = "789";
- check_queries_results(queries, options, [id1, id3, id4]);
-
- // Test 2
- dump("Test searching for 123 OR 456\n");
- queries[0].searchTerms = "123";
- queries[1].searchTerms = "456";
- check_queries_results(queries, options, [id1, id2, id3, id4]);
-
- // Test 3
- dump("Test searching for 00 OR 789\n");
- queries[0].searchTerms = "00";
- queries[1].searchTerms = "789";
- check_queries_results(queries, options, [id4]);
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js b/toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js
deleted file mode 100644
index e317cc2e9..000000000
--- a/toolkit/components/places/tests/bookmarks/test_405938_restore_queries.js
+++ /dev/null
@@ -1,221 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var tests = [];
-
-/*
-
-Backup/restore tests example:
-
-var myTest = {
- populate: function () { ... add bookmarks ... },
- validate: function () { ... query for your bookmarks ... }
-}
-
-this.push(myTest);
-
-*/
-
-/*
-
-test summary:
-- create folders with content
-- create a query bookmark for those folders
-- backs up bookmarks
-- restores bookmarks
-- confirms that the query has the new ids for the same folders
-
-scenarios:
-- 1 folder (folder shortcut)
-- n folders (single query)
-- n folders (multiple queries)
-
-*/
-
-const DEFAULT_INDEX = PlacesUtils.bookmarks.DEFAULT_INDEX;
-
-var test = {
- _testRootId: null,
- _testRootTitle: "test root",
- _folderIds: [],
- _bookmarkURIs: [],
- _count: 3,
-
- populate: function populate() {
- // folder to hold this test
- PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.toolbarFolderId);
- this._testRootId =
- PlacesUtils.bookmarks.createFolder(PlacesUtils.toolbarFolderId,
- this._testRootTitle, DEFAULT_INDEX);
-
- // create test folders each with a bookmark
- for (var i = 0; i < this._count; i++) {
- var folderId =
- PlacesUtils.bookmarks.createFolder(this._testRootId, "folder" + i, DEFAULT_INDEX);
- this._folderIds.push(folderId)
-
- var bookmarkURI = uri("http://" + i);
- PlacesUtils.bookmarks.insertBookmark(folderId, bookmarkURI,
- DEFAULT_INDEX, "bookmark" + i);
- this._bookmarkURIs.push(bookmarkURI);
- }
-
- // create a query URI with 1 folder (ie: folder shortcut)
- this._queryURI1 = uri("place:folder=" + this._folderIds[0] + "&queryType=1");
- this._queryTitle1 = "query1";
- PlacesUtils.bookmarks.insertBookmark(this._testRootId, this._queryURI1,
- DEFAULT_INDEX, this._queryTitle1);
-
- // create a query URI with _count folders
- this._queryURI2 = uri("place:folder=" + this._folderIds.join("&folder=") + "&queryType=1");
- this._queryTitle2 = "query2";
- PlacesUtils.bookmarks.insertBookmark(this._testRootId, this._queryURI2,
- DEFAULT_INDEX, this._queryTitle2);
-
- // create a query URI with _count queries (each with a folder)
- // first get a query object for each folder
- var queries = this._folderIds.map(function(aFolderId) {
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([aFolderId], 1);
- return query;
- });
- var options = PlacesUtils.history.getNewQueryOptions();
- options.queryType = options.QUERY_TYPE_BOOKMARKS;
- this._queryURI3 =
- uri(PlacesUtils.history.queriesToQueryString(queries, queries.length, options));
- this._queryTitle3 = "query3";
- PlacesUtils.bookmarks.insertBookmark(this._testRootId, this._queryURI3,
- DEFAULT_INDEX, this._queryTitle3);
- },
-
- clean: function () {},
-
- validate: function validate() {
- // Throw a wrench in the works by inserting some new bookmarks,
- // ensuring folder ids won't be the same, when restoring.
- for (let i = 0; i < 10; i++) {
- PlacesUtils.bookmarks.
- insertBookmark(PlacesUtils.bookmarksMenuFolderId, uri("http://aaaa"+i), DEFAULT_INDEX, "");
- }
-
- var toolbar =
- PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId,
- false, true).root;
- do_check_true(toolbar.childCount, 1);
-
- var folderNode = toolbar.getChild(0);
- do_check_eq(folderNode.type, folderNode.RESULT_TYPE_FOLDER);
- do_check_eq(folderNode.title, this._testRootTitle);
- folderNode.QueryInterface(Ci.nsINavHistoryQueryResultNode);
- folderNode.containerOpen = true;
-
- // |_count| folders + the query node
- do_check_eq(folderNode.childCount, this._count+3);
-
- for (let i = 0; i < this._count; i++) {
- var subFolder = folderNode.getChild(i);
- do_check_eq(subFolder.title, "folder"+i);
- subFolder.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- subFolder.containerOpen = true;
- do_check_eq(subFolder.childCount, 1);
- var child = subFolder.getChild(0);
- do_check_eq(child.title, "bookmark"+i);
- do_check_true(uri(child.uri).equals(uri("http://" + i)))
- }
-
- // validate folder shortcut
- this.validateQueryNode1(folderNode.getChild(this._count));
-
- // validate folders query
- this.validateQueryNode2(folderNode.getChild(this._count + 1));
-
- // validate multiple queries query
- this.validateQueryNode3(folderNode.getChild(this._count + 2));
-
- // clean up
- folderNode.containerOpen = false;
- toolbar.containerOpen = false;
- },
-
- validateQueryNode1: function validateQueryNode1(aNode) {
- do_check_eq(aNode.title, this._queryTitle1);
- do_check_true(PlacesUtils.nodeIsFolder(aNode));
-
- aNode.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- aNode.containerOpen = true;
- do_check_eq(aNode.childCount, 1);
- var child = aNode.getChild(0);
- do_check_true(uri(child.uri).equals(uri("http://0")))
- do_check_eq(child.title, "bookmark0")
- aNode.containerOpen = false;
- },
-
- validateQueryNode2: function validateQueryNode2(aNode) {
- do_check_eq(aNode.title, this._queryTitle2);
- do_check_true(PlacesUtils.nodeIsQuery(aNode));
-
- aNode.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- aNode.containerOpen = true;
- do_check_eq(aNode.childCount, this._count);
- for (var i = 0; i < aNode.childCount; i++) {
- var child = aNode.getChild(i);
- do_check_true(uri(child.uri).equals(uri("http://" + i)))
- do_check_eq(child.title, "bookmark" + i)
- }
- aNode.containerOpen = false;
- },
-
- validateQueryNode3: function validateQueryNode3(aNode) {
- do_check_eq(aNode.title, this._queryTitle3);
- do_check_true(PlacesUtils.nodeIsQuery(aNode));
-
- aNode.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- aNode.containerOpen = true;
- do_check_eq(aNode.childCount, this._count);
- for (var i = 0; i < aNode.childCount; i++) {
- var child = aNode.getChild(i);
- do_check_true(uri(child.uri).equals(uri("http://" + i)))
- do_check_eq(child.title, "bookmark" + i)
- }
- aNode.containerOpen = false;
- }
-}
-tests.push(test);
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* () {
- // make json file
- let jsonFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.json");
-
- // populate db
- tests.forEach(function(aTest) {
- aTest.populate();
- // sanity
- aTest.validate();
- });
-
- // export json to file
- yield BookmarkJSONUtils.exportToFile(jsonFile);
-
- // clean
- tests.forEach(function(aTest) {
- aTest.clean();
- });
-
- // restore json file
- yield BookmarkJSONUtils.importFromFile(jsonFile, true);
-
- // validate
- tests.forEach(function(aTest) {
- aTest.validate();
- });
-
- // clean up
- yield OS.File.remove(jsonFile);
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js b/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js
deleted file mode 100644
index 858496856..000000000
--- a/toolkit/components/places/tests/bookmarks/test_417228-exclude-from-backup.js
+++ /dev/null
@@ -1,141 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const EXCLUDE_FROM_BACKUP_ANNO = "places/excludeFromBackup";
-// Menu, Toolbar, Unsorted, Tags, Mobile
-const PLACES_ROOTS_COUNT = 5;
-var tests = [];
-
-/*
-
-Backup/restore tests example:
-
-var myTest = {
- populate: function () { ... add bookmarks ... },
- validate: function () { ... query for your bookmarks ... }
-}
-
-this.push(myTest);
-
-*/
-
-var test = {
- populate: function populate() {
- // check initial size
- var rootNode = PlacesUtils.getFolderContents(PlacesUtils.placesRootId,
- false, false).root;
- do_check_eq(rootNode.childCount, PLACES_ROOTS_COUNT );
- rootNode.containerOpen = false;
-
- var idx = PlacesUtils.bookmarks.DEFAULT_INDEX;
-
- // create a root to be restore
- this._restoreRootTitle = "restore root";
- var restoreRootId = PlacesUtils.bookmarks
- .createFolder(PlacesUtils.placesRootId,
- this._restoreRootTitle, idx);
- // add a test bookmark
- this._restoreRootURI = uri("http://restore.uri");
- PlacesUtils.bookmarks.insertBookmark(restoreRootId, this._restoreRootURI,
- idx, "restore uri");
- // add a test bookmark to be exclude
- this._restoreRootExcludeURI = uri("http://exclude.uri");
- var exItemId = PlacesUtils.bookmarks
- .insertBookmark(restoreRootId,
- this._restoreRootExcludeURI,
- idx, "exclude uri");
- // Annotate the bookmark for exclusion.
- PlacesUtils.annotations.setItemAnnotation(exItemId,
- EXCLUDE_FROM_BACKUP_ANNO, 1, 0,
- PlacesUtils.annotations.EXPIRE_NEVER);
-
- // create a root to be exclude
- this._excludeRootTitle = "exclude root";
- this._excludeRootId = PlacesUtils.bookmarks
- .createFolder(PlacesUtils.placesRootId,
- this._excludeRootTitle, idx);
- // Annotate the root for exclusion.
- PlacesUtils.annotations.setItemAnnotation(this._excludeRootId,
- EXCLUDE_FROM_BACKUP_ANNO, 1, 0,
- PlacesUtils.annotations.EXPIRE_NEVER);
- // add a test bookmark exclude by exclusion of its parent
- PlacesUtils.bookmarks.insertBookmark(this._excludeRootId,
- this._restoreRootExcludeURI,
- idx, "exclude uri");
- },
-
- validate: function validate(aEmptyBookmarks) {
- var rootNode = PlacesUtils.getFolderContents(PlacesUtils.placesRootId,
- false, false).root;
-
- if (!aEmptyBookmarks) {
- // since restore does not remove backup exclude items both
- // roots should still exist.
- do_check_eq(rootNode.childCount, PLACES_ROOTS_COUNT + 2);
- // open exclude root and check it still contains one item
- var restoreRootIndex = PLACES_ROOTS_COUNT;
- var excludeRootIndex = PLACES_ROOTS_COUNT+1;
- var excludeRootNode = rootNode.getChild(excludeRootIndex);
- do_check_eq(this._excludeRootTitle, excludeRootNode.title);
- excludeRootNode.QueryInterface(Ci.nsINavHistoryQueryResultNode);
- excludeRootNode.containerOpen = true;
- do_check_eq(excludeRootNode.childCount, 1);
- var excludeRootChildNode = excludeRootNode.getChild(0);
- do_check_eq(excludeRootChildNode.uri, this._restoreRootExcludeURI.spec);
- excludeRootNode.containerOpen = false;
- }
- else {
- // exclude root should not exist anymore
- do_check_eq(rootNode.childCount, PLACES_ROOTS_COUNT + 1);
- restoreRootIndex = PLACES_ROOTS_COUNT;
- }
-
- var restoreRootNode = rootNode.getChild(restoreRootIndex);
- do_check_eq(this._restoreRootTitle, restoreRootNode.title);
- restoreRootNode.QueryInterface(Ci.nsINavHistoryQueryResultNode);
- restoreRootNode.containerOpen = true;
- do_check_eq(restoreRootNode.childCount, 1);
- var restoreRootChildNode = restoreRootNode.getChild(0);
- do_check_eq(restoreRootChildNode.uri, this._restoreRootURI.spec);
- restoreRootNode.containerOpen = false;
-
- rootNode.containerOpen = false;
- }
-}
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function*() {
- // make json file
- let jsonFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.json");
-
- // populate db
- test.populate();
-
- yield BookmarkJSONUtils.exportToFile(jsonFile);
-
- // restore json file
- yield BookmarkJSONUtils.importFromFile(jsonFile, true);
-
- // validate without removing all bookmarks
- // restore do not remove backup exclude entries
- test.validate(false);
-
- // cleanup
- yield PlacesUtils.bookmarks.eraseEverything();
- // manually remove the excluded root
- PlacesUtils.bookmarks.removeItem(test._excludeRootId);
- // restore json file
- yield BookmarkJSONUtils.importFromFile(jsonFile, true);
-
- // validate after a complete bookmarks cleanup
- test.validate(true);
-
- // clean up
- yield OS.File.remove(jsonFile);
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_417228-other-roots.js b/toolkit/components/places/tests/bookmarks/test_417228-other-roots.js
deleted file mode 100644
index 1def75d2d..000000000
--- a/toolkit/components/places/tests/bookmarks/test_417228-other-roots.js
+++ /dev/null
@@ -1,158 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var tests = [];
-
-/*
-
-Backup/restore tests example:
-
-var myTest = {
- populate: function () { ... add bookmarks ... },
- validate: function () { ... query for your bookmarks ... }
-}
-
-this.push(myTest);
-
-*/
-
-tests.push({
- excludeItemsFromRestore: [],
- populate: function populate() {
- // check initial size
- var rootNode = PlacesUtils.getFolderContents(PlacesUtils.placesRootId,
- false, false).root;
- do_check_eq(rootNode.childCount, 5);
-
- // create a test root
- this._folderTitle = "test folder";
- this._folderId =
- PlacesUtils.bookmarks.createFolder(PlacesUtils.placesRootId,
- this._folderTitle,
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- do_check_eq(rootNode.childCount, 6);
-
- // add a tag
- this._testURI = PlacesUtils._uri("http://test");
- this._tags = ["a", "b"];
- PlacesUtils.tagging.tagURI(this._testURI, this._tags);
-
- // add a child to each root, including our test root
- this._roots = [PlacesUtils.bookmarksMenuFolderId, PlacesUtils.toolbarFolderId,
- PlacesUtils.unfiledBookmarksFolderId, PlacesUtils.mobileFolderId,
- this._folderId];
- this._roots.forEach(function(aRootId) {
- // clean slate
- PlacesUtils.bookmarks.removeFolderChildren(aRootId);
- // add a test bookmark
- PlacesUtils.bookmarks.insertBookmark(aRootId, this._testURI,
- PlacesUtils.bookmarks.DEFAULT_INDEX, "test");
- }, this);
-
- // add a folder to exclude from replacing during restore
- // this will still be present post-restore
- var excludedFolderId =
- PlacesUtils.bookmarks.createFolder(PlacesUtils.placesRootId,
- "excluded",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- do_check_eq(rootNode.childCount, 7);
- this.excludeItemsFromRestore.push(excludedFolderId);
-
- // add a test bookmark to it
- PlacesUtils.bookmarks.insertBookmark(excludedFolderId, this._testURI,
- PlacesUtils.bookmarks.DEFAULT_INDEX, "test");
- },
-
- inbetween: function inbetween() {
- // add some items that should be removed by the restore
-
- // add a folder
- this._litterTitle = "otter";
- PlacesUtils.bookmarks.createFolder(PlacesUtils.placesRootId,
- this._litterTitle, 0);
-
- // add some tags
- PlacesUtils.tagging.tagURI(this._testURI, ["c", "d"]);
- },
-
- validate: function validate() {
- // validate tags restored
- var tags = PlacesUtils.tagging.getTagsForURI(this._testURI);
- // also validates that litter tags are gone
- do_check_eq(this._tags.toString(), tags.toString());
-
- var rootNode = PlacesUtils.getFolderContents(PlacesUtils.placesRootId,
- false, false).root;
-
- // validate litter is gone
- do_check_neq(rootNode.getChild(0).title, this._litterTitle);
-
- // test root count is the same
- do_check_eq(rootNode.childCount, 7);
-
- var foundTestFolder = 0;
- for (var i = 0; i < rootNode.childCount; i++) {
- var node = rootNode.getChild(i);
-
- do_print("validating " + node.title);
- if (node.itemId != PlacesUtils.tagsFolderId) {
- if (node.title == this._folderTitle) {
- // check the test folder's properties
- do_check_eq(node.type, node.RESULT_TYPE_FOLDER);
- do_check_eq(node.title, this._folderTitle);
- foundTestFolder++;
- }
-
- // test contents
- node.QueryInterface(Ci.nsINavHistoryContainerResultNode).containerOpen = true;
- do_check_eq(node.childCount, 1);
- var child = node.getChild(0);
- do_check_true(PlacesUtils._uri(child.uri).equals(this._testURI));
-
- // clean up
- node.containerOpen = false;
- }
- }
- do_check_eq(foundTestFolder, 1);
- rootNode.containerOpen = false;
- }
-});
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* () {
- // make json file
- let jsonFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.json");
-
- // populate db
- tests.forEach(function(aTest) {
- aTest.populate();
- // sanity
- aTest.validate();
-
- if (aTest.excludedItemsFromRestore)
- excludedItemsFromRestore = excludedItems.concat(aTest.excludedItemsFromRestore);
- });
-
- yield BookmarkJSONUtils.exportToFile(jsonFile);
-
- tests.forEach(function(aTest) {
- aTest.inbetween();
- });
-
- // restore json file
- yield BookmarkJSONUtils.importFromFile(jsonFile, true);
-
- // validate
- tests.forEach(function(aTest) {
- aTest.validate();
- });
-
- // clean up
- yield OS.File.remove(jsonFile);
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js b/toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js
deleted file mode 100644
index 7da1146cf..000000000
--- a/toolkit/components/places/tests/bookmarks/test_424958-json-quoted-folders.js
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var tests = [];
-
-/*
-
-Backup/restore tests example:
-
-var myTest = {
- populate: function () { ... add bookmarks ... },
- validate: function () { ... query for your bookmarks ... }
-}
-
-this.push(myTest);
-
-*/
-
-var quotesTest = {
- _folderTitle: '"quoted folder"',
- _folderId: null,
-
- populate: function () {
- this._folderId =
- PlacesUtils.bookmarks.createFolder(PlacesUtils.toolbarFolderId,
- this._folderTitle,
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- },
-
- clean: function () {
- PlacesUtils.bookmarks.removeItem(this._folderId);
- },
-
- validate: function () {
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1);
- var result = PlacesUtils.history.executeQuery(query, PlacesUtils.history.getNewQueryOptions());
-
- var toolbar = result.root;
- toolbar.containerOpen = true;
-
- // test for our quoted folder
- do_check_true(toolbar.childCount, 1);
- var folderNode = toolbar.getChild(0);
- do_check_eq(folderNode.type, folderNode.RESULT_TYPE_FOLDER);
- do_check_eq(folderNode.title, this._folderTitle);
-
- // clean up
- toolbar.containerOpen = false;
- }
-}
-tests.push(quotesTest);
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* () {
- // make json file
- let jsonFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.json");
-
- // populate db
- tests.forEach(function(aTest) {
- aTest.populate();
- // sanity
- aTest.validate();
- });
-
- // export json to file
- yield BookmarkJSONUtils.exportToFile(jsonFile);
-
- // clean
- tests.forEach(function(aTest) {
- aTest.clean();
- });
-
- // restore json file
- yield BookmarkJSONUtils.importFromFile(jsonFile, true);
-
- // validate
- tests.forEach(function(aTest) {
- aTest.validate();
- });
-
- // clean up
- yield OS.File.remove(jsonFile);
-
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_448584.js b/toolkit/components/places/tests/bookmarks/test_448584.js
deleted file mode 100644
index 6e58bd83a..000000000
--- a/toolkit/components/places/tests/bookmarks/test_448584.js
+++ /dev/null
@@ -1,113 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var tests = [];
-
-// Get database connection
-try {
- var mDBConn = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
- .DBConnection;
-}
-catch (ex) {
- do_throw("Could not get database connection\n");
-}
-
-/*
- This test is:
- - don't try to add invalid uri nodes to a JSON backup
-*/
-
-var invalidURITest = {
- _itemTitle: "invalid uri",
- _itemUrl: "http://test.mozilla.org/",
- _itemId: null,
-
- populate: function () {
- // add a valid bookmark
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.toolbarFolderId,
- PlacesUtils._uri(this._itemUrl),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- this._itemTitle);
- // this bookmark will go corrupt
- this._itemId =
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.toolbarFolderId,
- PlacesUtils._uri(this._itemUrl),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- this._itemTitle);
- },
-
- clean: function () {
- PlacesUtils.bookmarks.removeItem(this._itemId);
- },
-
- validate: function (aExpectValidItemsCount) {
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1);
- var options = PlacesUtils.history.getNewQueryOptions();
- var result = PlacesUtils.history.executeQuery(query, options);
-
- var toolbar = result.root;
- toolbar.containerOpen = true;
-
- // test for our bookmark
- do_check_eq(toolbar.childCount, aExpectValidItemsCount);
- for (var i = 0; i < toolbar.childCount; i++) {
- var folderNode = toolbar.getChild(0);
- do_check_eq(folderNode.type, folderNode.RESULT_TYPE_URI);
- do_check_eq(folderNode.title, this._itemTitle);
- }
-
- // clean up
- toolbar.containerOpen = false;
- }
-}
-tests.push(invalidURITest);
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function*() {
- // make json file
- let jsonFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.json");
-
- // populate db
- tests.forEach(function(aTest) {
- aTest.populate();
- // sanity
- aTest.validate(2);
- // Something in the code went wrong and we finish up losing the place, so
- // the bookmark uri becomes null.
- var sql = "UPDATE moz_bookmarks SET fk = 1337 WHERE id = ?1";
- var stmt = mDBConn.createStatement(sql);
- stmt.bindByIndex(0, aTest._itemId);
- try {
- stmt.execute();
- } finally {
- stmt.finalize();
- }
- });
-
- yield BookmarkJSONUtils.exportToFile(jsonFile);
-
- // clean
- tests.forEach(function(aTest) {
- aTest.clean();
- });
-
- // restore json file
- try {
- yield BookmarkJSONUtils.importFromFile(jsonFile, true);
- } catch (ex) { do_throw("couldn't import the exported file: " + ex); }
-
- // validate
- tests.forEach(function(aTest) {
- aTest.validate(1);
- });
-
- // clean up
- yield OS.File.remove(jsonFile);
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_458683.js b/toolkit/components/places/tests/bookmarks/test_458683.js
deleted file mode 100644
index c3722aab5..000000000
--- a/toolkit/components/places/tests/bookmarks/test_458683.js
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var tests = [];
-
-// Get database connection
-try {
- var mDBConn = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
- .DBConnection;
-}
-catch (ex) {
- do_throw("Could not get database connection\n");
-}
-
-/*
- This test is:
- - don't block while doing backup and restore if tag containers contain
- bogus items (separators, folders)
-*/
-
-var invalidTagChildTest = {
- _itemTitle: "invalid uri",
- _itemUrl: "http://test.mozilla.org/",
- _itemId: -1,
- _tag: "testTag",
- _tagItemId: -1,
-
- populate: function () {
- // add a valid bookmark
- this._itemId = PlacesUtils.bookmarks
- .insertBookmark(PlacesUtils.toolbarFolderId,
- PlacesUtils._uri(this._itemUrl),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- this._itemTitle);
-
- // create a tag
- PlacesUtils.tagging.tagURI(PlacesUtils._uri(this._itemUrl), [this._tag]);
- // get tag folder id
- var options = PlacesUtils.history.getNewQueryOptions();
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.tagsFolder], 1);
- var result = PlacesUtils.history.executeQuery(query, options);
- var tagRoot = result.root;
- tagRoot.containerOpen = true;
- do_check_eq(tagRoot.childCount, 1);
- var tagNode = tagRoot.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- this._tagItemId = tagNode.itemId;
- tagRoot.containerOpen = false;
-
- // add a separator and a folder inside tag folder
- PlacesUtils.bookmarks.insertSeparator(this._tagItemId,
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- PlacesUtils.bookmarks.createFolder(this._tagItemId,
- "test folder",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
-
- // add a separator and a folder inside tag root
- PlacesUtils.bookmarks.insertSeparator(PlacesUtils.bookmarks.tagsFolder,
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- PlacesUtils.bookmarks.createFolder(PlacesUtils.bookmarks.tagsFolder,
- "test tags root folder",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- },
-
- clean: function () {
- PlacesUtils.tagging.untagURI(PlacesUtils._uri(this._itemUrl), [this._tag]);
- PlacesUtils.bookmarks.removeItem(this._itemId);
- },
-
- validate: function () {
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1);
- var options = PlacesUtils.history.getNewQueryOptions();
- var result = PlacesUtils.history.executeQuery(query, options);
-
- var toolbar = result.root;
- toolbar.containerOpen = true;
-
- // test for our bookmark
- do_check_eq(toolbar.childCount, 1);
- for (var i = 0; i < toolbar.childCount; i++) {
- var folderNode = toolbar.getChild(0);
- do_check_eq(folderNode.type, folderNode.RESULT_TYPE_URI);
- do_check_eq(folderNode.title, this._itemTitle);
- }
- toolbar.containerOpen = false;
-
- // test for our tag
- var tags = PlacesUtils.tagging.getTagsForURI(PlacesUtils._uri(this._itemUrl));
- do_check_eq(tags.length, 1);
- do_check_eq(tags[0], this._tag);
- }
-}
-tests.push(invalidTagChildTest);
-
-function run_test() {
- run_next_test()
-}
-
-add_task(function* () {
- let jsonFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.json");
-
- // populate db
- tests.forEach(function(aTest) {
- aTest.populate();
- // sanity
- aTest.validate();
- });
-
- yield BookmarkJSONUtils.exportToFile(jsonFile);
-
- // clean
- tests.forEach(function(aTest) {
- aTest.clean();
- });
-
- // restore json file
- yield BookmarkJSONUtils.importFromFile(jsonFile, true);
-
- // validate
- tests.forEach(function(aTest) {
- aTest.validate();
- });
-
- // clean up
- yield OS.File.remove(jsonFile);
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_466303-json-remove-backups.js b/toolkit/components/places/tests/bookmarks/test_466303-json-remove-backups.js
deleted file mode 100644
index 3ce0e6ad7..000000000
--- a/toolkit/components/places/tests/bookmarks/test_466303-json-remove-backups.js
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Since PlacesBackups.getbackupFiles() is a lazy getter, these tests must
-// run in the given order, to avoid making it out-of-sync.
-
-add_task(function* check_max_backups_is_respected() {
- // Get bookmarkBackups directory
- let backupFolder = yield PlacesBackups.getBackupFolder();
-
- // Create 2 json dummy backups in the past.
- let oldJsonPath = OS.Path.join(backupFolder, "bookmarks-2008-01-01.json");
- let oldJsonFile = yield OS.File.open(oldJsonPath, { truncate: true });
- oldJsonFile.close();
- do_check_true(yield OS.File.exists(oldJsonPath));
-
- let jsonPath = OS.Path.join(backupFolder, "bookmarks-2008-01-31.json");
- let jsonFile = yield OS.File.open(jsonPath, { truncate: true });
- jsonFile.close();
- do_check_true(yield OS.File.exists(jsonPath));
-
- // Export bookmarks to JSON.
- // Allow 2 backups, the older one should be removed.
- yield PlacesBackups.create(2);
-
- let count = 0;
- let lastBackupPath = null;
- let iterator = new OS.File.DirectoryIterator(backupFolder);
- try {
- yield iterator.forEach(aEntry => {
- count++;
- if (PlacesBackups.filenamesRegex.test(aEntry.name))
- lastBackupPath = aEntry.path;
- });
- } finally {
- iterator.close();
- }
-
- do_check_eq(count, 2);
- do_check_neq(lastBackupPath, null);
- do_check_false(yield OS.File.exists(oldJsonPath));
- do_check_true(yield OS.File.exists(jsonPath));
-});
-
-add_task(function* check_max_backups_greater_than_backups() {
- // Get bookmarkBackups directory
- let backupFolder = yield PlacesBackups.getBackupFolder();
-
- // Export bookmarks to JSON.
- // Allow 3 backups, none should be removed.
- yield PlacesBackups.create(3);
-
- let count = 0;
- let lastBackupPath = null;
- let iterator = new OS.File.DirectoryIterator(backupFolder);
- try {
- yield iterator.forEach(aEntry => {
- count++;
- if (PlacesBackups.filenamesRegex.test(aEntry.name))
- lastBackupPath = aEntry.path;
- });
- } finally {
- iterator.close();
- }
- do_check_eq(count, 2);
- do_check_neq(lastBackupPath, null);
-});
-
-add_task(function* check_max_backups_null() {
- // Get bookmarkBackups directory
- let backupFolder = yield PlacesBackups.getBackupFolder();
-
- // Export bookmarks to JSON.
- // Allow infinite backups, none should be removed, a new one is not created
- // since one for today already exists.
- yield PlacesBackups.create(null);
-
- let count = 0;
- let lastBackupPath = null;
- let iterator = new OS.File.DirectoryIterator(backupFolder);
- try {
- yield iterator.forEach(aEntry => {
- count++;
- if (PlacesBackups.filenamesRegex.test(aEntry.name))
- lastBackupPath = aEntry.path;
- });
- } finally {
- iterator.close();
- }
- do_check_eq(count, 2);
- do_check_neq(lastBackupPath, null);
-});
-
-add_task(function* check_max_backups_undefined() {
- // Get bookmarkBackups directory
- let backupFolder = yield PlacesBackups.getBackupFolder();
-
- // Export bookmarks to JSON.
- // Allow infinite backups, none should be removed, a new one is not created
- // since one for today already exists.
- yield PlacesBackups.create();
-
- let count = 0;
- let lastBackupPath = null;
- let iterator = new OS.File.DirectoryIterator(backupFolder);
- try {
- yield iterator.forEach(aEntry => {
- count++;
- if (PlacesBackups.filenamesRegex.test(aEntry.name))
- lastBackupPath = aEntry.path;
- });
- } finally {
- iterator.close();
- }
- do_check_eq(count, 2);
- do_check_neq(lastBackupPath, null);
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_477583_json-backup-in-future.js b/toolkit/components/places/tests/bookmarks/test_477583_json-backup-in-future.js
deleted file mode 100644
index 116352666..000000000
--- a/toolkit/components/places/tests/bookmarks/test_477583_json-backup-in-future.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- do_test_pending();
-
- Task.spawn(function*() {
- let backupFolder = yield PlacesBackups.getBackupFolder();
- let bookmarksBackupDir = new FileUtils.File(backupFolder);
- // Remove all files from backups folder.
- let files = bookmarksBackupDir.directoryEntries;
- while (files.hasMoreElements()) {
- let entry = files.getNext().QueryInterface(Ci.nsIFile);
- entry.remove(false);
- }
-
- // Create a json dummy backup in the future.
- let dateObj = new Date();
- dateObj.setYear(dateObj.getFullYear() + 1);
- let name = PlacesBackups.getFilenameForDate(dateObj);
- do_check_eq(name, "bookmarks-" + PlacesBackups.toISODateString(dateObj) + ".json");
- files = bookmarksBackupDir.directoryEntries;
- while (files.hasMoreElements()) {
- let entry = files.getNext().QueryInterface(Ci.nsIFile);
- if (PlacesBackups.filenamesRegex.test(entry.leafName))
- entry.remove(false);
- }
-
- let futureBackupFile = bookmarksBackupDir.clone();
- futureBackupFile.append(name);
- futureBackupFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, 0o600);
- do_check_true(futureBackupFile.exists());
-
- do_check_eq((yield PlacesBackups.getBackupFiles()).length, 0);
-
- yield PlacesBackups.create();
- // Check that a backup for today has been created.
- do_check_eq((yield PlacesBackups.getBackupFiles()).length, 1);
- let mostRecentBackupFile = yield PlacesBackups.getMostRecentBackup();
- do_check_neq(mostRecentBackupFile, null);
- do_check_true(PlacesBackups.filenamesRegex.test(OS.Path.basename(mostRecentBackupFile)));
-
- // Check that future backup has been removed.
- do_check_false(futureBackupFile.exists());
-
- // Cleanup.
- mostRecentBackupFile = new FileUtils.File(mostRecentBackupFile);
- mostRecentBackupFile.remove(false);
- do_check_false(mostRecentBackupFile.exists());
-
- do_test_finished()
- });
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_675416.js b/toolkit/components/places/tests/bookmarks/test_675416.js
deleted file mode 100644
index 08b1c3620..000000000
--- a/toolkit/components/places/tests/bookmarks/test_675416.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function run_test() {
- /**
- * Requests information to the service, so that bookmark's data is cached.
- * @param aItemId
- * Id of the bookmark to be cached.
- */
- function forceBookmarkCaching(aItemId) {
- PlacesUtils.bookmarks.getFolderIdForItem(aItemId);
- }
-
- let observer = {
- onBeginUpdateBatch: () => forceBookmarkCaching(itemId1),
- onEndUpdateBatch: () => forceBookmarkCaching(itemId1),
- onItemAdded: forceBookmarkCaching,
- onItemChanged: forceBookmarkCaching,
- onItemMoved: forceBookmarkCaching,
- onItemRemoved: function(id) {
- try {
- forceBookmarkCaching(id);
- do_throw("trying to fetch a removed bookmark should throw");
- } catch (ex) {}
- },
- onItemVisited: forceBookmarkCaching,
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver])
- };
- PlacesUtils.bookmarks.addObserver(observer, false);
-
- let folderId1 = PlacesUtils.bookmarks
- .createFolder(PlacesUtils.bookmarksMenuFolderId,
- "Bookmarks",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- let itemId1 = PlacesUtils.bookmarks
- .insertBookmark(folderId1,
- NetUtil.newURI("http:/www.wired.com/wiredscience"),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "Wired Science");
-
- PlacesUtils.bookmarks.removeItem(folderId1);
-
- let folderId2 = PlacesUtils.bookmarks
- .createFolder(PlacesUtils.bookmarksMenuFolderId,
- "Science",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- let folderId3 = PlacesUtils.bookmarks
- .createFolder(folderId2,
- "Blogs",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- // Check title is correctly reported.
- do_check_eq(PlacesUtils.bookmarks.getItemTitle(folderId3), "Blogs");
- do_check_eq(PlacesUtils.bookmarks.getItemTitle(folderId2), "Science");
-
- PlacesUtils.bookmarks.removeObserver(observer, false);
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_711914.js b/toolkit/components/places/tests/bookmarks/test_711914.js
deleted file mode 100644
index 3712c8a77..000000000
--- a/toolkit/components/places/tests/bookmarks/test_711914.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- /**
- * Requests information to the service, so that bookmark's data is cached.
- * @param aItemId
- * Id of the bookmark to be cached.
- */
- function forceBookmarkCaching(aItemId) {
- let parent = PlacesUtils.bookmarks.getFolderIdForItem(aItemId);
- PlacesUtils.bookmarks.getFolderIdForItem(parent);
- }
-
- let observer = {
- onBeginUpdateBatch: () => forceBookmarkCaching(itemId1),
- onEndUpdateBatch: () => forceBookmarkCaching(itemId1),
- onItemAdded: forceBookmarkCaching,
- onItemChanged: forceBookmarkCaching,
- onItemMoved: forceBookmarkCaching,
- onItemRemoved: function (id) {
- try {
- forceBookmarkCaching(id);
- do_throw("trying to fetch a removed bookmark should throw");
- } catch (ex) {}
- },
- onItemVisited: forceBookmarkCaching,
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver])
- };
- PlacesUtils.bookmarks.addObserver(observer, false);
-
- let folder1 = PlacesUtils.bookmarks
- .createFolder(PlacesUtils.bookmarksMenuFolderId,
- "Folder1",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- let folder2 = PlacesUtils.bookmarks
- .createFolder(folder1,
- "Folder2",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- PlacesUtils.bookmarks.insertBookmark(folder2,
- NetUtil.newURI("http://mozilla.org/"),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "Mozilla");
-
- PlacesUtils.bookmarks.removeFolderChildren(folder1);
-
- // Check title is correctly reported.
- do_check_eq(PlacesUtils.bookmarks.getItemTitle(folder1), "Folder1");
- try {
- PlacesUtils.bookmarks.getItemTitle(folder2);
- do_throw("trying to fetch a removed bookmark should throw");
- } catch (ex) {}
-
- PlacesUtils.bookmarks.removeObserver(observer, false);
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js b/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js
deleted file mode 100644
index c88323478..000000000
--- a/toolkit/components/places/tests/bookmarks/test_818584-discard-duplicate-backups.js
+++ /dev/null
@@ -1,59 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Checks that automatically created bookmark backups are discarded if they are
- * duplicate of an existing ones.
- */
-function run_test() {
- run_next_test();
-}
-
-add_task(function*() {
- // Create a backup for yesterday in the backups folder.
- let backupFolder = yield PlacesBackups.getBackupFolder();
- let dateObj = new Date();
- dateObj.setDate(dateObj.getDate() - 1);
- let oldBackupName = PlacesBackups.getFilenameForDate(dateObj);
- let oldBackup = OS.Path.join(backupFolder, oldBackupName);
- let {count: count, hash: hash} = yield BookmarkJSONUtils.exportToFile(oldBackup);
- do_check_true(count > 0);
- do_check_eq(hash.length, 24);
- oldBackupName = oldBackupName.replace(/\.json/, "_" + count + "_" + hash + ".json");
- yield OS.File.move(oldBackup, OS.Path.join(backupFolder, oldBackupName));
-
- // Create a backup.
- // This should just rename the existing backup, so in the end there should be
- // only one backup with today's date.
- yield PlacesBackups.create();
-
- // Get the hash of the generated backup
- let backupFiles = yield PlacesBackups.getBackupFiles();
- do_check_eq(backupFiles.length, 1);
-
- let matches = OS.Path.basename(backupFiles[0]).match(PlacesBackups.filenamesRegex);
- do_check_eq(matches[1], PlacesBackups.toISODateString(new Date()));
- do_check_eq(matches[2], count);
- do_check_eq(matches[3], hash);
-
- // Add a bookmark and create another backup.
- let bookmarkId = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.bookmarks.bookmarksMenuFolder,
- uri("http://foo.com"),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "foo");
- // We must enforce a backup since one for today already exists. The forced
- // backup will replace the existing one.
- yield PlacesBackups.create(undefined, true);
- do_check_eq(backupFiles.length, 1);
- recentBackup = yield PlacesBackups.getMostRecentBackup();
- do_check_neq(recentBackup, OS.Path.join(backupFolder, oldBackupName));
- matches = OS.Path.basename(recentBackup).match(PlacesBackups.filenamesRegex);
- do_check_eq(matches[1], PlacesBackups.toISODateString(new Date()));
- do_check_eq(matches[2], count + 1);
- do_check_neq(matches[3], hash);
-
- // Clean up
- PlacesUtils.bookmarks.removeItem(bookmarkId);
- yield PlacesBackups.create(0);
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_818587_compress-bookmarks-backups.js b/toolkit/components/places/tests/bookmarks/test_818587_compress-bookmarks-backups.js
deleted file mode 100644
index 2c84990b3..000000000
--- a/toolkit/components/places/tests/bookmarks/test_818587_compress-bookmarks-backups.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* compress_bookmark_backups_test() {
- // Check for jsonlz4 extension
- let todayFilename = PlacesBackups.getFilenameForDate(new Date(2014, 4, 15), true);
- do_check_eq(todayFilename, "bookmarks-2014-05-15.jsonlz4");
-
- yield PlacesBackups.create();
-
- // Check that a backup for today has been created and the regex works fine for lz4.
- do_check_eq((yield PlacesBackups.getBackupFiles()).length, 1);
- let mostRecentBackupFile = yield PlacesBackups.getMostRecentBackup();
- do_check_neq(mostRecentBackupFile, null);
- do_check_true(PlacesBackups.filenamesRegex.test(OS.Path.basename(mostRecentBackupFile)));
-
- // The most recent backup file has to be removed since saveBookmarksToJSONFile
- // will otherwise over-write the current backup, since it will be made on the
- // same date
- yield OS.File.remove(mostRecentBackupFile);
- do_check_false((yield OS.File.exists(mostRecentBackupFile)));
-
- // Check that, if the user created a custom backup out of the default
- // backups folder, it gets copied (compressed) into it.
- let jsonFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.json");
- yield PlacesBackups.saveBookmarksToJSONFile(jsonFile);
- do_check_eq((yield PlacesBackups.getBackupFiles()).length, 1);
-
- // Check if import works from lz4 compressed json
- let uri = NetUtil.newURI("http://www.mozilla.org/en-US/");
- let bm = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- uri,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark");
-
- // Force create a compressed backup, Remove the bookmark, the restore the backup
- yield PlacesBackups.create(undefined, true);
- let recentBackup = yield PlacesBackups.getMostRecentBackup();
- PlacesUtils.bookmarks.removeItem(bm);
- yield BookmarkJSONUtils.importFromFile(recentBackup, true);
- let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
- let node = root.getChild(0);
- do_check_eq(node.uri, uri.spec);
-
- root.containerOpen = false;
- PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId);
-
- // Cleanup.
- yield OS.File.remove(jsonFile);
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js b/toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js
deleted file mode 100644
index 4ea07fb39..000000000
--- a/toolkit/components/places/tests/bookmarks/test_818593-store-backup-metadata.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * To confirm that metadata i.e. bookmark count is set and retrieved for
- * automatic backups.
- */
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_saveBookmarksToJSONFile_and_create()
-{
- // Add a bookmark
- let uri = NetUtil.newURI("http://getfirefox.com/");
- let bookmarkId =
- PlacesUtils.bookmarks.insertBookmark(
- PlacesUtils.unfiledBookmarksFolderId, uri,
- PlacesUtils.bookmarks.DEFAULT_INDEX, "Get Firefox!");
-
- // Test saveBookmarksToJSONFile()
- let backupFile = FileUtils.getFile("TmpD", ["bookmarks.json"]);
- backupFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, parseInt("0600", 8));
-
- let nodeCount = yield PlacesBackups.saveBookmarksToJSONFile(backupFile, true);
- do_check_true(nodeCount > 0);
- do_check_true(backupFile.exists());
- do_check_eq(backupFile.leafName, "bookmarks.json");
-
- // Ensure the backup would be copied to our backups folder when the original
- // backup is saved somewhere else.
- let recentBackup = yield PlacesBackups.getMostRecentBackup();
- let matches = OS.Path.basename(recentBackup).match(PlacesBackups.filenamesRegex);
- do_check_eq(matches[2], nodeCount);
- do_check_eq(matches[3].length, 24);
-
- // Clear all backups in our backups folder.
- yield PlacesBackups.create(0);
- do_check_eq((yield PlacesBackups.getBackupFiles()).length, 0);
-
- // Test create() which saves bookmarks with metadata on the filename.
- yield PlacesBackups.create();
- do_check_eq((yield PlacesBackups.getBackupFiles()).length, 1);
-
- mostRecentBackupFile = yield PlacesBackups.getMostRecentBackup();
- do_check_neq(mostRecentBackupFile, null);
- matches = OS.Path.basename(recentBackup).match(PlacesBackups.filenamesRegex);
- do_check_eq(matches[2], nodeCount);
- do_check_eq(matches[3].length, 24);
-
- // Cleanup
- backupFile.remove(false);
- yield PlacesBackups.create(0);
- PlacesUtils.bookmarks.removeItem(bookmarkId);
-});
-
diff --git a/toolkit/components/places/tests/bookmarks/test_992901-backup-unsorted-hierarchy.js b/toolkit/components/places/tests/bookmarks/test_992901-backup-unsorted-hierarchy.js
deleted file mode 100644
index f5e9f8187..000000000
--- a/toolkit/components/places/tests/bookmarks/test_992901-backup-unsorted-hierarchy.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Checks that backups properly include all of the bookmarks if the hierarchy
- * in the database is unordered so that a hierarchy is defined before its
- * ancestor in the bookmarks table.
- */
-function run_test() {
- run_next_test();
-}
-
-add_task(function*() {
- let bm = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- NetUtil.newURI("http://mozilla.org/"),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark");
- let f2 = PlacesUtils.bookmarks.createFolder(PlacesUtils.unfiledBookmarksFolderId, "f2",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- PlacesUtils.bookmarks.moveItem(bm, f2, PlacesUtils.bookmarks.DEFAULT_INDEX);
- let f1 = PlacesUtils.bookmarks.createFolder(PlacesUtils.unfiledBookmarksFolderId, "f1",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- PlacesUtils.bookmarks.moveItem(f2, f1, PlacesUtils.bookmarks.DEFAULT_INDEX);
-
- // Create a backup.
- yield PlacesBackups.create();
-
- // Remove the bookmarks, then restore the backup.
- PlacesUtils.bookmarks.removeItem(f1);
- yield BookmarkJSONUtils.importFromFile((yield PlacesBackups.getMostRecentBackup()), true);
-
- do_print("Checking first level");
- let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
- let level1 = root.getChild(0);
- do_check_eq(level1.title, "f1");
- do_print("Checking second level");
- PlacesUtils.asContainer(level1).containerOpen = true
- let level2 = level1.getChild(0);
- do_check_eq(level2.title, "f2");
- do_print("Checking bookmark");
- PlacesUtils.asContainer(level2).containerOpen = true
- let bookmark = level2.getChild(0);
- do_check_eq(bookmark.title, "bookmark");
- level2.containerOpen = false;
- level1.containerOpen = false;
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js b/toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js
deleted file mode 100644
index b900887b5..000000000
--- a/toolkit/components/places/tests/bookmarks/test_997030-bookmarks-html-encode.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Checks that we don't encodeURI twice when creating bookmarks.html.
- */
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* () {
- let uri = NetUtil.newURI("http://bt.ktxp.com/search.php?keyword=%E5%A6%84%E6%83%B3%E5%AD%A6%E7%94%9F%E4%BC%9A");
- let bm = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- uri,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark");
-
- let file = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.exported.997030.html");
- if ((yield OS.File.exists(file))) {
- yield OS.File.remove(file);
- }
- yield BookmarkHTMLUtils.exportToFile(file);
-
- // Remove the bookmarks, then restore the backup.
- PlacesUtils.bookmarks.removeItem(bm);
- yield BookmarkHTMLUtils.importFromFile(file, true);
-
- do_print("Checking first level");
- let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
- let node = root.getChild(0);
- do_check_eq(node.uri, uri.spec);
-
- root.containerOpen = false;
- PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId);
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_async_observers.js b/toolkit/components/places/tests/bookmarks/test_async_observers.js
deleted file mode 100644
index 86d48ac24..000000000
--- a/toolkit/components/places/tests/bookmarks/test_async_observers.js
+++ /dev/null
@@ -1,177 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/* This test checks that bookmarks service is correctly forwarding async
- * events like visit or favicon additions. */
-
-const NOW = Date.now() * 1000;
-
-var observer = {
- bookmarks: [],
- observedBookmarks: 0,
- observedVisitId: 0,
- deferred: null,
-
- /**
- * Returns a promise that is resolved when the observer determines that the
- * test can continue. This is required rather than calling run_next_test
- * directly in the observer because there are cases where we must wait for
- * other asynchronous events to be completed in addition to this.
- */
- setupCompletionPromise: function ()
- {
- this.observedBookmarks = 0;
- this.deferred = Promise.defer();
- return this.deferred.promise;
- },
-
- onBeginUpdateBatch: function () {},
- onEndUpdateBatch: function () {},
- onItemAdded: function () {},
- onItemRemoved: function () {},
- onItemMoved: function () {},
- onItemChanged: function(aItemId, aProperty, aIsAnnotation, aNewValue,
- aLastModified, aItemType)
- {
- do_print("Check that we got the correct change information.");
- do_check_neq(this.bookmarks.indexOf(aItemId), -1);
- if (aProperty == "favicon") {
- do_check_false(aIsAnnotation);
- do_check_eq(aNewValue, SMALLPNG_DATA_URI.spec);
- do_check_eq(aLastModified, 0);
- do_check_eq(aItemType, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- }
- else if (aProperty == "cleartime") {
- do_check_false(aIsAnnotation);
- do_check_eq(aNewValue, "");
- do_check_eq(aLastModified, 0);
- do_check_eq(aItemType, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- }
- else {
- do_throw("Unexpected property change " + aProperty);
- }
-
- if (++this.observedBookmarks == this.bookmarks.length) {
- this.deferred.resolve();
- }
- },
- onItemVisited: function(aItemId, aVisitId, aTime)
- {
- do_print("Check that we got the correct visit information.");
- do_check_neq(this.bookmarks.indexOf(aItemId), -1);
- this.observedVisitId = aVisitId;
- do_check_eq(aTime, NOW);
- if (++this.observedBookmarks == this.bookmarks.length) {
- this.deferred.resolve();
- }
- },
-
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsINavBookmarkObserver,
- ])
-};
-PlacesUtils.bookmarks.addObserver(observer, false);
-
-add_task(function* test_add_visit()
-{
- let observerPromise = observer.setupCompletionPromise();
-
- // Add a visit to the bookmark and wait for the observer.
- let visitId;
- let deferUpdatePlaces = Promise.defer();
- PlacesUtils.asyncHistory.updatePlaces({
- uri: NetUtil.newURI("http://book.ma.rk/"),
- visits: [{ transitionType: TRANSITION_TYPED, visitDate: NOW }]
- }, {
- handleError: function TAV_handleError() {
- deferUpdatePlaces.reject(new Error("Unexpected error in adding visit."));
- },
- handleResult: function (aPlaceInfo) {
- visitId = aPlaceInfo.visits[0].visitId;
- },
- handleCompletion: function TAV_handleCompletion() {
- deferUpdatePlaces.resolve();
- }
- });
-
- // Wait for both the observer and the asynchronous update, in any order.
- yield deferUpdatePlaces.promise;
- yield observerPromise;
-
- // Check that both asynchronous results are consistent.
- do_check_eq(observer.observedVisitId, visitId);
-});
-
-add_task(function* test_add_icon()
-{
- let observerPromise = observer.setupCompletionPromise();
- PlacesUtils.favicons.setAndFetchFaviconForPage(NetUtil.newURI("http://book.ma.rk/"),
- SMALLPNG_DATA_URI, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- null,
- Services.scriptSecurityManager.getSystemPrincipal());
- yield observerPromise;
-});
-
-add_task(function* test_remove_page()
-{
- let observerPromise = observer.setupCompletionPromise();
- PlacesUtils.history.removePage(NetUtil.newURI("http://book.ma.rk/"));
- yield observerPromise;
-});
-
-add_task(function cleanup()
-{
- PlacesUtils.bookmarks.removeObserver(observer, false);
-});
-
-add_task(function* shutdown()
-{
- // Check that async observers don't try to create async statements after
- // shutdown. That would cause assertions, since the async thread is gone
- // already. Note that in such a case the notifications are not fired, so we
- // cannot test for them.
- // Put an history notification that triggers AsyncGetBookmarksForURI between
- // asyncClose() and the actual connection closing. Enqueuing a main-thread
- // event just after places-will-close-connection should ensure it runs before
- // places-connection-closed.
- // Notice this code is not using helpers cause it depends on a very specific
- // order, a change in the helpers code could make this test useless.
- let deferred = Promise.defer();
-
- Services.obs.addObserver(function onNotification() {
- Services.obs.removeObserver(onNotification, "places-will-close-connection");
- do_check_true(true, "Observed fake places shutdown");
-
- Services.tm.mainThread.dispatch(() => {
- // WARNING: this is very bad, never use out of testing code.
- PlacesUtils.bookmarks.QueryInterface(Ci.nsINavHistoryObserver)
- .onPageChanged(NetUtil.newURI("http://book.ma.rk/"),
- Ci.nsINavHistoryObserver.ATTRIBUTE_FAVICON,
- "test", "test");
- deferred.resolve(promiseTopicObserved("places-connection-closed"));
- }, Ci.nsIThread.DISPATCH_NORMAL);
- }, "places-will-close-connection", false);
- shutdownPlaces();
-
- yield deferred.promise;
-});
-
-function run_test()
-{
- // Add multiple bookmarks to the same uri.
- observer.bookmarks.push(
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- NetUtil.newURI("http://book.ma.rk/"),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "Bookmark")
- );
- observer.bookmarks.push(
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.toolbarFolderId,
- NetUtil.newURI("http://book.ma.rk/"),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "Bookmark")
- );
-
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_bmindex.js b/toolkit/components/places/tests/bookmarks/test_bmindex.js
deleted file mode 100644
index c764e4310..000000000
--- a/toolkit/components/places/tests/bookmarks/test_bmindex.js
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const NUM_BOOKMARKS = 20;
-const NUM_SEPARATORS = 5;
-const NUM_FOLDERS = 10;
-const NUM_ITEMS = NUM_BOOKMARKS + NUM_SEPARATORS + NUM_FOLDERS;
-const MIN_RAND = -5;
-const MAX_RAND = 40;
-
-var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-
-function check_contiguous_indexes(aBookmarks) {
- var indexes = [];
- aBookmarks.forEach(function(aBookmarkId) {
- let bmIndex = bs.getItemIndex(aBookmarkId);
- dump("Index: " + bmIndex + "\n");
- dump("Checking duplicates\n");
- do_check_eq(indexes.indexOf(bmIndex), -1);
- dump("Checking out of range, found " + aBookmarks.length + " items\n");
- do_check_true(bmIndex >= 0 && bmIndex < aBookmarks.length);
- indexes.push(bmIndex);
- });
- dump("Checking all valid indexes have been used\n");
- do_check_eq(indexes.length, aBookmarks.length);
-}
-
-// main
-function run_test() {
- var bookmarks = [];
- // Insert bookmarks with random indexes.
- for (let i = 0; bookmarks.length < NUM_BOOKMARKS; i++) {
- let randIndex = Math.round(MIN_RAND + (Math.random() * (MAX_RAND - MIN_RAND)));
- try {
- let id = bs.insertBookmark(bs.unfiledBookmarksFolder,
- uri("http://" + i + ".mozilla.org/"),
- randIndex, "Test bookmark " + i);
- if (randIndex < -1)
- do_throw("Creating a bookmark at an invalid index should throw");
- bookmarks.push(id);
- }
- catch (ex) {
- if (randIndex >= -1)
- do_throw("Creating a bookmark at a valid index should not throw");
- }
- }
- check_contiguous_indexes(bookmarks);
-
- // Insert separators with random indexes.
- for (let i = 0; bookmarks.length < NUM_BOOKMARKS + NUM_SEPARATORS; i++) {
- let randIndex = Math.round(MIN_RAND + (Math.random() * (MAX_RAND - MIN_RAND)));
- try {
- let id = bs.insertSeparator(bs.unfiledBookmarksFolder, randIndex);
- if (randIndex < -1)
- do_throw("Creating a separator at an invalid index should throw");
- bookmarks.push(id);
- }
- catch (ex) {
- if (randIndex >= -1)
- do_throw("Creating a separator at a valid index should not throw");
- }
- }
- check_contiguous_indexes(bookmarks);
-
- // Insert folders with random indexes.
- for (let i = 0; bookmarks.length < NUM_ITEMS; i++) {
- let randIndex = Math.round(MIN_RAND + (Math.random() * (MAX_RAND - MIN_RAND)));
- try {
- let id = bs.createFolder(bs.unfiledBookmarksFolder,
- "Test folder " + i, randIndex);
- if (randIndex < -1)
- do_throw("Creating a folder at an invalid index should throw");
- bookmarks.push(id);
- }
- catch (ex) {
- if (randIndex >= -1)
- do_throw("Creating a folder at a valid index should not throw");
- }
- }
- check_contiguous_indexes(bookmarks);
-
- // Execute some random bookmark delete.
- for (let i = 0; i < Math.ceil(NUM_ITEMS / 4); i++) {
- let id = bookmarks.splice(Math.floor(Math.random() * bookmarks.length), 1);
- dump("Removing item with id " + id + "\n");
- bs.removeItem(id);
- }
- check_contiguous_indexes(bookmarks);
-
- // Execute some random bookmark move. This will also try to move it to
- // invalid index values.
- for (let i = 0; i < Math.ceil(NUM_ITEMS / 4); i++) {
- let randIndex = Math.floor(Math.random() * bookmarks.length);
- let id = bookmarks[randIndex];
- let newIndex = Math.round(MIN_RAND + (Math.random() * (MAX_RAND - MIN_RAND)));
- dump("Moving item with id " + id + " to index " + newIndex + "\n");
- try {
- bs.moveItem(id, bs.unfiledBookmarksFolder, newIndex);
- if (newIndex < -1)
- do_throw("Moving an item to a negative index should throw\n");
- }
- catch (ex) {
- if (newIndex >= -1)
- do_throw("Moving an item to a valid index should not throw\n");
- }
-
- }
- check_contiguous_indexes(bookmarks);
-
- // Ensure setItemIndex throws if we pass it a negative index.
- try {
- bs.setItemIndex(bookmarks[0], -1);
- do_throw("setItemIndex should throw for a negative index");
- } catch (ex) {}
- // Ensure setItemIndex throws if we pass it a bad itemId.
- try {
- bs.setItemIndex(0, 5);
- do_throw("setItemIndex should throw for a bad itemId");
- } catch (ex) {}
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks.js b/toolkit/components/places/tests/bookmarks/test_bookmarks.js
deleted file mode 100644
index b67482223..000000000
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks.js
+++ /dev/null
@@ -1,718 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var bs = PlacesUtils.bookmarks;
-var hs = PlacesUtils.history;
-var anno = PlacesUtils.annotations;
-
-
-var bookmarksObserver = {
- onBeginUpdateBatch: function() {
- this._beginUpdateBatch = true;
- },
- onEndUpdateBatch: function() {
- this._endUpdateBatch = true;
- },
- onItemAdded: function(id, folder, index, itemType, uri, title, dateAdded,
- guid) {
- this._itemAddedId = id;
- this._itemAddedParent = folder;
- this._itemAddedIndex = index;
- this._itemAddedURI = uri;
- this._itemAddedTitle = title;
-
- // Ensure that we've created a guid for this item.
- let stmt = DBConn().createStatement(
- `SELECT guid
- FROM moz_bookmarks
- WHERE id = :item_id`
- );
- stmt.params.item_id = id;
- do_check_true(stmt.executeStep());
- do_check_false(stmt.getIsNull(0));
- do_check_valid_places_guid(stmt.row.guid);
- do_check_eq(stmt.row.guid, guid);
- stmt.finalize();
- },
- onItemRemoved: function(id, folder, index, itemType) {
- this._itemRemovedId = id;
- this._itemRemovedFolder = folder;
- this._itemRemovedIndex = index;
- },
- onItemChanged: function(id, property, isAnnotationProperty, value,
- lastModified, itemType, parentId, guid, parentGuid,
- oldValue) {
- this._itemChangedId = id;
- this._itemChangedProperty = property;
- this._itemChanged_isAnnotationProperty = isAnnotationProperty;
- this._itemChangedValue = value;
- this._itemChangedOldValue = oldValue;
- },
- onItemVisited: function(id, visitID, time) {
- this._itemVisitedId = id;
- this._itemVisitedVistId = visitID;
- this._itemVisitedTime = time;
- },
- onItemMoved: function(id, oldParent, oldIndex, newParent, newIndex,
- itemType) {
- this._itemMovedId = id
- this._itemMovedOldParent = oldParent;
- this._itemMovedOldIndex = oldIndex;
- this._itemMovedNewParent = newParent;
- this._itemMovedNewIndex = newIndex;
- },
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsINavBookmarkObserver,
- ])
-};
-
-
-// Get bookmarks menu folder id.
-var root = bs.bookmarksMenuFolder;
-// Index at which items should begin.
-var bmStartIndex = 0;
-
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_bookmarks() {
- bs.addObserver(bookmarksObserver, false);
-
- // test special folders
- do_check_true(bs.placesRoot > 0);
- do_check_true(bs.bookmarksMenuFolder > 0);
- do_check_true(bs.tagsFolder > 0);
- do_check_true(bs.toolbarFolder > 0);
- do_check_true(bs.unfiledBookmarksFolder > 0);
-
- // test getFolderIdForItem() with bogus item id will throw
- try {
- bs.getFolderIdForItem(0);
- do_throw("getFolderIdForItem accepted bad input");
- } catch (ex) {}
-
- // test getFolderIdForItem() with bogus item id will throw
- try {
- bs.getFolderIdForItem(-1);
- do_throw("getFolderIdForItem accepted bad input");
- } catch (ex) {}
-
- // test root parentage
- do_check_eq(bs.getFolderIdForItem(bs.bookmarksMenuFolder), bs.placesRoot);
- do_check_eq(bs.getFolderIdForItem(bs.tagsFolder), bs.placesRoot);
- do_check_eq(bs.getFolderIdForItem(bs.toolbarFolder), bs.placesRoot);
- do_check_eq(bs.getFolderIdForItem(bs.unfiledBookmarksFolder), bs.placesRoot);
-
- // create a folder to hold all the tests
- // this makes the tests more tolerant of changes to default_places.html
- let testRoot = bs.createFolder(root, "places bookmarks xpcshell tests",
- bs.DEFAULT_INDEX);
- do_check_eq(bookmarksObserver._itemAddedId, testRoot);
- do_check_eq(bookmarksObserver._itemAddedParent, root);
- do_check_eq(bookmarksObserver._itemAddedIndex, bmStartIndex);
- do_check_eq(bookmarksObserver._itemAddedURI, null);
- let testStartIndex = 0;
-
- // test getItemIndex for folders
- do_check_eq(bs.getItemIndex(testRoot), bmStartIndex);
-
- // test getItemType for folders
- do_check_eq(bs.getItemType(testRoot), bs.TYPE_FOLDER);
-
- // insert a bookmark.
- // the time before we insert, in microseconds
- let beforeInsert = Date.now() * 1000;
- do_check_true(beforeInsert > 0);
-
- let newId = bs.insertBookmark(testRoot, uri("http://google.com/"),
- bs.DEFAULT_INDEX, "");
- do_check_eq(bookmarksObserver._itemAddedId, newId);
- do_check_eq(bookmarksObserver._itemAddedParent, testRoot);
- do_check_eq(bookmarksObserver._itemAddedIndex, testStartIndex);
- do_check_true(bookmarksObserver._itemAddedURI.equals(uri("http://google.com/")));
- do_check_eq(bs.getBookmarkURI(newId).spec, "http://google.com/");
-
- let dateAdded = bs.getItemDateAdded(newId);
- // dateAdded can equal beforeInsert
- do_check_true(is_time_ordered(beforeInsert, dateAdded));
-
- // after just inserting, modified should not be set
- let lastModified = bs.getItemLastModified(newId);
- do_check_eq(lastModified, dateAdded);
-
- // The time before we set the title, in microseconds.
- let beforeSetTitle = Date.now() * 1000;
- do_check_true(beforeSetTitle >= beforeInsert);
-
- // Workaround possible VM timers issues moving lastModified and dateAdded
- // to the past.
- lastModified -= 1000;
- bs.setItemLastModified(newId, lastModified);
- dateAdded -= 1000;
- bs.setItemDateAdded(newId, dateAdded);
-
- // set bookmark title
- bs.setItemTitle(newId, "Google");
- do_check_eq(bookmarksObserver._itemChangedId, newId);
- do_check_eq(bookmarksObserver._itemChangedProperty, "title");
- do_check_eq(bookmarksObserver._itemChangedValue, "Google");
-
- // check that dateAdded hasn't changed
- let dateAdded2 = bs.getItemDateAdded(newId);
- do_check_eq(dateAdded2, dateAdded);
-
- // check lastModified after we set the title
- let lastModified2 = bs.getItemLastModified(newId);
- do_print("test setItemTitle");
- do_print("dateAdded = " + dateAdded);
- do_print("beforeSetTitle = " + beforeSetTitle);
- do_print("lastModified = " + lastModified);
- do_print("lastModified2 = " + lastModified2);
- do_check_true(is_time_ordered(lastModified, lastModified2));
- do_check_true(is_time_ordered(dateAdded, lastModified2));
-
- // get item title
- let title = bs.getItemTitle(newId);
- do_check_eq(title, "Google");
-
- // test getItemType for bookmarks
- do_check_eq(bs.getItemType(newId), bs.TYPE_BOOKMARK);
-
- // get item title bad input
- try {
- bs.getItemTitle(-3);
- do_throw("getItemTitle accepted bad input");
- } catch (ex) {}
-
- // get the folder that the bookmark is in
- let folderId = bs.getFolderIdForItem(newId);
- do_check_eq(folderId, testRoot);
-
- // test getItemIndex for bookmarks
- do_check_eq(bs.getItemIndex(newId), testStartIndex);
-
- // create a folder at a specific index
- let workFolder = bs.createFolder(testRoot, "Work", 0);
- do_check_eq(bookmarksObserver._itemAddedId, workFolder);
- do_check_eq(bookmarksObserver._itemAddedParent, testRoot);
- do_check_eq(bookmarksObserver._itemAddedIndex, 0);
- do_check_eq(bookmarksObserver._itemAddedURI, null);
-
- do_check_eq(bs.getItemTitle(workFolder), "Work");
- bs.setItemTitle(workFolder, "Work #");
- do_check_eq(bs.getItemTitle(workFolder), "Work #");
-
- // add item into subfolder, specifying index
- let newId2 = bs.insertBookmark(workFolder,
- uri("http://developer.mozilla.org/"),
- 0, "");
- do_check_eq(bookmarksObserver._itemAddedId, newId2);
- do_check_eq(bookmarksObserver._itemAddedParent, workFolder);
- do_check_eq(bookmarksObserver._itemAddedIndex, 0);
-
- // change item
- bs.setItemTitle(newId2, "DevMo");
- do_check_eq(bookmarksObserver._itemChangedProperty, "title");
-
- // insert item into subfolder
- let newId3 = bs.insertBookmark(workFolder,
- uri("http://msdn.microsoft.com/"),
- bs.DEFAULT_INDEX, "");
- do_check_eq(bookmarksObserver._itemAddedId, newId3);
- do_check_eq(bookmarksObserver._itemAddedParent, workFolder);
- do_check_eq(bookmarksObserver._itemAddedIndex, 1);
-
- // change item
- bs.setItemTitle(newId3, "MSDN");
- do_check_eq(bookmarksObserver._itemChangedProperty, "title");
-
- // remove item
- bs.removeItem(newId2);
- do_check_eq(bookmarksObserver._itemRemovedId, newId2);
- do_check_eq(bookmarksObserver._itemRemovedFolder, workFolder);
- do_check_eq(bookmarksObserver._itemRemovedIndex, 0);
-
- // insert item into subfolder
- let newId4 = bs.insertBookmark(workFolder,
- uri("http://developer.mozilla.org/"),
- bs.DEFAULT_INDEX, "");
- do_check_eq(bookmarksObserver._itemAddedId, newId4);
- do_check_eq(bookmarksObserver._itemAddedParent, workFolder);
- do_check_eq(bookmarksObserver._itemAddedIndex, 1);
-
- // create folder
- let homeFolder = bs.createFolder(testRoot, "Home", bs.DEFAULT_INDEX);
- do_check_eq(bookmarksObserver._itemAddedId, homeFolder);
- do_check_eq(bookmarksObserver._itemAddedParent, testRoot);
- do_check_eq(bookmarksObserver._itemAddedIndex, 2);
-
- // insert item
- let newId5 = bs.insertBookmark(homeFolder, uri("http://espn.com/"),
- bs.DEFAULT_INDEX, "");
- do_check_eq(bookmarksObserver._itemAddedId, newId5);
- do_check_eq(bookmarksObserver._itemAddedParent, homeFolder);
- do_check_eq(bookmarksObserver._itemAddedIndex, 0);
-
- // change item
- bs.setItemTitle(newId5, "ESPN");
- do_check_eq(bookmarksObserver._itemChangedId, newId5);
- do_check_eq(bookmarksObserver._itemChangedProperty, "title");
-
- // insert query item
- let uri6 = uri("place:domain=google.com&type="+
- Ci.nsINavHistoryQueryOptions.RESULTS_AS_SITE_QUERY);
- let newId6 = bs.insertBookmark(testRoot, uri6, bs.DEFAULT_INDEX, "");
- do_check_eq(bookmarksObserver._itemAddedParent, testRoot);
- do_check_eq(bookmarksObserver._itemAddedIndex, 3);
-
- // change item
- bs.setItemTitle(newId6, "Google Sites");
- do_check_eq(bookmarksObserver._itemChangedProperty, "title");
-
- // test getIdForItemAt
- do_check_eq(bs.getIdForItemAt(testRoot, 0), workFolder);
- // wrong parent, should return -1
- do_check_eq(bs.getIdForItemAt(1337, 0), -1);
- // wrong index, should return -1
- do_check_eq(bs.getIdForItemAt(testRoot, 1337), -1);
- // wrong parent and index, should return -1
- do_check_eq(bs.getIdForItemAt(1337, 1337), -1);
-
- // move folder, appending, to different folder
- let oldParentCC = getChildCount(testRoot);
- bs.moveItem(workFolder, homeFolder, bs.DEFAULT_INDEX);
- do_check_eq(bookmarksObserver._itemMovedId, workFolder);
- do_check_eq(bookmarksObserver._itemMovedOldParent, testRoot);
- do_check_eq(bookmarksObserver._itemMovedOldIndex, 0);
- do_check_eq(bookmarksObserver._itemMovedNewParent, homeFolder);
- do_check_eq(bookmarksObserver._itemMovedNewIndex, 1);
-
- // test that the new index is properly stored
- do_check_eq(bs.getItemIndex(workFolder), 1);
- do_check_eq(bs.getFolderIdForItem(workFolder), homeFolder);
-
- // try to get index of the item from within the old parent folder
- // check that it has been really removed from there
- do_check_neq(bs.getIdForItemAt(testRoot, 0), workFolder);
- // check the last item from within the old parent folder
- do_check_neq(bs.getIdForItemAt(testRoot, -1), workFolder);
- // check the index of the item within the new parent folder
- do_check_eq(bs.getIdForItemAt(homeFolder, 1), workFolder);
- // try to get index of the last item within the new parent folder
- do_check_eq(bs.getIdForItemAt(homeFolder, -1), workFolder);
- // XXX expose FolderCount, and check that the old parent has one less child?
- do_check_eq(getChildCount(testRoot), oldParentCC-1);
-
- // move item, appending, to different folder
- bs.moveItem(newId5, testRoot, bs.DEFAULT_INDEX);
- do_check_eq(bookmarksObserver._itemMovedId, newId5);
- do_check_eq(bookmarksObserver._itemMovedOldParent, homeFolder);
- do_check_eq(bookmarksObserver._itemMovedOldIndex, 0);
- do_check_eq(bookmarksObserver._itemMovedNewParent, testRoot);
- do_check_eq(bookmarksObserver._itemMovedNewIndex, 3);
-
- // test get folder's index
- let tmpFolder = bs.createFolder(testRoot, "tmp", 2);
- do_check_eq(bs.getItemIndex(tmpFolder), 2);
-
- // test setKeywordForBookmark
- let kwTestItemId = bs.insertBookmark(testRoot, uri("http://keywordtest.com"),
- bs.DEFAULT_INDEX, "");
- bs.setKeywordForBookmark(kwTestItemId, "bar");
-
- // test getKeywordForBookmark
- let k = bs.getKeywordForBookmark(kwTestItemId);
- do_check_eq("bar", k);
-
- // test getURIForKeyword
- let u = bs.getURIForKeyword("bar");
- do_check_eq("http://keywordtest.com/", u.spec);
-
- // test removeFolderChildren
- // 1) add/remove each child type (bookmark, separator, folder)
- tmpFolder = bs.createFolder(testRoot, "removeFolderChildren",
- bs.DEFAULT_INDEX);
- bs.insertBookmark(tmpFolder, uri("http://foo9.com/"), bs.DEFAULT_INDEX, "");
- bs.createFolder(tmpFolder, "subfolder", bs.DEFAULT_INDEX);
- bs.insertSeparator(tmpFolder, bs.DEFAULT_INDEX);
- // 2) confirm that folder has 3 children
- let options = hs.getNewQueryOptions();
- let query = hs.getNewQuery();
- query.setFolders([tmpFolder], 1);
- try {
- let result = hs.executeQuery(query, options);
- let rootNode = result.root;
- rootNode.containerOpen = true;
- do_check_eq(rootNode.childCount, 3);
- rootNode.containerOpen = false;
- } catch (ex) {
- do_throw("test removeFolderChildren() - querying for children failed: " + ex);
- }
- // 3) remove all children
- bs.removeFolderChildren(tmpFolder);
- // 4) confirm that folder has 0 children
- try {
- result = hs.executeQuery(query, options);
- let rootNode = result.root;
- rootNode.containerOpen = true;
- do_check_eq(rootNode.childCount, 0);
- rootNode.containerOpen = false;
- } catch (ex) {
- do_throw("removeFolderChildren(): " + ex);
- }
-
- // XXX - test folderReadOnly
-
- // test bookmark id in query output
- try {
- options = hs.getNewQueryOptions();
- query = hs.getNewQuery();
- query.setFolders([testRoot], 1);
- let result = hs.executeQuery(query, options);
- let rootNode = result.root;
- rootNode.containerOpen = true;
- let cc = rootNode.childCount;
- do_print("bookmark itemId test: CC = " + cc);
- do_check_true(cc > 0);
- for (let i=0; i < cc; ++i) {
- let node = rootNode.getChild(i);
- if (node.type == node.RESULT_TYPE_FOLDER ||
- node.type == node.RESULT_TYPE_URI ||
- node.type == node.RESULT_TYPE_SEPARATOR ||
- node.type == node.RESULT_TYPE_QUERY) {
- do_check_true(node.itemId > 0);
- }
- else {
- do_check_eq(node.itemId, -1);
- }
- }
- rootNode.containerOpen = false;
- }
- catch (ex) {
- do_throw("bookmarks query: " + ex);
- }
-
- // test that multiple bookmarks with same URI show up right in bookmark
- // folder queries, todo: also to do for complex folder queries
- try {
- // test uri
- let mURI = uri("http://multiple.uris.in.query");
-
- let testFolder = bs.createFolder(testRoot, "test Folder", bs.DEFAULT_INDEX);
- // add 2 bookmarks
- bs.insertBookmark(testFolder, mURI, bs.DEFAULT_INDEX, "title 1");
- bs.insertBookmark(testFolder, mURI, bs.DEFAULT_INDEX, "title 2");
-
- // query
- options = hs.getNewQueryOptions();
- query = hs.getNewQuery();
- query.setFolders([testFolder], 1);
- let result = hs.executeQuery(query, options);
- let rootNode = result.root;
- rootNode.containerOpen = true;
- let cc = rootNode.childCount;
- do_check_eq(cc, 2);
- do_check_eq(rootNode.getChild(0).title, "title 1");
- do_check_eq(rootNode.getChild(1).title, "title 2");
- rootNode.containerOpen = false;
- }
- catch (ex) {
- do_throw("bookmarks query: " + ex);
- }
-
- // test change bookmark uri
- let newId10 = bs.insertBookmark(testRoot, uri("http://foo10.com/"),
- bs.DEFAULT_INDEX, "");
- dateAdded = bs.getItemDateAdded(newId10);
- // after just inserting, modified should not be set
- lastModified = bs.getItemLastModified(newId10);
- do_check_eq(lastModified, dateAdded);
-
- // Workaround possible VM timers issues moving lastModified and dateAdded
- // to the past.
- lastModified -= 1000;
- bs.setItemLastModified(newId10, lastModified);
- dateAdded -= 1000;
- bs.setItemDateAdded(newId10, dateAdded);
-
- bs.changeBookmarkURI(newId10, uri("http://foo11.com/"));
-
- // check that lastModified is set after we change the bookmark uri
- lastModified2 = bs.getItemLastModified(newId10);
- do_print("test changeBookmarkURI");
- do_print("dateAdded = " + dateAdded);
- do_print("lastModified = " + lastModified);
- do_print("lastModified2 = " + lastModified2);
- do_check_true(is_time_ordered(lastModified, lastModified2));
- do_check_true(is_time_ordered(dateAdded, lastModified2));
-
- do_check_eq(bookmarksObserver._itemChangedId, newId10);
- do_check_eq(bookmarksObserver._itemChangedProperty, "uri");
- do_check_eq(bookmarksObserver._itemChangedValue, "http://foo11.com/");
- do_check_eq(bookmarksObserver._itemChangedOldValue, "http://foo10.com/");
-
- // test getBookmarkURI
- let newId11 = bs.insertBookmark(testRoot, uri("http://foo11.com/"),
- bs.DEFAULT_INDEX, "");
- let bmURI = bs.getBookmarkURI(newId11);
- do_check_eq("http://foo11.com/", bmURI.spec);
-
- // test getBookmarkURI with non-bookmark items
- try {
- bs.getBookmarkURI(testRoot);
- do_throw("getBookmarkURI() should throw for non-bookmark items!");
- } catch (ex) {}
-
- // test getItemIndex
- let newId12 = bs.insertBookmark(testRoot, uri("http://foo11.com/"), 1, "");
- let bmIndex = bs.getItemIndex(newId12);
- do_check_eq(1, bmIndex);
-
- // insert a bookmark with title ZZZXXXYYY and then search for it.
- // this test confirms that we can find bookmarks that we haven't visited
- // (which are "hidden") and that we can find by title.
- // see bug #369887 for more details
- let newId13 = bs.insertBookmark(testRoot, uri("http://foobarcheese.com/"),
- bs.DEFAULT_INDEX, "");
- do_check_eq(bookmarksObserver._itemAddedId, newId13);
- do_check_eq(bookmarksObserver._itemAddedParent, testRoot);
- do_check_eq(bookmarksObserver._itemAddedIndex, 11);
-
- // set bookmark title
- bs.setItemTitle(newId13, "ZZZXXXYYY");
- do_check_eq(bookmarksObserver._itemChangedId, newId13);
- do_check_eq(bookmarksObserver._itemChangedProperty, "title");
- do_check_eq(bookmarksObserver._itemChangedValue, "ZZZXXXYYY");
-
- // check if setting an item annotation triggers onItemChanged
- bookmarksObserver._itemChangedId = -1;
- anno.setItemAnnotation(newId3, "test-annotation", "foo", 0, 0);
- do_check_eq(bookmarksObserver._itemChangedId, newId3);
- do_check_eq(bookmarksObserver._itemChangedProperty, "test-annotation");
- do_check_true(bookmarksObserver._itemChanged_isAnnotationProperty);
- do_check_eq(bookmarksObserver._itemChangedValue, "");
-
- // test search on bookmark title ZZZXXXYYY
- try {
- options = hs.getNewQueryOptions();
- options.excludeQueries = 1;
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
- query = hs.getNewQuery();
- query.searchTerms = "ZZZXXXYYY";
- let result = hs.executeQuery(query, options);
- let rootNode = result.root;
- rootNode.containerOpen = true;
- let cc = rootNode.childCount;
- do_check_eq(cc, 1);
- let node = rootNode.getChild(0);
- do_check_eq(node.title, "ZZZXXXYYY");
- do_check_true(node.itemId > 0);
- rootNode.containerOpen = false;
- }
- catch (ex) {
- do_throw("bookmarks query: " + ex);
- }
-
- // test dateAdded and lastModified properties
- // for a search query
- try {
- options = hs.getNewQueryOptions();
- options.excludeQueries = 1;
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
- query = hs.getNewQuery();
- query.searchTerms = "ZZZXXXYYY";
- let result = hs.executeQuery(query, options);
- let rootNode = result.root;
- rootNode.containerOpen = true;
- let cc = rootNode.childCount;
- do_check_eq(cc, 1);
- let node = rootNode.getChild(0);
-
- do_check_eq(typeof node.dateAdded, "number");
- do_check_true(node.dateAdded > 0);
-
- do_check_eq(typeof node.lastModified, "number");
- do_check_true(node.lastModified > 0);
-
- rootNode.containerOpen = false;
- }
- catch (ex) {
- do_throw("bookmarks query: " + ex);
- }
-
- // test dateAdded and lastModified properties
- // for a folder query
- try {
- options = hs.getNewQueryOptions();
- query = hs.getNewQuery();
- query.setFolders([testRoot], 1);
- let result = hs.executeQuery(query, options);
- let rootNode = result.root;
- rootNode.containerOpen = true;
- let cc = rootNode.childCount;
- do_check_true(cc > 0);
- for (let i = 0; i < cc; i++) {
- let node = rootNode.getChild(i);
-
- if (node.type == node.RESULT_TYPE_URI) {
- do_check_eq(typeof node.dateAdded, "number");
- do_check_true(node.dateAdded > 0);
-
- do_check_eq(typeof node.lastModified, "number");
- do_check_true(node.lastModified > 0);
- break;
- }
- }
- rootNode.containerOpen = false;
- }
- catch (ex) {
- do_throw("bookmarks query: " + ex);
- }
-
- // check setItemLastModified() and setItemDateAdded()
- let newId14 = bs.insertBookmark(testRoot, uri("http://bar.tld/"),
- bs.DEFAULT_INDEX, "");
- dateAdded = bs.getItemDateAdded(newId14);
- lastModified = bs.getItemLastModified(newId14);
- do_check_eq(lastModified, dateAdded);
- bs.setItemLastModified(newId14, 1234000000000000);
- let fakeLastModified = bs.getItemLastModified(newId14);
- do_check_eq(fakeLastModified, 1234000000000000);
- bs.setItemDateAdded(newId14, 4321000000000000);
- let fakeDateAdded = bs.getItemDateAdded(newId14);
- do_check_eq(fakeDateAdded, 4321000000000000);
-
- // ensure that removing an item removes its annotations
- do_check_true(anno.itemHasAnnotation(newId3, "test-annotation"));
- bs.removeItem(newId3);
- do_check_false(anno.itemHasAnnotation(newId3, "test-annotation"));
-
- // bug 378820
- let uri1 = uri("http://foo.tld/a");
- bs.insertBookmark(testRoot, uri1, bs.DEFAULT_INDEX, "");
- yield PlacesTestUtils.addVisits(uri1);
-
- // bug 646993 - test bookmark titles longer than the maximum allowed length
- let title15 = Array(TITLE_LENGTH_MAX + 5).join("X");
- let title15expected = title15.substring(0, TITLE_LENGTH_MAX);
- let newId15 = bs.insertBookmark(testRoot, uri("http://evil.com/"),
- bs.DEFAULT_INDEX, title15);
-
- do_check_eq(bs.getItemTitle(newId15).length,
- title15expected.length);
- do_check_eq(bookmarksObserver._itemAddedTitle, title15expected);
- // test title length after updates
- bs.setItemTitle(newId15, title15 + " updated");
- do_check_eq(bs.getItemTitle(newId15).length,
- title15expected.length);
- do_check_eq(bookmarksObserver._itemChangedId, newId15);
- do_check_eq(bookmarksObserver._itemChangedProperty, "title");
- do_check_eq(bookmarksObserver._itemChangedValue, title15expected);
-
- testSimpleFolderResult();
-});
-
-function testSimpleFolderResult() {
- // the time before we create a folder, in microseconds
- // Workaround possible VM timers issues subtracting 1us.
- let beforeCreate = Date.now() * 1000 - 1;
- do_check_true(beforeCreate > 0);
-
- // create a folder
- let parent = bs.createFolder(root, "test", bs.DEFAULT_INDEX);
-
- let dateCreated = bs.getItemDateAdded(parent);
- do_print("check that the folder was created with a valid dateAdded");
- do_print("beforeCreate = " + beforeCreate);
- do_print("dateCreated = " + dateCreated);
- do_check_true(is_time_ordered(beforeCreate, dateCreated));
-
- // the time before we insert, in microseconds
- // Workaround possible VM timers issues subtracting 1ms.
- let beforeInsert = Date.now() * 1000 - 1;
- do_check_true(beforeInsert > 0);
-
- // insert a separator
- let sep = bs.insertSeparator(parent, bs.DEFAULT_INDEX);
-
- let dateAdded = bs.getItemDateAdded(sep);
- do_print("check that the separator was created with a valid dateAdded");
- do_print("beforeInsert = " + beforeInsert);
- do_print("dateAdded = " + dateAdded);
- do_check_true(is_time_ordered(beforeInsert, dateAdded));
-
- // re-set item title separately so can test nodes' last modified
- let item = bs.insertBookmark(parent, uri("about:blank"),
- bs.DEFAULT_INDEX, "");
- bs.setItemTitle(item, "test bookmark");
-
- // see above
- let folder = bs.createFolder(parent, "test folder", bs.DEFAULT_INDEX);
- bs.setItemTitle(folder, "test folder");
-
- let longName = Array(TITLE_LENGTH_MAX + 5).join("A");
- let folderLongName = bs.createFolder(parent, longName, bs.DEFAULT_INDEX);
- do_check_eq(bookmarksObserver._itemAddedTitle, longName.substring(0, TITLE_LENGTH_MAX));
-
- let options = hs.getNewQueryOptions();
- let query = hs.getNewQuery();
- query.setFolders([parent], 1);
- let result = hs.executeQuery(query, options);
- let rootNode = result.root;
- rootNode.containerOpen = true;
- do_check_eq(rootNode.childCount, 4);
-
- let node = rootNode.getChild(0);
- do_check_true(node.dateAdded > 0);
- do_check_eq(node.lastModified, node.dateAdded);
- do_check_eq(node.itemId, sep);
- do_check_eq(node.title, "");
- node = rootNode.getChild(1);
- do_check_eq(node.itemId, item);
- do_check_true(node.dateAdded > 0);
- do_check_true(node.lastModified > 0);
- do_check_eq(node.title, "test bookmark");
- node = rootNode.getChild(2);
- do_check_eq(node.itemId, folder);
- do_check_eq(node.title, "test folder");
- do_check_true(node.dateAdded > 0);
- do_check_true(node.lastModified > 0);
- node = rootNode.getChild(3);
- do_check_eq(node.itemId, folderLongName);
- do_check_eq(node.title, longName.substring(0, TITLE_LENGTH_MAX));
- do_check_true(node.dateAdded > 0);
- do_check_true(node.lastModified > 0);
-
- // update with another long title
- bs.setItemTitle(folderLongName, longName + " updated");
- do_check_eq(bookmarksObserver._itemChangedId, folderLongName);
- do_check_eq(bookmarksObserver._itemChangedProperty, "title");
- do_check_eq(bookmarksObserver._itemChangedValue, longName.substring(0, TITLE_LENGTH_MAX));
-
- node = rootNode.getChild(3);
- do_check_eq(node.title, longName.substring(0, TITLE_LENGTH_MAX));
-
- rootNode.containerOpen = false;
-}
-
-function getChildCount(aFolderId) {
- let cc = -1;
- try {
- let options = hs.getNewQueryOptions();
- let query = hs.getNewQuery();
- query.setFolders([aFolderId], 1);
- let result = hs.executeQuery(query, options);
- let rootNode = result.root;
- rootNode.containerOpen = true;
- cc = rootNode.childCount;
- rootNode.containerOpen = false;
- } catch (ex) {
- do_throw("getChildCount failed: " + ex);
- }
- return cc;
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_eraseEverything.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_eraseEverything.js
deleted file mode 100644
index e8414359b..000000000
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks_eraseEverything.js
+++ /dev/null
@@ -1,116 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* test_eraseEverything() {
- yield PlacesTestUtils.addVisits({ uri: NetUtil.newURI("http://example.com/") });
- yield PlacesTestUtils.addVisits({ uri: NetUtil.newURI("http://mozilla.org/") });
- let frecencyForExample = frecencyForUrl("http://example.com/");
- let frecencyForMozilla = frecencyForUrl("http://example.com/");
- Assert.ok(frecencyForExample > 0);
- Assert.ok(frecencyForMozilla > 0);
- let unfiledFolder = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
- checkBookmarkObject(unfiledFolder);
- let unfiledBookmark = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/" });
- checkBookmarkObject(unfiledBookmark);
- let unfiledBookmarkInFolder =
- yield PlacesUtils.bookmarks.insert({ parentGuid: unfiledFolder.guid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://mozilla.org/" });
- checkBookmarkObject(unfiledBookmarkInFolder);
- PlacesUtils.annotations.setItemAnnotation((yield PlacesUtils.promiseItemId(unfiledBookmarkInFolder.guid)),
- "testanno1", "testvalue1", 0, 0);
-
- let menuFolder = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.menuGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
- checkBookmarkObject(menuFolder);
- let menuBookmark = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.menuGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/" });
- checkBookmarkObject(menuBookmark);
- let menuBookmarkInFolder =
- yield PlacesUtils.bookmarks.insert({ parentGuid: menuFolder.guid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://mozilla.org/" });
- checkBookmarkObject(menuBookmarkInFolder);
- PlacesUtils.annotations.setItemAnnotation((yield PlacesUtils.promiseItemId(menuBookmarkInFolder.guid)),
- "testanno1", "testvalue1", 0, 0);
-
- let toolbarFolder = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
- checkBookmarkObject(toolbarFolder);
- let toolbarBookmark = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/" });
- checkBookmarkObject(toolbarBookmark);
- let toolbarBookmarkInFolder =
- yield PlacesUtils.bookmarks.insert({ parentGuid: toolbarFolder.guid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://mozilla.org/" });
- checkBookmarkObject(toolbarBookmarkInFolder);
- PlacesUtils.annotations.setItemAnnotation((yield PlacesUtils.promiseItemId(toolbarBookmarkInFolder.guid)),
- "testanno1", "testvalue1", 0, 0);
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- Assert.ok(frecencyForUrl("http://example.com/") > frecencyForExample);
- Assert.ok(frecencyForUrl("http://example.com/") > frecencyForMozilla);
-
- yield PlacesUtils.bookmarks.eraseEverything();
-
- Assert.equal(frecencyForUrl("http://example.com/"), frecencyForExample);
- Assert.equal(frecencyForUrl("http://example.com/"), frecencyForMozilla);
-
- // Check there are no orphan annotations.
- let conn = yield PlacesUtils.promiseDBConnection();
- let annoAttrs = yield conn.execute(`SELECT id, name FROM moz_anno_attributes`);
- // Bug 1306445 will eventually remove the mobile root anno.
- Assert.equal(annoAttrs.length, 1);
- Assert.equal(annoAttrs[0].getResultByName("name"), PlacesUtils.MOBILE_ROOT_ANNO);
- let annos = rows = yield conn.execute(`SELECT item_id, anno_attribute_id FROM moz_items_annos`);
- Assert.equal(annos.length, 1);
- Assert.equal(annos[0].getResultByName("item_id"), PlacesUtils.mobileFolderId);
- Assert.equal(annos[0].getResultByName("anno_attribute_id"), annoAttrs[0].getResultByName("id"));
-});
-
-add_task(function* test_eraseEverything_roots() {
- yield PlacesUtils.bookmarks.eraseEverything();
-
- // Ensure the roots have not been removed.
- Assert.ok(yield PlacesUtils.bookmarks.fetch(PlacesUtils.bookmarks.unfiledGuid));
- Assert.ok(yield PlacesUtils.bookmarks.fetch(PlacesUtils.bookmarks.toolbarGuid));
- Assert.ok(yield PlacesUtils.bookmarks.fetch(PlacesUtils.bookmarks.menuGuid));
- Assert.ok(yield PlacesUtils.bookmarks.fetch(PlacesUtils.bookmarks.tagsGuid));
- Assert.ok(yield PlacesUtils.bookmarks.fetch(PlacesUtils.bookmarks.rootGuid));
-});
-
-add_task(function* test_eraseEverything_reparented() {
- // Create a folder with 1 bookmark in it...
- let folder1 = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER
- });
- let bookmark1 = yield PlacesUtils.bookmarks.insert({
- parentGuid: folder1.guid,
- url: "http://example.com/"
- });
- // ...and a second folder.
- let folder2 = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER
- });
-
- // Reparent the bookmark to the 2nd folder.
- bookmark1.parentGuid = folder2.guid;
- yield PlacesUtils.bookmarks.update(bookmark1);
-
- // Erase everything.
- yield PlacesUtils.bookmarks.eraseEverything();
-
- // All the above items should no longer be in the GUIDHelper cache.
- for (let guid of [folder1.guid, bookmark1.guid, folder2.guid]) {
- yield Assert.rejects(PlacesUtils.promiseItemId(guid),
- /no item found for the given GUID/);
- }
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_fetch.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_fetch.js
deleted file mode 100644
index 9527f02e6..000000000
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks_fetch.js
+++ /dev/null
@@ -1,310 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var gAccumulator = {
- get callback() {
- this.results = [];
- return result => this.results.push(result);
- }
-};
-
-add_task(function* invalid_input_throws() {
- Assert.throws(() => PlacesUtils.bookmarks.fetch(),
- /Input should be a valid object/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch(null),
- /Input should be a valid object/);
-
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ guid: "123456789012",
- parentGuid: "012345678901" }),
- /The following properties were expected: index/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ guid: "123456789012",
- index: 0 }),
- /The following properties were expected: parentGuid/);
-
- Assert.throws(() => PlacesUtils.bookmarks.fetch({}),
- /Unexpected number of conditions provided: 0/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ guid: "123456789012",
- parentGuid: "012345678901",
- index: 0 }),
- /Unexpected number of conditions provided: 2/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ guid: "123456789012",
- url: "http://example.com"}),
- /Unexpected number of conditions provided: 2/);
-
- Assert.throws(() => PlacesUtils.bookmarks.fetch("test"),
- /Invalid value for property 'guid'/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch(123),
- /Invalid value for property 'guid'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ guid: "test" }),
- /Invalid value for property 'guid'/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ guid: null }),
- /Invalid value for property 'guid'/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ guid: 123 }),
- /Invalid value for property 'guid'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ parentGuid: "test",
- index: 0 }),
- /Invalid value for property 'parentGuid'/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ parentGuid: null,
- index: 0 }),
- /Invalid value for property 'parentGuid'/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ parentGuid: 123,
- index: 0 }),
- /Invalid value for property 'parentGuid'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ parentGuid: "123456789012",
- index: "0" }),
- /Invalid value for property 'index'/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ parentGuid: "123456789012",
- index: null }),
- /Invalid value for property 'index'/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ parentGuid: "123456789012",
- index: -10 }),
- /Invalid value for property 'index'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ url: "http://te st/" }),
- /Invalid value for property 'url'/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ url: null }),
- /Invalid value for property 'url'/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch({ url: -10 }),
- /Invalid value for property 'url'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.fetch("123456789012", "test"),
- /onResult callback must be a valid function/);
- Assert.throws(() => PlacesUtils.bookmarks.fetch("123456789012", {}),
- /onResult callback must be a valid function/);
-});
-
-add_task(function* fetch_nonexistent_guid() {
- let bm = yield PlacesUtils.bookmarks.fetch({ guid: "123456789012" },
- gAccumulator.callback);
- Assert.equal(bm, null);
- Assert.equal(gAccumulator.results.length, 0);
-});
-
-add_task(function* fetch_bookmark() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/",
- title: "a bookmark" });
- checkBookmarkObject(bm1);
-
- let bm2 = yield PlacesUtils.bookmarks.fetch(bm1.guid,
- gAccumulator.callback);
- checkBookmarkObject(bm2);
- Assert.equal(gAccumulator.results.length, 1);
- checkBookmarkObject(gAccumulator.results[0]);
- Assert.deepEqual(gAccumulator.results[0], bm1);
-
- Assert.deepEqual(bm1, bm2);
- Assert.equal(bm2.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm2.index, 0);
- Assert.deepEqual(bm2.dateAdded, bm2.lastModified);
- Assert.equal(bm2.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- Assert.equal(bm2.url.href, "http://example.com/");
- Assert.equal(bm2.title, "a bookmark");
-
- yield PlacesUtils.bookmarks.remove(bm1.guid);
-});
-
-add_task(function* fetch_bookmar_empty_title() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/",
- title: "" });
- checkBookmarkObject(bm1);
-
- let bm2 = yield PlacesUtils.bookmarks.fetch(bm1.guid);
- checkBookmarkObject(bm2);
-
- Assert.deepEqual(bm1, bm2);
- Assert.equal(bm2.index, 0);
- Assert.ok(!("title" in bm2));
-
- yield PlacesUtils.bookmarks.remove(bm1.guid);
-});
-
-add_task(function* fetch_folder() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "a folder" });
- checkBookmarkObject(bm1);
-
- let bm2 = yield PlacesUtils.bookmarks.fetch(bm1.guid);
- checkBookmarkObject(bm2);
-
- Assert.deepEqual(bm1, bm2);
- Assert.equal(bm2.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm2.index, 0);
- Assert.deepEqual(bm2.dateAdded, bm2.lastModified);
- Assert.equal(bm2.type, PlacesUtils.bookmarks.TYPE_FOLDER);
- Assert.equal(bm2.title, "a folder");
- Assert.ok(!("url" in bm2));
-
- yield PlacesUtils.bookmarks.remove(bm1.guid);
-});
-
-add_task(function* fetch_folder_empty_title() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "" });
- checkBookmarkObject(bm1);
-
- let bm2 = yield PlacesUtils.bookmarks.fetch(bm1.guid);
- checkBookmarkObject(bm2);
-
- Assert.deepEqual(bm1, bm2);
- Assert.equal(bm2.index, 0);
- Assert.ok(!("title" in bm2));
-
- yield PlacesUtils.bookmarks.remove(bm1.guid);
-});
-
-add_task(function* fetch_separator() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR });
- checkBookmarkObject(bm1);
-
- let bm2 = yield PlacesUtils.bookmarks.fetch(bm1.guid);
- checkBookmarkObject(bm2);
-
- Assert.deepEqual(bm1, bm2);
- Assert.equal(bm2.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm2.index, 0);
- Assert.deepEqual(bm2.dateAdded, bm2.lastModified);
- Assert.equal(bm2.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
- Assert.ok(!("url" in bm2));
- Assert.ok(!("title" in bm2));
-
- yield PlacesUtils.bookmarks.remove(bm1.guid);
-});
-
-add_task(function* fetch_byposition_nonexisting_parentGuid() {
- let bm = yield PlacesUtils.bookmarks.fetch({ parentGuid: "123456789012",
- index: 0 },
- gAccumulator.callback);
- Assert.equal(bm, null);
- Assert.equal(gAccumulator.results.length, 0);
-});
-
-add_task(function* fetch_byposition_nonexisting_index() {
- let bm = yield PlacesUtils.bookmarks.fetch({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- index: 100 },
- gAccumulator.callback);
- Assert.equal(bm, null);
- Assert.equal(gAccumulator.results.length, 0);
-});
-
-add_task(function* fetch_byposition() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/",
- title: "a bookmark" });
- checkBookmarkObject(bm1);
-
- let bm2 = yield PlacesUtils.bookmarks.fetch({ parentGuid: bm1.parentGuid,
- index: bm1.index },
- gAccumulator.callback);
- checkBookmarkObject(bm2);
- Assert.equal(gAccumulator.results.length, 1);
- checkBookmarkObject(gAccumulator.results[0]);
- Assert.deepEqual(gAccumulator.results[0], bm1);
-
- Assert.deepEqual(bm1, bm2);
- Assert.equal(bm2.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm2.index, 0);
- Assert.deepEqual(bm2.dateAdded, bm2.lastModified);
- Assert.equal(bm2.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- Assert.equal(bm2.url.href, "http://example.com/");
- Assert.equal(bm2.title, "a bookmark");
-});
-
-add_task(function* fetch_byposition_default_index() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/last",
- title: "last child" });
- checkBookmarkObject(bm1);
-
- let bm2 = yield PlacesUtils.bookmarks.fetch({ parentGuid: bm1.parentGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX },
- gAccumulator.callback);
- checkBookmarkObject(bm2);
- Assert.equal(gAccumulator.results.length, 1);
- checkBookmarkObject(gAccumulator.results[0]);
- Assert.deepEqual(gAccumulator.results[0], bm1);
-
- Assert.deepEqual(bm1, bm2);
- Assert.equal(bm2.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm2.index, 1);
- Assert.deepEqual(bm2.dateAdded, bm2.lastModified);
- Assert.equal(bm2.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- Assert.equal(bm2.url.href, "http://example.com/last");
- Assert.equal(bm2.title, "last child");
-
- yield PlacesUtils.bookmarks.remove(bm1.guid);
-});
-
-add_task(function* fetch_byurl_nonexisting() {
- let bm = yield PlacesUtils.bookmarks.fetch({ url: "http://nonexisting.com/" },
- gAccumulator.callback);
- Assert.equal(bm, null);
- Assert.equal(gAccumulator.results.length, 0);
-});
-
-add_task(function* fetch_byurl() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://byurl.com/",
- title: "a bookmark" });
- checkBookmarkObject(bm1);
-
- // Also ensure that fecth-by-url excludes the tags folder.
- PlacesUtils.tagging.tagURI(uri(bm1.url.href), ["Test Tag"]);
-
- let bm2 = yield PlacesUtils.bookmarks.fetch({ url: bm1.url },
- gAccumulator.callback);
- checkBookmarkObject(bm2);
- Assert.equal(gAccumulator.results.length, 1);
- checkBookmarkObject(gAccumulator.results[0]);
- Assert.deepEqual(gAccumulator.results[0], bm1);
-
- Assert.deepEqual(bm1, bm2);
- Assert.equal(bm2.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.deepEqual(bm2.dateAdded, bm2.lastModified);
- Assert.equal(bm2.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- Assert.equal(bm2.url.href, "http://byurl.com/");
- Assert.equal(bm2.title, "a bookmark");
-
- let bm3 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://byurl.com/",
- title: "a bookmark" });
- let bm4 = yield PlacesUtils.bookmarks.fetch({ url: bm1.url },
- gAccumulator.callback);
- checkBookmarkObject(bm4);
- Assert.deepEqual(bm3, bm4);
- Assert.equal(gAccumulator.results.length, 2);
- gAccumulator.results.forEach(checkBookmarkObject);
- Assert.deepEqual(gAccumulator.results[0], bm4);
-
- // After an update the returned bookmark should change.
- yield PlacesUtils.bookmarks.update({ guid: bm1.guid, title: "new title" });
- let bm5 = yield PlacesUtils.bookmarks.fetch({ url: bm1.url },
- gAccumulator.callback);
- checkBookmarkObject(bm5);
- // Cannot use deepEqual cause lastModified changed.
- Assert.equal(bm1.guid, bm5.guid);
- Assert.ok(bm5.lastModified > bm1.lastModified);
- Assert.equal(gAccumulator.results.length, 2);
- gAccumulator.results.forEach(checkBookmarkObject);
- Assert.deepEqual(gAccumulator.results[0], bm5);
-
- // cleanup
- PlacesUtils.tagging.untagURI(uri(bm1.url.href), ["Test Tag"]);
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_getRecent.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_getRecent.js
deleted file mode 100644
index 35166bd95..000000000
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks_getRecent.js
+++ /dev/null
@@ -1,44 +0,0 @@
-add_task(function* invalid_input_throws() {
- Assert.throws(() => PlacesUtils.bookmarks.getRecent(),
- /numberOfItems argument is required/);
- Assert.throws(() => PlacesUtils.bookmarks.getRecent("abc"),
- /numberOfItems argument must be an integer/);
- Assert.throws(() => PlacesUtils.bookmarks.getRecent(1.2),
- /numberOfItems argument must be an integer/);
- Assert.throws(() => PlacesUtils.bookmarks.getRecent(0),
- /numberOfItems argument must be greater than zero/);
- Assert.throws(() => PlacesUtils.bookmarks.getRecent(-1),
- /numberOfItems argument must be greater than zero/);
-});
-
-add_task(function* getRecent_returns_recent_bookmarks() {
- yield PlacesUtils.bookmarks.eraseEverything();
-
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.com/",
- title: "a bookmark" });
- let bm2 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.org/path",
- title: "another bookmark" });
- let bm3 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.net/",
- title: "another bookmark" });
- let bm4 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.net/path",
- title: "yet another bookmark" });
- checkBookmarkObject(bm1);
- checkBookmarkObject(bm2);
- checkBookmarkObject(bm3);
- checkBookmarkObject(bm4);
-
- let results = yield PlacesUtils.bookmarks.getRecent(3);
- Assert.equal(results.length, 3);
- checkBookmarkObject(results[0]);
- Assert.deepEqual(bm4, results[0]);
- checkBookmarkObject(results[1]);
- Assert.deepEqual(bm3, results[1]);
- checkBookmarkObject(results[2]);
- Assert.deepEqual(bm2, results[2]);
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_insert.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_insert.js
deleted file mode 100644
index 0f772a92f..000000000
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks_insert.js
+++ /dev/null
@@ -1,264 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* invalid_input_throws() {
- Assert.throws(() => PlacesUtils.bookmarks.insert(),
- /Input should be a valid object/);
- Assert.throws(() => PlacesUtils.bookmarks.insert(null),
- /Input should be a valid object/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({}),
- /The following properties were expected/);
-
- Assert.throws(() => PlacesUtils.bookmarks.insert({ guid: "test" }),
- /Invalid value for property 'guid'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ guid: null }),
- /Invalid value for property 'guid'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ guid: 123 }),
- /Invalid value for property 'guid'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.insert({ parentGuid: "test" }),
- /Invalid value for property 'parentGuid'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ parentGuid: null }),
- /Invalid value for property 'parentGuid'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ parentGuid: 123 }),
- /Invalid value for property 'parentGuid'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.insert({ index: "1" }),
- /Invalid value for property 'index'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ index: -10 }),
- /Invalid value for property 'index'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.insert({ dateAdded: -10 }),
- /Invalid value for property 'dateAdded'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ dateAdded: "today" }),
- /Invalid value for property 'dateAdded'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ dateAdded: Date.now() }),
- /Invalid value for property 'dateAdded'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.insert({ lastModified: -10 }),
- /Invalid value for property 'lastModified'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ lastModified: "today" }),
- /Invalid value for property 'lastModified'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ lastModified: Date.now() }),
- /Invalid value for property 'lastModified'/);
- let time = new Date();
- let future = new Date(time + 86400000);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ dateAdded: future,
- lastModified: time }),
- /Invalid value for property 'dateAdded'/);
- let past = new Date(time - 86400000);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ lastModified: past }),
- /Invalid value for property 'lastModified'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.insert({ type: -1 }),
- /Invalid value for property 'type'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ type: 100 }),
- /Invalid value for property 'type'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ type: "bookmark" }),
- /Invalid value for property 'type'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- title: -1 }),
- /Invalid value for property 'title'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: 10 }),
- /Invalid value for property 'url'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://te st" }),
- /Invalid value for property 'url'/);
- let longurl = "http://www.example.com/";
- for (let i = 0; i < 65536; i++) {
- longurl += "a";
- }
- Assert.throws(() => PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: longurl }),
- /Invalid value for property 'url'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: NetUtil.newURI(longurl) }),
- /Invalid value for property 'url'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "te st" }),
- /Invalid value for property 'url'/);
-});
-
-add_task(function* invalid_properties_for_bookmark_type() {
- Assert.throws(() => PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- url: "http://www.moz.com/" }),
- /Invalid value for property 'url'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- url: "http://www.moz.com/" }),
- /Invalid value for property 'url'/);
- Assert.throws(() => PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- title: "test" }),
- /Invalid value for property 'title'/);
-});
-
-add_task(function* long_title_trim() {
- let longtitle = "a";
- for (let i = 0; i < 4096; i++) {
- longtitle += "a";
- }
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: longtitle });
- checkBookmarkObject(bm);
- Assert.equal(bm.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm.index, 0);
- Assert.equal(bm.dateAdded, bm.lastModified);
- Assert.equal(bm.type, PlacesUtils.bookmarks.TYPE_FOLDER);
- Assert.equal(bm.title.length, 4096, "title should have been trimmed");
- Assert.ok(!("url" in bm), "url should not be set");
-});
-
-add_task(function* create_separator() {
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX });
- checkBookmarkObject(bm);
- Assert.equal(bm.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm.index, 1);
- Assert.equal(bm.dateAdded, bm.lastModified);
- Assert.equal(bm.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
- Assert.ok(!("title" in bm), "title should not be set");
-});
-
-add_task(function* create_separator_w_title_fail() {
- try {
- yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- title: "a separator" });
- Assert.ok(false, "Trying to set title for a separator should reject");
- } catch (ex) {}
-});
-
-add_task(function* create_separator_invalid_parent_fail() {
- try {
- yield PlacesUtils.bookmarks.insert({ parentGuid: "123456789012",
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- title: "a separator" });
- Assert.ok(false, "Trying to create an item in a non existing parent reject");
- } catch (ex) {}
-});
-
-add_task(function* create_separator_given_guid() {
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- guid: "123456789012" });
- checkBookmarkObject(bm);
- Assert.equal(bm.guid, "123456789012");
- Assert.equal(bm.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm.index, 2);
- Assert.equal(bm.dateAdded, bm.lastModified);
- Assert.equal(bm.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
- Assert.ok(!("title" in bm), "title should not be set");
-});
-
-add_task(function* create_item_given_guid_no_type_fail() {
- try {
- yield PlacesUtils.bookmarks.insert({ parentGuid: "123456789012" });
- Assert.ok(false, "Trying to create an item with a given guid but no type should reject");
- } catch (ex) {}
-});
-
-add_task(function* create_separator_big_index() {
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- index: 9999 });
- checkBookmarkObject(bm);
- Assert.equal(bm.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm.index, 3);
- Assert.equal(bm.dateAdded, bm.lastModified);
- Assert.equal(bm.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
- Assert.ok(!("title" in bm), "title should not be set");
-});
-
-add_task(function* create_separator_given_dateAdded() {
- let time = new Date();
- let past = new Date(time - 86400000);
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- dateAdded: past });
- checkBookmarkObject(bm);
- Assert.equal(bm.dateAdded, past);
- Assert.equal(bm.lastModified, past);
-});
-
-add_task(function* create_folder() {
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
- checkBookmarkObject(bm);
- Assert.equal(bm.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm.dateAdded, bm.lastModified);
- Assert.equal(bm.type, PlacesUtils.bookmarks.TYPE_FOLDER);
- Assert.ok(!("title" in bm), "title should not be set");
-
- // And then create a nested folder.
- let parentGuid = bm.guid;
- bm = yield PlacesUtils.bookmarks.insert({ parentGuid: parentGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "a folder" });
- checkBookmarkObject(bm);
- Assert.equal(bm.parentGuid, parentGuid);
- Assert.equal(bm.index, 0);
- Assert.equal(bm.type, PlacesUtils.bookmarks.TYPE_FOLDER);
- Assert.strictEqual(bm.title, "a folder");
-});
-
-add_task(function* create_bookmark() {
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
- let parentGuid = bm.guid;
-
- bm = yield PlacesUtils.bookmarks.insert({ parentGuid: parentGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/",
- title: "a bookmark" });
- checkBookmarkObject(bm);
- Assert.equal(bm.parentGuid, parentGuid);
- Assert.equal(bm.index, 0);
- Assert.equal(bm.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- Assert.equal(bm.url.href, "http://example.com/");
- Assert.equal(bm.title, "a bookmark");
-
- // Check parent lastModified.
- let parent = yield PlacesUtils.bookmarks.fetch({ guid: bm.parentGuid });
- Assert.deepEqual(parent.lastModified, bm.dateAdded);
-
- bm = yield PlacesUtils.bookmarks.insert({ parentGuid: parentGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: new URL("http://example.com/") });
- checkBookmarkObject(bm);
- Assert.equal(bm.parentGuid, parentGuid);
- Assert.equal(bm.index, 1);
- Assert.equal(bm.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- Assert.equal(bm.url.href, "http://example.com/");
- Assert.ok(!("title" in bm), "title should not be set");
-});
-
-add_task(function* create_bookmark_frecency() {
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/",
- title: "a bookmark" });
- checkBookmarkObject(bm);
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- Assert.ok(frecencyForUrl(bm.url) > 0, "Check frecency has been updated")
-});
-
-add_task(function* create_bookmark_without_type() {
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.com/",
- title: "a bookmark" });
- checkBookmarkObject(bm);
- Assert.equal(bm.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- Assert.equal(bm.url.href, "http://example.com/");
- Assert.equal(bm.title, "a bookmark");
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_notifications.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_notifications.js
deleted file mode 100644
index 02787425d..000000000
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks_notifications.js
+++ /dev/null
@@ -1,527 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* insert_separator_notification() {
- let observer = expectNotifications();
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid});
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
- observer.check([ { name: "onItemAdded",
- arguments: [ itemId, parentId, bm.index, bm.type,
- null, null, bm.dateAdded,
- bm.guid, bm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* insert_folder_notification() {
- let observer = expectNotifications();
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- title: "a folder" });
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
- observer.check([ { name: "onItemAdded",
- arguments: [ itemId, parentId, bm.index, bm.type,
- null, bm.title, bm.dateAdded,
- bm.guid, bm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* insert_folder_notitle_notification() {
- let observer = expectNotifications();
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
- observer.check([ { name: "onItemAdded",
- arguments: [ itemId, parentId, bm.index, bm.type,
- null, null, bm.dateAdded,
- bm.guid, bm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* insert_bookmark_notification() {
- let observer = expectNotifications();
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: new URL("http://example.com/"),
- title: "a bookmark" });
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
- observer.check([ { name: "onItemAdded",
- arguments: [ itemId, parentId, bm.index, bm.type,
- bm.url, bm.title, bm.dateAdded,
- bm.guid, bm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* insert_bookmark_notitle_notification() {
- let observer = expectNotifications();
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: new URL("http://example.com/") });
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
- observer.check([ { name: "onItemAdded",
- arguments: [ itemId, parentId, bm.index, bm.type,
- bm.url, null, bm.dateAdded,
- bm.guid, bm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* insert_bookmark_tag_notification() {
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: new URL("http://tag.example.com/") });
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
-
- let tagFolder = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.tagsGuid,
- title: "tag" });
- let observer = expectNotifications();
- let tag = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: tagFolder.guid,
- url: new URL("http://tag.example.com/") });
- let tagId = yield PlacesUtils.promiseItemId(tag.guid);
- let tagParentId = yield PlacesUtils.promiseItemId(tag.parentGuid);
-
- observer.check([ { name: "onItemAdded",
- arguments: [ tagId, tagParentId, tag.index, tag.type,
- tag.url, null, tag.dateAdded,
- tag.guid, tag.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemChanged",
- arguments: [ itemId, "tags", false, "",
- bm.lastModified, bm.type, parentId,
- bm.guid, bm.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* update_bookmark_lastModified() {
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: new URL("http://lastmod.example.com/") });
- let observer = expectNotifications();
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- lastModified: new Date() });
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
-
- observer.check([ { name: "onItemChanged",
- arguments: [ itemId, "lastModified", false,
- `${bm.lastModified * 1000}`, bm.lastModified,
- bm.type, parentId, bm.guid, bm.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* update_bookmark_title() {
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: new URL("http://title.example.com/") });
- let observer = expectNotifications();
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- title: "new title" });
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
-
- observer.check([ { name: "onItemChanged",
- arguments: [ itemId, "title", false, bm.title,
- bm.lastModified, bm.type, parentId, bm.guid,
- bm.parentGuid, "", Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* update_bookmark_uri() {
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: new URL("http://url.example.com/") });
- let observer = expectNotifications();
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- url: "http://mozilla.org/" });
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
-
- observer.check([ { name: "onItemChanged",
- arguments: [ itemId, "uri", false, bm.url.href,
- bm.lastModified, bm.type, parentId, bm.guid,
- bm.parentGuid, "http://url.example.com/",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* update_move_same_folder() {
- // Ensure there are at least two items in place (others test do so for us,
- // but we don't have to depend on that).
- yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: new URL("http://move.example.com/") });
- let bmItemId = yield PlacesUtils.promiseItemId(bm.guid);
- let bmParentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
- let bmOldIndex = bm.index;
-
- let observer = expectNotifications();
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- index: 0 });
- Assert.equal(bm.index, 0);
- observer.check([ { name: "onItemMoved",
- arguments: [ bmItemId, bmParentId, bmOldIndex, bmParentId, bm.index,
- bm.type, bm.guid, bm.parentGuid, bm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-
- // Test that we get the right index for DEFAULT_INDEX input.
- bmOldIndex = 0;
- observer = expectNotifications();
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX });
- Assert.ok(bm.index > 0);
- observer.check([ { name: "onItemMoved",
- arguments: [ bmItemId, bmParentId, bmOldIndex, bmParentId, bm.index,
- bm.type, bm.guid, bm.parentGuid, bm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* update_move_different_folder() {
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: new URL("http://move.example.com/") });
- let folder = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- let bmItemId = yield PlacesUtils.promiseItemId(bm.guid);
- let bmOldParentId = PlacesUtils.unfiledBookmarksFolderId;
- let bmOldIndex = bm.index;
-
- let observer = expectNotifications();
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- parentGuid: folder.guid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX });
- Assert.equal(bm.index, 0);
- let bmNewParentId = yield PlacesUtils.promiseItemId(folder.guid);
- observer.check([ { name: "onItemMoved",
- arguments: [ bmItemId, bmOldParentId, bmOldIndex, bmNewParentId,
- bm.index, bm.type, bm.guid,
- PlacesUtils.bookmarks.unfiledGuid,
- bm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* remove_bookmark() {
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: new URL("http://remove.example.com/") });
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
-
- let observer = expectNotifications();
- bm = yield PlacesUtils.bookmarks.remove(bm.guid);
- // TODO (Bug 653910): onItemAnnotationRemoved notified even if there were no
- // annotations.
- observer.check([ { name: "onItemRemoved",
- arguments: [ itemId, parentId, bm.index, bm.type, bm.url,
- bm.guid, bm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* remove_folder() {
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
-
- let observer = expectNotifications();
- bm = yield PlacesUtils.bookmarks.remove(bm.guid);
- observer.check([ { name: "onItemRemoved",
- arguments: [ itemId, parentId, bm.index, bm.type, null,
- bm.guid, bm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* remove_bookmark_tag_notification() {
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: new URL("http://untag.example.com/") });
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
-
- let tagFolder = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.tagsGuid,
- title: "tag" });
- let tag = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: tagFolder.guid,
- url: new URL("http://untag.example.com/") });
- let tagId = yield PlacesUtils.promiseItemId(tag.guid);
- let tagParentId = yield PlacesUtils.promiseItemId(tag.parentGuid);
-
- let observer = expectNotifications();
- yield PlacesUtils.bookmarks.remove(tag.guid);
-
- observer.check([ { name: "onItemRemoved",
- arguments: [ tagId, tagParentId, tag.index, tag.type,
- tag.url, tag.guid, tag.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemChanged",
- arguments: [ itemId, "tags", false, "",
- bm.lastModified, bm.type, parentId,
- bm.guid, bm.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* remove_folder_notification() {
- let folder1 = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- let folder1Id = yield PlacesUtils.promiseItemId(folder1.guid);
- let folder1ParentId = yield PlacesUtils.promiseItemId(folder1.parentGuid);
-
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: folder1.guid,
- url: new URL("http://example.com/") });
- let bmItemId = yield PlacesUtils.promiseItemId(bm.guid);
-
- let folder2 = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: folder1.guid });
- let folder2Id = yield PlacesUtils.promiseItemId(folder2.guid);
-
- let bm2 = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: folder2.guid,
- url: new URL("http://example.com/") });
- let bm2ItemId = yield PlacesUtils.promiseItemId(bm2.guid);
-
- let observer = expectNotifications();
- yield PlacesUtils.bookmarks.remove(folder1.guid);
-
- observer.check([ { name: "onItemRemoved",
- arguments: [ bm2ItemId, folder2Id, bm2.index, bm2.type,
- bm2.url, bm2.guid, bm2.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemRemoved",
- arguments: [ folder2Id, folder1Id, folder2.index,
- folder2.type, null, folder2.guid,
- folder2.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemRemoved",
- arguments: [ bmItemId, folder1Id, bm.index, bm.type,
- bm.url, bm.guid, bm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemRemoved",
- arguments: [ folder1Id, folder1ParentId, folder1.index,
- folder1.type, null, folder1.guid,
- folder1.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-});
-
-add_task(function* eraseEverything_notification() {
- // Let's start from a clean situation.
- yield PlacesUtils.bookmarks.eraseEverything();
-
- let folder1 = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- let folder1Id = yield PlacesUtils.promiseItemId(folder1.guid);
- let folder1ParentId = yield PlacesUtils.promiseItemId(folder1.parentGuid);
-
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: folder1.guid,
- url: new URL("http://example.com/") });
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
-
- let folder2 = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- let folder2Id = yield PlacesUtils.promiseItemId(folder2.guid);
- let folder2ParentId = yield PlacesUtils.promiseItemId(folder2.parentGuid);
-
- let toolbarBm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- url: new URL("http://example.com/") });
- let toolbarBmId = yield PlacesUtils.promiseItemId(toolbarBm.guid);
- let toolbarBmParentId = yield PlacesUtils.promiseItemId(toolbarBm.parentGuid);
-
- let menuBm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- url: new URL("http://example.com/") });
- let menuBmId = yield PlacesUtils.promiseItemId(menuBm.guid);
- let menuBmParentId = yield PlacesUtils.promiseItemId(menuBm.parentGuid);
-
- let observer = expectNotifications();
- yield PlacesUtils.bookmarks.eraseEverything();
-
- // Bookmarks should always be notified before their parents.
- observer.check([ { name: "onItemRemoved",
- arguments: [ itemId, parentId, bm.index, bm.type,
- bm.url, bm.guid, bm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemRemoved",
- arguments: [ folder2Id, folder2ParentId, folder2.index,
- folder2.type, null, folder2.guid,
- folder2.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemRemoved",
- arguments: [ folder1Id, folder1ParentId, folder1.index,
- folder1.type, null, folder1.guid,
- folder1.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemRemoved",
- arguments: [ menuBmId, menuBmParentId,
- menuBm.index, menuBm.type,
- menuBm.url, menuBm.guid,
- menuBm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemRemoved",
- arguments: [ toolbarBmId, toolbarBmParentId,
- toolbarBm.index, toolbarBm.type,
- toolbarBm.url, toolbarBm.guid,
- toolbarBm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- ]);
-});
-
-add_task(function* eraseEverything_reparented_notification() {
- // Let's start from a clean situation.
- yield PlacesUtils.bookmarks.eraseEverything();
-
- let folder1 = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- let folder1Id = yield PlacesUtils.promiseItemId(folder1.guid);
- let folder1ParentId = yield PlacesUtils.promiseItemId(folder1.parentGuid);
-
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: folder1.guid,
- url: new URL("http://example.com/") });
- let itemId = yield PlacesUtils.promiseItemId(bm.guid);
-
- let folder2 = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- let folder2Id = yield PlacesUtils.promiseItemId(folder2.guid);
- let folder2ParentId = yield PlacesUtils.promiseItemId(folder2.parentGuid);
-
- bm.parentGuid = folder2.guid;
- bm = yield PlacesUtils.bookmarks.update(bm);
- let parentId = yield PlacesUtils.promiseItemId(bm.parentGuid);
-
- let observer = expectNotifications();
- yield PlacesUtils.bookmarks.eraseEverything();
-
- // Bookmarks should always be notified before their parents.
- observer.check([ { name: "onItemRemoved",
- arguments: [ itemId, parentId, bm.index, bm.type,
- bm.url, bm.guid, bm.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemRemoved",
- arguments: [ folder2Id, folder2ParentId, folder2.index,
- folder2.type, null, folder2.guid,
- folder2.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemRemoved",
- arguments: [ folder1Id, folder1ParentId, folder1.index,
- folder1.type, null, folder1.guid,
- folder1.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- ]);
-});
-
-add_task(function* reorder_notification() {
- let bookmarks = [
- { type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example1.com/",
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- },
- { type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- },
- { type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- },
- { type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example2.com/",
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- },
- { type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example3.com/",
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- },
- ];
- let sorted = [];
- for (let bm of bookmarks) {
- sorted.push(yield PlacesUtils.bookmarks.insert(bm));
- }
-
- // Randomly reorder the array.
- sorted.sort(() => 0.5 - Math.random());
-
- let observer = expectNotifications();
- yield PlacesUtils.bookmarks.reorder(PlacesUtils.bookmarks.unfiledGuid,
- sorted.map(bm => bm.guid));
-
- let expectedNotifications = [];
- for (let i = 0; i < sorted.length; ++i) {
- let child = sorted[i];
- let childId = yield PlacesUtils.promiseItemId(child.guid);
- expectedNotifications.push({ name: "onItemMoved",
- arguments: [ childId,
- PlacesUtils.unfiledBookmarksFolderId,
- child.index,
- PlacesUtils.unfiledBookmarksFolderId,
- i,
- child.type,
- child.guid,
- child.parentGuid,
- child.parentGuid,
- Ci.nsINavBookmarksService.SOURCE_DEFAULT
- ] });
- }
- observer.check(expectedNotifications);
-});
-
-function expectNotifications() {
- let notifications = [];
- let observer = new Proxy(NavBookmarkObserver, {
- get(target, name) {
- if (name == "check") {
- PlacesUtils.bookmarks.removeObserver(observer);
- return expectedNotifications =>
- Assert.deepEqual(notifications, expectedNotifications);
- }
-
- if (name.startsWith("onItem")) {
- return (...origArgs) => {
- let args = Array.from(origArgs, arg => {
- if (arg && arg instanceof Ci.nsIURI)
- return new URL(arg.spec);
- if (arg && typeof(arg) == "number" && arg >= Date.now() * 1000)
- return new Date(parseInt(arg/1000));
- return arg;
- });
- notifications.push({ name: name, arguments: args });
- }
- }
-
- if (name in target)
- return target[name];
- return undefined;
- }
- });
- PlacesUtils.bookmarks.addObserver(observer, false);
- return observer;
-}
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_remove.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_remove.js
deleted file mode 100644
index 19085a282..000000000
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks_remove.js
+++ /dev/null
@@ -1,204 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* invalid_input_throws() {
- Assert.throws(() => PlacesUtils.bookmarks.remove(),
- /Input should be a valid object/);
- Assert.throws(() => PlacesUtils.bookmarks.remove(null),
- /Input should be a valid object/);
-
- Assert.throws(() => PlacesUtils.bookmarks.remove("test"),
- /Invalid value for property 'guid'/);
- Assert.throws(() => PlacesUtils.bookmarks.remove(123),
- /Invalid value for property 'guid'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.remove({ guid: "test" }),
- /Invalid value for property 'guid'/);
- Assert.throws(() => PlacesUtils.bookmarks.remove({ guid: null }),
- /Invalid value for property 'guid'/);
- Assert.throws(() => PlacesUtils.bookmarks.remove({ guid: 123 }),
- /Invalid value for property 'guid'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.remove({ parentGuid: "test" }),
- /Invalid value for property 'parentGuid'/);
- Assert.throws(() => PlacesUtils.bookmarks.remove({ parentGuid: null }),
- /Invalid value for property 'parentGuid'/);
- Assert.throws(() => PlacesUtils.bookmarks.remove({ parentGuid: 123 }),
- /Invalid value for property 'parentGuid'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.remove({ url: "http://te st/" }),
- /Invalid value for property 'url'/);
- Assert.throws(() => PlacesUtils.bookmarks.remove({ url: null }),
- /Invalid value for property 'url'/);
- Assert.throws(() => PlacesUtils.bookmarks.remove({ url: -10 }),
- /Invalid value for property 'url'/);
-});
-
-add_task(function* remove_nonexistent_guid() {
- try {
- yield PlacesUtils.bookmarks.remove({ guid: "123456789012"});
- Assert.ok(false, "Should have thrown");
- } catch (ex) {
- Assert.ok(/No bookmarks found for the provided GUID/.test(ex));
- }
-});
-
-add_task(function* remove_roots_fail() {
- let guids = [PlacesUtils.bookmarks.rootGuid,
- PlacesUtils.bookmarks.unfiledGuid,
- PlacesUtils.bookmarks.menuGuid,
- PlacesUtils.bookmarks.toolbarGuid,
- PlacesUtils.bookmarks.tagsGuid,
- PlacesUtils.bookmarks.mobileGuid];
- for (let guid of guids) {
- Assert.throws(() => PlacesUtils.bookmarks.remove(guid),
- /It's not possible to remove Places root folders/);
- }
-});
-
-add_task(function* remove_normal_folder_under_root_succeeds() {
- let folder = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.rootGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
- checkBookmarkObject(folder);
- let removed_folder = yield PlacesUtils.bookmarks.remove(folder);
- Assert.deepEqual(folder, removed_folder);
- Assert.strictEqual((yield PlacesUtils.bookmarks.fetch(folder.guid)), null);
-});
-
-add_task(function* remove_bookmark() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/",
- title: "a bookmark" });
- checkBookmarkObject(bm1);
-
- let bm2 = yield PlacesUtils.bookmarks.remove(bm1.guid);
- checkBookmarkObject(bm2);
-
- Assert.deepEqual(bm1, bm2);
- Assert.equal(bm2.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm2.index, 0);
- Assert.deepEqual(bm2.dateAdded, bm2.lastModified);
- Assert.equal(bm2.type, PlacesUtils.bookmarks.TYPE_BOOKMARK);
- Assert.equal(bm2.url.href, "http://example.com/");
- Assert.equal(bm2.title, "a bookmark");
-});
-
-
-add_task(function* remove_bookmark_orphans() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/",
- title: "a bookmark" });
- checkBookmarkObject(bm1);
- PlacesUtils.annotations.setItemAnnotation((yield PlacesUtils.promiseItemId(bm1.guid)),
- "testanno", "testvalue", 0, 0);
-
- let bm2 = yield PlacesUtils.bookmarks.remove(bm1.guid);
- checkBookmarkObject(bm2);
-
- // Check there are no orphan annotations.
- let conn = yield PlacesUtils.promiseDBConnection();
- let annoAttrs = yield conn.execute(`SELECT id, name FROM moz_anno_attributes`);
- // Bug 1306445 will eventually remove the mobile root anno.
- Assert.equal(annoAttrs.length, 1);
- Assert.equal(annoAttrs[0].getResultByName("name"), PlacesUtils.MOBILE_ROOT_ANNO);
- let annos = rows = yield conn.execute(`SELECT item_id, anno_attribute_id FROM moz_items_annos`);
- Assert.equal(annos.length, 1);
- Assert.equal(annos[0].getResultByName("item_id"), PlacesUtils.mobileFolderId);
- Assert.equal(annos[0].getResultByName("anno_attribute_id"), annoAttrs[0].getResultByName("id"));
-});
-
-add_task(function* remove_bookmark_empty_title() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/",
- title: "" });
- checkBookmarkObject(bm1);
-
- let bm2 = yield PlacesUtils.bookmarks.remove(bm1.guid);
- checkBookmarkObject(bm2);
-
- Assert.deepEqual(bm1, bm2);
- Assert.equal(bm2.index, 0);
- Assert.ok(!("title" in bm2));
-});
-
-add_task(function* remove_folder() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "a folder" });
- checkBookmarkObject(bm1);
-
- let bm2 = yield PlacesUtils.bookmarks.remove(bm1.guid);
- checkBookmarkObject(bm2);
-
- Assert.deepEqual(bm1, bm2);
- Assert.equal(bm2.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm2.index, 0);
- Assert.deepEqual(bm2.dateAdded, bm2.lastModified);
- Assert.equal(bm2.type, PlacesUtils.bookmarks.TYPE_FOLDER);
- Assert.equal(bm2.title, "a folder");
- Assert.ok(!("url" in bm2));
-});
-
-add_task(function* test_nested_contents_removed() {
- let folder1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "a folder" });
- let folder2 = yield PlacesUtils.bookmarks.insert({ parentGuid: folder1.guid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "a folder" });
- let sep = yield PlacesUtils.bookmarks.insert({ parentGuid: folder2.guid,
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR });
- yield PlacesUtils.bookmarks.remove(folder1);
- Assert.strictEqual((yield PlacesUtils.bookmarks.fetch(folder1.guid)), null);
- Assert.strictEqual((yield PlacesUtils.bookmarks.fetch(folder2.guid)), null);
- Assert.strictEqual((yield PlacesUtils.bookmarks.fetch(sep.guid)), null);
-});
-
-add_task(function* remove_folder_empty_title() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "" });
- checkBookmarkObject(bm1);
-
- let bm2 = yield PlacesUtils.bookmarks.remove(bm1.guid);
- checkBookmarkObject(bm2);
-
- Assert.deepEqual(bm1, bm2);
- Assert.equal(bm2.index, 0);
- Assert.ok(!("title" in bm2));
-});
-
-add_task(function* remove_separator() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR });
- checkBookmarkObject(bm1);
-
- let bm2 = yield PlacesUtils.bookmarks.remove(bm1.guid);
- checkBookmarkObject(bm2);
-
- Assert.deepEqual(bm1, bm2);
- Assert.equal(bm2.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- Assert.equal(bm2.index, 0);
- Assert.deepEqual(bm2.dateAdded, bm2.lastModified);
- Assert.equal(bm2.type, PlacesUtils.bookmarks.TYPE_SEPARATOR);
- Assert.ok(!("url" in bm2));
- Assert.ok(!("title" in bm2));
-});
-
-add_task(function* test_nested_content_fails_when_not_allowed() {
- let folder1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "a folder" });
- yield PlacesUtils.bookmarks.insert({ parentGuid: folder1.guid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "a folder" });
- yield Assert.rejects(PlacesUtils.bookmarks.remove(folder1, {preventRemovalOfNonEmptyFolders: true}),
- /Cannot remove a non-empty folder./);
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_reorder.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_reorder.js
deleted file mode 100644
index 4f6617280..000000000
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks_reorder.js
+++ /dev/null
@@ -1,177 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* invalid_input_throws() {
- Assert.throws(() => PlacesUtils.bookmarks.reorder(),
- /Invalid value for property 'guid'/);
- Assert.throws(() => PlacesUtils.bookmarks.reorder(null),
- /Invalid value for property 'guid'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.reorder("test"),
- /Invalid value for property 'guid'/);
- Assert.throws(() => PlacesUtils.bookmarks.reorder(123),
- /Invalid value for property 'guid'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.reorder({ guid: "test" }),
- /Invalid value for property 'guid'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.reorder("123456789012"),
- /Must provide a sorted array of children GUIDs./);
- Assert.throws(() => PlacesUtils.bookmarks.reorder("123456789012", {}),
- /Must provide a sorted array of children GUIDs./);
- Assert.throws(() => PlacesUtils.bookmarks.reorder("123456789012", null),
- /Must provide a sorted array of children GUIDs./);
- Assert.throws(() => PlacesUtils.bookmarks.reorder("123456789012", []),
- /Must provide a sorted array of children GUIDs./);
-
- Assert.throws(() => PlacesUtils.bookmarks.reorder("123456789012", [ null ]),
- /Invalid GUID found in the sorted children array/);
- Assert.throws(() => PlacesUtils.bookmarks.reorder("123456789012", [ "" ]),
- /Invalid GUID found in the sorted children array/);
- Assert.throws(() => PlacesUtils.bookmarks.reorder("123456789012", [ {} ]),
- /Invalid GUID found in the sorted children array/);
- Assert.throws(() => PlacesUtils.bookmarks.reorder("123456789012", [ "012345678901", null ]),
- /Invalid GUID found in the sorted children array/);
-});
-
-add_task(function* reorder_nonexistent_guid() {
- yield Assert.rejects(PlacesUtils.bookmarks.reorder("123456789012", [ "012345678901" ]),
- /No folder found for the provided GUID/,
- "Should throw for nonexisting guid");
-});
-
-add_task(function* reorder() {
- let bookmarks = [
- { url: "http://example1.com/",
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- },
- { type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- },
- { type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- },
- { url: "http://example2.com/",
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- },
- { url: "http://example3.com/",
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- }
- ];
-
- let sorted = [];
- for (let bm of bookmarks) {
- sorted.push(yield PlacesUtils.bookmarks.insert(bm));
- }
-
- // Check the initial append sorting.
- Assert.ok(sorted.every((bm, i) => bm.index == i),
- "Initial bookmarks sorting is correct");
-
- // Apply random sorting and run multiple tests.
- for (let t = 0; t < 4; t++) {
- sorted.sort(() => 0.5 - Math.random());
- let sortedGuids = sorted.map(child => child.guid);
- dump("Expected order: " + sortedGuids.join() + "\n");
- // Add a nonexisting guid to the array, to ensure nothing will break.
- sortedGuids.push("123456789012");
- yield PlacesUtils.bookmarks.reorder(PlacesUtils.bookmarks.unfiledGuid,
- sortedGuids);
- for (let i = 0; i < sorted.length; ++i) {
- let item = yield PlacesUtils.bookmarks.fetch(sorted[i].guid);
- Assert.equal(item.index, i);
- }
- }
-
- do_print("Test partial sorting");
- // Try a partial sorting by passing only 2 entries.
- // The unspecified entries should retain the original order.
- sorted = [ sorted[1], sorted[0] ].concat(sorted.slice(2));
- let sortedGuids = [ sorted[0].guid, sorted[1].guid ];
- dump("Expected order: " + sorted.map(b => b.guid).join() + "\n");
- yield PlacesUtils.bookmarks.reorder(PlacesUtils.bookmarks.unfiledGuid,
- sortedGuids);
- for (let i = 0; i < sorted.length; ++i) {
- let item = yield PlacesUtils.bookmarks.fetch(sorted[i].guid);
- Assert.equal(item.index, i);
- }
-
- // Use triangular numbers to detect skipped position.
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.execute(
- `SELECT parent
- FROM moz_bookmarks
- GROUP BY parent
- HAVING (SUM(DISTINCT position + 1) - (count(*) * (count(*) + 1) / 2)) <> 0`);
- Assert.equal(rows.length, 0, "All the bookmarks should have consistent positions");
-});
-
-add_task(function* move_and_reorder() {
- // Start clean.
- yield PlacesUtils.bookmarks.eraseEverything();
-
- let bm1 = yield PlacesUtils.bookmarks.insert({
- url: "http://example1.com/",
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- });
- let f1 = yield PlacesUtils.bookmarks.insert({
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- });
- let bm2 = yield PlacesUtils.bookmarks.insert({
- url: "http://example2.com/",
- parentGuid: f1.guid
- });
- let f2 = yield PlacesUtils.bookmarks.insert({
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- });
- let bm3 = yield PlacesUtils.bookmarks.insert({
- url: "http://example3.com/",
- parentGuid: f2.guid
- });
- let bm4 = yield PlacesUtils.bookmarks.insert({
- url: "http://example4.com/",
- parentGuid: f2.guid
- });
- let bm5 = yield PlacesUtils.bookmarks.insert({
- url: "http://example5.com/",
- parentGuid: f2.guid
- });
-
- // Invert f2 children.
- // This is critical to reproduce the bug, cause it inverts the position
- // compared to the natural insertion order.
- yield PlacesUtils.bookmarks.reorder(f2.guid, [bm5.guid, bm4.guid, bm3.guid]);
-
- bm1.parentGuid = f1.guid;
- bm1.index = 0;
- yield PlacesUtils.bookmarks.update(bm1);
-
- bm1 = yield PlacesUtils.bookmarks.fetch(bm1.guid);
- Assert.equal(bm1.index, 0);
- bm2 = yield PlacesUtils.bookmarks.fetch(bm2.guid);
- Assert.equal(bm2.index, 1);
- bm3 = yield PlacesUtils.bookmarks.fetch(bm3.guid);
- Assert.equal(bm3.index, 2);
- bm4 = yield PlacesUtils.bookmarks.fetch(bm4.guid);
- Assert.equal(bm4.index, 1);
- bm5 = yield PlacesUtils.bookmarks.fetch(bm5.guid);
- Assert.equal(bm5.index, 0);
-
- // No-op reorder on f1 children.
- // Nothing should change. Though, due to bug 1293365 this was causing children
- // of other folders to get messed up.
- yield PlacesUtils.bookmarks.reorder(f1.guid, [bm1.guid, bm2.guid]);
-
- bm1 = yield PlacesUtils.bookmarks.fetch(bm1.guid);
- Assert.equal(bm1.index, 0);
- bm2 = yield PlacesUtils.bookmarks.fetch(bm2.guid);
- Assert.equal(bm2.index, 1);
- bm3 = yield PlacesUtils.bookmarks.fetch(bm3.guid);
- Assert.equal(bm3.index, 2);
- bm4 = yield PlacesUtils.bookmarks.fetch(bm4.guid);
- Assert.equal(bm4.index, 1);
- bm5 = yield PlacesUtils.bookmarks.fetch(bm5.guid);
- Assert.equal(bm5.index, 0);
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_search.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_search.js
deleted file mode 100644
index 02f7c5460..000000000
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks_search.js
+++ /dev/null
@@ -1,223 +0,0 @@
-add_task(function* invalid_input_throws() {
- Assert.throws(() => PlacesUtils.bookmarks.search(),
- /Query object is required/);
- Assert.throws(() => PlacesUtils.bookmarks.search(null),
- /Query object is required/);
- Assert.throws(() => PlacesUtils.bookmarks.search({title: 50}),
- /Title option must be a string/);
- Assert.throws(() => PlacesUtils.bookmarks.search({url: {url: "wombat"}}),
- /Url option must be a string or a URL object/);
- Assert.throws(() => PlacesUtils.bookmarks.search(50),
- /Query must be an object or a string/);
- Assert.throws(() => PlacesUtils.bookmarks.search(true),
- /Query must be an object or a string/);
-});
-
-add_task(function* search_bookmark() {
- yield PlacesUtils.bookmarks.eraseEverything();
-
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.com/",
- title: "a bookmark" });
- let bm2 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.org/",
- title: "another bookmark" });
- let bm3 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.menuGuid,
- url: "http://menu.org/",
- title: "an on-menu bookmark" });
- let bm4 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- url: "http://toolbar.org/",
- title: "an on-toolbar bookmark" });
- checkBookmarkObject(bm1);
- checkBookmarkObject(bm2);
- checkBookmarkObject(bm3);
- checkBookmarkObject(bm4);
-
- // finds a result by query
- let results = yield PlacesUtils.bookmarks.search("example.com");
- Assert.equal(results.length, 1);
- checkBookmarkObject(results[0]);
- Assert.deepEqual(bm1, results[0]);
-
- // finds multiple results
- results = yield PlacesUtils.bookmarks.search("example");
- Assert.equal(results.length, 2);
- checkBookmarkObject(results[0]);
- checkBookmarkObject(results[1]);
-
- // finds menu bookmarks
- results = yield PlacesUtils.bookmarks.search("an on-menu bookmark");
- Assert.equal(results.length, 1);
- checkBookmarkObject(results[0]);
- Assert.deepEqual(bm3, results[0]);
-
- // finds toolbar bookmarks
- results = yield PlacesUtils.bookmarks.search("an on-toolbar bookmark");
- Assert.equal(results.length, 1);
- checkBookmarkObject(results[0]);
- Assert.deepEqual(bm4, results[0]);
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* search_bookmark_by_query_object() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.com/",
- title: "a bookmark" });
- let bm2 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.org/",
- title: "another bookmark" });
- checkBookmarkObject(bm1);
- checkBookmarkObject(bm2);
-
- let results = yield PlacesUtils.bookmarks.search({query: "example.com"});
- Assert.equal(results.length, 1);
- checkBookmarkObject(results[0]);
-
- Assert.deepEqual(bm1, results[0]);
-
- results = yield PlacesUtils.bookmarks.search({query: "example"});
- Assert.equal(results.length, 2);
- checkBookmarkObject(results[0]);
- checkBookmarkObject(results[1]);
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* search_bookmark_by_url() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.com/",
- title: "a bookmark" });
- let bm2 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.org/path",
- title: "another bookmark" });
- let bm3 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.org/path",
- title: "third bookmark" });
- checkBookmarkObject(bm1);
- checkBookmarkObject(bm2);
- checkBookmarkObject(bm3);
-
- // finds the correct result by url
- let results = yield PlacesUtils.bookmarks.search({url: "http://example.com/"});
- Assert.equal(results.length, 1);
- checkBookmarkObject(results[0]);
- Assert.deepEqual(bm1, results[0]);
-
- // normalizes the url
- results = yield PlacesUtils.bookmarks.search({url: "http:/example.com"});
- Assert.equal(results.length, 1);
- checkBookmarkObject(results[0]);
- Assert.deepEqual(bm1, results[0]);
-
- // returns multiple matches
- results = yield PlacesUtils.bookmarks.search({url: "http://example.org/path"});
- Assert.equal(results.length, 2);
-
- // requires exact match
- results = yield PlacesUtils.bookmarks.search({url: "http://example.org/"});
- Assert.equal(results.length, 0);
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* search_bookmark_by_title() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.com/",
- title: "a bookmark" });
- let bm2 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.org/path",
- title: "another bookmark" });
- let bm3 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.net/",
- title: "another bookmark" });
- checkBookmarkObject(bm1);
- checkBookmarkObject(bm2);
- checkBookmarkObject(bm3);
-
- // finds the correct result by title
- let results = yield PlacesUtils.bookmarks.search({title: "a bookmark"});
- Assert.equal(results.length, 1);
- checkBookmarkObject(results[0]);
- Assert.deepEqual(bm1, results[0]);
-
- // returns multiple matches
- results = yield PlacesUtils.bookmarks.search({title: "another bookmark"});
- Assert.equal(results.length, 2);
-
- // requires exact match
- results = yield PlacesUtils.bookmarks.search({title: "bookmark"});
- Assert.equal(results.length, 0);
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* search_bookmark_combinations() {
- let bm1 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.com/",
- title: "a bookmark" });
- let bm2 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.org/path",
- title: "another bookmark" });
- let bm3 = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.net/",
- title: "third bookmark" });
- checkBookmarkObject(bm1);
- checkBookmarkObject(bm2);
- checkBookmarkObject(bm3);
-
- // finds the correct result if title and url match
- let results = yield PlacesUtils.bookmarks.search({url: "http://example.com/", title: "a bookmark"});
- Assert.equal(results.length, 1);
- checkBookmarkObject(results[0]);
- Assert.deepEqual(bm1, results[0]);
-
- // does not match if query is not matching but url and title match
- results = yield PlacesUtils.bookmarks.search({url: "http://example.com/", title: "a bookmark", query: "nonexistent"});
- Assert.equal(results.length, 0);
-
- // does not match if one parameter is not matching
- results = yield PlacesUtils.bookmarks.search({url: "http://what.ever", title: "a bookmark"});
- Assert.equal(results.length, 0);
-
- // query only matches if other fields match as well
- results = yield PlacesUtils.bookmarks.search({query: "bookmark", url: "http://example.net/"});
- Assert.equal(results.length, 1);
- checkBookmarkObject(results[0]);
- Assert.deepEqual(bm3, results[0]);
-
- // non-matching query will also return no results
- results = yield PlacesUtils.bookmarks.search({query: "nonexistent", url: "http://example.net/"});
- Assert.equal(results.length, 0);
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* search_folder() {
- let folder = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.menuGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "a test folder" });
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: folder.guid,
- url: "http://example.com/",
- title: "a bookmark" });
- checkBookmarkObject(folder);
- checkBookmarkObject(bm);
-
- // also finds folders
- let results = yield PlacesUtils.bookmarks.search("a test folder");
- Assert.equal(results.length, 1);
- checkBookmarkObject(results[0]);
- Assert.equal(folder.title, results[0].title);
- Assert.equal(folder.type, results[0].type);
- Assert.equal(folder.parentGuid, results[0].parentGuid);
-
- // finds elements in folders
- results = yield PlacesUtils.bookmarks.search("example.com");
- Assert.equal(results.length, 1);
- checkBookmarkObject(results[0]);
- Assert.deepEqual(bm, results[0]);
- Assert.equal(folder.guid, results[0].parentGuid);
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarks_update.js b/toolkit/components/places/tests/bookmarks/test_bookmarks_update.js
deleted file mode 100644
index d077fd6f3..000000000
--- a/toolkit/components/places/tests/bookmarks/test_bookmarks_update.js
+++ /dev/null
@@ -1,414 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* invalid_input_throws() {
- Assert.throws(() => PlacesUtils.bookmarks.update(),
- /Input should be a valid object/);
- Assert.throws(() => PlacesUtils.bookmarks.update(null),
- /Input should be a valid object/);
- Assert.throws(() => PlacesUtils.bookmarks.update({}),
- /The following properties were expected/);
-
- Assert.throws(() => PlacesUtils.bookmarks.update({ guid: "test" }),
- /Invalid value for property 'guid'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ guid: null }),
- /Invalid value for property 'guid'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ guid: 123 }),
- /Invalid value for property 'guid'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.update({ parentGuid: "test" }),
- /Invalid value for property 'parentGuid'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ parentGuid: null }),
- /Invalid value for property 'parentGuid'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ parentGuid: 123 }),
- /Invalid value for property 'parentGuid'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.update({ index: "1" }),
- /Invalid value for property 'index'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ index: -10 }),
- /Invalid value for property 'index'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.update({ dateAdded: -10 }),
- /Invalid value for property 'dateAdded'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ dateAdded: "today" }),
- /Invalid value for property 'dateAdded'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ dateAdded: Date.now() }),
- /Invalid value for property 'dateAdded'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.update({ lastModified: -10 }),
- /Invalid value for property 'lastModified'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ lastModified: "today" }),
- /Invalid value for property 'lastModified'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ lastModified: Date.now() }),
- /Invalid value for property 'lastModified'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.update({ type: -1 }),
- /Invalid value for property 'type'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ type: 100 }),
- /Invalid value for property 'type'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ type: "bookmark" }),
- /Invalid value for property 'type'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.update({ url: 10 }),
- /Invalid value for property 'url'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ url: "http://te st" }),
- /Invalid value for property 'url'/);
- let longurl = "http://www.example.com/";
- for (let i = 0; i < 65536; i++) {
- longurl += "a";
- }
- Assert.throws(() => PlacesUtils.bookmarks.update({ url: longurl }),
- /Invalid value for property 'url'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.update({ url: NetUtil.newURI(longurl) }),
- /Invalid value for property 'url'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ url: "te st" }),
- /Invalid value for property 'url'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.update({ title: -1 }),
- /Invalid value for property 'title'/);
- Assert.throws(() => PlacesUtils.bookmarks.update({ title: {} }),
- /Invalid value for property 'title'/);
-
- Assert.throws(() => PlacesUtils.bookmarks.update({ guid: "123456789012" }),
- /Not enough properties to update/);
-
- Assert.throws(() => PlacesUtils.bookmarks.update({ guid: "123456789012",
- parentGuid: "012345678901" }),
- /The following properties were expected: index/);
-});
-
-add_task(function* nonexisting_bookmark_throws() {
- try {
- yield PlacesUtils.bookmarks.update({ guid: "123456789012",
- title: "test" });
- Assert.ok(false, "Should have thrown");
- } catch (ex) {
- Assert.ok(/No bookmarks found for the provided GUID/.test(ex));
- }
-});
-
-add_task(function* invalid_properties_for_existing_bookmark() {
- let bm = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://example.com/" });
-
- try {
- yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
- Assert.ok(false, "Should have thrown");
- } catch (ex) {
- Assert.ok(/The bookmark type cannot be changed/.test(ex));
- }
-
- try {
- yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- dateAdded: new Date() });
- Assert.ok(false, "Should have thrown");
- } catch (ex) {
- Assert.ok(/The bookmark dateAdded cannot be changed/.test(ex));
- }
-
- try {
- yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- dateAdded: new Date() });
- Assert.ok(false, "Should have thrown");
- } catch (ex) {
- Assert.ok(/The bookmark dateAdded cannot be changed/.test(ex));
- }
-
- try {
- yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- parentGuid: "123456789012",
- index: 1 });
- Assert.ok(false, "Should have thrown");
- } catch (ex) {
- Assert.ok(/No bookmarks found for the provided parentGuid/.test(ex));
- }
-
- let past = new Date(Date.now() - 86400000);
- try {
- yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- lastModified: past });
- Assert.ok(false, "Should have thrown");
- } catch (ex) {
- Assert.ok(/Invalid value for property 'lastModified'/.test(ex));
- }
-
- let folder = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- try {
- yield PlacesUtils.bookmarks.update({ guid: folder.guid,
- url: "http://example.com/" });
- Assert.ok(false, "Should have thrown");
- } catch (ex) {
- Assert.ok(/Invalid value for property 'url'/.test(ex));
- }
-
- let separator = yield PlacesUtils.bookmarks.insert({ type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- try {
- yield PlacesUtils.bookmarks.update({ guid: separator.guid,
- url: "http://example.com/" });
- Assert.ok(false, "Should have thrown");
- } catch (ex) {
- Assert.ok(/Invalid value for property 'url'/.test(ex));
- }
- try {
- yield PlacesUtils.bookmarks.update({ guid: separator.guid,
- title: "test" });
- Assert.ok(false, "Should have thrown");
- } catch (ex) {
- Assert.ok(/Invalid value for property 'title'/.test(ex));
- }
-});
-
-add_task(function* long_title_trim() {
- let longtitle = "a";
- for (let i = 0; i < 4096; i++) {
- longtitle += "a";
- }
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "title" });
- checkBookmarkObject(bm);
-
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- title: longtitle });
- let newTitle = bm.title;
- Assert.equal(newTitle.length, 4096, "title should have been trimmed");
-
- bm = yield PlacesUtils.bookmarks.fetch(bm.guid);
- Assert.equal(bm.title, newTitle);
-});
-
-add_task(function* update_lastModified() {
- let yesterday = new Date(Date.now() - 86400000);
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "title",
- dateAdded: yesterday });
- checkBookmarkObject(bm);
- Assert.deepEqual(bm.lastModified, yesterday);
-
- let time = new Date();
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- lastModified: time });
- checkBookmarkObject(bm);
- Assert.deepEqual(bm.lastModified, time);
-
- bm = yield PlacesUtils.bookmarks.fetch(bm.guid);
- Assert.deepEqual(bm.lastModified, time);
-
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- lastModified: yesterday });
- Assert.deepEqual(bm.lastModified, yesterday);
-
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- title: "title2" });
- Assert.ok(bm.lastModified >= time);
-
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- title: "" });
- Assert.ok(!("title" in bm));
-
- bm = yield PlacesUtils.bookmarks.fetch(bm.guid);
- Assert.ok(!("title" in bm));
-});
-
-add_task(function* update_url() {
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/",
- title: "title" });
- checkBookmarkObject(bm);
- let lastModified = bm.lastModified;
- let frecency = frecencyForUrl(bm.url);
- Assert.ok(frecency > 0, "Check frecency has been updated");
-
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- url: "http://mozilla.org/" });
- checkBookmarkObject(bm);
- Assert.ok(bm.lastModified >= lastModified);
- Assert.equal(bm.url.href, "http://mozilla.org/");
-
- bm = yield PlacesUtils.bookmarks.fetch(bm.guid);
- Assert.equal(bm.url.href, "http://mozilla.org/");
- Assert.ok(bm.lastModified >= lastModified);
-
- Assert.equal(frecencyForUrl("http://example.com/"), frecency, "Check frecency for example.com");
- Assert.equal(frecencyForUrl("http://mozilla.org/"), frecency, "Check frecency for mozilla.org");
-});
-
-add_task(function* update_index() {
- let parent = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER }) ;
- let f1 = yield PlacesUtils.bookmarks.insert({ parentGuid: parent.guid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
- Assert.equal(f1.index, 0);
- let f2 = yield PlacesUtils.bookmarks.insert({ parentGuid: parent.guid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
- Assert.equal(f2.index, 1);
- let f3 = yield PlacesUtils.bookmarks.insert({ parentGuid: parent.guid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
- Assert.equal(f3.index, 2);
- let lastModified = f1.lastModified;
-
- f1 = yield PlacesUtils.bookmarks.update({ guid: f1.guid,
- parentGuid: f1.parentGuid,
- index: 1});
- checkBookmarkObject(f1);
- Assert.equal(f1.index, 1);
- Assert.ok(f1.lastModified >= lastModified);
-
- parent = yield PlacesUtils.bookmarks.fetch(f1.parentGuid);
- Assert.deepEqual(parent.lastModified, f1.lastModified);
-
- f2 = yield PlacesUtils.bookmarks.fetch(f2.guid);
- Assert.equal(f2.index, 0);
-
- f3 = yield PlacesUtils.bookmarks.fetch(f3.guid);
- Assert.equal(f3.index, 2);
-
- f3 = yield PlacesUtils.bookmarks.update({ guid: f3.guid,
- index: 0 });
- f1 = yield PlacesUtils.bookmarks.fetch(f1.guid);
- Assert.equal(f1.index, 2);
-
- f2 = yield PlacesUtils.bookmarks.fetch(f2.guid);
- Assert.equal(f2.index, 1);
-});
-
-add_task(function* update_move_folder_into_descendant_throws() {
- let parent = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER }) ;
- let descendant = yield PlacesUtils.bookmarks.insert({ parentGuid: parent.guid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
-
- try {
- yield PlacesUtils.bookmarks.update({ guid: parent.guid,
- parentGuid: parent.guid,
- index: 0 });
- Assert.ok(false, "Should have thrown");
- } catch (ex) {
- Assert.ok(/Cannot insert a folder into itself or one of its descendants/.test(ex));
- }
-
- try {
- yield PlacesUtils.bookmarks.update({ guid: parent.guid,
- parentGuid: descendant.guid,
- index: 0 });
- Assert.ok(false, "Should have thrown");
- } catch (ex) {
- Assert.ok(/Cannot insert a folder into itself or one of its descendants/.test(ex));
- }
-});
-
-add_task(function* update_move() {
- let parent = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER }) ;
- let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: parent.guid,
- url: "http://example.com/",
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK }) ;
- let descendant = yield PlacesUtils.bookmarks.insert({ parentGuid: parent.guid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
- Assert.equal(descendant.index, 1);
- let lastModified = bm.lastModified;
-
- // This is moving to a nonexisting index by purpose, it will be appended.
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- parentGuid: descendant.guid,
- index: 1 });
- checkBookmarkObject(bm);
- Assert.equal(bm.parentGuid, descendant.guid);
- Assert.equal(bm.index, 0);
- Assert.ok(bm.lastModified >= lastModified);
-
- parent = yield PlacesUtils.bookmarks.fetch(parent.guid);
- descendant = yield PlacesUtils.bookmarks.fetch(descendant.guid);
- Assert.deepEqual(parent.lastModified, bm.lastModified);
- Assert.deepEqual(descendant.lastModified, bm.lastModified);
- Assert.equal(descendant.index, 0);
-
- bm = yield PlacesUtils.bookmarks.fetch(bm.guid);
- Assert.equal(bm.parentGuid, descendant.guid);
- Assert.equal(bm.index, 0);
-
- bm = yield PlacesUtils.bookmarks.update({ guid: bm.guid,
- parentGuid: parent.guid,
- index: 0 });
- Assert.equal(bm.parentGuid, parent.guid);
- Assert.equal(bm.index, 0);
-
- descendant = yield PlacesUtils.bookmarks.fetch(descendant.guid);
- Assert.equal(descendant.index, 1);
-});
-
-add_task(function* update_move_append() {
- let folder_a =
- yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
- checkBookmarkObject(folder_a);
- let folder_b =
- yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER });
- checkBookmarkObject(folder_b);
-
- /* folder_a: [sep_1, sep_2, sep_3], folder_b: [] */
- let sep_1 = yield PlacesUtils.bookmarks.insert({ parentGuid: folder_a.guid,
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR });
- checkBookmarkObject(sep_1);
- let sep_2 = yield PlacesUtils.bookmarks.insert({ parentGuid: folder_a.guid,
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR });
- checkBookmarkObject(sep_2);
- let sep_3 = yield PlacesUtils.bookmarks.insert({ parentGuid: folder_a.guid,
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR });
- checkBookmarkObject(sep_3);
-
- function ensurePosition(info, parentGuid, index) {
- checkBookmarkObject(info);
- Assert.equal(info.parentGuid, parentGuid);
- Assert.equal(info.index, index);
- }
-
- // folder_a: [sep_2, sep_3, sep_1], folder_b: []
- sep_1.index = PlacesUtils.bookmarks.DEFAULT_INDEX;
- // Note sep_1 includes parentGuid even though we're not moving the item to
- // another folder
- sep_1 = yield PlacesUtils.bookmarks.update(sep_1);
- ensurePosition(sep_1, folder_a.guid, 2);
- sep_2 = yield PlacesUtils.bookmarks.fetch(sep_2.guid);
- ensurePosition(sep_2, folder_a.guid, 0);
- sep_3 = yield PlacesUtils.bookmarks.fetch(sep_3.guid);
- ensurePosition(sep_3, folder_a.guid, 1);
- sep_1 = yield PlacesUtils.bookmarks.fetch(sep_1.guid);
- ensurePosition(sep_1, folder_a.guid, 2);
-
- // folder_a: [sep_2, sep_1], folder_b: [sep_3]
- sep_3.index = PlacesUtils.bookmarks.DEFAULT_INDEX;
- sep_3.parentGuid = folder_b.guid;
- sep_3 = yield PlacesUtils.bookmarks.update(sep_3);
- ensurePosition(sep_3, folder_b.guid, 0);
- sep_2 = yield PlacesUtils.bookmarks.fetch(sep_2.guid);
- ensurePosition(sep_2, folder_a.guid, 0);
- sep_1 = yield PlacesUtils.bookmarks.fetch(sep_1.guid);
- ensurePosition(sep_1, folder_a.guid, 1);
- sep_3 = yield PlacesUtils.bookmarks.fetch(sep_3.guid);
- ensurePosition(sep_3, folder_b.guid, 0);
-
- // folder_a: [sep_1], folder_b: [sep_3, sep_2]
- sep_2.index = Number.MAX_SAFE_INTEGER;
- sep_2.parentGuid = folder_b.guid;
- sep_2 = yield PlacesUtils.bookmarks.update(sep_2);
- ensurePosition(sep_2, folder_b.guid, 1);
- sep_1 = yield PlacesUtils.bookmarks.fetch(sep_1.guid);
- ensurePosition(sep_1, folder_a.guid, 0);
- sep_3 = yield PlacesUtils.bookmarks.fetch(sep_3.guid);
- ensurePosition(sep_3, folder_b.guid, 0);
- sep_2 = yield PlacesUtils.bookmarks.fetch(sep_2.guid);
- ensurePosition(sep_2, folder_b.guid, 1);
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_bookmarkstree_cache.js b/toolkit/components/places/tests/bookmarks/test_bookmarkstree_cache.js
deleted file mode 100644
index f5cf34641..000000000
--- a/toolkit/components/places/tests/bookmarks/test_bookmarkstree_cache.js
+++ /dev/null
@@ -1,18 +0,0 @@
-
-// Bug 1192692 - promiseBookmarksTree caches items without adding observers to
-// invalidate the cache.
-add_task(function* boookmarks_tree_cache() {
- // Note that for this test to be effective, it needs to use the "old" sync
- // bookmarks methods - using, eg, PlacesUtils.bookmarks.insert() doesn't
- // demonstrate the problem as it indirectly arranges for the observers to
- // be added.
- let id = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- uri("http://example.com"),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "A title");
- yield PlacesUtils.promiseBookmarksTree();
-
- PlacesUtils.bookmarks.removeItem(id);
-
- yield Assert.rejects(PlacesUtils.promiseItemGuid(id));
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_changeBookmarkURI.js b/toolkit/components/places/tests/bookmarks/test_changeBookmarkURI.js
deleted file mode 100644
index 55ffecf2f..000000000
--- a/toolkit/components/places/tests/bookmarks/test_changeBookmarkURI.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Get bookmark service
-var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-
-/**
- * Ensures that the Places APIs recognize that aBookmarkedUri is bookmarked
- * via aBookmarkId and that aUnbookmarkedUri is not bookmarked at all.
- *
- * @param aBookmarkId
- * an item ID whose corresponding URI is aBookmarkedUri
- * @param aBookmarkedUri
- * a bookmarked URI that has a corresponding item ID aBookmarkId
- * @param aUnbookmarkedUri
- * a URI that is not currently bookmarked at all
- */
-function checkUris(aBookmarkId, aBookmarkedUri, aUnbookmarkedUri)
-{
- // Ensure that aBookmarkedUri equals some URI that is bookmarked
- var uri = bmsvc.getBookmarkedURIFor(aBookmarkedUri);
- do_check_neq(uri, null);
- do_check_true(uri.equals(aBookmarkedUri));
-
- // Ensure that aBookmarkedUri is considered bookmarked
- do_check_true(bmsvc.isBookmarked(aBookmarkedUri));
-
- // Ensure that the URI corresponding to aBookmarkId equals aBookmarkedUri
- do_check_true(bmsvc.getBookmarkURI(aBookmarkId).equals(aBookmarkedUri));
-
- // Ensure that aUnbookmarkedUri does not equal any URI that is bookmarked
- uri = bmsvc.getBookmarkedURIFor(aUnbookmarkedUri);
- do_check_eq(uri, null);
-
- // Ensure that aUnbookmarkedUri is not considered bookmarked
- do_check_false(bmsvc.isBookmarked(aUnbookmarkedUri));
-}
-
-// main
-function run_test() {
- // Create a folder
- var folderId = bmsvc.createFolder(bmsvc.toolbarFolder,
- "test",
- bmsvc.DEFAULT_INDEX);
-
- // Create 2 URIs
- var uri1 = uri("http://www.dogs.com");
- var uri2 = uri("http://www.cats.com");
-
- // Bookmark the first one
- var bookmarkId = bmsvc.insertBookmark(folderId,
- uri1,
- bmsvc.DEFAULT_INDEX,
- "Dogs");
-
- // uri1 is bookmarked via bookmarkId, uri2 is not
- checkUris(bookmarkId, uri1, uri2);
-
- // Change the URI of the bookmark to uri2
- bmsvc.changeBookmarkURI(bookmarkId, uri2);
-
- // uri2 is now bookmarked via bookmarkId, uri1 is not
- checkUris(bookmarkId, uri2, uri1);
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_getBookmarkedURIFor.js b/toolkit/components/places/tests/bookmarks/test_getBookmarkedURIFor.js
deleted file mode 100644
index c43e8e283..000000000
--- a/toolkit/components/places/tests/bookmarks/test_getBookmarkedURIFor.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- /**
- * Test bookmarksService.getBookmarkedURIFor(aURI);
- */
-
-var hs = PlacesUtils.history;
-var bs = PlacesUtils.bookmarks;
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_getBookmarkedURIFor() {
- let now = Date.now() * 1000;
- const sourceURI = uri("http://test.mozilla.org/");
- // Add a visit and a bookmark.
- yield PlacesTestUtils.addVisits({ uri: sourceURI, visitDate: now });
- do_check_eq(bs.getBookmarkedURIFor(sourceURI), null);
-
- let sourceItemId = bs.insertBookmark(bs.unfiledBookmarksFolder,
- sourceURI,
- bs.DEFAULT_INDEX,
- "bookmark");
- do_check_true(bs.getBookmarkedURIFor(sourceURI).equals(sourceURI));
-
- // Add a redirected visit.
- const permaURI = uri("http://perma.mozilla.org/");
- yield PlacesTestUtils.addVisits({
- uri: permaURI,
- transition: TRANSITION_REDIRECT_PERMANENT,
- visitDate: now++,
- referrer: sourceURI
- });
- do_check_true(bs.getBookmarkedURIFor(sourceURI).equals(sourceURI));
- do_check_true(bs.getBookmarkedURIFor(permaURI).equals(sourceURI));
- // Add a bookmark to the destination.
- let permaItemId = bs.insertBookmark(bs.unfiledBookmarksFolder,
- permaURI,
- bs.DEFAULT_INDEX,
- "bookmark");
- do_check_true(bs.getBookmarkedURIFor(sourceURI).equals(sourceURI));
- do_check_true(bs.getBookmarkedURIFor(permaURI).equals(permaURI));
- // Now remove the bookmark on the destination.
- bs.removeItem(permaItemId);
- // We should see the source as bookmark.
- do_check_true(bs.getBookmarkedURIFor(permaURI).equals(sourceURI));
-
- // Add another redirected visit.
- const tempURI = uri("http://perma.mozilla.org/");
- yield PlacesTestUtils.addVisits({
- uri: tempURI,
- transition: TRANSITION_REDIRECT_TEMPORARY,
- visitDate: now++,
- referrer: permaURI
- });
-
- do_check_true(bs.getBookmarkedURIFor(sourceURI).equals(sourceURI));
- do_check_true(bs.getBookmarkedURIFor(tempURI).equals(sourceURI));
- // Add a bookmark to the destination.
- let tempItemId = bs.insertBookmark(bs.unfiledBookmarksFolder,
- tempURI,
- bs.DEFAULT_INDEX,
- "bookmark");
- do_check_true(bs.getBookmarkedURIFor(sourceURI).equals(sourceURI));
- do_check_true(bs.getBookmarkedURIFor(tempURI).equals(tempURI));
-
- // Now remove the bookmark on the destination.
- bs.removeItem(tempItemId);
- // We should see the source as bookmark.
- do_check_true(bs.getBookmarkedURIFor(tempURI).equals(sourceURI));
- // Remove the source bookmark as well.
- bs.removeItem(sourceItemId);
- do_check_eq(bs.getBookmarkedURIFor(tempURI), null);
-
- // Try to pass in a never seen URI, should return null and a new entry should
- // not be added to the database.
- do_check_eq(bs.getBookmarkedURIFor(uri("http://does.not.exist/")), null);
- do_check_false(page_in_database("http://does.not.exist/"));
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_keywords.js b/toolkit/components/places/tests/bookmarks/test_keywords.js
deleted file mode 100644
index 149d6d0b0..000000000
--- a/toolkit/components/places/tests/bookmarks/test_keywords.js
+++ /dev/null
@@ -1,310 +0,0 @@
-const URI1 = NetUtil.newURI("http://test1.mozilla.org/");
-const URI2 = NetUtil.newURI("http://test2.mozilla.org/");
-const URI3 = NetUtil.newURI("http://test3.mozilla.org/");
-
-function check_keyword(aURI, aKeyword) {
- if (aKeyword)
- aKeyword = aKeyword.toLowerCase();
-
- for (let bm of PlacesUtils.getBookmarksForURI(aURI)) {
- let keyword = PlacesUtils.bookmarks.getKeywordForBookmark(bm);
- if (keyword && !aKeyword) {
- throw (`${aURI.spec} should not have a keyword`);
- } else if (aKeyword && keyword == aKeyword) {
- Assert.equal(keyword, aKeyword);
- }
- }
-
- if (aKeyword) {
- let uri = PlacesUtils.bookmarks.getURIForKeyword(aKeyword);
- Assert.equal(uri.spec, aURI.spec);
- // Check case insensitivity.
- uri = PlacesUtils.bookmarks.getURIForKeyword(aKeyword.toUpperCase());
- Assert.equal(uri.spec, aURI.spec);
- }
-}
-
-function* check_orphans() {
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.executeCached(
- `SELECT id FROM moz_keywords k
- WHERE NOT EXISTS (SELECT 1 FROM moz_places WHERE id = k.place_id)
- `);
- Assert.equal(rows.length, 0);
-}
-
-function expectNotifications() {
- let notifications = [];
- let observer = new Proxy(NavBookmarkObserver, {
- get(target, name) {
- if (name == "check") {
- PlacesUtils.bookmarks.removeObserver(observer);
- return expectedNotifications =>
- Assert.deepEqual(notifications, expectedNotifications);
- }
-
- if (name.startsWith("onItemChanged")) {
- return function(id, prop, isAnno, val, lastMod, itemType, parentId, guid, parentGuid, oldVal) {
- if (prop != "keyword")
- return;
- let args = Array.from(arguments, arg => {
- if (arg && arg instanceof Ci.nsIURI)
- return new URL(arg.spec);
- if (arg && typeof(arg) == "number" && arg >= Date.now() * 1000)
- return new Date(parseInt(arg/1000));
- return arg;
- });
- notifications.push({ name: name, arguments: args });
- }
- }
-
- return target[name];
- }
- });
- PlacesUtils.bookmarks.addObserver(observer, false);
- return observer;
-}
-
-add_task(function test_invalid_input() {
- Assert.throws(() => PlacesUtils.bookmarks.getURIForKeyword(null),
- /NS_ERROR_ILLEGAL_VALUE/);
- Assert.throws(() => PlacesUtils.bookmarks.getURIForKeyword(""),
- /NS_ERROR_ILLEGAL_VALUE/);
- Assert.throws(() => PlacesUtils.bookmarks.getKeywordForBookmark(null),
- /NS_ERROR_ILLEGAL_VALUE/);
- Assert.throws(() => PlacesUtils.bookmarks.getKeywordForBookmark(0),
- /NS_ERROR_ILLEGAL_VALUE/);
- Assert.throws(() => PlacesUtils.bookmarks.setKeywordForBookmark(null, "k"),
- /NS_ERROR_ILLEGAL_VALUE/);
- Assert.throws(() => PlacesUtils.bookmarks.setKeywordForBookmark(0, "k"),
- /NS_ERROR_ILLEGAL_VALUE/);
-});
-
-add_task(function* test_addBookmarkAndKeyword() {
- check_keyword(URI1, null);
- let fc = yield foreign_count(URI1);
- let observer = expectNotifications();
-
- let itemId =
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- URI1,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "test");
-
- PlacesUtils.bookmarks.setKeywordForBookmark(itemId, "keyword");
- let bookmark = yield PlacesUtils.bookmarks.fetch({ url: URI1 });
- observer.check([ { name: "onItemChanged",
- arguments: [ itemId, "keyword", false, "keyword",
- bookmark.lastModified, bookmark.type,
- (yield PlacesUtils.promiseItemId(bookmark.parentGuid)),
- bookmark.guid, bookmark.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- check_keyword(URI1, "keyword");
- Assert.equal((yield foreign_count(URI1)), fc + 2); // + 1 bookmark + 1 keyword
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield check_orphans();
-});
-
-add_task(function* test_addBookmarkToURIHavingKeyword() {
- // The uri has already a keyword.
- check_keyword(URI1, "keyword");
- let fc = yield foreign_count(URI1);
-
- let itemId =
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- URI1,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "test");
- check_keyword(URI1, "keyword");
- Assert.equal((yield foreign_count(URI1)), fc + 1); // + 1 bookmark
-
- PlacesUtils.bookmarks.removeItem(itemId);
- yield PlacesTestUtils.promiseAsyncUpdates();
- check_orphans();
-});
-
-add_task(function* test_sameKeywordDifferentURI() {
- let fc1 = yield foreign_count(URI1);
- let fc2 = yield foreign_count(URI2);
- let observer = expectNotifications();
-
- let itemId =
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- URI2,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "test2");
- check_keyword(URI1, "keyword");
- check_keyword(URI2, null);
-
- PlacesUtils.bookmarks.setKeywordForBookmark(itemId, "kEyWoRd");
-
- let bookmark1 = yield PlacesUtils.bookmarks.fetch({ url: URI1 });
- let bookmark2 = yield PlacesUtils.bookmarks.fetch({ url: URI2 });
- observer.check([ { name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmark1.guid)),
- "keyword", false, "",
- bookmark1.lastModified, bookmark1.type,
- (yield PlacesUtils.promiseItemId(bookmark1.parentGuid)),
- bookmark1.guid, bookmark1.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemChanged",
- arguments: [ itemId, "keyword", false, "keyword",
- bookmark2.lastModified, bookmark2.type,
- (yield PlacesUtils.promiseItemId(bookmark2.parentGuid)),
- bookmark2.guid, bookmark2.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- // The keyword should have been "moved" to the new URI.
- check_keyword(URI1, null);
- Assert.equal((yield foreign_count(URI1)), fc1 - 1); // - 1 keyword
- check_keyword(URI2, "keyword");
- Assert.equal((yield foreign_count(URI2)), fc2 + 2); // + 1 bookmark + 1 keyword
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- check_orphans();
-});
-
-add_task(function* test_sameURIDifferentKeyword() {
- let fc = yield foreign_count(URI2);
- let observer = expectNotifications();
-
- let itemId =
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- URI2,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "test2");
- check_keyword(URI2, "keyword");
-
- PlacesUtils.bookmarks.setKeywordForBookmark(itemId, "keyword2");
-
- let bookmarks = [];
- yield PlacesUtils.bookmarks.fetch({ url: URI2 }, bookmark => bookmarks.push(bookmark));
- observer.check([ { name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmarks[0].guid)),
- "keyword", false, "keyword2",
- bookmarks[0].lastModified, bookmarks[0].type,
- (yield PlacesUtils.promiseItemId(bookmarks[0].parentGuid)),
- bookmarks[0].guid, bookmarks[0].parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmarks[1].guid)),
- "keyword", false, "keyword2",
- bookmarks[1].lastModified, bookmarks[1].type,
- (yield PlacesUtils.promiseItemId(bookmarks[1].parentGuid)),
- bookmarks[1].guid, bookmarks[1].parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- check_keyword(URI2, "keyword2");
- Assert.equal((yield foreign_count(URI2)), fc + 2); // + 1 bookmark + 1 keyword
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- check_orphans();
-});
-
-add_task(function* test_removeBookmarkWithKeyword() {
- let fc = yield foreign_count(URI2);
- let itemId =
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- URI2,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "test");
-
- // The keyword should not be removed, since there are other bookmarks yet.
- PlacesUtils.bookmarks.removeItem(itemId);
-
- check_keyword(URI2, "keyword2");
- Assert.equal((yield foreign_count(URI2)), fc); // + 1 bookmark - 1 bookmark
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- check_orphans();
-});
-
-add_task(function* test_unsetKeyword() {
- let fc = yield foreign_count(URI2);
- let observer = expectNotifications();
-
- let itemId =
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- URI2,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "test");
-
- // The keyword should be removed from any bookmark.
- PlacesUtils.bookmarks.setKeywordForBookmark(itemId, null);
-
- let bookmarks = [];
- yield PlacesUtils.bookmarks.fetch({ url: URI2 }, bookmark => bookmarks.push(bookmark));
- do_print(bookmarks.length);
- observer.check([ { name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmarks[0].guid)),
- "keyword", false, "",
- bookmarks[0].lastModified, bookmarks[0].type,
- (yield PlacesUtils.promiseItemId(bookmarks[0].parentGuid)),
- bookmarks[0].guid, bookmarks[0].parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmarks[1].guid)),
- "keyword", false, "",
- bookmarks[1].lastModified, bookmarks[1].type,
- (yield PlacesUtils.promiseItemId(bookmarks[1].parentGuid)),
- bookmarks[1].guid, bookmarks[1].parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmarks[2].guid)),
- "keyword", false, "",
- bookmarks[2].lastModified, bookmarks[2].type,
- (yield PlacesUtils.promiseItemId(bookmarks[2].parentGuid)),
- bookmarks[2].guid, bookmarks[2].parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-
- check_keyword(URI1, null);
- check_keyword(URI2, null);
- Assert.equal((yield foreign_count(URI2)), fc - 1); // + 1 bookmark - 2 keyword
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- check_orphans();
-});
-
-add_task(function* test_addRemoveBookmark() {
- let observer = expectNotifications();
-
- let itemId =
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- URI3,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "test3");
-
- PlacesUtils.bookmarks.setKeywordForBookmark(itemId, "keyword");
- let bookmark = yield PlacesUtils.bookmarks.fetch({ url: URI3 });
- let parentId = yield PlacesUtils.promiseItemId(bookmark.parentGuid);
- PlacesUtils.bookmarks.removeItem(itemId);
-
- observer.check([ { name: "onItemChanged",
- arguments: [ itemId,
- "keyword", false, "keyword",
- bookmark.lastModified, bookmark.type,
- parentId,
- bookmark.guid, bookmark.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] }
- ]);
-
- check_keyword(URI3, null);
- // Don't check the foreign count since the process is async.
- // The new test_keywords.js in unit is checking this though.
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- check_orphans();
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_nsINavBookmarkObserver.js b/toolkit/components/places/tests/bookmarks/test_nsINavBookmarkObserver.js
deleted file mode 100644
index 06f45b18e..000000000
--- a/toolkit/components/places/tests/bookmarks/test_nsINavBookmarkObserver.js
+++ /dev/null
@@ -1,640 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Tests that each nsINavBookmarksObserver method gets the correct input.
-Cu.import("resource://gre/modules/PromiseUtils.jsm");
-
-const GUID_RE = /^[a-zA-Z0-9\-_]{12}$/;
-
-var gBookmarksObserver = {
- expected: [],
- setup(expected) {
- this.expected = expected;
- this.deferred = PromiseUtils.defer();
- return this.deferred.promise;
- },
- validate: function (aMethodName, aArguments) {
- do_check_eq(this.expected[0].name, aMethodName);
-
- let args = this.expected.shift().args;
- do_check_eq(aArguments.length, args.length);
- for (let i = 0; i < aArguments.length; i++) {
- do_check_true(args[i].check(aArguments[i]), aMethodName + "(args[" + i + "]: " + args[i].name + ")");
- }
-
- if (this.expected.length === 0) {
- this.deferred.resolve();
- }
- },
-
- // nsINavBookmarkObserver
- onBeginUpdateBatch() {
- return this.validate("onBeginUpdateBatch", arguments);
- },
- onEndUpdateBatch() {
- return this.validate("onEndUpdateBatch", arguments);
- },
- onItemAdded() {
- return this.validate("onItemAdded", arguments);
- },
- onItemRemoved() {
- return this.validate("onItemRemoved", arguments);
- },
- onItemChanged() {
- return this.validate("onItemChanged", arguments);
- },
- onItemVisited() {
- return this.validate("onItemVisited", arguments);
- },
- onItemMoved() {
- return this.validate("onItemMoved", arguments);
- },
-
- // nsISupports
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver]),
-};
-
-var gBookmarkSkipObserver = {
- skipTags: true,
- skipDescendantsOnItemRemoval: true,
-
- expected: null,
- setup(expected) {
- this.expected = expected;
- this.deferred = PromiseUtils.defer();
- return this.deferred.promise;
- },
- validate: function (aMethodName) {
- do_check_eq(this.expected.shift(), aMethodName);
- if (this.expected.length === 0) {
- this.deferred.resolve();
- }
- },
-
- // nsINavBookmarkObserver
- onBeginUpdateBatch() {
- return this.validate("onBeginUpdateBatch", arguments);
- },
- onEndUpdateBatch() {
- return this.validate("onEndUpdateBatch", arguments);
- },
- onItemAdded() {
- return this.validate("onItemAdded", arguments);
- },
- onItemRemoved() {
- return this.validate("onItemRemoved", arguments);
- },
- onItemChanged() {
- return this.validate("onItemChanged", arguments);
- },
- onItemVisited() {
- return this.validate("onItemVisited", arguments);
- },
- onItemMoved() {
- return this.validate("onItemMoved", arguments);
- },
-
- // nsISupports
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver]),
-};
-
-
-add_task(function setup() {
- PlacesUtils.bookmarks.addObserver(gBookmarksObserver, false);
- PlacesUtils.bookmarks.addObserver(gBookmarkSkipObserver, false);
-});
-
-add_task(function* batch() {
- let promise = Promise.all([
- gBookmarksObserver.setup([
- { name: "onBeginUpdateBatch",
- args: [] },
- { name: "onEndUpdateBatch",
- args: [] },
- ]),
- gBookmarkSkipObserver.setup([
- "onBeginUpdateBatch", "onEndUpdateBatch"
- ])]);
- PlacesUtils.bookmarks.runInBatchMode({
- runBatched: function () {
- // Nothing.
- }
- }, null);
- yield promise;
-});
-
-add_task(function* onItemAdded_bookmark() {
- const TITLE = "Bookmark 1";
- let uri = NetUtil.newURI("http://1.mozilla.org/");
- let promise = Promise.all([
- gBookmarkSkipObserver.setup([
- "onItemAdded"
- ]),
- gBookmarksObserver.setup([
- { name: "onItemAdded",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => v === PlacesUtils.unfiledBookmarksFolderId },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "uri", check: v => v instanceof Ci.nsIURI && v.equals(uri) },
- { name: "title", check: v => v === TITLE },
- { name: "dateAdded", check: v => typeof(v) == "number" && v > 0 },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- ])]);
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- uri, PlacesUtils.bookmarks.DEFAULT_INDEX,
- TITLE);
- yield promise;
-});
-
-add_task(function* onItemAdded_separator() {
- let promise = Promise.all([
- gBookmarkSkipObserver.setup([
- "onItemAdded"
- ]),
- gBookmarksObserver.setup([
- { name: "onItemAdded",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => v === PlacesUtils.unfiledBookmarksFolderId },
- { name: "index", check: v => v === 1 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_SEPARATOR },
- { name: "uri", check: v => v === null },
- { name: "title", check: v => v === null },
- { name: "dateAdded", check: v => typeof(v) == "number" && v > 0 },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- ])]);
- PlacesUtils.bookmarks.insertSeparator(PlacesUtils.unfiledBookmarksFolderId,
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- yield promise;
-});
-
-add_task(function* onItemAdded_folder() {
- const TITLE = "Folder 1";
- let promise = Promise.all([
- gBookmarkSkipObserver.setup([
- "onItemAdded"
- ]),
- gBookmarksObserver.setup([
- { name: "onItemAdded",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => v === PlacesUtils.unfiledBookmarksFolderId },
- { name: "index", check: v => v === 2 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_FOLDER },
- { name: "uri", check: v => v === null },
- { name: "title", check: v => v === TITLE },
- { name: "dateAdded", check: v => typeof(v) == "number" && v > 0 },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- ])]);
- PlacesUtils.bookmarks.createFolder(PlacesUtils.unfiledBookmarksFolderId,
- TITLE,
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- yield promise;
-});
-
-add_task(function* onItemChanged_title_bookmark() {
- let id = PlacesUtils.bookmarks.getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId, 0);
- const TITLE = "New title";
- let promise = Promise.all([
- gBookmarkSkipObserver.setup([
- "onItemChanged"
- ]),
- gBookmarksObserver.setup([
- { name: "onItemChanged", // This is an unfortunate effect of bug 653910.
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "property", check: v => v === "title" },
- { name: "isAnno", check: v => v === false },
- { name: "newValue", check: v => v === TITLE },
- { name: "lastModified", check: v => typeof(v) == "number" && v > 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "parentId", check: v => v === PlacesUtils.unfiledBookmarksFolderId },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "oldValue", check: v => typeof(v) == "string" },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- ])]);
- PlacesUtils.bookmarks.setItemTitle(id, TITLE);
- yield promise;
-});
-
-add_task(function* onItemChanged_tags_bookmark() {
- let id = PlacesUtils.bookmarks.getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId, 0);
- let uri = PlacesUtils.bookmarks.getBookmarkURI(id);
- const TAG = "tag";
- let promise = Promise.all([
- gBookmarkSkipObserver.setup([
- "onItemChanged", "onItemChanged"
- ]),
- gBookmarksObserver.setup([
- { name: "onItemAdded", // This is the tag folder.
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => v === PlacesUtils.tagsFolderId },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_FOLDER },
- { name: "uri", check: v => v === null },
- { name: "title", check: v => v === TAG },
- { name: "dateAdded", check: v => typeof(v) == "number" && v > 0 },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemAdded", // This is the tag.
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => typeof(v) == "number" && v > 0 },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "uri", check: v => v instanceof Ci.nsIURI && v.equals(uri) },
- { name: "title", check: v => v === null },
- { name: "dateAdded", check: v => typeof(v) == "number" && v > 0 },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemChanged",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "property", check: v => v === "tags" },
- { name: "isAnno", check: v => v === false },
- { name: "newValue", check: v => v === "" },
- { name: "lastModified", check: v => typeof(v) == "number" && v > 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "parentId", check: v => v === PlacesUtils.unfiledBookmarksFolderId },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "oldValue", check: v => typeof(v) == "string" },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemRemoved", // This is the tag.
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => typeof(v) == "number" && v > 0 },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "uri", check: v => v instanceof Ci.nsIURI && v.equals(uri) },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemRemoved", // This is the tag folder.
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => v === PlacesUtils.tagsFolderId },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_FOLDER },
- { name: "uri", check: v => v === null },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemChanged",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "property", check: v => v === "tags" },
- { name: "isAnno", check: v => v === false },
- { name: "newValue", check: v => v === "" },
- { name: "lastModified", check: v => typeof(v) == "number" && v > 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "parentId", check: v => v === PlacesUtils.unfiledBookmarksFolderId },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "oldValue", check: v => typeof(v) == "string" },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- ])]);
- PlacesUtils.tagging.tagURI(uri, [TAG]);
- PlacesUtils.tagging.untagURI(uri, [TAG]);
- yield promise;
-});
-
-add_task(function* onItemMoved_bookmark() {
- let id = PlacesUtils.bookmarks.getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId, 0);
- let promise = Promise.all([
- gBookmarkSkipObserver.setup([
- "onItemMoved", "onItemMoved"
- ]),
- gBookmarksObserver.setup([
- { name: "onItemMoved",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "oldParentId", check: v => v === PlacesUtils.unfiledBookmarksFolderId },
- { name: "oldIndex", check: v => v === 0 },
- { name: "newParentId", check: v => v === PlacesUtils.toolbarFolderId },
- { name: "newIndex", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "oldParentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "newParentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemMoved",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "oldParentId", check: v => v === PlacesUtils.toolbarFolderId },
- { name: "oldIndex", check: v => v === 0 },
- { name: "newParentId", check: v => v === PlacesUtils.unfiledBookmarksFolderId },
- { name: "newIndex", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "oldParentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "newParentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- ])]);
- PlacesUtils.bookmarks.moveItem(id, PlacesUtils.toolbarFolderId, 0);
- PlacesUtils.bookmarks.moveItem(id, PlacesUtils.unfiledBookmarksFolderId, 0);
- yield promise;
-});
-
-add_task(function* onItemMoved_bookmark() {
- let id = PlacesUtils.bookmarks.getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId, 0);
- let uri = PlacesUtils.bookmarks.getBookmarkURI(id);
- let promise = Promise.all([
- gBookmarkSkipObserver.setup([
- "onItemVisited"
- ]),
- gBookmarksObserver.setup([
- { name: "onItemVisited",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "visitId", check: v => typeof(v) == "number" && v > 0 },
- { name: "time", check: v => typeof(v) == "number" && v > 0 },
- { name: "transitionType", check: v => v === PlacesUtils.history.TRANSITION_TYPED },
- { name: "uri", check: v => v instanceof Ci.nsIURI && v.equals(uri) },
- { name: "parentId", check: v => v === PlacesUtils.unfiledBookmarksFolderId },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- ] },
- ])]);
- PlacesTestUtils.addVisits({ uri: uri, transition: TRANSITION_TYPED });
- yield promise;
-});
-
-add_task(function* onItemRemoved_bookmark() {
- let id = PlacesUtils.bookmarks.getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId, 0);
- let uri = PlacesUtils.bookmarks.getBookmarkURI(id);
- let promise = Promise.all([
- gBookmarkSkipObserver.setup([
- "onItemChanged", "onItemRemoved"
- ]),
- gBookmarksObserver.setup([
- { name: "onItemChanged", // This is an unfortunate effect of bug 653910.
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "property", check: v => v === "" },
- { name: "isAnno", check: v => v === true },
- { name: "newValue", check: v => v === "" },
- { name: "lastModified", check: v => typeof(v) == "number" && v > 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "parentId", check: v => v === PlacesUtils.unfiledBookmarksFolderId },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "oldValue", check: v => typeof(v) == "string" },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemRemoved",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => v === PlacesUtils.unfiledBookmarksFolderId },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "uri", check: v => v instanceof Ci.nsIURI && v.equals(uri) },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- ])]);
- PlacesUtils.bookmarks.removeItem(id);
- yield promise;
-});
-
-add_task(function* onItemRemoved_separator() {
- let id = PlacesUtils.bookmarks.getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId, 0);
- let promise = Promise.all([
- gBookmarkSkipObserver.setup([
- "onItemChanged", "onItemRemoved"
- ]),
- gBookmarksObserver.setup([
- { name: "onItemChanged", // This is an unfortunate effect of bug 653910.
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "property", check: v => v === "" },
- { name: "isAnno", check: v => v === true },
- { name: "newValue", check: v => v === "" },
- { name: "lastModified", check: v => typeof(v) == "number" && v > 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_SEPARATOR },
- { name: "parentId", check: v => typeof(v) == "number" && v > 0 },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "oldValue", check: v => typeof(v) == "string" },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemRemoved",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => typeof(v) == "number" && v > 0 },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_SEPARATOR },
- { name: "uri", check: v => v === null },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- ])]);
- PlacesUtils.bookmarks.removeItem(id);
- yield promise;
-});
-
-add_task(function* onItemRemoved_folder() {
- let id = PlacesUtils.bookmarks.getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId, 0);
- let promise = Promise.all([
- gBookmarkSkipObserver.setup([
- "onItemChanged", "onItemRemoved"
- ]),
- gBookmarksObserver.setup([
- { name: "onItemChanged", // This is an unfortunate effect of bug 653910.
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "property", check: v => v === "" },
- { name: "isAnno", check: v => v === true },
- { name: "newValue", check: v => v === "" },
- { name: "lastModified", check: v => typeof(v) == "number" && v > 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_FOLDER },
- { name: "parentId", check: v => typeof(v) == "number" && v > 0 },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "oldValue", check: v => typeof(v) == "string" },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemRemoved",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => typeof(v) == "number" && v > 0 },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_FOLDER },
- { name: "uri", check: v => v === null },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- ])]);
- PlacesUtils.bookmarks.removeItem(id);
- yield promise;
-});
-
-add_task(function* onItemRemoved_folder_recursive() {
- const TITLE = "Folder 3";
- const BMTITLE = "Bookmark 1";
- let uri = NetUtil.newURI("http://1.mozilla.org/");
- let promise = Promise.all([
- gBookmarkSkipObserver.setup([
- "onItemAdded", "onItemAdded", "onItemAdded", "onItemAdded",
- "onItemChanged", "onItemRemoved"
- ]),
- gBookmarksObserver.setup([
- { name: "onItemAdded",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => v === PlacesUtils.unfiledBookmarksFolderId },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_FOLDER },
- { name: "uri", check: v => v === null },
- { name: "title", check: v => v === TITLE },
- { name: "dateAdded", check: v => typeof(v) == "number" && v > 0 },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemAdded",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => v === PlacesUtils.bookmarks.getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId, 0) },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "uri", check: v => v instanceof Ci.nsIURI && v.equals(uri) },
- { name: "title", check: v => v === BMTITLE },
- { name: "dateAdded", check: v => typeof(v) == "number" && v > 0 },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemAdded",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => v === PlacesUtils.bookmarks.getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId, 0) },
- { name: "index", check: v => v === 1 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_FOLDER },
- { name: "uri", check: v => v === null },
- { name: "title", check: v => v === TITLE },
- { name: "dateAdded", check: v => typeof(v) == "number" && v > 0 },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemAdded",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => v === PlacesUtils.bookmarks.getIdForItemAt(PlacesUtils.bookmarks.getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId, 0), 1) },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "uri", check: v => v instanceof Ci.nsIURI && v.equals(uri) },
- { name: "title", check: v => v === BMTITLE },
- { name: "dateAdded", check: v => typeof(v) == "number" && v > 0 },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemChanged", // This is an unfortunate effect of bug 653910.
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "property", check: v => v === "" },
- { name: "isAnno", check: v => v === true },
- { name: "newValue", check: v => v === "" },
- { name: "lastModified", check: v => typeof(v) == "number" && v > 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_FOLDER },
- { name: "parentId", check: v => typeof(v) == "number" && v > 0 },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "oldValue", check: v => typeof(v) == "string" },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemRemoved",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => typeof(v) == "number" && v > 0 },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "uri", check: v => v instanceof Ci.nsIURI && v.equals(uri) },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemRemoved",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => typeof(v) == "number" && v > 0 },
- { name: "index", check: v => v === 1 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_FOLDER },
- { name: "uri", check: v => v === null },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemRemoved",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => typeof(v) == "number" && v > 0 },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_BOOKMARK },
- { name: "uri", check: v => v instanceof Ci.nsIURI && v.equals(uri) },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- { name: "onItemRemoved",
- args: [
- { name: "itemId", check: v => typeof(v) == "number" && v > 0 },
- { name: "parentId", check: v => typeof(v) == "number" && v > 0 },
- { name: "index", check: v => v === 0 },
- { name: "itemType", check: v => v === PlacesUtils.bookmarks.TYPE_FOLDER },
- { name: "uri", check: v => v === null },
- { name: "guid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "parentGuid", check: v => typeof(v) == "string" && GUID_RE.test(v) },
- { name: "source", check: v => Object.values(PlacesUtils.bookmarks.SOURCES).includes(v) },
- ] },
- ])]);
- let folder = PlacesUtils.bookmarks.createFolder(PlacesUtils.unfiledBookmarksFolderId,
- TITLE,
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- PlacesUtils.bookmarks.insertBookmark(folder,
- uri, PlacesUtils.bookmarks.DEFAULT_INDEX,
- BMTITLE);
- let folder2 = PlacesUtils.bookmarks.createFolder(folder, TITLE,
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- PlacesUtils.bookmarks.insertBookmark(folder2,
- uri, PlacesUtils.bookmarks.DEFAULT_INDEX,
- BMTITLE);
-
- PlacesUtils.bookmarks.removeItem(folder);
- yield promise;
-});
-
-add_task(function cleanup()
-{
- PlacesUtils.bookmarks.removeObserver(gBookmarksObserver);
- PlacesUtils.bookmarks.removeObserver(gBookmarkSkipObserver);
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_protectRoots.js b/toolkit/components/places/tests/bookmarks/test_protectRoots.js
deleted file mode 100644
index 0a59f1653..000000000
--- a/toolkit/components/places/tests/bookmarks/test_protectRoots.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function run_test()
-{
- const ROOTS = [
- PlacesUtils.bookmarksMenuFolderId,
- PlacesUtils.toolbarFolderId,
- PlacesUtils.unfiledBookmarksFolderId,
- PlacesUtils.tagsFolderId,
- PlacesUtils.placesRootId,
- PlacesUtils.mobileFolderId,
- ];
-
- for (let root of ROOTS) {
- do_check_true(PlacesUtils.isRootItem(root));
-
- try {
- PlacesUtils.bookmarks.removeItem(root);
- do_throw("Trying to remove a root should throw");
- } catch (ex) {}
-
- try {
- PlacesUtils.bookmarks.moveItem(root, PlacesUtils.placesRootId, 0);
- do_throw("Trying to move a root should throw");
- } catch (ex) {}
-
- try {
- PlacesUtils.bookmarks.removeFolderChildren(root);
- if (root == PlacesUtils.placesRootId)
- do_throw("Trying to remove children of the main root should throw");
- } catch (ex) {
- if (root != PlacesUtils.placesRootId)
- do_throw("Trying to remove children of other roots should not throw");
- }
- }
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_removeFolderTransaction_reinsert.js b/toolkit/components/places/tests/bookmarks/test_removeFolderTransaction_reinsert.js
deleted file mode 100644
index 537974b38..000000000
--- a/toolkit/components/places/tests/bookmarks/test_removeFolderTransaction_reinsert.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * This test ensures that reinserting a folder within a transaction gives it
- * a different GUID, and passes the GUID to the observers.
- */
-
-add_task(function* test_removeFolderTransaction_reinsert() {
- let folder = yield PlacesUtils.bookmarks.insert({
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- title: "Test folder",
- });
- let folderId = yield PlacesUtils.promiseItemId(folder.guid);
- let fx = yield PlacesUtils.bookmarks.insert({
- parentGuid: folder.guid,
- title: "Get Firefox!",
- url: "http://getfirefox.com",
- });
- let fxId = yield PlacesUtils.promiseItemId(fx.guid);
- let tb = yield PlacesUtils.bookmarks.insert({
- parentGuid: folder.guid,
- title: "Get Thunderbird!",
- url: "http://getthunderbird.com",
- });
- let tbId = yield PlacesUtils.promiseItemId(tb.guid);
-
- let notifications = [];
- function checkNotifications(expected, message) {
- deepEqual(notifications, expected, message);
- notifications.length = 0;
- }
-
- let observer = {
- onItemAdded(itemId, parentId, index, type, uri, title, dateAdded, guid,
- parentGuid) {
- notifications.push(["onItemAdded", itemId, parentId, guid, parentGuid]);
- },
- onItemRemoved(itemId, parentId, index, type, uri, guid, parentGuid) {
- notifications.push(["onItemRemoved", itemId, parentId, guid, parentGuid]);
- },
- };
- PlacesUtils.bookmarks.addObserver(observer, false);
- PlacesUtils.registerShutdownFunction(function() {
- PlacesUtils.bookmarks.removeObserver(observer);
- });
-
- let transaction = PlacesUtils.bookmarks.getRemoveFolderTransaction(folderId);
- deepEqual(notifications, [], "We haven't executed the transaction yet");
-
- transaction.doTransaction();
- checkNotifications([
- ["onItemRemoved", tbId, folderId, tb.guid, folder.guid],
- ["onItemRemoved", fxId, folderId, fx.guid, folder.guid],
- ["onItemRemoved", folderId, PlacesUtils.bookmarksMenuFolderId, folder.guid,
- PlacesUtils.bookmarks.menuGuid],
- ], "Executing transaction should remove folder and its descendants");
-
- transaction.undoTransaction();
- // At this point, the restored folder has the same ID, but a different GUID.
- let newFolderGuid = yield PlacesUtils.promiseItemGuid(folderId);
- checkNotifications([
- ["onItemAdded", folderId, PlacesUtils.bookmarksMenuFolderId, newFolderGuid,
- PlacesUtils.bookmarks.menuGuid],
- ], "Undo should reinsert folder with same ID and different GUID");
-
- transaction.redoTransaction();
- checkNotifications([
- ["onItemRemoved", folderId, PlacesUtils.bookmarksMenuFolderId,
- newFolderGuid, PlacesUtils.bookmarks.menuGuid],
- ], "Redo should forward new GUID to observer");
-});
diff --git a/toolkit/components/places/tests/bookmarks/test_removeItem.js b/toolkit/components/places/tests/bookmarks/test_removeItem.js
deleted file mode 100644
index ec846b28e..000000000
--- a/toolkit/components/places/tests/bookmarks/test_removeItem.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var tests = [];
-
-
-const DEFAULT_INDEX = PlacesUtils.bookmarks.DEFAULT_INDEX;
-
-function run_test() {
- // folder to hold this test
- var folderId =
- PlacesUtils.bookmarks.createFolder(PlacesUtils.toolbarFolderId,
- "", DEFAULT_INDEX);
-
- // add a bookmark to the new folder
- var bookmarkURI = uri("http://iasdjkf");
- do_check_false(PlacesUtils.bookmarks.isBookmarked(bookmarkURI));
- var bookmarkId = PlacesUtils.bookmarks.insertBookmark(folderId, bookmarkURI,
- DEFAULT_INDEX, "");
- do_check_eq(PlacesUtils.bookmarks.getItemTitle(bookmarkId), "");
-
- // remove the folder using removeItem
- PlacesUtils.bookmarks.removeItem(folderId);
- do_check_eq(PlacesUtils.bookmarks.getBookmarkIdsForURI(bookmarkURI).length, 0);
- do_check_false(PlacesUtils.bookmarks.isBookmarked(bookmarkURI));
- do_check_eq(PlacesUtils.bookmarks.getItemIndex(bookmarkId), -1);
-}
diff --git a/toolkit/components/places/tests/bookmarks/test_savedsearches.js b/toolkit/components/places/tests/bookmarks/test_savedsearches.js
deleted file mode 100644
index eee2c4489..000000000
--- a/toolkit/components/places/tests/bookmarks/test_savedsearches.js
+++ /dev/null
@@ -1,209 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// get bookmarks root id
-var root = PlacesUtils.bookmarksMenuFolderId;
-
-// a search term that matches a default bookmark
-const searchTerm = "about";
-
-var testRoot;
-
-// main
-function run_test() {
- // create a folder to hold all the tests
- // this makes the tests more tolerant of changes to the default bookmarks set
- // also, name it using the search term, for testing that containers that match don't show up in query results
- testRoot = PlacesUtils.bookmarks.createFolder(
- root, searchTerm, PlacesUtils.bookmarks.DEFAULT_INDEX);
-
- run_next_test();
-}
-
-add_test(function test_savedsearches_bookmarks() {
- // add a bookmark that matches the search term
- var bookmarkId = PlacesUtils.bookmarks.insertBookmark(
- root, uri("http://foo.com"), PlacesUtils.bookmarks.DEFAULT_INDEX,
- searchTerm);
-
- // create a saved-search that matches a default bookmark
- var searchId = PlacesUtils.bookmarks.insertBookmark(
- testRoot, uri("place:terms=" + searchTerm + "&excludeQueries=1&expandQueries=1&queryType=1"),
- PlacesUtils.bookmarks.DEFAULT_INDEX, searchTerm);
-
- // query for the test root, expandQueries=0
- // the query should show up as a regular bookmark
- try {
- let options = PlacesUtils.history.getNewQueryOptions();
- options.expandQueries = 0;
- let query = PlacesUtils.history.getNewQuery();
- query.setFolders([testRoot], 1);
- let result = PlacesUtils.history.executeQuery(query, options);
- let rootNode = result.root;
- rootNode.containerOpen = true;
- let cc = rootNode.childCount;
- do_check_eq(cc, 1);
- for (let i = 0; i < cc; i++) {
- let node = rootNode.getChild(i);
- // test that queries have valid itemId
- do_check_true(node.itemId > 0);
- // test that the container is closed
- node.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- do_check_eq(node.containerOpen, false);
- }
- rootNode.containerOpen = false;
- }
- catch (ex) {
- do_throw("expandQueries=0 query error: " + ex);
- }
-
- // bookmark saved search
- // query for the test root, expandQueries=1
- // the query should show up as a query container, with 1 child
- try {
- let options = PlacesUtils.history.getNewQueryOptions();
- options.expandQueries = 1;
- let query = PlacesUtils.history.getNewQuery();
- query.setFolders([testRoot], 1);
- let result = PlacesUtils.history.executeQuery(query, options);
- let rootNode = result.root;
- rootNode.containerOpen = true;
- let cc = rootNode.childCount;
- do_check_eq(cc, 1);
- for (let i = 0; i < cc; i++) {
- let node = rootNode.getChild(i);
- // test that query node type is container when expandQueries=1
- do_check_eq(node.type, node.RESULT_TYPE_QUERY);
- // test that queries (as containers) have valid itemId
- do_check_true(node.itemId > 0);
- node.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- node.containerOpen = true;
-
- // test that queries have children when excludeItems=1
- // test that query nodes don't show containers (shouldn't have our folder that matches)
- // test that queries don't show themselves in query results (shouldn't have our saved search)
- do_check_eq(node.childCount, 1);
-
- // test that bookmark shows in query results
- var item = node.getChild(0);
- do_check_eq(item.itemId, bookmarkId);
-
- // XXX - FAILING - test live-update of query results - add a bookmark that matches the query
- // var tmpBmId = PlacesUtils.bookmarks.insertBookmark(
- // root, uri("http://" + searchTerm + ".com"),
- // PlacesUtils.bookmarks.DEFAULT_INDEX, searchTerm + "blah");
- // do_check_eq(query.childCount, 2);
-
- // XXX - test live-update of query results - delete a bookmark that matches the query
- // PlacesUtils.bookmarks.removeItem(tmpBMId);
- // do_check_eq(query.childCount, 1);
-
- // test live-update of query results - add a folder that matches the query
- PlacesUtils.bookmarks.createFolder(
- root, searchTerm + "zaa", PlacesUtils.bookmarks.DEFAULT_INDEX);
- do_check_eq(node.childCount, 1);
- // test live-update of query results - add a query that matches the query
- PlacesUtils.bookmarks.insertBookmark(
- root, uri("place:terms=foo&excludeQueries=1&expandQueries=1&queryType=1"),
- PlacesUtils.bookmarks.DEFAULT_INDEX, searchTerm + "blah");
- do_check_eq(node.childCount, 1);
- }
- rootNode.containerOpen = false;
- }
- catch (ex) {
- do_throw("expandQueries=1 bookmarks query: " + ex);
- }
-
- // delete the bookmark search
- PlacesUtils.bookmarks.removeItem(searchId);
-
- run_next_test();
-});
-
-add_task(function* test_savedsearches_history() {
- // add a visit that matches the search term
- var testURI = uri("http://" + searchTerm + ".com");
- yield PlacesTestUtils.addVisits({ uri: testURI, title: searchTerm });
-
- // create a saved-search that matches the visit we added
- var searchId = PlacesUtils.bookmarks.insertBookmark(testRoot,
- uri("place:terms=" + searchTerm + "&excludeQueries=1&expandQueries=1&queryType=0"),
- PlacesUtils.bookmarks.DEFAULT_INDEX, searchTerm);
-
- // query for the test root, expandQueries=1
- // the query should show up as a query container, with 1 child
- try {
- var options = PlacesUtils.history.getNewQueryOptions();
- options.expandQueries = 1;
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([testRoot], 1);
- var result = PlacesUtils.history.executeQuery(query, options);
- var rootNode = result.root;
- rootNode.containerOpen = true;
- var cc = rootNode.childCount;
- do_check_eq(cc, 1);
- for (var i = 0; i < cc; i++) {
- var node = rootNode.getChild(i);
- // test that query node type is container when expandQueries=1
- do_check_eq(node.type, node.RESULT_TYPE_QUERY);
- // test that queries (as containers) have valid itemId
- do_check_eq(node.itemId, searchId);
- node.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- node.containerOpen = true;
-
- // test that queries have children when excludeItems=1
- // test that query nodes don't show containers (shouldn't have our folder that matches)
- // test that queries don't show themselves in query results (shouldn't have our saved search)
- do_check_eq(node.childCount, 1);
-
- // test that history visit shows in query results
- var item = node.getChild(0);
- do_check_eq(item.type, item.RESULT_TYPE_URI);
- do_check_eq(item.itemId, -1); // history visit
- do_check_eq(item.uri, testURI.spec); // history visit
-
- // test live-update of query results - add a history visit that matches the query
- yield PlacesTestUtils.addVisits({
- uri: uri("http://foo.com"),
- title: searchTerm + "blah"
- });
- do_check_eq(node.childCount, 2);
-
- // test live-update of query results - delete a history visit that matches the query
- PlacesUtils.history.removePage(uri("http://foo.com"));
- do_check_eq(node.childCount, 1);
- node.containerOpen = false;
- }
-
- // test live-update of moved queries
- var tmpFolderId = PlacesUtils.bookmarks.createFolder(
- testRoot, "foo", PlacesUtils.bookmarks.DEFAULT_INDEX);
- PlacesUtils.bookmarks.moveItem(
- searchId, tmpFolderId, PlacesUtils.bookmarks.DEFAULT_INDEX);
- var tmpFolderNode = rootNode.getChild(0);
- do_check_eq(tmpFolderNode.itemId, tmpFolderId);
- tmpFolderNode.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- tmpFolderNode.containerOpen = true;
- do_check_eq(tmpFolderNode.childCount, 1);
-
- // test live-update of renamed queries
- PlacesUtils.bookmarks.setItemTitle(searchId, "foo");
- do_check_eq(tmpFolderNode.title, "foo");
-
- // test live-update of deleted queries
- PlacesUtils.bookmarks.removeItem(searchId);
- try {
- tmpFolderNode = root.getChild(1);
- do_throw("query was not removed");
- } catch (ex) {}
-
- tmpFolderNode.containerOpen = false;
- rootNode.containerOpen = false;
- }
- catch (ex) {
- do_throw("expandQueries=1 bookmarks query: " + ex);
- }
-});
diff --git a/toolkit/components/places/tests/bookmarks/xpcshell.ini b/toolkit/components/places/tests/bookmarks/xpcshell.ini
deleted file mode 100644
index c290fd693..000000000
--- a/toolkit/components/places/tests/bookmarks/xpcshell.ini
+++ /dev/null
@@ -1,50 +0,0 @@
-[DEFAULT]
-head = head_bookmarks.js
-tail =
-skip-if = toolkit == 'android'
-
-[test_1016953-renaming-uncompressed.js]
-[test_1017502-bookmarks_foreign_count.js]
-[test_384228.js]
-[test_385829.js]
-[test_388695.js]
-[test_393498.js]
-[test_395101.js]
-[test_395593.js]
-[test_405938_restore_queries.js]
-[test_417228-exclude-from-backup.js]
-[test_417228-other-roots.js]
-[test_424958-json-quoted-folders.js]
-[test_448584.js]
-[test_458683.js]
-[test_466303-json-remove-backups.js]
-[test_477583_json-backup-in-future.js]
-[test_675416.js]
-[test_711914.js]
-[test_818584-discard-duplicate-backups.js]
-[test_818587_compress-bookmarks-backups.js]
-[test_818593-store-backup-metadata.js]
-[test_992901-backup-unsorted-hierarchy.js]
-[test_997030-bookmarks-html-encode.js]
-[test_1129529.js]
-[test_async_observers.js]
-[test_bmindex.js]
-[test_bookmarkstree_cache.js]
-[test_bookmarks.js]
-[test_bookmarks_eraseEverything.js]
-[test_bookmarks_fetch.js]
-[test_bookmarks_getRecent.js]
-[test_bookmarks_insert.js]
-[test_bookmarks_notifications.js]
-[test_bookmarks_remove.js]
-[test_bookmarks_reorder.js]
-[test_bookmarks_search.js]
-[test_bookmarks_update.js]
-[test_changeBookmarkURI.js]
-[test_getBookmarkedURIFor.js]
-[test_keywords.js]
-[test_nsINavBookmarkObserver.js]
-[test_protectRoots.js]
-[test_removeFolderTransaction_reinsert.js]
-[test_removeItem.js]
-[test_savedsearches.js]
diff --git a/toolkit/components/places/tests/browser/.eslintrc.js b/toolkit/components/places/tests/browser/.eslintrc.js
deleted file mode 100644
index 7a41a9cde..000000000
--- a/toolkit/components/places/tests/browser/.eslintrc.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/browser.eslintrc.js",
- "../../../../../testing/mochitest/mochitest.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/places/tests/browser/399606-history.go-0.html b/toolkit/components/places/tests/browser/399606-history.go-0.html
deleted file mode 100644
index 039708ed7..000000000
--- a/toolkit/components/places/tests/browser/399606-history.go-0.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<head>
-<title>history.go(0)</title>
-<script>
-setTimeout('history.go(0)', 1000);
-</script>
-</head>
-<body>
-Testing history.go(0)
-</body>
-</html>
diff --git a/toolkit/components/places/tests/browser/399606-httprefresh.html b/toolkit/components/places/tests/browser/399606-httprefresh.html
deleted file mode 100644
index e43455ee0..000000000
--- a/toolkit/components/places/tests/browser/399606-httprefresh.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<html><head>
-<meta http-equiv="content-type" content="text/html; charset=UTF-8">
-
-<meta http-equiv="refresh" content="1">
-<title>httprefresh</title>
-</head><body>
-Testing httprefresh
-</body></html>
diff --git a/toolkit/components/places/tests/browser/399606-location.reload.html b/toolkit/components/places/tests/browser/399606-location.reload.html
deleted file mode 100644
index 0f46538cd..000000000
--- a/toolkit/components/places/tests/browser/399606-location.reload.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<head>
-<title>location.reload()</title>
-<script>
-setTimeout('location.reload();', 100);
-</script>
-</head>
-<body>
-Testing location.reload();
-</body>
-</html>
diff --git a/toolkit/components/places/tests/browser/399606-location.replace.html b/toolkit/components/places/tests/browser/399606-location.replace.html
deleted file mode 100644
index 36705402c..000000000
--- a/toolkit/components/places/tests/browser/399606-location.replace.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<head>
-<title>location.replace</title>
-<script>
-setTimeout('location.replace(window.location.href)', 1000);
-</script>
-</head>
-<body>
-Testing location.replace
-</body>
-</html>
diff --git a/toolkit/components/places/tests/browser/399606-window.location.href.html b/toolkit/components/places/tests/browser/399606-window.location.href.html
deleted file mode 100644
index 61a2c8ba0..000000000
--- a/toolkit/components/places/tests/browser/399606-window.location.href.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<head>
-<title>window.location.href</title>
-<script>
-setTimeout('window.location.href = window.location.href', 1000);
-</script>
-</head>
-<body>
-Testing window.location.href
-</body>
-</html>
diff --git a/toolkit/components/places/tests/browser/399606-window.location.html b/toolkit/components/places/tests/browser/399606-window.location.html
deleted file mode 100644
index e77f73071..000000000
--- a/toolkit/components/places/tests/browser/399606-window.location.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<html>
-<head>
-<title>window.location</title>
-<script>
-setTimeout('window.location = window.location', 1000);
-</script>
-</head>
-<body>
-Testing window.location
-</body>
-</html>
diff --git a/toolkit/components/places/tests/browser/461710_iframe.html b/toolkit/components/places/tests/browser/461710_iframe.html
deleted file mode 100644
index 7480fe58f..000000000
--- a/toolkit/components/places/tests/browser/461710_iframe.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<!DOCTYPE HTML>
-<html>
- <head>
- </head>
- <body>
- <iframe id="iframe"></iframe>
- </body>
-</html>
diff --git a/toolkit/components/places/tests/browser/461710_link_page-2.html b/toolkit/components/places/tests/browser/461710_link_page-2.html
deleted file mode 100644
index 1fc3e0959..000000000
--- a/toolkit/components/places/tests/browser/461710_link_page-2.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML>
-<html>
- <head>
- <title>Link page 2</title>
- <style type="text/css">
- a:link { color: #0000ff; }
- a:visited { color: #ff0000; }
- </style>
- </head>
- <body>
- <p><a href="461710_visited_page.html" id="link">Link to the second visited page</a></p>
- </body>
-</html> \ No newline at end of file
diff --git a/toolkit/components/places/tests/browser/461710_link_page-3.html b/toolkit/components/places/tests/browser/461710_link_page-3.html
deleted file mode 100644
index 596661803..000000000
--- a/toolkit/components/places/tests/browser/461710_link_page-3.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML>
-<html>
- <head>
- <title>Link page 3</title>
- <style type="text/css">
- a:link { color: #0000ff; }
- a:visited { color: #ff0000; }
- </style>
- </head>
- <body>
- <p><a href="461710_visited_page.html" id="link">Link to the third visited page</a></p>
- </body>
-</html> \ No newline at end of file
diff --git a/toolkit/components/places/tests/browser/461710_link_page.html b/toolkit/components/places/tests/browser/461710_link_page.html
deleted file mode 100644
index 6bea50628..000000000
--- a/toolkit/components/places/tests/browser/461710_link_page.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE HTML>
-<html>
- <head>
- <title>Link page</title>
- <style type="text/css">
- a:link { color: #0000ff; }
- a:visited { color: #ff0000; }
- </style>
- </head>
- <body>
- <p><a href="461710_visited_page.html" id="link">Link to the visited page</a></p>
- </body>
-</html> \ No newline at end of file
diff --git a/toolkit/components/places/tests/browser/461710_visited_page.html b/toolkit/components/places/tests/browser/461710_visited_page.html
deleted file mode 100644
index 90e65116b..000000000
--- a/toolkit/components/places/tests/browser/461710_visited_page.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE HTML>
-<html>
- <head>
- <title>Visited page</title>
- </head>
- <body>
- <p>This page is marked as visited</p>
- </body>
-</html> \ No newline at end of file
diff --git a/toolkit/components/places/tests/browser/begin.html b/toolkit/components/places/tests/browser/begin.html
deleted file mode 100644
index da4c16dd2..000000000
--- a/toolkit/components/places/tests/browser/begin.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!--
- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
--->
-
-<html>
- <body>
- <a id="clickme" href="redirect_twice.sjs">Redirect twice</a>
- </body>
-</html>
diff --git a/toolkit/components/places/tests/browser/browser.ini b/toolkit/components/places/tests/browser/browser.ini
deleted file mode 100644
index e6abe987f..000000000
--- a/toolkit/components/places/tests/browser/browser.ini
+++ /dev/null
@@ -1,26 +0,0 @@
-[DEFAULT]
-support-files =
- colorAnalyzer/category-discover.png
- colorAnalyzer/dictionaryGeneric-16.png
- colorAnalyzer/extensionGeneric-16.png
- colorAnalyzer/localeGeneric.png
- head.js
-
-[browser_bug248970.js]
-[browser_bug399606.js]
-[browser_bug461710.js]
-[browser_bug646422.js]
-[browser_bug680727.js]
-[browser_colorAnalyzer.js]
-[browser_double_redirect.js]
-[browser_favicon_privatebrowsing_perwindowpb.js]
-[browser_favicon_setAndFetchFaviconForPage.js]
-[browser_favicon_setAndFetchFaviconForPage_failures.js]
-[browser_history_post.js]
-[browser_notfound.js]
-[browser_redirect.js]
-[browser_settitle.js]
-[browser_visited_notfound.js]
-[browser_visituri.js]
-[browser_visituri_nohistory.js]
-[browser_visituri_privatebrowsing_perwindowpb.js] \ No newline at end of file
diff --git a/toolkit/components/places/tests/browser/browser_bug248970.js b/toolkit/components/places/tests/browser/browser_bug248970.js
deleted file mode 100644
index 5850a3038..000000000
--- a/toolkit/components/places/tests/browser/browser_bug248970.js
+++ /dev/null
@@ -1,152 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// This test performs checks on the history testing area as outlined
-// https://wiki.mozilla.org/Firefox3.1/PrivateBrowsing/TestPlan#History
-// http://developer.mozilla.org/en/Using_the_Places_history_service
-
-var visitedURIs = [
- "http://www.test-link.com/",
- "http://www.test-typed.com/",
- "http://www.test-bookmark.com/",
- "http://www.test-redirect-permanent.com/",
- "http://www.test-redirect-temporary.com/",
- "http://www.test-embed.com/",
- "http://www.test-framed.com/",
- "http://www.test-download.com/"
-].map(NetUtil.newURI.bind(NetUtil));
-
-add_task(function* () {
- let windowsToClose = [];
- let placeItemsCount = 0;
-
- registerCleanupFunction(function() {
- windowsToClose.forEach(function(win) {
- win.close();
- });
- });
-
- yield PlacesTestUtils.clearHistory();
-
- // Ensure we wait for the default bookmarks import.
- yield new Promise(resolve => {
- waitForCondition(() => {
- placeItemsCount = getPlacesItemsCount();
- return placeItemsCount > 0
- }, resolve, "Should have default bookmarks")
- });
-
- // Create a handful of history items with various visit types
- yield PlacesTestUtils.addVisits([
- { uri: visitedURIs[0], transition: TRANSITION_LINK },
- { uri: visitedURIs[1], transition: TRANSITION_TYPED },
- { uri: visitedURIs[2], transition: TRANSITION_BOOKMARK },
- { uri: visitedURIs[3], transition: TRANSITION_REDIRECT_PERMANENT },
- { uri: visitedURIs[4], transition: TRANSITION_REDIRECT_TEMPORARY },
- { uri: visitedURIs[5], transition: TRANSITION_EMBED },
- { uri: visitedURIs[6], transition: TRANSITION_FRAMED_LINK },
- { uri: visitedURIs[7], transition: TRANSITION_DOWNLOAD }
- ]);
-
- placeItemsCount += 7;
- // We added 7 new items to history.
- is(getPlacesItemsCount(), placeItemsCount,
- "Check the total items count");
-
- function* testOnWindow(aIsPrivate, aCount) {
- let win = yield new Promise(resolve => {
- whenNewWindowLoaded({ private: aIsPrivate }, resolve);
- });
- windowsToClose.push(win);
-
- // History items should be retrievable by query
- yield checkHistoryItems();
-
- // Updates the place items count
- let count = getPlacesItemsCount();
-
- // Create Bookmark
- let title = "title " + windowsToClose.length;
- let keyword = "keyword " + windowsToClose.length;
- let url = "http://test-a-" + windowsToClose.length + ".com/";
-
- yield PlacesUtils.bookmarks.insert({ url, title,
- parentGuid: PlacesUtils.bookmarks.menuGuid });
- yield PlacesUtils.keywords.insert({ url, keyword });
- count++;
-
- ok((yield PlacesUtils.bookmarks.fetch({ url })),
- "Bookmark should be bookmarked, data should be retrievable");
- is(getPlacesItemsCount(), count,
- "Check the new bookmark items count");
- is(isBookmarkAltered(), false, "Check if bookmark has been visited");
- }
-
- // Test on windows.
- yield testOnWindow(false);
- yield testOnWindow(true);
- yield testOnWindow(false);
-});
-
-/**
- * Function performs a really simple query on our places entries,
- * and makes sure that the number of entries equal num_places_entries.
- */
-function getPlacesItemsCount() {
- // Get bookmarks count
- let options = PlacesUtils.history.getNewQueryOptions();
- options.includeHidden = true;
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
- let root = PlacesUtils.history.executeQuery(
- PlacesUtils.history.getNewQuery(), options).root;
- root.containerOpen = true;
- let cc = root.childCount;
- root.containerOpen = false;
-
- // Get history item count
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_HISTORY;
- root = PlacesUtils.history.executeQuery(
- PlacesUtils.history.getNewQuery(), options).root;
- root.containerOpen = true;
- cc += root.childCount;
- root.containerOpen = false;
-
- return cc;
-}
-
-function* checkHistoryItems() {
- for (let i = 0; i < visitedURIs.length; i++) {
- let visitedUri = visitedURIs[i];
- ok((yield promiseIsURIVisited(visitedUri)), "");
- if (/embed/.test(visitedUri.spec)) {
- is((yield PlacesTestUtils.isPageInDB(visitedUri)), false, "Check if URI is in database");
- } else {
- ok((yield PlacesTestUtils.isPageInDB(visitedUri)), "Check if URI is in database");
- }
- }
-}
-
-/**
- * Function attempts to check if Bookmark-A has been visited
- * during private browsing mode, function should return false
- *
- * @returns false if the accessCount has not changed
- * true if the accessCount has changed
- */
-function isBookmarkAltered() {
- let options = PlacesUtils.history.getNewQueryOptions();
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
- options.maxResults = 1; // should only expect a new bookmark
-
- let query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.bookmarksMenuFolder], 1);
-
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- is(root.childCount, options.maxResults, "Check new bookmarks results");
- let node = root.getChild(0);
- root.containerOpen = false;
-
- return (node.accessCount != 0);
-}
diff --git a/toolkit/components/places/tests/browser/browser_bug399606.js b/toolkit/components/places/tests/browser/browser_bug399606.js
deleted file mode 100644
index b5eee0f92..000000000
--- a/toolkit/components/places/tests/browser/browser_bug399606.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-gBrowser.selectedTab = gBrowser.addTab();
-
-function test() {
- waitForExplicitFinish();
-
- var URIs = [
- "http://example.com/tests/toolkit/components/places/tests/browser/399606-window.location.href.html",
- "http://example.com/tests/toolkit/components/places/tests/browser/399606-history.go-0.html",
- "http://example.com/tests/toolkit/components/places/tests/browser/399606-location.replace.html",
- "http://example.com/tests/toolkit/components/places/tests/browser/399606-location.reload.html",
- "http://example.com/tests/toolkit/components/places/tests/browser/399606-httprefresh.html",
- "http://example.com/tests/toolkit/components/places/tests/browser/399606-window.location.html",
- ];
- var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-
- // Create and add history observer.
- var historyObserver = {
- visitCount: Array(),
- onBeginUpdateBatch: function () {},
- onEndUpdateBatch: function () {},
- onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID,
- aTransitionType) {
- info("Received onVisit: " + aURI.spec);
- if (aURI.spec in this.visitCount)
- this.visitCount[aURI.spec]++;
- else
- this.visitCount[aURI.spec] = 1;
- },
- onTitleChanged: function () {},
- onDeleteURI: function () {},
- onClearHistory: function () {},
- onPageChanged: function () {},
- onDeleteVisits: function () {},
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver])
- };
- hs.addObserver(historyObserver, false);
-
- function confirm_results() {
- gBrowser.removeCurrentTab();
- hs.removeObserver(historyObserver, false);
- for (let aURI in historyObserver.visitCount) {
- is(historyObserver.visitCount[aURI], 1,
- "onVisit has been received right number of times for " + aURI);
- }
- PlacesTestUtils.clearHistory().then(finish);
- }
-
- var loadCount = 0;
- function handleLoad(aEvent) {
- loadCount++;
- info("new load count is " + loadCount);
-
- if (loadCount == 3) {
- gBrowser.removeEventListener("DOMContentLoaded", handleLoad, true);
- gBrowser.loadURI("about:blank");
- executeSoon(check_next_uri);
- }
- }
-
- function check_next_uri() {
- if (URIs.length) {
- let uri = URIs.shift();
- loadCount = 0;
- gBrowser.addEventListener("DOMContentLoaded", handleLoad, true);
- gBrowser.loadURI(uri);
- }
- else {
- confirm_results();
- }
- }
- executeSoon(check_next_uri);
-}
diff --git a/toolkit/components/places/tests/browser/browser_bug461710.js b/toolkit/components/places/tests/browser/browser_bug461710.js
deleted file mode 100644
index 12af87a06..000000000
--- a/toolkit/components/places/tests/browser/browser_bug461710.js
+++ /dev/null
@@ -1,82 +0,0 @@
-const kRed = "rgb(255, 0, 0)";
-const kBlue = "rgb(0, 0, 255)";
-
-const prefix = "http://example.com/tests/toolkit/components/places/tests/browser/461710_";
-
-add_task(function* () {
- let contentPage = prefix + "iframe.html";
- let normalWindow = yield BrowserTestUtils.openNewBrowserWindow();
-
- let browser = normalWindow.gBrowser.selectedBrowser;
- BrowserTestUtils.loadURI(browser, contentPage);
- yield BrowserTestUtils.browserLoaded(browser, contentPage);
-
- let privateWindow = yield BrowserTestUtils.openNewBrowserWindow({private: true});
-
- browser = privateWindow.gBrowser.selectedBrowser;
- BrowserTestUtils.loadURI(browser, contentPage);
- yield BrowserTestUtils.browserLoaded(browser, contentPage);
-
- let tests = [{
- win: normalWindow,
- topic: "uri-visit-saved",
- subtest: "visited_page.html"
- }, {
- win: normalWindow,
- topic: "visited-status-resolution",
- subtest: "link_page.html",
- color: kRed,
- message: "Visited link coloring should work outside of private mode"
- }, {
- win: privateWindow,
- topic: "visited-status-resolution",
- subtest: "link_page-2.html",
- color: kBlue,
- message: "Visited link coloring should not work inside of private mode"
- }, {
- win: normalWindow,
- topic: "visited-status-resolution",
- subtest: "link_page-3.html",
- color: kRed,
- message: "Visited link coloring should work outside of private mode"
- }];
-
- let visited_page_url = prefix + tests[0].subtest;
- for (let test of tests) {
- let promise = new Promise(resolve => {
- let uri = NetUtil.newURI(visited_page_url);
- Services.obs.addObserver(function observe(aSubject) {
- if (uri.equals(aSubject.QueryInterface(Ci.nsIURI))) {
- Services.obs.removeObserver(observe, test.topic);
- resolve();
- }
- }, test.topic, false);
- });
- ContentTask.spawn(test.win.gBrowser.selectedBrowser, prefix + test.subtest, function* (aSrc) {
- content.document.getElementById("iframe").src = aSrc;
- });
- yield promise;
-
- if (test.color) {
- // In e10s waiting for visited-status-resolution is not enough to ensure links
- // have been updated, because it only tells us that messages to update links
- // have been dispatched. We must still wait for the actual links to update.
- yield BrowserTestUtils.waitForCondition(function* () {
- let color = yield ContentTask.spawn(test.win.gBrowser.selectedBrowser, null, function* () {
- let iframe = content.document.getElementById("iframe");
- let elem = iframe.contentDocument.getElementById("link");
- return content.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils)
- .getVisitedDependentComputedStyle(elem, "", "color");
- });
- return (color == test.color);
- }, test.message);
- // The harness will consider the test as failed overall if there were no
- // passes or failures, so record it as a pass.
- ok(true, test.message);
- }
- }
-
- yield BrowserTestUtils.closeWindow(normalWindow);
- yield BrowserTestUtils.closeWindow(privateWindow);
-});
diff --git a/toolkit/components/places/tests/browser/browser_bug646422.js b/toolkit/components/places/tests/browser/browser_bug646422.js
deleted file mode 100644
index 1a81de4e1..000000000
--- a/toolkit/components/places/tests/browser/browser_bug646422.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test for Bug 646224. Make sure that after changing the URI via
- * history.pushState, the history service has a title stored for the new URI.
- **/
-
-add_task(function* () {
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, 'http://example.com');
-
- let newTitlePromise = new Promise(resolve => {
- let observer = {
- onTitleChanged: function(uri, title) {
- // If the uri of the page whose title is changing ends with 'new_page',
- // then it's the result of our pushState.
- if (/new_page$/.test(uri.spec)) {
- resolve(title);
- PlacesUtils.history.removeObserver(observer);
- }
- },
-
- onBeginUpdateBatch: function() { },
- onEndUpdateBatch: function() { },
- onVisit: function() { },
- onDeleteURI: function() { },
- onClearHistory: function() { },
- onPageChanged: function() { },
- onDeleteVisits: function() { },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver])
- };
-
- PlacesUtils.history.addObserver(observer, false);
- });
-
- yield ContentTask.spawn(tab.linkedBrowser, null, function* () {
- let title = content.document.title;
- content.history.pushState('', '', 'new_page');
- Assert.ok(title, "Content window should initially have a title.");
- });
-
- let newtitle = yield newTitlePromise;
-
- yield ContentTask.spawn(tab.linkedBrowser, { newtitle }, function* (args) {
- Assert.equal(args.newtitle, content.document.title, "Title after pushstate.");
- });
-
- yield PlacesTestUtils.clearHistory();
- gBrowser.removeTab(tab);
-});
diff --git a/toolkit/components/places/tests/browser/browser_bug680727.js b/toolkit/components/places/tests/browser/browser_bug680727.js
deleted file mode 100644
index 560cbfe6c..000000000
--- a/toolkit/components/places/tests/browser/browser_bug680727.js
+++ /dev/null
@@ -1,109 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/* Ensure that clicking the button in the Offline mode neterror page updates
- global history. See bug 680727. */
-/* TEST_PATH=toolkit/components/places/tests/browser/browser_bug680727.js make -C $(OBJDIR) mochitest-browser-chrome */
-
-
-const kUniqueURI = Services.io.newURI("http://mochi.test:8888/#bug_680727",
- null, null);
-var gAsyncHistory =
- Cc["@mozilla.org/browser/history;1"].getService(Ci.mozIAsyncHistory);
-
-var proxyPrefValue;
-var ourTab;
-
-function test() {
- waitForExplicitFinish();
-
- // Tests always connect to localhost, and per bug 87717, localhost is now
- // reachable in offline mode. To avoid this, disable any proxy.
- proxyPrefValue = Services.prefs.getIntPref("network.proxy.type");
- Services.prefs.setIntPref("network.proxy.type", 0);
-
- // Clear network cache.
- Components.classes["@mozilla.org/netwerk/cache-storage-service;1"]
- .getService(Components.interfaces.nsICacheStorageService)
- .clear();
-
- // Go offline, expecting the error page.
- Services.io.offline = true;
-
- BrowserTestUtils.openNewForegroundTab(gBrowser).then(tab => {
- ourTab = tab;
- BrowserTestUtils.waitForContentEvent(ourTab.linkedBrowser, "DOMContentLoaded")
- .then(errorListener);
- BrowserTestUtils.loadURI(ourTab.linkedBrowser, kUniqueURI.spec);
- });
-}
-
-// ------------------------------------------------------------------------------
-// listen to loading the neterror page. (offline mode)
-function errorListener() {
- ok(Services.io.offline, "Services.io.offline is true.");
-
- // This is an error page.
- ContentTask.spawn(ourTab.linkedBrowser, kUniqueURI.spec, function(uri) {
- Assert.equal(content.document.documentURI.substring(0, 27),
- "about:neterror?e=netOffline", "Document URI is the error page.");
-
- // But location bar should show the original request.
- Assert.equal(content.location.href, uri, "Docshell URI is the original URI.");
- }).then(() => {
- // Global history does not record URI of a failed request.
- return PlacesTestUtils.promiseAsyncUpdates().then(() => {
- gAsyncHistory.isURIVisited(kUniqueURI, errorAsyncListener);
- });
- });
-}
-
-function errorAsyncListener(aURI, aIsVisited) {
- ok(kUniqueURI.equals(aURI) && !aIsVisited,
- "The neterror page is not listed in global history.");
-
- Services.prefs.setIntPref("network.proxy.type", proxyPrefValue);
-
- // Now press the "Try Again" button, with offline mode off.
- Services.io.offline = false;
-
- BrowserTestUtils.waitForContentEvent(ourTab.linkedBrowser, "DOMContentLoaded")
- .then(reloadListener);
-
- ContentTask.spawn(ourTab.linkedBrowser, null, function() {
- Assert.ok(content.document.getElementById("errorTryAgain"),
- "The error page has got a #errorTryAgain element");
- content.document.getElementById("errorTryAgain").click();
- });
-}
-
-// ------------------------------------------------------------------------------
-// listen to reload of neterror.
-function reloadListener() {
- // This listener catches "DOMContentLoaded" on being called
- // nsIWPL::onLocationChange(...). That is right *AFTER*
- // IHistory::VisitURI(...) is called.
- ok(!Services.io.offline, "Services.io.offline is false.");
-
- ContentTask.spawn(ourTab.linkedBrowser, kUniqueURI.spec, function(uri) {
- // This is not an error page.
- Assert.equal(content.document.documentURI, uri,
- "Document URI is not the offline-error page, but the original URI.");
- }).then(() => {
- // Check if global history remembers the successfully-requested URI.
- PlacesTestUtils.promiseAsyncUpdates().then(() => {
- gAsyncHistory.isURIVisited(kUniqueURI, reloadAsyncListener);
- });
- });
-}
-
-function reloadAsyncListener(aURI, aIsVisited) {
- ok(kUniqueURI.equals(aURI) && aIsVisited, "We have visited the URI.");
- PlacesTestUtils.clearHistory().then(finish);
-}
-
-registerCleanupFunction(function* () {
- Services.prefs.setIntPref("network.proxy.type", proxyPrefValue);
- Services.io.offline = false;
- yield BrowserTestUtils.removeTab(ourTab);
-});
diff --git a/toolkit/components/places/tests/browser/browser_colorAnalyzer.js b/toolkit/components/places/tests/browser/browser_colorAnalyzer.js
deleted file mode 100644
index 7b7fe6ec5..000000000
--- a/toolkit/components/places/tests/browser/browser_colorAnalyzer.js
+++ /dev/null
@@ -1,259 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-const CA = Cc["@mozilla.org/places/colorAnalyzer;1"].
- getService(Ci.mozIColorAnalyzer);
-
-const hiddenWindowDoc = Cc["@mozilla.org/appshell/appShellService;1"].
- getService(Ci.nsIAppShellService).
- hiddenDOMWindow.document;
-
-const XHTML_NS = "http://www.w3.org/1999/xhtml";
-
-/**
- * Passes the given uri to findRepresentativeColor.
- * If expected is null, you expect it to fail.
- * If expected is a function, it will call that function.
- * If expected is a color, you expect that color to be returned.
- * Message is used in the calls to is().
- */
-function frcTest(uri, expected, message) {
- return new Promise(resolve => {
- CA.findRepresentativeColor(Services.io.newURI(uri, "", null),
- function(success, color) {
- if (expected == null) {
- ok(!success, message);
- } else if (typeof expected == "function") {
- expected(color, message);
- } else {
- ok(success, "success: " + message);
- is(color, expected, message);
- }
- resolve();
- });
- });
-}
-
-/**
- * Handy function for getting an image into findRepresentativeColor and testing it.
- * Makes a canvas with the given dimensions, calls paintCanvasFunc with the 2d
- * context of the canvas, sticks the generated canvas into findRepresentativeColor.
- * See frcTest.
- */
-function canvasTest(width, height, paintCanvasFunc, expected, message) {
- let canvas = hiddenWindowDoc.createElementNS(XHTML_NS, "canvas");
- canvas.width = width;
- canvas.height = height;
- paintCanvasFunc(canvas.getContext("2d"));
- let uri = canvas.toDataURL();
- return frcTest(uri, expected, message);
-}
-
-// simple test - draw a red box in the center, make sure we get red back
-add_task(function* test_redSquare() {
- yield canvasTest(16, 16, function(ctx) {
- ctx.fillStyle = "red";
- ctx.fillRect(2, 2, 12, 12);
- }, 0xFF0000, "redSquare analysis returns red");
-});
-
-
-// draw a blue square in one corner, red in the other, such that blue overlaps
-// red by one pixel, making it the dominant color
-add_task(function* test_blueOverlappingRed() {
- yield canvasTest(16, 16, function(ctx) {
- ctx.fillStyle = "red";
- ctx.fillRect(0, 0, 8, 8);
- ctx.fillStyle = "blue";
- ctx.fillRect(7, 7, 8, 8);
- }, 0x0000FF, "blueOverlappingRed analysis returns blue");
-});
-
-// draw a red gradient next to a solid blue rectangle to ensure that a large
-// block of similar colors beats out a smaller block of one color
-add_task(function* test_redGradientBlueSolid() {
- yield canvasTest(16, 16, function(ctx) {
- let gradient = ctx.createLinearGradient(0, 0, 1, 15);
- gradient.addColorStop(0, "#FF0000");
- gradient.addColorStop(1, "#FF0808");
-
- ctx.fillStyle = gradient;
- ctx.fillRect(0, 0, 16, 16);
- ctx.fillStyle = "blue";
- ctx.fillRect(9, 0, 7, 16);
- }, function(actual, message) {
- ok(actual >= 0xFF0000 && actual <= 0xFF0808, message);
- }, "redGradientBlueSolid analysis returns redish");
-});
-
-// try a transparent image, should fail
-add_task(function* test_transparent() {
- yield canvasTest(16, 16, function(ctx) {
- // do nothing!
- }, null, "transparent analysis fails");
-});
-
-add_task(function* test_invalidURI() {
- yield frcTest("data:blah,Imnotavaliddatauri", null, "invalid URI analysis fails");
-});
-
-add_task(function* test_malformedPNGURI() {
- yield frcTest("data:image/png;base64,iVBORblahblahblah", null,
- "malformed PNG URI analysis fails");
-});
-
-add_task(function* test_unresolvableURI() {
- yield frcTest("http://www.example.com/blah/idontexist.png", null,
- "unresolvable URI analysis fails");
-});
-
-// draw a small blue box on a red background to make sure the algorithm avoids
-// using the background color
-add_task(function* test_blueOnRedBackground() {
- yield canvasTest(16, 16, function(ctx) {
- ctx.fillStyle = "red";
- ctx.fillRect(0, 0, 16, 16);
- ctx.fillStyle = "blue";
- ctx.fillRect(4, 4, 8, 8);
- }, 0x0000FF, "blueOnRedBackground analysis returns blue");
-});
-
-// draw a slightly different color in the corners to make sure the corner colors
-// don't have to be exactly equal to be considered the background color
-add_task(function* test_variableBackground() {
- yield canvasTest(16, 16, function(ctx) {
- ctx.fillStyle = "white";
- ctx.fillRect(0, 0, 16, 16);
- ctx.fillStyle = "#FEFEFE";
- ctx.fillRect(15, 0, 1, 1);
- ctx.fillStyle = "#FDFDFD";
- ctx.fillRect(15, 15, 1, 1);
- ctx.fillStyle = "#FCFCFC";
- ctx.fillRect(0, 15, 1, 1);
- ctx.fillStyle = "black";
- ctx.fillRect(4, 4, 8, 8);
- }, 0x000000, "variableBackground analysis returns black");
-});
-
-// like the above test, but make the colors different enough that they aren't
-// considered the background color
-add_task(function* test_tooVariableBackground() {
- yield canvasTest(16, 16, function(ctx) {
- ctx.fillStyle = "white";
- ctx.fillRect(0, 0, 16, 16);
- ctx.fillStyle = "#EEDDCC";
- ctx.fillRect(15, 0, 1, 1);
- ctx.fillStyle = "#DDDDDD";
- ctx.fillRect(15, 15, 1, 1);
- ctx.fillStyle = "#CCCCCC";
- ctx.fillRect(0, 15, 1, 1);
- ctx.fillStyle = "black";
- ctx.fillRect(4, 4, 8, 8);
- }, function(actual, message) {
- isnot(actual, 0x000000, message);
- }, "tooVariableBackground analysis doesn't return black");
-});
-
-// draw a small black/white box over transparent background to make sure the
-// algorithm doesn't think rgb(0,0,0) == rgba(0,0,0,0)
-add_task(function* test_transparentBackgroundConflation() {
- yield canvasTest(16, 16, function(ctx) {
- ctx.fillStyle = "black";
- ctx.fillRect(2, 2, 12, 12);
- ctx.fillStyle = "white";
- ctx.fillRect(5, 5, 6, 6);
- }, 0x000000, "transparentBackgroundConflation analysis returns black");
-});
-
-
-// make sure we fall back to the background color if we have no other choice
-// (instead of failing as if there were no colors)
-add_task(function* test_backgroundFallback() {
- yield canvasTest(16, 16, function(ctx) {
- ctx.fillStyle = "black";
- ctx.fillRect(0, 0, 16, 16);
- }, 0x000000, "backgroundFallback analysis returns black");
-});
-
-// draw red rectangle next to a pink one to make sure the algorithm picks the
-// more interesting color
-add_task(function* test_interestingColorPreference() {
- yield canvasTest(16, 16, function(ctx) {
- ctx.fillStyle = "#FFDDDD";
- ctx.fillRect(0, 0, 16, 16);
- ctx.fillStyle = "red";
- ctx.fillRect(0, 0, 3, 16);
- }, 0xFF0000, "interestingColorPreference analysis returns red");
-});
-
-// draw high saturation but dark red next to slightly less saturated color but
-// much lighter, to make sure the algorithm doesn't pick colors that are
-// nearly black just because of high saturation (in HSL terms)
-add_task(function* test_saturationDependence() {
- yield canvasTest(16, 16, function(ctx) {
- ctx.fillStyle = "hsl(0, 100%, 5%)";
- ctx.fillRect(0, 0, 16, 16);
- ctx.fillStyle = "hsl(0, 90%, 35%)";
- ctx.fillRect(0, 0, 8, 16);
- }, 0xA90808, "saturationDependence analysis returns lighter red");
-});
-
-// make sure the preference for interesting colors won't stupidly pick 1 pixel
-// of red over 169 black pixels
-add_task(function* test_interestingColorPreferenceLenient() {
- yield canvasTest(16, 16, function(ctx) {
- ctx.fillStyle = "black";
- ctx.fillRect(1, 1, 13, 13);
- ctx.fillStyle = "red";
- ctx.fillRect(3, 3, 1, 1);
- }, 0x000000, "interestingColorPreferenceLenient analysis returns black");
-});
-
-// ...but 6 pixels of red is more reasonable
-add_task(function* test_interestingColorPreferenceNotTooLenient() {
- yield canvasTest(16, 16, function(ctx) {
- ctx.fillStyle = "black";
- ctx.fillRect(1, 1, 13, 13);
- ctx.fillStyle = "red";
- ctx.fillRect(3, 3, 3, 2);
- }, 0xFF0000, "interestingColorPreferenceNotTooLenient analysis returns red");
-});
-
-var maxPixels = 144; // see ColorAnalyzer MAXIMUM_PIXELS const
-
-// make sure that images larger than maxPixels*maxPixels fail
-add_task(function* test_imageTooLarge() {
- yield canvasTest(1+maxPixels, 1+maxPixels, function(ctx) {
- ctx.fillStyle = "red";
- ctx.fillRect(0, 0, 1+maxPixels, 1+maxPixels);
- }, null, "imageTooLarge analysis fails");
-});
-
-// the rest of the tests are for coverage of "real" favicons
-// exact color isn't terribly important, just make sure it's reasonable
-const filePrefix = getRootDirectory(gTestPath) + "colorAnalyzer/";
-
-add_task(function* test_categoryDiscover() {
- yield frcTest(filePrefix + "category-discover.png", 0xB28D3A,
- "category-discover analysis returns red");
-});
-
-add_task(function* test_localeGeneric() {
- yield frcTest(filePrefix + "localeGeneric.png", 0x3EC23E,
- "localeGeneric analysis returns green");
-});
-
-add_task(function* test_dictionaryGeneric() {
- yield frcTest(filePrefix + "dictionaryGeneric-16.png", 0x854C30,
- "dictionaryGeneric-16 analysis returns brown");
-});
-
-add_task(function* test_extensionGeneric() {
- yield frcTest(filePrefix + "extensionGeneric-16.png", 0x53BA3F,
- "extensionGeneric-16 analysis returns green");
-});
diff --git a/toolkit/components/places/tests/browser/browser_double_redirect.js b/toolkit/components/places/tests/browser/browser_double_redirect.js
deleted file mode 100644
index 1e5dc9c16..000000000
--- a/toolkit/components/places/tests/browser/browser_double_redirect.js
+++ /dev/null
@@ -1,63 +0,0 @@
-// Test for bug 411966.
-// When a page redirects multiple times, from_visit should point to the
-// previous visit in the chain, not to the first visit in the chain.
-
-add_task(function* () {
- yield PlacesTestUtils.clearHistory();
-
- const BASE_URL = "http://example.com/tests/toolkit/components/places/tests/browser/";
- const TEST_URI = NetUtil.newURI(BASE_URL + "begin.html");
- const FIRST_REDIRECTING_URI = NetUtil.newURI(BASE_URL + "redirect_twice.sjs");
- const FINAL_URI = NetUtil.newURI(BASE_URL + "final.html");
-
- let promiseVisits = new Promise(resolve => {
- PlacesUtils.history.addObserver({
- __proto__: NavHistoryObserver.prototype,
- _notified: [],
- onVisit: function (uri, id, time, sessionId, referrerId, transition) {
- info("Received onVisit: " + uri.spec);
- this._notified.push(uri);
-
- if (!uri.equals(FINAL_URI)) {
- return;
- }
-
- is(this._notified.length, 4);
- PlacesUtils.history.removeObserver(this);
-
- Task.spawn(function* () {
- // Get all pages visited from the original typed one
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.execute(
- `SELECT url FROM moz_historyvisits
- JOIN moz_places h ON h.id = place_id
- WHERE from_visit IN
- (SELECT v.id FROM moz_historyvisits v
- JOIN moz_places p ON p.id = v.place_id
- WHERE p.url_hash = hash(:url) AND p.url = :url)
- `, { url: TEST_URI.spec });
-
- is(rows.length, 1, "Found right number of visits");
- let visitedUrl = rows[0].getResultByName("url");
- // Check that redirect from_visit is not from the original typed one
- is(visitedUrl, FIRST_REDIRECTING_URI.spec, "Check referrer for " + visitedUrl);
-
- resolve();
- });
- }
- }, false);
- });
-
- PlacesUtils.history.markPageAsTyped(TEST_URI);
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: TEST_URI.spec,
- }, function* (browser) {
- // Load begin page, click link on page to record visits.
- yield BrowserTestUtils.synthesizeMouseAtCenter("#clickme", {}, browser);
-
- yield promiseVisits;
- });
-
- yield PlacesTestUtils.clearHistory();
-});
diff --git a/toolkit/components/places/tests/browser/browser_favicon_privatebrowsing_perwindowpb.js b/toolkit/components/places/tests/browser/browser_favicon_privatebrowsing_perwindowpb.js
deleted file mode 100644
index 51d82adc6..000000000
--- a/toolkit/components/places/tests/browser/browser_favicon_privatebrowsing_perwindowpb.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function test() {
- waitForExplicitFinish();
-
- const pageURI =
- "http://example.org/tests/toolkit/components/places/tests/browser/favicon.html";
- let windowsToClose = [];
-
- registerCleanupFunction(function() {
- windowsToClose.forEach(function(aWin) {
- aWin.close();
- });
- });
-
- function testOnWindow(aIsPrivate, aCallback) {
- whenNewWindowLoaded({private: aIsPrivate}, function(aWin) {
- windowsToClose.push(aWin);
- executeSoon(() => aCallback(aWin));
- });
- }
-
- function waitForTabLoad(aWin, aCallback) {
- aWin.gBrowser.selectedBrowser.addEventListener("load", function onLoad() {
- aWin.gBrowser.selectedBrowser.removeEventListener("load", onLoad, true);
- aCallback();
- }, true);
- aWin.gBrowser.selectedBrowser.loadURI(pageURI);
- }
-
- testOnWindow(true, function(win) {
- waitForTabLoad(win, function() {
- PlacesUtils.favicons.getFaviconURLForPage(NetUtil.newURI(pageURI),
- function(uri, dataLen, data, mimeType) {
- is(uri, null, "No result should be found");
- finish();
- }
- );
- });
- });
-}
diff --git a/toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage.js b/toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage.js
deleted file mode 100644
index 60df8ebd7..000000000
--- a/toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage.js
+++ /dev/null
@@ -1,152 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// This file tests the normal operation of setAndFetchFaviconForPage.
-function test() {
- // Initialization
- waitForExplicitFinish();
- let windowsToClose = [];
- let favIconLocation =
- "http://example.org/tests/toolkit/components/places/tests/browser/favicon-normal32.png";
- let favIconURI = NetUtil.newURI(favIconLocation);
- let favIconMimeType= "image/png";
- let pageURI;
- let favIconData;
-
- function testOnWindow(aOptions, aCallback) {
- whenNewWindowLoaded(aOptions, function(aWin) {
- windowsToClose.push(aWin);
- executeSoon(() => aCallback(aWin));
- });
- }
-
- // This function is called after calling finish() on the test.
- registerCleanupFunction(function() {
- windowsToClose.forEach(function(aWin) {
- aWin.close();
- });
- });
-
- function getIconFile(aCallback) {
- NetUtil.asyncFetch({
- uri: favIconLocation,
- loadUsingSystemPrincipal: true,
- contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON
- }, function(inputStream, status) {
- if (!Components.isSuccessCode(status)) {
- ok(false, "Could not get the icon file");
- // Handle error.
- return;
- }
-
- // Check the returned size versus the expected size.
- let size = inputStream.available();
- favIconData = NetUtil.readInputStreamToString(inputStream, size);
- is(size, favIconData.length, "Check correct icon size");
- // Check that the favicon loaded correctly before starting the actual tests.
- is(favIconData.length, 344, "Check correct icon length (344)");
-
- if (aCallback) {
- aCallback();
- } else {
- finish();
- }
- });
- }
-
- function testNormal(aWindow, aCallback) {
- pageURI = NetUtil.newURI("http://example.com/normal");
- waitForFaviconChanged(pageURI, favIconURI, aWindow,
- function testNormalCallback() {
- checkFaviconDataForPage(pageURI, favIconMimeType, favIconData, aWindow,
- aCallback);
- }
- );
-
- addVisits({uri: pageURI, transition: TRANSITION_TYPED}, aWindow,
- function () {
- aWindow.PlacesUtils.favicons.setAndFetchFaviconForPage(pageURI, favIconURI,
- true, aWindow.PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE, null,
- Services.scriptSecurityManager.getSystemPrincipal());
- }
- );
- }
-
- function testAboutURIBookmarked(aWindow, aCallback) {
- pageURI = NetUtil.newURI("about:testAboutURI_bookmarked");
- waitForFaviconChanged(pageURI, favIconURI, aWindow,
- function testAboutURIBookmarkedCallback() {
- checkFaviconDataForPage(pageURI, favIconMimeType, favIconData, aWindow,
- aCallback);
- }
- );
-
- aWindow.PlacesUtils.bookmarks.insertBookmark(
- aWindow.PlacesUtils.unfiledBookmarksFolderId, pageURI,
- aWindow.PlacesUtils.bookmarks.DEFAULT_INDEX, pageURI.spec);
- aWindow.PlacesUtils.favicons.setAndFetchFaviconForPage(pageURI, favIconURI,
- true, aWindow.PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE, null,
- Services.scriptSecurityManager.getSystemPrincipal());
- }
-
- function testPrivateBrowsingBookmarked(aWindow, aCallback) {
- pageURI = NetUtil.newURI("http://example.com/privateBrowsing_bookmarked");
- waitForFaviconChanged(pageURI, favIconURI, aWindow,
- function testPrivateBrowsingBookmarkedCallback() {
- checkFaviconDataForPage(pageURI, favIconMimeType, favIconData, aWindow,
- aCallback);
- }
- );
-
- aWindow.PlacesUtils.bookmarks.insertBookmark(
- aWindow.PlacesUtils.unfiledBookmarksFolderId, pageURI,
- aWindow.PlacesUtils.bookmarks.DEFAULT_INDEX, pageURI.spec);
- aWindow.PlacesUtils.favicons.setAndFetchFaviconForPage(pageURI, favIconURI,
- true, aWindow.PlacesUtils.favicons.FAVICON_LOAD_PRIVATE, null,
- Services.scriptSecurityManager.getSystemPrincipal());
- }
-
- function testDisabledHistoryBookmarked(aWindow, aCallback) {
- pageURI = NetUtil.newURI("http://example.com/disabledHistory_bookmarked");
- waitForFaviconChanged(pageURI, favIconURI, aWindow,
- function testDisabledHistoryBookmarkedCallback() {
- checkFaviconDataForPage(pageURI, favIconMimeType, favIconData, aWindow,
- aCallback);
- }
- );
-
- // Disable history while changing the favicon.
- aWindow.Services.prefs.setBoolPref("places.history.enabled", false);
-
- aWindow.PlacesUtils.bookmarks.insertBookmark(
- aWindow.PlacesUtils.unfiledBookmarksFolderId, pageURI,
- aWindow.PlacesUtils.bookmarks.DEFAULT_INDEX, pageURI.spec);
- aWindow.PlacesUtils.favicons.setAndFetchFaviconForPage(pageURI, favIconURI,
- true, aWindow.PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE, null,
- Services.scriptSecurityManager.getSystemPrincipal());
-
- // The setAndFetchFaviconForPage function calls CanAddURI synchronously, thus
- // we can set the preference back to true immediately. We don't clear the
- // preference because not all products enable Places by default.
- aWindow.Services.prefs.setBoolPref("places.history.enabled", true);
- }
-
- getIconFile(function () {
- testOnWindow({}, function(aWin) {
- testNormal(aWin, function () {
- testOnWindow({}, function(aWin2) {
- testAboutURIBookmarked(aWin2, function () {
- testOnWindow({private: true}, function(aWin3) {
- testPrivateBrowsingBookmarked(aWin3, function () {
- testOnWindow({}, function(aWin4) {
- testDisabledHistoryBookmarked(aWin4, finish);
- });
- });
- });
- });
- });
- });
- });
- });
-}
diff --git a/toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage_failures.js b/toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage_failures.js
deleted file mode 100644
index bd73af441..000000000
--- a/toolkit/components/places/tests/browser/browser_favicon_setAndFetchFaviconForPage_failures.js
+++ /dev/null
@@ -1,261 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * This file tests setAndFetchFaviconForPage when it is called with invalid
- * arguments, and when no favicon is stored for the given arguments.
- */
-function test() {
- // Initialization
- waitForExplicitFinish();
- let windowsToClose = [];
- let favIcon16Location =
- "http://example.org/tests/toolkit/components/places/tests/browser/favicon-normal16.png";
- let favIcon32Location =
- "http://example.org/tests/toolkit/components/places/tests/browser/favicon-normal32.png";
- let favIcon16URI = NetUtil.newURI(favIcon16Location);
- let favIcon32URI = NetUtil.newURI(favIcon32Location);
- let lastPageURI = NetUtil.newURI("http://example.com/verification");
- // This error icon must stay in sync with FAVICON_ERRORPAGE_URL in
- // nsIFaviconService.idl, aboutCertError.xhtml and netError.xhtml.
- let favIconErrorPageURI =
- NetUtil.newURI("chrome://global/skin/icons/warning-16.png");
- let favIconsResultCount = 0;
-
- function testOnWindow(aOptions, aCallback) {
- whenNewWindowLoaded(aOptions, function(aWin) {
- windowsToClose.push(aWin);
- executeSoon(() => aCallback(aWin));
- });
- }
-
- // This function is called after calling finish() on the test.
- registerCleanupFunction(function() {
- windowsToClose.forEach(function(aWin) {
- aWin.close();
- });
- });
-
- function checkFavIconsDBCount(aCallback) {
- let stmt = DBConn().createAsyncStatement("SELECT url FROM moz_favicons");
- stmt.executeAsync({
- handleResult: function final_handleResult(aResultSet) {
- while (aResultSet.getNextRow()) {
- favIconsResultCount++;
- }
- },
- handleError: function final_handleError(aError) {
- throw ("Unexpected error (" + aError.result + "): " + aError.message);
- },
- handleCompletion: function final_handleCompletion(aReason) {
- // begin testing
- info("Previous records in moz_favicons: " + favIconsResultCount);
- if (aCallback) {
- aCallback();
- }
- }
- });
- stmt.finalize();
- }
-
- function testNullPageURI(aWindow, aCallback) {
- try {
- aWindow.PlacesUtils.favicons.setAndFetchFaviconForPage(null, favIcon16URI,
- true, aWindow.PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE, null,
- Services.scriptSecurityManager.getSystemPrincipal());
- throw ("Exception expected because aPageURI is null.");
- } catch (ex) {
- // We expected an exception.
- ok(true, "Exception expected because aPageURI is null");
- }
-
- if (aCallback) {
- aCallback();
- }
- }
-
- function testNullFavIconURI(aWindow, aCallback) {
- try {
- aWindow.PlacesUtils.favicons.setAndFetchFaviconForPage(
- NetUtil.newURI("http://example.com/null_faviconURI"), null,
- true, aWindow.PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- null, Services.scriptSecurityManager.getSystemPrincipal());
- throw ("Exception expected because aFaviconURI is null.");
- } catch (ex) {
- // We expected an exception.
- ok(true, "Exception expected because aFaviconURI is null.");
- }
-
- if (aCallback) {
- aCallback();
- }
- }
-
- function testAboutURI(aWindow, aCallback) {
- aWindow.PlacesUtils.favicons.setAndFetchFaviconForPage(
- NetUtil.newURI("about:testAboutURI"), favIcon16URI,
- true, aWindow.PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- null, Services.scriptSecurityManager.getSystemPrincipal());
-
- if (aCallback) {
- aCallback();
- }
- }
-
- function testPrivateBrowsingNonBookmarkedURI(aWindow, aCallback) {
- let pageURI = NetUtil.newURI("http://example.com/privateBrowsing");
- addVisits({ uri: pageURI, transitionType: TRANSITION_TYPED }, aWindow,
- function () {
- aWindow.PlacesUtils.favicons.setAndFetchFaviconForPage(pageURI,
- favIcon16URI, true,
- aWindow.PlacesUtils.favicons.FAVICON_LOAD_PRIVATE, null,
- Services.scriptSecurityManager.getSystemPrincipal());
-
- if (aCallback) {
- aCallback();
- }
- });
- }
-
- function testDisabledHistory(aWindow, aCallback) {
- let pageURI = NetUtil.newURI("http://example.com/disabledHistory");
- addVisits({ uri: pageURI, transition: TRANSITION_TYPED }, aWindow,
- function () {
- aWindow.Services.prefs.setBoolPref("places.history.enabled", false);
-
- aWindow.PlacesUtils.favicons.setAndFetchFaviconForPage(pageURI,
- favIcon16URI, true,
- aWindow.PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE, null,
- Services.scriptSecurityManager.getSystemPrincipal());
-
- // The setAndFetchFaviconForPage function calls CanAddURI synchronously, thus
- // we can set the preference back to true immediately . We don't clear the
- // preference because not all products enable Places by default.
- aWindow.Services.prefs.setBoolPref("places.history.enabled", true);
-
- if (aCallback) {
- aCallback();
- }
- });
- }
-
- function testErrorIcon(aWindow, aCallback) {
- let pageURI = NetUtil.newURI("http://example.com/errorIcon");
- addVisits({ uri: pageURI, transition: TRANSITION_TYPED }, aWindow,
- function () {
- aWindow.PlacesUtils.favicons.setAndFetchFaviconForPage(pageURI,
- favIconErrorPageURI, true,
- aWindow.PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE, null,
- Services.scriptSecurityManager.getSystemPrincipal());
-
- if (aCallback) {
- aCallback();
- }
- });
- }
-
- function testNonExistingPage(aWindow, aCallback) {
- aWindow.PlacesUtils.favicons.setAndFetchFaviconForPage(
- NetUtil.newURI("http://example.com/nonexistingPage"), favIcon16URI,
- true, aWindow.PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE, null,
- Services.scriptSecurityManager.getSystemPrincipal());
-
- if (aCallback) {
- aCallback();
- }
- }
-
- function testFinalVerification(aWindow, aCallback) {
- // Only the last test should raise the onPageChanged notification,
- // executing the waitForFaviconChanged callback.
- waitForFaviconChanged(lastPageURI, favIcon32URI, aWindow,
- function final_callback() {
- // Check that only one record corresponding to the last favicon is present.
- let resultCount = 0;
- let stmt = DBConn().createAsyncStatement("SELECT url FROM moz_favicons");
- stmt.executeAsync({
- handleResult: function final_handleResult(aResultSet) {
-
- // If the moz_favicons DB had been previously loaded (before our
- // test began), we should focus only in the URI we are testing and
- // skip the URIs not related to our test.
- if (favIconsResultCount > 0) {
- for (let row; (row = aResultSet.getNextRow()); ) {
- if (favIcon32URI.spec === row.getResultByIndex(0)) {
- is(favIcon32URI.spec, row.getResultByIndex(0),
- "Check equal favicons");
- resultCount++;
- }
- }
- } else {
- for (let row; (row = aResultSet.getNextRow()); ) {
- is(favIcon32URI.spec, row.getResultByIndex(0),
- "Check equal favicons");
- resultCount++;
- }
- }
- },
- handleError: function final_handleError(aError) {
- throw ("Unexpected error (" + aError.result + "): " + aError.message);
- },
- handleCompletion: function final_handleCompletion(aReason) {
- is(Ci.mozIStorageStatementCallback.REASON_FINISHED, aReason,
- "Check reasons are equal");
- is(1, resultCount, "Check result count");
- if (aCallback) {
- aCallback();
- }
- }
- });
- stmt.finalize();
- });
-
- // This is the only test that should cause the waitForFaviconChanged
- // callback to be invoked. In turn, the callback will invoke
- // finish() causing the tests to finish.
- addVisits({ uri: lastPageURI, transition: TRANSITION_TYPED }, aWindow,
- function () {
- aWindow.PlacesUtils.favicons.setAndFetchFaviconForPage(lastPageURI,
- favIcon32URI, true,
- aWindow.PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE, null,
- Services.scriptSecurityManager.getSystemPrincipal());
- });
- }
-
- checkFavIconsDBCount(function () {
- testOnWindow({}, function(aWin) {
- testNullPageURI(aWin, function () {
- testOnWindow({}, function(aWin2) {
- testNullFavIconURI(aWin2, function() {
- testOnWindow({}, function(aWin3) {
- testAboutURI(aWin3, function() {
- testOnWindow({private: true}, function(aWin4) {
- testPrivateBrowsingNonBookmarkedURI(aWin4, function () {
- testOnWindow({}, function(aWin5) {
- testDisabledHistory(aWin5, function () {
- testOnWindow({}, function(aWin6) {
- testErrorIcon(aWin6, function() {
- testOnWindow({}, function(aWin7) {
- testNonExistingPage(aWin7, function() {
- testOnWindow({}, function(aWin8) {
- testFinalVerification(aWin8, function() {
- finish();
- });
- });
- });
- });
- });
- });
- });
- });
- });
- });
- });
- });
- });
- });
- });
- });
- });
-}
diff --git a/toolkit/components/places/tests/browser/browser_history_post.js b/toolkit/components/places/tests/browser/browser_history_post.js
deleted file mode 100644
index c85e720f8..000000000
--- a/toolkit/components/places/tests/browser/browser_history_post.js
+++ /dev/null
@@ -1,23 +0,0 @@
-const PAGE_URI = "http://example.com/tests/toolkit/components/places/tests/browser/history_post.html";
-const SJS_URI = NetUtil.newURI("http://example.com/tests/toolkit/components/places/tests/browser/history_post.sjs");
-
-add_task(function* () {
- yield BrowserTestUtils.withNewTab({gBrowser, url: PAGE_URI}, Task.async(function* (aBrowser) {
- yield ContentTask.spawn(aBrowser, null, function* () {
- let doc = content.document;
- let submit = doc.getElementById("submit");
- let iframe = doc.getElementById("post_iframe");
- let p = new Promise((resolve, reject) => {
- iframe.addEventListener("load", function onLoad() {
- iframe.removeEventListener("load", onLoad);
- resolve();
- });
- });
- submit.click();
- yield p;
- });
- let visited = yield promiseIsURIVisited(SJS_URI);
- ok(!visited, "The POST page should not be added to history");
- ok(!(yield PlacesTestUtils.isPageInDB(SJS_URI.spec)), "The page should not be in the database");
- }));
-});
diff --git a/toolkit/components/places/tests/browser/browser_notfound.js b/toolkit/components/places/tests/browser/browser_notfound.js
deleted file mode 100644
index 20467eef4..000000000
--- a/toolkit/components/places/tests/browser/browser_notfound.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-add_task(function* () {
- const TEST_URL = "http://mochi.test:8888/notFoundPage.html";
-
- // Used to verify errors are not marked as typed.
- PlacesUtils.history.markPageAsTyped(NetUtil.newURI(TEST_URL));
-
- // Create and add history observer.
- let visitedPromise = new Promise(resolve => {
- let historyObserver = {
- onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID,
- aTransitionType) {
- PlacesUtils.history.removeObserver(historyObserver);
- info("Received onVisit: " + aURI.spec);
- fieldForUrl(aURI, "frecency", function (aFrecency) {
- is(aFrecency, 0, "Frecency should be 0");
- fieldForUrl(aURI, "hidden", function (aHidden) {
- is(aHidden, 0, "Page should not be hidden");
- fieldForUrl(aURI, "typed", function (aTyped) {
- is(aTyped, 0, "page should not be marked as typed");
- resolve();
- });
- });
- });
- },
- onBeginUpdateBatch: function () {},
- onEndUpdateBatch: function () {},
- onTitleChanged: function () {},
- onDeleteURI: function () {},
- onClearHistory: function () {},
- onPageChanged: function () {},
- onDeleteVisits: function () {},
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver])
- };
- PlacesUtils.history.addObserver(historyObserver, false);
- });
-
- let newTabPromise = BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_URL);
- yield Promise.all([visitedPromise, newTabPromise]);
-
- yield PlacesTestUtils.clearHistory();
- gBrowser.removeCurrentTab();
-});
diff --git a/toolkit/components/places/tests/browser/browser_redirect.js b/toolkit/components/places/tests/browser/browser_redirect.js
deleted file mode 100644
index d8a19731a..000000000
--- a/toolkit/components/places/tests/browser/browser_redirect.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-add_task(function* () {
- const REDIRECT_URI = NetUtil.newURI("http://mochi.test:8888/tests/toolkit/components/places/tests/browser/redirect.sjs");
- const TARGET_URI = NetUtil.newURI("http://mochi.test:8888/tests/toolkit/components/places/tests/browser/redirect-target.html");
-
- // Create and add history observer.
- let visitedPromise = new Promise(resolve => {
- let historyObserver = {
- _redirectNotified: false,
- onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID,
- aTransitionType) {
- info("Received onVisit: " + aURI.spec);
-
- if (aURI.equals(REDIRECT_URI)) {
- this._redirectNotified = true;
- // Wait for the target page notification.
- return;
- }
-
- PlacesUtils.history.removeObserver(historyObserver);
-
- ok(this._redirectNotified, "The redirect should have been notified");
-
- fieldForUrl(REDIRECT_URI, "frecency", function (aFrecency) {
- ok(aFrecency != 0, "Frecency or the redirecting page should not be 0");
-
- fieldForUrl(REDIRECT_URI, "hidden", function (aHidden) {
- is(aHidden, 1, "The redirecting page should be hidden");
-
- fieldForUrl(TARGET_URI, "frecency", function (aFrecency2) {
- ok(aFrecency2 != 0, "Frecency of the target page should not be 0");
-
- fieldForUrl(TARGET_URI, "hidden", function (aHidden2) {
- is(aHidden2, 0, "The target page should not be hidden");
- resolve();
- });
- });
- });
- });
- },
- onBeginUpdateBatch: function () {},
- onEndUpdateBatch: function () {},
- onTitleChanged: function () {},
- onDeleteURI: function () {},
- onClearHistory: function () {},
- onPageChanged: function () {},
- onDeleteVisits: function () {},
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver])
- };
- PlacesUtils.history.addObserver(historyObserver, false);
- });
-
- let newTabPromise = BrowserTestUtils.openNewForegroundTab(gBrowser, REDIRECT_URI.spec);
- yield Promise.all([visitedPromise, newTabPromise]);
-
- yield PlacesTestUtils.clearHistory();
- gBrowser.removeCurrentTab();
-});
diff --git a/toolkit/components/places/tests/browser/browser_settitle.js b/toolkit/components/places/tests/browser/browser_settitle.js
deleted file mode 100644
index 68c8deda7..000000000
--- a/toolkit/components/places/tests/browser/browser_settitle.js
+++ /dev/null
@@ -1,76 +0,0 @@
-var conn = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase).DBConnection;
-
-/**
- * Gets a single column value from either the places or historyvisits table.
- */
-function getColumn(table, column, url)
-{
- var stmt = conn.createStatement(
- `SELECT ${column} FROM ${table} WHERE url_hash = hash(:val) AND url = :val`);
- try {
- stmt.params.val = url;
- stmt.executeStep();
- return stmt.row[column];
- }
- finally {
- stmt.finalize();
- }
-}
-
-add_task(function* ()
-{
- // Make sure titles are correctly saved for a URI with the proper
- // notifications.
-
- // Create and add history observer.
- let titleChangedPromise = new Promise(resolve => {
- var historyObserver = {
- data: [],
- onBeginUpdateBatch: function() {},
- onEndUpdateBatch: function() {},
- onVisit: function(aURI, aVisitID, aTime, aSessionID, aReferringID,
- aTransitionType) {
- },
- onTitleChanged: function(aURI, aPageTitle, aGUID) {
- this.data.push({ uri: aURI, title: aPageTitle, guid: aGUID });
-
- // We only expect one title change.
- //
- // Although we are loading two different pages, the first page does not
- // have a title. Since the title starts out as empty and then is set
- // to empty, there is no title change notification.
-
- PlacesUtils.history.removeObserver(this);
- resolve(this.data);
- },
- onDeleteURI: function() {},
- onClearHistory: function() {},
- onPageChanged: function() {},
- onDeleteVisits: function() {},
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver])
- };
- PlacesUtils.history.addObserver(historyObserver, false);
- });
-
- const url1 = "http://example.com/tests/toolkit/components/places/tests/browser/title1.html";
- yield BrowserTestUtils.openNewForegroundTab(gBrowser, url1);
-
- const url2 = "http://example.com/tests/toolkit/components/places/tests/browser/title2.html";
- let loadPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
- BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url2);
- yield loadPromise;
-
- let data = yield titleChangedPromise;
- is(data[0].uri.spec, "http://example.com/tests/toolkit/components/places/tests/browser/title2.html");
- is(data[0].title, "Some title");
- is(data[0].guid, getColumn("moz_places", "guid", data[0].uri.spec));
-
- data.forEach(function(item) {
- var title = getColumn("moz_places", "title", data[0].uri.spec);
- is(title, item.title);
- });
-
- gBrowser.removeCurrentTab();
- yield PlacesTestUtils.clearHistory();
-});
-
diff --git a/toolkit/components/places/tests/browser/browser_visited_notfound.js b/toolkit/components/places/tests/browser/browser_visited_notfound.js
deleted file mode 100644
index b2b4f25b8..000000000
--- a/toolkit/components/places/tests/browser/browser_visited_notfound.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const TEST_URI = NetUtil.newURI("http://mochi.test:8888/notFoundPage.html");
-
-function test() {
- waitForExplicitFinish();
-
- gBrowser.selectedTab = gBrowser.addTab();
- registerCleanupFunction(function() {
- gBrowser.removeCurrentTab();
- });
-
- // First add a visit to the page, this will ensure that later we skip
- // updating the frecency for a newly not-found page.
- addVisits({ uri: TEST_URI }, window, () => {
- info("Added visit");
- fieldForUrl(TEST_URI, "frecency", aFrecency => {
- ok(aFrecency > 0, "Frecency should be > 0");
- continueTest(aFrecency);
- });
- });
-}
-
-function continueTest(aOldFrecency) {
- // Used to verify errors are not marked as typed.
- PlacesUtils.history.markPageAsTyped(TEST_URI);
- gBrowser.selectedBrowser.loadURI(TEST_URI.spec);
-
- // Create and add history observer.
- let historyObserver = {
- __proto__: NavHistoryObserver.prototype,
- onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID,
- aTransitionType) {
- PlacesUtils.history.removeObserver(historyObserver);
- info("Received onVisit: " + aURI.spec);
- fieldForUrl(aURI, "frecency", function (aFrecency) {
- is(aFrecency, aOldFrecency, "Frecency should be unchanged");
- fieldForUrl(aURI, "hidden", function (aHidden) {
- is(aHidden, 0, "Page should not be hidden");
- fieldForUrl(aURI, "typed", function (aTyped) {
- is(aTyped, 0, "page should not be marked as typed");
- PlacesTestUtils.clearHistory().then(finish);
- });
- });
- });
- }
- };
- PlacesUtils.history.addObserver(historyObserver, false);
-}
diff --git a/toolkit/components/places/tests/browser/browser_visituri.js b/toolkit/components/places/tests/browser/browser_visituri.js
deleted file mode 100644
index 8ba2b7272..000000000
--- a/toolkit/components/places/tests/browser/browser_visituri.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/**
- * One-time observer callback.
- */
-function promiseObserve(name, checkFn) {
- return new Promise(resolve => {
- Services.obs.addObserver(function observer(subject) {
- if (checkFn(subject)) {
- Services.obs.removeObserver(observer, name);
- resolve();
- }
- }, name, false);
- });
-}
-
-var conn = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase).DBConnection;
-
-/**
- * Gets a single column value from either the places or historyvisits table.
- */
-function getColumn(table, column, fromColumnName, fromColumnValue) {
- let sql = `SELECT ${column}
- FROM ${table}
- WHERE ${fromColumnName} = :val
- ${fromColumnName == "url" ? "AND url_hash = hash(:val)" : ""}
- LIMIT 1`;
- let stmt = conn.createStatement(sql);
- try {
- stmt.params.val = fromColumnValue;
- ok(stmt.executeStep(), "Expect to get a row");
- return stmt.row[column];
- }
- finally {
- stmt.reset();
- }
-}
-
-add_task(function* () {
- // Make sure places visit chains are saved correctly with a redirect
- // transitions.
-
- // Part 1: observe history events that fire when a visit occurs.
- // Make sure visits appear in order, and that the visit chain is correct.
- var expectedUrls = [
- "http://example.com/tests/toolkit/components/places/tests/browser/begin.html",
- "http://example.com/tests/toolkit/components/places/tests/browser/redirect_twice.sjs",
- "http://example.com/tests/toolkit/components/places/tests/browser/redirect_once.sjs",
- "http://example.com/tests/toolkit/components/places/tests/browser/final.html"
- ];
- var currentIndex = 0;
-
- function checkObserver(subject) {
- var uri = subject.QueryInterface(Ci.nsIURI);
- var expected = expectedUrls[currentIndex];
- is(uri.spec, expected, "Saved URL visit " + uri.spec);
-
- var placeId = getColumn("moz_places", "id", "url", uri.spec);
- var fromVisitId = getColumn("moz_historyvisits", "from_visit", "place_id", placeId);
-
- if (currentIndex == 0) {
- is(fromVisitId, 0, "First visit has no from visit");
- }
- else {
- var lastVisitId = getColumn("moz_historyvisits", "place_id", "id", fromVisitId);
- var fromVisitUrl = getColumn("moz_places", "url", "id", lastVisitId);
- is(fromVisitUrl, expectedUrls[currentIndex - 1],
- "From visit was " + expectedUrls[currentIndex - 1]);
- }
-
- currentIndex++;
- return (currentIndex >= expectedUrls.length);
- }
- let visitUriPromise = promiseObserve("uri-visit-saved", checkObserver);
-
- const testUrl = "http://example.com/tests/toolkit/components/places/tests/browser/begin.html";
- yield BrowserTestUtils.openNewForegroundTab(gBrowser, testUrl);
-
- // Load begin page, click link on page to record visits.
- yield BrowserTestUtils.synthesizeMouseAtCenter("#clickme", { }, gBrowser.selectedBrowser);
- yield visitUriPromise;
-
- yield PlacesTestUtils.clearHistory();
-
- gBrowser.removeCurrentTab();
-});
diff --git a/toolkit/components/places/tests/browser/browser_visituri_nohistory.js b/toolkit/components/places/tests/browser/browser_visituri_nohistory.js
deleted file mode 100644
index a3a8e7626..000000000
--- a/toolkit/components/places/tests/browser/browser_visituri_nohistory.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/**
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-const INITIAL_URL = "http://example.com/tests/toolkit/components/places/tests/browser/begin.html";
-const FINAL_URL = "http://example.com/tests/toolkit/components/places/tests/browser/final.html";
-
-/**
- * One-time observer callback.
- */
-function promiseObserve(name)
-{
- return new Promise(resolve => {
- Services.obs.addObserver(function observer(subject) {
- Services.obs.removeObserver(observer, name);
- resolve(subject);
- }, name, false);
- });
-}
-
-add_task(function* ()
-{
- yield new Promise(resolve => SpecialPowers.pushPrefEnv({"set": [["places.history.enabled", false]]}, resolve));
-
- let visitUriPromise = promiseObserve("uri-visit-saved");
-
- yield BrowserTestUtils.openNewForegroundTab(gBrowser, INITIAL_URL);
-
- yield new Promise(resolve => SpecialPowers.popPrefEnv(resolve));
-
- let browserLoadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
- gBrowser.loadURI(FINAL_URL);
- yield browserLoadedPromise;
-
- let subject = yield visitUriPromise;
- let uri = subject.QueryInterface(Ci.nsIURI);
- is(uri.spec, FINAL_URL, "received expected visit");
-
- yield PlacesTestUtils.clearHistory();
- gBrowser.removeCurrentTab();
-});
diff --git a/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js b/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js
deleted file mode 100644
index abde69a7d..000000000
--- a/toolkit/components/places/tests/browser/browser_visituri_privatebrowsing_perwindowpb.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function test() {
- // initialization
- waitForExplicitFinish();
- let windowsToClose = [];
- let initialURL =
- "http://example.com/tests/toolkit/components/places/tests/browser/begin.html";
- let finalURL =
- "http://example.com/tests/toolkit/components/places/tests/browser/final.html";
- let observer = null;
- let enumerator = null;
- let currentObserver = null;
- let uri = null;
-
- function doTest(aIsPrivateMode, aWindow, aTestURI, aCallback) {
- observer = {
- observe: function(aSubject, aTopic, aData) {
- // The uri-visit-saved topic should only work when on normal mode.
- if (aTopic == "uri-visit-saved") {
- // Remove the observers set on per window private mode and normal
- // mode.
- enumerator = aWindow.Services.obs.enumerateObservers("uri-visit-saved");
- while (enumerator.hasMoreElements()) {
- currentObserver = enumerator.getNext();
- aWindow.Services.obs.removeObserver(currentObserver, "uri-visit-saved");
- }
-
- // The expected visit should be the finalURL because private mode
- // should not register a visit with the initialURL.
- uri = aSubject.QueryInterface(Ci.nsIURI);
- is(uri.spec, finalURL, "Check received expected visit");
- }
- }
- };
-
- aWindow.Services.obs.addObserver(observer, "uri-visit-saved", false);
-
- BrowserTestUtils.browserLoaded(aWindow.gBrowser.selectedBrowser).then(aCallback);
- aWindow.gBrowser.selectedBrowser.loadURI(aTestURI);
- }
-
- function testOnWindow(aOptions, aCallback) {
- whenNewWindowLoaded(aOptions, function(aWin) {
- windowsToClose.push(aWin);
- // execute should only be called when need, like when you are opening
- // web pages on the test. If calling executeSoon() is not necesary, then
- // call whenNewWindowLoaded() instead of testOnWindow() on your test.
- executeSoon(() => aCallback(aWin));
- });
- }
-
- // This function is called after calling finish() on the test.
- registerCleanupFunction(function() {
- windowsToClose.forEach(function(aWin) {
- aWin.close();
- });
- });
-
- // test first when on private mode
- testOnWindow({private: true}, function(aWin) {
- doTest(true, aWin, initialURL, function() {
- // then test when not on private mode
- testOnWindow({}, function(aWin2) {
- doTest(false, aWin2, finalURL, function () {
- PlacesTestUtils.clearHistory().then(finish);
- });
- });
- });
- });
-}
diff --git a/toolkit/components/places/tests/browser/colorAnalyzer/category-discover.png b/toolkit/components/places/tests/browser/colorAnalyzer/category-discover.png
deleted file mode 100644
index a6f5b49b3..000000000
--- a/toolkit/components/places/tests/browser/colorAnalyzer/category-discover.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/browser/colorAnalyzer/dictionaryGeneric-16.png b/toolkit/components/places/tests/browser/colorAnalyzer/dictionaryGeneric-16.png
deleted file mode 100644
index 4ad1a1a82..000000000
--- a/toolkit/components/places/tests/browser/colorAnalyzer/dictionaryGeneric-16.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/browser/colorAnalyzer/extensionGeneric-16.png b/toolkit/components/places/tests/browser/colorAnalyzer/extensionGeneric-16.png
deleted file mode 100644
index fc6c8a258..000000000
--- a/toolkit/components/places/tests/browser/colorAnalyzer/extensionGeneric-16.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/browser/colorAnalyzer/localeGeneric.png b/toolkit/components/places/tests/browser/colorAnalyzer/localeGeneric.png
deleted file mode 100644
index 4d9ac5ad8..000000000
--- a/toolkit/components/places/tests/browser/colorAnalyzer/localeGeneric.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/browser/favicon-normal16.png b/toolkit/components/places/tests/browser/favicon-normal16.png
deleted file mode 100644
index 62b69a3d0..000000000
--- a/toolkit/components/places/tests/browser/favicon-normal16.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/browser/favicon-normal32.png b/toolkit/components/places/tests/browser/favicon-normal32.png
deleted file mode 100644
index 5535363c9..000000000
--- a/toolkit/components/places/tests/browser/favicon-normal32.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/browser/favicon.html b/toolkit/components/places/tests/browser/favicon.html
deleted file mode 100644
index a0f5ea959..000000000
--- a/toolkit/components/places/tests/browser/favicon.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!--
- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
--->
-
-<html>
- <head>
- <link rel="shortcut icon" href="http://example.org/tests/toolkit/components/places/tests/browser/favicon-normal32.png">
- </head>
- <body>
- OK we're done!
- </body>
-</html>
diff --git a/toolkit/components/places/tests/browser/final.html b/toolkit/components/places/tests/browser/final.html
deleted file mode 100644
index ccd581918..000000000
--- a/toolkit/components/places/tests/browser/final.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!--
- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
--->
-
-<html>
- <body>
- OK we're done!
- </body>
-</html>
diff --git a/toolkit/components/places/tests/browser/head.js b/toolkit/components/places/tests/browser/head.js
deleted file mode 100644
index 897585a81..000000000
--- a/toolkit/components/places/tests/browser/head.js
+++ /dev/null
@@ -1,319 +0,0 @@
-Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
- "resource://testing-common/PlacesTestUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "BrowserTestUtils",
- "resource://testing-common/BrowserTestUtils.jsm");
-
-const TRANSITION_LINK = PlacesUtils.history.TRANSITION_LINK;
-const TRANSITION_TYPED = PlacesUtils.history.TRANSITION_TYPED;
-const TRANSITION_BOOKMARK = PlacesUtils.history.TRANSITION_BOOKMARK;
-const TRANSITION_REDIRECT_PERMANENT = PlacesUtils.history.TRANSITION_REDIRECT_PERMANENT;
-const TRANSITION_REDIRECT_TEMPORARY = PlacesUtils.history.TRANSITION_REDIRECT_TEMPORARY;
-const TRANSITION_EMBED = PlacesUtils.history.TRANSITION_EMBED;
-const TRANSITION_FRAMED_LINK = PlacesUtils.history.TRANSITION_FRAMED_LINK;
-const TRANSITION_DOWNLOAD = PlacesUtils.history.TRANSITION_DOWNLOAD;
-
-/**
- * Returns a moz_places field value for a url.
- *
- * @param aURI
- * The URI or spec to get field for.
- * param aCallback
- * Callback function that will get the property value.
- */
-function fieldForUrl(aURI, aFieldName, aCallback)
-{
- let url = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
- let stmt = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
- .DBConnection.createAsyncStatement(
- `SELECT ${aFieldName} FROM moz_places WHERE url_hash = hash(:page_url) AND url = :page_url`
- );
- stmt.params.page_url = url;
- stmt.executeAsync({
- _value: -1,
- handleResult: function(aResultSet) {
- let row = aResultSet.getNextRow();
- if (!row)
- ok(false, "The page should exist in the database");
- this._value = row.getResultByName(aFieldName);
- },
- handleError: function() {},
- handleCompletion: function(aReason) {
- if (aReason != Ci.mozIStorageStatementCallback.REASON_FINISHED)
- ok(false, "The statement should properly succeed");
- aCallback(this._value);
- }
- });
- stmt.finalize();
-}
-
-/**
- * Generic nsINavHistoryObserver that doesn't implement anything, but provides
- * dummy methods to prevent errors about an object not having a certain method.
- */
-function NavHistoryObserver() {}
-
-NavHistoryObserver.prototype = {
- onBeginUpdateBatch: function () {},
- onEndUpdateBatch: function () {},
- onVisit: function () {},
- onTitleChanged: function () {},
- onDeleteURI: function () {},
- onClearHistory: function () {},
- onPageChanged: function () {},
- onDeleteVisits: function () {},
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsINavHistoryObserver,
- ])
-};
-
-/**
- * Waits for the first OnPageChanged notification for ATTRIBUTE_FAVICON, and
- * verifies that it matches the expected page URI and associated favicon URI.
- *
- * This function also double-checks the GUID parameter of the notification.
- *
- * @param aExpectedPageURI
- * nsIURI object of the page whose favicon should change.
- * @param aExpectedFaviconURI
- * nsIURI object of the newly associated favicon.
- * @param aCallback
- * This function is called after the check finished.
- */
-function waitForFaviconChanged(aExpectedPageURI, aExpectedFaviconURI, aWindow,
- aCallback) {
- let historyObserver = {
- __proto__: NavHistoryObserver.prototype,
- onPageChanged: function WFFC_onPageChanged(aURI, aWhat, aValue, aGUID) {
- if (aWhat != Ci.nsINavHistoryObserver.ATTRIBUTE_FAVICON) {
- return;
- }
- aWindow.PlacesUtils.history.removeObserver(this);
-
- ok(aURI.equals(aExpectedPageURI),
- "Check URIs are equal for the page which favicon changed");
- is(aValue, aExpectedFaviconURI.spec,
- "Check changed favicon URI is the expected");
- checkGuidForURI(aURI, aGUID);
-
- if (aCallback) {
- aCallback();
- }
- }
- };
- aWindow.PlacesUtils.history.addObserver(historyObserver, false);
-}
-
-/**
- * Asynchronously adds visits to a page, invoking a callback function when done.
- *
- * @param aPlaceInfo
- * Either an nsIURI, in such a case a single LINK visit will be added.
- * Or can be an object describing the visit to add, or an array
- * of these objects:
- * { uri: nsIURI of the page,
- * transition: one of the TRANSITION_* from nsINavHistoryService,
- * [optional] title: title of the page,
- * [optional] visitDate: visit date in microseconds from the epoch
- * [optional] referrer: nsIURI of the referrer for this visit
- * }
- * @param [optional] aCallback
- * Function to be invoked on completion.
- * @param [optional] aStack
- * The stack frame used to report errors.
- */
-function addVisits(aPlaceInfo, aWindow, aCallback, aStack) {
- let places = [];
- if (aPlaceInfo instanceof Ci.nsIURI) {
- places.push({ uri: aPlaceInfo });
- }
- else if (Array.isArray(aPlaceInfo)) {
- places = places.concat(aPlaceInfo);
- } else {
- places.push(aPlaceInfo)
- }
-
- // Create mozIVisitInfo for each entry.
- let now = Date.now();
- for (let place of places) {
- if (!place.title) {
- place.title = "test visit for " + place.uri.spec;
- }
- place.visits = [{
- transitionType: place.transition === undefined ? TRANSITION_LINK
- : place.transition,
- visitDate: place.visitDate || (now++) * 1000,
- referrerURI: place.referrer
- }];
- }
-
- aWindow.PlacesUtils.asyncHistory.updatePlaces(
- places,
- {
- handleError: function AAV_handleError() {
- throw ("Unexpected error in adding visit.");
- },
- handleResult: function () {},
- handleCompletion: function UP_handleCompletion() {
- if (aCallback)
- aCallback();
- }
- }
- );
-}
-
-/**
- * Checks that the favicon for the given page matches the provided data.
- *
- * @param aPageURI
- * nsIURI object for the page to check.
- * @param aExpectedMimeType
- * Expected MIME type of the icon, for example "image/png".
- * @param aExpectedData
- * Expected icon data, expressed as an array of byte values.
- * @param aCallback
- * This function is called after the check finished.
- */
-function checkFaviconDataForPage(aPageURI, aExpectedMimeType, aExpectedData,
- aWindow, aCallback) {
- aWindow.PlacesUtils.favicons.getFaviconDataForPage(aPageURI,
- function (aURI, aDataLen, aData, aMimeType) {
- is(aExpectedMimeType, aMimeType, "Check expected MimeType");
- is(aExpectedData.length, aData.length,
- "Check favicon data for the given page matches the provided data");
- checkGuidForURI(aPageURI);
- aCallback();
- });
-}
-
-/**
- * Tests that a guid was set in moz_places for a given uri.
- *
- * @param aURI
- * The uri to check.
- * @param [optional] aGUID
- * The expected guid in the database.
- */
-function checkGuidForURI(aURI, aGUID) {
- let guid = doGetGuidForURI(aURI);
- if (aGUID) {
- doCheckValidPlacesGuid(aGUID);
- is(guid, aGUID, "Check equal guid for URIs");
- }
-}
-
-/**
- * Retrieves the guid for a given uri.
- *
- * @param aURI
- * The uri to check.
- * @return the associated the guid.
- */
-function doGetGuidForURI(aURI) {
- let stmt = DBConn().createStatement(
- `SELECT guid
- FROM moz_places
- WHERE url_hash = hash(:url) AND url = :url`
- );
- stmt.params.url = aURI.spec;
- ok(stmt.executeStep(), "Check get guid for uri from moz_places");
- let guid = stmt.row.guid;
- stmt.finalize();
- doCheckValidPlacesGuid(guid);
- return guid;
-}
-
-/**
- * Tests if a given guid is valid for use in Places or not.
- *
- * @param aGuid
- * The guid to test.
- */
-function doCheckValidPlacesGuid(aGuid) {
- ok(/^[a-zA-Z0-9\-_]{12}$/.test(aGuid), "Check guid for valid places");
-}
-
-/**
- * Gets the database connection. If the Places connection is invalid it will
- * try to create a new connection.
- *
- * @param [optional] aForceNewConnection
- * Forces creation of a new connection to the database. When a
- * connection is asyncClosed it cannot anymore schedule async statements,
- * though connectionReady will keep returning true (Bug 726990).
- *
- * @return The database connection or null if unable to get one.
- */
-function DBConn(aForceNewConnection) {
- let gDBConn;
- if (!aForceNewConnection) {
- let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
- .DBConnection;
- if (db.connectionReady)
- return db;
- }
-
- // If the Places database connection has been closed, create a new connection.
- if (!gDBConn || aForceNewConnection) {
- let file = Services.dirsvc.get('ProfD', Ci.nsIFile);
- file.append("places.sqlite");
- let dbConn = gDBConn = Services.storage.openDatabase(file);
-
- // Be sure to cleanly close this connection.
- Services.obs.addObserver(function DBCloseCallback(aSubject, aTopic, aData) {
- Services.obs.removeObserver(DBCloseCallback, aTopic);
- dbConn.asyncClose();
- }, "profile-before-change", false);
- }
-
- return gDBConn.connectionReady ? gDBConn : null;
-}
-
-function whenNewWindowLoaded(aOptions, aCallback) {
- BrowserTestUtils.waitForNewWindow().then(aCallback);
- OpenBrowserWindow(aOptions);
-}
-
-/**
- * Asynchronously check a url is visited.
- *
- * @param aURI The URI.
- * @param aExpectedValue The expected value.
- * @return {Promise}
- * @resolves When the check has been added successfully.
- * @rejects JavaScript exception.
- */
-function promiseIsURIVisited(aURI, aExpectedValue) {
- return new Promise(resolve => {
- PlacesUtils.asyncHistory.isURIVisited(aURI, function(unused, aIsVisited) {
- resolve(aIsVisited);
- });
- });
-}
-
-function waitForCondition(condition, nextTest, errorMsg) {
- let tries = 0;
- let interval = setInterval(function() {
- if (tries >= 30) {
- ok(false, errorMsg);
- moveOn();
- }
- let conditionPassed;
- try {
- conditionPassed = condition();
- } catch (e) {
- ok(false, e + "\n" + e.stack);
- conditionPassed = false;
- }
- if (conditionPassed) {
- moveOn();
- }
- tries++;
- }, 200);
- function moveOn() {
- clearInterval(interval);
- nextTest();
- }
-}
diff --git a/toolkit/components/places/tests/browser/history_post.html b/toolkit/components/places/tests/browser/history_post.html
deleted file mode 100644
index a579a9b8a..000000000
--- a/toolkit/components/places/tests/browser/history_post.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE HTML>
-<html>
- <head>
- <title>Test post pages are not added to history</title>
- </head>
- <body>
- <iframe name="post_iframe" id="post_iframe"></iframe>
- <form method="post" action="http://example.com/tests/toolkit/components/places/tests/browser/history_post.sjs" target="post_iframe">
- <input type="submit" id="submit"/>
- </form>
- </body>
-</html>
diff --git a/toolkit/components/places/tests/browser/history_post.sjs b/toolkit/components/places/tests/browser/history_post.sjs
deleted file mode 100644
index 3c86aad7b..000000000
--- a/toolkit/components/places/tests/browser/history_post.sjs
+++ /dev/null
@@ -1,6 +0,0 @@
-function handleRequest(request, response)
-{
- response.setStatusLine("1.0", 200, "OK");
- response.setHeader("Content-Type", "text/plain; charset=utf-8", false);
- response.write("Ciao");
-}
diff --git a/toolkit/components/places/tests/browser/redirect-target.html b/toolkit/components/places/tests/browser/redirect-target.html
deleted file mode 100644
index 370026338..000000000
--- a/toolkit/components/places/tests/browser/redirect-target.html
+++ /dev/null
@@ -1 +0,0 @@
-<!DOCTYPE html><html><body><p>Ciao!</p></body></html>
diff --git a/toolkit/components/places/tests/browser/redirect.sjs b/toolkit/components/places/tests/browser/redirect.sjs
deleted file mode 100644
index f55e78eb1..000000000
--- a/toolkit/components/places/tests/browser/redirect.sjs
+++ /dev/null
@@ -1,14 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function handleRequest(request, response)
-{
- let page = "<!DOCTYPE html><html><body><p>Redirecting...</p></body></html>";
-
- response.setStatusLine(request.httpVersion, "301", "Moved Permanently");
- response.setHeader("Content-Type", "text/html", false);
- response.setHeader("Content-Length", page.length + "", false);
- response.setHeader("Location", "redirect-target.html", false);
- response.write(page);
-}
diff --git a/toolkit/components/places/tests/browser/redirect_once.sjs b/toolkit/components/places/tests/browser/redirect_once.sjs
deleted file mode 100644
index 8b2a8aa55..000000000
--- a/toolkit/components/places/tests/browser/redirect_once.sjs
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-function handleRequest(request, response) {
- response.setStatusLine("1.1", 301, "Found");
- response.setHeader("Location", "final.html", false);
-}
diff --git a/toolkit/components/places/tests/browser/redirect_twice.sjs b/toolkit/components/places/tests/browser/redirect_twice.sjs
deleted file mode 100644
index 099d20022..000000000
--- a/toolkit/components/places/tests/browser/redirect_twice.sjs
+++ /dev/null
@@ -1,9 +0,0 @@
-/**
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-function handleRequest(request, response) {
- response.setStatusLine("1.1", 302, "Found");
- response.setHeader("Location", "redirect_once.sjs", false);
-}
diff --git a/toolkit/components/places/tests/browser/title1.html b/toolkit/components/places/tests/browser/title1.html
deleted file mode 100644
index 3c98d693e..000000000
--- a/toolkit/components/places/tests/browser/title1.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!--
- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
--->
-
-<html>
- <head>
- </head>
- <body>
- title1.html
- </body>
-</html>
diff --git a/toolkit/components/places/tests/browser/title2.html b/toolkit/components/places/tests/browser/title2.html
deleted file mode 100644
index 28a6b69b5..000000000
--- a/toolkit/components/places/tests/browser/title2.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<!--
- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
--->
-
-<html>
- <head>
- <title>Some title</title>
- </head>
- <body>
- title2.html
- </body>
-</html>
-
diff --git a/toolkit/components/places/tests/chrome/.eslintrc.js b/toolkit/components/places/tests/chrome/.eslintrc.js
deleted file mode 100644
index bf379df8d..000000000
--- a/toolkit/components/places/tests/chrome/.eslintrc.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/chrome.eslintrc.js",
- "../../../../../testing/mochitest/mochitest.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/places/tests/chrome/bad_links.atom b/toolkit/components/places/tests/chrome/bad_links.atom
deleted file mode 100644
index 446927252..000000000
--- a/toolkit/components/places/tests/chrome/bad_links.atom
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom">
-
- <title>Example Feed</title>
- <link href="http://example.org/"/>
- <updated>2003-12-13T18:30:02Z</updated>
-
- <author>
- <name>John Doe</name>
- </author>
- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
-
- <entry>
-
- <title>First good item</title>
- <link href="http://example.org/first"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- <updated>2003-12-13T18:30:02Z</updated>
-
- <summary>Some text.</summary>
- </entry>
-
- <entry>
-
- <title>data: link</title>
- <link href="data:text/plain,Hi"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6b</id>
- <updated>2003-12-13T18:30:03Z</updated>
-
- <summary>Some text.</summary>
- </entry>
-
- <entry>
-
- <title>javascript: link</title>
- <link href="javascript:alert('Hi')"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6c</id>
- <updated>2003-12-13T18:30:04Z</updated>
-
- <summary>Some text.</summary>
- </entry>
-
- <entry>
-
- <title>file: link</title>
- <link href="file:///var/"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6d</id>
- <updated>2003-12-13T18:30:05Z</updated>
-
- <summary>Some text.</summary>
- </entry>
-
- <entry>
-
- <title>chrome: link</title>
- <link href="chrome://browser/content/browser.js"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6e</id>
- <updated>2003-12-13T18:30:06Z</updated>
-
- <summary>Some text.</summary>
- </entry>
-
- <entry>
-
- <title>Last good item</title>
- <link href="http://example.org/last"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6b</id>
- <updated>2003-12-13T18:30:07Z</updated>
-
- <summary>Some text.</summary>
- </entry>
-
-
-</feed>
diff --git a/toolkit/components/places/tests/chrome/browser_disableglobalhistory.xul b/toolkit/components/places/tests/chrome/browser_disableglobalhistory.xul
deleted file mode 100644
index d7bbfda67..000000000
--- a/toolkit/components/places/tests/chrome/browser_disableglobalhistory.xul
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window title="Test disableglobalhistory attribute on remote browsers"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="run_test();">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"></script>
-
- <browser id="inprocess_disabled" src="about:blank" type="content" disableglobalhistory="true" />
- <browser id="inprocess_enabled" src="about:blank" type="content" />
-
- <browser id="remote_disabled" src="about:blank" type="content" disableglobalhistory="true" />
- <browser id="remote_enabled" src="about:blank" type="content" />
-
- <script type="text/javascript;version=1.7">
- const {interfaces: Ci, classes: Cc, results: Cr, utils: Cu} = Components;
-
- Cu.import("resource://testing-common/ContentTask.jsm");
- ContentTask.setTestScope(window.opener.wrappedJSObject);
-
- function expectUseGlobalHistory(id, expected) {
- let browser = document.getElementById(id);
- return ContentTask.spawn(browser, {id, expected}, function*({id, expected}) {
- Assert.equal(docShell.useGlobalHistory, expected,
- "Got the right useGlobalHistory state in the docShell of " + id);
- });
- }
-
- function run_test() {
- spawn_task(function*() {
- yield expectUseGlobalHistory("inprocess_disabled", false);
- yield expectUseGlobalHistory("inprocess_enabled", true);
-
- yield expectUseGlobalHistory("remote_disabled", false);
- yield expectUseGlobalHistory("remote_enabled", true);
- window.opener.done();
- });
- };
-
- </script>
-</window> \ No newline at end of file
diff --git a/toolkit/components/places/tests/chrome/chrome.ini b/toolkit/components/places/tests/chrome/chrome.ini
deleted file mode 100644
index 5ac753e73..000000000
--- a/toolkit/components/places/tests/chrome/chrome.ini
+++ /dev/null
@@ -1,12 +0,0 @@
-[DEFAULT]
-
-[test_303567.xul]
-[test_341972a.xul]
-[test_341972b.xul]
-[test_342484.xul]
-[test_371798.xul]
-[test_381357.xul]
-[test_favicon_annotations.xul]
-[test_reloadLivemarks.xul]
-[test_browser_disableglobalhistory.xul]
-support-files = browser_disableglobalhistory.xul \ No newline at end of file
diff --git a/toolkit/components/places/tests/chrome/link-less-items-no-site-uri.rss b/toolkit/components/places/tests/chrome/link-less-items-no-site-uri.rss
deleted file mode 100644
index 612b0a5c2..000000000
--- a/toolkit/components/places/tests/chrome/link-less-items-no-site-uri.rss
+++ /dev/null
@@ -1,18 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<rss version="2.0">
- <channel>
- <title>feed title</title>
- <ttl>180</ttl>
- <item>
- <title>linked feed item</title>
- <link>http://feed-item-link.com</link>
- </item>
- <item>
- <title>link-less feed item</title>
- </item>
- <item>
- <title>linked feed item</title>
- <link>http://feed-item-link.com</link>
- </item>
- </channel>
-</rss>
diff --git a/toolkit/components/places/tests/chrome/link-less-items.rss b/toolkit/components/places/tests/chrome/link-less-items.rss
deleted file mode 100644
index a30d4a353..000000000
--- a/toolkit/components/places/tests/chrome/link-less-items.rss
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<rss version="2.0">
- <channel>
- <title>feed title</title>
- <link>http://feed-link.com</link>
- <ttl>180</ttl>
- <item>
- <title>linked feed item</title>
- <link>http://feed-item-link.com</link>
- </item>
- <item>
- <title>link-less feed item</title>
- </item>
- <item>
- <title>linked feed item</title>
- <link>http://feed-item-link.com</link>
- </item>
- </channel>
-</rss>
diff --git a/toolkit/components/places/tests/chrome/rss_as_html.rss b/toolkit/components/places/tests/chrome/rss_as_html.rss
deleted file mode 100644
index e82305035..000000000
--- a/toolkit/components/places/tests/chrome/rss_as_html.rss
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1" ?>
-<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/">
-<channel>
-<title>sadfasdfasdfasfasdf</title>
-<link>http://www.example.com</link>
-<description>asdfasdfasdf.example.com</description>
-<language>de</language>
-<copyright>asdfasdfasdfasdf</copyright>
-<lastBuildDate>Tue, 11 Mar 2008 18:52:52 +0100</lastBuildDate>
-<docs>http://blogs.law.harvard.edu/tech/rss</docs>
-<ttl>10</ttl>
-<item>
-<title>The First Title</title>
-<link>http://www.example.com/index.html</link>
-<pubDate>Tue, 11 Mar 2008 18:24:43 +0100</pubDate>
-<content:encoded>
-<![CDATA[
-<p>
-askdlfjas;dfkjas;fkdj
-</p>
-]]>
-</content:encoded>
-<description>aklsjdhfasdjfahasdfhj</description>
-<guid>http://foo.example.com/asdfasdf</guid>
-</item>
-</channel>
-</rss>
diff --git a/toolkit/components/places/tests/chrome/rss_as_html.rss^headers^ b/toolkit/components/places/tests/chrome/rss_as_html.rss^headers^
deleted file mode 100644
index 04fbaa08f..000000000
--- a/toolkit/components/places/tests/chrome/rss_as_html.rss^headers^
+++ /dev/null
@@ -1,2 +0,0 @@
-HTTP 200 OK
-Content-Type: text/html
diff --git a/toolkit/components/places/tests/chrome/sample_feed.atom b/toolkit/components/places/tests/chrome/sample_feed.atom
deleted file mode 100644
index add75efb4..000000000
--- a/toolkit/components/places/tests/chrome/sample_feed.atom
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom">
-
- <title>Example Feed</title>
- <link href="http://example.org/"/>
- <updated>2003-12-13T18:30:02Z</updated>
-
- <author>
- <name>John Doe</name>
- </author>
- <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>
-
- <entry>
-
- <title>Atom-Powered Robots Run Amok</title>
- <link href="http://example.org/2003/12/13/atom03"/>
- <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
- <updated>2003-12-13T18:30:02Z</updated>
-
- <summary>Some text.</summary>
- </entry>
-
-</feed>
diff --git a/toolkit/components/places/tests/chrome/test_303567.xul b/toolkit/components/places/tests/chrome/test_303567.xul
deleted file mode 100644
index 37ae77cbb..000000000
--- a/toolkit/components/places/tests/chrome/test_303567.xul
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<window title="Add Bad Livemarks"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTest()">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml" />
-
-<script type="application/javascript">
-<![CDATA[
-// Test that for feeds with items that have no link:
-// * the link-less items are present in the database.
-// * the feed's site URI is substituted for each item's link.
-SimpleTest.waitForExplicitFinish();
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
-
-const LIVEMARKS = [
- { feedURI: NetUtil.newURI("http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/link-less-items.rss"),
- siteURI: NetUtil.newURI("http://mochi.test:8888/"),
- urls: [
- "http://feed-item-link.com/",
- "http://feed-link.com/",
- "http://feed-item-link.com/",
- ],
- message: "Ensure link-less livemark item picked up site uri.",
- },
- { feedURI: NetUtil.newURI("http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/link-less-items-no-site-uri.rss"),
- siteURI: null,
- urls: [
- "http://feed-item-link.com/",
- "http://feed-item-link.com/",
- ],
- message: "Ensure livemark item links did not inherit site uri."
- },
-];
-
-function runTest()
-{
- let loadCount = 0;
-
- function testLivemark(aLivemarkData) {
- PlacesUtils.livemarks.addLivemark(
- { title: "foo"
- , parentGuid: PlacesUtils.bookmarks.toolbarGuid
- , feedURI: aLivemarkData.feedURI
- , siteURI: aLivemarkData.siteURI
- })
- .then(function (aLivemark) {
- is (aLivemark.feedURI.spec, aLivemarkData.feedURI.spec,
- "Get correct feedURI");
- if (aLivemarkData.siteURI) {
- is (aLivemark.siteURI.spec, aLivemarkData.siteURI.spec,
- "Get correct siteURI");
- }
- else {
- is (aLivemark.siteURI, null, "Get correct siteURI");
- }
-
- waitForLivemarkLoad(aLivemark, function (aLivemark) {
- let nodes = aLivemark.getNodesForContainer({});
- is(nodes.length, aLivemarkData.urls.length,
- "Ensure all the livemark items were created.");
- aLivemarkData.urls.forEach(function (aUrl, aIndex) {
- let node = nodes[aIndex];
- is(node.uri, aUrl, aLivemarkData.message);
- });
-
- PlacesUtils.livemarks.removeLivemark(aLivemark).then(() => {
- if (++loadCount == LIVEMARKS.length)
- SimpleTest.finish();
- });
- });
- }, function () {
- is(true, false, "Should not fail adding a livemark");
- }
- );
- }
-
- LIVEMARKS.forEach(testLivemark);
-}
-
-function waitForLivemarkLoad(aLivemark, aCallback) {
- // Don't need a real node here.
- let node = {};
- let resultObserver = {
- nodeInserted: function() {},
- nodeRemoved: function() {},
- nodeAnnotationChanged: function() {},
- nodeTitleChanged: function() {},
- nodeHistoryDetailsChanged: function() {},
- nodeMoved: function() {},
- ontainerStateChanged: function () {},
- sortingChanged: function() {},
- batching: function() {},
- invalidateContainer: function(node) {
- isnot(aLivemark.status, Ci.mozILivemark.STATUS_FAILED,
- "Loading livemark should success");
- if (aLivemark.status == Ci.mozILivemark.STATUS_READY) {
- aLivemark.unregisterForUpdates(node, resultObserver);
- aCallback(aLivemark);
- }
- }
- };
- aLivemark.registerForUpdates(node, resultObserver);
- aLivemark.reload();
-}
-
-]]>
-</script>
-</window>
diff --git a/toolkit/components/places/tests/chrome/test_341972a.xul b/toolkit/components/places/tests/chrome/test_341972a.xul
deleted file mode 100644
index 7c78136a9..000000000
--- a/toolkit/components/places/tests/chrome/test_341972a.xul
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<window title="Update Livemark SiteURI"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTest()">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml" />
-
-<script type="application/javascript">
-<![CDATA[
-/*
- Test updating livemark siteURI to the value from the feed
- */
-SimpleTest.waitForExplicitFinish();
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
-
-function runTest() {
- const FEEDSPEC = "http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/sample_feed.atom";
- const INITIALSITESPEC = "http://mochi.test:8888/";
- const FEEDSITESPEC = "http://example.org/";
-
- PlacesUtils.livemarks.addLivemark(
- { title: "foo"
- , parentGuid: PlacesUtils.bookmarks.toolbarGuid
- , feedURI: NetUtil.newURI(FEEDSPEC)
- , siteURI: NetUtil.newURI(INITIALSITESPEC)
- })
- .then(function (aLivemark) {
- is(aLivemark.siteURI.spec, INITIALSITESPEC,
- "Has correct initial livemark site URI");
-
- waitForLivemarkLoad(aLivemark, function (aLivemark) {
- is(aLivemark.siteURI.spec, FEEDSITESPEC,
- "livemark site URI set to value in feed");
-
- PlacesUtils.livemarks.removeLivemark(aLivemark).then(() => {
- SimpleTest.finish();
- });
- });
- }, function () {
- is(true, false, "Should not fail adding a livemark");
- }
- );
-}
-
-function waitForLivemarkLoad(aLivemark, aCallback) {
- // Don't need a real node here.
- let node = {};
- let resultObserver = {
- nodeInserted: function() {},
- nodeRemoved: function() {},
- nodeAnnotationChanged: function() {},
- nodeTitleChanged: function() {},
- nodeHistoryDetailsChanged: function() {},
- nodeMoved: function() {},
- ontainerStateChanged: function () {},
- sortingChanged: function() {},
- batching: function() {},
- invalidateContainer: function(node) {
- isnot(aLivemark.status, Ci.mozILivemark.STATUS_FAILED,
- "Loading livemark should success");
- if (aLivemark.status == Ci.mozILivemark.STATUS_READY) {
- aLivemark.unregisterForUpdates(node, resultObserver);
- aCallback(aLivemark);
- }
- }
- };
- aLivemark.registerForUpdates(node, resultObserver);
- aLivemark.reload();
-}
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/components/places/tests/chrome/test_341972b.xul b/toolkit/components/places/tests/chrome/test_341972b.xul
deleted file mode 100644
index 86cdc75f3..000000000
--- a/toolkit/components/places/tests/chrome/test_341972b.xul
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<window title="Update Livemark SiteURI, null to start"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTest()">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml" />
-
-<script type="application/javascript">
-<![CDATA[
-/*
- Test updating livemark siteURI to the value from the feed, when it's null
- */
-SimpleTest.waitForExplicitFinish();
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
-
-function runTest() {
- const FEEDSPEC = "http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/sample_feed.atom";
- const FEEDSITESPEC = "http://example.org/";
-
- PlacesUtils.livemarks.addLivemark(
- { title: "foo"
- , parentGuid: PlacesUtils.bookmarks.toolbarGuid
- , feedURI: NetUtil.newURI(FEEDSPEC)
- })
- .then(function (aLivemark) {
- is(aLivemark.siteURI, null, "Has null livemark site URI");
-
- waitForLivemarkLoad(aLivemark, function (aLivemark) {
- is(aLivemark.siteURI.spec, FEEDSITESPEC,
- "livemark site URI set to value in feed");
-
- PlacesUtils.livemarks.removeLivemark(aLivemark).then(() => {
- SimpleTest.finish();
- });
- });
- }, function () {
- is(true, false, "Should not fail adding a livemark");
- }
- );
-}
-
-function waitForLivemarkLoad(aLivemark, aCallback) {
- // Don't need a real node here.
- let node = {};
- let resultObserver = {
- nodeInserted: function() {},
- nodeRemoved: function() {},
- nodeAnnotationChanged: function() {},
- nodeTitleChanged: function() {},
- nodeHistoryDetailsChanged: function() {},
- nodeMoved: function() {},
- ontainerStateChanged: function () {},
- sortingChanged: function() {},
- batching: function() {},
- invalidateContainer: function(node) {
- isnot(aLivemark.status, Ci.mozILivemark.STATUS_FAILED,
- "Loading livemark should success");
- if (aLivemark.status == Ci.mozILivemark.STATUS_READY) {
- aLivemark.unregisterForUpdates(node, resultObserver);
- aCallback(aLivemark);
- }
- }
- };
- aLivemark.registerForUpdates(node, resultObserver);
- aLivemark.reload();
-}
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/components/places/tests/chrome/test_342484.xul b/toolkit/components/places/tests/chrome/test_342484.xul
deleted file mode 100644
index 353313abb..000000000
--- a/toolkit/components/places/tests/chrome/test_342484.xul
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<window title="Add Bad Livemarks"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTest()">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml" />
-
-<script type="application/javascript">
-<![CDATA[
-/*
- Test loading feeds with items that aren't allowed
- */
-SimpleTest.waitForExplicitFinish();
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
-
-function runTest() {
- const FEEDSPEC = "http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/bad_links.atom";
- const GOOD_URLS = ["http://example.org/first", "http://example.org/last"];
-
- PlacesUtils.livemarks.addLivemark(
- { title: "foo"
- , parentGuid: PlacesUtils.bookmarks.toolbarGuid
- , feedURI: NetUtil.newURI(FEEDSPEC)
- , siteURI: NetUtil.newURI("http:/mochi.test/")
- })
- .then(function (aLivemark) {
- waitForLivemarkLoad(aLivemark, function (aLivemark) {
- let nodes = aLivemark.getNodesForContainer({});
-
- is(nodes.length, 2, "Created the two good livemark items");
- for (let i = 0; i < nodes.length; ++i) {
- let node = nodes[i];
- ok(GOOD_URLS.includes(node.uri), "livemark item created with bad uri " + node.uri);
- }
-
- PlacesUtils.livemarks.removeLivemark(aLivemark).then(() => {
- SimpleTest.finish();
- });
- });
- }, function () {
- is(true, false, "Should not fail adding a livemark");
- }
- );
-}
-
-function waitForLivemarkLoad(aLivemark, aCallback) {
- // Don't need a real node here.
- let node = {};
- let resultObserver = {
- nodeInserted: function() {},
- nodeRemoved: function() {},
- nodeAnnotationChanged: function() {},
- nodeTitleChanged: function() {},
- nodeHistoryDetailsChanged: function() {},
- nodeMoved: function() {},
- ontainerStateChanged: function () {},
- sortingChanged: function() {},
- batching: function() {},
- invalidateContainer: function(node) {
- isnot(aLivemark.status, Ci.mozILivemark.STATUS_FAILED,
- "Loading livemark should success");
- if (aLivemark.status == Ci.mozILivemark.STATUS_READY) {
- aLivemark.unregisterForUpdates(node, resultObserver);
- aCallback(aLivemark);
- }
- }
- };
- aLivemark.registerForUpdates(node, resultObserver);
- aLivemark.reload();
-}
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/components/places/tests/chrome/test_371798.xul b/toolkit/components/places/tests/chrome/test_371798.xul
deleted file mode 100644
index 241db75c3..000000000
--- a/toolkit/components/places/tests/chrome/test_371798.xul
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<window title="Bug 371798"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml" />
-
-<script type="application/javascript">
-<![CDATA[
-// Test the asynchronous live-updating of bookmarks query results
-SimpleTest.waitForExplicitFinish();
-
-var {utils: Cu, interfaces: Ci} = Components;
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-
-const TEST_URI = NetUtil.newURI("http://foo.com");
-
-function promiseOnItemChanged() {
- return new Promise(resolve => {
- PlacesUtils.bookmarks.addObserver({
- onBeginUpdateBatch() {},
- onEndUpdateBatch() {},
- onItemAdded() {},
- onItemRemoved() {},
- onItemVisited() {},
- onItemMoved() {},
-
- onItemChanged() {
- PlacesUtils.bookmarks.removeObserver(this);
- resolve();
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver])
- }, false);
- });
-}
-
-Task.spawn(function* () {
- // add 2 bookmarks to the toolbar, same URI, different titles (set later)
- let bm1 = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- url: TEST_URI
- });
-
- let bm2 = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- url: TEST_URI
- });
-
- // query for bookmarks
- let rootNode = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root;
-
- // set up observer
- let promiseObserved = promiseOnItemChanged();
-
- // modify the bookmark's title
- yield PlacesUtils.bookmarks.update({
- guid: bm2.guid, title: "foo"
- });
-
- // wait for notification
- yield promiseObserved;
-
- // Continue after our observer gets notified of onItemChanged
- // which is triggered by updating the item's title.
- // After receiving the notification, our original query should also
- // have been live-updated, so we can iterate through its children,
- // to check that only the modified bookmark has changed.
-
- // result node should be updated
- let cc = rootNode.childCount;
- for (let i = 0; i < cc; ++i) {
- let node = rootNode.getChild(i);
- // test that bm1 does not have new title
- if (node.bookmarkGuid == bm1.guid)
- ok(node.title != "foo",
- "Changing a bookmark's title did not affect the title of other bookmarks with the same URI");
- }
- rootNode.containerOpen = false;
-
- // clean up
- yield PlacesUtils.bookmarks.remove(bm1);
- yield PlacesUtils.bookmarks.remove(bm2);
-}).catch(err => {
- ok(false, `uncaught error: ${err}`);
-}).then(() => {
- SimpleTest.finish();
-});
-]]>
-</script>
-
-</window>
diff --git a/toolkit/components/places/tests/chrome/test_381357.xul b/toolkit/components/places/tests/chrome/test_381357.xul
deleted file mode 100644
index 6bd6cb024..000000000
--- a/toolkit/components/places/tests/chrome/test_381357.xul
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<window title="Add Livemarks from RSS feed served as text/html"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTest()">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml" />
-
-<script type="application/javascript">
-<![CDATA[
-/*
- Test loading feeds with text/html
- */
-SimpleTest.waitForExplicitFinish();
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
-
-function runTest() {
- const FEEDSPEC = "http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/rss_as_html.rss";
-
- PlacesUtils.livemarks.addLivemark(
- { title: "foo"
- , parentGuid: PlacesUtils.bookmarks.toolbarGuid
- , feedURI: NetUtil.newURI(FEEDSPEC)
- , siteURI: NetUtil.newURI("http:/mochi.test/")
- })
- .then(function (aLivemark) {
- waitForLivemarkLoad(aLivemark, function (aLivemark) {
- let nodes = aLivemark.getNodesForContainer({});
-
- is(nodes[0].title, "The First Title",
- "livemark site URI set to value in feed");
-
- PlacesUtils.livemarks.removeLivemark(aLivemark).then(() => {
- SimpleTest.finish();
- });
- });
- }, function () {
- is(true, false, "Should not fail adding a livemark");
- SimpleTest.finish();
- }
- );
-}
-
-function waitForLivemarkLoad(aLivemark, aCallback) {
- // Don't need a real node here.
- let node = {};
- let resultObserver = {
- nodeInserted: function() {},
- nodeRemoved: function() {},
- nodeAnnotationChanged: function() {},
- nodeTitleChanged: function() {},
- nodeHistoryDetailsChanged: function() {},
- nodeMoved: function() {},
- ontainerStateChanged: function () {},
- sortingChanged: function() {},
- batching: function() {},
- invalidateContainer: function(node) {
- isnot(aLivemark.status, Ci.mozILivemark.STATUS_FAILED,
- "Loading livemark should success");
- if (aLivemark.status == Ci.mozILivemark.STATUS_READY) {
- aLivemark.unregisterForUpdates(node, resultObserver);
- aCallback(aLivemark);
- }
- }
- };
- aLivemark.registerForUpdates(node, resultObserver);
- aLivemark.reload();
-}
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/components/places/tests/chrome/test_browser_disableglobalhistory.xul b/toolkit/components/places/tests/chrome/test_browser_disableglobalhistory.xul
deleted file mode 100644
index 3a84f3030..000000000
--- a/toolkit/components/places/tests/chrome/test_browser_disableglobalhistory.xul
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-
-<window title="Test disableglobalhistory attribute on remote browsers"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- </body>
-
- <script type="text/javascript;version=1.7">
- SimpleTest.waitForExplicitFinish();
-
- let w = window.open('browser_disableglobalhistory.xul', '_blank', 'chrome,resizable=yes,width=400,height=600');
-
- function done() {
- w.close();
- SimpleTest.finish();
- }
- </script>
-
-</window> \ No newline at end of file
diff --git a/toolkit/components/places/tests/chrome/test_favicon_annotations.xul b/toolkit/components/places/tests/chrome/test_favicon_annotations.xul
deleted file mode 100644
index b7647cbc6..000000000
--- a/toolkit/components/places/tests/chrome/test_favicon_annotations.xul
+++ /dev/null
@@ -1,168 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<!--
- * This file tests the moz-anno protocol, which was added in Bug 316077 and how
- * it loads favicons.
--->
-
-<window title="Favicon Annotation Protocol Test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="test();">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
- <script type="application/javascript">
- <![CDATA[
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-
-let fs = Cc["@mozilla.org/browser/favicon-service;1"].
- getService(Ci.nsIFaviconService);
-
-// Test descriptions that will be printed in the case of failure.
-let testDescriptions = [
- "moz-anno URI with no data in the database loads default icon",
- "URI added to the database is properly loaded",
-];
-
-// URIs to load (will be compared with expectedURIs of the same index).
-let testURIs = [
- "http://mozilla.org/2009/made-up-favicon/places-rocks/",
- "http://mozilla.org/should-be-barney/",
-];
-
-// URIs to load for expected results.
-let expectedURIs = [
- fs.defaultFavicon.spec,
- "data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%10%00%00%00%10%08%06%00%00%00%1F%F3%FFa%00%00%00%04gAMA%00%00%AF%C87%05%8A%E9%00%00%00%19tEXtSoftware%00Adobe%20ImageReadyq%C9e%3C%00%00%01%D6IDATx%DAb%FC%FF%FF%3F%03%25%00%20%80%98%909%EF%DF%BFg%EF%EC%EC%FC%AD%AC%AC%FC%DF%95%91%F1%BF%89%89%C9%7F%20%FF%D7%EA%D5%AB%B7%DF%BBwO%16%9B%01%00%01%C4%00r%01%08%9F9s%C6%CD%D8%D8%F8%BF%0B%03%C3%FF3%40%BC%0A%88%EF%02q%1A%10%BB%40%F1%AAU%ABv%C1%D4%C30%40%00%81%89%993g%3E%06%1A%F6%3F%14%AA%11D%97%03%F1%7Fc%08%0D%E2%2B))%FD%17%04%89%A1%19%00%10%40%0C%D00%F8%0F3%00%C8%F8%BF%1B%E4%0Ac%88a%E5%60%17%19%FF%0F%0D%0D%05%1B%02v%D9%DD%BB%0A0%03%00%02%08%AC%B9%A3%A3%E3%17%03%D4v%90%01%EF%18%106%C3%0Cz%07%C5%BB%A1%DE%82y%07%20%80%A0%A6%08B%FCn%0C1%60%26%D4%20d%C3VA%C3%06%26%BE%0A%EA-%80%00%82%B9%E0%F7L4%0D%EF%90%F8%C6%60%2F%0A%82%BD%01%13%07%0700%D0%01%02%88%11%E4%02P%B41%DC%BB%C7%D0%014%0D%E8l%06W%20%06%BA%88%A1%1C%1AS%15%40%7C%16%CA6.%2Fgx%BFg%0F%83%CB%D9%B3%0C%7B%80%7C%80%00%02%BB%00%E8%9F%ED%20%1B%3A%A0%A6%9F%81%DA%DC%01%C5%B0%80%ED%80%FA%BF%BC%BC%FC%3F%83%12%90%9D%96%F6%1F%20%80%18%DE%BD%7B%C7%0E%8E%05AD%20%FEGr%A6%A0%A0%E0%7F%25P%80%02%9D%0F%D28%13%18%23%C6%C0%B0%02E%3D%C8%F5%00%01%04%8F%05P%A8%BA%40my%87%E4%12c%A8%8D%20%8B%D0%D3%00%08%03%04%10%9C%01R%E4%82d%3B%C8%A0%99%C6%90%90%C6%A5%19%84%01%02%08%9E%17%80%C9x%F7%7B%A0%DBVC%F9%A0%C0%5C%7D%16%2C%CE%00%F4%C6O%5C%99%09%20%800L%04y%A5%03%1A%95%A0%80%05%05%14.%DBA%18%20%80%18)%CD%CE%00%01%06%00%0C'%94%C7%C0k%C9%2C%00%00%00%00IEND%AEB%60%82",
-];
-
-
-/**
- * The event listener placed on our test windows used to determine when it is
- * safe to compare the two windows.
- */
-let _results = [];
-function loadEventHandler()
-{
- _results.push(snapshotWindow(window));
-
- loadNextTest();
-}
-
-/**
- * This runs the comparison.
- */
-function compareResults(aIndex, aImage1, aImage2)
-{
- let [correct, data1, data2] = compareSnapshots(aImage1, aImage2, true);
- SimpleTest.ok(correct,
- "Test '" + testDescriptions[aIndex] + "' matches expectations. " +
- "Data from window 1 is '" + data1 + "'. " +
- "Data from window 2 is '" + data2 + "'");
-}
-
-/**
- * Loads the next set of URIs to compare against.
- */
-let _counter = -1;
-function loadNextTest()
-{
- _counter++;
- // If we have no more tests, finish.
- if (_counter / 2 == testDescriptions.length) {
- for (let i = 0; i < _results.length; i = i + 2)
- compareResults(i / 2, _results[i], _results[i + 1]);
-
- SimpleTest.finish();
- return;
- }
-
- let nextURI = function() {
- let index = Math.floor(_counter / 2);
- if ((_counter % 2) == 0)
- return "moz-anno:favicon:" + testURIs[index];
- return expectedURIs[index];
- }
-
- let img = document.getElementById("favicon");
- img.setAttribute("src", nextURI());
-}
-
-function test()
-{
- SimpleTest.waitForExplicitFinish();
- let db = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsPIPlacesDatabase).
- DBConnection;
-
- // Empty any old favicons
- db.executeSimpleSQL("DELETE FROM moz_favicons");
-
- let ios = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
- let uri = function(aSpec) {
- return ios.newURI(aSpec, null, null);
- };
-
- let pageURI = uri("http://example.com/favicon_annotations");
- let history = Cc["@mozilla.org/browser/history;1"]
- .getService(Ci.mozIAsyncHistory);
- history.updatePlaces(
- {
- uri: pageURI,
- visits: [{ transitionType: Ci.nsINavHistoryService.TRANSITION_TYPED,
- visitDate: Date.now() * 1000
- }],
- },
- {
- handleError: function UP_handleError() {
- ok(false, "Unexpected error in adding visit.");
- },
- handleResult: function () {},
- handleCompletion: function UP_handleCompletion() {
- // Set the favicon data. Note that the "moz-anno:" protocol requires
- // the favicon to be stored in the database, but the
- // replaceFaviconDataFromDataURL function will not save the favicon
- // unless it is associated with a page. Thus, we must associate the
- // icon with a page explicitly in order for it to be visible through
- // the protocol.
- var systemPrincipal = Cc["@mozilla.org/systemprincipal;1"]
- .createInstance(Ci.nsIPrincipal);
-
- fs.replaceFaviconDataFromDataURL(uri(testURIs[1]), expectedURIs[1],
- (Date.now() + 60 * 60 * 24 * 1000) * 1000,
- systemPrincipal);
-
- fs.setAndFetchFaviconForPage(pageURI, uri(testURIs[1]), true,
- fs.FAVICON_LOAD_NON_PRIVATE,
- null, systemPrincipal);
-
- // And start our test process.
- loadNextTest();
- }
- }
- );
-
-
-}
-
- ]]>
- </script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <img id="favicon" onload="loadEventHandler();"/>
- <p id="display"></p>
- <div id="content" style="display:none;"></div>
- <pre id="test"></pre>
- </body>
-</window>
diff --git a/toolkit/components/places/tests/chrome/test_reloadLivemarks.xul b/toolkit/components/places/tests/chrome/test_reloadLivemarks.xul
deleted file mode 100644
index 43772d09f..000000000
--- a/toolkit/components/places/tests/chrome/test_reloadLivemarks.xul
+++ /dev/null
@@ -1,155 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<window title="Reload Livemarks"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTest()" onunload="cleanup()">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml" />
-
-<script type="application/javascript">
-<![CDATA[
-// Test that for concurrent reload of livemarks.
-
-SimpleTest.waitForExplicitFinish();
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/NetUtil.jsm");
-Components.utils.import("resource://gre/modules/PlacesUtils.jsm");
-
-let gLivemarks = [
- { id: -1,
- title: "foo",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- feedURI: NetUtil.newURI("http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/link-less-items.rss")
- },
- { id: -1,
- title: "bar",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- feedURI: NetUtil.newURI("http://mochi.test:8888/tests/toolkit/components/places/tests/chrome/link-less-items-no-site-uri.rss")
- },
-];
-
-function runTest()
-{
- addLivemarks(function () {
- reloadLivemarks(false, function () {
- reloadLivemarks(true, function () {
- removeLivemarks(SimpleTest.finish);
- });
- });
- // Ensure this normal reload doesn't overwrite the forced one.
- PlacesUtils.livemarks.reloadLivemarks();
- });
-}
-
-function addLivemarks(aCallback) {
- info("Adding livemarks");
- let count = gLivemarks.length;
- gLivemarks.forEach(function(aLivemarkData) {
- PlacesUtils.livemarks.addLivemark(aLivemarkData)
- .then(function (aLivemark) {
- ok(aLivemark.feedURI.equals(aLivemarkData.feedURI), "Livemark added");
- aLivemarkData.id = aLivemark.id;
- if (--count == 0) {
- aCallback();
- }
- },
- function () {
- is(true, false, "Should not fail adding a livemark.");
- aCallback();
- });
- });
-}
-
-function reloadLivemarks(aForceUpdate, aCallback) {
- info("Reloading livemarks with forceUpdate: " + aForceUpdate);
- let count = gLivemarks.length;
- gLivemarks.forEach(function(aLivemarkData) {
- PlacesUtils.livemarks.getLivemark(aLivemarkData)
- .then(aLivemark => {
- ok(aLivemark.feedURI.equals(aLivemarkData.feedURI), "Livemark found");
- aLivemarkData._observer = new resultObserver(aLivemark, function() {
- if (++count == gLivemarks.length) {
- aCallback();
- }
- });
- if (--count == 0) {
- PlacesUtils.livemarks.reloadLivemarks(aForceUpdate);
- }
- },
- function() {
- is(true, false, "Should not fail getting a livemark.");
- aCallback();
- }
- );
- });
-}
-
-function removeLivemarks(aCallback) {
- info("Removing livemarks");
- let count = gLivemarks.length;
- gLivemarks.forEach(function(aLivemarkData) {
- PlacesUtils.livemarks.removeLivemark(aLivemarkData).then(
- function (aLivemark) {
- if (--count == 0) {
- aCallback();
- }
- },
- function() {
- is(true, false, "Should not fail adding a livemark.");
- aCallback();
- }
- );
- });
-}
-
-function resultObserver(aLivemark, aCallback) {
- this._node = {};
- this._livemark = aLivemark;
- this._callback = aCallback;
- this._livemark.registerForUpdates(this._node, this);
-}
-resultObserver.prototype = {
- nodeInserted: function() {},
- nodeRemoved: function() {},
- nodeAnnotationChanged: function() {},
- nodeTitleChanged: function() {},
- nodeHistoryDetailsChanged: function() {},
- nodeMoved: function() {},
- ontainerStateChanged: function () {},
- sortingChanged: function() {},
- batching: function() {},
- invalidateContainer: function(aContainer) {
- // Wait for load finish.
- if (this._livemark.status == Ci.mozILivemark.STATUS_LOADING)
- return;
-
- this._terminate();
- this._callback();
- },
- _terminate: function () {
- if (!this._terminated) {
- this._livemark.unregisterForUpdates(this._node);
- this._terminated = true;
- }
- }
-};
-
-function cleanup() {
- gLivemarks.forEach(function(aLivemarkData) {
- if (aLivemarkData._observer)
- aLivemarkData._observer._terminate();
- });
-}
-]]>
-</script>
-</window>
diff --git a/toolkit/components/places/tests/cpp/mock_Link.h b/toolkit/components/places/tests/cpp/mock_Link.h
deleted file mode 100644
index 92ef25d6a..000000000
--- a/toolkit/components/places/tests/cpp/mock_Link.h
+++ /dev/null
@@ -1,229 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * This is a mock Link object which can be used in tests.
- */
-
-#ifndef mock_Link_h__
-#define mock_Link_h__
-
-#include "mozilla/MemoryReporting.h"
-#include "mozilla/dom/Link.h"
-#include "mozilla/dom/URLSearchParams.h"
-
-class mock_Link : public mozilla::dom::Link
-{
-public:
- NS_DECL_ISUPPORTS
-
- explicit mock_Link(void (*aHandlerFunction)(nsLinkState),
- bool aRunNextTest = true)
- : mozilla::dom::Link(nullptr)
- , mHandler(aHandlerFunction)
- , mRunNextTest(aRunNextTest)
- {
- // Create a cyclic ownership, so that the link will be released only
- // after its status has been updated. This will ensure that, when it should
- // run the next test, it will happen at the end of the test function, if
- // the link status has already been set before. Indeed the link status is
- // updated on a separate connection, thus may happen at any time.
- mDeathGrip = this;
- }
-
- virtual void SetLinkState(nsLinkState aState) override
- {
- // Notify our callback function.
- mHandler(aState);
-
- // Break the cycle so the object can be destroyed.
- mDeathGrip = nullptr;
- }
-
- virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const override
- {
- return 0; // the value shouldn't matter
- }
-
-protected:
- ~mock_Link() {
- // Run the next test if we are supposed to.
- if (mRunNextTest) {
- run_next_test();
- }
- }
-
-private:
- void (*mHandler)(nsLinkState);
- bool mRunNextTest;
- RefPtr<Link> mDeathGrip;
-};
-
-NS_IMPL_ISUPPORTS(
- mock_Link,
- mozilla::dom::Link
-)
-
-////////////////////////////////////////////////////////////////////////////////
-//// Needed Link Methods
-
-namespace mozilla {
-namespace dom {
-
-Link::Link(Element* aElement)
-: mElement(aElement)
-, mLinkState(eLinkState_NotLink)
-, mRegistered(false)
-{
-}
-
-Link::~Link()
-{
-}
-
-bool
-Link::ElementHasHref() const
-{
- NS_NOTREACHED("Unexpected call to Link::ElementHasHref");
- return false; // suppress compiler warning
-}
-
-void
-Link::SetLinkState(nsLinkState aState)
-{
- NS_NOTREACHED("Unexpected call to Link::SetLinkState");
-}
-
-void
-Link::ResetLinkState(bool aNotify, bool aHasHref)
-{
- NS_NOTREACHED("Unexpected call to Link::ResetLinkState");
-}
-
-nsIURI*
-Link::GetURI() const
-{
- NS_NOTREACHED("Unexpected call to Link::GetURI");
- return nullptr; // suppress compiler warning
-}
-
-size_t
-Link::SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const
-{
- NS_NOTREACHED("Unexpected call to Link::SizeOfExcludingThis");
- return 0;
-}
-
-NS_IMPL_CYCLE_COLLECTION_CLASS(URLSearchParams)
-NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(URLSearchParams)
-NS_IMPL_CYCLE_COLLECTION_UNLINK_END
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(URLSearchParams)
-NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
-NS_IMPL_CYCLE_COLLECTION_TRACE_WRAPPERCACHE(URLSearchParams)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(URLSearchParams)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(URLSearchParams)
-
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(URLSearchParams)
- NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
- NS_INTERFACE_MAP_ENTRY(nsISupports)
-NS_INTERFACE_MAP_END
-
-
-URLSearchParams::URLSearchParams(nsISupports* aParent,
- URLSearchParamsObserver* aObserver)
-{
-}
-
-URLSearchParams::~URLSearchParams()
-{
-}
-
-JSObject*
-URLSearchParams::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
- return nullptr;
-}
-
-void
-URLSearchParams::ParseInput(const nsACString& aInput)
-{
- NS_NOTREACHED("Unexpected call to URLSearchParams::ParseInput");
-}
-
-void
-URLSearchParams::Serialize(nsAString& aValue) const
-{
- NS_NOTREACHED("Unexpected call to URLSearchParams::Serialize");
-}
-
-void
-URLSearchParams::Get(const nsAString& aName, nsString& aRetval)
-{
- NS_NOTREACHED("Unexpected call to URLSearchParams::Get");
-}
-
-void
-URLSearchParams::GetAll(const nsAString& aName, nsTArray<nsString >& aRetval)
-{
- NS_NOTREACHED("Unexpected call to URLSearchParams::GetAll");
-}
-
-void
-URLSearchParams::Set(const nsAString& aName, const nsAString& aValue)
-{
- NS_NOTREACHED("Unexpected call to URLSearchParams::Set");
-}
-
-void
-URLSearchParams::Append(const nsAString& aName, const nsAString& aValue)
-{
- NS_NOTREACHED("Unexpected call to URLSearchParams::Append");
-}
-
-void
-URLSearchParams::AppendInternal(const nsAString& aName, const nsAString& aValue)
-{
- NS_NOTREACHED("Unexpected call to URLSearchParams::AppendInternal");
-}
-
-bool
-URLSearchParams::Has(const nsAString& aName)
-{
- NS_NOTREACHED("Unexpected call to URLSearchParams::Has");
- return false;
-}
-
-void
-URLSearchParams::Delete(const nsAString& aName)
-{
- NS_NOTREACHED("Unexpected call to URLSearchParams::Delete");
-}
-
-void
-URLSearchParams::DeleteAll()
-{
- NS_NOTREACHED("Unexpected call to URLSearchParams::DeleteAll");
-}
-
-void
-URLSearchParams::NotifyObserver()
-{
- NS_NOTREACHED("Unexpected call to URLSearchParams::NotifyObserver");
-}
-
-NS_IMETHODIMP
-URLSearchParams::GetSendInfo(nsIInputStream** aBody, uint64_t* aContentLength,
- nsACString& aContentType, nsACString& aCharset)
-{
- NS_NOTREACHED("Unexpected call to URLSearchParams::GetSendInfo");
- return NS_OK;
-}
-
-} // namespace dom
-} // namespace mozilla
-
-#endif // mock_Link_h__
diff --git a/toolkit/components/places/tests/cpp/moz.build b/toolkit/components/places/tests/cpp/moz.build
deleted file mode 100644
index f6bd91bd7..000000000
--- a/toolkit/components/places/tests/cpp/moz.build
+++ /dev/null
@@ -1,14 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-GeckoCppUnitTests([
- 'test_IHistory',
-])
-
-if CONFIG['JS_SHARED_LIBRARY']:
- USE_LIBS += [
- 'js',
- ]
diff --git a/toolkit/components/places/tests/cpp/places_test_harness.h b/toolkit/components/places/tests/cpp/places_test_harness.h
deleted file mode 100644
index 557a25f90..000000000
--- a/toolkit/components/places/tests/cpp/places_test_harness.h
+++ /dev/null
@@ -1,413 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "TestHarness.h"
-#include "nsMemory.h"
-#include "nsThreadUtils.h"
-#include "nsDocShellCID.h"
-
-#include "nsToolkitCompsCID.h"
-#include "nsINavHistoryService.h"
-#include "nsIObserverService.h"
-#include "nsIURI.h"
-#include "mozilla/IHistory.h"
-#include "mozIStorageConnection.h"
-#include "mozIStorageStatement.h"
-#include "mozIStorageAsyncStatement.h"
-#include "mozIStorageStatementCallback.h"
-#include "mozIStoragePendingStatement.h"
-#include "nsPIPlacesDatabase.h"
-#include "nsIObserver.h"
-#include "prinrval.h"
-#include "prtime.h"
-#include "mozilla/Attributes.h"
-
-#define WAITFORTOPIC_TIMEOUT_SECONDS 5
-
-
-static size_t gTotalTests = 0;
-static size_t gPassedTests = 0;
-
-#define do_check_true(aCondition) \
- PR_BEGIN_MACRO \
- gTotalTests++; \
- if (aCondition) { \
- gPassedTests++; \
- } else { \
- fail("%s | Expected true, got false at line %d", __FILE__, __LINE__); \
- } \
- PR_END_MACRO
-
-#define do_check_false(aCondition) \
- PR_BEGIN_MACRO \
- gTotalTests++; \
- if (!aCondition) { \
- gPassedTests++; \
- } else { \
- fail("%s | Expected false, got true at line %d", __FILE__, __LINE__); \
- } \
- PR_END_MACRO
-
-#define do_check_success(aResult) \
- do_check_true(NS_SUCCEEDED(aResult))
-
-#ifdef LINUX
-// XXX Linux opt builds on tinderbox are orange due to linking with stdlib.
-// This is sad and annoying, but it's a workaround that works.
-#define do_check_eq(aExpected, aActual) \
- do_check_true(aExpected == aActual)
-#else
-#include <sstream>
-
-#define do_check_eq(aActual, aExpected) \
- PR_BEGIN_MACRO \
- gTotalTests++; \
- if (aExpected == aActual) { \
- gPassedTests++; \
- } else { \
- std::ostringstream temp; \
- temp << __FILE__ << " | Expected '" << aExpected << "', got '"; \
- temp << aActual <<"' at line " << __LINE__; \
- fail(temp.str().c_str()); \
- } \
- PR_END_MACRO
-#endif
-
-struct Test
-{
- void (*func)(void);
- const char* const name;
-};
-#define TEST(aName) \
- {aName, #aName}
-
-/**
- * Runs the next text.
- */
-void run_next_test();
-
-/**
- * To be used around asynchronous work.
- */
-void do_test_pending();
-void do_test_finished();
-
-/**
- * Spins current thread until a topic is received.
- */
-class WaitForTopicSpinner final : public nsIObserver
-{
-public:
- NS_DECL_ISUPPORTS
-
- explicit WaitForTopicSpinner(const char* const aTopic)
- : mTopicReceived(false)
- , mStartTime(PR_IntervalNow())
- {
- nsCOMPtr<nsIObserverService> observerService =
- do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
- do_check_true(observerService);
- (void)observerService->AddObserver(this, aTopic, false);
- }
-
- void Spin() {
- while (!mTopicReceived) {
- if ((PR_IntervalNow() - mStartTime) > (WAITFORTOPIC_TIMEOUT_SECONDS * PR_USEC_PER_SEC)) {
- // Timed out waiting for the topic.
- do_check_true(false);
- break;
- }
- (void)NS_ProcessNextEvent();
- }
- }
-
- NS_IMETHOD Observe(nsISupports* aSubject,
- const char* aTopic,
- const char16_t* aData) override
- {
- mTopicReceived = true;
- nsCOMPtr<nsIObserverService> observerService =
- do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
- do_check_true(observerService);
- (void)observerService->RemoveObserver(this, aTopic);
- return NS_OK;
- }
-
-private:
- ~WaitForTopicSpinner() {}
-
- bool mTopicReceived;
- PRIntervalTime mStartTime;
-};
-NS_IMPL_ISUPPORTS(
- WaitForTopicSpinner,
- nsIObserver
-)
-
-/**
- * Spins current thread until an async statement is executed.
- */
-class AsyncStatementSpinner final : public mozIStorageStatementCallback
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_MOZISTORAGESTATEMENTCALLBACK
-
- AsyncStatementSpinner();
- void SpinUntilCompleted();
- uint16_t completionReason;
-
-protected:
- ~AsyncStatementSpinner() {}
-
- volatile bool mCompleted;
-};
-
-NS_IMPL_ISUPPORTS(AsyncStatementSpinner,
- mozIStorageStatementCallback)
-
-AsyncStatementSpinner::AsyncStatementSpinner()
-: completionReason(0)
-, mCompleted(false)
-{
-}
-
-NS_IMETHODIMP
-AsyncStatementSpinner::HandleResult(mozIStorageResultSet *aResultSet)
-{
- return NS_OK;
-}
-
-NS_IMETHODIMP
-AsyncStatementSpinner::HandleError(mozIStorageError *aError)
-{
- return NS_OK;
-}
-
-NS_IMETHODIMP
-AsyncStatementSpinner::HandleCompletion(uint16_t aReason)
-{
- completionReason = aReason;
- mCompleted = true;
- return NS_OK;
-}
-
-void AsyncStatementSpinner::SpinUntilCompleted()
-{
- nsCOMPtr<nsIThread> thread(::do_GetCurrentThread());
- nsresult rv = NS_OK;
- bool processed = true;
- while (!mCompleted && NS_SUCCEEDED(rv)) {
- rv = thread->ProcessNextEvent(true, &processed);
- }
-}
-
-struct PlaceRecord
-{
- int64_t id;
- int32_t hidden;
- int32_t typed;
- int32_t visitCount;
- nsCString guid;
-};
-
-struct VisitRecord
-{
- int64_t id;
- int64_t lastVisitId;
- int32_t transitionType;
-};
-
-already_AddRefed<mozilla::IHistory>
-do_get_IHistory()
-{
- nsCOMPtr<mozilla::IHistory> history = do_GetService(NS_IHISTORY_CONTRACTID);
- do_check_true(history);
- return history.forget();
-}
-
-already_AddRefed<nsINavHistoryService>
-do_get_NavHistory()
-{
- nsCOMPtr<nsINavHistoryService> serv =
- do_GetService(NS_NAVHISTORYSERVICE_CONTRACTID);
- do_check_true(serv);
- return serv.forget();
-}
-
-already_AddRefed<mozIStorageConnection>
-do_get_db()
-{
- nsCOMPtr<nsINavHistoryService> history = do_get_NavHistory();
- nsCOMPtr<nsPIPlacesDatabase> database = do_QueryInterface(history);
- do_check_true(database);
-
- nsCOMPtr<mozIStorageConnection> dbConn;
- nsresult rv = database->GetDBConnection(getter_AddRefs(dbConn));
- do_check_success(rv);
- return dbConn.forget();
-}
-
-/**
- * Get the place record from the database.
- *
- * @param aURI The unique URI of the place we are looking up
- * @param result Out parameter where the result is stored
- */
-void
-do_get_place(nsIURI* aURI, PlaceRecord& result)
-{
- nsCOMPtr<mozIStorageConnection> dbConn = do_get_db();
- nsCOMPtr<mozIStorageStatement> stmt;
-
- nsCString spec;
- nsresult rv = aURI->GetSpec(spec);
- do_check_success(rv);
-
- rv = dbConn->CreateStatement(NS_LITERAL_CSTRING(
- "SELECT id, hidden, typed, visit_count, guid FROM moz_places "
- "WHERE url_hash = hash(?1) AND url = ?1"
- ), getter_AddRefs(stmt));
- do_check_success(rv);
-
- rv = stmt->BindUTF8StringByIndex(0, spec);
- do_check_success(rv);
-
- bool hasResults;
- rv = stmt->ExecuteStep(&hasResults);
- do_check_success(rv);
- if (!hasResults) {
- result.id = 0;
- return;
- }
-
- rv = stmt->GetInt64(0, &result.id);
- do_check_success(rv);
- rv = stmt->GetInt32(1, &result.hidden);
- do_check_success(rv);
- rv = stmt->GetInt32(2, &result.typed);
- do_check_success(rv);
- rv = stmt->GetInt32(3, &result.visitCount);
- do_check_success(rv);
- rv = stmt->GetUTF8String(4, result.guid);
- do_check_success(rv);
-}
-
-/**
- * Gets the most recent visit to a place.
- *
- * @param placeID ID from the moz_places table
- * @param result Out parameter where visit is stored
- */
-void
-do_get_lastVisit(int64_t placeId, VisitRecord& result)
-{
- nsCOMPtr<mozIStorageConnection> dbConn = do_get_db();
- nsCOMPtr<mozIStorageStatement> stmt;
-
- nsresult rv = dbConn->CreateStatement(NS_LITERAL_CSTRING(
- "SELECT id, from_visit, visit_type FROM moz_historyvisits "
- "WHERE place_id=?1 "
- "LIMIT 1"
- ), getter_AddRefs(stmt));
- do_check_success(rv);
-
- rv = stmt->BindInt64ByIndex(0, placeId);
- do_check_success(rv);
-
- bool hasResults;
- rv = stmt->ExecuteStep(&hasResults);
- do_check_success(rv);
-
- if (!hasResults) {
- result.id = 0;
- return;
- }
-
- rv = stmt->GetInt64(0, &result.id);
- do_check_success(rv);
- rv = stmt->GetInt64(1, &result.lastVisitId);
- do_check_success(rv);
- rv = stmt->GetInt32(2, &result.transitionType);
- do_check_success(rv);
-}
-
-void
-do_wait_async_updates() {
- nsCOMPtr<mozIStorageConnection> db = do_get_db();
- nsCOMPtr<mozIStorageAsyncStatement> stmt;
-
- db->CreateAsyncStatement(NS_LITERAL_CSTRING("BEGIN EXCLUSIVE"),
- getter_AddRefs(stmt));
- nsCOMPtr<mozIStoragePendingStatement> pending;
- (void)stmt->ExecuteAsync(nullptr, getter_AddRefs(pending));
-
- db->CreateAsyncStatement(NS_LITERAL_CSTRING("COMMIT"),
- getter_AddRefs(stmt));
- RefPtr<AsyncStatementSpinner> spinner = new AsyncStatementSpinner();
- (void)stmt->ExecuteAsync(spinner, getter_AddRefs(pending));
-
- spinner->SpinUntilCompleted();
-}
-
-/**
- * Adds a URI to the database.
- *
- * @param aURI
- * The URI to add to the database.
- */
-void
-addURI(nsIURI* aURI)
-{
- nsCOMPtr<mozilla::IHistory> history = do_GetService(NS_IHISTORY_CONTRACTID);
- do_check_true(history);
- nsresult rv = history->VisitURI(aURI, nullptr, mozilla::IHistory::TOP_LEVEL);
- do_check_success(rv);
-
- do_wait_async_updates();
-}
-
-static const char TOPIC_PROFILE_CHANGE[] = "profile-before-change";
-static const char TOPIC_PLACES_CONNECTION_CLOSED[] = "places-connection-closed";
-
-class WaitForConnectionClosed final : public nsIObserver
-{
- RefPtr<WaitForTopicSpinner> mSpinner;
-
- ~WaitForConnectionClosed() {}
-
-public:
- NS_DECL_ISUPPORTS
-
- WaitForConnectionClosed()
- {
- nsCOMPtr<nsIObserverService> os =
- do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
- MOZ_ASSERT(os);
- if (os) {
- MOZ_ALWAYS_SUCCEEDS(os->AddObserver(this, TOPIC_PROFILE_CHANGE, false));
- }
- mSpinner = new WaitForTopicSpinner(TOPIC_PLACES_CONNECTION_CLOSED);
- }
-
- NS_IMETHOD Observe(nsISupports* aSubject,
- const char* aTopic,
- const char16_t* aData) override
- {
- nsCOMPtr<nsIObserverService> os =
- do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
- MOZ_ASSERT(os);
- if (os) {
- MOZ_ALWAYS_SUCCEEDS(os->RemoveObserver(this, aTopic));
- }
-
- mSpinner->Spin();
-
- return NS_OK;
- }
-};
-
-NS_IMPL_ISUPPORTS(WaitForConnectionClosed, nsIObserver)
diff --git a/toolkit/components/places/tests/cpp/places_test_harness_tail.h b/toolkit/components/places/tests/cpp/places_test_harness_tail.h
deleted file mode 100644
index 9e57c3724..000000000
--- a/toolkit/components/places/tests/cpp/places_test_harness_tail.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsWidgetsCID.h"
-#include "nsIComponentRegistrar.h"
-
-#ifndef TEST_NAME
-#error "Must #define TEST_NAME before including places_test_harness_tail.h"
-#endif
-
-#ifndef TEST_FILE
-#error "Must #define TEST_FILE before include places_test_harness_tail.h"
-#endif
-
-int gTestsIndex = 0;
-
-#define TEST_INFO_STR "TEST-INFO | (%s) | "
-
-class RunNextTest : public mozilla::Runnable
-{
-public:
- NS_IMETHOD Run() override
- {
- NS_ASSERTION(NS_IsMainThread(), "Not running on the main thread?");
- if (gTestsIndex < int(mozilla::ArrayLength(gTests))) {
- do_test_pending();
- Test &test = gTests[gTestsIndex++];
- (void)fprintf(stderr, TEST_INFO_STR "Running %s.\n", TEST_FILE,
- test.name);
- test.func();
- }
-
- do_test_finished();
- return NS_OK;
- }
-};
-
-void
-run_next_test()
-{
- nsCOMPtr<nsIRunnable> event = new RunNextTest();
- do_check_success(NS_DispatchToCurrentThread(event));
-}
-
-int gPendingTests = 0;
-
-void
-do_test_pending()
-{
- NS_ASSERTION(NS_IsMainThread(), "Not running on the main thread?");
- gPendingTests++;
-}
-
-void
-do_test_finished()
-{
- NS_ASSERTION(NS_IsMainThread(), "Not running on the main thread?");
- NS_ASSERTION(gPendingTests > 0, "Invalid pending test count!");
- gPendingTests--;
-}
-
-void
-disable_idle_service()
-{
- (void)fprintf(stderr, TEST_INFO_STR "Disabling Idle Service.\n", TEST_FILE);
- static NS_DEFINE_IID(kIdleCID, NS_IDLE_SERVICE_CID);
- nsresult rv;
- nsCOMPtr<nsIFactory> idleFactory = do_GetClassObject(kIdleCID, &rv);
- do_check_success(rv);
- nsCOMPtr<nsIComponentRegistrar> registrar;
- rv = NS_GetComponentRegistrar(getter_AddRefs(registrar));
- do_check_success(rv);
- rv = registrar->UnregisterFactory(kIdleCID, idleFactory);
- do_check_success(rv);
-}
-
-int
-main(int aArgc,
- char** aArgv)
-{
- ScopedXPCOM xpcom(TEST_NAME);
- if (xpcom.failed())
- return -1;
- // Initialize a profile folder to ensure a clean shutdown.
- nsCOMPtr<nsIFile> profile = xpcom.GetProfileDirectory();
- if (!profile) {
- fail("Couldn't get the profile directory.");
- return -1;
- }
-
- RefPtr<WaitForConnectionClosed> spinClose = new WaitForConnectionClosed();
-
- // Tinderboxes are constantly on idle. Since idle tasks can interact with
- // tests, causing random failures, disable the idle service.
- disable_idle_service();
-
- do_test_pending();
- run_next_test();
-
- // Spin the event loop until we've run out of tests to run.
- while (gPendingTests) {
- (void)NS_ProcessNextEvent();
- }
-
- // And let any other events finish before we quit.
- (void)NS_ProcessPendingEvents(nullptr);
-
- // Check that we have passed all of our tests, and output accordingly.
- if (gPassedTests == gTotalTests) {
- passed(TEST_FILE);
- }
-
- (void)fprintf(stderr, TEST_INFO_STR "%u of %u tests passed\n",
- TEST_FILE, unsigned(gPassedTests), unsigned(gTotalTests));
-
- return gPassedTests == gTotalTests ? 0 : -1;
-}
diff --git a/toolkit/components/places/tests/cpp/test_IHistory.cpp b/toolkit/components/places/tests/cpp/test_IHistory.cpp
deleted file mode 100644
index 90998ce8c..000000000
--- a/toolkit/components/places/tests/cpp/test_IHistory.cpp
+++ /dev/null
@@ -1,639 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "places_test_harness.h"
-#include "nsIPrefService.h"
-#include "nsIPrefBranch.h"
-#include "mozilla/Attributes.h"
-#include "nsNetUtil.h"
-
-#include "mock_Link.h"
-using namespace mozilla;
-using namespace mozilla::dom;
-
-/**
- * This file tests the IHistory interface.
- */
-
-////////////////////////////////////////////////////////////////////////////////
-//// Helper Methods
-
-void
-expect_visit(nsLinkState aState)
-{
- do_check_true(aState == eLinkState_Visited);
-}
-
-void
-expect_no_visit(nsLinkState aState)
-{
- do_check_true(aState == eLinkState_Unvisited);
-}
-
-already_AddRefed<nsIURI>
-new_test_uri()
-{
- // Create a unique spec.
- static int32_t specNumber = 0;
- nsAutoCString spec = NS_LITERAL_CSTRING("http://mozilla.org/");
- spec.AppendInt(specNumber++);
-
- // Create the URI for the spec.
- nsCOMPtr<nsIURI> testURI;
- nsresult rv = NS_NewURI(getter_AddRefs(testURI), spec);
- do_check_success(rv);
- return testURI.forget();
-}
-
-class VisitURIObserver final : public nsIObserver
-{
- ~VisitURIObserver() {}
-
-public:
- NS_DECL_ISUPPORTS
-
- explicit VisitURIObserver(int aExpectedVisits = 1) :
- mVisits(0),
- mExpectedVisits(aExpectedVisits)
- {
- nsCOMPtr<nsIObserverService> observerService =
- do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
- do_check_true(observerService);
- (void)observerService->AddObserver(this,
- "uri-visit-saved",
- false);
- }
-
- void WaitForNotification()
- {
- while (mVisits < mExpectedVisits) {
- (void)NS_ProcessNextEvent();
- }
- }
-
- NS_IMETHOD Observe(nsISupports* aSubject,
- const char* aTopic,
- const char16_t* aData) override
- {
- mVisits++;
-
- if (mVisits == mExpectedVisits) {
- nsCOMPtr<nsIObserverService> observerService =
- do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
- (void)observerService->RemoveObserver(this, "uri-visit-saved");
- }
-
- return NS_OK;
- }
-private:
- int mVisits;
- int mExpectedVisits;
-};
-NS_IMPL_ISUPPORTS(
- VisitURIObserver,
- nsIObserver
-)
-
-////////////////////////////////////////////////////////////////////////////////
-//// Test Functions
-
-void
-test_set_places_enabled()
-{
- // Ensure places is enabled for everyone.
- nsresult rv;
- nsCOMPtr<nsIPrefBranch> prefBranch =
- do_GetService(NS_PREFSERVICE_CONTRACTID, &rv);
- do_check_success(rv);
-
- rv = prefBranch->SetBoolPref("places.history.enabled", true);
- do_check_success(rv);
-
- // Run the next test.
- run_next_test();
-}
-
-
-void
-test_wait_checkpoint()
-{
- // This "fake" test is here to wait for the initial WAL checkpoint we force
- // after creating the database schema, since that may happen at any time,
- // and cause concurrent readers to access an older checkpoint.
- nsCOMPtr<mozIStorageConnection> db = do_get_db();
- nsCOMPtr<mozIStorageAsyncStatement> stmt;
- db->CreateAsyncStatement(NS_LITERAL_CSTRING("SELECT 1"),
- getter_AddRefs(stmt));
- RefPtr<AsyncStatementSpinner> spinner = new AsyncStatementSpinner();
- nsCOMPtr<mozIStoragePendingStatement> pending;
- (void)stmt->ExecuteAsync(spinner, getter_AddRefs(pending));
- spinner->SpinUntilCompleted();
-
- // Run the next test.
- run_next_test();
-}
-
-// These variables are shared between part 1 and part 2 of the test. Part 2
-// sets the nsCOMPtr's to nullptr, freeing the reference.
-namespace test_unvisited_does_not_notify {
- nsCOMPtr<nsIURI> testURI;
- RefPtr<Link> testLink;
-} // namespace test_unvisited_does_not_notify
-void
-test_unvisited_does_not_notify_part1()
-{
- using namespace test_unvisited_does_not_notify;
-
- // This test is done in two parts. The first part registers for a URI that
- // should not be visited. We then run another test that will also do a
- // lookup and will be notified. Since requests are answered in the order they
- // are requested (at least as long as the same URI isn't asked for later), we
- // will know that the Link was not notified.
-
- // First, we need a test URI.
- testURI = new_test_uri();
-
- // Create our test Link.
- testLink = new mock_Link(expect_no_visit);
-
- // Now, register our Link to be notified.
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsresult rv = history->RegisterVisitedCallback(testURI, testLink);
- do_check_success(rv);
-
- // Run the next test.
- run_next_test();
-}
-
-void
-test_visited_notifies()
-{
- // First, we add our test URI to history.
- nsCOMPtr<nsIURI> testURI = new_test_uri();
- addURI(testURI);
-
- // Create our test Link. The callback function will release the reference we
- // have on the Link.
- RefPtr<Link> link = new mock_Link(expect_visit);
-
- // Now, register our Link to be notified.
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsresult rv = history->RegisterVisitedCallback(testURI, link);
- do_check_success(rv);
-
- // Note: test will continue upon notification.
-}
-
-void
-test_unvisited_does_not_notify_part2()
-{
- using namespace test_unvisited_does_not_notify;
-
- // We would have had a failure at this point had the content node been told it
- // was visited. Therefore, it is safe to unregister our content node.
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsresult rv = history->UnregisterVisitedCallback(testURI, testLink);
- do_check_success(rv);
-
- // Clear the stored variables now.
- testURI = nullptr;
- testLink = nullptr;
-
- // Run the next test.
- run_next_test();
-}
-
-void
-test_same_uri_notifies_both()
-{
- // First, we add our test URI to history.
- nsCOMPtr<nsIURI> testURI = new_test_uri();
- addURI(testURI);
-
- // Create our two test Links. The callback function will release the
- // reference we have on the Links. Only the second Link should run the next
- // test!
- RefPtr<Link> link1 = new mock_Link(expect_visit, false);
- RefPtr<Link> link2 = new mock_Link(expect_visit);
-
- // Now, register our Link to be notified.
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsresult rv = history->RegisterVisitedCallback(testURI, link1);
- do_check_success(rv);
- rv = history->RegisterVisitedCallback(testURI, link2);
- do_check_success(rv);
-
- // Note: test will continue upon notification.
-}
-
-void
-test_unregistered_visited_does_not_notify()
-{
- // This test must have a test that has a successful notification after it.
- // The Link would have been notified by now if we were buggy and notified
- // unregistered Links (due to request serialization).
-
- nsCOMPtr<nsIURI> testURI = new_test_uri();
- RefPtr<Link> link = new mock_Link(expect_no_visit);
-
- // Now, register our Link to be notified.
- nsCOMPtr<IHistory> history(do_get_IHistory());
- nsresult rv = history->RegisterVisitedCallback(testURI, link);
- do_check_success(rv);
-
- // Unregister the Link.
- rv = history->UnregisterVisitedCallback(testURI, link);
- do_check_success(rv);
-
- // And finally add a visit for the URI.
- addURI(testURI);
-
- // If history tries to notify us, we'll either crash because the Link will
- // have been deleted (we are the only thing holding a reference to it), or our
- // expect_no_visit call back will produce a failure. Either way, the test
- // will be reported as a failure.
-
- // Run the next test.
- run_next_test();
-}
-
-void
-test_new_visit_notifies_waiting_Link()
-{
- // Create our test Link. The callback function will release the reference we
- // have on the link.
- RefPtr<Link> link = new mock_Link(expect_visit);
-
- // Now, register our content node to be notified.
- nsCOMPtr<nsIURI> testURI = new_test_uri();
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsresult rv = history->RegisterVisitedCallback(testURI, link);
- do_check_success(rv);
-
- // Add ourselves to history.
- addURI(testURI);
-
- // Note: test will continue upon notification.
-}
-
-void
-test_RegisterVisitedCallback_returns_before_notifying()
-{
- // Add a URI so that it's already in history.
- nsCOMPtr<nsIURI> testURI = new_test_uri();
- addURI(testURI);
-
- // Create our test Link.
- RefPtr<Link> link = new mock_Link(expect_no_visit);
-
- // Now, register our content node to be notified. It should not be notified.
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsresult rv = history->RegisterVisitedCallback(testURI, link);
- do_check_success(rv);
-
- // Remove ourselves as an observer. We would have failed if we had been
- // notified.
- rv = history->UnregisterVisitedCallback(testURI, link);
- do_check_success(rv);
-
- run_next_test();
-}
-
-namespace test_observer_topic_dispatched_helpers {
- #define URI_VISITED "visited"
- #define URI_NOT_VISITED "not visited"
- #define URI_VISITED_RESOLUTION_TOPIC "visited-status-resolution"
- class statusObserver final : public nsIObserver
- {
- ~statusObserver() {}
-
- public:
- NS_DECL_ISUPPORTS
-
- statusObserver(nsIURI* aURI,
- const bool aExpectVisit,
- bool& _notified)
- : mURI(aURI)
- , mExpectVisit(aExpectVisit)
- , mNotified(_notified)
- {
- nsCOMPtr<nsIObserverService> observerService =
- do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
- do_check_true(observerService);
- (void)observerService->AddObserver(this,
- URI_VISITED_RESOLUTION_TOPIC,
- false);
- }
-
- NS_IMETHOD Observe(nsISupports* aSubject,
- const char* aTopic,
- const char16_t* aData) override
- {
- // Make sure we got notified of the right topic.
- do_check_false(strcmp(aTopic, URI_VISITED_RESOLUTION_TOPIC));
-
- // If this isn't for our URI, do not do anything.
- nsCOMPtr<nsIURI> notifiedURI = do_QueryInterface(aSubject);
- do_check_true(notifiedURI);
-
- bool isOurURI;
- nsresult rv = notifiedURI->Equals(mURI, &isOurURI);
- do_check_success(rv);
- if (!isOurURI) {
- return NS_OK;
- }
-
- // Check that we have either the visited or not visited string.
- bool visited = !!NS_LITERAL_STRING(URI_VISITED).Equals(aData);
- bool notVisited = !!NS_LITERAL_STRING(URI_NOT_VISITED).Equals(aData);
- do_check_true(visited || notVisited);
-
- // Check to make sure we got the state we expected.
- do_check_eq(visited, mExpectVisit);
-
- // Indicate that we've been notified.
- mNotified = true;
-
- // Remove ourselves as an observer.
- nsCOMPtr<nsIObserverService> observerService =
- do_GetService(NS_OBSERVERSERVICE_CONTRACTID);
- (void)observerService->RemoveObserver(this,
- URI_VISITED_RESOLUTION_TOPIC);
- return NS_OK;
- }
- private:
- nsCOMPtr<nsIURI> mURI;
- const bool mExpectVisit;
- bool& mNotified;
- };
- NS_IMPL_ISUPPORTS(
- statusObserver,
- nsIObserver
- )
-} // namespace test_observer_topic_dispatched_helpers
-void
-test_observer_topic_dispatched()
-{
- using namespace test_observer_topic_dispatched_helpers;
-
- // Create two URIs, making sure only one is in history.
- nsCOMPtr<nsIURI> visitedURI = new_test_uri();
- nsCOMPtr<nsIURI> notVisitedURI = new_test_uri();
- bool urisEqual;
- nsresult rv = visitedURI->Equals(notVisitedURI, &urisEqual);
- do_check_success(rv);
- do_check_false(urisEqual);
- addURI(visitedURI);
-
- // Need two Link objects as well - one for each URI.
- RefPtr<Link> visitedLink = new mock_Link(expect_visit, false);
- RefPtr<Link> visitedLinkCopy = visitedLink;
- RefPtr<Link> notVisitedLink = new mock_Link(expect_no_visit);
-
- // Add the right observers for the URIs to check results.
- bool visitedNotified = false;
- nsCOMPtr<nsIObserver> visitedObs =
- new statusObserver(visitedURI, true, visitedNotified);
- bool notVisitedNotified = false;
- nsCOMPtr<nsIObserver> unvisitedObs =
- new statusObserver(notVisitedURI, false, notVisitedNotified);
-
- // Register our Links to be notified.
- nsCOMPtr<IHistory> history = do_get_IHistory();
- rv = history->RegisterVisitedCallback(visitedURI, visitedLink);
- do_check_success(rv);
- rv = history->RegisterVisitedCallback(notVisitedURI, notVisitedLink);
- do_check_success(rv);
-
- // Spin the event loop as long as we have not been properly notified.
- while (!visitedNotified || !notVisitedNotified) {
- (void)NS_ProcessNextEvent();
- }
-
- // Unregister our observer that would not have been released.
- rv = history->UnregisterVisitedCallback(notVisitedURI, notVisitedLink);
- do_check_success(rv);
-
- run_next_test();
-}
-
-void
-test_visituri_inserts()
-{
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsCOMPtr<nsIURI> lastURI = new_test_uri();
- nsCOMPtr<nsIURI> visitedURI = new_test_uri();
-
- history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL);
-
- RefPtr<VisitURIObserver> finisher = new VisitURIObserver();
- finisher->WaitForNotification();
-
- PlaceRecord place;
- do_get_place(visitedURI, place);
-
- do_check_true(place.id > 0);
- do_check_false(place.hidden);
- do_check_false(place.typed);
- do_check_eq(place.visitCount, 1);
-
- run_next_test();
-}
-
-void
-test_visituri_updates()
-{
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsCOMPtr<nsIURI> lastURI = new_test_uri();
- nsCOMPtr<nsIURI> visitedURI = new_test_uri();
- RefPtr<VisitURIObserver> finisher;
-
- history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL);
- finisher = new VisitURIObserver();
- finisher->WaitForNotification();
-
- history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL);
- finisher = new VisitURIObserver();
- finisher->WaitForNotification();
-
- PlaceRecord place;
- do_get_place(visitedURI, place);
-
- do_check_eq(place.visitCount, 2);
-
- run_next_test();
-}
-
-void
-test_visituri_preserves_shown_and_typed()
-{
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsCOMPtr<nsIURI> lastURI = new_test_uri();
- nsCOMPtr<nsIURI> visitedURI = new_test_uri();
-
- history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL);
- // this simulates the uri visit happening in a frame. Normally frame
- // transitions would be hidden unless it was previously loaded top-level
- history->VisitURI(visitedURI, lastURI, 0);
-
- RefPtr<VisitURIObserver> finisher = new VisitURIObserver(2);
- finisher->WaitForNotification();
-
- PlaceRecord place;
- do_get_place(visitedURI, place);
- do_check_false(place.hidden);
-
- run_next_test();
-}
-
-void
-test_visituri_creates_visit()
-{
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsCOMPtr<nsIURI> lastURI = new_test_uri();
- nsCOMPtr<nsIURI> visitedURI = new_test_uri();
-
- history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL);
- RefPtr<VisitURIObserver> finisher = new VisitURIObserver();
- finisher->WaitForNotification();
-
- PlaceRecord place;
- VisitRecord visit;
- do_get_place(visitedURI, place);
- do_get_lastVisit(place.id, visit);
-
- do_check_true(visit.id > 0);
- do_check_eq(visit.lastVisitId, 0);
- do_check_eq(visit.transitionType, nsINavHistoryService::TRANSITION_LINK);
-
- run_next_test();
-}
-
-void
-test_visituri_transition_typed()
-{
- nsCOMPtr<nsINavHistoryService> navHistory = do_get_NavHistory();
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsCOMPtr<nsIURI> lastURI = new_test_uri();
- nsCOMPtr<nsIURI> visitedURI = new_test_uri();
-
- navHistory->MarkPageAsTyped(visitedURI);
- history->VisitURI(visitedURI, lastURI, mozilla::IHistory::TOP_LEVEL);
- RefPtr<VisitURIObserver> finisher = new VisitURIObserver();
- finisher->WaitForNotification();
-
- PlaceRecord place;
- VisitRecord visit;
- do_get_place(visitedURI, place);
- do_get_lastVisit(place.id, visit);
-
- do_check_true(visit.transitionType == nsINavHistoryService::TRANSITION_TYPED);
-
- run_next_test();
-}
-
-void
-test_visituri_transition_embed()
-{
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsCOMPtr<nsIURI> lastURI = new_test_uri();
- nsCOMPtr<nsIURI> visitedURI = new_test_uri();
-
- history->VisitURI(visitedURI, lastURI, 0);
- RefPtr<VisitURIObserver> finisher = new VisitURIObserver();
- finisher->WaitForNotification();
-
- PlaceRecord place;
- VisitRecord visit;
- do_get_place(visitedURI, place);
- do_get_lastVisit(place.id, visit);
-
- do_check_eq(place.id, 0);
- do_check_eq(visit.id, 0);
-
- run_next_test();
-}
-
-void
-test_new_visit_adds_place_guid()
-{
- // First, add a visit and wait. This will also add a place.
- nsCOMPtr<nsIURI> visitedURI = new_test_uri();
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsresult rv = history->VisitURI(visitedURI, nullptr,
- mozilla::IHistory::TOP_LEVEL);
- do_check_success(rv);
- RefPtr<VisitURIObserver> finisher = new VisitURIObserver();
- finisher->WaitForNotification();
-
- // Check that we have a guid for our visit.
- PlaceRecord place;
- do_get_place(visitedURI, place);
- do_check_eq(place.visitCount, 1);
- do_check_eq(place.guid.Length(), 12);
-
- run_next_test();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//// IPC-only Tests
-
-void
-test_two_null_links_same_uri()
-{
- // Tests that we do not crash when we have had two nullptr Links passed to
- // RegisterVisitedCallback and then the visit occurs (bug 607469). This only
- // happens in IPC builds.
- nsCOMPtr<nsIURI> testURI = new_test_uri();
-
- nsCOMPtr<IHistory> history = do_get_IHistory();
- nsresult rv = history->RegisterVisitedCallback(testURI, nullptr);
- do_check_success(rv);
- rv = history->RegisterVisitedCallback(testURI, nullptr);
- do_check_success(rv);
-
- rv = history->VisitURI(testURI, nullptr, mozilla::IHistory::TOP_LEVEL);
- do_check_success(rv);
-
- RefPtr<VisitURIObserver> finisher = new VisitURIObserver();
- finisher->WaitForNotification();
-
- run_next_test();
-}
-
-////////////////////////////////////////////////////////////////////////////////
-//// Test Harness
-
-/**
- * Note: for tests marked "Order Important!", please see the test for details.
- */
-Test gTests[] = {
- TEST(test_set_places_enabled), // Must come first!
- TEST(test_wait_checkpoint), // Must come second!
- TEST(test_unvisited_does_not_notify_part1), // Order Important!
- TEST(test_visited_notifies),
- TEST(test_unvisited_does_not_notify_part2), // Order Important!
- TEST(test_same_uri_notifies_both),
- TEST(test_unregistered_visited_does_not_notify), // Order Important!
- TEST(test_new_visit_notifies_waiting_Link),
- TEST(test_RegisterVisitedCallback_returns_before_notifying),
- TEST(test_observer_topic_dispatched),
- TEST(test_visituri_inserts),
- TEST(test_visituri_updates),
- TEST(test_visituri_preserves_shown_and_typed),
- TEST(test_visituri_creates_visit),
- TEST(test_visituri_transition_typed),
- TEST(test_visituri_transition_embed),
- TEST(test_new_visit_adds_place_guid),
-
- // The rest of these tests are tests that are only run in IPC builds.
- TEST(test_two_null_links_same_uri),
-};
-
-const char* file = __FILE__;
-#define TEST_NAME "IHistory"
-#define TEST_FILE file
-#include "places_test_harness_tail.h"
diff --git a/toolkit/components/places/tests/expiration/.eslintrc.js b/toolkit/components/places/tests/expiration/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/places/tests/expiration/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/places/tests/expiration/head_expiration.js b/toolkit/components/places/tests/expiration/head_expiration.js
deleted file mode 100644
index 2be4af307..000000000
--- a/toolkit/components/places/tests/expiration/head_expiration.js
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cr = Components.results;
-var Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-// Import common head.
-{
- let commonFile = do_get_file("../head_common.js", false);
- let uri = Services.io.newFileURI(commonFile);
- Services.scriptloader.loadSubScript(uri.spec, this);
-}
-
-// Put any other stuff relative to this test folder below.
-
-
-// Simulates an expiration at shutdown.
-function shutdownExpiration()
-{
- let expire = Cc["@mozilla.org/places/expiration;1"].getService(Ci.nsIObserver);
- expire.observe(null, "places-will-close-connection", null);
-}
-
-
-/**
- * Causes expiration component to start, otherwise it would wait for the first
- * history notification.
- */
-function force_expiration_start() {
- Cc["@mozilla.org/places/expiration;1"]
- .getService(Ci.nsIObserver)
- .observe(null, "testing-mode", null);
-}
-
-
-/**
- * Forces an expiration run.
- *
- * @param [optional] aLimit
- * Limit for the expiration. Pass -1 for unlimited.
- * Any other non-positive value will just expire orphans.
- *
- * @return {Promise}
- * @resolves When expiration finishes.
- * @rejects Never.
- */
-function promiseForceExpirationStep(aLimit) {
- let promise = promiseTopicObserved(PlacesUtils.TOPIC_EXPIRATION_FINISHED);
- let expire = Cc["@mozilla.org/places/expiration;1"].getService(Ci.nsIObserver);
- expire.observe(null, "places-debug-start-expiration", aLimit);
- return promise;
-}
-
-
-/**
- * Expiration preferences helpers.
- */
-
-function setInterval(aNewInterval) {
- Services.prefs.setIntPref("places.history.expiration.interval_seconds", aNewInterval);
-}
-function getInterval() {
- return Services.prefs.getIntPref("places.history.expiration.interval_seconds");
-}
-function clearInterval() {
- try {
- Services.prefs.clearUserPref("places.history.expiration.interval_seconds");
- }
- catch (ex) {}
-}
-
-
-function setMaxPages(aNewMaxPages) {
- Services.prefs.setIntPref("places.history.expiration.max_pages", aNewMaxPages);
-}
-function getMaxPages() {
- return Services.prefs.getIntPref("places.history.expiration.max_pages");
-}
-function clearMaxPages() {
- try {
- Services.prefs.clearUserPref("places.history.expiration.max_pages");
- }
- catch (ex) {}
-}
-
-
-function setHistoryEnabled(aHistoryEnabled) {
- Services.prefs.setBoolPref("places.history.enabled", aHistoryEnabled);
-}
-function getHistoryEnabled() {
- return Services.prefs.getBoolPref("places.history.enabled");
-}
-function clearHistoryEnabled() {
- try {
- Services.prefs.clearUserPref("places.history.enabled");
- }
- catch (ex) {}
-}
-
-/**
- * Returns a PRTime in the past usable to add expirable visits.
- *
- * param [optional] daysAgo
- * Expiration ignores any visit added in the last 7 days, so by default
- * this will be set to 7.
- * @note to be safe against DST issues we go back one day more.
- */
-function getExpirablePRTime(daysAgo = 7) {
- let dateObj = new Date();
- // Normalize to midnight
- dateObj.setHours(0);
- dateObj.setMinutes(0);
- dateObj.setSeconds(0);
- dateObj.setMilliseconds(0);
- dateObj = new Date(dateObj.getTime() - (daysAgo + 1) * 86400000);
- return dateObj.getTime() * 1000;
-}
diff --git a/toolkit/components/places/tests/expiration/test_analyze_runs.js b/toolkit/components/places/tests/expiration/test_analyze_runs.js
deleted file mode 100644
index 1a84e1b38..000000000
--- a/toolkit/components/places/tests/expiration/test_analyze_runs.js
+++ /dev/null
@@ -1,118 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Constants
-
-const TOPIC_AUTOCOMPLETE_FEEDBACK_INCOMING = "autocomplete-will-enter-text";
-
-// Helpers
-
-/**
- * Ensures that we have no data in the tables created by ANALYZE.
- */
-function clearAnalyzeData() {
- let db = DBConn();
- if (!db.tableExists("sqlite_stat1")) {
- return;
- }
- db.executeSimpleSQL("DELETE FROM sqlite_stat1");
-}
-
-/**
- * Checks that we ran ANALYZE on the specified table.
- *
- * @param aTableName
- * The table to check if ANALYZE was ran.
- * @param aRan
- * True if it was expected to run, false otherwise
- */
-function do_check_analyze_ran(aTableName, aRan) {
- let db = DBConn();
- do_check_true(db.tableExists("sqlite_stat1"));
- let stmt = db.createStatement("SELECT idx FROM sqlite_stat1 WHERE tbl = :table");
- stmt.params.table = aTableName;
- try {
- if (aRan) {
- do_check_true(stmt.executeStep());
- do_check_neq(stmt.row.idx, null);
- }
- else {
- do_check_false(stmt.executeStep());
- }
- }
- finally {
- stmt.finalize();
- }
-}
-
-// Tests
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* init_tests() {
- const TEST_URI = NetUtil.newURI("http://mozilla.org/");
- const TEST_TITLE = "This is a test";
-
- yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- title: TEST_TITLE,
- url: TEST_URI
- });
- yield PlacesTestUtils.addVisits(TEST_URI);
- let thing = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteInput,
- Ci.nsIAutoCompletePopup,
- Ci.nsIAutoCompleteController]),
- get popup() { return thing; },
- get controller() { return thing; },
- popupOpen: true,
- selectedIndex: 0,
- getValueAt: function() { return TEST_URI.spec; },
- searchString: TEST_TITLE,
- };
- Services.obs.notifyObservers(thing, TOPIC_AUTOCOMPLETE_FEEDBACK_INCOMING,
- null);
-});
-
-add_task(function* test_timed() {
- clearAnalyzeData();
-
- // Set a low interval and wait for the timed expiration to start.
- let promise = promiseTopicObserved(PlacesUtils.TOPIC_EXPIRATION_FINISHED);
- setInterval(3);
- yield promise;
- setInterval(3600);
-
- do_check_analyze_ran("moz_places", false);
- do_check_analyze_ran("moz_bookmarks", false);
- do_check_analyze_ran("moz_historyvisits", false);
- do_check_analyze_ran("moz_inputhistory", true);
-});
-
-add_task(function* test_debug() {
- clearAnalyzeData();
-
- yield promiseForceExpirationStep(1);
-
- do_check_analyze_ran("moz_places", true);
- do_check_analyze_ran("moz_bookmarks", true);
- do_check_analyze_ran("moz_historyvisits", true);
- do_check_analyze_ran("moz_inputhistory", true);
-});
-
-add_task(function* test_clear_history() {
- clearAnalyzeData();
-
- let promise = promiseTopicObserved(PlacesUtils.TOPIC_EXPIRATION_FINISHED);
- let listener = Cc["@mozilla.org/places/expiration;1"]
- .getService(Ci.nsINavHistoryObserver);
- listener.onClearHistory();
- yield promise;
-
- do_check_analyze_ran("moz_places", true);
- do_check_analyze_ran("moz_bookmarks", false);
- do_check_analyze_ran("moz_historyvisits", true);
- do_check_analyze_ran("moz_inputhistory", true);
-});
diff --git a/toolkit/components/places/tests/expiration/test_annos_expire_history.js b/toolkit/components/places/tests/expiration/test_annos_expire_history.js
deleted file mode 100644
index f9568a769..000000000
--- a/toolkit/components/places/tests/expiration/test_annos_expire_history.js
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * What this is aimed to test:
- *
- * EXPIRE_WITH_HISTORY annotations should be expired when a page has no more
- * visits, even if the page still exists in the database.
- * This expiration policy is only valid for page annotations.
- */
-
-var as = Cc["@mozilla.org/browser/annotation-service;1"].
- getService(Ci.nsIAnnotationService);
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_annos_expire_history() {
- // Set interval to a large value so we don't expire on it.
- setInterval(3600); // 1h
-
- // Expire all expirable pages.
- setMaxPages(0);
-
- // Add some visited page and a couple expire with history annotations for each.
- let now = getExpirablePRTime();
- for (let i = 0; i < 5; i++) {
- let pageURI = uri("http://page_anno." + i + ".mozilla.org/");
- yield PlacesTestUtils.addVisits({ uri: pageURI, visitDate: now++ });
- as.setPageAnnotation(pageURI, "page_expire1", "test", 0, as.EXPIRE_WITH_HISTORY);
- as.setPageAnnotation(pageURI, "page_expire2", "test", 0, as.EXPIRE_WITH_HISTORY);
- }
-
- let pages = as.getPagesWithAnnotation("page_expire1");
- do_check_eq(pages.length, 5);
- pages = as.getPagesWithAnnotation("page_expire2");
- do_check_eq(pages.length, 5);
-
- // Add some bookmarked page and a couple session annotations for each.
- for (let i = 0; i < 5; i++) {
- let pageURI = uri("http://item_anno." + i + ".mozilla.org/");
- // We also add a visit before bookmarking.
- yield PlacesTestUtils.addVisits({ uri: pageURI, visitDate: now++ });
- yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: pageURI,
- title: null
- });
- // Notice we use page annotations here, items annotations can't use this
- // kind of expiration policy.
- as.setPageAnnotation(pageURI, "item_persist1", "test", 0, as.EXPIRE_WITH_HISTORY);
- as.setPageAnnotation(pageURI, "item_persist2", "test", 0, as.EXPIRE_WITH_HISTORY);
- }
-
- let items = as.getPagesWithAnnotation("item_persist1");
- do_check_eq(items.length, 5);
- items = as.getPagesWithAnnotation("item_persist2");
- do_check_eq(items.length, 5);
-
- // Add other visited page and a couple expire with history annotations for each.
- // We won't expire these visits, so the annotations should survive.
- for (let i = 0; i < 5; i++) {
- let pageURI = uri("http://persist_page_anno." + i + ".mozilla.org/");
- yield PlacesTestUtils.addVisits({ uri: pageURI, visitDate: now++ });
- as.setPageAnnotation(pageURI, "page_persist1", "test", 0, as.EXPIRE_WITH_HISTORY);
- as.setPageAnnotation(pageURI, "page_persist2", "test", 0, as.EXPIRE_WITH_HISTORY);
- }
-
- pages = as.getPagesWithAnnotation("page_persist1");
- do_check_eq(pages.length, 5);
- pages = as.getPagesWithAnnotation("page_persist2");
- do_check_eq(pages.length, 5);
-
- // Expire all visits for the first 5 pages and the bookmarks.
- yield promiseForceExpirationStep(10);
-
- pages = as.getPagesWithAnnotation("page_expire1");
- do_check_eq(pages.length, 0);
- pages = as.getPagesWithAnnotation("page_expire2");
- do_check_eq(pages.length, 0);
- items = as.getItemsWithAnnotation("item_persist1");
- do_check_eq(items.length, 0);
- items = as.getItemsWithAnnotation("item_persist2");
- do_check_eq(items.length, 0);
- pages = as.getPagesWithAnnotation("page_persist1");
- do_check_eq(pages.length, 5);
- pages = as.getPagesWithAnnotation("page_persist2");
- do_check_eq(pages.length, 5);
-});
diff --git a/toolkit/components/places/tests/expiration/test_annos_expire_never.js b/toolkit/components/places/tests/expiration/test_annos_expire_never.js
deleted file mode 100644
index f146f25b5..000000000
--- a/toolkit/components/places/tests/expiration/test_annos_expire_never.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * What this is aimed to test:
- *
- * EXPIRE_NEVER annotations should be expired when a page is removed from the
- * database.
- * If the annotation is a page annotation this will happen when the page is
- * expired, namely when the page has no visits and is not bookmarked.
- * Otherwise if it's an item annotation the annotation will be expired when
- * the item is removed, thus expiration won't handle this case at all.
- */
-
-var as = Cc["@mozilla.org/browser/annotation-service;1"].
- getService(Ci.nsIAnnotationService);
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_annos_expire_never() {
- // Set interval to a large value so we don't expire on it.
- setInterval(3600); // 1h
-
- // Expire all expirable pages.
- setMaxPages(0);
-
- // Add some visited page and a couple expire never annotations for each.
- let now = getExpirablePRTime();
- for (let i = 0; i < 5; i++) {
- let pageURI = uri("http://page_anno." + i + ".mozilla.org/");
- yield PlacesTestUtils.addVisits({ uri: pageURI, visitDate: now++ });
- as.setPageAnnotation(pageURI, "page_expire1", "test", 0, as.EXPIRE_NEVER);
- as.setPageAnnotation(pageURI, "page_expire2", "test", 0, as.EXPIRE_NEVER);
- }
-
- let pages = as.getPagesWithAnnotation("page_expire1");
- do_check_eq(pages.length, 5);
- pages = as.getPagesWithAnnotation("page_expire2");
- do_check_eq(pages.length, 5);
-
- // Add some bookmarked page and a couple expire never annotations for each.
- for (let i = 0; i < 5; i++) {
- let pageURI = uri("http://item_anno." + i + ".mozilla.org/");
- // We also add a visit before bookmarking.
- yield PlacesTestUtils.addVisits({ uri: pageURI, visitDate: now++ });
- let bm = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: pageURI,
- title: null
- });
- let id = yield PlacesUtils.promiseItemId(bm.guid);
- as.setItemAnnotation(id, "item_persist1", "test", 0, as.EXPIRE_NEVER);
- as.setItemAnnotation(id, "item_persist2", "test", 0, as.EXPIRE_NEVER);
- }
-
- let items = as.getItemsWithAnnotation("item_persist1");
- do_check_eq(items.length, 5);
- items = as.getItemsWithAnnotation("item_persist2");
- do_check_eq(items.length, 5);
-
- // Add other visited page and a couple expire never annotations for each.
- // We won't expire these visits, so the annotations should survive.
- for (let i = 0; i < 5; i++) {
- let pageURI = uri("http://persist_page_anno." + i + ".mozilla.org/");
- yield PlacesTestUtils.addVisits({ uri: pageURI, visitDate: now++ });
- as.setPageAnnotation(pageURI, "page_persist1", "test", 0, as.EXPIRE_NEVER);
- as.setPageAnnotation(pageURI, "page_persist2", "test", 0, as.EXPIRE_NEVER);
- }
-
- pages = as.getPagesWithAnnotation("page_persist1");
- do_check_eq(pages.length, 5);
- pages = as.getPagesWithAnnotation("page_persist2");
- do_check_eq(pages.length, 5);
-
- // Expire all visits for the first 5 pages and the bookmarks.
- yield promiseForceExpirationStep(10);
-
- pages = as.getPagesWithAnnotation("page_expire1");
- do_check_eq(pages.length, 0);
- pages = as.getPagesWithAnnotation("page_expire2");
- do_check_eq(pages.length, 0);
- items = as.getItemsWithAnnotation("item_persist1");
- do_check_eq(items.length, 5);
- items = as.getItemsWithAnnotation("item_persist2");
- do_check_eq(items.length, 5);
- pages = as.getPagesWithAnnotation("page_persist1");
- do_check_eq(pages.length, 5);
- pages = as.getPagesWithAnnotation("page_persist2");
- do_check_eq(pages.length, 5);
-});
diff --git a/toolkit/components/places/tests/expiration/test_annos_expire_policy.js b/toolkit/components/places/tests/expiration/test_annos_expire_policy.js
deleted file mode 100644
index 2fe50e13e..000000000
--- a/toolkit/components/places/tests/expiration/test_annos_expire_policy.js
+++ /dev/null
@@ -1,189 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * What this is aimed to test:
- *
- * Annotations can be set with a timed expiration policy.
- * Supported policies are:
- * - EXPIRE_DAYS: annotation would be expired after 7 days
- * - EXPIRE_WEEKS: annotation would be expired after 30 days
- * - EXPIRE_MONTHS: annotation would be expired after 180 days
- */
-
-var as = Cc["@mozilla.org/browser/annotation-service;1"].
- getService(Ci.nsIAnnotationService);
-
-/**
- * Creates an aged annotation.
- *
- * @param aIdentifier Either a page url or an item id.
- * @param aIdentifier Name of the annotation.
- * @param aValue Value for the annotation.
- * @param aExpirePolicy Expiration policy of the annotation.
- * @param aAgeInDays Age in days of the annotation.
- * @param [optional] aLastModifiedAgeInDays Age in days of the annotation, for lastModified.
- */
-var now = Date.now();
-function add_old_anno(aIdentifier, aName, aValue, aExpirePolicy,
- aAgeInDays, aLastModifiedAgeInDays) {
- let expireDate = (now - (aAgeInDays * 86400 * 1000)) * 1000;
- let lastModifiedDate = 0;
- if (aLastModifiedAgeInDays)
- lastModifiedDate = (now - (aLastModifiedAgeInDays * 86400 * 1000)) * 1000;
-
- let sql;
- if (typeof(aIdentifier) == "number") {
- // Item annotation.
- as.setItemAnnotation(aIdentifier, aName, aValue, 0, aExpirePolicy);
- // Update dateAdded for the last added annotation.
- sql = "UPDATE moz_items_annos SET dateAdded = :expire_date, lastModified = :last_modified " +
- "WHERE id = (SELECT id FROM moz_items_annos " +
- "WHERE item_id = :id " +
- "ORDER BY dateAdded DESC LIMIT 1)";
- }
- else if (aIdentifier instanceof Ci.nsIURI) {
- // Page annotation.
- as.setPageAnnotation(aIdentifier, aName, aValue, 0, aExpirePolicy);
- // Update dateAdded for the last added annotation.
- sql = "UPDATE moz_annos SET dateAdded = :expire_date, lastModified = :last_modified " +
- "WHERE id = (SELECT a.id FROM moz_annos a " +
- "LEFT JOIN moz_places h on h.id = a.place_id " +
- "WHERE h.url_hash = hash(:id) AND h.url = :id " +
- "ORDER BY a.dateAdded DESC LIMIT 1)";
- }
- else
- do_throw("Wrong identifier type");
-
- let stmt = DBConn().createStatement(sql);
- stmt.params.id = (typeof(aIdentifier) == "number") ? aIdentifier
- : aIdentifier.spec;
- stmt.params.expire_date = expireDate;
- stmt.params.last_modified = lastModifiedDate;
- try {
- stmt.executeStep();
- }
- finally {
- stmt.finalize();
- }
-}
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_annos_expire_policy() {
- // Set interval to a large value so we don't expire on it.
- setInterval(3600); // 1h
-
- // Expire all expirable pages.
- setMaxPages(0);
-
- let now_specific_to_test = getExpirablePRTime();
- // Add some bookmarked page and timed annotations for each.
- for (let i = 0; i < 5; i++) {
- let pageURI = uri("http://item_anno." + i + ".mozilla.org/");
- yield PlacesTestUtils.addVisits({ uri: pageURI, visitDate: now_specific_to_test++ });
- let bm = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: pageURI,
- title: null
- });
- let id = yield PlacesUtils.promiseItemId(bm.guid);
- // Add a 6 days old anno.
- add_old_anno(id, "persist_days", "test", as.EXPIRE_DAYS, 6);
- // Add a 8 days old anno, modified 5 days ago.
- add_old_anno(id, "persist_lm_days", "test", as.EXPIRE_DAYS, 8, 6);
- // Add a 8 days old anno.
- add_old_anno(id, "expire_days", "test", as.EXPIRE_DAYS, 8);
-
- // Add a 29 days old anno.
- add_old_anno(id, "persist_weeks", "test", as.EXPIRE_WEEKS, 29);
- // Add a 31 days old anno, modified 29 days ago.
- add_old_anno(id, "persist_lm_weeks", "test", as.EXPIRE_WEEKS, 31, 29);
- // Add a 31 days old anno.
- add_old_anno(id, "expire_weeks", "test", as.EXPIRE_WEEKS, 31);
-
- // Add a 179 days old anno.
- add_old_anno(id, "persist_months", "test", as.EXPIRE_MONTHS, 179);
- // Add a 181 days old anno, modified 179 days ago.
- add_old_anno(id, "persist_lm_months", "test", as.EXPIRE_MONTHS, 181, 179);
- // Add a 181 days old anno.
- add_old_anno(id, "expire_months", "test", as.EXPIRE_MONTHS, 181);
-
- // Add a 6 days old anno.
- add_old_anno(pageURI, "persist_days", "test", as.EXPIRE_DAYS, 6);
- // Add a 8 days old anno, modified 5 days ago.
- add_old_anno(pageURI, "persist_lm_days", "test", as.EXPIRE_DAYS, 8, 6);
- // Add a 8 days old anno.
- add_old_anno(pageURI, "expire_days", "test", as.EXPIRE_DAYS, 8);
-
- // Add a 29 days old anno.
- add_old_anno(pageURI, "persist_weeks", "test", as.EXPIRE_WEEKS, 29);
- // Add a 31 days old anno, modified 29 days ago.
- add_old_anno(pageURI, "persist_lm_weeks", "test", as.EXPIRE_WEEKS, 31, 29);
- // Add a 31 days old anno.
- add_old_anno(pageURI, "expire_weeks", "test", as.EXPIRE_WEEKS, 31);
-
- // Add a 179 days old anno.
- add_old_anno(pageURI, "persist_months", "test", as.EXPIRE_MONTHS, 179);
- // Add a 181 days old anno, modified 179 days ago.
- add_old_anno(pageURI, "persist_lm_months", "test", as.EXPIRE_MONTHS, 181, 179);
- // Add a 181 days old anno.
- add_old_anno(pageURI, "expire_months", "test", as.EXPIRE_MONTHS, 181);
- }
-
- // Add some visited page and timed annotations for each.
- for (let i = 0; i < 5; i++) {
- let pageURI = uri("http://page_anno." + i + ".mozilla.org/");
- yield PlacesTestUtils.addVisits({ uri: pageURI, visitDate: now_specific_to_test++ });
- // Add a 6 days old anno.
- add_old_anno(pageURI, "persist_days", "test", as.EXPIRE_DAYS, 6);
- // Add a 8 days old anno, modified 5 days ago.
- add_old_anno(pageURI, "persist_lm_days", "test", as.EXPIRE_DAYS, 8, 6);
- // Add a 8 days old anno.
- add_old_anno(pageURI, "expire_days", "test", as.EXPIRE_DAYS, 8);
-
- // Add a 29 days old anno.
- add_old_anno(pageURI, "persist_weeks", "test", as.EXPIRE_WEEKS, 29);
- // Add a 31 days old anno, modified 29 days ago.
- add_old_anno(pageURI, "persist_lm_weeks", "test", as.EXPIRE_WEEKS, 31, 29);
- // Add a 31 days old anno.
- add_old_anno(pageURI, "expire_weeks", "test", as.EXPIRE_WEEKS, 31);
-
- // Add a 179 days old anno.
- add_old_anno(pageURI, "persist_months", "test", as.EXPIRE_MONTHS, 179);
- // Add a 181 days old anno, modified 179 days ago.
- add_old_anno(pageURI, "persist_lm_months", "test", as.EXPIRE_MONTHS, 181, 179);
- // Add a 181 days old anno.
- add_old_anno(pageURI, "expire_months", "test", as.EXPIRE_MONTHS, 181);
- }
-
- // Expire all visits for the bookmarks.
- yield promiseForceExpirationStep(5);
-
- ["expire_days", "expire_weeks", "expire_months"].forEach(function(aAnno) {
- let pages = as.getPagesWithAnnotation(aAnno);
- do_check_eq(pages.length, 0);
- });
-
- ["expire_days", "expire_weeks", "expire_months"].forEach(function(aAnno) {
- let items = as.getItemsWithAnnotation(aAnno);
- do_check_eq(items.length, 0);
- });
-
- ["persist_days", "persist_lm_days", "persist_weeks", "persist_lm_weeks",
- "persist_months", "persist_lm_months"].forEach(function(aAnno) {
- let pages = as.getPagesWithAnnotation(aAnno);
- do_check_eq(pages.length, 10);
- });
-
- ["persist_days", "persist_lm_days", "persist_weeks", "persist_lm_weeks",
- "persist_months", "persist_lm_months"].forEach(function(aAnno) {
- let items = as.getItemsWithAnnotation(aAnno);
- do_check_eq(items.length, 5);
- });
-});
diff --git a/toolkit/components/places/tests/expiration/test_annos_expire_session.js b/toolkit/components/places/tests/expiration/test_annos_expire_session.js
deleted file mode 100644
index 68c995f80..000000000
--- a/toolkit/components/places/tests/expiration/test_annos_expire_session.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * What this is aimed to test:
- *
- * Session annotations should be expired when browsing session ends.
- */
-
-var as = Cc["@mozilla.org/browser/annotation-service;1"].
- getService(Ci.nsIAnnotationService);
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_annos_expire_session() {
- // Set interval to a large value so we don't expire on it.
- setInterval(3600); // 1h
-
- // Add some visited page and a couple session annotations for each.
- let now = Date.now() * 1000;
- for (let i = 0; i < 10; i++) {
- let pageURI = uri("http://session_page_anno." + i + ".mozilla.org/");
- yield PlacesTestUtils.addVisits({ uri: pageURI, visitDate: now++ });
- as.setPageAnnotation(pageURI, "test1", "test", 0, as.EXPIRE_SESSION);
- as.setPageAnnotation(pageURI, "test2", "test", 0, as.EXPIRE_SESSION);
- }
-
- // Add some bookmarked page and a couple session annotations for each.
- for (let i = 0; i < 10; i++) {
- let pageURI = uri("http://session_item_anno." + i + ".mozilla.org/");
- let bm = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: pageURI,
- title: null
- });
- let id = yield PlacesUtils.promiseItemId(bm.guid);
- as.setItemAnnotation(id, "test1", "test", 0, as.EXPIRE_SESSION);
- as.setItemAnnotation(id, "test2", "test", 0, as.EXPIRE_SESSION);
- }
-
-
- let pages = as.getPagesWithAnnotation("test1");
- do_check_eq(pages.length, 10);
- pages = as.getPagesWithAnnotation("test2");
- do_check_eq(pages.length, 10);
- let items = as.getItemsWithAnnotation("test1");
- do_check_eq(items.length, 10);
- items = as.getItemsWithAnnotation("test2");
- do_check_eq(items.length, 10);
-
- let deferred = Promise.defer();
- waitForConnectionClosed(function() {
- let stmt = DBConn(true).createAsyncStatement(
- `SELECT id FROM moz_annos
- UNION ALL
- SELECT id FROM moz_items_annos
- WHERE expiration = :expiration`
- );
- stmt.params.expiration = as.EXPIRE_SESSION;
- stmt.executeAsync({
- handleResult: function(aResultSet) {
- dump_table("moz_annos");
- dump_table("moz_items_annos");
- do_throw("Should not find any leftover session annotations");
- },
- handleError: function(aError) {
- do_throw("Error code " + aError.result + " with message '" +
- aError.message + "' returned.");
- },
- handleCompletion: function(aReason) {
- do_check_eq(aReason, Ci.mozIStorageStatementCallback.REASON_FINISHED);
- deferred.resolve();
- }
- });
- stmt.finalize();
- });
- yield deferred.promise;
-});
diff --git a/toolkit/components/places/tests/expiration/test_clearHistory.js b/toolkit/components/places/tests/expiration/test_clearHistory.js
deleted file mode 100644
index d3879d7ad..000000000
--- a/toolkit/components/places/tests/expiration/test_clearHistory.js
+++ /dev/null
@@ -1,157 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * What this is aimed to test:
- *
- * History.clear() should expire everything but bookmarked pages and valid
- * annos.
- */
-
-var hs = PlacesUtils.history;
-var as = PlacesUtils.annotations;
-
-/**
- * Creates an aged annotation.
- *
- * @param aIdentifier Either a page url or an item id.
- * @param aIdentifier Name of the annotation.
- * @param aValue Value for the annotation.
- * @param aExpirePolicy Expiration policy of the annotation.
- * @param aAgeInDays Age in days of the annotation.
- * @param [optional] aLastModifiedAgeInDays Age in days of the annotation, for lastModified.
- */
-var now = Date.now();
-function add_old_anno(aIdentifier, aName, aValue, aExpirePolicy,
- aAgeInDays, aLastModifiedAgeInDays) {
- let expireDate = (now - (aAgeInDays * 86400 * 1000)) * 1000;
- let lastModifiedDate = 0;
- if (aLastModifiedAgeInDays)
- lastModifiedDate = (now - (aLastModifiedAgeInDays * 86400 * 1000)) * 1000;
-
- let sql;
- if (typeof(aIdentifier) == "number") {
- // Item annotation.
- as.setItemAnnotation(aIdentifier, aName, aValue, 0, aExpirePolicy);
- // Update dateAdded for the last added annotation.
- sql = "UPDATE moz_items_annos SET dateAdded = :expire_date, lastModified = :last_modified " +
- "WHERE id = ( " +
- "SELECT a.id FROM moz_items_annos a " +
- "JOIN moz_anno_attributes n ON n.id = a.anno_attribute_id " +
- "WHERE a.item_id = :id " +
- "AND n.name = :anno_name " +
- "ORDER BY a.dateAdded DESC LIMIT 1 " +
- ")";
- }
- else if (aIdentifier instanceof Ci.nsIURI) {
- // Page annotation.
- as.setPageAnnotation(aIdentifier, aName, aValue, 0, aExpirePolicy);
- // Update dateAdded for the last added annotation.
- sql = "UPDATE moz_annos SET dateAdded = :expire_date, lastModified = :last_modified " +
- "WHERE id = ( " +
- "SELECT a.id FROM moz_annos a " +
- "JOIN moz_anno_attributes n ON n.id = a.anno_attribute_id " +
- "JOIN moz_places h on h.id = a.place_id " +
- "WHERE h.url_hash = hash(:id) AND h.url = :id " +
- "AND n.name = :anno_name " +
- "ORDER BY a.dateAdded DESC LIMIT 1 " +
- ")";
- }
- else
- do_throw("Wrong identifier type");
-
- let stmt = DBConn().createStatement(sql);
- stmt.params.id = (typeof(aIdentifier) == "number") ? aIdentifier
- : aIdentifier.spec;
- stmt.params.expire_date = expireDate;
- stmt.params.last_modified = lastModifiedDate;
- stmt.params.anno_name = aName;
- try {
- stmt.executeStep();
- }
- finally {
- stmt.finalize();
- }
-}
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_historyClear() {
- // Set interval to a large value so we don't expire on it.
- setInterval(3600); // 1h
-
- // Expire all expirable pages.
- setMaxPages(0);
-
- // Add some bookmarked page with visit and annotations.
- for (let i = 0; i < 5; i++) {
- let pageURI = uri("http://item_anno." + i + ".mozilla.org/");
- // This visit will be expired.
- yield PlacesTestUtils.addVisits({ uri: pageURI });
- let bm = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: pageURI,
- title: null
- });
- let id = yield PlacesUtils.promiseItemId(bm.guid);
- // Will persist because it's an EXPIRE_NEVER item anno.
- as.setItemAnnotation(id, "persist", "test", 0, as.EXPIRE_NEVER);
- // Will persist because the page is bookmarked.
- as.setPageAnnotation(pageURI, "persist", "test", 0, as.EXPIRE_NEVER);
- // All EXPIRE_SESSION annotations are expected to expire on clear history.
- as.setItemAnnotation(id, "expire_session", "test", 0, as.EXPIRE_SESSION);
- as.setPageAnnotation(pageURI, "expire_session", "test", 0, as.EXPIRE_SESSION);
- // Annotations with timed policy will expire regardless bookmarked status.
- add_old_anno(id, "expire_days", "test", as.EXPIRE_DAYS, 8);
- add_old_anno(id, "expire_weeks", "test", as.EXPIRE_WEEKS, 31);
- add_old_anno(id, "expire_months", "test", as.EXPIRE_MONTHS, 181);
- add_old_anno(pageURI, "expire_days", "test", as.EXPIRE_DAYS, 8);
- add_old_anno(pageURI, "expire_weeks", "test", as.EXPIRE_WEEKS, 31);
- add_old_anno(pageURI, "expire_months", "test", as.EXPIRE_MONTHS, 181);
- }
-
- // Add some visited page and annotations for each.
- for (let i = 0; i < 5; i++) {
- // All page annotations related to these expired pages are expected to
- // expire as well.
- let pageURI = uri("http://page_anno." + i + ".mozilla.org/");
- yield PlacesTestUtils.addVisits({ uri: pageURI });
- as.setPageAnnotation(pageURI, "expire", "test", 0, as.EXPIRE_NEVER);
- as.setPageAnnotation(pageURI, "expire_session", "test", 0, as.EXPIRE_SESSION);
- add_old_anno(pageURI, "expire_days", "test", as.EXPIRE_DAYS, 8);
- add_old_anno(pageURI, "expire_weeks", "test", as.EXPIRE_WEEKS, 31);
- add_old_anno(pageURI, "expire_months", "test", as.EXPIRE_MONTHS, 181);
- }
-
- // Expire all visits for the bookmarks
- yield PlacesUtils.history.clear();
-
- ["expire_days", "expire_weeks", "expire_months", "expire_session",
- "expire"].forEach(function(aAnno) {
- let pages = as.getPagesWithAnnotation(aAnno);
- do_check_eq(pages.length, 0);
- });
-
- ["expire_days", "expire_weeks", "expire_months", "expire_session",
- "expire"].forEach(function(aAnno) {
- let items = as.getItemsWithAnnotation(aAnno);
- do_check_eq(items.length, 0);
- });
-
- let pages = as.getPagesWithAnnotation("persist");
- do_check_eq(pages.length, 5);
-
- let items = as.getItemsWithAnnotation("persist");
- do_check_eq(items.length, 5);
-
- for (let itemId of items) {
- // Check item exists.
- let guid = yield PlacesUtils.promiseItemGuid(itemId);
- do_check_true((yield PlacesUtils.bookmarks.fetch({guid})), "item exists");
- }
-});
diff --git a/toolkit/components/places/tests/expiration/test_debug_expiration.js b/toolkit/components/places/tests/expiration/test_debug_expiration.js
deleted file mode 100644
index 456c03363..000000000
--- a/toolkit/components/places/tests/expiration/test_debug_expiration.js
+++ /dev/null
@@ -1,225 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * What this is aimed to test:
- *
- * Expiration can be manually triggered through a debug topic, but that should
- * only expire orphan entries, unless -1 is passed as limit.
- */
-
-var gNow = getExpirablePRTime(60);
-
-add_task(function* test_expire_orphans()
-{
- // Add visits to 2 pages and force a orphan expiration. Visits should survive.
- yield PlacesTestUtils.addVisits({
- uri: uri("http://page1.mozilla.org/"),
- visitDate: gNow++
- });
- yield PlacesTestUtils.addVisits({
- uri: uri("http://page2.mozilla.org/"),
- visitDate: gNow++
- });
- // Create a orphan place.
- let bm = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://page3.mozilla.org/",
- title: ""
- });
- yield PlacesUtils.bookmarks.remove(bm);
-
- // Expire now.
- yield promiseForceExpirationStep(0);
-
- // Check that visits survived.
- do_check_eq(visits_in_database("http://page1.mozilla.org/"), 1);
- do_check_eq(visits_in_database("http://page2.mozilla.org/"), 1);
- do_check_false(page_in_database("http://page3.mozilla.org/"));
-
- // Clean up.
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_expire_orphans_optionalarg()
-{
- // Add visits to 2 pages and force a orphan expiration. Visits should survive.
- yield PlacesTestUtils.addVisits({
- uri: uri("http://page1.mozilla.org/"),
- visitDate: gNow++
- });
- yield PlacesTestUtils.addVisits({
- uri: uri("http://page2.mozilla.org/"),
- visitDate: gNow++
- });
- // Create a orphan place.
- let bm = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "http://page3.mozilla.org/",
- title: ""
- });
- yield PlacesUtils.bookmarks.remove(bm);
-
- // Expire now.
- yield promiseForceExpirationStep();
-
- // Check that visits survived.
- do_check_eq(visits_in_database("http://page1.mozilla.org/"), 1);
- do_check_eq(visits_in_database("http://page2.mozilla.org/"), 1);
- do_check_false(page_in_database("http://page3.mozilla.org/"));
-
- // Clean up.
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_expire_limited()
-{
- yield PlacesTestUtils.addVisits([
- { // Should be expired cause it's the oldest visit
- uri: "http://old.mozilla.org/",
- visitDate: gNow++
- },
- { // Should not be expired cause we limit 1
- uri: "http://new.mozilla.org/",
- visitDate: gNow++
- },
- ]);
-
- // Expire now.
- yield promiseForceExpirationStep(1);
-
- // Check that newer visit survived.
- do_check_eq(visits_in_database("http://new.mozilla.org/"), 1);
- // Other visits should have been expired.
- do_check_false(page_in_database("http://old.mozilla.org/"));
-
- // Clean up.
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_expire_limited_longurl()
-{
- let longurl = "http://long.mozilla.org/" + "a".repeat(232);
- yield PlacesTestUtils.addVisits([
- { // Should be expired cause it's the oldest visit
- uri: "http://old.mozilla.org/",
- visitDate: gNow++
- },
- { // Should be expired cause it's a long url older than 60 days.
- uri: longurl,
- visitDate: gNow++
- },
- { // Should not be expired cause younger than 60 days.
- uri: longurl,
- visitDate: getExpirablePRTime(58)
- }
- ]);
-
- yield promiseForceExpirationStep(1);
-
- // Check that some visits survived.
- do_check_eq(visits_in_database(longurl), 1);
- // Other visits should have been expired.
- do_check_false(page_in_database("http://old.mozilla.org/"));
-
- // Clean up.
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_expire_limited_exoticurl()
-{
- yield PlacesTestUtils.addVisits([
- { // Should be expired cause it's the oldest visit
- uri: "http://old.mozilla.org/",
- visitDate: gNow++
- },
- { // Should be expired cause it's a long url older than 60 days.
- uri: "http://download.mozilla.org",
- visitDate: gNow++,
- transition: 7
- },
- { // Should not be expired cause younger than 60 days.
- uri: "http://nonexpirable-download.mozilla.org",
- visitDate: getExpirablePRTime(58),
- transition: 7
- }
- ]);
-
- yield promiseForceExpirationStep(1);
-
- // Check that some visits survived.
- do_check_eq(visits_in_database("http://nonexpirable-download.mozilla.org/"), 1);
- // The visits are gone, the url is not yet, cause we limited the expiration
- // to one entry, and we already removed http://old.mozilla.org/.
- // The page normally would be expired by the next expiration run.
- do_check_eq(visits_in_database("http://download.mozilla.org/"), 0);
- // Other visits should have been expired.
- do_check_false(page_in_database("http://old.mozilla.org/"));
-
- // Clean up.
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_expire_unlimited()
-{
- let longurl = "http://long.mozilla.org/" + "a".repeat(232);
- yield PlacesTestUtils.addVisits([
- {
- uri: "http://old.mozilla.org/",
- visitDate: gNow++
- },
- {
- uri: "http://new.mozilla.org/",
- visitDate: gNow++
- },
- // Add expirable visits.
- {
- uri: "http://download.mozilla.org/",
- visitDate: gNow++,
- transition: PlacesUtils.history.TRANSITION_DOWNLOAD
- },
- {
- uri: longurl,
- visitDate: gNow++
- },
-
- // Add non-expirable visits
- {
- uri: "http://nonexpirable.mozilla.org/",
- visitDate: getExpirablePRTime(5)
- },
- {
- uri: "http://nonexpirable-download.mozilla.org/",
- visitDate: getExpirablePRTime(5),
- transition: PlacesUtils.history.TRANSITION_DOWNLOAD
- },
- {
- uri: longurl,
- visitDate: getExpirablePRTime(5)
- }
- ]);
-
- yield promiseForceExpirationStep(-1);
-
- // Check that some visits survived.
- do_check_eq(visits_in_database("http://nonexpirable.mozilla.org/"), 1);
- do_check_eq(visits_in_database("http://nonexpirable-download.mozilla.org/"), 1);
- do_check_eq(visits_in_database(longurl), 1);
- // Other visits should have been expired.
- do_check_false(page_in_database("http://old.mozilla.org/"));
- do_check_false(page_in_database("http://download.mozilla.org/"));
- do_check_false(page_in_database("http://new.mozilla.org/"));
-
- // Clean up.
- yield PlacesTestUtils.clearHistory();
-});
-
-function run_test()
-{
- // Set interval to a large value so we don't expire on it.
- setInterval(3600); // 1h
- // Set maxPages to a low value, so it's easy to go over it.
- setMaxPages(1);
-
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/expiration/test_idle_daily.js b/toolkit/components/places/tests/expiration/test_idle_daily.js
deleted file mode 100644
index 05e5a8125..000000000
--- a/toolkit/components/places/tests/expiration/test_idle_daily.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Test that expiration runs on idle-daily.
-
-function run_test() {
- do_test_pending();
-
- // Set interval to a large value so we don't expire on it.
- setInterval(3600); // 1h
-
- Services.obs.addObserver(function observeExpiration(aSubject, aTopic, aData) {
- Services.obs.removeObserver(observeExpiration,
- PlacesUtils.TOPIC_EXPIRATION_FINISHED);
- do_test_finished();
- }, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false);
-
- let expire = Cc["@mozilla.org/places/expiration;1"].
- getService(Ci.nsIObserver);
- expire.observe(null, "idle-daily", null);
-}
diff --git a/toolkit/components/places/tests/expiration/test_notifications.js b/toolkit/components/places/tests/expiration/test_notifications.js
deleted file mode 100644
index 06e585c6c..000000000
--- a/toolkit/components/places/tests/expiration/test_notifications.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * What this is aimed to test:
- *
- * Ensure that History (through category cache) notifies us just once.
- */
-
-var os = Cc["@mozilla.org/observer-service;1"].
- getService(Ci.nsIObserverService);
-
-var gObserver = {
- notifications: 0,
- observe: function(aSubject, aTopic, aData) {
- this.notifications++;
- }
-};
-os.addObserver(gObserver, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false);
-
-function run_test() {
- // Set interval to a large value so we don't expire on it.
- setInterval(3600); // 1h
-
- PlacesTestUtils.clearHistory();
-
- do_timeout(2000, check_result);
- do_test_pending();
-}
-
-function check_result() {
- os.removeObserver(gObserver, PlacesUtils.TOPIC_EXPIRATION_FINISHED);
- do_check_eq(gObserver.notifications, 1);
- do_test_finished();
-}
diff --git a/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js b/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js
deleted file mode 100644
index f70cd2b58..000000000
--- a/toolkit/components/places/tests/expiration/test_notifications_onDeleteURI.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * What this is aimed to test:
- *
- * Expiring a full page should fire an onDeleteURI notification.
- */
-
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-
-var tests = [
-
- { desc: "Add 1 bookmarked page.",
- addPages: 1,
- addBookmarks: 1,
- expectedNotifications: 0, // No expirable pages.
- },
-
- { desc: "Add 2 pages, 1 bookmarked.",
- addPages: 2,
- addBookmarks: 1,
- expectedNotifications: 1, // Only one expirable page.
- },
-
- { desc: "Add 10 pages, none bookmarked.",
- addPages: 10,
- addBookmarks: 0,
- expectedNotifications: 10, // Will expire everything.
- },
-
- { desc: "Add 10 pages, all bookmarked.",
- addPages: 10,
- addBookmarks: 10,
- expectedNotifications: 0, // No expirable pages.
- },
-
-];
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_notifications_onDeleteURI() {
- // Set interval to a large value so we don't expire on it.
- setInterval(3600); // 1h
-
- // Expire anything that is expirable.
- setMaxPages(0);
-
- for (let testIndex = 1; testIndex <= tests.length; testIndex++) {
- let currentTest = tests[testIndex -1];
- print("\nTEST " + testIndex + ": " + currentTest.desc);
- currentTest.receivedNotifications = 0;
-
- // Setup visits.
- let now = getExpirablePRTime();
- for (let i = 0; i < currentTest.addPages; i++) {
- let page = "http://" + testIndex + "." + i + ".mozilla.org/";
- yield PlacesTestUtils.addVisits({ uri: uri(page), visitDate: now++ });
- }
-
- // Setup bookmarks.
- currentTest.bookmarks = [];
- for (let i = 0; i < currentTest.addBookmarks; i++) {
- let page = "http://" + testIndex + "." + i + ".mozilla.org/";
- yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- title: null,
- url: page
- });
- currentTest.bookmarks.push(page);
- }
-
- // Observe history.
- historyObserver = {
- onBeginUpdateBatch: function PEX_onBeginUpdateBatch() {},
- onEndUpdateBatch: function PEX_onEndUpdateBatch() {},
- onClearHistory: function() {},
- onVisit: function() {},
- onTitleChanged: function() {},
- onDeleteURI: function(aURI, aGUID, aReason) {
- currentTest.receivedNotifications++;
- // Check this uri was not bookmarked.
- do_check_eq(currentTest.bookmarks.indexOf(aURI.spec), -1);
- do_check_valid_places_guid(aGUID);
- do_check_eq(aReason, Ci.nsINavHistoryObserver.REASON_EXPIRED);
- },
- onPageChanged: function() {},
- onDeleteVisits: function(aURI, aTime) { },
- };
- hs.addObserver(historyObserver, false);
-
- // Expire now.
- yield promiseForceExpirationStep(-1);
-
- hs.removeObserver(historyObserver, false);
-
- do_check_eq(currentTest.receivedNotifications,
- currentTest.expectedNotifications);
-
- // Clean up.
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
- }
-
- clearMaxPages();
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-});
diff --git a/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js b/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js
deleted file mode 100644
index e6b99ff8b..000000000
--- a/toolkit/components/places/tests/expiration/test_notifications_onDeleteVisits.js
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * What this is aimed to test:
- *
- * Expiring only visits for a page, but not the full page, should fire an
- * onDeleteVisits notification.
- */
-
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-
-var tests = [
-
- { desc: "Add 1 bookmarked page.",
- addPages: 1,
- visitsPerPage: 1,
- addBookmarks: 1,
- limitExpiration: -1,
- expectedNotifications: 1, // Will expire visits for 1 page.
- },
-
- { desc: "Add 2 pages, 1 bookmarked.",
- addPages: 2,
- visitsPerPage: 1,
- addBookmarks: 1,
- limitExpiration: -1,
- expectedNotifications: 1, // Will expire visits for 1 page.
- },
-
- { desc: "Add 10 pages, none bookmarked.",
- addPages: 10,
- visitsPerPage: 1,
- addBookmarks: 0,
- limitExpiration: -1,
- expectedNotifications: 0, // Will expire only full pages.
- },
-
- { desc: "Add 10 pages, all bookmarked.",
- addPages: 10,
- visitsPerPage: 1,
- addBookmarks: 10,
- limitExpiration: -1,
- expectedNotifications: 10, // Will expire visist for all pages.
- },
-
- { desc: "Add 10 pages with lot of visits, none bookmarked.",
- addPages: 10,
- visitsPerPage: 10,
- addBookmarks: 0,
- limitExpiration: 10,
- expectedNotifications: 10, // Will expire 1 visist for each page, but won't
- }, // expire pages since they still have visits.
-
-];
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_notifications_onDeleteVisits() {
- // Set interval to a large value so we don't expire on it.
- setInterval(3600); // 1h
-
- // Expire anything that is expirable.
- setMaxPages(0);
-
- for (let testIndex = 1; testIndex <= tests.length; testIndex++) {
- let currentTest = tests[testIndex -1];
- print("\nTEST " + testIndex + ": " + currentTest.desc);
- currentTest.receivedNotifications = 0;
-
- // Setup visits.
- let timeInMicroseconds = getExpirablePRTime(8);
-
- function newTimeInMicroseconds() {
- timeInMicroseconds = timeInMicroseconds + 1000;
- return timeInMicroseconds;
- }
-
- for (let j = 0; j < currentTest.visitsPerPage; j++) {
- for (let i = 0; i < currentTest.addPages; i++) {
- let page = "http://" + testIndex + "." + i + ".mozilla.org/";
- yield PlacesTestUtils.addVisits({ uri: uri(page), visitDate: newTimeInMicroseconds() });
- }
- }
-
- // Setup bookmarks.
- currentTest.bookmarks = [];
- for (let i = 0; i < currentTest.addBookmarks; i++) {
- let page = "http://" + testIndex + "." + i + ".mozilla.org/";
- yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- title: null,
- url: page
- });
- currentTest.bookmarks.push(page);
- }
-
- // Observe history.
- historyObserver = {
- onBeginUpdateBatch: function PEX_onBeginUpdateBatch() {},
- onEndUpdateBatch: function PEX_onEndUpdateBatch() {},
- onClearHistory: function() {},
- onVisit: function() {},
- onTitleChanged: function() {},
- onDeleteURI: function(aURI, aGUID, aReason) {
- // Check this uri was not bookmarked.
- do_check_eq(currentTest.bookmarks.indexOf(aURI.spec), -1);
- do_check_valid_places_guid(aGUID);
- do_check_eq(aReason, Ci.nsINavHistoryObserver.REASON_EXPIRED);
- },
- onPageChanged: function() {},
- onDeleteVisits: function(aURI, aTime, aGUID, aReason) {
- currentTest.receivedNotifications++;
- do_check_guid_for_uri(aURI, aGUID);
- do_check_eq(aReason, Ci.nsINavHistoryObserver.REASON_EXPIRED);
- },
- };
- hs.addObserver(historyObserver, false);
-
- // Expire now.
- yield promiseForceExpirationStep(currentTest.limitExpiration);
-
- hs.removeObserver(historyObserver, false);
-
- do_check_eq(currentTest.receivedNotifications,
- currentTest.expectedNotifications);
-
- // Clean up.
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
- }
-
- clearMaxPages();
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-});
diff --git a/toolkit/components/places/tests/expiration/test_outdated_analyze.js b/toolkit/components/places/tests/expiration/test_outdated_analyze.js
deleted file mode 100644
index 9cf61f06b..000000000
--- a/toolkit/components/places/tests/expiration/test_outdated_analyze.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Test that expiration executes ANALYZE when statistics are outdated.
-
-const TEST_URL = "http://www.mozilla.org/";
-
-XPCOMUtils.defineLazyServiceGetter(this, "gHistory",
- "@mozilla.org/browser/history;1",
- "mozIAsyncHistory");
-
-/**
- * Object that represents a mozIVisitInfo object.
- *
- * @param [optional] aTransitionType
- * The transition type of the visit. Defaults to TRANSITION_LINK if not
- * provided.
- * @param [optional] aVisitTime
- * The time of the visit. Defaults to now if not provided.
- */
-function VisitInfo(aTransitionType, aVisitTime) {
- this.transitionType =
- aTransitionType === undefined ? TRANSITION_LINK : aTransitionType;
- this.visitDate = aVisitTime || Date.now() * 1000;
-}
-
-function run_test() {
- do_test_pending();
-
- // Init expiration before "importing".
- force_expiration_start();
-
- // Add a bunch of pages (at laast IMPORT_PAGES_THRESHOLD pages).
- let places = [];
- for (let i = 0; i < 100; i++) {
- places.push({
- uri: NetUtil.newURI(TEST_URL + i),
- title: "Title" + i,
- visits: [new VisitInfo]
- });
- }
- gHistory.updatePlaces(places);
-
- // Set interval to a small value to expire on it.
- setInterval(1); // 1s
-
- Services.obs.addObserver(function observeExpiration(aSubject, aTopic, aData) {
- Services.obs.removeObserver(observeExpiration,
- PlacesUtils.TOPIC_EXPIRATION_FINISHED);
-
- // Check that statistica are up-to-date.
- let stmt = DBConn().createAsyncStatement(
- "SELECT (SELECT COUNT(*) FROM moz_places) - "
- + "(SELECT SUBSTR(stat,1,LENGTH(stat)-2) FROM sqlite_stat1 "
- + "WHERE idx = 'moz_places_url_hashindex')"
- );
- stmt.executeAsync({
- handleResult: function(aResultSet) {
- let row = aResultSet.getNextRow();
- this._difference = row.getResultByIndex(0);
- },
- handleError: function(aError) {
- do_throw("Unexpected error (" + aError.result + "): " + aError.message);
- },
- handleCompletion: function(aReason) {
- do_check_true(this._difference === 0);
- do_test_finished();
- }
- });
- stmt.finalize();
- }, PlacesUtils.TOPIC_EXPIRATION_FINISHED, false);
-}
diff --git a/toolkit/components/places/tests/expiration/test_pref_interval.js b/toolkit/components/places/tests/expiration/test_pref_interval.js
deleted file mode 100644
index 44c749d7a..000000000
--- a/toolkit/components/places/tests/expiration/test_pref_interval.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/**
- * What this is aimed to test:
- *
- * Expiration relies on an interval, that is user-preffable setting
- * "places.history.expiration.interval_seconds".
- * On pref change it will stop current interval timer and fire a new one,
- * that will obey the new value.
- * If the pref is set to a number <= 0 we will use the default value.
- */
-
-// Default timer value for expiration in seconds. Must have same value as
-// PREF_INTERVAL_SECONDS_NOTSET in nsPlacesExpiration.
-const DEFAULT_TIMER_DELAY_SECONDS = 3 * 60;
-
-// Sync this with the const value in the component.
-const EXPIRE_AGGRESSIVITY_MULTIPLIER = 3;
-
-var tests = [
-
- // This test should be the first, so the interval won't be influenced by
- // status of history.
- { desc: "Set interval to 1s.",
- interval: 1,
- expectedTimerDelay: 1
- },
-
- { desc: "Set interval to a negative value.",
- interval: -1,
- expectedTimerDelay: DEFAULT_TIMER_DELAY_SECONDS
- },
-
- { desc: "Set interval to 0.",
- interval: 0,
- expectedTimerDelay: DEFAULT_TIMER_DELAY_SECONDS
- },
-
- { desc: "Set interval to a large value.",
- interval: 100,
- expectedTimerDelay: 100
- },
-
-];
-
-add_task(function* test() {
- // The pref should not exist by default.
- Assert.throws(() => getInterval());
-
- // Force the component, so it will start observing preferences.
- force_expiration_start();
-
- for (let currentTest of tests) {
- print(currentTest.desc);
- let promise = promiseTopicObserved("test-interval-changed");
- setInterval(currentTest.interval);
- let [, data] = yield promise;
- Assert.equal(data, currentTest.expectedTimerDelay * EXPIRE_AGGRESSIVITY_MULTIPLIER);
- }
-
- clearInterval();
-});
-
diff --git a/toolkit/components/places/tests/expiration/test_pref_maxpages.js b/toolkit/components/places/tests/expiration/test_pref_maxpages.js
deleted file mode 100644
index 6a237afbb..000000000
--- a/toolkit/components/places/tests/expiration/test_pref_maxpages.js
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * What this is aimed to test:
- *
- * Expiration will obey to hardware spec, but user can set a custom maximum
- * number of pages to retain, to restrict history, through
- * "places.history.expiration.max_pages".
- * This limit is used at next expiration run.
- * If the pref is set to a number < 0 we will use the default value.
- */
-
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-
-var tests = [
-
- { desc: "Set max_pages to a negative value, with 1 page.",
- maxPages: -1,
- addPages: 1,
- expectedNotifications: 0, // Will ignore and won't expire anything.
- },
-
- { desc: "Set max_pages to 0.",
- maxPages: 0,
- addPages: 1,
- expectedNotifications: 1,
- },
-
- { desc: "Set max_pages to 0, with 2 pages.",
- maxPages: 0,
- addPages: 2,
- expectedNotifications: 2, // Will expire everything.
- },
-
- // Notice if we are over limit we do a full step of expiration. So we ensure
- // that we will expire if we are over the limit, but we don't ensure that we
- // will expire exactly up to the limit. Thus in this case we expire
- // everything.
- { desc: "Set max_pages to 1 with 2 pages.",
- maxPages: 1,
- addPages: 2,
- expectedNotifications: 2, // Will expire everything (in this case).
- },
-
- { desc: "Set max_pages to 10, with 9 pages.",
- maxPages: 10,
- addPages: 9,
- expectedNotifications: 0, // We are at the limit, won't expire anything.
- },
-
- { desc: "Set max_pages to 10 with 10 pages.",
- maxPages: 10,
- addPages: 10,
- expectedNotifications: 0, // We are below the limit, won't expire anything.
- },
-];
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_pref_maxpages() {
- // The pref should not exist by default.
- try {
- getMaxPages();
- do_throw("interval pref should not exist by default");
- }
- catch (ex) {}
-
- // Set interval to a large value so we don't expire on it.
- setInterval(3600); // 1h
-
- for (let testIndex = 1; testIndex <= tests.length; testIndex++) {
- let currentTest = tests[testIndex -1];
- print("\nTEST " + testIndex + ": " + currentTest.desc);
- currentTest.receivedNotifications = 0;
-
- // Setup visits.
- let now = getExpirablePRTime();
- for (let i = 0; i < currentTest.addPages; i++) {
- let page = "http://" + testIndex + "." + i + ".mozilla.org/";
- yield PlacesTestUtils.addVisits({ uri: uri(page), visitDate: now++ });
- }
-
- // Observe history.
- let historyObserver = {
- onBeginUpdateBatch: function PEX_onBeginUpdateBatch() {},
- onEndUpdateBatch: function PEX_onEndUpdateBatch() {},
- onClearHistory: function() {},
- onVisit: function() {},
- onTitleChanged: function() {},
- onDeleteURI: function(aURI) {
- print("onDeleteURI " + aURI.spec);
- currentTest.receivedNotifications++;
- },
- onPageChanged: function() {},
- onDeleteVisits: function(aURI, aTime) {
- print("onDeleteVisits " + aURI.spec + " " + aTime);
- },
- };
- hs.addObserver(historyObserver, false);
-
- setMaxPages(currentTest.maxPages);
-
- // Expire now.
- yield promiseForceExpirationStep(-1);
-
- hs.removeObserver(historyObserver, false);
-
- do_check_eq(currentTest.receivedNotifications,
- currentTest.expectedNotifications);
-
- // Clean up.
- yield PlacesTestUtils.clearHistory();
- }
-
- clearMaxPages();
- yield PlacesTestUtils.clearHistory();
-});
diff --git a/toolkit/components/places/tests/expiration/xpcshell.ini b/toolkit/components/places/tests/expiration/xpcshell.ini
deleted file mode 100644
index cda7ac052..000000000
--- a/toolkit/components/places/tests/expiration/xpcshell.ini
+++ /dev/null
@@ -1,22 +0,0 @@
-[DEFAULT]
-head = head_expiration.js
-tail =
-skip-if = toolkit == 'android'
-
-[test_analyze_runs.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_annos_expire_history.js]
-[test_annos_expire_never.js]
-[test_annos_expire_policy.js]
-[test_annos_expire_session.js]
-[test_clearHistory.js]
-[test_debug_expiration.js]
-[test_idle_daily.js]
-[test_notifications.js]
-[test_notifications_onDeleteURI.js]
-[test_notifications_onDeleteVisits.js]
-[test_outdated_analyze.js]
-[test_pref_interval.js]
-[test_pref_maxpages.js]
-skip-if = os == "linux" # bug 1284083
diff --git a/toolkit/components/places/tests/favicons/.eslintrc.js b/toolkit/components/places/tests/favicons/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/places/tests/favicons/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/places/tests/favicons/expected-favicon-big32.jpg.png b/toolkit/components/places/tests/favicons/expected-favicon-big32.jpg.png
deleted file mode 100644
index 723008771..000000000
--- a/toolkit/components/places/tests/favicons/expected-favicon-big32.jpg.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/expected-favicon-big4.jpg.png b/toolkit/components/places/tests/favicons/expected-favicon-big4.jpg.png
deleted file mode 100644
index 9932c18fb..000000000
--- a/toolkit/components/places/tests/favicons/expected-favicon-big4.jpg.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/expected-favicon-big48.ico.png b/toolkit/components/places/tests/favicons/expected-favicon-big48.ico.png
deleted file mode 100644
index 9f16bef43..000000000
--- a/toolkit/components/places/tests/favicons/expected-favicon-big48.ico.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/expected-favicon-big64.png.png b/toolkit/components/places/tests/favicons/expected-favicon-big64.png.png
deleted file mode 100644
index ed158d161..000000000
--- a/toolkit/components/places/tests/favicons/expected-favicon-big64.png.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/expected-favicon-scale160x3.jpg.png b/toolkit/components/places/tests/favicons/expected-favicon-scale160x3.jpg.png
deleted file mode 100644
index 585c9e897..000000000
--- a/toolkit/components/places/tests/favicons/expected-favicon-scale160x3.jpg.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/expected-favicon-scale3x160.jpg.png b/toolkit/components/places/tests/favicons/expected-favicon-scale3x160.jpg.png
deleted file mode 100644
index e07dabc79..000000000
--- a/toolkit/components/places/tests/favicons/expected-favicon-scale3x160.jpg.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/favicon-big16.ico b/toolkit/components/places/tests/favicons/favicon-big16.ico
deleted file mode 100644
index d44438903..000000000
--- a/toolkit/components/places/tests/favicons/favicon-big16.ico
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/favicon-big32.jpg b/toolkit/components/places/tests/favicons/favicon-big32.jpg
deleted file mode 100644
index b2131bf0c..000000000
--- a/toolkit/components/places/tests/favicons/favicon-big32.jpg
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/favicon-big4.jpg b/toolkit/components/places/tests/favicons/favicon-big4.jpg
deleted file mode 100644
index b84fcd35a..000000000
--- a/toolkit/components/places/tests/favicons/favicon-big4.jpg
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/favicon-big48.ico b/toolkit/components/places/tests/favicons/favicon-big48.ico
deleted file mode 100644
index f22522411..000000000
--- a/toolkit/components/places/tests/favicons/favicon-big48.ico
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/favicon-big64.png b/toolkit/components/places/tests/favicons/favicon-big64.png
deleted file mode 100644
index 2756cf0cb..000000000
--- a/toolkit/components/places/tests/favicons/favicon-big64.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/favicon-normal16.png b/toolkit/components/places/tests/favicons/favicon-normal16.png
deleted file mode 100644
index 62b69a3d0..000000000
--- a/toolkit/components/places/tests/favicons/favicon-normal16.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/favicon-normal32.png b/toolkit/components/places/tests/favicons/favicon-normal32.png
deleted file mode 100644
index 5535363c9..000000000
--- a/toolkit/components/places/tests/favicons/favicon-normal32.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/favicon-scale160x3.jpg b/toolkit/components/places/tests/favicons/favicon-scale160x3.jpg
deleted file mode 100644
index 422ee7ea0..000000000
--- a/toolkit/components/places/tests/favicons/favicon-scale160x3.jpg
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/favicon-scale3x160.jpg b/toolkit/components/places/tests/favicons/favicon-scale3x160.jpg
deleted file mode 100644
index e8514966a..000000000
--- a/toolkit/components/places/tests/favicons/favicon-scale3x160.jpg
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/favicons/head_favicons.js b/toolkit/components/places/tests/favicons/head_favicons.js
deleted file mode 100644
index cc81791e8..000000000
--- a/toolkit/components/places/tests/favicons/head_favicons.js
+++ /dev/null
@@ -1,105 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cr = Components.results;
-var Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-// Import common head.
-{
- let commonFile = do_get_file("../head_common.js", false);
- let uri = Services.io.newFileURI(commonFile);
- Services.scriptloader.loadSubScript(uri.spec, this);
-}
-
-// Put any other stuff relative to this test folder below.
-
-
-// This error icon must stay in sync with FAVICON_ERRORPAGE_URL in
-// nsIFaviconService.idl, aboutCertError.xhtml and netError.xhtml.
-const FAVICON_ERRORPAGE_URI =
- NetUtil.newURI("chrome://global/skin/icons/warning-16.png");
-
-/**
- * Waits for the first OnPageChanged notification for ATTRIBUTE_FAVICON, and
- * verifies that it matches the expected page URI and associated favicon URI.
- *
- * This function also double-checks the GUID parameter of the notification.
- *
- * @param aExpectedPageURI
- * nsIURI object of the page whose favicon should change.
- * @param aExpectedFaviconURI
- * nsIURI object of the newly associated favicon.
- * @param aCallback
- * This function is called after the check finished.
- */
-function waitForFaviconChanged(aExpectedPageURI, aExpectedFaviconURI,
- aCallback) {
- let historyObserver = {
- __proto__: NavHistoryObserver.prototype,
- onPageChanged: function WFFC_onPageChanged(aURI, aWhat, aValue, aGUID) {
- if (aWhat != Ci.nsINavHistoryObserver.ATTRIBUTE_FAVICON) {
- return;
- }
- PlacesUtils.history.removeObserver(this);
-
- do_check_true(aURI.equals(aExpectedPageURI));
- do_check_eq(aValue, aExpectedFaviconURI.spec);
- do_check_guid_for_uri(aURI, aGUID);
- aCallback();
- }
- };
- PlacesUtils.history.addObserver(historyObserver, false);
-}
-
-/**
- * Checks that the favicon for the given page matches the provided data.
- *
- * @param aPageURI
- * nsIURI object for the page to check.
- * @param aExpectedMimeType
- * Expected MIME type of the icon, for example "image/png".
- * @param aExpectedData
- * Expected icon data, expressed as an array of byte values.
- * @param aCallback
- * This function is called after the check finished.
- */
-function checkFaviconDataForPage(aPageURI, aExpectedMimeType, aExpectedData,
- aCallback) {
- PlacesUtils.favicons.getFaviconDataForPage(aPageURI,
- function (aURI, aDataLen, aData, aMimeType) {
- do_check_eq(aExpectedMimeType, aMimeType);
- do_check_true(compareArrays(aExpectedData, aData));
- do_check_guid_for_uri(aPageURI);
- aCallback();
- });
-}
-
-/**
- * Checks that the given page has no associated favicon.
- *
- * @param aPageURI
- * nsIURI object for the page to check.
- * @param aCallback
- * This function is called after the check finished.
- */
-function checkFaviconMissingForPage(aPageURI, aCallback) {
- PlacesUtils.favicons.getFaviconURLForPage(aPageURI,
- function (aURI, aDataLen, aData, aMimeType) {
- do_check_true(aURI === null);
- aCallback();
- });
-}
-
-function promiseFaviconMissingForPage(aPageURI) {
- return new Promise(resolve => checkFaviconMissingForPage(aPageURI, resolve));
-}
-
-function promiseFaviconChanged(aExpectedPageURI, aExpectedFaviconURI) {
- return new Promise(resolve => waitForFaviconChanged(aExpectedPageURI, aExpectedFaviconURI, resolve));
-}
diff --git a/toolkit/components/places/tests/favicons/test_expireAllFavicons.js b/toolkit/components/places/tests/favicons/test_expireAllFavicons.js
deleted file mode 100644
index c5d8edfdd..000000000
--- a/toolkit/components/places/tests/favicons/test_expireAllFavicons.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/**
- * This file tests that favicons are correctly expired by expireAllFavicons.
- */
-
-"use strict";
-
-const TEST_PAGE_URI = NetUtil.newURI("http://example.com/");
-const BOOKMARKED_PAGE_URI = NetUtil.newURI("http://example.com/bookmarked");
-
-add_task(function* test_expireAllFavicons() {
- // Add a visited page.
- yield PlacesTestUtils.addVisits({ uri: TEST_PAGE_URI, transition: TRANSITION_TYPED });
-
- // Set a favicon for our test page.
- yield promiseSetIconForPage(TEST_PAGE_URI, SMALLPNG_DATA_URI);
-
- // Add a page with a bookmark.
- yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- url: BOOKMARKED_PAGE_URI,
- title: "Test bookmark"
- });
-
- // Set a favicon for our bookmark.
- yield promiseSetIconForPage(BOOKMARKED_PAGE_URI, SMALLPNG_DATA_URI);
-
- // Start expiration only after data has been saved in the database.
- let promise = promiseTopicObserved(PlacesUtils.TOPIC_FAVICONS_EXPIRED);
- PlacesUtils.favicons.expireAllFavicons();
- yield promise;
-
- // Check that the favicons for the pages we added were removed.
- yield promiseFaviconMissingForPage(TEST_PAGE_URI);
- yield promiseFaviconMissingForPage(BOOKMARKED_PAGE_URI);
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/favicons/test_favicons_conversions.js b/toolkit/components/places/tests/favicons/test_favicons_conversions.js
deleted file mode 100644
index fa0d332ec..000000000
--- a/toolkit/components/places/tests/favicons/test_favicons_conversions.js
+++ /dev/null
@@ -1,131 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests the image conversions done by the favicon service.
- */
-
-// Globals
-
-// The pixel values we get on Windows are sometimes +/- 1 value compared to
-// other platforms, so we need to skip some image content tests.
-var isWindows = ("@mozilla.org/windows-registry-key;1" in Cc);
-
-/**
- * Checks the conversion of the given test image file.
- *
- * @param aFileName
- * File that contains the favicon image, located in the test folder.
- * @param aFileMimeType
- * MIME type of the image contained in the file.
- * @param aFileLength
- * Expected length of the file.
- * @param aExpectConversion
- * If false, the icon should be stored as is. If true, the expected data
- * is loaded from a file named "expected-" + aFileName + ".png".
- * @param aVaryOnWindows
- * Indicates that the content of the converted image can be different on
- * Windows and should not be checked on that platform.
- * @param aCallback
- * This function is called after the check finished.
- */
-function checkFaviconDataConversion(aFileName, aFileMimeType, aFileLength,
- aExpectConversion, aVaryOnWindows,
- aCallback) {
- let pageURI = NetUtil.newURI("http://places.test/page/" + aFileName);
- PlacesTestUtils.addVisits({ uri: pageURI, transition: TRANSITION_TYPED }).then(
- function () {
- let faviconURI = NetUtil.newURI("http://places.test/icon/" + aFileName);
- let fileData = readFileOfLength(aFileName, aFileLength);
-
- PlacesUtils.favicons.replaceFaviconData(faviconURI, fileData, fileData.length,
- aFileMimeType);
- PlacesUtils.favicons.setAndFetchFaviconForPage(pageURI, faviconURI, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function CFDC_verify(aURI, aDataLen, aData, aMimeType) {
- if (!aExpectConversion) {
- do_check_true(compareArrays(aData, fileData));
- do_check_eq(aMimeType, aFileMimeType);
- } else {
- if (!aVaryOnWindows || !isWindows) {
- let expectedFile = do_get_file("expected-" + aFileName + ".png");
- do_check_true(compareArrays(aData, readFileData(expectedFile)));
- }
- do_check_eq(aMimeType, "image/png");
- }
-
- aCallback();
- }, Services.scriptSecurityManager.getSystemPrincipal());
- });
-}
-
-// Tests
-
-function run_test() {
- run_next_test();
-}
-
-add_test(function test_storing_a_normal_16x16_icon() {
- // 16x16 png, 286 bytes.
- // optimized: no
- checkFaviconDataConversion("favicon-normal16.png", "image/png", 286,
- false, false, run_next_test);
-});
-
-add_test(function test_storing_a_normal_32x32_icon() {
- // 32x32 png, 344 bytes.
- // optimized: no
- checkFaviconDataConversion("favicon-normal32.png", "image/png", 344,
- false, false, run_next_test);
-});
-
-add_test(function test_storing_a_big_16x16_icon() {
- // in: 16x16 ico, 1406 bytes.
- // optimized: no
- checkFaviconDataConversion("favicon-big16.ico", "image/x-icon", 1406,
- false, false, run_next_test);
-});
-
-add_test(function test_storing_an_oversize_4x4_icon() {
- // in: 4x4 jpg, 4751 bytes.
- // optimized: yes
- checkFaviconDataConversion("favicon-big4.jpg", "image/jpeg", 4751,
- true, false, run_next_test);
-});
-
-add_test(function test_storing_an_oversize_32x32_icon() {
- // in: 32x32 jpg, 3494 bytes.
- // optimized: yes
- checkFaviconDataConversion("favicon-big32.jpg", "image/jpeg", 3494,
- true, true, run_next_test);
-});
-
-add_test(function test_storing_an_oversize_48x48_icon() {
- // in: 48x48 ico, 56646 bytes.
- // (howstuffworks.com icon, contains 13 icons with sizes from 16x16 to
- // 48x48 in varying depths)
- // optimized: yes
- checkFaviconDataConversion("favicon-big48.ico", "image/x-icon", 56646,
- true, false, run_next_test);
-});
-
-add_test(function test_storing_an_oversize_64x64_icon() {
- // in: 64x64 png, 10698 bytes.
- // optimized: yes
- checkFaviconDataConversion("favicon-big64.png", "image/png", 10698,
- true, false, run_next_test);
-});
-
-add_test(function test_scaling_an_oversize_160x3_icon() {
- // in: 160x3 jpg, 5095 bytes.
- // optimized: yes
- checkFaviconDataConversion("favicon-scale160x3.jpg", "image/jpeg", 5095,
- true, false, run_next_test);
-});
-
-add_test(function test_scaling_an_oversize_3x160_icon() {
- // in: 3x160 jpg, 5059 bytes.
- // optimized: yes
- checkFaviconDataConversion("favicon-scale3x160.jpg", "image/jpeg", 5059,
- true, false, run_next_test);
-});
diff --git a/toolkit/components/places/tests/favicons/test_getFaviconDataForPage.js b/toolkit/components/places/tests/favicons/test_getFaviconDataForPage.js
deleted file mode 100644
index 73eea7436..000000000
--- a/toolkit/components/places/tests/favicons/test_getFaviconDataForPage.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests getFaviconDataForPage.
- */
-
-// Globals
-
-const FAVICON_URI = NetUtil.newURI(do_get_file("favicon-normal32.png"));
-const FAVICON_DATA = readFileData(do_get_file("favicon-normal32.png"));
-const FAVICON_MIMETYPE = "image/png";
-
-// Tests
-
-function run_test()
-{
- // Check that the favicon loaded correctly before starting the actual tests.
- do_check_eq(FAVICON_DATA.length, 344);
- run_next_test();
-}
-
-add_test(function test_normal()
-{
- let pageURI = NetUtil.newURI("http://example.com/normal");
-
- PlacesTestUtils.addVisits(pageURI).then(function () {
- PlacesUtils.favicons.setAndFetchFaviconForPage(
- pageURI, FAVICON_URI, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function () {
- PlacesUtils.favicons.getFaviconDataForPage(pageURI,
- function (aURI, aDataLen, aData, aMimeType) {
- do_check_true(aURI.equals(FAVICON_URI));
- do_check_eq(FAVICON_DATA.length, aDataLen);
- do_check_true(compareArrays(FAVICON_DATA, aData));
- do_check_eq(FAVICON_MIMETYPE, aMimeType);
- run_next_test();
- });
- }, Services.scriptSecurityManager.getSystemPrincipal());
- });
-});
-
-add_test(function test_missing()
-{
- let pageURI = NetUtil.newURI("http://example.com/missing");
-
- PlacesUtils.favicons.getFaviconDataForPage(pageURI,
- function (aURI, aDataLen, aData, aMimeType) {
- // Check also the expected data types.
- do_check_true(aURI === null);
- do_check_true(aDataLen === 0);
- do_check_true(aData.length === 0);
- do_check_true(aMimeType === "");
- run_next_test();
- });
-});
diff --git a/toolkit/components/places/tests/favicons/test_getFaviconURLForPage.js b/toolkit/components/places/tests/favicons/test_getFaviconURLForPage.js
deleted file mode 100644
index fb2e23ff9..000000000
--- a/toolkit/components/places/tests/favicons/test_getFaviconURLForPage.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests getFaviconURLForPage.
- */
-
-// Tests
-
-function run_test()
-{
- run_next_test();
-}
-
-add_test(function test_normal()
-{
- let pageURI = NetUtil.newURI("http://example.com/normal");
-
- PlacesTestUtils.addVisits(pageURI).then(function () {
- PlacesUtils.favicons.setAndFetchFaviconForPage(
- pageURI, SMALLPNG_DATA_URI, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function () {
- PlacesUtils.favicons.getFaviconURLForPage(pageURI,
- function (aURI, aDataLen, aData, aMimeType) {
- do_check_true(aURI.equals(SMALLPNG_DATA_URI));
-
- // Check also the expected data types.
- do_check_true(aDataLen === 0);
- do_check_true(aData.length === 0);
- do_check_true(aMimeType === "");
- run_next_test();
- });
- }, Services.scriptSecurityManager.getSystemPrincipal());
- });
-});
-
-add_test(function test_missing()
-{
- let pageURI = NetUtil.newURI("http://example.com/missing");
-
- PlacesUtils.favicons.getFaviconURLForPage(pageURI,
- function (aURI, aDataLen, aData, aMimeType) {
- // Check also the expected data types.
- do_check_true(aURI === null);
- do_check_true(aDataLen === 0);
- do_check_true(aData.length === 0);
- do_check_true(aMimeType === "");
- run_next_test();
- });
-});
diff --git a/toolkit/components/places/tests/favicons/test_moz-anno_favicon_mime_type.js b/toolkit/components/places/tests/favicons/test_moz-anno_favicon_mime_type.js
deleted file mode 100644
index d055d8d61..000000000
--- a/toolkit/components/places/tests/favicons/test_moz-anno_favicon_mime_type.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * This test ensures that the mime type is set for moz-anno channels of favicons
- * properly. Added with work in bug 481227.
- */
-
-// Constants
-Cu.import("resource://gre/modules/NetUtil.jsm");
-
-const testFaviconData = "data:image/png,%89PNG%0D%0A%1A%0A%00%00%00%0DIHDR%00%00%00%10%00%00%00%10%08%06%00%00%00%1F%F3%FFa%00%00%00%04gAMA%00%00%AF%C87%05%8A%E9%00%00%00%19tEXtSoftware%00Adobe%20ImageReadyq%C9e%3C%00%00%01%D6IDATx%DAb%FC%FF%FF%3F%03%25%00%20%80%98%909%EF%DF%BFg%EF%EC%EC%FC%AD%AC%AC%FC%DF%95%91%F1%BF%89%89%C9%7F%20%FF%D7%EA%D5%AB%B7%DF%BBwO%16%9B%01%00%01%C4%00r%01%08%9F9s%C6%CD%D8%D8%F8%BF%0B%03%C3%FF3%40%BC%0A%88%EF%02q%1A%10%BB%40%F1%AAU%ABv%C1%D4%C30%40%00%81%89%993g%3E%06%1A%F6%3F%14%AA%11D%97%03%F1%7Fc%08%0D%E2%2B))%FD%17%04%89%A1%19%00%10%40%0C%D00%F8%0F3%00%C8%F8%BF%1B%E4%0Ac%88a%E5%60%17%19%FF%0F%0D%0D%05%1B%02v%D9%DD%BB%0A0%03%00%02%08%AC%B9%A3%A3%E3%17%03%D4v%90%01%EF%18%106%C3%0Cz%07%C5%BB%A1%DE%82y%07%20%80%A0%A6%08B%FCn%0C1%60%26%D4%20d%C3VA%C3%06%26%BE%0A%EA-%80%00%82%B9%E0%F7L4%0D%EF%90%F8%C6%60%2F%0A%82%BD%01%13%07%0700%D0%01%02%88%11%E4%02P%B41%DC%BB%C7%D0%014%0D%E8l%06W%20%06%BA%88%A1%1C%1AS%15%40%7C%16%CA6.%2Fgx%BFg%0F%83%CB%D9%B3%0C%7B%80%7C%80%00%02%BB%00%E8%9F%ED%20%1B%3A%A0%A6%9F%81%DA%DC%01%C5%B0%80%ED%80%FA%BF%BC%BC%FC%3F%83%12%90%9D%96%F6%1F%20%80%18%DE%BD%7B%C7%0E%8E%05AD%20%FEGr%A6%A0%A0%E0%7F%25P%80%02%9D%0F%D28%13%18%23%C6%C0%B0%02E%3D%C8%F5%00%01%04%8F%05P%A8%BA%40my%87%E4%12c%A8%8D%20%8B%D0%D3%00%08%03%04%10%9C%01R%E4%82d%3B%C8%A0%99%C6%90%90%C6%A5%19%84%01%02%08%9E%17%80%C9x%F7%7B%A0%DBVC%F9%A0%C0%5C%7D%16%2C%CE%00%F4%C6O%5C%99%09%20%800L%04y%A5%03%1A%95%A0%80%05%05%14.%DBA%18%20%80%18)%CD%CE%00%01%06%00%0C'%94%C7%C0k%C9%2C%00%00%00%00IEND%AEB%60%82";
-const moz_anno_favicon_prefix = "moz-anno:favicon:";
-
-// streamListener
-
-function streamListener(aExpectedContentType)
-{
- this._expectedContentType = aExpectedContentType;
-}
-streamListener.prototype =
-{
- onStartRequest: function(aRequest, aContext)
- {
- // We have other tests that make sure the data is what we expect. We just
- // need to check the content type here.
- let channel = aRequest.QueryInterface(Ci.nsIChannel);
- dump("*** Checking " + channel.URI.spec + "\n");
- do_check_eq(channel.contentType, this._expectedContentType);
-
- // If we somehow throw before doing the above check, the test will pass, so
- // we do this for extra sanity.
- this._checked = true;
- },
- onStopRequest: function()
- {
- do_check_true(this._checked);
- do_test_finished();
- },
- onDataAvailable: function(aRequest, aContext, aInputStream, aOffset, aCount)
- {
- aRequest.cancel(Cr.NS_ERROR_ABORT);
- }
-};
-
-// Test Runner
-
-function run_test()
-{
- let fs = Cc["@mozilla.org/browser/favicon-service;1"].
- getService(Ci.nsIFaviconService);
-
- // Test that the default icon has the content type of image/png.
- let channel = NetUtil.newChannel({
- uri: fs.defaultFavicon,
- loadUsingSystemPrincipal: true,
- contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON
- });
- channel.asyncOpen2(new streamListener("image/png"));
- do_test_pending();
-
- // Test URI that we don't know anything about. Will end up being the default
- // icon, so expect image/png.
- channel = NetUtil.newChannel({
- uri: moz_anno_favicon_prefix + "http://mozilla.org",
- loadUsingSystemPrincipal: true,
- contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON
- });
- channel.asyncOpen2(new streamListener("image/png"));
- do_test_pending();
-
- // Test that the content type of a favicon we add ends up being image/png.
- let testURI = uri("http://mozilla.org/");
- // Add the data before opening
- fs.replaceFaviconDataFromDataURL(testURI, testFaviconData,
- (Date.now() + 60 * 60 * 24 * 1000) * 1000,
- Services.scriptSecurityManager.getSystemPrincipal());
-
- // Open the channel
- channel = NetUtil.newChannel({
- uri: moz_anno_favicon_prefix + testURI.spec,
- loadUsingSystemPrincipal: true,
- contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON
- });
- channel.asyncOpen2(new streamListener("image/png"));
- do_test_pending();
-}
diff --git a/toolkit/components/places/tests/favicons/test_page-icon_protocol.js b/toolkit/components/places/tests/favicons/test_page-icon_protocol.js
deleted file mode 100644
index 5533d5135..000000000
--- a/toolkit/components/places/tests/favicons/test_page-icon_protocol.js
+++ /dev/null
@@ -1,66 +0,0 @@
-const ICON_DATA = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAAAAAA6fptVAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==";
-const TEST_URI = NetUtil.newURI("http://mozilla.org/");
-const ICON_URI = NetUtil.newURI("http://mozilla.org/favicon.ico");
-
-function fetchIconForSpec(spec) {
- return new Promise((resolve, reject) => {
- NetUtil.asyncFetch({
- uri: NetUtil.newURI("page-icon:" + TEST_URI.spec),
- loadUsingSystemPrincipal: true,
- contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_IMAGE_FAVICON
- }, (input, status, request) => {
- if (!Components.isSuccessCode(status)) {
- reject(new Error("unable to load icon"));
- return;
- }
-
- try {
- let data = NetUtil.readInputStreamToString(input, input.available());
- let contentType = request.QueryInterface(Ci.nsIChannel).contentType;
- input.close();
- resolve({ data, contentType });
- } catch (ex) {
- reject(ex);
- }
- });
- });
-}
-
-var gDefaultFavicon;
-var gFavicon;
-
-add_task(function* setup() {
- yield PlacesTestUtils.addVisits({ uri: TEST_URI });
-
- PlacesUtils.favicons.replaceFaviconDataFromDataURL(
- ICON_URI, ICON_DATA, (Date.now() + 8640000) * 1000,
- Services.scriptSecurityManager.getSystemPrincipal());
-
- yield new Promise(resolve => {
- PlacesUtils.favicons.setAndFetchFaviconForPage(
- TEST_URI, ICON_URI, false,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- resolve, Services.scriptSecurityManager.getSystemPrincipal());
- });
-
- gDefaultFavicon = yield fetchIconForSpec(PlacesUtils.favicons.defaultFavicon);
- gFavicon = yield fetchIconForSpec(ICON_DATA);
-});
-
-add_task(function* known_url() {
- let {data, contentType} = yield fetchIconForSpec(TEST_URI.spec);
- Assert.equal(contentType, gFavicon.contentType);
- Assert.ok(data == gFavicon.data, "Got the favicon data");
-});
-
-add_task(function* unknown_url() {
- let {data, contentType} = yield fetchIconForSpec("http://www.moz.org/");
- Assert.equal(contentType, gDefaultFavicon.contentType);
- Assert.ok(data == gDefaultFavicon.data, "Got the default favicon data");
-});
-
-add_task(function* invalid_url() {
- let {data, contentType} = yield fetchIconForSpec("test");
- Assert.equal(contentType, gDefaultFavicon.contentType);
- Assert.ok(data == gDefaultFavicon.data, "Got the default favicon data");
-});
diff --git a/toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js b/toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js
deleted file mode 100644
index df61c22cd..000000000
--- a/toolkit/components/places/tests/favicons/test_query_result_favicon_changed_on_child.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/**
- * Test for bug 451499 <https://bugzilla.mozilla.org/show_bug.cgi?id=451499>:
- * Wrong folder icon appears on smart bookmarks.
- */
-
-"use strict";
-
-const PAGE_URI = NetUtil.newURI("http://example.com/test_query_result");
-
-add_task(function* test_query_result_favicon_changed_on_child() {
- // Bookmark our test page, so it will appear in the query resultset.
- yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- title: "test_bookmark",
- url: PAGE_URI
- });
-
- // Get the last 10 bookmarks added to the menu or the toolbar.
- let query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarksMenuFolderId,
- PlacesUtils.toolbarFolderId], 2);
-
- let options = PlacesUtils.history.getNewQueryOptions();
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
- options.maxResults = 10;
- options.excludeQueries = 1;
- options.sortingMode = options.SORT_BY_DATE_DESCENDING;
-
- let result = PlacesUtils.history.executeQuery(query, options);
- let resultObserver = {
- __proto__: NavHistoryResultObserver.prototype,
- containerStateChanged(aContainerNode, aOldState, aNewState) {
- if (aNewState == Ci.nsINavHistoryContainerResultNode.STATE_OPENED) {
- // We set a favicon on PAGE_URI while the container is open. The
- // favicon for the page must have data associated with it in order for
- // the icon changed notifications to be sent, so we use a valid image
- // data URI.
- PlacesUtils.favicons.setAndFetchFaviconForPage(PAGE_URI,
- SMALLPNG_DATA_URI,
- false,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- null,
- Services.scriptSecurityManager.getSystemPrincipal());
- }
- },
- nodeIconChanged(aNode) {
- do_throw("The icon should be set only for the page," +
- " not for the containing query.");
- }
- };
- result.addObserver(resultObserver, false);
-
- // Open the container and wait for containerStateChanged. We should start
- // observing before setting |containerOpen| as that's caused by the
- // setAndFetchFaviconForPage() call caused by the containerStateChanged
- // observer above.
- let promise = promiseFaviconChanged(PAGE_URI, SMALLPNG_DATA_URI);
- result.root.containerOpen = true;
- yield promise;
-
- // We must wait for the asynchronous database thread to finish the
- // operation, and then for the main thread to process any pending
- // notifications that came from the asynchronous thread, before we can be
- // sure that nodeIconChanged was not invoked in the meantime.
- yield PlacesTestUtils.promiseAsyncUpdates();
- result.removeObserver(resultObserver);
-
- // Free the resources immediately.
- result.root.containerOpen = false;
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/favicons/test_replaceFaviconData.js b/toolkit/components/places/tests/favicons/test_replaceFaviconData.js
deleted file mode 100644
index ac53e70e9..000000000
--- a/toolkit/components/places/tests/favicons/test_replaceFaviconData.js
+++ /dev/null
@@ -1,264 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Tests for mozIAsyncFavicons::replaceFaviconData()
- */
-
-var iconsvc = PlacesUtils.favicons;
-var histsvc = PlacesUtils.history;
-var systemPrincipal = Services.scriptSecurityManager.getSystemPrincipal();
-
-var originalFavicon = {
- file: do_get_file("favicon-normal16.png"),
- uri: uri(do_get_file("favicon-normal16.png")),
- data: readFileData(do_get_file("favicon-normal16.png")),
- mimetype: "image/png"
-};
-
-var uniqueFaviconId = 0;
-function createFavicon(fileName) {
- let tempdir = Services.dirsvc.get("TmpD", Ci.nsILocalFile);
-
- // remove any existing file at the path we're about to copy to
- let outfile = tempdir.clone();
- outfile.append(fileName);
- try { outfile.remove(false); } catch (e) {}
-
- originalFavicon.file.copyToFollowingLinks(tempdir, fileName);
-
- let stream = Cc["@mozilla.org/network/file-output-stream;1"]
- .createInstance(Ci.nsIFileOutputStream);
- stream.init(outfile, 0x02 | 0x08 | 0x10, 0o600, 0);
-
- // append some data that sniffers/encoders will ignore that will distinguish
- // the different favicons we'll create
- uniqueFaviconId++;
- let uniqueStr = "uid:" + uniqueFaviconId;
- stream.write(uniqueStr, uniqueStr.length);
- stream.close();
-
- do_check_eq(outfile.leafName.substr(0, fileName.length), fileName);
-
- return {
- file: outfile,
- uri: uri(outfile),
- data: readFileData(outfile),
- mimetype: "image/png"
- };
-}
-
-function checkCallbackSucceeded(callbackMimetype, callbackData, sourceMimetype, sourceData) {
- do_check_eq(callbackMimetype, sourceMimetype);
- do_check_true(compareArrays(callbackData, sourceData));
-}
-
-function run_test() {
- // check that the favicon loaded correctly
- do_check_eq(originalFavicon.data.length, 286);
- run_next_test();
-}
-
-add_task(function* test_replaceFaviconData_validHistoryURI() {
- do_print("test replaceFaviconData for valid history uri");
-
- let pageURI = uri("http://test1.bar/");
- yield PlacesTestUtils.addVisits(pageURI);
-
- let favicon = createFavicon("favicon1.png");
-
- iconsvc.replaceFaviconData(favicon.uri, favicon.data, favicon.data.length,
- favicon.mimetype);
-
- let deferSetAndFetchFavicon = Promise.defer();
- iconsvc.setAndFetchFaviconForPage(pageURI, favicon.uri, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function test_replaceFaviconData_validHistoryURI_check(aURI, aDataLen, aData, aMimeType) {
- checkCallbackSucceeded(aMimeType, aData, favicon.mimetype, favicon.data);
- checkFaviconDataForPage(
- pageURI, favicon.mimetype, favicon.data,
- function test_replaceFaviconData_validHistoryURI_callback() {
- favicon.file.remove(false);
- deferSetAndFetchFavicon.resolve();
- });
- }, systemPrincipal);
- yield deferSetAndFetchFavicon.promise;
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_replaceFaviconData_overrideDefaultFavicon() {
- do_print("test replaceFaviconData to override a later setAndFetchFaviconForPage");
-
- let pageURI = uri("http://test2.bar/");
- yield PlacesTestUtils.addVisits(pageURI);
-
- let firstFavicon = createFavicon("favicon2.png");
- let secondFavicon = createFavicon("favicon3.png");
-
- iconsvc.replaceFaviconData(
- firstFavicon.uri, secondFavicon.data, secondFavicon.data.length,
- secondFavicon.mimetype);
-
- let deferSetAndFetchFavicon = Promise.defer();
- iconsvc.setAndFetchFaviconForPage(
- pageURI, firstFavicon.uri, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function test_replaceFaviconData_overrideDefaultFavicon_check(aURI, aDataLen, aData, aMimeType) {
- checkCallbackSucceeded(aMimeType, aData, secondFavicon.mimetype, secondFavicon.data);
- checkFaviconDataForPage(
- pageURI, secondFavicon.mimetype, secondFavicon.data,
- function test_replaceFaviconData_overrideDefaultFavicon_callback() {
- firstFavicon.file.remove(false);
- secondFavicon.file.remove(false);
- deferSetAndFetchFavicon.resolve();
- });
- }, systemPrincipal);
- yield deferSetAndFetchFavicon.promise;
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_replaceFaviconData_replaceExisting() {
- do_print("test replaceFaviconData to override a previous setAndFetchFaviconForPage");
-
- let pageURI = uri("http://test3.bar");
- yield PlacesTestUtils.addVisits(pageURI);
-
- let firstFavicon = createFavicon("favicon4.png");
- let secondFavicon = createFavicon("favicon5.png");
-
- let deferSetAndFetchFavicon = Promise.defer();
- iconsvc.setAndFetchFaviconForPage(
- pageURI, firstFavicon.uri, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function test_replaceFaviconData_replaceExisting_firstSet_check(aURI, aDataLen, aData, aMimeType) {
- checkCallbackSucceeded(aMimeType, aData, firstFavicon.mimetype, firstFavicon.data);
- checkFaviconDataForPage(
- pageURI, firstFavicon.mimetype, firstFavicon.data,
- function test_replaceFaviconData_overrideDefaultFavicon_firstCallback() {
- iconsvc.replaceFaviconData(
- firstFavicon.uri, secondFavicon.data, secondFavicon.data.length,
- secondFavicon.mimetype);
- PlacesTestUtils.promiseAsyncUpdates().then(() => {
- checkFaviconDataForPage(
- pageURI, secondFavicon.mimetype, secondFavicon.data,
- function test_replaceFaviconData_overrideDefaultFavicon_secondCallback() {
- firstFavicon.file.remove(false);
- secondFavicon.file.remove(false);
- deferSetAndFetchFavicon.resolve();
- }, systemPrincipal);
- });
- });
- }, systemPrincipal);
- yield deferSetAndFetchFavicon.promise;
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_replaceFaviconData_unrelatedReplace() {
- do_print("test replaceFaviconData to not make unrelated changes");
-
- let pageURI = uri("http://test4.bar/");
- yield PlacesTestUtils.addVisits(pageURI);
-
- let favicon = createFavicon("favicon6.png");
- let unrelatedFavicon = createFavicon("favicon7.png");
-
- iconsvc.replaceFaviconData(
- unrelatedFavicon.uri, unrelatedFavicon.data, unrelatedFavicon.data.length,
- unrelatedFavicon.mimetype);
-
- let deferSetAndFetchFavicon = Promise.defer();
- iconsvc.setAndFetchFaviconForPage(
- pageURI, favicon.uri, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function test_replaceFaviconData_unrelatedReplace_check(aURI, aDataLen, aData, aMimeType) {
- checkCallbackSucceeded(aMimeType, aData, favicon.mimetype, favicon.data);
- checkFaviconDataForPage(
- pageURI, favicon.mimetype, favicon.data,
- function test_replaceFaviconData_unrelatedReplace_callback() {
- favicon.file.remove(false);
- unrelatedFavicon.file.remove(false);
- deferSetAndFetchFavicon.resolve();
- });
- }, systemPrincipal);
- yield deferSetAndFetchFavicon.promise;
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_replaceFaviconData_badInputs() {
- do_print("test replaceFaviconData to throw on bad inputs");
-
- let favicon = createFavicon("favicon8.png");
-
- let ex = null;
- try {
- iconsvc.replaceFaviconData(
- favicon.uri, favicon.data, favicon.data.length, "");
- } catch (e) {
- ex = e;
- } finally {
- do_check_true(!!ex);
- }
-
- ex = null;
- try {
- iconsvc.replaceFaviconData(
- null, favicon.data, favicon.data.length, favicon.mimeType);
- } catch (e) {
- ex = e;
- } finally {
- do_check_true(!!ex);
- }
-
- ex = null;
- try {
- iconsvc.replaceFaviconData(
- favicon.uri, null, 0, favicon.mimeType);
- } catch (e) {
- ex = e;
- } finally {
- do_check_true(!!ex);
- }
-
- favicon.file.remove(false);
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_replaceFaviconData_twiceReplace() {
- do_print("test replaceFaviconData on multiple replacements");
-
- let pageURI = uri("http://test5.bar/");
- yield PlacesTestUtils.addVisits(pageURI);
-
- let firstFavicon = createFavicon("favicon9.png");
- let secondFavicon = createFavicon("favicon10.png");
-
- iconsvc.replaceFaviconData(
- firstFavicon.uri, firstFavicon.data, firstFavicon.data.length,
- firstFavicon.mimetype);
- iconsvc.replaceFaviconData(
- firstFavicon.uri, secondFavicon.data, secondFavicon.data.length,
- secondFavicon.mimetype);
-
- let deferSetAndFetchFavicon = Promise.defer();
- iconsvc.setAndFetchFaviconForPage(
- pageURI, firstFavicon.uri, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function test_replaceFaviconData_twiceReplace_check(aURI, aDataLen, aData, aMimeType) {
- checkCallbackSucceeded(aMimeType, aData, secondFavicon.mimetype, secondFavicon.data);
- checkFaviconDataForPage(
- pageURI, secondFavicon.mimetype, secondFavicon.data,
- function test_replaceFaviconData_twiceReplace_callback() {
- firstFavicon.file.remove(false);
- secondFavicon.file.remove(false);
- deferSetAndFetchFavicon.resolve();
- }, systemPrincipal);
- }, systemPrincipal);
- yield deferSetAndFetchFavicon.promise;
-
- yield PlacesTestUtils.clearHistory();
-});
diff --git a/toolkit/components/places/tests/favicons/test_replaceFaviconDataFromDataURL.js b/toolkit/components/places/tests/favicons/test_replaceFaviconDataFromDataURL.js
deleted file mode 100644
index 69a5ba852..000000000
--- a/toolkit/components/places/tests/favicons/test_replaceFaviconDataFromDataURL.js
+++ /dev/null
@@ -1,352 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Tests for mozIAsyncFavicons::replaceFaviconData()
- */
-
-var iconsvc = PlacesUtils.favicons;
-var histsvc = PlacesUtils.history;
-
-var originalFavicon = {
- file: do_get_file("favicon-normal16.png"),
- uri: uri(do_get_file("favicon-normal16.png")),
- data: readFileData(do_get_file("favicon-normal16.png")),
- mimetype: "image/png"
-};
-
-var uniqueFaviconId = 0;
-function createFavicon(fileName) {
- let tempdir = Services.dirsvc.get("TmpD", Ci.nsILocalFile);
-
- // remove any existing file at the path we're about to copy to
- let outfile = tempdir.clone();
- outfile.append(fileName);
- try { outfile.remove(false); } catch (e) {}
-
- originalFavicon.file.copyToFollowingLinks(tempdir, fileName);
-
- let stream = Cc["@mozilla.org/network/file-output-stream;1"]
- .createInstance(Ci.nsIFileOutputStream);
- stream.init(outfile, 0x02 | 0x08 | 0x10, 0o600, 0);
-
- // append some data that sniffers/encoders will ignore that will distinguish
- // the different favicons we'll create
- uniqueFaviconId++;
- let uniqueStr = "uid:" + uniqueFaviconId;
- stream.write(uniqueStr, uniqueStr.length);
- stream.close();
-
- do_check_eq(outfile.leafName.substr(0, fileName.length), fileName);
-
- return {
- file: outfile,
- uri: uri(outfile),
- data: readFileData(outfile),
- mimetype: "image/png"
- };
-}
-
-function createDataURLForFavicon(favicon) {
- return "data:" + favicon.mimetype + ";base64," + toBase64(favicon.data);
-}
-
-function checkCallbackSucceeded(callbackMimetype, callbackData, sourceMimetype, sourceData) {
- do_check_eq(callbackMimetype, sourceMimetype);
- do_check_true(compareArrays(callbackData, sourceData));
-}
-
-function run_test() {
- // check that the favicon loaded correctly
- do_check_eq(originalFavicon.data.length, 286);
- run_next_test();
-}
-
-add_task(function* test_replaceFaviconDataFromDataURL_validHistoryURI() {
- do_print("test replaceFaviconDataFromDataURL for valid history uri");
-
- let pageURI = uri("http://test1.bar/");
- yield PlacesTestUtils.addVisits(pageURI);
-
- let favicon = createFavicon("favicon1.png");
- iconsvc.replaceFaviconDataFromDataURL(favicon.uri, createDataURLForFavicon(favicon), 0,
- Services.scriptSecurityManager.getSystemPrincipal());
-
- let deferSetAndFetchFavicon = Promise.defer();
- iconsvc.setAndFetchFaviconForPage(pageURI, favicon.uri, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function test_replaceFaviconDataFromDataURL_validHistoryURI_check(aURI, aDataLen, aData, aMimeType) {
- checkCallbackSucceeded(aMimeType, aData, favicon.mimetype, favicon.data);
- checkFaviconDataForPage(
- pageURI, favicon.mimetype, favicon.data,
- function test_replaceFaviconDataFromDataURL_validHistoryURI_callback() {
- favicon.file.remove(false);
- deferSetAndFetchFavicon.resolve();
- });
- }, Services.scriptSecurityManager.getSystemPrincipal());
- yield deferSetAndFetchFavicon.promise;
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_replaceFaviconDataFromDataURL_overrideDefaultFavicon() {
- do_print("test replaceFaviconDataFromDataURL to override a later setAndFetchFaviconForPage");
-
- let pageURI = uri("http://test2.bar/");
- yield PlacesTestUtils.addVisits(pageURI);
-
- let firstFavicon = createFavicon("favicon2.png");
- let secondFavicon = createFavicon("favicon3.png");
-
- iconsvc.replaceFaviconDataFromDataURL(firstFavicon.uri, createDataURLForFavicon(secondFavicon), 0,
- Services.scriptSecurityManager.getSystemPrincipal());
-
- let deferSetAndFetchFavicon = Promise.defer();
- iconsvc.setAndFetchFaviconForPage(
- pageURI, firstFavicon.uri, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function test_replaceFaviconDataFromDataURL_overrideDefaultFavicon_check(aURI, aDataLen, aData, aMimeType) {
- checkCallbackSucceeded(aMimeType, aData, secondFavicon.mimetype, secondFavicon.data);
- checkFaviconDataForPage(
- pageURI, secondFavicon.mimetype, secondFavicon.data,
- function test_replaceFaviconDataFromDataURL_overrideDefaultFavicon_callback() {
- firstFavicon.file.remove(false);
- secondFavicon.file.remove(false);
- deferSetAndFetchFavicon.resolve();
- });
- }, Services.scriptSecurityManager.getSystemPrincipal());
- yield deferSetAndFetchFavicon.promise;
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_replaceFaviconDataFromDataURL_replaceExisting() {
- do_print("test replaceFaviconDataFromDataURL to override a previous setAndFetchFaviconForPage");
-
- let pageURI = uri("http://test3.bar");
- yield PlacesTestUtils.addVisits(pageURI);
-
- let firstFavicon = createFavicon("favicon4.png");
- let secondFavicon = createFavicon("favicon5.png");
-
- let deferSetAndFetchFavicon = Promise.defer();
- iconsvc.setAndFetchFaviconForPage(
- pageURI, firstFavicon.uri, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function test_replaceFaviconDataFromDataURL_replaceExisting_firstSet_check(aURI, aDataLen, aData, aMimeType) {
- checkCallbackSucceeded(aMimeType, aData, firstFavicon.mimetype, firstFavicon.data);
- checkFaviconDataForPage(
- pageURI, firstFavicon.mimetype, firstFavicon.data,
- function test_replaceFaviconDataFromDataURL_replaceExisting_firstCallback() {
- iconsvc.replaceFaviconDataFromDataURL(firstFavicon.uri, createDataURLForFavicon(secondFavicon), 0,
- Services.scriptSecurityManager.getSystemPrincipal());
- checkFaviconDataForPage(
- pageURI, secondFavicon.mimetype, secondFavicon.data,
- function test_replaceFaviconDataFromDataURL_replaceExisting_secondCallback() {
- firstFavicon.file.remove(false);
- secondFavicon.file.remove(false);
- deferSetAndFetchFavicon.resolve();
- });
- });
- }, Services.scriptSecurityManager.getSystemPrincipal());
- yield deferSetAndFetchFavicon.promise;
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_replaceFaviconDataFromDataURL_unrelatedReplace() {
- do_print("test replaceFaviconDataFromDataURL to not make unrelated changes");
-
- let pageURI = uri("http://test4.bar/");
- yield PlacesTestUtils.addVisits(pageURI);
-
- let favicon = createFavicon("favicon6.png");
- let unrelatedFavicon = createFavicon("favicon7.png");
-
- iconsvc.replaceFaviconDataFromDataURL(unrelatedFavicon.uri, createDataURLForFavicon(unrelatedFavicon), 0,
- Services.scriptSecurityManager.getSystemPrincipal());
-
- let deferSetAndFetchFavicon = Promise.defer();
- iconsvc.setAndFetchFaviconForPage(
- pageURI, favicon.uri, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function test_replaceFaviconDataFromDataURL_unrelatedReplace_check(aURI, aDataLen, aData, aMimeType) {
- checkCallbackSucceeded(aMimeType, aData, favicon.mimetype, favicon.data);
- checkFaviconDataForPage(
- pageURI, favicon.mimetype, favicon.data,
- function test_replaceFaviconDataFromDataURL_unrelatedReplace_callback() {
- favicon.file.remove(false);
- unrelatedFavicon.file.remove(false);
- deferSetAndFetchFavicon.resolve();
- });
- }, Services.scriptSecurityManager.getSystemPrincipal());
- yield deferSetAndFetchFavicon.promise;
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_replaceFaviconDataFromDataURL_badInputs() {
- do_print("test replaceFaviconDataFromDataURL to throw on bad inputs");
-
- let favicon = createFavicon("favicon8.png");
-
- let ex = null;
- try {
- iconsvc.replaceFaviconDataFromDataURL(favicon.uri, "", 0,
- Services.scriptSecurityManager.getSystemPrincipal());
- } catch (e) {
- ex = e;
- } finally {
- do_check_true(!!ex);
- }
-
- ex = null;
- try {
- iconsvc.replaceFaviconDataFromDataURL(null, createDataURLForFavicon(favicon), 0,
- Services.scriptSecurityManager.getSystemPrincipal());
- } catch (e) {
- ex = e;
- } finally {
- do_check_true(!!ex);
- }
-
- favicon.file.remove(false);
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_replaceFaviconDataFromDataURL_twiceReplace() {
- do_print("test replaceFaviconDataFromDataURL on multiple replacements");
-
- let pageURI = uri("http://test5.bar/");
- yield PlacesTestUtils.addVisits(pageURI);
-
- let firstFavicon = createFavicon("favicon9.png");
- let secondFavicon = createFavicon("favicon10.png");
-
- iconsvc.replaceFaviconDataFromDataURL(firstFavicon.uri, createDataURLForFavicon(firstFavicon), 0,
- Services.scriptSecurityManager.getSystemPrincipal());
- iconsvc.replaceFaviconDataFromDataURL(firstFavicon.uri, createDataURLForFavicon(secondFavicon), 0,
- Services.scriptSecurityManager.getSystemPrincipal());
-
- let deferSetAndFetchFavicon = Promise.defer();
- iconsvc.setAndFetchFaviconForPage(
- pageURI, firstFavicon.uri, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function test_replaceFaviconDataFromDataURL_twiceReplace_check(aURI, aDataLen, aData, aMimeType) {
- checkCallbackSucceeded(aMimeType, aData, secondFavicon.mimetype, secondFavicon.data);
- checkFaviconDataForPage(
- pageURI, secondFavicon.mimetype, secondFavicon.data,
- function test_replaceFaviconDataFromDataURL_twiceReplace_callback() {
- firstFavicon.file.remove(false);
- secondFavicon.file.remove(false);
- deferSetAndFetchFavicon.resolve();
- });
- }, Services.scriptSecurityManager.getSystemPrincipal());
- yield deferSetAndFetchFavicon.promise;
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_replaceFaviconDataFromDataURL_afterRegularAssign() {
- do_print("test replaceFaviconDataFromDataURL after replaceFaviconData");
-
- let pageURI = uri("http://test6.bar/");
- yield PlacesTestUtils.addVisits(pageURI);
-
- let firstFavicon = createFavicon("favicon11.png");
- let secondFavicon = createFavicon("favicon12.png");
-
- iconsvc.replaceFaviconData(
- firstFavicon.uri, firstFavicon.data, firstFavicon.data.length,
- firstFavicon.mimetype);
- iconsvc.replaceFaviconDataFromDataURL(firstFavicon.uri, createDataURLForFavicon(secondFavicon), 0,
- Services.scriptSecurityManager.getSystemPrincipal());
-
- let deferSetAndFetchFavicon = Promise.defer();
- iconsvc.setAndFetchFaviconForPage(
- pageURI, firstFavicon.uri, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function test_replaceFaviconDataFromDataURL_afterRegularAssign_check(aURI, aDataLen, aData, aMimeType) {
- checkCallbackSucceeded(aMimeType, aData, secondFavicon.mimetype, secondFavicon.data);
- checkFaviconDataForPage(
- pageURI, secondFavicon.mimetype, secondFavicon.data,
- function test_replaceFaviconDataFromDataURL_afterRegularAssign_callback() {
- firstFavicon.file.remove(false);
- secondFavicon.file.remove(false);
- deferSetAndFetchFavicon.resolve();
- });
- }, Services.scriptSecurityManager.getSystemPrincipal());
- yield deferSetAndFetchFavicon.promise;
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_replaceFaviconDataFromDataURL_beforeRegularAssign() {
- do_print("test replaceFaviconDataFromDataURL before replaceFaviconData");
-
- let pageURI = uri("http://test7.bar/");
- yield PlacesTestUtils.addVisits(pageURI);
-
- let firstFavicon = createFavicon("favicon13.png");
- let secondFavicon = createFavicon("favicon14.png");
-
- iconsvc.replaceFaviconDataFromDataURL(firstFavicon.uri, createDataURLForFavicon(firstFavicon), 0,
- Services.scriptSecurityManager.getSystemPrincipal());
- iconsvc.replaceFaviconData(
- firstFavicon.uri, secondFavicon.data, secondFavicon.data.length,
- secondFavicon.mimetype);
-
- let deferSetAndFetchFavicon = Promise.defer();
- iconsvc.setAndFetchFaviconForPage(
- pageURI, firstFavicon.uri, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- function test_replaceFaviconDataFromDataURL_beforeRegularAssign_check(aURI, aDataLen, aData, aMimeType) {
- checkCallbackSucceeded(aMimeType, aData, secondFavicon.mimetype, secondFavicon.data);
- checkFaviconDataForPage(
- pageURI, secondFavicon.mimetype, secondFavicon.data,
- function test_replaceFaviconDataFromDataURL_beforeRegularAssign_callback() {
- firstFavicon.file.remove(false);
- secondFavicon.file.remove(false);
- deferSetAndFetchFavicon.resolve();
- });
- }, Services.scriptSecurityManager.getSystemPrincipal());
- yield deferSetAndFetchFavicon.promise;
-
- yield PlacesTestUtils.clearHistory();
-});
-
-/* toBase64 copied from image/test/unit/test_encoder_png.js */
-
-/* Convert data (an array of integers) to a Base64 string. */
-const toBase64Table = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' +
- '0123456789+/';
-const base64Pad = '=';
-function toBase64(data) {
- let result = '';
- let length = data.length;
- let i;
- // Convert every three bytes to 4 ascii characters.
- for (i = 0; i < (length - 2); i += 3) {
- result += toBase64Table[data[i] >> 2];
- result += toBase64Table[((data[i] & 0x03) << 4) + (data[i+1] >> 4)];
- result += toBase64Table[((data[i+1] & 0x0f) << 2) + (data[i+2] >> 6)];
- result += toBase64Table[data[i+2] & 0x3f];
- }
-
- // Convert the remaining 1 or 2 bytes, pad out to 4 characters.
- if (length%3) {
- i = length - (length%3);
- result += toBase64Table[data[i] >> 2];
- if ((length%3) == 2) {
- result += toBase64Table[((data[i] & 0x03) << 4) + (data[i+1] >> 4)];
- result += toBase64Table[(data[i+1] & 0x0f) << 2];
- result += base64Pad;
- } else {
- result += toBase64Table[(data[i] & 0x03) << 4];
- result += base64Pad + base64Pad;
- }
- }
-
- return result;
-}
diff --git a/toolkit/components/places/tests/favicons/xpcshell.ini b/toolkit/components/places/tests/favicons/xpcshell.ini
deleted file mode 100644
index 851f193c7..000000000
--- a/toolkit/components/places/tests/favicons/xpcshell.ini
+++ /dev/null
@@ -1,32 +0,0 @@
-[DEFAULT]
-head = head_favicons.js
-tail =
-skip-if = toolkit == 'android'
-support-files =
- expected-favicon-big32.jpg.png
- expected-favicon-big4.jpg.png
- expected-favicon-big48.ico.png
- expected-favicon-big64.png.png
- expected-favicon-scale160x3.jpg.png
- expected-favicon-scale3x160.jpg.png
- favicon-big16.ico
- favicon-big32.jpg
- favicon-big4.jpg
- favicon-big48.ico
- favicon-big64.png
- favicon-normal16.png
- favicon-normal32.png
- favicon-scale160x3.jpg
- favicon-scale3x160.jpg
-
-[test_expireAllFavicons.js]
-[test_favicons_conversions.js]
-# Bug 676989: test fails consistently on Android
-fail-if = os == "android"
-[test_getFaviconDataForPage.js]
-[test_getFaviconURLForPage.js]
-[test_moz-anno_favicon_mime_type.js]
-[test_page-icon_protocol.js]
-[test_query_result_favicon_changed_on_child.js]
-[test_replaceFaviconData.js]
-[test_replaceFaviconDataFromDataURL.js]
diff --git a/toolkit/components/places/tests/head_common.js b/toolkit/components/places/tests/head_common.js
deleted file mode 100644
index ddb6dcbd7..000000000
--- a/toolkit/components/places/tests/head_common.js
+++ /dev/null
@@ -1,869 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const CURRENT_SCHEMA_VERSION = 35;
-const FIRST_UPGRADABLE_SCHEMA_VERSION = 11;
-
-const NS_APP_USER_PROFILE_50_DIR = "ProfD";
-const NS_APP_PROFILE_DIR_STARTUP = "ProfDS";
-
-// Shortcuts to transitions type.
-const TRANSITION_LINK = Ci.nsINavHistoryService.TRANSITION_LINK;
-const TRANSITION_TYPED = Ci.nsINavHistoryService.TRANSITION_TYPED;
-const TRANSITION_BOOKMARK = Ci.nsINavHistoryService.TRANSITION_BOOKMARK;
-const TRANSITION_EMBED = Ci.nsINavHistoryService.TRANSITION_EMBED;
-const TRANSITION_FRAMED_LINK = Ci.nsINavHistoryService.TRANSITION_FRAMED_LINK;
-const TRANSITION_REDIRECT_PERMANENT = Ci.nsINavHistoryService.TRANSITION_REDIRECT_PERMANENT;
-const TRANSITION_REDIRECT_TEMPORARY = Ci.nsINavHistoryService.TRANSITION_REDIRECT_TEMPORARY;
-const TRANSITION_DOWNLOAD = Ci.nsINavHistoryService.TRANSITION_DOWNLOAD;
-const TRANSITION_RELOAD = Ci.nsINavHistoryService.TRANSITION_RELOAD;
-
-const TITLE_LENGTH_MAX = 4096;
-
-Cu.importGlobalProperties(["URL"]);
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "BookmarkJSONUtils",
- "resource://gre/modules/BookmarkJSONUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "BookmarkHTMLUtils",
- "resource://gre/modules/BookmarkHTMLUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesBackups",
- "resource://gre/modules/PlacesBackups.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
- "resource://testing-common/PlacesTestUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesTransactions",
- "resource://gre/modules/PlacesTransactions.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Sqlite",
- "resource://gre/modules/Sqlite.jsm");
-
-// This imports various other objects in addition to PlacesUtils.
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "SMALLPNG_DATA_URI", function() {
- return NetUtil.newURI(
- "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAA" +
- "AAAA6fptVAAAACklEQVQI12NgAAAAAgAB4iG8MwAAAABJRU5ErkJggg==");
-});
-XPCOMUtils.defineLazyGetter(this, "SMALLSVG_DATA_URI", function() {
- return NetUtil.newURI(
- "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy5" +
- "3My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIiBmaWxs" +
- "PSIjNDI0ZTVhIj4NCiAgPGNpcmNsZSBjeD0iNTAiIGN5PSI1MCIgcj0iN" +
- "DQiIHN0cm9rZT0iIzQyNGU1YSIgc3Ryb2tlLXdpZHRoPSIxMSIgZmlsbD" +
- "0ibm9uZSIvPg0KICA8Y2lyY2xlIGN4PSI1MCIgY3k9IjI0LjYiIHI9IjY" +
- "uNCIvPg0KICA8cmVjdCB4PSI0NSIgeT0iMzkuOSIgd2lkdGg9IjEwLjEi" +
- "IGhlaWdodD0iNDEuOCIvPg0KPC9zdmc%2BDQo%3D");
-});
-
-var gTestDir = do_get_cwd();
-
-// Initialize profile.
-var gProfD = do_get_profile(true);
-
-// Remove any old database.
-clearDB();
-
-/**
- * Shortcut to create a nsIURI.
- *
- * @param aSpec
- * URLString of the uri.
- */
-function uri(aSpec) {
- return NetUtil.newURI(aSpec);
-}
-
-
-/**
- * Gets the database connection. If the Places connection is invalid it will
- * try to create a new connection.
- *
- * @param [optional] aForceNewConnection
- * Forces creation of a new connection to the database. When a
- * connection is asyncClosed it cannot anymore schedule async statements,
- * though connectionReady will keep returning true (Bug 726990).
- *
- * @return The database connection or null if unable to get one.
- */
-var gDBConn;
-function DBConn(aForceNewConnection) {
- if (!aForceNewConnection) {
- let db = PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
- .DBConnection;
- if (db.connectionReady)
- return db;
- }
-
- // If the Places database connection has been closed, create a new connection.
- if (!gDBConn || aForceNewConnection) {
- let file = Services.dirsvc.get('ProfD', Ci.nsIFile);
- file.append("places.sqlite");
- let dbConn = gDBConn = Services.storage.openDatabase(file);
-
- // Be sure to cleanly close this connection.
- promiseTopicObserved("profile-before-change").then(() => dbConn.asyncClose());
- }
-
- return gDBConn.connectionReady ? gDBConn : null;
-}
-
-/**
- * Reads data from the provided inputstream.
- *
- * @return an array of bytes.
- */
-function readInputStreamData(aStream) {
- let bistream = Cc["@mozilla.org/binaryinputstream;1"].
- createInstance(Ci.nsIBinaryInputStream);
- try {
- bistream.setInputStream(aStream);
- let expectedData = [];
- let avail;
- while ((avail = bistream.available())) {
- expectedData = expectedData.concat(bistream.readByteArray(avail));
- }
- return expectedData;
- } finally {
- bistream.close();
- }
-}
-
-/**
- * Reads the data from the specified nsIFile.
- *
- * @param aFile
- * The nsIFile to read from.
- * @return an array of bytes.
- */
-function readFileData(aFile) {
- let inputStream = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- // init the stream as RD_ONLY, -1 == default permissions.
- inputStream.init(aFile, 0x01, -1, null);
-
- // Check the returned size versus the expected size.
- let size = inputStream.available();
- let bytes = readInputStreamData(inputStream);
- if (size != bytes.length) {
- throw "Didn't read expected number of bytes";
- }
- return bytes;
-}
-
-/**
- * Reads the data from the named file, verifying the expected file length.
- *
- * @param aFileName
- * This file should be located in the same folder as the test.
- * @param aExpectedLength
- * Expected length of the file.
- *
- * @return The array of bytes read from the file.
- */
-function readFileOfLength(aFileName, aExpectedLength) {
- let data = readFileData(do_get_file(aFileName));
- do_check_eq(data.length, aExpectedLength);
- return data;
-}
-
-
-/**
- * Returns the base64-encoded version of the given string. This function is
- * similar to window.btoa, but is available to xpcshell tests also.
- *
- * @param aString
- * Each character in this string corresponds to a byte, and must be a
- * code point in the range 0-255.
- *
- * @return The base64-encoded string.
- */
-function base64EncodeString(aString) {
- var stream = Cc["@mozilla.org/io/string-input-stream;1"]
- .createInstance(Ci.nsIStringInputStream);
- stream.setData(aString, aString.length);
- var encoder = Cc["@mozilla.org/scriptablebase64encoder;1"]
- .createInstance(Ci.nsIScriptableBase64Encoder);
- return encoder.encodeToString(stream, aString.length);
-}
-
-
-/**
- * Compares two arrays, and returns true if they are equal.
- *
- * @param aArray1
- * First array to compare.
- * @param aArray2
- * Second array to compare.
- */
-function compareArrays(aArray1, aArray2) {
- if (aArray1.length != aArray2.length) {
- print("compareArrays: array lengths differ\n");
- return false;
- }
-
- for (let i = 0; i < aArray1.length; i++) {
- if (aArray1[i] != aArray2[i]) {
- print("compareArrays: arrays differ at index " + i + ": " +
- "(" + aArray1[i] + ") != (" + aArray2[i] +")\n");
- return false;
- }
- }
-
- return true;
-}
-
-
-/**
- * Deletes a previously created sqlite file from the profile folder.
- */
-function clearDB() {
- try {
- let file = Services.dirsvc.get('ProfD', Ci.nsIFile);
- file.append("places.sqlite");
- if (file.exists())
- file.remove(false);
- } catch (ex) { dump("Exception: " + ex); }
-}
-
-
-/**
- * Dumps the rows of a table out to the console.
- *
- * @param aName
- * The name of the table or view to output.
- */
-function dump_table(aName)
-{
- let stmt = DBConn().createStatement("SELECT * FROM " + aName);
-
- print("\n*** Printing data from " + aName);
- let count = 0;
- while (stmt.executeStep()) {
- let columns = stmt.numEntries;
-
- if (count == 0) {
- // Print the column names.
- for (let i = 0; i < columns; i++)
- dump(stmt.getColumnName(i) + "\t");
- dump("\n");
- }
-
- // Print the rows.
- for (let i = 0; i < columns; i++) {
- switch (stmt.getTypeOfIndex(i)) {
- case Ci.mozIStorageValueArray.VALUE_TYPE_NULL:
- dump("NULL\t");
- break;
- case Ci.mozIStorageValueArray.VALUE_TYPE_INTEGER:
- dump(stmt.getInt64(i) + "\t");
- break;
- case Ci.mozIStorageValueArray.VALUE_TYPE_FLOAT:
- dump(stmt.getDouble(i) + "\t");
- break;
- case Ci.mozIStorageValueArray.VALUE_TYPE_TEXT:
- dump(stmt.getString(i) + "\t");
- break;
- }
- }
- dump("\n");
-
- count++;
- }
- print("*** There were a total of " + count + " rows of data.\n");
-
- stmt.finalize();
-}
-
-
-/**
- * Checks if an address is found in the database.
- * @param aURI
- * nsIURI or address to look for.
- * @return place id of the page or 0 if not found
- */
-function page_in_database(aURI)
-{
- let url = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
- let stmt = DBConn().createStatement(
- "SELECT id FROM moz_places WHERE url_hash = hash(:url) AND url = :url"
- );
- stmt.params.url = url;
- try {
- if (!stmt.executeStep())
- return 0;
- return stmt.getInt64(0);
- }
- finally {
- stmt.finalize();
- }
-}
-
-/**
- * Checks how many visits exist for a specified page.
- * @param aURI
- * nsIURI or address to look for.
- * @return number of visits found.
- */
-function visits_in_database(aURI)
-{
- let url = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
- let stmt = DBConn().createStatement(
- `SELECT count(*) FROM moz_historyvisits v
- JOIN moz_places h ON h.id = v.place_id
- WHERE url_hash = hash(:url) AND url = :url`
- );
- stmt.params.url = url;
- try {
- if (!stmt.executeStep())
- return 0;
- return stmt.getInt64(0);
- }
- finally {
- stmt.finalize();
- }
-}
-
-/**
- * Checks that we don't have any bookmark
- */
-function check_no_bookmarks() {
- let query = PlacesUtils.history.getNewQuery();
- let folders = [
- PlacesUtils.bookmarks.toolbarFolder,
- PlacesUtils.bookmarks.bookmarksMenuFolder,
- PlacesUtils.bookmarks.unfiledBookmarksFolder,
- ];
- query.setFolders(folders, 3);
- let options = PlacesUtils.history.getNewQueryOptions();
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- if (root.childCount != 0)
- do_throw("Unable to remove all bookmarks");
- root.containerOpen = false;
-}
-
-/**
- * Allows waiting for an observer notification once.
- *
- * @param aTopic
- * Notification topic to observe.
- *
- * @return {Promise}
- * @resolves The array [aSubject, aData] from the observed notification.
- * @rejects Never.
- */
-function promiseTopicObserved(aTopic)
-{
- return new Promise(resolve => {
- Services.obs.addObserver(function observe(aObsSubject, aObsTopic, aObsData) {
- Services.obs.removeObserver(observe, aObsTopic);
- resolve([aObsSubject, aObsData]);
- }, aTopic, false);
- });
-}
-
-/**
- * Simulates a Places shutdown.
- */
-var shutdownPlaces = function() {
- do_print("shutdownPlaces: starting");
- let promise = new Promise(resolve => {
- Services.obs.addObserver(resolve, "places-connection-closed", false);
- });
- let hs = PlacesUtils.history.QueryInterface(Ci.nsIObserver);
- hs.observe(null, "profile-change-teardown", null);
- do_print("shutdownPlaces: sent profile-change-teardown");
- hs.observe(null, "test-simulate-places-shutdown", null);
- do_print("shutdownPlaces: sent test-simulate-places-shutdown");
- return promise.then(() => {
- do_print("shutdownPlaces: complete");
- });
-};
-
-const FILENAME_BOOKMARKS_HTML = "bookmarks.html";
-const FILENAME_BOOKMARKS_JSON = "bookmarks-" +
- (PlacesBackups.toISODateString(new Date())) + ".json";
-
-/**
- * Creates a bookmarks.html file in the profile folder from a given source file.
- *
- * @param aFilename
- * Name of the file to copy to the profile folder. This file must
- * exist in the directory that contains the test files.
- *
- * @return nsIFile object for the file.
- */
-function create_bookmarks_html(aFilename) {
- if (!aFilename)
- do_throw("you must pass a filename to create_bookmarks_html function");
- remove_bookmarks_html();
- let bookmarksHTMLFile = gTestDir.clone();
- bookmarksHTMLFile.append(aFilename);
- do_check_true(bookmarksHTMLFile.exists());
- bookmarksHTMLFile.copyTo(gProfD, FILENAME_BOOKMARKS_HTML);
- let profileBookmarksHTMLFile = gProfD.clone();
- profileBookmarksHTMLFile.append(FILENAME_BOOKMARKS_HTML);
- do_check_true(profileBookmarksHTMLFile.exists());
- return profileBookmarksHTMLFile;
-}
-
-
-/**
- * Remove bookmarks.html file from the profile folder.
- */
-function remove_bookmarks_html() {
- let profileBookmarksHTMLFile = gProfD.clone();
- profileBookmarksHTMLFile.append(FILENAME_BOOKMARKS_HTML);
- if (profileBookmarksHTMLFile.exists()) {
- profileBookmarksHTMLFile.remove(false);
- do_check_false(profileBookmarksHTMLFile.exists());
- }
-}
-
-
-/**
- * Check bookmarks.html file exists in the profile folder.
- *
- * @return nsIFile object for the file.
- */
-function check_bookmarks_html() {
- let profileBookmarksHTMLFile = gProfD.clone();
- profileBookmarksHTMLFile.append(FILENAME_BOOKMARKS_HTML);
- do_check_true(profileBookmarksHTMLFile.exists());
- return profileBookmarksHTMLFile;
-}
-
-
-/**
- * Creates a JSON backup in the profile folder folder from a given source file.
- *
- * @param aFilename
- * Name of the file to copy to the profile folder. This file must
- * exist in the directory that contains the test files.
- *
- * @return nsIFile object for the file.
- */
-function create_JSON_backup(aFilename) {
- if (!aFilename)
- do_throw("you must pass a filename to create_JSON_backup function");
- let bookmarksBackupDir = gProfD.clone();
- bookmarksBackupDir.append("bookmarkbackups");
- if (!bookmarksBackupDir.exists()) {
- bookmarksBackupDir.create(Ci.nsIFile.DIRECTORY_TYPE, parseInt("0755", 8));
- do_check_true(bookmarksBackupDir.exists());
- }
- let profileBookmarksJSONFile = bookmarksBackupDir.clone();
- profileBookmarksJSONFile.append(FILENAME_BOOKMARKS_JSON);
- if (profileBookmarksJSONFile.exists()) {
- profileBookmarksJSONFile.remove();
- }
- let bookmarksJSONFile = gTestDir.clone();
- bookmarksJSONFile.append(aFilename);
- do_check_true(bookmarksJSONFile.exists());
- bookmarksJSONFile.copyTo(bookmarksBackupDir, FILENAME_BOOKMARKS_JSON);
- profileBookmarksJSONFile = bookmarksBackupDir.clone();
- profileBookmarksJSONFile.append(FILENAME_BOOKMARKS_JSON);
- do_check_true(profileBookmarksJSONFile.exists());
- return profileBookmarksJSONFile;
-}
-
-
-/**
- * Remove bookmarksbackup dir and all backups from the profile folder.
- */
-function remove_all_JSON_backups() {
- let bookmarksBackupDir = gProfD.clone();
- bookmarksBackupDir.append("bookmarkbackups");
- if (bookmarksBackupDir.exists()) {
- bookmarksBackupDir.remove(true);
- do_check_false(bookmarksBackupDir.exists());
- }
-}
-
-
-/**
- * Check a JSON backup file for today exists in the profile folder.
- *
- * @param aIsAutomaticBackup The boolean indicates whether it's an automatic
- * backup.
- * @return nsIFile object for the file.
- */
-function check_JSON_backup(aIsAutomaticBackup) {
- let profileBookmarksJSONFile;
- if (aIsAutomaticBackup) {
- let bookmarksBackupDir = gProfD.clone();
- bookmarksBackupDir.append("bookmarkbackups");
- let files = bookmarksBackupDir.directoryEntries;
- while (files.hasMoreElements()) {
- let entry = files.getNext().QueryInterface(Ci.nsIFile);
- if (PlacesBackups.filenamesRegex.test(entry.leafName)) {
- profileBookmarksJSONFile = entry;
- break;
- }
- }
- } else {
- profileBookmarksJSONFile = gProfD.clone();
- profileBookmarksJSONFile.append("bookmarkbackups");
- profileBookmarksJSONFile.append(FILENAME_BOOKMARKS_JSON);
- }
- do_check_true(profileBookmarksJSONFile.exists());
- return profileBookmarksJSONFile;
-}
-
-/**
- * Returns the frecency of a url.
- *
- * @param aURI
- * The URI or spec to get frecency for.
- * @return the frecency value.
- */
-function frecencyForUrl(aURI)
-{
- let url = aURI;
- if (aURI instanceof Ci.nsIURI) {
- url = aURI.spec;
- } else if (aURI instanceof URL) {
- url = aURI.href;
- }
- let stmt = DBConn().createStatement(
- "SELECT frecency FROM moz_places WHERE url_hash = hash(?1) AND url = ?1"
- );
- stmt.bindByIndex(0, url);
- try {
- if (!stmt.executeStep()) {
- throw new Error("No result for frecency.");
- }
- return stmt.getInt32(0);
- } finally {
- stmt.finalize();
- }
-}
-
-/**
- * Returns the hidden status of a url.
- *
- * @param aURI
- * The URI or spec to get hidden for.
- * @return @return true if the url is hidden, false otherwise.
- */
-function isUrlHidden(aURI)
-{
- let url = aURI instanceof Ci.nsIURI ? aURI.spec : aURI;
- let stmt = DBConn().createStatement(
- "SELECT hidden FROM moz_places WHERE url_hash = hash(?1) AND url = ?1"
- );
- stmt.bindByIndex(0, url);
- if (!stmt.executeStep())
- throw new Error("No result for hidden.");
- let hidden = stmt.getInt32(0);
- stmt.finalize();
-
- return !!hidden;
-}
-
-/**
- * Compares two times in usecs, considering eventual platform timers skews.
- *
- * @param aTimeBefore
- * The older time in usecs.
- * @param aTimeAfter
- * The newer time in usecs.
- * @return true if times are ordered, false otherwise.
- */
-function is_time_ordered(before, after) {
- // Windows has an estimated 16ms timers precision, since Date.now() and
- // PR_Now() use different code atm, the results can be unordered by this
- // amount of time. See bug 558745 and bug 557406.
- let isWindows = ("@mozilla.org/windows-registry-key;1" in Cc);
- // Just to be safe we consider 20ms.
- let skew = isWindows ? 20000000 : 0;
- return after - before > -skew;
-}
-
-/**
- * Shutdowns Places, invoking the callback when the connection has been closed.
- *
- * @param aCallback
- * Function to be called when done.
- */
-function waitForConnectionClosed(aCallback)
-{
- promiseTopicObserved("places-connection-closed").then(aCallback);
- shutdownPlaces();
-}
-
-/**
- * Tests if a given guid is valid for use in Places or not.
- *
- * @param aGuid
- * The guid to test.
- * @param [optional] aStack
- * The stack frame used to report the error.
- */
-function do_check_valid_places_guid(aGuid,
- aStack)
-{
- if (!aStack) {
- aStack = Components.stack.caller;
- }
- do_check_true(/^[a-zA-Z0-9\-_]{12}$/.test(aGuid), aStack);
-}
-
-/**
- * Retrieves the guid for a given uri.
- *
- * @param aURI
- * The uri to check.
- * @param [optional] aStack
- * The stack frame used to report the error.
- * @return the associated the guid.
- */
-function do_get_guid_for_uri(aURI,
- aStack)
-{
- if (!aStack) {
- aStack = Components.stack.caller;
- }
- let stmt = DBConn().createStatement(
- `SELECT guid
- FROM moz_places
- WHERE url_hash = hash(:url) AND url = :url`
- );
- stmt.params.url = aURI.spec;
- do_check_true(stmt.executeStep(), aStack);
- let guid = stmt.row.guid;
- stmt.finalize();
- do_check_valid_places_guid(guid, aStack);
- return guid;
-}
-
-/**
- * Tests that a guid was set in moz_places for a given uri.
- *
- * @param aURI
- * The uri to check.
- * @param [optional] aGUID
- * The expected guid in the database.
- */
-function do_check_guid_for_uri(aURI,
- aGUID)
-{
- let caller = Components.stack.caller;
- let guid = do_get_guid_for_uri(aURI, caller);
- if (aGUID) {
- do_check_valid_places_guid(aGUID, caller);
- do_check_eq(guid, aGUID, caller);
- }
-}
-
-/**
- * Retrieves the guid for a given bookmark.
- *
- * @param aId
- * The bookmark id to check.
- * @param [optional] aStack
- * The stack frame used to report the error.
- * @return the associated the guid.
- */
-function do_get_guid_for_bookmark(aId,
- aStack)
-{
- if (!aStack) {
- aStack = Components.stack.caller;
- }
- let stmt = DBConn().createStatement(
- `SELECT guid
- FROM moz_bookmarks
- WHERE id = :item_id`
- );
- stmt.params.item_id = aId;
- do_check_true(stmt.executeStep(), aStack);
- let guid = stmt.row.guid;
- stmt.finalize();
- do_check_valid_places_guid(guid, aStack);
- return guid;
-}
-
-/**
- * Tests that a guid was set in moz_places for a given bookmark.
- *
- * @param aId
- * The bookmark id to check.
- * @param [optional] aGUID
- * The expected guid in the database.
- */
-function do_check_guid_for_bookmark(aId,
- aGUID)
-{
- let caller = Components.stack.caller;
- let guid = do_get_guid_for_bookmark(aId, caller);
- if (aGUID) {
- do_check_valid_places_guid(aGUID, caller);
- do_check_eq(guid, aGUID, caller);
- }
-}
-
-/**
- * Compares 2 arrays returning whether they contains the same elements.
- *
- * @param a1
- * First array to compare.
- * @param a2
- * Second array to compare.
- * @param [optional] sorted
- * Whether the comparison should take in count position of the elements.
- * @return true if the arrays contain the same elements, false otherwise.
- */
-function do_compare_arrays(a1, a2, sorted)
-{
- if (a1.length != a2.length)
- return false;
-
- if (sorted) {
- return a1.every((e, i) => e == a2[i]);
- }
- return a1.filter(e => !a2.includes(e)).length == 0 &&
- a2.filter(e => !a1.includes(e)).length == 0;
-}
-
-/**
- * Generic nsINavBookmarkObserver that doesn't implement anything, but provides
- * dummy methods to prevent errors about an object not having a certain method.
- */
-function NavBookmarkObserver() {}
-
-NavBookmarkObserver.prototype = {
- onBeginUpdateBatch: function () {},
- onEndUpdateBatch: function () {},
- onItemAdded: function () {},
- onItemRemoved: function () {},
- onItemChanged: function () {},
- onItemVisited: function () {},
- onItemMoved: function () {},
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsINavBookmarkObserver,
- ])
-};
-
-/**
- * Generic nsINavHistoryObserver that doesn't implement anything, but provides
- * dummy methods to prevent errors about an object not having a certain method.
- */
-function NavHistoryObserver() {}
-
-NavHistoryObserver.prototype = {
- onBeginUpdateBatch: function () {},
- onEndUpdateBatch: function () {},
- onVisit: function () {},
- onTitleChanged: function () {},
- onDeleteURI: function () {},
- onClearHistory: function () {},
- onPageChanged: function () {},
- onDeleteVisits: function () {},
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsINavHistoryObserver,
- ])
-};
-
-/**
- * Generic nsINavHistoryResultObserver that doesn't implement anything, but
- * provides dummy methods to prevent errors about an object not having a certain
- * method.
- */
-function NavHistoryResultObserver() {}
-
-NavHistoryResultObserver.prototype = {
- batching: function () {},
- containerStateChanged: function () {},
- invalidateContainer: function () {},
- nodeAnnotationChanged: function () {},
- nodeDateAddedChanged: function () {},
- nodeHistoryDetailsChanged: function () {},
- nodeIconChanged: function () {},
- nodeInserted: function () {},
- nodeKeywordChanged: function () {},
- nodeLastModifiedChanged: function () {},
- nodeMoved: function () {},
- nodeRemoved: function () {},
- nodeTagsChanged: function () {},
- nodeTitleChanged: function () {},
- nodeURIChanged: function () {},
- sortingChanged: function () {},
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsINavHistoryResultObserver,
- ])
-};
-
-/**
- * Asynchronously check a url is visited.
- *
- * @param aURI The URI.
- * @return {Promise}
- * @resolves When the check has been added successfully.
- * @rejects JavaScript exception.
- */
-function promiseIsURIVisited(aURI) {
- let deferred = Promise.defer();
-
- PlacesUtils.asyncHistory.isURIVisited(aURI, function(unused, aIsVisited) {
- deferred.resolve(aIsVisited);
- });
-
- return deferred.promise;
-}
-
-/**
- * Asynchronously set the favicon associated with a page.
- * @param aPageURI
- * The page's URI
- * @param aIconURI
- * The URI of the favicon to be set.
- */
-function promiseSetIconForPage(aPageURI, aIconURI) {
- let deferred = Promise.defer();
- PlacesUtils.favicons.setAndFetchFaviconForPage(
- aPageURI, aIconURI, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- () => { deferred.resolve(); },
- Services.scriptSecurityManager.getSystemPrincipal());
- return deferred.promise;
-}
-
-function checkBookmarkObject(info) {
- do_check_valid_places_guid(info.guid);
- do_check_valid_places_guid(info.parentGuid);
- Assert.ok(typeof info.index == "number", "index should be a number");
- Assert.ok(info.dateAdded.constructor.name == "Date", "dateAdded should be a Date");
- Assert.ok(info.lastModified.constructor.name == "Date", "lastModified should be a Date");
- Assert.ok(info.lastModified >= info.dateAdded, "lastModified should never be smaller than dateAdded");
- Assert.ok(typeof info.type == "number", "type should be a number");
-}
-
-/**
- * Reads foreign_count value for a given url.
- */
-function* foreign_count(url) {
- if (url instanceof Ci.nsIURI)
- url = url.spec;
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.executeCached(
- `SELECT foreign_count FROM moz_places
- WHERE url_hash = hash(:url) AND url = :url
- `, { url });
- return rows.length == 0 ? 0 : rows[0].getResultByName("foreign_count");
-}
diff --git a/toolkit/components/places/tests/history/.eslintrc.js b/toolkit/components/places/tests/history/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/places/tests/history/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/places/tests/history/head_history.js b/toolkit/components/places/tests/history/head_history.js
deleted file mode 100644
index 870802dc1..000000000
--- a/toolkit/components/places/tests/history/head_history.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cr = Components.results;
-var Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-// Import common head.
-{
- let commonFile = do_get_file("../head_common.js", false);
- let uri = Services.io.newFileURI(commonFile);
- Services.scriptloader.loadSubScript(uri.spec, this);
-}
diff --git a/toolkit/components/places/tests/history/test_insert.js b/toolkit/components/places/tests/history/test_insert.js
deleted file mode 100644
index e2884af8c..000000000
--- a/toolkit/components/places/tests/history/test_insert.js
+++ /dev/null
@@ -1,257 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-
-// Tests for `History.insert` and `History.insertMany`, as implemented in History.jsm
-
-"use strict";
-
-add_task(function* test_insert_error_cases() {
- const TEST_URL = "http://mozilla.com";
-
- Assert.throws(
- () => PlacesUtils.history.insert(),
- /TypeError: pageInfo must be an object/,
- "passing a null into History.insert should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.insert(1),
- /TypeError: pageInfo must be an object/,
- "passing a non object into History.insert should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.insert({}),
- /TypeError: PageInfo object must have a url property/,
- "passing an object without a url to History.insert should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.insert({url: 123}),
- /TypeError: Invalid url or guid: 123/,
- "passing an object with an invalid url to History.insert should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.insert({url: TEST_URL}),
- /TypeError: PageInfo object must have an array of visits/,
- "passing an object without a visits property to History.insert should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.insert({url: TEST_URL, visits: 1}),
- /TypeError: PageInfo object must have an array of visits/,
- "passing an object with a non-array visits property to History.insert should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.insert({url: TEST_URL, visits: []}),
- /TypeError: PageInfo object must have an array of visits/,
- "passing an object with an empty array as the visits property to History.insert should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.insert({
- url: TEST_URL,
- visits: [
- {
- transition: TRANSITION_LINK,
- date: "a"
- }
- ]}),
- /TypeError: Expected a Date, got a/,
- "passing a visit object with an invalid date to History.insert should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.insert({
- url: TEST_URL,
- visits: [
- {
- transition: TRANSITION_LINK
- },
- {
- transition: TRANSITION_LINK,
- date: "a"
- }
- ]}),
- /TypeError: Expected a Date, got a/,
- "passing a second visit object with an invalid date to History.insert should throw a TypeError"
- );
- let futureDate = new Date();
- futureDate.setDate(futureDate.getDate() + 1000);
- Assert.throws(
- () => PlacesUtils.history.insert({
- url: TEST_URL,
- visits: [
- {
- transition: TRANSITION_LINK,
- date: futureDate,
- }
- ]}),
- `TypeError: date: ${futureDate} is not a valid date`,
- "passing a visit object with a future date to History.insert should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.insert({
- url: TEST_URL,
- visits: [
- {transition: "a"}
- ]}),
- /TypeError: transition: a is not a valid transition type/,
- "passing a visit object with an invalid transition to History.insert should throw a TypeError"
- );
-});
-
-add_task(function* test_history_insert() {
- const TEST_URL = "http://mozilla.com/";
-
- let inserter = Task.async(function*(name, filter, referrer, date, transition) {
- do_print(name);
- do_print(`filter: ${filter}, referrer: ${referrer}, date: ${date}, transition: ${transition}`);
-
- let uri = NetUtil.newURI(TEST_URL + Math.random());
- let title = "Visit " + Math.random();
-
- let pageInfo = {
- title,
- visits: [
- {transition: transition, referrer: referrer, date: date, }
- ]
- };
-
- pageInfo.url = yield filter(uri);
-
- let result = yield PlacesUtils.history.insert(pageInfo);
-
- Assert.ok(PlacesUtils.isValidGuid(result.guid), "guid for pageInfo object is valid");
- Assert.equal(uri.spec, result.url.href, "url is correct for pageInfo object");
- Assert.equal(title, result.title, "title is correct for pageInfo object");
- Assert.equal(TRANSITION_LINK, result.visits[0].transition, "transition is correct for pageInfo object");
- if (referrer) {
- Assert.equal(referrer, result.visits[0].referrer.href, "url of referrer for visit is correct");
- } else {
- Assert.equal(null, result.visits[0].referrer, "url of referrer for visit is correct");
- }
- if (date) {
- Assert.equal(Number(date),
- Number(result.visits[0].date),
- "date of visit is correct");
- }
-
- Assert.ok(yield PlacesTestUtils.isPageInDB(uri), "Page was added");
- Assert.ok(yield PlacesTestUtils.visitsInDB(uri), "Visit was added");
- });
-
- try {
- for (let referrer of [TEST_URL, null]) {
- for (let date of [new Date(), null]) {
- for (let transition of [TRANSITION_LINK, null]) {
- yield inserter("Testing History.insert() with an nsIURI", x => x, referrer, date, transition);
- yield inserter("Testing History.insert() with a string url", x => x.spec, referrer, date, transition);
- yield inserter("Testing History.insert() with a URL object", x => new URL(x.spec), referrer, date, transition);
- }
- }
- }
- } finally {
- yield PlacesTestUtils.clearHistory();
- }
-});
-
-add_task(function* test_insert_multiple_error_cases() {
- let validPageInfo = {
- url: "http://mozilla.com",
- visits: [
- {transition: TRANSITION_LINK}
- ]
- };
-
- Assert.throws(
- () => PlacesUtils.history.insertMany(),
- /TypeError: pageInfos must be an array/,
- "passing a null into History.insertMany should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.insertMany([]),
- /TypeError: pageInfos may not be an empty array/,
- "passing an empty array into History.insertMany should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.insertMany([validPageInfo, {}]),
- /TypeError: PageInfo object must have a url property/,
- "passing a second invalid PageInfo object to History.insertMany should throw a TypeError"
- );
-});
-
-add_task(function* test_history_insertMany() {
- const BAD_URLS = ["about:config", "chrome://browser/content/browser.xul"];
- const GOOD_URLS = [1, 2, 3].map(x => { return `http://mozilla.com/${x}`; });
-
- let makePageInfos = Task.async(function*(urls, filter = x => x) {
- let pageInfos = [];
- for (let url of urls) {
- let uri = NetUtil.newURI(url);
-
- let pageInfo = {
- title: `Visit to ${url}`,
- visits: [
- {transition: TRANSITION_LINK}
- ]
- };
-
- pageInfo.url = yield filter(uri);
- pageInfos.push(pageInfo);
- }
- return pageInfos;
- });
-
- let inserter = Task.async(function*(name, filter, useCallbacks) {
- do_print(name);
- do_print(`filter: ${filter}`);
- do_print(`useCallbacks: ${useCallbacks}`);
- yield PlacesTestUtils.clearHistory();
-
- let result;
- let allUrls = GOOD_URLS.concat(BAD_URLS);
- let pageInfos = yield makePageInfos(allUrls, filter);
-
- if (useCallbacks) {
- let onResultUrls = [];
- let onErrorUrls = [];
- result = yield PlacesUtils.history.insertMany(pageInfos, pageInfo => {
- let url = pageInfo.url.href;
- Assert.ok(GOOD_URLS.includes(url), "onResult callback called for correct url");
- onResultUrls.push(url);
- Assert.equal(`Visit to ${url}`, pageInfo.title, "onResult callback provides the correct title");
- Assert.ok(PlacesUtils.isValidGuid(pageInfo.guid), "onResult callback provides a valid guid");
- }, pageInfo => {
- let url = pageInfo.url.href;
- Assert.ok(BAD_URLS.includes(url), "onError callback called for correct uri");
- onErrorUrls.push(url);
- Assert.equal(undefined, pageInfo.title, "onError callback provides the correct title");
- Assert.equal(undefined, pageInfo.guid, "onError callback provides the expected guid");
- });
- Assert.equal(GOOD_URLS.sort().toString(), onResultUrls.sort().toString(), "onResult callback was called for each good url");
- Assert.equal(BAD_URLS.sort().toString(), onErrorUrls.sort().toString(), "onError callback was called for each bad url");
- } else {
- result = yield PlacesUtils.history.insertMany(pageInfos);
- }
-
- Assert.equal(undefined, result, "insertMany returned undefined");
-
- for (let url of allUrls) {
- let expected = GOOD_URLS.includes(url);
- Assert.equal(expected, yield PlacesTestUtils.isPageInDB(url), `isPageInDB for ${url} is ${expected}`);
- Assert.equal(expected, yield PlacesTestUtils.visitsInDB(url), `visitsInDB for ${url} is ${expected}`);
- }
- });
-
- try {
- for (let useCallbacks of [false, true]) {
- yield inserter("Testing History.insertMany() with an nsIURI", x => x, useCallbacks);
- yield inserter("Testing History.insertMany() with a string url", x => x.spec, useCallbacks);
- yield inserter("Testing History.insertMany() with a URL object", x => new URL(x.spec), useCallbacks);
- }
- // Test rejection when no items added
- let pageInfos = yield makePageInfos(BAD_URLS);
- PlacesUtils.history.insertMany(pageInfos).then(() => {
- Assert.ok(false, "History.insertMany rejected promise with all bad URLs");
- }, error => {
- Assert.equal("No items were added to history.", error.message, "History.insertMany rejected promise with all bad URLs");
- });
- } finally {
- yield PlacesTestUtils.clearHistory();
- }
-});
diff --git a/toolkit/components/places/tests/history/test_remove.js b/toolkit/components/places/tests/history/test_remove.js
deleted file mode 100644
index 7423f6464..000000000
--- a/toolkit/components/places/tests/history/test_remove.js
+++ /dev/null
@@ -1,360 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-
-// Tests for `History.remove`, as implemented in History.jsm
-
-"use strict";
-
-Cu.importGlobalProperties(["URL"]);
-
-
-// Test removing a single page
-add_task(function* test_remove_single() {
- yield PlacesTestUtils.clearHistory();
- yield PlacesUtils.bookmarks.eraseEverything();
-
-
- let WITNESS_URI = NetUtil.newURI("http://mozilla.com/test_browserhistory/test_remove/" + Math.random());
- yield PlacesTestUtils.addVisits(WITNESS_URI);
- Assert.ok(page_in_database(WITNESS_URI));
-
- let remover = Task.async(function*(name, filter, options) {
- do_print(name);
- do_print(JSON.stringify(options));
- do_print("Setting up visit");
-
- let uri = NetUtil.newURI("http://mozilla.com/test_browserhistory/test_remove/" + Math.random());
- let title = "Visit " + Math.random();
- yield PlacesTestUtils.addVisits({uri: uri, title: title});
- Assert.ok(visits_in_database(uri), "History entry created");
-
- let removeArg = yield filter(uri);
-
- if (options.addBookmark) {
- PlacesUtils.bookmarks.insertBookmark(
- PlacesUtils.unfiledBookmarksFolderId,
- uri,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "test bookmark");
- }
-
- let shouldRemove = !options.addBookmark;
- let observer;
- let promiseObserved = new Promise((resolve, reject) => {
- observer = {
- onBeginUpdateBatch: function() {},
- onEndUpdateBatch: function() {},
- onVisit: function(aUri) {
- reject(new Error("Unexpected call to onVisit " + aUri.spec));
- },
- onTitleChanged: function(aUri) {
- reject(new Error("Unexpected call to onTitleChanged " + aUri.spec));
- },
- onClearHistory: function() {
- reject("Unexpected call to onClearHistory");
- },
- onPageChanged: function(aUri) {
- reject(new Error("Unexpected call to onPageChanged " + aUri.spec));
- },
- onFrecencyChanged: function(aURI) {
- try {
- Assert.ok(!shouldRemove, "Observing onFrecencyChanged");
- Assert.equal(aURI.spec, uri.spec, "Observing effect on the right uri");
- } finally {
- resolve();
- }
- },
- onManyFrecenciesChanged: function() {
- try {
- Assert.ok(!shouldRemove, "Observing onManyFrecenciesChanged");
- } finally {
- resolve();
- }
- },
- onDeleteURI: function(aURI) {
- try {
- Assert.ok(shouldRemove, "Observing onDeleteURI");
- Assert.equal(aURI.spec, uri.spec, "Observing effect on the right uri");
- } finally {
- resolve();
- }
- },
- onDeleteVisits: function(aURI) {
- Assert.equal(aURI.spec, uri.spec, "Observing onDeleteVisits on the right uri");
- }
- };
- });
- PlacesUtils.history.addObserver(observer, false);
-
- do_print("Performing removal");
- let removed = false;
- if (options.useCallback) {
- let onRowCalled = false;
- let guid = do_get_guid_for_uri(uri);
- removed = yield PlacesUtils.history.remove(removeArg, page => {
- Assert.equal(onRowCalled, false, "Callback has not been called yet");
- onRowCalled = true;
- Assert.equal(page.url.href, uri.spec, "Callback provides the correct url");
- Assert.equal(page.guid, guid, "Callback provides the correct guid");
- Assert.equal(page.title, title, "Callback provides the correct title");
- });
- Assert.ok(onRowCalled, "Callback has been called");
- } else {
- removed = yield PlacesUtils.history.remove(removeArg);
- }
-
- yield promiseObserved;
- PlacesUtils.history.removeObserver(observer);
-
- Assert.equal(visits_in_database(uri), 0, "History entry has disappeared");
- Assert.notEqual(visits_in_database(WITNESS_URI), 0, "Witness URI still has visits");
- Assert.notEqual(page_in_database(WITNESS_URI), 0, "Witness URI is still here");
- if (shouldRemove) {
- Assert.ok(removed, "Something was removed");
- Assert.equal(page_in_database(uri), 0, "Page has disappeared");
- } else {
- Assert.ok(!removed, "The page was not removed, as there was a bookmark");
- Assert.notEqual(page_in_database(uri), 0, "The page is still present");
- }
- });
-
- try {
- for (let useCallback of [false, true]) {
- for (let addBookmark of [false, true]) {
- let options = { useCallback: useCallback, addBookmark: addBookmark };
- yield remover("Testing History.remove() with a single URI", x => x, options);
- yield remover("Testing History.remove() with a single string url", x => x.spec, options);
- yield remover("Testing History.remove() with a single string guid", x => do_get_guid_for_uri(x), options);
- yield remover("Testing History.remove() with a single URI in an array", x => [x], options);
- yield remover("Testing History.remove() with a single string url in an array", x => [x.spec], options);
- yield remover("Testing History.remove() with a single string guid in an array", x => [do_get_guid_for_uri(x)], options);
- }
- }
- } finally {
- yield PlacesTestUtils.clearHistory();
- }
- return;
-});
-
-// Test removing a list of pages
-add_task(function* test_remove_many() {
- const SIZE = 10;
-
- yield PlacesTestUtils.clearHistory();
- yield PlacesUtils.bookmarks.eraseEverything();
-
- do_print("Adding a witness page");
- let WITNESS_URI = NetUtil.newURI("http://mozilla.com/test_browserhistory/test_remove/" + Math.random());
- yield PlacesTestUtils.addVisits(WITNESS_URI);
- Assert.ok(page_in_database(WITNESS_URI), "Witness page added");
-
- do_print("Generating samples");
- let pages = [];
- for (let i = 0; i < SIZE; ++i) {
- let uri = NetUtil.newURI("http://mozilla.com/test_browserhistory/test_remove?sample=" + i + "&salt=" + Math.random());
- let title = "Visit " + i + ", " + Math.random();
- let hasBookmark = i % 3 == 0;
- let page = {
- uri: uri,
- title: title,
- hasBookmark: hasBookmark,
- // `true` once `onResult` has been called for this page
- onResultCalled: false,
- // `true` once `onDeleteVisits` has been called for this page
- onDeleteVisitsCalled: false,
- // `true` once `onFrecencyChangedCalled` has been called for this page
- onFrecencyChangedCalled: false,
- // `true` once `onDeleteURI` has been called for this page
- onDeleteURICalled: false,
- };
- do_print("Pushing: " + uri.spec);
- pages.push(page);
-
- yield PlacesTestUtils.addVisits(page);
- page.guid = do_get_guid_for_uri(uri);
- if (hasBookmark) {
- PlacesUtils.bookmarks.insertBookmark(
- PlacesUtils.unfiledBookmarksFolderId,
- uri,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "test bookmark " + i);
- }
- Assert.ok(page_in_database(uri), "Page added");
- }
-
- do_print("Mixing key types and introducing dangling keys");
- let keys = [];
- for (let i = 0; i < SIZE; ++i) {
- if (i % 4 == 0) {
- keys.push(pages[i].uri);
- keys.push(NetUtil.newURI("http://example.org/dangling/nsIURI/" + i));
- } else if (i % 4 == 1) {
- keys.push(new URL(pages[i].uri.spec));
- keys.push(new URL("http://example.org/dangling/URL/" + i));
- } else if (i % 4 == 2) {
- keys.push(pages[i].uri.spec);
- keys.push("http://example.org/dangling/stringuri/" + i);
- } else {
- keys.push(pages[i].guid);
- keys.push(("guid_" + i + "_01234567890").substr(0, 12));
- }
- }
-
- let observer = {
- onBeginUpdateBatch: function() {},
- onEndUpdateBatch: function() {},
- onVisit: function(aURI) {
- Assert.ok(false, "Unexpected call to onVisit " + aURI.spec);
- },
- onTitleChanged: function(aURI) {
- Assert.ok(false, "Unexpected call to onTitleChanged " + aURI.spec);
- },
- onClearHistory: function() {
- Assert.ok(false, "Unexpected call to onClearHistory");
- },
- onPageChanged: function(aURI) {
- Assert.ok(false, "Unexpected call to onPageChanged " + aURI.spec);
- },
- onFrecencyChanged: function(aURI) {
- let origin = pages.find(x => x.uri.spec == aURI.spec);
- Assert.ok(origin);
- Assert.ok(origin.hasBookmark, "Observing onFrecencyChanged on a page with a bookmark");
- origin.onFrecencyChangedCalled = true;
- // We do not make sure that `origin.onFrecencyChangedCalled` is `false`, as
- },
- onManyFrecenciesChanged: function() {
- Assert.ok(false, "Observing onManyFrecenciesChanges, this is most likely correct but not covered by this test");
- },
- onDeleteURI: function(aURI) {
- let origin = pages.find(x => x.uri.spec == aURI.spec);
- Assert.ok(origin);
- Assert.ok(!origin.hasBookmark, "Observing onDeleteURI on a page without a bookmark");
- Assert.ok(!origin.onDeleteURICalled, "Observing onDeleteURI for the first time");
- origin.onDeleteURICalled = true;
- },
- onDeleteVisits: function(aURI) {
- let origin = pages.find(x => x.uri.spec == aURI.spec);
- Assert.ok(origin);
- Assert.ok(!origin.onDeleteVisitsCalled, "Observing onDeleteVisits for the first time");
- origin.onDeleteVisitsCalled = true;
- }
- };
- PlacesUtils.history.addObserver(observer, false);
-
- do_print("Removing the pages and checking the callbacks");
- let removed = yield PlacesUtils.history.remove(keys, page => {
- let origin = pages.find(candidate => candidate.uri.spec == page.url.href);
-
- Assert.ok(origin, "onResult has a valid page");
- Assert.ok(!origin.onResultCalled, "onResult has not seen this page yet");
- origin.onResultCalled = true;
- Assert.equal(page.guid, origin.guid, "onResult has the right guid");
- Assert.equal(page.title, origin.title, "onResult has the right title");
- });
- Assert.ok(removed, "Something was removed");
-
- PlacesUtils.history.removeObserver(observer);
-
- do_print("Checking out results");
- // By now the observers should have been called.
- for (let i = 0; i < pages.length; ++i) {
- let page = pages[i];
- do_print("Page: " + i);
- Assert.ok(page.onResultCalled, "We have reached the page from the callback");
- Assert.ok(visits_in_database(page.uri) == 0, "History entry has disappeared");
- Assert.equal(page_in_database(page.uri) != 0, page.hasBookmark, "Page is present only if it also has bookmarks");
- Assert.equal(page.onFrecencyChangedCalled, page.onDeleteVisitsCalled, "onDeleteVisits was called iff onFrecencyChanged was called");
- Assert.ok(page.onFrecencyChangedCalled ^ page.onDeleteURICalled, "Either onFrecencyChanged or onDeleteURI was called");
- }
-
- Assert.notEqual(visits_in_database(WITNESS_URI), 0, "Witness URI still has visits");
- Assert.notEqual(page_in_database(WITNESS_URI), 0, "Witness URI is still here");
-});
-
-add_task(function* cleanup() {
- yield PlacesTestUtils.clearHistory();
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-// Test the various error cases
-add_task(function* test_error_cases() {
- Assert.throws(
- () => PlacesUtils.history.remove(),
- /TypeError: Invalid url/,
- "History.remove with no argument should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.remove(null),
- /TypeError: Invalid url/,
- "History.remove with `null` should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.remove(undefined),
- /TypeError: Invalid url/,
- "History.remove with `undefined` should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.remove("not a guid, obviously"),
- /TypeError: .* is not a valid URL/,
- "History.remove with an ill-formed guid/url argument should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.remove({"not the kind of object we know how to handle": true}),
- /TypeError: Invalid url/,
- "History.remove with an unexpected object should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.remove([]),
- /TypeError: Expected at least one page/,
- "History.remove with an empty array should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.remove([null]),
- /TypeError: Invalid url or guid/,
- "History.remove with an array containing null should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.remove(["http://example.org", "not a guid, obviously"]),
- /TypeError: .* is not a valid URL/,
- "History.remove with an array containing an ill-formed guid/url argument should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.remove(["0123456789ab"/* valid guid*/, null]),
- /TypeError: Invalid url or guid: null/,
- "History.remove with an array containing a guid and a second argument that is null should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.remove(["http://example.org", {"not the kind of object we know how to handle": true}]),
- /TypeError: Invalid url/,
- "History.remove with an array containing an unexpected objecgt should throw a TypeError"
- );
- Assert.throws(
- () => PlacesUtils.history.remove("http://example.org", "not a function, obviously"),
- /TypeError: Invalid function/,
- "History.remove with a second argument that is not a function argument should throw a TypeError"
- );
- try {
- PlacesUtils.history.remove("http://example.org/I/have/clearly/not/been/added", null);
- Assert.ok(true, "History.remove should ignore `null` as a second argument");
- } catch (ex) {
- Assert.ok(false, "History.remove should ignore `null` as a second argument");
- }
-});
-
-add_task(function* test_orphans() {
- let uri = NetUtil.newURI("http://moz.org/");
- yield PlacesTestUtils.addVisits({ uri });
-
- PlacesUtils.favicons.setAndFetchFaviconForPage(
- uri, SMALLPNG_DATA_URI, true, PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- null, Services.scriptSecurityManager.getSystemPrincipal());
- PlacesUtils.annotations.setPageAnnotation(uri, "test", "restval", 0,
- PlacesUtils.annotations.EXPIRE_NEVER);
-
- yield PlacesUtils.history.remove(uri);
- Assert.ok(!(yield PlacesTestUtils.isPageInDB(uri)), "Page should have been removed");
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.execute(`SELECT (SELECT count(*) FROM moz_annos) +
- (SELECT count(*) FROM moz_favicons) AS count`);
- Assert.equal(rows[0].getResultByName("count"), 0, "Should not find orphans");
-});
diff --git a/toolkit/components/places/tests/history/test_removeVisits.js b/toolkit/components/places/tests/history/test_removeVisits.js
deleted file mode 100644
index 8df0c81a9..000000000
--- a/toolkit/components/places/tests/history/test_removeVisits.js
+++ /dev/null
@@ -1,316 +0,0 @@
-const JS_NOW = Date.now();
-const DB_NOW = JS_NOW * 1000;
-const TEST_URI = uri("http://example.com/");
-const PLACE_URI = uri("place:queryType=0&sort=8&maxResults=10");
-
-function* cleanup() {
- yield PlacesTestUtils.clearHistory();
- yield PlacesUtils.bookmarks.eraseEverything();
- // This is needed to remove place: entries.
- DBConn().executeSimpleSQL("DELETE FROM moz_places");
-}
-
-add_task(function* remove_visits_outside_unbookmarked_uri() {
- do_print("*** TEST: Remove some visits outside valid timeframe from an unbookmarked URI");
-
- do_print("Add 10 visits for the URI from way in the past.");
- let visits = [];
- for (let i = 0; i < 10; i++) {
- visits.push({ uri: TEST_URI, visitDate: DB_NOW - 100000 - (i * 1000) });
- }
- yield PlacesTestUtils.addVisits(visits);
-
- do_print("Remove visits using timerange outside the URI's visits.");
- let filter = {
- beginDate: new Date(JS_NOW - 10),
- endDate: new Date(JS_NOW)
- };
- yield PlacesUtils.history.removeVisitsByFilter(filter);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("URI should still exist in moz_places.");
- do_check_true(page_in_database(TEST_URI.spec));
-
- do_print("Run a history query and check that all visits still exist.");
- let query = PlacesUtils.history.getNewQuery();
- let opts = PlacesUtils.history.getNewQueryOptions();
- opts.resultType = opts.RESULTS_AS_VISIT;
- opts.sortingMode = opts.SORT_BY_DATE_DESCENDING;
- let root = PlacesUtils.history.executeQuery(query, opts).root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 10);
- for (let i = 0; i < root.childCount; i++) {
- let visitTime = root.getChild(i).time;
- do_check_eq(visitTime, DB_NOW - 100000 - (i * 1000));
- }
- root.containerOpen = false;
-
- do_print("asyncHistory.isURIVisited should return true.");
- do_check_true(yield promiseIsURIVisited(TEST_URI));
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- do_print("Frecency should be positive.")
- do_check_true(frecencyForUrl(TEST_URI) > 0);
-
- yield cleanup();
-});
-
-add_task(function* remove_visits_outside_bookmarked_uri() {
- do_print("*** TEST: Remove some visits outside valid timeframe from a bookmarked URI");
-
- do_print("Add 10 visits for the URI from way in the past.");
- let visits = [];
- for (let i = 0; i < 10; i++) {
- visits.push({ uri: TEST_URI, visitDate: DB_NOW - 100000 - (i * 1000) });
- }
- yield PlacesTestUtils.addVisits(visits);
- do_print("Bookmark the URI.");
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- TEST_URI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark title");
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("Remove visits using timerange outside the URI's visits.");
- let filter = {
- beginDate: new Date(JS_NOW - 10),
- endDate: new Date(JS_NOW)
- };
- yield PlacesUtils.history.removeVisitsByFilter(filter);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("URI should still exist in moz_places.");
- do_check_true(page_in_database(TEST_URI.spec));
-
- do_print("Run a history query and check that all visits still exist.");
- let query = PlacesUtils.history.getNewQuery();
- let opts = PlacesUtils.history.getNewQueryOptions();
- opts.resultType = opts.RESULTS_AS_VISIT;
- opts.sortingMode = opts.SORT_BY_DATE_DESCENDING;
- let root = PlacesUtils.history.executeQuery(query, opts).root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 10);
- for (let i = 0; i < root.childCount; i++) {
- let visitTime = root.getChild(i).time;
- do_check_eq(visitTime, DB_NOW - 100000 - (i * 1000));
- }
- root.containerOpen = false;
-
- do_print("asyncHistory.isURIVisited should return true.");
- do_check_true(yield promiseIsURIVisited(TEST_URI));
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("Frecency should be positive.")
- do_check_true(frecencyForUrl(TEST_URI) > 0);
-
- yield cleanup();
-});
-
-add_task(function* remove_visits_unbookmarked_uri() {
- do_print("*** TEST: Remove some visits from an unbookmarked URI");
-
- do_print("Add 10 visits for the URI from now to 9 usecs in the past.");
- let visits = [];
- for (let i = 0; i < 10; i++) {
- visits.push({ uri: TEST_URI, visitDate: DB_NOW - (i * 1000) });
- }
- yield PlacesTestUtils.addVisits(visits);
-
- do_print("Remove the 5 most recent visits.");
- let filter = {
- beginDate: new Date(JS_NOW - 4),
- endDate: new Date(JS_NOW)
- };
- yield PlacesUtils.history.removeVisitsByFilter(filter);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("URI should still exist in moz_places.");
- do_check_true(page_in_database(TEST_URI.spec));
-
- do_print("Run a history query and check that only the older 5 visits still exist.");
- let query = PlacesUtils.history.getNewQuery();
- let opts = PlacesUtils.history.getNewQueryOptions();
- opts.resultType = opts.RESULTS_AS_VISIT;
- opts.sortingMode = opts.SORT_BY_DATE_DESCENDING;
- let root = PlacesUtils.history.executeQuery(query, opts).root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 5);
- for (let i = 0; i < root.childCount; i++) {
- let visitTime = root.getChild(i).time;
- do_check_eq(visitTime, DB_NOW - (i * 1000) - 5000);
- }
- root.containerOpen = false;
-
- do_print("asyncHistory.isURIVisited should return true.");
- do_check_true(yield promiseIsURIVisited(TEST_URI));
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("Frecency should be positive.")
- do_check_true(frecencyForUrl(TEST_URI) > 0);
-
- yield cleanup();
-});
-
-add_task(function* remove_visits_bookmarked_uri() {
- do_print("*** TEST: Remove some visits from a bookmarked URI");
-
- do_print("Add 10 visits for the URI from now to 9 usecs in the past.");
- let visits = [];
- for (let i = 0; i < 10; i++) {
- visits.push({ uri: TEST_URI, visitDate: DB_NOW - (i * 1000) });
- }
- yield PlacesTestUtils.addVisits(visits);
- do_print("Bookmark the URI.");
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- TEST_URI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark title");
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("Remove the 5 most recent visits.");
- let filter = {
- beginDate: new Date(JS_NOW - 4),
- endDate: new Date(JS_NOW)
- };
- yield PlacesUtils.history.removeVisitsByFilter(filter);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("URI should still exist in moz_places.");
- do_check_true(page_in_database(TEST_URI.spec));
-
- do_print("Run a history query and check that only the older 5 visits still exist.");
- let query = PlacesUtils.history.getNewQuery();
- let opts = PlacesUtils.history.getNewQueryOptions();
- opts.resultType = opts.RESULTS_AS_VISIT;
- opts.sortingMode = opts.SORT_BY_DATE_DESCENDING;
- let root = PlacesUtils.history.executeQuery(query, opts).root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 5);
- for (let i = 0; i < root.childCount; i++) {
- let visitTime = root.getChild(i).time;
- do_check_eq(visitTime, DB_NOW - (i * 1000) - 5000);
- }
- root.containerOpen = false;
-
- do_print("asyncHistory.isURIVisited should return true.");
- do_check_true(yield promiseIsURIVisited(TEST_URI));
- yield PlacesTestUtils.promiseAsyncUpdates()
-
- do_print("Frecency should be positive.")
- do_check_true(frecencyForUrl(TEST_URI) > 0);
-
- yield cleanup();
-});
-
-add_task(function* remove_all_visits_unbookmarked_uri() {
- do_print("*** TEST: Remove all visits from an unbookmarked URI");
-
- do_print("Add some visits for the URI.");
- let visits = [];
- for (let i = 0; i < 10; i++) {
- visits.push({ uri: TEST_URI, visitDate: DB_NOW - (i * 1000) });
- }
- yield PlacesTestUtils.addVisits(visits);
-
- do_print("Remove all visits.");
- let filter = {
- beginDate: new Date(JS_NOW - 10),
- endDate: new Date(JS_NOW)
- };
- yield PlacesUtils.history.removeVisitsByFilter(filter);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("URI should no longer exist in moz_places.");
- do_check_false(page_in_database(TEST_URI.spec));
-
- do_print("Run a history query and check that no visits exist.");
- let query = PlacesUtils.history.getNewQuery();
- let opts = PlacesUtils.history.getNewQueryOptions();
- opts.resultType = opts.RESULTS_AS_VISIT;
- opts.sortingMode = opts.SORT_BY_DATE_DESCENDING;
- let root = PlacesUtils.history.executeQuery(query, opts).root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 0);
- root.containerOpen = false;
-
- do_print("asyncHistory.isURIVisited should return false.");
- do_check_false(yield promiseIsURIVisited(TEST_URI));
-
- yield cleanup();
-});
-
-add_task(function* remove_all_visits_bookmarked_uri() {
- do_print("*** TEST: Remove all visits from a bookmarked URI");
-
- do_print("Add some visits for the URI.");
- let visits = [];
- for (let i = 0; i < 10; i++) {
- visits.push({ uri: TEST_URI, visitDate: DB_NOW - (i * 1000) });
- }
- yield PlacesTestUtils.addVisits(visits);
- do_print("Bookmark the URI.");
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- TEST_URI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark title");
- yield PlacesTestUtils.promiseAsyncUpdates();
- let initialFrecency = frecencyForUrl(TEST_URI);
-
- do_print("Remove all visits.");
- let filter = {
- beginDate: new Date(JS_NOW - 10),
- endDate: new Date(JS_NOW)
- };
- yield PlacesUtils.history.removeVisitsByFilter(filter);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("URI should still exist in moz_places.");
- do_check_true(page_in_database(TEST_URI.spec));
-
- do_print("Run a history query and check that no visits exist.");
- let query = PlacesUtils.history.getNewQuery();
- let opts = PlacesUtils.history.getNewQueryOptions();
- opts.resultType = opts.RESULTS_AS_VISIT;
- opts.sortingMode = opts.SORT_BY_DATE_DESCENDING;
- let root = PlacesUtils.history.executeQuery(query, opts).root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 0);
- root.containerOpen = false;
-
- do_print("asyncHistory.isURIVisited should return false.");
- do_check_false(yield promiseIsURIVisited(TEST_URI));
-
- do_print("nsINavBookmarksService.isBookmarked should return true.");
- do_check_true(PlacesUtils.bookmarks.isBookmarked(TEST_URI));
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("Frecency should be smaller.")
- do_check_true(frecencyForUrl(TEST_URI) < initialFrecency);
-
- yield cleanup();
-});
-
-add_task(function* remove_all_visits_bookmarked_uri() {
- do_print("*** TEST: Remove some visits from a zero frecency URI retains zero frecency");
-
- do_print("Add some visits for the URI.");
- yield PlacesTestUtils.addVisits([
- { uri: TEST_URI, transition: TRANSITION_FRAMED_LINK, visitDate: (DB_NOW - 86400000000000) },
- { uri: TEST_URI, transition: TRANSITION_FRAMED_LINK, visitDate: DB_NOW }
- ]);
-
- do_print("Remove newer visit.");
- let filter = {
- beginDate: new Date(JS_NOW - 10),
- endDate: new Date(JS_NOW)
- };
- yield PlacesUtils.history.removeVisitsByFilter(filter);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("URI should still exist in moz_places.");
- do_check_true(page_in_database(TEST_URI.spec));
- do_print("Frecency should be zero.")
- do_check_eq(frecencyForUrl(TEST_URI), 0);
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/history/test_removeVisitsByFilter.js b/toolkit/components/places/tests/history/test_removeVisitsByFilter.js
deleted file mode 100644
index 699420e43..000000000
--- a/toolkit/components/places/tests/history/test_removeVisitsByFilter.js
+++ /dev/null
@@ -1,345 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-
-// Tests for `History.removeVisitsByFilter`, as implemented in History.jsm
-
-"use strict";
-
-Cu.importGlobalProperties(["URL"]);
-
-Cu.import("resource://gre/modules/PromiseUtils.jsm", this);
-
-add_task(function* test_removeVisitsByFilter() {
- let referenceDate = new Date(1999, 9, 9, 9, 9);
-
- // Populate a database with 20 entries, remove a subset of entries,
- // ensure consistency.
- let remover = Task.async(function*(options) {
- do_print("Remover with options " + JSON.stringify(options));
- let SAMPLE_SIZE = options.sampleSize;
-
- yield PlacesTestUtils.clearHistory();
- yield PlacesUtils.bookmarks.eraseEverything();
-
- // Populate the database.
- // Create `SAMPLE_SIZE` visits, from the oldest to the newest.
-
- let bookmarkIndices = new Set(options.bookmarks);
- let visits = [];
- let frecencyChangePromises = new Map();
- let uriDeletePromises = new Map();
- let getURL = options.url ?
- i => "http://mozilla.com/test_browserhistory/test_removeVisitsByFilter/removeme/byurl/" + Math.floor(i / (SAMPLE_SIZE / 5)) + "/" :
- i => "http://mozilla.com/test_browserhistory/test_removeVisitsByFilter/removeme/" + i + "/" + Math.random();
- for (let i = 0; i < SAMPLE_SIZE; ++i) {
- let spec = getURL(i);
- let uri = NetUtil.newURI(spec);
- let jsDate = new Date(Number(referenceDate) + 3600 * 1000 * i);
- let dbDate = jsDate * 1000;
- let hasBookmark = bookmarkIndices.has(i);
- let hasOwnBookmark = hasBookmark;
- if (!hasOwnBookmark && options.url) {
- // Also mark as bookmarked if one of the earlier bookmarked items has the same URL.
- hasBookmark =
- options.bookmarks.filter(n => n < i).some(n => visits[n].uri.spec == spec && visits[n].test.hasBookmark);
- }
- do_print("Generating " + uri.spec + ", " + dbDate);
- let visit = {
- uri,
- title: "visit " + i,
- visitDate: dbDate,
- test: {
- // `visitDate`, as a Date
- jsDate: jsDate,
- // `true` if we expect that the visit will be removed
- toRemove: false,
- // `true` if `onRow` informed of the removal of this visit
- announcedByOnRow: false,
- // `true` if there is a bookmark for this URI, i.e. of the page
- // should not be entirely removed.
- hasBookmark: hasBookmark,
- onFrecencyChanged: null,
- onDeleteURI: null,
- },
- };
- visits.push(visit);
- if (hasOwnBookmark) {
- do_print("Adding a bookmark to visit " + i);
- yield PlacesUtils.bookmarks.insert({
- url: uri,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- title: "test bookmark"
- });
- do_print("Bookmark added");
- }
- }
-
- do_print("Adding visits");
- yield PlacesTestUtils.addVisits(visits);
-
- do_print("Preparing filters");
- let filter = {
- };
- let beginIndex = 0;
- let endIndex = visits.length - 1;
- if ("begin" in options) {
- let ms = Number(visits[options.begin].test.jsDate) - 1000;
- filter.beginDate = new Date(ms);
- beginIndex = options.begin;
- }
- if ("end" in options) {
- let ms = Number(visits[options.end].test.jsDate) + 1000;
- filter.endDate = new Date(ms);
- endIndex = options.end;
- }
- if ("limit" in options) {
- endIndex = beginIndex + options.limit - 1; // -1 because the start index is inclusive.
- filter.limit = options.limit;
- }
- let removedItems = visits.slice(beginIndex);
- endIndex -= beginIndex;
- if (options.url) {
- let rawURL = "";
- switch (options.url) {
- case 1:
- filter.url = new URL(removedItems[0].uri.spec);
- rawURL = filter.url.href;
- break;
- case 2:
- filter.url = removedItems[0].uri;
- rawURL = filter.url.spec;
- break;
- case 3:
- filter.url = removedItems[0].uri.spec;
- rawURL = filter.url;
- break;
- }
- endIndex = Math.min(endIndex, removedItems.findIndex((v, index) => v.uri.spec != rawURL) - 1);
- }
- removedItems.splice(endIndex + 1);
- let remainingItems = visits.filter(v => !removedItems.includes(v));
- for (let i = 0; i < removedItems.length; i++) {
- let test = removedItems[i].test;
- do_print("Marking visit " + (beginIndex + i) + " as expecting removal");
- test.toRemove = true;
- if (test.hasBookmark ||
- (options.url && remainingItems.some(v => v.uri.spec == removedItems[i].uri.spec))) {
- frecencyChangePromises.set(removedItems[i].uri.spec, PromiseUtils.defer());
- } else if (!options.url || i == 0) {
- uriDeletePromises.set(removedItems[i].uri.spec, PromiseUtils.defer());
- }
- }
-
- let observer = {
- deferred: PromiseUtils.defer(),
- onBeginUpdateBatch: function() {},
- onEndUpdateBatch: function() {},
- onVisit: function(uri) {
- this.deferred.reject(new Error("Unexpected call to onVisit " + uri.spec));
- },
- onTitleChanged: function(uri) {
- this.deferred.reject(new Error("Unexpected call to onTitleChanged " + uri.spec));
- },
- onClearHistory: function() {
- this.deferred.reject("Unexpected call to onClearHistory");
- },
- onPageChanged: function(uri) {
- this.deferred.reject(new Error("Unexpected call to onPageChanged " + uri.spec));
- },
- onFrecencyChanged: function(aURI) {
- do_print("onFrecencyChanged " + aURI.spec);
- let deferred = frecencyChangePromises.get(aURI.spec);
- Assert.ok(!!deferred, "Observing onFrecencyChanged");
- deferred.resolve();
- },
- onManyFrecenciesChanged: function() {
- do_print("Many frecencies changed");
- for (let [, deferred] of frecencyChangePromises) {
- deferred.resolve();
- }
- },
- onDeleteURI: function(aURI) {
- do_print("onDeleteURI " + aURI.spec);
- let deferred = uriDeletePromises.get(aURI.spec);
- Assert.ok(!!deferred, "Observing onDeleteURI");
- deferred.resolve();
- },
- onDeleteVisits: function(aURI) {
- // Not sure we can test anything.
- }
- };
- PlacesUtils.history.addObserver(observer, false);
-
- let cbarg;
- if (options.useCallback) {
- do_print("Setting up callback");
- cbarg = [info => {
- for (let visit of visits) {
- do_print("Comparing " + info.date + " and " + visit.test.jsDate);
- if (Math.abs(visit.test.jsDate - info.date) < 100) { // Assume rounding errors
- Assert.ok(!visit.test.announcedByOnRow,
- "This is the first time we announce the removal of this visit");
- Assert.ok(visit.test.toRemove,
- "This is a visit we intended to remove");
- visit.test.announcedByOnRow = true;
- return;
- }
- }
- Assert.ok(false, "Could not find the visit we attempt to remove");
- }];
- } else {
- do_print("No callback");
- cbarg = [];
- }
- let result = yield PlacesUtils.history.removeVisitsByFilter(filter, ...cbarg);
-
- Assert.ok(result, "Removal succeeded");
-
- // Make sure that we have eliminated exactly the entries we expected
- // to eliminate.
- for (let i = 0; i < visits.length; ++i) {
- let visit = visits[i];
- do_print("Controlling the results on visit " + i);
- let remainingVisitsForURI = remainingItems.filter(v => visit.uri.spec == v.uri.spec).length;
- Assert.equal(
- visits_in_database(visit.uri),
- remainingVisitsForURI,
- "Visit is still present iff expected");
- if (options.useCallback) {
- Assert.equal(
- visit.test.toRemove,
- visit.test.announcedByOnRow,
- "Visit removal has been announced by onResult iff expected");
- }
- if (visit.test.hasBookmark || remainingVisitsForURI) {
- Assert.notEqual(page_in_database(visit.uri), 0, "The page should still appear in the db");
- } else {
- Assert.equal(page_in_database(visit.uri), 0, "The page should have been removed from the db");
- }
- }
-
- // Make sure that the observer has been called wherever applicable.
- do_print("Checking URI delete promises.");
- yield Promise.all(Array.from(uriDeletePromises.values()));
- do_print("Checking frecency change promises.");
- yield Promise.all(Array.from(frecencyChangePromises.values()));
- PlacesUtils.history.removeObserver(observer);
- });
-
- let size = 20;
- for (let range of [
- {begin: 0},
- {end: 19},
- {begin: 0, end: 10},
- {begin: 3, end: 4},
- {begin: 5, end: 8, limit: 2},
- {begin: 10, end: 18, limit: 5},
- ]) {
- for (let bookmarks of [[], [5, 6]]) {
- let options = {
- sampleSize: size,
- bookmarks: bookmarks,
- };
- if ("begin" in range) {
- options.begin = range.begin;
- }
- if ("end" in range) {
- options.end = range.end;
- }
- if ("limit" in range) {
- options.limit = range.limit;
- }
- yield remover(options);
- options.url = 1;
- yield remover(options);
- options.url = 2;
- yield remover(options);
- options.url = 3;
- yield remover(options);
- }
- }
- yield PlacesTestUtils.clearHistory();
-});
-
-// Test the various error cases
-add_task(function* test_error_cases() {
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter(),
- /TypeError: Expected a filter/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter("obviously, not a filter"),
- /TypeError: Expected a filter/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter({}),
- /TypeError: Expected a non-empty filter/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter({beginDate: "now"}),
- /TypeError: Expected a Date/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter({beginDate: Date.now()}),
- /TypeError: Expected a Date/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter({beginDate: new Date()}, "obviously, not a callback"),
- /TypeError: Invalid function/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter({beginDate: new Date(1000), endDate: new Date(0)}),
- /TypeError: `beginDate` should be at least as old/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter({limit: {}}),
- /Expected a non-zero positive integer as a limit/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter({limit: -1}),
- /Expected a non-zero positive integer as a limit/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter({limit: 0.1}),
- /Expected a non-zero positive integer as a limit/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter({limit: Infinity}),
- /Expected a non-zero positive integer as a limit/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter({url: {}}),
- /Expected a valid URL for `url`/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter({url: 0}),
- /Expected a valid URL for `url`/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter({beginDate: new Date(1000), endDate: new Date(0)}),
- /TypeError: `beginDate` should be at least as old/
- );
- Assert.throws(
- () => PlacesUtils.history.removeVisitsByFilter({beginDate: new Date(1000), endDate: new Date(0)}),
- /TypeError: `beginDate` should be at least as old/
- );
-});
-
-add_task(function* test_orphans() {
- let uri = NetUtil.newURI("http://moz.org/");
- yield PlacesTestUtils.addVisits({ uri });
-
- PlacesUtils.favicons.setAndFetchFaviconForPage(
- uri, SMALLPNG_DATA_URI, true, PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- null, Services.scriptSecurityManager.getSystemPrincipal());
- PlacesUtils.annotations.setPageAnnotation(uri, "test", "restval", 0,
- PlacesUtils.annotations.EXPIRE_NEVER);
-
- yield PlacesUtils.history.removeVisitsByFilter({ beginDate: new Date(1999, 9, 9, 9, 9),
- endDate: new Date() });
- Assert.ok(!(yield PlacesTestUtils.isPageInDB(uri)), "Page should have been removed");
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.execute(`SELECT (SELECT count(*) FROM moz_annos) +
- (SELECT count(*) FROM moz_favicons) AS count`);
- Assert.equal(rows[0].getResultByName("count"), 0, "Should not find orphans");
-});
diff --git a/toolkit/components/places/tests/history/test_updatePlaces_sameUri_titleChanged.js b/toolkit/components/places/tests/history/test_updatePlaces_sameUri_titleChanged.js
deleted file mode 100644
index 832df9d9a..000000000
--- a/toolkit/components/places/tests/history/test_updatePlaces_sameUri_titleChanged.js
+++ /dev/null
@@ -1,52 +0,0 @@
-// Test that repeated additions of the same URI through updatePlaces, properly
-// update from_visit and notify titleChanged.
-
-add_task(function* test() {
- let uri = "http://test.com/";
-
- let promiseTitleChangedNotifications = new Promise(resolve => {
- let historyObserver = {
- _count: 0,
- __proto__: NavHistoryObserver.prototype,
- onTitleChanged(aURI, aTitle, aGUID) {
- Assert.equal(aURI.spec, uri, "Should notify the proper url");
- if (++this._count == 2) {
- PlacesUtils.history.removeObserver(historyObserver);
- resolve();
- }
- }
- };
- PlacesUtils.history.addObserver(historyObserver, false);
- });
-
- // This repeats the url on purpose, don't merge it into a single place entry.
- yield PlacesTestUtils.addVisits([
- { uri, title: "test" },
- { uri, referrer: uri, title: "test2" },
- ]);
-
- let options = PlacesUtils.history.getNewQueryOptions();
- let query = PlacesUtils.history.getNewQuery();
- query.uri = NetUtil.newURI(uri);
- options.resultType = options.RESULTS_AS_VISIT;
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
-
- Assert.equal(root.childCount, 2);
-
- let child = root.getChild(0);
- Assert.equal(child.visitType, TRANSITION_LINK, "Visit type should be TRANSITION_LINK");
- Assert.equal(child.visitId, 1, "Visit ID should be 1");
- Assert.equal(child.fromVisitId, -1, "Should have no referrer visit ID");
- Assert.equal(child.title, "test2", "Should have the correct title");
-
- child = root.getChild(1);
- Assert.equal(child.visitType, TRANSITION_LINK, "Visit type should be TRANSITION_LINK");
- Assert.equal(child.visitId, 2, "Visit ID should be 2");
- Assert.equal(child.fromVisitId, 1, "First visit should be the referring visit");
- Assert.equal(child.title, "test2", "Should have the correct title");
-
- root.containerOpen = false;
-
- yield promiseTitleChangedNotifications;
-});
diff --git a/toolkit/components/places/tests/history/xpcshell.ini b/toolkit/components/places/tests/history/xpcshell.ini
deleted file mode 100644
index ee182e090..000000000
--- a/toolkit/components/places/tests/history/xpcshell.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[DEFAULT]
-head = head_history.js
-tail =
-
-[test_insert.js]
-[test_remove.js]
-[test_removeVisits.js]
-[test_removeVisitsByFilter.js]
-[test_updatePlaces_sameUri_titleChanged.js]
diff --git a/toolkit/components/places/tests/migration/.eslintrc.js b/toolkit/components/places/tests/migration/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/places/tests/migration/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/places/tests/migration/head_migration.js b/toolkit/components/places/tests/migration/head_migration.js
deleted file mode 100644
index 1ebecd4c0..000000000
--- a/toolkit/components/places/tests/migration/head_migration.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict"
-
-var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-// Import common head.
-{
- let commonFile = do_get_file("../head_common.js", false);
- let uri = Services.io.newFileURI(commonFile);
- Services.scriptloader.loadSubScript(uri.spec, this);
-}
-
-// Put any other stuff relative to this test folder below.
-
-const DB_FILENAME = "places.sqlite";
-
-/**
- * Sets the database to use for the given test. This should be the very first
- * thing in the test, otherwise this database will not be used!
- *
- * @param aFileName
- * The filename of the database to use. This database must exist in
- * toolkit/components/places/tests/migration!
- * @return {Promise}
- */
-var setupPlacesDatabase = Task.async(function* (aFileName) {
- let currentDir = yield OS.File.getCurrentDirectory();
-
- let src = OS.Path.join(currentDir, aFileName);
- Assert.ok((yield OS.File.exists(src)), "Database file found");
-
- // Ensure that our database doesn't already exist.
- let dest = OS.Path.join(OS.Constants.Path.profileDir, DB_FILENAME);
- Assert.ok(!(yield OS.File.exists(dest)), "Database file should not exist yet");
-
- yield OS.File.copy(src, dest);
-});
-
-// This works provided all tests in this folder use add_task.
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/migration/places_v10.sqlite b/toolkit/components/places/tests/migration/places_v10.sqlite
deleted file mode 100644
index 80a8ecd6a..000000000
--- a/toolkit/components/places/tests/migration/places_v10.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v11.sqlite b/toolkit/components/places/tests/migration/places_v11.sqlite
deleted file mode 100644
index bef27d5f5..000000000
--- a/toolkit/components/places/tests/migration/places_v11.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v17.sqlite b/toolkit/components/places/tests/migration/places_v17.sqlite
deleted file mode 100644
index 5183cde83..000000000
--- a/toolkit/components/places/tests/migration/places_v17.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v19.sqlite b/toolkit/components/places/tests/migration/places_v19.sqlite
deleted file mode 100644
index 11e2e6247..000000000
--- a/toolkit/components/places/tests/migration/places_v19.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v21.sqlite b/toolkit/components/places/tests/migration/places_v21.sqlite
deleted file mode 100644
index f72930826..000000000
--- a/toolkit/components/places/tests/migration/places_v21.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v22.sqlite b/toolkit/components/places/tests/migration/places_v22.sqlite
deleted file mode 100644
index 30bf840b0..000000000
--- a/toolkit/components/places/tests/migration/places_v22.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v23.sqlite b/toolkit/components/places/tests/migration/places_v23.sqlite
deleted file mode 100644
index b519b97d2..000000000
--- a/toolkit/components/places/tests/migration/places_v23.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v24.sqlite b/toolkit/components/places/tests/migration/places_v24.sqlite
deleted file mode 100644
index b35f958a6..000000000
--- a/toolkit/components/places/tests/migration/places_v24.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v25.sqlite b/toolkit/components/places/tests/migration/places_v25.sqlite
deleted file mode 100644
index 2afd1da1f..000000000
--- a/toolkit/components/places/tests/migration/places_v25.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v26.sqlite b/toolkit/components/places/tests/migration/places_v26.sqlite
deleted file mode 100644
index b4b238179..000000000
--- a/toolkit/components/places/tests/migration/places_v26.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v27.sqlite b/toolkit/components/places/tests/migration/places_v27.sqlite
deleted file mode 100644
index 57dfb7562..000000000
--- a/toolkit/components/places/tests/migration/places_v27.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v28.sqlite b/toolkit/components/places/tests/migration/places_v28.sqlite
deleted file mode 100644
index 9a27db324..000000000
--- a/toolkit/components/places/tests/migration/places_v28.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v29.sqlite b/toolkit/components/places/tests/migration/places_v29.sqlite
deleted file mode 100644
index f6de0fe8a..000000000
--- a/toolkit/components/places/tests/migration/places_v29.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v30.sqlite b/toolkit/components/places/tests/migration/places_v30.sqlite
deleted file mode 100644
index 9cbabe005..000000000
--- a/toolkit/components/places/tests/migration/places_v30.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v31.sqlite b/toolkit/components/places/tests/migration/places_v31.sqlite
deleted file mode 100644
index 9d33b9eff..000000000
--- a/toolkit/components/places/tests/migration/places_v31.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v32.sqlite b/toolkit/components/places/tests/migration/places_v32.sqlite
deleted file mode 100644
index 239f6c5fe..000000000
--- a/toolkit/components/places/tests/migration/places_v32.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v33.sqlite b/toolkit/components/places/tests/migration/places_v33.sqlite
deleted file mode 100644
index 6071dc6a6..000000000
--- a/toolkit/components/places/tests/migration/places_v33.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v34.sqlite b/toolkit/components/places/tests/migration/places_v34.sqlite
deleted file mode 100644
index 474628996..000000000
--- a/toolkit/components/places/tests/migration/places_v34.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v35.sqlite b/toolkit/components/places/tests/migration/places_v35.sqlite
deleted file mode 100644
index 5e157d778..000000000
--- a/toolkit/components/places/tests/migration/places_v35.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/places_v6.sqlite b/toolkit/components/places/tests/migration/places_v6.sqlite
deleted file mode 100644
index 2852a4cf9..000000000
--- a/toolkit/components/places/tests/migration/places_v6.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/migration/test_current_from_downgraded.js b/toolkit/components/places/tests/migration/test_current_from_downgraded.js
deleted file mode 100644
index 6d36cab14..000000000
--- a/toolkit/components/places/tests/migration/test_current_from_downgraded.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* setup() {
- yield setupPlacesDatabase(`places_v${CURRENT_SCHEMA_VERSION}.sqlite`);
- // Downgrade the schema version to the first supported one.
- let path = OS.Path.join(OS.Constants.Path.profileDir, DB_FILENAME);
- let db = yield Sqlite.openConnection({ path: path });
- yield db.setSchemaVersion(FIRST_UPGRADABLE_SCHEMA_VERSION);
- yield db.close();
-});
-
-add_task(function* database_is_valid() {
- Assert.equal(PlacesUtils.history.databaseStatus,
- PlacesUtils.history.DATABASE_STATUS_UPGRADED);
-
- let db = yield PlacesUtils.promiseDBConnection();
- Assert.equal((yield db.getSchemaVersion()), CURRENT_SCHEMA_VERSION);
-});
diff --git a/toolkit/components/places/tests/migration/test_current_from_v11.js b/toolkit/components/places/tests/migration/test_current_from_v11.js
deleted file mode 100644
index 43b8fb1f6..000000000
--- a/toolkit/components/places/tests/migration/test_current_from_v11.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* setup() {
- yield setupPlacesDatabase("places_v11.sqlite");
-});
-
-add_task(function* database_is_valid() {
- Assert.equal(PlacesUtils.history.databaseStatus,
- PlacesUtils.history.DATABASE_STATUS_UPGRADED);
-
- let db = yield PlacesUtils.promiseDBConnection();
- Assert.equal((yield db.getSchemaVersion()), CURRENT_SCHEMA_VERSION);
-});
-
-add_task(function* test_moz_hosts() {
- let db = yield PlacesUtils.promiseDBConnection();
-
- // This will throw if the column does not exist.
- yield db.execute("SELECT host, frecency, typed, prefix FROM moz_hosts");
-
- // moz_hosts is populated asynchronously, so we need to wait.
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- // check the number of entries in moz_hosts equals the number of
- // unique rev_host in moz_places
- let rows = yield db.execute(
- `SELECT (SELECT COUNT(host) FROM moz_hosts),
- (SELECT COUNT(DISTINCT rev_host)
- FROM moz_places
- WHERE LENGTH(rev_host) > 1)
- `);
-
- Assert.equal(rows.length, 1);
- let mozHostsCount = rows[0].getResultByIndex(0);
- let mozPlacesCount = rows[0].getResultByIndex(1);
-
- Assert.ok(mozPlacesCount > 0, "There is some url in the database");
- Assert.equal(mozPlacesCount, mozHostsCount, "moz_hosts has the expected number of entries");
-});
-
-add_task(function* test_journal() {
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.execute("PRAGMA journal_mode");
- Assert.equal(rows.length, 1);
- // WAL journal mode should be set on this database.
- Assert.equal(rows[0].getResultByIndex(0), "wal");
-});
diff --git a/toolkit/components/places/tests/migration/test_current_from_v19.js b/toolkit/components/places/tests/migration/test_current_from_v19.js
deleted file mode 100644
index b8d837e68..000000000
--- a/toolkit/components/places/tests/migration/test_current_from_v19.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-const ANNO_LEGACYGUID = "placesInternal/GUID";
-
-var getTotalGuidAnnotationsCount = Task.async(function* (db) {
- let rows = yield db.execute(
- `SELECT count(*)
- FROM moz_items_annos a
- JOIN moz_anno_attributes b ON a.anno_attribute_id = b.id
- WHERE b.name = :attr_name
- `, { attr_name: ANNO_LEGACYGUID });
- return rows[0].getResultByIndex(0);
-});
-
-add_task(function* setup() {
- yield setupPlacesDatabase("places_v19.sqlite");
-});
-
-add_task(function* initial_state() {
- let path = OS.Path.join(OS.Constants.Path.profileDir, DB_FILENAME);
- let db = yield Sqlite.openConnection({ path: path });
-
- Assert.equal((yield getTotalGuidAnnotationsCount(db)), 1,
- "There should be 1 obsolete guid annotation");
- yield db.close();
-});
-
-add_task(function* database_is_valid() {
- Assert.equal(PlacesUtils.history.databaseStatus,
- PlacesUtils.history.DATABASE_STATUS_UPGRADED);
-
- let db = yield PlacesUtils.promiseDBConnection();
- Assert.equal((yield db.getSchemaVersion()), CURRENT_SCHEMA_VERSION);
-});
-
-add_task(function* test_bookmark_guid_annotation_removed()
-{
- let db = yield PlacesUtils.promiseDBConnection();
- Assert.equal((yield getTotalGuidAnnotationsCount(db)), 0,
- "There should be no more obsolete GUID annotations.");
-});
diff --git a/toolkit/components/places/tests/migration/test_current_from_v24.js b/toolkit/components/places/tests/migration/test_current_from_v24.js
deleted file mode 100644
index 0561b4922..000000000
--- a/toolkit/components/places/tests/migration/test_current_from_v24.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* setup() {
- yield setupPlacesDatabase("places_v24.sqlite");
-});
-
-add_task(function* database_is_valid() {
- Assert.equal(PlacesUtils.history.databaseStatus,
- PlacesUtils.history.DATABASE_STATUS_UPGRADED);
-
- let db = yield PlacesUtils.promiseDBConnection();
- Assert.equal((yield db.getSchemaVersion()), CURRENT_SCHEMA_VERSION);
-});
-
-add_task(function* test_bookmark_guid_annotation_removed()
-{
- yield PlacesUtils.bookmarks.eraseEverything();
-
- let db = yield PlacesUtils.promiseDBConnection();
- let m = new Map([
- [PlacesUtils.placesRootId, PlacesUtils.bookmarks.rootGuid],
- [PlacesUtils.bookmarksMenuFolderId, PlacesUtils.bookmarks.menuGuid],
- [PlacesUtils.toolbarFolderId, PlacesUtils.bookmarks.toolbarGuid],
- [PlacesUtils.unfiledBookmarksFolderId, PlacesUtils.bookmarks.unfiledGuid],
- [PlacesUtils.tagsFolderId, PlacesUtils.bookmarks.tagsGuid],
- [PlacesUtils.mobileFolderId, PlacesUtils.bookmarks.mobileGuid],
- ]);
-
- let rows = yield db.execute(`SELECT id, guid FROM moz_bookmarks`);
- for (let row of rows) {
- let id = row.getResultByName("id");
- let guid = row.getResultByName("guid");
- Assert.equal(m.get(id), guid, "The root folder has the correct GUID");
- }
-});
diff --git a/toolkit/components/places/tests/migration/test_current_from_v25.js b/toolkit/components/places/tests/migration/test_current_from_v25.js
deleted file mode 100644
index b066975fc..000000000
--- a/toolkit/components/places/tests/migration/test_current_from_v25.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* setup() {
- yield setupPlacesDatabase("places_v25.sqlite");
-});
-
-add_task(function* database_is_valid() {
- Assert.equal(PlacesUtils.history.databaseStatus,
- PlacesUtils.history.DATABASE_STATUS_UPGRADED);
-
- let db = yield PlacesUtils.promiseDBConnection();
- Assert.equal((yield db.getSchemaVersion()), CURRENT_SCHEMA_VERSION);
-});
-
-add_task(function* test_dates_rounded() {
- let root = yield PlacesUtils.promiseBookmarksTree();
- function ensureDates(node) {
- // When/if promiseBookmarksTree returns these as Date objects, switch this
- // test to use getItemDateAdded and getItemLastModified. And when these
- // methods are removed, this test can be eliminated altogether.
- Assert.strictEqual(typeof(node.dateAdded), "number");
- Assert.strictEqual(typeof(node.lastModified), "number");
- Assert.strictEqual(node.dateAdded % 1000, 0);
- Assert.strictEqual(node.lastModified % 1000, 0);
- if ("children" in node)
- node.children.forEach(ensureDates);
- }
- ensureDates(root);
-});
diff --git a/toolkit/components/places/tests/migration/test_current_from_v26.js b/toolkit/components/places/tests/migration/test_current_from_v26.js
deleted file mode 100644
index 7ff4bc352..000000000
--- a/toolkit/components/places/tests/migration/test_current_from_v26.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* setup() {
- yield setupPlacesDatabase("places_v26.sqlite");
- // Setup database contents to be migrated.
- let path = OS.Path.join(OS.Constants.Path.profileDir, DB_FILENAME);
- let db = yield Sqlite.openConnection({ path });
- // Add pages.
- yield db.execute(`INSERT INTO moz_places (url, guid)
- VALUES ("http://test1.com/", "test1_______")
- , ("http://test2.com/", "test2_______")
- , ("http://test3.com/", "test3_______")
- `);
- // Add keywords.
- yield db.execute(`INSERT INTO moz_keywords (keyword)
- VALUES ("kw1")
- , ("kw2")
- , ("kw3")
- , ("kw4")
- , ("kw5")
- `);
- // Add bookmarks.
- let now = Date.now() * 1000;
- let index = 0;
- yield db.execute(`INSERT INTO moz_bookmarks (type, fk, parent, position, dateAdded, lastModified, keyword_id, guid)
- VALUES (1, (SELECT id FROM moz_places WHERE guid = 'test1_______'), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = 'kw1'), "bookmark1___")
- /* same uri, different keyword */
- , (1, (SELECT id FROM moz_places WHERE guid = 'test1_______'), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = 'kw2'), "bookmark2___")
- /* different uri, same keyword as 1 */
- , (1, (SELECT id FROM moz_places WHERE guid = 'test2_______'), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = 'kw1'), "bookmark3___")
- /* same uri, same keyword as 1 */
- , (1, (SELECT id FROM moz_places WHERE guid = 'test1_______'), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = 'kw1'), "bookmark4___")
- /* same uri, same keyword as 2 */
- , (1, (SELECT id FROM moz_places WHERE guid = 'test2_______'), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = 'kw2'), "bookmark5___")
- /* different uri, same keyword as 1 */
- , (1, (SELECT id FROM moz_places WHERE guid = 'test1_______'), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = 'kw3'), "bookmark6___")
- , (1, (SELECT id FROM moz_places WHERE guid = 'test3_______'), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = 'kw4'), "bookmark7___")
- /* same uri and post_data as bookmark7, different keyword */
- , (1, (SELECT id FROM moz_places WHERE guid = 'test3_______'), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = 'kw5'), "bookmark8___")
- `);
- // Add postData.
- yield db.execute(`INSERT INTO moz_anno_attributes (name)
- VALUES ("bookmarkProperties/POSTData")
- , ("someOtherAnno")`);
- yield db.execute(`INSERT INTO moz_items_annos(anno_attribute_id, item_id, content)
- VALUES ((SELECT id FROM moz_anno_attributes where name = "bookmarkProperties/POSTData"),
- (SELECT id FROM moz_bookmarks WHERE guid = "bookmark3___"), "postData1")
- , ((SELECT id FROM moz_anno_attributes where name = "bookmarkProperties/POSTData"),
- (SELECT id FROM moz_bookmarks WHERE guid = "bookmark5___"), "postData2")
- , ((SELECT id FROM moz_anno_attributes where name = "someOtherAnno"),
- (SELECT id FROM moz_bookmarks WHERE guid = "bookmark5___"), "zzzzzzzzzz")
- , ((SELECT id FROM moz_anno_attributes where name = "bookmarkProperties/POSTData"),
- (SELECT id FROM moz_bookmarks WHERE guid = "bookmark7___"), "postData3")
- , ((SELECT id FROM moz_anno_attributes where name = "bookmarkProperties/POSTData"),
- (SELECT id FROM moz_bookmarks WHERE guid = "bookmark8___"), "postData3")
- `);
- yield db.close();
-});
-
-add_task(function* database_is_valid() {
- Assert.equal(PlacesUtils.history.databaseStatus,
- PlacesUtils.history.DATABASE_STATUS_UPGRADED);
-
- let db = yield PlacesUtils.promiseDBConnection();
- Assert.equal((yield db.getSchemaVersion()), CURRENT_SCHEMA_VERSION);
-});
-
-add_task(function* test_keywords() {
- // When 2 urls have the same keyword, if one has postData it will be
- // preferred.
- let entry1 = yield PlacesUtils.keywords.fetch("kw1");
- Assert.equal(entry1.url.href, "http://test2.com/");
- Assert.equal(entry1.postData, "postData1");
- let entry2 = yield PlacesUtils.keywords.fetch("kw2");
- Assert.equal(entry2.url.href, "http://test2.com/");
- Assert.equal(entry2.postData, "postData2");
- let entry3 = yield PlacesUtils.keywords.fetch("kw3");
- Assert.equal(entry3.url.href, "http://test1.com/");
- Assert.equal(entry3.postData, null);
- let entry4 = yield PlacesUtils.keywords.fetch("kw4");
- Assert.equal(entry4, null);
- let entry5 = yield PlacesUtils.keywords.fetch("kw5");
- Assert.equal(entry5.url.href, "http://test3.com/");
- Assert.equal(entry5.postData, "postData3");
-
- Assert.equal((yield foreign_count("http://test1.com/")), 5); // 4 bookmark2 + 1 keywords
- Assert.equal((yield foreign_count("http://test2.com/")), 4); // 2 bookmark2 + 2 keywords
- Assert.equal((yield foreign_count("http://test3.com/")), 3); // 2 bookmark2 + 1 keywords
-});
diff --git a/toolkit/components/places/tests/migration/test_current_from_v27.js b/toolkit/components/places/tests/migration/test_current_from_v27.js
deleted file mode 100644
index 1675901eb..000000000
--- a/toolkit/components/places/tests/migration/test_current_from_v27.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* setup() {
- yield setupPlacesDatabase("places_v27.sqlite");
- // Setup database contents to be migrated.
- let path = OS.Path.join(OS.Constants.Path.profileDir, DB_FILENAME);
- let db = yield Sqlite.openConnection({ path });
- // Add pages.
- yield db.execute(`INSERT INTO moz_places (url, guid)
- VALUES ("http://test1.com/", "test1_______")
- , ("http://test2.com/", "test2_______")
- `);
- // Add keywords.
- yield db.execute(`INSERT INTO moz_keywords (keyword, place_id, post_data)
- VALUES ("kw1", (SELECT id FROM moz_places WHERE guid = "test2_______"), "broken data")
- , ("kw2", (SELECT id FROM moz_places WHERE guid = "test2_______"), NULL)
- , ("kw3", (SELECT id FROM moz_places WHERE guid = "test1_______"), "zzzzzzzzzz")
- `);
- // Add bookmarks.
- let now = Date.now() * 1000;
- let index = 0;
- yield db.execute(`INSERT INTO moz_bookmarks (type, fk, parent, position, dateAdded, lastModified, keyword_id, guid)
- VALUES (1, (SELECT id FROM moz_places WHERE guid = "test1_______"), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = "kw1"), "bookmark1___")
- /* same uri, different keyword */
- , (1, (SELECT id FROM moz_places WHERE guid = "test1_______"), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = "kw2"), "bookmark2___")
- /* different uri, same keyword as 1 */
- , (1, (SELECT id FROM moz_places WHERE guid = "test2_______"), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = "kw1"), "bookmark3___")
- /* same uri, same keyword as 1 */
- , (1, (SELECT id FROM moz_places WHERE guid = "test1_______"), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = "kw1"), "bookmark4___")
- /* same uri, same keyword as 2 */
- , (1, (SELECT id FROM moz_places WHERE guid = "test2_______"), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = "kw2"), "bookmark5___")
- /* different uri, same keyword as 1 */
- , (1, (SELECT id FROM moz_places WHERE guid = "test1_______"), 3, ${index++}, ${now}, ${now},
- (SELECT id FROM moz_keywords WHERE keyword = "kw3"), "bookmark6___")
- `);
- // Add postData.
- yield db.execute(`INSERT INTO moz_anno_attributes (name)
- VALUES ("bookmarkProperties/POSTData")
- , ("someOtherAnno")`);
- yield db.execute(`INSERT INTO moz_items_annos(anno_attribute_id, item_id, content)
- VALUES ((SELECT id FROM moz_anno_attributes where name = "bookmarkProperties/POSTData"),
- (SELECT id FROM moz_bookmarks WHERE guid = "bookmark3___"), "postData1")
- , ((SELECT id FROM moz_anno_attributes where name = "bookmarkProperties/POSTData"),
- (SELECT id FROM moz_bookmarks WHERE guid = "bookmark5___"), "postData2")
- , ((SELECT id FROM moz_anno_attributes where name = "someOtherAnno"),
- (SELECT id FROM moz_bookmarks WHERE guid = "bookmark5___"), "zzzzzzzzzz")
- `);
- yield db.close();
-});
-
-add_task(function* database_is_valid() {
- Assert.equal(PlacesUtils.history.databaseStatus,
- PlacesUtils.history.DATABASE_STATUS_UPGRADED);
-
- let db = yield PlacesUtils.promiseDBConnection();
- Assert.equal((yield db.getSchemaVersion()), CURRENT_SCHEMA_VERSION);
-});
-
-add_task(function* test_keywords() {
- // When 2 urls have the same keyword, if one has postData it will be
- // preferred.
- let entry1 = yield PlacesUtils.keywords.fetch("kw1");
- Assert.equal(entry1.url.href, "http://test2.com/");
- Assert.equal(entry1.postData, "postData1");
- let entry2 = yield PlacesUtils.keywords.fetch("kw2");
- Assert.equal(entry2.url.href, "http://test2.com/");
- Assert.equal(entry2.postData, "postData2");
- let entry3 = yield PlacesUtils.keywords.fetch("kw3");
- Assert.equal(entry3.url.href, "http://test1.com/");
- Assert.equal(entry3.postData, null);
-});
diff --git a/toolkit/components/places/tests/migration/test_current_from_v31.js b/toolkit/components/places/tests/migration/test_current_from_v31.js
deleted file mode 100644
index 6b9131daa..000000000
--- a/toolkit/components/places/tests/migration/test_current_from_v31.js
+++ /dev/null
@@ -1,46 +0,0 @@
-// Add pages.
-let shorturl = "http://example.com/" + "a".repeat(1981);
-let longurl = "http://example.com/" + "a".repeat(1982);
-let bmurl = "http://example.com/" + "a".repeat(1983);
-
-add_task(function* setup() {
- yield setupPlacesDatabase("places_v31.sqlite");
- // Setup database contents to be migrated.
- let path = OS.Path.join(OS.Constants.Path.profileDir, DB_FILENAME);
- let db = yield Sqlite.openConnection({ path });
-
- yield db.execute(`INSERT INTO moz_places (url, guid, foreign_count)
- VALUES (:shorturl, "test1_______", 0)
- , (:longurl, "test2_______", 0)
- , (:bmurl, "test3_______", 1)
- `, { shorturl, longurl, bmurl });
- // Add visits.
- yield db.execute(`INSERT INTO moz_historyvisits (place_id)
- VALUES ((SELECT id FROM moz_places WHERE url = :shorturl))
- , ((SELECT id FROM moz_places WHERE url = :longurl))
- `, { shorturl, longurl });
- yield db.close();
-});
-
-add_task(function* database_is_valid() {
- Assert.equal(PlacesUtils.history.databaseStatus,
- PlacesUtils.history.DATABASE_STATUS_UPGRADED);
-
- let db = yield PlacesUtils.promiseDBConnection();
- Assert.equal((yield db.getSchemaVersion()), CURRENT_SCHEMA_VERSION);
-});
-
-add_task(function* test_longurls() {
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.execute(`SELECT 1 FROM moz_places where url = :longurl`,
- { longurl });
- Assert.equal(rows.length, 0, "Long url should have been removed");
- rows = yield db.execute(`SELECT 1 FROM moz_places where url = :shorturl`,
- { shorturl });
- Assert.equal(rows.length, 1, "Short url should have been retained");
- rows = yield db.execute(`SELECT 1 FROM moz_places where url = :bmurl`,
- { bmurl });
- Assert.equal(rows.length, 1, "Bookmarked url should have been retained");
- rows = yield db.execute(`SELECT count(*) FROM moz_historyvisits`);
- Assert.equal(rows.length, 1, "Orphan visists should have been removed");
-});
diff --git a/toolkit/components/places/tests/migration/test_current_from_v34.js b/toolkit/components/places/tests/migration/test_current_from_v34.js
deleted file mode 100644
index 115bcec67..000000000
--- a/toolkit/components/places/tests/migration/test_current_from_v34.js
+++ /dev/null
@@ -1,141 +0,0 @@
-Cu.importGlobalProperties(["URL", "crypto"]);
-
-const { TYPE_BOOKMARK, TYPE_FOLDER } = Ci.nsINavBookmarksService;
-const { EXPIRE_NEVER, TYPE_INT32 } = Ci.nsIAnnotationService;
-
-function makeGuid() {
- return ChromeUtils.base64URLEncode(crypto.getRandomValues(new Uint8Array(9)), {
- pad: false,
- });
-}
-
-// These queries are more or less copied directly from Bookmarks.jsm, but
-// operate on the old, pre-migration DB. We can't use any of the Places SQL
-// functions yet, because those are only registered for the main connection.
-function* insertItem(db, info) {
- let [parentInfo] = yield db.execute(`
- SELECT b.id, (SELECT count(*) FROM moz_bookmarks
- WHERE parent = b.id) AS childCount
- FROM moz_bookmarks b
- WHERE b.guid = :parentGuid`,
- { parentGuid: info.parentGuid });
-
- let guid = makeGuid();
- yield db.execute(`
- INSERT INTO moz_bookmarks (fk, type, parent, position, guid)
- VALUES ((SELECT id FROM moz_places WHERE url = :url),
- :type, :parent, :position, :guid)`,
- { url: info.url || "nonexistent", type: info.type, guid,
- // Just append items.
- position: parentInfo.getResultByName("childCount"),
- parent: parentInfo.getResultByName("id") });
-
- let id = (yield db.execute(`
- SELECT id FROM moz_bookmarks WHERE guid = :guid LIMIT 1`,
- { guid }))[0].getResultByName("id");
-
- return { id, guid };
-}
-
-function insertBookmark(db, info) {
- return db.executeTransaction(function* () {
- if (info.type == TYPE_BOOKMARK) {
- // We don't have access to the hash function here, so we omit the
- // `url_hash` column. These will be fixed up automatically during
- // migration.
- let url = new URL(info.url);
- let placeGuid = makeGuid();
- yield db.execute(`
- INSERT INTO moz_places (url, rev_host, hidden, frecency, guid)
- VALUES (:url, :rev_host, 0, -1, :guid)`,
- { url: url.href, guid: placeGuid,
- rev_host: PlacesUtils.getReversedHost(url) });
- }
- return yield* insertItem(db, info);
- });
-}
-
-function* insertAnno(db, itemId, name, value) {
- yield db.execute(`INSERT OR IGNORE INTO moz_anno_attributes (name)
- VALUES (:name)`, { name });
- yield db.execute(`
- INSERT INTO moz_items_annos
- (item_id, anno_attribute_id, content, flags,
- expiration, type, dateAdded, lastModified)
- VALUES (:itemId,
- (SELECT id FROM moz_anno_attributes
- WHERE name = :name),
- 1, 0, :expiration, :type, 0, 0)
- `, { itemId, name, expiration: EXPIRE_NEVER, type: TYPE_INT32 });
-}
-
-function insertMobileFolder(db) {
- return db.executeTransaction(function* () {
- let item = yield* insertItem(db, {
- type: TYPE_FOLDER,
- parentGuid: "root________",
- });
- yield* insertAnno(db, item.id, "mobile/bookmarksRoot", 1);
- return item;
- });
-}
-
-var mobileId, mobileGuid, fxGuid;
-var dupeMobileId, dupeMobileGuid, tbGuid;
-
-add_task(function* setup() {
- yield setupPlacesDatabase("places_v34.sqlite");
- // Setup database contents to be migrated.
- let path = OS.Path.join(OS.Constants.Path.profileDir, DB_FILENAME);
- let db = yield Sqlite.openConnection({ path });
-
- do_print("Create mobile folder with bookmarks");
- ({ id: mobileId, guid: mobileGuid } = yield insertMobileFolder(db));
- ({ guid: fxGuid } = yield insertBookmark(db, {
- type: TYPE_BOOKMARK,
- url: "http://getfirefox.com",
- parentGuid: mobileGuid,
- }));
-
- // We should only have one mobile folder, but, in case an old version of Sync
- // did the wrong thing and created multiple mobile folders, we should merge
- // their contents into the new mobile root.
- do_print("Create second mobile folder with different bookmarks");
- ({ id: dupeMobileId, guid: dupeMobileGuid } = yield insertMobileFolder(db));
- ({ guid: tbGuid } = yield insertBookmark(db, {
- type: TYPE_BOOKMARK,
- url: "http://getthunderbird.com",
- parentGuid: dupeMobileGuid,
- }));
-
- yield db.close();
-});
-
-add_task(function* database_is_valid() {
- // Accessing the database for the first time triggers migration.
- Assert.equal(PlacesUtils.history.databaseStatus,
- PlacesUtils.history.DATABASE_STATUS_UPGRADED);
-
- let db = yield PlacesUtils.promiseDBConnection();
- Assert.equal((yield db.getSchemaVersion()), CURRENT_SCHEMA_VERSION);
-});
-
-add_task(function* test_mobile_root() {
- let fxBmk = yield PlacesUtils.bookmarks.fetch(fxGuid);
- equal(fxBmk.parentGuid, PlacesUtils.bookmarks.mobileGuid,
- "Firefox bookmark should be moved to new mobile root");
- equal(fxBmk.index, 0, "Firefox bookmark should be first child of new root");
-
- let tbBmk = yield PlacesUtils.bookmarks.fetch(tbGuid);
- equal(tbBmk.parentGuid, PlacesUtils.bookmarks.mobileGuid,
- "Thunderbird bookmark should be moved to new mobile root");
- equal(tbBmk.index, 1,
- "Thunderbird bookmark should be second child of new root");
-
- let mobileRootId = PlacesUtils.promiseItemId(
- PlacesUtils.bookmarks.mobileGuid);
- let annoItemIds = PlacesUtils.annotations.getItemsWithAnnotation(
- PlacesUtils.MOBILE_ROOT_ANNO, {});
- deepEqual(annoItemIds, [mobileRootId],
- "Only mobile root should have mobile anno");
-});
diff --git a/toolkit/components/places/tests/migration/test_current_from_v34_no_roots.js b/toolkit/components/places/tests/migration/test_current_from_v34_no_roots.js
deleted file mode 100644
index 871fe8993..000000000
--- a/toolkit/components/places/tests/migration/test_current_from_v34_no_roots.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* setup() {
- yield setupPlacesDatabase("places_v34.sqlite");
- // Setup database contents to be migrated.
- let path = OS.Path.join(OS.Constants.Path.profileDir, DB_FILENAME);
- let db = yield Sqlite.openConnection({ path });
- // Remove all the roots.
- yield db.execute("DELETE FROM moz_bookmarks");
- yield db.close();
-});
-
-add_task(function* database_is_valid() {
- // Accessing the database for the first time triggers migration.
- Assert.equal(PlacesUtils.history.databaseStatus,
- PlacesUtils.history.DATABASE_STATUS_UPGRADED);
-
- let db = yield PlacesUtils.promiseDBConnection();
- Assert.equal((yield db.getSchemaVersion()), CURRENT_SCHEMA_VERSION);
-});
diff --git a/toolkit/components/places/tests/migration/test_current_from_v6.js b/toolkit/components/places/tests/migration/test_current_from_v6.js
deleted file mode 100644
index a3f9dc229..000000000
--- a/toolkit/components/places/tests/migration/test_current_from_v6.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests migration from a preliminary schema version 6 that
- * lacks frecency column and moz_inputhistory table.
- */
-
-add_task(function* setup() {
- yield setupPlacesDatabase("places_v6.sqlite");
-});
-
-add_task(function* corrupt_database_not_exists() {
- let corruptPath = OS.Path.join(OS.Constants.Path.profileDir,
- "places.sqlite.corrupt");
- Assert.ok(!(yield OS.File.exists(corruptPath)), "Corrupt file should not exist");
-});
-
-add_task(function* database_is_valid() {
- Assert.equal(PlacesUtils.history.databaseStatus,
- PlacesUtils.history.DATABASE_STATUS_CORRUPT);
-
- let db = yield PlacesUtils.promiseDBConnection();
- Assert.equal((yield db.getSchemaVersion()), CURRENT_SCHEMA_VERSION);
-});
-
-add_task(function* check_columns() {
- // Check the database has been replaced, these would throw otherwise.
- let db = yield PlacesUtils.promiseDBConnection();
- yield db.execute("SELECT frecency from moz_places");
- yield db.execute("SELECT 1 from moz_inputhistory");
-});
-
-add_task(function* corrupt_database_exists() {
- let corruptPath = OS.Path.join(OS.Constants.Path.profileDir,
- "places.sqlite.corrupt");
- Assert.ok((yield OS.File.exists(corruptPath)), "Corrupt file should exist");
-});
diff --git a/toolkit/components/places/tests/migration/xpcshell.ini b/toolkit/components/places/tests/migration/xpcshell.ini
deleted file mode 100644
index aae0f75ee..000000000
--- a/toolkit/components/places/tests/migration/xpcshell.ini
+++ /dev/null
@@ -1,36 +0,0 @@
-[DEFAULT]
-head = head_migration.js
-tail =
-
-support-files =
- places_v6.sqlite
- places_v10.sqlite
- places_v11.sqlite
- places_v17.sqlite
- places_v19.sqlite
- places_v21.sqlite
- places_v22.sqlite
- places_v23.sqlite
- places_v24.sqlite
- places_v25.sqlite
- places_v26.sqlite
- places_v27.sqlite
- places_v28.sqlite
- places_v30.sqlite
- places_v31.sqlite
- places_v32.sqlite
- places_v33.sqlite
- places_v34.sqlite
- places_v35.sqlite
-
-[test_current_from_downgraded.js]
-[test_current_from_v6.js]
-[test_current_from_v11.js]
-[test_current_from_v19.js]
-[test_current_from_v24.js]
-[test_current_from_v25.js]
-[test_current_from_v26.js]
-[test_current_from_v27.js]
-[test_current_from_v31.js]
-[test_current_from_v34.js]
-[test_current_from_v34_no_roots.js]
diff --git a/toolkit/components/places/tests/moz.build b/toolkit/components/places/tests/moz.build
deleted file mode 100644
index a40c0e93a..000000000
--- a/toolkit/components/places/tests/moz.build
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-TEST_DIRS += ['cpp']
-
-TESTING_JS_MODULES += [
- 'PlacesTestUtils.jsm',
-]
-
-XPCSHELL_TESTS_MANIFESTS += [
- 'bookmarks/xpcshell.ini',
- 'expiration/xpcshell.ini',
- 'favicons/xpcshell.ini',
- 'history/xpcshell.ini',
- 'migration/xpcshell.ini',
- 'queries/xpcshell.ini',
- 'unifiedcomplete/xpcshell.ini',
- 'unit/xpcshell.ini',
-]
-
-BROWSER_CHROME_MANIFESTS += ['browser/browser.ini']
-MOCHITEST_CHROME_MANIFESTS += [
- 'chrome/chrome.ini',
-]
-
-TEST_HARNESS_FILES.xpcshell.toolkit.components.places.tests += [
- 'head_common.js',
-]
-
-TEST_HARNESS_FILES.testing.mochitest.tests.toolkit.components.places.tests.browser += [
- 'browser/399606-history.go-0.html',
- 'browser/399606-httprefresh.html',
- 'browser/399606-location.reload.html',
- 'browser/399606-location.replace.html',
- 'browser/399606-window.location.href.html',
- 'browser/399606-window.location.html',
- 'browser/461710_iframe.html',
- 'browser/461710_link_page-2.html',
- 'browser/461710_link_page-3.html',
- 'browser/461710_link_page.html',
- 'browser/461710_visited_page.html',
- 'browser/begin.html',
- 'browser/favicon-normal16.png',
- 'browser/favicon-normal32.png',
- 'browser/favicon.html',
- 'browser/final.html',
- 'browser/history_post.html',
- 'browser/history_post.sjs',
- 'browser/redirect-target.html',
- 'browser/redirect.sjs',
- 'browser/redirect_once.sjs',
- 'browser/redirect_twice.sjs',
- 'browser/title1.html',
- 'browser/title2.html',
-]
-
-TEST_HARNESS_FILES.testing.mochitest.tests.toolkit.components.places.tests.chrome += [
- 'chrome/bad_links.atom',
- 'chrome/link-less-items-no-site-uri.rss',
- 'chrome/link-less-items.rss',
- 'chrome/rss_as_html.rss',
- 'chrome/rss_as_html.rss^headers^',
- 'chrome/sample_feed.atom',
-]
diff --git a/toolkit/components/places/tests/queries/.eslintrc.js b/toolkit/components/places/tests/queries/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/places/tests/queries/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/places/tests/queries/head_queries.js b/toolkit/components/places/tests/queries/head_queries.js
deleted file mode 100644
index d37b3365f..000000000
--- a/toolkit/components/places/tests/queries/head_queries.js
+++ /dev/null
@@ -1,370 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cr = Components.results;
-var Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-// Import common head.
-{
- let commonFile = do_get_file("../head_common.js", false);
- let uri = Services.io.newFileURI(commonFile);
- Services.scriptloader.loadSubScript(uri.spec, this);
-}
-
-// Put any other stuff relative to this test folder below.
-
-
-// Some Useful Date constants - PRTime uses microseconds, so convert
-const DAY_MICROSEC = 86400000000;
-const today = PlacesUtils.toPRTime(Date.now());
-const yesterday = today - DAY_MICROSEC;
-const lastweek = today - (DAY_MICROSEC * 7);
-const daybefore = today - (DAY_MICROSEC * 2);
-const old = today - (DAY_MICROSEC * 3);
-const futureday = today + (DAY_MICROSEC * 3);
-const olderthansixmonths = today - (DAY_MICROSEC * 31 * 7);
-
-
-/**
- * Generalized function to pull in an array of objects of data and push it into
- * the database. It does NOT do any checking to see that the input is
- * appropriate. This function is an asynchronous task, it can be called using
- * "Task.spawn" or using the "yield" function inside another task.
- */
-function* task_populateDB(aArray)
-{
- // Iterate over aArray and execute all instructions.
- for (let arrayItem of aArray) {
- try {
- // make the data object into a query data object in order to create proper
- // default values for anything left unspecified
- var qdata = new queryData(arrayItem);
- if (qdata.isVisit) {
- // Then we should add a visit for this node
- yield PlacesTestUtils.addVisits({
- uri: uri(qdata.uri),
- transition: qdata.transType,
- visitDate: qdata.lastVisit,
- referrer: qdata.referrer ? uri(qdata.referrer) : null,
- title: qdata.title
- });
- if (qdata.visitCount && !qdata.isDetails) {
- // Set a fake visit_count, this is not a real count but can be used
- // to test sorting by visit_count.
- let stmt = DBConn().createAsyncStatement(
- "UPDATE moz_places SET visit_count = :vc WHERE url_hash = hash(:url) AND url = :url");
- stmt.params.vc = qdata.visitCount;
- stmt.params.url = qdata.uri;
- try {
- stmt.executeAsync();
- }
- catch (ex) {
- print("Error while setting visit_count.");
- }
- finally {
- stmt.finalize();
- }
- }
- }
-
- if (qdata.isRedirect) {
- // This must be async to properly enqueue after the updateFrecency call
- // done by the visit addition.
- let stmt = DBConn().createAsyncStatement(
- "UPDATE moz_places SET hidden = 1 WHERE url_hash = hash(:url) AND url = :url");
- stmt.params.url = qdata.uri;
- try {
- stmt.executeAsync();
- }
- catch (ex) {
- print("Error while setting hidden.");
- }
- finally {
- stmt.finalize();
- }
- }
-
- if (qdata.isDetails) {
- // Then we add extraneous page details for testing
- yield PlacesTestUtils.addVisits({
- uri: uri(qdata.uri),
- visitDate: qdata.lastVisit,
- title: qdata.title
- });
- }
-
- if (qdata.markPageAsTyped) {
- PlacesUtils.history.markPageAsTyped(uri(qdata.uri));
- }
-
- if (qdata.isPageAnnotation) {
- if (qdata.removeAnnotation)
- PlacesUtils.annotations.removePageAnnotation(uri(qdata.uri),
- qdata.annoName);
- else {
- PlacesUtils.annotations.setPageAnnotation(uri(qdata.uri),
- qdata.annoName,
- qdata.annoVal,
- qdata.annoFlags,
- qdata.annoExpiration);
- }
- }
-
- if (qdata.isItemAnnotation) {
- if (qdata.removeAnnotation)
- PlacesUtils.annotations.removeItemAnnotation(qdata.itemId,
- qdata.annoName);
- else {
- PlacesUtils.annotations.setItemAnnotation(qdata.itemId,
- qdata.annoName,
- qdata.annoVal,
- qdata.annoFlags,
- qdata.annoExpiration);
- }
- }
-
- if (qdata.isFolder) {
- yield PlacesUtils.bookmarks.insert({
- parentGuid: qdata.parentGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: qdata.title,
- index: qdata.index
- });
- }
-
- if (qdata.isLivemark) {
- yield PlacesUtils.livemarks.addLivemark({ title: qdata.title
- , parentId: (yield PlacesUtils.promiseItemId(qdata.parentGuid))
- , index: qdata.index
- , feedURI: uri(qdata.feedURI)
- , siteURI: uri(qdata.uri)
- });
- }
-
- if (qdata.isBookmark) {
- let data = {
- parentGuid: qdata.parentGuid,
- index: qdata.index,
- title: qdata.title,
- url: qdata.uri
- };
-
- if (qdata.dateAdded) {
- data.dateAdded = new Date(qdata.dateAdded / 1000);
- }
-
- if (qdata.lastModified) {
- data.lastModified = new Date(qdata.lastModified / 1000);
- }
-
- yield PlacesUtils.bookmarks.insert(data);
-
- if (qdata.keyword) {
- yield PlacesUtils.keywords.insert({ url: qdata.uri,
- keyword: qdata.keyword });
- }
- }
-
- if (qdata.isTag) {
- PlacesUtils.tagging.tagURI(uri(qdata.uri), qdata.tagArray);
- }
-
- if (qdata.isSeparator) {
- yield PlacesUtils.bookmarks.insert({
- parentGuid: qdata.parentGuid,
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- index: qdata.index
- });
- }
- } catch (ex) {
- // use the arrayItem object here in case instantiation of qdata failed
- do_print("Problem with this URI: " + arrayItem.uri);
- do_throw("Error creating database: " + ex + "\n");
- }
- }
-}
-
-
-/**
- * The Query Data Object - this object encapsulates data for our queries and is
- * used to parameterize our calls to the Places APIs to put data into the
- * database. It also has some interesting meta functions to determine which APIs
- * should be called, and to determine if this object should show up in the
- * resulting query.
- * Its parameter is an object specifying which attributes you want to set.
- * For ex:
- * var myobj = new queryData({isVisit: true, uri:"http://mozilla.com", title="foo"});
- * Note that it doesn't do any input checking on that object.
- */
-function queryData(obj) {
- this.isVisit = obj.isVisit ? obj.isVisit : false;
- this.isBookmark = obj.isBookmark ? obj.isBookmark: false;
- this.uri = obj.uri ? obj.uri : "";
- this.lastVisit = obj.lastVisit ? obj.lastVisit : today;
- this.referrer = obj.referrer ? obj.referrer : null;
- this.transType = obj.transType ? obj.transType : Ci.nsINavHistoryService.TRANSITION_TYPED;
- this.isRedirect = obj.isRedirect ? obj.isRedirect : false;
- this.isDetails = obj.isDetails ? obj.isDetails : false;
- this.title = obj.title ? obj.title : "";
- this.markPageAsTyped = obj.markPageAsTyped ? obj.markPageAsTyped : false;
- this.isPageAnnotation = obj.isPageAnnotation ? obj.isPageAnnotation : false;
- this.removeAnnotation= obj.removeAnnotation ? true : false;
- this.annoName = obj.annoName ? obj.annoName : "";
- this.annoVal = obj.annoVal ? obj.annoVal : "";
- this.annoFlags = obj.annoFlags ? obj.annoFlags : 0;
- this.annoExpiration = obj.annoExpiration ? obj.annoExpiration : 0;
- this.isItemAnnotation = obj.isItemAnnotation ? obj.isItemAnnotation : false;
- this.itemId = obj.itemId ? obj.itemId : 0;
- this.annoMimeType = obj.annoMimeType ? obj.annoMimeType : "";
- this.isTag = obj.isTag ? obj.isTag : false;
- this.tagArray = obj.tagArray ? obj.tagArray : null;
- this.isLivemark = obj.isLivemark ? obj.isLivemark : false;
- this.parentGuid = obj.parentGuid || PlacesUtils.bookmarks.rootGuid;
- this.feedURI = obj.feedURI ? obj.feedURI : "";
- this.index = obj.index ? obj.index : PlacesUtils.bookmarks.DEFAULT_INDEX;
- this.isFolder = obj.isFolder ? obj.isFolder : false;
- this.contractId = obj.contractId ? obj.contractId : "";
- this.lastModified = obj.lastModified ? obj.lastModified : null;
- this.dateAdded = obj.dateAdded ? obj.dateAdded : null;
- this.keyword = obj.keyword ? obj.keyword : "";
- this.visitCount = obj.visitCount ? obj.visitCount : 0;
- this.isSeparator = obj.hasOwnProperty("isSeparator") && obj.isSeparator;
-
- // And now, the attribute for whether or not this object should appear in the
- // resulting query
- this.isInQuery = obj.isInQuery ? obj.isInQuery : false;
-}
-
-// All attributes are set in the constructor above
-queryData.prototype = { }
-
-
-/**
- * Helper function to compare an array of query objects with a result set.
- * It assumes the array of query objects contains the SAME SORT as the result
- * set. It checks the the uri, title, time, and bookmarkIndex properties of
- * the results, where appropriate.
- */
-function compareArrayToResult(aArray, aRoot) {
- do_print("Comparing Array to Results");
-
- var wasOpen = aRoot.containerOpen;
- if (!wasOpen)
- aRoot.containerOpen = true;
-
- // check expected number of results against actual
- var expectedResultCount = aArray.filter(function(aEl) { return aEl.isInQuery; }).length;
- if (expectedResultCount != aRoot.childCount) {
- // Debugging code for failures.
- dump_table("moz_places");
- dump_table("moz_historyvisits");
- do_print("Found children:");
- for (let i = 0; i < aRoot.childCount; i++) {
- do_print(aRoot.getChild(i).uri);
- }
- do_print("Expected:");
- for (let i = 0; i < aArray.length; i++) {
- if (aArray[i].isInQuery)
- do_print(aArray[i].uri);
- }
- }
- do_check_eq(expectedResultCount, aRoot.childCount);
-
- var inQueryIndex = 0;
- for (var i = 0; i < aArray.length; i++) {
- if (aArray[i].isInQuery) {
- var child = aRoot.getChild(inQueryIndex);
- // do_print("testing testData[" + i + "] vs result[" + inQueryIndex + "]");
- if (!aArray[i].isFolder && !aArray[i].isSeparator) {
- do_print("testing testData[" + aArray[i].uri + "] vs result[" + child.uri + "]");
- if (aArray[i].uri != child.uri) {
- dump_table("moz_places");
- do_throw("Expected " + aArray[i].uri + " found " + child.uri);
- }
- }
- if (!aArray[i].isSeparator && aArray[i].title != child.title)
- do_throw("Expected " + aArray[i].title + " found " + child.title);
- if (aArray[i].hasOwnProperty("lastVisit") &&
- aArray[i].lastVisit != child.time)
- do_throw("Expected " + aArray[i].lastVisit + " found " + child.time);
- if (aArray[i].hasOwnProperty("index") &&
- aArray[i].index != PlacesUtils.bookmarks.DEFAULT_INDEX &&
- aArray[i].index != child.bookmarkIndex)
- do_throw("Expected " + aArray[i].index + " found " + child.bookmarkIndex);
-
- inQueryIndex++;
- }
- }
-
- if (!wasOpen)
- aRoot.containerOpen = false;
- do_print("Comparing Array to Results passes");
-}
-
-
-/**
- * Helper function to check to see if one object either is or is not in the
- * result set. It can accept either a queryData object or an array of queryData
- * objects. If it gets an array, it only compares the first object in the array
- * to see if it is in the result set.
- * Returns: True if item is in query set, and false if item is not in query set
- * If input is an array, returns True if FIRST object in array is in
- * query set. To compare entire array, use the function above.
- */
-function isInResult(aQueryData, aRoot) {
- var rv = false;
- var uri;
- var wasOpen = aRoot.containerOpen;
- if (!wasOpen)
- aRoot.containerOpen = true;
-
- // If we have an array, pluck out the first item. If an object, pluc out the
- // URI, we just compare URI's here.
- if ("uri" in aQueryData) {
- uri = aQueryData.uri;
- } else {
- uri = aQueryData[0].uri;
- }
-
- for (var i=0; i < aRoot.childCount; i++) {
- if (uri == aRoot.getChild(i).uri) {
- rv = true;
- break;
- }
- }
- if (!wasOpen)
- aRoot.containerOpen = false;
- return rv;
-}
-
-
-/**
- * A nice helper function for debugging things. It prints the contents of a
- * result set.
- */
-function displayResultSet(aRoot) {
-
- var wasOpen = aRoot.containerOpen;
- if (!wasOpen)
- aRoot.containerOpen = true;
-
- if (!aRoot.hasChildren) {
- // Something wrong? Empty result set?
- do_print("Result Set Empty");
- return;
- }
-
- for (var i=0; i < aRoot.childCount; ++i) {
- do_print("Result Set URI: " + aRoot.getChild(i).uri + " Title: " +
- aRoot.getChild(i).title + " Visit Time: " + aRoot.getChild(i).time);
- }
- if (!wasOpen)
- aRoot.containerOpen = false;
-}
diff --git a/toolkit/components/places/tests/queries/readme.txt b/toolkit/components/places/tests/queries/readme.txt
deleted file mode 100644
index 19414f96e..000000000
--- a/toolkit/components/places/tests/queries/readme.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-These are tests specific to the Places Query API.
-
-We are tracking the coverage of these tests here:
-http://wiki.mozilla.org/QA/TDAI/Projects/Places_Tests
-
-When creating one of these tests, you need to update those tables so that we
-know how well our test coverage is of this area. Furthermore, when adding tests
-ensure to cover live update (changing the query set) by performing the following
-operations on the query set you get after running the query:
-* Adding a new item to the query set
-* Updating an existing item so that it matches the query set
-* Change an existing item so that it does not match the query set
-* Do multiple of the above inside an Update Batch transaction.
-* Try these transactions in different orders.
-
-Use the stub test to help you create a test with the proper structure.
diff --git a/toolkit/components/places/tests/queries/test_415716.js b/toolkit/components/places/tests/queries/test_415716.js
deleted file mode 100644
index 754a73e7c..000000000
--- a/toolkit/components/places/tests/queries/test_415716.js
+++ /dev/null
@@ -1,108 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function modHistoryTypes(val) {
- switch (val % 8) {
- case 0:
- case 1:
- return TRANSITION_LINK;
- case 2:
- return TRANSITION_TYPED;
- case 3:
- return TRANSITION_BOOKMARK;
- case 4:
- return TRANSITION_EMBED;
- case 5:
- return TRANSITION_REDIRECT_PERMANENT;
- case 6:
- return TRANSITION_REDIRECT_TEMPORARY;
- case 7:
- return TRANSITION_DOWNLOAD;
- case 8:
- return TRANSITION_FRAMED_LINK;
- }
- return TRANSITION_TYPED;
-}
-
-function run_test()
-{
- run_next_test();
-}
-
-/**
- * Builds a test database by hand using various times, annotations and
- * visit numbers for this test
- */
-add_task(function* test_buildTestDatabase()
-{
- // This is the set of visits that we will match - our min visit is 2 so that's
- // why we add more visits to the same URIs.
- let testURI = uri("http://www.foo.com");
- let places = [];
-
- for (let i = 0; i < 12; ++i) {
- places.push({
- uri: testURI,
- transition: modHistoryTypes(i),
- visitDate: today
- });
- }
-
- testURI = uri("http://foo.com/youdontseeme.html");
- let testAnnoName = "moz-test-places/testing123";
- let testAnnoVal = "test";
- for (let i = 0; i < 12; ++i) {
- places.push({
- uri: testURI,
- transition: modHistoryTypes(i),
- visitDate: today
- });
- }
-
- yield PlacesTestUtils.addVisits(places);
-
- PlacesUtils.annotations.setPageAnnotation(testURI, testAnnoName,
- testAnnoVal, 0, 0);
-});
-
-/**
- * This test will test Queries that use relative Time Range, minVists, maxVisits,
- * annotation.
- * The Query:
- * Annotation == "moz-test-places/testing123" &&
- * TimeRange == "now() - 2d" &&
- * minVisits == 2 &&
- * maxVisits == 10
- */
-add_task(function test_execute()
-{
- let query = PlacesUtils.history.getNewQuery();
- query.annotation = "moz-test-places/testing123";
- query.beginTime = daybefore * 1000;
- query.beginTimeReference = PlacesUtils.history.TIME_RELATIVE_NOW;
- query.endTime = today * 1000;
- query.endTimeReference = PlacesUtils.history.TIME_RELATIVE_NOW;
- query.minVisits = 2;
- query.maxVisits = 10;
-
- // Options
- let options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_DATE_DESCENDING;
- options.resultType = options.RESULTS_AS_VISIT;
-
- // Results
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- let cc = root.childCount;
- dump("----> cc is: " + cc + "\n");
- for (let i = 0; i < root.childCount; ++i) {
- let resultNode = root.getChild(i);
- let accesstime = Date(resultNode.time / 1000);
- dump("----> result: " + resultNode.uri + " Date: " + accesstime.toLocaleString() + "\n");
- }
- do_check_eq(cc, 0);
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/queries/test_abstime-annotation-domain.js b/toolkit/components/places/tests/queries/test_abstime-annotation-domain.js
deleted file mode 100644
index 199fc0865..000000000
--- a/toolkit/components/places/tests/queries/test_abstime-annotation-domain.js
+++ /dev/null
@@ -1,210 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const DAY_MSEC = 86400000;
-const MIN_MSEC = 60000;
-const HOUR_MSEC = 3600000;
-// Jan 6 2008 at 8am is our begin edge of the query
-var beginTimeDate = new Date(2008, 0, 6, 8, 0, 0, 0);
-// Jan 15 2008 at 9:30pm is our ending edge of the query
-var endTimeDate = new Date(2008, 0, 15, 21, 30, 0, 0);
-
-// These as millisecond values
-var beginTime = beginTimeDate.getTime();
-var endTime = endTimeDate.getTime();
-
-// Some range dates inside our query - mult by 1000 to convert to PRTIME
-var jan7_800 = (beginTime + DAY_MSEC) * 1000;
-var jan6_815 = (beginTime + (MIN_MSEC * 15)) * 1000;
-var jan11_800 = (beginTime + (DAY_MSEC * 5)) * 1000;
-var jan14_2130 = (endTime - DAY_MSEC) * 1000;
-var jan15_2045 = (endTime - (MIN_MSEC * 45)) * 1000;
-var jan12_1730 = (endTime - (DAY_MSEC * 3) - (HOUR_MSEC*4)) * 1000;
-
-// Dates outside our query - mult by 1000 to convert to PRTIME
-var jan6_700 = (beginTime - HOUR_MSEC) * 1000;
-var jan5_800 = (beginTime - DAY_MSEC) * 1000;
-var dec27_800 = (beginTime - (DAY_MSEC * 10)) * 1000;
-var jan15_2145 = (endTime + (MIN_MSEC * 15)) * 1000;
-var jan16_2130 = (endTime + (DAY_MSEC)) * 1000;
-var jan25_2130 = (endTime + (DAY_MSEC * 10)) * 1000;
-
-// So that we can easily use these too, convert them to PRTIME
-beginTime *= 1000;
-endTime *= 1000;
-
-/**
- * Array of objects to build our test database
- */
-var goodAnnoName = "moz-test-places/testing123";
-var val = "test";
-var badAnnoName = "text/foo";
-
-// The test data for our database, note that the ordering of the results that
-// will be returned by the query (the isInQuery: true objects) is IMPORTANT.
-// see compareArrayToResult in head_queries.js for more info.
-var testData = [
- // Test ftp protocol - vary the title length
- {isInQuery: true, isVisit: true, isDetails: true,
- uri: "ftp://foo.com/ftp", lastVisit: jan12_1730,
- title: "hugelongconfmozlagurationofwordswithasearchtermsinit whoo-hoo"},
-
- // Test flat domain with annotation
- {isInQuery: true, isVisit: true, isDetails: true, isPageAnnotation: true,
- uri: "http://foo.com/", annoName: goodAnnoName, annoVal: val,
- lastVisit: jan14_2130, title: "moz"},
-
- // Test subdomain included with isRedirect=true, different transtype
- {isInQuery: true, isVisit: true, isDetails: true, title: "moz",
- isRedirect: true, uri: "http://mail.foo.com/redirect", lastVisit: jan11_800,
- transType: PlacesUtils.history.TRANSITION_LINK},
-
- // Test subdomain inclued at the leading time edge
- {isInQuery: true, isVisit: true, isDetails: true,
- uri: "http://mail.foo.com/yiihah", title: "moz", lastVisit: jan6_815},
-
- // Test www. style URI is included, with an annotation
- {isInQuery: true, isVisit: true, isDetails: true, isPageAnnotation: true,
- uri: "http://www.foo.com/yiihah", annoName: goodAnnoName, annoVal: val,
- lastVisit: jan7_800, title: "moz"},
-
- // Test https protocol
- {isInQuery: true, isVisit: true, isDetails: true, title: "moz",
- uri: "https://foo.com/", lastVisit: jan15_2045},
-
- // Test begin edge of time
- {isInQuery: true, isVisit: true, isDetails: true, title: "moz mozilla",
- uri: "https://foo.com/begin.html", lastVisit: beginTime},
-
- // Test end edge of time
- {isInQuery: true, isVisit: true, isDetails: true, title: "moz mozilla",
- uri: "https://foo.com/end.html", lastVisit: endTime},
-
- // Test an image link, with annotations
- {isInQuery: true, isVisit: true, isDetails: true, isPageAnnotation: true,
- title: "mozzie the dino", uri: "https://foo.com/mozzie.png",
- annoName: goodAnnoName, annoVal: val, lastVisit: jan14_2130},
-
- // Begin the invalid queries: Test too early
- {isInQuery: false, isVisit:true, isDetails: true, title: "moz",
- uri: "http://foo.com/tooearly.php", lastVisit: jan6_700},
-
- // Test Bad Annotation
- {isInQuery: false, isVisit:true, isDetails: true, isPageAnnotation: true,
- title: "moz", uri: "http://foo.com/badanno.htm", lastVisit: jan12_1730,
- annoName: badAnnoName, annoVal: val},
-
- // Test bad URI
- {isInQuery: false, isVisit:true, isDetails: true, title: "moz",
- uri: "http://somefoo.com/justwrong.htm", lastVisit: jan11_800},
-
- // Test afterward, one to update
- {isInQuery: false, isVisit:true, isDetails: true, title: "changeme",
- uri: "http://foo.com/changeme1.htm", lastVisit: jan12_1730},
-
- // Test invalid title
- {isInQuery: false, isVisit:true, isDetails: true, title: "changeme2",
- uri: "http://foo.com/changeme2.htm", lastVisit: jan7_800},
-
- // Test changing the lastVisit
- {isInQuery: false, isVisit:true, isDetails: true, title: "moz",
- uri: "http://foo.com/changeme3.htm", lastVisit: dec27_800}];
-
-/**
- * This test will test a Query using several terms and do a bit of negative
- * testing for items that should be ignored while querying over history.
- * The Query:WHERE absoluteTime(matches) AND searchTerms AND URI
- * AND annotationIsNot(match) GROUP BY Domain, Day SORT BY uri,ascending
- * excludeITems(should be ignored)
- */
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_abstime_annotation_domain()
-{
- // Initialize database
- yield task_populateDB(testData);
-
- // Query
- var query = PlacesUtils.history.getNewQuery();
- query.beginTime = beginTime;
- query.endTime = endTime;
- query.beginTimeReference = PlacesUtils.history.TIME_RELATIVE_EPOCH;
- query.endTimeReference = PlacesUtils.history.TIME_RELATIVE_EPOCH;
- query.searchTerms = "moz";
- query.domain = "foo.com";
- query.domainIsHost = false;
- query.annotation = "text/foo";
- query.annotationIsNot = true;
-
- // Options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_URI_ASCENDING;
- options.resultType = options.RESULTS_AS_URI;
- // The next two options should be ignored
- // can't use this one, breaks test - bug 419779
- // options.excludeItems = true;
-
- // Results
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
-
- // Ensure the result set is correct
- compareArrayToResult(testData, root);
-
- // Make some changes to the result set
- // Let's add something first
- var addItem = [{isInQuery: true, isVisit: true, isDetails: true, title: "moz",
- uri: "http://www.foo.com/i-am-added.html", lastVisit: jan11_800}];
- yield task_populateDB(addItem);
- do_print("Adding item foo.com/i-am-added.html");
- do_check_eq(isInResult(addItem, root), true);
-
- // Let's update something by title
- var change1 = [{isDetails: true, uri: "http://foo.com/changeme1",
- lastVisit: jan12_1730, title: "moz moz mozzie"}];
- yield task_populateDB(change1);
- do_print("LiveUpdate by changing title");
- do_check_eq(isInResult(change1, root), true);
-
- // Let's update something by annotation
- // Updating a page by removing an annotation does not cause it to join this
- // query set. I tend to think that it should cause that page to join this
- // query set, because this visit fits all theother specified criteria once the
- // annotation is removed. Uncommenting this will fail the test.
- // Bug 424050
- /* var change2 = [{isPageAnnotation: true, uri: "http://foo.com/badannotaion.html",
- annoName: "text/mozilla", annoVal: "test"}];
- yield task_populateDB(change2);
- do_print("LiveUpdate by removing annotation");
- do_check_eq(isInResult(change2, root), true);*/
-
- // Let's update by adding a visit in the time range for an existing URI
- var change3 = [{isDetails: true, uri: "http://foo.com/changeme3.htm",
- title: "moz", lastVisit: jan15_2045}];
- yield task_populateDB(change3);
- do_print("LiveUpdate by adding visit within timerange");
- do_check_eq(isInResult(change3, root), true);
-
- // And delete something from the result set - using annotation
- // Once again, bug 424050 prevents this from passing
- /* var change4 = [{isPageAnnotation: true, uri: "ftp://foo.com/ftp",
- annoVal: "test", annoName: badAnnoName}];
- yield task_populateDB(change4);
- do_print("LiveUpdate by deleting item from set by adding annotation");
- do_check_eq(isInResult(change4, root), false);*/
-
- // Delete something by changing the title
- var change5 = [{isDetails: true, uri: "http://foo.com/end.html", title: "deleted"}];
- yield task_populateDB(change5);
- do_print("LiveUpdate by deleting item by changing title");
- do_check_eq(isInResult(change5, root), false);
-
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/queries/test_abstime-annotation-uri.js b/toolkit/components/places/tests/queries/test_abstime-annotation-uri.js
deleted file mode 100644
index 145d2cb59..000000000
--- a/toolkit/components/places/tests/queries/test_abstime-annotation-uri.js
+++ /dev/null
@@ -1,162 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const DAY_MSEC = 86400000;
-const MIN_MSEC = 60000;
-const HOUR_MSEC = 3600000;
-// Jan 6 2008 at 8am is our begin edge of the query
-var beginTimeDate = new Date(2008, 0, 6, 8, 0, 0, 0);
-// Jan 15 2008 at 9:30pm is our ending edge of the query
-var endTimeDate = new Date(2008, 0, 15, 21, 30, 0, 0);
-
-// These as millisecond values
-var beginTime = beginTimeDate.getTime();
-var endTime = endTimeDate.getTime();
-
-// Some range dates inside our query - mult by 1000 to convert to PRTIME
-var jan7_800 = (beginTime + DAY_MSEC) * 1000;
-var jan6_815 = (beginTime + (MIN_MSEC * 15)) * 1000;
-var jan11_800 = (beginTime + (DAY_MSEC * 5)) * 1000;
-var jan14_2130 = (endTime - DAY_MSEC) * 1000;
-var jan15_2045 = (endTime - (MIN_MSEC * 45)) * 1000;
-var jan12_1730 = (endTime - (DAY_MSEC * 3) - (HOUR_MSEC*4)) * 1000;
-
-// Dates outside our query - mult by 1000 to convert to PRTIME
-var jan6_700 = (beginTime - HOUR_MSEC) * 1000;
-var jan5_800 = (beginTime - DAY_MSEC) * 1000;
-var dec27_800 = (beginTime - (DAY_MSEC * 10)) * 1000;
-var jan15_2145 = (endTime + (MIN_MSEC * 15)) * 1000;
-var jan16_2130 = (endTime + (DAY_MSEC)) * 1000;
-var jan25_2130 = (endTime + (DAY_MSEC * 10)) * 1000;
-
-// So that we can easily use these too, convert them to PRTIME
-beginTime *= 1000;
-endTime *= 1000;
-
-/**
- * Array of objects to build our test database
- */
-var goodAnnoName = "moz-test-places/testing123";
-var val = "test";
-var badAnnoName = "text/foo";
-
-// The test data for our database, note that the ordering of the results that
-// will be returned by the query (the isInQuery: true objects) is IMPORTANT.
-// see compareArrayToResult in head_queries.js for more info.
-var testData = [
-
- // Test flat domain with annotation
- {isInQuery: true, isVisit: true, isDetails: true, isPageAnnotation: true,
- uri: "http://foo.com/", annoName: goodAnnoName, annoVal: val,
- lastVisit: jan14_2130, title: "moz"},
-
- // Begin the invalid queries:
- // Test www. style URI is not included, with an annotation
- {isInQuery: false, isVisit: true, isDetails: true, isPageAnnotation: true,
- uri: "http://www.foo.com/yiihah", annoName: goodAnnoName, annoVal: val,
- lastVisit: jan7_800, title: "moz"},
-
- // Test subdomain not inclued at the leading time edge
- {isInQuery: false, isVisit: true, isDetails: true,
- uri: "http://mail.foo.com/yiihah", title: "moz", lastVisit: jan6_815},
-
- // Test https protocol
- {isInQuery: false, isVisit: true, isDetails: true, title: "moz",
- uri: "https://foo.com/", lastVisit: jan15_2045},
-
- // Test ftp protocol
- {isInQuery: false, isVisit: true, isDetails: true,
- uri: "ftp://foo.com/ftp", lastVisit: jan12_1730,
- title: "hugelongconfmozlagurationofwordswithasearchtermsinit whoo-hoo"},
-
- // Test too early
- {isInQuery: false, isVisit:true, isDetails: true, title: "moz",
- uri: "http://foo.com/tooearly.php", lastVisit: jan6_700},
-
- // Test Bad Annotation
- {isInQuery: false, isVisit:true, isDetails: true, isPageAnnotation: true,
- title: "moz", uri: "http://foo.com/badanno.htm", lastVisit: jan12_1730,
- annoName: badAnnoName, annoVal: val},
-
- // Test afterward, one to update
- {isInQuery: false, isVisit:true, isDetails: true, title: "changeme",
- uri: "http://foo.com/changeme1.htm", lastVisit: jan12_1730},
-
- // Test invalid title
- {isInQuery: false, isVisit:true, isDetails: true, title: "changeme2",
- uri: "http://foo.com/changeme2.htm", lastVisit: jan7_800},
-
- // Test changing the lastVisit
- {isInQuery: false, isVisit:true, isDetails: true, title: "moz",
- uri: "http://foo.com/changeme3.htm", lastVisit: dec27_800}];
-
-/**
- * This test will test a Query using several terms and do a bit of negative
- * testing for items that should be ignored while querying over history.
- * The Query:WHERE absoluteTime(matches) AND searchTerms AND URI
- * AND annotationIsNot(match) GROUP BY Domain, Day SORT BY uri,ascending
- * excludeITems(should be ignored)
- */
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_abstime_annotation_uri()
-{
- // Initialize database
- yield task_populateDB(testData);
-
- // Query
- var query = PlacesUtils.history.getNewQuery();
- query.beginTime = beginTime;
- query.endTime = endTime;
- query.beginTimeReference = PlacesUtils.history.TIME_RELATIVE_EPOCH;
- query.endTimeReference = PlacesUtils.history.TIME_RELATIVE_EPOCH;
- query.searchTerms = "moz";
- query.uri = uri("http://foo.com");
- query.annotation = "text/foo";
- query.annotationIsNot = true;
-
- // Options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_URI_ASCENDING;
- options.resultType = options.RESULTS_AS_URI;
- // The next two options should be ignored
- // can't use this one, breaks test - bug 419779
- // options.excludeItems = true;
-
- // Results
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
-
- // Ensure the result set is correct
- compareArrayToResult(testData, root);
-
- // live update.
- do_print("change title");
- var change1 = [{isDetails: true, uri:"http://foo.com/",
- title: "mo"}, ];
- yield task_populateDB(change1);
- do_check_false(isInResult({uri: "http://foo.com/"}, root));
-
- var change2 = [{isDetails: true, uri:"http://foo.com/",
- title: "moz", lastvisit: endTime}, ];
- yield task_populateDB(change2);
- dump_table("moz_places");
- do_check_false(isInResult({uri: "http://foo.com/"}, root));
-
- // Let's delete something from the result set - using annotation
- var change3 = [{isPageAnnotation: true,
- uri: "http://foo.com/",
- annoName: badAnnoName, annoVal: "test"}];
- yield task_populateDB(change3);
- do_print("LiveUpdate by removing annotation");
- do_check_false(isInResult({uri: "http://foo.com/"}, root));
-
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/queries/test_async.js b/toolkit/components/places/tests/queries/test_async.js
deleted file mode 100644
index 0ec99f8fc..000000000
--- a/toolkit/components/places/tests/queries/test_async.js
+++ /dev/null
@@ -1,371 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var tests = [
- {
- desc: "nsNavHistoryFolderResultNode: Basic test, asynchronously open and " +
- "close container with a single child",
-
- loading: function (node, newState, oldState) {
- this.checkStateChanged("loading", 1);
- this.checkArgs("loading", node, oldState, node.STATE_CLOSED);
- },
-
- opened: function (node, newState, oldState) {
- this.checkStateChanged("opened", 1);
- this.checkState("loading", 1);
- this.checkArgs("opened", node, oldState, node.STATE_LOADING);
-
- print("Checking node children");
- compareArrayToResult(this.data, node);
-
- print("Closing container");
- node.containerOpen = false;
- },
-
- closed: function (node, newState, oldState) {
- this.checkStateChanged("closed", 1);
- this.checkState("opened", 1);
- this.checkArgs("closed", node, oldState, node.STATE_OPENED);
- this.success();
- }
- },
-
- {
- desc: "nsNavHistoryFolderResultNode: After async open and no changes, " +
- "second open should be synchronous",
-
- loading: function (node, newState, oldState) {
- this.checkStateChanged("loading", 1);
- this.checkState("closed", 0);
- this.checkArgs("loading", node, oldState, node.STATE_CLOSED);
- },
-
- opened: function (node, newState, oldState) {
- let cnt = this.checkStateChanged("opened", 1, 2);
- let expectOldState = cnt === 1 ? node.STATE_LOADING : node.STATE_CLOSED;
- this.checkArgs("opened", node, oldState, expectOldState);
-
- print("Checking node children");
- compareArrayToResult(this.data, node);
-
- print("Closing container");
- node.containerOpen = false;
- },
-
- closed: function (node, newState, oldState) {
- let cnt = this.checkStateChanged("closed", 1, 2);
- this.checkArgs("closed", node, oldState, node.STATE_OPENED);
-
- switch (cnt) {
- case 1:
- node.containerOpen = true;
- break;
- case 2:
- this.success();
- break;
- }
- }
- },
-
- {
- desc: "nsNavHistoryFolderResultNode: After closing container in " +
- "loading(), opened() should not be called",
-
- loading: function (node, newState, oldState) {
- this.checkStateChanged("loading", 1);
- this.checkArgs("loading", node, oldState, node.STATE_CLOSED);
- print("Closing container");
- node.containerOpen = false;
- },
-
- opened: function (node, newState, oldState) {
- do_throw("opened should not be called");
- },
-
- closed: function (node, newState, oldState) {
- this.checkStateChanged("closed", 1);
- this.checkState("loading", 1);
- this.checkArgs("closed", node, oldState, node.STATE_LOADING);
- this.success();
- }
- }
-];
-
-
-/**
- * Instances of this class become the prototypes of the test objects above.
- * Each test can therefore use the methods of this class, or they can override
- * them if they want. To run a test, call setup() and then run().
- */
-function Test() {
- // This maps a state name to the number of times it's been observed.
- this.stateCounts = {};
- // Promise object resolved when the next test can be run.
- this.deferNextTest = Promise.defer();
-}
-
-Test.prototype = {
- /**
- * Call this when an observer observes a container state change to sanity
- * check the arguments.
- *
- * @param aNewState
- * The name of the new state. Used only for printing out helpful info.
- * @param aNode
- * The node argument passed to containerStateChanged.
- * @param aOldState
- * The old state argument passed to containerStateChanged.
- * @param aExpectOldState
- * The expected old state.
- */
- checkArgs: function (aNewState, aNode, aOldState, aExpectOldState) {
- print("Node passed on " + aNewState + " should be result.root");
- do_check_eq(this.result.root, aNode);
- print("Old state passed on " + aNewState + " should be " + aExpectOldState);
-
- // aOldState comes from xpconnect and will therefore be defined. It may be
- // zero, though, so use strict equality just to make sure aExpectOldState is
- // also defined.
- do_check_true(aOldState === aExpectOldState);
- },
-
- /**
- * Call this when an observer observes a container state change. It registers
- * the state change and ensures that it has been observed the given number
- * of times. See checkState for parameter explanations.
- *
- * @return The number of times aState has been observed, including the new
- * observation.
- */
- checkStateChanged: function (aState, aExpectedMin, aExpectedMax) {
- print(aState + " state change observed");
- if (!this.stateCounts.hasOwnProperty(aState))
- this.stateCounts[aState] = 0;
- this.stateCounts[aState]++;
- return this.checkState(aState, aExpectedMin, aExpectedMax);
- },
-
- /**
- * Ensures that the state has been observed the given number of times.
- *
- * @param aState
- * The name of the state.
- * @param aExpectedMin
- * The state must have been observed at least this number of times.
- * @param aExpectedMax
- * The state must have been observed at most this number of times.
- * This parameter is optional. If undefined, it's set to
- * aExpectedMin.
- * @return The number of times aState has been observed, including the new
- * observation.
- */
- checkState: function (aState, aExpectedMin, aExpectedMax) {
- let cnt = this.stateCounts[aState] || 0;
- if (aExpectedMax === undefined)
- aExpectedMax = aExpectedMin;
- if (aExpectedMin === aExpectedMax) {
- print(aState + " should be observed only " + aExpectedMin +
- " times (actual = " + cnt + ")");
- }
- else {
- print(aState + " should be observed at least " + aExpectedMin +
- " times and at most " + aExpectedMax + " times (actual = " +
- cnt + ")");
- }
- do_check_true(cnt >= aExpectedMin && cnt <= aExpectedMax);
- return cnt;
- },
-
- /**
- * Asynchronously opens the root of the test's result.
- */
- openContainer: function () {
- // Set up the result observer. It delegates to this object's callbacks and
- // wraps them in a try-catch so that errors don't get eaten.
- let self = this;
- this.observer = {
- containerStateChanged: function (container, oldState, newState) {
- print("New state passed to containerStateChanged() should equal the " +
- "container's current state");
- do_check_eq(newState, container.state);
-
- try {
- switch (newState) {
- case Ci.nsINavHistoryContainerResultNode.STATE_LOADING:
- self.loading(container, newState, oldState);
- break;
- case Ci.nsINavHistoryContainerResultNode.STATE_OPENED:
- self.opened(container, newState, oldState);
- break;
- case Ci.nsINavHistoryContainerResultNode.STATE_CLOSED:
- self.closed(container, newState, oldState);
- break;
- default:
- do_throw("Unexpected new state! " + newState);
- }
- }
- catch (err) {
- do_throw(err);
- }
- },
- };
- this.result.addObserver(this.observer, false);
-
- print("Opening container");
- this.result.root.containerOpen = true;
- },
-
- /**
- * Starts the test and returns a promise resolved when the test completes.
- */
- run: function () {
- this.openContainer();
- return this.deferNextTest.promise;
- },
-
- /**
- * This must be called before run(). It adds a bookmark and sets up the
- * test's result. Override if need be.
- */
- setup: function*() {
- // Populate the database with different types of bookmark items.
- this.data = DataHelper.makeDataArray([
- { type: "bookmark" },
- { type: "separator" },
- { type: "folder" },
- { type: "bookmark", uri: "place:terms=foo" }
- ]);
- yield task_populateDB(this.data);
-
- // Make a query.
- this.query = PlacesUtils.history.getNewQuery();
- this.query.setFolders([DataHelper.defaults.bookmark.parent], 1);
- this.opts = PlacesUtils.history.getNewQueryOptions();
- this.opts.asyncEnabled = true;
- this.result = PlacesUtils.history.executeQuery(this.query, this.opts);
- },
-
- /**
- * Call this when the test has succeeded. It cleans up resources and starts
- * the next test.
- */
- success: function () {
- this.result.removeObserver(this.observer);
-
- // Resolve the promise object that indicates that the next test can be run.
- this.deferNextTest.resolve();
- }
-};
-
-/**
- * This makes it a little bit easier to use the functions of head_queries.js.
- */
-var DataHelper = {
- defaults: {
- bookmark: {
- parent: PlacesUtils.bookmarks.unfiledBookmarksFolder,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- uri: "http://example.com/",
- title: "test bookmark"
- },
-
- folder: {
- parent: PlacesUtils.bookmarks.unfiledBookmarksFolder,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- title: "test folder"
- },
-
- separator: {
- parent: PlacesUtils.bookmarks.unfiledBookmarksFolder,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- }
- },
-
- /**
- * Converts an array of simple bookmark item descriptions to the more verbose
- * format required by task_populateDB() in head_queries.js.
- *
- * @param aData
- * An array of objects, each of which describes a bookmark item.
- * @return An array of objects suitable for passing to populateDB().
- */
- makeDataArray: function DH_makeDataArray(aData) {
- let self = this;
- return aData.map(function (dat) {
- let type = dat.type;
- dat = self._makeDataWithDefaults(dat, self.defaults[type]);
- switch (type) {
- case "bookmark":
- return {
- isBookmark: true,
- uri: dat.uri,
- parentGuid: dat.parentGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: dat.title,
- isInQuery: true
- };
- case "separator":
- return {
- isSeparator: true,
- parentGuid: dat.parentGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- isInQuery: true
- };
- case "folder":
- return {
- isFolder: true,
- parentGuid: dat.parentGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: dat.title,
- isInQuery: true
- };
- default:
- do_throw("Unknown data type when populating DB: " + type);
- return undefined;
- }
- });
- },
-
- /**
- * Returns a copy of aData, except that any properties that are undefined but
- * defined in aDefaults are set to the corresponding values in aDefaults.
- *
- * @param aData
- * An object describing a bookmark item.
- * @param aDefaults
- * An object describing the default bookmark item.
- * @return A copy of aData with defaults values set.
- */
- _makeDataWithDefaults: function DH__makeDataWithDefaults(aData, aDefaults) {
- let dat = {};
- for (let [prop, val] of Object.entries(aDefaults)) {
- dat[prop] = aData.hasOwnProperty(prop) ? aData[prop] : val;
- }
- return dat;
- }
-};
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_async()
-{
- for (let test of tests) {
- yield PlacesUtils.bookmarks.eraseEverything();
-
- test.__proto__ = new Test();
- yield test.setup();
-
- print("------ Running test: " + test.desc);
- yield test.run();
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
- print("All tests done, exiting");
-});
diff --git a/toolkit/components/places/tests/queries/test_containersQueries_sorting.js b/toolkit/components/places/tests/queries/test_containersQueries_sorting.js
deleted file mode 100644
index ab9f2bf90..000000000
--- a/toolkit/components/places/tests/queries/test_containersQueries_sorting.js
+++ /dev/null
@@ -1,411 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Testing behavior of bug 473157
- * "Want to sort history in container view without sorting the containers"
- * and regression bug 488783
- * Tags list no longer sorted (alphabetized).
- * This test is for global testing sorting containers queries.
- */
-
-// Globals and Constants
-
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-var bh = hs.QueryInterface(Ci.nsIBrowserHistory);
-var tagging = Cc["@mozilla.org/browser/tagging-service;1"].
- getService(Ci.nsITaggingService);
-
-var resultTypes = [
- {value: Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY, name: "RESULTS_AS_DATE_QUERY"},
- {value: Ci.nsINavHistoryQueryOptions.RESULTS_AS_SITE_QUERY, name: "RESULTS_AS_SITE_QUERY"},
- {value: Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY, name: "RESULTS_AS_DATE_SITE_QUERY"},
- {value: Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_QUERY, name: "RESULTS_AS_TAG_QUERY"},
-];
-
-var sortingModes = [
- {value: Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_ASCENDING, name: "SORT_BY_TITLE_ASCENDING"},
- {value: Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_DESCENDING, name: "SORT_BY_TITLE_DESCENDING"},
- {value: Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_ASCENDING, name: "SORT_BY_DATE_ASCENDING"},
- {value: Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING, name: "SORT_BY_DATE_DESCENDING"},
- {value: Ci.nsINavHistoryQueryOptions.SORT_BY_DATEADDED_ASCENDING, name: "SORT_BY_DATEADDED_ASCENDING"},
- {value: Ci.nsINavHistoryQueryOptions.SORT_BY_DATEADDED_DESCENDING, name: "SORT_BY_DATEADDED_DESCENDING"},
-];
-
-// These pages will be added from newest to oldest and from less visited to most
-// visited.
-var pages = [
- "http://www.mozilla.org/c/",
- "http://www.mozilla.org/a/",
- "http://www.mozilla.org/b/",
- "http://www.mozilla.com/c/",
- "http://www.mozilla.com/a/",
- "http://www.mozilla.com/b/",
-];
-
-var tags = [
- "mozilla",
- "Development",
- "test",
-];
-
-// Test Runner
-
-/**
- * Enumerates all the sequences of the cartesian product of the arrays contained
- * in aSequences. Examples:
- *
- * cartProd([[1, 2, 3], ["a", "b"]], callback);
- * // callback is called 3 * 2 = 6 times with the following arrays:
- * // [1, "a"], [1, "b"], [2, "a"], [2, "b"], [3, "a"], [3, "b"]
- *
- * cartProd([["a"], [1, 2, 3], ["X", "Y"]], callback);
- * // callback is called 1 * 3 * 2 = 6 times with the following arrays:
- * // ["a", 1, "X"], ["a", 1, "Y"], ["a", 2, "X"], ["a", 2, "Y"],
- * // ["a", 3, "X"], ["a", 3, "Y"]
- *
- * cartProd([[1], [2], [3], [4]], callback);
- * // callback is called 1 * 1 * 1 * 1 = 1 time with the following array:
- * // [1, 2, 3, 4]
- *
- * cartProd([], callback);
- * // callback is 0 times
- *
- * cartProd([[1, 2, 3, 4]], callback);
- * // callback is called 4 times with the following arrays:
- * // [1], [2], [3], [4]
- *
- * @param aSequences
- * an array that contains an arbitrary number of arrays
- * @param aCallback
- * a function that is passed each sequence of the product as it's
- * computed
- * @return the total number of sequences in the product
- */
-function cartProd(aSequences, aCallback)
-{
- if (aSequences.length === 0)
- return 0;
-
- // For each sequence in aSequences, we maintain a pointer (an array index,
- // really) to the element we're currently enumerating in that sequence
- var seqEltPtrs = aSequences.map(i => 0);
-
- var numProds = 0;
- var done = false;
- while (!done) {
- numProds++;
-
- // prod = sequence in product we're currently enumerating
- var prod = [];
- for (var i = 0; i < aSequences.length; i++) {
- prod.push(aSequences[i][seqEltPtrs[i]]);
- }
- aCallback(prod);
-
- // The next sequence in the product differs from the current one by just a
- // single element. Determine which element that is. We advance the
- // "rightmost" element pointer to the "right" by one. If we move past the
- // end of that pointer's sequence, reset the pointer to the first element
- // in its sequence and then try the sequence to the "left", and so on.
-
- // seqPtr = index of rightmost input sequence whose element pointer is not
- // past the end of the sequence
- var seqPtr = aSequences.length - 1;
- while (!done) {
- // Advance the rightmost element pointer.
- seqEltPtrs[seqPtr]++;
-
- // The rightmost element pointer is past the end of its sequence.
- if (seqEltPtrs[seqPtr] >= aSequences[seqPtr].length) {
- seqEltPtrs[seqPtr] = 0;
- seqPtr--;
-
- // All element pointers are past the ends of their sequences.
- if (seqPtr < 0)
- done = true;
- }
- else break;
- }
- }
- return numProds;
-}
-
-/**
- * Test a query based on passed-in options.
- *
- * @param aSequence
- * array of options we will use to query.
- */
-function test_query_callback(aSequence) {
- do_check_eq(aSequence.length, 2);
- var resultType = aSequence[0];
- var sortingMode = aSequence[1];
- print("\n\n*** Testing default sorting for resultType (" + resultType.name + ") and sortingMode (" + sortingMode.name + ")");
-
- // Skip invalid combinations sorting queries by none.
- if (resultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_QUERY &&
- (sortingMode.value == Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_ASCENDING ||
- sortingMode.value == Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING)) {
- // This is a bookmark query, we can't sort by visit date.
- sortingMode.value = Ci.nsINavHistoryQueryOptions.SORT_BY_NONE;
- }
- if (resultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY ||
- resultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_SITE_QUERY ||
- resultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY) {
- // This is an history query, we can't sort by date added.
- if (sortingMode.value == Ci.nsINavHistoryQueryOptions.SORT_BY_DATEADDED_ASCENDING ||
- sortingMode.value == Ci.nsINavHistoryQueryOptions.SORT_BY_DATEADDED_DESCENDING)
- sortingMode.value = Ci.nsINavHistoryQueryOptions.SORT_BY_NONE;
- }
-
- // Create a new query with required options.
- var query = PlacesUtils.history.getNewQuery();
- var options = PlacesUtils.history.getNewQueryOptions();
- options.resultType = resultType.value;
- options.sortingMode = sortingMode.value;
-
- // Compare resultset with expectedData.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
-
- if (resultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY ||
- resultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY) {
- // Date containers are always sorted by date descending.
- check_children_sorting(root,
- Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING);
- }
- else
- check_children_sorting(root, sortingMode.value);
-
- // Now Check sorting of the first child container.
- var container = root.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- container.containerOpen = true;
-
- if (resultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY) {
- // Has more than one level of containers, first we check the sorting of
- // the first level (site containers), those won't inherit sorting...
- check_children_sorting(container,
- Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_ASCENDING);
- // ...then we check sorting of the contained urls, we can't inherit sorting
- // since the above level does not inherit it, so they will be sorted by
- // title ascending.
- let innerContainer = container.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- innerContainer.containerOpen = true;
- check_children_sorting(innerContainer,
- Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_ASCENDING);
- innerContainer.containerOpen = false;
- }
- else if (resultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_TAG_QUERY) {
- // Sorting mode for tag contents is hardcoded for now, to allow for faster
- // duplicates filtering.
- check_children_sorting(container,
- Ci.nsINavHistoryQueryOptions.SORT_BY_NONE);
- }
- else
- check_children_sorting(container, sortingMode.value);
-
- container.containerOpen = false;
- root.containerOpen = false;
-
- test_result_sortingMode_change(result, resultType, sortingMode);
-}
-
-/**
- * Sets sortingMode on aResult and checks for correct sorting of children.
- * Containers should not change their sorting, while contained uri nodes should.
- *
- * @param aResult
- * nsINavHistoryResult generated by our query.
- * @param aResultType
- * required result type.
- * @param aOriginalSortingMode
- * the sorting mode from query's options.
- */
-function test_result_sortingMode_change(aResult, aResultType, aOriginalSortingMode) {
- var root = aResult.root;
- // Now we set sortingMode on the result and check that containers are not
- // sorted while children are.
- sortingModes.forEach(function sortingModeChecker(aForcedSortingMode) {
- print("\n* Test setting sortingMode (" + aForcedSortingMode.name + ") " +
- "on result with resultType (" + aResultType.name + ") " +
- "currently sorted as (" + aOriginalSortingMode.name + ")");
-
- aResult.sortingMode = aForcedSortingMode.value;
- root.containerOpen = true;
-
- if (aResultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY ||
- aResultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY) {
- // Date containers are always sorted by date descending.
- check_children_sorting(root,
- Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING);
- }
- else if (aResultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_SITE_QUERY &&
- (aOriginalSortingMode.value == Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_ASCENDING ||
- aOriginalSortingMode.value == Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING)) {
- // Site containers don't have a good time property to sort by.
- check_children_sorting(root,
- Ci.nsINavHistoryQueryOptions.SORT_BY_NONE);
- }
- else
- check_children_sorting(root, aOriginalSortingMode.value);
-
- // Now Check sorting of the first child container.
- var container = root.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- container.containerOpen = true;
-
- if (aResultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY) {
- // Has more than one level of containers, first we check the sorting of
- // the first level (site containers), those won't be sorted...
- check_children_sorting(container,
- Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_ASCENDING);
- // ...then we check sorting of the second level of containers, result
- // will sort them through recursiveSort.
- let innerContainer = container.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- innerContainer.containerOpen = true;
- check_children_sorting(innerContainer, aForcedSortingMode.value);
- innerContainer.containerOpen = false;
- }
- else {
- if (aResultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY ||
- aResultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY ||
- aResultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_SITE_QUERY) {
- // Date containers are always sorted by date descending.
- check_children_sorting(root, Ci.nsINavHistoryQueryOptions.SORT_BY_NONE);
- }
- else if (aResultType.value == Ci.nsINavHistoryQueryOptions.RESULTS_AS_SITE_QUERY &&
- (aOriginalSortingMode.value == Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_ASCENDING ||
- aOriginalSortingMode.value == Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING)) {
- // Site containers don't have a good time property to sort by.
- check_children_sorting(root, Ci.nsINavHistoryQueryOptions.SORT_BY_NONE);
- }
- else
- check_children_sorting(root, aOriginalSortingMode.value);
-
- // Children should always be sorted.
- check_children_sorting(container, aForcedSortingMode.value);
- }
-
- container.containerOpen = false;
- root.containerOpen = false;
- });
-}
-
-/**
- * Test if children of aRootNode are correctly sorted.
- * @param aRootNode
- * already opened root node from our query's result.
- * @param aExpectedSortingMode
- * The sortingMode we expect results to be.
- */
-function check_children_sorting(aRootNode, aExpectedSortingMode) {
- var results = [];
- print("Found children:");
- for (let i = 0; i < aRootNode.childCount; i++) {
- results[i] = aRootNode.getChild(i);
- print(i + " " + results[i].title);
- }
-
- // Helper for case insensitive string comparison.
- function caseInsensitiveStringComparator(a, b) {
- var aLC = a.toLowerCase();
- var bLC = b.toLowerCase();
- if (aLC < bLC)
- return -1;
- if (aLC > bLC)
- return 1;
- return 0;
- }
-
- // Get a comparator based on expected sortingMode.
- var comparator;
- switch (aExpectedSortingMode) {
- case Ci.nsINavHistoryQueryOptions.SORT_BY_NONE:
- comparator = function (a, b) {
- return 0;
- }
- break;
- case Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_ASCENDING:
- comparator = function (a, b) {
- return caseInsensitiveStringComparator(a.title, b.title);
- }
- break;
- case Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_DESCENDING:
- comparator = function (a, b) {
- return -caseInsensitiveStringComparator(a.title, b.title);
- }
- break;
- case Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_ASCENDING:
- comparator = function (a, b) {
- return a.time - b.time;
- }
- break;
- case Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING:
- comparator = function (a, b) {
- return b.time - a.time;
- }
- case Ci.nsINavHistoryQueryOptions.SORT_BY_DATEADDED_ASCENDING:
- comparator = function (a, b) {
- return a.dateAdded - b.dateAdded;
- }
- break;
- case Ci.nsINavHistoryQueryOptions.SORT_BY_DATEADDED_DESCENDING:
- comparator = function (a, b) {
- return b.dateAdded - a.dateAdded;
- }
- break;
- default:
- do_throw("Unknown sorting type: " + aExpectedSortingMode);
- }
-
- // Make an independent copy of the results array and sort it.
- var sortedResults = results.slice();
- sortedResults.sort(comparator);
- // Actually compare returned children with our sorted array.
- for (let i = 0; i < sortedResults.length; i++) {
- if (sortedResults[i].title != results[i].title)
- print(i + " index wrong, expected " + sortedResults[i].title +
- " found " + results[i].title);
- do_check_eq(sortedResults[i].title, results[i].title);
- }
-}
-
-// Main
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_containersQueries_sorting()
-{
- // Add visits, bookmarks and tags to our database.
- var timeInMilliseconds = Date.now();
- var visitCount = 0;
- var dayOffset = 0;
- var visits = [];
- pages.forEach(aPageUrl => visits.push(
- { isVisit: true,
- isBookmark: true,
- transType: Ci.nsINavHistoryService.TRANSITION_TYPED,
- uri: aPageUrl,
- title: aPageUrl,
- // subtract 5 hours per iteration, to expose more than one day container.
- lastVisit: (timeInMilliseconds - (18000 * 1000 * dayOffset++)) * 1000,
- visitCount: visitCount++,
- isTag: true,
- tagArray: tags,
- isInQuery: true }));
- yield task_populateDB(visits);
-
- cartProd([resultTypes, sortingModes], test_query_callback);
-});
diff --git a/toolkit/components/places/tests/queries/test_history_queries_tags_liveUpdate.js b/toolkit/components/places/tests/queries/test_history_queries_tags_liveUpdate.js
deleted file mode 100644
index fbbacf6c9..000000000
--- a/toolkit/components/places/tests/queries/test_history_queries_tags_liveUpdate.js
+++ /dev/null
@@ -1,200 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// This test ensures that tags changes are correctly live-updated in a history
-// query.
-
-let timeInMicroseconds = PlacesUtils.toPRTime(Date.now() - 10000);
-
-function newTimeInMicroseconds() {
- timeInMicroseconds = timeInMicroseconds + 1000;
- return timeInMicroseconds;
-}
-
-var gTestData = [
- {
- isVisit: true,
- uri: "http://example.com/1/",
- lastVisit: newTimeInMicroseconds(),
- isInQuery: true,
- isBookmark: true,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "example1",
- },
- {
- isVisit: true,
- uri: "http://example.com/2/",
- lastVisit: newTimeInMicroseconds(),
- isInQuery: true,
- isBookmark: true,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "example2",
- },
- {
- isVisit: true,
- uri: "http://example.com/3/",
- lastVisit: newTimeInMicroseconds(),
- isInQuery: true,
- isBookmark: true,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "example3",
- },
-];
-
-function newQueryWithOptions()
-{
- return [ PlacesUtils.history.getNewQuery(),
- PlacesUtils.history.getNewQueryOptions() ];
-}
-
-function testQueryContents(aQuery, aOptions, aCallback)
-{
- let root = PlacesUtils.history.executeQuery(aQuery, aOptions).root;
- root.containerOpen = true;
- aCallback(root);
- root.containerOpen = false;
-}
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_initialize()
-{
- yield task_populateDB(gTestData);
-});
-
-add_task(function pages_query()
-{
- let [query, options] = newQueryWithOptions();
- testQueryContents(query, options, function (root) {
- compareArrayToResult([gTestData[0], gTestData[1], gTestData[2]], root);
- for (let i = 0; i < root.childCount; i++) {
- let node = root.getChild(i);
- let uri = NetUtil.newURI(node.uri);
- do_check_eq(node.tags, null);
- PlacesUtils.tagging.tagURI(uri, ["test-tag"]);
- do_check_eq(node.tags, "test-tag");
- PlacesUtils.tagging.untagURI(uri, ["test-tag"]);
- do_check_eq(node.tags, null);
- }
- });
-});
-
-add_task(function visits_query()
-{
- let [query, options] = newQueryWithOptions();
- options.resultType = Ci.nsINavHistoryQueryOptions.RESULTS_AS_VISIT;
- testQueryContents(query, options, function (root) {
- compareArrayToResult([gTestData[0], gTestData[1], gTestData[2]], root);
- for (let i = 0; i < root.childCount; i++) {
- let node = root.getChild(i);
- let uri = NetUtil.newURI(node.uri);
- do_check_eq(node.tags, null);
- PlacesUtils.tagging.tagURI(uri, ["test-tag"]);
- do_check_eq(node.tags, "test-tag");
- PlacesUtils.tagging.untagURI(uri, ["test-tag"]);
- do_check_eq(node.tags, null);
- }
- });
-});
-
-add_task(function bookmarks_query()
-{
- let [query, options] = newQueryWithOptions();
- query.setFolders([PlacesUtils.unfiledBookmarksFolderId], 1);
- testQueryContents(query, options, function (root) {
- compareArrayToResult([gTestData[0], gTestData[1], gTestData[2]], root);
- for (let i = 0; i < root.childCount; i++) {
- let node = root.getChild(i);
- let uri = NetUtil.newURI(node.uri);
- do_check_eq(node.tags, null);
- PlacesUtils.tagging.tagURI(uri, ["test-tag"]);
- do_check_eq(node.tags, "test-tag");
- PlacesUtils.tagging.untagURI(uri, ["test-tag"]);
- do_check_eq(node.tags, null);
- }
- });
-});
-
-add_task(function pages_searchterm_query()
-{
- let [query, options] = newQueryWithOptions();
- query.searchTerms = "example";
- testQueryContents(query, options, function (root) {
- compareArrayToResult([gTestData[0], gTestData[1], gTestData[2]], root);
- for (let i = 0; i < root.childCount; i++) {
- let node = root.getChild(i);
- let uri = NetUtil.newURI(node.uri);
- do_check_eq(node.tags, null);
- PlacesUtils.tagging.tagURI(uri, ["test-tag"]);
- do_check_eq(node.tags, "test-tag");
- PlacesUtils.tagging.untagURI(uri, ["test-tag"]);
- do_check_eq(node.tags, null);
- }
- });
-});
-
-add_task(function visits_searchterm_query()
-{
- let [query, options] = newQueryWithOptions();
- query.searchTerms = "example";
- options.resultType = Ci.nsINavHistoryQueryOptions.RESULTS_AS_VISIT;
- testQueryContents(query, options, function (root) {
- compareArrayToResult([gTestData[0], gTestData[1], gTestData[2]], root);
- for (let i = 0; i < root.childCount; i++) {
- let node = root.getChild(i);
- let uri = NetUtil.newURI(node.uri);
- do_check_eq(node.tags, null);
- PlacesUtils.tagging.tagURI(uri, ["test-tag"]);
- do_check_eq(node.tags, "test-tag");
- PlacesUtils.tagging.untagURI(uri, ["test-tag"]);
- do_check_eq(node.tags, null);
- }
- });
-});
-
-add_task(function pages_searchterm_is_tag_query()
-{
- let [query, options] = newQueryWithOptions();
- query.searchTerms = "test-tag";
- testQueryContents(query, options, function (root) {
- compareArrayToResult([], root);
- gTestData.forEach(function (data) {
- let uri = NetUtil.newURI(data.uri);
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- uri,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- data.title);
- PlacesUtils.tagging.tagURI(uri, ["test-tag"]);
- compareArrayToResult([data], root);
- PlacesUtils.tagging.untagURI(uri, ["test-tag"]);
- compareArrayToResult([], root);
- });
- });
-});
-
-add_task(function visits_searchterm_is_tag_query()
-{
- let [query, options] = newQueryWithOptions();
- query.searchTerms = "test-tag";
- options.resultType = Ci.nsINavHistoryQueryOptions.RESULTS_AS_VISIT;
- testQueryContents(query, options, function (root) {
- compareArrayToResult([], root);
- gTestData.forEach(function (data) {
- let uri = NetUtil.newURI(data.uri);
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- uri,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- data.title);
- PlacesUtils.tagging.tagURI(uri, ["test-tag"]);
- compareArrayToResult([data], root);
- PlacesUtils.tagging.untagURI(uri, ["test-tag"]);
- compareArrayToResult([], root);
- });
- });
-});
diff --git a/toolkit/components/places/tests/queries/test_history_queries_titles_liveUpdate.js b/toolkit/components/places/tests/queries/test_history_queries_titles_liveUpdate.js
deleted file mode 100644
index eec87fe0e..000000000
--- a/toolkit/components/places/tests/queries/test_history_queries_titles_liveUpdate.js
+++ /dev/null
@@ -1,210 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// This test ensures that tags changes are correctly live-updated in a history
-// query.
-
-let timeInMicroseconds = PlacesUtils.toPRTime(Date.now() - 10000);
-
-function newTimeInMicroseconds() {
- timeInMicroseconds = timeInMicroseconds + 1000;
- return timeInMicroseconds;
-}
-
-var gTestData = [
- {
- isVisit: true,
- uri: "http://example.com/1/",
- lastVisit: newTimeInMicroseconds(),
- isInQuery: true,
- title: "title1",
- },
- {
- isVisit: true,
- uri: "http://example.com/2/",
- lastVisit: newTimeInMicroseconds(),
- isInQuery: true,
- title: "title2",
- },
- {
- isVisit: true,
- uri: "http://example.com/3/",
- lastVisit: newTimeInMicroseconds(),
- isInQuery: true,
- title: "title3",
- },
-];
-
-function searchNodeHavingUrl(aRoot, aUrl) {
- for (let i = 0; i < aRoot.childCount; i++) {
- if (aRoot.getChild(i).uri == aUrl) {
- return aRoot.getChild(i);
- }
- }
- return undefined;
-}
-
-function newQueryWithOptions()
-{
- return [ PlacesUtils.history.getNewQuery(),
- PlacesUtils.history.getNewQueryOptions() ];
-}
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* pages_query()
-{
- yield task_populateDB(gTestData);
-
- let [query, options] = newQueryWithOptions();
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
-
- compareArrayToResult([gTestData[0], gTestData[1], gTestData[2]], root);
- for (let i = 0; i < root.childCount; i++) {
- let node = root.getChild(i);
- do_check_eq(node.title, gTestData[i].title);
- let uri = NetUtil.newURI(node.uri);
- yield PlacesTestUtils.addVisits({uri: uri, title: "changedTitle"});
- do_check_eq(node.title, "changedTitle");
- yield PlacesTestUtils.addVisits({uri: uri, title: gTestData[i].title});
- do_check_eq(node.title, gTestData[i].title);
- }
-
- root.containerOpen = false;
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* visits_query()
-{
- yield task_populateDB(gTestData);
-
- let [query, options] = newQueryWithOptions();
- options.resultType = Ci.nsINavHistoryQueryOptions.RESULTS_AS_VISIT;
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
-
- compareArrayToResult([gTestData[0], gTestData[1], gTestData[2]], root);
-
- for (let testData of gTestData) {
- let uri = NetUtil.newURI(testData.uri);
- let node = searchNodeHavingUrl(root, testData.uri);
- do_check_eq(node.title, testData.title);
- yield PlacesTestUtils.addVisits({uri: uri, title: "changedTitle"});
- node = searchNodeHavingUrl(root, testData.uri);
- do_check_eq(node.title, "changedTitle");
- yield PlacesTestUtils.addVisits({uri: uri, title: testData.title});
- node = searchNodeHavingUrl(root, testData.uri);
- do_check_eq(node.title, testData.title);
- }
-
- root.containerOpen = false;
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* pages_searchterm_query()
-{
- yield task_populateDB(gTestData);
-
- let [query, options] = newQueryWithOptions();
- query.searchTerms = "example";
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
-
- compareArrayToResult([gTestData[0], gTestData[1], gTestData[2]], root);
- for (let i = 0; i < root.childCount; i++) {
- let node = root.getChild(i);
- let uri = NetUtil.newURI(node.uri);
- do_check_eq(node.title, gTestData[i].title);
- yield PlacesTestUtils.addVisits({uri: uri, title: "changedTitle"});
- do_check_eq(node.title, "changedTitle");
- yield PlacesTestUtils.addVisits({uri: uri, title: gTestData[i].title});
- do_check_eq(node.title, gTestData[i].title);
- }
-
- root.containerOpen = false;
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* visits_searchterm_query()
-{
- yield task_populateDB(gTestData);
-
- let [query, options] = newQueryWithOptions();
- query.searchTerms = "example";
- options.resultType = Ci.nsINavHistoryQueryOptions.RESULTS_AS_VISIT;
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
-
- compareArrayToResult([gTestData[0], gTestData[1], gTestData[2]], root);
- for (let testData of gTestData) {
- let uri = NetUtil.newURI(testData.uri);
- let node = searchNodeHavingUrl(root, testData.uri);
- do_check_eq(node.title, testData.title);
- yield PlacesTestUtils.addVisits({uri: uri, title: "changedTitle"});
- node = searchNodeHavingUrl(root, testData.uri);
- do_check_eq(node.title, "changedTitle");
- yield PlacesTestUtils.addVisits({uri: uri, title: testData.title});
- node = searchNodeHavingUrl(root, testData.uri);
- do_check_eq(node.title, testData.title);
- }
-
- root.containerOpen = false;
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* pages_searchterm_is_title_query()
-{
- yield task_populateDB(gTestData);
-
- let [query, options] = newQueryWithOptions();
- query.searchTerms = "match";
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- compareArrayToResult([], root);
- for (let data of gTestData) {
- let uri = NetUtil.newURI(data.uri);
- let origTitle = data.title;
- data.title = "match";
- yield PlacesTestUtils.addVisits({ uri: uri, title: data.title,
- visitDate: data.lastVisit });
- compareArrayToResult([data], root);
- data.title = origTitle;
- yield PlacesTestUtils.addVisits({ uri: uri, title: data.title,
- visitDate: data.lastVisit });
- compareArrayToResult([], root);
- }
-
- root.containerOpen = false;
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* visits_searchterm_is_title_query()
-{
- yield task_populateDB(gTestData);
-
- let [query, options] = newQueryWithOptions();
- query.searchTerms = "match";
- options.resultType = Ci.nsINavHistoryQueryOptions.RESULTS_AS_VISIT;
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- compareArrayToResult([], root);
- for (let data of gTestData) {
- let uri = NetUtil.newURI(data.uri);
- let origTitle = data.title;
- data.title = "match";
- yield PlacesTestUtils.addVisits({ uri: uri, title: data.title,
- visitDate: data.lastVisit });
- compareArrayToResult([data], root);
- data.title = origTitle;
- yield PlacesTestUtils.addVisits({ uri: uri, title: data.title,
- visitDate: data.lastVisit });
- compareArrayToResult([], root);
- }
-
- root.containerOpen = false;
- yield PlacesTestUtils.clearHistory();
-});
diff --git a/toolkit/components/places/tests/queries/test_onlyBookmarked.js b/toolkit/components/places/tests/queries/test_onlyBookmarked.js
deleted file mode 100644
index 45704c109..000000000
--- a/toolkit/components/places/tests/queries/test_onlyBookmarked.js
+++ /dev/null
@@ -1,128 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * The next thing we do is create a test database for us. Each test runs with
- * its own database (tail_queries.js will clear it after the run). Take a look
- * at the queryData object in head_queries.js, and you'll see how this object
- * works. You can call it anything you like, but I usually use "testData".
- * I'll include a couple of example entries in the database.
- *
- * Note that to use the compareArrayToResult API, you need to put all the
- * results that are in the query set at the top of the testData list, and those
- * results MUST be in the same sort order as the items in the resulting query.
- */
-
-var testData = [
- // Add a bookmark that should be in the results
- { isBookmark: true,
- uri: "http://bookmarked.com/",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- isInQuery: true },
-
- // Add a bookmark that should not be in the results
- { isBookmark: true,
- uri: "http://bookmarked-elsewhere.com/",
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- isInQuery: false },
-
- // Add an un-bookmarked visit
- { isVisit: true,
- uri: "http://notbookmarked.com/",
- isInQuery: false }
-];
-
-
-/**
- * run_test is where the magic happens. This is automatically run by the test
- * harness. It is where you do the work of creating the query, running it, and
- * playing with the result set.
- */
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_onlyBookmarked()
-{
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(testData);
-
- // Query
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.toolbarFolderId], 1);
- query.onlyBookmarked = true;
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.queryType = options.QUERY_TYPE_HISTORY;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
-
- // You can use this to compare the data in the array with the result set,
- // if the array's isInQuery: true items are sorted the same way as the result
- // set.
- do_print("begin first test");
- compareArrayToResult(testData, root);
- do_print("end first test");
-
- // Test live-update
- var liveUpdateTestData = [
- // Add a bookmark that should show up
- { isBookmark: true,
- uri: "http://bookmarked2.com/",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- isInQuery: true },
-
- // Add a bookmark that should not show up
- { isBookmark: true,
- uri: "http://bookmarked-elsewhere2.com/",
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- isInQuery: false }
- ];
-
- yield task_populateDB(liveUpdateTestData); // add to the db
-
- // add to the test data
- testData.push(liveUpdateTestData[0]);
- testData.push(liveUpdateTestData[1]);
-
- // re-query and test
- do_print("begin live-update test");
- compareArrayToResult(testData, root);
- do_print("end live-update test");
-/*
- // we are actually not updating during a batch.
- // see bug 432706 for details.
-
- // Here's a batch update
- var updateBatch = {
- runBatched: function (aUserData) {
- liveUpdateTestData[0].uri = "http://bookmarked3.com";
- liveUpdateTestData[1].uri = "http://bookmarked-elsewhere3.com";
- populateDB(liveUpdateTestData);
- testData.push(liveUpdateTestData[0]);
- testData.push(liveUpdateTestData[1]);
- }
- };
-
- PlacesUtils.history.runInBatchMode(updateBatch, null);
-
- // re-query and test
- do_print("begin batched test");
- compareArrayToResult(testData, root);
- do_print("end batched test");
-*/
- // Close the container when finished
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/queries/test_queryMultipleFolder.js b/toolkit/components/places/tests/queries/test_queryMultipleFolder.js
deleted file mode 100644
index 694728a43..000000000
--- a/toolkit/components/places/tests/queries/test_queryMultipleFolder.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_queryMultipleFolders() {
- // adding bookmarks in the folders
- let folderIds = [];
- let bookmarkIds = [];
- for (let i = 0; i < 3; ++i) {
- let folder = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: `Folder${i}`
- });
- folderIds.push(yield PlacesUtils.promiseItemId(folder.guid));
-
- for (let j = 0; j < 7; ++j) {
- let bm = yield PlacesUtils.bookmarks.insert({
- parentGuid: (yield PlacesUtils.promiseItemGuid(folderIds[i])),
- url: `http://Bookmark${i}_${j}.com`,
- title: ""
- });
- bookmarkIds.push(yield PlacesUtils.promiseItemId(bm.guid));
- }
- }
-
- // using queryStringToQueries
- let query = {};
- let options = {};
- let maxResults = 20;
- let queryString = "place:" + folderIds.map((id) => {
- return "folder=" + id;
- }).join('&') + "&sort=5&maxResults=" + maxResults;
- PlacesUtils.history.queryStringToQueries(queryString, query, {}, options);
- let rootNode = PlacesUtils.history.executeQuery(query.value[0], options.value).root;
- rootNode.containerOpen = true;
- let resultLength = rootNode.childCount;
- Assert.equal(resultLength, maxResults);
- for (let i = 0; i < resultLength; ++i) {
- let node = rootNode.getChild(i);
- Assert.equal(bookmarkIds[i], node.itemId, node.uri);
- }
- rootNode.containerOpen = false;
-
- // using getNewQuery and getNewQueryOptions
- query = PlacesUtils.history.getNewQuery();
- options = PlacesUtils.history.getNewQueryOptions();
- query.setFolders(folderIds, folderIds.length);
- options.sortingMode = options.SORT_BY_URI_ASCENDING;
- options.maxResults = maxResults;
- rootNode = PlacesUtils.history.executeQuery(query, options).root;
- rootNode.containerOpen = true;
- resultLength = rootNode.childCount;
- Assert.equal(resultLength, maxResults);
- for (let i = 0; i < resultLength; ++i) {
- let node = rootNode.getChild(i);
- Assert.equal(bookmarkIds[i], node.itemId, node.uri);
- }
- rootNode.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/queries/test_querySerialization.js b/toolkit/components/places/tests/queries/test_querySerialization.js
deleted file mode 100644
index 24cf8aa9b..000000000
--- a/toolkit/components/places/tests/queries/test_querySerialization.js
+++ /dev/null
@@ -1,797 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Tests Places query serialization. Associated bug is
- * https://bugzilla.mozilla.org/show_bug.cgi?id=370197
- *
- * The simple idea behind this test is to try out different combinations of
- * query switches and ensure that queries are the same before serialization
- * as they are after de-serialization.
- *
- * In the code below, "switch" refers to a query option -- "option" in a broad
- * sense, not nsINavHistoryQueryOptions specifically (which is why we refer to
- * them as switches, not options). Both nsINavHistoryQuery and
- * nsINavHistoryQueryOptions allow you to specify switches that affect query
- * strings. nsINavHistoryQuery instances have attributes hasBeginTime,
- * hasEndTime, hasSearchTerms, and so on. nsINavHistoryQueryOptions instances
- * have attributes sortingMode, resultType, excludeItems, etc.
- *
- * Ideally we would like to test all 2^N subsets of switches, where N is the
- * total number of switches; switches might interact in erroneous or other ways
- * we do not expect. However, since N is large (21 at this time), that's
- * impractical for a single test in a suite.
- *
- * Instead we choose all possible subsets of a certain, smaller size. In fact
- * we begin by choosing CHOOSE_HOW_MANY_SWITCHES_LO and ramp up to
- * CHOOSE_HOW_MANY_SWITCHES_HI.
- *
- * There are two more wrinkles. First, for some switches we'd like to be able to
- * test multiple values. For example, it seems like a good idea to test both an
- * empty string and a non-empty string for switch nsINavHistoryQuery.searchTerms.
- * When switches have more than one value for a test run, we use the Cartesian
- * product of their values to generate all possible combinations of values.
- *
- * Second, we need to also test serialization of multiple nsINavHistoryQuery
- * objects at once. To do this, we remember the previous NUM_MULTIPLE_QUERIES
- * queries we tested individually and then serialize them together. We do this
- * each time we test an individual query. Thus the set of queries we test
- * together loses one query and gains another each time.
- *
- * To summarize, here's how this test works:
- *
- * - For n = CHOOSE_HOW_MANY_SWITCHES_LO to CHOOSE_HOW_MANY_SWITCHES_HI:
- * - From the total set of switches choose all possible subsets of size n.
- * For each of those subsets s:
- * - Collect the test runs of each switch in subset s and take their
- * Cartesian product. For each sequence in the product:
- * - Create nsINavHistoryQuery and nsINavHistoryQueryOptions objects
- * with the chosen switches and test run values.
- * - Serialize the query.
- * - De-serialize and ensure that the de-serialized query objects equal
- * the originals.
- * - For each of the previous NUM_MULTIPLE_QUERIES
- * nsINavHistoryQueryOptions objects o we created:
- * - Serialize the previous NUM_MULTIPLE_QUERIES nsINavHistoryQuery
- * objects together with o.
- * - De-serialize and ensure that the de-serialized query objects
- * equal the originals.
- */
-
-const CHOOSE_HOW_MANY_SWITCHES_LO = 1;
-const CHOOSE_HOW_MANY_SWITCHES_HI = 2;
-
-const NUM_MULTIPLE_QUERIES = 2;
-
-// The switches are represented by objects below, in arrays querySwitches and
-// queryOptionSwitches. Use them to set up test runs.
-//
-// Some switches have special properties (where noted), but all switches must
-// have the following properties:
-//
-// matches: A function that takes two nsINavHistoryQuery objects (in the case
-// of nsINavHistoryQuery switches) or two nsINavHistoryQueryOptions
-// objects (for nsINavHistoryQueryOptions switches) and returns true
-// if the values of the switch in the two objects are equal. This is
-// the foundation of how we determine if two queries are equal.
-// runs: An array of functions. Each function takes an nsINavHistoryQuery
-// object and an nsINavHistoryQueryOptions object. The functions
-// should set the attributes of one of the two objects as appropriate
-// to their switches. This is how switch values are set for each test
-// run.
-//
-// The following properties are optional:
-//
-// desc: An informational string to print out during runs when the switch
-// is chosen. Hopefully helpful if the test fails.
-
-// nsINavHistoryQuery switches
-const querySwitches = [
- // hasBeginTime
- {
- // flag and subswitches are used by the flagSwitchMatches function. Several
- // of the nsINavHistoryQuery switches (like this one) are really guard flags
- // that indicate if other "subswitches" are enabled.
- flag: "hasBeginTime",
- subswitches: ["beginTime", "beginTimeReference", "absoluteBeginTime"],
- desc: "nsINavHistoryQuery.hasBeginTime",
- matches: flagSwitchMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQuery.beginTime = Date.now() * 1000;
- aQuery.beginTimeReference = Ci.nsINavHistoryQuery.TIME_RELATIVE_EPOCH;
- },
- function (aQuery, aQueryOptions) {
- aQuery.beginTime = Date.now() * 1000;
- aQuery.beginTimeReference = Ci.nsINavHistoryQuery.TIME_RELATIVE_TODAY;
- }
- ]
- },
- // hasEndTime
- {
- flag: "hasEndTime",
- subswitches: ["endTime", "endTimeReference", "absoluteEndTime"],
- desc: "nsINavHistoryQuery.hasEndTime",
- matches: flagSwitchMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQuery.endTime = Date.now() * 1000;
- aQuery.endTimeReference = Ci.nsINavHistoryQuery.TIME_RELATIVE_EPOCH;
- },
- function (aQuery, aQueryOptions) {
- aQuery.endTime = Date.now() * 1000;
- aQuery.endTimeReference = Ci.nsINavHistoryQuery.TIME_RELATIVE_TODAY;
- }
- ]
- },
- // hasSearchTerms
- {
- flag: "hasSearchTerms",
- subswitches: ["searchTerms"],
- desc: "nsINavHistoryQuery.hasSearchTerms",
- matches: flagSwitchMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQuery.searchTerms = "shrimp and white wine";
- },
- function (aQuery, aQueryOptions) {
- aQuery.searchTerms = "";
- }
- ]
- },
- // hasDomain
- {
- flag: "hasDomain",
- subswitches: ["domain", "domainIsHost"],
- desc: "nsINavHistoryQuery.hasDomain",
- matches: flagSwitchMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQuery.domain = "mozilla.com";
- aQuery.domainIsHost = false;
- },
- function (aQuery, aQueryOptions) {
- aQuery.domain = "www.mozilla.com";
- aQuery.domainIsHost = true;
- },
- function (aQuery, aQueryOptions) {
- aQuery.domain = "";
- }
- ]
- },
- // hasUri
- {
- flag: "hasUri",
- subswitches: ["uri"],
- desc: "nsINavHistoryQuery.hasUri",
- matches: flagSwitchMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQuery.uri = uri("http://mozilla.com");
- },
- ]
- },
- // hasAnnotation
- {
- flag: "hasAnnotation",
- subswitches: ["annotation", "annotationIsNot"],
- desc: "nsINavHistoryQuery.hasAnnotation",
- matches: flagSwitchMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQuery.annotation = "bookmarks/toolbarFolder";
- aQuery.annotationIsNot = false;
- },
- function (aQuery, aQueryOptions) {
- aQuery.annotation = "bookmarks/toolbarFolder";
- aQuery.annotationIsNot = true;
- }
- ]
- },
- // minVisits
- {
- // property is used by function simplePropertyMatches.
- property: "minVisits",
- desc: "nsINavHistoryQuery.minVisits",
- matches: simplePropertyMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQuery.minVisits = 0x7fffffff; // 2^31 - 1
- }
- ]
- },
- // maxVisits
- {
- property: "maxVisits",
- desc: "nsINavHistoryQuery.maxVisits",
- matches: simplePropertyMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQuery.maxVisits = 0x7fffffff; // 2^31 - 1
- }
- ]
- },
- // onlyBookmarked
- {
- property: "onlyBookmarked",
- desc: "nsINavHistoryQuery.onlyBookmarked",
- matches: simplePropertyMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQuery.onlyBookmarked = true;
- }
- ]
- },
- // getFolders
- {
- desc: "nsINavHistoryQuery.getFolders",
- matches: function (aQuery1, aQuery2) {
- var q1Folders = aQuery1.getFolders();
- var q2Folders = aQuery2.getFolders();
- if (q1Folders.length !== q2Folders.length)
- return false;
- for (let i = 0; i < q1Folders.length; i++) {
- if (q2Folders.indexOf(q1Folders[i]) < 0)
- return false;
- }
- for (let i = 0; i < q2Folders.length; i++) {
- if (q1Folders.indexOf(q2Folders[i]) < 0)
- return false;
- }
- return true;
- },
- runs: [
- function (aQuery, aQueryOptions) {
- aQuery.setFolders([], 0);
- },
- function (aQuery, aQueryOptions) {
- aQuery.setFolders([PlacesUtils.placesRootId], 1);
- },
- function (aQuery, aQueryOptions) {
- aQuery.setFolders([PlacesUtils.placesRootId, PlacesUtils.tagsFolderId], 2);
- }
- ]
- },
- // tags
- {
- desc: "nsINavHistoryQuery.getTags",
- matches: function (aQuery1, aQuery2) {
- if (aQuery1.tagsAreNot !== aQuery2.tagsAreNot)
- return false;
- var q1Tags = aQuery1.tags;
- var q2Tags = aQuery2.tags;
- if (q1Tags.length !== q2Tags.length)
- return false;
- for (let i = 0; i < q1Tags.length; i++) {
- if (q2Tags.indexOf(q1Tags[i]) < 0)
- return false;
- }
- for (let i = 0; i < q2Tags.length; i++) {
- if (q1Tags.indexOf(q2Tags[i]) < 0)
- return false;
- }
- return true;
- },
- runs: [
- function (aQuery, aQueryOptions) {
- aQuery.tags = [];
- },
- function (aQuery, aQueryOptions) {
- aQuery.tags = [""];
- },
- function (aQuery, aQueryOptions) {
- aQuery.tags = [
- "foo",
- "七難",
- "",
- "ã„ã£ã±ã„ãŠã£ã±ã„",
- "Abracadabra",
- "123",
- "Here's a pretty long tag name with some = signs and 1 2 3s and spaces oh jeez will it work I hope so!",
- "アスキーã§ã”ã–ã„ã¾ã›ã‚“",
- "ã‚ã„ã†ãˆãŠ",
- ];
- },
- function (aQuery, aQueryOptions) {
- aQuery.tags = [
- "foo",
- "七難",
- "",
- "ã„ã£ã±ã„ãŠã£ã±ã„",
- "Abracadabra",
- "123",
- "Here's a pretty long tag name with some = signs and 1 2 3s and spaces oh jeez will it work I hope so!",
- "アスキーã§ã”ã–ã„ã¾ã›ã‚“",
- "ã‚ã„ã†ãˆãŠ",
- ];
- aQuery.tagsAreNot = true;
- }
- ]
- },
- // transitions
- {
- desc: "tests nsINavHistoryQuery.getTransitions",
- matches: function (aQuery1, aQuery2) {
- var q1Trans = aQuery1.getTransitions();
- var q2Trans = aQuery2.getTransitions();
- if (q1Trans.length !== q2Trans.length)
- return false;
- for (let i = 0; i < q1Trans.length; i++) {
- if (q2Trans.indexOf(q1Trans[i]) < 0)
- return false;
- }
- for (let i = 0; i < q2Trans.length; i++) {
- if (q1Trans.indexOf(q2Trans[i]) < 0)
- return false;
- }
- return true;
- },
- runs: [
- function (aQuery, aQueryOptions) {
- aQuery.setTransitions([], 0);
- },
- function (aQuery, aQueryOptions) {
- aQuery.setTransitions([Ci.nsINavHistoryService.TRANSITION_DOWNLOAD],
- 1);
- },
- function (aQuery, aQueryOptions) {
- aQuery.setTransitions([Ci.nsINavHistoryService.TRANSITION_TYPED,
- Ci.nsINavHistoryService.TRANSITION_BOOKMARK], 2);
- }
- ]
- },
-];
-
-// nsINavHistoryQueryOptions switches
-const queryOptionSwitches = [
- // sortingMode
- {
- desc: "nsINavHistoryQueryOptions.sortingMode",
- matches: function (aOptions1, aOptions2) {
- if (aOptions1.sortingMode === aOptions2.sortingMode) {
- switch (aOptions1.sortingMode) {
- case aOptions1.SORT_BY_ANNOTATION_ASCENDING:
- case aOptions1.SORT_BY_ANNOTATION_DESCENDING:
- return aOptions1.sortingAnnotation === aOptions2.sortingAnnotation;
- }
- return true;
- }
- return false;
- },
- runs: [
- function (aQuery, aQueryOptions) {
- aQueryOptions.sortingMode = aQueryOptions.SORT_BY_DATE_ASCENDING;
- },
- function (aQuery, aQueryOptions) {
- aQueryOptions.sortingMode = aQueryOptions.SORT_BY_ANNOTATION_ASCENDING;
- aQueryOptions.sortingAnnotation = "bookmarks/toolbarFolder";
- }
- ]
- },
- // resultType
- {
- // property is used by function simplePropertyMatches.
- property: "resultType",
- desc: "nsINavHistoryQueryOptions.resultType",
- matches: simplePropertyMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQueryOptions.resultType = aQueryOptions.RESULTS_AS_URI;
- },
- function (aQuery, aQueryOptions) {
- aQueryOptions.resultType = aQueryOptions.RESULTS_AS_FULL_VISIT;
- }
- ]
- },
- // excludeItems
- {
- property: "excludeItems",
- desc: "nsINavHistoryQueryOptions.excludeItems",
- matches: simplePropertyMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQueryOptions.excludeItems = true;
- }
- ]
- },
- // excludeQueries
- {
- property: "excludeQueries",
- desc: "nsINavHistoryQueryOptions.excludeQueries",
- matches: simplePropertyMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQueryOptions.excludeQueries = true;
- }
- ]
- },
- // expandQueries
- {
- property: "expandQueries",
- desc: "nsINavHistoryQueryOptions.expandQueries",
- matches: simplePropertyMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQueryOptions.expandQueries = true;
- }
- ]
- },
- // includeHidden
- {
- property: "includeHidden",
- desc: "nsINavHistoryQueryOptions.includeHidden",
- matches: simplePropertyMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQueryOptions.includeHidden = true;
- }
- ]
- },
- // maxResults
- {
- property: "maxResults",
- desc: "nsINavHistoryQueryOptions.maxResults",
- matches: simplePropertyMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQueryOptions.maxResults = 0xffffffff; // 2^32 - 1
- }
- ]
- },
- // queryType
- {
- property: "queryType",
- desc: "nsINavHistoryQueryOptions.queryType",
- matches: simplePropertyMatches,
- runs: [
- function (aQuery, aQueryOptions) {
- aQueryOptions.queryType = aQueryOptions.QUERY_TYPE_HISTORY;
- },
- function (aQuery, aQueryOptions) {
- aQueryOptions.queryType = aQueryOptions.QUERY_TYPE_UNIFIED;
- }
- ]
- },
-];
-
-/**
- * Enumerates all the sequences of the cartesian product of the arrays contained
- * in aSequences. Examples:
- *
- * cartProd([[1, 2, 3], ["a", "b"]], callback);
- * // callback is called 3 * 2 = 6 times with the following arrays:
- * // [1, "a"], [1, "b"], [2, "a"], [2, "b"], [3, "a"], [3, "b"]
- *
- * cartProd([["a"], [1, 2, 3], ["X", "Y"]], callback);
- * // callback is called 1 * 3 * 2 = 6 times with the following arrays:
- * // ["a", 1, "X"], ["a", 1, "Y"], ["a", 2, "X"], ["a", 2, "Y"],
- * // ["a", 3, "X"], ["a", 3, "Y"]
- *
- * cartProd([[1], [2], [3], [4]], callback);
- * // callback is called 1 * 1 * 1 * 1 = 1 time with the following array:
- * // [1, 2, 3, 4]
- *
- * cartProd([], callback);
- * // callback is 0 times
- *
- * cartProd([[1, 2, 3, 4]], callback);
- * // callback is called 4 times with the following arrays:
- * // [1], [2], [3], [4]
- *
- * @param aSequences
- * an array that contains an arbitrary number of arrays
- * @param aCallback
- * a function that is passed each sequence of the product as it's
- * computed
- * @return the total number of sequences in the product
- */
-function cartProd(aSequences, aCallback)
-{
- if (aSequences.length === 0)
- return 0;
-
- // For each sequence in aSequences, we maintain a pointer (an array index,
- // really) to the element we're currently enumerating in that sequence
- var seqEltPtrs = aSequences.map(i => 0);
-
- var numProds = 0;
- var done = false;
- while (!done) {
- numProds++;
-
- // prod = sequence in product we're currently enumerating
- let prod = [];
- for (let i = 0; i < aSequences.length; i++) {
- prod.push(aSequences[i][seqEltPtrs[i]]);
- }
- aCallback(prod);
-
- // The next sequence in the product differs from the current one by just a
- // single element. Determine which element that is. We advance the
- // "rightmost" element pointer to the "right" by one. If we move past the
- // end of that pointer's sequence, reset the pointer to the first element
- // in its sequence and then try the sequence to the "left", and so on.
-
- // seqPtr = index of rightmost input sequence whose element pointer is not
- // past the end of the sequence
- let seqPtr = aSequences.length - 1;
- while (!done) {
- // Advance the rightmost element pointer.
- seqEltPtrs[seqPtr]++;
-
- // The rightmost element pointer is past the end of its sequence.
- if (seqEltPtrs[seqPtr] >= aSequences[seqPtr].length) {
- seqEltPtrs[seqPtr] = 0;
- seqPtr--;
-
- // All element pointers are past the ends of their sequences.
- if (seqPtr < 0)
- done = true;
- }
- else break;
- }
- }
- return numProds;
-}
-
-/**
- * Enumerates all the subsets in aSet of size aHowMany. There are
- * C(aSet.length, aHowMany) such subsets. aCallback will be passed each subset
- * as it is generated. Note that aSet and the subsets enumerated are -- even
- * though they're arrays -- not sequences; the ordering of their elements is not
- * important. Example:
- *
- * choose([1, 2, 3, 4], 2, callback);
- * // callback is called C(4, 2) = 6 times with the following sets (arrays):
- * // [1, 2], [1, 3], [1, 4], [2, 3], [2, 4], [3, 4]
- *
- * @param aSet
- * an array from which to choose elements, aSet.length > 0
- * @param aHowMany
- * the number of elements to choose, > 0 and <= aSet.length
- * @return the total number of sets chosen
- */
-function choose(aSet, aHowMany, aCallback)
-{
- // ptrs = indices of the elements in aSet we're currently choosing
- var ptrs = [];
- for (let i = 0; i < aHowMany; i++) {
- ptrs.push(i);
- }
-
- var numFound = 0;
- var done = false;
- while (!done) {
- numFound++;
- aCallback(ptrs.map(p => aSet[p]));
-
- // The next subset to be chosen differs from the current one by just a
- // single element. Determine which element that is. Advance the "rightmost"
- // pointer to the "right" by one. If we move past the end of set, move the
- // next non-adjacent rightmost pointer to the right by one, and reset all
- // succeeding pointers so that they're adjacent to it. When all pointers
- // are clustered all the way to the right, we're done.
-
- // Advance the rightmost pointer.
- ptrs[ptrs.length - 1]++;
-
- // The rightmost pointer has gone past the end of set.
- if (ptrs[ptrs.length - 1] >= aSet.length) {
- // Find the next rightmost pointer that is not adjacent to the current one.
- let si = aSet.length - 2; // aSet index
- let pi = ptrs.length - 2; // ptrs index
- while (pi >= 0 && ptrs[pi] === si) {
- pi--;
- si--;
- }
-
- // All pointers are adjacent and clustered all the way to the right.
- if (pi < 0)
- done = true;
- else {
- // pi = index of rightmost pointer with a gap between it and its
- // succeeding pointer. Move it right and reset all succeeding pointers
- // so that they're adjacent to it.
- ptrs[pi]++;
- for (let i = 0; i < ptrs.length - pi - 1; i++) {
- ptrs[i + pi + 1] = ptrs[pi] + i + 1;
- }
- }
- }
- }
- return numFound;
-}
-
-/**
- * Convenience function for nsINavHistoryQuery switches that act as flags. This
- * is attached to switch objects. See querySwitches array above.
- *
- * @param aQuery1
- * an nsINavHistoryQuery object
- * @param aQuery2
- * another nsINavHistoryQuery object
- * @return true if this switch is the same in both aQuery1 and aQuery2
- */
-function flagSwitchMatches(aQuery1, aQuery2)
-{
- if (aQuery1[this.flag] && aQuery2[this.flag]) {
- for (let p in this.subswitches) {
- if (p in aQuery1 && p in aQuery2) {
- if (aQuery1[p] instanceof Ci.nsIURI) {
- if (!aQuery1[p].equals(aQuery2[p]))
- return false;
- }
- else if (aQuery1[p] !== aQuery2[p])
- return false;
- }
- }
- }
- else if (aQuery1[this.flag] || aQuery2[this.flag])
- return false;
-
- return true;
-}
-
-/**
- * Tests if aObj1 and aObj2 are equal. This function is general and may be used
- * for either nsINavHistoryQuery or nsINavHistoryQueryOptions objects. aSwitches
- * determines which set of switches is used for comparison. Pass in either
- * querySwitches or queryOptionSwitches.
- *
- * @param aSwitches
- * determines which set of switches applies to aObj1 and aObj2, either
- * querySwitches or queryOptionSwitches
- * @param aObj1
- * an nsINavHistoryQuery or nsINavHistoryQueryOptions object
- * @param aObj2
- * another nsINavHistoryQuery or nsINavHistoryQueryOptions object
- * @return true if aObj1 and aObj2 are equal
- */
-function queryObjsEqual(aSwitches, aObj1, aObj2)
-{
- for (let i = 0; i < aSwitches.length; i++) {
- if (!aSwitches[i].matches(aObj1, aObj2))
- return false;
- }
- return true;
-}
-
-/**
- * This drives the test runs. See the comment at the top of this file.
- *
- * @param aHowManyLo
- * the size of the switch subsets to start with
- * @param aHowManyHi
- * the size of the switch subsets to end with (inclusive)
- */
-function runQuerySequences(aHowManyLo, aHowManyHi)
-{
- var allSwitches = querySwitches.concat(queryOptionSwitches);
- var prevQueries = [];
- var prevOpts = [];
-
- // Choose aHowManyLo switches up to aHowManyHi switches.
- for (let howMany = aHowManyLo; howMany <= aHowManyHi; howMany++) {
- let numIters = 0;
- print("CHOOSING " + howMany + " SWITCHES");
-
- // Choose all subsets of size howMany from allSwitches.
- choose(allSwitches, howMany, function (chosenSwitches) {
- print(numIters);
- numIters++;
-
- // Collect the runs.
- // runs = [ [runs from switch 1], ..., [runs from switch howMany] ]
- var runs = chosenSwitches.map(function (s) {
- if (s.desc)
- print(" " + s.desc);
- return s.runs;
- });
-
- // cartProd(runs) => [
- // [switch 1 run 1, switch 2 run 1, ..., switch howMany run 1 ],
- // ...,
- // [switch 1 run 1, switch 2 run 1, ..., switch howMany run N ],
- // ..., ...,
- // [switch 1 run N, switch 2 run N, ..., switch howMany run 1 ],
- // ...,
- // [switch 1 run N, switch 2 run N, ..., switch howMany run N ],
- // ]
- cartProd(runs, function (runSet) {
- // Create a new query, apply the switches in runSet, and test it.
- var query = PlacesUtils.history.getNewQuery();
- var opts = PlacesUtils.history.getNewQueryOptions();
- for (let i = 0; i < runSet.length; i++) {
- runSet[i](query, opts);
- }
- serializeDeserialize([query], opts);
-
- // Test the previous NUM_MULTIPLE_QUERIES queries together.
- prevQueries.push(query);
- prevOpts.push(opts);
- if (prevQueries.length >= NUM_MULTIPLE_QUERIES) {
- // We can serialize multiple nsINavHistoryQuery objects together but
- // only one nsINavHistoryQueryOptions object with them. So, test each
- // of the previous NUM_MULTIPLE_QUERIES nsINavHistoryQueryOptions.
- for (let i = 0; i < prevOpts.length; i++) {
- serializeDeserialize(prevQueries, prevOpts[i]);
- }
- prevQueries.shift();
- prevOpts.shift();
- }
- });
- });
- }
- print("\n");
-}
-
-/**
- * Serializes the nsINavHistoryQuery objects in aQueryArr and the
- * nsINavHistoryQueryOptions object aQueryOptions, de-serializes the
- * serialization, and ensures (using do_check_* functions) that the
- * de-serialized objects equal the originals.
- *
- * @param aQueryArr
- * an array containing nsINavHistoryQuery objects
- * @param aQueryOptions
- * an nsINavHistoryQueryOptions object
- */
-function serializeDeserialize(aQueryArr, aQueryOptions)
-{
- var queryStr = PlacesUtils.history.queriesToQueryString(aQueryArr,
- aQueryArr.length,
- aQueryOptions);
- print(" " + queryStr);
- var queryArr2 = {};
- var opts2 = {};
- PlacesUtils.history.queryStringToQueries(queryStr, queryArr2, {}, opts2);
- queryArr2 = queryArr2.value;
- opts2 = opts2.value;
-
- // The two sets of queries cannot be the same if their lengths differ.
- do_check_eq(aQueryArr.length, queryArr2.length);
-
- // Although the query serialization code as it is written now practically
- // ensures that queries appear in the query string in the same order they
- // appear in both the array to be serialized and the array resulting from
- // de-serialization, the interface does not guarantee any ordering. So, for
- // each query in aQueryArr, find its equivalent in queryArr2 and delete it
- // from queryArr2. If queryArr2 is empty after looping through aQueryArr,
- // the two sets of queries are equal.
- for (let i = 0; i < aQueryArr.length; i++) {
- let j = 0;
- for (; j < queryArr2.length; j++) {
- if (queryObjsEqual(querySwitches, aQueryArr[i], queryArr2[j]))
- break;
- }
- if (j < queryArr2.length)
- queryArr2.splice(j, 1);
- }
- do_check_eq(queryArr2.length, 0);
-
- // Finally check the query options objects.
- do_check_true(queryObjsEqual(queryOptionSwitches, aQueryOptions, opts2));
-}
-
-/**
- * Convenience function for switches that have simple values. This is attached
- * to switch objects. See querySwitches and queryOptionSwitches arrays above.
- *
- * @param aObj1
- * an nsINavHistoryQuery or nsINavHistoryQueryOptions object
- * @param aObj2
- * another nsINavHistoryQuery or nsINavHistoryQueryOptions object
- * @return true if this switch is the same in both aObj1 and aObj2
- */
-function simplePropertyMatches(aObj1, aObj2)
-{
- return aObj1[this.property] === aObj2[this.property];
-}
-
-function run_test()
-{
- runQuerySequences(CHOOSE_HOW_MANY_SWITCHES_LO, CHOOSE_HOW_MANY_SWITCHES_HI);
-}
diff --git a/toolkit/components/places/tests/queries/test_redirects.js b/toolkit/components/places/tests/queries/test_redirects.js
deleted file mode 100644
index 1be5a626f..000000000
--- a/toolkit/components/places/tests/queries/test_redirects.js
+++ /dev/null
@@ -1,311 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Array of visits we will add to the database, will be populated later
-// in the test.
-var visits = [];
-
-/**
- * Takes a sequence of query options, and compare query results obtained through
- * them with a custom filtered array of visits, based on the values we are
- * expecting from the query.
- *
- * @param aSequence
- * an array that contains query options in the form:
- * [includeHidden, maxResults, sortingMode]
- */
-function check_results_callback(aSequence) {
- // Sanity check: we should receive 3 parameters.
- do_check_eq(aSequence.length, 3);
- let includeHidden = aSequence[0];
- let maxResults = aSequence[1];
- let sortingMode = aSequence[2];
- print("\nTESTING: includeHidden(" + includeHidden + ")," +
- " maxResults(" + maxResults + ")," +
- " sortingMode(" + sortingMode + ").");
-
- function isHidden(aVisit) {
- return aVisit.transType == Ci.nsINavHistoryService.TRANSITION_FRAMED_LINK ||
- aVisit.isRedirect;
- }
-
- // Build expectedData array.
- let expectedData = visits.filter(function (aVisit, aIndex, aArray) {
- // Embed visits never appear in results.
- if (aVisit.transType == Ci.nsINavHistoryService.TRANSITION_EMBED)
- return false;
-
- if (!includeHidden && isHidden(aVisit)) {
- // If the page has any non-hidden visit, then it's visible.
- if (visits.filter(function (refVisit) {
- return refVisit.uri == aVisit.uri && !isHidden(refVisit);
- }).length == 0)
- return false;
- }
-
- return true;
- });
-
- // Remove duplicates, since queries are RESULTS_AS_URI (unique pages).
- let seen = [];
- expectedData = expectedData.filter(function (aData) {
- if (seen.includes(aData.uri)) {
- return false;
- }
- seen.push(aData.uri);
- return true;
- });
-
- // Sort expectedData.
- function getFirstIndexFor(aEntry) {
- for (let i = 0; i < visits.length; i++) {
- if (visits[i].uri == aEntry.uri)
- return i;
- }
- return undefined;
- }
- function comparator(a, b) {
- if (sortingMode == Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING) {
- return b.lastVisit - a.lastVisit;
- }
- if (sortingMode == Ci.nsINavHistoryQueryOptions.SORT_BY_VISITCOUNT_DESCENDING) {
- return b.visitCount - a.visitCount;
- }
- return getFirstIndexFor(a) - getFirstIndexFor(b);
- }
- expectedData.sort(comparator);
-
- // Crop results to maxResults if it's defined.
- if (maxResults) {
- expectedData = expectedData.slice(0, maxResults);
- }
-
- // Create a new query with required options.
- let query = PlacesUtils.history.getNewQuery();
- let options = PlacesUtils.history.getNewQueryOptions();
- options.includeHidden = includeHidden;
- options.sortingMode = sortingMode;
- if (maxResults)
- options.maxResults = maxResults;
-
- // Compare resultset with expectedData.
- let result = PlacesUtils.history.executeQuery(query, options);
- let root = result.root;
- root.containerOpen = true;
- compareArrayToResult(expectedData, root);
- root.containerOpen = false;
-}
-
-/**
- * Enumerates all the sequences of the cartesian product of the arrays contained
- * in aSequences. Examples:
- *
- * cartProd([[1, 2, 3], ["a", "b"]], callback);
- * // callback is called 3 * 2 = 6 times with the following arrays:
- * // [1, "a"], [1, "b"], [2, "a"], [2, "b"], [3, "a"], [3, "b"]
- *
- * cartProd([["a"], [1, 2, 3], ["X", "Y"]], callback);
- * // callback is called 1 * 3 * 2 = 6 times with the following arrays:
- * // ["a", 1, "X"], ["a", 1, "Y"], ["a", 2, "X"], ["a", 2, "Y"],
- * // ["a", 3, "X"], ["a", 3, "Y"]
- *
- * cartProd([[1], [2], [3], [4]], callback);
- * // callback is called 1 * 1 * 1 * 1 = 1 time with the following array:
- * // [1, 2, 3, 4]
- *
- * cartProd([], callback);
- * // callback is 0 times
- *
- * cartProd([[1, 2, 3, 4]], callback);
- * // callback is called 4 times with the following arrays:
- * // [1], [2], [3], [4]
- *
- * @param aSequences
- * an array that contains an arbitrary number of arrays
- * @param aCallback
- * a function that is passed each sequence of the product as it's
- * computed
- * @return the total number of sequences in the product
- */
-function cartProd(aSequences, aCallback)
-{
- if (aSequences.length === 0)
- return 0;
-
- // For each sequence in aSequences, we maintain a pointer (an array index,
- // really) to the element we're currently enumerating in that sequence
- let seqEltPtrs = aSequences.map(i => 0);
-
- let numProds = 0;
- let done = false;
- while (!done) {
- numProds++;
-
- // prod = sequence in product we're currently enumerating
- let prod = [];
- for (let i = 0; i < aSequences.length; i++) {
- prod.push(aSequences[i][seqEltPtrs[i]]);
- }
- aCallback(prod);
-
- // The next sequence in the product differs from the current one by just a
- // single element. Determine which element that is. We advance the
- // "rightmost" element pointer to the "right" by one. If we move past the
- // end of that pointer's sequence, reset the pointer to the first element
- // in its sequence and then try the sequence to the "left", and so on.
-
- // seqPtr = index of rightmost input sequence whose element pointer is not
- // past the end of the sequence
- let seqPtr = aSequences.length - 1;
- while (!done) {
- // Advance the rightmost element pointer.
- seqEltPtrs[seqPtr]++;
-
- // The rightmost element pointer is past the end of its sequence.
- if (seqEltPtrs[seqPtr] >= aSequences[seqPtr].length) {
- seqEltPtrs[seqPtr] = 0;
- seqPtr--;
-
- // All element pointers are past the ends of their sequences.
- if (seqPtr < 0)
- done = true;
- }
- else break;
- }
- }
- return numProds;
-}
-
-function run_test()
-{
- run_next_test();
-}
-
-/**
- * Populate the visits array and add visits to the database.
- * We will generate visit-chains like:
- * visit -> redirect_temp -> redirect_perm
- */
-add_task(function* test_add_visits_to_database()
-{
- yield PlacesUtils.bookmarks.eraseEverything();
-
- // We don't really bother on this, but we need a time to add visits.
- let timeInMicroseconds = Date.now() * 1000;
- let visitCount = 1;
-
- // Array of all possible transition types we could be redirected from.
- let t = [
- Ci.nsINavHistoryService.TRANSITION_LINK,
- Ci.nsINavHistoryService.TRANSITION_TYPED,
- Ci.nsINavHistoryService.TRANSITION_BOOKMARK,
- // Embed visits are not added to the database and we don't want redirects
- // to them, thus just avoid addition.
- // Ci.nsINavHistoryService.TRANSITION_EMBED,
- Ci.nsINavHistoryService.TRANSITION_FRAMED_LINK,
- // Would make hard sorting by visit date because last_visit_date is actually
- // calculated excluding download transitions, but the query includes
- // downloads.
- // TODO: Bug 488966 could fix this behavior.
- //Ci.nsINavHistoryService.TRANSITION_DOWNLOAD,
- ];
-
- function newTimeInMicroseconds() {
- timeInMicroseconds = timeInMicroseconds - 1000;
- return timeInMicroseconds;
- }
-
- // we add a visit for each of the above transition types.
- t.forEach(transition => visits.push(
- { isVisit: true,
- transType: transition,
- uri: "http://" + transition + ".example.com/",
- title: transition + "-example",
- isRedirect: true,
- lastVisit: newTimeInMicroseconds(),
- visitCount: (transition == Ci.nsINavHistoryService.TRANSITION_EMBED ||
- transition == Ci.nsINavHistoryService.TRANSITION_FRAMED_LINK) ? 0 : visitCount++,
- isInQuery: true }));
-
- // Add a REDIRECT_TEMPORARY layer of visits for each of the above visits.
- t.forEach(transition => visits.push(
- { isVisit: true,
- transType: Ci.nsINavHistoryService.TRANSITION_REDIRECT_TEMPORARY,
- uri: "http://" + transition + ".redirect.temp.example.com/",
- title: transition + "-redirect-temp-example",
- lastVisit: newTimeInMicroseconds(),
- isRedirect: true,
- referrer: "http://" + transition + ".example.com/",
- visitCount: visitCount++,
- isInQuery: true }));
-
- // Add a REDIRECT_PERMANENT layer of visits for each of the above redirects.
- t.forEach(transition => visits.push(
- { isVisit: true,
- transType: Ci.nsINavHistoryService.TRANSITION_REDIRECT_PERMANENT,
- uri: "http://" + transition + ".redirect.perm.example.com/",
- title: transition + "-redirect-perm-example",
- lastVisit: newTimeInMicroseconds(),
- isRedirect: true,
- referrer: "http://" + transition + ".redirect.temp.example.com/",
- visitCount: visitCount++,
- isInQuery: true }));
-
- // Add a REDIRECT_PERMANENT layer of visits that loop to the first visit.
- // These entries should not change visitCount or lastVisit, otherwise
- // guessing an order would be a nightmare.
- function getLastValue(aURI, aProperty) {
- for (let i = 0; i < visits.length; i++) {
- if (visits[i].uri == aURI) {
- return visits[i][aProperty];
- }
- }
- do_throw("Unknown uri.");
- return null;
- }
- t.forEach(transition => visits.push(
- { isVisit: true,
- transType: Ci.nsINavHistoryService.TRANSITION_REDIRECT_PERMANENT,
- uri: "http://" + transition + ".example.com/",
- title: getLastValue("http://" + transition + ".example.com/", "title"),
- lastVisit: getLastValue("http://" + transition + ".example.com/", "lastVisit"),
- isRedirect: true,
- referrer: "http://" + transition + ".redirect.perm.example.com/",
- visitCount: getLastValue("http://" + transition + ".example.com/", "visitCount"),
- isInQuery: true }));
-
- // Add an unvisited bookmark in the database, it should never appear.
- visits.push({ isBookmark: true,
- uri: "http://unvisited.bookmark.com/",
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "Unvisited Bookmark",
- isInQuery: false });
-
- // Put visits in the database.
- yield task_populateDB(visits);
-});
-
-add_task(function* test_redirects()
-{
- // Frecency and hidden are updated asynchronously, wait for them.
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- // This array will be used by cartProd to generate a matrix of all possible
- // combinations.
- let includeHidden_options = [true, false];
- let maxResults_options = [5, 10, 20, null];
- // These sortingMode are choosen to toggle using special queries for history
- // menu and most visited smart bookmark.
- let sorting_options = [Ci.nsINavHistoryQueryOptions.SORT_BY_NONE,
- Ci.nsINavHistoryQueryOptions.SORT_BY_VISITCOUNT_DESCENDING,
- Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING];
- // Will execute check_results_callback() for each generated combination.
- cartProd([includeHidden_options, maxResults_options, sorting_options],
- check_results_callback);
-
- yield PlacesUtils.bookmarks.eraseEverything();
-
- yield PlacesTestUtils.clearHistory();
-});
diff --git a/toolkit/components/places/tests/queries/test_results-as-tag-contents-query.js b/toolkit/components/places/tests/queries/test_results-as-tag-contents-query.js
deleted file mode 100644
index f1cbfd4d8..000000000
--- a/toolkit/components/places/tests/queries/test_results-as-tag-contents-query.js
+++ /dev/null
@@ -1,127 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var testData = [
- { isInQuery: true,
- isDetails: true,
- title: "bmoz",
- uri: "http://foo.com/",
- isBookmark: true,
- isTag: true,
- tagArray: ["bugzilla"] },
-
- { isInQuery: true,
- isDetails: true,
- title: "C Moz",
- uri: "http://foo.com/changeme1.html",
- isBookmark: true,
- isTag: true,
- tagArray: ["moz", "bugzilla"] },
-
- { isInQuery: false,
- isDetails: true,
- title: "amo",
- uri: "http://foo2.com/",
- isBookmark: true,
- isTag: true,
- tagArray: ["moz"] },
-
- { isInQuery: false,
- isDetails: true,
- title: "amo",
- uri: "http://foo.com/changeme2.html",
- isBookmark: true },
-];
-
-function getIdForTag(aTagName) {
- var id = -1;
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.tagsFolderId], 1);
- var options = PlacesUtils.history.getNewQueryOptions();
- var root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- var cc = root.childCount;
- do_check_eq(root.childCount, 2);
- for (let i = 0; i < cc; i++) {
- let node = root.getChild(i);
- if (node.title == aTagName) {
- id = node.itemId;
- break;
- }
- }
- root.containerOpen = false;
- return id;
-}
-
- /**
- * This test will test Queries that use relative search terms and URI options
- */
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_results_as_tag_contents_query()
-{
- yield task_populateDB(testData);
-
- // Get tag id.
- let tagId = getIdForTag("bugzilla");
- do_check_true(tagId > 0);
-
- var options = PlacesUtils.history.getNewQueryOptions();
- options.resultType = options.RESULTS_AS_TAG_CONTENTS;
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([tagId], 1);
-
- var root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
-
- displayResultSet(root);
- // Cannot use compare array to results, since results ordering is hardcoded
- // and depending on lastModified (that could have VM timers issues).
- testData.forEach(function(aEntry) {
- if (aEntry.isInResult)
- do_check_true(isInResult({uri: "http://foo.com/added.html"}, root));
- });
-
- // If that passes, check liveupdate
- // Add to the query set
- var change1 = { isVisit: true,
- isDetails: true,
- uri: "http://foo.com/added.html",
- title: "mozadded",
- isBookmark: true,
- isTag: true,
- tagArray: ["moz", "bugzilla"] };
- do_print("Adding item to query");
- yield task_populateDB([change1]);
- do_print("These results should have been LIVE UPDATED with the new addition");
- displayResultSet(root);
- do_check_true(isInResult(change1, root));
-
- // Add one by adding a tag, remove one by removing search term.
- do_print("Updating items");
- var change2 = [{ isDetails: true,
- uri: "http://foo3.com/",
- title: "foo"},
- { isDetails: true,
- uri: "http://foo.com/changeme2.html",
- title: "zydeco",
- isBookmark:true,
- isTag: true,
- tagArray: ["bugzilla", "moz"] }];
- yield task_populateDB(change2);
- do_check_false(isInResult({uri: "http://fooz.com/"}, root));
- do_check_true(isInResult({uri: "http://foo.com/changeme2.html"}, root));
-
- // Test removing a tag updates us.
- do_print("Deleting item");
- PlacesUtils.tagging.untagURI(uri("http://foo.com/changeme2.html"), ["bugzilla"]);
- do_check_false(isInResult({uri: "http://foo.com/changeme2.html"}, root));
-
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/queries/test_results-as-visit.js b/toolkit/components/places/tests/queries/test_results-as-visit.js
deleted file mode 100644
index d0f270bd2..000000000
--- a/toolkit/components/places/tests/queries/test_results-as-visit.js
+++ /dev/null
@@ -1,119 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-var testData = [];
-var timeInMicroseconds = PlacesUtils.toPRTime(Date.now() - 10000);
-
-function newTimeInMicroseconds() {
- timeInMicroseconds = timeInMicroseconds + 1000;
- return timeInMicroseconds;
-}
-
-function createTestData() {
- function generateVisits(aPage) {
- for (var i = 0; i < aPage.visitCount; i++) {
- testData.push({ isInQuery: aPage.inQuery,
- isVisit: true,
- title: aPage.title,
- uri: aPage.uri,
- lastVisit: newTimeInMicroseconds(),
- isTag: aPage.tags && aPage.tags.length > 0,
- tagArray: aPage.tags });
- }
- }
-
- var pages = [
- { uri: "http://foo.com/", title: "amo", tags: ["moz"], visitCount: 3, inQuery: true },
- { uri: "http://moilla.com/", title: "bMoz", tags: ["bugzilla"], visitCount: 5, inQuery: true },
- { uri: "http://foo.mail.com/changeme1.html", title: "c Moz", visitCount: 7, inQuery: true },
- { uri: "http://foo.mail.com/changeme2.html", tags: ["moz"], title: "", visitCount: 1, inQuery: false },
- { uri: "http://foo.mail.com/changeme3.html", title: "zydeco", visitCount: 5, inQuery: false },
- ];
- pages.forEach(generateVisits);
-}
-
-/**
- * This test will test Queries that use relative search terms and URI options
- */
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_results_as_visit()
-{
- createTestData();
- yield task_populateDB(testData);
- var query = PlacesUtils.history.getNewQuery();
- query.searchTerms = "moz";
- query.minVisits = 2;
-
- // Options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_VISITCOUNT_ASCENDING;
- options.resultType = options.RESULTS_AS_VISIT;
-
- // Results
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
-
- do_print("Number of items in result set: " + root.childCount);
- for (let i=0; i < root.childCount; ++i) {
- do_print("result: " + root.getChild(i).uri + " Title: " + root.getChild(i).title);
- }
-
- // Check our inital result set
- compareArrayToResult(testData, root);
-
- // If that passes, check liveupdate
- // Add to the query set
- do_print("Adding item to query")
- var tmp = [];
- for (let i=0; i < 2; i++) {
- tmp.push({ isVisit: true,
- uri: "http://foo.com/added.html",
- title: "ab moz" });
- }
- yield task_populateDB(tmp);
- for (let i=0; i < 2; i++)
- do_check_eq(root.getChild(i).title, "ab moz");
-
- // Update an existing URI
- do_print("Updating Item");
- var change2 = [{ isVisit: true,
- title: "moz",
- uri: "http://foo.mail.com/changeme2.html" }];
- yield task_populateDB(change2);
- do_check_true(isInResult(change2, root));
-
- // Update some visits - add one and take one out of query set, and simply
- // change one so that it still applies to the query.
- do_print("Updating More Items");
- var change3 = [{ isVisit: true,
- lastVisit: newTimeInMicroseconds(),
- uri: "http://foo.mail.com/changeme1.html",
- title: "foo"},
- { isVisit: true,
- lastVisit: newTimeInMicroseconds(),
- uri: "http://foo.mail.com/changeme3.html",
- title: "moz",
- isTag: true,
- tagArray: ["foo", "moz"] }];
- yield task_populateDB(change3);
- do_check_false(isInResult({uri: "http://foo.mail.com/changeme1.html"}, root));
- do_check_true(isInResult({uri: "http://foo.mail.com/changeme3.html"}, root));
-
- // And now, delete one
- do_print("Delete item outside of batch");
- var change4 = [{ isVisit: true,
- lastVisit: newTimeInMicroseconds(),
- uri: "http://moilla.com/",
- title: "mo,z" }];
- yield task_populateDB(change4);
- do_check_false(isInResult(change4, root));
-
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/queries/test_searchTerms_includeHidden.js b/toolkit/components/places/tests/queries/test_searchTerms_includeHidden.js
deleted file mode 100644
index 038367c0b..000000000
--- a/toolkit/components/places/tests/queries/test_searchTerms_includeHidden.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Tests the interaction of includeHidden and searchTerms search options.
-
-var timeInMicroseconds = Date.now() * 1000;
-
-const VISITS = [
- { isVisit: true,
- transType: TRANSITION_TYPED,
- uri: "http://redirect.example.com/",
- title: "example",
- isRedirect: true,
- lastVisit: timeInMicroseconds--
- },
- { isVisit: true,
- transType: TRANSITION_TYPED,
- uri: "http://target.example.com/",
- title: "example",
- lastVisit: timeInMicroseconds--
- }
-];
-
-const HIDDEN_VISITS = [
- { isVisit: true,
- transType: TRANSITION_FRAMED_LINK,
- uri: "http://hidden.example.com/",
- title: "red",
- lastVisit: timeInMicroseconds--
- },
-];
-
-const TEST_DATA = [
- { searchTerms: "example",
- includeHidden: true,
- expectedResults: 2
- },
- { searchTerms: "example",
- includeHidden: false,
- expectedResults: 1
- },
- { searchTerms: "red",
- includeHidden: true,
- expectedResults: 1
- }
-];
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_initalize()
-{
- yield task_populateDB(VISITS);
-});
-
-add_task(function* test_searchTerms_includeHidden()
-{
- for (let data of TEST_DATA) {
- let query = PlacesUtils.history.getNewQuery();
- query.searchTerms = data.searchTerms;
- let options = PlacesUtils.history.getNewQueryOptions();
- options.includeHidden = data.includeHidden;
-
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
-
- let cc = root.childCount;
- // Live update with hidden visits.
- yield task_populateDB(HIDDEN_VISITS);
- let cc_update = root.childCount;
-
- root.containerOpen = false;
-
- do_check_eq(cc, data.expectedResults);
- do_check_eq(cc_update, data.expectedResults + (data.includeHidden ? 1 : 0));
-
- PlacesUtils.bhistory.removePage(uri("http://hidden.example.com/"));
- }
-});
diff --git a/toolkit/components/places/tests/queries/test_searchterms-bookmarklets.js b/toolkit/components/places/tests/queries/test_searchterms-bookmarklets.js
deleted file mode 100644
index 7bd91f057..000000000
--- a/toolkit/components/places/tests/queries/test_searchterms-bookmarklets.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Check that bookmarklets are returned by searches with searchTerms.
-
-var testData = [
- { isInQuery: true
- , isBookmark: true
- , title: "bookmark 1"
- , uri: "http://mozilla.org/script/"
- },
-
- { isInQuery: true
- , isBookmark: true
- , title: "bookmark 2"
- , uri: "javascript:alert('moz');"
- }
-];
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_initalize()
-{
- yield task_populateDB(testData);
-});
-
-add_test(function test_search_by_title()
-{
- let query = PlacesUtils.history.getNewQuery();
- query.searchTerms = "bookmark";
- let options = PlacesUtils.history.getNewQueryOptions();
- options.queryType = options.QUERY_TYPE_BOOKMARKS;
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- compareArrayToResult(testData, root);
- root.containerOpen = false;
-
- run_next_test();
-});
-
-add_test(function test_search_by_schemeToken()
-{
- let query = PlacesUtils.history.getNewQuery();
- query.searchTerms = "script";
- let options = PlacesUtils.history.getNewQueryOptions();
- options.queryType = options.QUERY_TYPE_BOOKMARKS;
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- compareArrayToResult(testData, root);
- root.containerOpen = false;
-
- run_next_test();
-});
-
-add_test(function test_search_by_uriAndTitle()
-{
- let query = PlacesUtils.history.getNewQuery();
- query.searchTerms = "moz";
- let options = PlacesUtils.history.getNewQueryOptions();
- options.queryType = options.QUERY_TYPE_BOOKMARKS;
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- compareArrayToResult(testData, root);
- root.containerOpen = false;
-
- run_next_test();
-});
diff --git a/toolkit/components/places/tests/queries/test_searchterms-domain.js b/toolkit/components/places/tests/queries/test_searchterms-domain.js
deleted file mode 100644
index 4f42e7000..000000000
--- a/toolkit/components/places/tests/queries/test_searchterms-domain.js
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- // The test data for our database, note that the ordering of the results that
- // will be returned by the query (the isInQuery: true objects) is IMPORTANT.
- // see compareArrayToResult in head_queries.js for more info.
- var testData = [
- // Test ftp protocol - vary the title length, embed search term
- {isInQuery: true, isVisit: true, isDetails: true,
- uri: "ftp://foo.com/ftp", lastVisit: lastweek,
- title: "hugelongconfmozlagurationofwordswithasearchtermsinit whoo-hoo"},
-
- // Test flat domain with annotation, search term in sentence
- {isInQuery: true, isVisit: true, isDetails: true, isPageAnnotation: true,
- uri: "http://foo.com/", annoName: "moz/test", annoVal: "val",
- lastVisit: lastweek, title: "you know, moz is cool"},
-
- // Test subdomain included with isRedirect=true, different transtype
- {isInQuery: true, isVisit: true, isDetails: true, title: "amozzie",
- isRedirect: true, uri: "http://mail.foo.com/redirect", lastVisit: old,
- referrer: "http://myreferrer.com", transType: PlacesUtils.history.TRANSITION_LINK},
-
- // Test subdomain inclued, search term at end
- {isInQuery: true, isVisit: true, isDetails: true,
- uri: "http://mail.foo.com/yiihah", title: "blahmoz", lastVisit: daybefore},
-
- // Test www. style URI is included, with a tag
- {isInQuery: true, isVisit: true, isDetails: true, isTag: true,
- uri: "http://www.foo.com/yiihah", tagArray: ["moz"],
- lastVisit: yesterday, title: "foo"},
-
- // Test https protocol
- {isInQuery: true, isVisit: true, isDetails: true, title: "moz",
- uri: "https://foo.com/", lastVisit: today},
-
- // Begin the invalid queries: wrong search term
- {isInQuery: false, isVisit:true, isDetails: true, title: "m o z",
- uri: "http://foo.com/tooearly.php", lastVisit: today},
-
- // Test bad URI
- {isInQuery: false, isVisit:true, isDetails: true, title: "moz",
- uri: "http://sffoo.com/justwrong.htm", lastVisit: yesterday},
-
- // Test what we do with escaping in titles
- {isInQuery: false, isVisit:true, isDetails: true, title: "m%0o%0z",
- uri: "http://foo.com/changeme1.htm", lastVisit: yesterday},
-
- // Test another invalid title - for updating later
- {isInQuery: false, isVisit:true, isDetails: true, title: "m,oz",
- uri: "http://foo.com/changeme2.htm", lastVisit: yesterday}];
-
-/**
- * This test will test Queries that use relative search terms and domain options
- */
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_searchterms_domain()
-{
- yield task_populateDB(testData);
- var query = PlacesUtils.history.getNewQuery();
- query.searchTerms = "moz";
- query.domain = "foo.com";
- query.domainIsHost = false;
-
- // Options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_DATE_ASCENDING;
- options.resultType = options.RESULTS_AS_URI;
-
- // Results
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
-
- do_print("Number of items in result set: " + root.childCount);
- for (var i=0; i < root.childCount; ++i) {
- do_print("result: " + root.getChild(i).uri + " Title: " + root.getChild(i).title);
- }
-
- // Check our inital result set
- compareArrayToResult(testData, root);
-
- // If that passes, check liveupdate
- // Add to the query set
- do_print("Adding item to query");
- var change1 = [{isVisit: true, isDetails: true, uri: "http://foo.com/added.htm",
- title: "moz", transType: PlacesUtils.history.TRANSITION_LINK}];
- yield task_populateDB(change1);
- do_check_true(isInResult(change1, root));
-
- // Update an existing URI
- do_print("Updating Item");
- var change2 = [{isDetails: true, uri: "http://foo.com/changeme1.htm",
- title: "moz" }];
- yield task_populateDB(change2);
- do_check_true(isInResult(change2, root));
-
- // Add one and take one out of query set, and simply change one so that it
- // still applies to the query.
- do_print("Updating More Items");
- var change3 = [{isDetails: true, uri:"http://foo.com/changeme2.htm",
- title: "moz"},
- {isDetails: true, uri: "http://mail.foo.com/yiihah",
- title: "moz now updated"},
- {isDetails: true, uri: "ftp://foo.com/ftp", title: "gone"}];
- yield task_populateDB(change3);
- do_check_true(isInResult({uri: "http://foo.com/changeme2.htm"}, root));
- do_check_true(isInResult({uri: "http://mail.foo.com/yiihah"}, root));
- do_check_false(isInResult({uri: "ftp://foo.com/ftp"}, root));
-
- // And now, delete one
- do_print("Deleting items");
- var change4 = [{isDetails: true, uri: "https://foo.com/",
- title: "mo,z"}];
- yield task_populateDB(change4);
- do_check_false(isInResult(change4, root));
-
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/queries/test_searchterms-uri.js b/toolkit/components/places/tests/queries/test_searchterms-uri.js
deleted file mode 100644
index af4efe196..000000000
--- a/toolkit/components/places/tests/queries/test_searchterms-uri.js
+++ /dev/null
@@ -1,87 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- // The test data for our database, note that the ordering of the results that
- // will be returned by the query (the isInQuery: true objects) is IMPORTANT.
- // see compareArrayToResult in head_queries.js for more info.
- var testData = [
- // Test flat domain with annotation, search term in sentence
- {isInQuery: true, isVisit: true, isDetails: true, isPageAnnotation: true,
- uri: "http://foo.com/", annoName: "moz/test", annoVal: "val",
- lastVisit: lastweek, title: "you know, moz is cool"},
-
- // Test https protocol
- {isInQuery: false, isVisit: true, isDetails: true, title: "moz",
- uri: "https://foo.com/", lastVisit: today},
-
- // Begin the invalid queries: wrong search term
- {isInQuery: false, isVisit:true, isDetails: true, title: "m o z",
- uri: "http://foo.com/wrongsearch.php", lastVisit: today},
-
- // Test subdomain inclued, search term at end
- {isInQuery: false, isVisit: true, isDetails: true,
- uri: "http://mail.foo.com/yiihah", title: "blahmoz", lastVisit: daybefore},
-
- // Test ftp protocol - vary the title length, embed search term
- {isInQuery: false, isVisit: true, isDetails: true,
- uri: "ftp://foo.com/ftp", lastVisit: lastweek,
- title: "hugelongconfmozlagurationofwordswithasearchtermsinit whoo-hoo"},
-
- // Test what we do with escaping in titles
- {isInQuery: false, isVisit:true, isDetails: true, title: "m%0o%0z",
- uri: "http://foo.com/changeme1.htm", lastVisit: yesterday},
-
- // Test another invalid title - for updating later
- {isInQuery: false, isVisit:true, isDetails: true, title: "m,oz",
- uri: "http://foo.com/changeme2.htm", lastVisit: yesterday}];
-
-/**
- * This test will test Queries that use relative search terms and URI options
- */
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_searchterms_uri()
-{
- yield task_populateDB(testData);
- var query = PlacesUtils.history.getNewQuery();
- query.searchTerms = "moz";
- query.uri = uri("http://foo.com");
-
- // Options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_DATE_ASCENDING;
- options.resultType = options.RESULTS_AS_URI;
-
- // Results
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
-
- do_print("Number of items in result set: " + root.childCount);
- for (var i=0; i < root.childCount; ++i) {
- do_print("result: " + root.getChild(i).uri + " Title: " + root.getChild(i).title);
- }
-
- // Check our inital result set
- compareArrayToResult(testData, root);
-
- // live update.
- do_print("change title");
- var change1 = [{isDetails: true, uri:"http://foo.com/",
- title: "mo"}, ];
- yield task_populateDB(change1);
-
- do_check_false(isInResult({uri: "http://foo.com/"}, root));
- var change2 = [{isDetails: true, uri:"http://foo.com/",
- title: "moz"}, ];
- yield task_populateDB(change2);
- do_check_true(isInResult({uri: "http://foo.com/"}, root));
-
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/queries/test_sort-date-site-grouping.js b/toolkit/components/places/tests/queries/test_sort-date-site-grouping.js
deleted file mode 100644
index 7ca50e6de..000000000
--- a/toolkit/components/places/tests/queries/test_sort-date-site-grouping.js
+++ /dev/null
@@ -1,225 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* ***** BEGIN LICENSE BLOCK *****
- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
- * ***** END LICENSE BLOCK ***** */
-
-// This test ensures that the date and site type of |place:| query maintains
-// its quantifications correctly. Namely, it ensures that the date part of the
-// query is not lost when the domain queries are made.
-
-// We specifically craft these entries so that if a by Date and Site sorting is
-// applied, we find one domain in the today range, and two domains in the older
-// than six months range.
-// The correspondence between item in |testData| and date range is stored in
-// leveledTestData.
-var testData = [
- {
- isVisit: true,
- uri: "file:///directory/1",
- lastVisit: today,
- title: "test visit",
- isInQuery: true
- },
- {
- isVisit: true,
- uri: "http://example.com/1",
- lastVisit: today,
- title: "test visit",
- isInQuery: true
- },
- {
- isVisit: true,
- uri: "http://example.com/2",
- lastVisit: today,
- title: "test visit",
- isInQuery: true
- },
- {
- isVisit: true,
- uri: "file:///directory/2",
- lastVisit: olderthansixmonths,
- title: "test visit",
- isInQuery: true
- },
- {
- isVisit: true,
- uri: "http://example.com/3",
- lastVisit: olderthansixmonths,
- title: "test visit",
- isInQuery: true
- },
- {
- isVisit: true,
- uri: "http://example.com/4",
- lastVisit: olderthansixmonths,
- title: "test visit",
- isInQuery: true
- },
- {
- isVisit: true,
- uri: "http://example.net/1",
- lastVisit: olderthansixmonths + 1000,
- title: "test visit",
- isInQuery: true
- }
-];
-var domainsInRange = [2, 3];
-var leveledTestData = [// Today
- [[0], // Today, local files
- [1, 2]], // Today, example.com
- // Older than six months
- [[3], // Older than six months, local files
- [4, 5], // Older than six months, example.com
- [6] // Older than six months, example.net
- ]];
-
-// This test data is meant for live updating. The |levels| property indicates
-// date range index and then domain index.
-var testDataAddedLater = [
- {
- isVisit: true,
- uri: "http://example.com/5",
- lastVisit: olderthansixmonths,
- title: "test visit",
- isInQuery: true,
- levels: [1, 1]
- },
- {
- isVisit: true,
- uri: "http://example.com/6",
- lastVisit: olderthansixmonths,
- title: "test visit",
- isInQuery: true,
- levels: [1, 1]
- },
- {
- isVisit: true,
- uri: "http://example.com/7",
- lastVisit: today,
- title: "test visit",
- isInQuery: true,
- levels: [0, 1]
- },
- {
- isVisit: true,
- uri: "file:///directory/3",
- lastVisit: today,
- title: "test visit",
- isInQuery: true,
- levels: [0, 0]
- }
-];
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_sort_date_site_grouping()
-{
- yield task_populateDB(testData);
-
- // On Linux, the (local files) folder is shown after sites unlike Mac/Windows.
- // Thus, we avoid running this test on Linux but this should be re-enabled
- // after bug 624024 is resolved.
- let isLinux = ("@mozilla.org/gnome-gconf-service;1" in Components.classes);
- if (isLinux)
- return;
-
- // In this test, there are three levels of results:
- // 1st: Date queries. e.g., today, last week, or older than 6 months.
- // 2nd: Domain queries restricted to a date. e.g. mozilla.com today.
- // 3rd: Actual visits. e.g. mozilla.com/index.html today.
- //
- // We store all the third level result roots so that we can easily close all
- // containers and test live updating into specific results.
- let roots = [];
-
- let query = PlacesUtils.history.getNewQuery();
- let options = PlacesUtils.history.getNewQueryOptions();
- options.resultType = Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY;
-
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
-
- // This corresponds to the number of date ranges.
- do_check_eq(root.childCount, leveledTestData.length);
-
- // We pass off to |checkFirstLevel| to check the first level of results.
- for (let index = 0; index < leveledTestData.length; index++) {
- let node = root.getChild(index);
- checkFirstLevel(index, node, roots);
- }
-
- // Test live updating.
- for (let visit of testDataAddedLater) {
- yield task_populateDB([visit]);
- let oldLength = testData.length;
- let i = visit.levels[0];
- let j = visit.levels[1];
- testData.push(visit);
- leveledTestData[i][j].push(oldLength);
- compareArrayToResult(leveledTestData[i][j].
- map(x => testData[x]), roots[i][j]);
- }
-
- for (let i = 0; i < roots.length; i++) {
- for (let j = 0; j < roots[i].length; j++)
- roots[i][j].containerOpen = false;
- }
-
- root.containerOpen = false;
-});
-
-function checkFirstLevel(index, node, roots) {
- PlacesUtils.asContainer(node).containerOpen = true;
-
- do_check_true(PlacesUtils.nodeIsDay(node));
- PlacesUtils.asQuery(node);
- let queries = node.getQueries();
- let options = node.queryOptions;
-
- do_check_eq(queries.length, 1);
- let query = queries[0];
-
- do_check_true(query.hasBeginTime && query.hasEndTime);
-
- // Here we check the second level of results.
- let root = PlacesUtils.history.executeQuery(query, options).root;
- roots.push([]);
- root.containerOpen = true;
-
- do_check_eq(root.childCount, leveledTestData[index].length);
- for (var secondIndex = 0; secondIndex < root.childCount; secondIndex++) {
- let child = PlacesUtils.asQuery(root.getChild(secondIndex));
- checkSecondLevel(index, secondIndex, child, roots);
- }
- root.containerOpen = false;
- node.containerOpen = false;
-}
-
-function checkSecondLevel(index, secondIndex, child, roots) {
- let queries = child.getQueries();
- let options = child.queryOptions;
-
- do_check_eq(queries.length, 1);
- let query = queries[0];
-
- do_check_true(query.hasDomain);
- do_check_true(query.hasBeginTime && query.hasEndTime);
-
- let root = PlacesUtils.history.executeQuery(query, options).root;
- // We should now have that roots[index][secondIndex] is set to the second
- // level's results root.
- roots[index].push(root);
-
- // We pass off to compareArrayToResult to check the third level of
- // results.
- root.containerOpen = true;
- compareArrayToResult(leveledTestData[index][secondIndex].
- map(x => testData[x]), root);
- // We close |root|'s container later so that we can test live
- // updates into it.
-}
diff --git a/toolkit/components/places/tests/queries/test_sorting.js b/toolkit/components/places/tests/queries/test_sorting.js
deleted file mode 100644
index 4d8e1146d..000000000
--- a/toolkit/components/places/tests/queries/test_sorting.js
+++ /dev/null
@@ -1,1265 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var tests = [];
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_NONE,
-
- *setup() {
- do_print("Sorting test 1: SORT BY NONE");
-
- this._unsortedData = [
- { isBookmark: true,
- uri: "http://example.com/b",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "y",
- keyword: "b",
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/a",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "z",
- keyword: "a",
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/c",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "x",
- keyword: "c",
- isInQuery: true },
- ];
-
- this._sortedData = this._unsortedData;
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- },
-
- check: function() {
- // Query
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1);
- query.onlyBookmarked = true;
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = this._sortingMode;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- // no reverse sorting for SORT BY NONE
- }
-});
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_ASCENDING,
-
- *setup() {
- do_print("Sorting test 2: SORT BY TITLE");
-
- this._unsortedData = [
- { isBookmark: true,
- uri: "http://example.com/b1",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "y",
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/a",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "z",
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/c",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "x",
- isInQuery: true },
-
- // if titles are equal, should fall back to URI
- { isBookmark: true,
- uri: "http://example.com/b2",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "y",
- isInQuery: true },
- ];
-
- this._sortedData = [
- this._unsortedData[2],
- this._unsortedData[0],
- this._unsortedData[3],
- this._unsortedData[1],
- ];
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- },
-
- check: function() {
- // Query
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1);
- query.onlyBookmarked = true;
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = this._sortingMode;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_TITLE_DESCENDING;
- this._sortedData.reverse();
- this.check();
- }
-});
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_ASCENDING,
-
- *setup() {
- do_print("Sorting test 3: SORT BY DATE");
-
- var timeInMicroseconds = Date.now() * 1000;
- this._unsortedData = [
- { isVisit: true,
- isDetails: true,
- isBookmark: true,
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 0,
- uri: "http://example.com/c1",
- lastVisit: timeInMicroseconds - 2000,
- title: "x1",
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- isBookmark: true,
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 1,
- uri: "http://example.com/a",
- lastVisit: timeInMicroseconds - 1000,
- title: "z",
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- isBookmark: true,
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 2,
- uri: "http://example.com/b",
- lastVisit: timeInMicroseconds - 3000,
- title: "y",
- isInQuery: true },
-
- // if dates are equal, should fall back to title
- { isVisit: true,
- isDetails: true,
- isBookmark: true,
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 3,
- uri: "http://example.com/c2",
- lastVisit: timeInMicroseconds - 2000,
- title: "x2",
- isInQuery: true },
-
- // if dates and title are equal, should fall back to bookmark index
- { isVisit: true,
- isDetails: true,
- isBookmark: true,
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 4,
- uri: "http://example.com/c2",
- lastVisit: timeInMicroseconds - 2000,
- title: "x2",
- isInQuery: true },
- ];
-
- this._sortedData = [
- this._unsortedData[2],
- this._unsortedData[0],
- this._unsortedData[3],
- this._unsortedData[4],
- this._unsortedData[1],
- ];
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- },
-
- check: function() {
- // Query
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1);
- query.onlyBookmarked = true;
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = this._sortingMode;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING;
- this._sortedData.reverse();
- this.check();
- }
-});
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_URI_ASCENDING,
-
- *setup() {
- do_print("Sorting test 4: SORT BY URI");
-
- var timeInMicroseconds = Date.now() * 1000;
- this._unsortedData = [
- { isBookmark: true,
- isDetails: true,
- lastVisit: timeInMicroseconds,
- uri: "http://example.com/b",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 0,
- title: "y",
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/c",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 1,
- title: "x",
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/a",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 2,
- title: "z",
- isInQuery: true },
-
- // if URIs are equal, should fall back to date
- { isBookmark: true,
- isDetails: true,
- lastVisit: timeInMicroseconds + 1000,
- uri: "http://example.com/c",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 3,
- title: "x",
- isInQuery: true },
-
- // if no URI (e.g., node is a folder), should fall back to title
- { isFolder: true,
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 4,
- title: "a",
- isInQuery: true },
-
- // if URIs and dates are equal, should fall back to bookmark index
- { isBookmark: true,
- isDetails: true,
- lastVisit: timeInMicroseconds + 1000,
- uri: "http://example.com/c",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 5,
- title: "x",
- isInQuery: true },
-
- // if no URI and titles are equal, should fall back to bookmark index
- { isFolder: true,
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 6,
- title: "a",
- isInQuery: true },
- ];
-
- this._sortedData = [
- this._unsortedData[4],
- this._unsortedData[6],
- this._unsortedData[2],
- this._unsortedData[0],
- this._unsortedData[1],
- this._unsortedData[3],
- this._unsortedData[5],
- ];
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- },
-
- check: function() {
- // Query
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1);
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = this._sortingMode;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_URI_DESCENDING;
- this._sortedData.reverse();
- this.check();
- }
-});
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_VISITCOUNT_ASCENDING,
-
- *setup() {
- do_print("Sorting test 5: SORT BY VISITCOUNT");
-
- var timeInMicroseconds = Date.now() * 1000;
- this._unsortedData = [
- { isBookmark: true,
- uri: "http://example.com/a",
- lastVisit: timeInMicroseconds,
- title: "z",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 0,
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/c",
- lastVisit: timeInMicroseconds,
- title: "x",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 1,
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/b1",
- lastVisit: timeInMicroseconds,
- title: "y1",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 2,
- isInQuery: true },
-
- // if visitCounts are equal, should fall back to date
- { isBookmark: true,
- uri: "http://example.com/b2",
- lastVisit: timeInMicroseconds + 1000,
- title: "y2a",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 3,
- isInQuery: true },
-
- // if visitCounts and dates are equal, should fall back to bookmark index
- { isBookmark: true,
- uri: "http://example.com/b2",
- lastVisit: timeInMicroseconds + 1000,
- title: "y2b",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 4,
- isInQuery: true },
- ];
-
- this._sortedData = [
- this._unsortedData[0],
- this._unsortedData[2],
- this._unsortedData[3],
- this._unsortedData[4],
- this._unsortedData[1],
- ];
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- // add visits to increase visit count
- yield PlacesTestUtils.addVisits([
- { uri: uri("http://example.com/a"), transition: TRANSITION_TYPED, visitDate: timeInMicroseconds },
- { uri: uri("http://example.com/b1"), transition: TRANSITION_TYPED, visitDate: timeInMicroseconds },
- { uri: uri("http://example.com/b1"), transition: TRANSITION_TYPED, visitDate: timeInMicroseconds },
- { uri: uri("http://example.com/b2"), transition: TRANSITION_TYPED, visitDate: timeInMicroseconds + 1000 },
- { uri: uri("http://example.com/b2"), transition: TRANSITION_TYPED, visitDate: timeInMicroseconds + 1000 },
- { uri: uri("http://example.com/c"), transition: TRANSITION_TYPED, visitDate: timeInMicroseconds },
- { uri: uri("http://example.com/c"), transition: TRANSITION_TYPED, visitDate: timeInMicroseconds },
- { uri: uri("http://example.com/c"), transition: TRANSITION_TYPED, visitDate: timeInMicroseconds },
- ]);
- },
-
- check: function() {
- // Query
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1);
- query.onlyBookmarked = true;
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = this._sortingMode;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_VISITCOUNT_DESCENDING;
- this._sortedData.reverse();
- this.check();
- }
-});
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_KEYWORD_ASCENDING,
-
- *setup() {
- do_print("Sorting test 6: SORT BY KEYWORD");
-
- this._unsortedData = [
- { isBookmark: true,
- uri: "http://example.com/a",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "z",
- keyword: "a",
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/c",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "x",
- keyword: "c",
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/b1",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "y9",
- keyword: "b",
- isInQuery: true },
-
- // without a keyword, should fall back to title
- { isBookmark: true,
- uri: "http://example.com/null2",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "null8",
- keyword: null,
- isInQuery: true },
-
- // without a keyword, should fall back to title
- { isBookmark: true,
- uri: "http://example.com/null1",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "null9",
- keyword: null,
- isInQuery: true },
-
- // if keywords are equal, should fall back to title
- { isBookmark: true,
- uri: "http://example.com/b1",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "y8",
- keyword: "b",
- isInQuery: true },
- ];
-
- this._sortedData = [
- this._unsortedData[3],
- this._unsortedData[4],
- this._unsortedData[0],
- this._unsortedData[5],
- this._unsortedData[2],
- this._unsortedData[1],
- ];
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- },
-
- check: function() {
- // Query
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1);
- query.onlyBookmarked = true;
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = this._sortingMode;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_KEYWORD_DESCENDING;
- this._sortedData.reverse();
- this.check();
- }
-});
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_DATEADDED_ASCENDING,
-
- *setup() {
- do_print("Sorting test 7: SORT BY DATEADDED");
-
- var timeInMicroseconds = Date.now() * 1000;
- this._unsortedData = [
- { isBookmark: true,
- uri: "http://example.com/b1",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 0,
- title: "y1",
- dateAdded: timeInMicroseconds - 1000,
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/a",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 1,
- title: "z",
- dateAdded: timeInMicroseconds - 2000,
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/c",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 2,
- title: "x",
- dateAdded: timeInMicroseconds,
- isInQuery: true },
-
- // if dateAddeds are equal, should fall back to title
- { isBookmark: true,
- uri: "http://example.com/b2",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 3,
- title: "y2",
- dateAdded: timeInMicroseconds - 1000,
- isInQuery: true },
-
- // if dateAddeds and titles are equal, should fall back to bookmark index
- { isBookmark: true,
- uri: "http://example.com/b3",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 4,
- title: "y3",
- dateAdded: timeInMicroseconds - 1000,
- isInQuery: true },
- ];
-
- this._sortedData = [
- this._unsortedData[1],
- this._unsortedData[0],
- this._unsortedData[3],
- this._unsortedData[4],
- this._unsortedData[2],
- ];
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- },
-
- check: function() {
- // Query
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1);
- query.onlyBookmarked = true;
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = this._sortingMode;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_DATEADDED_DESCENDING;
- this._sortedData.reverse();
- this.check();
- }
-});
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_LASTMODIFIED_ASCENDING,
-
- *setup() {
- do_print("Sorting test 8: SORT BY LASTMODIFIED");
-
- var timeInMicroseconds = Date.now() * 1000;
- var timeAddedInMicroseconds = timeInMicroseconds - 10000;
-
- this._unsortedData = [
- { isBookmark: true,
- uri: "http://example.com/b1",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 0,
- title: "y1",
- dateAdded: timeAddedInMicroseconds,
- lastModified: timeInMicroseconds - 1000,
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/a",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 1,
- title: "z",
- dateAdded: timeAddedInMicroseconds,
- lastModified: timeInMicroseconds - 2000,
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://example.com/c",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 2,
- title: "x",
- dateAdded: timeAddedInMicroseconds,
- lastModified: timeInMicroseconds,
- isInQuery: true },
-
- // if lastModifieds are equal, should fall back to title
- { isBookmark: true,
- uri: "http://example.com/b2",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 3,
- title: "y2",
- dateAdded: timeAddedInMicroseconds,
- lastModified: timeInMicroseconds - 1000,
- isInQuery: true },
-
- // if lastModifieds and titles are equal, should fall back to bookmark
- // index
- { isBookmark: true,
- uri: "http://example.com/b3",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: 4,
- title: "y3",
- dateAdded: timeAddedInMicroseconds,
- lastModified: timeInMicroseconds - 1000,
- isInQuery: true },
- ];
-
- this._sortedData = [
- this._unsortedData[1],
- this._unsortedData[0],
- this._unsortedData[3],
- this._unsortedData[4],
- this._unsortedData[2],
- ];
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- },
-
- check: function() {
- // Query
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1);
- query.onlyBookmarked = true;
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = this._sortingMode;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_LASTMODIFIED_DESCENDING;
- this._sortedData.reverse();
- this.check();
- }
-});
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_TAGS_ASCENDING,
-
- *setup() {
- do_print("Sorting test 9: SORT BY TAGS");
-
- this._unsortedData = [
- { isBookmark: true,
- uri: "http://url2.com/",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "title x",
- isTag: true,
- tagArray: ["x", "y", "z"],
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://url1a.com/",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "title y1",
- isTag: true,
- tagArray: ["a", "b"],
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://url3a.com/",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "title w1",
- isInQuery: true },
-
- { isBookmark: true,
- uri: "http://url0.com/",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "title z",
- isTag: true,
- tagArray: ["a", "y", "z"],
- isInQuery: true },
-
- // if tags are equal, should fall back to title
- { isBookmark: true,
- uri: "http://url1b.com/",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "title y2",
- isTag: true,
- tagArray: ["b", "a"],
- isInQuery: true },
-
- // if tags are equal, should fall back to title
- { isBookmark: true,
- uri: "http://url3b.com/",
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- title: "title w2",
- isInQuery: true },
- ];
-
- this._sortedData = [
- this._unsortedData[2],
- this._unsortedData[5],
- this._unsortedData[1],
- this._unsortedData[4],
- this._unsortedData[3],
- this._unsortedData[0],
- ];
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- },
-
- check: function() {
- // Query
- var query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.bookmarks.toolbarFolder], 1);
- query.onlyBookmarked = true;
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = this._sortingMode;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_TAGS_DESCENDING;
- this._sortedData.reverse();
- this.check();
- }
-});
-
-// SORT_BY_ANNOTATION_* (int32)
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_ASCENDING,
-
- *setup() {
- do_print("Sorting test 10: SORT BY ANNOTATION (int32)");
-
- var timeInMicroseconds = Date.now() * 1000;
- this._unsortedData = [
- { isVisit: true,
- isDetails: true,
- lastVisit: timeInMicroseconds,
- uri: "http://example.com/b1",
- title: "y1",
- isPageAnnotation: true,
- annoName: "sorting",
- annoVal: 2,
- annoFlags: 0,
- annoExpiration: Ci.nsIAnnotationService.EXPIRE_NEVER,
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- lastVisit: timeInMicroseconds,
- uri: "http://example.com/a",
- title: "z",
- isPageAnnotation: true,
- annoName: "sorting",
- annoVal: 1,
- annoFlags: 0,
- annoExpiration: Ci.nsIAnnotationService.EXPIRE_NEVER,
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- lastVisit: timeInMicroseconds,
- uri: "http://example.com/c",
- title: "x",
- isPageAnnotation: true,
- annoName: "sorting",
- annoVal: 3,
- annoFlags: 0,
- annoExpiration: Ci.nsIAnnotationService.EXPIRE_NEVER,
- isInQuery: true },
-
- // if annotations are equal, should fall back to title
- { isVisit: true,
- isDetails: true,
- lastVisit: timeInMicroseconds,
- uri: "http://example.com/b2",
- title: "y2",
- isPageAnnotation: true,
- annoName: "sorting",
- annoVal: 2,
- annoFlags: 0,
- annoExpiration: Ci.nsIAnnotationService.EXPIRE_NEVER,
- isInQuery: true },
- ];
-
- this._sortedData = [
- this._unsortedData[1],
- this._unsortedData[0],
- this._unsortedData[3],
- this._unsortedData[2],
- ];
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- },
-
- check: function() {
- // Query
- var query = PlacesUtils.history.getNewQuery();
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingAnnotation = "sorting";
- options.sortingMode = this._sortingMode;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_DESCENDING;
- this._sortedData.reverse();
- this.check();
- }
-});
-
-// SORT_BY_ANNOTATION_* (int64)
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_ASCENDING,
-
- *setup() {
- do_print("Sorting test 11: SORT BY ANNOTATION (int64)");
-
- var timeInMicroseconds = Date.now() * 1000;
- this._unsortedData = [
- { isVisit: true,
- isDetails: true,
- uri: "http://moz.com/",
- lastVisit: timeInMicroseconds,
- title: "I",
- isPageAnnotation: true,
- annoName: "sorting",
- annoVal: 0xffffffff1,
- annoFlags: 0,
- annoExpiration: Ci.nsIAnnotationService.EXPIRE_NEVER,
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- uri: "http://is.com/",
- lastVisit: timeInMicroseconds,
- title: "love",
- isPageAnnotation: true,
- annoName: "sorting",
- annoVal: 0xffffffff0,
- annoFlags: 0,
- annoExpiration: Ci.nsIAnnotationService.EXPIRE_NEVER,
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- uri: "http://best.com/",
- lastVisit: timeInMicroseconds,
- title: "moz",
- isPageAnnotation: true,
- annoName: "sorting",
- annoVal: 0xffffffff2,
- annoFlags: 0,
- annoExpiration: Ci.nsIAnnotationService.EXPIRE_NEVER,
- isInQuery: true },
- ];
-
- this._sortedData = [
- this._unsortedData[1],
- this._unsortedData[0],
- this._unsortedData[2],
- ];
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- },
-
- check: function() {
- // Query
- var query = PlacesUtils.history.getNewQuery();
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingAnnotation = "sorting";
- options.sortingMode = this._sortingMode;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_DESCENDING;
- this._sortedData.reverse();
- this.check();
- }
-});
-
-// SORT_BY_ANNOTATION_* (string)
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_ASCENDING,
-
- *setup() {
- do_print("Sorting test 12: SORT BY ANNOTATION (string)");
-
- var timeInMicroseconds = Date.now() * 1000;
- this._unsortedData = [
- { isVisit: true,
- isDetails: true,
- uri: "http://moz.com/",
- lastVisit: timeInMicroseconds,
- title: "I",
- isPageAnnotation: true,
- annoName: "sorting",
- annoVal: "a",
- annoFlags: 0,
- annoExpiration: Ci.nsIAnnotationService.EXPIRE_NEVER,
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- uri: "http://is.com/",
- lastVisit: timeInMicroseconds,
- title: "love",
- isPageAnnotation: true,
- annoName: "sorting",
- annoVal: "",
- annoFlags: 0,
- annoExpiration: Ci.nsIAnnotationService.EXPIRE_NEVER,
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- uri: "http://best.com/",
- lastVisit: timeInMicroseconds,
- title: "moz",
- isPageAnnotation: true,
- annoName: "sorting",
- annoVal: "z",
- annoFlags: 0,
- annoExpiration: Ci.nsIAnnotationService.EXPIRE_NEVER,
- isInQuery: true },
- ];
-
- this._sortedData = [
- this._unsortedData[1],
- this._unsortedData[0],
- this._unsortedData[2],
- ];
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- },
-
- check: function() {
- // Query
- var query = PlacesUtils.history.getNewQuery();
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingAnnotation = "sorting";
- options.sortingMode = this._sortingMode;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_DESCENDING;
- this._sortedData.reverse();
- this.check();
- }
-});
-
-// SORT_BY_ANNOTATION_* (double)
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_ASCENDING,
-
- *setup() {
- do_print("Sorting test 13: SORT BY ANNOTATION (double)");
-
- var timeInMicroseconds = Date.now() * 1000;
- this._unsortedData = [
- { isVisit: true,
- isDetails: true,
- uri: "http://moz.com/",
- lastVisit: timeInMicroseconds,
- title: "I",
- isPageAnnotation: true,
- annoName: "sorting",
- annoVal: 1.2,
- annoFlags: 0,
- annoExpiration: Ci.nsIAnnotationService.EXPIRE_NEVER,
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- uri: "http://is.com/",
- lastVisit: timeInMicroseconds,
- title: "love",
- isPageAnnotation: true,
- annoName: "sorting",
- annoVal: 1.1,
- annoFlags: 0,
- annoExpiration: Ci.nsIAnnotationService.EXPIRE_NEVER,
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- uri: "http://best.com/",
- lastVisit: timeInMicroseconds,
- title: "moz",
- isPageAnnotation: true,
- annoName: "sorting",
- annoVal: 1.3,
- annoFlags: 0,
- annoExpiration: Ci.nsIAnnotationService.EXPIRE_NEVER,
- isInQuery: true },
- ];
-
- this._sortedData = [
- this._unsortedData[1],
- this._unsortedData[0],
- this._unsortedData[2],
- ];
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- },
-
- check: function() {
- // Query
- var query = PlacesUtils.history.getNewQuery();
-
- // query options
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingAnnotation = "sorting";
- options.sortingMode = this._sortingMode;
-
- // Results - this gets the result set and opens it for reading and modification.
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_ANNOTATION_DESCENDING;
- this._sortedData.reverse();
- this.check();
- }
-});
-
-// SORT_BY_FRECENCY_*
-
-tests.push({
- _sortingMode: Ci.nsINavHistoryQueryOptions.SORT_BY_FRECENCY_ASCENDING,
-
- *setup() {
- do_print("Sorting test 13: SORT BY FRECENCY ");
-
- let timeInMicroseconds = PlacesUtils.toPRTime(Date.now() - 10000);
-
- function newTimeInMicroseconds() {
- timeInMicroseconds = timeInMicroseconds + 1000;
- return timeInMicroseconds;
- }
-
- this._unsortedData = [
- { isVisit: true,
- isDetails: true,
- uri: "http://moz.com/",
- lastVisit: newTimeInMicroseconds(),
- title: "I",
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- uri: "http://moz.com/",
- lastVisit: newTimeInMicroseconds(),
- title: "I",
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- uri: "http://moz.com/",
- lastVisit: newTimeInMicroseconds(),
- title: "I",
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- uri: "http://is.com/",
- lastVisit: newTimeInMicroseconds(),
- title: "love",
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- uri: "http://best.com/",
- lastVisit: newTimeInMicroseconds(),
- title: "moz",
- isInQuery: true },
-
- { isVisit: true,
- isDetails: true,
- uri: "http://best.com/",
- lastVisit: newTimeInMicroseconds(),
- title: "moz",
- isInQuery: true },
- ];
-
- this._sortedData = [
- this._unsortedData[3],
- this._unsortedData[5],
- this._unsortedData[2],
- ];
-
- // This function in head_queries.js creates our database with the above data
- yield task_populateDB(this._unsortedData);
- },
-
- check: function() {
- var query = PlacesUtils.history.getNewQuery();
- var options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = this._sortingMode;
-
- var root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- compareArrayToResult(this._sortedData, root);
- root.containerOpen = false;
- },
-
- check_reverse: function() {
- this._sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_FRECENCY_DESCENDING;
- this._sortedData.reverse();
- this.check();
- }
-});
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_sorting()
-{
- for (let test of tests) {
- yield test.setup();
- yield PlacesTestUtils.promiseAsyncUpdates();
- test.check();
- // sorting reversed, usually SORT_BY have ASC and DESC
- test.check_reverse();
- // Execute cleanup tasks
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
- }
-});
diff --git a/toolkit/components/places/tests/queries/test_tags.js b/toolkit/components/places/tests/queries/test_tags.js
deleted file mode 100644
index afda3f03f..000000000
--- a/toolkit/components/places/tests/queries/test_tags.js
+++ /dev/null
@@ -1,743 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Tests bookmark and history queries with tags. See bug 399799.
- */
-
-"use strict";
-
-add_task(function* tags_getter_setter() {
- do_print("Tags getter/setter should work correctly");
- do_print("Without setting tags, tags getter should return empty array");
- var [query] = makeQuery();
- do_check_eq(query.tags.length, 0);
-
- do_print("Setting tags to an empty array, tags getter should return "+
- "empty array");
- [query] = makeQuery([]);
- do_check_eq(query.tags.length, 0);
-
- do_print("Setting a few tags, tags getter should return correct array");
- var tags = ["bar", "baz", "foo"];
- [query] = makeQuery(tags);
- setsAreEqual(query.tags, tags, true);
-
- do_print("Setting some dupe tags, tags getter return unique tags");
- [query] = makeQuery(["foo", "foo", "bar", "foo", "baz", "bar"]);
- setsAreEqual(query.tags, ["bar", "baz", "foo"], true);
-});
-
-add_task(function* invalid_setter_calls() {
- do_print("Invalid calls to tags setter should fail");
- try {
- var query = PlacesUtils.history.getNewQuery();
- query.tags = null;
- do_throw("Passing null to SetTags should fail");
- }
- catch (exc) {}
-
- try {
- query = PlacesUtils.history.getNewQuery();
- query.tags = "this should not work";
- do_throw("Passing a string to SetTags should fail");
- }
- catch (exc) {}
-
- try {
- makeQuery([null]);
- do_throw("Passing one-element array with null to SetTags should fail");
- }
- catch (exc) {}
-
- try {
- makeQuery([undefined]);
- do_throw("Passing one-element array with undefined to SetTags " +
- "should fail");
- }
- catch (exc) {}
-
- try {
- makeQuery(["foo", null, "bar"]);
- do_throw("Passing mixture of tags and null to SetTags should fail");
- }
- catch (exc) {}
-
- try {
- makeQuery(["foo", undefined, "bar"]);
- do_throw("Passing mixture of tags and undefined to SetTags " +
- "should fail");
- }
- catch (exc) {}
-
- try {
- makeQuery([1, 2, 3]);
- do_throw("Passing numbers to SetTags should fail");
- }
- catch (exc) {}
-
- try {
- makeQuery(["foo", 1, 2, 3]);
- do_throw("Passing mixture of tags and numbers to SetTags should fail");
- }
- catch (exc) {}
-
- try {
- var str = PlacesUtils.toISupportsString("foo");
- query = PlacesUtils.history.getNewQuery();
- query.tags = str;
- do_throw("Passing nsISupportsString to SetTags should fail");
- }
- catch (exc) {}
-
- try {
- makeQuery([str]);
- do_throw("Passing array of nsISupportsStrings to SetTags should fail");
- }
- catch (exc) {}
-});
-
-add_task(function* not_setting_tags() {
- do_print("Not setting tags at all should not affect query URI");
- checkQueryURI();
-});
-
-add_task(function* empty_array_tags() {
- do_print("Setting tags with an empty array should not affect query URI");
- checkQueryURI([]);
-});
-
-add_task(function* set_tags() {
- do_print("Setting some tags should result in correct query URI");
- checkQueryURI([
- "foo",
- "七難",
- "",
- "ã„ã£ã±ã„ãŠã£ã±ã„",
- "Abracadabra",
- "123",
- "Here's a pretty long tag name with some = signs and 1 2 3s and spaces oh jeez will it work I hope so!",
- "アスキーã§ã”ã–ã„ã¾ã›ã‚“",
- "ã‚ã„ã†ãˆãŠ",
- ]);
-});
-
-add_task(function* no_tags_tagsAreNot() {
- do_print("Not setting tags at all but setting tagsAreNot should " +
- "affect query URI");
- checkQueryURI(null, true);
-});
-
-add_task(function* empty_array_tags_tagsAreNot() {
- do_print("Setting tags with an empty array and setting tagsAreNot " +
- "should affect query URI");
- checkQueryURI([], true);
-});
-
-add_task(function* () {
- do_print("Setting some tags and setting tagsAreNot should result in " +
- "correct query URI");
- checkQueryURI([
- "foo",
- "七難",
- "",
- "ã„ã£ã±ã„ãŠã£ã±ã„",
- "Abracadabra",
- "123",
- "Here's a pretty long tag name with some = signs and 1 2 3s and spaces oh jeez will it work I hope so!",
- "アスキーã§ã”ã–ã„ã¾ã›ã‚“",
- "ã‚ã„ã†ãˆãŠ",
- ], true);
-});
-
-add_task(function* tag_to_uri() {
- do_print("Querying history on tag associated with a URI should return " +
- "that URI");
- yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
- var [query, opts] = makeQuery(["foo"]);
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- [query, opts] = makeQuery(["bar"]);
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- [query, opts] = makeQuery(["baz"]);
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- });
-});
-
-add_task(function* tags_to_uri() {
- do_print("Querying history on many tags associated with a URI should " +
- "return that URI");
- yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
- var [query, opts] = makeQuery(["foo", "bar"]);
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- [query, opts] = makeQuery(["foo", "baz"]);
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- [query, opts] = makeQuery(["bar", "baz"]);
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- [query, opts] = makeQuery(["foo", "bar", "baz"]);
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- });
-});
-
-add_task(function* repeated_tag() {
- do_print("Specifying the same tag multiple times in a history query " +
- "should not matter");
- yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
- var [query, opts] = makeQuery(["foo", "foo"]);
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- [query, opts] = makeQuery(["foo", "foo", "foo", "bar", "bar", "baz"]);
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- });
-});
-
-add_task(function* many_tags_no_uri() {
- do_print("Querying history on many tags associated with a URI and " +
- "tags not associated with that URI should not return that URI");
- yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
- var [query, opts] = makeQuery(["foo", "bogus"]);
- executeAndCheckQueryResults(query, opts, []);
- [query, opts] = makeQuery(["foo", "bar", "bogus"]);
- executeAndCheckQueryResults(query, opts, []);
- [query, opts] = makeQuery(["foo", "bar", "baz", "bogus"]);
- executeAndCheckQueryResults(query, opts, []);
- });
-});
-
-add_task(function* nonexistent_tags() {
- do_print("Querying history on nonexistent tags should return no results");
- yield task_doWithVisit(["foo", "bar", "baz"], function (aURI) {
- var [query, opts] = makeQuery(["bogus"]);
- executeAndCheckQueryResults(query, opts, []);
- [query, opts] = makeQuery(["bogus", "gnarly"]);
- executeAndCheckQueryResults(query, opts, []);
- });
-});
-
-add_task(function* tag_to_bookmark() {
- do_print("Querying bookmarks on tag associated with a URI should " +
- "return that URI");
- yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
- var [query, opts] = makeQuery(["foo"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- [query, opts] = makeQuery(["bar"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- [query, opts] = makeQuery(["baz"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- });
-});
-
-add_task(function* many_tags_to_bookmark() {
- do_print("Querying bookmarks on many tags associated with a URI " +
- "should return that URI");
- yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
- var [query, opts] = makeQuery(["foo", "bar"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- [query, opts] = makeQuery(["foo", "baz"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- [query, opts] = makeQuery(["bar", "baz"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- [query, opts] = makeQuery(["foo", "bar", "baz"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- });
-});
-
-add_task(function* repeated_tag_to_bookmarks() {
- do_print("Specifying the same tag multiple times in a bookmark query " +
- "should not matter");
- yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
- var [query, opts] = makeQuery(["foo", "foo"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- [query, opts] = makeQuery(["foo", "foo", "foo", "bar", "bar", "baz"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, [aURI.spec]);
- });
-});
-
-add_task(function* many_tags_no_bookmark() {
- do_print("Querying bookmarks on many tags associated with a URI and " +
- "tags not associated with that URI should not return that URI");
- yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
- var [query, opts] = makeQuery(["foo", "bogus"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, []);
- [query, opts] = makeQuery(["foo", "bar", "bogus"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, []);
- [query, opts] = makeQuery(["foo", "bar", "baz", "bogus"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, []);
- });
-});
-
-add_task(function* nonexistent_tags_bookmark() {
- do_print("Querying bookmarks on nonexistent tag should return no results");
- yield task_doWithBookmark(["foo", "bar", "baz"], function (aURI) {
- var [query, opts] = makeQuery(["bogus"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, []);
- [query, opts] = makeQuery(["bogus", "gnarly"]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- executeAndCheckQueryResults(query, opts, []);
- });
-});
-
-add_task(function* tagsAreNot_history() {
- do_print("Querying history using tagsAreNot should work correctly");
- var urisAndTags = {
- "http://example.com/1": ["foo", "bar"],
- "http://example.com/2": ["baz", "qux"],
- "http://example.com/3": null
- };
-
- do_print("Add visits and tag the URIs");
- for (let [pURI, tags] of Object.entries(urisAndTags)) {
- let nsiuri = uri(pURI);
- yield PlacesTestUtils.addVisits(nsiuri);
- if (tags)
- PlacesUtils.tagging.tagURI(nsiuri, tags);
- }
-
- do_print(' Querying for "foo" should match only /2 and /3');
- var [query, opts] = makeQuery(["foo"], true);
- queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
- ["http://example.com/2", "http://example.com/3"]);
-
- do_print(' Querying for "foo" and "bar" should match only /2 and /3');
- [query, opts] = makeQuery(["foo", "bar"], true);
- queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
- ["http://example.com/2", "http://example.com/3"]);
-
- do_print(' Querying for "foo" and "bogus" should match only /2 and /3');
- [query, opts] = makeQuery(["foo", "bogus"], true);
- queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
- ["http://example.com/2", "http://example.com/3"]);
-
- do_print(' Querying for "foo" and "baz" should match only /3');
- [query, opts] = makeQuery(["foo", "baz"], true);
- queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
- ["http://example.com/3"]);
-
- do_print(' Querying for "bogus" should match all');
- [query, opts] = makeQuery(["bogus"], true);
- queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
- ["http://example.com/1",
- "http://example.com/2",
- "http://example.com/3"]);
-
- // Clean up.
- for (let [pURI, tags] of Object.entries(urisAndTags)) {
- let nsiuri = uri(pURI);
- if (tags)
- PlacesUtils.tagging.untagURI(nsiuri, tags);
- }
- yield task_cleanDatabase();
-});
-
-add_task(function* tagsAreNot_bookmarks() {
- do_print("Querying bookmarks using tagsAreNot should work correctly");
- var urisAndTags = {
- "http://example.com/1": ["foo", "bar"],
- "http://example.com/2": ["baz", "qux"],
- "http://example.com/3": null
- };
-
- do_print("Add bookmarks and tag the URIs");
- for (let [pURI, tags] of Object.entries(urisAndTags)) {
- let nsiuri = uri(pURI);
- yield addBookmark(nsiuri);
- if (tags)
- PlacesUtils.tagging.tagURI(nsiuri, tags);
- }
-
- do_print(' Querying for "foo" should match only /2 and /3');
- var [query, opts] = makeQuery(["foo"], true);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
- ["http://example.com/2", "http://example.com/3"]);
-
- do_print(' Querying for "foo" and "bar" should match only /2 and /3');
- [query, opts] = makeQuery(["foo", "bar"], true);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
- ["http://example.com/2", "http://example.com/3"]);
-
- do_print(' Querying for "foo" and "bogus" should match only /2 and /3');
- [query, opts] = makeQuery(["foo", "bogus"], true);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
- ["http://example.com/2", "http://example.com/3"]);
-
- do_print(' Querying for "foo" and "baz" should match only /3');
- [query, opts] = makeQuery(["foo", "baz"], true);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
- ["http://example.com/3"]);
-
- do_print(' Querying for "bogus" should match all');
- [query, opts] = makeQuery(["bogus"], true);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root,
- ["http://example.com/1",
- "http://example.com/2",
- "http://example.com/3"]);
-
- // Clean up.
- for (let [pURI, tags] of Object.entries(urisAndTags)) {
- let nsiuri = uri(pURI);
- if (tags)
- PlacesUtils.tagging.untagURI(nsiuri, tags);
- }
- yield task_cleanDatabase();
-});
-
-add_task(function* duplicate_tags() {
- do_print("Duplicate existing tags (i.e., multiple tag folders with " +
- "same name) should not throw off query results");
- var tagName = "foo";
-
- do_print("Add bookmark and tag it normally");
- yield addBookmark(TEST_URI);
- PlacesUtils.tagging.tagURI(TEST_URI, [tagName]);
-
- do_print("Manually create tag folder with same name as tag and insert " +
- "bookmark");
- let dupTag = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.tagsGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: tagName
- });
-
- yield PlacesUtils.bookmarks.insert({
- parentGuid: dupTag.guid,
- title: "title",
- url: TEST_URI
- });
-
- do_print("Querying for tag should match URI");
- var [query, opts] = makeQuery([tagName]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root, [TEST_URI.spec]);
-
- PlacesUtils.tagging.untagURI(TEST_URI, [tagName]);
- yield task_cleanDatabase();
-});
-
-add_task(function* folder_named_as_tag() {
- do_print("Regular folders with the same name as tag should not throw " +
- "off query results");
- var tagName = "foo";
-
- do_print("Add bookmark and tag it");
- yield addBookmark(TEST_URI);
- PlacesUtils.tagging.tagURI(TEST_URI, [tagName]);
-
- do_print("Create folder with same name as tag");
- yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: tagName
- });
-
- do_print("Querying for tag should match URI");
- var [query, opts] = makeQuery([tagName]);
- opts.queryType = opts.QUERY_TYPE_BOOKMARKS;
- queryResultsAre(PlacesUtils.history.executeQuery(query, opts).root, [TEST_URI.spec]);
-
- PlacesUtils.tagging.untagURI(TEST_URI, [tagName]);
- yield task_cleanDatabase();
-});
-
-add_task(function* ORed_queries() {
- do_print("Multiple queries ORed together should work");
- var urisAndTags = {
- "http://example.com/1": [],
- "http://example.com/2": []
- };
-
- // Search with lots of tags to make sure tag parameter substitution in SQL
- // can handle it with more than one query.
- for (let i = 0; i < 11; i++) {
- urisAndTags["http://example.com/1"].push("/1 tag " + i);
- urisAndTags["http://example.com/2"].push("/2 tag " + i);
- }
-
- do_print("Add visits and tag the URIs");
- for (let [pURI, tags] of Object.entries(urisAndTags)) {
- let nsiuri = uri(pURI);
- yield PlacesTestUtils.addVisits(nsiuri);
- if (tags)
- PlacesUtils.tagging.tagURI(nsiuri, tags);
- }
-
- do_print("Query for /1 OR query for /2 should match both /1 and /2");
- var [query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
- var [query2] = makeQuery(urisAndTags["http://example.com/2"]);
- var root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
- queryResultsAre(root, ["http://example.com/1", "http://example.com/2"]);
-
- do_print("Query for /1 OR query on bogus tag should match only /1");
- [query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
- [query2] = makeQuery(["bogus"]);
- root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
- queryResultsAre(root, ["http://example.com/1"]);
-
- do_print("Query for /1 OR query for /1 should match only /1");
- [query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
- [query2] = makeQuery(urisAndTags["http://example.com/1"]);
- root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
- queryResultsAre(root, ["http://example.com/1"]);
-
- do_print("Query for /1 with tagsAreNot OR query for /2 with tagsAreNot " +
- "should match both /1 and /2");
- [query1, opts] = makeQuery(urisAndTags["http://example.com/1"], true);
- [query2] = makeQuery(urisAndTags["http://example.com/2"], true);
- root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
- queryResultsAre(root, ["http://example.com/1", "http://example.com/2"]);
-
- do_print("Query for /1 OR query for /2 with tagsAreNot should match " +
- "only /1");
- [query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
- [query2] = makeQuery(urisAndTags["http://example.com/2"], true);
- root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
- queryResultsAre(root, ["http://example.com/1"]);
-
- do_print("Query for /1 OR query for /1 with tagsAreNot should match " +
- "both URIs");
- [query1, opts] = makeQuery(urisAndTags["http://example.com/1"]);
- [query2] = makeQuery(urisAndTags["http://example.com/1"], true);
- root = PlacesUtils.history.executeQueries([query1, query2], 2, opts).root;
- queryResultsAre(root, ["http://example.com/1", "http://example.com/2"]);
-
- // Clean up.
- for (let [pURI, tags] of Object.entries(urisAndTags)) {
- let nsiuri = uri(pURI);
- if (tags)
- PlacesUtils.tagging.untagURI(nsiuri, tags);
- }
- yield task_cleanDatabase();
-});
-
-// The tag keys in query URIs, i.e., "place:tag=foo&!tags=1"
-// --- -----
-const QUERY_KEY_TAG = "tag";
-const QUERY_KEY_NOT_TAGS = "!tags";
-
-const TEST_URI = uri("http://example.com/");
-
-/**
- * Adds a bookmark.
- *
- * @param aURI
- * URI of the page (an nsIURI)
- */
-function addBookmark(aURI) {
- return PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- title: aURI.spec,
- url: aURI
- });
-}
-
-/**
- * Asynchronous task that removes all pages from history and bookmarks.
- */
-function* task_cleanDatabase(aCallback) {
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-}
-
-/**
- * Sets up a query with the specified tags, converts it to a URI, and makes sure
- * the URI is what we expect it to be.
- *
- * @param aTags
- * The query's tags will be set to those in this array
- * @param aTagsAreNot
- * The query's tagsAreNot property will be set to this
- */
-function checkQueryURI(aTags, aTagsAreNot) {
- var pairs = (aTags || []).sort().map(t => QUERY_KEY_TAG + "=" + encodeTag(t));
- if (aTagsAreNot)
- pairs.push(QUERY_KEY_NOT_TAGS + "=1");
- var expURI = "place:" + pairs.join("&");
- var [query, opts] = makeQuery(aTags, aTagsAreNot);
- var actualURI = queryURI(query, opts);
- do_print("Query URI should be what we expect for the given tags");
- do_check_eq(actualURI, expURI);
-}
-
-/**
- * Asynchronous task that executes a callback task in a "scoped" database state.
- * A bookmark is added and tagged before the callback is called, and afterward
- * the database is cleared.
- *
- * @param aTags
- * A bookmark will be added and tagged with this array of tags
- * @param aCallback
- * A task function that will be called after the bookmark has been tagged
- */
-function* task_doWithBookmark(aTags, aCallback) {
- yield addBookmark(TEST_URI);
- PlacesUtils.tagging.tagURI(TEST_URI, aTags);
- yield aCallback(TEST_URI);
- PlacesUtils.tagging.untagURI(TEST_URI, aTags);
- yield task_cleanDatabase();
-}
-
-/**
- * Asynchronous task that executes a callback function in a "scoped" database
- * state. A history visit is added and tagged before the callback is called,
- * and afterward the database is cleared.
- *
- * @param aTags
- * A history visit will be added and tagged with this array of tags
- * @param aCallback
- * A function that will be called after the visit has been tagged
- */
-function* task_doWithVisit(aTags, aCallback) {
- yield PlacesTestUtils.addVisits(TEST_URI);
- PlacesUtils.tagging.tagURI(TEST_URI, aTags);
- yield aCallback(TEST_URI);
- PlacesUtils.tagging.untagURI(TEST_URI, aTags);
- yield task_cleanDatabase();
-}
-
-/**
- * queriesToQueryString() encodes every character in the query URI that doesn't
- * match /[a-zA-Z]/. There's no simple JavaScript function that does the same,
- * but encodeURIComponent() comes close, only missing some punctuation. This
- * function takes care of all of that.
- *
- * @param aTag
- * A tag name to encode
- * @return A UTF-8 escaped string suitable for inclusion in a query URI
- */
-function encodeTag(aTag) {
- return encodeURIComponent(aTag).
- replace(/[-_.!~*'()]/g, // '
- s => "%" + s.charCodeAt(0).toString(16));
-}
-
-/**
- * Executes the given query and compares the results to the given URIs.
- * See queryResultsAre().
- *
- * @param aQuery
- * An nsINavHistoryQuery
- * @param aQueryOpts
- * An nsINavHistoryQueryOptions
- * @param aExpectedURIs
- * Array of URIs (as strings) that aResultRoot should contain
- */
-function executeAndCheckQueryResults(aQuery, aQueryOpts, aExpectedURIs) {
- var root = PlacesUtils.history.executeQuery(aQuery, aQueryOpts).root;
- root.containerOpen = true;
- queryResultsAre(root, aExpectedURIs);
- root.containerOpen = false;
-}
-
-/**
- * Returns new query and query options objects. The query's tags will be
- * set to aTags. aTags may be null, in which case setTags() is not called at
- * all on the query.
- *
- * @param aTags
- * The query's tags will be set to those in this array
- * @param aTagsAreNot
- * The query's tagsAreNot property will be set to this
- * @return [query, queryOptions]
- */
-function makeQuery(aTags, aTagsAreNot) {
- aTagsAreNot = !!aTagsAreNot;
- do_print("Making a query " +
- (aTags ?
- "with tags " + aTags.toSource() :
- "without calling setTags() at all") +
- " and with tagsAreNot=" +
- aTagsAreNot);
- var query = PlacesUtils.history.getNewQuery();
- query.tagsAreNot = aTagsAreNot;
- if (aTags) {
- query.tags = aTags;
- var uniqueTags = [];
- aTags.forEach(function (t) {
- if (typeof(t) === "string" && uniqueTags.indexOf(t) < 0)
- uniqueTags.push(t);
- });
- uniqueTags.sort();
- }
-
- do_print("Made query should be correct for tags and tagsAreNot");
- if (uniqueTags)
- setsAreEqual(query.tags, uniqueTags, true);
- var expCount = uniqueTags ? uniqueTags.length : 0;
- do_check_eq(query.tags.length, expCount);
- do_check_eq(query.tagsAreNot, aTagsAreNot);
-
- return [query, PlacesUtils.history.getNewQueryOptions()];
-}
-
-/**
- * Ensures that the URIs of aResultRoot are the same as those in aExpectedURIs.
- *
- * @param aResultRoot
- * The nsINavHistoryContainerResultNode root of an nsINavHistoryResult
- * @param aExpectedURIs
- * Array of URIs (as strings) that aResultRoot should contain
- */
-function queryResultsAre(aResultRoot, aExpectedURIs) {
- var rootWasOpen = aResultRoot.containerOpen;
- if (!rootWasOpen)
- aResultRoot.containerOpen = true;
- var actualURIs = [];
- for (let i = 0; i < aResultRoot.childCount; i++) {
- actualURIs.push(aResultRoot.getChild(i).uri);
- }
- setsAreEqual(actualURIs, aExpectedURIs);
- if (!rootWasOpen)
- aResultRoot.containerOpen = false;
-}
-
-/**
- * Converts the given query into its query URI.
- *
- * @param aQuery
- * An nsINavHistoryQuery
- * @param aQueryOpts
- * An nsINavHistoryQueryOptions
- * @return The query's URI
- */
-function queryURI(aQuery, aQueryOpts) {
- return PlacesUtils.history.queriesToQueryString([aQuery], 1, aQueryOpts);
-}
-
-/**
- * Ensures that the arrays contain the same elements and, optionally, in the
- * same order.
- */
-function setsAreEqual(aArr1, aArr2, aIsOrdered) {
- do_check_eq(aArr1.length, aArr2.length);
- if (aIsOrdered) {
- for (let i = 0; i < aArr1.length; i++) {
- do_check_eq(aArr1[i], aArr2[i]);
- }
- }
- else {
- aArr1.forEach(u => do_check_true(aArr2.indexOf(u) >= 0));
- aArr2.forEach(u => do_check_true(aArr1.indexOf(u) >= 0));
- }
-}
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/queries/test_transitions.js b/toolkit/components/places/tests/queries/test_transitions.js
deleted file mode 100644
index bbd4c9e01..000000000
--- a/toolkit/components/places/tests/queries/test_transitions.js
+++ /dev/null
@@ -1,178 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* ***** BEGIN LICENSE BLOCK *****
- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
- * ***** END LICENSE BLOCK ***** */
-var beginTime = Date.now();
-var testData = [
- {
- isVisit: true,
- title: "page 0",
- uri: "http://mozilla.com/",
- transType: Ci.nsINavHistoryService.TRANSITION_TYPED
- },
- {
- isVisit: true,
- title: "page 1",
- uri: "http://google.com/",
- transType: Ci.nsINavHistoryService.TRANSITION_DOWNLOAD
- },
- {
- isVisit: true,
- title: "page 2",
- uri: "http://microsoft.com/",
- transType: Ci.nsINavHistoryService.TRANSITION_DOWNLOAD
- },
- {
- isVisit: true,
- title: "page 3",
- uri: "http://en.wikipedia.org/",
- transType: Ci.nsINavHistoryService.TRANSITION_BOOKMARK
- },
- {
- isVisit: true,
- title: "page 4",
- uri: "http://fr.wikipedia.org/",
- transType: Ci.nsINavHistoryService.TRANSITION_DOWNLOAD
- },
- {
- isVisit: true,
- title: "page 5",
- uri: "http://apple.com/",
- transType: Ci.nsINavHistoryService.TRANSITION_TYPED
- },
- {
- isVisit: true,
- title: "page 6",
- uri: "http://campus-bike-store.com/",
- transType: Ci.nsINavHistoryService.TRANSITION_DOWNLOAD
- },
- {
- isVisit: true,
- title: "page 7",
- uri: "http://uwaterloo.ca/",
- transType: Ci.nsINavHistoryService.TRANSITION_TYPED
- },
- {
- isVisit: true,
- title: "page 8",
- uri: "http://pugcleaner.com/",
- transType: Ci.nsINavHistoryService.TRANSITION_BOOKMARK
- },
- {
- isVisit: true,
- title: "page 9",
- uri: "http://de.wikipedia.org/",
- transType: Ci.nsINavHistoryService.TRANSITION_TYPED
- },
- {
- isVisit: true,
- title: "arewefastyet",
- uri: "http://arewefastyet.com/",
- transType: Ci.nsINavHistoryService.TRANSITION_DOWNLOAD
- },
- {
- isVisit: true,
- title: "arewefastyet",
- uri: "http://arewefastyet.com/",
- transType: Ci.nsINavHistoryService.TRANSITION_BOOKMARK
- }];
-// sets of indices of testData array by transition type
-var testDataTyped = [0, 5, 7, 9];
-var testDataDownload = [1, 2, 4, 6, 10];
-var testDataBookmark = [3, 8, 11];
-
-/**
- * run_test is where the magic happens. This is automatically run by the test
- * harness. It is where you do the work of creating the query, running it, and
- * playing with the result set.
- */
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_transitions()
-{
- let timeNow = Date.now();
- for (let item of testData) {
- yield PlacesTestUtils.addVisits({
- uri: uri(item.uri),
- transition: item.transType,
- visitDate: timeNow++ * 1000,
- title: item.title
- });
- }
-
- // dump_table("moz_places");
- // dump_table("moz_historyvisits");
-
- var numSortFunc = function (a, b) { return (a - b); };
- var arrs = testDataTyped.concat(testDataDownload).concat(testDataBookmark)
- .sort(numSortFunc);
-
- // Four tests which compare the result of a query to an expected set.
- var data = arrs.filter(function (index) {
- return (testData[index].uri.match(/arewefastyet\.com/) &&
- testData[index].transType ==
- Ci.nsINavHistoryService.TRANSITION_DOWNLOAD);
- });
-
- compareQueryToTestData("place:domain=arewefastyet.com&transition=" +
- Ci.nsINavHistoryService.TRANSITION_DOWNLOAD,
- data.slice());
-
- compareQueryToTestData("place:transition=" +
- Ci.nsINavHistoryService.TRANSITION_DOWNLOAD,
- testDataDownload.slice());
-
- compareQueryToTestData("place:transition=" +
- Ci.nsINavHistoryService.TRANSITION_TYPED,
- testDataTyped.slice());
-
- compareQueryToTestData("place:transition=" +
- Ci.nsINavHistoryService.TRANSITION_DOWNLOAD +
- "&transition=" +
- Ci.nsINavHistoryService.TRANSITION_BOOKMARK,
- data);
-
- // Tests the live update property of transitions.
- var query = {};
- var options = {};
- PlacesUtils.history.
- queryStringToQueries("place:transition=" +
- Ci.nsINavHistoryService.TRANSITION_DOWNLOAD,
- query, {}, options);
- query = (query.value)[0];
- options = PlacesUtils.history.getNewQueryOptions();
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- do_check_eq(testDataDownload.length, root.childCount);
- yield PlacesTestUtils.addVisits({
- uri: uri("http://getfirefox.com"),
- transition: TRANSITION_DOWNLOAD
- });
- do_check_eq(testDataDownload.length + 1, root.childCount);
- root.containerOpen = false;
-});
-
-/*
- * Takes a query and a set of indices. The indices correspond to elements
- * of testData that are the result of the query.
- */
-function compareQueryToTestData(queryStr, data) {
- var query = {};
- var options = {};
- PlacesUtils.history.queryStringToQueries(queryStr, query, {}, options);
- query = query.value[0];
- options = options.value;
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- for (var i = 0; i < data.length; i++) {
- data[i] = testData[data[i]];
- data[i].isInQuery = true;
- }
- compareArrayToResult(data, root);
-}
diff --git a/toolkit/components/places/tests/queries/xpcshell.ini b/toolkit/components/places/tests/queries/xpcshell.ini
deleted file mode 100644
index 7ff864679..000000000
--- a/toolkit/components/places/tests/queries/xpcshell.ini
+++ /dev/null
@@ -1,34 +0,0 @@
-[DEFAULT]
-head = head_queries.js
-tail =
-skip-if = toolkit == 'android'
-
-[test_415716.js]
-[test_abstime-annotation-domain.js]
-[test_abstime-annotation-uri.js]
-[test_async.js]
-[test_containersQueries_sorting.js]
-[test_history_queries_tags_liveUpdate.js]
-[test_history_queries_titles_liveUpdate.js]
-[test_onlyBookmarked.js]
-[test_queryMultipleFolder.js]
-[test_querySerialization.js]
-[test_redirects.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_results-as-tag-contents-query.js]
-[test_results-as-visit.js]
-[test_searchterms-domain.js]
-[test_searchterms-uri.js]
-[test_searchterms-bookmarklets.js]
-[test_sort-date-site-grouping.js]
-[test_sorting.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_tags.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_transitions.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_searchTerms_includeHidden.js]
diff --git a/toolkit/components/places/tests/unifiedcomplete/.eslintrc.js b/toolkit/components/places/tests/unifiedcomplete/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/places/tests/unifiedcomplete/data/engine-rel-searchform.xml b/toolkit/components/places/tests/unifiedcomplete/data/engine-rel-searchform.xml
deleted file mode 100644
index f4baad28a..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/data/engine-rel-searchform.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
-<ShortName>engine-rel-searchform.xml</ShortName>
-<Url type="text/html" method="GET" template="http://example.com/?search" rel="searchform"/>
-</SearchPlugin>
diff --git a/toolkit/components/places/tests/unifiedcomplete/data/engine-suggestions.xml b/toolkit/components/places/tests/unifiedcomplete/data/engine-suggestions.xml
deleted file mode 100644
index a322a7c86..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/data/engine-suggestions.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-
-<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
-<ShortName>engine-suggestions.xml</ShortName>
-<Url type="application/x-suggestions+json"
- method="GET"
- template="http://localhost:9000/suggest?{searchTerms}"/>
-<Url type="text/html"
- method="GET"
- template="http://localhost:9000/search"
- rel="searchform"/>
-</SearchPlugin>
diff --git a/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js b/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js
deleted file mode 100644
index bc252efe0..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/head_autocomplete.js
+++ /dev/null
@@ -1,505 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cr = Components.results;
-var Cu = Components.utils;
-
-const FRECENCY_DEFAULT = 10000;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://testing-common/httpd.js");
-
-// Import common head.
-{
- let commonFile = do_get_file("../head_common.js", false);
- let uri = Services.io.newFileURI(commonFile);
- Services.scriptloader.loadSubScript(uri.spec, this);
-}
-
-// Put any other stuff relative to this test folder below.
-
-const TITLE_SEARCH_ENGINE_SEPARATOR = " \u00B7\u2013\u00B7 ";
-
-function run_test() {
- run_next_test();
-}
-
-function* cleanup() {
- Services.prefs.clearUserPref("browser.urlbar.autocomplete.enabled");
- Services.prefs.clearUserPref("browser.urlbar.autoFill");
- Services.prefs.clearUserPref("browser.urlbar.autoFill.typed");
- Services.prefs.clearUserPref("browser.urlbar.autoFill.searchEngines");
- let suggestPrefs = [
- "history",
- "bookmark",
- "history.onlyTyped",
- "openpage",
- "searches",
- ];
- for (let type of suggestPrefs) {
- Services.prefs.clearUserPref("browser.urlbar.suggest." + type);
- }
- Services.prefs.clearUserPref("browser.search.suggest.enabled");
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-}
-do_register_cleanup(cleanup);
-
-/**
- * @param aSearches
- * Array of AutoCompleteSearch names.
- */
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- popup: {
- selectedIndex: -1,
- invalidate: function () {},
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompletePopup])
- },
- popupOpen: false,
-
- disableAutoComplete: false,
- completeDefaultIndex: true,
- completeSelectedIndex: true,
- forceComplete: false,
-
- minResultsForPopup: 0,
- maxRows: 0,
-
- showCommentColumn: false,
- showImageColumn: false,
-
- timeout: 10,
- searchParam: "",
-
- get searchCount() {
- return this.searches.length;
- },
- getSearchAt: function(aIndex) {
- return this.searches[aIndex];
- },
-
- textValue: "",
- // Text selection range
- _selStart: 0,
- _selEnd: 0,
- get selectionStart() {
- return this._selStart;
- },
- get selectionEnd() {
- return this._selEnd;
- },
- selectTextRange: function(aStart, aEnd) {
- this._selStart = aStart;
- this._selEnd = aEnd;
- },
-
- onSearchBegin: function () {},
- onSearchComplete: function () {},
-
- onTextEntered: () => false,
- onTextReverted: () => false,
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteInput])
-}
-
-// A helper for check_autocomplete to check a specific match against data from
-// the controller.
-function _check_autocomplete_matches(match, result) {
- let { uri, title, tags, style } = match;
- if (tags)
- title += " \u2013 " + tags.sort().join(", ");
- if (style)
- style = style.sort();
- else
- style = ["favicon"];
-
- do_print(`Checking against expected "${uri.spec}", "${title}"`);
- // Got a match on both uri and title?
- if (stripPrefix(uri.spec) != stripPrefix(result.value) || title != result.comment) {
- return false;
- }
-
- let actualStyle = result.style.split(/\s+/).sort();
- if (style)
- Assert.equal(actualStyle.toString(), style.toString(), "Match should have expected style");
- if (uri.spec.startsWith("moz-action:")) {
- Assert.ok(actualStyle.includes("action"), "moz-action results should always have 'action' in their style");
- }
-
- if (match.icon)
- Assert.equal(result.image, match.icon, "Match should have expected image");
-
- return true;
-}
-
-function* check_autocomplete(test) {
- // At this point frecency could still be updating due to latest pages
- // updates.
- // This is not a problem in real life, but autocomplete tests should
- // return reliable resultsets, thus we have to wait.
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- // Make an AutoCompleteInput that uses our searches and confirms results.
- let input = new AutoCompleteInput(["unifiedcomplete"]);
- input.textValue = test.search;
-
- if (test.searchParam)
- input.searchParam = test.searchParam;
-
- // Caret must be at the end for autoFill to happen.
- let strLen = test.search.length;
- input.selectTextRange(strLen, strLen);
- Assert.equal(input.selectionStart, strLen, "Selection starts at end");
- Assert.equal(input.selectionEnd, strLen, "Selection ends at the end");
-
- let controller = Cc["@mozilla.org/autocomplete/controller;1"]
- .getService(Ci.nsIAutoCompleteController);
- controller.input = input;
-
- let numSearchesStarted = 0;
- input.onSearchBegin = () => {
- do_print("onSearchBegin received");
- numSearchesStarted++;
- };
- let searchCompletePromise = new Promise(resolve => {
- input.onSearchComplete = () => {
- do_print("onSearchComplete received");
- resolve();
- }
- });
- let expectedSearches = 1;
- if (test.incompleteSearch) {
- controller.startSearch(test.incompleteSearch);
- expectedSearches++;
- }
-
- do_print("Searching for: '" + test.search + "'");
- controller.startSearch(test.search);
- yield searchCompletePromise;
-
- Assert.equal(numSearchesStarted, expectedSearches, "All searches started");
-
- // Check to see the expected uris and titles match up. If 'enable-actions'
- // is specified, we check that the first specified match is the first
- // controller value (as this is the "special" always selected item), but the
- // rest can match in any order.
- // If 'enable-actions' is not specified, they can match in any order.
- if (test.matches) {
- // Do not modify the test original matches.
- let matches = test.matches.slice();
-
- if (matches.length) {
- let firstIndexToCheck = 0;
- if (test.searchParam && test.searchParam.includes("enable-actions")) {
- firstIndexToCheck = 1;
- do_print("Checking first match is first autocomplete entry")
- let result = {
- value: controller.getValueAt(0),
- comment: controller.getCommentAt(0),
- style: controller.getStyleAt(0),
- image: controller.getImageAt(0),
- }
- do_print(`First match is "${result.value}", "${result.comment}"`);
- Assert.ok(_check_autocomplete_matches(matches[0], result), "first item is correct");
- do_print("Checking rest of the matches");
- }
-
- for (let i = firstIndexToCheck; i < controller.matchCount; i++) {
- let result = {
- value: controller.getValueAt(i),
- comment: controller.getCommentAt(i),
- style: controller.getStyleAt(i),
- image: controller.getImageAt(i),
- }
- do_print(`Looking for "${result.value}", "${result.comment}" in expected results...`);
- let lowerBound = test.checkSorting ? i : firstIndexToCheck;
- let upperBound = test.checkSorting ? i + 1 : matches.length;
- let found = false;
- for (let j = lowerBound; j < upperBound; ++j) {
- // Skip processed expected results
- if (matches[j] == undefined)
- continue;
- if (_check_autocomplete_matches(matches[j], result)) {
- do_print("Got a match at index " + j + "!");
- // Make it undefined so we don't process it again
- matches[j] = undefined;
- found = true;
- break;
- }
- }
-
- if (!found)
- do_throw(`Didn't find the current result ("${result.value}", "${result.comment}") in matches`); // ' (Emacs syntax highlighting fix)
- }
- }
-
- Assert.equal(controller.matchCount, matches.length,
- "Got as many results as expected");
-
- // If we expect results, make sure we got matches.
- do_check_eq(controller.searchStatus, matches.length ?
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH :
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH);
- }
-
- if (test.autofilled) {
- // Check the autoFilled result.
- Assert.equal(input.textValue, test.autofilled,
- "Autofilled value is correct");
-
- // Now force completion and check correct casing of the result.
- // This ensures the controller is able to do its magic case-preserving
- // stuff and correct replacement of the user's casing with result's one.
- controller.handleEnter(false);
- Assert.equal(input.textValue, test.completed,
- "Completed value is correct");
- }
-}
-
-var addBookmark = Task.async(function* (aBookmarkObj) {
- Assert.ok(!!aBookmarkObj.uri, "Bookmark object contains an uri");
- let parentId = aBookmarkObj.parentId ? aBookmarkObj.parentId
- : PlacesUtils.unfiledBookmarksFolderId;
-
- let bm = yield PlacesUtils.bookmarks.insert({
- parentGuid: (yield PlacesUtils.promiseItemGuid(parentId)),
- title: aBookmarkObj.title || "A bookmark",
- url: aBookmarkObj.uri
- });
- yield PlacesUtils.promiseItemId(bm.guid);
-
- if (aBookmarkObj.keyword) {
- yield PlacesUtils.keywords.insert({ keyword: aBookmarkObj.keyword,
- url: aBookmarkObj.uri.spec,
- postData: aBookmarkObj.postData
- });
- }
-
- if (aBookmarkObj.tags) {
- PlacesUtils.tagging.tagURI(aBookmarkObj.uri, aBookmarkObj.tags);
- }
-});
-
-function addOpenPages(aUri, aCount=1) {
- let ac = Cc["@mozilla.org/autocomplete/search;1?name=unifiedcomplete"]
- .getService(Ci.mozIPlacesAutoComplete);
- for (let i = 0; i < aCount; i++) {
- ac.registerOpenPage(aUri);
- }
-}
-
-function removeOpenPages(aUri, aCount=1) {
- let ac = Cc["@mozilla.org/autocomplete/search;1?name=unifiedcomplete"]
- .getService(Ci.mozIPlacesAutoComplete);
- for (let i = 0; i < aCount; i++) {
- ac.unregisterOpenPage(aUri);
- }
-}
-
-function changeRestrict(aType, aChar) {
- let branch = "browser.urlbar.";
- // "title" and "url" are different from everything else, so special case them.
- if (aType == "title" || aType == "url")
- branch += "match.";
- else
- branch += "restrict.";
-
- do_print("changing restrict for " + aType + " to '" + aChar + "'");
- Services.prefs.setCharPref(branch + aType, aChar);
-}
-
-function resetRestrict(aType) {
- let branch = "browser.urlbar.";
- // "title" and "url" are different from everything else, so special case them.
- if (aType == "title" || aType == "url")
- branch += "match.";
- else
- branch += "restrict.";
-
- Services.prefs.clearUserPref(branch + aType);
-}
-
-/**
- * Strip prefixes from the URI that we don't care about for searching.
- *
- * @param spec
- * The text to modify.
- * @return the modified spec.
- */
-function stripPrefix(spec)
-{
- ["http://", "https://", "ftp://"].some(scheme => {
- if (spec.startsWith(scheme)) {
- spec = spec.slice(scheme.length);
- return true;
- }
- return false;
- });
-
- if (spec.startsWith("www.")) {
- spec = spec.slice(4);
- }
- return spec;
-}
-
-function makeActionURI(action, params) {
- let encodedParams = {};
- for (let key in params) {
- encodedParams[key] = encodeURIComponent(params[key]);
- }
- let url = "moz-action:" + action + "," + JSON.stringify(encodedParams);
- return NetUtil.newURI(url);
-}
-
-// Creates a full "match" entry for a search result, suitable for passing as
-// an entry to check_autocomplete.
-function makeSearchMatch(input, extra = {}) {
- // Note that counter-intuitively, the order the object properties are defined
- // in the object passed to makeActionURI is important for check_autocomplete
- // to match them :(
- let params = {
- engineName: extra.engineName || "MozSearch",
- input,
- searchQuery: "searchQuery" in extra ? extra.searchQuery : input,
- };
- if ("alias" in extra) {
- // May be undefined, which is expected, but in that case make sure it's not
- // included in the params of the moz-action URL.
- params.alias = extra.alias;
- }
- let style = [ "action", "searchengine" ];
- if (Array.isArray(extra.style)) {
- style.push(...extra.style);
- }
- if (extra.heuristic) {
- style.push("heuristic");
- }
- return {
- uri: makeActionURI("searchengine", params),
- title: params.engineName,
- style,
- }
-}
-
-// Creates a full "match" entry for a search result, suitable for passing as
-// an entry to check_autocomplete.
-function makeVisitMatch(input, url, extra = {}) {
- // Note that counter-intuitively, the order the object properties are defined
- // in the object passed to makeActionURI is important for check_autocomplete
- // to match them :(
- let params = {
- url,
- input,
- }
- let style = [ "action", "visiturl" ];
- if (extra.heuristic) {
- style.push("heuristic");
- }
- return {
- uri: makeActionURI("visiturl", params),
- title: extra.title || url,
- style,
- }
-}
-
-function makeSwitchToTabMatch(url, extra = {}) {
- return {
- uri: makeActionURI("switchtab", {url}),
- title: extra.title || url,
- style: [ "action", "switchtab" ],
- }
-}
-
-function makeExtensionMatch(extra = {}) {
- let style = [ "action", "extension" ];
- if (extra.heuristic) {
- style.push("heuristic");
- }
-
- return {
- uri: makeActionURI("extension", {
- content: extra.content,
- keyword: extra.keyword,
- }),
- title: extra.description,
- style,
- };
-}
-
-function setFaviconForHref(href, iconHref) {
- return new Promise(resolve => {
- PlacesUtils.favicons.setAndFetchFaviconForPage(
- NetUtil.newURI(href),
- NetUtil.newURI(iconHref),
- true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- resolve,
- Services.scriptSecurityManager.getSystemPrincipal()
- );
- });
-}
-
-function makeTestServer(port=-1) {
- let httpServer = new HttpServer();
- httpServer.start(port);
- do_register_cleanup(() => httpServer.stop(() => {}));
- return httpServer;
-}
-
-function* addTestEngine(basename, httpServer=undefined) {
- httpServer = httpServer || makeTestServer();
- httpServer.registerDirectory("/", do_get_cwd());
- let dataUrl =
- "http://localhost:" + httpServer.identity.primaryPort + "/data/";
-
- do_print("Adding engine: " + basename);
- return yield new Promise(resolve => {
- Services.obs.addObserver(function obs(subject, topic, data) {
- let engine = subject.QueryInterface(Ci.nsISearchEngine);
- do_print("Observed " + data + " for " + engine.name);
- if (data != "engine-added" || engine.name != basename) {
- return;
- }
-
- Services.obs.removeObserver(obs, "browser-search-engine-modified");
- do_register_cleanup(() => Services.search.removeEngine(engine));
- resolve(engine);
- }, "browser-search-engine-modified", false);
-
- do_print("Adding engine from URL: " + dataUrl + basename);
- Services.search.addEngine(dataUrl + basename, null, null, false);
- });
-}
-
-// Ensure we have a default search engine and the keyword.enabled preference
-// set.
-add_task(function* ensure_search_engine() {
- // keyword.enabled is necessary for the tests to see keyword searches.
- Services.prefs.setBoolPref("keyword.enabled", true);
-
- // Initialize the search service, but first set this geo IP pref to a dummy
- // string. When the search service is initialized, it contacts the URI named
- // in this pref, which breaks the test since outside connections aren't
- // allowed.
- let geoPref = "browser.search.geoip.url";
- Services.prefs.setCharPref(geoPref, "");
- do_register_cleanup(() => Services.prefs.clearUserPref(geoPref));
- yield new Promise(resolve => {
- Services.search.init(resolve);
- });
-
- // Remove any existing engines before adding ours.
- for (let engine of Services.search.getEngines()) {
- Services.search.removeEngine(engine);
- }
- Services.search.addEngineWithDetails("MozSearch", "", "", "", "GET",
- "http://s.example.com/search");
- let engine = Services.search.getEngineByName("MozSearch");
- Services.search.currentEngine = engine;
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_416211.js b/toolkit/components/places/tests/unifiedcomplete/test_416211.js
deleted file mode 100644
index e02906ddc..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_416211.js
+++ /dev/null
@@ -1,22 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * Test bug 416211 to make sure results that match the tag show the bookmark
- * title instead of the page title.
- */
-
-add_task(function* test_tag_match_has_bookmark_title() {
- do_print("Make sure the tag match gives the bookmark title");
- let uri = NetUtil.newURI("http://theuri/");
- yield PlacesTestUtils.addVisits({ uri: uri, title: "Page title" });
- yield addBookmark({ uri: uri,
- title: "Bookmark title",
- tags: [ "superTag" ]});
- yield check_autocomplete({
- search: "superTag",
- matches: [ { uri: uri, title: "Bookmark title", tags: [ "superTag" ], style: [ "bookmark-tag" ] } ]
- });
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_416214.js b/toolkit/components/places/tests/unifiedcomplete/test_416214.js
deleted file mode 100644
index a30b3fe74..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_416214.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * Test autocomplete for non-English URLs that match the tag bug 416214. Also
- * test bug 417441 by making sure escaped ascii characters like "+" remain
- * escaped.
- *
- * - add a visit for a page with a non-English URL
- * - add a tag for the page
- * - search for the tag
- * - test number of matches (should be exactly one)
- * - make sure the url is decoded
- */
-
-add_task(function* test_tag_match_url() {
- do_print("Make sure tag matches return the right url as well as '+' remain escaped");
- let uri1 = NetUtil.newURI("http://escaped/ユニコード");
- let uri2 = NetUtil.newURI("http://asciiescaped/blocking-firefox3%2B");
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "title" },
- { uri: uri2, title: "title" }
- ]);
- yield addBookmark({ uri: uri1,
- title: "title",
- tags: [ "superTag" ],
- style: [ "bookmark-tag" ] });
- yield addBookmark({ uri: uri2,
- title: "title",
- tags: [ "superTag" ],
- style: [ "bookmark-tag" ] });
- yield check_autocomplete({
- search: "superTag",
- matches: [ { uri: uri1, title: "title", tags: [ "superTag" ], style: [ "bookmark-tag" ] },
- { uri: uri2, title: "title", tags: [ "superTag" ], style: [ "bookmark-tag" ] } ]
- });
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_417798.js b/toolkit/components/places/tests/unifiedcomplete/test_417798.js
deleted file mode 100644
index bed14b2ce..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_417798.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test for bug 417798 to make sure javascript: URIs don't show up unless the
- * user searches for javascript: explicitly.
- */
-
-add_task(function* test_javascript_match() {
- Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", false);
-
- let uri1 = NetUtil.newURI("http://abc/def");
- let uri2 = NetUtil.newURI("javascript:5");
- yield PlacesTestUtils.addVisits([ { uri: uri1, title: "Title with javascript:" } ]);
- yield addBookmark({ uri: uri2,
- title: "Title with javascript:" });
-
- do_print("Match non-javascript: with plain search");
- yield check_autocomplete({
- search: "a",
- matches: [ { uri: uri1, title: "Title with javascript:" } ]
- });
-
- do_print("Match non-javascript: with almost javascript:");
- yield check_autocomplete({
- search: "javascript",
- matches: [ { uri: uri1, title: "Title with javascript:" } ]
- });
-
- do_print("Match javascript:");
- yield check_autocomplete({
- search: "javascript:",
- matches: [ { uri: uri1, title: "Title with javascript:" },
- { uri: uri2, title: "Title with javascript:", style: [ "bookmark" ]} ]
- });
-
- do_print("Match nothing with non-first javascript:");
- yield check_autocomplete({
- search: "5 javascript:",
- matches: [ ]
- });
-
- do_print("Match javascript: with multi-word search");
- yield check_autocomplete({
- search: "javascript: 5",
- matches: [ { uri: uri2, title: "Title with javascript:", style: [ "bookmark" ]} ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_418257.js b/toolkit/components/places/tests/unifiedcomplete/test_418257.js
deleted file mode 100644
index 323c2a7af..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_418257.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test bug 418257 by making sure tags are returned with the title as part of
- * the "comment" if there are tags even if we didn't match in the tags. They
- * are separated from the title by a endash.
- */
-
-add_task(function* test_javascript_match() {
- let uri1 = NetUtil.newURI("http://page1");
- let uri2 = NetUtil.newURI("http://page2");
- let uri3 = NetUtil.newURI("http://page3");
- let uri4 = NetUtil.newURI("http://page4");
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "tagged" },
- { uri: uri2, title: "tagged" },
- { uri: uri3, title: "tagged" },
- { uri: uri4, title: "tagged" }
- ]);
- yield addBookmark({ uri: uri1,
- title: "tagged",
- tags: [ "tag1" ] });
- yield addBookmark({ uri: uri2,
- title: "tagged",
- tags: [ "tag1", "tag2" ] });
- yield addBookmark({ uri: uri3,
- title: "tagged",
- tags: [ "tag1", "tag3" ] });
- yield addBookmark({ uri: uri4,
- title: "tagged",
- tags: [ "tag1", "tag2", "tag3" ] });
-
- do_print("Make sure tags come back in the title when matching tags");
- yield check_autocomplete({
- search: "page1 tag",
- matches: [ { uri: uri1, title: "tagged", tags: [ "tag1" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("Check tags in title for page2");
- yield check_autocomplete({
- search: "page2 tag",
- matches: [ { uri: uri2, title: "tagged", tags: [ "tag1", "tag2" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("Make sure tags appear even when not matching the tag");
- yield check_autocomplete({
- search: "page3",
- matches: [ { uri: uri3, title: "tagged", tags: [ "tag1", "tag3" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("Multiple tags come in commas for page4");
- yield check_autocomplete({
- search: "page4",
- matches: [ { uri: uri4, title: "tagged", tags: [ "tag1", "tag2", "tag3" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("Extra test just to make sure we match the title");
- yield check_autocomplete({
- search: "tag2",
- matches: [ { uri: uri2, title: "tagged", tags: [ "tag1", "tag2" ], style: [ "bookmark-tag" ] },
- { uri: uri4, title: "tagged", tags: [ "tag1", "tag2", "tag3" ], style: [ "bookmark-tag" ] } ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_422277.js b/toolkit/components/places/tests/unifiedcomplete/test_422277.js
deleted file mode 100644
index df6f7601a..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_422277.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test bug 422277 to make sure bad escaped uris don't get escaped. This makes
- * sure we don't hit an assertion for "not a UTF8 string".
- */
-
-add_task(function* test_javascript_match() {
- do_print("Bad escaped uri stays escaped");
- let uri1 = NetUtil.newURI("http://site/%EAid");
- yield PlacesTestUtils.addVisits([ { uri: uri1, title: "title" } ]);
- yield check_autocomplete({
- search: "site",
- matches: [ { uri: uri1, title: "title" } ]
- });
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_functional.js b/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_functional.js
deleted file mode 100644
index cd2dfdb17..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_functional.js
+++ /dev/null
@@ -1,171 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Functional tests for inline autocomplete
-
-const PREF_AUTOCOMPLETE_ENABLED = "browser.urlbar.autocomplete.enabled";
-
-add_task(function* test_disabling_autocomplete() {
- do_print("Check disabling autocomplete disables autofill");
- Services.prefs.setBoolPref(PREF_AUTOCOMPLETE_ENABLED, false);
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://visit.mozilla.org"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "vis",
- autofilled: "vis",
- completed: "vis"
- });
- yield cleanup();
-});
-
-add_task(function* test_urls_order() {
- do_print("Add urls, check for correct order");
- let places = [{ uri: NetUtil.newURI("http://visit1.mozilla.org") },
- { uri: NetUtil.newURI("http://visit2.mozilla.org"),
- transition: TRANSITION_TYPED }];
- yield PlacesTestUtils.addVisits(places);
- yield check_autocomplete({
- search: "vis",
- autofilled: "visit2.mozilla.org/",
- completed: "visit2.mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_ignore_prefix() {
- do_print("Add urls, make sure www and http are ignored");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits(NetUtil.newURI("http://www.visit1.mozilla.org"));
- yield check_autocomplete({
- search: "visit1",
- autofilled: "visit1.mozilla.org/",
- completed: "visit1.mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_after_host() {
- do_print("Autocompleting after an existing host completes to the url");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits(NetUtil.newURI("http://www.visit3.mozilla.org"));
- yield check_autocomplete({
- search: "visit3.mozilla.org/",
- autofilled: "visit3.mozilla.org/",
- completed: "visit3.mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_respect_www() {
- do_print("Searching for www.me should yield www.me.mozilla.org/");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits(NetUtil.newURI("http://www.me.mozilla.org"));
- yield check_autocomplete({
- search: "www.me",
- autofilled: "www.me.mozilla.org/",
- completed: "www.me.mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_bookmark_first() {
- do_print("With a bookmark and history, the query result should be the bookmark");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield addBookmark({ uri: NetUtil.newURI("http://bookmark1.mozilla.org/") });
- yield PlacesTestUtils.addVisits(NetUtil.newURI("http://bookmark1.mozilla.org/foo"));
- yield check_autocomplete({
- search: "bookmark",
- autofilled: "bookmark1.mozilla.org/",
- completed: "bookmark1.mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_full_path() {
- do_print("Check to make sure we get the proper results with full paths");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- let places = [{ uri: NetUtil.newURI("http://smokey.mozilla.org/foo/bar/baz?bacon=delicious") },
- { uri: NetUtil.newURI("http://smokey.mozilla.org/foo/bar/baz?bacon=smokey") }];
- yield PlacesTestUtils.addVisits(places);
- yield check_autocomplete({
- search: "smokey",
- autofilled: "smokey.mozilla.org/",
- completed: "smokey.mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_complete_to_slash() {
- do_print("Check to make sure we autocomplete to the following '/'");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- let places = [{ uri: NetUtil.newURI("http://smokey.mozilla.org/foo/bar/baz?bacon=delicious") },
- { uri: NetUtil.newURI("http://smokey.mozilla.org/foo/bar/baz?bacon=smokey") }];
- yield PlacesTestUtils.addVisits(places);
- yield check_autocomplete({
- search: "smokey.mozilla.org/fo",
- autofilled: "smokey.mozilla.org/foo/",
- completed: "http://smokey.mozilla.org/foo/",
- });
- yield cleanup();
-});
-
-add_task(function* test_complete_to_slash_with_www() {
- do_print("Check to make sure we autocomplete to the following '/'");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- let places = [{ uri: NetUtil.newURI("http://www.smokey.mozilla.org/foo/bar/baz?bacon=delicious") },
- { uri: NetUtil.newURI("http://www.smokey.mozilla.org/foo/bar/baz?bacon=smokey") }];
- yield PlacesTestUtils.addVisits(places);
- yield check_autocomplete({
- search: "smokey.mozilla.org/fo",
- autofilled: "smokey.mozilla.org/foo/",
- completed: "http://www.smokey.mozilla.org/foo/",
- });
- yield cleanup();
-});
-
-add_task(function* test_complete_querystring() {
- do_print("Check to make sure we autocomplete after ?");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits(NetUtil.newURI("http://smokey.mozilla.org/foo?bacon=delicious"));
- yield check_autocomplete({
- search: "smokey.mozilla.org/foo?",
- autofilled: "smokey.mozilla.org/foo?bacon=delicious",
- completed: "http://smokey.mozilla.org/foo?bacon=delicious",
- });
- yield cleanup();
-});
-
-add_task(function* test_complete_fragment() {
- do_print("Check to make sure we autocomplete after #");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits(NetUtil.newURI("http://smokey.mozilla.org/foo?bacon=delicious#bar"));
- yield check_autocomplete({
- search: "smokey.mozilla.org/foo?bacon=delicious#bar",
- autofilled: "smokey.mozilla.org/foo?bacon=delicious#bar",
- completed: "http://smokey.mozilla.org/foo?bacon=delicious#bar",
- });
- yield cleanup();
-});
-
-add_task(function* test_autocomplete_enabled_pref() {
- Services.prefs.setBoolPref(PREF_AUTOCOMPLETE_ENABLED, false);
- let types = ["history", "bookmark", "openpage"];
- for (type of types) {
- do_check_eq(Services.prefs.getBoolPref("browser.urlbar.suggest." + type), false,
- "suggest." + type + "pref should be false");
- }
- Services.prefs.setBoolPref(PREF_AUTOCOMPLETE_ENABLED, true);
- for (type of types) {
- do_check_eq(Services.prefs.getBoolPref("browser.urlbar.suggest." + type), true,
- "suggest." + type + "pref should be true");
- }
-
- // Clear prefs.
- Services.prefs.clearUserPref(PREF_AUTOCOMPLETE_ENABLED);
- for (type of types) {
- Services.prefs.clearUserPref("browser.urlbar.suggest." + type);
- }
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_on_value_removed_479089.js b/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_on_value_removed_479089.js
deleted file mode 100644
index ecc96266b..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_autocomplete_on_value_removed_479089.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * Need to test that removing a page from autocomplete actually removes a page
- * Description From Shawn Wilsher :sdwilsh 2009-02-18 11:29:06 PST
- * We don't test the code path of onValueRemoved
- * for the autocomplete implementation
- * Bug 479089
- */
-
-add_task(function* test_autocomplete_on_value_removed() {
- let listener = Cc["@mozilla.org/autocomplete/search;1?name=unifiedcomplete"].
- getService(Components.interfaces.nsIAutoCompleteSimpleResultListener);
-
- let testUri = NetUtil.newURI("http://foo.mozilla.com/");
- yield PlacesTestUtils.addVisits({
- uri: testUri,
- referrer: uri("http://mozilla.com/")
- });
-
- let query = PlacesUtils.history.getNewQuery();
- let options = PlacesUtils.history.getNewQueryOptions();
- // look for this uri only
- query.uri = testUri;
-
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- Assert.equal(root.childCount, 1);
- // call the untested code path
- listener.onValueRemoved(null, testUri.spec, true);
- // make sure it is GONE from the DB
- Assert.equal(root.childCount, 0);
- // close the container
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_autofill_default_behavior.js b/toolkit/components/places/tests/unifiedcomplete/test_autofill_default_behavior.js
deleted file mode 100644
index 482fcf485..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_autofill_default_behavior.js
+++ /dev/null
@@ -1,310 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test autoFill for different default behaviors.
- */
-
-add_task(function* test_default_behavior_host() {
- let uri1 = NetUtil.newURI("http://typed/");
- let uri2 = NetUtil.newURI("http://visited/");
- let uri3 = NetUtil.newURI("http://bookmarked/");
- let uri4 = NetUtil.newURI("http://tpbk/");
- let uri5 = NetUtil.newURI("http://tagged/");
-
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "typed", transition: TRANSITION_TYPED },
- { uri: uri2, title: "visited" },
- { uri: uri4, title: "tpbk", transition: TRANSITION_TYPED },
- ]);
- yield addBookmark( { uri: uri3, title: "bookmarked" } );
- yield addBookmark( { uri: uri4, title: "tpbk" } );
- yield addBookmark( { uri: uri5, title: "title", tags: ["foo"] } );
-
- yield setFaviconForHref(uri1.spec, "chrome://global/skin/icons/information-16.png");
- yield setFaviconForHref(uri3.spec, "chrome://global/skin/icons/error-16.png");
-
- // RESTRICT TO HISTORY.
- Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
- Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", false);
- Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-
- do_print("Restrict history, common visit, should not autoFill");
- yield check_autocomplete({
- search: "vi",
- matches: [ { uri: uri2, title: "visited" } ],
- autofilled: "vi",
- completed: "vi"
- });
-
- do_print("Restrict history, typed visit, should autoFill");
- yield check_autocomplete({
- search: "ty",
- matches: [ { uri: uri1, title: "typed", style: [ "autofill", "heuristic" ],
- icon: "chrome://global/skin/icons/information-16.png" } ],
- autofilled: "typed/",
- completed: "typed/"
- });
-
- // Don't autoFill this one cause it's not typed.
- do_print("Restrict history, bookmark, should not autoFill");
- yield check_autocomplete({
- search: "bo",
- matches: [ ],
- autofilled: "bo",
- completed: "bo"
- });
-
- // Note we don't show this one cause it's not typed.
- do_print("Restrict history, typed bookmark, should autoFill");
- yield check_autocomplete({
- search: "tp",
- matches: [ { uri: uri4, title: "tpbk", style: [ "autofill", "heuristic" ] } ],
- autofilled: "tpbk/",
- completed: "tpbk/"
- });
-
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
-
- // We are not restricting on typed, so we autoFill the bookmark even if we
- // are restricted to history. We accept that cause not doing that
- // would be a perf hit and the privacy implications are very weak.
- do_print("Restrict history, bookmark, autoFill.typed = false, should autoFill");
- yield check_autocomplete({
- search: "bo",
- matches: [ { uri: uri3, title: "bookmarked", style: [ "autofill", "heuristic" ],
- icon: "chrome://global/skin/icons/error-16.png" } ],
- autofilled: "bookmarked/",
- completed: "bookmarked/"
- });
-
- do_print("Restrict history, common visit, autoFill.typed = false, should autoFill");
- yield check_autocomplete({
- search: "vi",
- matches: [ { uri: uri2, title: "visited", style: [ "autofill", "heuristic" ] } ],
- autofilled: "visited/",
- completed: "visited/"
- });
-
- // RESTRICT TO TYPED.
- // This should basically ignore autoFill.typed and acts as if it would be set.
- Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);
-
- // Typed behavior basically acts like history, but filters on typed.
- do_print("Restrict typed, common visit, autoFill.typed = false, should not autoFill");
- yield check_autocomplete({
- search: "vi",
- matches: [ ],
- autofilled: "vi",
- completed: "vi"
- });
-
- do_print("Restrict typed, typed visit, autofill.typed = false, should autoFill");
- yield check_autocomplete({
- search: "ty",
- matches: [ { uri: uri1, title: "typed", style: [ "autofill", "heuristic" ],
- icon: "chrome://global/skin/icons/information-16.png"} ],
- autofilled: "typed/",
- completed: "typed/"
- });
-
- do_print("Restrict typed, bookmark, autofill.typed = false, should not autoFill");
- yield check_autocomplete({
- search: "bo",
- matches: [ ],
- autofilled: "bo",
- completed: "bo"
- });
-
- do_print("Restrict typed, typed bookmark, autofill.typed = false, should autoFill");
- yield check_autocomplete({
- search: "tp",
- matches: [ { uri: uri4, title: "tpbk", style: [ "autofill", "heuristic" ] } ],
- autofilled: "tpbk/",
- completed: "tpbk/"
- });
-
- // RESTRICT BOOKMARKS.
- Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
- Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", true);
-
- do_print("Restrict bookmarks, common visit, should not autoFill");
- yield check_autocomplete({
- search: "vi",
- matches: [ ],
- autofilled: "vi",
- completed: "vi"
- });
-
- do_print("Restrict bookmarks, typed visit, should not autoFill");
- yield check_autocomplete({
- search: "ty",
- matches: [ ],
- autofilled: "ty",
- completed: "ty"
- });
-
- // Don't autoFill this one cause it's not typed.
- do_print("Restrict bookmarks, bookmark, should not autoFill");
- yield check_autocomplete({
- search: "bo",
- matches: [ { uri: uri3, title: "bookmarked", style: [ "bookmark" ],
- icon: "chrome://global/skin/icons/error-16.png"} ],
- autofilled: "bo",
- completed: "bo"
- });
-
- // Note we don't show this one cause it's not typed.
- do_print("Restrict bookmarks, typed bookmark, should autoFill");
- yield check_autocomplete({
- search: "tp",
- matches: [ { uri: uri4, title: "tpbk", style: [ "autofill", "heuristic" ] } ],
- autofilled: "tpbk/",
- completed: "tpbk/"
- });
-
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
-
- do_print("Restrict bookmarks, bookmark, autofill.typed = false, should autoFill");
- yield check_autocomplete({
- search: "bo",
- matches: [ { uri: uri3, title: "bookmarked", style: [ "autofill", "heuristic" ],
- icon: "chrome://global/skin/icons/error-16.png" } ],
- autofilled: "bookmarked/",
- completed: "bookmarked/"
- });
-
- // Don't autofill because it's a title.
- do_print("Restrict bookmarks, title, autofill.typed = false, should not autoFill");
- yield check_autocomplete({
- search: "# ta",
- matches: [ ],
- autofilled: "# ta",
- completed: "# ta"
- });
-
- // Don't autofill because it's a tag.
- do_print("Restrict bookmarks, tag, autofill.typed = false, should not autoFill");
- yield check_autocomplete({
- search: "+ ta",
- matches: [ { uri: uri5, title: "title", tags: [ "foo" ], style: [ "tag" ] } ],
- autofilled: "+ ta",
- completed: "+ ta"
- });
-
- yield cleanup();
-});
-
-add_task(function* test_default_behavior_url() {
- let uri1 = NetUtil.newURI("http://typed/ty/");
- let uri2 = NetUtil.newURI("http://visited/vi/");
- let uri3 = NetUtil.newURI("http://bookmarked/bo/");
- let uri4 = NetUtil.newURI("http://tpbk/tp/");
-
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "typed", transition: TRANSITION_TYPED },
- { uri: uri2, title: "visited" },
- { uri: uri4, title: "tpbk", transition: TRANSITION_TYPED },
- ]);
- yield addBookmark( { uri: uri3, title: "bookmarked" } );
- yield addBookmark( { uri: uri4, title: "tpbk" } );
-
- yield setFaviconForHref(uri1.spec, "chrome://global/skin/icons/information-16.png");
- yield setFaviconForHref(uri3.spec, "chrome://global/skin/icons/error-16.png");
-
- // RESTRICT TO HISTORY.
- Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
- Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", false);
- Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", true);
- Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", false);
-
- do_print("URL: Restrict history, common visit, should not autoFill");
- yield check_autocomplete({
- search: "visited/v",
- matches: [ { uri: uri2, title: "visited" } ],
- autofilled: "visited/v",
- completed: "visited/v"
- });
-
- do_print("URL: Restrict history, typed visit, should autoFill");
- yield check_autocomplete({
- search: "typed/t",
- matches: [ { uri: uri1, title: "typed/ty/", style: [ "autofill", "heuristic" ],
- icon: "chrome://global/skin/icons/information-16.png"} ],
- autofilled: "typed/ty/",
- completed: "http://typed/ty/"
- });
-
- // Don't autoFill this one cause it's not typed.
- do_print("URL: Restrict history, bookmark, should not autoFill");
- yield check_autocomplete({
- search: "bookmarked/b",
- matches: [ ],
- autofilled: "bookmarked/b",
- completed: "bookmarked/b"
- });
-
- // Note we don't show this one cause it's not typed.
- do_print("URL: Restrict history, typed bookmark, should autoFill");
- yield check_autocomplete({
- search: "tpbk/t",
- matches: [ { uri: uri4, title: "tpbk/tp/", style: [ "autofill", "heuristic" ] } ],
- autofilled: "tpbk/tp/",
- completed: "http://tpbk/tp/"
- });
-
- // RESTRICT BOOKMARKS.
- Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
- Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
-
- do_print("URL: Restrict bookmarks, common visit, should not autoFill");
- yield check_autocomplete({
- search: "visited/v",
- matches: [ ],
- autofilled: "visited/v",
- completed: "visited/v"
- });
-
- do_print("URL: Restrict bookmarks, typed visit, should not autoFill");
- yield check_autocomplete({
- search: "typed/t",
- matches: [ ],
- autofilled: "typed/t",
- completed: "typed/t"
- });
-
- // Don't autoFill this one cause it's not typed.
- do_print("URL: Restrict bookmarks, bookmark, should not autoFill");
- yield check_autocomplete({
- search: "bookmarked/b",
- matches: [ { uri: uri3, title: "bookmarked", style: [ "bookmark" ],
- icon: "chrome://global/skin/icons/error-16.png" } ],
- autofilled: "bookmarked/b",
- completed: "bookmarked/b"
- });
-
- // Note we don't show this one cause it's not typed.
- do_print("URL: Restrict bookmarks, typed bookmark, should autoFill");
- yield check_autocomplete({
- search: "tpbk/t",
- matches: [ { uri: uri4, title: "tpbk/tp/", style: [ "autofill", "heuristic" ] } ],
- autofilled: "tpbk/tp/",
- completed: "http://tpbk/tp/"
- });
-
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
-
- do_print("URL: Restrict bookmarks, bookmark, autofill.typed = false, should autoFill");
- yield check_autocomplete({
- search: "bookmarked/b",
- matches: [ { uri: uri3, title: "bookmarked/bo/", style: [ "autofill", "heuristic" ],
- icon: "chrome://global/skin/icons/error-16.png" } ],
- autofilled: "bookmarked/bo/",
- completed: "http://bookmarked/bo/"
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_avoid_middle_complete.js b/toolkit/components/places/tests/unifiedcomplete/test_avoid_middle_complete.js
deleted file mode 100644
index 54fc343ca..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_avoid_middle_complete.js
+++ /dev/null
@@ -1,179 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-add_task(function* test_prefix_space_noautofill() {
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://moz.org/test/"),
- transition: TRANSITION_TYPED
- });
-
- do_print("Should not try to autoFill if search string contains a space");
- yield check_autocomplete({
- search: " mo",
- autofilled: " mo",
- completed: " mo"
- });
-
- yield cleanup();
-});
-
-add_task(function* test_trailing_space_noautofill() {
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://moz.org/test/"),
- transition: TRANSITION_TYPED
- });
-
- do_print("Should not try to autoFill if search string contains a space");
- yield check_autocomplete({
- search: "mo ",
- autofilled: "mo ",
- completed: "mo "
- });
-
- yield cleanup();
-});
-
-add_task(function* test_searchEngine_autofill() {
- Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
- Services.search.addEngineWithDetails("CakeSearch", "", "", "",
- "GET", "http://cake.search/");
- let engine = Services.search.getEngineByName("CakeSearch");
- engine.addParam("q", "{searchTerms}", null);
- do_register_cleanup(() => Services.search.removeEngine(engine));
-
- do_print("Should autoFill search engine if search string does not contains a space");
- yield check_autocomplete({
- search: "ca",
- autofilled: "cake.search",
- completed: "http://cake.search"
- });
-
- yield cleanup();
-});
-
-add_task(function* test_searchEngine_prefix_space_noautofill() {
- Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
- Services.search.addEngineWithDetails("CupcakeSearch", "", "", "",
- "GET", "http://cupcake.search/");
- let engine = Services.search.getEngineByName("CupcakeSearch");
- engine.addParam("q", "{searchTerms}", null);
- do_register_cleanup(() => Services.search.removeEngine(engine));
-
- do_print("Should not try to autoFill search engine if search string contains a space");
- yield check_autocomplete({
- search: " cu",
- autofilled: " cu",
- completed: " cu"
- });
-
- yield cleanup();
-});
-
-add_task(function* test_searchEngine_trailing_space_noautofill() {
- Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
- Services.search.addEngineWithDetails("BaconSearch", "", "", "",
- "GET", "http://bacon.search/");
- let engine = Services.search.getEngineByName("BaconSearch");
- engine.addParam("q", "{searchTerms}", null);
- do_register_cleanup(() => Services.search.removeEngine(engine));
-
- do_print("Should not try to autoFill search engine if search string contains a space");
- yield check_autocomplete({
- search: "ba ",
- autofilled: "ba ",
- completed: "ba "
- });
-
- yield cleanup();
-});
-
-add_task(function* test_searchEngine_www_noautofill() {
- Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
- Services.search.addEngineWithDetails("HamSearch", "", "", "",
- "GET", "http://ham.search/");
- let engine = Services.search.getEngineByName("HamSearch");
- engine.addParam("q", "{searchTerms}", null);
- do_register_cleanup(() => Services.search.removeEngine(engine));
-
- do_print("Should not autoFill search engine if search string contains www. but engine doesn't");
- yield check_autocomplete({
- search: "www.ham",
- autofilled: "www.ham",
- completed: "www.ham"
- });
-
- yield cleanup();
-});
-
-add_task(function* test_searchEngine_different_scheme_noautofill() {
- Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
- Services.search.addEngineWithDetails("PieSearch", "", "", "",
- "GET", "https://pie.search/");
- let engine = Services.search.getEngineByName("PieSearch");
- engine.addParam("q", "{searchTerms}", null);
- do_register_cleanup(() => Services.search.removeEngine(engine));
-
- do_print("Should not autoFill search engine if search string has a different scheme.");
- yield check_autocomplete({
- search: "http://pie",
- autofilled: "http://pie",
- completed: "http://pie"
- });
-
- yield cleanup();
-});
-
-add_task(function* test_searchEngine_matching_prefix_autofill() {
- Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
- Services.search.addEngineWithDetails("BeanSearch", "", "", "",
- "GET", "http://www.bean.search/");
- let engine = Services.search.getEngineByName("BeanSearch");
- engine.addParam("q", "{searchTerms}", null);
- do_register_cleanup(() => Services.search.removeEngine(engine));
-
-
- do_print("Should autoFill search engine if search string has matching prefix.");
- yield check_autocomplete({
- search: "http://www.be",
- autofilled: "http://www.bean.search",
- completed: "http://www.bean.search"
- })
-
- do_print("Should autoFill search engine if search string has www prefix.");
- yield check_autocomplete({
- search: "www.be",
- autofilled: "www.bean.search",
- completed: "http://www.bean.search"
- });
-
- do_print("Should autoFill search engine if search string has matching scheme.");
- yield check_autocomplete({
- search: "http://be",
- autofilled: "http://bean.search",
- completed: "http://www.bean.search"
- });
-
- yield cleanup();
-});
-
-add_task(function* test_prefix_autofill() {
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://moz.org/test/"),
- transition: TRANSITION_TYPED
- });
-
- do_print("Should not try to autoFill in-the-middle if a search is canceled immediately");
- yield check_autocomplete({
- incompleteSearch: "moz",
- search: "mozi",
- autofilled: "mozilla.org/",
- completed: "mozilla.org/"
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_avoid_stripping_to_empty_tokens.js b/toolkit/components/places/tests/unifiedcomplete/test_avoid_stripping_to_empty_tokens.js
deleted file mode 100644
index 1fcfe1c75..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_avoid_stripping_to_empty_tokens.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-add_task(function* test_protocol_trimming() {
- for (let prot of ["http", "https", "ftp"]) {
- let visit = {
- // Include the protocol in the query string to ensure we get matches (see bug 1059395)
- uri: NetUtil.newURI(prot + "://www.mozilla.org/test/?q=" + prot + encodeURIComponent("://") + "www.foo"),
- title: "Test title",
- transition: TRANSITION_TYPED
- };
- yield PlacesTestUtils.addVisits(visit);
- let matches = [{uri: visit.uri, title: visit.title}];
-
- let inputs = [
- prot + "://",
- prot + ":// ",
- prot + ":// mo",
- prot + "://mo te",
- prot + "://www.",
- prot + "://www. ",
- prot + "://www. mo",
- prot + "://www.mo te",
- "www.",
- "www. ",
- "www. mo",
- "www.mo te"
- ];
- for (let input of inputs) {
- do_print("Searching for: " + input);
- yield check_autocomplete({
- search: input,
- matches: matches
- });
- }
-
- yield cleanup();
- }
-});
-
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_casing.js b/toolkit/components/places/tests/unifiedcomplete/test_casing.js
deleted file mode 100644
index 585b51be1..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_casing.js
+++ /dev/null
@@ -1,157 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-add_task(function* test_casing_1() {
- do_print("Searching for cased entry 1");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "MOZ",
- autofilled: "MOZilla.org/",
- completed: "mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_casing_2() {
- do_print("Searching for cased entry 2");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mozilla.org/T",
- autofilled: "mozilla.org/T",
- completed: "mozilla.org/T"
- });
- yield cleanup();
-});
-
-add_task(function* test_casing_3() {
- do_print("Searching for cased entry 3");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/Test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mozilla.org/T",
- autofilled: "mozilla.org/Test/",
- completed: "http://mozilla.org/Test/"
- });
- yield cleanup();
-});
-
-add_task(function* test_casing_4() {
- do_print("Searching for cased entry 4");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/Test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mOzilla.org/t",
- autofilled: "mOzilla.org/t",
- completed: "mOzilla.org/t"
- });
- yield cleanup();
-});
-
-add_task(function* test_casing_5() {
- do_print("Searching for cased entry 5");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/Test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mOzilla.org/T",
- autofilled: "mOzilla.org/Test/",
- completed: "http://mozilla.org/Test/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untrimmed_casing() {
- do_print("Searching for untrimmed cased entry");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/Test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "http://mOz",
- autofilled: "http://mOzilla.org/",
- completed: "http://mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untrimmed_www_casing() {
- do_print("Searching for untrimmed cased entry with www");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://www.mozilla.org/Test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "http://www.mOz",
- autofilled: "http://www.mOzilla.org/",
- completed: "http://www.mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untrimmed_path_casing() {
- do_print("Searching for untrimmed cased entry with path");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/Test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "http://mOzilla.org/t",
- autofilled: "http://mOzilla.org/t",
- completed: "http://mOzilla.org/t"
- });
- yield cleanup();
-});
-
-add_task(function* test_untrimmed_path_casing_2() {
- do_print("Searching for untrimmed cased entry with path 2");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/Test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "http://mOzilla.org/T",
- autofilled: "http://mOzilla.org/Test/",
- completed: "http://mozilla.org/Test/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untrimmed_path_www_casing() {
- do_print("Searching for untrimmed cased entry with www and path");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://www.mozilla.org/Test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "http://www.mOzilla.org/t",
- autofilled: "http://www.mOzilla.org/t",
- completed: "http://www.mOzilla.org/t"
- });
- yield cleanup();
-});
-
-add_task(function* test_untrimmed_path_www_casing_2() {
- do_print("Searching for untrimmed cased entry with www and path 2");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://www.mozilla.org/Test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "http://www.mOzilla.org/T",
- autofilled: "http://www.mOzilla.org/Test/",
- completed: "http://www.mozilla.org/Test/"
- });
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_do_not_trim.js b/toolkit/components/places/tests/unifiedcomplete/test_do_not_trim.js
deleted file mode 100644
index 014d74998..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_do_not_trim.js
+++ /dev/null
@@ -1,91 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Inline should never return matches shorter than the search string, since
-// that largely confuses completeDefaultIndex
-
-add_task(function* test_not_autofill_ws_1() {
- do_print("Do not autofill whitespaced entry 1");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/link/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mozilla.org ",
- autofilled: "mozilla.org ",
- completed: "mozilla.org "
- });
- yield cleanup();
-});
-
-add_task(function* test_not_autofill_ws_2() {
- do_print("Do not autofill whitespaced entry 2");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/link/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mozilla.org/ ",
- autofilled: "mozilla.org/ ",
- completed: "mozilla.org/ "
- });
- yield cleanup();
-});
-
-add_task(function* test_not_autofill_ws_3() {
- do_print("Do not autofill whitespaced entry 3");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/link/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mozilla.org/link ",
- autofilled: "mozilla.org/link ",
- completed: "mozilla.org/link "
- });
- yield cleanup();
-});
-
-add_task(function* test_not_autofill_ws_4() {
- do_print("Do not autofill whitespaced entry 4");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/link/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mozilla.org/link/ ",
- autofilled: "mozilla.org/link/ ",
- completed: "mozilla.org/link/ "
- });
- yield cleanup();
-});
-
-
-add_task(function* test_not_autofill_ws_5() {
- do_print("Do not autofill whitespaced entry 5");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/link/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "moz illa ",
- autofilled: "moz illa ",
- completed: "moz illa "
- });
- yield cleanup();
-});
-
-add_task(function* test_not_autofill_ws_6() {
- do_print("Do not autofill whitespaced entry 6");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/link/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: " mozilla",
- autofilled: " mozilla",
- completed: " mozilla"
- });
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_download_embed_bookmarks.js b/toolkit/components/places/tests/unifiedcomplete/test_download_embed_bookmarks.js
deleted file mode 100644
index 72661d075..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_download_embed_bookmarks.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim:set ts=2 sw=2 sts=2 et:
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Tests bug 449406 to ensure that TRANSITION_DOWNLOAD, TRANSITION_EMBED and
- * TRANSITION_FRAMED_LINK bookmarked uri's show up in the location bar.
- */
-
-add_task(function* test_download_embed_bookmarks() {
- let uri1 = NetUtil.newURI("http://download/bookmarked");
- let uri2 = NetUtil.newURI("http://embed/bookmarked");
- let uri3 = NetUtil.newURI("http://framed/bookmarked");
- let uri4 = NetUtil.newURI("http://download");
- let uri5 = NetUtil.newURI("http://embed");
- let uri6 = NetUtil.newURI("http://framed");
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "download-bookmark", transition: TRANSITION_DOWNLOAD },
- { uri: uri2, title: "embed-bookmark", transition: TRANSITION_EMBED },
- { uri: uri3, title: "framed-bookmark", transition: TRANSITION_FRAMED_LINK},
- { uri: uri4, title: "download2", transition: TRANSITION_DOWNLOAD },
- { uri: uri5, title: "embed2", transition: TRANSITION_EMBED },
- { uri: uri6, title: "framed2", transition: TRANSITION_FRAMED_LINK }
- ]);
- yield addBookmark({ uri: uri1,
- title: "download-bookmark" });
- yield addBookmark({ uri: uri2,
- title: "embed-bookmark" });
- yield addBookmark({ uri: uri3,
- title: "framed-bookmark" });
-
- do_print("Searching for bookmarked download uri matches");
- yield check_autocomplete({
- search: "download-bookmark",
- matches: [ { uri: uri1, title: "download-bookmark", style: [ "bookmark" ] } ]
- });
-
- do_print("Searching for bookmarked embed uri matches");
- yield check_autocomplete({
- search: "embed-bookmark",
- matches: [ { uri: uri2, title: "embed-bookmark", style: [ "bookmark" ] } ]
- });
-
- do_print("Searching for bookmarked framed uri matches");
- yield check_autocomplete({
- search: "framed-bookmark",
- matches: [ { uri: uri3, title: "framed-bookmark", style: [ "bookmark" ] } ]
- });
-
- do_print("Searching for download uri does not match");
- yield check_autocomplete({
- search: "download2",
- matches: [ ]
- });
-
- do_print("Searching for embed uri does not match");
- yield check_autocomplete({
- search: "embed2",
- matches: [ ]
- });
-
- do_print("Searching for framed uri does not match");
- yield check_autocomplete({
- search: "framed2",
- matches: [ ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_dupe_urls.js b/toolkit/components/places/tests/unifiedcomplete/test_dupe_urls.js
deleted file mode 100644
index a39c15236..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_dupe_urls.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Ensure inline autocomplete doesn't return zero frecency pages.
-
-add_task(function* test_dupe_urls() {
- do_print("Searching for urls with dupes should only show one");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/"),
- transition: TRANSITION_TYPED
- }, {
- uri: NetUtil.newURI("http://mozilla.org/?")
- });
- yield check_autocomplete({
- search: "moz",
- autofilled: "mozilla.org/",
- completed: "mozilla.org/",
- matches: [ { uri: NetUtil.newURI("http://mozilla.org/"),
- title: "mozilla.org",
- style: [ "autofill", "heuristic" ] } ]
- });
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_empty_search.js b/toolkit/components/places/tests/unifiedcomplete/test_empty_search.js
deleted file mode 100644
index ef1159705..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_empty_search.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test for bug 426864 that makes sure the empty search (drop down list) only
- * shows typed pages from history.
- */
-
-add_task(function* test_javascript_match() {
- let uri1 = NetUtil.newURI("http://t.foo/0");
- let uri2 = NetUtil.newURI("http://t.foo/1");
- let uri3 = NetUtil.newURI("http://t.foo/2");
- let uri4 = NetUtil.newURI("http://t.foo/3");
- let uri5 = NetUtil.newURI("http://t.foo/4");
- let uri6 = NetUtil.newURI("http://t.foo/5");
- let uri7 = NetUtil.newURI("http://t.foo/6");
-
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "title" },
- { uri: uri2, title: "title" },
- { uri: uri3, title: "title", transition: TRANSITION_TYPED},
- { uri: uri4, title: "title", transition: TRANSITION_TYPED },
- { uri: uri6, title: "title", transition: TRANSITION_TYPED },
- { uri: uri7, title: "title" }
- ]);
-
- yield addBookmark({ uri: uri2,
- title: "title" });
- yield addBookmark({ uri: uri4,
- title: "title" });
- yield addBookmark({ uri: uri5,
- title: "title" });
- yield addBookmark({ uri: uri6,
- title: "title" });
-
- addOpenPages(uri7, 1);
-
- // Now remove page 6 from history, so it is an unvisited bookmark.
- PlacesUtils.history.removePage(uri6);
-
- do_print("Match everything");
- yield check_autocomplete({
- search: "foo",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("foo", { heuristic: true }),
- { uri: uri1, title: "title" },
- { uri: uri2, title: "title", style: ["bookmark"] },
- { uri: uri3, title: "title" },
- { uri: uri4, title: "title", style: ["bookmark"] },
- { uri: uri5, title: "title", style: ["bookmark"] },
- { uri: uri6, title: "title", style: ["bookmark"] },
- makeSwitchToTabMatch("http://t.foo/6", { title: "title" }),
- ]
- });
-
- // Note the next few tests do *not* get a search result as enable-actions
- // isn't specified.
- do_print("Match only typed history");
- yield check_autocomplete({
- search: "foo ^ ~",
- matches: [ { uri: uri3, title: "title" },
- { uri: uri4, title: "title" } ]
- });
-
- do_print("Drop-down empty search matches only typed history");
- yield check_autocomplete({
- search: "",
- matches: [ { uri: uri3, title: "title" },
- { uri: uri4, title: "title" } ]
- });
-
- do_print("Drop-down empty search matches only bookmarks");
- Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
- Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
- yield check_autocomplete({
- search: "",
- matches: [ { uri: uri2, title: "title", style: ["bookmark"] },
- { uri: uri4, title: "title", style: ["bookmark"] },
- { uri: uri5, title: "title", style: ["bookmark"] },
- { uri: uri6, title: "title", style: ["bookmark"] } ]
- });
-
- do_print("Drop-down empty search matches only open tabs");
- Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
- yield check_autocomplete({
- search: "",
- searchParam: "enable-actions",
- matches: [
- makeSwitchToTabMatch("http://t.foo/6", { title: "title" }),
- ]
- });
-
- Services.prefs.clearUserPref("browser.urlbar.suggest.history");
- Services.prefs.clearUserPref("browser.urlbar.suggest.bookmark");
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_enabled.js b/toolkit/components/places/tests/unifiedcomplete/test_enabled.js
deleted file mode 100644
index dee8df8ec..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_enabled.js
+++ /dev/null
@@ -1,68 +0,0 @@
-add_task(function* test_enabled() {
- // Test for bug 471903 to make sure searching in autocomplete can be turned on
- // and off. Also test bug 463535 for pref changing search.
- let uri = NetUtil.newURI("http://url/0");
- yield PlacesTestUtils.addVisits([ { uri: uri, title: "title" } ]);
-
- do_print("plain search");
- yield check_autocomplete({
- search: "url",
- matches: [ { uri: uri, title: "title" } ]
- });
-
- do_print("search disabled");
- Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", false);
- yield check_autocomplete({
- search: "url",
- matches: [ ]
- });
-
- do_print("resume normal search");
- Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", true);
- yield check_autocomplete({
- search: "url",
- matches: [ { uri: uri, title: "title" } ]
- });
-
- yield cleanup();
-});
-
-add_task(function* test_sync_enabled() {
- // Initialize unified complete.
- Cc["@mozilla.org/autocomplete/search;1?name=unifiedcomplete"]
- .getService(Ci.mozIPlacesAutoComplete);
-
- let types = [ "history", "bookmark", "openpage", "searches" ];
-
- // Test the service keeps browser.urlbar.autocomplete.enabled synchronized
- // with browser.urlbar.suggest prefs.
- for (let type of types) {
- Services.prefs.setBoolPref("browser.urlbar.suggest." + type, true);
- }
- Assert.equal(Services.prefs.getBoolPref("browser.urlbar.autocomplete.enabled"), true);
-
- // Disable autocomplete and check all the suggest prefs are set to false.
- Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", false);
- for (let type of types) {
- Assert.equal(Services.prefs.getBoolPref("browser.urlbar.suggest." + type), false);
- }
-
- // Setting even a single suggest pref to true should enable autocomplete.
- Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
- for (let type of types.filter(t => t != "history")) {
- Assert.equal(Services.prefs.getBoolPref("browser.urlbar.suggest." + type), false);
- }
- Assert.equal(Services.prefs.getBoolPref("browser.urlbar.autocomplete.enabled"), true);
-
- // Disable autocoplete again, then re-enable it and check suggest prefs
- // have been reset.
- Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", false);
- Services.prefs.setBoolPref("browser.urlbar.autocomplete.enabled", true);
- for (let type of types.filter(t => t != "history")) {
- if (type == "searches") {
- Assert.equal(Services.prefs.getBoolPref("browser.urlbar.suggest." + type), false);
- } else {
- Assert.equal(Services.prefs.getBoolPref("browser.urlbar.suggest." + type), true);
- }
- }
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_escape_self.js b/toolkit/components/places/tests/unifiedcomplete/test_escape_self.js
deleted file mode 100644
index ff6e5f929..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_escape_self.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test bug 422698 to make sure searches with urls from the location bar
- * correctly match itself when it contains escaped characters.
- */
-
-add_task(function* test_escape() {
- let uri1 = NetUtil.newURI("http://unescapeduri/");
- let uri2 = NetUtil.newURI("http://escapeduri/%40/");
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "title" },
- { uri: uri2, title: "title" }
- ]);
-
- do_print("Unescaped location matches itself");
- yield check_autocomplete({
- search: "http://unescapeduri/",
- matches: [ { uri: uri1, title: "title" } ]
- });
-
- do_print("Escaped location matches itself");
- yield check_autocomplete({
- search: "http://escapeduri/%40/",
- matches: [ { uri: uri2, title: "title" } ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_extension_matches.js b/toolkit/components/places/tests/unifiedcomplete/test_extension_matches.js
deleted file mode 100644
index 76af20558..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_extension_matches.js
+++ /dev/null
@@ -1,384 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim:set ts=2 sw=2 sts=2 et:
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import("resource://gre/modules/ExtensionSearchHandler.jsm");
-
-let controller = Cc["@mozilla.org/autocomplete/controller;1"].getService(Ci.nsIAutoCompleteController);
-
-add_task(function* test_correct_errors_are_thrown() {
- let keyword = "foo";
- let anotherKeyword = "bar";
- let unregisteredKeyword = "baz";
-
- // Register a keyword.
- ExtensionSearchHandler.registerKeyword(keyword, { emit: () => {} });
-
- // Try registering the keyword again.
- Assert.throws(() => ExtensionSearchHandler.registerKeyword(keyword, { emit: () => {} }));
-
- // Register a different keyword.
- ExtensionSearchHandler.registerKeyword(anotherKeyword, { emit: () => {} });
-
- // Try calling handleSearch for an unregistered keyword.
- Assert.throws(() => ExtensionSearchHandler.handleSearch(unregisteredKeyword, `${unregisteredKeyword} `, () => {}));
-
- // Try calling handleSearch without a callback.
- Assert.throws(() => ExtensionSearchHandler.handleSearch(unregisteredKeyword, `${unregisteredKeyword} `));
-
- // Try getting the description for a keyword which isn't registered.
- Assert.throws(() => ExtensionSearchHandler.getDescription(unregisteredKeyword));
-
- // Try getting the extension name for a keyword which isn't registered.
- Assert.throws(() => ExtensionSearchHandler.getExtensionName(unregisteredKeyword));
-
- // Try setting the default suggestion for a keyword which isn't registered.
- Assert.throws(() => ExtensionSearchHandler.setDefaultSuggestion(unregisteredKeyword, "suggestion"));
-
- // Try calling handleInputCancelled when there is no active input session.
- Assert.throws(() => ExtensionSearchHandler.handleInputCancelled());
-
- // Try calling handleInputEntered when there is no active input session.
- Assert.throws(() => ExtensionSearchHandler.handleInputEntered(anotherKeyword, `${anotherKeyword} test`, "tab"));
-
- // Start a session by calling handleSearch with the registered keyword.
- ExtensionSearchHandler.handleSearch(keyword, `${keyword} test`, () => {});
-
- // Try providing suggestions for an unregistered keyword.
- Assert.throws(() => ExtensionSearchHandler.addSuggestions(unregisteredKeyword, 0, []));
-
- // Try providing suggestions for an inactive keyword.
- Assert.throws(() => ExtensionSearchHandler.addSuggestions(anotherKeyword, 0, []));
-
- // Try calling handleSearch for an inactive keyword.
- Assert.throws(() => ExtensionSearchHandler.handleSearch(anotherKeyword, `${anotherKeyword} `, () => {}));
-
- // Try calling addSuggestions with an old callback ID.
- Assert.throws(() => ExtensionSearchHandler.addSuggestions(keyword, 0, []));
-
- // Add suggestions with a valid callback ID.
- ExtensionSearchHandler.addSuggestions(keyword, 1, []);
-
- // Add suggestions again with a valid callback ID.
- ExtensionSearchHandler.addSuggestions(keyword, 1, []);
-
- // Try calling addSuggestions with a future callback ID.
- Assert.throws(() => ExtensionSearchHandler.addSuggestions(keyword, 2, []));
-
- // End the input session by calling handleInputCancelled.
- ExtensionSearchHandler.handleInputCancelled();
-
- // Try calling handleInputCancelled after the session has ended.
- Assert.throws(() => ExtensionSearchHandler.handleInputCancelled());
-
- // Try calling handleSearch that doesn't have a space after the keyword.
- Assert.throws(() => ExtensionSearchHandler.handleSearch(anotherKeyword, `${anotherKeyword}`, () => {}));
-
- // Try calling handleSearch with text starting with the wrong keyword.
- Assert.throws(() => ExtensionSearchHandler.handleSearch(anotherKeyword, `${keyword} test`, () => {}));
-
- // Start a new session by calling handleSearch with a different keyword
- ExtensionSearchHandler.handleSearch(anotherKeyword, `${anotherKeyword} test`, () => {});
-
- // Try adding suggestions again with the same callback ID now that the input session has ended.
- Assert.throws(() => ExtensionSearchHandler.addSuggestions(keyword, 1, []));
-
- // Add suggestions with a valid callback ID.
- ExtensionSearchHandler.addSuggestions(anotherKeyword, 2, []);
-
- // Try adding suggestions with a valid callback ID but a different keyword.
- Assert.throws(() => ExtensionSearchHandler.addSuggestions(keyword, 2, []));
-
- // Try adding suggestions with a valid callback ID but an unregistered keyword.
- Assert.throws(() => ExtensionSearchHandler.addSuggestions(unregisteredKeyword, 2, []));
-
- // Set the default suggestion.
- ExtensionSearchHandler.setDefaultSuggestion(anotherKeyword, {description: "test result"});
-
- // Try ending the session using handleInputEntered with a different keyword.
- Assert.throws(() => ExtensionSearchHandler.handleInputEntered(keyword, `${keyword} test`, "tab"));
-
- // Try calling handleInputEntered with invalid text.
- Assert.throws(() => ExtensionSearchHandler.handleInputEntered(anotherKeyword, ` test`, "tab"));
-
- // Try calling handleInputEntered with an invalid disposition.
- Assert.throws(() => ExtensionSearchHandler.handleInputEntered(anotherKeyword, `${anotherKeyword} test`, "invalid"));
-
- // End the session by calling handleInputEntered.
- ExtensionSearchHandler.handleInputEntered(anotherKeyword, `${anotherKeyword} test`, "tab");
-
- // Try calling handleInputEntered after the session has ended.
- Assert.throws(() => ExtensionSearchHandler.handleInputEntered(anotherKeyword, `${anotherKeyword} test`, "tab"));
-
- // Unregister the keyword.
- ExtensionSearchHandler.unregisterKeyword(keyword);
-
- // Try setting the default suggestion for the unregistered keyword.
- Assert.throws(() => ExtensionSearchHandler.setDefaultSuggestion(keyword, {description: "test"}));
-
- // Try handling a search with the unregistered keyword.
- Assert.throws(() => ExtensionSearchHandler.handleSearch(keyword, `${keyword} test`, () => {}));
-
- // Try unregistering the keyword again.
- Assert.throws(() => ExtensionSearchHandler.unregisterKeyword(keyword));
-
- // Unregister the other keyword.
- ExtensionSearchHandler.unregisterKeyword(anotherKeyword);
-
- // Try unregistering the word which was never registered.
- Assert.throws(() => ExtensionSearchHandler.unregisterKeyword(unregisteredKeyword));
-
- // Try setting the default suggestion for a word that was never registered.
- Assert.throws(() => ExtensionSearchHandler.setDefaultSuggestion(unregisteredKeyword, {description: "test"}));
-
- yield cleanup();
-});
-
-add_task(function* test_correct_events_are_emitted() {
- let events = [];
- function checkEvents(expectedEvents) {
- Assert.equal(events.length, expectedEvents.length, "The correct number of events fired");
- expectedEvents.forEach((e, i) => Assert.equal(e, events[i], `Expected "${e}" event to fire`));
- events = [];
- }
-
- let mockExtension = { emit: message => events.push(message) };
-
- let keyword = "foo";
- let anotherKeyword = "bar";
-
- ExtensionSearchHandler.registerKeyword(keyword, mockExtension);
- ExtensionSearchHandler.registerKeyword(anotherKeyword, mockExtension);
-
- ExtensionSearchHandler.handleSearch(keyword, `${keyword} `, () => {});
- checkEvents([ExtensionSearchHandler.MSG_INPUT_STARTED]);
-
- ExtensionSearchHandler.handleSearch(keyword, `${keyword} f`, () => {});
- checkEvents([ExtensionSearchHandler.MSG_INPUT_CHANGED]);
-
- ExtensionSearchHandler.handleInputEntered(keyword, `${keyword} f`, "tab");
- checkEvents([ExtensionSearchHandler.MSG_INPUT_ENTERED]);
-
- ExtensionSearchHandler.handleSearch(keyword, `${keyword} f`, () => {});
- checkEvents([
- ExtensionSearchHandler.MSG_INPUT_STARTED,
- ExtensionSearchHandler.MSG_INPUT_CHANGED
- ]);
-
- ExtensionSearchHandler.handleInputCancelled();
- checkEvents([ExtensionSearchHandler.MSG_INPUT_CANCELLED]);
-
- ExtensionSearchHandler.handleSearch(anotherKeyword, `${anotherKeyword} baz`, () => {});
- checkEvents([
- ExtensionSearchHandler.MSG_INPUT_STARTED,
- ExtensionSearchHandler.MSG_INPUT_CHANGED
- ]);
-
- ExtensionSearchHandler.handleInputEntered(anotherKeyword, `${anotherKeyword} baz`, "tab");
- checkEvents([ExtensionSearchHandler.MSG_INPUT_ENTERED]);
-
- ExtensionSearchHandler.unregisterKeyword(keyword);
-});
-
-add_task(function* test_removes_suggestion_if_its_content_is_typed_in() {
- let keyword = "test";
- let extensionName = "Foo Bar";
-
- let mockExtension = {
- name: extensionName,
- emit(message, text, id) {
- if (message === ExtensionSearchHandler.MSG_INPUT_CHANGED) {
- ExtensionSearchHandler.addSuggestions(keyword, id, [
- {content: "foo", description: "first suggestion"},
- {content: "bar", description: "second suggestion"},
- {content: "baz", description: "third suggestion"},
- ]);
- controller.stopSearch();
- }
- }
- };
-
- ExtensionSearchHandler.registerKeyword(keyword, mockExtension);
-
- yield check_autocomplete({
- search: `${keyword} unmatched`,
- searchParam: "enable-actions",
- matches: [
- makeExtensionMatch({heuristic: true, keyword, description: extensionName, content: `${keyword} unmatched`}),
- makeExtensionMatch({keyword, content: `${keyword} foo`, description: "first suggestion"}),
- makeExtensionMatch({keyword, content: `${keyword} bar`, description: "second suggestion"}),
- makeExtensionMatch({keyword, content: `${keyword} baz`, description: "third suggestion"})
- ]
- });
-
- yield check_autocomplete({
- search: `${keyword} foo`,
- searchParam: "enable-actions",
- matches: [
- makeExtensionMatch({heuristic: true, keyword, description: extensionName, content: `${keyword} foo`}),
- makeExtensionMatch({keyword, content: `${keyword} bar`, description: "second suggestion"}),
- makeExtensionMatch({keyword, content: `${keyword} baz`, description: "third suggestion"})
- ]
- });
-
- yield check_autocomplete({
- search: `${keyword} bar`,
- searchParam: "enable-actions",
- matches: [
- makeExtensionMatch({heuristic: true, keyword, description: extensionName, content: `${keyword} bar`}),
- makeExtensionMatch({keyword, content: `${keyword} foo`, description: "first suggestion"}),
- makeExtensionMatch({keyword, content: `${keyword} baz`, description: "third suggestion"})
- ]
- });
-
- yield check_autocomplete({
- search: `${keyword} baz`,
- searchParam: "enable-actions",
- matches: [
- makeExtensionMatch({heuristic: true, keyword, description: extensionName, content: `${keyword} baz`}),
- makeExtensionMatch({keyword, content: `${keyword} foo`, description: "first suggestion"}),
- makeExtensionMatch({keyword, content: `${keyword} bar`, description: "second suggestion"})
- ]
- });
-
- ExtensionSearchHandler.unregisterKeyword(keyword);
- yield cleanup();
-});
-
-add_task(function* test_extension_results_should_come_first() {
- let keyword = "test";
- let extensionName = "Omnibox Example";
-
- let uri = NetUtil.newURI(`http://a.com/b`);
- yield PlacesTestUtils.addVisits([
- { uri, title: `${keyword} -` },
- ]);
-
- let mockExtension = {
- name: extensionName,
- emit(message, text, id) {
- if (message === ExtensionSearchHandler.MSG_INPUT_CHANGED) {
- ExtensionSearchHandler.addSuggestions(keyword, id, [
- {content: "foo", description: "first suggestion"},
- {content: "bar", description: "second suggestion"},
- {content: "baz", description: "third suggestion"},
- ]);
- }
- controller.stopSearch();
- }
- };
-
- ExtensionSearchHandler.registerKeyword(keyword, mockExtension);
-
- // Start an input session before testing MSG_INPUT_CHANGED.
- ExtensionSearchHandler.handleSearch(keyword, `${keyword} `, () => {});
-
- yield check_autocomplete({
- search: `${keyword} -`,
- searchParam: "enable-actions",
- matches: [
- makeExtensionMatch({heuristic: true, keyword, description: extensionName, content: `${keyword} -`}),
- makeExtensionMatch({keyword, content: `${keyword} foo`, description: "first suggestion"}),
- makeExtensionMatch({keyword, content: `${keyword} bar`, description: "second suggestion"}),
- makeExtensionMatch({keyword, content: `${keyword} baz`, description: "third suggestion"}),
- { uri, title: `${keyword} -` }
- ]
- });
-
- ExtensionSearchHandler.unregisterKeyword(keyword);
- yield cleanup();
-});
-
-add_task(function* test_setting_the_default_suggestion() {
- let keyword = "test";
- let extensionName = "Omnibox Example";
-
- let mockExtension = {
- name: extensionName,
- emit(message, text, id) {
- if (message === ExtensionSearchHandler.MSG_INPUT_CHANGED) {
- ExtensionSearchHandler.addSuggestions(keyword, id, []);
- }
- controller.stopSearch();
- }
- };
-
- ExtensionSearchHandler.registerKeyword(keyword, mockExtension);
-
- ExtensionSearchHandler.setDefaultSuggestion(keyword, {
- description: "hello world"
- });
-
- let searchString = `${keyword} search query`;
- yield check_autocomplete({
- search: searchString,
- searchParam: "enable-actions",
- matches: [
- makeExtensionMatch({heuristic: true, keyword, description: "hello world", content: searchString}),
- ]
- });
-
- ExtensionSearchHandler.setDefaultSuggestion(keyword, {
- description: "foo bar"
- });
-
- yield check_autocomplete({
- search: searchString,
- searchParam: "enable-actions",
- matches: [
- makeExtensionMatch({heuristic: true, keyword, description: "foo bar", content: searchString}),
- ]
- });
-
- ExtensionSearchHandler.unregisterKeyword(keyword);
- yield cleanup();
-});
-
-add_task(function* test_maximum_number_of_suggestions_is_enforced() {
- let keyword = "test";
- let extensionName = "Omnibox Example";
-
- let mockExtension = {
- name: extensionName,
- emit(message, text, id) {
- if (message === ExtensionSearchHandler.MSG_INPUT_CHANGED) {
- ExtensionSearchHandler.addSuggestions(keyword, id, [
- {content: "a", description: "first suggestion"},
- {content: "b", description: "second suggestion"},
- {content: "c", description: "third suggestion"},
- {content: "d", description: "fourth suggestion"},
- {content: "e", description: "fifth suggestion"},
- {content: "f", description: "sixth suggestion"},
- {content: "g", description: "seventh suggestion"},
- {content: "h", description: "eigth suggestion"},
- {content: "i", description: "ninth suggestion"},
- {content: "j", description: "tenth suggestion"},
- ]);
- controller.stopSearch();
- }
- }
- };
-
- ExtensionSearchHandler.registerKeyword(keyword, mockExtension);
-
- // Start an input session before testing MSG_INPUT_CHANGED.
- ExtensionSearchHandler.handleSearch(keyword, `${keyword} `, () => {});
-
- yield check_autocomplete({
- search: `${keyword} #`,
- searchParam: "enable-actions",
- matches: [
- makeExtensionMatch({heuristic: true, keyword, description: extensionName, content: `${keyword} #`}),
- makeExtensionMatch({keyword, content: `${keyword} a`, description: "first suggestion"}),
- makeExtensionMatch({keyword, content: `${keyword} b`, description: "second suggestion"}),
- makeExtensionMatch({keyword, content: `${keyword} c`, description: "third suggestion"}),
- makeExtensionMatch({keyword, content: `${keyword} d`, description: "fourth suggestion"}),
- makeExtensionMatch({keyword, content: `${keyword} e`, description: "fifth suggestion"}),
- ]
- });
-
- ExtensionSearchHandler.unregisterKeyword(keyword);
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_ignore_protocol.js b/toolkit/components/places/tests/unifiedcomplete/test_ignore_protocol.js
deleted file mode 100644
index 92e7f601a..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_ignore_protocol.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test bug 424509 to make sure searching for "h" doesn't match "http" of urls.
- */
-
-add_task(function* test_escape() {
- let uri1 = NetUtil.newURI("http://site/");
- let uri2 = NetUtil.newURI("http://happytimes/");
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "title" },
- { uri: uri2, title: "title" }
- ]);
-
- do_print("Searching for h matches site and not http://");
- yield check_autocomplete({
- search: "h",
- matches: [ { uri: uri2, title: "title" } ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_keyword_search.js b/toolkit/components/places/tests/unifiedcomplete/test_keyword_search.js
deleted file mode 100644
index 12b7fea77..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_keyword_search.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test for bug 392143 that puts keyword results into the autocomplete. Makes
- * sure that multiple parameter queries get spaces converted to +, + converted
- * to %2B, non-ascii become escaped, and pages in history that match the
- * keyword uses the page's title.
- *
- * Also test for bug 249468 by making sure multiple keyword bookmarks with the
- * same keyword appear in the list.
- */
-
-add_task(function* test_keyword_searc() {
- let uri1 = NetUtil.newURI("http://abc/?search=%s");
- let uri2 = NetUtil.newURI("http://abc/?search=ThisPageIsInHistory");
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "Generic page title" },
- { uri: uri2, title: "Generic page title" }
- ]);
- yield addBookmark({ uri: uri1, title: "Bookmark title", keyword: "key"});
-
- do_print("Plain keyword query");
- yield check_autocomplete({
- search: "key term",
- matches: [ { uri: NetUtil.newURI("http://abc/?search=term"), title: "abc", style: ["keyword", "heuristic"] } ]
- });
-
- do_print("Plain keyword UC");
- yield check_autocomplete({
- search: "key TERM",
- matches: [ { uri: NetUtil.newURI("http://abc/?search=TERM"), title: "abc", style: ["keyword", "heuristic"] } ]
- });
-
- do_print("Multi-word keyword query");
- yield check_autocomplete({
- search: "key multi word",
- matches: [ { uri: NetUtil.newURI("http://abc/?search=multi%20word"), title: "abc", style: ["keyword", "heuristic"] } ]
- });
-
- do_print("Keyword query with +");
- yield check_autocomplete({
- search: "key blocking+",
- matches: [ { uri: NetUtil.newURI("http://abc/?search=blocking%2B"), title: "abc", style: ["keyword", "heuristic"] } ]
- });
-
- do_print("Unescaped term in query");
- yield check_autocomplete({
- search: "key ユニコード",
- matches: [ { uri: NetUtil.newURI("http://abc/?search=ユニコード"), title: "abc", style: ["keyword", "heuristic"] } ]
- });
-
- do_print("Keyword that happens to match a page");
- yield check_autocomplete({
- search: "key ThisPageIsInHistory",
- matches: [ { uri: NetUtil.newURI("http://abc/?search=ThisPageIsInHistory"), title: "abc", style: ["keyword", "heuristic"] } ]
- });
-
- do_print("Keyword without query (without space)");
- yield check_autocomplete({
- search: "key",
- matches: [ { uri: NetUtil.newURI("http://abc/?search="), title: "abc", style: ["keyword", "heuristic"] } ]
- });
-
- do_print("Keyword without query (with space)");
- yield check_autocomplete({
- search: "key ",
- matches: [ { uri: NetUtil.newURI("http://abc/?search="), title: "abc", style: ["keyword", "heuristic"] } ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_keyword_search_actions.js b/toolkit/components/places/tests/unifiedcomplete/test_keyword_search_actions.js
deleted file mode 100644
index 61d98f72d..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_keyword_search_actions.js
+++ /dev/null
@@ -1,149 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test for bug 392143 that puts keyword results into the autocomplete. Makes
- * sure that multiple parameter queries get spaces converted to +, + converted
- * to %2B, non-ascii become escaped, and pages in history that match the
- * keyword uses the page's title.
- *
- * Also test for bug 249468 by making sure multiple keyword bookmarks with the
- * same keyword appear in the list.
- */
-
-add_task(function* test_keyword_search() {
- let uri1 = NetUtil.newURI("http://abc/?search=%s");
- let uri2 = NetUtil.newURI("http://abc/?search=ThisPageIsInHistory");
- let uri3 = NetUtil.newURI("http://abc/?search=%s&raw=%S");
- let uri4 = NetUtil.newURI("http://abc/?search=%s&raw=%S&mozcharset=ISO-8859-1");
- yield PlacesTestUtils.addVisits([{ uri: uri1 },
- { uri: uri2 },
- { uri: uri3 }]);
- yield addBookmark({ uri: uri1, title: "Keyword", keyword: "key"});
- yield addBookmark({ uri: uri1, title: "Post", keyword: "post", postData: "post_search=%s"});
- yield addBookmark({ uri: uri3, title: "Encoded", keyword: "encoded"});
- yield addBookmark({ uri: uri4, title: "Charset", keyword: "charset"});
- yield addBookmark({ uri: uri2, title: "Noparam", keyword: "noparam"});
- yield addBookmark({ uri: uri2, title: "Noparam-Post", keyword: "post_noparam", postData: "noparam=1"});
-
- do_print("Plain keyword query");
- yield check_autocomplete({
- search: "key term",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=term", input: "key term"}),
- title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
- });
-
- do_print("Plain keyword UC");
- yield check_autocomplete({
- search: "key TERM",
- matches: [ { uri: NetUtil.newURI("http://abc/?search=TERM"),
- title: "abc", style: ["keyword", "heuristic"] } ]
- });
-
- do_print("Multi-word keyword query");
- yield check_autocomplete({
- search: "key multi word",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=multi%20word", input: "key multi word"}),
- title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
- });
-
- do_print("Keyword query with +");
- yield check_autocomplete({
- search: "key blocking+",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=blocking%2B", input: "key blocking+"}),
- title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
- });
-
- do_print("Unescaped term in query");
- // ... but note that UnifiedComplete calls encodeURIComponent() on the query
- // string when it builds the URL, so the expected result will have the
- // ユニコード substring encoded in the URL.
- yield check_autocomplete({
- search: "key ユニコード",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=" + encodeURIComponent("ユニコード"), input: "key ユニコード"}),
- title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
- });
-
- do_print("Keyword that happens to match a page");
- yield check_autocomplete({
- search: "key ThisPageIsInHistory",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=ThisPageIsInHistory", input: "key ThisPageIsInHistory"}),
- title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
- });
-
- do_print("Keyword without query (without space)");
- yield check_autocomplete({
- search: "key",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=", input: "key"}),
- title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
- });
-
- do_print("Keyword without query (with space)");
- yield check_autocomplete({
- search: "key ",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=", input: "key "}),
- title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
- });
-
- do_print("POST Keyword");
- yield check_autocomplete({
- search: "post foo",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=foo", input: "post foo", postData: "post_search=foo"}),
- title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
- });
-
- do_print("Bug 420328: no-param keyword with a param");
- yield check_autocomplete({
- search: "noparam foo",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("noparam foo", { heuristic: true }) ]
- });
- yield check_autocomplete({
- search: "post_noparam foo",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("post_noparam foo", { heuristic: true }) ]
- });
-
- do_print("escaping with default UTF-8 charset");
- yield check_autocomplete({
- search: "encoded foé",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=fo%C3%A9&raw=foé", input: "encoded foé" }),
- title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
- });
-
- do_print("escaping with forced ISO-8859-1 charset");
- yield check_autocomplete({
- search: "charset foé",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=fo%E9&raw=foé", input: "charset foé" }),
- title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
- });
-
- do_print("Bug 359809: escaping +, / and @ with default UTF-8 charset");
- yield check_autocomplete({
- search: "encoded +/@",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=%2B%2F%40&raw=+/@", input: "encoded +/@" }),
- title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
- });
-
- do_print("Bug 359809: escaping +, / and @ with forced ISO-8859-1 charset");
- yield check_autocomplete({
- search: "charset +/@",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("keyword", {url: "http://abc/?search=%2B%2F%40&raw=+/@", input: "charset +/@" }),
- title: "abc", style: [ "action", "keyword", "heuristic" ] } ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_keywords.js b/toolkit/components/places/tests/unifiedcomplete/test_keywords.js
deleted file mode 100644
index 93e8d7a6f..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_keywords.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-add_task(function* test_non_keyword() {
- do_print("Searching for non-keyworded entry should autoFill it");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/") });
- yield check_autocomplete({
- search: "moz",
- autofilled: "mozilla.org/",
- completed: "mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_keyword() {
- do_print("Searching for keyworded entry should not autoFill it");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/"), keyword: "moz" });
- yield check_autocomplete({
- search: "moz",
- autofilled: "moz",
- completed: "moz",
- });
- yield cleanup();
-});
-
-add_task(function* test_more_than_keyword() {
- do_print("Searching for more than keyworded entry should autoFill it");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/"), keyword: "moz" });
- yield check_autocomplete({
- search: "mozi",
- autofilled: "mozilla.org/",
- completed: "mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_less_than_keyword() {
- do_print("Searching for less than keyworded entry should autoFill it");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/"), keyword: "moz" });
- yield check_autocomplete({
- search: "mo",
- autofilled: "mozilla.org/",
- completed: "mozilla.org/",
- });
- yield cleanup();
-});
-
-add_task(function* test_keyword_casing() {
- do_print("Searching for keyworded entry is case-insensitive");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield addBookmark({ uri: NetUtil.newURI("http://mozilla.org/test/"), keyword: "moz" });
- yield check_autocomplete({
- search: "MoZ",
- autofilled: "MoZ",
- completed: "MoZ"
- });
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_match_beginning.js b/toolkit/components/places/tests/unifiedcomplete/test_match_beginning.js
deleted file mode 100644
index 57a1efaeb..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_match_beginning.js
+++ /dev/null
@@ -1,54 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test bug 451760 which allows matching only at the beginning of urls or
- * titles to simulate Firefox 2 functionality.
- */
-
-add_task(function* test_match_beginning() {
- Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", false);
-
- let uri1 = NetUtil.newURI("http://x.com/y");
- let uri2 = NetUtil.newURI("https://y.com/x");
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "a b" },
- { uri: uri2, title: "b a" }
- ]);
-
- do_print("Match at the beginning of titles");
- Services.prefs.setIntPref("browser.urlbar.matchBehavior", 3);
- yield check_autocomplete({
- search: "a",
- matches: [ { uri: uri1, title: "a b" } ]
- });
-
- do_print("Match at the beginning of titles");
- yield check_autocomplete({
- search: "b",
- matches: [ { uri: uri2, title: "b a" } ]
- });
-
- do_print("Match at the beginning of urls");
- yield check_autocomplete({
- search: "x",
- matches: [ { uri: uri1, title: "a b" } ]
- });
-
- do_print("Match at the beginning of urls");
- yield check_autocomplete({
- search: "y",
- matches: [ { uri: uri2, title: "b a" } ]
- });
-
- do_print("Sanity check that matching anywhere finds more");
- Services.prefs.setIntPref("browser.urlbar.matchBehavior", 1);
- yield check_autocomplete({
- search: "a",
- matches: [ { uri: uri1, title: "a b" },
- { uri: uri2, title: "b a" } ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_multi_word_search.js b/toolkit/components/places/tests/unifiedcomplete/test_multi_word_search.js
deleted file mode 100644
index c6c9e952e..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_multi_word_search.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test for bug 401869 to allow multiple words separated by spaces to match in
- * the page title, page url, or bookmark title to be considered a match. All
- * terms must match but not all terms need to be in the title, etc.
- *
- * Test bug 424216 by making sure bookmark titles are always shown if one is
- * available. Also bug 425056 makes sure matches aren't found partially in the
- * page title and partially in the bookmark.
- */
-
-add_task(function* test_match_beginning() {
- let uri1 = NetUtil.newURI("http://a.b.c/d-e_f/h/t/p");
- let uri2 = NetUtil.newURI("http://d.e.f/g-h_i/h/t/p");
- let uri3 = NetUtil.newURI("http://g.h.i/j-k_l/h/t/p");
- let uri4 = NetUtil.newURI("http://j.k.l/m-n_o/h/t/p");
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "f(o)o b<a>r" },
- { uri: uri2, title: "b(a)r b<a>z" },
- { uri: uri3, title: "f(o)o b<a>r" },
- { uri: uri4, title: "f(o)o b<a>r" }
- ]);
- yield addBookmark({ uri: uri3, title: "f(o)o b<a>r" });
- yield addBookmark({ uri: uri4, title: "b(a)r b<a>z" });
-
- do_print("Match 2 terms all in url");
- yield check_autocomplete({
- search: "c d",
- matches: [ { uri: uri1, title: "f(o)o b<a>r" } ]
- });
-
- do_print("Match 1 term in url and 1 term in title");
- yield check_autocomplete({
- search: "b e",
- matches: [ { uri: uri1, title: "f(o)o b<a>r" },
- { uri: uri2, title: "b(a)r b<a>z" } ]
- });
-
- do_print("Match 3 terms all in title; display bookmark title if matched");
- yield check_autocomplete({
- search: "b a z",
- matches: [ { uri: uri2, title: "b(a)r b<a>z" },
- { uri: uri4, title: "b(a)r b<a>z", style: [ "bookmark" ] } ]
- });
-
- do_print("Match 2 terms in url and 1 in title; make sure bookmark title is used for search");
- yield check_autocomplete({
- search: "k f t",
- matches: [ { uri: uri3, title: "f(o)o b<a>r", style: [ "bookmark" ] } ]
- });
-
- do_print("Match 3 terms in url and 1 in title");
- yield check_autocomplete({
- search: "d i g z",
- matches: [ { uri: uri2, title: "b(a)r b<a>z" } ]
- });
-
- do_print("Match nothing");
- yield check_autocomplete({
- search: "m o z i",
- matches: [ ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_query_url.js b/toolkit/components/places/tests/unifiedcomplete/test_query_url.js
deleted file mode 100644
index 915ba770e..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_query_url.js
+++ /dev/null
@@ -1,68 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-add_task(function* test_no_slash() {
- do_print("Searching for host match without slash should match host");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://file.org/test/"),
- transition: TRANSITION_TYPED
- }, {
- uri: NetUtil.newURI("file:///c:/test.html"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "file",
- autofilled: "file.org/",
- completed: "file.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_w_slash() {
- do_print("Searching match with slash at the end should do nothing");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://file.org/test/"),
- transition: TRANSITION_TYPED
- }, {
- uri: NetUtil.newURI("file:///c:/test.html"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "file.org/",
- autofilled: "file.org/",
- completed: "file.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_middle() {
- do_print("Searching match with slash in the middle should match url");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://file.org/test/"),
- transition: TRANSITION_TYPED
- }, {
- uri: NetUtil.newURI("file:///c:/test.html"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "file.org/t",
- autofilled: "file.org/test/",
- completed: "http://file.org/test/"
- });
- yield cleanup();
-});
-
-add_task(function* test_nonhost() {
- do_print("Searching for non-host match without slash should not match url");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("file:///c:/test.html"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "file",
- autofilled: "file",
- completed: "file"
- });
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_remote_tab_matches.js b/toolkit/components/places/tests/unifiedcomplete/test_remote_tab_matches.js
deleted file mode 100644
index 56998d4d6..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_remote_tab_matches.js
+++ /dev/null
@@ -1,203 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim:set ts=2 sw=2 sts=2 et:
-*/
-"use strict";
-
-Cu.import("resource://services-sync/main.js");
-
-Services.prefs.setCharPref("services.sync.username", "someone@somewhere.com");
-
-// A mock "Tabs" engine which autocomplete will use instead of the real
-// engine. We pass a constructor that Sync creates.
-function MockTabsEngine() {
- this.clients = null; // We'll set this dynamically
-}
-
-MockTabsEngine.prototype = {
- name: "tabs",
-
- getAllClients() {
- return this.clients;
- },
-}
-
-// A clients engine that doesn't need to be a constructor.
-let MockClientsEngine = {
- isMobile(guid) {
- Assert.ok(guid.endsWith("desktop") || guid.endsWith("mobile"));
- return guid.endsWith("mobile");
- },
-}
-
-// Tell Sync about the mocks.
-Weave.Service.engineManager.register(MockTabsEngine);
-Weave.Service.clientsEngine = MockClientsEngine;
-
-// Tell the Sync XPCOM service it is initialized.
-let weaveXPCService = Cc["@mozilla.org/weave/service;1"]
- .getService(Ci.nsISupports)
- .wrappedJSObject;
-weaveXPCService.ready = true;
-
-// Configure the singleton engine for a test.
-function configureEngine(clients) {
- // Configure the instance Sync created.
- let engine = Weave.Service.engineManager.get("tabs");
- engine.clients = clients;
- // Send an observer that pretends the engine just finished a sync.
- Services.obs.notifyObservers(null, "weave:engine:sync:finish", "tabs");
-}
-
-// Make a match object suitable for passing to check_autocomplete.
-function makeRemoteTabMatch(url, deviceName, extra = {}) {
- return {
- uri: makeActionURI("remotetab", {url, deviceName}),
- title: extra.title || url,
- style: [ "action", "remotetab" ],
- icon: extra.icon,
- }
-}
-
-// The tests.
-add_task(function* test_nomatch() {
- // Nothing matches.
- configureEngine({
- guid_desktop: {
- clientName: "My Desktop",
- tabs: [{
- urlHistory: ["http://foo.com/"],
- }],
- }
- });
-
- // No remote tabs match here, so we only expect search results.
- yield check_autocomplete({
- search: "ex",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("ex", { heuristic: true }) ],
- });
-});
-
-add_task(function* test_minimal() {
- // The minimal client and tabs info we can get away with.
- configureEngine({
- guid_desktop: {
- clientName: "My Desktop",
- tabs: [{
- urlHistory: ["http://example.com/"],
- }],
- }
- });
-
- yield check_autocomplete({
- search: "ex",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("ex", { heuristic: true }),
- makeRemoteTabMatch("http://example.com/", "My Desktop") ],
- });
-});
-
-add_task(function* test_maximal() {
- // Every field that could possibly exist on a remote record.
- configureEngine({
- guid_mobile: {
- clientName: "My Phone",
- tabs: [{
- urlHistory: ["http://example.com/"],
- title: "An Example",
- icon: "http://favicon",
- }],
- }
- });
-
- yield check_autocomplete({
- search: "ex",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("ex", { heuristic: true }),
- makeRemoteTabMatch("http://example.com/", "My Phone",
- { title: "An Example",
- icon: "moz-anno:favicon:http://favicon/"
- }),
- ],
- });
-});
-
-add_task(function* test_noShowIcons() {
- Services.prefs.setBoolPref("services.sync.syncedTabs.showRemoteIcons", false);
- configureEngine({
- guid_mobile: {
- clientName: "My Phone",
- tabs: [{
- urlHistory: ["http://example.com/"],
- title: "An Example",
- icon: "http://favicon",
- }],
- }
- });
-
- yield check_autocomplete({
- search: "ex",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("ex", { heuristic: true }),
- makeRemoteTabMatch("http://example.com/", "My Phone",
- { title: "An Example",
- // expecting the default favicon due to that pref.
- icon: "",
- }),
- ],
- });
- Services.prefs.clearUserPref("services.sync.syncedTabs.showRemoteIcons");
-});
-
-add_task(function* test_matches_title() {
- // URL doesn't match search expression, should still match the title.
- configureEngine({
- guid_mobile: {
- clientName: "My Phone",
- tabs: [{
- urlHistory: ["http://foo.com/"],
- title: "An Example",
- }],
- }
- });
-
- yield check_autocomplete({
- search: "ex",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("ex", { heuristic: true }),
- makeRemoteTabMatch("http://foo.com/", "My Phone",
- { title: "An Example" }),
- ],
- });
-});
-
-add_task(function* test_localtab_matches_override() {
- // We have an open tab to the same page on a remote device, only "switch to
- // tab" should appear as duplicate detection removed the remote one.
-
- // First setup Sync to have the page as a remote tab.
- configureEngine({
- guid_mobile: {
- clientName: "My Phone",
- tabs: [{
- urlHistory: ["http://foo.com/"],
- title: "An Example",
- }],
- }
- });
-
- // Setup Places to think the tab is open locally.
- let uri = NetUtil.newURI("http://foo.com/");
- yield PlacesTestUtils.addVisits([
- { uri: uri, title: "An Example" },
- ]);
- addOpenPages(uri, 1);
-
- yield check_autocomplete({
- search: "ex",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("ex", { heuristic: true }),
- makeSwitchToTabMatch("http://foo.com/", { title: "An Example" }),
- ],
- });
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_search_engine_alias.js b/toolkit/components/places/tests/unifiedcomplete/test_search_engine_alias.js
deleted file mode 100644
index f35242e21..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_search_engine_alias.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-
-add_task(function*() {
- // Note that head_autocomplete.js has already added a MozSearch engine.
- // Here we add another engine with a search alias.
- Services.search.addEngineWithDetails("AliasedGETMozSearch", "", "get", "",
- "GET", "http://s.example.com/search");
- Services.search.addEngineWithDetails("AliasedPOSTMozSearch", "", "post", "",
- "POST", "http://s.example.com/search");
-
- for (let alias of ["get", "post"]) {
- yield check_autocomplete({
- search: alias,
- searchParam: "enable-actions",
- matches: [ makeSearchMatch(alias, { engineName: `Aliased${alias.toUpperCase()}MozSearch`,
- searchQuery: "", alias, heuristic: true }) ]
- });
-
- yield check_autocomplete({
- search: `${alias} `,
- searchParam: "enable-actions",
- matches: [ makeSearchMatch(`${alias} `, { engineName: `Aliased${alias.toUpperCase()}MozSearch`,
- searchQuery: "", alias, heuristic: true }) ]
- });
-
- yield check_autocomplete({
- search: `${alias} mozilla`,
- searchParam: "enable-actions",
- matches: [ makeSearchMatch(`${alias} mozilla`, { engineName: `Aliased${alias.toUpperCase()}MozSearch`,
- searchQuery: "mozilla", alias, heuristic: true }) ]
- });
-
- yield check_autocomplete({
- search: `${alias} MoZiLlA`,
- searchParam: "enable-actions",
- matches: [ makeSearchMatch(`${alias} MoZiLlA`, { engineName: `Aliased${alias.toUpperCase()}MozSearch`,
- searchQuery: "MoZiLlA", alias, heuristic: true }) ]
- });
-
- yield check_autocomplete({
- search: `${alias} mozzarella mozilla`,
- searchParam: "enable-actions",
- matches: [ makeSearchMatch(`${alias} mozzarella mozilla`, { engineName: `Aliased${alias.toUpperCase()}MozSearch`,
- searchQuery: "mozzarella mozilla", alias, heuristic: true }) ]
- });
- }
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js b/toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js
deleted file mode 100644
index b41d9884b..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_search_engine_current.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-
-add_task(function*() {
- // Note that head_autocomplete.js has already added a MozSearch engine.
- // Here we add another engine with a search alias.
- Services.search.addEngineWithDetails("AliasedMozSearch", "", "doit", "",
- "GET", "http://s.example.com/search");
-
- do_print("search engine");
- yield check_autocomplete({
- search: "mozilla",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("mozilla", { heuristic: true }) ]
- });
-
- do_print("search engine, uri-like input");
- yield check_autocomplete({
- search: "http:///",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("http:///", { heuristic: true }) ]
- });
-
- do_print("search engine, multiple words");
- yield check_autocomplete({
- search: "mozzarella cheese",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("mozzarella cheese", { heuristic: true }) ]
- });
-
- do_print("search engine, after current engine has changed");
- Services.search.addEngineWithDetails("MozSearch2", "", "", "", "GET",
- "http://s.example.com/search2");
- engine = Services.search.getEngineByName("MozSearch2");
- notEqual(Services.search.currentEngine, engine, "New engine shouldn't be the current engine yet");
- Services.search.currentEngine = engine;
- yield check_autocomplete({
- search: "mozilla",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("mozilla", { engineName: "MozSearch2", heuristic: true }) ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_search_engine_host.js b/toolkit/components/places/tests/unifiedcomplete/test_search_engine_host.js
deleted file mode 100644
index 61b9826f7..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_search_engine_host.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(function* test_searchEngine_autoFill() {
- Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", true);
- Services.search.addEngineWithDetails("MySearchEngine", "", "", "",
- "GET", "http://my.search.com/");
- let engine = Services.search.getEngineByName("MySearchEngine");
- do_register_cleanup(() => Services.search.removeEngine(engine));
-
- // Add an uri that matches the search string with high frecency.
- let uri = NetUtil.newURI("http://www.example.com/my/");
- let visits = [];
- for (let i = 0; i < 100; ++i) {
- visits.push({ uri, title: "Terms - SearchEngine Search" });
- }
- yield PlacesTestUtils.addVisits(visits);
- yield addBookmark({ uri: uri, title: "Example bookmark" });
- yield PlacesTestUtils.promiseAsyncUpdates();
- ok(frecencyForUrl(uri) > 10000, "Added URI should have expected high frecency");
-
- do_print("Check search domain is autoFilled even if there's an higher frecency match");
- yield check_autocomplete({
- search: "my",
- autofilled: "my.search.com",
- completed: "http://my.search.com"
- });
-
- yield cleanup();
-});
-
-add_task(function* test_searchEngine_noautoFill() {
- let engineName = "engine-rel-searchform.xml";
- let engine = yield addTestEngine(engineName);
- equal(engine.searchForm, "http://example.com/?search");
-
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits(NetUtil.newURI("http://example.com/my/"));
-
- do_print("Check search domain is not autoFilled if it matches a visited domain");
- yield check_autocomplete({
- search: "example",
- autofilled: "example.com/",
- completed: "example.com/"
- });
-
- yield cleanup();
-});
-
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_search_engine_restyle.js b/toolkit/components/places/tests/unifiedcomplete/test_search_engine_restyle.js
deleted file mode 100644
index 2a5f2d78e..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_search_engine_restyle.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-add_task(function* test_searchEngine() {
- Services.search.addEngineWithDetails("SearchEngine", "", "", "",
- "GET", "http://s.example.com/search");
- let engine = Services.search.getEngineByName("SearchEngine");
- engine.addParam("q", "{searchTerms}", null);
- do_register_cleanup(() => Services.search.removeEngine(engine));
-
- let uri1 = NetUtil.newURI("http://s.example.com/search?q=Terms&client=1");
- let uri2 = NetUtil.newURI("http://s.example.com/search?q=Terms&client=2");
- yield PlacesTestUtils.addVisits({ uri: uri1, title: "Terms - SearchEngine Search" });
- yield addBookmark({ uri: uri2, title: "Terms - SearchEngine Search" });
-
- do_print("Past search terms should be styled, unless bookmarked");
- Services.prefs.setBoolPref("browser.urlbar.restyleSearches", true);
- yield check_autocomplete({
- search: "term",
- matches: [
- makeSearchMatch("Terms", {
- engineName: "SearchEngine",
- style: ["favicon"]
- }),
- {
- uri: uri2,
- title: "Terms - SearchEngine Search",
- style: ["bookmark"]
- }
- ]
- });
-
- do_print("Past search terms should not be styled if restyling is disabled");
- Services.prefs.setBoolPref("browser.urlbar.restyleSearches", false);
- yield check_autocomplete({
- search: "term",
- matches: [ { uri: uri1, title: "Terms - SearchEngine Search" },
- { uri: uri2, title: "Terms - SearchEngine Search", style: ["bookmark"] } ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_search_suggestions.js b/toolkit/components/places/tests/unifiedcomplete/test_search_suggestions.js
deleted file mode 100644
index 63b428cd4..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_search_suggestions.js
+++ /dev/null
@@ -1,651 +0,0 @@
-Cu.import("resource://gre/modules/FormHistory.jsm");
-
-const ENGINE_NAME = "engine-suggestions.xml";
-const SERVER_PORT = 9000;
-const SUGGEST_PREF = "browser.urlbar.suggest.searches";
-const SUGGEST_ENABLED_PREF = "browser.search.suggest.enabled";
-const SUGGEST_RESTRICT_TOKEN = "$";
-
-var suggestionsFn;
-var previousSuggestionsFn;
-
-function setSuggestionsFn(fn) {
- previousSuggestionsFn = suggestionsFn;
- suggestionsFn = fn;
-}
-
-function* cleanUpSuggestions() {
- yield cleanup();
- if (previousSuggestionsFn) {
- suggestionsFn = previousSuggestionsFn;
- previousSuggestionsFn = null;
- }
-}
-
-add_task(function* setUp() {
- // Set up a server that provides some suggestions by appending strings onto
- // the search query.
- let server = makeTestServer(SERVER_PORT);
- server.registerPathHandler("/suggest", (req, resp) => {
- // URL query params are x-www-form-urlencoded, which converts spaces into
- // plus signs, so un-convert any plus signs back to spaces.
- let searchStr = decodeURIComponent(req.queryString.replace(/\+/g, " "));
- let suggestions = suggestionsFn(searchStr);
- let data = [searchStr, suggestions];
- resp.setHeader("Content-Type", "application/json", false);
- resp.write(JSON.stringify(data));
- });
- setSuggestionsFn(searchStr => {
- let suffixes = ["foo", "bar"];
- return suffixes.map(s => searchStr + " " + s);
- });
-
- // Install the test engine.
- let oldCurrentEngine = Services.search.currentEngine;
- do_register_cleanup(() => Services.search.currentEngine = oldCurrentEngine);
- let engine = yield addTestEngine(ENGINE_NAME, server);
- Services.search.currentEngine = engine;
-});
-
-add_task(function* disabled_urlbarSuggestions() {
- Services.prefs.setBoolPref(SUGGEST_PREF, false);
- Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, true);
- yield check_autocomplete({
- search: "hello",
- searchParam: "enable-actions",
- matches: [
- makeSearchMatch("hello", { engineName: ENGINE_NAME, heuristic: true }),
- ],
- });
- yield cleanUpSuggestions();
-});
-
-add_task(function* disabled_allSuggestions() {
- Services.prefs.setBoolPref(SUGGEST_PREF, true);
- Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, false);
- yield check_autocomplete({
- search: "hello",
- searchParam: "enable-actions",
- matches: [
- makeSearchMatch("hello", { engineName: ENGINE_NAME, heuristic: true }),
- ],
- });
- yield cleanUpSuggestions();
-});
-
-add_task(function* disabled_privateWindow() {
- Services.prefs.setBoolPref(SUGGEST_PREF, true);
- Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, true);
- yield check_autocomplete({
- search: "hello",
- searchParam: "private-window enable-actions",
- matches: [
- makeSearchMatch("hello", { engineName: ENGINE_NAME, heuristic: true }),
- ],
- });
- yield cleanUpSuggestions();
-});
-
-add_task(function* singleWordQuery() {
- Services.prefs.setBoolPref(SUGGEST_PREF, true);
- Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, true);
-
- yield check_autocomplete({
- search: "hello",
- searchParam: "enable-actions",
- matches: [
- makeSearchMatch("hello", { engineName: ENGINE_NAME, heuristic: true }),
- { uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "hello foo",
- searchQuery: "hello",
- searchSuggestion: "hello foo",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- }, {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "hello bar",
- searchQuery: "hello",
- searchSuggestion: "hello bar",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- }],
- });
-
- yield cleanUpSuggestions();
-});
-
-add_task(function* multiWordQuery() {
- Services.prefs.setBoolPref(SUGGEST_PREF, true);
- Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, true);
-
- yield check_autocomplete({
- search: "hello world",
- searchParam: "enable-actions",
- matches: [
- makeSearchMatch("hello world", { engineName: ENGINE_NAME, heuristic: true }),
- { uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "hello world foo",
- searchQuery: "hello world",
- searchSuggestion: "hello world foo",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- }, {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "hello world bar",
- searchQuery: "hello world",
- searchSuggestion: "hello world bar",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- }],
- });
-
- yield cleanUpSuggestions();
-});
-
-add_task(function* suffixMatch() {
- Services.prefs.setBoolPref(SUGGEST_PREF, true);
- Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, true);
-
- setSuggestionsFn(searchStr => {
- let prefixes = ["baz", "quux"];
- return prefixes.map(p => p + " " + searchStr);
- });
-
- yield check_autocomplete({
- search: "hello",
- searchParam: "enable-actions",
- matches: [
- makeSearchMatch("hello", { engineName: ENGINE_NAME, heuristic: true }),
- { uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "baz hello",
- searchQuery: "hello",
- searchSuggestion: "baz hello",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- }, {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "quux hello",
- searchQuery: "hello",
- searchSuggestion: "quux hello",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- }],
- });
-
- yield cleanUpSuggestions();
-});
-
-add_task(function* queryIsNotASubstring() {
- Services.prefs.setBoolPref(SUGGEST_PREF, true);
-
- setSuggestionsFn(searchStr => {
- return ["aaa", "bbb"];
- });
-
- yield check_autocomplete({
- search: "hello",
- searchParam: "enable-actions",
- matches: [
- makeSearchMatch("hello", { engineName: ENGINE_NAME, heuristic: true }),
- { uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "aaa",
- searchQuery: "hello",
- searchSuggestion: "aaa",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- }, {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "bbb",
- searchQuery: "hello",
- searchSuggestion: "bbb",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- }],
- });
-
- yield cleanUpSuggestions();
-});
-
-add_task(function* restrictToken() {
- Services.prefs.setBoolPref(SUGGEST_PREF, true);
- Services.prefs.setBoolPref(SUGGEST_ENABLED_PREF, true);
-
- // Add a visit and a bookmark. Actually, make the bookmark visited too so
- // that it's guaranteed, with its higher frecency, to appear above the search
- // suggestions.
- yield PlacesTestUtils.addVisits([
- {
- uri: NetUtil.newURI("http://example.com/hello-visit"),
- title: "hello visit",
- },
- {
- uri: NetUtil.newURI("http://example.com/hello-bookmark"),
- title: "hello bookmark",
- },
- ]);
-
- yield addBookmark({
- uri: NetUtil.newURI("http://example.com/hello-bookmark"),
- title: "hello bookmark",
- });
-
- // Do an unrestricted search to make sure everything appears in it, including
- // the visit and bookmark.
- yield check_autocomplete({
- search: "hello",
- searchParam: "enable-actions",
- matches: [
- makeSearchMatch("hello", { engineName: ENGINE_NAME, heuristic: true }),
- {
- uri: NetUtil.newURI("http://example.com/hello-visit"),
- title: "hello visit",
- },
- {
- uri: NetUtil.newURI("http://example.com/hello-bookmark"),
- title: "hello bookmark",
- style: ["bookmark"],
- },
- {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "hello foo",
- searchQuery: "hello",
- searchSuggestion: "hello foo",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- },
- {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "hello bar",
- searchQuery: "hello",
- searchSuggestion: "hello bar",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- },
- ],
- });
-
- // Now do a restricted search to make sure only suggestions appear.
- yield check_autocomplete({
- search: SUGGEST_RESTRICT_TOKEN + " hello",
- searchParam: "enable-actions",
- matches: [
- // TODO (bug 1177895) This is wrong.
- makeSearchMatch(SUGGEST_RESTRICT_TOKEN + " hello", { engineName: ENGINE_NAME, heuristic: true }),
- {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "hello foo",
- searchQuery: "hello",
- searchSuggestion: "hello foo",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- },
- {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "hello bar",
- searchQuery: "hello",
- searchSuggestion: "hello bar",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- }
- ],
- });
-
- yield cleanUpSuggestions();
-});
-
-add_task(function* mixup_frecency() {
- Services.prefs.setBoolPref(SUGGEST_PREF, true);
-
- // Add a visit and a bookmark. Actually, make the bookmark visited too so
- // that it's guaranteed, with its higher frecency, to appear above the search
- // suggestions.
- yield PlacesTestUtils.addVisits([
- { uri: NetUtil.newURI("http://example.com/lo0"),
- title: "low frecency 0" },
- { uri: NetUtil.newURI("http://example.com/lo1"),
- title: "low frecency 1" },
- { uri: NetUtil.newURI("http://example.com/lo2"),
- title: "low frecency 2" },
- { uri: NetUtil.newURI("http://example.com/lo3"),
- title: "low frecency 3" },
- { uri: NetUtil.newURI("http://example.com/lo4"),
- title: "low frecency 4" },
- ]);
-
- for (let i = 0; i < 4; i++) {
- let href = `http://example.com/lo${i}`;
- let frecency = frecencyForUrl(href);
- Assert.ok(frecency < FRECENCY_DEFAULT,
- `frecency for ${href}: ${frecency}, should be lower than ${FRECENCY_DEFAULT}`);
- }
-
- for (let i = 0; i < 5; i++) {
- yield PlacesTestUtils.addVisits([
- { uri: NetUtil.newURI("http://example.com/hi0"),
- title: "high frecency 0",
- transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://example.com/hi1"),
- title: "high frecency 1",
- transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://example.com/hi2"),
- title: "high frecency 2",
- transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://example.com/hi3"),
- title: "high frecency 3",
- transition: TRANSITION_TYPED },
- ]);
- }
-
- for (let i = 0; i < 4; i++) {
- let href = `http://example.com/hi${i}`;
- yield addBookmark({ uri: href, title: `high frecency ${i}` });
- let frecency = frecencyForUrl(href);
- Assert.ok(frecency > FRECENCY_DEFAULT,
- `frecency for ${href}: ${frecency}, should be higher than ${FRECENCY_DEFAULT}`);
- }
-
- // Do an unrestricted search to make sure everything appears in it, including
- // the visit and bookmark.
- yield check_autocomplete({
- checkSorting: true,
- search: "frecency",
- searchParam: "enable-actions",
- matches: [
- makeSearchMatch("frecency", { engineName: ENGINE_NAME, heuristic: true }),
- { uri: NetUtil.newURI("http://example.com/hi3"),
- title: "high frecency 3",
- style: [ "bookmark" ] },
- { uri: NetUtil.newURI("http://example.com/hi2"),
- title: "high frecency 2",
- style: [ "bookmark" ] },
- { uri: NetUtil.newURI("http://example.com/hi1"),
- title: "high frecency 1",
- style: [ "bookmark" ] },
- { uri: NetUtil.newURI("http://example.com/hi0"),
- title: "high frecency 0",
- style: [ "bookmark" ] },
- { uri: NetUtil.newURI("http://example.com/lo4"),
- title: "low frecency 4" },
- {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "frecency foo",
- searchQuery: "frecency",
- searchSuggestion: "frecency foo",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- },
- {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "frecency bar",
- searchQuery: "frecency",
- searchSuggestion: "frecency bar",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- },
- { uri: NetUtil.newURI("http://example.com/lo3"),
- title: "low frecency 3" },
- { uri: NetUtil.newURI("http://example.com/lo2"),
- title: "low frecency 2" },
- { uri: NetUtil.newURI("http://example.com/lo1"),
- title: "low frecency 1" },
- { uri: NetUtil.newURI("http://example.com/lo0"),
- title: "low frecency 0" },
- ],
- });
-
- yield cleanUpSuggestions();
-});
-
-add_task(function* prohibit_suggestions() {
- Services.prefs.setBoolPref(SUGGEST_PREF, true);
-
- yield check_autocomplete({
- search: "localhost",
- searchParam: "enable-actions",
- matches: [
- makeSearchMatch("localhost", { engineName: ENGINE_NAME, heuristic: true }),
- {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "localhost foo",
- searchQuery: "localhost",
- searchSuggestion: "localhost foo",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- },
- {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "localhost bar",
- searchQuery: "localhost",
- searchSuggestion: "localhost bar",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- },
- ],
- });
- Services.prefs.setBoolPref("browser.fixup.domainwhitelist.localhost", true);
- do_register_cleanup(() => {
- Services.prefs.clearUserPref("browser.fixup.domainwhitelist.localhost");
- });
- yield check_autocomplete({
- search: "localhost",
- searchParam: "enable-actions",
- matches: [
- makeVisitMatch("localhost", "http://localhost/", { heuristic: true }),
- makeSearchMatch("localhost", { engineName: ENGINE_NAME, heuristic: false })
- ],
- });
-
- // When using multiple words, we should still get suggestions:
- yield check_autocomplete({
- search: "localhost other",
- searchParam: "enable-actions",
- matches: [
- makeSearchMatch("localhost other", { engineName: ENGINE_NAME, heuristic: true }),
- {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "localhost other foo",
- searchQuery: "localhost other",
- searchSuggestion: "localhost other foo",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- },
- {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "localhost other bar",
- searchQuery: "localhost other",
- searchSuggestion: "localhost other bar",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- },
- ],
- });
-
- // Clear the whitelist for localhost, and try preferring DNS for any single
- // word instead:
- Services.prefs.clearUserPref("browser.fixup.domainwhitelist.localhost");
- Services.prefs.setBoolPref("browser.fixup.dns_first_for_single_words", true);
- do_register_cleanup(() => {
- Services.prefs.clearUserPref("browser.fixup.dns_first_for_single_words");
- });
-
- yield check_autocomplete({
- search: "localhost",
- searchParam: "enable-actions",
- matches: [
- makeVisitMatch("localhost", "http://localhost/", { heuristic: true }),
- makeSearchMatch("localhost", { engineName: ENGINE_NAME, heuristic: false })
- ],
- });
-
- yield check_autocomplete({
- search: "somethingelse",
- searchParam: "enable-actions",
- matches: [
- makeVisitMatch("somethingelse", "http://somethingelse/", { heuristic: true }),
- makeSearchMatch("somethingelse", { engineName: ENGINE_NAME, heuristic: false })
- ],
- });
-
- // When using multiple words, we should still get suggestions:
- yield check_autocomplete({
- search: "localhost other",
- searchParam: "enable-actions",
- matches: [
- makeSearchMatch("localhost other", { engineName: ENGINE_NAME, heuristic: true }),
- {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "localhost other foo",
- searchQuery: "localhost other",
- searchSuggestion: "localhost other foo",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- },
- {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "localhost other bar",
- searchQuery: "localhost other",
- searchSuggestion: "localhost other bar",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- },
- ],
- });
-
- Services.prefs.clearUserPref("browser.fixup.dns_first_for_single_words");
-
- yield check_autocomplete({
- search: "1.2.3.4",
- searchParam: "enable-actions",
- matches: [
- makeVisitMatch("1.2.3.4", "http://1.2.3.4/", { heuristic: true }),
- ],
- });
- yield check_autocomplete({
- search: "[2001::1]:30",
- searchParam: "enable-actions",
- matches: [
- makeVisitMatch("[2001::1]:30", "http://[2001::1]:30/", { heuristic: true }),
- ],
- });
- yield check_autocomplete({
- search: "user:pass@test",
- searchParam: "enable-actions",
- matches: [
- makeVisitMatch("user:pass@test", "http://user:pass@test/", { heuristic: true }),
- ],
- });
- yield check_autocomplete({
- search: "test/test",
- searchParam: "enable-actions",
- matches: [
- makeVisitMatch("test/test", "http://test/test", { heuristic: true }),
- ],
- });
- yield check_autocomplete({
- search: "data:text/plain,Content",
- searchParam: "enable-actions",
- matches: [
- makeVisitMatch("data:text/plain,Content", "data:text/plain,Content", { heuristic: true }),
- ],
- });
-
- yield check_autocomplete({
- search: "a",
- searchParam: "enable-actions",
- matches: [
- makeSearchMatch("a", { engineName: ENGINE_NAME, heuristic: true }),
- ],
- });
-
- yield cleanUpSuggestions();
-});
-
-add_task(function* avoid_url_suggestions() {
- Services.prefs.setBoolPref(SUGGEST_PREF, true);
-
- setSuggestionsFn(searchStr => {
- let suffixes = [".com", "/test", ":1]", "@test", ". com"];
- return suffixes.map(s => searchStr + s);
- });
-
- yield check_autocomplete({
- search: "test",
- searchParam: "enable-actions",
- matches: [
- makeSearchMatch("test", { engineName: ENGINE_NAME, heuristic: true }),
- {
- uri: makeActionURI(("searchengine"), {
- engineName: ENGINE_NAME,
- input: "test. com",
- searchQuery: "test",
- searchSuggestion: "test. com",
- }),
- title: ENGINE_NAME,
- style: ["action", "searchengine"],
- icon: "",
- },
- ],
- });
-
- yield cleanUpSuggestions();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_special_search.js b/toolkit/components/places/tests/unifiedcomplete/test_special_search.js
deleted file mode 100644
index 21df7046c..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_special_search.js
+++ /dev/null
@@ -1,447 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test for bug 395161 that allows special searches that restrict results to
- * history/bookmark/tagged items and title/url matches.
- *
- * Test 485122 by making sure results don't have tags when restricting result
- * to just history either by default behavior or dynamic query restrict.
- */
-
-function setSuggestPrefsToFalse() {
- Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
- Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", false);
- Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
-}
-
-add_task(function* test_special_searches() {
- let uri1 = NetUtil.newURI("http://url/");
- let uri2 = NetUtil.newURI("http://url/2");
- let uri3 = NetUtil.newURI("http://foo.bar/");
- let uri4 = NetUtil.newURI("http://foo.bar/2");
- let uri5 = NetUtil.newURI("http://url/star");
- let uri6 = NetUtil.newURI("http://url/star/2");
- let uri7 = NetUtil.newURI("http://foo.bar/star");
- let uri8 = NetUtil.newURI("http://foo.bar/star/2");
- let uri9 = NetUtil.newURI("http://url/tag");
- let uri10 = NetUtil.newURI("http://url/tag/2");
- let uri11 = NetUtil.newURI("http://foo.bar/tag");
- let uri12 = NetUtil.newURI("http://foo.bar/tag/2");
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "title", transition: TRANSITION_TYPED },
- { uri: uri2, title: "foo.bar" },
- { uri: uri3, title: "title" },
- { uri: uri4, title: "foo.bar", transition: TRANSITION_TYPED },
- { uri: uri6, title: "foo.bar" },
- { uri: uri11, title: "title", transition: TRANSITION_TYPED }
- ]);
- yield addBookmark( { uri: uri5, title: "title" } );
- yield addBookmark( { uri: uri6, title: "foo.bar" } );
- yield addBookmark( { uri: uri7, title: "title" } );
- yield addBookmark( { uri: uri8, title: "foo.bar" } );
- yield addBookmark( { uri: uri9, title: "title", tags: [ "foo.bar" ] } );
- yield addBookmark( { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ] } );
- yield addBookmark( { uri: uri11, title: "title", tags: [ "foo.bar" ] } );
- yield addBookmark( { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ] } );
-
- // Test restricting searches
- do_print("History restrict");
- yield check_autocomplete({
- search: "^",
- matches: [ { uri: uri1, title: "title" },
- { uri: uri2, title: "foo.bar" },
- { uri: uri3, title: "title" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri6, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("Star restrict");
- yield check_autocomplete({
- search: "*",
- matches: [ { uri: uri5, title: "title", style: [ "bookmark" ] },
- { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri7, title: "title", style: [ "bookmark" ] },
- { uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar"], style: [ "bookmark-tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("Tag restrict");
- yield check_autocomplete({
- search: "+",
- matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- // Test specials as any word position
- do_print("Special as first word");
- yield check_autocomplete({
- search: "^ foo bar",
- matches: [ { uri: uri2, title: "foo.bar" },
- { uri: uri3, title: "title" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri6, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("Special as middle word");
- yield check_autocomplete({
- search: "foo ^ bar",
- matches: [ { uri: uri2, title: "foo.bar" },
- { uri: uri3, title: "title" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri6, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("Special as last word");
- yield check_autocomplete({
- search: "foo bar ^",
- matches: [ { uri: uri2, title: "foo.bar" },
- { uri: uri3, title: "title" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri6, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- // Test restricting and matching searches with a term
- do_print("foo ^ -> history");
- yield check_autocomplete({
- search: "foo ^",
- matches: [ { uri: uri2, title: "foo.bar" },
- { uri: uri3, title: "title" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri6, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo | -> history (change pref)");
- changeRestrict("history", "|");
- yield check_autocomplete({
- search: "foo |",
- matches: [ { uri: uri2, title: "foo.bar" },
- { uri: uri3, title: "title" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri6, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo * -> is star");
- resetRestrict("history");
- yield check_autocomplete({
- search: "foo *",
- matches: [ { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri7, title: "title", style: [ "bookmark" ] },
- { uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("foo | -> is star (change pref)");
- changeRestrict("bookmark", "|");
- yield check_autocomplete({
- search: "foo |",
- matches: [ { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri7, title: "title", style: [ "bookmark" ] },
- { uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("foo # -> in title");
- resetRestrict("bookmark");
- yield check_autocomplete({
- search: "foo #",
- matches: [ { uri: uri2, title: "foo.bar" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo | -> in title (change pref)");
- changeRestrict("title", "|");
- yield check_autocomplete({
- search: "foo |",
- matches: [ { uri: uri2, title: "foo.bar" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo @ -> in url");
- resetRestrict("title");
- yield check_autocomplete({
- search: "foo @",
- matches: [ { uri: uri3, title: "title" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri7, title: "title", style: [ "bookmark" ] },
- { uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo | -> in url (change pref)");
- changeRestrict("url", "|");
- yield check_autocomplete({
- search: "foo |",
- matches: [ { uri: uri3, title: "title" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri7, title: "title", style: [ "bookmark" ] },
- { uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo + -> is tag");
- resetRestrict("url");
- yield check_autocomplete({
- search: "foo +",
- matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo | -> is tag (change pref)");
- changeRestrict("tag", "|");
- yield check_autocomplete({
- search: "foo |",
- matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo ~ -> is typed");
- resetRestrict("tag");
- yield check_autocomplete({
- search: "foo ~",
- matches: [ { uri: uri4, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo | -> is typed (change pref)");
- changeRestrict("typed", "|");
- yield check_autocomplete({
- search: "foo |",
- matches: [ { uri: uri4, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- // Test various pairs of special searches
- do_print("foo ^ * -> history, is star");
- resetRestrict("typed");
- yield check_autocomplete({
- search: "foo ^ *",
- matches: [ { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("foo ^ # -> history, in title");
- yield check_autocomplete({
- search: "foo ^ #",
- matches: [ { uri: uri2, title: "foo.bar" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri6, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo ^ @ -> history, in url");
- yield check_autocomplete({
- search: "foo ^ @",
- matches: [ { uri: uri3, title: "title" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo ^ + -> history, is tag");
- yield check_autocomplete({
- search: "foo ^ +",
- matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo ^ ~ -> history, is typed");
- yield check_autocomplete({
- search: "foo ^ ~",
- matches: [ { uri: uri4, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo * # -> is star, in title");
- yield check_autocomplete({
- search: "foo * #",
- matches: [ { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("foo * @ -> is star, in url");
- yield check_autocomplete({
- search: "foo * @",
- matches: [ { uri: uri7, title: "title", style: [ "bookmark" ] },
- { uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("foo * + -> same as +");
- yield check_autocomplete({
- search: "foo * +",
- matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("foo * ~ -> is star, is typed");
- yield check_autocomplete({
- search: "foo * ~",
- matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("foo # @ -> in title, in url");
- yield check_autocomplete({
- search: "foo # @",
- matches: [ { uri: uri4, title: "foo.bar" },
- { uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo # + -> in title, is tag");
- yield check_autocomplete({
- search: "foo # +",
- matches: [ { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo # ~ -> in title, is typed");
- yield check_autocomplete({
- search: "foo # ~",
- matches: [ { uri: uri4, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo @ + -> in url, is tag");
- yield check_autocomplete({
- search: "foo @ +",
- matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo @ ~ -> in url, is typed");
- yield check_autocomplete({
- search: "foo @ ~",
- matches: [ { uri: uri4, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- do_print("foo + ~ -> is tag, is typed");
- yield check_autocomplete({
- search: "foo + ~",
- matches: [ { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "tag" ] } ]
- });
-
- // Disable autoFill for the next tests, see test_autoFill_default_behavior.js
- // for specific tests.
- Services.prefs.setBoolPref("browser.urlbar.autoFill", false);
-
- // Test default usage by setting certain browser.urlbar.suggest.* prefs
- do_print("foo -> default history");
- setSuggestPrefsToFalse();
- Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
- yield check_autocomplete({
- search: "foo",
- matches: [ { uri: uri2, title: "foo.bar" },
- { uri: uri3, title: "title" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri6, title: "foo.bar" },
- { uri: uri11, title: "title", tags: ["foo.bar"], style: [ "tag" ] } ]
- });
-
- do_print("foo -> default history, is star");
- setSuggestPrefsToFalse();
- Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
- Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
- yield check_autocomplete({
- search: "foo",
- matches: [ { uri: uri2, title: "foo.bar" },
- { uri: uri3, title: "title" },
- { uri: uri4, title: "foo.bar" },
- { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri7, title: "title", style: [ "bookmark" ] },
- { uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar"], style: [ "bookmark-tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("foo -> default history, is star, is typed");
- setSuggestPrefsToFalse();
- Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
- Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);
- Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
- yield check_autocomplete({
- search: "foo",
- matches: [ { uri: uri4, title: "foo.bar" },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("foo -> is star");
- setSuggestPrefsToFalse();
- Services.prefs.setBoolPref("browser.urlbar.suggest.history", false);
- Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
- yield check_autocomplete({
- search: "foo",
- matches: [ { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri7, title: "title", style: [ "bookmark" ] },
- { uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("foo -> is star, is typed");
- setSuggestPrefsToFalse();
- // only typed should be ignored
- Services.prefs.setBoolPref("browser.urlbar.suggest.history.onlyTyped", true);
- Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
- yield check_autocomplete({
- search: "foo",
- matches: [ { uri: uri6, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri7, title: "title", style: [ "bookmark" ] },
- { uri: uri8, title: "foo.bar", style: [ "bookmark" ] },
- { uri: uri9, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri10, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri11, title: "title", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] },
- { uri: uri12, title: "foo.bar", tags: [ "foo.bar" ], style: [ "bookmark-tag" ] } ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_swap_protocol.js b/toolkit/components/places/tests/unifiedcomplete/test_swap_protocol.js
deleted file mode 100644
index 89ccc3206..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_swap_protocol.js
+++ /dev/null
@@ -1,153 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test bug 424717 to make sure searching with an existing location like
- * http://site/ also matches https://site/ or ftp://site/. Same thing for
- * ftp://site/ and https://site/.
- *
- * Test bug 461483 to make sure a search for "w" doesn't match the "www." from
- * site subdomains.
- */
-
-add_task(function* test_swap_protocol() {
- let uri1 = NetUtil.newURI("http://www.site/");
- let uri2 = NetUtil.newURI("http://site/");
- let uri3 = NetUtil.newURI("ftp://ftp.site/");
- let uri4 = NetUtil.newURI("ftp://site/");
- let uri5 = NetUtil.newURI("https://www.site/");
- let uri6 = NetUtil.newURI("https://site/");
- let uri7 = NetUtil.newURI("http://woohoo/");
- let uri8 = NetUtil.newURI("http://wwwwwwacko/");
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "title" },
- { uri: uri2, title: "title" },
- { uri: uri3, title: "title" },
- { uri: uri4, title: "title" },
- { uri: uri5, title: "title" },
- { uri: uri6, title: "title" },
- { uri: uri7, title: "title" },
- { uri: uri8, title: "title" }
- ]);
-
- let allMatches = [
- { uri: uri1, title: "title" },
- { uri: uri2, title: "title" },
- { uri: uri3, title: "title" },
- { uri: uri4, title: "title" },
- { uri: uri5, title: "title" },
- { uri: uri6, title: "title" }
- ];
-
- // Disable autoFill to avoid handling the first result.
- Services.prefs.setBoolPref("browser.urlbar.autoFill", "false");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", false);
-
- do_print("http://www.site matches all site");
- yield check_autocomplete({
- search: "http://www.site",
- matches: allMatches
- });
-
- do_print("http://site matches all site");
- yield check_autocomplete({
- search: "http://site",
- matches: allMatches
- });
-
- do_print("ftp://ftp.site matches itself");
- yield check_autocomplete({
- search: "ftp://ftp.site",
- matches: [ { uri: uri3, title: "title" } ]
- });
-
- do_print("ftp://site matches all site");
- yield check_autocomplete({
- search: "ftp://site",
- matches: allMatches
- });
-
- do_print("https://www.site matches all site");
- yield check_autocomplete({
- search: "https://www.site",
- matches: allMatches
- });
-
- do_print("https://site matches all site");
- yield check_autocomplete({
- search: "https://site",
- matches: allMatches
- });
-
- do_print("www.site matches all site");
- yield check_autocomplete({
- search: "www.site",
- matches: allMatches
- });
-
- do_print("w matches none of www.");
- yield check_autocomplete({
- search: "w",
- matches: [ { uri: uri7, title: "title" },
- { uri: uri8, title: "title" } ]
- });
-
- do_print("http://w matches none of www.");
- yield check_autocomplete({
- search: "http://w",
- matches: [ { uri: uri7, title: "title" },
- { uri: uri8, title: "title" } ]
- });
-
- do_print("http://w matches none of www.");
- yield check_autocomplete({
- search: "http://www.w",
- matches: [ { uri: uri7, title: "title" },
- { uri: uri8, title: "title" } ]
- });
-
- do_print("ww matches none of www.");
- yield check_autocomplete({
- search: "ww",
- matches: [ { uri: uri8, title: "title" } ]
- });
-
- do_print("ww matches none of www.");
- yield check_autocomplete({
- search: "ww",
- matches: [ { uri: uri8, title: "title" } ]
- });
-
- do_print("http://ww matches none of www.");
- yield check_autocomplete({
- search: "http://ww",
- matches: [ { uri: uri8, title: "title" } ]
- });
-
- do_print("http://www.ww matches none of www.");
- yield check_autocomplete({
- search: "http://www.ww",
- matches: [ { uri: uri8, title: "title" } ]
- });
-
- do_print("www matches none of www.");
- yield check_autocomplete({
- search: "www",
- matches: [ { uri: uri8, title: "title" } ]
- });
-
- do_print("http://www matches none of www.");
- yield check_autocomplete({
- search: "http://www",
- matches: [ { uri: uri8, title: "title" } ]
- });
-
- do_print("http://www.www matches none of www.");
- yield check_autocomplete({
- search: "http://www.www",
- matches: [ { uri: uri8, title: "title" } ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_tab_matches.js b/toolkit/components/places/tests/unifiedcomplete/test_tab_matches.js
deleted file mode 100644
index 646519c32..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_tab_matches.js
+++ /dev/null
@@ -1,125 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim:set ts=2 sw=2 sts=2 et:
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var gTabRestrictChar = "%";
-
-add_task(function* test_tab_matches() {
- let uri1 = NetUtil.newURI("http://abc.com/");
- let uri2 = NetUtil.newURI("http://xyz.net/");
- let uri3 = NetUtil.newURI("about:mozilla");
- let uri4 = NetUtil.newURI("data:text/html,test");
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "ABC rocks" },
- { uri: uri2, title: "xyz.net - we're better than ABC" }
- ]);
- addOpenPages(uri1, 1);
- // Pages that cannot be registered in history.
- addOpenPages(uri3, 1);
- addOpenPages(uri4, 1);
-
- do_print("two results, normal result is a tab match");
- yield check_autocomplete({
- search: "abc.com",
- searchParam: "enable-actions",
- matches: [ makeVisitMatch("abc.com", "http://abc.com/", { heuristic: true }),
- makeSwitchToTabMatch("http://abc.com/", { title: "ABC rocks" }),
- makeSearchMatch("abc.com", { heuristic: false }) ]
- });
-
- do_print("three results, one tab match");
- yield check_autocomplete({
- search: "abc",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("abc", { heuristic: true }),
- makeSwitchToTabMatch("http://abc.com/", { title: "ABC rocks" }),
- { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
- });
-
- do_print("three results, both normal results are tab matches");
- addOpenPages(uri2, 1);
- yield check_autocomplete({
- search: "abc",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("abc", { heuristic: true }),
- makeSwitchToTabMatch("http://abc.com/", { title: "ABC rocks" }),
- makeSwitchToTabMatch("http://xyz.net/", { title: "xyz.net - we're better than ABC" }) ]
- });
-
- do_print("three results, both normal results are tab matches, one has multiple tabs");
- addOpenPages(uri2, 5);
- yield check_autocomplete({
- search: "abc",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("abc", { heuristic: true }),
- makeSwitchToTabMatch("http://abc.com/", { title: "ABC rocks" }),
- makeSwitchToTabMatch("http://xyz.net/", { title: "xyz.net - we're better than ABC" }) ]
- });
-
- do_print("three results, no tab matches (disable-private-actions)");
- yield check_autocomplete({
- search: "abc",
- searchParam: "enable-actions disable-private-actions",
- matches: [ makeSearchMatch("abc", { heuristic: true }),
- { uri: uri1, title: "ABC rocks", style: [ "favicon" ] },
- { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
- });
-
- do_print("two results (actions disabled)");
- yield check_autocomplete({
- search: "abc",
- searchParam: "",
- matches: [ { uri: uri1, title: "ABC rocks", style: [ "favicon" ] },
- { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
- });
-
- do_print("three results, no tab matches");
- removeOpenPages(uri1, 1);
- removeOpenPages(uri2, 6);
- yield check_autocomplete({
- search: "abc",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("abc", { heuristic: true }),
- { uri: uri1, title: "ABC rocks", style: [ "favicon" ] },
- { uri: uri2, title: "xyz.net - we're better than ABC", style: [ "favicon" ] } ]
- });
-
- do_print("tab match search with restriction character");
- addOpenPages(uri1, 1);
- yield check_autocomplete({
- search: gTabRestrictChar + " abc",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch(gTabRestrictChar + " abc", { heuristic: true }),
- makeSwitchToTabMatch("http://abc.com/", { title: "ABC rocks" }) ]
- });
-
- do_print("tab match with not-addable pages");
- yield check_autocomplete({
- search: "mozilla",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("mozilla", { heuristic: true }),
- makeSwitchToTabMatch("about:mozilla") ]
- });
-
- do_print("tab match with not-addable pages and restriction character");
- yield check_autocomplete({
- search: gTabRestrictChar + " mozilla",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch(gTabRestrictChar + " mozilla", { heuristic: true }),
- makeSwitchToTabMatch("about:mozilla") ]
- });
-
- do_print("tab match with not-addable pages and only restriction character");
- yield check_autocomplete({
- search: gTabRestrictChar,
- searchParam: "enable-actions",
- matches: [ makeSearchMatch(gTabRestrictChar, { heuristic: true }),
- makeSwitchToTabMatch("http://abc.com/", { title: "ABC rocks" }),
- makeSwitchToTabMatch("about:mozilla"),
- makeSwitchToTabMatch("data:text/html,test") ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_trimming.js b/toolkit/components/places/tests/unifiedcomplete/test_trimming.js
deleted file mode 100644
index e55b009ff..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_trimming.js
+++ /dev/null
@@ -1,313 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-add_task(function* test_untrimmed_secure_www() {
- do_print("Searching for untrimmed https://www entry");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("https://www.mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mo",
- autofilled: "mozilla.org/",
- completed: "https://www.mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untrimmed_secure_www_path() {
- do_print("Searching for untrimmed https://www entry with path");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("https://www.mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mozilla.org/t",
- autofilled: "mozilla.org/test/",
- completed: "https://www.mozilla.org/test/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untrimmed_secure() {
- do_print("Searching for untrimmed https:// entry");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("https://mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mo",
- autofilled: "mozilla.org/",
- completed: "https://mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untrimmed_secure_path() {
- do_print("Searching for untrimmed https:// entry with path");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("https://mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mozilla.org/t",
- autofilled: "mozilla.org/test/",
- completed: "https://mozilla.org/test/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untrimmed_www() {
- do_print("Searching for untrimmed http://www entry");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://www.mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mo",
- autofilled: "mozilla.org/",
- completed: "www.mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untrimmed_www_path() {
- do_print("Searching for untrimmed http://www entry with path");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://www.mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mozilla.org/t",
- autofilled: "mozilla.org/test/",
- completed: "http://www.mozilla.org/test/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untrimmed_ftp() {
- do_print("Searching for untrimmed ftp:// entry");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("ftp://mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mo",
- autofilled: "mozilla.org/",
- completed: "ftp://mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untrimmed_ftp_path() {
- do_print("Searching for untrimmed ftp:// entry with path");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("ftp://mozilla.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "mozilla.org/t",
- autofilled: "mozilla.org/test/",
- completed: "ftp://mozilla.org/test/"
- });
- yield cleanup();
-});
-
-add_task(function* test_priority_1() {
- do_print("Ensuring correct priority 1");
- yield PlacesTestUtils.addVisits([
- { uri: NetUtil.newURI("https://www.mozilla.org/test/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("https://mozilla.org/test/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("ftp://mozilla.org/test/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://www.mozilla.org/test/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://mozilla.org/test/"), transition: TRANSITION_TYPED }
- ]);
- yield check_autocomplete({
- search: "mo",
- autofilled: "mozilla.org/",
- completed: "mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_periority_2() {
- do_print( "Ensuring correct priority 2");
- yield PlacesTestUtils.addVisits([
- { uri: NetUtil.newURI("https://mozilla.org/test/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("ftp://mozilla.org/test/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://www.mozilla.org/test/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://mozilla.org/test/"), transition: TRANSITION_TYPED }
- ]);
- yield check_autocomplete({
- search: "mo",
- autofilled: "mozilla.org/",
- completed: "mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_periority_3() {
- do_print("Ensuring correct priority 3");
- yield PlacesTestUtils.addVisits([
- { uri: NetUtil.newURI("ftp://mozilla.org/test/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://www.mozilla.org/test/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://mozilla.org/test/"), transition: TRANSITION_TYPED }
- ]);
- yield check_autocomplete({
- search: "mo",
- autofilled: "mozilla.org/",
- completed: "mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_periority_4() {
- do_print("Ensuring correct priority 4");
- yield PlacesTestUtils.addVisits([
- { uri: NetUtil.newURI("http://www.mozilla.org/test/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://mozilla.org/test/"), transition: TRANSITION_TYPED }
- ]);
- yield check_autocomplete({
- search: "mo",
- autofilled: "mozilla.org/",
- completed: "mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_priority_5() {
- do_print("Ensuring correct priority 5");
- yield PlacesTestUtils.addVisits([
- { uri: NetUtil.newURI("ftp://mozilla.org/test/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("ftp://www.mozilla.org/test/"), transition: TRANSITION_TYPED }
- ]);
- yield check_autocomplete({
- search: "mo",
- autofilled: "mozilla.org/",
- completed: "ftp://mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_priority_6() {
- do_print("Ensuring correct priority 6");
- yield PlacesTestUtils.addVisits([
- { uri: NetUtil.newURI("http://www.mozilla.org/test1/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://www.mozilla.org/test2/"), transition: TRANSITION_TYPED }
- ]);
- yield check_autocomplete({
- search: "mo",
- autofilled: "mozilla.org/",
- completed: "www.mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_longer_domain() {
- do_print("Ensuring longer domain can't match");
- // The .co should be preferred, but should not get the https from the .com.
- // The .co domain must be added later to activate the trigger bug.
- yield PlacesTestUtils.addVisits([
- { uri: NetUtil.newURI("https://mozilla.com/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://mozilla.co/"), transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://mozilla.co/"), transition: TRANSITION_TYPED }
- ]);
- yield check_autocomplete({
- search: "mo",
- autofilled: "mozilla.co/",
- completed: "mozilla.co/"
- });
-
- yield cleanup();
-});
-
-add_task(function* test_escaped_chars() {
- do_print("Searching for URL with characters that are normally escaped");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("https://www.mozilla.org/å•Š-test"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "https://www.mozilla.org/å•Š-test",
- autofilled: "https://www.mozilla.org/å•Š-test",
- completed: "https://www.mozilla.org/å•Š-test"
- });
- yield cleanup();
-});
-
-add_task(function* test_unsecure_secure() {
- do_print("Don't return unsecure URL when searching for secure ones");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://test.moz.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "https://test.moz.org/t",
- autofilled: "https://test.moz.org/test/",
- completed: "https://test.moz.org/test/"
- });
- yield cleanup();
-});
-
-add_task(function* test_unsecure_secure_domain() {
- do_print("Don't return unsecure domain when searching for secure ones");
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://test.moz.org/test/"),
- transition: TRANSITION_TYPED
- });
- yield check_autocomplete({
- search: "https://test.moz",
- autofilled: "https://test.moz.org/",
- completed: "https://test.moz.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untyped_www() {
- do_print("Untyped is not accounted for www");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits({ uri: NetUtil.newURI("http://www.moz.org/test/") });
- yield check_autocomplete({
- search: "mo",
- autofilled: "moz.org/",
- completed: "moz.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untyped_ftp() {
- do_print("Untyped is not accounted for ftp");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits({ uri: NetUtil.newURI("ftp://moz.org/test/") });
- yield check_autocomplete({
- search: "mo",
- autofilled: "moz.org/",
- completed: "moz.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untyped_secure() {
- do_print("Untyped is not accounted for https");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits({ uri: NetUtil.newURI("https://moz.org/test/") });
- yield check_autocomplete({
- search: "mo",
- autofilled: "moz.org/",
- completed: "moz.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untyped_secure_www() {
- do_print("Untyped is not accounted for https://www");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits({ uri: NetUtil.newURI("https://www.moz.org/test/") });
- yield check_autocomplete({
- search: "mo",
- autofilled: "moz.org/",
- completed: "moz.org/"
- });
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_typed.js b/toolkit/components/places/tests/unifiedcomplete/test_typed.js
deleted file mode 100644
index 72f76159c..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_typed.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// First do searches with typed behavior forced to false, so later tests will
-// ensure autocomplete is able to dinamically switch behavior.
-
-const FAVICON_HREF = NetUtil.newURI(do_get_file("../favicons/favicon-normal16.png")).spec;
-
-add_task(function* test_domain() {
- do_print("Searching for domain should autoFill it");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits(NetUtil.newURI("http://mozilla.org/link/"));
- yield setFaviconForHref("http://mozilla.org/link/", FAVICON_HREF);
- yield check_autocomplete({
- search: "moz",
- autofilled: "mozilla.org/",
- completed: "mozilla.org/",
- icon: "moz-anno:favicon:" + FAVICON_HREF
- });
- yield cleanup();
-});
-
-add_task(function* test_url() {
- do_print("Searching for url should autoFill it");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits(NetUtil.newURI("http://mozilla.org/link/"));
- yield setFaviconForHref("http://mozilla.org/link/", FAVICON_HREF);
- yield check_autocomplete({
- search: "mozilla.org/li",
- autofilled: "mozilla.org/link/",
- completed: "http://mozilla.org/link/",
- icon: "moz-anno:favicon:" + FAVICON_HREF
- });
- yield cleanup();
-});
-
-// Now do searches with typed behavior forced to true.
-
-add_task(function* test_untyped_domain() {
- do_print("Searching for non-typed domain should not autoFill it");
- yield PlacesTestUtils.addVisits(NetUtil.newURI("http://mozilla.org/link/"));
- yield check_autocomplete({
- search: "moz",
- autofilled: "moz",
- completed: "moz"
- });
- yield cleanup();
-});
-
-add_task(function* test_typed_domain() {
- do_print("Searching for typed domain should autoFill it");
- yield PlacesTestUtils.addVisits({ uri: NetUtil.newURI("http://mozilla.org/typed/"),
- transition: TRANSITION_TYPED });
- yield check_autocomplete({
- search: "moz",
- autofilled: "mozilla.org/",
- completed: "mozilla.org/"
- });
- yield cleanup();
-});
-
-add_task(function* test_untyped_url() {
- do_print("Searching for non-typed url should not autoFill it");
- yield PlacesTestUtils.addVisits(NetUtil.newURI("http://mozilla.org/link/"));
- yield check_autocomplete({
- search: "mozilla.org/li",
- autofilled: "mozilla.org/li",
- completed: "mozilla.org/li"
- });
- yield cleanup();
-});
-
-add_task(function* test_typed_url() {
- do_print("Searching for typed url should autoFill it");
- yield PlacesTestUtils.addVisits({ uri: NetUtil.newURI("http://mozilla.org/link/"),
- transition: TRANSITION_TYPED });
- yield check_autocomplete({
- search: "mozilla.org/li",
- autofilled: "mozilla.org/link/",
- completed: "http://mozilla.org/link/"
- });
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_visit_url.js b/toolkit/components/places/tests/unifiedcomplete/test_visit_url.js
deleted file mode 100644
index eaccb23e5..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_visit_url.js
+++ /dev/null
@@ -1,186 +0,0 @@
-add_task(function*() {
- do_print("visit url, no protocol");
- yield check_autocomplete({
- search: "mozilla.org",
- searchParam: "enable-actions",
- matches: [
- { uri: makeActionURI("visiturl", {url: "http://mozilla.org/", input: "mozilla.org"}), title: "http://mozilla.org/", style: [ "action", "visiturl", "heuristic" ] },
- { uri: makeActionURI("searchengine", {engineName: "MozSearch", input: "mozilla.org", searchQuery: "mozilla.org"}), title: "MozSearch", style: ["action", "searchengine"] }
- ]
- });
-
- do_print("visit url, no protocol but with 2 dots");
- yield check_autocomplete({
- search: "www.mozilla.org",
- searchParam: "enable-actions",
- matches: [
- { uri: makeActionURI("visiturl", {url: "http://www.mozilla.org/", input: "www.mozilla.org"}), title: "http://www.mozilla.org/", style: [ "action", "visiturl", "heuristic" ] },
- { uri: makeActionURI("searchengine", {engineName: "MozSearch", input: "www.mozilla.org", searchQuery: "www.mozilla.org"}), title: "MozSearch", style: ["action", "searchengine"] }
- ]
- });
-
- do_print("visit url, no protocol but with 3 dots");
- yield check_autocomplete({
- search: "www.mozilla.org.tw",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("visiturl", {url: "http://www.mozilla.org.tw/", input: "www.mozilla.org.tw"}), title: "http://www.mozilla.org.tw/", style: [ "action", "visiturl", "heuristic" ] } ]
- });
-
- do_print("visit url, with protocol but with 2 dots");
- yield check_autocomplete({
- search: "https://www.mozilla.org",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("visiturl", {url: "https://www.mozilla.org/", input: "https://www.mozilla.org"}), title: "https://www.mozilla.org/", style: [ "action", "visiturl", "heuristic" ] } ]
- });
-
- do_print("visit url, with protocol but with 3 dots");
- yield check_autocomplete({
- search: "https://www.mozilla.org.tw",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("visiturl", {url: "https://www.mozilla.org.tw/", input: "https://www.mozilla.org.tw"}), title: "https://www.mozilla.org.tw/", style: [ "action", "visiturl", "heuristic" ] } ]
- });
-
- do_print("visit url, with protocol");
- yield check_autocomplete({
- search: "https://mozilla.org",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("visiturl", {url: "https://mozilla.org/", input: "https://mozilla.org"}), title: "https://mozilla.org/", style: [ "action", "visiturl", "heuristic" ] } ]
- });
-
- do_print("visit url, about: protocol (no host)");
- yield check_autocomplete({
- search: "about:config",
- searchParam: "enable-actions",
- matches: [ { uri: makeActionURI("visiturl", {url: "about:config", input: "about:config"}), title: "about:config", style: [ "action", "visiturl", "heuristic" ] } ]
- });
-
- // This is distinct because of how we predict being able to url autofill via
- // host lookups.
- do_print("visit url, host matching visited host but not visited url");
- yield PlacesTestUtils.addVisits([
- { uri: NetUtil.newURI("http://mozilla.org/wine/"), title: "Mozilla Wine", transition: TRANSITION_TYPED },
- ]);
- yield check_autocomplete({
- search: "mozilla.org/rum",
- searchParam: "enable-actions",
- matches: [ makeVisitMatch("mozilla.org/rum", "http://mozilla.org/rum", { heuristic: true }) ]
- });
-
- // And hosts with no dot in them are special, due to requiring whitelisting.
- do_print("non-whitelisted host");
- yield check_autocomplete({
- search: "firefox",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("firefox", { heuristic: true }) ]
- });
-
- do_print("url with non-whitelisted host");
- yield check_autocomplete({
- search: "firefox/get",
- searchParam: "enable-actions",
- matches: [ makeVisitMatch("firefox/get", "http://firefox/get", { heuristic: true }) ]
- });
-
- Services.prefs.setBoolPref("browser.fixup.domainwhitelist.firefox", true);
- do_register_cleanup(() => {
- Services.prefs.clearUserPref("browser.fixup.domainwhitelist.firefox");
- });
-
- do_print("whitelisted host");
- yield check_autocomplete({
- search: "firefox",
- searchParam: "enable-actions",
- matches: [
- makeVisitMatch("firefox", "http://firefox/", { heuristic: true }),
- makeSearchMatch("firefox", { heuristic: false })
- ]
- });
-
- do_print("url with whitelisted host");
- yield check_autocomplete({
- search: "firefox/get",
- searchParam: "enable-actions",
- matches: [ makeVisitMatch("firefox/get", "http://firefox/get", { heuristic: true }) ]
- });
-
- do_print("visit url, host matching visited host but not visited url, whitelisted host");
- Services.prefs.setBoolPref("browser.fixup.domainwhitelist.mozilla", true);
- do_register_cleanup(() => {
- Services.prefs.clearUserPref("browser.fixup.domainwhitelist.mozilla");
- });
- yield check_autocomplete({
- search: "mozilla/rum",
- searchParam: "enable-actions",
- matches: [ makeVisitMatch("mozilla/rum", "http://mozilla/rum", { heuristic: true }) ]
- });
-
- // ipv4 and ipv6 literal addresses should offer to visit.
- do_print("visit url, ipv4 literal");
- yield check_autocomplete({
- search: "127.0.0.1",
- searchParam: "enable-actions",
- matches: [ makeVisitMatch("127.0.0.1", "http://127.0.0.1/", { heuristic: true }) ]
- });
-
- do_print("visit url, ipv6 literal");
- yield check_autocomplete({
- search: "[2001:db8::1]",
- searchParam: "enable-actions",
- matches: [ makeVisitMatch("[2001:db8::1]", "http://[2001:db8::1]/", { heuristic: true }) ]
- });
-
- // Setting keyword.enabled to false should always try to visit.
- let keywordEnabled = Services.prefs.getBoolPref("keyword.enabled");
- Services.prefs.setBoolPref("keyword.enabled", false);
- do_register_cleanup(() => {
- Services.prefs.clearUserPref("keyword.enabled");
- });
- do_print("visit url, keyword.enabled = false");
- yield check_autocomplete({
- search: "bacon",
- searchParam: "enable-actions",
- matches: [ makeVisitMatch("bacon", "http://bacon/", { heuristic: true }) ]
- });
- do_print("visit two word query, keyword.enabled = false");
- yield check_autocomplete({
- search: "bacon lovers",
- searchParam: "enable-actions",
- matches: [ makeVisitMatch("bacon lovers", "bacon lovers", { heuristic: true }) ]
- });
- Services.prefs.setBoolPref("keyword.enabled", keywordEnabled);
-
- do_print("visit url, scheme+host");
- yield check_autocomplete({
- search: "http://example",
- searchParam: "enable-actions",
- matches: [ makeVisitMatch("http://example", "http://example/", { heuristic: true }) ]
- });
-
- do_print("visit url, scheme+host");
- yield check_autocomplete({
- search: "ftp://example",
- searchParam: "enable-actions",
- matches: [ makeVisitMatch("ftp://example", "ftp://example/", { heuristic: true }) ]
- });
-
- do_print("visit url, host+port");
- yield check_autocomplete({
- search: "example:8080",
- searchParam: "enable-actions",
- matches: [ makeVisitMatch("example:8080", "http://example:8080/", { heuristic: true }) ]
- });
-
- do_print("numerical operations that look like urls should search");
- yield check_autocomplete({
- search: "123/12",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("123/12", { heuristic: true }) ]
- });
-
- do_print("numerical operations that look like urls should search");
- yield check_autocomplete({
- search: "123.12/12.1",
- searchParam: "enable-actions",
- matches: [ makeSearchMatch("123.12/12.1", { heuristic: true }) ]
- });
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_word_boundary_search.js b/toolkit/components/places/tests/unifiedcomplete/test_word_boundary_search.js
deleted file mode 100644
index f79573ae6..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_word_boundary_search.js
+++ /dev/null
@@ -1,175 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test bug 393678 to make sure matches against the url, title, tags are only
- * made on word boundaries instead of in the middle of words.
- *
- * Make sure we don't try matching one after a CamelCase because the upper-case
- * isn't really a word boundary. (bug 429498)
- *
- * Bug 429531 provides switching between "must match on word boundary" and "can
- * match," so leverage "must match" pref for checking word boundary logic and
- * make sure "can match" matches anywhere.
- */
-
-var katakana = ["\u30a8", "\u30c9"]; // E, Do
-var ideograph = ["\u4efb", "\u5929", "\u5802"]; // Nin Ten Do
-
-add_task(function* test_escape() {
- Services.prefs.setBoolPref("browser.urlbar.autoFill.searchEngines", false);
-
- let uri1 = NetUtil.newURI("http://matchme/");
- let uri2 = NetUtil.newURI("http://dontmatchme/");
- let uri3 = NetUtil.newURI("http://title/1");
- let uri4 = NetUtil.newURI("http://title/2");
- let uri5 = NetUtil.newURI("http://tag/1");
- let uri6 = NetUtil.newURI("http://tag/2");
- let uri7 = NetUtil.newURI("http://crazytitle/");
- let uri8 = NetUtil.newURI("http://katakana/");
- let uri9 = NetUtil.newURI("http://ideograph/");
- let uri10 = NetUtil.newURI("http://camel/pleaseMatchMe/");
-
- yield PlacesTestUtils.addVisits([
- { uri: uri1, title: "title1" },
- { uri: uri2, title: "title1" },
- { uri: uri3, title: "matchme2" },
- { uri: uri4, title: "dontmatchme3" },
- { uri: uri5, title: "title1" },
- { uri: uri6, title: "title1" },
- { uri: uri7, title: "!@#$%^&*()_+{}|:<>?word" },
- { uri: uri8, title: katakana.join("") },
- { uri: uri9, title: ideograph.join("") },
- { uri: uri10, title: "title1" }
- ]);
- yield addBookmark( { uri: uri5, title: "title1", tags: [ "matchme2" ] } );
- yield addBookmark( { uri: uri6, title: "title1", tags: [ "dontmatchme3" ] } );
-
- // match only on word boundaries
- Services.prefs.setIntPref("browser.urlbar.matchBehavior", 2);
-
- do_print("Match 'match' at the beginning or after / or on a CamelCase");
- yield check_autocomplete({
- search: "match",
- matches: [ { uri: uri1, title: "title1" },
- { uri: uri3, title: "matchme2" },
- { uri: uri5, title: "title1", tags: [ "matchme2" ], style: [ "bookmark-tag" ] },
- { uri: uri10, title: "title1" } ]
- });
-
- do_print("Match 'dont' at the beginning or after /");
- yield check_autocomplete({
- search: "dont",
- matches: [ { uri: uri2, title: "title1" },
- { uri: uri4, title: "dontmatchme3" },
- { uri: uri6, title: "title1", tags: [ "dontmatchme3" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("Match 'match' at the beginning or after / or on a CamelCase");
- yield check_autocomplete({
- search: "2",
- matches: [ { uri: uri3, title: "matchme2" },
- { uri: uri4, title: "dontmatchme3" },
- { uri: uri5, title: "title1", tags: [ "matchme2" ], style: [ "bookmark-tag" ] },
- { uri: uri6, title: "title1", tags: [ "dontmatchme3" ], style: [ "bookmark-tag" ] } ]
- });
-
- do_print("Match 't' at the beginning or after /");
- yield check_autocomplete({
- search: "t",
- matches: [ { uri: uri1, title: "title1" },
- { uri: uri2, title: "title1" },
- { uri: uri3, title: "matchme2" },
- { uri: uri4, title: "dontmatchme3" },
- { uri: uri5, title: "title1", tags: [ "matchme2" ], style: [ "bookmark-tag" ] },
- { uri: uri6, title: "title1", tags: [ "dontmatchme3" ], style: [ "bookmark-tag" ] },
- { uri: uri10, title: "title1" } ]
- });
-
- do_print("Match 'word' after many consecutive word boundaries");
- yield check_autocomplete({
- search: "word",
- matches: [ { uri: uri7, title: "!@#$%^&*()_+{}|:<>?word" } ]
- });
-
- do_print("Match a word boundary '/' for everything");
- yield check_autocomplete({
- search: "/",
- matches: [ { uri: uri1, title: "title1" },
- { uri: uri2, title: "title1" },
- { uri: uri3, title: "matchme2" },
- { uri: uri4, title: "dontmatchme3" },
- { uri: uri5, title: "title1", tags: [ "matchme2" ], style: [ "bookmark-tag" ] },
- { uri: uri6, title: "title1", tags: [ "dontmatchme3" ], style: [ "bookmark-tag" ] },
- { uri: uri7, title: "!@#$%^&*()_+{}|:<>?word" },
- { uri: uri8, title: katakana.join("") },
- { uri: uri9, title: ideograph.join("") },
- { uri: uri10, title: "title1" } ]
- });
-
- do_print("Match word boundaries '()_+' that are among word boundaries");
- yield check_autocomplete({
- search: "()_+",
- matches: [ { uri: uri7, title: "!@#$%^&*()_+{}|:<>?word" } ]
- });
-
- do_print("Katakana characters form a string, so match the beginning");
- yield check_autocomplete({
- search: katakana[0],
- matches: [ { uri: uri8, title: katakana.join("") } ]
- });
-
-/*
- do_print("Middle of a katakana word shouldn't be matched");
- yield check_autocomplete({
- search: katakana[1],
- matches: [ ]
- });
-*/
- do_print("Ideographs are treated as words so 'nin' is one word");
- yield check_autocomplete({
- search: ideograph[0],
- matches: [ { uri: uri9, title: ideograph.join("") } ]
- });
-
- do_print("Ideographs are treated as words so 'ten' is another word");
- yield check_autocomplete({
- search: ideograph[1],
- matches: [ { uri: uri9, title: ideograph.join("") } ]
- });
-
- do_print("Ideographs are treated as words so 'do' is yet another word");
- yield check_autocomplete({
- search: ideograph[2],
- matches: [ { uri: uri9, title: ideograph.join("") } ]
- });
-
- do_print("Extra negative assert that we don't match in the middle");
- yield check_autocomplete({
- search: "ch",
- matches: [ ]
- });
-
- do_print("Don't match one character after a camel-case word boundary (bug 429498)");
- yield check_autocomplete({
- search: "atch",
- matches: [ ]
- });
-
- // match against word boundaries and anywhere
- Services.prefs.setIntPref("browser.urlbar.matchBehavior", 1);
-
- yield check_autocomplete({
- search: "tch",
- matches: [ { uri: uri1, title: "title1" },
- { uri: uri2, title: "title1" },
- { uri: uri3, title: "matchme2" },
- { uri: uri4, title: "dontmatchme3" },
- { uri: uri5, title: "title1", tags: [ "matchme2" ], style: [ "bookmark-tag" ] },
- { uri: uri6, title: "title1", tags: [ "dontmatchme3" ], style: [ "bookmark-tag" ] },
- { uri: uri10, title: "title1" } ]
- });
-
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/test_zero_frecency.js b/toolkit/components/places/tests/unifiedcomplete/test_zero_frecency.js
deleted file mode 100644
index adf638886..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/test_zero_frecency.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Ensure inline autocomplete doesn't return zero frecency pages.
-
-add_task(function* test_zzero_frec_domain() {
- do_print("Searching for zero frecency domain should not autoFill it");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/framed_link/"),
- transition: TRANSITION_FRAMED_LINK
- });
- yield check_autocomplete({
- search: "moz",
- autofilled: "moz",
- completed: "moz"
- });
- yield cleanup();
-});
-
-add_task(function* test_zzero_frec_url() {
- do_print("Searching for zero frecency url should not autoFill it");
- Services.prefs.setBoolPref("browser.urlbar.autoFill.typed", false);
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://mozilla.org/framed_link/"),
- transition: TRANSITION_FRAMED_LINK
- });
- yield check_autocomplete({
- search: "mozilla.org/f",
- autofilled: "mozilla.org/f",
- completed: "mozilla.org/f"
- });
- yield cleanup();
-});
diff --git a/toolkit/components/places/tests/unifiedcomplete/xpcshell.ini b/toolkit/components/places/tests/unifiedcomplete/xpcshell.ini
deleted file mode 100644
index 60ef8c48a..000000000
--- a/toolkit/components/places/tests/unifiedcomplete/xpcshell.ini
+++ /dev/null
@@ -1,49 +0,0 @@
-[DEFAULT]
-head = head_autocomplete.js
-tail =
-skip-if = toolkit == 'android'
-support-files =
- data/engine-rel-searchform.xml
- data/engine-suggestions.xml
- !/toolkit/components/places/tests/favicons/favicon-normal16.png
-
-[test_416211.js]
-[test_416214.js]
-[test_417798.js]
-[test_418257.js]
-[test_422277.js]
-[test_autocomplete_functional.js]
-[test_autocomplete_on_value_removed_479089.js]
-[test_autofill_default_behavior.js]
-[test_avoid_middle_complete.js]
-[test_avoid_stripping_to_empty_tokens.js]
-[test_casing.js]
-[test_do_not_trim.js]
-[test_download_embed_bookmarks.js]
-[test_dupe_urls.js]
-[test_empty_search.js]
-[test_enabled.js]
-[test_escape_self.js]
-[test_extension_matches.js]
-[test_ignore_protocol.js]
-[test_keyword_search.js]
-[test_keyword_search_actions.js]
-[test_keywords.js]
-[test_match_beginning.js]
-[test_multi_word_search.js]
-[test_query_url.js]
-[test_remote_tab_matches.js]
-skip-if = !sync
-[test_search_engine_alias.js]
-[test_search_engine_current.js]
-[test_search_engine_host.js]
-[test_search_engine_restyle.js]
-[test_search_suggestions.js]
-[test_special_search.js]
-[test_swap_protocol.js]
-[test_tab_matches.js]
-[test_trimming.js]
-[test_typed.js]
-[test_visit_url.js]
-[test_word_boundary_search.js]
-[test_zero_frecency.js]
diff --git a/toolkit/components/places/tests/unit/.eslintrc.js b/toolkit/components/places/tests/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/places/tests/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/places/tests/unit/bookmarks.corrupt.html b/toolkit/components/places/tests/unit/bookmarks.corrupt.html
deleted file mode 100644
index 3cf43367f..000000000
--- a/toolkit/components/places/tests/unit/bookmarks.corrupt.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE NETSCAPE-Bookmark-file-1>
-<!-- This is an automatically generated file.
- It will be read and overwritten.
- DO NOT EDIT! -->
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
-<TITLE>Bookmarks</TITLE>
-<H1 LAST_MODIFIED="1177541029">Bookmarks</H1>
-
-<DL><p>
- <DT><H3 ID="rdf:#$ZvPhC3">Mozilla Firefox</H3>
- <DL><p>
- <DT><A HREF="http://en-US.www.mozilla.com/en-US/firefox/help/" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==" ID="rdf:#$22iCK1">Help and Tutorials</A>
- <DT><A HREF="http://en-US.www.mozilla.com/en-US/firefox/customize/" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==" ID="rdf:#$32iCK1">Customize Firefox</A>
- <DT><A HREF="http://en-US.www.mozilla.com/en-US/firefox/community/" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==" ID="rdf:#$42iCK1">Get Involved</A>
- <DT><A HREF="http://en-US.www.mozilla.com/en-US/about/" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==" ID="rdf:#$52iCK1">About Us</A>
- <DT><A HREF="b0rked" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==" ID="rdf:#$52iCK1">About Us</A>
- </DL><p>
- <DT><H3 ADD_DATE="1177541020" LAST_MODIFIED="1177541050" ID="rdf:#$74Gpx2">test</H3>
-<DD>folder test comment
- <DL><p>
- <DT><A HREF="http://test/post" ADD_DATE="1177375336" LAST_MODIFIED="1177375423" SHORTCUTURL="test" WEB_PANEL="true" POST_DATA="hidden1%3Dbar&amp;text1%3D%25s" LAST_CHARSET="ISO-8859-1" ID="rdf:#$pYFe7">test post keyword</A>
-<DD>item description
- </DL>
- <DT><H3 UNFILED_BOOKMARKS_FOLDER="true">Unsorted Bookmarks</H3>
- <DL><p>
- <DT><A HREF="http://example.tld">Example.tld</A>
- </DL><p>
- <DT><H3 LAST_MODIFIED="1177541040" PERSONAL_TOOLBAR_FOLDER="true" ID="rdf:#$FvPhC3">Bookmarks Toolbar Folder</H3>
-<DD>Add bookmarks to this folder to see them displayed on the Bookmarks Toolbar
- <DL><p>
- <DT><A HREF="http://en-US.www.mozilla.com/en-US/firefox/central/" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==" ID="rdf:#$GvPhC3">Getting Started</A>
- <DT><A HREF="http://en-US.fxfeeds.mozilla.com/en-US/firefox/livebookmarks/" LAST_MODIFIED="1177541035" FEEDURL="http://en-US.fxfeeds.mozilla.com/en-US/firefox/headlines.xml" ID="rdf:#$HvPhC3">Latest Headlines</A>
- <DT><A HREF="http://bogus-icon.mozilla.com/" ICON="b0rked" ID="rdf:#$GvPhC3">Getting Started</A>
-<DD>Livemark test comment
- </DL><p>
-</DL><p>
diff --git a/toolkit/components/places/tests/unit/bookmarks.json b/toolkit/components/places/tests/unit/bookmarks.json
deleted file mode 100644
index afe62abae..000000000
--- a/toolkit/components/places/tests/unit/bookmarks.json
+++ /dev/null
@@ -1 +0,0 @@
-{"guid":"root________","title":"","id":1,"dateAdded":1361551978957783,"lastModified":1361551978957783,"type":"text/x-moz-place-container","root":"placesRoot","children":[{"guid":"menu________","title":"Bookmarks Menu","id":2,"parent":1,"dateAdded":1361551978957783,"lastModified":1361551979382837,"type":"text/x-moz-place-container","root":"bookmarksMenuFolder","children":[{"guid":"OCyeUO5uu9FF","title":"Mozilla Firefox","id":6,"parent":2,"dateAdded":1361551979350273,"lastModified":1361551979376699,"type":"text/x-moz-place-container","children":[{"guid":"OCyeUO5uu9FG","title":"Help and Tutorials","id":7,"parent":6,"dateAdded":1361551979356436,"lastModified":1361551979362718,"type":"text/x-moz-place","uri":"http://en-us.www.mozilla.com/en-US/firefox/help/", "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="},{"guid":"OCyeUO5uu9FH","index":1,"title":"Customize Firefox","id":8,"parent":6,"dateAdded":1361551979365662,"lastModified":1361551979368077,"type":"text/x-moz-place","uri":"http://en-us.www.mozilla.com/en-US/firefox/customize/", "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="},{"guid":"OCyeUO5uu9FI","index":2,"title":"Get Involved","id":9,"parent":6,"dateAdded":1361551979371071,"lastModified":1361551979373745,"type":"text/x-moz-place","uri":"http://en-us.www.mozilla.com/en-US/firefox/community/", "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="},{"guid":"OCyeUO5uu9FJ","index":3,"title":"About Us","id":10,"parent":6,"dateAdded":1361551979376699,"lastModified":1361551979379060,"type":"text/x-moz-place","uri":"http://en-us.www.mozilla.com/en-US/about/", "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="}]},{"guid":"OCyeUO5uu9FK","index":1,"title":"","id":11,"parent":2,"dateAdded":1361551979380988,"lastModified":1361551979380988,"type":"text/x-moz-place-separator"},{"guid":"OCyeUO5uu9FL","index":2,"title":"test","id":12,"parent":2,"dateAdded":1177541020000000,"lastModified":1177541050000000,"annos":[{"name":"bookmarkProperties/description","flags":0,"expires":4,"mimeType":null,"type":3,"value":"folder test comment"}],"type":"text/x-moz-place-container","children":[{"guid":"OCyeUO5uu9GX","title":"test post keyword","id":13,"parent":12,"dateAdded":1177375336000000,"lastModified":1177375423000000,"annos":[{"name":"bookmarkProperties/description","flags":0,"expires":4,"mimeType":null,"type":3,"value":"item description"},{"name":"bookmarkProperties/POSTData","flags":0,"expires":4,"mimeType":null,"type":3,"value":"hidden1%3Dbar&text1%3D%25s"},{"name":"bookmarkProperties/loadInSidebar","flags":0,"expires":4,"mimeType":null,"type":1,"value":1}],"type":"text/x-moz-place","uri":"http://test/post","keyword":"test","charset":"ISO-8859-1"}]}]},{"index":1,"title":"Bookmarks Toolbar","id":3,"parent":1,"dateAdded":1361551978957783,"lastModified":1177541050000000,"annos":[{"name":"bookmarkProperties/description","flags":0,"expires":4,"mimeType":null,"type":3,"value":"Add bookmarks to this folder to see them displayed on the Bookmarks Toolbar"}],"type":"text/x-moz-place-container","root":"toolbarFolder","children":[{"guid":"OCyeUO5uu9FB","title":"Getting Started","id":15,"parent":3,"dateAdded":1361551979409695,"lastModified":1361551979412080,"type":"text/x-moz-place","uri":"http://en-us.www.mozilla.com/en-US/firefox/central/", "icon": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="},{"guid":"OCyeUO5uu9FR","index":1,"title":"Latest Headlines","id":16,"parent":3,"dateAdded":1361551979451584,"lastModified":1361551979457086,"livemark":1,"annos":[{"name":"placesInternal/READ_ONLY","flags":0,"expires":4,"mimeType":null,"type":1,"value":1},{"name":"livemark/feedURI","flags":0,"expires":4,"mimeType":null,"type":3,"value":"http://en-us.fxfeeds.mozilla.com/en-US/firefox/headlines.xml"},{"name":"livemark/siteURI","flags":0,"expires":4,"mimeType":null,"type":3,"value":"http://en-us.fxfeeds.mozilla.com/en-US/firefox/livebookmarks/"}],"type":"text/x-moz-place-container","children":[]}]},{"index":2,"title":"Tags","id":4,"parent":1,"dateAdded":1361551978957783,"lastModified":1361551978957783,"type":"text/x-moz-place-container","root":"tagsFolder","children":[]},{"index":3,"title":"Unsorted Bookmarks","id":5,"parent":1,"dateAdded":1361551978957783,"lastModified":1177541050000000,"type":"text/x-moz-place-container","root":"unfiledBookmarksFolder","children":[{"guid":"OCyeUO5uu9FW","title":"Example.tld","id":14,"parent":5,"dateAdded":1361551979401846,"lastModified":1361551979402952,"type":"text/x-moz-place","uri":"http://example.tld/"}]}]}
diff --git a/toolkit/components/places/tests/unit/bookmarks.preplaces.html b/toolkit/components/places/tests/unit/bookmarks.preplaces.html
deleted file mode 100644
index 2e5a1baf0..000000000
--- a/toolkit/components/places/tests/unit/bookmarks.preplaces.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<!DOCTYPE NETSCAPE-Bookmark-file-1>
-<!-- This is an automatically generated file.
- It will be read and overwritten.
- DO NOT EDIT! -->
-<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
-<TITLE>Bookmarks</TITLE>
-<H1 LAST_MODIFIED="1177541029">Bookmarks</H1>
-
-<DL><p>
- <DT><H3 ID="rdf:#$ZvPhC3">Mozilla Firefox</H3>
- <DL><p>
- <DT><A HREF="http://en-US.www.mozilla.com/en-US/firefox/help/" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==" ID="rdf:#$22iCK1">Help and Tutorials</A>
- <DT><A HREF="http://en-US.www.mozilla.com/en-US/firefox/customize/" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==" ID="rdf:#$32iCK1">Customize Firefox</A>
- <DT><A HREF="http://en-US.www.mozilla.com/en-US/firefox/community/" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==" ID="rdf:#$42iCK1">Get Involved</A>
- <DT><A HREF="http://en-US.www.mozilla.com/en-US/about/" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==" ID="rdf:#$52iCK1">About Us</A>
- </DL><p>
- <HR>
- <DT><H3 ADD_DATE="1177541020" LAST_MODIFIED="1177541050" ID="rdf:#$74Gpx2">test</H3>
-<DD>folder test comment
- <DL><p>
- <DT><A HREF="http://test/post" ADD_DATE="1177375336" LAST_MODIFIED="1177375423" SHORTCUTURL="test" WEB_PANEL="true" POST_DATA="hidden1%3Dbar&amp;text1%3D%25s" LAST_CHARSET="ISO-8859-1" ID="rdf:#$pYFe7">test post keyword</A>
-<DD>item description
- </DL>
- <DT><H3 UNFILED_BOOKMARKS_FOLDER="true">Unsorted Bookmarks</H3>
- <DL><p>
- <DT><A HREF="http://example.tld">Example.tld</A>
- </DL><p>
- <DT><H3 LAST_MODIFIED="1177541040" PERSONAL_TOOLBAR_FOLDER="true" ID="rdf:#$FvPhC3">Bookmarks Toolbar Folder</H3>
-<DD>Add bookmarks to this folder to see them displayed on the Bookmarks Toolbar
- <DL><p>
- <DT><A HREF="http://en-US.www.mozilla.com/en-US/firefox/central/" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg==" ID="rdf:#$GvPhC3">Getting Started</A>
- <DT><A HREF="http://en-US.fxfeeds.mozilla.com/en-US/firefox/livebookmarks/" LAST_MODIFIED="1177541035" FEEDURL="http://en-US.fxfeeds.mozilla.com/en-US/firefox/headlines.xml" ID="rdf:#$HvPhC3">Latest Headlines</A>
-<DD>Livemark test comment
- </DL><p>
-</DL><p>
diff --git a/toolkit/components/places/tests/unit/bookmarks_html_singleframe.html b/toolkit/components/places/tests/unit/bookmarks_html_singleframe.html
deleted file mode 100644
index 9fe662f32..000000000
--- a/toolkit/components/places/tests/unit/bookmarks_html_singleframe.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE NETSCAPE-Bookmark-file-1>
- <HTML>
- <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8">
- <Title>Bookmarks</Title>
- <H1>Bookmarks</H1>
- <DT><H3>Subtitle</H3>
- <DL><p>
- <DT><A HREF="http://www.mozilla.org/">Mozilla</A>
- </DL><p>
-</HTML>
diff --git a/toolkit/components/places/tests/unit/bug476292.sqlite b/toolkit/components/places/tests/unit/bug476292.sqlite
deleted file mode 100644
index 43130cb51..000000000
--- a/toolkit/components/places/tests/unit/bug476292.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/unit/corruptDB.sqlite b/toolkit/components/places/tests/unit/corruptDB.sqlite
deleted file mode 100644
index b234246ca..000000000
--- a/toolkit/components/places/tests/unit/corruptDB.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/unit/default.sqlite b/toolkit/components/places/tests/unit/default.sqlite
deleted file mode 100644
index 8fbd3bc9a..000000000
--- a/toolkit/components/places/tests/unit/default.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/unit/head_bookmarks.js b/toolkit/components/places/tests/unit/head_bookmarks.js
deleted file mode 100644
index 842a66b31..000000000
--- a/toolkit/components/places/tests/unit/head_bookmarks.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cr = Components.results;
-var Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-// Import common head.
-{
- let commonFile = do_get_file("../head_common.js", false);
- let uri = Services.io.newFileURI(commonFile);
- Services.scriptloader.loadSubScript(uri.spec, this);
-}
-
-// Put any other stuff relative to this test folder below.
diff --git a/toolkit/components/places/tests/unit/livemark.xml b/toolkit/components/places/tests/unit/livemark.xml
deleted file mode 100644
index db2ea9023..000000000
--- a/toolkit/components/places/tests/unit/livemark.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<feed xmlns="http://www.w3.org/2005/Atom">
- <title>Livemark Feed</title>
- <link href="https://example.com/"/>
- <updated>2016-08-09T19:51:45.147Z</updated>
- <author>
- <name>John Doe</name>
- </author>
- <id>urn:uuid:e7947414-6ee0-4009-ae75-8b0ad3c6894b</id>
- <entry>
- <title>Some awesome article</title>
- <link href="https://example.com/some-article"/>
- <id>urn:uuid:d72ce019-0a56-4a0b-ac03-f66117d78141</id>
- <updated>2016-08-09T19:57:22.178Z</updated>
- <summary>My great article summary.</summary>
- </entry>
-</feed>
diff --git a/toolkit/components/places/tests/unit/mobile_bookmarks_folder_import.json b/toolkit/components/places/tests/unit/mobile_bookmarks_folder_import.json
deleted file mode 100644
index 38762b3f1..000000000
--- a/toolkit/components/places/tests/unit/mobile_bookmarks_folder_import.json
+++ /dev/null
@@ -1 +0,0 @@
-{"guid":"root________","title":"","index":0,"dateAdded":1475084731479000,"lastModified":1475084731479000,"id":1,"type":"text/x-moz-place-container","root":"placesRoot","children":[{"guid":"menu________","title":"Bookmarks Menu","index":0,"dateAdded":1475084731479000,"lastModified":1475084731768000,"id":2,"type":"text/x-moz-place-container","root":"bookmarksMenuFolder","children":[{"guid":"X6lUyOspVYwi","title":"Test Pilot","index":0,"dateAdded":1475084731768000,"lastModified":1475084731768000,"id":3,"type":"text/x-moz-place","uri":"https://testpilot.firefox.com/"},{"guid":"XF4yRP6bTuil","title":"Mobile bookmarks query","index":1,"dateAdded":1475084731768000,"lastModified":1475084731768000,"id":11,"type":"text/x-moz-place","uri":"place:folder=101"}]},{"guid":"toolbar_____","title":"Bookmarks Toolbar","index":1,"dateAdded":1475084731479000,"lastModified":1475084731742000,"id":4,"type":"text/x-moz-place-container","root":"toolbarFolder","children":[{"guid":"buy7711R3ZgE","title":"MDN","index":0,"dateAdded":1475084731769000,"lastModified":1475084731769000,"id":5,"type":"text/x-moz-place","uri":"https://developer.mozilla.org"}]},{"guid":"3qmd_imziEBE","title":"Mobile Bookmarks","index":5,"dateAdded":1475084731479000,"lastModified":1475084731770000,"id":101,"annos":[{"name":"mobile/bookmarksRoot","flags":0,"expires":4,"value":1},{"name":"bookmarkProperties/description","flags":0,"expires":4,"mimeType":null,"type":3,"value":"A description of the mobile folder that should be ignored on import"}],"type":"text/x-moz-place-container","children":[{"guid":"_o8e1_zxTJFg","title":"Get Firefox!","index":0,"dateAdded":1475084731769000,"lastModified":1475084731769000,"id":7,"type":"text/x-moz-place","uri":"http://getfirefox.com/"},{"guid":"QCtSqkVYUbXB","title":"Get Thunderbird!","index":1,"dateAdded":1475084731770000,"lastModified":1475084731770000,"id":8,"type":"text/x-moz-place","uri":"http://getthunderbird.com/"}]},{"guid":"unfiled_____","title":"Other Bookmarks","index":3,"dateAdded":1475084731479000,"lastModified":1475084731742000,"id":9,"type":"text/x-moz-place-container","root":"unfiledBookmarksFolder","children":[{"guid":"KIa9iKZab2Z5","title":"Add-ons","index":0,"dateAdded":1475084731769000,"lastModified":1475084731769000,"id":10,"type":"text/x-moz-place","uri":"https://addons.mozilla.org"}]}]} \ No newline at end of file
diff --git a/toolkit/components/places/tests/unit/mobile_bookmarks_folder_merge.json b/toolkit/components/places/tests/unit/mobile_bookmarks_folder_merge.json
deleted file mode 100644
index 7319a3a52..000000000
--- a/toolkit/components/places/tests/unit/mobile_bookmarks_folder_merge.json
+++ /dev/null
@@ -1 +0,0 @@
-{"guid":"root________","title":"","index":0,"dateAdded":1475084731479000,"lastModified":1475084731479000,"id":1,"type":"text/x-moz-place-container","root":"placesRoot","children":[{"guid":"menu________","title":"Bookmarks Menu","index":0,"dateAdded":1475084731479000,"lastModified":1475084731768000,"id":2,"type":"text/x-moz-place-container","root":"bookmarksMenuFolder","children":[{"guid":"Utodo9b0oVws","title":"Firefox Accounts","index":0,"dateAdded":1475084731955000,"lastModified":1475084731955000,"id":3,"type":"text/x-moz-place","uri":"https://accounts.firefox.com/"}]},{"guid":"toolbar_____","title":"Bookmarks Toolbar","index":1,"dateAdded":1475084731479000,"lastModified":1475084731742000,"id":4,"type":"text/x-moz-place-container","root":"toolbarFolder"},{"guid":"3qmd_imziEBE","title":"Mobile Bookmarks","index":5,"dateAdded":1475084731479000,"lastModified":1475084731770000,"id":5,"annos":[{"name":"mobile/bookmarksRoot","flags":0,"expires":4,"value":1},{"name":"bookmarkProperties/description","flags":0,"expires":4,"mimeType":null,"type":3,"value":"A description of the mobile folder that should be ignored on import"}],"type":"text/x-moz-place-container","children":[{"guid":"a17yW6-nTxEJ","title":"Mozilla","index":0,"dateAdded":1475084731959000,"lastModified":1475084731959000,"id":6,"type":"text/x-moz-place","uri":"https://mozilla.org/"},{"guid":"xV10h9Wi3FBM","title":"Bugzilla","index":1,"dateAdded":1475084731961000,"lastModified":1475084731961000,"id":7,"type":"text/x-moz-place","uri":"https://bugzilla.mozilla.org/"}]},{"guid":"unfiled_____","title":"Other Bookmarks","index":3,"dateAdded":1475084731479000,"lastModified":1475084731742000,"id":8,"type":"text/x-moz-place-container","root":"unfiledBookmarksFolder"}]} \ No newline at end of file
diff --git a/toolkit/components/places/tests/unit/mobile_bookmarks_multiple_folders.json b/toolkit/components/places/tests/unit/mobile_bookmarks_multiple_folders.json
deleted file mode 100644
index afe13c975..000000000
--- a/toolkit/components/places/tests/unit/mobile_bookmarks_multiple_folders.json
+++ /dev/null
@@ -1 +0,0 @@
-{"guid":"root________","title":"","index":0,"dateAdded":1475084731479000,"lastModified":1475084731479000,"id":1,"type":"text/x-moz-place-container","root":"placesRoot","children":[{"guid":"menu________","title":"Bookmarks Menu","index":0,"dateAdded":1475084731479000,"lastModified":1475084731768000,"id":2,"type":"text/x-moz-place-container","root":"bookmarksMenuFolder","children":[{"guid":"buy7711R3ZgE","title":"MDN","index":0,"dateAdded":1475084731769000,"lastModified":1475084731769000,"id":3,"type":"text/x-moz-place","uri":"https://developer.mozilla.org"},{"guid":"F_LBgd1fS_uQ","title":"Mobile bookmarks query for first folder","index":1,"dateAdded":1475084731768000,"lastModified":1475084731768000,"id":11,"type":"text/x-moz-place","uri":"place:folder=101"},{"guid":"oIpmQXMWsXvY","title":"Mobile bookmarks query for second folder","index":2,"dateAdded":1475084731768000,"lastModified":1475084731768000,"id":12,"type":"text/x-moz-place","uri":"place:folder=102"}]},{"guid":"3qmd_imziEBE","title":"Mobile Bookmarks","index":5,"dateAdded":1475084731479000,"lastModified":1475084731770000,"id":101,"annos":[{"name":"mobile/bookmarksRoot","flags":0,"expires":4,"value":1},{"name":"bookmarkProperties/description","flags":0,"expires":4,"mimeType":null,"type":3,"value":"A description of the mobile folder that should be ignored on import"}],"type":"text/x-moz-place-container","children":[{"guid":"a17yW6-nTxEJ","title":"Mozilla","index":0,"dateAdded":1475084731959000,"lastModified":1475084731959000,"id":5,"type":"text/x-moz-place","uri":"https://mozilla.org/"}]},{"guid":"toolbar_____","title":"Bookmarks Toolbar","index":1,"dateAdded":1475084731479000,"lastModified":1475084731742000,"id":6,"type":"text/x-moz-place-container","root":"toolbarFolder","children":[{"guid":"Utodo9b0oVws","title":"Firefox Accounts","index":0,"dateAdded":1475084731955000,"lastModified":1475084731955000,"id":7,"type":"text/x-moz-place","uri":"https://accounts.firefox.com/"}]},{"guid":"o4YjJpgsufU-","title":"Mobile Bookmarks","index":7,"dateAdded":1475084731479000,"lastModified":1475084731770000,"id":102,"annos":[{"name":"mobile/bookmarksRoot","flags":0,"expires":4,"value":1}],"type":"text/x-moz-place-container","children":[{"guid":"sSZ86WT9WbN3","title":"DXR","index":0,"dateAdded":1475084731769000,"lastModified":1475084731769000,"id":9,"type":"text/x-moz-place","uri":"https://dxr.mozilla.org"}]},{"guid":"unfiled_____","title":"Other Bookmarks","index":3,"dateAdded":1475084731479000,"lastModified":1475084731742000,"id":10,"type":"text/x-moz-place-container","root":"unfiledBookmarksFolder","children":[{"guid":"xV10h9Wi3FBM","title":"Bugzilla","index":1,"dateAdded":1475084731961000,"lastModified":1475084731961000,"id":11,"type":"text/x-moz-place","uri":"https://bugzilla.mozilla.org/"}]}]} \ No newline at end of file
diff --git a/toolkit/components/places/tests/unit/mobile_bookmarks_root_import.json b/toolkit/components/places/tests/unit/mobile_bookmarks_root_import.json
deleted file mode 100644
index 27f5825ec..000000000
--- a/toolkit/components/places/tests/unit/mobile_bookmarks_root_import.json
+++ /dev/null
@@ -1 +0,0 @@
-{"guid":"root________","title":"","index":0,"dateAdded":1475084731479000,"lastModified":1475084731479000,"id":1,"type":"text/x-moz-place-container","root":"placesRoot","children":[{"guid":"menu________","title":"Bookmarks Menu","index":0,"dateAdded":1475084731479000,"lastModified":1475084731768000,"id":2,"type":"text/x-moz-place-container","root":"bookmarksMenuFolder","children":[{"guid":"X6lUyOspVYwi","title":"Test Pilot","index":0,"dateAdded":1475084731768000,"lastModified":1475084731768000,"id":3,"type":"text/x-moz-place","uri":"https://testpilot.firefox.com/"}]},{"guid":"toolbar_____","title":"Bookmarks Toolbar","index":1,"dateAdded":1475084731479000,"lastModified":1475084731742000,"id":4,"type":"text/x-moz-place-container","root":"toolbarFolder"},{"guid":"unfiled_____","title":"Other Bookmarks","index":3,"dateAdded":1475084731479000,"lastModified":1475084731742000,"id":5,"type":"text/x-moz-place-container","root":"unfiledBookmarksFolder"},{"guid":"mobile______","title":"Mobile Bookmarks","index":4,"dateAdded":1475084731479000,"lastModified":1475084731770000,"id":6,"annos":[{"name":"mobile/bookmarksRoot","flags":0,"expires":4,"value":1}],"type":"text/x-moz-place-container","root":"mobileFolder","children":[{"guid":"_o8e1_zxTJFg","title":"Get Firefox!","index":0,"dateAdded":1475084731769000,"lastModified":1475084731769000,"id":7,"type":"text/x-moz-place","uri":"http://getfirefox.com/"},{"guid":"QCtSqkVYUbXB","title":"Get Thunderbird!","index":1,"dateAdded":1475084731770000,"lastModified":1475084731770000,"id":8,"type":"text/x-moz-place","uri":"http://getthunderbird.com/"}]}]} \ No newline at end of file
diff --git a/toolkit/components/places/tests/unit/mobile_bookmarks_root_merge.json b/toolkit/components/places/tests/unit/mobile_bookmarks_root_merge.json
deleted file mode 100644
index 85721f2fa..000000000
--- a/toolkit/components/places/tests/unit/mobile_bookmarks_root_merge.json
+++ /dev/null
@@ -1 +0,0 @@
-{"guid":"root________","title":"","index":0,"dateAdded":1475084731479000,"lastModified":1475084731479000,"id":1,"type":"text/x-moz-place-container","root":"placesRoot","children":[{"guid":"menu________","title":"Bookmarks Menu","index":0,"dateAdded":1475084731479000,"lastModified":1475084731955000,"id":2,"type":"text/x-moz-place-container","root":"bookmarksMenuFolder","children":[{"guid":"Utodo9b0oVws","title":"Firefox Accounts","index":0,"dateAdded":1475084731955000,"lastModified":1475084731955000,"id":3,"type":"text/x-moz-place","uri":"https://accounts.firefox.com/"}]},{"guid":"toolbar_____","title":"Bookmarks Toolbar","index":1,"dateAdded":1475084731479000,"lastModified":1475084731938000,"id":4,"type":"text/x-moz-place-container","root":"toolbarFolder"},{"guid":"unfiled_____","title":"Other Bookmarks","index":3,"dateAdded":1475084731479000,"lastModified":1475084731938000,"id":5,"type":"text/x-moz-place-container","root":"unfiledBookmarksFolder"},{"guid":"mobile______","title":"Mobile Bookmarks","index":4,"dateAdded":1475084731479000,"lastModified":1475084731961000,"id":6,"annos":[{"name":"mobile/bookmarksRoot","flags":0,"expires":4,"value":1}],"type":"text/x-moz-place-container","root":"mobileFolder","children":[{"guid":"a17yW6-nTxEJ","title":"Mozilla","index":0,"dateAdded":1475084731959000,"lastModified":1475084731959000,"id":7,"type":"text/x-moz-place","uri":"https://mozilla.org/"},{"guid":"xV10h9Wi3FBM","title":"Bugzilla","index":1,"dateAdded":1475084731961000,"lastModified":1475084731961000,"id":8,"type":"text/x-moz-place","uri":"https://bugzilla.mozilla.org/"}]}]} \ No newline at end of file
diff --git a/toolkit/components/places/tests/unit/nsDummyObserver.js b/toolkit/components/places/tests/unit/nsDummyObserver.js
deleted file mode 100644
index 9049d04b3..000000000
--- a/toolkit/components/places/tests/unit/nsDummyObserver.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-
-// Dummy boomark/history observer
-function DummyObserver() {
- Services.obs.notifyObservers(null, "dummy-observer-created", null);
-}
-
-DummyObserver.prototype = {
- // history observer
- onBeginUpdateBatch: function () {},
- onEndUpdateBatch: function () {},
- onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID, aTransitionType) {
- Services.obs.notifyObservers(null, "dummy-observer-visited", null);
- },
- onTitleChanged: function () {},
- onDeleteURI: function () {},
- onClearHistory: function () {},
- onPageChanged: function () {},
- onDeleteVisits: function () {},
-
- // bookmark observer
- // onBeginUpdateBatch: function() {},
- // onEndUpdateBatch: function() {},
- onItemAdded: function(aItemId, aParentId, aIndex, aItemType, aURI) {
- Services.obs.notifyObservers(null, "dummy-observer-item-added", null);
- },
- onItemChanged: function () {},
- onItemRemoved: function() {},
- onItemVisited: function() {},
- onItemMoved: function() {},
-
- classID: Components.ID("62e221d3-68c3-4e1a-8943-a27beb5005fe"),
-
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsINavBookmarkObserver,
- Ci.nsINavHistoryObserver,
- ])
-};
-
-this.NSGetFactory = XPCOMUtils.generateNSGetFactory([DummyObserver]);
diff --git a/toolkit/components/places/tests/unit/nsDummyObserver.manifest b/toolkit/components/places/tests/unit/nsDummyObserver.manifest
deleted file mode 100644
index ed4d87fff..000000000
--- a/toolkit/components/places/tests/unit/nsDummyObserver.manifest
+++ /dev/null
@@ -1,4 +0,0 @@
-component 62e221d3-68c3-4e1a-8943-a27beb5005fe nsDummyObserver.js
-contract @mozilla.org/places/test/dummy-observer;1 62e221d3-68c3-4e1a-8943-a27beb5005fe
-category bookmark-observers nsDummyObserver @mozilla.org/places/test/dummy-observer;1
-category history-observers nsDummyObserver @mozilla.org/places/test/dummy-observer;1
diff --git a/toolkit/components/places/tests/unit/places.sparse.sqlite b/toolkit/components/places/tests/unit/places.sparse.sqlite
deleted file mode 100644
index 915089021..000000000
--- a/toolkit/components/places/tests/unit/places.sparse.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/places/tests/unit/test_000_frecency.js b/toolkit/components/places/tests/unit/test_000_frecency.js
deleted file mode 100644
index 64ee86b59..000000000
--- a/toolkit/components/places/tests/unit/test_000_frecency.js
+++ /dev/null
@@ -1,267 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
-
-Autocomplete Frecency Tests
-
-- add a visit for each score permutation
-- search
-- test number of matches
-- test each item's location in results
-
-*/
-
-try {
- var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
- var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
- var prefs = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
-} catch (ex) {
- do_throw("Could not get services\n");
-}
-
-var bucketPrefs = [
- [ "firstBucketCutoff", "firstBucketWeight"],
- [ "secondBucketCutoff", "secondBucketWeight"],
- [ "thirdBucketCutoff", "thirdBucketWeight"],
- [ "fourthBucketCutoff", "fourthBucketWeight"],
- [ null, "defaultBucketWeight"]
-];
-
-var bonusPrefs = {
- embedVisitBonus: Ci.nsINavHistoryService.TRANSITION_EMBED,
- framedLinkVisitBonus: Ci.nsINavHistoryService.TRANSITION_FRAMED_LINK,
- linkVisitBonus: Ci.nsINavHistoryService.TRANSITION_LINK,
- typedVisitBonus: Ci.nsINavHistoryService.TRANSITION_TYPED,
- bookmarkVisitBonus: Ci.nsINavHistoryService.TRANSITION_BOOKMARK,
- downloadVisitBonus: Ci.nsINavHistoryService.TRANSITION_DOWNLOAD,
- permRedirectVisitBonus: Ci.nsINavHistoryService.TRANSITION_REDIRECT_PERMANENT,
- tempRedirectVisitBonus: Ci.nsINavHistoryService.TRANSITION_REDIRECT_TEMPORARY,
- reloadVisitBonus: Ci.nsINavHistoryService.TRANSITION_RELOAD,
-};
-
-// create test data
-var searchTerm = "frecency";
-var results = [];
-var matchCount = 0;
-var now = Date.now();
-var prefPrefix = "places.frecency.";
-
-function* task_initializeBucket(bucket) {
- let [cutoffName, weightName] = bucket;
- // get pref values
- var weight = prefs.getIntPref(prefPrefix + weightName, 0);
- var cutoff = prefs.getIntPref(prefPrefix + cutoffName, 0);
- if (cutoff < 1)
- return;
-
- // generate a date within the cutoff period
- var dateInPeriod = (now - ((cutoff - 1) * 86400 * 1000)) * 1000;
-
- for (let [bonusName, visitType] of Object.entries(bonusPrefs)) {
- var frecency = -1;
- var calculatedURI = null;
- var matchTitle = "";
- var bonusValue = prefs.getIntPref(prefPrefix + bonusName);
- // unvisited (only for first cutoff date bucket)
- if (bonusName == "unvisitedBookmarkBonus" || bonusName == "unvisitedTypedBonus") {
- if (cutoffName == "firstBucketCutoff") {
- let points = Math.ceil(bonusValue / parseFloat(100.0) * weight);
- var visitCount = 1; // bonusName == "unvisitedBookmarkBonus" ? 1 : 0;
- frecency = Math.ceil(visitCount * points);
- calculatedURI = uri("http://" + searchTerm + ".com/" +
- bonusName + ":" + bonusValue + "/cutoff:" + cutoff +
- "/weight:" + weight + "/frecency:" + frecency);
- if (bonusName == "unvisitedBookmarkBonus") {
- matchTitle = searchTerm + "UnvisitedBookmark";
- bmsvc.insertBookmark(bmsvc.unfiledBookmarksFolder, calculatedURI, bmsvc.DEFAULT_INDEX, matchTitle);
- }
- else {
- matchTitle = searchTerm + "UnvisitedTyped";
- yield PlacesTestUtils.addVisits({
- uri: calculatedURI,
- title: matchTitle,
- transition: visitType,
- visitDate: now
- });
- histsvc.markPageAsTyped(calculatedURI);
- }
- }
- }
- else {
- // visited
- // visited bookmarks get the visited bookmark bonus twice
- if (visitType == Ci.nsINavHistoryService.TRANSITION_BOOKMARK)
- bonusValue = bonusValue * 2;
-
- let points = Math.ceil(1 * ((bonusValue / parseFloat(100.000000)).toFixed(6) * weight) / 1);
- if (!points) {
- if (visitType == Ci.nsINavHistoryService.TRANSITION_EMBED ||
- visitType == Ci.nsINavHistoryService.TRANSITION_FRAMED_LINK ||
- visitType == Ci.nsINavHistoryService.TRANSITION_DOWNLOAD ||
- visitType == Ci.nsINavHistoryService.TRANSITION_RELOAD ||
- bonusName == "defaultVisitBonus")
- frecency = 0;
- else
- frecency = -1;
- }
- else
- frecency = points;
- calculatedURI = uri("http://" + searchTerm + ".com/" +
- bonusName + ":" + bonusValue + "/cutoff:" + cutoff +
- "/weight:" + weight + "/frecency:" + frecency);
- if (visitType == Ci.nsINavHistoryService.TRANSITION_BOOKMARK) {
- matchTitle = searchTerm + "Bookmarked";
- bmsvc.insertBookmark(bmsvc.unfiledBookmarksFolder, calculatedURI, bmsvc.DEFAULT_INDEX, matchTitle);
- }
- else
- matchTitle = calculatedURI.spec.substr(calculatedURI.spec.lastIndexOf("/")+1);
- yield PlacesTestUtils.addVisits({
- uri: calculatedURI,
- transition: visitType,
- visitDate: dateInPeriod
- });
- }
-
- if (calculatedURI && frecency) {
- results.push([calculatedURI, frecency, matchTitle]);
- yield PlacesTestUtils.addVisits({
- uri: calculatedURI,
- title: matchTitle,
- transition: visitType,
- visitDate: dateInPeriod
- });
- }
- }
-}
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
-
- searches: null,
-
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "",
- disableAutoComplete: false,
- completeDefaultIndex: false,
-
- get searchCount() {
- return this.searches.length;
- },
-
- getSearchAt: function(aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchBegin: function() {},
- onSearchComplete: function() {},
-
- popupOpen: false,
-
- popup: {
- setSelectedIndex: function(aIndex) {},
- invalidate: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompletePopup))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- },
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteInput))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-add_task(function* test_frecency()
-{
- // Disable autoFill for this test.
- Services.prefs.setBoolPref("browser.urlbar.autoFill", false);
- do_register_cleanup(() => Services.prefs.clearUserPref("browser.urlbar.autoFill"));
- for (let bucket of bucketPrefs) {
- yield task_initializeBucket(bucket);
- }
-
- // sort results by frecency
- results.sort((a, b) => b[1] - a[1]);
- // Make sure there's enough results returned
- prefs.setIntPref("browser.urlbar.maxRichResults", results.length);
-
- // DEBUG
- // results.every(function(el) { dump("result: " + el[1] + ": " + el[0].spec + " (" + el[2] + ")\n"); return true; })
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- var controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
- getService(Components.interfaces.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches
- // and confirms results on search complete
- var input = new AutoCompleteInput(["unifiedcomplete"]);
-
- controller.input = input;
-
- // always search in history + bookmarks, no matter what the default is
- prefs.setIntPref("browser.urlbar.search.sources", 3);
- prefs.setIntPref("browser.urlbar.default.behavior", 0);
-
- var numSearchesStarted = 0;
- input.onSearchBegin = function() {
- numSearchesStarted++;
- do_check_eq(numSearchesStarted, 1);
- };
-
- let deferred = Promise.defer();
- input.onSearchComplete = function() {
- do_check_eq(numSearchesStarted, 1);
- do_check_eq(controller.searchStatus,
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
-
- // test that all records with non-zero frecency were matched
- do_check_eq(controller.matchCount, results.length);
-
- // test that matches are sorted by frecency
- for (var i = 0; i < controller.matchCount; i++) {
- let searchURL = controller.getValueAt(i);
- let expectURL = results[i][0].spec;
- if (searchURL == expectURL) {
- do_check_eq(controller.getValueAt(i), results[i][0].spec);
- do_check_eq(controller.getCommentAt(i), results[i][2]);
- } else {
- // If the results didn't match exactly, perhaps it's still the right
- // frecency just in the wrong "order" (order of same frecency is
- // undefined), so check if frecency matches. This is okay because we
- // can still ensure the correct number of expected frecencies.
- let getFrecency = aURL => aURL.match(/frecency:(-?\d+)$/)[1];
- print("### checking for same frecency between '" + searchURL +
- "' and '" + expectURL + "'");
- do_check_eq(getFrecency(searchURL), getFrecency(expectURL));
- }
- }
- deferred.resolve();
- };
-
- controller.startSearch(searchTerm);
-
- yield deferred.promise;
-});
diff --git a/toolkit/components/places/tests/unit/test_1085291.js b/toolkit/components/places/tests/unit/test_1085291.js
deleted file mode 100644
index 3159ff8bc..000000000
--- a/toolkit/components/places/tests/unit/test_1085291.js
+++ /dev/null
@@ -1,42 +0,0 @@
-add_task(function* () {
- // test that nodes inserted by incremental update for bookmarks of all types
- // have the extra bookmark properties (bookmarkGuid, dateAdded, lastModified).
-
- // getFolderContents opens the root node.
- let root = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root;
-
- function* insertAndTest(bmInfo) {
- bmInfo = yield PlacesUtils.bookmarks.insert(bmInfo);
- let node = root.getChild(root.childCount - 1);
- Assert.equal(node.bookmarkGuid, bmInfo.guid);
- Assert.equal(node.dateAdded, bmInfo.dateAdded * 1000);
- Assert.equal(node.lastModified, bmInfo.lastModified * 1000);
- }
-
- // Normal bookmark.
- yield insertAndTest({ parentGuid: root.bookmarkGuid
- , type: PlacesUtils.bookmarks.TYPE_BOOKMARK
- , title: "Test Bookmark"
- , url: "http://test.url.tld" });
-
- // place: query
- yield insertAndTest({ parentGuid: root.bookmarkGuid
- , type: PlacesUtils.bookmarks.TYPE_BOOKMARK
- , title: "Test Query"
- , url: "place:folder=BOOKMARKS_MENU" });
-
- // folder
- yield insertAndTest({ parentGuid: root.bookmarkGuid
- , type: PlacesUtils.bookmarks.TYPE_FOLDER
- , title: "Test Folder" });
-
- // separator
- yield insertAndTest({ parentGuid: root.bookmarkGuid
- , type: PlacesUtils.bookmarks.TYPE_SEPARATOR });
-
- root.containerOpen = false;
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/unit/test_1105208.js b/toolkit/components/places/tests/unit/test_1105208.js
deleted file mode 100644
index 39a27c95f..000000000
--- a/toolkit/components/places/tests/unit/test_1105208.js
+++ /dev/null
@@ -1,24 +0,0 @@
-// Test that result node for folder shortcuts get the target folder title if
-// the shortcut itself has no title set.
-add_task(function* () {
- let shortcutInfo = yield PlacesUtils.bookmarks.insert({
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "place:folder=TOOLBAR"
- });
-
- let unfiledRoot =
- PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
- let shortcutNode = unfiledRoot.getChild(unfiledRoot.childCount - 1);
- Assert.equal(shortcutNode.bookmarkGuid, shortcutInfo.guid);
-
- let toolbarInfo =
- yield PlacesUtils.bookmarks.fetch(PlacesUtils.bookmarks.toolbarGuid);
- Assert.equal(shortcutNode.title, toolbarInfo.title);
-
- unfiledRoot.containerOpen = false;
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/unit/test_1105866.js b/toolkit/components/places/tests/unit/test_1105866.js
deleted file mode 100644
index eb376bbe2..000000000
--- a/toolkit/components/places/tests/unit/test_1105866.js
+++ /dev/null
@@ -1,63 +0,0 @@
-add_task(function* test_folder_shortcuts() {
- let shortcutInfo = yield PlacesUtils.bookmarks.insert({
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "place:folder=TOOLBAR"
- });
-
- let unfiledRoot =
- PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
- let shortcutNode = unfiledRoot.getChild(unfiledRoot.childCount - 1);
- Assert.strictEqual(shortcutNode.itemId,
- yield PlacesUtils.promiseItemId(shortcutInfo.guid));
- Assert.strictEqual(PlacesUtils.asQuery(shortcutNode).folderItemId,
- PlacesUtils.toolbarFolderId);
- Assert.strictEqual(shortcutNode.bookmarkGuid, shortcutInfo.guid);
- Assert.strictEqual(PlacesUtils.asQuery(shortcutNode).targetFolderGuid,
- PlacesUtils.bookmarks.toolbarGuid);
-
- // test that a node added incrementally also behaves just as well.
- shortcutInfo = yield PlacesUtils.bookmarks.insert({
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: "place:folder=BOOKMARKS_MENU"
- });
- shortcutNode = unfiledRoot.getChild(unfiledRoot.childCount - 1);
- Assert.strictEqual(shortcutNode.itemId,
- yield PlacesUtils.promiseItemId(shortcutInfo.guid));
- Assert.strictEqual(PlacesUtils.asQuery(shortcutNode).folderItemId,
- PlacesUtils.bookmarksMenuFolderId);
- Assert.strictEqual(shortcutNode.bookmarkGuid, shortcutInfo.guid);
- Assert.strictEqual(PlacesUtils.asQuery(shortcutNode).targetFolderGuid,
- PlacesUtils.bookmarks.menuGuid);
-
- unfiledRoot.containerOpen = false;
-});
-
-add_task(function* test_plain_folder() {
- let folderInfo = yield PlacesUtils.bookmarks.insert({
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- });
-
- let unfiledRoot =
- PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
- let lastChild = unfiledRoot.getChild(unfiledRoot.childCount - 1);
- Assert.strictEqual(lastChild.bookmarkGuid, folderInfo.guid);
- Assert.strictEqual(PlacesUtils.asQuery(lastChild).targetFolderGuid,
- folderInfo.guid);
-});
-
-add_task(function* test_non_item_query() {
- let options = PlacesUtils.history.getNewQueryOptions();
- let root = PlacesUtils.history.executeQuery(
- PlacesUtils.history.getNewQuery(), options).root;
- Assert.strictEqual(root.itemId, -1);
- Assert.strictEqual(PlacesUtils.asQuery(root).folderItemId, -1);
- Assert.strictEqual(root.bookmarkGuid, "");
- Assert.strictEqual(PlacesUtils.asQuery(root).targetFolderGuid, "");
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/unit/test_317472.js b/toolkit/components/places/tests/unit/test_317472.js
deleted file mode 100644
index a08651916..000000000
--- a/toolkit/components/places/tests/unit/test_317472.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const charset = "UTF-8";
-const CHARSET_ANNO = "URIProperties/characterSet";
-
-const TEST_URI = uri("http://foo.com");
-const TEST_BOOKMARKED_URI = uri("http://bar.com");
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- // add pages to history
- yield PlacesTestUtils.addVisits(TEST_URI);
- yield PlacesTestUtils.addVisits(TEST_BOOKMARKED_URI);
-
- // create bookmarks on TEST_BOOKMARKED_URI
- PlacesUtils.bookmarks.insertBookmark(
- PlacesUtils.unfiledBookmarksFolderId,
- TEST_BOOKMARKED_URI, PlacesUtils.bookmarks.DEFAULT_INDEX,
- TEST_BOOKMARKED_URI.spec);
- PlacesUtils.bookmarks.insertBookmark(
- PlacesUtils.toolbarFolderId,
- TEST_BOOKMARKED_URI, PlacesUtils.bookmarks.DEFAULT_INDEX,
- TEST_BOOKMARKED_URI.spec);
-
- // set charset on not-bookmarked page
- yield PlacesUtils.setCharsetForURI(TEST_URI, charset);
- // set charset on bookmarked page
- yield PlacesUtils.setCharsetForURI(TEST_BOOKMARKED_URI, charset);
-
- // check that we have created a page annotation
- do_check_eq(PlacesUtils.annotations.getPageAnnotation(TEST_URI, CHARSET_ANNO), charset);
-
- // get charset from not-bookmarked page
- do_check_eq((yield PlacesUtils.getCharsetForURI(TEST_URI)), charset);
-
- // get charset from bookmarked page
- do_check_eq((yield PlacesUtils.getCharsetForURI(TEST_BOOKMARKED_URI)), charset);
-
- yield PlacesTestUtils.clearHistory();
-
- // ensure that charset has gone for not-bookmarked page
- do_check_neq((yield PlacesUtils.getCharsetForURI(TEST_URI)), charset);
-
- // check that page annotation has been removed
- try {
- PlacesUtils.annotations.getPageAnnotation(TEST_URI, CHARSET_ANNO);
- do_throw("Charset page annotation has not been removed correctly");
- } catch (e) {}
-
- // ensure that charset still exists for bookmarked page
- do_check_eq((yield PlacesUtils.getCharsetForURI(TEST_BOOKMARKED_URI)), charset);
-
- // remove charset from bookmark and check that has gone
- yield PlacesUtils.setCharsetForURI(TEST_BOOKMARKED_URI, "");
- do_check_neq((yield PlacesUtils.getCharsetForURI(TEST_BOOKMARKED_URI)), charset);
-});
diff --git a/toolkit/components/places/tests/unit/test_331487.js b/toolkit/components/places/tests/unit/test_331487.js
deleted file mode 100644
index 55d41aebf..000000000
--- a/toolkit/components/places/tests/unit/test_331487.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Get history service
-try {
- var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsINavHistoryService);
-} catch (ex) {
- do_throw("Could not get history service\n");
-}
-
-var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-
-// main
-function run_test() {
- // add a folder
- var folder = bmsvc.createFolder(bmsvc.placesRoot, "test folder", bmsvc.DEFAULT_INDEX);
-
- // add a bookmark to the folder
- var b1 = bmsvc.insertBookmark(folder, uri("http://a1.com/"),
- bmsvc.DEFAULT_INDEX, "1 title");
- // add a subfolder
- var sf1 = bmsvc.createFolder(folder, "subfolder 1", bmsvc.DEFAULT_INDEX);
-
- // add a bookmark to the subfolder
- var b2 = bmsvc.insertBookmark(sf1, uri("http://a2.com/"),
- bmsvc.DEFAULT_INDEX, "2 title");
-
- // add a subfolder to the subfolder
- var sf2 = bmsvc.createFolder(sf1, "subfolder 2", bmsvc.DEFAULT_INDEX);
-
- // add a bookmark to the subfolder of the subfolder
- var b3 = bmsvc.insertBookmark(sf2, uri("http://a3.com/"),
- bmsvc.DEFAULT_INDEX, "3 title");
-
- // bookmark query that should result in the "hierarchical" result
- // because there is one query, one folder,
- // no begin time, no end time, no domain, no uri, no search term
- // and no max results. See GetSimpleBookmarksQueryFolder()
- // for more details.
- var options = histsvc.getNewQueryOptions();
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
- var query = histsvc.getNewQuery();
- query.setFolders([folder], 1);
- var result = histsvc.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 2);
- do_check_eq(root.getChild(0).itemId, b1);
- do_check_eq(root.getChild(1).itemId, sf1);
-
- // check the contents of the subfolder
- var sf1Node = root.getChild(1);
- sf1Node = sf1Node.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- sf1Node.containerOpen = true;
- do_check_eq(sf1Node.childCount, 2);
- do_check_eq(sf1Node.getChild(0).itemId, b2);
- do_check_eq(sf1Node.getChild(1).itemId, sf2);
-
- // check the contents of the subfolder's subfolder
- var sf2Node = sf1Node.getChild(1);
- sf2Node = sf2Node.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- sf2Node.containerOpen = true;
- do_check_eq(sf2Node.childCount, 1);
- do_check_eq(sf2Node.getChild(0).itemId, b3);
-
- sf2Node.containerOpen = false;
- sf1Node.containerOpen = false;
- root.containerOpen = false;
-
- // bookmark query that should result in a flat list
- // because we specified max results
- options = histsvc.getNewQueryOptions();
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
- options.maxResults = 10;
- query = histsvc.getNewQuery();
- query.setFolders([folder], 1);
- result = histsvc.executeQuery(query, options);
- root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 3);
- do_check_eq(root.getChild(0).itemId, b1);
- do_check_eq(root.getChild(1).itemId, b2);
- do_check_eq(root.getChild(2).itemId, b3);
- root.containerOpen = false;
-
- // XXX TODO
- // test that if we have: more than one query,
- // multiple folders, a begin time, an end time, a domain, a uri
- // or a search term, that we get the (correct) flat list results
- // (like we do when specified maxResults)
-}
diff --git a/toolkit/components/places/tests/unit/test_384370.js b/toolkit/components/places/tests/unit/test_384370.js
deleted file mode 100644
index ec6f43683..000000000
--- a/toolkit/components/places/tests/unit/test_384370.js
+++ /dev/null
@@ -1,173 +0,0 @@
-const LOAD_IN_SIDEBAR_ANNO = "bookmarkProperties/loadInSidebar";
-const DESCRIPTION_ANNO = "bookmarkProperties/description";
-
-var tagData = [
- { uri: uri("http://slint.us"), tags: ["indie", "kentucky", "music"] },
- { uri: uri("http://en.wikipedia.org/wiki/Diplodocus"), tags: ["dinosaur", "dj", "rad word"] }
-];
-
-var bookmarkData = [
- { uri: uri("http://slint.us"), title: "indie, kentucky, music" },
- { uri: uri("http://en.wikipedia.org/wiki/Diplodocus"), title: "dinosaur, dj, rad word" }
-];
-
-function run_test() {
- run_next_test();
-}
-
-/*
- HTML+FEATURES SUMMARY:
- - import legacy bookmarks
- - export as json, import, test (tests integrity of html > json)
- - export as html, import, test (tests integrity of json > html)
-
- BACKUP/RESTORE SUMMARY:
- - create a bookmark in each root
- - tag multiple URIs with multiple tags
- - export as json, import, test
-*/
-add_task(function* () {
- // Remove eventual bookmarks.exported.json.
- let jsonFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.exported.json");
- if ((yield OS.File.exists(jsonFile)))
- yield OS.File.remove(jsonFile);
-
- // Test importing a pre-Places canonical bookmarks file.
- // Note: we do not empty the db before this import to catch bugs like 380999
- let htmlFile = OS.Path.join(do_get_cwd().path, "bookmarks.preplaces.html");
- yield BookmarkHTMLUtils.importFromFile(htmlFile, true);
-
- // Populate the database.
- for (let { uri, tags } of tagData) {
- PlacesUtils.tagging.tagURI(uri, tags);
- }
- for (let { uri, title } of bookmarkData) {
- yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: uri,
- title });
- }
- for (let { uri, title } of bookmarkData) {
- yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- url: uri,
- title });
- }
-
- yield validate();
-
- // Test exporting a Places canonical json file.
- // 1. export to bookmarks.exported.json
- yield BookmarkJSONUtils.exportToFile(jsonFile);
- do_print("exported json");
-
- // 2. empty bookmarks db
- // 3. import bookmarks.exported.json
- yield BookmarkJSONUtils.importFromFile(jsonFile, true);
- do_print("imported json");
-
- // 4. run the test-suite
- yield validate();
- do_print("validated import");
-});
-
-function* validate() {
- yield testMenuBookmarks();
- yield testToolbarBookmarks();
- testUnfiledBookmarks();
- testTags();
- yield PlacesTestUtils.promiseAsyncUpdates();
-}
-
-// Tests a bookmarks datastore that has a set of bookmarks, etc
-// that flex each supported field and feature.
-function* testMenuBookmarks() {
- let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarksMenuFolderId).root;
- Assert.equal(root.childCount, 3);
-
- let separatorNode = root.getChild(1);
- Assert.equal(separatorNode.type, separatorNode.RESULT_TYPE_SEPARATOR);
-
- let folderNode = root.getChild(2);
- Assert.equal(folderNode.type, folderNode.RESULT_TYPE_FOLDER);
- Assert.equal(folderNode.title, "test");
- let folder = yield PlacesUtils.bookmarks.fetch(folderNode.bookmarkGuid);
- Assert.equal(folder.dateAdded.getTime(), 1177541020000);
-
- Assert.equal(PlacesUtils.asQuery(folderNode).hasChildren, true);
-
- Assert.equal("folder test comment",
- PlacesUtils.annotations.getItemAnnotation(folderNode.itemId,
- DESCRIPTION_ANNO));
-
- // open test folder, and test the children
- folderNode.containerOpen = true;
- Assert.equal(folderNode.childCount, 1);
-
- let bookmarkNode = folderNode.getChild(0);
- Assert.equal("http://test/post", bookmarkNode.uri);
- Assert.equal("test post keyword", bookmarkNode.title);
- Assert.ok(PlacesUtils.annotations.itemHasAnnotation(bookmarkNode.itemId,
- LOAD_IN_SIDEBAR_ANNO));
- Assert.equal(bookmarkNode.dateAdded, 1177375336000000);
-
- let entry = yield PlacesUtils.keywords.fetch({ url: bookmarkNode.uri });
- Assert.equal("test", entry.keyword);
- Assert.equal("hidden1%3Dbar&text1%3D%25s", entry.postData);
-
- Assert.equal("ISO-8859-1",
- (yield PlacesUtils.getCharsetForURI(NetUtil.newURI(bookmarkNode.uri))));
- Assert.equal("item description",
- PlacesUtils.annotations.getItemAnnotation(bookmarkNode.itemId,
- DESCRIPTION_ANNO));
-
- folderNode.containerOpen = false;
- root.containerOpen = false;
-}
-
-function* testToolbarBookmarks() {
- let root = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root;
-
- // child count (add 2 for pre-existing items)
- Assert.equal(root.childCount, bookmarkData.length + 2);
-
- let livemarkNode = root.getChild(1);
- Assert.equal("Latest Headlines", livemarkNode.title);
-
- let livemark = yield PlacesUtils.livemarks.getLivemark({ id: livemarkNode.itemId });
- Assert.equal("http://en-us.fxfeeds.mozilla.com/en-US/firefox/livebookmarks/",
- livemark.siteURI.spec);
- Assert.equal("http://en-us.fxfeeds.mozilla.com/en-US/firefox/headlines.xml",
- livemark.feedURI.spec);
-
- // test added bookmark data
- let bookmarkNode = root.getChild(2);
- Assert.equal(bookmarkNode.uri, bookmarkData[0].uri.spec);
- Assert.equal(bookmarkNode.title, bookmarkData[0].title);
- bookmarkNode = root.getChild(3);
- Assert.equal(bookmarkNode.uri, bookmarkData[1].uri.spec);
- Assert.equal(bookmarkNode.title, bookmarkData[1].title);
-
- root.containerOpen = false;
-}
-
-function testUnfiledBookmarks() {
- let root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
- // child count (add 1 for pre-existing item)
- Assert.equal(root.childCount, bookmarkData.length + 1);
- for (let i = 1; i < root.childCount; ++i) {
- let child = root.getChild(i);
- Assert.equal(child.uri, bookmarkData[i - 1].uri.spec);
- Assert.equal(child.title, bookmarkData[i - 1].title);
- if (child.tags)
- Assert.equal(child.tags, bookmarkData[i - 1].title);
- }
- root.containerOpen = false;
-}
-
-function testTags() {
- for (let { uri, tags } of tagData) {
- do_print("Test tags for " + uri.spec + ": " + tags + "\n");
- let foundTags = PlacesUtils.tagging.getTagsForURI(uri);
- Assert.equal(foundTags.length, tags.length);
- Assert.ok(tags.every(tag => foundTags.includes(tag)));
- }
-}
diff --git a/toolkit/components/places/tests/unit/test_385397.js b/toolkit/components/places/tests/unit/test_385397.js
deleted file mode 100644
index 4b60d4768..000000000
--- a/toolkit/components/places/tests/unit/test_385397.js
+++ /dev/null
@@ -1,142 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const TOTAL_SITES = 20;
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- let now = (Date.now() - 10000) * 1000;
-
- for (let i = 0; i < TOTAL_SITES; i++) {
- let site = "http://www.test-" + i + ".com/";
- let testURI = uri(site);
- let testImageURI = uri(site + "blank.gif");
- let when = now + (i * TOTAL_SITES * 1000);
- yield PlacesTestUtils.addVisits([
- { uri: testURI, visitDate: when, transition: TRANSITION_TYPED },
- { uri: testImageURI, visitDate: when + 1000, transition: TRANSITION_EMBED },
- { uri: testImageURI, visitDate: when + 2000, transition: TRANSITION_FRAMED_LINK },
- { uri: testURI, visitDate: when + 3000, transition: TRANSITION_LINK },
- ]);
- }
-
- // verify our visits AS_VISIT, ordered by date descending
- // including hidden
- // we should get 80 visits:
- // http://www.test-19.com/
- // http://www.test-19.com/blank.gif
- // http://www.test-19.com/
- // http://www.test-19.com/
- // ...
- // http://www.test-0.com/
- // http://www.test-0.com/blank.gif
- // http://www.test-0.com/
- // http://www.test-0.com/
- let options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_DATE_DESCENDING;
- options.resultType = options.RESULTS_AS_VISIT;
- options.includeHidden = true;
- let root = PlacesUtils.history.executeQuery(PlacesUtils.history.getNewQuery(),
- options).root;
- root.containerOpen = true;
- let cc = root.childCount;
- // Embed visits are not added to the database, thus they won't appear.
- do_check_eq(cc, 3 * TOTAL_SITES);
- for (let i = 0; i < TOTAL_SITES; i++) {
- let index = i * 3;
- let node = root.getChild(index);
- let site = "http://www.test-" + (TOTAL_SITES - 1 - i) + ".com/";
- do_check_eq(node.uri, site);
- do_check_eq(node.type, Ci.nsINavHistoryResultNode.RESULT_TYPE_URI);
- node = root.getChild(++index);
- do_check_eq(node.uri, site + "blank.gif");
- do_check_eq(node.type, Ci.nsINavHistoryResultNode.RESULT_TYPE_URI);
- node = root.getChild(++index);
- do_check_eq(node.uri, site);
- do_check_eq(node.type, Ci.nsINavHistoryResultNode.RESULT_TYPE_URI);
- }
- root.containerOpen = false;
-
- // verify our visits AS_VISIT, ordered by date descending
- // we should get 40 visits:
- // http://www.test-19.com/
- // http://www.test-19.com/
- // ...
- // http://www.test-0.com/
- // http://www.test-0.com/
- options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_DATE_DESCENDING;
- options.resultType = options.RESULTS_AS_VISIT;
- root = PlacesUtils.history.executeQuery(PlacesUtils.history.getNewQuery(),
- options).root;
- root.containerOpen = true;
- cc = root.childCount;
- // 2 * TOTAL_SITES because we count the TYPED and LINK, but not EMBED or FRAMED
- do_check_eq(cc, 2 * TOTAL_SITES);
- for (let i=0; i < TOTAL_SITES; i++) {
- let index = i * 2;
- let node = root.getChild(index);
- let site = "http://www.test-" + (TOTAL_SITES - 1 - i) + ".com/";
- do_check_eq(node.uri, site);
- do_check_eq(node.type, Ci.nsINavHistoryResultNode.RESULT_TYPE_URI);
- node = root.getChild(++index);
- do_check_eq(node.uri, site);
- do_check_eq(node.type, Ci.nsINavHistoryResultNode.RESULT_TYPE_URI);
- }
- root.containerOpen = false;
-
- // test our optimized query for the places menu
- // place:type=0&sort=4&maxResults=10
- // verify our visits AS_URI, ordered by date descending
- // we should get 10 visits:
- // http://www.test-19.com/
- // ...
- // http://www.test-10.com/
- options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_DATE_DESCENDING;
- options.maxResults = 10;
- options.resultType = options.RESULTS_AS_URI;
- root = PlacesUtils.history.executeQuery(PlacesUtils.history.getNewQuery(),
- options).root;
- root.containerOpen = true;
- cc = root.childCount;
- do_check_eq(cc, options.maxResults);
- for (let i=0; i < cc; i++) {
- let node = root.getChild(i);
- let site = "http://www.test-" + (TOTAL_SITES - 1 - i) + ".com/";
- do_check_eq(node.uri, site);
- do_check_eq(node.type, Ci.nsINavHistoryResultNode.RESULT_TYPE_URI);
- }
- root.containerOpen = false;
-
- // test without a maxResults, which executes a different query
- // but the first 10 results should be the same.
- // verify our visits AS_URI, ordered by date descending
- // we should get 20 visits, but the first 10 should be
- // http://www.test-19.com/
- // ...
- // http://www.test-10.com/
- options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_DATE_DESCENDING;
- options.resultType = options.RESULTS_AS_URI;
- root = PlacesUtils.history.executeQuery(PlacesUtils.history.getNewQuery(),
- options).root;
- root.containerOpen = true;
- cc = root.childCount;
- do_check_eq(cc, TOTAL_SITES);
- for (let i=0; i < 10; i++) {
- let node = root.getChild(i);
- let site = "http://www.test-" + (TOTAL_SITES - 1 - i) + ".com/";
- do_check_eq(node.uri, site);
- do_check_eq(node.type, Ci.nsINavHistoryResultNode.RESULT_TYPE_URI);
- }
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/unit/test_399264_query_to_string.js b/toolkit/components/places/tests/unit/test_399264_query_to_string.js
deleted file mode 100644
index 6e6cc279c..000000000
--- a/toolkit/components/places/tests/unit/test_399264_query_to_string.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Obtains the id of the folder obtained from the query.
- *
- * @param aFolderID
- * The id of the folder we want to generate a query for.
- * @returns the string representation of the query for the given folder.
- */
-function query_string(aFolderID)
-{
- var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-
- var query = hs.getNewQuery();
- query.setFolders([aFolderID], 1);
- var options = hs.getNewQueryOptions();
- return hs.queriesToQueryString([query], 1, options);
-}
-
-function run_test()
-{
- var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-
- const QUERIES = [
- "folder=PLACES_ROOT"
- , "folder=BOOKMARKS_MENU"
- , "folder=TAGS"
- , "folder=UNFILED_BOOKMARKS"
- , "folder=TOOLBAR"
- ];
- const FOLDER_IDS = [
- bs.placesRoot
- , bs.bookmarksMenuFolder
- , bs.tagsFolder
- , bs.unfiledBookmarksFolder
- , bs.toolbarFolder
- ];
-
-
- for (var i = 0; i < QUERIES.length; i++) {
- var result = query_string(FOLDER_IDS[i]);
- dump("Looking for '" + QUERIES[i] + "' in '" + result + "'\n");
- do_check_neq(-1, result.indexOf(QUERIES[i]));
- }
-}
diff --git a/toolkit/components/places/tests/unit/test_399264_string_to_query.js b/toolkit/components/places/tests/unit/test_399264_string_to_query.js
deleted file mode 100644
index bd29316d9..000000000
--- a/toolkit/components/places/tests/unit/test_399264_string_to_query.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Obtains the id of the folder obtained from the query.
- *
- * @param aQuery
- * The query to obtain the folder id from.
- * @returns the folder id of the folder of the root node of the query.
- */
-function folder_id(aQuery)
-{
- var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-
- dump("Checking query '" + aQuery + "'\n");
- var options = { };
- var queries = { };
- var size = { };
- hs.queryStringToQueries(aQuery, queries, size, options);
- var result = hs.executeQueries(queries.value, size.value, options.value);
- var root = result.root;
- root.containerOpen = true;
- do_check_true(root.hasChildren);
- var folderID = root.getChild(0).parent.itemId;
- root.containerOpen = false;
- return folderID;
-}
-
-function run_test()
-{
- var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-
- const QUERIES = [
- "place:folder=PLACES_ROOT"
- , "place:folder=BOOKMARKS_MENU"
- , "place:folder=TAGS"
- , "place:folder=UNFILED_BOOKMARKS"
- , "place:folder=TOOLBAR"
- ];
- const FOLDER_IDS = [
- bs.placesRoot
- , bs.bookmarksMenuFolder
- , bs.tagsFolder
- , bs.unfiledBookmarksFolder
- , bs.toolbarFolder
- ];
-
- // add something in the bookmarks menu folder so a query to it returns results
- bs.insertBookmark(bs.bookmarksMenuFolder, uri("http://example.com/bmf/"),
- Ci.nsINavBookmarksService.DEFAULT_INDEX, "bmf");
-
- // add something to the tags folder
- var ts = Cc["@mozilla.org/browser/tagging-service;1"].
- getService(Ci.nsITaggingService);
- ts.tagURI(uri("http://www.example.com/"), ["tag"]);
-
- // add something to the unfiled bookmarks folder
- bs.insertBookmark(bs.unfiledBookmarksFolder, uri("http://example.com/ubf/"),
- Ci.nsINavBookmarksService.DEFAULT_INDEX, "ubf");
-
- // add something to the toolbar folder
- bs.insertBookmark(bs.toolbarFolder, uri("http://example.com/tf/"),
- Ci.nsINavBookmarksService.DEFAULT_INDEX, "tf");
-
- for (var i = 0; i < QUERIES.length; i++) {
- var result = folder_id(QUERIES[i]);
- dump("expected " + FOLDER_IDS[i] + ", got " + result + "\n");
- do_check_eq(FOLDER_IDS[i], result);
- }
-}
diff --git a/toolkit/components/places/tests/unit/test_399266.js b/toolkit/components/places/tests/unit/test_399266.js
deleted file mode 100644
index 296d69414..000000000
--- a/toolkit/components/places/tests/unit/test_399266.js
+++ /dev/null
@@ -1,78 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const TOTAL_SITES = 20;
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- let places = [];
- for (let i = 0; i < TOTAL_SITES; i++) {
- for (let j = 0; j <= i; j++) {
- places.push({ uri: uri("http://www.test-" + i + ".com/"),
- transition: TRANSITION_TYPED });
- // because these are embedded visits, they should not show up on our
- // query results. If they do, we have a problem.
- places.push({ uri: uri("http://www.hidden.com/hidden.gif"),
- transition: TRANSITION_EMBED });
- places.push({ uri: uri("http://www.alsohidden.com/hidden.gif"),
- transition: TRANSITION_FRAMED_LINK });
- }
- }
- yield PlacesTestUtils.addVisits(places);
-
- // test our optimized query for the "Most Visited" item
- // in the "Smart Bookmarks" folder
- // place:queryType=0&sort=8&maxResults=10
- // verify our visits AS_URI, ordered by visit count descending
- // we should get 10 visits:
- // http://www.test-19.com/
- // ...
- // http://www.test-10.com/
- let options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_VISITCOUNT_DESCENDING;
- options.maxResults = 10;
- options.resultType = options.RESULTS_AS_URI;
- let root = PlacesUtils.history.executeQuery(PlacesUtils.history.getNewQuery(),
- options).root;
- root.containerOpen = true;
- let cc = root.childCount;
- do_check_eq(cc, options.maxResults);
- for (let i = 0; i < cc; i++) {
- let node = root.getChild(i);
- let site = "http://www.test-" + (TOTAL_SITES - 1 - i) + ".com/";
- do_check_eq(node.uri, site);
- do_check_eq(node.type, Ci.nsINavHistoryResultNode.RESULT_TYPE_URI);
- }
- root.containerOpen = false;
-
- // test without a maxResults, which executes a different query
- // but the first 10 results should be the same.
- // verify our visits AS_URI, ordered by visit count descending
- // we should get 20 visits, but the first 10 should be
- // http://www.test-19.com/
- // ...
- // http://www.test-10.com/
- options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_VISITCOUNT_DESCENDING;
- options.resultType = options.RESULTS_AS_URI;
- root = PlacesUtils.history.executeQuery(PlacesUtils.history.getNewQuery(),
- options).root;
- root.containerOpen = true;
- cc = root.childCount;
- do_check_eq(cc, TOTAL_SITES);
- for (let i = 0; i < 10; i++) {
- let node = root.getChild(i);
- let site = "http://www.test-" + (TOTAL_SITES - 1 - i) + ".com/";
- do_check_eq(node.uri, site);
- do_check_eq(node.type, Ci.nsINavHistoryResultNode.RESULT_TYPE_URI);
- }
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/unit/test_402799.js b/toolkit/components/places/tests/unit/test_402799.js
deleted file mode 100644
index 263e20aa5..000000000
--- a/toolkit/components/places/tests/unit/test_402799.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Get history services
-try {
- var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
- var bhist = histsvc.QueryInterface(Ci.nsIBrowserHistory);
-} catch (ex) {
- do_throw("Could not get history services\n");
-}
-
-// Get bookmark service
-try {
- var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-}
-catch (ex) {
- do_throw("Could not get the nav-bookmarks-service\n");
-}
-
-// Get tagging service
-try {
- var tagssvc = Cc["@mozilla.org/browser/tagging-service;1"].
- getService(Ci.nsITaggingService);
-} catch (ex) {
- do_throw("Could not get tagging service\n");
-}
-
-
-// main
-function run_test() {
- var uri1 = uri("http://foo.bar/");
-
- // create 2 bookmarks on the same uri
- bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, uri1,
- bmsvc.DEFAULT_INDEX, "title 1");
- bmsvc.insertBookmark(bmsvc.toolbarFolder, uri1,
- bmsvc.DEFAULT_INDEX, "title 2");
- // add some tags
- tagssvc.tagURI(uri1, ["foo", "bar", "foobar", "foo bar"]);
-
- // check that a generic bookmark query returns only real bookmarks
- var options = histsvc.getNewQueryOptions();
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
-
- var query = histsvc.getNewQuery();
- var result = histsvc.executeQuery(query, options);
- var root = result.root;
-
- root.containerOpen = true;
- var cc = root.childCount;
- do_check_eq(cc, 2);
- var node1 = root.getChild(0);
- do_check_eq(bmsvc.getFolderIdForItem(node1.itemId), bmsvc.bookmarksMenuFolder);
- var node2 = root.getChild(1);
- do_check_eq(bmsvc.getFolderIdForItem(node2.itemId), bmsvc.toolbarFolder);
- root.containerOpen = false;
-}
diff --git a/toolkit/components/places/tests/unit/test_405497.js b/toolkit/components/places/tests/unit/test_405497.js
deleted file mode 100644
index 951302b84..000000000
--- a/toolkit/components/places/tests/unit/test_405497.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-
-/**
- * The callback object for runInBatchMode.
- *
- * @param aService
- * Takes a reference to the history service or the bookmark service.
- * This determines which service should be called when calling the second
- * runInBatchMode the second time.
- */
-function callback(aService)
-{
- this.callCount = 0;
- this.service = aService;
-}
-callback.prototype = {
- // nsINavHistoryBatchCallback
-
- runBatched: function(aUserData)
- {
- this.callCount++;
-
- if (this.callCount == 1) {
- // We want to call run in batched once more.
- this.service.runInBatchMode(this, null);
- return;
- }
-
- do_check_eq(this.callCount, 2);
- do_test_finished();
- },
-
- // nsISupports
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryBatchCallback])
-};
-
-function run_test() {
- // checking the history service
- do_test_pending();
- hs.runInBatchMode(new callback(hs), null);
-
- // checking the bookmark service
- do_test_pending();
- bs.runInBatchMode(new callback(bs), null);
-}
diff --git a/toolkit/components/places/tests/unit/test_408221.js b/toolkit/components/places/tests/unit/test_408221.js
deleted file mode 100644
index 2b41ce1a2..000000000
--- a/toolkit/components/places/tests/unit/test_408221.js
+++ /dev/null
@@ -1,165 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var current_test = 0;
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
-
- searches: null,
-
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "",
- disableAutoComplete: false,
- completeDefaultIndex: false,
-
- get searchCount() {
- return this.searches.length;
- },
-
- getSearchAt: function(aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchBegin: function() {},
- onSearchComplete: function() {},
-
- popupOpen: false,
-
- popup: {
- setSelectedIndex: function(aIndex) {},
- invalidate: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompletePopup))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- },
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteInput))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-// Get tagging service
-try {
- var tagssvc = Cc["@mozilla.org/browser/tagging-service;1"].
- getService(Ci.nsITaggingService);
-} catch (ex) {
- do_throw("Could not get tagging service\n");
-}
-
-function ensure_tag_results(uris, searchTerm)
-{
- var controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
- getService(Components.interfaces.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches
- // and confirms results on search complete
- var input = new AutoCompleteInput(["unifiedcomplete"]);
-
- controller.input = input;
-
- // Search is asynchronous, so don't let the test finish immediately
- do_test_pending();
-
- var numSearchesStarted = 0;
- input.onSearchBegin = function() {
- numSearchesStarted++;
- do_check_eq(numSearchesStarted, 1);
- };
-
- input.onSearchComplete = function() {
- do_check_eq(numSearchesStarted, 1);
- do_check_eq(controller.searchStatus,
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
- do_check_eq(controller.matchCount, uris.length);
- let vals = [];
- for (let i=0; i<controller.matchCount; i++) {
- // Keep the URL for later because order of tag results is undefined
- vals.push(controller.getValueAt(i));
- do_check_eq(controller.getStyleAt(i), "bookmark-tag");
- }
- // Sort the results then check if we have the right items
- vals.sort().forEach((val, i) => do_check_eq(val, uris[i].spec))
-
- if (current_test < (tests.length - 1)) {
- current_test++;
- tests[current_test]();
- }
-
- do_test_finished();
- };
-
- controller.startSearch(searchTerm);
-}
-
-var uri1 = uri("http://site.tld/1");
-var uri2 = uri("http://site.tld/2");
-var uri3 = uri("http://site.tld/3");
-var uri4 = uri("http://site.tld/4");
-var uri5 = uri("http://site.tld/5");
-var uri6 = uri("http://site.tld/6");
-
-var tests = [function() { ensure_tag_results([uri1, uri2, uri3], "foo"); },
- function() { ensure_tag_results([uri1, uri2, uri3], "Foo"); },
- function() { ensure_tag_results([uri1, uri2, uri3], "foO"); },
- function() { ensure_tag_results([uri4, uri5, uri6], "bar mud"); },
- function() { ensure_tag_results([uri4, uri5, uri6], "BAR MUD"); },
- function() { ensure_tag_results([uri4, uri5, uri6], "Bar Mud"); }];
-
-/**
- * Properly tags a uri adding it to bookmarks.
- *
- * @param aURI
- * The nsIURI to tag.
- * @param aTags
- * The tags to add.
- */
-function tagURI(aURI, aTags) {
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- aURI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "A title");
- tagssvc.tagURI(aURI, aTags);
-}
-
-/**
- * Test bug #408221
- */
-function run_test() {
- // always search in history + bookmarks, no matter what the default is
- var prefs = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
- prefs.setIntPref("browser.urlbar.search.sources", 3);
- prefs.setIntPref("browser.urlbar.default.behavior", 0);
-
- tagURI(uri1, ["Foo"]);
- tagURI(uri2, ["FOO"]);
- tagURI(uri3, ["foO"]);
- tagURI(uri4, ["BAR"]);
- tagURI(uri4, ["MUD"]);
- tagURI(uri5, ["bar"]);
- tagURI(uri5, ["mud"]);
- tagURI(uri6, ["baR"]);
- tagURI(uri6, ["muD"]);
-
- tests[0]();
-}
diff --git a/toolkit/components/places/tests/unit/test_412132.js b/toolkit/components/places/tests/unit/test_412132.js
deleted file mode 100644
index 827391f18..000000000
--- a/toolkit/components/places/tests/unit/test_412132.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * TEST DESCRIPTION:
- *
- * Tests patch to Bug 412132:
- * https://bugzilla.mozilla.org/show_bug.cgi?id=412132
- */
-
-add_task(function* changeuri_unvisited_bookmark()
-{
- do_print("After changing URI of bookmark, frecency of bookmark's " +
- "original URI should be zero if original URI is unvisited and " +
- "no longer bookmarked.");
- const TEST_URI = NetUtil.newURI("http://example.com/1");
- let id = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- TEST_URI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark title");
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("Bookmarked => frecency of URI should be != 0");
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- PlacesUtils.bookmarks.changeBookmarkURI(id, uri("http://example.com/2"));
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("Unvisited URI no longer bookmarked => frecency should = 0");
- do_check_eq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* changeuri_visited_bookmark()
-{
- do_print("After changing URI of bookmark, frecency of bookmark's " +
- "original URI should not be zero if original URI is visited.");
- const TEST_URI = NetUtil.newURI("http://example.com/1");
- let id = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- TEST_URI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark title");
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("Bookmarked => frecency of URI should be != 0");
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesTestUtils.addVisits(TEST_URI);
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- PlacesUtils.bookmarks.changeBookmarkURI(id, uri("http://example.com/2"));
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("*Visited* URI no longer bookmarked => frecency should != 0");
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* changeuri_bookmark_still_bookmarked()
-{
- do_print("After changing URI of bookmark, frecency of bookmark's " +
- "original URI should not be zero if original URI is still " +
- "bookmarked.");
- const TEST_URI = NetUtil.newURI("http://example.com/1");
- let id1 = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- TEST_URI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark 1 title");
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- TEST_URI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark 2 title");
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("Bookmarked => frecency of URI should be != 0");
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- PlacesUtils.bookmarks.changeBookmarkURI(id1, uri("http://example.com/2"));
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("URI still bookmarked => frecency should != 0");
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* changeuri_nonexistent_bookmark()
-{
- do_print("Changing the URI of a nonexistent bookmark should fail.");
- function tryChange(itemId)
- {
- try {
- PlacesUtils.bookmarks.changeBookmarkURI(itemId + 1, uri("http://example.com/2"));
- do_throw("Nonexistent bookmark should throw.");
- }
- catch (ex) {}
- }
-
- // First try a straight-up bogus item ID, one greater than the current max
- // ID.
- let stmt = DBConn().createStatement("SELECT MAX(id) FROM moz_bookmarks");
- stmt.executeStep();
- let maxId = stmt.getInt32(0);
- stmt.finalize();
- tryChange(maxId + 1);
-
- // Now add a bookmark, delete it, and check.
- let id = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- uri("http://example.com/"),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark title");
- PlacesUtils.bookmarks.removeItem(id);
- tryChange(id);
-
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-});
-
-function run_test()
-{
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/unit/test_413784.js b/toolkit/components/places/tests/unit/test_413784.js
deleted file mode 100644
index 6df4dfbbb..000000000
--- a/toolkit/components/places/tests/unit/test_413784.js
+++ /dev/null
@@ -1,118 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
-
-Test autocomplete for non-English URLs
-
-- add a visit for a page with a non-English URL
-- search
-- test number of matches (should be exactly one)
-
-*/
-
-var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-
-// create test data
-var searchTerm = "ユニコード";
-var decoded = "http://www.foobar.com/" + searchTerm + "/";
-var url = uri(decoded);
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
-
- searches: null,
-
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "",
- disableAutoComplete: false,
- completeDefaultIndex: false,
-
- get searchCount() {
- return this.searches.length;
- },
-
- getSearchAt: function(aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchBegin: function() {},
- onSearchComplete: function() {},
-
- popupOpen: false,
-
- popup: {
- setSelectedIndex: function(aIndex) {},
- invalidate: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompletePopup))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- },
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteInput))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-function run_test()
-{
- do_test_pending();
- PlacesTestUtils.addVisits(url).then(continue_test);
-}
-
-function continue_test()
-{
- var controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
- getService(Components.interfaces.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches
- // and confirms results on search complete
- var input = new AutoCompleteInput(["unifiedcomplete"]);
-
- controller.input = input;
-
- var numSearchesStarted = 0;
- input.onSearchBegin = function() {
- numSearchesStarted++;
- do_check_eq(numSearchesStarted, 1);
- };
-
- input.onSearchComplete = function() {
- do_check_eq(numSearchesStarted, 1);
- do_check_eq(controller.searchStatus,
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
-
- // test that we found the entry we added
- do_check_eq(controller.matchCount, 1);
-
- // Make sure the url is the same according to spec, so it can be deleted
- do_check_eq(controller.getValueAt(0), url.spec);
-
- do_test_finished();
- };
-
- controller.startSearch(searchTerm);
-}
diff --git a/toolkit/components/places/tests/unit/test_415460.js b/toolkit/components/places/tests/unit/test_415460.js
deleted file mode 100644
index f2e049f09..000000000
--- a/toolkit/components/places/tests/unit/test_415460.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-
-/**
- * Checks to see that a search has exactly one result in the database.
- *
- * @param aTerms
- * The terms to search for.
- * @returns true if the search returns one result, false otherwise.
- */
-function search_has_result(aTerms)
-{
- var options = hs.getNewQueryOptions();
- options.maxResults = 1;
- options.resultType = options.RESULTS_AS_URI;
- var query = hs.getNewQuery();
- query.searchTerms = aTerms;
- var result = hs.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- var cc = root.childCount;
- root.containerOpen = false;
- return (cc == 1);
-}
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- const SEARCH_TERM = "ユニコード";
- const TEST_URL = "http://example.com/" + SEARCH_TERM + "/";
- yield PlacesTestUtils.addVisits(uri(TEST_URL));
- do_check_true(search_has_result(SEARCH_TERM));
-});
diff --git a/toolkit/components/places/tests/unit/test_415757.js b/toolkit/components/places/tests/unit/test_415757.js
deleted file mode 100644
index afd396183..000000000
--- a/toolkit/components/places/tests/unit/test_415757.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Checks to see that a URI is in the database.
- *
- * @param aURI
- * The URI to check.
- * @returns true if the URI is in the DB, false otherwise.
- */
-function uri_in_db(aURI) {
- var options = PlacesUtils.history.getNewQueryOptions();
- options.maxResults = 1;
- options.resultType = options.RESULTS_AS_URI
- var query = PlacesUtils.history.getNewQuery();
- query.uri = aURI;
- var result = PlacesUtils.history.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- var cc = root.childCount;
- root.containerOpen = false;
- return (cc == 1);
-}
-
-const TOTAL_SITES = 20;
-
-// main
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- // add pages to global history
- for (let i = 0; i < TOTAL_SITES; i++) {
- let site = "http://www.test-" + i + ".com/";
- let testURI = uri(site);
- let when = Date.now() * 1000 + (i * TOTAL_SITES);
- yield PlacesTestUtils.addVisits({ uri: testURI, visitDate: when });
- }
- for (let i = 0; i < TOTAL_SITES; i++) {
- let site = "http://www.test.com/" + i + "/";
- let testURI = uri(site);
- let when = Date.now() * 1000 + (i * TOTAL_SITES);
- yield PlacesTestUtils.addVisits({ uri: testURI, visitDate: when });
- }
-
- // set a page annotation on one of the urls that will be removed
- var testAnnoDeletedURI = uri("http://www.test.com/1/");
- var testAnnoDeletedName = "foo";
- var testAnnoDeletedValue = "bar";
- PlacesUtils.annotations.setPageAnnotation(testAnnoDeletedURI,
- testAnnoDeletedName,
- testAnnoDeletedValue, 0,
- PlacesUtils.annotations.EXPIRE_WITH_HISTORY);
-
- // set a page annotation on one of the urls that will NOT be removed
- var testAnnoRetainedURI = uri("http://www.test-1.com/");
- var testAnnoRetainedName = "foo";
- var testAnnoRetainedValue = "bar";
- PlacesUtils.annotations.setPageAnnotation(testAnnoRetainedURI,
- testAnnoRetainedName,
- testAnnoRetainedValue, 0,
- PlacesUtils.annotations.EXPIRE_WITH_HISTORY);
-
- // remove pages from www.test.com
- PlacesUtils.history.removePagesFromHost("www.test.com", false);
-
- // check that all pages in www.test.com have been removed
- for (let i = 0; i < TOTAL_SITES; i++) {
- let site = "http://www.test.com/" + i + "/";
- let testURI = uri(site);
- do_check_false(uri_in_db(testURI));
- }
-
- // check that all pages in www.test-X.com have NOT been removed
- for (let i = 0; i < TOTAL_SITES; i++) {
- let site = "http://www.test-" + i + ".com/";
- let testURI = uri(site);
- do_check_true(uri_in_db(testURI));
- }
-
- // check that annotation on the removed item does not exists
- try {
- PlacesUtils.annotations.getPageAnnotation(testAnnoDeletedURI, testAnnoName);
- do_throw("fetching page-annotation that doesn't exist, should've thrown");
- } catch (ex) {}
-
- // check that annotation on the NOT removed item still exists
- try {
- var annoVal = PlacesUtils.annotations.getPageAnnotation(testAnnoRetainedURI,
- testAnnoRetainedName);
- } catch (ex) {
- do_throw("The annotation has been removed erroneously");
- }
- do_check_eq(annoVal, testAnnoRetainedValue);
-
-});
diff --git a/toolkit/components/places/tests/unit/test_418643_removeFolderChildren.js b/toolkit/components/places/tests/unit/test_418643_removeFolderChildren.js
deleted file mode 100644
index 2eed02921..000000000
--- a/toolkit/components/places/tests/unit/test_418643_removeFolderChildren.js
+++ /dev/null
@@ -1,143 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Get services.
-try {
- var histSvc = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
- var bmSvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
- var annoSvc = Cc["@mozilla.org/browser/annotation-service;1"]
- .getService(Ci.nsIAnnotationService);
-} catch (ex) {
- do_throw("Could not get services\n");
-}
-
-var validAnnoName = "validAnno";
-var validItemName = "validItem";
-var deletedAnnoName = "deletedAnno";
-var deletedItemName = "deletedItem";
-var bookmarkedURI = uri("http://www.mozilla.org/");
-// set lastModified to the past to prevent VM timing bugs
-var pastDate = Date.now() * 1000 - 1;
-var deletedBookmarkIds = [];
-
-// bookmarks observer
-var observer = {
- // cached ordered array of notified items
- _onItemRemovedItemIds: [],
- onItemRemoved: function(aItemId, aParentId, aIndex) {
- // We should first get notifications for children, then for their parent
- do_check_eq(this._onItemRemovedItemIds.indexOf(aParentId), -1);
- // Ensure we are not wrongly removing 1 level up
- do_check_neq(aParentId, bmSvc.toolbarFolder);
- // Removed item must be one of those we have manually deleted
- do_check_neq(deletedBookmarkIds.indexOf(aItemId), -1);
- this._onItemRemovedItemIds.push(aItemId);
- },
-
- QueryInterface: function(aIID) {
- if (aIID.equals(Ci.nsINavBookmarkObserver) ||
- aIID.equals(Ci.nsISupports)) {
- return this;
- }
- throw Cr.NS_ERROR_NO_INTERFACE;
- }
-};
-
-bmSvc.addObserver(observer, false);
-
-function add_bookmarks() {
- // This is the folder we will cleanup
- var validFolderId = bmSvc.createFolder(bmSvc.toolbarFolder,
- validItemName,
- bmSvc.DEFAULT_INDEX);
- annoSvc.setItemAnnotation(validFolderId, validAnnoName,
- "annotation", 0,
- annoSvc.EXPIRE_NEVER);
- bmSvc.setItemLastModified(validFolderId, pastDate);
-
- // This bookmark should not be deleted
- var validItemId = bmSvc.insertBookmark(bmSvc.toolbarFolder,
- bookmarkedURI,
- bmSvc.DEFAULT_INDEX,
- validItemName);
- annoSvc.setItemAnnotation(validItemId, validAnnoName,
- "annotation", 0, annoSvc.EXPIRE_NEVER);
-
- // The following contents should be deleted
- var deletedItemId = bmSvc.insertBookmark(validFolderId,
- bookmarkedURI,
- bmSvc.DEFAULT_INDEX,
- deletedItemName);
- annoSvc.setItemAnnotation(deletedItemId, deletedAnnoName,
- "annotation", 0, annoSvc.EXPIRE_NEVER);
- deletedBookmarkIds.push(deletedItemId);
-
- var internalFolderId = bmSvc.createFolder(validFolderId,
- deletedItemName,
- bmSvc.DEFAULT_INDEX);
- annoSvc.setItemAnnotation(internalFolderId, deletedAnnoName,
- "annotation", 0, annoSvc.EXPIRE_NEVER);
- deletedBookmarkIds.push(internalFolderId);
-
- deletedItemId = bmSvc.insertBookmark(internalFolderId,
- bookmarkedURI,
- bmSvc.DEFAULT_INDEX,
- deletedItemName);
- annoSvc.setItemAnnotation(deletedItemId, deletedAnnoName,
- "annotation", 0, annoSvc.EXPIRE_NEVER);
- deletedBookmarkIds.push(deletedItemId);
-
- return validFolderId;
-}
-
-function check_bookmarks(aFolderId) {
- // check that we still have valid bookmarks
- var bookmarks = bmSvc.getBookmarkIdsForURI(bookmarkedURI);
- for (var i = 0; i < bookmarks.length; i++) {
- do_check_eq(bmSvc.getItemTitle(bookmarks[i]), validItemName);
- do_check_true(annoSvc.itemHasAnnotation(bookmarks[i], validAnnoName));
- }
-
- // check that folder exists and has still its annotation
- do_check_eq(bmSvc.getItemTitle(aFolderId), validItemName);
- do_check_true(annoSvc.itemHasAnnotation(aFolderId, validAnnoName));
-
- // check that folder is empty
- var options = histSvc.getNewQueryOptions();
- var query = histSvc.getNewQuery();
- query.setFolders([aFolderId], 1);
- var result = histSvc.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 0);
- root.containerOpen = false;
-
- // test that lastModified got updated
- do_check_true(pastDate < bmSvc.getItemLastModified(aFolderId));
-
- // test that all children have been deleted, we use annos for that
- var deletedItems = annoSvc.getItemsWithAnnotation(deletedAnnoName);
- do_check_eq(deletedItems.length, 0);
-
- // test that observer has been called for (and only for) deleted items
- do_check_eq(observer._onItemRemovedItemIds.length, deletedBookmarkIds.length);
-
- // Sanity check: all roots should be intact
- do_check_eq(bmSvc.getFolderIdForItem(bmSvc.placesRoot), 0);
- do_check_eq(bmSvc.getFolderIdForItem(bmSvc.bookmarksMenuFolder), bmSvc.placesRoot);
- do_check_eq(bmSvc.getFolderIdForItem(bmSvc.tagsFolder), bmSvc.placesRoot);
- do_check_eq(bmSvc.getFolderIdForItem(bmSvc.unfiledBookmarksFolder), bmSvc.placesRoot);
- do_check_eq(bmSvc.getFolderIdForItem(bmSvc.toolbarFolder), bmSvc.placesRoot);
-}
-
-// main
-function run_test() {
- var folderId = add_bookmarks();
- bmSvc.removeFolderChildren(folderId);
- check_bookmarks(folderId);
-}
diff --git a/toolkit/components/places/tests/unit/test_419731.js b/toolkit/components/places/tests/unit/test_419731.js
deleted file mode 100644
index b1a434e12..000000000
--- a/toolkit/components/places/tests/unit/test_419731.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- let uri1 = NetUtil.newURI("http://foo.bar/");
-
- // create 2 bookmarks
- let bookmark1id = PlacesUtils.bookmarks
- .insertBookmark(PlacesUtils.bookmarksMenuFolderId,
- uri1,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "title 1");
- let bookmark2id = PlacesUtils.bookmarks
- .insertBookmark(PlacesUtils.toolbarFolderId,
- uri1,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "title 2");
- // add a new tag
- PlacesUtils.tagging.tagURI(uri1, ["foo"]);
-
- // get tag folder id
- let options = PlacesUtils.history.getNewQueryOptions();
- let query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.tagsFolderId], 1);
- let result = PlacesUtils.history.executeQuery(query, options);
- let tagRoot = result.root;
- tagRoot.containerOpen = true;
- let tagNode = tagRoot.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- let tagItemId = tagNode.itemId;
- tagRoot.containerOpen = false;
-
- // change bookmark 1 title
- PlacesUtils.bookmarks.setItemTitle(bookmark1id, "new title 1");
-
- // Workaround timers resolution and time skews.
- let bookmark2LastMod = PlacesUtils.bookmarks.getItemLastModified(bookmark2id);
- PlacesUtils.bookmarks.setItemLastModified(bookmark1id, bookmark2LastMod + 1000);
-
- // Query the tag.
- options = PlacesUtils.history.getNewQueryOptions();
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
- options.resultType = options.RESULTS_AS_TAG_QUERY;
-
- query = PlacesUtils.history.getNewQuery();
- result = PlacesUtils.history.executeQuery(query, options);
- let root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 1);
-
- let theTag = root.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- // Bug 524219: Check that renaming the tag shows up in the result.
- do_check_eq(theTag.title, "foo")
- PlacesUtils.bookmarks.setItemTitle(tagItemId, "bar");
-
- // Check that the item has been replaced
- do_check_neq(theTag, root.getChild(0));
- theTag = root.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- do_check_eq(theTag.title, "bar");
-
- // Check that tag container contains new title
- theTag.containerOpen = true;
- do_check_eq(theTag.childCount, 1);
- let node = theTag.getChild(0);
- do_check_eq(node.title, "new title 1");
- theTag.containerOpen = false;
- root.containerOpen = false;
-
- // Change bookmark 2 title.
- PlacesUtils.bookmarks.setItemTitle(bookmark2id, "new title 2");
-
- // Workaround timers resolution and time skews.
- let bookmark1LastMod = PlacesUtils.bookmarks.getItemLastModified(bookmark1id);
- PlacesUtils.bookmarks.setItemLastModified(bookmark2id, bookmark1LastMod + 1000);
-
- // Check that tag container contains new title
- options = PlacesUtils.history.getNewQueryOptions();
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
- options.resultType = options.RESULTS_AS_TAG_CONTENTS;
-
- query = PlacesUtils.history.getNewQuery();
- query.setFolders([tagItemId], 1);
- result = PlacesUtils.history.executeQuery(query, options);
- root = result.root;
-
- root.containerOpen = true;
- do_check_eq(root.childCount, 1);
- node = root.getChild(0);
- do_check_eq(node.title, "new title 2");
- root.containerOpen = false;
-}
diff --git a/toolkit/components/places/tests/unit/test_419792_node_tags_property.js b/toolkit/components/places/tests/unit/test_419792_node_tags_property.js
deleted file mode 100644
index 4c726d667..000000000
--- a/toolkit/components/places/tests/unit/test_419792_node_tags_property.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// get services
-var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-var tagssvc = Cc["@mozilla.org/browser/tagging-service;1"].
- getService(Ci.nsITaggingService);
-
-function run_test() {
- // get toolbar node
- var options = histsvc.getNewQueryOptions();
- var query = histsvc.getNewQuery();
- query.setFolders([bmsvc.toolbarFolder], 1);
- var result = histsvc.executeQuery(query, options);
- var toolbarNode = result.root;
- toolbarNode.containerOpen = true;
-
- // add a bookmark
- var bookmarkURI = uri("http://foo.com");
- var bookmarkId = bmsvc.insertBookmark(bmsvc.toolbarFolder, bookmarkURI,
- bmsvc.DEFAULT_INDEX, "");
-
- // get the node for the new bookmark
- var node = toolbarNode.getChild(toolbarNode.childCount-1);
- do_check_eq(node.itemId, bookmarkId);
-
- // confirm there's no tags via the .tags property
- do_check_eq(node.tags, null);
-
- // add a tag
- tagssvc.tagURI(bookmarkURI, ["foo"]);
- do_check_eq(node.tags, "foo");
-
- // add another tag, to test delimiter and sorting
- tagssvc.tagURI(bookmarkURI, ["bar"]);
- do_check_eq(node.tags, "bar, foo");
-
- // remove the tags, confirming the property is cleared
- tagssvc.untagURI(bookmarkURI, null);
- do_check_eq(node.tags, null);
-
- toolbarNode.containerOpen = false;
-}
diff --git a/toolkit/components/places/tests/unit/test_425563.js b/toolkit/components/places/tests/unit/test_425563.js
deleted file mode 100644
index bee3a4a54..000000000
--- a/toolkit/components/places/tests/unit/test_425563.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- let count_visited_URIs = ["http://www.test-link.com/",
- "http://www.test-typed.com/",
- "http://www.test-bookmark.com/",
- "http://www.test-redirect-permanent.com/",
- "http://www.test-redirect-temporary.com/"];
-
- let notcount_visited_URIs = ["http://www.test-embed.com/",
- "http://www.test-download.com/",
- "http://www.test-framed.com/",
- "http://www.test-reload.com/"];
-
- // add visits, one for each transition type
- yield PlacesTestUtils.addVisits([
- { uri: uri("http://www.test-link.com/"),
- transition: TRANSITION_LINK },
- { uri: uri("http://www.test-typed.com/"),
- transition: TRANSITION_TYPED },
- { uri: uri("http://www.test-bookmark.com/"),
- transition: TRANSITION_BOOKMARK },
- { uri: uri("http://www.test-embed.com/"),
- transition: TRANSITION_EMBED },
- { uri: uri("http://www.test-framed.com/"),
- transition: TRANSITION_FRAMED_LINK },
- { uri: uri("http://www.test-redirect-permanent.com/"),
- transition: TRANSITION_REDIRECT_PERMANENT },
- { uri: uri("http://www.test-redirect-temporary.com/"),
- transition: TRANSITION_REDIRECT_TEMPORARY },
- { uri: uri("http://www.test-download.com/"),
- transition: TRANSITION_DOWNLOAD },
- { uri: uri("http://www.test-reload.com/"),
- transition: TRANSITION_RELOAD },
- ]);
-
- // check that all links are marked as visited
- for (let visited_uri of count_visited_URIs) {
- do_check_true(yield promiseIsURIVisited(uri(visited_uri)));
- }
- for (let visited_uri of notcount_visited_URIs) {
- do_check_true(yield promiseIsURIVisited(uri(visited_uri)));
- }
-
- // check that visit_count does not take in count embed and downloads
- // maxVisits query are directly binded to visit_count
- let options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_VISITCOUNT_DESCENDING;
- options.resultType = options.RESULTS_AS_VISIT;
- options.includeHidden = true;
- let query = PlacesUtils.history.getNewQuery();
- query.minVisits = 1;
- let root = PlacesUtils.history.executeQuery(query, options).root;
-
- root.containerOpen = true;
- let cc = root.childCount;
- do_check_eq(cc, count_visited_URIs.length);
-
- for (let i = 0; i < cc; i++) {
- let node = root.getChild(i);
- do_check_neq(count_visited_URIs.indexOf(node.uri), -1);
- }
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/unit/test_429505_remove_shortcuts.js b/toolkit/components/places/tests/unit/test_429505_remove_shortcuts.js
deleted file mode 100644
index e0b6be64c..000000000
--- a/toolkit/components/places/tests/unit/test_429505_remove_shortcuts.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
-
-- add a folder
-- add a folder-shortcut to the new folder
-- query for the shortcut
-- remove the folder-shortcut
-- confirm the shortcut is removed from the query results
-
-*/
-
-function run_test() {
- const IDX = PlacesUtils.bookmarks.DEFAULT_INDEX;
- var folderId =
- PlacesUtils.bookmarks.createFolder(PlacesUtils.toolbarFolderId, "", IDX);
-
- var queryId =
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.toolbarFolderId,
- uri("place:folder=" + folderId), IDX, "");
-
- var root = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId, false, true).root;
-
- var oldCount = root.childCount;
-
- PlacesUtils.bookmarks.removeItem(queryId);
-
- do_check_eq(root.childCount, oldCount-1);
-
- root.containerOpen = false;
-}
diff --git a/toolkit/components/places/tests/unit/test_433317_query_title_update.js b/toolkit/components/places/tests/unit/test_433317_query_title_update.js
deleted file mode 100644
index 52558e844..000000000
--- a/toolkit/components/places/tests/unit/test_433317_query_title_update.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- try {
- var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
- var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
- } catch (ex) {
- do_throw("Unable to initialize Places services");
- }
-
- // create a query bookmark
- var queryId = bmsvc.insertBookmark(bmsvc.toolbarFolder, uri("place:"),
- 0 /* first item */, "test query");
-
- // query for that query
- var options = histsvc.getNewQueryOptions();
- var query = histsvc.getNewQuery();
- query.setFolders([bmsvc.toolbarFolder], 1);
- var result = histsvc.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- var queryNode = root.getChild(0);
- do_check_eq(queryNode.title, "test query");
-
- // change the title
- bmsvc.setItemTitle(queryId, "foo");
-
- // confirm the node was updated
- do_check_eq(queryNode.title, "foo");
-
- root.containerOpen = false;
-}
diff --git a/toolkit/components/places/tests/unit/test_433525_hasChildren_crash.js b/toolkit/components/places/tests/unit/test_433525_hasChildren_crash.js
deleted file mode 100644
index 92dac0b17..000000000
--- a/toolkit/components/places/tests/unit/test_433525_hasChildren_crash.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- try {
- var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
- var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
- } catch (ex) {
- do_throw("Unable to initialize Places services");
- }
-
- // add a visit
- var testURI = uri("http://test");
- yield PlacesTestUtils.addVisits(testURI);
-
- // query for the visit
- var options = histsvc.getNewQueryOptions();
- options.maxResults = 1;
- options.resultType = options.RESULTS_AS_URI;
- var query = histsvc.getNewQuery();
- query.uri = testURI;
- var result = histsvc.executeQuery(query, options);
- var root = result.root;
-
- // check hasChildren while the container is closed
- do_check_eq(root.hasChildren, true);
-
- // now check via the saved search path
- var queryURI = histsvc.queriesToQueryString([query], 1, options);
- bmsvc.insertBookmark(bmsvc.toolbarFolder, uri(queryURI),
- 0 /* first item */, "test query");
-
- // query for that query
- options = histsvc.getNewQueryOptions();
- query = histsvc.getNewQuery();
- query.setFolders([bmsvc.toolbarFolder], 1);
- result = histsvc.executeQuery(query, options);
- root = result.root;
- root.containerOpen = true;
- var queryNode = root.getChild(0);
- do_check_eq(queryNode.title, "test query");
- queryNode.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- do_check_eq(queryNode.hasChildren, true);
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/unit/test_452777.js b/toolkit/components/places/tests/unit/test_452777.js
deleted file mode 100644
index 97b2852f6..000000000
--- a/toolkit/components/places/tests/unit/test_452777.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim:set ts=2 sw=2 sts=2 expandtab
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * This test ensures that when removing a folder within a transaction, undoing
- * the transaction restores it with the same id (as received by the observers).
- */
-
-var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-
-function run_test()
-{
- const TITLE = "test folder";
-
- // Create two test folders; remove the first one. This ensures that undoing
- // the removal will not get the same id by chance (the insert id's can be
- // reused in SQLite).
- let id = bs.createFolder(bs.placesRoot, TITLE, -1);
- bs.createFolder(bs.placesRoot, "test folder 2", -1);
- let transaction = bs.getRemoveFolderTransaction(id);
- transaction.doTransaction();
-
- // Now check to make sure it gets added with the right id
- bs.addObserver({
- onItemAdded: function(aItemId, aFolder, aIndex, aItemType, aURI, aTitle)
- {
- do_check_eq(aItemId, id);
- do_check_eq(aTitle, TITLE);
- }
- }, false);
- transaction.undoTransaction();
-}
diff --git a/toolkit/components/places/tests/unit/test_454977.js b/toolkit/components/places/tests/unit/test_454977.js
deleted file mode 100644
index 606e83048..000000000
--- a/toolkit/components/places/tests/unit/test_454977.js
+++ /dev/null
@@ -1,124 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Cache actual visit_count value, filled by add_visit, used by check_results
-var visit_count = 0;
-
-// Returns the Place ID corresponding to an added visit.
-function* task_add_visit(aURI, aVisitType)
-{
- // Add the visit asynchronously, and save its visit ID.
- let deferUpdatePlaces = new Promise((resolve, reject) =>
- {
- PlacesUtils.asyncHistory.updatePlaces({
- uri: aURI,
- visits: [{ transitionType: aVisitType, visitDate: Date.now() * 1000 }]
- }, {
- handleError: function TAV_handleError() {
- reject(new Error("Unexpected error in adding visit."));
- },
- handleResult: function (aPlaceInfo) {
- this.visitId = aPlaceInfo.visits[0].visitId;
- },
- handleCompletion: function TAV_handleCompletion() {
- resolve(this.visitId);
- }
- });
- });
-
- let visitId = yield deferUpdatePlaces;
-
- // Increase visit_count if applicable
- if (aVisitType != 0 &&
- aVisitType != TRANSITION_EMBED &&
- aVisitType != TRANSITION_FRAMED_LINK &&
- aVisitType != TRANSITION_DOWNLOAD &&
- aVisitType != TRANSITION_RELOAD) {
- visit_count ++;
- }
-
- // Get the place id
- if (visitId > 0) {
- let sql = "SELECT place_id FROM moz_historyvisits WHERE id = ?1";
- let stmt = DBConn().createStatement(sql);
- stmt.bindByIndex(0, visitId);
- do_check_true(stmt.executeStep());
- let placeId = stmt.getInt64(0);
- stmt.finalize();
- do_check_true(placeId > 0);
- return placeId;
- }
- return 0;
-}
-
-/**
- * Checks for results consistency, using visit_count as constraint
- * @param aExpectedCount
- * Number of history results we are expecting (excluded hidden ones)
- * @param aExpectedCountWithHidden
- * Number of history results we are expecting (included hidden ones)
- */
-function check_results(aExpectedCount, aExpectedCountWithHidden)
-{
- let query = PlacesUtils.history.getNewQuery();
- // used to check visit_count
- query.minVisits = visit_count;
- query.maxVisits = visit_count;
- let options = PlacesUtils.history.getNewQueryOptions();
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_HISTORY;
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- // Children without hidden ones
- do_check_eq(root.childCount, aExpectedCount);
- root.containerOpen = false;
-
- // Execute again with includeHidden = true
- // This will ensure visit_count is correct
- options.includeHidden = true;
- root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- // Children with hidden ones
- do_check_eq(root.childCount, aExpectedCountWithHidden);
- root.containerOpen = false;
-}
-
-// main
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- const TEST_URI = uri("http://test.mozilla.org/");
-
- // Add a visit that force hidden
- yield task_add_visit(TEST_URI, TRANSITION_EMBED);
- check_results(0, 0);
-
- let placeId = yield task_add_visit(TEST_URI, TRANSITION_FRAMED_LINK);
- check_results(0, 1);
-
- // Add a visit that force unhide and check the place id.
- // - We expect that the place gets hidden = 0 while retaining the same
- // place id and a correct visit_count.
- do_check_eq((yield task_add_visit(TEST_URI, TRANSITION_TYPED)), placeId);
- check_results(1, 1);
-
- // Add a visit that should not increase visit_count
- do_check_eq((yield task_add_visit(TEST_URI, TRANSITION_RELOAD)), placeId);
- check_results(1, 1);
-
- // Add a visit that should not increase visit_count
- do_check_eq((yield task_add_visit(TEST_URI, TRANSITION_DOWNLOAD)), placeId);
- check_results(1, 1);
-
- // Add a visit, check that hidden is not overwritten
- // - We expect that the place has still hidden = 0, while retaining
- // correct visit_count.
- yield task_add_visit(TEST_URI, TRANSITION_EMBED);
- check_results(1, 1);
-});
diff --git a/toolkit/components/places/tests/unit/test_463863.js b/toolkit/components/places/tests/unit/test_463863.js
deleted file mode 100644
index 2f7cece4a..000000000
--- a/toolkit/components/places/tests/unit/test_463863.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * TEST DESCRIPTION:
- *
- * This test checks that in a basic history query all transition types visits
- * appear but TRANSITION_EMBED and TRANSITION_FRAMED_LINK ones.
- */
-
-var transitions = [
- TRANSITION_LINK
-, TRANSITION_TYPED
-, TRANSITION_BOOKMARK
-, TRANSITION_EMBED
-, TRANSITION_FRAMED_LINK
-, TRANSITION_REDIRECT_PERMANENT
-, TRANSITION_REDIRECT_TEMPORARY
-, TRANSITION_DOWNLOAD
-];
-
-function runQuery(aResultType) {
- let options = PlacesUtils.history.getNewQueryOptions();
- options.resultType = aResultType;
- let root = PlacesUtils.history.executeQuery(PlacesUtils.history.getNewQuery(),
- options).root;
- root.containerOpen = true;
- let cc = root.childCount;
- do_check_eq(cc, transitions.length - 2);
-
- for (let i = 0; i < cc; i++) {
- let node = root.getChild(i);
- // Check that all transition types but EMBED and FRAMED appear in results
- do_check_neq(node.uri.substr(6, 1), TRANSITION_EMBED);
- do_check_neq(node.uri.substr(6, 1), TRANSITION_FRAMED_LINK);
- }
- root.containerOpen = false;
-}
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- // add visits, one for each transition type
- for (let transition of transitions) {
- yield PlacesTestUtils.addVisits({
- uri: uri("http://" + transition + ".mozilla.org/"),
- transition: transition
- });
- }
-
- runQuery(Ci.nsINavHistoryQueryOptions.RESULTS_AS_VISIT);
- runQuery(Ci.nsINavHistoryQueryOptions.RESULTS_AS_URI);
-});
diff --git a/toolkit/components/places/tests/unit/test_485442_crash_bug_nsNavHistoryQuery_GetUri.js b/toolkit/components/places/tests/unit/test_485442_crash_bug_nsNavHistoryQuery_GetUri.js
deleted file mode 100644
index 873174ffd..000000000
--- a/toolkit/components/places/tests/unit/test_485442_crash_bug_nsNavHistoryQuery_GetUri.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-
-function run_test() {
- var query = hs.getNewQuery();
- var options = hs.getNewQueryOptions();
- options.resultType = options.RESULT_TYPE_QUERY;
- var result = hs.executeQuery(query, options);
- result.root.containerOpen = true;
- var rootNode = result.root;
- rootNode.QueryInterface(Ci.nsINavHistoryQueryResultNode);
- var queries = rootNode.getQueries();
- do_check_eq(queries[0].uri, null); // Should be null, instead of crashing the browser
- rootNode.containerOpen = false;
-}
diff --git a/toolkit/components/places/tests/unit/test_486978_sort_by_date_queries.js b/toolkit/components/places/tests/unit/test_486978_sort_by_date_queries.js
deleted file mode 100644
index 05f3f83e7..000000000
--- a/toolkit/components/places/tests/unit/test_486978_sort_by_date_queries.js
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * TEST DESCRIPTION:
- *
- * This test checks that setting a sort on a RESULTS_AS_DATE_QUERY query,
- * children of inside containers are sorted accordingly.
- */
-
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-
-// Will be inserted in this order, so last one will be the newest visit.
-var pages = [
- "http://a.mozilla.org/1/",
- "http://a.mozilla.org/2/",
- "http://a.mozilla.org/3/",
- "http://a.mozilla.org/4/",
- "http://b.mozilla.org/5/",
- "http://b.mozilla.org/6/",
- "http://b.mozilla.org/7/",
- "http://b.mozilla.org/8/",
-];
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_initialize()
-{
- var noon = new Date();
- noon.setHours(12);
-
- // Add visits.
- for (let pageIndex = 0; pageIndex < pages.length; ++pageIndex) {
- let page = pages[pageIndex];
- yield PlacesTestUtils.addVisits({
- uri: uri(page),
- visitDate: noon - (pages.length - pageIndex) * 1000
- });
- }
-});
-
-/**
- * Tests that sorting date query by none will sort by title asc.
- */
-add_task(function() {
- var options = hs.getNewQueryOptions();
- options.resultType = options.RESULTS_AS_DATE_QUERY;
- // This should sort by title asc.
- options.sortingMode = options.SORT_BY_NONE;
- var query = hs.getNewQuery();
- var result = hs.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- var dayContainer = root.getChild(0).QueryInterface(Ci.nsINavHistoryContainerResultNode);
- dayContainer.containerOpen = true;
-
- var cc = dayContainer.childCount;
- do_check_eq(cc, pages.length);
- for (var i = 0; i < cc; i++) {
- var node = dayContainer.getChild(i);
- do_check_eq(pages[i], node.uri);
- }
-
- dayContainer.containerOpen = false;
- root.containerOpen = false;
-});
-
-/**
- * Tests that sorting date query by date will sort accordingly.
- */
-add_task(function() {
- var options = hs.getNewQueryOptions();
- options.resultType = options.RESULTS_AS_DATE_QUERY;
- // This should sort by title asc.
- options.sortingMode = options.SORT_BY_DATE_DESCENDING;
- var query = hs.getNewQuery();
- var result = hs.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- var dayContainer = root.getChild(0).QueryInterface(Ci.nsINavHistoryContainerResultNode);
- dayContainer.containerOpen = true;
-
- var cc = dayContainer.childCount;
- do_check_eq(cc, pages.length);
- for (var i = 0; i < cc; i++) {
- var node = dayContainer.getChild(i);
- do_check_eq(pages[pages.length - i - 1], node.uri);
- }
-
- dayContainer.containerOpen = false;
- root.containerOpen = false;
-});
-
-/**
- * Tests that sorting date site query by date will still sort by title asc.
- */
-add_task(function() {
- var options = hs.getNewQueryOptions();
- options.resultType = options.RESULTS_AS_DATE_SITE_QUERY;
- // This should sort by title asc.
- options.sortingMode = options.SORT_BY_DATE_DESCENDING;
- var query = hs.getNewQuery();
- var result = hs.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- var dayContainer = root.getChild(0).QueryInterface(Ci.nsINavHistoryContainerResultNode);
- dayContainer.containerOpen = true;
- var siteContainer = dayContainer.getChild(0).QueryInterface(Ci.nsINavHistoryContainerResultNode);
- do_check_eq(siteContainer.title, "a.mozilla.org");
- siteContainer.containerOpen = true;
-
- var cc = siteContainer.childCount;
- do_check_eq(cc, pages.length / 2);
- for (var i = 0; i < cc / 2; i++) {
- var node = siteContainer.getChild(i);
- do_check_eq(pages[i], node.uri);
- }
-
- siteContainer.containerOpen = false;
- dayContainer.containerOpen = false;
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/unit/test_536081.js b/toolkit/components/places/tests/unit/test_536081.js
deleted file mode 100644
index b61b91866..000000000
--- a/toolkit/components/places/tests/unit/test_536081.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-var bh = hs.QueryInterface(Ci.nsIBrowserHistory);
-var db = hs.QueryInterface(Ci.nsPIPlacesDatabase).DBConnection;
-
-const URLS = [
- { u: "http://www.google.com/search?q=testing%3Bthis&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:unofficial&client=firefox-a",
- s: "goog" },
-];
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- for (let url of URLS) {
- yield task_test_url(url);
- }
-});
-
-function* task_test_url(aURL) {
- print("Testing url: " + aURL.u);
- yield PlacesTestUtils.addVisits(uri(aURL.u));
- let query = hs.getNewQuery();
- query.searchTerms = aURL.s;
- let options = hs.getNewQueryOptions();
- let root = hs.executeQuery(query, options).root;
- root.containerOpen = true;
- let cc = root.childCount;
- do_check_eq(cc, 1);
- print("Checking url is in the query.");
- let node = root.getChild(0);
- print("Found " + node.uri);
- root.containerOpen = false;
- bh.removePage(uri(node.uri));
-}
-
-function check_empty_table(table_name) {
- print("Checking url has been removed.");
- let stmt = db.createStatement("SELECT count(*) FROM " + table_name);
- try {
- stmt.executeStep();
- do_check_eq(stmt.getInt32(0), 0);
- }
- finally {
- stmt.finalize();
- }
-}
diff --git a/toolkit/components/places/tests/unit/test_PlacesSearchAutocompleteProvider.js b/toolkit/components/places/tests/unit/test_PlacesSearchAutocompleteProvider.js
deleted file mode 100644
index 1280ce3e7..000000000
--- a/toolkit/components/places/tests/unit/test_PlacesSearchAutocompleteProvider.js
+++ /dev/null
@@ -1,133 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import("resource://gre/modules/PlacesSearchAutocompleteProvider.jsm");
-
-function run_test() {
- // Tell the search service we are running in the US. This also has the
- // desired side-effect of preventing our geoip lookup.
- Services.prefs.setBoolPref("browser.search.isUS", true);
- Services.prefs.setCharPref("browser.search.countryCode", "US");
- Services.prefs.setBoolPref("browser.search.geoSpecificDefaults", false);
- run_next_test();
-}
-
-add_task(function* search_engine_match() {
- let engine = yield promiseDefaultSearchEngine();
- let token = engine.getResultDomain();
- let match = yield PlacesSearchAutocompleteProvider.findMatchByToken(token.substr(0, 1));
- do_check_eq(match.url, engine.searchForm);
- do_check_eq(match.engineName, engine.name);
- do_check_eq(match.iconUrl, engine.iconURI ? engine.iconURI.spec : null);
-});
-
-add_task(function* no_match() {
- do_check_eq(null, yield PlacesSearchAutocompleteProvider.findMatchByToken("test"));
-});
-
-add_task(function* hide_search_engine_nomatch() {
- let engine = yield promiseDefaultSearchEngine();
- let token = engine.getResultDomain();
- let promiseTopic = promiseSearchTopic("engine-changed");
- Services.search.removeEngine(engine);
- yield promiseTopic;
- do_check_true(engine.hidden);
- do_check_eq(null, yield PlacesSearchAutocompleteProvider.findMatchByToken(token.substr(0, 1)));
-});
-
-add_task(function* add_search_engine_match() {
- let promiseTopic = promiseSearchTopic("engine-added");
- do_check_eq(null, yield PlacesSearchAutocompleteProvider.findMatchByToken("bacon"));
- Services.search.addEngineWithDetails("bacon", "", "pork", "Search Bacon",
- "GET", "http://www.bacon.moz/?search={searchTerms}");
- yield promiseTopic;
- let match = yield PlacesSearchAutocompleteProvider.findMatchByToken("bacon");
- do_check_eq(match.url, "http://www.bacon.moz");
- do_check_eq(match.engineName, "bacon");
- do_check_eq(match.iconUrl, null);
-});
-
-add_task(function* test_aliased_search_engine_match() {
- do_check_eq(null, yield PlacesSearchAutocompleteProvider.findMatchByAlias("sober"));
- // Lower case
- let match = yield PlacesSearchAutocompleteProvider.findMatchByAlias("pork");
- do_check_eq(match.engineName, "bacon");
- do_check_eq(match.alias, "pork");
- do_check_eq(match.iconUrl, null);
- // Upper case
- let match1 = yield PlacesSearchAutocompleteProvider.findMatchByAlias("PORK");
- do_check_eq(match1.engineName, "bacon");
- do_check_eq(match1.alias, "pork");
- do_check_eq(match1.iconUrl, null);
- // Cap case
- let match2 = yield PlacesSearchAutocompleteProvider.findMatchByAlias("Pork");
- do_check_eq(match2.engineName, "bacon");
- do_check_eq(match2.alias, "pork");
- do_check_eq(match2.iconUrl, null);
-});
-
-add_task(function* test_aliased_search_engine_match_upper_case_alias() {
- let promiseTopic = promiseSearchTopic("engine-added");
- do_check_eq(null, yield PlacesSearchAutocompleteProvider.findMatchByToken("patch"));
- Services.search.addEngineWithDetails("patch", "", "PR", "Search Patch",
- "GET", "http://www.patch.moz/?search={searchTerms}");
- yield promiseTopic;
- // lower case
- let match = yield PlacesSearchAutocompleteProvider.findMatchByAlias("pr");
- do_check_eq(match.engineName, "patch");
- do_check_eq(match.alias, "PR");
- do_check_eq(match.iconUrl, null);
- // Upper case
- let match1 = yield PlacesSearchAutocompleteProvider.findMatchByAlias("PR");
- do_check_eq(match1.engineName, "patch");
- do_check_eq(match1.alias, "PR");
- do_check_eq(match1.iconUrl, null);
- // Cap case
- let match2 = yield PlacesSearchAutocompleteProvider.findMatchByAlias("Pr");
- do_check_eq(match2.engineName, "patch");
- do_check_eq(match2.alias, "PR");
- do_check_eq(match2.iconUrl, null);
-});
-
-add_task(function* remove_search_engine_nomatch() {
- let engine = Services.search.getEngineByName("bacon");
- let promiseTopic = promiseSearchTopic("engine-removed");
- Services.search.removeEngine(engine);
- yield promiseTopic;
- do_check_eq(null, yield PlacesSearchAutocompleteProvider.findMatchByToken("bacon"));
-});
-
-add_task(function* test_parseSubmissionURL_basic() {
- // Most of the logic of parseSubmissionURL is tested in the search service
- // itself, thus we only do a sanity check of the wrapper here.
- let engine = yield promiseDefaultSearchEngine();
- let submissionURL = engine.getSubmission("terms").uri.spec;
-
- let result = PlacesSearchAutocompleteProvider.parseSubmissionURL(submissionURL);
- do_check_eq(result.engineName, engine.name);
- do_check_eq(result.terms, "terms");
-
- result = PlacesSearchAutocompleteProvider.parseSubmissionURL("http://example.org/");
- do_check_eq(result, null);
-});
-
-function promiseDefaultSearchEngine() {
- let deferred = Promise.defer();
- Services.search.init( () => {
- deferred.resolve(Services.search.defaultEngine);
- });
- return deferred.promise;
-}
-
-function promiseSearchTopic(expectedVerb) {
- let deferred = Promise.defer();
- Services.obs.addObserver( function observe(subject, topic, verb) {
- do_print("browser-search-engine-modified: " + verb);
- if (verb == expectedVerb) {
- Services.obs.removeObserver(observe, "browser-search-engine-modified");
- deferred.resolve();
- }
- }, "browser-search-engine-modified", false);
- return deferred.promise;
-}
diff --git a/toolkit/components/places/tests/unit/test_PlacesUtils_asyncGetBookmarkIds.js b/toolkit/components/places/tests/unit/test_PlacesUtils_asyncGetBookmarkIds.js
deleted file mode 100644
index 182f75eac..000000000
--- a/toolkit/components/places/tests/unit/test_PlacesUtils_asyncGetBookmarkIds.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/**
- * This file tests PlacesUtils.asyncGetBookmarkIds method.
- */
-
-const TEST_URL = "http://www.example.com/";
-
-var promiseAsyncGetBookmarkIds = Task.async(function* (url) {
- yield PlacesTestUtils.promiseAsyncUpdates();
- return new Promise(resolve => {
- PlacesUtils.asyncGetBookmarkIds(url, (itemIds, uri) => {
- Assert.equal(uri, url);
- resolve({ itemIds, url });
- });
- });
-});
-
-add_task(function* test_no_bookmark() {
- let { itemIds, url } = yield promiseAsyncGetBookmarkIds(TEST_URL);
- Assert.equal(itemIds.length, 0);
- Assert.equal(url, TEST_URL);
-});
-
-add_task(function* test_one_bookmark() {
- let bookmark = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: TEST_URL,
- title: "test"
- });
- let itemId = yield PlacesUtils.promiseItemId(bookmark.guid);
- {
- let { itemIds, url } = yield promiseAsyncGetBookmarkIds(NetUtil.newURI(TEST_URL));
- Assert.equal(itemIds.length, 1);
- Assert.equal(itemIds[0], itemId);
- Assert.equal(url.spec, TEST_URL);
- }
- {
- let { itemIds, url } = yield promiseAsyncGetBookmarkIds(TEST_URL);
- Assert.equal(itemIds.length, 1);
- Assert.equal(itemIds[0], itemId);
- Assert.equal(url, TEST_URL);
- }
- yield PlacesUtils.bookmarks.remove(bookmark);
-});
-
-add_task(function* test_multiple_bookmarks() {
- let ids = [];
- let bookmark1 = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: TEST_URL,
- title: "test"
- });
- ids.push((yield PlacesUtils.promiseItemId(bookmark1.guid)));
- let bookmark2 = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: TEST_URL,
- title: "test"
- });
- ids.push((yield PlacesUtils.promiseItemId(bookmark2.guid)));
-
- let { itemIds, url } = yield promiseAsyncGetBookmarkIds(TEST_URL);
- Assert.deepEqual(ids, itemIds);
- Assert.equal(url, TEST_URL);
-
- yield PlacesUtils.bookmarks.remove(bookmark1);
- yield PlacesUtils.bookmarks.remove(bookmark2);
-});
-
-add_task(function* test_cancel() {
- let pending = PlacesUtils.asyncGetBookmarkIds(TEST_URL, () => {
- Assert.ok(false, "A canceled pending statement should not be invoked");
- });
- pending.cancel();
-
- let { itemIds, url } = yield promiseAsyncGetBookmarkIds(TEST_URL);
- Assert.equal(itemIds.length, 0);
- Assert.equal(url, TEST_URL);
-});
diff --git a/toolkit/components/places/tests/unit/test_PlacesUtils_invalidateCachedGuidFor.js b/toolkit/components/places/tests/unit/test_PlacesUtils_invalidateCachedGuidFor.js
deleted file mode 100644
index b7906ec5c..000000000
--- a/toolkit/components/places/tests/unit/test_PlacesUtils_invalidateCachedGuidFor.js
+++ /dev/null
@@ -1,25 +0,0 @@
-add_task(function* () {
- do_print("Add a bookmark.");
- let bm = yield PlacesUtils.bookmarks.insert({ url: "http://example.com/",
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- let id = yield PlacesUtils.promiseItemId(bm.guid);
- Assert.equal((yield PlacesUtils.promiseItemGuid(id)), bm.guid);
-
- // Ensure invalidating a non-existent itemId doesn't throw.
- PlacesUtils.invalidateCachedGuidFor(null);
- PlacesUtils.invalidateCachedGuidFor(9999);
-
- do_print("Change the GUID.");
- yield PlacesUtils.withConnectionWrapper("test", Task.async(function*(db) {
- yield db.execute("UPDATE moz_bookmarks SET guid = :guid WHERE id = :id",
- { guid: "123456789012", id});
- }));
- // The cache should still point to the wrong id.
- Assert.equal((yield PlacesUtils.promiseItemGuid(id)), bm.guid);
-
- do_print("Invalidate the cache.");
- PlacesUtils.invalidateCachedGuidFor(id);
- Assert.equal((yield PlacesUtils.promiseItemGuid(id)), "123456789012");
- Assert.equal((yield PlacesUtils.promiseItemId("123456789012")), id);
- yield Assert.rejects(PlacesUtils.promiseItemId(bm.guid), /no item found for the given GUID/);
-});
diff --git a/toolkit/components/places/tests/unit/test_PlacesUtils_lazyobservers.js b/toolkit/components/places/tests/unit/test_PlacesUtils_lazyobservers.js
deleted file mode 100644
index f0e9c5517..000000000
--- a/toolkit/components/places/tests/unit/test_PlacesUtils_lazyobservers.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function run_test() {
- do_test_pending();
-
- const TEST_URI = NetUtil.newURI("http://moz.org/")
- let observer = {
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsINavBookmarkObserver,
- ]),
-
- onBeginUpdateBatch: function () {},
- onEndUpdateBatch: function () {},
- onItemAdded: function (aItemId, aParentId, aIndex, aItemType, aURI) {
- do_check_true(aURI.equals(TEST_URI));
- PlacesUtils.removeLazyBookmarkObserver(this);
- do_test_finished();
- },
- onItemRemoved: function () {},
- onItemChanged: function () {},
- onItemVisited: function () {},
- onItemMoved: function () {},
- };
-
- // Check registration and removal with uninitialized bookmarks service.
- PlacesUtils.addLazyBookmarkObserver(observer);
- PlacesUtils.removeLazyBookmarkObserver(observer);
-
- // Add a proper lazy observer we will test.
- PlacesUtils.addLazyBookmarkObserver(observer);
-
- // Check that we don't leak when adding and removing an observer while the
- // bookmarks service is instantiated but no change happened (bug 721319).
- PlacesUtils.bookmarks;
- PlacesUtils.addLazyBookmarkObserver(observer);
- PlacesUtils.removeLazyBookmarkObserver(observer);
- try {
- PlacesUtils.bookmarks.removeObserver(observer);
- do_throw("Trying to remove a nonexisting observer should throw!");
- } catch (ex) {}
-
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- TEST_URI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "Bookmark title");
-}
diff --git a/toolkit/components/places/tests/unit/test_adaptive.js b/toolkit/components/places/tests/unit/test_adaptive.js
deleted file mode 100644
index 78ffaedb5..000000000
--- a/toolkit/components/places/tests/unit/test_adaptive.js
+++ /dev/null
@@ -1,406 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test for bug 395739 to make sure the feedback to the search results in those
- * entries getting better ranks. Additionally, exact matches should be ranked
- * higher. Because the interactions among adaptive rank and visit counts is not
- * well defined, this test holds one of the two values constant when modifying
- * the other.
- *
- * This also tests bug 395735 for the instrumentation feedback mechanism.
- *
- * Bug 411293 is tested to make sure the drop down strongly prefers previously
- * typed pages that have been selected and are moved to the top with adaptive
- * learning.
- */
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
-
- get minResultsForPopup() {
- return 0;
- },
- get timeout() {
- return 10;
- },
- get searchParam() {
- return "";
- },
- get textValue() {
- return "";
- },
- get disableAutoComplete() {
- return false;
- },
- get completeDefaultIndex() {
- return false;
- },
-
- get searchCount() {
- return this.searches.length;
- },
- getSearchAt: function (aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchBegin: function () {},
- onSearchComplete: function() {},
-
- get popupOpen() {
- return false;
- },
- popup: {
- set selectedIndex(aIndex) {},
- invalidate: function () {},
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompletePopup])
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteInput])
-}
-
-/**
- * Checks that autocomplete results are ordered correctly.
- */
-function ensure_results(expected, searchTerm)
-{
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches
- // and confirms results on search complete.
- let input = new AutoCompleteInput(["unifiedcomplete"]);
-
- controller.input = input;
-
- input.onSearchComplete = function() {
- do_check_eq(controller.searchStatus,
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
- do_check_eq(controller.matchCount, expected.length);
- for (let i = 0; i < controller.matchCount; i++) {
- print("Testing for '" + expected[i].uri.spec + "' got '" + controller.getValueAt(i) + "'");
- do_check_eq(controller.getValueAt(i), expected[i].uri.spec);
- do_check_eq(controller.getStyleAt(i), expected[i].style);
- }
-
- deferEnsureResults.resolve();
- };
-
- controller.startSearch(searchTerm);
-}
-
-/**
- * Asynchronous task that bumps up the rank for an uri.
- */
-function* task_setCountRank(aURI, aCount, aRank, aSearch, aBookmark)
-{
- // Bump up the visit count for the uri.
- let visits = [];
- for (let i = 0; i < aCount; i++) {
- visits.push({ uri: aURI, visitDate: d1, transition: TRANSITION_TYPED });
- }
- yield PlacesTestUtils.addVisits(visits);
-
- // Make a nsIAutoCompleteController and friends for instrumentation feedback.
- let thing = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteInput,
- Ci.nsIAutoCompletePopup,
- Ci.nsIAutoCompleteController]),
- get popup() {
- return thing;
- },
- get controller() {
- return thing;
- },
- popupOpen: true,
- selectedIndex: 0,
- getValueAt: function() {
- return aURI.spec;
- },
- searchString: aSearch
- };
-
- // Bump up the instrumentation feedback.
- for (let i = 0; i < aRank; i++) {
- Services.obs.notifyObservers(thing, "autocomplete-will-enter-text", null);
- }
-
- // If this is supposed to be a bookmark, add it.
- if (aBookmark) {
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- aURI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "test_book");
-
- // And add the tag if we need to.
- if (aBookmark == "tag") {
- PlacesUtils.tagging.tagURI(aURI, ["test_tag"]);
- }
- }
-}
-
-/**
- * Decay the adaptive entries by sending the daily idle topic.
- */
-function doAdaptiveDecay()
-{
- PlacesUtils.history.runInBatchMode({
- runBatched: function() {
- for (let i = 0; i < 10; i++) {
- PlacesUtils.history.QueryInterface(Ci.nsIObserver)
- .observe(null, "idle-daily", null);
- }
- }
- }, this);
-}
-
-var uri1 = uri("http://site.tld/1");
-var uri2 = uri("http://site.tld/2");
-
-// d1 is some date for the page visit
-var d1 = new Date(Date.now() - 1000 * 60 * 60) * 1000;
-// c1 is larger (should show up higher) than c2
-var c1 = 10;
-var c2 = 1;
-// s1 is a partial match of s2
-var s0 = "";
-var s1 = "si";
-var s2 = "site";
-
-var observer = {
- results: null,
- search: null,
- runCount: -1,
- observe: function(aSubject, aTopic, aData)
- {
- if (--this.runCount > 0)
- return;
- ensure_results(this.results, this.search);
- }
-};
-Services.obs.addObserver(observer, PlacesUtils.TOPIC_FEEDBACK_UPDATED, false);
-
-/**
- * Make the result object for a given URI that will be passed to ensure_results.
- */
-function makeResult(aURI, aStyle = "favicon") {
- return {
- uri: aURI,
- style: aStyle,
- };
-}
-
-var tests = [
- // Test things without a search term.
- function*() {
- print("Test 0 same count, diff rank, same term; no search");
- observer.results = [
- makeResult(uri1),
- makeResult(uri2),
- ];
- observer.search = s0;
- observer.runCount = c1 + c2;
- yield task_setCountRank(uri1, c1, c1, s2);
- yield task_setCountRank(uri2, c1, c2, s2);
- },
- function*() {
- print("Test 1 same count, diff rank, same term; no search");
- observer.results = [
- makeResult(uri2),
- makeResult(uri1),
- ];
- observer.search = s0;
- observer.runCount = c1 + c2;
- yield task_setCountRank(uri1, c1, c2, s2);
- yield task_setCountRank(uri2, c1, c1, s2);
- },
- function*() {
- print("Test 2 diff count, same rank, same term; no search");
- observer.results = [
- makeResult(uri1),
- makeResult(uri2),
- ];
- observer.search = s0;
- observer.runCount = c1 + c1;
- yield task_setCountRank(uri1, c1, c1, s2);
- yield task_setCountRank(uri2, c2, c1, s2);
- },
- function*() {
- print("Test 3 diff count, same rank, same term; no search");
- observer.results = [
- makeResult(uri2),
- makeResult(uri1),
- ];
- observer.search = s0;
- observer.runCount = c1 + c1;
- yield task_setCountRank(uri1, c2, c1, s2);
- yield task_setCountRank(uri2, c1, c1, s2);
- },
-
- // Test things with a search term (exact match one, partial other).
- function*() {
- print("Test 4 same count, same rank, diff term; one exact/one partial search");
- observer.results = [
- makeResult(uri1),
- makeResult(uri2),
- ];
- observer.search = s1;
- observer.runCount = c1 + c1;
- yield task_setCountRank(uri1, c1, c1, s1);
- yield task_setCountRank(uri2, c1, c1, s2);
- },
- function*() {
- print("Test 5 same count, same rank, diff term; one exact/one partial search");
- observer.results = [
- makeResult(uri2),
- makeResult(uri1),
- ];
- observer.search = s1;
- observer.runCount = c1 + c1;
- yield task_setCountRank(uri1, c1, c1, s2);
- yield task_setCountRank(uri2, c1, c1, s1);
- },
-
- // Test things with a search term (exact match both).
- function*() {
- print("Test 6 same count, diff rank, same term; both exact search");
- observer.results = [
- makeResult(uri1),
- makeResult(uri2),
- ];
- observer.search = s1;
- observer.runCount = c1 + c2;
- yield task_setCountRank(uri1, c1, c1, s1);
- yield task_setCountRank(uri2, c1, c2, s1);
- },
- function*() {
- print("Test 7 same count, diff rank, same term; both exact search");
- observer.results = [
- makeResult(uri2),
- makeResult(uri1),
- ];
- observer.search = s1;
- observer.runCount = c1 + c2;
- yield task_setCountRank(uri1, c1, c2, s1);
- yield task_setCountRank(uri2, c1, c1, s1);
- },
-
- // Test things with a search term (partial match both).
- function*() {
- print("Test 8 same count, diff rank, same term; both partial search");
- observer.results = [
- makeResult(uri1),
- makeResult(uri2),
- ];
- observer.search = s1;
- observer.runCount = c1 + c2;
- yield task_setCountRank(uri1, c1, c1, s2);
- yield task_setCountRank(uri2, c1, c2, s2);
- },
- function*() {
- print("Test 9 same count, diff rank, same term; both partial search");
- observer.results = [
- makeResult(uri2),
- makeResult(uri1),
- ];
- observer.search = s1;
- observer.runCount = c1 + c2;
- yield task_setCountRank(uri1, c1, c2, s2);
- yield task_setCountRank(uri2, c1, c1, s2);
- },
- function*() {
- print("Test 10 same count, same rank, same term, decay first; exact match");
- observer.results = [
- makeResult(uri2),
- makeResult(uri1),
- ];
- observer.search = s1;
- observer.runCount = c1 + c1;
- yield task_setCountRank(uri1, c1, c1, s1);
- doAdaptiveDecay();
- yield task_setCountRank(uri2, c1, c1, s1);
- },
- function*() {
- print("Test 11 same count, same rank, same term, decay second; exact match");
- observer.results = [
- makeResult(uri1),
- makeResult(uri2),
- ];
- observer.search = s1;
- observer.runCount = c1 + c1;
- yield task_setCountRank(uri2, c1, c1, s1);
- doAdaptiveDecay();
- yield task_setCountRank(uri1, c1, c1, s1);
- },
- // Test that bookmarks are hidden if the preferences are set right.
- function*() {
- print("Test 12 same count, diff rank, same term; no search; history only");
- Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
- Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
- Services.prefs.setBoolPref("browser.urlbar.suggest.openpage", false);
- observer.results = [
- makeResult(uri1),
- makeResult(uri2),
- ];
- observer.search = s0;
- observer.runCount = c1 + c2;
- yield task_setCountRank(uri1, c1, c1, s2, "bookmark");
- yield task_setCountRank(uri2, c1, c2, s2);
- },
- // Test that tags are shown if the preferences are set right.
- function*() {
- print("Test 13 same count, diff rank, same term; no search; history only with tag");
- Services.prefs.setBoolPref("browser.urlbar.suggest.history", true);
- Services.prefs.setBoolPref("browser.urlbar.suggest.bookmark", false);
- Services.prefs.setBoolPref("browser.urlbar.suggest.openpage", false);
- observer.results = [
- makeResult(uri1, "tag"),
- makeResult(uri2),
- ];
- observer.search = s0;
- observer.runCount = c1 + c2;
- yield task_setCountRank(uri1, c1, c1, s2, "tag");
- yield task_setCountRank(uri2, c1, c2, s2);
- },
-];
-
-/**
- * This deferred object contains a promise that is resolved when the
- * ensure_results function has finished its execution.
- */
-var deferEnsureResults;
-
-/**
- * Test adaptive autocomplete.
- */
-add_task(function* test_adaptive()
-{
- // Disable autoFill for this test.
- Services.prefs.setBoolPref("browser.urlbar.autoFill", false);
- do_register_cleanup(() => Services.prefs.clearUserPref("browser.urlbar.autoFill"));
- for (let test of tests) {
- // Cleanup.
- PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId);
- PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.tagsFolderId);
- observer.runCount = -1;
-
- let types = ["history", "bookmark", "openpage"];
- for (let type of types) {
- Services.prefs.clearUserPref("browser.urlbar.suggest." + type);
- }
-
- yield PlacesTestUtils.clearHistory();
-
- deferEnsureResults = Promise.defer();
- yield test();
- yield deferEnsureResults.promise;
- }
-
- Services.obs.removeObserver(observer, PlacesUtils.TOPIC_FEEDBACK_UPDATED);
-});
diff --git a/toolkit/components/places/tests/unit/test_adaptive_bug527311.js b/toolkit/components/places/tests/unit/test_adaptive_bug527311.js
deleted file mode 100644
index 024553bba..000000000
--- a/toolkit/components/places/tests/unit/test_adaptive_bug527311.js
+++ /dev/null
@@ -1,141 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const TEST_URL = "http://adapt.mozilla.org/";
-const SEARCH_STRING = "adapt";
-const SUGGEST_TYPES = ["history", "bookmark", "openpage"];
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-var os = Cc["@mozilla.org/observer-service;1"].
- getService(Ci.nsIObserverService);
-var ps = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
-
-const PLACES_AUTOCOMPLETE_FEEDBACK_UPDATED_TOPIC =
- "places-autocomplete-feedback-updated";
-
-function cleanup() {
- for (let type of SUGGEST_TYPES) {
- ps.clearUserPref("browser.urlbar.suggest." + type);
- }
-}
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
- searches: null,
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "",
- disableAutoComplete: false,
- completeDefaultIndex: false,
-
- get searchCount() {
- return this.searches.length;
- },
-
- getSearchAt: function ACI_getSearchAt(aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchComplete: function ACI_onSearchComplete() {},
-
- popupOpen: false,
-
- popup: {
- setSelectedIndex: function() {},
- invalidate: function() {},
-
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompletePopup))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- },
-
- onSearchBegin: function() {},
-
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteInput))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-
-function check_results() {
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
- let input = new AutoCompleteInput(["unifiedcomplete"]);
- controller.input = input;
-
- input.onSearchComplete = function() {
- do_check_eq(controller.searchStatus,
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH);
- do_check_eq(controller.matchCount, 0);
-
- PlacesUtils.bookmarks.eraseEverything().then(() => {
- cleanup();
- do_test_finished();
- });
- };
-
- controller.startSearch(SEARCH_STRING);
-}
-
-
-function addAdaptiveFeedback(aUrl, aSearch, aCallback) {
- let observer = {
- observe: function(aSubject, aTopic, aData) {
- os.removeObserver(observer, PLACES_AUTOCOMPLETE_FEEDBACK_UPDATED_TOPIC);
- do_timeout(0, aCallback);
- }
- };
- os.addObserver(observer, PLACES_AUTOCOMPLETE_FEEDBACK_UPDATED_TOPIC, false);
-
- let thing = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIAutoCompleteInput,
- Ci.nsIAutoCompletePopup,
- Ci.nsIAutoCompleteController]),
- get popup() { return thing; },
- get controller() { return thing; },
- popupOpen: true,
- selectedIndex: 0,
- getValueAt: () => aUrl,
- searchString: aSearch
- };
-
- os.notifyObservers(thing, "autocomplete-will-enter-text", null);
-}
-
-
-function run_test() {
- do_test_pending();
-
- // Add a bookmark to our url.
- bs.insertBookmark(bs.unfiledBookmarksFolder, uri(TEST_URL),
- bs.DEFAULT_INDEX, "test_book");
- // We want to search only history.
- for (let type of SUGGEST_TYPES) {
- type == "history" ? ps.setBoolPref("browser.urlbar.suggest." + type, true)
- : ps.setBoolPref("browser.urlbar.suggest." + type, false);
- }
-
- // Add an adaptive entry.
- addAdaptiveFeedback(TEST_URL, SEARCH_STRING, check_results);
-}
diff --git a/toolkit/components/places/tests/unit/test_analyze.js b/toolkit/components/places/tests/unit/test_analyze.js
deleted file mode 100644
index 456270101..000000000
--- a/toolkit/components/places/tests/unit/test_analyze.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Tests sqlite_sta1 table exists, it should be created by analyze.
-// Since the bookmark roots are created when the DB is created (bug 704855),
-// the table will contain data.
-
-function run_test() {
- do_test_pending();
-
- let stmt = DBConn().createAsyncStatement(
- "SELECT ROWID FROM sqlite_stat1"
- );
- stmt.executeAsync({
- _gotResult: false,
- handleResult: function(aResultSet) {
- this._gotResult = true;
- },
- handleError: function(aError) {
- do_throw("Unexpected error (" + aError.result + "): " + aError.message);
- },
- handleCompletion: function(aReason) {
- do_check_true(this._gotResult);
- do_test_finished();
- }
- });
- stmt.finalize();
-}
diff --git a/toolkit/components/places/tests/unit/test_annotations.js b/toolkit/components/places/tests/unit/test_annotations.js
deleted file mode 100644
index a37d7e6c9..000000000
--- a/toolkit/components/places/tests/unit/test_annotations.js
+++ /dev/null
@@ -1,363 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Get bookmark service
-try {
- var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].getService(Ci.nsINavBookmarksService);
-} catch (ex) {
- do_throw("Could not get nav-bookmarks-service\n");
-}
-
-// Get annotation service
-try {
- var annosvc= Cc["@mozilla.org/browser/annotation-service;1"].getService(Ci.nsIAnnotationService);
-} catch (ex) {
- do_throw("Could not get annotation service\n");
-}
-
-var annoObserver = {
- PAGE_lastSet_URI: "",
- PAGE_lastSet_AnnoName: "",
-
- onPageAnnotationSet: function(aURI, aName) {
- this.PAGE_lastSet_URI = aURI.spec;
- this.PAGE_lastSet_AnnoName = aName;
- },
-
- ITEM_lastSet_Id: -1,
- ITEM_lastSet_AnnoName: "",
- onItemAnnotationSet: function(aItemId, aName) {
- this.ITEM_lastSet_Id = aItemId;
- this.ITEM_lastSet_AnnoName = aName;
- },
-
- PAGE_lastRemoved_URI: "",
- PAGE_lastRemoved_AnnoName: "",
- onPageAnnotationRemoved: function(aURI, aName) {
- this.PAGE_lastRemoved_URI = aURI.spec;
- this.PAGE_lastRemoved_AnnoName = aName;
- },
-
- ITEM_lastRemoved_Id: -1,
- ITEM_lastRemoved_AnnoName: "",
- onItemAnnotationRemoved: function(aItemId, aName) {
- this.ITEM_lastRemoved_Id = aItemId;
- this.ITEM_lastRemoved_AnnoName = aName;
- }
-};
-
-// main
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- var testURI = uri("http://mozilla.com/");
- var testItemId = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, testURI, -1, "");
- var testAnnoName = "moz-test-places/annotations";
- var testAnnoVal = "test";
-
- annosvc.addObserver(annoObserver);
- // create new string annotation
- try {
- annosvc.setPageAnnotation(testURI, testAnnoName, testAnnoVal, 0, 0);
- } catch (ex) {
- do_throw("unable to add page-annotation");
- }
- do_check_eq(annoObserver.PAGE_lastSet_URI, testURI.spec);
- do_check_eq(annoObserver.PAGE_lastSet_AnnoName, testAnnoName);
-
- // get string annotation
- do_check_true(annosvc.pageHasAnnotation(testURI, testAnnoName));
- var storedAnnoVal = annosvc.getPageAnnotation(testURI, testAnnoName);
- do_check_true(testAnnoVal === storedAnnoVal);
- // string item-annotation
- try {
- var lastModified = bmsvc.getItemLastModified(testItemId);
- // Verify that lastModified equals dateAdded before we set the annotation.
- do_check_eq(lastModified, bmsvc.getItemDateAdded(testItemId));
- // Workaround possible VM timers issues moving last modified to the past.
- bmsvc.setItemLastModified(testItemId, --lastModified);
- annosvc.setItemAnnotation(testItemId, testAnnoName, testAnnoVal, 0, 0);
- var lastModified2 = bmsvc.getItemLastModified(testItemId);
- // verify that setting the annotation updates the last modified time
- do_check_true(lastModified2 > lastModified);
- } catch (ex) {
- do_throw("unable to add item annotation");
- }
- do_check_eq(annoObserver.ITEM_lastSet_Id, testItemId);
- do_check_eq(annoObserver.ITEM_lastSet_AnnoName, testAnnoName);
-
- try {
- var annoVal = annosvc.getItemAnnotation(testItemId, testAnnoName);
- // verify the anno value
- do_check_true(testAnnoVal === annoVal);
- } catch (ex) {
- do_throw("unable to get item annotation");
- }
-
- // test getPagesWithAnnotation
- var uri2 = uri("http://www.tests.tld");
- yield PlacesTestUtils.addVisits(uri2);
- annosvc.setPageAnnotation(uri2, testAnnoName, testAnnoVal, 0, 0);
- var pages = annosvc.getPagesWithAnnotation(testAnnoName);
- do_check_eq(pages.length, 2);
- // Don't rely on the order
- do_check_false(pages[0].equals(pages[1]));
- do_check_true(pages[0].equals(testURI) || pages[1].equals(testURI));
- do_check_true(pages[0].equals(uri2) || pages[1].equals(uri2));
-
- // test getItemsWithAnnotation
- var testItemId2 = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, uri2, -1, "");
- annosvc.setItemAnnotation(testItemId2, testAnnoName, testAnnoVal, 0, 0);
- var items = annosvc.getItemsWithAnnotation(testAnnoName);
- do_check_eq(items.length, 2);
- // Don't rely on the order
- do_check_true(items[0] != items[1]);
- do_check_true(items[0] == testItemId || items[1] == testItemId);
- do_check_true(items[0] == testItemId2 || items[1] == testItemId2);
-
- // get annotation that doesn't exist
- try {
- annosvc.getPageAnnotation(testURI, "blah");
- do_throw("fetching page-annotation that doesn't exist, should've thrown");
- } catch (ex) {}
- try {
- annosvc.getItemAnnotation(testURI, "blah");
- do_throw("fetching item-annotation that doesn't exist, should've thrown");
- } catch (ex) {}
-
- // get annotation info
- var flags = {}, exp = {}, storageType = {};
- annosvc.getPageAnnotationInfo(testURI, testAnnoName, flags, exp, storageType);
- do_check_eq(flags.value, 0);
- do_check_eq(exp.value, 0);
- do_check_eq(storageType.value, Ci.nsIAnnotationService.TYPE_STRING);
- annosvc.getItemAnnotationInfo(testItemId, testAnnoName, flags, exp, storageType);
- do_check_eq(flags.value, 0);
- do_check_eq(exp.value, 0);
- do_check_eq(storageType.value, Ci.nsIAnnotationService.TYPE_STRING);
-
- // get annotation names for a uri
- var annoNames = annosvc.getPageAnnotationNames(testURI);
- do_check_eq(annoNames.length, 1);
- do_check_eq(annoNames[0], "moz-test-places/annotations");
-
- // get annotation names for an item
- annoNames = annosvc.getItemAnnotationNames(testItemId);
- do_check_eq(annoNames.length, 1);
- do_check_eq(annoNames[0], "moz-test-places/annotations");
-
- // copy annotations to another uri
- var newURI = uri("http://mozilla.org");
- yield PlacesTestUtils.addVisits(newURI);
- annosvc.setPageAnnotation(testURI, "oldAnno", "new", 0, 0);
- annosvc.setPageAnnotation(newURI, "oldAnno", "old", 0, 0);
- annoNames = annosvc.getPageAnnotationNames(newURI);
- do_check_eq(annoNames.length, 1);
- do_check_eq(annoNames[0], "oldAnno");
- var oldAnnoNames = annosvc.getPageAnnotationNames(testURI);
- do_check_eq(oldAnnoNames.length, 2);
- var copiedAnno = oldAnnoNames[0];
- annosvc.copyPageAnnotations(testURI, newURI, false);
- var newAnnoNames = annosvc.getPageAnnotationNames(newURI);
- do_check_eq(newAnnoNames.length, 2);
- do_check_true(annosvc.pageHasAnnotation(newURI, "oldAnno"));
- do_check_true(annosvc.pageHasAnnotation(newURI, copiedAnno));
- do_check_eq(annosvc.getPageAnnotation(newURI, "oldAnno"), "old");
- annosvc.setPageAnnotation(newURI, "oldAnno", "new", 0, 0);
- annosvc.copyPageAnnotations(testURI, newURI, true);
- newAnnoNames = annosvc.getPageAnnotationNames(newURI);
- do_check_eq(newAnnoNames.length, 2);
- do_check_true(annosvc.pageHasAnnotation(newURI, "oldAnno"));
- do_check_true(annosvc.pageHasAnnotation(newURI, copiedAnno));
- do_check_eq(annosvc.getPageAnnotation(newURI, "oldAnno"), "new");
-
-
- // copy annotations to another item
- newURI = uri("http://mozilla.org");
- var newItemId = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, newURI, -1, "");
- var itemId = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, testURI, -1, "");
- annosvc.setItemAnnotation(itemId, "oldAnno", "new", 0, 0);
- annosvc.setItemAnnotation(itemId, "testAnno", "test", 0, 0);
- annosvc.setItemAnnotation(newItemId, "oldAnno", "old", 0, 0);
- annoNames = annosvc.getItemAnnotationNames(newItemId);
- do_check_eq(annoNames.length, 1);
- do_check_eq(annoNames[0], "oldAnno");
- oldAnnoNames = annosvc.getItemAnnotationNames(itemId);
- do_check_eq(oldAnnoNames.length, 2);
- copiedAnno = oldAnnoNames[0];
- annosvc.copyItemAnnotations(itemId, newItemId, false);
- newAnnoNames = annosvc.getItemAnnotationNames(newItemId);
- do_check_eq(newAnnoNames.length, 2);
- do_check_true(annosvc.itemHasAnnotation(newItemId, "oldAnno"));
- do_check_true(annosvc.itemHasAnnotation(newItemId, copiedAnno));
- do_check_eq(annosvc.getItemAnnotation(newItemId, "oldAnno"), "old");
- annosvc.setItemAnnotation(newItemId, "oldAnno", "new", 0, 0);
- annosvc.copyItemAnnotations(itemId, newItemId, true);
- newAnnoNames = annosvc.getItemAnnotationNames(newItemId);
- do_check_eq(newAnnoNames.length, 2);
- do_check_true(annosvc.itemHasAnnotation(newItemId, "oldAnno"));
- do_check_true(annosvc.itemHasAnnotation(newItemId, copiedAnno));
- do_check_eq(annosvc.getItemAnnotation(newItemId, "oldAnno"), "new");
-
- // test int32 anno type
- var int32Key = testAnnoName + "/types/Int32";
- var int32Val = 23;
- annosvc.setPageAnnotation(testURI, int32Key, int32Val, 0, 0);
- do_check_true(annosvc.pageHasAnnotation(testURI, int32Key));
- flags = {}, exp = {}, storageType = {};
- annosvc.getPageAnnotationInfo(testURI, int32Key, flags, exp, storageType);
- do_check_eq(flags.value, 0);
- do_check_eq(exp.value, 0);
- do_check_eq(storageType.value, Ci.nsIAnnotationService.TYPE_INT32);
- var storedVal = annosvc.getPageAnnotation(testURI, int32Key);
- do_check_true(int32Val === storedVal);
- annosvc.setItemAnnotation(testItemId, int32Key, int32Val, 0, 0);
- do_check_true(annosvc.itemHasAnnotation(testItemId, int32Key));
- annosvc.getItemAnnotationInfo(testItemId, int32Key, flags, exp, storageType);
- do_check_eq(flags.value, 0);
- do_check_eq(exp.value, 0);
- storedVal = annosvc.getItemAnnotation(testItemId, int32Key);
- do_check_true(int32Val === storedVal);
-
- // test int64 anno type
- var int64Key = testAnnoName + "/types/Int64";
- var int64Val = 4294967296;
- annosvc.setPageAnnotation(testURI, int64Key, int64Val, 0, 0);
- annosvc.getPageAnnotationInfo(testURI, int64Key, flags, exp, storageType);
- do_check_eq(flags.value, 0);
- do_check_eq(exp.value, 0);
- storedVal = annosvc.getPageAnnotation(testURI, int64Key);
- do_check_true(int64Val === storedVal);
- annosvc.setItemAnnotation(testItemId, int64Key, int64Val, 0, 0);
- do_check_true(annosvc.itemHasAnnotation(testItemId, int64Key));
- annosvc.getItemAnnotationInfo(testItemId, int64Key, flags, exp, storageType);
- do_check_eq(flags.value, 0);
- do_check_eq(exp.value, 0);
- storedVal = annosvc.getItemAnnotation(testItemId, int64Key);
- do_check_true(int64Val === storedVal);
-
- // test double anno type
- var doubleKey = testAnnoName + "/types/Double";
- var doubleVal = 0.000002342;
- annosvc.setPageAnnotation(testURI, doubleKey, doubleVal, 0, 0);
- annosvc.getPageAnnotationInfo(testURI, doubleKey, flags, exp, storageType);
- do_check_eq(flags.value, 0);
- do_check_eq(exp.value, 0);
- storedVal = annosvc.getPageAnnotation(testURI, doubleKey);
- do_check_true(doubleVal === storedVal);
- annosvc.setItemAnnotation(testItemId, doubleKey, doubleVal, 0, 0);
- do_check_true(annosvc.itemHasAnnotation(testItemId, doubleKey));
- annosvc.getItemAnnotationInfo(testItemId, doubleKey, flags, exp, storageType);
- do_check_eq(flags.value, 0);
- do_check_eq(exp.value, 0);
- do_check_eq(storageType.value, Ci.nsIAnnotationService.TYPE_DOUBLE);
- storedVal = annosvc.getItemAnnotation(testItemId, doubleKey);
- do_check_true(doubleVal === storedVal);
-
- // test annotation removal
- annosvc.removePageAnnotation(testURI, int32Key);
-
- annosvc.setItemAnnotation(testItemId, testAnnoName, testAnnoVal, 0, 0);
- // verify that removing an annotation updates the last modified date
- var lastModified3 = bmsvc.getItemLastModified(testItemId);
- // Workaround possible VM timers issues moving last modified to the past.
- bmsvc.setItemLastModified(testItemId, --lastModified3);
- annosvc.removeItemAnnotation(testItemId, int32Key);
- var lastModified4 = bmsvc.getItemLastModified(testItemId);
- do_print("verify that removing an annotation updates the last modified date");
- do_print("lastModified3 = " + lastModified3);
- do_print("lastModified4 = " + lastModified4);
- do_check_true(lastModified4 > lastModified3);
-
- do_check_eq(annoObserver.PAGE_lastRemoved_URI, testURI.spec);
- do_check_eq(annoObserver.PAGE_lastRemoved_AnnoName, int32Key);
- do_check_eq(annoObserver.ITEM_lastRemoved_Id, testItemId);
- do_check_eq(annoObserver.ITEM_lastRemoved_AnnoName, int32Key);
-
- // test that getItems/PagesWithAnnotation returns an empty array after
- // removing all items/pages which had the annotation set, see bug 380317.
- do_check_eq(annosvc.getItemsWithAnnotation(int32Key).length, 0);
- do_check_eq(annosvc.getPagesWithAnnotation(int32Key).length, 0);
-
- // Setting item annotations on invalid item ids should throw
- var invalidIds = [-1, 0, 37643];
- for (var id of invalidIds) {
- try {
- annosvc.setItemAnnotation(id, "foo", "bar", 0, 0);
- do_throw("setItemAnnotation* should throw for invalid item id: " + id)
- }
- catch (ex) { }
- }
-
- // setting an annotation with EXPIRE_HISTORY for an item should throw
- itemId = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, testURI, -1, "");
- try {
- annosvc.setItemAnnotation(itemId, "foo", "bar", 0, annosvc.EXPIRE_WITH_HISTORY);
- do_throw("setting an item annotation with EXPIRE_HISTORY should throw");
- }
- catch (ex) {
- }
-
- annosvc.removeObserver(annoObserver);
-});
-
-add_test(function test_getAnnotationsHavingName() {
- let uri = NetUtil.newURI("http://cat.mozilla.org");
- let id = PlacesUtils.bookmarks.insertBookmark(
- PlacesUtils.unfiledBookmarksFolderId, uri,
- PlacesUtils.bookmarks.DEFAULT_INDEX, "cat");
- let fid = PlacesUtils.bookmarks.createFolder(
- PlacesUtils.unfiledBookmarksFolderId, "pillow",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
-
- const ANNOS = {
- "int": 7,
- "double": 7.7,
- "string": "seven"
- };
- for (let name in ANNOS) {
- PlacesUtils.annotations.setPageAnnotation(
- uri, name, ANNOS[name], 0,
- PlacesUtils.annotations.EXPIRE_SESSION);
- PlacesUtils.annotations.setItemAnnotation(
- id, name, ANNOS[name], 0,
- PlacesUtils.annotations.EXPIRE_SESSION);
- PlacesUtils.annotations.setItemAnnotation(
- fid, name, ANNOS[name], 0,
- PlacesUtils.annotations.EXPIRE_SESSION);
- }
-
- for (let name in ANNOS) {
- let results = PlacesUtils.annotations.getAnnotationsWithName(name);
- do_check_eq(results.length, 3);
-
- for (let result of results) {
- do_check_eq(result.annotationName, name);
- do_check_eq(result.annotationValue, ANNOS[name]);
- if (result.uri)
- do_check_true(result.uri.equals(uri));
- else
- do_check_true(result.itemId > 0);
-
- if (result.itemId != -1) {
- if (result.uri)
- do_check_eq(result.itemId, id);
- else
- do_check_eq(result.itemId, fid);
- do_check_guid_for_bookmark(result.itemId, result.guid);
- }
- else {
- do_check_guid_for_uri(result.uri, result.guid);
- }
- }
- }
-
- run_next_test();
-});
diff --git a/toolkit/components/places/tests/unit/test_asyncExecuteLegacyQueries.js b/toolkit/components/places/tests/unit/test_asyncExecuteLegacyQueries.js
deleted file mode 100644
index 7296fe061..000000000
--- a/toolkit/components/places/tests/unit/test_asyncExecuteLegacyQueries.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-// This is a test for asyncExecuteLegacyQueries API.
-
-var tests = [
-
-function test_history_query() {
- let uri = NetUtil.newURI("http://test.visit.mozilla.com/");
- let title = "Test visit";
- PlacesTestUtils.addVisits({ uri: uri, title: title }).then(function () {
- let options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING;
- let query = PlacesUtils.history.getNewQuery();
-
- PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
- .asyncExecuteLegacyQueries([query], 1, options, {
- handleResult: function (aResultSet) {
- for (let row; (row = aResultSet.getNextRow());) {
- try {
- do_check_eq(row.getResultByIndex(1), uri.spec);
- do_check_eq(row.getResultByIndex(2), title);
- } catch (e) {
- do_throw("Error while fetching page data.");
- }
- }
- },
- handleError: function (aError) {
- do_throw("Async execution error (" + aError.result + "): " + aError.message);
- },
- handleCompletion: function (aReason) {
- run_next_test();
- },
- });
- });
-},
-
-function test_bookmarks_query() {
- let uri = NetUtil.newURI("http://test.bookmark.mozilla.com/");
- let title = "Test bookmark";
- bookmark(uri, title);
- let options = PlacesUtils.history.getNewQueryOptions();
- options.sortingMode = Ci.nsINavHistoryQueryOptions.SORT_BY_LASMODIFIED_DESCENDING;
- options.queryType = options.QUERY_TYPE_BOOKMARKS;
- let query = PlacesUtils.history.getNewQuery();
-
- PlacesUtils.history.QueryInterface(Ci.nsPIPlacesDatabase)
- .asyncExecuteLegacyQueries([query], 1, options, {
- handleResult: function (aResultSet) {
- for (let row; (row = aResultSet.getNextRow());) {
- try {
- do_check_eq(row.getResultByIndex(1), uri.spec);
- do_check_eq(row.getResultByIndex(2), title);
- } catch (e) {
- do_throw("Error while fetching page data.");
- }
- }
- },
- handleError: function (aError) {
- do_throw("Async execution error (" + aError.result + "): " + aError.message);
- },
- handleCompletion: function (aReason) {
- run_next_test();
- },
- });
-},
-
-];
-
-function bookmark(aURI, aTitle)
-{
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- aURI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- aTitle);
-}
-
-function run_test()
-{
- do_test_pending();
- run_next_test();
-}
-
-function run_next_test() {
- if (tests.length == 0) {
- do_test_finished();
- return;
- }
-
- Promise.all([
- PlacesTestUtils.clearHistory(),
- PlacesUtils.bookmarks.eraseEverything()
- ]).then(tests.shift());
-}
diff --git a/toolkit/components/places/tests/unit/test_async_history_api.js b/toolkit/components/places/tests/unit/test_async_history_api.js
deleted file mode 100644
index a012fcda2..000000000
--- a/toolkit/components/places/tests/unit/test_async_history_api.js
+++ /dev/null
@@ -1,1118 +0,0 @@
-/**
- * This file tests the async history API exposed by mozIAsyncHistory.
- */
-
-// Globals
-
-const TEST_DOMAIN = "http://mozilla.org/";
-const URI_VISIT_SAVED = "uri-visit-saved";
-const RECENT_EVENT_THRESHOLD = 15 * 60 * 1000000;
-
-// Helpers
-/**
- * Object that represents a mozIVisitInfo object.
- *
- * @param [optional] aTransitionType
- * The transition type of the visit. Defaults to TRANSITION_LINK if not
- * provided.
- * @param [optional] aVisitTime
- * The time of the visit. Defaults to now if not provided.
- */
-function VisitInfo(aTransitionType,
- aVisitTime) {
- this.transitionType =
- aTransitionType === undefined ? TRANSITION_LINK : aTransitionType;
- this.visitDate = aVisitTime || Date.now() * 1000;
-}
-
-function promiseUpdatePlaces(aPlaces) {
- return new Promise((resolve, reject) => {
- PlacesUtils.asyncHistory.updatePlaces(aPlaces, {
- _errors: [],
- _results: [],
- handleError(aResultCode, aPlace) {
- this._errors.push({ resultCode: aResultCode, info: aPlace});
- },
- handleResult(aPlace) {
- this._results.push(aPlace);
- },
- handleCompletion() {
- resolve({ errors: this._errors, results: this._results });
- }
- });
- });
-}
-
-/**
- * Listens for a title change notification, and calls aCallback when it gets it.
- *
- * @param aURI
- * The URI of the page we expect a notification for.
- * @param aExpectedTitle
- * The expected title of the URI we expect a notification for.
- * @param aCallback
- * The method to call when we have gotten the proper notification about
- * the title changing.
- */
-function TitleChangedObserver(aURI,
- aExpectedTitle,
- aCallback) {
- this.uri = aURI;
- this.expectedTitle = aExpectedTitle;
- this.callback = aCallback;
-}
-TitleChangedObserver.prototype = {
- __proto__: NavHistoryObserver.prototype,
- onTitleChanged(aURI, aTitle, aGUID) {
- do_print("onTitleChanged(" + aURI.spec + ", " + aTitle + ", " + aGUID + ")");
- if (!this.uri.equals(aURI)) {
- return;
- }
- do_check_eq(aTitle, this.expectedTitle);
- do_check_guid_for_uri(aURI, aGUID);
- this.callback();
- },
-};
-
-/**
- * Listens for a visit notification, and calls aCallback when it gets it.
- *
- * @param aURI
- * The URI of the page we expect a notification for.
- * @param aCallback
- * The method to call when we have gotten the proper notification about
- * being visited.
- */
-function VisitObserver(aURI,
- aGUID,
- aCallback)
-{
- this.uri = aURI;
- this.guid = aGUID;
- this.callback = aCallback;
-}
-VisitObserver.prototype = {
- __proto__: NavHistoryObserver.prototype,
- onVisit: function(aURI,
- aVisitId,
- aTime,
- aSessionId,
- aReferringId,
- aTransitionType,
- aGUID)
- {
- do_print("onVisit(" + aURI.spec + ", " + aVisitId + ", " + aTime +
- ", " + aSessionId + ", " + aReferringId + ", " +
- aTransitionType + ", " + aGUID + ")");
- if (!this.uri.equals(aURI) || this.guid != aGUID) {
- return;
- }
- this.callback(aTime, aTransitionType);
- },
-};
-
-/**
- * Tests that a title was set properly in the database.
- *
- * @param aURI
- * The uri to check.
- * @param aTitle
- * The expected title in the database.
- */
-function do_check_title_for_uri(aURI,
- aTitle)
-{
- let stack = Components.stack.caller;
- let stmt = DBConn().createStatement(
- `SELECT title
- FROM moz_places
- WHERE url_hash = hash(:url) AND url = :url`
- );
- stmt.params.url = aURI.spec;
- do_check_true(stmt.executeStep(), stack);
- do_check_eq(stmt.row.title, aTitle, stack);
- stmt.finalize();
-}
-
-// Test Functions
-
-add_task(function* test_interface_exists() {
- let history = Cc["@mozilla.org/browser/history;1"].getService(Ci.nsISupports);
- do_check_true(history instanceof Ci.mozIAsyncHistory);
-});
-
-add_task(function* test_invalid_uri_throws() {
- // First, test passing in nothing.
- let place = {
- visits: [
- new VisitInfo(),
- ],
- };
- try {
- yield promiseUpdatePlaces(place);
- do_throw("Should have thrown!");
- }
- catch (e) {
- do_check_eq(e.result, Cr.NS_ERROR_INVALID_ARG);
- }
-
- // Now, test other bogus things.
- const TEST_VALUES = [
- null,
- undefined,
- {},
- [],
- TEST_DOMAIN + "test_invalid_id_throws",
- ];
- for (let i = 0; i < TEST_VALUES.length; i++) {
- place.uri = TEST_VALUES[i];
- try {
- yield promiseUpdatePlaces(place);
- do_throw("Should have thrown!");
- }
- catch (e) {
- do_check_eq(e.result, Cr.NS_ERROR_INVALID_ARG);
- }
- }
-});
-
-add_task(function* test_invalid_places_throws() {
- // First, test passing in nothing.
- try {
- PlacesUtils.asyncHistory.updatePlaces();
- do_throw("Should have thrown!");
- }
- catch (e) {
- do_check_eq(e.result, Cr.NS_ERROR_XPC_NOT_ENOUGH_ARGS);
- }
-
- // Now, test other bogus things.
- const TEST_VALUES = [
- null,
- undefined,
- {},
- [],
- "",
- ];
- for (let i = 0; i < TEST_VALUES.length; i++) {
- let value = TEST_VALUES[i];
- try {
- yield promiseUpdatePlaces(value);
- do_throw("Should have thrown!");
- }
- catch (e) {
- do_check_eq(e.result, Cr.NS_ERROR_INVALID_ARG);
- }
- }
-});
-
-add_task(function* test_invalid_guid_throws() {
- // First check invalid length guid.
- let place = {
- guid: "BAD_GUID",
- uri: NetUtil.newURI(TEST_DOMAIN + "test_invalid_guid_throws"),
- visits: [
- new VisitInfo(),
- ],
- };
- try {
- yield promiseUpdatePlaces(place);
- do_throw("Should have thrown!");
- }
- catch (e) {
- do_check_eq(e.result, Cr.NS_ERROR_INVALID_ARG);
- }
-
- // Now check invalid character guid.
- place.guid = "__BADGUID+__";
- do_check_eq(place.guid.length, 12);
- try {
- yield promiseUpdatePlaces(place);
- do_throw("Should have thrown!");
- }
- catch (e) {
- do_check_eq(e.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_no_visits_throws() {
- const TEST_URI =
- NetUtil.newURI(TEST_DOMAIN + "test_no_id_or_guid_no_visits_throws");
- const TEST_GUID = "_RANDOMGUID_";
-
- let log_test_conditions = function(aPlace) {
- let str = "Testing place with " +
- (aPlace.uri ? "uri" : "no uri") + ", " +
- (aPlace.guid ? "guid" : "no guid") + ", " +
- (aPlace.visits ? "visits array" : "no visits array");
- do_print(str);
- };
-
- // Loop through every possible case. Note that we don't actually care about
- // the case where we have no uri, place id, or guid (covered by another test),
- // but it is easier to just make sure it too throws than to exclude it.
- let place = { };
- for (let uri = 1; uri >= 0; uri--) {
- place.uri = uri ? TEST_URI : undefined;
-
- for (let guid = 1; guid >= 0; guid--) {
- place.guid = guid ? TEST_GUID : undefined;
-
- for (let visits = 1; visits >= 0; visits--) {
- place.visits = visits ? [] : undefined;
-
- log_test_conditions(place);
- try {
- yield promiseUpdatePlaces(place);
- do_throw("Should have thrown!");
- }
- catch (e) {
- do_check_eq(e.result, Cr.NS_ERROR_INVALID_ARG);
- }
- }
- }
- }
-});
-
-add_task(function* test_add_visit_no_date_throws() {
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_add_visit_no_date_throws"),
- visits: [
- new VisitInfo(),
- ],
- };
- delete place.visits[0].visitDate;
- try {
- yield promiseUpdatePlaces(place);
- do_throw("Should have thrown!");
- }
- catch (e) {
- do_check_eq(e.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_add_visit_no_transitionType_throws() {
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_add_visit_no_transitionType_throws"),
- visits: [
- new VisitInfo(),
- ],
- };
- delete place.visits[0].transitionType;
- try {
- yield promiseUpdatePlaces(place);
- do_throw("Should have thrown!");
- }
- catch (e) {
- do_check_eq(e.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_add_visit_invalid_transitionType_throws() {
- // First, test something that has a transition type lower than the first one.
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN +
- "test_add_visit_invalid_transitionType_throws"),
- visits: [
- new VisitInfo(TRANSITION_LINK - 1),
- ],
- };
- try {
- yield promiseUpdatePlaces(place);
- do_throw("Should have thrown!");
- }
- catch (e) {
- do_check_eq(e.result, Cr.NS_ERROR_INVALID_ARG);
- }
-
- // Now, test something that has a transition type greater than the last one.
- place.visits[0] = new VisitInfo(TRANSITION_RELOAD + 1);
- try {
- yield promiseUpdatePlaces(place);
- do_throw("Should have thrown!");
- }
- catch (e) {
- do_check_eq(e.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_non_addable_uri_errors() {
- // Array of protocols that nsINavHistoryService::canAddURI returns false for.
- const URLS = [
- "about:config",
- "imap://cyrus.andrew.cmu.edu/archive.imap",
- "news://new.mozilla.org/mozilla.dev.apps.firefox",
- "mailbox:Inbox",
- "moz-anno:favicon:http://mozilla.org/made-up-favicon",
- "view-source:http://mozilla.org",
- "chrome://browser/content/browser.xul",
- "resource://gre-resources/hiddenWindow.html",
- "data:,Hello%2C%20World!",
- "wyciwyg:/0/http://mozilla.org",
- "javascript:alert('hello wolrd!');",
- "blob:foo",
- ];
- let places = [];
- URLS.forEach(function(url) {
- try {
- let place = {
- uri: NetUtil.newURI(url),
- title: "test for " + url,
- visits: [
- new VisitInfo(),
- ],
- };
- places.push(place);
- }
- catch (e) {
- if (e.result != Cr.NS_ERROR_FAILURE) {
- throw e;
- }
- // NetUtil.newURI() can throw if e.g. our app knows about imap://
- // but the account is not set up and so the URL is invalid for us.
- // Note this in the log but ignore as it's not the subject of this test.
- do_print("Could not construct URI for '" + url + "'; ignoring");
- }
- });
-
- let placesResult = yield promiseUpdatePlaces(places);
- if (placesResult.results.length > 0) {
- do_throw("Unexpected success.");
- }
- for (let place of placesResult.errors) {
- do_print("Checking '" + place.info.uri.spec + "'");
- do_check_eq(place.resultCode, Cr.NS_ERROR_INVALID_ARG);
- do_check_false(yield promiseIsURIVisited(place.info.uri));
- }
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-add_task(function* test_duplicate_guid_errors() {
- // This test ensures that trying to add a visit, with a guid already found in
- // another visit, fails.
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_duplicate_guid_fails_first"),
- visits: [
- new VisitInfo(),
- ],
- };
-
- do_check_false(yield promiseIsURIVisited(place.uri));
- let placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- let placeInfo = placesResult.results[0];
- do_check_true(yield promiseIsURIVisited(placeInfo.uri));
-
- let badPlace = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_duplicate_guid_fails_second"),
- visits: [
- new VisitInfo(),
- ],
- guid: placeInfo.guid,
- };
-
- do_check_false(yield promiseIsURIVisited(badPlace.uri));
- placesResult = yield promiseUpdatePlaces(badPlace);
- if (placesResult.results.length > 0) {
- do_throw("Unexpected success.");
- }
- let badPlaceInfo = placesResult.errors[0];
- do_check_eq(badPlaceInfo.resultCode, Cr.NS_ERROR_STORAGE_CONSTRAINT);
- do_check_false(yield promiseIsURIVisited(badPlaceInfo.info.uri));
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-add_task(function* test_invalid_referrerURI_ignored() {
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN +
- "test_invalid_referrerURI_ignored"),
- visits: [
- new VisitInfo(),
- ],
- };
- place.visits[0].referrerURI = NetUtil.newURI(place.uri.spec + "_unvisistedURI");
- do_check_false(yield promiseIsURIVisited(place.uri));
- do_check_false(yield promiseIsURIVisited(place.visits[0].referrerURI));
-
- let placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- let placeInfo = placesResult.results[0];
- do_check_true(yield promiseIsURIVisited(placeInfo.uri));
-
- // Check to make sure we do not visit the invalid referrer.
- do_check_false(yield promiseIsURIVisited(place.visits[0].referrerURI));
-
- // Check to make sure from_visit is zero in database.
- let stmt = DBConn().createStatement(
- `SELECT from_visit
- FROM moz_historyvisits
- WHERE id = :visit_id`
- );
- stmt.params.visit_id = placeInfo.visits[0].visitId;
- do_check_true(stmt.executeStep());
- do_check_eq(stmt.row.from_visit, 0);
- stmt.finalize();
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-add_task(function* test_nonnsIURI_referrerURI_ignored() {
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN +
- "test_nonnsIURI_referrerURI_ignored"),
- visits: [
- new VisitInfo(),
- ],
- };
- place.visits[0].referrerURI = place.uri.spec + "_nonnsIURI";
- do_check_false(yield promiseIsURIVisited(place.uri));
-
- let placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- let placeInfo = placesResult.results[0];
- do_check_true(yield promiseIsURIVisited(placeInfo.uri));
-
- // Check to make sure from_visit is zero in database.
- let stmt = DBConn().createStatement(
- `SELECT from_visit
- FROM moz_historyvisits
- WHERE id = :visit_id`
- );
- stmt.params.visit_id = placeInfo.visits[0].visitId;
- do_check_true(stmt.executeStep());
- do_check_eq(stmt.row.from_visit, 0);
- stmt.finalize();
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-add_task(function* test_old_referrer_ignored() {
- // This tests that a referrer for a visit which is not recent (specifically,
- // older than 15 minutes as per RECENT_EVENT_THRESHOLD) is not saved by
- // updatePlaces.
- let oldTime = (Date.now() * 1000) - (RECENT_EVENT_THRESHOLD + 1);
- let referrerPlace = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_old_referrer_ignored_referrer"),
- visits: [
- new VisitInfo(TRANSITION_LINK, oldTime),
- ],
- };
-
- // First we must add our referrer to the history so that it is not ignored
- // as being invalid.
- do_check_false(yield promiseIsURIVisited(referrerPlace.uri));
- let placesResult = yield promiseUpdatePlaces(referrerPlace);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
-
- // Now that the referrer is added, we can add a page with a valid
- // referrer to determine if the recency of the referrer is taken into
- // account.
- do_check_true(yield promiseIsURIVisited(referrerPlace.uri));
-
- let visitInfo = new VisitInfo();
- visitInfo.referrerURI = referrerPlace.uri;
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_old_referrer_ignored_page"),
- visits: [
- visitInfo,
- ],
- };
-
- do_check_false(yield promiseIsURIVisited(place.uri));
- placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- let placeInfo = placesResult.results[0];
- do_check_true(yield promiseIsURIVisited(place.uri));
-
- // Though the visit will not contain the referrer, we must examine the
- // database to be sure.
- do_check_eq(placeInfo.visits[0].referrerURI, null);
- let stmt = DBConn().createStatement(
- `SELECT COUNT(1) AS count
- FROM moz_historyvisits
- JOIN moz_places h ON h.id = place_id
- WHERE url_hash = hash(:page_url) AND url = :page_url
- AND from_visit = 0`
- );
- stmt.params.page_url = place.uri.spec;
- do_check_true(stmt.executeStep());
- do_check_eq(stmt.row.count, 1);
- stmt.finalize();
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-add_task(function* test_place_id_ignored() {
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_place_id_ignored_first"),
- visits: [
- new VisitInfo(),
- ],
- };
-
- do_check_false(yield promiseIsURIVisited(place.uri));
- let placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- let placeInfo = placesResult.results[0];
- do_check_true(yield promiseIsURIVisited(place.uri));
-
- let placeId = placeInfo.placeId;
- do_check_neq(placeId, 0);
-
- let badPlace = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_place_id_ignored_second"),
- visits: [
- new VisitInfo(),
- ],
- placeId: placeId,
- };
-
- do_check_false(yield promiseIsURIVisited(badPlace.uri));
- placesResult = yield promiseUpdatePlaces(badPlace);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- placeInfo = placesResult.results[0];
-
- do_check_neq(placeInfo.placeId, placeId);
- do_check_true(yield promiseIsURIVisited(badPlace.uri));
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-add_task(function* test_handleCompletion_called_when_complete() {
- // We test a normal visit, and embeded visit, and a uri that would fail
- // the canAddURI test to make sure that the notification happens after *all*
- // of them have had a callback.
- let places = [
- { uri: NetUtil.newURI(TEST_DOMAIN +
- "test_handleCompletion_called_when_complete"),
- visits: [
- new VisitInfo(),
- new VisitInfo(TRANSITION_EMBED),
- ],
- },
- { uri: NetUtil.newURI("data:,Hello%2C%20World!"),
- visits: [
- new VisitInfo(),
- ],
- },
- ];
- do_check_false(yield promiseIsURIVisited(places[0].uri));
- do_check_false(yield promiseIsURIVisited(places[1].uri));
-
- const EXPECTED_COUNT_SUCCESS = 2;
- const EXPECTED_COUNT_FAILURE = 1;
-
- let {results, errors} = yield promiseUpdatePlaces(places);
-
- do_check_eq(results.length, EXPECTED_COUNT_SUCCESS);
- do_check_eq(errors.length, EXPECTED_COUNT_FAILURE);
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-add_task(function* test_add_visit() {
- const VISIT_TIME = Date.now() * 1000;
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_add_visit"),
- title: "test_add_visit title",
- visits: [],
- };
- for (let t in PlacesUtils.history.TRANSITIONS) {
- let transitionType = PlacesUtils.history.TRANSITIONS[t];
- place.visits.push(new VisitInfo(transitionType, VISIT_TIME));
- }
- do_check_false(yield promiseIsURIVisited(place.uri));
-
- let callbackCount = 0;
- let placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- for (let placeInfo of placesResult.results) {
- do_check_true(yield promiseIsURIVisited(place.uri));
-
- // Check mozIPlaceInfo properties.
- do_check_true(place.uri.equals(placeInfo.uri));
- do_check_eq(placeInfo.frecency, -1); // We don't pass frecency here!
- do_check_eq(placeInfo.title, place.title);
-
- // Check mozIVisitInfo properties.
- let visits = placeInfo.visits;
- do_check_eq(visits.length, 1);
- let visit = visits[0];
- do_check_eq(visit.visitDate, VISIT_TIME);
- do_check_true(Object.values(PlacesUtils.history.TRANSITIONS).includes(visit.transitionType));
- do_check_true(visit.referrerURI === null);
-
- // For TRANSITION_EMBED visits, many properties will always be zero or
- // undefined.
- if (visit.transitionType == TRANSITION_EMBED) {
- // Check mozIPlaceInfo properties.
- do_check_eq(placeInfo.placeId, 0, '//');
- do_check_eq(placeInfo.guid, null);
-
- // Check mozIVisitInfo properties.
- do_check_eq(visit.visitId, 0);
- }
- // But they should be valid for non-embed visits.
- else {
- // Check mozIPlaceInfo properties.
- do_check_true(placeInfo.placeId > 0);
- do_check_valid_places_guid(placeInfo.guid);
-
- // Check mozIVisitInfo properties.
- do_check_true(visit.visitId > 0);
- }
-
- // If we have had all of our callbacks, continue running tests.
- if (++callbackCount == place.visits.length) {
- yield PlacesTestUtils.promiseAsyncUpdates();
- }
- }
-});
-
-add_task(function* test_properties_saved() {
- // Check each transition type to make sure it is saved properly.
- let places = [];
- for (let t in PlacesUtils.history.TRANSITIONS) {
- let transitionType = PlacesUtils.history.TRANSITIONS[t];
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_properties_saved/" +
- transitionType),
- title: "test_properties_saved test",
- visits: [
- new VisitInfo(transitionType),
- ],
- };
- do_check_false(yield promiseIsURIVisited(place.uri));
- places.push(place);
- }
-
- let callbackCount = 0;
- let placesResult = yield promiseUpdatePlaces(places);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- for (let placeInfo of placesResult.results) {
- let uri = placeInfo.uri;
- do_check_true(yield promiseIsURIVisited(uri));
- let visit = placeInfo.visits[0];
- print("TEST-INFO | test_properties_saved | updatePlaces callback for " +
- "transition type " + visit.transitionType);
-
- // Note that TRANSITION_EMBED should not be in the database.
- const EXPECTED_COUNT = visit.transitionType == TRANSITION_EMBED ? 0 : 1;
-
- // mozIVisitInfo::date
- let stmt = DBConn().createStatement(
- `SELECT COUNT(1) AS count
- FROM moz_places h
- JOIN moz_historyvisits v
- ON h.id = v.place_id
- WHERE h.url_hash = hash(:page_url) AND h.url = :page_url
- AND v.visit_date = :visit_date`
- );
- stmt.params.page_url = uri.spec;
- stmt.params.visit_date = visit.visitDate;
- do_check_true(stmt.executeStep());
- do_check_eq(stmt.row.count, EXPECTED_COUNT);
- stmt.finalize();
-
- // mozIVisitInfo::transitionType
- stmt = DBConn().createStatement(
- `SELECT COUNT(1) AS count
- FROM moz_places h
- JOIN moz_historyvisits v
- ON h.id = v.place_id
- WHERE h.url_hash = hash(:page_url) AND h.url = :page_url
- AND v.visit_type = :transition_type`
- );
- stmt.params.page_url = uri.spec;
- stmt.params.transition_type = visit.transitionType;
- do_check_true(stmt.executeStep());
- do_check_eq(stmt.row.count, EXPECTED_COUNT);
- stmt.finalize();
-
- // mozIPlaceInfo::title
- stmt = DBConn().createStatement(
- `SELECT COUNT(1) AS count
- FROM moz_places h
- WHERE h.url_hash = hash(:page_url) AND h.url = :page_url
- AND h.title = :title`
- );
- stmt.params.page_url = uri.spec;
- stmt.params.title = placeInfo.title;
- do_check_true(stmt.executeStep());
- do_check_eq(stmt.row.count, EXPECTED_COUNT);
- stmt.finalize();
-
- // If we have had all of our callbacks, continue running tests.
- if (++callbackCount == places.length) {
- yield PlacesTestUtils.promiseAsyncUpdates();
- }
- }
-});
-
-add_task(function* test_guid_saved() {
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_guid_saved"),
- guid: "__TESTGUID__",
- visits: [
- new VisitInfo(),
- ],
- };
- do_check_valid_places_guid(place.guid);
- do_check_false(yield promiseIsURIVisited(place.uri));
-
- let placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- let placeInfo = placesResult.results[0];
- let uri = placeInfo.uri;
- do_check_true(yield promiseIsURIVisited(uri));
- do_check_eq(placeInfo.guid, place.guid);
- do_check_guid_for_uri(uri, place.guid);
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-add_task(function* test_referrer_saved() {
- let places = [
- { uri: NetUtil.newURI(TEST_DOMAIN + "test_referrer_saved/referrer"),
- visits: [
- new VisitInfo(),
- ],
- },
- { uri: NetUtil.newURI(TEST_DOMAIN + "test_referrer_saved/test"),
- visits: [
- new VisitInfo(),
- ],
- },
- ];
- places[1].visits[0].referrerURI = places[0].uri;
- do_check_false(yield promiseIsURIVisited(places[0].uri));
- do_check_false(yield promiseIsURIVisited(places[1].uri));
-
- let resultCount = 0;
- let placesResult = yield promiseUpdatePlaces(places);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- for (let placeInfo of placesResult.results) {
- let uri = placeInfo.uri;
- do_check_true(yield promiseIsURIVisited(uri));
- let visit = placeInfo.visits[0];
-
- // We need to insert all of our visits before we can test conditions.
- if (++resultCount == places.length) {
- do_check_true(places[0].uri.equals(visit.referrerURI));
-
- let stmt = DBConn().createStatement(
- `SELECT COUNT(1) AS count
- FROM moz_historyvisits
- JOIN moz_places h ON h.id = place_id
- WHERE url_hash = hash(:page_url) AND url = :page_url
- AND from_visit = (
- SELECT v.id
- FROM moz_historyvisits v
- JOIN moz_places h ON h.id = place_id
- WHERE url_hash = hash(:referrer) AND url = :referrer
- )`
- );
- stmt.params.page_url = uri.spec;
- stmt.params.referrer = visit.referrerURI.spec;
- do_check_true(stmt.executeStep());
- do_check_eq(stmt.row.count, 1);
- stmt.finalize();
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- }
- }
-});
-
-add_task(function* test_guid_change_saved() {
- // First, add a visit for it.
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_guid_change_saved"),
- visits: [
- new VisitInfo(),
- ],
- };
- do_check_false(yield promiseIsURIVisited(place.uri));
-
- let placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- // Then, change the guid with visits.
- place.guid = "_GUIDCHANGE_";
- place.visits = [new VisitInfo()];
- placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- do_check_guid_for_uri(place.uri, place.guid);
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-add_task(function* test_title_change_saved() {
- // First, add a visit for it.
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_title_change_saved"),
- title: "original title",
- visits: [
- new VisitInfo(),
- ],
- };
- do_check_false(yield promiseIsURIVisited(place.uri));
-
- let placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
-
- // Now, make sure the empty string clears the title.
- place.title = "";
- place.visits = [new VisitInfo()];
- placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- do_check_title_for_uri(place.uri, null);
-
- // Then, change the title with visits.
- place.title = "title change";
- place.visits = [new VisitInfo()];
- placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- do_check_title_for_uri(place.uri, place.title);
-
- // Lastly, check that the title is cleared if we set it to null.
- place.title = null;
- place.visits = [new VisitInfo()];
- placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- do_check_title_for_uri(place.uri, place.title);
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-add_task(function* test_no_title_does_not_clear_title() {
- const TITLE = "test title";
- // First, add a visit for it.
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_no_title_does_not_clear_title"),
- title: TITLE,
- visits: [
- new VisitInfo(),
- ],
- };
- do_check_false(yield promiseIsURIVisited(place.uri));
-
- let placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- // Now, make sure that not specifying a title does not clear it.
- delete place.title;
- place.visits = [new VisitInfo()];
- placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
- do_check_title_for_uri(place.uri, TITLE);
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-add_task(function* test_title_change_notifies() {
- // There are three cases to test. The first case is to make sure we do not
- // get notified if we do not specify a title.
- let place = {
- uri: NetUtil.newURI(TEST_DOMAIN + "test_title_change_notifies"),
- visits: [
- new VisitInfo(),
- ],
- };
- do_check_false(yield promiseIsURIVisited(place.uri));
-
- let silentObserver =
- new TitleChangedObserver(place.uri, "DO NOT WANT", function() {
- do_throw("unexpected callback!");
- });
-
- PlacesUtils.history.addObserver(silentObserver, false);
- let placesResult = yield promiseUpdatePlaces(place);
- if (placesResult.errors.length > 0) {
- do_throw("Unexpected error.");
- }
-
- // The second case to test is that we get the notification when we add
- // it for the first time. The first case will fail before our callback if it
- // is busted, so we can do this now.
- place.uri = NetUtil.newURI(place.uri.spec + "/new-visit-with-title");
- place.title = "title 1";
- function promiseTitleChangedObserver(aPlace) {
- return new Promise((resolve, reject) => {
- let callbackCount = 0;
- let observer = new TitleChangedObserver(aPlace.uri, aPlace.title, function() {
- switch (++callbackCount) {
- case 1:
- // The third case to test is to make sure we get a notification when
- // we change an existing place.
- observer.expectedTitle = place.title = "title 2";
- place.visits = [new VisitInfo()];
- PlacesUtils.asyncHistory.updatePlaces(place);
- break;
- case 2:
- PlacesUtils.history.removeObserver(silentObserver);
- PlacesUtils.history.removeObserver(observer);
- resolve();
- break;
- }
- });
-
- PlacesUtils.history.addObserver(observer, false);
- PlacesUtils.asyncHistory.updatePlaces(aPlace);
- });
- }
-
- yield promiseTitleChangedObserver(place);
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-add_task(function* test_visit_notifies() {
- // There are two observers we need to see for each visit. One is an
- // nsINavHistoryObserver and the other is the uri-visit-saved observer topic.
- let place = {
- guid: "abcdefghijkl",
- uri: NetUtil.newURI(TEST_DOMAIN + "test_visit_notifies"),
- visits: [
- new VisitInfo(),
- ],
- };
- do_check_false(yield promiseIsURIVisited(place.uri));
-
- function promiseVisitObserver(aPlace) {
- return new Promise((resolve, reject) => {
- let callbackCount = 0;
- let finisher = function() {
- if (++callbackCount == 2) {
- resolve();
- }
- }
- let visitObserver = new VisitObserver(place.uri, place.guid,
- function(aVisitDate,
- aTransitionType) {
- let visit = place.visits[0];
- do_check_eq(visit.visitDate, aVisitDate);
- do_check_eq(visit.transitionType, aTransitionType);
-
- PlacesUtils.history.removeObserver(visitObserver);
- finisher();
- });
- PlacesUtils.history.addObserver(visitObserver, false);
- let observer = function(aSubject, aTopic, aData) {
- do_print("observe(" + aSubject + ", " + aTopic + ", " + aData + ")");
- do_check_true(aSubject instanceof Ci.nsIURI);
- do_check_true(aSubject.equals(place.uri));
-
- Services.obs.removeObserver(observer, URI_VISIT_SAVED);
- finisher();
- };
- Services.obs.addObserver(observer, URI_VISIT_SAVED, false);
- PlacesUtils.asyncHistory.updatePlaces(place);
- });
- }
-
- yield promiseVisitObserver(place);
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-// test with empty mozIVisitInfoCallback object
-add_task(function* test_callbacks_not_supplied() {
- const URLS = [
- "imap://cyrus.andrew.cmu.edu/archive.imap", // bad URI
- "http://mozilla.org/" // valid URI
- ];
- let places = [];
- URLS.forEach(function(url) {
- try {
- let place = {
- uri: NetUtil.newURI(url),
- title: "test for " + url,
- visits: [
- new VisitInfo(),
- ],
- };
- places.push(place);
- }
- catch (e) {
- if (e.result != Cr.NS_ERROR_FAILURE) {
- throw e;
- }
- // NetUtil.newURI() can throw if e.g. our app knows about imap://
- // but the account is not set up and so the URL is invalid for us.
- // Note this in the log but ignore as it's not the subject of this test.
- do_print("Could not construct URI for '" + url + "'; ignoring");
- }
- });
-
- PlacesUtils.asyncHistory.updatePlaces(places, {});
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-// Test that we don't wrongly overwrite typed and hidden when adding new visits.
-add_task(function* test_typed_hidden_not_overwritten() {
- yield PlacesTestUtils.clearHistory();
- let places = [
- { uri: NetUtil.newURI("http://mozilla.org/"),
- title: "test",
- visits: [
- new VisitInfo(TRANSITION_TYPED),
- new VisitInfo(TRANSITION_LINK)
- ]
- },
- { uri: NetUtil.newURI("http://mozilla.org/"),
- title: "test",
- visits: [
- new VisitInfo(TRANSITION_FRAMED_LINK)
- ]
- },
- ];
- yield promiseUpdatePlaces(places);
-
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.execute(
- "SELECT hidden, typed FROM moz_places WHERE url_hash = hash(:url) AND url = :url",
- { url: "http://mozilla.org/" });
- Assert.equal(rows[0].getResultByName("typed"), 1,
- "The page should be marked as typed");
- Assert.equal(rows[0].getResultByName("hidden"), 0,
- "The page should be marked as not hidden");
-});
-
-function run_test()
-{
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/unit/test_async_in_batchmode.js b/toolkit/components/places/tests/unit/test_async_in_batchmode.js
deleted file mode 100644
index b39b26519..000000000
--- a/toolkit/components/places/tests/unit/test_async_in_batchmode.js
+++ /dev/null
@@ -1,55 +0,0 @@
-// This is testing the frankenstein situation Sync forces Places into.
-// Sync does runInBatchMode() and before the callback returns the Places async
-// APIs are used (either by Sync itself, or by any other code in the system)
-// As seen in bug 1197856 and bug 1190131.
-
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-
-// This function "waits" for a promise to resolve by spinning a nested event
-// loop.
-function waitForPromise(promise) {
- let thread = Cc["@mozilla.org/thread-manager;1"].getService().currentThread;
-
- let finalResult, finalException;
-
- promise.then(result => {
- finalResult = result;
- }, err => {
- finalException = err;
- });
-
- // Keep waiting until our callback is triggered (unless the app is quitting).
- while (!finalResult && !finalException) {
- thread.processNextEvent(true);
- }
- if (finalException) {
- throw finalException;
- }
- return finalResult;
-}
-
-add_test(function() {
- let testCompleted = false;
- PlacesUtils.bookmarks.runInBatchMode({
- runBatched() {
- // create a bookmark.
- let info = { parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "http://example.com/" };
- let insertPromise = PlacesUtils.bookmarks.insert(info);
- let bookmark = waitForPromise(insertPromise);
- // Check we got a bookmark (bookmark creation failed completely in
- // bug 1190131)
- equal(bookmark.url, info.url);
- // Check the promiseItemGuid and promiseItemId helpers - failure in these
- // was the underlying reason for the failure.
- let id = waitForPromise(PlacesUtils.promiseItemId(bookmark.guid));
- let guid = waitForPromise(PlacesUtils.promiseItemGuid(id));
- equal(guid, bookmark.guid, "id and guid round-tripped correctly");
- testCompleted = true;
- }
- }, null);
- // make sure we tested what we think we tested.
- ok(testCompleted);
- run_next_test();
-});
diff --git a/toolkit/components/places/tests/unit/test_async_transactions.js b/toolkit/components/places/tests/unit/test_async_transactions.js
deleted file mode 100644
index edc9abf87..000000000
--- a/toolkit/components/places/tests/unit/test_async_transactions.js
+++ /dev/null
@@ -1,1739 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const bmsvc = PlacesUtils.bookmarks;
-const tagssvc = PlacesUtils.tagging;
-const annosvc = PlacesUtils.annotations;
-const PT = PlacesTransactions;
-const rootGuid = PlacesUtils.bookmarks.rootGuid;
-
-Components.utils.importGlobalProperties(["URL"]);
-
-// Create and add bookmarks observer.
-var observer = {
- __proto__: NavBookmarkObserver.prototype,
-
- tagRelatedGuids: new Set(),
-
- reset: function () {
- this.itemsAdded = new Map();
- this.itemsRemoved = new Map();
- this.itemsChanged = new Map();
- this.itemsMoved = new Map();
- this.beginUpdateBatch = false;
- this.endUpdateBatch = false;
- },
-
- onBeginUpdateBatch: function () {
- this.beginUpdateBatch = true;
- },
-
- onEndUpdateBatch: function () {
- this.endUpdateBatch = true;
- },
-
- onItemAdded:
- function (aItemId, aParentId, aIndex, aItemType, aURI, aTitle, aDateAdded,
- aGuid, aParentGuid) {
- // Ignore tag items.
- if (aParentId == PlacesUtils.tagsFolderId ||
- (aParentId != PlacesUtils.placesRootId &&
- bmsvc.getFolderIdForItem(aParentId) == PlacesUtils.tagsFolderId)) {
- this.tagRelatedGuids.add(aGuid);
- return;
- }
-
- this.itemsAdded.set(aGuid, { itemId: aItemId
- , parentGuid: aParentGuid
- , index: aIndex
- , itemType: aItemType
- , title: aTitle
- , url: aURI });
- },
-
- onItemRemoved:
- function (aItemId, aParentId, aIndex, aItemType, aURI, aGuid, aParentGuid) {
- if (this.tagRelatedGuids.has(aGuid))
- return;
-
- this.itemsRemoved.set(aGuid, { parentGuid: aParentGuid
- , index: aIndex
- , itemType: aItemType });
- },
-
- onItemChanged:
- function (aItemId, aProperty, aIsAnnoProperty, aNewValue, aLastModified,
- aItemType, aParentId, aGuid, aParentGuid) {
- if (this.tagRelatedGuids.has(aGuid))
- return;
-
- let changesForGuid = this.itemsChanged.get(aGuid);
- if (changesForGuid === undefined) {
- changesForGuid = new Map();
- this.itemsChanged.set(aGuid, changesForGuid);
- }
-
- let newValue = aNewValue;
- if (aIsAnnoProperty) {
- if (annosvc.itemHasAnnotation(aItemId, aProperty))
- newValue = annosvc.getItemAnnotation(aItemId, aProperty);
- else
- newValue = null;
- }
- let change = { isAnnoProperty: aIsAnnoProperty
- , newValue: newValue
- , lastModified: aLastModified
- , itemType: aItemType };
- changesForGuid.set(aProperty, change);
- },
-
- onItemVisited: () => {},
-
- onItemMoved:
- function (aItemId, aOldParent, aOldIndex, aNewParent, aNewIndex, aItemType,
- aGuid, aOldParentGuid, aNewParentGuid) {
- this.itemsMoved.set(aGuid, { oldParentGuid: aOldParentGuid
- , oldIndex: aOldIndex
- , newParentGuid: aNewParentGuid
- , newIndex: aNewIndex
- , itemType: aItemType });
- }
-};
-observer.reset();
-
-// index at which items should begin
-var bmStartIndex = 0;
-
-function run_test() {
- bmsvc.addObserver(observer, false);
- do_register_cleanup(function () {
- bmsvc.removeObserver(observer);
- });
-
- run_next_test();
-}
-
-function sanityCheckTransactionHistory() {
- do_check_true(PT.undoPosition <= PT.length);
-
- let check_entry_throws = f => {
- try {
- f();
- do_throw("PT.entry should throw for invalid input");
- } catch (ex) {}
- };
- check_entry_throws( () => PT.entry(-1) );
- check_entry_throws( () => PT.entry({}) );
- check_entry_throws( () => PT.entry(PT.length) );
-
- if (PT.undoPosition < PT.length)
- do_check_eq(PT.topUndoEntry, PT.entry(PT.undoPosition));
- else
- do_check_null(PT.topUndoEntry);
- if (PT.undoPosition > 0)
- do_check_eq(PT.topRedoEntry, PT.entry(PT.undoPosition - 1));
- else
- do_check_null(PT.topRedoEntry);
-}
-
-function getTransactionsHistoryState() {
- let history = [];
- for (let i = 0; i < PT.length; i++) {
- history.push(PT.entry(i));
- }
- return [history, PT.undoPosition];
-}
-
-function ensureUndoState(aExpectedEntries = [], aExpectedUndoPosition = 0) {
- // ensureUndoState is called in various places during this test, so it's
- // a good places to sanity-check the transaction-history APIs in all
- // cases.
- sanityCheckTransactionHistory();
-
- let [actualEntries, actualUndoPosition] = getTransactionsHistoryState();
- do_check_eq(actualEntries.length, aExpectedEntries.length);
- do_check_eq(actualUndoPosition, aExpectedUndoPosition);
-
- function checkEqualEntries(aExpectedEntry, aActualEntry) {
- do_check_eq(aExpectedEntry.length, aActualEntry.length);
- aExpectedEntry.forEach( (t, i) => do_check_eq(t, aActualEntry[i]) );
- }
- aExpectedEntries.forEach( (e, i) => checkEqualEntries(e, actualEntries[i]) );
-}
-
-function ensureItemsAdded(...items) {
- Assert.equal(observer.itemsAdded.size, items.length);
- for (let item of items) {
- Assert.ok(observer.itemsAdded.has(item.guid));
- let info = observer.itemsAdded.get(item.guid);
- Assert.equal(info.parentGuid, item.parentGuid);
- for (let propName of ["title", "index", "itemType"]) {
- if (propName in item)
- Assert.equal(info[propName], item[propName]);
- }
- if ("url" in item)
- Assert.ok(info.url.equals(item.url));
- }
-}
-
-function ensureItemsRemoved(...items) {
- Assert.equal(observer.itemsRemoved.size, items.length);
- for (let item of items) {
- // We accept both guids and full info object here.
- if (typeof(item) == "string") {
- Assert.ok(observer.itemsRemoved.has(item));
- }
- else {
- Assert.ok(observer.itemsRemoved.has(item.guid));
- let info = observer.itemsRemoved.get(item.guid);
- Assert.equal(info.parentGuid, item.parentGuid);
- if ("index" in item)
- Assert.equal(info.index, item.index);
- }
- }
-}
-
-function ensureItemsChanged(...items) {
- for (let item of items) {
- do_check_true(observer.itemsChanged.has(item.guid));
- let changes = observer.itemsChanged.get(item.guid);
- do_check_true(changes.has(item.property));
- let info = changes.get(item.property);
- do_check_eq(info.isAnnoProperty, Boolean(item.isAnnoProperty));
- do_check_eq(info.newValue, item.newValue);
- if ("url" in item)
- do_check_true(item.url.equals(info.url));
- }
-}
-
-function ensureAnnotationsSet(aGuid, aAnnos) {
- do_check_true(observer.itemsChanged.has(aGuid));
- let changes = observer.itemsChanged.get(aGuid);
- for (let anno of aAnnos) {
- do_check_true(changes.has(anno.name));
- let changeInfo = changes.get(anno.name);
- do_check_true(changeInfo.isAnnoProperty);
- do_check_eq(changeInfo.newValue, anno.value);
- }
-}
-
-function ensureItemsMoved(...items) {
- do_check_true(observer.itemsMoved.size, items.length);
- for (let item of items) {
- do_check_true(observer.itemsMoved.has(item.guid));
- let info = observer.itemsMoved.get(item.guid);
- do_check_eq(info.oldParentGuid, item.oldParentGuid);
- do_check_eq(info.oldIndex, item.oldIndex);
- do_check_eq(info.newParentGuid, item.newParentGuid);
- do_check_eq(info.newIndex, item.newIndex);
- }
-}
-
-function ensureTimestampsUpdated(aGuid, aCheckDateAdded = false) {
- do_check_true(observer.itemsChanged.has(aGuid));
- let changes = observer.itemsChanged.get(aGuid);
- if (aCheckDateAdded)
- do_check_true(changes.has("dateAdded"))
- do_check_true(changes.has("lastModified"));
-}
-
-function ensureTagsForURI(aURI, aTags) {
- let tagsSet = tagssvc.getTagsForURI(aURI);
- do_check_eq(tagsSet.length, aTags.length);
- do_check_true(aTags.every( t => tagsSet.includes(t)));
-}
-
-function createTestFolderInfo(aTitle = "Test Folder") {
- return { parentGuid: rootGuid, title: "Test Folder" };
-}
-
-function isLivemarkTree(aTree) {
- return !!aTree.annos &&
- aTree.annos.some( a => a.name == PlacesUtils.LMANNO_FEEDURI );
-}
-
-function* ensureLivemarkCreatedByAddLivemark(aLivemarkGuid) {
- // This throws otherwise.
- yield PlacesUtils.livemarks.getLivemark({ guid: aLivemarkGuid });
-}
-
-// Checks if two bookmark trees (as returned by promiseBookmarksTree) are the
-// same.
-// false value for aCheckParentAndPosition is ignored if aIsRestoredItem is set.
-function* ensureEqualBookmarksTrees(aOriginal,
- aNew,
- aIsRestoredItem = true,
- aCheckParentAndPosition = false) {
- // Note "id" is not-enumerable, and is therefore skipped by Object.keys (both
- // ours and the one at deepEqual). This is fine for us because ids are not
- // restored by Redo.
- if (aIsRestoredItem) {
- Assert.deepEqual(aOriginal, aNew);
- if (isLivemarkTree(aNew))
- yield ensureLivemarkCreatedByAddLivemark(aNew.guid);
- return;
- }
-
- for (let property of Object.keys(aOriginal)) {
- if (property == "children") {
- Assert.equal(aOriginal.children.length, aNew.children.length);
- for (let i = 0; i < aOriginal.children.length; i++) {
- yield ensureEqualBookmarksTrees(aOriginal.children[i],
- aNew.children[i],
- false,
- true);
- }
- }
- else if (property == "guid") {
- // guid shouldn't be copied if the item was not restored.
- Assert.notEqual(aOriginal.guid, aNew.guid);
- }
- else if (property == "dateAdded") {
- // dateAdded shouldn't be copied if the item was not restored.
- Assert.ok(is_time_ordered(aOriginal.dateAdded, aNew.dateAdded));
- }
- else if (property == "lastModified") {
- // same same, except for the never-changed case
- if (!aOriginal.lastModified)
- Assert.ok(!aNew.lastModified);
- else
- Assert.ok(is_time_ordered(aOriginal.lastModified, aNew.lastModified));
- }
- else if (aCheckParentAndPosition ||
- (property != "parentGuid" && property != "index")) {
- Assert.deepEqual(aOriginal[property], aNew[property]);
- }
- }
-
- if (isLivemarkTree(aNew))
- yield ensureLivemarkCreatedByAddLivemark(aNew.guid);
-}
-
-function* ensureBookmarksTreeRestoredCorrectly(...aOriginalBookmarksTrees) {
- for (let originalTree of aOriginalBookmarksTrees) {
- let restoredTree =
- yield PlacesUtils.promiseBookmarksTree(originalTree.guid);
- yield ensureEqualBookmarksTrees(originalTree, restoredTree);
- }
-}
-
-function* ensureNonExistent(...aGuids) {
- for (let guid of aGuids) {
- Assert.strictEqual((yield PlacesUtils.promiseBookmarksTree(guid)), null);
- }
-}
-
-add_task(function* test_recycled_transactions() {
- function* ensureTransactThrowsFor(aTransaction) {
- let [txns, undoPosition] = getTransactionsHistoryState();
- try {
- yield aTransaction.transact();
- do_throw("Shouldn't be able to use the same transaction twice");
- }
- catch (ex) { }
- ensureUndoState(txns, undoPosition);
- }
-
- let txn_a = PT.NewFolder(createTestFolderInfo());
- yield txn_a.transact();
- ensureUndoState([[txn_a]], 0);
- yield ensureTransactThrowsFor(txn_a);
-
- yield PT.undo();
- ensureUndoState([[txn_a]], 1);
- ensureTransactThrowsFor(txn_a);
-
- yield PT.clearTransactionsHistory();
- ensureUndoState();
- ensureTransactThrowsFor(txn_a);
-
- let txn_b = PT.NewFolder(createTestFolderInfo());
- yield PT.batch(function* () {
- try {
- yield txn_a.transact();
- do_throw("Shouldn't be able to use the same transaction twice");
- }
- catch (ex) { }
- ensureUndoState();
- yield txn_b.transact();
- });
- ensureUndoState([[txn_b]], 0);
-
- yield PT.undo();
- ensureUndoState([[txn_b]], 1);
- ensureTransactThrowsFor(txn_a);
- ensureTransactThrowsFor(txn_b);
-
- yield PT.clearTransactionsHistory();
- ensureUndoState();
- observer.reset();
-});
-
-add_task(function* test_new_folder_with_annotation() {
- const ANNO = { name: "TestAnno", value: "TestValue" };
- let folder_info = createTestFolderInfo();
- folder_info.index = bmStartIndex;
- folder_info.annotations = [ANNO];
- ensureUndoState();
- let txn = PT.NewFolder(folder_info);
- folder_info.guid = yield txn.transact();
- let ensureDo = function* (aRedo = false) {
- ensureUndoState([[txn]], 0);
- yield ensureItemsAdded(folder_info);
- ensureAnnotationsSet(folder_info.guid, [ANNO]);
- if (aRedo)
- ensureTimestampsUpdated(folder_info.guid, true);
- observer.reset();
- };
-
- let ensureUndo = () => {
- ensureUndoState([[txn]], 1);
- ensureItemsRemoved({ guid: folder_info.guid
- , parentGuid: folder_info.parentGuid
- , index: bmStartIndex });
- observer.reset();
- };
-
- yield ensureDo();
- yield PT.undo();
- yield ensureUndo();
- yield PT.redo();
- yield ensureDo(true);
- yield PT.undo();
- ensureUndo();
- yield PT.clearTransactionsHistory();
- ensureUndoState();
-});
-
-add_task(function* test_new_bookmark() {
- let bm_info = { parentGuid: rootGuid
- , url: NetUtil.newURI("http://test_create_item.com")
- , index: bmStartIndex
- , title: "Test creating an item" };
-
- ensureUndoState();
- let txn = PT.NewBookmark(bm_info);
- bm_info.guid = yield txn.transact();
-
- let ensureDo = function* (aRedo = false) {
- ensureUndoState([[txn]], 0);
- yield ensureItemsAdded(bm_info);
- if (aRedo)
- ensureTimestampsUpdated(bm_info.guid, true);
- observer.reset();
- };
- let ensureUndo = () => {
- ensureUndoState([[txn]], 1);
- ensureItemsRemoved({ guid: bm_info.guid
- , parentGuid: bm_info.parentGuid
- , index: bmStartIndex });
- observer.reset();
- };
-
- yield ensureDo();
- yield PT.undo();
- ensureUndo();
- yield PT.redo(true);
- yield ensureDo();
- yield PT.undo();
- ensureUndo();
-
- yield PT.clearTransactionsHistory();
- ensureUndoState();
-});
-
-add_task(function* test_merge_create_folder_and_item() {
- let folder_info = createTestFolderInfo();
- let bm_info = { url: NetUtil.newURI("http://test_create_item_to_folder.com")
- , title: "Test Bookmark"
- , index: bmStartIndex };
-
- let [folderTxnResult, bkmTxnResult] = yield PT.batch(function* () {
- let folderTxn = PT.NewFolder(folder_info);
- folder_info.guid = bm_info.parentGuid = yield folderTxn.transact();
- let bkmTxn = PT.NewBookmark(bm_info);
- bm_info.guid = yield bkmTxn.transact();
- return [folderTxn, bkmTxn];
- });
-
- let ensureDo = function* () {
- ensureUndoState([[bkmTxnResult, folderTxnResult]], 0);
- yield ensureItemsAdded(folder_info, bm_info);
- observer.reset();
- };
-
- let ensureUndo = () => {
- ensureUndoState([[bkmTxnResult, folderTxnResult]], 1);
- ensureItemsRemoved(folder_info, bm_info);
- observer.reset();
- };
-
- yield ensureDo();
- yield PT.undo();
- ensureUndo();
- yield PT.redo();
- yield ensureDo();
- yield PT.undo();
- ensureUndo();
-
- yield PT.clearTransactionsHistory();
- ensureUndoState();
-});
-
-add_task(function* test_move_items_to_folder() {
- let folder_a_info = createTestFolderInfo("Folder A");
- let bkm_a_info = { url: new URL("http://test_move_items.com")
- , title: "Bookmark A" };
- let bkm_b_info = { url: NetUtil.newURI("http://test_move_items.com")
- , title: "Bookmark B" };
-
- // Test moving items within the same folder.
- let [folder_a_txn_result, bkm_a_txn_result, bkm_b_txn_result] = yield PT.batch(function* () {
- let folder_a_txn = PT.NewFolder(folder_a_info);
-
- folder_a_info.guid = bkm_a_info.parentGuid = bkm_b_info.parentGuid =
- yield folder_a_txn.transact();
- let bkm_a_txn = PT.NewBookmark(bkm_a_info);
- bkm_a_info.guid = yield bkm_a_txn.transact();
- let bkm_b_txn = PT.NewBookmark(bkm_b_info);
- bkm_b_info.guid = yield bkm_b_txn.transact();
- return [folder_a_txn, bkm_a_txn, bkm_b_txn];
- });
-
- ensureUndoState([[bkm_b_txn_result, bkm_a_txn_result, folder_a_txn_result]], 0);
-
- let moveTxn = PT.Move({ guid: bkm_a_info.guid
- , newParentGuid: folder_a_info.guid });
- yield moveTxn.transact();
-
- let ensureDo = () => {
- ensureUndoState([[moveTxn], [bkm_b_txn_result, bkm_a_txn_result, folder_a_txn_result]], 0);
- ensureItemsMoved({ guid: bkm_a_info.guid
- , oldParentGuid: folder_a_info.guid
- , newParentGuid: folder_a_info.guid
- , oldIndex: 0
- , newIndex: 1 });
- observer.reset();
- };
- let ensureUndo = () => {
- ensureUndoState([[moveTxn], [bkm_b_txn_result, bkm_a_txn_result, folder_a_txn_result]], 1);
- ensureItemsMoved({ guid: bkm_a_info.guid
- , oldParentGuid: folder_a_info.guid
- , newParentGuid: folder_a_info.guid
- , oldIndex: 1
- , newIndex: 0 });
- observer.reset();
- };
-
- ensureDo();
- yield PT.undo();
- ensureUndo();
- yield PT.redo();
- ensureDo();
- yield PT.undo();
- ensureUndo();
-
- yield PT.clearTransactionsHistory(false, true);
- ensureUndoState([[bkm_b_txn_result, bkm_a_txn_result, folder_a_txn_result]], 0);
-
- // Test moving items between folders.
- let folder_b_info = createTestFolderInfo("Folder B");
- let folder_b_txn = PT.NewFolder(folder_b_info);
- folder_b_info.guid = yield folder_b_txn.transact();
- ensureUndoState([ [folder_b_txn]
- , [bkm_b_txn_result, bkm_a_txn_result, folder_a_txn_result] ], 0);
-
- moveTxn = PT.Move({ guid: bkm_a_info.guid
- , newParentGuid: folder_b_info.guid
- , newIndex: bmsvc.DEFAULT_INDEX });
- yield moveTxn.transact();
-
- ensureDo = () => {
- ensureUndoState([ [moveTxn]
- , [folder_b_txn]
- , [bkm_b_txn_result, bkm_a_txn_result, folder_a_txn_result] ], 0);
- ensureItemsMoved({ guid: bkm_a_info.guid
- , oldParentGuid: folder_a_info.guid
- , newParentGuid: folder_b_info.guid
- , oldIndex: 0
- , newIndex: 0 });
- observer.reset();
- };
- ensureUndo = () => {
- ensureUndoState([ [moveTxn]
- , [folder_b_txn]
- , [bkm_b_txn_result, bkm_a_txn_result, folder_a_txn_result] ], 1);
- ensureItemsMoved({ guid: bkm_a_info.guid
- , oldParentGuid: folder_b_info.guid
- , newParentGuid: folder_a_info.guid
- , oldIndex: 0
- , newIndex: 0 });
- observer.reset();
- };
-
- ensureDo();
- yield PT.undo();
- ensureUndo();
- yield PT.redo();
- ensureDo();
- yield PT.undo();
- ensureUndo();
-
- // Clean up
- yield PT.undo(); // folder_b_txn
- yield PT.undo(); // folder_a_txn + the bookmarks;
- do_check_eq(observer.itemsRemoved.size, 4);
- ensureUndoState([ [moveTxn]
- , [folder_b_txn]
- , [bkm_b_txn_result, bkm_a_txn_result, folder_a_txn_result] ], 3);
- yield PT.clearTransactionsHistory();
- ensureUndoState();
-});
-
-add_task(function* test_remove_folder() {
- let folder_level_1_info = createTestFolderInfo("Folder Level 1");
- let folder_level_2_info = { title: "Folder Level 2" };
- let [folder_level_1_txn_result,
- folder_level_2_txn_result] = yield PT.batch(function* () {
- let folder_level_1_txn = PT.NewFolder(folder_level_1_info);
- folder_level_1_info.guid = yield folder_level_1_txn.transact();
- folder_level_2_info.parentGuid = folder_level_1_info.guid;
- let folder_level_2_txn = PT.NewFolder(folder_level_2_info);
- folder_level_2_info.guid = yield folder_level_2_txn.transact();
- return [folder_level_1_txn, folder_level_2_txn];
- });
-
- ensureUndoState([[folder_level_2_txn_result, folder_level_1_txn_result]]);
- yield ensureItemsAdded(folder_level_1_info, folder_level_2_info);
- observer.reset();
-
- let remove_folder_2_txn = PT.Remove(folder_level_2_info);
- yield remove_folder_2_txn.transact();
-
- ensureUndoState([ [remove_folder_2_txn]
- , [folder_level_2_txn_result, folder_level_1_txn_result] ]);
- yield ensureItemsRemoved(folder_level_2_info);
-
- // Undo Remove "Folder Level 2"
- yield PT.undo();
- ensureUndoState([ [remove_folder_2_txn]
- , [folder_level_2_txn_result, folder_level_1_txn_result] ], 1);
- yield ensureItemsAdded(folder_level_2_info);
- ensureTimestampsUpdated(folder_level_2_info.guid, true);
- observer.reset();
-
- // Redo Remove "Folder Level 2"
- yield PT.redo();
- ensureUndoState([ [remove_folder_2_txn]
- , [folder_level_2_txn_result, folder_level_1_txn_result] ]);
- yield ensureItemsRemoved(folder_level_2_info);
- observer.reset();
-
- // Undo it again
- yield PT.undo();
- ensureUndoState([ [remove_folder_2_txn]
- , [folder_level_2_txn_result, folder_level_1_txn_result] ], 1);
- yield ensureItemsAdded(folder_level_2_info);
- ensureTimestampsUpdated(folder_level_2_info.guid, true);
- observer.reset();
-
- // Undo the creation of both folders
- yield PT.undo();
- ensureUndoState([ [remove_folder_2_txn]
- , [folder_level_2_txn_result, folder_level_1_txn_result] ], 2);
- yield ensureItemsRemoved(folder_level_2_info, folder_level_1_info);
- observer.reset();
-
- // Redo the creation of both folders
- yield PT.redo();
- ensureUndoState([ [remove_folder_2_txn]
- , [folder_level_2_txn_result, folder_level_1_txn_result] ], 1);
- yield ensureItemsAdded(folder_level_1_info, folder_level_2_info);
- ensureTimestampsUpdated(folder_level_1_info.guid, true);
- ensureTimestampsUpdated(folder_level_2_info.guid, true);
- observer.reset();
-
- // Redo Remove "Folder Level 2"
- yield PT.redo();
- ensureUndoState([ [remove_folder_2_txn]
- , [folder_level_2_txn_result, folder_level_1_txn_result] ]);
- yield ensureItemsRemoved(folder_level_2_info);
- observer.reset();
-
- // Undo everything one last time
- yield PT.undo();
- ensureUndoState([ [remove_folder_2_txn]
- , [folder_level_2_txn_result, folder_level_1_txn_result] ], 1);
- yield ensureItemsAdded(folder_level_2_info);
- observer.reset();
-
- yield PT.undo();
- ensureUndoState([ [remove_folder_2_txn]
- , [folder_level_2_txn_result, folder_level_1_txn_result] ], 2);
- yield ensureItemsRemoved(folder_level_2_info, folder_level_2_info);
- observer.reset();
-
- yield PT.clearTransactionsHistory();
- ensureUndoState();
-});
-
-add_task(function* test_add_and_remove_bookmarks_with_additional_info() {
- const testURI = NetUtil.newURI("http://add.remove.tag");
- const TAG_1 = "TestTag1";
- const TAG_2 = "TestTag2";
- const KEYWORD = "test_keyword";
- const POST_DATA = "post_data";
- const ANNO = { name: "TestAnno", value: "TestAnnoValue" };
-
- let folder_info = createTestFolderInfo();
- folder_info.guid = yield PT.NewFolder(folder_info).transact();
- let ensureTags = ensureTagsForURI.bind(null, testURI);
-
- // Check that the NewBookmark transaction preserves tags.
- observer.reset();
- let b1_info = { parentGuid: folder_info.guid, url: testURI, tags: [TAG_1] };
- b1_info.guid = yield PT.NewBookmark(b1_info).transact();
- ensureTags([TAG_1]);
- yield PT.undo();
- ensureTags([]);
-
- observer.reset();
- yield PT.redo();
- ensureTimestampsUpdated(b1_info.guid, true);
- ensureTags([TAG_1]);
-
- // Check if the Remove transaction removes and restores tags of children
- // correctly.
- yield PT.Remove(folder_info.guid).transact();
- ensureTags([]);
-
- observer.reset();
- yield PT.undo();
- ensureTimestampsUpdated(b1_info.guid, true);
- ensureTags([TAG_1]);
-
- yield PT.redo();
- ensureTags([]);
-
- observer.reset();
- yield PT.undo();
- ensureTimestampsUpdated(b1_info.guid, true);
- ensureTags([TAG_1]);
-
- // * Check that no-op tagging (the uri is already tagged with TAG_1) is
- // also a no-op on undo.
- // * Test the "keyword" property of the NewBookmark transaction.
- observer.reset();
- let b2_info = { parentGuid: folder_info.guid
- , url: testURI, tags: [TAG_1, TAG_2]
- , keyword: KEYWORD
- , postData: POST_DATA
- , annotations: [ANNO] };
- b2_info.guid = yield PT.NewBookmark(b2_info).transact();
- let b2_post_creation_changes = [
- { guid: b2_info.guid
- , isAnnoProperty: true
- , property: ANNO.name
- , newValue: ANNO.value },
- { guid: b2_info.guid
- , property: "keyword"
- , newValue: KEYWORD } ];
- ensureItemsChanged(...b2_post_creation_changes);
- ensureTags([TAG_1, TAG_2]);
-
- observer.reset();
- yield PT.undo();
- yield ensureItemsRemoved(b2_info);
- ensureTags([TAG_1]);
-
- // Check if Remove correctly restores keywords, tags and annotations.
- // Since both bookmarks share the same uri, they also share the keyword that
- // is not removed along with one of the bookmarks.
- observer.reset();
- yield PT.redo();
- ensureItemsChanged({ guid: b2_info.guid
- , isAnnoProperty: true
- , property: ANNO.name
- , newValue: ANNO.value });
- ensureTags([TAG_1, TAG_2]);
-
- // Test Remove for multiple items.
- observer.reset();
- yield PT.Remove(b1_info.guid).transact();
- yield PT.Remove(b2_info.guid).transact();
- yield PT.Remove(folder_info.guid).transact();
- yield ensureItemsRemoved(b1_info, b2_info, folder_info);
- ensureTags([]);
- // There is no keyword removal notification cause all bookmarks are removed
- // before the keyword itself, so there's no one to notify.
- let entry = yield PlacesUtils.keywords.fetch(KEYWORD);
- Assert.equal(entry, null, "keyword has been removed");
-
- observer.reset();
- yield PT.undo();
- yield ensureItemsAdded(folder_info);
- ensureTags([]);
-
- observer.reset();
- yield PT.undo();
- ensureItemsChanged(...b2_post_creation_changes);
- ensureTags([TAG_1, TAG_2]);
-
- observer.reset();
- yield PT.undo();
- yield ensureItemsAdded(b1_info);
- ensureTags([TAG_1, TAG_2]);
-
- // The redo calls below cleanup everything we did.
- observer.reset();
- yield PT.redo();
- yield ensureItemsRemoved(b1_info);
- ensureTags([TAG_1, TAG_2]);
-
- observer.reset();
- yield PT.redo();
- yield ensureItemsRemoved(b2_info);
- ensureTags([]);
-
- observer.reset();
- yield PT.redo();
- yield ensureItemsRemoved(folder_info);
- ensureTags([]);
-
- yield PT.clearTransactionsHistory();
- ensureUndoState();
-});
-
-add_task(function* test_creating_and_removing_a_separator() {
- let folder_info = createTestFolderInfo();
- let separator_info = {};
- let undoEntries = [];
-
- observer.reset();
- let create_txns = yield PT.batch(function* () {
- let folder_txn = PT.NewFolder(folder_info);
- folder_info.guid = separator_info.parentGuid = yield folder_txn.transact();
- let separator_txn = PT.NewSeparator(separator_info);
- separator_info.guid = yield separator_txn.transact();
- return [separator_txn, folder_txn];
- });
- undoEntries.unshift(create_txns);
- ensureUndoState(undoEntries, 0);
- ensureItemsAdded(folder_info, separator_info);
-
- observer.reset();
- yield PT.undo();
- ensureUndoState(undoEntries, 1);
- ensureItemsRemoved(folder_info, separator_info);
-
- observer.reset();
- yield PT.redo();
- ensureUndoState(undoEntries, 0);
- ensureItemsAdded(folder_info, separator_info);
-
- observer.reset();
- let remove_sep_txn = PT.Remove(separator_info);
- yield remove_sep_txn.transact();
- undoEntries.unshift([remove_sep_txn]);
- ensureUndoState(undoEntries, 0);
- ensureItemsRemoved(separator_info);
-
- observer.reset();
- yield PT.undo();
- ensureUndoState(undoEntries, 1);
- ensureItemsAdded(separator_info);
-
- observer.reset();
- yield PT.undo();
- ensureUndoState(undoEntries, 2);
- ensureItemsRemoved(folder_info, separator_info);
-
- observer.reset();
- yield PT.redo();
- ensureUndoState(undoEntries, 1);
- ensureItemsAdded(folder_info, separator_info);
-
- // Clear redo entries and check that |redo| does nothing
- observer.reset();
- yield PT.clearTransactionsHistory(false, true);
- undoEntries.shift();
- ensureUndoState(undoEntries, 0);
- yield PT.redo();
- ensureItemsAdded();
- ensureItemsRemoved();
-
- // Cleanup
- observer.reset();
- yield PT.undo();
- ensureUndoState(undoEntries, 1);
- ensureItemsRemoved(folder_info, separator_info);
- yield PT.clearTransactionsHistory();
- ensureUndoState();
-});
-
-add_task(function* test_add_and_remove_livemark() {
- let createLivemarkTxn = PT.NewLivemark(
- { feedUrl: NetUtil.newURI("http://test.remove.livemark")
- , parentGuid: rootGuid
- , title: "Test Remove Livemark" });
- let guid = yield createLivemarkTxn.transact();
- let originalInfo = yield PlacesUtils.promiseBookmarksTree(guid);
- Assert.ok(originalInfo);
- yield ensureLivemarkCreatedByAddLivemark(guid);
-
- let removeTxn = PT.Remove(guid);
- yield removeTxn.transact();
- yield ensureNonExistent(guid);
- function* undo() {
- ensureUndoState([[removeTxn], [createLivemarkTxn]], 0);
- yield PT.undo();
- ensureUndoState([[removeTxn], [createLivemarkTxn]], 1);
- yield ensureBookmarksTreeRestoredCorrectly(originalInfo);
- yield PT.undo();
- ensureUndoState([[removeTxn], [createLivemarkTxn]], 2);
- yield ensureNonExistent(guid);
- }
- function* redo() {
- ensureUndoState([[removeTxn], [createLivemarkTxn]], 2);
- yield PT.redo();
- ensureUndoState([[removeTxn], [createLivemarkTxn]], 1);
- yield ensureBookmarksTreeRestoredCorrectly(originalInfo);
- yield PT.redo();
- ensureUndoState([[removeTxn], [createLivemarkTxn]], 0);
- yield ensureNonExistent(guid);
- }
-
- yield undo();
- yield redo();
- yield undo();
- yield redo();
-
- // Cleanup
- yield undo();
- observer.reset();
- yield PT.clearTransactionsHistory();
-});
-
-add_task(function* test_edit_title() {
- let bm_info = { parentGuid: rootGuid
- , url: NetUtil.newURI("http://test_create_item.com")
- , title: "Original Title" };
-
- function ensureTitleChange(aCurrentTitle) {
- ensureItemsChanged({ guid: bm_info.guid
- , property: "title"
- , newValue: aCurrentTitle});
- }
-
- bm_info.guid = yield PT.NewBookmark(bm_info).transact();
-
- observer.reset();
- yield PT.EditTitle({ guid: bm_info.guid, title: "New Title" }).transact();
- ensureTitleChange("New Title");
-
- observer.reset();
- yield PT.undo();
- ensureTitleChange("Original Title");
-
- observer.reset();
- yield PT.redo();
- ensureTitleChange("New Title");
-
- // Cleanup
- observer.reset();
- yield PT.undo();
- ensureTitleChange("Original Title");
- yield PT.undo();
- ensureItemsRemoved(bm_info);
-
- yield PT.clearTransactionsHistory();
- ensureUndoState();
-});
-
-add_task(function* test_edit_url() {
- let oldURI = NetUtil.newURI("http://old.test_editing_item_uri.com/");
- let newURI = NetUtil.newURI("http://new.test_editing_item_uri.com/");
- let bm_info = { parentGuid: rootGuid, url: oldURI, tags: ["TestTag"] };
- function ensureURIAndTags(aPreChangeURI, aPostChangeURI, aOLdURITagsPreserved) {
- ensureItemsChanged({ guid: bm_info.guid
- , property: "uri"
- , newValue: aPostChangeURI.spec });
- ensureTagsForURI(aPostChangeURI, bm_info.tags);
- ensureTagsForURI(aPreChangeURI, aOLdURITagsPreserved ? bm_info.tags : []);
- }
-
- bm_info.guid = yield PT.NewBookmark(bm_info).transact();
- ensureTagsForURI(oldURI, bm_info.tags);
-
- // When there's a single bookmark for the same url, tags should be moved.
- observer.reset();
- yield PT.EditUrl({ guid: bm_info.guid, url: newURI }).transact();
- ensureURIAndTags(oldURI, newURI, false);
-
- observer.reset();
- yield PT.undo();
- ensureURIAndTags(newURI, oldURI, false);
-
- observer.reset();
- yield PT.redo();
- ensureURIAndTags(oldURI, newURI, false);
-
- observer.reset();
- yield PT.undo();
- ensureURIAndTags(newURI, oldURI, false);
-
- // When there're multiple bookmarks for the same url, tags should be copied.
- let bm2_info = Object.create(bm_info);
- bm2_info.guid = yield PT.NewBookmark(bm2_info).transact();
- let bm3_info = Object.create(bm_info);
- bm3_info.url = newURI;
- bm3_info.guid = yield PT.NewBookmark(bm3_info).transact();
-
- observer.reset();
- yield PT.EditUrl({ guid: bm_info.guid, url: newURI }).transact();
- ensureURIAndTags(oldURI, newURI, true);
-
- observer.reset();
- yield PT.undo();
- ensureURIAndTags(newURI, oldURI, true);
-
- observer.reset();
- yield PT.redo();
- ensureURIAndTags(oldURI, newURI, true);
-
- // Cleanup
- observer.reset();
- yield PT.undo();
- ensureURIAndTags(newURI, oldURI, true);
- yield PT.undo();
- yield PT.undo();
- yield PT.undo();
- ensureItemsRemoved(bm3_info, bm2_info, bm_info);
-
- yield PT.clearTransactionsHistory();
- ensureUndoState();
-});
-
-add_task(function* test_edit_keyword() {
- let bm_info = { parentGuid: rootGuid
- , url: NetUtil.newURI("http://test.edit.keyword") };
- const KEYWORD = "test_keyword";
- bm_info.guid = yield PT.NewBookmark(bm_info).transact();
- function ensureKeywordChange(aCurrentKeyword = "") {
- ensureItemsChanged({ guid: bm_info.guid
- , property: "keyword"
- , newValue: aCurrentKeyword });
- }
-
- bm_info.guid = yield PT.NewBookmark(bm_info).transact();
-
- observer.reset();
- yield PT.EditKeyword({ guid: bm_info.guid, keyword: KEYWORD, postData: "postData" }).transact();
- ensureKeywordChange(KEYWORD);
- let entry = yield PlacesUtils.keywords.fetch(KEYWORD);
- Assert.equal(entry.url.href, bm_info.url.spec);
- Assert.equal(entry.postData, "postData");
-
- observer.reset();
- yield PT.undo();
- ensureKeywordChange();
- entry = yield PlacesUtils.keywords.fetch(KEYWORD);
- Assert.equal(entry, null);
-
- observer.reset();
- yield PT.redo();
- ensureKeywordChange(KEYWORD);
- entry = yield PlacesUtils.keywords.fetch(KEYWORD);
- Assert.equal(entry.url.href, bm_info.url.spec);
- Assert.equal(entry.postData, "postData");
-
- // Cleanup
- observer.reset();
- yield PT.undo();
- ensureKeywordChange();
- yield PT.undo();
- ensureItemsRemoved(bm_info);
-
- yield PT.clearTransactionsHistory();
- ensureUndoState();
-});
-
-add_task(function* test_edit_specific_keyword() {
- let bm_info = { parentGuid: rootGuid
- , url: NetUtil.newURI("http://test.edit.keyword") };
- bm_info.guid = yield PT.NewBookmark(bm_info).transact();
- function ensureKeywordChange(aCurrentKeyword = "", aPreviousKeyword = "") {
- ensureItemsChanged({ guid: bm_info.guid
- , property: "keyword"
- , newValue: aCurrentKeyword
- });
- }
-
- yield PlacesUtils.keywords.insert({ keyword: "kw1", url: bm_info.url.spec, postData: "postData1" });
- yield PlacesUtils.keywords.insert({ keyword: "kw2", url: bm_info.url.spec, postData: "postData2" });
- bm_info.guid = yield PT.NewBookmark(bm_info).transact();
-
- observer.reset();
- yield PT.EditKeyword({ guid: bm_info.guid, keyword: "keyword", oldKeyword: "kw2" }).transact();
- ensureKeywordChange("keyword", "kw2");
- let entry = yield PlacesUtils.keywords.fetch("kw1");
- Assert.equal(entry.url.href, bm_info.url.spec);
- Assert.equal(entry.postData, "postData1");
- entry = yield PlacesUtils.keywords.fetch("keyword");
- Assert.equal(entry.url.href, bm_info.url.spec);
- Assert.equal(entry.postData, "postData2");
- entry = yield PlacesUtils.keywords.fetch("kw2");
- Assert.equal(entry, null);
-
- observer.reset();
- yield PT.undo();
- ensureKeywordChange("kw2", "keyword");
- entry = yield PlacesUtils.keywords.fetch("kw1");
- Assert.equal(entry.url.href, bm_info.url.spec);
- Assert.equal(entry.postData, "postData1");
- entry = yield PlacesUtils.keywords.fetch("kw2");
- Assert.equal(entry.url.href, bm_info.url.spec);
- Assert.equal(entry.postData, "postData2");
- entry = yield PlacesUtils.keywords.fetch("keyword");
- Assert.equal(entry, null);
-
- observer.reset();
- yield PT.redo();
- ensureKeywordChange("keyword", "kw2");
- entry = yield PlacesUtils.keywords.fetch("kw1");
- Assert.equal(entry.url.href, bm_info.url.spec);
- Assert.equal(entry.postData, "postData1");
- entry = yield PlacesUtils.keywords.fetch("keyword");
- Assert.equal(entry.url.href, bm_info.url.spec);
- Assert.equal(entry.postData, "postData2");
- entry = yield PlacesUtils.keywords.fetch("kw2");
- Assert.equal(entry, null);
-
- // Cleanup
- observer.reset();
- yield PT.undo();
- ensureKeywordChange("kw2");
- yield PT.undo();
- ensureItemsRemoved(bm_info);
-
- yield PT.clearTransactionsHistory();
- ensureUndoState();
-});
-
-add_task(function* test_tag_uri() {
- // This also tests passing uri specs.
- let bm_info_a = { url: "http://bookmarked.uri"
- , parentGuid: rootGuid };
- let bm_info_b = { url: NetUtil.newURI("http://bookmarked2.uri")
- , parentGuid: rootGuid };
- let unbookmarked_uri = NetUtil.newURI("http://un.bookmarked.uri");
-
- function* promiseIsBookmarked(aURI) {
- let deferred = Promise.defer();
- PlacesUtils.asyncGetBookmarkIds(aURI, ids => {
- deferred.resolve(ids.length > 0);
- });
- return deferred.promise;
- }
-
- yield PT.batch(function* () {
- bm_info_a.guid = yield PT.NewBookmark(bm_info_a).transact();
- bm_info_b.guid = yield PT.NewBookmark(bm_info_b).transact();
- });
-
- function* doTest(aInfo) {
- let urls = "url" in aInfo ? [aInfo.url] : aInfo.urls;
- let tags = "tag" in aInfo ? [aInfo.tag] : aInfo.tags;
-
- let ensureURI = url => typeof(url) == "string" ? NetUtil.newURI(url) : url;
- urls = urls.map(ensureURI);
-
- let tagWillAlsoBookmark = new Set();
- for (let url of urls) {
- if (!(yield promiseIsBookmarked(url))) {
- tagWillAlsoBookmark.add(url);
- }
- }
-
- function* ensureTagsSet() {
- for (let url of urls) {
- ensureTagsForURI(url, tags);
- Assert.ok(yield promiseIsBookmarked(url));
- }
- }
- function* ensureTagsUnset() {
- for (let url of urls) {
- ensureTagsForURI(url, []);
- if (tagWillAlsoBookmark.has(url))
- Assert.ok(!(yield promiseIsBookmarked(url)));
- else
- Assert.ok(yield promiseIsBookmarked(url));
- }
- }
-
- yield PT.Tag(aInfo).transact();
- yield ensureTagsSet();
- yield PT.undo();
- yield ensureTagsUnset();
- yield PT.redo();
- yield ensureTagsSet();
- yield PT.undo();
- yield ensureTagsUnset();
- }
-
- yield doTest({ url: bm_info_a.url, tags: ["MyTag"] });
- yield doTest({ urls: [bm_info_a.url], tag: "MyTag" });
- yield doTest({ urls: [bm_info_a.url, bm_info_b.url], tags: ["A, B"] });
- yield doTest({ urls: [bm_info_a.url, unbookmarked_uri], tag: "C" });
-
- // Cleanup
- observer.reset();
- yield PT.undo();
- ensureItemsRemoved(bm_info_a, bm_info_b);
-
- yield PT.clearTransactionsHistory();
- ensureUndoState();
-});
-
-add_task(function* test_untag_uri() {
- let bm_info_a = { url: NetUtil.newURI("http://bookmarked.uri")
- , parentGuid: rootGuid
- , tags: ["A", "B"] };
- let bm_info_b = { url: NetUtil.newURI("http://bookmarked2.uri")
- , parentGuid: rootGuid
- , tag: "B" };
-
- yield PT.batch(function* () {
- bm_info_a.guid = yield PT.NewBookmark(bm_info_a).transact();
- ensureTagsForURI(bm_info_a.url, bm_info_a.tags);
- bm_info_b.guid = yield PT.NewBookmark(bm_info_b).transact();
- ensureTagsForURI(bm_info_b.url, [bm_info_b.tag]);
- });
-
- function* doTest(aInfo) {
- let urls, tagsRemoved;
- if (aInfo instanceof Ci.nsIURI) {
- urls = [aInfo];
- tagsRemoved = [];
- }
- else if (Array.isArray(aInfo)) {
- urls = aInfo;
- tagsRemoved = [];
- }
- else {
- urls = "url" in aInfo ? [aInfo.url] : aInfo.urls;
- tagsRemoved = "tag" in aInfo ? [aInfo.tag] : aInfo.tags;
- }
-
- let preRemovalTags = new Map();
- for (let url of urls) {
- preRemovalTags.set(url, tagssvc.getTagsForURI(url));
- }
-
- function ensureTagsSet() {
- for (let url of urls) {
- ensureTagsForURI(url, preRemovalTags.get(url));
- }
- }
- function ensureTagsUnset() {
- for (let url of urls) {
- let expectedTags = tagsRemoved.length == 0 ?
- [] : preRemovalTags.get(url).filter(tag => !tagsRemoved.includes(tag));
- ensureTagsForURI(url, expectedTags);
- }
- }
-
- yield PT.Untag(aInfo).transact();
- yield ensureTagsUnset();
- yield PT.undo();
- yield ensureTagsSet();
- yield PT.redo();
- yield ensureTagsUnset();
- yield PT.undo();
- yield ensureTagsSet();
- }
-
- yield doTest(bm_info_a);
- yield doTest(bm_info_b);
- yield doTest(bm_info_a.url);
- yield doTest(bm_info_b.url);
- yield doTest([bm_info_a.url, bm_info_b.url]);
- yield doTest({ urls: [bm_info_a.url, bm_info_b.url], tags: ["A", "B"] });
- yield doTest({ urls: [bm_info_a.url, bm_info_b.url], tag: "B" });
- yield doTest({ urls: [bm_info_a.url, bm_info_b.url], tag: "C" });
- yield doTest({ urls: [bm_info_a.url, bm_info_b.url], tags: ["C"] });
-
- // Cleanup
- observer.reset();
- yield PT.undo();
- ensureItemsRemoved(bm_info_a, bm_info_b);
-
- yield PT.clearTransactionsHistory();
- ensureUndoState();
-});
-
-add_task(function* test_annotate() {
- let bm_info = { url: NetUtil.newURI("http://test.item.annotation")
- , parentGuid: rootGuid };
- let anno_info = { name: "TestAnno", value: "TestValue" };
- function ensureAnnoState(aSet) {
- ensureAnnotationsSet(bm_info.guid,
- [{ name: anno_info.name
- , value: aSet ? anno_info.value : null }]);
- }
-
- bm_info.guid = yield PT.NewBookmark(bm_info).transact();
-
- observer.reset();
- yield PT.Annotate({ guid: bm_info.guid, annotation: anno_info }).transact();
- ensureAnnoState(true);
-
- observer.reset();
- yield PT.undo();
- ensureAnnoState(false);
-
- observer.reset();
- yield PT.redo();
- ensureAnnoState(true);
-
- // Test removing the annotation by not passing the |value| property.
- observer.reset();
- yield PT.Annotate({ guid: bm_info.guid,
- annotation: { name: anno_info.name }}).transact();
- ensureAnnoState(false);
-
- observer.reset();
- yield PT.undo();
- ensureAnnoState(true);
-
- observer.reset();
- yield PT.redo();
- ensureAnnoState(false);
-
- // Cleanup
- yield PT.undo();
- observer.reset();
-});
-
-add_task(function* test_annotate_multiple() {
- let guid = yield PT.NewFolder(createTestFolderInfo()).transact();
- let itemId = yield PlacesUtils.promiseItemId(guid);
-
- function AnnoObj(aName, aValue) {
- this.name = aName;
- this.value = aValue;
- this.flags = 0;
- this.expires = Ci.nsIAnnotationService.EXPIRE_NEVER;
- }
-
- function annos(a = null, b = null) {
- return [new AnnoObj("A", a), new AnnoObj("B", b)];
- }
-
- function verifyAnnoValues(a = null, b = null) {
- let currentAnnos = PlacesUtils.getAnnotationsForItem(itemId);
- let expectedAnnos = [];
- if (a !== null)
- expectedAnnos.push(new AnnoObj("A", a));
- if (b !== null)
- expectedAnnos.push(new AnnoObj("B", b));
-
- Assert.deepEqual(currentAnnos, expectedAnnos);
- }
-
- yield PT.Annotate({ guid: guid, annotations: annos(1, 2) }).transact();
- verifyAnnoValues(1, 2);
- yield PT.undo();
- verifyAnnoValues();
- yield PT.redo();
- verifyAnnoValues(1, 2);
-
- yield PT.Annotate({ guid: guid
- , annotation: { name: "A" } }).transact();
- verifyAnnoValues(null, 2);
-
- yield PT.Annotate({ guid: guid
- , annotation: { name: "B", value: 0 } }).transact();
- verifyAnnoValues(null, 0);
- yield PT.undo();
- verifyAnnoValues(null, 2);
- yield PT.redo();
- verifyAnnoValues(null, 0);
- yield PT.undo();
- verifyAnnoValues(null, 2);
- yield PT.undo();
- verifyAnnoValues(1, 2);
- yield PT.undo();
- verifyAnnoValues();
-
- // Cleanup
- yield PT.undo();
- observer.reset();
-});
-
-add_task(function* test_sort_folder_by_name() {
- let folder_info = createTestFolderInfo();
-
- let url = NetUtil.newURI("http://sort.by.name/");
- let preSep = ["3", "2", "1"].map(i => ({ title: i, url }));
- let sep = {};
- let postSep = ["c", "b", "a"].map(l => ({ title: l, url }));
- let originalOrder = [...preSep, sep, ...postSep];
- let sortedOrder = [...preSep.slice(0).reverse(),
- sep,
- ...postSep.slice(0).reverse()];
- yield PT.batch(function* () {
- folder_info.guid = yield PT.NewFolder(folder_info).transact();
- for (let info of originalOrder) {
- info.parentGuid = folder_info.guid;
- info.guid = yield info == sep ?
- PT.NewSeparator(info).transact() :
- PT.NewBookmark(info).transact();
- }
- });
-
- let folderId = yield PlacesUtils.promiseItemId(folder_info.guid);
- let folderContainer = PlacesUtils.getFolderContents(folderId).root;
- function ensureOrder(aOrder) {
- for (let i = 0; i < folderContainer.childCount; i++) {
- do_check_eq(folderContainer.getChild(i).bookmarkGuid, aOrder[i].guid);
- }
- }
-
- ensureOrder(originalOrder);
- yield PT.SortByName(folder_info.guid).transact();
- ensureOrder(sortedOrder);
- yield PT.undo();
- ensureOrder(originalOrder);
- yield PT.redo();
- ensureOrder(sortedOrder);
-
- // Cleanup
- observer.reset();
- yield PT.undo();
- ensureOrder(originalOrder);
- yield PT.undo();
- ensureItemsRemoved(...originalOrder, folder_info);
-});
-
-add_task(function* test_livemark_txns() {
- let livemark_info =
- { feedUrl: NetUtil.newURI("http://test.feed.uri")
- , parentGuid: rootGuid
- , title: "Test Livemark" };
- function ensureLivemarkAdded() {
- ensureItemsAdded({ guid: livemark_info.guid
- , title: livemark_info.title
- , parentGuid: livemark_info.parentGuid
- , itemType: bmsvc.TYPE_FOLDER });
- let annos = [{ name: PlacesUtils.LMANNO_FEEDURI
- , value: livemark_info.feedUrl.spec }];
- if ("siteUrl" in livemark_info) {
- annos.push({ name: PlacesUtils.LMANNO_SITEURI
- , value: livemark_info.siteUrl.spec });
- }
- ensureAnnotationsSet(livemark_info.guid, annos);
- }
- function ensureLivemarkRemoved() {
- ensureItemsRemoved({ guid: livemark_info.guid
- , parentGuid: livemark_info.parentGuid });
- }
-
- function* _testDoUndoRedoUndo() {
- observer.reset();
- livemark_info.guid = yield PT.NewLivemark(livemark_info).transact();
- ensureLivemarkAdded();
-
- observer.reset();
- yield PT.undo();
- ensureLivemarkRemoved();
-
- observer.reset();
- yield PT.redo();
- ensureLivemarkAdded();
-
- yield PT.undo();
- ensureLivemarkRemoved();
- }
-
- yield* _testDoUndoRedoUndo()
- livemark_info.siteUrl = NetUtil.newURI("http://feed.site.uri");
- yield* _testDoUndoRedoUndo();
-
- // Cleanup
- observer.reset();
- yield PT.clearTransactionsHistory();
-});
-
-add_task(function* test_copy() {
- function* duplicate_and_test(aOriginalGuid) {
- let txn = PT.Copy({ guid: aOriginalGuid, newParentGuid: rootGuid });
- yield duplicateGuid = yield txn.transact();
- let originalInfo = yield PlacesUtils.promiseBookmarksTree(aOriginalGuid);
- let duplicateInfo = yield PlacesUtils.promiseBookmarksTree(duplicateGuid);
- yield ensureEqualBookmarksTrees(originalInfo, duplicateInfo, false);
-
- function* redo() {
- yield PT.redo();
- yield ensureBookmarksTreeRestoredCorrectly(originalInfo);
- yield PT.redo();
- yield ensureBookmarksTreeRestoredCorrectly(duplicateInfo);
- }
- function* undo() {
- yield PT.undo();
- // also undo the original item addition.
- yield PT.undo();
- yield ensureNonExistent(aOriginalGuid, duplicateGuid);
- }
-
- yield undo();
- yield redo();
- yield undo();
- yield redo();
-
- // Cleanup. This also remove the original item.
- yield PT.undo();
- observer.reset();
- yield PT.clearTransactionsHistory();
- }
-
- // Test duplicating leafs (bookmark, separator, empty folder)
- PT.NewBookmark({ url: new URL("http://test.item.duplicate")
- , parentGuid: rootGuid
- , annos: [{ name: "Anno", value: "AnnoValue"}] });
- let sepTxn = PT.NewSeparator({ parentGuid: rootGuid, index: 1 });
- let livemarkTxn = PT.NewLivemark(
- { feedUrl: new URL("http://test.feed.uri")
- , parentGuid: rootGuid
- , title: "Test Livemark", index: 1 });
- let emptyFolderTxn = PT.NewFolder(createTestFolderInfo());
- for (let txn of [livemarkTxn, sepTxn, emptyFolderTxn]) {
- let guid = yield txn.transact();
- yield duplicate_and_test(guid);
- }
-
- // Test duplicating a folder having some contents.
- let filledFolderGuid = yield PT.batch(function *() {
- let folderGuid = yield PT.NewFolder(createTestFolderInfo()).transact();
- let nestedFolderGuid =
- yield PT.NewFolder({ parentGuid: folderGuid
- , title: "Nested Folder" }).transact();
- // Insert a bookmark under the nested folder.
- yield PT.NewBookmark({ url: new URL("http://nested.nested.bookmark")
- , parentGuid: nestedFolderGuid }).transact();
- // Insert a separator below the nested folder
- yield PT.NewSeparator({ parentGuid: folderGuid }).transact();
- // And another bookmark.
- yield PT.NewBookmark({ url: new URL("http://nested.bookmark")
- , parentGuid: folderGuid }).transact();
- return folderGuid;
- });
-
- yield duplicate_and_test(filledFolderGuid);
-
- // Cleanup
- yield PT.clearTransactionsHistory();
-});
-
-add_task(function* test_array_input_for_batch() {
- let folderTxn = PT.NewFolder(createTestFolderInfo());
- let folderGuid = yield folderTxn.transact();
-
- let sep1_txn = PT.NewSeparator({ parentGuid: folderGuid });
- let sep2_txn = PT.NewSeparator({ parentGuid: folderGuid });
- yield PT.batch([sep1_txn, sep2_txn]);
- ensureUndoState([[sep2_txn, sep1_txn], [folderTxn]], 0);
-
- let ensureChildCount = function* (count) {
- let tree = yield PlacesUtils.promiseBookmarksTree(folderGuid);
- if (count == 0)
- Assert.ok(!("children" in tree));
- else
- Assert.equal(tree.children.length, count);
- };
-
- yield ensureChildCount(2);
- yield PT.undo();
- yield ensureChildCount(0);
- yield PT.redo()
- yield ensureChildCount(2);
- yield PT.undo();
- yield ensureChildCount(0);
-
- yield PT.undo();
- Assert.equal((yield PlacesUtils.promiseBookmarksTree(folderGuid)), null);
-
- // Cleanup
- yield PT.clearTransactionsHistory();
-});
-
-add_task(function* test_copy_excluding_annotations() {
- let folderInfo = createTestFolderInfo();
- let anno = n => { return { name: n, value: 1 } };
- folderInfo.annotations = [anno("a"), anno("b"), anno("c")];
- let folderGuid = yield PT.NewFolder(folderInfo).transact();
-
- let ensureAnnosSet = function* (guid, ...expectedAnnoNames) {
- let tree = yield PlacesUtils.promiseBookmarksTree(guid);
- let annoNames = "annos" in tree ?
- tree.annos.map(a => a.name).sort() : [];
- Assert.deepEqual(annoNames, expectedAnnoNames);
- };
-
- yield ensureAnnosSet(folderGuid, "a", "b", "c");
-
- let excluding_a_dupeGuid =
- yield PT.Copy({ guid: folderGuid
- , newParentGuid: rootGuid
- , excludingAnnotation: "a" }).transact();
- yield ensureAnnosSet(excluding_a_dupeGuid, "b", "c");
-
- let excluding_ac_dupeGuid =
- yield PT.Copy({ guid: folderGuid
- , newParentGuid: rootGuid
- , excludingAnnotations: ["a", "c"] }).transact();
- yield ensureAnnosSet(excluding_ac_dupeGuid, "b");
-
- // Cleanup
- yield PT.undo();
- yield PT.undo();
- yield PT.undo();
- yield PT.clearTransactionsHistory();
-});
-
-add_task(function* test_invalid_uri_spec_throws() {
- Assert.throws(() =>
- PT.NewBookmark({ parentGuid: rootGuid
- , url: "invalid uri spec"
- , title: "test bookmark" }));
- Assert.throws(() =>
- PT.Tag({ tag: "TheTag"
- , urls: ["invalid uri spec"] }));
- Assert.throws(() =>
- PT.Tag({ tag: "TheTag"
- , urls: ["about:blank", "invalid uri spec"] }));
-});
-
-add_task(function* test_annotate_multiple_items() {
- let parentGuid = rootGuid;
- let guids = [
- yield PT.NewBookmark({ url: "about:blank", parentGuid }).transact(),
- yield PT.NewFolder({ title: "Test Folder", parentGuid }).transact()];
-
- let annotation = { name: "TestAnno", value: "TestValue" };
- yield PT.Annotate({ guids, annotation }).transact();
-
- function *ensureAnnoSet() {
- for (let guid of guids) {
- let itemId = yield PlacesUtils.promiseItemId(guid);
- Assert.equal(annosvc.getItemAnnotation(itemId, annotation.name),
- annotation.value);
- }
- }
- function *ensureAnnoUnset() {
- for (let guid of guids) {
- let itemId = yield PlacesUtils.promiseItemId(guid);
- Assert.ok(!annosvc.itemHasAnnotation(itemId, annotation.name));
- }
- }
-
- yield ensureAnnoSet();
- yield PT.undo();
- yield ensureAnnoUnset();
- yield PT.redo();
- yield ensureAnnoSet();
- yield PT.undo();
- yield ensureAnnoUnset();
-
- // Cleanup
- yield PT.undo();
- yield PT.undo();
- yield ensureNonExistent(...guids);
- yield PT.clearTransactionsHistory();
- observer.reset();
-});
-
-add_task(function* test_remove_multiple() {
- let guids = [];
- yield PT.batch(function* () {
- let folderGuid = yield PT.NewFolder({ title: "Test Folder"
- , parentGuid: rootGuid }).transact();
- let nestedFolderGuid =
- yield PT.NewFolder({ title: "Nested Test Folder"
- , parentGuid: folderGuid }).transact();
- yield PT.NewSeparator(nestedFolderGuid).transact();
-
- guids.push(folderGuid);
-
- let bmGuid =
- yield PT.NewBookmark({ url: new URL("http://test.bookmark.removed")
- , parentGuid: rootGuid }).transact();
- guids.push(bmGuid);
- });
-
- let originalInfos = [];
- for (let guid of guids) {
- originalInfos.push(yield PlacesUtils.promiseBookmarksTree(guid));
- }
-
- yield PT.Remove(guids).transact();
- yield ensureNonExistent(...guids);
- yield PT.undo();
- yield ensureBookmarksTreeRestoredCorrectly(...originalInfos);
- yield PT.redo();
- yield ensureNonExistent(...guids);
- yield PT.undo();
- yield ensureBookmarksTreeRestoredCorrectly(...originalInfos);
-
- // Undo the New* transactions batch.
- yield PT.undo();
- yield ensureNonExistent(...guids);
-
- // Redo it.
- yield PT.redo();
- yield ensureBookmarksTreeRestoredCorrectly(...originalInfos);
-
- // Redo remove.
- yield PT.redo();
- yield ensureNonExistent(...guids);
-
- // Cleanup
- yield PT.clearTransactionsHistory();
- observer.reset();
-});
-
-add_task(function* test_remove_bookmarks_for_urls() {
- let urls = [new URL("http://test.url.1"), new URL("http://test.url.2")];
- let guids = [];
- yield PT.batch(function* () {
- for (let url of urls) {
- for (let title of ["test title a", "test title b"]) {
- let txn = PT.NewBookmark({ url, title, parentGuid: rootGuid });
- guids.push(yield txn.transact());
- }
- }
- });
-
- let originalInfos = [];
- for (let guid of guids) {
- originalInfos.push(yield PlacesUtils.promiseBookmarksTree(guid));
- }
-
- yield PT.RemoveBookmarksForUrls(urls).transact();
- yield ensureNonExistent(...guids);
- yield PT.undo();
- yield ensureBookmarksTreeRestoredCorrectly(...originalInfos);
- yield PT.redo();
- yield ensureNonExistent(...guids);
- yield PT.undo();
- yield ensureBookmarksTreeRestoredCorrectly(...originalInfos);
-
- // Cleanup.
- yield PT.redo();
- yield ensureNonExistent(...guids);
- yield PT.clearTransactionsHistory();
- observer.reset();
-});
diff --git a/toolkit/components/places/tests/unit/test_autocomplete_stopSearch_no_throw.js b/toolkit/components/places/tests/unit/test_autocomplete_stopSearch_no_throw.js
deleted file mode 100644
index 7d5df565f..000000000
--- a/toolkit/components/places/tests/unit/test_autocomplete_stopSearch_no_throw.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Added with bug 508102 to make sure that calling stopSearch on our
- * AutoComplete implementation does not throw.
- */
-
-// Globals and Constants
-
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-var ac = Cc["@mozilla.org/autocomplete/search;1?name=unifiedcomplete"].
- getService(Ci.nsIAutoCompleteSearch);
-
-// Test Functions
-
-function test_stopSearch()
-{
- try {
- ac.stopSearch();
- }
- catch (e) {
- do_throw("we should not have caught anything!");
- }
-}
-
-// Test Runner
-
-var tests = [
- test_stopSearch,
-];
-function run_test()
-{
- tests.forEach(test => test());
-}
diff --git a/toolkit/components/places/tests/unit/test_bookmark_catobs.js b/toolkit/components/places/tests/unit/test_bookmark_catobs.js
deleted file mode 100644
index e2b589090..000000000
--- a/toolkit/components/places/tests/unit/test_bookmark_catobs.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function run_test() {
- run_next_test()
-}
-
-add_task(function* test_observers() {
- do_load_manifest("nsDummyObserver.manifest");
-
- let dummyCreated = false;
- let dummyReceivedOnItemAdded = false;
-
- Services.obs.addObserver(function created() {
- Services.obs.removeObserver(created, "dummy-observer-created");
- dummyCreated = true;
- }, "dummy-observer-created", false);
- Services.obs.addObserver(function added() {
- Services.obs.removeObserver(added, "dummy-observer-item-added");
- dummyReceivedOnItemAdded = true;
- }, "dummy-observer-item-added", false);
-
- let initialObservers = PlacesUtils.bookmarks.getObservers();
-
- // Add a common observer, it should be invoked after the category observer.
- let notificationsPromised = new Promise((resolve, reject) => {
- PlacesUtils.bookmarks.addObserver( {
- __proto__: NavBookmarkObserver.prototype,
- onItemAdded() {
- let observers = PlacesUtils.bookmarks.getObservers();
- Assert.equal(observers.length, initialObservers.length + 1);
-
- // Check the common observer is the last one.
- for (let i = 0; i < initialObservers.length; ++i) {
- Assert.equal(initialObservers[i], observers[i]);
- }
-
- PlacesUtils.bookmarks.removeObserver(this);
- observers = PlacesUtils.bookmarks.getObservers();
- Assert.equal(observers.length, initialObservers.length);
-
- // Check the category observer has been invoked before this one.
- Assert.ok(dummyCreated);
- Assert.ok(dummyReceivedOnItemAdded);
- resolve();
- }
- }, false);
- });
-
- // Add a bookmark
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- uri("http://typed.mozilla.org"),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark");
-
- yield notificationsPromised;
-});
diff --git a/toolkit/components/places/tests/unit/test_bookmarks_html.js b/toolkit/components/places/tests/unit/test_bookmarks_html.js
deleted file mode 100644
index b10dc6185..000000000
--- a/toolkit/components/places/tests/unit/test_bookmarks_html.js
+++ /dev/null
@@ -1,385 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const LOAD_IN_SIDEBAR_ANNO = "bookmarkProperties/loadInSidebar";
-const DESCRIPTION_ANNO = "bookmarkProperties/description";
-
-// An object representing the contents of bookmarks.preplaces.html.
-var test_bookmarks = {
- menu: [
- { title: "Mozilla Firefox",
- children: [
- { title: "Help and Tutorials",
- url: "http://en-us.www.mozilla.com/en-US/firefox/help/",
- icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="
- },
- { title: "Customize Firefox",
- url: "http://en-us.www.mozilla.com/en-US/firefox/customize/",
- icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="
- },
- { title: "Get Involved",
- url: "http://en-us.www.mozilla.com/en-US/firefox/community/",
- icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="
- },
- { title: "About Us",
- url: "http://en-us.www.mozilla.com/en-US/about/",
- icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="
- }
- ]
- },
- {
- type: Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR
- },
- { title: "test",
- description: "folder test comment",
- dateAdded: 1177541020000000,
- lastModified: 1177541050000000,
- children: [
- { title: "test post keyword",
- description: "item description",
- dateAdded: 1177375336000000,
- lastModified: 1177375423000000,
- keyword: "test",
- sidebar: true,
- postData: "hidden1%3Dbar&text1%3D%25s",
- charset: "ISO-8859-1",
- url: "http://test/post"
- }
- ]
- }
- ],
- toolbar: [
- { title: "Getting Started",
- url: "http://en-us.www.mozilla.com/en-US/firefox/central/",
- icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="
- },
- { title: "Latest Headlines",
- url: "http://en-us.fxfeeds.mozilla.com/en-US/firefox/livebookmarks/",
- feedUrl: "http://en-us.fxfeeds.mozilla.com/en-US/firefox/headlines.xml"
- }
- ],
- unfiled: [
- { title: "Example.tld",
- url: "http://example.tld/"
- }
- ]
-};
-
-// Pre-Places bookmarks.html file pointer.
-var gBookmarksFileOld;
-// Places bookmarks.html file pointer.
-var gBookmarksFileNew;
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* setup() {
- // Avoid creating smart bookmarks during the test.
- Services.prefs.setIntPref("browser.places.smartBookmarksVersion", -1);
-
- // File pointer to legacy bookmarks file.
- gBookmarksFileOld = do_get_file("bookmarks.preplaces.html");
-
- // File pointer to a new Places-exported bookmarks file.
- gBookmarksFileNew = Services.dirsvc.get("ProfD", Ci.nsILocalFile);
- gBookmarksFileNew.append("bookmarks.exported.html");
- if (gBookmarksFileNew.exists()) {
- gBookmarksFileNew.remove(false);
- }
-
- // This test must be the first one, since it setups the new bookmarks.html.
- // Test importing a pre-Places canonical bookmarks file.
- // 1. import bookmarks.preplaces.html
- // 2. run the test-suite
- // Note: we do not empty the db before this import to catch bugs like 380999
- yield BookmarkHTMLUtils.importFromFile(gBookmarksFileOld, true);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield testImportedBookmarks();
-
- yield BookmarkHTMLUtils.exportToFile(gBookmarksFileNew);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_import_new()
-{
- // Test importing a Places bookmarks.html file.
- // 1. import bookmarks.exported.html
- // 2. run the test-suite
- yield BookmarkHTMLUtils.importFromFile(gBookmarksFileNew, true);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- yield testImportedBookmarks();
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_emptytitle_export()
-{
- // Test exporting and importing with an empty-titled bookmark.
- // 1. import bookmarks
- // 2. create an empty-titled bookmark.
- // 3. export to bookmarks.exported.html
- // 4. empty bookmarks db
- // 5. import bookmarks.exported.html
- // 6. run the test-suite
- // 7. remove the empty-titled bookmark
- // 8. export to bookmarks.exported.html
- // 9. empty bookmarks db and continue
-
- yield BookmarkHTMLUtils.importFromFile(gBookmarksFileNew, true);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- const NOTITLE_URL = "http://notitle.mozilla.org/";
- let bookmark = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: NOTITLE_URL
- });
- test_bookmarks.unfiled.push({ title: "", url: NOTITLE_URL });
-
- yield BookmarkHTMLUtils.exportToFile(gBookmarksFileNew);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield PlacesUtils.bookmarks.eraseEverything();
-
- yield BookmarkHTMLUtils.importFromFile(gBookmarksFileNew, true);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield testImportedBookmarks();
-
- // Cleanup.
- test_bookmarks.unfiled.pop();
- // HTML imports don't restore GUIDs yet.
- let reimportedBookmark = yield PlacesUtils.bookmarks.fetch({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX
- });
- Assert.equal(reimportedBookmark.url.href, bookmark.url.href);
- yield PlacesUtils.bookmarks.remove(reimportedBookmark);
-
- yield BookmarkHTMLUtils.exportToFile(gBookmarksFileNew);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_import_chromefavicon()
-{
- // Test exporting and importing with a bookmark pointing to a chrome favicon.
- // 1. import bookmarks
- // 2. create a bookmark pointing to a chrome favicon.
- // 3. export to bookmarks.exported.html
- // 4. empty bookmarks db
- // 5. import bookmarks.exported.html
- // 6. run the test-suite
- // 7. remove the bookmark pointing to a chrome favicon.
- // 8. export to bookmarks.exported.html
- // 9. empty bookmarks db and continue
-
- const PAGE_URI = NetUtil.newURI("http://example.com/chromefavicon_page");
- const CHROME_FAVICON_URI = NetUtil.newURI("chrome://global/skin/icons/information-16.png");
- const CHROME_FAVICON_URI_2 = NetUtil.newURI("chrome://global/skin/icons/error-16.png");
-
- do_print("Importing from html");
- yield BookmarkHTMLUtils.importFromFile(gBookmarksFileNew, true);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("Insert bookmark");
- yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: PAGE_URI,
- title: "Test"
- });
-
- do_print("Set favicon");
- yield new Promise(resolve => {
- PlacesUtils.favicons.setAndFetchFaviconForPage(
- PAGE_URI, CHROME_FAVICON_URI, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- resolve, Services.scriptSecurityManager.getSystemPrincipal());
- });
-
- let data = yield new Promise(resolve => {
- PlacesUtils.favicons.getFaviconDataForPage(
- PAGE_URI, (uri, dataLen, faviconData, mimeType) => resolve(faviconData));
- });
-
- let base64Icon = "data:image/png;base64," +
- base64EncodeString(String.fromCharCode.apply(String, data));
-
- test_bookmarks.unfiled.push(
- { title: "Test", url: PAGE_URI.spec, icon: base64Icon });
-
- do_print("Export to html");
- yield BookmarkHTMLUtils.exportToFile(gBookmarksFileNew);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("Set favicon");
- // Change the favicon to check it's really imported again later.
- yield new Promise(resolve => {
- PlacesUtils.favicons.setAndFetchFaviconForPage(
- PAGE_URI, CHROME_FAVICON_URI_2, true,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- resolve, Services.scriptSecurityManager.getSystemPrincipal());
- });
-
- do_print("import from html");
- yield PlacesUtils.bookmarks.eraseEverything();
- yield BookmarkHTMLUtils.importFromFile(gBookmarksFileNew, true);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- do_print("Test imported bookmarks");
- yield testImportedBookmarks();
-
- // Cleanup.
- test_bookmarks.unfiled.pop();
- // HTML imports don't restore GUIDs yet.
- let reimportedBookmark = yield PlacesUtils.bookmarks.fetch({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX
- });
- yield PlacesUtils.bookmarks.remove(reimportedBookmark);
-
- yield BookmarkHTMLUtils.exportToFile(gBookmarksFileNew);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_import_ontop()
-{
- // Test importing the exported bookmarks.html file *on top of* the existing
- // bookmarks.
- // 1. empty bookmarks db
- // 2. import the exported bookmarks file
- // 3. export to file
- // 3. import the exported bookmarks file
- // 4. run the test-suite
-
- yield BookmarkHTMLUtils.importFromFile(gBookmarksFileNew, true);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield BookmarkHTMLUtils.exportToFile(gBookmarksFileNew);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- yield BookmarkHTMLUtils.importFromFile(gBookmarksFileNew, true);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield testImportedBookmarks();
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-function* testImportedBookmarks()
-{
- for (let group in test_bookmarks) {
- do_print("[testImportedBookmarks()] Checking group '" + group + "'");
-
- let root;
- switch (group) {
- case "menu":
- root = PlacesUtils.getFolderContents(PlacesUtils.bookmarksMenuFolderId).root;
- break;
- case "toolbar":
- root = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root;
- break;
- case "unfiled":
- root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
- break;
- }
-
- let items = test_bookmarks[group];
- do_check_eq(root.childCount, items.length);
-
- for (let key in items) {
- yield checkItem(items[key], root.getChild(key));
- }
-
- root.containerOpen = false;
- }
-}
-
-function* checkItem(aExpected, aNode)
-{
- let id = aNode.itemId;
-
- return Task.spawn(function* () {
- for (prop in aExpected) {
- switch (prop) {
- case "type":
- do_check_eq(aNode.type, aExpected.type);
- break;
- case "title":
- do_check_eq(aNode.title, aExpected.title);
- break;
- case "description":
- do_check_eq(PlacesUtils.annotations
- .getItemAnnotation(id, DESCRIPTION_ANNO),
- aExpected.description);
- break;
- case "dateAdded":
- do_check_eq(PlacesUtils.bookmarks.getItemDateAdded(id),
- aExpected.dateAdded);
- break;
- case "lastModified":
- do_check_eq(PlacesUtils.bookmarks.getItemLastModified(id),
- aExpected.lastModified);
- break;
- case "url":
- if (!("feedUrl" in aExpected))
- do_check_eq(aNode.uri, aExpected.url)
- break;
- case "icon":
- let deferred = Promise.defer();
- PlacesUtils.favicons.getFaviconDataForPage(
- NetUtil.newURI(aExpected.url),
- function (aURI, aDataLen, aData, aMimeType) {
- deferred.resolve(aData);
- });
- let data = yield deferred.promise;
- let base64Icon = "data:image/png;base64," +
- base64EncodeString(String.fromCharCode.apply(String, data));
- do_check_true(base64Icon == aExpected.icon);
- break;
- case "keyword": {
- let entry = yield PlacesUtils.keywords.fetch({ url: aNode.uri });
- Assert.equal(entry.keyword, aExpected.keyword);
- break;
- }
- case "sidebar":
- do_check_eq(PlacesUtils.annotations
- .itemHasAnnotation(id, LOAD_IN_SIDEBAR_ANNO),
- aExpected.sidebar);
- break;
- case "postData": {
- let entry = yield PlacesUtils.keywords.fetch({ url: aNode.uri });
- Assert.equal(entry.postData, aExpected.postData);
- break;
- }
- case "charset":
- let testURI = NetUtil.newURI(aNode.uri);
- do_check_eq((yield PlacesUtils.getCharsetForURI(testURI)), aExpected.charset);
- break;
- case "feedUrl":
- let livemark = yield PlacesUtils.livemarks.getLivemark({ id: id });
- do_check_eq(livemark.siteURI.spec, aExpected.url);
- do_check_eq(livemark.feedURI.spec, aExpected.feedUrl);
- break;
- case "children":
- let folder = aNode.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- do_check_eq(folder.hasChildren, aExpected.children.length > 0);
- folder.containerOpen = true;
- do_check_eq(folder.childCount, aExpected.children.length);
-
- for (let index = 0; index < aExpected.children.length; index++) {
- yield checkItem(aExpected.children[index], folder.getChild(index));
- }
-
- folder.containerOpen = false;
- break;
- default:
- throw new Error("Unknown property");
- }
- }
- });
-}
diff --git a/toolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js b/toolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js
deleted file mode 100644
index 845b2227b..000000000
--- a/toolkit/components/places/tests/unit/test_bookmarks_html_corrupt.js
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * This test ensures that importing/exporting to HTML does not stop
- * if a malformed uri is found.
- */
-
-const DESCRIPTION_ANNO = "bookmarkProperties/description";
-const LOAD_IN_SIDEBAR_ANNO = "bookmarkProperties/loadInSidebar";
-
-const TEST_FAVICON_PAGE_URL = "http://en-US.www.mozilla.com/en-US/firefox/central/";
-const TEST_FAVICON_DATA_SIZE = 580;
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_corrupt_file() {
- // avoid creating the places smart folder during tests
- Services.prefs.setIntPref("browser.places.smartBookmarksVersion", -1);
-
- // Import bookmarks from the corrupt file.
- let corruptHtml = OS.Path.join(do_get_cwd().path, "bookmarks.corrupt.html");
- yield BookmarkHTMLUtils.importFromFile(corruptHtml, true);
-
- // Check that bookmarks that are not corrupt have been imported.
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield database_check();
-});
-
-add_task(function* test_corrupt_database() {
- // Create corruption in the database, then export.
- let corruptBookmark = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- url: "http://test.mozilla.org",
- title: "We love belugas" });
- yield PlacesUtils.withConnectionWrapper("test", Task.async(function*(db) {
- yield db.execute("UPDATE moz_bookmarks SET fk = NULL WHERE guid = :guid",
- { guid: corruptBookmark.guid });
- }));
-
- let bookmarksFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.exported.html");
- if ((yield OS.File.exists(bookmarksFile)))
- yield OS.File.remove(bookmarksFile);
- yield BookmarkHTMLUtils.exportToFile(bookmarksFile);
-
- // Import again and check for correctness.
- yield PlacesUtils.bookmarks.eraseEverything();
- yield BookmarkHTMLUtils.importFromFile(bookmarksFile, true);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield database_check();
-});
-
-/*
- * Check for imported bookmarks correctness
- *
- * @return {Promise}
- * @resolves When the checks are finished.
- * @rejects Never.
- */
-var database_check = Task.async(function* () {
- // BOOKMARKS MENU
- let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarksMenuFolderId).root;
- Assert.equal(root.childCount, 2);
-
- let folderNode = root.getChild(1);
- Assert.equal(folderNode.type, folderNode.RESULT_TYPE_FOLDER);
- Assert.equal(folderNode.title, "test");
- Assert.equal(PlacesUtils.bookmarks.getItemDateAdded(folderNode.itemId), 1177541020000000);
- Assert.equal(PlacesUtils.bookmarks.getItemLastModified(folderNode.itemId), 1177541050000000);
- Assert.equal("folder test comment",
- PlacesUtils.annotations.getItemAnnotation(folderNode.itemId,
- DESCRIPTION_ANNO));
- // open test folder, and test the children
- PlacesUtils.asQuery(folderNode);
- Assert.equal(folderNode.hasChildren, true);
- folderNode.containerOpen = true;
- Assert.equal(folderNode.childCount, 1);
-
- let bookmarkNode = folderNode.getChild(0);
- Assert.equal("http://test/post", bookmarkNode.uri);
- Assert.equal("test post keyword", bookmarkNode.title);
-
- let entry = yield PlacesUtils.keywords.fetch({ url: bookmarkNode.uri });
- Assert.equal("test", entry.keyword);
- Assert.equal("hidden1%3Dbar&text1%3D%25s", entry.postData);
-
- Assert.ok(PlacesUtils.annotations.itemHasAnnotation(bookmarkNode.itemId,
- LOAD_IN_SIDEBAR_ANNO));
- Assert.equal(bookmarkNode.dateAdded, 1177375336000000);
- Assert.equal(bookmarkNode.lastModified, 1177375423000000);
-
- Assert.equal((yield PlacesUtils.getCharsetForURI(NetUtil.newURI(bookmarkNode.uri))),
- "ISO-8859-1");
-
- Assert.equal("item description",
- PlacesUtils.annotations.getItemAnnotation(bookmarkNode.itemId,
- DESCRIPTION_ANNO));
-
- // clean up
- folderNode.containerOpen = false;
- root.containerOpen = false;
-
- // BOOKMARKS TOOLBAR
- root = PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root;
- Assert.equal(root.childCount, 3);
-
- // For now some promises are resolved later, so we can't guarantee an order.
- let foundLivemark = false;
- for (let i = 0; i < root.childCount; ++i) {
- let node = root.getChild(i);
- if (node.title == "Latest Headlines") {
- foundLivemark = true;
- Assert.equal("Latest Headlines", node.title);
-
- let livemark = yield PlacesUtils.livemarks.getLivemark({ guid: node.bookmarkGuid });
- Assert.equal("http://en-us.fxfeeds.mozilla.com/en-US/firefox/livebookmarks/",
- livemark.siteURI.spec);
- Assert.equal("http://en-us.fxfeeds.mozilla.com/en-US/firefox/headlines.xml",
- livemark.feedURI.spec);
- }
- }
- Assert.ok(foundLivemark);
-
- // cleanup
- root.containerOpen = false;
-
- // UNFILED BOOKMARKS
- root = PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
- Assert.equal(root.childCount, 1);
- root.containerOpen = false;
-
- // favicons
- yield new Promise(resolve => {
- PlacesUtils.favicons.getFaviconDataForPage(uri(TEST_FAVICON_PAGE_URL),
- (aURI, aDataLen, aData, aMimeType) => {
- // aURI should never be null when aDataLen > 0.
- Assert.notEqual(aURI, null);
- // Favicon data is stored in the bookmarks file as a "data:" URI. For
- // simplicity, instead of converting the data we receive to a "data:" URI
- // and comparing it, we just check the data size.
- Assert.equal(TEST_FAVICON_DATA_SIZE, aDataLen);
- resolve();
- });
- });
-});
diff --git a/toolkit/components/places/tests/unit/test_bookmarks_html_import_tags.js b/toolkit/components/places/tests/unit/test_bookmarks_html_import_tags.js
deleted file mode 100644
index e4ba433a3..000000000
--- a/toolkit/components/places/tests/unit/test_bookmarks_html_import_tags.js
+++ /dev/null
@@ -1,57 +0,0 @@
-var bookmarkData = [
- { uri: uri("http://www.toastytech.com"),
- title: "Nathan's Toasty Technology Page",
- tags: ["technology", "personal", "retro"] },
- { uri: uri("http://www.reddit.com"),
- title: "reddit: the front page of the internet",
- tags: ["social media", "news", "humour"] },
- { uri: uri("http://www.4chan.org"),
- title: "4chan",
- tags: ["discussion", "imageboard", "anime"] }
-];
-
-/*
- TEST SUMMARY
- - Add bookmarks with tags
- - Export tagged bookmarks as HTML file
- - Delete bookmarks
- - Import bookmarks from HTML file
- - Check that all bookmarks are successfully imported with tags
-*/
-
-add_task(function* test_import_tags() {
- // Removes bookmarks.html if the file already exists.
- let HTMLFile = OS.Path.join(OS.Constants.Path.profileDir, "bookmarks.html");
- if ((yield OS.File.exists(HTMLFile)))
- yield OS.File.remove(HTMLFile);
-
- // Adds bookmarks and tags to the database.
- let bookmarkList = new Set();
- for (let { uri, title, tags } of bookmarkData) {
- bookmarkList.add(yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- url: uri,
- title }));
- PlacesUtils.tagging.tagURI(uri, tags);
- }
-
- // Exports the bookmarks as a HTML file.
- yield BookmarkHTMLUtils.exportToFile(HTMLFile);
-
- // Deletes bookmarks and tags from the database.
- for (let bookmark of bookmarkList) {
- yield PlacesUtils.bookmarks.remove(bookmark.guid);
- }
-
- // Re-imports the bookmarks from the HTML file.
- yield BookmarkHTMLUtils.importFromFile(HTMLFile, true);
-
- // Tests to ensure that the tags are still present for each bookmark URI.
- for (let { uri, tags } of bookmarkData) {
- do_print("Test tags for " + uri.spec + ": " + tags + "\n");
- let foundTags = PlacesUtils.tagging.getTagsForURI(uri);
- Assert.equal(foundTags.length, tags.length);
- Assert.ok(tags.every(tag => foundTags.includes(tag)));
- }
-});
-
diff --git a/toolkit/components/places/tests/unit/test_bookmarks_html_singleframe.js b/toolkit/components/places/tests/unit/test_bookmarks_html_singleframe.js
deleted file mode 100644
index 02b430ff2..000000000
--- a/toolkit/components/places/tests/unit/test_bookmarks_html_singleframe.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Test for bug #801450
-
-// Get Services
-Cu.import("resource://gre/modules/BookmarkHTMLUtils.jsm");
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_bookmarks_html_singleframe()
-{
- let bookmarksFile = OS.Path.join(do_get_cwd().path, "bookmarks_html_singleframe.html");
- yield BookmarkHTMLUtils.importFromFile(bookmarksFile, true);
-
- let root = PlacesUtils.getFolderContents(PlacesUtils.bookmarksMenuFolderId).root;
- do_check_eq(root.childCount, 1);
- let folder = root.getChild(0);
- PlacesUtils.asContainer(folder).containerOpen = true;
- do_check_eq(folder.title, "Subtitle");
- do_check_eq(folder.childCount, 1);
- let bookmark = folder.getChild(0);
- do_check_eq(bookmark.uri, "http://www.mozilla.org/");
- do_check_eq(bookmark.title, "Mozilla");
- folder.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/unit/test_bookmarks_json.js b/toolkit/components/places/tests/unit/test_bookmarks_json.js
deleted file mode 100644
index a6801540a..000000000
--- a/toolkit/components/places/tests/unit/test_bookmarks_json.js
+++ /dev/null
@@ -1,241 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import("resource://gre/modules/BookmarkJSONUtils.jsm");
-
-function run_test() {
- run_next_test();
-}
-
-const LOAD_IN_SIDEBAR_ANNO = "bookmarkProperties/loadInSidebar";
-const DESCRIPTION_ANNO = "bookmarkProperties/description";
-
-// An object representing the contents of bookmarks.json.
-var test_bookmarks = {
- menu: [
- { guid: "OCyeUO5uu9FF",
- title: "Mozilla Firefox",
- children: [
- { guid:"OCyeUO5uu9FG",
- title: "Help and Tutorials",
- url: "http://en-us.www.mozilla.com/en-US/firefox/help/",
- icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="
- },
- { guid:"OCyeUO5uu9FH",
- title: "Customize Firefox",
- url: "http://en-us.www.mozilla.com/en-US/firefox/customize/",
- icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="
- },
- { guid:"OCyeUO5uu9FI",
- title: "Get Involved",
- url: "http://en-us.www.mozilla.com/en-US/firefox/community/",
- icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="
- },
- { guid:"OCyeUO5uu9FJ",
- title: "About Us",
- url: "http://en-us.www.mozilla.com/en-US/about/",
- icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="
- }
- ]
- },
- {
- guid: "OCyeUO5uu9FK",
- type: Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR
- },
- {
- guid:"OCyeUO5uu9FL",
- title: "test",
- description: "folder test comment",
- dateAdded: 1177541020000000,
- // lastModified: 1177541050000000,
- children: [
- { guid:"OCyeUO5uu9GX",
- title: "test post keyword",
- description: "item description",
- dateAdded: 1177375336000000,
- // lastModified: 1177375423000000,
- keyword: "test",
- sidebar: true,
- postData: "hidden1%3Dbar&text1%3D%25s",
- charset: "ISO-8859-1"
- }
- ]
- }
- ],
- toolbar: [
- { guid: "OCyeUO5uu9FB",
- title: "Getting Started",
- url: "http://en-us.www.mozilla.com/en-US/firefox/central/",
- icon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAHWSURBVHjaYvz//z8DJQAggJiQOe/fv2fv7Oz8rays/N+VkfG/iYnJfyD/1+rVq7ffu3dPFpsBAAHEAHIBCJ85c8bN2Nj4vwsDw/8zQLwKiO8CcRoQu0DxqlWrdsHUwzBAAIGJmTNnPgYa9j8UqhFElwPxf2MIDeIrKSn9FwSJoRkAEEAM0DD4DzMAyPi/G+QKY4hh5WAXGf8PDQ0FGwJ22d27CjADAAIIrLmjo+MXA9R2kAHvGBA2wwx6B8W7od6CeQcggKCmCEL8bgwxYCbUIGTDVkHDBia+CuotgACCueD3TDQN75D4xmAvCoK9ARMHBzAw0AECiBHkAlC0Mdy7x9ABNA3obAZXIAa6iKEcGlMVQHwWyjYuL2d4v2cPg8vZswx7gHyAAAK7AOif7SAbOqCmn4Ha3AHFsIDtgPq/vLz8P4MSkJ2W9h8ggBjevXvHDo4FQUQg/kdypqCg4H8lUIACnQ/SOBMYI8bAsAJFPcj1AAEEjwVQqLpAbXmH5BJjqI0gi9DTAAgDBBCcAVLkgmQ7yKCZxpCQxqUZhAECCJ4XgMl493ug21ZD+aDAXH0WLM4A9MZPXJkJIIAwTAR5pQMalaCABQUULttBGCCAGCnNzgABBgAMJ5THwGvJLAAAAABJRU5ErkJggg=="
- },
- { guid:"OCyeUO5uu9FR",
- title: "Latest Headlines",
- url: "http://en-us.fxfeeds.mozilla.com/en-US/firefox/livebookmarks/",
- feedUrl: "http://en-us.fxfeeds.mozilla.com/en-US/firefox/headlines.xml"
- }
- ],
- unfiled: [
- { guid: "OCyeUO5uu9FW",
- title: "Example.tld",
- url: "http://example.tld/"
- }
- ]
-};
-
-// Exported bookmarks file pointer.
-var bookmarksExportedFile;
-
-add_task(function* test_import_bookmarks() {
- let bookmarksFile = OS.Path.join(do_get_cwd().path, "bookmarks.json");
-
- yield BookmarkJSONUtils.importFromFile(bookmarksFile, true);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield testImportedBookmarks();
-});
-
-add_task(function* test_export_bookmarks() {
- bookmarksExportedFile = OS.Path.join(OS.Constants.Path.profileDir,
- "bookmarks.exported.json");
- yield BookmarkJSONUtils.exportToFile(bookmarksExportedFile);
- yield PlacesTestUtils.promiseAsyncUpdates();
-});
-
-add_task(function* test_import_exported_bookmarks() {
- yield PlacesUtils.bookmarks.eraseEverything();
- yield BookmarkJSONUtils.importFromFile(bookmarksExportedFile, true);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield testImportedBookmarks();
-});
-
-add_task(function* test_import_ontop() {
- yield PlacesUtils.bookmarks.eraseEverything();
- yield BookmarkJSONUtils.importFromFile(bookmarksExportedFile, true);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield BookmarkJSONUtils.exportToFile(bookmarksExportedFile);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield BookmarkJSONUtils.importFromFile(bookmarksExportedFile, true);
- yield PlacesTestUtils.promiseAsyncUpdates();
- yield testImportedBookmarks();
-});
-
-add_task(function* test_clean() {
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-function* testImportedBookmarks() {
- for (let group in test_bookmarks) {
- do_print("[testImportedBookmarks()] Checking group '" + group + "'");
-
- let root;
- switch (group) {
- case "menu":
- root =
- PlacesUtils.getFolderContents(PlacesUtils.bookmarksMenuFolderId).root;
- break;
- case "toolbar":
- root =
- PlacesUtils.getFolderContents(PlacesUtils.toolbarFolderId).root;
- break;
- case "unfiled":
- root =
- PlacesUtils.getFolderContents(PlacesUtils.unfiledBookmarksFolderId).root;
- break;
- }
-
- let items = test_bookmarks[group];
- do_check_eq(root.childCount, items.length);
-
- for (let key in items) {
- yield checkItem(items[key], root.getChild(key));
- }
-
- root.containerOpen = false;
- }
-}
-
-function* checkItem(aExpected, aNode) {
- let id = aNode.itemId;
-
- return Task.spawn(function* () {
- for (prop in aExpected) {
- switch (prop) {
- case "type":
- do_check_eq(aNode.type, aExpected.type);
- break;
- case "title":
- do_check_eq(aNode.title, aExpected.title);
- break;
- case "description":
- do_check_eq(PlacesUtils.annotations.getItemAnnotation(
- id, DESCRIPTION_ANNO), aExpected.description);
- break;
- case "dateAdded":
- do_check_eq(PlacesUtils.bookmarks.getItemDateAdded(id),
- aExpected.dateAdded);
- break;
- case "lastModified":
- do_check_eq(PlacesUtils.bookmarks.getItemLastModified(id),
- aExpected.lastModified);
- break;
- case "url":
- if (!("feedUrl" in aExpected))
- do_check_eq(aNode.uri, aExpected.url);
- break;
- case "icon":
- let deferred = Promise.defer();
- PlacesUtils.favicons.getFaviconDataForPage(
- NetUtil.newURI(aExpected.url),
- function (aURI, aDataLen, aData, aMimeType) {
- deferred.resolve(aData);
- });
- let data = yield deferred.promise;
- let base64Icon = "data:image/png;base64," +
- base64EncodeString(String.fromCharCode.apply(String, data));
- do_check_true(base64Icon == aExpected.icon);
- break;
- case "keyword": {
- let entry = yield PlacesUtils.keywords.fetch({ url: aNode.uri });
- Assert.equal(entry.keyword, aExpected.keyword);
- break;
- }
- case "guid":
- let guid = yield PlacesUtils.promiseItemGuid(id);
- do_check_eq(guid, aExpected.guid);
- break;
- case "sidebar":
- do_check_eq(PlacesUtils.annotations.itemHasAnnotation(
- id, LOAD_IN_SIDEBAR_ANNO), aExpected.sidebar);
- break;
- case "postData": {
- let entry = yield PlacesUtils.keywords.fetch({ url: aNode.uri });
- Assert.equal(entry.postData, aExpected.postData);
- break;
- }
- case "charset":
- let testURI = NetUtil.newURI(aNode.uri);
- do_check_eq((yield PlacesUtils.getCharsetForURI(testURI)), aExpected.charset);
- break;
- case "feedUrl":
- let livemark = yield PlacesUtils.livemarks.getLivemark({ id: id });
- do_check_eq(livemark.siteURI.spec, aExpected.url);
- do_check_eq(livemark.feedURI.spec, aExpected.feedUrl);
- break;
- case "children":
- let folder = aNode.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- do_check_eq(folder.hasChildren, aExpected.children.length > 0);
- folder.containerOpen = true;
- do_check_eq(folder.childCount, aExpected.children.length);
-
- for (let index = 0; index < aExpected.children.length; index++) {
- yield checkItem(aExpected.children[index], folder.getChild(index));
- }
-
- folder.containerOpen = false;
- break;
- default:
- throw new Error("Unknown property");
- }
- }
- });
-}
diff --git a/toolkit/components/places/tests/unit/test_bookmarks_restore_notification.js b/toolkit/components/places/tests/unit/test_bookmarks_restore_notification.js
deleted file mode 100644
index 2f8022c6b..000000000
--- a/toolkit/components/places/tests/unit/test_bookmarks_restore_notification.js
+++ /dev/null
@@ -1,325 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cu.import("resource://gre/modules/BookmarkHTMLUtils.jsm");
-
-/**
- * Tests the bookmarks-restore-* nsIObserver notifications after restoring
- * bookmarks from JSON and HTML. See bug 470314.
- */
-
-// The topics and data passed to nsIObserver.observe() on bookmarks restore
-const NSIOBSERVER_TOPIC_BEGIN = "bookmarks-restore-begin";
-const NSIOBSERVER_TOPIC_SUCCESS = "bookmarks-restore-success";
-const NSIOBSERVER_TOPIC_FAILED = "bookmarks-restore-failed";
-const NSIOBSERVER_DATA_JSON = "json";
-const NSIOBSERVER_DATA_HTML = "html";
-const NSIOBSERVER_DATA_HTML_INIT = "html-initial";
-
-// Bookmarks are added for these URIs
-var uris = [
- "http://example.com/1",
- "http://example.com/2",
- "http://example.com/3",
- "http://example.com/4",
- "http://example.com/5",
-];
-
-/**
- * Adds some bookmarks for the URIs in |uris|.
- */
-function* addBookmarks() {
- for (let url of uris) {
- yield PlacesUtils.bookmarks.insert({
- url: url, parentGuid: PlacesUtils.bookmarks.menuGuid
- })
- }
- checkBookmarksExist();
-}
-
-/**
- * Checks that all of the bookmarks created for |uris| exist. It works by
- * creating one query per URI and then ORing all the queries. The number of
- * results returned should be uris.length.
- */
-function checkBookmarksExist() {
- let hs = PlacesUtils.history;
- let queries = uris.map(function (u) {
- let q = hs.getNewQuery();
- q.uri = uri(u);
- return q;
- });
- let options = hs.getNewQueryOptions();
- options.queryType = options.QUERY_TYPE_BOOKMARKS;
- let root = hs.executeQueries(queries, uris.length, options).root;
- root.containerOpen = true;
- Assert.equal(root.childCount, uris.length);
- root.containerOpen = false;
-}
-
-/**
- * Creates an file in the profile directory.
- *
- * @param aBasename
- * e.g., "foo.txt" in the path /some/long/path/foo.txt
- * @return {Promise}
- * @resolves to an OS.File path
- */
-function promiseFile(aBasename) {
- let path = OS.Path.join(OS.Constants.Path.profileDir, aBasename);
- do_print("opening " + path);
- return OS.File.open(path, { truncate: true })
- .then(aFile => {
- aFile.close();
- return path;
- });
-}
-
-/**
- * Register observers via promiseTopicObserved helper.
- *
- * @param {boolean} expectSuccess pass true when expect a success notification
- * @return {Promise[]}
- */
-function registerObservers(expectSuccess) {
- let promiseBegin = promiseTopicObserved(NSIOBSERVER_TOPIC_BEGIN);
- let promiseResult;
- if (expectSuccess) {
- promiseResult = promiseTopicObserved(NSIOBSERVER_TOPIC_SUCCESS);
- } else {
- promiseResult = promiseTopicObserved(NSIOBSERVER_TOPIC_FAILED);
- }
-
- return [promiseBegin, promiseResult];
-}
-
-/**
- * Check notification results.
- *
- * @param {Promise[]} expectPromises array contain promiseBegin and promiseResult
- * @param {object} expectedData contain data and folderId
- */
-function* checkObservers(expectPromises, expectedData) {
- let [promiseBegin, promiseResult] = expectPromises;
-
- let beginData = (yield promiseBegin)[1];
- Assert.equal(beginData, expectedData.data,
- "Data for current test should be what is expected");
-
- let [resultSubject, resultData] = yield promiseResult;
- Assert.equal(resultData, expectedData.data,
- "Data for current test should be what is expected");
-
- // Make sure folder ID is what is expected. For importing HTML into a
- // folder, this will be an integer, otherwise null.
- if (resultSubject) {
- Assert.equal(aSubject.QueryInterface(Ci.nsISupportsPRInt64).data,
- expectedData.folderId);
- } else {
- Assert.equal(expectedData.folderId, null);
- }
-}
-
-/**
- * Run after every test cases.
- */
-function* teardown(file, begin, success, fail) {
- // On restore failed, file may not exist, so wrap in try-catch.
- try {
- yield OS.File.remove(file, {ignoreAbsent: true});
- } catch (e) {}
-
- // clean up bookmarks
- yield PlacesUtils.bookmarks.eraseEverything();
-}
-
-add_task(function* test_json_restore_normal() {
- // data: the data passed to nsIObserver.observe() corresponding to the test
- // folderId: for HTML restore into a folder, the folder ID to restore into;
- // otherwise, set it to null
- let expectedData = {
- data: NSIOBSERVER_DATA_JSON,
- folderId: null
- }
- let expectPromises = registerObservers(true);
-
- do_print("JSON restore: normal restore should succeed");
- let file = yield promiseFile("bookmarks-test_restoreNotification.json");
- yield addBookmarks();
-
- yield BookmarkJSONUtils.exportToFile(file);
- yield PlacesUtils.bookmarks.eraseEverything();
- try {
- yield BookmarkJSONUtils.importFromFile(file, true);
- } catch (e) {
- do_throw(" Restore should not have failed" + e);
- }
-
- yield checkObservers(expectPromises, expectedData);
- yield teardown(file);
-});
-
-add_task(function* test_json_restore_empty() {
- let expectedData = {
- data: NSIOBSERVER_DATA_JSON,
- folderId: null
- }
- let expectPromises = registerObservers(true);
-
- do_print("JSON restore: empty file should succeed");
- let file = yield promiseFile("bookmarks-test_restoreNotification.json");
- try {
- yield BookmarkJSONUtils.importFromFile(file, true);
- } catch (e) {
- do_throw(" Restore should not have failed" + e);
- }
-
- yield checkObservers(expectPromises, expectedData);
- yield teardown(file);
-});
-
-add_task(function* test_json_restore_nonexist() {
- let expectedData = {
- data: NSIOBSERVER_DATA_JSON,
- folderId: null
- }
- let expectPromises = registerObservers(false);
-
- do_print("JSON restore: nonexistent file should fail");
- let file = Services.dirsvc.get("ProfD", Ci.nsILocalFile);
- file.append("this file doesn't exist because nobody created it 1");
- try {
- yield BookmarkJSONUtils.importFromFile(file, true);
- do_throw(" Restore should have failed");
- } catch (e) {}
-
- yield checkObservers(expectPromises, expectedData);
- yield teardown(file);
-});
-
-add_task(function* test_html_restore_normal() {
- let expectedData = {
- data: NSIOBSERVER_DATA_HTML,
- folderId: null
- }
- let expectPromises = registerObservers(true);
-
- do_print("HTML restore: normal restore should succeed");
- let file = yield promiseFile("bookmarks-test_restoreNotification.html");
- yield addBookmarks();
- yield BookmarkHTMLUtils.exportToFile(file);
- yield PlacesUtils.bookmarks.eraseEverything();
- try {
- BookmarkHTMLUtils.importFromFile(file, false)
- .then(null, do_report_unexpected_exception);
- } catch (e) {
- do_throw(" Restore should not have failed");
- }
-
- yield checkObservers(expectPromises, expectedData);
- yield teardown(file);
-});
-
-add_task(function* test_html_restore_empty() {
- let expectedData = {
- data: NSIOBSERVER_DATA_HTML,
- folderId: null
- }
- let expectPromises = registerObservers(true);
-
- do_print("HTML restore: empty file should succeed");
- let file = yield promiseFile("bookmarks-test_restoreNotification.init.html");
- try {
- BookmarkHTMLUtils.importFromFile(file, false)
- .then(null, do_report_unexpected_exception);
- } catch (e) {
- do_throw(" Restore should not have failed");
- }
-
- yield checkObservers(expectPromises, expectedData);
- yield teardown(file);
-});
-
-add_task(function* test_html_restore_nonexist() {
- let expectedData = {
- data: NSIOBSERVER_DATA_HTML,
- folderId: null
- }
- let expectPromises = registerObservers(false);
-
- do_print("HTML restore: nonexistent file should fail");
- let file = Services.dirsvc.get("ProfD", Ci.nsILocalFile);
- file.append("this file doesn't exist because nobody created it 2");
- try {
- yield BookmarkHTMLUtils.importFromFile(file, false);
- do_throw("Should fail!");
- } catch (e) {}
-
- yield checkObservers(expectPromises, expectedData);
- yield teardown(file);
-});
-
-add_task(function* test_html_init_restore_normal() {
- let expectedData = {
- data: NSIOBSERVER_DATA_HTML_INIT,
- folderId: null
- }
- let expectPromises = registerObservers(true);
-
- do_print("HTML initial restore: normal restore should succeed");
- let file = yield promiseFile("bookmarks-test_restoreNotification.init.html");
- yield addBookmarks();
- yield BookmarkHTMLUtils.exportToFile(file);
- yield PlacesUtils.bookmarks.eraseEverything();
- try {
- BookmarkHTMLUtils.importFromFile(file, true)
- .then(null, do_report_unexpected_exception);
- } catch (e) {
- do_throw(" Restore should not have failed");
- }
-
- yield checkObservers(expectPromises, expectedData);
- yield teardown(file);
-});
-
-add_task(function* test_html_init_restore_empty() {
- let expectedData = {
- data: NSIOBSERVER_DATA_HTML_INIT,
- folderId: null
- }
- let expectPromises = registerObservers(true);
-
- do_print("HTML initial restore: empty file should succeed");
- let file = yield promiseFile("bookmarks-test_restoreNotification.init.html");
- try {
- BookmarkHTMLUtils.importFromFile(file, true)
- .then(null, do_report_unexpected_exception);
- } catch (e) {
- do_throw(" Restore should not have failed");
- }
-
- yield checkObservers(expectPromises, expectedData);
- yield teardown(file);
-});
-
-add_task(function* test_html_init_restore_nonexist() {
- let expectedData = {
- data: NSIOBSERVER_DATA_HTML_INIT,
- folderId: null
- }
- let expectPromises = registerObservers(false);
-
- do_print("HTML initial restore: nonexistent file should fail");
- let file = Services.dirsvc.get("ProfD", Ci.nsILocalFile);
- file.append("this file doesn't exist because nobody created it 3");
- try {
- yield BookmarkHTMLUtils.importFromFile(file, true);
- do_throw("Should fail!");
- } catch (e) {}
-
- yield checkObservers(expectPromises, expectedData);
- yield teardown(file);
-});
diff --git a/toolkit/components/places/tests/unit/test_bookmarks_setNullTitle.js b/toolkit/components/places/tests/unit/test_bookmarks_setNullTitle.js
deleted file mode 100644
index 959dfe85f..000000000
--- a/toolkit/components/places/tests/unit/test_bookmarks_setNullTitle.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Both SetItemtitle and insertBookmark should allow for null titles.
- */
-
-const bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-
-const TEST_URL = "http://www.mozilla.org";
-
-function run_test() {
- // Insert a bookmark with an empty title.
- var itemId = bs.insertBookmark(bs.toolbarFolder,
- uri(TEST_URL),
- bs.DEFAULT_INDEX,
- "");
- // Check returned title is an empty string.
- do_check_eq(bs.getItemTitle(itemId), "");
- // Set title to null.
- bs.setItemTitle(itemId, null);
- // Check returned title is null.
- do_check_eq(bs.getItemTitle(itemId), null);
- // Cleanup.
- bs.removeItem(itemId);
-
- // Insert a bookmark with a null title.
- itemId = bs.insertBookmark(bs.toolbarFolder,
- uri(TEST_URL),
- bs.DEFAULT_INDEX,
- null);
- // Check returned title is null.
- do_check_eq(bs.getItemTitle(itemId), null);
- // Set title to an empty string.
- bs.setItemTitle(itemId, "");
- // Check returned title is an empty string.
- do_check_eq(bs.getItemTitle(itemId), "");
- // Cleanup.
- bs.removeItem(itemId);
-}
diff --git a/toolkit/components/places/tests/unit/test_broken_folderShortcut_result.js b/toolkit/components/places/tests/unit/test_broken_folderShortcut_result.js
deleted file mode 100644
index b67e141e6..000000000
--- a/toolkit/components/places/tests/unit/test_broken_folderShortcut_result.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- PlacesUtils.bookmarks.insertBookmark(
- PlacesUtils.unfiledBookmarksFolderId, NetUtil.newURI("http://1.moz.org/"),
- PlacesUtils.bookmarks.DEFAULT_INDEX, "Bookmark 1"
- );
- let id1 = PlacesUtils.bookmarks.insertBookmark(
- PlacesUtils.unfiledBookmarksFolderId, NetUtil.newURI("place:folder=1234"),
- PlacesUtils.bookmarks.DEFAULT_INDEX, "Shortcut 1"
- );
- let id2 = PlacesUtils.bookmarks.insertBookmark(
- PlacesUtils.unfiledBookmarksFolderId, NetUtil.newURI("place:folder=-1"),
- PlacesUtils.bookmarks.DEFAULT_INDEX, "Shortcut 2"
- );
- PlacesUtils.bookmarks.insertBookmark(
- PlacesUtils.unfiledBookmarksFolderId, NetUtil.newURI("http://2.moz.org/"),
- PlacesUtils.bookmarks.DEFAULT_INDEX, "Bookmark 2"
- );
-
- // Add also a simple visit.
- yield PlacesTestUtils.addVisits(uri(("http://3.moz.org/")));
-
- // Query containing a broken folder shortcuts among results.
- let query = PlacesUtils.history.getNewQuery();
- query.setFolders([PlacesUtils.unfiledBookmarksFolderId], 1);
- let options = PlacesUtils.history.getNewQueryOptions();
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
-
- do_check_eq(root.childCount, 4);
-
- let shortcut = root.getChild(1);
- do_check_eq(shortcut.uri, "place:folder=1234");
- PlacesUtils.asContainer(shortcut);
- shortcut.containerOpen = true;
- do_check_eq(shortcut.childCount, 0);
- shortcut.containerOpen = false;
- // Remove the broken shortcut while the containing result is open.
- PlacesUtils.bookmarks.removeItem(id1);
- do_check_eq(root.childCount, 3);
-
- shortcut = root.getChild(1);
- do_check_eq(shortcut.uri, "place:folder=-1");
- PlacesUtils.asContainer(shortcut);
- shortcut.containerOpen = true;
- do_check_eq(shortcut.childCount, 0);
- shortcut.containerOpen = false;
- // Remove the broken shortcut while the containing result is open.
- PlacesUtils.bookmarks.removeItem(id2);
- do_check_eq(root.childCount, 2);
-
- root.containerOpen = false;
-
- // Broken folder shortcut as root node.
- query = PlacesUtils.history.getNewQuery();
- query.setFolders([1234], 1);
- options = PlacesUtils.history.getNewQueryOptions();
- root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 0);
- root.containerOpen = false;
-
- // Broken folder shortcut as root node with folder=-1.
- query = PlacesUtils.history.getNewQuery();
- query.setFolders([-1], 1);
- options = PlacesUtils.history.getNewQueryOptions();
- root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 0);
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/unit/test_browserhistory.js b/toolkit/components/places/tests/unit/test_browserhistory.js
deleted file mode 100644
index 5f88c26e3..000000000
--- a/toolkit/components/places/tests/unit/test_browserhistory.js
+++ /dev/null
@@ -1,129 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const TEST_URI = NetUtil.newURI("http://mozilla.com/");
-const TEST_SUBDOMAIN_URI = NetUtil.newURI("http://foobar.mozilla.com/");
-
-add_task(function* test_addPage() {
- yield PlacesTestUtils.addVisits(TEST_URI);
- do_check_eq(1, PlacesUtils.history.hasHistoryEntries);
-});
-
-add_task(function* test_removePage() {
- PlacesUtils.bhistory.removePage(TEST_URI);
- do_check_eq(0, PlacesUtils.history.hasHistoryEntries);
-});
-
-add_task(function* test_removePages() {
- let pages = [];
- for (let i = 0; i < 8; i++) {
- pages.push(NetUtil.newURI(TEST_URI.spec + i));
- }
-
- yield PlacesTestUtils.addVisits(pages.map(uri => ({ uri: uri })));
- // Bookmarked item should not be removed from moz_places.
- const ANNO_INDEX = 1;
- const ANNO_NAME = "testAnno";
- const ANNO_VALUE = "foo";
- const BOOKMARK_INDEX = 2;
- PlacesUtils.annotations.setPageAnnotation(pages[ANNO_INDEX],
- ANNO_NAME, ANNO_VALUE, 0,
- Ci.nsIAnnotationService.EXPIRE_NEVER);
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- pages[BOOKMARK_INDEX],
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "test bookmark");
- PlacesUtils.annotations.setPageAnnotation(pages[BOOKMARK_INDEX],
- ANNO_NAME, ANNO_VALUE, 0,
- Ci.nsIAnnotationService.EXPIRE_NEVER);
-
- PlacesUtils.bhistory.removePages(pages, pages.length);
- do_check_eq(0, PlacesUtils.history.hasHistoryEntries);
-
- // Check that the bookmark and its annotation still exist.
- do_check_true(PlacesUtils.bookmarks.getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId, 0) > 0);
- do_check_eq(PlacesUtils.annotations.getPageAnnotation(pages[BOOKMARK_INDEX], ANNO_NAME),
- ANNO_VALUE);
-
- // Check the annotation on the non-bookmarked page does not exist anymore.
- try {
- PlacesUtils.annotations.getPageAnnotation(pages[ANNO_INDEX], ANNO_NAME);
- do_throw("did not expire expire_never anno on a not bookmarked item");
- } catch (ex) {}
-
- // Cleanup.
- PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId);
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_removePagesByTimeframe() {
- let visits = [];
- let startDate = (Date.now() - 10000) * 1000;
- for (let i = 0; i < 10; i++) {
- visits.push({
- uri: NetUtil.newURI(TEST_URI.spec + i),
- visitDate: startDate + i * 1000
- });
- }
-
- yield PlacesTestUtils.addVisits(visits);
-
- // Delete all pages except the first and the last.
- PlacesUtils.bhistory.removePagesByTimeframe(startDate + 1000, startDate + 8000);
-
- // Check that we have removed the correct pages.
- for (let i = 0; i < 10; i++) {
- do_check_eq(page_in_database(NetUtil.newURI(TEST_URI.spec + i)) == 0,
- i > 0 && i < 9);
- }
-
- // Clear remaining items and check that all pages have been removed.
- PlacesUtils.bhistory.removePagesByTimeframe(startDate, startDate + 9000);
- do_check_eq(0, PlacesUtils.history.hasHistoryEntries);
-});
-
-add_task(function* test_removePagesFromHost() {
- yield PlacesTestUtils.addVisits(TEST_URI);
- PlacesUtils.bhistory.removePagesFromHost("mozilla.com", true);
- do_check_eq(0, PlacesUtils.history.hasHistoryEntries);
-});
-
-add_task(function* test_removePagesFromHost_keepSubdomains() {
- yield PlacesTestUtils.addVisits([{ uri: TEST_URI }, { uri: TEST_SUBDOMAIN_URI }]);
- PlacesUtils.bhistory.removePagesFromHost("mozilla.com", false);
- do_check_eq(1, PlacesUtils.history.hasHistoryEntries);
-});
-
-add_task(function* test_history_clear() {
- yield PlacesTestUtils.clearHistory();
- do_check_eq(0, PlacesUtils.history.hasHistoryEntries);
-});
-
-add_task(function* test_getObservers() {
- // Ensure that getObservers() invalidates the hasHistoryEntries cache.
- yield PlacesTestUtils.addVisits(TEST_URI);
- do_check_eq(1, PlacesUtils.history.hasHistoryEntries);
- // This is just for testing purposes, never do it.
- return new Promise((resolve, reject) => {
- DBConn().executeSimpleSQLAsync("DELETE FROM moz_historyvisits", {
- handleError: function(error) {
- reject(error);
- },
- handleResult: function(result) {
- },
- handleCompletion: function(result) {
- // Just invoking getObservers should be enough to invalidate the cache.
- PlacesUtils.history.getObservers();
- do_check_eq(0, PlacesUtils.history.hasHistoryEntries);
- resolve();
- }
- });
- });
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/unit/test_bug636917_isLivemark.js b/toolkit/components/places/tests/unit/test_bug636917_isLivemark.js
deleted file mode 100644
index a7ad1257a..000000000
--- a/toolkit/components/places/tests/unit/test_bug636917_isLivemark.js
+++ /dev/null
@@ -1,35 +0,0 @@
-// Test that asking for a livemark in a annotationChanged notification works.
-add_task(function* () {
- let annoPromise = new Promise(resolve => {
- let annoObserver = {
- onItemAnnotationSet(id, name) {
- if (name == PlacesUtils.LMANNO_FEEDURI) {
- PlacesUtils.annotations.removeObserver(this);
- resolve();
- }
- },
- onItemAnnotationRemoved() {},
- onPageAnnotationSet() {},
- onPageAnnotationRemoved() {},
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsIAnnotationObserver
- ]),
- };
- PlacesUtils.annotations.addObserver(annoObserver, false);
- });
-
-
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "livemark title"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , index: PlacesUtils.bookmarks.DEFAULT_INDEX
- , siteURI: uri("http://example.com/")
- , feedURI: uri("http://example.com/rdf")
- });
-
- yield annoPromise;
-
- livemark = yield PlacesUtils.livemarks.getLivemark({ guid: livemark.guid });
- Assert.ok(livemark);
- yield PlacesUtils.livemarks.removeLivemark({ guid: livemark.guid });
-});
diff --git a/toolkit/components/places/tests/unit/test_childlessTags.js b/toolkit/components/places/tests/unit/test_childlessTags.js
deleted file mode 100644
index 4c3e38fa4..000000000
--- a/toolkit/components/places/tests/unit/test_childlessTags.js
+++ /dev/null
@@ -1,117 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Ensures that removal of a bookmark untags the bookmark if it's no longer
- * contained in any regular, non-tag folders. See bug 444849.
- */
-
-// Add your tests here. Each is an object with a summary string |desc| and a
-// method run() that's called to run the test.
-var tests = [
- {
- desc: "Removing a tagged bookmark should cause the tag to be removed.",
- run: function () {
- print(" Make a bookmark.");
- var bmId = bmsvc.insertBookmark(bmsvc.unfiledBookmarksFolder,
- BOOKMARK_URI,
- bmsvc.DEFAULT_INDEX,
- "test bookmark");
- do_check_true(bmId > 0);
-
- print(" Tag it up.");
- var tags = ["foo", "bar"];
- tagssvc.tagURI(BOOKMARK_URI, tags);
- ensureTagsExist(tags);
-
- print(" Remove the bookmark. The tags should no longer exist.");
- bmsvc.removeItem(bmId);
- ensureTagsExist([]);
- }
- },
-
- {
- desc: "Removing a folder containing a tagged bookmark should cause the " +
- "tag to be removed.",
- run: function () {
- print(" Make a folder.");
- var folderId = bmsvc.createFolder(bmsvc.unfiledBookmarksFolder,
- "test folder",
- bmsvc.DEFAULT_INDEX);
- do_check_true(folderId > 0);
-
- print(" Stick a bookmark in the folder.");
- var bmId = bmsvc.insertBookmark(folderId,
- BOOKMARK_URI,
- bmsvc.DEFAULT_INDEX,
- "test bookmark");
- do_check_true(bmId > 0);
-
- print(" Tag the bookmark.");
- var tags = ["foo", "bar"];
- tagssvc.tagURI(BOOKMARK_URI, tags);
- ensureTagsExist(tags);
-
- print(" Remove the folder. The tags should no longer exist.");
- bmsvc.removeItem(folderId);
- ensureTagsExist([]);
- }
- }
-];
-
-var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-
-var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-
-var tagssvc = Cc["@mozilla.org/browser/tagging-service;1"].
- getService(Ci.nsITaggingService);
-
-const BOOKMARK_URI = uri("http://example.com/");
-
-/**
- * Runs a tag query and ensures that the tags returned are those and only those
- * in aTags. aTags may be empty, in which case this function ensures that no
- * tags exist.
- *
- * @param aTags
- * An array of tags (strings)
- */
-function ensureTagsExist(aTags) {
- var query = histsvc.getNewQuery();
- var opts = histsvc.getNewQueryOptions();
- opts.resultType = opts.RESULTS_AS_TAG_QUERY;
- var resultRoot = histsvc.executeQuery(query, opts).root;
-
- // Dupe aTags.
- var tags = aTags.slice(0);
-
- resultRoot.containerOpen = true;
-
- // Ensure that the number of tags returned from the query is the same as the
- // number in |tags|.
- do_check_eq(resultRoot.childCount, tags.length);
-
- // For each tag result from the query, ensure that it's contained in |tags|.
- // Remove the tag from |tags| so that we ensure the sets are equal.
- for (let i = 0; i < resultRoot.childCount; i++) {
- var tag = resultRoot.getChild(i).title;
- var indexOfTag = tags.indexOf(tag);
- do_check_true(indexOfTag >= 0);
- tags.splice(indexOfTag, 1);
- }
-
- resultRoot.containerOpen = false;
-}
-
-function run_test()
-{
- tests.forEach(function (test) {
- print("Running test: " + test.desc);
- test.run();
- });
-}
diff --git a/toolkit/components/places/tests/unit/test_corrupt_telemetry.js b/toolkit/components/places/tests/unit/test_corrupt_telemetry.js
deleted file mode 100644
index cd9e9ec0c..000000000
--- a/toolkit/components/places/tests/unit/test_corrupt_telemetry.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Tests that history initialization correctly handles a request to forcibly
-// replace the current database.
-
-add_task(function* () {
- let profileDBPath = yield OS.Path.join(OS.Constants.Path.profileDir, "places.sqlite");
- yield OS.File.remove(profileDBPath, {ignoreAbsent: true});
- // Ensure that our database doesn't already exist.
- Assert.ok(!(yield OS.File.exists(profileDBPath)), "places.sqlite shouldn't exist");
- let dir = yield OS.File.getCurrentDirectory();
- let src = OS.Path.join(dir, "corruptDB.sqlite");
- yield OS.File.copy(src, profileDBPath);
- Assert.ok(yield OS.File.exists(profileDBPath), "places.sqlite should exist");
-
- let count = Services.telemetry
- .getHistogramById("PLACES_DATABASE_CORRUPTION_HANDLING_STAGE")
- .snapshot()
- .counts[3];
- Assert.equal(count, 0, "There should be no telemetry");
-
- do_check_eq(PlacesUtils.history.databaseStatus,
- PlacesUtils.history.DATABASE_STATUS_CORRUPT);
-
- count = Services.telemetry
- .getHistogramById("PLACES_DATABASE_CORRUPTION_HANDLING_STAGE")
- .snapshot()
- .counts[3];
- Assert.equal(count, 1, "Telemetry should have been added");
-});
diff --git a/toolkit/components/places/tests/unit/test_crash_476292.js b/toolkit/components/places/tests/unit/test_crash_476292.js
deleted file mode 100644
index 8f0862022..000000000
--- a/toolkit/components/places/tests/unit/test_crash_476292.js
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * This tests a crash during startup found in bug 476292 that was caused by
- * getting the bookmarks service during nsNavHistory::Init when the bookmarks
- * service was created before the history service was.
- */
-
-function run_test()
-{
- // First, we need to move our old database file into our test profile
- // directory. This will trigger DATABASE_STATUS_UPGRADED (CREATE is not
- // sufficient since there will be no entries to update frecencies for, which
- // causes us to get the bookmarks service in the first place).
- let dbFile = do_get_file("bug476292.sqlite");
- let profD = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties).
- get(NS_APP_USER_PROFILE_50_DIR, Ci.nsIFile);
- dbFile.copyTo(profD, "places.sqlite");
-
- // Now get the bookmarks service. This will crash when the bug exists.
- Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-}
diff --git a/toolkit/components/places/tests/unit/test_database_replaceOnStartup.js b/toolkit/components/places/tests/unit/test_database_replaceOnStartup.js
deleted file mode 100644
index e83d0fdae..000000000
--- a/toolkit/components/places/tests/unit/test_database_replaceOnStartup.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Tests that history initialization correctly handles a request to forcibly
-// replace the current database.
-
-function run_test() {
- // Ensure that our database doesn't already exist.
- let dbFile = gProfD.clone();
- dbFile.append("places.sqlite");
- do_check_false(dbFile.exists());
-
- dbFile = gProfD.clone();
- dbFile.append("places.sqlite.corrupt");
- do_check_false(dbFile.exists());
-
- let file = do_get_file("default.sqlite");
- file.copyToFollowingLinks(gProfD, "places.sqlite");
- file = gProfD.clone();
- file.append("places.sqlite");
-
- // Create some unique stuff to check later.
- let db = Services.storage.openUnsharedDatabase(file);
- db.executeSimpleSQL("CREATE TABLE test (id INTEGER PRIMARY KEY)");
- db.close();
-
- Services.prefs.setBoolPref("places.database.replaceOnStartup", true);
- do_check_eq(PlacesUtils.history.databaseStatus,
- PlacesUtils.history.DATABASE_STATUS_CORRUPT);
-
- dbFile = gProfD.clone();
- dbFile.append("places.sqlite");
- do_check_true(dbFile.exists());
-
- // Check the new database is really a new one.
- db = Services.storage.openUnsharedDatabase(file);
- try {
- db.executeSimpleSQL("DELETE * FROM test");
- do_throw("The new database should not have our unique content");
- } catch (ex) {}
- db.close();
-
- dbFile = gProfD.clone();
- dbFile.append("places.sqlite.corrupt");
- do_check_true(dbFile.exists());
-}
diff --git a/toolkit/components/places/tests/unit/test_download_history.js b/toolkit/components/places/tests/unit/test_download_history.js
deleted file mode 100644
index 643360b20..000000000
--- a/toolkit/components/places/tests/unit/test_download_history.js
+++ /dev/null
@@ -1,283 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests the nsIDownloadHistory Places implementation.
- */
-
-XPCOMUtils.defineLazyServiceGetter(this, "gDownloadHistory",
- "@mozilla.org/browser/download-history;1",
- "nsIDownloadHistory");
-
-const DOWNLOAD_URI = NetUtil.newURI("http://www.example.com/");
-const REFERRER_URI = NetUtil.newURI("http://www.example.org/");
-const PRIVATE_URI = NetUtil.newURI("http://www.example.net/");
-
-/**
- * Waits for the first visit notification to be received.
- *
- * @param aCallback
- * Callback function to be called with the same arguments of onVisit.
- */
-function waitForOnVisit(aCallback) {
- let historyObserver = {
- __proto__: NavHistoryObserver.prototype,
- onVisit: function HO_onVisit() {
- PlacesUtils.history.removeObserver(this);
- aCallback.apply(null, arguments);
- }
- };
- PlacesUtils.history.addObserver(historyObserver, false);
-}
-
-/**
- * Waits for the first onDeleteURI notification to be received.
- *
- * @param aCallback
- * Callback function to be called with the same arguments of onDeleteURI.
- */
-function waitForOnDeleteURI(aCallback) {
- let historyObserver = {
- __proto__: NavHistoryObserver.prototype,
- onDeleteURI: function HO_onDeleteURI() {
- PlacesUtils.history.removeObserver(this);
- aCallback.apply(null, arguments);
- }
- };
- PlacesUtils.history.addObserver(historyObserver, false);
-}
-
-/**
- * Waits for the first onDeleteVisits notification to be received.
- *
- * @param aCallback
- * Callback function to be called with the same arguments of onDeleteVisits.
- */
-function waitForOnDeleteVisits(aCallback) {
- let historyObserver = {
- __proto__: NavHistoryObserver.prototype,
- onDeleteVisits: function HO_onDeleteVisits() {
- PlacesUtils.history.removeObserver(this);
- aCallback.apply(null, arguments);
- }
- };
- PlacesUtils.history.addObserver(historyObserver, false);
-}
-
-function run_test()
-{
- run_next_test();
-}
-
-add_test(function test_dh_is_from_places()
-{
- // Test that this nsIDownloadHistory is the one places implements.
- do_check_true(gDownloadHistory instanceof Ci.mozIAsyncHistory);
-
- run_next_test();
-});
-
-add_test(function test_dh_addRemoveDownload()
-{
- waitForOnVisit(function DHAD_onVisit(aURI) {
- do_check_true(aURI.equals(DOWNLOAD_URI));
-
- // Verify that the URI is already available in results at this time.
- do_check_true(!!page_in_database(DOWNLOAD_URI));
-
- waitForOnDeleteURI(function DHRAD_onDeleteURI(aDeletedURI) {
- do_check_true(aDeletedURI.equals(DOWNLOAD_URI));
-
- // Verify that the URI is already available in results at this time.
- do_check_false(!!page_in_database(DOWNLOAD_URI));
-
- run_next_test();
- });
- gDownloadHistory.removeAllDownloads();
- });
-
- gDownloadHistory.addDownload(DOWNLOAD_URI, null, Date.now() * 1000);
-});
-
-add_test(function test_dh_addMultiRemoveDownload()
-{
- PlacesTestUtils.addVisits({
- uri: DOWNLOAD_URI,
- transition: TRANSITION_TYPED
- }).then(function () {
- waitForOnVisit(function DHAD_onVisit(aURI) {
- do_check_true(aURI.equals(DOWNLOAD_URI));
- do_check_true(!!page_in_database(DOWNLOAD_URI));
-
- waitForOnDeleteVisits(function DHRAD_onDeleteVisits(aDeletedURI) {
- do_check_true(aDeletedURI.equals(DOWNLOAD_URI));
- do_check_true(!!page_in_database(DOWNLOAD_URI));
-
- PlacesTestUtils.clearHistory().then(run_next_test);
- });
- gDownloadHistory.removeAllDownloads();
- });
-
- gDownloadHistory.addDownload(DOWNLOAD_URI, null, Date.now() * 1000);
- });
-});
-
-add_test(function test_dh_addBookmarkRemoveDownload()
-{
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- DOWNLOAD_URI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "A bookmark");
- waitForOnVisit(function DHAD_onVisit(aURI) {
- do_check_true(aURI.equals(DOWNLOAD_URI));
- do_check_true(!!page_in_database(DOWNLOAD_URI));
-
- waitForOnDeleteVisits(function DHRAD_onDeleteVisits(aDeletedURI) {
- do_check_true(aDeletedURI.equals(DOWNLOAD_URI));
- do_check_true(!!page_in_database(DOWNLOAD_URI));
-
- PlacesTestUtils.clearHistory().then(run_next_test);
- });
- gDownloadHistory.removeAllDownloads();
- });
-
- gDownloadHistory.addDownload(DOWNLOAD_URI, null, Date.now() * 1000);
-});
-
-add_test(function test_dh_addDownload_referrer()
-{
- waitForOnVisit(function DHAD_prepareReferrer(aURI, aVisitID) {
- do_check_true(aURI.equals(REFERRER_URI));
- let referrerVisitId = aVisitID;
-
- waitForOnVisit(function DHAD_onVisit(aVisitedURI, unused, unused2, unused3,
- aReferringID) {
- do_check_true(aVisitedURI.equals(DOWNLOAD_URI));
- do_check_eq(aReferringID, referrerVisitId);
-
- // Verify that the URI is already available in results at this time.
- do_check_true(!!page_in_database(DOWNLOAD_URI));
-
- PlacesTestUtils.clearHistory().then(run_next_test);
- });
-
- gDownloadHistory.addDownload(DOWNLOAD_URI, REFERRER_URI, Date.now() * 1000);
- });
-
- // Note that we don't pass the optional callback argument here because we must
- // ensure that we receive the onVisit notification before we call addDownload.
- PlacesUtils.asyncHistory.updatePlaces({
- uri: REFERRER_URI,
- visits: [{
- transitionType: Ci.nsINavHistoryService.TRANSITION_TYPED,
- visitDate: Date.now() * 1000
- }]
- });
-});
-
-add_test(function test_dh_addDownload_disabledHistory()
-{
- waitForOnVisit(function DHAD_onVisit(aURI) {
- // We should only receive the notification for the non-private URI. This
- // test is based on the assumption that visit notifications are received in
- // the same order of the addDownload calls, which is currently true because
- // database access is serialized on the same worker thread.
- do_check_true(aURI.equals(DOWNLOAD_URI));
-
- do_check_true(!!page_in_database(DOWNLOAD_URI));
- do_check_false(!!page_in_database(PRIVATE_URI));
-
- PlacesTestUtils.clearHistory().then(run_next_test);
- });
-
- Services.prefs.setBoolPref("places.history.enabled", false);
- gDownloadHistory.addDownload(PRIVATE_URI, REFERRER_URI, Date.now() * 1000);
-
- // The addDownload functions calls CanAddURI synchronously, thus we can set
- // the preference back to true immediately (not all apps enable places by
- // default).
- Services.prefs.setBoolPref("places.history.enabled", true);
- gDownloadHistory.addDownload(DOWNLOAD_URI, REFERRER_URI, Date.now() * 1000);
-});
-
-/**
- * Tests that nsIDownloadHistory::AddDownload saves the additional download
- * details if the optional destination URL is specified.
- */
-add_test(function test_dh_details()
-{
- const REMOTE_URI = NetUtil.newURI("http://localhost/");
- const SOURCE_URI = NetUtil.newURI("http://example.com/test_dh_details");
- const DEST_FILE_NAME = "dest.txt";
-
- // We must build a real, valid file URI for the destination.
- let destFileUri = NetUtil.newURI(FileUtils.getFile("TmpD", [DEST_FILE_NAME]));
-
- let titleSet = false;
- let destinationFileUriSet = false;
- let destinationFileNameSet = false;
-
- function checkFinished()
- {
- if (titleSet && destinationFileUriSet && destinationFileNameSet) {
- PlacesUtils.annotations.removeObserver(annoObserver);
- PlacesUtils.history.removeObserver(historyObserver);
-
- PlacesTestUtils.clearHistory().then(run_next_test);
- }
- }
-
- let annoObserver = {
- onPageAnnotationSet: function AO_onPageAnnotationSet(aPage, aName)
- {
- if (aPage.equals(SOURCE_URI)) {
- let value = PlacesUtils.annotations.getPageAnnotation(aPage, aName);
- switch (aName)
- {
- case "downloads/destinationFileURI":
- destinationFileUriSet = true;
- do_check_eq(value, destFileUri.spec);
- break;
- case "downloads/destinationFileName":
- destinationFileNameSet = true;
- do_check_eq(value, DEST_FILE_NAME);
- break;
- }
- checkFinished();
- }
- },
- onItemAnnotationSet: function() {},
- onPageAnnotationRemoved: function() {},
- onItemAnnotationRemoved: function() {}
- }
-
- let historyObserver = {
- onBeginUpdateBatch: function() {},
- onEndUpdateBatch: function() {},
- onVisit: function() {},
- onTitleChanged: function HO_onTitleChanged(aURI, aPageTitle)
- {
- if (aURI.equals(SOURCE_URI)) {
- titleSet = true;
- do_check_eq(aPageTitle, DEST_FILE_NAME);
- checkFinished();
- }
- },
- onDeleteURI: function() {},
- onClearHistory: function() {},
- onPageChanged: function() {},
- onDeleteVisits: function() {}
- };
-
- PlacesUtils.annotations.addObserver(annoObserver, false);
- PlacesUtils.history.addObserver(historyObserver, false);
-
- // Both null values and remote URIs should not cause errors.
- gDownloadHistory.addDownload(SOURCE_URI, null, Date.now() * 1000);
- gDownloadHistory.addDownload(SOURCE_URI, null, Date.now() * 1000, null);
- gDownloadHistory.addDownload(SOURCE_URI, null, Date.now() * 1000, REMOTE_URI);
-
- // Valid local file URIs should cause the download details to be saved.
- gDownloadHistory.addDownload(SOURCE_URI, null, Date.now() * 1000,
- destFileUri);
-});
diff --git a/toolkit/components/places/tests/unit/test_frecency.js b/toolkit/components/places/tests/unit/test_frecency.js
deleted file mode 100644
index a04befe00..000000000
--- a/toolkit/components/places/tests/unit/test_frecency.js
+++ /dev/null
@@ -1,294 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test for bug 406358 to make sure frecency works for empty input/search, but
- * this also tests for non-empty inputs as well. Because the interactions among
- * *DIFFERENT* visit counts and visit dates is not well defined, this test
- * holds one of the two values constant when modifying the other.
- *
- * Also test bug 419068 to make sure tagged pages don't necessarily have to be
- * first in the results.
- *
- * Also test bug 426166 to make sure that the results of autocomplete searches
- * are stable. Note that failures of this test will be intermittent by nature
- * since we are testing to make sure that the unstable sort algorithm used
- * by SQLite is not changing the order of the results on us.
- */
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
-
- searches: null,
-
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "",
- disableAutoComplete: false,
- completeDefaultIndex: false,
-
- get searchCount() {
- return this.searches.length;
- },
-
- getSearchAt: function(aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchBegin: function() {},
- onSearchComplete: function() {},
-
- popupOpen: false,
-
- popup: {
- setSelectedIndex: function(aIndex) {},
- invalidate: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompletePopup))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- },
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteInput))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-function ensure_results(uris, searchTerm)
-{
- PlacesTestUtils.promiseAsyncUpdates()
- .then(() => ensure_results_internal(uris, searchTerm));
-}
-
-function ensure_results_internal(uris, searchTerm)
-{
- var controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
- getService(Components.interfaces.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches
- // and confirms results on search complete
- var input = new AutoCompleteInput(["unifiedcomplete"]);
-
- controller.input = input;
-
- var numSearchesStarted = 0;
- input.onSearchBegin = function() {
- numSearchesStarted++;
- do_check_eq(numSearchesStarted, 1);
- };
-
- input.onSearchComplete = function() {
- do_check_eq(numSearchesStarted, 1);
- do_check_eq(controller.searchStatus,
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
- do_check_eq(controller.matchCount, uris.length);
- for (var i=0; i<controller.matchCount; i++) {
- do_check_eq(controller.getValueAt(i), uris[i].spec);
- }
-
- deferEnsureResults.resolve();
- };
-
- controller.startSearch(searchTerm);
-}
-
-// Get history service
-try {
- var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
- var bhist = histsvc.QueryInterface(Ci.nsIBrowserHistory);
- var tagssvc = Cc["@mozilla.org/browser/tagging-service;1"].
- getService(Ci.nsITaggingService);
- var bmksvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-} catch (ex) {
- do_throw("Could not get history service\n");
-}
-
-function* task_setCountDate(aURI, aCount, aDate)
-{
- // We need visits so that frecency can be computed over multiple visits
- let visits = [];
- for (let i = 0; i < aCount; i++) {
- visits.push({ uri: aURI, visitDate: aDate, transition: TRANSITION_TYPED });
- }
- yield PlacesTestUtils.addVisits(visits);
-}
-
-function setBookmark(aURI)
-{
- bmksvc.insertBookmark(bmksvc.bookmarksMenuFolder, aURI, -1, "bleh");
-}
-
-function tagURI(aURI, aTags) {
- bmksvc.insertBookmark(bmksvc.unfiledBookmarksFolder, aURI,
- bmksvc.DEFAULT_INDEX, "bleh");
- tagssvc.tagURI(aURI, aTags);
-}
-
-var uri1 = uri("http://site.tld/1");
-var uri2 = uri("http://site.tld/2");
-var uri3 = uri("http://aaaaaaaaaa/1");
-var uri4 = uri("http://aaaaaaaaaa/2");
-
-// d1 is younger (should show up higher) than d2 (PRTime is in usecs not msec)
-// Make sure the dates fall into different frecency buckets
-var d1 = new Date(Date.now() - 1000 * 60 * 60) * 1000;
-var d2 = new Date(Date.now() - 1000 * 60 * 60 * 24 * 10) * 1000;
-// c1 is larger (should show up higher) than c2
-var c1 = 10;
-var c2 = 1;
-
-var tests = [
-// test things without a search term
-function*() {
- print("TEST-INFO | Test 0: same count, different date");
- yield task_setCountDate(uri1, c1, d1);
- yield task_setCountDate(uri2, c1, d2);
- tagURI(uri1, ["site"]);
- ensure_results([uri1, uri2], "");
-},
-function*() {
- print("TEST-INFO | Test 1: same count, different date");
- yield task_setCountDate(uri1, c1, d2);
- yield task_setCountDate(uri2, c1, d1);
- tagURI(uri1, ["site"]);
- ensure_results([uri2, uri1], "");
-},
-function*() {
- print("TEST-INFO | Test 2: different count, same date");
- yield task_setCountDate(uri1, c1, d1);
- yield task_setCountDate(uri2, c2, d1);
- tagURI(uri1, ["site"]);
- ensure_results([uri1, uri2], "");
-},
-function*() {
- print("TEST-INFO | Test 3: different count, same date");
- yield task_setCountDate(uri1, c2, d1);
- yield task_setCountDate(uri2, c1, d1);
- tagURI(uri1, ["site"]);
- ensure_results([uri2, uri1], "");
-},
-
-// test things with a search term
-function*() {
- print("TEST-INFO | Test 4: same count, different date");
- yield task_setCountDate(uri1, c1, d1);
- yield task_setCountDate(uri2, c1, d2);
- tagURI(uri1, ["site"]);
- ensure_results([uri1, uri2], "site");
-},
-function*() {
- print("TEST-INFO | Test 5: same count, different date");
- yield task_setCountDate(uri1, c1, d2);
- yield task_setCountDate(uri2, c1, d1);
- tagURI(uri1, ["site"]);
- ensure_results([uri2, uri1], "site");
-},
-function*() {
- print("TEST-INFO | Test 6: different count, same date");
- yield task_setCountDate(uri1, c1, d1);
- yield task_setCountDate(uri2, c2, d1);
- tagURI(uri1, ["site"]);
- ensure_results([uri1, uri2], "site");
-},
-function*() {
- print("TEST-INFO | Test 7: different count, same date");
- yield task_setCountDate(uri1, c2, d1);
- yield task_setCountDate(uri2, c1, d1);
- tagURI(uri1, ["site"]);
- ensure_results([uri2, uri1], "site");
-},
-// There are multiple tests for 8, hence the multiple functions
-// Bug 426166 section
-function*() {
- print("TEST-INFO | Test 8.1a: same count, same date");
- setBookmark(uri3);
- setBookmark(uri4);
- ensure_results([uri4, uri3], "a");
-},
-function*() {
- print("TEST-INFO | Test 8.1b: same count, same date");
- setBookmark(uri3);
- setBookmark(uri4);
- ensure_results([uri4, uri3], "aa");
-},
-function*() {
- print("TEST-INFO | Test 8.2: same count, same date");
- setBookmark(uri3);
- setBookmark(uri4);
- ensure_results([uri4, uri3], "aaa");
-},
-function*() {
- print("TEST-INFO | Test 8.3: same count, same date");
- setBookmark(uri3);
- setBookmark(uri4);
- ensure_results([uri4, uri3], "aaaa");
-},
-function*() {
- print("TEST-INFO | Test 8.4: same count, same date");
- setBookmark(uri3);
- setBookmark(uri4);
- ensure_results([uri4, uri3], "aaa");
-},
-function*() {
- print("TEST-INFO | Test 8.5: same count, same date");
- setBookmark(uri3);
- setBookmark(uri4);
- ensure_results([uri4, uri3], "aa");
-},
-function*() {
- print("TEST-INFO | Test 8.6: same count, same date");
- setBookmark(uri3);
- setBookmark(uri4);
- ensure_results([uri4, uri3], "a");
-}
-];
-
-/**
- * This deferred object contains a promise that is resolved when the
- * ensure_results_internal function has finished its execution.
- */
-var deferEnsureResults;
-
-add_task(function* test_frecency()
-{
- // Disable autoFill for this test.
- Services.prefs.setBoolPref("browser.urlbar.autoFill", false);
- do_register_cleanup(() => Services.prefs.clearUserPref("browser.urlbar.autoFill"));
- // always search in history + bookmarks, no matter what the default is
- var prefs = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
-
- prefs.setBoolPref("browser.urlbar.suggest.history", true);
- prefs.setBoolPref("browser.urlbar.suggest.bookmark", true);
- prefs.setBoolPref("browser.urlbar.suggest.openpage", false);
- for (let test of tests) {
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-
- deferEnsureResults = Promise.defer();
- yield test();
- yield deferEnsureResults.promise;
- }
- for (let type of ["history", "bookmark", "openpage"]) {
- prefs.clearUserPref("browser.urlbar.suggest." + type);
- }
-});
diff --git a/toolkit/components/places/tests/unit/test_frecency_observers.js b/toolkit/components/places/tests/unit/test_frecency_observers.js
deleted file mode 100644
index 7fadd4ae9..000000000
--- a/toolkit/components/places/tests/unit/test_frecency_observers.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function run_test() {
- run_next_test();
-}
-
-// Each of these tests a path that triggers a frecency update. Together they
-// hit all sites that update a frecency.
-
-// InsertVisitedURIs::UpdateFrecency and History::InsertPlace
-add_task(function* test_InsertVisitedURIs_UpdateFrecency_and_History_InsertPlace() {
- // InsertPlace is at the end of a path that UpdateFrecency is also on, so kill
- // two birds with one stone and expect two notifications. Trigger the path by
- // adding a download.
- let uri = NetUtil.newURI("http://example.com/a");
- Cc["@mozilla.org/browser/download-history;1"].
- getService(Ci.nsIDownloadHistory).
- addDownload(uri);
- yield Promise.all([onFrecencyChanged(uri), onFrecencyChanged(uri)]);
-});
-
-// nsNavHistory::UpdateFrecency
-add_task(function* test_nsNavHistory_UpdateFrecency() {
- let bm = PlacesUtils.bookmarks;
- let uri = NetUtil.newURI("http://example.com/b");
- bm.insertBookmark(bm.unfiledBookmarksFolder, uri,
- Ci.nsINavBookmarksService.DEFAULT_INDEX, "test");
- yield onFrecencyChanged(uri);
-});
-
-// nsNavHistory::invalidateFrecencies for particular pages
-add_task(function* test_nsNavHistory_invalidateFrecencies_somePages() {
- let uri = NetUtil.newURI("http://test-nsNavHistory-invalidateFrecencies-somePages.com/");
- // Bookmarking the URI is enough to add it to moz_places, and importantly, it
- // means that removePagesFromHost doesn't remove it from moz_places, so its
- // frecency is able to be changed.
- let bm = PlacesUtils.bookmarks;
- bm.insertBookmark(bm.unfiledBookmarksFolder, uri,
- Ci.nsINavBookmarksService.DEFAULT_INDEX, "test");
- PlacesUtils.history.removePagesFromHost(uri.host, false);
- yield onFrecencyChanged(uri);
-});
-
-// nsNavHistory::invalidateFrecencies for all pages
-add_task(function* test_nsNavHistory_invalidateFrecencies_allPages() {
- yield Promise.all([onManyFrecenciesChanged(), PlacesTestUtils.clearHistory()]);
-});
-
-// nsNavHistory::DecayFrecency and nsNavHistory::FixInvalidFrecencies
-add_task(function* test_nsNavHistory_DecayFrecency_and_nsNavHistory_FixInvalidFrecencies() {
- // FixInvalidFrecencies is at the end of a path that DecayFrecency is also on,
- // so expect two notifications. Trigger the path by making nsNavHistory
- // observe the idle-daily notification.
- PlacesUtils.history.QueryInterface(Ci.nsIObserver).
- observe(null, "idle-daily", "");
- yield Promise.all([onManyFrecenciesChanged(), onManyFrecenciesChanged()]);
-});
-
-function onFrecencyChanged(expectedURI) {
- let deferred = Promise.defer();
- let obs = new NavHistoryObserver();
- obs.onFrecencyChanged =
- (uri, newFrecency, guid, hidden, visitDate) => {
- PlacesUtils.history.removeObserver(obs);
- do_check_true(!!uri);
- do_check_true(uri.equals(expectedURI));
- deferred.resolve();
- };
- PlacesUtils.history.addObserver(obs, false);
- return deferred.promise;
-}
-
-function onManyFrecenciesChanged() {
- let deferred = Promise.defer();
- let obs = new NavHistoryObserver();
- obs.onManyFrecenciesChanged = () => {
- PlacesUtils.history.removeObserver(obs);
- do_check_true(true);
- deferred.resolve();
- };
- PlacesUtils.history.addObserver(obs, false);
- return deferred.promise;
-}
diff --git a/toolkit/components/places/tests/unit/test_frecency_zero_updated.js b/toolkit/components/places/tests/unit/test_frecency_zero_updated.js
deleted file mode 100644
index e60030ca5..000000000
--- a/toolkit/components/places/tests/unit/test_frecency_zero_updated.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Tests a zero frecency is correctly updated when inserting new valid visits.
-
-function run_test()
-{
- run_next_test()
-}
-
-add_task(function* ()
-{
- const TEST_URI = NetUtil.newURI("http://example.com/");
- let id = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- TEST_URI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "A title");
- yield PlacesTestUtils.promiseAsyncUpdates();
- do_check_true(frecencyForUrl(TEST_URI) > 0);
-
- // Removing the bookmark should leave an orphan page with zero frecency.
- // Note this would usually be expired later by expiration.
- PlacesUtils.bookmarks.removeItem(id);
- yield PlacesTestUtils.promiseAsyncUpdates();
- do_check_eq(frecencyForUrl(TEST_URI), 0);
-
- // Now add a valid visit to the page, frecency should increase.
- yield PlacesTestUtils.addVisits({ uri: TEST_URI });
- do_check_true(frecencyForUrl(TEST_URI) > 0);
-});
diff --git a/toolkit/components/places/tests/unit/test_getChildIndex.js b/toolkit/components/places/tests/unit/test_getChildIndex.js
deleted file mode 100644
index 4cf164d45..000000000
--- a/toolkit/components/places/tests/unit/test_getChildIndex.js
+++ /dev/null
@@ -1,69 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim:set ts=2 sw=2 sts=2 et:
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * Tests nsNavHistoryContainerResultNode::GetChildIndex(aNode) functionality.
- */
-
-function run_test() {
- // Add a bookmark to the menu.
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.bookmarksMenuFolderId,
- uri("http://test.mozilla.org/bookmark/"),
- Ci.nsINavBookmarksService.DEFAULT_INDEX,
- "Test bookmark");
-
- // Add a bookmark to unfiled folder.
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- uri("http://test.mozilla.org/unfiled/"),
- Ci.nsINavBookmarksService.DEFAULT_INDEX,
- "Unfiled bookmark");
-
- // Get the unfiled bookmark node.
- let unfiledNode = getNodeAt(PlacesUtils.unfiledBookmarksFolderId, 0);
- if (!unfiledNode)
- do_throw("Unable to find bookmark in hierarchy!");
- do_check_eq(unfiledNode.title, "Unfiled bookmark");
-
- let hs = PlacesUtils.history;
- let query = hs.getNewQuery();
- query.setFolders([PlacesUtils.bookmarksMenuFolderId], 1);
- let options = hs.getNewQueryOptions();
- options.queryType = options.QUERY_TYPE_BOOKMARKS;
- let root = hs.executeQuery(query, options).root;
- root.containerOpen = true;
-
- // Check functionality for proper nodes.
- for (let i = 0; i < root.childCount; i++) {
- let node = root.getChild(i);
- print("Now testing: " + node.title);
- do_check_eq(root.getChildIndex(node), i);
- }
-
- // Now search for an invalid node and expect an exception.
- try {
- root.getChildIndex(unfiledNode);
- do_throw("Searching for an invalid node should have thrown.");
- } catch (ex) {
- print("We correctly got an exception.");
- }
-
- root.containerOpen = false;
-}
-
-function getNodeAt(aFolderId, aIndex) {
- let hs = PlacesUtils.history;
- let query = hs.getNewQuery();
- query.setFolders([aFolderId], 1);
- let options = hs.getNewQueryOptions();
- options.queryType = options.QUERY_TYPE_BOOKMARKS;
- let root = hs.executeQuery(query, options).root;
- root.containerOpen = true;
- if (root.childCount < aIndex)
- do_throw("Not enough children to find bookmark!");
- let node = root.getChild(aIndex);
- root.containerOpen = false;
- return node;
-}
diff --git a/toolkit/components/places/tests/unit/test_getPlacesInfo.js b/toolkit/components/places/tests/unit/test_getPlacesInfo.js
deleted file mode 100644
index 3dfecb934..000000000
--- a/toolkit/components/places/tests/unit/test_getPlacesInfo.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function promiseGetPlacesInfo(aPlacesIdentifiers) {
- let deferred = Promise.defer();
- PlacesUtils.asyncHistory.getPlacesInfo(aPlacesIdentifiers, {
- _results: [],
- _errors: [],
-
- handleResult: function handleResult(aPlaceInfo) {
- this._results.push(aPlaceInfo);
- },
- handleError: function handleError(aResultCode, aPlaceInfo) {
- this._errors.push({ resultCode: aResultCode, info: aPlaceInfo });
- },
- handleCompletion: function handleCompletion() {
- deferred.resolve({ errors: this._errors, results: this._results });
- }
- });
-
- return deferred.promise;
-}
-
-function ensurePlacesInfoObjectsAreEqual(a, b) {
- do_check_true(a.uri.equals(b.uri));
- do_check_eq(a.title, b.title);
- do_check_eq(a.guid, b.guid);
- do_check_eq(a.placeId, b.placeId);
-}
-
-function* test_getPlacesInfoExistentPlace() {
- let testURI = NetUtil.newURI("http://www.example.tld");
- yield PlacesTestUtils.addVisits(testURI);
-
- let getPlacesInfoResult = yield promiseGetPlacesInfo([testURI]);
- do_check_eq(getPlacesInfoResult.results.length, 1);
- do_check_eq(getPlacesInfoResult.errors.length, 0);
-
- let placeInfo = getPlacesInfoResult.results[0];
- do_check_true(placeInfo instanceof Ci.mozIPlaceInfo);
-
- do_check_true(placeInfo.uri.equals(testURI));
- do_check_eq(placeInfo.title, "test visit for " + testURI.spec);
- do_check_true(placeInfo.guid.length > 0);
- do_check_eq(placeInfo.visits, null);
-}
-add_task(test_getPlacesInfoExistentPlace);
-
-function* test_getPlacesInfoNonExistentPlace() {
- let testURI = NetUtil.newURI("http://www.example_non_existent.tld");
- let getPlacesInfoResult = yield promiseGetPlacesInfo(testURI);
- do_check_eq(getPlacesInfoResult.results.length, 0);
- do_check_eq(getPlacesInfoResult.errors.length, 1);
-}
-add_task(test_getPlacesInfoNonExistentPlace);
-
-function* test_promisedHelper() {
- let uri = NetUtil.newURI("http://www.helper_existent_example.tld");
- yield PlacesTestUtils.addVisits(uri);
- let placeInfo = yield PlacesUtils.promisePlaceInfo(uri);
- do_check_true(placeInfo instanceof Ci.mozIPlaceInfo);
-
- uri = NetUtil.newURI("http://www.helper_non_existent_example.tld");
- try {
- yield PlacesUtils.promisePlaceInfo(uri);
- do_throw("PlacesUtils.promisePlaceInfo should have rejected the promise");
- }
- catch (ex) { }
-}
-add_task(test_promisedHelper);
-
-function* test_infoByGUID() {
- let testURI = NetUtil.newURI("http://www.guid_example.tld");
- yield PlacesTestUtils.addVisits(testURI);
-
- let placeInfoByURI = yield PlacesUtils.promisePlaceInfo(testURI);
- let placeInfoByGUID = yield PlacesUtils.promisePlaceInfo(placeInfoByURI.guid);
- ensurePlacesInfoObjectsAreEqual(placeInfoByURI, placeInfoByGUID);
-}
-add_task(test_infoByGUID);
-
-function* test_invalid_guid() {
- try {
- yield PlacesUtils.promisePlaceInfo("###");
- do_throw("getPlacesInfo should fail for invalid guids")
- }
- catch (ex) { }
-}
-add_task(test_invalid_guid);
-
-function* test_mixed_selection() {
- let placeInfo1, placeInfo2;
- let uri = NetUtil.newURI("http://www.mixed_selection_test_1.tld");
- yield PlacesTestUtils.addVisits(uri);
- placeInfo1 = yield PlacesUtils.promisePlaceInfo(uri);
-
- uri = NetUtil.newURI("http://www.mixed_selection_test_2.tld");
- yield PlacesTestUtils.addVisits(uri);
- placeInfo2 = yield PlacesUtils.promisePlaceInfo(uri);
-
- let getPlacesInfoResult = yield promiseGetPlacesInfo([placeInfo1.uri, placeInfo2.guid]);
- do_check_eq(getPlacesInfoResult.results.length, 2);
- do_check_eq(getPlacesInfoResult.errors.length, 0);
-
- do_check_eq(getPlacesInfoResult.results[0].uri.spec, placeInfo1.uri.spec);
- do_check_eq(getPlacesInfoResult.results[1].guid, placeInfo2.guid);
-}
-add_task(test_mixed_selection);
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/unit/test_history.js b/toolkit/components/places/tests/unit/test_history.js
deleted file mode 100644
index 8d194cde1..000000000
--- a/toolkit/components/places/tests/unit/test_history.js
+++ /dev/null
@@ -1,184 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Get history services
-var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-
-/**
- * Checks to see that a URI is in the database.
- *
- * @param aURI
- * The URI to check.
- * @returns true if the URI is in the DB, false otherwise.
- */
-function uri_in_db(aURI) {
- var options = histsvc.getNewQueryOptions();
- options.maxResults = 1;
- options.resultType = options.RESULTS_AS_URI
- var query = histsvc.getNewQuery();
- query.uri = aURI;
- var result = histsvc.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- var cc = root.childCount;
- root.containerOpen = false;
- return (cc == 1);
-}
-
-// main
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- // we have a new profile, so we should have imported bookmarks
- do_check_eq(histsvc.databaseStatus, histsvc.DATABASE_STATUS_CREATE);
-
- // add a visit
- var testURI = uri("http://mozilla.com");
- yield PlacesTestUtils.addVisits(testURI);
-
- // now query for the visit, setting sorting and limit such that
- // we should retrieve only the visit we just added
- var options = histsvc.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_DATE_DESCENDING;
- options.maxResults = 1;
- // TODO: using full visit crashes in xpcshell test
- // options.resultType = options.RESULTS_AS_FULL_VISIT;
- options.resultType = options.RESULTS_AS_VISIT;
- var query = histsvc.getNewQuery();
- var result = histsvc.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- var cc = root.childCount;
- for (var i=0; i < cc; ++i) {
- var node = root.getChild(i);
- // test node properties in RESULTS_AS_VISIT
- do_check_eq(node.uri, testURI.spec);
- do_check_eq(node.type, Ci.nsINavHistoryResultNode.RESULT_TYPE_URI);
- // TODO: change query type to RESULTS_AS_FULL_VISIT and test this
- // do_check_eq(node.transitionType, histsvc.TRANSITION_TYPED);
- }
- root.containerOpen = false;
-
- // add another visit for the same URI, and a third visit for a different URI
- var testURI2 = uri("http://google.com/");
- yield PlacesTestUtils.addVisits(testURI);
- yield PlacesTestUtils.addVisits(testURI2);
-
- options.maxResults = 5;
- options.resultType = options.RESULTS_AS_URI;
-
- // test minVisits
- query.minVisits = 0;
- result = histsvc.executeQuery(query, options);
- result.root.containerOpen = true;
- do_check_eq(result.root.childCount, 2);
- result.root.containerOpen = false;
- query.minVisits = 1;
- result = histsvc.executeQuery(query, options);
- result.root.containerOpen = true;
- do_check_eq(result.root.childCount, 2);
- result.root.containerOpen = false;
- query.minVisits = 2;
- result = histsvc.executeQuery(query, options);
- result.root.containerOpen = true;
- do_check_eq(result.root.childCount, 1);
- query.minVisits = 3;
- result.root.containerOpen = false;
- result = histsvc.executeQuery(query, options);
- result.root.containerOpen = true;
- do_check_eq(result.root.childCount, 0);
- result.root.containerOpen = false;
-
- // test maxVisits
- query.minVisits = -1;
- query.maxVisits = -1;
- result = histsvc.executeQuery(query, options);
- result.root.containerOpen = true;
- do_check_eq(result.root.childCount, 2);
- result.root.containerOpen = false;
- query.maxVisits = 0;
- result = histsvc.executeQuery(query, options);
- result.root.containerOpen = true;
- do_check_eq(result.root.childCount, 0);
- result.root.containerOpen = false;
- query.maxVisits = 1;
- result = histsvc.executeQuery(query, options);
- result.root.containerOpen = true;
- do_check_eq(result.root.childCount, 1);
- result.root.containerOpen = false;
- query.maxVisits = 2;
- result = histsvc.executeQuery(query, options);
- result.root.containerOpen = true;
- do_check_eq(result.root.childCount, 2);
- result.root.containerOpen = false;
- query.maxVisits = 3;
- result = histsvc.executeQuery(query, options);
- result.root.containerOpen = true;
- do_check_eq(result.root.childCount, 2);
- result.root.containerOpen = false;
-
- // test annotation-based queries
- var annos = Cc["@mozilla.org/browser/annotation-service;1"].
- getService(Ci.nsIAnnotationService);
- annos.setPageAnnotation(uri("http://mozilla.com/"), "testAnno", 0, 0,
- Ci.nsIAnnotationService.EXPIRE_NEVER);
- query.annotation = "testAnno";
- result = histsvc.executeQuery(query, options);
- result.root.containerOpen = true;
- do_check_eq(result.root.childCount, 1);
- do_check_eq(result.root.getChild(0).uri, "http://mozilla.com/");
- result.root.containerOpen = false;
-
- // test annotationIsNot
- query.annotationIsNot = true;
- result = histsvc.executeQuery(query, options);
- result.root.containerOpen = true;
- do_check_eq(result.root.childCount, 1);
- do_check_eq(result.root.getChild(0).uri, "http://google.com/");
- result.root.containerOpen = false;
-
- // By default history is enabled.
- do_check_true(!histsvc.historyDisabled);
-
- // test getPageTitle
- yield PlacesTestUtils.addVisits({ uri: uri("http://example.com"), title: "title" });
- let placeInfo = yield PlacesUtils.promisePlaceInfo(uri("http://example.com"));
- do_check_eq(placeInfo.title, "title");
-
- // query for the visit
- do_check_true(uri_in_db(testURI));
-
- // test for schema changes in bug 373239
- // get direct db connection
- var db = histsvc.QueryInterface(Ci.nsPIPlacesDatabase).DBConnection;
- var q = "SELECT id FROM moz_bookmarks";
- var statement;
- try {
- statement = db.createStatement(q);
- } catch (ex) {
- do_throw("bookmarks table does not have id field, schema is too old!");
- }
- finally {
- statement.finalize();
- }
-
- // bug 394741 - regressed history text searches
- yield PlacesTestUtils.addVisits(uri("http://mozilla.com"));
- options = histsvc.getNewQueryOptions();
- // options.resultType = options.RESULTS_AS_VISIT;
- query = histsvc.getNewQuery();
- query.searchTerms = "moz";
- result = histsvc.executeQuery(query, options);
- root = result.root;
- root.containerOpen = true;
- do_check_true(root.childCount > 0);
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/unit/test_history_autocomplete_tags.js b/toolkit/components/places/tests/unit/test_history_autocomplete_tags.js
deleted file mode 100644
index a5e0e1cb1..000000000
--- a/toolkit/components/places/tests/unit/test_history_autocomplete_tags.js
+++ /dev/null
@@ -1,185 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var current_test = 0;
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
-
- searches: null,
-
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "",
- disableAutoComplete: false,
- completeDefaultIndex: false,
-
- get searchCount() {
- return this.searches.length;
- },
-
- getSearchAt: function(aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchBegin: function() {},
- onSearchComplete: function() {},
-
- popupOpen: false,
-
- popup: {
- setSelectedIndex: function(aIndex) {},
- invalidate: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompletePopup))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- },
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteInput))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-// Get tagging service
-try {
- var tagssvc = Cc["@mozilla.org/browser/tagging-service;1"].
- getService(Ci.nsITaggingService);
-} catch (ex) {
- do_throw("Could not get tagging service\n");
-}
-
-function ensure_tag_results(uris, searchTerm)
-{
- print("Searching for '" + searchTerm + "'");
- var controller = Components.classes["@mozilla.org/autocomplete/controller;1"].
- getService(Components.interfaces.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches
- // and confirms results on search complete
- var input = new AutoCompleteInput(["unifiedcomplete"]);
-
- controller.input = input;
-
- // Search is asynchronous, so don't let the test finish immediately
- do_test_pending();
-
- var numSearchesStarted = 0;
- input.onSearchBegin = function() {
- numSearchesStarted++;
- do_check_eq(numSearchesStarted, 1);
- };
-
- input.onSearchComplete = function() {
- do_check_eq(numSearchesStarted, 1);
- do_check_eq(controller.searchStatus,
- uris.length ?
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH :
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH);
- do_check_eq(controller.matchCount, uris.length);
- let vals = [];
- for (let i=0; i<controller.matchCount; i++) {
- // Keep the URL for later because order of tag results is undefined
- vals.push(controller.getValueAt(i));
- do_check_eq(controller.getStyleAt(i), "bookmark-tag");
- }
- // Sort the results then check if we have the right items
- vals.sort().forEach((val, i) => do_check_eq(val, uris[i].spec))
-
- if (current_test < (tests.length - 1)) {
- current_test++;
- tests[current_test]();
- }
-
- do_test_finished();
- };
-
- controller.startSearch(searchTerm);
-}
-
-var uri1 = uri("http://site.tld/1/aaa");
-var uri2 = uri("http://site.tld/2/bbb");
-var uri3 = uri("http://site.tld/3/aaa");
-var uri4 = uri("http://site.tld/4/bbb");
-var uri5 = uri("http://site.tld/5/aaa");
-var uri6 = uri("http://site.tld/6/bbb");
-
-var tests = [
- () => ensure_tag_results([uri1, uri4, uri6], "foo"),
- () => ensure_tag_results([uri1], "foo aaa"),
- () => ensure_tag_results([uri4, uri6], "foo bbb"),
- () => ensure_tag_results([uri2, uri4, uri5, uri6], "bar"),
- () => ensure_tag_results([uri5], "bar aaa"),
- () => ensure_tag_results([uri2, uri4, uri6], "bar bbb"),
- () => ensure_tag_results([uri3, uri5, uri6], "cheese"),
- () => ensure_tag_results([uri3, uri5], "chees aaa"),
- () => ensure_tag_results([uri6], "chees bbb"),
- () => ensure_tag_results([uri4, uri6], "fo bar"),
- () => ensure_tag_results([], "fo bar aaa"),
- () => ensure_tag_results([uri4, uri6], "fo bar bbb"),
- () => ensure_tag_results([uri4, uri6], "ba foo"),
- () => ensure_tag_results([], "ba foo aaa"),
- () => ensure_tag_results([uri4, uri6], "ba foo bbb"),
- () => ensure_tag_results([uri5, uri6], "ba chee"),
- () => ensure_tag_results([uri5], "ba chee aaa"),
- () => ensure_tag_results([uri6], "ba chee bbb"),
- () => ensure_tag_results([uri5, uri6], "cheese bar"),
- () => ensure_tag_results([uri5], "cheese bar aaa"),
- () => ensure_tag_results([uri6], "chees bar bbb"),
- () => ensure_tag_results([uri6], "cheese bar foo"),
- () => ensure_tag_results([], "foo bar cheese aaa"),
- () => ensure_tag_results([uri6], "foo bar cheese bbb"),
-];
-
-/**
- * Properly tags a uri adding it to bookmarks.
- *
- * @param aURI
- * The nsIURI to tag.
- * @param aTags
- * The tags to add.
- */
-function tagURI(aURI, aTags) {
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- aURI,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "A title");
- tagssvc.tagURI(aURI, aTags);
-}
-
-/**
- * Test history autocomplete
- */
-function run_test() {
- // always search in history + bookmarks, no matter what the default is
- var prefs = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
- prefs.setIntPref("browser.urlbar.search.sources", 3);
- prefs.setIntPref("browser.urlbar.default.behavior", 0);
-
- tagURI(uri1, ["foo"]);
- tagURI(uri2, ["bar"]);
- tagURI(uri3, ["cheese"]);
- tagURI(uri4, ["foo bar"]);
- tagURI(uri5, ["bar cheese"]);
- tagURI(uri6, ["foo bar cheese"]);
-
- tests[0]();
-}
diff --git a/toolkit/components/places/tests/unit/test_history_catobs.js b/toolkit/components/places/tests/unit/test_history_catobs.js
deleted file mode 100644
index e0a81d67b..000000000
--- a/toolkit/components/places/tests/unit/test_history_catobs.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* () {
- do_load_manifest("nsDummyObserver.manifest");
-
- let dummyCreated = false;
- let dummyReceivedOnVisit = false;
-
- Services.obs.addObserver(function created() {
- Services.obs.removeObserver(created, "dummy-observer-created");
- dummyCreated = true;
- }, "dummy-observer-created", false);
- Services.obs.addObserver(function visited() {
- Services.obs.removeObserver(visited, "dummy-observer-visited");
- dummyReceivedOnVisit = true;
- }, "dummy-observer-visited", false);
-
- let initialObservers = PlacesUtils.history.getObservers();
-
- // Add a common observer, it should be invoked after the category observer.
- let notificationsPromised = new Promise((resolve, reject) => {
- PlacesUtils.history.addObserver({
- __proto__: NavHistoryObserver.prototype,
- onVisit() {
- let observers = PlacesUtils.history.getObservers();
- Assert.equal(observers.length, initialObservers.length + 1);
-
- // Check the common observer is the last one.
- for (let i = 0; i < initialObservers.length; ++i) {
- Assert.equal(initialObservers[i], observers[i]);
- }
-
- PlacesUtils.history.removeObserver(this);
- observers = PlacesUtils.history.getObservers();
- Assert.equal(observers.length, initialObservers.length);
-
- // Check the category observer has been invoked before this one.
- Assert.ok(dummyCreated);
- Assert.ok(dummyReceivedOnVisit);
- resolve();
- }
- }, false);
- });
-
- // Add a visit.
- yield PlacesTestUtils.addVisits(uri("http://typed.mozilla.org"));
-
- yield notificationsPromised;
-});
diff --git a/toolkit/components/places/tests/unit/test_history_clear.js b/toolkit/components/places/tests/unit/test_history_clear.js
deleted file mode 100644
index 56d34994f..000000000
--- a/toolkit/components/places/tests/unit/test_history_clear.js
+++ /dev/null
@@ -1,169 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var mDBConn = DBConn();
-
-function promiseOnClearHistoryObserved() {
- let deferred = Promise.defer();
-
- let historyObserver = {
- onBeginUpdateBatch: function() {},
- onEndUpdateBatch: function() {},
- onVisit: function() {},
- onTitleChanged: function() {},
- onDeleteURI: function(aURI) {},
- onPageChanged: function() {},
- onDeleteVisits: function() {},
-
- onClearHistory: function() {
- PlacesUtils.history.removeObserver(this, false);
- deferred.resolve();
- },
-
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsINavHistoryObserver,
- ])
- }
- PlacesUtils.history.addObserver(historyObserver, false);
- return deferred.promise;
-}
-
-// This global variable is a promise object, initialized in run_test and waited
-// upon in the first asynchronous test. It is resolved when the
-// "places-init-complete" notification is received. We cannot initialize it in
-// the asynchronous test, because then it's too late to register the observer.
-var promiseInit;
-
-function run_test() {
- // places-init-complete is notified after run_test, and it will
- // run a first frecency fix through async statements.
- // To avoid random failures we have to run after all of this.
- promiseInit = promiseTopicObserved(PlacesUtils.TOPIC_INIT_COMPLETE);
-
- run_next_test();
-}
-
-add_task(function* test_history_clear()
-{
- yield promiseInit;
-
- yield PlacesTestUtils.addVisits([
- { uri: uri("http://typed.mozilla.org/"),
- transition: TRANSITION_TYPED },
- { uri: uri("http://link.mozilla.org/"),
- transition: TRANSITION_LINK },
- { uri: uri("http://download.mozilla.org/"),
- transition: TRANSITION_DOWNLOAD },
- { uri: uri("http://redir_temp.mozilla.org/"),
- transition: TRANSITION_REDIRECT_TEMPORARY,
- referrer: "http://link.mozilla.org/"},
- { uri: uri("http://redir_perm.mozilla.org/"),
- transition: TRANSITION_REDIRECT_PERMANENT,
- referrer: "http://link.mozilla.org/"},
- ]);
-
- // add a place: bookmark
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- uri("place:folder=4"),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "shortcut");
-
- // Add an expire never annotation
- // Actually expire never annotations are removed as soon as a page is removed
- // from the database, so this should act as a normal visit.
- PlacesUtils.annotations.setPageAnnotation(uri("http://download.mozilla.org/"),
- "never", "never", 0,
- PlacesUtils.annotations.EXPIRE_NEVER);
-
- // Add a bookmark
- // Bookmarked page should have history cleared and frecency = -1
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- uri("http://typed.mozilla.org/"),
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark");
-
- yield PlacesTestUtils.addVisits([
- { uri: uri("http://typed.mozilla.org/"),
- transition: TRANSITION_BOOKMARK },
- { uri: uri("http://frecency.mozilla.org/"),
- transition: TRANSITION_LINK },
- ]);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- // Clear history and wait for the onClearHistory notification.
- let promiseWaitClearHistory = promiseOnClearHistoryObserved();
- PlacesUtils.history.clear();
- yield promiseWaitClearHistory;
-
- // check browserHistory returns no entries
- do_check_eq(0, PlacesUtils.history.hasHistoryEntries);
-
- yield promiseTopicObserved(PlacesUtils.TOPIC_EXPIRATION_FINISHED);
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- // Check that frecency for not cleared items (bookmarks) has been converted
- // to -1.
- stmt = mDBConn.createStatement(
- "SELECT h.id FROM moz_places h WHERE h.frecency > 0 ");
- do_check_false(stmt.executeStep());
- stmt.finalize();
-
- stmt = mDBConn.createStatement(
- `SELECT h.id FROM moz_places h WHERE h.frecency < 0
- AND EXISTS (SELECT id FROM moz_bookmarks WHERE fk = h.id) LIMIT 1`);
- do_check_true(stmt.executeStep());
- stmt.finalize();
-
- // Check that all visit_counts have been brought to 0
- stmt = mDBConn.createStatement(
- "SELECT id FROM moz_places WHERE visit_count <> 0 LIMIT 1");
- do_check_false(stmt.executeStep());
- stmt.finalize();
-
- // Check that history tables are empty
- stmt = mDBConn.createStatement(
- "SELECT * FROM (SELECT id FROM moz_historyvisits LIMIT 1)");
- do_check_false(stmt.executeStep());
- stmt.finalize();
-
- // Check that all moz_places entries except bookmarks and place: have been removed
- stmt = mDBConn.createStatement(
- `SELECT h.id FROM moz_places h WHERE
- url_hash NOT BETWEEN hash('place', 'prefix_lo') AND hash('place', 'prefix_hi')
- AND NOT EXISTS (SELECT id FROM moz_bookmarks WHERE fk = h.id) LIMIT 1`);
- do_check_false(stmt.executeStep());
- stmt.finalize();
-
- // Check that we only have favicons for retained places
- stmt = mDBConn.createStatement(
- `SELECT f.id FROM moz_favicons f WHERE NOT EXISTS
- (SELECT id FROM moz_places WHERE favicon_id = f.id) LIMIT 1`);
- do_check_false(stmt.executeStep());
- stmt.finalize();
-
- // Check that we only have annotations for retained places
- stmt = mDBConn.createStatement(
- `SELECT a.id FROM moz_annos a WHERE NOT EXISTS
- (SELECT id FROM moz_places WHERE id = a.place_id) LIMIT 1`);
- do_check_false(stmt.executeStep());
- stmt.finalize();
-
- // Check that we only have inputhistory for retained places
- stmt = mDBConn.createStatement(
- `SELECT i.place_id FROM moz_inputhistory i WHERE NOT EXISTS
- (SELECT id FROM moz_places WHERE id = i.place_id) LIMIT 1`);
- do_check_false(stmt.executeStep());
- stmt.finalize();
-
- // Check that place:uris have frecency 0
- stmt = mDBConn.createStatement(
- `SELECT h.id FROM moz_places h
- WHERE url_hash BETWEEN hash('place', 'prefix_lo')
- AND hash('place', 'prefix_hi')
- AND h.frecency <> 0 LIMIT 1`);
- do_check_false(stmt.executeStep());
- stmt.finalize();
-});
diff --git a/toolkit/components/places/tests/unit/test_history_notifications.js b/toolkit/components/places/tests/unit/test_history_notifications.js
deleted file mode 100644
index 4e1e635a0..000000000
--- a/toolkit/components/places/tests/unit/test_history_notifications.js
+++ /dev/null
@@ -1,38 +0,0 @@
-const NS_PLACES_INIT_COMPLETE_TOPIC = "places-init-complete";
-const NS_PLACES_DATABASE_LOCKED_TOPIC = "places-database-locked";
-
-add_task(function* () {
- // Create a dummy places.sqlite and open an unshared connection on it
- let db = Services.dirsvc.get('ProfD', Ci.nsIFile);
- db.append("places.sqlite");
- let dbConn = Services.storage.openUnsharedDatabase(db);
- Assert.ok(db.exists(), "The database should have been created");
-
- // We need an exclusive lock on the db
- dbConn.executeSimpleSQL("PRAGMA locking_mode = EXCLUSIVE");
- // Exclusive locking is lazy applied, we need to make a write to activate it
- dbConn.executeSimpleSQL("PRAGMA USER_VERSION = 1");
-
- // Try to create history service while the db is locked
- let promiseLocked = promiseTopicObserved(NS_PLACES_DATABASE_LOCKED_TOPIC);
- Assert.throws(() => Cc["@mozilla.org/browser/nav-history-service;1"]
- .getService(Ci.nsINavHistoryService),
- /NS_ERROR_XPC_GS_RETURNED_FAILURE/);
- yield promiseLocked;
-
- // Close our connection and try to cleanup the file (could fail on Windows)
- dbConn.close();
- if (db.exists()) {
- try {
- db.remove(false);
- } catch (e) {
- do_print("Unable to remove dummy places.sqlite");
- }
- }
-
- // Create history service correctly
- let promiseComplete = promiseTopicObserved(NS_PLACES_INIT_COMPLETE_TOPIC);
- Cc["@mozilla.org/browser/nav-history-service;1"]
- .getService(Ci.nsINavHistoryService);
- yield promiseComplete;
-});
diff --git a/toolkit/components/places/tests/unit/test_history_observer.js b/toolkit/components/places/tests/unit/test_history_observer.js
deleted file mode 100644
index c101cfb61..000000000
--- a/toolkit/components/places/tests/unit/test_history_observer.js
+++ /dev/null
@@ -1,215 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * Generic nsINavHistoryObserver that doesn't implement anything, but provides
- * dummy methods to prevent errors about an object not having a certain method.
- */
-function NavHistoryObserver() {
-}
-NavHistoryObserver.prototype = {
- onBeginUpdateBatch: function() { },
- onEndUpdateBatch: function() { },
- onVisit: function() { },
- onTitleChanged: function() { },
- onDeleteURI: function() { },
- onClearHistory: function() { },
- onPageChanged: function() { },
- onDeleteVisits: function() { },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsINavHistoryObserver])
-};
-
-/**
- * Registers a one-time history observer for and calls the callback
- * when the specified nsINavHistoryObserver method is called.
- * Returns a promise that is resolved when the callback returns.
- */
-function onNotify(callback) {
- return new Promise(resolve => {
- let obs = new NavHistoryObserver();
- obs[callback.name] = function () {
- PlacesUtils.history.removeObserver(this);
- callback.apply(this, arguments);
- resolve();
- };
- PlacesUtils.history.addObserver(obs, false);
- });
-}
-
-/**
- * Asynchronous task that adds a visit to the history database.
- */
-function* task_add_visit(uri, timestamp, transition) {
- uri = uri || NetUtil.newURI("http://firefox.com/");
- timestamp = timestamp || Date.now() * 1000;
- yield PlacesTestUtils.addVisits({
- uri: uri,
- transition: transition || TRANSITION_TYPED,
- visitDate: timestamp
- });
- return [uri, timestamp];
-}
-
-add_task(function* test_onVisit() {
- let promiseNotify = onNotify(function onVisit(aURI, aVisitID, aTime,
- aSessionID, aReferringID,
- aTransitionType, aGUID,
- aHidden, aVisitCount, aTyped) {
- Assert.ok(aURI.equals(testuri));
- Assert.ok(aVisitID > 0);
- Assert.equal(aTime, testtime);
- Assert.equal(aSessionID, 0);
- Assert.equal(aReferringID, 0);
- Assert.equal(aTransitionType, TRANSITION_TYPED);
- do_check_guid_for_uri(aURI, aGUID);
- Assert.ok(!aHidden);
- Assert.equal(aVisitCount, 1);
- Assert.equal(aTyped, 1);
- });
- let testuri = NetUtil.newURI("http://firefox.com/");
- let testtime = Date.now() * 1000;
- yield task_add_visit(testuri, testtime);
- yield promiseNotify;
-});
-
-add_task(function* test_onVisit() {
- let promiseNotify = onNotify(function onVisit(aURI, aVisitID, aTime,
- aSessionID, aReferringID,
- aTransitionType, aGUID,
- aHidden, aVisitCount, aTyped) {
- Assert.ok(aURI.equals(testuri));
- Assert.ok(aVisitID > 0);
- Assert.equal(aTime, testtime);
- Assert.equal(aSessionID, 0);
- Assert.equal(aReferringID, 0);
- Assert.equal(aTransitionType, TRANSITION_FRAMED_LINK);
- do_check_guid_for_uri(aURI, aGUID);
- Assert.ok(aHidden);
- Assert.equal(aVisitCount, 1);
- Assert.equal(aTyped, 0);
- });
- let testuri = NetUtil.newURI("http://hidden.firefox.com/");
- let testtime = Date.now() * 1000;
- yield task_add_visit(testuri, testtime, TRANSITION_FRAMED_LINK);
- yield promiseNotify;
-});
-
-add_task(function* test_multiple_onVisit() {
- let testuri = NetUtil.newURI("http://self.firefox.com/");
- let promiseNotifications = new Promise(resolve => {
- let observer = {
- _c: 0,
- __proto__: NavHistoryObserver.prototype,
- onVisit(uri, id, time, unused, referrerId, transition, guid,
- hidden, visitCount, typed) {
- Assert.ok(testuri.equals(uri));
- Assert.ok(id > 0);
- Assert.ok(time > 0);
- Assert.ok(!hidden);
- do_check_guid_for_uri(uri, guid);
- switch (++this._c) {
- case 1:
- Assert.equal(referrerId, 0);
- Assert.equal(transition, TRANSITION_LINK);
- Assert.equal(visitCount, 1);
- Assert.equal(typed, 0);
- break;
- case 2:
- Assert.ok(referrerId > 0);
- Assert.equal(transition, TRANSITION_LINK);
- Assert.equal(visitCount, 2);
- Assert.equal(typed, 0);
- break;
- case 3:
- Assert.equal(referrerId, 0);
- Assert.equal(transition, TRANSITION_TYPED);
- Assert.equal(visitCount, 3);
- Assert.equal(typed, 1);
-
- PlacesUtils.history.removeObserver(observer, false);
- resolve();
- break;
- }
- }
- };
- PlacesUtils.history.addObserver(observer, false);
- });
- yield PlacesTestUtils.addVisits([
- { uri: testuri, transition: TRANSITION_LINK },
- { uri: testuri, referrer: testuri, transition: TRANSITION_LINK },
- { uri: testuri, transition: TRANSITION_TYPED },
- ]);
- yield promiseNotifications;
-});
-
-add_task(function* test_onDeleteURI() {
- let promiseNotify = onNotify(function onDeleteURI(aURI, aGUID, aReason) {
- Assert.ok(aURI.equals(testuri));
- // Can't use do_check_guid_for_uri() here because the visit is already gone.
- Assert.equal(aGUID, testguid);
- Assert.equal(aReason, Ci.nsINavHistoryObserver.REASON_DELETED);
- });
- let [testuri] = yield task_add_visit();
- let testguid = do_get_guid_for_uri(testuri);
- PlacesUtils.bhistory.removePage(testuri);
- yield promiseNotify;
-});
-
-add_task(function* test_onDeleteVisits() {
- let promiseNotify = onNotify(function onDeleteVisits(aURI, aVisitTime, aGUID,
- aReason) {
- Assert.ok(aURI.equals(testuri));
- // Can't use do_check_guid_for_uri() here because the visit is already gone.
- Assert.equal(aGUID, testguid);
- Assert.equal(aReason, Ci.nsINavHistoryObserver.REASON_DELETED);
- Assert.equal(aVisitTime, 0); // All visits have been removed.
- });
- let msecs24hrsAgo = Date.now() - (86400 * 1000);
- let [testuri] = yield task_add_visit(undefined, msecs24hrsAgo * 1000);
- // Add a bookmark so the page is not removed.
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- testuri,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "test");
- let testguid = do_get_guid_for_uri(testuri);
- PlacesUtils.bhistory.removePage(testuri);
- yield promiseNotify;
-});
-
-add_task(function* test_onTitleChanged() {
- let promiseNotify = onNotify(function onTitleChanged(aURI, aTitle, aGUID) {
- Assert.ok(aURI.equals(testuri));
- Assert.equal(aTitle, title);
- do_check_guid_for_uri(aURI, aGUID);
- });
-
- let [testuri] = yield task_add_visit();
- let title = "test-title";
- yield PlacesTestUtils.addVisits({
- uri: testuri,
- title: title
- });
- yield promiseNotify;
-});
-
-add_task(function* test_onPageChanged() {
- let promiseNotify = onNotify(function onPageChanged(aURI, aChangedAttribute,
- aNewValue, aGUID) {
- Assert.equal(aChangedAttribute, Ci.nsINavHistoryObserver.ATTRIBUTE_FAVICON);
- Assert.ok(aURI.equals(testuri));
- Assert.equal(aNewValue, SMALLPNG_DATA_URI.spec);
- do_check_guid_for_uri(aURI, aGUID);
- });
-
- let [testuri] = yield task_add_visit();
-
- // The new favicon for the page must have data associated with it in order to
- // receive the onPageChanged notification. To keep this test self-contained,
- // we use an URI representing the smallest possible PNG file.
- PlacesUtils.favicons.setAndFetchFaviconForPage(testuri, SMALLPNG_DATA_URI,
- false,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- null,
- Services.scriptSecurityManager.getSystemPrincipal());
- yield promiseNotify;
-});
diff --git a/toolkit/components/places/tests/unit/test_history_sidebar.js b/toolkit/components/places/tests/unit/test_history_sidebar.js
deleted file mode 100644
index 1c03547d7..000000000
--- a/toolkit/components/places/tests/unit/test_history_sidebar.js
+++ /dev/null
@@ -1,447 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Get history service
-var hs = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-var bh = hs.QueryInterface(Ci.nsIBrowserHistory);
-var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-var ps = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
-
-/**
- * Adds a test URI visit to the database.
- *
- * @param aURI
- * The URI to add a visit for.
- * @param aTime
- * Reference "now" time.
- * @param aDayOffset
- * number of days to add, pass a negative value to subtract them.
- */
-function* task_add_normalized_visit(aURI, aTime, aDayOffset) {
- var dateObj = new Date(aTime);
- // Normalize to midnight
- dateObj.setHours(0);
- dateObj.setMinutes(0);
- dateObj.setSeconds(0);
- dateObj.setMilliseconds(0);
- // Days where DST changes should be taken in count.
- var previousDateObj = new Date(dateObj.getTime() + aDayOffset * 86400000);
- var DSTCorrection = (dateObj.getTimezoneOffset() -
- previousDateObj.getTimezoneOffset()) * 60 * 1000;
- // Substract aDayOffset
- var PRTimeWithOffset = (previousDateObj.getTime() - DSTCorrection) * 1000;
- var timeInMs = new Date(PRTimeWithOffset/1000);
- print("Adding visit to " + aURI.spec + " at " + timeInMs);
- yield PlacesTestUtils.addVisits({
- uri: aURI,
- visitDate: PRTimeWithOffset
- });
-}
-
-function days_for_x_months_ago(aNowObj, aMonths) {
- var oldTime = new Date();
- // Set day before month, otherwise we could try to calculate 30 February, or
- // other nonexistent days.
- oldTime.setDate(1);
- oldTime.setMonth(aNowObj.getMonth() - aMonths);
- oldTime.setHours(0);
- oldTime.setMinutes(0);
- oldTime.setSeconds(0);
- // Stay larger for eventual timezone issues, add 2 days.
- return parseInt((aNowObj - oldTime) / (1000*60*60*24)) + 2;
-}
-
-var nowObj = new Date();
-// This test relies on en-US locale
-// Offset is number of days
-/* eslint-disable comma-spacing */
-var containers = [
- { label: "Today" , offset: 0 , visible: true },
- { label: "Yesterday" , offset: -1 , visible: true },
- { label: "Last 7 days" , offset: -3 , visible: true },
- { label: "This month" , offset: -8 , visible: nowObj.getDate() > 8 },
- { label: "" , offset: -days_for_x_months_ago(nowObj, 0) , visible: true },
- { label: "" , offset: -days_for_x_months_ago(nowObj, 1) , visible: true },
- { label: "" , offset: -days_for_x_months_ago(nowObj, 2) , visible: true },
- { label: "" , offset: -days_for_x_months_ago(nowObj, 3) , visible: true },
- { label: "" , offset: -days_for_x_months_ago(nowObj, 4) , visible: true },
- { label: "Older than 6 months" , offset: -days_for_x_months_ago(nowObj, 5) , visible: true },
-];
-/* eslint-enable comma-spacing */
-
-var visibleContainers = containers.filter(
- function(aContainer) { return aContainer.visible });
-
-/**
- * Asynchronous task that fills history and checks containers' labels.
- */
-function* task_fill_history() {
- print("\n\n*** TEST Fill History\n");
- // We can't use "now" because our hardcoded offsets would be invalid for some
- // date. So we hardcode a date.
- for (let i = 0; i < containers.length; i++) {
- let container = containers[i];
- var testURI = uri("http://mirror"+i+".mozilla.com/b");
- yield task_add_normalized_visit(testURI, nowObj.getTime(), container.offset);
- testURI = uri("http://mirror"+i+".mozilla.com/a");
- yield task_add_normalized_visit(testURI, nowObj.getTime(), container.offset);
- testURI = uri("http://mirror"+i+".google.com/b");
- yield task_add_normalized_visit(testURI, nowObj.getTime(), container.offset);
- testURI = uri("http://mirror"+i+".google.com/a");
- yield task_add_normalized_visit(testURI, nowObj.getTime(), container.offset);
- // Bug 485703 - Hide date containers not containing additional entries
- // compared to previous ones.
- // Check after every new container is added.
- check_visit(container.offset);
- }
-
- var options = hs.getNewQueryOptions();
- options.resultType = options.RESULTS_AS_DATE_SITE_QUERY;
- var query = hs.getNewQuery();
-
- var result = hs.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
-
- var cc = root.childCount;
- print("Found containers:");
- var previousLabels = [];
- for (let i = 0; i < cc; i++) {
- let container = visibleContainers[i];
- var node = root.getChild(i);
- print(node.title);
- if (container.label)
- do_check_eq(node.title, container.label);
- // Check labels are not repeated.
- do_check_eq(previousLabels.indexOf(node.title), -1);
- previousLabels.push(node.title);
- }
- do_check_eq(cc, visibleContainers.length);
- root.containerOpen = false;
-}
-
-/**
- * Bug 485703 - Hide date containers not containing additional entries compared
- * to previous ones.
- */
-function check_visit(aOffset) {
- var options = hs.getNewQueryOptions();
- options.resultType = options.RESULTS_AS_DATE_SITE_QUERY;
- var query = hs.getNewQuery();
- var result = hs.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- var cc = root.childCount;
-
- var unexpected = [];
- switch (aOffset) {
- case 0:
- unexpected = ["Yesterday", "Last 7 days", "This month"];
- break;
- case -1:
- unexpected = ["Last 7 days", "This month"];
- break;
- case -3:
- unexpected = ["This month"];
- break;
- default:
- // Other containers are tested later.
- }
-
- print("Found containers:");
- for (var i = 0; i < cc; i++) {
- var node = root.getChild(i);
- print(node.title);
- do_check_eq(unexpected.indexOf(node.title), -1);
- }
-
- root.containerOpen = false;
-}
-
-/**
- * Queries history grouped by date and site, checking containers' labels and
- * children.
- */
-function test_RESULTS_AS_DATE_SITE_QUERY() {
- print("\n\n*** TEST RESULTS_AS_DATE_SITE_QUERY\n");
- var options = hs.getNewQueryOptions();
- options.resultType = options.RESULTS_AS_DATE_SITE_QUERY;
- var query = hs.getNewQuery();
- var result = hs.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
-
- // Check one of the days
- var dayNode = root.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- dayNode.containerOpen = true;
- do_check_eq(dayNode.childCount, 2);
-
- // Items should be sorted by host
- var site1 = dayNode.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- do_check_eq(site1.title, "mirror0.google.com");
-
- var site2 = dayNode.getChild(1)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- do_check_eq(site2.title, "mirror0.mozilla.com");
-
- site1.containerOpen = true;
- do_check_eq(site1.childCount, 2);
-
- // Inside of host sites are sorted by title
- var site1visit = site1.getChild(0);
- do_check_eq(site1visit.uri, "http://mirror0.google.com/a");
-
- // Bug 473157: changing sorting mode should not affect the containers
- result.sortingMode = options.SORT_BY_TITLE_DESCENDING;
-
- // Check one of the days
- dayNode = root.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- dayNode.containerOpen = true;
- do_check_eq(dayNode.childCount, 2);
-
- // Hosts are still sorted by title
- site1 = dayNode.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- do_check_eq(site1.title, "mirror0.google.com");
-
- site2 = dayNode.getChild(1)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- do_check_eq(site2.title, "mirror0.mozilla.com");
-
- site1.containerOpen = true;
- do_check_eq(site1.childCount, 2);
-
- // But URLs are now sorted by title descending
- site1visit = site1.getChild(0);
- do_check_eq(site1visit.uri, "http://mirror0.google.com/b");
-
- site1.containerOpen = false;
- dayNode.containerOpen = false;
- root.containerOpen = false;
-}
-
-/**
- * Queries history grouped by date, checking containers' labels and children.
- */
-function test_RESULTS_AS_DATE_QUERY() {
- print("\n\n*** TEST RESULTS_AS_DATE_QUERY\n");
- var options = hs.getNewQueryOptions();
- options.resultType = options.RESULTS_AS_DATE_QUERY;
- var query = hs.getNewQuery();
- var result = hs.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
-
- var cc = root.childCount;
- do_check_eq(cc, visibleContainers.length);
- print("Found containers:");
- for (var i = 0; i < cc; i++) {
- var container = visibleContainers[i];
- var node = root.getChild(i);
- print(node.title);
- if (container.label)
- do_check_eq(node.title, container.label);
- }
-
- // Check one of the days
- var dayNode = root.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- dayNode.containerOpen = true;
- do_check_eq(dayNode.childCount, 4);
-
- // Items should be sorted by title
- var visit1 = dayNode.getChild(0);
- do_check_eq(visit1.uri, "http://mirror0.google.com/a");
-
- var visit2 = dayNode.getChild(3);
- do_check_eq(visit2.uri, "http://mirror0.mozilla.com/b");
-
- // Bug 473157: changing sorting mode should not affect the containers
- result.sortingMode = options.SORT_BY_TITLE_DESCENDING;
-
- // Check one of the days
- dayNode = root.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- dayNode.containerOpen = true;
- do_check_eq(dayNode.childCount, 4);
-
- // But URLs are now sorted by title descending
- visit1 = dayNode.getChild(0);
- do_check_eq(visit1.uri, "http://mirror0.mozilla.com/b");
-
- visit2 = dayNode.getChild(3);
- do_check_eq(visit2.uri, "http://mirror0.google.com/a");
-
- dayNode.containerOpen = false;
- root.containerOpen = false;
-}
-
-/**
- * Queries history grouped by site, checking containers' labels and children.
- */
-function test_RESULTS_AS_SITE_QUERY() {
- print("\n\n*** TEST RESULTS_AS_SITE_QUERY\n");
- // add a bookmark with a domain not in the set of visits in the db
- var itemId = bs.insertBookmark(bs.toolbarFolder, uri("http://foobar"),
- bs.DEFAULT_INDEX, "");
-
- var options = hs.getNewQueryOptions();
- options.resultType = options.RESULTS_AS_SITE_QUERY;
- options.sortingMode = options.SORT_BY_TITLE_ASCENDING;
- var query = hs.getNewQuery();
- var result = hs.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, containers.length * 2);
-
-/* Expected results:
- "mirror0.google.com",
- "mirror0.mozilla.com",
- "mirror1.google.com",
- "mirror1.mozilla.com",
- "mirror2.google.com",
- "mirror2.mozilla.com",
- "mirror3.google.com", <== We check for this site (index 6)
- "mirror3.mozilla.com",
- "mirror4.google.com",
- "mirror4.mozilla.com",
- "mirror5.google.com",
- "mirror5.mozilla.com",
- ...
-*/
-
- // Items should be sorted by host
- var siteNode = root.getChild(6)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- do_check_eq(siteNode.title, "mirror3.google.com");
-
- siteNode.containerOpen = true;
- do_check_eq(siteNode.childCount, 2);
-
- // Inside of host sites are sorted by title
- var visitNode = siteNode.getChild(0);
- do_check_eq(visitNode.uri, "http://mirror3.google.com/a");
-
- // Bug 473157: changing sorting mode should not affect the containers
- result.sortingMode = options.SORT_BY_TITLE_DESCENDING;
- siteNode = root.getChild(6)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- do_check_eq(siteNode.title, "mirror3.google.com");
-
- siteNode.containerOpen = true;
- do_check_eq(siteNode.childCount, 2);
-
- // But URLs are now sorted by title descending
- var visit = siteNode.getChild(0);
- do_check_eq(visit.uri, "http://mirror3.google.com/b");
-
- siteNode.containerOpen = false;
- root.containerOpen = false;
-
- // Cleanup.
- bs.removeItem(itemId);
-}
-
-/**
- * Checks that queries grouped by date do liveupdate correctly.
- */
-function* task_test_date_liveupdate(aResultType) {
- var midnight = nowObj;
- midnight.setHours(0);
- midnight.setMinutes(0);
- midnight.setSeconds(0);
- midnight.setMilliseconds(0);
-
- // TEST 1. Test that the query correctly updates when it is root.
- var options = hs.getNewQueryOptions();
- options.resultType = aResultType;
- var query = hs.getNewQuery();
- var result = hs.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
-
- do_check_eq(root.childCount, visibleContainers.length);
- // Remove "Today".
- hs.removePagesByTimeframe(midnight.getTime() * 1000, Date.now() * 1000);
- do_check_eq(root.childCount, visibleContainers.length - 1);
-
- // Open "Last 7 days" container, this way we will have a container accepting
- // the new visit, but we should still add back "Today" container.
- var last7Days = root.getChild(1)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- last7Days.containerOpen = true;
-
- // Add a visit for "Today". This should add back the missing "Today"
- // container.
- yield task_add_normalized_visit(uri("http://www.mozilla.org/"), nowObj.getTime(), 0);
- do_check_eq(root.childCount, visibleContainers.length);
-
- last7Days.containerOpen = false;
- root.containerOpen = false;
-
- // TEST 2. Test that the query correctly updates even if it is not root.
- var itemId = bs.insertBookmark(bs.toolbarFolder,
- uri("place:type=" + aResultType),
- bs.DEFAULT_INDEX, "");
-
- // Query toolbar and open our query container, then check again liveupdate.
- options = hs.getNewQueryOptions();
- query = hs.getNewQuery();
- query.setFolders([bs.toolbarFolder], 1);
- result = hs.executeQuery(query, options);
- root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 1);
- var dateContainer = root.getChild(0).QueryInterface(Ci.nsINavHistoryContainerResultNode);
- dateContainer.containerOpen = true;
-
- do_check_eq(dateContainer.childCount, visibleContainers.length);
- // Remove "Today".
- hs.removePagesByTimeframe(midnight.getTime() * 1000, Date.now() * 1000);
- do_check_eq(dateContainer.childCount, visibleContainers.length - 1);
- // Add a visit for "Today".
- yield task_add_normalized_visit(uri("http://www.mozilla.org/"), nowObj.getTime(), 0);
- do_check_eq(dateContainer.childCount, visibleContainers.length);
-
- dateContainer.containerOpen = false;
- root.containerOpen = false;
-
- // Cleanup.
- bs.removeItem(itemId);
-}
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_history_sidebar()
-{
- // If we're dangerously close to a date change, just bail out.
- if (nowObj.getHours() == 23 && nowObj.getMinutes() >= 50) {
- return;
- }
-
- yield task_fill_history();
- test_RESULTS_AS_DATE_SITE_QUERY();
- test_RESULTS_AS_DATE_QUERY();
- test_RESULTS_AS_SITE_QUERY();
-
- yield task_test_date_liveupdate(Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_SITE_QUERY);
- yield task_test_date_liveupdate(Ci.nsINavHistoryQueryOptions.RESULTS_AS_DATE_QUERY);
-
- // The remaining views are
- // RESULTS_AS_URI + SORT_BY_VISITCOUNT_DESCENDING
- // -> test_399266.js
- // RESULTS_AS_URI + SORT_BY_DATE_DESCENDING
- // -> test_385397.js
-});
diff --git a/toolkit/components/places/tests/unit/test_hosts_triggers.js b/toolkit/components/places/tests/unit/test_hosts_triggers.js
deleted file mode 100644
index 9c3359e76..000000000
--- a/toolkit/components/places/tests/unit/test_hosts_triggers.js
+++ /dev/null
@@ -1,226 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests the validity of various triggers that add remove hosts from moz_hosts
- */
-
-XPCOMUtils.defineLazyServiceGetter(this, "gHistory",
- "@mozilla.org/browser/history;1",
- "mozIAsyncHistory");
-
-// add some visits and remove them, add a bookmark,
-// change its uri, then remove it, and
-// for each change check that moz_hosts has correctly been updated.
-
-function isHostInMozPlaces(aURI)
-{
- let stmt = DBConn().createStatement(
- `SELECT url
- FROM moz_places
- WHERE url_hash = hash(:host) AND url = :host`
- );
- let result = false;
- stmt.params.host = aURI.spec;
- while (stmt.executeStep()) {
- if (stmt.row.url == aURI.spec) {
- result = true;
- break;
- }
- }
- stmt.finalize();
- return result;
-}
-
-function isHostInMozHosts(aURI, aTyped, aPrefix)
-{
- let stmt = DBConn().createStatement(
- `SELECT host, typed, prefix
- FROM moz_hosts
- WHERE host = fixup_url(:host)
- AND frecency NOTNULL`
- );
- let result = false;
- stmt.params.host = aURI.host;
- if (stmt.executeStep()) {
- result = aTyped == stmt.row.typed && aPrefix == stmt.row.prefix;
- }
- stmt.finalize();
- return result;
-}
-
-var urls = [{uri: NetUtil.newURI("http://visit1.mozilla.org"),
- expected: "visit1.mozilla.org",
- typed: 0,
- prefix: null
- },
- {uri: NetUtil.newURI("http://visit2.mozilla.org"),
- expected: "visit2.mozilla.org",
- typed: 0,
- prefix: null
- },
- {uri: NetUtil.newURI("http://www.foo.mozilla.org"),
- expected: "foo.mozilla.org",
- typed: 1,
- prefix: "www."
- },
- ];
-
-const NEW_URL = "http://different.mozilla.org/";
-
-add_task(function* test_moz_hosts_update()
-{
- let places = [];
- urls.forEach(function(url) {
- let place = { uri: url.uri,
- title: "test for " + url.url,
- transition: url.typed ? TRANSITION_TYPED : undefined };
- places.push(place);
- });
-
- yield PlacesTestUtils.addVisits(places);
-
- do_check_true(isHostInMozHosts(urls[0].uri, urls[0].typed, urls[0].prefix));
- do_check_true(isHostInMozHosts(urls[1].uri, urls[1].typed, urls[1].prefix));
- do_check_true(isHostInMozHosts(urls[2].uri, urls[2].typed, urls[2].prefix));
-});
-
-add_task(function* test_remove_places()
-{
- for (let idx in urls) {
- PlacesUtils.history.removePage(urls[idx].uri);
- }
-
- yield PlacesTestUtils.clearHistory();
-
- for (let idx in urls) {
- do_check_false(isHostInMozHosts(urls[idx].uri, urls[idx].typed, urls[idx].prefix));
- }
-});
-
-add_task(function* test_bookmark_changes()
-{
- let testUri = NetUtil.newURI("http://test.mozilla.org");
-
- let itemId = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- testUri,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "bookmark title");
-
- do_check_true(isHostInMozPlaces(testUri));
-
- // Change the hostname
- PlacesUtils.bookmarks.changeBookmarkURI(itemId, NetUtil.newURI(NEW_URL));
-
- yield PlacesTestUtils.clearHistory();
-
- let newUri = NetUtil.newURI(NEW_URL);
- do_check_true(isHostInMozPlaces(newUri));
- do_check_true(isHostInMozHosts(newUri, false, null));
- do_check_false(isHostInMozHosts(NetUtil.newURI("http://test.mozilla.org"), false, null));
-});
-
-add_task(function* test_bookmark_removal()
-{
- let itemId = PlacesUtils.bookmarks.getIdForItemAt(PlacesUtils.unfiledBookmarksFolderId,
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- let newUri = NetUtil.newURI(NEW_URL);
- PlacesUtils.bookmarks.removeItem(itemId);
- yield PlacesTestUtils.clearHistory();
-
- do_check_false(isHostInMozHosts(newUri, false, null));
-});
-
-add_task(function* test_moz_hosts_typed_update()
-{
- const TEST_URI = NetUtil.newURI("http://typed.mozilla.com");
- let places = [{ uri: TEST_URI
- , title: "test for " + TEST_URI.spec
- },
- { uri: TEST_URI
- , title: "test for " + TEST_URI.spec
- , transition: TRANSITION_TYPED
- }];
-
- yield PlacesTestUtils.addVisits(places);
-
- do_check_true(isHostInMozHosts(TEST_URI, true, null));
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_moz_hosts_www_remove()
-{
- function* test_removal(aURIToRemove, aURIToKeep, aCallback) {
- let places = [{ uri: aURIToRemove
- , title: "test for " + aURIToRemove.spec
- , transition: TRANSITION_TYPED
- },
- { uri: aURIToKeep
- , title: "test for " + aURIToKeep.spec
- , transition: TRANSITION_TYPED
- }];
-
- yield PlacesTestUtils.addVisits(places);
- print("removing " + aURIToRemove.spec + " keeping " + aURIToKeep);
- dump_table("moz_hosts");
- dump_table("moz_places");
- PlacesUtils.history.removePage(aURIToRemove);
- let prefix = /www/.test(aURIToKeep.spec) ? "www." : null;
- dump_table("moz_hosts");
- dump_table("moz_places");
- do_check_true(isHostInMozHosts(aURIToKeep, true, prefix));
- }
-
- const TEST_URI = NetUtil.newURI("http://rem.mozilla.com");
- const TEST_WWW_URI = NetUtil.newURI("http://www.rem.mozilla.com");
- yield test_removal(TEST_URI, TEST_WWW_URI);
- yield test_removal(TEST_WWW_URI, TEST_URI);
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_moz_hosts_ftp_matchall()
-{
- const TEST_URI_1 = NetUtil.newURI("ftp://www.mozilla.com/");
- const TEST_URI_2 = NetUtil.newURI("ftp://mozilla.com/");
-
- yield PlacesTestUtils.addVisits([
- { uri: TEST_URI_1, transition: TRANSITION_TYPED },
- { uri: TEST_URI_2, transition: TRANSITION_TYPED }
- ]);
-
- do_check_true(isHostInMozHosts(TEST_URI_1, true, "ftp://"));
-});
-
-add_task(function* test_moz_hosts_ftp_not_matchall()
-{
- const TEST_URI_1 = NetUtil.newURI("http://mozilla.com/");
- const TEST_URI_2 = NetUtil.newURI("ftp://mozilla.com/");
-
- yield PlacesTestUtils.addVisits([
- { uri: TEST_URI_1, transition: TRANSITION_TYPED },
- { uri: TEST_URI_2, transition: TRANSITION_TYPED }
- ]);
-
- do_check_true(isHostInMozHosts(TEST_URI_1, true, null));
-});
-
-add_task(function* test_moz_hosts_update_2()
-{
- // Check that updating trigger takes into account prefixes for different
- // rev_hosts.
- const TEST_URI_1 = NetUtil.newURI("https://www.google.it/");
- const TEST_URI_2 = NetUtil.newURI("https://google.it/");
- let places = [{ uri: TEST_URI_1
- , transition: TRANSITION_TYPED
- },
- { uri: TEST_URI_2
- }];
- yield PlacesTestUtils.addVisits(places);
-
- do_check_true(isHostInMozHosts(TEST_URI_1, true, "https://www."));
-});
-
-function run_test()
-{
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/unit/test_import_mobile_bookmarks.js b/toolkit/components/places/tests/unit/test_import_mobile_bookmarks.js
deleted file mode 100644
index 771a6ac17..000000000
--- a/toolkit/components/places/tests/unit/test_import_mobile_bookmarks.js
+++ /dev/null
@@ -1,292 +0,0 @@
-function* importFromFixture(fixture, replace) {
- let cwd = yield OS.File.getCurrentDirectory();
- let path = OS.Path.join(cwd, fixture);
-
- do_print(`Importing from ${path}`);
- yield BookmarkJSONUtils.importFromFile(path, replace);
- yield PlacesTestUtils.promiseAsyncUpdates();
-}
-
-function* treeEquals(guid, expected, message) {
- let root = yield PlacesUtils.promiseBookmarksTree(guid);
- let bookmarks = (function nodeToEntry(node) {
- let entry = { guid: node.guid, index: node.index }
- if (node.children) {
- entry.children = node.children.map(nodeToEntry);
- }
- if (node.annos) {
- entry.annos = node.annos;
- }
- return entry;
- }(root));
-
- do_print(`Checking if ${guid} tree matches ${JSON.stringify(expected)}`);
- do_print(`Got bookmarks tree for ${guid}: ${JSON.stringify(bookmarks)}`);
-
- deepEqual(bookmarks, expected, message);
-}
-
-add_task(function* test_restore_mobile_bookmarks_root() {
- yield* importFromFixture("mobile_bookmarks_root_import.json",
- /* replace */ true);
-
- yield* treeEquals(PlacesUtils.bookmarks.rootGuid, {
- guid: PlacesUtils.bookmarks.rootGuid,
- index: 0,
- children: [{
- guid: PlacesUtils.bookmarks.menuGuid,
- index: 0,
- children: [
- { guid: "X6lUyOspVYwi", index: 0 },
- ],
- }, {
- guid: PlacesUtils.bookmarks.toolbarGuid,
- index: 1,
- }, {
- guid: PlacesUtils.bookmarks.unfiledGuid,
- index: 3,
- }, {
- guid: PlacesUtils.bookmarks.mobileGuid,
- index: 4,
- annos: [{
- name: "mobile/bookmarksRoot",
- flags: 0,
- expires: 4,
- value: 1,
- }],
- children: [
- { guid: "_o8e1_zxTJFg", index: 0 },
- { guid: "QCtSqkVYUbXB", index: 1 },
- ],
- }],
- }, "Should restore mobile bookmarks from root");
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_import_mobile_bookmarks_root() {
- yield* importFromFixture("mobile_bookmarks_root_import.json",
- /* replace */ false);
- yield* importFromFixture("mobile_bookmarks_root_merge.json",
- /* replace */ false);
-
- yield* treeEquals(PlacesUtils.bookmarks.rootGuid, {
- guid: PlacesUtils.bookmarks.rootGuid,
- index: 0,
- children: [{
- guid: PlacesUtils.bookmarks.menuGuid,
- index: 0,
- children: [
- { guid: "Utodo9b0oVws", index: 0 },
- { guid: "X6lUyOspVYwi", index: 1 },
- ],
- }, {
- guid: PlacesUtils.bookmarks.toolbarGuid,
- index: 1,
- }, {
- guid: PlacesUtils.bookmarks.unfiledGuid,
- index: 3,
- }, {
- guid: PlacesUtils.bookmarks.mobileGuid,
- index: 4,
- annos: [{
- name: "mobile/bookmarksRoot",
- flags: 0,
- expires: 4,
- value: 1,
- }],
- children: [
- { guid: "a17yW6-nTxEJ", index: 0 },
- { guid: "xV10h9Wi3FBM", index: 1 },
- { guid: "_o8e1_zxTJFg", index: 2 },
- { guid: "QCtSqkVYUbXB", index: 3 },
- ],
- }],
- }, "Should merge bookmarks root contents");
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_restore_mobile_bookmarks_folder() {
- yield* importFromFixture("mobile_bookmarks_folder_import.json",
- /* replace */ true);
-
- yield* treeEquals(PlacesUtils.bookmarks.rootGuid, {
- guid: PlacesUtils.bookmarks.rootGuid,
- index: 0,
- children: [{
- guid: PlacesUtils.bookmarks.menuGuid,
- index: 0,
- children: [
- { guid: "X6lUyOspVYwi", index: 0 },
- { guid: "XF4yRP6bTuil", index: 1 },
- ],
- }, {
- guid: PlacesUtils.bookmarks.toolbarGuid,
- index: 1,
- children: [{ guid: "buy7711R3ZgE", index: 0 }],
- }, {
- guid: PlacesUtils.bookmarks.unfiledGuid,
- index: 3,
- children: [{ guid: "KIa9iKZab2Z5", index: 0 }],
- }, {
- guid: PlacesUtils.bookmarks.mobileGuid,
- index: 4,
- annos: [{
- name: "mobile/bookmarksRoot",
- flags: 0,
- expires: 4,
- value: 1,
- }],
- children: [
- { guid: "_o8e1_zxTJFg", index: 0 },
- { guid: "QCtSqkVYUbXB", index: 1 },
- ],
- }],
- }, "Should restore mobile bookmark folder contents into mobile root");
-
- // We rewrite queries to point to the root ID instead of the name
- // ("MOBILE_BOOKMARKS") so that we don't break them if the user downgrades
- // to an earlier release channel. This can be removed along with the anno in
- // bug 1306445.
- let queryById = yield PlacesUtils.bookmarks.fetch("XF4yRP6bTuil");
- equal(queryById.url.href, "place:folder=" + PlacesUtils.mobileFolderId,
- "Should rewrite mobile query to point to root ID");
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_import_mobile_bookmarks_folder() {
- yield* importFromFixture("mobile_bookmarks_folder_import.json",
- /* replace */ false);
- yield* importFromFixture("mobile_bookmarks_folder_merge.json",
- /* replace */ false);
-
- yield* treeEquals(PlacesUtils.bookmarks.rootGuid, {
- guid: PlacesUtils.bookmarks.rootGuid,
- index: 0,
- children: [{
- guid: PlacesUtils.bookmarks.menuGuid,
- index: 0,
- children: [
- { guid: "Utodo9b0oVws", index: 0 },
- { guid: "X6lUyOspVYwi", index: 1 },
- { guid: "XF4yRP6bTuil", index: 2 },
- ],
- }, {
- guid: PlacesUtils.bookmarks.toolbarGuid,
- index: 1,
- children: [{ guid: "buy7711R3ZgE", index: 0 }],
- }, {
- guid: PlacesUtils.bookmarks.unfiledGuid,
- index: 3,
- children: [{ guid: "KIa9iKZab2Z5", index: 0 }],
- }, {
- guid: PlacesUtils.bookmarks.mobileGuid,
- index: 4,
- annos: [{
- name: "mobile/bookmarksRoot",
- flags: 0,
- expires: 4,
- value: 1,
- }],
- children: [
- { guid: "a17yW6-nTxEJ", index: 0 },
- { guid: "xV10h9Wi3FBM", index: 1 },
- { guid: "_o8e1_zxTJFg", index: 2 },
- { guid: "QCtSqkVYUbXB", index: 3 },
- ],
- }],
- }, "Should merge bookmarks folder contents into mobile root");
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_restore_multiple_bookmarks_folders() {
- yield* importFromFixture("mobile_bookmarks_multiple_folders.json",
- /* replace */ true);
-
- yield* treeEquals(PlacesUtils.bookmarks.rootGuid, {
- guid: PlacesUtils.bookmarks.rootGuid,
- index: 0,
- children: [{
- guid: PlacesUtils.bookmarks.menuGuid,
- index: 0,
- children: [
- { guid: "buy7711R3ZgE", index: 0 },
- { guid: "F_LBgd1fS_uQ", index: 1 },
- { guid: "oIpmQXMWsXvY", index: 2 },
- ],
- }, {
- guid: PlacesUtils.bookmarks.toolbarGuid,
- index: 1,
- children: [{ guid: "Utodo9b0oVws", index: 0 }],
- }, {
- guid: PlacesUtils.bookmarks.unfiledGuid,
- index: 3,
- children: [{ guid: "xV10h9Wi3FBM", index: 0 }],
- }, {
- guid: PlacesUtils.bookmarks.mobileGuid,
- index: 4,
- annos: [{
- name: "mobile/bookmarksRoot",
- flags: 0,
- expires: 4,
- value: 1,
- }],
- children: [
- { guid: "sSZ86WT9WbN3", index: 0 },
- { guid: "a17yW6-nTxEJ", index: 1 },
- ],
- }],
- }, "Should restore multiple bookmarks folder contents into root");
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_import_multiple_bookmarks_folders() {
- yield* importFromFixture("mobile_bookmarks_root_import.json",
- /* replace */ false);
- yield* importFromFixture("mobile_bookmarks_multiple_folders.json",
- /* replace */ false);
-
- yield* treeEquals(PlacesUtils.bookmarks.rootGuid, {
- guid: PlacesUtils.bookmarks.rootGuid,
- index: 0,
- children: [{
- guid: PlacesUtils.bookmarks.menuGuid,
- index: 0,
- children: [
- { guid: "buy7711R3ZgE", index: 0 },
- { guid: "F_LBgd1fS_uQ", index: 1 },
- { guid: "oIpmQXMWsXvY", index: 2 },
- { guid: "X6lUyOspVYwi", index: 3 },
- ],
- }, {
- guid: PlacesUtils.bookmarks.toolbarGuid,
- index: 1,
- children: [{ guid: "Utodo9b0oVws", index: 0 }],
- }, {
- guid: PlacesUtils.bookmarks.unfiledGuid,
- index: 3,
- children: [{ guid: "xV10h9Wi3FBM", index: 0 }],
- }, {
- guid: PlacesUtils.bookmarks.mobileGuid,
- index: 4,
- annos: [{
- name: "mobile/bookmarksRoot",
- flags: 0,
- expires: 4,
- value: 1,
- }],
- children: [
- { guid: "sSZ86WT9WbN3", index: 0 },
- { guid: "a17yW6-nTxEJ", index: 1 },
- { guid: "_o8e1_zxTJFg", index: 2 },
- { guid: "QCtSqkVYUbXB", index: 3 },
- ],
- }],
- }, "Should merge multiple mobile folders into root");
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
diff --git a/toolkit/components/places/tests/unit/test_isPageInDB.js b/toolkit/components/places/tests/unit/test_isPageInDB.js
deleted file mode 100644
index 249853fa9..000000000
--- a/toolkit/components/places/tests/unit/test_isPageInDB.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-
-add_task(function* test_execute() {
- var good_uri = uri("http://mozilla.com");
- var bad_uri = uri("http://google.com");
- yield PlacesTestUtils.addVisits({uri: good_uri});
- do_check_true(yield PlacesTestUtils.isPageInDB(good_uri));
- do_check_false(yield PlacesTestUtils.isPageInDB(bad_uri));
-});
diff --git a/toolkit/components/places/tests/unit/test_isURIVisited.js b/toolkit/components/places/tests/unit/test_isURIVisited.js
deleted file mode 100644
index 93c010e83..000000000
--- a/toolkit/components/places/tests/unit/test_isURIVisited.js
+++ /dev/null
@@ -1,84 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Tests functionality of the isURIVisited API.
-
-const SCHEMES = {
- "http://": true,
- "https://": true,
- "ftp://": true,
- "file:///": true,
- "about:": false,
-// nsIIOService.newURI() can throw if e.g. the app knows about imap://
-// but the account is not set up and so the URL is invalid for it.
-// "imap://": false,
- "news://": false,
- "mailbox:": false,
- "moz-anno:favicon:http://": false,
- "view-source:http://": false,
- "chrome://browser/content/browser.xul?": false,
- "resource://": false,
- "data:,": false,
- "wyciwyg:/0/http://": false,
- "javascript:": false,
-};
-
-var gRunner;
-function run_test()
-{
- do_test_pending();
- gRunner = step();
- gRunner.next();
-}
-
-function* step()
-{
- let history = Cc["@mozilla.org/browser/history;1"]
- .getService(Ci.mozIAsyncHistory);
-
- for (let scheme in SCHEMES) {
- do_print("Testing scheme " + scheme);
- for (let t in PlacesUtils.history.TRANSITIONS) {
- do_print("With transition " + t);
- let transition = PlacesUtils.history.TRANSITIONS[t];
-
- let uri = NetUtil.newURI(scheme + "mozilla.org/");
-
- history.isURIVisited(uri, function(aURI, aIsVisited) {
- do_check_true(uri.equals(aURI));
- do_check_false(aIsVisited);
-
- let callback = {
- handleError: function () {},
- handleResult: function () {},
- handleCompletion: function () {
- do_print("Added visit to " + uri.spec);
-
- history.isURIVisited(uri, function (aURI2, aIsVisited2) {
- do_check_true(uri.equals(aURI2));
- let checker = SCHEMES[scheme] ? do_check_true : do_check_false;
- checker(aIsVisited2);
-
- PlacesTestUtils.clearHistory().then(function () {
- history.isURIVisited(uri, function(aURI3, aIsVisited3) {
- do_check_true(uri.equals(aURI3));
- do_check_false(aIsVisited3);
- gRunner.next();
- });
- });
- });
- },
- };
-
- history.updatePlaces({ uri: uri
- , visits: [ { transitionType: transition
- , visitDate: Date.now() * 1000
- } ]
- }, callback);
- });
- yield undefined;
- }
- }
-
- do_test_finished();
-}
diff --git a/toolkit/components/places/tests/unit/test_isvisited.js b/toolkit/components/places/tests/unit/test_isvisited.js
deleted file mode 100644
index d7bcc2851..000000000
--- a/toolkit/components/places/tests/unit/test_isvisited.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- var referrer = uri("about:blank");
-
- // add a http:// uri
- var uri1 = uri("http://mozilla.com");
- yield PlacesTestUtils.addVisits({uri: uri1, referrer: referrer});
- do_check_guid_for_uri(uri1);
- do_check_true(yield promiseIsURIVisited(uri1));
-
- // add a https:// uri
- var uri2 = uri("https://etrade.com");
- yield PlacesTestUtils.addVisits({uri: uri2, referrer: referrer});
- do_check_guid_for_uri(uri2);
- do_check_true(yield promiseIsURIVisited(uri2));
-
- // add a ftp:// uri
- var uri3 = uri("ftp://ftp.mozilla.org");
- yield PlacesTestUtils.addVisits({uri: uri3, referrer: referrer});
- do_check_guid_for_uri(uri3);
- do_check_true(yield promiseIsURIVisited(uri3));
-
- // check if a nonexistent uri is visited
- var uri4 = uri("http://foobarcheese.com");
- do_check_false(yield promiseIsURIVisited(uri4));
-
- // check that certain schemes never show up as visited
- // even if we attempt to add them to history
- // see CanAddURI() in nsNavHistory.cpp
- const URLS = [
- "about:config",
- "imap://cyrus.andrew.cmu.edu/archive.imap",
- "news://new.mozilla.org/mozilla.dev.apps.firefox",
- "mailbox:Inbox",
- "moz-anno:favicon:http://mozilla.org/made-up-favicon",
- "view-source:http://mozilla.org",
- "chrome://browser/content/browser.xul",
- "resource://gre-resources/hiddenWindow.html",
- "data:,Hello%2C%20World!",
- "wyciwyg:/0/http://mozilla.org",
- "javascript:alert('hello wolrd!');",
- "http://localhost/" + "a".repeat(1984),
- ];
- for (let currentURL of URLS) {
- try {
- var cantAddUri = uri(currentURL);
- }
- catch (e) {
- // nsIIOService.newURI() can throw if e.g. our app knows about imap://
- // but the account is not set up and so the URL is invalid for us.
- // Note this in the log but ignore as it's not the subject of this test.
- do_print("Could not construct URI for '" + currentURL + "'; ignoring");
- }
- if (cantAddUri) {
- PlacesTestUtils.addVisits({uri: cantAddUri, referrer: referrer}).then(() => {
- do_throw("Should not have added history for invalid URI.");
- }, error => {
- do_check_true(error.message.includes("No items were added to history"));
- });
- do_check_false(yield promiseIsURIVisited(cantAddUri));
- }
- }
-});
-
diff --git a/toolkit/components/places/tests/unit/test_keywords.js b/toolkit/components/places/tests/unit/test_keywords.js
deleted file mode 100644
index 57b734c5d..000000000
--- a/toolkit/components/places/tests/unit/test_keywords.js
+++ /dev/null
@@ -1,548 +0,0 @@
-"use strict"
-
-function* check_keyword(aExpectExists, aHref, aKeyword, aPostData = null) {
- // Check case-insensitivity.
- aKeyword = aKeyword.toUpperCase();
-
- let entry = yield PlacesUtils.keywords.fetch(aKeyword);
-
- Assert.deepEqual(entry, yield PlacesUtils.keywords.fetch({ keyword: aKeyword }));
-
- if (aExpectExists) {
- Assert.ok(!!entry, "A keyword should exist");
- Assert.equal(entry.url.href, aHref);
- Assert.equal(entry.postData, aPostData);
- Assert.deepEqual(entry, yield PlacesUtils.keywords.fetch({ keyword: aKeyword, url: aHref }));
- let entries = [];
- yield PlacesUtils.keywords.fetch({ url: aHref }, e => entries.push(e));
- Assert.ok(entries.some(e => e.url.href == aHref && e.keyword == aKeyword.toLowerCase()));
- } else {
- Assert.ok(!entry || entry.url.href != aHref,
- "The given keyword entry should not exist");
- Assert.equal(null, yield PlacesUtils.keywords.fetch({ keyword: aKeyword, url: aHref }));
- }
-}
-
-/**
- * Polls the keywords cache waiting for the given keyword entry.
- */
-function* promiseKeyword(keyword, expectedHref) {
- let href = null;
- do {
- yield new Promise(resolve => do_timeout(100, resolve));
- let entry = yield PlacesUtils.keywords.fetch(keyword);
- if (entry)
- href = entry.url.href;
- } while (href != expectedHref);
-}
-
-function* check_no_orphans() {
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.executeCached(
- `SELECT id FROM moz_keywords k
- WHERE NOT EXISTS (SELECT 1 FROM moz_places WHERE id = k.place_id)
- `);
- Assert.equal(rows.length, 0);
-}
-
-function expectBookmarkNotifications() {
- let notifications = [];
- let observer = new Proxy(NavBookmarkObserver, {
- get(target, name) {
- if (name == "check") {
- PlacesUtils.bookmarks.removeObserver(observer);
- return expectedNotifications =>
- Assert.deepEqual(notifications, expectedNotifications);
- }
-
- if (name.startsWith("onItemChanged")) {
- return function(itemId, property) {
- if (property != "keyword")
- return;
- let args = Array.from(arguments, arg => {
- if (arg && arg instanceof Ci.nsIURI)
- return new URL(arg.spec);
- if (arg && typeof(arg) == "number" && arg >= Date.now() * 1000)
- return new Date(parseInt(arg/1000));
- return arg;
- });
- notifications.push({ name: name, arguments: args });
- }
- }
-
- if (name in target)
- return target[name];
- return undefined;
- }
- });
- PlacesUtils.bookmarks.addObserver(observer, false);
- return observer;
-}
-
-add_task(function* test_invalid_input() {
- Assert.throws(() => PlacesUtils.keywords.fetch(null),
- /Invalid keyword/);
- Assert.throws(() => PlacesUtils.keywords.fetch(5),
- /Invalid keyword/);
- Assert.throws(() => PlacesUtils.keywords.fetch(undefined),
- /Invalid keyword/);
- Assert.throws(() => PlacesUtils.keywords.fetch({ keyword: null }),
- /Invalid keyword/);
- Assert.throws(() => PlacesUtils.keywords.fetch({ keyword: {} }),
- /Invalid keyword/);
- Assert.throws(() => PlacesUtils.keywords.fetch({ keyword: 5 }),
- /Invalid keyword/);
- Assert.throws(() => PlacesUtils.keywords.fetch({}),
- /At least keyword or url must be provided/);
- Assert.throws(() => PlacesUtils.keywords.fetch({ keyword: "test" }, "test"),
- /onResult callback must be a valid function/);
- Assert.throws(() => PlacesUtils.keywords.fetch({ url: "test" }),
- /is not a valid URL/);
- Assert.throws(() => PlacesUtils.keywords.fetch({ url: {} }),
- /is not a valid URL/);
- Assert.throws(() => PlacesUtils.keywords.fetch({ url: null }),
- /is not a valid URL/);
- Assert.throws(() => PlacesUtils.keywords.fetch({ url: "" }),
- /is not a valid URL/);
-
- Assert.throws(() => PlacesUtils.keywords.insert(null),
- /Input should be a valid object/);
- Assert.throws(() => PlacesUtils.keywords.insert("test"),
- /Input should be a valid object/);
- Assert.throws(() => PlacesUtils.keywords.insert(undefined),
- /Input should be a valid object/);
- Assert.throws(() => PlacesUtils.keywords.insert({ }),
- /Invalid keyword/);
- Assert.throws(() => PlacesUtils.keywords.insert({ keyword: null }),
- /Invalid keyword/);
- Assert.throws(() => PlacesUtils.keywords.insert({ keyword: 5 }),
- /Invalid keyword/);
- Assert.throws(() => PlacesUtils.keywords.insert({ keyword: "" }),
- /Invalid keyword/);
- Assert.throws(() => PlacesUtils.keywords.insert({ keyword: "test", postData: 5 }),
- /Invalid POST data/);
- Assert.throws(() => PlacesUtils.keywords.insert({ keyword: "test", postData: {} }),
- /Invalid POST data/);
- Assert.throws(() => PlacesUtils.keywords.insert({ keyword: "test" }),
- /is not a valid URL/);
- Assert.throws(() => PlacesUtils.keywords.insert({ keyword: "test", url: 5 }),
- /is not a valid URL/);
- Assert.throws(() => PlacesUtils.keywords.insert({ keyword: "test", url: "" }),
- /is not a valid URL/);
- Assert.throws(() => PlacesUtils.keywords.insert({ keyword: "test", url: null }),
- /is not a valid URL/);
- Assert.throws(() => PlacesUtils.keywords.insert({ keyword: "test", url: "mozilla" }),
- /is not a valid URL/);
-
- Assert.throws(() => PlacesUtils.keywords.remove(null),
- /Invalid keyword/);
- Assert.throws(() => PlacesUtils.keywords.remove(""),
- /Invalid keyword/);
- Assert.throws(() => PlacesUtils.keywords.remove(5),
- /Invalid keyword/);
-});
-
-add_task(function* test_addKeyword() {
- yield check_keyword(false, "http://example.com/", "keyword");
- let fc = yield foreign_count("http://example.com/");
- let observer = expectBookmarkNotifications();
-
- yield PlacesUtils.keywords.insert({ keyword: "keyword", url: "http://example.com/" });
- observer.check([]);
-
- yield check_keyword(true, "http://example.com/", "keyword");
- Assert.equal((yield foreign_count("http://example.com/")), fc + 1); // +1 keyword
-
- // Now remove the keyword.
- observer = expectBookmarkNotifications();
- yield PlacesUtils.keywords.remove("keyword");
- observer.check([]);
-
- yield check_keyword(false, "http://example.com/", "keyword");
- Assert.equal((yield foreign_count("http://example.com/")), fc); // -1 keyword
-
- // Check using URL.
- yield PlacesUtils.keywords.insert({ keyword: "keyword", url: new URL("http://example.com/") });
- yield check_keyword(true, "http://example.com/", "keyword");
- yield PlacesUtils.keywords.remove("keyword");
- yield check_keyword(false, "http://example.com/", "keyword");
-
- yield check_no_orphans();
-});
-
-add_task(function* test_addBookmarkAndKeyword() {
- yield check_keyword(false, "http://example.com/", "keyword");
- let fc = yield foreign_count("http://example.com/");
- let bookmark = yield PlacesUtils.bookmarks.insert({ url: "http://example.com/",
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
-
- let observer = expectBookmarkNotifications();
- yield PlacesUtils.keywords.insert({ keyword: "keyword", url: "http://example.com/" });
-
- observer.check([{ name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmark.guid)),
- "keyword", false, "keyword",
- bookmark.lastModified, bookmark.type,
- (yield PlacesUtils.promiseItemId(bookmark.parentGuid)),
- bookmark.guid, bookmark.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] } ]);
-
- yield check_keyword(true, "http://example.com/", "keyword");
- Assert.equal((yield foreign_count("http://example.com/")), fc + 2); // +1 bookmark +1 keyword
-
- // Now remove the keyword.
- observer = expectBookmarkNotifications();
- yield PlacesUtils.keywords.remove("keyword");
-
- observer.check([{ name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmark.guid)),
- "keyword", false, "",
- bookmark.lastModified, bookmark.type,
- (yield PlacesUtils.promiseItemId(bookmark.parentGuid)),
- bookmark.guid, bookmark.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] } ]);
-
- yield check_keyword(false, "http://example.com/", "keyword");
- Assert.equal((yield foreign_count("http://example.com/")), fc + 1); // -1 keyword
-
- // Add again the keyword, then remove the bookmark.
- yield PlacesUtils.keywords.insert({ keyword: "keyword", url: "http://example.com/" });
-
- observer = expectBookmarkNotifications();
- yield PlacesUtils.bookmarks.remove(bookmark.guid);
- // the notification is synchronous but the removal process is async.
- // Unfortunately there's nothing explicit we can wait for.
- while ((yield foreign_count("http://example.com/")));
- // We don't get any itemChanged notification since the bookmark has been
- // removed already.
- observer.check([]);
-
- yield check_keyword(false, "http://example.com/", "keyword");
-
- yield check_no_orphans();
-});
-
-add_task(function* test_addKeywordToURIHavingKeyword() {
- yield check_keyword(false, "http://example.com/", "keyword");
- let fc = yield foreign_count("http://example.com/");
-
- let observer = expectBookmarkNotifications();
- yield PlacesUtils.keywords.insert({ keyword: "keyword", url: "http://example.com/" });
- observer.check([]);
-
- yield check_keyword(true, "http://example.com/", "keyword");
- Assert.equal((yield foreign_count("http://example.com/")), fc + 1); // +1 keyword
-
- yield PlacesUtils.keywords.insert({ keyword: "keyword2", url: "http://example.com/" });
-
- yield check_keyword(true, "http://example.com/", "keyword");
- yield check_keyword(true, "http://example.com/", "keyword2");
- Assert.equal((yield foreign_count("http://example.com/")), fc + 2); // +1 keyword
- let entries = [];
- let entry = yield PlacesUtils.keywords.fetch({ url: "http://example.com/" }, e => entries.push(e));
- Assert.equal(entries.length, 2);
- Assert.deepEqual(entries[0], entry);
-
- // Now remove the keywords.
- observer = expectBookmarkNotifications();
- yield PlacesUtils.keywords.remove("keyword");
- yield PlacesUtils.keywords.remove("keyword2");
- observer.check([]);
-
- yield check_keyword(false, "http://example.com/", "keyword");
- yield check_keyword(false, "http://example.com/", "keyword2");
- Assert.equal((yield foreign_count("http://example.com/")), fc); // -1 keyword
-
- yield check_no_orphans();
-});
-
-add_task(function* test_addBookmarkToURIHavingKeyword() {
- yield check_keyword(false, "http://example.com/", "keyword");
- let fc = yield foreign_count("http://example.com/");
- let observer = expectBookmarkNotifications();
-
- yield PlacesUtils.keywords.insert({ keyword: "keyword", url: "http://example.com/" });
- observer.check([]);
-
- yield check_keyword(true, "http://example.com/", "keyword");
- Assert.equal((yield foreign_count("http://example.com/")), fc + 1); // +1 keyword
-
- observer = expectBookmarkNotifications();
- let bookmark = yield PlacesUtils.bookmarks.insert({ url: "http://example.com/",
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- Assert.equal((yield foreign_count("http://example.com/")), fc + 2); // +1 bookmark
- observer.check([]);
-
- observer = expectBookmarkNotifications();
- yield PlacesUtils.bookmarks.remove(bookmark.guid);
- // the notification is synchronous but the removal process is async.
- // Unfortunately there's nothing explicit we can wait for.
- while ((yield foreign_count("http://example.com/")));
- // We don't get any itemChanged notification since the bookmark has been
- // removed already.
- observer.check([]);
-
- yield check_keyword(false, "http://example.com/", "keyword");
-
- yield check_no_orphans();
-});
-
-add_task(function* test_sameKeywordDifferentURL() {
- let fc1 = yield foreign_count("http://example1.com/");
- let bookmark1 = yield PlacesUtils.bookmarks.insert({ url: "http://example1.com/",
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- let fc2 = yield foreign_count("http://example2.com/");
- let bookmark2 = yield PlacesUtils.bookmarks.insert({ url: "http://example2.com/",
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- yield PlacesUtils.keywords.insert({ keyword: "keyword", url: "http://example1.com/" });
-
- yield check_keyword(true, "http://example1.com/", "keyword");
- Assert.equal((yield foreign_count("http://example1.com/")), fc1 + 2); // +1 bookmark +1 keyword
- yield check_keyword(false, "http://example2.com/", "keyword");
- Assert.equal((yield foreign_count("http://example2.com/")), fc2 + 1); // +1 bookmark
-
- // Assign the same keyword to another url.
- let observer = expectBookmarkNotifications();
- yield PlacesUtils.keywords.insert({ keyword: "keyword", url: "http://example2.com/" });
-
- observer.check([{ name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmark1.guid)),
- "keyword", false, "",
- bookmark1.lastModified, bookmark1.type,
- (yield PlacesUtils.promiseItemId(bookmark1.parentGuid)),
- bookmark1.guid, bookmark1.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmark2.guid)),
- "keyword", false, "keyword",
- bookmark2.lastModified, bookmark2.type,
- (yield PlacesUtils.promiseItemId(bookmark2.parentGuid)),
- bookmark2.guid, bookmark2.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] } ]);
-
- yield check_keyword(false, "http://example1.com/", "keyword");
- Assert.equal((yield foreign_count("http://example1.com/")), fc1 + 1); // -1 keyword
- yield check_keyword(true, "http://example2.com/", "keyword");
- Assert.equal((yield foreign_count("http://example2.com/")), fc2 + 2); // +1 keyword
-
- // Now remove the keyword.
- observer = expectBookmarkNotifications();
- yield PlacesUtils.keywords.remove("keyword");
- observer.check([{ name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmark2.guid)),
- "keyword", false, "",
- bookmark2.lastModified, bookmark2.type,
- (yield PlacesUtils.promiseItemId(bookmark2.parentGuid)),
- bookmark2.guid, bookmark2.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] } ]);
-
- yield check_keyword(false, "http://example1.com/", "keyword");
- yield check_keyword(false, "http://example2.com/", "keyword");
- Assert.equal((yield foreign_count("http://example1.com/")), fc1 + 1);
- Assert.equal((yield foreign_count("http://example2.com/")), fc2 + 1); // -1 keyword
-
- yield PlacesUtils.bookmarks.remove(bookmark1);
- yield PlacesUtils.bookmarks.remove(bookmark2);
- Assert.equal((yield foreign_count("http://example1.com/")), fc1); // -1 bookmark
- while ((yield foreign_count("http://example2.com/"))); // -1 keyword
-
- yield check_no_orphans();
-});
-
-add_task(function* test_sameURIDifferentKeyword() {
- let fc = yield foreign_count("http://example.com/");
-
- let observer = expectBookmarkNotifications();
- let bookmark = yield PlacesUtils.bookmarks.insert({ url: "http://example.com/",
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- yield PlacesUtils.keywords.insert({keyword: "keyword", url: "http://example.com/" });
-
- yield check_keyword(true, "http://example.com/", "keyword");
- Assert.equal((yield foreign_count("http://example.com/")), fc + 2); // +1 bookmark +1 keyword
-
- observer.check([{ name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmark.guid)),
- "keyword", false, "keyword",
- bookmark.lastModified, bookmark.type,
- (yield PlacesUtils.promiseItemId(bookmark.parentGuid)),
- bookmark.guid, bookmark.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] } ]);
-
- observer = expectBookmarkNotifications();
- yield PlacesUtils.keywords.insert({ keyword: "keyword2", url: "http://example.com/" });
- yield check_keyword(true, "http://example.com/", "keyword");
- yield check_keyword(true, "http://example.com/", "keyword2");
- Assert.equal((yield foreign_count("http://example.com/")), fc + 3); // +1 keyword
- observer.check([{ name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmark.guid)),
- "keyword", false, "keyword2",
- bookmark.lastModified, bookmark.type,
- (yield PlacesUtils.promiseItemId(bookmark.parentGuid)),
- bookmark.guid, bookmark.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] } ]);
-
- // Add a third keyword.
- yield PlacesUtils.keywords.insert({ keyword: "keyword3", url: "http://example.com/" });
- yield check_keyword(true, "http://example.com/", "keyword");
- yield check_keyword(true, "http://example.com/", "keyword2");
- yield check_keyword(true, "http://example.com/", "keyword3");
- Assert.equal((yield foreign_count("http://example.com/")), fc + 4); // +1 keyword
-
- // Remove one of the keywords.
- observer = expectBookmarkNotifications();
- yield PlacesUtils.keywords.remove("keyword");
- yield check_keyword(false, "http://example.com/", "keyword");
- yield check_keyword(true, "http://example.com/", "keyword2");
- yield check_keyword(true, "http://example.com/", "keyword3");
- observer.check([{ name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmark.guid)),
- "keyword", false, "",
- bookmark.lastModified, bookmark.type,
- (yield PlacesUtils.promiseItemId(bookmark.parentGuid)),
- bookmark.guid, bookmark.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] } ]);
- Assert.equal((yield foreign_count("http://example.com/")), fc + 3); // -1 keyword
-
- // Now remove the bookmark.
- yield PlacesUtils.bookmarks.remove(bookmark);
- while ((yield foreign_count("http://example.com/")));
- yield check_keyword(false, "http://example.com/", "keyword");
- yield check_keyword(false, "http://example.com/", "keyword2");
- yield check_keyword(false, "http://example.com/", "keyword3");
-
- check_no_orphans();
-});
-
-add_task(function* test_deleteKeywordMultipleBookmarks() {
- let fc = yield foreign_count("http://example.com/");
-
- let observer = expectBookmarkNotifications();
- let bookmark1 = yield PlacesUtils.bookmarks.insert({ url: "http://example.com/",
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- let bookmark2 = yield PlacesUtils.bookmarks.insert({ url: "http://example.com/",
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- yield PlacesUtils.keywords.insert({ keyword: "keyword", url: "http://example.com/" });
-
- yield check_keyword(true, "http://example.com/", "keyword");
- Assert.equal((yield foreign_count("http://example.com/")), fc + 3); // +2 bookmark +1 keyword
- observer.check([{ name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmark2.guid)),
- "keyword", false, "keyword",
- bookmark2.lastModified, bookmark2.type,
- (yield PlacesUtils.promiseItemId(bookmark2.parentGuid)),
- bookmark2.guid, bookmark2.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmark1.guid)),
- "keyword", false, "keyword",
- bookmark1.lastModified, bookmark1.type,
- (yield PlacesUtils.promiseItemId(bookmark1.parentGuid)),
- bookmark1.guid, bookmark1.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] } ]);
-
- observer = expectBookmarkNotifications();
- yield PlacesUtils.keywords.remove("keyword");
- yield check_keyword(false, "http://example.com/", "keyword");
- Assert.equal((yield foreign_count("http://example.com/")), fc + 2); // -1 keyword
- observer.check([{ name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmark2.guid)),
- "keyword", false, "",
- bookmark2.lastModified, bookmark2.type,
- (yield PlacesUtils.promiseItemId(bookmark2.parentGuid)),
- bookmark2.guid, bookmark2.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] },
- { name: "onItemChanged",
- arguments: [ (yield PlacesUtils.promiseItemId(bookmark1.guid)),
- "keyword", false, "",
- bookmark1.lastModified, bookmark1.type,
- (yield PlacesUtils.promiseItemId(bookmark1.parentGuid)),
- bookmark1.guid, bookmark1.parentGuid, "",
- Ci.nsINavBookmarksService.SOURCE_DEFAULT ] } ]);
-
- // Now remove the bookmarks.
- yield PlacesUtils.bookmarks.remove(bookmark1);
- yield PlacesUtils.bookmarks.remove(bookmark2);
- Assert.equal((yield foreign_count("http://example.com/")), fc); // -2 bookmarks
-
- check_no_orphans();
-});
-
-add_task(function* test_multipleKeywordsSamePostData() {
- yield PlacesUtils.keywords.insert({ keyword: "keyword", url: "http://example.com/", postData: "postData1" });
- yield check_keyword(true, "http://example.com/", "keyword", "postData1");
- // Add another keyword with same postData, should fail.
- yield Assert.rejects(PlacesUtils.keywords.insert({ keyword: "keyword2", url: "http://example.com/", postData: "postData1" }),
- /constraint failed/);
- yield check_keyword(false, "http://example.com/", "keyword2", "postData1");
-
- yield PlacesUtils.keywords.remove("keyword");
-
- check_no_orphans();
-});
-
-add_task(function* test_oldPostDataAPI() {
- let bookmark = yield PlacesUtils.bookmarks.insert({ url: "http://example.com/",
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- yield PlacesUtils.keywords.insert({ keyword: "keyword", url: "http://example.com/" });
- let itemId = yield PlacesUtils.promiseItemId(bookmark.guid);
- yield PlacesUtils.setPostDataForBookmark(itemId, "postData");
- yield check_keyword(true, "http://example.com/", "keyword", "postData");
- Assert.equal(PlacesUtils.getPostDataForBookmark(itemId), "postData");
-
- yield PlacesUtils.keywords.remove("keyword");
- yield PlacesUtils.bookmarks.remove(bookmark);
-
- check_no_orphans();
-});
-
-add_task(function* test_oldKeywordsAPI() {
- let bookmark = yield PlacesUtils.bookmarks.insert({ url: "http://example.com/",
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- yield check_keyword(false, "http://example.com/", "keyword");
- let itemId = yield PlacesUtils.promiseItemId(bookmark.guid);
-
- PlacesUtils.bookmarks.setKeywordForBookmark(itemId, "keyword");
- yield promiseKeyword("keyword", "http://example.com/");
-
- // Remove the keyword.
- PlacesUtils.bookmarks.setKeywordForBookmark(itemId, "");
- yield promiseKeyword("keyword", null);
-
- yield PlacesUtils.keywords.insert({ keyword: "keyword", url: "http://example.com" });
- Assert.equal(PlacesUtils.bookmarks.getKeywordForBookmark(itemId), "keyword");
- Assert.equal(PlacesUtils.bookmarks.getURIForKeyword("keyword").spec, "http://example.com/");
- yield PlacesUtils.bookmarks.remove(bookmark);
-
- check_no_orphans();
-});
-
-add_task(function* test_bookmarkURLChange() {
- let fc1 = yield foreign_count("http://example1.com/");
- let fc2 = yield foreign_count("http://example2.com/");
- let bookmark = yield PlacesUtils.bookmarks.insert({ url: "http://example1.com/",
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- yield PlacesUtils.keywords.insert({ keyword: "keyword",
- url: "http://example1.com/" });
-
- yield check_keyword(true, "http://example1.com/", "keyword");
- Assert.equal((yield foreign_count("http://example1.com/")), fc1 + 2); // +1 bookmark +1 keyword
-
- yield PlacesUtils.bookmarks.update({ guid: bookmark.guid,
- url: "http://example2.com/"});
- yield promiseKeyword("keyword", "http://example2.com/");
-
- yield check_keyword(false, "http://example1.com/", "keyword");
- yield check_keyword(true, "http://example2.com/", "keyword");
- Assert.equal((yield foreign_count("http://example1.com/")), fc1); // -1 bookmark -1 keyword
- Assert.equal((yield foreign_count("http://example2.com/")), fc2 + 2); // +1 bookmark +1 keyword
-});
diff --git a/toolkit/components/places/tests/unit/test_lastModified.js b/toolkit/components/places/tests/unit/test_lastModified.js
deleted file mode 100644
index c75494932..000000000
--- a/toolkit/components/places/tests/unit/test_lastModified.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- /**
- * Test that inserting a new bookmark will set lastModified to the same
- * values as dateAdded.
- */
-// main
-function run_test() {
- var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
- var itemId = bs.insertBookmark(bs.bookmarksMenuFolder,
- uri("http://www.mozilla.org/"),
- bs.DEFAULT_INDEX,
- "itemTitle");
- var dateAdded = bs.getItemDateAdded(itemId);
- do_check_eq(dateAdded, bs.getItemLastModified(itemId));
-
- // Change lastModified, then change dateAdded. LastModified should be set
- // to the new dateAdded.
- // This could randomly fail on virtual machines due to timing issues, so
- // we manually increase the time value. See bug 500640 for details.
- bs.setItemLastModified(itemId, dateAdded + 1000);
- do_check_true(bs.getItemLastModified(itemId) === dateAdded + 1000);
- do_check_true(bs.getItemDateAdded(itemId) < bs.getItemLastModified(itemId));
- bs.setItemDateAdded(itemId, dateAdded + 2000);
- do_check_true(bs.getItemDateAdded(itemId) === dateAdded + 2000);
- do_check_eq(bs.getItemDateAdded(itemId), bs.getItemLastModified(itemId));
-
- bs.removeItem(itemId);
-}
diff --git a/toolkit/components/places/tests/unit/test_markpageas.js b/toolkit/components/places/tests/unit/test_markpageas.js
deleted file mode 100644
index ba4f740c6..000000000
--- a/toolkit/components/places/tests/unit/test_markpageas.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var gVisits = [{url: "http://www.mozilla.com/",
- transition: TRANSITION_TYPED},
- {url: "http://www.google.com/",
- transition: TRANSITION_BOOKMARK},
- {url: "http://www.espn.com/",
- transition: TRANSITION_LINK}];
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- let observer;
- let completionPromise = new Promise(resolveCompletionPromise => {
- observer = {
- __proto__: NavHistoryObserver.prototype,
- _visitCount: 0,
- onVisit: function (aURI, aVisitID, aTime, aSessionID, aReferringID,
- aTransitionType, aAdded)
- {
- do_check_eq(aURI.spec, gVisits[this._visitCount].url);
- do_check_eq(aTransitionType, gVisits[this._visitCount].transition);
- this._visitCount++;
-
- if (this._visitCount == gVisits.length) {
- resolveCompletionPromise();
- }
- },
- };
- });
-
- PlacesUtils.history.addObserver(observer, false);
-
- for (var visit of gVisits) {
- if (visit.transition == TRANSITION_TYPED)
- PlacesUtils.history.markPageAsTyped(uri(visit.url));
- else if (visit.transition == TRANSITION_BOOKMARK)
- PlacesUtils.history.markPageAsFollowedBookmark(uri(visit.url))
- else {
- // because it is a top level visit with no referrer,
- // it will result in TRANSITION_LINK
- }
- yield PlacesTestUtils.addVisits({
- uri: uri(visit.url),
- transition: visit.transition
- });
- }
-
- yield completionPromise;
-
- PlacesUtils.history.removeObserver(observer);
-});
-
diff --git a/toolkit/components/places/tests/unit/test_mozIAsyncLivemarks.js b/toolkit/components/places/tests/unit/test_mozIAsyncLivemarks.js
deleted file mode 100644
index 5136591ba..000000000
--- a/toolkit/components/places/tests/unit/test_mozIAsyncLivemarks.js
+++ /dev/null
@@ -1,514 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Tests functionality of the mozIAsyncLivemarks interface.
-
-const FEED_URI = NetUtil.newURI("http://feed.rss/");
-const SITE_URI = NetUtil.newURI("http://site.org/");
-
-// This test must be the first one, since it's testing the cache.
-add_task(function* test_livemark_cache() {
- // Add a livemark through other APIs.
- let folder = yield PlacesUtils.bookmarks.insert({
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "test",
- parentGuid: PlacesUtils.bookmarks.unfiledGuid
- });
- let id = yield PlacesUtils.promiseItemId(folder.guid);
- PlacesUtils.annotations
- .setItemAnnotation(id, PlacesUtils.LMANNO_FEEDURI,
- "http://example.com/feed",
- 0, PlacesUtils.annotations.EXPIRE_NEVER);
- PlacesUtils.annotations
- .setItemAnnotation(id, PlacesUtils.LMANNO_SITEURI,
- "http://example.com/site",
- 0, PlacesUtils.annotations.EXPIRE_NEVER);
-
- let livemark = yield PlacesUtils.livemarks.getLivemark({ guid: folder.guid });
- Assert.equal(folder.guid, livemark.guid);
- Assert.equal(folder.dateAdded * 1000, livemark.dateAdded);
- Assert.equal(folder.parentGuid, livemark.parentGuid);
- Assert.equal(folder.index, livemark.index);
- Assert.equal(folder.title, livemark.title);
- Assert.equal(id, livemark.id);
- Assert.equal(PlacesUtils.unfiledBookmarksFolderId, livemark.parentId);
- Assert.equal("http://example.com/feed", livemark.feedURI.spec);
- Assert.equal("http://example.com/site", livemark.siteURI.spec);
-
- yield PlacesUtils.livemarks.removeLivemark(livemark);
-});
-
-add_task(function* test_addLivemark_noArguments_throws() {
- try {
- yield PlacesUtils.livemarks.addLivemark();
- do_throw("Invoking addLivemark with no arguments should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_XPC_NOT_ENOUGH_ARGS);
- }
-});
-
-add_task(function* test_addLivemark_emptyObject_throws() {
- try {
- yield PlacesUtils.livemarks.addLivemark({});
- do_throw("Invoking addLivemark with empty object should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_addLivemark_badParentId_throws() {
- try {
- yield PlacesUtils.livemarks.addLivemark({ parentId: "test" });
- do_throw("Invoking addLivemark with a bad parent id should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_addLivemark_invalidParentId_throws() {
- try {
- yield PlacesUtils.livemarks.addLivemark({ parentId: -2 });
- do_throw("Invoking addLivemark with an invalid parent id should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_addLivemark_noIndex_throws() {
- try {
- yield PlacesUtils.livemarks.addLivemark({
- parentId: PlacesUtils.unfiledBookmarksFolderId });
- do_throw("Invoking addLivemark with no index should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_addLivemark_badIndex_throws() {
- try {
- yield PlacesUtils.livemarks.addLivemark(
- { parentId: PlacesUtils.unfiledBookmarksFolderId
- , index: "test" });
- do_throw("Invoking addLivemark with a bad index should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_addLivemark_invalidIndex_throws() {
- try {
- yield PlacesUtils.livemarks.addLivemark(
- { parentId: PlacesUtils.unfiledBookmarksFolderId
- , index: -2
- });
- do_throw("Invoking addLivemark with an invalid index should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_addLivemark_noFeedURI_throws() {
- try {
- yield PlacesUtils.livemarks.addLivemark(
- { parentGuid: PlacesUtils.bookmarks.unfiledGuid });
- do_throw("Invoking addLivemark with no feedURI should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_addLivemark_badFeedURI_throws() {
- try {
- yield PlacesUtils.livemarks.addLivemark(
- { parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: "test" });
- do_throw("Invoking addLivemark with a bad feedURI should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_addLivemark_badSiteURI_throws() {
- try {
- yield PlacesUtils.livemarks.addLivemark(
- { parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- , siteURI: "test" });
- do_throw("Invoking addLivemark with a bad siteURI should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_addLivemark_badGuid_throws() {
- try {
- yield PlacesUtils.livemarks.addLivemark(
- { parentGuid: PlacesUtils.bookmarks.unfileGuid
- , feedURI: FEED_URI
- , guid: "123456" });
- do_throw("Invoking addLivemark with a bad guid should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_addLivemark_parentId_succeeds() {
- let onItemAddedCalled = false;
- PlacesUtils.bookmarks.addObserver({
- __proto__: NavBookmarkObserver.prototype,
- onItemAdded: function onItemAdded(aItemId, aParentId, aIndex, aItemType,
- aURI, aTitle)
- {
- onItemAddedCalled = true;
- PlacesUtils.bookmarks.removeObserver(this);
- do_check_eq(aParentId, PlacesUtils.unfiledBookmarksFolderId);
- do_check_eq(aIndex, 0);
- do_check_eq(aItemType, Ci.nsINavBookmarksService.TYPE_FOLDER);
- do_check_eq(aTitle, "test");
- }
- }, false);
-
- yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentId: PlacesUtils.unfiledBookmarksFolderId
- , feedURI: FEED_URI });
- do_check_true(onItemAddedCalled);
-});
-
-
-add_task(function* test_addLivemark_noSiteURI_succeeds() {
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- });
- do_check_true(livemark.id > 0);
- do_check_valid_places_guid(livemark.guid);
- do_check_eq(livemark.title, "test");
- do_check_eq(livemark.parentId, PlacesUtils.unfiledBookmarksFolderId);
- do_check_eq(livemark.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- do_check_true(livemark.feedURI.equals(FEED_URI));
- do_check_eq(livemark.siteURI, null);
- do_check_true(livemark.lastModified > 0);
- do_check_true(is_time_ordered(livemark.dateAdded, livemark.lastModified));
-
- let bookmark = yield PlacesUtils.bookmarks.fetch(livemark.guid);
- do_check_eq(livemark.index, bookmark.index);
- do_check_eq(livemark.dateAdded, bookmark.dateAdded * 1000);
-});
-
-add_task(function* test_addLivemark_succeeds() {
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- , siteURI: SITE_URI
- });
-
- do_check_true(livemark.id > 0);
- do_check_valid_places_guid(livemark.guid);
- do_check_eq(livemark.title, "test");
- do_check_eq(livemark.parentId, PlacesUtils.unfiledBookmarksFolderId);
- do_check_eq(livemark.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- do_check_true(livemark.feedURI.equals(FEED_URI));
- do_check_true(livemark.siteURI.equals(SITE_URI));
- do_check_true(PlacesUtils.annotations
- .itemHasAnnotation(livemark.id,
- PlacesUtils.LMANNO_FEEDURI));
- do_check_true(PlacesUtils.annotations
- .itemHasAnnotation(livemark.id,
- PlacesUtils.LMANNO_SITEURI));
-});
-
-add_task(function* test_addLivemark_bogusid_succeeds() {
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { id: 100 // Should be ignored.
- , title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- , siteURI: SITE_URI
- });
- do_check_true(livemark.id > 0);
- do_check_neq(livemark.id, 100);
-});
-
-add_task(function* test_addLivemark_bogusParentId_fails() {
- try {
- yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentId: 187
- , feedURI: FEED_URI
- });
- do_throw("Adding a livemark with a bogus parent should fail");
- } catch (ex) {}
-});
-
-add_task(function* test_addLivemark_bogusParentGuid_fails() {
- try {
- yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: "123456789012"
- , feedURI: FEED_URI
- });
- do_throw("Adding a livemark with a bogus parent should fail");
- } catch (ex) {}
-})
-
-add_task(function* test_addLivemark_intoLivemark_fails() {
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- });
-
- try {
- yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: livemark.guid
- , feedURI: FEED_URI
- });
- do_throw("Adding a livemark into a livemark should fail");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_addLivemark_forceGuid_succeeds() {
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- , guid: "1234567890AB"
- });
- do_check_eq(livemark.guid, "1234567890AB");
- do_check_guid_for_bookmark(livemark.id, "1234567890AB");
-});
-
-add_task(function* test_addLivemark_dateAdded_succeeds() {
- let dateAdded = new Date("2013-03-01T01:10:00") * 1000;
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- , dateAdded
- });
- do_check_eq(livemark.dateAdded, dateAdded);
-});
-
-add_task(function* test_addLivemark_lastModified_succeeds() {
- let now = Date.now() * 1000;
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- , lastModified: now
- });
- do_check_eq(livemark.dateAdded, now);
- do_check_eq(livemark.lastModified, now);
-});
-
-add_task(function* test_removeLivemark_emptyObject_throws() {
- try {
- yield PlacesUtils.livemarks.removeLivemark({});
- do_throw("Invoking removeLivemark with empty object should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_removeLivemark_noValidId_throws() {
- try {
- yield PlacesUtils.livemarks.removeLivemark({ id: -10, guid: "test"});
- do_throw("Invoking removeLivemark with no valid id should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_removeLivemark_nonExistent_fails() {
- try {
- yield PlacesUtils.livemarks.removeLivemark({ id: 1337 });
- do_throw("Removing a non-existent livemark should fail");
- }
- catch (ex) {
- }
-});
-
-add_task(function* test_removeLivemark_guid_succeeds() {
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- , guid: "234567890ABC"
- });
-
- do_check_eq(livemark.guid, "234567890ABC");
-
- yield PlacesUtils.livemarks.removeLivemark({
- id: 789, guid: "234567890ABC"
- });
-
- do_check_eq((yield PlacesUtils.bookmarks.fetch("234567890ABC")), null);
-});
-
-add_task(function* test_removeLivemark_id_succeeds() {
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- });
-
- yield PlacesUtils.livemarks.removeLivemark({ id: livemark.id });
-
- do_check_eq((yield PlacesUtils.bookmarks.fetch("234567890ABC")), null);
-});
-
-add_task(function* test_getLivemark_emptyObject_throws() {
- try {
- yield PlacesUtils.livemarks.getLivemark({});
- do_throw("Invoking getLivemark with empty object should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_getLivemark_noValidId_throws() {
- try {
- yield PlacesUtils.livemarks.getLivemark({ id: -10, guid: "test"});
- do_throw("Invoking getLivemark with no valid id should throw");
- } catch (ex) {
- do_check_eq(ex.result, Cr.NS_ERROR_INVALID_ARG);
- }
-});
-
-add_task(function* test_getLivemark_nonExistentId_fails() {
- try {
- yield PlacesUtils.livemarks.getLivemark({ id: 1234 });
- do_throw("getLivemark for a non existent id should fail");
- } catch (ex) {}
-});
-
-add_task(function* test_getLivemark_nonExistentGUID_fails() {
- try {
- yield PlacesUtils.livemarks.getLivemark({ guid: "34567890ABCD" });
- do_throw("getLivemark for a non-existent guid should fail");
- } catch (ex) {}
-});
-
-add_task(function* test_getLivemark_guid_succeeds() {
- yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- , guid: "34567890ABCD" });
-
- // invalid id to check the guid wins.
- let livemark =
- yield PlacesUtils.livemarks.getLivemark({ id: 789, guid: "34567890ABCD" });
-
- do_check_eq(livemark.title, "test");
- do_check_eq(livemark.parentId, PlacesUtils.unfiledBookmarksFolderId);
- do_check_eq(livemark.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- do_check_true(livemark.feedURI.equals(FEED_URI));
- do_check_eq(livemark.siteURI, null);
- do_check_eq(livemark.guid, "34567890ABCD");
-
- let bookmark = yield PlacesUtils.bookmarks.fetch("34567890ABCD");
- do_check_eq(livemark.index, bookmark.index);
-});
-
-add_task(function* test_getLivemark_id_succeeds() {
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- });
-
- livemark = yield PlacesUtils.livemarks.getLivemark({ id: livemark.id });
-
- do_check_eq(livemark.title, "test");
- do_check_eq(livemark.parentId, PlacesUtils.unfiledBookmarksFolderId);
- do_check_eq(livemark.parentGuid, PlacesUtils.bookmarks.unfiledGuid);
- do_check_true(livemark.feedURI.equals(FEED_URI));
- do_check_eq(livemark.siteURI, null);
- do_check_guid_for_bookmark(livemark.id, livemark.guid);
-
- let bookmark = yield PlacesUtils.bookmarks.fetch(livemark.guid);
- do_check_eq(livemark.index, bookmark.index);
-});
-
-add_task(function* test_getLivemark_removeItem_contention() {
- // do not yield.
- PlacesUtils.livemarks.addLivemark({ title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- }).catch(() => { /* swallow errors*/ });
- yield PlacesUtils.bookmarks.eraseEverything();
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- });
-
- livemark = yield PlacesUtils.livemarks.getLivemark({ guid: livemark.guid });
-
- do_check_eq(livemark.title, "test");
- do_check_eq(livemark.parentId, PlacesUtils.unfiledBookmarksFolderId);
- do_check_true(livemark.feedURI.equals(FEED_URI));
- do_check_eq(livemark.siteURI, null);
- do_check_guid_for_bookmark(livemark.id, livemark.guid);
-});
-
-add_task(function* test_title_change() {
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI
- });
-
- yield PlacesUtils.bookmarks.update({ guid: livemark.guid,
- title: "test2" });
- // Poll for the title change.
- while (true) {
- let lm = yield PlacesUtils.livemarks.getLivemark({ guid: livemark.guid });
- if (lm.title == "test2")
- break;
- yield new Promise(resolve => do_timeout(resolve, 100));
- }
-});
-
-add_task(function* test_livemark_move() {
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI } );
-
- yield PlacesUtils.bookmarks.update({ guid: livemark.guid,
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX });
- // Poll for the parent change.
- while (true) {
- let lm = yield PlacesUtils.livemarks.getLivemark({ guid: livemark.guid });
- if (lm.parentGuid == PlacesUtils.bookmarks.toolbarGuid)
- break;
- yield new Promise(resolve => do_timeout(resolve, 100));
- }
-});
-
-add_task(function* test_livemark_removed() {
- let livemark = yield PlacesUtils.livemarks.addLivemark(
- { title: "test"
- , parentGuid: PlacesUtils.bookmarks.unfiledGuid
- , feedURI: FEED_URI } );
-
- yield PlacesUtils.bookmarks.remove(livemark.guid);
- // Poll for the livemark removal.
- while (true) {
- try {
- yield PlacesUtils.livemarks.getLivemark({ guid: livemark.guid });
- } catch (ex) {
- break;
- }
- yield new Promise(resolve => do_timeout(resolve, 100));
- }
-});
diff --git a/toolkit/components/places/tests/unit/test_multi_queries.js b/toolkit/components/places/tests/unit/test_multi_queries.js
deleted file mode 100644
index d485355a5..000000000
--- a/toolkit/components/places/tests/unit/test_multi_queries.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Adds a test URI visit to history.
- *
- * @param aURI
- * The URI to add a visit for.
- * @param aReferrer
- * The referring URI for the given URI. This can be null.
- */
-function* add_visit(aURI, aDayOffset, aTransition) {
- yield PlacesTestUtils.addVisits({
- uri: aURI,
- transition: aTransition,
- visitDate: (Date.now() + aDayOffset*86400000) * 1000
- });
-}
-
-function run_test()
-{
- run_next_test();
-}
-
-add_task(function* test_execute()
-{
- yield add_visit(uri("http://mirror1.mozilla.com/a"), -1, TRANSITION_LINK);
- yield add_visit(uri("http://mirror2.mozilla.com/b"), -2, TRANSITION_LINK);
- yield add_visit(uri("http://mirror3.mozilla.com/c"), -4, TRANSITION_FRAMED_LINK);
- yield add_visit(uri("http://mirror1.google.com/b"), -1, TRANSITION_EMBED);
- yield add_visit(uri("http://mirror2.google.com/a"), -2, TRANSITION_LINK);
- yield add_visit(uri("http://mirror1.apache.org/b"), -3, TRANSITION_LINK);
- yield add_visit(uri("http://mirror2.apache.org/a"), -4, TRANSITION_FRAMED_LINK);
-
- let queries = [
- PlacesUtils.history.getNewQuery(),
- PlacesUtils.history.getNewQuery()
- ];
- queries[0].domain = "mozilla.com";
- queries[1].domain = "google.com";
-
- let root = PlacesUtils.history.executeQueries(
- queries, queries.length, PlacesUtils.history.getNewQueryOptions()
- ).root;
- root.containerOpen = true;
- let childCount = root.childCount;
- root.containerOpen = false;
-
- do_check_eq(childCount, 3);
-});
diff --git a/toolkit/components/places/tests/unit/test_multi_word_tags.js b/toolkit/components/places/tests/unit/test_multi_word_tags.js
deleted file mode 100644
index 6a0e5f130..000000000
--- a/toolkit/components/places/tests/unit/test_multi_word_tags.js
+++ /dev/null
@@ -1,150 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Get history service
-try {
- var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].
- getService(Ci.nsINavHistoryService);
-} catch (ex) {
- do_throw("Could not get history service\n");
-}
-
-// Get bookmark service
-try {
- var bmsvc = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
-}
-catch (ex) {
- do_throw("Could not get the nav-bookmarks-service\n");
-}
-
-// Get tagging service
-try {
- var tagssvc = Cc["@mozilla.org/browser/tagging-service;1"].
- getService(Ci.nsITaggingService);
-} catch (ex) {
- do_throw("Could not get tagging service\n");
-}
-
-// main
-function run_test() {
- var uri1 = uri("http://site.tld/1");
- var uri2 = uri("http://site.tld/2");
- var uri3 = uri("http://site.tld/3");
- var uri4 = uri("http://site.tld/4");
- var uri5 = uri("http://site.tld/5");
- var uri6 = uri("http://site.tld/6");
-
- bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, uri1, bmsvc.DEFAULT_INDEX, null);
- bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, uri2, bmsvc.DEFAULT_INDEX, null);
- bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, uri3, bmsvc.DEFAULT_INDEX, null);
- bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, uri4, bmsvc.DEFAULT_INDEX, null);
- bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, uri5, bmsvc.DEFAULT_INDEX, null);
- bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, uri6, bmsvc.DEFAULT_INDEX, null);
-
- tagssvc.tagURI(uri1, ["foo"]);
- tagssvc.tagURI(uri2, ["bar"]);
- tagssvc.tagURI(uri3, ["cheese"]);
- tagssvc.tagURI(uri4, ["foo bar"]);
- tagssvc.tagURI(uri5, ["bar cheese"]);
- tagssvc.tagURI(uri6, ["foo bar cheese"]);
-
- // exclude livemark items, search for "item", should get one result
- var options = histsvc.getNewQueryOptions();
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
-
- var query = histsvc.getNewQuery();
- query.searchTerms = "foo";
- var result = histsvc.executeQuery(query, options);
- var root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 3);
- do_check_eq(root.getChild(0).uri, "http://site.tld/1");
- do_check_eq(root.getChild(1).uri, "http://site.tld/4");
- do_check_eq(root.getChild(2).uri, "http://site.tld/6");
- root.containerOpen = false;
-
- query.searchTerms = "bar";
- result = histsvc.executeQuery(query, options);
- root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 4);
- do_check_eq(root.getChild(0).uri, "http://site.tld/2");
- do_check_eq(root.getChild(1).uri, "http://site.tld/4");
- do_check_eq(root.getChild(2).uri, "http://site.tld/5");
- do_check_eq(root.getChild(3).uri, "http://site.tld/6");
- root.containerOpen = false;
-
- query.searchTerms = "cheese";
- result = histsvc.executeQuery(query, options);
- root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 3);
- do_check_eq(root.getChild(0).uri, "http://site.tld/3");
- do_check_eq(root.getChild(1).uri, "http://site.tld/5");
- do_check_eq(root.getChild(2).uri, "http://site.tld/6");
- root.containerOpen = false;
-
- query.searchTerms = "foo bar";
- result = histsvc.executeQuery(query, options);
- root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 2);
- do_check_eq(root.getChild(0).uri, "http://site.tld/4");
- do_check_eq(root.getChild(1).uri, "http://site.tld/6");
- root.containerOpen = false;
-
- query.searchTerms = "bar foo";
- result = histsvc.executeQuery(query, options);
- root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 2);
- do_check_eq(root.getChild(0).uri, "http://site.tld/4");
- do_check_eq(root.getChild(1).uri, "http://site.tld/6");
- root.containerOpen = false;
-
- query.searchTerms = "bar cheese";
- result = histsvc.executeQuery(query, options);
- root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 2);
- do_check_eq(root.getChild(0).uri, "http://site.tld/5");
- do_check_eq(root.getChild(1).uri, "http://site.tld/6");
- root.containerOpen = false;
-
- query.searchTerms = "cheese bar";
- result = histsvc.executeQuery(query, options);
- root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 2);
- do_check_eq(root.getChild(0).uri, "http://site.tld/5");
- do_check_eq(root.getChild(1).uri, "http://site.tld/6");
- root.containerOpen = false;
-
- query.searchTerms = "foo bar cheese";
- result = histsvc.executeQuery(query, options);
- root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 1);
- do_check_eq(root.getChild(0).uri, "http://site.tld/6");
- root.containerOpen = false;
-
- query.searchTerms = "cheese foo bar";
- result = histsvc.executeQuery(query, options);
- root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 1);
- do_check_eq(root.getChild(0).uri, "http://site.tld/6");
- root.containerOpen = false;
-
- query.searchTerms = "cheese bar foo";
- result = histsvc.executeQuery(query, options);
- root = result.root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 1);
- do_check_eq(root.getChild(0).uri, "http://site.tld/6");
- root.containerOpen = false;
-}
diff --git a/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js b/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js
deleted file mode 100644
index 037ab7d08..000000000
--- a/toolkit/components/places/tests/unit/test_nsINavHistoryViewer.js
+++ /dev/null
@@ -1,256 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Get history service
-var histsvc = PlacesUtils.history;
-var bhist = PlacesUtils.bhistory;
-var bmsvc = PlacesUtils.bookmarks;
-
-var resultObserver = {
- insertedNode: null,
- nodeInserted: function(parent, node, newIndex) {
- this.insertedNode = node;
- },
- removedNode: null,
- nodeRemoved: function(parent, node, oldIndex) {
- this.removedNode = node;
- },
-
- nodeAnnotationChanged: function() {},
-
- newTitle: "",
- nodeChangedByTitle: null,
- nodeTitleChanged: function(node, newTitle) {
- this.nodeChangedByTitle = node;
- this.newTitle = newTitle;
- },
-
- newAccessCount: 0,
- newTime: 0,
- nodeChangedByHistoryDetails: null,
- nodeHistoryDetailsChanged: function(node,
- updatedVisitDate,
- updatedVisitCount) {
- this.nodeChangedByHistoryDetails = node
- this.newTime = updatedVisitDate;
- this.newAccessCount = updatedVisitCount;
- },
-
- movedNode: null,
- nodeMoved: function(node, oldParent, oldIndex, newParent, newIndex) {
- this.movedNode = node;
- },
- openedContainer: null,
- closedContainer: null,
- containerStateChanged: function (aNode, aOldState, aNewState) {
- if (aNewState == Ci.nsINavHistoryContainerResultNode.STATE_OPENED) {
- this.openedContainer = aNode;
- }
- else if (aNewState == Ci.nsINavHistoryContainerResultNode.STATE_CLOSED) {
- this.closedContainer = aNode;
- }
- },
- invalidatedContainer: null,
- invalidateContainer: function(node) {
- this.invalidatedContainer = node;
- },
- sortingMode: null,
- sortingChanged: function(sortingMode) {
- this.sortingMode = sortingMode;
- },
- inBatchMode: false,
- batching: function(aToggleMode) {
- do_check_neq(this.inBatchMode, aToggleMode);
- this.inBatchMode = aToggleMode;
- },
- result: null,
- reset: function() {
- this.insertedNode = null;
- this.removedNode = null;
- this.nodeChangedByTitle = null;
- this.nodeChangedByHistoryDetails = null;
- this.replacedNode = null;
- this.movedNode = null;
- this.openedContainer = null;
- this.closedContainer = null;
- this.invalidatedContainer = null;
- this.sortingMode = null;
- }
-};
-
-var testURI = uri("http://mozilla.com");
-
-function run_test() {
- run_next_test();
-}
-
-add_test(function check_history_query() {
- var options = histsvc.getNewQueryOptions();
- options.sortingMode = options.SORT_BY_DATE_DESCENDING;
- options.resultType = options.RESULTS_AS_VISIT;
- var query = histsvc.getNewQuery();
- var result = histsvc.executeQuery(query, options);
- result.addObserver(resultObserver, false);
- var root = result.root;
- root.containerOpen = true;
-
- do_check_neq(resultObserver.openedContainer, null);
-
- // nsINavHistoryResultObserver.nodeInserted
- // add a visit
- PlacesTestUtils.addVisits(testURI).then(function() {
- do_check_eq(testURI.spec, resultObserver.insertedNode.uri);
-
- // nsINavHistoryResultObserver.nodeHistoryDetailsChanged
- // adding a visit causes nodeHistoryDetailsChanged for the folder
- do_check_eq(root.uri, resultObserver.nodeChangedByHistoryDetails.uri);
-
- // nsINavHistoryResultObserver.itemTitleChanged for a leaf node
- PlacesTestUtils.addVisits({ uri: testURI, title: "baz" }).then(function () {
- do_check_eq(resultObserver.nodeChangedByTitle.title, "baz");
-
- // nsINavHistoryResultObserver.nodeRemoved
- var removedURI = uri("http://google.com");
- PlacesTestUtils.addVisits(removedURI).then(function() {
- bhist.removePage(removedURI);
- do_check_eq(removedURI.spec, resultObserver.removedNode.uri);
-
- // nsINavHistoryResultObserver.invalidateContainer
- bhist.removePagesFromHost("mozilla.com", false);
- do_check_eq(root.uri, resultObserver.invalidatedContainer.uri);
-
- // nsINavHistoryResultObserver.sortingChanged
- resultObserver.invalidatedContainer = null;
- result.sortingMode = options.SORT_BY_TITLE_ASCENDING;
- do_check_eq(resultObserver.sortingMode, options.SORT_BY_TITLE_ASCENDING);
- do_check_eq(resultObserver.invalidatedContainer, result.root);
-
- // nsINavHistoryResultObserver.invalidateContainer
- PlacesTestUtils.clearHistoryEnabled().then(() => {
- do_check_eq(root.uri, resultObserver.invalidatedContainer.uri);
-
- // nsINavHistoryResultObserver.batching
- do_check_false(resultObserver.inBatchMode);
- histsvc.runInBatchMode({
- runBatched: function (aUserData) {
- do_check_true(resultObserver.inBatchMode);
- }
- }, null);
- do_check_false(resultObserver.inBatchMode);
- bmsvc.runInBatchMode({
- runBatched: function (aUserData) {
- do_check_true(resultObserver.inBatchMode);
- }
- }, null);
- do_check_false(resultObserver.inBatchMode);
-
- root.containerOpen = false;
- do_check_eq(resultObserver.closedContainer, resultObserver.openedContainer);
- result.removeObserver(resultObserver);
- resultObserver.reset();
- PlacesTestUtils.promiseAsyncUpdates().then(run_next_test);
- });
- });
- });
- });
-});
-
-add_test(function check_bookmarks_query() {
- var options = histsvc.getNewQueryOptions();
- var query = histsvc.getNewQuery();
- query.setFolders([bmsvc.bookmarksMenuFolder], 1);
- var result = histsvc.executeQuery(query, options);
- result.addObserver(resultObserver, false);
- var root = result.root;
- root.containerOpen = true;
-
- do_check_neq(resultObserver.openedContainer, null);
-
- // nsINavHistoryResultObserver.nodeInserted
- // add a bookmark
- var testBookmark = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, testURI, bmsvc.DEFAULT_INDEX, "foo");
- do_check_eq("foo", resultObserver.insertedNode.title);
- do_check_eq(testURI.spec, resultObserver.insertedNode.uri);
-
- // nsINavHistoryResultObserver.nodeHistoryDetailsChanged
- // adding a visit causes nodeHistoryDetailsChanged for the folder
- do_check_eq(root.uri, resultObserver.nodeChangedByHistoryDetails.uri);
-
- // nsINavHistoryResultObserver.nodeTitleChanged for a leaf node
- bmsvc.setItemTitle(testBookmark, "baz");
- do_check_eq(resultObserver.nodeChangedByTitle.title, "baz");
- do_check_eq(resultObserver.newTitle, "baz");
-
- var testBookmark2 = bmsvc.insertBookmark(bmsvc.bookmarksMenuFolder, uri("http://google.com"), bmsvc.DEFAULT_INDEX, "foo");
- bmsvc.moveItem(testBookmark2, bmsvc.bookmarksMenuFolder, 0);
- do_check_eq(resultObserver.movedNode.itemId, testBookmark2);
-
- // nsINavHistoryResultObserver.nodeRemoved
- bmsvc.removeItem(testBookmark2);
- do_check_eq(testBookmark2, resultObserver.removedNode.itemId);
-
- // XXX nsINavHistoryResultObserver.invalidateContainer
-
- // nsINavHistoryResultObserver.sortingChanged
- resultObserver.invalidatedContainer = null;
- result.sortingMode = options.SORT_BY_TITLE_ASCENDING;
- do_check_eq(resultObserver.sortingMode, options.SORT_BY_TITLE_ASCENDING);
- do_check_eq(resultObserver.invalidatedContainer, result.root);
-
- // nsINavHistoryResultObserver.batching
- do_check_false(resultObserver.inBatchMode);
- histsvc.runInBatchMode({
- runBatched: function (aUserData) {
- do_check_true(resultObserver.inBatchMode);
- }
- }, null);
- do_check_false(resultObserver.inBatchMode);
- bmsvc.runInBatchMode({
- runBatched: function (aUserData) {
- do_check_true(resultObserver.inBatchMode);
- }
- }, null);
- do_check_false(resultObserver.inBatchMode);
-
- root.containerOpen = false;
- do_check_eq(resultObserver.closedContainer, resultObserver.openedContainer);
- result.removeObserver(resultObserver);
- resultObserver.reset();
- PlacesTestUtils.promiseAsyncUpdates().then(run_next_test);
-});
-
-add_test(function check_mixed_query() {
- var options = histsvc.getNewQueryOptions();
- var query = histsvc.getNewQuery();
- query.onlyBookmarked = true;
- var result = histsvc.executeQuery(query, options);
- result.addObserver(resultObserver, false);
- var root = result.root;
- root.containerOpen = true;
-
- do_check_neq(resultObserver.openedContainer, null);
-
- // nsINavHistoryResultObserver.batching
- do_check_false(resultObserver.inBatchMode);
- histsvc.runInBatchMode({
- runBatched: function (aUserData) {
- do_check_true(resultObserver.inBatchMode);
- }
- }, null);
- do_check_false(resultObserver.inBatchMode);
- bmsvc.runInBatchMode({
- runBatched: function (aUserData) {
- do_check_true(resultObserver.inBatchMode);
- }
- }, null);
- do_check_false(resultObserver.inBatchMode);
-
- root.containerOpen = false;
- do_check_eq(resultObserver.closedContainer, resultObserver.openedContainer);
- result.removeObserver(resultObserver);
- resultObserver.reset();
- PlacesTestUtils.promiseAsyncUpdates().then(run_next_test);
-});
diff --git a/toolkit/components/places/tests/unit/test_null_interfaces.js b/toolkit/components/places/tests/unit/test_null_interfaces.js
deleted file mode 100644
index 524837ca3..000000000
--- a/toolkit/components/places/tests/unit/test_null_interfaces.js
+++ /dev/null
@@ -1,98 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
-* License, v. 2.0. If a copy of the MPL was not distributed with this
-* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test bug 489872 to make sure passing nulls to nsNavHistory doesn't crash.
- */
-
-// Make an array of services to test, each specifying a class id, interface
-// and an array of function names that don't throw when passed nulls
-var testServices = [
- ["browser/nav-history-service;1",
- ["nsINavHistoryService"],
- ["queryStringToQueries", "removePagesByTimeframe", "removePagesFromHost", "getObservers"]
- ],
- ["browser/nav-bookmarks-service;1",
- ["nsINavBookmarksService", "nsINavHistoryObserver", "nsIAnnotationObserver"],
- ["createFolder", "getObservers", "onFrecencyChanged", "onTitleChanged",
- "onPageAnnotationSet", "onPageAnnotationRemoved", "onDeleteURI"]
- ],
- ["browser/livemark-service;2", ["mozIAsyncLivemarks"], ["reloadLivemarks"]],
- ["browser/annotation-service;1", ["nsIAnnotationService"], []],
- ["browser/favicon-service;1", ["nsIFaviconService"], []],
- ["browser/tagging-service;1", ["nsITaggingService"], []],
-];
-do_print(testServices.join("\n"));
-
-function run_test()
-{
- for (let [cid, ifaces, nothrow] of testServices) {
- do_print(`Running test with ${cid} ${ifaces.join(", ")} ${nothrow}`);
- let s = Cc["@mozilla.org/" + cid].getService(Ci.nsISupports);
- for (let iface of ifaces) {
- s.QueryInterface(Ci[iface]);
- }
-
- let okName = function(name) {
- do_print(`Checking if function is okay to test: ${name}`);
- let func = s[name];
-
- let mesg = "";
- if (typeof func != "function")
- mesg = "Not a function!";
- else if (func.length == 0)
- mesg = "No args needed!";
- else if (name == "QueryInterface")
- mesg = "Ignore QI!";
-
- if (mesg) {
- do_print(`${mesg} Skipping: ${name}`);
- return false;
- }
-
- return true;
- }
-
- do_print(`Generating an array of functions to test service: ${s}`);
- for (let n of Object.keys(s).filter(i => okName(i)).sort()) {
- do_print(`\nTesting ${ifaces.join(", ")} function with null args: ${n}`);
-
- let func = s[n];
- let num = func.length;
- do_print(`Generating array of nulls for #args: ${num}`);
- let args = Array(num).fill(null);
-
- let tryAgain = true;
- while (tryAgain == true) {
- try {
- do_print(`Calling with args: ${JSON.stringify(args)}`);
- func.apply(s, args);
-
- do_print(`The function did not throw! Is it one of the nothrow? ${nothrow}`);
- Assert.notEqual(nothrow.indexOf(n), -1);
-
- do_print("Must have been an expected nothrow, so no need to try again");
- tryAgain = false;
- }
- catch (ex) {
- if (ex.result == Cr.NS_ERROR_ILLEGAL_VALUE) {
- do_print(`Caught an expected exception: ${ex.name}`);
- do_print("Moving on to the next test..");
- tryAgain = false;
- } else if (ex.result == Cr.NS_ERROR_XPC_NEED_OUT_OBJECT) {
- let pos = Number(ex.message.match(/object arg (\d+)/)[1]);
- do_print(`Function call expects an out object at ${pos}`);
- args[pos] = {};
- } else if (ex.result == Cr.NS_ERROR_NOT_IMPLEMENTED) {
- do_print(`Method not implemented exception: ${ex.name}`);
- do_print("Moving on to the next test..");
- tryAgain = false;
- } else {
- throw ex;
- }
- }
- }
- }
- }
-}
diff --git a/toolkit/components/places/tests/unit/test_onItemChanged_tags.js b/toolkit/components/places/tests/unit/test_onItemChanged_tags.js
deleted file mode 100644
index 7a0eb354d..000000000
--- a/toolkit/components/places/tests/unit/test_onItemChanged_tags.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// This test checks that changing a tag for a bookmark with multiple tags
-// notifies OnItemChanged("tags") only once, and not once per tag.
-
-function run_test() {
- do_test_pending();
-
- let tags = ["a", "b", "c"];
- let uri = NetUtil.newURI("http://1.moz.org/");
-
- let id = PlacesUtils.bookmarks.insertBookmark(
- PlacesUtils.unfiledBookmarksFolderId, uri,
- PlacesUtils.bookmarks.DEFAULT_INDEX, "Bookmark 1"
- );
- PlacesUtils.tagging.tagURI(uri, tags);
-
- let bookmarksObserver = {
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsINavBookmarkObserver
- ]),
-
- _changedCount: 0,
- onItemChanged: function (aItemId, aProperty, aIsAnnotationProperty, aValue,
- aLastModified, aItemType) {
- if (aProperty == "tags") {
- do_check_eq(aItemId, id);
- this._changedCount++;
- }
- },
-
- onItemRemoved: function (aItemId, aParentId, aIndex, aItemType) {
- if (aItemId == id) {
- PlacesUtils.bookmarks.removeObserver(this);
- do_check_eq(this._changedCount, 2);
- do_test_finished();
- }
- },
-
- onItemAdded: function () {},
- onBeginUpdateBatch: function () {},
- onEndUpdateBatch: function () {},
- onItemVisited: function () {},
- onItemMoved: function () {},
- };
- PlacesUtils.bookmarks.addObserver(bookmarksObserver, false);
-
- PlacesUtils.tagging.tagURI(uri, ["d"]);
- PlacesUtils.tagging.tagURI(uri, ["e"]);
- PlacesUtils.bookmarks.removeItem(id);
-}
diff --git a/toolkit/components/places/tests/unit/test_pageGuid_bookmarkGuid.js b/toolkit/components/places/tests/unit/test_pageGuid_bookmarkGuid.js
deleted file mode 100644
index f6131b211..000000000
--- a/toolkit/components/places/tests/unit/test_pageGuid_bookmarkGuid.js
+++ /dev/null
@@ -1,179 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const bmsvc = PlacesUtils.bookmarks;
-const histsvc = PlacesUtils.history;
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_addBookmarksAndCheckGuids() {
- let folder = bmsvc.createFolder(bmsvc.placesRoot, "test folder", bmsvc.DEFAULT_INDEX);
- bmsvc.insertBookmark(folder, uri("http://test1.com/"),
- bmsvc.DEFAULT_INDEX, "1 title");
- bmsvc.insertBookmark(folder, uri("http://test2.com/"),
- bmsvc.DEFAULT_INDEX, "2 title");
- bmsvc.insertBookmark(folder, uri("http://test3.com/"),
- bmsvc.DEFAULT_INDEX, "3 title");
- bmsvc.insertSeparator(folder, bmsvc.DEFAULT_INDEX);
- bmsvc.createFolder(folder, "test folder 2", bmsvc.DEFAULT_INDEX);
-
- let root = PlacesUtils.getFolderContents(folder).root;
- do_check_eq(root.childCount, 5);
-
- // check bookmark guids
- let bookmarkGuidZero = root.getChild(0).bookmarkGuid;
- do_check_eq(bookmarkGuidZero.length, 12);
- // bookmarks have bookmark guids
- do_check_eq(root.getChild(1).bookmarkGuid.length, 12);
- do_check_eq(root.getChild(2).bookmarkGuid.length, 12);
- // separator has bookmark guid
- do_check_eq(root.getChild(3).bookmarkGuid.length, 12);
- // folder has bookmark guid
- do_check_eq(root.getChild(4).bookmarkGuid.length, 12);
- // all bookmark guids are different.
- do_check_neq(bookmarkGuidZero, root.getChild(1).bookmarkGuid);
- do_check_neq(root.getChild(1).bookmarkGuid, root.getChild(2).bookmarkGuid);
- do_check_neq(root.getChild(2).bookmarkGuid, root.getChild(3).bookmarkGuid);
- do_check_neq(root.getChild(3).bookmarkGuid, root.getChild(4).bookmarkGuid);
-
- // check page guids
- let pageGuidZero = root.getChild(0).pageGuid;
- do_check_eq(pageGuidZero.length, 12);
- // bookmarks have page guids
- do_check_eq(root.getChild(1).pageGuid.length, 12);
- do_check_eq(root.getChild(2).pageGuid.length, 12);
- // folder and separator don't have page guids
- do_check_eq(root.getChild(3).pageGuid, "");
- do_check_eq(root.getChild(4).pageGuid, "");
-
- do_check_neq(pageGuidZero, root.getChild(1).pageGuid);
- do_check_neq(root.getChild(1).pageGuid, root.getChild(2).pageGuid);
-
- root.containerOpen = false;
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_updateBookmarksAndCheckGuids() {
- let folder = bmsvc.createFolder(bmsvc.placesRoot, "test folder", bmsvc.DEFAULT_INDEX);
- let b1 = bmsvc.insertBookmark(folder, uri("http://test1.com/"),
- bmsvc.DEFAULT_INDEX, "1 title");
- let f1 = bmsvc.createFolder(folder, "test folder 2", bmsvc.DEFAULT_INDEX);
-
- let root = PlacesUtils.getFolderContents(folder).root;
- do_check_eq(root.childCount, 2);
-
- // ensure the bookmark and page guids remain the same after modifing other property.
- let bookmarkGuidZero = root.getChild(0).bookmarkGuid;
- let pageGuidZero = root.getChild(0).pageGuid;
- bmsvc.setItemTitle(b1, "1 title mod");
- do_check_eq(root.getChild(0).title, "1 title mod");
- do_check_eq(root.getChild(0).bookmarkGuid, bookmarkGuidZero);
- do_check_eq(root.getChild(0).pageGuid, pageGuidZero);
-
- let bookmarkGuidOne = root.getChild(1).bookmarkGuid;
- let pageGuidOne = root.getChild(1).pageGuid;
- bmsvc.setItemTitle(f1, "test foolder 234");
- do_check_eq(root.getChild(1).title, "test foolder 234");
- do_check_eq(root.getChild(1).bookmarkGuid, bookmarkGuidOne);
- do_check_eq(root.getChild(1).pageGuid, pageGuidOne);
-
- root.containerOpen = false;
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_addVisitAndCheckGuid() {
- // add a visit and test page guid and non-existing bookmark guids.
- let sourceURI = uri("http://test4.com/");
- yield PlacesTestUtils.addVisits({ uri: sourceURI });
- do_check_eq(bmsvc.getBookmarkedURIFor(sourceURI), null);
-
- let options = histsvc.getNewQueryOptions();
- let query = histsvc.getNewQuery();
- query.uri = sourceURI;
- let root = histsvc.executeQuery(query, options).root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 1);
-
- do_check_valid_places_guid(root.getChild(0).pageGuid);
- do_check_eq(root.getChild(0).bookmarkGuid, "");
- root.containerOpen = false;
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_addItemsWithInvalidGUIDsFails() {
- const INVALID_GUID = "XYZ";
- try {
- bmsvc.createFolder(bmsvc.placesRoot, "XYZ folder",
- bmsvc.DEFAULT_INDEX, INVALID_GUID);
- do_throw("Adding a folder with an invalid guid should fail");
- }
- catch (ex) { }
-
- let folder = bmsvc.createFolder(bmsvc.placesRoot, "test folder",
- bmsvc.DEFAULT_INDEX);
- try {
- bmsvc.insertBookmark(folder, uri("http://test.tld"), bmsvc.DEFAULT_INDEX,
- "title", INVALID_GUID);
- do_throw("Adding a bookmark with an invalid guid should fail");
- }
- catch (ex) { }
-
- try {
- bmsvc.insertSeparator(folder, bmsvc.DEFAULT_INDEX, INVALID_GUID);
- do_throw("Adding a separator with an invalid guid should fail");
- }
- catch (ex) { }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_addItemsWithGUIDs() {
- const FOLDER_GUID = "FOLDER--GUID";
- const BOOKMARK_GUID = "BM------GUID";
- const SEPARATOR_GUID = "SEP-----GUID";
-
- let folder = bmsvc.createFolder(bmsvc.placesRoot, "test folder",
- bmsvc.DEFAULT_INDEX, FOLDER_GUID);
- bmsvc.insertBookmark(folder, uri("http://test1.com/"), bmsvc.DEFAULT_INDEX,
- "1 title", BOOKMARK_GUID);
- bmsvc.insertSeparator(folder, bmsvc.DEFAULT_INDEX, SEPARATOR_GUID);
-
- let root = PlacesUtils.getFolderContents(folder).root;
- do_check_eq(root.childCount, 2);
- do_check_eq(root.bookmarkGuid, FOLDER_GUID);
- do_check_eq(root.getChild(0).bookmarkGuid, BOOKMARK_GUID);
- do_check_eq(root.getChild(1).bookmarkGuid, SEPARATOR_GUID);
-
- root.containerOpen = false;
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_emptyGUIDIgnored() {
- let folder = bmsvc.createFolder(bmsvc.placesRoot, "test folder",
- bmsvc.DEFAULT_INDEX, "");
- do_check_valid_places_guid(PlacesUtils.getFolderContents(folder)
- .root.bookmarkGuid);
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_usingSameGUIDFails() {
- const GUID = "XYZXYZXYZXYZ";
- bmsvc.createFolder(bmsvc.placesRoot, "test folder",
- bmsvc.DEFAULT_INDEX, GUID);
- try {
- bmsvc.createFolder(bmsvc.placesRoot, "test folder 2",
- bmsvc.DEFAULT_INDEX, GUID);
- do_throw("Using the same guid twice should fail");
- }
- catch (ex) { }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
diff --git a/toolkit/components/places/tests/unit/test_placeURIs.js b/toolkit/components/places/tests/unit/test_placeURIs.js
deleted file mode 100644
index 0f585ca51..000000000
--- a/toolkit/components/places/tests/unit/test_placeURIs.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-
-// Get history service
-try {
- var histsvc = Cc["@mozilla.org/browser/nav-history-service;1"].getService(Ci.nsINavHistoryService);
-} catch (ex) {
- do_throw("Could not get history service\n");
-}
-
-// main
-function run_test() {
- // XXX Full testing coverage for QueriesToQueryString and
- // QueryStringToQueries
-
- var bs = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
- getService(Ci.nsINavBookmarksService);
- const NHQO = Ci.nsINavHistoryQueryOptions;
- // Bug 376798
- var query = histsvc.getNewQuery();
- query.setFolders([bs.placesRoot], 1);
- do_check_eq(histsvc.queriesToQueryString([query], 1, histsvc.getNewQueryOptions()),
- "place:folder=PLACES_ROOT");
-
- // Bug 378828
- var options = histsvc.getNewQueryOptions();
- options.sortingAnnotation = "test anno";
- options.sortingMode = NHQO.SORT_BY_ANNOTATION_DESCENDING;
- var placeURI =
- "place:folder=PLACES_ROOT&sort=" + NHQO.SORT_BY_ANNOTATION_DESCENDING +
- "&sortingAnnotation=test%20anno";
- do_check_eq(histsvc.queriesToQueryString([query], 1, options),
- placeURI);
- options = {};
- histsvc.queryStringToQueries(placeURI, { }, {}, options);
- do_check_eq(options.value.sortingAnnotation, "test anno");
- do_check_eq(options.value.sortingMode, NHQO.SORT_BY_ANNOTATION_DESCENDING);
-}
diff --git a/toolkit/components/places/tests/unit/test_placesTxn.js b/toolkit/components/places/tests/unit/test_placesTxn.js
deleted file mode 100644
index 3cc9809bb..000000000
--- a/toolkit/components/places/tests/unit/test_placesTxn.js
+++ /dev/null
@@ -1,937 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var bmsvc = PlacesUtils.bookmarks;
-var tagssvc = PlacesUtils.tagging;
-var annosvc = PlacesUtils.annotations;
-var txnManager = PlacesUtils.transactionManager;
-const DESCRIPTION_ANNO = "bookmarkProperties/description";
-
-function* promiseKeyword(keyword, href, postData) {
- while (true) {
- let entry = yield PlacesUtils.keywords.fetch(keyword);
- if (href == null && !entry)
- break;
- if (entry && entry.url.href == href && entry.postData == postData) {
- break;
- }
-
- yield new Promise(resolve => do_timeout(100, resolve));
- }
-}
-
-// create and add bookmarks observer
-var observer = {
-
- onBeginUpdateBatch: function() {
- this._beginUpdateBatch = true;
- },
- _beginUpdateBatch: false,
-
- onEndUpdateBatch: function() {
- this._endUpdateBatch = true;
- },
- _endUpdateBatch: false,
-
- onItemAdded: function(id, folder, index, itemType, uri) {
- this._itemAddedId = id;
- this._itemAddedParent = folder;
- this._itemAddedIndex = index;
- this._itemAddedType = itemType;
- },
- _itemAddedId: null,
- _itemAddedParent: null,
- _itemAddedIndex: null,
- _itemAddedType: null,
-
- onItemRemoved: function(id, folder, index, itemType) {
- this._itemRemovedId = id;
- this._itemRemovedFolder = folder;
- this._itemRemovedIndex = index;
- },
- _itemRemovedId: null,
- _itemRemovedFolder: null,
- _itemRemovedIndex: null,
-
- onItemChanged: function(id, property, isAnnotationProperty, newValue,
- lastModified, itemType) {
- // The transaction manager is being rewritten in bug 891303, so just
- // skip checking this for now.
- if (property == "tags")
- return;
- this._itemChangedId = id;
- this._itemChangedProperty = property;
- this._itemChanged_isAnnotationProperty = isAnnotationProperty;
- this._itemChangedValue = newValue;
- },
- _itemChangedId: null,
- _itemChangedProperty: null,
- _itemChanged_isAnnotationProperty: null,
- _itemChangedValue: null,
-
- onItemVisited: function(id, visitID, time) {
- this._itemVisitedId = id;
- this._itemVisitedVistId = visitID;
- this._itemVisitedTime = time;
- },
- _itemVisitedId: null,
- _itemVisitedVistId: null,
- _itemVisitedTime: null,
-
- onItemMoved: function(id, oldParent, oldIndex, newParent, newIndex,
- itemType) {
- this._itemMovedId = id;
- this._itemMovedOldParent = oldParent;
- this._itemMovedOldIndex = oldIndex;
- this._itemMovedNewParent = newParent;
- this._itemMovedNewIndex = newIndex;
- },
- _itemMovedId: null,
- _itemMovedOldParent: null,
- _itemMovedOldIndex: null,
- _itemMovedNewParent: null,
- _itemMovedNewIndex: null,
-
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsINavBookmarkObserver) ||
- iid.equals(Ci.nsISupports)) {
- return this;
- }
- throw Cr.NS_ERROR_NO_INTERFACE;
- }
-};
-
-// index at which items should begin
-var bmStartIndex = 0;
-
-// get bookmarks root id
-var root = PlacesUtils.bookmarksMenuFolderId;
-
-add_task(function* init() {
- bmsvc.addObserver(observer, false);
- do_register_cleanup(function () {
- bmsvc.removeObserver(observer);
- });
-});
-
-add_task(function* test_create_folder_with_description() {
- const TEST_FOLDERNAME = "Test creating a folder with a description";
- const TEST_DESCRIPTION = "this is my test description";
-
- let annos = [{ name: DESCRIPTION_ANNO,
- type: annosvc.TYPE_STRING,
- flags: 0,
- value: TEST_DESCRIPTION,
- expires: annosvc.EXPIRE_NEVER }];
- let txn = new PlacesCreateFolderTransaction(TEST_FOLDERNAME, root, bmStartIndex, annos);
- txnManager.doTransaction(txn);
-
- // This checks that calling undoTransaction on an "empty batch" doesn't
- // undo the previous transaction (getItemTitle will fail)
- txnManager.beginBatch(null);
- txnManager.endBatch(false);
- txnManager.undoTransaction();
-
- let folderId = observer._itemAddedId;
- do_check_eq(bmsvc.getItemTitle(folderId), TEST_FOLDERNAME);
- do_check_eq(observer._itemAddedIndex, bmStartIndex);
- do_check_eq(observer._itemAddedParent, root);
- do_check_eq(observer._itemAddedId, folderId);
- do_check_eq(TEST_DESCRIPTION, annosvc.getItemAnnotation(folderId, DESCRIPTION_ANNO));
-
- txn.undoTransaction();
- do_check_eq(observer._itemRemovedId, folderId);
- do_check_eq(observer._itemRemovedFolder, root);
- do_check_eq(observer._itemRemovedIndex, bmStartIndex);
-
- txn.redoTransaction();
- do_check_eq(observer._itemAddedIndex, bmStartIndex);
- do_check_eq(observer._itemAddedParent, root);
- do_check_eq(observer._itemAddedId, folderId);
-
- txn.undoTransaction();
- do_check_eq(observer._itemRemovedId, folderId);
- do_check_eq(observer._itemRemovedFolder, root);
- do_check_eq(observer._itemRemovedIndex, bmStartIndex);
-});
-
-add_task(function* test_create_item() {
- let testURI = NetUtil.newURI("http://test_create_item.com");
-
- let txn = new PlacesCreateBookmarkTransaction(testURI, root, bmStartIndex,
- "Test creating an item");
-
- txnManager.doTransaction(txn);
- let id = bmsvc.getBookmarkIdsForURI(testURI)[0];
- do_check_eq(observer._itemAddedId, id);
- do_check_eq(observer._itemAddedIndex, bmStartIndex);
- do_check_true(bmsvc.isBookmarked(testURI));
-
- txn.undoTransaction();
- do_check_eq(observer._itemRemovedId, id);
- do_check_eq(observer._itemRemovedIndex, bmStartIndex);
- do_check_false(bmsvc.isBookmarked(testURI));
-
- txn.redoTransaction();
- do_check_true(bmsvc.isBookmarked(testURI));
- let newId = bmsvc.getBookmarkIdsForURI(testURI)[0];
- do_check_eq(observer._itemAddedIndex, bmStartIndex);
- do_check_eq(observer._itemAddedParent, root);
- do_check_eq(observer._itemAddedId, newId);
-
- txn.undoTransaction();
- do_check_eq(observer._itemRemovedId, newId);
- do_check_eq(observer._itemRemovedFolder, root);
- do_check_eq(observer._itemRemovedIndex, bmStartIndex);
-});
-
-add_task(function* test_create_item_to_folder() {
- const TEST_FOLDERNAME = "Test creating item to a folder";
- let testURI = NetUtil.newURI("http://test_create_item_to_folder.com");
- let folderId = bmsvc.createFolder(root, TEST_FOLDERNAME, bmsvc.DEFAULT_INDEX);
-
- let txn = new PlacesCreateBookmarkTransaction(testURI, folderId, bmStartIndex,
- "Test creating item");
- txnManager.doTransaction(txn);
- let bkmId = bmsvc.getBookmarkIdsForURI(testURI)[0];
- do_check_eq(observer._itemAddedId, bkmId);
- do_check_eq(observer._itemAddedIndex, bmStartIndex);
- do_check_true(bmsvc.isBookmarked(testURI));
-
- txn.undoTransaction();
- do_check_eq(observer._itemRemovedId, bkmId);
- do_check_eq(observer._itemRemovedIndex, bmStartIndex);
-
- txn.redoTransaction();
- let newBkmId = bmsvc.getBookmarkIdsForURI(testURI)[0];
- do_check_eq(observer._itemAddedIndex, bmStartIndex);
- do_check_eq(observer._itemAddedParent, folderId);
- do_check_eq(observer._itemAddedId, newBkmId);
-
- txn.undoTransaction();
- do_check_eq(observer._itemRemovedId, newBkmId);
- do_check_eq(observer._itemRemovedFolder, folderId);
- do_check_eq(observer._itemRemovedIndex, bmStartIndex);
-});
-
-add_task(function* test_move_items_to_folder() {
- let testFolderId = bmsvc.createFolder(root, "Test move items", bmsvc.DEFAULT_INDEX);
- let testURI = NetUtil.newURI("http://test_move_items.com");
- let testBkmId = bmsvc.insertBookmark(testFolderId, testURI, bmsvc.DEFAULT_INDEX, "1: Test move items");
- bmsvc.insertBookmark(testFolderId, testURI, bmsvc.DEFAULT_INDEX, "2: Test move items");
-
- // Moving items between the same folder
- let sameTxn = new PlacesMoveItemTransaction(testBkmId, testFolderId, bmsvc.DEFAULT_INDEX);
-
- sameTxn.doTransaction();
- do_check_eq(observer._itemMovedId, testBkmId);
- do_check_eq(observer._itemMovedOldParent, testFolderId);
- do_check_eq(observer._itemMovedOldIndex, 0);
- do_check_eq(observer._itemMovedNewParent, testFolderId);
- do_check_eq(observer._itemMovedNewIndex, 1);
-
- sameTxn.undoTransaction();
- do_check_eq(observer._itemMovedId, testBkmId);
- do_check_eq(observer._itemMovedOldParent, testFolderId);
- do_check_eq(observer._itemMovedOldIndex, 1);
- do_check_eq(observer._itemMovedNewParent, testFolderId);
- do_check_eq(observer._itemMovedNewIndex, 0);
-
- sameTxn.redoTransaction();
- do_check_eq(observer._itemMovedId, testBkmId);
- do_check_eq(observer._itemMovedOldParent, testFolderId);
- do_check_eq(observer._itemMovedOldIndex, 0);
- do_check_eq(observer._itemMovedNewParent, testFolderId);
- do_check_eq(observer._itemMovedNewIndex, 1);
-
- sameTxn.undoTransaction();
- do_check_eq(observer._itemMovedId, testBkmId);
- do_check_eq(observer._itemMovedOldParent, testFolderId);
- do_check_eq(observer._itemMovedOldIndex, 1);
- do_check_eq(observer._itemMovedNewParent, testFolderId);
- do_check_eq(observer._itemMovedNewIndex, 0);
-
- // Moving items between different folders
- let folderId = bmsvc.createFolder(testFolderId,
- "Test move items between different folders",
- bmsvc.DEFAULT_INDEX);
- let diffTxn = new PlacesMoveItemTransaction(testBkmId, folderId, bmsvc.DEFAULT_INDEX);
-
- diffTxn.doTransaction();
- do_check_eq(observer._itemMovedId, testBkmId);
- do_check_eq(observer._itemMovedOldParent, testFolderId);
- do_check_eq(observer._itemMovedOldIndex, 0);
- do_check_eq(observer._itemMovedNewParent, folderId);
- do_check_eq(observer._itemMovedNewIndex, 0);
-
- sameTxn.undoTransaction();
- do_check_eq(observer._itemMovedId, testBkmId);
- do_check_eq(observer._itemMovedOldParent, folderId);
- do_check_eq(observer._itemMovedOldIndex, 0);
- do_check_eq(observer._itemMovedNewParent, testFolderId);
- do_check_eq(observer._itemMovedNewIndex, 0);
-
- diffTxn.redoTransaction();
- do_check_eq(observer._itemMovedId, testBkmId);
- do_check_eq(observer._itemMovedOldParent, testFolderId);
- do_check_eq(observer._itemMovedOldIndex, 0);
- do_check_eq(observer._itemMovedNewParent, folderId);
- do_check_eq(observer._itemMovedNewIndex, 0);
-
- sameTxn.undoTransaction();
- do_check_eq(observer._itemMovedId, testBkmId);
- do_check_eq(observer._itemMovedOldParent, folderId);
- do_check_eq(observer._itemMovedOldIndex, 0);
- do_check_eq(observer._itemMovedNewParent, testFolderId);
- do_check_eq(observer._itemMovedNewIndex, 0);
-});
-
-add_task(function* test_remove_folder() {
- let testFolder = bmsvc.createFolder(root, "Test Removing a Folder", bmsvc.DEFAULT_INDEX);
- let folderId = bmsvc.createFolder(testFolder, "Removed Folder", bmsvc.DEFAULT_INDEX);
-
- let txn = new PlacesRemoveItemTransaction(folderId);
-
- txn.doTransaction();
- do_check_eq(observer._itemRemovedId, folderId);
- do_check_eq(observer._itemRemovedFolder, testFolder);
- do_check_eq(observer._itemRemovedIndex, 0);
-
- txn.undoTransaction();
- do_check_eq(observer._itemAddedId, folderId);
- do_check_eq(observer._itemAddedParent, testFolder);
- do_check_eq(observer._itemAddedIndex, 0);
-
- txn.redoTransaction();
- do_check_eq(observer._itemRemovedId, folderId);
- do_check_eq(observer._itemRemovedFolder, testFolder);
- do_check_eq(observer._itemRemovedIndex, 0);
-
- txn.undoTransaction();
- do_check_eq(observer._itemAddedId, folderId);
- do_check_eq(observer._itemAddedParent, testFolder);
- do_check_eq(observer._itemAddedIndex, 0);
-});
-
-add_task(function* test_remove_item_with_tag() {
- // Notice in this case the tag persists since other bookmarks have same uri.
- let testFolder = bmsvc.createFolder(root, "Test removing an item with a tag",
- bmsvc.DEFAULT_INDEX);
-
- const TAG_NAME = "tag-test_remove_item_with_tag";
- let testURI = NetUtil.newURI("http://test_remove_item_with_tag.com");
- let testBkmId = bmsvc.insertBookmark(testFolder, testURI, bmsvc.DEFAULT_INDEX, "test-item1");
-
- // create bookmark for not removing tag.
- bmsvc.insertBookmark(testFolder, testURI, bmsvc.DEFAULT_INDEX, "test-item2");
-
- // set tag
- tagssvc.tagURI(testURI, [TAG_NAME]);
-
- let txn = new PlacesRemoveItemTransaction(testBkmId);
-
- txn.doTransaction();
- do_check_eq(observer._itemRemovedId, testBkmId);
- do_check_eq(observer._itemRemovedFolder, testFolder);
- do_check_eq(observer._itemRemovedIndex, 0);
- do_check_eq(tagssvc.getTagsForURI(testURI), TAG_NAME);
-
- txn.undoTransaction();
- let newbkmk2Id = observer._itemAddedId;
- do_check_eq(observer._itemAddedParent, testFolder);
- do_check_eq(observer._itemAddedIndex, 0);
- do_check_eq(tagssvc.getTagsForURI(testURI)[0], TAG_NAME);
-
- txn.redoTransaction();
- do_check_eq(observer._itemRemovedId, newbkmk2Id);
- do_check_eq(observer._itemRemovedFolder, testFolder);
- do_check_eq(observer._itemRemovedIndex, 0);
- do_check_eq(tagssvc.getTagsForURI(testURI)[0], TAG_NAME);
-
- txn.undoTransaction();
- do_check_eq(observer._itemAddedParent, testFolder);
- do_check_eq(observer._itemAddedIndex, 0);
- do_check_eq(tagssvc.getTagsForURI(testURI)[0], TAG_NAME);
-});
-
-add_task(function* test_remove_item_with_keyword() {
- // Notice in this case the tag persists since other bookmarks have same uri.
- let testFolder = bmsvc.createFolder(root, "Test removing an item with a keyword",
- bmsvc.DEFAULT_INDEX);
-
- const KEYWORD = "test: test removing an item with a keyword";
- let testURI = NetUtil.newURI("http://test_remove_item_with_keyword.com");
- let testBkmId = bmsvc.insertBookmark(testFolder, testURI, bmsvc.DEFAULT_INDEX, "test-item1");
-
- // set keyword
- yield PlacesUtils.keywords.insert({ url: testURI.spec, keyword: KEYWORD});
-
- let txn = new PlacesRemoveItemTransaction(testBkmId);
-
- txn.doTransaction();
- do_check_eq(observer._itemRemovedId, testBkmId);
- do_check_eq(observer._itemRemovedFolder, testFolder);
- do_check_eq(observer._itemRemovedIndex, 0);
- yield promiseKeyword(KEYWORD, null);
-
- txn.undoTransaction();
- let newbkmk2Id = observer._itemAddedId;
- do_check_eq(observer._itemAddedParent, testFolder);
- do_check_eq(observer._itemAddedIndex, 0);
- yield promiseKeyword(KEYWORD, testURI.spec);
-
- txn.redoTransaction();
- do_check_eq(observer._itemRemovedId, newbkmk2Id);
- do_check_eq(observer._itemRemovedFolder, testFolder);
- do_check_eq(observer._itemRemovedIndex, 0);
- yield promiseKeyword(KEYWORD, null);
-
- txn.undoTransaction();
- do_check_eq(observer._itemAddedParent, testFolder);
- do_check_eq(observer._itemAddedIndex, 0);
-});
-
-add_task(function* test_creating_separator() {
- let testFolder = bmsvc.createFolder(root, "Test creating a separator", bmsvc.DEFAULT_INDEX);
-
- let txn = new PlacesCreateSeparatorTransaction(testFolder, 0);
- txn.doTransaction();
-
- let sepId = observer._itemAddedId;
- do_check_eq(observer._itemAddedIndex, 0);
- do_check_eq(observer._itemAddedParent, testFolder);
-
- txn.undoTransaction();
- do_check_eq(observer._itemRemovedId, sepId);
- do_check_eq(observer._itemRemovedFolder, testFolder);
- do_check_eq(observer._itemRemovedIndex, 0);
-
- txn.redoTransaction();
- let newSepId = observer._itemAddedId;
- do_check_eq(observer._itemAddedIndex, 0);
- do_check_eq(observer._itemAddedParent, testFolder);
-
- txn.undoTransaction();
- do_check_eq(observer._itemRemovedId, newSepId);
- do_check_eq(observer._itemRemovedFolder, testFolder);
- do_check_eq(observer._itemRemovedIndex, 0);
-});
-
-add_task(function* test_removing_separator() {
- let testFolder = bmsvc.createFolder(root, "Test removing a separator", bmsvc.DEFAULT_INDEX);
-
- let sepId = bmsvc.insertSeparator(testFolder, 0);
- let txn = new PlacesRemoveItemTransaction(sepId);
-
- txn.doTransaction();
- do_check_eq(observer._itemRemovedId, sepId);
- do_check_eq(observer._itemRemovedFolder, testFolder);
- do_check_eq(observer._itemRemovedIndex, 0);
-
- txn.undoTransaction();
- do_check_eq(observer._itemAddedId, sepId); // New separator created
- do_check_eq(observer._itemAddedParent, testFolder);
- do_check_eq(observer._itemAddedIndex, 0);
-
- txn.redoTransaction();
- do_check_eq(observer._itemRemovedId, sepId);
- do_check_eq(observer._itemRemovedFolder, testFolder);
- do_check_eq(observer._itemRemovedIndex, 0);
-
- txn.undoTransaction();
- do_check_eq(observer._itemAddedId, sepId); // New separator created
- do_check_eq(observer._itemAddedParent, testFolder);
- do_check_eq(observer._itemAddedIndex, 0);
-});
-
-add_task(function* test_editing_item_title() {
- const TITLE = "Test editing item title";
- const MOD_TITLE = "Mod: Test editing item title";
- let testURI = NetUtil.newURI("http://www.test_editing_item_title.com");
- let testBkmId = bmsvc.insertBookmark(root, testURI, bmsvc.DEFAULT_INDEX, TITLE);
-
- let txn = new PlacesEditItemTitleTransaction(testBkmId, MOD_TITLE);
-
- txn.doTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "title");
- do_check_eq(observer._itemChangedValue, MOD_TITLE);
-
- txn.undoTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "title");
- do_check_eq(observer._itemChangedValue, TITLE);
-
- txn.redoTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "title");
- do_check_eq(observer._itemChangedValue, MOD_TITLE);
-
- txn.undoTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "title");
- do_check_eq(observer._itemChangedValue, TITLE);
-});
-
-add_task(function* test_editing_item_uri() {
- const OLD_TEST_URI = NetUtil.newURI("http://old.test_editing_item_uri.com/");
- const NEW_TEST_URI = NetUtil.newURI("http://new.test_editing_item_uri.com/");
- let testBkmId = bmsvc.insertBookmark(root, OLD_TEST_URI, bmsvc.DEFAULT_INDEX,
- "Test editing item title");
- tagssvc.tagURI(OLD_TEST_URI, ["tag"]);
-
- let txn = new PlacesEditBookmarkURITransaction(testBkmId, NEW_TEST_URI);
-
- txn.doTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "uri");
- do_check_eq(observer._itemChangedValue, NEW_TEST_URI.spec);
- do_check_eq(JSON.stringify(tagssvc.getTagsForURI(NEW_TEST_URI)), JSON.stringify(["tag"]));
- do_check_eq(JSON.stringify(tagssvc.getTagsForURI(OLD_TEST_URI)), JSON.stringify([]));
-
- txn.undoTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "uri");
- do_check_eq(observer._itemChangedValue, OLD_TEST_URI.spec);
- do_check_eq(JSON.stringify(tagssvc.getTagsForURI(OLD_TEST_URI)), JSON.stringify(["tag"]));
- do_check_eq(JSON.stringify(tagssvc.getTagsForURI(NEW_TEST_URI)), JSON.stringify([]));
-
- txn.redoTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "uri");
- do_check_eq(observer._itemChangedValue, NEW_TEST_URI.spec);
- do_check_eq(JSON.stringify(tagssvc.getTagsForURI(NEW_TEST_URI)), JSON.stringify(["tag"]));
- do_check_eq(JSON.stringify(tagssvc.getTagsForURI(OLD_TEST_URI)), JSON.stringify([]));
-
- txn.undoTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "uri");
- do_check_eq(observer._itemChangedValue, OLD_TEST_URI.spec);
- do_check_eq(JSON.stringify(tagssvc.getTagsForURI(OLD_TEST_URI)), JSON.stringify(["tag"]));
- do_check_eq(JSON.stringify(tagssvc.getTagsForURI(NEW_TEST_URI)), JSON.stringify([]));
-});
-
-add_task(function* test_edit_description_transaction() {
- let testURI = NetUtil.newURI("http://test_edit_description_transaction.com");
- let testBkmId = bmsvc.insertBookmark(root, testURI, bmsvc.DEFAULT_INDEX, "Test edit description transaction");
-
- let anno = {
- name: DESCRIPTION_ANNO,
- type: Ci.nsIAnnotationService.TYPE_STRING,
- flags: 0,
- value: "Test edit Description",
- expires: Ci.nsIAnnotationService.EXPIRE_NEVER,
- };
- let txn = new PlacesSetItemAnnotationTransaction(testBkmId, anno);
-
- txn.doTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, DESCRIPTION_ANNO);
-});
-
-add_task(function* test_edit_keyword() {
- const KEYWORD = "keyword-test_edit_keyword";
-
- let testURI = NetUtil.newURI("http://test_edit_keyword.com");
- let testBkmId = bmsvc.insertBookmark(root, testURI, bmsvc.DEFAULT_INDEX, "Test edit keyword");
-
- let txn = new PlacesEditBookmarkKeywordTransaction(testBkmId, KEYWORD, "postData");
-
- txn.doTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "keyword");
- do_check_eq(observer._itemChangedValue, KEYWORD);
- do_check_eq(PlacesUtils.getPostDataForBookmark(testBkmId), "postData");
-
- txn.undoTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "keyword");
- do_check_eq(observer._itemChangedValue, "");
- do_check_eq(PlacesUtils.getPostDataForBookmark(testBkmId), null);
-});
-
-add_task(function* test_edit_specific_keyword() {
- const KEYWORD = "keyword-test_edit_keyword2";
-
- let testURI = NetUtil.newURI("http://test_edit_keyword2.com");
- let testBkmId = bmsvc.insertBookmark(root, testURI, bmsvc.DEFAULT_INDEX, "Test edit keyword");
- // Add multiple keyword to this uri.
- yield PlacesUtils.keywords.insert({ keyword: "kw1", url: testURI.spec, postData: "postData1" });
- yield PlacesUtils.keywords.insert({keyword: "kw2", url: testURI.spec, postData: "postData2" });
-
- // Try to change only kw2.
- let txn = new PlacesEditBookmarkKeywordTransaction(testBkmId, KEYWORD, "postData2", "kw2");
-
- txn.doTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "keyword");
- do_check_eq(observer._itemChangedValue, KEYWORD);
- let entry = yield PlacesUtils.keywords.fetch("kw1");
- Assert.equal(entry.url.href, testURI.spec);
- Assert.equal(entry.postData, "postData1");
- yield promiseKeyword(KEYWORD, testURI.spec, "postData2");
- yield promiseKeyword("kw2", null);
-
- txn.undoTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "keyword");
- do_check_eq(observer._itemChangedValue, "kw2");
- do_check_eq(PlacesUtils.getPostDataForBookmark(testBkmId), "postData1");
- entry = yield PlacesUtils.keywords.fetch("kw1");
- Assert.equal(entry.url.href, testURI.spec);
- Assert.equal(entry.postData, "postData1");
- yield promiseKeyword("kw2", testURI.spec, "postData2");
- yield promiseKeyword("keyword", null);
-});
-
-add_task(function* test_LoadInSidebar_transaction() {
- let testURI = NetUtil.newURI("http://test_LoadInSidebar_transaction.com");
- let testBkmId = bmsvc.insertBookmark(root, testURI, bmsvc.DEFAULT_INDEX, "Test LoadInSidebar transaction");
-
- const LOAD_IN_SIDEBAR_ANNO = "bookmarkProperties/loadInSidebar";
- let anno = { name: LOAD_IN_SIDEBAR_ANNO,
- type: Ci.nsIAnnotationService.TYPE_INT32,
- flags: 0,
- value: true,
- expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
- let txn = new PlacesSetItemAnnotationTransaction(testBkmId, anno);
-
- txn.doTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, LOAD_IN_SIDEBAR_ANNO);
- do_check_eq(observer._itemChanged_isAnnotationProperty, true);
-
- txn.undoTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, LOAD_IN_SIDEBAR_ANNO);
- do_check_eq(observer._itemChanged_isAnnotationProperty, true);
-});
-
-add_task(function* test_generic_item_annotation() {
- let testURI = NetUtil.newURI("http://test_generic_item_annotation.com");
- let testBkmId = bmsvc.insertBookmark(root, testURI, bmsvc.DEFAULT_INDEX, "Test generic item annotation");
-
- let itemAnnoObj = { name: "testAnno/testInt",
- type: Ci.nsIAnnotationService.TYPE_INT32,
- flags: 0,
- value: 123,
- expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
- let txn = new PlacesSetItemAnnotationTransaction(testBkmId, itemAnnoObj);
-
- txn.doTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "testAnno/testInt");
- do_check_eq(observer._itemChanged_isAnnotationProperty, true);
-
- txn.undoTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "testAnno/testInt");
- do_check_eq(observer._itemChanged_isAnnotationProperty, true);
-
- txn.redoTransaction();
- do_check_eq(observer._itemChangedId, testBkmId);
- do_check_eq(observer._itemChangedProperty, "testAnno/testInt");
- do_check_eq(observer._itemChanged_isAnnotationProperty, true);
-});
-
-add_task(function* test_editing_item_date_added() {
- let testURI = NetUtil.newURI("http://test_editing_item_date_added.com");
- let testBkmId = bmsvc.insertBookmark(root, testURI, bmsvc.DEFAULT_INDEX,
- "Test editing item date added");
-
- let oldAdded = bmsvc.getItemDateAdded(testBkmId);
- let newAdded = Date.now() * 1000 + 1000;
- let txn = new PlacesEditItemDateAddedTransaction(testBkmId, newAdded);
-
- txn.doTransaction();
- do_check_eq(newAdded, bmsvc.getItemDateAdded(testBkmId));
-
- txn.undoTransaction();
- do_check_eq(oldAdded, bmsvc.getItemDateAdded(testBkmId));
-});
-
-add_task(function* test_edit_item_last_modified() {
- let testURI = NetUtil.newURI("http://test_edit_item_last_modified.com");
- let testBkmId = bmsvc.insertBookmark(root, testURI, bmsvc.DEFAULT_INDEX,
- "Test editing item last modified");
-
- let oldModified = bmsvc.getItemLastModified(testBkmId);
- let newModified = Date.now() * 1000 + 1000;
- let txn = new PlacesEditItemLastModifiedTransaction(testBkmId, newModified);
-
- txn.doTransaction();
- do_check_eq(newModified, bmsvc.getItemLastModified(testBkmId));
-
- txn.undoTransaction();
- do_check_eq(oldModified, bmsvc.getItemLastModified(testBkmId));
-});
-
-add_task(function* test_generic_page_annotation() {
- const TEST_ANNO = "testAnno/testInt";
- let testURI = NetUtil.newURI("http://www.mozilla.org/");
- PlacesTestUtils.addVisits(testURI).then(function () {
- let pageAnnoObj = { name: TEST_ANNO,
- type: Ci.nsIAnnotationService.TYPE_INT32,
- flags: 0,
- value: 123,
- expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
- let txn = new PlacesSetPageAnnotationTransaction(testURI, pageAnnoObj);
-
- txn.doTransaction();
- do_check_true(annosvc.pageHasAnnotation(testURI, TEST_ANNO));
-
- txn.undoTransaction();
- do_check_false(annosvc.pageHasAnnotation(testURI, TEST_ANNO));
-
- txn.redoTransaction();
- do_check_true(annosvc.pageHasAnnotation(testURI, TEST_ANNO));
- });
-});
-
-add_task(function* test_sort_folder_by_name() {
- let testFolder = bmsvc.createFolder(root, "Test PlacesSortFolderByNameTransaction",
- bmsvc.DEFAULT_INDEX);
- let testURI = NetUtil.newURI("http://test_sort_folder_by_name.com");
-
- bmsvc.insertBookmark(testFolder, testURI, bmsvc.DEFAULT_INDEX, "bookmark3");
- bmsvc.insertBookmark(testFolder, testURI, bmsvc.DEFAULT_INDEX, "bookmark2");
- bmsvc.insertBookmark(testFolder, testURI, bmsvc.DEFAULT_INDEX, "bookmark1");
-
- let bkmIds = bmsvc.getBookmarkIdsForURI(testURI);
- bkmIds.sort();
-
- let b1 = bkmIds[0];
- let b2 = bkmIds[1];
- let b3 = bkmIds[2];
-
- do_check_eq(0, bmsvc.getItemIndex(b1));
- do_check_eq(1, bmsvc.getItemIndex(b2));
- do_check_eq(2, bmsvc.getItemIndex(b3));
-
- let txn = new PlacesSortFolderByNameTransaction(testFolder);
-
- txn.doTransaction();
- do_check_eq(2, bmsvc.getItemIndex(b1));
- do_check_eq(1, bmsvc.getItemIndex(b2));
- do_check_eq(0, bmsvc.getItemIndex(b3));
-
- txn.undoTransaction();
- do_check_eq(0, bmsvc.getItemIndex(b1));
- do_check_eq(1, bmsvc.getItemIndex(b2));
- do_check_eq(2, bmsvc.getItemIndex(b3));
-
- txn.redoTransaction();
- do_check_eq(2, bmsvc.getItemIndex(b1));
- do_check_eq(1, bmsvc.getItemIndex(b2));
- do_check_eq(0, bmsvc.getItemIndex(b3));
-
- txn.undoTransaction();
- do_check_eq(0, bmsvc.getItemIndex(b1));
- do_check_eq(1, bmsvc.getItemIndex(b2));
- do_check_eq(2, bmsvc.getItemIndex(b3));
-});
-
-add_task(function* test_tagURI_untagURI() {
- const TAG_1 = "tag-test_tagURI_untagURI-bar";
- const TAG_2 = "tag-test_tagURI_untagURI-foo";
- let tagURI = NetUtil.newURI("http://test_tagURI_untagURI.com");
-
- // Test tagURI
- let tagTxn = new PlacesTagURITransaction(tagURI, [TAG_1, TAG_2]);
-
- tagTxn.doTransaction();
- do_check_eq(JSON.stringify(tagssvc.getTagsForURI(tagURI)), JSON.stringify([TAG_1, TAG_2]));
-
- tagTxn.undoTransaction();
- do_check_eq(tagssvc.getTagsForURI(tagURI).length, 0);
-
- tagTxn.redoTransaction();
- do_check_eq(JSON.stringify(tagssvc.getTagsForURI(tagURI)), JSON.stringify([TAG_1, TAG_2]));
-
- // Test untagURI
- let untagTxn = new PlacesUntagURITransaction(tagURI, [TAG_1]);
-
- untagTxn.doTransaction();
- do_check_eq(JSON.stringify(tagssvc.getTagsForURI(tagURI)), JSON.stringify([TAG_2]));
-
- untagTxn.undoTransaction();
- do_check_eq(JSON.stringify(tagssvc.getTagsForURI(tagURI)), JSON.stringify([TAG_1, TAG_2]));
-
- untagTxn.redoTransaction();
- do_check_eq(JSON.stringify(tagssvc.getTagsForURI(tagURI)), JSON.stringify([TAG_2]));
-});
-
-add_task(function* test_aggregate_removeItem_Txn() {
- let testFolder = bmsvc.createFolder(root, "Test aggregate removeItem transaction", bmsvc.DEFAULT_INDEX);
-
- const TEST_URL = "http://test_aggregate_removeitem_txn.com/";
- const FOLDERNAME = "Folder";
- let testURI = NetUtil.newURI(TEST_URL);
-
- let bkmk1Id = bmsvc.insertBookmark(testFolder, testURI, 0, "Mozilla");
- let bkmk2Id = bmsvc.insertSeparator(testFolder, 1);
- let bkmk3Id = bmsvc.createFolder(testFolder, FOLDERNAME, 2);
-
- let bkmk3_1Id = bmsvc.insertBookmark(bkmk3Id, testURI, 0, "Mozilla");
- let bkmk3_2Id = bmsvc.insertSeparator(bkmk3Id, 1);
- let bkmk3_3Id = bmsvc.createFolder(bkmk3Id, FOLDERNAME, 2);
-
- let childTxn1 = new PlacesRemoveItemTransaction(bkmk1Id);
- let childTxn2 = new PlacesRemoveItemTransaction(bkmk2Id);
- let childTxn3 = new PlacesRemoveItemTransaction(bkmk3Id);
- let transactions = [childTxn1, childTxn2, childTxn3];
- let txn = new PlacesAggregatedTransaction("RemoveItems", transactions);
-
- txn.doTransaction();
- do_check_eq(bmsvc.getItemIndex(bkmk1Id), -1);
- do_check_eq(bmsvc.getItemIndex(bkmk2Id), -1);
- do_check_eq(bmsvc.getItemIndex(bkmk3Id), -1);
- do_check_eq(bmsvc.getItemIndex(bkmk3_1Id), -1);
- do_check_eq(bmsvc.getItemIndex(bkmk3_2Id), -1);
- do_check_eq(bmsvc.getItemIndex(bkmk3_3Id), -1);
- // Check last removed item id.
- do_check_eq(observer._itemRemovedId, bkmk3Id);
-
- txn.undoTransaction();
- let newBkmk1Id = bmsvc.getIdForItemAt(testFolder, 0);
- let newBkmk2Id = bmsvc.getIdForItemAt(testFolder, 1);
- let newBkmk3Id = bmsvc.getIdForItemAt(testFolder, 2);
- let newBkmk3_1Id = bmsvc.getIdForItemAt(newBkmk3Id, 0);
- let newBkmk3_2Id = bmsvc.getIdForItemAt(newBkmk3Id, 1);
- let newBkmk3_3Id = bmsvc.getIdForItemAt(newBkmk3Id, 2);
- do_check_eq(bmsvc.getItemType(newBkmk1Id), bmsvc.TYPE_BOOKMARK);
- do_check_eq(bmsvc.getBookmarkURI(newBkmk1Id).spec, TEST_URL);
- do_check_eq(bmsvc.getItemType(newBkmk2Id), bmsvc.TYPE_SEPARATOR);
- do_check_eq(bmsvc.getItemType(newBkmk3Id), bmsvc.TYPE_FOLDER);
- do_check_eq(bmsvc.getItemTitle(newBkmk3Id), FOLDERNAME);
- do_check_eq(bmsvc.getFolderIdForItem(newBkmk3_1Id), newBkmk3Id);
- do_check_eq(bmsvc.getItemType(newBkmk3_1Id), bmsvc.TYPE_BOOKMARK);
- do_check_eq(bmsvc.getBookmarkURI(newBkmk3_1Id).spec, TEST_URL);
- do_check_eq(bmsvc.getFolderIdForItem(newBkmk3_2Id), newBkmk3Id);
- do_check_eq(bmsvc.getItemType(newBkmk3_2Id), bmsvc.TYPE_SEPARATOR);
- do_check_eq(bmsvc.getFolderIdForItem(newBkmk3_3Id), newBkmk3Id);
- do_check_eq(bmsvc.getItemType(newBkmk3_3Id), bmsvc.TYPE_FOLDER);
- do_check_eq(bmsvc.getItemTitle(newBkmk3_3Id), FOLDERNAME);
- // Check last added back item id.
- // Notice items are restored in reverse order.
- do_check_eq(observer._itemAddedId, newBkmk1Id);
-
- txn.redoTransaction();
- do_check_eq(bmsvc.getItemIndex(newBkmk1Id), -1);
- do_check_eq(bmsvc.getItemIndex(newBkmk2Id), -1);
- do_check_eq(bmsvc.getItemIndex(newBkmk3Id), -1);
- do_check_eq(bmsvc.getItemIndex(newBkmk3_1Id), -1);
- do_check_eq(bmsvc.getItemIndex(newBkmk3_2Id), -1);
- do_check_eq(bmsvc.getItemIndex(newBkmk3_3Id), -1);
- // Check last removed item id.
- do_check_eq(observer._itemRemovedId, newBkmk3Id);
-
- txn.undoTransaction();
- newBkmk1Id = bmsvc.getIdForItemAt(testFolder, 0);
- newBkmk2Id = bmsvc.getIdForItemAt(testFolder, 1);
- newBkmk3Id = bmsvc.getIdForItemAt(testFolder, 2);
- newBkmk3_1Id = bmsvc.getIdForItemAt(newBkmk3Id, 0);
- newBkmk3_2Id = bmsvc.getIdForItemAt(newBkmk3Id, 1);
- newBkmk3_3Id = bmsvc.getIdForItemAt(newBkmk3Id, 2);
- do_check_eq(bmsvc.getItemType(newBkmk1Id), bmsvc.TYPE_BOOKMARK);
- do_check_eq(bmsvc.getBookmarkURI(newBkmk1Id).spec, TEST_URL);
- do_check_eq(bmsvc.getItemType(newBkmk2Id), bmsvc.TYPE_SEPARATOR);
- do_check_eq(bmsvc.getItemType(newBkmk3Id), bmsvc.TYPE_FOLDER);
- do_check_eq(bmsvc.getItemTitle(newBkmk3Id), FOLDERNAME);
- do_check_eq(bmsvc.getFolderIdForItem(newBkmk3_1Id), newBkmk3Id);
- do_check_eq(bmsvc.getItemType(newBkmk3_1Id), bmsvc.TYPE_BOOKMARK);
- do_check_eq(bmsvc.getBookmarkURI(newBkmk3_1Id).spec, TEST_URL);
- do_check_eq(bmsvc.getFolderIdForItem(newBkmk3_2Id), newBkmk3Id);
- do_check_eq(bmsvc.getItemType(newBkmk3_2Id), bmsvc.TYPE_SEPARATOR);
- do_check_eq(bmsvc.getFolderIdForItem(newBkmk3_3Id), newBkmk3Id);
- do_check_eq(bmsvc.getItemType(newBkmk3_3Id), bmsvc.TYPE_FOLDER);
- do_check_eq(bmsvc.getItemTitle(newBkmk3_3Id), FOLDERNAME);
- // Check last added back item id.
- // Notice items are restored in reverse order.
- do_check_eq(observer._itemAddedId, newBkmk1Id);
-});
-
-add_task(function* test_create_item_with_childTxn() {
- let testFolder = bmsvc.createFolder(root, "Test creating an item with childTxns", bmsvc.DEFAULT_INDEX);
-
- const BOOKMARK_TITLE = "parent item";
- let testURI = NetUtil.newURI("http://test_create_item_with_childTxn.com");
- let childTxns = [];
- let newDateAdded = Date.now() * 1000 - 20000;
- let editDateAdddedTxn = new PlacesEditItemDateAddedTransaction(null, newDateAdded);
- childTxns.push(editDateAdddedTxn);
-
- let itemChildAnnoObj = { name: "testAnno/testInt",
- type: Ci.nsIAnnotationService.TYPE_INT32,
- flags: 0,
- value: 123,
- expires: Ci.nsIAnnotationService.EXPIRE_NEVER };
- let annoTxn = new PlacesSetItemAnnotationTransaction(null, itemChildAnnoObj);
- childTxns.push(annoTxn);
-
- let itemWChildTxn = new PlacesCreateBookmarkTransaction(testURI, testFolder, bmStartIndex,
- BOOKMARK_TITLE, null, null,
- childTxns);
- try {
- txnManager.doTransaction(itemWChildTxn);
- let itemId = bmsvc.getBookmarkIdsForURI(testURI)[0];
- do_check_eq(observer._itemAddedId, itemId);
- do_check_eq(newDateAdded, bmsvc.getItemDateAdded(itemId));
- do_check_eq(observer._itemChangedProperty, "testAnno/testInt");
- do_check_eq(observer._itemChanged_isAnnotationProperty, true);
- do_check_true(annosvc.itemHasAnnotation(itemId, itemChildAnnoObj.name))
- do_check_eq(annosvc.getItemAnnotation(itemId, itemChildAnnoObj.name), itemChildAnnoObj.value);
-
- itemWChildTxn.undoTransaction();
- do_check_eq(observer._itemRemovedId, itemId);
-
- itemWChildTxn.redoTransaction();
- do_check_true(bmsvc.isBookmarked(testURI));
- let newId = bmsvc.getBookmarkIdsForURI(testURI)[0];
- do_check_eq(newDateAdded, bmsvc.getItemDateAdded(newId));
- do_check_eq(observer._itemAddedId, newId);
- do_check_eq(observer._itemChangedProperty, "testAnno/testInt");
- do_check_eq(observer._itemChanged_isAnnotationProperty, true);
- do_check_true(annosvc.itemHasAnnotation(newId, itemChildAnnoObj.name))
- do_check_eq(annosvc.getItemAnnotation(newId, itemChildAnnoObj.name), itemChildAnnoObj.value);
-
- itemWChildTxn.undoTransaction();
- do_check_eq(observer._itemRemovedId, newId);
- }
- catch (ex) {
- do_throw("Setting a child transaction in a createItem transaction did throw: " + ex);
- }
-});
-
-add_task(function* test_create_folder_with_child_itemTxn() {
- let childURI = NetUtil.newURI("http://test_create_folder_with_child_itemTxn.com");
- let childItemTxn = new PlacesCreateBookmarkTransaction(childURI, root,
- bmStartIndex, "childItem");
- let txn = new PlacesCreateFolderTransaction("Test creating a folder with child itemTxns",
- root, bmStartIndex, null, [childItemTxn]);
- try {
- txnManager.doTransaction(txn);
- let childItemId = bmsvc.getBookmarkIdsForURI(childURI)[0];
- do_check_eq(observer._itemAddedId, childItemId);
- do_check_eq(observer._itemAddedIndex, 0);
- do_check_true(bmsvc.isBookmarked(childURI));
-
- txn.undoTransaction();
- do_check_false(bmsvc.isBookmarked(childURI));
-
- txn.redoTransaction();
- let newchildItemId = bmsvc.getBookmarkIdsForURI(childURI)[0];
- do_check_eq(observer._itemAddedIndex, 0);
- do_check_eq(observer._itemAddedId, newchildItemId);
- do_check_true(bmsvc.isBookmarked(childURI));
-
- txn.undoTransaction();
- do_check_false(bmsvc.isBookmarked(childURI));
- }
- catch (ex) {
- do_throw("Setting a child item transaction in a createFolder transaction did throw: " + ex);
- }
-});
diff --git a/toolkit/components/places/tests/unit/test_preventive_maintenance.js b/toolkit/components/places/tests/unit/test_preventive_maintenance.js
deleted file mode 100644
index a533c8295..000000000
--- a/toolkit/components/places/tests/unit/test_preventive_maintenance.js
+++ /dev/null
@@ -1,1356 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- /**
- * Test preventive maintenance
- * For every maintenance query create an uncoherent db and check that we take
- * correct fix steps, without polluting valid data.
- */
-
-// Include PlacesDBUtils module
-Components.utils.import("resource://gre/modules/PlacesDBUtils.jsm");
-
-const FINISHED_MAINTENANCE_NOTIFICATION_TOPIC = "places-maintenance-finished";
-
-// Get services and database connection
-var hs = PlacesUtils.history;
-var bs = PlacesUtils.bookmarks;
-var ts = PlacesUtils.tagging;
-var as = PlacesUtils.annotations;
-var fs = PlacesUtils.favicons;
-
-var mDBConn = hs.QueryInterface(Ci.nsPIPlacesDatabase).DBConnection;
-
-// ------------------------------------------------------------------------------
-// Helpers
-
-var defaultBookmarksMaxId = 0;
-function cleanDatabase() {
- mDBConn.executeSimpleSQL("DELETE FROM moz_places");
- mDBConn.executeSimpleSQL("DELETE FROM moz_historyvisits");
- mDBConn.executeSimpleSQL("DELETE FROM moz_anno_attributes");
- mDBConn.executeSimpleSQL("DELETE FROM moz_annos");
- mDBConn.executeSimpleSQL("DELETE FROM moz_items_annos");
- mDBConn.executeSimpleSQL("DELETE FROM moz_inputhistory");
- mDBConn.executeSimpleSQL("DELETE FROM moz_keywords");
- mDBConn.executeSimpleSQL("DELETE FROM moz_favicons");
- mDBConn.executeSimpleSQL("DELETE FROM moz_bookmarks WHERE id > " + defaultBookmarksMaxId);
-}
-
-function addPlace(aUrl, aFavicon) {
- let stmt = mDBConn.createStatement(
- "INSERT INTO moz_places (url, url_hash, favicon_id) VALUES (:url, hash(:url), :favicon)");
- stmt.params["url"] = aUrl || "http://www.mozilla.org";
- stmt.params["favicon"] = aFavicon || null;
- stmt.execute();
- stmt.finalize();
- return mDBConn.lastInsertRowID;
-}
-
-function addBookmark(aPlaceId, aType, aParent, aKeywordId, aFolderType, aTitle) {
- let stmt = mDBConn.createStatement(
- `INSERT INTO moz_bookmarks (fk, type, parent, keyword_id, folder_type,
- title, guid)
- VALUES (:place_id, :type, :parent, :keyword_id, :folder_type, :title,
- GENERATE_GUID())`);
- stmt.params["place_id"] = aPlaceId || null;
- stmt.params["type"] = aType || bs.TYPE_BOOKMARK;
- stmt.params["parent"] = aParent || bs.unfiledBookmarksFolder;
- stmt.params["keyword_id"] = aKeywordId || null;
- stmt.params["folder_type"] = aFolderType || null;
- stmt.params["title"] = typeof(aTitle) == "string" ? aTitle : null;
- stmt.execute();
- stmt.finalize();
- return mDBConn.lastInsertRowID;
-}
-
-// ------------------------------------------------------------------------------
-// Tests
-
-var tests = [];
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "A.1",
- desc: "Remove obsolete annotations from moz_annos",
-
- _obsoleteWeaveAttribute: "weave/test",
- _placeId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid.
- this._placeId = addPlace();
- // Add an obsolete attribute.
- let stmt = mDBConn.createStatement(
- "INSERT INTO moz_anno_attributes (name) VALUES (:anno)"
- );
- stmt.params['anno'] = this._obsoleteWeaveAttribute;
- stmt.execute();
- stmt.finalize();
- stmt = mDBConn.createStatement(
- `INSERT INTO moz_annos (place_id, anno_attribute_id)
- VALUES (:place_id,
- (SELECT id FROM moz_anno_attributes WHERE name = :anno)
- )`
- );
- stmt.params['place_id'] = this._placeId;
- stmt.params['anno'] = this._obsoleteWeaveAttribute;
- stmt.execute();
- stmt.finalize();
- },
-
- check: function() {
- // Check that the obsolete annotation has been removed.
- let stmt = mDBConn.createStatement(
- "SELECT id FROM moz_anno_attributes WHERE name = :anno"
- );
- stmt.params['anno'] = this._obsoleteWeaveAttribute;
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-tests.push({
- name: "A.2",
- desc: "Remove obsolete annotations from moz_items_annos",
-
- _obsoleteSyncAttribute: "sync/children",
- _obsoleteGuidAttribute: "placesInternal/GUID",
- _obsoleteWeaveAttribute: "weave/test",
- _placeId: null,
- _bookmarkId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid.
- this._placeId = addPlace();
- // Add a bookmark.
- this._bookmarkId = addBookmark(this._placeId);
- // Add an obsolete attribute.
- let stmt = mDBConn.createStatement(
- `INSERT INTO moz_anno_attributes (name)
- VALUES (:anno1), (:anno2), (:anno3)`
- );
- stmt.params['anno1'] = this._obsoleteSyncAttribute;
- stmt.params['anno2'] = this._obsoleteGuidAttribute;
- stmt.params['anno3'] = this._obsoleteWeaveAttribute;
- stmt.execute();
- stmt.finalize();
- stmt = mDBConn.createStatement(
- `INSERT INTO moz_items_annos (item_id, anno_attribute_id)
- SELECT :item_id, id
- FROM moz_anno_attributes
- WHERE name IN (:anno1, :anno2, :anno3)`
- );
- stmt.params['item_id'] = this._bookmarkId;
- stmt.params['anno1'] = this._obsoleteSyncAttribute;
- stmt.params['anno2'] = this._obsoleteGuidAttribute;
- stmt.params['anno3'] = this._obsoleteWeaveAttribute;
- stmt.execute();
- stmt.finalize();
- },
-
- check: function() {
- // Check that the obsolete annotations have been removed.
- let stmt = mDBConn.createStatement(
- `SELECT id FROM moz_anno_attributes
- WHERE name IN (:anno1, :anno2, :anno3)`
- );
- stmt.params['anno1'] = this._obsoleteSyncAttribute;
- stmt.params['anno2'] = this._obsoleteGuidAttribute;
- stmt.params['anno3'] = this._obsoleteWeaveAttribute;
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-tests.push({
- name: "A.3",
- desc: "Remove unused attributes",
-
- _usedPageAttribute: "usedPage",
- _usedItemAttribute: "usedItem",
- _unusedAttribute: "unused",
- _placeId: null,
- _bookmarkId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this._placeId = addPlace();
- // add a bookmark
- this._bookmarkId = addBookmark(this._placeId);
- // Add a used attribute and an unused one.
- let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
- stmt.params['anno'] = this._usedPageAttribute;
- stmt.execute();
- stmt.reset();
- stmt.params['anno'] = this._usedItemAttribute;
- stmt.execute();
- stmt.reset();
- stmt.params['anno'] = this._unusedAttribute;
- stmt.execute();
- stmt.finalize();
-
- stmt = mDBConn.createStatement("INSERT INTO moz_annos (place_id, anno_attribute_id) VALUES(:place_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
- stmt.params['place_id'] = this._placeId;
- stmt.params['anno'] = this._usedPageAttribute;
- stmt.execute();
- stmt.finalize();
- stmt = mDBConn.createStatement("INSERT INTO moz_items_annos (item_id, anno_attribute_id) VALUES(:item_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
- stmt.params['item_id'] = this._bookmarkId;
- stmt.params['anno'] = this._usedItemAttribute;
- stmt.execute();
- stmt.finalize();
- },
-
- check: function() {
- // Check that used attributes are still there
- let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
- stmt.params['anno'] = this._usedPageAttribute;
- do_check_true(stmt.executeStep());
- stmt.reset();
- stmt.params['anno'] = this._usedItemAttribute;
- do_check_true(stmt.executeStep());
- stmt.reset();
- // Check that unused attribute has been removed
- stmt.params['anno'] = this._unusedAttribute;
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "B.1",
- desc: "Remove annotations with an invalid attribute",
-
- _usedPageAttribute: "usedPage",
- _placeId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this._placeId = addPlace();
- // Add a used attribute.
- let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
- stmt.params['anno'] = this._usedPageAttribute;
- stmt.execute();
- stmt.finalize();
- stmt = mDBConn.createStatement("INSERT INTO moz_annos (place_id, anno_attribute_id) VALUES(:place_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
- stmt.params['place_id'] = this._placeId;
- stmt.params['anno'] = this._usedPageAttribute;
- stmt.execute();
- stmt.finalize();
- // Add an annotation with a nonexistent attribute
- stmt = mDBConn.createStatement("INSERT INTO moz_annos (place_id, anno_attribute_id) VALUES(:place_id, 1337)");
- stmt.params['place_id'] = this._placeId;
- stmt.execute();
- stmt.finalize();
- },
-
- check: function() {
- // Check that used attribute is still there
- let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
- stmt.params['anno'] = this._usedPageAttribute;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- // check that annotation with valid attribute is still there
- stmt = mDBConn.createStatement("SELECT id FROM moz_annos WHERE anno_attribute_id = (SELECT id FROM moz_anno_attributes WHERE name = :anno)");
- stmt.params['anno'] = this._usedPageAttribute;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- // Check that annotation with bogus attribute has been removed
- stmt = mDBConn.createStatement("SELECT id FROM moz_annos WHERE anno_attribute_id = 1337");
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "B.2",
- desc: "Remove orphan page annotations",
-
- _usedPageAttribute: "usedPage",
- _placeId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this._placeId = addPlace();
- // Add a used attribute.
- let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
- stmt.params['anno'] = this._usedPageAttribute;
- stmt.execute();
- stmt.finalize();
- stmt = mDBConn.createStatement("INSERT INTO moz_annos (place_id, anno_attribute_id) VALUES(:place_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
- stmt.params['place_id'] = this._placeId;
- stmt.params['anno'] = this._usedPageAttribute;
- stmt.execute();
- stmt.reset();
- // Add an annotation to a nonexistent page
- stmt.params['place_id'] = 1337;
- stmt.params['anno'] = this._usedPageAttribute;
- stmt.execute();
- stmt.finalize();
- },
-
- check: function() {
- // Check that used attribute is still there
- let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
- stmt.params['anno'] = this._usedPageAttribute;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- // check that annotation with valid attribute is still there
- stmt = mDBConn.createStatement("SELECT id FROM moz_annos WHERE anno_attribute_id = (SELECT id FROM moz_anno_attributes WHERE name = :anno)");
- stmt.params['anno'] = this._usedPageAttribute;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- // Check that an annotation to a nonexistent page has been removed
- stmt = mDBConn.createStatement("SELECT id FROM moz_annos WHERE place_id = 1337");
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-tests.push({
- name: "C.1",
- desc: "fix missing Places root",
-
- setup: function() {
- // Sanity check: ensure that roots are intact.
- do_check_eq(bs.getFolderIdForItem(bs.placesRoot), 0);
- do_check_eq(bs.getFolderIdForItem(bs.bookmarksMenuFolder), bs.placesRoot);
- do_check_eq(bs.getFolderIdForItem(bs.tagsFolder), bs.placesRoot);
- do_check_eq(bs.getFolderIdForItem(bs.unfiledBookmarksFolder), bs.placesRoot);
- do_check_eq(bs.getFolderIdForItem(bs.toolbarFolder), bs.placesRoot);
-
- // Remove the root.
- mDBConn.executeSimpleSQL("DELETE FROM moz_bookmarks WHERE parent = 0");
- let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE parent = 0");
- do_check_false(stmt.executeStep());
- stmt.finalize();
- },
-
- check: function() {
- // Ensure the roots have been correctly restored.
- do_check_eq(bs.getFolderIdForItem(bs.placesRoot), 0);
- do_check_eq(bs.getFolderIdForItem(bs.bookmarksMenuFolder), bs.placesRoot);
- do_check_eq(bs.getFolderIdForItem(bs.tagsFolder), bs.placesRoot);
- do_check_eq(bs.getFolderIdForItem(bs.unfiledBookmarksFolder), bs.placesRoot);
- do_check_eq(bs.getFolderIdForItem(bs.toolbarFolder), bs.placesRoot);
- }
-});
-
-// ------------------------------------------------------------------------------
-tests.push({
- name: "C.2",
- desc: "Fix roots titles",
-
- setup: function() {
- // Sanity check: ensure that roots titles are correct. We can use our check.
- this.check();
- // Change some roots' titles.
- bs.setItemTitle(bs.placesRoot, "bad title");
- do_check_eq(bs.getItemTitle(bs.placesRoot), "bad title");
- bs.setItemTitle(bs.unfiledBookmarksFolder, "bad title");
- do_check_eq(bs.getItemTitle(bs.unfiledBookmarksFolder), "bad title");
- },
-
- check: function() {
- // Ensure all roots titles are correct.
- do_check_eq(bs.getItemTitle(bs.placesRoot), "");
- do_check_eq(bs.getItemTitle(bs.bookmarksMenuFolder),
- PlacesUtils.getString("BookmarksMenuFolderTitle"));
- do_check_eq(bs.getItemTitle(bs.tagsFolder),
- PlacesUtils.getString("TagsFolderTitle"));
- do_check_eq(bs.getItemTitle(bs.unfiledBookmarksFolder),
- PlacesUtils.getString("OtherBookmarksFolderTitle"));
- do_check_eq(bs.getItemTitle(bs.toolbarFolder),
- PlacesUtils.getString("BookmarksToolbarFolderTitle"));
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "D.1",
- desc: "Remove items without a valid place",
-
- _validItemId: null,
- _invalidItemId: null,
- _placeId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this.placeId = addPlace();
- // Insert a valid bookmark
- this._validItemId = addBookmark(this.placeId);
- // Insert a bookmark with an invalid place
- this._invalidItemId = addBookmark(1337);
- },
-
- check: function() {
- // Check that valid bookmark is still there
- let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id");
- stmt.params["item_id"] = this._validItemId;
- do_check_true(stmt.executeStep());
- stmt.reset();
- // Check that invalid bookmark has been removed
- stmt.params["item_id"] = this._invalidItemId;
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "D.2",
- desc: "Remove items that are not uri bookmarks from tag containers",
-
- _tagId: null,
- _bookmarkId: null,
- _separatorId: null,
- _folderId: null,
- _placeId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this._placeId = addPlace();
- // Create a tag
- this._tagId = addBookmark(null, bs.TYPE_FOLDER, bs.tagsFolder);
- // Insert a bookmark in the tag
- this._bookmarkId = addBookmark(this._placeId, bs.TYPE_BOOKMARK, this._tagId);
- // Insert a separator in the tag
- this._separatorId = addBookmark(null, bs.TYPE_SEPARATOR, this._tagId);
- // Insert a folder in the tag
- this._folderId = addBookmark(null, bs.TYPE_FOLDER, this._tagId);
- },
-
- check: function() {
- // Check that valid bookmark is still there
- let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE type = :type AND parent = :parent");
- stmt.params["type"] = bs.TYPE_BOOKMARK;
- stmt.params["parent"] = this._tagId;
- do_check_true(stmt.executeStep());
- stmt.reset();
- // Check that separator is no more there
- stmt.params["type"] = bs.TYPE_SEPARATOR;
- stmt.params["parent"] = this._tagId;
- do_check_false(stmt.executeStep());
- stmt.reset();
- // Check that folder is no more there
- stmt.params["type"] = bs.TYPE_FOLDER;
- stmt.params["parent"] = this._tagId;
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "D.3",
- desc: "Remove empty tags",
-
- _tagId: null,
- _bookmarkId: null,
- _emptyTagId: null,
- _placeId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this._placeId = addPlace();
- // Create a tag
- this._tagId = addBookmark(null, bs.TYPE_FOLDER, bs.tagsFolder);
- // Insert a bookmark in the tag
- this._bookmarkId = addBookmark(this._placeId, bs.TYPE_BOOKMARK, this._tagId);
- // Create another tag (empty)
- this._emptyTagId = addBookmark(null, bs.TYPE_FOLDER, bs.tagsFolder);
- },
-
- check: function() {
- // Check that valid bookmark is still there
- let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :id AND type = :type AND parent = :parent");
- stmt.params["id"] = this._bookmarkId;
- stmt.params["type"] = bs.TYPE_BOOKMARK;
- stmt.params["parent"] = this._tagId;
- do_check_true(stmt.executeStep());
- stmt.reset();
- stmt.params["id"] = this._tagId;
- stmt.params["type"] = bs.TYPE_FOLDER;
- stmt.params["parent"] = bs.tagsFolder;
- do_check_true(stmt.executeStep());
- stmt.reset();
- stmt.params["id"] = this._emptyTagId;
- stmt.params["type"] = bs.TYPE_FOLDER;
- stmt.params["parent"] = bs.tagsFolder;
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "D.4",
- desc: "Move orphan items to unsorted folder",
-
- _orphanBookmarkId: null,
- _orphanSeparatorId: null,
- _orphanFolderId: null,
- _bookmarkId: null,
- _placeId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this._placeId = addPlace();
- // Insert an orphan bookmark
- this._orphanBookmarkId = addBookmark(this._placeId, bs.TYPE_BOOKMARK, 8888);
- // Insert an orphan separator
- this._orphanSeparatorId = addBookmark(null, bs.TYPE_SEPARATOR, 8888);
- // Insert a orphan folder
- this._orphanFolderId = addBookmark(null, bs.TYPE_FOLDER, 8888);
- // Create a child of the last created folder
- this._bookmarkId = addBookmark(this._placeId, bs.TYPE_BOOKMARK, this._orphanFolderId);
- },
-
- check: function() {
- // Check that bookmarks are now children of a real folder (unsorted)
- let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id AND parent = :parent");
- stmt.params["item_id"] = this._orphanBookmarkId;
- stmt.params["parent"] = bs.unfiledBookmarksFolder;
- do_check_true(stmt.executeStep());
- stmt.reset();
- stmt.params["item_id"] = this._orphanSeparatorId;
- stmt.params["parent"] = bs.unfiledBookmarksFolder;
- do_check_true(stmt.executeStep());
- stmt.reset();
- stmt.params["item_id"] = this._orphanFolderId;
- stmt.params["parent"] = bs.unfiledBookmarksFolder;
- do_check_true(stmt.executeStep());
- stmt.reset();
- stmt.params["item_id"] = this._bookmarkId;
- stmt.params["parent"] = this._orphanFolderId;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "D.6",
- desc: "Fix wrong item types | bookmarks",
-
- _separatorId: null,
- _folderId: null,
- _placeId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this._placeId = addPlace();
- // Add a separator with a fk
- this._separatorId = addBookmark(this._placeId, bs.TYPE_SEPARATOR);
- // Add a folder with a fk
- this._folderId = addBookmark(this._placeId, bs.TYPE_FOLDER);
- },
-
- check: function() {
- // Check that items with an fk have been converted to bookmarks
- let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id AND type = :type");
- stmt.params["item_id"] = this._separatorId;
- stmt.params["type"] = bs.TYPE_BOOKMARK;
- do_check_true(stmt.executeStep());
- stmt.reset();
- stmt.params["item_id"] = this._folderId;
- stmt.params["type"] = bs.TYPE_BOOKMARK;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "D.7",
- desc: "Fix wrong item types | bookmarks",
-
- _validBookmarkId: null,
- _invalidBookmarkId: null,
- _placeId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this._placeId = addPlace();
- // Add a bookmark with a valid place id
- this._validBookmarkId = addBookmark(this._placeId, bs.TYPE_BOOKMARK);
- // Add a bookmark with a null place id
- this._invalidBookmarkId = addBookmark(null, bs.TYPE_BOOKMARK);
- },
-
- check: function() {
- // Check valid bookmark
- let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id AND type = :type");
- stmt.params["item_id"] = this._validBookmarkId;
- stmt.params["type"] = bs.TYPE_BOOKMARK;
- do_check_true(stmt.executeStep());
- stmt.reset();
- // Check invalid bookmark has been converted to a folder
- stmt.params["item_id"] = this._invalidBookmarkId;
- stmt.params["type"] = bs.TYPE_FOLDER;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "D.9",
- desc: "Fix wrong parents",
-
- _bookmarkId: null,
- _separatorId: null,
- _bookmarkId1: null,
- _bookmarkId2: null,
- _placeId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this._placeId = addPlace();
- // Insert a bookmark
- this._bookmarkId = addBookmark(this._placeId, bs.TYPE_BOOKMARK);
- // Insert a separator
- this._separatorId = addBookmark(null, bs.TYPE_SEPARATOR);
- // Create 3 children of these items
- this._bookmarkId1 = addBookmark(this._placeId, bs.TYPE_BOOKMARK, this._bookmarkId);
- this._bookmarkId2 = addBookmark(this._placeId, bs.TYPE_BOOKMARK, this._separatorId);
- },
-
- check: function() {
- // Check that bookmarks are now children of a real folder (unsorted)
- let stmt = mDBConn.createStatement("SELECT id FROM moz_bookmarks WHERE id = :item_id AND parent = :parent");
- stmt.params["item_id"] = this._bookmarkId1;
- stmt.params["parent"] = bs.unfiledBookmarksFolder;
- do_check_true(stmt.executeStep());
- stmt.reset();
- stmt.params["item_id"] = this._bookmarkId2;
- stmt.params["parent"] = bs.unfiledBookmarksFolder;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "D.10",
- desc: "Recalculate positions",
-
- _unfiledBookmarks: [],
- _toolbarBookmarks: [],
-
- setup: function() {
- const NUM_BOOKMARKS = 20;
- bs.runInBatchMode({
- runBatched: function (aUserData) {
- // Add bookmarks to two folders to better perturbate the table.
- for (let i = 0; i < NUM_BOOKMARKS; i++) {
- bs.insertBookmark(PlacesUtils.unfiledBookmarksFolderId,
- NetUtil.newURI("http://example.com/"),
- bs.DEFAULT_INDEX, "testbookmark");
- }
- for (let i = 0; i < NUM_BOOKMARKS; i++) {
- bs.insertBookmark(PlacesUtils.toolbarFolderId,
- NetUtil.newURI("http://example.com/"),
- bs.DEFAULT_INDEX, "testbookmark");
- }
- }
- }, null);
-
- function randomize_positions(aParent, aResultArray) {
- let stmt = mDBConn.createStatement(
- `UPDATE moz_bookmarks SET position = :rand
- WHERE id IN (
- SELECT id FROM moz_bookmarks WHERE parent = :parent
- ORDER BY RANDOM() LIMIT 1
- )`
- );
- for (let i = 0; i < (NUM_BOOKMARKS / 2); i++) {
- stmt.params["parent"] = aParent;
- stmt.params["rand"] = Math.round(Math.random() * (NUM_BOOKMARKS - 1));
- stmt.execute();
- stmt.reset();
- }
- stmt.finalize();
-
- // Build the expected ordered list of bookmarks.
- stmt = mDBConn.createStatement(
- `SELECT id, position
- FROM moz_bookmarks WHERE parent = :parent
- ORDER BY position ASC, ROWID ASC`
- );
- stmt.params["parent"] = aParent;
- while (stmt.executeStep()) {
- aResultArray.push(stmt.row.id);
- print(stmt.row.id + "\t" + stmt.row.position + "\t" +
- (aResultArray.length - 1));
- }
- stmt.finalize();
- }
-
- // Set random positions for the added bookmarks.
- randomize_positions(PlacesUtils.unfiledBookmarksFolderId,
- this._unfiledBookmarks);
- randomize_positions(PlacesUtils.toolbarFolderId, this._toolbarBookmarks);
- },
-
- check: function() {
- function check_order(aParent, aResultArray) {
- // Build the expected ordered list of bookmarks.
- let stmt = mDBConn.createStatement(
- `SELECT id, position FROM moz_bookmarks WHERE parent = :parent
- ORDER BY position ASC`
- );
- stmt.params["parent"] = aParent;
- let pass = true;
- while (stmt.executeStep()) {
- print(stmt.row.id + "\t" + stmt.row.position);
- if (aResultArray.indexOf(stmt.row.id) != stmt.row.position) {
- pass = false;
- }
- }
- stmt.finalize();
- if (!pass) {
- dump_table("moz_bookmarks");
- do_throw("Unexpected unfiled bookmarks order.");
- }
- }
-
- check_order(PlacesUtils.unfiledBookmarksFolderId, this._unfiledBookmarks);
- check_order(PlacesUtils.toolbarFolderId, this._toolbarBookmarks);
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "D.12",
- desc: "Fix empty-named tags",
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- let placeId = addPlace();
- // Create a empty-named tag.
- this._untitledTagId = addBookmark(null, bs.TYPE_FOLDER, bs.tagsFolder, null, null, "");
- // Insert a bookmark in the tag, otherwise it will be removed.
- addBookmark(placeId, bs.TYPE_BOOKMARK, this._untitledTagId);
- // Create a empty-named folder.
- this._untitledFolderId = addBookmark(null, bs.TYPE_FOLDER, bs.toolbarFolder, null, null, "");
- // Create a titled tag.
- this._titledTagId = addBookmark(null, bs.TYPE_FOLDER, bs.tagsFolder, null, null, "titledTag");
- // Insert a bookmark in the tag, otherwise it will be removed.
- addBookmark(placeId, bs.TYPE_BOOKMARK, this._titledTagId);
- // Create a titled folder.
- this._titledFolderId = addBookmark(null, bs.TYPE_FOLDER, bs.toolbarFolder, null, null, "titledFolder");
- },
-
- check: function() {
- // Check that valid bookmark is still there
- let stmt = mDBConn.createStatement(
- "SELECT title FROM moz_bookmarks WHERE id = :id"
- );
- stmt.params["id"] = this._untitledTagId;
- do_check_true(stmt.executeStep());
- do_check_eq(stmt.row.title, "(notitle)");
- stmt.reset();
- stmt.params["id"] = this._untitledFolderId;
- do_check_true(stmt.executeStep());
- do_check_eq(stmt.row.title, "");
- stmt.reset();
- stmt.params["id"] = this._titledTagId;
- do_check_true(stmt.executeStep());
- do_check_eq(stmt.row.title, "titledTag");
- stmt.reset();
- stmt.params["id"] = this._titledFolderId;
- do_check_true(stmt.executeStep());
- do_check_eq(stmt.row.title, "titledFolder");
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "E.1",
- desc: "Remove orphan icons",
-
- _placeId: null,
-
- setup: function() {
- // Insert favicon entries
- let stmt = mDBConn.createStatement("INSERT INTO moz_favicons (id, url) VALUES(:favicon_id, :url)");
- stmt.params["favicon_id"] = 1;
- stmt.params["url"] = "http://www1.mozilla.org/favicon.ico";
- stmt.execute();
- stmt.reset();
- stmt.params["favicon_id"] = 2;
- stmt.params["url"] = "http://www2.mozilla.org/favicon.ico";
- stmt.execute();
- stmt.finalize();
- // Insert a place using the existing favicon entry
- this._placeId = addPlace("http://www.mozilla.org", 1);
- },
-
- check: function() {
- // Check that used icon is still there
- let stmt = mDBConn.createStatement("SELECT id FROM moz_favicons WHERE id = :favicon_id");
- stmt.params["favicon_id"] = 1;
- do_check_true(stmt.executeStep());
- stmt.reset();
- // Check that unused icon has been removed
- stmt.params["favicon_id"] = 2;
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "F.1",
- desc: "Remove orphan visits",
-
- _placeId: null,
- _invalidPlaceId: 1337,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this._placeId = addPlace();
- // Add a valid visit and an invalid one
- stmt = mDBConn.createStatement("INSERT INTO moz_historyvisits(place_id) VALUES (:place_id)");
- stmt.params["place_id"] = this._placeId;
- stmt.execute();
- stmt.reset();
- stmt.params["place_id"] = this._invalidPlaceId;
- stmt.execute();
- stmt.finalize();
- },
-
- check: function() {
- // Check that valid visit is still there
- let stmt = mDBConn.createStatement("SELECT id FROM moz_historyvisits WHERE place_id = :place_id");
- stmt.params["place_id"] = this._placeId;
- do_check_true(stmt.executeStep());
- stmt.reset();
- // Check that invalid visit has been removed
- stmt.params["place_id"] = this._invalidPlaceId;
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "G.1",
- desc: "Remove orphan input history",
-
- _placeId: null,
- _invalidPlaceId: 1337,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this._placeId = addPlace();
- // Add input history entries
- let stmt = mDBConn.createStatement("INSERT INTO moz_inputhistory (place_id, input) VALUES (:place_id, :input)");
- stmt.params["place_id"] = this._placeId;
- stmt.params["input"] = "moz";
- stmt.execute();
- stmt.reset();
- stmt.params["place_id"] = this._invalidPlaceId;
- stmt.params["input"] = "moz";
- stmt.execute();
- stmt.finalize();
- },
-
- check: function() {
- // Check that inputhistory on valid place is still there
- let stmt = mDBConn.createStatement("SELECT place_id FROM moz_inputhistory WHERE place_id = :place_id");
- stmt.params["place_id"] = this._placeId;
- do_check_true(stmt.executeStep());
- stmt.reset();
- // Check that inputhistory on invalid place has gone
- stmt.params["place_id"] = this._invalidPlaceId;
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "H.1",
- desc: "Remove item annos with an invalid attribute",
-
- _usedItemAttribute: "usedItem",
- _bookmarkId: null,
- _placeId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this._placeId = addPlace();
- // Insert a bookmark
- this._bookmarkId = addBookmark(this._placeId);
- // Add a used attribute.
- let stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
- stmt.params['anno'] = this._usedItemAttribute;
- stmt.execute();
- stmt.finalize();
- stmt = mDBConn.createStatement("INSERT INTO moz_items_annos (item_id, anno_attribute_id) VALUES(:item_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
- stmt.params['item_id'] = this._bookmarkId;
- stmt.params['anno'] = this._usedItemAttribute;
- stmt.execute();
- stmt.finalize();
- // Add an annotation with a nonexistent attribute
- stmt = mDBConn.createStatement("INSERT INTO moz_items_annos (item_id, anno_attribute_id) VALUES(:item_id, 1337)");
- stmt.params['item_id'] = this._bookmarkId;
- stmt.execute();
- stmt.finalize();
- },
-
- check: function() {
- // Check that used attribute is still there
- let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
- stmt.params['anno'] = this._usedItemAttribute;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- // check that annotation with valid attribute is still there
- stmt = mDBConn.createStatement("SELECT id FROM moz_items_annos WHERE anno_attribute_id = (SELECT id FROM moz_anno_attributes WHERE name = :anno)");
- stmt.params['anno'] = this._usedItemAttribute;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- // Check that annotation with bogus attribute has been removed
- stmt = mDBConn.createStatement("SELECT id FROM moz_items_annos WHERE anno_attribute_id = 1337");
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "H.2",
- desc: "Remove orphan item annotations",
-
- _usedItemAttribute: "usedItem",
- _bookmarkId: null,
- _invalidBookmarkId: 8888,
- _placeId: null,
-
- setup: function() {
- // Add a place to ensure place_id = 1 is valid
- this._placeId = addPlace();
- // Insert a bookmark
- this._bookmarkId = addBookmark(this._placeId);
- // Add a used attribute.
- stmt = mDBConn.createStatement("INSERT INTO moz_anno_attributes (name) VALUES (:anno)");
- stmt.params['anno'] = this._usedItemAttribute;
- stmt.execute();
- stmt.finalize();
- stmt = mDBConn.createStatement("INSERT INTO moz_items_annos (item_id, anno_attribute_id) VALUES (:item_id, (SELECT id FROM moz_anno_attributes WHERE name = :anno))");
- stmt.params["item_id"] = this._bookmarkId;
- stmt.params["anno"] = this._usedItemAttribute;
- stmt.execute();
- stmt.reset();
- // Add an annotation to a nonexistent item
- stmt.params["item_id"] = this._invalidBookmarkId;
- stmt.params["anno"] = this._usedItemAttribute;
- stmt.execute();
- stmt.finalize();
- },
-
- check: function() {
- // Check that used attribute is still there
- let stmt = mDBConn.createStatement("SELECT id FROM moz_anno_attributes WHERE name = :anno");
- stmt.params['anno'] = this._usedItemAttribute;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- // check that annotation with valid attribute is still there
- stmt = mDBConn.createStatement("SELECT id FROM moz_items_annos WHERE anno_attribute_id = (SELECT id FROM moz_anno_attributes WHERE name = :anno)");
- stmt.params['anno'] = this._usedItemAttribute;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- // Check that an annotation to a nonexistent page has been removed
- stmt = mDBConn.createStatement("SELECT id FROM moz_items_annos WHERE item_id = 8888");
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "I.1",
- desc: "Remove unused keywords",
-
- _bookmarkId: null,
- _placeId: null,
-
- setup: function() {
- // Insert 2 keywords
- let stmt = mDBConn.createStatement("INSERT INTO moz_keywords (id, keyword, place_id) VALUES(:id, :keyword, :place_id)");
- stmt.params["id"] = 1;
- stmt.params["keyword"] = "unused";
- stmt.params["place_id"] = 100;
- stmt.execute();
- stmt.finalize();
- },
-
- check: function() {
- // Check that "used" keyword is still there
- let stmt = mDBConn.createStatement("SELECT id FROM moz_keywords WHERE keyword = :keyword");
- // Check that "unused" keyword has gone
- stmt.params["keyword"] = "unused";
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "L.1",
- desc: "Fix wrong favicon ids",
-
- _validIconPlaceId: null,
- _invalidIconPlaceId: null,
-
- setup: function() {
- // Insert a favicon entry
- let stmt = mDBConn.createStatement("INSERT INTO moz_favicons (id, url) VALUES(1, :url)");
- stmt.params["url"] = "http://www.mozilla.org/favicon.ico";
- stmt.execute();
- stmt.finalize();
- // Insert a place using the existing favicon entry
- this._validIconPlaceId = addPlace("http://www1.mozilla.org", 1);
-
- // Insert a place using a nonexistent favicon entry
- this._invalidIconPlaceId = addPlace("http://www2.mozilla.org", 1337);
- },
-
- check: function() {
- // Check that bogus favicon is not there
- let stmt = mDBConn.createStatement("SELECT id FROM moz_places WHERE favicon_id = :favicon_id");
- stmt.params["favicon_id"] = 1337;
- do_check_false(stmt.executeStep());
- stmt.reset();
- // Check that valid favicon is still there
- stmt.params["favicon_id"] = 1;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- // Check that place entries are there
- stmt = mDBConn.createStatement("SELECT id FROM moz_places WHERE id = :place_id");
- stmt.params["place_id"] = this._validIconPlaceId;
- do_check_true(stmt.executeStep());
- stmt.reset();
- stmt.params["place_id"] = this._invalidIconPlaceId;
- do_check_true(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "L.2",
- desc: "Recalculate visit_count and last_visit_date",
-
- setup: function* () {
- function setVisitCount(aURL, aValue) {
- let stmt = mDBConn.createStatement(
- `UPDATE moz_places SET visit_count = :count WHERE url_hash = hash(:url)
- AND url = :url`
- );
- stmt.params.count = aValue;
- stmt.params.url = aURL;
- stmt.execute();
- stmt.finalize();
- }
- function setLastVisitDate(aURL, aValue) {
- let stmt = mDBConn.createStatement(
- `UPDATE moz_places SET last_visit_date = :date WHERE url_hash = hash(:url)
- AND url = :url`
- );
- stmt.params.date = aValue;
- stmt.params.url = aURL;
- stmt.execute();
- stmt.finalize();
- }
-
- let now = Date.now() * 1000;
- // Add a page with 1 visit.
- let url = "http://1.moz.org/";
- yield PlacesTestUtils.addVisits({ uri: uri(url), visitDate: now++ });
- // Add a page with 1 visit and set wrong visit_count.
- url = "http://2.moz.org/";
- yield PlacesTestUtils.addVisits({ uri: uri(url), visitDate: now++ });
- setVisitCount(url, 10);
- // Add a page with 1 visit and set wrong last_visit_date.
- url = "http://3.moz.org/";
- yield PlacesTestUtils.addVisits({ uri: uri(url), visitDate: now++ });
- setLastVisitDate(url, now++);
- // Add a page with 1 visit and set wrong stats.
- url = "http://4.moz.org/";
- yield PlacesTestUtils.addVisits({ uri: uri(url), visitDate: now++ });
- setVisitCount(url, 10);
- setLastVisitDate(url, now++);
-
- // Add a page without visits.
- url = "http://5.moz.org/";
- addPlace(url);
- // Add a page without visits and set wrong visit_count.
- url = "http://6.moz.org/";
- addPlace(url);
- setVisitCount(url, 10);
- // Add a page without visits and set wrong last_visit_date.
- url = "http://7.moz.org/";
- addPlace(url);
- setLastVisitDate(url, now++);
- // Add a page without visits and set wrong stats.
- url = "http://8.moz.org/";
- addPlace(url);
- setVisitCount(url, 10);
- setLastVisitDate(url, now++);
- },
-
- check: function() {
- let stmt = mDBConn.createStatement(
- `SELECT h.id FROM moz_places h
- JOIN moz_historyvisits v ON v.place_id = h.id AND visit_type NOT IN (0,4,7,8,9)
- GROUP BY h.id HAVING h.visit_count <> count(*)
- UNION ALL
- SELECT h.id FROM moz_places h
- JOIN moz_historyvisits v ON v.place_id = h.id
- GROUP BY h.id HAVING h.last_visit_date <> MAX(v.visit_date)`
- );
- do_check_false(stmt.executeStep());
- stmt.finalize();
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "L.3",
- desc: "recalculate hidden for redirects.",
-
- *setup() {
- yield PlacesTestUtils.addVisits([
- { uri: NetUtil.newURI("http://l3.moz.org/"),
- transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://l3.moz.org/redirecting/"),
- transition: TRANSITION_TYPED },
- { uri: NetUtil.newURI("http://l3.moz.org/redirecting2/"),
- transition: TRANSITION_REDIRECT_TEMPORARY,
- referrer: NetUtil.newURI("http://l3.moz.org/redirecting/") },
- { uri: NetUtil.newURI("http://l3.moz.org/target/"),
- transition: TRANSITION_REDIRECT_PERMANENT,
- referrer: NetUtil.newURI("http://l3.moz.org/redirecting2/") },
- ]);
- },
-
- check: function () {
- return new Promise(resolve => {
- let stmt = mDBConn.createAsyncStatement(
- "SELECT h.url FROM moz_places h WHERE h.hidden = 1"
- );
- stmt.executeAsync({
- _count: 0,
- handleResult: function(aResultSet) {
- for (let row; (row = aResultSet.getNextRow());) {
- let url = row.getResultByIndex(0);
- do_check_true(/redirecting/.test(url));
- this._count++;
- }
- },
- handleError: function(aError) {
- },
- handleCompletion: function(aReason) {
- dump_table("moz_places");
- dump_table("moz_historyvisits");
- do_check_eq(aReason, Ci.mozIStorageStatementCallback.REASON_FINISHED);
- do_check_eq(this._count, 2);
- resolve();
- }
- });
- stmt.finalize();
- });
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "L.4",
- desc: "recalculate foreign_count.",
-
- *setup() {
- this._pageGuid = (yield PlacesUtils.history.insert({ url: "http://l4.moz.org/",
- visits: [{ date: new Date() }] })).guid;
- yield PlacesUtils.bookmarks.insert({ url: "http://l4.moz.org/",
- parentGuid: PlacesUtils.bookmarks.unfiledGuid});
- yield PlacesUtils.keywords.insert({ url: "http://l4.moz.org/", keyword: "kw" });
- Assert.equal((yield this._getForeignCount()), 2);
- },
-
- *_getForeignCount() {
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.execute(`SELECT foreign_count FROM moz_places
- WHERE guid = :guid`, { guid: this._pageGuid });
- return rows[0].getResultByName("foreign_count");
- },
-
- *check() {
- Assert.equal((yield this._getForeignCount()), 2);
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "L.5",
- desc: "recalculate hashes when missing.",
-
- *setup() {
- this._pageGuid = (yield PlacesUtils.history.insert({ url: "http://l5.moz.org/",
- visits: [{ date: new Date() }] })).guid;
- Assert.ok((yield this._getHash()) > 0);
- yield PlacesUtils.withConnectionWrapper("change url hash", Task.async(function* (db) {
- yield db.execute(`UPDATE moz_places SET url_hash = 0`);
- }));
- Assert.equal((yield this._getHash()), 0);
- },
-
- *_getHash() {
- let db = yield PlacesUtils.promiseDBConnection();
- let rows = yield db.execute(`SELECT url_hash FROM moz_places
- WHERE guid = :guid`, { guid: this._pageGuid });
- return rows[0].getResultByName("url_hash");
- },
-
- *check() {
- Assert.ok((yield this._getHash()) > 0);
- }
-});
-
-// ------------------------------------------------------------------------------
-
-tests.push({
- name: "Z",
- desc: "Sanity: Preventive maintenance does not touch valid items",
-
- _uri1: uri("http://www1.mozilla.org"),
- _uri2: uri("http://www2.mozilla.org"),
- _folderId: null,
- _bookmarkId: null,
- _separatorId: null,
-
- setup: function* () {
- // use valid api calls to create a bunch of items
- yield PlacesTestUtils.addVisits([
- { uri: this._uri1 },
- { uri: this._uri2 },
- ]);
-
- this._folderId = bs.createFolder(bs.toolbarFolder, "testfolder",
- bs.DEFAULT_INDEX);
- do_check_true(this._folderId > 0);
- this._bookmarkId = bs.insertBookmark(this._folderId, this._uri1,
- bs.DEFAULT_INDEX, "testbookmark");
- do_check_true(this._bookmarkId > 0);
- this._separatorId = bs.insertSeparator(bs.unfiledBookmarksFolder,
- bs.DEFAULT_INDEX);
- do_check_true(this._separatorId > 0);
- ts.tagURI(this._uri1, ["testtag"]);
- fs.setAndFetchFaviconForPage(this._uri2, SMALLPNG_DATA_URI, false,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- null,
- Services.scriptSecurityManager.getSystemPrincipal());
- yield PlacesUtils.keywords.insert({ url: this._uri1.spec, keyword: "testkeyword" });
- as.setPageAnnotation(this._uri2, "anno", "anno", 0, as.EXPIRE_NEVER);
- as.setItemAnnotation(this._bookmarkId, "anno", "anno", 0, as.EXPIRE_NEVER);
- },
-
- check: Task.async(function* () {
- // Check that all items are correct
- let isVisited = yield promiseIsURIVisited(this._uri1);
- do_check_true(isVisited);
- isVisited = yield promiseIsURIVisited(this._uri2);
- do_check_true(isVisited);
-
- do_check_eq(bs.getBookmarkURI(this._bookmarkId).spec, this._uri1.spec);
- do_check_eq(bs.getItemIndex(this._folderId), 0);
- do_check_eq(bs.getItemType(this._folderId), bs.TYPE_FOLDER);
- do_check_eq(bs.getItemType(this._separatorId), bs.TYPE_SEPARATOR);
-
- do_check_eq(ts.getTagsForURI(this._uri1).length, 1);
- do_check_eq((yield PlacesUtils.keywords.fetch({ url: this._uri1.spec })).keyword, "testkeyword");
- do_check_eq(as.getPageAnnotation(this._uri2, "anno"), "anno");
- do_check_eq(as.getItemAnnotation(this._bookmarkId, "anno"), "anno");
-
- yield new Promise(resolve => {
- fs.getFaviconURLForPage(this._uri2, aFaviconURI => {
- do_check_true(aFaviconURI.equals(SMALLPNG_DATA_URI));
- resolve();
- });
- });
- })
-});
-
-// ------------------------------------------------------------------------------
-
-add_task(function* test_preventive_maintenance()
-{
- // Get current bookmarks max ID for cleanup
- let stmt = mDBConn.createStatement("SELECT MAX(id) FROM moz_bookmarks");
- stmt.executeStep();
- defaultBookmarksMaxId = stmt.getInt32(0);
- stmt.finalize();
- do_check_true(defaultBookmarksMaxId > 0);
-
- for (let test of tests) {
- dump("\nExecuting test: " + test.name + "\n" + "*** " + test.desc + "\n");
- yield test.setup();
-
- let promiseMaintenanceFinished =
- promiseTopicObserved(FINISHED_MAINTENANCE_NOTIFICATION_TOPIC);
- Services.prefs.clearUserPref("places.database.lastMaintenance");
- let callbackInvoked = false;
- PlacesDBUtils.maintenanceOnIdle(() => callbackInvoked = true);
- yield promiseMaintenanceFinished;
- do_check_true(callbackInvoked);
-
- // Check the lastMaintenance time has been saved.
- do_check_neq(Services.prefs.getIntPref("places.database.lastMaintenance"), null);
-
- yield test.check();
-
- cleanDatabase();
- }
-
- // Sanity check: all roots should be intact
- do_check_eq(bs.getFolderIdForItem(bs.placesRoot), 0);
- do_check_eq(bs.getFolderIdForItem(bs.bookmarksMenuFolder), bs.placesRoot);
- do_check_eq(bs.getFolderIdForItem(bs.tagsFolder), bs.placesRoot);
- do_check_eq(bs.getFolderIdForItem(bs.unfiledBookmarksFolder), bs.placesRoot);
- do_check_eq(bs.getFolderIdForItem(bs.toolbarFolder), bs.placesRoot);
-});
diff --git a/toolkit/components/places/tests/unit/test_preventive_maintenance_checkAndFixDatabase.js b/toolkit/components/places/tests/unit/test_preventive_maintenance_checkAndFixDatabase.js
deleted file mode 100644
index a8acb4be0..000000000
--- a/toolkit/components/places/tests/unit/test_preventive_maintenance_checkAndFixDatabase.js
+++ /dev/null
@@ -1,50 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- /**
- * Test preventive maintenance checkAndFixDatabase.
- */
-
-// Include PlacesDBUtils module.
-Components.utils.import("resource://gre/modules/PlacesDBUtils.jsm");
-
-function run_test() {
- do_test_pending();
- PlacesDBUtils.checkAndFixDatabase(function(aLog) {
- let sections = [];
- let positives = [];
- let negatives = [];
- let infos = [];
-
- aLog.forEach(function (aMsg) {
- print (aMsg);
- switch (aMsg.substr(0, 1)) {
- case "+":
- positives.push(aMsg);
- break;
- case "-":
- negatives.push(aMsg);
- break;
- case ">":
- sections.push(aMsg);
- break;
- default:
- infos.push(aMsg);
- }
- });
-
- print("Check that we have run all sections.");
- do_check_eq(sections.length, 5);
- print("Check that we have no negatives.");
- do_check_false(!!negatives.length);
- print("Check that we have positives.");
- do_check_true(!!positives.length);
- print("Check that we have info.");
- do_check_true(!!infos.length);
-
- do_test_finished();
- });
-}
diff --git a/toolkit/components/places/tests/unit/test_preventive_maintenance_runTasks.js b/toolkit/components/places/tests/unit/test_preventive_maintenance_runTasks.js
deleted file mode 100644
index ebe308f03..000000000
--- a/toolkit/components/places/tests/unit/test_preventive_maintenance_runTasks.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- /**
- * Test preventive maintenance runTasks.
- */
-
-// Include PlacesDBUtils module.
-Components.utils.import("resource://gre/modules/PlacesDBUtils.jsm");
-
-function run_test() {
- do_test_pending();
- PlacesDBUtils.runTasks([PlacesDBUtils.reindex], function(aLog) {
- let sections = [];
- let positives = [];
- let negatives = [];
- let infos = [];
-
- aLog.forEach(function (aMsg) {
- print (aMsg);
- switch (aMsg.substr(0, 1)) {
- case "+":
- positives.push(aMsg);
- break;
- case "-":
- negatives.push(aMsg);
- break;
- case ">":
- sections.push(aMsg);
- break;
- default:
- infos.push(aMsg);
- }
- });
-
- print("Check that we have run all sections.");
- do_check_eq(sections.length, 1);
- print("Check that we have no negatives.");
- do_check_false(!!negatives.length);
- print("Check that we have positives.");
- do_check_true(!!positives.length);
-
- do_test_finished();
- });
-}
diff --git a/toolkit/components/places/tests/unit/test_promiseBookmarksTree.js b/toolkit/components/places/tests/unit/test_promiseBookmarksTree.js
deleted file mode 100644
index 0719a0cd4..000000000
--- a/toolkit/components/places/tests/unit/test_promiseBookmarksTree.js
+++ /dev/null
@@ -1,256 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function* check_has_child(aParentGuid, aChildGuid) {
- let parentTree = yield PlacesUtils.promiseBookmarksTree(aParentGuid);
- do_check_true("children" in parentTree);
- do_check_true(parentTree.children.find( e => e.guid == aChildGuid ) != null);
-}
-
-function* compareToNode(aItem, aNode, aIsRootItem, aExcludedGuids = []) {
- // itemId==-1 indicates a non-bookmark node, which is unexpected.
- do_check_neq(aNode.itemId, -1);
-
- function check_unset(...aProps) {
- aProps.forEach( p => { do_check_false(p in aItem); } );
- }
- function strict_eq_check(v1, v2) {
- dump("v1: " + v1 + " v2: " + v2 + "\n");
- do_check_eq(typeof v1, typeof v2);
- do_check_eq(v1, v2);
- }
- function compare_prop(aItemProp, aNodeProp = aItemProp, aOptional = false) {
- if (aOptional && aNode[aNodeProp] === null)
- check_unset(aItemProp);
- else
- strict_eq_check(aItem[aItemProp], aNode[aNodeProp]);
- }
- function compare_prop_to_value(aItemProp, aValue, aOptional = true) {
- if (aOptional && aValue === null)
- check_unset(aItemProp);
- else
- strict_eq_check(aItem[aItemProp], aValue);
- }
-
- // Bug 1013053 - bookmarkIndex is unavailable for the query's root
- if (aNode.bookmarkIndex == -1) {
- compare_prop_to_value("index",
- PlacesUtils.bookmarks.getItemIndex(aNode.itemId),
- false);
- }
- else {
- compare_prop("index", "bookmarkIndex");
- }
-
- compare_prop("dateAdded");
- compare_prop("lastModified");
-
- if (aIsRootItem && aNode.itemId != PlacesUtils.placesRootId) {
- do_check_true("parentGuid" in aItem);
- yield check_has_child(aItem.parentGuid, aItem.guid)
- }
- else {
- check_unset("parentGuid");
- }
-
- let expectedAnnos = PlacesUtils.getAnnotationsForItem(aItem.id);
- if (expectedAnnos.length > 0) {
- let annosToString = annos => {
- return annos.map(a => a.name + ":" + a.value).sort().join(",");
- };
- do_check_true(Array.isArray(aItem.annos))
- do_check_eq(annosToString(aItem.annos), annosToString(expectedAnnos));
- }
- else {
- check_unset("annos");
- }
- const BOOKMARK_ONLY_PROPS = ["uri", "iconuri", "tags", "charset", "keyword"];
- const FOLDER_ONLY_PROPS = ["children", "root"];
-
- let nodesCount = 1;
-
- switch (aNode.type) {
- case Ci.nsINavHistoryResultNode.RESULT_TYPE_FOLDER:
- do_check_eq(aItem.type, PlacesUtils.TYPE_X_MOZ_PLACE_CONTAINER);
- compare_prop("title", "title", true);
- check_unset(...BOOKMARK_ONLY_PROPS);
-
- let expectedChildrenNodes = [];
-
- PlacesUtils.asContainer(aNode);
- if (!aNode.containerOpen)
- aNode.containerOpen = true;
-
- for (let i = 0; i < aNode.childCount; i++) {
- let childNode = aNode.getChild(i);
- if (childNode.itemId == PlacesUtils.tagsFolderId ||
- aExcludedGuids.includes(childNode.bookmarkGuid)) {
- continue;
- }
- expectedChildrenNodes.push(childNode);
- }
-
- if (expectedChildrenNodes.length > 0) {
- do_check_true(Array.isArray(aItem.children));
- do_check_eq(aItem.children.length, expectedChildrenNodes.length);
- for (let i = 0; i < aItem.children.length; i++) {
- nodesCount +=
- yield compareToNode(aItem.children[i], expectedChildrenNodes[i],
- false, aExcludedGuids);
- }
- }
- else {
- check_unset("children");
- }
-
- switch (aItem.id) {
- case PlacesUtils.placesRootId:
- compare_prop_to_value("root", "placesRoot");
- break;
- case PlacesUtils.bookmarksMenuFolderId:
- compare_prop_to_value("root", "bookmarksMenuFolder");
- break;
- case PlacesUtils.toolbarFolderId:
- compare_prop_to_value("root", "toolbarFolder");
- break;
- case PlacesUtils.unfiledBookmarksFolderId:
- compare_prop_to_value("root", "unfiledBookmarksFolder");
- break;
- case PlacesUtils.mobileFolderId:
- compare_prop_to_value("root", "mobileFolder");
- break;
- default:
- check_unset("root");
- }
- break;
- case Ci.nsINavHistoryResultNode.RESULT_TYPE_SEPARATOR:
- do_check_eq(aItem.type, PlacesUtils.TYPE_X_MOZ_PLACE_SEPARATOR);
- check_unset(...BOOKMARK_ONLY_PROPS, ...FOLDER_ONLY_PROPS);
- break;
- default:
- do_check_eq(aItem.type, PlacesUtils.TYPE_X_MOZ_PLACE);
- compare_prop("uri");
- // node.tags's format is "a, b" whilst promiseBoookmarksTree is "a,b"
- if (aNode.tags === null)
- check_unset("tags");
- else
- compare_prop_to_value("tags", aNode.tags.replace(/, /g, ","), false);
-
- if (aNode.icon) {
- let nodeIconData = aNode.icon.replace("moz-anno:favicon:", "");
- compare_prop_to_value("iconuri", nodeIconData);
- }
- else {
- check_unset(aItem.iconuri);
- }
-
- check_unset(...FOLDER_ONLY_PROPS);
-
- let itemURI = uri(aNode.uri);
- compare_prop_to_value("charset",
- yield PlacesUtils.getCharsetForURI(itemURI));
-
- let entry = yield PlacesUtils.keywords.fetch({ url: aNode.uri });
- compare_prop_to_value("keyword", entry ? entry.keyword : null);
-
- if ("title" in aItem)
- compare_prop("title");
- else
- do_check_null(aNode.title);
- }
-
- if (aIsRootItem)
- do_check_eq(aItem.itemsCount, nodesCount);
-
- return nodesCount;
-}
-
-var itemsCount = 0;
-function* new_bookmark(aInfo) {
- ++itemsCount;
- if (!("url" in aInfo))
- aInfo.url = uri("http://test.item." + itemsCount);
-
- if (!("title" in aInfo))
- aInfo.title = "Test Item (bookmark) " + itemsCount;
-
- yield PlacesTransactions.NewBookmark(aInfo).transact();
-}
-
-function* new_folder(aInfo) {
- if (!("title" in aInfo))
- aInfo.title = "Test Item (folder) " + itemsCount;
- return yield PlacesTransactions.NewFolder(aInfo).transact();
-}
-
-// Walks a result nodes tree and test promiseBookmarksTree for each node.
-// DO NOT COPY THIS LOGIC: It is done here to accomplish a more comprehensive
-// test of the API (the entire hierarchy data is available in the very test).
-function* test_promiseBookmarksTreeForEachNode(aNode, aOptions, aExcludedGuids) {
- do_check_true(aNode.bookmarkGuid && aNode.bookmarkGuid.length > 0);
- let item = yield PlacesUtils.promiseBookmarksTree(aNode.bookmarkGuid, aOptions);
- yield* compareToNode(item, aNode, true, aExcludedGuids);
-
- for (let i = 0; i < aNode.childCount; i++) {
- let child = aNode.getChild(i);
- if (child.itemId != PlacesUtils.tagsFolderId)
- yield test_promiseBookmarksTreeForEachNode(child,
- { includeItemIds: true },
- aExcludedGuids);
- }
- return item;
-}
-
-function* test_promiseBookmarksTreeAgainstResult(aItemGuid = "",
- aOptions = { includeItemIds: true },
- aExcludedGuids) {
- let itemId = aItemGuid ?
- yield PlacesUtils.promiseItemId(aItemGuid) : PlacesUtils.placesRootId;
- let node = PlacesUtils.getFolderContents(itemId).root;
- return yield test_promiseBookmarksTreeForEachNode(node, aOptions, aExcludedGuids);
-}
-
-add_task(function* () {
- // Add some bookmarks to cover various use cases.
- yield new_bookmark({ parentGuid: PlacesUtils.bookmarks.toolbarGuid });
- yield new_folder({ parentGuid: PlacesUtils.bookmarks.menuGuid,
- annotations: [{ name: "TestAnnoA", value: "TestVal" },
- { name: "TestAnnoB", value: 0 }]});
- let sepInfo = { parentGuid: PlacesUtils.bookmarks.menuGuid };
- yield PlacesTransactions.NewSeparator(sepInfo).transact();
- let folderGuid = yield new_folder({ parentGuid: PlacesUtils.bookmarks.menuGuid });
- yield new_bookmark({ title: null,
- parentGuid: folderGuid,
- keyword: "test_keyword",
- tags: ["TestTagA", "TestTagB"],
- annotations: [{ name: "TestAnnoA", value: "TestVal2"}]});
- let urlWithCharsetAndFavicon = uri("http://charset.and.favicon");
- yield new_bookmark({ parentGuid: folderGuid, url: urlWithCharsetAndFavicon });
- yield PlacesUtils.setCharsetForURI(urlWithCharsetAndFavicon, "UTF-8");
- yield promiseSetIconForPage(urlWithCharsetAndFavicon, SMALLPNG_DATA_URI);
- // Test the default places root without specifying it.
- yield test_promiseBookmarksTreeAgainstResult();
-
- // Do specify it
- yield test_promiseBookmarksTreeAgainstResult(PlacesUtils.bookmarks.rootGuid);
-
- // Exclude the bookmarks menu.
- // The calllback should be four times - once for the toolbar, once for
- // the bookmark we inserted under, and once for the menu (and not
- // at all for any of its descendants) and once for the unsorted bookmarks
- // folder. However, promiseBookmarksTree is called multiple times, so
- // rather than counting the calls, we count the number of unique items
- // passed in.
- let guidsPassedToExcludeCallback = new Set();
- let placesRootWithoutTheMenu =
- yield test_promiseBookmarksTreeAgainstResult(PlacesUtils.bookmarks.rootGuid, {
- excludeItemsCallback: aItem => {
- guidsPassedToExcludeCallback.add(aItem.guid);
- return aItem.root == "bookmarksMenuFolder";
- },
- includeItemIds: true
- }, [PlacesUtils.bookmarks.menuGuid]);
- do_check_eq(guidsPassedToExcludeCallback.size, 5);
- do_check_eq(placesRootWithoutTheMenu.children.length, 3);
-});
diff --git a/toolkit/components/places/tests/unit/test_resolveNullBookmarkTitles.js b/toolkit/components/places/tests/unit/test_resolveNullBookmarkTitles.js
deleted file mode 100644
index 01fb3eef9..000000000
--- a/toolkit/components/places/tests/unit/test_resolveNullBookmarkTitles.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function run_test() {
- run_next_test();
-}
-
-add_test(function test_resolveNullBookmarkTitles() {
- let uri1 = uri("http://foo.tld/");
- let uri2 = uri("https://bar.tld/");
-
- PlacesTestUtils.addVisits([
- { uri: uri1, title: "foo title" },
- { uri: uri2, title: "bar title" }
- ]).then(function () {
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.bookmarksMenuFolderId,
- uri1,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- null);
- PlacesUtils.bookmarks.insertBookmark(PlacesUtils.bookmarksMenuFolderId,
- uri2,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- null);
-
- PlacesUtils.tagging.tagURI(uri1, ["tag 1"]);
- PlacesUtils.tagging.tagURI(uri2, ["tag 2"]);
-
- let options = PlacesUtils.history.getNewQueryOptions();
- options.queryType = Ci.nsINavHistoryQueryOptions.QUERY_TYPE_BOOKMARKS;
- options.resultType = options.RESULTS_AS_TAG_CONTENTS;
-
- let query = PlacesUtils.history.getNewQuery();
- // if we don't set a tag folder, RESULTS_AS_TAG_CONTENTS will return all
- // tagged URIs
- let root = PlacesUtils.history.executeQuery(query, options).root;
- root.containerOpen = true;
- do_check_eq(root.childCount, 2);
- // actually RESULTS_AS_TAG_CONTENTS return results ordered by place_id DESC
- // so they are reversed
- do_check_eq(root.getChild(0).title, "bar title");
- do_check_eq(root.getChild(1).title, "foo title");
- root.containerOpen = false;
-
- run_next_test();
- });
-});
diff --git a/toolkit/components/places/tests/unit/test_result_sort.js b/toolkit/components/places/tests/unit/test_result_sort.js
deleted file mode 100644
index 35405ac50..000000000
--- a/toolkit/components/places/tests/unit/test_result_sort.js
+++ /dev/null
@@ -1,139 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const NHQO = Ci.nsINavHistoryQueryOptions;
-
-/**
- * Waits for onItemVisited notifications to be received.
- */
-function promiseOnItemVisited() {
- let defer = Promise.defer();
- let bookmarksObserver = {
- __proto__: NavBookmarkObserver.prototype,
- onItemVisited: function BO_onItemVisited() {
- PlacesUtils.bookmarks.removeObserver(this);
- // Enqueue to be sure that all onItemVisited notifications ran.
- do_execute_soon(defer.resolve);
- }
- };
- PlacesUtils.bookmarks.addObserver(bookmarksObserver, false);
- return defer.promise;
-}
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test() {
- let testFolder = PlacesUtils.bookmarks.createFolder(
- PlacesUtils.bookmarks.placesRoot,
- "Result-sort functionality tests root",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
-
- let uri1 = NetUtil.newURI("http://foo.tld/a");
- let uri2 = NetUtil.newURI("http://foo.tld/b");
-
- let id1 = PlacesUtils.bookmarks.insertBookmark(
- testFolder, uri1, PlacesUtils.bookmarks.DEFAULT_INDEX, "b");
- let id2 = PlacesUtils.bookmarks.insertBookmark(
- testFolder, uri2, PlacesUtils.bookmarks.DEFAULT_INDEX, "a");
- // url of id1, title of id2
- let id3 = PlacesUtils.bookmarks.insertBookmark(
- testFolder, uri1, PlacesUtils.bookmarks.DEFAULT_INDEX, "a");
-
- // query with natural order
- let result = PlacesUtils.getFolderContents(testFolder);
- let root = result.root;
-
- do_check_eq(root.childCount, 3);
-
- function checkOrder(a, b, c) {
- do_check_eq(root.getChild(0).itemId, a);
- do_check_eq(root.getChild(1).itemId, b);
- do_check_eq(root.getChild(2).itemId, c);
- }
-
- // natural order
- do_print("Natural order");
- checkOrder(id1, id2, id3);
-
- // title: id3 should precede id2 since we fall-back to URI-based sorting
- do_print("Sort by title asc");
- result.sortingMode = NHQO.SORT_BY_TITLE_ASCENDING;
- checkOrder(id3, id2, id1);
-
- // In reverse
- do_print("Sort by title desc");
- result.sortingMode = NHQO.SORT_BY_TITLE_DESCENDING;
- checkOrder(id1, id2, id3);
-
- // uri sort: id1 should precede id3 since we fall-back to natural order
- do_print("Sort by uri asc");
- result.sortingMode = NHQO.SORT_BY_URI_ASCENDING;
- checkOrder(id1, id3, id2);
-
- // test live update
- do_print("Change bookmark uri liveupdate");
- PlacesUtils.bookmarks.changeBookmarkURI(id1, uri2);
- checkOrder(id3, id1, id2);
- PlacesUtils.bookmarks.changeBookmarkURI(id1, uri1);
- checkOrder(id1, id3, id2);
-
- // keyword sort
- do_print("Sort by keyword asc");
- result.sortingMode = NHQO.SORT_BY_KEYWORD_ASCENDING;
- checkOrder(id3, id2, id1); // no keywords set - falling back to title sort
- yield PlacesUtils.keywords.insert({ url: uri1.spec, keyword: "a" });
- yield PlacesUtils.keywords.insert({ url: uri2.spec, keyword: "z" });
- checkOrder(id3, id1, id2);
-
- // XXXtodo: test history sortings (visit count, visit date)
- // XXXtodo: test different item types once folderId and bookmarkId are merged.
- // XXXtodo: test sortingAnnotation functionality with non-bookmark nodes
-
- do_print("Sort by annotation desc");
- PlacesUtils.annotations.setItemAnnotation(id1, "testAnno", "a", 0, 0);
- PlacesUtils.annotations.setItemAnnotation(id3, "testAnno", "b", 0, 0);
- result.sortingAnnotation = "testAnno";
- result.sortingMode = NHQO.SORT_BY_ANNOTATION_DESCENDING;
-
- // id1 precedes id2 per title-descending fallback
- checkOrder(id3, id1, id2);
-
- // XXXtodo: test dateAdded sort
- // XXXtodo: test lastModified sort
-
- // test live update
- do_print("Annotation liveupdate");
- PlacesUtils.annotations.setItemAnnotation(id1, "testAnno", "c", 0, 0);
- checkOrder(id1, id3, id2);
-
- // Add a visit, then check frecency ordering.
-
- // When the bookmarks service gets onVisit, it asynchronously fetches all
- // items for that visit, and then notifies onItemVisited. Thus we must
- // explicitly wait for that.
- let waitForVisited = promiseOnItemVisited();
- yield PlacesTestUtils.addVisits({ uri: uri2, transition: TRANSITION_TYPED });
- yield waitForVisited;
-
- do_print("Sort by frecency desc");
- result.sortingMode = NHQO.SORT_BY_FRECENCY_DESCENDING;
- for (let i = 0; i < root.childCount; ++i) {
- print(root.getChild(i).uri + " " + root.getChild(i).title);
- }
- // For id1 and id3, since they have same frecency and no visits, fallback
- // to sort by the newest bookmark.
- checkOrder(id2, id3, id1);
- do_print("Sort by frecency asc");
- result.sortingMode = NHQO.SORT_BY_FRECENCY_ASCENDING;
- for (let i = 0; i < root.childCount; ++i) {
- print(root.getChild(i).uri + " " + root.getChild(i).title);
- }
- checkOrder(id1, id3, id2);
-
- root.containerOpen = false;
-});
diff --git a/toolkit/components/places/tests/unit/test_resultsAsVisit_details.js b/toolkit/components/places/tests/unit/test_resultsAsVisit_details.js
deleted file mode 100644
index 8e71ffd0d..000000000
--- a/toolkit/components/places/tests/unit/test_resultsAsVisit_details.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-
-const {bookmarks, history} = PlacesUtils
-
-add_task(function* test_addVisitCheckFields() {
- let uri = NetUtil.newURI("http://test4.com/");
- yield PlacesTestUtils.addVisits([
- { uri },
- { uri, referrer: uri },
- { uri, transition: history.TRANSITION_TYPED },
- ]);
-
-
- let options = history.getNewQueryOptions();
- let query = history.getNewQuery();
-
- query.uri = uri;
-
-
- // Check RESULTS_AS_VISIT node.
- options.resultType = options.RESULTS_AS_VISIT;
-
- let root = history.executeQuery(query, options).root;
- root.containerOpen = true;
-
- equal(root.childCount, 3);
-
- let child = root.getChild(0);
- equal(child.visitType, history.TRANSITION_LINK, "Visit type should be TRANSITION_LINK");
- equal(child.visitId, 1, "Visit ID should be 1");
- equal(child.fromVisitId, -1, "Should have no referrer visit ID");
-
- child = root.getChild(1);
- equal(child.visitType, history.TRANSITION_LINK, "Visit type should be TRANSITION_LINK");
- equal(child.visitId, 2, "Visit ID should be 2");
- equal(child.fromVisitId, 1, "First visit should be the referring visit");
-
- child = root.getChild(2);
- equal(child.visitType, history.TRANSITION_TYPED, "Visit type should be TRANSITION_TYPED");
- equal(child.visitId, 3, "Visit ID should be 3");
- equal(child.fromVisitId, -1, "Should have no referrer visit ID");
-
- root.containerOpen = false;
-
-
- // Check RESULTS_AS_URI node.
- options.resultType = options.RESULTS_AS_URI;
-
- root = history.executeQuery(query, options).root;
- root.containerOpen = true;
-
- equal(root.childCount, 1);
-
- child = root.getChild(0);
- equal(child.visitType, 0, "Visit type should be 0");
- equal(child.visitId, -1, "Visit ID should be -1");
- equal(child.fromVisitId, -1, "Referrer visit id should be -1");
-
- root.containerOpen = false;
-
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* test_bookmarkFields() {
- let folder = bookmarks.createFolder(bookmarks.placesRoot, "test folder", bookmarks.DEFAULT_INDEX);
- bookmarks.insertBookmark(folder, uri("http://test4.com/"),
- bookmarks.DEFAULT_INDEX, "test4 title");
-
- let root = PlacesUtils.getFolderContents(folder).root;
- equal(root.childCount, 1);
-
- equal(root.visitType, 0, "Visit type should be 0");
- equal(root.visitId, -1, "Visit ID should be -1");
- equal(root.fromVisitId, -1, "Referrer visit id should be -1");
-
- let child = root.getChild(0);
- equal(child.visitType, 0, "Visit type should be 0");
- equal(child.visitId, -1, "Visit ID should be -1");
- equal(child.fromVisitId, -1, "Referrer visit id should be -1");
-
- root.containerOpen = false;
-
- yield bookmarks.eraseEverything();
-});
diff --git a/toolkit/components/places/tests/unit/test_sql_guid_functions.js b/toolkit/components/places/tests/unit/test_sql_guid_functions.js
deleted file mode 100644
index 41e6bab9e..000000000
--- a/toolkit/components/places/tests/unit/test_sql_guid_functions.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests that the guid function generates a guid of the proper length,
- * with no invalid characters.
- */
-
-/**
- * Checks all our invariants about our guids for a given result.
- *
- * @param aGuid
- * The guid to check.
- */
-function check_invariants(aGuid)
-{
- do_print("Checking guid '" + aGuid + "'");
-
- do_check_valid_places_guid(aGuid);
-}
-
-// Test Functions
-
-function test_guid_invariants()
-{
- const kExpectedChars = 64;
- const kAllowedChars =
- "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
- do_check_eq(kAllowedChars.length, kExpectedChars);
- const kGuidLength = 12;
-
- let checkedChars = [];
- for (let i = 0; i < kGuidLength; i++) {
- checkedChars[i] = {};
- for (let j = 0; j < kAllowedChars; j++) {
- checkedChars[i][kAllowedChars[j]] = false;
- }
- }
-
- // We run this until we've seen every character that we expect to see in every
- // position.
- let seenChars = 0;
- let stmt = DBConn().createStatement("SELECT GENERATE_GUID()");
- while (seenChars != (kExpectedChars * kGuidLength)) {
- do_check_true(stmt.executeStep());
- let guid = stmt.getString(0);
- check_invariants(guid);
-
- for (let i = 0; i < guid.length; i++) {
- let character = guid[i];
- if (!checkedChars[i][character]) {
- checkedChars[i][character] = true;
- seenChars++;
- }
- }
- stmt.reset();
- }
- stmt.finalize();
-
- // One last reality check - make sure all of our characters were seen.
- for (let i = 0; i < kGuidLength; i++) {
- for (let j = 0; j < kAllowedChars; j++) {
- do_check_true(checkedChars[i][kAllowedChars[j]]);
- }
- }
-
- run_next_test();
-}
-
-function test_guid_on_background()
-{
- // We should not assert if we execute this asynchronously.
- let stmt = DBConn().createAsyncStatement("SELECT GENERATE_GUID()");
- let checked = false;
- stmt.executeAsync({
- handleResult: function(aResult) {
- try {
- let row = aResult.getNextRow();
- check_invariants(row.getResultByIndex(0));
- do_check_eq(aResult.getNextRow(), null);
- checked = true;
- }
- catch (e) {
- do_throw(e);
- }
- },
- handleCompletion: function(aReason) {
- do_check_eq(aReason, Ci.mozIStorageStatementCallback.REASON_FINISHED);
- do_check_true(checked);
- run_next_test();
- }
- });
- stmt.finalize();
-}
-
-// Test Runner
-
-[
- test_guid_invariants,
- test_guid_on_background,
-].forEach(add_test);
-
-function run_test()
-{
- run_next_test();
-}
diff --git a/toolkit/components/places/tests/unit/test_svg_favicon.js b/toolkit/components/places/tests/unit/test_svg_favicon.js
deleted file mode 100644
index cec40ddef..000000000
--- a/toolkit/components/places/tests/unit/test_svg_favicon.js
+++ /dev/null
@@ -1,31 +0,0 @@
-const PAGEURI = NetUtil.newURI("http://deliciousbacon.com/");
-
-add_task(function* () {
- // First, add a history entry or else Places can't save a favicon.
- yield PlacesTestUtils.addVisits({
- uri: PAGEURI,
- transition: TRANSITION_LINK,
- visitDate: Date.now() * 1000
- });
-
- yield new Promise(resolve => {
- function onSetComplete(aURI, aDataLen, aData, aMimeType) {
- equal(aURI.spec, SMALLSVG_DATA_URI.spec, "setFavicon aURI check");
- equal(aDataLen, 263, "setFavicon aDataLen check");
- equal(aMimeType, "image/svg+xml", "setFavicon aMimeType check");
- resolve();
- }
-
- PlacesUtils.favicons.setAndFetchFaviconForPage(PAGEURI, SMALLSVG_DATA_URI,
- false,
- PlacesUtils.favicons.FAVICON_LOAD_NON_PRIVATE,
- onSetComplete,
- Services.scriptSecurityManager.getSystemPrincipal());
- });
-
- let data = yield PlacesUtils.promiseFaviconData(PAGEURI.spec);
- equal(data.uri.spec, SMALLSVG_DATA_URI.spec, "getFavicon aURI check");
- equal(data.dataLen, 263, "getFavicon aDataLen check");
- equal(data.mimeType, "image/svg+xml", "getFavicon aMimeType check");
-});
-
diff --git a/toolkit/components/places/tests/unit/test_sync_utils.js b/toolkit/components/places/tests/unit/test_sync_utils.js
deleted file mode 100644
index f8c7e6b58..000000000
--- a/toolkit/components/places/tests/unit/test_sync_utils.js
+++ /dev/null
@@ -1,1150 +0,0 @@
-Cu.import("resource://gre/modules/PlacesSyncUtils.jsm");
-Cu.import("resource://testing-common/httpd.js");
-Cu.importGlobalProperties(["crypto", "URLSearchParams"]);
-
-const DESCRIPTION_ANNO = "bookmarkProperties/description";
-const LOAD_IN_SIDEBAR_ANNO = "bookmarkProperties/loadInSidebar";
-const SYNC_PARENT_ANNO = "sync/parent";
-
-function makeGuid() {
- return ChromeUtils.base64URLEncode(crypto.getRandomValues(new Uint8Array(9)), {
- pad: false,
- });
-}
-
-function makeLivemarkServer() {
- let server = new HttpServer();
- server.registerPrefixHandler("/feed/", do_get_file("./livemark.xml"));
- server.start(-1);
- return {
- server,
- get site() {
- let { identity } = server;
- let host = identity.primaryHost.includes(":") ?
- `[${identity.primaryHost}]` : identity.primaryHost;
- return `${identity.primaryScheme}://${host}:${identity.primaryPort}`;
- },
- stopServer() {
- return new Promise(resolve => server.stop(resolve));
- },
- };
-}
-
-function shuffle(array) {
- let results = [];
- for (let i = 0; i < array.length; ++i) {
- let randomIndex = Math.floor(Math.random() * (i + 1));
- results[i] = results[randomIndex];
- results[randomIndex] = array[i];
- }
- return results;
-}
-
-function compareAscending(a, b) {
- if (a > b) {
- return 1;
- }
- if (a < b) {
- return -1;
- }
- return 0;
-}
-
-function assertTagForURLs(tag, urls, message) {
- let taggedURLs = PlacesUtils.tagging.getURIsForTag(tag).map(uri => uri.spec);
- deepEqual(taggedURLs.sort(compareAscending), urls.sort(compareAscending), message);
-}
-
-function assertURLHasTags(url, tags, message) {
- let actualTags = PlacesUtils.tagging.getTagsForURI(uri(url));
- deepEqual(actualTags.sort(compareAscending), tags, message);
-}
-
-var populateTree = Task.async(function* populate(parentGuid, ...items) {
- let guids = {};
-
- for (let index = 0; index < items.length; index++) {
- let item = items[index];
- let guid = makeGuid();
-
- switch (item.kind) {
- case "bookmark":
- case "query":
- yield PlacesUtils.bookmarks.insert({
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: item.url,
- title: item.title,
- parentGuid, guid, index,
- });
- break;
-
- case "separator":
- yield PlacesUtils.bookmarks.insert({
- type: PlacesUtils.bookmarks.TYPE_SEPARATOR,
- parentGuid, guid,
- });
- break;
-
- case "folder":
- yield PlacesUtils.bookmarks.insert({
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: item.title,
- parentGuid, guid,
- });
- if (item.children) {
- Object.assign(guids, yield* populate(guid, ...item.children));
- }
- break;
-
- default:
- throw new Error(`Unsupported item type: ${item.type}`);
- }
-
- if (item.exclude) {
- let itemId = yield PlacesUtils.promiseItemId(guid);
- PlacesUtils.annotations.setItemAnnotation(
- itemId, PlacesUtils.EXCLUDE_FROM_BACKUP_ANNO, "Don't back this up", 0,
- PlacesUtils.annotations.EXPIRE_NEVER);
- }
-
- guids[item.title] = guid;
- }
-
- return guids;
-});
-
-var syncIdToId = Task.async(function* syncIdToId(syncId) {
- let guid = yield PlacesSyncUtils.bookmarks.syncIdToGuid(syncId);
- return PlacesUtils.promiseItemId(guid);
-});
-
-add_task(function* test_order() {
- do_print("Insert some bookmarks");
- let guids = yield populateTree(PlacesUtils.bookmarks.menuGuid, {
- kind: "bookmark",
- title: "childBmk",
- url: "http://getfirefox.com",
- }, {
- kind: "bookmark",
- title: "siblingBmk",
- url: "http://getthunderbird.com",
- }, {
- kind: "folder",
- title: "siblingFolder",
- }, {
- kind: "separator",
- title: "siblingSep",
- });
-
- do_print("Reorder inserted bookmarks");
- {
- let order = [guids.siblingFolder, guids.siblingSep, guids.childBmk,
- guids.siblingBmk];
- yield PlacesSyncUtils.bookmarks.order(PlacesUtils.bookmarks.menuGuid, order);
- let childSyncIds = yield PlacesSyncUtils.bookmarks.fetchChildSyncIds(PlacesUtils.bookmarks.menuGuid);
- deepEqual(childSyncIds, order, "New bookmarks should be reordered according to array");
- }
-
- do_print("Reorder with unspecified children");
- {
- yield PlacesSyncUtils.bookmarks.order(PlacesUtils.bookmarks.menuGuid, [
- guids.siblingSep, guids.siblingBmk,
- ]);
- let childSyncIds = yield PlacesSyncUtils.bookmarks.fetchChildSyncIds(
- PlacesUtils.bookmarks.menuGuid);
- deepEqual(childSyncIds, [guids.siblingSep, guids.siblingBmk,
- guids.siblingFolder, guids.childBmk],
- "Unordered children should be moved to end");
- }
-
- do_print("Reorder with nonexistent children");
- {
- yield PlacesSyncUtils.bookmarks.order(PlacesUtils.bookmarks.menuGuid, [
- guids.childBmk, makeGuid(), guids.siblingBmk, guids.siblingSep,
- makeGuid(), guids.siblingFolder, makeGuid()]);
- let childSyncIds = yield PlacesSyncUtils.bookmarks.fetchChildSyncIds(
- PlacesUtils.bookmarks.menuGuid);
- deepEqual(childSyncIds, [guids.childBmk, guids.siblingBmk, guids.siblingSep,
- guids.siblingFolder], "Nonexistent children should be ignored");
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_changeGuid_invalid() {
- yield rejects(PlacesSyncUtils.bookmarks.changeGuid(makeGuid()),
- "Should require a new GUID");
- yield rejects(PlacesSyncUtils.bookmarks.changeGuid(makeGuid(), "!@#$"),
- "Should reject invalid GUIDs");
- yield rejects(PlacesSyncUtils.bookmarks.changeGuid(makeGuid(), makeGuid()),
- "Should reject nonexistent item GUIDs");
- yield rejects(
- PlacesSyncUtils.bookmarks.changeGuid(PlacesUtils.bookmarks.menuGuid,
- makeGuid()),
- "Should reject roots");
-});
-
-add_task(function* test_changeGuid() {
- let item = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "https://mozilla.org",
- });
- let id = yield PlacesUtils.promiseItemId(item.guid);
-
- let newGuid = makeGuid();
- let result = yield PlacesSyncUtils.bookmarks.changeGuid(item.guid, newGuid);
- equal(result, newGuid, "Should return new GUID");
-
- equal(yield PlacesUtils.promiseItemId(newGuid), id, "Should map ID to new GUID");
- yield rejects(PlacesUtils.promiseItemId(item.guid), "Should not map ID to old GUID");
- equal(yield PlacesUtils.promiseItemGuid(id), newGuid, "Should map new GUID to ID");
-});
-
-add_task(function* test_order_roots() {
- let oldOrder = yield PlacesSyncUtils.bookmarks.fetchChildSyncIds(
- PlacesUtils.bookmarks.rootGuid);
- yield PlacesSyncUtils.bookmarks.order(PlacesUtils.bookmarks.rootGuid,
- shuffle(oldOrder));
- let newOrder = yield PlacesSyncUtils.bookmarks.fetchChildSyncIds(
- PlacesUtils.bookmarks.rootGuid);
- deepEqual(oldOrder, newOrder, "Should ignore attempts to reorder roots");
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_update_tags() {
- do_print("Insert item without tags");
- let item = yield PlacesSyncUtils.bookmarks.insert({
- kind: "bookmark",
- url: "https://mozilla.org",
- syncId: makeGuid(),
- parentSyncId: "menu",
- });
-
- do_print("Add tags");
- {
- let updatedItem = yield PlacesSyncUtils.bookmarks.update({
- syncId: item.syncId,
- tags: ["foo", "bar"],
- });
- deepEqual(updatedItem.tags, ["foo", "bar"], "Should return new tags");
- assertURLHasTags("https://mozilla.org", ["bar", "foo"],
- "Should set new tags for URL");
- }
-
- do_print("Add new tag, remove existing tag");
- {
- let updatedItem = yield PlacesSyncUtils.bookmarks.update({
- syncId: item.syncId,
- tags: ["foo", "baz"],
- });
- deepEqual(updatedItem.tags, ["foo", "baz"], "Should return updated tags");
- assertURLHasTags("https://mozilla.org", ["baz", "foo"],
- "Should update tags for URL");
- assertTagForURLs("bar", [], "Should remove existing tag");
- }
-
- do_print("Tags with whitespace");
- {
- let updatedItem = yield PlacesSyncUtils.bookmarks.update({
- syncId: item.syncId,
- tags: [" leading", "trailing ", " baz ", " "],
- });
- deepEqual(updatedItem.tags, ["leading", "trailing", "baz"],
- "Should return filtered tags");
- assertURLHasTags("https://mozilla.org", ["baz", "leading", "trailing"],
- "Should trim whitespace and filter blank tags");
- }
-
- do_print("Remove all tags");
- {
- let updatedItem = yield PlacesSyncUtils.bookmarks.update({
- syncId: item.syncId,
- tags: null,
- });
- deepEqual(updatedItem.tags, [], "Should return empty tag array");
- assertURLHasTags("https://mozilla.org", [],
- "Should remove all existing tags");
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_update_keyword() {
- do_print("Insert item without keyword");
- let item = yield PlacesSyncUtils.bookmarks.insert({
- kind: "bookmark",
- parentSyncId: "menu",
- url: "https://mozilla.org",
- syncId: makeGuid(),
- });
-
- do_print("Add item keyword");
- {
- let updatedItem = yield PlacesSyncUtils.bookmarks.update({
- syncId: item.syncId,
- keyword: "moz",
- });
- equal(updatedItem.keyword, "moz", "Should return new keyword");
- let entryByKeyword = yield PlacesUtils.keywords.fetch("moz");
- equal(entryByKeyword.url.href, "https://mozilla.org/",
- "Should set new keyword for URL");
- let entryByURL = yield PlacesUtils.keywords.fetch({
- url: "https://mozilla.org",
- });
- equal(entryByURL.keyword, "moz", "Looking up URL should return new keyword");
- }
-
- do_print("Change item keyword");
- {
- let updatedItem = yield PlacesSyncUtils.bookmarks.update({
- syncId: item.syncId,
- keyword: "m",
- });
- equal(updatedItem.keyword, "m", "Should return updated keyword");
- let newEntry = yield PlacesUtils.keywords.fetch("m");
- equal(newEntry.url.href, "https://mozilla.org/", "Should update keyword for URL");
- let oldEntry = yield PlacesUtils.keywords.fetch("moz");
- ok(!oldEntry, "Should remove old keyword");
- }
-
- do_print("Remove existing keyword");
- {
- let updatedItem = yield PlacesSyncUtils.bookmarks.update({
- syncId: item.syncId,
- keyword: null,
- });
- ok(!updatedItem.keyword,
- "Should not include removed keyword in properties");
- let entry = yield PlacesUtils.keywords.fetch({
- url: "https://mozilla.org",
- });
- ok(!entry, "Should remove new keyword from URL");
- }
-
- do_print("Remove keyword for item without keyword");
- {
- yield PlacesSyncUtils.bookmarks.update({
- syncId: item.syncId,
- keyword: null,
- });
- let entry = yield PlacesUtils.keywords.fetch({
- url: "https://mozilla.org",
- });
- ok(!entry,
- "Removing keyword for URL without existing keyword should succeed");
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_update_annos() {
- let guids = yield populateTree(PlacesUtils.bookmarks.menuGuid, {
- kind: "folder",
- title: "folder",
- }, {
- kind: "bookmark",
- title: "bmk",
- url: "https://example.com",
- });
-
- do_print("Add folder description");
- {
- let updatedItem = yield PlacesSyncUtils.bookmarks.update({
- syncId: guids.folder,
- description: "Folder description",
- });
- equal(updatedItem.description, "Folder description",
- "Should return new description");
- let id = yield syncIdToId(updatedItem.syncId);
- equal(PlacesUtils.annotations.getItemAnnotation(id, DESCRIPTION_ANNO),
- "Folder description", "Should set description anno");
- }
-
- do_print("Clear folder description");
- {
- let updatedItem = yield PlacesSyncUtils.bookmarks.update({
- syncId: guids.folder,
- description: null,
- });
- ok(!updatedItem.description, "Should not return cleared description");
- let id = yield syncIdToId(updatedItem.syncId);
- ok(!PlacesUtils.annotations.itemHasAnnotation(id, DESCRIPTION_ANNO),
- "Should remove description anno");
- }
-
- do_print("Add bookmark sidebar anno");
- {
- let updatedItem = yield PlacesSyncUtils.bookmarks.update({
- syncId: guids.bmk,
- loadInSidebar: true,
- });
- ok(updatedItem.loadInSidebar, "Should return sidebar anno");
- let id = yield syncIdToId(updatedItem.syncId);
- ok(PlacesUtils.annotations.itemHasAnnotation(id, LOAD_IN_SIDEBAR_ANNO),
- "Should set sidebar anno for existing bookmark");
- }
-
- do_print("Clear bookmark sidebar anno");
- {
- let updatedItem = yield PlacesSyncUtils.bookmarks.update({
- syncId: guids.bmk,
- loadInSidebar: false,
- });
- ok(!updatedItem.loadInSidebar, "Should not return cleared sidebar anno");
- let id = yield syncIdToId(updatedItem.syncId);
- ok(!PlacesUtils.annotations.itemHasAnnotation(id, LOAD_IN_SIDEBAR_ANNO),
- "Should clear sidebar anno for existing bookmark");
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_update_move_root() {
- do_print("Move root to same parent");
- {
- // This should be a no-op.
- let sameRoot = yield PlacesSyncUtils.bookmarks.update({
- syncId: "menu",
- parentSyncId: "places",
- });
- equal(sameRoot.syncId, "menu",
- "Menu root GUID should not change");
- equal(sameRoot.parentSyncId, "places",
- "Parent Places root GUID should not change");
- }
-
- do_print("Try reparenting root");
- yield rejects(PlacesSyncUtils.bookmarks.update({
- syncId: "menu",
- parentSyncId: "toolbar",
- }));
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_insert() {
- do_print("Insert bookmark");
- {
- let item = yield PlacesSyncUtils.bookmarks.insert({
- kind: "bookmark",
- syncId: makeGuid(),
- parentSyncId: "menu",
- url: "https://example.org",
- });
- let { type } = yield PlacesUtils.bookmarks.fetch({ guid: item.syncId });
- equal(type, PlacesUtils.bookmarks.TYPE_BOOKMARK,
- "Bookmark should have correct type");
- }
-
- do_print("Insert query");
- {
- let item = yield PlacesSyncUtils.bookmarks.insert({
- kind: "query",
- syncId: makeGuid(),
- parentSyncId: "menu",
- url: "place:terms=term&folder=TOOLBAR&queryType=1",
- folder: "Saved search",
- });
- let { type } = yield PlacesUtils.bookmarks.fetch({ guid: item.syncId });
- equal(type, PlacesUtils.bookmarks.TYPE_BOOKMARK,
- "Queries should be stored as bookmarks");
- }
-
- do_print("Insert folder");
- {
- let item = yield PlacesSyncUtils.bookmarks.insert({
- kind: "folder",
- syncId: makeGuid(),
- parentSyncId: "menu",
- title: "New folder",
- });
- let { type } = yield PlacesUtils.bookmarks.fetch({ guid: item.syncId });
- equal(type, PlacesUtils.bookmarks.TYPE_FOLDER,
- "Folder should have correct type");
- }
-
- do_print("Insert separator");
- {
- let item = yield PlacesSyncUtils.bookmarks.insert({
- kind: "separator",
- syncId: makeGuid(),
- parentSyncId: "menu",
- });
- let { type } = yield PlacesUtils.bookmarks.fetch({ guid: item.syncId });
- equal(type, PlacesUtils.bookmarks.TYPE_SEPARATOR,
- "Separator should have correct type");
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_insert_livemark() {
- let { site, stopServer } = makeLivemarkServer();
-
- try {
- do_print("Insert livemark with feed URL");
- {
- let livemark = yield PlacesSyncUtils.bookmarks.insert({
- kind: "livemark",
- syncId: makeGuid(),
- feed: site + "/feed/1",
- parentSyncId: "menu",
- });
- let bmk = yield PlacesUtils.bookmarks.fetch({
- guid: yield PlacesSyncUtils.bookmarks.syncIdToGuid(livemark.syncId),
- })
- equal(bmk.type, PlacesUtils.bookmarks.TYPE_FOLDER,
- "Livemarks should be stored as folders");
- }
-
- let livemarkSyncId;
- do_print("Insert livemark with site and feed URLs");
- {
- let livemark = yield PlacesSyncUtils.bookmarks.insert({
- kind: "livemark",
- syncId: makeGuid(),
- site,
- feed: site + "/feed/1",
- parentSyncId: "menu",
- });
- livemarkSyncId = livemark.syncId;
- }
-
- do_print("Try inserting livemark into livemark");
- {
- let livemark = yield PlacesSyncUtils.bookmarks.insert({
- kind: "livemark",
- syncId: makeGuid(),
- site,
- feed: site + "/feed/1",
- parentSyncId: livemarkSyncId,
- });
- ok(!livemark, "Should not insert livemark as child of livemark");
- }
- } finally {
- yield stopServer();
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_update_livemark() {
- let { site, stopServer } = makeLivemarkServer();
- let feedURI = uri(site + "/feed/1");
-
- try {
- // We shouldn't reinsert the livemark if the URLs are the same.
- do_print("Update livemark with same URLs");
- {
- let livemark = yield PlacesUtils.livemarks.addLivemark({
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- feedURI,
- siteURI: uri(site),
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- });
-
- yield PlacesSyncUtils.bookmarks.update({
- syncId: livemark.guid,
- feed: feedURI,
- });
- // `nsLivemarkService` returns references to `Livemark` instances, so we
- // can compare them with `==` to make sure they haven't been replaced.
- equal(yield PlacesUtils.livemarks.getLivemark({
- guid: livemark.guid,
- }), livemark, "Livemark with same feed URL should not be replaced");
-
- yield PlacesSyncUtils.bookmarks.update({
- syncId: livemark.guid,
- site,
- });
- equal(yield PlacesUtils.livemarks.getLivemark({
- guid: livemark.guid,
- }), livemark, "Livemark with same site URL should not be replaced");
-
- yield PlacesSyncUtils.bookmarks.update({
- syncId: livemark.guid,
- feed: feedURI,
- site,
- });
- equal(yield PlacesUtils.livemarks.getLivemark({
- guid: livemark.guid,
- }), livemark, "Livemark with same feed and site URLs should not be replaced");
- }
-
- do_print("Change livemark feed URL");
- {
- let livemark = yield PlacesUtils.livemarks.addLivemark({
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- feedURI,
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- });
-
- // Since we're reinserting, we need to pass all properties required
- // for a new livemark. `update` won't merge the old and new ones.
- yield rejects(PlacesSyncUtils.bookmarks.update({
- syncId: livemark.guid,
- feed: site + "/feed/2",
- }), "Reinserting livemark with changed feed URL requires full record");
-
- let newLivemark = yield PlacesSyncUtils.bookmarks.update({
- kind: "livemark",
- parentSyncId: "menu",
- syncId: livemark.guid,
- feed: site + "/feed/2",
- });
- equal(newLivemark.syncId, livemark.guid,
- "GUIDs should match for reinserted livemark with changed feed URL");
- equal(newLivemark.feed.href, site + "/feed/2",
- "Reinserted livemark should have changed feed URI");
- }
-
- do_print("Add livemark site URL");
- {
- let livemark = yield PlacesUtils.livemarks.addLivemark({
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- feedURI,
- });
- ok(livemark.feedURI.equals(feedURI), "Livemark feed URI should match");
- ok(!livemark.siteURI, "Livemark should not have site URI");
-
- yield rejects(PlacesSyncUtils.bookmarks.update({
- syncId: livemark.guid,
- site,
- }), "Reinserting livemark with new site URL requires full record");
-
- let newLivemark = yield PlacesSyncUtils.bookmarks.update({
- kind: "livemark",
- parentSyncId: "menu",
- syncId: livemark.guid,
- feed: feedURI,
- site,
- });
- notEqual(newLivemark, livemark,
- "Livemark with new site URL should replace old livemark");
- equal(newLivemark.syncId, livemark.guid,
- "GUIDs should match for reinserted livemark with new site URL");
- equal(newLivemark.site.href, site + "/",
- "Reinserted livemark should have new site URI");
- equal(newLivemark.feed.href, feedURI.spec,
- "Reinserted livemark with new site URL should have same feed URI");
- }
-
- do_print("Remove livemark site URL");
- {
- let livemark = yield PlacesUtils.livemarks.addLivemark({
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- feedURI,
- siteURI: uri(site),
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- });
-
- yield rejects(PlacesSyncUtils.bookmarks.update({
- syncId: livemark.guid,
- site: null,
- }), "Reinserting livemark witout site URL requires full record");
-
- let newLivemark = yield PlacesSyncUtils.bookmarks.update({
- kind: "livemark",
- parentSyncId: "menu",
- syncId: livemark.guid,
- feed: feedURI,
- site: null,
- });
- notEqual(newLivemark, livemark,
- "Livemark without site URL should replace old livemark");
- equal(newLivemark.syncId, livemark.guid,
- "GUIDs should match for reinserted livemark without site URL");
- ok(!newLivemark.site, "Reinserted livemark should not have site URI");
- }
-
- do_print("Change livemark site URL");
- {
- let livemark = yield PlacesUtils.livemarks.addLivemark({
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- feedURI,
- siteURI: uri(site),
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- });
-
- yield rejects(PlacesSyncUtils.bookmarks.update({
- syncId: livemark.guid,
- site: site + "/new",
- }), "Reinserting livemark with changed site URL requires full record");
-
- let newLivemark = yield PlacesSyncUtils.bookmarks.update({
- kind: "livemark",
- parentSyncId: "menu",
- syncId: livemark.guid,
- feed:feedURI,
- site: site + "/new",
- });
- notEqual(newLivemark, livemark,
- "Livemark with changed site URL should replace old livemark");
- equal(newLivemark.syncId, livemark.guid,
- "GUIDs should match for reinserted livemark with changed site URL");
- equal(newLivemark.site.href, site + "/new",
- "Reinserted livemark should have changed site URI");
- }
-
- // Livemarks are stored as folders, but have different kinds. We should
- // remove the folder and insert a livemark with the same GUID instead of
- // trying to update the folder in-place.
- do_print("Replace folder with livemark");
- {
- let folder = yield PlacesUtils.bookmarks.insert({
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- title: "Plain folder",
- });
- let livemark = yield PlacesSyncUtils.bookmarks.update({
- kind: "livemark",
- parentSyncId: "menu",
- syncId: folder.guid,
- feed: feedURI,
- });
- equal(livemark.guid, folder.syncId,
- "Livemark should have same GUID as replaced folder");
- }
- } finally {
- yield stopServer();
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_insert_tags() {
- yield Promise.all([{
- kind: "bookmark",
- url: "https://example.com",
- syncId: makeGuid(),
- parentSyncId: "menu",
- tags: ["foo", "bar"],
- }, {
- kind: "bookmark",
- url: "https://example.org",
- syncId: makeGuid(),
- parentSyncId: "toolbar",
- tags: ["foo", "baz"],
- }, {
- kind: "query",
- url: "place:queryType=1&sort=12&maxResults=10",
- syncId: makeGuid(),
- parentSyncId: "toolbar",
- folder: "bar",
- tags: ["baz", "qux"],
- title: "bar",
- }].map(info => PlacesSyncUtils.bookmarks.insert(info)));
-
- assertTagForURLs("foo", ["https://example.com/", "https://example.org/"],
- "2 URLs with new tag");
- assertTagForURLs("bar", ["https://example.com/"], "1 URL with existing tag");
- assertTagForURLs("baz", ["https://example.org/",
- "place:queryType=1&sort=12&maxResults=10"],
- "Should support tagging URLs and tag queries");
- assertTagForURLs("qux", ["place:queryType=1&sort=12&maxResults=10"],
- "Should support tagging tag queries");
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_insert_tags_whitespace() {
- do_print("Untrimmed and blank tags");
- let taggedBlanks = yield PlacesSyncUtils.bookmarks.insert({
- kind: "bookmark",
- url: "https://example.org",
- syncId: makeGuid(),
- parentSyncId: "menu",
- tags: [" untrimmed ", " ", "taggy"],
- });
- deepEqual(taggedBlanks.tags, ["untrimmed", "taggy"],
- "Should not return empty tags");
- assertURLHasTags("https://example.org/", ["taggy", "untrimmed"],
- "Should set trimmed tags and ignore dupes");
-
- do_print("Dupe tags");
- let taggedDupes = yield PlacesSyncUtils.bookmarks.insert({
- kind: "bookmark",
- url: "https://example.net",
- syncId: makeGuid(),
- parentSyncId: "toolbar",
- tags: [" taggy", "taggy ", " taggy ", "taggy"],
- });
- deepEqual(taggedDupes.tags, ["taggy", "taggy", "taggy", "taggy"],
- "Should return trimmed and dupe tags");
- assertURLHasTags("https://example.net/", ["taggy"],
- "Should ignore dupes when setting tags");
-
- assertTagForURLs("taggy", ["https://example.net/", "https://example.org/"],
- "Should exclude falsy tags");
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_insert_keyword() {
- do_print("Insert item with new keyword");
- {
- yield PlacesSyncUtils.bookmarks.insert({
- kind: "bookmark",
- parentSyncId: "menu",
- url: "https://example.com",
- keyword: "moz",
- syncId: makeGuid(),
- });
- let entry = yield PlacesUtils.keywords.fetch("moz");
- equal(entry.url.href, "https://example.com/",
- "Should add keyword for item");
- }
-
- do_print("Insert item with existing keyword");
- {
- yield PlacesSyncUtils.bookmarks.insert({
- kind: "bookmark",
- parentSyncId: "menu",
- url: "https://mozilla.org",
- keyword: "moz",
- syncId: makeGuid(),
- });
- let entry = yield PlacesUtils.keywords.fetch("moz");
- equal(entry.url.href, "https://mozilla.org/",
- "Should reassign keyword to new item");
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_insert_annos() {
- do_print("Bookmark with description");
- let descBmk = yield PlacesSyncUtils.bookmarks.insert({
- kind: "bookmark",
- url: "https://example.com",
- syncId: makeGuid(),
- parentSyncId: "menu",
- description: "Bookmark description",
- });
- {
- equal(descBmk.description, "Bookmark description",
- "Should return new bookmark description");
- let id = yield syncIdToId(descBmk.syncId);
- equal(PlacesUtils.annotations.getItemAnnotation(id, DESCRIPTION_ANNO),
- "Bookmark description", "Should set new bookmark description");
- }
-
- do_print("Folder with description");
- let descFolder = yield PlacesSyncUtils.bookmarks.insert({
- kind: "folder",
- syncId: makeGuid(),
- parentSyncId: "menu",
- description: "Folder description",
- });
- {
- equal(descFolder.description, "Folder description",
- "Should return new folder description");
- let id = yield syncIdToId(descFolder.syncId);
- equal(PlacesUtils.annotations.getItemAnnotation(id, DESCRIPTION_ANNO),
- "Folder description", "Should set new folder description");
- }
-
- do_print("Bookmark with sidebar anno");
- let sidebarBmk = yield PlacesSyncUtils.bookmarks.insert({
- kind: "bookmark",
- url: "https://example.com",
- syncId: makeGuid(),
- parentSyncId: "menu",
- loadInSidebar: true,
- });
- {
- ok(sidebarBmk.loadInSidebar, "Should return sidebar anno for new bookmark");
- let id = yield syncIdToId(sidebarBmk.syncId);
- ok(PlacesUtils.annotations.itemHasAnnotation(id, LOAD_IN_SIDEBAR_ANNO),
- "Should set sidebar anno for new bookmark");
- }
-
- do_print("Bookmark without sidebar anno");
- let noSidebarBmk = yield PlacesSyncUtils.bookmarks.insert({
- kind: "bookmark",
- url: "https://example.org",
- syncId: makeGuid(),
- parentSyncId: "toolbar",
- loadInSidebar: false,
- });
- {
- ok(!noSidebarBmk.loadInSidebar,
- "Should not return sidebar anno for new bookmark");
- let id = yield syncIdToId(noSidebarBmk.syncId);
- ok(!PlacesUtils.annotations.itemHasAnnotation(id, LOAD_IN_SIDEBAR_ANNO),
- "Should not set sidebar anno for new bookmark");
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_insert_tag_query() {
- let tagFolder = -1;
-
- do_print("Insert tag query for new tag");
- {
- deepEqual(PlacesUtils.tagging.allTags, [], "New tag should not exist yet");
- let query = yield PlacesSyncUtils.bookmarks.insert({
- kind: "query",
- syncId: makeGuid(),
- parentSyncId: "toolbar",
- url: "place:type=7&folder=90",
- folder: "taggy",
- title: "Tagged stuff",
- });
- notEqual(query.url.href, "place:type=7&folder=90",
- "Tag query URL for new tag should differ");
-
- [, tagFolder] = /\bfolder=(\d+)\b/.exec(query.url.pathname);
- ok(tagFolder > 0, "New tag query URL should contain valid folder");
- deepEqual(PlacesUtils.tagging.allTags, ["taggy"], "New tag should exist");
- }
-
- do_print("Insert tag query for existing tag");
- {
- let url = "place:type=7&folder=90&maxResults=15";
- let query = yield PlacesSyncUtils.bookmarks.insert({
- kind: "query",
- url,
- folder: "taggy",
- title: "Sorted and tagged",
- syncId: makeGuid(),
- parentSyncId: "menu",
- });
- notEqual(query.url.href, url, "Tag query URL for existing tag should differ");
- let params = new URLSearchParams(query.url.pathname);
- equal(params.get("type"), "7", "Should preserve query type");
- equal(params.get("maxResults"), "15", "Should preserve additional params");
- equal(params.get("folder"), tagFolder, "Should update tag folder");
- deepEqual(PlacesUtils.tagging.allTags, ["taggy"], "Should not duplicate existing tags");
- }
-
- do_print("Use the public tagging API to ensure we added the tag correctly");
- {
- yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- type: PlacesUtils.bookmarks.TYPE_BOOKMARK,
- url: "https://mozilla.org",
- title: "Mozilla",
- });
- PlacesUtils.tagging.tagURI(uri("https://mozilla.org"), ["taggy"]);
- assertURLHasTags("https://mozilla.org/", ["taggy"],
- "Should set tags using the tagging API");
- }
-
- do_print("Removing the tag should clean up the tag folder");
- {
- PlacesUtils.tagging.untagURI(uri("https://mozilla.org"), null);
- deepEqual(PlacesUtils.tagging.allTags, [],
- "Should remove tag folder once last item is untagged");
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_insert_orphans() {
- let grandParentGuid = makeGuid();
- let parentGuid = makeGuid();
- let childGuid = makeGuid();
- let childId;
-
- do_print("Insert an orphaned child");
- {
- let child = yield PlacesSyncUtils.bookmarks.insert({
- kind: "bookmark",
- parentSyncId: parentGuid,
- syncId: childGuid,
- url: "https://mozilla.org",
- });
- equal(child.syncId, childGuid,
- "Should insert orphan with requested GUID");
- equal(child.parentSyncId, "unfiled",
- "Should reparent orphan to unfiled");
-
- childId = yield PlacesUtils.promiseItemId(childGuid);
- equal(PlacesUtils.annotations.getItemAnnotation(childId, SYNC_PARENT_ANNO),
- parentGuid, "Should set anno to missing parent GUID");
- }
-
- do_print("Insert the grandparent");
- {
- yield PlacesSyncUtils.bookmarks.insert({
- kind: "folder",
- parentSyncId: "menu",
- syncId: grandParentGuid,
- });
- equal(PlacesUtils.annotations.getItemAnnotation(childId, SYNC_PARENT_ANNO),
- parentGuid, "Child should still have orphan anno");
- }
-
- // Note that only `PlacesSyncUtils` reparents orphans, though Sync adds an
- // observer that removes the orphan anno if the orphan is manually moved.
- do_print("Insert the missing parent");
- {
- let parent = yield PlacesSyncUtils.bookmarks.insert({
- kind: "folder",
- parentSyncId: grandParentGuid,
- syncId: parentGuid,
- });
- equal(parent.syncId, parentGuid, "Should insert parent with requested GUID");
- equal(parent.parentSyncId, grandParentGuid,
- "Parent should be child of grandparent");
- ok(!PlacesUtils.annotations.itemHasAnnotation(childId, SYNC_PARENT_ANNO),
- "Orphan anno should be removed after reparenting");
-
- let child = yield PlacesUtils.bookmarks.fetch({ guid: childGuid });
- equal(child.parentGuid, parentGuid,
- "Should reparent child after inserting missing parent");
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_fetch() {
- let folder = yield PlacesSyncUtils.bookmarks.insert({
- syncId: makeGuid(),
- parentSyncId: "menu",
- kind: "folder",
- description: "Folder description",
- });
- let bmk = yield PlacesSyncUtils.bookmarks.insert({
- syncId: makeGuid(),
- parentSyncId: "menu",
- kind: "bookmark",
- url: "https://example.com",
- description: "Bookmark description",
- loadInSidebar: true,
- tags: ["taggy"],
- });
- let folderBmk = yield PlacesSyncUtils.bookmarks.insert({
- syncId: makeGuid(),
- parentSyncId: folder.syncId,
- kind: "bookmark",
- url: "https://example.org",
- keyword: "kw",
- });
- let folderSep = yield PlacesSyncUtils.bookmarks.insert({
- syncId: makeGuid(),
- parentSyncId: folder.syncId,
- kind: "separator",
- });
- let tagQuery = yield PlacesSyncUtils.bookmarks.insert({
- kind: "query",
- syncId: makeGuid(),
- parentSyncId: "toolbar",
- url: "place:type=7&folder=90",
- folder: "taggy",
- title: "Tagged stuff",
- });
- let [, tagFolderId] = /\bfolder=(\d+)\b/.exec(tagQuery.url.pathname);
- let smartBmk = yield PlacesSyncUtils.bookmarks.insert({
- kind: "query",
- syncId: makeGuid(),
- parentSyncId: "toolbar",
- url: "place:folder=TOOLBAR",
- query: "BookmarksToolbar",
- title: "Bookmarks toolbar query",
- });
-
- do_print("Fetch empty folder with description");
- {
- let item = yield PlacesSyncUtils.bookmarks.fetch(folder.syncId);
- deepEqual(item, {
- syncId: folder.syncId,
- kind: "folder",
- parentSyncId: "menu",
- description: "Folder description",
- childSyncIds: [folderBmk.syncId, folderSep.syncId],
- parentTitle: "Bookmarks Menu",
- title: "",
- }, "Should include description, children, title, and parent title in folder");
- }
-
- do_print("Fetch bookmark with description, sidebar anno, and tags");
- {
- let item = yield PlacesSyncUtils.bookmarks.fetch(bmk.syncId);
- deepEqual(Object.keys(item).sort(), ["syncId", "kind", "parentSyncId",
- "url", "tags", "description", "loadInSidebar", "parentTitle", "title"].sort(),
- "Should include bookmark-specific properties");
- equal(item.syncId, bmk.syncId, "Sync ID should match");
- equal(item.url.href, "https://example.com/", "Should return URL");
- equal(item.parentSyncId, "menu", "Should return parent sync ID");
- deepEqual(item.tags, ["taggy"], "Should return tags");
- equal(item.description, "Bookmark description", "Should return bookmark description");
- strictEqual(item.loadInSidebar, true, "Should return sidebar anno");
- equal(item.parentTitle, "Bookmarks Menu", "Should return parent title");
- strictEqual(item.title, "", "Should return empty title");
- }
-
- do_print("Fetch bookmark with keyword; without parent title or annos");
- {
- let item = yield PlacesSyncUtils.bookmarks.fetch(folderBmk.syncId);
- deepEqual(Object.keys(item).sort(), ["syncId", "kind", "parentSyncId",
- "url", "keyword", "tags", "loadInSidebar", "parentTitle", "title"].sort(),
- "Should omit blank bookmark-specific properties");
- strictEqual(item.loadInSidebar, false, "Should not load bookmark in sidebar");
- deepEqual(item.tags, [], "Tags should be empty");
- equal(item.keyword, "kw", "Should return keyword");
- strictEqual(item.parentTitle, "", "Should include parent title even if empty");
- strictEqual(item.title, "", "Should include bookmark title even if empty");
- }
-
- do_print("Fetch separator");
- {
- let item = yield PlacesSyncUtils.bookmarks.fetch(folderSep.syncId);
- strictEqual(item.index, 1, "Should return separator position");
- }
-
- do_print("Fetch tag query");
- {
- let item = yield PlacesSyncUtils.bookmarks.fetch(tagQuery.syncId);
- deepEqual(Object.keys(item).sort(), ["syncId", "kind", "parentSyncId",
- "url", "title", "folder", "parentTitle"].sort(),
- "Should include query-specific properties");
- equal(item.url.href, `place:type=7&folder=${tagFolderId}`, "Should not rewrite outgoing tag queries");
- equal(item.folder, "taggy", "Should return tag name for tag queries");
- }
-
- do_print("Fetch smart bookmark");
- {
- let item = yield PlacesSyncUtils.bookmarks.fetch(smartBmk.syncId);
- deepEqual(Object.keys(item).sort(), ["syncId", "kind", "parentSyncId",
- "url", "title", "query", "parentTitle"].sort(),
- "Should include smart bookmark-specific properties");
- equal(item.query, "BookmarksToolbar", "Should return query name for smart bookmarks");
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
-
-add_task(function* test_fetch_livemark() {
- let { site, stopServer } = makeLivemarkServer();
-
- try {
- do_print("Create livemark");
- let livemark = yield PlacesUtils.livemarks.addLivemark({
- parentGuid: PlacesUtils.bookmarks.menuGuid,
- feedURI: uri(site + "/feed/1"),
- siteURI: uri(site),
- index: PlacesUtils.bookmarks.DEFAULT_INDEX,
- });
- PlacesUtils.annotations.setItemAnnotation(livemark.id, DESCRIPTION_ANNO,
- "Livemark description", 0, PlacesUtils.annotations.EXPIRE_NEVER);
-
- do_print("Fetch livemark");
- let item = yield PlacesSyncUtils.bookmarks.fetch(livemark.guid);
- deepEqual(Object.keys(item).sort(), ["syncId", "kind", "parentSyncId",
- "description", "feed", "site", "parentTitle", "title"].sort(),
- "Should include livemark-specific properties");
- equal(item.description, "Livemark description", "Should return description");
- equal(item.feed.href, site + "/feed/1", "Should return feed URL");
- equal(item.site.href, site + "/", "Should return site URL");
- strictEqual(item.title, "", "Should include livemark title even if empty");
- } finally {
- yield stopServer();
- }
-
- yield PlacesUtils.bookmarks.eraseEverything();
-});
diff --git a/toolkit/components/places/tests/unit/test_tag_autocomplete_search.js b/toolkit/components/places/tests/unit/test_tag_autocomplete_search.js
deleted file mode 100644
index 92930e329..000000000
--- a/toolkit/components/places/tests/unit/test_tag_autocomplete_search.js
+++ /dev/null
@@ -1,137 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var current_test = 0;
-
-function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
-}
-AutoCompleteInput.prototype = {
- constructor: AutoCompleteInput,
-
- searches: null,
-
- minResultsForPopup: 0,
- timeout: 10,
- searchParam: "",
- textValue: "",
- disableAutoComplete: false,
- completeDefaultIndex: false,
-
- get searchCount() {
- return this.searches.length;
- },
-
- getSearchAt: function(aIndex) {
- return this.searches[aIndex];
- },
-
- onSearchBegin: function() {},
- onSearchComplete: function() {},
-
- popupOpen: false,
-
- popup: {
- setSelectedIndex: function(aIndex) {},
- invalidate: function() {},
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompletePopup))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
- },
-
- // nsISupports implementation
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIAutoCompleteInput))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-// Get tagging service
-try {
- var tagssvc = Cc["@mozilla.org/browser/tagging-service;1"].
- getService(Ci.nsITaggingService);
-} catch (ex) {
- do_throw("Could not get tagging service\n");
-}
-
-function ensure_tag_results(results, searchTerm)
-{
- var controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
-
- // Make an AutoCompleteInput that uses our searches
- // and confirms results on search complete
- var input = new AutoCompleteInput(["places-tag-autocomplete"]);
-
- controller.input = input;
-
- var numSearchesStarted = 0;
- input.onSearchBegin = function input_onSearchBegin() {
- numSearchesStarted++;
- do_check_eq(numSearchesStarted, 1);
- };
-
- input.onSearchComplete = function input_onSearchComplete() {
- do_check_eq(numSearchesStarted, 1);
- if (results.length)
- do_check_eq(controller.searchStatus,
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_MATCH);
- else
- do_check_eq(controller.searchStatus,
- Ci.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH);
-
- do_check_eq(controller.matchCount, results.length);
- for (var i=0; i<controller.matchCount; i++) {
- do_check_eq(controller.getValueAt(i), results[i]);
- }
-
- if (current_test < (tests.length - 1)) {
- current_test++;
- tests[current_test]();
- }
- else {
- // finish once all tests have run
- do_test_finished();
- }
- };
-
- controller.startSearch(searchTerm);
-}
-
-var uri1 = uri("http://site.tld/1");
-
-var tests = [
- function test1() { ensure_tag_results(["bar", "Baz", "boo"], "b"); },
- function test2() { ensure_tag_results(["bar", "Baz"], "ba"); },
- function test3() { ensure_tag_results(["bar", "Baz"], "Ba"); },
- function test4() { ensure_tag_results(["bar"], "bar"); },
- function test5() { ensure_tag_results(["Baz"], "Baz"); },
- function test6() { ensure_tag_results([], "barb"); },
- function test7() { ensure_tag_results([], "foo"); },
- function test8() { ensure_tag_results(["first tag, bar", "first tag, Baz"], "first tag, ba"); },
- function test9() { ensure_tag_results(["first tag; bar", "first tag; Baz"], "first tag; ba"); }
-];
-
-/**
- * Test tag autocomplete
- */
-function run_test() {
- // Search is asynchronous, so don't let the test finish immediately
- do_test_pending();
-
- tagssvc.tagURI(uri1, ["bar", "Baz", "boo", "*nix"]);
-
- tests[0]();
-}
diff --git a/toolkit/components/places/tests/unit/test_tagging.js b/toolkit/components/places/tests/unit/test_tagging.js
deleted file mode 100644
index ccb287050..000000000
--- a/toolkit/components/places/tests/unit/test_tagging.js
+++ /dev/null
@@ -1,189 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Notice we use createInstance because later we will have to terminate the
-// service and restart it.
-var tagssvc = Cc["@mozilla.org/browser/tagging-service;1"].
- createInstance().QueryInterface(Ci.nsITaggingService);
-
-function run_test() {
- var options = PlacesUtils.history.getNewQueryOptions();
- var query = PlacesUtils.history.getNewQuery();
-
- query.setFolders([PlacesUtils.tagsFolderId], 1);
- var result = PlacesUtils.history.executeQuery(query, options);
- var tagRoot = result.root;
- tagRoot.containerOpen = true;
-
- do_check_eq(tagRoot.childCount, 0);
-
- var uri1 = uri("http://foo.tld/");
- var uri2 = uri("https://bar.tld/");
-
- // this also tests that the multiple folders are not created for the same tag
- tagssvc.tagURI(uri1, ["tag 1"]);
- tagssvc.tagURI(uri2, ["tag 1"]);
- do_check_eq(tagRoot.childCount, 1);
-
- var tag1node = tagRoot.getChild(0)
- .QueryInterface(Ci.nsINavHistoryContainerResultNode);
- var tag1itemId = tag1node.itemId;
-
- do_check_eq(tag1node.title, "tag 1");
- tag1node.containerOpen = true;
- do_check_eq(tag1node.childCount, 2);
-
- // Tagging the same url twice (or even thrice!) with the same tag should be a
- // no-op
- tagssvc.tagURI(uri1, ["tag 1"]);
- do_check_eq(tag1node.childCount, 2);
- tagssvc.tagURI(uri1, [tag1itemId]);
- do_check_eq(tag1node.childCount, 2);
- do_check_eq(tagRoot.childCount, 1);
-
- // also tests bug 407575
- tagssvc.tagURI(uri1, [tag1itemId, "tag 1", "tag 2", "Tag 1", "Tag 2"]);
- do_check_eq(tagRoot.childCount, 2);
- do_check_eq(tag1node.childCount, 2);
-
- // test getTagsForURI
- var uri1tags = tagssvc.getTagsForURI(uri1);
- do_check_eq(uri1tags.length, 2);
- do_check_eq(uri1tags[0], "Tag 1");
- do_check_eq(uri1tags[1], "Tag 2");
- var uri2tags = tagssvc.getTagsForURI(uri2);
- do_check_eq(uri2tags.length, 1);
- do_check_eq(uri2tags[0], "Tag 1");
-
- // test getURIsForTag
- var tag1uris = tagssvc.getURIsForTag("tag 1");
- do_check_eq(tag1uris.length, 2);
- do_check_true(tag1uris[0].equals(uri1));
- do_check_true(tag1uris[1].equals(uri2));
-
- // test allTags attribute
- var allTags = tagssvc.allTags;
- do_check_eq(allTags.length, 2);
- do_check_eq(allTags[0], "Tag 1");
- do_check_eq(allTags[1], "Tag 2");
-
- // test untagging
- tagssvc.untagURI(uri1, ["tag 1"]);
- do_check_eq(tag1node.childCount, 1);
-
- // removing the last uri from a tag should remove the tag-container
- tagssvc.untagURI(uri2, ["tag 1"]);
- do_check_eq(tagRoot.childCount, 1);
-
- // cleanup
- tag1node.containerOpen = false;
-
- // get array of tag folder ids => title
- // for testing tagging with mixed folder ids and tags
- var child = tagRoot.getChild(0);
- var tagId = child.itemId;
- var tagTitle = child.title;
-
- // test mixed id/name tagging
- // as well as non-id numeric tags
- var uri3 = uri("http://testuri/3");
- tagssvc.tagURI(uri3, [tagId, "tag 3", "456"]);
- var tags = tagssvc.getTagsForURI(uri3);
- do_check_true(tags.includes(tagTitle));
- do_check_true(tags.includes("tag 3"));
- do_check_true(tags.includes("456"));
-
- // test mixed id/name tagging
- tagssvc.untagURI(uri3, [tagId, "tag 3", "456"]);
- tags = tagssvc.getTagsForURI(uri3);
- do_check_eq(tags.length, 0);
-
- // Terminate tagging service, fire up a new instance and check that existing
- // tags are there. This will ensure that any internal caching system is
- // correctly filled at startup and we are not losing previously existing tags.
- var uri4 = uri("http://testuri/4");
- tagssvc.tagURI(uri4, [tagId, "tag 3", "456"]);
- tagssvc = null;
- tagssvc = Cc["@mozilla.org/browser/tagging-service;1"].
- getService(Ci.nsITaggingService);
- var uri4Tags = tagssvc.getTagsForURI(uri4);
- do_check_eq(uri4Tags.length, 3);
- do_check_true(uri4Tags.includes(tagTitle));
- do_check_true(uri4Tags.includes("tag 3"));
- do_check_true(uri4Tags.includes("456"));
-
- // Test sparse arrays.
- let curChildCount = tagRoot.childCount;
-
- try {
- tagssvc.tagURI(uri1, [, "tagSparse"]);
- do_check_eq(tagRoot.childCount, curChildCount + 1);
- } catch (ex) {
- do_throw("Passing a sparse array should not throw");
- }
- try {
- tagssvc.untagURI(uri1, [, "tagSparse"]);
- do_check_eq(tagRoot.childCount, curChildCount);
- } catch (ex) {
- do_throw("Passing a sparse array should not throw");
- }
-
- // Test that the API throws for bad arguments.
- try {
- tagssvc.tagURI(uri1, ["", "test"]);
- do_throw("Passing a bad tags array should throw");
- } catch (ex) {
- do_check_eq(ex.name, "NS_ERROR_ILLEGAL_VALUE");
- }
- try {
- tagssvc.untagURI(uri1, ["", "test"]);
- do_throw("Passing a bad tags array should throw");
- } catch (ex) {
- do_check_eq(ex.name, "NS_ERROR_ILLEGAL_VALUE");
- }
- try {
- tagssvc.tagURI(uri1, [0, "test"]);
- do_throw("Passing a bad tags array should throw");
- } catch (ex) {
- do_check_eq(ex.name, "NS_ERROR_ILLEGAL_VALUE");
- }
- try {
- tagssvc.tagURI(uri1, [0, "test"]);
- do_throw("Passing a bad tags array should throw");
- } catch (ex) {
- do_check_eq(ex.name, "NS_ERROR_ILLEGAL_VALUE");
- }
-
- // Tag name length should be limited to nsITaggingService.MAX_TAG_LENGTH (bug407821)
- try {
-
- // generate a long tag name. i.e. looooo...oong_tag
- var n = Ci.nsITaggingService.MAX_TAG_LENGTH;
- var someOos = new Array(n).join('o');
- var longTagName = "l" + someOos + "ng_tag";
-
- tagssvc.tagURI(uri1, ["short_tag", longTagName]);
- do_throw("Passing a bad tags array should throw");
-
- } catch (ex) {
- do_check_eq(ex.name, "NS_ERROR_ILLEGAL_VALUE");
- }
-
- // cleanup
- tagRoot.containerOpen = false;
-
- // Tagging service should trim tags (Bug967196)
- let exampleURI = uri("http://www.example.com/");
- PlacesUtils.tagging.tagURI(exampleURI, [ " test " ]);
-
- let exampleTags = PlacesUtils.tagging.getTagsForURI(exampleURI);
- do_check_eq(exampleTags.length, 1);
- do_check_eq(exampleTags[0], "test");
-
- PlacesUtils.tagging.untagURI(exampleURI, [ "test" ]);
- exampleTags = PlacesUtils.tagging.getTagsForURI(exampleURI);
- do_check_eq(exampleTags.length, 0);
-}
diff --git a/toolkit/components/places/tests/unit/test_telemetry.js b/toolkit/components/places/tests/unit/test_telemetry.js
deleted file mode 100644
index 99f36d78c..000000000
--- a/toolkit/components/places/tests/unit/test_telemetry.js
+++ /dev/null
@@ -1,166 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Tests common Places telemetry probes by faking the telemetry service.
-
-Components.utils.import("resource://gre/modules/PlacesDBUtils.jsm");
-
-var histograms = {
- PLACES_PAGES_COUNT: val => do_check_eq(val, 1),
- PLACES_BOOKMARKS_COUNT: val => do_check_eq(val, 1),
- PLACES_TAGS_COUNT: val => do_check_eq(val, 1),
- PLACES_KEYWORDS_COUNT: val => do_check_eq(val, 1),
- PLACES_SORTED_BOOKMARKS_PERC: val => do_check_eq(val, 100),
- PLACES_TAGGED_BOOKMARKS_PERC: val => do_check_eq(val, 100),
- PLACES_DATABASE_FILESIZE_MB: val => do_check_true(val > 0),
- PLACES_DATABASE_PAGESIZE_B: val => do_check_eq(val, 32768),
- PLACES_DATABASE_SIZE_PER_PAGE_B: val => do_check_true(val > 0),
- PLACES_EXPIRATION_STEPS_TO_CLEAN2: val => do_check_true(val > 1),
- // PLACES_AUTOCOMPLETE_1ST_RESULT_TIME_MS: val => do_check_true(val > 1),
- PLACES_IDLE_FRECENCY_DECAY_TIME_MS: val => do_check_true(val >= 0),
- PLACES_IDLE_MAINTENANCE_TIME_MS: val => do_check_true(val > 0),
- // One from the `setItemAnnotation` call; the other from the mobile root.
- // This can be removed along with the anno in bug 1306445.
- PLACES_ANNOS_BOOKMARKS_COUNT: val => do_check_eq(val, 2),
- PLACES_ANNOS_PAGES_COUNT: val => do_check_eq(val, 1),
- PLACES_MAINTENANCE_DAYSFROMLAST: val => do_check_true(val >= 0),
-}
-
-/**
- * Forces an expiration run.
- *
- * @param [optional] aLimit
- * Limit for the expiration. Pass -1 for unlimited.
- * Any other non-positive value will just expire orphans.
- *
- * @return {Promise}
- * @resolves When expiration finishes.
- * @rejects Never.
- */
-function promiseForceExpirationStep(aLimit) {
- let promise = promiseTopicObserved(PlacesUtils.TOPIC_EXPIRATION_FINISHED);
- let expire = Cc["@mozilla.org/places/expiration;1"].getService(Ci.nsIObserver);
- expire.observe(null, "places-debug-start-expiration", aLimit);
- return promise;
-}
-
-/**
- * Returns a PRTime in the past usable to add expirable visits.
- *
- * param [optional] daysAgo
- * Expiration ignores any visit added in the last 7 days, so by default
- * this will be set to 7.
- * @note to be safe against DST issues we go back one day more.
- */
-function getExpirablePRTime(daysAgo = 7) {
- let dateObj = new Date();
- // Normalize to midnight
- dateObj.setHours(0);
- dateObj.setMinutes(0);
- dateObj.setSeconds(0);
- dateObj.setMilliseconds(0);
- dateObj = new Date(dateObj.getTime() - (daysAgo + 1) * 86400000);
- return dateObj.getTime() * 1000;
-}
-
-add_task(function* test_execute()
-{
- // Put some trash in the database.
- let uri = NetUtil.newURI("http://moz.org/");
-
- let folderId = PlacesUtils.bookmarks.createFolder(PlacesUtils.unfiledBookmarksFolderId,
- "moz test",
- PlacesUtils.bookmarks.DEFAULT_INDEX);
- let itemId = PlacesUtils.bookmarks.insertBookmark(folderId,
- uri,
- PlacesUtils.bookmarks.DEFAULT_INDEX,
- "moz test");
- PlacesUtils.tagging.tagURI(uri, ["tag"]);
- yield PlacesUtils.keywords.insert({ url: uri.spec, keyword: "keyword"});
-
- // Set a large annotation.
- let content = "";
- while (content.length < 1024) {
- content += "0";
- }
- PlacesUtils.annotations.setItemAnnotation(itemId, "test-anno", content, 0,
- PlacesUtils.annotations.EXPIRE_NEVER);
- PlacesUtils.annotations.setPageAnnotation(uri, "test-anno", content, 0,
- PlacesUtils.annotations.EXPIRE_NEVER);
-
- // Request to gather telemetry data.
- Cc["@mozilla.org/places/categoriesStarter;1"]
- .getService(Ci.nsIObserver)
- .observe(null, "gather-telemetry", null);
-
- yield PlacesTestUtils.promiseAsyncUpdates();
-
- // Test expiration probes.
- let timeInMicroseconds = getExpirablePRTime(8);
-
- function newTimeInMicroseconds() {
- timeInMicroseconds = timeInMicroseconds + 1000;
- return timeInMicroseconds;
- }
-
- for (let i = 0; i < 3; i++) {
- yield PlacesTestUtils.addVisits({
- uri: NetUtil.newURI("http://" + i + ".moz.org/"),
- visitDate: newTimeInMicroseconds()
- });
- }
- Services.prefs.setIntPref("places.history.expiration.max_pages", 0);
- yield promiseForceExpirationStep(2);
- yield promiseForceExpirationStep(2);
-
- // Test autocomplete probes.
- /*
- // This is useful for manual testing by changing the minimum time for
- // autocomplete telemetry to 0, but there is no way to artificially delay
- // autocomplete by more than 50ms in a realiable way.
- Services.prefs.setIntPref("browser.urlbar.search.sources", 3);
- Services.prefs.setIntPref("browser.urlbar.default.behavior", 0);
- function AutoCompleteInput(aSearches) {
- this.searches = aSearches;
- }
- AutoCompleteInput.prototype = {
- timeout: 10,
- textValue: "",
- searchParam: "",
- popupOpen: false,
- minResultsForPopup: 0,
- invalidate: function() {},
- disableAutoComplete: false,
- completeDefaultIndex: false,
- get popup() { return this; },
- onSearchBegin: function() {},
- onSearchComplete: function() {},
- setSelectedIndex: function() {},
- get searchCount() { return this.searches.length; },
- getSearchAt: function(aIndex) { return this.searches[aIndex]; },
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsIAutoCompleteInput,
- Ci.nsIAutoCompletePopup,
- ])
- };
- let controller = Cc["@mozilla.org/autocomplete/controller;1"].
- getService(Ci.nsIAutoCompleteController);
- controller.input = new AutoCompleteInput(["unifiedcomplete"]);
- controller.startSearch("moz");
- */
-
- // Test idle probes.
- PlacesUtils.history.QueryInterface(Ci.nsIObserver)
- .observe(null, "idle-daily", null);
- PlacesDBUtils.maintenanceOnIdle();
-
- yield promiseTopicObserved("places-maintenance-finished");
-
- for (let histogramId in histograms) {
- do_print("checking histogram " + histogramId);
- let validate = histograms[histogramId];
- let snapshot = Services.telemetry.getHistogramById(histogramId).snapshot();
- validate(snapshot.sum);
- do_check_true(snapshot.counts.reduce((a, b) => a + b) > 0);
- }
-});
diff --git a/toolkit/components/places/tests/unit/test_update_frecency_after_delete.js b/toolkit/components/places/tests/unit/test_update_frecency_after_delete.js
deleted file mode 100644
index 662ea0841..000000000
--- a/toolkit/components/places/tests/unit/test_update_frecency_after_delete.js
+++ /dev/null
@@ -1,151 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Bug 455315
- * https://bugzilla.mozilla.org/show_bug.cgi?id=412132
- *
- * Ensures that the frecency of a bookmark's URI is what it should be after the
- * bookmark is deleted.
- */
-
-add_task(function* removed_bookmark() {
- do_print("After removing bookmark, frecency of bookmark's URI should be " +
- "zero if URI is unvisited and no longer bookmarked.");
- const TEST_URI = NetUtil.newURI("http://example.com/1");
- let bm = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- title: "bookmark title",
- url: TEST_URI
- });
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- do_print("Bookmarked => frecency of URI should be != 0");
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesUtils.bookmarks.remove(bm);
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- do_print("Unvisited URI no longer bookmarked => frecency should = 0");
- do_check_eq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* removed_but_visited_bookmark() {
- do_print("After removing bookmark, frecency of bookmark's URI should " +
- "not be zero if URI is visited.");
- const TEST_URI = NetUtil.newURI("http://example.com/1");
- let bm = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- title: "bookmark title",
- url: TEST_URI
- });
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- do_print("Bookmarked => frecency of URI should be != 0");
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesTestUtils.addVisits(TEST_URI);
- yield PlacesUtils.bookmarks.remove(bm);
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- do_print("*Visited* URI no longer bookmarked => frecency should != 0");
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* remove_bookmark_still_bookmarked() {
- do_print("After removing bookmark, frecency of bookmark's URI should " +
- "not be zero if URI is still bookmarked.");
- const TEST_URI = NetUtil.newURI("http://example.com/1");
- let bm1 = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- title: "bookmark 1 title",
- url: TEST_URI
- });
- yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- title: "bookmark 2 title",
- url: TEST_URI
- });
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- do_print("Bookmarked => frecency of URI should be != 0");
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesUtils.bookmarks.remove(bm1);
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- do_print("URI still bookmarked => frecency should != 0");
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* cleared_parent_of_visited_bookmark() {
- do_print("After removing all children from bookmark's parent, frecency " +
- "of bookmark's URI should not be zero if URI is visited.");
- const TEST_URI = NetUtil.newURI("http://example.com/1");
- yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- title: "bookmark title",
- url: TEST_URI
- });
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- do_print("Bookmarked => frecency of URI should be != 0");
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesTestUtils.addVisits(TEST_URI);
- PlacesUtils.bookmarks.removeFolderChildren(PlacesUtils.unfiledBookmarksFolderId);
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- do_print("*Visited* URI no longer bookmarked => frecency should != 0");
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-});
-
-add_task(function* cleared_parent_of_bookmark_still_bookmarked() {
- do_print("After removing all children from bookmark's parent, frecency " +
- "of bookmark's URI should not be zero if URI is still " +
- "bookmarked.");
- const TEST_URI = NetUtil.newURI("http://example.com/1");
- yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.toolbarGuid,
- title: "bookmark 1 title",
- url: TEST_URI
- });
-
- let folder = yield PlacesUtils.bookmarks.insert({
- parentGuid: PlacesUtils.bookmarks.unfiledGuid,
- type: PlacesUtils.bookmarks.TYPE_FOLDER,
- title: "bookmark 2 folder"
- });
- yield PlacesUtils.bookmarks.insert({
- title: "bookmark 2 title",
- parentGuid: folder.guid,
- url: TEST_URI
- });
-
- yield PlacesTestUtils.promiseAsyncUpdates();
- do_print("Bookmarked => frecency of URI should be != 0");
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesUtils.bookmarks.remove(folder);
- yield PlacesTestUtils.promiseAsyncUpdates();
- // URI still bookmarked => frecency should != 0.
- do_check_neq(frecencyForUrl(TEST_URI), 0);
-
- yield PlacesUtils.bookmarks.eraseEverything();
- yield PlacesTestUtils.clearHistory();
-});
diff --git a/toolkit/components/places/tests/unit/test_utils_backups_create.js b/toolkit/components/places/tests/unit/test_utils_backups_create.js
deleted file mode 100644
index a30589c44..000000000
--- a/toolkit/components/places/tests/unit/test_utils_backups_create.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- /**
- * Check for correct functionality of bookmarks backups
- */
-
-const NUMBER_OF_BACKUPS = 10;
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* () {
- // Generate random dates.
- let dateObj = new Date();
- let dates = [];
- while (dates.length < NUMBER_OF_BACKUPS) {
- // Use last year to ensure today's backup is the newest.
- let randomDate = new Date(dateObj.getFullYear() - 1,
- Math.floor(12 * Math.random()),
- Math.floor(28 * Math.random()));
- if (!dates.includes(randomDate.getTime()))
- dates.push(randomDate.getTime());
- }
- // Sort dates from oldest to newest.
- dates.sort();
-
- // Get and cleanup the backups folder.
- let backupFolderPath = yield PlacesBackups.getBackupFolder();
- let bookmarksBackupDir = new FileUtils.File(backupFolderPath);
-
- // Fake backups are created backwards to ensure we won't consider file
- // creation time.
- // Create fake backups for the newest dates.
- for (let i = dates.length - 1; i >= 0; i--) {
- let backupFilename = PlacesBackups.getFilenameForDate(new Date(dates[i]));
- let backupFile = bookmarksBackupDir.clone();
- backupFile.append(backupFilename);
- backupFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, parseInt("0666", 8));
- do_print("Creating fake backup " + backupFile.leafName);
- if (!backupFile.exists())
- do_throw("Unable to create fake backup " + backupFile.leafName);
- }
-
- yield PlacesBackups.create(NUMBER_OF_BACKUPS);
- // Add today's backup.
- dates.push(dateObj.getTime());
-
- // Check backups. We have 11 dates but we the max number is 10 so the
- // oldest backup should have been removed.
- for (let i = 0; i < dates.length; i++) {
- let backupFilename;
- let shouldExist;
- let backupFile;
- if (i > 0) {
- let files = bookmarksBackupDir.directoryEntries;
- while (files.hasMoreElements()) {
- let entry = files.getNext().QueryInterface(Ci.nsIFile);
- if (PlacesBackups.filenamesRegex.test(entry.leafName)) {
- backupFilename = entry.leafName;
- backupFile = entry;
- break;
- }
- }
- shouldExist = true;
- }
- else {
- backupFilename = PlacesBackups.getFilenameForDate(new Date(dates[i]));
- backupFile = bookmarksBackupDir.clone();
- backupFile.append(backupFilename);
- shouldExist = false;
- }
- if (backupFile.exists() != shouldExist)
- do_throw("Backup should " + (shouldExist ? "" : "not") + " exist: " + backupFilename);
- }
-
- // Cleanup backups folder.
- // XXX: Can't use bookmarksBackupDir.remove(true) because file lock happens
- // on WIN XP.
- let files = bookmarksBackupDir.directoryEntries;
- while (files.hasMoreElements()) {
- let entry = files.getNext().QueryInterface(Ci.nsIFile);
- entry.remove(false);
- }
- do_check_false(bookmarksBackupDir.directoryEntries.hasMoreElements());
-});
diff --git a/toolkit/components/places/tests/unit/test_utils_getURLsForContainerNode.js b/toolkit/components/places/tests/unit/test_utils_getURLsForContainerNode.js
deleted file mode 100644
index 3e2f88c21..000000000
--- a/toolkit/components/places/tests/unit/test_utils_getURLsForContainerNode.js
+++ /dev/null
@@ -1,181 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- /**
- * Check for correct functionality of PlacesUtils.getURLsForContainerNode and
- * PlacesUtils.hasChildURIs (those helpers share almost all of their code)
- */
-
-var PU = PlacesUtils;
-var hs = PU.history;
-var bs = PU.bookmarks;
-
-var tests = [
-
-function() {
- dump("\n\n*** TEST: folder\n");
- // This is the folder we will check for children.
- var folderId = bs.createFolder(bs.toolbarFolder, "folder", bs.DEFAULT_INDEX);
-
- // Create a folder and a query node inside it, these should not be considered
- // uri nodes.
- bs.createFolder(folderId, "inside folder", bs.DEFAULT_INDEX);
- bs.insertBookmark(folderId, uri("place:sort=1"),
- bs.DEFAULT_INDEX, "inside query");
-
- var query = hs.getNewQuery();
- query.setFolders([bs.toolbarFolder], 1);
- var options = hs.getNewQueryOptions();
-
- dump("Check folder without uri nodes\n");
- check_uri_nodes(query, options, 0);
-
- dump("Check folder with uri nodes\n");
- // Add an uri node, this should be considered.
- bs.insertBookmark(folderId, uri("http://www.mozilla.org/"),
- bs.DEFAULT_INDEX, "bookmark");
- check_uri_nodes(query, options, 1);
-},
-
-function() {
- dump("\n\n*** TEST: folder in an excludeItems root\n");
- // This is the folder we will check for children.
- var folderId = bs.createFolder(bs.toolbarFolder, "folder", bs.DEFAULT_INDEX);
-
- // Create a folder and a query node inside it, these should not be considered
- // uri nodes.
- bs.createFolder(folderId, "inside folder", bs.DEFAULT_INDEX);
- bs.insertBookmark(folderId, uri("place:sort=1"), bs.DEFAULT_INDEX, "inside query");
-
- var query = hs.getNewQuery();
- query.setFolders([bs.toolbarFolder], 1);
- var options = hs.getNewQueryOptions();
- options.excludeItems = true;
-
- dump("Check folder without uri nodes\n");
- check_uri_nodes(query, options, 0);
-
- dump("Check folder with uri nodes\n");
- // Add an uri node, this should be considered.
- bs.insertBookmark(folderId, uri("http://www.mozilla.org/"),
- bs.DEFAULT_INDEX, "bookmark");
- check_uri_nodes(query, options, 1);
-},
-
-function() {
- dump("\n\n*** TEST: query\n");
- // This is the query we will check for children.
- bs.insertBookmark(bs.toolbarFolder, uri("place:folder=BOOKMARKS_MENU&sort=1"),
- bs.DEFAULT_INDEX, "inside query");
-
- // Create a folder and a query node inside it, these should not be considered
- // uri nodes.
- bs.createFolder(bs.bookmarksMenuFolder, "inside folder", bs.DEFAULT_INDEX);
- bs.insertBookmark(bs.bookmarksMenuFolder, uri("place:sort=1"),
- bs.DEFAULT_INDEX, "inside query");
-
- var query = hs.getNewQuery();
- query.setFolders([bs.toolbarFolder], 1);
- var options = hs.getNewQueryOptions();
-
- dump("Check query without uri nodes\n");
- check_uri_nodes(query, options, 0);
-
- dump("Check query with uri nodes\n");
- // Add an uri node, this should be considered.
- bs.insertBookmark(bs.bookmarksMenuFolder, uri("http://www.mozilla.org/"),
- bs.DEFAULT_INDEX, "bookmark");
- check_uri_nodes(query, options, 1);
-},
-
-function() {
- dump("\n\n*** TEST: excludeItems Query\n");
- // This is the query we will check for children.
- bs.insertBookmark(bs.toolbarFolder, uri("place:folder=BOOKMARKS_MENU&sort=8"),
- bs.DEFAULT_INDEX, "inside query");
-
- // Create a folder and a query node inside it, these should not be considered
- // uri nodes.
- bs.createFolder(bs.bookmarksMenuFolder, "inside folder", bs.DEFAULT_INDEX);
- bs.insertBookmark(bs.bookmarksMenuFolder, uri("place:sort=1"),
- bs.DEFAULT_INDEX, "inside query");
-
- var query = hs.getNewQuery();
- query.setFolders([bs.toolbarFolder], 1);
- var options = hs.getNewQueryOptions();
- options.excludeItems = true;
-
- dump("Check folder without uri nodes\n");
- check_uri_nodes(query, options, 0);
-
- dump("Check folder with uri nodes\n");
- // Add an uri node, this should be considered.
- bs.insertBookmark(bs.bookmarksMenuFolder, uri("http://www.mozilla.org/"),
- bs.DEFAULT_INDEX, "bookmark");
- check_uri_nodes(query, options, 1);
-},
-
-function() {
- dump("\n\n*** TEST: !expandQueries Query\n");
- // This is the query we will check for children.
- bs.insertBookmark(bs.toolbarFolder, uri("place:folder=BOOKMARKS_MENU&sort=8"),
- bs.DEFAULT_INDEX, "inside query");
-
- // Create a folder and a query node inside it, these should not be considered
- // uri nodes.
- bs.createFolder(bs.bookmarksMenuFolder, "inside folder", bs.DEFAULT_INDEX);
- bs.insertBookmark(bs.bookmarksMenuFolder, uri("place:sort=1"),
- bs.DEFAULT_INDEX, "inside query");
-
- var query = hs.getNewQuery();
- query.setFolders([bs.toolbarFolder], 1);
- var options = hs.getNewQueryOptions();
- options.expandQueries = false;
-
- dump("Check folder without uri nodes\n");
- check_uri_nodes(query, options, 0);
-
- dump("Check folder with uri nodes\n");
- // Add an uri node, this should be considered.
- bs.insertBookmark(bs.bookmarksMenuFolder, uri("http://www.mozilla.org/"),
- bs.DEFAULT_INDEX, "bookmark");
- check_uri_nodes(query, options, 1);
-}
-
-];
-
-/**
- * Executes a query and checks number of uri nodes in the first container in
- * query's results. To correctly test a container ensure that the query will
- * return only your container in the first level.
- *
- * @param aQuery
- * nsINavHistoryQuery object defining the query
- * @param aOptions
- * nsINavHistoryQueryOptions object defining the query's options
- * @param aExpectedURINodes
- * number of expected uri nodes
- */
-function check_uri_nodes(aQuery, aOptions, aExpectedURINodes) {
- var result = hs.executeQuery(aQuery, aOptions);
- var root = result.root;
- root.containerOpen = true;
- var node = root.getChild(0);
- do_check_eq(PU.hasChildURIs(node), aExpectedURINodes > 0);
- do_check_eq(PU.hasChildURIs(node, true), aExpectedURINodes > 1);
- do_check_eq(PU.getURLsForContainerNode(node).length, aExpectedURINodes);
- root.containerOpen = false;
-}
-
-add_task(function* () {
- for (let test of tests) {
- yield PlacesUtils.bookmarks.eraseEverything();
- test();
- }
-
- // Cleanup.
- yield PlacesUtils.bookmarks.eraseEverything();
-});
diff --git a/toolkit/components/places/tests/unit/test_utils_setAnnotationsFor.js b/toolkit/components/places/tests/unit/test_utils_setAnnotationsFor.js
deleted file mode 100644
index 62947620d..000000000
--- a/toolkit/components/places/tests/unit/test_utils_setAnnotationsFor.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
- /**
- * Check for correct functionality of PlacesUtils.setAnnotationsForItem/URI
- */
-
-var hs = PlacesUtils.history;
-var bs = PlacesUtils.bookmarks;
-var as = PlacesUtils.annotations;
-
-const TEST_URL = "http://test.mozilla.org/";
-
-function run_test() {
- var testURI = uri(TEST_URL);
- // add a bookmark
- var itemId = bs.insertBookmark(bs.unfiledBookmarksFolder, testURI,
- bs.DEFAULT_INDEX, "test");
-
- // create annotations array
- var testAnnos = [{ name: "testAnno/test0",
- flags: 0,
- value: "test0",
- expires: Ci.nsIAnnotationService.EXPIRE_NEVER },
- { name: "testAnno/test1",
- flags: 0,
- value: "test1",
- expires: Ci.nsIAnnotationService.EXPIRE_NEVER },
- { name: "testAnno/test2",
- flags: 0,
- value: "test2",
- expires: Ci.nsIAnnotationService.EXPIRE_NEVER },
- { name: "testAnno/test3",
- flags: 0,
- value: 0,
- expires: Ci.nsIAnnotationService.EXPIRE_NEVER }];
-
- // Add item annotations
- PlacesUtils.setAnnotationsForItem(itemId, testAnnos);
- // Check for correct addition
- testAnnos.forEach(function(anno) {
- do_check_true(as.itemHasAnnotation(itemId, anno.name));
- do_check_eq(as.getItemAnnotation(itemId, anno.name), anno.value);
- });
-
- // Add page annotations
- PlacesUtils.setAnnotationsForURI(testURI, testAnnos);
- // Check for correct addition
- testAnnos.forEach(function(anno) {
- do_check_true(as.pageHasAnnotation(testURI, anno.name));
- do_check_eq(as.getPageAnnotation(testURI, anno.name), anno.value);
- });
-
- // To unset annotations we unset their values or set them to
- // null/undefined
- testAnnos[0].value = null;
- testAnnos[1].value = undefined;
- delete testAnnos[2].value;
- delete testAnnos[3].value;
-
- // Unset all item annotations
- PlacesUtils.setAnnotationsForItem(itemId, testAnnos);
- // Check for correct removal
- testAnnos.forEach(function(anno) {
- do_check_false(as.itemHasAnnotation(itemId, anno.name));
- // sanity: page annotations should not be removed here
- do_check_true(as.pageHasAnnotation(testURI, anno.name));
- });
-
- // Unset all page annotations
- PlacesUtils.setAnnotationsForURI(testURI, testAnnos);
- // Check for correct removal
- testAnnos.forEach(function(anno) {
- do_check_false(as.pageHasAnnotation(testURI, anno.name));
- });
-}
diff --git a/toolkit/components/places/tests/unit/test_visitsInDB.js b/toolkit/components/places/tests/unit/test_visitsInDB.js
deleted file mode 100644
index 3cab39ed9..000000000
--- a/toolkit/components/places/tests/unit/test_visitsInDB.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim:set ts=2 sw=2 sts=2 et: */
-
-add_task(function* test_execute() {
- const TEST_URI = uri("http://mozilla.com");
-
- do_check_eq(0, yield PlacesTestUtils.visitsInDB(TEST_URI));
- yield PlacesTestUtils.addVisits({uri: TEST_URI});
- do_check_eq(1, yield PlacesTestUtils.visitsInDB(TEST_URI));
- yield PlacesTestUtils.addVisits({uri: TEST_URI});
- do_check_eq(2, yield PlacesTestUtils.visitsInDB(TEST_URI));
-});
diff --git a/toolkit/components/places/tests/unit/xpcshell.ini b/toolkit/components/places/tests/unit/xpcshell.ini
deleted file mode 100644
index 60bba4758..000000000
--- a/toolkit/components/places/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,163 +0,0 @@
-[DEFAULT]
-head = head_bookmarks.js
-tail =
-firefox-appdir = browser
-skip-if = toolkit == 'android'
-support-files =
- bookmarks.corrupt.html
- bookmarks.json
- bookmarks.preplaces.html
- bookmarks_html_singleframe.html
- bug476292.sqlite
- corruptDB.sqlite
- default.sqlite
- livemark.xml
- mobile_bookmarks_folder_import.json
- mobile_bookmarks_folder_merge.json
- mobile_bookmarks_multiple_folders.json
- mobile_bookmarks_root_import.json
- mobile_bookmarks_root_merge.json
- nsDummyObserver.js
- nsDummyObserver.manifest
- places.sparse.sqlite
-
-[test_000_frecency.js]
-[test_317472.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_331487.js]
-[test_384370.js]
-[test_385397.js]
-# Bug 676989: test fails consistently on Android
-fail-if = os == "android"
-[test_399264_query_to_string.js]
-[test_399264_string_to_query.js]
-[test_399266.js]
-# Bug 676989: test fails consistently on Android
-fail-if = os == "android"
-# Bug 821781: test fails intermittently on Linux
-skip-if = os == "linux"
-[test_402799.js]
-[test_405497.js]
-[test_408221.js]
-[test_412132.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_413784.js]
-[test_415460.js]
-[test_415757.js]
-[test_418643_removeFolderChildren.js]
-[test_419731.js]
-[test_419792_node_tags_property.js]
-[test_425563.js]
-[test_429505_remove_shortcuts.js]
-[test_433317_query_title_update.js]
-[test_433525_hasChildren_crash.js]
-[test_452777.js]
-[test_454977.js]
-[test_463863.js]
-[test_485442_crash_bug_nsNavHistoryQuery_GetUri.js]
-[test_486978_sort_by_date_queries.js]
-[test_536081.js]
-[test_1085291.js]
-[test_1105208.js]
-[test_1105866.js]
-[test_adaptive.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_adaptive_bug527311.js]
-[test_analyze.js]
-[test_annotations.js]
-[test_asyncExecuteLegacyQueries.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_async_history_api.js]
-[test_async_in_batchmode.js]
-[test_async_transactions.js]
-skip-if = (os == "win" && os_version == "5.1") # Bug 1158887
-[test_autocomplete_stopSearch_no_throw.js]
-[test_bookmark_catobs.js]
-[test_bookmarks_json.js]
-[test_bookmarks_html.js]
-[test_bookmarks_html_corrupt.js]
-[test_bookmarks_html_import_tags.js]
-[test_bookmarks_html_singleframe.js]
-[test_bookmarks_restore_notification.js]
-[test_bookmarks_setNullTitle.js]
-[test_broken_folderShortcut_result.js]
-[test_browserhistory.js]
-[test_bug636917_isLivemark.js]
-[test_childlessTags.js]
-[test_corrupt_telemetry.js]
-[test_crash_476292.js]
-[test_database_replaceOnStartup.js]
-[test_download_history.js]
-# Bug 676989: test fails consistently on Android
-fail-if = os == "android"
-[test_frecency.js]
-[test_frecency_zero_updated.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_getChildIndex.js]
-[test_getPlacesInfo.js]
-[test_history.js]
-[test_history_autocomplete_tags.js]
-[test_history_catobs.js]
-[test_history_clear.js]
-[test_history_notifications.js]
-[test_history_observer.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_history_sidebar.js]
-[test_hosts_triggers.js]
-[test_import_mobile_bookmarks.js]
-[test_isPageInDB.js]
-[test_isURIVisited.js]
-[test_isvisited.js]
-[test_keywords.js]
-[test_lastModified.js]
-[test_markpageas.js]
-[test_mozIAsyncLivemarks.js]
-[test_multi_queries.js]
-# Bug 676989: test fails consistently on Android
-fail-if = os == "android"
-[test_multi_word_tags.js]
-[test_nsINavHistoryViewer.js]
-# Bug 902248: intermittent timeouts on all platforms
-skip-if = true
-[test_null_interfaces.js]
-[test_onItemChanged_tags.js]
-[test_pageGuid_bookmarkGuid.js]
-[test_frecency_observers.js]
-[test_placeURIs.js]
-[test_PlacesSearchAutocompleteProvider.js]
-[test_PlacesUtils_asyncGetBookmarkIds.js]
-[test_PlacesUtils_invalidateCachedGuidFor.js]
-[test_PlacesUtils_lazyobservers.js]
-[test_placesTxn.js]
-[test_preventive_maintenance.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_preventive_maintenance_checkAndFixDatabase.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_preventive_maintenance_runTasks.js]
-[test_promiseBookmarksTree.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_resolveNullBookmarkTitles.js]
-[test_result_sort.js]
-[test_resultsAsVisit_details.js]
-[test_sql_guid_functions.js]
-[test_svg_favicon.js]
-[test_sync_utils.js]
-[test_tag_autocomplete_search.js]
-[test_tagging.js]
-[test_telemetry.js]
-[test_update_frecency_after_delete.js]
-# Bug 676989: test hangs consistently on Android
-skip-if = os == "android"
-[test_utils_backups_create.js]
-[test_utils_getURLsForContainerNode.js]
-[test_utils_setAnnotationsFor.js]
-[test_visitsInDB.js]
diff --git a/toolkit/components/printing/content/printPreviewBindings.xml b/toolkit/components/printing/content/printPreviewBindings.xml
index 182ecc199..c33b22e36 100644
--- a/toolkit/components/printing/content/printPreviewBindings.xml
+++ b/toolkit/components/printing/content/printPreviewBindings.xml
@@ -161,10 +161,14 @@
let $ = id => document.getAnonymousElementByAttribute(this, "anonid", id);
let ltr = document.documentElement.matches(":root:-moz-locale-dir(ltr)");
+#ifdef XP_WIN
// Windows 7 doesn't support â® and â­ by default, and fallback doesn't
// always work (bug 1343330).
- let {AppConstants} = Components.utils.import("resource://gre/modules/AppConstants.jsm", {});
- let useCompatCharacters = AppConstants.isPlatformAndVersionAtMost("win", "6.1");
+ let useCompatCharacters = Services.vc.compare(Services.sysinfo.getProperty("version"), "6.1") <= 0;
+#else
+ let useCompatCharacters = false;
+#endif
+
let leftEnd = useCompatCharacters ? "âª" : "â®";
let rightEnd = useCompatCharacters ? "â©" : "â­";
$("navigateHome").label = ltr ? leftEnd : rightEnd;
diff --git a/toolkit/components/printing/jar.mn b/toolkit/components/printing/jar.mn
index 40f9acf2b..a0e951030 100644
--- a/toolkit/components/printing/jar.mn
+++ b/toolkit/components/printing/jar.mn
@@ -13,7 +13,7 @@ toolkit.jar:
#endif
content/global/printPageSetup.js (content/printPageSetup.js)
content/global/printPageSetup.xul (content/printPageSetup.xul)
- content/global/printPreviewBindings.xml (content/printPreviewBindings.xml)
+* content/global/printPreviewBindings.xml (content/printPreviewBindings.xml)
content/global/printPreviewProgress.js (content/printPreviewProgress.js)
content/global/printPreviewProgress.xul (content/printPreviewProgress.xul)
content/global/printProgress.js (content/printProgress.js)
diff --git a/toolkit/components/printing/moz.build b/toolkit/components/printing/moz.build
index dc8204b8c..aac3a838c 100644
--- a/toolkit/components/printing/moz.build
+++ b/toolkit/components/printing/moz.build
@@ -5,10 +5,3 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
JAR_MANIFESTS += ['jar.mn']
-
-BROWSER_CHROME_MANIFESTS += [
- 'tests/browser.ini'
-]
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Printing')
diff --git a/toolkit/components/printing/tests/browser.ini b/toolkit/components/printing/tests/browser.ini
deleted file mode 100644
index 5f2867189..000000000
--- a/toolkit/components/printing/tests/browser.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[browser_page_change_print_original.js]
-support-files =
- file_page_change_print_original_1.html
- file_page_change_print_original_2.html
-skip-if = os == "mac"
diff --git a/toolkit/components/printing/tests/browser_page_change_print_original.js b/toolkit/components/printing/tests/browser_page_change_print_original.js
deleted file mode 100644
index 864150451..000000000
--- a/toolkit/components/printing/tests/browser_page_change_print_original.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Verify that if the page contents change after print preview is initialized,
- * and we re-initialize print preview (e.g. by changing page orientation),
- * we still show (and will therefore print) the original contents.
- */
-const TEST_PATH = getRootDirectory(gTestPath)
- .replace("chrome://mochitests/content", "http://example.com");
-
-add_task(function* pp_after_orientation_change() {
- const URI = TEST_PATH + "file_page_change_print_original_1.html";
- // Can only do something if we have a print preview UI:
- if (AppConstants.platform != "win" && AppConstants.platform != "linux") {
- ok(true, "Can't test if there's no print preview.");
- return;
- }
-
- // Ensure we get a browserStopped for this browser
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, URI, false, true);
- let browserToPrint = tab.linkedBrowser;
- let ppBrowser = PrintPreviewListener.getPrintPreviewBrowser();
-
- // Get a promise now that resolves when the original tab's location changes.
- let originalTabNavigated = BrowserTestUtils.browserStopped(browserToPrint);
-
- // Enter print preview:
- let printPreviewEntered = BrowserTestUtils.waitForMessage(ppBrowser.messageManager, "Printing:Preview:Entered");
- document.getElementById("cmd_printPreview").doCommand();
- yield printPreviewEntered;
-
- // Assert that we are showing the original page
- yield ContentTask.spawn(ppBrowser, null, function* () {
- is(content.document.body.textContent.trim(), "INITIAL PAGE", "Should have initial page print previewed.");
- });
-
- yield originalTabNavigated;
-
- // Change orientation and wait for print preview to re-enter:
- let orient = PrintUtils.getPrintSettings().orientation;
- let orientToSwitchTo = orient != Ci.nsIPrintSettings.kPortraitOrientation ?
- "portrait" : "landscape";
- let printPreviewToolbar = document.querySelector("toolbar[printpreview=true]");
-
- printPreviewEntered = BrowserTestUtils.waitForMessage(ppBrowser.messageManager, "Printing:Preview:Entered");
- printPreviewToolbar.orient(orientToSwitchTo);
- yield printPreviewEntered;
-
- // Check that we're still showing the original page.
- yield ContentTask.spawn(ppBrowser, null, function* () {
- is(content.document.body.textContent.trim(), "INITIAL PAGE", "Should still have initial page print previewed.");
- });
-
- // Check that the other tab is definitely showing the new page:
- yield ContentTask.spawn(browserToPrint, null, function* () {
- is(content.document.body.textContent.trim(), "REPLACED PAGE!", "Original page should have changed.");
- });
-
- PrintUtils.exitPrintPreview();
-
- yield BrowserTestUtils.removeTab(tab);
-});
diff --git a/toolkit/components/printing/tests/file_page_change_print_original_1.html b/toolkit/components/printing/tests/file_page_change_print_original_1.html
deleted file mode 100644
index 76e3be137..000000000
--- a/toolkit/components/printing/tests/file_page_change_print_original_1.html
+++ /dev/null
@@ -1,8 +0,0 @@
-<script>
-window.onafterprint = function() {
- setTimeout(function() {
- window.location = "file_page_change_print_original_2.html"
- }, 0);
-}
-</script>
-<pre>INITIAL PAGE</pre>
diff --git a/toolkit/components/printing/tests/file_page_change_print_original_2.html b/toolkit/components/printing/tests/file_page_change_print_original_2.html
deleted file mode 100644
index 44f33281c..000000000
--- a/toolkit/components/printing/tests/file_page_change_print_original_2.html
+++ /dev/null
@@ -1 +0,0 @@
-REPLACED PAGE!
diff --git a/toolkit/components/promiseworker/moz.build b/toolkit/components/promiseworker/moz.build
index 44a90e679..1c771464d 100644
--- a/toolkit/components/promiseworker/moz.build
+++ b/toolkit/components/promiseworker/moz.build
@@ -4,15 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-DIRS += [
- 'worker'
-]
+DIRS += ['worker']
-EXTRA_JS_MODULES += [
- 'PromiseWorker.jsm',
-]
-
-XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Async Tooling')
+EXTRA_JS_MODULES += ['PromiseWorker.jsm']
diff --git a/toolkit/components/promiseworker/tests/xpcshell/.eslintrc.js b/toolkit/components/promiseworker/tests/xpcshell/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/promiseworker/tests/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/promiseworker/tests/xpcshell/data/chrome.manifest b/toolkit/components/promiseworker/tests/xpcshell/data/chrome.manifest
deleted file mode 100644
index 9e5dd29b2..000000000
--- a/toolkit/components/promiseworker/tests/xpcshell/data/chrome.manifest
+++ /dev/null
@@ -1 +0,0 @@
-content promiseworker ./
diff --git a/toolkit/components/promiseworker/tests/xpcshell/data/worker.js b/toolkit/components/promiseworker/tests/xpcshell/data/worker.js
deleted file mode 100644
index b4750788b..000000000
--- a/toolkit/components/promiseworker/tests/xpcshell/data/worker.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Trivial worker definition
-
-importScripts("resource://gre/modules/workers/require.js");
-var PromiseWorker = require("resource://gre/modules/workers/PromiseWorker.js");
-
-var worker = new PromiseWorker.AbstractWorker();
-worker.dispatch = function(method, args = []) {
- return Agent[method](...args);
-},
-worker.postMessage = function(...args) {
- self.postMessage(...args);
-};
-worker.close = function() {
- self.close();
-};
-worker.log = function(...args) {
- dump("Worker: " + args.join(" ") + "\n");
-};
-self.addEventListener("message", msg => worker.handleMessage(msg));
-
-var Agent = {
- bounce: function(...args) {
- return args;
- },
-
- throwError: function(msg, ...args) {
- throw new Error(msg);
- },
-};
diff --git a/toolkit/components/promiseworker/tests/xpcshell/test_Promise.js b/toolkit/components/promiseworker/tests/xpcshell/test_Promise.js
deleted file mode 100644
index 70f49e92e..000000000
--- a/toolkit/components/promiseworker/tests/xpcshell/test_Promise.js
+++ /dev/null
@@ -1,117 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var Cu = Components.utils;
-
-Cu.import("resource://gre/modules/PromiseWorker.jsm", this);
-Cu.import("resource://gre/modules/Timer.jsm", this);
-
-// Worker must be loaded from a chrome:// uri, not a file://
-// uri, so we first need to load it.
-
-var WORKER_SOURCE_URI = "chrome://promiseworker/content/worker.js";
-do_load_manifest("data/chrome.manifest");
-var worker = new BasePromiseWorker(WORKER_SOURCE_URI);
-worker.log = function(...args) {
- do_print("Controller: " + args.join(" "));
-};
-
-// Test that simple messages work
-add_task(function* test_simple_args() {
- let message = ["test_simple_args", Math.random()];
- let result = yield worker.post("bounce", message);
- Assert.equal(JSON.stringify(result), JSON.stringify(message));
-});
-
-// Test that it works when we don't provide a message
-add_task(function* test_no_args() {
- let result = yield worker.post("bounce");
- Assert.equal(JSON.stringify(result), JSON.stringify([]));
-});
-
-// Test that messages with promise work
-add_task(function* test_promise_args() {
- let message = ["test_promise_args", Promise.resolve(Math.random())];
- let stringified = JSON.stringify((yield Promise.resolve(Promise.all(message))));
- let result = yield worker.post("bounce", message);
- Assert.equal(JSON.stringify(result), stringified);
-});
-
-// Test that messages with delayed promise work
-add_task(function* test_delayed_promise_args() {
- let promise = new Promise(resolve => setTimeout(() => resolve(Math.random()), 10));
- let message = ["test_delayed_promise_args", promise];
- let stringified = JSON.stringify((yield Promise.resolve(Promise.all(message))));
- let result = yield worker.post("bounce", message);
- Assert.equal(JSON.stringify(result), stringified);
-});
-
-// Test that messages with rejected promise cause appropriate errors
-add_task(function* test_rejected_promise_args() {
- let error = new Error();
- let message = ["test_promise_args", Promise.reject(error)];
- try {
- yield worker.post("bounce", message);
- do_throw("I shound have thrown an error by now");
- } catch (ex) {
- if (ex != error)
- throw ex;
- do_print("I threw the right error");
- }
-});
-
-// Test that we can transfer to the worker using argument `transfer`
-add_task(function* test_transfer_args() {
- let array = new Uint8Array(4);
- for (let i = 0; i < 4; ++i) {
- array[i] = i;
- }
- Assert.equal(array.buffer.byteLength, 4, "The buffer is not detached yet");
-
- let result = (yield worker.post("bounce", [array.buffer], [], [array.buffer]))[0];
-
- // Check that the buffer has been sent
- Assert.equal(array.buffer.byteLength, 0, "The buffer has been detached");
-
- // Check that the result is correct
- Assert.equal(result.byteLength, 4, "The result has the right size");
- let array2 = new Uint8Array(result);
- for (let i = 0; i < 4; ++i) {
- Assert.equal(array2[i], i);
- }
-});
-
-// Test that we can transfer to the worker using an instance of `Meta`
-add_task(function* test_transfer_with_meta() {
- let array = new Uint8Array(4);
- for (let i = 0; i < 4; ++i) {
- array[i] = i;
- }
- Assert.equal(array.buffer.byteLength, 4, "The buffer is not detached yet");
-
- let message = new BasePromiseWorker.Meta(array, {transfers: [array.buffer]});
- let result = (yield worker.post("bounce", [message]))[0];
-
- // Check that the buffer has been sent
- Assert.equal(array.buffer.byteLength, 0, "The buffer has been detached");
-
- // Check that the result is correct
- Assert.equal(Object.prototype.toString.call(result), "[object Uint8Array]",
- "The result appears to be a Typed Array");
- Assert.equal(result.byteLength, 4, "The result has the right size");
-
- for (let i = 0; i < 4; ++i) {
- Assert.equal(result[i], i);
- }
-});
-
-add_task(function* test_throw_error() {
- try {
- yield worker.post("throwError", ["error message"]);
- Assert.ok(false, "should have thrown");
- } catch (ex) {
- Assert.equal(ex.message, "Error: error message");
- }
-});
diff --git a/toolkit/components/promiseworker/tests/xpcshell/xpcshell.ini b/toolkit/components/promiseworker/tests/xpcshell/xpcshell.ini
deleted file mode 100644
index 1efcd8c9e..000000000
--- a/toolkit/components/promiseworker/tests/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-[DEFAULT]
-head=
-tail=
-skip-if = toolkit == 'android'
-support-files=
- data/worker.js
- data/chrome.manifest
-
-[test_Promise.js]
diff --git a/toolkit/components/prompts/moz.build b/toolkit/components/prompts/moz.build
index 1dc21cca6..b827a11b6 100644
--- a/toolkit/components/prompts/moz.build
+++ b/toolkit/components/prompts/moz.build
@@ -6,6 +6,4 @@
DIRS += ['src']
-MOCHITEST_MANIFESTS += ['test/mochitest.ini']
-
JAR_MANIFESTS += ['jar.mn']
diff --git a/toolkit/components/prompts/test/.eslintrc.js b/toolkit/components/prompts/test/.eslintrc.js
deleted file mode 100644
index 3c788d6d6..000000000
--- a/toolkit/components/prompts/test/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/mochitest.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/prompts/test/bug619644_inner.html b/toolkit/components/prompts/test/bug619644_inner.html
deleted file mode 100644
index f929c5649..000000000
--- a/toolkit/components/prompts/test/bug619644_inner.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<head></head><body><p>Original content</p>
-<script>
- window.opener.postMessage("", "*");
- confirm ("Message");
- document.write ("Extra content");
- window.opener.postMessage(document.documentElement.innerHTML, "*");
-</script></body>
diff --git a/toolkit/components/prompts/test/bug625187_iframe.html b/toolkit/components/prompts/test/bug625187_iframe.html
deleted file mode 100644
index 740d59a61..000000000
--- a/toolkit/components/prompts/test/bug625187_iframe.html
+++ /dev/null
@@ -1,16 +0,0 @@
-<html>
-<head>
- <title>Test for Bug 625187 - the iframe</title>
-<!--
- - Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/
- -
- - Contributor(s):
- - Mihai Sucan <mihai.sucan@gmail.com>
- -->
-</head>
-<body>
-<p><button id="btn1" onclick="alert('hello world 2')">Button 2</button></p>
-<p><button id="btn2" onclick="window.parent.alert('hello world 3')">Button 3</button></p>
-</body>
-</html>
diff --git a/toolkit/components/prompts/test/chromeScript.js b/toolkit/components/prompts/test/chromeScript.js
deleted file mode 100644
index 7b2d37100..000000000
--- a/toolkit/components/prompts/test/chromeScript.js
+++ /dev/null
@@ -1,241 +0,0 @@
-const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/Timer.jsm");
-
-// Define these to make EventUtils happy.
-let window = this;
-let parent = {};
-
-let EventUtils = {};
-Services.scriptloader.loadSubScript(
- "chrome://mochikit/content/tests/SimpleTest/EventUtils.js",
- EventUtils
-);
-
-addMessageListener("handlePrompt", msg => {
- handlePromptWhenItAppears(msg.action, msg.isTabModal, msg.isSelect);
-});
-
-function handlePromptWhenItAppears(action, isTabModal, isSelect) {
- let interval = setInterval(() => {
- if (handlePrompt(action, isTabModal, isSelect)) {
- clearInterval(interval);
- }
- }, 100);
-}
-
-function handlePrompt(action, isTabModal, isSelect) {
- let ui;
-
- if (isTabModal) {
- let browserWin = Services.wm.getMostRecentWindow("navigator:browser");
- let gBrowser = browserWin.gBrowser;
- let promptManager = gBrowser.getTabModalPromptBox(gBrowser.selectedBrowser);
- let prompts = promptManager.listPrompts();
- if (!prompts.length) {
- return false; // try again in a bit
- }
-
- ui = prompts[0].Dialog.ui;
- } else {
- let doc = getDialogDoc();
- if (!doc) {
- return false; // try again in a bit
- }
-
- if (isSelect)
- ui = doc;
- else
- ui = doc.defaultView.Dialog.ui;
-
- }
-
- let promptState;
- if (isSelect) {
- promptState = getSelectState(ui);
- dismissSelect(ui, action);
- } else {
- promptState = getPromptState(ui);
- dismissPrompt(ui, action);
- }
- sendAsyncMessage("promptHandled", { promptState: promptState });
- return true;
-}
-
-function getSelectState(ui) {
- let listbox = ui.getElementById("list");
-
- let state = {};
- state.msg = ui.getElementById("info.txt").value;
- state.selectedIndex = listbox.selectedIndex;
- state.items = [];
-
- for (let i = 0; i < listbox.itemCount; i++) {
- let item = listbox.getItemAtIndex(i).label;
- state.items.push(item);
- }
-
- return state;
-}
-
-function getPromptState(ui) {
- let state = {};
- state.msg = ui.infoBody.textContent;
- state.titleHidden = ui.infoTitle.getAttribute("hidden") == "true";
- state.textHidden = ui.loginContainer.hidden;
- state.passHidden = ui.password1Container.hidden;
- state.checkHidden = ui.checkboxContainer.hidden;
- state.checkMsg = ui.checkbox.label;
- state.checked = ui.checkbox.checked;
- // tab-modal prompts don't have an infoIcon
- state.iconClass = ui.infoIcon ? ui.infoIcon.className : null;
- state.textValue = ui.loginTextbox.getAttribute("value");
- state.passValue = ui.password1Textbox.getAttribute("value");
-
- state.butt0Label = ui.button0.label;
- state.butt1Label = ui.button1.label;
- state.butt2Label = ui.button2.label;
-
- state.butt0Disabled = ui.button0.disabled;
- state.butt1Disabled = ui.button1.disabled;
- state.butt2Disabled = ui.button2.disabled;
-
- function isDefaultButton(b) {
- return (b.hasAttribute("default") &&
- b.getAttribute("default") == "true");
- }
- state.defButton0 = isDefaultButton(ui.button0);
- state.defButton1 = isDefaultButton(ui.button1);
- state.defButton2 = isDefaultButton(ui.button2);
-
- let fm = Cc["@mozilla.org/focus-manager;1"].
- getService(Ci.nsIFocusManager);
- let e = fm.focusedElement;
-
- if (e == null) {
- state.focused = null;
- } else if (ui.button0.isSameNode(e)) {
- state.focused = "button0";
- } else if (ui.button1.isSameNode(e)) {
- state.focused = "button1";
- } else if (ui.button2.isSameNode(e)) {
- state.focused = "button2";
- } else if (ui.loginTextbox.inputField.isSameNode(e)) {
- state.focused = "textField";
- } else if (ui.password1Textbox.inputField.isSameNode(e)) {
- state.focused = "passField";
- } else if (ui.infoBody.isSameNode(e)) {
- state.focused = "infoBody";
- } else {
- state.focused = "ERROR: unexpected element focused: " + (e ? e.localName : "<null>");
- }
-
- return state;
-}
-
-function dismissSelect(ui, action) {
- let dialog = ui.getElementsByTagName("dialog")[0];
- let listbox = ui.getElementById("list");
-
- if (action.selectItem) {
- listbox.selectedIndex = 1;
- }
-
- if (action.buttonClick == "ok") {
- dialog.acceptDialog();
- } else if (action.buttonClick == "cancel") {
- dialog.cancelDialog();
- }
-}
-
-function dismissPrompt(ui, action) {
- if (action.setCheckbox) {
- // Annoyingly, the prompt code is driven by oncommand.
- ui.checkbox.setChecked(true);
- ui.checkbox.doCommand();
- }
-
- if ("textField" in action) {
- ui.loginTextbox.setAttribute("value", action.textField);
- }
-
- if ("passField" in action) {
- ui.password1Textbox.setAttribute("value", action.passField);
- }
-
- switch (action.buttonClick) {
- case "ok":
- case 0:
- ui.button0.click();
- break;
- case "cancel":
- case 1:
- ui.button1.click();
- break;
- case 2:
- ui.button2.click();
- break;
- case "ESC":
- // XXX This is assuming tab-modal.
- let browserWin = Services.wm.getMostRecentWindow("navigator:browser");
- EventUtils.synthesizeKey("KEY_Escape", { code: "Escape" }, browserWin);
- break;
- case "pollOK":
- // Buttons are disabled at the moment, poll until they're reenabled.
- // Can't use setInterval here, because the window's in a modal state
- // and thus DOM events are suppressed.
- let interval = setInterval(() => {
- if (ui.button0.disabled)
- return;
- ui.button0.click();
- clearInterval(interval);
- }, 100);
- break;
-
- default:
- throw "dismissPrompt action listed unknown button.";
- }
-}
-
-function getDialogDoc() {
- // Trudge through all the open windows, until we find the one
- // that has either commonDialog.xul or selectDialog.xul loaded.
- var wm = Cc["@mozilla.org/appshell/window-mediator;1"].
- getService(Ci.nsIWindowMediator);
- // var enumerator = wm.getEnumerator("navigator:browser");
- var enumerator = wm.getXULWindowEnumerator(null);
-
- while (enumerator.hasMoreElements()) {
- var win = enumerator.getNext();
- var windowDocShell = win.QueryInterface(Ci.nsIXULWindow).docShell;
-
- var containedDocShells = windowDocShell.getDocShellEnumerator(
- Ci.nsIDocShellTreeItem.typeChrome,
- Ci.nsIDocShell.ENUMERATE_FORWARDS);
- while (containedDocShells.hasMoreElements()) {
- // Get the corresponding document for this docshell
- var childDocShell = containedDocShells.getNext();
- // We don't want it if it's not done loading.
- if (childDocShell.busyFlags != Ci.nsIDocShell.BUSY_FLAGS_NONE)
- continue;
- var childDoc = childDocShell.QueryInterface(Ci.nsIDocShell)
- .contentViewer
- .DOMDocument;
-
- if (childDoc.location.href != "chrome://global/content/commonDialog.xul" &&
- childDoc.location.href != "chrome://global/content/selectDialog.xul")
- continue;
-
- // We're expecting the dialog to be focused. If it's not yet, try later.
- // (In particular, this is needed on Linux to reliably check focused elements.)
- let fm = Cc["@mozilla.org/focus-manager;1"].
- getService(Ci.nsIFocusManager);
- if (fm.focusedWindow != childDoc.defaultView)
- continue;
-
- return childDoc;
- }
- }
-
- return null;
-}
diff --git a/toolkit/components/prompts/test/mochitest.ini b/toolkit/components/prompts/test/mochitest.ini
deleted file mode 100644
index 7f87650d6..000000000
--- a/toolkit/components/prompts/test/mochitest.ini
+++ /dev/null
@@ -1,19 +0,0 @@
-[DEFAULT]
-support-files =
- ../../passwordmgr/test/authenticate.sjs
- bug619644_inner.html
- bug625187_iframe.html
- prompt_common.js
- chromeScript.js
-
-[test_bug619644.html]
-[test_bug620145.html]
-skip-if = toolkit == 'android' #TIMED_OUT
-[test_subresources_prompts.html]
-skip-if = toolkit == 'android'
-[test_dom_prompts.html]
-skip-if = toolkit == 'android' #android: bug 1267092
-[test_modal_prompts.html]
-skip-if = toolkit == 'android' || (os == 'linux' && (debug || asan)) #android: TIMED_OUT (For Linux : 950636)
-[test_modal_select.html]
-skip-if = toolkit == 'android' #android: TIMED_OUT
diff --git a/toolkit/components/prompts/test/prompt_common.js b/toolkit/components/prompts/test/prompt_common.js
deleted file mode 100644
index e3a69b347..000000000
--- a/toolkit/components/prompts/test/prompt_common.js
+++ /dev/null
@@ -1,158 +0,0 @@
-const Ci = SpecialPowers.Ci;
-const Cc = SpecialPowers.Cc;
-ok(Ci != null, "Access Ci");
-ok(Cc != null, "Access Cc");
-
-function hasTabModalPrompts() {
- var prefName = "prompts.tab_modal.enabled";
- var Services = SpecialPowers.Cu.import("resource://gre/modules/Services.jsm").Services;
- return Services.prefs.getPrefType(prefName) == Services.prefs.PREF_BOOL &&
- Services.prefs.getBoolPref(prefName);
-}
-var isTabModal = hasTabModalPrompts();
-var isSelectDialog = false;
-var isOSX = ("nsILocalFileMac" in SpecialPowers.Ci);
-var isE10S = SpecialPowers.Services.appinfo.processType == 2;
-
-
-var gChromeScript = SpecialPowers.loadChromeScript(SimpleTest.getTestFileURL("chromeScript.js"));
-SimpleTest.registerCleanupFunction(() => gChromeScript.destroy());
-
-function onloadPromiseFor(id) {
- var iframe = document.getElementById(id);
- return new Promise(resolve => {
- iframe.addEventListener("load", function onload(e) {
- iframe.removeEventListener("load", onload);
- resolve(true);
- });
- });
-}
-
-function handlePrompt(state, action) {
- return new Promise(resolve => {
- gChromeScript.addMessageListener("promptHandled", function handled(msg) {
- gChromeScript.removeMessageListener("promptHandled", handled);
- checkPromptState(msg.promptState, state);
- resolve(true);
- });
- gChromeScript.sendAsyncMessage("handlePrompt", { action: action, isTabModal: isTabModal});
- });
-}
-
-function checkPromptState(promptState, expectedState) {
- // XXX check title? OS X has title in content
- is(promptState.msg, expectedState.msg, "Checking expected message");
- if (isOSX && !isTabModal)
- ok(!promptState.titleHidden, "Checking title always visible on OS X");
- else
- is(promptState.titleHidden, expectedState.titleHidden, "Checking title visibility");
- is(promptState.textHidden, expectedState.textHidden, "Checking textbox visibility");
- is(promptState.passHidden, expectedState.passHidden, "Checking passbox visibility");
- is(promptState.checkHidden, expectedState.checkHidden, "Checking checkbox visibility");
- is(promptState.checkMsg, expectedState.checkMsg, "Checking checkbox label");
- is(promptState.checked, expectedState.checked, "Checking checkbox checked");
- if (!isTabModal)
- is(promptState.iconClass, "spaced " + expectedState.iconClass, "Checking expected icon CSS class");
- is(promptState.textValue, expectedState.textValue, "Checking textbox value");
- is(promptState.passValue, expectedState.passValue, "Checking passbox value");
-
- if (expectedState.butt0Label) {
- is(promptState.butt0Label, expectedState.butt0Label, "Checking accept-button label");
- }
- if (expectedState.butt1Label) {
- is(promptState.butt1Label, expectedState.butt1Label, "Checking cancel-button label");
- }
- if (expectedState.butt2Label) {
- is(promptState.butt2Label, expectedState.butt2Label, "Checking extra1-button label");
- }
-
- // For prompts with a time-delay button.
- if (expectedState.butt0Disabled) {
- is(promptState.butt0Disabled, true, "Checking accept-button is disabled");
- is(promptState.butt1Disabled, false, "Checking cancel-button isn't disabled");
- }
-
- is(promptState.defButton0, expectedState.defButton == "button0", "checking button0 default");
- is(promptState.defButton1, expectedState.defButton == "button1", "checking button1 default");
- is(promptState.defButton2, expectedState.defButton == "button2", "checking button2 default");
-
- if (isOSX && expectedState.focused && expectedState.focused.startsWith("button")) {
- is(promptState.focused, "infoBody", "buttons don't focus on OS X, but infoBody does instead");
- } else {
- is(promptState.focused, expectedState.focused, "Checking focused element");
- }
-}
-
-function checkEchoedAuthInfo(expectedState, doc) {
- // The server echos back the HTTP auth info it received.
- let username = doc.getElementById("user").textContent;
- let password = doc.getElementById("pass").textContent;
- let authok = doc.getElementById("ok").textContent;
-
- is(authok, "PASS", "Checking for successful authentication");
- is(username, expectedState.user, "Checking for echoed username");
- is(password, expectedState.pass, "Checking for echoed password");
-}
-
-/**
- * Create a Proxy to relay method calls on an nsIAuthPrompt[2] prompter to a chrome script which can
- * perform the calls in the parent. Out and inout params will be copied back from the parent to
- * content.
- *
- * @param chromeScript The reference to the chrome script that will listen to `proxyPrompter`
- * messages in the parent and call the `methodName` method.
- * The return value from the message handler should be an object with properties:
- * `rv` - containing the return value of the method call.
- * `args` - containing the array of arguments passed to the method since out or inout ones could have
- * been modified.
- */
-function PrompterProxy(chromeScript) {
- return new Proxy({}, {
- get(target, prop, receiver) {
- return (...args) => {
- // Array of indices of out/inout params to copy from the parent back to the caller.
- let outParams = [];
-
- switch (prop) {
- case "prompt": {
- outParams = [/* result */ 5];
- break;
- }
- case "promptAuth": {
- outParams = [];
- break;
- }
- case "promptPassword": {
- outParams = [/* pwd */ 4];
- break;
- }
- case "promptUsernameAndPassword": {
- outParams = [/* user */ 4, /* pwd */ 5];
- break;
- }
- default: {
- throw new Error("Unknown nsIAuthPrompt method");
- }
- }
-
- let result = chromeScript.sendSyncMessage("proxyPrompter", {
- args,
- methodName: prop,
- })[0][0];
-
- for (let outParam of outParams) {
- // Copy the out or inout param value over the original
- args[outParam].value = result.args[outParam].value;
- }
-
- if (prop == "promptAuth") {
- args[2].username = result.args[2].username;
- args[2].password = result.args[2].password;
- args[2].domain = result.args[2].domain;
- }
-
- return result.rv;
- };
- },
- });
-}
diff --git a/toolkit/components/prompts/test/test_bug619644.html b/toolkit/components/prompts/test/test_bug619644.html
deleted file mode 100644
index 9f61eb18b..000000000
--- a/toolkit/components/prompts/test/test_bug619644.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=619644
--->
-<head>
- <title>Test for Bug 619644</title>
- <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=619644">Mozilla Bug 619644</a>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-// This is a little yucky, but it works
-// The contents of bug619644_inner.html
-const expectedFinalDoc =
-"<head><\/head><body><p>Original content<\/p>\n<script>\n window.opener.postMessage(\"\", \"*\");\n confirm (\"Message\");\n document.write (\"Extra content\");\n window.opener.postMessage(document.documentElement.innerHTML, \"*\");\n<\/script>Extra content<\/body>";
-
-if (!isTabModal) {
- todo(false, "Test disabled when tab modal prompts are not enabled.");
-} else {
- inittest();
-}
-
-var promptDone;
-
-function inittest() {
- window.addEventListener("message", runtest, false);
- window.open("bug619644_inner.html", "619644");
-
- SimpleTest.waitForExplicitFinish();
-}
-
-function runtest(e) {
- window.removeEventListener("message", runtest, false);
- window.addEventListener("message", checktest, false);
-
- let state = {
- msg : "Message",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- let action = {
- buttonClick: "ESC",
- };
-
- promptDone = handlePrompt(state, action);
-}
-
-function checktest(e) {
- is(e.data, expectedFinalDoc, "ESC press should not abort document load");
- e.source.close();
- promptDone.then(endtest);
-}
-
-function endtest() {
- info("Ending test");
- SimpleTest.finish();
-}
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/prompts/test/test_bug620145.html b/toolkit/components/prompts/test/test_bug620145.html
deleted file mode 100644
index bb4470259..000000000
--- a/toolkit/components/prompts/test/test_bug620145.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<html>
-<head>
- <title>Test for Bug 620145</title>
- <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=620145">Mozilla Bug 620145</a>
-<pre id="test">
-</pre>
-
-<div id="text" style="max-width: 100px" onmouseup="openAlert()">
- This is a short piece of text used for testing that mouse selecting is
- stopped when an alert appears.
-</div>
-<div id="text2" style="max-width: 100px">
- This is another short piece of text used for testing that mouse selecting is
- stopped when an alert appears.
-</div>
-<button id="button" onmouseup="openAlert()">Button</button>
-
-<script class="testbody" type="text/javascript">
-var selectionTest = false;
-
-function openAlert() {
- info("opening alert...");
- alert("hello!");
- info("...alert done.");
-}
-
-add_task(function* runTest() {
- var state, action;
- // The <button> in this test's HTML opens a prompt when clicked.
- // Here we send the events to simulate clicking it.
- info("isTabModal? " + isTabModal);
- selectionTest = isTabModal;
-
- state = {
- msg : "hello!",
- iconClass : "alert-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- var button = $("button");
- dispatchMouseEvent(button, "mousedown");
- dispatchMouseEvent(button, "mouseup");
- // alert appears at this point, to be closed by the chrome script.
-
- yield promptDone;
- checkSelection();
-
- // using same state and action.
- promptDone = handlePrompt(state, action);
-
- var text = $("text");
- dispatchMouseEvent(text, "mousedown");
- dispatchMouseEvent(text, "mouseup");
- // alert appears at this point, to be closed by the chrome script.
-
- yield promptDone;
- checkSelection();
-});
-
-function dispatchMouseEvent(target, type)
-{
- var win = target.ownerDocument.defaultView;
- e = document.createEvent("MouseEvent");
- e.initEvent(type, false, false, win, 0, 1, 1, 1, 1,
- false, false, false, false, 0, null);
- var utils = SpecialPowers.getDOMWindowUtils(win);
- utils.dispatchDOMEventViaPresShell(target, e, true);
- ok(true, type + " sent to " + target.id);
-}
-
-function checkSelection()
-{
- if (!selectionTest) {
- todo(false, "Selection test is disabled when tab modal prompts are not enabled.");
- } else {
- synthesizeMouse($("text"), 25, 55, { type: "mousemove" });
- is(window.getSelection().toString(), "", "selection not made");
- }
-}
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/prompts/test/test_dom_prompts.html b/toolkit/components/prompts/test/test_dom_prompts.html
deleted file mode 100644
index 413ed8fd5..000000000
--- a/toolkit/components/prompts/test/test_dom_prompts.html
+++ /dev/null
@@ -1,208 +0,0 @@
-<html>
-<head>
- <title>Test for DOM prompts</title>
- <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<pre id="test">
-</pre>
-
-<script class="testbody" type="text/javascript">
-var rv;
-var state, action;
-
-add_task(function* test_alert_ok() {
- info("Starting test: Alert");
- state = {
- msg : "This is the alert text.",
- iconClass : "alert-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- alert("This is the alert text.");
-
- yield promptDone;
-});
-
-// bug 861605 made the arguments to alert/confirm optional (prompt already was).
-add_task(function* test_alert_noargs() {
- info("Starting test: Alert with no args");
- state = {
- msg : "",
- iconClass : "alert-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- try {
- alert();
- ok(true, "alert() without arguments should not throw!");
- } catch (e) {
- ok(false, "alert() without arguments should not throw!");
- }
-
- yield promptDone;
-});
-
-
-add_task(function* test_confirm_ok() {
- info("Starting test: Confirm");
- state = {
- msg : "This is the confirm text.",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- rv = confirm("This is the confirm text.");
- is(rv, true, "check prompt return value");
-
- yield promptDone;
-});
-
-// bug 861605 made the arguments to alert/confirm optional (prompt already was).
-add_task(function* test_confirm_noargs() {
- info("Starting test: Confirm with no args");
- state = {
- msg : "",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- try {
- rv = confirm();
- ok(true, "confirm() without arguments should not throw!");
- } catch (e) {
- ok(false, "confirm() without arguments should not throw!");
- }
- is(rv, true, "check prompt return value");
-
- yield promptDone;
-});
-
-
-add_task(function* test_prompt_ok() {
- info("Starting test: Prompt");
- state = {
- msg : "This is the Prompt text.",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- rv = prompt("This is the Prompt text.");
- is(rv, "", "check prompt return value");
-
- yield promptDone;
-});
-
-// bug 861605 made the arguments to alert/confirm optional (prompt already was).
-add_task(function* test_prompt_noargs() {
- info("Starting test: Prompt with no args");
- state = {
- msg : "",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- try {
- rv = prompt();
- ok(true, "prompt() without arguments should not throw!");
- } catch (e) {
- ok(false, "prompt() without arguments should not throw!");
- }
- is(rv, "", "check prompt return value");
-
- yield promptDone;
-});
-
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/prompts/test/test_modal_prompts.html b/toolkit/components/prompts/test/test_modal_prompts.html
deleted file mode 100644
index 42e6be52c..000000000
--- a/toolkit/components/prompts/test/test_modal_prompts.html
+++ /dev/null
@@ -1,1184 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Modal Prompts Test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Prompter tests: modal prompts
-<p id="display"></p>
-
-<div id="content" style="display: none">
- <iframe id="iframe"></iframe>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript;version=1.8">
-
-function* runTests() {
- const { NetUtil } = SpecialPowers.Cu.import('resource://gre/modules/NetUtil.jsm');
- let state, action;
- ok(true, "Running tests (isTabModal=" + isTabModal + ", usePromptService=" + usePromptService + ")");
-
- let prompter, promptArgs;
- if (usePromptService) {
- prompter = Cc["@mozilla.org/embedcomp/prompt-service;1"].
- getService(Ci.nsIPromptService2);
- } else {
- prompter = Cc["@mozilla.org/prompter;1"].
- getService(Ci.nsIPromptFactory).
- getPrompt(window, Ci.nsIPrompt);
- if (isTabModal) {
- let bag = prompter.QueryInterface(Ci.nsIWritablePropertyBag2);
- bag.setPropertyAsBool("allowTabModal", true);
- }
- }
-
- let checkVal = {};
- let textVal = {};
- let passVal = {};
- let flags;
- let isOK, clickedButton;
-
- // =====
- info("Starting test: Alert");
- state = {
- msg : "This is the alert text.",
- title : "TestTitle",
- iconClass : "alert-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- promptArgs = ["TestTitle", "This is the alert text."];
- if (usePromptService)
- promptArgs.unshift(window);
- prompter.alert.apply(null, promptArgs);
-
- yield promptDone;
-
- // =====
- info("Starting test: AlertCheck (null checkbox label, so it's hidden)");
- state = {
- msg : "This is the alertCheck text.",
- title : "TestTitle",
- iconClass : "alert-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- promptArgs = ["TestTitle", "This is the alertCheck text.", null, {}];
- if (usePromptService)
- promptArgs.unshift(window);
- prompter.alertCheck.apply(null, promptArgs);
-
- yield promptDone;
-
- // =====
- info("Starting test: AlertCheck");
- state = {
- msg : "This is the alertCheck text.",
- title : "TestTitle",
- iconClass : "alert-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : false,
- textValue : "",
- passValue : "",
- checkMsg : "Check me out!",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- setCheckbox: true,
- };
-
- promptDone = handlePrompt(state, action);
-
- checkVal.value = false;
- promptArgs = ["TestTitle", "This is the alertCheck text.", "Check me out!", checkVal];
- if (usePromptService)
- promptArgs.unshift(window);
- prompter.alertCheck.apply(null, promptArgs);
- is(checkVal.value, true, "checkbox was checked");
-
- yield promptDone;
-
- // =====
- info("Starting test: Confirm (ok)");
- state = {
- msg : "This is the confirm text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- promptArgs = ["TestTitle", "This is the confirm text."];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.confirm.apply(null, promptArgs);
- is(isOK, true, "checked expected retval");
-
- yield promptDone;
-
- // =====
- info("Starting test: Confirm (cancel)");
- state = {
- msg : "This is the confirm text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "cancel",
- };
-
- promptDone = handlePrompt(state, action);
-
- promptArgs = ["TestTitle", "This is the confirm text."];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.confirm.apply(null, promptArgs);
- is(isOK, false, "checked expected retval");
-
- yield promptDone;
-
- // =====
- info("Starting test: ConfirmCheck (ok, null checkbox label)");
- state = {
- msg : "This is the confirmCheck text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- promptArgs = ["TestTitle", "This is the confirmCheck text.", null, {}];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.confirmCheck.apply(null, promptArgs);
- is(isOK, true, "checked expected retval");
-
- yield promptDone;
-
- // =====
- info("Starting test: ConfirmCheck (cancel, null checkbox label)");
- state = {
- msg : "This is the confirmCheck text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "cancel",
- };
-
- promptDone = handlePrompt(state, action);
-
- promptArgs = ["TestTitle", "This is the confirmCheck text.", null, {}];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.confirmCheck.apply(null, promptArgs);
- is(isOK, false, "checked expected retval");
-
- yield promptDone;
-
- // =====
- info("Starting test: ConfirmCheck (ok)");
- state = {
- msg : "This is the confirmCheck text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : false,
- textValue : "",
- passValue : "",
- checkMsg : "Check me out!",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- setCheckbox: true,
- };
-
- promptDone = handlePrompt(state, action);
-
- checkVal.value = false;
- promptArgs = ["TestTitle", "This is the confirmCheck text.", "Check me out!", checkVal];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.confirmCheck.apply(null, promptArgs);
- is(isOK, true, "checked expected retval");
- is(checkVal.value, true, "expected checkbox setting");
-
- yield promptDone;
-
- // =====
- info("Starting test: ConfirmCheck (cancel)");
- state = {
- msg : "This is the confirmCheck text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : false,
- textValue : "",
- passValue : "",
- checkMsg : "Check me out!",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "cancel",
- setCheckbox: true,
- };
-
- promptDone = handlePrompt(state, action);
-
- checkVal.value = false;
- promptArgs = ["TestTitle", "This is the confirmCheck text.", "Check me out!", checkVal];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.confirmCheck.apply(null, promptArgs);
- is(isOK, false, "checked expected retval");
- is(checkVal.value, true, "expected checkbox setting");
-
- yield promptDone;
-
- // =====
- info("Starting test: Prompt (ok, no default text)");
- state = {
- msg : "This is the prompt text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- textField : "bacon",
- };
-
- promptDone = handlePrompt(state, action);
-
- textVal.value = "";
- promptArgs = ["TestTitle", "This is the prompt text.", textVal, null, {}];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.prompt.apply(null, promptArgs);
- is(isOK, true, "checked expected retval");
- is(textVal.value, "bacon", "checking expected text value");
-
- yield promptDone;
-
- // =====
- info("Starting test: Prompt (ok, default text)");
- state = {
- msg : "This is the prompt text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : true,
- checkHidden : true,
- textValue : "kittens",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- textVal.value = "kittens";
- promptArgs = ["TestTitle", "This is the prompt text.", textVal, null, {}];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.prompt.apply(null, promptArgs);
- is(isOK, true, "checked expected retval");
- is(textVal.value, "kittens", "checking expected text value");
-
- yield promptDone;
-
- // =====
- info("Starting test: Prompt (cancel, default text)");
- state = {
- msg : "This is the prompt text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : true,
- checkHidden : true,
- textValue : "puppies",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick: "cancel",
- };
-
- promptDone = handlePrompt(state, action);
-
- textVal.value = "puppies";
- promptArgs = ["TestTitle", "This is the prompt text.", textVal, null, {}];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.prompt.apply(null, promptArgs);
- is(isOK, false, "checked expected retval");
- is(textVal.value, "puppies", "checking expected text value");
-
- yield promptDone;
-
- // =====
- info("Starting test: Prompt (cancel, default text modified)");
- state = {
- msg : "This is the prompt text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : true,
- checkHidden : true,
- textValue : "puppies",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "cancel",
- textField : "bacon",
- };
-
- promptDone = handlePrompt(state, action);
-
- textVal.value = "puppies";
- promptArgs = ["TestTitle", "This is the prompt text.", textVal, null, {}];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.prompt.apply(null, promptArgs);
- is(isOK, false, "checked expected retval");
- is(textVal.value, "puppies", "checking expected text value");
-
- yield promptDone;
-
- // =====
- info("Starting test: Prompt (ok, with checkbox)");
- state = {
- msg : "This is the prompt text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : true,
- checkHidden : false,
- textValue : "tribbles",
- passValue : "",
- checkMsg : "Check me out!",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- setCheckbox: true,
- };
-
- promptDone = handlePrompt(state, action);
-
- textVal.value = "tribbles";
- checkVal.value = false;
- promptArgs = ["TestTitle", "This is the prompt text.", textVal, "Check me out!", checkVal];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.prompt.apply(null, promptArgs);
- is(isOK, true, "checked expected retval");
- is(textVal.value, "tribbles", "checking expected text value");
- is(checkVal.value, true, "expected checkbox setting");
-
- yield promptDone;
-
- // =====
- info("Starting test: Prompt (cancel, with checkbox)");
- state = {
- msg : "This is the prompt text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : true,
- checkHidden : false,
- textValue : "tribbles",
- passValue : "",
- checkMsg : "Check me out!",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick: "cancel",
- setCheckbox: true,
- };
-
- promptDone = handlePrompt(state, action);
-
- textVal.value = "tribbles";
- checkVal.value = false;
- promptArgs = ["TestTitle", "This is the prompt text.", textVal, "Check me out!", checkVal];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.prompt.apply(null, promptArgs);
- is(isOK, false, "checked expected retval");
- is(textVal.value, "tribbles", "checking expected text value");
- is(checkVal.value, false, "expected checkbox setting");
-
- yield promptDone;
-
- // =====
- // Just two tests for this, since password manager already tests this extensively.
- info("Starting test: PromptUsernameAndPassword (ok)");
- state = {
- msg : "This is the pUAP text.",
- title : "TestTitle",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : false,
- textValue : "usr",
- passValue : "ssh",
- checkMsg : "Check me out!",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- setCheckbox: true,
- textField: "newusr",
- passField: "newssh",
- };
-
- promptDone = handlePrompt(state, action);
-
- textVal.value = "usr";
- passVal.value = "ssh";
- checkVal.value = false;
- promptArgs = ["TestTitle", "This is the pUAP text.", textVal, passVal, "Check me out!", checkVal];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.promptUsernameAndPassword.apply(null, promptArgs);
- is(isOK, true, "checked expected retval");
- is(textVal.value, "newusr", "checking expected text value");
- is(passVal.value, "newssh", "checking expected pass value");
- is(checkVal.value, true, "expected checkbox setting");
-
- yield promptDone;
-
- // =====
- info("Starting test: PromptUsernameAndPassword (cancel)");
- state = {
- msg : "This is the pUAP text.",
- title : "TestTitle",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : false,
- textValue : "usr",
- passValue : "ssh",
- checkMsg : "Check me out!",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "cancel",
- setCheckbox : true,
- textField : "newusr",
- passField : "newssh",
- };
-
- promptDone = handlePrompt(state, action);
-
- textVal.value = "usr";
- passVal.value = "ssh";
- checkVal.value = false;
- promptArgs = ["TestTitle", "This is the pUAP text.", textVal, passVal, "Check me out!", checkVal];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.promptUsernameAndPassword.apply(null, promptArgs);
- is(isOK, false, "checked expected retval");
- is(textVal.value, "usr", "checking expected text value");
- is(passVal.value, "ssh", "checking expected pass value");
- is(checkVal.value, false, "expected checkbox setting");
-
- yield promptDone;
-
- // =====
- info("Starting test: PromptPassword (ok)");
- state = {
- msg : "This is the promptPassword text.",
- title : "TestTitle",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : false,
- checkHidden : false,
- textValue : "",
- passValue : "ssh",
- checkMsg : "Check me out!",
- checked : false,
- focused : "passField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- setCheckbox : true,
- passField : "newssh",
- };
-
- promptDone = handlePrompt(state, action);
-
- passVal.value = "ssh";
- checkVal.value = false;
- promptArgs = ["TestTitle", "This is the promptPassword text.", passVal, "Check me out!", checkVal];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.promptPassword.apply(null, promptArgs);
- is(isOK, true, "checked expected retval");
- is(passVal.value, "newssh", "checking expected pass value");
- is(checkVal.value, true, "expected checkbox setting");
-
- yield promptDone;
-
- // =====
- info("Starting test: PromptPassword (cancel)");
- state = {
- msg : "This is the promptPassword text.",
- title : "TestTitle",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : false,
- checkHidden : false,
- textValue : "",
- passValue : "ssh",
- checkMsg : "Check me out!",
- checked : false,
- focused : "passField",
- defButton : "button0",
- };
- action = {
- buttonClick : "cancel",
- setCheckbox : true,
- passField : "newssh",
- };
-
- promptDone = handlePrompt(state, action);
-
- passVal.value = "ssh";
- checkVal.value = false;
- promptArgs = ["TestTitle", "This is the promptPassword text.", passVal, "Check me out!", checkVal];
- if (usePromptService)
- promptArgs.unshift(window);
- isOK = prompter.promptPassword.apply(null, promptArgs);
- is(isOK, false, "checked expected retval");
- is(passVal.value, "ssh", "checking expected pass value");
- is(checkVal.value, false, "expected checkbox setting");
-
- yield promptDone;
-
- // =====
- info("Starting test: ConfirmEx (ok/cancel, ok)");
- state = {
- msg : "This is the confirmEx text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- butt0Label : "OK",
- butt1Label : "Cancel",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- flags = Ci.nsIPromptService.STD_OK_CANCEL_BUTTONS;
- promptArgs = ["TestTitle", "This is the confirmEx text.", flags, null, null, null, null, {}];
- if (usePromptService)
- promptArgs.unshift(window);
- clickedButton = prompter.confirmEx.apply(null, promptArgs);
- is(clickedButton, 0, "checked expected button num click");
-
- yield promptDone;
-
- // =====
- info("Starting test: ConfirmEx (yes/no, cancel)");
- state = {
- msg : "This is the confirmEx text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- butt0Label : "Yes",
- butt1Label : "No",
- };
- action = {
- buttonClick: "cancel",
- };
-
- promptDone = handlePrompt(state, action);
-
- flags = Ci.nsIPromptService.STD_YES_NO_BUTTONS;
- promptArgs = ["TestTitle", "This is the confirmEx text.", flags, null, null, null, null, {}];
- if (usePromptService)
- promptArgs.unshift(window);
- clickedButton = prompter.confirmEx.apply(null, promptArgs);
- is(clickedButton, 1, "checked expected button num click");
-
- yield promptDone;
-
- // =====
- info("Starting test: ConfirmEx (buttons from args, checkbox, ok)");
- state = {
- msg : "This is the confirmEx text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : false,
- textValue : "",
- passValue : "",
- checkMsg : "Check me out!",
- checked : false,
- focused : "button0",
- defButton : "button0",
- butt0Label : "butt0",
- butt1Label : "butt1",
- butt2Label : "butt2",
- };
- action = {
- buttonClick: "ok",
- setCheckbox: true,
- };
-
- promptDone = handlePrompt(state, action);
-
- let b = Ci.nsIPromptService.BUTTON_TITLE_IS_STRING;
- flags = b * Ci.nsIPromptService.BUTTON_POS_2 +
- b * Ci.nsIPromptService.BUTTON_POS_1 +
- b * Ci.nsIPromptService.BUTTON_POS_0;
- checkVal.value = false;
- promptArgs = ["TestTitle", "This is the confirmEx text.", flags,
- "butt0", "butt1", "butt2", "Check me out!", checkVal];
- if (usePromptService)
- promptArgs.unshift(window);
- clickedButton = prompter.confirmEx.apply(null, promptArgs);
- is(clickedButton, 0, "checked expected button num click");
- is(checkVal.value, true, "expected checkbox setting");
-
- yield promptDone;
-
- // =====
- info("Starting test: ConfirmEx (buttons from args, checkbox, cancel)");
- state = {
- msg : "This is the confirmEx text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : false,
- textValue : "",
- passValue : "",
- checkMsg : "Check me out!",
- checked : false,
- focused : "button1", // Default changed!
- defButton : "button1",
- butt0Label : "butt0",
- butt1Label : "butt1",
- butt2Label : "butt2",
- };
- action = {
- buttonClick: "cancel",
- setCheckbox: true,
- };
-
- promptDone = handlePrompt(state, action);
-
- b = Ci.nsIPromptService.BUTTON_TITLE_IS_STRING;
- flags = b * Ci.nsIPromptService.BUTTON_POS_2 +
- b * Ci.nsIPromptService.BUTTON_POS_1 +
- b * Ci.nsIPromptService.BUTTON_POS_0;
- flags ^= Ci.nsIPromptService.BUTTON_POS_1_DEFAULT;
- checkVal.value = false;
- promptArgs = ["TestTitle", "This is the confirmEx text.", flags,
- "butt0", "butt1", "butt2", "Check me out!", checkVal];
- if (usePromptService)
- promptArgs.unshift(window);
- clickedButton = prompter.confirmEx.apply(null, promptArgs);
- is(clickedButton, 1, "checked expected button num click");
- is(checkVal.value, true, "expected checkbox setting");
-
- yield promptDone;
-
- // =====
- info("Starting test: ConfirmEx (buttons from args, checkbox, button3)");
- state = {
- msg : "This is the confirmEx text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : false,
- textValue : "",
- passValue : "",
- checkMsg : "Check me out!",
- checked : false,
- focused : "button2", // Default changed!
- defButton : "button2",
- butt0Label : "butt0",
- butt1Label : "butt1",
- butt2Label : "butt2",
- };
- action = {
- buttonClick: 2,
- setCheckbox: true,
- };
-
- promptDone = handlePrompt(state, action);
-
- b = Ci.nsIPromptService.BUTTON_TITLE_IS_STRING;
- flags = b * Ci.nsIPromptService.BUTTON_POS_2 +
- b * Ci.nsIPromptService.BUTTON_POS_1 +
- b * Ci.nsIPromptService.BUTTON_POS_0;
- flags ^= Ci.nsIPromptService.BUTTON_POS_2_DEFAULT;
- checkVal.value = false;
- promptArgs = ["TestTitle", "This is the confirmEx text.", flags,
- "butt0", "butt1", "butt2", "Check me out!", checkVal];
- if (usePromptService)
- promptArgs.unshift(window);
- clickedButton = prompter.confirmEx.apply(null, promptArgs);
- is(clickedButton, 2, "checked expected button num click");
- is(checkVal.value, true, "expected checkbox setting");
-
- yield promptDone;
-
- // =====
- // (skipped for E10S and tabmodal tests: window is required)
- info("Starting test: Alert, no window");
- state = {
- msg : "This is the alert text.",
- title : "TestTitle",
- iconClass : "alert-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
- if (!isTabModal && !isE10S) {
- promptDone = handlePrompt(state, action);
-
- promptArgs = ["TestTitle", "This is the alert text."];
- if (usePromptService)
- promptArgs.unshift(null);
- prompter.alert.apply(null, promptArgs);
-
- yield promptDone;
- }
-
-
- // =====
- // (skipped for tabmodal tests: delay not supported)
- info("Starting test: ConfirmEx (delay, ok)");
- state = {
- msg : "This is the confirmEx delay text.",
- title : "TestTitle",
- iconClass : "question-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : null, // nothing focused until after delay fires
- defButton : "button0",
- butt0Label : "OK",
- butt1Label : "Cancel",
- butt0Disabled: true,
- };
-
- // OS X doesn't initially focus the button, but rather the infoBody.
- // The focus stays there even after the button-enable delay has fired.
- if (isOSX)
- state.focused = "infoBody";
-
- action = {
- buttonClick: "pollOK",
- };
- if (!isTabModal) {
- promptDone = handlePrompt(state, action);
-
- flags = (Ci.nsIPromptService.STD_OK_CANCEL_BUTTONS | Ci.nsIPromptService.BUTTON_DELAY_ENABLE);
- promptArgs = ["TestTitle", "This is the confirmEx delay text.", flags, null, null, null, null, {}];
- if (usePromptService)
- promptArgs.unshift(window);
- clickedButton = prompter.confirmEx.apply(null, promptArgs);
- is(clickedButton, 0, "checked expected button num click");
-
- yield promptDone;
- }
-
- // promptAuth already tested via password manager but do a few specific things here.
- var channel = NetUtil.newChannel({
- uri: "http://example.com",
- loadUsingSystemPrincipal: true
- });
-
- var level = Ci.nsIAuthPrompt2.LEVEL_NONE;
- var authinfo = {
- username : "",
- password : "",
- domain : "",
- flags : Ci.nsIAuthInformation.AUTH_HOST,
- authenticationScheme : "basic",
- realm : ""
- };
-
-
- // =====
- // (promptAuth is only accessible from the prompt service)
- info("Starting test: promptAuth with empty realm");
- state = {
- msg : 'http://example.com is requesting your username and password.',
- title : "TestTitle",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : false,
- textValue : "",
- passValue : "",
- checkMsg : "Check me out!",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- setCheckbox : true,
- textField : "username",
- passField : "password",
- };
- if (usePromptService) {
- promptDone = handlePrompt(state, action);
-
- checkVal.value = false;
- isOK = prompter.promptAuth(window, channel, level, authinfo, "Check me out!", checkVal);
- is(isOK, true, "checked expected retval");
- is(authinfo.username, "username", "checking filled username");
- is(authinfo.password, "password", "checking filled password");
- is(checkVal.value, true, "expected checkbox setting");
-
- yield promptDone;
- }
-
-
- // =====
- // (promptAuth is only accessible from the prompt service)
- info("Starting test: promptAuth with long realm");
- state = {
- msg : 'http://example.com is requesting your username and password. The site ' +
- 'says: \u201cabcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi ' +
- 'abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi abcdefghi ' +
- 'abcdefghi \u2026\u201d',
- title : "TestTitle",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : false,
- textValue : "",
- passValue : "",
- checkMsg : "Check me out!",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- setCheckbox : true,
- textField : "username",
- passField : "password",
- };
- if (usePromptService) {
- promptDone = handlePrompt(state, action);
-
- checkVal.value = false;
- var longString = "";
- for (var i = 0; i < 20; i++)
- longString += "abcdefghi "; // 200 chars long
- authinfo.realm = longString;
- authinfo.username = "";
- authinfo.password = "";
- isOK = prompter.promptAuth(window, channel, level, authinfo, "Check me out!", checkVal);
- is(isOK, true, "checked expected retval");
- is(authinfo.username, "username", "checking filled username");
- is(authinfo.password, "password", "checking filled password");
- is(checkVal.value, true, "expected checkbox setting");
-
- yield promptDone;
- }
-
- info("Starting test: promptAuth for a cross-origin and a empty realm");
- authinfo = {
- username : "",
- password : "",
- domain : "",
- flags : Ci. nsIAuthInformation.AUTH_HOST |
- Ci.nsIAuthInformation.CROSS_ORIGIN_SUB_RESOURCE,
- authenticationScheme : "basic",
- realm : ""
- }
- state = {
- msg : 'http://example.com is requesting your username and password. ' +
- 'WARNING: Your password will not be sent to the website you are currently visiting!',
- title : "TestTitle",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : false,
- textValue : "",
- passValue : "",
- checkMsg : "Check me out!",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- setCheckbox : false,
- textField : "username",
- passField : "password",
- };
- if (usePromptService) {
- promptDone = handlePrompt(state, action);
- checkVal.value = false;
- isOK = prompter.promptAuth(window, channel, level, authinfo, "Check me out!", checkVal);
- is(isOK, true, "checked expected retval");
- is(authinfo.username, "username", "checking filled username");
- is(authinfo.password, "password", "checking filled password");
- is(checkVal.value, false, "expected checkbox setting");
-
- yield promptDone;
- }
-
- info("Starting test: promptAuth for a cross-origin with realm");
- authinfo = {
- username : "",
- password : "",
- domain : "",
- flags : Ci. nsIAuthInformation.AUTH_HOST | Ci.nsIAuthInformation.CROSS_ORIGIN_SUB_RESOURCE,
- authenticationScheme : "basic",
- realm : "Something!!!"
- }
- state = {
- msg : 'http://example.com is requesting your username and password. ' +
- 'WARNING: Your password will not be sent to the website you are currently visiting!',
- title : "TestTitle",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : false,
- textValue : "",
- passValue : "",
- checkMsg : "Check me out!",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
- action = {
- buttonClick : "ok",
- setCheckbox : false,
- textField : "username",
- passField : "password",
- };
- if (usePromptService) {
- promptDone = handlePrompt(state, action);
-
- checkVal.value = false;
- isOK = prompter.promptAuth(window, channel, level, authinfo, "Check me out!", checkVal);
- is(isOK, true, "checked expected retval");
- is(authinfo.username, "username", "checking filled username");
- is(authinfo.password, "password", "checking filled password");
- is(checkVal.value, false, "expected checkbox setting");
-
- yield promptDone;
- }
-}
-
-let usePromptService;
-
-/*
- * Run the body of the 3 times:
- * - 1st pass: with window-modal prompts, using nsIPromptService
- * - 2nd pass: still window-modal, using nsIPrompt directly (via nsIPromptFactory)
- * - 3rd pass: with tab-modal prompts. Can't opt into these via * nsIPromptService.
- */
-
-add_task(function* runPromptTests() {
- info("Process type: " + SpecialPowers.Services.appinfo.processType);
-
- isTabModal = false; usePromptService = true;
- info("Running tests with: isTabModal=" + isTabModal + ", usePromptService=" + usePromptService);
- yield* runTests();
-
- isTabModal = false; usePromptService = false;
- info("Running tests with: isTabModal=" + isTabModal + ", usePromptService=" + usePromptService);
- yield* runTests();
-
- if (SpecialPowers.getBoolPref("prompts.tab_modal.enabled")) {
- isTabModal = true; usePromptService = false;
- info("Running tests with: isTabModal=" + isTabModal + ", usePromptService=" + usePromptService);
- yield* runTests();
- }
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/prompts/test/test_modal_select.html b/toolkit/components/prompts/test/test_modal_select.html
deleted file mode 100644
index 1e008d0f4..000000000
--- a/toolkit/components/prompts/test/test_modal_select.html
+++ /dev/null
@@ -1,146 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Modal Prompts Test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Prompter tests: modal prompts
-<p id="display"></p>
-
-<div id="content" style="display: none">
- <iframe id="iframe"></iframe>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript;version=1.8">
-
-let prompter = Cc["@mozilla.org/embedcomp/prompt-service;1"].
- getService(Ci.nsIPromptService2);
-
-function checkPromptState(promptState, expectedState) {
- // XXX check title? OS X has title in content
- // XXX check focused element
- // XXX check button labels?
-
- is(promptState.msg, expectedState.msg, "Checking expected message");
-
- // Compare listbox contents
- is(promptState.items.length, expectedState.items.length, "Checking listbox length");
-
- if (promptState.items.length)
- is(promptState.selectedIndex, 0, "Checking selected index");
-
- for (let i = 0; i < promptState.items; i++) {
- is(promptState.items[i], expectedState.items[i], "Checking list item #" + i);
- }
-}
-
-let selectVal = {};
-let isOK;
-let state, action;
-
-function handlePrompt(state, action) {
- return new Promise(resolve => {
- gChromeScript.addMessageListener("promptHandled", function handled(msg) {
- gChromeScript.removeMessageListener("promptHandled", handled);
- checkPromptState(msg.promptState, state);
- resolve(true);
- });
- gChromeScript.sendAsyncMessage("handlePrompt", { action: action, isSelect: true});
- });
-}
-
-
-// =====
-add_task(function* test_select_empty_list() {
- info("Starting test: Select (0 items, ok)");
- state = {
- msg : "This is the select text.",
- title : "TestTitle",
- items : [],
- };
- action = {
- buttonClick: "ok",
- };
- promptDone = handlePrompt(state, action);
- items = [];
- selectVal.value = null; // outparam, just making sure.
- isOK = prompter.select(window, "TestTitle", "This is the select text.", items.length, items, selectVal);
- is(isOK, true, "checked expected retval");
- is(selectVal.value, -1, "checking selected index");
-
- yield promptDone;
-});
-
-// =====
-add_task(function* test_select_ok() {
- info("Starting test: Select (3 items, ok)");
- state = {
- msg : "This is the select text.",
- title : "TestTitle",
- items : ["one", "two", "three"],
- };
- action = {
- buttonClick: "ok",
- };
- promptDone = handlePrompt(state, action);
- items = ["one", "two", "three"];
- selectVal.value = null; // outparam, just making sure.
- isOK = prompter.select(window, "TestTitle", "This is the select text.", items.length, items, selectVal);
- is(isOK, true, "checked expected retval");
- is(selectVal.value, 0, "checking selected index");
-
- yield promptDone;
-});
-
-// =====
-add_task(function* test_select_item() {
- info("Starting test: Select (3 items, selection changed, ok)");
- state = {
- msg : "This is the select text.",
- title : "TestTitle",
- items : ["one", "two", "three"],
- };
- action = {
- buttonClick: "ok",
- selectItem: 1,
- };
- promptDone = handlePrompt(state, action);
- items = ["one", "two", "three"];
- selectVal.value = null; // outparam, just making sure.
- isOK = prompter.select(window, "TestTitle", "This is the select text.", items.length, items, selectVal);
- is(isOK, true, "checked expected retval");
- is(selectVal.value, 1, "checking selected index");
-
- yield promptDone;
-});
-
-// =====
-add_task(function* test_cancel_prompt() {
- info("Starting test: Select (3 items, cancel)");
- state = {
- msg : "This is the select text.",
- title : "TestTitle",
- items : ["one", "two", "three"],
- };
- action = {
- buttonClick: "cancel",
- };
- promptDone = handlePrompt(state, action);
- items = ["one", "two", "three"];
- selectVal.value = null; // outparam, just making sure.
- isOK = prompter.select(window, "TestTitle", "This is the select text.", items.length, items, selectVal);
- is(isOK, false, "checked expected retval");
- is(selectVal.value, 0, "checking selected index");
-
- yield promptDone;
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/prompts/test/test_subresources_prompts.html b/toolkit/components/prompts/test/test_subresources_prompts.html
deleted file mode 100644
index 241ce430f..000000000
--- a/toolkit/components/prompts/test/test_subresources_prompts.html
+++ /dev/null
@@ -1,202 +0,0 @@
-<html>
-<head>
- <title>Test subresources prompts (Bug 625187 and bug 1230462)</title>
- <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="prompt_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
-<!--
- - Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/
- -
- - Contributor(s):
- - Mihai Sucan <mihai.sucan@gmail.com>
- -->
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=625187">Mozilla Bug 625187</a>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1230462">Mozilla Bug 1230462</a>
-
-<p><button onclick="alert('hello world')">Button</button></p>
-
-<iframe id="iframe_diff_origin" src="http://example.com/tests/toolkit/components/prompts/test/bug625187_iframe.html"></iframe>
-
-<iframe id="iframe_same_origin" src="bug625187_iframe.html"></iframe>
-
-<iframe id="iframe_prompt"></iframe>
-
-<pre id="test"></pre>
-
-<script class="testbody" type="text/javascript">
-var iframe1Loaded = onloadPromiseFor("iframe_diff_origin");
-var iframe2Loaded = onloadPromiseFor("iframe_same_origin");
-var iframe_prompt = document.getElementById("iframe_prompt");
-
-add_task(function* runTest()
-{
- // This test depends on tab modal prompts being enabled.
- if (!isTabModal) {
- todo(false, "Test disabled when tab modal prompts are not enabled.");
- return;
- }
-
- info("Ensuring iframe1 has loaded...");
- yield iframe1Loaded;
- info("Ensuring iframe2 has loaded...");
- yield iframe2Loaded;
- let state, action;
-
- state = {
- msg : "hello world",
- iconClass : "alert-icon",
- titleHidden : true,
- textHidden : true,
- passHidden : true,
- checkHidden : true,
- textValue : "",
- passValue : "",
- checkMsg : "",
- checked : false,
- focused : "button0",
- defButton : "button0",
- };
- action = {
- buttonClick: "ok",
- };
-
- promptDone = handlePrompt(state, action);
-
- var button = document.querySelector("button");
- dispatchMouseEvent(button, "click");
-
- yield promptDone;
-
-
- // mostly reusing same state/action
- state.titleHidden = false;
- state.msg = "hello world 2";
- promptDone = handlePrompt(state, action);
-
- var iframe = document.getElementById("iframe_diff_origin");
- button = SpecialPowers.wrap(iframe.contentWindow).document.getElementById("btn1");
- dispatchMouseEvent(button, "click");
-
- yield promptDone;
-
-
- // mostly reusing same state/action
- state.titleHidden = true;
- state.msg = "hello world 2";
- promptDone = handlePrompt(state, action);
-
- iframe = document.getElementById("iframe_same_origin");
- button = iframe.contentWindow.document.getElementById("btn1");
- dispatchMouseEvent(button, "click");
-
- yield promptDone;
-
-
- // mostly reusing same state/action
- state.msg = "hello world 3";
- promptDone = handlePrompt(state, action);
-
- button = iframe.contentWindow.document.getElementById("btn2");
- dispatchMouseEvent(button, "click");
-
- yield promptDone;
-});
-
-add_task(function* runTestAuth()
-{
- // Following tests chack prompt message for a cross-origin and not
- // cross-origin subresources load
-
- // Force parent to not look for tab-modal prompts, as they're not
- // used for auth prompts.
- isTabModal = false;
-
- state = {
- msg : "http://mochi.test:8888 is requesting your username " +
- "and password. The site says: “mochitestâ€",
- title : "Authentication Required",
- textValue : "",
- passValue : "",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
-
- action = {
- buttonClick : "ok",
- setCheckbox : false,
- textField : "mochiuser1",
- passField : "mochipass1",
- };
-
- promptDone = handlePrompt(state, action);
-
- var iframe3Loaded = onloadPromiseFor("iframe_prompt");
- iframe_prompt.src = "authenticate.sjs?user=mochiuser1&pass=mochipass1";
- yield promptDone;
- yield iframe3Loaded;
- checkEchoedAuthInfo({user: "mochiuser1", pass: "mochipass1"},
- iframe_prompt.contentDocument);
-
- // Cross-origin subresourse test.
-
- // Force parent to not look for tab-modal prompts, as they're not used for auth prompts.
- isTabModal =false;
- state = {
- msg : "http://example.com is requesting your username and password. " +
- "WARNING: Your password will not be sent to the website you are currently visiting!",
- title : "Authentication Required",
- textValue : "",
- passValue : "",
- iconClass : "authentication-icon question-icon",
- titleHidden : true,
- textHidden : false,
- passHidden : false,
- checkHidden : true,
- checkMsg : "",
- checked : false,
- focused : "textField",
- defButton : "button0",
- };
-
- action = {
- buttonClick : "ok",
- setCheckbox : false,
- textField : "mochiuser2",
- passField : "mochipass2",
- };
-
- promptDone = handlePrompt(state, action);
-
- iframe3Loaded = onloadPromiseFor("iframe_prompt");
- iframe_prompt.src = "http://example.com/tests/toolkit/components/prompts/test/authenticate.sjs?user=mochiuser2&pass=mochipass2&realm=mochitest";
- yield promptDone;
- yield iframe3Loaded;
- checkEchoedAuthInfo({user: "mochiuser2", pass: "mochipass2"},
- SpecialPowers.wrap(iframe_prompt.contentWindow).document);
-});
-
-function dispatchMouseEvent(target, type)
-{
- var win = SpecialPowers.unwrap(target.ownerDocument.defaultView);
- var e = document.createEvent("MouseEvent");
- e.initEvent(type, false, false, win, 0, 1, 1, 1, 1,
- false, false, false, false, 0, null);
- var utils = SpecialPowers.getDOMWindowUtils(win);
- utils.dispatchDOMEventViaPresShell(SpecialPowers.unwrap(target), e, true);
-}
-</script>
-</body>
-</html>
diff --git a/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h b/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h
index 7956d076d..b05f2f853 100644
--- a/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h
+++ b/toolkit/components/protobuf/src/google/protobuf/stubs/platform_macros.h
@@ -67,7 +67,7 @@
#define GOOGLE_PROTOBUF_ARCH_32_BIT 1
#elif defined(sparc)
#define GOOGLE_PROTOBUF_ARCH_SPARC 1
-#ifdef SOLARIS_64BIT_ENABLED
+#ifdef __arch64__
#define GOOGLE_PROTOBUF_ARCH_64_BIT 1
#else
#define GOOGLE_PROTOBUF_ARCH_32_BIT 1
diff --git a/toolkit/components/reader/moz.build b/toolkit/components/reader/moz.build
index d49bda14f..4ffca0421 100644
--- a/toolkit/components/reader/moz.build
+++ b/toolkit/components/reader/moz.build
@@ -11,9 +11,7 @@ EXTRA_JS_MODULES += [
'ReaderMode.jsm'
]
-EXTRA_PP_JS_MODULES += [
- 'Readerable.jsm'
-]
+EXTRA_PP_JS_MODULES += ['Readerable.jsm']
EXTRA_JS_MODULES.reader = [
'JSDOMParser.js',
@@ -21,10 +19,3 @@ EXTRA_JS_MODULES.reader = [
'ReaderWorker.js',
'ReaderWorker.jsm'
]
-
-BROWSER_CHROME_MANIFESTS += [
- 'test/browser.ini'
-]
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Reader Mode')
diff --git a/toolkit/components/reader/test/browser.ini b/toolkit/components/reader/test/browser.ini
deleted file mode 100644
index 4f9df23b3..000000000
--- a/toolkit/components/reader/test/browser.ini
+++ /dev/null
@@ -1,15 +0,0 @@
-[DEFAULT]
-support-files = head.js
-[browser_readerMode.js]
-support-files =
- readerModeArticle.html
- readerModeArticleHiddenNodes.html
-[browser_readerMode_hidden_nodes.js]
-support-files =
- readerModeArticleHiddenNodes.html
-[browser_readerMode_with_anchor.js]
-support-files =
- readerModeArticle.html
-[browser_bug1124271_readerModePinnedTab.js]
-support-files =
- readerModeArticle.html
diff --git a/toolkit/components/reader/test/browser_bug1124271_readerModePinnedTab.js b/toolkit/components/reader/test/browser_bug1124271_readerModePinnedTab.js
deleted file mode 100644
index 39913aa3e..000000000
--- a/toolkit/components/reader/test/browser_bug1124271_readerModePinnedTab.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Test that the reader mode button won't open in a new tab when clicked from a pinned tab
-
-const PREF = "reader.parse-on-load.enabled";
-
-const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "http://example.com");
-
-var readerButton = document.getElementById("reader-mode-button");
-
-add_task(function* () {
- registerCleanupFunction(function() {
- Services.prefs.clearUserPref(PREF);
- while (gBrowser.tabs.length > 1) {
- gBrowser.removeCurrentTab();
- }
- });
-
- // Enable the reader mode button.
- Services.prefs.setBoolPref(PREF, true);
-
- let tab = gBrowser.selectedTab = gBrowser.addTab();
- gBrowser.pinTab(tab);
-
- let initialTabsCount = gBrowser.tabs.length;
-
- // Point tab to a test page that is reader-able.
- let url = TEST_PATH + "readerModeArticle.html";
- yield promiseTabLoadEvent(tab, url);
- yield promiseWaitForCondition(() => !readerButton.hidden);
-
- readerButton.click();
- yield promiseTabLoadEvent(tab);
-
- // Ensure no new tabs are opened when exiting reader mode in a pinned tab
- is(gBrowser.tabs.length, initialTabsCount, "No additional tabs were opened.");
-
- let pageShownPromise = BrowserTestUtils.waitForContentEvent(tab.linkedBrowser, "pageshow");
- readerButton.click();
- yield pageShownPromise;
- // Ensure no new tabs are opened when exiting reader mode in a pinned tab
- is(gBrowser.tabs.length, initialTabsCount, "No additional tabs were opened.");
-
- gBrowser.removeCurrentTab();
-});
diff --git a/toolkit/components/reader/test/browser_readerMode.js b/toolkit/components/reader/test/browser_readerMode.js
deleted file mode 100644
index 70290c3b5..000000000
--- a/toolkit/components/reader/test/browser_readerMode.js
+++ /dev/null
@@ -1,220 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test that the reader mode button appears and works properly on
- * reader-able content.
- */
-const TEST_PREFS = [
- ["reader.parse-on-load.enabled", true],
-];
-
-const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "http://example.com");
-
-var readerButton = document.getElementById("reader-mode-button");
-
-add_task(function* test_reader_button() {
- registerCleanupFunction(function() {
- // Reset test prefs.
- TEST_PREFS.forEach(([name, value]) => {
- Services.prefs.clearUserPref(name);
- });
- while (gBrowser.tabs.length > 1) {
- gBrowser.removeCurrentTab();
- }
- });
-
- // Set required test prefs.
- TEST_PREFS.forEach(([name, value]) => {
- Services.prefs.setBoolPref(name, value);
- });
- Services.prefs.setBoolPref("browser.reader.detectedFirstArticle", false);
-
- let tab = gBrowser.selectedTab = gBrowser.addTab();
- is_element_hidden(readerButton, "Reader mode button is not present on a new tab");
- ok(!UITour.isInfoOnTarget(window, "readerMode-urlBar"),
- "Info panel shouldn't appear without the reader mode button");
- ok(!Services.prefs.getBoolPref("browser.reader.detectedFirstArticle"),
- "Shouldn't have detected the first article");
-
- // We're going to show the reader mode intro popup, make sure we wait for it:
- let tourPopupShownPromise =
- BrowserTestUtils.waitForEvent(document.getElementById("UITourTooltip"), "popupshown");
- // Point tab to a test page that is reader-able.
- let url = TEST_PATH + "readerModeArticle.html";
- yield promiseTabLoadEvent(tab, url);
- yield promiseWaitForCondition(() => !readerButton.hidden);
- yield tourPopupShownPromise;
- is_element_visible(readerButton, "Reader mode button is present on a reader-able page");
- ok(UITour.isInfoOnTarget(window, "readerMode-urlBar"),
- "Info panel should be anchored at the reader mode button");
- ok(Services.prefs.getBoolPref("browser.reader.detectedFirstArticle"),
- "Should have detected the first article");
-
- // Switch page into reader mode.
- readerButton.click();
- yield promiseTabLoadEvent(tab);
- ok(!UITour.isInfoOnTarget(window, "readerMode-urlBar"), "Info panel should have closed");
-
- let readerUrl = gBrowser.selectedBrowser.currentURI.spec;
- ok(readerUrl.startsWith("about:reader"), "about:reader loaded after clicking reader mode button");
- is_element_visible(readerButton, "Reader mode button is present on about:reader");
-
- is(gURLBar.value, readerUrl, "gURLBar value is about:reader URL");
- is(gURLBar.textValue, url.substring("http://".length), "gURLBar is displaying original article URL");
-
- // Check selected value for URL bar
- yield new Promise((resolve, reject) => {
- waitForClipboard(url, function () {
- gURLBar.focus();
- gURLBar.select();
- goDoCommand("cmd_copy");
- }, resolve, reject);
- });
-
- info("Got correct URL when copying");
-
- // Switch page back out of reader mode.
- let promisePageShow = BrowserTestUtils.waitForContentEvent(tab.linkedBrowser, "pageshow");
- readerButton.click();
- yield promisePageShow;
- is(gBrowser.selectedBrowser.currentURI.spec, url,
- "Back to the original page after clicking active reader mode button");
- ok(gBrowser.selectedBrowser.canGoForward,
- "Moved one step back in the session history.");
-
- // Load a new tab that is NOT reader-able.
- let newTab = gBrowser.selectedTab = gBrowser.addTab();
- yield promiseTabLoadEvent(newTab, "about:robots");
- yield promiseWaitForCondition(() => readerButton.hidden);
- is_element_hidden(readerButton, "Reader mode button is not present on a non-reader-able page");
-
- // Switch back to the original tab to make sure reader mode button is still visible.
- gBrowser.removeCurrentTab();
- yield promiseWaitForCondition(() => !readerButton.hidden);
- is_element_visible(readerButton, "Reader mode button is present on a reader-able page");
-});
-
-add_task(function* test_getOriginalUrl() {
- let { ReaderMode } = Cu.import("resource://gre/modules/ReaderMode.jsm", {});
- let url = "http://foo.com/article.html";
-
- is(ReaderMode.getOriginalUrl("about:reader?url=" + encodeURIComponent(url)), url, "Found original URL from encoded URL");
- is(ReaderMode.getOriginalUrl("about:reader?foobar"), null, "Did not find original URL from malformed reader URL");
- is(ReaderMode.getOriginalUrl(url), null, "Did not find original URL from non-reader URL");
-
- let badUrl = "http://foo.com/?;$%^^";
- is(ReaderMode.getOriginalUrl("about:reader?url=" + encodeURIComponent(badUrl)), badUrl, "Found original URL from encoded malformed URL");
- is(ReaderMode.getOriginalUrl("about:reader?url=" + badUrl), badUrl, "Found original URL from non-encoded malformed URL");
-});
-
-add_task(function* test_reader_view_element_attribute_transform() {
- registerCleanupFunction(function() {
- while (gBrowser.tabs.length > 1) {
- gBrowser.removeCurrentTab();
- }
- });
-
- function observeAttribute(element, attribute, triggerFn, checkFn) {
- return new Promise(resolve => {
- let observer = new MutationObserver((mutations) => {
- mutations.forEach( mu => {
- if (element.getAttribute(attribute) !== mu.oldValue) {
- checkFn();
- resolve();
- observer.disconnect();
- }
- });
- });
-
- observer.observe(element, {
- attributes: true,
- attributeOldValue: true,
- attributeFilter: [attribute]
- });
-
- triggerFn();
- });
- }
-
- let command = document.getElementById("View:ReaderView");
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser);
- is(command.hidden, true, "Command element should have the hidden attribute");
-
- info("Navigate a reader-able page");
- let waitForPageshow = BrowserTestUtils.waitForContentEvent(tab.linkedBrowser, "pageshow");
- yield observeAttribute(command, "hidden",
- () => {
- let url = TEST_PATH + "readerModeArticle.html";
- tab.linkedBrowser.loadURI(url);
- },
- () => {
- is(command.hidden, false, "Command's hidden attribute should be false on a reader-able page");
- }
- );
- yield waitForPageshow;
-
- info("Navigate a non-reader-able page");
- waitForPageshow = BrowserTestUtils.waitForContentEvent(tab.linkedBrowser, "pageshow");
- yield observeAttribute(command, "hidden",
- () => {
- let url = TEST_PATH + "readerModeArticleHiddenNodes.html";
- tab.linkedBrowser.loadURI(url);
- },
- () => {
- is(command.hidden, true, "Command's hidden attribute should be true on a non-reader-able page");
- }
- );
- yield waitForPageshow;
-
- info("Navigate a reader-able page");
- waitForPageshow = BrowserTestUtils.waitForContentEvent(tab.linkedBrowser, "pageshow");
- yield observeAttribute(command, "hidden",
- () => {
- let url = TEST_PATH + "readerModeArticle.html";
- tab.linkedBrowser.loadURI(url);
- },
- () => {
- is(command.hidden, false, "Command's hidden attribute should be false on a reader-able page");
- }
- );
- yield waitForPageshow;
-
- info("Enter Reader Mode");
- waitForPageshow = BrowserTestUtils.waitForContentEvent(tab.linkedBrowser, "pageshow");
- yield observeAttribute(readerButton, "readeractive",
- () => {
- readerButton.click();
- },
- () => {
- is(readerButton.getAttribute("readeractive"), "true", "readerButton's readeractive attribute should be true when entering reader mode");
- }
- );
- yield waitForPageshow;
-
- info("Exit Reader Mode");
- waitForPageshow = BrowserTestUtils.waitForContentEvent(tab.linkedBrowser, "pageshow");
- yield observeAttribute(readerButton, "readeractive",
- () => {
- readerButton.click();
- },
- () => {
- is(readerButton.getAttribute("readeractive"), "", "readerButton's readeractive attribute should be empty when reader mode is exited");
- }
- );
- yield waitForPageshow;
-
- info("Navigate a non-reader-able page");
- waitForPageshow = BrowserTestUtils.waitForContentEvent(tab.linkedBrowser, "pageshow");
- yield observeAttribute(command, "hidden",
- () => {
- let url = TEST_PATH + "readerModeArticleHiddenNodes.html";
- tab.linkedBrowser.loadURI(url);
- },
- () => {
- is(command.hidden, true, "Command's hidden attribute should be true on a non-reader-able page");
- }
- );
- yield waitForPageshow;
-});
diff --git a/toolkit/components/reader/test/browser_readerMode_hidden_nodes.js b/toolkit/components/reader/test/browser_readerMode_hidden_nodes.js
deleted file mode 100644
index b73eab58d..000000000
--- a/toolkit/components/reader/test/browser_readerMode_hidden_nodes.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test that the reader mode button appears and works properly on
- * reader-able content.
- */
-const TEST_PREFS = [
- ["reader.parse-on-load.enabled", true],
- ["browser.reader.detectedFirstArticle", false],
-];
-
-const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "http://example.com");
-
-var readerButton = document.getElementById("reader-mode-button");
-
-add_task(function* test_reader_button() {
- registerCleanupFunction(function() {
- // Reset test prefs.
- TEST_PREFS.forEach(([name, value]) => {
- Services.prefs.clearUserPref(name);
- });
- while (gBrowser.tabs.length > 1) {
- gBrowser.removeCurrentTab();
- }
- });
-
- // Set required test prefs.
- TEST_PREFS.forEach(([name, value]) => {
- Services.prefs.setBoolPref(name, value);
- });
-
- let tab = gBrowser.selectedTab = gBrowser.addTab();
- is_element_hidden(readerButton, "Reader mode button is not present on a new tab");
- // Point tab to a test page that is not reader-able due to hidden nodes.
- let url = TEST_PATH + "readerModeArticleHiddenNodes.html";
- let paintPromise = ContentTask.spawn(tab.linkedBrowser, "", function() {
- return new Promise(resolve => {
- addEventListener("DOMContentLoaded", function onDCL() {
- removeEventListener("DOMContentLoaded", onDCL);
- addEventListener("MozAfterPaint", function onPaint() {
- removeEventListener("MozAfterPaint", onPaint);
- resolve();
- });
- });
- });
- });
- tab.linkedBrowser.loadURI(url);
- yield paintPromise;
-
- is_element_hidden(readerButton, "Reader mode button is still not present on tab with unreadable content.");
-});
diff --git a/toolkit/components/reader/test/browser_readerMode_with_anchor.js b/toolkit/components/reader/test/browser_readerMode_with_anchor.js
deleted file mode 100644
index 24c23c49f..000000000
--- a/toolkit/components/reader/test/browser_readerMode_with_anchor.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "http://example.com");
-
-add_task(function* () {
- yield BrowserTestUtils.withNewTab(TEST_PATH + "readerModeArticle.html#foo", function* (browser) {
- let pageShownPromise = BrowserTestUtils.waitForContentEvent(browser, "AboutReaderContentReady");
- let readerButton = document.getElementById("reader-mode-button");
- readerButton.click();
- yield pageShownPromise;
- yield ContentTask.spawn(browser, null, function* () {
- // Check if offset != 0
- ok(content.document.getElementById("foo") !== null, "foo element should be in document");
- ok(content.pageYOffset != 0, "pageYOffset should be > 0");
- });
- });
-});
diff --git a/toolkit/components/reader/test/head.js b/toolkit/components/reader/test/head.js
deleted file mode 100644
index 3d8d989bc..000000000
--- a/toolkit/components/reader/test/head.js
+++ /dev/null
@@ -1,126 +0,0 @@
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-
-/* exported promiseTabLoadEvent, promiseWaitForCondition, is_element_visible, is_element_hidden */
-
-/**
- * Waits for a load (or custom) event to finish in a given tab. If provided
- * load an uri into the tab.
- *
- * @param tab
- * The tab to load into.
- * @param [optional] url
- * The url to load, or the current url.
- * @return {Promise} resolved when the event is handled.
- * @resolves to the received event
- * @rejects if a valid load event is not received within a meaningful interval
- */
-function promiseTabLoadEvent(tab, url) {
- let deferred = Promise.defer();
- info("Wait tab event: load");
-
- function handle(loadedUrl) {
- if (loadedUrl === "about:blank" || (url && loadedUrl !== url)) {
- info(`Skipping spurious load event for ${loadedUrl}`);
- return false;
- }
-
- info("Tab event received: load");
- return true;
- }
-
- // Create two promises: one resolved from the content process when the page
- // loads and one that is rejected if we take too long to load the url.
- let loaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser, false, handle);
-
- let timeout = setTimeout(() => {
- deferred.reject(new Error("Timed out while waiting for a 'load' event"));
- }, 30000);
-
- loaded.then(() => {
- clearTimeout(timeout);
- deferred.resolve();
- });
-
- if (url)
- BrowserTestUtils.loadURI(tab.linkedBrowser, url);
-
- // Promise.all rejects if either promise rejects (i.e. if we time out) and
- // if our loaded promise resolves before the timeout, then we resolve the
- // timeout promise as well, causing the all promise to resolve.
- return Promise.all([deferred.promise, loaded]);
-}
-
-function waitForCondition(condition, nextTest, errorMsg, retryTimes) {
- retryTimes = typeof retryTimes !== 'undefined' ? retryTimes : 30;
- var tries = 0;
- var interval = setInterval(function() {
- if (tries >= retryTimes) {
- ok(false, errorMsg);
- moveOn();
- }
- var conditionPassed;
- try {
- conditionPassed = condition();
- } catch (e) {
- ok(false, e + "\n" + e.stack);
- conditionPassed = false;
- }
- if (conditionPassed) {
- moveOn();
- }
- tries++;
- }, 100);
- var moveOn = function() {
- clearInterval(interval);
- nextTest();
- };
-}
-
-function promiseWaitForCondition(aConditionFn) {
- let deferred = Promise.defer();
- waitForCondition(aConditionFn, deferred.resolve, "Condition didn't pass.");
- return deferred.promise;
-}
-
-function is_element_visible(element, msg) {
- isnot(element, null, "Element should not be null, when checking visibility");
- ok(is_visible(element), msg || "Element should be visible");
-
-}
-function is_element_hidden(element, msg) {
- isnot(element, null, "Element should not be null, when checking visibility");
- ok(is_hidden(element), msg || "Element should be hidden");
-}
-
-function is_visible(element) {
- var style = element.ownerGlobal.getComputedStyle(element);
- if (style.display == "none")
- return false;
- if (style.visibility != "visible")
- return false;
- if (style.display == "-moz-popup" && element.state != "open")
- return false;
-
- // Hiding a parent element will hide all its children
- if (element.parentNode != element.ownerDocument)
- return is_visible(element.parentNode);
-
- return true;
-}
-
-function is_hidden(element) {
- var style = element.ownerGlobal.getComputedStyle(element);
- if (style.display == "none")
- return true;
- if (style.visibility != "visible")
- return true;
- if (style.display == "-moz-popup")
- return ["hiding", "closed"].indexOf(element.state) != -1;
-
- // Hiding a parent element will hide all its children
- if (element.parentNode != element.ownerDocument)
- return is_hidden(element.parentNode);
-
- return false;
-}
diff --git a/toolkit/components/reader/test/readerModeArticle.html b/toolkit/components/reader/test/readerModeArticle.html
deleted file mode 100644
index 7c5033d5b..000000000
--- a/toolkit/components/reader/test/readerModeArticle.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Article title</title>
-<meta name="description" content="This is the article description." />
-</head>
-<body>
-<header>Site header</header>
-<div>
-<h1>Article title</h1>
-<h2 class="author">by Jane Doe</h2>
-<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p>
-<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
-<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
-<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
-<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
-<div id="foo">by John Doe</div>
-<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p>
-<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
-<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
-<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
-<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
-</div>
-</body>
-</html>
diff --git a/toolkit/components/reader/test/readerModeArticleHiddenNodes.html b/toolkit/components/reader/test/readerModeArticleHiddenNodes.html
deleted file mode 100644
index 92441b797..000000000
--- a/toolkit/components/reader/test/readerModeArticleHiddenNodes.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<title>Article title</title>
-<meta name="description" content="This is the article description." />
-</head>
-<body>
-<style>
-p { display: none }
-</style>
-<header>Site header</header>
-<div>
-<h1>Article title</h1>
-<h2 class="author">by Jane Doe</h2>
-<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante hendrerit. Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aenean ut gravida lorem. Ut turpis felis, pulvinar a semper sed, adipiscing id dolor. Pellentesque auctor nisi id magna consequat sagittis. Curabitur dapibus enim sit amet elit pharetra tincidunt feugiat nisl imperdiet. Ut convallis libero in urna ultrices accumsan. Donec sed odio eros. Donec viverra mi quis quam pulvinar at malesuada arcu rhoncus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. In rutrum accumsan ultricies. Mauris vitae nisi at sem facilisis semper ac in est.</p>
-<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
-<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
-<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
-<p>Vivamus fermentum semper porta. Nunc diam velit, adipiscing ut tristique vitae, sagittis vel odio. Maecenas convallis ullamcorper ultricies. Curabitur ornare, ligula semper consectetur sagittis, nisi diam iaculis velit, id fringilla sem nunc vel mi. Nam dictum, odio nec pretium volutpat, arcu ante placerat erat, non tristique elit urna et turpis. Quisque mi metus, ornare sit amet fermentum et, tincidunt et orci. Fusce eget orci a orci congue vestibulum. Ut dolor diam, elementum et vestibulum eu, porttitor vel elit. Curabitur venenatis pulvinar tellus gravida ornare. Sed et erat faucibus nunc euismod ultricies ut id justo. Nullam cursus suscipit nisi, et ultrices justo sodales nec. Fusce venenatis facilisis lectus ac semper. Aliquam at massa ipsum. Quisque bibendum purus convallis nulla ultrices ultricies. Nullam aliquam, mi eu aliquam tincidunt, purus velit laoreet tortor, viverra pretium nisi quam vitae mi. Fusce vel volutpat elit. Nam sagittis nisi dui.</p>
-</div>
-</body>
-</html>
diff --git a/toolkit/components/remotebrowserutils/moz.build b/toolkit/components/remotebrowserutils/moz.build
index 9cfc4a976..47ee6a483 100644
--- a/toolkit/components/remotebrowserutils/moz.build
+++ b/toolkit/components/remotebrowserutils/moz.build
@@ -8,5 +8,3 @@ EXTRA_COMPONENTS += [
'remotebrowserutils.manifest',
'RemoteWebNavigation.js',
]
-
-BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
diff --git a/toolkit/components/remotebrowserutils/tests/browser/.eslintrc.js b/toolkit/components/remotebrowserutils/tests/browser/.eslintrc.js
deleted file mode 100644
index 7c8021192..000000000
--- a/toolkit/components/remotebrowserutils/tests/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/remotebrowserutils/tests/browser/browser.ini b/toolkit/components/remotebrowserutils/tests/browser/browser.ini
deleted file mode 100644
index 916d0f9cb..000000000
--- a/toolkit/components/remotebrowserutils/tests/browser/browser.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-run-if = e10s
-support-files =
- dummy_page.html
-
-[browser_RemoteWebNavigation.js]
diff --git a/toolkit/components/remotebrowserutils/tests/browser/browser_RemoteWebNavigation.js b/toolkit/components/remotebrowserutils/tests/browser/browser_RemoteWebNavigation.js
deleted file mode 100644
index 106758e81..000000000
--- a/toolkit/components/remotebrowserutils/tests/browser/browser_RemoteWebNavigation.js
+++ /dev/null
@@ -1,156 +0,0 @@
-/* eslint-env mozilla/frame-script */
-
-const DUMMY1 = "http://example.com/browser/toolkit/modules/tests/browser/dummy_page.html";
-const DUMMY2 = "http://example.org/browser/toolkit/modules/tests/browser/dummy_page.html"
-
-function waitForLoad(uri) {
- return BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser, false, uri);
-}
-
-function waitForPageShow(browser = gBrowser.selectedBrowser) {
- return BrowserTestUtils.waitForContentEvent(browser, "pageshow", true);
-}
-
-function makeURI(url) {
- return Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService).
- newURI(url, null, null);
-}
-
-// Tests that loadURI accepts a referrer and it is included in the load.
-add_task(function* test_referrer() {
- gBrowser.selectedTab = gBrowser.addTab();
- let browser = gBrowser.selectedBrowser;
-
- browser.webNavigation.loadURI(DUMMY1,
- Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
- makeURI(DUMMY2),
- null, null);
- yield waitForLoad(DUMMY1);
-
- yield ContentTask.spawn(browser, [ DUMMY1, DUMMY2 ], function([dummy1, dummy2]) {
- is(content.location.href, dummy1, "Should have loaded the right URL");
- is(content.document.referrer, dummy2, "Should have the right referrer");
- });
-
- gBrowser.removeCurrentTab();
-});
-
-// Tests that remote access to webnavigation.sessionHistory works.
-add_task(function* test_history() {
- function checkHistoryIndex(browser, n) {
- return ContentTask.spawn(browser, n, function(n) {
- let history = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISHistory);
- is(history.index, n, "Should be at the right place in history");
- });
- }
- gBrowser.selectedTab = gBrowser.addTab();
- let browser = gBrowser.selectedBrowser;
-
- browser.webNavigation.loadURI(DUMMY1,
- Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
- null, null, null);
- yield waitForLoad(DUMMY1);
-
- browser.webNavigation.loadURI(DUMMY2,
- Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
- null, null, null);
- yield waitForLoad(DUMMY2);
-
- yield ContentTask.spawn(browser, [DUMMY1, DUMMY2], function([dummy1, dummy2]) {
- let history = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISHistory);
- is(history.count, 2, "Should be two history items");
- is(history.index, 1, "Should be at the right place in history");
- let entry = history.getEntryAtIndex(0, false);
- is(entry.URI.spec, dummy1, "Should have the right history entry");
- entry = history.getEntryAtIndex(1, false);
- is(entry.URI.spec, dummy2, "Should have the right history entry");
- });
-
- let promise = waitForPageShow();
- browser.webNavigation.goBack();
- yield promise;
- yield checkHistoryIndex(browser, 0);
-
- promise = waitForPageShow();
- browser.webNavigation.goForward();
- yield promise;
- yield checkHistoryIndex(browser, 1);
-
- promise = waitForPageShow();
- browser.webNavigation.gotoIndex(0);
- yield promise;
- yield checkHistoryIndex(browser, 0);
-
- gBrowser.removeCurrentTab();
-});
-
-// Tests that load flags are passed through to the content process.
-add_task(function* test_flags() {
- function checkHistory(browser, { count, index }) {
- return ContentTask.spawn(browser, [ DUMMY2, count, index ],
- function([ dummy2, count, index ]) {
- let history = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISHistory);
- is(history.count, count, "Should be one history item");
- is(history.index, index, "Should be at the right place in history");
- let entry = history.getEntryAtIndex(index, false);
- is(entry.URI.spec, dummy2, "Should have the right history entry");
- });
- }
-
- gBrowser.selectedTab = gBrowser.addTab();
- let browser = gBrowser.selectedBrowser;
-
- browser.webNavigation.loadURI(DUMMY1,
- Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
- null, null, null);
- yield waitForLoad(DUMMY1);
-
- browser.webNavigation.loadURI(DUMMY2,
- Ci.nsIWebNavigation.LOAD_FLAGS_REPLACE_HISTORY,
- null, null, null);
- yield waitForLoad(DUMMY2);
- yield checkHistory(browser, { count: 1, index: 0 });
-
- browser.webNavigation.loadURI(DUMMY1,
- Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY,
- null, null, null);
- yield waitForLoad(DUMMY1);
- yield checkHistory(browser, { count: 1, index: 0 });
-
- gBrowser.removeCurrentTab();
-});
-
-// Tests that attempts to use unsupported arguments throw an exception.
-add_task(function* test_badarguments() {
- if (!gMultiProcessBrowser)
- return;
-
- gBrowser.selectedTab = gBrowser.addTab();
- let browser = gBrowser.selectedBrowser;
-
- try {
- browser.webNavigation.loadURI(DUMMY1,
- Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
- null, {}, null);
- ok(false, "Should have seen an exception from trying to pass some postdata");
- }
- catch (e) {
- ok(true, "Should have seen an exception from trying to pass some postdata");
- }
-
- try {
- browser.webNavigation.loadURI(DUMMY1,
- Ci.nsIWebNavigation.LOAD_FLAGS_NONE,
- null, null, {});
- ok(false, "Should have seen an exception from trying to pass some headers");
- }
- catch (e) {
- ok(true, "Should have seen an exception from trying to pass some headers");
- }
-
- gBrowser.removeCurrentTab();
-});
diff --git a/toolkit/components/remotebrowserutils/tests/browser/dummy_page.html b/toolkit/components/remotebrowserutils/tests/browser/dummy_page.html
deleted file mode 100644
index c1c9a4e04..000000000
--- a/toolkit/components/remotebrowserutils/tests/browser/dummy_page.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<body>
-<p>Page</p>
-</body>
-</html>
diff --git a/toolkit/components/satchel/FormHistory.jsm b/toolkit/components/satchel/FormHistory.jsm
index 3d4a9fc43..2182fbfb7 100644
--- a/toolkit/components/satchel/FormHistory.jsm
+++ b/toolkit/components/satchel/FormHistory.jsm
@@ -91,7 +91,6 @@ const Cr = Components.results;
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyServiceGetter(this, "uuidService",
"@mozilla.org/uuid-generator;1",
@@ -102,7 +101,7 @@ const DAY_IN_MS = 86400000; // 1 day in milliseconds
const MAX_SEARCH_TOKENS = 10;
const NOOP = function noop() {};
-var supportsDeletedTable = AppConstants.platform == "android";
+var supportsDeletedTable = false;
var Prefs = {
initialized: false,
diff --git a/toolkit/components/satchel/moz.build b/toolkit/components/satchel/moz.build
index 239f412bc..f9f727da0 100644
--- a/toolkit/components/satchel/moz.build
+++ b/toolkit/components/satchel/moz.build
@@ -4,10 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-MOCHITEST_MANIFESTS += ['test/mochitest.ini']
-XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
-BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
-
XPIDL_SOURCES += [
'nsIFormAutoComplete.idl',
'nsIFormFillController.idl',
@@ -17,13 +13,9 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'satchel'
-SOURCES += [
- 'nsFormFillController.cpp',
-]
+SOURCES += ['nsFormFillController.cpp']
-LOCAL_INCLUDES += [
- '../build',
-]
+LOCAL_INCLUDES += ['../build']
EXTRA_COMPONENTS += [
'FormHistoryStartup.js',
diff --git a/toolkit/components/satchel/nsFormFillController.cpp b/toolkit/components/satchel/nsFormFillController.cpp
index d70036635..d8dae41ed 100644
--- a/toolkit/components/satchel/nsFormFillController.cpp
+++ b/toolkit/components/satchel/nsFormFillController.cpp
@@ -985,7 +985,6 @@ nsFormFillController::Focus(nsIDOMEvent* aEvent)
return NS_OK;
}
-#ifndef ANDROID
nsCOMPtr<nsIFormControl> formControl = do_QueryInterface(mFocusedInputNode);
MOZ_ASSERT(formControl);
@@ -995,7 +994,6 @@ nsFormFillController::Focus(nsIDOMEvent* aEvent)
&& formControl->GetType() == NS_FORM_INPUT_PASSWORD) {
ShowPopup();
}
-#endif
mContextMenuFiredBeforeFocus = false;
return NS_OK;
diff --git a/toolkit/components/satchel/nsFormHistory.js b/toolkit/components/satchel/nsFormHistory.js
index d68be2d58..f940e104d 100644
--- a/toolkit/components/satchel/nsFormHistory.js
+++ b/toolkit/components/satchel/nsFormHistory.js
@@ -12,8 +12,6 @@ Components.utils.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
"resource://gre/modules/Deprecated.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
const DB_VERSION = 4;
const DAY_IN_MS = 86400000; // 1 day in milliseconds
@@ -351,26 +349,6 @@ FormHistory.prototype = {
},
moveToDeletedTable : function moveToDeletedTable(values, params) {
- if (AppConstants.platform == "android") {
- this.log("Moving entries to deleted table.");
-
- let stmt;
-
- try {
- // Move the entries to the deleted items table.
- let query = "INSERT INTO moz_deleted_formhistory (guid, timeDeleted) ";
- if (values) query += values;
- stmt = this.dbCreateStatement(query, params);
- stmt.execute();
- } catch (e) {
- this.log("Moving deleted entries failed: " + e);
- throw e;
- } finally {
- if (stmt) {
- stmt.reset();
- }
- }
- }
},
get dbConnection() {
diff --git a/toolkit/components/satchel/test/.eslintrc.js b/toolkit/components/satchel/test/.eslintrc.js
deleted file mode 100644
index 3c788d6d6..000000000
--- a/toolkit/components/satchel/test/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/mochitest.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/satchel/test/browser/.eslintrc.js b/toolkit/components/satchel/test/browser/.eslintrc.js
deleted file mode 100644
index 7c8021192..000000000
--- a/toolkit/components/satchel/test/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/satchel/test/browser/browser.ini b/toolkit/components/satchel/test/browser/browser.ini
deleted file mode 100644
index 6a3fc452e..000000000
--- a/toolkit/components/satchel/test/browser/browser.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[DEFAULT]
-support-files =
- !/toolkit/components/satchel/test/subtst_privbrowsing.html
-
-[browser_privbrowsing_perwindowpb.js]
diff --git a/toolkit/components/satchel/test/browser/browser_privbrowsing_perwindowpb.js b/toolkit/components/satchel/test/browser/browser_privbrowsing_perwindowpb.js
deleted file mode 100644
index 982480648..000000000
--- a/toolkit/components/satchel/test/browser/browser_privbrowsing_perwindowpb.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var FormHistory = (Components.utils.import("resource://gre/modules/FormHistory.jsm", {})).FormHistory;
-
-/** Test for Bug 472396 **/
-add_task(function* test() {
- // initialization
- let windowsToClose = [];
- let testURI =
- "http://example.com/tests/toolkit/components/satchel/test/subtst_privbrowsing.html";
-
- function* doTest(aShouldValueExist, aWindow) {
- let browser = aWindow.gBrowser.selectedBrowser;
- BrowserTestUtils.loadURI(browser, testURI);
- yield BrowserTestUtils.browserLoaded(browser);
-
- // Wait for the page to reload itself.
- yield BrowserTestUtils.browserLoaded(browser);
-
- let count = 0;
- let doneCounting = {};
- doneCounting.promise = new Promise(resolve => doneCounting.resolve = resolve);
- FormHistory.count({ fieldname: "field", value: "value" },
- {
- handleResult(result) {
- count = result;
- },
- handleError(error) {
- do_throw("Error occurred searching form history: " + error);
- },
- handleCompletion(num) {
- if (aShouldValueExist) {
- is(count, 1, "In non-PB mode, we add a single entry");
- } else {
- is(count, 0, "In PB mode, we don't add any entries");
- }
-
- doneCounting.resolve();
- }
- });
- yield doneCounting.promise;
- }
-
- function testOnWindow(aOptions, aCallback) {
- return BrowserTestUtils.openNewBrowserWindow(aOptions)
- .then(win => { windowsToClose.push(win); return win; });
- }
-
-
- yield testOnWindow({private: true}).then((aWin) => {
- return Task.spawn(doTest(false, aWin));
- });
-
- // Test when not on private mode after visiting a site on private
- // mode. The form history should not exist.
- yield testOnWindow({}).then((aWin) => {
- return Task.spawn(doTest(true, aWin));
- });
-
- yield Promise.all(windowsToClose.map(win => BrowserTestUtils.closeWindow(win)));
-});
diff --git a/toolkit/components/satchel/test/mochitest.ini b/toolkit/components/satchel/test/mochitest.ini
deleted file mode 100644
index 5a65baeb6..000000000
--- a/toolkit/components/satchel/test/mochitest.ini
+++ /dev/null
@@ -1,19 +0,0 @@
-[DEFAULT]
-skip-if = toolkit == 'android' || os == 'linux' # linux - bug 1022386
-support-files =
- satchel_common.js
- subtst_form_submission_1.html
- subtst_privbrowsing.html
- parent_utils.js
-
-[test_bug_511615.html]
-[test_bug_787624.html]
-[test_datalist_with_caching.html]
-[test_form_autocomplete.html]
-[test_form_autocomplete_with_list.html]
-[test_form_submission.html]
-[test_form_submission_cap.html]
-[test_form_submission_cap2.html]
-[test_password_autocomplete.html]
-[test_popup_direction.html]
-[test_popup_enter_event.html]
diff --git a/toolkit/components/satchel/test/parent_utils.js b/toolkit/components/satchel/test/parent_utils.js
deleted file mode 100644
index 87738bdb5..000000000
--- a/toolkit/components/satchel/test/parent_utils.js
+++ /dev/null
@@ -1,149 +0,0 @@
-const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/FormHistory.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://testing-common/ContentTaskUtils.jsm");
-
-var gAutocompletePopup = Services.ww.activeWindow.
- document.
- getElementById("PopupAutoComplete");
-assert.ok(gAutocompletePopup, "Got autocomplete popup");
-
-var ParentUtils = {
- getMenuEntries() {
- let entries = [];
- let numRows = gAutocompletePopup.view.matchCount;
- for (let i = 0; i < numRows; i++) {
- entries.push(gAutocompletePopup.view.getValueAt(i));
- }
- return entries;
- },
-
- cleanUpFormHist() {
- FormHistory.update({ op: "remove" });
- },
-
- updateFormHistory(changes) {
- let handler = {
- handleError: function (error) {
- assert.ok(false, error);
- sendAsyncMessage("formHistoryUpdated", { ok: false });
- },
- handleCompletion: function (reason) {
- if (!reason)
- sendAsyncMessage("formHistoryUpdated", { ok: true });
- },
- };
- FormHistory.update(changes, handler);
- },
-
- popupshownListener() {
- let results = this.getMenuEntries();
- sendAsyncMessage("onpopupshown", { results });
- },
-
- countEntries(name, value) {
- let obj = {};
- if (name)
- obj.fieldname = name;
- if (value)
- obj.value = value;
-
- let count = 0;
- let listener = {
- handleResult(result) { count = result },
- handleError(error) {
- assert.ok(false, error);
- sendAsyncMessage("entriesCounted", { ok: false });
- },
- handleCompletion(reason) {
- if (!reason) {
- sendAsyncMessage("entriesCounted", { ok: true, count });
- }
- }
- };
-
- FormHistory.count(obj, listener);
- },
-
- checkRowCount(expectedCount, expectedFirstValue = null) {
- ContentTaskUtils.waitForCondition(() => {
- // This may be called before gAutocompletePopup has initialised
- // which causes it to throw
- try {
- return gAutocompletePopup.view.matchCount === expectedCount &&
- (!expectedFirstValue ||
- expectedCount <= 1 ||
- gAutocompletePopup.view.getValueAt(0) === expectedFirstValue);
- } catch (e) {
- return false;
- }
- }, "Waiting for row count change: " + expectedCount + " First value: " + expectedFirstValue).then(() => {
- let results = this.getMenuEntries();
- sendAsyncMessage("gotMenuChange", { results });
- });
- },
-
- checkSelectedIndex(expectedIndex) {
- ContentTaskUtils.waitForCondition(() => {
- return gAutocompletePopup.popupOpen &&
- gAutocompletePopup.selectedIndex === expectedIndex;
- }, "Checking selected index").then(() => {
- sendAsyncMessage("gotSelectedIndex");
- });
- },
-
- getPopupState() {
- sendAsyncMessage("gotPopupState", {
- open: gAutocompletePopup.popupOpen,
- selectedIndex: gAutocompletePopup.selectedIndex,
- direction: gAutocompletePopup.style.direction,
- });
- },
-
- observe(subject, topic, data) {
- assert.ok(topic === "satchel-storage-changed");
- sendAsyncMessage("satchel-storage-changed", { subject: null, topic, data });
- },
-
- cleanup() {
- gAutocompletePopup.removeEventListener("popupshown", this._popupshownListener);
- this.cleanUpFormHist();
- }
-};
-
-ParentUtils._popupshownListener =
- ParentUtils.popupshownListener.bind(ParentUtils);
-gAutocompletePopup.addEventListener("popupshown", ParentUtils._popupshownListener);
-ParentUtils.cleanUpFormHist();
-
-addMessageListener("updateFormHistory", (msg) => {
- ParentUtils.updateFormHistory(msg.changes);
-});
-
-addMessageListener("countEntries", ({ name, value }) => {
- ParentUtils.countEntries(name, value);
-});
-
-addMessageListener("waitForMenuChange", ({ expectedCount, expectedFirstValue }) => {
- ParentUtils.checkRowCount(expectedCount, expectedFirstValue);
-});
-
-addMessageListener("waitForSelectedIndex", ({ expectedIndex }) => {
- ParentUtils.checkSelectedIndex(expectedIndex);
-});
-
-addMessageListener("getPopupState", () => {
- ParentUtils.getPopupState();
-});
-
-addMessageListener("addObserver", () => {
- Services.obs.addObserver(ParentUtils, "satchel-storage-changed", false);
-});
-addMessageListener("removeObserver", () => {
- Services.obs.removeObserver(ParentUtils, "satchel-storage-changed");
-});
-
-addMessageListener("cleanup", () => {
- ParentUtils.cleanup();
-});
diff --git a/toolkit/components/satchel/test/satchel_common.js b/toolkit/components/satchel/test/satchel_common.js
deleted file mode 100644
index c047f40af..000000000
--- a/toolkit/components/satchel/test/satchel_common.js
+++ /dev/null
@@ -1,274 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var gPopupShownExpected = false;
-var gPopupShownListener;
-var gLastAutoCompleteResults;
-var gChromeScript;
-
-/*
- * Returns the element with the specified |name| attribute.
- */
-function $_(formNum, name) {
- var form = document.getElementById("form" + formNum);
- if (!form) {
- ok(false, "$_ couldn't find requested form " + formNum);
- return null;
- }
-
- var element = form.elements.namedItem(name);
- if (!element) {
- ok(false, "$_ couldn't find requested element " + name);
- return null;
- }
-
- // Note that namedItem is a bit stupid, and will prefer an
- // |id| attribute over a |name| attribute when looking for
- // the element.
-
- if (element.hasAttribute("name") && element.getAttribute("name") != name) {
- ok(false, "$_ got confused.");
- return null;
- }
-
- return element;
-}
-
-// Mochitest gives us a sendKey(), but it's targeted to a specific element.
-// This basically sends an untargeted key event, to whatever's focused.
-function doKey(aKey, modifier) {
- var keyName = "DOM_VK_" + aKey.toUpperCase();
- var key = SpecialPowers.Ci.nsIDOMKeyEvent[keyName];
-
- // undefined --> null
- if (!modifier)
- modifier = null;
-
- // Window utils for sending fake key events.
- var wutils = SpecialPowers.getDOMWindowUtils(window);
-
- if (wutils.sendKeyEvent("keydown", key, 0, modifier)) {
- wutils.sendKeyEvent("keypress", key, 0, modifier);
- }
- wutils.sendKeyEvent("keyup", key, 0, modifier);
-}
-
-function registerPopupShownListener(listener) {
- if (gPopupShownListener) {
- ok(false, "got too many popupshownlisteners");
- return;
- }
- gPopupShownListener = listener;
-}
-
-function getMenuEntries() {
- if (!gLastAutoCompleteResults) {
- throw new Error("no autocomplete results");
- }
-
- var results = gLastAutoCompleteResults;
- gLastAutoCompleteResults = null;
- return results;
-}
-
-function checkArrayValues(actualValues, expectedValues, msg) {
- is(actualValues.length, expectedValues.length, "Checking array values: " + msg);
- for (var i = 0; i < expectedValues.length; i++)
- is(actualValues[i], expectedValues[i], msg + " Checking array entry #" + i);
-}
-
-var checkObserver = {
- verifyStack: [],
- callback: null,
-
- init() {
- gChromeScript.sendAsyncMessage("addObserver");
- gChromeScript.addMessageListener("satchel-storage-changed", this.observe.bind(this));
- },
-
- uninit() {
- gChromeScript.sendAsyncMessage("removeObserver");
- },
-
- waitForChecks: function(callback) {
- if (this.verifyStack.length == 0)
- callback();
- else
- this.callback = callback;
- },
-
- observe: function({ subject, topic, data }) {
- if (data != "formhistory-add" && data != "formhistory-update")
- return;
- ok(this.verifyStack.length > 0, "checking if saved form data was expected");
-
- // Make sure that every piece of data we expect to be saved is saved, and no
- // more. Here it is assumed that for every entry satchel saves or modifies, a
- // message is sent.
- //
- // We don't actually check the content of the message, but just that the right
- // quantity of messages is received.
- // - if there are too few messages, test will time out
- // - if there are too many messages, test will error out here
- //
- var expected = this.verifyStack.shift();
-
- countEntries(expected.name, expected.value,
- function(num) {
- ok(num > 0, expected.message);
- if (checkObserver.verifyStack.length == 0) {
- var callback = checkObserver.callback;
- checkObserver.callback = null;
- callback();
- }
- });
- }
-};
-
-function checkForSave(name, value, message) {
- checkObserver.verifyStack.push({ name : name, value: value, message: message });
-}
-
-function getFormSubmitButton(formNum) {
- var form = $("form" + formNum); // by id, not name
- ok(form != null, "getting form " + formNum);
-
- // we can't just call form.submit(), because that doesn't seem to
- // invoke the form onsubmit handler.
- var button = form.firstChild;
- while (button && button.type != "submit") { button = button.nextSibling; }
- ok(button != null, "getting form submit button");
-
- return button;
-}
-
-// Count the number of entries with the given name and value, and call then(number)
-// when done. If name or value is null, then the value of that field does not matter.
-function countEntries(name, value, then = null) {
- return new Promise(resolve => {
- gChromeScript.sendAsyncMessage("countEntries", { name, value });
- gChromeScript.addMessageListener("entriesCounted", function counted(data) {
- gChromeScript.removeMessageListener("entriesCounted", counted);
- if (!data.ok) {
- ok(false, "Error occurred counting form history");
- SimpleTest.finish();
- return;
- }
-
- if (then) {
- then(data.count);
- }
- resolve(data.count);
- });
- });
-}
-
-// Wrapper around FormHistory.update which handles errors. Calls then() when done.
-function updateFormHistory(changes, then = null) {
- return new Promise(resolve => {
- gChromeScript.sendAsyncMessage("updateFormHistory", { changes });
- gChromeScript.addMessageListener("formHistoryUpdated", function updated({ ok }) {
- gChromeScript.removeMessageListener("formHistoryUpdated", updated);
- if (!ok) {
- ok(false, "Error occurred updating form history");
- SimpleTest.finish();
- return;
- }
-
- if (then) {
- then();
- }
- resolve();
- });
- });
-}
-
-function notifyMenuChanged(expectedCount, expectedFirstValue, then = null) {
- return new Promise(resolve => {
- gChromeScript.sendAsyncMessage("waitForMenuChange",
- { expectedCount,
- expectedFirstValue });
- gChromeScript.addMessageListener("gotMenuChange", function changed({ results }) {
- gChromeScript.removeMessageListener("gotMenuChange", changed);
- gLastAutoCompleteResults = results;
- if (then) {
- then(results);
- }
- resolve(results);
- });
- });
-}
-
-function notifySelectedIndex(expectedIndex, then = null) {
- return new Promise(resolve => {
- gChromeScript.sendAsyncMessage("waitForSelectedIndex", { expectedIndex });
- gChromeScript.addMessageListener("gotSelectedIndex", function changed() {
- gChromeScript.removeMessageListener("gotSelectedIndex", changed);
- if (then) {
- then();
- }
- resolve();
- });
- });
-}
-
-function getPopupState(then = null) {
- return new Promise(resolve => {
- gChromeScript.sendAsyncMessage("getPopupState");
- gChromeScript.addMessageListener("gotPopupState", function listener(state) {
- gChromeScript.removeMessageListener("gotPopupState", listener);
- if (then) {
- then(state);
- }
- resolve(state);
- });
- });
-}
-
-function listenForUnexpectedPopupShown() {
- gPopupShownListener = function onPopupShown() {
- if (!gPopupShownExpected) {
- ok(false, "Unexpected autocomplete popupshown event");
- }
- };
-}
-
-function* promiseNoUnexpectedPopupShown() {
- gPopupShownExpected = false;
- listenForUnexpectedPopupShown();
- SimpleTest.requestFlakyTimeout("Giving a chance for an unexpected popupshown to occur");
- yield new Promise(resolve => setTimeout(resolve, 1000));
-}
-
-/**
- * Resolve at the next popupshown event for the autocomplete popup
- * @return {Promise} with the results
- */
-function promiseACShown() {
- gPopupShownExpected = true;
- return new Promise(resolve => {
- gPopupShownListener = ({ results }) => {
- gPopupShownExpected = false;
- resolve(results);
- };
- });
-}
-
-function satchelCommonSetup() {
- var chromeURL = SimpleTest.getTestFileURL("parent_utils.js");
- gChromeScript = SpecialPowers.loadChromeScript(chromeURL);
- gChromeScript.addMessageListener("onpopupshown", ({ results }) => {
- gLastAutoCompleteResults = results;
- if (gPopupShownListener)
- gPopupShownListener({results});
- });
-
- SimpleTest.registerCleanupFunction(() => {
- gChromeScript.sendAsyncMessage("cleanup");
- gChromeScript.destroy();
- });
-}
-
-
-satchelCommonSetup();
diff --git a/toolkit/components/satchel/test/subtst_form_submission_1.html b/toolkit/components/satchel/test/subtst_form_submission_1.html
deleted file mode 100644
index f7441668a..000000000
--- a/toolkit/components/satchel/test/subtst_form_submission_1.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-
-<head>
-</head>
-
-<body>
-
-<form id="subform1" onsubmit="return checkSubmit(21)">
- <input id="subtest1" type="text" name="subtest1">
- <button type="submit">Submit</button>
-</form>
-
-<form id="subform2" onsubmit="return checkSubmit(100)">
- <input id="subtest2" type="text" name="subtest2">
- <button type="submit">Submit</button>
-</form>
-
-<script>
- function checkSubmit(num) {
- netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
- return parent.checkSubmit(num);
- }
-
- function clickButton(num) {
- if (num == 21)
- document.querySelectorAll("button")[0].click();
- else if (num == 100)
- document.querySelectorAll("button")[1].click();
- }
-
- // set the input's value (can't use a default value, as satchel will ignore it)
- document.getElementById("subtest1").value = "subtestValue";
- document.getElementById("subtest2").value = "subtestValue";
-</script>
-
-</body>
-</html>
diff --git a/toolkit/components/satchel/test/subtst_privbrowsing.html b/toolkit/components/satchel/test/subtst_privbrowsing.html
deleted file mode 100644
index b53e0b229..000000000
--- a/toolkit/components/satchel/test/subtst_privbrowsing.html
+++ /dev/null
@@ -1,22 +0,0 @@
-<html>
-<head>
- <meta charset=UTF-8>
- <title>Subtest for bug 472396</title>
- <script>
- function submitForm() {
- if (location.search.indexOf("field") == -1) {
- var form = document.getElementById("form");
- var field = document.getElementById("field");
- field.value = "value";
- form.submit();
- }
- }
- </script>
-</head>
-<body onload="submitForm();">
- <h2>Subtest for bug 472396</h2>
- <form id="form">
- <input name="field" id="field">
- </form>
-</body>
-</html>
diff --git a/toolkit/components/satchel/test/test_bug_511615.html b/toolkit/components/satchel/test/test_bug_511615.html
deleted file mode 100644
index 66972d9b3..000000000
--- a/toolkit/components/satchel/test/test_bug_511615.html
+++ /dev/null
@@ -1,194 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for Form History Autocomplete Untrusted Events: Bug 511615</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Test for Form History Autocomplete Untrusted Events: Bug 511615
-<p id="display"></p>
-
-<!-- we presumably can't hide the content for this test. -->
-<div id="content">
- <!-- normal, basic form -->
- <form id="form1" onsubmit="return false;">
- <input type="text" name="field1">
- <button type="submit">Submit</button>
- </form>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-var resolvePopupShownListener;
-registerPopupShownListener(() => resolvePopupShownListener());
-
-function waitForNextPopup() {
- return new Promise(resolve => { resolvePopupShownListener = resolve; });
-}
-
-/**
- * Indicates the time to wait before checking that the state of the autocomplete
- * popup, including whether it is open, has not changed in response to events.
- *
- * Manual testing on a fast machine revealed that 80ms was still unreliable,
- * while 100ms detected a simulated failure reliably. Unfortunately, this means
- * that to take into account slower machines we should use a larger value.
- *
- * Note that if a machine takes more than this time to show the popup, this
- * would not cause a failure, conversely the machine would not be able to detect
- * whether the test should have failed. In other words, this use of timeouts is
- * never expected to cause intermittent failures with test automation.
- */
-const POPUP_RESPONSE_WAIT_TIME_MS = 200;
-
-SimpleTest.requestFlakyTimeout("Must ensure that an event does not happen.");
-
-/**
- * Checks that the popup does not open in response to the given function.
- */
-function expectPopupDoesNotOpen(triggerFn) {
- let popupShown = waitForNextPopup();
- triggerFn();
- return Promise.race([
- popupShown.then(() => Promise.reject("Popup opened unexpectedly.")),
- new Promise(resolve => setTimeout(resolve, POPUP_RESPONSE_WAIT_TIME_MS)),
- ]);
-}
-
-/**
- * Checks that the selected index in the popup still matches the given value.
- */
-function checkSelectedIndexAfterResponseTime(expectedIndex) {
- return new Promise(resolve => {
- setTimeout(() => getPopupState(resolve), POPUP_RESPONSE_WAIT_TIME_MS);
- }).then(popupState => {
- is(popupState.open, true, "Popup should still be open.");
- is(popupState.selectedIndex, expectedIndex, "Selected index should match.");
- });
-}
-
-function doKeyUnprivileged(key) {
- let keyName = "DOM_VK_" + key.toUpperCase();
- let keycode, charcode;
-
- if (key.length == 1) {
- keycode = 0;
- charcode = key.charCodeAt(0);
- alwaysval = charcode;
- } else {
- keycode = KeyEvent[keyName];
- if (!keycode)
- throw "invalid keyname in test";
- charcode = 0;
- alwaysval = keycode;
- }
-
- let dnEvent = document.createEvent('KeyboardEvent');
- let prEvent = document.createEvent('KeyboardEvent');
- let upEvent = document.createEvent('KeyboardEvent');
-
- dnEvent.initKeyEvent("keydown", true, true, null, false, false, false, false, alwaysval, 0);
- prEvent.initKeyEvent("keypress", true, true, null, false, false, false, false, keycode, charcode);
- upEvent.initKeyEvent("keyup", true, true, null, false, false, false, false, alwaysval, 0);
-
- input.dispatchEvent(dnEvent);
- input.dispatchEvent(prEvent);
- input.dispatchEvent(upEvent);
-}
-
-function doClickWithMouseEventUnprivileged() {
- let dnEvent = document.createEvent('MouseEvent');
- let upEvent = document.createEvent('MouseEvent');
- let ckEvent = document.createEvent('MouseEvent');
-
- dnEvent.initMouseEvent("mousedown", true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
- upEvent.initMouseEvent("mouseup", true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
- ckEvent.initMouseEvent("mouseclick", true, true, window, 1, 0, 0, 0, 0, false, false, false, false, 0, null);
-
- input.dispatchEvent(dnEvent);
- input.dispatchEvent(upEvent);
- input.dispatchEvent(ckEvent);
-}
-
-let input = $_(1, "field1");
-
-add_task(function* test_initialize() {
- yield new Promise(resolve => updateFormHistory([
- { op : "remove" },
- { op : "add", fieldname : "field1", value : "value1" },
- { op : "add", fieldname : "field1", value : "value2" },
- { op : "add", fieldname : "field1", value : "value3" },
- { op : "add", fieldname : "field1", value : "value4" },
- { op : "add", fieldname : "field1", value : "value5" },
- { op : "add", fieldname : "field1", value : "value6" },
- { op : "add", fieldname : "field1", value : "value7" },
- { op : "add", fieldname : "field1", value : "value8" },
- { op : "add", fieldname : "field1", value : "value9" },
- ], resolve));
-});
-
-add_task(function* test_untrusted_events_ignored() {
- // The autocomplete popup should not open from untrusted events.
- for (let triggerFn of [
- () => input.focus(),
- () => input.click(),
- () => doClickWithMouseEventUnprivileged(),
- () => doKeyUnprivileged("down"),
- () => doKeyUnprivileged("page_down"),
- () => doKeyUnprivileged("return"),
- () => doKeyUnprivileged("v"),
- () => doKeyUnprivileged(" "),
- () => doKeyUnprivileged("back_space"),
- ]) {
- // We must wait for the entire timeout for each individual test, because the
- // next event in the list might prevent the popup from opening.
- yield expectPopupDoesNotOpen(triggerFn);
- }
-
- // A privileged key press will actually open the popup.
- let popupShown = waitForNextPopup();
- doKey("down");
- yield popupShown;
-
- // The selected autocomplete item should not change from untrusted events.
- for (let triggerFn of [
- () => doKeyUnprivileged("down"),
- () => doKeyUnprivileged("page_down"),
- ]) {
- triggerFn();
- yield checkSelectedIndexAfterResponseTime(-1);
- }
-
- // A privileged key press will actually change the selected index.
- let indexChanged = new Promise(resolve => notifySelectedIndex(0, resolve));
- doKey("down");
- yield indexChanged;
-
- // The selected autocomplete item should not change and it should not be
- // possible to use it from untrusted events.
- for (let triggerFn of [
- () => doKeyUnprivileged("down"),
- () => doKeyUnprivileged("page_down"),
- () => doKeyUnprivileged("right"),
- () => doKeyUnprivileged(" "),
- () => doKeyUnprivileged("back_space"),
- () => doKeyUnprivileged("back_space"),
- () => doKeyUnprivileged("return"),
- ]) {
- triggerFn();
- yield checkSelectedIndexAfterResponseTime(0);
- is(input.value, "", "The selected item should not have been used.");
- }
-
- // Close the popup.
- input.blur();
-});
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/satchel/test/test_bug_787624.html b/toolkit/components/satchel/test/test_bug_787624.html
deleted file mode 100644
index 6ca5136cd..000000000
--- a/toolkit/components/satchel/test/test_bug_787624.html
+++ /dev/null
@@ -1,88 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for Layout of Form History Autocomplete: Bug 787624</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
- <style>
- .container {
- border: 1px solid #333;
- width: 80px;
- height: 26px;
- position: absolute;
- z-index: 2;
- }
-
- .subcontainer {
- width: 100%;
- overflow: hidden;
- }
-
- .subcontainer input {
- width: 120px;
- margin: 2px 6px;
- padding-right: 4px;
- border: none;
- height: 22px;
- z-index: 1;
- outline: 1px dashed #555
- }
- </style>
-</head>
-<body>
-Form History Layout test: form field autocomplete: Bug 787624
-<p id="display"></p>
-
-<!-- we presumably can't hide the content for this test. -->
-<div id="content">
- <!-- in this form, the input field is partially hidden and can scroll -->
- <div class="container">
- <div class="subcontainer">
- <form id="form1" onsubmit="return false;">
- <input type="text" name="field1">
- <button type="submit">Submit</button>
- </form>
- </div>
- </div>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Form History autocomplete Layout: Bug 787624 **/
-
-var resolvePopupShownListener;
-registerPopupShownListener(() => resolvePopupShownListener());
-
-function waitForNextPopup() {
- return new Promise(resolve => { resolvePopupShownListener = resolve; });
-}
-
-add_task(function* test_popup_not_move_input() {
- var input = $_(1, "field1");
- var rect = input.getBoundingClientRect();
-
- yield new Promise(resolve => updateFormHistory([
- { op : "remove" },
- { op : "add", fieldname : "field1", value : "value1" },
- { op : "add", fieldname : "field1", value : "value2" },
- ], resolve));
-
- let popupShown = waitForNextPopup();
- input.focus();
- doKey("down");
- yield popupShown;
-
- var newRect = input.getBoundingClientRect();
- is(newRect.left, rect.left,
- "autocomplete popup does not disturb the input position");
- is(newRect.top, rect.top,
- "autocomplete popup does not disturb the input position");
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/satchel/test/test_datalist_with_caching.html b/toolkit/components/satchel/test/test_datalist_with_caching.html
deleted file mode 100644
index 8445cb159..000000000
--- a/toolkit/components/satchel/test/test_datalist_with_caching.html
+++ /dev/null
@@ -1,139 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for Form History Autocomplete</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Form History test: form field autocomplete
-<p id="display"></p>
-
-<!-- we presumably can't hide the content for this test. -->
-<div id="content">
-
- <!-- normal, basic form -->
- <form id="form1" onsubmit="return false;">
- <input list="suggest" type="text" name="field1">
- <button type="submit">Submit</button>
- </form>
-
- <datalist id="suggest">
- <option value="First"></option>
- <option value="Second"></option>
- <option value="Secomundo"></option>
- </datalist>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-var input = $_(1, "field1");
-
-function setupFormHistory(aCallback) {
- updateFormHistory([
- { op : "remove" },
- { op : "add", fieldname : "field1", value : "Sec" },
- ], () => {
- spawn_task(aCallback);
- });
-}
-
-function setForm(value) {
- input.value = value;
- input.focus();
-}
-
-// Restore the form to the default state.
-function restoreForm() {
- setForm("");
-}
-
-// Check for expected form data.
-function checkForm(expectedValue) {
- var formID = input.parentNode.id;
- is(input.value, expectedValue, "Checking " + formID + " input");
-}
-
-SimpleTest.waitForExplicitFinish();
-
-var expectingPopup = null;
-
-function expectPopup() {
- info("expecting a popup");
- return new Promise(resolve => {
- expectingPopup = resolve;
- });
-}
-
-var testNum = 0;
-
-function popupShownListener() {
- info("popup shown for test " + testNum);
- if (expectingPopup) {
- expectingPopup();
- expectingPopup = null;
- }
- else {
- ok(false, "Autocomplete popup not expected during test " + testNum);
- }
-}
-
-function waitForMenuChange(expectedCount) {
- return new Promise(resolve => {
- notifyMenuChanged(expectedCount, null, resolve);
- });
-}
-
-registerPopupShownListener(popupShownListener);
-
-function checkMenuEntries(expectedValues) {
- var actualValues = getMenuEntries();
- is(actualValues.length, expectedValues.length, testNum + " Checking length of expected menu");
- for (var i = 0; i < expectedValues.length; i++)
- is(actualValues[i], expectedValues[i], testNum + " Checking menu entry #"+i);
-}
-
-function* runTests() {
- testNum++;
- restoreForm();
- doKey("down");
- yield expectPopup();
-
- checkMenuEntries(["Sec", "First", "Second", "Secomundo"]);
- doKey("down");
- doKey("return");
- checkForm("Sec");
-
- testNum++;
- restoreForm();
- sendString("Sec");
- doKey("down");
- yield expectPopup();
-
- testNum++;
- checkMenuEntries(["Sec", "Second", "Secomundo"]);
- sendString("o");
- yield waitForMenuChange(2);
-
- testNum++;
- checkMenuEntries(["Second", "Secomundo"]);
- doKey("down");
- doKey("return");
- checkForm("Second");
- SimpleTest.finish();
-}
-
-function startTest() {
- setupFormHistory(runTests);
-}
-
-window.onload = startTest;
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/satchel/test/test_form_autocomplete.html b/toolkit/components/satchel/test/test_form_autocomplete.html
deleted file mode 100644
index d2c22a3db..000000000
--- a/toolkit/components/satchel/test/test_form_autocomplete.html
+++ /dev/null
@@ -1,1074 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for Form History Autocomplete</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Form History test: form field autocomplete
-<p id="display"></p>
-
-<!-- We presumably can't hide the content for this test. The large top padding is to allow
- listening for scrolls to occur. -->
-<div id="content" style="padding-top: 20000px;">
-
- <!-- normal, basic form -->
- <form id="form1" onsubmit="return false;">
- <input type="text" name="field1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- normal, basic form (new fieldname) -->
- <form id="form2" onsubmit="return false;">
- <input type="text" name="field2">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with autocomplete=off on input -->
- <form id="form3" onsubmit="return false;">
- <input type="text" name="field2" autocomplete="off">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with autocomplete=off on form -->
- <form id="form4" autocomplete="off" onsubmit="return false;">
- <input type="text" name="field2">
- <button type="submit">Submit</button>
- </form>
-
- <!-- normal form for testing filtering -->
- <form id="form5" onsubmit="return false;">
- <input type="text" name="field3">
- <button type="submit">Submit</button>
- </form>
-
- <!-- normal form for testing word boundary filtering -->
- <form id="form6" onsubmit="return false;">
- <input type="text" name="field4">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with maxlength attribute on input -->
- <form id="form7" onsubmit="return false;">
- <input type="text" name="field5" maxlength="10">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with input type='email' -->
- <form id="form8" onsubmit="return false;">
- <input type="email" name="field6">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with input type='tel' -->
- <form id="form9" onsubmit="return false;">
- <input type="tel" name="field7">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with input type='url' -->
- <form id="form10" onsubmit="return false;">
- <input type="url" name="field8">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with input type='search' -->
- <form id="form11" onsubmit="return false;">
- <input type="search" name="field9">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with input type='number' -->
- <form id="form12" onsubmit="return false;">
- <input type="text" name="field10"> <!-- TODO: change back to type=number -->
- <button type="submit">Submit</button>
- </form>
-
- <!-- normal, basic form (with fieldname='searchbar-history') -->
- <form id="form13" onsubmit="return false;">
- <input type="text" name="searchbar-history">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with input type='date' -->
- <form id="form14" onsubmit="return false;">
- <input type="date" name="field11">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with input type='time' -->
- <form id="form15" onsubmit="return false;">
- <input type="time" name="field12">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with input type='range' -->
- <form id="form16" onsubmit="return false;">
- <input type="range" name="field13" max="64">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with input type='color' -->
- <form id="form17" onsubmit="return false;">
- <input type="color" name="field14">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with input type='month' -->
- <form id="form18" onsubmit="return false;">
- <input type="month" name="field15">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with input type='week' -->
- <form id="form19" onsubmit="return false;">
- <input type="week" name="field16">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with input type='datetime-local' -->
- <form id="form20" onsubmit="return false;">
- <input type="datetime-local" name="field17">
- <button type="submit">Submit</button>
- </form>
-
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Form History autocomplete **/
-
-var input = $_(1, "field1");
-const shiftModifier = Event.SHIFT_MASK;
-
-function setupFormHistory(aCallback) {
- updateFormHistory([
- { op : "remove" },
- { op : "add", fieldname : "field1", value : "value1" },
- { op : "add", fieldname : "field1", value : "value2" },
- { op : "add", fieldname : "field1", value : "value3" },
- { op : "add", fieldname : "field1", value : "value4" },
- { op : "add", fieldname : "field2", value : "value1" },
- { op : "add", fieldname : "field3", value : "a" },
- { op : "add", fieldname : "field3", value : "aa" },
- { op : "add", fieldname : "field3", value : "aaz" },
- { op : "add", fieldname : "field3", value : "aa\xe6" }, // 0xae == latin ae pair (0xc6 == AE)
- { op : "add", fieldname : "field3", value : "az" },
- { op : "add", fieldname : "field3", value : "z" },
- { op : "add", fieldname : "field4", value : "a\xe6" },
- { op : "add", fieldname : "field4", value : "aa a\xe6" },
- { op : "add", fieldname : "field4", value : "aba\xe6" },
- { op : "add", fieldname : "field4", value : "bc d\xe6" },
- { op : "add", fieldname : "field5", value : "1" },
- { op : "add", fieldname : "field5", value : "12" },
- { op : "add", fieldname : "field5", value : "123" },
- { op : "add", fieldname : "field5", value : "1234" },
- { op : "add", fieldname : "field6", value : "value" },
- { op : "add", fieldname : "field7", value : "value" },
- { op : "add", fieldname : "field8", value : "value" },
- { op : "add", fieldname : "field9", value : "value" },
- { op : "add", fieldname : "field10", value : "42" },
- { op : "add", fieldname : "field11", value : "2010-10-10" }, // not used, since type=date doesn't have autocomplete currently
- { op : "add", fieldname : "field12", value : "21:21" }, // not used, since type=time doesn't have autocomplete currently
- { op : "add", fieldname : "field13", value : "32" }, // not used, since type=range doesn't have a drop down menu
- { op : "add", fieldname : "field14", value : "#ffffff" }, // not used, since type=color doesn't have autocomplete currently
- { op : "add", fieldname : "field15", value : "2016-08" },
- { op : "add", fieldname : "field16", value : "2016-W32" },
- { op : "add", fieldname : "field17", value : "2016-10-21T10:10" },
- { op : "add", fieldname : "searchbar-history", value : "blacklist test" },
- ], aCallback);
-}
-
-function setForm(value) {
- input.value = value;
- input.focus();
-}
-
-// Restore the form to the default state.
-function restoreForm() {
- setForm("");
-}
-
-// Check for expected form data.
-function checkForm(expectedValue) {
- var formID = input.parentNode.id;
- is(input.value, expectedValue, "Checking " + formID + " input");
-}
-
-var testNum = 0;
-var expectingPopup = false;
-
-function expectPopup()
-{
- info("expecting popup for test " + testNum);
- expectingPopup = true;
-}
-
-function popupShownListener()
-{
- info("popup shown for test " + testNum);
- if (expectingPopup) {
- expectingPopup = false;
- SimpleTest.executeSoon(runTest);
- }
- else {
- ok(false, "Autocomplete popup not expected during test " + testNum);
- }
-}
-
-registerPopupShownListener(popupShownListener);
-
-/*
- * Main section of test...
- *
- * This is a bit hacky, as many operations happen asynchronously.
- * Various mechanisms call runTests as a result of operations:
- * - set expectingPopup to true, and the next test will occur when the autocomplete popup is shown
- * - call waitForMenuChange(x) to run the next test when the autocomplete popup to have x items in it
- * - addEntry calls runs the test when an entry has been added
- * - some tests scroll the window. This is because the form fill controller happens to scroll
- * the field into view near the end of the search, and there isn't any other good notification
- * to listen to for when the search is complete.
- * - some items still use setTimeout
- */
-function runTest() {
- testNum++;
-
- ok(true, "Starting test #" + testNum);
-
- switch (testNum) {
- case 1:
- // Make sure initial form is empty.
- checkForm("");
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 2:
- checkMenuEntries(["value1", "value2", "value3", "value4"], testNum);
- // Check first entry
- doKey("down");
- checkForm(""); // value shouldn't update
- doKey("return"); // not "enter"!
- checkForm("value1");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 3:
- // Check second entry
- doKey("down");
- doKey("down");
- doKey("return"); // not "enter"!
- checkForm("value2");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 4:
- // Check third entry
- doKey("down");
- doKey("down");
- doKey("down");
- doKey("return");
- checkForm("value3");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 5:
- // Check fourth entry
- doKey("down");
- doKey("down");
- doKey("down");
- doKey("down");
- doKey("return");
- checkForm("value4");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 6:
- // Check first entry (wraparound)
- doKey("down");
- doKey("down");
- doKey("down");
- doKey("down");
- doKey("down"); // deselects
- doKey("down");
- doKey("return");
- checkForm("value1");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 7:
- // Check the last entry via arrow-up
- doKey("up");
- doKey("return");
- checkForm("value4");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 8:
- // Check the last entry via arrow-up
- doKey("down"); // select first entry
- doKey("up"); // selects nothing!
- doKey("up"); // select last entry
- doKey("return");
- checkForm("value4");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 9:
- // Check the last entry via arrow-up (wraparound)
- doKey("down");
- doKey("up"); // deselects
- doKey("up"); // last entry
- doKey("up");
- doKey("up");
- doKey("up"); // first entry
- doKey("up"); // deselects
- doKey("up"); // last entry
- doKey("return");
- checkForm("value4");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 10:
- // Set first entry w/o triggering autocomplete
- doKey("down");
- doKey("right");
- checkForm("value1");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 11:
- // Set first entry w/o triggering autocomplete
- doKey("down");
- doKey("left");
- checkForm("value1");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 12:
- // Check first entry (page up)
- doKey("down");
- doKey("down");
- doKey("page_up");
- doKey("return");
- checkForm("value1");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 13:
- // Check last entry (page down)
- doKey("down");
- doKey("page_down");
- doKey("return");
- checkForm("value4");
-
- // Trigger autocomplete popup
- testNum = 49;
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- /* Test removing entries from the dropdown */
-
- case 50:
- checkMenuEntries(["value1", "value2", "value3", "value4"], testNum);
- // Delete the first entry (of 4)
- setForm("value");
- doKey("down");
-
- // On OS X, shift-backspace and shift-delete work, just delete does not.
- // On Win/Linux, shift-backspace does not work, delete and shift-delete do.
- if (SpecialPowers.OS == "Darwin")
- doKey("back_space", shiftModifier);
- else
- doKey("delete", shiftModifier);
-
- // This tests that on OS X shift-backspace didn't delete the last character
- // in the input (bug 480262).
- waitForMenuChange(3);
- break;
-
- case 51:
- checkForm("value");
- countEntries("field1", "value1",
- function (num) {
- ok(!num, testNum + " checking that f1/v1 was deleted");
- runTest();
- });
- break;
-
- case 52:
- doKey("return");
- checkForm("value2");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 53:
- checkMenuEntries(["value2", "value3", "value4"], testNum);
- // Check the new first entry (of 3)
- doKey("down");
- doKey("return");
- checkForm("value2");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 54:
- // Delete the second entry (of 3)
- doKey("down");
- doKey("down");
- doKey("delete", shiftModifier);
- waitForMenuChange(2);
- break;
-
- case 55:
- checkForm("");
- countEntries("field1", "value3",
- function (num) {
- ok(!num, testNum + " checking that f1/v3 was deleted");
- runTest();
- });
- break;
-
- case 56:
- doKey("return");
- checkForm("value4")
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 57:
- checkMenuEntries(["value2", "value4"], testNum);
- // Check the new first entry (of 2)
- doKey("down");
- doKey("return");
- checkForm("value2");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 58:
- // Delete the last entry (of 2)
- doKey("down");
- doKey("down");
- doKey("delete", shiftModifier);
- checkForm("");
- waitForMenuChange(1);
- break;
-
- case 59:
- countEntries("field1", "value4",
- function (num) {
- ok(!num, testNum + " checking that f1/v4 was deleted");
- runTest();
- });
- break;
-
- case 60:
- doKey("return");
- checkForm("value2");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 61:
- checkMenuEntries(["value2"], testNum);
- // Check the new first entry (of 1)
- doKey("down");
- doKey("return");
- checkForm("value2");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 62:
- // Delete the only remaining entry
- doKey("down");
- doKey("delete", shiftModifier);
- waitForMenuChange(0);
- break;
-
- case 63:
- checkForm("");
- countEntries("field1", "value2",
- function (num) {
- ok(!num, testNum + " checking that f1/v2 was deleted");
- runTest();
- });
- break;
-
- case 64:
- // Look at form 2, trigger autocomplete popup
- input = $_(2, "field2");
- testNum = 99;
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- /* Test entries with autocomplete=off */
-
- case 100:
- // Select first entry
- doKey("down");
- doKey("return");
- checkForm("value1");
-
- // Look at form 3, try to trigger autocomplete popup
- input = $_(3, "field2");
- restoreForm();
- // Sometimes, this will fail if scrollTo(0, 0) is called, so that doesn't
- // happen here. Fortunately, a different input is used from the last test,
- // so a scroll should still occur.
- doKey("down");
- waitForScroll();
- break;
-
- case 101:
- // Ensure there's no autocomplete dropdown (autocomplete=off is present)
- doKey("down");
- doKey("return");
- checkForm("");
-
- // Look at form 4, try to trigger autocomplete popup
- input = $_(4, "field2");
- restoreForm();
- doKey("down");
- waitForMenuChange(0);
- break;
-
- case 102:
- // Ensure there's no autocomplete dropdown (autocomplete=off is present)
- doKey("down");
- doKey("return");
- checkForm("");
-
- // Look at form 5, try to trigger autocomplete popup
- input = $_(5, "field3");
- restoreForm();
- testNum = 199;
- expectPopup();
- input.focus();
- sendChar("a");
- break;
-
- /* Test filtering as characters are typed. */
-
- case 200:
- checkMenuEntries(["a", "aa", "aaz", "aa\xe6", "az"], testNum);
- input.focus();
- sendChar("a");
- waitForMenuChange(3);
- break;
-
- case 201:
- checkMenuEntries(["aa", "aaz", "aa\xe6"], testNum);
- input.focus();
- sendChar("\xc6");
- waitForMenuChange(1);
- break;
-
- case 202:
- checkMenuEntries(["aa\xe6"], testNum);
- doKey("back_space");
- waitForMenuChange(3);
- break;
-
- case 203:
- checkMenuEntries(["aa", "aaz", "aa\xe6"], testNum);
- doKey("back_space");
- waitForMenuChange(5);
- break;
-
- case 204:
- checkMenuEntries(["a", "aa", "aaz", "aa\xe6", "az"], testNum);
- input.focus();
- sendChar("z");
- waitForMenuChange(2);
- break;
-
- case 205:
- checkMenuEntries(["az", "aaz"], testNum);
- input.focus();
- doKey("left");
- expectPopup();
- // Check case-insensitivity.
- sendChar("A");
- break;
-
- case 206:
- checkMenuEntries(["aaz"], testNum);
- addEntry("field3", "aazq");
- break;
-
- case 207:
- // check that results were cached
- input.focus();
- doKey("right");
- sendChar("q");
- waitForMenuChange(0);
- break;
-
- case 208:
- // check that results were cached
- checkMenuEntries([], testNum);
- addEntry("field3", "aazqq");
- break;
-
- case 209:
- input.focus();
- window.scrollTo(0, 0);
- sendChar("q");
- waitForMenuChange(0);
- break;
-
- case 210:
- // check that empty results were cached - bug 496466
- checkMenuEntries([], testNum);
- doKey("escape");
-
- // Look at form 6, try to trigger autocomplete popup
- input = $_(6, "field4");
- restoreForm();
- testNum = 249;
- expectPopup();
- input.focus();
- sendChar("a");
- break;
-
- /* Test substring matches and word boundary bonuses */
-
- case 250:
- // alphabetical results for first character
- checkMenuEntries(["aa a\xe6", "aba\xe6", "a\xe6"], testNum);
- input.focus();
-
- sendChar("\xe6");
- waitForMenuChange(3, "a\xe6");
- break;
-
- case 251:
- // prefix match comes first, then word boundary match
- // followed by substring match
- checkMenuEntries(["a\xe6", "aa a\xe6", "aba\xe6"], testNum);
-
- restoreForm();
- input.focus();
- sendChar("b");
- waitForMenuChange(1, "bc d\xe6");
- break;
-
- case 252:
- checkMenuEntries(["bc d\xe6"], testNum);
- input.focus();
- sendChar(" ");
- waitForMenuChange(1);
- break;
-
- case 253:
- // check that trailing space has no effect after single char.
- checkMenuEntries(["bc d\xe6"], testNum);
- input.focus();
- sendChar("\xc6");
- waitForMenuChange(2);
- break;
-
- case 254:
- // check multi-word substring matches
- checkMenuEntries(["bc d\xe6", "aba\xe6"]);
- input.focus();
- expectPopup();
- doKey("left");
- sendChar("d");
- break;
-
- case 255:
- // check inserting in multi-word searches
- checkMenuEntries(["bc d\xe6"], testNum);
- input.focus();
- sendChar("z");
- waitForMenuChange(0);
- break;
-
- case 256:
- checkMenuEntries([], testNum);
-
- // Look at form 7, try to trigger autocomplete popup
- input = $_(7, "field5");
- testNum = 299;
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 300:
- checkMenuEntries(["1", "12", "123", "1234"], testNum);
- input.maxLength = 4;
- expectPopup();
- doKey("escape");
- doKey("down");
- break;
-
- case 301:
- checkMenuEntries(["1", "12", "123", "1234"], testNum);
- input.maxLength = 3;
- expectPopup();
- doKey("escape");
- doKey("down");
- break;
-
- case 302:
- checkMenuEntries(["1", "12", "123"], testNum);
- input.maxLength = 2;
- expectPopup();
- doKey("escape");
- doKey("down");
- break;
-
- case 303:
- checkMenuEntries(["1", "12"], testNum);
- input.maxLength = 1;
- expectPopup();
- doKey("escape");
- doKey("down");
- break;
-
- case 304:
- checkMenuEntries(["1"], testNum);
- input.maxLength = 0;
- doKey("escape");
- doKey("down");
- waitForMenuChange(0);
- break;
-
- case 305:
- checkMenuEntries([], testNum);
- input.maxLength = 4;
-
- // now again with a character typed
- input.focus();
- sendChar("1");
- expectPopup();
- doKey("escape");
- doKey("down");
- break;
-
- case 306:
- checkMenuEntries(["1", "12", "123", "1234"], testNum);
- input.maxLength = 3;
- expectPopup();
- doKey("escape");
- doKey("down");
- break;
-
- case 307:
- checkMenuEntries(["1", "12", "123"], testNum);
- input.maxLength = 2;
- expectPopup();
- doKey("escape");
- doKey("down");
- break;
-
- case 308:
- checkMenuEntries(["1", "12"], testNum);
- input.maxLength = 1;
- expectPopup();
- doKey("escape");
- doKey("down");
- break;
-
- case 309:
- checkMenuEntries(["1"], testNum);
- input.maxLength = 0;
- doKey("escape");
- doKey("down");
- waitForMenuChange(0);
- break;
-
- case 310:
- checkMenuEntries([], testNum);
-
- input = $_(8, "field6");
- testNum = 399;
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 400:
- case 401:
- case 402:
- case 403:
- checkMenuEntries(["value"], testNum);
- doKey("down");
- doKey("return");
- checkForm("value");
-
- if (testNum == 400) {
- input = $_(9, "field7");
- } else if (testNum == 401) {
- input = $_(10, "field8");
- } else if (testNum == 402) {
- input = $_(11, "field9");
- } else if (testNum == 403) {
- todo(false, "Fix input type=number");
- input = $_(12, "field10");
- }
-
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 404:
- checkMenuEntries(["42"], testNum);
- doKey("down");
- doKey("return");
- checkForm("42");
-
- input = $_(14, "field11");
- restoreForm();
- waitForMenuChange(0);
- break;
-
- case 405:
- checkMenuEntries([]); // type=date with it's own control frame does not
- // have a drop down menu for now
- checkForm("");
-
- input = $_(15, "field12");
- restoreForm();
- waitForMenuChange(0);
- break;
-
- case 406:
- checkMenuEntries([]); // type=time with it's own control frame does not
- // have a drop down menu for now
- checkForm("");
-
- input = $_(16, "field13");
- restoreForm();
- doKey("down");
- waitForMenuChange(0);
- break;
-
- case 407:
- checkMenuEntries([]); // type=range does not have a drop down menu
- doKey("down");
- doKey("return");
- checkForm("30"); // default (midway between minimum (0) and maximum (64)) - step
-
- input = $_(17, "field14");
- restoreForm();
- waitForMenuChange(0);
- break;
-
- case 408:
- checkMenuEntries([]); // type=color does not have a drop down menu
- checkForm("#000000"); // default color value
-
- input = $_(18, "field15");
- restoreForm();
- expectPopup();
- doKey("down");
- break;
-
- case 409:
- checkMenuEntries(["2016-08"]);
- doKey("down");
- doKey("return");
- checkForm("2016-08");
-
- input = $_(19, "field16");
- restoreForm();
- expectPopup();
- doKey("down");
- break;
-
- case 410:
- checkMenuEntries(["2016-W32"]);
- doKey("down");
- doKey("return");
- checkForm("2016-W32");
-
- input = $_(20, "field17");
- restoreForm();
- expectPopup();
- doKey("down");
- break;
-
- case 411:
- checkMenuEntries(["2016-10-21T10:10"]);
- doKey("down");
- doKey("return");
- checkForm("2016-10-21T10:10");
-
- addEntry("field1", "value1");
- break;
-
- case 412:
- input = $_(1, "field1");
- // Go to test 500.
- testNum = 499;
-
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- // Check that the input event is fired.
- case 500:
- input.addEventListener("input", function(event) {
- input.removeEventListener("input", arguments.callee, false);
- ok(true, testNum + " oninput should have been received");
- ok(event.bubbles, testNum + " input event should bubble");
- ok(event.cancelable, testNum + " input event should be cancelable");
- }, false);
-
- doKey("down");
- checkForm("");
- doKey("return");
- checkForm("value1");
- testNum = 599;
- setTimeout(runTest, 100);
- break;
-
- case 600:
- // check we don't show autocomplete for searchbar-history
- input = $_(13, "searchbar-history");
-
- // Trigger autocomplete popup
- checkForm("");
- restoreForm();
- doKey("down");
- waitForMenuChange(0);
- break;
-
- case 601:
- checkMenuEntries([], testNum);
- input.blur();
- SimpleTest.finish();
- return;
-
- default:
- ok(false, "Unexpected invocation of test #" + testNum);
- SimpleTest.finish();
- return;
- }
-}
-
-function addEntry(name, value)
-{
- updateFormHistory({ op : "add", fieldname : name, value: value }, runTest);
-}
-
-// Runs the next test when scroll event occurs
-function waitForScroll()
-{
- addEventListener("scroll", function() {
- if (!window.pageYOffset)
- return;
-
- removeEventListener("scroll", arguments.callee, false);
- setTimeout(runTest, 100);
- }, false);
-}
-
-function waitForMenuChange(expectedCount, expectedFirstValue)
-{
- notifyMenuChanged(expectedCount, expectedFirstValue, runTest);
-}
-
-function checkMenuEntries(expectedValues, testNumber) {
- var actualValues = getMenuEntries();
- is(actualValues.length, expectedValues.length, testNumber + " Checking length of expected menu");
- for (var i = 0; i < expectedValues.length; i++)
- is(actualValues[i], expectedValues[i], testNumber + " Checking menu entry #"+i);
-}
-
-function startTest() {
- setupFormHistory(function() {
- runTest();
- });
-}
-
-window.onload = startTest;
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestFlakyTimeout("untriaged");
-</script>
-</pre>
-</body>
-</html>
-
diff --git a/toolkit/components/satchel/test/test_form_autocomplete_with_list.html b/toolkit/components/satchel/test/test_form_autocomplete_with_list.html
deleted file mode 100644
index 04fb080c9..000000000
--- a/toolkit/components/satchel/test/test_form_autocomplete_with_list.html
+++ /dev/null
@@ -1,506 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for Form History Autocomplete</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Form History test: form field autocomplete
-<p id="display"></p>
-
-<!-- we presumably can't hide the content for this test. -->
-<div id="content">
-
- <!-- normal, basic form -->
- <form id="form1" onsubmit="return false;">
- <input list="suggest" type="text" name="field1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with autocomplete=off on input -->
- <form id="form3" onsubmit="return false;">
- <input list="suggest" type="text" name="field2" autocomplete="off">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form with autocomplete=off on form -->
- <form id="form4" autocomplete="off" onsubmit="return false;">
- <input list="suggest" type="text" name="field2">
- <button type="submit">Submit</button>
- </form>
-
- <datalist id="suggest">
- <option value="Google" label="PASS1">FAIL</option>
- <option value="Reddit">PASS2</option>
- <option value="final"></option>
- </datalist>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/** Test for Form History autocomplete **/
-
-var input = $_(1, "field1");
-const shiftModifier = Components.interfaces.nsIDOMEvent.SHIFT_MASK;
-
-function setupFormHistory(aCallback) {
- updateFormHistory([
- { op : "remove" },
- { op : "add", fieldname : "field1", value : "historyvalue" },
- { op : "add", fieldname : "field2", value : "othervalue" },
- ], aCallback);
-}
-
-function setForm(value) {
- input.value = value;
- input.focus();
-}
-
-// Restore the form to the default state.
-function restoreForm() {
- setForm("");
-}
-
-// Check for expected form data.
-function checkForm(expectedValue) {
- var formID = input.parentNode.id;
- is(input.value, expectedValue, "Checking " + formID + " input");
-}
-
-var testNum = 0;
-var prevValue;
-var expectingPopup = false;
-
-function expectPopup() {
- info("expecting popup for test " + testNum);
- expectingPopup = true;
-}
-
-function popupShownListener() {
- info("popup shown for test " + testNum);
- if (expectingPopup) {
- expectingPopup = false;
- SimpleTest.executeSoon(runTest);
- }
- else {
- ok(false, "Autocomplete popup not expected during test " + testNum);
- }
-}
-
-registerPopupShownListener(popupShownListener);
-
-/*
-* Main section of test...
-*
-* This is a bit hacky, as many operations happen asynchronously.
-* Various mechanisms call runTests as a result of operations:
-* - set expectingPopup to true, and the next test will occur when the autocomplete popup is shown
-* - call waitForMenuChange(x) to run the next test when the autocomplete popup to have x items in it
-*/
-function runTest() {
- testNum++;
-
- info("Starting test #" + testNum);
-
- switch (testNum) {
- case 1:
- // Make sure initial form is empty.
- checkForm("");
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
- case 2:
- checkMenuEntries(["historyvalue", "PASS1", "PASS2", "final"], testNum);
- // Check first entry
- doKey("down");
- checkForm(""); // value shouldn't update
- doKey("return"); // not "enter"!
- checkForm("historyvalue");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 3:
- // Check second entry
- doKey("down");
- doKey("down");
- doKey("return"); // not "enter"!
- checkForm("Google");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 4:
- // Check third entry
- doKey("down");
- doKey("down");
- doKey("down");
- doKey("return");
- checkForm("Reddit");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 5:
- // Check fourth entry
- doKey("down");
- doKey("down");
- doKey("down");
- doKey("down");
- doKey("return");
- checkForm("final");
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 6:
- // Delete the first entry (of 3)
- doKey("down");
- doKey("delete", shiftModifier);
- waitForMenuChange(3);
- break;
-
- case 7:
- checkForm("");
- countEntries("field1", "historyvalue",
- function (num) {
- ok(!num, testNum + " checking that form history value was deleted");
- runTest();
- });
- break;
-
- case 8:
- doKey("return");
- checkForm("Google")
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 9:
- // Test deletion
- checkMenuEntries(["PASS1", "PASS2", "final"], testNum);
- // Check the new first entry (of 3)
- doKey("down");
- doKey("return");
- checkForm("Google");
-
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 10:
- // Test autocompletion of datalists with cached results.
- sendString("PAS");
- waitForMenuChange(2);
- break;
-
- case 11:
- // Continuation of test 10
- sendString("S1");
- waitForMenuChange(1);
- break;
-
- case 12:
- doKey("down");
- doKey("return");
- checkForm("Google");
-
- // Trigger autocomplete popup
- // Look at form 3, try to trigger autocomplete popup
- input.value = "";
- input = $_(3, "field2");
- testNum = 99;
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 100:
- checkMenuEntries(["PASS1", "PASS2", "final"], testNum);
- // Check first entry
- doKey("down");
- checkForm(""); // value shouldn't update
- doKey("return"); // not "enter"!
- checkForm("Google");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 101:
- // Check second entry
- doKey("down");
- doKey("down");
- doKey("return"); // not "enter"!
- checkForm("Reddit");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 102:
- // Check third entry
- doKey("down");
- doKey("down");
- doKey("down");
- doKey("return");
- checkForm("final");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 103:
- checkMenuEntries(["PASS1", "PASS2", "final"], testNum);
- // Check first entry
- doKey("down");
- checkForm(""); // value shouldn't update
- doKey("return"); // not "enter"!
- checkForm("Google");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 104:
- // Check second entry
- doKey("down");
- doKey("down");
- doKey("return"); // not "enter"!
- checkForm("Reddit");
-
- // Trigger autocomplete popup
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 105:
- // Check third entry
- doKey("down");
- doKey("down");
- doKey("down");
- doKey("return");
- checkForm("final");
-
- testNum = 199;
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- // Test dynamic updates.
- // For some reasons, when there is an update of the list, the selection is
- // lost so we need to go down like if we were at the beginning of the list
- // again.
- case 200:
- // Removing the second element while on the first then going down and
- // push enter. Value should be one from the third suggesion.
- doKey("down");
- var datalist = document.getElementById('suggest');
- var toRemove = datalist.children[1]
- datalist.removeChild(toRemove);
-
- SimpleTest.executeSoon(function() {
- doKey("down");
- doKey("down");
- doKey("return");
- checkForm("final");
-
- // Restore the element.
- datalist.insertBefore(toRemove, datalist.children[1]);
- expectPopup();
- restoreForm();
- doKey("down");
- });
- break;
-
- case 201:
- // Adding an attribute after the first one while on the first then going
- // down and push enter. Value should be the on from the new suggestion.
- doKey("down");
- datalist = document.getElementById('suggest');
- var added = new Option("Foo");
- datalist.insertBefore(added, datalist.children[1]);
- waitForMenuChange(4);
- break;
-
- case 202:
- doKey("down");
- doKey("down");
- doKey("return");
- checkForm("Foo");
-
- // Remove the element.
- datalist = document.getElementById('suggest');
- datalist.removeChild(datalist.children[1]);
- waitForMenuChange(0);
- break;
-
- case 203:
- // Change the first element value attribute.
- restoreForm();
- datalist = document.getElementById('suggest');
- prevValue = datalist.children[0].value;
- datalist.children[0].value = "foo";
- expectPopup();
- break;
-
- case 204:
- doKey("down");
- doKey("return");
- checkForm("foo");
-
- datalist = document.getElementById('suggest');
- datalist.children[0].value = prevValue;
- waitForMenuChange(0);
- break;
-
- case 205:
- // Change the textContent to update the value attribute.
- restoreForm();
- datalist = document.getElementById('suggest');
- prevValue = datalist.children[0].getAttribute('value');
- datalist.children[0].removeAttribute('value');
- datalist.children[0].textContent = "foobar";
- expectPopup();
- break;
-
- case 206:
- doKey("down");
- doKey("return");
- checkForm("foobar");
-
- datalist = document.getElementById('suggest');
- datalist.children[0].setAttribute('value', prevValue);
- testNum = 299;
- waitForMenuChange(0);
- break;
-
- // Tests for filtering (or not).
- case 300:
- // Filters with first letter of the word.
- restoreForm();
- synthesizeKey("f", {});
- expectPopup();
- break;
-
- case 301:
- doKey("down");
- doKey("return");
- checkForm("final");
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 302:
- // Filter with a letter in the middle of the word.
- synthesizeKey("i", {});
- synthesizeKey("n", {});
- waitForMenuChange(1);
- break;
-
- case 303:
- // Continuation of test 302.
- doKey("down");
- doKey("return");
- checkForm("final");
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 304:
- // Filter is disabled with mozNoFilter.
- input.setAttribute('mozNoFilter', 'true');
- synthesizeKey("f", {});
- waitForMenuChange(3); // no change
- break;
-
- case 305:
- // Continuation of test 304.
- doKey("down");
- doKey("return");
- checkForm("Google");
- input.removeAttribute('mozNoFilter');
- testNum = 399;
- expectPopup();
- restoreForm();
- doKey("down");
- break;
-
- case 400:
- // Check that the input event is fired.
- input.addEventListener("input", function(event) {
- input.removeEventListener("input", arguments.callee, false);
- ok(true, "oninput should have been received");
- ok(event.bubbles, "input event should bubble");
- ok(event.cancelable, "input event should be cancelable");
- checkForm("Google");
- input.blur();
- SimpleTest.finish();
- }, false);
-
- doKey("down");
- checkForm("");
- doKey("return");
- break;
-
- default:
- ok(false, "Unexpected invocation of test #" + testNum);
- SimpleTest.finish();
- return;
- }
-}
-
-function waitForMenuChange(expectedCount) {
- notifyMenuChanged(expectedCount, null, runTest);
-}
-
-function checkMenuEntries(expectedValues, testNumber) {
- var actualValues = getMenuEntries();
- is(actualValues.length, expectedValues.length, testNumber + " Checking length of expected menu");
- for (var i = 0; i < expectedValues.length; i++)
- is(actualValues[i], expectedValues[i], testNumber + " Checking menu entry #"+i);
-}
-
-function startTest() {
- setupFormHistory(runTest);
-}
-
-window.onload = startTest;
-
-SimpleTest.waitForExplicitFinish();
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/satchel/test/test_form_submission.html b/toolkit/components/satchel/test/test_form_submission.html
deleted file mode 100644
index ecccabcaf..000000000
--- a/toolkit/components/satchel/test/test_form_submission.html
+++ /dev/null
@@ -1,537 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Satchel Test for Form Submisstion</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-<iframe id="iframe" src="https://example.com/tests/toolkit/components/satchel/test/subtst_form_submission_1.html"></iframe>
-<div id="content" style="display: none">
-
- <!-- ===== Things that should not be saved. ===== -->
-
- <!-- autocomplete=off for input -->
- <form id="form1" onsubmit="return checkSubmit(1)">
- <input type="text" name="test1" autocomplete="off">
- <button type="submit">Submit</button>
- </form>
-
- <!-- autocomplete=off for form -->
- <form id="form2" onsubmit="return checkSubmit(2)" autocomplete="off">
- <input type="text" name="test1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- don't save type=hidden -->
- <form id="form3" onsubmit="return checkSubmit(3)">
- <input type="hidden" name="test1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- don't save type=checkbox -->
- <form id="form4" onsubmit="return checkSubmit(4)">
- <input type="checkbox" name="test1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- Don't save empty values. -->
- <form id="form5" onsubmit="return checkSubmit(5)">
- <input type="text" name="test1" value="originalValue">
- <button type="submit">Submit</button>
- </form>
-
- <!-- Don't save unchanged values. -->
- <form id="form6" onsubmit="return checkSubmit(6)">
- <input type="text" name="test1" value="dontSaveThis">
- <button type="submit">Submit</button>
- </form>
-
- <!-- Don't save unchanged values. (.value not touched) -->
- <form id="form7" onsubmit="return checkSubmit(7)">
- <input type="text" name="test1" value="dontSaveThis">
- <button type="submit">Submit</button>
- </form>
-
- <!-- No field name or ID. -->
- <form id="form8" onsubmit="return checkSubmit(8)">
- <input type="text">
- <button type="submit">Submit</button>
- </form>
-
- <!-- Nothing to save! -->
- <form id="form9" onsubmit="return checkSubmit(9)">
- <button type="submit">Submit</button>
- </form>
-
- <!-- input with name too long (300 chars.) -->
- <form id="form10" onsubmit="return checkSubmit(10)">
- <input type="text" name="12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890">
- <button type="submit">Submit</button>
- </form>
-
- <!-- input with value too long (300 chars.) -->
- <form id="form11" onsubmit="return checkSubmit(11)">
- <input type="text" name="test1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- input with value of one space (which should be trimmed) -->
- <form id="form12" onsubmit="return checkSubmit(12)">
- <input type="text" name="test1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- password field -->
- <form id="form13" onsubmit="return checkSubmit(13)">
- <input type="password" name="test1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- password field (type changed after pageload) -->
- <form id="form14" onsubmit="return checkSubmit(14)">
- <input type="text" name="test1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- input with sensitive data (16 digit credit card number) -->
- <form id="form15" onsubmit="return checkSubmit(15)">
- <script type="text/javascript">
- var form = document.getElementById('form15');
- for (let i = 0; i != 10; i++)
- {
- let input = document.createElement('input');
- input.type = 'text';
- input.name = 'test' + (i + 1);
- form.appendChild(input);
- }
- </script>
- <button type="submit">Submit</button>
- </form>
-
- <!-- input with sensitive data (15 digit credit card number) -->
- <form id="form16" onsubmit="return checkSubmit(16)">
- <script type="text/javascript">
- form = document.getElementById('form16');
- for (let i = 0; i != 10; i++)
- {
- let input = document.createElement('input');
- input.type = 'text';
- input.name = 'test' + (i + 1);
- form.appendChild(input);
- }
- </script>
- <button type="submit">Submit</button>
- </form>
-
- <!-- input with sensitive data (9 digit credit card number) -->
- <form id="form17" onsubmit="return checkSubmit(17)">
- <input type="text" name="test1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- input with sensitive data (16 digit hyphenated credit card number) -->
- <form id="form18" onsubmit="return checkSubmit(18)">
- <input type="text" name="test1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- input with sensitive data (15 digit whitespace-separated credit card number) -->
- <form id="form19" onsubmit="return checkSubmit(19)">
- <input type="text" name="test1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- form data submitted through HTTPS, when browser.formfill.saveHttpsForms is false -->
- <form id="form20" action="https://www.example.com/" onsubmit="return checkSubmit(20)">
- <input type="text" name="test1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- Form 21 is submitted into an iframe, not declared here. -->
-
- <!-- Don't save values if the form is invalid. -->
- <form id="form22" onsubmit="return checkSubmit(22);">
- <input type='email' name='test1' oninvalid="return checkSubmit(22);">
- <button type='submit'>Submit</button>
- </form>
-
- <!-- Don't save values if the form is invalid. -->
- <form id="form23" onsubmit="return checkSubmit(23);">
- <input type='email' value='foo' oninvalid="return checkSubmit(23);">
- <input type='text' name='test1'>
- <button type='submit'>Submit</button>
- </form>
-
- <!-- Don't save values if the input name is 'searchbar-history' -->
- <form id="form24" onsubmit="return checkSubmit(24);">
- <input type='text' name='searchbar-history'>
- <button type='submit'>Submit</button>
- </form>
-
- <!-- ===== Things that should be saved ===== -->
-
- <!-- Form 100 is submitted into an iframe, not declared here. -->
-
- <!-- input with no default value -->
- <form id="form101" onsubmit="return checkSubmit(101)">
- <input type="text" name="test1">
- <button type="submit">Submit</button>
- </form>
-
- <!-- input with a default value -->
- <form id="form102" onsubmit="return checkSubmit(102)">
- <input type="text" name="test2" value="originalValue">
- <button type="submit">Submit</button>
- </form>
-
- <!-- input uses id but not name -->
- <form id="form103" onsubmit="return checkSubmit(103)">
- <input type="text" id="test3">
- <button type="submit">Submit</button>
- </form>
-
- <!-- input with leading and trailing space -->
- <form id="form104" onsubmit="return checkSubmit(104)">
- <input type="text" name="test4">
- <button type="submit">Submit</button>
- </form>
-
- <!-- input with leading and trailing whitespace -->
- <form id="form105" onsubmit="return checkSubmit(105)">
- <input type="text" name="test5">
- <button type="submit">Submit</button>
- </form>
-
- <!-- input that looks like sensitive data but doesn't
- satisfy the requirements (incorrect length) -->
- <form id="form106" onsubmit="return checkSubmit(106)">
- <input type="text" name="test6">
- <button type="submit">Submit</button>
- </form>
-
- <!-- input that looks like sensitive data but doesn't
- satisfy the requirements (Luhn check fails for 16 chars) -->
- <form id="form107" onsubmit="return checkSubmit(107)">
- <script type="text/javascript">
- form = document.getElementById('form107');
- for (let i = 0; i != 10; i++)
- {
- let input = document.createElement('input');
- input.type = 'text';
- input.name = 'test7_' + (i + 1);
- form.appendChild(input);
- }
- </script>
- <button type="submit">Submit</button>
- </form>
-
- <!-- input that looks like sensitive data but doesn't
- satisfy the requirements (Luhn check fails for 15 chars) -->
- <form id="form108" onsubmit="return checkSubmit(108)">
- <script type="text/javascript">
- form = document.getElementById('form108');
- for (let i = 0; i != 10; i++)
- {
- let input = document.createElement('input');
- input.type = 'text';
- input.name = 'test8_' + (i + 1);
- form.appendChild(input);
- }
- </script>
- <button type="submit">Submit</button>
- </form>
-
- <!-- form data submitted through HTTPS, when browser.formfill.saveHttpsForms is true -->
- <form id="form109" action="https://www.example.com/" onsubmit="return checkSubmit(109)">
- <input type="text" name="test9">
- <button type="submit">Submit</button>
- </form>
-
- <!-- regular form data, when browser.formfill.saveHttpsForms is false -->
- <form id="form110" onsubmit="return checkSubmit(110)">
- <input type="text" name="test10">
- <button type="submit">Submit</button>
- </form>
-
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-var numSubmittedForms = 0;
-
-var ccNumbers = {
- valid15: [
- "930771457288760", "474915027480942",
- "924894781317325", "714816113937185",
- "790466087343106", "474320195408363",
- "219211148122351", "633038472250799",
- "354236732906484", "095347810189325",
- ],
- valid16: [
- "3091269135815020", "5471839082338112",
- "0580828863575793", "5015290610002932",
- "9465714503078607", "4302068493801686",
- "2721398408985465", "6160334316984331",
- "8643619970075142", "0218246069710785"
- ],
- invalid15: [
- "526931005800649", "724952425140686",
- "379761391174135", "030551436468583",
- "947377014076746", "254848023655752",
- "226871580283345", "708025346034339",
- "917585839076788", "918632588027666"
- ],
- invalid16: [
- "9946177098017064", "4081194386488872",
- "3095975979578034", "3662215692222536",
- "6723210018630429", "4411962856225025",
- "8276996369036686", "4449796938248871",
- "3350852696538147", "5011802870046957"
- ],
-};
-
-function checkInitialState() {
- countEntries(null, null,
- function (num) {
- ok(!num, "checking for initially empty storage");
- startTest();
- });
-}
-
-function startTest() {
- // Fill in values for the various fields. We could just set the <input>'s
- // value attribute, but we don't save default form values (and we want to
- // ensure unsaved values are because of autocomplete=off or whatever).
- $_(1, "test1").value = "dontSaveThis";
- $_(2, "test1").value = "dontSaveThis";
- $_(3, "test1").value = "dontSaveThis";
- $_(4, "test1").value = "dontSaveThis";
- $_(5, "test1").value = "";
- $_(6, "test1").value = "dontSaveThis";
- // Form 7 deliberately left untouched.
- // Form 8 has an input with no name or input attribute.
- let input = document.getElementById("form8").elements[0];
- is(input.type, "text", "checking we got unidentified input");
- input.value = "dontSaveThis";
- // Form 9 has nothing to modify.
- $_(10, "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890").value = "dontSaveThis";
- $_(11, "test1").value = "12345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890";
- $_(12, "test1").value = " ";
- $_(13, "test1").value = "dontSaveThis";
- $_(14, "test1").type = "password";
- $_(14, "test1").value = "dontSaveThis";
-
- var testData = ccNumbers.valid16;
- for (let i = 0; i != testData.length; i++) {
- $_(15, "test" + (i + 1)).value = testData[i];
- }
-
- testData = ccNumbers.valid15;
- for (let i = 0; i != testData.length; i++) {
- $_(16, "test" + (i + 1)).value = testData[i];
- }
- $_(17, "test1").value = "001064088";
- $_(18, "test1").value = "0000-0000-0080-4609";
- $_(19, "test1").value = "0000 0000 0222 331";
- $_(20, "test1").value = "dontSaveThis";
- $_(22, "test1").value = "dontSaveThis";
- $_(23, "test1").value = "dontSaveThis";
- $_(24, "searchbar-history").value = "dontSaveThis";
-
- $_(101, "test1").value = "savedValue";
- $_(102, "test2").value = "savedValue";
- $_(103, "test3").value = "savedValue";
- $_(104, "test4").value = " trimTrailingAndLeadingSpace ";
- $_(105, "test5").value = "\t trimTrailingAndLeadingWhitespace\t ";
- $_(106, "test6").value = "00000000109181";
-
- testData = ccNumbers.invalid16;
- for (let i = 0; i != testData.length; i++) {
- $_(107, "test7_" + (i + 1)).value = testData[i];
- }
-
- testData = ccNumbers.invalid15;
- for (let i = 0; i != testData.length; i++) {
- $_(108, "test8_" + (i + 1)).value = testData[i];
- }
-
- $_(109, "test9").value = "savedValue";
- $_(110, "test10").value = "savedValue";
-
- // submit the first form.
- var button = getFormSubmitButton(1);
- button.click();
-}
-
-
-// Called by each form's onsubmit handler.
-function checkSubmit(formNum) {
- netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
-
- ok(true, "form " + formNum + " submitted");
- numSubmittedForms++;
-
- // Check for expected storage state.
- switch (formNum) {
- // Test 1-24 should not save anything.
- case 1:
- case 2:
- case 3:
- case 4:
- case 5:
- case 6:
- case 7:
- case 8:
- case 9:
- case 10:
- case 11:
- case 12:
- case 13:
- case 14:
- case 15:
- case 16:
- case 17:
- case 18:
- case 19:
- case 20:
- case 21:
- case 22:
- case 23:
- case 24:
- countEntries(null, null,
- function (num) {
- ok(!num, "checking for empty storage");
- submitForm(formNum);
- });
- return false;
- case 100:
- checkForSave("subtest2", "subtestValue", "checking saved subtest value");
- break;
- case 101:
- checkForSave("test1", "savedValue", "checking saved value");
- break;
- case 102:
- checkForSave("test2", "savedValue", "checking saved value");
- break;
- case 103:
- checkForSave("test3", "savedValue", "checking saved value");
- break;
- case 104:
- checkForSave("test4", "trimTrailingAndLeadingSpace", "checking saved value is trimmed on both sides");
- break;
- case 105:
- checkForSave("test5", "trimTrailingAndLeadingWhitespace", "checking saved value is trimmed on both sides");
- break;
- case 106:
- checkForSave("test6", "00000000109181", "checking saved value");
- break;
- case 107:
- for (let i = 0; i != ccNumbers.invalid16.length; i++) {
- checkForSave("test7_" + (i + 1), ccNumbers.invalid16[i], "checking saved value");
- }
- break;
- case 108:
- for (let i = 0; i != ccNumbers.invalid15.length; i++) {
- checkForSave("test8_" + (i + 1), ccNumbers.invalid15[i], "checking saved value");
- }
- break;
- case 109:
- checkForSave("test9", "savedValue", "checking saved value");
- break;
- case 110:
- checkForSave("test10", "savedValue", "checking saved value");
- break;
- default:
- ok(false, "Unexpected form submission");
- break;
- }
-
- return submitForm(formNum);
-}
-
-function submitForm(formNum)
-{
- // Forms 13 and 14 would trigger a save-password notification. Temporarily
- // disable pwmgr, then reenable it.
- if (formNum == 12)
- SpecialPowers.setBoolPref("signon.rememberSignons", false);
- if (formNum == 14)
- SpecialPowers.clearUserPref("signon.rememberSignons");
-
- // Forms 20 and 21 requires browser.formfill.saveHttpsForms to be false
- if (formNum == 19)
- SpecialPowers.setBoolPref("browser.formfill.saveHttpsForms", false);
- // Reset preference now that 20 and 21 are over
- if (formNum == 21)
- SpecialPowers.clearUserPref("browser.formfill.saveHttpsForms");
-
- // End the test now on SeaMonkey.
- if (formNum == 21 && navigator.userAgent.match(/ SeaMonkey\//)) {
- checkObserver.uninit();
- is(numSubmittedForms, 21, "Ensuring all forms were submitted.");
-
- todo(false, "Skipping remaining checks on SeaMonkey ftb. (Bug 589471)");
- // finish(), yet let the test actually end first, to be safe.
- SimpleTest.executeSoon(SimpleTest.finish);
-
- return false; // return false to cancel current form submission
- }
-
- // Form 109 requires browser.formfill.save_https_forms to be true;
- // Form 110 requires it to be false.
- if (formNum == 108)
- SpecialPowers.setBoolPref("browser.formfill.saveHttpsForms", true);
- if (formNum == 109)
- SpecialPowers.setBoolPref("browser.formfill.saveHttpsForms", false);
- if (formNum == 110)
- SpecialPowers.clearUserPref("browser.formfill.saveHttpsForms");
-
- // End the test at the last form.
- if (formNum == 110) {
- is(numSubmittedForms, 35, "Ensuring all forms were submitted.");
- checkObserver.uninit();
- SimpleTest.finish();
- return false; // return false to cancel current form submission
- }
-
- // This timeout is here so that button.click() is never called before this
- // function returns. If button.click() is called before returning, a long
- // chain of submits will happen recursively since the submit is dispatched
- // immediately.
- //
- // This in itself is fine, but if there are errors in the code, mochitests
- // will in some cases give you "server too busy", which is hard to debug!
- //
- setTimeout(function() {
- checkObserver.waitForChecks(function() {
- var nextFormNum = formNum == 24 ? 100 : (formNum + 1);
-
- // Submit the next form. Special cases are Forms 21 and 100, which happen
- // from an HTTPS domain in an iframe.
- if (nextFormNum == 21 || nextFormNum == 100) {
- ok(true, "submitting iframe test " + nextFormNum);
- document.getElementById("iframe").contentWindow.clickButton(nextFormNum);
- }
- else {
- var button = getFormSubmitButton(nextFormNum);
- button.click();
- }
- });
- }, 0);
-
- return false; // cancel current form submission
-}
-
-checkObserver.init();
-
-window.onload = checkInitialState;
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/satchel/test/test_form_submission_cap.html b/toolkit/components/satchel/test/test_form_submission_cap.html
deleted file mode 100644
index 96112f1c1..000000000
--- a/toolkit/components/satchel/test/test_form_submission_cap.html
+++ /dev/null
@@ -1,85 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Satchel Test for Form Submisstion Field Cap</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-
- <form id="form1" onsubmit="return checkSubmit(1)">
- <button type="submit">Submit</button>
- </form>
-
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/* Test for bug 492701.
- Save only the first MAX_FIELDS_SAVED changed fields in a form.
- Generate numInputFields = MAX_FIELDS_SAVED + 1 fields, change all values,
- and test that only MAX_FIELDS_SAVED are actually saved and that
- field # numInputFields was not saved.
-*/
-
-var numSubmittedForms = 0;
-var numInputFields = 101;
-
-function checkInitialState() {
- countEntries(null, null,
- function (num) {
- ok(!num, "checking for initially empty storage");
- startTest();
- });
-}
-
-function startTest() {
- var form = document.getElementById("form1");
- for (i = 1; i <= numInputFields; i++) {
- var newField = document.createElement("input");
- newField.setAttribute("type", "text");
- newField.setAttribute("name", "test" + i);
- form.appendChild(newField);
- }
-
- // Fill in values for the various fields. We could just set the <input>'s
- // value attribute, but we don't save default form values (and we want to
- // ensure unsaved values are because of autocomplete=off or whatever).
- for (i = 1; i <= numInputFields; i++) {
- $_(1, "test" + i).value = i;
- }
-
- // submit the first form.
- var button = getFormSubmitButton(1);
- button.click();
-}
-
-
-// Called by each form's onsubmit handler.
-function checkSubmit(formNum) {
- ok(true, "form " + formNum + " submitted");
- numSubmittedForms++;
-
- // check that the first (numInputFields - 1) CHANGED fields are saved
- for (i = 1; i < numInputFields; i++) { // check all but last
- checkForSave("test" + i, i, "checking saved value " + i);
- }
-
- // End the test.
- is(numSubmittedForms, 1, "Ensuring all forms were submitted.");
- SimpleTest.finish();
- return false; // return false to cancel current form submission
-}
-
-
-window.onload = checkInitialState;
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/satchel/test/test_form_submission_cap2.html b/toolkit/components/satchel/test/test_form_submission_cap2.html
deleted file mode 100644
index f51fb5f47..000000000
--- a/toolkit/components/satchel/test/test_form_submission_cap2.html
+++ /dev/null
@@ -1,190 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Satchel Test for Form Submisstion Field Cap</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-<!--
- Test for bug 492701.
- Only change field # numInputFields (= MAX_FIELDS_SAVED + 1)
- and test that it is actually saved and the other (unmodified) ones are not.
--->
- <form id="form1" onsubmit="return checkSubmit(1)">
- <input type="text" name="test1" value="1">
- <input type="text" name="test2" value="2">
- <input type="text" name="test3" value="3">
- <input type="text" name="test4" value="4">
- <input type="text" name="test5" value="5">
- <input type="text" name="test6" value="6">
- <input type="text" name="test7" value="7">
- <input type="text" name="test8" value="8">
- <input type="text" name="test9" value="9">
- <input type="text" name="test10" value="10">
- <input type="text" name="test11" value="11">
- <input type="text" name="test12" value="12">
- <input type="text" name="test13" value="13">
- <input type="text" name="test14" value="14">
- <input type="text" name="test15" value="15">
- <input type="text" name="test16" value="16">
- <input type="text" name="test17" value="17">
- <input type="text" name="test18" value="18">
- <input type="text" name="test19" value="19">
- <input type="text" name="test20" value="20">
- <input type="text" name="test21" value="21">
- <input type="text" name="test22" value="22">
- <input type="text" name="test23" value="23">
- <input type="text" name="test24" value="24">
- <input type="text" name="test25" value="25">
- <input type="text" name="test26" value="26">
- <input type="text" name="test27" value="27">
- <input type="text" name="test28" value="28">
- <input type="text" name="test29" value="29">
- <input type="text" name="test30" value="30">
- <input type="text" name="test31" value="31">
- <input type="text" name="test32" value="32">
- <input type="text" name="test33" value="33">
- <input type="text" name="test34" value="34">
- <input type="text" name="test35" value="35">
- <input type="text" name="test36" value="36">
- <input type="text" name="test37" value="37">
- <input type="text" name="test38" value="38">
- <input type="text" name="test39" value="39">
- <input type="text" name="test40" value="40">
- <input type="text" name="test41" value="41">
- <input type="text" name="test42" value="42">
- <input type="text" name="test43" value="43">
- <input type="text" name="test44" value="44">
- <input type="text" name="test45" value="45">
- <input type="text" name="test46" value="46">
- <input type="text" name="test47" value="47">
- <input type="text" name="test48" value="48">
- <input type="text" name="test49" value="49">
- <input type="text" name="test50" value="50">
- <input type="text" name="test51" value="51">
- <input type="text" name="test52" value="52">
- <input type="text" name="test53" value="53">
- <input type="text" name="test54" value="54">
- <input type="text" name="test55" value="55">
- <input type="text" name="test56" value="56">
- <input type="text" name="test57" value="57">
- <input type="text" name="test58" value="58">
- <input type="text" name="test59" value="59">
- <input type="text" name="test60" value="60">
- <input type="text" name="test61" value="61">
- <input type="text" name="test62" value="62">
- <input type="text" name="test63" value="63">
- <input type="text" name="test64" value="64">
- <input type="text" name="test65" value="65">
- <input type="text" name="test66" value="66">
- <input type="text" name="test67" value="67">
- <input type="text" name="test68" value="68">
- <input type="text" name="test69" value="69">
- <input type="text" name="test70" value="70">
- <input type="text" name="test71" value="71">
- <input type="text" name="test72" value="72">
- <input type="text" name="test73" value="73">
- <input type="text" name="test74" value="74">
- <input type="text" name="test75" value="75">
- <input type="text" name="test76" value="76">
- <input type="text" name="test77" value="77">
- <input type="text" name="test78" value="78">
- <input type="text" name="test79" value="79">
- <input type="text" name="test80" value="80">
- <input type="text" name="test81" value="81">
- <input type="text" name="test82" value="82">
- <input type="text" name="test83" value="83">
- <input type="text" name="test84" value="84">
- <input type="text" name="test85" value="85">
- <input type="text" name="test86" value="86">
- <input type="text" name="test87" value="87">
- <input type="text" name="test88" value="88">
- <input type="text" name="test89" value="89">
- <input type="text" name="test90" value="90">
- <input type="text" name="test91" value="91">
- <input type="text" name="test92" value="92">
- <input type="text" name="test93" value="93">
- <input type="text" name="test94" value="94">
- <input type="text" name="test95" value="95">
- <input type="text" name="test96" value="96">
- <input type="text" name="test97" value="97">
- <input type="text" name="test98" value="98">
- <input type="text" name="test99" value="99">
- <input type="text" name="test100" value="100">
- <input type="text" name="test101" value="101">
- <button type="submit">Submit</button>
- </form>
-
-</div>
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-var numSubmittedForms = 0;
-var numInputFields = 101;
-
-function checkInitialState() {
- countEntries(null, null,
- function (num) {
- ok(!num, "checking for initially empty storage");
- startTest();
- });
-}
-
-function startTest() {
- // Fill in values for the various fields. We could just set the <input>'s
- // value attribute, but we don't save default form values (and we want to
- // ensure unsaved values are because of autocomplete=off or whatever).
- $_(1, "test" + numInputFields).value = numInputFields + " changed";
-
- // submit the first form.
- var button = getFormSubmitButton(1);
- button.click();
-}
-
-// Make sure that the first (numInputFields - 1) were not saved (as they were not changed).
-// Call done() when finished.
-function checkCountEntries(formNum, index, done)
-{
- countEntries("test" + index, index,
- function (num) {
- ok(!num, "checking unsaved value " + index);
- if (index < numInputFields) {
- checkCountEntries(formNum, index + 1, done);
- }
- else {
- done(formNum);
- }
- });
-}
-
-// Called by each form's onsubmit handler.
-function checkSubmit(formNum) {
- ok(true, "form " + formNum + " submitted");
- numSubmittedForms++;
-
- // make sure that the field # numInputFields was saved
- checkForSave("test" + numInputFields, numInputFields + " changed", "checking saved value " + numInputFields);
-
- checkCountEntries(formNum, 1, checkSubmitCounted);
-
- return false; // cancel current form submission
-}
-
-function checkSubmitCounted(formNum) {
- is(numSubmittedForms, 1, "Ensuring all forms were submitted.");
- SimpleTest.finish();
- return false;
-}
-
-window.onload = checkInitialState;
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/satchel/test/test_password_autocomplete.html b/toolkit/components/satchel/test/test_password_autocomplete.html
deleted file mode 100644
index 82781ae35..000000000
--- a/toolkit/components/satchel/test/test_password_autocomplete.html
+++ /dev/null
@@ -1,107 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for form history on type=password</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
- Test for form history on type=password
- (based on test_bug_511615.html)
-<p id="display"></p>
-
-<!-- we presumably can't hide the content for this test. -->
-<div id="content">
- <datalist id="datalist1">
- <option>value10</option>
- <option>value11</option>
- <option>value12</option>
- </datalist>
- <form id="form1" onsubmit="return false;">
- <!-- Don't set the type to password until rememberSignons is false since we
- want to test when rememberSignons is false. -->
- <input type="to-be-password" name="field1" list="datalist1">
- <button type="submit">Submit</button>
- </form>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-/* import-globals-from satchel_common.js */
-
-var resolvePopupShownListener;
-registerPopupShownListener(() => resolvePopupShownListener());
-
-function waitForNextPopup() {
- return new Promise(resolve => { resolvePopupShownListener = resolve; });
-}
-
-/**
- * Indicates the time to wait before checking that the state of the autocomplete
- * popup, including whether it is open, has not changed in response to events.
- *
- * Manual testing on a fast machine revealed that 80ms was still unreliable,
- * while 100ms detected a simulated failure reliably. Unfortunately, this means
- * that to take into account slower machines we should use a larger value.
- *
- * Note that if a machine takes more than this time to show the popup, this
- * would not cause a failure, conversely the machine would not be able to detect
- * whether the test should have failed. In other words, this use of timeouts is
- * never expected to cause intermittent failures with test automation.
- */
-const POPUP_RESPONSE_WAIT_TIME_MS = 200;
-
-SimpleTest.requestFlakyTimeout("Must ensure that an event does not happen.");
-
-/**
- * Checks that the popup does not open in response to the given function.
- */
-function expectPopupDoesNotOpen(triggerFn) {
- let popupShown = waitForNextPopup();
- triggerFn();
- return Promise.race([
- popupShown.then(() => Promise.reject("Popup opened unexpectedly.")),
- new Promise(resolve => setTimeout(resolve, POPUP_RESPONSE_WAIT_TIME_MS)),
- ]);
-}
-
-add_task(function* test_initialize() {
- yield SpecialPowers.pushPrefEnv({"set": [["signon.rememberSignons", false]]});
-
- // Now that rememberSignons is false, create the password field
- $_(1, "field1").type = "password";
-
- yield new Promise(resolve => updateFormHistory([
- { op : "remove" },
- { op : "add", fieldname : "field1", value : "value1" },
- { op : "add", fieldname : "field1", value : "value2" },
- { op : "add", fieldname : "field1", value : "value3" },
- { op : "add", fieldname : "field1", value : "value4" },
- { op : "add", fieldname : "field1", value : "value5" },
- { op : "add", fieldname : "field1", value : "value6" },
- { op : "add", fieldname : "field1", value : "value7" },
- { op : "add", fieldname : "field1", value : "value8" },
- { op : "add", fieldname : "field1", value : "value9" },
- ], resolve));
-});
-
-add_task(function* test_insecure_focusWarning() {
- // The form is insecure so should show the warning even if password manager is disabled.
- let input = $_(1, "field1");
- let shownPromise = waitForNextPopup();
- input.focus();
- yield shownPromise;
-
- ok(getMenuEntries()[0].includes("Logins entered here could be compromised"),
- "Check warning is first")
-
- // Close the popup
- input.blur();
-});
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/satchel/test/test_popup_direction.html b/toolkit/components/satchel/test/test_popup_direction.html
deleted file mode 100644
index 02e044bbd..000000000
--- a/toolkit/components/satchel/test/test_popup_direction.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for Popup Direction</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Test for Popup Direction
-<p id="display"></p>
-
-<!-- we presumably can't hide the content for this test. -->
-<div id="content">
- <!-- normal, basic form -->
- <form id="form1" onsubmit="return false;">
- <input type="text" name="field1">
- <button type="submit">Submit</button>
- </form>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-var resolvePopupShownListener;
-registerPopupShownListener(() => resolvePopupShownListener());
-
-function waitForNextPopup() {
- return new Promise(resolve => { resolvePopupShownListener = resolve; });
-}
-
-add_task(function* test_popup_direction() {
- var input = $_(1, "field1");
-
- yield new Promise(resolve => updateFormHistory([
- { op : "remove" },
- { op : "add", fieldname : "field1", value : "value1" },
- { op : "add", fieldname : "field1", value : "value2" },
- ], resolve));
-
- for (let direction of ["ltr", "rtl"]) {
- document.getElementById("content").style.direction = direction;
-
- let popupShown = waitForNextPopup();
- input.focus();
- doKey("down");
- yield popupShown;
-
- let popupState = yield new Promise(resolve => getPopupState(resolve));
- is(popupState.direction, direction, "Direction should match.");
-
- // Close the popup.
- input.blur();
- }
-});
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/satchel/test/test_popup_enter_event.html b/toolkit/components/satchel/test/test_popup_enter_event.html
deleted file mode 100644
index 1a7aa8c19..000000000
--- a/toolkit/components/satchel/test/test_popup_enter_event.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Test for events while the form history popup is open</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="satchel_common.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-Form History test: Test for events while the form history popup is open
-<p id="display"></p>
-
-<div id="content">
- <form id="form1">
- <input type="text" name="field1">
- <button type="submit">Submit</button>
- </form>
-</div>
-
-<pre id="test">
-<script class="testbody">
-var form = document.getElementById("form1");
-var input = $_(1, "field1");
-var expectedValue = "value1";
-
-function setupFormHistory(aCallback) {
- updateFormHistory([
- { op : "remove" },
- { op : "add", fieldname : "field1", value : "value1" },
- ], aCallback);
-}
-
-registerPopupShownListener(popupShownListener);
-
-function handleEnter(evt) {
- if (evt.keyCode != KeyEvent.DOM_VK_RETURN) {
- return;
- }
-
- info("RETURN received for phase: " + evt.eventPhase);
- if (input.value == expectedValue) {
- ok(true, "RETURN should be received when the popup is closed");
- is(input.value, expectedValue, "Check input value when enter is pressed the 2nd time");
- info("form should submit with the default handler");
- } else {
- ok(false, "RETURN keypress shouldn't have been received when a popup item is selected");
- }
-}
-
-function popupShownListener(evt) {
- doKey("down");
- doKey("return"); // select the first entry in the popup
- doKey("return"); // try to submit the form with the filled value
-}
-
-function runTest() {
- input.addEventListener("keypress", handleEnter, true);
- form.addEventListener("submit", evt => {
- is(input.value, expectedValue, "Check input value in the submit handler");
- evt.preventDefault();
- SimpleTest.finish();
- });
-
- // Focus the input before adjusting.value so that the caret goes to the end
- // (since OS X doesn't show the dropdown otherwise).
- input.focus();
- input.value = "value"
- input.focus();
- doKey("down");
-}
-
-function startTest() {
- setupFormHistory(function() {
- runTest();
- });
-}
-
-window.onload = startTest;
-
-SimpleTest.waitForExplicitFinish();
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/satchel/test/unit/.eslintrc.js b/toolkit/components/satchel/test/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/satchel/test/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/satchel/test/unit/asyncformhistory_expire.sqlite b/toolkit/components/satchel/test/unit/asyncformhistory_expire.sqlite
deleted file mode 100644
index 07b43c209..000000000
--- a/toolkit/components/satchel/test/unit/asyncformhistory_expire.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/satchel/test/unit/formhistory_1000.sqlite b/toolkit/components/satchel/test/unit/formhistory_1000.sqlite
deleted file mode 100644
index 5eeab074f..000000000
--- a/toolkit/components/satchel/test/unit/formhistory_1000.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/satchel/test/unit/formhistory_CORRUPT.sqlite b/toolkit/components/satchel/test/unit/formhistory_CORRUPT.sqlite
deleted file mode 100644
index 5f7498bfc..000000000
--- a/toolkit/components/satchel/test/unit/formhistory_CORRUPT.sqlite
+++ /dev/null
@@ -1 +0,0 @@
-BACON
diff --git a/toolkit/components/satchel/test/unit/formhistory_apitest.sqlite b/toolkit/components/satchel/test/unit/formhistory_apitest.sqlite
deleted file mode 100644
index 00daf03c2..000000000
--- a/toolkit/components/satchel/test/unit/formhistory_apitest.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/satchel/test/unit/formhistory_autocomplete.sqlite b/toolkit/components/satchel/test/unit/formhistory_autocomplete.sqlite
deleted file mode 100644
index 724cff73f..000000000
--- a/toolkit/components/satchel/test/unit/formhistory_autocomplete.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/satchel/test/unit/formhistory_v3.sqlite b/toolkit/components/satchel/test/unit/formhistory_v3.sqlite
deleted file mode 100644
index e0e8fe246..000000000
--- a/toolkit/components/satchel/test/unit/formhistory_v3.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/satchel/test/unit/formhistory_v3v4.sqlite b/toolkit/components/satchel/test/unit/formhistory_v3v4.sqlite
deleted file mode 100644
index 8eab177e9..000000000
--- a/toolkit/components/satchel/test/unit/formhistory_v3v4.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/satchel/test/unit/formhistory_v999a.sqlite b/toolkit/components/satchel/test/unit/formhistory_v999a.sqlite
deleted file mode 100644
index 14279f05f..000000000
--- a/toolkit/components/satchel/test/unit/formhistory_v999a.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/satchel/test/unit/formhistory_v999b.sqlite b/toolkit/components/satchel/test/unit/formhistory_v999b.sqlite
deleted file mode 100644
index 21d9c1f1c..000000000
--- a/toolkit/components/satchel/test/unit/formhistory_v999b.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/satchel/test/unit/head_satchel.js b/toolkit/components/satchel/test/unit/head_satchel.js
deleted file mode 100644
index 282d07ba5..000000000
--- a/toolkit/components/satchel/test/unit/head_satchel.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/FormHistory.jsm");
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
-
-const CURRENT_SCHEMA = 4;
-const PR_HOURS = 60 * 60 * 1000000;
-
-do_get_profile();
-
-var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties);
-
-// Send the profile-after-change notification to the form history component to ensure
-// that it has been initialized.
-var formHistoryStartup = Cc["@mozilla.org/satchel/form-history-startup;1"].
- getService(Ci.nsIObserver);
-formHistoryStartup.observe(null, "profile-after-change", null);
-
-function getDBVersion(dbfile) {
- var ss = Cc["@mozilla.org/storage/service;1"].
- getService(Ci.mozIStorageService);
- var dbConnection = ss.openDatabase(dbfile);
- var version = dbConnection.schemaVersion;
- dbConnection.close();
-
- return version;
-}
-
-const isGUID = /[A-Za-z0-9\+\/]{16}/;
-
-// Find form history entries.
-function searchEntries(terms, params, iter) {
- let results = [];
- FormHistory.search(terms, params, { handleResult: result => results.push(result),
- handleError: function (error) {
- do_throw("Error occurred searching form history: " + error);
- },
- handleCompletion: function (reason) { if (!reason) iter.next(results); }
- });
-}
-
-// Count the number of entries with the given name and value, and call then(number)
-// when done. If name or value is null, then the value of that field does not matter.
-function countEntries(name, value, then) {
- var obj = {};
- if (name !== null)
- obj.fieldname = name;
- if (value !== null)
- obj.value = value;
-
- let count = 0;
- FormHistory.count(obj, { handleResult: result => count = result,
- handleError: function (error) {
- do_throw("Error occurred searching form history: " + error);
- },
- handleCompletion: function (reason) { if (!reason) then(count); }
- });
-}
-
-// Perform a single form history update and call then() when done.
-function updateEntry(op, name, value, then) {
- var obj = { op: op };
- if (name !== null)
- obj.fieldname = name;
- if (value !== null)
- obj.value = value;
- updateFormHistory(obj, then);
-}
-
-// Add a single form history entry with the current time and call then() when done.
-function addEntry(name, value, then) {
- let now = Date.now() * 1000;
- updateFormHistory({ op: "add", fieldname: name, value: value, timesUsed: 1,
- firstUsed: now, lastUsed: now }, then);
-}
-
-// Wrapper around FormHistory.update which handles errors. Calls then() when done.
-function updateFormHistory(changes, then) {
- FormHistory.update(changes, { handleError: function (error) {
- do_throw("Error occurred updating form history: " + error);
- },
- handleCompletion: function (reason) { if (!reason) then(); },
- });
-}
-
-/**
- * Logs info to the console in the standard way (includes the filename).
- *
- * @param aMessage
- * The message to log to the console.
- */
-function do_log_info(aMessage) {
- print("TEST-INFO | " + _TEST_FILE + " | " + aMessage);
-}
diff --git a/toolkit/components/satchel/test/unit/perf_autocomplete.js b/toolkit/components/satchel/test/unit/perf_autocomplete.js
deleted file mode 100644
index 6e8bb5125..000000000
--- a/toolkit/components/satchel/test/unit/perf_autocomplete.js
+++ /dev/null
@@ -1,140 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var testnum = 0;
-var fh;
-var fac;
-var prefs;
-
-function countAllEntries() {
- let stmt = fh.DBConnection.createStatement("SELECT COUNT(*) as numEntries FROM moz_formhistory");
- do_check_true(stmt.executeStep());
- let numEntries = stmt.row.numEntries;
- stmt.finalize();
- return numEntries;
-}
-
-function do_AC_search(searchTerm, previousResult) {
- var duration = 0;
- var searchCount = 5;
- var tempPrevious = null;
- var startTime;
- for (var i = 0; i < searchCount; i++) {
- if (previousResult !== null)
- tempPrevious = fac.autoCompleteSearch("searchbar-history", previousResult, null, null);
- startTime = Date.now();
- results = fac.autoCompleteSearch("searchbar-history", searchTerm, null, tempPrevious);
- duration += Date.now() - startTime;
- }
- dump("[autoCompleteSearch][test " + testnum + "] for '" + searchTerm + "' ");
- if (previousResult !== null)
- dump("with '" + previousResult + "' previous result ");
- else
- dump("w/o previous result ");
- dump("took " + duration + " ms with " + results.matchCount + " matches. ");
- dump("Average of " + Math.round(duration / searchCount) + " ms per search\n");
- return results;
-}
-
-function run_test() {
- try {
-
- // ===== test init =====
- var testfile = do_get_file("formhistory_1000.sqlite");
- var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
- var results;
-
- // Cleanup from any previous tests or failures.
- var destFile = profileDir.clone();
- destFile.append("formhistory.sqlite");
- if (destFile.exists())
- destFile.remove(false);
-
- testfile.copyTo(profileDir, "formhistory.sqlite");
-
- fh = Cc["@mozilla.org/satchel/form-history;1"].
- getService(Ci.nsIFormHistory2);
- fac = Cc["@mozilla.org/satchel/form-autocomplete;1"].
- getService(Ci.nsIFormAutoComplete);
- prefs = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
-
- timeGroupingSize = prefs.getIntPref("browser.formfill.timeGroupingSize") * 1000 * 1000;
- maxTimeGroupings = prefs.getIntPref("browser.formfill.maxTimeGroupings");
- bucketSize = prefs.getIntPref("browser.formfill.bucketSize");
-
- // ===== 1 =====
- // Check initial state is as expected
- testnum++;
- do_check_true(fh.hasEntries);
- do_check_eq(1000, countAllEntries());
- fac.autoCompleteSearch("searchbar-history", "zzzzzzzzzz", null, null); // warm-up search
- do_check_true(fh.nameExists("searchbar-history"));
-
- // ===== 2 =====
- // Search for '' with no previous result
- testnum++;
- results = do_AC_search("", null);
- do_check_true(results.matchCount > 0);
-
- // ===== 3 =====
- // Search for 'r' with no previous result
- testnum++;
- results = do_AC_search("r", null);
- do_check_true(results.matchCount > 0);
-
- // ===== 4 =====
- // Search for 'r' with '' previous result
- testnum++;
- results = do_AC_search("r", "");
- do_check_true(results.matchCount > 0);
-
- // ===== 5 =====
- // Search for 're' with no previous result
- testnum++;
- results = do_AC_search("re", null);
- do_check_true(results.matchCount > 0);
-
- // ===== 6 =====
- // Search for 're' with 'r' previous result
- testnum++;
- results = do_AC_search("re", "r");
- do_check_true(results.matchCount > 0);
-
- // ===== 7 =====
- // Search for 'rea' without previous result
- testnum++;
- results = do_AC_search("rea", null);
- let countREA = results.matchCount;
-
- // ===== 8 =====
- // Search for 'rea' with 're' previous result
- testnum++;
- results = do_AC_search("rea", "re");
- do_check_eq(countREA, results.matchCount);
-
- // ===== 9 =====
- // Search for 'real' with 'rea' previous result
- testnum++;
- results = do_AC_search("real", "rea");
- let countREAL = results.matchCount;
- do_check_true(results.matchCount <= countREA);
-
- // ===== 10 =====
- // Search for 'real' with 're' previous result
- testnum++;
- results = do_AC_search("real", "re");
- do_check_eq(countREAL, results.matchCount);
-
- // ===== 11 =====
- // Search for 'real' with no previous result
- testnum++;
- results = do_AC_search("real", null);
- do_check_eq(countREAL, results.matchCount);
-
-
- } catch (e) {
- throw "FAILED in test #" + testnum + " -- " + e;
- }
-}
diff --git a/toolkit/components/satchel/test/unit/test_async_expire.js b/toolkit/components/satchel/test/unit/test_async_expire.js
deleted file mode 100644
index 501cbdfe5..000000000
--- a/toolkit/components/satchel/test/unit/test_async_expire.js
+++ /dev/null
@@ -1,168 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var dbFile, oldSize;
-var currentTestIndex = 0;
-
-function triggerExpiration() {
- // We can't easily fake a "daily idle" event, so for testing purposes form
- // history listens for another notification to trigger an immediate
- // expiration.
- Services.obs.notifyObservers(null, "formhistory-expire-now", null);
-}
-
-var checkExists = function(num) { do_check_true(num > 0); next_test(); }
-var checkNotExists = function(num) { do_check_true(!num); next_test(); }
-
-var TestObserver = {
- QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
-
- observe : function (subject, topic, data) {
- do_check_eq(topic, "satchel-storage-changed");
-
- if (data == "formhistory-expireoldentries") {
- next_test();
- }
- }
-};
-
-function test_finished() {
- // Make sure we always reset prefs.
- if (Services.prefs.prefHasUserValue("browser.formfill.expire_days"))
- Services.prefs.clearUserPref("browser.formfill.expire_days");
-
- do_test_finished();
-}
-
-var iter = tests();
-
-function run_test()
-{
- do_test_pending();
- iter.next();
-}
-
-function next_test()
-{
- iter.next();
-}
-
-function* tests()
-{
- Services.obs.addObserver(TestObserver, "satchel-storage-changed", true);
-
- // ===== test init =====
- var testfile = do_get_file("asyncformhistory_expire.sqlite");
- var profileDir = do_get_profile();
-
- // Cleanup from any previous tests or failures.
- dbFile = profileDir.clone();
- dbFile.append("formhistory.sqlite");
- if (dbFile.exists())
- dbFile.remove(false);
-
- testfile.copyTo(profileDir, "formhistory.sqlite");
- do_check_true(dbFile.exists());
-
- // We're going to clear this at the end, so it better have the default value now.
- do_check_false(Services.prefs.prefHasUserValue("browser.formfill.expire_days"));
-
- // Sanity check initial state
- yield countEntries(null, null, function(num) { do_check_eq(508, num); next_test(); });
- yield countEntries("name-A", "value-A", checkExists); // lastUsed == distant past
- yield countEntries("name-B", "value-B", checkExists); // lastUsed == distant future
-
- do_check_eq(CURRENT_SCHEMA, FormHistory.schemaVersion);
-
- // Add a new entry
- yield countEntries("name-C", "value-C", checkNotExists);
- yield addEntry("name-C", "value-C", next_test);
- yield countEntries("name-C", "value-C", checkExists);
-
- // Update some existing entries to have ages relative to when the test runs.
- var now = 1000 * Date.now();
- let updateLastUsed = function updateLastUsedFn(results, age)
- {
- let lastUsed = now - age * 24 * PR_HOURS;
-
- let changes = [ ];
- for (let r = 0; r < results.length; r++) {
- changes.push({ op: "update", lastUsed: lastUsed, guid: results[r].guid });
- }
-
- return changes;
- }
-
- let results = yield searchEntries(["guid"], { lastUsed: 181 }, iter);
- yield updateFormHistory(updateLastUsed(results, 181), next_test);
-
- results = yield searchEntries(["guid"], { lastUsed: 179 }, iter);
- yield updateFormHistory(updateLastUsed(results, 179), next_test);
-
- results = yield searchEntries(["guid"], { lastUsed: 31 }, iter);
- yield updateFormHistory(updateLastUsed(results, 31), next_test);
-
- results = yield searchEntries(["guid"], { lastUsed: 29 }, iter);
- yield updateFormHistory(updateLastUsed(results, 29), next_test);
-
- results = yield searchEntries(["guid"], { lastUsed: 9999 }, iter);
- yield updateFormHistory(updateLastUsed(results, 11), next_test);
-
- results = yield searchEntries(["guid"], { lastUsed: 9 }, iter);
- yield updateFormHistory(updateLastUsed(results, 9), next_test);
-
- yield countEntries("name-A", "value-A", checkExists);
- yield countEntries("181DaysOld", "foo", checkExists);
- yield countEntries("179DaysOld", "foo", checkExists);
- yield countEntries(null, null, function(num) { do_check_eq(509, num); next_test(); });
-
- // 2 entries are expected to expire.
- triggerExpiration();
- yield;
-
- yield countEntries("name-A", "value-A", checkNotExists);
- yield countEntries("181DaysOld", "foo", checkNotExists);
- yield countEntries("179DaysOld", "foo", checkExists);
- yield countEntries(null, null, function(num) { do_check_eq(507, num); next_test(); });
-
- // And again. No change expected.
- triggerExpiration();
- yield;
-
- yield countEntries(null, null, function(num) { do_check_eq(507, num); next_test(); });
-
- // Set formfill pref to 30 days.
- Services.prefs.setIntPref("browser.formfill.expire_days", 30);
- yield countEntries("179DaysOld", "foo", checkExists);
- yield countEntries("bar", "31days", checkExists);
- yield countEntries("bar", "29days", checkExists);
- yield countEntries(null, null, function(num) { do_check_eq(507, num); next_test(); });
-
- triggerExpiration();
- yield;
-
- yield countEntries("179DaysOld", "foo", checkNotExists);
- yield countEntries("bar", "31days", checkNotExists);
- yield countEntries("bar", "29days", checkExists);
- yield countEntries(null, null, function(num) { do_check_eq(505, num); next_test(); });
-
- // Set override pref to 10 days and expire. This expires a large batch of
- // entries, and should trigger a VACCUM to reduce file size.
- Services.prefs.setIntPref("browser.formfill.expire_days", 10);
-
- yield countEntries("bar", "29days", checkExists);
- yield countEntries("9DaysOld", "foo", checkExists);
- yield countEntries(null, null, function(num) { do_check_eq(505, num); next_test(); });
-
- triggerExpiration();
- yield;
-
- yield countEntries("bar", "29days", checkNotExists);
- yield countEntries("9DaysOld", "foo", checkExists);
- yield countEntries("name-B", "value-B", checkExists);
- yield countEntries("name-C", "value-C", checkExists);
- yield countEntries(null, null, function(num) { do_check_eq(3, num); next_test(); });
-
- test_finished();
-}
diff --git a/toolkit/components/satchel/test/unit/test_autocomplete.js b/toolkit/components/satchel/test/unit/test_autocomplete.js
deleted file mode 100644
index 211753809..000000000
--- a/toolkit/components/satchel/test/unit/test_autocomplete.js
+++ /dev/null
@@ -1,266 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-var testnum = 0;
-var fac;
-var prefs;
-
-var numRecords, timeGroupingSize, now;
-
-const DEFAULT_EXPIRE_DAYS = 180;
-
-function padLeft(number, length) {
- var str = number + '';
- while (str.length < length)
- str = '0' + str;
- return str;
-}
-
-function getFormExpiryDays() {
- if (prefs.prefHasUserValue("browser.formfill.expire_days")) {
- return prefs.getIntPref("browser.formfill.expire_days");
- }
- return DEFAULT_EXPIRE_DAYS;
-}
-
-function run_test() {
- // ===== test init =====
- var testfile = do_get_file("formhistory_autocomplete.sqlite");
- var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
-
- // Cleanup from any previous tests or failures.
- var destFile = profileDir.clone();
- destFile.append("formhistory.sqlite");
- if (destFile.exists())
- destFile.remove(false);
-
- testfile.copyTo(profileDir, "formhistory.sqlite");
-
- fac = Cc["@mozilla.org/satchel/form-autocomplete;1"].
- getService(Ci.nsIFormAutoComplete);
- prefs = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
-
- timeGroupingSize = prefs.getIntPref("browser.formfill.timeGroupingSize") * 1000 * 1000;
-
- run_next_test();
-}
-
-add_test(function test0() {
- var maxTimeGroupings = prefs.getIntPref("browser.formfill.maxTimeGroupings");
- var bucketSize = prefs.getIntPref("browser.formfill.bucketSize");
-
- // ===== Tests with constant timesUsed and varying lastUsed date =====
- // insert 2 records per bucket to check alphabetical sort within
- now = 1000 * Date.now();
- numRecords = Math.ceil(maxTimeGroupings / bucketSize) * 2;
-
- let changes = [ ];
- for (let i = 0; i < numRecords; i+=2) {
- let useDate = now - (i/2 * bucketSize * timeGroupingSize);
-
- changes.push({ op : "add", fieldname: "field1", value: "value" + padLeft(numRecords - 1 - i, 2),
- timesUsed: 1, firstUsed: useDate, lastUsed: useDate });
- changes.push({ op : "add", fieldname: "field1", value: "value" + padLeft(numRecords - 2 - i, 2),
- timesUsed: 1, firstUsed: useDate, lastUsed: useDate });
- }
-
- updateFormHistory(changes, run_next_test);
-});
-
-add_test(function test1() {
- do_log_info("Check initial state is as expected");
-
- countEntries(null, null, function () {
- countEntries("field1", null, function (count) {
- do_check_true(count > 0);
- run_next_test();
- });
- });
-});
-
-add_test(function test2() {
- do_log_info("Check search contains all entries");
-
- fac.autoCompleteSearchAsync("field1", "", null, null, null, {
- onSearchCompletion : function(aResults) {
- do_check_eq(numRecords, aResults.matchCount);
- run_next_test();
- }
- });
-});
-
-add_test(function test3() {
- do_log_info("Check search result ordering with empty search term");
-
- let lastFound = numRecords;
- fac.autoCompleteSearchAsync("field1", "", null, null, null, {
- onSearchCompletion : function(aResults) {
- for (let i = 0; i < numRecords; i+=2) {
- do_check_eq(parseInt(aResults.getValueAt(i + 1).substr(5), 10), --lastFound);
- do_check_eq(parseInt(aResults.getValueAt(i).substr(5), 10), --lastFound);
- }
- run_next_test();
- }
- });
-});
-
-add_test(function test4() {
- do_log_info("Check search result ordering with \"v\"");
-
- let lastFound = numRecords;
- fac.autoCompleteSearchAsync("field1", "v", null, null, null, {
- onSearchCompletion : function(aResults) {
- for (let i = 0; i < numRecords; i+=2) {
- do_check_eq(parseInt(aResults.getValueAt(i + 1).substr(5), 10), --lastFound);
- do_check_eq(parseInt(aResults.getValueAt(i).substr(5), 10), --lastFound);
- }
- run_next_test();
- }
- });
-});
-
-const timesUsedSamples = 20;
-
-add_test(function test5() {
- do_log_info("Begin tests with constant use dates and varying timesUsed");
-
- let changes = [];
- for (let i = 0; i < timesUsedSamples; i++) {
- let timesUsed = (timesUsedSamples - i);
- let change = { op : "add", fieldname: "field2", value: "value" + (timesUsedSamples - 1 - i),
- timesUsed: timesUsed * timeGroupingSize, firstUsed: now, lastUsed: now };
- changes.push(change);
- }
- updateFormHistory(changes, run_next_test);
-});
-
-add_test(function test6() {
- do_log_info("Check search result ordering with empty search term");
-
- let lastFound = timesUsedSamples;
- fac.autoCompleteSearchAsync("field2", "", null, null, null, {
- onSearchCompletion : function(aResults) {
- for (let i = 0; i < timesUsedSamples; i++) {
- do_check_eq(parseInt(aResults.getValueAt(i).substr(5)), --lastFound);
- }
- run_next_test();
- }
- });
-});
-
-add_test(function test7() {
- do_log_info("Check search result ordering with \"v\"");
-
- let lastFound = timesUsedSamples;
- fac.autoCompleteSearchAsync("field2", "v", null, null, null, {
- onSearchCompletion : function(aResults) {
- for (let i = 0; i < timesUsedSamples; i++) {
- do_check_eq(parseInt(aResults.getValueAt(i).substr(5)), --lastFound);
- }
- run_next_test();
- }
- });
-});
-
-add_test(function test8() {
- do_log_info("Check that \"senior citizen\" entries get a bonus (browser.formfill.agedBonus)");
-
- let agedDate = 1000 * (Date.now() - getFormExpiryDays() * 24 * 60 * 60 * 1000);
-
- let changes = [ ];
- changes.push({ op : "add", fieldname: "field3", value: "old but not senior",
- timesUsed: 100, firstUsed: (agedDate + 60 * 1000 * 1000), lastUsed: now });
- changes.push({ op : "add", fieldname: "field3", value: "senior citizen",
- timesUsed: 100, firstUsed: (agedDate - 60 * 1000 * 1000), lastUsed: now });
- updateFormHistory(changes, run_next_test);
-});
-
-add_test(function test9() {
- fac.autoCompleteSearchAsync("field3", "", null, null, null, {
- onSearchCompletion : function(aResults) {
- do_check_eq(aResults.getValueAt(0), "senior citizen");
- do_check_eq(aResults.getValueAt(1), "old but not senior");
- run_next_test();
- }
- });
-});
-
-add_test(function test10() {
- do_log_info("Check entries that are really old or in the future");
-
- let changes = [ ];
- changes.push({ op : "add", fieldname: "field4", value: "date of 0",
- timesUsed: 1, firstUsed: 0, lastUsed: 0 });
- changes.push({ op : "add", fieldname: "field4", value: "in the future 1",
- timesUsed: 1, firstUsed: 0, lastUsed: now * 2 });
- changes.push({ op : "add", fieldname: "field4", value: "in the future 2",
- timesUsed: 1, firstUsed: now * 2, lastUsed: now * 2 });
- updateFormHistory(changes, run_next_test);
-});
-
-add_test(function test11() {
- fac.autoCompleteSearchAsync("field4", "", null, null, null, {
- onSearchCompletion : function(aResults) {
- do_check_eq(aResults.matchCount, 3);
- run_next_test();
- }
- });
-});
-
-var syncValues = ["sync1", "sync1a", "sync2", "sync3"]
-
-add_test(function test12() {
- do_log_info("Check old synchronous api");
-
- let changes = [ ];
- for (let value of syncValues) {
- changes.push({ op : "add", fieldname: "field5", value: value });
- }
- updateFormHistory(changes, run_next_test);
-});
-
-add_test(function test_token_limit_DB() {
- function test_token_limit_previousResult(previousResult) {
- do_log_info("Check that the number of tokens used in a search is not capped to " +
- "MAX_SEARCH_TOKENS when using a previousResult");
- // This provide more accuracy since performance is less of an issue.
- // Search for a string where the first 10 tokens match the previous value but the 11th does not
- // when re-using a previous result.
- fac.autoCompleteSearchAsync("field_token_cap",
- "a b c d e f g h i j .",
- null, previousResult, null, {
- onSearchCompletion : function(aResults) {
- do_check_eq(aResults.matchCount, 0,
- "All search tokens should be used with " +
- "previous results");
- run_next_test();
- }
- });
- }
-
- do_log_info("Check that the number of tokens used in a search is capped to MAX_SEARCH_TOKENS " +
- "for performance when querying the DB");
- let changes = [ ];
- changes.push({ op : "add", fieldname: "field_token_cap",
- // value with 15 unique tokens
- value: "a b c d e f g h i j k l m n o",
- timesUsed: 1, firstUsed: 0, lastUsed: 0 });
- updateFormHistory(changes, () => {
- // Search for a string where the first 10 tokens match the value above but the 11th does not
- // (which would prevent the result from being returned if the 11th term was used).
- fac.autoCompleteSearchAsync("field_token_cap",
- "a b c d e f g h i j .",
- null, null, null, {
- onSearchCompletion : function(aResults) {
- do_check_eq(aResults.matchCount, 1,
- "Only the first MAX_SEARCH_TOKENS tokens " +
- "should be used for DB queries");
- test_token_limit_previousResult(aResults);
- }
- });
- });
-});
diff --git a/toolkit/components/satchel/test/unit/test_db_corrupt.js b/toolkit/components/satchel/test/unit/test_db_corrupt.js
deleted file mode 100644
index a6fdc4c02..000000000
--- a/toolkit/components/satchel/test/unit/test_db_corrupt.js
+++ /dev/null
@@ -1,89 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var bakFile;
-
-function run_test() {
- // ===== test init =====
- let testfile = do_get_file("formhistory_CORRUPT.sqlite");
- let profileDir = dirSvc.get("ProfD", Ci.nsIFile);
-
- // Cleanup from any previous tests or failures.
- let destFile = profileDir.clone();
- destFile.append("formhistory.sqlite");
- if (destFile.exists())
- destFile.remove(false);
-
- bakFile = profileDir.clone();
- bakFile.append("formhistory.sqlite.corrupt");
- if (bakFile.exists())
- bakFile.remove(false);
-
- testfile.copyTo(profileDir, "formhistory.sqlite");
- run_next_test();
-}
-
-add_test(function test_corruptFormHistoryDB_lazyCorruptInit1() {
- do_log_info("ensure FormHistory backs up a corrupt DB on initialization.");
-
- // DB init is done lazily so the DB shouldn't be created yet.
- do_check_false(bakFile.exists());
- // Doing any request to the DB should create it.
- countEntries(null, null, run_next_test);
-});
-
-add_test(function test_corruptFormHistoryDB_lazyCorruptInit2() {
- do_check_true(bakFile.exists());
- bakFile.remove(false);
- run_next_test();
-});
-
-
-add_test(function test_corruptFormHistoryDB_emptyInit() {
- do_log_info("test that FormHistory initializes an empty DB in place of corrupt DB.");
-
- FormHistory.count({}, {
- handleResult : function(aNumEntries) {
- do_check_true(aNumEntries == 0);
- FormHistory.count({ fieldname : "name-A", value : "value-A" }, {
- handleResult : function(aNumEntries2) {
- do_check_true(aNumEntries2 == 0);
- run_next_test();
- },
- handleError : function(aError2) {
- do_throw("DB initialized after reading a corrupt DB file found an entry.");
- }
- });
- },
- handleError : function (aError) {
- do_throw("DB initialized after reading a corrupt DB file is not empty.");
- }
- });
-});
-
-add_test(function test_corruptFormHistoryDB_addEntry() {
- do_log_info("test adding an entry to the empty DB.");
-
- updateEntry("add", "name-A", "value-A",
- function() {
- countEntries("name-A", "value-A",
- function(count) {
- do_check_true(count == 1);
- run_next_test();
- });
- });
- });
-
-add_test(function test_corruptFormHistoryDB_removeEntry() {
- do_log_info("test removing an entry to the empty DB.");
-
- updateEntry("remove", "name-A", "value-A",
- function() {
- countEntries("name-A", "value-A",
- function(count) {
- do_check_true(count == 0);
- run_next_test();
- });
- });
- });
diff --git a/toolkit/components/satchel/test/unit/test_db_update_v4.js b/toolkit/components/satchel/test/unit/test_db_update_v4.js
deleted file mode 100644
index 84b17e8a0..000000000
--- a/toolkit/components/satchel/test/unit/test_db_update_v4.js
+++ /dev/null
@@ -1,60 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var testnum = 0;
-
-var iter;
-
-function run_test()
-{
- do_test_pending();
- iter = next_test();
- iter.next();
-}
-
-function* next_test()
-{
- try {
-
- // ===== test init =====
- var testfile = do_get_file("formhistory_v3.sqlite");
- var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
-
- // Cleanup from any previous tests or failures.
- var destFile = profileDir.clone();
- destFile.append("formhistory.sqlite");
- if (destFile.exists())
- destFile.remove(false);
-
- testfile.copyTo(profileDir, "formhistory.sqlite");
- do_check_eq(3, getDBVersion(testfile));
-
- // ===== 1 =====
- testnum++;
-
- destFile = profileDir.clone();
- destFile.append("formhistory.sqlite");
- let dbConnection = Services.storage.openUnsharedDatabase(destFile);
-
- // check for upgraded schema.
- do_check_eq(CURRENT_SCHEMA, FormHistory.schemaVersion);
-
- // Check that the index was added
- do_check_true(dbConnection.tableExists("moz_deleted_formhistory"));
- dbConnection.close();
-
- // check for upgraded schema.
- do_check_eq(CURRENT_SCHEMA, FormHistory.schemaVersion);
- // check that an entry still exists
- yield countEntries("name-A", "value-A",
- function (num) {
- do_check_true(num > 0);
- do_test_finished();
- }
- );
-
- } catch (e) {
- throw "FAILED in test #" + testnum + " -- " + e;
- }
-}
diff --git a/toolkit/components/satchel/test/unit/test_db_update_v4b.js b/toolkit/components/satchel/test/unit/test_db_update_v4b.js
deleted file mode 100644
index 356d34a48..000000000
--- a/toolkit/components/satchel/test/unit/test_db_update_v4b.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var testnum = 0;
-
-var iter;
-
-function run_test()
-{
- do_test_pending();
- iter = next_test();
- iter.next();
-}
-
-function* next_test()
-{
- try {
-
- // ===== test init =====
- var testfile = do_get_file("formhistory_v3v4.sqlite");
- var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
-
- // Cleanup from any previous tests or failures.
- var destFile = profileDir.clone();
- destFile.append("formhistory.sqlite");
- if (destFile.exists())
- destFile.remove(false);
-
- testfile.copyTo(profileDir, "formhistory.sqlite");
- do_check_eq(3, getDBVersion(testfile));
-
- // ===== 1 =====
- testnum++;
-
- destFile = profileDir.clone();
- destFile.append("formhistory.sqlite");
- dbConnection = Services.storage.openUnsharedDatabase(destFile);
-
- // check for upgraded schema.
- do_check_eq(CURRENT_SCHEMA, FormHistory.schemaVersion);
-
- // Check that the index was added
- do_check_true(dbConnection.tableExists("moz_deleted_formhistory"));
- dbConnection.close();
-
- // check that an entry still exists
- yield countEntries("name-A", "value-A",
- function (num) {
- do_check_true(num > 0);
- do_test_finished();
- }
- );
-
- } catch (e) {
- throw "FAILED in test #" + testnum + " -- " + e;
- }
-}
diff --git a/toolkit/components/satchel/test/unit/test_db_update_v999a.js b/toolkit/components/satchel/test/unit/test_db_update_v999a.js
deleted file mode 100644
index 0a44d06aa..000000000
--- a/toolkit/components/satchel/test/unit/test_db_update_v999a.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * This test uses a formhistory.sqlite with schema version set to 999 (a
- * future version). This exercies the code that allows using a future schema
- * version as long as the expected columns are present.
- *
- * Part A tests this when the columns do match, so the DB is used.
- * Part B tests this when the columns do *not* match, so the DB is reset.
- */
-
-var iter = tests();
-
-function run_test()
-{
- do_test_pending();
- iter.next();
-}
-
-function next_test()
-{
- iter.next();
-}
-
-function* tests()
-{
- try {
- var testnum = 0;
-
- // ===== test init =====
- var testfile = do_get_file("formhistory_v999a.sqlite");
- var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
-
- // Cleanup from any previous tests or failures.
- var destFile = profileDir.clone();
- destFile.append("formhistory.sqlite");
- if (destFile.exists())
- destFile.remove(false);
-
- testfile.copyTo(profileDir, "formhistory.sqlite");
- do_check_eq(999, getDBVersion(testfile));
-
- let checkZero = function(num) { do_check_eq(num, 0); next_test(); }
- let checkOne = function(num) { do_check_eq(num, 1); next_test(); }
-
- // ===== 1 =====
- testnum++;
- // Check for expected contents.
- yield countEntries(null, null, function(num) { do_check_true(num > 0); next_test(); });
- yield countEntries("name-A", "value-A", checkOne);
- yield countEntries("name-B", "value-B", checkOne);
- yield countEntries("name-C", "value-C1", checkOne);
- yield countEntries("name-C", "value-C2", checkOne);
- yield countEntries("name-E", "value-E", checkOne);
-
- // check for downgraded schema.
- do_check_eq(CURRENT_SCHEMA, FormHistory.schemaVersion);
-
- // ===== 2 =====
- testnum++;
- // Exercise adding and removing a name/value pair
- yield countEntries("name-D", "value-D", checkZero);
- yield updateEntry("add", "name-D", "value-D", next_test);
- yield countEntries("name-D", "value-D", checkOne);
- yield updateEntry("remove", "name-D", "value-D", next_test);
- yield countEntries("name-D", "value-D", checkZero);
-
- } catch (e) {
- throw "FAILED in test #" + testnum + " -- " + e;
- }
-
- do_test_finished();
-}
diff --git a/toolkit/components/satchel/test/unit/test_db_update_v999b.js b/toolkit/components/satchel/test/unit/test_db_update_v999b.js
deleted file mode 100644
index fb0ecd1b7..000000000
--- a/toolkit/components/satchel/test/unit/test_db_update_v999b.js
+++ /dev/null
@@ -1,92 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * This test uses a formhistory.sqlite with schema version set to 999 (a
- * future version). This exercies the code that allows using a future schema
- * version as long as the expected columns are present.
- *
- * Part A tests this when the columns do match, so the DB is used.
- * Part B tests this when the columns do *not* match, so the DB is reset.
- */
-
-var iter = tests();
-
-function run_test()
-{
- do_test_pending();
- iter.next();
-}
-
-function next_test()
-{
- iter.next();
-}
-
-function* tests()
-{
- try {
- var testnum = 0;
-
- // ===== test init =====
- var testfile = do_get_file("formhistory_v999b.sqlite");
- var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
-
- // Cleanup from any previous tests or failures.
- var destFile = profileDir.clone();
- destFile.append("formhistory.sqlite");
- if (destFile.exists())
- destFile.remove(false);
-
- var bakFile = profileDir.clone();
- bakFile.append("formhistory.sqlite.corrupt");
- if (bakFile.exists())
- bakFile.remove(false);
-
- testfile.copyTo(profileDir, "formhistory.sqlite");
- do_check_eq(999, getDBVersion(testfile));
-
- let checkZero = function(num) { do_check_eq(num, 0); next_test(); }
- let checkOne = function(num) { do_check_eq(num, 1); next_test(); }
-
- // ===== 1 =====
- testnum++;
-
- // Open the DB, ensure that a backup of the corrupt DB is made.
- // DB init is done lazily so the DB shouldn't be created yet.
- do_check_false(bakFile.exists());
- // Doing any request to the DB should create it.
- yield countEntries("", "", next_test);
-
- do_check_true(bakFile.exists());
- bakFile.remove(false);
-
- // ===== 2 =====
- testnum++;
- // File should be empty
- yield countEntries(null, null, function(num) { do_check_false(num); next_test(); });
- yield countEntries("name-A", "value-A", checkZero);
- // check for current schema.
- do_check_eq(CURRENT_SCHEMA, FormHistory.schemaVersion);
-
- // ===== 3 =====
- testnum++;
- // Try adding an entry
- yield updateEntry("add", "name-A", "value-A", next_test);
- yield countEntries(null, null, checkOne);
- yield countEntries("name-A", "value-A", checkOne);
-
- // ===== 4 =====
- testnum++;
- // Try removing an entry
- yield updateEntry("remove", "name-A", "value-A", next_test);
- yield countEntries(null, null, checkZero);
- yield countEntries("name-A", "value-A", checkZero);
-
- } catch (e) {
- throw "FAILED in test #" + testnum + " -- " + e;
- }
-
- do_test_finished();
-}
diff --git a/toolkit/components/satchel/test/unit/test_history_api.js b/toolkit/components/satchel/test/unit/test_history_api.js
deleted file mode 100644
index 753504183..000000000
--- a/toolkit/components/satchel/test/unit/test_history_api.js
+++ /dev/null
@@ -1,457 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var testnum = 0;
-var dbConnection; // used for deleted table tests
-
-Cu.import("resource://gre/modules/Promise.jsm");
-
-function countDeletedEntries(expected)
-{
- let deferred = Promise.defer();
- let stmt = dbConnection.createAsyncStatement("SELECT COUNT(*) AS numEntries FROM moz_deleted_formhistory");
- stmt.executeAsync({
- handleResult: function(resultSet) {
- do_check_eq(expected, resultSet.getNextRow().getResultByName("numEntries"));
- deferred.resolve();
- },
- handleError : function () {
- do_throw("Error occurred counting deleted entries: " + error);
- deferred.reject();
- },
- handleCompletion : function () {
- stmt.finalize();
- }
- });
- return deferred.promise;
-}
-
-function checkTimeDeleted(guid, checkFunction)
-{
- let deferred = Promise.defer();
- let stmt = dbConnection.createAsyncStatement("SELECT timeDeleted FROM moz_deleted_formhistory WHERE guid = :guid");
- stmt.params.guid = guid;
- stmt.executeAsync({
- handleResult: function(resultSet) {
- checkFunction(resultSet.getNextRow().getResultByName("timeDeleted"));
- deferred.resolve();
- },
- handleError : function () {
- do_throw("Error occurred getting deleted entries: " + error);
- deferred.reject();
- },
- handleCompletion : function () {
- stmt.finalize();
- }
- });
- return deferred.promise;
-}
-
-function promiseUpdateEntry(op, name, value)
-{
- var change = { op: op };
- if (name !== null)
- change.fieldname = name;
- if (value !== null)
- change.value = value;
- return promiseUpdate(change);
-}
-
-function promiseUpdate(change) {
- return new Promise((resolve, reject) => {
- FormHistory.update(change, {
- handleError(error) {
- this._error = error;
- },
- handleCompletion(reason) {
- if (reason) {
- reject(this._error);
- } else {
- resolve();
- }
- }
- });
- });
-}
-
-function promiseSearchEntries(terms, params)
-{
- let deferred = Promise.defer();
- let results = [];
- FormHistory.search(terms, params,
- { handleResult: result => results.push(result),
- handleError: function (error) {
- do_throw("Error occurred searching form history: " + error);
- deferred.reject(error);
- },
- handleCompletion: function (reason) { if (!reason) deferred.resolve(results); }
- });
- return deferred.promise;
-}
-
-function promiseCountEntries(name, value, checkFn)
-{
- let deferred = Promise.defer();
- countEntries(name, value, function (result) { checkFn(result); deferred.resolve(); } );
- return deferred.promise;
-}
-
-add_task(function* ()
-{
- let oldSupportsDeletedTable = FormHistory._supportsDeletedTable;
- FormHistory._supportsDeletedTable = true;
-
- try {
-
- // ===== test init =====
- var testfile = do_get_file("formhistory_apitest.sqlite");
- var profileDir = dirSvc.get("ProfD", Ci.nsIFile);
-
- // Cleanup from any previous tests or failures.
- var destFile = profileDir.clone();
- destFile.append("formhistory.sqlite");
- if (destFile.exists())
- destFile.remove(false);
-
- testfile.copyTo(profileDir, "formhistory.sqlite");
-
- function checkExists(num) { do_check_true(num > 0); }
- function checkNotExists(num) { do_check_true(num == 0); }
-
- // ===== 1 =====
- // Check initial state is as expected
- testnum++;
- yield promiseCountEntries("name-A", null, checkExists);
- yield promiseCountEntries("name-B", null, checkExists);
- yield promiseCountEntries("name-C", null, checkExists);
- yield promiseCountEntries("name-D", null, checkExists);
- yield promiseCountEntries("name-A", "value-A", checkExists);
- yield promiseCountEntries("name-B", "value-B1", checkExists);
- yield promiseCountEntries("name-B", "value-B2", checkExists);
- yield promiseCountEntries("name-C", "value-C", checkExists);
- yield promiseCountEntries("name-D", "value-D", checkExists);
- // time-A/B/C/D checked below.
-
- // Delete anything from the deleted table
- let dbFile = Services.dirsvc.get("ProfD", Ci.nsIFile).clone();
- dbFile.append("formhistory.sqlite");
- dbConnection = Services.storage.openUnsharedDatabase(dbFile);
-
- let deferred = Promise.defer();
-
- let stmt = dbConnection.createAsyncStatement("DELETE FROM moz_deleted_formhistory");
- stmt.executeAsync({
- handleResult: function(resultSet) { },
- handleError : function () {
- do_throw("Error occurred counting deleted all entries: " + error);
- },
- handleCompletion : function () {
- stmt.finalize();
- deferred.resolve();
- }
- });
- yield deferred.promise;
-
- // ===== 2 =====
- // Test looking for nonexistent / bogus data.
- testnum++;
- yield promiseCountEntries("blah", null, checkNotExists);
- yield promiseCountEntries("", null, checkNotExists);
- yield promiseCountEntries("name-A", "blah", checkNotExists);
- yield promiseCountEntries("name-A", "", checkNotExists);
- yield promiseCountEntries("name-A", null, checkExists);
- yield promiseCountEntries("blah", "value-A", checkNotExists);
- yield promiseCountEntries("", "value-A", checkNotExists);
- yield promiseCountEntries(null, "value-A", checkExists);
-
- // Cannot use promiseCountEntries when name and value are null because it treats null values as not set
- // and here a search should be done explicity for null.
- deferred = Promise.defer();
- yield FormHistory.count({ fieldname: null, value: null },
- { handleResult: result => checkNotExists(result),
- handleError: function (error) {
- do_throw("Error occurred searching form history: " + error);
- },
- handleCompletion: function(reason) { if (!reason) deferred.resolve() }
- });
- yield deferred.promise;
-
- // ===== 3 =====
- // Test removeEntriesForName with a single matching value
- testnum++;
- yield promiseUpdateEntry("remove", "name-A", null);
-
- yield promiseCountEntries("name-A", "value-A", checkNotExists);
- yield promiseCountEntries("name-B", "value-B1", checkExists);
- yield promiseCountEntries("name-B", "value-B2", checkExists);
- yield promiseCountEntries("name-C", "value-C", checkExists);
- yield promiseCountEntries("name-D", "value-D", checkExists);
- yield countDeletedEntries(1);
-
- // ===== 4 =====
- // Test removeEntriesForName with multiple matching values
- testnum++;
- yield promiseUpdateEntry("remove", "name-B", null);
-
- yield promiseCountEntries("name-A", "value-A", checkNotExists);
- yield promiseCountEntries("name-B", "value-B1", checkNotExists);
- yield promiseCountEntries("name-B", "value-B2", checkNotExists);
- yield promiseCountEntries("name-C", "value-C", checkExists);
- yield promiseCountEntries("name-D", "value-D", checkExists);
- yield countDeletedEntries(3);
-
- // ===== 5 =====
- // Test removing by time range (single entry, not surrounding entries)
- testnum++;
- yield promiseCountEntries("time-A", null, checkExists); // firstUsed=1000, lastUsed=1000
- yield promiseCountEntries("time-B", null, checkExists); // firstUsed=1000, lastUsed=1099
- yield promiseCountEntries("time-C", null, checkExists); // firstUsed=1099, lastUsed=1099
- yield promiseCountEntries("time-D", null, checkExists); // firstUsed=2001, lastUsed=2001
- yield promiseUpdate({ op : "remove", firstUsedStart: 1050, firstUsedEnd: 2000 });
-
- yield promiseCountEntries("time-A", null, checkExists);
- yield promiseCountEntries("time-B", null, checkExists);
- yield promiseCountEntries("time-C", null, checkNotExists);
- yield promiseCountEntries("time-D", null, checkExists);
- yield countDeletedEntries(4);
-
- // ===== 6 =====
- // Test removing by time range (multiple entries)
- testnum++;
- yield promiseUpdate({ op : "remove", firstUsedStart: 1000, firstUsedEnd: 2000 });
-
- yield promiseCountEntries("time-A", null, checkNotExists);
- yield promiseCountEntries("time-B", null, checkNotExists);
- yield promiseCountEntries("time-C", null, checkNotExists);
- yield promiseCountEntries("time-D", null, checkExists);
- yield countDeletedEntries(6);
-
- // ===== 7 =====
- // test removeAllEntries
- testnum++;
- yield promiseUpdateEntry("remove", null, null);
-
- yield promiseCountEntries("name-C", null, checkNotExists);
- yield promiseCountEntries("name-D", null, checkNotExists);
- yield promiseCountEntries("name-C", "value-C", checkNotExists);
- yield promiseCountEntries("name-D", "value-D", checkNotExists);
-
- yield promiseCountEntries(null, null, checkNotExists);
- yield countDeletedEntries(6);
-
- // ===== 8 =====
- // Add a single entry back
- testnum++;
- yield promiseUpdateEntry("add", "newname-A", "newvalue-A");
- yield promiseCountEntries("newname-A", "newvalue-A", checkExists);
-
- // ===== 9 =====
- // Remove the single entry
- testnum++;
- yield promiseUpdateEntry("remove", "newname-A", "newvalue-A");
- yield promiseCountEntries("newname-A", "newvalue-A", checkNotExists);
-
- // ===== 10 =====
- // Add a single entry
- testnum++;
- yield promiseUpdateEntry("add", "field1", "value1");
- yield promiseCountEntries("field1", "value1", checkExists);
-
- let processFirstResult = function processResults(results)
- {
- // Only handle the first result
- if (results.length > 0) {
- let result = results[0];
- return [result.timesUsed, result.firstUsed, result.lastUsed, result.guid];
- }
- return undefined;
- }
-
- results = yield promiseSearchEntries(["timesUsed", "firstUsed", "lastUsed"],
- { fieldname: "field1", value: "value1" });
- let [timesUsed, firstUsed, lastUsed] = processFirstResult(results);
- do_check_eq(1, timesUsed);
- do_check_true(firstUsed > 0);
- do_check_true(lastUsed > 0);
- yield promiseCountEntries(null, null, num => do_check_eq(num, 1));
-
- // ===== 11 =====
- // Add another single entry
- testnum++;
- yield promiseUpdateEntry("add", "field1", "value1b");
- yield promiseCountEntries("field1", "value1", checkExists);
- yield promiseCountEntries("field1", "value1b", checkExists);
- yield promiseCountEntries(null, null, num => do_check_eq(num, 2));
-
- // ===== 12 =====
- // Update a single entry
- testnum++;
-
- results = yield promiseSearchEntries(["guid"], { fieldname: "field1", value: "value1" });
- let guid = processFirstResult(results)[3];
-
- yield promiseUpdate({ op : "update", guid: guid, value: "modifiedValue" });
- yield promiseCountEntries("field1", "modifiedValue", checkExists);
- yield promiseCountEntries("field1", "value1", checkNotExists);
- yield promiseCountEntries("field1", "value1b", checkExists);
- yield promiseCountEntries(null, null, num => do_check_eq(num, 2));
-
- // ===== 13 =====
- // Add a single entry with times
- testnum++;
- yield promiseUpdate({ op : "add", fieldname: "field2", value: "value2",
- timesUsed: 20, firstUsed: 100, lastUsed: 500 });
-
- results = yield promiseSearchEntries(["timesUsed", "firstUsed", "lastUsed"],
- { fieldname: "field2", value: "value2" });
- [timesUsed, firstUsed, lastUsed] = processFirstResult(results);
-
- do_check_eq(20, timesUsed);
- do_check_eq(100, firstUsed);
- do_check_eq(500, lastUsed);
- yield promiseCountEntries(null, null, num => do_check_eq(num, 3));
-
- // ===== 14 =====
- // Bump an entry, which updates its lastUsed field
- testnum++;
- yield promiseUpdate({ op : "bump", fieldname: "field2", value: "value2",
- timesUsed: 20, firstUsed: 100, lastUsed: 500 });
- results = yield promiseSearchEntries(["timesUsed", "firstUsed", "lastUsed"],
- { fieldname: "field2", value: "value2" });
- [timesUsed, firstUsed, lastUsed] = processFirstResult(results);
- do_check_eq(21, timesUsed);
- do_check_eq(100, firstUsed);
- do_check_true(lastUsed > 500);
- yield promiseCountEntries(null, null, num => do_check_eq(num, 3));
-
- // ===== 15 =====
- // Bump an entry that does not exist
- testnum++;
- yield promiseUpdate({ op : "bump", fieldname: "field3", value: "value3",
- timesUsed: 10, firstUsed: 50, lastUsed: 400 });
- results = yield promiseSearchEntries(["timesUsed", "firstUsed", "lastUsed"],
- { fieldname: "field3", value: "value3" });
- [timesUsed, firstUsed, lastUsed] = processFirstResult(results);
- do_check_eq(10, timesUsed);
- do_check_eq(50, firstUsed);
- do_check_eq(400, lastUsed);
- yield promiseCountEntries(null, null, num => do_check_eq(num, 4));
-
- // ===== 16 =====
- // Bump an entry with a guid
- testnum++;
- results = yield promiseSearchEntries(["guid"], { fieldname: "field3", value: "value3" });
- guid = processFirstResult(results)[3];
- yield promiseUpdate({ op : "bump", guid: guid, timesUsed: 20, firstUsed: 55, lastUsed: 400 });
- results = yield promiseSearchEntries(["timesUsed", "firstUsed", "lastUsed"],
- { fieldname: "field3", value: "value3" });
- [timesUsed, firstUsed, lastUsed] = processFirstResult(results);
- do_check_eq(11, timesUsed);
- do_check_eq(50, firstUsed);
- do_check_true(lastUsed > 400);
- yield promiseCountEntries(null, null, num => do_check_eq(num, 4));
-
- // ===== 17 =====
- // Remove an entry
- testnum++;
- yield countDeletedEntries(7);
-
- results = yield promiseSearchEntries(["guid"], { fieldname: "field1", value: "value1b" });
- guid = processFirstResult(results)[3];
-
- yield promiseUpdate({ op : "remove", guid: guid});
- yield promiseCountEntries("field1", "modifiedValue", checkExists);
- yield promiseCountEntries("field1", "value1b", checkNotExists);
- yield promiseCountEntries(null, null, num => do_check_eq(num, 3));
-
- yield countDeletedEntries(8);
- yield checkTimeDeleted(guid, timeDeleted => do_check_true(timeDeleted > 10000));
-
- // ===== 18 =====
- // Add yet another single entry
- testnum++;
- yield promiseUpdate({ op : "add", fieldname: "field4", value: "value4",
- timesUsed: 5, firstUsed: 230, lastUsed: 600 });
- yield promiseCountEntries(null, null, num => do_check_eq(num, 4));
-
- // ===== 19 =====
- // Remove an entry by time
- testnum++;
- yield promiseUpdate({ op : "remove", firstUsedStart: 60, firstUsedEnd: 250 });
- yield promiseCountEntries("field1", "modifiedValue", checkExists);
- yield promiseCountEntries("field2", "value2", checkNotExists);
- yield promiseCountEntries("field3", "value3", checkExists);
- yield promiseCountEntries("field4", "value4", checkNotExists);
- yield promiseCountEntries(null, null, num => do_check_eq(num, 2));
- yield countDeletedEntries(10);
-
- // ===== 20 =====
- // Bump multiple existing entries at once
- testnum++;
-
- yield promiseUpdate([{ op : "add", fieldname: "field5", value: "value5",
- timesUsed: 5, firstUsed: 230, lastUsed: 600 },
- { op : "add", fieldname: "field6", value: "value6",
- timesUsed: 12, firstUsed: 430, lastUsed: 700 }]);
- yield promiseCountEntries(null, null, num => do_check_eq(num, 4));
-
- yield promiseUpdate([
- { op : "bump", fieldname: "field5", value: "value5" },
- { op : "bump", fieldname: "field6", value: "value6" }]);
- results = yield promiseSearchEntries(["fieldname", "timesUsed", "firstUsed", "lastUsed"], { });
-
- do_check_eq(6, results[2].timesUsed);
- do_check_eq(13, results[3].timesUsed);
- do_check_eq(230, results[2].firstUsed);
- do_check_eq(430, results[3].firstUsed);
- do_check_true(results[2].lastUsed > 600);
- do_check_true(results[3].lastUsed > 700);
-
- yield promiseCountEntries(null, null, num => do_check_eq(num, 4));
-
- // ===== 21 =====
- // Check update fails if form history is disabled and the operation is not a
- // pure removal.
- testnum++;
- Services.prefs.setBoolPref("browser.formfill.enable", false);
-
- // Cannot use arrow functions, see bug 1237961.
- Assert.rejects(promiseUpdate(
- { op : "bump", fieldname: "field5", value: "value5" }),
- function(err) { return err.result == Ci.mozIStorageError.MISUSE; },
- "bumping when form history is disabled should fail");
- Assert.rejects(promiseUpdate(
- { op : "add", fieldname: "field5", value: "value5" }),
- function(err) { return err.result == Ci.mozIStorageError.MISUSE; },
- "Adding when form history is disabled should fail");
- Assert.rejects(promiseUpdate([
- { op : "update", fieldname: "field5", value: "value5" },
- { op : "remove", fieldname: "field5", value: "value5" }
- ]),
- function(err) { return err.result == Ci.mozIStorageError.MISUSE; },
- "mixed operations when form history is disabled should fail");
- Assert.rejects(promiseUpdate([
- null, undefined, "", 1, {},
- { op : "remove", fieldname: "field5", value: "value5" }
- ]),
- function(err) { return err.result == Ci.mozIStorageError.MISUSE; },
- "Invalid entries when form history is disabled should fail");
-
- // Remove should work though.
- yield promiseUpdate([{ op: "remove", fieldname: "field5", value: null },
- { op: "remove", fieldname: null, value: null }]);
- Services.prefs.clearUserPref("browser.formfill.enable");
-
- } catch (e) {
- throw "FAILED in test #" + testnum + " -- " + e;
- }
- finally {
- FormHistory._supportsDeletedTable = oldSupportsDeletedTable;
- dbConnection.asyncClose(do_test_finished);
- }
-});
-
-function run_test() {
- return run_next_test();
-}
diff --git a/toolkit/components/satchel/test/unit/test_notify.js b/toolkit/components/satchel/test/unit/test_notify.js
deleted file mode 100644
index 556ecd4b0..000000000
--- a/toolkit/components/satchel/test/unit/test_notify.js
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Test suite for satchel notifications
- *
- * Tests notifications dispatched when modifying form history.
- *
- */
-
-var expectedNotification;
-var expectedData;
-
-var TestObserver = {
- QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
-
- observe : function (subject, topic, data) {
- do_check_eq(topic, "satchel-storage-changed");
- do_check_eq(data, expectedNotification);
-
- switch (data) {
- case "formhistory-add":
- case "formhistory-update":
- do_check_true(subject instanceof Ci.nsISupportsString);
- do_check_true(isGUID.test(subject.toString()));
- break;
- case "formhistory-remove":
- do_check_eq(null, subject);
- break;
- default:
- do_throw("Unhandled notification: " + data + " / " + topic);
- }
-
- expectedNotification = null;
- expectedData = null;
- }
-};
-
-var testIterator = null;
-
-function run_test() {
- do_test_pending();
- testIterator = run_test_steps();
- testIterator.next();
-}
-
-function next_test()
-{
- testIterator.next();
-}
-
-function* run_test_steps() {
-
-try {
-
-var testnum = 0;
-var testdesc = "Setup of test form history entries";
-
-var entry1 = ["entry1", "value1"];
-
-/* ========== 1 ========== */
-testnum = 1;
-testdesc = "Initial connection to storage module"
-
-yield updateEntry("remove", null, null, next_test);
-yield countEntries(null, null, function (num) { do_check_false(num, "Checking initial DB is empty"); next_test(); });
-
-// Add the observer
-var os = Cc["@mozilla.org/observer-service;1"].
- getService(Ci.nsIObserverService);
-os.addObserver(TestObserver, "satchel-storage-changed", false);
-
-/* ========== 2 ========== */
-testnum++;
-testdesc = "addEntry";
-
-expectedNotification = "formhistory-add";
-expectedData = entry1;
-
-yield updateEntry("add", entry1[0], entry1[1], next_test);
-do_check_eq(expectedNotification, null); // check that observer got a notification
-
-yield countEntries(entry1[0], entry1[1], function (num) { do_check_true(num > 0); next_test(); });
-
-/* ========== 3 ========== */
-testnum++;
-testdesc = "modifyEntry";
-
-expectedNotification = "formhistory-update";
-expectedData = entry1;
-// will update previous entry
-yield updateEntry("update", entry1[0], entry1[1], next_test);
-yield countEntries(entry1[0], entry1[1], function (num) { do_check_true(num > 0); next_test(); });
-
-do_check_eq(expectedNotification, null);
-
-/* ========== 4 ========== */
-testnum++;
-testdesc = "removeEntry";
-
-expectedNotification = "formhistory-remove";
-expectedData = entry1;
-yield updateEntry("remove", entry1[0], entry1[1], next_test);
-
-do_check_eq(expectedNotification, null);
-yield countEntries(entry1[0], entry1[1], function(num) { do_check_false(num, "doesn't exist after remove"); next_test(); });
-
-/* ========== 5 ========== */
-testnum++;
-testdesc = "removeAllEntries";
-
-expectedNotification = "formhistory-remove";
-expectedData = null; // no data expected
-yield updateEntry("remove", null, null, next_test);
-
-do_check_eq(expectedNotification, null);
-
-/* ========== 6 ========== */
-testnum++;
-testdesc = "removeAllEntries (again)";
-
-expectedNotification = "formhistory-remove";
-expectedData = null;
-yield updateEntry("remove", null, null, next_test);
-
-do_check_eq(expectedNotification, null);
-
-/* ========== 7 ========== */
-testnum++;
-testdesc = "removeEntriesForName";
-
-expectedNotification = "formhistory-remove";
-expectedData = "field2";
-yield updateEntry("remove", null, "field2", next_test);
-
-do_check_eq(expectedNotification, null);
-
-/* ========== 8 ========== */
-testnum++;
-testdesc = "removeEntriesByTimeframe";
-
-expectedNotification = "formhistory-remove";
-expectedData = [10, 99999999999];
-
-yield FormHistory.update({ op: "remove", firstUsedStart: expectedData[0], firstUsedEnd: expectedData[1] },
- { handleCompletion: function(reason) { if (!reason) next_test() },
- handleErrors: function (error) {
- do_throw("Error occurred updating form history: " + error);
- }
- });
-
-do_check_eq(expectedNotification, null);
-
-os.removeObserver(TestObserver, "satchel-storage-changed", false);
-
-do_test_finished();
-
-} catch (e) {
- throw "FAILED in test #" + testnum + " -- " + testdesc + ": " + e;
-}
-}
diff --git a/toolkit/components/satchel/test/unit/test_previous_result.js b/toolkit/components/satchel/test/unit/test_previous_result.js
deleted file mode 100644
index 06e5a385b..000000000
--- a/toolkit/components/satchel/test/unit/test_previous_result.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var aaaListener = {
- onSearchResult: function(search, result) {
- do_check_eq(result.searchString, "aaa");
- do_test_finished();
- }
-};
-
-var aaListener = {
- onSearchResult: function(search, result) {
- do_check_eq(result.searchString, "aa");
- search.startSearch("aaa", "", result, aaaListener);
- }
-};
-
-function run_test()
-{
- do_test_pending();
- let search = Cc['@mozilla.org/autocomplete/search;1?name=form-history'].
- getService(Components.interfaces.nsIAutoCompleteSearch);
- search.startSearch("aa", "", null, aaListener);
-}
diff --git a/toolkit/components/satchel/test/unit/xpcshell.ini b/toolkit/components/satchel/test/unit/xpcshell.ini
deleted file mode 100644
index 4a41b47d6..000000000
--- a/toolkit/components/satchel/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,26 +0,0 @@
-[DEFAULT]
-head = head_satchel.js
-tail =
-skip-if = toolkit == 'android'
-support-files =
- asyncformhistory_expire.sqlite
- formhistory_1000.sqlite
- formhistory_CORRUPT.sqlite
- formhistory_apitest.sqlite
- formhistory_autocomplete.sqlite
- formhistory_v3.sqlite
- formhistory_v3v4.sqlite
- formhistory_v999a.sqlite
- formhistory_v999b.sqlite
- perf_autocomplete.js
-
-[test_async_expire.js]
-[test_autocomplete.js]
-[test_db_corrupt.js]
-[test_db_update_v4.js]
-[test_db_update_v4b.js]
-[test_db_update_v999a.js]
-[test_db_update_v999b.js]
-[test_history_api.js]
-[test_notify.js]
-[test_previous_result.js]
diff --git a/toolkit/components/search/nsSearchService.js b/toolkit/components/search/nsSearchService.js
index f6303bca1..f3e8b94a7 100644
--- a/toolkit/components/search/nsSearchService.js
+++ b/toolkit/components/search/nsSearchService.js
@@ -2213,32 +2213,8 @@ Engine.prototype = {
this.lazySerializeTask.arm();
},
-#ifdef ANDROID
- get _defaultMobileResponseType() {
- let type = URLTYPE_SEARCH_HTML;
-
- let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
- let isTablet = sysInfo.get("tablet");
- if (isTablet && this.supportsResponseType("application/x-moz-tabletsearch")) {
- // Check for a tablet-specific search URL override
- type = "application/x-moz-tabletsearch";
- } else if (!isTablet && this.supportsResponseType("application/x-moz-phonesearch")) {
- // Check for a phone-specific search URL override
- type = "application/x-moz-phonesearch";
- }
-
- delete this._defaultMobileResponseType;
- return this._defaultMobileResponseType = type;
- },
-#endif
-
// from nsISearchEngine
getSubmission: function SRCH_ENG_getSubmission(aData, aResponseType, aPurpose) {
-#ifdef ANDROID
- if (!aResponseType) {
- aResponseType = this._defaultMobileResponseType;
- }
-#endif
if (!aResponseType) {
aResponseType = URLTYPE_SEARCH_HTML;
}
@@ -2272,11 +2248,6 @@ Engine.prototype = {
// from nsISearchEngine
getResultDomain: function SRCH_ENG_getResultDomain(aResponseType) {
-#ifdef ANDROID
- if (!aResponseType) {
- aResponseType = this._defaultMobileResponseType;
- }
-#endif
if (!aResponseType) {
aResponseType = URLTYPE_SEARCH_HTML;
}
@@ -2293,11 +2264,7 @@ Engine.prototype = {
* Returns URL parsing properties used by _buildParseSubmissionMap.
*/
getURLParsingInfo: function () {
-#ifdef ANDROID
- let responseType = this._defaultMobileResponseType;
-#else
let responseType = URLTYPE_SEARCH_HTML;
-#endif
LOG("getURLParsingInfo: responseType: \"" + responseType + "\"");
diff --git a/toolkit/components/social/test/xpcshell/.eslintrc.js b/toolkit/components/social/test/xpcshell/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/social/test/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/sqlite/moz.build b/toolkit/components/sqlite/moz.build
deleted file mode 100644
index bbe5b8b96..000000000
--- a/toolkit/components/sqlite/moz.build
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
-
-EXTRA_JS_MODULES.sqlite += [
- 'sqlite_internal.js',
-]
diff --git a/toolkit/components/sqlite/sqlite_internal.js b/toolkit/components/sqlite/sqlite_internal.js
deleted file mode 100644
index 18b07ff50..000000000
--- a/toolkit/components/sqlite/sqlite_internal.js
+++ /dev/null
@@ -1,323 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * This file defines an Sqlite object containing js-ctypes bindings for
- * sqlite3. It should be included from a worker thread using require.
- *
- * It serves the following purposes:
- * - opens libxul;
- * - defines sqlite3 API functions;
- * - defines the necessary sqlite3 types.
- */
-
-"use strict";
-
-importScripts("resource://gre/modules/workers/require.js");
-
-var SharedAll = require(
- "resource://gre/modules/osfile/osfile_shared_allthreads.jsm");
-
-// Open the sqlite3 library.
-var path;
-if (SharedAll.Constants.Sys.Name === "Android") {
- path = ctypes.libraryName("sqlite3");
-} else if (SharedAll.Constants.Win) {
- path = ctypes.libraryName("nss3");
-} else {
- path = SharedAll.Constants.Path.libxul;
-}
-
-var lib;
-try {
- lib = ctypes.open(path);
-} catch (ex) {
- throw new Error("Could not open system library: " + ex.message);
-}
-
-var declareLazyFFI = SharedAll.declareLazyFFI;
-
-var Type = Object.create(SharedAll.Type);
-
-/**
- * Opaque Structure |sqlite3_ptr|.
- * |sqlite3_ptr| is equivalent to a void*.
- */
-Type.sqlite3_ptr = Type.voidptr_t.withName("sqlite3_ptr");
-
-/**
- * |sqlite3_stmt_ptr| an instance of an object representing a single SQL
- * statement.
- * |sqlite3_stmt_ptr| is equivalent to a void*.
- */
-Type.sqlite3_stmt_ptr = Type.voidptr_t.withName("sqlite3_stmt_ptr");
-
-/**
- * |sqlite3_destructor_ptr| a constant defining a special destructor behaviour.
- * |sqlite3_destructor_ptr| is equivalent to a void*.
- */
-Type.sqlite3_destructor_ptr = Type.voidptr_t.withName(
- "sqlite3_destructor_ptr");
-
-/**
- * A C double.
- */
-Type.double = new SharedAll.Type("double", ctypes.double);
-
-/**
- * |sqlite3_int64| typedef for 64-bit integer.
- */
-Type.sqlite3_int64 = Type.int64_t.withName("sqlite3_int64");
-
-/**
- * Sqlite3 constants.
- */
-var Constants = {};
-
-/**
- * |SQLITE_STATIC| a special value for the destructor that is passed as an
- * argument to routines like bind_blob, bind_text and bind_text16. It means that
- * the content pointer is constant and will never change and does need to be
- * destroyed.
- */
-Constants.SQLITE_STATIC = Type.sqlite3_destructor_ptr.implementation(0);
-
-/**
- * |SQLITE_TRANSIENT| a special value for the destructor that is passed as an
- * argument to routines like bind_blob, bind_text and bind_text16. It means that
- * the content will likely change in the near future and that SQLite should make
- * its own private copy of the content before returning.
- */
-Constants.SQLITE_TRANSIENT = Type.sqlite3_destructor_ptr.implementation(-1);
-
-/**
- * |SQLITE_OK|
- * Successful result.
- */
-Constants.SQLITE_OK = 0;
-
-/**
- * |SQLITE_ROW|
- * sqlite3_step() has another row ready.
- */
-Constants.SQLITE_ROW = 100;
-
-/**
- * |SQLITE_DONE|
- * sqlite3_step() has finished executing.
- */
-Constants.SQLITE_DONE = 101;
-
-var Sqlite3 = {
- Constants: Constants,
- Type: Type
-};
-
-declareLazyFFI(Sqlite3, "open", lib, "sqlite3_open", null,
- /* return*/ Type.int,
- /* path*/ Type.char.in_ptr,
- /* db handle*/ Type.sqlite3_ptr.out_ptr);
-
-declareLazyFFI(Sqlite3, "open_v2", lib, "sqlite3_open_v2", null,
- /* return*/ Type.int,
- /* path*/ Type.char.in_ptr,
- /* db handle*/ Type.sqlite3_ptr.out_ptr,
- /* flags*/ Type.int,
- /* VFS*/ Type.char.in_ptr);
-
-declareLazyFFI(Sqlite3, "close", lib, "sqlite3_close", null,
- /* return*/ Type.int,
- /* db handle*/ Type.sqlite3_ptr);
-
-declareLazyFFI(Sqlite3, "prepare_v2", lib, "sqlite3_prepare_v2", null,
- /* return*/ Type.int,
- /* db handle*/ Type.sqlite3_ptr,
- /* zSql*/ Type.char.in_ptr,
- /* nByte*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr.out_ptr,
- /* unused*/ Type.cstring.out_ptr);
-
-declareLazyFFI(Sqlite3, "step", lib, "sqlite3_step", null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr);
-
-declareLazyFFI(Sqlite3, "finalize", lib, "sqlite3_finalize", null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr);
-
-declareLazyFFI(Sqlite3, "reset", lib, "sqlite3_reset", null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr);
-
-declareLazyFFI(Sqlite3, "column_int", lib, "sqlite3_column_int", null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* col*/ Type.int);
-
-declareLazyFFI(Sqlite3, "column_blob", lib, "sqlite3_column_blob", null,
- /* return*/ Type.voidptr_t,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* col*/ Type.int);
-
-declareLazyFFI(Sqlite3, "column_bytes", lib, "sqlite3_column_bytes", null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* col*/ Type.int);
-
-declareLazyFFI(Sqlite3, "column_bytes16", lib, "sqlite3_column_bytes16",
- null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* col*/ Type.int);
-
-declareLazyFFI(Sqlite3, "column_double", lib, "sqlite3_column_double", null,
- /* return*/ Type.double,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* col*/ Type.int);
-
-declareLazyFFI(Sqlite3, "column_int64", lib, "sqlite3_column_int64", null,
- /* return*/ Type.sqlite3_int64,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* col*/ Type.int);
-
-declareLazyFFI(Sqlite3, "column_text", lib, "sqlite3_column_text", null,
- /* return*/ Type.cstring,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* col*/ Type.int);
-
-declareLazyFFI(Sqlite3, "column_text16", lib, "sqlite3_column_text16", null,
- /* return*/ Type.wstring,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* col*/ Type.int);
-
-declareLazyFFI(Sqlite3, "bind_int", lib, "sqlite3_bind_int", null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* index*/ Type.int,
- /* value*/ Type.int);
-
-declareLazyFFI(Sqlite3, "bind_int64", lib, "sqlite3_bind_int64", null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* index*/ Type.int,
- /* value*/ Type.sqlite3_int64);
-
-declareLazyFFI(Sqlite3, "bind_double", lib, "sqlite3_bind_double", null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* index*/ Type.int,
- /* value*/ Type.double);
-
-declareLazyFFI(Sqlite3, "bind_null", lib, "sqlite3_bind_null", null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* index*/ Type.int);
-
-declareLazyFFI(Sqlite3, "bind_zeroblob", lib, "sqlite3_bind_zeroblob", null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* index*/ Type.int,
- /* nBytes*/ Type.int);
-
-declareLazyFFI(Sqlite3, "bind_text", lib, "sqlite3_bind_text", null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* index*/ Type.int,
- /* value*/ Type.cstring,
- /* nBytes*/ Type.int,
- /* destructor*/ Type.sqlite3_destructor_ptr);
-
-declareLazyFFI(Sqlite3, "bind_text16", lib, "sqlite3_bind_text16", null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* index*/ Type.int,
- /* value*/ Type.wstring,
- /* nBytes*/ Type.int,
- /* destructor*/ Type.sqlite3_destructor_ptr);
-
-declareLazyFFI(Sqlite3, "bind_blob", lib, "sqlite3_bind_blob", null,
- /* return*/ Type.int,
- /* statement*/ Type.sqlite3_stmt_ptr,
- /* index*/ Type.int,
- /* value*/ Type.voidptr_t,
- /* nBytes*/ Type.int,
- /* destructor*/ Type.sqlite3_destructor_ptr);
-
-module.exports = {
- get Constants() {
- return Sqlite3.Constants;
- },
- get Type() {
- return Sqlite3.Type;
- },
- get open() {
- return Sqlite3.open;
- },
- get open_v2() {
- return Sqlite3.open_v2;
- },
- get close() {
- return Sqlite3.close;
- },
- get prepare_v2() {
- return Sqlite3.prepare_v2;
- },
- get step() {
- return Sqlite3.step;
- },
- get finalize() {
- return Sqlite3.finalize;
- },
- get reset() {
- return Sqlite3.reset;
- },
- get column_int() {
- return Sqlite3.column_int;
- },
- get column_blob() {
- return Sqlite3.column_blob;
- },
- get column_bytes() {
- return Sqlite3.column_bytes;
- },
- get column_bytes16() {
- return Sqlite3.column_bytes16;
- },
- get column_double() {
- return Sqlite3.column_double;
- },
- get column_int64() {
- return Sqlite3.column_int64;
- },
- get column_text() {
- return Sqlite3.column_text;
- },
- get column_text16() {
- return Sqlite3.column_text16;
- },
- get bind_int() {
- return Sqlite3.bind_int;
- },
- get bind_int64() {
- return Sqlite3.bind_int64;
- },
- get bind_double() {
- return Sqlite3.bind_double;
- },
- get bind_null() {
- return Sqlite3.bind_null;
- },
- get bind_zeroblob() {
- return Sqlite3.bind_zeroblob;
- },
- get bind_text() {
- return Sqlite3.bind_text;
- },
- get bind_text16() {
- return Sqlite3.bind_text16;
- },
- get bind_blob() {
- return Sqlite3.bind_blob;
- }
-};
diff --git a/toolkit/components/sqlite/tests/xpcshell/.eslintrc.js b/toolkit/components/sqlite/tests/xpcshell/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/sqlite/tests/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/sqlite/tests/xpcshell/data/chrome.manifest b/toolkit/components/sqlite/tests/xpcshell/data/chrome.manifest
deleted file mode 100644
index 92b9cf60b..000000000
--- a/toolkit/components/sqlite/tests/xpcshell/data/chrome.manifest
+++ /dev/null
@@ -1 +0,0 @@
-content test_sqlite_internal ./
diff --git a/toolkit/components/sqlite/tests/xpcshell/data/worker_sqlite_internal.js b/toolkit/components/sqlite/tests/xpcshell/data/worker_sqlite_internal.js
deleted file mode 100644
index 7f0b3af03..000000000
--- a/toolkit/components/sqlite/tests/xpcshell/data/worker_sqlite_internal.js
+++ /dev/null
@@ -1,279 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-importScripts("worker_sqlite_shared.js",
- "resource://gre/modules/workers/require.js");
-
-self.onmessage = function onmessage(msg) {
- try {
- run_test();
- } catch (ex) {
- let {message, moduleStack, moduleName, lineNumber} = ex;
- let error = new Error(message, moduleName, lineNumber);
- error.stack = moduleStack;
- dump("Uncaught error: " + error + "\n");
- dump("Full stack: " + moduleStack + "\n");
- throw error;
- }
-};
-
-var Sqlite;
-
-var SQLITE_OK; /* Successful result */
-var SQLITE_ROW; /* sqlite3_step() has another row ready */
-var SQLITE_DONE; /* sqlite3_step() has finished executing */
-
-function test_init() {
- do_print("Starting test_init");
- // Sqlite should be loaded.
- Sqlite = require("resource://gre/modules/sqlite/sqlite_internal.js");
- do_check_neq(typeof Sqlite, "undefined");
- do_check_neq(typeof Sqlite.Constants, "undefined");
- SQLITE_OK = Sqlite.Constants.SQLITE_OK;
- SQLITE_ROW = Sqlite.Constants.SQLITE_ROW;
- SQLITE_DONE = Sqlite.Constants.SQLITE_DONE;
-}
-
-/**
- * Clean up the database.
- * @param {sqlite3_ptr} db A pointer to the database.
- */
-function cleanupDB(db) {
- withQuery(db, "DROP TABLE IF EXISTS TEST;", SQLITE_DONE);
-}
-
-/**
- * Open and close sqlite3 database.
- * @param {String} open A name of the sqlite3 open function to be
- * used.
- * @param {Array} openArgs = [] Optional arguments to open function.
- * @param {Function} callback = null An optional callback to be run after the
- * database is opened but before it is
- * closed.
- */
-function withDB(open, openArgs = [], callback = null) {
- let db = Sqlite.Type.sqlite3_ptr.implementation();
- let dbPtr = db.address();
-
- // Open database.
- let result = Sqlite[open].apply(Sqlite, ["data/test.db", dbPtr].concat(
- openArgs));
- do_check_eq(result, SQLITE_OK);
-
- // Drop the test table if it already exists.
- cleanupDB(db);
-
- try {
- if (callback) {
- callback(db);
- }
- } catch (ex) {
- do_check_true(false);
- throw ex;
- } finally {
- // Drop the test table if it still exists.
- cleanupDB(db);
- // Close data base.
- result = Sqlite.close(db);
- do_check_eq(result, SQLITE_OK);
- }
-}
-
-/**
- * Execute an SQL query using sqlite3 API.
- * @param {sqlite3_ptr} db A pointer to the database.
- * @param {String} sql A SQL query string.
- * @param {Number} stepResult Expected result code after evaluating the
- * SQL statement.
- * @param {Function} bind An optional callback with SQL binding steps.
- * @param {Function} callback An optional callback that runs after the SQL
- * query completes.
- */
-function withQuery(db, sql, stepResult, bind, callback) {
- // Create an instance of a single SQL statement.
- let sqlStmt = Sqlite.Type.sqlite3_stmt_ptr.implementation();
- let sqlStmtPtr = sqlStmt.address();
-
- // Unused portion of an SQL query.
- let unused = Sqlite.Type.cstring.implementation();
- let unusedPtr = unused.address();
-
- // Compile an SQL statement.
- let result = Sqlite.prepare_v2(db, sql, sql.length, sqlStmtPtr, unusedPtr);
- do_check_eq(result, SQLITE_OK);
-
- try {
- if (bind) {
- bind(sqlStmt);
- }
-
- // Evaluate an SQL statement.
- result = Sqlite.step(sqlStmt);
- do_check_eq(result, stepResult);
-
- if (callback) {
- callback(sqlStmt);
- }
- } catch (ex) {
- do_check_true(false);
- throw ex;
- } finally {
- // Destroy a prepared statement object.
- result = Sqlite.finalize(sqlStmt);
- do_check_eq(result, SQLITE_OK);
- }
-}
-
-function test_open_close() {
- do_print("Starting test_open_close");
- do_check_eq(typeof Sqlite.open, "function");
- do_check_eq(typeof Sqlite.close, "function");
-
- withDB("open");
-}
-
-function test_open_v2_close() {
- do_print("Starting test_open_v2_close");
- do_check_eq(typeof Sqlite.open_v2, "function");
-
- withDB("open_v2", [0x02, null]);
-}
-
-function createTableOnOpen(db) {
- withQuery(db, "CREATE TABLE TEST(" +
- "ID INT PRIMARY KEY NOT NULL," +
- "FIELD1 INT," +
- "FIELD2 REAL," +
- "FIELD3 TEXT," +
- "FIELD4 TEXT," +
- "FIELD5 BLOB" +
- ");", SQLITE_DONE);
-}
-
-function test_create_table() {
- do_print("Starting test_create_table");
- do_check_eq(typeof Sqlite.prepare_v2, "function");
- do_check_eq(typeof Sqlite.step, "function");
- do_check_eq(typeof Sqlite.finalize, "function");
-
- withDB("open", [], createTableOnOpen);
-}
-
-/**
- * Read column values after evaluating the SQL SELECT statement.
- * @param {sqlite3_stmt_ptr} sqlStmt A pointer to the SQL statement.
- */
-function onSqlite3Step(sqlStmt) {
- // Get an int value from a query result from the ID (column 0).
- let field = Sqlite.column_int(sqlStmt, 0);
- do_check_eq(field, 3);
-
- // Get an int value from a query result from the column 1.
- field = Sqlite.column_int(sqlStmt, 1);
- do_check_eq(field, 2);
- // Get an int64 value from a query result from the column 1.
- field = Sqlite.column_int64(sqlStmt, 1);
- do_check_eq(field, 2);
-
- // Get a double value from a query result from the column 2.
- field = Sqlite.column_double(sqlStmt, 2);
- do_check_eq(field, 1.2);
-
- // Get a number of bytes of the value in the column 3.
- let bytes = Sqlite.column_bytes(sqlStmt, 3);
- do_check_eq(bytes, 4);
- // Get a text(cstring) value from a query result from the column 3.
- field = Sqlite.column_text(sqlStmt, 3);
- do_check_eq(field.readString(), "DATA");
-
- // Get a number of bytes of the UTF-16 value in the column 4.
- bytes = Sqlite.column_bytes16(sqlStmt, 4);
- do_check_eq(bytes, 8);
- // Get a text16(wstring) value from a query result from the column 4.
- field = Sqlite.column_text16(sqlStmt, 4);
- do_check_eq(field.readString(), "TADA");
-
- // Get a blob value from a query result from the column 5.
- field = Sqlite.column_blob(sqlStmt, 5);
- do_check_eq(ctypes.cast(field,
- Sqlite.Type.cstring.implementation).readString(), "BLOB");
-}
-
-function test_insert_select() {
- do_print("Starting test_insert_select");
- do_check_eq(typeof Sqlite.column_int, "function");
- do_check_eq(typeof Sqlite.column_int64, "function");
- do_check_eq(typeof Sqlite.column_double, "function");
- do_check_eq(typeof Sqlite.column_bytes, "function");
- do_check_eq(typeof Sqlite.column_text, "function");
- do_check_eq(typeof Sqlite.column_text16, "function");
- do_check_eq(typeof Sqlite.column_blob, "function");
-
- function onOpen(db) {
- createTableOnOpen(db);
- withQuery(db,
- "INSERT INTO TEST VALUES (3, 2, 1.2, \"DATA\", \"TADA\", \"BLOB\");",
- SQLITE_DONE);
- withQuery(db, "SELECT * FROM TEST;", SQLITE_ROW, null, onSqlite3Step);
- }
-
- withDB("open", [], onOpen);
-}
-
-function test_insert_bind_select() {
- do_print("Starting test_insert_bind_select");
- do_check_eq(typeof Sqlite.bind_int, "function");
- do_check_eq(typeof Sqlite.bind_int64, "function");
- do_check_eq(typeof Sqlite.bind_double, "function");
- do_check_eq(typeof Sqlite.bind_text, "function");
- do_check_eq(typeof Sqlite.bind_text16, "function");
- do_check_eq(typeof Sqlite.bind_blob, "function");
-
- function onBind(sqlStmt) {
- // Bind an int value to the ID (column 0).
- let result = Sqlite.bind_int(sqlStmt, 1, 3);
- do_check_eq(result, SQLITE_OK);
-
- // Bind an int64 value to the FIELD1 (column 1).
- result = Sqlite.bind_int64(sqlStmt, 2, 2);
- do_check_eq(result, SQLITE_OK);
-
- // Bind a double value to the FIELD2 (column 2).
- result = Sqlite.bind_double(sqlStmt, 3, 1.2);
- do_check_eq(result, SQLITE_OK);
-
- // Destructor.
- let destructor = Sqlite.Constants.SQLITE_TRANSIENT;
- // Bind a text value to the FIELD3 (column 3).
- result = Sqlite.bind_text(sqlStmt, 4, "DATA", 4, destructor);
- do_check_eq(result, SQLITE_OK);
-
- // Bind a text16 value to the FIELD4 (column 4).
- result = Sqlite.bind_text16(sqlStmt, 5, "TADA", 8, destructor);
- do_check_eq(result, SQLITE_OK);
-
- // Bind a blob value to the FIELD5 (column 5).
- result = Sqlite.bind_blob(sqlStmt, 6, ctypes.char.array()("BLOB"), 4,
- destructor);
- do_check_eq(result, SQLITE_OK);
- }
-
- function onOpen(db) {
- createTableOnOpen(db);
- withQuery(db, "INSERT INTO TEST VALUES (?, ?, ?, ?, ?, ?);", SQLITE_DONE,
- onBind);
- withQuery(db, "SELECT * FROM TEST;", SQLITE_ROW, null, onSqlite3Step);
- }
-
- withDB("open", [], onOpen);
-}
-
-function run_test() {
- test_init();
- test_open_close();
- test_open_v2_close();
- test_create_table();
- test_insert_select();
- test_insert_bind_select();
- do_test_complete();
-}
diff --git a/toolkit/components/sqlite/tests/xpcshell/data/worker_sqlite_shared.js b/toolkit/components/sqlite/tests/xpcshell/data/worker_sqlite_shared.js
deleted file mode 100644
index 54351a02a..000000000
--- a/toolkit/components/sqlite/tests/xpcshell/data/worker_sqlite_shared.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function send(message) {
- self.postMessage(message);
-}
-
-function do_test_complete() {
- send({kind: "do_test_complete", args: []});
-}
-
-function do_check_true(x) {
- send({kind: "do_check_true", args: [!!x]});
- if (x) {
- dump("TEST-PASS: " + x + "\n");
- } else {
- throw new Error("do_check_true failed");
- }
-}
-
-function do_check_eq(a, b) {
- let result = a == b;
- send({kind: "do_check_true", args: [result]});
- if (!result) {
- throw new Error("do_check_eq failed " + a + " != " + b);
- }
-}
-
-function do_check_neq(a, b) {
- let result = a != b;
- send({kind: "do_check_true", args: [result]});
- if (!result) {
- throw new Error("do_check_neq failed " + a + " == " + b);
- }
-}
-
-function do_print(x) {
- dump("TEST-INFO: " + x + "\n");
-}
diff --git a/toolkit/components/sqlite/tests/xpcshell/test_sqlite_internal.js b/toolkit/components/sqlite/tests/xpcshell/test_sqlite_internal.js
deleted file mode 100644
index 725cbfaea..000000000
--- a/toolkit/components/sqlite/tests/xpcshell/test_sqlite_internal.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Components.utils.import("resource://gre/modules/Promise.jsm");
-
-var WORKER_SOURCE_URI =
- "chrome://test_sqlite_internal/content/worker_sqlite_internal.js";
-do_load_manifest("data/chrome.manifest");
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function() {
- let worker = new ChromeWorker(WORKER_SOURCE_URI);
- let deferred = Promise.defer();
- worker.onmessage = function(event) {
- let data = event.data;
- switch (data.kind) {
- case "do_check_true":
- try {
- do_check_true(data.args[0]);
- } catch (ex) {
- // Ignore errors
- }
- break;
- case "do_test_complete":
- deferred.resolve();
- worker.terminate();
- break;
- case "do_print":
- do_print(data.args[0]);
- break;
- }
- };
- worker.onerror = function(event) {
- let error = new Error(event.message, event.filename, event.lineno);
- worker.terminate();
- deferred.reject(error);
- };
- worker.postMessage("START");
- return deferred.promise;
-});
diff --git a/toolkit/components/sqlite/tests/xpcshell/xpcshell.ini b/toolkit/components/sqlite/tests/xpcshell/xpcshell.ini
deleted file mode 100644
index d652dbb1d..000000000
--- a/toolkit/components/sqlite/tests/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,10 +0,0 @@
-[DEFAULT]
-head =
-tail =
-skip-if = toolkit == 'android' || (os == 'mac' && appname == 'thunderbird')
-support-files =
- data/worker_sqlite_shared.js
- data/worker_sqlite_internal.js
- data/chrome.manifest
-
-[test_sqlite_internal.js]
diff --git a/toolkit/components/startup/moz.build b/toolkit/components/startup/moz.build
index 5f290b783..6c9515c15 100644
--- a/toolkit/components/startup/moz.build
+++ b/toolkit/components/startup/moz.build
@@ -6,12 +6,7 @@
DIRS += ['public']
-EXPORTS.mozilla += [
- 'StartupTimeline.h',
-]
-
-BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
-XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
+EXPORTS.mozilla += ['StartupTimeline.h']
UNIFIED_SOURCES += [
'nsAppStartup.cpp',
@@ -28,6 +23,3 @@ if CONFIG['MOZ_USERINFO']:
UNIFIED_SOURCES += ['nsUserInfoUnix.cpp']
FINAL_LIBRARY = 'xul'
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Startup and Profile System')
diff --git a/toolkit/components/startup/tests/browser/.eslintrc.js b/toolkit/components/startup/tests/browser/.eslintrc.js
deleted file mode 100644
index 7c8021192..000000000
--- a/toolkit/components/startup/tests/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/startup/tests/browser/beforeunload.html b/toolkit/components/startup/tests/browser/beforeunload.html
deleted file mode 100644
index 93ddd5f14..000000000
--- a/toolkit/components/startup/tests/browser/beforeunload.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
- <script>
- window.onbeforeunload = function(event) {
- event.returnValue = 'Test beforeunload handler';
- }
- </script>
- <body>
- Test page
- </body>
-</html>
diff --git a/toolkit/components/startup/tests/browser/browser.ini b/toolkit/components/startup/tests/browser/browser.ini
deleted file mode 100644
index 0c02f73b6..000000000
--- a/toolkit/components/startup/tests/browser/browser.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-support-files =
- head.js
- beforeunload.html
-
-[browser_bug511456.js]
-[browser_bug537449.js]
-[browser_crash_detection.js]
diff --git a/toolkit/components/startup/tests/browser/browser_bug511456.js b/toolkit/components/startup/tests/browser/browser_bug511456.js
deleted file mode 100644
index 652a34ea2..000000000
--- a/toolkit/components/startup/tests/browser/browser_bug511456.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const TEST_URL = "http://example.com/browser/toolkit/components/startup/tests/browser/beforeunload.html";
-
-SpecialPowers.pushPrefEnv({"set": [["dom.require_user_interaction_for_beforeunload", false]]});
-
-function test() {
- waitForExplicitFinish();
- ignoreAllUncaughtExceptions();
-
- let win2 = window.openDialog(location, "", "chrome,all,dialog=no", "about:blank");
- win2.addEventListener("load", function onLoad() {
- win2.removeEventListener("load", onLoad);
-
- gBrowser.selectedTab = gBrowser.addTab(TEST_URL);
- let browser = gBrowser.selectedBrowser;
-
- whenBrowserLoaded(browser, function () {
- let seenDialog = false;
-
- // Cancel the prompt the first time.
- waitForOnBeforeUnloadDialog(browser, (btnLeave, btnStay) => {
- seenDialog = true;
- btnStay.click();
- });
-
- let appStartup = Cc['@mozilla.org/toolkit/app-startup;1'].
- getService(Ci.nsIAppStartup);
- appStartup.quit(Ci.nsIAppStartup.eAttemptQuit);
- ok(seenDialog, "Should have seen a prompt dialog");
- ok(!win2.closed, "Shouldn't have closed the additional window");
- win2.close();
-
- // Leave the page the second time.
- waitForOnBeforeUnloadDialog(browser, (btnLeave, btnStay) => {
- btnLeave.click();
- });
-
- gBrowser.removeTab(gBrowser.selectedTab);
- executeSoon(finish);
- });
- });
-}
diff --git a/toolkit/components/startup/tests/browser/browser_bug537449.js b/toolkit/components/startup/tests/browser/browser_bug537449.js
deleted file mode 100644
index ed3446f8d..000000000
--- a/toolkit/components/startup/tests/browser/browser_bug537449.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-//
-// Whitelisting this test.
-// As part of bug 1077403, the leaking uncaught rejection should be fixed.
-//
-thisTestLeaksUncaughtRejectionsAndShouldBeFixed("TypeError: this.docShell is null");
-
-SpecialPowers.pushPrefEnv({"set": [["dom.require_user_interaction_for_beforeunload", false]]});
-
-const TEST_URL = "http://example.com/browser/toolkit/components/startup/tests/browser/beforeunload.html";
-
-function test() {
- waitForExplicitFinish();
-
- gBrowser.selectedTab = gBrowser.addTab(TEST_URL);
- let browser = gBrowser.selectedBrowser;
-
- whenBrowserLoaded(browser, function () {
- let seenDialog = false;
-
- // Cancel the prompt the first time.
- waitForOnBeforeUnloadDialog(browser, (btnLeave, btnStay) => {
- seenDialog = true;
- btnStay.click();
- });
-
- let appStartup = Cc['@mozilla.org/toolkit/app-startup;1'].
- getService(Ci.nsIAppStartup);
- appStartup.quit(Ci.nsIAppStartup.eAttemptQuit);
- ok(seenDialog, "Should have seen a prompt dialog");
- ok(!window.closed, "Shouldn't have closed the window");
-
- let win2 = window.openDialog(location, "", "chrome,all,dialog=no", "about:blank");
- ok(win2 != null, "Should have been able to open a new window");
- win2.addEventListener("load", function onLoad() {
- win2.removeEventListener("load", onLoad);
- win2.close();
-
- // Leave the page the second time.
- waitForOnBeforeUnloadDialog(browser, (btnLeave, btnStay) => {
- btnLeave.click();
- });
-
- gBrowser.removeTab(gBrowser.selectedTab);
- executeSoon(finish);
- });
- });
-}
diff --git a/toolkit/components/startup/tests/browser/browser_crash_detection.js b/toolkit/components/startup/tests/browser/browser_crash_detection.js
deleted file mode 100644
index 039f80dde..000000000
--- a/toolkit/components/startup/tests/browser/browser_crash_detection.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-function test() {
- function checkLastSuccess() {
- let lastSuccess = Services.prefs.getIntPref("toolkit.startup.last_success");
- let si = Services.startup.getStartupInfo();
- is(lastSuccess, parseInt(si["main"].getTime() / 1000, 10),
- "Startup tracking pref should be set after a delay at the end of startup");
- finish();
- }
-
- if (Services.prefs.getPrefType("toolkit.startup.max_resumed_crashes") == Services.prefs.PREF_INVALID) {
- info("Skipping this test since startup crash detection is disabled");
- return;
- }
-
- const startupCrashEndDelay = 35 * 1000;
- waitForExplicitFinish();
- requestLongerTimeout(2);
- setTimeout(checkLastSuccess, startupCrashEndDelay);
-}
diff --git a/toolkit/components/startup/tests/browser/head.js b/toolkit/components/startup/tests/browser/head.js
deleted file mode 100644
index c17da2ff7..000000000
--- a/toolkit/components/startup/tests/browser/head.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-
-function whenBrowserLoaded(browser, callback) {
- return BrowserTestUtils.browserLoaded(browser).then(callback);
-}
-
-function waitForOnBeforeUnloadDialog(browser, callback) {
- browser.addEventListener("DOMWillOpenModalDialog", function onModalDialog(event) {
- if (Cu.isCrossProcessWrapper(event.target)) {
- // This event fires in both the content and chrome processes. We
- // want to ignore the one in the content process.
- return;
- }
-
- browser.removeEventListener("DOMWillOpenModalDialog", onModalDialog, true);
-
- executeSoon(() => {
- let stack = browser.parentNode;
- let dialogs = stack.getElementsByTagNameNS(XUL_NS, "tabmodalprompt");
- let {button0, button1} = dialogs[0].ui;
- callback(button0, button1);
- });
- }, true);
-}
diff --git a/toolkit/components/startup/tests/unit/.eslintrc.js b/toolkit/components/startup/tests/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/startup/tests/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/startup/tests/unit/head_startup.js b/toolkit/components/startup/tests/unit/head_startup.js
deleted file mode 100644
index 2466f70ee..000000000
--- a/toolkit/components/startup/tests/unit/head_startup.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-const XULRUNTIME_CONTRACTID = "@mozilla.org/xre/runtime;1";
-const XULRUNTIME_CID = Components.ID("7685dac8-3637-4660-a544-928c5ec0e714}");
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-var gAppInfo = null;
-
-function createAppInfo(ID, name, version, platformVersion="1.0") {
- let tmp = {};
- Components.utils.import("resource://testing-common/AppInfo.jsm", tmp);
- gAppInfo = tmp.newAppInfo({
- ID, name, version, platformVersion,
- crashReporter: true,
- replacedLockTime: 0,
- });
-
- let XULAppInfoFactory = {
- createInstance: function (outer, iid) {
- if (outer != null)
- throw Components.results.NS_ERROR_NO_AGGREGATION;
- return gAppInfo.QueryInterface(iid);
- }
- };
- let registrar = Components.manager.QueryInterface(Ci.nsIComponentRegistrar);
- registrar.registerFactory(XULRUNTIME_CID, "XULRuntime",
- XULRUNTIME_CONTRACTID, XULAppInfoFactory);
-}
diff --git a/toolkit/components/startup/tests/unit/test_startup_crash.js b/toolkit/components/startup/tests/unit/test_startup_crash.js
deleted file mode 100644
index 283633086..000000000
--- a/toolkit/components/startup/tests/unit/test_startup_crash.js
+++ /dev/null
@@ -1,300 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-
-createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "10.0");
-
-var prefService = Services.prefs;
-var appStartup = Cc["@mozilla.org/toolkit/app-startup;1"].
- getService(Ci.nsIAppStartup);
-
-const pref_last_success = "toolkit.startup.last_success";
-const pref_recent_crashes = "toolkit.startup.recent_crashes";
-const pref_max_resumed_crashes = "toolkit.startup.max_resumed_crashes";
-const pref_always_use_safe_mode = "toolkit.startup.always_use_safe_mode";
-
-function run_test() {
- prefService.setBoolPref(pref_always_use_safe_mode, true);
-
- resetTestEnv(0);
-
- test_trackStartupCrashBegin();
- test_trackStartupCrashEnd();
- test_trackStartupCrashBegin_safeMode();
- test_trackStartupCrashEnd_safeMode();
- test_maxResumed();
- resetTestEnv(0);
-
- prefService.clearUserPref(pref_always_use_safe_mode);
-}
-
-// reset prefs to default
-function resetTestEnv(replacedLockTime) {
- try {
- // call begin to reset mStartupCrashTrackingEnded
- appStartup.trackStartupCrashBegin();
- } catch (x) { }
- prefService.setIntPref(pref_max_resumed_crashes, 2);
- prefService.clearUserPref(pref_recent_crashes);
- gAppInfo.replacedLockTime = replacedLockTime;
- prefService.clearUserPref(pref_last_success);
-}
-
-function now_seconds() {
- return ms_to_s(Date.now());
-}
-
-function ms_to_s(ms) {
- return Math.floor(ms / 1000);
-}
-
-function test_trackStartupCrashBegin() {
- let max_resumed = prefService.getIntPref(pref_max_resumed_crashes);
- do_check_false(gAppInfo.inSafeMode);
-
- // first run with startup crash tracking - existing profile lock
- let replacedLockTime = Date.now();
- resetTestEnv(replacedLockTime);
- do_check_false(prefService.prefHasUserValue(pref_recent_crashes));
- do_check_false(prefService.prefHasUserValue(pref_last_success));
- do_check_eq(replacedLockTime, gAppInfo.replacedLockTime);
- try {
- do_check_false(appStartup.trackStartupCrashBegin());
- do_throw("Should have thrown since last_success is not set");
- } catch (x) { }
-
- do_check_false(prefService.prefHasUserValue(pref_last_success));
- do_check_false(prefService.prefHasUserValue(pref_recent_crashes));
- do_check_false(appStartup.automaticSafeModeNecessary);
-
- // first run with startup crash tracking - no existing profile lock
- replacedLockTime = 0;
- resetTestEnv(replacedLockTime);
- do_check_false(prefService.prefHasUserValue(pref_recent_crashes));
- do_check_false(prefService.prefHasUserValue(pref_last_success));
- do_check_eq(replacedLockTime, gAppInfo.replacedLockTime);
- try {
- do_check_false(appStartup.trackStartupCrashBegin());
- do_throw("Should have thrown since last_success is not set");
- } catch (x) { }
-
- do_check_false(prefService.prefHasUserValue(pref_last_success));
- do_check_false(prefService.prefHasUserValue(pref_recent_crashes));
- do_check_false(appStartup.automaticSafeModeNecessary);
-
- // normal startup - last startup was success
- replacedLockTime = Date.now();
- resetTestEnv(replacedLockTime);
- do_check_false(prefService.prefHasUserValue(pref_recent_crashes));
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime));
- do_check_eq(ms_to_s(replacedLockTime), prefService.getIntPref(pref_last_success));
- do_check_false(appStartup.trackStartupCrashBegin());
- do_check_eq(ms_to_s(replacedLockTime), prefService.getIntPref(pref_last_success));
- do_check_false(prefService.prefHasUserValue(pref_recent_crashes));
- do_check_false(appStartup.automaticSafeModeNecessary);
-
- // normal startup with 1 recent crash
- resetTestEnv(replacedLockTime);
- prefService.setIntPref(pref_recent_crashes, 1);
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime));
- do_check_false(appStartup.trackStartupCrashBegin());
- do_check_eq(ms_to_s(replacedLockTime), prefService.getIntPref(pref_last_success));
- do_check_eq(1, prefService.getIntPref(pref_recent_crashes));
- do_check_false(appStartup.automaticSafeModeNecessary);
-
- // normal startup with max_resumed_crashes crash
- resetTestEnv(replacedLockTime);
- prefService.setIntPref(pref_recent_crashes, max_resumed);
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime));
- do_check_false(appStartup.trackStartupCrashBegin());
- do_check_eq(ms_to_s(replacedLockTime), prefService.getIntPref(pref_last_success));
- do_check_eq(max_resumed, prefService.getIntPref(pref_recent_crashes));
- do_check_false(appStartup.automaticSafeModeNecessary);
-
- // normal startup with too many recent crashes
- resetTestEnv(replacedLockTime);
- prefService.setIntPref(pref_recent_crashes, max_resumed + 1);
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime));
- do_check_true(appStartup.trackStartupCrashBegin());
- // should remain the same since the last startup was not a crash
- do_check_eq(max_resumed + 1, prefService.getIntPref(pref_recent_crashes));
- do_check_true(appStartup.automaticSafeModeNecessary);
-
- // normal startup with too many recent crashes and startup crash tracking disabled
- resetTestEnv(replacedLockTime);
- prefService.setIntPref(pref_max_resumed_crashes, -1);
- prefService.setIntPref(pref_recent_crashes, max_resumed + 1);
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime));
- do_check_false(appStartup.trackStartupCrashBegin());
- // should remain the same since the last startup was not a crash
- do_check_eq(max_resumed + 1, prefService.getIntPref(pref_recent_crashes));
- // returns false when disabled
- do_check_false(appStartup.automaticSafeModeNecessary);
- do_check_eq(-1, prefService.getIntPref(pref_max_resumed_crashes));
-
- // normal startup after 1 non-recent crash (1 year ago), no other recent
- replacedLockTime = Date.now() - 365 * 24 * 60 * 60 * 1000;
- resetTestEnv(replacedLockTime);
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime) - 365 * 24 * 60 * 60);
- do_check_false(appStartup.trackStartupCrashBegin());
- // recent crash count pref should be unset since the last crash was not recent
- do_check_false(prefService.prefHasUserValue(pref_recent_crashes));
- do_check_false(appStartup.automaticSafeModeNecessary);
-
- // normal startup after 1 crash (1 minute ago), no other recent
- replacedLockTime = Date.now() - 60 * 1000;
- resetTestEnv(replacedLockTime);
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime) - 60 * 60); // last success - 1 hour ago
- do_check_false(appStartup.trackStartupCrashBegin());
- // recent crash count pref should be created with value 1
- do_check_eq(1, prefService.getIntPref(pref_recent_crashes));
- do_check_false(appStartup.automaticSafeModeNecessary);
-
- // normal startup after another crash (1 minute ago), 1 already
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime) - 60 * 60); // last success - 1 hour ago
- replacedLockTime = Date.now() - 60 * 1000;
- gAppInfo.replacedLockTime = replacedLockTime;
- do_check_false(appStartup.trackStartupCrashBegin());
- // recent crash count pref should be incremented by 1
- do_check_eq(2, prefService.getIntPref(pref_recent_crashes));
- do_check_false(appStartup.automaticSafeModeNecessary);
-
- // normal startup after another crash (1 minute ago), 2 already
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime) - 60 * 60); // last success - 1 hour ago
- do_check_true(appStartup.trackStartupCrashBegin());
- // recent crash count pref should be incremented by 1
- do_check_eq(3, prefService.getIntPref(pref_recent_crashes));
- do_check_true(appStartup.automaticSafeModeNecessary);
-
- // normal startup after 1 non-recent crash (1 year ago), 3 crashes already
- replacedLockTime = Date.now() - 365 * 24 * 60 * 60 * 1000;
- resetTestEnv(replacedLockTime);
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime) - 60 * 60); // last success - 1 hour ago
- do_check_false(appStartup.trackStartupCrashBegin());
- // recent crash count should be unset since the last crash was not recent
- do_check_false(prefService.prefHasUserValue(pref_recent_crashes));
- do_check_false(appStartup.automaticSafeModeNecessary);
-}
-
-function test_trackStartupCrashEnd() {
- // successful startup with no last_success (upgrade test)
- let replacedLockTime = Date.now() - 10 * 1000; // 10s ago
- resetTestEnv(replacedLockTime);
- try {
- appStartup.trackStartupCrashBegin(); // required to be called before end
- do_throw("Should have thrown since last_success is not set");
- } catch (x) { }
- appStartup.trackStartupCrashEnd();
- do_check_false(prefService.prefHasUserValue(pref_recent_crashes));
- do_check_false(prefService.prefHasUserValue(pref_last_success));
-
- // successful startup - should set last_success
- replacedLockTime = Date.now() - 10 * 1000; // 10s ago
- resetTestEnv(replacedLockTime);
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime));
- appStartup.trackStartupCrashBegin(); // required to be called before end
- appStartup.trackStartupCrashEnd();
- // ensure last_success was set since we have declared a succesful startup
- // main timestamp doesn't get set in XPCShell so approximate with now
- do_check_true(prefService.getIntPref(pref_last_success) <= now_seconds());
- do_check_true(prefService.getIntPref(pref_last_success) >= now_seconds() - 4 * 60 * 60);
- do_check_false(prefService.prefHasUserValue(pref_recent_crashes));
-
- // successful startup with 1 recent crash
- resetTestEnv(replacedLockTime);
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime));
- prefService.setIntPref(pref_recent_crashes, 1);
- appStartup.trackStartupCrashBegin(); // required to be called before end
- appStartup.trackStartupCrashEnd();
- // ensure recent_crashes was cleared since we have declared a succesful startup
- do_check_false(prefService.prefHasUserValue(pref_recent_crashes));
-}
-
-function test_trackStartupCrashBegin_safeMode() {
- gAppInfo.inSafeMode = true;
- resetTestEnv(0);
- let max_resumed = prefService.getIntPref(pref_max_resumed_crashes);
-
- // check manual safe mode doesn't change prefs without crash
- let replacedLockTime = Date.now() - 10 * 1000; // 10s ago
- resetTestEnv(replacedLockTime);
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime));
-
- do_check_false(prefService.prefHasUserValue(pref_recent_crashes));
- do_check_true(prefService.prefHasUserValue(pref_last_success));
- do_check_false(appStartup.automaticSafeModeNecessary);
- do_check_false(appStartup.trackStartupCrashBegin());
- do_check_false(prefService.prefHasUserValue(pref_recent_crashes));
- do_check_true(prefService.prefHasUserValue(pref_last_success));
- do_check_false(appStartup.automaticSafeModeNecessary);
-
- // check forced safe mode doesn't change prefs without crash
- replacedLockTime = Date.now() - 10 * 1000; // 10s ago
- resetTestEnv(replacedLockTime);
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime));
- prefService.setIntPref(pref_recent_crashes, max_resumed + 1);
-
- do_check_eq(max_resumed + 1, prefService.getIntPref(pref_recent_crashes));
- do_check_true(prefService.prefHasUserValue(pref_last_success));
- do_check_false(appStartup.automaticSafeModeNecessary);
- do_check_true(appStartup.trackStartupCrashBegin());
- do_check_eq(max_resumed + 1, prefService.getIntPref(pref_recent_crashes));
- do_check_true(prefService.prefHasUserValue(pref_last_success));
- do_check_true(appStartup.automaticSafeModeNecessary);
-
- // check forced safe mode after old crash
- replacedLockTime = Date.now() - 365 * 24 * 60 * 60 * 1000;
- resetTestEnv(replacedLockTime);
- // one year ago
- let last_success = ms_to_s(replacedLockTime) - 365 * 24 * 60 * 60;
- prefService.setIntPref(pref_last_success, last_success);
- prefService.setIntPref(pref_recent_crashes, max_resumed + 1);
- do_check_eq(max_resumed + 1, prefService.getIntPref(pref_recent_crashes));
- do_check_true(prefService.prefHasUserValue(pref_last_success));
- do_check_true(appStartup.automaticSafeModeNecessary);
- do_check_true(appStartup.trackStartupCrashBegin());
- do_check_eq(max_resumed + 1, prefService.getIntPref(pref_recent_crashes));
- do_check_eq(last_success, prefService.getIntPref(pref_last_success));
- do_check_true(appStartup.automaticSafeModeNecessary);
-}
-
-function test_trackStartupCrashEnd_safeMode() {
- gAppInfo.inSafeMode = true;
- let replacedLockTime = Date.now();
- resetTestEnv(replacedLockTime);
- let max_resumed = prefService.getIntPref(pref_max_resumed_crashes);
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime) - 24 * 60 * 60);
-
- // ensure recent_crashes were not cleared in manual safe mode
- prefService.setIntPref(pref_recent_crashes, 1);
- appStartup.trackStartupCrashBegin(); // required to be called before end
- appStartup.trackStartupCrashEnd();
- do_check_eq(1, prefService.getIntPref(pref_recent_crashes));
-
- // recent_crashes should be set to max_resumed in forced safe mode to allow the user
- // to try and start in regular mode after making changes.
- prefService.setIntPref(pref_recent_crashes, max_resumed + 1);
- appStartup.trackStartupCrashBegin(); // required to be called before end
- appStartup.trackStartupCrashEnd();
- do_check_eq(max_resumed, prefService.getIntPref(pref_recent_crashes));
-}
-
-function test_maxResumed() {
- resetTestEnv(0);
- gAppInfo.inSafeMode = false;
- let max_resumed = prefService.getIntPref(pref_max_resumed_crashes);
- let replacedLockTime = Date.now();
- resetTestEnv(replacedLockTime);
- prefService.setIntPref(pref_max_resumed_crashes, -1);
-
- prefService.setIntPref(pref_recent_crashes, max_resumed + 1);
- prefService.setIntPref(pref_last_success, ms_to_s(replacedLockTime) - 24 * 60 * 60);
- appStartup.trackStartupCrashBegin();
- // should remain the same since the last startup was not a crash
- do_check_eq(max_resumed + 2, prefService.getIntPref(pref_recent_crashes));
- do_check_false(appStartup.automaticSafeModeNecessary);
-}
diff --git a/toolkit/components/startup/tests/unit/xpcshell.ini b/toolkit/components/startup/tests/unit/xpcshell.ini
deleted file mode 100644
index 294800ee3..000000000
--- a/toolkit/components/startup/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-head = head_startup.js
-tail =
-skip-if = toolkit == 'android'
-
-[test_startup_crash.js]
diff --git a/toolkit/components/telemetry/Makefile.in b/toolkit/components/telemetry/Makefile.in
deleted file mode 100644
index 52016707c..000000000
--- a/toolkit/components/telemetry/Makefile.in
+++ /dev/null
@@ -1,17 +0,0 @@
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-include $(topsrcdir)/config/rules.mk
-
-# This is so hacky. Waiting on bug 988938.
-addondir = $(srcdir)/tests/addons
-testdir = $(topobjdir)/_tests/xpcshell/toolkit/components/telemetry/tests/unit
-
-misc:: $(call mkdir_deps,$(testdir))
- $(EXIT_ON_ERROR) \
- for dir in $(addondir)/*; do \
- base=`basename $$dir`; \
- (cd $$dir && zip -qr $(testdir)/$$base.xpi *); \
- done
diff --git a/toolkit/components/telemetry/TelemetryController.jsm b/toolkit/components/telemetry/TelemetryController.jsm
index b8de776da..86de87d02 100644
--- a/toolkit/components/telemetry/TelemetryController.jsm
+++ b/toolkit/components/telemetry/TelemetryController.jsm
@@ -365,7 +365,7 @@ var Impl = {
let updateChannel = null;
try {
- updateChannel = UpdateUtils.getUpdateChannel(false);
+ updateChannel = UpdateUtils.UpdateChannel;
} catch (e) {
this._log.trace("_getApplicationSection - Unable to get update channel.", e);
}
diff --git a/toolkit/components/telemetry/TelemetryEnvironment.jsm b/toolkit/components/telemetry/TelemetryEnvironment.jsm
index 391ea4bb4..f88dfc5f0 100644
--- a/toolkit/components/telemetry/TelemetryEnvironment.jsm
+++ b/toolkit/components/telemetry/TelemetryEnvironment.jsm
@@ -1106,7 +1106,7 @@ EnvironmentCache.prototype = {
_updateSettings: function () {
let updateChannel = null;
try {
- updateChannel = UpdateUtils.getUpdateChannel(false);
+ updateChannel = UpdateUtils.UpdateChannel;
} catch (e) {}
this._currentEnvironment.settings = {
diff --git a/toolkit/components/telemetry/TelemetryReportingPolicy.jsm b/toolkit/components/telemetry/TelemetryReportingPolicy.jsm
index d9c99df49..6ad534f53 100644
--- a/toolkit/components/telemetry/TelemetryReportingPolicy.jsm
+++ b/toolkit/components/telemetry/TelemetryReportingPolicy.jsm
@@ -254,7 +254,7 @@ var TelemetryReportingPolicyImpl = {
// use the general minimum policy version.
let channel = "";
try {
- channel = UpdateUtils.getUpdateChannel(false);
+ channel = UpdateUtils.UpdateChannel;
} catch (e) {
this._log.error("minimumPolicyVersion - Unable to retrieve the current channel.");
return minPolicyVersion;
diff --git a/toolkit/components/telemetry/moz.build b/toolkit/components/telemetry/moz.build
index 7765c59b4..712da7999 100644
--- a/toolkit/components/telemetry/moz.build
+++ b/toolkit/components/telemetry/moz.build
@@ -22,9 +22,6 @@ SPHINX_TREES['telemetry'] = 'docs'
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wno-error=shadow']
-XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
-BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
-
XPIDL_SOURCES += [
'nsITelemetry.idl',
]
@@ -71,10 +68,6 @@ EXTRA_JS_MODULES += [
'UITelemetry.jsm',
]
-TESTING_JS_MODULES += [
- 'tests/unit/TelemetryArchiveTesting.jsm',
-]
-
GENERATED_FILES = [
'TelemetryEventData.h',
'TelemetryEventEnums.h',
@@ -125,5 +118,3 @@ event_enums = GENERATED_FILES['TelemetryEventEnums.h']
event_enums.script = 'gen-event-enum.py'
event_enums.inputs = event_files
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Telemetry')
diff --git a/toolkit/components/telemetry/tests/addons/dictionary/install.rdf b/toolkit/components/telemetry/tests/addons/dictionary/install.rdf
deleted file mode 100644
index ff0039b39..000000000
--- a/toolkit/components/telemetry/tests/addons/dictionary/install.rdf
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>telemetry-dictionary@tests.mozilla.org</em:id>
- <em:version>1</em:version>
- <em:type>64</em:type>
-
- <em:targetApplication>
- <Description>
- <em:id>toolkit@mozilla.org</em:id>
- <em:minVersion>0</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <!-- Front End MetaData -->
- <em:name>Telemetry test dictionary</em:name>
- <em:description>A nice dictionary to prevent all typos for Telemetry.</em:description>
- <em:bootstrap>true</em:bootstrap>
-
- </Description>
-</RDF>
diff --git a/toolkit/components/telemetry/tests/addons/experiment/install.rdf b/toolkit/components/telemetry/tests/addons/experiment/install.rdf
deleted file mode 100644
index d12f06816..000000000
--- a/toolkit/components/telemetry/tests/addons/experiment/install.rdf
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>telemetry-experiment-1@tests.mozilla.org</em:id>
- <em:version>1</em:version>
- <em:type>128</em:type>
-
- <!-- Front End MetaData -->
- <em:name>Telemetry test experiment</em:name>
- <em:description>Yet another experiment that experiments experimentally.</em:description>
-
- </Description>
-</RDF>
diff --git a/toolkit/components/telemetry/tests/addons/extension-2/install.rdf b/toolkit/components/telemetry/tests/addons/extension-2/install.rdf
deleted file mode 100644
index ddb5904f8..000000000
--- a/toolkit/components/telemetry/tests/addons/extension-2/install.rdf
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>telemetry-ext-2@tests.mozilla.org</em:id>
- <em:version>2</em:version>
- <em:type>2</em:type>
-
- <!-- Front End MetaData -->
- <em:name>Telemetry test extension 2</em:name>
- <em:description>Yet another extension that extends twice.</em:description>
-
- </Description>
-</RDF>
diff --git a/toolkit/components/telemetry/tests/addons/extension/install.rdf b/toolkit/components/telemetry/tests/addons/extension/install.rdf
deleted file mode 100644
index 4b1bd2da7..000000000
--- a/toolkit/components/telemetry/tests/addons/extension/install.rdf
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>telemetry-ext-1@tests.mozilla.org</em:id>
- <em:version>1</em:version>
- <em:type>2</em:type>
-
- <!-- Front End MetaData -->
- <em:name>Telemetry test extension</em:name>
- <em:description>Yet another extension that extends.</em:description>
-
- </Description>
-</RDF>
diff --git a/toolkit/components/telemetry/tests/addons/long-fields/install.rdf b/toolkit/components/telemetry/tests/addons/long-fields/install.rdf
deleted file mode 100644
index 23ca7523c..000000000
--- a/toolkit/components/telemetry/tests/addons/long-fields/install.rdf
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>tel-longfields-xpi@tests.mozilla.org</em:id>
- <em:version>This is a really long addon version, that will get limited to 100 characters. We're much longer, we're at about 116.</em:version>
-
- <em:targetApplication>
- <Description>
- <em:id>toolkit@mozilla.org</em:id>
- <em:minVersion>0</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <!-- Front End MetaData -->
- <em:name>This is a really long addon name, that will get limited to 100 characters. We're much longer, we're at about 219. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nullam sodales. Yeah, Latin placeholder.</em:name>
- <em:description>This is a really long addon description, that will get limited to 100 characters. We're much longer, we're at about 200. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus nullam sodales.</em:description>
- <em:bootstrap>true</em:bootstrap>
-
- </Description>
-</RDF>
diff --git a/toolkit/components/telemetry/tests/addons/restartless/install.rdf b/toolkit/components/telemetry/tests/addons/restartless/install.rdf
deleted file mode 100644
index f6cda9f25..000000000
--- a/toolkit/components/telemetry/tests/addons/restartless/install.rdf
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>tel-restartless-xpi@tests.mozilla.org</em:id>
- <em:version>1.0</em:version>
-
- <em:targetApplication>
- <Description>
- <em:id>toolkit@mozilla.org</em:id>
- <em:minVersion>0</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <!-- Front End MetaData -->
- <em:name>XPI Telemetry Restartless Test</em:name>
- <em:description>A restartless addon which gets enabled without a reboot.</em:description>
- <em:bootstrap>true</em:bootstrap>
-
- </Description>
-</RDF>
diff --git a/toolkit/components/telemetry/tests/addons/signed/META-INF/manifest.mf b/toolkit/components/telemetry/tests/addons/signed/META-INF/manifest.mf
deleted file mode 100644
index e6e279dbc..000000000
--- a/toolkit/components/telemetry/tests/addons/signed/META-INF/manifest.mf
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-
-Name: install.rdf
-Digest-Algorithms: MD5 SHA1
-MD5-Digest: YEilRfaecTg2bMNPoYqexQ==
-SHA1-Digest: GEnQKM8Coyw83phx/z1oNh327+0=
-
diff --git a/toolkit/components/telemetry/tests/addons/signed/META-INF/mozilla.rsa b/toolkit/components/telemetry/tests/addons/signed/META-INF/mozilla.rsa
deleted file mode 100644
index 8e5a92650..000000000
--- a/toolkit/components/telemetry/tests/addons/signed/META-INF/mozilla.rsa
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/telemetry/tests/addons/signed/META-INF/mozilla.sf b/toolkit/components/telemetry/tests/addons/signed/META-INF/mozilla.sf
deleted file mode 100644
index 21ce46081..000000000
--- a/toolkit/components/telemetry/tests/addons/signed/META-INF/mozilla.sf
+++ /dev/null
@@ -1,4 +0,0 @@
-Signature-Version: 1.0
-MD5-Digest-Manifest: Ko2bKTrwTXCdstWHWqCR4w==
-SHA1-Digest-Manifest: k6+jfNGFxXtDd1cSX0ZoIyQ1cww=
-
diff --git a/toolkit/components/telemetry/tests/addons/signed/install.rdf b/toolkit/components/telemetry/tests/addons/signed/install.rdf
deleted file mode 100644
index 5fdca172c..000000000
--- a/toolkit/components/telemetry/tests/addons/signed/install.rdf
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>tel-signed-xpi@tests.mozilla.org</em:id>
- <em:version>1.0</em:version>
-
- <em:targetApplication>
- <Description>
- <em:id>toolkit@mozilla.org</em:id>
- <em:minVersion>0</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <!-- Front End MetaData -->
- <em:name>XPI Telemetry Signed Test</em:name>
- <em:description>A signed addon which gets enabled without a reboot.</em:description>
- <em:bootstrap>true</em:bootstrap>
-
- </Description>
-</RDF>
diff --git a/toolkit/components/telemetry/tests/addons/system/install.rdf b/toolkit/components/telemetry/tests/addons/system/install.rdf
deleted file mode 100644
index 12cb143a7..000000000
--- a/toolkit/components/telemetry/tests/addons/system/install.rdf
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>tel-system-xpi@tests.mozilla.org</em:id>
- <em:version>1.0</em:version>
-
- <em:targetApplication>
- <Description>
- <em:id>toolkit@mozilla.org</em:id>
- <em:minVersion>0</em:minVersion>
- <em:maxVersion>*</em:maxVersion>
- </Description>
- </em:targetApplication>
-
- <!-- Front End MetaData -->
- <em:name>XPI Telemetry System Add-on Test</em:name>
- <em:description>A system addon which is shipped with Firefox.</em:description>
- <em:bootstrap>true</em:bootstrap>
-
- </Description>
-</RDF>
diff --git a/toolkit/components/telemetry/tests/addons/theme/install.rdf b/toolkit/components/telemetry/tests/addons/theme/install.rdf
deleted file mode 100644
index a35249dba..000000000
--- a/toolkit/components/telemetry/tests/addons/theme/install.rdf
+++ /dev/null
@@ -1,16 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
-
- <Description about="urn:mozilla:install-manifest">
- <em:id>telemetry-theme@tests.mozilla.org</em:id>
- <em:version>1</em:version>
- <em:type>4</em:type>
-
- <!-- Front End MetaData -->
- <em:name>Telemetry test theme</em:name>
- <em:description>A good looking test theme for Telemetry.</em:description>
-
- </Description>
-</RDF>
diff --git a/toolkit/components/telemetry/tests/browser/browser.ini b/toolkit/components/telemetry/tests/browser/browser.ini
deleted file mode 100644
index a1725d54d..000000000
--- a/toolkit/components/telemetry/tests/browser/browser.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-[browser_TelemetryGC.js]
diff --git a/toolkit/components/telemetry/tests/browser/browser_TelemetryGC.js b/toolkit/components/telemetry/tests/browser/browser_TelemetryGC.js
deleted file mode 100644
index 262fd69ff..000000000
--- a/toolkit/components/telemetry/tests/browser/browser_TelemetryGC.js
+++ /dev/null
@@ -1,193 +0,0 @@
-"use strict";
-
-/*
- *********************************************************************************
- * *
- * WARNING *
- * *
- * If you adjust any of the constants here (slice limit, number of keys, etc.) *
- * make sure to update the JSON schema at: *
- * https://github.com/mozilla-services/mozilla-pipeline-schemas/blob/master/ *
- * telemetry/main.schema.json *
- * *
- * Otherwise, pings may be dropped by the telemetry backend! *
- * *
- ********************************************************************************/
-
-const {GCTelemetry} = Cu.import("resource://gre/modules/GCTelemetry.jsm", {});
-
-function check(entries) {
- const FIELDS = ["random", "worst"];
-
- // Check that all FIELDS are in |entries|.
- for (let f of FIELDS) {
- ok(f in entries, `${f} found in entries`);
- }
-
- // Check that only FIELDS are in |entries|.
- for (let k of Object.keys(entries)) {
- ok(FIELDS.includes(k), `${k} found in FIELDS`);
- }
-
- let foundGCs = 0;
-
- for (let f of FIELDS) {
- ok(Array.isArray(entries[f]), "have an array of GCs");
-
- ok(entries[f].length <= 2, "not too many GCs");
-
- for (let gc of entries[f]) {
- ok(gc !== null, "GC is non-null");
-
- foundGCs++;
-
- ok(Object.keys(gc).length <= 25, "number of keys in GC is not too large");
-
- // Sanity check the GC data.
- ok("total_time" in gc, "total_time field present");
- ok("max_pause" in gc, "max_pause field present");
-
- ok("slices" in gc, "slices field present");
- ok(Array.isArray(gc.slices), "slices is an array");
- ok(gc.slices.length > 0, "slices array non-empty");
- ok(gc.slices.length <= 4, "slices array is not too long");
-
- ok("totals" in gc, "totals field present");
- ok(typeof(gc.totals) == "object", "totals is an object");
- ok(Object.keys(gc.totals).length <= 65, "totals array is not too long");
-
- // Make sure we don't skip any big objects.
- for (let key in gc) {
- if (key != "slices" && key != "totals") {
- ok(typeof(gc[key]) != "object", `${key} property should be primitive`);
- }
- }
-
- let phases = new Set();
-
- for (let slice of gc.slices) {
- ok(Object.keys(slice).length <= 15, "slice is not too large");
-
- ok("pause" in slice, "pause field present in slice");
- ok("reason" in slice, "reason field present in slice");
- ok("times" in slice, "times field present in slice");
-
- // Make sure we don't skip any big objects.
- for (let key in slice) {
- if (key != "times") {
- ok(typeof(slice[key]) != "object", `${key} property should be primitive`);
- }
- }
-
- ok(Object.keys(slice.times).length <= 65, "no more than 65 phases");
-
- for (let phase in slice.times) {
- phases.add(phase);
- ok(typeof(slice.times[phase]) == "number", `${phase} property should be a number`);
- }
- }
-
- let totals = gc.totals;
- // Make sure we don't skip any big objects.
- for (let phase in totals) {
- ok(typeof(totals[phase]) == "number", `${phase} property should be a number`);
- }
-
- for (let phase of phases) {
- ok(phase in totals, `${phase} is in totals`);
- }
- }
- }
-
- ok(foundGCs > 0, "saw at least one GC");
-}
-
-add_task(function* test() {
- let multiprocess = Services.appinfo.browserTabsRemoteAutostart;
-
- // Set these prefs to ensure that we get measurements.
- const prefs = {"set": [["javascript.options.mem.notify", true]]};
- yield new Promise(resolve => SpecialPowers.pushPrefEnv(prefs, resolve));
-
- function runRemote(f) {
- gBrowser.selectedBrowser.messageManager.loadFrameScript(`data:,(${f})()`, false);
- }
-
- function initScript() {
- const {GCTelemetry} = Components.utils.import("resource://gre/modules/GCTelemetry.jsm", {});
-
- /*
- * Don't shut down GC telemetry if it was already running before the test!
- * Note: We need to use a multiline comment here since this code is turned into a data: URI.
- */
- let shutdown = GCTelemetry.init();
-
- function listener() {
- removeMessageListener("GCTelemTest:Shutdown", listener);
- if (shutdown) {
- GCTelemetry.shutdown();
- }
- }
- addMessageListener("GCTelemTest:Shutdown", listener);
- }
-
- if (multiprocess) {
- runRemote(initScript);
- }
-
- // Don't shut down GC telemetry if it was already running before the test!
- let shutdown = GCTelemetry.init();
- registerCleanupFunction(() => {
- if (shutdown) {
- GCTelemetry.shutdown();
- }
-
- gBrowser.selectedBrowser.messageManager.sendAsyncMessage("GCTelemTest:Shutdown");
- });
-
- let localPromise = new Promise(resolve => {
- function obs() {
- Services.obs.removeObserver(obs, "garbage-collection-statistics");
- resolve();
- }
- Services.obs.addObserver(obs, "garbage-collection-statistics", false);
- });
-
- let remotePromise;
- if (multiprocess) {
- remotePromise = new Promise(resolve => {
- function obs() {
- Services.ppmm.removeMessageListener("Telemetry:GCStatistics", obs);
- resolve();
- }
- Services.ppmm.addMessageListener("Telemetry:GCStatistics", obs);
- });
- } else {
- remotePromise = Promise.resolve();
- }
-
- // Make sure we have a GC to work with in both processes.
- Cu.forceGC();
- if (multiprocess) {
- runRemote(() => Components.utils.forceGC());
- }
-
- info("Waiting for GCs");
-
- yield Promise.all([localPromise, remotePromise]);
-
- let localEntries = GCTelemetry.entries("main", true);
- let remoteEntries = multiprocess ? GCTelemetry.entries("content", true) : localEntries;
-
- check(localEntries);
- check(remoteEntries);
-
- localEntries = GCTelemetry.entries("main", false);
- remoteEntries = multiprocess ? GCTelemetry.entries("content", false) : localEntries;
-
- is(localEntries.random.length, 0, "no random GCs after reset");
- is(localEntries.worst.length, 0, "no worst GCs after reset");
-
- is(remoteEntries.random.length, 0, "no random GCs after reset");
- is(remoteEntries.worst.length, 0, "no worst GCs after reset");
-});
diff --git a/toolkit/components/telemetry/tests/search/chrome.manifest b/toolkit/components/telemetry/tests/search/chrome.manifest
deleted file mode 100644
index ec412e050..000000000
--- a/toolkit/components/telemetry/tests/search/chrome.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-locale testsearchplugin ar jar:jar:searchTest.jar!/chrome/searchTest.jar!/
-content testsearchplugin ./
-
diff --git a/toolkit/components/telemetry/tests/search/searchTest.jar b/toolkit/components/telemetry/tests/search/searchTest.jar
deleted file mode 100644
index b10fc0c3e..000000000
--- a/toolkit/components/telemetry/tests/search/searchTest.jar
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/telemetry/tests/unit/.eslintrc.js b/toolkit/components/telemetry/tests/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/telemetry/tests/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/telemetry/tests/unit/TelemetryArchiveTesting.jsm b/toolkit/components/telemetry/tests/unit/TelemetryArchiveTesting.jsm
deleted file mode 100644
index 9be82c883..000000000
--- a/toolkit/components/telemetry/tests/unit/TelemetryArchiveTesting.jsm
+++ /dev/null
@@ -1,86 +0,0 @@
-const {utils: Cu} = Components;
-Cu.import("resource://gre/modules/TelemetryArchive.jsm");
-Cu.import("resource://testing-common/Assert.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/TelemetryController.jsm");
-
-this.EXPORTED_SYMBOLS = [
- "TelemetryArchiveTesting",
-];
-
-function checkForProperties(ping, expected) {
- for (let [props, val] of expected) {
- let test = ping;
- for (let prop of props) {
- test = test[prop];
- if (test === undefined) {
- return false;
- }
- }
- if (test !== val) {
- return false;
- }
- }
- return true;
-}
-
-/**
- * A helper object that allows test code to check whether a telemetry ping
- * was properly saved. To use, first initialize to collect the starting pings
- * and then check for new ping data.
- */
-function Checker() {
-}
-Checker.prototype = {
- promiseInit: function() {
- this._pingMap = new Map();
- return TelemetryArchive.promiseArchivedPingList().then((plist) => {
- for (let ping of plist) {
- this._pingMap.set(ping.id, ping);
- }
- });
- },
-
- /**
- * Find and return a new ping with certain properties.
- *
- * @param expected: an array of [['prop'...], 'value'] to check
- * For example:
- * [
- * [['environment', 'build', 'applicationId'], '20150101010101'],
- * [['version'], 1],
- * [['metadata', 'OOMAllocationSize'], 123456789],
- * ]
- * @returns a matching ping if found, or null
- */
- promiseFindPing: Task.async(function*(type, expected) {
- let candidates = [];
- let plist = yield TelemetryArchive.promiseArchivedPingList();
- for (let ping of plist) {
- if (this._pingMap.has(ping.id)) {
- continue;
- }
- if (ping.type == type) {
- candidates.push(ping);
- }
- }
-
- for (let candidate of candidates) {
- let ping = yield TelemetryArchive.promiseArchivedPingById(candidate.id);
- if (checkForProperties(ping, expected)) {
- return ping;
- }
- }
- return null;
- }),
-};
-
-const TelemetryArchiveTesting = {
- setup: function() {
- Services.prefs.setCharPref("toolkit.telemetry.log.level", "Trace");
- Services.prefs.setBoolPref("toolkit.telemetry.archive.enabled", true);
- },
-
- Checker: Checker,
-};
diff --git a/toolkit/components/telemetry/tests/unit/engine.xml b/toolkit/components/telemetry/tests/unit/engine.xml
deleted file mode 100644
index 2304fcdd7..000000000
--- a/toolkit/components/telemetry/tests/unit/engine.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<SearchPlugin xmlns="http://www.mozilla.org/2006/browser/search/">
-<ShortName>engine-telemetry</ShortName>
-<Url type="text/html" method="GET" template="http://www.example.com/search">
- <Param name="q" value="{searchTerms}"/>
-</Url>
-</SearchPlugin>
diff --git a/toolkit/components/telemetry/tests/unit/head.js b/toolkit/components/telemetry/tests/unit/head.js
deleted file mode 100644
index 87afd3617..000000000
--- a/toolkit/components/telemetry/tests/unit/head.js
+++ /dev/null
@@ -1,319 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var { classes: Cc, utils: Cu, interfaces: Ci, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/PromiseUtils.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm", this);
-Cu.import("resource://gre/modules/FileUtils.jsm", this);
-Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://testing-common/httpd.js", this);
-Cu.import("resource://gre/modules/AppConstants.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "AddonTestUtils",
- "resource://testing-common/AddonTestUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-
-const gIsWindows = AppConstants.platform == "win";
-const gIsMac = AppConstants.platform == "macosx";
-const gIsAndroid = AppConstants.platform == "android";
-const gIsGonk = false;
-const gIsLinux = AppConstants.platform == "linux";
-
-const Telemetry = Cc["@mozilla.org/base/telemetry;1"].getService(Ci.nsITelemetry);
-
-const MILLISECONDS_PER_MINUTE = 60 * 1000;
-const MILLISECONDS_PER_HOUR = 60 * MILLISECONDS_PER_MINUTE;
-const MILLISECONDS_PER_DAY = 24 * MILLISECONDS_PER_HOUR;
-
-const PREF_TELEMETRY_ENABLED = "toolkit.telemetry.enabled";
-
-const UUID_REGEX = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
-
-var gGlobalScope = this;
-
-const PingServer = {
- _httpServer: null,
- _started: false,
- _defers: [ PromiseUtils.defer() ],
- _currentDeferred: 0,
-
- get port() {
- return this._httpServer.identity.primaryPort;
- },
-
- get started() {
- return this._started;
- },
-
- registerPingHandler: function(handler) {
- const wrapped = wrapWithExceptionHandler(handler);
- this._httpServer.registerPrefixHandler("/submit/telemetry/", wrapped);
- },
-
- resetPingHandler: function() {
- this.registerPingHandler((request, response) => {
- let deferred = this._defers[this._defers.length - 1];
- this._defers.push(PromiseUtils.defer());
- deferred.resolve(request);
- });
- },
-
- start: function() {
- this._httpServer = new HttpServer();
- this._httpServer.start(-1);
- this._started = true;
- this.clearRequests();
- this.resetPingHandler();
- },
-
- stop: function() {
- return new Promise(resolve => {
- this._httpServer.stop(resolve);
- this._started = false;
- });
- },
-
- clearRequests: function() {
- this._defers = [ PromiseUtils.defer() ];
- this._currentDeferred = 0;
- },
-
- promiseNextRequest: function() {
- const deferred = this._defers[this._currentDeferred++];
- // Send the ping to the consumer on the next tick, so that the completion gets
- // signaled to Telemetry.
- return new Promise(r => Services.tm.currentThread.dispatch(() => r(deferred.promise),
- Ci.nsIThread.DISPATCH_NORMAL));
- },
-
- promiseNextPing: function() {
- return this.promiseNextRequest().then(request => decodeRequestPayload(request));
- },
-
- promiseNextRequests: Task.async(function*(count) {
- let results = [];
- for (let i=0; i<count; ++i) {
- results.push(yield this.promiseNextRequest());
- }
-
- return results;
- }),
-
- promiseNextPings: function(count) {
- return this.promiseNextRequests(count).then(requests => {
- return Array.from(requests, decodeRequestPayload);
- });
- },
-};
-
-/**
- * Decode the payload of an HTTP request into a ping.
- * @param {Object} request The data representing an HTTP request (nsIHttpRequest).
- * @return {Object} The decoded ping payload.
- */
-function decodeRequestPayload(request) {
- let s = request.bodyInputStream;
- let payload = null;
- let decoder = Cc["@mozilla.org/dom/json;1"].createInstance(Ci.nsIJSON)
-
- if (request.getHeader("content-encoding") == "gzip") {
- let observer = {
- buffer: "",
- onStreamComplete: function(loader, context, status, length, result) {
- this.buffer = String.fromCharCode.apply(this, result);
- }
- };
-
- let scs = Cc["@mozilla.org/streamConverters;1"]
- .getService(Ci.nsIStreamConverterService);
- let listener = Cc["@mozilla.org/network/stream-loader;1"]
- .createInstance(Ci.nsIStreamLoader);
- listener.init(observer);
- let converter = scs.asyncConvertData("gzip", "uncompressed",
- listener, null);
- converter.onStartRequest(null, null);
- converter.onDataAvailable(null, null, s, 0, s.available());
- converter.onStopRequest(null, null, null);
- let unicodeConverter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
- .createInstance(Ci.nsIScriptableUnicodeConverter);
- unicodeConverter.charset = "UTF-8";
- let utf8string = unicodeConverter.ConvertToUnicode(observer.buffer);
- utf8string += unicodeConverter.Finish();
- payload = JSON.parse(utf8string);
- } else {
- payload = decoder.decodeFromStream(s, s.available());
- }
-
- return payload;
-}
-
-function wrapWithExceptionHandler(f) {
- function wrapper(...args) {
- try {
- f(...args);
- } catch (ex) {
- if (typeof(ex) != 'object') {
- throw ex;
- }
- dump("Caught exception: " + ex.message + "\n");
- dump(ex.stack);
- do_test_finished();
- }
- }
- return wrapper;
-}
-
-function loadAddonManager(...args) {
- AddonTestUtils.init(gGlobalScope);
- AddonTestUtils.overrideCertDB();
- createAppInfo(...args);
-
- // As we're not running in application, we need to setup the features directory
- // used by system add-ons.
- const distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "app0"], true);
- AddonTestUtils.registerDirectory("XREAppFeat", distroDir);
- return AddonTestUtils.promiseStartupManager();
-}
-
-var gAppInfo = null;
-
-function createAppInfo(ID="xpcshell@tests.mozilla.org", name="XPCShell",
- version="1.0", platformVersion="1.0") {
- AddonTestUtils.createAppInfo(ID, name, version, platformVersion);
- gAppInfo = AddonTestUtils.appInfo;
-}
-
-// Fake the timeout functions for the TelemetryScheduler.
-function fakeSchedulerTimer(set, clear) {
- let session = Cu.import("resource://gre/modules/TelemetrySession.jsm");
- session.Policy.setSchedulerTickTimeout = set;
- session.Policy.clearSchedulerTickTimeout = clear;
-}
-
-/**
- * Fake the current date.
- * This passes all received arguments to a new Date constructor and
- * uses the resulting date to fake the time in Telemetry modules.
- *
- * @return Date The new faked date.
- */
-function fakeNow(...args) {
- const date = new Date(...args);
- const modules = [
- Cu.import("resource://gre/modules/TelemetrySession.jsm"),
- Cu.import("resource://gre/modules/TelemetryEnvironment.jsm"),
- Cu.import("resource://gre/modules/TelemetryController.jsm"),
- Cu.import("resource://gre/modules/TelemetryStorage.jsm"),
- Cu.import("resource://gre/modules/TelemetrySend.jsm"),
- Cu.import("resource://gre/modules/TelemetryReportingPolicy.jsm"),
- ];
-
- for (let m of modules) {
- m.Policy.now = () => date;
- }
-
- return new Date(date);
-}
-
-function fakeMonotonicNow(ms) {
- const m = Cu.import("resource://gre/modules/TelemetrySession.jsm");
- m.Policy.monotonicNow = () => ms;
- return ms;
-}
-
-// Fake the timeout functions for TelemetryController sending.
-function fakePingSendTimer(set, clear) {
- let module = Cu.import("resource://gre/modules/TelemetrySend.jsm");
- let obj = Cu.cloneInto({set, clear}, module, {cloneFunctions:true});
- module.Policy.setSchedulerTickTimeout = obj.set;
- module.Policy.clearSchedulerTickTimeout = obj.clear;
-}
-
-function fakeMidnightPingFuzzingDelay(delayMs) {
- let module = Cu.import("resource://gre/modules/TelemetrySend.jsm");
- module.Policy.midnightPingFuzzingDelay = () => delayMs;
-}
-
-function fakeGeneratePingId(func) {
- let module = Cu.import("resource://gre/modules/TelemetryController.jsm");
- module.Policy.generatePingId = func;
-}
-
-function fakeCachedClientId(uuid) {
- let module = Cu.import("resource://gre/modules/TelemetryController.jsm");
- module.Policy.getCachedClientID = () => uuid;
-}
-
-// Return a date that is |offset| ms in the future from |date|.
-function futureDate(date, offset) {
- return new Date(date.getTime() + offset);
-}
-
-function truncateToDays(aMsec) {
- return Math.floor(aMsec / MILLISECONDS_PER_DAY);
-}
-
-// Returns a promise that resolves to true when the passed promise rejects,
-// false otherwise.
-function promiseRejects(promise) {
- return promise.then(() => false, () => true);
-}
-
-// Generates a random string of at least a specific length.
-function generateRandomString(length) {
- let string = "";
-
- while (string.length < length) {
- string += Math.random().toString(36);
- }
-
- return string.substring(0, length);
-}
-
-// Short-hand for retrieving the histogram with that id.
-function getHistogram(histogramId) {
- return Telemetry.getHistogramById(histogramId);
-}
-
-// Short-hand for retrieving the snapshot of the Histogram with that id.
-function getSnapshot(histogramId) {
- return Telemetry.getHistogramById(histogramId).snapshot();
-}
-
-// Helper for setting an empty list of Environment preferences to watch.
-function setEmptyPrefWatchlist() {
- let TelemetryEnvironment =
- Cu.import("resource://gre/modules/TelemetryEnvironment.jsm").TelemetryEnvironment;
- return TelemetryEnvironment.onInitialized().then(() => {
- TelemetryEnvironment.testWatchPreferences(new Map());
- });
-}
-
-if (runningInParent) {
- // Set logging preferences for all the tests.
- Services.prefs.setCharPref("toolkit.telemetry.log.level", "Trace");
- // Telemetry archiving should be on.
- Services.prefs.setBoolPref("toolkit.telemetry.archive.enabled", true);
- // Telemetry xpcshell tests cannot show the infobar.
- Services.prefs.setBoolPref("datareporting.policy.dataSubmissionPolicyBypassNotification", true);
- // FHR uploads should be enabled.
- Services.prefs.setBoolPref("datareporting.healthreport.uploadEnabled", true);
-
- fakePingSendTimer((callback, timeout) => {
- Services.tm.mainThread.dispatch(() => callback(), Ci.nsIThread.DISPATCH_NORMAL);
- },
- () => {});
-
- do_register_cleanup(() => TelemetrySend.shutdown());
-}
-
-TelemetryController.testInitLogging();
-
-// Avoid timers interrupting test behavior.
-fakeSchedulerTimer(() => {}, () => {});
-// Make pind sending predictable.
-fakeMidnightPingFuzzingDelay(0);
diff --git a/toolkit/components/telemetry/tests/unit/test_ChildHistograms.js b/toolkit/components/telemetry/tests/unit/test_ChildHistograms.js
deleted file mode 100644
index 11d730499..000000000
--- a/toolkit/components/telemetry/tests/unit/test_ChildHistograms.js
+++ /dev/null
@@ -1,107 +0,0 @@
-
-Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySession.jsm", this);
-Cu.import("resource://gre/modules/PromiseUtils.jsm", this);
-Cu.import("resource://testing-common/ContentTaskUtils.jsm", this);
-
-const MESSAGE_TELEMETRY_PAYLOAD = "Telemetry:Payload";
-const MESSAGE_TELEMETRY_GET_CHILD_PAYLOAD = "Telemetry:GetChildPayload";
-const MESSAGE_CHILD_TEST_DONE = "ChildTest:Done";
-
-const PLATFORM_VERSION = "1.9.2";
-const APP_VERSION = "1";
-const APP_ID = "xpcshell@tests.mozilla.org";
-const APP_NAME = "XPCShell";
-
-function run_child_test() {
- // Setup histograms with some fixed values.
- let flagHist = Telemetry.getHistogramById("TELEMETRY_TEST_FLAG");
- flagHist.add(1);
- let countHist = Telemetry.getHistogramById("TELEMETRY_TEST_COUNT");
- Telemetry.setHistogramRecordingEnabled("TELEMETRY_TEST_COUNT", false);
- countHist.add();
- Telemetry.setHistogramRecordingEnabled("TELEMETRY_TEST_COUNT", true);
- countHist.add();
- countHist.add();
- let categHist = Telemetry.getHistogramById("TELEMETRY_TEST_CATEGORICAL");
- categHist.add("Label2");
- categHist.add("Label3");
-
- let flagKeyed = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_FLAG");
- flagKeyed.add("a", 1);
- flagKeyed.add("b", 1);
- let countKeyed = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_COUNT");
- Telemetry.setHistogramRecordingEnabled("TELEMETRY_TEST_KEYED_COUNT", false);
- countKeyed.add("a");
- countKeyed.add("b");
- Telemetry.setHistogramRecordingEnabled("TELEMETRY_TEST_KEYED_COUNT", true);
- countKeyed.add("a");
- countKeyed.add("b");
- countKeyed.add("b");
-}
-
-function check_histogram_values(payload) {
- const hs = payload.histograms;
- Assert.ok("TELEMETRY_TEST_COUNT" in hs, "Should have count test histogram.");
- Assert.ok("TELEMETRY_TEST_FLAG" in hs, "Should have flag test histogram.");
- Assert.ok("TELEMETRY_TEST_CATEGORICAL" in hs, "Should have categorical test histogram.");
- Assert.equal(hs["TELEMETRY_TEST_COUNT"].sum, 2,
- "Count test histogram should have the right value.");
- Assert.equal(hs["TELEMETRY_TEST_FLAG"].sum, 1,
- "Flag test histogram should have the right value.");
- Assert.equal(hs["TELEMETRY_TEST_CATEGORICAL"].sum, 3,
- "Categorical test histogram should have the right sum.");
-
- const kh = payload.keyedHistograms;
- Assert.ok("TELEMETRY_TEST_KEYED_COUNT" in kh, "Should have keyed count test histogram.");
- Assert.ok("TELEMETRY_TEST_KEYED_FLAG" in kh, "Should have keyed flag test histogram.");
- Assert.equal(kh["TELEMETRY_TEST_KEYED_COUNT"]["a"].sum, 1,
- "Keyed count test histogram should have the right value.");
- Assert.equal(kh["TELEMETRY_TEST_KEYED_COUNT"]["b"].sum, 2,
- "Keyed count test histogram should have the right value.");
- Assert.equal(kh["TELEMETRY_TEST_KEYED_FLAG"]["a"].sum, 1,
- "Keyed flag test histogram should have the right value.");
- Assert.equal(kh["TELEMETRY_TEST_KEYED_FLAG"]["b"].sum, 1,
- "Keyed flag test histogram should have the right value.");
-}
-
-add_task(function*() {
- if (!runningInParent) {
- TelemetryController.testSetupContent();
- run_child_test();
- dump("... done with child test\n");
- do_send_remote_message(MESSAGE_CHILD_TEST_DONE);
- return;
- }
-
- // Setup.
- do_get_profile(true);
- loadAddonManager(APP_ID, APP_NAME, APP_VERSION, PLATFORM_VERSION);
- Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
- yield TelemetryController.testSetup();
- if (runningInParent) {
- // Make sure we don't generate unexpected pings due to pref changes.
- yield setEmptyPrefWatchlist();
- }
-
- // Run test in child, don't wait for it to finish.
- run_test_in_child("test_ChildHistograms.js");
- yield do_await_remote_message(MESSAGE_CHILD_TEST_DONE);
-
- yield ContentTaskUtils.waitForCondition(() => {
- let payload = TelemetrySession.getPayload("test-ping");
- return payload &&
- "processes" in payload &&
- "content" in payload.processes &&
- "histograms" in payload.processes.content &&
- "TELEMETRY_TEST_COUNT" in payload.processes.content.histograms;
- });
- const payload = TelemetrySession.getPayload("test-ping");
- Assert.ok("processes" in payload, "Should have processes section");
- Assert.ok("content" in payload.processes, "Should have child process section");
- Assert.ok("histograms" in payload.processes.content, "Child process section should have histograms.");
- Assert.ok("keyedHistograms" in payload.processes.content, "Child process section should have keyed histograms.");
- check_histogram_values(payload.processes.content);
-
- do_test_finished();
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_PingAPI.js b/toolkit/components/telemetry/tests/unit/test_PingAPI.js
deleted file mode 100644
index d4d79aad4..000000000
--- a/toolkit/components/telemetry/tests/unit/test_PingAPI.js
+++ /dev/null
@@ -1,502 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
-*/
-
-// This tests the public Telemetry API for submitting pings.
-
-"use strict";
-
-Cu.import("resource://gre/modules/ClientID.jsm", this);
-Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/TelemetryArchive.jsm", this);
-Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://gre/modules/osfile.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-
-XPCOMUtils.defineLazyGetter(this, "gPingsArchivePath", function() {
- return OS.Path.join(OS.Constants.Path.profileDir, "datareporting", "archived");
-});
-
-/**
- * Fakes the archive storage quota.
- * @param {Integer} aArchiveQuota The new quota, in bytes.
- */
-function fakeStorageQuota(aArchiveQuota) {
- let storage = Cu.import("resource://gre/modules/TelemetryStorage.jsm");
- storage.Policy.getArchiveQuota = () => aArchiveQuota;
-}
-
-/**
- * Lists all the valid archived pings and their metadata, sorted by creation date.
- *
- * @param aFileName {String} The filename.
- * @return {Object[]} A list of objects with the extracted data in the form:
- * { timestamp: <number>,
- * id: <string>,
- * type: <string>,
- * size: <integer> }
- */
-var getArchivedPingsInfo = Task.async(function*() {
- let dirIterator = new OS.File.DirectoryIterator(gPingsArchivePath);
- let subdirs = (yield dirIterator.nextBatch()).filter(e => e.isDir);
- let archivedPings = [];
-
- // Iterate through the subdirs of |gPingsArchivePath|.
- for (let dir of subdirs) {
- let fileIterator = new OS.File.DirectoryIterator(dir.path);
- let files = (yield fileIterator.nextBatch()).filter(e => !e.isDir);
-
- // Then get a list of the files for the current subdir.
- for (let f of files) {
- let pingInfo = TelemetryStorage._testGetArchivedPingDataFromFileName(f.name);
- if (!pingInfo) {
- // This is not a valid archived ping, skip it.
- continue;
- }
- // Find the size of the ping and then add the info to the array.
- pingInfo.size = (yield OS.File.stat(f.path)).size;
- archivedPings.push(pingInfo);
- }
- }
-
- // Sort the list by creation date and then return it.
- archivedPings.sort((a, b) => b.timestamp - a.timestamp);
- return archivedPings;
-});
-
-add_task(function* test_setup() {
- do_get_profile(true);
- // Make sure we don't generate unexpected pings due to pref changes.
- yield setEmptyPrefWatchlist();
- Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
-});
-
-add_task(function* test_archivedPings() {
- // TelemetryController should not be fully initialized at this point.
- // Submitting pings should still work fine.
-
- const PINGS = [
- {
- type: "test-ping-api-1",
- payload: { foo: "bar"},
- dateCreated: new Date(2010, 1, 1, 10, 0, 0),
- },
- {
- type: "test-ping-api-2",
- payload: { moo: "meh"},
- dateCreated: new Date(2010, 2, 1, 10, 0, 0),
- },
- ];
-
- // Submit pings and check the ping list.
- let expectedPingList = [];
-
- for (let data of PINGS) {
- fakeNow(data.dateCreated);
- data.id = yield TelemetryController.submitExternalPing(data.type, data.payload);
- let list = yield TelemetryArchive.promiseArchivedPingList();
-
- expectedPingList.push({
- id: data.id,
- type: data.type,
- timestampCreated: data.dateCreated.getTime(),
- });
- Assert.deepEqual(list, expectedPingList, "Archived ping list should contain submitted pings");
- }
-
- // Check loading the archived pings.
- let checkLoadingPings = Task.async(function*() {
- for (let data of PINGS) {
- let ping = yield TelemetryArchive.promiseArchivedPingById(data.id);
- Assert.equal(ping.id, data.id, "Archived ping should have matching id");
- Assert.equal(ping.type, data.type, "Archived ping should have matching type");
- Assert.equal(ping.creationDate, data.dateCreated.toISOString(),
- "Archived ping should have matching creation date");
- }
- });
-
- yield checkLoadingPings();
-
- // Check that we find the archived pings again by scanning after a restart.
- yield TelemetryController.testReset();
-
- let pingList = yield TelemetryArchive.promiseArchivedPingList();
- Assert.deepEqual(expectedPingList, pingList,
- "Should have submitted pings in archive list after restart");
- yield checkLoadingPings();
-
- // Write invalid pings into the archive with both valid and invalid names.
- let writeToArchivedDir = Task.async(function*(dirname, filename, content, compressed) {
- const dirPath = OS.Path.join(gPingsArchivePath, dirname);
- yield OS.File.makeDir(dirPath, { ignoreExisting: true });
- const filePath = OS.Path.join(dirPath, filename);
- const options = { tmpPath: filePath + ".tmp", noOverwrite: false };
- if (compressed) {
- options.compression = "lz4";
- }
- yield OS.File.writeAtomic(filePath, content, options);
- });
-
- const FAKE_ID1 = "10000000-0123-0123-0123-0123456789a1";
- const FAKE_ID2 = "20000000-0123-0123-0123-0123456789a2";
- const FAKE_ID3 = "20000000-0123-0123-0123-0123456789a3";
- const FAKE_TYPE = "foo";
-
- // These should get rejected.
- yield writeToArchivedDir("xx", "foo.json", "{}");
- yield writeToArchivedDir("2010-02", "xx.xx.xx.json", "{}");
- // This one should get picked up...
- yield writeToArchivedDir("2010-02", "1." + FAKE_ID1 + "." + FAKE_TYPE + ".json", "{}");
- // ... but get overwritten by this one.
- yield writeToArchivedDir("2010-02", "2." + FAKE_ID1 + "." + FAKE_TYPE + ".json", "");
- // This should get picked up fine.
- yield writeToArchivedDir("2010-02", "3." + FAKE_ID2 + "." + FAKE_TYPE + ".json", "");
- // This compressed ping should get picked up fine as well.
- yield writeToArchivedDir("2010-02", "4." + FAKE_ID3 + "." + FAKE_TYPE + ".jsonlz4", "");
-
- expectedPingList.push({
- id: FAKE_ID1,
- type: "foo",
- timestampCreated: 2,
- });
- expectedPingList.push({
- id: FAKE_ID2,
- type: "foo",
- timestampCreated: 3,
- });
- expectedPingList.push({
- id: FAKE_ID3,
- type: "foo",
- timestampCreated: 4,
- });
- expectedPingList.sort((a, b) => a.timestampCreated - b.timestampCreated);
-
- // Reset the TelemetryArchive so we scan the archived dir again.
- yield TelemetryController.testReset();
-
- // Check that we are still picking up the valid archived pings on disk,
- // plus the valid ones above.
- pingList = yield TelemetryArchive.promiseArchivedPingList();
- Assert.deepEqual(expectedPingList, pingList, "Should have picked up valid archived pings");
- yield checkLoadingPings();
-
- // Now check that we fail to load the two invalid pings from above.
- Assert.ok((yield promiseRejects(TelemetryArchive.promiseArchivedPingById(FAKE_ID1))),
- "Should have rejected invalid ping");
- Assert.ok((yield promiseRejects(TelemetryArchive.promiseArchivedPingById(FAKE_ID2))),
- "Should have rejected invalid ping");
-});
-
-add_task(function* test_archiveCleanup() {
- const PING_TYPE = "foo";
-
- // Empty the archive.
- yield OS.File.removeDir(gPingsArchivePath);
-
- Telemetry.getHistogramById("TELEMETRY_ARCHIVE_SCAN_PING_COUNT").clear();
- Telemetry.getHistogramById("TELEMETRY_ARCHIVE_DIRECTORIES_COUNT").clear();
- // Also reset these histograms to make sure normal sized pings don't get counted.
- Telemetry.getHistogramById("TELEMETRY_PING_SIZE_EXCEEDED_ARCHIVED").clear();
- Telemetry.getHistogramById("TELEMETRY_DISCARDED_ARCHIVED_PINGS_SIZE_MB").clear();
-
- // Build the cache. Nothing should be evicted as there's no ping directory.
- yield TelemetryController.testReset();
- yield TelemetryStorage.testCleanupTaskPromise();
- yield TelemetryArchive.promiseArchivedPingList();
-
- let h = Telemetry.getHistogramById("TELEMETRY_ARCHIVE_SCAN_PING_COUNT").snapshot();
- Assert.equal(h.sum, 0, "Telemetry must report 0 pings scanned if no archive dir exists.");
- // One directory out of four was removed as well.
- h = Telemetry.getHistogramById("TELEMETRY_ARCHIVE_EVICTED_OLD_DIRS").snapshot();
- Assert.equal(h.sum, 0, "Telemetry must report 0 evicted dirs if no archive dir exists.");
-
- let expectedPrunedInfo = [];
- let expectedNotPrunedInfo = [];
-
- let checkArchive = Task.async(function*() {
- // Check that the pruned pings are not on disk anymore.
- for (let prunedInfo of expectedPrunedInfo) {
- yield Assert.rejects(TelemetryArchive.promiseArchivedPingById(prunedInfo.id),
- "Ping " + prunedInfo.id + " should have been pruned.");
- const pingPath =
- TelemetryStorage._testGetArchivedPingPath(prunedInfo.id, prunedInfo.creationDate, PING_TYPE);
- Assert.ok(!(yield OS.File.exists(pingPath)), "The ping should not be on the disk anymore.");
- }
-
- // Check that the expected pings are there.
- for (let expectedInfo of expectedNotPrunedInfo) {
- Assert.ok((yield TelemetryArchive.promiseArchivedPingById(expectedInfo.id)),
- "Ping" + expectedInfo.id + " should be in the archive.");
- }
- });
-
- Telemetry.getHistogramById("TELEMETRY_ARCHIVE_SESSION_PING_COUNT").clear();
-
- // Create a ping which should be pruned because it is past the retention period.
- let date = fakeNow(2010, 1, 1, 1, 0, 0);
- let firstDate = date;
- let pingId = yield TelemetryController.submitExternalPing(PING_TYPE, {}, {});
- expectedPrunedInfo.push({ id: pingId, creationDate: date });
-
- // Create a ping which should be kept because it is within the retention period.
- const oldestDirectoryDate = fakeNow(2010, 2, 1, 1, 0, 0);
- pingId = yield TelemetryController.submitExternalPing(PING_TYPE, {}, {});
- expectedNotPrunedInfo.push({ id: pingId, creationDate: oldestDirectoryDate });
-
- // Create 20 other pings which are within the retention period, but would be affected
- // by the disk quota.
- for (let month of [3, 4]) {
- for (let minute = 0; minute < 10; minute++) {
- date = fakeNow(2010, month, 1, 1, minute, 0);
- pingId = yield TelemetryController.submitExternalPing(PING_TYPE, {}, {});
- expectedNotPrunedInfo.push({ id: pingId, creationDate: date });
- }
- }
-
- // We expect all the pings we archived to be in this histogram.
- h = Telemetry.getHistogramById("TELEMETRY_ARCHIVE_SESSION_PING_COUNT");
- Assert.equal(h.snapshot().sum, 22, "All the pings must be live-accumulated in the histogram.");
- // Reset the histogram that will be populated by the archive scan.
- Telemetry.getHistogramById("TELEMETRY_ARCHIVE_EVICTED_OLD_DIRS").clear();
- Telemetry.getHistogramById("TELEMETRY_ARCHIVE_OLDEST_DIRECTORY_AGE").clear();
-
- // Move the current date 60 days ahead of the first ping.
- fakeNow(futureDate(firstDate, 60 * MILLISECONDS_PER_DAY));
- // Reset TelemetryArchive and TelemetryController to start the startup cleanup.
- yield TelemetryController.testReset();
- // Wait for the cleanup to finish.
- yield TelemetryStorage.testCleanupTaskPromise();
- // Then scan the archived dir.
- yield TelemetryArchive.promiseArchivedPingList();
-
- // Check that the archive is in the correct state.
- yield checkArchive();
-
- // Make sure the ping count is correct after the scan (one ping was removed).
- h = Telemetry.getHistogramById("TELEMETRY_ARCHIVE_SCAN_PING_COUNT").snapshot();
- Assert.equal(h.sum, 21, "The histogram must count all the pings in the archive.");
- // One directory out of four was removed as well.
- h = Telemetry.getHistogramById("TELEMETRY_ARCHIVE_EVICTED_OLD_DIRS").snapshot();
- Assert.equal(h.sum, 1, "Telemetry must correctly report removed archive directories.");
- // Check that the remaining directories are correctly counted.
- h = Telemetry.getHistogramById("TELEMETRY_ARCHIVE_DIRECTORIES_COUNT").snapshot();
- Assert.equal(h.sum, 3, "Telemetry must correctly report the remaining archive directories.");
- // Check that the remaining directories are correctly counted.
- const oldestAgeInMonths = 1;
- h = Telemetry.getHistogramById("TELEMETRY_ARCHIVE_OLDEST_DIRECTORY_AGE").snapshot();
- Assert.equal(h.sum, oldestAgeInMonths,
- "Telemetry must correctly report age of the oldest directory in the archive.");
-
- // We need to test the archive size before we hit the quota, otherwise a special
- // value is recorded.
- Telemetry.getHistogramById("TELEMETRY_ARCHIVE_SIZE_MB").clear();
- Telemetry.getHistogramById("TELEMETRY_ARCHIVE_EVICTED_OVER_QUOTA").clear();
- Telemetry.getHistogramById("TELEMETRY_ARCHIVE_EVICTING_OVER_QUOTA_MS").clear();
-
- // Move the current date 60 days ahead of the second ping.
- fakeNow(futureDate(oldestDirectoryDate, 60 * MILLISECONDS_PER_DAY));
- // Reset TelemetryController and TelemetryArchive.
- yield TelemetryController.testReset();
- // Wait for the cleanup to finish.
- yield TelemetryStorage.testCleanupTaskPromise();
- // Then scan the archived dir again.
- yield TelemetryArchive.promiseArchivedPingList();
-
- // Move the oldest ping to the unexpected pings list.
- expectedPrunedInfo.push(expectedNotPrunedInfo.shift());
- // Check that the archive is in the correct state.
- yield checkArchive();
-
- // Find how much disk space the archive takes.
- const archivedPingsInfo = yield getArchivedPingsInfo();
- let archiveSizeInBytes =
- archivedPingsInfo.reduce((lastResult, element) => lastResult + element.size, 0);
-
- // Check that the correct values for quota probes are reported when no quota is hit.
- h = Telemetry.getHistogramById("TELEMETRY_ARCHIVE_SIZE_MB").snapshot();
- Assert.equal(h.sum, Math.round(archiveSizeInBytes / 1024 / 1024),
- "Telemetry must report the correct archive size.");
- h = Telemetry.getHistogramById("TELEMETRY_ARCHIVE_EVICTED_OVER_QUOTA").snapshot();
- Assert.equal(h.sum, 0, "Telemetry must report 0 evictions if quota is not hit.");
- h = Telemetry.getHistogramById("TELEMETRY_ARCHIVE_EVICTING_OVER_QUOTA_MS").snapshot();
- Assert.equal(h.sum, 0, "Telemetry must report a null elapsed time if quota is not hit.");
-
- // Set the quota to 80% of the space.
- const testQuotaInBytes = archiveSizeInBytes * 0.8;
- fakeStorageQuota(testQuotaInBytes);
-
- // The storage prunes archived pings until we reach 90% of the requested storage quota.
- // Based on that, find how many pings should be kept.
- const safeQuotaSize = testQuotaInBytes * 0.9;
- let sizeInBytes = 0;
- let pingsWithinQuota = [];
- let pingsOutsideQuota = [];
-
- for (let pingInfo of archivedPingsInfo) {
- sizeInBytes += pingInfo.size;
- if (sizeInBytes >= safeQuotaSize) {
- pingsOutsideQuota.push({ id: pingInfo.id, creationDate: new Date(pingInfo.timestamp) });
- continue;
- }
- pingsWithinQuota.push({ id: pingInfo.id, creationDate: new Date(pingInfo.timestamp) });
- }
-
- expectedNotPrunedInfo = pingsWithinQuota;
- expectedPrunedInfo = expectedPrunedInfo.concat(pingsOutsideQuota);
-
- // Reset TelemetryArchive and TelemetryController to start the startup cleanup.
- yield TelemetryController.testReset();
- yield TelemetryStorage.testCleanupTaskPromise();
- yield TelemetryArchive.promiseArchivedPingList();
- // Check that the archive is in the correct state.
- yield checkArchive();
-
- h = Telemetry.getHistogramById("TELEMETRY_ARCHIVE_EVICTED_OVER_QUOTA").snapshot();
- Assert.equal(h.sum, pingsOutsideQuota.length,
- "Telemetry must correctly report the over quota pings evicted from the archive.");
- h = Telemetry.getHistogramById("TELEMETRY_ARCHIVE_SIZE_MB").snapshot();
- Assert.equal(h.sum, 300, "Archive quota was hit, a special size must be reported.");
-
- // Trigger a cleanup again and make sure we're not removing anything.
- yield TelemetryController.testReset();
- yield TelemetryStorage.testCleanupTaskPromise();
- yield TelemetryArchive.promiseArchivedPingList();
- yield checkArchive();
-
- const OVERSIZED_PING_ID = "9b21ec8f-f762-4d28-a2c1-44e1c4694f24";
- // Create and archive an oversized, uncompressed, ping.
- const OVERSIZED_PING = {
- id: OVERSIZED_PING_ID,
- type: PING_TYPE,
- creationDate: (new Date()).toISOString(),
- // Generate a ~2MB string to use as the payload.
- payload: generateRandomString(2 * 1024 * 1024)
- };
- yield TelemetryArchive.promiseArchivePing(OVERSIZED_PING);
-
- // Get the size of the archived ping.
- const oversizedPingPath =
- TelemetryStorage._testGetArchivedPingPath(OVERSIZED_PING.id, new Date(OVERSIZED_PING.creationDate), PING_TYPE) + "lz4";
- const archivedPingSizeMB = Math.floor((yield OS.File.stat(oversizedPingPath)).size / 1024 / 1024);
-
- // We expect the oversized ping to be pruned when scanning the archive.
- expectedPrunedInfo.push({ id: OVERSIZED_PING_ID, creationDate: new Date(OVERSIZED_PING.creationDate) });
-
- // Scan the archive.
- yield TelemetryController.testReset();
- yield TelemetryStorage.testCleanupTaskPromise();
- yield TelemetryArchive.promiseArchivedPingList();
- // The following also checks that non oversized pings are not removed.
- yield checkArchive();
-
- // Make sure we're correctly updating the related histograms.
- h = Telemetry.getHistogramById("TELEMETRY_PING_SIZE_EXCEEDED_ARCHIVED").snapshot();
- Assert.equal(h.sum, 1, "Telemetry must report 1 oversized ping in the archive.");
- h = Telemetry.getHistogramById("TELEMETRY_DISCARDED_ARCHIVED_PINGS_SIZE_MB").snapshot();
- Assert.equal(h.counts[archivedPingSizeMB], 1,
- "Telemetry must report the correct size for the oversized ping.");
-});
-
-add_task(function* test_clientId() {
- // Check that a ping submitted after the delayed telemetry initialization completed
- // should get a valid client id.
- yield TelemetryController.testReset();
- const clientId = yield ClientID.getClientID();
-
- let id = yield TelemetryController.submitExternalPing("test-type", {}, {addClientId: true});
- let ping = yield TelemetryArchive.promiseArchivedPingById(id);
-
- Assert.ok(!!ping, "Should have loaded the ping.");
- Assert.ok("clientId" in ping, "Ping should have a client id.");
- Assert.ok(UUID_REGEX.test(ping.clientId), "Client id is in UUID format.");
- Assert.equal(ping.clientId, clientId, "Ping client id should match the global client id.");
-
- // We should have cached the client id now. Lets confirm that by
- // checking the client id on a ping submitted before the async
- // controller setup is finished.
- let promiseSetup = TelemetryController.testReset();
- id = yield TelemetryController.submitExternalPing("test-type", {}, {addClientId: true});
- ping = yield TelemetryArchive.promiseArchivedPingById(id);
- Assert.equal(ping.clientId, clientId);
-
- // Finish setup.
- yield promiseSetup;
-});
-
-add_task(function* test_InvalidPingType() {
- const TYPES = [
- "a",
- "-",
- "¿€€€?",
- "-foo-",
- "-moo",
- "zoo-",
- ".bar",
- "asfd.asdf",
- ];
-
- for (let type of TYPES) {
- let histogram = Telemetry.getKeyedHistogramById("TELEMETRY_INVALID_PING_TYPE_SUBMITTED");
- Assert.equal(histogram.snapshot(type).sum, 0,
- "Should not have counted this invalid ping yet: " + type);
- Assert.ok(promiseRejects(TelemetryController.submitExternalPing(type, {})),
- "Ping type should have been rejected.");
- Assert.equal(histogram.snapshot(type).sum, 1,
- "Should have counted this as an invalid ping type.");
- }
-});
-
-add_task(function* test_InvalidPayloadType() {
- const PAYLOAD_TYPES = [
- 19,
- "string",
- [1, 2, 3, 4],
- null,
- undefined,
- ];
-
- let histogram = Telemetry.getHistogramById("TELEMETRY_INVALID_PAYLOAD_SUBMITTED");
- for (let i = 0; i < PAYLOAD_TYPES.length; i++) {
- histogram.clear();
- Assert.equal(histogram.snapshot().sum, 0,
- "Should not have counted this invalid payload yet: " + JSON.stringify(PAYLOAD_TYPES[i]));
- Assert.ok(yield promiseRejects(TelemetryController.submitExternalPing("payload-test", PAYLOAD_TYPES[i])),
- "Payload type should have been rejected.");
- Assert.equal(histogram.snapshot().sum, 1,
- "Should have counted this as an invalid payload type.");
- }
-});
-
-add_task(function* test_currentPingData() {
- yield TelemetryController.testSetup();
-
- // Setup test data.
- let h = Telemetry.getHistogramById("TELEMETRY_TEST_RELEASE_OPTOUT");
- h.clear();
- h.add(1);
- let k = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_RELEASE_OPTOUT");
- k.clear();
- k.add("a", 1);
-
- // Get current ping data objects and check that their data is sane.
- for (let subsession of [true, false]) {
- let ping = TelemetryController.getCurrentPingData(subsession);
-
- Assert.ok(!!ping, "Should have gotten a ping.");
- Assert.equal(ping.type, "main", "Ping should have correct type.");
- const expectedReason = subsession ? "gather-subsession-payload" : "gather-payload";
- Assert.equal(ping.payload.info.reason, expectedReason, "Ping should have the correct reason.");
-
- let id = "TELEMETRY_TEST_RELEASE_OPTOUT";
- Assert.ok(id in ping.payload.histograms, "Payload should have test count histogram.");
- Assert.equal(ping.payload.histograms[id].sum, 1, "Test count value should match.");
- id = "TELEMETRY_TEST_KEYED_RELEASE_OPTOUT";
- Assert.ok(id in ping.payload.keyedHistograms, "Payload should have keyed test histogram.");
- Assert.equal(ping.payload.keyedHistograms[id]["a"].sum, 1, "Keyed test value should match.");
- }
-});
-
-add_task(function* test_shutdown() {
- yield TelemetryController.testShutdown();
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_SubsessionChaining.js b/toolkit/components/telemetry/tests/unit/test_SubsessionChaining.js
deleted file mode 100644
index c86fb0499..000000000
--- a/toolkit/components/telemetry/tests/unit/test_SubsessionChaining.js
+++ /dev/null
@@ -1,236 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
-*/
-
-Cu.import("resource://gre/modules/Preferences.jsm", this);
-Cu.import("resource://gre/modules/Promise.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm", this);
-Cu.import("resource://gre/modules/TelemetryArchive.jsm", this);
-Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/TelemetryEnvironment.jsm", this);
-Cu.import("resource://gre/modules/osfile.jsm", this);
-Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-
-const MS_IN_ONE_HOUR = 60 * 60 * 1000;
-const MS_IN_ONE_DAY = 24 * MS_IN_ONE_HOUR;
-
-const PREF_BRANCH = "toolkit.telemetry.";
-const PREF_ARCHIVE_ENABLED = PREF_BRANCH + "archive.enabled";
-
-const REASON_ABORTED_SESSION = "aborted-session";
-const REASON_DAILY = "daily";
-const REASON_ENVIRONMENT_CHANGE = "environment-change";
-const REASON_SHUTDOWN = "shutdown";
-
-XPCOMUtils.defineLazyGetter(this, "DATAREPORTING_PATH", function() {
- return OS.Path.join(OS.Constants.Path.profileDir, "datareporting");
-});
-
-var promiseValidateArchivedPings = Task.async(function*(aExpectedReasons) {
- // The list of ping reasons which mark the session end (and must reset the subsession
- // count).
- const SESSION_END_PING_REASONS = new Set([ REASON_ABORTED_SESSION, REASON_SHUTDOWN ]);
-
- let list = yield TelemetryArchive.promiseArchivedPingList();
-
- // We're just interested in the "main" pings.
- list = list.filter(p => p.type == "main");
-
- Assert.equal(aExpectedReasons.length, list.length, "All the expected pings must be received.");
-
- let previousPing = yield TelemetryArchive.promiseArchivedPingById(list[0].id);
- Assert.equal(aExpectedReasons.shift(), previousPing.payload.info.reason,
- "Telemetry should only get pings with expected reasons.");
- Assert.equal(previousPing.payload.info.previousSessionId, null,
- "The first session must report a null previous session id.");
- Assert.equal(previousPing.payload.info.previousSubsessionId, null,
- "The first subsession must report a null previous subsession id.");
- Assert.equal(previousPing.payload.info.profileSubsessionCounter, 1,
- "profileSubsessionCounter must be 1 the first time.");
- Assert.equal(previousPing.payload.info.subsessionCounter, 1,
- "subsessionCounter must be 1 the first time.");
-
- let expectedSubsessionCounter = 1;
- let expectedPreviousSessionId = previousPing.payload.info.sessionId;
-
- for (let i = 1; i < list.length; i++) {
- let currentPing = yield TelemetryArchive.promiseArchivedPingById(list[i].id);
- let currentInfo = currentPing.payload.info;
- let previousInfo = previousPing.payload.info;
- do_print("Archive entry " + i + " - id: " + currentPing.id + ", reason: " + currentInfo.reason);
-
- Assert.equal(aExpectedReasons.shift(), currentInfo.reason,
- "Telemetry should only get pings with expected reasons.");
- Assert.equal(currentInfo.previousSessionId, expectedPreviousSessionId,
- "Telemetry must correctly chain session identifiers.");
- Assert.equal(currentInfo.previousSubsessionId, previousInfo.subsessionId,
- "Telemetry must correctly chain subsession identifiers.");
- Assert.equal(currentInfo.profileSubsessionCounter, previousInfo.profileSubsessionCounter + 1,
- "Telemetry must correctly track the profile subsessions count.");
- Assert.equal(currentInfo.subsessionCounter, expectedSubsessionCounter,
- "The subsession counter should be monotonically increasing.");
-
- // Store the current ping as previous.
- previousPing = currentPing;
- // Reset the expected subsession counter, if required. Otherwise increment the expected
- // subsession counter.
- // If this is the final subsession of a session we need to update expected values accordingly.
- if (SESSION_END_PING_REASONS.has(currentInfo.reason)) {
- expectedSubsessionCounter = 1;
- expectedPreviousSessionId = currentInfo.sessionId;
- } else {
- expectedSubsessionCounter++;
- }
- }
-});
-
-add_task(function* test_setup() {
- do_test_pending();
-
- // Addon manager needs a profile directory
- do_get_profile();
- loadAddonManager("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
- // Make sure we don't generate unexpected pings due to pref changes.
- yield setEmptyPrefWatchlist();
-
- Preferences.set(PREF_TELEMETRY_ENABLED, true);
-});
-
-add_task(function* test_subsessionsChaining() {
- if (gIsAndroid) {
- // We don't support subsessions yet on Android, so skip the next checks.
- return;
- }
-
- const PREF_TEST = PREF_BRANCH + "test.pref1";
- const PREFS_TO_WATCH = new Map([
- [PREF_TEST, {what: TelemetryEnvironment.RECORD_PREF_VALUE}],
- ]);
- Preferences.reset(PREF_TEST);
-
- // Fake the clock data to manually trigger an aborted-session ping and a daily ping.
- // This is also helpful to make sure we get the archived pings in an expected order.
- let now = fakeNow(2009, 9, 18, 0, 0, 0);
- let monotonicNow = fakeMonotonicNow(1000);
-
- let moveClockForward = (minutes) => {
- let ms = minutes * MILLISECONDS_PER_MINUTE;
- now = fakeNow(futureDate(now, ms));
- monotonicNow = fakeMonotonicNow(monotonicNow + ms);
- }
-
- // Keep track of the ping reasons we're expecting in this test.
- let expectedReasons = [];
-
- // Start and shut down Telemetry. We expect a shutdown ping with profileSubsessionCounter: 1,
- // subsessionCounter: 1, subsessionId: A, and previousSubsessionId: null to be archived.
- yield TelemetryController.testSetup();
- yield TelemetryController.testShutdown();
- expectedReasons.push(REASON_SHUTDOWN);
-
- // Start Telemetry but don't wait for it to initialise before shutting down. We expect a
- // shutdown ping with profileSubsessionCounter: 2, subsessionCounter: 1, subsessionId: B
- // and previousSubsessionId: A to be archived.
- moveClockForward(30);
- TelemetryController.testReset();
- yield TelemetryController.testShutdown();
- expectedReasons.push(REASON_SHUTDOWN);
-
- // Start Telemetry and simulate an aborted-session ping. We expect an aborted-session ping
- // with profileSubsessionCounter: 3, subsessionCounter: 1, subsessionId: C and
- // previousSubsessionId: B to be archived.
- let schedulerTickCallback = null;
- fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
- yield TelemetryController.testReset();
- moveClockForward(6);
- // Trigger the an aborted session ping save. When testing,we are not saving the aborted-session
- // ping as soon as Telemetry starts, otherwise we would end up with unexpected pings being
- // sent when calling |TelemetryController.testReset()|, thus breaking some tests.
- Assert.ok(!!schedulerTickCallback);
- yield schedulerTickCallback();
- expectedReasons.push(REASON_ABORTED_SESSION);
-
- // Start Telemetry and trigger an environment change through a pref modification. We expect
- // an environment-change ping with profileSubsessionCounter: 4, subsessionCounter: 1,
- // subsessionId: D and previousSubsessionId: C to be archived.
- moveClockForward(30);
- yield TelemetryController.testReset();
- TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH);
- moveClockForward(30);
- Preferences.set(PREF_TEST, 1);
- expectedReasons.push(REASON_ENVIRONMENT_CHANGE);
-
- // Shut down Telemetry. We expect a shutdown ping with profileSubsessionCounter: 5,
- // subsessionCounter: 2, subsessionId: E and previousSubsessionId: D to be archived.
- moveClockForward(30);
- yield TelemetryController.testShutdown();
- expectedReasons.push(REASON_SHUTDOWN);
-
- // Start Telemetry and trigger a daily ping. We expect a daily ping with
- // profileSubsessionCounter: 6, subsessionCounter: 1, subsessionId: F and
- // previousSubsessionId: E to be archived.
- moveClockForward(30);
- yield TelemetryController.testReset();
-
- // Delay the callback around midnight.
- now = fakeNow(futureDate(now, MS_IN_ONE_DAY));
- // Trigger the daily ping.
- yield schedulerTickCallback();
- expectedReasons.push(REASON_DAILY);
-
- // Trigger an environment change ping. We expect an environment-changed ping with
- // profileSubsessionCounter: 7, subsessionCounter: 2, subsessionId: G and
- // previousSubsessionId: F to be archived.
- moveClockForward(30);
- Preferences.set(PREF_TEST, 0);
- expectedReasons.push(REASON_ENVIRONMENT_CHANGE);
-
- // Shut down Telemetry and trigger a shutdown ping.
- moveClockForward(30);
- yield TelemetryController.testShutdown();
- expectedReasons.push(REASON_SHUTDOWN);
-
- // Start Telemetry and trigger an environment change.
- yield TelemetryController.testReset();
- TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH);
- moveClockForward(30);
- Preferences.set(PREF_TEST, 1);
- expectedReasons.push(REASON_ENVIRONMENT_CHANGE);
-
- // Don't shut down, instead trigger an aborted-session ping.
- moveClockForward(6);
- // Trigger the an aborted session ping save.
- yield schedulerTickCallback();
- expectedReasons.push(REASON_ABORTED_SESSION);
-
- // Start Telemetry and trigger a daily ping.
- moveClockForward(30);
- yield TelemetryController.testReset();
- // Delay the callback around midnight.
- now = futureDate(now, MS_IN_ONE_DAY);
- fakeNow(now);
- // Trigger the daily ping.
- yield schedulerTickCallback();
- expectedReasons.push(REASON_DAILY);
-
- // Trigger an environment change.
- moveClockForward(30);
- Preferences.set(PREF_TEST, 0);
- expectedReasons.push(REASON_ENVIRONMENT_CHANGE);
-
- // And an aborted-session ping again.
- moveClockForward(6);
- // Trigger the an aborted session ping save.
- yield schedulerTickCallback();
- expectedReasons.push(REASON_ABORTED_SESSION);
-
- // Make sure the aborted-session ping gets archived.
- yield TelemetryController.testReset();
-
- yield promiseValidateArchivedPings(expectedReasons);
-});
-
-add_task(function* () {
- yield TelemetryController.testShutdown();
- do_test_finished();
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryController.js b/toolkit/components/telemetry/tests/unit/test_TelemetryController.js
deleted file mode 100644
index b383de6bf..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryController.js
+++ /dev/null
@@ -1,507 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
-*/
-/* This testcase triggers two telemetry pings.
- *
- * Telemetry code keeps histograms of past telemetry pings. The first
- * ping populates these histograms. One of those histograms is then
- * checked in the second request.
- */
-
-Cu.import("resource://gre/modules/ClientID.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/TelemetryStorage.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySend.jsm", this);
-Cu.import("resource://gre/modules/TelemetryArchive.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm", this);
-Cu.import("resource://gre/modules/Promise.jsm", this);
-Cu.import("resource://gre/modules/Preferences.jsm");
-
-const PING_FORMAT_VERSION = 4;
-const DELETION_PING_TYPE = "deletion";
-const TEST_PING_TYPE = "test-ping-type";
-
-const PLATFORM_VERSION = "1.9.2";
-const APP_VERSION = "1";
-const APP_NAME = "XPCShell";
-
-const PREF_BRANCH = "toolkit.telemetry.";
-const PREF_ENABLED = PREF_BRANCH + "enabled";
-const PREF_ARCHIVE_ENABLED = PREF_BRANCH + "archive.enabled";
-const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
-const PREF_UNIFIED = PREF_BRANCH + "unified";
-
-var gClientID = null;
-
-function sendPing(aSendClientId, aSendEnvironment) {
- if (PingServer.started) {
- TelemetrySend.setServer("http://localhost:" + PingServer.port);
- } else {
- TelemetrySend.setServer("http://doesnotexist");
- }
-
- let options = {
- addClientId: aSendClientId,
- addEnvironment: aSendEnvironment,
- };
- return TelemetryController.submitExternalPing(TEST_PING_TYPE, {}, options);
-}
-
-function checkPingFormat(aPing, aType, aHasClientId, aHasEnvironment) {
- const MANDATORY_PING_FIELDS = [
- "type", "id", "creationDate", "version", "application", "payload"
- ];
-
- const APPLICATION_TEST_DATA = {
- buildId: gAppInfo.appBuildID,
- name: APP_NAME,
- version: APP_VERSION,
- displayVersion: AppConstants.MOZ_APP_VERSION_DISPLAY,
- vendor: "Mozilla",
- platformVersion: PLATFORM_VERSION,
- xpcomAbi: "noarch-spidermonkey",
- };
-
- // Check that the ping contains all the mandatory fields.
- for (let f of MANDATORY_PING_FIELDS) {
- Assert.ok(f in aPing, f + " must be available.");
- }
-
- Assert.equal(aPing.type, aType, "The ping must have the correct type.");
- Assert.equal(aPing.version, PING_FORMAT_VERSION, "The ping must have the correct version.");
-
- // Test the application section.
- for (let f in APPLICATION_TEST_DATA) {
- Assert.equal(aPing.application[f], APPLICATION_TEST_DATA[f],
- f + " must have the correct value.");
- }
-
- // We can't check the values for channel and architecture. Just make
- // sure they are in.
- Assert.ok("architecture" in aPing.application,
- "The application section must have an architecture field.");
- Assert.ok("channel" in aPing.application,
- "The application section must have a channel field.");
-
- // Check the clientId and environment fields, as needed.
- Assert.equal("clientId" in aPing, aHasClientId);
- Assert.equal("environment" in aPing, aHasEnvironment);
-}
-
-add_task(function* test_setup() {
- // Addon manager needs a profile directory
- do_get_profile();
- loadAddonManager("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
- // Make sure we don't generate unexpected pings due to pref changes.
- yield setEmptyPrefWatchlist();
-
- Services.prefs.setBoolPref(PREF_ENABLED, true);
- Services.prefs.setBoolPref(PREF_FHR_UPLOAD_ENABLED, true);
-
- yield new Promise(resolve =>
- Telemetry.asyncFetchTelemetryData(wrapWithExceptionHandler(resolve)));
-});
-
-add_task(function* asyncSetup() {
- yield TelemetryController.testSetup();
-});
-
-// Ensure that not overwriting an existing file fails silently
-add_task(function* test_overwritePing() {
- let ping = {id: "foo"};
- yield TelemetryStorage.savePing(ping, true);
- yield TelemetryStorage.savePing(ping, false);
- yield TelemetryStorage.cleanupPingFile(ping);
-});
-
-// Checks that a sent ping is correctly received by a dummy http server.
-add_task(function* test_simplePing() {
- PingServer.start();
- // Update the Telemetry Server preference with the address of the local server.
- // Otherwise we might end up sending stuff to a non-existing server after
- // |TelemetryController.testReset| is called.
- Preferences.set(TelemetryController.Constants.PREF_SERVER, "http://localhost:" + PingServer.port);
-
- yield sendPing(false, false);
- let request = yield PingServer.promiseNextRequest();
-
- // Check that we have a version query parameter in the URL.
- Assert.notEqual(request.queryString, "");
-
- // Make sure the version in the query string matches the new ping format version.
- let params = request.queryString.split("&");
- Assert.ok(params.find(p => p == ("v=" + PING_FORMAT_VERSION)));
-
- let ping = decodeRequestPayload(request);
- checkPingFormat(ping, TEST_PING_TYPE, false, false);
-});
-
-add_task(function* test_disableDataUpload() {
- const isUnified = Preferences.get(PREF_UNIFIED, false);
- if (!isUnified) {
- // Skipping the test if unified telemetry is off, as no deletion ping will
- // be generated.
- return;
- }
-
- // Disable FHR upload: this should trigger a deletion ping.
- Preferences.set(PREF_FHR_UPLOAD_ENABLED, false);
-
- let ping = yield PingServer.promiseNextPing();
- checkPingFormat(ping, DELETION_PING_TYPE, true, false);
- // Wait on ping activity to settle.
- yield TelemetrySend.testWaitOnOutgoingPings();
-
- // Restore FHR Upload.
- Preferences.set(PREF_FHR_UPLOAD_ENABLED, true);
-
- // Simulate a failure in sending the deletion ping by disabling the HTTP server.
- yield PingServer.stop();
-
- // Try to send a ping. It will be saved as pending and get deleted when disabling upload.
- TelemetryController.submitExternalPing(TEST_PING_TYPE, {});
-
- // Disable FHR upload to send a deletion ping again.
- Preferences.set(PREF_FHR_UPLOAD_ENABLED, false);
-
- // Wait on sending activity to settle, as |TelemetryController.testReset()| doesn't do that.
- yield TelemetrySend.testWaitOnOutgoingPings();
- // Wait for the pending pings to be deleted. Resetting TelemetryController doesn't
- // trigger the shutdown, so we need to call it ourselves.
- yield TelemetryStorage.shutdown();
- // Simulate a restart, and spin the send task.
- yield TelemetryController.testReset();
-
- // Disabling Telemetry upload must clear out all the pending pings.
- let pendingPings = yield TelemetryStorage.loadPendingPingList();
- Assert.equal(pendingPings.length, 1,
- "All the pending pings but the deletion ping should have been deleted");
-
- // Enable the ping server again.
- PingServer.start();
- // We set the new server using the pref, otherwise it would get reset with
- // |TelemetryController.testReset|.
- Preferences.set(TelemetryController.Constants.PREF_SERVER, "http://localhost:" + PingServer.port);
-
- // Stop the sending task and then start it again.
- yield TelemetrySend.shutdown();
- // Reset the controller to spin the ping sending task.
- yield TelemetryController.testReset();
- ping = yield PingServer.promiseNextPing();
- checkPingFormat(ping, DELETION_PING_TYPE, true, false);
-
- // Wait on ping activity to settle before moving on to the next test. If we were
- // to shut down telemetry, even though the PingServer caught the expected pings,
- // TelemetrySend could still be processing them (clearing pings would happen in
- // a couple of ticks). Shutting down would cancel the request and save them as
- // pending pings.
- yield TelemetrySend.testWaitOnOutgoingPings();
- // Restore FHR Upload.
- Preferences.set(PREF_FHR_UPLOAD_ENABLED, true);
-});
-
-add_task(function* test_pingHasClientId() {
- const PREF_CACHED_CLIENTID = "toolkit.telemetry.cachedClientID";
-
- // Make sure we have no cached client ID for this test: we'll try to send
- // a ping with it while Telemetry is being initialized.
- Preferences.reset(PREF_CACHED_CLIENTID);
- yield TelemetryController.testShutdown();
- yield ClientID._reset();
- yield TelemetryStorage.testClearPendingPings();
- // And also clear the counter histogram since we're here.
- let h = Telemetry.getHistogramById("TELEMETRY_PING_SUBMISSION_WAITING_CLIENTID");
- h.clear();
-
- // Init telemetry and try to send a ping with a client ID.
- let promisePingSetup = TelemetryController.testReset();
- yield sendPing(true, false);
- Assert.equal(h.snapshot().sum, 1,
- "We must have a ping waiting for the clientId early during startup.");
- // Wait until we are fully initialized. Pings will be assembled but won't get
- // sent before then.
- yield promisePingSetup;
-
- let ping = yield PingServer.promiseNextPing();
- // Fetch the client ID after initializing and fetching the the ping, so we
- // don't unintentionally trigger its loading. We'll still need the client ID
- // to see if the ping looks sane.
- gClientID = yield ClientID.getClientID();
-
- checkPingFormat(ping, TEST_PING_TYPE, true, false);
- Assert.equal(ping.clientId, gClientID, "The correct clientId must be reported.");
-
- // Shutdown Telemetry so we can safely restart it.
- yield TelemetryController.testShutdown();
- yield TelemetryStorage.testClearPendingPings();
-
- // We should have cached the client ID now. Lets confirm that by checking it before
- // the async ping setup is finished.
- h.clear();
- promisePingSetup = TelemetryController.testReset();
- yield sendPing(true, false);
- yield promisePingSetup;
-
- // Check that we received the cached client id.
- Assert.equal(h.snapshot().sum, 0, "We must have used the cached clientId.");
- ping = yield PingServer.promiseNextPing();
- checkPingFormat(ping, TEST_PING_TYPE, true, false);
- Assert.equal(ping.clientId, gClientID,
- "Telemetry should report the correct cached clientId.");
-
- // Check that sending a ping without relying on the cache, after the
- // initialization, still works.
- Preferences.reset(PREF_CACHED_CLIENTID);
- yield TelemetryController.testShutdown();
- yield TelemetryStorage.testClearPendingPings();
- yield TelemetryController.testReset();
- yield sendPing(true, false);
- ping = yield PingServer.promiseNextPing();
- checkPingFormat(ping, TEST_PING_TYPE, true, false);
- Assert.equal(ping.clientId, gClientID, "The correct clientId must be reported.");
- Assert.equal(h.snapshot().sum, 0, "No ping should have been waiting for a clientId.");
-});
-
-add_task(function* test_pingHasEnvironment() {
- // Send a ping with the environment data.
- yield sendPing(false, true);
- let ping = yield PingServer.promiseNextPing();
- checkPingFormat(ping, TEST_PING_TYPE, false, true);
-
- // Test a field in the environment build section.
- Assert.equal(ping.application.buildId, ping.environment.build.buildId);
-});
-
-add_task(function* test_pingHasEnvironmentAndClientId() {
- // Send a ping with the environment data and client id.
- yield sendPing(true, true);
- let ping = yield PingServer.promiseNextPing();
- checkPingFormat(ping, TEST_PING_TYPE, true, true);
-
- // Test a field in the environment build section.
- Assert.equal(ping.application.buildId, ping.environment.build.buildId);
- // Test that we have the correct clientId.
- Assert.equal(ping.clientId, gClientID, "The correct clientId must be reported.");
-});
-
-add_task(function* test_archivePings() {
- let now = new Date(2009, 10, 18, 12, 0, 0);
- fakeNow(now);
-
- // Disable ping upload so that pings don't get sent.
- // With unified telemetry the FHR upload pref controls this,
- // with non-unified telemetry the Telemetry enabled pref.
- const isUnified = Preferences.get(PREF_UNIFIED, false);
- const uploadPref = isUnified ? PREF_FHR_UPLOAD_ENABLED : PREF_ENABLED;
- Preferences.set(uploadPref, false);
-
- // If we're using unified telemetry, disabling ping upload will generate a "deletion"
- // ping. Catch it.
- if (isUnified) {
- let ping = yield PingServer.promiseNextPing();
- checkPingFormat(ping, DELETION_PING_TYPE, true, false);
- }
-
- // Register a new Ping Handler that asserts if a ping is received, then send a ping.
- PingServer.registerPingHandler(() => Assert.ok(false, "Telemetry must not send pings if not allowed to."));
- let pingId = yield sendPing(true, true);
-
- // Check that the ping was archived, even with upload disabled.
- let ping = yield TelemetryArchive.promiseArchivedPingById(pingId);
- Assert.equal(ping.id, pingId, "TelemetryController should still archive pings.");
-
- // Check that pings don't get archived if not allowed to.
- now = new Date(2010, 10, 18, 12, 0, 0);
- fakeNow(now);
- Preferences.set(PREF_ARCHIVE_ENABLED, false);
- pingId = yield sendPing(true, true);
- let promise = TelemetryArchive.promiseArchivedPingById(pingId);
- Assert.ok((yield promiseRejects(promise)),
- "TelemetryController should not archive pings if the archive pref is disabled.");
-
- // Enable archiving and the upload so that pings get sent and archived again.
- Preferences.set(uploadPref, true);
- Preferences.set(PREF_ARCHIVE_ENABLED, true);
-
- now = new Date(2014, 6, 18, 22, 0, 0);
- fakeNow(now);
- // Restore the non asserting ping handler.
- PingServer.resetPingHandler();
- pingId = yield sendPing(true, true);
-
- // Check that we archive pings when successfully sending them.
- yield PingServer.promiseNextPing();
- ping = yield TelemetryArchive.promiseArchivedPingById(pingId);
- Assert.equal(ping.id, pingId,
- "TelemetryController should still archive pings if ping upload is enabled.");
-});
-
-// Test that we fuzz the submission time around midnight properly
-// to avoid overloading the telemetry servers.
-add_task(function* test_midnightPingSendFuzzing() {
- const fuzzingDelay = 60 * 60 * 1000;
- fakeMidnightPingFuzzingDelay(fuzzingDelay);
- let now = new Date(2030, 5, 1, 11, 0, 0);
- fakeNow(now);
-
- let waitForTimer = () => new Promise(resolve => {
- fakePingSendTimer((callback, timeout) => {
- resolve([callback, timeout]);
- }, () => {});
- });
-
- PingServer.clearRequests();
- yield TelemetryController.testReset();
-
- // A ping after midnight within the fuzzing delay should not get sent.
- now = new Date(2030, 5, 2, 0, 40, 0);
- fakeNow(now);
- PingServer.registerPingHandler((req, res) => {
- Assert.ok(false, "No ping should be received yet.");
- });
- let timerPromise = waitForTimer();
- yield sendPing(true, true);
- let [timerCallback, timerTimeout] = yield timerPromise;
- Assert.ok(!!timerCallback);
- Assert.deepEqual(futureDate(now, timerTimeout), new Date(2030, 5, 2, 1, 0, 0));
-
- // A ping just before the end of the fuzzing delay should not get sent.
- now = new Date(2030, 5, 2, 0, 59, 59);
- fakeNow(now);
- timerPromise = waitForTimer();
- yield sendPing(true, true);
- [timerCallback, timerTimeout] = yield timerPromise;
- Assert.deepEqual(timerTimeout, 1 * 1000);
-
- // Restore the previous ping handler.
- PingServer.resetPingHandler();
-
- // Setting the clock to after the fuzzing delay, we should trigger the two ping sends
- // with the timer callback.
- now = futureDate(now, timerTimeout);
- fakeNow(now);
- yield timerCallback();
- const pings = yield PingServer.promiseNextPings(2);
- for (let ping of pings) {
- checkPingFormat(ping, TEST_PING_TYPE, true, true);
- }
- yield TelemetrySend.testWaitOnOutgoingPings();
-
- // Moving the clock further we should still send pings immediately.
- now = futureDate(now, 5 * 60 * 1000);
- yield sendPing(true, true);
- let ping = yield PingServer.promiseNextPing();
- checkPingFormat(ping, TEST_PING_TYPE, true, true);
- yield TelemetrySend.testWaitOnOutgoingPings();
-
- // Check that pings shortly before midnight are immediately sent.
- now = fakeNow(2030, 5, 3, 23, 59, 0);
- yield sendPing(true, true);
- ping = yield PingServer.promiseNextPing();
- checkPingFormat(ping, TEST_PING_TYPE, true, true);
- yield TelemetrySend.testWaitOnOutgoingPings();
-
- // Clean-up.
- fakeMidnightPingFuzzingDelay(0);
- fakePingSendTimer(() => {}, () => {});
-});
-
-add_task(function* test_changePingAfterSubmission() {
- // Submit a ping with a custom payload.
- let payload = { canary: "test" };
- let pingPromise = TelemetryController.submitExternalPing(TEST_PING_TYPE, payload, options);
-
- // Change the payload with a predefined value.
- payload.canary = "changed";
-
- // Wait for the ping to be archived.
- const pingId = yield pingPromise;
-
- // Make sure our changes didn't affect the submitted payload.
- let archivedCopy = yield TelemetryArchive.promiseArchivedPingById(pingId);
- Assert.equal(archivedCopy.payload.canary, "test",
- "The payload must not be changed after being submitted.");
-});
-
-add_task(function* test_telemetryEnabledUnexpectedValue() {
- // Remove the default value for toolkit.telemetry.enabled from the default prefs.
- // Otherwise, we wouldn't be able to set the pref to a string.
- let defaultPrefBranch = Services.prefs.getDefaultBranch(null);
- defaultPrefBranch.deleteBranch(PREF_ENABLED);
-
- // Set the preferences controlling the Telemetry status to a string.
- Preferences.set(PREF_ENABLED, "false");
- // Check that Telemetry is not enabled.
- yield TelemetryController.testReset();
- Assert.equal(Telemetry.canRecordExtended, false,
- "Invalid values must not enable Telemetry recording.");
-
- // Delete the pref again.
- defaultPrefBranch.deleteBranch(PREF_ENABLED);
-
- // Make sure that flipping it to true works.
- Preferences.set(PREF_ENABLED, true);
- yield TelemetryController.testReset();
- Assert.equal(Telemetry.canRecordExtended, true,
- "True must enable Telemetry recording.");
-
- // Also check that the false works as well.
- Preferences.set(PREF_ENABLED, false);
- yield TelemetryController.testReset();
- Assert.equal(Telemetry.canRecordExtended, false,
- "False must disable Telemetry recording.");
-});
-
-add_task(function* test_telemetryCleanFHRDatabase() {
- const FHR_DBNAME_PREF = "datareporting.healthreport.dbName";
- const CUSTOM_DB_NAME = "unlikely.to.be.used.sqlite";
- const DEFAULT_DB_NAME = "healthreport.sqlite";
-
- // Check that we're able to remove a FHR DB with a custom name.
- const CUSTOM_DB_PATHS = [
- OS.Path.join(OS.Constants.Path.profileDir, CUSTOM_DB_NAME),
- OS.Path.join(OS.Constants.Path.profileDir, CUSTOM_DB_NAME + "-wal"),
- OS.Path.join(OS.Constants.Path.profileDir, CUSTOM_DB_NAME + "-shm"),
- ];
- Preferences.set(FHR_DBNAME_PREF, CUSTOM_DB_NAME);
-
- // Write fake DB files to the profile directory.
- for (let dbFilePath of CUSTOM_DB_PATHS) {
- yield OS.File.writeAtomic(dbFilePath, "some data");
- }
-
- // Trigger the cleanup and check that the files were removed.
- yield TelemetryStorage.removeFHRDatabase();
- for (let dbFilePath of CUSTOM_DB_PATHS) {
- Assert.ok(!(yield OS.File.exists(dbFilePath)), "The DB must not be on the disk anymore: " + dbFilePath);
- }
-
- // We should not break anything if there's no DB file.
- yield TelemetryStorage.removeFHRDatabase();
-
- // Check that we're able to remove a FHR DB with the default name.
- Preferences.reset(FHR_DBNAME_PREF);
-
- const DEFAULT_DB_PATHS = [
- OS.Path.join(OS.Constants.Path.profileDir, DEFAULT_DB_NAME),
- OS.Path.join(OS.Constants.Path.profileDir, DEFAULT_DB_NAME + "-wal"),
- OS.Path.join(OS.Constants.Path.profileDir, DEFAULT_DB_NAME + "-shm"),
- ];
-
- // Write fake DB files to the profile directory.
- for (let dbFilePath of DEFAULT_DB_PATHS) {
- yield OS.File.writeAtomic(dbFilePath, "some data");
- }
-
- // Trigger the cleanup and check that the files were removed.
- yield TelemetryStorage.removeFHRDatabase();
- for (let dbFilePath of DEFAULT_DB_PATHS) {
- Assert.ok(!(yield OS.File.exists(dbFilePath)), "The DB must not be on the disk anymore: " + dbFilePath);
- }
-});
-
-add_task(function* stopServer() {
- yield PingServer.stop();
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryControllerBuildID.js b/toolkit/components/telemetry/tests/unit/test_TelemetryControllerBuildID.js
deleted file mode 100644
index b8a88afa2..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryControllerBuildID.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
-*/
-/* Test inclusion of previous build ID in telemetry pings when build ID changes.
- * bug 841028
- *
- * Cases to cover:
- * 1) Run with no "previousBuildID" stored in prefs:
- * -> no previousBuildID in telemetry system info, new value set in prefs.
- * 2) previousBuildID in prefs, equal to current build ID:
- * -> no previousBuildID in telemetry, prefs not updated.
- * 3) previousBuildID in prefs, not equal to current build ID:
- * -> previousBuildID in telemetry, new value set in prefs.
- */
-
-"use strict";
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySession.jsm", this);
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-// Force the Telemetry enabled preference so that TelemetrySession.testReset() doesn't exit early.
-Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
-
-// Set up our dummy AppInfo object so we can control the appBuildID.
-Cu.import("resource://testing-common/AppInfo.jsm", this);
-updateAppInfo();
-
-// Check that when run with no previous build ID stored, we update the pref but do not
-// put anything into the metadata.
-add_task(function* test_firstRun() {
- yield TelemetryController.testReset();
- let metadata = TelemetrySession.getMetadata();
- do_check_false("previousBuildID" in metadata);
- let appBuildID = getAppInfo().appBuildID;
- let buildIDPref = Services.prefs.getCharPref(TelemetrySession.Constants.PREF_PREVIOUS_BUILDID);
- do_check_eq(appBuildID, buildIDPref);
-});
-
-// Check that a subsequent run with the same build ID does not put prev build ID in
-// metadata. Assumes testFirstRun() has already been called to set the previousBuildID pref.
-add_task(function* test_secondRun() {
- yield TelemetryController.testReset();
- let metadata = TelemetrySession.getMetadata();
- do_check_false("previousBuildID" in metadata);
-});
-
-// Set up telemetry with a different app build ID and check that the old build ID
-// is returned in the metadata and the pref is updated to the new build ID.
-// Assumes testFirstRun() has been called to set the previousBuildID pref.
-const NEW_BUILD_ID = "20130314";
-add_task(function* test_newBuild() {
- let info = getAppInfo();
- let oldBuildID = info.appBuildID;
- info.appBuildID = NEW_BUILD_ID;
- yield TelemetryController.testReset();
- let metadata = TelemetrySession.getMetadata();
- do_check_eq(metadata.previousBuildId, oldBuildID);
- let buildIDPref = Services.prefs.getCharPref(TelemetrySession.Constants.PREF_PREVIOUS_BUILDID);
- do_check_eq(NEW_BUILD_ID, buildIDPref);
-});
-
-
-function run_test() {
- // Make sure we have a profile directory.
- do_get_profile();
-
- run_next_test();
-}
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryControllerShutdown.js b/toolkit/components/telemetry/tests/unit/test_TelemetryControllerShutdown.js
deleted file mode 100644
index 391db0d9d..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryControllerShutdown.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Test that TelemetryController sends close to shutdown don't lead
-// to AsyncShutdown timeouts.
-
-"use strict";
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySend.jsm", this);
-Cu.import("resource://gre/modules/Timer.jsm", this);
-Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://gre/modules/AsyncShutdown.jsm", this);
-Cu.import("resource://testing-common/httpd.js", this);
-
-const PREF_BRANCH = "toolkit.telemetry.";
-const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
-
-function contentHandler(metadata, response)
-{
- dump("contentHandler called for path: " + metadata._path + "\n");
- // We intentionally don't finish writing the response here to let the
- // client time out.
- response.processAsync();
- response.setHeader("Content-Type", "text/plain");
-}
-
-add_task(function* test_setup() {
- // Addon manager needs a profile directory
- do_get_profile();
- loadAddonManager("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
- // Make sure we don't generate unexpected pings due to pref changes.
- yield setEmptyPrefWatchlist();
-
- Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
- Services.prefs.setBoolPref(PREF_FHR_UPLOAD_ENABLED, true);
-});
-
-/**
- * Ensures that TelemetryController does not hang processing shutdown
- * phases. Assumes that Telemetry shutdown routines do not take longer than
- * CRASH_TIMEOUT_MS to complete.
- */
-add_task(function* test_sendTelemetryShutsDownWithinReasonableTimeout() {
- const CRASH_TIMEOUT_MS = 5 * 1000;
- // Enable testing mode for AsyncShutdown, otherwise some testing-only functionality
- // is not available.
- Services.prefs.setBoolPref("toolkit.asyncshutdown.testing", true);
- // Reducing the max delay for waitiing on phases to complete from 1 minute
- // (standard) to 10 seconds to avoid blocking the tests in case of misbehavior.
- Services.prefs.setIntPref("toolkit.asyncshutdown.crash_timeout", CRASH_TIMEOUT_MS);
-
- let httpServer = new HttpServer();
- httpServer.registerPrefixHandler("/", contentHandler);
- httpServer.start(-1);
-
- yield TelemetryController.testSetup();
- TelemetrySend.setServer("http://localhost:" + httpServer.identity.primaryPort);
- let submissionPromise = TelemetryController.submitExternalPing("test-ping-type", {});
-
- // Trigger the AsyncShutdown phase TelemetryController hangs off.
- AsyncShutdown.profileBeforeChange._trigger();
- AsyncShutdown.sendTelemetry._trigger();
- // Now wait for the ping submission.
- yield submissionPromise;
-
- // If we get here, we didn't time out in the shutdown routines.
- Assert.ok(true, "Didn't time out on shutdown.");
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryController_idle.js b/toolkit/components/telemetry/tests/unit/test_TelemetryController_idle.js
deleted file mode 100644
index ca5d1820b..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryController_idle.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Check that TelemetrySession notifies correctly on idle-daily.
-
-Cu.import("resource://testing-common/httpd.js", this);
-Cu.import("resource://gre/modules/PromiseUtils.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm", this);
-Cu.import("resource://gre/modules/TelemetryStorage.jsm", this);
-Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySession.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySend.jsm", this);
-
-const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
-
-var gHttpServer = null;
-
-add_task(function* test_setup() {
- do_get_profile();
-
- // Make sure we don't generate unexpected pings due to pref changes.
- yield setEmptyPrefWatchlist();
-
- Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
- Services.prefs.setBoolPref(PREF_FHR_UPLOAD_ENABLED, true);
-
- // Start the webserver to check if the pending ping correctly arrives.
- gHttpServer = new HttpServer();
- gHttpServer.start(-1);
-});
-
-add_task(function* testSendPendingOnIdleDaily() {
- // Create a valid pending ping.
- const PENDING_PING = {
- id: "2133234d-4ea1-44f4-909e-ce8c6c41e0fc",
- type: "test-ping",
- version: 4,
- application: {},
- payload: {},
- };
- yield TelemetryStorage.savePing(PENDING_PING, true);
-
- // Telemetry will not send this ping at startup, because it's not overdue.
- yield TelemetryController.testSetup();
- TelemetrySend.setServer("http://localhost:" + gHttpServer.identity.primaryPort);
-
- let pendingPromise = new Promise(resolve =>
- gHttpServer.registerPrefixHandler("/submit/telemetry/", request => resolve(request)));
-
- let gatherPromise = PromiseUtils.defer();
- Services.obs.addObserver(gatherPromise.resolve, "gather-telemetry", false);
-
- // Check that we are correctly receiving the gather-telemetry notification.
- TelemetrySession.observe(null, "idle-daily", null);
- yield gatherPromise;
- Assert.ok(true, "Received gather-telemetry notification.");
-
- Services.obs.removeObserver(gatherPromise.resolve, "gather-telemetry");
-
- // Check that the pending ping is correctly received.
- let ns = {};
- let module = Cu.import("resource://gre/modules/TelemetrySend.jsm", ns);
- module.TelemetrySendImpl.observe(null, "idle-daily", null);
- let request = yield pendingPromise;
- let ping = decodeRequestPayload(request);
-
- // Validate the ping data.
- Assert.equal(ping.id, PENDING_PING.id);
- Assert.equal(ping.type, PENDING_PING.type);
-
- yield new Promise(resolve => gHttpServer.stop(resolve));
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js b/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
deleted file mode 100644
index 2518a80ba..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js
+++ /dev/null
@@ -1,1522 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Cu.import("resource://gre/modules/AddonManager.jsm");
-Cu.import("resource://gre/modules/TelemetryEnvironment.jsm", this);
-Cu.import("resource://gre/modules/Preferences.jsm", this);
-Cu.import("resource://gre/modules/PromiseUtils.jsm", this);
-Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://testing-common/AddonManagerTesting.jsm");
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://testing-common/MockRegistrar.jsm", this);
-Cu.import("resource://gre/modules/FileUtils.jsm");
-
-// AttributionCode is only needed for Firefox
-XPCOMUtils.defineLazyModuleGetter(this, "AttributionCode",
- "resource:///modules/AttributionCode.jsm");
-
-// Lazy load |LightweightThemeManager|, we won't be using it on Gonk.
-XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeManager",
- "resource://gre/modules/LightweightThemeManager.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "ProfileAge",
- "resource://gre/modules/ProfileAge.jsm");
-
-// The webserver hosting the addons.
-var gHttpServer = null;
-// The URL of the webserver root.
-var gHttpRoot = null;
-// The URL of the data directory, on the webserver.
-var gDataRoot = null;
-
-const PLATFORM_VERSION = "1.9.2";
-const APP_VERSION = "1";
-const APP_ID = "xpcshell@tests.mozilla.org";
-const APP_NAME = "XPCShell";
-
-const DISTRIBUTION_ID = "distributor-id";
-const DISTRIBUTION_VERSION = "4.5.6b";
-const DISTRIBUTOR_NAME = "Some Distributor";
-const DISTRIBUTOR_CHANNEL = "A Channel";
-const PARTNER_NAME = "test";
-const PARTNER_ID = "NicePartner-ID-3785";
-const DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC = "distribution-customization-complete";
-
-const GFX_VENDOR_ID = "0xabcd";
-const GFX_DEVICE_ID = "0x1234";
-
-// The profile reset date, in milliseconds (Today)
-const PROFILE_RESET_DATE_MS = Date.now();
-// The profile creation date, in milliseconds (Yesterday).
-const PROFILE_CREATION_DATE_MS = PROFILE_RESET_DATE_MS - MILLISECONDS_PER_DAY;
-
-const FLASH_PLUGIN_NAME = "Shockwave Flash";
-const FLASH_PLUGIN_DESC = "A mock flash plugin";
-const FLASH_PLUGIN_VERSION = "\u201c1.1.1.1\u201d";
-const PLUGIN_MIME_TYPE1 = "application/x-shockwave-flash";
-const PLUGIN_MIME_TYPE2 = "text/plain";
-
-const PLUGIN2_NAME = "Quicktime";
-const PLUGIN2_DESC = "A mock Quicktime plugin";
-const PLUGIN2_VERSION = "2.3";
-
-const PERSONA_ID = "3785";
-// Defined by LightweightThemeManager, it is appended to the PERSONA_ID.
-const PERSONA_ID_SUFFIX = "@personas.mozilla.org";
-const PERSONA_NAME = "Test Theme";
-const PERSONA_DESCRIPTION = "A nice theme/persona description.";
-
-const PLUGIN_UPDATED_TOPIC = "plugins-list-updated";
-
-// system add-ons are enabled at startup, so record date when the test starts
-const SYSTEM_ADDON_INSTALL_DATE = Date.now();
-
-// Valid attribution code to write so that settings.attribution can be tested.
-const ATTRIBUTION_CODE = "source%3Dgoogle.com";
-
-/**
- * Used to mock plugin tags in our fake plugin host.
- */
-function PluginTag(aName, aDescription, aVersion, aEnabled) {
- this.name = aName;
- this.description = aDescription;
- this.version = aVersion;
- this.disabled = !aEnabled;
-}
-
-PluginTag.prototype = {
- name: null,
- description: null,
- version: null,
- filename: null,
- fullpath: null,
- disabled: false,
- blocklisted: false,
- clicktoplay: true,
-
- mimeTypes: [ PLUGIN_MIME_TYPE1, PLUGIN_MIME_TYPE2 ],
-
- getMimeTypes: function(count) {
- count.value = this.mimeTypes.length;
- return this.mimeTypes;
- }
-};
-
-// A container for the plugins handled by the fake plugin host.
-var gInstalledPlugins = [
- new PluginTag("Java", "A mock Java plugin", "1.0", false /* Disabled */),
- new PluginTag(FLASH_PLUGIN_NAME, FLASH_PLUGIN_DESC, FLASH_PLUGIN_VERSION, true),
-];
-
-// A fake plugin host for testing plugin telemetry environment.
-var PluginHost = {
- getPluginTags: function(countRef) {
- countRef.value = gInstalledPlugins.length;
- return gInstalledPlugins;
- },
-
- QueryInterface: function(iid) {
- if (iid.equals(Ci.nsIPluginHost)
- || iid.equals(Ci.nsISupports))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- }
-}
-
-function registerFakePluginHost() {
- MockRegistrar.register("@mozilla.org/plugin/host;1", PluginHost);
-}
-
-var SysInfo = {
- overrides: {},
-
- getProperty(name) {
- // Assert.ok(false, "Mock SysInfo: " + name + ", " + JSON.stringify(this.overrides));
- if (name in this.overrides) {
- return this.overrides[name];
- }
- try {
- return this._genuine.getProperty(name);
- } catch (ex) {
- throw ex;
- }
- },
-
- get(name) {
- return this._genuine.get(name);
- },
-
- QueryInterface(iid) {
- if (iid.equals(Ci.nsIPropertyBag2)
- || iid.equals(Ci.nsISupports))
- return this;
-
- throw Cr.NS_ERROR_NO_INTERFACE;
- }
-};
-
-function registerFakeSysInfo() {
- MockRegistrar.register("@mozilla.org/system-info;1", SysInfo);
-}
-
-function MockAddonWrapper(aAddon) {
- this.addon = aAddon;
-}
-MockAddonWrapper.prototype = {
- get id() {
- return this.addon.id;
- },
-
- get type() {
- return "service";
- },
-
- get appDisabled() {
- return false;
- },
-
- get isCompatible() {
- return true;
- },
-
- get isPlatformCompatible() {
- return true;
- },
-
- get scope() {
- return AddonManager.SCOPE_PROFILE;
- },
-
- get foreignInstall() {
- return false;
- },
-
- get providesUpdatesSecurely() {
- return true;
- },
-
- get blocklistState() {
- return 0; // Not blocked.
- },
-
- get pendingOperations() {
- return AddonManager.PENDING_NONE;
- },
-
- get permissions() {
- return AddonManager.PERM_CAN_UNINSTALL | AddonManager.PERM_CAN_DISABLE;
- },
-
- get isActive() {
- return true;
- },
-
- get name() {
- return this.addon.name;
- },
-
- get version() {
- return this.addon.version;
- },
-
- get creator() {
- return new AddonManagerPrivate.AddonAuthor(this.addon.author);
- },
-
- get userDisabled() {
- return this.appDisabled;
- },
-};
-
-function createMockAddonProvider(aName) {
- let mockProvider = {
- _addons: [],
-
- get name() {
- return aName;
- },
-
- addAddon: function(aAddon) {
- this._addons.push(aAddon);
- AddonManagerPrivate.callAddonListeners("onInstalled", new MockAddonWrapper(aAddon));
- },
-
- getAddonsByTypes: function (aTypes, aCallback) {
- aCallback(this._addons.map(a => new MockAddonWrapper(a)));
- },
-
- shutdown() {
- return Promise.resolve();
- },
- };
-
- return mockProvider;
-}
-
-/**
- * Used to spoof the Persona Id.
- */
-function spoofTheme(aId, aName, aDesc) {
- return {
- id: aId,
- name: aName,
- description: aDesc,
- headerURL: "http://lwttest.invalid/a.png",
- footerURL: "http://lwttest.invalid/b.png",
- textcolor: Math.random().toString(),
- accentcolor: Math.random().toString()
- };
-}
-
-function spoofGfxAdapter() {
- try {
- let gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfoDebug);
- gfxInfo.spoofVendorID(GFX_VENDOR_ID);
- gfxInfo.spoofDeviceID(GFX_DEVICE_ID);
- } catch (x) {
- // If we can't test gfxInfo, that's fine, we'll note it later.
- }
-}
-
-function spoofProfileReset() {
- let profileAccessor = new ProfileAge();
-
- return profileAccessor.writeTimes({
- created: PROFILE_CREATION_DATE_MS,
- reset: PROFILE_RESET_DATE_MS
- });
-}
-
-function spoofPartnerInfo() {
- let prefsToSpoof = {};
- prefsToSpoof["distribution.id"] = DISTRIBUTION_ID;
- prefsToSpoof["distribution.version"] = DISTRIBUTION_VERSION;
- prefsToSpoof["app.distributor"] = DISTRIBUTOR_NAME;
- prefsToSpoof["app.distributor.channel"] = DISTRIBUTOR_CHANNEL;
- prefsToSpoof["app.partner.test"] = PARTNER_NAME;
- prefsToSpoof["mozilla.partner.id"] = PARTNER_ID;
-
- // Spoof the preferences.
- for (let pref in prefsToSpoof) {
- Preferences.set(pref, prefsToSpoof[pref]);
- }
-}
-
-function getAttributionFile() {
- let file = Services.dirsvc.get("LocalAppData", Ci.nsIFile);
- file.append("mozilla");
- file.append(AppConstants.MOZ_APP_NAME);
- file.append("postSigningData");
- return file;
-}
-
-function spoofAttributionData() {
- if (gIsWindows) {
- AttributionCode._clearCache();
- let stream = Cc["@mozilla.org/network/file-output-stream;1"].
- createInstance(Ci.nsIFileOutputStream);
- stream.init(getAttributionFile(), -1, -1, 0);
- stream.write(ATTRIBUTION_CODE, ATTRIBUTION_CODE.length);
- }
-}
-
-function cleanupAttributionData() {
- if (gIsWindows) {
- getAttributionFile().remove(false);
- AttributionCode._clearCache();
- }
-}
-
-/**
- * Check that a value is a string and not empty.
- *
- * @param aValue The variable to check.
- * @return True if |aValue| has type "string" and is not empty, False otherwise.
- */
-function checkString(aValue) {
- return (typeof aValue == "string") && (aValue != "");
-}
-
-/**
- * If value is non-null, check if it's a valid string.
- *
- * @param aValue The variable to check.
- * @return True if it's null or a valid string, false if it's non-null and an invalid
- * string.
- */
-function checkNullOrString(aValue) {
- if (aValue) {
- return checkString(aValue);
- } else if (aValue === null) {
- return true;
- }
-
- return false;
-}
-
-/**
- * If value is non-null, check if it's a boolean.
- *
- * @param aValue The variable to check.
- * @return True if it's null or a valid boolean, false if it's non-null and an invalid
- * boolean.
- */
-function checkNullOrBool(aValue) {
- return aValue === null || (typeof aValue == "boolean");
-}
-
-function checkBuildSection(data) {
- const expectedInfo = {
- applicationId: APP_ID,
- applicationName: APP_NAME,
- buildId: gAppInfo.appBuildID,
- version: APP_VERSION,
- vendor: "Mozilla",
- platformVersion: PLATFORM_VERSION,
- xpcomAbi: "noarch-spidermonkey",
- };
-
- Assert.ok("build" in data, "There must be a build section in Environment.");
-
- for (let f in expectedInfo) {
- Assert.ok(checkString(data.build[f]), f + " must be a valid string.");
- Assert.equal(data.build[f], expectedInfo[f], f + " must have the correct value.");
- }
-
- // Make sure architecture is in the environment.
- Assert.ok(checkString(data.build.architecture));
-
- if (gIsMac) {
- let macUtils = Cc["@mozilla.org/xpcom/mac-utils;1"].getService(Ci.nsIMacUtils);
- if (macUtils && macUtils.isUniversalBinary) {
- Assert.ok(checkString(data.build.architecturesInBinary));
- }
- }
-}
-
-function checkSettingsSection(data) {
- const EXPECTED_FIELDS_TYPES = {
- blocklistEnabled: "boolean",
- e10sEnabled: "boolean",
- e10sCohort: "string",
- telemetryEnabled: "boolean",
- locale: "string",
- update: "object",
- userPrefs: "object",
- };
-
- Assert.ok("settings" in data, "There must be a settings section in Environment.");
-
- for (let f in EXPECTED_FIELDS_TYPES) {
- Assert.equal(typeof data.settings[f], EXPECTED_FIELDS_TYPES[f],
- f + " must have the correct type.");
- }
-
- // Check "addonCompatibilityCheckEnabled" separately, as it is not available
- // on Gonk.
- if (gIsGonk) {
- Assert.ok(!("addonCompatibilityCheckEnabled" in data.settings), "Must not be available on Gonk.");
- } else {
- Assert.equal(data.settings.addonCompatibilityCheckEnabled, AddonManager.checkCompatibility);
- }
-
- // Check "isDefaultBrowser" separately, as it is not available on Android an can either be
- // null or boolean on other platforms.
- if (gIsAndroid) {
- Assert.ok(!("isDefaultBrowser" in data.settings), "Must not be available on Android.");
- } else {
- Assert.ok(checkNullOrBool(data.settings.isDefaultBrowser));
- }
-
- // Check "channel" separately, as it can either be null or string.
- let update = data.settings.update;
- Assert.ok(checkNullOrString(update.channel));
- Assert.equal(typeof update.enabled, "boolean");
- Assert.equal(typeof update.autoDownload, "boolean");
-
- // Check "defaultSearchEngine" separately, as it can either be undefined or string.
- if ("defaultSearchEngine" in data.settings) {
- checkString(data.settings.defaultSearchEngine);
- Assert.equal(typeof data.settings.defaultSearchEngineData, "object");
- }
-
- if ("attribution" in data.settings) {
- Assert.equal(typeof data.settings.attribution, "object");
- Assert.equal(data.settings.attribution.source, "google.com");
- }
-}
-
-function checkProfileSection(data) {
- Assert.ok("profile" in data, "There must be a profile section in Environment.");
- Assert.equal(data.profile.creationDate, truncateToDays(PROFILE_CREATION_DATE_MS));
- Assert.equal(data.profile.resetDate, truncateToDays(PROFILE_RESET_DATE_MS));
-}
-
-function checkPartnerSection(data, isInitial) {
- const EXPECTED_FIELDS = {
- distributionId: DISTRIBUTION_ID,
- distributionVersion: DISTRIBUTION_VERSION,
- partnerId: PARTNER_ID,
- distributor: DISTRIBUTOR_NAME,
- distributorChannel: DISTRIBUTOR_CHANNEL,
- };
-
- Assert.ok("partner" in data, "There must be a partner section in Environment.");
-
- for (let f in EXPECTED_FIELDS) {
- let expected = isInitial ? null : EXPECTED_FIELDS[f];
- Assert.strictEqual(data.partner[f], expected, f + " must have the correct value.");
- }
-
- // Check that "partnerNames" exists and contains the correct element.
- Assert.ok(Array.isArray(data.partner.partnerNames));
- if (isInitial) {
- Assert.equal(data.partner.partnerNames.length, 0);
- } else {
- Assert.ok(data.partner.partnerNames.includes(PARTNER_NAME));
- }
-}
-
-function checkGfxAdapter(data) {
- const EXPECTED_ADAPTER_FIELDS_TYPES = {
- description: "string",
- vendorID: "string",
- deviceID: "string",
- subsysID: "string",
- RAM: "number",
- driver: "string",
- driverVersion: "string",
- driverDate: "string",
- GPUActive: "boolean",
- };
-
- for (let f in EXPECTED_ADAPTER_FIELDS_TYPES) {
- Assert.ok(f in data, f + " must be available.");
-
- if (data[f]) {
- // Since we have a non-null value, check if it has the correct type.
- Assert.equal(typeof data[f], EXPECTED_ADAPTER_FIELDS_TYPES[f],
- f + " must have the correct type.");
- }
- }
-}
-
-function checkSystemSection(data) {
- const EXPECTED_FIELDS = [ "memoryMB", "cpu", "os", "hdd", "gfx" ];
- const EXPECTED_HDD_FIELDS = [ "profile", "binary", "system" ];
-
- Assert.ok("system" in data, "There must be a system section in Environment.");
-
- // Make sure we have all the top level sections and fields.
- for (let f of EXPECTED_FIELDS) {
- Assert.ok(f in data.system, f + " must be available.");
- }
-
- Assert.ok(Number.isFinite(data.system.memoryMB), "MemoryMB must be a number.");
-
- if (gIsWindows || gIsMac || gIsLinux) {
- let EXTRA_CPU_FIELDS = ["cores", "model", "family", "stepping",
- "l2cacheKB", "l3cacheKB", "speedMHz", "vendor"];
-
- for (let f of EXTRA_CPU_FIELDS) {
- // Note this is testing TelemetryEnvironment.js only, not that the
- // values are valid - null is the fallback.
- Assert.ok(f in data.system.cpu, f + " must be available under cpu.");
- }
-
- if (gIsWindows) {
- Assert.equal(typeof data.system.isWow64, "boolean",
- "isWow64 must be available on Windows and have the correct type.");
- Assert.ok("virtualMaxMB" in data.system, "virtualMaxMB must be available.");
- Assert.ok(Number.isFinite(data.system.virtualMaxMB),
- "virtualMaxMB must be a number.");
- }
-
- // We insist these are available
- for (let f of ["cores"]) {
- Assert.ok(!(f in data.system.cpu) ||
- Number.isFinite(data.system.cpu[f]),
- f + " must be a number if non null.");
- }
-
- // These should be numbers if they are not null
- for (let f of ["model", "family", "stepping", "l2cacheKB",
- "l3cacheKB", "speedMHz"]) {
- Assert.ok(!(f in data.system.cpu) ||
- data.system.cpu[f] === null ||
- Number.isFinite(data.system.cpu[f]),
- f + " must be a number if non null.");
- }
- }
-
- let cpuData = data.system.cpu;
- Assert.ok(Number.isFinite(cpuData.count), "CPU count must be a number.");
- Assert.ok(Array.isArray(cpuData.extensions), "CPU extensions must be available.");
-
- // Device data is only available on Android or Gonk.
- if (gIsAndroid || gIsGonk) {
- let deviceData = data.system.device;
- Assert.ok(checkNullOrString(deviceData.model));
- Assert.ok(checkNullOrString(deviceData.manufacturer));
- Assert.ok(checkNullOrString(deviceData.hardware));
- Assert.ok(checkNullOrBool(deviceData.isTablet));
- }
-
- let osData = data.system.os;
- Assert.ok(checkNullOrString(osData.name));
- Assert.ok(checkNullOrString(osData.version));
- Assert.ok(checkNullOrString(osData.locale));
-
- // Service pack is only available on Windows.
- if (gIsWindows) {
- Assert.ok(Number.isFinite(osData["servicePackMajor"]),
- "ServicePackMajor must be a number.");
- Assert.ok(Number.isFinite(osData["servicePackMinor"]),
- "ServicePackMinor must be a number.");
- if ("windowsBuildNumber" in osData) {
- // This might not be available on all Windows platforms.
- Assert.ok(Number.isFinite(osData["windowsBuildNumber"]),
- "windowsBuildNumber must be a number.");
- }
- if ("windowsUBR" in osData) {
- // This might not be available on all Windows platforms.
- Assert.ok((osData["windowsUBR"] === null) || Number.isFinite(osData["windowsUBR"]),
- "windowsUBR must be null or a number.");
- }
- } else if (gIsAndroid || gIsGonk) {
- Assert.ok(checkNullOrString(osData.kernelVersion));
- }
-
- let check = gIsWindows ? checkString : checkNullOrString;
- for (let disk of EXPECTED_HDD_FIELDS) {
- Assert.ok(check(data.system.hdd[disk].model));
- Assert.ok(check(data.system.hdd[disk].revision));
- }
-
- let gfxData = data.system.gfx;
- Assert.ok("D2DEnabled" in gfxData);
- Assert.ok("DWriteEnabled" in gfxData);
- // DWriteVersion is disabled due to main thread jank and will be enabled
- // again as part of bug 1154500.
- // Assert.ok("DWriteVersion" in gfxData);
- if (gIsWindows) {
- Assert.equal(typeof gfxData.D2DEnabled, "boolean");
- Assert.equal(typeof gfxData.DWriteEnabled, "boolean");
- // As above, will be enabled again as part of bug 1154500.
- // Assert.ok(checkString(gfxData.DWriteVersion));
- }
-
- Assert.ok("adapters" in gfxData);
- Assert.ok(gfxData.adapters.length > 0, "There must be at least one GFX adapter.");
- for (let adapter of gfxData.adapters) {
- checkGfxAdapter(adapter);
- }
- Assert.equal(typeof gfxData.adapters[0].GPUActive, "boolean");
- Assert.ok(gfxData.adapters[0].GPUActive, "The first GFX adapter must be active.");
-
- Assert.ok(Array.isArray(gfxData.monitors));
- if (gIsWindows || gIsMac) {
- Assert.ok(gfxData.monitors.length >= 1, "There is at least one monitor.");
- Assert.equal(typeof gfxData.monitors[0].screenWidth, "number");
- Assert.equal(typeof gfxData.monitors[0].screenHeight, "number");
- if (gIsWindows) {
- Assert.equal(typeof gfxData.monitors[0].refreshRate, "number");
- Assert.equal(typeof gfxData.monitors[0].pseudoDisplay, "boolean");
- }
- if (gIsMac) {
- Assert.equal(typeof gfxData.monitors[0].scale, "number");
- }
- }
-
- Assert.equal(typeof gfxData.features, "object");
- Assert.equal(typeof gfxData.features.compositor, "string");
-
- try {
- // If we've not got nsIGfxInfoDebug, then this will throw and stop us doing
- // this test.
- let gfxInfo = Cc["@mozilla.org/gfx/info;1"].getService(Ci.nsIGfxInfoDebug);
-
- if (gIsWindows || gIsMac) {
- Assert.equal(GFX_VENDOR_ID, gfxData.adapters[0].vendorID);
- Assert.equal(GFX_DEVICE_ID, gfxData.adapters[0].deviceID);
- }
-
- let features = gfxInfo.getFeatures();
- Assert.equal(features.compositor, gfxData.features.compositor);
- Assert.equal(features.opengl, gfxData.features.opengl);
- Assert.equal(features.webgl, gfxData.features.webgl);
- }
- catch (e) {}
-}
-
-function checkActiveAddon(data) {
- let signedState = mozinfo.addon_signing ? "number" : "undefined";
- // system add-ons have an undefined signState
- if (data.isSystem)
- signedState = "undefined";
-
- const EXPECTED_ADDON_FIELDS_TYPES = {
- blocklisted: "boolean",
- name: "string",
- userDisabled: "boolean",
- appDisabled: "boolean",
- version: "string",
- scope: "number",
- type: "string",
- foreignInstall: "boolean",
- hasBinaryComponents: "boolean",
- installDay: "number",
- updateDay: "number",
- signedState: signedState,
- isSystem: "boolean",
- };
-
- for (let f in EXPECTED_ADDON_FIELDS_TYPES) {
- Assert.ok(f in data, f + " must be available.");
- Assert.equal(typeof data[f], EXPECTED_ADDON_FIELDS_TYPES[f],
- f + " must have the correct type.");
- }
-
- // We check "description" separately, as it can be null.
- Assert.ok(checkNullOrString(data.description));
-}
-
-function checkPlugin(data) {
- const EXPECTED_PLUGIN_FIELDS_TYPES = {
- name: "string",
- version: "string",
- description: "string",
- blocklisted: "boolean",
- disabled: "boolean",
- clicktoplay: "boolean",
- updateDay: "number",
- };
-
- for (let f in EXPECTED_PLUGIN_FIELDS_TYPES) {
- Assert.ok(f in data, f + " must be available.");
- Assert.equal(typeof data[f], EXPECTED_PLUGIN_FIELDS_TYPES[f],
- f + " must have the correct type.");
- }
-
- Assert.ok(Array.isArray(data.mimeTypes));
- for (let type of data.mimeTypes) {
- Assert.ok(checkString(type));
- }
-}
-
-function checkTheme(data) {
- // "hasBinaryComponents" is not available when testing.
- const EXPECTED_THEME_FIELDS_TYPES = {
- id: "string",
- blocklisted: "boolean",
- name: "string",
- userDisabled: "boolean",
- appDisabled: "boolean",
- version: "string",
- scope: "number",
- foreignInstall: "boolean",
- installDay: "number",
- updateDay: "number",
- };
-
- for (let f in EXPECTED_THEME_FIELDS_TYPES) {
- Assert.ok(f in data, f + " must be available.");
- Assert.equal(typeof data[f], EXPECTED_THEME_FIELDS_TYPES[f],
- f + " must have the correct type.");
- }
-
- // We check "description" separately, as it can be null.
- Assert.ok(checkNullOrString(data.description));
-}
-
-function checkActiveGMPlugin(data) {
- // GMP plugin version defaults to null until GMPDownloader runs to update it.
- if (data.version) {
- Assert.equal(typeof data.version, "string");
- }
- Assert.equal(typeof data.userDisabled, "boolean");
- Assert.equal(typeof data.applyBackgroundUpdates, "number");
-}
-
-function checkAddonsSection(data, expectBrokenAddons) {
- const EXPECTED_FIELDS = [
- "activeAddons", "theme", "activePlugins", "activeGMPlugins", "activeExperiment",
- "persona",
- ];
-
- Assert.ok("addons" in data, "There must be an addons section in Environment.");
- for (let f of EXPECTED_FIELDS) {
- Assert.ok(f in data.addons, f + " must be available.");
- }
-
- // Check the active addons, if available.
- if (!expectBrokenAddons) {
- let activeAddons = data.addons.activeAddons;
- for (let addon in activeAddons) {
- checkActiveAddon(activeAddons[addon]);
- }
- }
-
- // Check "theme" structure.
- if (Object.keys(data.addons.theme).length !== 0) {
- checkTheme(data.addons.theme);
- }
-
- // Check the active plugins.
- Assert.ok(Array.isArray(data.addons.activePlugins));
- for (let plugin of data.addons.activePlugins) {
- checkPlugin(plugin);
- }
-
- // Check active GMPlugins
- let activeGMPlugins = data.addons.activeGMPlugins;
- for (let gmPlugin in activeGMPlugins) {
- checkActiveGMPlugin(activeGMPlugins[gmPlugin]);
- }
-
- // Check the active Experiment
- let experiment = data.addons.activeExperiment;
- if (Object.keys(experiment).length !== 0) {
- Assert.ok(checkString(experiment.id));
- Assert.ok(checkString(experiment.branch));
- }
-
- // Check persona
- Assert.ok(checkNullOrString(data.addons.persona));
-}
-
-function checkEnvironmentData(data, isInitial = false, expectBrokenAddons = false) {
- checkBuildSection(data);
- checkSettingsSection(data);
- checkProfileSection(data);
- checkPartnerSection(data, isInitial);
- checkSystemSection(data);
- checkAddonsSection(data, expectBrokenAddons);
-}
-
-add_task(function* setup() {
- // Load a custom manifest to provide search engine loading from JAR files.
- do_load_manifest("chrome.manifest");
- registerFakeSysInfo();
- spoofGfxAdapter();
- do_get_profile();
-
- // The system add-on must be installed before AddonManager is started.
- const distroDir = FileUtils.getDir("ProfD", ["sysfeatures", "app0"], true);
- do_get_file("system.xpi").copyTo(distroDir, "tel-system-xpi@tests.mozilla.org.xpi");
- let system_addon = FileUtils.File(distroDir.path);
- system_addon.append("tel-system-xpi@tests.mozilla.org.xpi");
- system_addon.lastModifiedTime = SYSTEM_ADDON_INSTALL_DATE;
- loadAddonManager(APP_ID, APP_NAME, APP_VERSION, PLATFORM_VERSION);
-
- // Spoof the persona ID, but not on Gonk.
- if (!gIsGonk) {
- LightweightThemeManager.currentTheme =
- spoofTheme(PERSONA_ID, PERSONA_NAME, PERSONA_DESCRIPTION);
- }
- // Register a fake plugin host for consistent flash version data.
- registerFakePluginHost();
-
- // Setup a webserver to serve Addons, Plugins, etc.
- gHttpServer = new HttpServer();
- gHttpServer.start(-1);
- let port = gHttpServer.identity.primaryPort;
- gHttpRoot = "http://localhost:" + port + "/";
- gDataRoot = gHttpRoot + "data/";
- gHttpServer.registerDirectory("/data/", do_get_cwd());
- do_register_cleanup(() => gHttpServer.stop(() => {}));
-
- // Create the attribution data file, so that settings.attribution will exist.
- // The attribution functionality only exists in Firefox.
- if (AppConstants.MOZ_BUILD_APP == "browser") {
- spoofAttributionData();
- do_register_cleanup(cleanupAttributionData);
- }
-
- yield spoofProfileReset();
- TelemetryEnvironment.delayedInit();
-});
-
-add_task(function* test_checkEnvironment() {
- let environmentData = yield TelemetryEnvironment.onInitialized();
- checkEnvironmentData(environmentData, true);
-
- spoofPartnerInfo();
- Services.obs.notifyObservers(null, DISTRIBUTION_CUSTOMIZATION_COMPLETE_TOPIC, null);
-
- environmentData = TelemetryEnvironment.currentEnvironment;
- checkEnvironmentData(environmentData);
-});
-
-add_task(function* test_prefWatchPolicies() {
- const PREF_TEST_1 = "toolkit.telemetry.test.pref_new";
- const PREF_TEST_2 = "toolkit.telemetry.test.pref1";
- const PREF_TEST_3 = "toolkit.telemetry.test.pref2";
- const PREF_TEST_4 = "toolkit.telemetry.test.pref_old";
- const PREF_TEST_5 = "toolkit.telemetry.test.requiresRestart";
-
- const expectedValue = "some-test-value";
- const unexpectedValue = "unexpected-test-value";
-
- const PREFS_TO_WATCH = new Map([
- [PREF_TEST_1, {what: TelemetryEnvironment.RECORD_PREF_VALUE}],
- [PREF_TEST_2, {what: TelemetryEnvironment.RECORD_PREF_STATE}],
- [PREF_TEST_3, {what: TelemetryEnvironment.RECORD_PREF_STATE}],
- [PREF_TEST_4, {what: TelemetryEnvironment.RECORD_PREF_VALUE}],
- [PREF_TEST_5, {what: TelemetryEnvironment.RECORD_PREF_VALUE, requiresRestart: true}],
- ]);
-
- Preferences.set(PREF_TEST_4, expectedValue);
- Preferences.set(PREF_TEST_5, expectedValue);
-
- // Set the Environment preferences to watch.
- TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH);
- let deferred = PromiseUtils.defer();
-
- // Check that the pref values are missing or present as expected
- Assert.strictEqual(TelemetryEnvironment.currentEnvironment.settings.userPrefs[PREF_TEST_1], undefined);
- Assert.strictEqual(TelemetryEnvironment.currentEnvironment.settings.userPrefs[PREF_TEST_4], expectedValue);
- Assert.strictEqual(TelemetryEnvironment.currentEnvironment.settings.userPrefs[PREF_TEST_5], expectedValue);
-
- TelemetryEnvironment.registerChangeListener("testWatchPrefs",
- (reason, data) => deferred.resolve(data));
- let oldEnvironmentData = TelemetryEnvironment.currentEnvironment;
-
- // Trigger a change in the watched preferences.
- Preferences.set(PREF_TEST_1, expectedValue);
- Preferences.set(PREF_TEST_2, false);
- Preferences.set(PREF_TEST_5, unexpectedValue);
- let eventEnvironmentData = yield deferred.promise;
-
- // Unregister the listener.
- TelemetryEnvironment.unregisterChangeListener("testWatchPrefs");
-
- // Check environment contains the correct data.
- Assert.deepEqual(oldEnvironmentData, eventEnvironmentData);
- let userPrefs = TelemetryEnvironment.currentEnvironment.settings.userPrefs;
-
- Assert.equal(userPrefs[PREF_TEST_1], expectedValue,
- "Environment contains the correct preference value.");
- Assert.equal(userPrefs[PREF_TEST_2], "<user-set>",
- "Report that the pref was user set but the value is not shown.");
- Assert.ok(!(PREF_TEST_3 in userPrefs),
- "Do not report if preference not user set.");
- Assert.equal(userPrefs[PREF_TEST_5], expectedValue,
- "The pref value in the environment data should still be the same");
-});
-
-add_task(function* test_prefWatch_prefReset() {
- const PREF_TEST = "toolkit.telemetry.test.pref1";
- const PREFS_TO_WATCH = new Map([
- [PREF_TEST, {what: TelemetryEnvironment.RECORD_PREF_STATE}],
- ]);
-
- // Set the preference to a non-default value.
- Preferences.set(PREF_TEST, false);
-
- // Set the Environment preferences to watch.
- TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH);
- let deferred = PromiseUtils.defer();
- TelemetryEnvironment.registerChangeListener("testWatchPrefs_reset", deferred.resolve);
-
- Assert.strictEqual(TelemetryEnvironment.currentEnvironment.settings.userPrefs[PREF_TEST], "<user-set>");
-
- // Trigger a change in the watched preferences.
- Preferences.reset(PREF_TEST);
- yield deferred.promise;
-
- Assert.strictEqual(TelemetryEnvironment.currentEnvironment.settings.userPrefs[PREF_TEST], undefined);
-
- // Unregister the listener.
- TelemetryEnvironment.unregisterChangeListener("testWatchPrefs_reset");
-});
-
-add_task(function* test_addonsWatch_InterestingChange() {
- const ADDON_INSTALL_URL = gDataRoot + "restartless.xpi";
- const ADDON_ID = "tel-restartless-xpi@tests.mozilla.org";
- // We only expect a single notification for each install, uninstall, enable, disable.
- const EXPECTED_NOTIFICATIONS = 4;
-
- let receivedNotifications = 0;
-
- let registerCheckpointPromise = (aExpected) => {
- return new Promise(resolve => TelemetryEnvironment.registerChangeListener(
- "testWatchAddons_Changes" + aExpected, (reason, data) => {
- Assert.equal(reason, "addons-changed");
- receivedNotifications++;
- resolve();
- }));
- };
-
- let assertCheckpoint = (aExpected) => {
- Assert.equal(receivedNotifications, aExpected);
- TelemetryEnvironment.unregisterChangeListener("testWatchAddons_Changes" + aExpected);
- };
-
- // Test for receiving one notification after each change.
- let checkpointPromise = registerCheckpointPromise(1);
- yield AddonManagerTesting.installXPIFromURL(ADDON_INSTALL_URL);
- yield checkpointPromise;
- assertCheckpoint(1);
- Assert.ok(ADDON_ID in TelemetryEnvironment.currentEnvironment.addons.activeAddons);
-
- checkpointPromise = registerCheckpointPromise(2);
- let addon = yield AddonManagerTesting.getAddonById(ADDON_ID);
- addon.userDisabled = true;
- yield checkpointPromise;
- assertCheckpoint(2);
- Assert.ok(!(ADDON_ID in TelemetryEnvironment.currentEnvironment.addons.activeAddons));
-
- checkpointPromise = registerCheckpointPromise(3);
- addon.userDisabled = false;
- yield checkpointPromise;
- assertCheckpoint(3);
- Assert.ok(ADDON_ID in TelemetryEnvironment.currentEnvironment.addons.activeAddons);
-
- checkpointPromise = registerCheckpointPromise(4);
- yield AddonManagerTesting.uninstallAddonByID(ADDON_ID);
- yield checkpointPromise;
- assertCheckpoint(4);
- Assert.ok(!(ADDON_ID in TelemetryEnvironment.currentEnvironment.addons.activeAddons));
-
- Assert.equal(receivedNotifications, EXPECTED_NOTIFICATIONS,
- "We must only receive the notifications we expect.");
-});
-
-add_task(function* test_pluginsWatch_Add() {
- if (gIsAndroid) {
- Assert.ok(true, "Skipping: there is no Plugin Manager on Android.");
- return;
- }
-
- Assert.equal(TelemetryEnvironment.currentEnvironment.addons.activePlugins.length, 1);
-
- let newPlugin = new PluginTag(PLUGIN2_NAME, PLUGIN2_DESC, PLUGIN2_VERSION, true);
- gInstalledPlugins.push(newPlugin);
-
- let deferred = PromiseUtils.defer();
- let receivedNotifications = 0;
- let callback = (reason, data) => {
- receivedNotifications++;
- Assert.equal(reason, "addons-changed");
- deferred.resolve();
- };
- TelemetryEnvironment.registerChangeListener("testWatchPlugins_Add", callback);
-
- Services.obs.notifyObservers(null, PLUGIN_UPDATED_TOPIC, null);
- yield deferred.promise;
-
- Assert.equal(TelemetryEnvironment.currentEnvironment.addons.activePlugins.length, 2);
-
- TelemetryEnvironment.unregisterChangeListener("testWatchPlugins_Add");
-
- Assert.equal(receivedNotifications, 1, "We must only receive one notification.");
-});
-
-add_task(function* test_pluginsWatch_Remove() {
- if (gIsAndroid) {
- Assert.ok(true, "Skipping: there is no Plugin Manager on Android.");
- return;
- }
-
- // Find the test plugin.
- let plugin = gInstalledPlugins.find(p => (p.name == PLUGIN2_NAME));
- Assert.ok(plugin, "The test plugin must exist.");
-
- // Remove it from the PluginHost.
- gInstalledPlugins = gInstalledPlugins.filter(p => p != plugin);
-
- let deferred = PromiseUtils.defer();
- let receivedNotifications = 0;
- let callback = () => {
- receivedNotifications++;
- deferred.resolve();
- };
- TelemetryEnvironment.registerChangeListener("testWatchPlugins_Remove", callback);
-
- Services.obs.notifyObservers(null, PLUGIN_UPDATED_TOPIC, null);
- yield deferred.promise;
-
- TelemetryEnvironment.unregisterChangeListener("testWatchPlugins_Remove");
-
- Assert.equal(receivedNotifications, 1, "We must only receive one notification.");
-});
-
-add_task(function* test_addonsWatch_NotInterestingChange() {
- // We are not interested to dictionary addons changes.
- const DICTIONARY_ADDON_INSTALL_URL = gDataRoot + "dictionary.xpi";
- const INTERESTING_ADDON_INSTALL_URL = gDataRoot + "restartless.xpi";
-
- let receivedNotification = false;
- let deferred = PromiseUtils.defer();
- TelemetryEnvironment.registerChangeListener("testNotInteresting",
- () => {
- Assert.ok(!receivedNotification, "Should not receive multiple notifications");
- receivedNotification = true;
- deferred.resolve();
- });
-
- yield AddonManagerTesting.installXPIFromURL(DICTIONARY_ADDON_INSTALL_URL);
- yield AddonManagerTesting.installXPIFromURL(INTERESTING_ADDON_INSTALL_URL);
-
- yield deferred.promise;
- Assert.ok(!("telemetry-dictionary@tests.mozilla.org" in
- TelemetryEnvironment.currentEnvironment.addons.activeAddons),
- "Dictionaries should not appear in active addons.");
-
- TelemetryEnvironment.unregisterChangeListener("testNotInteresting");
-});
-
-add_task(function* test_addonsAndPlugins() {
- const ADDON_INSTALL_URL = gDataRoot + "restartless.xpi";
- const ADDON_ID = "tel-restartless-xpi@tests.mozilla.org";
- const ADDON_INSTALL_DATE = truncateToDays(Date.now());
- const EXPECTED_ADDON_DATA = {
- blocklisted: false,
- description: "A restartless addon which gets enabled without a reboot.",
- name: "XPI Telemetry Restartless Test",
- userDisabled: false,
- appDisabled: false,
- version: "1.0",
- scope: 1,
- type: "extension",
- foreignInstall: false,
- hasBinaryComponents: false,
- installDay: ADDON_INSTALL_DATE,
- updateDay: ADDON_INSTALL_DATE,
- signedState: mozinfo.addon_signing ? AddonManager.SIGNEDSTATE_SIGNED : AddonManager.SIGNEDSTATE_NOT_REQUIRED,
- isSystem: false,
- };
- const SYSTEM_ADDON_ID = "tel-system-xpi@tests.mozilla.org";
- const EXPECTED_SYSTEM_ADDON_DATA = {
- blocklisted: false,
- description: "A system addon which is shipped with Firefox.",
- name: "XPI Telemetry System Add-on Test",
- userDisabled: false,
- appDisabled: false,
- version: "1.0",
- scope: 1,
- type: "extension",
- foreignInstall: false,
- hasBinaryComponents: false,
- installDay: truncateToDays(SYSTEM_ADDON_INSTALL_DATE),
- updateDay: truncateToDays(SYSTEM_ADDON_INSTALL_DATE),
- signedState: undefined,
- isSystem: true,
- };
-
- const EXPECTED_PLUGIN_DATA = {
- name: FLASH_PLUGIN_NAME,
- version: FLASH_PLUGIN_VERSION,
- description: FLASH_PLUGIN_DESC,
- blocklisted: false,
- disabled: false,
- clicktoplay: true,
- };
-
- // Install an addon so we have some data.
- yield AddonManagerTesting.installXPIFromURL(ADDON_INSTALL_URL);
-
- let data = TelemetryEnvironment.currentEnvironment;
- checkEnvironmentData(data);
-
- // Check addon data.
- Assert.ok(ADDON_ID in data.addons.activeAddons, "We must have one active addon.");
- let targetAddon = data.addons.activeAddons[ADDON_ID];
- for (let f in EXPECTED_ADDON_DATA) {
- Assert.equal(targetAddon[f], EXPECTED_ADDON_DATA[f], f + " must have the correct value.");
- }
-
- // Check system add-on data.
- Assert.ok(SYSTEM_ADDON_ID in data.addons.activeAddons, "We must have one active system addon.");
- let targetSystemAddon = data.addons.activeAddons[SYSTEM_ADDON_ID];
- for (let f in EXPECTED_SYSTEM_ADDON_DATA) {
- Assert.equal(targetSystemAddon[f], EXPECTED_SYSTEM_ADDON_DATA[f], f + " must have the correct value.");
- }
-
- // Check theme data.
- let theme = data.addons.theme;
- Assert.equal(theme.id, (PERSONA_ID + PERSONA_ID_SUFFIX));
- Assert.equal(theme.name, PERSONA_NAME);
- Assert.equal(theme.description, PERSONA_DESCRIPTION);
-
- // Check plugin data.
- Assert.equal(data.addons.activePlugins.length, 1, "We must have only one active plugin.");
- let targetPlugin = data.addons.activePlugins[0];
- for (let f in EXPECTED_PLUGIN_DATA) {
- Assert.equal(targetPlugin[f], EXPECTED_PLUGIN_DATA[f], f + " must have the correct value.");
- }
-
- // Check plugin mime types.
- Assert.ok(targetPlugin.mimeTypes.find(m => m == PLUGIN_MIME_TYPE1));
- Assert.ok(targetPlugin.mimeTypes.find(m => m == PLUGIN_MIME_TYPE2));
- Assert.ok(!targetPlugin.mimeTypes.find(m => m == "Not There."));
-
- let personaId = (gIsGonk) ? null : PERSONA_ID;
- Assert.equal(data.addons.persona, personaId, "The correct Persona Id must be reported.");
-
- // Uninstall the addon.
- yield AddonManagerTesting.uninstallAddonByID(ADDON_ID);
-});
-
-add_task(function* test_signedAddon() {
- const ADDON_INSTALL_URL = gDataRoot + "signed.xpi";
- const ADDON_ID = "tel-signed-xpi@tests.mozilla.org";
- const ADDON_INSTALL_DATE = truncateToDays(Date.now());
- const EXPECTED_ADDON_DATA = {
- blocklisted: false,
- description: "A signed addon which gets enabled without a reboot.",
- name: "XPI Telemetry Signed Test",
- userDisabled: false,
- appDisabled: false,
- version: "1.0",
- scope: 1,
- type: "extension",
- foreignInstall: false,
- hasBinaryComponents: false,
- installDay: ADDON_INSTALL_DATE,
- updateDay: ADDON_INSTALL_DATE,
- signedState: mozinfo.addon_signing ? AddonManager.SIGNEDSTATE_SIGNED : AddonManager.SIGNEDSTATE_NOT_REQUIRED,
- };
-
- let deferred = PromiseUtils.defer();
- TelemetryEnvironment.registerChangeListener("test_signedAddon", deferred.resolve);
-
- // Install the addon.
- yield AddonManagerTesting.installXPIFromURL(ADDON_INSTALL_URL);
-
- yield deferred.promise;
- // Unregister the listener.
- TelemetryEnvironment.unregisterChangeListener("test_signedAddon");
-
- let data = TelemetryEnvironment.currentEnvironment;
- checkEnvironmentData(data);
-
- // Check addon data.
- Assert.ok(ADDON_ID in data.addons.activeAddons, "Add-on should be in the environment.");
- let targetAddon = data.addons.activeAddons[ADDON_ID];
- for (let f in EXPECTED_ADDON_DATA) {
- Assert.equal(targetAddon[f], EXPECTED_ADDON_DATA[f], f + " must have the correct value.");
- }
-});
-
-add_task(function* test_addonsFieldsLimit() {
- const ADDON_INSTALL_URL = gDataRoot + "long-fields.xpi";
- const ADDON_ID = "tel-longfields-xpi@tests.mozilla.org";
-
- // Install the addon and wait for the TelemetryEnvironment to pick it up.
- let deferred = PromiseUtils.defer();
- TelemetryEnvironment.registerChangeListener("test_longFieldsAddon", deferred.resolve);
- yield AddonManagerTesting.installXPIFromURL(ADDON_INSTALL_URL);
- yield deferred.promise;
- TelemetryEnvironment.unregisterChangeListener("test_longFieldsAddon");
-
- let data = TelemetryEnvironment.currentEnvironment;
- checkEnvironmentData(data);
-
- // Check that the addon is available and that the string fields are limited.
- Assert.ok(ADDON_ID in data.addons.activeAddons, "Add-on should be in the environment.");
- let targetAddon = data.addons.activeAddons[ADDON_ID];
-
- // TelemetryEnvironment limits the length of string fields for activeAddons to 100 chars,
- // to mitigate misbehaving addons.
- Assert.lessOrEqual(targetAddon.version.length, 100,
- "The version string must have been limited");
- Assert.lessOrEqual(targetAddon.name.length, 100,
- "The name string must have been limited");
- Assert.lessOrEqual(targetAddon.description.length, 100,
- "The description string must have been limited");
-});
-
-add_task(function* test_collectionWithbrokenAddonData() {
- const BROKEN_ADDON_ID = "telemetry-test2.example.com@services.mozilla.org";
- const BROKEN_MANIFEST = {
- id: "telemetry-test2.example.com@services.mozilla.org",
- name: "telemetry broken addon",
- origin: "https://telemetry-test2.example.com",
- version: 1, // This is intentionally not a string.
- signedState: AddonManager.SIGNEDSTATE_SIGNED,
- };
-
- const ADDON_INSTALL_URL = gDataRoot + "restartless.xpi";
- const ADDON_ID = "tel-restartless-xpi@tests.mozilla.org";
- const ADDON_INSTALL_DATE = truncateToDays(Date.now());
- const EXPECTED_ADDON_DATA = {
- blocklisted: false,
- description: "A restartless addon which gets enabled without a reboot.",
- name: "XPI Telemetry Restartless Test",
- userDisabled: false,
- appDisabled: false,
- version: "1.0",
- scope: 1,
- type: "extension",
- foreignInstall: false,
- hasBinaryComponents: false,
- installDay: ADDON_INSTALL_DATE,
- updateDay: ADDON_INSTALL_DATE,
- signedState: mozinfo.addon_signing ? AddonManager.SIGNEDSTATE_MISSING :
- AddonManager.SIGNEDSTATE_NOT_REQUIRED,
- };
-
- let receivedNotifications = 0;
-
- let registerCheckpointPromise = (aExpected) => {
- return new Promise(resolve => TelemetryEnvironment.registerChangeListener(
- "testBrokenAddon_collection" + aExpected, (reason, data) => {
- Assert.equal(reason, "addons-changed");
- receivedNotifications++;
- resolve();
- }));
- };
-
- let assertCheckpoint = (aExpected) => {
- Assert.equal(receivedNotifications, aExpected);
- TelemetryEnvironment.unregisterChangeListener("testBrokenAddon_collection" + aExpected);
- };
-
- // Register the broken provider and install the broken addon.
- let checkpointPromise = registerCheckpointPromise(1);
- let brokenAddonProvider = createMockAddonProvider("Broken Extensions Provider");
- AddonManagerPrivate.registerProvider(brokenAddonProvider);
- brokenAddonProvider.addAddon(BROKEN_MANIFEST);
- yield checkpointPromise;
- assertCheckpoint(1);
-
- // Now install an addon which returns the correct information.
- checkpointPromise = registerCheckpointPromise(2);
- yield AddonManagerTesting.installXPIFromURL(ADDON_INSTALL_URL);
- yield checkpointPromise;
- assertCheckpoint(2);
-
- // Check that the new environment contains the Social addon installed with the broken
- // manifest and the rest of the data.
- let data = TelemetryEnvironment.currentEnvironment;
- checkEnvironmentData(data, false, true /* expect broken addons*/);
-
- let activeAddons = data.addons.activeAddons;
- Assert.ok(BROKEN_ADDON_ID in activeAddons,
- "The addon with the broken manifest must be reported.");
- Assert.equal(activeAddons[BROKEN_ADDON_ID].version, null,
- "null should be reported for invalid data.");
- Assert.ok(ADDON_ID in activeAddons,
- "The valid addon must be reported.");
- Assert.equal(activeAddons[ADDON_ID].description, EXPECTED_ADDON_DATA.description,
- "The description for the valid addon should be correct.");
-
- // Unregister the broken provider so we don't mess with other tests.
- AddonManagerPrivate.unregisterProvider(brokenAddonProvider);
-
- // Uninstall the valid addon.
- yield AddonManagerTesting.uninstallAddonByID(ADDON_ID);
-});
-
-add_task(function* test_defaultSearchEngine() {
- // Check that no default engine is in the environment before the search service is
- // initialized.
- let data = TelemetryEnvironment.currentEnvironment;
- checkEnvironmentData(data);
- Assert.ok(!("defaultSearchEngine" in data.settings));
- Assert.ok(!("defaultSearchEngineData" in data.settings));
-
- // Load the engines definitions from a custom JAR file: that's needed so that
- // the search provider reports an engine identifier.
- let url = "chrome://testsearchplugin/locale/searchplugins/";
- let resProt = Services.io.getProtocolHandler("resource")
- .QueryInterface(Ci.nsIResProtocolHandler);
- resProt.setSubstitution("search-plugins",
- Services.io.newURI(url, null, null));
-
- // Initialize the search service.
- yield new Promise(resolve => Services.search.init(resolve));
-
- // Our default engine from the JAR file has an identifier. Check if it is correctly
- // reported.
- data = TelemetryEnvironment.currentEnvironment;
- checkEnvironmentData(data);
- Assert.equal(data.settings.defaultSearchEngine, "telemetrySearchIdentifier");
- let expectedSearchEngineData = {
- name: "telemetrySearchIdentifier",
- loadPath: "jar:[other]/searchTest.jar!testsearchplugin/telemetrySearchIdentifier.xml",
- origin: "default",
- submissionURL: "http://ar.wikipedia.org/wiki/%D8%AE%D8%A7%D8%B5:%D8%A8%D8%AD%D8%AB?search=&sourceid=Mozilla-search"
- };
- Assert.deepEqual(data.settings.defaultSearchEngineData, expectedSearchEngineData);
-
- // Remove all the search engines.
- for (let engine of Services.search.getEngines()) {
- Services.search.removeEngine(engine);
- }
- // The search service does not notify "engine-current" when removing a default engine.
- // Manually force the notification.
- // TODO: remove this when bug 1165341 is resolved.
- Services.obs.notifyObservers(null, "browser-search-engine-modified", "engine-current");
-
- // Then check that no default engine is reported if none is available.
- data = TelemetryEnvironment.currentEnvironment;
- checkEnvironmentData(data);
- Assert.equal(data.settings.defaultSearchEngine, "NONE");
- Assert.deepEqual(data.settings.defaultSearchEngineData, {name:"NONE"});
-
- // Add a new search engine (this will have no engine identifier).
- const SEARCH_ENGINE_ID = "telemetry_default";
- const SEARCH_ENGINE_URL = "http://www.example.org/?search={searchTerms}";
- Services.search.addEngineWithDetails(SEARCH_ENGINE_ID, "", null, "", "get", SEARCH_ENGINE_URL);
-
- // Register a new change listener and then wait for the search engine change to be notified.
- let deferred = PromiseUtils.defer();
- TelemetryEnvironment.registerChangeListener("testWatch_SearchDefault", deferred.resolve);
- Services.search.defaultEngine = Services.search.getEngineByName(SEARCH_ENGINE_ID);
- yield deferred.promise;
-
- data = TelemetryEnvironment.currentEnvironment;
- checkEnvironmentData(data);
-
- const EXPECTED_SEARCH_ENGINE = "other-" + SEARCH_ENGINE_ID;
- Assert.equal(data.settings.defaultSearchEngine, EXPECTED_SEARCH_ENGINE);
-
- const EXPECTED_SEARCH_ENGINE_DATA = {
- name: "telemetry_default",
- loadPath: "[other]addEngineWithDetails",
- origin: "verified"
- };
- Assert.deepEqual(data.settings.defaultSearchEngineData, EXPECTED_SEARCH_ENGINE_DATA);
- TelemetryEnvironment.unregisterChangeListener("testWatch_SearchDefault");
-
- // Cleanly install an engine from an xml file, and check if origin is
- // recorded as "verified".
- let promise = new Promise(resolve => {
- TelemetryEnvironment.registerChangeListener("testWatch_SearchDefault", resolve);
- });
- let engine = yield new Promise((resolve, reject) => {
- Services.obs.addObserver(function obs(obsSubject, obsTopic, obsData) {
- try {
- let searchEngine = obsSubject.QueryInterface(Ci.nsISearchEngine);
- do_print("Observed " + obsData + " for " + searchEngine.name);
- if (obsData != "engine-added" || searchEngine.name != "engine-telemetry") {
- return;
- }
-
- Services.obs.removeObserver(obs, "browser-search-engine-modified");
- resolve(searchEngine);
- } catch (ex) {
- reject(ex);
- }
- }, "browser-search-engine-modified", false);
- Services.search.addEngine("file://" + do_get_cwd().path + "/engine.xml",
- null, null, false);
- });
- Services.search.defaultEngine = engine;
- yield promise;
- TelemetryEnvironment.unregisterChangeListener("testWatch_SearchDefault");
- data = TelemetryEnvironment.currentEnvironment;
- checkEnvironmentData(data);
- Assert.deepEqual(data.settings.defaultSearchEngineData,
- {"name":"engine-telemetry", "loadPath":"[other]/engine.xml", "origin":"verified"});
-
- // Now break this engine's load path hash.
- promise = new Promise(resolve => {
- TelemetryEnvironment.registerChangeListener("testWatch_SearchDefault", resolve);
- });
- engine.wrappedJSObject.setAttr("loadPathHash", "broken");
- Services.obs.notifyObservers(null, "browser-search-engine-modified", "engine-current");
- yield promise;
- TelemetryEnvironment.unregisterChangeListener("testWatch_SearchDefault");
- data = TelemetryEnvironment.currentEnvironment;
- Assert.equal(data.settings.defaultSearchEngineData.origin, "invalid");
- Services.search.removeEngine(engine);
-
- // Define and reset the test preference.
- const PREF_TEST = "toolkit.telemetry.test.pref1";
- const PREFS_TO_WATCH = new Map([
- [PREF_TEST, {what: TelemetryEnvironment.RECORD_PREF_STATE}],
- ]);
- Preferences.reset(PREF_TEST);
-
- // Watch the test preference.
- TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH);
- deferred = PromiseUtils.defer();
- TelemetryEnvironment.registerChangeListener("testSearchEngine_pref", deferred.resolve);
- // Trigger an environment change.
- Preferences.set(PREF_TEST, 1);
- yield deferred.promise;
- TelemetryEnvironment.unregisterChangeListener("testSearchEngine_pref");
-
- // Check that the search engine information is correctly retained when prefs change.
- data = TelemetryEnvironment.currentEnvironment;
- checkEnvironmentData(data);
- Assert.equal(data.settings.defaultSearchEngine, EXPECTED_SEARCH_ENGINE);
-
- // Check that by default we are not sending a cohort identifier...
- Assert.equal(data.settings.searchCohort, undefined);
-
- // ... but that if a cohort identifier is set, we send it.
- Services.prefs.setCharPref("browser.search.cohort", "testcohort");
- Services.obs.notifyObservers(null, "browser-search-service", "init-complete");
- data = TelemetryEnvironment.currentEnvironment;
- Assert.equal(data.settings.searchCohort, "testcohort");
-});
-
-add_task(function* test_osstrings() {
- // First test that numbers in sysinfo properties are converted to string fields
- // in system.os.
- SysInfo.overrides = {
- version: 1,
- name: 2,
- kernel_version: 3,
- };
-
- yield TelemetryEnvironment.testCleanRestart().onInitialized();
- let data = TelemetryEnvironment.currentEnvironment;
- checkEnvironmentData(data);
-
- Assert.equal(data.system.os.version, "1");
- Assert.equal(data.system.os.name, "2");
- if (AppConstants.platform == "android") {
- Assert.equal(data.system.os.kernelVersion, "3");
- }
-
- // Check that null values are also handled.
- SysInfo.overrides = {
- version: null,
- name: null,
- kernel_version: null,
- };
-
- yield TelemetryEnvironment.testCleanRestart().onInitialized();
- data = TelemetryEnvironment.currentEnvironment;
- checkEnvironmentData(data);
-
- Assert.equal(data.system.os.version, null);
- Assert.equal(data.system.os.name, null);
- if (AppConstants.platform == "android") {
- Assert.equal(data.system.os.kernelVersion, null);
- }
-
- // Clean up.
- SysInfo.overrides = {};
- yield TelemetryEnvironment.testCleanRestart().onInitialized();
-});
-
-add_task(function* test_environmentShutdown() {
- // Define and reset the test preference.
- const PREF_TEST = "toolkit.telemetry.test.pref1";
- const PREFS_TO_WATCH = new Map([
- [PREF_TEST, {what: TelemetryEnvironment.RECORD_PREF_STATE}],
- ]);
- Preferences.reset(PREF_TEST);
-
- // Set up the preferences and listener, then the trigger shutdown
- TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH);
- TelemetryEnvironment.registerChangeListener("test_environmentShutdownChange", () => {
- // Register a new change listener that asserts if change is propogated
- Assert.ok(false, "No change should be propagated after shutdown.");
- });
- TelemetryEnvironment.shutdown();
-
- // Flipping the test preference after shutdown should not trigger the listener
- Preferences.set(PREF_TEST, 1);
-
- // Unregister the listener.
- TelemetryEnvironment.unregisterChangeListener("test_environmentShutdownChange");
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryEvents.js b/toolkit/components/telemetry/tests/unit/test_TelemetryEvents.js
deleted file mode 100644
index 2bfb62c14..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryEvents.js
+++ /dev/null
@@ -1,249 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
-*/
-
-const OPTIN = Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN;
-const OPTOUT = Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT;
-
-function checkEventFormat(events) {
- Assert.ok(Array.isArray(events), "Events should be serialized to an array.");
- for (let e of events) {
- Assert.ok(Array.isArray(e), "Event should be an array.");
- Assert.greaterOrEqual(e.length, 4, "Event should have at least 4 elements.");
- Assert.lessOrEqual(e.length, 6, "Event should have at most 6 elements.");
-
- Assert.equal(typeof(e[0]), "number", "Element 0 should be a number.");
- Assert.equal(typeof(e[1]), "string", "Element 1 should be a string.");
- Assert.equal(typeof(e[2]), "string", "Element 2 should be a string.");
- Assert.equal(typeof(e[3]), "string", "Element 3 should be a string.");
-
- if (e.length > 4) {
- Assert.ok(e[4] === null || typeof(e[4]) == "string",
- "Event element 4 should be null or a string.");
- }
- if (e.length > 5) {
- Assert.ok(e[5] === null || typeof(e[5]) == "object",
- "Event element 5 should be null or an object.");
- }
-
- let extra = e[5];
- if (extra) {
- Assert.ok(Object.keys(extra).every(k => typeof(k) == "string"),
- "All extra keys should be strings.");
- Assert.ok(Object.values(extra).every(v => typeof(v) == "string"),
- "All extra values should be strings.");
- }
- }
-}
-
-add_task(function* test_recording() {
- Telemetry.clearEvents();
-
- // Record some events.
- let expected = [
- {optout: false, event: ["telemetry.test", "test1", "object1"]},
- {optout: false, event: ["telemetry.test", "test2", "object2"]},
-
- {optout: false, event: ["telemetry.test", "test1", "object1", "value"]},
- {optout: false, event: ["telemetry.test", "test1", "object1", "value", null]},
- {optout: false, event: ["telemetry.test", "test1", "object1", null, {"key1": "value1"}]},
- {optout: false, event: ["telemetry.test", "test1", "object1", "value", {"key1": "value1", "key2": "value2"}]},
-
- {optout: true, event: ["telemetry.test", "optout", "object1"]},
- {optout: false, event: ["telemetry.test.second", "test", "object1"]},
- {optout: false, event: ["telemetry.test.second", "test", "object1", null, {"key1": "value1"}]},
- ];
-
- for (let entry of expected) {
- entry.tsBefore = Math.floor(Telemetry.msSinceProcessStart());
- try {
- Telemetry.recordEvent(...entry.event);
- } catch (ex) {
- Assert.ok(false, `Failed to record event ${JSON.stringify(entry.event)}: ${ex}`);
- }
- entry.tsAfter = Math.floor(Telemetry.msSinceProcessStart());
- }
-
- // Strip off trailing null values to match the serialized events.
- for (let entry of expected) {
- let e = entry.event;
- while ((e.length >= 3) && (e[e.length - 1] === null)) {
- e.pop();
- }
- }
-
- // The following should not result in any recorded events.
- Assert.throws(() => Telemetry.recordEvent("unknown.category", "test1", "object1"),
- /Error: Unknown event: \["unknown.category", "test1", "object1"\]/,
- "Should throw on unknown category.");
- Assert.throws(() => Telemetry.recordEvent("telemetry.test", "unknown", "object1"),
- /Error: Unknown event: \["telemetry.test", "unknown", "object1"\]/,
- "Should throw on unknown method.");
- Assert.throws(() => Telemetry.recordEvent("telemetry.test", "test1", "unknown"),
- /Error: Unknown event: \["telemetry.test", "test1", "unknown"\]/,
- "Should throw on unknown object.");
-
- let checkEvents = (events, expectedEvents) => {
- checkEventFormat(events);
- Assert.equal(events.length, expectedEvents.length,
- "Snapshot should have the right number of events.");
-
- for (let i = 0; i < events.length; ++i) {
- let {tsBefore, tsAfter} = expectedEvents[i];
- let ts = events[i][0];
- Assert.greaterOrEqual(ts, tsBefore, "The recorded timestamp should be greater than the one before recording.");
- Assert.lessOrEqual(ts, tsAfter, "The recorded timestamp should be less than the one after recording.");
-
- let recordedData = events[i].slice(1);
- let expectedData = expectedEvents[i].event.slice();
- Assert.deepEqual(recordedData, expectedData, "The recorded event data should match.");
- }
- };
-
- // Check that the expected events were recorded.
- let events = Telemetry.snapshotBuiltinEvents(OPTIN, false);
- checkEvents(events, expected);
-
- // Check serializing only opt-out events.
- events = Telemetry.snapshotBuiltinEvents(OPTOUT, false);
- filtered = expected.filter(e => e.optout == true);
- checkEvents(events, filtered);
-});
-
-add_task(function* test_clear() {
- Telemetry.clearEvents();
-
- const COUNT = 10;
- for (let i = 0; i < COUNT; ++i) {
- Telemetry.recordEvent("telemetry.test", "test1", "object1");
- Telemetry.recordEvent("telemetry.test.second", "test", "object1");
- }
-
- // Check that events were recorded.
- // The events are cleared by passing the respective flag.
- let events = Telemetry.snapshotBuiltinEvents(OPTIN, true);
- Assert.equal(events.length, 2 * COUNT, `Should have recorded ${2 * COUNT} events.`);
-
- // Now the events should be cleared.
- events = Telemetry.snapshotBuiltinEvents(OPTIN, false);
- Assert.equal(events.length, 0, `Should have cleared the events.`);
-});
-
-add_task(function* test_expiry() {
- Telemetry.clearEvents();
-
- // Recording call with event that is expired by version.
- Telemetry.recordEvent("telemetry.test", "expired_version", "object1");
- let events = Telemetry.snapshotBuiltinEvents(OPTIN, true);
- Assert.equal(events.length, 0, "Should not record event with expired version.");
-
- // Recording call with event that is expired by date.
- Telemetry.recordEvent("telemetry.test", "expired_date", "object1");
- events = Telemetry.snapshotBuiltinEvents(OPTIN, true);
- Assert.equal(events.length, 0, "Should not record event with expired date.");
-
- // Recording call with event that has expiry_version and expiry_date in the future.
- Telemetry.recordEvent("telemetry.test", "not_expired_optout", "object1");
- events = Telemetry.snapshotBuiltinEvents(OPTOUT, true);
- Assert.equal(events.length, 1, "Should record event when date and version are not expired.");
-});
-
-add_task(function* test_invalidParams() {
- Telemetry.clearEvents();
-
- // Recording call with wrong type for value argument.
- Telemetry.recordEvent("telemetry.test", "test1", "object1", 1);
- let events = Telemetry.snapshotBuiltinEvents(OPTIN, true);
- Assert.equal(events.length, 0, "Should not record event when value argument with invalid type is passed.");
-
- // Recording call with wrong type for extra argument.
- Telemetry.recordEvent("telemetry.test", "test1", "object1", null, "invalid");
- events = Telemetry.snapshotBuiltinEvents(OPTIN, true);
- Assert.equal(events.length, 0, "Should not record event when extra argument with invalid type is passed.");
-
- // Recording call with unknown extra key.
- Telemetry.recordEvent("telemetry.test", "test1", "object1", null, {"key3": "x"});
- events = Telemetry.snapshotBuiltinEvents(OPTIN, true);
- Assert.equal(events.length, 0, "Should not record event when extra argument with invalid key is passed.");
-
- // Recording call with invalid value type.
- Telemetry.recordEvent("telemetry.test", "test1", "object1", null, {"key3": 1});
- events = Telemetry.snapshotBuiltinEvents(OPTIN, true);
- Assert.equal(events.length, 0, "Should not record event when extra argument with invalid value type is passed.");
-});
-
-add_task(function* test_storageLimit() {
- Telemetry.clearEvents();
-
- // Record more events than the storage limit allows.
- let LIMIT = 1000;
- let COUNT = LIMIT + 10;
- for (let i = 0; i < COUNT; ++i) {
- Telemetry.recordEvent("telemetry.test", "test1", "object1", String(i));
- }
-
- // Check that the right events were recorded.
- let events = Telemetry.snapshotBuiltinEvents(OPTIN, true);
- Assert.equal(events.length, LIMIT, `Should have only recorded ${LIMIT} events`);
- Assert.ok(events.every((e, idx) => e[4] === String(idx)),
- "Should have recorded all events from before hitting the limit.");
-});
-
-add_task(function* test_valueLimits() {
- Telemetry.clearEvents();
-
- // Record values that are at or over the limits for string lengths.
- let LIMIT = 80;
- let expected = [
- ["telemetry.test", "test1", "object1", "a".repeat(LIMIT - 10), null],
- ["telemetry.test", "test1", "object1", "a".repeat(LIMIT ), null],
- ["telemetry.test", "test1", "object1", "a".repeat(LIMIT + 1), null],
- ["telemetry.test", "test1", "object1", "a".repeat(LIMIT + 10), null],
-
- ["telemetry.test", "test1", "object1", null, {key1: "a".repeat(LIMIT - 10)}],
- ["telemetry.test", "test1", "object1", null, {key1: "a".repeat(LIMIT )}],
- ["telemetry.test", "test1", "object1", null, {key1: "a".repeat(LIMIT + 1)}],
- ["telemetry.test", "test1", "object1", null, {key1: "a".repeat(LIMIT + 10)}],
- ];
-
- for (let event of expected) {
- Telemetry.recordEvent(...event);
- if (event[3]) {
- event[3] = event[3].substr(0, LIMIT);
- }
- if (event[4]) {
- event[4].key1 = event[4].key1.substr(0, LIMIT);
- }
- }
-
- // Strip off trailing null values to match the serialized events.
- for (let e of expected) {
- while ((e.length >= 3) && (e[e.length - 1] === null)) {
- e.pop();
- }
- }
-
- // Check that the right events were recorded.
- let events = Telemetry.snapshotBuiltinEvents(OPTIN, true);
- Assert.equal(events.length, expected.length,
- "Should have recorded the expected number of events");
- for (let i = 0; i < expected.length; ++i) {
- Assert.deepEqual(events[i].slice(1), expected[i],
- "Should have recorded the expected event data.");
- }
-});
-
-add_task(function* test_unicodeValues() {
- Telemetry.clearEvents();
-
- // Record string values containing unicode characters.
- let value = "漢語";
- Telemetry.recordEvent("telemetry.test", "test1", "object1", value);
- Telemetry.recordEvent("telemetry.test", "test1", "object1", null, {"key1": value});
-
- // Check that the values were correctly recorded.
- let events = Telemetry.snapshotBuiltinEvents(OPTIN, true);
- Assert.equal(events.length, 2, "Should have recorded 2 events.");
- Assert.equal(events[0][4], value, "Should have recorded the right value.");
- Assert.equal(events[1][5]["key1"], value, "Should have recorded the right extra value.");
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryFlagClear.js b/toolkit/components/telemetry/tests/unit/test_TelemetryFlagClear.js
deleted file mode 100644
index 712aceb3b..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryFlagClear.js
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function run_test()
-{
- let testFlag = Services.telemetry.getHistogramById("TELEMETRY_TEST_FLAG");
- equal(JSON.stringify(testFlag.snapshot().counts), "[1,0,0]", "Original value is correct");
- testFlag.add(1);
- equal(JSON.stringify(testFlag.snapshot().counts), "[0,1,0]", "Value is correct after ping.");
- testFlag.clear();
- equal(JSON.stringify(testFlag.snapshot().counts), "[1,0,0]", "Value is correct after calling clear()");
- testFlag.add(1);
- equal(JSON.stringify(testFlag.snapshot().counts), "[0,1,0]", "Value is correct after ping.");
-}
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryLateWrites.js b/toolkit/components/telemetry/tests/unit/test_TelemetryLateWrites.js
deleted file mode 100644
index f2b2b3bba..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryLateWrites.js
+++ /dev/null
@@ -1,127 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
-*/
-/* A testcase to make sure reading late writes stacks works. */
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-
-// Constants from prio.h for nsIFileOutputStream.init
-const PR_WRONLY = 0x2;
-const PR_CREATE_FILE = 0x8;
-const PR_TRUNCATE = 0x20;
-const RW_OWNER = parseInt("0600", 8);
-
-const STACK_SUFFIX1 = "stack1.txt";
-const STACK_SUFFIX2 = "stack2.txt";
-const STACK_BOGUS_SUFFIX = "bogus.txt";
-const LATE_WRITE_PREFIX = "Telemetry.LateWriteFinal-";
-
-// The names and IDs don't matter, but the format of the IDs does.
-const LOADED_MODULES = {
- '4759A7E6993548C89CAF716A67EC242D00': 'libtest.so',
- 'F77AF15BB8D6419FA875954B4A3506CA00': 'libxul.so',
- '1E2F7FB590424E8F93D60BB88D66B8C500': 'libc.so'
-};
-const N_MODULES = Object.keys(LOADED_MODULES).length;
-
-// Format of individual items is [index, offset-in-library].
-const STACK1 = [
- [ 0, 0 ],
- [ 1, 1 ],
- [ 2, 2 ]
-];
-const STACK2 = [
- [ 0, 0 ],
- [ 1, 5 ],
- [ 2, 10 ],
-];
-// XXX The only error checking is for a zero-sized stack.
-const STACK_BOGUS = [];
-
-function write_string_to_file(file, contents) {
- let ostream = Cc["@mozilla.org/network/safe-file-output-stream;1"]
- .createInstance(Ci.nsIFileOutputStream);
- ostream.init(file, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE,
- RW_OWNER, ostream.DEFER_OPEN);
- ostream.write(contents, contents.length);
- ostream.QueryInterface(Ci.nsISafeOutputStream).finish();
- ostream.close();
-}
-
-function construct_file(suffix) {
- let profileDirectory = Services.dirsvc.get("ProfD", Ci.nsIFile);
- let file = profileDirectory.clone();
- file.append(LATE_WRITE_PREFIX + suffix);
- return file;
-}
-
-function write_late_writes_file(stack, suffix)
-{
- let file = construct_file(suffix);
- let contents = N_MODULES + "\n";
- for (let id in LOADED_MODULES) {
- contents += id + " " + LOADED_MODULES[id] + "\n";
- }
-
- contents += stack.length + "\n";
- for (let element of stack) {
- contents += element[0] + " " + element[1].toString(16) + "\n";
- }
-
- write_string_to_file(file, contents);
-}
-
-function run_test() {
- do_get_profile();
-
- write_late_writes_file(STACK1, STACK_SUFFIX1);
- write_late_writes_file(STACK2, STACK_SUFFIX2);
- write_late_writes_file(STACK_BOGUS, STACK_BOGUS_SUFFIX);
-
- let lateWrites = Telemetry.lateWrites;
- do_check_true("memoryMap" in lateWrites);
- do_check_eq(lateWrites.memoryMap.length, 0);
- do_check_true("stacks" in lateWrites);
- do_check_eq(lateWrites.stacks.length, 0);
-
- do_test_pending();
- Telemetry.asyncFetchTelemetryData(function () {
- actual_test();
- });
-}
-
-function actual_test() {
- do_check_false(construct_file(STACK_SUFFIX1).exists());
- do_check_false(construct_file(STACK_SUFFIX2).exists());
- do_check_false(construct_file(STACK_BOGUS_SUFFIX).exists());
-
- let lateWrites = Telemetry.lateWrites;
-
- do_check_true("memoryMap" in lateWrites);
- do_check_eq(lateWrites.memoryMap.length, N_MODULES);
- for (let id in LOADED_MODULES) {
- let matchingLibrary = lateWrites.memoryMap.filter(function(library, idx, array) {
- return library[1] == id;
- });
- do_check_eq(matchingLibrary.length, 1);
- let library = matchingLibrary[0]
- let name = library[0];
- do_check_eq(LOADED_MODULES[id], name);
- }
-
- do_check_true("stacks" in lateWrites);
- do_check_eq(lateWrites.stacks.length, 2);
- let uneval_STACKS = [uneval(STACK1), uneval(STACK2)];
- let first_stack = lateWrites.stacks[0];
- let second_stack = lateWrites.stacks[1];
- function stackChecker(canonicalStack) {
- let unevalCanonicalStack = uneval(canonicalStack);
- return function(obj, idx, array) {
- return unevalCanonicalStack == obj;
- }
- }
- do_check_eq(uneval_STACKS.filter(stackChecker(first_stack)).length, 1);
- do_check_eq(uneval_STACKS.filter(stackChecker(second_stack)).length, 1);
-
- do_test_finished();
-}
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryLockCount.js b/toolkit/components/telemetry/tests/unit/test_TelemetryLockCount.js
deleted file mode 100644
index 808f2f3ec..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryLockCount.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
-*/
-/* A testcase to make sure reading the failed profile lock count works. */
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-
-const LOCK_FILE_NAME = "Telemetry.FailedProfileLocks.txt";
-const N_FAILED_LOCKS = 10;
-
-// Constants from prio.h for nsIFileOutputStream.init
-const PR_WRONLY = 0x2;
-const PR_CREATE_FILE = 0x8;
-const PR_TRUNCATE = 0x20;
-const RW_OWNER = parseInt("0600", 8);
-
-function write_string_to_file(file, contents) {
- let ostream = Cc["@mozilla.org/network/safe-file-output-stream;1"]
- .createInstance(Ci.nsIFileOutputStream);
- ostream.init(file, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE,
- RW_OWNER, ostream.DEFER_OPEN);
- ostream.write(contents, contents.length);
- ostream.QueryInterface(Ci.nsISafeOutputStream).finish();
- ostream.close();
-}
-
-function construct_file() {
- let profileDirectory = Services.dirsvc.get("ProfD", Ci.nsIFile);
- let file = profileDirectory.clone();
- file.append(LOCK_FILE_NAME);
- return file;
-}
-
-function run_test() {
- do_get_profile();
-
- do_check_eq(Telemetry.failedProfileLockCount, 0);
-
- write_string_to_file(construct_file(), N_FAILED_LOCKS.toString());
-
- // Make sure that we're not eagerly reading the count now that the
- // file exists.
- do_check_eq(Telemetry.failedProfileLockCount, 0);
-
- do_test_pending();
- Telemetry.asyncFetchTelemetryData(actual_test);
-}
-
-function actual_test() {
- do_check_eq(Telemetry.failedProfileLockCount, N_FAILED_LOCKS);
- do_check_false(construct_file().exists());
- do_test_finished();
-}
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryLog.js b/toolkit/components/telemetry/tests/unit/test_TelemetryLog.js
deleted file mode 100644
index ea37a1bc5..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryLog.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Cu.import("resource://gre/modules/TelemetryLog.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySession.jsm", this);
-
-const TEST_PREFIX = "TEST-";
-const TEST_REGEX = new RegExp("^" + TEST_PREFIX);
-
-function check_event(event, id, data)
-{
- do_print("Checking message " + id);
- do_check_eq(event[0], id);
- do_check_true(event[1] > 0);
-
- if (data === undefined) {
- do_check_true(event.length == 2);
- } else {
- do_check_eq(event.length, data.length + 2);
- for (var i = 0; i < data.length; ++i) {
- do_check_eq(typeof(event[i + 2]), "string");
- do_check_eq(event[i + 2], data[i]);
- }
- }
-}
-
-add_task(function* ()
-{
- do_get_profile();
- // TODO: After Bug 1254550 lands we should not need to set the pref here.
- Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
- yield TelemetryController.testSetup();
-
- TelemetryLog.log(TEST_PREFIX + "1", ["val", 123, undefined]);
- TelemetryLog.log(TEST_PREFIX + "2", []);
- TelemetryLog.log(TEST_PREFIX + "3");
-
- var log = TelemetrySession.getPayload().log.filter(function(e) {
- // Only want events that were generated by the test.
- return TEST_REGEX.test(e[0]);
- });
-
- do_check_eq(log.length, 3);
- check_event(log[0], TEST_PREFIX + "1", ["val", "123", "undefined"]);
- check_event(log[1], TEST_PREFIX + "2", []);
- check_event(log[2], TEST_PREFIX + "3", undefined);
- do_check_true(log[0][1] <= log[1][1]);
- do_check_true(log[1][1] <= log[2][1]);
-
- yield TelemetryController.testShutdown();
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryReportingPolicy.js b/toolkit/components/telemetry/tests/unit/test_TelemetryReportingPolicy.js
deleted file mode 100644
index 68606a98e..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryReportingPolicy.js
+++ /dev/null
@@ -1,268 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Test that TelemetryController sends close to shutdown don't lead
-// to AsyncShutdown timeouts.
-
-"use strict";
-
-Cu.import("resource://gre/modules/Preferences.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySend.jsm", this);
-Cu.import("resource://gre/modules/TelemetryReportingPolicy.jsm", this);
-Cu.import("resource://gre/modules/TelemetryUtils.jsm", this);
-Cu.import("resource://gre/modules/Timer.jsm", this);
-Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://gre/modules/UpdateUtils.jsm", this);
-
-const PREF_BRANCH = "toolkit.telemetry.";
-const PREF_SERVER = PREF_BRANCH + "server";
-
-const TEST_CHANNEL = "TestChannelABC";
-
-const PREF_POLICY_BRANCH = "datareporting.policy.";
-const PREF_BYPASS_NOTIFICATION = PREF_POLICY_BRANCH + "dataSubmissionPolicyBypassNotification";
-const PREF_DATA_SUBMISSION_ENABLED = PREF_POLICY_BRANCH + "dataSubmissionEnabled";
-const PREF_CURRENT_POLICY_VERSION = PREF_POLICY_BRANCH + "currentPolicyVersion";
-const PREF_MINIMUM_POLICY_VERSION = PREF_POLICY_BRANCH + "minimumPolicyVersion";
-const PREF_MINIMUM_CHANNEL_POLICY_VERSION = PREF_MINIMUM_POLICY_VERSION + ".channel-" + TEST_CHANNEL;
-const PREF_ACCEPTED_POLICY_VERSION = PREF_POLICY_BRANCH + "dataSubmissionPolicyAcceptedVersion";
-const PREF_ACCEPTED_POLICY_DATE = PREF_POLICY_BRANCH + "dataSubmissionPolicyNotifiedTime";
-
-function fakeShowPolicyTimeout(set, clear) {
- let reportingPolicy = Cu.import("resource://gre/modules/TelemetryReportingPolicy.jsm");
- reportingPolicy.Policy.setShowInfobarTimeout = set;
- reportingPolicy.Policy.clearShowInfobarTimeout = clear;
-}
-
-function fakeResetAcceptedPolicy() {
- Preferences.reset(PREF_ACCEPTED_POLICY_DATE);
- Preferences.reset(PREF_ACCEPTED_POLICY_VERSION);
-}
-
-function setMinimumPolicyVersion(aNewPolicyVersion) {
- const CHANNEL_NAME = UpdateUtils.getUpdateChannel(false);
- // We might have channel-dependent minimum policy versions.
- const CHANNEL_DEPENDENT_PREF = PREF_MINIMUM_POLICY_VERSION + ".channel-" + CHANNEL_NAME;
-
- // Does the channel-dependent pref exist? If so, set its value.
- if (Preferences.get(CHANNEL_DEPENDENT_PREF, undefined)) {
- Preferences.set(CHANNEL_DEPENDENT_PREF, aNewPolicyVersion);
- return;
- }
-
- // We don't have a channel specific minimu, so set the common one.
- Preferences.set(PREF_MINIMUM_POLICY_VERSION, aNewPolicyVersion);
-}
-
-add_task(function* test_setup() {
- // Addon manager needs a profile directory
- do_get_profile(true);
- loadAddonManager("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
-
- // Make sure we don't generate unexpected pings due to pref changes.
- yield setEmptyPrefWatchlist();
-
- Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
- // Don't bypass the notifications in this test, we'll fake it.
- Services.prefs.setBoolPref(PREF_BYPASS_NOTIFICATION, false);
-
- TelemetryReportingPolicy.setup();
-});
-
-add_task(function* test_firstRun() {
- const PREF_FIRST_RUN = "toolkit.telemetry.reportingpolicy.firstRun";
- const FIRST_RUN_TIMEOUT_MSEC = 60 * 1000; // 60s
- const OTHER_RUNS_TIMEOUT_MSEC = 10 * 1000; // 10s
-
- Preferences.reset(PREF_FIRST_RUN);
-
- let startupTimeout = 0;
- fakeShowPolicyTimeout((callback, timeout) => startupTimeout = timeout, () => {});
- TelemetryReportingPolicy.reset();
-
- Services.obs.notifyObservers(null, "sessionstore-windows-restored", null);
- Assert.equal(startupTimeout, FIRST_RUN_TIMEOUT_MSEC,
- "The infobar display timeout should be 60s on the first run.");
-
- // Run again, and check that we actually wait only 10 seconds.
- TelemetryReportingPolicy.reset();
- Services.obs.notifyObservers(null, "sessionstore-windows-restored", null);
- Assert.equal(startupTimeout, OTHER_RUNS_TIMEOUT_MSEC,
- "The infobar display timeout should be 10s on other runs.");
-});
-
-add_task(function* test_prefs() {
- TelemetryReportingPolicy.reset();
-
- let now = fakeNow(2009, 11, 18);
-
- // If the date is not valid (earlier than 2012), we don't regard the policy as accepted.
- TelemetryReportingPolicy.testInfobarShown();
- Assert.ok(!TelemetryReportingPolicy.testIsUserNotified());
- Assert.equal(Preferences.get(PREF_ACCEPTED_POLICY_DATE, null), 0,
- "Invalid dates should not make the policy accepted.");
-
- // Check that the notification date and version are correctly saved to the prefs.
- now = fakeNow(2012, 11, 18);
- TelemetryReportingPolicy.testInfobarShown();
- Assert.equal(Preferences.get(PREF_ACCEPTED_POLICY_DATE, null), now.getTime(),
- "A valid date must correctly be saved.");
-
- // Now that user is notified, check if we are allowed to upload.
- Assert.ok(TelemetryReportingPolicy.canUpload(),
- "We must be able to upload after the policy is accepted.");
-
- // Disable submission and check that we're no longer allowed to upload.
- Preferences.set(PREF_DATA_SUBMISSION_ENABLED, false);
- Assert.ok(!TelemetryReportingPolicy.canUpload(),
- "We must not be able to upload if data submission is disabled.");
-
- // Turn the submission back on.
- Preferences.set(PREF_DATA_SUBMISSION_ENABLED, true);
- Assert.ok(TelemetryReportingPolicy.canUpload(),
- "We must be able to upload if data submission is enabled and the policy was accepted.");
-
- // Set a new minimum policy version and check that user is no longer notified.
- let newMinimum = Preferences.get(PREF_CURRENT_POLICY_VERSION, 1) + 1;
- setMinimumPolicyVersion(newMinimum);
- Assert.ok(!TelemetryReportingPolicy.testIsUserNotified(),
- "A greater minimum policy version must invalidate the policy and disable upload.");
-
- // Eventually accept the policy and make sure user is notified.
- Preferences.set(PREF_CURRENT_POLICY_VERSION, newMinimum);
- TelemetryReportingPolicy.testInfobarShown();
- Assert.ok(TelemetryReportingPolicy.testIsUserNotified(),
- "Accepting the policy again should show the user as notified.");
- Assert.ok(TelemetryReportingPolicy.canUpload(),
- "Accepting the policy again should let us upload data.");
-
- // Set a new, per channel, minimum policy version. Start by setting a test current channel.
- let defaultPrefs = new Preferences({ defaultBranch: true });
- defaultPrefs.set("app.update.channel", TEST_CHANNEL);
-
- // Increase and set the new minimum version, then check that we're not notified anymore.
- newMinimum++;
- Preferences.set(PREF_MINIMUM_CHANNEL_POLICY_VERSION, newMinimum);
- Assert.ok(!TelemetryReportingPolicy.testIsUserNotified(),
- "Increasing the minimum policy version should invalidate the policy.");
-
- // Eventually accept the policy and make sure user is notified.
- Preferences.set(PREF_CURRENT_POLICY_VERSION, newMinimum);
- TelemetryReportingPolicy.testInfobarShown();
- Assert.ok(TelemetryReportingPolicy.testIsUserNotified(),
- "Accepting the policy again should show the user as notified.");
- Assert.ok(TelemetryReportingPolicy.canUpload(),
- "Accepting the policy again should let us upload data.");
-});
-
-add_task(function* test_migratePrefs() {
- const DEPRECATED_FHR_PREFS = {
- "datareporting.policy.dataSubmissionPolicyAccepted": true,
- "datareporting.policy.dataSubmissionPolicyBypassAcceptance": true,
- "datareporting.policy.dataSubmissionPolicyResponseType": "foxyeah",
- "datareporting.policy.dataSubmissionPolicyResponseTime": Date.now().toString(),
- };
-
- // Make sure the preferences are set before setting up the policy.
- for (let name in DEPRECATED_FHR_PREFS) {
- Preferences.set(name, DEPRECATED_FHR_PREFS[name]);
- }
- // Set up the policy.
- TelemetryReportingPolicy.reset();
- // They should have been removed by now.
- for (let name in DEPRECATED_FHR_PREFS) {
- Assert.ok(!Preferences.has(name), name + " should have been removed.");
- }
-});
-
-add_task(function* test_userNotifiedOfCurrentPolicy() {
- fakeResetAcceptedPolicy();
- TelemetryReportingPolicy.reset();
-
- // User should be reported as not notified by default.
- Assert.ok(!TelemetryReportingPolicy.testIsUserNotified(),
- "The initial state should be unnotified.");
-
- // Forcing a policy version should not automatically make the user notified.
- Preferences.set(PREF_ACCEPTED_POLICY_VERSION,
- TelemetryReportingPolicy.DEFAULT_DATAREPORTING_POLICY_VERSION);
- Assert.ok(!TelemetryReportingPolicy.testIsUserNotified(),
- "The default state of the date should have a time of 0 and it should therefore fail");
-
- // Showing the notification bar should make the user notified.
- fakeNow(2012, 11, 11);
- TelemetryReportingPolicy.testInfobarShown();
- Assert.ok(TelemetryReportingPolicy.testIsUserNotified(),
- "Using the proper API causes user notification to report as true.");
-
- // It is assumed that later versions of the policy will incorporate previous
- // ones, therefore this should also return true.
- let newVersion =
- Preferences.get(PREF_CURRENT_POLICY_VERSION, 1) + 1;
- Preferences.set(PREF_ACCEPTED_POLICY_VERSION, newVersion);
- Assert.ok(TelemetryReportingPolicy.testIsUserNotified(),
- "A future version of the policy should pass.");
-
- newVersion =
- Preferences.get(PREF_CURRENT_POLICY_VERSION, 1) - 1;
- Preferences.set(PREF_ACCEPTED_POLICY_VERSION, newVersion);
- Assert.ok(!TelemetryReportingPolicy.testIsUserNotified(),
- "A previous version of the policy should fail.");
-});
-
-add_task(function* test_canSend() {
- const TEST_PING_TYPE = "test-ping";
-
- PingServer.start();
- Preferences.set(PREF_SERVER, "http://localhost:" + PingServer.port);
-
- yield TelemetryController.testReset();
- TelemetryReportingPolicy.reset();
-
- // User should be reported as not notified by default.
- Assert.ok(!TelemetryReportingPolicy.testIsUserNotified(),
- "The initial state should be unnotified.");
-
- // Assert if we receive any ping before the policy is accepted.
- PingServer.registerPingHandler(() => Assert.ok(false, "Should not have received any pings now"));
- yield TelemetryController.submitExternalPing(TEST_PING_TYPE, {});
-
- // Reset the ping handler.
- PingServer.resetPingHandler();
-
- // Fake the infobar: this should also trigger the ping send task.
- TelemetryReportingPolicy.testInfobarShown();
- let ping = yield PingServer.promiseNextPings(1);
- Assert.equal(ping.length, 1, "We should have received one ping.");
- Assert.equal(ping[0].type, TEST_PING_TYPE,
- "We should have received the previous ping.");
-
- // Submit another ping, to make sure it gets sent.
- yield TelemetryController.submitExternalPing(TEST_PING_TYPE, {});
-
- // Get the ping and check its type.
- ping = yield PingServer.promiseNextPings(1);
- Assert.equal(ping.length, 1, "We should have received one ping.");
- Assert.equal(ping[0].type, TEST_PING_TYPE, "We should have received the new ping.");
-
- // Fake a restart with a pending ping.
- yield TelemetryController.addPendingPing(TEST_PING_TYPE, {});
- yield TelemetryController.testReset();
-
- // We should be immediately sending the ping out.
- ping = yield PingServer.promiseNextPings(1);
- Assert.equal(ping.length, 1, "We should have received one ping.");
- Assert.equal(ping[0].type, TEST_PING_TYPE, "We should have received the pending ping.");
-
- // Submit another ping, to make sure it gets sent.
- yield TelemetryController.submitExternalPing(TEST_PING_TYPE, {});
-
- // Get the ping and check its type.
- ping = yield PingServer.promiseNextPings(1);
- Assert.equal(ping.length, 1, "We should have received one ping.");
- Assert.equal(ping[0].type, TEST_PING_TYPE, "We should have received the new ping.");
-
- yield PingServer.stop();
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryScalars.js b/toolkit/components/telemetry/tests/unit/test_TelemetryScalars.js
deleted file mode 100644
index 5914a4235..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryScalars.js
+++ /dev/null
@@ -1,574 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
-*/
-
-const UINT_SCALAR = "telemetry.test.unsigned_int_kind";
-const STRING_SCALAR = "telemetry.test.string_kind";
-const BOOLEAN_SCALAR = "telemetry.test.boolean_kind";
-const KEYED_UINT_SCALAR = "telemetry.test.keyed_unsigned_int";
-
-add_task(function* test_serializationFormat() {
- Telemetry.clearScalars();
-
- // Set the scalars to a known value.
- const expectedUint = 3785;
- const expectedString = "some value";
- Telemetry.scalarSet(UINT_SCALAR, expectedUint);
- Telemetry.scalarSet(STRING_SCALAR, expectedString);
- Telemetry.scalarSet(BOOLEAN_SCALAR, true);
- Telemetry.keyedScalarSet(KEYED_UINT_SCALAR, "first_key", 1234);
-
- // Get a snapshot of the scalars.
- const scalars =
- Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
-
- // Check that they are serialized to the correct format.
- Assert.equal(typeof(scalars[UINT_SCALAR]), "number",
- UINT_SCALAR + " must be serialized to the correct format.");
- Assert.ok(Number.isInteger(scalars[UINT_SCALAR]),
- UINT_SCALAR + " must be a finite integer.");
- Assert.equal(scalars[UINT_SCALAR], expectedUint,
- UINT_SCALAR + " must have the correct value.");
- Assert.equal(typeof(scalars[STRING_SCALAR]), "string",
- STRING_SCALAR + " must be serialized to the correct format.");
- Assert.equal(scalars[STRING_SCALAR], expectedString,
- STRING_SCALAR + " must have the correct value.");
- Assert.equal(typeof(scalars[BOOLEAN_SCALAR]), "boolean",
- BOOLEAN_SCALAR + " must be serialized to the correct format.");
- Assert.equal(scalars[BOOLEAN_SCALAR], true,
- BOOLEAN_SCALAR + " must have the correct value.");
- Assert.ok(!(KEYED_UINT_SCALAR in scalars),
- "Keyed scalars must be reported in a separate section.");
-});
-
-add_task(function* test_keyedSerializationFormat() {
- Telemetry.clearScalars();
-
- const expectedKey = "first_key";
- const expectedOtherKey = "漢語";
- const expectedUint = 3785;
- const expectedOtherValue = 1107;
-
- Telemetry.scalarSet(UINT_SCALAR, expectedUint);
- Telemetry.keyedScalarSet(KEYED_UINT_SCALAR, expectedKey, expectedUint);
- Telemetry.keyedScalarSet(KEYED_UINT_SCALAR, expectedOtherKey, expectedOtherValue);
-
- // Get a snapshot of the scalars.
- const keyedScalars =
- Telemetry.snapshotKeyedScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
-
- Assert.ok(!(UINT_SCALAR in keyedScalars),
- UINT_SCALAR + " must not be serialized with the keyed scalars.");
- Assert.ok(KEYED_UINT_SCALAR in keyedScalars,
- KEYED_UINT_SCALAR + " must be serialized with the keyed scalars.");
- Assert.equal(Object.keys(keyedScalars[KEYED_UINT_SCALAR]).length, 2,
- "The keyed scalar must contain exactly 2 keys.");
- Assert.ok(expectedKey in keyedScalars[KEYED_UINT_SCALAR],
- KEYED_UINT_SCALAR + " must contain the expected keys.");
- Assert.ok(expectedOtherKey in keyedScalars[KEYED_UINT_SCALAR],
- KEYED_UINT_SCALAR + " must contain the expected keys.");
- Assert.ok(Number.isInteger(keyedScalars[KEYED_UINT_SCALAR][expectedKey]),
- KEYED_UINT_SCALAR + "." + expectedKey + " must be a finite integer.");
- Assert.equal(keyedScalars[KEYED_UINT_SCALAR][expectedKey], expectedUint,
- KEYED_UINT_SCALAR + "." + expectedKey + " must have the correct value.");
- Assert.equal(keyedScalars[KEYED_UINT_SCALAR][expectedOtherKey], expectedOtherValue,
- KEYED_UINT_SCALAR + "." + expectedOtherKey + " must have the correct value.");
-});
-
-add_task(function* test_nonexistingScalar() {
- const NON_EXISTING_SCALAR = "telemetry.test.non_existing";
-
- Telemetry.clearScalars();
-
- // Make sure we throw on any operation for non-existing scalars.
- Assert.throws(() => Telemetry.scalarAdd(NON_EXISTING_SCALAR, 11715),
- /NS_ERROR_ILLEGAL_VALUE/,
- "Adding to a non existing scalar must throw.");
- Assert.throws(() => Telemetry.scalarSet(NON_EXISTING_SCALAR, 11715),
- /NS_ERROR_ILLEGAL_VALUE/,
- "Setting a non existing scalar must throw.");
- Assert.throws(() => Telemetry.scalarSetMaximum(NON_EXISTING_SCALAR, 11715),
- /NS_ERROR_ILLEGAL_VALUE/,
- "Setting the maximum of a non existing scalar must throw.");
-
- // Make sure we throw on any operation for non-existing scalars.
- Assert.throws(() => Telemetry.keyedScalarAdd(NON_EXISTING_SCALAR, "some_key", 11715),
- /NS_ERROR_ILLEGAL_VALUE/,
- "Adding to a non existing keyed scalar must throw.");
- Assert.throws(() => Telemetry.keyedScalarSet(NON_EXISTING_SCALAR, "some_key", 11715),
- /NS_ERROR_ILLEGAL_VALUE/,
- "Setting a non existing keyed scalar must throw.");
- Assert.throws(() => Telemetry.keyedScalarSetMaximum(NON_EXISTING_SCALAR, "some_key", 11715),
- /NS_ERROR_ILLEGAL_VALUE/,
- "Setting the maximum of a non keyed existing scalar must throw.");
-
- // Get a snapshot of the scalars.
- const scalars =
- Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
-
- Assert.ok(!(NON_EXISTING_SCALAR in scalars), "The non existing scalar must not be persisted.");
-
- const keyedScalars =
- Telemetry.snapshotKeyedScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
-
- Assert.ok(!(NON_EXISTING_SCALAR in keyedScalars),
- "The non existing keyed scalar must not be persisted.");
-});
-
-add_task(function* test_expiredScalar() {
- const EXPIRED_SCALAR = "telemetry.test.expired";
- const EXPIRED_KEYED_SCALAR = "telemetry.test.keyed_expired";
- const UNEXPIRED_SCALAR = "telemetry.test.unexpired";
-
- Telemetry.clearScalars();
-
- // Try to set the expired scalar to some value. We will not be recording the value,
- // but we shouldn't throw.
- Telemetry.scalarAdd(EXPIRED_SCALAR, 11715);
- Telemetry.scalarSet(EXPIRED_SCALAR, 11715);
- Telemetry.scalarSetMaximum(EXPIRED_SCALAR, 11715);
- Telemetry.keyedScalarAdd(EXPIRED_KEYED_SCALAR, "some_key", 11715);
- Telemetry.keyedScalarSet(EXPIRED_KEYED_SCALAR, "some_key", 11715);
- Telemetry.keyedScalarSetMaximum(EXPIRED_KEYED_SCALAR, "some_key", 11715);
-
- // The unexpired scalar has an expiration version, but far away in the future.
- const expectedValue = 11716;
- Telemetry.scalarSet(UNEXPIRED_SCALAR, expectedValue);
-
- // Get a snapshot of the scalars.
- const scalars =
- Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
- const keyedScalars =
- Telemetry.snapshotKeyedScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
-
- Assert.ok(!(EXPIRED_SCALAR in scalars), "The expired scalar must not be persisted.");
- Assert.equal(scalars[UNEXPIRED_SCALAR], expectedValue,
- "The unexpired scalar must be persisted with the correct value.");
- Assert.ok(!(EXPIRED_KEYED_SCALAR in keyedScalars),
- "The expired keyed scalar must not be persisted.");
-});
-
-add_task(function* test_unsignedIntScalar() {
- let checkScalar = (expectedValue) => {
- const scalars =
- Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
- Assert.equal(scalars[UINT_SCALAR], expectedValue,
- UINT_SCALAR + " must contain the expected value.");
- };
-
- Telemetry.clearScalars();
-
- // Let's start with an accumulation without a prior set.
- Telemetry.scalarAdd(UINT_SCALAR, 1);
- Telemetry.scalarAdd(UINT_SCALAR, 2);
- // Do we get what we expect?
- checkScalar(3);
-
- // Let's test setting the scalar to a value.
- Telemetry.scalarSet(UINT_SCALAR, 3785);
- checkScalar(3785);
- Telemetry.scalarAdd(UINT_SCALAR, 1);
- checkScalar(3786);
-
- // Does setMaximum work?
- Telemetry.scalarSet(UINT_SCALAR, 2);
- checkScalar(2);
- Telemetry.scalarSetMaximum(UINT_SCALAR, 5);
- checkScalar(5);
- // The value of the probe should still be 5, as the previous value
- // is greater than the one we want to set.
- Telemetry.scalarSetMaximum(UINT_SCALAR, 3);
- checkScalar(5);
-
- // Check that non-integer numbers get truncated and set.
- Telemetry.scalarSet(UINT_SCALAR, 3.785);
- checkScalar(3);
-
- // Setting or adding a negative number must report an error through
- // the console and drop the change (shouldn't throw).
- Telemetry.scalarAdd(UINT_SCALAR, -5);
- Telemetry.scalarSet(UINT_SCALAR, -5);
- Telemetry.scalarSetMaximum(UINT_SCALAR, -1);
- checkScalar(3);
-
- // What happens if we try to set a value of a different type?
- Telemetry.scalarSet(UINT_SCALAR, 1);
- Assert.throws(() => Telemetry.scalarSet(UINT_SCALAR, "unexpected value"),
- /NS_ERROR_ILLEGAL_VALUE/,
- "Setting the scalar to an unexpected value type must throw.");
- Assert.throws(() => Telemetry.scalarAdd(UINT_SCALAR, "unexpected value"),
- /NS_ERROR_ILLEGAL_VALUE/,
- "Adding an unexpected value type must throw.");
- Assert.throws(() => Telemetry.scalarSetMaximum(UINT_SCALAR, "unexpected value"),
- /NS_ERROR_ILLEGAL_VALUE/,
- "Setting the scalar to an unexpected value type must throw.");
- // The stored value must not be compromised.
- checkScalar(1);
-});
-
-add_task(function* test_stringScalar() {
- let checkExpectedString = (expectedString) => {
- const scalars =
- Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
- Assert.equal(scalars[STRING_SCALAR], expectedString,
- STRING_SCALAR + " must contain the expected string value.");
- };
-
- Telemetry.clearScalars();
-
- // Let's check simple strings...
- let expected = "test string";
- Telemetry.scalarSet(STRING_SCALAR, expected);
- checkExpectedString(expected);
- expected = "漢語";
- Telemetry.scalarSet(STRING_SCALAR, expected);
- checkExpectedString(expected);
-
- // We have some unsupported operations for strings.
- Assert.throws(() => Telemetry.scalarAdd(STRING_SCALAR, 1),
- /NS_ERROR_NOT_AVAILABLE/,
- "Using an unsupported operation must throw.");
- Assert.throws(() => Telemetry.scalarAdd(STRING_SCALAR, "string value"),
- /NS_ERROR_NOT_AVAILABLE/,
- "Using an unsupported operation must throw.");
- Assert.throws(() => Telemetry.scalarSetMaximum(STRING_SCALAR, 1),
- /NS_ERROR_NOT_AVAILABLE/,
- "Using an unsupported operation must throw.");
- Assert.throws(() => Telemetry.scalarSetMaximum(STRING_SCALAR, "string value"),
- /NS_ERROR_NOT_AVAILABLE/,
- "Using an unsupported operation must throw.");
- Assert.throws(() => Telemetry.scalarSet(STRING_SCALAR, 1),
- /NS_ERROR_ILLEGAL_VALUE/,
- "The string scalar must throw if we're not setting a string.");
-
- // Try to set the scalar to a string longer than the maximum length limit.
- const LONG_STRING = "browser.qaxfiuosnzmhlg.rpvxicawolhtvmbkpnludhedobxvkjwqyeyvmv";
- Telemetry.scalarSet(STRING_SCALAR, LONG_STRING);
- checkExpectedString(LONG_STRING.substr(0, 50));
-});
-
-add_task(function* test_booleanScalar() {
- let checkExpectedBool = (expectedBoolean) => {
- const scalars =
- Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
- Assert.equal(scalars[BOOLEAN_SCALAR], expectedBoolean,
- BOOLEAN_SCALAR + " must contain the expected boolean value.");
- };
-
- Telemetry.clearScalars();
-
- // Set a test boolean value.
- let expected = false;
- Telemetry.scalarSet(BOOLEAN_SCALAR, expected);
- checkExpectedBool(expected);
- expected = true;
- Telemetry.scalarSet(BOOLEAN_SCALAR, expected);
- checkExpectedBool(expected);
-
- // Check that setting a numeric value implicitly converts to boolean.
- Telemetry.scalarSet(BOOLEAN_SCALAR, 1);
- checkExpectedBool(true);
- Telemetry.scalarSet(BOOLEAN_SCALAR, 0);
- checkExpectedBool(false);
- Telemetry.scalarSet(BOOLEAN_SCALAR, 1.0);
- checkExpectedBool(true);
- Telemetry.scalarSet(BOOLEAN_SCALAR, 0.0);
- checkExpectedBool(false);
-
- // Check that unsupported operations for booleans throw.
- Assert.throws(() => Telemetry.scalarAdd(BOOLEAN_SCALAR, 1),
- /NS_ERROR_NOT_AVAILABLE/,
- "Using an unsupported operation must throw.");
- Assert.throws(() => Telemetry.scalarAdd(BOOLEAN_SCALAR, "string value"),
- /NS_ERROR_NOT_AVAILABLE/,
- "Using an unsupported operation must throw.");
- Assert.throws(() => Telemetry.scalarSetMaximum(BOOLEAN_SCALAR, 1),
- /NS_ERROR_NOT_AVAILABLE/,
- "Using an unsupported operation must throw.");
- Assert.throws(() => Telemetry.scalarSetMaximum(BOOLEAN_SCALAR, "string value"),
- /NS_ERROR_NOT_AVAILABLE/,
- "Using an unsupported operation must throw.");
- Assert.throws(() => Telemetry.scalarSet(BOOLEAN_SCALAR, "true"),
- /NS_ERROR_ILLEGAL_VALUE/,
- "The boolean scalar must throw if we're not setting a boolean.");
-});
-
-add_task(function* test_scalarRecording() {
- const OPTIN_SCALAR = "telemetry.test.release_optin";
- const OPTOUT_SCALAR = "telemetry.test.release_optout";
-
- let checkValue = (scalarName, expectedValue) => {
- const scalars =
- Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
- Assert.equal(scalars[scalarName], expectedValue,
- scalarName + " must contain the expected value.");
- };
-
- let checkNotSerialized = (scalarName) => {
- const scalars =
- Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
- Assert.ok(!(scalarName in scalars), scalarName + " was not recorded.");
- };
-
- Telemetry.canRecordBase = false;
- Telemetry.canRecordExtended = false;
- Telemetry.clearScalars();
-
- // Check that no scalar is recorded if both base and extended recording are off.
- Telemetry.scalarSet(OPTOUT_SCALAR, 3);
- Telemetry.scalarSet(OPTIN_SCALAR, 3);
- checkNotSerialized(OPTOUT_SCALAR);
- checkNotSerialized(OPTIN_SCALAR);
-
- // Check that opt-out scalars are recorded, while opt-in are not.
- Telemetry.canRecordBase = true;
- Telemetry.scalarSet(OPTOUT_SCALAR, 3);
- Telemetry.scalarSet(OPTIN_SCALAR, 3);
- checkValue(OPTOUT_SCALAR, 3);
- checkNotSerialized(OPTIN_SCALAR);
-
- // Check that both opt-out and opt-in scalars are recorded.
- Telemetry.canRecordExtended = true;
- Telemetry.scalarSet(OPTOUT_SCALAR, 5);
- Telemetry.scalarSet(OPTIN_SCALAR, 6);
- checkValue(OPTOUT_SCALAR, 5);
- checkValue(OPTIN_SCALAR, 6);
-});
-
-add_task(function* test_keyedScalarRecording() {
- const OPTIN_SCALAR = "telemetry.test.keyed_release_optin";
- const OPTOUT_SCALAR = "telemetry.test.keyed_release_optout";
- const testKey = "policy_key";
-
- let checkValue = (scalarName, expectedValue) => {
- const scalars =
- Telemetry.snapshotKeyedScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
- Assert.equal(scalars[scalarName][testKey], expectedValue,
- scalarName + " must contain the expected value.");
- };
-
- let checkNotSerialized = (scalarName) => {
- const scalars =
- Telemetry.snapshotKeyedScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
- Assert.ok(!(scalarName in scalars), scalarName + " was not recorded.");
- };
-
- Telemetry.canRecordBase = false;
- Telemetry.canRecordExtended = false;
- Telemetry.clearScalars();
-
- // Check that no scalar is recorded if both base and extended recording are off.
- Telemetry.keyedScalarSet(OPTOUT_SCALAR, testKey, 3);
- Telemetry.keyedScalarSet(OPTIN_SCALAR, testKey, 3);
- checkNotSerialized(OPTOUT_SCALAR);
- checkNotSerialized(OPTIN_SCALAR);
-
- // Check that opt-out scalars are recorded, while opt-in are not.
- Telemetry.canRecordBase = true;
- Telemetry.keyedScalarSet(OPTOUT_SCALAR, testKey, 3);
- Telemetry.keyedScalarSet(OPTIN_SCALAR, testKey, 3);
- checkValue(OPTOUT_SCALAR, 3);
- checkNotSerialized(OPTIN_SCALAR);
-
- // Check that both opt-out and opt-in scalars are recorded.
- Telemetry.canRecordExtended = true;
- Telemetry.keyedScalarSet(OPTOUT_SCALAR, testKey, 5);
- Telemetry.keyedScalarSet(OPTIN_SCALAR, testKey, 6);
- checkValue(OPTOUT_SCALAR, 5);
- checkValue(OPTIN_SCALAR, 6);
-});
-
-add_task(function* test_subsession() {
- Telemetry.clearScalars();
-
- // Set the scalars to a known value.
- Telemetry.scalarSet(UINT_SCALAR, 3785);
- Telemetry.scalarSet(STRING_SCALAR, "some value");
- Telemetry.scalarSet(BOOLEAN_SCALAR, false);
- Telemetry.keyedScalarSet(KEYED_UINT_SCALAR, "some_random_key", 12);
-
- // Get a snapshot and reset the subsession. The value we set must be there.
- let scalars =
- Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true);
- let keyedScalars =
- Telemetry.snapshotKeyedScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true);
-
- Assert.equal(scalars[UINT_SCALAR], 3785,
- UINT_SCALAR + " must contain the expected value.");
- Assert.equal(scalars[STRING_SCALAR], "some value",
- STRING_SCALAR + " must contain the expected value.");
- Assert.equal(scalars[BOOLEAN_SCALAR], false,
- BOOLEAN_SCALAR + " must contain the expected value.");
- Assert.equal(keyedScalars[KEYED_UINT_SCALAR]["some_random_key"], 12,
- KEYED_UINT_SCALAR + " must contain the expected value.");
-
- // Get a new snapshot and reset the subsession again. Since no new value
- // was set, the scalars should not be reported.
- scalars =
- Telemetry.snapshotScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true);
- keyedScalars =
- Telemetry.snapshotKeyedScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, true);
-
- Assert.ok(!(UINT_SCALAR in scalars), UINT_SCALAR + " must be empty and not reported.");
- Assert.ok(!(STRING_SCALAR in scalars), STRING_SCALAR + " must be empty and not reported.");
- Assert.ok(!(BOOLEAN_SCALAR in scalars), BOOLEAN_SCALAR + " must be empty and not reported.");
- Assert.ok(!(KEYED_UINT_SCALAR in keyedScalars), KEYED_UINT_SCALAR + " must be empty and not reported.");
-});
-
-add_task(function* test_keyed_uint() {
- Telemetry.clearScalars();
-
- const KEYS = [ "a_key", "another_key", "third_key" ];
- let expectedValues = [ 1, 1, 1 ];
-
- // Set all the keys to a baseline value.
- for (let key of KEYS) {
- Telemetry.keyedScalarSet(KEYED_UINT_SCALAR, key, 1);
- }
-
- // Increment only one key.
- Telemetry.keyedScalarAdd(KEYED_UINT_SCALAR, KEYS[1], 1);
- expectedValues[1]++;
-
- // Use SetMaximum on the third key.
- Telemetry.keyedScalarSetMaximum(KEYED_UINT_SCALAR, KEYS[2], 37);
- expectedValues[2] = 37;
-
- // Get a snapshot of the scalars and make sure the keys contain
- // the correct values.
- const keyedScalars =
- Telemetry.snapshotKeyedScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
-
- for (let k = 0; k < 3; k++) {
- const keyName = KEYS[k];
- Assert.equal(keyedScalars[KEYED_UINT_SCALAR][keyName], expectedValues[k],
- KEYED_UINT_SCALAR + "." + keyName + " must contain the correct value.");
- }
-
- // Are we still throwing when doing unsupported things on uint keyed scalars?
- // Just test one single unsupported operation, the other are covered in the plain
- // unsigned scalar test.
- Assert.throws(() => Telemetry.scalarSet(KEYED_UINT_SCALAR, "new_key", "unexpected value"),
- /NS_ERROR_ILLEGAL_VALUE/,
- "Setting the scalar to an unexpected value type must throw.");
-});
-
-add_task(function* test_keyed_boolean() {
- Telemetry.clearScalars();
-
- const KEYED_BOOLEAN_TYPE = "telemetry.test.keyed_boolean_kind";
- const first_key = "first_key";
- const second_key = "second_key";
-
- // Set the initial values.
- Telemetry.keyedScalarSet(KEYED_BOOLEAN_TYPE, first_key, true);
- Telemetry.keyedScalarSet(KEYED_BOOLEAN_TYPE, second_key, false);
-
- // Get a snapshot of the scalars and make sure the keys contain
- // the correct values.
- let keyedScalars =
- Telemetry.snapshotKeyedScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
- Assert.equal(keyedScalars[KEYED_BOOLEAN_TYPE][first_key], true,
- "The key must contain the expected value.");
- Assert.equal(keyedScalars[KEYED_BOOLEAN_TYPE][second_key], false,
- "The key must contain the expected value.");
-
- // Now flip the values and make sure we get the expected values back.
- Telemetry.keyedScalarSet(KEYED_BOOLEAN_TYPE, first_key, false);
- Telemetry.keyedScalarSet(KEYED_BOOLEAN_TYPE, second_key, true);
-
- keyedScalars =
- Telemetry.snapshotKeyedScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
- Assert.equal(keyedScalars[KEYED_BOOLEAN_TYPE][first_key], false,
- "The key must contain the expected value.");
- Assert.equal(keyedScalars[KEYED_BOOLEAN_TYPE][second_key], true,
- "The key must contain the expected value.");
-
- // Are we still throwing when doing unsupported things on a boolean keyed scalars?
- // Just test one single unsupported operation, the other are covered in the plain
- // boolean scalar test.
- Assert.throws(() => Telemetry.keyedScalarAdd(KEYED_BOOLEAN_TYPE, "somehey", 1),
- /NS_ERROR_NOT_AVAILABLE/,
- "Using an unsupported operation must throw.");
-});
-
-add_task(function* test_keyed_keys_length() {
- Telemetry.clearScalars();
-
- const LONG_KEY_STRING =
- "browser.qaxfiuosnzmhlg.rpvxicawolhtvmbkpnludhedobxvkjwqyeyvmv.somemoresowereach70chars";
- const NORMAL_KEY = "a_key";
-
- // Set the value for a key within the length limits.
- Telemetry.keyedScalarSet(KEYED_UINT_SCALAR, NORMAL_KEY, 1);
-
- // Now try to set and modify the value for a very long key.
- Assert.throws(() => Telemetry.keyedScalarAdd(KEYED_UINT_SCALAR, LONG_KEY_STRING, 10),
- /NS_ERROR_ILLEGAL_VALUE/,
- "Using keys longer than 70 characters must throw.");
- Assert.throws(() => Telemetry.keyedScalarSet(KEYED_UINT_SCALAR, LONG_KEY_STRING, 1),
- /NS_ERROR_ILLEGAL_VALUE/,
- "Using keys longer than 70 characters must throw.");
- Assert.throws(() => Telemetry.keyedScalarSetMaximum(KEYED_UINT_SCALAR, LONG_KEY_STRING, 10),
- /NS_ERROR_ILLEGAL_VALUE/,
- "Using keys longer than 70 characters must throw.");
-
- // Make sure the key with the right length contains the expected value.
- let keyedScalars =
- Telemetry.snapshotKeyedScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
- Assert.equal(Object.keys(keyedScalars[KEYED_UINT_SCALAR]).length, 1,
- "The keyed scalar must contain exactly 1 key.");
- Assert.ok(NORMAL_KEY in keyedScalars[KEYED_UINT_SCALAR],
- "The keyed scalar must contain the expected key.");
- Assert.equal(keyedScalars[KEYED_UINT_SCALAR][NORMAL_KEY], 1,
- "The key must contain the expected value.");
- Assert.ok(!(LONG_KEY_STRING in keyedScalars[KEYED_UINT_SCALAR]),
- "The data for the long key should not have been recorded.");
-});
-
-add_task(function* test_keyed_max_keys() {
- Telemetry.clearScalars();
-
- // Generate the names for the first 100 keys.
- let keyNamesSet = new Set();
- for (let k = 0; k < 100; k++) {
- keyNamesSet.add("key_" + k);
- }
-
- // Add 100 keys to an histogram and set their initial value.
- let valueToSet = 0;
- keyNamesSet.forEach(keyName => {
- Telemetry.keyedScalarSet(KEYED_UINT_SCALAR, keyName, valueToSet++);
- });
-
- // Perform some operations on the 101th key. This should throw, as
- // we're not allowed to have more than 100 keys.
- const LAST_KEY_NAME = "overflowing_key";
- Assert.throws(() => Telemetry.keyedScalarAdd(KEYED_UINT_SCALAR, LAST_KEY_NAME, 10),
- /NS_ERROR_FAILURE/,
- "Using more than 100 keys must throw.");
- Assert.throws(() => Telemetry.keyedScalarSet(KEYED_UINT_SCALAR, LAST_KEY_NAME, 1),
- /NS_ERROR_FAILURE/,
- "Using more than 100 keys must throw.");
- Assert.throws(() => Telemetry.keyedScalarSetMaximum(KEYED_UINT_SCALAR, LAST_KEY_NAME, 10),
- /NS_ERROR_FAILURE/,
- "Using more than 100 keys must throw.");
-
- // Make sure all the keys except the last one are available and have the correct
- // values.
- let keyedScalars =
- Telemetry.snapshotKeyedScalars(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN);
-
- // Check that the keyed scalar only contain the first 100 keys.
- const reportedKeysSet = new Set(Object.keys(keyedScalars[KEYED_UINT_SCALAR]));
- Assert.ok([...keyNamesSet].filter(x => reportedKeysSet.has(x)) &&
- [...reportedKeysSet].filter(x => keyNamesSet.has(x)),
- "The keyed scalar must contain all the 100 keys, and drop the others.");
-
- // Check that all the keys recorded the expected values.
- let expectedValue = 0;
- keyNamesSet.forEach(keyName => {
- Assert.equal(keyedScalars[KEYED_UINT_SCALAR][keyName], expectedValue++,
- "The key must contain the expected value.");
- });
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js b/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js
deleted file mode 100644
index 88ff8cf44..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js
+++ /dev/null
@@ -1,427 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
-*/
-
-// This tests the public Telemetry API for submitting pings.
-
-"use strict";
-
-Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySession.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySend.jsm", this);
-Cu.import("resource://gre/modules/TelemetryUtils.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/Preferences.jsm", this);
-Cu.import("resource://gre/modules/osfile.jsm", this);
-
-const PREF_TELEMETRY_SERVER = "toolkit.telemetry.server";
-
-const MS_IN_A_MINUTE = 60 * 1000;
-
-function countPingTypes(pings) {
- let countByType = new Map();
- for (let p of pings) {
- countByType.set(p.type, 1 + (countByType.get(p.type) || 0));
- }
- return countByType;
-}
-
-function setPingLastModified(id, timestamp) {
- const path = OS.Path.join(TelemetryStorage.pingDirectoryPath, id);
- return OS.File.setDates(path, null, timestamp);
-}
-
-// Mock out the send timer activity.
-function waitForTimer() {
- return new Promise(resolve => {
- fakePingSendTimer((callback, timeout) => {
- resolve([callback, timeout]);
- }, () => {});
- });
-}
-
-// Allow easy faking of readable ping ids.
-// This helps with debugging issues with e.g. ordering in the send logic.
-function fakePingId(type, number) {
- const HEAD = "93bd0011-2c8f-4e1c-bee0-";
- const TAIL = "000000000000";
- const N = String(number);
- const id = HEAD + type + TAIL.slice(type.length, - N.length) + N;
- fakeGeneratePingId(() => id);
- return id;
-}
-
-var checkPingsSaved = Task.async(function* (pingIds) {
- let allFound = true;
- for (let id of pingIds) {
- const path = OS.Path.join(TelemetryStorage.pingDirectoryPath, id);
- let exists = false;
- try {
- exists = yield OS.File.exists(path);
- } catch (ex) {}
-
- if (!exists) {
- dump("checkPingsSaved - failed to find ping: " + path + "\n");
- allFound = false;
- }
- }
-
- return allFound;
-});
-
-function histogramValueCount(h) {
- return h.counts.reduce((a, b) => a + b);
-}
-
-add_task(function* test_setup() {
- // Trigger a proper telemetry init.
- do_get_profile(true);
- // Make sure we don't generate unexpected pings due to pref changes.
- yield setEmptyPrefWatchlist();
- Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
-});
-
-// Test the ping sending logic.
-add_task(function* test_sendPendingPings() {
- const TYPE_PREFIX = "test-sendPendingPings-";
- const TEST_TYPE_A = TYPE_PREFIX + "A";
- const TEST_TYPE_B = TYPE_PREFIX + "B";
-
- const TYPE_A_COUNT = 20;
- const TYPE_B_COUNT = 5;
-
- let histSuccess = Telemetry.getHistogramById("TELEMETRY_SUCCESS");
- let histSendTimeSuccess = Telemetry.getHistogramById("TELEMETRY_SEND_SUCCESS");
- let histSendTimeFail = Telemetry.getHistogramById("TELEMETRY_SEND_FAILURE");
- histSuccess.clear();
- histSendTimeSuccess.clear();
- histSendTimeFail.clear();
-
- // Fake a current date.
- let now = TelemetryUtils.truncateToDays(new Date());
- now = fakeNow(futureDate(now, 10 * 60 * MS_IN_A_MINUTE));
-
- // Enable test-mode for TelemetrySend, otherwise we won't store pending pings
- // before the module is fully initialized later.
- TelemetrySend.setTestModeEnabled(true);
-
- // Submit some pings without the server and telemetry started yet.
- for (let i = 0; i < TYPE_A_COUNT; ++i) {
- fakePingId("a", i);
- const id = yield TelemetryController.submitExternalPing(TEST_TYPE_A, {});
- yield setPingLastModified(id, now.getTime() + (i * 1000));
- }
-
- Assert.equal(TelemetrySend.pendingPingCount, TYPE_A_COUNT,
- "Should have correct pending ping count");
-
- // Submit some more pings of a different type.
- now = fakeNow(futureDate(now, 5 * MS_IN_A_MINUTE));
- for (let i = 0; i < TYPE_B_COUNT; ++i) {
- fakePingId("b", i);
- const id = yield TelemetryController.submitExternalPing(TEST_TYPE_B, {});
- yield setPingLastModified(id, now.getTime() + (i * 1000));
- }
-
- Assert.equal(TelemetrySend.pendingPingCount, TYPE_A_COUNT + TYPE_B_COUNT,
- "Should have correct pending ping count");
-
- Assert.deepEqual(histSuccess.snapshot().counts, [0, 0, 0],
- "Should not have recorded any sending in histograms yet.");
- Assert.equal(histSendTimeSuccess.snapshot().sum, 0,
- "Should not have recorded any sending in histograms yet.");
- Assert.equal(histSendTimeFail.snapshot().sum, 0,
- "Should not have recorded any sending in histograms yet.");
-
- // Now enable sending to the ping server.
- now = fakeNow(futureDate(now, MS_IN_A_MINUTE));
- PingServer.start();
- Preferences.set(PREF_TELEMETRY_SERVER, "http://localhost:" + PingServer.port);
-
- let timerPromise = waitForTimer();
- yield TelemetryController.testReset();
- let [pingSendTimerCallback, pingSendTimeout] = yield timerPromise;
- Assert.ok(!!pingSendTimerCallback, "Should have a timer callback");
-
- // We should have received 10 pings from the first send batch:
- // 5 of type B and 5 of type A, as sending is newest-first.
- // The other pings should be delayed by the 10-pings-per-minute limit.
- let pings = yield PingServer.promiseNextPings(10);
- Assert.equal(TelemetrySend.pendingPingCount, TYPE_A_COUNT - 5,
- "Should have correct pending ping count");
- PingServer.registerPingHandler(() => Assert.ok(false, "Should not have received any pings now"));
- let countByType = countPingTypes(pings);
-
- Assert.equal(countByType.get(TEST_TYPE_B), TYPE_B_COUNT,
- "Should have received the correct amount of type B pings");
- Assert.equal(countByType.get(TEST_TYPE_A), 10 - TYPE_B_COUNT,
- "Should have received the correct amount of type A pings");
-
- Assert.deepEqual(histSuccess.snapshot().counts, [0, 10, 0],
- "Should have recorded sending success in histograms.");
- Assert.equal(histogramValueCount(histSendTimeSuccess.snapshot()), 10,
- "Should have recorded successful send times in histograms.");
- Assert.equal(histogramValueCount(histSendTimeFail.snapshot()), 0,
- "Should not have recorded any failed sending in histograms yet.");
-
- // As we hit the ping send limit and still have pending pings, a send tick should
- // be scheduled in a minute.
- Assert.ok(!!pingSendTimerCallback, "Timer callback should be set");
- Assert.equal(pingSendTimeout, MS_IN_A_MINUTE, "Send tick timeout should be correct");
-
- // Trigger the next tick - we should receive the next 10 type A pings.
- PingServer.resetPingHandler();
- now = fakeNow(futureDate(now, pingSendTimeout));
- timerPromise = waitForTimer();
- pingSendTimerCallback();
- [pingSendTimerCallback, pingSendTimeout] = yield timerPromise;
-
- pings = yield PingServer.promiseNextPings(10);
- PingServer.registerPingHandler(() => Assert.ok(false, "Should not have received any pings now"));
- countByType = countPingTypes(pings);
-
- Assert.equal(countByType.get(TEST_TYPE_A), 10, "Should have received the correct amount of type A pings");
-
- // We hit the ping send limit again and still have pending pings, a send tick should
- // be scheduled in a minute.
- Assert.equal(pingSendTimeout, MS_IN_A_MINUTE, "Send tick timeout should be correct");
-
- // Trigger the next tick - we should receive the remaining type A pings.
- PingServer.resetPingHandler();
- now = fakeNow(futureDate(now, pingSendTimeout));
- yield pingSendTimerCallback();
-
- pings = yield PingServer.promiseNextPings(5);
- PingServer.registerPingHandler(() => Assert.ok(false, "Should not have received any pings now"));
- countByType = countPingTypes(pings);
-
- Assert.equal(countByType.get(TEST_TYPE_A), 5, "Should have received the correct amount of type A pings");
-
- yield TelemetrySend.testWaitOnOutgoingPings();
- PingServer.resetPingHandler();
-});
-
-add_task(function* test_sendDateHeader() {
- fakeNow(new Date(Date.UTC(2011, 1, 1, 11, 0, 0)));
- yield TelemetrySend.reset();
-
- let pingId = yield TelemetryController.submitExternalPing("test-send-date-header", {});
- let req = yield PingServer.promiseNextRequest();
- let ping = decodeRequestPayload(req);
- Assert.equal(req.getHeader("Date"), "Tue, 01 Feb 2011 11:00:00 GMT",
- "Telemetry should send the correct Date header with requests.");
- Assert.equal(ping.id, pingId, "Should have received the correct ping id.");
-});
-
-// Test the backoff timeout behavior after send failures.
-add_task(function* test_backoffTimeout() {
- const TYPE_PREFIX = "test-backoffTimeout-";
- const TEST_TYPE_C = TYPE_PREFIX + "C";
- const TEST_TYPE_D = TYPE_PREFIX + "D";
- const TEST_TYPE_E = TYPE_PREFIX + "E";
-
- let histSuccess = Telemetry.getHistogramById("TELEMETRY_SUCCESS");
- let histSendTimeSuccess = Telemetry.getHistogramById("TELEMETRY_SEND_SUCCESS");
- let histSendTimeFail = Telemetry.getHistogramById("TELEMETRY_SEND_FAILURE");
-
- // Failing a ping send now should trigger backoff behavior.
- let now = fakeNow(2010, 1, 1, 11, 0, 0);
- yield TelemetrySend.reset();
- PingServer.stop();
-
- histSuccess.clear();
- histSendTimeSuccess.clear();
- histSendTimeFail.clear();
-
- fakePingId("c", 0);
- now = fakeNow(futureDate(now, MS_IN_A_MINUTE));
- let sendAttempts = 0;
- let timerPromise = waitForTimer();
- yield TelemetryController.submitExternalPing(TEST_TYPE_C, {});
- let [pingSendTimerCallback, pingSendTimeout] = yield timerPromise;
- Assert.equal(TelemetrySend.pendingPingCount, 1, "Should have one pending ping.");
- ++sendAttempts;
-
- const MAX_BACKOFF_TIMEOUT = 120 * MS_IN_A_MINUTE;
- for (let timeout = 2 * MS_IN_A_MINUTE; timeout <= MAX_BACKOFF_TIMEOUT; timeout *= 2) {
- Assert.ok(!!pingSendTimerCallback, "Should have received a timer callback");
- Assert.equal(pingSendTimeout, timeout, "Send tick timeout should be correct");
-
- let callback = pingSendTimerCallback;
- now = fakeNow(futureDate(now, pingSendTimeout));
- timerPromise = waitForTimer();
- yield callback();
- [pingSendTimerCallback, pingSendTimeout] = yield timerPromise;
- ++sendAttempts;
- }
-
- timerPromise = waitForTimer();
- yield pingSendTimerCallback();
- [pingSendTimerCallback, pingSendTimeout] = yield timerPromise;
- Assert.equal(pingSendTimeout, MAX_BACKOFF_TIMEOUT, "Tick timeout should be capped");
- ++sendAttempts;
-
- Assert.deepEqual(histSuccess.snapshot().counts, [sendAttempts, 0, 0],
- "Should have recorded sending failure in histograms.");
- Assert.equal(histSendTimeSuccess.snapshot().sum, 0,
- "Should not have recorded any sending success in histograms yet.");
- Assert.greater(histSendTimeFail.snapshot().sum, 0,
- "Should have recorded send failure times in histograms.");
- Assert.equal(histogramValueCount(histSendTimeFail.snapshot()), sendAttempts,
- "Should have recorded send failure times in histograms.");
-
- // Submitting a new ping should reset the backoff behavior.
- fakePingId("d", 0);
- now = fakeNow(futureDate(now, MS_IN_A_MINUTE));
- timerPromise = waitForTimer();
- yield TelemetryController.submitExternalPing(TEST_TYPE_D, {});
- [pingSendTimerCallback, pingSendTimeout] = yield timerPromise;
- Assert.equal(pingSendTimeout, 2 * MS_IN_A_MINUTE, "Send tick timeout should be correct");
- sendAttempts += 2;
-
- // With the server running again, we should send out the pending pings immediately
- // when a new ping is submitted.
- PingServer.start();
- TelemetrySend.setServer("http://localhost:" + PingServer.port);
- fakePingId("e", 0);
- now = fakeNow(futureDate(now, MS_IN_A_MINUTE));
- timerPromise = waitForTimer();
- yield TelemetryController.submitExternalPing(TEST_TYPE_E, {});
-
- let pings = yield PingServer.promiseNextPings(3);
- let countByType = countPingTypes(pings);
-
- Assert.equal(countByType.get(TEST_TYPE_C), 1, "Should have received the correct amount of type C pings");
- Assert.equal(countByType.get(TEST_TYPE_D), 1, "Should have received the correct amount of type D pings");
- Assert.equal(countByType.get(TEST_TYPE_E), 1, "Should have received the correct amount of type E pings");
-
- yield TelemetrySend.testWaitOnOutgoingPings();
- Assert.equal(TelemetrySend.pendingPingCount, 0, "Should have no pending pings left");
-
- Assert.deepEqual(histSuccess.snapshot().counts, [sendAttempts, 3, 0],
- "Should have recorded sending failure in histograms.");
- Assert.greater(histSendTimeSuccess.snapshot().sum, 0,
- "Should have recorded sending success in histograms.");
- Assert.equal(histogramValueCount(histSendTimeSuccess.snapshot()), 3,
- "Should have recorded sending success in histograms.");
- Assert.equal(histogramValueCount(histSendTimeFail.snapshot()), sendAttempts,
- "Should have recorded send failure times in histograms.");
-});
-
-add_task(function* test_discardBigPings() {
- const TEST_PING_TYPE = "test-ping-type";
-
- let histSizeExceeded = Telemetry.getHistogramById("TELEMETRY_PING_SIZE_EXCEEDED_SEND");
- let histDiscardedSize = Telemetry.getHistogramById("TELEMETRY_DISCARDED_SEND_PINGS_SIZE_MB");
- let histSuccess = Telemetry.getHistogramById("TELEMETRY_SUCCESS");
- let histSendTimeSuccess = Telemetry.getHistogramById("TELEMETRY_SEND_SUCCESS");
- let histSendTimeFail = Telemetry.getHistogramById("TELEMETRY_SEND_FAILURE");
- for (let h of [histSizeExceeded, histDiscardedSize, histSuccess, histSendTimeSuccess, histSendTimeFail]) {
- h.clear();
- }
-
- // Generate a 2MB string and create an oversized payload.
- const OVERSIZED_PAYLOAD = {"data": generateRandomString(2 * 1024 * 1024)};
-
- // Reset the histograms.
- Telemetry.getHistogramById("TELEMETRY_PING_SIZE_EXCEEDED_SEND").clear();
- Telemetry.getHistogramById("TELEMETRY_DISCARDED_SEND_PINGS_SIZE_MB").clear();
-
- // Submit a ping of a normal size and check that we don't count it in the histogram.
- yield TelemetryController.submitExternalPing(TEST_PING_TYPE, { test: "test" });
- yield TelemetrySend.testWaitOnOutgoingPings();
-
- Assert.equal(histSizeExceeded.snapshot().sum, 0, "Telemetry must report no oversized ping submitted.");
- Assert.equal(histDiscardedSize.snapshot().sum, 0, "Telemetry must report no oversized pings.");
- Assert.deepEqual(histSuccess.snapshot().counts, [0, 1, 0], "Should have recorded sending success.");
- Assert.equal(histogramValueCount(histSendTimeSuccess.snapshot()), 1, "Should have recorded send success time.");
- Assert.greater(histSendTimeSuccess.snapshot().sum, 0, "Should have recorded send success time.");
- Assert.equal(histogramValueCount(histSendTimeFail.snapshot()), 0, "Should not have recorded send failure time.");
-
- // Submit an oversized ping and check that it gets discarded.
- yield TelemetryController.submitExternalPing(TEST_PING_TYPE, OVERSIZED_PAYLOAD);
- yield TelemetrySend.testWaitOnOutgoingPings();
-
- Assert.equal(histSizeExceeded.snapshot().sum, 1, "Telemetry must report 1 oversized ping submitted.");
- Assert.equal(histDiscardedSize.snapshot().counts[2], 1, "Telemetry must report a 2MB, oversized, ping submitted.");
- Assert.deepEqual(histSuccess.snapshot().counts, [0, 1, 0], "Should have recorded sending success.");
- Assert.equal(histogramValueCount(histSendTimeSuccess.snapshot()), 1, "Should have recorded send success time.");
- Assert.greater(histSendTimeSuccess.snapshot().sum, 0, "Should have recorded send success time.");
- Assert.equal(histogramValueCount(histSendTimeFail.snapshot()), 0, "Should not have recorded send failure time.");
-});
-
-add_task(function* test_evictedOnServerErrors() {
- const TEST_TYPE = "test-evicted";
-
- yield TelemetrySend.reset();
-
- let histEvicted = Telemetry.getHistogramById("TELEMETRY_PING_EVICTED_FOR_SERVER_ERRORS");
- let histSuccess = Telemetry.getHistogramById("TELEMETRY_SUCCESS");
- let histSendTimeSuccess = Telemetry.getHistogramById("TELEMETRY_SEND_SUCCESS");
- let histSendTimeFail = Telemetry.getHistogramById("TELEMETRY_SEND_FAILURE");
- for (let h of [histEvicted, histSuccess, histSendTimeSuccess, histSendTimeFail]) {
- h.clear();
- }
-
- // Write a custom ping handler which will return 403. This will trigger ping eviction
- // on client side.
- PingServer.registerPingHandler((req, res) => {
- res.setStatusLine(null, 403, "Forbidden");
- res.processAsync();
- res.finish();
- });
-
- // Clear the histogram and submit a ping.
- let pingId = yield TelemetryController.submitExternalPing(TEST_TYPE, {});
- yield TelemetrySend.testWaitOnOutgoingPings();
-
- Assert.equal(histEvicted.snapshot().sum, 1,
- "Telemetry must report a ping evicted due to server errors");
- Assert.deepEqual(histSuccess.snapshot().counts, [0, 1, 0]);
- Assert.equal(histogramValueCount(histSendTimeSuccess.snapshot()), 1);
- Assert.greater(histSendTimeSuccess.snapshot().sum, 0);
- Assert.equal(histogramValueCount(histSendTimeFail.snapshot()), 0);
-
- // The ping should not be persisted.
- yield Assert.rejects(TelemetryStorage.loadPendingPing(pingId), "The ping must not be persisted.");
-
- // Reset the ping handler and submit a new ping.
- PingServer.resetPingHandler();
- pingId = yield TelemetryController.submitExternalPing(TEST_TYPE, {});
-
- let ping = yield PingServer.promiseNextPings(1);
- Assert.equal(ping[0].id, pingId, "The correct ping must be received");
-
- // We should not have updated the error histogram.
- yield TelemetrySend.testWaitOnOutgoingPings();
- Assert.equal(histEvicted.snapshot().sum, 1, "Telemetry must report only one ping evicted due to server errors");
- Assert.deepEqual(histSuccess.snapshot().counts, [0, 2, 0]);
- Assert.equal(histogramValueCount(histSendTimeSuccess.snapshot()), 2);
- Assert.equal(histogramValueCount(histSendTimeFail.snapshot()), 0);
-});
-
-// Test that the current, non-persisted pending pings are properly saved on shutdown.
-add_task(function* test_persistCurrentPingsOnShutdown() {
- const TEST_TYPE = "test-persistCurrentPingsOnShutdown";
- const PING_COUNT = 5;
- yield TelemetrySend.reset();
- PingServer.stop();
- Assert.equal(TelemetrySend.pendingPingCount, 0, "Should have no pending pings yet");
-
- // Submit new pings that shouldn't be persisted yet.
- let ids = [];
- for (let i=0; i<5; ++i) {
- ids.push(fakePingId("f", i));
- TelemetryController.submitExternalPing(TEST_TYPE, {});
- }
-
- Assert.equal(TelemetrySend.pendingPingCount, PING_COUNT, "Should have the correct pending ping count");
-
- // Triggering a shutdown should persist the pings.
- yield TelemetrySend.shutdown();
- Assert.ok((yield checkPingsSaved(ids)), "All pending pings should have been persisted");
-
- // After a restart the pings should have been found when scanning.
- yield TelemetrySend.reset();
- Assert.equal(TelemetrySend.pendingPingCount, PING_COUNT, "Should have the correct pending ping count");
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetrySendOldPings.js b/toolkit/components/telemetry/tests/unit/test_TelemetrySendOldPings.js
deleted file mode 100644
index 221b6bcab..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetrySendOldPings.js
+++ /dev/null
@@ -1,547 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
-
-/**
- * This test case populates the profile with some fake stored
- * pings, and checks that pending pings are immediatlely sent
- * after delayed init.
- */
-
-"use strict"
-
-Cu.import("resource://gre/modules/osfile.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/Promise.jsm", this);
-Cu.import("resource://gre/modules/TelemetryStorage.jsm", this);
-Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySend.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm", this);
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-var {OS: {File, Path, Constants}} = Cu.import("resource://gre/modules/osfile.jsm", {});
-
-// We increment TelemetryStorage's MAX_PING_FILE_AGE and
-// OVERDUE_PING_FILE_AGE by 1 minute so that our test pings exceed
-// those points in time, even taking into account file system imprecision.
-const ONE_MINUTE_MS = 60 * 1000;
-const OVERDUE_PING_FILE_AGE = TelemetrySend.OVERDUE_PING_FILE_AGE + ONE_MINUTE_MS;
-
-const PING_SAVE_FOLDER = "saved-telemetry-pings";
-const PING_TIMEOUT_LENGTH = 5000;
-const OVERDUE_PINGS = 6;
-const OLD_FORMAT_PINGS = 4;
-const RECENT_PINGS = 4;
-
-const TOTAL_EXPECTED_PINGS = OVERDUE_PINGS + RECENT_PINGS + OLD_FORMAT_PINGS;
-
-const PREF_FHR_UPLOAD = "datareporting.healthreport.uploadEnabled";
-
-var gCreatedPings = 0;
-var gSeenPings = 0;
-
-/**
- * Creates some Telemetry pings for the and saves them to disk. Each ping gets a
- * unique ID based on an incrementor.
- *
- * @param {Array} aPingInfos An array of ping type objects. Each entry must be an
- * object containing a "num" field for the number of pings to create and
- * an "age" field. The latter representing the age in milliseconds to offset
- * from now. A value of 10 would make the ping 10ms older than now, for
- * example.
- * @returns Promise
- * @resolve an Array with the created pings ids.
- */
-var createSavedPings = Task.async(function* (aPingInfos) {
- let pingIds = [];
- let now = Date.now();
-
- for (let type in aPingInfos) {
- let num = aPingInfos[type].num;
- let age = now - (aPingInfos[type].age || 0);
- for (let i = 0; i < num; ++i) {
- let pingId = yield TelemetryController.addPendingPing("test-ping", {}, { overwrite: true });
- if (aPingInfos[type].age) {
- // savePing writes to the file synchronously, so we're good to
- // modify the lastModifedTime now.
- let filePath = getSavePathForPingId(pingId);
- yield File.setDates(filePath, null, age);
- }
- gCreatedPings++;
- pingIds.push(pingId);
- }
- }
-
- return pingIds;
-});
-
-/**
- * Deletes locally saved pings if they exist.
- *
- * @param aPingIds an Array of ping ids to delete.
- * @returns Promise
- */
-var clearPings = Task.async(function* (aPingIds) {
- for (let pingId of aPingIds) {
- yield TelemetryStorage.removePendingPing(pingId);
- }
-});
-
-/**
- * Fakes the pending pings storage quota.
- * @param {Integer} aPendingQuota The new quota, in bytes.
- */
-function fakePendingPingsQuota(aPendingQuota) {
- let storage = Cu.import("resource://gre/modules/TelemetryStorage.jsm");
- storage.Policy.getPendingPingsQuota = () => aPendingQuota;
-}
-
-/**
- * Returns a handle for the file that a ping should be
- * stored in locally.
- *
- * @returns path
- */
-function getSavePathForPingId(aPingId) {
- return Path.join(Constants.Path.profileDir, PING_SAVE_FOLDER, aPingId);
-}
-
-/**
- * Check if the number of Telemetry pings received by the HttpServer is not equal
- * to aExpectedNum.
- *
- * @param aExpectedNum the number of pings we expect to receive.
- */
-function assertReceivedPings(aExpectedNum) {
- do_check_eq(gSeenPings, aExpectedNum);
-}
-
-/**
- * Throws if any pings with the id in aPingIds is saved locally.
- *
- * @param aPingIds an Array of pings ids to check.
- * @returns Promise
- */
-var assertNotSaved = Task.async(function* (aPingIds) {
- let saved = 0;
- for (let id of aPingIds) {
- let filePath = getSavePathForPingId(id);
- if (yield File.exists(filePath)) {
- saved++;
- }
- }
- if (saved > 0) {
- do_throw("Found " + saved + " unexpected saved pings.");
- }
-});
-
-/**
- * Our handler function for the HttpServer that simply
- * increments the gSeenPings global when it successfully
- * receives and decodes a Telemetry payload.
- *
- * @param aRequest the HTTP request sent from HttpServer.
- */
-function pingHandler(aRequest) {
- gSeenPings++;
-}
-
-add_task(function* test_setup() {
- PingServer.start();
- PingServer.registerPingHandler(pingHandler);
- do_get_profile();
- loadAddonManager("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
- // Make sure we don't generate unexpected pings due to pref changes.
- yield setEmptyPrefWatchlist();
-
- Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
- Services.prefs.setCharPref(TelemetryController.Constants.PREF_SERVER,
- "http://localhost:" + PingServer.port);
-});
-
-/**
- * Setup the tests by making sure the ping storage directory is available, otherwise
- * |TelemetryController.testSaveDirectoryToFile| could fail.
- */
-add_task(function* setupEnvironment() {
- // The following tests assume this pref to be true by default.
- Services.prefs.setBoolPref(PREF_FHR_UPLOAD, true);
-
- yield TelemetryController.testSetup();
-
- let directory = TelemetryStorage.pingDirectoryPath;
- yield File.makeDir(directory, { ignoreExisting: true, unixMode: OS.Constants.S_IRWXU });
-
- yield TelemetryStorage.testClearPendingPings();
-});
-
-/**
- * Test that really recent pings are sent on Telemetry initialization.
- */
-add_task(function* test_recent_pings_sent() {
- let pingTypes = [{ num: RECENT_PINGS }];
- yield createSavedPings(pingTypes);
-
- yield TelemetryController.testReset();
- yield TelemetrySend.testWaitOnOutgoingPings();
- assertReceivedPings(RECENT_PINGS);
-
- yield TelemetryStorage.testClearPendingPings();
-});
-
-/**
- * Create an overdue ping in the old format and try to send it.
- */
-add_task(function* test_overdue_old_format() {
- // A test ping in the old, standard format.
- const PING_OLD_FORMAT = {
- slug: "1234567abcd",
- reason: "test-ping",
- payload: {
- info: {
- reason: "test-ping",
- OS: "XPCShell",
- appID: "SomeId",
- appVersion: "1.0",
- appName: "XPCShell",
- appBuildID: "123456789",
- appUpdateChannel: "Test",
- platformBuildID: "987654321",
- },
- },
- };
-
- // A ping with no info section, but with a slug.
- const PING_NO_INFO = {
- slug: "1234-no-info-ping",
- reason: "test-ping",
- payload: {}
- };
-
- // A ping with no payload.
- const PING_NO_PAYLOAD = {
- slug: "5678-no-payload",
- reason: "test-ping",
- };
-
- // A ping with no info and no slug.
- const PING_NO_SLUG = {
- reason: "test-ping",
- payload: {}
- };
-
- const PING_FILES_PATHS = [
- getSavePathForPingId(PING_OLD_FORMAT.slug),
- getSavePathForPingId(PING_NO_INFO.slug),
- getSavePathForPingId(PING_NO_PAYLOAD.slug),
- getSavePathForPingId("no-slug-file"),
- ];
-
- // Write the ping to file and make it overdue.
- yield TelemetryStorage.savePing(PING_OLD_FORMAT, true);
- yield TelemetryStorage.savePing(PING_NO_INFO, true);
- yield TelemetryStorage.savePing(PING_NO_PAYLOAD, true);
- yield TelemetryStorage.savePingToFile(PING_NO_SLUG, PING_FILES_PATHS[3], true);
-
- for (let f in PING_FILES_PATHS) {
- yield File.setDates(PING_FILES_PATHS[f], null, Date.now() - OVERDUE_PING_FILE_AGE);
- }
-
- gSeenPings = 0;
- yield TelemetryController.testReset();
- yield TelemetrySend.testWaitOnOutgoingPings();
- assertReceivedPings(OLD_FORMAT_PINGS);
-
- // |TelemetryStorage.cleanup| doesn't know how to remove a ping with no slug or id,
- // so remove it manually so that the next test doesn't fail.
- yield OS.File.remove(PING_FILES_PATHS[3]);
-
- yield TelemetryStorage.testClearPendingPings();
-});
-
-add_task(function* test_corrupted_pending_pings() {
- const TEST_TYPE = "test_corrupted";
-
- Telemetry.getHistogramById("TELEMETRY_PENDING_LOAD_FAILURE_READ").clear();
- Telemetry.getHistogramById("TELEMETRY_PENDING_LOAD_FAILURE_PARSE").clear();
-
- // Save a pending ping and get its id.
- let pendingPingId = yield TelemetryController.addPendingPing(TEST_TYPE, {}, {});
-
- // Try to load it: there should be no error.
- yield TelemetryStorage.loadPendingPing(pendingPingId);
-
- let h = Telemetry.getHistogramById("TELEMETRY_PENDING_LOAD_FAILURE_READ").snapshot();
- Assert.equal(h.sum, 0, "Telemetry must not report a pending ping load failure");
- h = Telemetry.getHistogramById("TELEMETRY_PENDING_LOAD_FAILURE_PARSE").snapshot();
- Assert.equal(h.sum, 0, "Telemetry must not report a pending ping parse failure");
-
- // Delete it from the disk, so that its id will be kept in the cache but it will
- // fail loading the file.
- yield OS.File.remove(getSavePathForPingId(pendingPingId));
-
- // Try to load a pending ping which isn't there anymore.
- yield Assert.rejects(TelemetryStorage.loadPendingPing(pendingPingId),
- "Telemetry must fail loading a ping which isn't there");
-
- h = Telemetry.getHistogramById("TELEMETRY_PENDING_LOAD_FAILURE_READ").snapshot();
- Assert.equal(h.sum, 1, "Telemetry must report a pending ping load failure");
- h = Telemetry.getHistogramById("TELEMETRY_PENDING_LOAD_FAILURE_PARSE").snapshot();
- Assert.equal(h.sum, 0, "Telemetry must not report a pending ping parse failure");
-
- // Save a new ping, so that it gets in the pending pings cache.
- pendingPingId = yield TelemetryController.addPendingPing(TEST_TYPE, {}, {});
- // Overwrite it with a corrupted JSON file and then try to load it.
- const INVALID_JSON = "{ invalid,JSON { {1}";
- yield OS.File.writeAtomic(getSavePathForPingId(pendingPingId), INVALID_JSON, { encoding: "utf-8" });
-
- // Try to load the ping with the corrupted JSON content.
- yield Assert.rejects(TelemetryStorage.loadPendingPing(pendingPingId),
- "Telemetry must fail loading a corrupted ping");
-
- h = Telemetry.getHistogramById("TELEMETRY_PENDING_LOAD_FAILURE_READ").snapshot();
- Assert.equal(h.sum, 1, "Telemetry must report a pending ping load failure");
- h = Telemetry.getHistogramById("TELEMETRY_PENDING_LOAD_FAILURE_PARSE").snapshot();
- Assert.equal(h.sum, 1, "Telemetry must report a pending ping parse failure");
-
- let exists = yield OS.File.exists(getSavePathForPingId(pendingPingId));
- Assert.ok(!exists, "The unparseable ping should have been removed");
-
- yield TelemetryStorage.testClearPendingPings();
-});
-
-/**
- * Create some recent and overdue pings and verify that they get sent.
- */
-add_task(function* test_overdue_pings_trigger_send() {
- let pingTypes = [
- { num: RECENT_PINGS },
- { num: OVERDUE_PINGS, age: OVERDUE_PING_FILE_AGE },
- ];
- let pings = yield createSavedPings(pingTypes);
- let recentPings = pings.slice(0, RECENT_PINGS);
- let overduePings = pings.slice(-OVERDUE_PINGS);
-
- yield TelemetryController.testReset();
- yield TelemetrySend.testWaitOnOutgoingPings();
- assertReceivedPings(TOTAL_EXPECTED_PINGS);
-
- yield assertNotSaved(recentPings);
- yield assertNotSaved(overduePings);
-
- Assert.equal(TelemetrySend.overduePingsCount, overduePings.length,
- "Should have tracked the correct amount of overdue pings");
-
- yield TelemetryStorage.testClearPendingPings();
-});
-
-/**
- * Create a ping in the old format, send it, and make sure the request URL contains
- * the correct version query parameter.
- */
-add_task(function* test_overdue_old_format() {
- // A test ping in the old, standard format.
- const PING_OLD_FORMAT = {
- slug: "1234567abcd",
- reason: "test-ping",
- payload: {
- info: {
- reason: "test-ping",
- OS: "XPCShell",
- appID: "SomeId",
- appVersion: "1.0",
- appName: "XPCShell",
- appBuildID: "123456789",
- appUpdateChannel: "Test",
- platformBuildID: "987654321",
- },
- },
- };
-
- const filePath =
- Path.join(Constants.Path.profileDir, PING_SAVE_FOLDER, PING_OLD_FORMAT.slug);
-
- // Write the ping to file and make it overdue.
- yield TelemetryStorage.savePing(PING_OLD_FORMAT, true);
- yield File.setDates(filePath, null, Date.now() - OVERDUE_PING_FILE_AGE);
-
- let receivedPings = 0;
- // Register a new prefix handler to validate the URL.
- PingServer.registerPingHandler(request => {
- // Check that we have a version query parameter in the URL.
- Assert.notEqual(request.queryString, "");
-
- // Make sure the version in the query string matches the old ping format version.
- let params = request.queryString.split("&");
- Assert.ok(params.find(p => p == "v=1"));
-
- receivedPings++;
- });
-
- yield TelemetryController.testReset();
- yield TelemetrySend.testWaitOnOutgoingPings();
- Assert.equal(receivedPings, 1, "We must receive a ping in the old format.");
-
- yield TelemetryStorage.testClearPendingPings();
- PingServer.resetPingHandler();
-});
-
-add_task(function* test_pendingPingsQuota() {
- const PING_TYPE = "foo";
-
- // Disable upload so pings don't get sent and removed from the pending pings directory.
- Services.prefs.setBoolPref(PREF_FHR_UPLOAD, false);
-
- // Remove all the pending pings then startup and wait for the cleanup task to complete.
- // There should be nothing to remove.
- yield TelemetryStorage.testClearPendingPings();
- yield TelemetryController.testReset();
- yield TelemetrySend.testWaitOnOutgoingPings();
- yield TelemetryStorage.testPendingQuotaTaskPromise();
-
- // Remove the pending deletion ping generated when flipping FHR upload off.
- yield TelemetryStorage.testClearPendingPings();
-
- let expectedPrunedPings = [];
- let expectedNotPrunedPings = [];
-
- let checkPendingPings = Task.async(function*() {
- // Check that the pruned pings are not on disk anymore.
- for (let prunedPingId of expectedPrunedPings) {
- yield Assert.rejects(TelemetryStorage.loadPendingPing(prunedPingId),
- "Ping " + prunedPingId + " should have been pruned.");
- const pingPath = getSavePathForPingId(prunedPingId);
- Assert.ok(!(yield OS.File.exists(pingPath)), "The ping should not be on the disk anymore.");
- }
-
- // Check that the expected pings are there.
- for (let expectedPingId of expectedNotPrunedPings) {
- Assert.ok((yield TelemetryStorage.loadPendingPing(expectedPingId)),
- "Ping" + expectedPingId + " should be among the pending pings.");
- }
- });
-
- let pendingPingsInfo = [];
- let pingsSizeInBytes = 0;
-
- // Create 10 pings to test the pending pings quota.
- for (let days = 1; days < 11; days++) {
- const date = fakeNow(2010, 1, days, 1, 1, 0);
- const pingId = yield TelemetryController.addPendingPing(PING_TYPE, {}, {});
-
- // Find the size of the ping.
- const pingFilePath = getSavePathForPingId(pingId);
- const pingSize = (yield OS.File.stat(pingFilePath)).size;
- // Add the info at the beginning of the array, so that most recent pings come first.
- pendingPingsInfo.unshift({id: pingId, size: pingSize, timestamp: date.getTime() });
-
- // Set the last modification date.
- yield OS.File.setDates(pingFilePath, null, date.getTime());
-
- // Add it to the pending ping directory size.
- pingsSizeInBytes += pingSize;
- }
-
- // We need to test the pending pings size before we hit the quota, otherwise a special
- // value is recorded.
- Telemetry.getHistogramById("TELEMETRY_PENDING_PINGS_SIZE_MB").clear();
- Telemetry.getHistogramById("TELEMETRY_PENDING_PINGS_EVICTED_OVER_QUOTA").clear();
- Telemetry.getHistogramById("TELEMETRY_PENDING_EVICTING_OVER_QUOTA_MS").clear();
-
- yield TelemetryController.testReset();
- yield TelemetryStorage.testPendingQuotaTaskPromise();
-
- // Check that the correct values for quota probes are reported when no quota is hit.
- let h = Telemetry.getHistogramById("TELEMETRY_PENDING_PINGS_SIZE_MB").snapshot();
- Assert.equal(h.sum, Math.round(pingsSizeInBytes / 1024 / 1024),
- "Telemetry must report the correct pending pings directory size.");
- h = Telemetry.getHistogramById("TELEMETRY_PENDING_PINGS_EVICTED_OVER_QUOTA").snapshot();
- Assert.equal(h.sum, 0, "Telemetry must report 0 evictions if quota is not hit.");
- h = Telemetry.getHistogramById("TELEMETRY_PENDING_EVICTING_OVER_QUOTA_MS").snapshot();
- Assert.equal(h.sum, 0, "Telemetry must report a null elapsed time if quota is not hit.");
-
- // Set the quota to 80% of the space.
- const testQuotaInBytes = pingsSizeInBytes * 0.8;
- fakePendingPingsQuota(testQuotaInBytes);
-
- // The storage prunes pending pings until we reach 90% of the requested storage quota.
- // Based on that, find how many pings should be kept.
- const safeQuotaSize = Math.round(testQuotaInBytes * 0.9);
- let sizeInBytes = 0;
- let pingsWithinQuota = [];
- let pingsOutsideQuota = [];
-
- for (let pingInfo of pendingPingsInfo) {
- sizeInBytes += pingInfo.size;
- if (sizeInBytes >= safeQuotaSize) {
- pingsOutsideQuota.push(pingInfo.id);
- continue;
- }
- pingsWithinQuota.push(pingInfo.id);
- }
-
- expectedNotPrunedPings = pingsWithinQuota;
- expectedPrunedPings = pingsOutsideQuota;
-
- // Reset TelemetryController to start the pending pings cleanup.
- yield TelemetryController.testReset();
- yield TelemetryStorage.testPendingQuotaTaskPromise();
- yield checkPendingPings();
-
- h = Telemetry.getHistogramById("TELEMETRY_PENDING_PINGS_EVICTED_OVER_QUOTA").snapshot();
- Assert.equal(h.sum, pingsOutsideQuota.length,
- "Telemetry must correctly report the over quota pings evicted from the pending pings directory.");
- h = Telemetry.getHistogramById("TELEMETRY_PENDING_PINGS_SIZE_MB").snapshot();
- Assert.equal(h.sum, 17, "Pending pings quota was hit, a special size must be reported.");
-
- // Trigger a cleanup again and make sure we're not removing anything.
- yield TelemetryController.testReset();
- yield TelemetryStorage.testPendingQuotaTaskPromise();
- yield checkPendingPings();
-
- const OVERSIZED_PING_ID = "9b21ec8f-f762-4d28-a2c1-44e1c4694f24";
- // Create a pending oversized ping.
- const OVERSIZED_PING = {
- id: OVERSIZED_PING_ID,
- type: PING_TYPE,
- creationDate: (new Date()).toISOString(),
- // Generate a 2MB string to use as the ping payload.
- payload: generateRandomString(2 * 1024 * 1024),
- };
- yield TelemetryStorage.savePendingPing(OVERSIZED_PING);
-
- // Reset the histograms.
- Telemetry.getHistogramById("TELEMETRY_PING_SIZE_EXCEEDED_PENDING").clear();
- Telemetry.getHistogramById("TELEMETRY_DISCARDED_PENDING_PINGS_SIZE_MB").clear();
-
- // Try to manually load the oversized ping.
- yield Assert.rejects(TelemetryStorage.loadPendingPing(OVERSIZED_PING_ID),
- "The oversized ping should have been pruned.");
- Assert.ok(!(yield OS.File.exists(getSavePathForPingId(OVERSIZED_PING_ID))),
- "The ping should not be on the disk anymore.");
-
- // Make sure we're correctly updating the related histograms.
- h = Telemetry.getHistogramById("TELEMETRY_PING_SIZE_EXCEEDED_PENDING").snapshot();
- Assert.equal(h.sum, 1, "Telemetry must report 1 oversized ping in the pending pings directory.");
- h = Telemetry.getHistogramById("TELEMETRY_DISCARDED_PENDING_PINGS_SIZE_MB").snapshot();
- Assert.equal(h.counts[2], 1, "Telemetry must report a 2MB, oversized, ping.");
-
- // Save the ping again to check if it gets pruned when scanning the pings directory.
- yield TelemetryStorage.savePendingPing(OVERSIZED_PING);
- expectedPrunedPings.push(OVERSIZED_PING_ID);
-
- // Scan the pending pings directory.
- yield TelemetryController.testReset();
- yield TelemetryStorage.testPendingQuotaTaskPromise();
- yield checkPendingPings();
-
- // Make sure we're correctly updating the related histograms.
- h = Telemetry.getHistogramById("TELEMETRY_PING_SIZE_EXCEEDED_PENDING").snapshot();
- Assert.equal(h.sum, 2, "Telemetry must report 1 oversized ping in the pending pings directory.");
- h = Telemetry.getHistogramById("TELEMETRY_DISCARDED_PENDING_PINGS_SIZE_MB").snapshot();
- Assert.equal(h.counts[2], 2, "Telemetry must report two 2MB, oversized, pings.");
-
- Services.prefs.setBoolPref(PREF_FHR_UPLOAD, true);
-});
-
-add_task(function* teardown() {
- yield PingServer.stop();
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js b/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
deleted file mode 100644
index 698133162..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
+++ /dev/null
@@ -1,2029 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
-*/
-/* This testcase triggers two telemetry pings.
- *
- * Telemetry code keeps histograms of past telemetry pings. The first
- * ping populates these histograms. One of those histograms is then
- * checked in the second request.
- */
-
-Cu.import("resource://services-common/utils.js");
-Cu.import("resource://gre/modules/ClientID.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/LightweightThemeManager.jsm", this);
-Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
-Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySession.jsm", this);
-Cu.import("resource://gre/modules/TelemetryStorage.jsm", this);
-Cu.import("resource://gre/modules/TelemetryEnvironment.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySend.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm", this);
-Cu.import("resource://gre/modules/Promise.jsm", this);
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/osfile.jsm", this);
-
-const PING_FORMAT_VERSION = 4;
-const PING_TYPE_MAIN = "main";
-const PING_TYPE_SAVED_SESSION = "saved-session";
-
-const REASON_ABORTED_SESSION = "aborted-session";
-const REASON_SAVED_SESSION = "saved-session";
-const REASON_SHUTDOWN = "shutdown";
-const REASON_TEST_PING = "test-ping";
-const REASON_DAILY = "daily";
-const REASON_ENVIRONMENT_CHANGE = "environment-change";
-
-const PLATFORM_VERSION = "1.9.2";
-const APP_VERSION = "1";
-const APP_ID = "xpcshell@tests.mozilla.org";
-const APP_NAME = "XPCShell";
-
-const IGNORE_HISTOGRAM_TO_CLONE = "MEMORY_HEAP_ALLOCATED";
-const IGNORE_CLONED_HISTOGRAM = "test::ignore_me_also";
-const ADDON_NAME = "Telemetry test addon";
-const ADDON_HISTOGRAM = "addon-histogram";
-// Add some unicode characters here to ensure that sending them works correctly.
-const SHUTDOWN_TIME = 10000;
-const FAILED_PROFILE_LOCK_ATTEMPTS = 2;
-
-// Constants from prio.h for nsIFileOutputStream.init
-const PR_WRONLY = 0x2;
-const PR_CREATE_FILE = 0x8;
-const PR_TRUNCATE = 0x20;
-const RW_OWNER = parseInt("0600", 8);
-
-const NUMBER_OF_THREADS_TO_LAUNCH = 30;
-var gNumberOfThreadsLaunched = 0;
-
-const MS_IN_ONE_HOUR = 60 * 60 * 1000;
-const MS_IN_ONE_DAY = 24 * MS_IN_ONE_HOUR;
-
-const PREF_BRANCH = "toolkit.telemetry.";
-const PREF_SERVER = PREF_BRANCH + "server";
-const PREF_FHR_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
-
-const DATAREPORTING_DIR = "datareporting";
-const ABORTED_PING_FILE_NAME = "aborted-session-ping";
-const ABORTED_SESSION_UPDATE_INTERVAL_MS = 5 * 60 * 1000;
-
-XPCOMUtils.defineLazyGetter(this, "DATAREPORTING_PATH", function() {
- return OS.Path.join(OS.Constants.Path.profileDir, DATAREPORTING_DIR);
-});
-
-var gClientID = null;
-var gMonotonicNow = 0;
-
-function generateUUID() {
- let str = Cc["@mozilla.org/uuid-generator;1"].getService(Ci.nsIUUIDGenerator).generateUUID().toString();
- // strip {}
- return str.substring(1, str.length - 1);
-}
-
-function truncateDateToDays(date) {
- return new Date(date.getFullYear(),
- date.getMonth(),
- date.getDate(),
- 0, 0, 0, 0);
-}
-
-function sendPing() {
- TelemetrySession.gatherStartup();
- if (PingServer.started) {
- TelemetrySend.setServer("http://localhost:" + PingServer.port);
- return TelemetrySession.testPing();
- }
- TelemetrySend.setServer("http://doesnotexist");
- return TelemetrySession.testPing();
-}
-
-function fakeGenerateUUID(sessionFunc, subsessionFunc) {
- let session = Cu.import("resource://gre/modules/TelemetrySession.jsm");
- session.Policy.generateSessionUUID = sessionFunc;
- session.Policy.generateSubsessionUUID = subsessionFunc;
-}
-
-function fakeIdleNotification(topic) {
- let session = Cu.import("resource://gre/modules/TelemetrySession.jsm");
- return session.TelemetryScheduler.observe(null, topic, null);
-}
-
-function setupTestData() {
-
- Services.startup.interrupted = true;
- Telemetry.registerAddonHistogram(ADDON_NAME, ADDON_HISTOGRAM,
- Telemetry.HISTOGRAM_LINEAR,
- 1, 5, 6);
- let h1 = Telemetry.getAddonHistogram(ADDON_NAME, ADDON_HISTOGRAM);
- h1.add(1);
- let h2 = Telemetry.getHistogramById("TELEMETRY_TEST_COUNT");
- h2.add();
-
- let k1 = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_COUNT");
- k1.add("a");
- k1.add("a");
- k1.add("b");
-}
-
-function getSavedPingFile(basename) {
- let tmpDir = Services.dirsvc.get("ProfD", Ci.nsIFile);
- let pingFile = tmpDir.clone();
- pingFile.append(basename);
- if (pingFile.exists()) {
- pingFile.remove(true);
- }
- do_register_cleanup(function () {
- try {
- pingFile.remove(true);
- } catch (e) {
- }
- });
- return pingFile;
-}
-
-function checkPingFormat(aPing, aType, aHasClientId, aHasEnvironment) {
- const MANDATORY_PING_FIELDS = [
- "type", "id", "creationDate", "version", "application", "payload"
- ];
-
- const APPLICATION_TEST_DATA = {
- buildId: gAppInfo.appBuildID,
- name: APP_NAME,
- version: APP_VERSION,
- vendor: "Mozilla",
- platformVersion: PLATFORM_VERSION,
- xpcomAbi: "noarch-spidermonkey",
- };
-
- // Check that the ping contains all the mandatory fields.
- for (let f of MANDATORY_PING_FIELDS) {
- Assert.ok(f in aPing, f + "must be available.");
- }
-
- Assert.equal(aPing.type, aType, "The ping must have the correct type.");
- Assert.equal(aPing.version, PING_FORMAT_VERSION, "The ping must have the correct version.");
-
- // Test the application section.
- for (let f in APPLICATION_TEST_DATA) {
- Assert.equal(aPing.application[f], APPLICATION_TEST_DATA[f],
- f + " must have the correct value.");
- }
-
- // We can't check the values for channel and architecture. Just make
- // sure they are in.
- Assert.ok("architecture" in aPing.application,
- "The application section must have an architecture field.");
- Assert.ok("channel" in aPing.application,
- "The application section must have a channel field.");
-
- // Check the clientId and environment fields, as needed.
- Assert.equal("clientId" in aPing, aHasClientId);
- Assert.equal("environment" in aPing, aHasEnvironment);
-}
-
-function checkPayloadInfo(data) {
- const ALLOWED_REASONS = [
- "environment-change", "shutdown", "daily", "saved-session", "test-ping"
- ];
- let numberCheck = arg => { return (typeof arg == "number"); };
- let positiveNumberCheck = arg => { return numberCheck(arg) && (arg >= 0); };
- let stringCheck = arg => { return (typeof arg == "string") && (arg != ""); };
- let revisionCheck = arg => {
- return (Services.appinfo.isOfficial) ? stringCheck(arg) : (typeof arg == "string");
- };
- let uuidCheck = arg => {
- return UUID_REGEX.test(arg);
- };
- let isoDateCheck = arg => {
- // We expect use of this version of the ISO format:
- // 2015-04-12T18:51:19.1+00:00
- const isoDateRegEx = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d+[+-]\d{2}:\d{2}$/;
- return stringCheck(arg) && !Number.isNaN(Date.parse(arg)) &&
- isoDateRegEx.test(arg);
- };
-
- const EXPECTED_INFO_FIELDS_TYPES = {
- reason: stringCheck,
- revision: revisionCheck,
- timezoneOffset: numberCheck,
- sessionId: uuidCheck,
- subsessionId: uuidCheck,
- // Special cases: previousSessionId and previousSubsessionId are null on first run.
- previousSessionId: (arg) => { return (arg) ? uuidCheck(arg) : true; },
- previousSubsessionId: (arg) => { return (arg) ? uuidCheck(arg) : true; },
- subsessionCounter: positiveNumberCheck,
- profileSubsessionCounter: positiveNumberCheck,
- sessionStartDate: isoDateCheck,
- subsessionStartDate: isoDateCheck,
- subsessionLength: positiveNumberCheck,
- };
-
- for (let f in EXPECTED_INFO_FIELDS_TYPES) {
- Assert.ok(f in data, f + " must be available.");
-
- let checkFunc = EXPECTED_INFO_FIELDS_TYPES[f];
- Assert.ok(checkFunc(data[f]),
- f + " must have the correct type and valid data " + data[f]);
- }
-
- // Previous buildId is not mandatory.
- if (data.previousBuildId) {
- Assert.ok(stringCheck(data.previousBuildId));
- }
-
- Assert.ok(ALLOWED_REASONS.find(r => r == data.reason),
- "Payload must contain an allowed reason.");
-
- Assert.ok(Date.parse(data.subsessionStartDate) >= Date.parse(data.sessionStartDate));
- Assert.ok(data.profileSubsessionCounter >= data.subsessionCounter);
- Assert.ok(data.timezoneOffset >= -12*60, "The timezone must be in a valid range.");
- Assert.ok(data.timezoneOffset <= 12*60, "The timezone must be in a valid range.");
-}
-
-function checkScalars(processes) {
- // Check that the scalars section is available in the ping payload.
- const parentProcess = processes.parent;
- Assert.ok("scalars" in parentProcess, "The scalars section must be available in the parent process.");
- Assert.ok("keyedScalars" in parentProcess, "The keyedScalars section must be available in the parent process.");
- Assert.equal(typeof parentProcess.scalars, "object", "The scalars entry must be an object.");
- Assert.equal(typeof parentProcess.keyedScalars, "object", "The keyedScalars entry must be an object.");
-
- let checkScalar = function(scalar) {
- // Check if the value is of a supported type.
- const valueType = typeof(scalar);
- switch (valueType) {
- case "string":
- Assert.ok(scalar.length <= 50,
- "String values can't have more than 50 characters");
- break;
- case "number":
- Assert.ok(scalar >= 0,
- "We only support unsigned integer values in scalars.");
- break;
- case "boolean":
- Assert.ok(true,
- "Boolean scalar found.");
- break;
- default:
- Assert.ok(false,
- name + " contains an unsupported value type (" + valueType + ")");
- }
- }
-
- // Check that we have valid scalar entries.
- const scalars = parentProcess.scalars;
- for (let name in scalars) {
- Assert.equal(typeof name, "string", "Scalar names must be strings.");
- checkScalar(scalar[name]);
- }
-
- // Check that we have valid keyed scalar entries.
- const keyedScalars = parentProcess.keyedScalars;
- for (let name in keyedScalars) {
- Assert.equal(typeof name, "string", "Scalar names must be strings.");
- Assert.ok(Object.keys(keyedScalars[name]).length,
- "The reported keyed scalars must contain at least 1 key.");
- for (let key in keyedScalars[name]) {
- Assert.equal(typeof key, "string", "Keyed scalar keys must be strings.");
- Assert.ok(key.length <= 70, "Keyed scalar keys can't have more than 70 characters.");
- checkScalar(scalar[name][key]);
- }
- }
-}
-
-function checkEvents(processes) {
- // Check that the events section is available in the ping payload.
- const parent = processes.parent;
- Assert.ok("events" in parent, "The events section must be available in the parent process.");
-
- // Check that the events section has the right format.
- Assert.ok(Array.isArray(parent.events), "The events entry must be an array.");
- for (let [ts, category, method, object, value, extra] of parent.events) {
- Assert.equal(typeof(ts), "number", "Timestamp field should be a number.");
- Assert.greaterOrEqual(ts, 0, "Timestamp should be >= 0.");
-
- Assert.equal(typeof(category), "string", "Category should have the right type.");
- Assert.lessOrEqual(category.length, 100, "Category should have the right string length.");
-
- Assert.equal(typeof(method), "string", "Method should have the right type.");
- Assert.lessOrEqual(method.length, 40, "Method should have the right string length.");
-
- Assert.equal(typeof(object), "string", "Object should have the right type.");
- Assert.lessOrEqual(object.length, 40, "Object should have the right string length.");
-
- Assert.ok(value === null || typeof(value) === "string",
- "Value should be null or a string.");
- if (value) {
- Assert.lessOrEqual(value.length, 100, "Value should have the right string length.");
- }
-
- Assert.ok(extra === null || typeof(extra) === "object",
- "Extra should be null or an object.");
- if (extra) {
- let keys = Object.keys(extra);
- let keyTypes = keys.map(k => typeof(k));
- Assert.lessOrEqual(keys.length, 20, "Should not have too many extra keys.");
- Assert.ok(keyTypes.every(t => t === "string"),
- "All extra keys should be strings.");
- Assert.ok(keys.every(k => k.length <= 20),
- "All extra keys should have the right string length.");
-
- let values = Object.values(extra);
- let valueTypes = values.map(v => typeof(v));
- Assert.ok(valueTypes.every(t => t === "string"),
- "All extra values should be strings.");
- Assert.ok(values.every(v => v.length <= 100),
- "All extra values should have the right string length.");
- }
- }
-}
-
-function checkPayload(payload, reason, successfulPings, savedPings) {
- Assert.ok("info" in payload, "Payload must contain an info section.");
- checkPayloadInfo(payload.info);
-
- Assert.ok(payload.simpleMeasurements.totalTime >= 0);
- Assert.ok(payload.simpleMeasurements.uptime >= 0);
- Assert.equal(payload.simpleMeasurements.startupInterrupted, 1);
- Assert.equal(payload.simpleMeasurements.shutdownDuration, SHUTDOWN_TIME);
- Assert.equal(payload.simpleMeasurements.savedPings, savedPings);
- Assert.ok("maximalNumberOfConcurrentThreads" in payload.simpleMeasurements);
- Assert.ok(payload.simpleMeasurements.maximalNumberOfConcurrentThreads >= gNumberOfThreadsLaunched);
-
- let activeTicks = payload.simpleMeasurements.activeTicks;
- Assert.ok(activeTicks >= 0);
-
- Assert.equal(payload.simpleMeasurements.failedProfileLockCount,
- FAILED_PROFILE_LOCK_ATTEMPTS);
- let profileDirectory = Services.dirsvc.get("ProfD", Ci.nsIFile);
- let failedProfileLocksFile = profileDirectory.clone();
- failedProfileLocksFile.append("Telemetry.FailedProfileLocks.txt");
- Assert.ok(!failedProfileLocksFile.exists());
-
-
- let isWindows = ("@mozilla.org/windows-registry-key;1" in Components.classes);
- if (isWindows) {
- Assert.ok(payload.simpleMeasurements.startupSessionRestoreReadBytes > 0);
- Assert.ok(payload.simpleMeasurements.startupSessionRestoreWriteBytes > 0);
- }
-
- const TELEMETRY_SEND_SUCCESS = "TELEMETRY_SEND_SUCCESS";
- const TELEMETRY_SUCCESS = "TELEMETRY_SUCCESS";
- const TELEMETRY_TEST_FLAG = "TELEMETRY_TEST_FLAG";
- const TELEMETRY_TEST_COUNT = "TELEMETRY_TEST_COUNT";
- const TELEMETRY_TEST_KEYED_FLAG = "TELEMETRY_TEST_KEYED_FLAG";
- const TELEMETRY_TEST_KEYED_COUNT = "TELEMETRY_TEST_KEYED_COUNT";
-
- if (successfulPings > 0) {
- Assert.ok(TELEMETRY_SEND_SUCCESS in payload.histograms);
- }
- Assert.ok(TELEMETRY_TEST_FLAG in payload.histograms);
- Assert.ok(TELEMETRY_TEST_COUNT in payload.histograms);
-
- Assert.ok(!(IGNORE_CLONED_HISTOGRAM in payload.histograms));
-
- // Flag histograms should automagically spring to life.
- const expected_flag = {
- range: [1, 2],
- bucket_count: 3,
- histogram_type: 3,
- values: {0:1, 1:0},
- sum: 0
- };
- let flag = payload.histograms[TELEMETRY_TEST_FLAG];
- Assert.equal(uneval(flag), uneval(expected_flag));
-
- // We should have a test count.
- const expected_count = {
- range: [1, 2],
- bucket_count: 3,
- histogram_type: 4,
- values: {0:1, 1:0},
- sum: 1,
- };
- let count = payload.histograms[TELEMETRY_TEST_COUNT];
- Assert.equal(uneval(count), uneval(expected_count));
-
- // There should be one successful report from the previous telemetry ping.
- if (successfulPings > 0) {
- const expected_tc = {
- range: [1, 2],
- bucket_count: 3,
- histogram_type: 2,
- values: {0:2, 1:successfulPings, 2:0},
- sum: successfulPings
- };
- let tc = payload.histograms[TELEMETRY_SUCCESS];
- Assert.equal(uneval(tc), uneval(expected_tc));
- }
-
- // The ping should include data from memory reporters. We can't check that
- // this data is correct, because we can't control the values returned by the
- // memory reporters. But we can at least check that the data is there.
- //
- // It's important to check for the presence of reporters with a mix of units,
- // because TelemetryController has separate logic for each one. But we can't
- // currently check UNITS_COUNT_CUMULATIVE or UNITS_PERCENTAGE because
- // Telemetry doesn't touch a memory reporter with these units that's
- // available on all platforms.
-
- Assert.ok('MEMORY_JS_GC_HEAP' in payload.histograms); // UNITS_BYTES
- Assert.ok('MEMORY_JS_COMPARTMENTS_SYSTEM' in payload.histograms); // UNITS_COUNT
-
- // We should have included addon histograms.
- Assert.ok("addonHistograms" in payload);
- Assert.ok(ADDON_NAME in payload.addonHistograms);
- Assert.ok(ADDON_HISTOGRAM in payload.addonHistograms[ADDON_NAME]);
-
- Assert.ok(("mainThread" in payload.slowSQL) &&
- ("otherThreads" in payload.slowSQL));
-
- Assert.ok(("IceCandidatesStats" in payload.webrtc) &&
- ("webrtc" in payload.webrtc.IceCandidatesStats));
-
- // Check keyed histogram payload.
-
- Assert.ok("keyedHistograms" in payload);
- let keyedHistograms = payload.keyedHistograms;
- Assert.ok(!(TELEMETRY_TEST_KEYED_FLAG in keyedHistograms));
- Assert.ok(TELEMETRY_TEST_KEYED_COUNT in keyedHistograms);
-
- const expected_keyed_count = {
- "a": {
- range: [1, 2],
- bucket_count: 3,
- histogram_type: 4,
- values: {0:2, 1:0},
- sum: 2,
- },
- "b": {
- range: [1, 2],
- bucket_count: 3,
- histogram_type: 4,
- values: {0:1, 1:0},
- sum: 1,
- },
- };
- Assert.deepEqual(expected_keyed_count, keyedHistograms[TELEMETRY_TEST_KEYED_COUNT]);
-
- Assert.ok("processes" in payload, "The payload must have a processes section.");
- Assert.ok("parent" in payload.processes, "There must be at least a parent process.");
- checkScalars(payload.processes);
- checkEvents(payload.processes);
-}
-
-function writeStringToFile(file, contents) {
- let ostream = Cc["@mozilla.org/network/safe-file-output-stream;1"]
- .createInstance(Ci.nsIFileOutputStream);
- ostream.init(file, PR_WRONLY | PR_CREATE_FILE | PR_TRUNCATE,
- RW_OWNER, ostream.DEFER_OPEN);
- ostream.write(contents, contents.length);
- ostream.QueryInterface(Ci.nsISafeOutputStream).finish();
- ostream.close();
-}
-
-function write_fake_shutdown_file() {
- let profileDirectory = Services.dirsvc.get("ProfD", Ci.nsIFile);
- let file = profileDirectory.clone();
- file.append("Telemetry.ShutdownTime.txt");
- let contents = "" + SHUTDOWN_TIME;
- writeStringToFile(file, contents);
-}
-
-function write_fake_failedprofilelocks_file() {
- let profileDirectory = Services.dirsvc.get("ProfD", Ci.nsIFile);
- let file = profileDirectory.clone();
- file.append("Telemetry.FailedProfileLocks.txt");
- let contents = "" + FAILED_PROFILE_LOCK_ATTEMPTS;
- writeStringToFile(file, contents);
-}
-
-add_task(function* test_setup() {
- // Addon manager needs a profile directory
- do_get_profile();
- loadAddonManager(APP_ID, APP_NAME, APP_VERSION, PLATFORM_VERSION);
- // Make sure we don't generate unexpected pings due to pref changes.
- yield setEmptyPrefWatchlist();
-
- Services.prefs.setBoolPref(PREF_TELEMETRY_ENABLED, true);
- Services.prefs.setBoolPref(PREF_FHR_UPLOAD_ENABLED, true);
-
- // Make it look like we've previously failed to lock a profile a couple times.
- write_fake_failedprofilelocks_file();
-
- // Make it look like we've shutdown before.
- write_fake_shutdown_file();
-
- let currentMaxNumberOfThreads = Telemetry.maximalNumberOfConcurrentThreads;
- do_check_true(currentMaxNumberOfThreads > 0);
-
- // Try to augment the maximal number of threads currently launched
- let threads = [];
- try {
- for (let i = 0; i < currentMaxNumberOfThreads + 10; ++i) {
- threads.push(Services.tm.newThread(0));
- }
- } catch (ex) {
- // If memory is too low, it is possible that not all threads will be launched.
- }
- gNumberOfThreadsLaunched = threads.length;
-
- do_check_true(Telemetry.maximalNumberOfConcurrentThreads >= gNumberOfThreadsLaunched);
-
- do_register_cleanup(function() {
- threads.forEach(function(thread) {
- thread.shutdown();
- });
- });
-
- yield new Promise(resolve =>
- Telemetry.asyncFetchTelemetryData(wrapWithExceptionHandler(resolve)));
-});
-
-add_task(function* asyncSetup() {
- yield TelemetryController.testSetup();
- // Load the client ID from the client ID provider to check for pings sanity.
- gClientID = yield ClientID.getClientID();
-});
-
-// Ensures that expired histograms are not part of the payload.
-add_task(function* test_expiredHistogram() {
-
- let dummy = Telemetry.getHistogramById("TELEMETRY_TEST_EXPIRED");
-
- dummy.add(1);
-
- do_check_eq(TelemetrySession.getPayload()["histograms"]["TELEMETRY_TEST_EXPIRED"], undefined);
-});
-
-// Sends a ping to a non existing server. If we remove this test, we won't get
-// all the histograms we need in the main ping.
-add_task(function* test_noServerPing() {
- yield sendPing();
- // We need two pings in order to make sure STARTUP_MEMORY_STORAGE_SQLIE histograms
- // are initialised. See bug 1131585.
- yield sendPing();
- // Allowing Telemetry to persist unsent pings as pending. If omitted may cause
- // problems to the consequent tests.
- yield TelemetryController.testShutdown();
-});
-
-// Checks that a sent ping is correctly received by a dummy http server.
-add_task(function* test_simplePing() {
- yield TelemetryStorage.testClearPendingPings();
- PingServer.start();
- Preferences.set(PREF_SERVER, "http://localhost:" + PingServer.port);
-
- let now = new Date(2020, 1, 1, 12, 0, 0);
- let expectedDate = new Date(2020, 1, 1, 0, 0, 0);
- fakeNow(now);
- gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 5000);
-
- const expectedSessionUUID = "bd314d15-95bf-4356-b682-b6c4a8942202";
- const expectedSubsessionUUID = "3e2e5f6c-74ba-4e4d-a93f-a48af238a8c7";
- fakeGenerateUUID(() => expectedSessionUUID, () => expectedSubsessionUUID);
- yield TelemetryController.testReset();
-
- // Session and subsession start dates are faked during TelemetrySession setup. We can
- // now fake the session duration.
- const SESSION_DURATION_IN_MINUTES = 15;
- fakeNow(new Date(2020, 1, 1, 12, SESSION_DURATION_IN_MINUTES, 0));
- gMonotonicNow = fakeMonotonicNow(gMonotonicNow + SESSION_DURATION_IN_MINUTES * 60 * 1000);
-
- yield sendPing();
- let ping = yield PingServer.promiseNextPing();
-
- checkPingFormat(ping, PING_TYPE_MAIN, true, true);
-
- // Check that we get the data we expect.
- let payload = ping.payload;
- Assert.equal(payload.info.sessionId, expectedSessionUUID);
- Assert.equal(payload.info.subsessionId, expectedSubsessionUUID);
- let sessionStartDate = new Date(payload.info.sessionStartDate);
- Assert.equal(sessionStartDate.toISOString(), expectedDate.toISOString());
- let subsessionStartDate = new Date(payload.info.subsessionStartDate);
- Assert.equal(subsessionStartDate.toISOString(), expectedDate.toISOString());
- Assert.equal(payload.info.subsessionLength, SESSION_DURATION_IN_MINUTES * 60);
-
- // Restore the UUID generator so we don't mess with other tests.
- fakeGenerateUUID(generateUUID, generateUUID);
-});
-
-// Saves the current session histograms, reloads them, performs a ping
-// and checks that the dummy http server received both the previously
-// saved ping and the new one.
-add_task(function* test_saveLoadPing() {
- // Let's start out with a defined state.
- yield TelemetryStorage.testClearPendingPings();
- yield TelemetryController.testReset();
- PingServer.clearRequests();
-
- // Setup test data and trigger pings.
- setupTestData();
- yield TelemetrySession.testSavePendingPing();
- yield sendPing();
-
- // Get requests received by dummy server.
- const requests = yield PingServer.promiseNextRequests(2);
-
- for (let req of requests) {
- Assert.equal(req.getHeader("content-type"), "application/json; charset=UTF-8",
- "The request must have the correct content-type.");
- }
-
- // We decode both requests to check for the |reason|.
- let pings = Array.from(requests, decodeRequestPayload);
-
- // Check we have the correct two requests. Ordering is not guaranteed. The ping type
- // is encoded in the URL.
- if (pings[0].type != PING_TYPE_MAIN) {
- pings.reverse();
- }
-
- checkPingFormat(pings[0], PING_TYPE_MAIN, true, true);
- checkPayload(pings[0].payload, REASON_TEST_PING, 0, 1);
- checkPingFormat(pings[1], PING_TYPE_SAVED_SESSION, true, true);
- checkPayload(pings[1].payload, REASON_SAVED_SESSION, 0, 0);
-});
-
-add_task(function* test_checkSubsessionScalars() {
- if (gIsAndroid) {
- // We don't support subsessions yet on Android.
- return;
- }
-
- // Clear the scalars.
- Telemetry.clearScalars();
- yield TelemetryController.testReset();
-
- // Set some scalars.
- const UINT_SCALAR = "telemetry.test.unsigned_int_kind";
- const STRING_SCALAR = "telemetry.test.string_kind";
- let expectedUint = 37;
- let expectedString = "Test value. Yay.";
- Telemetry.scalarSet(UINT_SCALAR, expectedUint);
- Telemetry.scalarSet(STRING_SCALAR, expectedString);
-
- // Check that scalars are not available in classic pings but are in subsession
- // pings. Also clear the subsession.
- let classic = TelemetrySession.getPayload();
- let subsession = TelemetrySession.getPayload("environment-change", true);
-
- const TEST_SCALARS = [ UINT_SCALAR, STRING_SCALAR ];
- for (let name of TEST_SCALARS) {
- // Scalar must be reported in subsession pings (e.g. main).
- Assert.ok(name in subsession.processes.parent.scalars,
- name + " must be reported in a subsession ping.");
- }
- // No scalar must be reported in classic pings (e.g. saved-session).
- Assert.ok(Object.keys(classic.processes.parent.scalars).length == 0,
- "Scalars must not be reported in a classic ping.");
-
- // And make sure that we're getting the right values in the
- // subsession ping.
- Assert.equal(subsession.processes.parent.scalars[UINT_SCALAR], expectedUint,
- UINT_SCALAR + " must contain the expected value.");
- Assert.equal(subsession.processes.parent.scalars[STRING_SCALAR], expectedString,
- STRING_SCALAR + " must contain the expected value.");
-
- // Since we cleared the subsession in the last getPayload(), check that
- // breaking subsessions clears the scalars.
- subsession = TelemetrySession.getPayload("environment-change");
- for (let name of TEST_SCALARS) {
- Assert.ok(!(name in subsession.processes.parent.scalars),
- name + " must be cleared with the new subsession.");
- }
-
- // Check if setting the scalars again works as expected.
- expectedUint = 85;
- expectedString = "A creative different value";
- Telemetry.scalarSet(UINT_SCALAR, expectedUint);
- Telemetry.scalarSet(STRING_SCALAR, expectedString);
- subsession = TelemetrySession.getPayload("environment-change");
- Assert.equal(subsession.processes.parent.scalars[UINT_SCALAR], expectedUint,
- UINT_SCALAR + " must contain the expected value.");
- Assert.equal(subsession.processes.parent.scalars[STRING_SCALAR], expectedString,
- STRING_SCALAR + " must contain the expected value.");
-});
-
-add_task(function* test_checkSubsessionEvents() {
- if (gIsAndroid) {
- // We don't support subsessions yet on Android.
- return;
- }
-
- // Clear the events.
- Telemetry.clearEvents();
- yield TelemetryController.testReset();
-
- // Record some events.
- let expected = [
- ["telemetry.test", "test1", "object1", "a", null],
- ["telemetry.test", "test1", "object1", null, {key1: "value"}],
- ];
- for (let event of expected) {
- Telemetry.recordEvent(...event);
- }
-
- // Strip off trailing null values to match the serialized events.
- for (let e of expected) {
- while ((e.length >= 3) && (e[e.length - 1] === null)) {
- e.pop();
- }
- }
-
- // Check that events are not available in classic pings but are in subsession
- // pings. Also clear the subsession.
- let classic = TelemetrySession.getPayload();
- let subsession = TelemetrySession.getPayload("environment-change", true);
-
- Assert.ok("events" in classic.processes.parent, "Should have an events field in classic payload.");
- Assert.ok("events" in subsession.processes.parent, "Should have an events field in subsession payload.");
-
- // They should be empty in the classic payload.
- Assert.deepEqual(classic.processes.parent.events, [], "Events in classic payload should be empty.");
-
- // In the subsession payload, they should contain the recorded test events.
- let events = subsession.processes.parent.events.filter(e => e[1] === "telemetry.test");
- Assert.equal(events.length, expected.length, "Should have the right amount of events in the payload.");
- for (let i = 0; i < expected.length; ++i) {
- Assert.deepEqual(events[i].slice(1), expected[i],
- "Should have the right event data in the ping.");
- }
-
- // As we cleared the subsession above, the events entry should now be empty.
- subsession = TelemetrySession.getPayload("environment-change", false);
- Assert.ok("events" in subsession.processes.parent, "Should have an events field in subsession payload.");
- events = subsession.processes.parent.events.filter(e => e[1] === "telemetry.test");
- Assert.equal(events.length, 0, "Should have no test events in the subsession payload now.");
-});
-
-add_task(function* test_checkSubsessionHistograms() {
- if (gIsAndroid) {
- // We don't support subsessions yet on Android.
- return;
- }
-
- let now = new Date(2020, 1, 1, 12, 0, 0);
- let expectedDate = new Date(2020, 1, 1, 0, 0, 0);
- fakeNow(now);
- yield TelemetryController.testReset();
-
- const COUNT_ID = "TELEMETRY_TEST_COUNT";
- const KEYED_ID = "TELEMETRY_TEST_KEYED_COUNT";
- const count = Telemetry.getHistogramById(COUNT_ID);
- const keyed = Telemetry.getKeyedHistogramById(KEYED_ID);
- const registeredIds =
- new Set(Telemetry.registeredHistograms(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, []));
-
- const stableHistograms = new Set([
- "TELEMETRY_TEST_FLAG",
- "TELEMETRY_TEST_COUNT",
- "TELEMETRY_TEST_RELEASE_OPTOUT",
- "TELEMETRY_TEST_RELEASE_OPTIN",
- "STARTUP_CRASH_DETECTED",
- ]);
-
- const stableKeyedHistograms = new Set([
- "TELEMETRY_TEST_KEYED_FLAG",
- "TELEMETRY_TEST_KEYED_COUNT",
- "TELEMETRY_TEST_KEYED_RELEASE_OPTIN",
- "TELEMETRY_TEST_KEYED_RELEASE_OPTOUT",
- ]);
-
- // Compare the two sets of histograms.
- // The "subsession" histograms should match the registered
- // "classic" histograms. However, histograms can change
- // between us collecting the different payloads, so we only
- // check for deep equality on known stable histograms.
- checkHistograms = (classic, subsession) => {
- for (let id of Object.keys(classic)) {
- if (!registeredIds.has(id)) {
- continue;
- }
-
- Assert.ok(id in subsession);
- if (stableHistograms.has(id)) {
- Assert.deepEqual(classic[id],
- subsession[id]);
- } else {
- Assert.equal(classic[id].histogram_type,
- subsession[id].histogram_type);
- }
- }
- };
-
- // Same as above, except for keyed histograms.
- checkKeyedHistograms = (classic, subsession) => {
- for (let id of Object.keys(classic)) {
- if (!registeredIds.has(id)) {
- continue;
- }
-
- Assert.ok(id in subsession);
- if (stableKeyedHistograms.has(id)) {
- Assert.deepEqual(classic[id],
- subsession[id]);
- }
- }
- };
-
- // Both classic and subsession payload histograms should start the same.
- // The payloads should be identical for now except for the reason.
- count.clear();
- keyed.clear();
- let classic = TelemetrySession.getPayload();
- let subsession = TelemetrySession.getPayload("environment-change");
-
- Assert.equal(classic.info.reason, "gather-payload");
- Assert.equal(subsession.info.reason, "environment-change");
- Assert.ok(!(COUNT_ID in classic.histograms));
- Assert.ok(!(COUNT_ID in subsession.histograms));
- Assert.ok(!(KEYED_ID in classic.keyedHistograms));
- Assert.ok(!(KEYED_ID in subsession.keyedHistograms));
-
- checkHistograms(classic.histograms, subsession.histograms);
- checkKeyedHistograms(classic.keyedHistograms, subsession.keyedHistograms);
-
- // Adding values should get picked up in both.
- count.add(1);
- keyed.add("a", 1);
- keyed.add("b", 1);
- classic = TelemetrySession.getPayload();
- subsession = TelemetrySession.getPayload("environment-change");
-
- Assert.ok(COUNT_ID in classic.histograms);
- Assert.ok(COUNT_ID in subsession.histograms);
- Assert.ok(KEYED_ID in classic.keyedHistograms);
- Assert.ok(KEYED_ID in subsession.keyedHistograms);
- Assert.equal(classic.histograms[COUNT_ID].sum, 1);
- Assert.equal(classic.keyedHistograms[KEYED_ID]["a"].sum, 1);
- Assert.equal(classic.keyedHistograms[KEYED_ID]["b"].sum, 1);
-
- checkHistograms(classic.histograms, subsession.histograms);
- checkKeyedHistograms(classic.keyedHistograms, subsession.keyedHistograms);
-
- // Values should still reset properly.
- count.clear();
- keyed.clear();
- classic = TelemetrySession.getPayload();
- subsession = TelemetrySession.getPayload("environment-change");
-
- Assert.ok(!(COUNT_ID in classic.histograms));
- Assert.ok(!(COUNT_ID in subsession.histograms));
- Assert.ok(!(KEYED_ID in classic.keyedHistograms));
- Assert.ok(!(KEYED_ID in subsession.keyedHistograms));
-
- checkHistograms(classic.histograms, subsession.histograms);
- checkKeyedHistograms(classic.keyedHistograms, subsession.keyedHistograms);
-
- // Adding values should get picked up in both.
- count.add(1);
- keyed.add("a", 1);
- keyed.add("b", 1);
- classic = TelemetrySession.getPayload();
- subsession = TelemetrySession.getPayload("environment-change");
-
- Assert.ok(COUNT_ID in classic.histograms);
- Assert.ok(COUNT_ID in subsession.histograms);
- Assert.ok(KEYED_ID in classic.keyedHistograms);
- Assert.ok(KEYED_ID in subsession.keyedHistograms);
- Assert.equal(classic.histograms[COUNT_ID].sum, 1);
- Assert.equal(classic.keyedHistograms[KEYED_ID]["a"].sum, 1);
- Assert.equal(classic.keyedHistograms[KEYED_ID]["b"].sum, 1);
-
- checkHistograms(classic.histograms, subsession.histograms);
- checkKeyedHistograms(classic.keyedHistograms, subsession.keyedHistograms);
-
- // We should be able to reset only the subsession histograms.
- // First check that "snapshot and clear" still returns the old state...
- classic = TelemetrySession.getPayload();
- subsession = TelemetrySession.getPayload("environment-change", true);
-
- let subsessionStartDate = new Date(classic.info.subsessionStartDate);
- Assert.equal(subsessionStartDate.toISOString(), expectedDate.toISOString());
- subsessionStartDate = new Date(subsession.info.subsessionStartDate);
- Assert.equal(subsessionStartDate.toISOString(), expectedDate.toISOString());
- checkHistograms(classic.histograms, subsession.histograms);
- checkKeyedHistograms(classic.keyedHistograms, subsession.keyedHistograms);
-
- // ... then check that the next snapshot shows the subsession
- // histograms got reset.
- classic = TelemetrySession.getPayload();
- subsession = TelemetrySession.getPayload("environment-change");
-
- Assert.ok(COUNT_ID in classic.histograms);
- Assert.ok(COUNT_ID in subsession.histograms);
- Assert.equal(classic.histograms[COUNT_ID].sum, 1);
- Assert.equal(subsession.histograms[COUNT_ID].sum, 0);
-
- Assert.ok(KEYED_ID in classic.keyedHistograms);
- Assert.ok(!(KEYED_ID in subsession.keyedHistograms));
- Assert.equal(classic.keyedHistograms[KEYED_ID]["a"].sum, 1);
- Assert.equal(classic.keyedHistograms[KEYED_ID]["b"].sum, 1);
-
- // Adding values should get picked up in both again.
- count.add(1);
- keyed.add("a", 1);
- keyed.add("b", 1);
- classic = TelemetrySession.getPayload();
- subsession = TelemetrySession.getPayload("environment-change");
-
- Assert.ok(COUNT_ID in classic.histograms);
- Assert.ok(COUNT_ID in subsession.histograms);
- Assert.equal(classic.histograms[COUNT_ID].sum, 2);
- Assert.equal(subsession.histograms[COUNT_ID].sum, 1);
-
- Assert.ok(KEYED_ID in classic.keyedHistograms);
- Assert.ok(KEYED_ID in subsession.keyedHistograms);
- Assert.equal(classic.keyedHistograms[KEYED_ID]["a"].sum, 2);
- Assert.equal(classic.keyedHistograms[KEYED_ID]["b"].sum, 2);
- Assert.equal(subsession.keyedHistograms[KEYED_ID]["a"].sum, 1);
- Assert.equal(subsession.keyedHistograms[KEYED_ID]["b"].sum, 1);
-});
-
-add_task(function* test_checkSubsessionData() {
- if (gIsAndroid) {
- // We don't support subsessions yet on Android.
- return;
- }
-
- // Keep track of the active ticks count if the session recorder is available.
- let sessionRecorder = TelemetryController.getSessionRecorder();
- let activeTicksAtSubsessionStart = sessionRecorder.activeTicks;
- let expectedActiveTicks = activeTicksAtSubsessionStart;
-
- incrementActiveTicks = () => {
- sessionRecorder.incrementActiveTicks();
- ++expectedActiveTicks;
- }
-
- yield TelemetryController.testReset();
-
- // Both classic and subsession payload data should be the same on the first subsession.
- incrementActiveTicks();
- let classic = TelemetrySession.getPayload();
- let subsession = TelemetrySession.getPayload("environment-change");
- Assert.equal(classic.simpleMeasurements.activeTicks, expectedActiveTicks,
- "Classic pings must count active ticks since the beginning of the session.");
- Assert.equal(subsession.simpleMeasurements.activeTicks, expectedActiveTicks,
- "Subsessions must count active ticks as classic pings on the first subsession.");
-
- // Start a new subsession and check that the active ticks are correctly reported.
- incrementActiveTicks();
- activeTicksAtSubsessionStart = sessionRecorder.activeTicks;
- classic = TelemetrySession.getPayload();
- subsession = TelemetrySession.getPayload("environment-change", true);
- Assert.equal(classic.simpleMeasurements.activeTicks, expectedActiveTicks,
- "Classic pings must count active ticks since the beginning of the session.");
- Assert.equal(subsession.simpleMeasurements.activeTicks, expectedActiveTicks,
- "Pings must not loose the tick count when starting a new subsession.");
-
- // Get a new subsession payload without clearing the subsession.
- incrementActiveTicks();
- classic = TelemetrySession.getPayload();
- subsession = TelemetrySession.getPayload("environment-change");
- Assert.equal(classic.simpleMeasurements.activeTicks, expectedActiveTicks,
- "Classic pings must count active ticks since the beginning of the session.");
- Assert.equal(subsession.simpleMeasurements.activeTicks,
- expectedActiveTicks - activeTicksAtSubsessionStart,
- "Subsessions must count active ticks since the last new subsession.");
-});
-
-add_task(function* test_dailyCollection() {
- if (gIsAndroid) {
- // We don't do daily collections yet on Android.
- return;
- }
-
- let now = new Date(2030, 1, 1, 12, 0, 0);
- let nowDay = new Date(2030, 1, 1, 0, 0, 0);
- let schedulerTickCallback = null;
-
- PingServer.clearRequests();
-
- fakeNow(now);
-
- // Fake scheduler functions to control daily collection flow in tests.
- fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
-
- // Init and check timer.
- yield TelemetryStorage.testClearPendingPings();
- yield TelemetryController.testSetup();
- TelemetrySend.setServer("http://localhost:" + PingServer.port);
-
- // Set histograms to expected state.
- const COUNT_ID = "TELEMETRY_TEST_COUNT";
- const KEYED_ID = "TELEMETRY_TEST_KEYED_COUNT";
- const count = Telemetry.getHistogramById(COUNT_ID);
- const keyed = Telemetry.getKeyedHistogramById(KEYED_ID);
-
- count.clear();
- keyed.clear();
- count.add(1);
- keyed.add("a", 1);
- keyed.add("b", 1);
- keyed.add("b", 1);
-
- // Make sure the daily ping gets triggered.
- let expectedDate = nowDay;
- now = futureDate(nowDay, MS_IN_ONE_DAY);
- fakeNow(now);
-
- Assert.ok(!!schedulerTickCallback);
- // Run a scheduler tick: it should trigger the daily ping.
- yield schedulerTickCallback();
-
- // Collect the daily ping.
- let ping = yield PingServer.promiseNextPing();
- Assert.ok(!!ping);
-
- Assert.equal(ping.type, PING_TYPE_MAIN);
- Assert.equal(ping.payload.info.reason, REASON_DAILY);
- let subsessionStartDate = new Date(ping.payload.info.subsessionStartDate);
- Assert.equal(subsessionStartDate.toISOString(), expectedDate.toISOString());
-
- Assert.equal(ping.payload.histograms[COUNT_ID].sum, 1);
- Assert.equal(ping.payload.keyedHistograms[KEYED_ID]["a"].sum, 1);
- Assert.equal(ping.payload.keyedHistograms[KEYED_ID]["b"].sum, 2);
-
- // The daily ping is rescheduled for "tomorrow".
- expectedDate = futureDate(expectedDate, MS_IN_ONE_DAY);
- now = futureDate(now, MS_IN_ONE_DAY);
- fakeNow(now);
-
- // Run a scheduler tick. Trigger and collect another ping. The histograms should be reset.
- yield schedulerTickCallback();
-
- ping = yield PingServer.promiseNextPing();
- Assert.ok(!!ping);
-
- Assert.equal(ping.type, PING_TYPE_MAIN);
- Assert.equal(ping.payload.info.reason, REASON_DAILY);
- subsessionStartDate = new Date(ping.payload.info.subsessionStartDate);
- Assert.equal(subsessionStartDate.toISOString(), expectedDate.toISOString());
-
- Assert.equal(ping.payload.histograms[COUNT_ID].sum, 0);
- Assert.ok(!(KEYED_ID in ping.payload.keyedHistograms));
-
- // Trigger and collect another daily ping, with the histograms being set again.
- count.add(1);
- keyed.add("a", 1);
- keyed.add("b", 1);
-
- // The daily ping is rescheduled for "tomorrow".
- expectedDate = futureDate(expectedDate, MS_IN_ONE_DAY);
- now = futureDate(now, MS_IN_ONE_DAY);
- fakeNow(now);
-
- yield schedulerTickCallback();
- ping = yield PingServer.promiseNextPing();
- Assert.ok(!!ping);
-
- Assert.equal(ping.type, PING_TYPE_MAIN);
- Assert.equal(ping.payload.info.reason, REASON_DAILY);
- subsessionStartDate = new Date(ping.payload.info.subsessionStartDate);
- Assert.equal(subsessionStartDate.toISOString(), expectedDate.toISOString());
-
- Assert.equal(ping.payload.histograms[COUNT_ID].sum, 1);
- Assert.equal(ping.payload.keyedHistograms[KEYED_ID]["a"].sum, 1);
- Assert.equal(ping.payload.keyedHistograms[KEYED_ID]["b"].sum, 1);
-
- // Shutdown to cleanup the aborted-session if it gets created.
- yield TelemetryController.testShutdown();
-});
-
-add_task(function* test_dailyDuplication() {
- if (gIsAndroid) {
- // We don't do daily collections yet on Android.
- return;
- }
-
- yield TelemetrySend.reset();
- yield TelemetryStorage.testClearPendingPings();
- PingServer.clearRequests();
-
- let schedulerTickCallback = null;
- let now = new Date(2030, 1, 1, 0, 0, 0);
- fakeNow(now);
- // Fake scheduler functions to control daily collection flow in tests.
- fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
- yield TelemetryController.testReset();
-
- // Make sure the daily ping gets triggered at midnight.
- // We need to make sure that we trigger this after the period where we wait for
- // the user to become idle.
- let firstDailyDue = new Date(2030, 1, 2, 0, 0, 0);
- fakeNow(firstDailyDue);
-
- // Run a scheduler tick: it should trigger the daily ping.
- Assert.ok(!!schedulerTickCallback);
- yield schedulerTickCallback();
-
- // Get the first daily ping.
- let ping = yield PingServer.promiseNextPing();
- Assert.ok(!!ping);
-
- Assert.equal(ping.type, PING_TYPE_MAIN);
- Assert.equal(ping.payload.info.reason, REASON_DAILY);
-
- // We don't expect to receive any other daily ping in this test, so assert if we do.
- PingServer.registerPingHandler((req, res) => {
- Assert.ok(false, "No more daily pings should be sent/received in this test.");
- });
-
- // Set the current time to a bit after midnight.
- let secondDailyDue = new Date(firstDailyDue);
- secondDailyDue.setHours(0);
- secondDailyDue.setMinutes(15);
- fakeNow(secondDailyDue);
-
- // Run a scheduler tick: it should NOT trigger the daily ping.
- Assert.ok(!!schedulerTickCallback);
- yield schedulerTickCallback();
-
- // Shutdown to cleanup the aborted-session if it gets created.
- PingServer.resetPingHandler();
- yield TelemetryController.testShutdown();
-});
-
-add_task(function* test_dailyOverdue() {
- if (gIsAndroid) {
- // We don't do daily collections yet on Android.
- return;
- }
-
- let schedulerTickCallback = null;
- let now = new Date(2030, 1, 1, 11, 0, 0);
- fakeNow(now);
- // Fake scheduler functions to control daily collection flow in tests.
- fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
- yield TelemetryStorage.testClearPendingPings();
- yield TelemetryController.testReset();
-
- // Skip one hour ahead: nothing should be due.
- now.setHours(now.getHours() + 1);
- fakeNow(now);
-
- // Assert if we receive something!
- PingServer.registerPingHandler((req, res) => {
- Assert.ok(false, "No daily ping should be received if not overdue!.");
- });
-
- // This tick should not trigger any daily ping.
- Assert.ok(!!schedulerTickCallback);
- yield schedulerTickCallback();
-
- // Restore the non asserting ping handler.
- PingServer.resetPingHandler();
- PingServer.clearRequests();
-
- // Simulate an overdue ping: we're not close to midnight, but the last daily ping
- // time is too long ago.
- let dailyOverdue = new Date(2030, 1, 2, 13, 0, 0);
- fakeNow(dailyOverdue);
-
- // Run a scheduler tick: it should trigger the daily ping.
- Assert.ok(!!schedulerTickCallback);
- yield schedulerTickCallback();
-
- // Get the first daily ping.
- let ping = yield PingServer.promiseNextPing();
- Assert.ok(!!ping);
-
- Assert.equal(ping.type, PING_TYPE_MAIN);
- Assert.equal(ping.payload.info.reason, REASON_DAILY);
-
- // Shutdown to cleanup the aborted-session if it gets created.
- yield TelemetryController.testShutdown();
-});
-
-add_task(function* test_environmentChange() {
- if (gIsAndroid) {
- // We don't split subsessions on environment changes yet on Android.
- return;
- }
-
- yield TelemetryStorage.testClearPendingPings();
- PingServer.clearRequests();
-
- let now = fakeNow(2040, 1, 1, 12, 0, 0);
- gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 10 * MILLISECONDS_PER_MINUTE);
-
- const PREF_TEST = "toolkit.telemetry.test.pref1";
- Preferences.reset(PREF_TEST);
-
- const PREFS_TO_WATCH = new Map([
- [PREF_TEST, {what: TelemetryEnvironment.RECORD_PREF_VALUE}],
- ]);
-
- // Setup.
- yield TelemetryController.testReset();
- TelemetrySend.setServer("http://localhost:" + PingServer.port);
- TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH);
-
- // Set histograms to expected state.
- const COUNT_ID = "TELEMETRY_TEST_COUNT";
- const KEYED_ID = "TELEMETRY_TEST_KEYED_COUNT";
- const count = Telemetry.getHistogramById(COUNT_ID);
- const keyed = Telemetry.getKeyedHistogramById(KEYED_ID);
-
- count.clear();
- keyed.clear();
- count.add(1);
- keyed.add("a", 1);
- keyed.add("b", 1);
-
- // Trigger and collect environment-change ping.
- gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 10 * MILLISECONDS_PER_MINUTE);
- let startDay = truncateDateToDays(now);
- now = fakeNow(futureDate(now, 10 * MILLISECONDS_PER_MINUTE));
-
- Preferences.set(PREF_TEST, 1);
- let ping = yield PingServer.promiseNextPing();
- Assert.ok(!!ping);
-
- Assert.equal(ping.type, PING_TYPE_MAIN);
- Assert.equal(ping.environment.settings.userPrefs[PREF_TEST], undefined);
- Assert.equal(ping.payload.info.reason, REASON_ENVIRONMENT_CHANGE);
- let subsessionStartDate = new Date(ping.payload.info.subsessionStartDate);
- Assert.equal(subsessionStartDate.toISOString(), startDay.toISOString());
-
- Assert.equal(ping.payload.histograms[COUNT_ID].sum, 1);
- Assert.equal(ping.payload.keyedHistograms[KEYED_ID]["a"].sum, 1);
-
- // Trigger and collect another ping. The histograms should be reset.
- startDay = truncateDateToDays(now);
- gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 10 * MILLISECONDS_PER_MINUTE);
- now = fakeNow(futureDate(now, 10 * MILLISECONDS_PER_MINUTE));
-
- Preferences.set(PREF_TEST, 2);
- ping = yield PingServer.promiseNextPing();
- Assert.ok(!!ping);
-
- Assert.equal(ping.type, PING_TYPE_MAIN);
- Assert.equal(ping.environment.settings.userPrefs[PREF_TEST], 1);
- Assert.equal(ping.payload.info.reason, REASON_ENVIRONMENT_CHANGE);
- subsessionStartDate = new Date(ping.payload.info.subsessionStartDate);
- Assert.equal(subsessionStartDate.toISOString(), startDay.toISOString());
-
- Assert.equal(ping.payload.histograms[COUNT_ID].sum, 0);
- Assert.ok(!(KEYED_ID in ping.payload.keyedHistograms));
-});
-
-add_task(function* test_savedPingsOnShutdown() {
- // On desktop, we expect both "saved-session" and "shutdown" pings. We only expect
- // the former on Android.
- const expectedPingCount = (gIsAndroid) ? 1 : 2;
- // Assure that we store the ping properly when saving sessions on shutdown.
- // We make the TelemetryController shutdown to trigger a session save.
- const dir = TelemetryStorage.pingDirectoryPath;
- yield OS.File.removeDir(dir, {ignoreAbsent: true});
- yield OS.File.makeDir(dir);
- yield TelemetryController.testShutdown();
-
- PingServer.clearRequests();
- yield TelemetryController.testReset();
-
- const pings = yield PingServer.promiseNextPings(expectedPingCount);
-
- for (let ping of pings) {
- Assert.ok("type" in ping);
-
- let expectedReason =
- (ping.type == PING_TYPE_SAVED_SESSION) ? REASON_SAVED_SESSION : REASON_SHUTDOWN;
-
- checkPingFormat(ping, ping.type, true, true);
- Assert.equal(ping.payload.info.reason, expectedReason);
- Assert.equal(ping.clientId, gClientID);
- }
-});
-
-add_task(function* test_savedSessionData() {
- // Create the directory which will contain the data file, if it doesn't already
- // exist.
- yield OS.File.makeDir(DATAREPORTING_PATH);
- getHistogram("TELEMETRY_SESSIONDATA_FAILED_LOAD").clear();
- getHistogram("TELEMETRY_SESSIONDATA_FAILED_PARSE").clear();
- getHistogram("TELEMETRY_SESSIONDATA_FAILED_VALIDATION").clear();
-
- // Write test data to the session data file.
- const dataFilePath = OS.Path.join(DATAREPORTING_PATH, "session-state.json");
- const sessionState = {
- sessionId: null,
- subsessionId: null,
- profileSubsessionCounter: 3785,
- };
- yield CommonUtils.writeJSON(sessionState, dataFilePath);
-
- const PREF_TEST = "toolkit.telemetry.test.pref1";
- Preferences.reset(PREF_TEST);
- const PREFS_TO_WATCH = new Map([
- [PREF_TEST, {what: TelemetryEnvironment.RECORD_PREF_VALUE}],
- ]);
-
- // We expect one new subsession when starting TelemetrySession and one after triggering
- // an environment change.
- const expectedSubsessions = sessionState.profileSubsessionCounter + 2;
- const expectedSessionUUID = "ff602e52-47a1-b7e8-4c1a-ffffffffc87a";
- const expectedSubsessionUUID = "009fd1ad-b85e-4817-b3e5-000000003785";
- fakeGenerateUUID(() => expectedSessionUUID, () => expectedSubsessionUUID);
-
- if (gIsAndroid) {
- // We don't support subsessions yet on Android, so skip the next checks.
- return;
- }
-
- // Start TelemetrySession so that it loads the session data file.
- yield TelemetryController.testReset();
- Assert.equal(0, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_LOAD").sum);
- Assert.equal(0, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_PARSE").sum);
- Assert.equal(0, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_VALIDATION").sum);
-
- // Watch a test preference, trigger and environment change and wait for it to propagate.
- // _watchPreferences triggers a subsession notification
- gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 10 * MILLISECONDS_PER_MINUTE);
- fakeNow(new Date(2050, 1, 1, 12, 0, 0));
- TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH);
- let changePromise = new Promise(resolve =>
- TelemetryEnvironment.registerChangeListener("test_fake_change", resolve));
- Preferences.set(PREF_TEST, 1);
- yield changePromise;
- TelemetryEnvironment.unregisterChangeListener("test_fake_change");
-
- let payload = TelemetrySession.getPayload();
- Assert.equal(payload.info.profileSubsessionCounter, expectedSubsessions);
- yield TelemetryController.testShutdown();
-
- // Restore the UUID generator so we don't mess with other tests.
- fakeGenerateUUID(generateUUID, generateUUID);
-
- // Load back the serialised session data.
- let data = yield CommonUtils.readJSON(dataFilePath);
- Assert.equal(data.profileSubsessionCounter, expectedSubsessions);
- Assert.equal(data.sessionId, expectedSessionUUID);
- Assert.equal(data.subsessionId, expectedSubsessionUUID);
-});
-
-add_task(function* test_sessionData_ShortSession() {
- if (gIsAndroid) {
- // We don't support subsessions yet on Android, so skip the next checks.
- return;
- }
-
- const SESSION_STATE_PATH = OS.Path.join(DATAREPORTING_PATH, "session-state.json");
-
- // Shut down Telemetry and remove the session state file.
- yield TelemetryController.testReset();
- yield OS.File.remove(SESSION_STATE_PATH, { ignoreAbsent: true });
- getHistogram("TELEMETRY_SESSIONDATA_FAILED_LOAD").clear();
- getHistogram("TELEMETRY_SESSIONDATA_FAILED_PARSE").clear();
- getHistogram("TELEMETRY_SESSIONDATA_FAILED_VALIDATION").clear();
-
- const expectedSessionUUID = "ff602e52-47a1-b7e8-4c1a-ffffffffc87a";
- const expectedSubsessionUUID = "009fd1ad-b85e-4817-b3e5-000000003785";
- fakeGenerateUUID(() => expectedSessionUUID, () => expectedSubsessionUUID);
-
- // We intentionally don't wait for the setup to complete and shut down to simulate
- // short sessions. We expect the profile subsession counter to be 1.
- TelemetryController.testReset();
- yield TelemetryController.testShutdown();
-
- Assert.equal(1, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_LOAD").sum);
- Assert.equal(0, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_PARSE").sum);
- Assert.equal(0, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_VALIDATION").sum);
-
- // Restore the UUID generation functions.
- fakeGenerateUUID(generateUUID, generateUUID);
-
- // Start TelemetryController so that it loads the session data file. We expect the profile
- // subsession counter to be incremented by 1 again.
- yield TelemetryController.testReset();
-
- // We expect 2 profile subsession counter updates.
- let payload = TelemetrySession.getPayload();
- Assert.equal(payload.info.profileSubsessionCounter, 2);
- Assert.equal(payload.info.previousSessionId, expectedSessionUUID);
- Assert.equal(payload.info.previousSubsessionId, expectedSubsessionUUID);
- Assert.equal(1, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_LOAD").sum);
- Assert.equal(0, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_PARSE").sum);
- Assert.equal(0, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_VALIDATION").sum);
-});
-
-add_task(function* test_invalidSessionData() {
- // Create the directory which will contain the data file, if it doesn't already
- // exist.
- yield OS.File.makeDir(DATAREPORTING_PATH);
- getHistogram("TELEMETRY_SESSIONDATA_FAILED_LOAD").clear();
- getHistogram("TELEMETRY_SESSIONDATA_FAILED_PARSE").clear();
- getHistogram("TELEMETRY_SESSIONDATA_FAILED_VALIDATION").clear();
-
- // Write test data to the session data file. This should fail to parse.
- const dataFilePath = OS.Path.join(DATAREPORTING_PATH, "session-state.json");
- const unparseableData = "{asdf:@äü";
- OS.File.writeAtomic(dataFilePath, unparseableData,
- {encoding: "utf-8", tmpPath: dataFilePath + ".tmp"});
-
- // Start TelemetryController so that it loads the session data file.
- yield TelemetryController.testReset();
-
- // The session data file should not load. Only expect the current subsession.
- Assert.equal(0, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_LOAD").sum);
- Assert.equal(1, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_PARSE").sum);
- Assert.equal(0, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_VALIDATION").sum);
-
- // Write test data to the session data file. This should fail validation.
- const sessionState = {
- profileSubsessionCounter: "not-a-number?",
- someOtherField: 12,
- };
- yield CommonUtils.writeJSON(sessionState, dataFilePath);
-
- // The session data file should not load. Only expect the current subsession.
- const expectedSubsessions = 1;
- const expectedSessionUUID = "ff602e52-47a1-b7e8-4c1a-ffffffffc87a";
- const expectedSubsessionUUID = "009fd1ad-b85e-4817-b3e5-000000003785";
- fakeGenerateUUID(() => expectedSessionUUID, () => expectedSubsessionUUID);
-
- // Start TelemetryController so that it loads the session data file.
- yield TelemetryController.testReset();
-
- let payload = TelemetrySession.getPayload();
- Assert.equal(payload.info.profileSubsessionCounter, expectedSubsessions);
- Assert.equal(0, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_LOAD").sum);
- Assert.equal(1, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_PARSE").sum);
- Assert.equal(1, getSnapshot("TELEMETRY_SESSIONDATA_FAILED_VALIDATION").sum);
-
- yield TelemetryController.testShutdown();
-
- // Restore the UUID generator so we don't mess with other tests.
- fakeGenerateUUID(generateUUID, generateUUID);
-
- // Load back the serialised session data.
- let data = yield CommonUtils.readJSON(dataFilePath);
- Assert.equal(data.profileSubsessionCounter, expectedSubsessions);
- Assert.equal(data.sessionId, expectedSessionUUID);
- Assert.equal(data.subsessionId, expectedSubsessionUUID);
-});
-
-add_task(function* test_abortedSession() {
- if (gIsAndroid || gIsGonk) {
- // We don't have the aborted session ping here.
- return;
- }
-
- const ABORTED_FILE = OS.Path.join(DATAREPORTING_PATH, ABORTED_PING_FILE_NAME);
-
- // Make sure the aborted sessions directory does not exist to test its creation.
- yield OS.File.removeDir(DATAREPORTING_PATH, { ignoreAbsent: true });
-
- let schedulerTickCallback = null;
- let now = new Date(2040, 1, 1, 0, 0, 0);
- fakeNow(now);
- // Fake scheduler functions to control aborted-session flow in tests.
- fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
- yield TelemetryController.testReset();
-
- Assert.ok((yield OS.File.exists(DATAREPORTING_PATH)),
- "Telemetry must create the aborted session directory when starting.");
-
- // Fake now again so that the scheduled aborted-session save takes place.
- now = futureDate(now, ABORTED_SESSION_UPDATE_INTERVAL_MS);
- fakeNow(now);
- // The first aborted session checkpoint must take place right after the initialisation.
- Assert.ok(!!schedulerTickCallback);
- // Execute one scheduler tick.
- yield schedulerTickCallback();
- // Check that the aborted session is due at the correct time.
- Assert.ok((yield OS.File.exists(ABORTED_FILE)),
- "There must be an aborted session ping.");
-
- // This ping is not yet in the pending pings folder, so we can't access it using
- // TelemetryStorage.popPendingPings().
- let pingContent = yield OS.File.read(ABORTED_FILE, { encoding: "utf-8" });
- let abortedSessionPing = JSON.parse(pingContent);
-
- // Validate the ping.
- checkPingFormat(abortedSessionPing, PING_TYPE_MAIN, true, true);
- Assert.equal(abortedSessionPing.payload.info.reason, REASON_ABORTED_SESSION);
-
- // Trigger a another aborted-session ping and check that it overwrites the previous one.
- now = futureDate(now, ABORTED_SESSION_UPDATE_INTERVAL_MS);
- fakeNow(now);
- yield schedulerTickCallback();
-
- pingContent = yield OS.File.read(ABORTED_FILE, { encoding: "utf-8" });
- let updatedAbortedSessionPing = JSON.parse(pingContent);
- checkPingFormat(updatedAbortedSessionPing, PING_TYPE_MAIN, true, true);
- Assert.equal(updatedAbortedSessionPing.payload.info.reason, REASON_ABORTED_SESSION);
- Assert.notEqual(abortedSessionPing.id, updatedAbortedSessionPing.id);
- Assert.notEqual(abortedSessionPing.creationDate, updatedAbortedSessionPing.creationDate);
-
- yield TelemetryController.testShutdown();
- Assert.ok(!(yield OS.File.exists(ABORTED_FILE)),
- "No aborted session ping must be available after a shutdown.");
-
- // Write the ping to the aborted-session file. TelemetrySession will add it to the
- // saved pings directory when it starts.
- yield TelemetryStorage.savePingToFile(abortedSessionPing, ABORTED_FILE, false);
- Assert.ok((yield OS.File.exists(ABORTED_FILE)),
- "The aborted session ping must exist in the aborted session ping directory.");
-
- yield TelemetryStorage.testClearPendingPings();
- PingServer.clearRequests();
- yield TelemetryController.testReset();
-
- Assert.ok(!(yield OS.File.exists(ABORTED_FILE)),
- "The aborted session ping must be removed from the aborted session ping directory.");
-
- // Restarting Telemetry again to trigger sending pings in TelemetrySend.
- yield TelemetryController.testReset();
-
- // We should have received an aborted-session ping.
- const receivedPing = yield PingServer.promiseNextPing();
- Assert.equal(receivedPing.type, PING_TYPE_MAIN, "Should have the correct type");
- Assert.equal(receivedPing.payload.info.reason, REASON_ABORTED_SESSION, "Ping should have the correct reason");
-
- yield TelemetryController.testShutdown();
-});
-
-add_task(function* test_abortedSession_Shutdown() {
- if (gIsAndroid || gIsGonk) {
- // We don't have the aborted session ping here.
- return;
- }
-
- const ABORTED_FILE = OS.Path.join(DATAREPORTING_PATH, ABORTED_PING_FILE_NAME);
-
- let schedulerTickCallback = null;
- let now = fakeNow(2040, 1, 1, 0, 0, 0);
- // Fake scheduler functions to control aborted-session flow in tests.
- fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
- yield TelemetryController.testReset();
-
- Assert.ok((yield OS.File.exists(DATAREPORTING_PATH)),
- "Telemetry must create the aborted session directory when starting.");
-
- // Fake now again so that the scheduled aborted-session save takes place.
- fakeNow(futureDate(now, ABORTED_SESSION_UPDATE_INTERVAL_MS));
- // The first aborted session checkpoint must take place right after the initialisation.
- Assert.ok(!!schedulerTickCallback);
- // Execute one scheduler tick.
- yield schedulerTickCallback();
- // Check that the aborted session is due at the correct time.
- Assert.ok((yield OS.File.exists(ABORTED_FILE)), "There must be an aborted session ping.");
-
- // Remove the aborted session file and then shut down to make sure exceptions (e.g file
- // not found) do not compromise the shutdown.
- yield OS.File.remove(ABORTED_FILE);
-
- yield TelemetryController.testShutdown();
-});
-
-add_task(function* test_abortedDailyCoalescing() {
- if (gIsAndroid || gIsGonk) {
- // We don't have the aborted session or the daily ping here.
- return;
- }
-
- const ABORTED_FILE = OS.Path.join(DATAREPORTING_PATH, ABORTED_PING_FILE_NAME);
-
- // Make sure the aborted sessions directory does not exist to test its creation.
- yield OS.File.removeDir(DATAREPORTING_PATH, { ignoreAbsent: true });
-
- let schedulerTickCallback = null;
- PingServer.clearRequests();
-
- let nowDate = new Date(2009, 10, 18, 0, 0, 0);
- fakeNow(nowDate);
-
- // Fake scheduler functions to control aborted-session flow in tests.
- fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
- yield TelemetryStorage.testClearPendingPings();
- PingServer.clearRequests();
- yield TelemetryController.testReset();
-
- Assert.ok((yield OS.File.exists(DATAREPORTING_PATH)),
- "Telemetry must create the aborted session directory when starting.");
-
- // Delay the callback around midnight so that the aborted-session ping gets merged with the
- // daily ping.
- let dailyDueDate = futureDate(nowDate, MS_IN_ONE_DAY);
- fakeNow(dailyDueDate);
- // Trigger both the daily ping and the saved-session.
- Assert.ok(!!schedulerTickCallback);
- // Execute one scheduler tick.
- yield schedulerTickCallback();
-
- // Wait for the daily ping.
- let dailyPing = yield PingServer.promiseNextPing();
- Assert.equal(dailyPing.payload.info.reason, REASON_DAILY);
-
- // Check that an aborted session ping was also written to disk.
- Assert.ok((yield OS.File.exists(ABORTED_FILE)),
- "There must be an aborted session ping.");
-
- // Read aborted session ping and check that the session/subsession ids equal the
- // ones in the daily ping.
- let pingContent = yield OS.File.read(ABORTED_FILE, { encoding: "utf-8" });
- let abortedSessionPing = JSON.parse(pingContent);
- Assert.equal(abortedSessionPing.payload.info.sessionId, dailyPing.payload.info.sessionId);
- Assert.equal(abortedSessionPing.payload.info.subsessionId, dailyPing.payload.info.subsessionId);
-
- yield TelemetryController.testShutdown();
-});
-
-add_task(function* test_schedulerComputerSleep() {
- if (gIsAndroid || gIsGonk) {
- // We don't have the aborted session or the daily ping here.
- return;
- }
-
- const ABORTED_FILE = OS.Path.join(DATAREPORTING_PATH, ABORTED_PING_FILE_NAME);
-
- yield TelemetryStorage.testClearPendingPings();
- yield TelemetryController.testReset();
- PingServer.clearRequests();
-
- // Remove any aborted-session ping from the previous tests.
- yield OS.File.removeDir(DATAREPORTING_PATH, { ignoreAbsent: true });
-
- // Set a fake current date and start Telemetry.
- let nowDate = fakeNow(2009, 10, 18, 0, 0, 0);
- let schedulerTickCallback = null;
- fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
- yield TelemetryController.testReset();
-
- // Set the current time 3 days in the future at midnight, before running the callback.
- nowDate = fakeNow(futureDate(nowDate, 3 * MS_IN_ONE_DAY));
- Assert.ok(!!schedulerTickCallback);
- // Execute one scheduler tick.
- yield schedulerTickCallback();
-
- let dailyPing = yield PingServer.promiseNextPing();
- Assert.equal(dailyPing.payload.info.reason, REASON_DAILY,
- "The wake notification should have triggered a daily ping.");
- Assert.equal(dailyPing.creationDate, nowDate.toISOString(),
- "The daily ping date should be correct.");
-
- Assert.ok((yield OS.File.exists(ABORTED_FILE)),
- "There must be an aborted session ping.");
-
- // Now also test if we are sending a daily ping if we wake up on the next
- // day even when the timer doesn't trigger.
- // This can happen due to timeouts not running out during sleep times,
- // see bug 1262386, bug 1204823 et al.
- // Note that we don't get wake notifications on Linux due to bug 758848.
- nowDate = fakeNow(futureDate(nowDate, 1 * MS_IN_ONE_DAY));
-
- // We emulate the mentioned timeout behavior by sending the wake notification
- // instead of triggering the timeout callback.
- // This should trigger a daily ping, because we passed midnight.
- Services.obs.notifyObservers(null, "wake_notification", null);
-
- dailyPing = yield PingServer.promiseNextPing();
- Assert.equal(dailyPing.payload.info.reason, REASON_DAILY,
- "The wake notification should have triggered a daily ping.");
- Assert.equal(dailyPing.creationDate, nowDate.toISOString(),
- "The daily ping date should be correct.");
-
- yield TelemetryController.testShutdown();
-});
-
-add_task(function* test_schedulerEnvironmentReschedules() {
- if (gIsAndroid || gIsGonk) {
- // We don't have the aborted session or the daily ping here.
- return;
- }
-
- // Reset the test preference.
- const PREF_TEST = "toolkit.telemetry.test.pref1";
- Preferences.reset(PREF_TEST);
- const PREFS_TO_WATCH = new Map([
- [PREF_TEST, {what: TelemetryEnvironment.RECORD_PREF_VALUE}],
- ]);
-
- yield TelemetryStorage.testClearPendingPings();
- PingServer.clearRequests();
- yield TelemetryController.testReset();
-
- // Set a fake current date and start Telemetry.
- let nowDate = fakeNow(2060, 10, 18, 0, 0, 0);
- gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 10 * MILLISECONDS_PER_MINUTE);
- let schedulerTickCallback = null;
- fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
- yield TelemetryController.testReset();
- TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH);
-
- // Set the current time at midnight.
- fakeNow(futureDate(nowDate, MS_IN_ONE_DAY));
- gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 10 * MILLISECONDS_PER_MINUTE);
-
- // Trigger the environment change.
- Preferences.set(PREF_TEST, 1);
-
- // Wait for the environment-changed ping.
- yield PingServer.promiseNextPing();
-
- // We don't expect to receive any daily ping in this test, so assert if we do.
- PingServer.registerPingHandler((req, res) => {
- Assert.ok(false, "No ping should be sent/received in this test.");
- });
-
- // Execute one scheduler tick. It should not trigger a daily ping.
- Assert.ok(!!schedulerTickCallback);
- yield schedulerTickCallback();
- yield TelemetryController.testShutdown();
-});
-
-add_task(function* test_schedulerNothingDue() {
- if (gIsAndroid || gIsGonk) {
- // We don't have the aborted session or the daily ping here.
- return;
- }
-
- const ABORTED_FILE = OS.Path.join(DATAREPORTING_PATH, ABORTED_PING_FILE_NAME);
-
- // Remove any aborted-session ping from the previous tests.
- yield OS.File.removeDir(DATAREPORTING_PATH, { ignoreAbsent: true });
- yield TelemetryStorage.testClearPendingPings();
- yield TelemetryController.testReset();
-
- // We don't expect to receive any ping in this test, so assert if we do.
- PingServer.registerPingHandler((req, res) => {
- Assert.ok(false, "No ping should be sent/received in this test.");
- });
-
- // Set a current date/time away from midnight, so that the daily ping doesn't get
- // sent.
- let nowDate = new Date(2009, 10, 18, 11, 0, 0);
- fakeNow(nowDate);
- let schedulerTickCallback = null;
- fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
- yield TelemetryController.testReset();
-
- // Delay the callback execution to a time when no ping should be due.
- let nothingDueDate = futureDate(nowDate, ABORTED_SESSION_UPDATE_INTERVAL_MS / 2);
- fakeNow(nothingDueDate);
- Assert.ok(!!schedulerTickCallback);
- // Execute one scheduler tick.
- yield schedulerTickCallback();
-
- // Check that no aborted session ping was written to disk.
- Assert.ok(!(yield OS.File.exists(ABORTED_FILE)));
-
- yield TelemetryController.testShutdown();
- PingServer.resetPingHandler();
-});
-
-add_task(function* test_pingExtendedStats() {
- const EXTENDED_PAYLOAD_FIELDS = [
- "chromeHangs", "threadHangStats", "log", "slowSQL", "fileIOReports", "lateWrites",
- "addonHistograms", "addonDetails", "UIMeasurements", "webrtc"
- ];
-
- // Reset telemetry and disable sending extended statistics.
- yield TelemetryStorage.testClearPendingPings();
- PingServer.clearRequests();
- yield TelemetryController.testReset();
- Telemetry.canRecordExtended = false;
-
- yield sendPing();
-
- let ping = yield PingServer.promiseNextPing();
- checkPingFormat(ping, PING_TYPE_MAIN, true, true);
-
- // Check that the payload does not contain extended statistics fields.
- for (let f in EXTENDED_PAYLOAD_FIELDS) {
- Assert.ok(!(EXTENDED_PAYLOAD_FIELDS[f] in ping.payload),
- EXTENDED_PAYLOAD_FIELDS[f] + " must not be in the payload if the extended set is off.");
- }
-
- // We check this one separately so that we can reuse EXTENDED_PAYLOAD_FIELDS below, since
- // slowSQLStartup might not be there.
- Assert.ok(!("slowSQLStartup" in ping.payload),
- "slowSQLStartup must not be sent if the extended set is off");
-
- Assert.ok(!("addonManager" in ping.payload.simpleMeasurements),
- "addonManager must not be sent if the extended set is off.");
- Assert.ok(!("UITelemetry" in ping.payload.simpleMeasurements),
- "UITelemetry must not be sent if the extended set is off.");
-
- // Restore the preference.
- Telemetry.canRecordExtended = true;
-
- // Send a new ping that should contain the extended data.
- yield sendPing();
- ping = yield PingServer.promiseNextPing();
- checkPingFormat(ping, PING_TYPE_MAIN, true, true);
-
- // Check that the payload now contains extended statistics fields.
- for (let f in EXTENDED_PAYLOAD_FIELDS) {
- Assert.ok(EXTENDED_PAYLOAD_FIELDS[f] in ping.payload,
- EXTENDED_PAYLOAD_FIELDS[f] + " must be in the payload if the extended set is on.");
- }
-
- Assert.ok("addonManager" in ping.payload.simpleMeasurements,
- "addonManager must be sent if the extended set is on.");
- Assert.ok("UITelemetry" in ping.payload.simpleMeasurements,
- "UITelemetry must be sent if the extended set is on.");
-});
-
-add_task(function* test_schedulerUserIdle() {
- if (gIsAndroid || gIsGonk) {
- // We don't have the aborted session or the daily ping here.
- return;
- }
-
- const SCHEDULER_TICK_INTERVAL_MS = 5 * 60 * 1000;
- const SCHEDULER_TICK_IDLE_INTERVAL_MS = 60 * 60 * 1000;
-
- let now = new Date(2010, 1, 1, 11, 0, 0);
- fakeNow(now);
-
- let schedulerTimeout = 0;
- fakeSchedulerTimer((callback, timeout) => {
- schedulerTimeout = timeout;
- }, () => {});
- yield TelemetryController.testReset();
- yield TelemetryStorage.testClearPendingPings();
- PingServer.clearRequests();
-
- // When not idle, the scheduler should have a 5 minutes tick interval.
- Assert.equal(schedulerTimeout, SCHEDULER_TICK_INTERVAL_MS);
-
- // Send an "idle" notification to the scheduler.
- fakeIdleNotification("idle");
-
- // When idle, the scheduler should have a 1hr tick interval.
- Assert.equal(schedulerTimeout, SCHEDULER_TICK_IDLE_INTERVAL_MS);
-
- // Send an "active" notification to the scheduler.
- fakeIdleNotification("active");
-
- // When user is back active, the scheduler tick should be 5 minutes again.
- Assert.equal(schedulerTimeout, SCHEDULER_TICK_INTERVAL_MS);
-
- // We should not miss midnight when going to idle.
- now.setHours(23);
- now.setMinutes(50);
- fakeNow(now);
- fakeIdleNotification("idle");
- Assert.equal(schedulerTimeout, 10 * 60 * 1000);
-
- yield TelemetryController.testShutdown();
-});
-
-add_task(function* test_DailyDueAndIdle() {
- if (gIsAndroid || gIsGonk) {
- // We don't have the aborted session or the daily ping here.
- return;
- }
-
- yield TelemetryStorage.testClearPendingPings();
- PingServer.clearRequests();
-
- let receivedPingRequest = null;
- // Register a ping handler that will assert when receiving multiple daily pings.
- PingServer.registerPingHandler(req => {
- Assert.ok(!receivedPingRequest, "Telemetry must only send one daily ping.");
- receivedPingRequest = req;
- });
-
- // Faking scheduler timer has to happen before resetting TelemetryController
- // to be effective.
- let schedulerTickCallback = null;
- let now = new Date(2030, 1, 1, 0, 0, 0);
- fakeNow(now);
- // Fake scheduler functions to control daily collection flow in tests.
- fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
- yield TelemetryController.testReset();
-
- // Trigger the daily ping.
- let firstDailyDue = new Date(2030, 1, 2, 0, 0, 0);
- fakeNow(firstDailyDue);
-
- // Run a scheduler tick: it should trigger the daily ping.
- Assert.ok(!!schedulerTickCallback);
- let tickPromise = schedulerTickCallback();
-
- // Send an idle and then an active user notification.
- fakeIdleNotification("idle");
- fakeIdleNotification("active");
-
- // Wait on the tick promise.
- yield tickPromise;
-
- yield TelemetrySend.testWaitOnOutgoingPings();
-
- // Decode the ping contained in the request and check that's a daily ping.
- Assert.ok(receivedPingRequest, "Telemetry must send one daily ping.");
- const receivedPing = decodeRequestPayload(receivedPingRequest);
- checkPingFormat(receivedPing, PING_TYPE_MAIN, true, true);
- Assert.equal(receivedPing.payload.info.reason, REASON_DAILY);
-
- yield TelemetryController.testShutdown();
-});
-
-add_task(function* test_userIdleAndSchedlerTick() {
- if (gIsAndroid || gIsGonk) {
- // We don't have the aborted session or the daily ping here.
- return;
- }
-
- let receivedPingRequest = null;
- // Register a ping handler that will assert when receiving multiple daily pings.
- PingServer.registerPingHandler(req => {
- Assert.ok(!receivedPingRequest, "Telemetry must only send one daily ping.");
- receivedPingRequest = req;
- });
-
- let schedulerTickCallback = null;
- let now = new Date(2030, 1, 1, 0, 0, 0);
- fakeNow(now);
- // Fake scheduler functions to control daily collection flow in tests.
- fakeSchedulerTimer(callback => schedulerTickCallback = callback, () => {});
- yield TelemetryStorage.testClearPendingPings();
- yield TelemetryController.testReset();
- PingServer.clearRequests();
-
- // Move the current date/time to midnight.
- let firstDailyDue = new Date(2030, 1, 2, 0, 0, 0);
- fakeNow(firstDailyDue);
-
- // The active notification should trigger a scheduler tick. The latter will send the
- // due daily ping.
- fakeIdleNotification("active");
-
- // Immediately running another tick should not send a daily ping again.
- Assert.ok(!!schedulerTickCallback);
- yield schedulerTickCallback();
-
- // A new "idle" notification should not send a new daily ping.
- fakeIdleNotification("idle");
-
- yield TelemetrySend.testWaitOnOutgoingPings();
-
- // Decode the ping contained in the request and check that's a daily ping.
- Assert.ok(receivedPingRequest, "Telemetry must send one daily ping.");
- const receivedPing = decodeRequestPayload(receivedPingRequest);
- checkPingFormat(receivedPing, PING_TYPE_MAIN, true, true);
- Assert.equal(receivedPing.payload.info.reason, REASON_DAILY);
-
- PingServer.resetPingHandler();
- yield TelemetryController.testShutdown();
-});
-
-add_task(function* test_changeThrottling() {
- if (gIsAndroid) {
- // We don't support subsessions yet on Android.
- return;
- }
-
- let getSubsessionCount = () => {
- return TelemetrySession.getPayload().info.subsessionCounter;
- };
-
- const PREF_TEST = "toolkit.telemetry.test.pref1";
- const PREFS_TO_WATCH = new Map([
- [PREF_TEST, {what: TelemetryEnvironment.RECORD_PREF_STATE}],
- ]);
- Preferences.reset(PREF_TEST);
-
- let now = fakeNow(2050, 1, 2, 0, 0, 0);
- gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 10 * MILLISECONDS_PER_MINUTE);
- yield TelemetryController.testReset();
- Assert.equal(getSubsessionCount(), 1);
-
- // Set the Environment preferences to watch.
- TelemetryEnvironment.testWatchPreferences(PREFS_TO_WATCH);
-
- // The first pref change should not trigger a notification.
- Preferences.set(PREF_TEST, 1);
- Assert.equal(getSubsessionCount(), 1);
-
- // We should get a change notification after the 5min throttling interval.
- fakeNow(futureDate(now, 5 * MILLISECONDS_PER_MINUTE + 1));
- gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 5 * MILLISECONDS_PER_MINUTE + 1);
- Preferences.set(PREF_TEST, 2);
- Assert.equal(getSubsessionCount(), 2);
-
- // After that, changes should be throttled again.
- now = fakeNow(futureDate(now, 1 * MILLISECONDS_PER_MINUTE));
- gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 1 * MILLISECONDS_PER_MINUTE);
- Preferences.set(PREF_TEST, 3);
- Assert.equal(getSubsessionCount(), 2);
-
- // ... for 5min.
- now = fakeNow(futureDate(now, 4 * MILLISECONDS_PER_MINUTE + 1));
- gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 4 * MILLISECONDS_PER_MINUTE + 1);
- Preferences.set(PREF_TEST, 4);
- Assert.equal(getSubsessionCount(), 3);
-
- // Unregister the listener.
- TelemetryEnvironment.unregisterChangeListener("testWatchPrefs_throttling");
-});
-
-add_task(function* stopServer() {
- yield PingServer.stop();
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetryTimestamps.js b/toolkit/components/telemetry/tests/unit/test_TelemetryTimestamps.js
deleted file mode 100644
index 75bf3157a..000000000
--- a/toolkit/components/telemetry/tests/unit/test_TelemetryTimestamps.js
+++ /dev/null
@@ -1,77 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var Cu = Components.utils;
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/TelemetryController.jsm", this);
-Cu.import("resource://gre/modules/TelemetrySession.jsm", this);
-Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-
-// The @mozilla/xre/app-info;1 XPCOM object provided by the xpcshell test harness doesn't
-// implement the nsIXULAppInfo interface, which is needed by Services.jsm and
-// TelemetrySession.jsm. updateAppInfo() creates and registers a minimal mock app-info.
-Cu.import("resource://testing-common/AppInfo.jsm");
-updateAppInfo();
-
-var gGlobalScope = this;
-
-function getSimpleMeasurementsFromTelemetryController() {
- return TelemetrySession.getPayload().simpleMeasurements;
-}
-
-add_task(function* test_setup() {
- // Telemetry needs the AddonManager.
- loadAddonManager();
- // Make profile available for |TelemetryController.testShutdown()|.
- do_get_profile();
-
- // Make sure we don't generate unexpected pings due to pref changes.
- yield setEmptyPrefWatchlist();
-
- yield new Promise(resolve =>
- Services.telemetry.asyncFetchTelemetryData(resolve));
-});
-
-add_task(function* actualTest() {
- yield TelemetryController.testSetup();
-
- // Test the module logic
- let tmp = {};
- Cu.import("resource://gre/modules/TelemetryTimestamps.jsm", tmp);
- let TelemetryTimestamps = tmp.TelemetryTimestamps;
- let now = Date.now();
- TelemetryTimestamps.add("foo");
- do_check_true(TelemetryTimestamps.get().foo != null); // foo was added
- do_check_true(TelemetryTimestamps.get().foo >= now); // foo has a reasonable value
-
- // Add timestamp with value
- // Use a value far in the future since TelemetryController substracts the time of
- // process initialization.
- const YEAR_4000_IN_MS = 64060588800000;
- TelemetryTimestamps.add("bar", YEAR_4000_IN_MS);
- do_check_eq(TelemetryTimestamps.get().bar, YEAR_4000_IN_MS); // bar has the right value
-
- // Can't add the same timestamp twice
- TelemetryTimestamps.add("bar", 2);
- do_check_eq(TelemetryTimestamps.get().bar, YEAR_4000_IN_MS); // bar wasn't overwritten
-
- let threw = false;
- try {
- TelemetryTimestamps.add("baz", "this isn't a number");
- } catch (ex) {
- threw = true;
- }
- do_check_true(threw); // adding non-number threw
- do_check_null(TelemetryTimestamps.get().baz); // no baz was added
-
- // Test that the data gets added to the telemetry ping properly
- let simpleMeasurements = getSimpleMeasurementsFromTelemetryController();
- do_check_true(simpleMeasurements != null); // got simple measurements from ping data
- do_check_true(simpleMeasurements.foo > 1); // foo was included
- do_check_true(simpleMeasurements.bar > 1); // bar was included
- do_check_eq(undefined, simpleMeasurements.baz); // baz wasn't included since it wasn't added
-
- yield TelemetryController.testShutdown();
-});
diff --git a/toolkit/components/telemetry/tests/unit/test_ThreadHangStats.js b/toolkit/components/telemetry/tests/unit/test_ThreadHangStats.js
deleted file mode 100644
index e8c9f868a..000000000
--- a/toolkit/components/telemetry/tests/unit/test_ThreadHangStats.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-function getMainThreadHangStats() {
- let threads = Services.telemetry.threadHangStats;
- return threads.find((thread) => (thread.name === "Gecko"));
-}
-
-function run_test() {
- let startHangs = getMainThreadHangStats();
-
- // We disable hang reporting in several situations (e.g. debug builds,
- // official releases). In those cases, we don't have hang stats available
- // and should exit the test early.
- if (!startHangs) {
- ok("Hang reporting not enabled.");
- return;
- }
-
- if (Services.appinfo.OS === 'Linux' || Services.appinfo.OS === 'Android') {
- // We use the rt_tgsigqueueinfo syscall on Linux which requires a
- // certain kernel version. It's not an error if the system running
- // the test is older than that.
- let kernel = Services.sysinfo.get('kernel_version') ||
- Services.sysinfo.get('version');
- if (Services.vc.compare(kernel, '2.6.31') < 0) {
- ok("Hang reporting not supported for old kernel.");
- return;
- }
- }
-
- // Run three events in the event loop:
- // the first event causes a transient hang;
- // the second event causes a permanent hang;
- // the third event checks results from previous events.
-
- do_execute_soon(() => {
- // Cause a hang lasting 1 second (transient hang).
- let startTime = Date.now();
- while ((Date.now() - startTime) < 1000);
- });
-
- do_execute_soon(() => {
- // Cause a hang lasting 10 seconds (permanent hang).
- let startTime = Date.now();
- while ((Date.now() - startTime) < 10000);
- });
-
- do_execute_soon(() => {
- do_test_pending();
-
- let check_results = () => {
- let endHangs = getMainThreadHangStats();
-
- // Because hangs are recorded asynchronously, if we don't see new hangs,
- // we should wait for pending hangs to be recorded. On the other hand,
- // if hang monitoring is broken, this test will time out.
- if (endHangs.hangs.length === startHangs.hangs.length) {
- do_timeout(100, check_results);
- return;
- }
-
- let check_histogram = (histogram) => {
- equal(typeof histogram, "object");
- equal(histogram.histogram_type, 0);
- equal(typeof histogram.min, "number");
- equal(typeof histogram.max, "number");
- equal(typeof histogram.sum, "number");
- ok(Array.isArray(histogram.ranges));
- ok(Array.isArray(histogram.counts));
- equal(histogram.counts.length, histogram.ranges.length);
- };
-
- // Make sure the hang stats structure is what we expect.
- equal(typeof endHangs, "object");
- check_histogram(endHangs.activity);
-
- ok(Array.isArray(endHangs.hangs));
- notEqual(endHangs.hangs.length, 0);
-
- ok(Array.isArray(endHangs.hangs[0].stack));
- notEqual(endHangs.hangs[0].stack.length, 0);
- equal(typeof endHangs.hangs[0].stack[0], "string");
-
- // Make sure one of the hangs is a permanent
- // hang containing a native stack.
- ok(endHangs.hangs.some((hang) => (
- Array.isArray(hang.nativeStack) &&
- hang.nativeStack.length !== 0 &&
- typeof hang.nativeStack[0] === "string"
- )));
-
- check_histogram(endHangs.hangs[0].histogram);
-
- do_test_finished();
- };
-
- check_results();
- });
-}
diff --git a/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js b/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js
deleted file mode 100644
index 8dc552604..000000000
--- a/toolkit/components/telemetry/tests/unit/test_nsITelemetry.js
+++ /dev/null
@@ -1,883 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-const INT_MAX = 0x7FFFFFFF;
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/TelemetryUtils.jsm", this);
-
-// Return an array of numbers from lower up to, excluding, upper
-function numberRange(lower, upper)
-{
- let a = [];
- for (let i=lower; i<upper; ++i) {
- a.push(i);
- }
- return a;
-}
-
-function expect_fail(f) {
- let failed = false;
- try {
- f();
- failed = false;
- } catch (e) {
- failed = true;
- }
- do_check_true(failed);
-}
-
-function expect_success(f) {
- let succeeded = false;
- try {
- f();
- succeeded = true;
- } catch (e) {
- succeeded = false;
- }
- do_check_true(succeeded);
-}
-
-function compareHistograms(h1, h2) {
- let s1 = h1.snapshot();
- let s2 = h2.snapshot();
-
- do_check_eq(s1.histogram_type, s2.histogram_type);
- do_check_eq(s1.min, s2.min);
- do_check_eq(s1.max, s2.max);
- do_check_eq(s1.sum, s2.sum);
-
- do_check_eq(s1.counts.length, s2.counts.length);
- for (let i = 0; i < s1.counts.length; i++)
- do_check_eq(s1.counts[i], s2.counts[i]);
-
- do_check_eq(s1.ranges.length, s2.ranges.length);
- for (let i = 0; i < s1.ranges.length; i++)
- do_check_eq(s1.ranges[i], s2.ranges[i]);
-}
-
-function check_histogram(histogram_type, name, min, max, bucket_count) {
- var h = Telemetry.getHistogramById(name);
- var r = h.snapshot().ranges;
- var sum = 0;
- for (let i=0;i<r.length;i++) {
- var v = r[i];
- sum += v;
- h.add(v);
- }
- var s = h.snapshot();
- // verify properties
- do_check_eq(sum, s.sum);
-
- // there should be exactly one element per bucket
- for (let i of s.counts) {
- do_check_eq(i, 1);
- }
- var hgrams = Telemetry.histogramSnapshots
- let gh = hgrams[name]
- do_check_eq(gh.histogram_type, histogram_type);
-
- do_check_eq(gh.min, min)
- do_check_eq(gh.max, max)
-
- // Check that booleans work with nonboolean histograms
- h.add(false);
- h.add(true);
- s = h.snapshot().counts;
- do_check_eq(s[0], 2)
- do_check_eq(s[1], 2)
-
- // Check that clearing works.
- h.clear();
- s = h.snapshot();
- for (var i of s.counts) {
- do_check_eq(i, 0);
- }
- do_check_eq(s.sum, 0);
-
- h.add(0);
- h.add(1);
- var c = h.snapshot().counts;
- do_check_eq(c[0], 1);
- do_check_eq(c[1], 1);
-}
-
-// This MUST be the very first test of this file.
-add_task({
- skip_if: () => gIsAndroid
-},
-function* test_instantiate() {
- const ID = "TELEMETRY_TEST_COUNT";
- let h = Telemetry.getHistogramById(ID);
-
- // Instantiate the subsession histogram through |add| and make sure they match.
- // This MUST be the first use of "TELEMETRY_TEST_COUNT" in this file, otherwise
- // |add| will not instantiate the histogram.
- h.add(1);
- let snapshot = h.snapshot();
- let subsession = Telemetry.snapshotSubsessionHistograms();
- Assert.equal(snapshot.sum, subsession[ID].sum,
- "Histogram and subsession histogram sum must match.");
- // Clear the histogram, so we don't void the assumptions from the other tests.
- h.clear();
-});
-
-add_task(function* test_parameterChecks() {
- let kinds = [Telemetry.HISTOGRAM_EXPONENTIAL, Telemetry.HISTOGRAM_LINEAR]
- let testNames = ["TELEMETRY_TEST_EXPONENTIAL", "TELEMETRY_TEST_LINEAR"]
- for (let i = 0; i < kinds.length; i++) {
- let histogram_type = kinds[i];
- let test_type = testNames[i];
- let [min, max, bucket_count] = [1, INT_MAX - 1, 10]
- check_histogram(histogram_type, test_type, min, max, bucket_count);
- }
-});
-
-add_task(function* test_noSerialization() {
- // Instantiate the storage for this histogram and make sure it doesn't
- // get reflected into JS, as it has no interesting data in it.
- Telemetry.getHistogramById("NEWTAB_PAGE_PINNED_SITES_COUNT");
- do_check_false("NEWTAB_PAGE_PINNED_SITES_COUNT" in Telemetry.histogramSnapshots);
-});
-
-add_task(function* test_boolean_histogram() {
- var h = Telemetry.getHistogramById("TELEMETRY_TEST_BOOLEAN");
- var r = h.snapshot().ranges;
- // boolean histograms ignore numeric parameters
- do_check_eq(uneval(r), uneval([0, 1, 2]))
- for (var i=0;i<r.length;i++) {
- var v = r[i];
- h.add(v);
- }
- h.add(true);
- h.add(false);
- var s = h.snapshot();
- do_check_eq(s.histogram_type, Telemetry.HISTOGRAM_BOOLEAN);
- // last bucket should always be 0 since .add parameters are normalized to either 0 or 1
- do_check_eq(s.counts[2], 0);
- do_check_eq(s.sum, 3);
- do_check_eq(s.counts[0], 2);
-});
-
-add_task(function* test_flag_histogram() {
- var h = Telemetry.getHistogramById("TELEMETRY_TEST_FLAG");
- var r = h.snapshot().ranges;
- // Flag histograms ignore numeric parameters.
- do_check_eq(uneval(r), uneval([0, 1, 2]));
- // Should already have a 0 counted.
- var c = h.snapshot().counts;
- var s = h.snapshot().sum;
- do_check_eq(uneval(c), uneval([1, 0, 0]));
- do_check_eq(s, 0);
- // Should switch counts.
- h.add(1);
- var c2 = h.snapshot().counts;
- var s2 = h.snapshot().sum;
- do_check_eq(uneval(c2), uneval([0, 1, 0]));
- do_check_eq(s2, 1);
- // Should only switch counts once.
- h.add(1);
- var c3 = h.snapshot().counts;
- var s3 = h.snapshot().sum;
- do_check_eq(uneval(c3), uneval([0, 1, 0]));
- do_check_eq(s3, 1);
- do_check_eq(h.snapshot().histogram_type, Telemetry.HISTOGRAM_FLAG);
-});
-
-add_task(function* test_count_histogram() {
- let h = Telemetry.getHistogramById("TELEMETRY_TEST_COUNT2");
- let s = h.snapshot();
- do_check_eq(uneval(s.ranges), uneval([0, 1, 2]));
- do_check_eq(uneval(s.counts), uneval([0, 0, 0]));
- do_check_eq(s.sum, 0);
- h.add();
- s = h.snapshot();
- do_check_eq(uneval(s.counts), uneval([1, 0, 0]));
- do_check_eq(s.sum, 1);
- h.add();
- s = h.snapshot();
- do_check_eq(uneval(s.counts), uneval([2, 0, 0]));
- do_check_eq(s.sum, 2);
-});
-
-add_task(function* test_categorical_histogram()
-{
- let h1 = Telemetry.getHistogramById("TELEMETRY_TEST_CATEGORICAL");
- for (let v of ["CommonLabel", "Label2", "Label3", "Label3", 0, 0, 1]) {
- h1.add(v);
- }
- for (let s of ["", "Label4", "1234"]) {
- Assert.throws(() => h1.add(s));
- }
-
- let snapshot = h1.snapshot();
- Assert.equal(snapshot.sum, 6);
- Assert.deepEqual(snapshot.ranges, [0, 1, 2, 3]);
- Assert.deepEqual(snapshot.counts, [3, 2, 2, 0]);
-
- let h2 = Telemetry.getHistogramById("TELEMETRY_TEST_CATEGORICAL_OPTOUT");
- for (let v of ["CommonLabel", "CommonLabel", "Label4", "Label5", "Label6", 0, 1]) {
- h2.add(v);
- }
- for (let s of ["", "Label3", "1234"]) {
- Assert.throws(() => h2.add(s));
- }
-
- snapshot = h2.snapshot();
- Assert.equal(snapshot.sum, 7);
- Assert.deepEqual(snapshot.ranges, [0, 1, 2, 3, 4]);
- Assert.deepEqual(snapshot.counts, [3, 2, 1, 1, 0]);
-});
-
-add_task(function* test_getHistogramById() {
- try {
- Telemetry.getHistogramById("nonexistent");
- do_throw("This can't happen");
- } catch (e) {
-
- }
- var h = Telemetry.getHistogramById("CYCLE_COLLECTOR");
- var s = h.snapshot();
- do_check_eq(s.histogram_type, Telemetry.HISTOGRAM_EXPONENTIAL);
- do_check_eq(s.min, 1);
- do_check_eq(s.max, 10000);
-});
-
-add_task(function* test_getSlowSQL() {
- var slow = Telemetry.slowSQL;
- do_check_true(("mainThread" in slow) && ("otherThreads" in slow));
-});
-
-add_task(function* test_getWebrtc() {
- var webrtc = Telemetry.webrtcStats;
- do_check_true("IceCandidatesStats" in webrtc);
- var icestats = webrtc.IceCandidatesStats;
- do_check_true("webrtc" in icestats);
-});
-
-// Check that telemetry doesn't record in private mode
-add_task(function* test_privateMode() {
- var h = Telemetry.getHistogramById("TELEMETRY_TEST_BOOLEAN");
- var orig = h.snapshot();
- Telemetry.canRecordExtended = false;
- h.add(1);
- do_check_eq(uneval(orig), uneval(h.snapshot()));
- Telemetry.canRecordExtended = true;
- h.add(1);
- do_check_neq(uneval(orig), uneval(h.snapshot()));
-});
-
-// Check that telemetry records only when it is suppose to.
-add_task(function* test_histogramRecording() {
- // Check that no histogram is recorded if both base and extended recording are off.
- Telemetry.canRecordBase = false;
- Telemetry.canRecordExtended = false;
-
- let h = Telemetry.getHistogramById("TELEMETRY_TEST_RELEASE_OPTOUT");
- h.clear();
- let orig = h.snapshot();
- h.add(1);
- Assert.equal(orig.sum, h.snapshot().sum);
-
- // Check that only base histograms are recorded.
- Telemetry.canRecordBase = true;
- h.add(1);
- Assert.equal(orig.sum + 1, h.snapshot().sum,
- "Histogram value should have incremented by 1 due to recording.");
-
- // Extended histograms should not be recorded.
- h = Telemetry.getHistogramById("TELEMETRY_TEST_RELEASE_OPTIN");
- orig = h.snapshot();
- h.add(1);
- Assert.equal(orig.sum, h.snapshot().sum,
- "Histograms should be equal after recording.");
-
- // Runtime created histograms should not be recorded.
- h = Telemetry.getHistogramById("TELEMETRY_TEST_BOOLEAN");
- orig = h.snapshot();
- h.add(1);
- Assert.equal(orig.sum, h.snapshot().sum,
- "Histograms should be equal after recording.");
-
- // Check that extended histograms are recorded when required.
- Telemetry.canRecordExtended = true;
-
- h.add(1);
- Assert.equal(orig.sum + 1, h.snapshot().sum,
- "Runtime histogram value should have incremented by 1 due to recording.");
-
- h = Telemetry.getHistogramById("TELEMETRY_TEST_RELEASE_OPTIN");
- orig = h.snapshot();
- h.add(1);
- Assert.equal(orig.sum + 1, h.snapshot().sum,
- "Histogram value should have incremented by 1 due to recording.");
-
- // Check that base histograms are still being recorded.
- h = Telemetry.getHistogramById("TELEMETRY_TEST_RELEASE_OPTOUT");
- h.clear();
- orig = h.snapshot();
- h.add(1);
- Assert.equal(orig.sum + 1, h.snapshot().sum,
- "Histogram value should have incremented by 1 due to recording.");
-});
-
-add_task(function* test_addons() {
- var addon_id = "testing-addon";
- var fake_addon_id = "fake-addon";
- var name1 = "testing-histogram1";
- var register = Telemetry.registerAddonHistogram;
- expect_success(() =>
- register(addon_id, name1, Telemetry.HISTOGRAM_LINEAR, 1, 5, 6));
- // Can't register the same histogram multiple times.
- expect_fail(() =>
- register(addon_id, name1, Telemetry.HISTOGRAM_LINEAR, 1, 5, 6));
- // Make sure we can't get at it with another name.
- expect_fail(() => Telemetry.getAddonHistogram(fake_addon_id, name1));
-
- // Check for reflection capabilities.
- var h1 = Telemetry.getAddonHistogram(addon_id, name1);
- // Verify that although we've created storage for it, we don't reflect it into JS.
- var snapshots = Telemetry.addonHistogramSnapshots;
- do_check_false(name1 in snapshots[addon_id]);
- h1.add(1);
- h1.add(3);
- var s1 = h1.snapshot();
- do_check_eq(s1.histogram_type, Telemetry.HISTOGRAM_LINEAR);
- do_check_eq(s1.min, 1);
- do_check_eq(s1.max, 5);
- do_check_eq(s1.counts[1], 1);
- do_check_eq(s1.counts[3], 1);
-
- var name2 = "testing-histogram2";
- expect_success(() =>
- register(addon_id, name2, Telemetry.HISTOGRAM_LINEAR, 2, 4, 4));
-
- var h2 = Telemetry.getAddonHistogram(addon_id, name2);
- h2.add(2);
- h2.add(3);
- var s2 = h2.snapshot();
- do_check_eq(s2.histogram_type, Telemetry.HISTOGRAM_LINEAR);
- do_check_eq(s2.min, 2);
- do_check_eq(s2.max, 4);
- do_check_eq(s2.counts[1], 1);
- do_check_eq(s2.counts[2], 1);
-
- // Check that we can register histograms for a different addon with
- // identical names.
- var extra_addon = "testing-extra-addon";
- expect_success(() =>
- register(extra_addon, name1, Telemetry.HISTOGRAM_BOOLEAN));
-
- // Check that we can register flag histograms.
- var flag_addon = "testing-flag-addon";
- var flag_histogram = "flag-histogram";
- expect_success(() =>
- register(flag_addon, flag_histogram, Telemetry.HISTOGRAM_FLAG));
- expect_success(() =>
- register(flag_addon, name2, Telemetry.HISTOGRAM_LINEAR, 2, 4, 4));
-
- // Check that we reflect registered addons and histograms.
- snapshots = Telemetry.addonHistogramSnapshots;
- do_check_true(addon_id in snapshots)
- do_check_true(extra_addon in snapshots);
- do_check_true(flag_addon in snapshots);
-
- // Check that we have data for our created histograms.
- do_check_true(name1 in snapshots[addon_id]);
- do_check_true(name2 in snapshots[addon_id]);
- var s1_alt = snapshots[addon_id][name1];
- var s2_alt = snapshots[addon_id][name2];
- do_check_eq(s1_alt.min, s1.min);
- do_check_eq(s1_alt.max, s1.max);
- do_check_eq(s1_alt.histogram_type, s1.histogram_type);
- do_check_eq(s2_alt.min, s2.min);
- do_check_eq(s2_alt.max, s2.max);
- do_check_eq(s2_alt.histogram_type, s2.histogram_type);
-
- // Even though we've registered it, it shouldn't show up until data is added to it.
- do_check_false(name1 in snapshots[extra_addon]);
-
- // Flag histograms should show up automagically.
- do_check_true(flag_histogram in snapshots[flag_addon]);
- do_check_false(name2 in snapshots[flag_addon]);
-
- // Check that we can remove addon histograms.
- Telemetry.unregisterAddonHistograms(addon_id);
- snapshots = Telemetry.addonHistogramSnapshots;
- do_check_false(addon_id in snapshots);
- // Make sure other addons are unaffected.
- do_check_true(extra_addon in snapshots);
-});
-
-add_task(function* test_expired_histogram() {
- var test_expired_id = "TELEMETRY_TEST_EXPIRED";
- var dummy = Telemetry.getHistogramById(test_expired_id);
- var rh = Telemetry.registeredHistograms(Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN, []);
- Assert.ok(!!rh);
-
- dummy.add(1);
-
- do_check_eq(Telemetry.histogramSnapshots["__expired__"], undefined);
- do_check_eq(Telemetry.histogramSnapshots[test_expired_id], undefined);
- do_check_eq(rh[test_expired_id], undefined);
-});
-
-add_task(function* test_keyed_histogram() {
- // Check that invalid names get rejected.
-
- let threw = false;
- try {
- Telemetry.getKeyedHistogramById("test::unknown histogram", "never", Telemetry.HISTOGRAM_BOOLEAN);
- } catch (e) {
- // This should throw as it is an unknown ID
- threw = true;
- }
- Assert.ok(threw, "getKeyedHistogramById should have thrown");
-});
-
-add_task(function* test_keyed_boolean_histogram() {
- const KEYED_ID = "TELEMETRY_TEST_KEYED_BOOLEAN";
- let KEYS = numberRange(0, 2).map(i => "key" + (i + 1));
- KEYS.push("漢語");
- let histogramBase = {
- "min": 1,
- "max": 2,
- "histogram_type": 2,
- "sum": 1,
- "ranges": [0, 1, 2],
- "counts": [0, 1, 0]
- };
- let testHistograms = numberRange(0, 3).map(i => JSON.parse(JSON.stringify(histogramBase)));
- let testKeys = [];
- let testSnapShot = {};
-
- let h = Telemetry.getKeyedHistogramById(KEYED_ID);
- for (let i=0; i<2; ++i) {
- let key = KEYS[i];
- h.add(key, true);
- testSnapShot[key] = testHistograms[i];
- testKeys.push(key);
-
- Assert.deepEqual(h.keys().sort(), testKeys);
- Assert.deepEqual(h.snapshot(), testSnapShot);
- }
-
- h = Telemetry.getKeyedHistogramById(KEYED_ID);
- Assert.deepEqual(h.keys().sort(), testKeys);
- Assert.deepEqual(h.snapshot(), testSnapShot);
-
- let key = KEYS[2];
- h.add(key, false);
- testKeys.push(key);
- testSnapShot[key] = testHistograms[2];
- testSnapShot[key].sum = 0;
- testSnapShot[key].counts = [1, 0, 0];
- Assert.deepEqual(h.keys().sort(), testKeys);
- Assert.deepEqual(h.snapshot(), testSnapShot);
-
- let allSnapshots = Telemetry.keyedHistogramSnapshots;
- Assert.deepEqual(allSnapshots[KEYED_ID], testSnapShot);
-
- h.clear();
- Assert.deepEqual(h.keys(), []);
- Assert.deepEqual(h.snapshot(), {});
-});
-
-add_task(function* test_keyed_count_histogram() {
- const KEYED_ID = "TELEMETRY_TEST_KEYED_COUNT";
- const KEYS = numberRange(0, 5).map(i => "key" + (i + 1));
- let histogramBase = {
- "min": 1,
- "max": 2,
- "histogram_type": 4,
- "sum": 0,
- "ranges": [0, 1, 2],
- "counts": [1, 0, 0]
- };
- let testHistograms = numberRange(0, 5).map(i => JSON.parse(JSON.stringify(histogramBase)));
- let testKeys = [];
- let testSnapShot = {};
-
- let h = Telemetry.getKeyedHistogramById(KEYED_ID);
- for (let i=0; i<4; ++i) {
- let key = KEYS[i];
- let value = i*2 + 1;
-
- for (let k=0; k<value; ++k) {
- h.add(key);
- }
- testHistograms[i].counts[0] = value;
- testHistograms[i].sum = value;
- testSnapShot[key] = testHistograms[i];
- testKeys.push(key);
-
- Assert.deepEqual(h.keys().sort(), testKeys);
- Assert.deepEqual(h.snapshot(key), testHistograms[i]);
- Assert.deepEqual(h.snapshot(), testSnapShot);
- }
-
- h = Telemetry.getKeyedHistogramById(KEYED_ID);
- Assert.deepEqual(h.keys().sort(), testKeys);
- Assert.deepEqual(h.snapshot(), testSnapShot);
-
- let key = KEYS[4];
- h.add(key);
- testKeys.push(key);
- testHistograms[4].counts[0] = 1;
- testHistograms[4].sum = 1;
- testSnapShot[key] = testHistograms[4];
-
- Assert.deepEqual(h.keys().sort(), testKeys);
- Assert.deepEqual(h.snapshot(), testSnapShot);
-
- let allSnapshots = Telemetry.keyedHistogramSnapshots;
- Assert.deepEqual(allSnapshots[KEYED_ID], testSnapShot);
-
- h.clear();
- Assert.deepEqual(h.keys(), []);
- Assert.deepEqual(h.snapshot(), {});
-});
-
-add_task(function* test_keyed_flag_histogram() {
- const KEYED_ID = "TELEMETRY_TEST_KEYED_FLAG";
- let h = Telemetry.getKeyedHistogramById(KEYED_ID);
-
- const KEY = "default";
- h.add(KEY, true);
-
- let testSnapshot = {};
- testSnapshot[KEY] = {
- "min": 1,
- "max": 2,
- "histogram_type": 3,
- "sum": 1,
- "ranges": [0, 1, 2],
- "counts": [0, 1, 0]
- };
-
- Assert.deepEqual(h.keys().sort(), [KEY]);
- Assert.deepEqual(h.snapshot(), testSnapshot);
-
- let allSnapshots = Telemetry.keyedHistogramSnapshots;
- Assert.deepEqual(allSnapshots[KEYED_ID], testSnapshot);
-
- h.clear();
- Assert.deepEqual(h.keys(), []);
- Assert.deepEqual(h.snapshot(), {});
-});
-
-add_task(function* test_keyed_histogram_recording() {
- // Check that no histogram is recorded if both base and extended recording are off.
- Telemetry.canRecordBase = false;
- Telemetry.canRecordExtended = false;
-
- const TEST_KEY = "record_foo";
- let h = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_RELEASE_OPTOUT");
- h.clear();
- h.add(TEST_KEY, 1);
- Assert.equal(h.snapshot(TEST_KEY).sum, 0);
-
- // Check that only base histograms are recorded.
- Telemetry.canRecordBase = true;
- h.add(TEST_KEY, 1);
- Assert.equal(h.snapshot(TEST_KEY).sum, 1,
- "The keyed histogram should record the correct value.");
-
- // Extended set keyed histograms should not be recorded.
- h = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_RELEASE_OPTIN");
- h.clear();
- h.add(TEST_KEY, 1);
- Assert.equal(h.snapshot(TEST_KEY).sum, 0,
- "The keyed histograms should not record any data.");
-
- // Check that extended histograms are recorded when required.
- Telemetry.canRecordExtended = true;
-
- h.add(TEST_KEY, 1);
- Assert.equal(h.snapshot(TEST_KEY).sum, 1,
- "The runtime keyed histogram should record the correct value.");
-
- h = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_RELEASE_OPTIN");
- h.clear();
- h.add(TEST_KEY, 1);
- Assert.equal(h.snapshot(TEST_KEY).sum, 1,
- "The keyed histogram should record the correct value.");
-
- // Check that base histograms are still being recorded.
- h = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_RELEASE_OPTOUT");
- h.clear();
- h.add(TEST_KEY, 1);
- Assert.equal(h.snapshot(TEST_KEY).sum, 1);
-});
-
-add_task(function* test_histogram_recording_enabled() {
- Telemetry.canRecordBase = true;
- Telemetry.canRecordExtended = true;
-
- // Check that a "normal" histogram respects recording-enabled on/off
- var h = Telemetry.getHistogramById("TELEMETRY_TEST_COUNT");
- var orig = h.snapshot();
-
- h.add(1);
- Assert.equal(orig.sum + 1, h.snapshot().sum,
- "add should record by default.");
-
- // Check that when recording is disabled - add is ignored
- Telemetry.setHistogramRecordingEnabled("TELEMETRY_TEST_COUNT", false);
- h.add(1);
- Assert.equal(orig.sum + 1, h.snapshot().sum,
- "When recording is disabled add should not record.");
-
- // Check that we're back to normal after recording is enabled
- Telemetry.setHistogramRecordingEnabled("TELEMETRY_TEST_COUNT", true);
- h.add(1);
- Assert.equal(orig.sum + 2, h.snapshot().sum,
- "When recording is re-enabled add should record.");
-
- // Check that we're correctly accumulating values other than 1.
- h.clear();
- h.add(3);
- Assert.equal(3, h.snapshot().sum, "Recording counts greater than 1 should work.");
-
- // Check that a histogram with recording disabled by default behaves correctly
- h = Telemetry.getHistogramById("TELEMETRY_TEST_COUNT_INIT_NO_RECORD");
- orig = h.snapshot();
-
- h.add(1);
- Assert.equal(orig.sum, h.snapshot().sum,
- "When recording is disabled by default, add should not record by default.");
-
- Telemetry.setHistogramRecordingEnabled("TELEMETRY_TEST_COUNT_INIT_NO_RECORD", true);
- h.add(1);
- Assert.equal(orig.sum + 1, h.snapshot().sum,
- "When recording is enabled add should record.");
-
- // Restore to disabled
- Telemetry.setHistogramRecordingEnabled("TELEMETRY_TEST_COUNT_INIT_NO_RECORD", false);
- h.add(1);
- Assert.equal(orig.sum + 1, h.snapshot().sum,
- "When recording is disabled add should not record.");
-});
-
-add_task(function* test_keyed_histogram_recording_enabled() {
- Telemetry.canRecordBase = true;
- Telemetry.canRecordExtended = true;
-
- // Check RecordingEnabled for keyed histograms which are recording by default
- const TEST_KEY = "record_foo";
- let h = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_RELEASE_OPTOUT");
-
- h.clear();
- h.add(TEST_KEY, 1);
- Assert.equal(h.snapshot(TEST_KEY).sum, 1,
- "Keyed histogram add should record by default");
-
- Telemetry.setHistogramRecordingEnabled("TELEMETRY_TEST_KEYED_RELEASE_OPTOUT", false);
- h.add(TEST_KEY, 1);
- Assert.equal(h.snapshot(TEST_KEY).sum, 1,
- "Keyed histogram add should not record when recording is disabled");
-
- Telemetry.setHistogramRecordingEnabled("TELEMETRY_TEST_KEYED_RELEASE_OPTOUT", true);
- h.clear();
- h.add(TEST_KEY, 1);
- Assert.equal(h.snapshot(TEST_KEY).sum, 1,
- "Keyed histogram add should record when recording is re-enabled");
-
- // Check that a histogram with recording disabled by default behaves correctly
- h = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_COUNT_INIT_NO_RECORD");
- h.clear();
-
- h.add(TEST_KEY, 1);
- Assert.equal(h.snapshot(TEST_KEY).sum, 0,
- "Keyed histogram add should not record by default for histograms which don't record by default");
-
- Telemetry.setHistogramRecordingEnabled("TELEMETRY_TEST_KEYED_COUNT_INIT_NO_RECORD", true);
- h.add(TEST_KEY, 1);
- Assert.equal(h.snapshot(TEST_KEY).sum, 1,
- "Keyed histogram add should record when recording is enabled");
-
- // Restore to disabled
- Telemetry.setHistogramRecordingEnabled("TELEMETRY_TEST_KEYED_COUNT_INIT_NO_RECORD", false);
- h.add(TEST_KEY, 1);
- Assert.equal(h.snapshot(TEST_KEY).sum, 1,
- "Keyed histogram add should not record when recording is disabled");
-});
-
-add_task(function* test_datasets() {
- // Check that datasets work as expected.
-
- const RELEASE_CHANNEL_OPTOUT = Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTOUT;
- const RELEASE_CHANNEL_OPTIN = Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN;
-
- // Histograms should default to the extended dataset
- let h = Telemetry.getHistogramById("TELEMETRY_TEST_FLAG");
- Assert.equal(h.dataset(), RELEASE_CHANNEL_OPTIN);
- h = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_FLAG");
- Assert.equal(h.dataset(), RELEASE_CHANNEL_OPTIN);
-
- // Check test histograms with explicit dataset definitions
- h = Telemetry.getHistogramById("TELEMETRY_TEST_RELEASE_OPTIN");
- Assert.equal(h.dataset(), RELEASE_CHANNEL_OPTIN);
- h = Telemetry.getHistogramById("TELEMETRY_TEST_RELEASE_OPTOUT");
- Assert.equal(h.dataset(), RELEASE_CHANNEL_OPTOUT);
- h = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_RELEASE_OPTIN");
- Assert.equal(h.dataset(), RELEASE_CHANNEL_OPTIN);
- h = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_RELEASE_OPTOUT");
- Assert.equal(h.dataset(), RELEASE_CHANNEL_OPTOUT);
-
- // Check that registeredHistogram works properly
- let registered = Telemetry.registeredHistograms(RELEASE_CHANNEL_OPTIN, []);
- registered = new Set(registered);
- Assert.ok(registered.has("TELEMETRY_TEST_FLAG"));
- Assert.ok(registered.has("TELEMETRY_TEST_RELEASE_OPTIN"));
- Assert.ok(registered.has("TELEMETRY_TEST_RELEASE_OPTOUT"));
- registered = Telemetry.registeredHistograms(RELEASE_CHANNEL_OPTOUT, []);
- registered = new Set(registered);
- Assert.ok(!registered.has("TELEMETRY_TEST_FLAG"));
- Assert.ok(!registered.has("TELEMETRY_TEST_RELEASE_OPTIN"));
- Assert.ok(registered.has("TELEMETRY_TEST_RELEASE_OPTOUT"));
-
- // Check that registeredKeyedHistograms works properly
- registered = Telemetry.registeredKeyedHistograms(RELEASE_CHANNEL_OPTIN, []);
- registered = new Set(registered);
- Assert.ok(registered.has("TELEMETRY_TEST_KEYED_FLAG"));
- Assert.ok(registered.has("TELEMETRY_TEST_KEYED_RELEASE_OPTOUT"));
- registered = Telemetry.registeredKeyedHistograms(RELEASE_CHANNEL_OPTOUT, []);
- registered = new Set(registered);
- Assert.ok(!registered.has("TELEMETRY_TEST_KEYED_FLAG"));
- Assert.ok(registered.has("TELEMETRY_TEST_KEYED_RELEASE_OPTOUT"));
-});
-
-add_task({
- skip_if: () => gIsAndroid
-},
-function* test_subsession() {
- const ID = "TELEMETRY_TEST_COUNT";
- const FLAG = "TELEMETRY_TEST_FLAG";
- let h = Telemetry.getHistogramById(ID);
- let flag = Telemetry.getHistogramById(FLAG);
-
- // Both original and duplicate should start out the same.
- h.clear();
- let snapshot = Telemetry.histogramSnapshots;
- let subsession = Telemetry.snapshotSubsessionHistograms();
- Assert.ok(!(ID in snapshot));
- Assert.ok(!(ID in subsession));
-
- // They should instantiate and pick-up the count.
- h.add(1);
- snapshot = Telemetry.histogramSnapshots;
- subsession = Telemetry.snapshotSubsessionHistograms();
- Assert.ok(ID in snapshot);
- Assert.ok(ID in subsession);
- Assert.equal(snapshot[ID].sum, 1);
- Assert.equal(subsession[ID].sum, 1);
-
- // They should still reset properly.
- h.clear();
- snapshot = Telemetry.histogramSnapshots;
- subsession = Telemetry.snapshotSubsessionHistograms();
- Assert.ok(!(ID in snapshot));
- Assert.ok(!(ID in subsession));
-
- // Both should instantiate and pick-up the count.
- h.add(1);
- snapshot = Telemetry.histogramSnapshots;
- subsession = Telemetry.snapshotSubsessionHistograms();
- Assert.equal(snapshot[ID].sum, 1);
- Assert.equal(subsession[ID].sum, 1);
-
- // Check that we are able to only reset the duplicate histogram.
- h.clear(true);
- snapshot = Telemetry.histogramSnapshots;
- subsession = Telemetry.snapshotSubsessionHistograms();
- Assert.ok(ID in snapshot);
- Assert.ok(ID in subsession);
- Assert.equal(snapshot[ID].sum, 1);
- Assert.equal(subsession[ID].sum, 0);
-
- // Both should register the next count.
- h.add(1);
- snapshot = Telemetry.histogramSnapshots;
- subsession = Telemetry.snapshotSubsessionHistograms();
- Assert.equal(snapshot[ID].sum, 2);
- Assert.equal(subsession[ID].sum, 1);
-
- // Retrieve a subsession snapshot and pass the flag to
- // clear subsession histograms too.
- h.clear();
- flag.clear();
- h.add(1);
- flag.add(1);
- snapshot = Telemetry.histogramSnapshots;
- subsession = Telemetry.snapshotSubsessionHistograms(true);
- Assert.ok(ID in snapshot);
- Assert.ok(ID in subsession);
- Assert.ok(FLAG in snapshot);
- Assert.ok(FLAG in subsession);
- Assert.equal(snapshot[ID].sum, 1);
- Assert.equal(subsession[ID].sum, 1);
- Assert.equal(snapshot[FLAG].sum, 1);
- Assert.equal(subsession[FLAG].sum, 1);
-
- // The next subsesssion snapshot should show the histograms
- // got reset.
- snapshot = Telemetry.histogramSnapshots;
- subsession = Telemetry.snapshotSubsessionHistograms();
- Assert.ok(ID in snapshot);
- Assert.ok(ID in subsession);
- Assert.ok(FLAG in snapshot);
- Assert.ok(FLAG in subsession);
- Assert.equal(snapshot[ID].sum, 1);
- Assert.equal(subsession[ID].sum, 0);
- Assert.equal(snapshot[FLAG].sum, 1);
- Assert.equal(subsession[FLAG].sum, 0);
-});
-
-add_task({
- skip_if: () => gIsAndroid
-},
-function* test_keyed_subsession() {
- let h = Telemetry.getKeyedHistogramById("TELEMETRY_TEST_KEYED_FLAG");
- const KEY = "foo";
-
- // Both original and subsession should start out the same.
- h.clear();
- Assert.ok(!(KEY in h.snapshot()));
- Assert.ok(!(KEY in h.subsessionSnapshot()));
- Assert.equal(h.snapshot(KEY).sum, 0);
- Assert.equal(h.subsessionSnapshot(KEY).sum, 0);
-
- // Both should register the flag.
- h.add(KEY, 1);
- Assert.ok(KEY in h.snapshot());
- Assert.ok(KEY in h.subsessionSnapshot());
- Assert.equal(h.snapshot(KEY).sum, 1);
- Assert.equal(h.subsessionSnapshot(KEY).sum, 1);
-
- // Check that we are able to only reset the subsession histogram.
- h.clear(true);
- Assert.ok(KEY in h.snapshot());
- Assert.ok(!(KEY in h.subsessionSnapshot()));
- Assert.equal(h.snapshot(KEY).sum, 1);
- Assert.equal(h.subsessionSnapshot(KEY).sum, 0);
-
- // Setting the flag again should make both match again.
- h.add(KEY, 1);
- Assert.ok(KEY in h.snapshot());
- Assert.ok(KEY in h.subsessionSnapshot());
- Assert.equal(h.snapshot(KEY).sum, 1);
- Assert.equal(h.subsessionSnapshot(KEY).sum, 1);
-
- // Check that "snapshot and clear" works properly.
- let snapshot = h.snapshot();
- let subsession = h.snapshotSubsessionAndClear();
- Assert.ok(KEY in snapshot);
- Assert.ok(KEY in subsession);
- Assert.equal(snapshot[KEY].sum, 1);
- Assert.equal(subsession[KEY].sum, 1);
-
- subsession = h.subsessionSnapshot();
- Assert.ok(!(KEY in subsession));
- Assert.equal(h.subsessionSnapshot(KEY).sum, 0);
-});
diff --git a/toolkit/components/telemetry/tests/unit/xpcshell.ini b/toolkit/components/telemetry/tests/unit/xpcshell.ini
deleted file mode 100644
index 224516f57..000000000
--- a/toolkit/components/telemetry/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,61 +0,0 @@
-[DEFAULT]
-head = head.js
-tail =
-firefox-appdir = browser
-# The *.xpi files are only needed for test_TelemetryEnvironment.js, but
-# xpcshell fails to install tests if we move them under the test entry.
-support-files =
- ../search/chrome.manifest
- ../search/searchTest.jar
- dictionary.xpi
- experiment.xpi
- extension.xpi
- extension-2.xpi
- engine.xml
- system.xpi
- restartless.xpi
- theme.xpi
-generated-files =
- dictionary.xpi
- experiment.xpi
- extension.xpi
- extension-2.xpi
- system.xpi
- restartless.xpi
- theme.xpi
-
-[test_nsITelemetry.js]
-[test_SubsessionChaining.js]
-tags = addons
-[test_TelemetryEnvironment.js]
-skip-if = os == "android"
-tags = addons
-[test_PingAPI.js]
-skip-if = os == "android"
-[test_TelemetryFlagClear.js]
-[test_TelemetryLateWrites.js]
-[test_TelemetryLockCount.js]
-[test_TelemetryLog.js]
-[test_TelemetryController.js]
-tags = addons
-[test_TelemetryController_idle.js]
-[test_TelemetryControllerShutdown.js]
-tags = addons
-[test_TelemetryControllerBuildID.js]
-[test_TelemetrySendOldPings.js]
-skip-if = os == "android" # Disabled due to intermittent orange on Android
-tags = addons
-[test_TelemetrySession.js]
-tags = addons
-[test_ThreadHangStats.js]
-run-sequentially = Bug 1046307, test can fail intermittently when CPU load is high
-[test_TelemetrySend.js]
-[test_ChildHistograms.js]
-skip-if = os == "android"
-tags = addons
-[test_TelemetryReportingPolicy.js]
-tags = addons
-[test_TelemetryScalars.js]
-[test_TelemetryTimestamps.js]
-skip-if = toolkit == 'android'
-[test_TelemetryEvents.js]
diff --git a/toolkit/components/terminator/moz.build b/toolkit/components/terminator/moz.build
index 7e230ed4d..c0b2aa1c8 100644
--- a/toolkit/components/terminator/moz.build
+++ b/toolkit/components/terminator/moz.build
@@ -4,15 +4,9 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
+EXPORTS += ['nsTerminator.h']
-SOURCES += [
- 'nsTerminator.cpp',
-]
-
-EXPORTS += [
- 'nsTerminator.h',
-]
+SOURCES += ['nsTerminator.cpp']
EXTRA_COMPONENTS += [
'nsTerminatorTelemetry.js',
diff --git a/toolkit/components/terminator/tests/xpcshell/.eslintrc.js b/toolkit/components/terminator/tests/xpcshell/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/terminator/tests/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/terminator/tests/xpcshell/test_terminator_record.js b/toolkit/components/terminator/tests/xpcshell/test_terminator_record.js
deleted file mode 100644
index 248ead9ce..000000000
--- a/toolkit/components/terminator/tests/xpcshell/test_terminator_record.js
+++ /dev/null
@@ -1,108 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-
-// Test that the Shutdown Terminator records durations correctly
-
-var Cu = Components.utils;
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/osfile.jsm", this);
-Cu.import("resource://gre/modules/Timer.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm", this);
-
-var {Path, File, Constants} = OS;
-
-var PATH;
-var PATH_TMP;
-var terminator;
-
-add_task(function* init() {
- do_get_profile();
- PATH = Path.join(Constants.Path.localProfileDir, "ShutdownDuration.json");
- PATH_TMP = PATH + ".tmp";
-
- // Initialize the terminator
- // (normally, this is done through the manifest file, but xpcshell
- // doesn't take them into account).
- do_print("Initializing the Terminator");
- terminator = Cc["@mozilla.org/toolkit/shutdown-terminator;1"].
- createInstance(Ci.nsIObserver);
- terminator.observe(null, "profile-after-change", null);
-});
-
-var promiseShutdownDurationData = Task.async(function*() {
- // Wait until PATH exists.
- // Timeout if it is never created.
- do_print("Waiting for file creation: " + PATH);
- while (true) {
- if ((yield OS.File.exists(PATH))) {
- break;
- }
-
- do_print("The file does not exist yet. Waiting 1 second.");
- yield new Promise(resolve => setTimeout(resolve, 1000));
- }
-
- do_print("The file has been created");
- let raw = yield OS.File.read(PATH, { encoding: "utf-8"} );
- do_print(raw);
- return JSON.parse(raw);
-});
-
-add_task(function* test_record() {
- let PHASE0 = "profile-change-teardown";
- let PHASE1 = "profile-before-change";
- let PHASE2 = "xpcom-will-shutdown";
- let t0 = Date.now();
-
- do_print("Starting shutdown");
- terminator.observe(null, "profile-change-teardown", null);
-
- do_print("Moving to next phase");
- terminator.observe(null, PHASE1, null);
-
- let data = yield promiseShutdownDurationData();
-
- let t1 = Date.now();
-
- Assert.ok(PHASE0 in data, "The file contains the expected key");
- let duration = data[PHASE0];
- Assert.equal(typeof duration, "number");
- Assert.ok(duration >= 0, "Duration is a non-negative number");
- Assert.ok(duration <= Math.ceil((t1 - t0) / 1000) + 1,
- "Duration is reasonable");
-
- Assert.equal(Object.keys(data).length, 1, "Data does not contain other durations");
-
- do_print("Cleaning up and moving to next phase");
- yield File.remove(PATH);
- yield File.remove(PATH_TMP);
-
- do_print("Waiting at least one tick");
- let WAIT_MS = 2000;
- yield new Promise(resolve => setTimeout(resolve, WAIT_MS));
-
- terminator.observe(null, PHASE2, null);
- data = yield promiseShutdownDurationData();
-
- let t2 = Date.now();
-
- Assert.equal(Object.keys(data).sort().join(", "),
- [PHASE0, PHASE1].sort().join(", "),
- "The file contains the expected keys");
- Assert.equal(data[PHASE0], duration, "Duration of phase 0 hasn't changed");
- let duration2 = data[PHASE1];
- Assert.equal(typeof duration2, "number");
- Assert.ok(duration2 >= WAIT_MS / 2000, "We have waited at least " + (WAIT_MS / 2000) + " ticks");
- Assert.ok(duration2 <= Math.ceil((t2 - t1) / 1000) + 1,
- "Duration is reasonable");
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/terminator/tests/xpcshell/test_terminator_reload.js b/toolkit/components/terminator/tests/xpcshell/test_terminator_reload.js
deleted file mode 100644
index 1c16395b3..000000000
--- a/toolkit/components/terminator/tests/xpcshell/test_terminator_reload.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-
-// Test that the Shutdown Terminator reloads durations correctly
-
-var Cu = Components.utils;
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/osfile.jsm", this);
-Cu.import("resource://gre/modules/Timer.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm", this);
-
-var {Path, File, Constants} = OS;
-
-var PATH;
-
-var HISTOGRAMS = {
- "quit-application": "SHUTDOWN_PHASE_DURATION_TICKS_QUIT_APPLICATION",
- "profile-change-teardown": "SHUTDOWN_PHASE_DURATION_TICKS_PROFILE_CHANGE_TEARDOWN",
- "profile-before-change": "SHUTDOWN_PHASE_DURATION_TICKS_PROFILE_BEFORE_CHANGE",
- "xpcom-will-shutdown": "SHUTDOWN_PHASE_DURATION_TICKS_XPCOM_WILL_SHUTDOWN",
-};
-
-add_task(function* init() {
- do_get_profile();
- PATH = Path.join(Constants.Path.localProfileDir, "ShutdownDuration.json");
-});
-
-add_task(function* test_reload() {
- do_print("Forging data");
- let data = {};
- let telemetrySnapshots = Services.telemetry.histogramSnapshots;
- let i = 0;
- for (let k of Object.keys(HISTOGRAMS)) {
- let id = HISTOGRAMS[k];
- data[k] = i++;
- Assert.equal(telemetrySnapshots[id] || undefined, undefined, "Histogram " + id + " is empty");
- }
-
-
- yield OS.File.writeAtomic(PATH, JSON.stringify(data));
-
- const TOPIC = "shutdown-terminator-telemetry-updated";
-
- let wait = new Promise(resolve =>
- Services.obs.addObserver(
- function observer() {
- do_print("Telemetry has been updated");
- Services.obs.removeObserver(observer, TOPIC);
- resolve();
- },
- TOPIC,
- false));
-
- do_print("Starting nsTerminatorTelemetry");
- let tt = Cc["@mozilla.org/toolkit/shutdown-terminator-telemetry;1"].
- createInstance(Ci.nsIObserver);
- tt.observe(null, "profile-after-change", "");
-
- do_print("Waiting until telemetry is updated");
- // Now wait until Telemetry is updated
- yield wait;
-
- telemetrySnapshots = Services.telemetry.histogramSnapshots;
- for (let k of Object.keys(HISTOGRAMS)) {
- let id = HISTOGRAMS[k];
- do_print("Testing histogram " + id);
- let snapshot = telemetrySnapshots[id];
- let count = 0;
- for (let x of snapshot.counts) {
- count += x;
- }
- Assert.equal(count, 1, "We have added one item");
- }
-
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/components/terminator/tests/xpcshell/xpcshell.ini b/toolkit/components/terminator/tests/xpcshell/xpcshell.ini
deleted file mode 100644
index 7f77938aa..000000000
--- a/toolkit/components/terminator/tests/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-head=
-tail=
-
-[test_terminator_record.js]
-skip-if = debug # Disabled by bug 1242084, bug 1255484 will enable it again.
-[test_terminator_reload.js]
-skip-if = os == "android"
diff --git a/toolkit/components/thumbnails/PageThumbUtils.jsm b/toolkit/components/thumbnails/PageThumbUtils.jsm
index dda3a81b3..fb5d67ddb 100644
--- a/toolkit/components/thumbnails/PageThumbUtils.jsm
+++ b/toolkit/components/thumbnails/PageThumbUtils.jsm
@@ -14,7 +14,6 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Promise.jsm", this);
-Cu.import("resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
"resource://gre/modules/BrowserUtils.jsm");
@@ -72,15 +71,17 @@ this.PageThumbUtils = {
let windowScale = aWindow ? aWindow.devicePixelRatio : systemScale;
let scale = Math.max(systemScale, windowScale);
+#ifdef XP_MACOSX
/** *
* On retina displays, we can sometimes go down this path
* without a window object. In those cases, force 2x scaling
* as the system scale doesn't represent the 2x scaling
* on OS X.
*/
- if (AppConstants.platform == "macosx" && !aWindow) {
+ if (!aWindow) {
scale = 2;
}
+#endif
/** *
* THESE VALUES ARE DEFINED IN newtab.css and hard coded.
diff --git a/toolkit/components/thumbnails/moz.build b/toolkit/components/thumbnails/moz.build
index e4a178998..bd88532c0 100644
--- a/toolkit/components/thumbnails/moz.build
+++ b/toolkit/components/thumbnails/moz.build
@@ -4,9 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
-XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell.ini']
-
EXTRA_COMPONENTS += [
'BrowserPageThumbs.manifest',
'PageThumbsProtocol.js',
@@ -15,12 +12,11 @@ EXTRA_COMPONENTS += [
EXTRA_JS_MODULES += [
'PageThumbs.jsm',
'PageThumbsWorker.js',
- 'PageThumbUtils.jsm',
]
EXTRA_PP_JS_MODULES += [
'BackgroundPageThumbs.jsm',
+ 'PageThumbUtils.jsm',
]
-
JAR_MANIFESTS += ['jar.mn']
diff --git a/toolkit/components/thumbnails/test/.eslintrc.js b/toolkit/components/thumbnails/test/.eslintrc.js
deleted file mode 100644
index f6f8d62c2..000000000
--- a/toolkit/components/thumbnails/test/.eslintrc.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/browser.eslintrc.js",
- "../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/thumbnails/test/authenticate.sjs b/toolkit/components/thumbnails/test/authenticate.sjs
deleted file mode 100644
index 58da655cf..000000000
--- a/toolkit/components/thumbnails/test/authenticate.sjs
+++ /dev/null
@@ -1,220 +0,0 @@
-function handleRequest(request, response)
-{
- try {
- reallyHandleRequest(request, response);
- } catch (e) {
- response.setStatusLine("1.0", 200, "AlmostOK");
- response.write("Error handling request: " + e);
- }
-}
-
-
-function reallyHandleRequest(request, response) {
- var match;
- var requestAuth = true, requestProxyAuth = true;
-
- // Allow the caller to drive how authentication is processed via the query.
- // Eg, http://localhost:8888/authenticate.sjs?user=foo&realm=bar
- // The extra ? allows the user/pass/realm checks to succeed if the name is
- // at the beginning of the query string.
- var query = "?" + request.queryString;
-
- var expected_user = "", expected_pass = "", realm = "mochitest";
- var proxy_expected_user = "", proxy_expected_pass = "", proxy_realm = "mochi-proxy";
- var huge = false, plugin = false, anonymous = false;
- var authHeaderCount = 1;
- // user=xxx
- match = /[^_]user=([^&]*)/.exec(query);
- if (match)
- expected_user = match[1];
-
- // pass=xxx
- match = /[^_]pass=([^&]*)/.exec(query);
- if (match)
- expected_pass = match[1];
-
- // realm=xxx
- match = /[^_]realm=([^&]*)/.exec(query);
- if (match)
- realm = match[1];
-
- // proxy_user=xxx
- match = /proxy_user=([^&]*)/.exec(query);
- if (match)
- proxy_expected_user = match[1];
-
- // proxy_pass=xxx
- match = /proxy_pass=([^&]*)/.exec(query);
- if (match)
- proxy_expected_pass = match[1];
-
- // proxy_realm=xxx
- match = /proxy_realm=([^&]*)/.exec(query);
- if (match)
- proxy_realm = match[1];
-
- // huge=1
- match = /huge=1/.exec(query);
- if (match)
- huge = true;
-
- // plugin=1
- match = /plugin=1/.exec(query);
- if (match)
- plugin = true;
-
- // multiple=1
- match = /multiple=([^&]*)/.exec(query);
- if (match)
- authHeaderCount = match[1]+0;
-
- // anonymous=1
- match = /anonymous=1/.exec(query);
- if (match)
- anonymous = true;
-
- // Look for an authentication header, if any, in the request.
- //
- // EG: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
- //
- // This test only supports Basic auth. The value sent by the client is
- // "username:password", obscured with base64 encoding.
-
- var actual_user = "", actual_pass = "", authHeader, authPresent = false;
- if (request.hasHeader("Authorization")) {
- authPresent = true;
- authHeader = request.getHeader("Authorization");
- match = /Basic (.+)/.exec(authHeader);
- if (match.length != 2)
- throw "Couldn't parse auth header: " + authHeader;
-
- var userpass = base64ToString(match[1]); // no atob() :-(
- match = /(.*):(.*)/.exec(userpass);
- if (match.length != 3)
- throw "Couldn't decode auth header: " + userpass;
- actual_user = match[1];
- actual_pass = match[2];
- }
-
- var proxy_actual_user = "", proxy_actual_pass = "";
- if (request.hasHeader("Proxy-Authorization")) {
- authHeader = request.getHeader("Proxy-Authorization");
- match = /Basic (.+)/.exec(authHeader);
- if (match.length != 2)
- throw "Couldn't parse auth header: " + authHeader;
-
- var userpass = base64ToString(match[1]); // no atob() :-(
- match = /(.*):(.*)/.exec(userpass);
- if (match.length != 3)
- throw "Couldn't decode auth header: " + userpass;
- proxy_actual_user = match[1];
- proxy_actual_pass = match[2];
- }
-
- // Don't request authentication if the credentials we got were what we
- // expected.
- if (expected_user == actual_user &&
- expected_pass == actual_pass) {
- requestAuth = false;
- }
- if (proxy_expected_user == proxy_actual_user &&
- proxy_expected_pass == proxy_actual_pass) {
- requestProxyAuth = false;
- }
-
- if (anonymous) {
- if (authPresent) {
- response.setStatusLine("1.0", 400, "Unexpected authorization header found");
- } else {
- response.setStatusLine("1.0", 200, "Authorization header not found");
- }
- } else {
- if (requestProxyAuth) {
- response.setStatusLine("1.0", 407, "Proxy authentication required");
- for (i = 0; i < authHeaderCount; ++i)
- response.setHeader("Proxy-Authenticate", "basic realm=\"" + proxy_realm + "\"", true);
- } else if (requestAuth) {
- response.setStatusLine("1.0", 401, "Authentication required");
- for (i = 0; i < authHeaderCount; ++i)
- response.setHeader("WWW-Authenticate", "basic realm=\"" + realm + "\"", true);
- } else {
- response.setStatusLine("1.0", 200, "OK");
- }
- }
-
- response.setHeader("Content-Type", "application/xhtml+xml", false);
- response.write("<html xmlns='http://www.w3.org/1999/xhtml'>");
- response.write("<p>Login: <span id='ok'>" + (requestAuth ? "FAIL" : "PASS") + "</span></p>\n");
- response.write("<p>Proxy: <span id='proxy'>" + (requestProxyAuth ? "FAIL" : "PASS") + "</span></p>\n");
- response.write("<p>Auth: <span id='auth'>" + authHeader + "</span></p>\n");
- response.write("<p>User: <span id='user'>" + actual_user + "</span></p>\n");
- response.write("<p>Pass: <span id='pass'>" + actual_pass + "</span></p>\n");
-
- if (huge) {
- response.write("<div style='display: none'>");
- for (i = 0; i < 100000; i++) {
- response.write("123456789\n");
- }
- response.write("</div>");
- response.write("<span id='footnote'>This is a footnote after the huge content fill</span>");
- }
-
- if (plugin) {
- response.write("<embed id='embedtest' style='width: 400px; height: 100px;' " +
- "type='application/x-test'></embed>\n");
- }
-
- response.write("</html>");
-}
-
-
-// base64 decoder
-//
-// Yoinked from extensions/xml-rpc/src/nsXmlRpcClient.js because btoa()
-// doesn't seem to exist. :-(
-/* Convert Base64 data to a string */
-const toBinaryTable = [
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
- 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
- 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
- -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
- 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
-];
-const base64Pad = '=';
-
-function base64ToString(data) {
-
- var result = '';
- var leftbits = 0; // number of bits decoded, but yet to be appended
- var leftdata = 0; // bits decoded, but yet to be appended
-
- // Convert one by one.
- for (var i = 0; i < data.length; i++) {
- var c = toBinaryTable[data.charCodeAt(i) & 0x7f];
- var padding = (data[i] == base64Pad);
- // Skip illegal characters and whitespace
- if (c == -1) continue;
-
- // Collect data into leftdata, update bitcount
- leftdata = (leftdata << 6) | c;
- leftbits += 6;
-
- // If we have 8 or more bits, append 8 bits to the result
- if (leftbits >= 8) {
- leftbits -= 8;
- // Append if not padding.
- if (!padding)
- result += String.fromCharCode((leftdata >> leftbits) & 0xff);
- leftdata &= (1 << leftbits) - 1;
- }
- }
-
- // If there are any bits left, the base64 string was corrupted
- if (leftbits)
- throw Components.Exception('Corrupted base64 string');
-
- return result;
-}
diff --git a/toolkit/components/thumbnails/test/background_red.html b/toolkit/components/thumbnails/test/background_red.html
deleted file mode 100644
index 95159dd29..000000000
--- a/toolkit/components/thumbnails/test/background_red.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<html>
- <body bgcolor=ff0000></body>
-</html>
diff --git a/toolkit/components/thumbnails/test/background_red_redirect.sjs b/toolkit/components/thumbnails/test/background_red_redirect.sjs
deleted file mode 100644
index 5f0852e19..000000000
--- a/toolkit/components/thumbnails/test/background_red_redirect.sjs
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function handleRequest(aRequest, aResponse) {
- // Set HTTP Status.
- aResponse.setStatusLine(aRequest.httpVersion, 301, "Moved Permanently");
-
- // Set redirect URI.
- aResponse.setHeader("Location", "http://mochi.test:8888/browser/toolkit/components/thumbnails/test/background_red.html");
-}
diff --git a/toolkit/components/thumbnails/test/background_red_scroll.html b/toolkit/components/thumbnails/test/background_red_scroll.html
deleted file mode 100644
index 1e30bd3c6..000000000
--- a/toolkit/components/thumbnails/test/background_red_scroll.html
+++ /dev/null
@@ -1,3 +0,0 @@
-<html>
- <body bgcolor=ff0000 style="overflow: scroll;"></body>
-</html>
diff --git a/toolkit/components/thumbnails/test/browser.ini b/toolkit/components/thumbnails/test/browser.ini
deleted file mode 100644
index 3b87815ff..000000000
--- a/toolkit/components/thumbnails/test/browser.ini
+++ /dev/null
@@ -1,38 +0,0 @@
-[DEFAULT]
-support-files =
- authenticate.sjs
- background_red.html
- background_red_redirect.sjs
- background_red_scroll.html
- head.js
- privacy_cache_control.sjs
- thumbnails_background.sjs
- thumbnails_crash_content_helper.js
- thumbnails_update.sjs
-
-[browser_thumbnails_bg_bad_url.js]
-[browser_thumbnails_bg_crash_during_capture.js]
-skip-if = !crashreporter
-[browser_thumbnails_bg_crash_while_idle.js]
-skip-if = !crashreporter
-[browser_thumbnails_bg_basic.js]
-[browser_thumbnails_bg_queueing.js]
-[browser_thumbnails_bg_timeout.js]
-[browser_thumbnails_bg_redirect.js]
-[browser_thumbnails_bg_destroy_browser.js]
-[browser_thumbnails_bg_no_cookies_sent.js]
-[browser_thumbnails_bg_no_cookies_stored.js]
-[browser_thumbnails_bg_no_auth_prompt.js]
-[browser_thumbnails_bg_no_alert.js]
-[browser_thumbnails_bg_no_duplicates.js]
-[browser_thumbnails_bg_captureIfMissing.js]
-[browser_thumbnails_bug726727.js]
-[browser_thumbnails_bug727765.js]
-[browser_thumbnails_bug818225.js]
-[browser_thumbnails_capture.js]
-[browser_thumbnails_expiration.js]
-[browser_thumbnails_privacy.js]
-[browser_thumbnails_redirect.js]
-[browser_thumbnails_storage.js]
-[browser_thumbnails_storage_migrate3.js]
-[browser_thumbnails_update.js]
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_bad_url.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_bad_url.js
deleted file mode 100644
index df8ef8d96..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_bad_url.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function* runTests() {
- let url = "invalid-protocol://ffggfsdfsdf/";
- ok(!thumbnailExists(url), "Thumbnail should not be cached already.");
- let numCalls = 0;
- BackgroundPageThumbs.capture(url, {
- onDone: function onDone(capturedURL) {
- is(capturedURL, url, "Captured URL should be URL passed to capture");
- is(numCalls++, 0, "onDone should be called only once");
- ok(!thumbnailExists(url),
- "Capture failed so thumbnail should not be cached");
- next();
- },
- });
- yield new Promise(resolve => {
- bgAddPageThumbObserver(url).catch(function(err) {
- ok(true, "page-thumbnail error produced");
- resolve();
- });
- });
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_basic.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_basic.js
deleted file mode 100644
index 027e0bfb7..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_basic.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function* runTests() {
- let url = "http://www.example.com/";
- ok(!thumbnailExists(url), "Thumbnail should not be cached yet.");
-
- let capturePromise = new Promise(resolve => {
- bgAddPageThumbObserver(url).then(() => {
- ok(true, `page-thumbnail created for ${url}`);
- resolve();
- });
- });
- let capturedURL = yield bgCapture(url);
- is(capturedURL, url, "Captured URL should be URL passed to capture");
- yield capturePromise;
-
- ok(thumbnailExists(url), "Thumbnail should be cached after capture");
- removeThumbnail(url);
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_captureIfMissing.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_captureIfMissing.js
deleted file mode 100644
index cd1f1c5c2..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_captureIfMissing.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function* runTests() {
- let numNotifications = 0;
- function observe(subject, topic, data) {
- is(topic, "page-thumbnail:create", "got expected topic");
- numNotifications += 1;
- }
-
- Services.obs.addObserver(observe, "page-thumbnail:create", false);
-
- let url = "http://example.com/";
- let file = thumbnailFile(url);
- ok(!file.exists(), "Thumbnail file should not already exist.");
-
- let capturedURL = yield bgCaptureIfMissing(url);
- is(numNotifications, 1, "got notification of item being created.");
- is(capturedURL, url, "Captured URL should be URL passed to capture");
- ok(file.exists(url), "Thumbnail should be cached after capture");
-
- let past = Date.now() - 1000000000;
- let pastFudge = past + 30000;
- file.lastModifiedTime = past;
- ok(file.lastModifiedTime < pastFudge, "Last modified time should stick!");
- capturedURL = yield bgCaptureIfMissing(url);
- is(numNotifications, 1, "still only 1 notification of item being created.");
- is(capturedURL, url, "Captured URL should be URL passed to second capture");
- ok(file.exists(), "Thumbnail should remain cached after second capture");
- ok(file.lastModifiedTime < pastFudge,
- "File should not have been overwritten");
-
- file.remove(false);
- Services.obs.removeObserver(observe, "page-thumbnail:create");
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_crash_during_capture.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_crash_during_capture.js
deleted file mode 100644
index db67a04a8..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_crash_during_capture.js
+++ /dev/null
@@ -1,49 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function* runTests() {
- let crashObserver = bgAddCrashObserver();
-
- // make a good capture first - this ensures we have the <browser>
- let goodUrl = bgTestPageURL();
- yield bgCapture(goodUrl);
- ok(thumbnailExists(goodUrl), "Thumbnail should be cached after capture");
- removeThumbnail(goodUrl);
-
- // inject our content script.
- let mm = bgInjectCrashContentScript();
-
- // queue up 2 captures - the first has a wait, so this is the one that
- // will die. The second one should immediately capture after the crash.
- let waitUrl = bgTestPageURL({ wait: 30000 });
- let sawWaitUrlCapture = false;
- bgCapture(waitUrl, { onDone: () => {
- sawWaitUrlCapture = true;
- ok(!thumbnailExists(waitUrl), "Thumbnail should not have been saved due to the crash");
- }});
- bgCapture(goodUrl, { onDone: () => {
- ok(sawWaitUrlCapture, "waitUrl capture should have finished first");
- ok(thumbnailExists(goodUrl), "We should have recovered and completed the 2nd capture after the crash");
- removeThumbnail(goodUrl);
- // Test done.
- ok(crashObserver.crashed, "Saw a crash from this test");
- next();
- }});
- let crashPromise = new Promise(resolve => {
- bgAddPageThumbObserver(waitUrl).catch(function(err) {
- ok(true, `page-thumbnail error thrown for ${waitUrl}`);
- resolve();
- });
- });
- let capturePromise = new Promise(resolve => {
- bgAddPageThumbObserver(goodUrl).then(() => {
- ok(true, `page-thumbnail created for ${goodUrl}`);
- resolve();
- });
- });
-
- info("Crashing the thumbnail content process.");
- mm.sendAsyncMessage("thumbnails-test:crash");
- yield crashPromise;
- yield capturePromise;
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_crash_while_idle.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_crash_while_idle.js
deleted file mode 100644
index 8ff6a3509..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_crash_while_idle.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function* runTests() {
- let crashObserver = bgAddCrashObserver();
-
- // make a good capture first - this ensures we have the <browser>
- let goodUrl = bgTestPageURL();
- yield bgCapture(goodUrl);
- ok(thumbnailExists(goodUrl), "Thumbnail should be cached after capture");
- removeThumbnail(goodUrl);
-
- // inject our content script.
- let mm = bgInjectCrashContentScript();
-
- // the observer for the crashing process is basically async, so it's hard
- // to know when the <browser> has actually seen it. Easist is to just add
- // our own observer.
- Services.obs.addObserver(function onCrash() {
- Services.obs.removeObserver(onCrash, "oop-frameloader-crashed");
- // spin the event loop to ensure the BPT observer was called.
- executeSoon(function() {
- // Now queue another capture and ensure it recovers.
- bgCapture(goodUrl, { onDone: () => {
- ok(thumbnailExists(goodUrl), "We should have recovered and handled new capture requests");
- removeThumbnail(goodUrl);
- // Test done.
- ok(crashObserver.crashed, "Saw a crash from this test");
- next();
- }});
- });
- }, "oop-frameloader-crashed", false);
-
- // Nothing is pending - crash the process.
- info("Crashing the thumbnail content process.");
- mm.sendAsyncMessage("thumbnails-test:crash");
- yield true;
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_destroy_browser.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_destroy_browser.js
deleted file mode 100644
index b83fdf583..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_destroy_browser.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function* runTests() {
- yield SpecialPowers.pushPrefEnv({
- set: [["dom.ipc.processCount", 1]]
- });
-
- let url1 = "http://example.com/1";
- ok(!thumbnailExists(url1), "First file should not exist yet.");
-
- let url2 = "http://example.com/2";
- ok(!thumbnailExists(url2), "Second file should not exist yet.");
-
- let defaultTimeout = BackgroundPageThumbs._destroyBrowserTimeout;
- BackgroundPageThumbs._destroyBrowserTimeout = 1000;
-
- yield bgCapture(url1);
- ok(thumbnailExists(url1), "First file should exist after capture.");
- removeThumbnail(url1);
-
- yield wait(2000);
- is(BackgroundPageThumbs._thumbBrowser, undefined,
- "Thumb browser should be destroyed after timeout.");
- BackgroundPageThumbs._destroyBrowserTimeout = defaultTimeout;
-
- yield bgCapture(url2);
- ok(thumbnailExists(url2), "Second file should exist after capture.");
- removeThumbnail(url2);
-
- isnot(BackgroundPageThumbs._thumbBrowser, undefined,
- "Thumb browser should exist immediately after capture.");
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_alert.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_alert.js
deleted file mode 100644
index 5d6bd81f8..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_alert.js
+++ /dev/null
@@ -1,13 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function* runTests() {
- let url = "data:text/html,<script>try { alert('yo!'); } catch (e) {}</script>";
- ok(!thumbnailExists(url), "Thumbnail file should not already exist.");
-
- let capturedURL = yield bgCapture(url);
- is(capturedURL, url, "Captured URL should be URL passed to capture.");
- ok(thumbnailExists(url),
- "Thumbnail file should exist even though it alerted.");
- removeThumbnail(url);
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_auth_prompt.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_auth_prompt.js
deleted file mode 100644
index 0eb9df7a9..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_auth_prompt.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// the following tests attempt to display modal dialogs. The test just
-// relies on the fact that if the dialog was displayed the test will hang
-// and timeout. IOW - the tests would pass if the dialogs appear and are
-// manually closed by the user - so don't do that :) (obviously there is
-// noone available to do that when run via tbpl etc, so this should be safe,
-// and it's tricky to use the window-watcher to check a window *does not*
-// appear - how long should the watcher be active before assuming it's not
-// going to appear?)
-function* runTests() {
- let url = "http://mochi.test:8888/browser/toolkit/components/thumbnails/test/authenticate.sjs?user=anyone";
- ok(!thumbnailExists(url), "Thumbnail file should not already exist.");
-
- let capturedURL = yield bgCapture(url);
- is(capturedURL, url, "Captured URL should be URL passed to capture.");
- ok(thumbnailExists(url),
- "Thumbnail file should exist even though it requires auth.");
- removeThumbnail(url);
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_cookies_sent.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_cookies_sent.js
deleted file mode 100644
index afbedb382..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_cookies_sent.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function* runTests() {
- // Visit the test page in the browser and tell it to set a cookie.
- let url = bgTestPageURL({ setGreenCookie: true });
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, url);
- let browser = tab.linkedBrowser;
-
- // The root element of the page shouldn't be green yet.
- yield ContentTask.spawn(browser, null, function () {
- Assert.notEqual(content.document.documentElement.style.backgroundColor,
- "rgb(0, 255, 0)",
- "The page shouldn't be green yet.");
- });
-
- // Cookie should be set now. Reload the page to verify. Its root element
- // will be green if the cookie's set.
- browser.reload();
- yield BrowserTestUtils.browserLoaded(browser);
- yield ContentTask.spawn(browser, null, function () {
- Assert.equal(content.document.documentElement.style.backgroundColor,
- "rgb(0, 255, 0)",
- "The page should be green now.");
- });
-
- // Capture the page. Get the image data of the capture and verify it's not
- // green. (Checking only the first pixel suffices.)
- yield bgCapture(url);
- ok(thumbnailExists(url), "Thumbnail file should exist after capture.");
-
- retrieveImageDataForURL(url, function ([r, g, b]) {
- isnot([r, g, b].toString(), [0, 255, 0].toString(),
- "The captured page should not be green.");
- gBrowser.removeTab(tab);
- removeThumbnail(url);
- next();
- });
- yield true;
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_cookies_stored.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_cookies_stored.js
deleted file mode 100644
index 90a1a890b..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_cookies_stored.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// check that if a page captured in the background attempts to set a cookie,
-// that cookie is not saved for subsequent requests.
-function* runTests() {
- yield SpecialPowers.pushPrefEnv({
- set: [["privacy.usercontext.about_newtab_segregation.enabled", true]]
- });
- let url = bgTestPageURL({
- setRedCookie: true,
- iframe: bgTestPageURL({ setRedCookie: true}),
- xhr: bgTestPageURL({ setRedCookie: true})
- });
- ok(!thumbnailExists(url), "Thumbnail file should not exist before capture.");
- yield bgCapture(url);
- ok(thumbnailExists(url), "Thumbnail file should exist after capture.");
- removeThumbnail(url);
- // now load it up in a browser - it should *not* be red, otherwise the
- // cookie above was saved.
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, url);
- let browser = tab.linkedBrowser;
-
- // The root element of the page shouldn't be red.
- yield ContentTask.spawn(browser, null, function() {
- Assert.notEqual(content.document.documentElement.style.backgroundColor,
- "rgb(255, 0, 0)",
- "The page shouldn't be red.");
- });
-
- gBrowser.removeTab(tab);
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_duplicates.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_duplicates.js
deleted file mode 100644
index 31b504335..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_no_duplicates.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function* runTests() {
- let url = "http://example.com/1";
- ok(!thumbnailExists(url), "Thumbnail file should not already exist.");
- let numCallbacks = 0;
- let doneCallback = function(doneUrl) {
- is(doneUrl, url, "called back with correct url");
- numCallbacks += 1;
- // We will delete the file after the first callback, then check it
- // still doesn't exist on the second callback, which should give us
- // confidence that we didn't end up with 2 different captures happening
- // for the same url...
- if (numCallbacks == 1) {
- ok(thumbnailExists(url), "Thumbnail file should now exist.");
- removeThumbnail(url);
- return;
- }
- if (numCallbacks == 2) {
- ok(!thumbnailExists(url), "Thumbnail file should still be deleted.");
- // and that's all we expect, so we are done...
- next();
- return;
- }
- ok(false, "only expecting 2 callbacks");
- }
- BackgroundPageThumbs.capture(url, {onDone: doneCallback});
- BackgroundPageThumbs.capture(url, {onDone: doneCallback});
- yield true;
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_queueing.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_queueing.js
deleted file mode 100644
index 1426f6f4e..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_queueing.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function* runTests() {
- let urls = [
- "http://www.example.com/0",
- "http://www.example.com/1",
- // an item that will timeout to ensure timeouts work and we resume.
- bgTestPageURL({ wait: 2002 }),
- "http://www.example.com/2",
- ];
- dontExpireThumbnailURLs(urls);
- urls.forEach(url => {
- ok(!thumbnailExists(url), "Thumbnail should not exist yet: " + url);
- let isTimeoutTest = url.indexOf("wait") >= 0;
- BackgroundPageThumbs.capture(url, {
- timeout: isTimeoutTest ? 100 : 30000,
- onDone: function onDone(capturedURL) {
- ok(urls.length > 0, "onDone called, so URLs should still remain");
- is(capturedURL, urls.shift(),
- "Captured URL should be currently expected URL (i.e., " +
- "capture() callbacks should be called in the correct order)");
- if (isTimeoutTest) {
- ok(!thumbnailExists(capturedURL),
- "Thumbnail shouldn't exist for timed out capture");
- } else {
- ok(thumbnailExists(capturedURL),
- "Thumbnail should be cached after capture");
- removeThumbnail(url);
- }
- if (!urls.length)
- // Test done.
- next();
- },
- });
- });
- yield true;
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_redirect.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_redirect.js
deleted file mode 100644
index baa1b6d68..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_redirect.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function* runTests() {
- let finalURL = "http://example.com/redirected";
- let originalURL = bgTestPageURL({ redirect: finalURL });
-
- ok(!thumbnailExists(originalURL),
- "Thumbnail file for original URL should not exist yet.");
- ok(!thumbnailExists(finalURL),
- "Thumbnail file for final URL should not exist yet.");
-
- let captureOriginalPromise = new Promise(resolve => {
- bgAddPageThumbObserver(originalURL).then(() => {
- ok(true, `page-thumbnail created for ${originalURL}`);
- resolve();
- });
- });
-
- let captureFinalPromise = new Promise(resolve => {
- bgAddPageThumbObserver(finalURL).then(() => {
- ok(true, `page-thumbnail created for ${finalURL}`);
- resolve();
- });
- });
-
- let capturedURL = yield bgCapture(originalURL);
- is(capturedURL, originalURL,
- "Captured URL should be URL passed to capture");
- yield captureOriginalPromise;
- yield captureFinalPromise;
- ok(thumbnailExists(originalURL),
- "Thumbnail for original URL should be cached");
- ok(thumbnailExists(finalURL),
- "Thumbnail for final URL should be cached");
-
- removeThumbnail(originalURL);
- removeThumbnail(finalURL);
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bg_timeout.js b/toolkit/components/thumbnails/test/browser_thumbnails_bg_timeout.js
deleted file mode 100644
index da05b4355..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bg_timeout.js
+++ /dev/null
@@ -1,24 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function* runTests() {
- let url = bgTestPageURL({ wait: 30000 });
- ok(!thumbnailExists(url), "Thumbnail should not be cached already.");
- let numCalls = 0;
- BackgroundPageThumbs.capture(url, {
- timeout: 0,
- onDone: function onDone(capturedURL) {
- is(capturedURL, url, "Captured URL should be URL passed to capture");
- is(numCalls++, 0, "onDone should be called only once");
- ok(!thumbnailExists(url),
- "Capture timed out so thumbnail should not be cached");
- next();
- },
- });
- yield new Promise(resolve => {
- bgAddPageThumbObserver(url).catch(function(err) {
- ok(true, `page-thumbnail error thrown for ${url}`);
- resolve();
- });
- });
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bug726727.js b/toolkit/components/thumbnails/test/browser_thumbnails_bug726727.js
deleted file mode 100644
index f7f1f3deb..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bug726727.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * These tests ensure that capturing a sites's thumbnail, saving it and
- * retrieving it from the cache works.
- */
-function* runTests() {
- // Create a tab that shows an error page.
- let tab = gBrowser.addTab("http://127.0.0.1:1/");
- let browser = tab.linkedBrowser;
- yield browser.addEventListener("DOMContentLoaded", function onLoad() {
- browser.removeEventListener("DOMContentLoaded", onLoad, false);
- PageThumbs.shouldStoreThumbnail(browser, (aResult) => {
- ok(!aResult, "we're not going to capture an error page");
- executeSoon(next);
- });
- }, false);
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bug727765.js b/toolkit/components/thumbnails/test/browser_thumbnails_bug727765.js
deleted file mode 100644
index c4faac685..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bug727765.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-const URL = "http://mochi.test:8888/browser/toolkit/components/thumbnails/" +
- "test/background_red_scroll.html";
-
-function isRedThumbnailFuzz(r, g, b, expectedR, expectedB, expectedG, aFuzz)
-{
- return (Math.abs(r - expectedR) <= aFuzz) &&
- (Math.abs(g - expectedG) <= aFuzz) &&
- (Math.abs(b - expectedB) <= aFuzz);
-}
-
-// Test for black borders caused by scrollbars.
-function* runTests() {
- // Create a tab with a page with a red background and scrollbars.
- yield addTab(URL);
- yield captureAndCheckColor(255, 0, 0, "we have a red thumbnail");
-
- // Check the thumbnail color of the bottom right pixel.
- yield whenFileExists(URL);
- yield retrieveImageDataForURL(URL, function (aData) {
- let [r, g, b] = [].slice.call(aData, -4);
- let fuzz = 2; // Windows 8 x64 blends with the scrollbar a bit.
- var message = "Expected red thumbnail rgb(255, 0, 0), got " + r + "," + g + "," + b;
- ok(isRedThumbnailFuzz(r, g, b, 255, 0, 0, fuzz), message);
- next();
- });
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_bug818225.js b/toolkit/components/thumbnails/test/browser_thumbnails_bug818225.js
deleted file mode 100644
index a7e1caa04..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_bug818225.js
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-const URL = "http://mochi.test:8888/browser/toolkit/components/thumbnails/" +
- "test/background_red.html?" + Date.now();
-
-// Test PageThumbs API function getThumbnailPath
-function* runTests() {
-
- let path = PageThumbs.getThumbnailPath(URL);
- yield testIfExists(path, false, "Thumbnail file does not exist");
-
- yield addVisitsAndRepopulateNewTabLinks(URL, next);
- yield createThumbnail(URL);
-
- path = PageThumbs.getThumbnailPath(URL);
- let expectedPath = PageThumbsStorage.getFilePathForURL(URL);
- is(path, expectedPath, "Thumbnail file has correct path");
-
- yield testIfExists(path, true, "Thumbnail file exists");
-
-}
-
-function createThumbnail(aURL) {
- addTab(aURL, function () {
- whenFileExists(aURL, function () {
- gBrowser.removeTab(gBrowser.selectedTab);
- next();
- });
- });
-}
-
-function testIfExists(aPath, aExpected, aMessage) {
- return OS.File.exists(aPath).then(
- function onSuccess(exists) {
- is(exists, aExpected, aMessage);
- },
- function onFailure(error) {
- ok(false, "OS.File.exists() failed " + error);
- }
- );
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_capture.js b/toolkit/components/thumbnails/test/browser_thumbnails_capture.js
deleted file mode 100644
index 47d94d31b..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_capture.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * These tests ensure that capturing a sites's thumbnail, saving it and
- * retrieving it from the cache works.
- */
-function* runTests() {
- // Create a tab with a red background.
- yield addTab("data:text/html,<body bgcolor=ff0000></body>");
- yield captureAndCheckColor(255, 0, 0, "we have a red thumbnail");
-
- // Load a page with a green background.
- yield navigateTo("data:text/html,<body bgcolor=00ff00></body>");
- yield captureAndCheckColor(0, 255, 0, "we have a green thumbnail");
-
- // Load a page with a blue background.
- yield navigateTo("data:text/html,<body bgcolor=0000ff></body>");
- yield captureAndCheckColor(0, 0, 255, "we have a blue thumbnail");
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_expiration.js b/toolkit/components/thumbnails/test/browser_thumbnails_expiration.js
deleted file mode 100644
index 4c73e17be..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_expiration.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-const URL = "http://mochi.test:8888/?t=" + Date.now();
-const URL1 = URL + "#1";
-const URL2 = URL + "#2";
-const URL3 = URL + "#3";
-
-var tmp = {};
-Cc["@mozilla.org/moz/jssubscript-loader;1"]
- .getService(Ci.mozIJSSubScriptLoader)
- .loadSubScript("resource://gre/modules/PageThumbs.jsm", tmp);
-
-const EXPIRATION_MIN_CHUNK_SIZE = 50;
-const {PageThumbsExpiration} = tmp;
-
-function* runTests() {
- // Create dummy URLs.
- let dummyURLs = [];
- for (let i = 0; i < EXPIRATION_MIN_CHUNK_SIZE + 10; i++) {
- dummyURLs.push(URL + "#dummy" + i);
- }
-
- // Make sure our thumbnails aren't expired too early.
- dontExpireThumbnailURLs([URL1, URL2, URL3].concat(dummyURLs));
-
- // Create three thumbnails.
- yield createDummyThumbnail(URL1);
- ok(thumbnailExists(URL1), "first thumbnail created");
-
- yield createDummyThumbnail(URL2);
- ok(thumbnailExists(URL2), "second thumbnail created");
-
- yield createDummyThumbnail(URL3);
- ok(thumbnailExists(URL3), "third thumbnail created");
-
- // Remove the third thumbnail.
- yield expireThumbnails([URL1, URL2]);
- ok(thumbnailExists(URL1), "first thumbnail still exists");
- ok(thumbnailExists(URL2), "second thumbnail still exists");
- ok(!thumbnailExists(URL3), "third thumbnail has been removed");
-
- // Remove the second thumbnail.
- yield expireThumbnails([URL1]);
- ok(thumbnailExists(URL1), "first thumbnail still exists");
- ok(!thumbnailExists(URL2), "second thumbnail has been removed");
-
- // Remove all thumbnails.
- yield expireThumbnails([]);
- ok(!thumbnailExists(URL1), "all thumbnails have been removed");
-
- // Create some more files than the min chunk size.
- for (let url of dummyURLs) {
- yield createDummyThumbnail(url);
- }
-
- ok(dummyURLs.every(thumbnailExists), "all dummy thumbnails created");
-
- // Expire thumbnails and expect 10 remaining.
- yield expireThumbnails([]);
- let remainingURLs = dummyURLs.filter(thumbnailExists);
- is(remainingURLs.length, 10, "10 dummy thumbnails remaining");
-
- // Expire thumbnails again. All should be gone by now.
- yield expireThumbnails([]);
- remainingURLs = remainingURLs.filter(thumbnailExists);
- is(remainingURLs.length, 0, "no dummy thumbnails remaining");
-}
-
-function createDummyThumbnail(aURL) {
- info("Creating dummy thumbnail for " + aURL);
- let dummy = new Uint8Array(10);
- for (let i = 0; i < 10; ++i) {
- dummy[i] = i;
- }
- PageThumbsStorage.writeData(aURL, dummy).then(
- function onSuccess() {
- info("createDummyThumbnail succeeded");
- executeSoon(next);
- },
- function onFailure(error) {
- ok(false, "createDummyThumbnail failed " + error);
- }
- );
-}
-
-function expireThumbnails(aKeep) {
- PageThumbsExpiration.expireThumbnails(aKeep).then(
- function onSuccess() {
- info("expireThumbnails succeeded");
- executeSoon(next);
- },
- function onFailure(error) {
- ok(false, "expireThumbnails failed " + error);
- }
- );
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_privacy.js b/toolkit/components/thumbnails/test/browser_thumbnails_privacy.js
deleted file mode 100644
index e7dc7b4d5..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_privacy.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-const PREF_DISK_CACHE_SSL = "browser.cache.disk_cache_ssl";
-const URL = "://example.com/browser/toolkit/components/thumbnails/" +
- "test/privacy_cache_control.sjs";
-
-function* runTests() {
- registerCleanupFunction(function () {
- Services.prefs.clearUserPref(PREF_DISK_CACHE_SSL);
- });
-
- let positive = [
- // A normal HTTP page without any Cache-Control header.
- {scheme: "http", cacheControl: null, diskCacheSSL: false},
-
- // A normal HTTP page with 'Cache-Control: private'.
- {scheme: "http", cacheControl: "private", diskCacheSSL: false},
-
- // Capture HTTPS pages if browser.cache.disk_cache_ssl == true.
- {scheme: "https", cacheControl: null, diskCacheSSL: true},
- {scheme: "https", cacheControl: "public", diskCacheSSL: true},
- {scheme: "https", cacheControl: "private", diskCacheSSL: true}
- ];
-
- let negative = [
- // Never capture pages with 'Cache-Control: no-store'.
- {scheme: "http", cacheControl: "no-store", diskCacheSSL: false},
- {scheme: "http", cacheControl: "no-store", diskCacheSSL: true},
- {scheme: "https", cacheControl: "no-store", diskCacheSSL: false},
- {scheme: "https", cacheControl: "no-store", diskCacheSSL: true},
-
- // Don't capture HTTPS pages by default.
- {scheme: "https", cacheControl: null, diskCacheSSL: false},
- {scheme: "https", cacheControl: "public", diskCacheSSL: false},
- {scheme: "https", cacheControl: "private", diskCacheSSL: false}
- ];
-
- yield checkCombinations(positive, true);
- yield checkCombinations(negative, false);
-}
-
-function checkCombinations(aCombinations, aResult) {
- let combi = aCombinations.shift();
- if (!combi) {
- next();
- return;
- }
-
- let url = combi.scheme + URL;
- if (combi.cacheControl)
- url += "?" + combi.cacheControl;
- Services.prefs.setBoolPref(PREF_DISK_CACHE_SSL, combi.diskCacheSSL);
-
- // Add the test page as a top link so it has a chance to be thumbnailed
- addVisitsAndRepopulateNewTabLinks(url, _ => {
- testCombination(combi, url, aCombinations, aResult);
- });
-}
-
-function testCombination(combi, url, aCombinations, aResult) {
- let tab = gBrowser.selectedTab = gBrowser.addTab(url);
- let browser = gBrowser.selectedBrowser;
-
- whenLoaded(browser, () => {
- let msg = JSON.stringify(combi) + " == " + aResult;
- PageThumbs.shouldStoreThumbnail(browser, (aIsSafeSite) => {
- is(aIsSafeSite, aResult, msg);
- gBrowser.removeTab(tab);
- // Continue with the next combination.
- checkCombinations(aCombinations, aResult);
- });
- });
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_redirect.js b/toolkit/components/thumbnails/test/browser_thumbnails_redirect.js
deleted file mode 100644
index 482dbc803..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_redirect.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-const URL = "http://mochi.test:8888/browser/toolkit/components/thumbnails/" +
- "test/background_red_redirect.sjs";
-// loading URL will redirect us to...
-const FINAL_URL = "http://mochi.test:8888/browser/toolkit/components/" +
- "thumbnails/test/background_red.html";
-
-/**
- * These tests ensure that we save and provide thumbnails for redirecting sites.
- */
-function* runTests() {
- dontExpireThumbnailURLs([URL, FINAL_URL]);
-
- // Kick off history by loading a tab first or the test fails in single mode.
- yield addTab(URL);
- gBrowser.removeTab(gBrowser.selectedTab);
-
- // Create a tab, redirecting to a page with a red background.
- yield addTab(URL);
- yield captureAndCheckColor(255, 0, 0, "we have a red thumbnail");
-
- // Wait until the referrer's thumbnail's file has been written.
- yield whenFileExists(URL);
- yield retrieveImageDataForURL(URL, function ([r, g, b]) {
- is("" + [r, g, b], "255,0,0", "referrer has a red thumbnail");
- next();
- });
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_storage.js b/toolkit/components/thumbnails/test/browser_thumbnails_storage.js
deleted file mode 100644
index 972f956e5..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_storage.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-const URL = "http://mochi.test:8888/";
-const URL_COPY = URL + "#copy";
-
-XPCOMUtils.defineLazyGetter(this, "Sanitizer", function () {
- let tmp = {};
- Cc["@mozilla.org/moz/jssubscript-loader;1"]
- .getService(Ci.mozIJSSubScriptLoader)
- .loadSubScript("chrome://browser/content/sanitize.js", tmp);
- return tmp.Sanitizer;
-});
-
-/**
- * These tests ensure that the thumbnail storage is working as intended.
- * Newly captured thumbnails should be saved as files and they should as well
- * be removed when the user sanitizes their history.
- */
-function* runTests() {
- yield Task.spawn(function*() {
- dontExpireThumbnailURLs([URL, URL_COPY]);
-
- yield promiseClearHistory();
- yield promiseAddVisitsAndRepopulateNewTabLinks(URL);
- yield promiseCreateThumbnail();
-
- // Make sure Storage.copy() updates an existing file.
- yield PageThumbsStorage.copy(URL, URL_COPY);
- let copy = new FileUtils.File(PageThumbsStorage.getFilePathForURL(URL_COPY));
- let mtime = copy.lastModifiedTime -= 60;
-
- yield PageThumbsStorage.copy(URL, URL_COPY);
- isnot(new FileUtils.File(PageThumbsStorage.getFilePathForURL(URL_COPY)).lastModifiedTime, mtime,
- "thumbnail file was updated");
-
- let file = new FileUtils.File(PageThumbsStorage.getFilePathForURL(URL));
- let fileCopy = new FileUtils.File(PageThumbsStorage.getFilePathForURL(URL_COPY));
-
- // Clear the browser history. Retry until the files are gone because Windows
- // locks them sometimes.
- info("Clearing history");
- while (file.exists() || fileCopy.exists()) {
- yield promiseClearHistory();
- }
- info("History is clear");
-
- info("Repopulating");
- yield promiseAddVisitsAndRepopulateNewTabLinks(URL);
- yield promiseCreateThumbnail();
-
- info("Clearing the last 10 minutes of browsing history");
- // Clear the last 10 minutes of browsing history.
- yield promiseClearHistory(true);
-
- info("Attempt to clear file");
- // Retry until the file is gone because Windows locks it sometimes.
- yield promiseClearFile(file, URL);
-
- info("Done");
- });
-}
-
-var promiseClearFile = Task.async(function*(aFile, aURL) {
- if (!aFile.exists()) {
- return undefined;
- }
- // Re-add our URL to the history so that history observer's onDeleteURI()
- // is called again.
- yield PlacesTestUtils.addVisits(makeURI(aURL));
- yield promiseClearHistory(true);
- // Then retry.
- return promiseClearFile(aFile, aURL);
-});
-
-function promiseClearHistory(aUseRange) {
- let s = new Sanitizer();
- s.prefDomain = "privacy.cpd.";
-
- let prefs = gPrefService.getBranch(s.prefDomain);
- prefs.setBoolPref("history", true);
- prefs.setBoolPref("downloads", false);
- prefs.setBoolPref("cache", false);
- prefs.setBoolPref("cookies", false);
- prefs.setBoolPref("formdata", false);
- prefs.setBoolPref("offlineApps", false);
- prefs.setBoolPref("passwords", false);
- prefs.setBoolPref("sessions", false);
- prefs.setBoolPref("siteSettings", false);
-
- if (aUseRange) {
- let usec = Date.now() * 1000;
- s.range = [usec - 10 * 60 * 1000 * 1000, usec];
- s.ignoreTimespan = false;
- }
-
- return s.sanitize().then(() => {
- s.range = null;
- s.ignoreTimespan = true;
- });
-}
-
-function promiseCreateThumbnail() {
- return new Promise(resolve => {
- addTab(URL, function () {
- whenFileExists(URL, function () {
- gBrowser.removeTab(gBrowser.selectedTab);
- resolve();
- });
- });
- });
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_storage_migrate3.js b/toolkit/components/thumbnails/test/browser_thumbnails_storage_migrate3.js
deleted file mode 100644
index e7f150f87..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_storage_migrate3.js
+++ /dev/null
@@ -1,102 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-const URL = "http://mochi.test:8888/migration3";
-const URL2 = URL + "#2";
-const URL3 = URL + "#3";
-const THUMBNAIL_DIRECTORY = "thumbnails";
-const PREF_STORAGE_VERSION = "browser.pagethumbnails.storage_version";
-
-var tmp = {};
-Cc["@mozilla.org/moz/jssubscript-loader;1"]
- .getService(Ci.mozIJSSubScriptLoader)
- .loadSubScript("resource://gre/modules/PageThumbs.jsm", tmp);
-var {PageThumbsStorageMigrator} = tmp;
-
-XPCOMUtils.defineLazyServiceGetter(this, "gDirSvc",
- "@mozilla.org/file/directory_service;1", "nsIProperties");
-
-/**
- * This test makes sure we correctly migrate to thumbnail storage version 3.
- * This means copying existing thumbnails from the roaming to the local profile
- * directory and should just apply to Linux.
- */
-function* runTests() {
- // Prepare a local profile directory.
- let localProfile = FileUtils.getDir("ProfD", ["local-test"], true);
- changeLocation("ProfLD", localProfile);
-
- let roaming = FileUtils.getDir("ProfD", [THUMBNAIL_DIRECTORY], true);
-
- // Set up some data in the roaming profile.
- let name = PageThumbsStorage.getLeafNameForURL(URL);
- let file = FileUtils.getFile("ProfD", [THUMBNAIL_DIRECTORY, name]);
- writeDummyFile(file);
-
- name = PageThumbsStorage.getLeafNameForURL(URL2);
- file = FileUtils.getFile("ProfD", [THUMBNAIL_DIRECTORY, name]);
- writeDummyFile(file);
-
- name = PageThumbsStorage.getLeafNameForURL(URL3);
- file = FileUtils.getFile("ProfD", [THUMBNAIL_DIRECTORY, name]);
- writeDummyFile(file);
-
- // Pretend to have one of the thumbnails
- // already in place at the new storage site.
- name = PageThumbsStorage.getLeafNameForURL(URL3);
- file = FileUtils.getFile("ProfLD", [THUMBNAIL_DIRECTORY, name]);
- writeDummyFile(file, "no-overwrite-plz");
-
- // Kick off thumbnail storage migration.
- PageThumbsStorageMigrator.migrateToVersion3(localProfile.path);
- ok(true, "migration finished");
-
- // Wait until the first thumbnail was moved to its new location.
- yield whenFileExists(URL);
- ok(true, "first thumbnail moved");
-
- // Wait for the second thumbnail to be moved as well.
- yield whenFileExists(URL2);
- ok(true, "second thumbnail moved");
-
- yield whenFileRemoved(roaming);
- ok(true, "roaming thumbnail directory removed");
-
- // Check that our existing thumbnail wasn't overwritten.
- is(getFileContents(file), "no-overwrite-plz",
- "existing thumbnail was not overwritten");
-
- // Sanity check: ensure that, until it is removed, deprecated
- // function |getFileForURL| points to the same path as
- // |getFilePathForURL|.
- if ("getFileForURL" in PageThumbsStorage) {
- file = PageThumbsStorage.getFileForURL(URL);
- is(file.path, PageThumbsStorage.getFilePathForURL(URL),
- "Deprecated getFileForURL and getFilePathForURL return the same path");
- }
-}
-
-function changeLocation(aLocation, aNewDir) {
- let oldDir = gDirSvc.get(aLocation, Ci.nsILocalFile);
- gDirSvc.undefine(aLocation);
- gDirSvc.set(aLocation, aNewDir);
-
- registerCleanupFunction(function () {
- gDirSvc.undefine(aLocation);
- gDirSvc.set(aLocation, oldDir);
- });
-}
-
-function writeDummyFile(aFile, aContents) {
- let fos = FileUtils.openSafeFileOutputStream(aFile);
- let data = aContents || "dummy";
- fos.write(data, data.length);
- FileUtils.closeSafeFileOutputStream(fos);
-}
-
-function getFileContents(aFile) {
- let istream = Cc["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Ci.nsIFileInputStream);
- istream.init(aFile, FileUtils.MODE_RDONLY, FileUtils.PERMS_FILE, 0);
- return NetUtil.readInputStreamToString(istream, istream.available());
-}
diff --git a/toolkit/components/thumbnails/test/browser_thumbnails_update.js b/toolkit/components/thumbnails/test/browser_thumbnails_update.js
deleted file mode 100644
index 971a2994e..000000000
--- a/toolkit/components/thumbnails/test/browser_thumbnails_update.js
+++ /dev/null
@@ -1,169 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * These tests check the auto-update facility of the thumbnail service.
- */
-
-function* runTests() {
- // A "trampoline" - a generator that iterates over sub-iterators
- let tests = [
- simpleCaptureTest,
- capIfStaleErrorResponseUpdateTest,
- capIfStaleGoodResponseUpdateTest,
- regularCapErrorResponseUpdateTest,
- regularCapGoodResponseUpdateTest
- ];
- for (let test of tests) {
- info("Running subtest " + test.name);
- for (let iterator of test())
- yield iterator;
- }
-}
-
-function ensureThumbnailStale(url) {
- // We go behind the back of the thumbnail service and change the
- // mtime of the file to be in the past.
- let fname = PageThumbsStorage.getFilePathForURL(url);
- let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- file.initWithPath(fname);
- ok(file.exists(), fname + " should exist");
- // Set it as very stale...
- file.lastModifiedTime = Date.now() - 1000000000;
-}
-
-function getThumbnailModifiedTime(url) {
- let fname = PageThumbsStorage.getFilePathForURL(url);
- let file = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsIFile);
- file.initWithPath(fname);
- return file.lastModifiedTime;
-}
-
-// The tests!
-/* Check functionality of a normal captureAndStoreIfStale request */
-function* simpleCaptureTest() {
- let numNotifications = 0;
- const URL = "http://mochi.test:8888/browser/toolkit/components/thumbnails/test/thumbnails_update.sjs?simple";
-
- function observe(subject, topic, data) {
- is(topic, "page-thumbnail:create", "got expected topic");
- is(data, URL, "data is our test URL");
- if (++numNotifications == 2) {
- // This is the final notification and signals test success...
- Services.obs.removeObserver(observe, "page-thumbnail:create");
- gBrowser.removeTab(gBrowser.selectedTab);
- next();
- }
- }
-
- Services.obs.addObserver(observe, "page-thumbnail:create", false);
- // Create a tab - we don't care what the content is.
- yield addTab(URL);
- let browser = gBrowser.selectedBrowser;
-
- // Capture the screenshot.
- PageThumbs.captureAndStore(browser, function () {
- // We've got a capture so should have seen the observer.
- is(numNotifications, 1, "got notification of item being created.");
- // The capture is now "fresh" - so requesting the URL should not cause
- // a new capture.
- PageThumbs.captureAndStoreIfStale(browser, function() {
- is(numNotifications, 1, "still only 1 notification of item being created.");
-
- ensureThumbnailStale(URL);
- // Ask for it to be updated.
- PageThumbs.captureAndStoreIfStale(browser);
- // But it's async, so wait - our observer above will call next() when
- // the notification comes.
- });
- });
- yield undefined // wait for callbacks to call 'next'...
-}
-
-/* Check functionality of captureAndStoreIfStale when there is an error response
- from the server.
- */
-function* capIfStaleErrorResponseUpdateTest() {
- const URL = "http://mochi.test:8888/browser/toolkit/components/thumbnails/test/thumbnails_update.sjs?fail";
- yield addTab(URL);
-
- yield captureAndCheckColor(0, 255, 0, "we have a green thumbnail");
- // update the thumbnail to be stale, then re-request it. The server will
- // return a 400 response and a red thumbnail.
- // The service should not save the thumbnail - so we (a) check the thumbnail
- // remains green and (b) check the mtime of the file is < now.
- ensureThumbnailStale(URL);
- yield navigateTo(URL);
- // now() returns a higher-precision value than the modified time of a file.
- // As we set the thumbnail very stale, allowing 1 second of "slop" here
- // works around this while still keeping the test valid.
- let now = Date.now() - 1000 ;
- PageThumbs.captureAndStoreIfStale(gBrowser.selectedBrowser, () => {
- ok(getThumbnailModifiedTime(URL) < now, "modified time should be < now");
- retrieveImageDataForURL(URL, function ([r, g, b]) {
- is("" + [r, g, b], "" + [0, 255, 0], "thumbnail is still green");
- gBrowser.removeTab(gBrowser.selectedTab);
- next();
- });
- });
- yield undefined; // wait for callback to call 'next'...
-}
-
-/* Check functionality of captureAndStoreIfStale when there is a non-error
- response from the server. This test is somewhat redundant - although it is
- using a http:// URL instead of a data: url like most others.
- */
-function* capIfStaleGoodResponseUpdateTest() {
- const URL = "http://mochi.test:8888/browser/toolkit/components/thumbnails/test/thumbnails_update.sjs?ok";
- yield addTab(URL);
- let browser = gBrowser.selectedBrowser;
-
- yield captureAndCheckColor(0, 255, 0, "we have a green thumbnail");
- // update the thumbnail to be stale, then re-request it. The server will
- // return a 200 response and a red thumbnail - so that new thumbnail should
- // end up captured.
- ensureThumbnailStale(URL);
- yield navigateTo(URL);
- // now() returns a higher-precision value than the modified time of a file.
- // As we set the thumbnail very stale, allowing 1 second of "slop" here
- // works around this while still keeping the test valid.
- let now = Date.now() - 1000 ;
- PageThumbs.captureAndStoreIfStale(browser, () => {
- ok(getThumbnailModifiedTime(URL) >= now, "modified time should be >= now");
- // the captureAndStoreIfStale request saw a 200 response with the red body,
- // so we expect to see the red version here.
- retrieveImageDataForURL(URL, function ([r, g, b]) {
- is("" + [r, g, b], "" + [255, 0, 0], "thumbnail is now red");
- next();
- });
- });
- yield undefined; // wait for callback to call 'next'...
-}
-
-/* Check functionality of captureAndStore when there is an error response
- from the server.
- */
-function* regularCapErrorResponseUpdateTest() {
- const URL = "http://mochi.test:8888/browser/toolkit/components/thumbnails/test/thumbnails_update.sjs?fail";
- yield addTab(URL);
- yield captureAndCheckColor(0, 255, 0, "we have a green thumbnail");
- gBrowser.removeTab(gBrowser.selectedTab);
- // do it again - the server will return a 400, so the foreground service
- // should not update it.
- yield addTab(URL);
- yield captureAndCheckColor(0, 255, 0, "we still have a green thumbnail");
-}
-
-/* Check functionality of captureAndStore when there is an OK response
- from the server.
- */
-function* regularCapGoodResponseUpdateTest() {
- const URL = "http://mochi.test:8888/browser/toolkit/components/thumbnails/test/thumbnails_update.sjs?ok";
- yield addTab(URL);
- yield captureAndCheckColor(0, 255, 0, "we have a green thumbnail");
- gBrowser.removeTab(gBrowser.selectedTab);
- // do it again - the server will return a 200, so the foreground service
- // should update it.
- yield addTab(URL);
- yield captureAndCheckColor(255, 0, 0, "we now have a red thumbnail");
-}
diff --git a/toolkit/components/thumbnails/test/head.js b/toolkit/components/thumbnails/test/head.js
deleted file mode 100644
index e8229508a..000000000
--- a/toolkit/components/thumbnails/test/head.js
+++ /dev/null
@@ -1,356 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var tmp = {};
-Cu.import("resource://gre/modules/PageThumbs.jsm", tmp);
-Cu.import("resource://gre/modules/BackgroundPageThumbs.jsm", tmp);
-Cu.import("resource://gre/modules/NewTabUtils.jsm", tmp);
-Cu.import("resource:///modules/sessionstore/SessionStore.jsm", tmp);
-Cu.import("resource://gre/modules/FileUtils.jsm", tmp);
-Cu.import("resource://gre/modules/osfile.jsm", tmp);
-var {PageThumbs, BackgroundPageThumbs, NewTabUtils, PageThumbsStorage, SessionStore, FileUtils, OS} = tmp;
-
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
- "resource://testing-common/PlacesTestUtils.jsm");
-
-var oldEnabledPref = Services.prefs.getBoolPref("browser.pagethumbnails.capturing_disabled");
-Services.prefs.setBoolPref("browser.pagethumbnails.capturing_disabled", false);
-
-registerCleanupFunction(function () {
- while (gBrowser.tabs.length > 1)
- gBrowser.removeTab(gBrowser.tabs[1]);
- Services.prefs.setBoolPref("browser.pagethumbnails.capturing_disabled", oldEnabledPref)
-});
-
-/**
- * Provide the default test function to start our test runner.
- */
-function test() {
- TestRunner.run();
-}
-
-/**
- * The test runner that controls the execution flow of our tests.
- */
-var TestRunner = {
- /**
- * Starts the test runner.
- */
- run: function () {
- waitForExplicitFinish();
-
- SessionStore.promiseInitialized.then(function () {
- this._iter = runTests();
- if (this._iter) {
- this.next();
- } else {
- finish();
- }
- }.bind(this));
- },
-
- /**
- * Runs the next available test or finishes if there's no test left.
- * @param aValue This value will be passed to the yielder via the runner's
- * iterator.
- */
- next: function (aValue) {
- let obj = TestRunner._iter.next(aValue);
- if (obj.done) {
- finish();
- return;
- }
-
- let value = obj.value || obj;
- if (value && typeof value.then == "function") {
- value.then(result => {
- next(result);
- }, error => {
- ok(false, error + "\n" + error.stack);
- });
- }
- }
-};
-
-/**
- * Continues the current test execution.
- * @param aValue This value will be passed to the yielder via the runner's
- * iterator.
- */
-function next(aValue) {
- TestRunner.next(aValue);
-}
-
-/**
- * Creates a new tab with the given URI.
- * @param aURI The URI that's loaded in the tab.
- * @param aCallback The function to call when the tab has loaded.
- */
-function addTab(aURI, aCallback) {
- let tab = gBrowser.selectedTab = gBrowser.addTab(aURI);
- whenLoaded(tab.linkedBrowser, aCallback);
-}
-
-/**
- * Loads a new URI into the currently selected tab.
- * @param aURI The URI to load.
- */
-function navigateTo(aURI) {
- let browser = gBrowser.selectedBrowser;
- whenLoaded(browser);
- browser.loadURI(aURI);
-}
-
-/**
- * Continues the current test execution when a load event for the given element
- * has been received.
- * @param aElement The DOM element to listen on.
- * @param aCallback The function to call when the load event was dispatched.
- */
-function whenLoaded(aElement, aCallback = next) {
- aElement.addEventListener("load", function onLoad() {
- aElement.removeEventListener("load", onLoad, true);
- executeSoon(aCallback);
- }, true);
-}
-
-/**
- * Captures a screenshot for the currently selected tab, stores it in the cache,
- * retrieves it from the cache and compares pixel color values.
- * @param aRed The red component's intensity.
- * @param aGreen The green component's intensity.
- * @param aBlue The blue component's intensity.
- * @param aMessage The info message to print when comparing the pixel color.
- */
-function captureAndCheckColor(aRed, aGreen, aBlue, aMessage) {
- let browser = gBrowser.selectedBrowser;
- // We'll get oranges if the expiration filter removes the file during the
- // test.
- dontExpireThumbnailURLs([browser.currentURI.spec]);
-
- // Capture the screenshot.
- PageThumbs.captureAndStore(browser, function () {
- retrieveImageDataForURL(browser.currentURI.spec, function ([r, g, b]) {
- is("" + [r, g, b], "" + [aRed, aGreen, aBlue], aMessage);
- next();
- });
- });
-}
-
-/**
- * For a given URL, loads the corresponding thumbnail
- * to a canvas and passes its image data to the callback.
- * Note, not compat with e10s!
- * @param aURL The url associated with the thumbnail.
- * @param aCallback The function to pass the image data to.
- */
-function retrieveImageDataForURL(aURL, aCallback) {
- let width = 100, height = 100;
- let thumb = PageThumbs.getThumbnailURL(aURL, width, height);
-
- let htmlns = "http://www.w3.org/1999/xhtml";
- let img = document.createElementNS(htmlns, "img");
- img.setAttribute("src", thumb);
-
- whenLoaded(img, function () {
- let canvas = document.createElementNS(htmlns, "canvas");
- canvas.setAttribute("width", width);
- canvas.setAttribute("height", height);
-
- // Draw the image to a canvas and compare the pixel color values.
- let ctx = canvas.getContext("2d");
- ctx.drawImage(img, 0, 0, width, height);
- let result = ctx.getImageData(0, 0, 100, 100).data;
- aCallback(result);
- });
-}
-
-/**
- * Returns the file of the thumbnail with the given URL.
- * @param aURL The URL of the thumbnail.
- */
-function thumbnailFile(aURL) {
- return new FileUtils.File(PageThumbsStorage.getFilePathForURL(aURL));
-}
-
-/**
- * Checks if a thumbnail for the given URL exists.
- * @param aURL The url associated to the thumbnail.
- */
-function thumbnailExists(aURL) {
- let file = thumbnailFile(aURL);
- return file.exists() && file.fileSize;
-}
-
-/**
- * Removes the thumbnail for the given URL.
- * @param aURL The URL associated with the thumbnail.
- */
-function removeThumbnail(aURL) {
- let file = thumbnailFile(aURL);
- file.remove(false);
-}
-
-/**
- * Calls addVisits, and then forces the newtab module to repopulate its links.
- * See addVisits for parameter descriptions.
- */
-function addVisitsAndRepopulateNewTabLinks(aPlaceInfo, aCallback) {
- PlacesTestUtils.addVisits(makeURI(aPlaceInfo)).then(() => {
- NewTabUtils.links.populateCache(aCallback, true);
- });
-}
-function promiseAddVisitsAndRepopulateNewTabLinks(aPlaceInfo) {
- return new Promise(resolve => addVisitsAndRepopulateNewTabLinks(aPlaceInfo, resolve));
-}
-
-/**
- * Calls a given callback when the thumbnail for a given URL has been found
- * on disk. Keeps trying until the thumbnail has been created.
- *
- * @param aURL The URL of the thumbnail's page.
- * @param [optional] aCallback
- * Function to be invoked on completion.
- */
-function whenFileExists(aURL, aCallback = next) {
- let callback = aCallback;
- if (!thumbnailExists(aURL)) {
- callback = () => whenFileExists(aURL, aCallback);
- }
-
- executeSoon(callback);
-}
-
-/**
- * Calls a given callback when the given file has been removed.
- * Keeps trying until the file is removed.
- *
- * @param aFile The file that is being removed
- * @param [optional] aCallback
- * Function to be invoked on completion.
- */
-function whenFileRemoved(aFile, aCallback) {
- let callback = aCallback;
- if (aFile.exists()) {
- callback = () => whenFileRemoved(aFile, aCallback);
- }
-
- executeSoon(callback || next);
-}
-
-function wait(aMillis) {
- setTimeout(next, aMillis);
-}
-
-/**
- * Makes sure that a given list of URLs is not implicitly expired.
- *
- * @param aURLs The list of URLs that should not be expired.
- */
-function dontExpireThumbnailURLs(aURLs) {
- let dontExpireURLs = (cb) => cb(aURLs);
- PageThumbs.addExpirationFilter(dontExpireURLs);
-
- registerCleanupFunction(function () {
- PageThumbs.removeExpirationFilter(dontExpireURLs);
- });
-}
-
-function bgCapture(aURL, aOptions) {
- bgCaptureWithMethod("capture", aURL, aOptions);
-}
-
-function bgCaptureIfMissing(aURL, aOptions) {
- bgCaptureWithMethod("captureIfMissing", aURL, aOptions);
-}
-
-function bgCaptureWithMethod(aMethodName, aURL, aOptions = {}) {
- // We'll get oranges if the expiration filter removes the file during the
- // test.
- dontExpireThumbnailURLs([aURL]);
- if (!aOptions.onDone)
- aOptions.onDone = next;
- BackgroundPageThumbs[aMethodName](aURL, aOptions);
-}
-
-function bgTestPageURL(aOpts = {}) {
- let TEST_PAGE_URL = "http://mochi.test:8888/browser/toolkit/components/thumbnails/test/thumbnails_background.sjs";
- return TEST_PAGE_URL + "?" + encodeURIComponent(JSON.stringify(aOpts));
-}
-
-function bgAddPageThumbObserver(url) {
- return new Promise((resolve, reject) => {
- function observe(subject, topic, data) { // jshint ignore:line
- if (data === url) {
- switch (topic) {
- case "page-thumbnail:create":
- resolve();
- break;
- case "page-thumbnail:error":
- reject(new Error("page-thumbnail:error"));
- break;
- }
- Services.obs.removeObserver(observe, "page-thumbnail:create");
- Services.obs.removeObserver(observe, "page-thumbnail:error");
- }
- }
- Services.obs.addObserver(observe, "page-thumbnail:create", false);
- Services.obs.addObserver(observe, "page-thumbnail:error", false);
- });
-}
-
-function bgAddCrashObserver() {
- let crashed = false;
- Services.obs.addObserver(function crashObserver(subject, topic, data) {
- is(topic, 'ipc:content-shutdown', 'Received correct observer topic.');
- ok(subject instanceof Components.interfaces.nsIPropertyBag2,
- 'Subject implements nsIPropertyBag2.');
- // we might see this called as the process terminates due to previous tests.
- // We are only looking for "abnormal" exits...
- if (!subject.hasKey("abnormal")) {
- info("This is a normal termination and isn't the one we are looking for...");
- return;
- }
- Services.obs.removeObserver(crashObserver, 'ipc:content-shutdown');
- crashed = true;
-
- var dumpID;
- if ('nsICrashReporter' in Components.interfaces) {
- dumpID = subject.getPropertyAsAString('dumpID');
- ok(dumpID, "dumpID is present and not an empty string");
- }
-
- if (dumpID) {
- var minidumpDirectory = getMinidumpDirectory();
- removeFile(minidumpDirectory, dumpID + '.dmp');
- removeFile(minidumpDirectory, dumpID + '.extra');
- }
- }, 'ipc:content-shutdown', false);
- return {
- get crashed() {
- return crashed;
- }
- };
-}
-
-function bgInjectCrashContentScript() {
- const TEST_CONTENT_HELPER = "chrome://mochitests/content/browser/toolkit/components/thumbnails/test/thumbnails_crash_content_helper.js";
- let thumbnailBrowser = BackgroundPageThumbs._thumbBrowser;
- let mm = thumbnailBrowser.messageManager;
- mm.loadFrameScript(TEST_CONTENT_HELPER, false);
- return mm;
-}
-
-function getMinidumpDirectory() {
- var dir = Services.dirsvc.get('ProfD', Components.interfaces.nsIFile);
- dir.append("minidumps");
- return dir;
-}
-
-function removeFile(directory, filename) {
- var file = directory.clone();
- file.append(filename);
- if (file.exists()) {
- file.remove(false);
- }
-}
diff --git a/toolkit/components/thumbnails/test/privacy_cache_control.sjs b/toolkit/components/thumbnails/test/privacy_cache_control.sjs
deleted file mode 100644
index 6c7c16edb..000000000
--- a/toolkit/components/thumbnails/test/privacy_cache_control.sjs
+++ /dev/null
@@ -1,16 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-function handleRequest(aRequest, aResponse) {
- // Set HTTP Status
- aResponse.setStatusLine(aRequest.httpVersion, 200, "OK");
-
- // Set Cache-Control header.
- let value = aRequest.queryString;
- if (value)
- aResponse.setHeader("Cache-Control", value);
-
- // Set the response body.
- aResponse.write("<!DOCTYPE html><html><body></body></html>");
-}
diff --git a/toolkit/components/thumbnails/test/test_thumbnails_interfaces.js b/toolkit/components/thumbnails/test/test_thumbnails_interfaces.js
deleted file mode 100644
index a8fe51418..000000000
--- a/toolkit/components/thumbnails/test/test_thumbnails_interfaces.js
+++ /dev/null
@@ -1,25 +0,0 @@
-// tests to check that moz-page-thumb URLs correctly resolve as file:// URLS
-"use strict";
-
-const Cu = Components.utils;
-const Cc = Components.classes;
-const Cr = Components.results;
-const Ci = Components.interfaces;
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-// need profile so that PageThumbsStorage can resolve the path to the underlying file
-do_get_profile();
-
-function run_test() {
- // first check the protocol handler implements the correct interface
- let handler = Services.io.getProtocolHandler("moz-page-thumb");
- ok(handler instanceof Ci.nsISubstitutingProtocolHandler,
- "moz-page-thumb handler provides substituting interface");
-
- // then check that the file URL resolution works
- let uri = Services.io.newURI("moz-page-thumb://thumbnail/?url=http%3A%2F%2Fwww.mozilla.org%2F",
- null, null);
- ok(uri instanceof Ci.nsIFileURL, "moz-page-thumb:// is a FileURL");
- ok(uri.file, "This moz-page-thumb:// object is backed by a file");
-}
diff --git a/toolkit/components/thumbnails/test/thumbnails_background.sjs b/toolkit/components/thumbnails/test/thumbnails_background.sjs
deleted file mode 100644
index f1cce96a0..000000000
--- a/toolkit/components/thumbnails/test/thumbnails_background.sjs
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// The timer never fires if it's not declared and set to this variable outside
-// handleRequest, as if it's getting GC'ed when handleRequest's scope goes away.
-// Shouldn't the timer thread hold a strong reference to it?
-var timer;
-
-function handleRequest(req, resp) {
- resp.processAsync();
- resp.setHeader("Cache-Control", "no-cache, no-store", false);
- resp.setHeader("Content-Type", "text/html;charset=utf-8", false);
-
- let opts = {};
- try {
- opts = JSON.parse(decodeURIComponent(req.queryString));
- }
- catch (err) {}
-
- let setCookieScript = "";
- if (opts.setRedCookie) {
- resp.setHeader("Set-Cookie", "red", false);
- setCookieScript = '<script>document.cookie="red";</script>';
- }
-
- if (opts.setGreenCookie) {
- resp.setHeader("Set-Cookie", "green", false);
- setCookieScript = '<script>document.cookie="green";</script>';
- }
-
- if (opts.iframe) {
- setCookieScript += '<iframe src="' + opts.iframe + '" />';
- }
-
- if (opts.xhr) {
- setCookieScript += `
- <script>
- var req = new XMLHttpRequest();
- req.open("GET", "${opts.xhr}", true);
- req.send();
- </script>
- `;
- }
-
- if (req.hasHeader("Cookie") &&
- req.getHeader("Cookie").split(";").indexOf("red") >= 0) {
- resp.write('<html style="background: #f00;">' + setCookieScript + '</html>');
- resp.finish();
- return;
- }
-
- if (req.hasHeader("Cookie") &&
- req.getHeader("Cookie").split(";").indexOf("green") >= 0) {
- resp.write('<html style="background: #0f0;">' + setCookieScript + '</html>');
- resp.finish();
- return;
- }
-
- if (opts.redirect) {
- resp.setHeader("Location", opts.redirect);
- resp.setStatusLine(null, 303, null);
- resp.finish();
- return;
- }
-
- if (opts.wait) {
- resp.write("Waiting " + opts.wait + " ms... ");
- timer = Components.classes["@mozilla.org/timer;1"].
- createInstance(Components.interfaces.nsITimer);
- timer.init(function ding() {
- resp.write("OK!");
- resp.finish();
- }, opts.wait, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
- return;
- }
-
- resp.write("<pre>" + JSON.stringify(opts, undefined, 2) + "</pre>" + setCookieScript);
- resp.finish();
-}
diff --git a/toolkit/components/thumbnails/test/thumbnails_crash_content_helper.js b/toolkit/components/thumbnails/test/thumbnails_crash_content_helper.js
deleted file mode 100644
index 935175f86..000000000
--- a/toolkit/components/thumbnails/test/thumbnails_crash_content_helper.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-* http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var Cu = Components.utils;
-
-// Ideally we would use CrashTestUtils.jsm, but that's only available for
-// xpcshell tests - so we just copy a ctypes crasher from it.
-Cu.import("resource://gre/modules/ctypes.jsm");
-var crash = function() { // this will crash when called.
- let zero = new ctypes.intptr_t(8);
- let badptr = ctypes.cast(zero, ctypes.PointerType(ctypes.int32_t));
- badptr.contents
-};
-
-
-var TestHelper = {
- init: function() {
- addMessageListener("thumbnails-test:crash", this);
- },
-
- receiveMessage: function(msg) {
- switch (msg.name) {
- case "thumbnails-test:crash":
- privateNoteIntentionalCrash();
- crash();
- break;
- }
- },
-}
-
-TestHelper.init();
diff --git a/toolkit/components/thumbnails/test/thumbnails_update.sjs b/toolkit/components/thumbnails/test/thumbnails_update.sjs
deleted file mode 100644
index 4d8ab406a..000000000
--- a/toolkit/components/thumbnails/test/thumbnails_update.sjs
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// This server-side script is used for browser_thumbnails_update. One of the
-// main things it must do in all cases is ensure a Cache-Control: no-store
-// header, so the foreground capture doesn't interfere with the testing.
-
-// If the querystring is "simple", then all it does it return some content -
-// it doesn't really matter what that content is.
-
-// Otherwise, its main role is that it must return different *content* for the
-// second request than it did for the first.
-// Also, it should be able to return an error response when requested for the
-// second response.
-// So the basic tests will be to grab the thumbnail, then request it to be
-// grabbed again:
-// * If the second request succeeded, the new thumbnail should exist.
-// * If the second request is an error, the new thumbnail should be ignored.
-
-function handleRequest(aRequest, aResponse) {
- aResponse.setHeader("Content-Type", "text/html;charset=utf-8", false);
- // we want to disable gBrowserThumbnails on-load capture for these responses,
- // so set as a "no-store" response.
- aResponse.setHeader("Cache-Control", "no-store");
-
- // for the simple test - just return some content.
- if (aRequest.queryString == "simple") {
- aResponse.write("<html><body></body></html>");
- aResponse.setStatusLine(aRequest.httpVersion, 200, "Its simply OK");
- return;
- }
-
- // it's one of the more complex tests where the first request for the given
- // URL must return different content than the second, and possibly an error
- // response for the second
- let doneError = getState(aRequest.queryString);
- if (!doneError) {
- // first request - return a response with a green body and 200 response.
- aResponse.setStatusLine(aRequest.httpVersion, 200, "OK - It's green");
- aResponse.write("<html><body bgcolor=00ff00></body></html>");
- // set the state so the next request does the "second request" thing below.
- setState(aRequest.queryString, "yep");
- } else {
- // second request - this will be done by the b/g service.
- // We always return a red background, but depending on the query string we
- // return either a 200 or 401 response.
- if (aRequest.queryString == "fail")
- aResponse.setStatusLine(aRequest.httpVersion, 401, "Oh no you don't");
- else
- aResponse.setStatusLine(aRequest.httpVersion, 200, "OK - It's red");
- aResponse.write("<html><body bgcolor=ff0000></body></html>");
- // reset the error state incase this ends up being reused for the
- // same url and querystring.
- setState(aRequest.queryString, "");
- }
-}
diff --git a/toolkit/components/thumbnails/test/xpcshell.ini b/toolkit/components/thumbnails/test/xpcshell.ini
deleted file mode 100644
index 4dae8cced..000000000
--- a/toolkit/components/thumbnails/test/xpcshell.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-head =
-tail =
-
-[test_thumbnails_interfaces.js]
-skip-if = os == 'android' # xpcom interface not packaged
diff --git a/toolkit/components/timermanager/moz.build b/toolkit/components/timermanager/moz.build
index 9977df6b5..81ef3330b 100644
--- a/toolkit/components/timermanager/moz.build
+++ b/toolkit/components/timermanager/moz.build
@@ -6,16 +6,9 @@
XPIDL_MODULE = 'update'
-XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
-
-XPIDL_SOURCES += [
- 'nsIUpdateTimerManager.idl',
-]
+XPIDL_SOURCES += ['nsIUpdateTimerManager.idl']
EXTRA_COMPONENTS += [
'nsUpdateTimerManager.js',
'nsUpdateTimerManager.manifest',
]
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Application Update')
diff --git a/toolkit/components/timermanager/tests/unit/.eslintrc.js b/toolkit/components/timermanager/tests/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/timermanager/tests/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/timermanager/tests/unit/consumerNotifications.js b/toolkit/components/timermanager/tests/unit/consumerNotifications.js
deleted file mode 100644
index b9926e11e..000000000
--- a/toolkit/components/timermanager/tests/unit/consumerNotifications.js
+++ /dev/null
@@ -1,519 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Update Timer Manager Tests */
-
-'use strict';
-
-const { classes: Cc, interfaces: Ci, manager: Cm, results: Cr,
- utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const CATEGORY_UPDATE_TIMER = "update-timer";
-
-const PREF_APP_UPDATE_TIMERMINIMUMDELAY = "app.update.timerMinimumDelay";
-const PREF_APP_UPDATE_TIMERFIRSTINTERVAL = "app.update.timerFirstInterval";
-const PREF_APP_UPDATE_LOG_ALL = "app.update.log.all";
-const PREF_BRANCH_LAST_UPDATE_TIME = "app.update.lastUpdateTime.";
-
-const MAIN_TIMER_INTERVAL = 1000; // milliseconds
-const CONSUMER_TIMER_INTERVAL = 1; // seconds
-
-const TESTS = [ {
- desc: "Test Timer Callback 0",
- timerID: "test0-update-timer",
- defaultInterval: "bogus",
- prefInterval: "test0.timer.interval",
- contractID: "@mozilla.org/test0/timercallback;1",
- method: "createInstance",
- classID: Components.ID("9c7ce81f-98bb-4729-adb4-4d0deb0f59e5"),
- notified: false
-}, {
- desc: "Test Timer Callback 1",
- timerID: "test1-update-timer",
- defaultInterval: 86400,
- prefInterval: "test1.timer.interval",
- contractID: "@mozilla.org/test2/timercallback;1",
- method: "createInstance",
- classID: Components.ID("512834f3-05bb-46be-84e0-81d881a140b7"),
- notified: false
-}, {
- desc: "Test Timer Callback 2",
- timerID: "test2-update-timer",
- defaultInterval: CONSUMER_TIMER_INTERVAL,
- prefInterval: "test2.timer.interval",
- contractID: "@mozilla.org/test2/timercallback;1",
- method: "createInstance",
- classID: Components.ID("c8ac5027-8d11-4471-9d7c-fd692501b437"),
- notified: false
-}, {
- desc: "Test Timer Callback 3",
- timerID: "test3-update-timer",
- defaultInterval: CONSUMER_TIMER_INTERVAL,
- prefInterval: "test3.timer.interval",
- contractID: "@mozilla.org/test3/timercallback;1",
- method: "createInstance",
- classID: Components.ID("6b0e79f3-4ab8-414c-8f14-dde10e185727"),
- notified: false
-}, {
- desc: "Test Timer Callback 4",
- timerID: "test4-update-timer",
- defaultInterval: CONSUMER_TIMER_INTERVAL,
- prefInterval: "test4.timer.interval",
- contractID: "@mozilla.org/test4/timercallback;1",
- method: "createInstance",
- classID: Components.ID("2f6b7b92-e40f-4874-bfbb-eeb2412c959d"),
- notified: false
-}, {
- desc: "Test Timer Callback 5",
- timerID: "test5-update-timer",
- defaultInterval: 86400,
- prefInterval: "test5.timer.interval",
- contractID: "@mozilla.org/test5/timercallback;1",
- method: "createInstance",
- classID: Components.ID("8a95f611-b2ac-4c7e-8b73-9748c4839731"),
- notified: false
-}, {
- desc: "Test Timer Callback 6",
- timerID: "test6-update-timer",
- defaultInterval: CONSUMER_TIMER_INTERVAL,
- prefInterval: "test6.timer.interval",
- contractID: "@mozilla.org/test6/timercallback;1",
- method: "createInstance",
- classID: Components.ID("2d091020-e23c-11e2-a28f-0800200c9a66"),
- notified: false
-}, {
- desc: "Test Timer Callback 7",
- timerID: "test7-update-timer",
- defaultInterval: 86400,
- maxInterval: CONSUMER_TIMER_INTERVAL,
- prefInterval: "test7.timer.interval",
- contractID: "@mozilla.org/test7/timercallback;1",
- method: "createInstance",
- classID: Components.ID("8e8633ae-1d70-4a7a-8bea-6e1e6c5d7742"),
- notified: false
-}, {
- desc: "Test Timer Callback 8",
- timerID: "test8-update-timer",
- defaultInterval: CONSUMER_TIMER_INTERVAL,
- contractID: "@mozilla.org/test8/timercallback;1",
- classID: Components.ID("af878d4b-1d12-41f6-9a90-4e687367ecc1"),
- notified: false,
- lastUpdateTime: 0
-}, {
- desc: "Test Timer Callback 9",
- timerID: "test9-update-timer",
- defaultInterval: CONSUMER_TIMER_INTERVAL,
- contractID: "@mozilla.org/test9/timercallback;1",
- classID: Components.ID("5136b201-d64c-4328-8cf1-1a63491cc117"),
- notified: false,
- lastUpdateTime: 0
-} ];
-
-var gUTM;
-var gNextFunc;
-
-XPCOMUtils.defineLazyServiceGetter(this, "gPref",
- "@mozilla.org/preferences-service;1",
- "nsIPrefBranch");
-
-XPCOMUtils.defineLazyServiceGetter(this, "gCatMan",
- "@mozilla.org/categorymanager;1",
- "nsICategoryManager");
-
-XPCOMUtils.defineLazyGetter(this, "gCompReg", function () {
- return Cm.QueryInterface(Ci.nsIComponentRegistrar);
-});
-
-const gTest0TimerCallback = {
- notify: function T0CB_notify(aTimer) {
- // This can happen when another notification fails and this timer having
- // time to fire so check other timers are successful.
- do_throw("gTest0TimerCallback notify method should not have been called");
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
-};
-
-const gTest0Factory = {
- createInstance: function T0F_createInstance(aOuter, aIID) {
- if (aOuter == null) {
- return gTest0TimerCallback.QueryInterface(aIID);
- }
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
-};
-
-const gTest1TimerCallback = {
- notify: function T1CB_notify(aTimer) {
- // This can happen when another notification fails and this timer having
- // time to fire so check other timers are successful.
- do_throw("gTest1TimerCallback notify method should not have been called");
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITimer])
-};
-
-const gTest1Factory = {
- createInstance: function T1F_createInstance(aOuter, aIID) {
- if (aOuter == null) {
- return gTest1TimerCallback.QueryInterface(aIID);
- }
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
-};
-
-const gTest2TimerCallback = {
- notify: function T2CB_notify(aTimer) {
- // This can happen when another notification fails and this timer having
- // time to fire so check other timers are successful.
- do_throw("gTest2TimerCallback notify method should not have been called");
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
-};
-
-const gTest2Factory = {
- createInstance: function T2F_createInstance(aOuter, aIID) {
- if (aOuter == null) {
- return gTest2TimerCallback.QueryInterface(aIID);
- }
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
-};
-
-const gTest3TimerCallback = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
-};
-
-const gTest3Factory = {
- createInstance: function T3F_createInstance(aOuter, aIID) {
- if (aOuter == null) {
- return gTest3TimerCallback.QueryInterface(aIID);
- }
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
-};
-
-const gTest4TimerCallback = {
- notify: function T4CB_notify(aTimer) {
- gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[4].desc, true);
- TESTS[4].notified = true;
- finished_test0thru7();
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
-};
-
-const gTest4Factory = {
- createInstance: function T4F_createInstance(aOuter, aIID) {
- if (aOuter == null) {
- return gTest4TimerCallback.QueryInterface(aIID);
- }
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
-};
-
-const gTest5TimerCallback = {
- notify: function T5CB_notify(aTimer) {
- gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[5].desc, true);
- TESTS[5].notified = true;
- finished_test0thru7();
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
-};
-
-const gTest5Factory = {
- createInstance: function T5F_createInstance(aOuter, aIID) {
- if (aOuter == null) {
- return gTest5TimerCallback.QueryInterface(aIID);
- }
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
-};
-
-const gTest6TimerCallback = {
- notify: function T6CB_notify(aTimer) {
- gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[6].desc, true);
- TESTS[6].notified = true;
- finished_test0thru7();
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
-};
-
-const gTest6Factory = {
- createInstance: function T6F_createInstance(aOuter, aIID) {
- if (aOuter == null) {
- return gTest6TimerCallback.QueryInterface(aIID);
- }
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
-};
-
-const gTest7TimerCallback = {
- notify: function T7CB_notify(aTimer) {
- gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[7].desc, true);
- TESTS[7].notified = true;
- finished_test0thru7();
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
-};
-
-const gTest7Factory = {
- createInstance: function T7F_createInstance(aOuter, aIID) {
- if (aOuter == null) {
- return gTest7TimerCallback.QueryInterface(aIID);
- }
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
-};
-
-const gTest8TimerCallback = {
- notify: function T8CB_notify(aTimer) {
- TESTS[8].notified = true;
- TESTS[8].notifyTime = Date.now();
- do_execute_soon(function () {
- check_test8thru9(gTest8TimerCallback);
- });
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
-};
-
-const gTest8Factory = {
- createInstance: function T8F_createInstance(aOuter, aIID) {
- if (aOuter == null) {
- return gTest8TimerCallback.QueryInterface(aIID);
- }
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
-};
-
-const gTest9TimerCallback = {
- notify: function T9CB_notify(aTimer) {
- TESTS[9].notified = true;
- TESTS[9].notifyTime = Date.now();
- do_execute_soon(function () {
- check_test8thru9(gTest9TimerCallback);
- });
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
-};
-
-const gTest9Factory = {
- createInstance: function T9F_createInstance(aOuter, aIID) {
- if (aOuter == null) {
- return gTest9TimerCallback.QueryInterface(aIID);
- }
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
-};
-
-function run_test() {
- do_test_pending();
-
- // Set the timer to fire every second
- gPref.setIntPref(PREF_APP_UPDATE_TIMERMINIMUMDELAY, MAIN_TIMER_INTERVAL / 1000);
- gPref.setIntPref(PREF_APP_UPDATE_TIMERFIRSTINTERVAL, MAIN_TIMER_INTERVAL);
- gPref.setBoolPref(PREF_APP_UPDATE_LOG_ALL, true);
-
- // Remove existing update timers to prevent them from being notified
- let entries = gCatMan.enumerateCategory(CATEGORY_UPDATE_TIMER);
- while (entries.hasMoreElements()) {
- let entry = entries.getNext().QueryInterface(Ci.nsISupportsCString).data;
- gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, entry, false);
- }
-
- gUTM = Cc["@mozilla.org/updates/timer-manager;1"].
- getService(Ci.nsIUpdateTimerManager).
- QueryInterface(Ci.nsIObserver);
- gUTM.observe(null, "utm-test-init", "");
-
- do_execute_soon(run_test0thru7);
-}
-
-function end_test() {
- gUTM.observe(null, "xpcom-shutdown", "");
- do_test_finished();
-}
-
-function run_test0thru7() {
- gNextFunc = check_test0thru7;
- // bogus default interval
- gCompReg.registerFactory(TESTS[0].classID, TESTS[0].desc,
- TESTS[0].contractID, gTest0Factory);
- gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[0].desc,
- [TESTS[0].contractID, TESTS[0].method,
- TESTS[0].timerID, TESTS[0].prefInterval,
- TESTS[0].defaultInterval].join(","), false, true);
-
- // doesn't implement nsITimerCallback
- gCompReg.registerFactory(TESTS[1].classID, TESTS[1].desc,
- TESTS[1].contractID, gTest1Factory);
- gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[1].desc,
- [TESTS[1].contractID, TESTS[1].method,
- TESTS[1].timerID, TESTS[1].prefInterval,
- TESTS[1].defaultInterval].join(","), false, true);
-
- // has a last update time of now - 43200 which is half of its interval
- let lastUpdateTime = Math.round(Date.now() / 1000) - 43200;
- gPref.setIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[2].timerID, lastUpdateTime);
- gCompReg.registerFactory(TESTS[2].classID, TESTS[2].desc,
- TESTS[2].contractID, gTest2Factory);
- gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[2].desc,
- [TESTS[2].contractID, TESTS[2].method,
- TESTS[2].timerID, TESTS[2].prefInterval,
- TESTS[2].defaultInterval].join(","), false, true);
-
- // doesn't have a notify method
- gCompReg.registerFactory(TESTS[3].classID, TESTS[3].desc,
- TESTS[3].contractID, gTest3Factory);
- gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[3].desc,
- [TESTS[3].contractID, TESTS[3].method,
- TESTS[3].timerID, TESTS[3].prefInterval,
- TESTS[3].defaultInterval].join(","), false, true);
-
- // already has a last update time
- gPref.setIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[4].timerID, 1);
- gCompReg.registerFactory(TESTS[4].classID, TESTS[4].desc,
- TESTS[4].contractID, gTest4Factory);
- gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[4].desc,
- [TESTS[4].contractID, TESTS[4].method,
- TESTS[4].timerID, TESTS[4].prefInterval,
- TESTS[4].defaultInterval].join(","), false, true);
-
- // has an interval preference that overrides the default
- gPref.setIntPref(TESTS[5].prefInterval, CONSUMER_TIMER_INTERVAL);
- gCompReg.registerFactory(TESTS[5].classID, TESTS[5].desc,
- TESTS[5].contractID, gTest5Factory);
- gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[5].desc,
- [TESTS[5].contractID, TESTS[5].method,
- TESTS[5].timerID, TESTS[5].prefInterval,
- TESTS[5].defaultInterval].join(","), false, true);
-
- // has a next update time 24 hours from now
- let nextUpdateTime = Math.round(Date.now() / 1000) + 86400;
- gPref.setIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[6].timerID, nextUpdateTime);
- gCompReg.registerFactory(TESTS[6].classID, TESTS[6].desc,
- TESTS[6].contractID, gTest6Factory);
- gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[6].desc,
- [TESTS[6].contractID, TESTS[6].method,
- TESTS[6].timerID, TESTS[6].prefInterval,
- TESTS[6].defaultInterval].join(","), false, true);
-
- // has a maximum interval set by the value of MAIN_TIMER_INTERVAL
- gPref.setIntPref(TESTS[7].prefInterval, 86400);
- gCompReg.registerFactory(TESTS[7].classID, TESTS[7].desc,
- TESTS[7].contractID, gTest7Factory);
- gCatMan.addCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[7].desc,
- [TESTS[7].contractID, TESTS[7].method,
- TESTS[7].timerID, TESTS[7].prefInterval,
- TESTS[7].defaultInterval,
- TESTS[7].maxInterval].join(","), false, true);
-}
-
-function finished_test0thru7() {
- if (TESTS[4].notified && TESTS[5].notified && TESTS[6].notified && TESTS[7].notified) {
- do_execute_soon(gNextFunc);
- }
-}
-
-function check_test0thru7() {
- Assert.ok(!TESTS[0].notified,
- "a category registered timer didn't fire due to an invalid " +
- "default interval");
-
- Assert.ok(!TESTS[1].notified,
- "a category registered timer didn't fire due to not implementing " +
- "nsITimerCallback");
-
- Assert.ok(!TESTS[2].notified,
- "a category registered timer didn't fire due to the next update " +
- "time being in the future");
-
- Assert.ok(!TESTS[3].notified,
- "a category registered timer didn't fire due to not having a " +
- "notify method");
-
- Assert.ok(TESTS[4].notified,
- "a category registered timer has fired");
-
- Assert.ok(TESTS[5].notified,
- "a category registered timer fired that has an interval " +
- "preference that overrides a default that wouldn't have fired yet");
-
- Assert.ok(TESTS[6].notified,
- "a category registered timer has fired due to the next update " +
- "time being reset due to a future last update time");
-
- Assert.ok(gPref.prefHasUserValue(PREF_BRANCH_LAST_UPDATE_TIME +
- TESTS[4].timerID),
- "first of two category registered timers last update time has " +
- "a user value");
- Assert.ok(gPref.prefHasUserValue(PREF_BRANCH_LAST_UPDATE_TIME +
- TESTS[5].timerID),
- "second of two category registered timers last update time has " +
- "a user value");
-
- // Remove the category timers that should have failed
- gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[0].desc, true);
- gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[1].desc, true);
- gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[2].desc, true);
- gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, TESTS[3].desc, true);
- let entries = gCatMan.enumerateCategory(CATEGORY_UPDATE_TIMER);
- while (entries.hasMoreElements()) {
- let entry = entries.getNext().QueryInterface(Ci.nsISupportsCString).data;
- gCatMan.deleteCategoryEntry(CATEGORY_UPDATE_TIMER, entry, false);
- }
-
- entries = gCatMan.enumerateCategory(CATEGORY_UPDATE_TIMER);
- Assert.ok(!entries.hasMoreElements(),
- "no " + CATEGORY_UPDATE_TIMER + " categories should still be " +
- "registered");
-
- do_execute_soon(run_test8thru9);
-}
-
-function run_test8thru9() {
- gPref.setIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[8].timerID, 1);
- gCompReg.registerFactory(TESTS[8].classID, TESTS[8].desc,
- TESTS[8].contractID, gTest8Factory);
- gUTM.registerTimer(TESTS[8].timerID, gTest8TimerCallback,
- TESTS[8].defaultInterval);
- gPref.setIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[9].timerID, 1);
- gCompReg.registerFactory(TESTS[9].classID, TESTS[9].desc,
- TESTS[9].contractID, gTest9Factory);
- gUTM.registerTimer(TESTS[9].timerID, gTest9TimerCallback,
- TESTS[9].defaultInterval);
-}
-
-function check_test8thru9(aTestTimerCallback) {
- aTestTimerCallback.timesCalled = (aTestTimerCallback.timesCalled || 0) + 1;
- if (aTestTimerCallback.timesCalled < 2) {
- return;
- }
-
- Assert.ok(TESTS[8].notified,
- "first registerTimer registered timer should have fired");
-
- Assert.ok(TESTS[9].notified,
- "second registerTimer registered timer should have fired");
-
- // Check that 'staggering' has happened: even though the two events wanted to fire at
- // the same time, we waited a full MAIN_TIMER_INTERVAL between them.
- // (to avoid sensitivity to random timing issues, we fudge by a factor of 0.5 here)
- Assert.ok(Math.abs(TESTS[8].notifyTime - TESTS[9].notifyTime) >=
- MAIN_TIMER_INTERVAL * 0.5,
- "staggering between two timers that want to fire at the same " +
- "time should have occured");
-
- let time = gPref.getIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[8].timerID);
- Assert.notEqual(time, 1,
- "first registerTimer registered timer last update time " +
- "should have been updated");
-
- time = gPref.getIntPref(PREF_BRANCH_LAST_UPDATE_TIME + TESTS[9].timerID);
- Assert.notEqual(time, 1,
- "second registerTimer registered timer last update time " +
- "should have been updated");
-
- end_test();
-}
diff --git a/toolkit/components/timermanager/tests/unit/xpcshell.ini b/toolkit/components/timermanager/tests/unit/xpcshell.ini
deleted file mode 100644
index 89e192e94..000000000
--- a/toolkit/components/timermanager/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,9 +0,0 @@
-; This Source Code Form is subject to the terms of the Mozilla Public
-; License, v. 2.0. If a copy of the MPL was not distributed with this
-; file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-[DEFAULT]
-head =
-tail =
-
-[consumerNotifications.js]
diff --git a/toolkit/components/tooltiptext/moz.build b/toolkit/components/tooltiptext/moz.build
index c75e6b7a4..3c5702ca4 100644
--- a/toolkit/components/tooltiptext/moz.build
+++ b/toolkit/components/tooltiptext/moz.build
@@ -4,12 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-BROWSER_CHROME_MANIFESTS += ['tests/browser.ini']
-
EXTRA_COMPONENTS += [
'TooltipTextProvider.js',
'TooltipTextProvider.manifest',
]
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'General')
diff --git a/toolkit/components/tooltiptext/tests/browser.ini b/toolkit/components/tooltiptext/tests/browser.ini
deleted file mode 100644
index 9896fcd2c..000000000
--- a/toolkit/components/tooltiptext/tests/browser.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[browser_bug329212.js]
-support-files = title_test.svg
-[browser_bug331772_xul_tooltiptext_in_html.js]
-support-files = xul_tooltiptext.xhtml
-[browser_bug561623.js]
-[browser_bug581947.js]
-[browser_input_file_tooltips.js]
diff --git a/toolkit/components/tooltiptext/tests/browser_bug329212.js b/toolkit/components/tooltiptext/tests/browser_bug329212.js
deleted file mode 100644
index b3434eff6..000000000
--- a/toolkit/components/tooltiptext/tests/browser_bug329212.js
+++ /dev/null
@@ -1,35 +0,0 @@
-"use strict";
-
-add_task(function*() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "http://mochi.test:8888/browser/toolkit/components/tooltiptext/tests/title_test.svg",
- }, function*(browser) {
- yield ContentTask.spawn(browser, "", function() {
- let tttp = Cc["@mozilla.org/embedcomp/default-tooltiptextprovider;1"]
- .getService(Ci.nsITooltipTextProvider);
- function checkElement(id, expectedTooltipText) {
- let el = content.document.getElementById(id);
- let textObj = {};
- let shouldHaveTooltip = expectedTooltipText !== null;
- is(tttp.getNodeText(el, textObj, {}), shouldHaveTooltip,
- "element " + id + " should " + (shouldHaveTooltip ? "" : "not ") + "have a tooltip");
- if (shouldHaveTooltip) {
- is(textObj.value, expectedTooltipText,
- "element " + id + " should have the right tooltip text");
- }
- }
- checkElement("svg1", "This is a non-root SVG element title");
- checkElement("text1", "\n\n\n This is a title\n\n ");
- checkElement("text2", null);
- checkElement("text3", null);
- checkElement("link1", "\n This is a title\n ");
- checkElement("text4", "\n This is a title\n ");
- checkElement("link2", null);
- checkElement("link3", "This is an xlink:title attribute");
- checkElement("link4", "This is an xlink:title attribute");
- checkElement("text5", null);
- });
- });
-});
-
diff --git a/toolkit/components/tooltiptext/tests/browser_bug331772_xul_tooltiptext_in_html.js b/toolkit/components/tooltiptext/tests/browser_bug331772_xul_tooltiptext_in_html.js
deleted file mode 100644
index 23d8c4a6e..000000000
--- a/toolkit/components/tooltiptext/tests/browser_bug331772_xul_tooltiptext_in_html.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * Tests that the tooltiptext attribute is used for XUL elements in an HTML doc.
- */
-add_task(function*() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "http://mochi.test:8888/browser/toolkit/components/tooltiptext/tests/xul_tooltiptext.xhtml",
- }, function*(browser) {
- yield ContentTask.spawn(browser, "", function() {
- let textObj = {};
- let tttp = Cc["@mozilla.org/embedcomp/default-tooltiptextprovider;1"]
- .getService(Ci.nsITooltipTextProvider);
- let xulToolbarButton = content.document.getElementById("xulToolbarButton");
- ok(tttp.getNodeText(xulToolbarButton, textObj, {}), "should get tooltiptext");
- is(textObj.value, "XUL tooltiptext");
- });
- });
-});
-
diff --git a/toolkit/components/tooltiptext/tests/browser_bug561623.js b/toolkit/components/tooltiptext/tests/browser_bug561623.js
deleted file mode 100644
index 49c51c4ba..000000000
--- a/toolkit/components/tooltiptext/tests/browser_bug561623.js
+++ /dev/null
@@ -1,24 +0,0 @@
-add_task(function*() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "data:text/html,<!DOCTYPE html><html><body><input id='i'></body></html>",
- }, function*(browser) {
- yield ContentTask.spawn(browser, "", function() {
- let tttp = Cc["@mozilla.org/embedcomp/default-tooltiptextprovider;1"]
- .getService(Ci.nsITooltipTextProvider);
- let i = content.document.getElementById("i");
-
- ok(!tttp.getNodeText(i, {}, {}),
- "No tooltip should be shown when @title is null");
-
- i.title = "foo";
- ok(tttp.getNodeText(i, {}, {}),
- "A tooltip should be shown when @title is not the empty string");
-
- i.pattern = "bar";
- ok(tttp.getNodeText(i, {}, {}),
- "A tooltip should be shown when @title is not the empty string");
- });
- });
-});
-
diff --git a/toolkit/components/tooltiptext/tests/browser_bug581947.js b/toolkit/components/tooltiptext/tests/browser_bug581947.js
deleted file mode 100644
index 034e0a4d1..000000000
--- a/toolkit/components/tooltiptext/tests/browser_bug581947.js
+++ /dev/null
@@ -1,87 +0,0 @@
-function check(aBrowser, aElementName, aBarred, aType) {
- return ContentTask.spawn(aBrowser, [aElementName, aBarred, aType], function*([aElementName, aBarred, aType]) {
- let e = content.document.createElement(aElementName);
- let contentElement = content.document.getElementById('content');
- contentElement.appendChild(e);
-
- if (aType) {
- e.type = aType;
- }
-
- let tttp = Cc["@mozilla.org/embedcomp/default-tooltiptextprovider;1"]
- .getService(Ci.nsITooltipTextProvider);
- ok(!tttp.getNodeText(e, {}, {}),
- "No tooltip should be shown when the element is valid");
-
- e.setCustomValidity('foo');
- if (aBarred) {
- ok(!tttp.getNodeText(e, {}, {}),
- "No tooltip should be shown when the element is barred from constraint validation");
- } else {
- ok(tttp.getNodeText(e, {}, {}),
- e.tagName + " " +"A tooltip should be shown when the element isn't valid");
- }
-
- e.setAttribute('title', '');
- ok (!tttp.getNodeText(e, {}, {}),
- "No tooltip should be shown if the title attribute is set");
-
- e.removeAttribute('title');
- contentElement.setAttribute('novalidate', '');
- ok (!tttp.getNodeText(e, {}, {}),
- "No tooltip should be shown if the novalidate attribute is set on the form owner");
- contentElement.removeAttribute('novalidate');
-
- e.remove();
- });
-}
-
-function todo_check(aBrowser, aElementName, aBarred) {
- return ContentTask.spawn(aBrowser, [aElementName, aBarred], function*([aElementName, aBarred]) {
- let e = content.document.createElement(aElementName);
- let contentElement = content.document.getElementById('content');
- contentElement.appendChild(e);
-
- let caught = false;
- try {
- e.setCustomValidity('foo');
- } catch (e) {
- caught = true;
- }
-
- todo(!caught, "setCustomValidity should exist for " + aElementName);
-
- e.remove();
- });
-}
-
-add_task(function*() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "data:text/html,<!DOCTYPE html><html><body><form id='content'></form></body></html>",
- }, function*(browser) {
- let testData = [
- /* element name, barred */
- [ 'input', false, null],
- [ 'textarea', false, null],
- [ 'button', true, 'button'],
- [ 'button', false, 'submit'],
- [ 'select', false, null],
- [ 'output', true, null],
- [ 'fieldset', true, null],
- [ 'object', true, null],
- ];
-
- for (let data of testData) {
- yield check(browser, data[0], data[1], data[2]);
- }
-
- let todo_testData = [
- [ 'keygen', 'false' ],
- ];
-
- for (let data of todo_testData) {
- yield todo_check(browser, data[0], data[1]);
- }
- });
-});
diff --git a/toolkit/components/tooltiptext/tests/browser_input_file_tooltips.js b/toolkit/components/tooltiptext/tests/browser_input_file_tooltips.js
deleted file mode 100644
index a1323095d..000000000
--- a/toolkit/components/tooltiptext/tests/browser_input_file_tooltips.js
+++ /dev/null
@@ -1,122 +0,0 @@
-
-let tempFile;
-add_task(function* setup() {
- yield new Promise(resolve => {
- SpecialPowers.pushPrefEnv({"set": [["ui.tooltipDelay", 0]]}, resolve);
- });
- tempFile = createTempFile();
- registerCleanupFunction(function() {
- tempFile.remove(true);
- });
-});
-
-add_task(function* test_singlefile_selected() {
- yield do_test({value: true, result: "testfile_bug1251809"});
-});
-
-add_task(function* test_title_set() {
- yield do_test({title: "foo", result: "foo"});
-});
-
-add_task(function* test_nofile_selected() {
- yield do_test({result: "No file selected."});
-});
-
-add_task(function* test_multipleset_nofile_selected() {
- yield do_test({multiple: true, result: "No files selected."});
-});
-
-add_task(function* test_requiredset() {
- yield do_test({required: true, result: "Please select a file."});
-});
-
-function* do_test(test) {
- info(`starting test ${JSON.stringify(test)}`);
-
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser);
-
- info("Moving mouse out of the way.");
- yield new Promise(resolve => {
- EventUtils.synthesizeNativeMouseMove(tab.linkedBrowser, 300, 300, resolve);
- });
-
- info("creating input field");
- yield ContentTask.spawn(tab.linkedBrowser, test, function*(test) {
- let doc = content.document;
- let input = doc.createElement("input");
- doc.body.appendChild(input);
- input.id = "test_input";
- input.setAttribute("style", "position: absolute; top: 0; left: 0;");
- input.type = "file";
- if (test.title) {
- input.setAttribute("title", test.title);
- }
- if (test.multiple) {
- input.multiple = true;
- }
- if (test.required) {
- input.required = true;
- }
- });
-
- if (test.value) {
- info("Creating mock filepicker to select files");
- let MockFilePicker = SpecialPowers.MockFilePicker;
- MockFilePicker.init(window);
- MockFilePicker.returnValue = MockFilePicker.returnOK;
- MockFilePicker.displayDirectory = FileUtils.getDir("TmpD", [], false);
- MockFilePicker.returnFiles = [tempFile];
-
- try {
- // Open the File Picker dialog (MockFilePicker) to select
- // the files for the test.
- yield BrowserTestUtils.synthesizeMouseAtCenter("#test_input", {}, tab.linkedBrowser);
- info("Waiting for the input to have the requisite files");
- yield ContentTask.spawn(tab.linkedBrowser, {}, function*() {
- let input = content.document.querySelector("#test_input");
- yield ContentTaskUtils.waitForCondition(() => input.files.length,
- "The input should have at least one file selected");
- info(`The input has ${input.files.length} file(s) selected.`);
- });
- } finally {
- MockFilePicker.cleanup();
- }
- } else {
- info("No real file selection required.");
- }
-
- let awaitTooltipOpen = new Promise(resolve => {
- let tooltipId = Services.appinfo.browserTabsRemoteAutostart ?
- "remoteBrowserTooltip" :
- "aHTMLTooltip";
- let tooltip = document.getElementById(tooltipId);
- tooltip.addEventListener("popupshown", function onpopupshown(event) {
- tooltip.removeEventListener("popupshown", onpopupshown);
- resolve(event.target);
- });
- });
- info("Initial mouse move");
- yield new Promise(resolve => {
- EventUtils.synthesizeNativeMouseMove(tab.linkedBrowser, 50, 5, resolve);
- });
- info("Waiting");
- yield new Promise(resolve => setTimeout(resolve, 400));
- info("Second mouse move");
- yield new Promise(resolve => {
- EventUtils.synthesizeNativeMouseMove(tab.linkedBrowser, 70, 5, resolve);
- });
- info("Waiting for tooltip to open");
- let tooltip = yield awaitTooltipOpen;
-
- is(tooltip.getAttribute("label"), test.result, "tooltip label should match expectation");
-
- info("Closing tab");
- yield BrowserTestUtils.removeTab(tab);
-}
-
-function createTempFile() {
- let file = FileUtils.getDir("TmpD", [], false);
- file.append("testfile_bug1251809");
- file.create(Ci.nsIFile.NORMAL_FILE_TYPE, 0o644);
- return file;
-}
diff --git a/toolkit/components/tooltiptext/tests/title_test.svg b/toolkit/components/tooltiptext/tests/title_test.svg
deleted file mode 100644
index 7638fd5cc..000000000
--- a/toolkit/components/tooltiptext/tests/title_test.svg
+++ /dev/null
@@ -1,59 +0,0 @@
-<svg width="640px" height="480px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
- <title>This is a root SVG element's title</title>
- <foreignObject>
- <html xmlns="http://www.w3.org/1999/xhtml">
- <body>
- <svg xmlns="http://www.w3.org/2000/svg" id="svg1">
- <title>This is a non-root SVG element title</title>
- </svg>
- </body>
- </html>
- </foreignObject>
- <text id="text1" x="10px" y="32px" font-size="24px">
- This contains only &lt;title&gt;
- <title>
-
-
- This is a title
-
- </title>
- </text>
- <text id="text2" x="10px" y="96px" font-size="24px">
- This contains only &lt;desc&gt;
- <desc>This is a desc</desc>
- </text>
- <text id="text3" x="10px" y="128px" font-size="24px" title="ignored for SVG">
- This contains nothing.
- </text>
- <a id="link1" xlink:href="#">
- This link contains &lt;title&gt;
- <title>
- This is a title
- </title>
- <text id="text4" x="10px" y="192px" font-size="24px">
- </text>
- </a>
- <a id="link2" xlink:href="#">
- <text x="10px" y="192px" font-size="24px">
- This text contains &lt;title&gt;
- <title>
- This is a title
- </title>
- </text>
- </a>
- <a id="link3" xlink:href="#" xlink:title="This is an xlink:title attribute">
- <text x="10px" y="224px" font-size="24px">
- This link contains &lt;title&gt; &amp; xlink:title attr.
- <title>This is a title</title>
- </text>
- </a>
- <a id="link4" xlink:href="#" xlink:title="This is an xlink:title attribute">
- <text x="10px" y="256px" font-size="24px">
- This link contains xlink:title attr.
- </text>
- </a>
- <text id="text5" x="10px" y="160px" font-size="24px"
- xlink:title="This is an xlink:title attribute but it isn't on a link" >
- This contains nothing.
- </text>
-</svg>
diff --git a/toolkit/components/tooltiptext/tests/xul_tooltiptext.xhtml b/toolkit/components/tooltiptext/tests/xul_tooltiptext.xhtml
deleted file mode 100644
index 4a80864dd..000000000
--- a/toolkit/components/tooltiptext/tests/xul_tooltiptext.xhtml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0"?>
-<html xmlns="http://www.w3.org/1999/xhtml"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <xul:toolbox xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <toolbar>
- <toolbarbutton id="xulToolbarButton"
- tooltiptext="XUL tooltiptext"
- title="XUL title"/>
- </toolbar>
- </xul:toolbox>
-</html>
-
-
diff --git a/toolkit/components/url-classifier/moz.build b/toolkit/components/url-classifier/moz.build
index d8856ee4a..b6e630abd 100644
--- a/toolkit/components/url-classifier/moz.build
+++ b/toolkit/components/url-classifier/moz.build
@@ -4,8 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-TEST_DIRS += ['tests']
-
XPIDL_SOURCES += [
'nsIUrlClassifierDBService.idl',
'nsIUrlClassifierHashCompleter.idl',
diff --git a/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp b/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
index e4cf68c98..c4ee5f26d 100644
--- a/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
+++ b/toolkit/components/url-classifier/nsUrlClassifierUtils.cpp
@@ -83,9 +83,7 @@ namespace safebrowsing {
static PlatformType
GetPlatformType()
{
-#if defined(ANDROID)
- return ANDROID_PLATFORM;
-#elif defined(XP_MACOSX)
+#if defined(XP_MACOSX)
return OSX_PLATFORM;
#elif defined(XP_LINUX)
return LINUX_PLATFORM;
diff --git a/toolkit/components/url-classifier/tests/UrlClassifierTestUtils.jsm b/toolkit/components/url-classifier/tests/UrlClassifierTestUtils.jsm
deleted file mode 100644
index 615769473..000000000
--- a/toolkit/components/url-classifier/tests/UrlClassifierTestUtils.jsm
+++ /dev/null
@@ -1,98 +0,0 @@
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["UrlClassifierTestUtils"];
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-const TRACKING_TABLE_NAME = "mochitest-track-simple";
-const TRACKING_TABLE_PREF = "urlclassifier.trackingTable";
-const WHITELIST_TABLE_NAME = "mochitest-trackwhite-simple";
-const WHITELIST_TABLE_PREF = "urlclassifier.trackingWhitelistTable";
-
-Cu.import("resource://gre/modules/Services.jsm");
-
-this.UrlClassifierTestUtils = {
-
- addTestTrackers() {
- // Add some URLs to the tracking databases
- let trackingURL1 = "tracking.example.com/";
- let trackingURL2 = "itisatracker.org/";
- let trackingURL3 = "trackertest.org/";
- let whitelistedURL = "itisatrap.org/?resource=itisatracker.org";
-
- let trackingUpdate =
- "n:1000\ni:" + TRACKING_TABLE_NAME + "\nad:3\n" +
- "a:1:32:" + trackingURL1.length + "\n" +
- trackingURL1 + "\n" +
- "a:2:32:" + trackingURL2.length + "\n" +
- trackingURL2 + "\n" +
- "a:3:32:" + trackingURL3.length + "\n" +
- trackingURL3 + "\n";
- let whitelistUpdate =
- "n:1000\ni:" + WHITELIST_TABLE_NAME + "\nad:1\n" +
- "a:1:32:" + whitelistedURL.length + "\n" +
- whitelistedURL + "\n";
-
- var tables = [
- {
- pref: TRACKING_TABLE_PREF,
- name: TRACKING_TABLE_NAME,
- update: trackingUpdate
- },
- {
- pref: WHITELIST_TABLE_PREF,
- name: WHITELIST_TABLE_NAME,
- update: whitelistUpdate
- }
- ];
-
- return this.useTestDatabase(tables);
- },
-
- cleanupTestTrackers() {
- Services.prefs.clearUserPref(TRACKING_TABLE_PREF);
- Services.prefs.clearUserPref(WHITELIST_TABLE_PREF);
- },
-
- /**
- * Add some entries to a test tracking protection database, and resets
- * back to the default database after the test ends.
- *
- * @return {Promise}
- */
- useTestDatabase(tables) {
- for (var table of tables) {
- Services.prefs.setCharPref(table.pref, table.name);
- }
-
- return new Promise((resolve, reject) => {
- let dbService = Cc["@mozilla.org/url-classifier/dbservice;1"].
- getService(Ci.nsIUrlClassifierDBService);
- let listener = {
- QueryInterface: iid => {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIUrlClassifierUpdateObserver))
- return listener;
-
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
- updateUrlRequested: url => { },
- streamFinished: status => { },
- updateError: errorCode => {
- reject("Couldn't update classifier.");
- },
- updateSuccess: requestedTimeout => {
- resolve();
- }
- };
-
- for (var table of tables) {
- dbService.beginUpdate(listener, table.name, "");
- dbService.beginStream("", "");
- dbService.updateStream(table.update);
- dbService.finishStream();
- dbService.finishUpdate();
- }
- });
- },
-};
diff --git a/toolkit/components/url-classifier/tests/gtest/Common.cpp b/toolkit/components/url-classifier/tests/gtest/Common.cpp
deleted file mode 100644
index b5f024b38..000000000
--- a/toolkit/components/url-classifier/tests/gtest/Common.cpp
+++ /dev/null
@@ -1,78 +0,0 @@
-#include "Common.h"
-#include "HashStore.h"
-#include "Classifier.h"
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsTArray.h"
-#include "nsIThread.h"
-#include "nsThreadUtils.h"
-#include "nsUrlClassifierUtils.h"
-
-using namespace mozilla;
-using namespace mozilla::safebrowsing;
-
-template<typename Function>
-void RunTestInNewThread(Function&& aFunction) {
- nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction(mozilla::Forward<Function>(aFunction));
- nsCOMPtr<nsIThread> testingThread;
- nsresult rv = NS_NewThread(getter_AddRefs(testingThread), r);
- ASSERT_EQ(rv, NS_OK);
- testingThread->Shutdown();
-}
-
-already_AddRefed<nsIFile>
-GetFile(const nsTArray<nsString>& path)
-{
- nsCOMPtr<nsIFile> file;
- nsresult rv = NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return nullptr;
- }
-
- for (uint32_t i = 0; i < path.Length(); i++) {
- file->Append(path[i]);
- }
- return file.forget();
-}
-
-void ApplyUpdate(nsTArray<TableUpdate*>& updates)
-{
- nsCOMPtr<nsIFile> file;
- NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file));
-
- UniquePtr<Classifier> classifier(new Classifier());
- classifier->Open(*file);
-
- {
- // Force nsIUrlClassifierUtils loading on main thread
- // because nsIUrlClassifierDBService will not run in advance
- // in gtest.
- nsresult rv;
- nsCOMPtr<nsIUrlClassifierUtils> dummy =
- do_GetService(NS_URLCLASSIFIERUTILS_CONTRACTID, &rv);
- ASSERT_TRUE(NS_SUCCEEDED(rv));
- }
-
- RunTestInNewThread([&] () -> void {
- classifier->ApplyUpdates(&updates);
- });
-}
-
-void ApplyUpdate(TableUpdate* update)
-{
- nsTArray<TableUpdate*> updates = { update };
- ApplyUpdate(updates);
-}
-
-void
-PrefixArrayToPrefixStringMap(const nsTArray<nsCString>& prefixArray,
- PrefixStringMap& out)
-{
- out.Clear();
-
- for (uint32_t i = 0; i < prefixArray.Length(); i++) {
- const nsCString& prefix = prefixArray[i];
- nsCString* prefixString = out.LookupOrAdd(prefix.Length());
- prefixString->Append(prefix.BeginReading(), prefix.Length());
- }
-}
-
diff --git a/toolkit/components/url-classifier/tests/gtest/Common.h b/toolkit/components/url-classifier/tests/gtest/Common.h
deleted file mode 100644
index c9a9cdf7e..000000000
--- a/toolkit/components/url-classifier/tests/gtest/Common.h
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "HashStore.h"
-#include "nsIFile.h"
-#include "nsTArray.h"
-#include "gtest/gtest.h"
-
-using namespace mozilla;
-using namespace mozilla::safebrowsing;
-
-template<typename Function>
-void RunTestInNewThread(Function&& aFunction);
-
-// Return nsIFile with root directory - NS_APP_USER_PROFILE_50_DIR
-// Sub-directories are passed in path argument.
-already_AddRefed<nsIFile>
-GetFile(const nsTArray<nsString>& path);
-
-// ApplyUpdate will call |ApplyUpdates| of Classifier within a new thread
-void ApplyUpdate(nsTArray<TableUpdate*>& updates);
-
-void ApplyUpdate(TableUpdate* update);
-
-// This function converts lexigraphic-sorted prefixes to a hashtable
-// which key is prefix size and value is concatenated prefix string.
-void PrefixArrayToPrefixStringMap(const nsTArray<nsCString>& prefixArray,
- PrefixStringMap& out);
-
diff --git a/toolkit/components/url-classifier/tests/gtest/TestChunkSet.cpp b/toolkit/components/url-classifier/tests/gtest/TestChunkSet.cpp
deleted file mode 100644
index dba2fc2c1..000000000
--- a/toolkit/components/url-classifier/tests/gtest/TestChunkSet.cpp
+++ /dev/null
@@ -1,279 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <set>
-
-#include "gtest/gtest.h"
-#include "ChunkSet.h"
-#include "mozilla/ArrayUtils.h"
-
-TEST(UrlClassifierChunkSet, Empty)
-{
- mozilla::safebrowsing::ChunkSet chunkSet;
- mozilla::safebrowsing::ChunkSet removeSet;
-
- removeSet.Set(0);
-
- ASSERT_FALSE(chunkSet.Has(0));
- ASSERT_FALSE(chunkSet.Has(1));
- ASSERT_TRUE(chunkSet.Remove(removeSet) == NS_OK);
- ASSERT_TRUE(chunkSet.Length() == 0);
-
- chunkSet.Set(0);
-
- ASSERT_TRUE(chunkSet.Has(0));
- ASSERT_TRUE(chunkSet.Length() == 1);
- ASSERT_TRUE(chunkSet.Remove(removeSet) == NS_OK);
- ASSERT_FALSE(chunkSet.Has(0));
- ASSERT_TRUE(chunkSet.Length() == 0);
-}
-
-TEST(UrlClassifierChunkSet, Main)
-{
- static int testVals[] = {2, 1, 5, 6, 8, 7, 14, 10, 12, 13};
-
- mozilla::safebrowsing::ChunkSet chunkSet;
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(testVals); i++) {
- chunkSet.Set(testVals[i]);
- }
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(testVals); i++) {
- ASSERT_TRUE(chunkSet.Has(testVals[i]));
- }
-
- ASSERT_FALSE(chunkSet.Has(3));
- ASSERT_FALSE(chunkSet.Has(4));
- ASSERT_FALSE(chunkSet.Has(9));
- ASSERT_FALSE(chunkSet.Has(11));
-
- ASSERT_TRUE(chunkSet.Length() == MOZ_ARRAY_LENGTH(testVals));
-}
-
-TEST(UrlClassifierChunkSet, Merge)
-{
- static int testVals[] = {2, 1, 5, 6, 8, 7, 14, 10, 12, 13};
- static int mergeVals[] = {9, 3, 4, 20, 14, 16};
-
- mozilla::safebrowsing::ChunkSet chunkSet;
- mozilla::safebrowsing::ChunkSet mergeSet;
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(testVals); i++) {
- chunkSet.Set(testVals[i]);
- }
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(mergeVals); i++) {
- mergeSet.Set(mergeVals[i]);
- }
-
- chunkSet.Merge(mergeSet);
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(testVals); i++) {
- ASSERT_TRUE(chunkSet.Has(testVals[i]));
- }
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(mergeVals); i++) {
- ASSERT_TRUE(chunkSet.Has(mergeVals[i]));
- }
-
- // -1 because 14 is duplicated in both sets
- ASSERT_TRUE(chunkSet.Length() ==
- MOZ_ARRAY_LENGTH(testVals) + MOZ_ARRAY_LENGTH(mergeVals) - 1);
-
- ASSERT_FALSE(chunkSet.Has(11));
- ASSERT_FALSE(chunkSet.Has(15));
- ASSERT_FALSE(chunkSet.Has(17));
- ASSERT_FALSE(chunkSet.Has(18));
- ASSERT_FALSE(chunkSet.Has(19));
-}
-
-TEST(UrlClassifierChunkSet, Merge2)
-{
- static int testVals[] = {2, 1, 5, 6, 8, 7, 14, 10, 12, 13};
- static int mergeVals[] = {9, 3, 4, 20, 14, 16};
- static int mergeVals2[] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11};
-
- mozilla::safebrowsing::ChunkSet chunkSet;
- mozilla::safebrowsing::ChunkSet mergeSet;
- mozilla::safebrowsing::ChunkSet mergeSet2;
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(testVals); i++) {
- chunkSet.Set(testVals[i]);
- }
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(mergeVals); i++) {
- mergeSet.Set(mergeVals[i]);
- }
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(mergeVals2); i++) {
- mergeSet2.Set(mergeVals2[i]);
- }
-
- chunkSet.Merge(mergeSet);
- chunkSet.Merge(mergeSet2);
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(testVals); i++) {
- ASSERT_TRUE(chunkSet.Has(testVals[i]));
- }
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(mergeVals); i++) {
- ASSERT_TRUE(chunkSet.Has(mergeVals[i]));
- }
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(mergeVals2); i++) {
- ASSERT_TRUE(chunkSet.Has(mergeVals2[i]));
- }
-
- ASSERT_FALSE(chunkSet.Has(15));
- ASSERT_FALSE(chunkSet.Has(17));
- ASSERT_FALSE(chunkSet.Has(18));
- ASSERT_FALSE(chunkSet.Has(19));
-}
-
-TEST(UrlClassifierChunkSet, Stress)
-{
- mozilla::safebrowsing::ChunkSet chunkSet;
- mozilla::safebrowsing::ChunkSet mergeSet;
- std::set<int> refSet;
- std::set<int> refMergeSet;
- static const int TEST_ITERS = 7000;
- static const int REMOVE_ITERS = 3000;
- static const int TEST_RANGE = 10000;
-
- // Construction by Set
- for (int i = 0; i < TEST_ITERS; i++) {
- int chunk = rand() % TEST_RANGE;
- chunkSet.Set(chunk);
- refSet.insert(chunk);
- }
-
- // Same elements as reference set
- for (auto it = refSet.begin(); it != refSet.end(); ++it) {
- ASSERT_TRUE(chunkSet.Has(*it));
- }
-
- // Hole punching via Remove
- for (int i = 0; i < REMOVE_ITERS; i++) {
- int chunk = rand() % TEST_RANGE;
- mozilla::safebrowsing::ChunkSet helpChunk;
- helpChunk.Set(chunk);
-
- chunkSet.Remove(helpChunk);
- refSet.erase(chunk);
-
- ASSERT_FALSE(chunkSet.Has(chunk));
- }
-
- // Should have chunks present in reference set
- // Should not have chunks absent in reference set
- for (int it = 0; it < TEST_RANGE; ++it) {
- auto found = refSet.find(it);
- if (chunkSet.Has(it)) {
- ASSERT_FALSE(found == refSet.end());
- } else {
- ASSERT_TRUE(found == refSet.end());
- }
- }
-
- // Construct set to merge with
- for (int i = 0; i < TEST_ITERS; i++) {
- int chunk = rand() % TEST_RANGE;
- mergeSet.Set(chunk);
- refMergeSet.insert(chunk);
- }
-
- // Merge set constructed correctly
- for (auto it = refMergeSet.begin(); it != refMergeSet.end(); ++it) {
- ASSERT_TRUE(mergeSet.Has(*it));
- }
-
- mozilla::safebrowsing::ChunkSet origSet;
- origSet = chunkSet;
-
- chunkSet.Merge(mergeSet);
- refSet.insert(refMergeSet.begin(), refMergeSet.end());
-
- // Check for presence of elements from both source
- // Should not have chunks absent in reference set
- for (int it = 0; it < TEST_RANGE; ++it) {
- auto found = refSet.find(it);
- if (chunkSet.Has(it)) {
- ASSERT_FALSE(found == refSet.end());
- } else {
- ASSERT_TRUE(found == refSet.end());
- }
- }
-
- // Unmerge
- chunkSet.Remove(origSet);
- for (int it = 0; it < TEST_RANGE; ++it) {
- if (origSet.Has(it)) {
- ASSERT_FALSE(chunkSet.Has(it));
- } else if (mergeSet.Has(it)) {
- ASSERT_TRUE(chunkSet.Has(it));
- }
- }
-}
-
-TEST(UrlClassifierChunkSet, RemoveClear)
-{
- static int testVals[] = {2, 1, 5, 6, 8, 7, 14, 10, 12, 13};
- static int mergeVals[] = {3, 4, 9, 16, 20};
-
- mozilla::safebrowsing::ChunkSet chunkSet;
- mozilla::safebrowsing::ChunkSet mergeSet;
- mozilla::safebrowsing::ChunkSet removeSet;
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(testVals); i++) {
- chunkSet.Set(testVals[i]);
- removeSet.Set(testVals[i]);
- }
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(mergeVals); i++) {
- mergeSet.Set(mergeVals[i]);
- }
-
- ASSERT_TRUE(chunkSet.Merge(mergeSet) == NS_OK);
- ASSERT_TRUE(chunkSet.Remove(removeSet) == NS_OK);
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(mergeVals); i++) {
- ASSERT_TRUE(chunkSet.Has(mergeVals[i]));
- }
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(testVals); i++) {
- ASSERT_FALSE(chunkSet.Has(testVals[i]));
- }
-
- chunkSet.Clear();
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(mergeVals); i++) {
- ASSERT_FALSE(chunkSet.Has(mergeVals[i]));
- }
-}
-
-TEST(UrlClassifierChunkSet, Serialize)
-{
- static int testVals[] = {2, 1, 5, 6, 8, 7, 14, 10, 12, 13};
- static int mergeVals[] = {3, 4, 9, 16, 20};
-
- mozilla::safebrowsing::ChunkSet chunkSet;
- mozilla::safebrowsing::ChunkSet mergeSet;
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(testVals); i++) {
- chunkSet.Set(testVals[i]);
- }
-
- for (size_t i = 0; i < MOZ_ARRAY_LENGTH(mergeVals); i++) {
- mergeSet.Set(mergeVals[i]);
- }
-
- chunkSet.Merge(mergeSet);
-
- nsAutoCString mergeResult;
- chunkSet.Serialize(mergeResult);
-
- printf("mergeResult: %s\n", mergeResult.get());
-
- nsAutoCString expected(NS_LITERAL_CSTRING("1-10,12-14,16,20"));
-
- ASSERT_TRUE(mergeResult.Equals(expected));
-}
diff --git a/toolkit/components/url-classifier/tests/gtest/TestFailUpdate.cpp b/toolkit/components/url-classifier/tests/gtest/TestFailUpdate.cpp
deleted file mode 100644
index bdb9eebb0..000000000
--- a/toolkit/components/url-classifier/tests/gtest/TestFailUpdate.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-#include "HashStore.h"
-#include "nsPrintfCString.h"
-#include "string.h"
-#include "gtest/gtest.h"
-#include "mozilla/Unused.h"
-
-using namespace mozilla;
-using namespace mozilla::safebrowsing;
-
-static const char* kFilesInV2[] = {".pset", ".sbstore"};
-static const char* kFilesInV4[] = {".pset", ".metadata"};
-
-#define V2_TABLE "gtest-malware-simple"
-#define V4_TABLE1 "goog-malware-proto"
-#define V4_TABLE2 "goog-phish-proto"
-
-#define ROOT_DIR NS_LITERAL_STRING("safebrowsing")
-#define SB_FILE(x, y) NS_ConvertUTF8toUTF16(nsPrintfCString("%s%s",x, y))
-
-template<typename T, size_t N>
-void CheckFileExist(const char* table, const T (&files)[N], bool expectExists)
-{
- for (uint32_t i = 0; i < N; i++) {
- // This is just a quick way to know if this is v4 table
- NS_ConvertUTF8toUTF16 SUB_DIR(strstr(table, "-proto") ? "google4" : "");
- nsCOMPtr<nsIFile> file =
- GetFile(nsTArray<nsString> { ROOT_DIR, SUB_DIR, SB_FILE(table, files[i]) });
-
- bool exists;
- file->Exists(&exists);
-
- nsAutoCString path;
- file->GetNativePath(path);
- ASSERT_EQ(expectExists, exists) << path.get();
- }
-}
-
-TEST(FailUpdate, CheckTableReset)
-{
- const bool FULL_UPDATE = true;
- const bool PARTIAL_UPDATE = false;
-
- // Apply V2 update
- {
- auto update = new TableUpdateV2(NS_LITERAL_CSTRING(V2_TABLE));
- Unused << update->NewAddChunk(1);
-
- ApplyUpdate(update);
-
- // A successful V2 update should create .pset & .sbstore files
- CheckFileExist(V2_TABLE, kFilesInV2, true);
- }
-
- // Helper function to generate table update data
- auto func = [](TableUpdateV4* update, bool full, const char* str) {
- update->SetFullUpdate(full);
- std::string prefix(str);
- update->NewPrefixes(prefix.length(), prefix);
- };
-
- // Apply V4 update for table1
- {
- auto update = new TableUpdateV4(NS_LITERAL_CSTRING(V4_TABLE1));
- func(update, FULL_UPDATE, "test_prefix");
-
- ApplyUpdate(update);
-
- // A successful V4 update should create .pset & .metadata files
- CheckFileExist(V4_TABLE1, kFilesInV4, true);
- }
-
- // Apply V4 update for table2
- {
- auto update = new TableUpdateV4(NS_LITERAL_CSTRING(V4_TABLE2));
- func(update, FULL_UPDATE, "test_prefix");
-
- ApplyUpdate(update);
-
- CheckFileExist(V4_TABLE2, kFilesInV4, true);
- }
-
- // Apply V4 update with the same prefix in previous full udpate
- // This should cause an update error.
- {
- auto update = new TableUpdateV4(NS_LITERAL_CSTRING(V4_TABLE1));
- func(update, PARTIAL_UPDATE, "test_prefix");
-
- ApplyUpdate(update);
-
- // A fail update should remove files for that table
- CheckFileExist(V4_TABLE1, kFilesInV4, false);
-
- // A fail update should NOT remove files for the other tables
- CheckFileExist(V2_TABLE, kFilesInV2, true);
- CheckFileExist(V4_TABLE2, kFilesInV4, true);
- }
-}
diff --git a/toolkit/components/url-classifier/tests/gtest/TestLookupCacheV4.cpp b/toolkit/components/url-classifier/tests/gtest/TestLookupCacheV4.cpp
deleted file mode 100644
index 00525f704..000000000
--- a/toolkit/components/url-classifier/tests/gtest/TestLookupCacheV4.cpp
+++ /dev/null
@@ -1,88 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "LookupCacheV4.h"
-#include "Common.h"
-
-#define GTEST_SAFEBROWSING_DIR NS_LITERAL_CSTRING("safebrowsing")
-#define GTEST_TABLE NS_LITERAL_CSTRING("gtest-malware-proto")
-
-typedef nsCString _Fragment;
-typedef nsTArray<nsCString> _PrefixArray;
-
-// Generate a hash prefix from string
-static const nsCString
-GeneratePrefix(const _Fragment& aFragment, uint8_t aLength)
-{
- Completion complete;
- nsCOMPtr<nsICryptoHash> cryptoHash = do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID);
- complete.FromPlaintext(aFragment, cryptoHash);
-
- nsCString hash;
- hash.Assign((const char *)complete.buf, aLength);
- return hash;
-}
-
-static UniquePtr<LookupCacheV4>
-SetupLookupCacheV4(const _PrefixArray& prefixArray)
-{
- nsCOMPtr<nsIFile> file;
- NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file));
-
- file->AppendNative(GTEST_SAFEBROWSING_DIR);
-
- UniquePtr<LookupCacheV4> cache = MakeUnique<LookupCacheV4>(GTEST_TABLE, EmptyCString(), file);
- nsresult rv = cache->Init();
- EXPECT_EQ(rv, NS_OK);
-
- PrefixStringMap map;
- PrefixArrayToPrefixStringMap(prefixArray, map);
- rv = cache->Build(map);
- EXPECT_EQ(rv, NS_OK);
-
- return Move(cache);
-}
-
-void
-TestHasPrefix(const _Fragment& aFragment, bool aExpectedHas, bool aExpectedComplete)
-{
- _PrefixArray array = { GeneratePrefix(_Fragment("bravo.com/"), 32),
- GeneratePrefix(_Fragment("browsing.com/"), 8),
- GeneratePrefix(_Fragment("gound.com/"), 5),
- GeneratePrefix(_Fragment("small.com/"), 4)
- };
-
- RunTestInNewThread([&] () -> void {
- UniquePtr<LookupCache> cache = SetupLookupCacheV4(array);
-
- Completion lookupHash;
- nsCOMPtr<nsICryptoHash> cryptoHash = do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID);
- lookupHash.FromPlaintext(aFragment, cryptoHash);
-
- bool has, complete;
- nsresult rv = cache->Has(lookupHash, &has, &complete);
-
- EXPECT_EQ(rv, NS_OK);
- EXPECT_EQ(has, aExpectedHas);
- EXPECT_EQ(complete, aExpectedComplete);
-
- cache->ClearAll();
- });
-
-}
-
-TEST(LookupCacheV4, HasComplete)
-{
- TestHasPrefix(_Fragment("bravo.com/"), true, true);
-}
-
-TEST(LookupCacheV4, HasPrefix)
-{
- TestHasPrefix(_Fragment("browsing.com/"), true, false);
-}
-
-TEST(LookupCacheV4, Nomatch)
-{
- TestHasPrefix(_Fragment("nomatch.com/"), false, false);
-}
diff --git a/toolkit/components/url-classifier/tests/gtest/TestPerProviderDirectory.cpp b/toolkit/components/url-classifier/tests/gtest/TestPerProviderDirectory.cpp
deleted file mode 100644
index 72ff08a1e..000000000
--- a/toolkit/components/url-classifier/tests/gtest/TestPerProviderDirectory.cpp
+++ /dev/null
@@ -1,98 +0,0 @@
-#include "LookupCache.h"
-#include "LookupCacheV4.h"
-#include "HashStore.h"
-#include "gtest/gtest.h"
-#include "nsAppDirectoryServiceDefs.h"
-
-namespace mozilla {
-namespace safebrowsing {
-
-class PerProviderDirectoryTestUtils {
-public:
- template<typename T>
- static nsIFile* InspectStoreDirectory(const T& aT)
- {
- return aT.mStoreDirectory;
- }
-};
-
-} // end of namespace safebrowsing
-} // end of namespace mozilla
-
-using namespace mozilla;
-using namespace mozilla::safebrowsing;
-
-template<typename T>
-void VerifyPrivateStorePath(const char* aTableName,
- const char* aProvider,
- nsIFile* aRootDir,
- bool aUsePerProviderStore)
-{
- nsString rootStorePath;
- nsresult rv = aRootDir->GetPath(rootStorePath);
- EXPECT_EQ(rv, NS_OK);
-
- T target(nsCString(aTableName), nsCString(aProvider), aRootDir);
-
- nsIFile* privateStoreDirectory =
- PerProviderDirectoryTestUtils::InspectStoreDirectory(target);
-
- nsString privateStorePath;
- rv = privateStoreDirectory->GetPath(privateStorePath);
- ASSERT_EQ(rv, NS_OK);
-
- nsString expectedPrivateStorePath = rootStorePath;
-
- if (aUsePerProviderStore) {
- // Use API to append "provider" to the root directoy path
- nsCOMPtr<nsIFile> expectedPrivateStoreDir;
- rv = aRootDir->Clone(getter_AddRefs(expectedPrivateStoreDir));
- ASSERT_EQ(rv, NS_OK);
-
- expectedPrivateStoreDir->AppendNative(nsCString(aProvider));
- rv = expectedPrivateStoreDir->GetPath(expectedPrivateStorePath);
- ASSERT_EQ(rv, NS_OK);
- }
-
- printf("table: %s\nprovider: %s\nroot path: %s\nprivate path: %s\n\n",
- aTableName,
- aProvider,
- NS_ConvertUTF16toUTF8(rootStorePath).get(),
- NS_ConvertUTF16toUTF8(privateStorePath).get());
-
- ASSERT_TRUE(privateStorePath == expectedPrivateStorePath);
-}
-
-TEST(PerProviderDirectory, LookupCache)
-{
- RunTestInNewThread([] () -> void {
- nsCOMPtr<nsIFile> rootDir;
- NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(rootDir));
-
- // For V2 tables (NOT ending with '-proto'), root directory should be
- // used as the private store.
- VerifyPrivateStorePath<LookupCacheV2>("goog-phish-shavar", "google", rootDir, false);
-
- // For V4 tables, if provider is found, use per-provider subdirectory;
- // If not found, use root directory.
- VerifyPrivateStorePath<LookupCacheV4>("goog-noprovider-proto", "", rootDir, false);
- VerifyPrivateStorePath<LookupCacheV4>("goog-phish-proto", "google4", rootDir, true);
- });
-}
-
-TEST(PerProviderDirectory, HashStore)
-{
- RunTestInNewThread([] () -> void {
- nsCOMPtr<nsIFile> rootDir;
- NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(rootDir));
-
- // For V2 tables (NOT ending with '-proto'), root directory should be
- // used as the private store.
- VerifyPrivateStorePath<HashStore>("goog-phish-shavar", "google", rootDir, false);
-
- // For V4 tables, if provider is found, use per-provider subdirectory;
- // If not found, use root directory.
- VerifyPrivateStorePath<HashStore>("goog-noprovider-proto", "", rootDir, false);
- VerifyPrivateStorePath<HashStore>("goog-phish-proto", "google4", rootDir, true);
- });
-}
diff --git a/toolkit/components/url-classifier/tests/gtest/TestProtocolParser.cpp b/toolkit/components/url-classifier/tests/gtest/TestProtocolParser.cpp
deleted file mode 100644
index ea6ffb5e6..000000000
--- a/toolkit/components/url-classifier/tests/gtest/TestProtocolParser.cpp
+++ /dev/null
@@ -1,159 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-#include "gtest/gtest.h"
-#include "ProtocolParser.h"
-#include "mozilla/EndianUtils.h"
-
-using namespace mozilla;
-using namespace mozilla::safebrowsing;
-
-typedef FetchThreatListUpdatesResponse_ListUpdateResponse ListUpdateResponse;
-
-static bool
-InitUpdateResponse(ListUpdateResponse* aUpdateResponse,
- ThreatType aThreatType,
- const nsACString& aState,
- const nsACString& aChecksum,
- bool isFullUpdate,
- const nsTArray<uint32_t>& aFixedLengthPrefixes,
- bool aDoPrefixEncoding);
-
-static void
-DumpBinary(const nsACString& aBinary);
-
-TEST(ProtocolParser, UpdateWait)
-{
- // Top level response which contains a list of update response
- // for different lists.
- FetchThreatListUpdatesResponse response;
-
- auto r = response.mutable_list_update_responses()->Add();
- InitUpdateResponse(r, SOCIAL_ENGINEERING_PUBLIC,
- nsCString("sta\x00te", 6),
- nsCString("check\x0sum", 9),
- true,
- {0, 1, 2, 3},
- false /* aDoPrefixEncoding */ );
-
- // Set min wait duration.
- auto minWaitDuration = response.mutable_minimum_wait_duration();
- minWaitDuration->set_seconds(8);
- minWaitDuration->set_nanos(1 * 1000000000);
-
- std::string s;
- response.SerializeToString(&s);
-
- DumpBinary(nsCString(s.c_str(), s.length()));
-
- ProtocolParser* p = new ProtocolParserProtobuf();
- p->AppendStream(nsCString(s.c_str(), s.length()));
- p->End();
- ASSERT_EQ(p->UpdateWaitSec(), 9u);
- delete p;
-}
-
-TEST(ProtocolParser, SingleValueEncoding)
-{
- // Top level response which contains a list of update response
- // for different lists.
- FetchThreatListUpdatesResponse response;
-
- auto r = response.mutable_list_update_responses()->Add();
-
- const char* expectedPrefix = "\x00\x01\x02\x00";
- if (!InitUpdateResponse(r, SOCIAL_ENGINEERING_PUBLIC,
- nsCString("sta\x00te", 6),
- nsCString("check\x0sum", 9),
- true,
- // As per spec, we should interpret the prefix as uint32
- // in little endian before encoding.
- {LittleEndian::readUint32(expectedPrefix)},
- true /* aDoPrefixEncoding */ )) {
- printf("Failed to initialize update response.");
- ASSERT_TRUE(false);
- return;
- }
-
- // Set min wait duration.
- auto minWaitDuration = response.mutable_minimum_wait_duration();
- minWaitDuration->set_seconds(8);
- minWaitDuration->set_nanos(1 * 1000000000);
-
- std::string s;
- response.SerializeToString(&s);
-
- // Feed data to the protocol parser.
- ProtocolParser* p = new ProtocolParserProtobuf();
- p->SetRequestedTables({ nsCString("googpub-phish-proto") });
- p->AppendStream(nsCString(s.c_str(), s.length()));
- p->End();
-
- auto& tus = p->GetTableUpdates();
- auto tuv4 = TableUpdate::Cast<TableUpdateV4>(tus[0]);
- auto& prefixMap = tuv4->Prefixes();
- for (auto iter = prefixMap.Iter(); !iter.Done(); iter.Next()) {
- // This prefix map should contain only a single 4-byte prefixe.
- ASSERT_EQ(iter.Key(), 4u);
-
- // The fixed-length prefix string from ProtcolParser should
- // exactly match the expected prefix string.
- auto& prefix = iter.Data()->GetPrefixString();
- ASSERT_TRUE(prefix.Equals(nsCString(expectedPrefix, 4)));
- }
-
- delete p;
-}
-
-static bool
-InitUpdateResponse(ListUpdateResponse* aUpdateResponse,
- ThreatType aThreatType,
- const nsACString& aState,
- const nsACString& aChecksum,
- bool isFullUpdate,
- const nsTArray<uint32_t>& aFixedLengthPrefixes,
- bool aDoPrefixEncoding)
-{
- aUpdateResponse->set_threat_type(aThreatType);
- aUpdateResponse->set_new_client_state(aState.BeginReading(), aState.Length());
- aUpdateResponse->mutable_checksum()->set_sha256(aChecksum.BeginReading(), aChecksum.Length());
- aUpdateResponse->set_response_type(isFullUpdate ? ListUpdateResponse::FULL_UPDATE
- : ListUpdateResponse::PARTIAL_UPDATE);
-
- auto additions = aUpdateResponse->mutable_additions()->Add();
-
- if (!aDoPrefixEncoding) {
- additions->set_compression_type(RAW);
- auto rawHashes = additions->mutable_raw_hashes();
- rawHashes->set_prefix_size(4);
- auto prefixes = rawHashes->mutable_raw_hashes();
- for (auto p : aFixedLengthPrefixes) {
- char buffer[4];
- NativeEndian::copyAndSwapToBigEndian(buffer, &p, 1);
- prefixes->append(buffer, 4);
- }
- return true;
- }
-
- if (1 != aFixedLengthPrefixes.Length()) {
- printf("This function only supports single value encoding.\n");
- return false;
- }
-
- uint32_t firstValue = aFixedLengthPrefixes[0];
- additions->set_compression_type(RICE);
- auto riceHashes = additions->mutable_rice_hashes();
- riceHashes->set_first_value(firstValue);
- riceHashes->set_num_entries(0);
-
- return true;
-}
-
-static void DumpBinary(const nsACString& aBinary)
-{
- nsCString s;
- for (size_t i = 0; i < aBinary.Length(); i++) {
- s.AppendPrintf("\\x%.2X", (uint8_t)aBinary[i]);
- }
- printf("%s\n", s.get());
-} \ No newline at end of file
diff --git a/toolkit/components/url-classifier/tests/gtest/TestRiceDeltaDecoder.cpp b/toolkit/components/url-classifier/tests/gtest/TestRiceDeltaDecoder.cpp
deleted file mode 100644
index f03d27358..000000000
--- a/toolkit/components/url-classifier/tests/gtest/TestRiceDeltaDecoder.cpp
+++ /dev/null
@@ -1,165 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-#include "gtest/gtest.h"
-#include "RiceDeltaDecoder.h"
-#include "mozilla/ArrayUtils.h"
-
-using namespace mozilla;
-using namespace mozilla::safebrowsing;
-
-struct TestingData {
- std::vector<uint32_t> mExpectedDecoded;
- std::vector<uint8_t> mEncoded;
- uint32_t mRiceParameter;
-};
-
-static bool runOneTest(TestingData& aData);
-
-TEST(RiceDeltaDecoder, SingleEncodedValue) {
- TestingData td = { { 99 }, { 99 }, 0 };
-
- ASSERT_TRUE(runOneTest(td));
-}
-
-// In this batch of tests, the encoded data would be like
-// what we originally receive from the network. See comment
-// in |runOneTest| for more detail.
-TEST(RiceDeltaDecoder, Empty) {
-
- // The following structure and testing data is copied from Chromium source code:
- //
- // https://chromium.googlesource.com/chromium/src.git/+/950f9975599768b6a08c7146cb4befa161be87aa/components/safe_browsing_db/v4_rice_unittest.cc#75
- //
- // and will be translated to our own testing format.
-
- struct RiceDecodingTestInfo {
- uint32_t mRiceParameter;
- std::vector<uint32_t> mDeltas;
- std::string mEncoded;
-
- RiceDecodingTestInfo(uint32_t aRiceParameter,
- const std::vector<uint32_t>& aDeltas,
- const std::string& aEncoded)
- : mRiceParameter(aRiceParameter)
- , mDeltas(aDeltas)
- , mEncoded(aEncoded)
- {
- }
- };
-
- // Copyright 2016 The Chromium Authors. All rights reserved.
- // Use of this source code is governed by a BSD-style license that can be
- // found in the media/webrtc/trunk/webrtc/LICENSE.
-
- // ----- Start of Chromium test code ----
- const std::vector<RiceDecodingTestInfo> TESTING_DATA_CHROMIUM = {
- RiceDecodingTestInfo(2, {15, 9}, "\xf7\x2"),
- RiceDecodingTestInfo(
- 28, {1777762129, 2093280223, 924369848},
- "\xbf\xa8\x3f\xfb\xfc\xfb\x5e\x27\xe6\xc3\x1d\xc6\x38"),
- RiceDecodingTestInfo(
- 28, {62763050, 1046523781, 192522171, 1800511020, 4442775, 582142548},
- "\x54\x60\x7b\xe7\x0a\x5f\xc1\xdc\xee\x69\xde"
- "\xfe\x58\x3c\xa3\xd6\xa5\xf2\x10\x8c\x4a\x59"
- "\x56\x00"),
- RiceDecodingTestInfo(
- 28, {26067715, 344823336, 8420095, 399843890, 95029378, 731622412,
- 35811335, 1047558127, 1117722715, 78698892},
- "\x06\x86\x1b\x23\x14\xcb\x46\xf2\xaf\x07\x08\xc9\x88\x54\x1f\x41\x04"
- "\xd5\x1a\x03\xeb\xe6\x3a\x80\x13\x91\x7b\xbf\x83\xf3\xb7\x85\xf1\x29"
- "\x18\xb3\x61\x09"),
- RiceDecodingTestInfo(
- 27, {225846818, 328287420, 166748623, 29117720, 552397365, 350353215,
- 558267528, 4738273, 567093445, 28563065, 55077698, 73091685,
- 339246010, 98242620, 38060941, 63917830, 206319759, 137700744},
- "\x89\x98\xd8\x75\xbc\x44\x91\xeb\x39\x0c\x3e\x30\x9a\x78\xf3\x6a\xd4"
- "\xd9\xb1\x9f\xfb\x70\x3e\x44\x3e\xa3\x08\x67\x42\xc2\x2b\x46\x69\x8e"
- "\x3c\xeb\xd9\x10\x5a\x43\x9a\x32\xa5\x2d\x4e\x77\x0f\x87\x78\x20\xb6"
- "\xab\x71\x98\x48\x0c\x9e\x9e\xd7\x23\x0c\x13\x43\x2c\xa9\x01"),
- RiceDecodingTestInfo(
- 28, {339784008, 263128563, 63871877, 69723256, 826001074, 797300228,
- 671166008, 207712688},
- std::string("\x21\xc5\x02\x91\xf9\x82\xd7\x57\xb8\xe9\x3c\xf0\xc8\x4f"
- "\xe8\x64\x8d\x77\x62\x04\xd6\x85\x3f\x1c\x97\x00\x04\x1b"
- "\x17\xc6",
- 30)),
- RiceDecodingTestInfo(
- 28, {471820069, 196333855, 855579133, 122737976, 203433838, 85354544,
- 1307949392, 165938578, 195134475, 553930435, 49231136},
- "\x95\x9c\x7d\xb0\x8f\xe8\xd9\xbd\xfe\x8c\x7f\x81\x53\x0d\x75\xdc\x4e"
- "\x40\x18\x0c\x9a\x45\x3d\xa8\xdc\xfa\x26\x59\x40\x9e\x16\x08\x43\x77"
- "\xc3\x4e\x04\x01\xa4\xe6\x5d\x00"),
- RiceDecodingTestInfo(
- 27, {87336845, 129291033, 30906211, 433549264, 30899891, 53207875,
- 11959529, 354827862, 82919275, 489637251, 53561020, 336722992,
- 408117728, 204506246, 188216092, 9047110, 479817359, 230317256},
- "\x1a\x4f\x69\x2a\x63\x9a\xf6\xc6\x2e\xaf\x73\xd0\x6f\xd7\x31\xeb\x77"
- "\x1d\x43\xe3\x2b\x93\xce\x67\x8b\x59\xf9\x98\xd4\xda\x4f\x3c\x6f\xb0"
- "\xe8\xa5\x78\x8d\x62\x36\x18\xfe\x08\x1e\x78\xd8\x14\x32\x24\x84\x61"
- "\x1c\xf3\x37\x63\xc4\xa0\x88\x7b\x74\xcb\x64\xc8\x5c\xba\x05"),
- RiceDecodingTestInfo(
- 28, {297968956, 19709657, 259702329, 76998112, 1023176123, 29296013,
- 1602741145, 393745181, 177326295, 55225536, 75194472},
- "\xf1\x94\x0a\x87\x6c\x5f\x96\x90\xe3\xab\xf7\xc0\xcb\x2d\xe9\x76\xdb"
- "\xf8\x59\x63\xc1\x6f\x7c\x99\xe3\x87\x5f\xc7\x04\xde\xb9\x46\x8e\x54"
- "\xc0\xac\x4a\x03\x0d\x6c\x8f\x00"),
- RiceDecodingTestInfo(
- 28, {532220688, 780594691, 436816483, 163436269, 573044456, 1069604,
- 39629436, 211410997, 227714491, 381562898, 75610008, 196754597,
- 40310339, 15204118, 99010842},
- "\x41\x2c\xe4\xfe\x06\xdc\x0d\xbd\x31\xa5\x04\xd5\x6e\xdd\x9b\x43\xb7"
- "\x3f\x11\x24\x52\x10\x80\x4f\x96\x4b\xd4\x80\x67\xb2\xdd\x52\xc9\x4e"
- "\x02\xc6\xd7\x60\xde\x06\x92\x52\x1e\xdd\x35\x64\x71\x26\x2c\xfe\xcf"
- "\x81\x46\xb2\x79\x01"),
- RiceDecodingTestInfo(
- 28, {219354713, 389598618, 750263679, 554684211, 87381124, 4523497,
- 287633354, 801308671, 424169435, 372520475, 277287849},
- "\xb2\x2c\x26\x3a\xcd\x66\x9c\xdb\x5f\x07\x2e\x6f\xe6\xf9\x21\x10\x52"
- "\xd5\x94\xf4\x82\x22\x48\xf9\x9d\x24\xf6\xff\x2f\xfc\x6d\x3f\x21\x65"
- "\x1b\x36\x34\x56\xea\xc4\x21\x00"),
- };
-
- // ----- End of Chromium test code ----
-
- for (auto tdc : TESTING_DATA_CHROMIUM) {
- // Populate chromium testing data to our native testing data struct.
- TestingData d;
-
- d.mRiceParameter = tdc.mRiceParameter; // Populate rice parameter.
-
- // Populate encoded data from std::string to vector<uint8>.
- d.mEncoded.resize(tdc.mEncoded.size());
- memcpy(&d.mEncoded[0], tdc.mEncoded.c_str(), tdc.mEncoded.size());
-
- // Populate deltas to expected decoded data. The first value would be just
- // set to an arbitrary value, say 7, to avoid any assumption to the
- // first value in the implementation.
- d.mExpectedDecoded.resize(tdc.mDeltas.size() + 1);
- for (size_t i = 0; i < d.mExpectedDecoded.size(); i++) {
- if (0 == i) {
- d.mExpectedDecoded[i] = 7; // "7" is an arbitrary starting value
- } else {
- d.mExpectedDecoded[i] = d.mExpectedDecoded[i - 1] + tdc.mDeltas[i - 1];
- }
- }
-
- ASSERT_TRUE(runOneTest(d));
- }
-}
-
-static bool
-runOneTest(TestingData& aData)
-{
- RiceDeltaDecoder decoder(&aData.mEncoded[0], aData.mEncoded.size());
-
- std::vector<uint32_t> decoded(aData.mExpectedDecoded.size());
-
- uint32_t firstValue = aData.mExpectedDecoded[0];
- bool rv = decoder.Decode(aData.mRiceParameter,
- firstValue,
- decoded.size() - 1, // # of entries (first value not included).
- &decoded[0]);
-
- return rv && decoded == aData.mExpectedDecoded;
-}
diff --git a/toolkit/components/url-classifier/tests/gtest/TestSafeBrowsingProtobuf.cpp b/toolkit/components/url-classifier/tests/gtest/TestSafeBrowsingProtobuf.cpp
deleted file mode 100644
index fe6f28960..000000000
--- a/toolkit/components/url-classifier/tests/gtest/TestSafeBrowsingProtobuf.cpp
+++ /dev/null
@@ -1,24 +0,0 @@
-#include "safebrowsing.pb.h"
-#include "gtest/gtest.h"
-
-TEST(SafeBrowsingProtobuf, Empty)
-{
- using namespace mozilla::safebrowsing;
-
- const std::string CLIENT_ID = "firefox";
-
- // Construct a simple update request.
- FetchThreatListUpdatesRequest r;
- r.set_allocated_client(new ClientInfo());
- r.mutable_client()->set_client_id(CLIENT_ID);
-
- // Then serialize.
- std::string s;
- r.SerializeToString(&s);
-
- // De-serialize.
- FetchThreatListUpdatesRequest r2;
- r2.ParseFromString(s);
-
- ASSERT_EQ(r2.client().client_id(), CLIENT_ID);
-}
diff --git a/toolkit/components/url-classifier/tests/gtest/TestSafebrowsingHash.cpp b/toolkit/components/url-classifier/tests/gtest/TestSafebrowsingHash.cpp
deleted file mode 100644
index 89ed74be6..000000000
--- a/toolkit/components/url-classifier/tests/gtest/TestSafebrowsingHash.cpp
+++ /dev/null
@@ -1,52 +0,0 @@
-#include "Entries.h"
-#include "mozilla/EndianUtils.h"
-
-TEST(SafebrowsingHash, ToFromUint32)
-{
- using namespace mozilla::safebrowsing;
-
- // typedef SafebrowsingHash<PREFIX_SIZE, PrefixComparator> Prefix;
- // typedef nsTArray<Prefix> PrefixArray;
-
- const char PREFIX_RAW[4] = { 0x1, 0x2, 0x3, 0x4 };
- uint32_t PREFIX_UINT32;
- memcpy(&PREFIX_UINT32, PREFIX_RAW, 4);
-
- Prefix p;
- p.Assign(nsCString(PREFIX_RAW, 4));
- ASSERT_EQ(p.ToUint32(), PREFIX_UINT32);
-
- p.FromUint32(PREFIX_UINT32);
- ASSERT_EQ(memcmp(PREFIX_RAW, p.buf, 4), 0);
-}
-
-TEST(SafebrowsingHash, Compare)
-{
- using namespace mozilla;
- using namespace mozilla::safebrowsing;
-
- Prefix p1, p2, p3;
-
- // The order of p1,p2,p3 is "p1 == p3 < p2"
-#if MOZ_LITTLE_ENDIAN
- p1.Assign(nsCString("\x01\x00\x00\x00", 4));
- p2.Assign(nsCString("\x00\x00\x00\x01", 4));
- p3.Assign(nsCString("\x01\x00\x00\x00", 4));
-#else
- p1.Assign(nsCString("\x00\x00\x00\x01", 4));
- p2.Assign(nsCString("\x01\x00\x00\x00", 4));
- p3.Assign(nsCString("\x00\x00\x00\x01", 4));
-#endif
-
- // Make sure "p1 == p3 < p2" is true
- // on both little and big endian machine.
-
- ASSERT_EQ(p1.Compare(p2), -1);
- ASSERT_EQ(p1.Compare(p1), 0);
- ASSERT_EQ(p2.Compare(p1), 1);
- ASSERT_EQ(p1.Compare(p3), 0);
-
- ASSERT_TRUE(p1 < p2);
- ASSERT_TRUE(p1 == p1);
- ASSERT_TRUE(p1 == p3);
-} \ No newline at end of file
diff --git a/toolkit/components/url-classifier/tests/gtest/TestTable.cpp b/toolkit/components/url-classifier/tests/gtest/TestTable.cpp
deleted file mode 100644
index 307587459..000000000
--- a/toolkit/components/url-classifier/tests/gtest/TestTable.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-#include "gtest/gtest.h"
-#include "nsUrlClassifierDBService.h"
-
-using namespace mozilla::safebrowsing;
-
-void
-TestResponseCode(const char* table, nsresult result)
-{
- nsCString tableName(table);
- ASSERT_EQ(TablesToResponse(tableName), result);
-}
-
-TEST(UrlClassifierTable, ResponseCode)
-{
- // malware URIs.
- TestResponseCode("goog-malware-shavar", NS_ERROR_MALWARE_URI);
- TestResponseCode("test-malware-simple", NS_ERROR_MALWARE_URI);
- TestResponseCode("goog-phish-shavar,test-malware-simple", NS_ERROR_MALWARE_URI);
- TestResponseCode("test-malware-simple,mozstd-track-digest256,mozplugin-block-digest256", NS_ERROR_MALWARE_URI);
-
- // phish URIs.
- TestResponseCode("goog-phish-shavar", NS_ERROR_PHISHING_URI);
- TestResponseCode("test-phish-simple", NS_ERROR_PHISHING_URI);
- TestResponseCode("test-phish-simple,mozplugin-block-digest256", NS_ERROR_PHISHING_URI);
- TestResponseCode("mozstd-track-digest256,test-phish-simple,goog-unwanted-shavar", NS_ERROR_PHISHING_URI);
-
- // unwanted URIs.
- TestResponseCode("goog-unwanted-shavar", NS_ERROR_UNWANTED_URI);
- TestResponseCode("test-unwanted-simple", NS_ERROR_UNWANTED_URI);
- TestResponseCode("mozplugin-unwanted-digest256,mozfull-track-digest256", NS_ERROR_UNWANTED_URI);
- TestResponseCode("test-block-simple,mozfull-track-digest256,test-unwanted-simple", NS_ERROR_UNWANTED_URI);
-
- // track URIs.
- TestResponseCode("test-track-simple", NS_ERROR_TRACKING_URI);
- TestResponseCode("mozstd-track-digest256", NS_ERROR_TRACKING_URI);
- TestResponseCode("test-block-simple,mozstd-track-digest256", NS_ERROR_TRACKING_URI);
-
- // block URIs
- TestResponseCode("test-block-simple", NS_ERROR_BLOCKED_URI);
- TestResponseCode("mozplugin-block-digest256", NS_ERROR_BLOCKED_URI);
- TestResponseCode("mozplugin2-block-digest256", NS_ERROR_BLOCKED_URI);
-
- TestResponseCode("test-trackwhite-simple", NS_OK);
- TestResponseCode("mozstd-trackwhite-digest256", NS_OK);
- TestResponseCode("goog-badbinurl-shavar", NS_OK);
- TestResponseCode("goog-downloadwhite-digest256", NS_OK);
-}
diff --git a/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp b/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp
deleted file mode 100644
index 470a88ba2..000000000
--- a/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierTableUpdateV4.cpp
+++ /dev/null
@@ -1,755 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-#include "Common.h"
-#include "Classifier.h"
-#include "HashStore.h"
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsIFile.h"
-#include "nsIThread.h"
-#include "string.h"
-#include "gtest/gtest.h"
-#include "nsThreadUtils.h"
-
-using namespace mozilla;
-using namespace mozilla::safebrowsing;
-
-typedef nsCString _Prefix;
-typedef nsTArray<_Prefix> _PrefixArray;
-
-#define GTEST_SAFEBROWSING_DIR NS_LITERAL_CSTRING("safebrowsing")
-#define GTEST_TABLE NS_LITERAL_CSTRING("gtest-malware-proto")
-#define GTEST_PREFIXFILE NS_LITERAL_CSTRING("gtest-malware-proto.pset")
-
-// This function removes common elements of inArray and outArray from
-// outArray. This is used by partial update testcase to ensure partial update
-// data won't contain prefixes we already have.
-static void
-RemoveIntersection(const _PrefixArray& inArray, _PrefixArray& outArray)
-{
- for (uint32_t i = 0; i < inArray.Length(); i++) {
- int32_t idx = outArray.BinaryIndexOf(inArray[i]);
- if (idx >= 0) {
- outArray.RemoveElementAt(idx);
- }
- }
-}
-
-// This fucntion removes elements from outArray by index specified in
-// removal array.
-static void
-RemoveElements(const nsTArray<uint32_t>& removal, _PrefixArray& outArray)
-{
- for (int32_t i = removal.Length() - 1; i >= 0; i--) {
- outArray.RemoveElementAt(removal[i]);
- }
-}
-
-static void
-MergeAndSortArray(const _PrefixArray& array1,
- const _PrefixArray& array2,
- _PrefixArray& output)
-{
- output.Clear();
- output.AppendElements(array1);
- output.AppendElements(array2);
- output.Sort();
-}
-
-static void
-CalculateCheckSum(_PrefixArray& prefixArray, nsCString& checksum)
-{
- prefixArray.Sort();
-
- nsresult rv;
- nsCOMPtr<nsICryptoHash> cryptoHash =
- do_CreateInstance(NS_CRYPTO_HASH_CONTRACTID, &rv);
-
- cryptoHash->Init(nsICryptoHash::SHA256);
- for (uint32_t i = 0; i < prefixArray.Length(); i++) {
- const _Prefix& prefix = prefixArray[i];
- cryptoHash->Update(reinterpret_cast<uint8_t*>(
- const_cast<char*>(prefix.get())), prefix.Length());
- }
- cryptoHash->Finish(false, checksum);
-}
-
-// N: Number of prefixes, MIN/MAX: minimum/maximum prefix size
-// This function will append generated prefixes to outArray.
-static void
-CreateRandomSortedPrefixArray(uint32_t N,
- uint32_t MIN,
- uint32_t MAX,
- _PrefixArray& outArray)
-{
- outArray.SetCapacity(outArray.Length() + N);
-
- const uint32_t range = (MAX - MIN + 1);
-
- for (uint32_t i = 0; i < N; i++) {
- uint32_t prefixSize = (rand() % range) + MIN;
- _Prefix prefix;
- prefix.SetLength(prefixSize);
-
- while (true) {
- char* dst = prefix.BeginWriting();
- for (uint32_t j = 0; j < prefixSize; j++) {
- dst[j] = rand() % 256;
- }
-
- if (!outArray.Contains(prefix)) {
- outArray.AppendElement(prefix);
- break;
- }
- }
- }
-
- outArray.Sort();
-}
-
-// N: Number of removal indices, MAX: maximum index
-static void
-CreateRandomRemovalIndices(uint32_t N,
- uint32_t MAX,
- nsTArray<uint32_t>& outArray)
-{
- for (uint32_t i = 0; i < N; i++) {
- uint32_t idx = rand() % MAX;
- if (!outArray.Contains(idx)) {
- outArray.InsertElementSorted(idx);
- }
- }
-}
-
-// Function to generate TableUpdateV4.
-static void
-GenerateUpdateData(bool fullUpdate,
- PrefixStringMap& add,
- nsTArray<uint32_t>* removal,
- nsCString* checksum,
- nsTArray<TableUpdate*>& tableUpdates)
-{
- TableUpdateV4* tableUpdate = new TableUpdateV4(GTEST_TABLE);
- tableUpdate->SetFullUpdate(fullUpdate);
-
- for (auto iter = add.ConstIter(); !iter.Done(); iter.Next()) {
- nsCString* pstring = iter.Data();
- std::string str(pstring->BeginReading(), pstring->Length());
-
- tableUpdate->NewPrefixes(iter.Key(), str);
- }
-
- if (removal) {
- tableUpdate->NewRemovalIndices(removal->Elements(), removal->Length());
- }
-
- if (checksum) {
- std::string stdChecksum;
- stdChecksum.assign(const_cast<char*>(checksum->BeginReading()), checksum->Length());
-
- tableUpdate->NewChecksum(stdChecksum);
- }
-
- tableUpdates.AppendElement(tableUpdate);
-}
-
-static void
-VerifyPrefixSet(PrefixStringMap& expected)
-{
- // Verify the prefix set is written to disk.
- nsCOMPtr<nsIFile> file;
- NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file));
-
- file->AppendNative(GTEST_SAFEBROWSING_DIR);
- file->AppendNative(GTEST_PREFIXFILE);
-
- RefPtr<VariableLengthPrefixSet> load = new VariableLengthPrefixSet;
- load->Init(GTEST_TABLE);
-
- PrefixStringMap prefixesInFile;
- load->LoadFromFile(file);
- load->GetPrefixes(prefixesInFile);
-
- for (auto iter = expected.ConstIter(); !iter.Done(); iter.Next()) {
- nsCString* expectedPrefix = iter.Data();
- nsCString* resultPrefix = prefixesInFile.Get(iter.Key());
-
- ASSERT_TRUE(*resultPrefix == *expectedPrefix);
- }
-}
-
-static void
-Clear()
-{
- nsCOMPtr<nsIFile> file;
- NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file));
-
- UniquePtr<Classifier> classifier(new Classifier());
- classifier->Open(*file);
- classifier->Reset();
-}
-
-static void
-testUpdateFail(nsTArray<TableUpdate*>& tableUpdates)
-{
- nsCOMPtr<nsIFile> file;
- NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file));
-
- UniquePtr<Classifier> classifier(new Classifier());
- classifier->Open(*file);
-
- RunTestInNewThread([&] () -> void {
- nsresult rv = classifier->ApplyUpdates(&tableUpdates);
- ASSERT_TRUE(NS_FAILED(rv));
- });
-}
-
-static void
-testUpdate(nsTArray<TableUpdate*>& tableUpdates,
- PrefixStringMap& expected)
-{
- nsCOMPtr<nsIFile> file;
- NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file));
-
- UniquePtr<Classifier> classifier(new Classifier());
- classifier->Open(*file);
-
- RunTestInNewThread([&] () -> void {
- nsresult rv = classifier->ApplyUpdates(&tableUpdates);
- ASSERT_TRUE(rv == NS_OK);
-
- VerifyPrefixSet(expected);
- });
-}
-
-static void
-testFullUpdate(PrefixStringMap& add, nsCString* checksum)
-{
- nsTArray<TableUpdate*> tableUpdates;
-
- GenerateUpdateData(true, add, nullptr, checksum, tableUpdates);
-
- testUpdate(tableUpdates, add);
-}
-
-static void
-testPartialUpdate(PrefixStringMap& add,
- nsTArray<uint32_t>* removal,
- nsCString* checksum,
- PrefixStringMap& expected)
-{
- nsTArray<TableUpdate*> tableUpdates;
- GenerateUpdateData(false, add, removal, checksum, tableUpdates);
-
- testUpdate(tableUpdates, expected);
-}
-
-static void
-testOpenLookupCache()
-{
- nsCOMPtr<nsIFile> file;
- NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR, getter_AddRefs(file));
- file->AppendNative(GTEST_SAFEBROWSING_DIR);
-
- RunTestInNewThread([&] () -> void {
- LookupCacheV4 cache(nsCString(GTEST_TABLE), EmptyCString(), file);
- nsresult rv = cache.Init();
- ASSERT_EQ(rv, NS_OK);
-
- rv = cache.Open();
- ASSERT_EQ(rv, NS_OK);
- });
-}
-
-// Tests start from here.
-TEST(UrlClassifierTableUpdateV4, FixLenghtPSetFullUpdate)
-{
- srand(time(NULL));
-
- _PrefixArray array;
- PrefixStringMap map;
- nsCString checksum;
-
- CreateRandomSortedPrefixArray(5000, 4, 4, array);
- PrefixArrayToPrefixStringMap(array, map);
- CalculateCheckSum(array, checksum);
-
- testFullUpdate(map, &checksum);
-
- Clear();
-}
-
-TEST(UrlClassifierTableUpdateV4, VariableLenghtPSetFullUpdate)
-{
- _PrefixArray array;
- PrefixStringMap map;
- nsCString checksum;
-
- CreateRandomSortedPrefixArray(5000, 5, 32, array);
- PrefixArrayToPrefixStringMap(array, map);
- CalculateCheckSum(array, checksum);
-
- testFullUpdate(map, &checksum);
-
- Clear();
-}
-
-// This test contain both variable length prefix set and fixed-length prefix set
-TEST(UrlClassifierTableUpdateV4, MixedPSetFullUpdate)
-{
- _PrefixArray array;
- PrefixStringMap map;
- nsCString checksum;
-
- CreateRandomSortedPrefixArray(5000, 4, 4, array);
- CreateRandomSortedPrefixArray(1000, 5, 32, array);
- PrefixArrayToPrefixStringMap(array, map);
- CalculateCheckSum(array, checksum);
-
- testFullUpdate(map, &checksum);
-
- Clear();
-}
-
-TEST(UrlClassifierTableUpdateV4, PartialUpdateWithRemoval)
-{
- _PrefixArray fArray;
-
- // Apply a full update first.
- {
- PrefixStringMap fMap;
- nsCString checksum;
-
- CreateRandomSortedPrefixArray(10000, 4, 4, fArray);
- CreateRandomSortedPrefixArray(2000, 5, 32, fArray);
- PrefixArrayToPrefixStringMap(fArray, fMap);
- CalculateCheckSum(fArray, checksum);
-
- testFullUpdate(fMap, &checksum);
- }
-
- // Apply a partial update with removal.
- {
- _PrefixArray pArray, mergedArray;
- PrefixStringMap pMap, mergedMap;
- nsCString checksum;
-
- CreateRandomSortedPrefixArray(5000, 4, 4, pArray);
- CreateRandomSortedPrefixArray(1000, 5, 32, pArray);
- RemoveIntersection(fArray, pArray);
- PrefixArrayToPrefixStringMap(pArray, pMap);
-
- // Remove 1/5 of elements of original prefix set.
- nsTArray<uint32_t> removal;
- CreateRandomRemovalIndices(fArray.Length() / 5, fArray.Length(), removal);
- RemoveElements(removal, fArray);
-
- // Calculate the expected prefix map.
- MergeAndSortArray(fArray, pArray, mergedArray);
- PrefixArrayToPrefixStringMap(mergedArray, mergedMap);
- CalculateCheckSum(mergedArray, checksum);
-
- testPartialUpdate(pMap, &removal, &checksum, mergedMap);
- }
-
- Clear();
-}
-
-TEST(UrlClassifierTableUpdateV4, PartialUpdateWithoutRemoval)
-{
- _PrefixArray fArray;
-
- // Apply a full update first.
- {
- PrefixStringMap fMap;
- nsCString checksum;
-
- CreateRandomSortedPrefixArray(10000, 4, 4, fArray);
- CreateRandomSortedPrefixArray(2000, 5, 32, fArray);
- PrefixArrayToPrefixStringMap(fArray, fMap);
- CalculateCheckSum(fArray, checksum);
-
- testFullUpdate(fMap, &checksum);
- }
-
- // Apply a partial update without removal
- {
- _PrefixArray pArray, mergedArray;
- PrefixStringMap pMap, mergedMap;
- nsCString checksum;
-
- CreateRandomSortedPrefixArray(5000, 4, 4, pArray);
- CreateRandomSortedPrefixArray(1000, 5, 32, pArray);
- RemoveIntersection(fArray, pArray);
- PrefixArrayToPrefixStringMap(pArray, pMap);
-
- // Calculate the expected prefix map.
- MergeAndSortArray(fArray, pArray, mergedArray);
- PrefixArrayToPrefixStringMap(mergedArray, mergedMap);
- CalculateCheckSum(mergedArray, checksum);
-
- testPartialUpdate(pMap, nullptr, &checksum, mergedMap);
- }
-
- Clear();
-}
-
-// Expect failure because partial update contains prefix already
-// in old prefix set.
-TEST(UrlClassifierTableUpdateV4, PartialUpdatePrefixAlreadyExist)
-{
- _PrefixArray fArray;
-
- // Apply a full update fist.
- {
- PrefixStringMap fMap;
- nsCString checksum;
-
- CreateRandomSortedPrefixArray(1000, 4, 32, fArray);
- PrefixArrayToPrefixStringMap(fArray, fMap);
- CalculateCheckSum(fArray, checksum);
-
- testFullUpdate(fMap, &checksum);
- }
-
- // Apply a partial update which contains a prefix in previous full update.
- // This should cause an update error.
- {
- _PrefixArray pArray;
- PrefixStringMap pMap;
- nsTArray<TableUpdate*> tableUpdates;
-
- // Pick one prefix from full update prefix and add it to partial update.
- // This should result a failure when call ApplyUpdates.
- pArray.AppendElement(fArray[rand() % fArray.Length()]);
- CreateRandomSortedPrefixArray(200, 4, 32, pArray);
- PrefixArrayToPrefixStringMap(pArray, pMap);
-
- GenerateUpdateData(false, pMap, nullptr, nullptr, tableUpdates);
- testUpdateFail(tableUpdates);
- }
-
- Clear();
-}
-
-// Test apply partial update directly without applying an full update first.
-TEST(UrlClassifierTableUpdateV4, OnlyPartialUpdate)
-{
- _PrefixArray pArray;
- PrefixStringMap pMap;
- nsCString checksum;
-
- CreateRandomSortedPrefixArray(5000, 4, 4, pArray);
- CreateRandomSortedPrefixArray(1000, 5, 32, pArray);
- PrefixArrayToPrefixStringMap(pArray, pMap);
- CalculateCheckSum(pArray, checksum);
-
- testPartialUpdate(pMap, nullptr, &checksum, pMap);
-
- Clear();
-}
-
-// Test partial update without any ADD prefixes, only removalIndices.
-TEST(UrlClassifierTableUpdateV4, PartialUpdateOnlyRemoval)
-{
- _PrefixArray fArray;
-
- // Apply a full update first.
- {
- PrefixStringMap fMap;
- nsCString checksum;
-
- CreateRandomSortedPrefixArray(5000, 4, 4, fArray);
- CreateRandomSortedPrefixArray(1000, 5, 32, fArray);
- PrefixArrayToPrefixStringMap(fArray, fMap);
- CalculateCheckSum(fArray, checksum);
-
- testFullUpdate(fMap, &checksum);
- }
-
- // Apply a partial update without add prefix, only contain removal indices.
- {
- _PrefixArray pArray;
- PrefixStringMap pMap, mergedMap;
- nsCString checksum;
-
- // Remove 1/5 of elements of original prefix set.
- nsTArray<uint32_t> removal;
- CreateRandomRemovalIndices(fArray.Length() / 5, fArray.Length(), removal);
- RemoveElements(removal, fArray);
-
- PrefixArrayToPrefixStringMap(fArray, mergedMap);
- CalculateCheckSum(fArray, checksum);
-
- testPartialUpdate(pMap, &removal, &checksum, mergedMap);
- }
-
- Clear();
-}
-
-// Test one tableupdate array contains full update and multiple partial updates.
-TEST(UrlClassifierTableUpdateV4, MultipleTableUpdates)
-{
- _PrefixArray fArray, pArray, mergedArray;
- PrefixStringMap fMap, pMap, mergedMap;
- nsCString checksum;
-
- nsTArray<TableUpdate*> tableUpdates;
-
- // Generate first full udpate
- CreateRandomSortedPrefixArray(10000, 4, 4, fArray);
- CreateRandomSortedPrefixArray(2000, 5, 32, fArray);
- PrefixArrayToPrefixStringMap(fArray, fMap);
- CalculateCheckSum(fArray, checksum);
-
- GenerateUpdateData(true, fMap, nullptr, &checksum, tableUpdates);
-
- // Generate second partial update
- CreateRandomSortedPrefixArray(3000, 4, 4, pArray);
- CreateRandomSortedPrefixArray(1000, 5, 32, pArray);
- RemoveIntersection(fArray, pArray);
- PrefixArrayToPrefixStringMap(pArray, pMap);
-
- MergeAndSortArray(fArray, pArray, mergedArray);
- CalculateCheckSum(mergedArray, checksum);
-
- GenerateUpdateData(false, pMap, nullptr, &checksum, tableUpdates);
-
- // Generate thrid partial update
- fArray.AppendElements(pArray);
- fArray.Sort();
- pArray.Clear();
- CreateRandomSortedPrefixArray(3000, 4, 4, pArray);
- CreateRandomSortedPrefixArray(1000, 5, 32, pArray);
- RemoveIntersection(fArray, pArray);
- PrefixArrayToPrefixStringMap(pArray, pMap);
-
- // Remove 1/5 of elements of original prefix set.
- nsTArray<uint32_t> removal;
- CreateRandomRemovalIndices(fArray.Length() / 5, fArray.Length(), removal);
- RemoveElements(removal, fArray);
-
- MergeAndSortArray(fArray, pArray, mergedArray);
- PrefixArrayToPrefixStringMap(mergedArray, mergedMap);
- CalculateCheckSum(mergedArray, checksum);
-
- GenerateUpdateData(false, pMap, &removal, &checksum, tableUpdates);
-
- testUpdate(tableUpdates, mergedMap);
-
- Clear();
-}
-
-// Test apply full update first, and then apply multiple partial updates
-// in one tableupdate array.
-TEST(UrlClassifierTableUpdateV4, MultiplePartialUpdateTableUpdates)
-{
- _PrefixArray fArray;
-
- // Apply a full update first
- {
- PrefixStringMap fMap;
- nsCString checksum;
-
- // Generate first full udpate
- CreateRandomSortedPrefixArray(10000, 4, 4, fArray);
- CreateRandomSortedPrefixArray(3000, 5, 32, fArray);
- PrefixArrayToPrefixStringMap(fArray, fMap);
- CalculateCheckSum(fArray, checksum);
-
- testFullUpdate(fMap, &checksum);
- }
-
- // Apply multiple partial updates in one table update
- {
- _PrefixArray pArray, mergedArray;
- PrefixStringMap pMap, mergedMap;
- nsCString checksum;
- nsTArray<uint32_t> removal;
- nsTArray<TableUpdate*> tableUpdates;
-
- // Generate first partial update
- CreateRandomSortedPrefixArray(3000, 4, 4, pArray);
- CreateRandomSortedPrefixArray(1000, 5, 32, pArray);
- RemoveIntersection(fArray, pArray);
- PrefixArrayToPrefixStringMap(pArray, pMap);
-
- // Remove 1/5 of elements of original prefix set.
- CreateRandomRemovalIndices(fArray.Length() / 5, fArray.Length(), removal);
- RemoveElements(removal, fArray);
-
- MergeAndSortArray(fArray, pArray, mergedArray);
- CalculateCheckSum(mergedArray, checksum);
-
- GenerateUpdateData(false, pMap, &removal, &checksum, tableUpdates);
-
- fArray.AppendElements(pArray);
- fArray.Sort();
- pArray.Clear();
- removal.Clear();
-
- // Generate second partial update.
- CreateRandomSortedPrefixArray(2000, 4, 4, pArray);
- CreateRandomSortedPrefixArray(1000, 5, 32, pArray);
- RemoveIntersection(fArray, pArray);
- PrefixArrayToPrefixStringMap(pArray, pMap);
-
- // Remove 1/5 of elements of original prefix set.
- CreateRandomRemovalIndices(fArray.Length() / 5, fArray.Length(), removal);
- RemoveElements(removal, fArray);
-
- MergeAndSortArray(fArray, pArray, mergedArray);
- PrefixArrayToPrefixStringMap(mergedArray, mergedMap);
- CalculateCheckSum(mergedArray, checksum);
-
- GenerateUpdateData(false, pMap, &removal, &checksum, tableUpdates);
-
- testUpdate(tableUpdates, mergedMap);
- }
-
- Clear();
-}
-
-// Test removal indices are larger than the original prefix set.
-TEST(UrlClassifierTableUpdateV4, RemovalIndexTooLarge)
-{
- _PrefixArray fArray;
-
- // Apply a full update first
- {
- PrefixStringMap fMap;
- nsCString checksum;
-
- CreateRandomSortedPrefixArray(1000, 4, 32, fArray);
- PrefixArrayToPrefixStringMap(fArray, fMap);
- CalculateCheckSum(fArray, checksum);
-
- testFullUpdate(fMap, &checksum);
- }
-
- // Apply a partial update with removal indice array larger than
- // old prefix set(fArray). This should cause an error.
- {
- _PrefixArray pArray;
- PrefixStringMap pMap;
- nsTArray<uint32_t> removal;
- nsTArray<TableUpdate*> tableUpdates;
-
- CreateRandomSortedPrefixArray(200, 4, 32, pArray);
- RemoveIntersection(fArray, pArray);
- PrefixArrayToPrefixStringMap(pArray, pMap);
-
- for (uint32_t i = 0; i < fArray.Length() + 1 ;i++) {
- removal.AppendElement(i);
- }
-
- GenerateUpdateData(false, pMap, &removal, nullptr, tableUpdates);
- testUpdateFail(tableUpdates);
- }
-
- Clear();
-}
-
-TEST(UrlClassifierTableUpdateV4, ChecksumMismatch)
-{
- // Apply a full update first
- {
- _PrefixArray fArray;
- PrefixStringMap fMap;
- nsCString checksum;
-
- CreateRandomSortedPrefixArray(1000, 4, 32, fArray);
- PrefixArrayToPrefixStringMap(fArray, fMap);
- CalculateCheckSum(fArray, checksum);
-
- testFullUpdate(fMap, &checksum);
- }
-
- // Apply a partial update with incorrect checksum
- {
- _PrefixArray pArray;
- PrefixStringMap pMap;
- nsCString checksum;
- nsTArray<TableUpdate*> tableUpdates;
-
- CreateRandomSortedPrefixArray(200, 4, 32, pArray);
- PrefixArrayToPrefixStringMap(pArray, pMap);
-
- // Checksum should be calculated with both old prefix set and add prefix set,
- // here we only calculate checksum with add prefix set to check if applyUpdate
- // will return failure.
- CalculateCheckSum(pArray, checksum);
-
- GenerateUpdateData(false, pMap, nullptr, &checksum, tableUpdates);
- testUpdateFail(tableUpdates);
- }
-
- Clear();
-}
-
-TEST(UrlClassifierTableUpdateV4, ApplyUpdateThenLoad)
-{
- // Apply update with checksum
- {
- _PrefixArray fArray;
- PrefixStringMap fMap;
- nsCString checksum;
-
- CreateRandomSortedPrefixArray(1000, 4, 32, fArray);
- PrefixArrayToPrefixStringMap(fArray, fMap);
- CalculateCheckSum(fArray, checksum);
-
- testFullUpdate(fMap, &checksum);
-
- // Open lookup cache will load prefix set and verify the checksum
- testOpenLookupCache();
- }
-
- Clear();
-
- // Apply update without checksum
- {
- _PrefixArray fArray;
- PrefixStringMap fMap;
-
- CreateRandomSortedPrefixArray(1000, 4, 32, fArray);
- PrefixArrayToPrefixStringMap(fArray, fMap);
-
- testFullUpdate(fMap, nullptr);
-
- testOpenLookupCache();
- }
-
- Clear();
-}
-
-// This test is used to avoid an eror from nsICryptoHash
-TEST(UrlClassifierTableUpdateV4, ApplyUpdateWithFixedChecksum)
-{
- _PrefixArray fArray = { _Prefix("enus"), _Prefix("apollo"), _Prefix("mars"),
- _Prefix("Hecatonchires cyclopes"),
- _Prefix("vesta"), _Prefix("neptunus"), _Prefix("jupiter"),
- _Prefix("diana"), _Prefix("minerva"), _Prefix("ceres"),
- _Prefix("Aidos,Adephagia,Adikia,Aletheia"),
- _Prefix("hecatonchires"), _Prefix("alcyoneus"), _Prefix("hades"),
- _Prefix("vulcanus"), _Prefix("juno"), _Prefix("mercury"),
- _Prefix("Stheno, Euryale and Medusa")
- };
- fArray.Sort();
-
- PrefixStringMap fMap;
- PrefixArrayToPrefixStringMap(fArray, fMap);
-
- nsCString checksum("\xae\x18\x94\xd7\xd0\x83\x5f\xc1"
- "\x58\x59\x5c\x2c\x72\xb9\x6e\x5e"
- "\xf4\xe8\x0a\x6b\xff\x5e\x6b\x81"
- "\x65\x34\x06\x16\x06\x59\xa0\x67");
-
- testFullUpdate(fMap, &checksum);
-
- // Open lookup cache will load prefix set and verify the checksum
- testOpenLookupCache();
-
- Clear();
-}
-
diff --git a/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierUtils.cpp b/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierUtils.cpp
deleted file mode 100644
index fa5ce4f56..000000000
--- a/toolkit/components/url-classifier/tests/gtest/TestUrlClassifierUtils.cpp
+++ /dev/null
@@ -1,276 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdio.h>
-#include <ctype.h>
-
-#include <mozilla/RefPtr.h>
-#include "nsString.h"
-#include "nsEscape.h"
-#include "nsUrlClassifierUtils.h"
-#include "stdlib.h"
-#include "gtest/gtest.h"
-
-static char int_to_hex_digit(int32_t i) {
- NS_ASSERTION((i >= 0) && (i <= 15), "int too big in int_to_hex_digit");
- return static_cast<char>(((i < 10) ? (i + '0') : ((i - 10) + 'A')));
-}
-
-static void CheckEquals(nsCString& expected, nsCString& actual)
-{
- ASSERT_TRUE((expected).Equals((actual)));
-}
-
-void TestUnescapeHelper(const char* in, const char* expected)
-{
- nsCString out, strIn(in), strExp(expected);
-
- NS_UnescapeURL(strIn.get(), strIn.Length(), esc_AlwaysCopy, out);
- CheckEquals(strExp, out);
-}
-
-// Make sure Unescape from nsEncode.h's unescape does what the server does.
-TEST(UrlClassifierUtils, Unescape)
-{
- // test empty string
- TestUnescapeHelper("\0", "\0");
-
- // Test docoding of all characters.
- nsCString allCharsEncoded, allCharsEncodedLowercase, allCharsAsString;
- for (int32_t i = 1; i < 256; ++i) {
- allCharsEncoded.Append('%');
- allCharsEncoded.Append(int_to_hex_digit(i / 16));
- allCharsEncoded.Append((int_to_hex_digit(i % 16)));
-
- allCharsEncodedLowercase.Append('%');
- allCharsEncodedLowercase.Append(tolower(int_to_hex_digit(i / 16)));
- allCharsEncodedLowercase.Append(tolower(int_to_hex_digit(i % 16)));
-
- allCharsAsString.Append(static_cast<char>(i));
- }
-
- nsCString out;
- NS_UnescapeURL(allCharsEncoded.get(),
- allCharsEncoded.Length(),
- esc_AlwaysCopy,
- out);
-
- CheckEquals(allCharsAsString, out);
-
- out.Truncate();
- NS_UnescapeURL(allCharsEncodedLowercase.get(),
- allCharsEncodedLowercase.Length(),
- esc_AlwaysCopy,
- out);
- CheckEquals(allCharsAsString, out);
-
- // Test %-related edge cases
- TestUnescapeHelper("%", "%");
- TestUnescapeHelper("%xx", "%xx");
- TestUnescapeHelper("%%", "%%");
- TestUnescapeHelper("%%%", "%%%");
- TestUnescapeHelper("%%%%", "%%%%");
- TestUnescapeHelper("%1", "%1");
- TestUnescapeHelper("%1z", "%1z");
- TestUnescapeHelper("a%1z", "a%1z");
- TestUnescapeHelper("abc%d%e%fg%hij%klmno%", "abc%d%e%fg%hij%klmno%");
-
- // A few more tests
- TestUnescapeHelper("%25", "%");
- TestUnescapeHelper("%25%32%35", "%25");
-}
-
-void TestEncodeHelper(const char* in, const char* expected)
-{
- nsCString out, strIn(in), strExp(expected);
- RefPtr<nsUrlClassifierUtils> utils = new nsUrlClassifierUtils;
- utils->Init();
-
- utils->SpecialEncode(strIn, true, out);
- CheckEquals(strExp, out);
-}
-
-TEST(UrlClassifierUtils, Enc)
-{
- // Test empty string
- TestEncodeHelper("", "");
-
- // Test that all characters we shouldn't encode ([33-36],[38,126]) are not.
- nsCString noenc;
- for (int32_t i = 33; i < 127; i++) {
- if (i != 37) { // skip %
- noenc.Append(static_cast<char>(i));
- }
- }
- RefPtr<nsUrlClassifierUtils> utils = new nsUrlClassifierUtils;
- utils->Init();
- nsCString out;
- utils->SpecialEncode(noenc, false, out);
- CheckEquals(noenc, out);
-
- // Test that all the chars that we should encode [0,32],37,[127,255] are
- nsCString yesAsString, yesExpectedString;
- for (int32_t i = 1; i < 256; i++) {
- if (i < 33 || i == 37 || i > 126) {
- yesAsString.Append(static_cast<char>(i));
- yesExpectedString.Append('%');
- yesExpectedString.Append(int_to_hex_digit(i / 16));
- yesExpectedString.Append(int_to_hex_digit(i % 16));
- }
- }
-
- out.Truncate();
- utils->SpecialEncode(yesAsString, false, out);
- CheckEquals(yesExpectedString, out);
-
- TestEncodeHelper("blah//blah", "blah/blah");
-}
-
-void TestCanonicalizeHelper(const char* in, const char* expected)
-{
- nsCString out, strIn(in), strExp(expected);
- RefPtr<nsUrlClassifierUtils> utils = new nsUrlClassifierUtils;
- utils->Init();
-
- utils->CanonicalizePath(strIn, out);
- CheckEquals(strExp, out);
-}
-
-TEST(UrlClassifierUtils, Canonicalize)
-{
- // Test repeated %-decoding. Note: %25 --> %, %32 --> 2, %35 --> 5
- TestCanonicalizeHelper("%25", "%25");
- TestCanonicalizeHelper("%25%32%35", "%25");
- TestCanonicalizeHelper("asdf%25%32%35asd", "asdf%25asd");
- TestCanonicalizeHelper("%%%25%32%35asd%%", "%25%25%25asd%25%25");
- TestCanonicalizeHelper("%25%32%35%25%32%35%25%32%35", "%25%25%25");
- TestCanonicalizeHelper("%25", "%25");
- TestCanonicalizeHelper("%257Ea%2521b%2540c%2523d%2524e%25f%255E00%252611%252A22%252833%252944_55%252B",
- "~a!b@c#d$e%25f^00&11*22(33)44_55+");
-
- TestCanonicalizeHelper("", "");
- TestCanonicalizeHelper("%31%36%38%2e%31%38%38%2e%39%39%2e%32%36/%2E%73%65%63%75%72%65/%77%77%77%2E%65%62%61%79%2E%63%6F%6D/",
- "168.188.99.26/.secure/www.ebay.com/");
- TestCanonicalizeHelper("195.127.0.11/uploads/%20%20%20%20/.verify/.eBaysecure=updateuserdataxplimnbqmn-xplmvalidateinfoswqpcmlx=hgplmcx/",
- "195.127.0.11/uploads/%20%20%20%20/.verify/.eBaysecure=updateuserdataxplimnbqmn-xplmvalidateinfoswqpcmlx=hgplmcx/");
- // Added in bug 489455. %00 should no longer be changed to %01.
- TestCanonicalizeHelper("%00", "%00");
-}
-
-void TestParseIPAddressHelper(const char *in, const char *expected)
-{
- nsCString out, strIn(in), strExp(expected);
- RefPtr<nsUrlClassifierUtils> utils = new nsUrlClassifierUtils;
- utils->Init();
-
- utils->ParseIPAddress(strIn, out);
- CheckEquals(strExp, out);
-}
-
-TEST(UrlClassifierUtils, ParseIPAddress)
-{
- TestParseIPAddressHelper("123.123.0.0.1", "");
- TestParseIPAddressHelper("255.0.0.1", "255.0.0.1");
- TestParseIPAddressHelper("12.0x12.01234", "12.18.2.156");
- TestParseIPAddressHelper("276.2.3", "20.2.0.3");
- TestParseIPAddressHelper("012.034.01.055", "10.28.1.45");
- TestParseIPAddressHelper("0x12.0x43.0x44.0x01", "18.67.68.1");
- TestParseIPAddressHelper("167838211", "10.1.2.3");
- TestParseIPAddressHelper("3279880203", "195.127.0.11");
- TestParseIPAddressHelper("0x12434401", "18.67.68.1");
- TestParseIPAddressHelper("413960661", "24.172.137.213");
- TestParseIPAddressHelper("03053104725", "24.172.137.213");
- TestParseIPAddressHelper("030.0254.0x89d5", "24.172.137.213");
- TestParseIPAddressHelper("1.234.4.0377", "1.234.4.255");
- TestParseIPAddressHelper("1.2.3.00x0", "");
- TestParseIPAddressHelper("10.192.95.89 xy", "10.192.95.89");
- TestParseIPAddressHelper("10.192.95.89 xyz", "");
- TestParseIPAddressHelper("1.2.3.0x0", "1.2.3.0");
- TestParseIPAddressHelper("1.2.3.4", "1.2.3.4");
-}
-
-void TestCanonicalNumHelper(const char *in, uint32_t bytes,
- bool allowOctal, const char *expected)
-{
- nsCString out, strIn(in), strExp(expected);
- RefPtr<nsUrlClassifierUtils> utils = new nsUrlClassifierUtils;
- utils->Init();
-
- utils->CanonicalNum(strIn, bytes, allowOctal, out);
- CheckEquals(strExp, out);
-}
-
-TEST(UrlClassifierUtils, CanonicalNum)
-{
- TestCanonicalNumHelper("", 1, true, "");
- TestCanonicalNumHelper("10", 0, true, "");
- TestCanonicalNumHelper("45", 1, true, "45");
- TestCanonicalNumHelper("0x10", 1, true, "16");
- TestCanonicalNumHelper("367", 2, true, "1.111");
- TestCanonicalNumHelper("012345", 3, true, "0.20.229");
- TestCanonicalNumHelper("0173", 1, true, "123");
- TestCanonicalNumHelper("09", 1, false, "9");
- TestCanonicalNumHelper("0x120x34", 2, true, "");
- TestCanonicalNumHelper("0x12fc", 2, true, "18.252");
- TestCanonicalNumHelper("3279880203", 4, true, "195.127.0.11");
- TestCanonicalNumHelper("0x0000059", 1, true, "89");
- TestCanonicalNumHelper("0x00000059", 1, true, "89");
- TestCanonicalNumHelper("0x0000067", 1, true, "103");
-}
-
-void TestHostnameHelper(const char *in, const char *expected)
-{
- nsCString out, strIn(in), strExp(expected);
- RefPtr<nsUrlClassifierUtils> utils = new nsUrlClassifierUtils;
- utils->Init();
-
- utils->CanonicalizeHostname(strIn, out);
- CheckEquals(strExp, out);
-}
-
-TEST(UrlClassifierUtils, Hostname)
-{
- TestHostnameHelper("abcd123;[]", "abcd123;[]");
- TestHostnameHelper("abc.123", "abc.123");
- TestHostnameHelper("abc..123", "abc.123");
- TestHostnameHelper("trailing.", "trailing");
- TestHostnameHelper("i love trailing dots....", "i%20love%20trailing%20dots");
- TestHostnameHelper(".leading", "leading");
- TestHostnameHelper("..leading", "leading");
- TestHostnameHelper(".dots.", "dots");
- TestHostnameHelper(".both.", "both");
- TestHostnameHelper(".both..", "both");
- TestHostnameHelper("..both.", "both");
- TestHostnameHelper("..both..", "both");
- TestHostnameHelper("..a.b.c.d..", "a.b.c.d");
- TestHostnameHelper("..127.0.0.1..", "127.0.0.1");
- TestHostnameHelper("asdf!@#$a", "asdf!@#$a");
- TestHostnameHelper("AB CD 12354", "ab%20cd%2012354");
- TestHostnameHelper("\1\2\3\4\112\177", "%01%02%03%04j%7F");
- TestHostnameHelper("<>.AS/-+", "<>.as/-+");
- // Added in bug 489455. %00 should no longer be changed to %01.
- TestHostnameHelper("%00", "%00");
-}
-
-TEST(UrlClassifierUtils, LongHostname)
-{
- static const int kTestSize = 1024 * 150;
- char *str = static_cast<char*>(malloc(kTestSize + 1));
- memset(str, 'x', kTestSize);
- str[kTestSize] = '\0';
-
- RefPtr<nsUrlClassifierUtils> utils = new nsUrlClassifierUtils;
- utils->Init();
-
- nsAutoCString out;
- nsDependentCString in(str);
- PRIntervalTime clockStart = PR_IntervalNow();
- utils->CanonicalizeHostname(in, out);
- PRIntervalTime clockEnd = PR_IntervalNow();
-
- CheckEquals(in, out);
-
- printf("CanonicalizeHostname on long string (%dms)\n",
- PR_IntervalToMilliseconds(clockEnd - clockStart));
-}
diff --git a/toolkit/components/url-classifier/tests/gtest/TestVariableLengthPrefixSet.cpp b/toolkit/components/url-classifier/tests/gtest/TestVariableLengthPrefixSet.cpp
deleted file mode 100644
index 9e380a9d3..000000000
--- a/toolkit/components/url-classifier/tests/gtest/TestVariableLengthPrefixSet.cpp
+++ /dev/null
@@ -1,559 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <mozilla/RefPtr.h>
-#include "nsString.h"
-#include "nsTArray.h"
-#include "nsClassHashtable.h"
-#include "VariableLengthPrefixSet.h"
-#include "nsAppDirectoryServiceDefs.h"
-#include "nsIFile.h"
-#include "gtest/gtest.h"
-
-using namespace mozilla::safebrowsing;
-
-typedef nsCString _Prefix;
-typedef nsTArray<_Prefix> _PrefixArray;
-
-// Create fullhash by appending random characters.
-static nsCString* CreateFullHash(const nsACString& in)
-{
- nsCString* out = new nsCString(in);
- out->SetLength(32);
- for (size_t i = in.Length(); i < 32; i++) {
- out->SetCharAt(char(rand() % 256), i);
- }
-
- return out;
-}
-
-// This function generate N prefixes with size between MIN and MAX.
-// The output array will not be cleared, random result will append to it
-static void RandomPrefixes(uint32_t N, uint32_t MIN, uint32_t MAX, _PrefixArray& array)
-{
- array.SetCapacity(array.Length() + N);
-
- uint32_t range = (MAX - MIN + 1);
-
- for (uint32_t i = 0; i < N; i++) {
- uint32_t prefixSize = (rand() % range) + MIN;
- _Prefix prefix;
- prefix.SetLength(prefixSize);
-
- bool added = false;
- while(!added) {
- char* dst = prefix.BeginWriting();
- for (uint32_t j = 0; j < prefixSize; j++) {
- dst[j] = rand() % 256;
- }
-
- if (!array.Contains(prefix)) {
- array.AppendElement(prefix);
- added = true;
- }
- }
- }
-}
-
-static void CheckContent(VariableLengthPrefixSet* pset,
- PrefixStringMap& expected)
-{
- PrefixStringMap vlPSetMap;
- pset->GetPrefixes(vlPSetMap);
-
- for (auto iter = vlPSetMap.Iter(); !iter.Done(); iter.Next()) {
- nsCString* expectedPrefix = expected.Get(iter.Key());
- nsCString* resultPrefix = iter.Data();
-
- ASSERT_TRUE(resultPrefix->Equals(*expectedPrefix));
- }
-}
-
-// This test loops through all the prefixes and converts each prefix to
-// fullhash by appending random characters, each converted fullhash
-// should at least match its original length in the prefixSet.
-static void DoExpectedLookup(VariableLengthPrefixSet* pset,
- _PrefixArray& array)
-{
- uint32_t matchLength = 0;
- for (uint32_t i = 0; i < array.Length(); i++) {
- const nsCString& prefix = array[i];
- UniquePtr<nsCString> fullhash(CreateFullHash(prefix));
-
- // Find match for prefix-generated full hash
- pset->Matches(*fullhash, &matchLength);
- MOZ_ASSERT(matchLength != 0);
-
- if (matchLength != prefix.Length()) {
- // Return match size is not the same as prefix size.
- // In this case it could be because the generated fullhash match other
- // prefixes, check if this prefix exist.
- bool found = false;
-
- for (uint32_t j = 0; j < array.Length(); j++) {
- if (array[j].Length() != matchLength) {
- continue;
- }
-
- if (0 == memcmp(fullhash->BeginReading(),
- array[j].BeginReading(),
- matchLength)) {
- found = true;
- break;
- }
- }
- ASSERT_TRUE(found);
- }
- }
-}
-
-static void DoRandomLookup(VariableLengthPrefixSet* pset,
- uint32_t N,
- _PrefixArray& array)
-{
- for (uint32_t i = 0; i < N; i++) {
- // Random 32-bytes test fullhash
- char buf[32];
- for (uint32_t j = 0; j < 32; j++) {
- buf[j] = (char)(rand() % 256);
- }
-
- // Get the expected result.
- nsTArray<uint32_t> expected;
- for (uint32_t j = 0; j < array.Length(); j++) {
- const nsACString& str = array[j];
- if (0 == memcmp(buf, str.BeginReading(), str.Length())) {
- expected.AppendElement(str.Length());
- }
- }
-
- uint32_t matchLength = 0;
- pset->Matches(nsDependentCSubstring(buf, 32), &matchLength);
-
- ASSERT_TRUE(expected.IsEmpty() ? !matchLength : expected.Contains(matchLength));
- }
-}
-
-static void SetupPrefixMap(const _PrefixArray& array,
- PrefixStringMap& map)
-{
- map.Clear();
-
- // Buckets are keyed by prefix length and contain an array of
- // all prefixes of that length.
- nsClassHashtable<nsUint32HashKey, _PrefixArray> table;
-
- for (uint32_t i = 0; i < array.Length(); i++) {
- _PrefixArray* prefixes = table.Get(array[i].Length());
- if (!prefixes) {
- prefixes = new _PrefixArray();
- table.Put(array[i].Length(), prefixes);
- }
-
- prefixes->AppendElement(array[i]);
- }
-
- // The resulting map entries will be a concatenation of all
- // prefix data for the prefixes of a given size.
- for (auto iter = table.Iter(); !iter.Done(); iter.Next()) {
- uint32_t size = iter.Key();
- uint32_t count = iter.Data()->Length();
-
- _Prefix* str = new _Prefix();
- str->SetLength(size * count);
-
- char* dst = str->BeginWriting();
-
- iter.Data()->Sort();
- for (uint32_t i = 0; i < count; i++) {
- memcpy(dst, iter.Data()->ElementAt(i).get(), size);
- dst += size;
- }
-
- map.Put(size, str);
- }
-}
-
-
-// Test setting prefix set with only 4-bytes prefixes
-TEST(VariableLengthPrefixSet, FixedLengthSet)
-{
- srand(time(nullptr));
-
- RefPtr<VariableLengthPrefixSet> pset = new VariableLengthPrefixSet;
- pset->Init(NS_LITERAL_CSTRING("test"));
-
- PrefixStringMap map;
- _PrefixArray array = { _Prefix("alph"), _Prefix("brav"), _Prefix("char"),
- _Prefix("delt"), _Prefix("echo"), _Prefix("foxt"),
- };
-
- SetupPrefixMap(array, map);
- pset->SetPrefixes(map);
-
- DoExpectedLookup(pset, array);
-
- DoRandomLookup(pset, 1000, array);
-
- CheckContent(pset, map);
-
- // Run random test
- array.Clear();
- map.Clear();
-
- RandomPrefixes(1500, 4, 4, array);
-
- SetupPrefixMap(array, map);
- pset->SetPrefixes(map);
-
- DoExpectedLookup(pset, array);
-
- DoRandomLookup(pset, 1000, array);
-
- CheckContent(pset, map);
-}
-
-// Test setting prefix set with only 5~32 bytes prefixes
-TEST(VariableLengthPrefixSet, VariableLengthSet)
-{
- RefPtr<VariableLengthPrefixSet> pset = new VariableLengthPrefixSet;
- pset->Init(NS_LITERAL_CSTRING("test"));
-
- PrefixStringMap map;
- _PrefixArray array = { _Prefix("bravo"), _Prefix("charlie"), _Prefix("delta"),
- _Prefix("EchoEchoEchoEchoEcho"), _Prefix("foxtrot"),
- _Prefix("GolfGolfGolfGolfGolfGolfGolfGolf"),
- _Prefix("hotel"), _Prefix("november"),
- _Prefix("oscar"), _Prefix("quebec"), _Prefix("romeo"),
- _Prefix("sierrasierrasierrasierrasierra"),
- _Prefix("Tango"), _Prefix("whiskey"), _Prefix("yankee"),
- _Prefix("ZuluZuluZuluZulu")
- };
-
- SetupPrefixMap(array, map);
- pset->SetPrefixes(map);
-
- DoExpectedLookup(pset, array);
-
- DoRandomLookup(pset, 1000, array);
-
- CheckContent(pset, map);
-
- // Run random test
- array.Clear();
- map.Clear();
-
- RandomPrefixes(1500, 5, 32, array);
-
- SetupPrefixMap(array, map);
- pset->SetPrefixes(map);
-
- DoExpectedLookup(pset, array);
-
- DoRandomLookup(pset, 1000, array);
-
- CheckContent(pset, map);
-
-}
-
-// Test setting prefix set with both 4-bytes prefixes and 5~32 bytes prefixes
-TEST(VariableLengthPrefixSet, MixedPrefixSet)
-{
- RefPtr<VariableLengthPrefixSet> pset = new VariableLengthPrefixSet;
- pset->Init(NS_LITERAL_CSTRING("test"));
-
- PrefixStringMap map;
- _PrefixArray array = { _Prefix("enus"), _Prefix("apollo"), _Prefix("mars"),
- _Prefix("Hecatonchires cyclopes"),
- _Prefix("vesta"), _Prefix("neptunus"), _Prefix("jupiter"),
- _Prefix("diana"), _Prefix("minerva"), _Prefix("ceres"),
- _Prefix("Aidos,Adephagia,Adikia,Aletheia"),
- _Prefix("hecatonchires"), _Prefix("alcyoneus"), _Prefix("hades"),
- _Prefix("vulcanus"), _Prefix("juno"), _Prefix("mercury"),
- _Prefix("Stheno, Euryale and Medusa")
- };
-
- SetupPrefixMap(array, map);
- pset->SetPrefixes(map);
-
- DoExpectedLookup(pset, array);
-
- DoRandomLookup(pset, 1000, array);
-
- CheckContent(pset, map);
-
- // Run random test
- array.Clear();
- map.Clear();
-
- RandomPrefixes(1500, 4, 32, array);
-
- SetupPrefixMap(array, map);
- pset->SetPrefixes(map);
-
- DoExpectedLookup(pset, array);
-
- DoRandomLookup(pset, 1000, array);
-
- CheckContent(pset, map);
-}
-
-// Test resetting prefix set
-TEST(VariableLengthPrefixSet, ResetPrefix)
-{
- RefPtr<VariableLengthPrefixSet> pset = new VariableLengthPrefixSet;
- pset->Init(NS_LITERAL_CSTRING("test"));
-
- // First prefix set
- _PrefixArray array1 = { _Prefix("Iceland"), _Prefix("Peru"), _Prefix("Mexico"),
- _Prefix("Australia"), _Prefix("Japan"), _Prefix("Egypt"),
- _Prefix("America"), _Prefix("Finland"), _Prefix("Germany"),
- _Prefix("Italy"), _Prefix("France"), _Prefix("Taiwan"),
- };
- {
- PrefixStringMap map;
-
- SetupPrefixMap(array1, map);
- pset->SetPrefixes(map);
-
- DoExpectedLookup(pset, array1);
- }
-
- // Second
- _PrefixArray array2 = { _Prefix("Pikachu"), _Prefix("Bulbasaur"), _Prefix("Charmander"),
- _Prefix("Blastoise"), _Prefix("Pidgey"), _Prefix("Mewtwo"),
- _Prefix("Jigglypuff"), _Prefix("Persian"), _Prefix("Tentacool"),
- _Prefix("Onix"), _Prefix("Eevee"), _Prefix("Jynx"),
- };
- {
- PrefixStringMap map;
-
- SetupPrefixMap(array2, map);
- pset->SetPrefixes(map);
-
- DoExpectedLookup(pset, array2);
- }
-
- // Should not match any of the first prefix set
- uint32_t matchLength = 0;
- for (uint32_t i = 0; i < array1.Length(); i++) {
- UniquePtr<nsACString> fullhash(CreateFullHash(array1[i]));
-
- pset->Matches(*fullhash, &matchLength);
- ASSERT_TRUE(matchLength == 0);
- }
-}
-
-// Test only set one 4-bytes prefix and one full-length prefix
-TEST(VariableLengthPrefixSet, TinyPrefixSet)
-{
- RefPtr<VariableLengthPrefixSet> pset = new VariableLengthPrefixSet;
- pset->Init(NS_LITERAL_CSTRING("test"));
-
- PrefixStringMap map;
- _PrefixArray array = { _Prefix("AAAA"),
- _Prefix("11112222333344445555666677778888"),
- };
-
- SetupPrefixMap(array, map);
- pset->SetPrefixes(map);
-
- DoExpectedLookup(pset, array);
-
- DoRandomLookup(pset, 1000, array);
-
- CheckContent(pset, map);
-}
-
-// Test empty prefix set and IsEmpty function
-TEST(VariableLengthPrefixSet, EmptyPrefixSet)
-{
- RefPtr<VariableLengthPrefixSet> pset = new VariableLengthPrefixSet;
- pset->Init(NS_LITERAL_CSTRING("test"));
-
- bool empty;
- pset->IsEmpty(&empty);
- ASSERT_TRUE(empty);
-
- PrefixStringMap map;
- _PrefixArray array1;
-
- // Lookup an empty array should never match
- DoRandomLookup(pset, 100, array1);
-
- // Insert an 4-bytes prefix, then IsEmpty should return false
- _PrefixArray array2 = { _Prefix("test") };
- SetupPrefixMap(array2, map);
- pset->SetPrefixes(map);
-
- pset->IsEmpty(&empty);
- ASSERT_TRUE(!empty);
-
- _PrefixArray array3 = { _Prefix("test variable length") };
-
- // Insert an 5~32 bytes prefix, then IsEmpty should return false
- SetupPrefixMap(array3, map);
- pset->SetPrefixes(map);
-
- pset->IsEmpty(&empty);
- ASSERT_TRUE(!empty);
-}
-
-// Test prefix size should only between 4~32 bytes
-TEST(VariableLengthPrefixSet, MinMaxPrefixSet)
-{
- RefPtr<VariableLengthPrefixSet> pset = new VariableLengthPrefixSet;
- pset->Init(NS_LITERAL_CSTRING("test"));
-
- PrefixStringMap map;
- {
- _PrefixArray array = { _Prefix("1234"),
- _Prefix("ABCDEFGHIJKKMNOP"),
- _Prefix("1aaa2bbb3ccc4ddd5eee6fff7ggg8hhh") };
-
- SetupPrefixMap(array, map);
- nsresult rv = pset->SetPrefixes(map);
- ASSERT_TRUE(rv == NS_OK);
- }
-
- // Prefix size less than 4-bytes should fail
- {
- _PrefixArray array = { _Prefix("123") };
-
- SetupPrefixMap(array, map);
- nsresult rv = pset->SetPrefixes(map);
- ASSERT_TRUE(NS_FAILED(rv));
- }
-
- // Prefix size greater than 32-bytes should fail
- {
- _PrefixArray array = { _Prefix("1aaa2bbb3ccc4ddd5eee6fff7ggg8hhh9") };
-
- SetupPrefixMap(array, map);
- nsresult rv = pset->SetPrefixes(map);
- ASSERT_TRUE(NS_FAILED(rv));
- }
-}
-
-// Test save then load prefix set with only 4-bytes prefixes
-TEST(VariableLengthPrefixSet, LoadSaveFixedLengthPrefixSet)
-{
- RefPtr<VariableLengthPrefixSet> save = new VariableLengthPrefixSet;
- save->Init(NS_LITERAL_CSTRING("test-save"));
-
- _PrefixArray array;
- RandomPrefixes(10000, 4, 4, array);
-
- PrefixStringMap map;
- SetupPrefixMap(array, map);
- save->SetPrefixes(map);
-
- DoExpectedLookup(save, array);
-
- DoRandomLookup(save, 1000, array);
-
- CheckContent(save, map);
-
- nsCOMPtr<nsIFile> file;
- NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
- getter_AddRefs(file));
- file->Append(NS_LITERAL_STRING("test.vlpset"));
-
- save->StoreToFile(file);
-
- RefPtr<VariableLengthPrefixSet> load = new VariableLengthPrefixSet;
- load->Init(NS_LITERAL_CSTRING("test-load"));
-
- load->LoadFromFile(file);
-
- DoExpectedLookup(load, array);
-
- DoRandomLookup(load, 1000, array);
-
- CheckContent(load, map);
-
- file->Remove(false);
-}
-
-// Test save then load prefix set with only 5~32 bytes prefixes
-TEST(VariableLengthPrefixSet, LoadSaveVariableLengthPrefixSet)
-{
- RefPtr<VariableLengthPrefixSet> save = new VariableLengthPrefixSet;
- save->Init(NS_LITERAL_CSTRING("test-save"));
-
- _PrefixArray array;
- RandomPrefixes(10000, 5, 32, array);
-
- PrefixStringMap map;
- SetupPrefixMap(array, map);
- save->SetPrefixes(map);
-
- DoExpectedLookup(save, array);
-
- DoRandomLookup(save, 1000, array);
-
- CheckContent(save, map);
-
- nsCOMPtr<nsIFile> file;
- NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
- getter_AddRefs(file));
- file->Append(NS_LITERAL_STRING("test.vlpset"));
-
- save->StoreToFile(file);
-
- RefPtr<VariableLengthPrefixSet> load = new VariableLengthPrefixSet;
- load->Init(NS_LITERAL_CSTRING("test-load"));
-
- load->LoadFromFile(file);
-
- DoExpectedLookup(load, array);
-
- DoRandomLookup(load, 1000, array);
-
- CheckContent(load, map);
-
- file->Remove(false);
-}
-
-// Test save then load prefix with both 4 bytes prefixes and 5~32 bytes prefixes
-TEST(VariableLengthPrefixSet, LoadSavePrefixSet)
-{
- RefPtr<VariableLengthPrefixSet> save = new VariableLengthPrefixSet;
- save->Init(NS_LITERAL_CSTRING("test-save"));
-
- // Try to simulate the real case that most prefixes are 4bytes
- _PrefixArray array;
- RandomPrefixes(20000, 4, 4, array);
- RandomPrefixes(1000, 5, 32, array);
-
- PrefixStringMap map;
- SetupPrefixMap(array, map);
- save->SetPrefixes(map);
-
- DoExpectedLookup(save, array);
-
- DoRandomLookup(save, 1000, array);
-
- CheckContent(save, map);
-
- nsCOMPtr<nsIFile> file;
- NS_GetSpecialDirectory(NS_APP_USER_PROFILE_50_DIR,
- getter_AddRefs(file));
- file->Append(NS_LITERAL_STRING("test.vlpset"));
-
- save->StoreToFile(file);
-
- RefPtr<VariableLengthPrefixSet> load = new VariableLengthPrefixSet;
- load->Init(NS_LITERAL_CSTRING("test-load"));
-
- load->LoadFromFile(file);
-
- DoExpectedLookup(load, array);
-
- DoRandomLookup(load, 1000, array);
-
- CheckContent(load, map);
-
- file->Remove(false);
-}
diff --git a/toolkit/components/url-classifier/tests/gtest/moz.build b/toolkit/components/url-classifier/tests/gtest/moz.build
deleted file mode 100644
index e66af9024..000000000
--- a/toolkit/components/url-classifier/tests/gtest/moz.build
+++ /dev/null
@@ -1,27 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-LOCAL_INCLUDES += [
- '../..',
-]
-
-UNIFIED_SOURCES += [
- 'Common.cpp',
- 'TestChunkSet.cpp',
- 'TestFailUpdate.cpp',
- 'TestLookupCacheV4.cpp',
- 'TestPerProviderDirectory.cpp',
- 'TestProtocolParser.cpp',
- 'TestRiceDeltaDecoder.cpp',
- 'TestSafebrowsingHash.cpp',
- 'TestSafeBrowsingProtobuf.cpp',
- 'TestTable.cpp',
- 'TestUrlClassifierTableUpdateV4.cpp',
- 'TestUrlClassifierUtils.cpp',
- 'TestVariableLengthPrefixSet.cpp',
-]
-
-FINAL_LIBRARY = 'xul-gtest'
diff --git a/toolkit/components/url-classifier/tests/jar.mn b/toolkit/components/url-classifier/tests/jar.mn
deleted file mode 100644
index 2264c2896..000000000
--- a/toolkit/components/url-classifier/tests/jar.mn
+++ /dev/null
@@ -1,2 +0,0 @@
-toolkit.jar:
- content/global/url-classifier/unittests.xul (unittests.xul)
diff --git a/toolkit/components/url-classifier/tests/mochitest/.eslintrc.js b/toolkit/components/url-classifier/tests/mochitest/.eslintrc.js
deleted file mode 100644
index 58b3df4a7..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/.eslintrc.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/mochitest.eslintrc.js",
- "../../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/url-classifier/tests/mochitest/allowlistAnnotatedFrame.html b/toolkit/components/url-classifier/tests/mochitest/allowlistAnnotatedFrame.html
deleted file mode 100644
index 9aae1b841..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/allowlistAnnotatedFrame.html
+++ /dev/null
@@ -1,144 +0,0 @@
-<html>
-<head>
-<title></title>
-
-<script type="text/javascript">
-
-// Modified by evil.js
-var scriptItem;
-
-var scriptItem1 = "untouched";
-var imageItem1 = "untouched";
-var frameItem1 = "untouched";
-var scriptItem2 = "untouched";
-var imageItem2 = "untouched";
-var frameItem2 = "untouched";
-var xhrItem = "untouched";
-var fetchItem = "untouched";
-var mediaItem1 = "untouched";
-
-function checkLoads() {
- window.parent.is(scriptItem1, "spoiled", "Should not block tracking js 1");
- window.parent.is(scriptItem2, "spoiled", "Should not block tracking js 2");
- window.parent.is(imageItem1, "spoiled", "Should not block tracking img 1");
- window.parent.is(imageItem2, "spoiled", "Should not block tracking img 2");
- window.parent.is(frameItem1, "spoiled", "Should not block tracking iframe 1");
- window.parent.is(frameItem2, "spoiled", "Should not block tracking iframe 2");
- window.parent.is(mediaItem1, "loaded", "Should not block tracking video");
- window.parent.is(xhrItem, "loaded", "Should not block tracking XHR");
- window.parent.is(fetchItem, "loaded", "Should not block fetches from tracking domains");
- window.parent.is(window.document.blockedTrackingNodeCount, 0,
- "No elements should be blocked");
-
- // End (parent) test.
- window.parent.clearPermissions();
- window.parent.SimpleTest.finish();
-}
-
-var onloadCalled = false;
-var xhrFinished = false;
-var fetchFinished = false;
-var videoLoaded = false;
-function loaded(type) {
- if (type === "onload") {
- onloadCalled = true;
- } else if (type === "xhr") {
- xhrFinished = true;
- } else if (type === "fetch") {
- fetchFinished = true;
- } else if (type === "video") {
- videoLoaded = true;
- }
-
- if (onloadCalled && xhrFinished && fetchFinished && videoLoaded) {
- checkLoads();
- }
-}
-</script>
-
-</head>
-
-<body onload="loaded('onload')">
-
-<!-- Try loading from a tracking script URI (1) -->
-<script id="badscript1" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js" onload="scriptItem1 = 'spoiled';"></script>
-
-<!-- Try loading from a tracking image URI (1) -->
-<img id="badimage1" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/raptor.jpg" onload="imageItem1 = 'spoiled';"/>
-
-<!-- Try loading from a tracking frame URI (1) -->
-<iframe id="badframe1" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/track.html" onload="frameItem1 = 'spoiled';"></iframe>
-
-<!-- Try loading from a tracking video URI -->
-<video id="badmedia1" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/vp9.webm"></video>
-
-<script>
-var v = document.getElementById("badmedia1");
-v.addEventListener("loadedmetadata", function() {
- mediaItem1 = "loaded";
- loaded("video");
-}, true);
-v.addEventListener("error", function() {
- mediaItem1 = "error";
- loaded("video");
-}, true);
-
-// Try loading from a tracking script URI (2) - The loader may follow a
-// different path depending on whether the resource is loaded from JS or HTML.
-var newScript = document.createElement("script");
-newScript.id = "badscript2";
-newScript.src = "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js";
-newScript.addEventListener("load", function onload() {scriptItem2 = 'spoiled';});
-document.body.appendChild(newScript);
-
-/// Try loading from a tracking image URI (2)
-var newImage = document.createElement("img");
-newImage.id = "badimage2";
-newImage.src = "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/raptor.jpg";
-newImage.addEventListener("load", function onload() {imageItem2 = 'spoiled'});
-document.body.appendChild(newImage);
-
-// Try loading from a tracking iframe URI (2)
-var newFrame = document.createElement("iframe");
-newFrame.id = "badframe2";
-newFrame.src = "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/track.html"
-newFrame.addEventListener("load", function onload() {frameItem2 = 'spoiled'});
-document.body.appendChild(newFrame);
-
-// Try doing an XHR against a tracking domain (bug 1216793)
-function reqListener() {
- xhrItem = "loaded";
- loaded("xhr");
-}
-function transferFailed() {
- xhrItem = "failed";
- loaded("xhr");
-}
-function transferCanceled() {
- xhrItem = "canceled";
- loaded("xhr");
-}
-var oReq = new XMLHttpRequest();
-oReq.addEventListener("load", reqListener);
-oReq.addEventListener("error", transferFailed);
-oReq.addEventListener("abort", transferCanceled);
-oReq.open("GET", "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js");
-oReq.send();
-
-// Fetch from a tracking domain
-fetch("http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js").then(function(response) {
- if(response.ok) {
- fetchItem = "loaded";
- loaded("fetch");
- } else {
- fetchItem = "badresponse";
- loaded("fetch");
- }
- }).catch(function(error) {
- fetchItem = "error";
- loaded("fetch");
-});
-</script>
-</body>
-</html>
-
diff --git a/toolkit/components/url-classifier/tests/mochitest/bad.css b/toolkit/components/url-classifier/tests/mochitest/bad.css
deleted file mode 100644
index f57b36a77..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/bad.css
+++ /dev/null
@@ -1 +0,0 @@
-#styleBad { visibility: hidden; }
diff --git a/toolkit/components/url-classifier/tests/mochitest/bad.css^headers^ b/toolkit/components/url-classifier/tests/mochitest/bad.css^headers^
deleted file mode 100644
index 4030ea1d3..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/bad.css^headers^
+++ /dev/null
@@ -1 +0,0 @@
-Cache-Control: no-store
diff --git a/toolkit/components/url-classifier/tests/mochitest/basic.vtt b/toolkit/components/url-classifier/tests/mochitest/basic.vtt
deleted file mode 100644
index 7781790d0..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/basic.vtt
+++ /dev/null
@@ -1,27 +0,0 @@
-WEBVTT
-Region: id=testOne lines=2 width=30%
-Region: id=testTwo lines=4 width=20%
-
-1
-00:00.500 --> 00:00.700 region:testOne
-This
-
-2
-00:01.200 --> 00:02.400 region:testTwo
-Is
-
-2.5
-00:02.000 --> 00:03.500 region:testOne
-(Over here?!)
-
-3
-00:02.710 --> 00:02.910
-A
-
-4
-00:03.217 --> 00:03.989
-Test
-
-5
-00:03.217 --> 00:03.989
-And more!
diff --git a/toolkit/components/url-classifier/tests/mochitest/basic.vtt^headers^ b/toolkit/components/url-classifier/tests/mochitest/basic.vtt^headers^
deleted file mode 100644
index 23de552c1..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/basic.vtt^headers^
+++ /dev/null
@@ -1 +0,0 @@
-Access-Control-Allow-Origin: * \ No newline at end of file
diff --git a/toolkit/components/url-classifier/tests/mochitest/bug_1281083.html b/toolkit/components/url-classifier/tests/mochitest/bug_1281083.html
deleted file mode 100644
index cd5770177..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/bug_1281083.html
+++ /dev/null
@@ -1,35 +0,0 @@
-<html>
-<head>
-<title></title>
-
-<script type="text/javascript">
-
-var scriptItem = "untouched";
-
-function checkLoads() {
- // Make sure the javascript did not load.
- window.parent.is(scriptItem, "untouched", "Should not load bad javascript");
-
- // Call parent.loadTestFrame again to test classification metadata in HTTP
- // cache entries.
- if (window.parent.firstLoad) {
- window.parent.info("Reloading from cache...");
- window.parent.firstLoad = false;
- window.parent.loadTestFrame();
- return;
- }
-
- // End (parent) test.
- window.parent.SimpleTest.finish();
-}
-
-</script>
-
-<!-- Try loading from a malware javascript URI -->
-<script type="text/javascript" src="http://bug1281083.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js"></script>
-
-</head>
-
-<body onload="checkLoads()">
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/chrome.ini b/toolkit/components/url-classifier/tests/mochitest/chrome.ini
deleted file mode 100644
index 1652e7421..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/chrome.ini
+++ /dev/null
@@ -1,23 +0,0 @@
-[DEFAULT]
-skip-if = os == 'android'
-support-files =
- allowlistAnnotatedFrame.html
- classifiedAnnotatedFrame.html
- classifiedAnnotatedPBFrame.html
- bug_1281083.html
-
-[test_lookup_system_principal.html]
-[test_classified_annotations.html]
-tags = trackingprotection
-skip-if = os == 'linux' && asan # Bug 1202548
-[test_allowlisted_annotations.html]
-tags = trackingprotection
-[test_privatebrowsing_trackingprotection.html]
-tags = trackingprotection
-[test_trackingprotection_bug1157081.html]
-tags = trackingprotection
-[test_trackingprotection_whitelist.html]
-tags = trackingprotection
-[test_safebrowsing_bug1272239.html]
-[test_donottrack.html]
-[test_classifier_changetablepref.html]
diff --git a/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html b/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html
deleted file mode 100644
index 8aab13dd3..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedFrame.html
+++ /dev/null
@@ -1,213 +0,0 @@
-<html>
-<head>
-<title></title>
-
-<script type="text/javascript">
-"use strict";
-
-var scriptItem = "untouched";
-var scriptItem1 = "untouched";
-var scriptItem2 = "untouched";
-var imageItem1 = "untouched";
-var imageItem2 = "untouched";
-var frameItem1 = "untouched";
-var frameItem2 = "untouched";
-var xhrItem = "untouched";
-var fetchItem = "untouched";
-var mediaItem1 = "untouched";
-
-var badids = [
- "badscript1",
- "badscript2",
- "badimage1",
- "badimage2",
- "badframe1",
- "badframe2",
- "badmedia1",
- "badcss"
-];
-
-function checkLoads() {
- window.parent.is(
- scriptItem1, "untouched", "Should not load tracking javascript");
- window.parent.is(
- scriptItem2, "untouched", "Should not load tracking javascript (2)");
-
- window.parent.is(
- imageItem1, "untouched", "Should not load tracking images");
- window.parent.is(
- imageItem2, "untouched", "Should not load tracking images (2)");
-
- window.parent.is(
- frameItem1, "untouched", "Should not load tracking iframes");
- window.parent.is(
- frameItem2, "untouched", "Should not load tracking iframes (2)");
- window.parent.is(
- mediaItem1, "error", "Should not load tracking videos");
- window.parent.is(
- xhrItem, "failed", "Should not load tracking XHRs");
- window.parent.is(
- fetchItem, "error", "Should not fetch from tracking URLs");
-
- var elt = document.getElementById("styleCheck");
- var style = document.defaultView.getComputedStyle(elt, "");
- window.parent.isnot(
- style.visibility, "hidden", "Should not load tracking css");
-
- window.parent.is(window.document.blockedTrackingNodeCount, badids.length,
- "Should identify all tracking elements");
-
- var blockedTrackingNodes = window.document.blockedTrackingNodes;
-
- // Make sure that every node in blockedTrackingNodes exists in the tree
- // (that may not always be the case but do not expect any nodes to disappear
- // from the tree here)
- var allNodeMatch = true;
- for (var i = 0; i < blockedTrackingNodes.length; i++) {
- var nodeMatch = false;
- for (var j = 0; j < badids.length && !nodeMatch; j++) {
- nodeMatch = nodeMatch ||
- (blockedTrackingNodes[i] == document.getElementById(badids[j]));
- }
-
- allNodeMatch = allNodeMatch && nodeMatch;
- }
- window.parent.ok(allNodeMatch,
- "All annotated nodes are expected in the tree");
-
- // Make sure that every node with a badid (see badids) is found in the
- // blockedTrackingNodes. This tells us if we are neglecting to annotate
- // some nodes
- allNodeMatch = true;
- for (var j = 0; j < badids.length; j++) {
- var nodeMatch = false;
- for (var i = 0; i < blockedTrackingNodes.length && !nodeMatch; i++) {
- nodeMatch = nodeMatch ||
- (blockedTrackingNodes[i] == document.getElementById(badids[j]));
- }
-
- if (!nodeMatch) {
- console.log(badids[j] + " was not found in blockedTrackingNodes");
- }
- allNodeMatch = allNodeMatch && nodeMatch;
- }
- window.parent.ok(allNodeMatch,
- "All tracking nodes are expected to be annotated as such");
-
- // Unset prefs, etc.
- window.parent.cleanup();
- // End (parent) test.
- window.parent.SimpleTest.finish();
-}
-
-var onloadCalled = false;
-var xhrFinished = false;
-var fetchFinished = false;
-var videoLoaded = false;
-function loaded(type) {
- if (type === "onload") {
- onloadCalled = true;
- } else if (type === "xhr") {
- xhrFinished = true;
- } else if (type === "fetch") {
- fetchFinished = true;
- } else if (type === "video") {
- videoLoaded = true;
- }
- if (onloadCalled && xhrFinished && fetchFinished && videoLoaded) {
- checkLoads();
- }
-}
-</script>
-
-<!-- Try loading from a tracking CSS URI -->
-<link id="badcss" rel="stylesheet" type="text/css" href="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.css"></link>
-
-</head>
-
-<body onload="loaded('onload')">
-
-<!-- Try loading from a tracking script URI (1): evil.js onload will have updated the scriptItem variable -->
-<script id="badscript1" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js" onload="scriptItem1 = scriptItem;"></script>
-
-<!-- Try loading from a tracking image URI (1) -->
-<img id="badimage1" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/raptor.jpg?reload=true" onload="imageItem1 = 'spoiled';"/>
-
-<!-- Try loading from a tracking frame URI (1) -->
-<iframe id="badframe1" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/track.html" onload="frameItem1 = 'spoiled';"></iframe>
-
-<!-- Try loading from a tracking video URI -->
-<video id="badmedia1" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/vp9.webm?reload=true"></video>
-
-<script>
-var v = document.getElementById("badmedia1");
-v.addEventListener("loadedmetadata", function() {
- mediaItem1 = "loaded";
- loaded("video");
-}, true);
-v.addEventListener("error", function() {
- mediaItem1 = "error";
- loaded("video");
-}, true);
-
-// Try loading from a tracking script URI (2) - The loader may follow a different path depending on whether the resource is loaded from JS or HTML.
-var newScript = document.createElement("script");
-newScript.id = "badscript2";
-newScript.src = "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js";
-newScript.addEventListener("load", function() {scriptItem2 = scriptItem;});
-document.body.appendChild(newScript);
-
-/// Try loading from a tracking image URI (2)
-var newImage = document.createElement("img");
-newImage.id = "badimage2";
-newImage.src = "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/raptor.jpg?reload=true";
-newImage.addEventListener("load", function() {imageItem2 = 'spoiled'});
-document.body.appendChild(newImage);
-
-// Try loading from a tracking iframe URI (2)
-var newFrame = document.createElement("iframe");
-newFrame.id = "badframe2";
-newFrame.src = "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/track.html"
-newFrame.addEventListener("load", function() {frameItem2 = 'spoiled'});
-document.body.appendChild(newFrame);
-
-// Try doing an XHR against a tracking domain (bug 1216793)
-function reqListener() {
- xhrItem = "loaded";
- loaded("xhr");
-}
-function transferFailed() {
- xhrItem = "failed";
- loaded("xhr");
-}
-function transferCanceled() {
- xhrItem = "canceled";
- loaded("xhr");
-}
-var oReq = new XMLHttpRequest();
-oReq.addEventListener("load", reqListener);
-oReq.addEventListener("error", transferFailed);
-oReq.addEventListener("abort", transferCanceled);
-oReq.open("GET", "http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js");
-oReq.send();
-
-// Fetch from a tracking domain
-fetch("http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js").then(function(response) {
- if(response.ok) {
- fetchItem = "loaded";
- loaded("fetch");
- } else {
- fetchItem = "badresponse";
- loaded("fetch");
- }
- }).catch(function(error) {
- fetchItem = "error";
- loaded("fetch");
-});
-</script>
-
-The following should not be hidden:
-<div id="styleCheck">STYLE TEST</div>
-
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html b/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html
deleted file mode 100644
index f11ec1de3..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE HTML>
-<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
-<html>
-<head>
-<title></title>
-
-<link id="badcss" rel="stylesheet" type="text/css" href="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.css"></link>
-
-</head>
-<body>
-
-<script id="badscript" data-touched="not sure" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js" onload="this.dataset.touched = 'yes';" onerror="this.dataset.touched = 'no';"></script>
-
-<script id="goodscript" data-touched="not sure" src="http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/good.js" onload="this.dataset.touched = 'yes';" onerror="this.dataset.touched = 'no';"></script>
-
-<!-- The image cache can cache JS handlers, so make sure we use a different URL for raptor.jpg each time -->
-<img id="badimage" data-touched="not sure" src="http://tracking.example.com/tests/toolkit/components/url-classifier/tests/mochitest/raptor.jpg?pbmode=test" onload="this.dataset.touched = 'yes';" onerror="this.dataset.touched = 'no';"/>
-
-The following should not be hidden:
-<div id="styleCheck">STYLE TEST</div>
-
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js b/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js
deleted file mode 100644
index 49bda38db..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/classifierCommon.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-const { classes: Cc, interfaces: Ci, results: Cr } = Components;
-
-var dbService = Cc["@mozilla.org/url-classifier/dbservice;1"]
- .getService(Ci.nsIUrlClassifierDBService);
-
-var timer;
-function setTimeout(callback, delay) {
- timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
- timer.initWithCallback({ notify: callback },
- delay,
- Ci.nsITimer.TYPE_ONE_SHOT);
-}
-
-function doUpdate(update) {
- let listener = {
- QueryInterface: function(iid)
- {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIUrlClassifierUpdateObserver))
- return this;
-
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
- updateUrlRequested: function(url) { },
- streamFinished: function(status) { },
- updateError: function(errorCode) {
- sendAsyncMessage("updateError", errorCode);
- },
- updateSuccess: function(requestedTimeout) {
- sendAsyncMessage("updateSuccess");
- }
- };
-
- let dbService = Cc["@mozilla.org/url-classifier/dbservice;1"]
- .getService(Ci.nsIUrlClassifierDBService);
-
- try {
- dbService.beginUpdate(listener, "test-malware-simple,test-unwanted-simple", "");
- dbService.beginStream("", "");
- dbService.updateStream(update);
- dbService.finishStream();
- dbService.finishUpdate();
- } catch(e) {
- // beginUpdate may fail if there's an existing update in progress
- // retry until success or testcase timeout.
- setTimeout(() => { doUpdate(update); }, 1000);
- }
-}
-
-function doReload() {
- dbService.reloadDatabase();
-
- sendAsyncMessage("reloadSuccess");
-}
-
-// SafeBrowsing.jsm is initialized after mozEntries are added. Add observer
-// to receive "finished" event. For the case when this function is called
-// after the event had already been notified, we lookup entries to see if
-// they are already added to database.
-function waitForInit() {
- let observerService = Cc["@mozilla.org/observer-service;1"]
- .getService(Ci.nsIObserverService);
-
- observerService.addObserver(function() {
- sendAsyncMessage("safeBrowsingInited");
- }, "mozentries-update-finished", false);
-
- // This url must sync with the table, url in SafeBrowsing.jsm addMozEntries
- const table = "test-phish-simple";
- const url = "http://itisatrap.org/firefox/its-a-trap.html";
-
- let secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
- .getService(Ci.nsIScriptSecurityManager);
- let iosvc = Cc["@mozilla.org/network/io-service;1"]
- .getService(Ci.nsIIOService);
-
- let principal = secMan.createCodebasePrincipal(
- iosvc.newURI(url, null, null), {});
-
- let listener = {
- QueryInterface: function(iid)
- {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIUrlClassifierUpdateObserver))
- return this;
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
-
- handleEvent: function(value)
- {
- if (value === table) {
- sendAsyncMessage("safeBrowsingInited");
- }
- },
- };
- dbService.lookup(principal, table, listener);
-}
-
-addMessageListener("doUpdate", ({ testUpdate }) => {
- doUpdate(testUpdate);
-});
-
-addMessageListener("doReload", () => {
- doReload();
-});
-
-addMessageListener("waitForInit", () => {
- waitForInit();
-});
diff --git a/toolkit/components/url-classifier/tests/mochitest/classifierFrame.html b/toolkit/components/url-classifier/tests/mochitest/classifierFrame.html
deleted file mode 100644
index c7923f448..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/classifierFrame.html
+++ /dev/null
@@ -1,57 +0,0 @@
-<html>
-<head>
-<title></title>
-
-<script type="text/javascript">
-
-var scriptItem = "untouched";
-
-function checkLoads() {
- // Make sure the javascript did not load.
- window.parent.is(scriptItem, "untouched", "Should not load bad javascript");
-
- // Make sure the css did not load.
- var elt = document.getElementById("styleCheck");
- var style = document.defaultView.getComputedStyle(elt, "");
- window.parent.isnot(style.visibility, "hidden", "Should not load bad css");
-
- elt = document.getElementById("styleBad");
- style = document.defaultView.getComputedStyle(elt, "");
- window.parent.isnot(style.visibility, "hidden", "Should not load bad css");
-
- elt = document.getElementById("styleImport");
- style = document.defaultView.getComputedStyle(elt, "");
- window.parent.isnot(style.visibility, "visible", "Should import clean css");
-
- // Call parent.loadTestFrame again to test classification metadata in HTTP
- // cache entries.
- if (window.parent.firstLoad) {
- window.parent.info("Reloading from cache...");
- window.parent.firstLoad = false;
- window.parent.loadTestFrame();
- return;
- }
-
- // End (parent) test.
- window.parent.SimpleTest.finish();
-}
-
-</script>
-
-<!-- Try loading from a malware javascript URI -->
-<script type="text/javascript" src="http://malware.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js"></script>
-
-<!-- Try loading from an uwanted software css URI -->
-<link rel="stylesheet" type="text/css" href="http://unwanted.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.css"></link>
-
-<!-- Try loading a marked-as-malware css through an @import from a clean URI -->
-<link rel="stylesheet" type="text/css" href="import.css"></link>
-</head>
-
-<body onload="checkLoads()">
-The following should not be hidden:
-<div id="styleCheck">STYLE TEST</div>
-<div id="styleBad">STYLE BAD</div>
-<div id="styleImport">STYLE IMPORT</div>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/classifierHelper.js b/toolkit/components/url-classifier/tests/mochitest/classifierHelper.js
deleted file mode 100644
index 973f0c2c4..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/classifierHelper.js
+++ /dev/null
@@ -1,201 +0,0 @@
-if (typeof(classifierHelper) == "undefined") {
- var classifierHelper = {};
-}
-
-const CLASSIFIER_COMMON_URL = SimpleTest.getTestFileURL("classifierCommon.js");
-var gScript = SpecialPowers.loadChromeScript(CLASSIFIER_COMMON_URL);
-
-const ADD_CHUNKNUM = 524;
-const SUB_CHUNKNUM = 523;
-const HASHLEN = 32;
-
-const PREFS = {
- PROVIDER_LISTS : "browser.safebrowsing.provider.mozilla.lists",
- DISALLOW_COMPLETIONS : "urlclassifier.disallow_completions",
- PROVIDER_GETHASHURL : "browser.safebrowsing.provider.mozilla.gethashURL"
-};
-
-// addUrlToDB & removeUrlFromDB are asynchronous, queue the task to ensure
-// the callback follow correct order.
-classifierHelper._updates = [];
-
-// Keep urls added to database, those urls should be automatically
-// removed after test complete.
-classifierHelper._updatesToCleanup = [];
-
-classifierHelper._initsCB = [];
-
-// This function return a Promise, promise is resolved when SafeBrowsing.jsm
-// is initialized.
-classifierHelper.waitForInit = function() {
- return new Promise(function(resolve, reject) {
- classifierHelper._initsCB.push(resolve);
- gScript.sendAsyncMessage("waitForInit");
- });
-}
-
-// This function is used to allow completion for specific "list",
-// some lists like "test-malware-simple" is default disabled to ask for complete.
-// "list" is the db we would like to allow it
-// "url" is the completion server
-classifierHelper.allowCompletion = function(lists, url) {
- for (var list of lists) {
- // Add test db to provider
- var pref = SpecialPowers.getCharPref(PREFS.PROVIDER_LISTS);
- pref += "," + list;
- SpecialPowers.setCharPref(PREFS.PROVIDER_LISTS, pref);
-
- // Rename test db so we will not disallow it from completions
- pref = SpecialPowers.getCharPref(PREFS.DISALLOW_COMPLETIONS);
- pref = pref.replace(list, list + "-backup");
- SpecialPowers.setCharPref(PREFS.DISALLOW_COMPLETIONS, pref);
- }
-
- // Set get hash url
- SpecialPowers.setCharPref(PREFS.PROVIDER_GETHASHURL, url);
-}
-
-// Pass { url: ..., db: ... } to add url to database,
-// onsuccess/onerror will be called when update complete.
-classifierHelper.addUrlToDB = function(updateData) {
- return new Promise(function(resolve, reject) {
- var testUpdate = "";
- for (var update of updateData) {
- var LISTNAME = update.db;
- var CHUNKDATA = update.url;
- var CHUNKLEN = CHUNKDATA.length;
- var HASHLEN = update.len ? update.len : 32;
-
- classifierHelper._updatesToCleanup.push(update);
- testUpdate +=
- "n:1000\n" +
- "i:" + LISTNAME + "\n" +
- "ad:1\n" +
- "a:" + ADD_CHUNKNUM + ":" + HASHLEN + ":" + CHUNKLEN + "\n" +
- CHUNKDATA;
- }
-
- classifierHelper._update(testUpdate, resolve, reject);
- });
-}
-
-// Pass { url: ..., db: ... } to remove url from database,
-// onsuccess/onerror will be called when update complete.
-classifierHelper.removeUrlFromDB = function(updateData) {
- return new Promise(function(resolve, reject) {
- var testUpdate = "";
- for (var update of updateData) {
- var LISTNAME = update.db;
- var CHUNKDATA = ADD_CHUNKNUM + ":" + update.url;
- var CHUNKLEN = CHUNKDATA.length;
- var HASHLEN = update.len ? update.len : 32;
-
- testUpdate +=
- "n:1000\n" +
- "i:" + LISTNAME + "\n" +
- "s:" + SUB_CHUNKNUM + ":" + HASHLEN + ":" + CHUNKLEN + "\n" +
- CHUNKDATA;
- }
-
- classifierHelper._updatesToCleanup =
- classifierHelper._updatesToCleanup.filter((v) => {
- return updateData.indexOf(v) == -1;
- });
-
- classifierHelper._update(testUpdate, resolve, reject);
- });
-};
-
-// This API is used to expire all add/sub chunks we have updated
-// by using addUrlToDB and removeUrlFromDB.
-classifierHelper.resetDB = function() {
- return new Promise(function(resolve, reject) {
- var testUpdate = "";
- for (var update of classifierHelper._updatesToCleanup) {
- if (testUpdate.includes(update.db))
- continue;
-
- testUpdate +=
- "n:1000\n" +
- "i:" + update.db + "\n" +
- "ad:" + ADD_CHUNKNUM + "\n" +
- "sd:" + SUB_CHUNKNUM + "\n"
- }
-
- classifierHelper._update(testUpdate, resolve, reject);
- });
-};
-
-classifierHelper.reloadDatabase = function() {
- return new Promise(function(resolve, reject) {
- gScript.addMessageListener("reloadSuccess", function handler() {
- gScript.removeMessageListener('reloadSuccess', handler);
- resolve();
- });
-
- gScript.sendAsyncMessage("doReload");
- });
-}
-
-classifierHelper._update = function(testUpdate, onsuccess, onerror) {
- // Queue the task if there is still an on-going update
- classifierHelper._updates.push({"data": testUpdate,
- "onsuccess": onsuccess,
- "onerror": onerror});
- if (classifierHelper._updates.length != 1) {
- return;
- }
-
- gScript.sendAsyncMessage("doUpdate", { testUpdate });
-};
-
-classifierHelper._updateSuccess = function() {
- var update = classifierHelper._updates.shift();
- update.onsuccess();
-
- if (classifierHelper._updates.length) {
- var testUpdate = classifierHelper._updates[0].data;
- gScript.sendAsyncMessage("doUpdate", { testUpdate });
- }
-};
-
-classifierHelper._updateError = function(errorCode) {
- var update = classifierHelper._updates.shift();
- update.onerror(errorCode);
-
- if (classifierHelper._updates.length) {
- var testUpdate = classifierHelper._updates[0].data;
- gScript.sendAsyncMessage("doUpdate", { testUpdate });
- }
-};
-
-classifierHelper._inited = function() {
- classifierHelper._initsCB.forEach(function (cb) {
- cb();
- });
- classifierHelper._initsCB = [];
-};
-
-classifierHelper._setup = function() {
- gScript.addMessageListener("updateSuccess", classifierHelper._updateSuccess);
- gScript.addMessageListener("updateError", classifierHelper._updateError);
- gScript.addMessageListener("safeBrowsingInited", classifierHelper._inited);
-
- // cleanup will be called at end of each testcase to remove all the urls added to database.
- SimpleTest.registerCleanupFunction(classifierHelper._cleanup);
-};
-
-classifierHelper._cleanup = function() {
- // clean all the preferences may touch by helper
- for (var pref in PREFS) {
- SpecialPowers.clearUserPref(pref);
- }
-
- if (!classifierHelper._updatesToCleanup) {
- return Promise.resolve();
- }
-
- return classifierHelper.resetDB();
-};
-
-classifierHelper._setup();
diff --git a/toolkit/components/url-classifier/tests/mochitest/cleanWorker.js b/toolkit/components/url-classifier/tests/mochitest/cleanWorker.js
deleted file mode 100644
index 685648373..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/cleanWorker.js
+++ /dev/null
@@ -1,10 +0,0 @@
-onmessage = function() {
- try {
- importScripts("evilWorker.js");
- } catch(ex) {
- postMessage("success");
- return;
- }
-
- postMessage("failure");
-};
diff --git a/toolkit/components/url-classifier/tests/mochitest/dnt.html b/toolkit/components/url-classifier/tests/mochitest/dnt.html
deleted file mode 100644
index effc3a4f8..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/dnt.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<html>
-<head>
-<title></title>
-
-<script type="text/javascript">
-
-function makeXHR(url, callback) {
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url, true);
- xhr.onload = function() {
- callback(xhr.response);
- };
- xhr.send();
-}
-
-function loaded(type) {
- window.parent.postMessage("navigator.doNotTrack=" + navigator.doNotTrack, "*");
-
- makeXHR("dnt.sjs", (res) => {
- window.parent.postMessage("DNT=" + res, "*");
- window.parent.postMessage("finish", "*");
- });
-}
-
-</script>
-</head>
-
-<body onload="loaded('onload')">
-</body>
-
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/dnt.sjs b/toolkit/components/url-classifier/tests/mochitest/dnt.sjs
deleted file mode 100644
index bbb836482..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/dnt.sjs
+++ /dev/null
@@ -1,9 +0,0 @@
-function handleRequest(request, response) {
- var dnt = "unspecified";
- if (request.hasHeader("DNT")) {
- dnt = "1";
- }
-
- response.setHeader("Content-Type", "text/plain", false);
- response.write(dnt);
-}
diff --git a/toolkit/components/url-classifier/tests/mochitest/evil.css b/toolkit/components/url-classifier/tests/mochitest/evil.css
deleted file mode 100644
index f6f08d7c5..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/evil.css
+++ /dev/null
@@ -1 +0,0 @@
-#styleCheck { visibility: hidden; } \ No newline at end of file
diff --git a/toolkit/components/url-classifier/tests/mochitest/evil.css^headers^ b/toolkit/components/url-classifier/tests/mochitest/evil.css^headers^
deleted file mode 100644
index 4030ea1d3..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/evil.css^headers^
+++ /dev/null
@@ -1 +0,0 @@
-Cache-Control: no-store
diff --git a/toolkit/components/url-classifier/tests/mochitest/evil.js b/toolkit/components/url-classifier/tests/mochitest/evil.js
deleted file mode 100644
index 27f2e8c43..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/evil.js
+++ /dev/null
@@ -1 +0,0 @@
-scriptItem = "loaded malware javascript!";
diff --git a/toolkit/components/url-classifier/tests/mochitest/evil.js^headers^ b/toolkit/components/url-classifier/tests/mochitest/evil.js^headers^
deleted file mode 100644
index 3eced9614..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/evil.js^headers^
+++ /dev/null
@@ -1,2 +0,0 @@
-Access-Control-Allow-Origin: *
-Cache-Control: no-store
diff --git a/toolkit/components/url-classifier/tests/mochitest/evilWorker.js b/toolkit/components/url-classifier/tests/mochitest/evilWorker.js
deleted file mode 100644
index ac34977d7..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/evilWorker.js
+++ /dev/null
@@ -1,3 +0,0 @@
-onmessage = function() {
- postMessage("loaded bad file");
-}
diff --git a/toolkit/components/url-classifier/tests/mochitest/gethash.sjs b/toolkit/components/url-classifier/tests/mochitest/gethash.sjs
deleted file mode 100644
index 9dcc6e0d5..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/gethash.sjs
+++ /dev/null
@@ -1,130 +0,0 @@
-const CC = Components.Constructor;
-const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
- "nsIBinaryInputStream",
- "setInputStream");
-
-function handleRequest(request, response)
-{
- var query = {};
- request.queryString.split('&').forEach(function (val) {
- var idx = val.indexOf('=');
- query[val.slice(0, idx)] = unescape(val.slice(idx + 1));
- });
-
- var responseBody;
-
- // Store fullhash in the server side.
- if ("list" in query && "fullhash" in query) {
- // In the server side we will store:
- // 1. All the full hashes for a given list
- // 2. All the lists we have right now
- // data is separate by '\n'
- let list = query["list"];
- let hashes = getState(list);
-
- let hash = base64ToString(query["fullhash"]);
- hashes += hash + "\n";
- setState(list, hashes);
-
- let lists = getState("lists");
- if (lists.indexOf(list) == -1) {
- lists += list + "\n";
- setState("lists", lists);
- }
-
- return;
- // gethash count return how many gethash request received.
- // This is used by client to know if a gethash request is triggered by gecko
- } else if ("gethashcount" == request.queryString) {
- var counter = getState("counter");
- responseBody = counter == "" ? "0" : counter;
- } else {
- var body = new BinaryInputStream(request.bodyInputStream);
- var avail;
- var bytes = [];
-
- while ((avail = body.available()) > 0) {
- Array.prototype.push.apply(bytes, body.readByteArray(avail));
- }
-
- var counter = getState("counter");
- counter = counter == "" ? "1" : (parseInt(counter) + 1).toString();
- setState("counter", counter);
-
- responseBody = parseV2Request(bytes);
- }
-
- response.setHeader("Content-Type", "text/plain", false);
- response.write(responseBody);
-
-}
-
-function parseV2Request(bytes) {
- var request = String.fromCharCode.apply(this, bytes);
- var [HEADER, PREFIXES] = request.split("\n");
- var [PREFIXSIZE, LENGTH] = HEADER.split(":").map(val => {
- return parseInt(val);
- });
-
- var ret = "";
- for(var start = 0; start < LENGTH; start += PREFIXSIZE) {
- getState("lists").split("\n").forEach(function(list) {
- var completions = getState(list).split("\n");
-
- for (var completion of completions) {
- if (completion.indexOf(PREFIXES.substr(start, PREFIXSIZE)) == 0) {
- ret += list + ":" + "1" + ":" + "32" + "\n";
- ret += completion;
- }
- }
- });
- }
-
- return ret;
-}
-
-/* Convert Base64 data to a string */
-const toBinaryTable = [
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
- 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
- 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
- -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
- 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
-];
-const base64Pad = '=';
-
-function base64ToString(data) {
- var result = '';
- var leftbits = 0; // number of bits decoded, but yet to be appended
- var leftdata = 0; // bits decoded, but yet to be appended
-
- // Convert one by one.
- for (var i = 0; i < data.length; i++) {
- var c = toBinaryTable[data.charCodeAt(i) & 0x7f];
- var padding = (data[i] == base64Pad);
- // Skip illegal characters and whitespace
- if (c == -1) continue;
-
- // Collect data into leftdata, update bitcount
- leftdata = (leftdata << 6) | c;
- leftbits += 6;
-
- // If we have 8 or more bits, append 8 bits to the result
- if (leftbits >= 8) {
- leftbits -= 8;
- // Append if not padding.
- if (!padding)
- result += String.fromCharCode((leftdata >> leftbits) & 0xff);
- leftdata &= (1 << leftbits) - 1;
- }
- }
-
- // If there are any bits left, the base64 string was corrupted
- if (leftbits)
- throw Components.Exception('Corrupted base64 string');
-
- return result;
-}
diff --git a/toolkit/components/url-classifier/tests/mochitest/gethashFrame.html b/toolkit/components/url-classifier/tests/mochitest/gethashFrame.html
deleted file mode 100644
index 560ddcde6..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/gethashFrame.html
+++ /dev/null
@@ -1,62 +0,0 @@
-<html>
-<head>
-<title></title>
-
-<script type="text/javascript">
-
-var scriptItem = "untouched";
-
-function checkLoads() {
-
- var title = document.getElementById("title");
- title.innerHTML = window.parent.shouldLoad ?
- "The following should be hidden:" :
- "The following should not be hidden:"
-
- if (window.parent.shouldLoad) {
- window.parent.is(scriptItem, "loaded malware javascript!", "Should load bad javascript");
- } else {
- window.parent.is(scriptItem, "untouched", "Should not load bad javascript");
- }
-
- var elt = document.getElementById("styleImport");
- var style = document.defaultView.getComputedStyle(elt, "");
- window.parent.isnot(style.visibility, "visible", "Should load clean css");
-
- // Make sure the css did not load.
- elt = document.getElementById("styleCheck");
- style = document.defaultView.getComputedStyle(elt, "");
- if (window.parent.shouldLoad) {
- window.parent.isnot(style.visibility, "visible", "Should load bad css");
- } else {
- window.parent.isnot(style.visibility, "hidden", "Should not load bad css");
- }
-
- elt = document.getElementById("styleBad");
- style = document.defaultView.getComputedStyle(elt, "");
- if (window.parent.shouldLoad) {
- window.parent.isnot(style.visibility, "visible", "Should import bad css");
- } else {
- window.parent.isnot(style.visibility, "hidden", "Should not import bad css");
- }
-}
-
-</script>
-
-<!-- Try loading from a malware javascript URI -->
-<script type="text/javascript" src="http://malware.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.js"></script>
-
-<!-- Try loading from an uwanted software css URI -->
-<link rel="stylesheet" type="text/css" href="http://unwanted.example.com/tests/toolkit/components/url-classifier/tests/mochitest/evil.css"></link>
-
-<!-- Try loading a marked-as-malware css through an @import from a clean URI -->
-<link rel="stylesheet" type="text/css" href="import.css"></link>
-</head>
-
-<body onload="checkLoads()">
-<div id="title"></div>
-<div id="styleCheck">STYLE EVIL</div>
-<div id="styleBad">STYLE BAD</div>
-<div id="styleImport">STYLE IMPORT</div>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/good.js b/toolkit/components/url-classifier/tests/mochitest/good.js
deleted file mode 100644
index 015b9fe52..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/good.js
+++ /dev/null
@@ -1 +0,0 @@
-scriptItem = "loaded whitelisted javascript!";
diff --git a/toolkit/components/url-classifier/tests/mochitest/import.css b/toolkit/components/url-classifier/tests/mochitest/import.css
deleted file mode 100644
index 9b86c8216..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/import.css
+++ /dev/null
@@ -1,3 +0,0 @@
-/* malware.example.com is in the malware database. */
-@import url("http://malware.example.com/tests/toolkit/components/url-classifier/tests/mochitest/bad.css");
-#styleImport { visibility: hidden; }
diff --git a/toolkit/components/url-classifier/tests/mochitest/mochitest.ini b/toolkit/components/url-classifier/tests/mochitest/mochitest.ini
deleted file mode 100644
index c5679e86b..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/mochitest.ini
+++ /dev/null
@@ -1,39 +0,0 @@
-[DEFAULT]
-support-files =
- classifiedAnnotatedPBFrame.html
- classifierCommon.js
- classifierFrame.html
- classifierHelper.js
- cleanWorker.js
- good.js
- evil.css
- evil.css^headers^
- evil.js
- evil.js^headers^
- evilWorker.js
- import.css
- raptor.jpg
- track.html
- unwantedWorker.js
- vp9.webm
- whitelistFrame.html
- workerFrame.html
- ping.sjs
- basic.vtt
- basic.vtt^headers^
- dnt.html
- dnt.sjs
- update.sjs
- bad.css
- bad.css^headers^
- gethash.sjs
- gethashFrame.html
- seek.webm
-
-[test_classifier.html]
-skip-if = (os == 'linux' && debug) #Bug 1199778
-[test_classifier_worker.html]
-[test_classify_ping.html]
-[test_classify_track.html]
-[test_gethash.html]
-[test_bug1254766.html]
diff --git a/toolkit/components/url-classifier/tests/mochitest/ping.sjs b/toolkit/components/url-classifier/tests/mochitest/ping.sjs
deleted file mode 100644
index 37a78956e..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/ping.sjs
+++ /dev/null
@@ -1,16 +0,0 @@
-function handleRequest(request, response)
-{
- var query = {};
- request.queryString.split('&').forEach(function (val) {
- var [name, value] = val.split('=');
- query[name] = unescape(value);
- });
-
- if (request.method == "POST") {
- setState(query["id"], "ping");
- } else {
- var value = getState(query["id"]);
- response.setHeader("Content-Type", "text/plain", false);
- response.write(value);
- }
-}
diff --git a/toolkit/components/url-classifier/tests/mochitest/raptor.jpg b/toolkit/components/url-classifier/tests/mochitest/raptor.jpg
deleted file mode 100644
index 243ba9e2d..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/raptor.jpg
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/url-classifier/tests/mochitest/seek.webm b/toolkit/components/url-classifier/tests/mochitest/seek.webm
deleted file mode 100644
index 72b029723..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/seek.webm
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_allowlisted_annotations.html b/toolkit/components/url-classifier/tests/mochitest/test_allowlisted_annotations.html
deleted file mode 100644
index ba9c86f95..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_allowlisted_annotations.html
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test the URI Classifier</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
-</head>
-
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
-
-var Cc = SpecialPowers.Cc;
-var Ci = SpecialPowers.Ci;
-
-Components.utils.import("resource://testing-common/UrlClassifierTestUtils.jsm");
-
-// Add https://allowlisted.example.com to the permissions manager
-SpecialPowers.addPermission("trackingprotection",
- Ci.nsIPermissionManager.ALLOW_ACTION,
- { url: "https://allowlisted.example.com" });
-
-function clearPermissions() {
- SpecialPowers.removePermission("trackingprotection",
- { url: "https://allowlisted.example.com" });
- ok(!SpecialPowers.testPermission("trackingprotection",
- Ci.nsIPermissionManager.ALLOW_ACTION,
- { url: "https://allowlisted.example.com" }));
-}
-
-SpecialPowers.pushPrefEnv(
- {"set" : [["urlclassifier.trackingTable", "test-track-simple"],
- ["privacy.trackingprotection.enabled", true],
- ["channelclassifier.allowlist_example", true]]},
- test);
-
-function test() {
- SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
- UrlClassifierTestUtils.addTestTrackers().then(() => {
- document.getElementById("testFrame").src = "allowlistAnnotatedFrame.html";
- });
-}
-
-// Expected finish() call is in "allowlistedAnnotatedFrame.html".
-SimpleTest.waitForExplicitFinish();
-
-</script>
-
-</pre>
-<iframe id="testFrame" width="100%" height="100%" onload=""></iframe>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html b/toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html
deleted file mode 100644
index 1c149406a..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_bug1254766.html
+++ /dev/null
@@ -1,305 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Bug 1272239 - Test gethash.</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="classifierHelper.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
-
-const MALWARE_LIST = "test-malware-simple";
-const MALWARE_HOST1 = "malware.example.com/";
-const MALWARE_HOST2 = "test1.example.com/";
-
-const UNWANTED_LIST = "test-unwanted-simple";
-const UNWANTED_HOST1 = "unwanted.example.com/";
-const UNWANTED_HOST2 = "test2.example.com/";
-
-
-const UNUSED_MALWARE_HOST = "unused.malware.com/";
-const UNUSED_UNWANTED_HOST = "unused.unwanted.com/";
-
-const GETHASH_URL =
- "http://mochi.test:8888/tests/toolkit/components/url-classifier/tests/mochitest/gethash.sjs";
-
-var gPreGethashCounter = 0;
-var gCurGethashCounter = 0;
-
-var expectLoad = false;
-
-function loadTestFrame() {
- return new Promise(function(resolve, reject) {
- var iframe = document.createElement("iframe");
- iframe.setAttribute("src", "gethashFrame.html");
- document.body.appendChild(iframe);
-
- iframe.onload = function() {
- document.body.removeChild(iframe);
- resolve();
- };
- }).then(getGethashCounter);
-}
-
-function getGethashCounter() {
- return new Promise(function(resolve, reject) {
- var xhr = new XMLHttpRequest;
- xhr.open("PUT", GETHASH_URL + "?gethashcount");
- xhr.setRequestHeader("Content-Type", "text/plain");
- xhr.onreadystatechange = function() {
- if (this.readyState == this.DONE) {
- gPreGethashCounter = gCurGethashCounter;
- gCurGethashCounter = parseInt(xhr.response);
- resolve();
- }
- };
- xhr.send();
- });
-}
-
-// calculate the fullhash and send it to gethash server
-function addCompletionToServer(list, url) {
- return new Promise(function(resolve, reject) {
- var listParam = "list=" + list;
- var fullhashParam = "fullhash=" + hash(url);
-
- var xhr = new XMLHttpRequest;
- xhr.open("PUT", GETHASH_URL + "?" + listParam + "&" + fullhashParam, true);
- xhr.setRequestHeader("Content-Type", "text/plain");
- xhr.onreadystatechange = function() {
- if (this.readyState == this.DONE) {
- resolve();
- }
- };
- xhr.send();
- });
-}
-
-function hash(str) {
- function bytesFromString(str) {
- var converter =
- SpecialPowers.Cc["@mozilla.org/intl/scriptableunicodeconverter"]
- .createInstance(SpecialPowers.Ci.nsIScriptableUnicodeConverter);
- converter.charset = "UTF-8";
- return converter.convertToByteArray(str);
- }
-
- var hasher = SpecialPowers.Cc["@mozilla.org/security/hash;1"]
- .createInstance(SpecialPowers.Ci.nsICryptoHash);
-
- var data = bytesFromString(str);
- hasher.init(hasher.SHA256);
- hasher.update(data, data.length);
-
- return hasher.finish(true);
-}
-
-// setup function allows classifier send gethash request for test database
-// also it calculate to fullhash for url and store those hashes in gethash sjs.
-function setup() {
- classifierHelper.allowCompletion([MALWARE_LIST, UNWANTED_LIST], GETHASH_URL);
-
- return Promise.all([
- addCompletionToServer(MALWARE_LIST, MALWARE_HOST1),
- addCompletionToServer(MALWARE_LIST, MALWARE_HOST2),
- addCompletionToServer(UNWANTED_LIST, UNWANTED_HOST1),
- addCompletionToServer(UNWANTED_LIST, UNWANTED_HOST2),
- ]);
-}
-
-// Reset function in helper try to simulate the behavior we restart firefox
-function reset() {
- return classifierHelper.resetDB()
- .catch(err => {
- ok(false, "Couldn't update classifier. Error code: " + errorCode);
- // Abort test.
- SimpleTest.finish();
- });
-}
-
-function updateUnusedUrl() {
- var testData = [
- { url: UNUSED_MALWARE_HOST, db: MALWARE_LIST },
- { url: UNUSED_UNWANTED_HOST, db: UNWANTED_LIST }
- ];
-
- return classifierHelper.addUrlToDB(testData)
- .catch(err => {
- ok(false, "Couldn't update classifier. Error code: " + err);
- // Abort test.
- SimpleTest.finish();
- });
-}
-
-function addPrefixToDB() {
- return update(true);
-}
-
-function addCompletionToDB() {
- return update(false);
-}
-
-function update(prefix = false) {
- var length = prefix ? 4 : 32;
- var testData = [
- { url: MALWARE_HOST1, db: MALWARE_LIST, len: length },
- { url: MALWARE_HOST2, db: MALWARE_LIST, len: length },
- { url: UNWANTED_HOST1, db: UNWANTED_LIST, len: length },
- { url: UNWANTED_HOST2, db: UNWANTED_LIST, len: length }
- ];
-
- return classifierHelper.addUrlToDB(testData)
- .catch(err => {
- ok(false, "Couldn't update classifier. Error code: " + errorCode);
- // Abort test.
- SimpleTest.finish();
- });
-}
-
-// This testcase is to make sure gethash works:
-// 1. Add prefixes to DB.
-// 2. Load test frame contains malware & unwanted url, those urls should be blocked.
-// 3. The second step should also trigger a gethash request since completions is not in
-// either cache or DB.
-// 4. Load test frame again, since completions is stored in cache now, no gethash
-// request should be triggered.
-function testGethash() {
- return Promise.resolve()
- .then(addPrefixToDB)
- .then(loadTestFrame)
- .then(() => {
- ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered."); })
- .then(loadTestFrame)
- .then(() => {
- ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered."); })
- .then(reset);
-}
-
-// This testcase is to make sure an update request will clear completion cache:
-// 1. Add prefixes to DB.
-// 2. Load test frame, this should trigger a gethash request
-// 3. Trigger an update, completion cache should be cleared now.
-// 4. Load test frame again, since cache is cleared now, gethash request should be triggered.
-function testUpdateClearCache() {
- return Promise.resolve()
- .then(addPrefixToDB)
- .then(loadTestFrame)
- .then(() => {
- ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered."); })
- .then(updateUnusedUrl)
- .then(loadTestFrame)
- .then(() => {
- ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered."); })
- .then(reset);
-}
-
-// This testcae is to make sure completions in update works:
-// 1. Add completions to DB.
-// 2. Load test frame, since completions is stored in DB, gethash request should
-// not be triggered.
-function testUpdate() {
- return Promise.resolve()
- .then(addCompletionToDB)
- .then(loadTestFrame)
- .then(() => {
- ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered."); })
- .then(reset);
-}
-
-// This testcase is to make sure an update request will not clear completions in DB:
-// 1. Add completions to DB.
-// 2. Load test frame to make sure completions is stored in database, in this case, gethash
-// should not be triggered.
-// 3. Trigger an update, cache is cleared, but completions in DB should still remain.
-// 4. Load test frame again, since completions is in DB, gethash request should not be triggered.
-function testUpdateNotClearCompletions() {
- return Promise.resolve()
- .then(addCompletionToDB)
- .then(loadTestFrame)
- .then(() => {
- ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered."); })
- .then(updateUnusedUrl)
- .then(loadTestFrame)
- .then(() => {
- ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered."); })
- .then(reset);
-}
-
-// This testcase is to make sure completion store in DB will properly load after restarting.
-// 1. Add completions to DB.
-// 2. Simulate firefox restart by calling reloadDatabase.
-// 3. Load test frame, since completions should be loaded from DB, no gethash request should
-// be triggered.
-function testUpdateCompletionsAfterReload() {
- return Promise.resolve()
- .then(addCompletionToDB)
- .then(classifierHelper.reloadDatabase)
- .then(loadTestFrame)
- .then(() => {
- ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered."); })
- .then(reset);
-}
-
-// This testcase is to make sure cache will be cleared after restarting
-// 1. Add prefixes to DB.
-// 2. Load test frame, this should trigger a gethash request and completions will be stored in
-// cache.
-// 3. Load test frame again, no gethash should be triggered because of cache.
-// 4. Simulate firefox restart by calling reloadDatabase.
-// 5. Load test frame again, since cache is cleared, gethash request should be triggered.
-function testGethashCompletionsAfterReload() {
- return Promise.resolve()
- .then(addPrefixToDB)
- .then(loadTestFrame)
- .then(() => {
- ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered."); })
- .then(loadTestFrame)
- .then(() => {
- ok(gCurGethashCounter == gPreGethashCounter, "Gethash request is not triggered."); })
- .then(classifierHelper.reloadDatabase)
- .then(loadTestFrame)
- .then(() => {
- ok(gCurGethashCounter > gPreGethashCounter, "Gethash request is triggered."); })
- .then(reset);
-}
-
-function runTest() {
- Promise.resolve()
- .then(classifierHelper.waitForInit)
- .then(setup)
- .then(testGethash)
- .then(testUpdateClearCache)
- .then(testUpdate)
- .then(testUpdateNotClearCompletions)
- .then(testUpdateCompletionsAfterReload)
- .then(testGethashCompletionsAfterReload)
- .then(function() {
- SimpleTest.finish();
- }).catch(function(e) {
- ok(false, "Some test failed with error " + e);
- SimpleTest.finish();
- });
-}
-
-SimpleTest.waitForExplicitFinish();
-
-// 'network.predictor.enabled' is disabled because if other testcase load
-// evil.js, evil.css ...etc resources, it may cause we load them from cache
-// directly and bypass classifier check
-SpecialPowers.pushPrefEnv({"set": [
- ["browser.safebrowsing.malware.enabled", true],
- ["network.predictor.enabled", false],
- ["urlclassifier.gethash.timeout_ms", 30000],
-]}, runTest);
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_classified_annotations.html b/toolkit/components/url-classifier/tests/mochitest/test_classified_annotations.html
deleted file mode 100644
index 5814fff00..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_classified_annotations.html
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test the URI Classifier</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
-</head>
-
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
-
-var Cc = SpecialPowers.Cc;
-var Ci = SpecialPowers.Ci;
-
-Components.utils.import("resource://testing-common/UrlClassifierTestUtils.jsm");
-
-function cleanup() {
- SpecialPowers.clearUserPref("privacy.trackingprotection.enabled");
- SpecialPowers.clearUserPref("channelclassifier.allowlist_example");
-}
-
-SpecialPowers.pushPrefEnv(
- {"set" : [["urlclassifier.trackingTable", "test-track-simple"]]},
- test);
-
-function test() {
- UrlClassifierTestUtils.addTestTrackers().then(() => {
- SpecialPowers.setBoolPref("privacy.trackingprotection.enabled", true);
- // Make sure chrome:// URIs are processed. This does not white-list
- // any URIs unless 'https://allowlisted.example.com' is added in the
- // permission manager (see test_allowlisted_annotations.html)
- SpecialPowers.setBoolPref("channelclassifier.allowlist_example", true);
- document.getElementById("testFrame").src = "classifiedAnnotatedFrame.html";
- });
-}
-
-// Expected finish() call is in "classifiedAnnotatedFrame.html".
-SimpleTest.waitForExplicitFinish();
-
-</script>
-
-</pre>
-<iframe id="testFrame" width="100%" height="100%" onload=""></iframe>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_classifier.html b/toolkit/components/url-classifier/tests/mochitest/test_classifier.html
deleted file mode 100644
index 9533db426..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_classifier.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test the URI Classifier</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="classifierHelper.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
-
-var firstLoad = true;
-
-// Add some URLs to the malware database.
-var testData = [
- { url: "malware.example.com/",
- db: "test-malware-simple"
- },
- { url: "unwanted.example.com/",
- db: "test-unwanted-simple"
- }
-];
-
-function loadTestFrame() {
- document.getElementById("testFrame").src = "classifierFrame.html";
-}
-
-// Expected finish() call is in "classifierFrame.html".
-SimpleTest.waitForExplicitFinish();
-
-function updateSuccess() {
- SpecialPowers.pushPrefEnv(
- {"set" : [["browser.safebrowsing.malware.enabled", true]]},
- loadTestFrame);
-}
-
-function updateError(errorCode) {
- ok(false, "Couldn't update classifier. Error code: " + errorCode);
- // Abort test.
- SimpleTest.finish();
-}
-
-SpecialPowers.pushPrefEnv(
- {"set" : [["urlclassifier.malwareTable", "test-malware-simple,test-unwanted-simple"],
- ["urlclassifier.phishTable", "test-phish-simple"]]},
- function() {
- classifierHelper.waitForInit()
- .then(() => classifierHelper.addUrlToDB(testData))
- .then(updateSuccess)
- .catch(err => {
- updateError(err);
- });
- });
-
-</script>
-
-</pre>
-<iframe id="testFrame" onload=""></iframe>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html b/toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html
deleted file mode 100644
index 7423d3e8e..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_classifier_changetablepref.html
+++ /dev/null
@@ -1,149 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Bug 1281083 - Changing the urlclassifier.*Table prefs doesn't take effect before the next browser restart.</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="classifierHelper.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
-</head>
-
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
-
-const testTable = "moz-track-digest256";
-const UPDATE_URL = "http://mochi.test:8888/tests/toolkit/components/url-classifier/tests/mochitest/update.sjs";
-
-var Cc = SpecialPowers.Cc;
-var Ci = SpecialPowers.Ci;
-
-var prefService = Cc["@mozilla.org/preferences-service;1"]
- .getService(Ci.nsIPrefService);
-
-var timer = Cc["@mozilla.org/timer;1"]
- .createInstance(Ci.nsITimer);
-
-// If default preference contain the table we want to test,
-// We should change test table to a different one.
-var trackingTables = SpecialPowers.getCharPref("urlclassifier.trackingTable").split(",");
-ok(!trackingTables.includes(testTable), "test table should not be in the preference");
-
-var listmanager = Cc["@mozilla.org/url-classifier/listmanager;1"].
- getService(Ci.nsIUrlListManager);
-
-is(listmanager.getGethashUrl(testTable), "",
- "gethash url for test table should be empty before setting to preference");
-
-function loadTestFrame() {
- // gethash url of test table "moz-track-digest256" should be updated
- // after setting preference.
- var url = listmanager.getGethashUrl(testTable);
- var expected = SpecialPowers.getCharPref("browser.safebrowsing.provider.mozilla.gethashURL");
-
- is(url, expected, testTable + " matches its gethash url");
-
- // Trigger update
- listmanager.disableUpdate(testTable);
- listmanager.enableUpdate(testTable);
- listmanager.maybeToggleUpdateChecking();
-
- // We wait until "nextupdattime" was set as a signal that update is complete.
- waitForUpdateSuccess(function() {
- document.getElementById("testFrame").src = "bug_1281083.html";
- });
-}
-
-function waitForUpdateSuccess(callback) {
- let nextupdatetime =
- SpecialPowers.getCharPref("browser.safebrowsing.provider.mozilla.nextupdatetime");
-
- if (nextupdatetime !== "1") {
- callback();
- return;
- }
-
- timer.initWithCallback(function() {
- waitForUpdateSuccess(callback);
- }, 10, Components.interfaces.nsITimer.TYPE_ONE_SHOT);
-}
-
-function addCompletionToServer(list, url) {
- return new Promise(function(resolve, reject) {
- var listParam = "list=" + list;
- var fullhashParam = "fullhash=" + hash(url);
-
- var xhr = new XMLHttpRequest;
- xhr.open("PUT", UPDATE_URL + "?" +
- listParam + "&" +
- fullhashParam, true);
- xhr.setRequestHeader("Content-Type", "text/plain");
- xhr.onreadystatechange = function() {
- if (this.readyState == this.DONE) {
- resolve();
- }
- };
- xhr.send();
- });
-}
-
-function hash(str) {
- function bytesFromString(str) {
- var converter =
- SpecialPowers.Cc["@mozilla.org/intl/scriptableunicodeconverter"]
- .createInstance(SpecialPowers.Ci.nsIScriptableUnicodeConverter);
- converter.charset = "UTF-8";
- return converter.convertToByteArray(str);
- }
-
- var hasher = SpecialPowers.Cc["@mozilla.org/security/hash;1"]
- .createInstance(SpecialPowers.Ci.nsICryptoHash);
-
- var data = bytesFromString(str);
- hasher.init(hasher.SHA256);
- hasher.update(data, data.length);
-
- return hasher.finish(true);
-}
-
-function runTest() {
- /**
- * In this test we try to modify only urlclassifier.*Table preference to see if
- * url specified in the table will be blocked after update.
- */
- var pushPrefPromise = SpecialPowers.pushPrefEnv(
- {"set" : [["urlclassifier.trackingTable", testTable]]});
-
- // To make sure url is not blocked by an already blocked url.
- // Here we use non-tracking.example.com as a tracked url.
- // Since this table is only used in this bug, so it won't affect other testcases.
- var addCompletePromise =
- addCompletionToServer(testTable, "bug1281083.example.com/");
-
- Promise.all([pushPrefPromise, addCompletePromise])
- .then(() => {
- loadTestFrame();
- });
-}
-
-// Set nextupdatetime to 1 to trigger an update
-SpecialPowers.pushPrefEnv(
- {"set" : [["privacy.trackingprotection.enabled", true],
- ["channelclassifier.allowlist_example", true],
- ["browser.safebrowsing.provider.mozilla.nextupdatetime", "1"],
- ["browser.safebrowsing.provider.mozilla.lists", testTable],
- ["browser.safebrowsing.provider.mozilla.updateURL", UPDATE_URL]]},
- runTest);
-
-// Expected finish() call is in "bug_1281083.html".
-SimpleTest.waitForExplicitFinish();
-
-</script>
-</pre>
-<iframe id="testFrame" width="100%" height="100%" onload=""></iframe>
-</body>
-</html>
-
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_classifier_worker.html b/toolkit/components/url-classifier/tests/mochitest/test_classifier_worker.html
deleted file mode 100644
index 1f54d45b0..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_classifier_worker.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test the URI Classifier</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="classifierHelper.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
-
-// Add some URLs to the malware database.
-var testData = [
- { url: "example.com/tests/toolkit/components/url-classifier/tests/mochitest/evilWorker.js",
- db: "test-malware-simple"
- },
- { url: "example.com/tests/toolkit/components/url-classifier/tests/mochitest/unwantedWorker.js",
- db: "test-unwanted-simple"
- }
-];
-
-function loadTestFrame() {
- document.getElementById("testFrame").src =
- "http://example.com/tests/toolkit/components/url-classifier/tests/mochitest/workerFrame.html";
-}
-
-function onmessage(event)
-{
- var pieces = event.data.split(':');
- if (pieces[0] == "finish") {
- SimpleTest.finish();
- return;
- }
-
- is(pieces[0], "success", pieces[1]);
-}
-
-function updateSuccess() {
- SpecialPowers.pushPrefEnv(
- {"set" : [["browser.safebrowsing.malware.enabled", true]]},
- loadTestFrame);
-}
-
-function updateError(errorCode) {
- ok(false, "Couldn't update classifier. Error code: " + errorCode);
- // Abort test.
- SimpleTest.finish();
-};
-
-SpecialPowers.pushPrefEnv(
- {"set" : [["urlclassifier.malwareTable", "test-malware-simple,test-unwanted-simple"],
- ["urlclassifier.phishTable", "test-phish-simple"]]},
- function() {
- classifierHelper.waitForInit()
- .then(() => classifierHelper.addUrlToDB(testData))
- .then(updateSuccess)
- .catch(err => {
- updateError(err);
- });
- });
-
-window.addEventListener("message", onmessage, false);
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-
-</pre>
-<iframe id="testFrame" onload=""></iframe>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html b/toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html
deleted file mode 100644
index 96fa2891a..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html
+++ /dev/null
@@ -1,121 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Bug 1233914 - ping doesn't honor the TP list here.</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
- SimpleTest.requestFlakyTimeout("Delay to make sure ping is made prior than XHR");
-
- const timeout = 200;
- const host_nottrack = "http://not-tracking.example.com/";
- const host_track = "http://trackertest.org/";
- const path_ping = "tests/toolkit/components/url-classifier/tests/mochitest/ping.sjs";
- const TP_ENABLE_PREF = "privacy.trackingprotection.enabled";
-
- function testPingNonBlacklist() {
- SpecialPowers.setBoolPref(TP_ENABLE_PREF, true);
-
- var msg = "ping should reach page not in blacklist";
- var expectPing = true;
- var id = "1111";
- ping(id, host_nottrack);
-
- return new Promise(function(resolve, reject) {
- setTimeout(function() {
- isPinged(id, expectPing, msg, resolve);
- }, timeout);
- });
- }
-
- function testPingBlacklistSafebrowsingOff() {
- SpecialPowers.setBoolPref(TP_ENABLE_PREF, false);
-
- var msg = "ping should reach page in blacklist when tracking protection is off";
- var expectPing = true;
- var id = "2222";
- ping(id, host_track);
-
- return new Promise(function(resolve, reject) {
- setTimeout(function() {
- isPinged(id, expectPing, msg, resolve);
- }, timeout);
- });
- }
-
- function testPingBlacklistSafebrowsingOn() {
- SpecialPowers.setBoolPref(TP_ENABLE_PREF, true);
-
- var msg = "ping should not reach page in blacklist when tracking protection is on";
- var expectPing = false;
- var id = "3333";
- ping(id, host_track);
-
- return new Promise(function(resolve, reject) {
- setTimeout(function() {
- isPinged(id, expectPing, msg, resolve);
- }, timeout);
- });
- }
-
- function ping(id, host) {
- var elm = document.createElement("a");
- elm.setAttribute('ping', host + path_ping + "?id=" + id);
- elm.setAttribute('href', "#");
- document.body.appendChild(elm);
-
- // Trigger ping.
- elm.click();
-
- document.body.removeChild(elm);
- }
-
- function isPinged(id, expected, msg, callback) {
- var url = "http://mochi.test:8888/" + path_ping;
- var xhr = new XMLHttpRequest();
- xhr.open('GET', url + "?id=" + id);
- xhr.onload = function() {
- var isPinged = xhr.response === "ping";
- is(expected, isPinged, msg);
-
- callback();
- };
- xhr.send();
- }
-
- function cleanup() {
- SpecialPowers.clearUserPref(TP_ENABLE_PREF);
- }
-
- function runTest() {
- Promise.resolve()
- .then(testPingNonBlacklist)
- .then(testPingBlacklistSafebrowsingOff)
- .then(testPingBlacklistSafebrowsingOn)
- .then(function() {
- SimpleTest.finish();
- }).catch(function(e) {
- ok(false, "Some test failed with error " + e);
- SimpleTest.finish();
- });
- }
-
- SimpleTest.waitForExplicitFinish();
- SimpleTest.registerCleanupFunction(cleanup);
- SpecialPowers.pushPrefEnv({"set": [
- ["browser.send_pings", true],
- ["urlclassifier.trackingTable", "test-track-simple"],
- ]}, runTest);
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_classify_track.html b/toolkit/components/url-classifier/tests/mochitest/test_classify_track.html
deleted file mode 100644
index a868d7960..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_classify_track.html
+++ /dev/null
@@ -1,162 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Bug 1262406 - Track element doesn't use the URL classifier.</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="classifierHelper.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
- const PREF = "browser.safebrowsing.malware.enabled";
- const track_path = "tests/toolkit/components/url-classifier/tests/mochitest/basic.vtt";
- const malware_url = "http://malware.example.com/" + track_path;
- const validtrack_url = "http://mochi.test:8888/" + track_path;
-
- var video = document.createElement("video");
- video.src = "seek.webm";
- video.crossOrigin = "anonymous";
-
- document.body.appendChild(video);
-
- function testValidTrack() {
- SpecialPowers.setBoolPref(PREF, true);
-
- return new Promise(function(resolve, reject) {
- var track = document.createElement("track");
- track.src = validtrack_url;
- video.appendChild(track);
-
- function onload() {
- ok(true, "Track should be loaded when url is not in blacklist");
- finish();
- }
-
- function onerror() {
- ok(false, "Error while loading track");
- finish();
- }
-
- function finish() {
- track.removeEventListener("load", onload);
- track.removeEventListener("error", onerror)
- resolve();
- }
-
- track.addEventListener("load", onload);
- track.addEventListener("error", onerror)
- });
- }
-
- function testBlacklistTrackSafebrowsingOff() {
- SpecialPowers.setBoolPref(PREF, false);
-
- return new Promise(function(resolve, reject) {
- var track = document.createElement("track");
- track.src = malware_url;
- video.appendChild(track);
-
- function onload() {
- ok(true, "Track should be loaded when url is in blacklist and safebrowsing is off");
- finish();
- }
-
- function onerror() {
- ok(false, "Error while loading track");
- finish();
- }
-
- function finish() {
- track.removeEventListener("load", onload);
- track.removeEventListener("error", onerror)
- resolve();
- }
-
- track.addEventListener("load", onload);
- track.addEventListener("error", onerror)
- });
- }
-
- function testBlacklistTrackSafebrowsingOn() {
- SpecialPowers.setBoolPref(PREF, true);
-
- return new Promise(function(resolve, reject) {
- var track = document.createElement("track");
-
- // Add a query string parameter here to avoid url classifier bypass classify
- // because of cache.
- track.src = malware_url + "?testsbon";
- video.appendChild(track);
-
- function onload() {
- ok(false, "Unexpected result while loading track in blacklist");
- finish();
- }
-
- function onerror() {
- ok(true, "Track should not be loaded when url is in blacklist and safebrowsing is on");
- finish();
- }
-
- function finish() {
- track.removeEventListener("load", onload);
- track.removeEventListener("error", onerror)
- resolve();
- }
-
- track.addEventListener("load", onload);
- track.addEventListener("error", onerror)
- });
- }
-
- function cleanup() {
- SpecialPowers.clearUserPref(PREF);
- }
-
- function setup() {
- var testData = [
- { url: "malware.example.com/",
- db: "test-malware-simple"
- }
- ];
-
- return classifierHelper.addUrlToDB(testData)
- .catch(function(err) {
- ok(false, "Couldn't update classifier. Error code: " + err);
- // Abort test.
- SimpleTest.finish();
- });
- }
-
- function runTest() {
- Promise.resolve()
- .then(classifierHelper.waitForInit)
- .then(setup)
- .then(testValidTrack)
- .then(testBlacklistTrackSafebrowsingOff)
- .then(testBlacklistTrackSafebrowsingOn)
- .then(function() {
- SimpleTest.finish();
- }).catch(function(e) {
- ok(false, "Some test failed with error " + e);
- SimpleTest.finish();
- });
- }
-
- SimpleTest.waitForExplicitFinish();
- SimpleTest.registerCleanupFunction(cleanup);
- SpecialPowers.pushPrefEnv({"set": [
- ["media.webvtt.regions.enabled", true],
- ["urlclassifier.malwareTable", "test-malware-simple"],
- ]}, runTest);
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_donottrack.html b/toolkit/components/url-classifier/tests/mochitest/test_donottrack.html
deleted file mode 100644
index 56003e7eb..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_donottrack.html
+++ /dev/null
@@ -1,150 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Bug 1258033 - Fix the DNT loophole for tracking protection</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
-</head>
-
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
-
-var Cc = SpecialPowers.Cc;
-var Ci = SpecialPowers.Ci;
-
-var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShellTreeItem)
- .rootTreeItem
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindow);
-
-const tests = [
- // DNT turned on and TP turned off, DNT signal sent in both private browsing
- // and normal mode.
- {
- setting: {dntPref:true, tpPref:false, tppbPref:false, pbMode:true},
- expected: {dnt: "1"},
- },
- {
- setting: {dntPref:true, tpPref:false, tppbPref:false, pbMode:false},
- expected: {dnt: "1"}
- },
- // DNT turned off and TP turned on globally, DNT signal sent in both private
- // browsing and normal mode.
- {
- setting: {dntPref:false, tpPref:true, tppbPref:false, pbMode:true},
- expected: {dnt: "1"}
- },
- {
- setting: {dntPref:false, tpPref:true, tppbPref:false, pbMode:false},
- expected: {dnt: "1"}
- },
- // DNT turned off and TP in Private Browsing only, DNT signal sent in private
- // browsing mode only.
- {
- setting: {dntPref:false, tpPref:false, tppbPref:true, pbMode:true},
- expected: {dnt: "1"}
- },
- {
- setting: {dntPref:false, tpPref:false, tppbPref:true, pbMode:false},
- expected: {dnt: "unspecified"}
- },
- // DNT turned off and TP turned off, DNT signal is never sent.
- {
- setting: {dntPref:false, tpPref:false, tppbPref:false, pbMode:true},
- expected: {dnt: "unspecified"}
- },
- {
- setting: {dntPref:false, tpPref:false, tppbPref:false, pbMode:false},
- expected: {dnt: "unspecified"}
- },
-]
-
-const DNT_PREF = 'privacy.donottrackheader.enabled';
-const TP_PREF = 'privacy.trackingprotection.enabled';
-const TP_PB_PREF = 'privacy.trackingprotection.pbmode.enabled';
-
-const contentPage =
- "http://mochi.test:8888/tests/toolkit/components/url-classifier/tests/mochitest/dnt.html";
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-function whenDelayedStartupFinished(aWindow, aCallback) {
- Services.obs.addObserver(function observer(aSubject, aTopic) {
- if (aWindow == aSubject) {
- Services.obs.removeObserver(observer, aTopic);
- setTimeout(aCallback, 0);
- }
- }, "browser-delayed-startup-finished", false);
-}
-
-function executeTest(test) {
- SpecialPowers.pushPrefEnv({"set" : [
- [DNT_PREF, test.setting.dntPref],
- [TP_PREF, test.setting.tpPref],
- [TP_PB_PREF, test.setting.tppbPref]
- ]});
-
- var win = mainWindow.OpenBrowserWindow({private: test.setting.pbMode});
-
- return new Promise(function(resolve, reject) {
- win.addEventListener("load", function onLoad() {
- win.removeEventListener("load", onLoad, false);
- whenDelayedStartupFinished(win, function() {
- win.addEventListener("DOMContentLoaded", function onInnerLoad() {
- if (win.content.location.href != contentPage) {
- win.gBrowser.loadURI(contentPage);
- return;
- }
-
- win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
-
- win.content.addEventListener('message', function (event) {
- let [key, value] = event.data.split("=");
- if (key == "finish") {
- win.close();
- resolve();
- } else if (key == "navigator.doNotTrack") {
- is(value, test.expected.dnt, "navigator.doNotTrack should be " + test.expected.dnt);
- } else if (key == "DNT") {
- let msg = test.expected.dnt == "1" ? "" : "not ";
- is(value, test.expected.dnt, "DNT header should " + msg + "be sent");
- } else {
- ok(false, "unexpected message");
- }
- });
- }, true);
- SimpleTest.executeSoon(function() { win.gBrowser.loadURI(contentPage); });
- });
- }, true);
- });
-}
-
-let loop = function loop(index) {
- if (index >= tests.length) {
- SimpleTest.finish();
- return;
- }
-
- let test = tests[index];
- let next = function next() {
- loop(index + 1);
- };
- let result = executeTest(test);
- result.then(next, next);
-};
-
-SimpleTest.waitForExplicitFinish();
-loop(0);
-
-</script>
-
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_gethash.html b/toolkit/components/url-classifier/tests/mochitest/test_gethash.html
deleted file mode 100644
index af995e2a5..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_gethash.html
+++ /dev/null
@@ -1,157 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Bug 1272239 - Test gethash.</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="classifierHelper.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-<iframe id="testFrame1" onload=""></iframe>
-<iframe id="testFrame2" onload=""></iframe>
-
-<script class="testbody" type="text/javascript">
-
-const MALWARE_LIST = "test-malware-simple";
-const MALWARE_HOST = "malware.example.com/";
-
-const UNWANTED_LIST = "test-unwanted-simple";
-const UNWANTED_HOST = "unwanted.example.com/";
-
-const GETHASH_URL = "http://mochi.test:8888/tests/toolkit/components/url-classifier/tests/mochitest/gethash.sjs";
-const NOTEXIST_URL = "http://mochi.test:8888/tests/toolkit/components/url-classifier/tests/mochitest/nonexistserver.sjs";
-
-var shouldLoad = false;
-
-// In this testcase we store prefixes to localdb and send the fullhash to gethash server.
-// When access the test page gecko should trigger gethash request to server and
-// get the completion response.
-function loadTestFrame(id) {
- return new Promise(function(resolve, reject) {
-
- var iframe = document.getElementById(id);
- iframe.setAttribute("src", "gethashFrame.html");
-
- iframe.onload = function() {
- resolve();
- };
- });
-}
-
-// add 4-bytes prefixes to local database, so when we access the url,
-// it will trigger gethash request.
-function addPrefixToDB(list, url) {
- var testData = [{ db: list, url: url, len: 4 }];
-
- return classifierHelper.addUrlToDB(testData)
- .catch(function(err) {
- ok(false, "Couldn't update classifier. Error code: " + err);
- // Abort test.
- SimpleTest.finish();
- });
-}
-
-// calculate the fullhash and send it to gethash server
-function addCompletionToServer(list, url) {
- return new Promise(function(resolve, reject) {
- var listParam = "list=" + list;
- var fullhashParam = "fullhash=" + hash(url);
-
- var xhr = new XMLHttpRequest;
- xhr.open("PUT", GETHASH_URL + "?" +
- listParam + "&" +
- fullhashParam, true);
- xhr.setRequestHeader("Content-Type", "text/plain");
- xhr.onreadystatechange = function() {
- if (this.readyState == this.DONE) {
- resolve();
- }
- };
- xhr.send();
- });
-}
-
-function hash(str) {
- function bytesFromString(str) {
- var converter =
- SpecialPowers.Cc["@mozilla.org/intl/scriptableunicodeconverter"]
- .createInstance(SpecialPowers.Ci.nsIScriptableUnicodeConverter);
- converter.charset = "UTF-8";
- return converter.convertToByteArray(str);
- }
-
- var hasher = SpecialPowers.Cc["@mozilla.org/security/hash;1"]
- .createInstance(SpecialPowers.Ci.nsICryptoHash);
-
- var data = bytesFromString(str);
- hasher.init(hasher.SHA256);
- hasher.update(data, data.length);
-
- return hasher.finish(true);
-}
-
-function setup404() {
- shouldLoad = true;
-
- classifierHelper.allowCompletion([MALWARE_LIST, UNWANTED_LIST], NOTEXIST_URL);
-
- return Promise.all([
- addPrefixToDB(MALWARE_LIST, MALWARE_HOST),
- addPrefixToDB(UNWANTED_LIST, UNWANTED_HOST)
- ]);
-}
-
-function setup() {
- classifierHelper.allowCompletion([MALWARE_LIST, UNWANTED_LIST], GETHASH_URL);
-
- return Promise.all([
- addPrefixToDB(MALWARE_LIST, MALWARE_HOST),
- addPrefixToDB(UNWANTED_LIST, UNWANTED_HOST),
- addCompletionToServer(MALWARE_LIST, MALWARE_HOST),
- addCompletionToServer(UNWANTED_LIST, UNWANTED_HOST),
- ]);
-}
-
-// manually reset DB to make sure next test won't be affected by cache.
-function reset() {
- return classifierHelper.resetDB;
-}
-
-function runTest() {
- Promise.resolve()
- // This test resources get blocked when gethash returns successfully
- .then(classifierHelper.waitForInit)
- .then(setup)
- .then(() => loadTestFrame("testFrame1"))
- .then(reset)
- // This test resources are not blocked when gethash returns an error
- .then(setup404)
- .then(() => loadTestFrame("testFrame2"))
- .then(function() {
- SimpleTest.finish();
- }).catch(function(e) {
- ok(false, "Some test failed with error " + e);
- SimpleTest.finish();
- });
-}
-
-SimpleTest.waitForExplicitFinish();
-
-// 'network.predictor.enabled' is disabled because if other testcase load
-// evil.js, evil.css ...etc resources, it may cause we load them from cache
-// directly and bypass classifier check
-SpecialPowers.pushPrefEnv({"set": [
- ["browser.safebrowsing.malware.enabled", true],
- ["network.predictor.enabled", false],
- ["urlclassifier.gethash.timeout_ms", 30000],
-]}, runTest);
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_lookup_system_principal.html b/toolkit/components/url-classifier/tests/mochitest/test_lookup_system_principal.html
deleted file mode 100644
index fa61e6a00..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_lookup_system_principal.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test that lookup() on a system principal doesn't crash</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
-</head>
-
-<body>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script type="text/javascript">
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-
-var dbService = Cc["@mozilla.org/url-classifier/dbservice;1"]
- .getService(Ci.nsIUrlClassifierDBService);
-
-dbService.lookup(document.nodePrincipal, "", function(arg) {});
-
-ok(true, "lookup() didn't crash");
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html b/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
deleted file mode 100644
index 02ef57b46..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_privatebrowsing_trackingprotection.html
+++ /dev/null
@@ -1,154 +0,0 @@
-<!DOCTYPE HTML>
-<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
-<html>
-<head>
- <title>Test Tracking Protection in Private Browsing mode</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
-</head>
-
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
-
-var Cc = SpecialPowers.Cc;
-var Ci = SpecialPowers.Ci;
-
-var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShellTreeItem)
- .rootTreeItem
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindow);
-var contentPage = "http://www.itisatrap.org/tests/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html";
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://testing-common/UrlClassifierTestUtils.jsm");
-
-function whenDelayedStartupFinished(aWindow, aCallback) {
- Services.obs.addObserver(function observer(aSubject, aTopic) {
- if (aWindow == aSubject) {
- Services.obs.removeObserver(observer, aTopic);
- setTimeout(aCallback, 0);
- }
- }, "browser-delayed-startup-finished", false);
-}
-
-function testOnWindow(aPrivate, aCallback) {
- var win = mainWindow.OpenBrowserWindow({private: aPrivate});
- win.addEventListener("load", function onLoad() {
- win.removeEventListener("load", onLoad, false);
- whenDelayedStartupFinished(win, function() {
- win.addEventListener("DOMContentLoaded", function onInnerLoad() {
- if (win.content.location.href != contentPage) {
- win.gBrowser.loadURI(contentPage);
- return;
- }
- win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
-
- win.content.addEventListener('load', function innerLoad2() {
- win.content.removeEventListener('load', innerLoad2, false);
- SimpleTest.executeSoon(function() { aCallback(win); });
- }, false, true);
- }, true);
- SimpleTest.executeSoon(function() { win.gBrowser.loadURI(contentPage); });
- });
- }, true);
-}
-
-var badids = [
- "badscript",
- "badimage",
- "badcss"
-];
-
-function checkLoads(aWindow, aBlocked) {
- var win = aWindow.content;
- is(win.document.getElementById("badscript").dataset.touched, aBlocked ? "no" : "yes", "Should not load tracking javascript");
- is(win.document.getElementById("badimage").dataset.touched, aBlocked ? "no" : "yes", "Should not load tracking images");
- is(win.document.getElementById("goodscript").dataset.touched, "yes", "Should load whitelisted tracking javascript");
-
- var elt = win.document.getElementById("styleCheck");
- var style = win.document.defaultView.getComputedStyle(elt, "");
- isnot(style.visibility, aBlocked ? "hidden" : "", "Should not load tracking css");
-
- is(win.document.blockedTrackingNodeCount, aBlocked ? badids.length : 0, "Should identify all tracking elements");
-
- var blockedTrackingNodes = win.document.blockedTrackingNodes;
-
- // Make sure that every node in blockedTrackingNodes exists in the tree
- // (that may not always be the case but do not expect any nodes to disappear
- // from the tree here)
- var allNodeMatch = true;
- for (var i = 0; i < blockedTrackingNodes.length; i++) {
- var nodeMatch = false;
- for (var j = 0; j < badids.length && !nodeMatch; j++) {
- nodeMatch = nodeMatch ||
- (blockedTrackingNodes[i] == win.document.getElementById(badids[j]));
- }
-
- allNodeMatch = allNodeMatch && nodeMatch;
- }
- is(allNodeMatch, true, "All annotated nodes are expected in the tree");
-
- // Make sure that every node with a badid (see badids) is found in the
- // blockedTrackingNodes. This tells us if we are neglecting to annotate
- // some nodes
- allNodeMatch = true;
- for (var j = 0; j < badids.length; j++) {
- var nodeMatch = false;
- for (var i = 0; i < blockedTrackingNodes.length && !nodeMatch; i++) {
- nodeMatch = nodeMatch ||
- (blockedTrackingNodes[i] == win.document.getElementById(badids[j]));
- }
-
- allNodeMatch = allNodeMatch && nodeMatch;
- }
- is(allNodeMatch, aBlocked, "All tracking nodes are expected to be annotated as such");
-}
-
-SpecialPowers.pushPrefEnv(
- {"set" : [["urlclassifier.trackingTable", "test-track-simple"],
- ["privacy.trackingprotection.enabled", false],
- ["privacy.trackingprotection.pbmode.enabled", true],
- ["channelclassifier.allowlist_example", true]]},
- test);
-
-function test() {
- SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
- UrlClassifierTestUtils.addTestTrackers().then(() => {
- // Normal mode, with the pref (trackers should be loaded)
- testOnWindow(false, function(aWindow) {
- checkLoads(aWindow, false);
- aWindow.close();
-
- // Private Browsing, with the pref (trackers should be blocked)
- testOnWindow(true, function(aWindow) {
- checkLoads(aWindow, true);
- aWindow.close();
-
- // Private Browsing, without the pref (trackers should be loaded)
- SpecialPowers.setBoolPref("privacy.trackingprotection.pbmode.enabled", false);
- testOnWindow(true, function(aWindow) {
- checkLoads(aWindow, false);
- aWindow.close();
- SimpleTest.finish();
- });
- });
- });
- });
-}
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-
-</pre>
-<iframe id="testFrame" width="100%" height="100%" onload=""></iframe>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_safebrowsing_bug1272239.html b/toolkit/components/url-classifier/tests/mochitest/test_safebrowsing_bug1272239.html
deleted file mode 100644
index 8066c2a37..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_safebrowsing_bug1272239.html
+++ /dev/null
@@ -1,87 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Bug 1272239 - Only tables with provider could register gethash url in listmanager.</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
-</head>
-
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
-
-var Cc = SpecialPowers.Cc;
-var Ci = SpecialPowers.Ci;
-
-// List all the tables
-const prefs = [
- "urlclassifier.phishTable",
- "urlclassifier.malwareTable",
- "urlclassifier.downloadBlockTable",
- "urlclassifier.downloadAllowTable",
- "urlclassifier.trackingTable",
- "urlclassifier.trackingWhitelistTable",
- "urlclassifier.blockedTable"
-];
-
-var prefService = Cc["@mozilla.org/preferences-service;1"]
- .getService(Ci.nsIPrefService);
-
-// Get providers
-var providers = {};
-
-var branch = prefService.getBranch("browser.safebrowsing.provider.");
-var children = branch.getChildList("", {});
-
-for (var child of children) {
- var prefComponents = child.split(".");
- var providerName = prefComponents[0];
- providers[providerName] = {};
-}
-
-// Get lists from |browser.safebrowsing.provider.PROVIDER_NAME.lists| preference.
-var listsWithProvider = [];
-var listsToProvider = [];
-for (var provider in providers) {
- var pref = "browser.safebrowsing.provider." + provider + ".lists";
- var list = SpecialPowers.getCharPref(pref).split(",");
-
- listsToProvider = listsToProvider.concat(list.map( () => { return provider; }));
- listsWithProvider = listsWithProvider.concat(list);
-}
-
-// Get all the lists
-var lists = [];
-for (var pref of prefs) {
- lists = lists.concat(SpecialPowers.getCharPref(pref).split(","));
-}
-
-var listmanager = Cc["@mozilla.org/url-classifier/listmanager;1"].
- getService(Ci.nsIUrlListManager);
-
-for (var list of lists) {
- if (!list)
- continue;
-
- // For lists having a provider, it should have a correct gethash url
- // For lists without a provider, for example, test-malware-simple, it should not
- // have a gethash url.
- var url = listmanager.getGethashUrl(list);
- var index = listsWithProvider.indexOf(list);
- if (index >= 0) {
- var provider = listsToProvider[index];
- var pref = "browser.safebrowsing.provider." + provider + ".gethashURL";
- is(url, SpecialPowers.getCharPref(pref), list + " matches its gethash url");
- } else {
- is(url, "", list + " should not have a gethash url");
- }
-}
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1157081.html b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1157081.html
deleted file mode 100644
index 7611dd245..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_bug1157081.html
+++ /dev/null
@@ -1,107 +0,0 @@
-<!DOCTYPE HTML>
-<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
-<html>
-<head>
- <title>Test Tracking Protection with and without Safe Browsing (Bug #1157081)</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
-</head>
-
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
-
-var Cc = SpecialPowers.Cc;
-var Ci = SpecialPowers.Ci;
-
-var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShellTreeItem)
- .rootTreeItem
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindow);
-var contentPage = "chrome://mochitests/content/chrome/toolkit/components/url-classifier/tests/mochitest/classifiedAnnotatedPBFrame.html"
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://testing-common/UrlClassifierTestUtils.jsm");
-
-function whenDelayedStartupFinished(aWindow, aCallback) {
- Services.obs.addObserver(function observer(aSubject, aTopic) {
- if (aWindow == aSubject) {
- Services.obs.removeObserver(observer, aTopic);
- setTimeout(aCallback, 0);
- }
- }, "browser-delayed-startup-finished", false);
-}
-
-function testOnWindow(aCallback) {
- var win = mainWindow.OpenBrowserWindow();
- win.addEventListener("load", function onLoad() {
- win.removeEventListener("load", onLoad, false);
- whenDelayedStartupFinished(win, function() {
- win.addEventListener("DOMContentLoaded", function onInnerLoad() {
- if (win.content.location.href != contentPage) {
- win.gBrowser.loadURI(contentPage);
- return;
- }
- win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
-
- win.content.addEventListener('load', function innerLoad2() {
- win.content.removeEventListener('load', innerLoad2, false);
- SimpleTest.executeSoon(function() { aCallback(win); });
- }, false, true);
- }, true);
- SimpleTest.executeSoon(function() { win.gBrowser.loadURI(contentPage); });
- });
- }, true);
-}
-
-var badids = [
- "badscript"
-];
-
-function checkLoads(aWindow, aBlocked) {
- var win = aWindow.content;
- is(win.document.getElementById("badscript").dataset.touched, aBlocked ? "no" : "yes", "Should not load tracking javascript");
-}
-
-SpecialPowers.pushPrefEnv(
- {"set" : [["urlclassifier.trackingTable", "test-track-simple"],
- ["privacy.trackingprotection.enabled", true],
- ["browser.safebrowsing.malware.enabled", false],
- ["browser.safebrowsing.phishing.enabled", false],
- ["channelclassifier.allowlist_example", true]]},
- test);
-
-function test() {
- SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
- UrlClassifierTestUtils.addTestTrackers().then(() => {
- // Safe Browsing turned OFF, tracking protection should work nevertheless
- testOnWindow(function(aWindow) {
- checkLoads(aWindow, true);
- aWindow.close();
-
- // Safe Browsing turned ON, tracking protection should still work
- SpecialPowers.setBoolPref("browser.safebrowsing.phishing.enabled", true);
- testOnWindow(function(aWindow) {
- checkLoads(aWindow, true);
- aWindow.close();
- SimpleTest.finish();
- });
- });
- });
-}
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-
-</pre>
-<iframe id="testFrame" width="100%" height="100%" onload=""></iframe>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html b/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html
deleted file mode 100644
index 29de0dfed..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/test_trackingprotection_whitelist.html
+++ /dev/null
@@ -1,153 +0,0 @@
-<!DOCTYPE HTML>
-<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
-<html>
-<head>
- <title>Test Tracking Protection in Private Browsing mode</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css">
-</head>
-
-<body>
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-
-<script class="testbody" type="text/javascript">
-
-var Cc = SpecialPowers.Cc;
-var Ci = SpecialPowers.Ci;
-
-var mainWindow = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShellTreeItem)
- .rootTreeItem
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindow);
-var contentPage1 = "http://www.itisatrap.org/tests/toolkit/components/url-classifier/tests/mochitest/whitelistFrame.html";
-var contentPage2 = "http://example.com/tests/toolkit/components/url-classifier/tests/mochitest/whitelistFrame.html";
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://testing-common/UrlClassifierTestUtils.jsm");
-
-function whenDelayedStartupFinished(aWindow, aCallback) {
- Services.obs.addObserver(function observer(aSubject, aTopic) {
- if (aWindow == aSubject) {
- Services.obs.removeObserver(observer, aTopic);
- setTimeout(aCallback, 0);
- }
- }, "browser-delayed-startup-finished", false);
-}
-
-function testOnWindow(contentPage, aCallback) {
- var win = mainWindow.OpenBrowserWindow();
- win.addEventListener("load", function onLoad() {
- win.removeEventListener("load", onLoad, false);
- whenDelayedStartupFinished(win, function() {
- win.addEventListener("DOMContentLoaded", function onInnerLoad() {
- if (win.content.location.href != contentPage) {
- win.gBrowser.loadURI(contentPage);
- return;
- }
- win.removeEventListener("DOMContentLoaded", onInnerLoad, true);
-
- win.content.addEventListener('load', function innerLoad2() {
- win.content.removeEventListener('load', innerLoad2, false);
- SimpleTest.executeSoon(function() { aCallback(win); });
- }, false, true);
- }, true);
- SimpleTest.executeSoon(function() { win.gBrowser.loadURI(contentPage); });
- });
- }, true);
-}
-
-var alwaysbadids = [
- "badscript",
-];
-
-function checkLoads(aWindow, aWhitelisted) {
- var win = aWindow.content;
- is(win.document.getElementById("badscript").dataset.touched, "no", "Should not load tracking javascript");
- is(win.document.getElementById("goodscript").dataset.touched, aWhitelisted ? "yes" : "no", "Should load whitelisted tracking javascript");
-
- var badids = alwaysbadids.slice();
- if (!aWhitelisted) {
- badids.push("goodscript");
- }
- is(win.document.blockedTrackingNodeCount, badids.length, "Should identify all tracking elements");
-
- var blockedTrackingNodes = win.document.blockedTrackingNodes;
-
- // Make sure that every node in blockedTrackingNodes exists in the tree
- // (that may not always be the case but do not expect any nodes to disappear
- // from the tree here)
- var allNodeMatch = true;
- for (var i = 0; i < blockedTrackingNodes.length; i++) {
- var nodeMatch = false;
- for (var j = 0; j < badids.length && !nodeMatch; j++) {
- nodeMatch = nodeMatch ||
- (blockedTrackingNodes[i] == win.document.getElementById(badids[j]));
- }
-
- allNodeMatch = allNodeMatch && nodeMatch;
- }
- is(allNodeMatch, true, "All annotated nodes are expected in the tree");
-
- // Make sure that every node with a badid (see badids) is found in the
- // blockedTrackingNodes. This tells us if we are neglecting to annotate
- // some nodes
- allNodeMatch = true;
- for (var j = 0; j < badids.length; j++) {
- var nodeMatch = false;
- for (var i = 0; i < blockedTrackingNodes.length && !nodeMatch; i++) {
- nodeMatch = nodeMatch ||
- (blockedTrackingNodes[i] == win.document.getElementById(badids[j]));
- }
-
- allNodeMatch = allNodeMatch && nodeMatch;
- }
- is(allNodeMatch, true, "All tracking nodes are expected to be annotated as such");
-}
-
-SpecialPowers.pushPrefEnv(
- {"set" : [["privacy.trackingprotection.enabled", true],
- ["channelclassifier.allowlist_example", true]]},
- test);
-
-function test() {
- SimpleTest.registerCleanupFunction(UrlClassifierTestUtils.cleanupTestTrackers);
- UrlClassifierTestUtils.addTestTrackers().then(() => {
- // Load the test from a URL on the whitelist
- testOnWindow(contentPage1, function(aWindow) {
- checkLoads(aWindow, true);
- aWindow.close();
-
- // Load the test from a URL that's NOT on the whitelist
- testOnWindow(contentPage2, function(aWindow) {
- checkLoads(aWindow, false);
- aWindow.close();
-
- // Load the test from a URL on the whitelist but without the whitelist
- SpecialPowers.pushPrefEnv({"set" : [["urlclassifier.trackingWhitelistTable", ""]]},
- function() {
- testOnWindow(contentPage1, function(aWindow) {
- checkLoads(aWindow, false);
- aWindow.close();
- SimpleTest.finish();
- });
- });
-
- });
- });
- });
-}
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-
-</pre>
-<iframe id="testFrame" width="100%" height="100%" onload=""></iframe>
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/track.html b/toolkit/components/url-classifier/tests/mochitest/track.html
deleted file mode 100644
index 8785e7c5b..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/track.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<html>
- <head>
- </head>
- <body>
- <h1>Tracking Works!</h1>
- </body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/unwantedWorker.js b/toolkit/components/url-classifier/tests/mochitest/unwantedWorker.js
deleted file mode 100644
index ac34977d7..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/unwantedWorker.js
+++ /dev/null
@@ -1,3 +0,0 @@
-onmessage = function() {
- postMessage("loaded bad file");
-}
diff --git a/toolkit/components/url-classifier/tests/mochitest/update.sjs b/toolkit/components/url-classifier/tests/mochitest/update.sjs
deleted file mode 100644
index 53efaafdf..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/update.sjs
+++ /dev/null
@@ -1,114 +0,0 @@
-const CC = Components.Constructor;
-const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
- "nsIBinaryInputStream",
- "setInputStream");
-
-function handleRequest(request, response)
-{
- var query = {};
- request.queryString.split('&').forEach(function (val) {
- var idx = val.indexOf('=');
- query[val.slice(0, idx)] = unescape(val.slice(idx + 1));
- });
-
- // Store fullhash in the server side.
- if ("list" in query && "fullhash" in query) {
- // In the server side we will store:
- // 1. All the full hashes for a given list
- // 2. All the lists we have right now
- // data is separate by '\n'
- let list = query["list"];
- let hashes = getState(list);
-
- let hash = base64ToString(query["fullhash"]);
- hashes += hash + "\n";
- setState(list, hashes);
-
- let lists = getState("lists");
- if (lists.indexOf(list) == -1) {
- lists += list + "\n";
- setState("lists", lists);
- }
-
- return;
- }
-
- var body = new BinaryInputStream(request.bodyInputStream);
- var avail;
- var bytes = [];
-
- while ((avail = body.available()) > 0) {
- Array.prototype.push.apply(bytes, body.readByteArray(avail));
- }
-
- var responseBody = parseV2Request(bytes);
-
- response.setHeader("Content-Type", "text/plain", false);
- response.write(responseBody);
-}
-
-function parseV2Request(bytes) {
- var table = String.fromCharCode.apply(this, bytes).slice(0,-2);
-
- var ret = "";
- getState("lists").split("\n").forEach(function(list) {
- if (list == table) {
- var completions = getState(list).split("\n");
- ret += "n:1000\n"
- ret += "i:" + list + "\n";
- ret += "a:1:32:" + 32*(completions.length - 1) + "\n";
-
- for (var completion of completions) {
- ret += completion;
- }
- }
- });
-
- return ret;
-}
-
-/* Convert Base64 data to a string */
-const toBinaryTable = [
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,-1,
- -1,-1,-1,-1, -1,-1,-1,-1, -1,-1,-1,62, -1,-1,-1,63,
- 52,53,54,55, 56,57,58,59, 60,61,-1,-1, -1, 0,-1,-1,
- -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,10, 11,12,13,14,
- 15,16,17,18, 19,20,21,22, 23,24,25,-1, -1,-1,-1,-1,
- -1,26,27,28, 29,30,31,32, 33,34,35,36, 37,38,39,40,
- 41,42,43,44, 45,46,47,48, 49,50,51,-1, -1,-1,-1,-1
-];
-const base64Pad = '=';
-
-function base64ToString(data) {
- var result = '';
- var leftbits = 0; // number of bits decoded, but yet to be appended
- var leftdata = 0; // bits decoded, but yet to be appended
-
- // Convert one by one.
- for (var i = 0; i < data.length; i++) {
- var c = toBinaryTable[data.charCodeAt(i) & 0x7f];
- var padding = (data[i] == base64Pad);
- // Skip illegal characters and whitespace
- if (c == -1) continue;
-
- // Collect data into leftdata, update bitcount
- leftdata = (leftdata << 6) | c;
- leftbits += 6;
-
- // If we have 8 or more bits, append 8 bits to the result
- if (leftbits >= 8) {
- leftbits -= 8;
- // Append if not padding.
- if (!padding)
- result += String.fromCharCode((leftdata >> leftbits) & 0xff);
- leftdata &= (1 << leftbits) - 1;
- }
- }
-
- // If there are any bits left, the base64 string was corrupted
- if (leftbits)
- throw Components.Exception('Corrupted base64 string');
-
- return result;
-}
diff --git a/toolkit/components/url-classifier/tests/mochitest/vp9.webm b/toolkit/components/url-classifier/tests/mochitest/vp9.webm
deleted file mode 100644
index 221877e30..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/vp9.webm
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/url-classifier/tests/mochitest/whitelistFrame.html b/toolkit/components/url-classifier/tests/mochitest/whitelistFrame.html
deleted file mode 100644
index 620416fc7..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/whitelistFrame.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE HTML>
-<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
-<html>
-<head>
-<title></title>
-</head>
-<body>
-
-<script id="badscript" data-touched="not sure" src="http://trackertest.org/tests/toolkit/components/url-classifier/tests/mochitest/evil.js" onload="this.dataset.touched = 'yes';" onerror="this.dataset.touched = 'no';"></script>
-
-<script id="goodscript" data-touched="not sure" src="http://itisatracker.org/tests/toolkit/components/url-classifier/tests/mochitest/good.js" onload="this.dataset.touched = 'yes';" onerror="this.dataset.touched = 'no';"></script>
-
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/mochitest/workerFrame.html b/toolkit/components/url-classifier/tests/mochitest/workerFrame.html
deleted file mode 100644
index 69e8dd007..000000000
--- a/toolkit/components/url-classifier/tests/mochitest/workerFrame.html
+++ /dev/null
@@ -1,65 +0,0 @@
-<html>
-<head>
-<title></title>
-
-<script type="text/javascript">
-
-function startCleanWorker() {
- var worker = new Worker("cleanWorker.js");
-
- worker.onmessage = function(event) {
- if (event.data == "success") {
- window.parent.postMessage("success:blocked importScripts('evilWorker.js')", "*");
- } else {
- window.parent.postMessage("failure:failed to block importScripts('evilWorker.js')", "*");
- }
- window.parent.postMessage("finish", "*");
- };
-
- worker.onerror = function(event) {
- window.parent.postmessage("failure:failed to load cleanWorker.js", "*");
- window.parent.postMessage("finish", "*");
- };
-
- worker.postMessage("");
-}
-
-function startEvilWorker() {
- var worker = new Worker("evilWorker.js");
-
- worker.onmessage = function(event) {
- window.parent.postMessage("failure:failed to block evilWorker.js", "*");
- startUnwantedWorker();
- };
-
- worker.onerror = function(event) {
- window.parent.postMessage("success:blocked evilWorker.js", "*");
- startUnwantedWorker();
- };
-
- worker.postMessage("");
-}
-
-function startUnwantedWorker() {
- var worker = new Worker("unwantedWorker.js");
-
- worker.onmessage = function(event) {
- window.parent.postMessage("failure:failed to block unwantedWorker.js", "*");
- startCleanWorker();
- };
-
- worker.onerror = function(event) {
- window.parent.postMessage("success:blocked unwantedWorker.js", "*");
- startCleanWorker();
- };
-
- worker.postMessage("");
-}
-
-</script>
-
-</head>
-
-<body onload="startEvilWorker()">
-</body>
-</html>
diff --git a/toolkit/components/url-classifier/tests/moz.build b/toolkit/components/url-classifier/tests/moz.build
deleted file mode 100644
index 599727ab9..000000000
--- a/toolkit/components/url-classifier/tests/moz.build
+++ /dev/null
@@ -1,18 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-MOCHITEST_MANIFESTS += ['mochitest/mochitest.ini']
-MOCHITEST_CHROME_MANIFESTS += ['mochitest/chrome.ini']
-XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
-
-JAR_MANIFESTS += ['jar.mn']
-
-TESTING_JS_MODULES += [
- 'UrlClassifierTestUtils.jsm',
-]
-
-if CONFIG['ENABLE_TESTS']:
- DIRS += ['gtest']
diff --git a/toolkit/components/url-classifier/tests/unit/.eslintrc.js b/toolkit/components/url-classifier/tests/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/url-classifier/tests/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/url-classifier/tests/unit/data/digest1.chunk b/toolkit/components/url-classifier/tests/unit/data/digest1.chunk
deleted file mode 100644
index 3850373c1..000000000
--- a/toolkit/components/url-classifier/tests/unit/data/digest1.chunk
+++ /dev/null
Binary files differ
diff --git a/toolkit/components/url-classifier/tests/unit/data/digest2.chunk b/toolkit/components/url-classifier/tests/unit/data/digest2.chunk
deleted file mode 100644
index 738c96f6b..000000000
--- a/toolkit/components/url-classifier/tests/unit/data/digest2.chunk
+++ /dev/null
@@ -1,2 +0,0 @@
-a:5:32:32
-“Ê_Há^˜aÍ7ÂÙ]´=#ÌnmåÃøún‹æo—ÌQ‰ \ No newline at end of file
diff --git a/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js b/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
deleted file mode 100644
index 21849ced7..000000000
--- a/toolkit/components/url-classifier/tests/unit/head_urlclassifier.js
+++ /dev/null
@@ -1,429 +0,0 @@
-//* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- *
-function dumpn(s) {
- dump(s + "\n");
-}
-
-const NS_APP_USER_PROFILE_50_DIR = "ProfD";
-const NS_APP_USER_PROFILE_LOCAL_50_DIR = "ProfLD";
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://testing-common/httpd.js");
-
-do_get_profile();
-
-var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
-
-var iosvc = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService);
-
-var secMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
- .getService(Ci.nsIScriptSecurityManager);
-
-// Disable hashcompleter noise for tests
-var prefBranch = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
-prefBranch.setIntPref("urlclassifier.gethashnoise", 0);
-
-// Enable malware/phishing checking for tests
-prefBranch.setBoolPref("browser.safebrowsing.malware.enabled", true);
-prefBranch.setBoolPref("browser.safebrowsing.blockedURIs.enabled", true);
-prefBranch.setBoolPref("browser.safebrowsing.phishing.enabled", true);
-
-// Enable all completions for tests
-prefBranch.setCharPref("urlclassifier.disallow_completions", "");
-
-// Hash completion timeout
-prefBranch.setIntPref("urlclassifier.gethash.timeout_ms", 5000);
-
-function delFile(name) {
- try {
- // Delete a previously created sqlite file
- var file = dirSvc.get('ProfLD', Ci.nsIFile);
- file.append(name);
- if (file.exists())
- file.remove(false);
- } catch(e) {
- }
-}
-
-function cleanUp() {
- delFile("urlclassifier3.sqlite");
- delFile("safebrowsing/classifier.hashkey");
- delFile("safebrowsing/test-phish-simple.sbstore");
- delFile("safebrowsing/test-malware-simple.sbstore");
- delFile("safebrowsing/test-unwanted-simple.sbstore");
- delFile("safebrowsing/test-block-simple.sbstore");
- delFile("safebrowsing/test-track-simple.sbstore");
- delFile("safebrowsing/test-trackwhite-simple.sbstore");
- delFile("safebrowsing/test-phish-simple.pset");
- delFile("safebrowsing/test-malware-simple.pset");
- delFile("safebrowsing/test-unwanted-simple.pset");
- delFile("safebrowsing/test-block-simple.pset");
- delFile("safebrowsing/test-track-simple.pset");
- delFile("safebrowsing/test-trackwhite-simple.pset");
- delFile("safebrowsing/moz-phish-simple.sbstore");
- delFile("safebrowsing/moz-phish-simple.pset");
- delFile("testLarge.pset");
- delFile("testNoDelta.pset");
-}
-
-// Update uses allTables by default
-var allTables = "test-phish-simple,test-malware-simple,test-unwanted-simple,test-track-simple,test-trackwhite-simple,test-block-simple";
-var mozTables = "moz-phish-simple";
-
-var dbservice = Cc["@mozilla.org/url-classifier/dbservice;1"].getService(Ci.nsIUrlClassifierDBService);
-var streamUpdater = Cc["@mozilla.org/url-classifier/streamupdater;1"]
- .getService(Ci.nsIUrlClassifierStreamUpdater);
-
-
-/*
- * Builds an update from an object that looks like:
- *{ "test-phish-simple" : [{
- * "chunkType" : "a", // 'a' is assumed if not specified
- * "chunkNum" : 1, // numerically-increasing chunk numbers are assumed
- * // if not specified
- * "urls" : [ "foo.com/a", "foo.com/b", "bar.com/" ]
- * }
- */
-
-function buildUpdate(update, hashSize) {
- if (!hashSize) {
- hashSize = 32;
- }
- var updateStr = "n:1000\n";
-
- for (var tableName in update) {
- if (tableName != "")
- updateStr += "i:" + tableName + "\n";
- var chunks = update[tableName];
- for (var j = 0; j < chunks.length; j++) {
- var chunk = chunks[j];
- var chunkType = chunk.chunkType ? chunk.chunkType : 'a';
- var chunkNum = chunk.chunkNum ? chunk.chunkNum : j;
- updateStr += chunkType + ':' + chunkNum + ':' + hashSize;
-
- if (chunk.urls) {
- var chunkData = chunk.urls.join("\n");
- updateStr += ":" + chunkData.length + "\n" + chunkData;
- }
-
- updateStr += "\n";
- }
- }
-
- return updateStr;
-}
-
-function buildPhishingUpdate(chunks, hashSize) {
- return buildUpdate({"test-phish-simple" : chunks}, hashSize);
-}
-
-function buildMalwareUpdate(chunks, hashSize) {
- return buildUpdate({"test-malware-simple" : chunks}, hashSize);
-}
-
-function buildUnwantedUpdate(chunks, hashSize) {
- return buildUpdate({"test-unwanted-simple" : chunks}, hashSize);
-}
-
-function buildBlockedUpdate(chunks, hashSize) {
- return buildUpdate({"test-block-simple" : chunks}, hashSize);
-}
-
-function buildMozPhishingUpdate(chunks, hashSize) {
- return buildUpdate({"moz-phish-simple" : chunks}, hashSize);
-}
-
-function buildBareUpdate(chunks, hashSize) {
- return buildUpdate({"" : chunks}, hashSize);
-}
-
-/**
- * Performs an update of the dbservice manually, bypassing the stream updater
- */
-function doSimpleUpdate(updateText, success, failure) {
- var listener = {
- QueryInterface: function(iid)
- {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIUrlClassifierUpdateObserver))
- return this;
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
-
- updateUrlRequested: function(url) { },
- streamFinished: function(status) { },
- updateError: function(errorCode) { failure(errorCode); },
- updateSuccess: function(requestedTimeout) { success(requestedTimeout); }
- };
-
- dbservice.beginUpdate(listener, allTables);
- dbservice.beginStream("", "");
- dbservice.updateStream(updateText);
- dbservice.finishStream();
- dbservice.finishUpdate();
-}
-
-/**
- * Simulates a failed database update.
- */
-function doErrorUpdate(tables, success, failure) {
- var listener = {
- QueryInterface: function(iid)
- {
- if (iid.equals(Ci.nsISupports) ||
- iid.equals(Ci.nsIUrlClassifierUpdateObserver))
- return this;
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
-
- updateUrlRequested: function(url) { },
- streamFinished: function(status) { },
- updateError: function(errorCode) { success(errorCode); },
- updateSuccess: function(requestedTimeout) { failure(requestedTimeout); }
- };
-
- dbservice.beginUpdate(listener, tables, null);
- dbservice.beginStream("", "");
- dbservice.cancelUpdate();
-}
-
-/**
- * Performs an update of the dbservice using the stream updater and a
- * data: uri
- */
-function doStreamUpdate(updateText, success, failure, downloadFailure) {
- var dataUpdate = "data:," + encodeURIComponent(updateText);
-
- if (!downloadFailure) {
- downloadFailure = failure;
- }
-
- streamUpdater.downloadUpdates(allTables, "", true,
- dataUpdate, success, failure, downloadFailure);
-}
-
-var gAssertions = {
-
-tableData : function(expectedTables, cb)
-{
- dbservice.getTables(function(tables) {
- // rebuild the tables in a predictable order.
- var parts = tables.split("\n");
- while (parts[parts.length - 1] == '') {
- parts.pop();
- }
- parts.sort();
- tables = parts.join("\n");
-
- do_check_eq(tables, expectedTables);
- cb();
- });
-},
-
-checkUrls: function(urls, expected, cb, useMoz = false)
-{
- // work with a copy of the list.
- urls = urls.slice(0);
- var doLookup = function() {
- if (urls.length > 0) {
- var tables = useMoz ? mozTables : allTables;
- var fragment = urls.shift();
- var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + fragment, null, null), {});
- dbservice.lookup(principal, tables,
- function(arg) {
- do_check_eq(expected, arg);
- doLookup();
- }, true);
- } else {
- cb();
- }
- };
- doLookup();
-},
-
-checkTables: function(url, expected, cb)
-{
- var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + url, null, null), {});
- dbservice.lookup(principal, allTables, function(tables) {
- // Rebuild tables in a predictable order.
- var parts = tables.split(",");
- while (parts[parts.length - 1] == '') {
- parts.pop();
- }
- parts.sort();
- tables = parts.join(",");
- do_check_eq(tables, expected);
- cb();
- }, true);
-},
-
-urlsDontExist: function(urls, cb)
-{
- this.checkUrls(urls, '', cb);
-},
-
-urlsExist: function(urls, cb)
-{
- this.checkUrls(urls, 'test-phish-simple', cb);
-},
-
-malwareUrlsExist: function(urls, cb)
-{
- this.checkUrls(urls, 'test-malware-simple', cb);
-},
-
-unwantedUrlsExist: function(urls, cb)
-{
- this.checkUrls(urls, 'test-unwanted-simple', cb);
-},
-
-blockedUrlsExist: function(urls, cb)
-{
- this.checkUrls(urls, 'test-block-simple', cb);
-},
-
-mozPhishingUrlsExist: function(urls, cb)
-{
- this.checkUrls(urls, 'moz-phish-simple', cb, true);
-},
-
-subsDontExist: function(urls, cb)
-{
- // XXX: there's no interface for checking items in the subs table
- cb();
-},
-
-subsExist: function(urls, cb)
-{
- // XXX: there's no interface for checking items in the subs table
- cb();
-},
-
-urlExistInMultipleTables: function(data, cb)
-{
- this.checkTables(data["url"], data["tables"], cb);
-}
-
-};
-
-/**
- * Check a set of assertions against the gAssertions table.
- */
-function checkAssertions(assertions, doneCallback)
-{
- var checkAssertion = function() {
- for (var i in assertions) {
- var data = assertions[i];
- delete assertions[i];
- gAssertions[i](data, checkAssertion);
- return;
- }
-
- doneCallback();
- }
-
- checkAssertion();
-}
-
-function updateError(arg)
-{
- do_throw(arg);
-}
-
-// Runs a set of updates, and then checks a set of assertions.
-function doUpdateTest(updates, assertions, successCallback, errorCallback) {
- var errorUpdate = function() {
- checkAssertions(assertions, errorCallback);
- }
-
- var runUpdate = function() {
- if (updates.length > 0) {
- var update = updates.shift();
- doStreamUpdate(update, runUpdate, errorUpdate, null);
- } else {
- checkAssertions(assertions, successCallback);
- }
- }
-
- runUpdate();
-}
-
-var gTests;
-var gNextTest = 0;
-
-function runNextTest()
-{
- if (gNextTest >= gTests.length) {
- do_test_finished();
- return;
- }
-
- dbservice.resetDatabase();
- dbservice.setHashCompleter('test-phish-simple', null);
-
- let test = gTests[gNextTest++];
- dump("running " + test.name + "\n");
- test();
-}
-
-function runTests(tests)
-{
- gTests = tests;
- runNextTest();
-}
-
-var timerArray = [];
-
-function Timer(delay, cb) {
- this.cb = cb;
- var timer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
- timer.initWithCallback(this, delay, timer.TYPE_ONE_SHOT);
- timerArray.push(timer);
-}
-
-Timer.prototype = {
-QueryInterface: function(iid) {
- if (!iid.equals(Ci.nsISupports) && !iid.equals(Ci.nsITimerCallback)) {
- throw Cr.NS_ERROR_NO_INTERFACE;
- }
- return this;
- },
-notify: function(timer) {
- this.cb();
- }
-}
-
-// LFSRgenerator is a 32-bit linear feedback shift register random number
-// generator. It is highly predictable and is not intended to be used for
-// cryptography but rather to allow easier debugging than a test that uses
-// Math.random().
-function LFSRgenerator(seed) {
- // Force |seed| to be a number.
- seed = +seed;
- // LFSR generators do not work with a value of 0.
- if (seed == 0)
- seed = 1;
-
- this._value = seed;
-}
-LFSRgenerator.prototype = {
- // nextNum returns a random unsigned integer of in the range [0,2^|bits|].
- nextNum: function(bits) {
- if (!bits)
- bits = 32;
-
- let val = this._value;
- // Taps are 32, 22, 2 and 1.
- let bit = ((val >>> 0) ^ (val >>> 10) ^ (val >>> 30) ^ (val >>> 31)) & 1;
- val = (val >>> 1) | (bit << 31);
- this._value = val;
-
- return (val >>> (32 - bits));
- },
-};
-
-cleanUp();
diff --git a/toolkit/components/url-classifier/tests/unit/tail_urlclassifier.js b/toolkit/components/url-classifier/tests/unit/tail_urlclassifier.js
deleted file mode 100644
index 37f39d1a8..000000000
--- a/toolkit/components/url-classifier/tests/unit/tail_urlclassifier.js
+++ /dev/null
@@ -1 +0,0 @@
-cleanUp();
diff --git a/toolkit/components/url-classifier/tests/unit/test_addsub.js b/toolkit/components/url-classifier/tests/unit/test_addsub.js
deleted file mode 100644
index 1ed65c7ba..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_addsub.js
+++ /dev/null
@@ -1,488 +0,0 @@
-
-function doTest(updates, assertions)
-{
- doUpdateTest(updates, assertions, runNextTest, updateError);
-}
-
-// Test an add of two urls to a fresh database
-function testSimpleAdds() {
- var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsExist" : addUrls
- };
-
- doTest([update], assertions);
-}
-
-// Same as testSimpleAdds, but make the same-domain URLs come from different
-// chunks.
-function testMultipleAdds() {
- var add1Urls = [ "foo.com/a", "bar.com/c" ];
- var add2Urls = [ "foo.com/b" ];
-
- var update = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "urls" : add1Urls },
- { "chunkNum" : 2,
- "urls" : add2Urls }]);
- var assertions = {
- "tableData" : "test-phish-simple;a:1-2",
- "urlsExist" : add1Urls.concat(add2Urls)
- };
-
- doTest([update], assertions);
-}
-
-// Test that a sub will remove an existing add
-function testSimpleSub()
-{
- var addUrls = ["foo.com/a", "bar.com/b"];
- var subUrls = ["1:foo.com/a"];
-
- var addUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 1, // adds and subtracts don't share a chunk numbering space
- "urls": addUrls }]);
-
- var subUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 50,
- "chunkType" : "s",
- "urls": subUrls }]);
-
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1:s:50",
- "urlsExist" : [ "bar.com/b" ],
- "urlsDontExist": ["foo.com/a" ],
- "subsDontExist" : [ "foo.com/a" ]
- }
-
- doTest([addUpdate, subUpdate], assertions);
-
-}
-
-// Same as testSimpleSub(), but the sub comes in before the add.
-function testSubEmptiesAdd()
-{
- var subUrls = ["1:foo.com/a"];
- var addUrls = ["foo.com/a", "bar.com/b"];
-
- var subUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 50,
- "chunkType" : "s",
- "urls": subUrls }]);
-
- var addUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "urls": addUrls }]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1:s:50",
- "urlsExist" : [ "bar.com/b" ],
- "urlsDontExist": ["foo.com/a" ],
- "subsDontExist" : [ "foo.com/a" ] // this sub was found, it shouldn't exist anymore
- }
-
- doTest([subUpdate, addUpdate], assertions);
-}
-
-// Very similar to testSubEmptiesAdd, except that the domain entry will
-// still have an item left over that needs to be synced.
-function testSubPartiallyEmptiesAdd()
-{
- var subUrls = ["1:foo.com/a"];
- var addUrls = ["foo.com/a", "foo.com/b", "bar.com/b"];
-
- var subUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "chunkType" : "s",
- "urls": subUrls }]);
-
- var addUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 1, // adds and subtracts don't share a chunk numbering space
- "urls": addUrls }]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1:s:1",
- "urlsExist" : [ "foo.com/b", "bar.com/b" ],
- "urlsDontExist" : ["foo.com/a" ],
- "subsDontExist" : [ "foo.com/a" ] // this sub was found, it shouldn't exist anymore
- }
-
- doTest([subUpdate, addUpdate], assertions);
-}
-
-// We SHOULD be testing that pending subs are removed using
-// subsDontExist assertions. Since we don't have a good interface for getting
-// at sub entries, we'll verify it by side-effect. Subbing a url once
-// then adding it twice should leave the url intact.
-function testPendingSubRemoved()
-{
- var subUrls = ["1:foo.com/a", "2:foo.com/b"];
- var addUrls = ["foo.com/a", "foo.com/b"];
-
- var subUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "chunkType" : "s",
- "urls": subUrls }]);
-
- var addUpdate1 = buildPhishingUpdate(
- [{ "chunkNum" : 1, // adds and subtracts don't share a chunk numbering space
- "urls": addUrls }]);
-
- var addUpdate2 = buildPhishingUpdate(
- [{ "chunkNum" : 2,
- "urls": addUrls }]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1-2:s:1",
- "urlsExist" : [ "foo.com/a", "foo.com/b" ],
- "subsDontExist" : [ "foo.com/a", "foo.com/b" ] // this sub was found, it shouldn't exist anymore
- }
-
- doTest([subUpdate, addUpdate1, addUpdate2], assertions);
-}
-
-// Make sure that a saved sub is removed when the sub chunk is expired.
-function testPendingSubExpire()
-{
- var subUrls = ["1:foo.com/a", "1:foo.com/b"];
- var addUrls = ["foo.com/a", "foo.com/b"];
-
- var subUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "chunkType" : "s",
- "urls": subUrls }]);
-
- var expireUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "chunkType" : "sd" }]);
-
- var addUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 1, // adds and subtracts don't share a chunk numbering space
- "urls": addUrls }]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsExist" : [ "foo.com/a", "foo.com/b" ],
- "subsDontExist" : [ "foo.com/a", "foo.com/b" ] // this sub was expired
- }
-
- doTest([subUpdate, expireUpdate, addUpdate], assertions);
-}
-
-// Make sure that the sub url removes from only the chunk that it specifies
-function testDuplicateAdds()
-{
- var urls = ["foo.com/a"];
-
- var addUpdate1 = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "urls": urls }]);
- var addUpdate2 = buildPhishingUpdate(
- [{ "chunkNum" : 2,
- "urls": urls }]);
- var subUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 3,
- "chunkType" : "s",
- "urls": ["2:foo.com/a"]}]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1-2:s:3",
- "urlsExist" : [ "foo.com/a"],
- "subsDontExist" : [ "foo.com/a"]
- }
-
- doTest([addUpdate1, addUpdate2, subUpdate], assertions);
-}
-
-// Tests a sub which matches some existing adds but leaves others.
-function testSubPartiallyMatches()
-{
- var subUrls = ["foo.com/a"];
- var addUrls = ["1:foo.com/a", "2:foo.com/b"];
-
- var addUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "urls" : addUrls }]);
-
- var subUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "chunkType" : "s",
- "urls" : addUrls }]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1:s:1",
- "urlsDontExist" : ["foo.com/a"],
- "subsDontExist" : ["foo.com/a"],
- "subsExist" : ["foo.com/b"]
- };
-
- doTest([addUpdate, subUpdate], assertions);
-}
-
-// XXX: because subsExist isn't actually implemented, this is the same
-// test as above but with a second add chunk that should fail to be added
-// because of a pending sub chunk.
-function testSubPartiallyMatches2()
-{
- var addUrls = ["foo.com/a"];
- var subUrls = ["1:foo.com/a", "2:foo.com/b"];
- var addUrls2 = ["foo.com/b"];
-
- var addUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "urls" : addUrls }]);
-
- var subUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "chunkType" : "s",
- "urls" : subUrls }]);
-
- var addUpdate2 = buildPhishingUpdate(
- [{ "chunkNum" : 2,
- "urls" : addUrls2 }]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1-2:s:1",
- "urlsDontExist" : ["foo.com/a", "foo.com/b"],
- "subsDontExist" : ["foo.com/a", "foo.com/b"]
- };
-
- doTest([addUpdate, subUpdate, addUpdate2], assertions);
-}
-
-// Verify that two subs for the same domain but from different chunks
-// match (tests that existing sub entries are properly updated)
-function testSubsDifferentChunks() {
- var subUrls1 = [ "3:foo.com/a" ];
- var subUrls2 = [ "3:foo.com/b" ];
-
- var addUrls = [ "foo.com/a", "foo.com/b", "foo.com/c" ];
-
- var subUpdate1 = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "chunkType" : "s",
- "urls": subUrls1 }]);
- var subUpdate2 = buildPhishingUpdate(
- [{ "chunkNum" : 2,
- "chunkType" : "s",
- "urls" : subUrls2 }]);
- var addUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 3,
- "urls" : addUrls }]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:3:s:1-2",
- "urlsExist" : [ "foo.com/c" ],
- "urlsDontExist" : [ "foo.com/a", "foo.com/b" ],
- "subsDontExist" : [ "foo.com/a", "foo.com/b" ]
- };
-
- doTest([subUpdate1, subUpdate2, addUpdate], assertions);
-}
-
-// for bug 534079
-function testSubsDifferentChunksSameHostId() {
- var subUrls1 = [ "1:foo.com/a" ];
- var subUrls2 = [ "1:foo.com/b", "2:foo.com/c" ];
-
- var addUrls = [ "foo.com/a", "foo.com/b" ];
- var addUrls2 = [ "foo.com/c" ];
-
- var subUpdate1 = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "chunkType" : "s",
- "urls": subUrls1 }]);
- var subUpdate2 = buildPhishingUpdate(
- [{ "chunkNum" : 2,
- "chunkType" : "s",
- "urls" : subUrls2 }]);
-
- var addUpdate = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "urls" : addUrls }]);
- var addUpdate2 = buildPhishingUpdate(
- [{ "chunkNum" : 2,
- "urls" : addUrls2 }]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1-2:s:1-2",
- "urlsDontExist" : [ "foo.com/c", "foo.com/b", "foo.com/a", ],
- };
-
- doTest([addUpdate, addUpdate2, subUpdate1, subUpdate2], assertions);
-}
-
-// Test lists of expired chunks
-function testExpireLists() {
- var addUpdate = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : [ "foo.com/a" ]
- },
- { "chunkNum" : 3,
- "urls" : [ "bar.com/a" ]
- },
- { "chunkNum" : 4,
- "urls" : [ "baz.com/a" ]
- },
- { "chunkNum" : 5,
- "urls" : [ "blah.com/a" ]
- },
- ]);
- var subUpdate = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "chunkType" : "s",
- "urls" : [ "50:foo.com/1" ]
- },
- { "chunkNum" : 2,
- "chunkType" : "s",
- "urls" : [ "50:bar.com/1" ]
- },
- { "chunkNum" : 3,
- "chunkType" : "s",
- "urls" : [ "50:baz.com/1" ]
- },
- { "chunkNum" : 5,
- "chunkType" : "s",
- "urls" : [ "50:blah.com/1" ]
- },
- ]);
-
- var expireUpdate = buildPhishingUpdate(
- [ { "chunkType" : "ad:1,3-5" },
- { "chunkType" : "sd:1-3,5" }]);
-
- var assertions = {
- // "tableData" : "test-phish-simple;"
- "tableData": ""
- };
-
- doTest([addUpdate, subUpdate, expireUpdate], assertions);
-}
-
-// Test a duplicate add chunk.
-function testDuplicateAddChunks() {
- var addUrls1 = [ "foo.com/a" ];
- var addUrls2 = [ "bar.com/b" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls1
- },
- { "chunkNum" : 1,
- "urls" : addUrls2
- }]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsExist" : addUrls1,
- "urlsDontExist" : addUrls2
- };
-
- doTest([update], assertions);
-}
-
-// This test is a bit tricky. We want to test that an add removes all
-// subs with the same add chunk id, even if there is no match. To do
-// that we need to add the same add chunk twice, with an expiration
-// in the middle. This would be easier if subsDontExist actually
-// worked...
-function testExpireWholeSub()
-{
- var subUrls = ["1:foo.com/a"];
-
- var update = buildPhishingUpdate(
- [{ "chunkNum" : 5,
- "chunkType" : "s",
- "urls" : subUrls
- },
- // empty add chunk should still cause foo.com/a to go away.
- { "chunkNum" : 1,
- "urls" : []
- },
- // and now adding chunk 1 again with foo.com/a should succeed,
- // because the sub should have been expired with the empty
- // add chunk.
-
- // we need to expire this chunk to let us add chunk 1 again.
- {
- "chunkType" : "ad:1"
- },
- { "chunkNum" : 1,
- "urls" : [ "foo.com/a" ]
- }]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1:s:5",
- "urlsExist" : ["foo.com/a"]
- };
-
- doTest([update], assertions);
-}
-
-
-// This test is roughly the opposite of testExpireWholeSub(). We add
-// the empty add first, and make sure that it prevents a sub for that
-// add from being applied.
-function testPreventWholeSub()
-{
- var subUrls = ["1:foo.com/a"];
-
- var update = buildPhishingUpdate(
- [ // empty add chunk should cause foo.com/a to not be saved
- { "chunkNum" : 1,
- "urls" : []
- },
- { "chunkNum" : 5,
- "chunkType" : "s",
- "urls" : subUrls
- },
- // and now adding chunk 1 again with foo.com/a should succeed,
- // because the sub should have been expired with the empty
- // add chunk.
-
- // we need to expire this chunk to let us add chunk 1 again.
- {
- "chunkType" : "ad:1"
- },
- { "chunkNum" : 1,
- "urls" : [ "foo.com/a" ]
- }]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1:s:5",
- "urlsExist" : ["foo.com/a"]
- };
-
- doTest([update], assertions);
-}
-
-function run_test()
-{
- runTests([
- testSimpleAdds,
- testMultipleAdds,
- testSimpleSub,
- testSubEmptiesAdd,
- testSubPartiallyEmptiesAdd,
- testPendingSubRemoved,
- testPendingSubExpire,
- testDuplicateAdds,
- testSubPartiallyMatches,
- testSubPartiallyMatches2,
- testSubsDifferentChunks,
- testSubsDifferentChunksSameHostId,
- testExpireLists
- ]);
-}
-
-do_test_pending();
diff --git a/toolkit/components/url-classifier/tests/unit/test_backoff.js b/toolkit/components/url-classifier/tests/unit/test_backoff.js
deleted file mode 100644
index 365568c47..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_backoff.js
+++ /dev/null
@@ -1,89 +0,0 @@
-// Some unittests (e.g., paste into JS shell)
-var jslib = Cc["@mozilla.org/url-classifier/jslib;1"].
- getService().wrappedJSObject;
-var _Datenow = jslib.Date.now;
-function setNow(time) {
- jslib.Date.now = function() {
- return time;
- }
-}
-
-function run_test() {
- // 3 errors, 1ms retry period, max 3 requests per ten milliseconds,
- // 5ms backoff interval, 19ms max delay
- var rb = new jslib.RequestBackoff(3, 1, 3, 10, 5, 19);
- setNow(1);
- rb.noteServerResponse(200);
- do_check_true(rb.canMakeRequest());
- setNow(2);
- do_check_true(rb.canMakeRequest());
-
- // First error should trigger a 1ms delay
- rb.noteServerResponse(500);
- do_check_false(rb.canMakeRequest());
- do_check_eq(rb.nextRequestTime_, 3);
- setNow(3);
- do_check_true(rb.canMakeRequest());
-
- // Second error should also trigger a 1ms delay
- rb.noteServerResponse(500);
- do_check_false(rb.canMakeRequest());
- do_check_eq(rb.nextRequestTime_, 4);
- setNow(4);
- do_check_true(rb.canMakeRequest());
-
- // Third error should trigger a 5ms backoff
- rb.noteServerResponse(500);
- do_check_false(rb.canMakeRequest());
- do_check_eq(rb.nextRequestTime_, 9);
- setNow(9);
- do_check_true(rb.canMakeRequest());
-
- // Trigger backoff again
- rb.noteServerResponse(503);
- do_check_false(rb.canMakeRequest());
- do_check_eq(rb.nextRequestTime_, 19);
- setNow(19);
- do_check_true(rb.canMakeRequest());
-
- // Trigger backoff a third time and hit max timeout
- rb.noteServerResponse(302);
- do_check_false(rb.canMakeRequest());
- do_check_eq(rb.nextRequestTime_, 38);
- setNow(38);
- do_check_true(rb.canMakeRequest());
-
- // One more backoff, should still be at the max timeout
- rb.noteServerResponse(400);
- do_check_false(rb.canMakeRequest());
- do_check_eq(rb.nextRequestTime_, 57);
- setNow(57);
- do_check_true(rb.canMakeRequest());
-
- // Request goes through
- rb.noteServerResponse(200);
- do_check_true(rb.canMakeRequest());
- do_check_eq(rb.nextRequestTime_, 0);
- setNow(58);
- rb.noteServerResponse(500);
-
- // Another error, should trigger a 1ms backoff
- do_check_false(rb.canMakeRequest());
- do_check_eq(rb.nextRequestTime_, 59);
-
- setNow(59);
- do_check_true(rb.canMakeRequest());
-
- setNow(200);
- rb.noteRequest();
- setNow(201);
- rb.noteRequest();
- setNow(202);
- do_check_true(rb.canMakeRequest());
- rb.noteRequest();
- do_check_false(rb.canMakeRequest());
- setNow(211);
- do_check_true(rb.canMakeRequest());
-
- jslib.Date.now = _Datenow;
-}
diff --git a/toolkit/components/url-classifier/tests/unit/test_bug1274685_unowned_list.js b/toolkit/components/url-classifier/tests/unit/test_bug1274685_unowned_list.js
deleted file mode 100644
index 037bc7b88..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_bug1274685_unowned_list.js
+++ /dev/null
@@ -1,32 +0,0 @@
-Cu.import("resource://gre/modules/SafeBrowsing.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://testing-common/AppInfo.jsm");
-
-// 'Cc["@mozilla.org/xre/app-info;1"]' for xpcshell has no nsIXULAppInfo
-// so that we have to update it to make nsURLFormatter.js happy.
-// (SafeBrowsing.init() will indirectly use nsURLFormatter.js)
-updateAppInfo();
-
-function run_test() {
- SafeBrowsing.init();
-
- let origList = Services.prefs.getCharPref("browser.safebrowsing.provider.google.lists");
-
- // Remove 'goog-malware-shavar' from the original.
- let trimmedList = origList.replace('goog-malware-shavar,', '');
- Services.prefs.setCharPref("browser.safebrowsing.provider.google.lists", trimmedList);
-
- try {
- // Bug 1274685 - Unowned Safe Browsing tables break list updates
- //
- // If SafeBrowsing.registerTableWithURLs() doesn't check if
- // a provider is found before registering table, an exception
- // will be thrown while accessing a null object.
- //
- SafeBrowsing.registerTables();
- } catch (e) {
- ok(false, 'Exception thrown due to ' + e.toString());
- }
-
- Services.prefs.setCharPref("browser.safebrowsing.provider.google.lists", origList);
-}
diff --git a/toolkit/components/url-classifier/tests/unit/test_dbservice.js b/toolkit/components/url-classifier/tests/unit/test_dbservice.js
deleted file mode 100644
index 4b01e7016..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_dbservice.js
+++ /dev/null
@@ -1,314 +0,0 @@
-var checkUrls = [];
-var checkExpect;
-
-var chunk1Urls = [
- "test.com/aba",
- "test.com/foo/bar",
- "foo.bar.com/a/b/c"
-];
-var chunk1 = chunk1Urls.join("\n");
-
-var chunk2Urls = [
- "blah.com/a",
- "baz.com/",
- "255.255.0.1/",
- "www.foo.com/test2?param=1"
-];
-var chunk2 = chunk2Urls.join("\n");
-
-var chunk3Urls = [
- "test.com/a",
- "foo.bar.com/a",
- "blah.com/a",
- ];
-var chunk3 = chunk3Urls.join("\n");
-
-var chunk3SubUrls = [
- "1:test.com/a",
- "1:foo.bar.com/a",
- "2:blah.com/a" ];
-var chunk3Sub = chunk3SubUrls.join("\n");
-
-var chunk4Urls = [
- "a.com/b",
- "b.com/c",
- ];
-var chunk4 = chunk4Urls.join("\n");
-
-var chunk5Urls = [
- "d.com/e",
- "f.com/g",
- ];
-var chunk5 = chunk5Urls.join("\n");
-
-var chunk6Urls = [
- "h.com/i",
- "j.com/k",
- ];
-var chunk6 = chunk6Urls.join("\n");
-
-var chunk7Urls = [
- "l.com/m",
- "n.com/o",
- ];
-var chunk7 = chunk7Urls.join("\n");
-
-// we are going to add chunks 1, 2, 4, 5, and 6 to phish-simple,
-// chunk 2 to malware-simple, and chunk 3 to unwanted-simple,
-// and chunk 7 to block-simple.
-// Then we'll remove the urls in chunk3 from phish-simple, then
-// expire chunk 1 and chunks 4-7 from phish-simple.
-var phishExpected = {};
-var phishUnexpected = {};
-var malwareExpected = {};
-var unwantedExpected = {};
-var blockedExpected = {};
-for (var i = 0; i < chunk2Urls.length; i++) {
- phishExpected[chunk2Urls[i]] = true;
- malwareExpected[chunk2Urls[i]] = true;
-}
-for (var i = 0; i < chunk3Urls.length; i++) {
- unwantedExpected[chunk3Urls[i]] = true;
- delete phishExpected[chunk3Urls[i]];
- phishUnexpected[chunk3Urls[i]] = true;
-}
-for (var i = 0; i < chunk1Urls.length; i++) {
- // chunk1 urls are expired
- phishUnexpected[chunk1Urls[i]] = true;
-}
-for (var i = 0; i < chunk4Urls.length; i++) {
- // chunk4 urls are expired
- phishUnexpected[chunk4Urls[i]] = true;
-}
-for (var i = 0; i < chunk5Urls.length; i++) {
- // chunk5 urls are expired
- phishUnexpected[chunk5Urls[i]] = true;
-}
-for (var i = 0; i < chunk6Urls.length; i++) {
- // chunk6 urls are expired
- phishUnexpected[chunk6Urls[i]] = true;
-}
-for (var i = 0; i < chunk7Urls.length; i++) {
- blockedExpected[chunk7Urls[i]] = true;
- // chunk7 urls are expired
- phishUnexpected[chunk7Urls[i]] = true;
-}
-
-// Check that the entries hit based on sub-parts
-phishExpected["baz.com/foo/bar"] = true;
-phishExpected["foo.bar.baz.com/foo"] = true;
-phishExpected["bar.baz.com/"] = true;
-
-var numExpecting;
-
-function testFailure(arg) {
- do_throw(arg);
-}
-
-function checkNoHost()
-{
- // Looking up a no-host uri such as a data: uri should throw an exception.
- var exception;
- try {
- var principal = secMan.createCodebasePrincipal(iosvc.newURI("data:text/html,<b>test</b>", null, null), {});
- dbservice.lookup(principal, allTables);
-
- exception = false;
- } catch(e) {
- exception = true;
- }
- do_check_true(exception);
-
- do_test_finished();
-}
-
-function tablesCallbackWithoutSub(tables)
-{
- var parts = tables.split("\n");
- parts.sort();
-
- // there's a leading \n here because splitting left an empty string
- // after the trailing newline, which will sort first
- do_check_eq(parts.join("\n"),
- "\ntest-block-simple;a:1\ntest-malware-simple;a:1\ntest-phish-simple;a:2\ntest-unwanted-simple;a:1");
-
- checkNoHost();
-}
-
-
-function expireSubSuccess(result) {
- dbservice.getTables(tablesCallbackWithoutSub);
-}
-
-function tablesCallbackWithSub(tables)
-{
- var parts = tables.split("\n");
- parts.sort();
-
- // there's a leading \n here because splitting left an empty string
- // after the trailing newline, which will sort first
- do_check_eq(parts.join("\n"),
- "\ntest-block-simple;a:1\ntest-malware-simple;a:1\ntest-phish-simple;a:2:s:3\ntest-unwanted-simple;a:1");
-
- // verify that expiring a sub chunk removes its name from the list
- var data =
- "n:1000\n" +
- "i:test-phish-simple\n" +
- "sd:3\n";
-
- doSimpleUpdate(data, expireSubSuccess, testFailure);
-}
-
-function checkChunksWithSub()
-{
- dbservice.getTables(tablesCallbackWithSub);
-}
-
-function checkDone() {
- if (--numExpecting == 0)
- checkChunksWithSub();
-}
-
-function phishExists(result) {
- dumpn("phishExists: " + result);
- try {
- do_check_true(result.indexOf("test-phish-simple") != -1);
- } finally {
- checkDone();
- }
-}
-
-function phishDoesntExist(result) {
- dumpn("phishDoesntExist: " + result);
- try {
- do_check_true(result.indexOf("test-phish-simple") == -1);
- } finally {
- checkDone();
- }
-}
-
-function malwareExists(result) {
- dumpn("malwareExists: " + result);
-
- try {
- do_check_true(result.indexOf("test-malware-simple") != -1);
- } finally {
- checkDone();
- }
-}
-
-function unwantedExists(result) {
- dumpn("unwantedExists: " + result);
-
- try {
- do_check_true(result.indexOf("test-unwanted-simple") != -1);
- } finally {
- checkDone();
- }
-}
-
-function blockedExists(result) {
- dumpn("blockedExists: " + result);
-
- try {
- do_check_true(result.indexOf("test-block-simple") != -1);
- } finally {
- checkDone();
- }
-}
-
-function checkState()
-{
- numExpecting = 0;
-
-
- for (var key in phishExpected) {
- var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key, null, null), {});
- dbservice.lookup(principal, allTables, phishExists, true);
- numExpecting++;
- }
-
- for (var key in phishUnexpected) {
- var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key, null, null), {});
- dbservice.lookup(principal, allTables, phishDoesntExist, true);
- numExpecting++;
- }
-
- for (var key in malwareExpected) {
- var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key, null, null), {});
- dbservice.lookup(principal, allTables, malwareExists, true);
- numExpecting++;
- }
-
- for (var key in unwantedExpected) {
- var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key, null, null), {});
- dbservice.lookup(principal, allTables, unwantedExists, true);
- numExpecting++;
- }
-
- for (var key in blockedExpected) {
- var principal = secMan.createCodebasePrincipal(iosvc.newURI("http://" + key, null, null), {});
- dbservice.lookup(principal, allTables, blockedExists, true);
- numExpecting++;
- }
-}
-
-function testSubSuccess(result)
-{
- do_check_eq(result, "1000");
- checkState();
-}
-
-function do_subs() {
- var data =
- "n:1000\n" +
- "i:test-phish-simple\n" +
- "s:3:32:" + chunk3Sub.length + "\n" +
- chunk3Sub + "\n" +
- "ad:1\n" +
- "ad:4-6\n";
-
- doSimpleUpdate(data, testSubSuccess, testFailure);
-}
-
-function testAddSuccess(arg) {
- do_check_eq(arg, "1000");
-
- do_subs();
-}
-
-function do_adds() {
- // This test relies on the fact that only -regexp tables are ungzipped,
- // and only -hash tables are assumed to be pre-md5'd. So we use
- // a 'simple' table type to get simple hostname-per-line semantics.
-
- var data =
- "n:1000\n" +
- "i:test-phish-simple\n" +
- "a:1:32:" + chunk1.length + "\n" +
- chunk1 + "\n" +
- "a:2:32:" + chunk2.length + "\n" +
- chunk2 + "\n" +
- "a:4:32:" + chunk4.length + "\n" +
- chunk4 + "\n" +
- "a:5:32:" + chunk5.length + "\n" +
- chunk5 + "\n" +
- "a:6:32:" + chunk6.length + "\n" +
- chunk6 + "\n" +
- "i:test-malware-simple\n" +
- "a:1:32:" + chunk2.length + "\n" +
- chunk2 + "\n" +
- "i:test-unwanted-simple\n" +
- "a:1:32:" + chunk3.length + "\n" +
- chunk3 + "\n" +
- "i:test-block-simple\n" +
- "a:1:32:" + chunk7.length + "\n" +
- chunk7 + "\n";
-
- doSimpleUpdate(data, testAddSuccess, testFailure);
-}
-
-function run_test() {
- do_adds();
- do_test_pending();
-}
diff --git a/toolkit/components/url-classifier/tests/unit/test_digest256.js b/toolkit/components/url-classifier/tests/unit/test_digest256.js
deleted file mode 100644
index 6ae652915..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_digest256.js
+++ /dev/null
@@ -1,147 +0,0 @@
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-// Global test server for serving safebrowsing updates.
-var gHttpServ = null;
-// Global nsIUrlClassifierDBService
-var gDbService = Cc["@mozilla.org/url-classifier/dbservice;1"]
- .getService(Ci.nsIUrlClassifierDBService);
-// Security manager for creating nsIPrincipals from URIs
-var gSecMan = Cc["@mozilla.org/scriptsecuritymanager;1"]
- .getService(Ci.nsIScriptSecurityManager);
-
-// A map of tables to arrays of update redirect urls.
-var gTables = {};
-
-// Construct an update from a file.
-function readFileToString(aFilename) {
- let f = do_get_file(aFilename);
- let stream = Cc["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Ci.nsIFileInputStream);
- stream.init(f, -1, 0, 0);
- let buf = NetUtil.readInputStreamToString(stream, stream.available());
- return buf;
-}
-
-// Registers a table for which to serve update chunks. Returns a promise that
-// resolves when that chunk has been downloaded.
-function registerTableUpdate(aTable, aFilename) {
- let deferred = Promise.defer();
- // If we haven't been given an update for this table yet, add it to the map
- if (!(aTable in gTables)) {
- gTables[aTable] = [];
- }
-
- // The number of chunks associated with this table.
- let numChunks = gTables[aTable].length + 1;
- let redirectPath = "/" + aTable + "-" + numChunks;
- let redirectUrl = "localhost:4444" + redirectPath;
-
- // Store redirect url for that table so we can return it later when we
- // process an update request.
- gTables[aTable].push(redirectUrl);
-
- gHttpServ.registerPathHandler(redirectPath, function(request, response) {
- do_print("Mock safebrowsing server handling request for " + redirectPath);
- let contents = readFileToString(aFilename);
- response.setHeader("Content-Type",
- "application/vnd.google.safebrowsing-update", false);
- response.setStatusLine(request.httpVersion, 200, "OK");
- response.bodyOutputStream.write(contents, contents.length);
- deferred.resolve(contents);
- });
- return deferred.promise;
-}
-
-// Construct a response with redirect urls.
-function processUpdateRequest() {
- let response = "n:1000\n";
- for (let table in gTables) {
- response += "i:" + table + "\n";
- for (let i = 0; i < gTables[table].length; ++i) {
- response += "u:" + gTables[table][i] + "\n";
- }
- }
- do_print("Returning update response: " + response);
- return response;
-}
-
-// Set up our test server to handle update requests.
-function run_test() {
- gHttpServ = new HttpServer();
- gHttpServ.registerDirectory("/", do_get_cwd());
-
- gHttpServ.registerPathHandler("/downloads", function(request, response) {
- let buf = NetUtil.readInputStreamToString(request.bodyInputStream,
- request.bodyInputStream.available());
- let blob = processUpdateRequest();
- response.setHeader("Content-Type",
- "application/vnd.google.safebrowsing-update", false);
- response.setStatusLine(request.httpVersion, 200, "OK");
- response.bodyOutputStream.write(blob, blob.length);
- });
-
- gHttpServ.start(4444);
- run_next_test();
-}
-
-function createURI(s) {
- let service = Cc["@mozilla.org/network/io-service;1"]
- .getService(Ci.nsIIOService);
- return service.newURI(s, null, null);
-}
-
-// Just throw if we ever get an update or download error.
-function handleError(aEvent) {
- do_throw("We didn't download or update correctly: " + aEvent);
-}
-
-add_test(function test_update() {
- let streamUpdater = Cc["@mozilla.org/url-classifier/streamupdater;1"]
- .getService(Ci.nsIUrlClassifierStreamUpdater);
-
- // Load up some update chunks for the safebrowsing server to serve.
- registerTableUpdate("goog-downloadwhite-digest256", "data/digest1.chunk");
- registerTableUpdate("goog-downloadwhite-digest256", "data/digest2.chunk");
-
- // Download some updates, and don't continue until the downloads are done.
- function updateSuccess(aEvent) {
- // Timeout of n:1000 is constructed in processUpdateRequest above and
- // passed back in the callback in nsIUrlClassifierStreamUpdater on success.
- do_check_eq("1000", aEvent);
- do_print("All data processed");
- run_next_test();
- }
- streamUpdater.downloadUpdates(
- "goog-downloadwhite-digest256",
- "goog-downloadwhite-digest256;\n",
- true,
- "http://localhost:4444/downloads",
- updateSuccess, handleError, handleError);
-});
-
-add_test(function test_url_not_whitelisted() {
- let uri = createURI("http://example.com");
- let principal = gSecMan.createCodebasePrincipal(uri, {});
- gDbService.lookup(principal, "goog-downloadwhite-digest256",
- function handleEvent(aEvent) {
- // This URI is not on any lists.
- do_check_eq("", aEvent);
- run_next_test();
- });
-});
-
-add_test(function test_url_whitelisted() {
- // Hash of "whitelisted.com/" (canonicalized URL) is:
- // 93CA5F48E15E9861CD37C2D95DB43D23CC6E6DE5C3F8FA6E8BE66F97CC518907
- let uri = createURI("http://whitelisted.com");
- let principal = gSecMan.createCodebasePrincipal(uri, {});
- gDbService.lookup(principal, "goog-downloadwhite-digest256",
- function handleEvent(aEvent) {
- do_check_eq("goog-downloadwhite-digest256", aEvent);
- run_next_test();
- });
-});
diff --git a/toolkit/components/url-classifier/tests/unit/test_hashcompleter.js b/toolkit/components/url-classifier/tests/unit/test_hashcompleter.js
deleted file mode 100644
index 40fafd923..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_hashcompleter.js
+++ /dev/null
@@ -1,403 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// This test ensures that the nsIUrlClassifierHashCompleter works as expected
-// and simulates an HTTP server to provide completions.
-//
-// In order to test completions, each group of completions sent as one request
-// to the HTTP server is called a completion set. There is currently not
-// support for multiple requests being sent to the server at once, in this test.
-// This tests makes a request for each element of |completionSets|, waits for
-// a response and then moves to the next element.
-// Each element of |completionSets| is an array of completions, and each
-// completion is an object with the properties:
-// hash: complete hash for the completion. Automatically right-padded
-// to be COMPLETE_LENGTH.
-// expectCompletion: boolean indicating whether the server should respond
-// with a full hash.
-// forceServerError: boolean indicating whether the server should respond
-// with a 503.
-// table: name of the table that the hash corresponds to. Only needs to be set
-// if a completion is expected.
-// chunkId: positive integer corresponding to the chunk that the hash belongs
-// to. Only needs to be set if a completion is expected.
-// multipleCompletions: boolean indicating whether the server should respond
-// with more than one full hash. If this is set to true
-// then |expectCompletion| must also be set to true and
-// |hash| must have the same prefix as all |completions|.
-// completions: an array of completions (objects with a hash, table and
-// chunkId property as described above). This property is only
-// used when |multipleCompletions| is set to true.
-
-// Basic prefixes with 2/3 completions.
-var basicCompletionSet = [
- {
- hash: "abcdefgh",
- expectCompletion: true,
- table: "test",
- chunkId: 1234,
- },
- {
- hash: "1234",
- expectCompletion: false,
- },
- {
- hash: "\u0000\u0000\u000012312",
- expectCompletion: true,
- table: "test",
- chunkId: 1234,
- }
-];
-
-// 3 prefixes with 0 completions to test HashCompleter handling a 204 status.
-var falseCompletionSet = [
- {
- hash: "1234",
- expectCompletion: false,
- },
- {
- hash: "",
- expectCompletion: false,
- },
- {
- hash: "abc",
- expectCompletion: false,
- }
-];
-
-// The current implementation (as of Mar 2011) sometimes sends duplicate
-// entries to HashCompleter and even expects responses for duplicated entries.
-var dupedCompletionSet = [
- {
- hash: "1234",
- expectCompletion: true,
- table: "test",
- chunkId: 1,
- },
- {
- hash: "5678",
- expectCompletion: false,
- table: "test2",
- chunkId: 2,
- },
- {
- hash: "1234",
- expectCompletion: true,
- table: "test",
- chunkId: 1,
- },
- {
- hash: "5678",
- expectCompletion: false,
- table: "test2",
- chunkId: 2
- }
-];
-
-// It is possible for a hash completion request to return with multiple
-// completions, the HashCompleter should return all of these.
-var multipleResponsesCompletionSet = [
- {
- hash: "1234",
- expectCompletion: true,
- multipleCompletions: true,
- completions: [
- {
- hash: "123456",
- table: "test1",
- chunkId: 3,
- },
- {
- hash: "123478",
- table: "test2",
- chunkId: 4,
- }
- ],
- }
-];
-
-function buildCompletionRequest(aCompletionSet) {
- let prefixes = [];
- let prefixSet = new Set();
- aCompletionSet.forEach(s => {
- let prefix = s.hash.substring(0, 4);
- if (prefixSet.has(prefix)) {
- return;
- }
- prefixSet.add(prefix);
- prefixes.push(prefix);
- });
- return 4 + ":" + (4 * prefixes.length) + "\n" + prefixes.join("");
-}
-
-function parseCompletionRequest(aRequest) {
- // Format: [partial_length]:[num_of_prefix * partial_length]\n[prefixes_data]
-
- let tokens = /(\d):(\d+)/.exec(aRequest);
- if (tokens.length < 3) {
- dump("Request format error.");
- return null;
- }
-
- let partialLength = parseInt(tokens[1]);
- let payloadLength = parseInt(tokens[2]);
-
- let payloadStart = tokens[1].length + // partial length
- 1 + // ':'
- tokens[2].length + // payload length
- 1; // '\n'
-
- let prefixSet = [];
- for (let i = payloadStart; i < aRequest.length; i += partialLength) {
- let prefix = aRequest.substr(i, partialLength);
- if (prefix.length !== partialLength) {
- dump("Header info not correct: " + aRequest.substr(0, payloadStart));
- return null;
- }
- prefixSet.push(prefix);
- }
- prefixSet.sort();
-
- return prefixSet;
-}
-
-// Compare the requests in string format.
-function compareCompletionRequest(aRequest1, aRequest2) {
- let prefixSet1 = parseCompletionRequest(aRequest1);
- let prefixSet2 = parseCompletionRequest(aRequest2);
-
- return equal(JSON.stringify(prefixSet1), JSON.stringify(prefixSet2));
-}
-
-// The fifth completion set is added at runtime by getRandomCompletionSet.
-// Each completion in the set only has one response and its purpose is to
-// provide an easy way to test the HashCompleter handling an arbitrarily large
-// completion set (determined by SIZE_OF_RANDOM_SET).
-const SIZE_OF_RANDOM_SET = 16;
-function getRandomCompletionSet(forceServerError) {
- let completionSet = [];
- let hashPrefixes = [];
-
- let seed = Math.floor(Math.random() * Math.pow(2, 32));
- dump("Using seed of " + seed + " for random completion set.\n");
- let rand = new LFSRgenerator(seed);
-
- for (let i = 0; i < SIZE_OF_RANDOM_SET; i++) {
- let completion = { expectCompletion: false, forceServerError: false, _finished: false };
-
- // Generate a random 256 bit hash. First we get a random number and then
- // convert it to a string.
- let hash;
- let prefix;
- do {
- hash = "";
- let length = 1 + rand.nextNum(5);
- for (let i = 0; i < length; i++)
- hash += String.fromCharCode(rand.nextNum(8));
- prefix = hash.substring(0,4);
- } while (hashPrefixes.indexOf(prefix) != -1);
-
- hashPrefixes.push(prefix);
- completion.hash = hash;
-
- if (!forceServerError) {
- completion.expectCompletion = rand.nextNum(1) == 1;
- } else {
- completion.forceServerError = true;
- }
- if (completion.expectCompletion) {
- // Generate a random alpha-numeric string of length at most 6 for the
- // table name.
- completion.table = (rand.nextNum(31)).toString(36);
-
- completion.chunkId = rand.nextNum(16);
- }
- completionSet.push(completion);
- }
-
- return completionSet;
-}
-
-var completionSets = [basicCompletionSet, falseCompletionSet,
- dupedCompletionSet, multipleResponsesCompletionSet];
-var currentCompletionSet = -1;
-var finishedCompletions = 0;
-
-const SERVER_PORT = 8080;
-const SERVER_PATH = "/hash-completer";
-var server;
-
-// Completion hashes are automatically right-padded with null chars to have a
-// length of COMPLETE_LENGTH.
-// Taken from nsUrlClassifierDBService.h
-const COMPLETE_LENGTH = 32;
-
-var completer = Cc["@mozilla.org/url-classifier/hashcompleter;1"].
- getService(Ci.nsIUrlClassifierHashCompleter);
-
-var gethashUrl;
-
-// Expected highest completion set for which the server sends a response.
-var expectedMaxServerCompletionSet = 0;
-var maxServerCompletionSet = 0;
-
-function run_test() {
- // Generate a random completion set that return successful responses.
- completionSets.push(getRandomCompletionSet(false));
- // We backoff after receiving an error, so requests shouldn't reach the
- // server after that.
- expectedMaxServerCompletionSet = completionSets.length;
- // Generate some completion sets that return 503s.
- for (let j = 0; j < 10; ++j) {
- completionSets.push(getRandomCompletionSet(true));
- }
-
- // Fix up the completions before running the test.
- for (let completionSet of completionSets) {
- for (let completion of completionSet) {
- // Pad the right of each |hash| so that the length is COMPLETE_LENGTH.
- if (completion.multipleCompletions) {
- for (let responseCompletion of completion.completions) {
- let numChars = COMPLETE_LENGTH - responseCompletion.hash.length;
- responseCompletion.hash += (new Array(numChars + 1)).join("\u0000");
- }
- }
- else {
- let numChars = COMPLETE_LENGTH - completion.hash.length;
- completion.hash += (new Array(numChars + 1)).join("\u0000");
- }
- }
- }
- do_test_pending();
-
- server = new HttpServer();
- server.registerPathHandler(SERVER_PATH, hashCompleterServer);
-
- server.start(-1);
- const SERVER_PORT = server.identity.primaryPort;
-
- gethashUrl = "http://localhost:" + SERVER_PORT + SERVER_PATH;
-
- runNextCompletion();
-}
-
-function runNextCompletion() {
- // The server relies on currentCompletionSet to send the correct response, so
- // don't increment it until we start the new set of callbacks.
- currentCompletionSet++;
- if (currentCompletionSet >= completionSets.length) {
- finish();
- return;
- }
-
- dump("Now on completion set index " + currentCompletionSet + ", length " +
- completionSets[currentCompletionSet].length + "\n");
- // Number of finished completions for this set.
- finishedCompletions = 0;
- for (let completion of completionSets[currentCompletionSet]) {
- completer.complete(completion.hash.substring(0,4), gethashUrl,
- (new callback(completion)));
- }
-}
-
-function hashCompleterServer(aRequest, aResponse) {
- let stream = aRequest.bodyInputStream;
- let wrapperStream = Cc["@mozilla.org/binaryinputstream;1"].
- createInstance(Ci.nsIBinaryInputStream);
- wrapperStream.setInputStream(stream);
-
- let len = stream.available();
- let data = wrapperStream.readBytes(len);
-
- // Check if we got the expected completion request.
- let expectedRequest = buildCompletionRequest(completionSets[currentCompletionSet]);
- compareCompletionRequest(data, expectedRequest);
-
- // To avoid a response with duplicate hash completions, we keep track of all
- // completed hash prefixes so far.
- let completedHashes = [];
- let responseText = "";
-
- function responseForCompletion(x) {
- return x.table + ":" + x.chunkId + ":" + x.hash.length + "\n" + x.hash;
- }
- // As per the spec, a server should response with a 204 if there are no
- // full-length hashes that match the prefixes.
- let httpStatus = 204;
- for (let completion of completionSets[currentCompletionSet]) {
- if (completion.expectCompletion &&
- (completedHashes.indexOf(completion.hash) == -1)) {
- completedHashes.push(completion.hash);
-
- if (completion.multipleCompletions)
- responseText += completion.completions.map(responseForCompletion).join("");
- else
- responseText += responseForCompletion(completion);
- }
- if (completion.forceServerError) {
- httpStatus = 503;
- }
- }
-
- dump("Server sending response for " + currentCompletionSet + "\n");
- maxServerCompletionSet = currentCompletionSet;
- if (responseText && httpStatus != 503) {
- aResponse.write(responseText);
- } else {
- aResponse.setStatusLine(null, httpStatus, null);
- }
-}
-
-
-function callback(completion) {
- this._completion = completion;
-}
-
-callback.prototype = {
- completion: function completion(hash, table, chunkId, trusted) {
- do_check_true(this._completion.expectCompletion);
- if (this._completion.multipleCompletions) {
- for (let completion of this._completion.completions) {
- if (completion.hash == hash) {
- do_check_eq(JSON.stringify(hash), JSON.stringify(completion.hash));
- do_check_eq(table, completion.table);
- do_check_eq(chunkId, completion.chunkId);
-
- completion._completed = true;
-
- if (this._completion.completions.every(x => x._completed))
- this._completed = true;
-
- break;
- }
- }
- }
- else {
- // Hashes are not actually strings and can contain arbitrary data.
- do_check_eq(JSON.stringify(hash), JSON.stringify(this._completion.hash));
- do_check_eq(table, this._completion.table);
- do_check_eq(chunkId, this._completion.chunkId);
-
- this._completed = true;
- }
- },
-
- completionFinished: function completionFinished(status) {
- finishedCompletions++;
- do_check_eq(!!this._completion.expectCompletion, !!this._completed);
- this._completion._finished = true;
-
- // currentCompletionSet can mutate before all of the callbacks are complete.
- if (currentCompletionSet < completionSets.length &&
- finishedCompletions == completionSets[currentCompletionSet].length) {
- runNextCompletion();
- }
- },
-};
-
-function finish() {
- do_check_eq(expectedMaxServerCompletionSet, maxServerCompletionSet);
- server.stop(function() {
- do_test_finished();
- });
-}
diff --git a/toolkit/components/url-classifier/tests/unit/test_listmanager.js b/toolkit/components/url-classifier/tests/unit/test_listmanager.js
deleted file mode 100644
index ba11d930e..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_listmanager.js
+++ /dev/null
@@ -1,376 +0,0 @@
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
- "resource://gre/modules/NetUtil.jsm");
-
-// These tables share the same updateURL.
-const TEST_TABLE_DATA_LIST = [
- // 0:
- {
- tableName: "test-listmanager0-digest256",
- providerName: "google",
- updateUrl: "http://localhost:4444/safebrowsing/update",
- gethashUrl: "http://localhost:4444/safebrowsing/gethash0",
- },
-
- // 1:
- {
- tableName: "test-listmanager1-digest256",
- providerName: "google",
- updateUrl: "http://localhost:4444/safebrowsing/update",
- gethashUrl: "http://localhost:4444/safebrowsing/gethash1",
- },
-
- // 2.
- {
- tableName: "test-listmanager2-digest256",
- providerName: "google",
- updateUrl: "http://localhost:4444/safebrowsing/update",
- gethashUrl: "http://localhost:4444/safebrowsing/gethash2",
- }
-];
-
-// These tables have a different update URL (for v4).
-const TEST_TABLE_DATA_V4 = {
- tableName: "test-phish-proto",
- providerName: "google4",
- updateUrl: "http://localhost:5555/safebrowsing/update?",
- gethashUrl: "http://localhost:5555/safebrowsing/gethash-v4",
-};
-const TEST_TABLE_DATA_V4_DISABLED = {
- tableName: "test-unwanted-proto",
- providerName: "google4",
- updateUrl: "http://localhost:5555/safebrowsing/update?",
- gethashUrl: "http://localhost:5555/safebrowsing/gethash-v4",
-};
-
-const PREF_NEXTUPDATETIME = "browser.safebrowsing.provider.google.nextupdatetime";
-const PREF_NEXTUPDATETIME_V4 = "browser.safebrowsing.provider.google4.nextupdatetime";
-
-let gListManager = Cc["@mozilla.org/url-classifier/listmanager;1"]
- .getService(Ci.nsIUrlListManager);
-
-let gUrlUtils = Cc["@mozilla.org/url-classifier/utils;1"]
- .getService(Ci.nsIUrlClassifierUtils);
-
-// Global test server for serving safebrowsing updates.
-let gHttpServ = null;
-let gUpdateResponse = "";
-let gExpectedUpdateRequest = "";
-let gExpectedQueryV4 = "";
-
-// Handles request for TEST_TABLE_DATA_V4.
-let gHttpServV4 = null;
-
-// These two variables are used to synchronize the last two racing updates
-// (in terms of "update URL") in test_update_all_tables().
-let gUpdatedCntForTableData = 0; // For TEST_TABLE_DATA_LIST.
-let gIsV4Updated = false; // For TEST_TABLE_DATA_V4.
-
-const NEW_CLIENT_STATE = 'sta\0te';
-const CHECKSUM = '\x30\x67\xc7\x2c\x5e\x50\x1c\x31\xe3\xfe\xca\x73\xf0\x47\xdc\x34\x1a\x95\x63\x99\xec\x70\x5e\x0a\xee\x9e\xfb\x17\xa1\x55\x35\x78';
-
-prefBranch.setBoolPref("browser.safebrowsing.debug", true);
-
-// The "\xFF\xFF" is to generate a base64 string with "/".
-prefBranch.setCharPref("browser.safebrowsing.id", "Firefox\xFF\xFF");
-
-// Register tables.
-TEST_TABLE_DATA_LIST.forEach(function(t) {
- gListManager.registerTable(t.tableName,
- t.providerName,
- t.updateUrl,
- t.gethashUrl);
-});
-
-gListManager.registerTable(TEST_TABLE_DATA_V4.tableName,
- TEST_TABLE_DATA_V4.providerName,
- TEST_TABLE_DATA_V4.updateUrl,
- TEST_TABLE_DATA_V4.gethashUrl);
-
-// To test Bug 1302044.
-gListManager.registerTable(TEST_TABLE_DATA_V4_DISABLED.tableName,
- TEST_TABLE_DATA_V4_DISABLED.providerName,
- TEST_TABLE_DATA_V4_DISABLED.updateUrl,
- TEST_TABLE_DATA_V4_DISABLED.gethashUrl);
-
-const SERVER_INVOLVED_TEST_CASE_LIST = [
- // - Do table0 update.
- // - Server would respond "a:5:32:32\n[DATA]".
- function test_update_table0() {
- disableAllUpdates();
-
- gListManager.enableUpdate(TEST_TABLE_DATA_LIST[0].tableName);
- gExpectedUpdateRequest = TEST_TABLE_DATA_LIST[0].tableName + ";\n";
-
- gUpdateResponse = "n:1000\ni:" + TEST_TABLE_DATA_LIST[0].tableName + "\n";
- gUpdateResponse += readFileToString("data/digest2.chunk");
-
- forceTableUpdate();
- },
-
- // - Do table0 update again. Since chunk 5 was added to table0 in the last
- // update, the expected request contains "a:5".
- // - Server would respond "s;2-12\n[DATA]".
- function test_update_table0_with_existing_chunks() {
- disableAllUpdates();
-
- gListManager.enableUpdate(TEST_TABLE_DATA_LIST[0].tableName);
- gExpectedUpdateRequest = TEST_TABLE_DATA_LIST[0].tableName + ";a:5\n";
-
- gUpdateResponse = "n:1000\ni:" + TEST_TABLE_DATA_LIST[0].tableName + "\n";
- gUpdateResponse += readFileToString("data/digest1.chunk");
-
- forceTableUpdate();
- },
-
- // - Do all-table update.
- // - Server would respond no chunk control.
- //
- // Note that this test MUST be the last one in the array since we rely on
- // the number of sever-involved test case to synchronize the racing last
- // two udpates for different URL.
- function test_update_all_tables() {
- disableAllUpdates();
-
- // Enable all tables including TEST_TABLE_DATA_V4!
- TEST_TABLE_DATA_LIST.forEach(function(t) {
- gListManager.enableUpdate(t.tableName);
- });
-
- // We register two v4 tables but only enable one of them
- // to verify that the disabled tables are not updated.
- // See Bug 1302044.
- gListManager.enableUpdate(TEST_TABLE_DATA_V4.tableName);
- gListManager.disableUpdate(TEST_TABLE_DATA_V4_DISABLED.tableName);
-
- // Expected results for v2.
- gExpectedUpdateRequest = TEST_TABLE_DATA_LIST[0].tableName + ";a:5:s:2-12\n" +
- TEST_TABLE_DATA_LIST[1].tableName + ";\n" +
- TEST_TABLE_DATA_LIST[2].tableName + ";\n";
- gUpdateResponse = "n:1000\n";
-
- // We test the request against the query string since v4 request
- // would be appened to the query string. The request is generated
- // by protobuf API (binary) then encoded to base64 format.
- let requestV4 = gUrlUtils.makeUpdateRequestV4([TEST_TABLE_DATA_V4.tableName],
- [""],
- 1);
- gExpectedQueryV4 = "&$req=" + requestV4;
-
- forceTableUpdate();
- },
-
-];
-
-SERVER_INVOLVED_TEST_CASE_LIST.forEach(t => add_test(t));
-
-add_test(function test_partialUpdateV4() {
- disableAllUpdates();
-
- gListManager.enableUpdate(TEST_TABLE_DATA_V4.tableName);
-
- // Since the new client state has been responded and saved in
- // test_update_all_tables, this update request should send
- // a partial update to the server.
- let requestV4 = gUrlUtils.makeUpdateRequestV4([TEST_TABLE_DATA_V4.tableName],
- [btoa(NEW_CLIENT_STATE)],
- 1);
- gExpectedQueryV4 = "&$req=" + requestV4;
-
- forceTableUpdate();
-});
-
-// Tests nsIUrlListManager.getGethashUrl.
-add_test(function test_getGethashUrl() {
- TEST_TABLE_DATA_LIST.forEach(function (t) {
- equal(gListManager.getGethashUrl(t.tableName), t.gethashUrl);
- });
- equal(gListManager.getGethashUrl(TEST_TABLE_DATA_V4.tableName),
- TEST_TABLE_DATA_V4.gethashUrl);
- run_next_test();
-});
-
-function run_test() {
- // Setup primary testing server.
- gHttpServ = new HttpServer();
- gHttpServ.registerDirectory("/", do_get_cwd());
-
- gHttpServ.registerPathHandler("/safebrowsing/update", function(request, response) {
- let body = NetUtil.readInputStreamToString(request.bodyInputStream,
- request.bodyInputStream.available());
-
- // Verify if the request is as expected.
- equal(body, gExpectedUpdateRequest);
-
- // Respond the update which is controlled by the test case.
- response.setHeader("Content-Type",
- "application/vnd.google.safebrowsing-update", false);
- response.setStatusLine(request.httpVersion, 200, "OK");
- response.bodyOutputStream.write(gUpdateResponse, gUpdateResponse.length);
-
- gUpdatedCntForTableData++;
-
- if (gUpdatedCntForTableData !== SERVER_INVOLVED_TEST_CASE_LIST.length) {
- // This is not the last test case so run the next once upon the
- // the update success.
- waitForUpdateSuccess(run_next_test);
- return;
- }
-
- if (gIsV4Updated) {
- run_next_test(); // All tests are done. Just finish.
- return;
- }
-
- do_print("Waiting for TEST_TABLE_DATA_V4 to be tested ...");
- });
-
- gHttpServ.start(4444);
-
- // Setup v4 testing server for the different update URL.
- gHttpServV4 = new HttpServer();
- gHttpServV4.registerDirectory("/", do_get_cwd());
-
- gHttpServV4.registerPathHandler("/safebrowsing/update", function(request, response) {
- // V4 update request body should be empty.
- equal(request.bodyInputStream.available(), 0);
-
- // Not on the spec. Found in Chromium source code...
- equal(request.getHeader("X-HTTP-Method-Override"), "POST");
-
- // V4 update request uses GET.
- equal(request.method, "GET");
-
- // V4 append the base64 encoded request to the query string.
- equal(request.queryString, gExpectedQueryV4);
- equal(request.queryString.indexOf('+'), -1);
- equal(request.queryString.indexOf('/'), -1);
-
- // Respond a V2 compatible content for now. In the future we can
- // send a meaningful response to test Bug 1284178 to see if the
- // update is successfully stored to database.
- response.setHeader("Content-Type",
- "application/vnd.google.safebrowsing-update", false);
- response.setStatusLine(request.httpVersion, 200, "OK");
-
- // The protobuf binary represention of response:
- //
- // [
- // {
- // 'threat_type': 2, // SOCIAL_ENGINEERING_PUBLIC
- // 'response_type': 2, // FULL_UPDATE
- // 'new_client_state': 'sta\x00te', // NEW_CLIENT_STATE
- // 'checksum': { "sha256": CHECKSUM }, // CHECKSUM
- // 'additions': { 'compression_type': RAW,
- // 'prefix_size': 4,
- // 'raw_hashes': "00000001000000020000000300000004"}
- // }
- // ]
- //
- let content = "\x0A\x4A\x08\x02\x20\x02\x2A\x18\x08\x01\x12\x14\x08\x04\x12\x10\x00\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x02\x00\x00\x00\x03\x3A\x06\x73\x74\x61\x00\x74\x65\x42\x22\x0A\x20\x30\x67\xC7\x2C\x5E\x50\x1C\x31\xE3\xFE\xCA\x73\xF0\x47\xDC\x34\x1A\x95\x63\x99\xEC\x70\x5E\x0A\xEE\x9E\xFB\x17\xA1\x55\x35\x78\x12\x08\x08\x08\x10\x80\x94\xEB\xDC\x03";
-
- response.bodyOutputStream.write(content, content.length);
-
- if (gIsV4Updated) {
- // This falls to the case where test_partialUpdateV4 is running.
- // We are supposed to have verified the update request contains
- // the state we set in the previous request.
- run_next_test();
- return;
- }
-
- waitUntilMetaDataSaved(NEW_CLIENT_STATE, CHECKSUM, () => {
- gIsV4Updated = true;
-
- if (gUpdatedCntForTableData === SERVER_INVOLVED_TEST_CASE_LIST.length) {
- // All tests are done!
- run_next_test();
- return;
- }
-
- do_print("Wait for all sever-involved tests to be done ...");
- });
-
- });
-
- gHttpServV4.start(5555);
-
- run_next_test();
-}
-
-// A trick to force updating tables. However, before calling this, we have to
-// call disableAllUpdates() first to clean up the updateCheckers in listmanager.
-function forceTableUpdate() {
- prefBranch.setCharPref(PREF_NEXTUPDATETIME, "1");
- prefBranch.setCharPref(PREF_NEXTUPDATETIME_V4, "1");
- gListManager.maybeToggleUpdateChecking();
-}
-
-function disableAllUpdates() {
- TEST_TABLE_DATA_LIST.forEach(t => gListManager.disableUpdate(t.tableName));
- gListManager.disableUpdate(TEST_TABLE_DATA_V4.tableName);
-}
-
-// Since there's no public interface on listmanager to know the update success,
-// we could only rely on the refresh of "nextupdatetime".
-function waitForUpdateSuccess(callback) {
- let nextupdatetime = parseInt(prefBranch.getCharPref(PREF_NEXTUPDATETIME));
- do_print("nextupdatetime: " + nextupdatetime);
- if (nextupdatetime !== 1) {
- callback();
- return;
- }
- do_timeout(1000, waitForUpdateSuccess.bind(null, callback));
-}
-
-// Construct an update from a file.
-function readFileToString(aFilename) {
- let f = do_get_file(aFilename);
- let stream = Cc["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Ci.nsIFileInputStream);
- stream.init(f, -1, 0, 0);
- let buf = NetUtil.readInputStreamToString(stream, stream.available());
- return buf;
-}
-
-function waitUntilMetaDataSaved(expectedState, expectedChecksum, callback) {
- let dbService = Cc["@mozilla.org/url-classifier/dbservice;1"]
- .getService(Ci.nsIUrlClassifierDBService);
-
- dbService.getTables(metaData => {
- do_print("metadata: " + metaData);
- let didCallback = false;
- metaData.split("\n").some(line => {
- // Parse [tableName];[stateBase64]
- let p = line.indexOf(";");
- if (-1 === p) {
- return false; // continue.
- }
- let tableName = line.substring(0, p);
- let metadata = line.substring(p + 1).split(":");
- let stateBase64 = metadata[0];
- let checksumBase64 = metadata[1];
-
- if (tableName !== 'test-phish-proto') {
- return false; // continue.
- }
-
- if (stateBase64 === btoa(expectedState) &&
- checksumBase64 === btoa(expectedChecksum)) {
- do_print('State has been saved to disk!');
- callback();
- didCallback = true;
- }
-
- return true; // break no matter whether the state is matching.
- });
-
- if (!didCallback) {
- do_timeout(1000, waitUntilMetaDataSaved.bind(null, expectedState,
- expectedChecksum,
- callback));
- }
- });
-}
diff --git a/toolkit/components/url-classifier/tests/unit/test_partial.js b/toolkit/components/url-classifier/tests/unit/test_partial.js
deleted file mode 100644
index 83243fb4e..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_partial.js
+++ /dev/null
@@ -1,825 +0,0 @@
-
-/**
- * DummyCompleter() lets tests easily specify the results of a partial
- * hash completion request.
- */
-function DummyCompleter() {
- this.fragments = {};
- this.queries = [];
- this.tableName = "test-phish-simple";
-}
-
-DummyCompleter.prototype =
-{
-QueryInterface: function(iid)
-{
- if (!iid.equals(Ci.nsISupports) &&
- !iid.equals(Ci.nsIUrlClassifierHashCompleter)) {
- throw Cr.NS_ERROR_NO_INTERFACE;
- }
- return this;
-},
-
-complete: function(partialHash, gethashUrl, cb)
-{
- this.queries.push(partialHash);
- var fragments = this.fragments;
- var self = this;
- var doCallback = function() {
- if (self.alwaysFail) {
- cb.completionFinished(1);
- return;
- }
- var results;
- if (fragments[partialHash]) {
- for (var i = 0; i < fragments[partialHash].length; i++) {
- var chunkId = fragments[partialHash][i][0];
- var hash = fragments[partialHash][i][1];
- cb.completion(hash, self.tableName, chunkId);
- }
- }
- cb.completionFinished(0);
- }
- var timer = new Timer(0, doCallback);
-},
-
-getHash: function(fragment)
-{
- var converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
- createInstance(Ci.nsIScriptableUnicodeConverter);
- converter.charset = "UTF-8";
- var data = converter.convertToByteArray(fragment);
- var ch = Cc["@mozilla.org/security/hash;1"].createInstance(Ci.nsICryptoHash);
- ch.init(ch.SHA256);
- ch.update(data, data.length);
- var hash = ch.finish(false);
- return hash.slice(0, 32);
-},
-
-addFragment: function(chunkId, fragment)
-{
- this.addHash(chunkId, this.getHash(fragment));
-},
-
-// This method allows the caller to generate complete hashes that match the
-// prefix of a real fragment, but have different complete hashes.
-addConflict: function(chunkId, fragment)
-{
- var realHash = this.getHash(fragment);
- var invalidHash = this.getHash("blah blah blah blah blah");
- this.addHash(chunkId, realHash.slice(0, 4) + invalidHash.slice(4, 32));
-},
-
-addHash: function(chunkId, hash)
-{
- var partial = hash.slice(0, 4);
- if (this.fragments[partial]) {
- this.fragments[partial].push([chunkId, hash]);
- } else {
- this.fragments[partial] = [[chunkId, hash]];
- }
-},
-
-compareQueries: function(fragments)
-{
- var expectedQueries = [];
- for (var i = 0; i < fragments.length; i++) {
- expectedQueries.push(this.getHash(fragments[i]).slice(0, 4));
- }
- do_check_eq(this.queries.length, expectedQueries.length);
- expectedQueries.sort();
- this.queries.sort();
- for (var i = 0; i < this.queries.length; i++) {
- do_check_eq(this.queries[i], expectedQueries[i]);
- }
-}
-};
-
-function setupCompleter(table, hits, conflicts)
-{
- var completer = new DummyCompleter();
- completer.tableName = table;
- for (var i = 0; i < hits.length; i++) {
- var chunkId = hits[i][0];
- var fragments = hits[i][1];
- for (var j = 0; j < fragments.length; j++) {
- completer.addFragment(chunkId, fragments[j]);
- }
- }
- for (var i = 0; i < conflicts.length; i++) {
- var chunkId = conflicts[i][0];
- var fragments = conflicts[i][1];
- for (var j = 0; j < fragments.length; j++) {
- completer.addConflict(chunkId, fragments[j]);
- }
- }
-
- dbservice.setHashCompleter(table, completer);
-
- return completer;
-}
-
-function installCompleter(table, fragments, conflictFragments)
-{
- return setupCompleter(table, fragments, conflictFragments);
-}
-
-function installFailingCompleter(table) {
- var completer = setupCompleter(table, [], []);
- completer.alwaysFail = true;
- return completer;
-}
-
-// Helper assertion for checking dummy completer queries
-gAssertions.completerQueried = function(data, cb)
-{
- var completer = data[0];
- completer.compareQueries(data[1]);
- cb();
-}
-
-function doTest(updates, assertions)
-{
- doUpdateTest(updates, assertions, runNextTest, updateError);
-}
-
-// Test an add of two partial urls to a fresh database
-function testPartialAdds() {
- var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 4);
-
-
- var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsExist" : addUrls,
- "completerQueried" : [completer, addUrls]
- };
-
-
- doTest([update], assertions);
-}
-
-function testPartialAddsWithConflicts() {
- var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 4);
-
- // Each result will have both a real match and a conflict
- var completer = installCompleter('test-phish-simple',
- [[1, addUrls]],
- [[1, addUrls]]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsExist" : addUrls,
- "completerQueried" : [completer, addUrls]
- };
-
- doTest([update], assertions);
-}
-
-// Test whether the fragmenting code does not cause duplicated completions
-function testFragments() {
- var addUrls = [ "foo.com/a/b/c", "foo.net/", "foo.com/c/" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 4);
-
-
- var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsExist" : addUrls,
- "completerQueried" : [completer, addUrls]
- };
-
-
- doTest([update], assertions);
-}
-
-// Test http://code.google.com/p/google-safe-browsing/wiki/Protocolv2Spec
-// section 6.2 example 1
-function testSpecFragments() {
- var probeUrls = [ "a.b.c/1/2.html?param=1" ];
-
- var addUrls = [ "a.b.c/1/2.html",
- "a.b.c/",
- "a.b.c/1/",
- "b.c/1/2.html?param=1",
- "b.c/1/2.html",
- "b.c/",
- "b.c/1/",
- "a.b.c/1/2.html?param=1" ];
-
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 4);
-
-
- var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsExist" : probeUrls,
- "completerQueried" : [completer, addUrls]
- };
-
- doTest([update], assertions);
-
-}
-
-// Test http://code.google.com/p/google-safe-browsing/wiki/Protocolv2Spec
-// section 6.2 example 2
-function testMoreSpecFragments() {
- var probeUrls = [ "a.b.c.d.e.f.g/1.html" ];
-
- var addUrls = [ "a.b.c.d.e.f.g/1.html",
- "a.b.c.d.e.f.g/",
- "c.d.e.f.g/1.html",
- "c.d.e.f.g/",
- "d.e.f.g/1.html",
- "d.e.f.g/",
- "e.f.g/1.html",
- "e.f.g/",
- "f.g/1.html",
- "f.g/" ];
-
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 4);
-
- var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsExist" : probeUrls,
- "completerQueried" : [completer, addUrls]
- };
-
- doTest([update], assertions);
-
-}
-
-function testFalsePositives() {
- var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 4);
-
- // Each result will have no matching complete hashes and a non-matching
- // conflict
- var completer = installCompleter('test-phish-simple', [], [[1, addUrls]]);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsDontExist" : addUrls,
- "completerQueried" : [completer, addUrls]
- };
-
- doTest([update], assertions);
-}
-
-function testEmptyCompleter() {
- var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 4);
-
- // Completer will never return full hashes
- var completer = installCompleter('test-phish-simple', [], []);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsDontExist" : addUrls,
- "completerQueried" : [completer, addUrls]
- };
-
- doTest([update], assertions);
-}
-
-function testCompleterFailure() {
- var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 4);
-
- // Completer will never return full hashes
- var completer = installFailingCompleter('test-phish-simple');
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsDontExist" : addUrls,
- "completerQueried" : [completer, addUrls]
- };
-
- doTest([update], assertions);
-}
-
-function testMixedSizesSameDomain() {
- var add1Urls = [ "foo.com/a" ];
- var add2Urls = [ "foo.com/b" ];
-
- var update1 = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : add1Urls }],
- 4);
- var update2 = buildPhishingUpdate(
- [
- { "chunkNum" : 2,
- "urls" : add2Urls }],
- 32);
-
- // We should only need to complete the partial hashes
- var completer = installCompleter('test-phish-simple', [[1, add1Urls]], []);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1-2",
- // both urls should match...
- "urlsExist" : add1Urls.concat(add2Urls),
- // ... but the completer should only be queried for the partial entry
- "completerQueried" : [completer, add1Urls]
- };
-
- doTest([update1, update2], assertions);
-}
-
-function testMixedSizesDifferentDomains() {
- var add1Urls = [ "foo.com/a" ];
- var add2Urls = [ "bar.com/b" ];
-
- var update1 = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : add1Urls }],
- 4);
- var update2 = buildPhishingUpdate(
- [
- { "chunkNum" : 2,
- "urls" : add2Urls }],
- 32);
-
- // We should only need to complete the partial hashes
- var completer = installCompleter('test-phish-simple', [[1, add1Urls]], []);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1-2",
- // both urls should match...
- "urlsExist" : add1Urls.concat(add2Urls),
- // ... but the completer should only be queried for the partial entry
- "completerQueried" : [completer, add1Urls]
- };
-
- doTest([update1, update2], assertions);
-}
-
-function testInvalidHashSize()
-{
- var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 12); // only 4 and 32 are legal hash sizes
-
- var addUrls2 = [ "zaz.com/a", "xyz.com/b" ];
- var update2 = buildPhishingUpdate(
- [
- { "chunkNum" : 2,
- "urls" : addUrls2
- }],
- 4);
-
- var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:2",
- "urlsDontExist" : addUrls
- };
-
- // A successful update will trigger an error
- doUpdateTest([update2, update], assertions, updateError, runNextTest);
-}
-
-function testWrongTable()
-{
- var addUrls = [ "foo.com/a" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 4);
- var completer = installCompleter('test-malware-simple', // wrong table
- [[1, addUrls]], []);
-
- // The above installCompleter installs the completer for test-malware-simple,
- // we want it to be used for test-phish-simple too.
- dbservice.setHashCompleter("test-phish-simple", completer);
-
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- // The urls were added as phishing urls, but the completer is claiming
- // that they are malware urls, and we trust the completer in this case.
- // The result will be discarded, so we can only check for non-existence.
- "urlsDontExist" : addUrls,
- // Make sure the completer was actually queried.
- "completerQueried" : [completer, addUrls]
- };
-
- doUpdateTest([update], assertions,
- function() {
- // Give the dbservice a chance to (not) cache the result.
- var timer = new Timer(3000, function() {
- // The miss earlier will have caused a miss to be cached.
- // Resetting the completer does not count as an update,
- // so we will not be probed again.
- var newCompleter = installCompleter('test-malware-simple', [[1, addUrls]], []); dbservice.setHashCompleter("test-phish-simple",
- newCompleter);
-
- var assertions = {
- "urlsDontExist" : addUrls
- };
- checkAssertions(assertions, runNextTest);
- });
- }, updateError);
-}
-
-function setupCachedResults(addUrls, part2)
-{
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 4);
-
- var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- // Request the add url. This should cause the completion to be cached.
- "urlsExist" : addUrls,
- // Make sure the completer was actually queried.
- "completerQueried" : [completer, addUrls]
- };
-
- doUpdateTest([update], assertions,
- function() {
- // Give the dbservice a chance to cache the result.
- var timer = new Timer(3000, part2);
- }, updateError);
-}
-
-function testCachedResults()
-{
- setupCachedResults(["foo.com/a"], function(add) {
- // This is called after setupCachedResults(). Verify that
- // checking the url again does not cause a completer request.
-
- // install a new completer, this one should never be queried.
- var newCompleter = installCompleter('test-phish-simple', [[1, []]], []);
-
- var assertions = {
- "urlsExist" : ["foo.com/a"],
- "completerQueried" : [newCompleter, []]
- };
- checkAssertions(assertions, runNextTest);
- });
-}
-
-function testCachedResultsWithSub() {
- setupCachedResults(["foo.com/a"], function() {
- // install a new completer, this one should never be queried.
- var newCompleter = installCompleter('test-phish-simple', [[1, []]], []);
-
- var removeUpdate = buildPhishingUpdate(
- [ { "chunkNum" : 2,
- "chunkType" : "s",
- "urls": ["1:foo.com/a"] }],
- 4);
-
- var assertions = {
- "urlsDontExist" : ["foo.com/a"],
- "completerQueried" : [newCompleter, []]
- }
-
- doTest([removeUpdate], assertions);
- });
-}
-
-function testCachedResultsWithExpire() {
- setupCachedResults(["foo.com/a"], function() {
- // install a new completer, this one should never be queried.
- var newCompleter = installCompleter('test-phish-simple', [[1, []]], []);
-
- var expireUpdate =
- "n:1000\n" +
- "i:test-phish-simple\n" +
- "ad:1\n";
-
- var assertions = {
- "urlsDontExist" : ["foo.com/a"],
- "completerQueried" : [newCompleter, []]
- }
- doTest([expireUpdate], assertions);
- });
-}
-
-function testCachedResultsUpdate()
-{
- var existUrls = ["foo.com/a"];
- setupCachedResults(existUrls, function() {
- // This is called after setupCachedResults(). Verify that
- // checking the url again does not cause a completer request.
-
- // install a new completer, this one should never be queried.
- var newCompleter = installCompleter('test-phish-simple', [[1, []]], []);
-
- var assertions = {
- "urlsExist" : existUrls,
- "completerQueried" : [newCompleter, []]
- };
-
- var addUrls = ["foobar.org/a"];
-
- var update2 = buildPhishingUpdate(
- [
- { "chunkNum" : 2,
- "urls" : addUrls
- }],
- 4);
-
- checkAssertions(assertions, function () {
- // Apply the update. The cached completes should be gone.
- doStreamUpdate(update2, function() {
- // Now the completer gets queried again.
- var newCompleter2 = installCompleter('test-phish-simple', [[1, existUrls]], []);
- var assertions2 = {
- "tableData" : "test-phish-simple;a:1-2",
- "urlsExist" : existUrls,
- "completerQueried" : [newCompleter2, existUrls]
- };
- checkAssertions(assertions2, runNextTest);
- }, updateError);
- });
- });
-}
-
-function testCachedResultsFailure()
-{
- var existUrls = ["foo.com/a"];
- setupCachedResults(existUrls, function() {
- // This is called after setupCachedResults(). Verify that
- // checking the url again does not cause a completer request.
-
- // install a new completer, this one should never be queried.
- var newCompleter = installCompleter('test-phish-simple', [[1, []]], []);
-
- var assertions = {
- "urlsExist" : existUrls,
- "completerQueried" : [newCompleter, []]
- };
-
- var addUrls = ["foobar.org/a"];
-
- var update2 = buildPhishingUpdate(
- [
- { "chunkNum" : 2,
- "urls" : addUrls
- }],
- 4);
-
- checkAssertions(assertions, function() {
- // Apply the update. The cached completes should be gone.
- doErrorUpdate("test-phish-simple,test-malware-simple", function() {
- // Now the completer gets queried again.
- var newCompleter2 = installCompleter('test-phish-simple', [[1, existUrls]], []);
- var assertions2 = {
- "tableData" : "test-phish-simple;a:1",
- "urlsExist" : existUrls,
- "completerQueried" : [newCompleter2, existUrls]
- };
- checkAssertions(assertions2, runNextTest);
- }, updateError);
- });
- });
-}
-
-function testErrorList()
-{
- var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 4);
- // The update failure should will kill the completes, so the above
- // must be a prefix to get any hit at all past the update failure.
-
- var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsExist" : addUrls,
- // These are complete urls, and will only be completed if the
- // list is stale.
- "completerQueried" : [completer, addUrls]
- };
-
- // Apply the update.
- doStreamUpdate(update, function() {
- // Now the test-phish-simple and test-malware-simple tables are marked
- // as fresh. Fake an update failure to mark them stale.
- doErrorUpdate("test-phish-simple,test-malware-simple", function() {
- // Now the lists should be marked stale. Check assertions.
- checkAssertions(assertions, runNextTest);
- }, updateError);
- }, updateError);
-}
-
-
-function testStaleList()
-{
- var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 32);
-
- var completer = installCompleter('test-phish-simple', [[1, addUrls]], []);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsExist" : addUrls,
- // These are complete urls, and will only be completed if the
- // list is stale.
- "completerQueried" : [completer, addUrls]
- };
-
- // Consider a match stale after one second.
- prefBranch.setIntPref("urlclassifier.max-complete-age", 1);
-
- // Apply the update.
- doStreamUpdate(update, function() {
- // Now the test-phish-simple and test-malware-simple tables are marked
- // as fresh. Wait three seconds to make sure the list is marked stale.
- new Timer(3000, function() {
- // Now the lists should be marked stale. Check assertions.
- checkAssertions(assertions, function() {
- prefBranch.setIntPref("urlclassifier.max-complete-age", 2700);
- runNextTest();
- });
- }, updateError);
- }, updateError);
-}
-
-// Same as testStaleList, but verifies that an empty response still
-// unconfirms the entry.
-function testStaleListEmpty()
-{
- var addUrls = [ "foo.com/a", "foo.com/b", "bar.com/c" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls
- }],
- 32);
-
- var completer = installCompleter('test-phish-simple', [], []);
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- // None of these should match, because they won't be completed
- "urlsDontExist" : addUrls,
- // These are complete urls, and will only be completed if the
- // list is stale.
- "completerQueried" : [completer, addUrls]
- };
-
- // Consider a match stale after one second.
- prefBranch.setIntPref("urlclassifier.max-complete-age", 1);
-
- // Apply the update.
- doStreamUpdate(update, function() {
- // Now the test-phish-simple and test-malware-simple tables are marked
- // as fresh. Wait three seconds to make sure the list is marked stale.
- new Timer(3000, function() {
- // Now the lists should be marked stale. Check assertions.
- checkAssertions(assertions, function() {
- prefBranch.setIntPref("urlclassifier.max-complete-age", 2700);
- runNextTest();
- });
- }, updateError);
- }, updateError);
-}
-
-
-// Verify that different lists (test-phish-simple,
-// test-malware-simple) maintain their freshness separately.
-function testErrorListIndependent()
-{
- var phishUrls = [ "phish.com/a" ];
- var malwareUrls = [ "attack.com/a" ];
- var update = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : phishUrls
- }],
- 4);
- // These have to persist past the update failure, so they must be prefixes,
- // not completes.
-
- update += buildMalwareUpdate(
- [
- { "chunkNum" : 2,
- "urls" : malwareUrls
- }],
- 32);
-
- var completer = installCompleter('test-phish-simple', [[1, phishUrls]], []);
-
- var assertions = {
- "tableData" : "test-malware-simple;a:2\ntest-phish-simple;a:1",
- "urlsExist" : phishUrls,
- "malwareUrlsExist" : malwareUrls,
- // Only this phishing urls should be completed, because only the phishing
- // urls will be stale.
- "completerQueried" : [completer, phishUrls]
- };
-
- // Apply the update.
- doStreamUpdate(update, function() {
- // Now the test-phish-simple and test-malware-simple tables are
- // marked as fresh. Fake an update failure to mark *just*
- // phishing data as stale.
- doErrorUpdate("test-phish-simple", function() {
- // Now the lists should be marked stale. Check assertions.
- checkAssertions(assertions, runNextTest);
- }, updateError);
- }, updateError);
-}
-
-function run_test()
-{
- runTests([
- testPartialAdds,
- testPartialAddsWithConflicts,
- testFragments,
- testSpecFragments,
- testMoreSpecFragments,
- testFalsePositives,
- testEmptyCompleter,
- testCompleterFailure,
- testMixedSizesSameDomain,
- testMixedSizesDifferentDomains,
- testInvalidHashSize,
- testWrongTable,
- testCachedResults,
- testCachedResultsWithSub,
- testCachedResultsWithExpire,
- testCachedResultsUpdate,
- testCachedResultsFailure,
- testStaleList,
- testStaleListEmpty,
- testErrorList,
- testErrorListIndependent
- ]);
-}
-
-do_test_pending();
diff --git a/toolkit/components/url-classifier/tests/unit/test_pref.js b/toolkit/components/url-classifier/tests/unit/test_pref.js
deleted file mode 100644
index 68030a246..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_pref.js
+++ /dev/null
@@ -1,14 +0,0 @@
-function run_test() {
- let urlUtils = Cc["@mozilla.org/url-classifier/utils;1"]
- .getService(Ci.nsIUrlClassifierUtils);
-
- // The google protocol version should be "2.2" until we enable SB v4
- // by default.
- equal(urlUtils.getProtocolVersion("google"), "2.2");
-
- // Mozilla protocol version will stick to "2.2".
- equal(urlUtils.getProtocolVersion("mozilla"), "2.2");
-
- // Unknown provider version will be "2.2".
- equal(urlUtils.getProtocolVersion("unknown-provider"), "2.2");
-} \ No newline at end of file
diff --git a/toolkit/components/url-classifier/tests/unit/test_prefixset.js b/toolkit/components/url-classifier/tests/unit/test_prefixset.js
deleted file mode 100644
index f2ecc9c2b..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_prefixset.js
+++ /dev/null
@@ -1,232 +0,0 @@
-// newPset: returns an empty nsIUrlClassifierPrefixSet.
-function newPset() {
- let pset = Cc["@mozilla.org/url-classifier/prefixset;1"]
- .createInstance(Ci.nsIUrlClassifierPrefixSet);
- pset.init("all");
- return pset;
-}
-
-// arrContains: returns true if |arr| contains the element |target|. Uses binary
-// search and requires |arr| to be sorted.
-function arrContains(arr, target) {
- let start = 0;
- let end = arr.length - 1;
- let i = 0;
-
- while (end > start) {
- i = start + (end - start >> 1);
- let value = arr[i];
-
- if (value < target)
- start = i+1;
- else if (value > target)
- end = i-1;
- else
- break;
- }
- if (start == end)
- i = start;
-
- return (!(i < 0 || i >= arr.length) && arr[i] == target);
-}
-
-// checkContents: Check whether the PrefixSet pset contains
-// the prefixes in the passed array.
-function checkContents(pset, prefixes) {
- var outcount = {}, outset = {};
- outset = pset.getPrefixes(outcount);
- let inset = prefixes;
- do_check_eq(inset.length, outset.length);
- inset.sort((x,y) => x - y);
- for (let i = 0; i < inset.length; i++) {
- do_check_eq(inset[i], outset[i]);
- }
-}
-
-function wrappedProbe(pset, prefix) {
- return pset.contains(prefix);
-};
-
-// doRandomLookups: we use this to test for false membership with random input
-// over the range of prefixes (unsigned 32-bits integers).
-// pset: a nsIUrlClassifierPrefixSet to test.
-// prefixes: an array of prefixes supposed to make up the prefix set.
-// N: number of random lookups to make.
-function doRandomLookups(pset, prefixes, N) {
- for (let i = 0; i < N; i++) {
- let randInt = prefixes[0];
- while (arrContains(prefixes, randInt))
- randInt = Math.floor(Math.random() * Math.pow(2, 32));
-
- do_check_false(wrappedProbe(pset, randInt));
- }
-}
-
-// doExpectedLookups: we use this to test expected membership.
-// pset: a nsIUrlClassifierPrefixSet to test.
-// prefixes:
-function doExpectedLookups(pset, prefixes, N) {
- for (let i = 0; i < N; i++) {
- prefixes.forEach(function (x) {
- dump("Checking " + x + "\n");
- do_check_true(wrappedProbe(pset, x));
- });
- }
-}
-
-// testBasicPset: A very basic test of the prefix set to make sure that it
-// exists and to give a basic example of its use.
-function testBasicPset() {
- let pset = Cc["@mozilla.org/url-classifier/prefixset;1"]
- .createInstance(Ci.nsIUrlClassifierPrefixSet);
- let prefixes = [2,50,100,2000,78000,1593203];
- pset.setPrefixes(prefixes, prefixes.length);
-
- do_check_true(wrappedProbe(pset, 100));
- do_check_false(wrappedProbe(pset, 100000));
- do_check_true(wrappedProbe(pset, 1593203));
- do_check_false(wrappedProbe(pset, 999));
- do_check_false(wrappedProbe(pset, 0));
-
-
- checkContents(pset, prefixes);
-}
-
-function testDuplicates() {
- let pset = Cc["@mozilla.org/url-classifier/prefixset;1"]
- .createInstance(Ci.nsIUrlClassifierPrefixSet);
- let prefixes = [1,1,2,2,2,3,3,3,3,3,3,5,6,6,7,7,9,9,9];
- pset.setPrefixes(prefixes, prefixes.length);
-
- do_check_true(wrappedProbe(pset, 1));
- do_check_true(wrappedProbe(pset, 2));
- do_check_true(wrappedProbe(pset, 5));
- do_check_true(wrappedProbe(pset, 9));
- do_check_false(wrappedProbe(pset, 4));
- do_check_false(wrappedProbe(pset, 8));
-
-
- checkContents(pset, prefixes);
-}
-
-function testSimplePset() {
- let pset = newPset();
- let prefixes = [1,2,100,400,123456789];
- pset.setPrefixes(prefixes, prefixes.length);
-
- doRandomLookups(pset, prefixes, 100);
- doExpectedLookups(pset, prefixes, 1);
-
-
- checkContents(pset, prefixes);
-}
-
-function testReSetPrefixes() {
- let pset = newPset();
- let prefixes = [1, 5, 100, 1000, 150000];
- pset.setPrefixes(prefixes, prefixes.length);
-
- doExpectedLookups(pset, prefixes, 1);
-
- let secondPrefixes = [12, 50, 300, 2000, 5000, 200000];
- pset.setPrefixes(secondPrefixes, secondPrefixes.length);
-
- doExpectedLookups(pset, secondPrefixes, 1);
- for (let i = 0; i < prefixes.length; i++) {
- do_check_false(wrappedProbe(pset, prefixes[i]));
- }
-
-
- checkContents(pset, secondPrefixes);
-}
-
-function testLoadSaveLargeSet() {
- let N = 1000;
- let arr = [];
-
- for (let i = 0; i < N; i++) {
- let randInt = Math.floor(Math.random() * Math.pow(2, 32));
- arr.push(randInt);
- }
-
- arr.sort((x,y) => x - y);
-
- let pset = newPset();
- pset.setPrefixes(arr, arr.length);
-
- doExpectedLookups(pset, arr, 1);
- doRandomLookups(pset, arr, 1000);
-
- checkContents(pset, arr);
-
- // Now try to save, restore, and redo the lookups
- var file = dirSvc.get('ProfLD', Ci.nsIFile);
- file.append("testLarge.pset");
-
- pset.storeToFile(file);
-
- let psetLoaded = newPset();
- psetLoaded.loadFromFile(file);
-
- doExpectedLookups(psetLoaded, arr, 1);
- doRandomLookups(psetLoaded, arr, 1000);
-
- checkContents(psetLoaded, arr);
-}
-
-function testTinySet() {
- let pset = Cc["@mozilla.org/url-classifier/prefixset;1"]
- .createInstance(Ci.nsIUrlClassifierPrefixSet);
- let prefixes = [1];
- pset.setPrefixes(prefixes, prefixes.length);
-
- do_check_true(wrappedProbe(pset, 1));
- do_check_false(wrappedProbe(pset, 100000));
- checkContents(pset, prefixes);
-
- prefixes = [];
- pset.setPrefixes(prefixes, prefixes.length);
- do_check_false(wrappedProbe(pset, 1));
- checkContents(pset, prefixes);
-}
-
-function testLoadSaveNoDelta() {
- let N = 100;
- let arr = [];
-
- for (let i = 0; i < N; i++) {
- // construct a tree without deltas by making the distance
- // between entries larger than 16 bits
- arr.push(((1 << 16) + 1) * i);
- }
-
- let pset = newPset();
- pset.setPrefixes(arr, arr.length);
-
- doExpectedLookups(pset, arr, 1);
-
- var file = dirSvc.get('ProfLD', Ci.nsIFile);
- file.append("testNoDelta.pset");
-
- pset.storeToFile(file);
- pset.loadFromFile(file);
-
- doExpectedLookups(pset, arr, 1);
-}
-
-var tests = [testBasicPset,
- testSimplePset,
- testReSetPrefixes,
- testLoadSaveLargeSet,
- testDuplicates,
- testTinySet,
- testLoadSaveNoDelta];
-
-function run_test() {
- // None of the tests use |executeSoon| or any sort of callbacks, so we can
- // just run them in succession.
- for (let i = 0; i < tests.length; i++) {
- dump("Running " + tests[i].name + "\n");
- tests[i]();
- }
-}
diff --git a/toolkit/components/url-classifier/tests/unit/test_provider_url.js b/toolkit/components/url-classifier/tests/unit/test_provider_url.js
deleted file mode 100644
index 9a946dc3f..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_provider_url.js
+++ /dev/null
@@ -1,34 +0,0 @@
-Cu.import("resource://testing-common/AppInfo.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm");
-
-function updateVersion(version) {
- updateAppInfo({ version });
-}
-
-add_test(function test_provider_url() {
- let urls = [
- "browser.safebrowsing.provider.google.updateURL",
- "browser.safebrowsing.provider.google.gethashURL",
- "browser.safebrowsing.provider.mozilla.updateURL",
- "browser.safebrowsing.provider.mozilla.gethashURL"
- ];
-
- let versions = [
- "49.0",
- "49.0.1",
- "49.0a1",
- "49.0b1",
- "49.0esr",
- "49.0.1esr"
- ];
-
- for (let version of versions) {
- for (let url of urls) {
- updateVersion(version);
- let value = Services.urlFormatter.formatURLPref(url);
- Assert.notEqual(value.indexOf("&appver=49.0&"), -1);
- }
- }
-
- run_next_test();
-});
diff --git a/toolkit/components/url-classifier/tests/unit/test_safebrowsing_protobuf.js b/toolkit/components/url-classifier/tests/unit/test_safebrowsing_protobuf.js
deleted file mode 100644
index 45309ba54..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_safebrowsing_protobuf.js
+++ /dev/null
@@ -1,23 +0,0 @@
-function run_test() {
- let urlUtils = Cc["@mozilla.org/url-classifier/utils;1"]
- .getService(Ci.nsIUrlClassifierUtils);
-
- // No list at all.
- let requestNoList = urlUtils.makeUpdateRequestV4([], [], 0);
-
- // Only one valid list name.
- let requestOneValid =
- urlUtils.makeUpdateRequestV4(["goog-phish-proto"], ["AAAAAA"], 1);
-
- // Only one invalid list name.
- let requestOneInvalid =
- urlUtils.makeUpdateRequestV4(["bad-list-name"], ["AAAAAA"], 1);
-
- // One valid and one invalid list name.
- let requestOneInvalidOneValid =
- urlUtils.makeUpdateRequestV4(["goog-phish-proto", "bad-list-name"],
- ["AAAAAA", "AAAAAA"], 2);
-
- equal(requestNoList, requestOneInvalid);
- equal(requestOneValid, requestOneInvalidOneValid);
-} \ No newline at end of file
diff --git a/toolkit/components/url-classifier/tests/unit/test_streamupdater.js b/toolkit/components/url-classifier/tests/unit/test_streamupdater.js
deleted file mode 100644
index e5abc4e91..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_streamupdater.js
+++ /dev/null
@@ -1,288 +0,0 @@
-function doTest(updates, assertions, expectError)
-{
- if (expectError) {
- doUpdateTest(updates, assertions, updateError, runNextTest);
- } else {
- doUpdateTest(updates, assertions, runNextTest, updateError);
- }
-}
-
-// Never use the same URLs for multiple tests, because we aren't guaranteed
-// to reset the database between tests.
-function testFillDb() {
- var add1Urls = [ "zaz.com/a", "yxz.com/c" ];
-
- var update = "n:1000\n";
- update += "i:test-phish-simple\n";
-
- var update1 = buildBareUpdate(
- [{ "chunkNum" : 1,
- "urls" : add1Urls }]);
- update += "u:data:," + encodeURIComponent(update1) + "\n";
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1",
- "urlsExist" : add1Urls
- };
-
- doTest([update], assertions, false);
-}
-
-function testSimpleForward() {
- var add1Urls = [ "foo-simple.com/a", "bar-simple.com/c" ];
- var add2Urls = [ "foo-simple.com/b" ];
- var add3Urls = [ "bar-simple.com/d" ];
-
- var update = "n:1000\n";
- update += "i:test-phish-simple\n";
-
- var update1 = buildBareUpdate(
- [{ "chunkNum" : 1,
- "urls" : add1Urls }]);
- update += "u:data:," + encodeURIComponent(update1) + "\n";
-
- var update2 = buildBareUpdate(
- [{ "chunkNum" : 2,
- "urls" : add2Urls }]);
- update += "u:data:," + encodeURIComponent(update2) + "\n";
-
- var update3 = buildBareUpdate(
- [{ "chunkNum" : 3,
- "urls" : add3Urls }]);
- update += "u:data:," + encodeURIComponent(update3) + "\n";
-
- var assertions = {
- "tableData" : "test-phish-simple;a:1-3",
- "urlsExist" : add1Urls.concat(add2Urls).concat(add3Urls)
- };
-
- doTest([update], assertions, false);
-}
-
-// Make sure that a nested forward (a forward within a forward) causes
-// the update to fail.
-function testNestedForward() {
- var add1Urls = [ "foo-nested.com/a", "bar-nested.com/c" ];
- var add2Urls = [ "foo-nested.com/b" ];
-
- var update = "n:1000\n";
- update += "i:test-phish-simple\n";
-
- var update1 = buildBareUpdate(
- [{ "chunkNum" : 1,
- "urls" : add1Urls }]);
- update += "u:data:," + encodeURIComponent(update1) + "\n";
-
- var update2 = buildBareUpdate(
- [{ "chunkNum" : 2 }]);
- var update3 = buildBareUpdate(
- [{ "chunkNum" : 3,
- "urls" : add1Urls }]);
-
- update2 += "u:data:," + encodeURIComponent(update3) + "\n";
-
- update += "u:data:," + encodeURIComponent(update2) + "\n";
-
- var assertions = {
- "tableData" : "",
- "urlsDontExist" : add1Urls.concat(add2Urls)
- };
-
- doTest([update], assertions, true);
-}
-
-// An invalid URL forward causes the update to fail.
-function testInvalidUrlForward() {
- var add1Urls = [ "foo-invalid.com/a", "bar-invalid.com/c" ];
-
- var update = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "urls" : add1Urls }]);
- update += "u:asdf://blah/blah\n"; // invalid URL scheme
-
- // add1Urls is present, but that is an artifact of the way we do the test.
- var assertions = {
- "tableData" : "",
- "urlsExist" : add1Urls
- };
-
- doTest([update], assertions, true);
-}
-
-// A failed network request causes the update to fail.
-function testErrorUrlForward() {
- var add1Urls = [ "foo-forward.com/a", "bar-forward.com/c" ];
-
- var update = buildPhishingUpdate(
- [{ "chunkNum" : 1,
- "urls" : add1Urls }]);
- update += "u:http://test.invalid/asdf/asdf\n"; // invalid URL scheme
-
- // add1Urls is present, but that is an artifact of the way we do the test.
- var assertions = {
- "tableData" : "",
- "urlsExist" : add1Urls
- };
-
- doTest([update], assertions, true);
-}
-
-function testMultipleTables() {
- var add1Urls = [ "foo-multiple.com/a", "bar-multiple.com/c" ];
- var add2Urls = [ "foo-multiple.com/b" ];
- var add3Urls = [ "bar-multiple.com/d" ];
- var add4Urls = [ "bar-multiple.com/e" ];
- var add6Urls = [ "bar-multiple.com/g" ];
-
- var update = "n:1000\n";
- update += "i:test-phish-simple\n";
-
- var update1 = buildBareUpdate(
- [{ "chunkNum" : 1,
- "urls" : add1Urls }]);
- update += "u:data:," + encodeURIComponent(update1) + "\n";
-
- var update2 = buildBareUpdate(
- [{ "chunkNum" : 2,
- "urls" : add2Urls }]);
- update += "u:data:," + encodeURIComponent(update2) + "\n";
-
- update += "i:test-malware-simple\n";
-
- var update3 = buildBareUpdate(
- [{ "chunkNum" : 3,
- "urls" : add3Urls }]);
- update += "u:data:," + encodeURIComponent(update3) + "\n";
-
- update += "i:test-unwanted-simple\n";
- var update4 = buildBareUpdate(
- [{ "chunkNum" : 4,
- "urls" : add4Urls }]);
- update += "u:data:," + encodeURIComponent(update4) + "\n";
-
- update += "i:test-block-simple\n";
- var update6 = buildBareUpdate(
- [{ "chunkNum" : 6,
- "urls" : add6Urls }]);
- update += "u:data:," + encodeURIComponent(update6) + "\n";
-
- var assertions = {
- "tableData" : "test-block-simple;a:6\ntest-malware-simple;a:3\ntest-phish-simple;a:1-2\ntest-unwanted-simple;a:4",
- "urlsExist" : add1Urls.concat(add2Urls),
- "malwareUrlsExist" : add3Urls,
- "unwantedUrlsExist" : add4Urls,
- "blockedUrlsExist" : add6Urls
- };
-
- doTest([update], assertions, false);
-}
-
-function testUrlInMultipleTables() {
- var add1Urls = [ "foo-forward.com/a" ];
-
- var update = "n:1000\n";
- update += "i:test-phish-simple\n";
-
- var update1 = buildBareUpdate(
- [{ "chunkNum" : 1,
- "urls" : add1Urls }]);
- update += "u:data:," + encodeURIComponent(update1) + "\n";
-
- update += "i:test-malware-simple\n";
- var update2 = buildBareUpdate(
- [{ "chunkNum" : 2,
- "urls" : add1Urls }]);
- update += "u:data:," + encodeURIComponent(update2) + "\n";
-
- update += "i:test-unwanted-simple\n";
- var update3 = buildBareUpdate(
- [{ "chunkNum" : 3,
- "urls" : add1Urls }]);
- update += "u:data:," + encodeURIComponent(update3) + "\n";
-
- var assertions = {
- "tableData" : "test-malware-simple;a:2\ntest-phish-simple;a:1\ntest-unwanted-simple;a:3",
- "urlExistInMultipleTables" : { url: add1Urls,
- tables: "test-malware-simple,test-phish-simple,test-unwanted-simple" }
- };
-
- doTest([update], assertions, false);
-}
-
-function Observer(callback) {
- this.observe = callback;
-}
-
-Observer.prototype =
-{
-QueryInterface: function(iid)
-{
- if (!iid.equals(Ci.nsISupports) &&
- !iid.equals(Ci.nsIObserver)) {
- throw Cr.NS_ERROR_NO_INTERFACE;
- }
- return this;
-}
-};
-
-// Tests a database reset request.
-function testReset() {
- // The moz-phish-simple table is populated separately from the other update in
- // a separate update request. Therefore it should not be reset when we run the
- // updates later in this function.
- var mozAddUrls = [ "moz-reset.com/a" ];
- var mozUpdate = buildMozPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : mozAddUrls
- }]);
-
- var dataUpdate = "data:," + encodeURIComponent(mozUpdate);
-
- streamUpdater.downloadUpdates(mozTables, "", true,
- dataUpdate, () => {}, updateError, updateError);
-
- var addUrls1 = [ "foo-reset.com/a", "foo-reset.com/b" ];
- var update1 = buildPhishingUpdate(
- [
- { "chunkNum" : 1,
- "urls" : addUrls1
- }]);
-
- var update2 = "n:1000\nr:pleasereset\n";
-
- var addUrls3 = [ "bar-reset.com/a", "bar-reset.com/b" ];
- var update3 = buildPhishingUpdate(
- [
- { "chunkNum" : 3,
- "urls" : addUrls3
- }]);
-
- var assertions = {
- "tableData" : "moz-phish-simple;a:1\ntest-phish-simple;a:3", // tables that should still be there.
- "mozPhishingUrlsExist" : mozAddUrls, // mozAddUrls added prior to the reset
- // but it should still exist after reset.
- "urlsExist" : addUrls3, // addUrls3 added after the reset.
- "urlsDontExist" : addUrls1 // addUrls1 added prior to the reset
- };
-
- // Use these update responses in order. The update request only
- // contains test-*-simple tables so the reset will only apply to these.
- doTest([update1, update2, update3], assertions, false);
-}
-
-
-function run_test()
-{
- runTests([
- testSimpleForward,
- testNestedForward,
- testInvalidUrlForward,
- testErrorUrlForward,
- testMultipleTables,
- testUrlInMultipleTables,
- testReset
- ]);
-}
-
-do_test_pending();
diff --git a/toolkit/components/url-classifier/tests/unit/test_threat_type_conversion.js b/toolkit/components/url-classifier/tests/unit/test_threat_type_conversion.js
deleted file mode 100644
index f7c51b956..000000000
--- a/toolkit/components/url-classifier/tests/unit/test_threat_type_conversion.js
+++ /dev/null
@@ -1,37 +0,0 @@
-function run_test() {
- let urlUtils = Cc["@mozilla.org/url-classifier/utils;1"]
- .getService(Ci.nsIUrlClassifierUtils);
-
- // Test list name to threat type conversion.
-
- equal(urlUtils.convertListNameToThreatType("goog-malware-proto"), 1);
- equal(urlUtils.convertListNameToThreatType("googpub-phish-proto"), 2);
- equal(urlUtils.convertListNameToThreatType("goog-unwanted-proto"), 3);
- equal(urlUtils.convertListNameToThreatType("goog-phish-proto"), 5);
-
- try {
- urlUtils.convertListNameToThreatType("bad-list-name");
- ok(false, "Bad list name should lead to exception.");
- } catch (e) {}
-
- try {
- urlUtils.convertListNameToThreatType("bad-list-name");
- ok(false, "Bad list name should lead to exception.");
- } catch (e) {}
-
- // Test threat type to list name conversion.
- equal(urlUtils.convertThreatTypeToListNames(1), "goog-malware-proto");
- equal(urlUtils.convertThreatTypeToListNames(2), "googpub-phish-proto,test-phish-proto");
- equal(urlUtils.convertThreatTypeToListNames(3), "goog-unwanted-proto,test-unwanted-proto");
- equal(urlUtils.convertThreatTypeToListNames(5), "goog-phish-proto");
-
- try {
- urlUtils.convertThreatTypeToListNames(0);
- ok(false, "Bad threat type should lead to exception.");
- } catch (e) {}
-
- try {
- urlUtils.convertThreatTypeToListNames(100);
- ok(false, "Bad threat type should lead to exception.");
- } catch (e) {}
-} \ No newline at end of file
diff --git a/toolkit/components/url-classifier/tests/unit/xpcshell.ini b/toolkit/components/url-classifier/tests/unit/xpcshell.ini
deleted file mode 100644
index c34d575c6..000000000
--- a/toolkit/components/url-classifier/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,24 +0,0 @@
-[DEFAULT]
-head = head_urlclassifier.js
-tail = tail_urlclassifier.js
-skip-if = toolkit == 'android'
-support-files =
- data/digest1.chunk
- data/digest2.chunk
-
-[test_addsub.js]
-[test_bug1274685_unowned_list.js]
-[test_backoff.js]
-[test_dbservice.js]
-[test_hashcompleter.js]
-# Bug 752243: Profile cleanup frequently fails
-#skip-if = os == "mac" || os == "linux"
-[test_partial.js]
-[test_prefixset.js]
-[test_threat_type_conversion.js]
-[test_provider_url.js]
-[test_streamupdater.js]
-[test_digest256.js]
-[test_listmanager.js]
-[test_pref.js]
-[test_safebrowsing_protobuf.js]
diff --git a/toolkit/components/url-classifier/tests/unittests.xul b/toolkit/components/url-classifier/tests/unittests.xul
deleted file mode 100644
index 0c9ce898b..000000000
--- a/toolkit/components/url-classifier/tests/unittests.xul
+++ /dev/null
@@ -1,188 +0,0 @@
-<?xml version="1.0"?>
-<window id="PROT_unittest"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="onProtUnittestLoad();"
- title="prot unittests">
-
-<script><![CDATA[
- const Cc = Components.classes;
- const Ci = Components.interfaces;
-
- function G_Debug(zone, s) {
- var label = document.createElement('label');
- var txt = "[" + zone + "] " + s;
- label.appendChild(document.createTextNode(txt));
-
- document.documentElement.appendChild(label);
- }
-
- function G_Assert(zone, cond, msg) {
- if (!cond) {
- G_Debug(zone, msg);
- throw msg;
- }
- }
-
- function ProtectionTableTests() {
- var z = "trtable UNITTEST";
-
- G_Debug(z, "Starting");
-
- var url = "http://www.yahoo.com?foo=bar";
- var url2 = "http://168.188.99.26/.secure/www.ebay.com/";
- var urlTable = Cc['@mozilla.org/url-classifier/table;1?type=url']
- .createInstance(Ci.nsIUrlClassifierTable);
- urlTable.insert(url, "1");
- urlTable.insert(url2, "1");
- G_Assert(z, urlTable.exists(url), "URL lookups broken");
- G_Assert(z, !urlTable.exists("about:config"), "about:config breaks domlook");
- G_Assert(z, urlTable.exists(url2), "URL lookups broken");
- G_Assert(z, urlTable.exists("http://%31%36%38%2e%31%38%38%2e%39%39%2e%32%36/%2E%73%65%63%75%72%65/%77%77%77%2E%65%62%61%79%2E%63%6F%6D/") == true,
- "URL Canonicalization broken");
- G_Assert(z, urlTable.count == 2, 'urlTable: wrong size');
-
- var dom1 = "bar.com";
- var dom2 = "amazon.co.uk";
- var dom3 = "127.0.0.1";
- var domainTable = Cc['@mozilla.org/url-classifier/table;1?type=domain']
- .createInstance(Ci.nsIUrlClassifierTable);
- domainTable.insert(dom1, "1");
- domainTable.insert(dom2, "1");
- domainTable.insert(dom3, "1");
- G_Assert(z, domainTable.exists("http://www.bar.com/?zaz=asdf#url"),
- "Domain lookups broken (single dot)");
- G_Assert(z, domainTable.exists("http://www.amazon.co.uk/?z=af#url"),
- "Domain lookups broken (two dots)");
- G_Assert(z, domainTable.exists("http://127.0.0.1/?z=af#url"),
- "Domain lookups broken (IP)");
- G_Assert(z, domainTable.count == 3, 'domainTable: wrong size');
-
- var site1 = "google.com/safebrowsing/";
- var site2 = "www.foo.bar/";
- var site3 = "127.0.0.1/";
- var siteTable = Cc['@mozilla.org/url-classifier/table;1?type=site']
- .createInstance(Ci.nsIUrlClassifierTable);
- siteTable.insert(site1, "1");
- siteTable.insert(site2, "1");
- siteTable.insert(site3, "1");
- G_Assert(z, siteTable.exists("http://www.google.com/safebrowsing/1.php"),
- "Site lookups broken - reducing");
- G_Assert(z, siteTable.exists("http://www.foo.bar/some/random/path"),
- "Site lookups broken - fqdn");
- G_Assert(z, siteTable.exists("http://127.0.0.1/something?hello=1"),
- "Site lookups broken - IP");
- G_Assert(z, !siteTable.exists("http://www.google.com/search/"),
- "Site lookups broken - overreaching");
- G_Assert(z, siteTable.count == 3, 'siteTable: wrong size');
-
- var url1 = "http://poseidon.marinet.gr/~eleni/eBay/index.php";
- var domainHash = "01844755C8143C4579BB28DD59C23747";
- var enchashTable = Cc['@mozilla.org/url-classifier/table;1?type=enchash']
- .createInstance(Ci.nsIUrlClassifierTable);
- enchashTable.insert(domainHash, "bGtEQWJuMl9FA3Kl5RiXMpgFU8nDJl9J0hXjUck9+"
- + "mMUQwAN6llf0gJeY5DIPPc2f+a8MSBFJN17ANGJ"
- + "Zl5oZVsQfSW4i12rlScsx4tweZAE");
- G_Assert(z, enchashTable.exists(url1), 'enchash lookup failed');
- G_Assert(z, !enchashTable.exists(url1 + '/foo'),
- "enchash lookup broken - overreaching");
- G_Assert(z, enchashTable.count == 1, 'enchashTable: wrong size');
-
- // TODO: test replace
- G_Debug(z, "PASSED");
- }
-
- function ProtectionListManagerTests() {
- var z = "listmanager UNITTEST";
- G_Debug(z, "Starting");
-
- // test lookup and register
- var listManagerInst = Cc["@mozilla.org/url-classifier/listmanager;1"]
- .createInstance(Ci.nsIUrlListManager);
- var listName = 'foo-bar-url';
- listManagerInst.registerTable(listName, false);
- listManagerInst.safeInsert(listName, 'test', '1');
- G_Assert(z, listManagerInst.safeExists(listName, 'test'),
- 'insert/exist failed');
-
- // test serialization
- var baseName = (new Date().getTime()) + ".tmp";
- var tempDir = Cc["@mozilla.org/file/directory_service;1"]
- .getService(Ci.nsIProperties)
- .get("TmpD", Ci.nsILocalFile);
- tempDir.append(baseName);
- tempDir.createUnique(tempDir.DIRECTORY_TYPE, 0744);
-
- var listManager = Cc["@mozilla.org/url-classifier/listmanager;1"]
- .getService(Ci.nsIUrlListManager);
- listManager.setAppDir(tempDir);
-
- var data = "";
-
- var set1Name = "test1-foo-domain";
- data += "[" + set1Name + " 1.2]\n";
- var set1 = {};
- for (var i = 0; i < 10; i++) {
- set1["http://" + i + ".com"] = 1;
- data += "+" + i + ".com\t1\n";
- }
-
- data += "\n";
- var set2Name = "test2-foo-domain";
- // TODO must have blank line
- data += "\n[" + set2Name + " 1.7]\n";
- var set2 = {};
- for (var i = 0; i < 5; i++) {
- set2["http://" + i + ".com"] = 1;
- data += "+" + i + ".com\t1\n";
- }
-
- function deserialized(tablesKnown, tablesData) {
- listManager.wrappedJSObject.dataReady(tablesKnown, tablesData);
-
- var file = tempDir.clone();
- file.append(set1Name + ".sst");
- G_Assert(z, file.exists() && file.isFile() && file.isReadable(),
- "Failed to write out: " + file.path);
-
- file = tempDir.clone();
- file.append(set2Name + ".sst");
- G_Assert(z, file.exists() && file.isFile() && file.isReadable(),
- "Failed to write out: " + file.path);
-
- // now try to read them back from disk
- listManager = Cc["@mozilla.org/url-classifier/listmanager;1"]
- .createInstance(Ci.nsIUrlListManager);
- listManager.setAppDir(tempDir);
- var tables = [ set1Name, set2Name ];
- listManager.enableUpdate(set1Name);
- listManager.enableUpdate(set2Name);
- listManager.wrappedJSObject.readDataFiles();
-
- // assert that the values match
- for (var prop in set1) {
- G_Assert(z,
- listManager.wrappedJSObject.tablesData[set1Name].exists(prop),
- "Couldn't find member " + prop + "of set1 from disk.");
- }
-
- for (var prop in set2) {
- G_Assert(z,
- listManager.wrappedJSObject.tablesData[set2Name].exists(prop),
- "Couldn't find member " + prop + "of set2 from disk.");
- }
-
- tempDir.remove(true);
-
- G_Debug(z, "PASSED");
- };
-
- // Use the unwrapped object for the unittest
- listManager.wrappedJSObject.deserialize_(data, deserialized);
- }
-
- function onProtUnittestLoad() {
- ProtectionTableTests();
- ProtectionListManagerTests();
- }
-]]></script>
-</window>
diff --git a/toolkit/components/urlformatter/moz.build b/toolkit/components/urlformatter/moz.build
index 1543fddda..c7a3ac76e 100644
--- a/toolkit/components/urlformatter/moz.build
+++ b/toolkit/components/urlformatter/moz.build
@@ -4,24 +4,14 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
-
-XPIDL_SOURCES += [
- 'nsIURLFormatter.idl',
-]
+XPIDL_SOURCES += ['nsIURLFormatter.idl']
XPIDL_MODULE = 'urlformatter'
-EXTRA_COMPONENTS += [
- 'nsURLFormatter.manifest',
-]
+EXTRA_COMPONENTS += ['nsURLFormatter.manifest']
-EXTRA_PP_COMPONENTS += [
- 'nsURLFormatter.js',
-]
+EXTRA_PP_COMPONENTS += ['nsURLFormatter.js']
-CONFIGURE_SUBST_FILES += [
- 'api_keys',
-]
+CONFIGURE_SUBST_FILES += ['api_keys']
DEFINES['OBJDIR'] = OBJDIR
diff --git a/toolkit/components/urlformatter/tests/unit/.eslintrc.js b/toolkit/components/urlformatter/tests/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/urlformatter/tests/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/urlformatter/tests/unit/head_urlformatter.js b/toolkit/components/urlformatter/tests/unit/head_urlformatter.js
deleted file mode 100644
index 8af2aaac4..000000000
--- a/toolkit/components/urlformatter/tests/unit/head_urlformatter.js
+++ /dev/null
@@ -1,16 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-var Cu = Components.utils;
-
-Cu.import("resource://testing-common/AppInfo.jsm", this);
-updateAppInfo({
- name: "Url Formatter Test",
- ID: "urlformattertest@test.mozilla.org",
- version: "1",
- platformVersion: "2.0",
-});
-var gAppInfo = getAppInfo();
diff --git a/toolkit/components/urlformatter/tests/unit/test_urlformatter.js b/toolkit/components/urlformatter/tests/unit/test_urlformatter.js
deleted file mode 100644
index 6f218822a..000000000
--- a/toolkit/components/urlformatter/tests/unit/test_urlformatter.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-function run_test() {
- var formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
- getService(Ci.nsIURLFormatter);
- var locale = Cc["@mozilla.org/chrome/chrome-registry;1"].
- getService(Ci.nsIXULChromeRegistry).
- getSelectedLocale('global');
- var prefs = Cc['@mozilla.org/preferences-service;1'].
- getService(Ci.nsIPrefBranch);
- var sysInfo = Cc["@mozilla.org/system-info;1"].
- getService(Ci.nsIPropertyBag2);
- var OSVersion = sysInfo.getProperty("name") + " " +
- sysInfo.getProperty("version");
- try {
- OSVersion += " (" + sysInfo.getProperty("secondaryLibrary") + ")";
- } catch (e) {}
- OSVersion = encodeURIComponent(OSVersion);
- var macutils = null;
- try {
- macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].
- getService(Ci.nsIMacUtils);
- } catch (e) {}
- var appInfo = Cc["@mozilla.org/xre/app-info;1"].
- getService(Ci.nsIXULAppInfo).
- QueryInterface(Ci.nsIXULRuntime);
- var abi = macutils && macutils.isUniversalBinary ? "Universal-gcc3" : appInfo.XPCOMABI;
-
- let defaults = prefs.QueryInterface(Ci.nsIPrefService).getDefaultBranch(null);
- let channel = defaults.getCharPref("app.update.channel", "default");
-
- // Set distribution values.
- defaults.setCharPref("distribution.id", "bacon");
- defaults.setCharPref("distribution.version", "1.0");
-
- var upperUrlRaw = "http://%LOCALE%.%VENDOR%.foo/?name=%NAME%&id=%ID%&version=%VERSION%&platversion=%PLATFORMVERSION%&abid=%APPBUILDID%&pbid=%PLATFORMBUILDID%&app=%APP%&os=%OS%&abi=%XPCOMABI%";
- var lowerUrlRaw = "http://%locale%.%vendor%.foo/?name=%name%&id=%id%&version=%version%&platversion=%platformversion%&abid=%appbuildid%&pbid=%platformbuildid%&app=%app%&os=%os%&abi=%xpcomabi%";
- // XXX %APP%'s RegExp is not global, so it only replaces the first space
- var ulUrlRef = "http://" + locale + ".Mozilla.foo/?name=Url Formatter Test&id=urlformattertest@test.mozilla.org&version=1&platversion=2.0&abid=" + gAppInfo.appBuildID + "&pbid=" + gAppInfo.platformBuildID + "&app=urlformatter test&os=XPCShell&abi=" + abi;
- var multiUrl = "http://%VENDOR%.%VENDOR%.%NAME%.%VENDOR%.%NAME%";
- var multiUrlRef = "http://Mozilla.Mozilla.Url Formatter Test.Mozilla.Url Formatter Test";
- var encodedUrl = "https://%LOCALE%.%VENDOR%.foo/?q=%E3%82%BF%E3%83%96&app=%NAME%&ver=%PLATFORMVERSION%";
- var encodedUrlRef = "https://" + locale + ".Mozilla.foo/?q=%E3%82%BF%E3%83%96&app=Url Formatter Test&ver=2.0";
- var advancedUrl = "http://test.mozilla.com/%NAME%/%VERSION%/%APPBUILDID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/";
- var advancedUrlRef = "http://test.mozilla.com/Url Formatter Test/1/" + gAppInfo.appBuildID + "/XPCShell_" + abi + "/" + locale + "/" + channel + "/" + OSVersion + "/bacon/1.0/";
-
- var pref = "xpcshell.urlformatter.test";
- var str = Cc["@mozilla.org/supports-string;1"].
- createInstance(Ci.nsISupportsString);
- str.data = upperUrlRaw;
- prefs.setComplexValue(pref, Ci.nsISupportsString, str);
-
- do_check_eq(formatter.formatURL(upperUrlRaw), ulUrlRef);
- do_check_eq(formatter.formatURLPref(pref), ulUrlRef);
- // Keys must be uppercase
- do_check_neq(formatter.formatURL(lowerUrlRaw), ulUrlRef);
- do_check_eq(formatter.formatURL(multiUrl), multiUrlRef);
- // Encoded strings must be kept as is (Bug 427304)
- do_check_eq(formatter.formatURL(encodedUrl), encodedUrlRef);
-
- do_check_eq(formatter.formatURL(advancedUrl), advancedUrlRef);
-}
diff --git a/toolkit/components/urlformatter/tests/unit/xpcshell.ini b/toolkit/components/urlformatter/tests/unit/xpcshell.ini
deleted file mode 100644
index 2f82beaa3..000000000
--- a/toolkit/components/urlformatter/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-head = head_urlformatter.js
-tail =
-skip-if = toolkit == 'android'
-
-[test_urlformatter.js]
diff --git a/toolkit/components/viewsource/moz.build b/toolkit/components/viewsource/moz.build
index aecd25682..965c0b66f 100644
--- a/toolkit/components/viewsource/moz.build
+++ b/toolkit/components/viewsource/moz.build
@@ -4,14 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
-MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
+EXTRA_JS_MODULES += ['ViewSourceBrowser.jsm']
-JAR_MANIFESTS += ['jar.mn']
-
-EXTRA_JS_MODULES += [
- 'ViewSourceBrowser.jsm',
-]
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'View Source')
+JAR_MANIFESTS += ['jar.mn'] \ No newline at end of file
diff --git a/toolkit/components/viewsource/test/.eslintrc.js b/toolkit/components/viewsource/test/.eslintrc.js
deleted file mode 100644
index 2c669d844..000000000
--- a/toolkit/components/viewsource/test/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/viewsource/test/browser/.eslintrc.js b/toolkit/components/viewsource/test/browser/.eslintrc.js
deleted file mode 100644
index 7c8021192..000000000
--- a/toolkit/components/viewsource/test/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/viewsource/test/browser/browser.ini b/toolkit/components/viewsource/test/browser/browser.ini
deleted file mode 100644
index d9ebbd25f..000000000
--- a/toolkit/components/viewsource/test/browser/browser.ini
+++ /dev/null
@@ -1,12 +0,0 @@
-[DEFAULT]
-support-files = head.js
- file_bug464222.html
-
-[browser_bug464222.js]
-[browser_bug699356.js]
-[browser_bug713810.js]
-[browser_contextmenu.js]
-subsuite = clipboard
-[browser_gotoline.js]
-[browser_srcdoc.js]
-[browser_viewsourceprefs.js]
diff --git a/toolkit/components/viewsource/test/browser/browser_bug464222.js b/toolkit/components/viewsource/test/browser/browser_bug464222.js
deleted file mode 100644
index 30c4fb67a..000000000
--- a/toolkit/components/viewsource/test/browser/browser_bug464222.js
+++ /dev/null
@@ -1,12 +0,0 @@
-const source = "http://example.com/browser/toolkit/components/viewsource/test/browser/file_bug464222.html";
-
-add_task(function *() {
- let viewSourceTab = yield* openDocumentSelect(source, "a");
-
- let href = yield ContentTask.spawn(viewSourceTab.linkedBrowser, { }, function* () {
- return content.document.querySelectorAll("a[href]")[0].href;
- });
-
- is(href, "view-source:" + source, "Relative links broken?");
- gBrowser.removeTab(viewSourceTab);
-});
diff --git a/toolkit/components/viewsource/test/browser/browser_bug699356.js b/toolkit/components/viewsource/test/browser/browser_bug699356.js
deleted file mode 100644
index e55c4cf20..000000000
--- a/toolkit/components/viewsource/test/browser/browser_bug699356.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-function test() {
- let source = "about:blank";
-
- waitForExplicitFinish();
- openViewSourceWindow(source, function(aWindow) {
- let gBrowser = aWindow.gBrowser;
- let docEl = aWindow.document.documentElement;
-
- is(gBrowser.contentDocument.title, source, "Correct document title");
- is(docEl.getAttribute("title"),
- "Source of: " + source + ("nsILocalFileMac" in Components.interfaces ? "" : " - " + docEl.getAttribute("titlemodifier")),
- "Correct window title");
- closeViewSourceWindow(aWindow, finish);
- });
-}
diff --git a/toolkit/components/viewsource/test/browser/browser_bug713810.js b/toolkit/components/viewsource/test/browser/browser_bug713810.js
deleted file mode 100644
index d5b2f3424..000000000
--- a/toolkit/components/viewsource/test/browser/browser_bug713810.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-const source = '<html xmlns="http://www.w3.org/1999/xhtml"><body><p>This is a paragraph.</p></body></html>';
-
-add_task(function *() {
- let viewSourceTab = yield* openDocumentSelect("data:text/html," + source, "p");
- yield ContentTask.spawn(viewSourceTab.linkedBrowser, null, function* () {
- Assert.equal(content.document.body.textContent, "<p>This is a paragraph.</p>",
- "Correct source for text/html");
- });
- gBrowser.removeTab(viewSourceTab);
-
- viewSourceTab = yield* openDocumentSelect("data:application/xhtml+xml," + source, "p");
- yield ContentTask.spawn(viewSourceTab.linkedBrowser, null, function* () {
- Assert.equal(content.document.body.textContent,
- '<p xmlns="http://www.w3.org/1999/xhtml">This is a paragraph.</p>',
- "Correct source for application/xhtml+xml");
- });
- gBrowser.removeTab(viewSourceTab);
-});
-
diff --git a/toolkit/components/viewsource/test/browser/browser_contextmenu.js b/toolkit/components/viewsource/test/browser/browser_contextmenu.js
deleted file mode 100644
index 72b8a40be..000000000
--- a/toolkit/components/viewsource/test/browser/browser_contextmenu.js
+++ /dev/null
@@ -1,107 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-var source = "data:text/html,text<link%20href='http://example.com/'%20/>more%20text<a%20href='mailto:abc@def.ghi'>email</a>";
-var gViewSourceWindow, gContextMenu, gCopyLinkMenuItem, gCopyEmailMenuItem;
-
-var expectedData = [];
-
-add_task(function *() {
- // Full source in view source window
- let newWindow = yield loadViewSourceWindow(source);
- yield SimpleTest.promiseFocus(newWindow);
-
- yield* onViewSourceWindowOpen(newWindow, false);
-
- let contextMenu = gViewSourceWindow.document.getElementById("viewSourceContextMenu");
-
- for (let test of expectedData) {
- yield* checkMenuItems(contextMenu, false, test[0], test[1], test[2], test[3]);
- }
-
- yield new Promise(resolve => {
- closeViewSourceWindow(newWindow, resolve);
- });
-
- // Selection source in view source tab
- expectedData = [];
- let newTab = yield openDocumentSelect(source, "body");
- yield* onViewSourceWindowOpen(window, true);
-
- contextMenu = document.getElementById("contentAreaContextMenu");
-
- for (let test of expectedData) {
- yield* checkMenuItems(contextMenu, true, test[0], test[1], test[2], test[3]);
- }
-
- gBrowser.removeTab(newTab);
-
- // Selection source in view source window
- yield pushPrefs(["view_source.tab", false]);
-
- expectedData = [];
- newWindow = yield openDocumentSelect(source, "body");
- yield SimpleTest.promiseFocus(newWindow);
-
- yield* onViewSourceWindowOpen(newWindow, false);
-
- contextMenu = newWindow.document.getElementById("viewSourceContextMenu");
-
- for (let test of expectedData) {
- yield* checkMenuItems(contextMenu, false, test[0], test[1], test[2], test[3]);
- }
-
- yield new Promise(resolve => {
- closeViewSourceWindow(newWindow, resolve);
- });
-});
-
-function* onViewSourceWindowOpen(aWindow, aIsTab) {
- gViewSourceWindow = aWindow;
-
- gCopyLinkMenuItem = aWindow.document.getElementById(aIsTab ? "context-copylink" : "context-copyLink");
- gCopyEmailMenuItem = aWindow.document.getElementById(aIsTab ? "context-copyemail" : "context-copyEmail");
-
- let browser = aIsTab ? gBrowser.selectedBrowser : gViewSourceWindow.gBrowser;
- yield ContentTask.spawn(browser, null, function* (arg) {
- let tags = content.document.querySelectorAll("a[href]");
- Assert.equal(tags[0].href, "view-source:http://example.com/", "Link has correct href");
- Assert.equal(tags[1].href, "mailto:abc@def.ghi", "Link has correct href");
- });
-
- expectedData.push(["a[href]", true, false, "http://example.com/"]);
- expectedData.push(["a[href^=mailto]", false, true, "abc@def.ghi"]);
- expectedData.push(["span", false, false, null]);
-}
-
-function* checkMenuItems(contextMenu, isTab, selector, copyLinkExpected, copyEmailExpected, expectedClipboardContent) {
-
- let browser = isTab ? gBrowser.selectedBrowser : gViewSourceWindow.gBrowser;
- yield ContentTask.spawn(browser, { selector: selector }, function* (arg) {
- content.document.querySelector(arg.selector).scrollIntoView();
- });
-
- let popupShownPromise = BrowserTestUtils.waitForEvent(contextMenu, "popupshown");
- yield BrowserTestUtils.synthesizeMouseAtCenter(selector,
- { type: "contextmenu", button: 2}, browser);
- yield popupShownPromise;
-
- is(gCopyLinkMenuItem.hidden, !copyLinkExpected, "Copy link menuitem is " + (copyLinkExpected ? "not hidden" : "hidden"));
- is(gCopyEmailMenuItem.hidden, !copyEmailExpected, "Copy email menuitem is " + (copyEmailExpected ? "not hidden" : "hidden"));
-
- if (copyLinkExpected || copyEmailExpected) {
- yield new Promise((resolve, reject) => {
- waitForClipboard(expectedClipboardContent, function() {
- if (copyLinkExpected)
- gCopyLinkMenuItem.click();
- else
- gCopyEmailMenuItem.click();
- }, resolve, reject);
- });
- }
-
- let popupHiddenPromise = BrowserTestUtils.waitForEvent(contextMenu, "popuphidden");
- contextMenu.hidePopup();
- yield popupHiddenPromise;
-}
diff --git a/toolkit/components/viewsource/test/browser/browser_gotoline.js b/toolkit/components/viewsource/test/browser/browser_gotoline.js
deleted file mode 100644
index 5bb45f9ca..000000000
--- a/toolkit/components/viewsource/test/browser/browser_gotoline.js
+++ /dev/null
@@ -1,36 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-Cu.import("resource://testing-common/ContentTaskUtils.jsm", this);
-
-var content = "line 1\nline 2\nline 3";
-
-add_task(function*() {
- // First test with text with the text/html mimetype.
- let win = yield loadViewSourceWindow("data:text/html," + encodeURIComponent(content));
- yield checkViewSource(win);
- yield BrowserTestUtils.closeWindow(win);
-
- win = yield loadViewSourceWindow("data:text/plain," + encodeURIComponent(content));
- yield checkViewSource(win);
- yield BrowserTestUtils.closeWindow(win);
-});
-
-var checkViewSource = Task.async(function* (aWindow) {
- is(aWindow.gBrowser.contentDocument.body.textContent, content, "Correct content loaded");
- let statusPanel = aWindow.document.getElementById("statusbar-line-col");
- is(statusPanel.getAttribute("label"), "", "Correct status bar text");
-
- for (let i = 1; i <= 3; i++) {
- aWindow.viewSourceChrome.goToLine(i);
- yield ContentTask.spawn(aWindow.gBrowser, i, function*(i) {
- let selection = content.getSelection();
- Assert.equal(selection.toString(), "line " + i, "Correct text selected");
- });
-
- yield ContentTaskUtils.waitForCondition(() => {
- return (statusPanel.getAttribute("label") == "Line " + i + ", Col 1");
- }, "Correct status bar text");
- }
-});
diff --git a/toolkit/components/viewsource/test/browser/browser_srcdoc.js b/toolkit/components/viewsource/test/browser/browser_srcdoc.js
deleted file mode 100644
index 542741ffc..000000000
--- a/toolkit/components/viewsource/test/browser/browser_srcdoc.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-const frameSource = `<a href="about:mozilla">good</a>`;
-const source = `<html><iframe srcdoc='${frameSource}' id="f"></iframe></html>`;
-
-add_task(function*() {
- let url = `data:text/html,${source}`;
- yield BrowserTestUtils.withNewTab({ gBrowser, url }, checkFrameSource);
-});
-
-function* checkFrameSource() {
- let sourceTab = yield openViewFrameSourceTab("#f");
- registerCleanupFunction(function() {
- gBrowser.removeTab(sourceTab);
- });
-
- yield waitForSourceLoaded(sourceTab);
-
- let browser = gBrowser.selectedBrowser;
- let textContent = yield ContentTask.spawn(browser, {}, function*() {
- return content.document.body.textContent;
- });
- is(textContent, frameSource, "Correct content loaded");
- let id = yield ContentTask.spawn(browser, {}, function*() {
- return content.document.body.id;
- });
- is(id, "viewsource", "View source mode enabled")
-}
diff --git a/toolkit/components/viewsource/test/browser/browser_viewsourceprefs.js b/toolkit/components/viewsource/test/browser/browser_viewsourceprefs.js
deleted file mode 100644
index 7361a70a5..000000000
--- a/toolkit/components/viewsource/test/browser/browser_viewsourceprefs.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-var plaintextURL = "data:text/plain,hello+world";
-var htmlURL = "about:mozilla";
-
-add_task(function* setup() {
- registerCleanupFunction(function() {
- SpecialPowers.clearUserPref("view_source.tab_size");
- SpecialPowers.clearUserPref("view_source.wrap_long_lines");
- SpecialPowers.clearUserPref("view_source.syntax_highlight");
- });
-});
-
-add_task(function*() {
- yield exercisePrefs(plaintextURL, false);
- yield exercisePrefs(htmlURL, true);
-});
-
-var exercisePrefs = Task.async(function* (source, highlightable) {
- let win = yield loadViewSourceWindow(source);
- let wrapMenuItem = win.document.getElementById("menu_wrapLongLines");
- let syntaxMenuItem = win.document.getElementById("menu_highlightSyntax");
-
- // Strip checked="false" attributes, since we're not interested in them.
- if (wrapMenuItem.getAttribute("checked") == "false") {
- wrapMenuItem.removeAttribute("checked");
- }
- if (syntaxMenuItem.getAttribute("checked") == "false") {
- syntaxMenuItem.removeAttribute("checked");
- }
-
- // Test the default states of these menu items.
- is(wrapMenuItem.hasAttribute("checked"), false,
- "Wrap menu item not checked by default");
- is(syntaxMenuItem.hasAttribute("checked"), true,
- "Syntax menu item checked by default");
-
- yield checkStyle(win, "-moz-tab-size", 4);
- yield checkStyle(win, "white-space", "pre");
-
- // Next, test that the Wrap Long Lines menu item works.
- let prefReady = waitForPrefChange("view_source.wrap_long_lines");
- simulateClick(wrapMenuItem);
- is(wrapMenuItem.hasAttribute("checked"), true, "Wrap menu item checked");
- yield prefReady;
- is(SpecialPowers.getBoolPref("view_source.wrap_long_lines"), true, "Wrap pref set");
-
- yield checkStyle(win, "white-space", "pre-wrap");
-
- prefReady = waitForPrefChange("view_source.wrap_long_lines");
- simulateClick(wrapMenuItem);
- is(wrapMenuItem.hasAttribute("checked"), false, "Wrap menu item unchecked");
- yield prefReady;
- is(SpecialPowers.getBoolPref("view_source.wrap_long_lines"), false, "Wrap pref set");
- yield checkStyle(win, "white-space", "pre");
-
- // Check that the Syntax Highlighting menu item works.
- prefReady = waitForPrefChange("view_source.syntax_highlight");
- simulateClick(syntaxMenuItem);
- is(syntaxMenuItem.hasAttribute("checked"), false, "Syntax menu item unchecked");
- yield prefReady;
- is(SpecialPowers.getBoolPref("view_source.syntax_highlight"), false, "Syntax highlighting pref set");
- yield checkHighlight(win, false);
-
- prefReady = waitForPrefChange("view_source.syntax_highlight");
- simulateClick(syntaxMenuItem);
- is(syntaxMenuItem.hasAttribute("checked"), true, "Syntax menu item checked");
- yield prefReady;
- is(SpecialPowers.getBoolPref("view_source.syntax_highlight"), true, "Syntax highlighting pref set");
- yield checkHighlight(win, highlightable);
- yield BrowserTestUtils.closeWindow(win);
-
- // Open a new view-source window to check that the prefs are obeyed.
- SpecialPowers.setIntPref("view_source.tab_size", 2);
- SpecialPowers.setBoolPref("view_source.wrap_long_lines", true);
- SpecialPowers.setBoolPref("view_source.syntax_highlight", false);
-
- win = yield loadViewSourceWindow(source);
- wrapMenuItem = win.document.getElementById("menu_wrapLongLines");
- syntaxMenuItem = win.document.getElementById("menu_highlightSyntax");
-
- // Strip checked="false" attributes, since we're not interested in them.
- if (wrapMenuItem.getAttribute("checked") == "false") {
- wrapMenuItem.removeAttribute("checked");
- }
- if (syntaxMenuItem.getAttribute("checked") == "false") {
- syntaxMenuItem.removeAttribute("checked");
- }
-
- is(wrapMenuItem.hasAttribute("checked"), true, "Wrap menu item checked");
- is(syntaxMenuItem.hasAttribute("checked"), false, "Syntax menu item unchecked");
- yield checkStyle(win, "-moz-tab-size", 2);
- yield checkStyle(win, "white-space", "pre-wrap");
- yield checkHighlight(win, false);
-
- SpecialPowers.clearUserPref("view_source.tab_size");
- SpecialPowers.clearUserPref("view_source.wrap_long_lines");
- SpecialPowers.clearUserPref("view_source.syntax_highlight");
-
- yield BrowserTestUtils.closeWindow(win);
-});
-
-// Simulate a menu item click, including toggling the checked state.
-// This saves us from opening the menu and trying to click on the item,
-// which doesn't work on Mac OS X.
-function simulateClick(aMenuItem) {
- if (aMenuItem.hasAttribute("checked"))
- aMenuItem.removeAttribute("checked");
- else
- aMenuItem.setAttribute("checked", "true");
-
- aMenuItem.click();
-}
-
-var checkStyle = Task.async(function* (win, styleProperty, expected) {
- let browser = win.gBrowser;
- let value = yield ContentTask.spawn(browser, styleProperty, function* (styleProperty) {
- let style = content.getComputedStyle(content.document.body, null);
- return style.getPropertyValue(styleProperty);
- });
- is(value, expected, "Correct value of " + styleProperty);
-});
-
-var checkHighlight = Task.async(function* (win, expected) {
- let browser = win.gBrowser;
- let highlighted = yield ContentTask.spawn(browser, {}, function* () {
- let spans = content.document.getElementsByTagName("span");
- return Array.some(spans, (span) => {
- let style = content.getComputedStyle(span, null);
- return style.getPropertyValue("color") !== "rgb(0, 0, 0)";
- });
- });
- is(highlighted, expected, "Syntax highlighting " + (expected ? "on" : "off"));
-});
diff --git a/toolkit/components/viewsource/test/browser/file_bug464222.html b/toolkit/components/viewsource/test/browser/file_bug464222.html
deleted file mode 100644
index 4f2a43f0d..000000000
--- a/toolkit/components/viewsource/test/browser/file_bug464222.html
+++ /dev/null
@@ -1 +0,0 @@
-<a href="file_bug464222.html">I'm a link</a> \ No newline at end of file
diff --git a/toolkit/components/viewsource/test/browser/head.js b/toolkit/components/viewsource/test/browser/head.js
deleted file mode 100644
index bb46369b0..000000000
--- a/toolkit/components/viewsource/test/browser/head.js
+++ /dev/null
@@ -1,200 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-Cu.import("resource://gre/modules/PromiseUtils.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-
-const WINDOW_TYPE = "navigator:view-source";
-
-function openViewSourceWindow(aURI, aCallback) {
- let viewSourceWindow = openDialog("chrome://global/content/viewSource.xul", null, null, aURI);
- viewSourceWindow.addEventListener("pageshow", function pageShowHandler(event) {
- // Wait for the inner window to load, not viewSourceWindow.
- if (event.target.location == "view-source:" + aURI) {
- info("View source window opened: " + event.target.location);
- viewSourceWindow.removeEventListener("pageshow", pageShowHandler, false);
- aCallback(viewSourceWindow);
- }
- }, false);
-}
-
-function loadViewSourceWindow(URL) {
- return new Promise((resolve) => {
- openViewSourceWindow(URL, resolve);
- })
-}
-
-function closeViewSourceWindow(aWindow, aCallback) {
- Services.wm.addListener({
- onCloseWindow: function() {
- Services.wm.removeListener(this);
- executeSoon(aCallback);
- }
- });
- aWindow.close();
-}
-
-function testViewSourceWindow(aURI, aTestCallback, aCloseCallback) {
- openViewSourceWindow(aURI, function(aWindow) {
- aTestCallback(aWindow);
- closeViewSourceWindow(aWindow, aCloseCallback);
- });
-}
-
-function waitForViewSourceWindow() {
- return new Promise(resolve => {
- let windowListener = {
- onOpenWindow(xulWindow) {
- let win = xulWindow.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindow);
- win.addEventListener("load", function listener() {
- win.removeEventListener("load", listener, false);
- if (win.document.documentElement.getAttribute("windowtype") !=
- WINDOW_TYPE) {
- return;
- }
- // Found the window
- resolve(win);
- Services.wm.removeListener(windowListener);
- }, false);
- },
- onCloseWindow() {},
- onWindowTitleChange() {}
- };
- Services.wm.addListener(windowListener);
- });
-}
-
-/**
- * Opens a view source tab / window for a selection (View Selection Source)
- * within the currently selected browser in gBrowser.
- *
- * @param aCSSSelector - used to specify a node within the selection to
- * view the source of. It is expected that this node is
- * within an existing selection.
- * @returns the new tab / window which shows the source.
- */
-function* openViewPartialSource(aCSSSelector) {
- let contentAreaContextMenuPopup =
- document.getElementById("contentAreaContextMenu");
- let popupShownPromise =
- BrowserTestUtils.waitForEvent(contentAreaContextMenuPopup, "popupshown");
- yield BrowserTestUtils.synthesizeMouseAtCenter(aCSSSelector,
- { type: "contextmenu", button: 2 }, gBrowser.selectedBrowser);
- yield popupShownPromise;
-
- let openPromise;
- if (Services.prefs.getBoolPref("view_source.tab")) {
- openPromise = BrowserTestUtils.waitForNewTab(gBrowser, null);
- } else {
- openPromise = waitForViewSourceWindow();
- }
-
- let popupHiddenPromise =
- BrowserTestUtils.waitForEvent(contentAreaContextMenuPopup, "popuphidden");
- let item = document.getElementById("context-viewpartialsource-selection");
- EventUtils.synthesizeMouseAtCenter(item, {});
- yield popupHiddenPromise;
-
- return (yield openPromise);
-}
-
-/**
- * Opens a view source tab for a frame (View Frame Source) within the
- * currently selected browser in gBrowser.
- *
- * @param aCSSSelector - used to specify the frame to view the source of.
- * @returns the new tab which shows the source.
- */
-function* openViewFrameSourceTab(aCSSSelector) {
- let contentAreaContextMenuPopup =
- document.getElementById("contentAreaContextMenu");
- let popupShownPromise =
- BrowserTestUtils.waitForEvent(contentAreaContextMenuPopup, "popupshown");
- yield BrowserTestUtils.synthesizeMouseAtCenter(aCSSSelector,
- { type: "contextmenu", button: 2 }, gBrowser.selectedBrowser);
- yield popupShownPromise;
-
- let frameContextMenu = document.getElementById("frame");
- popupShownPromise =
- BrowserTestUtils.waitForEvent(frameContextMenu, "popupshown");
- EventUtils.synthesizeMouseAtCenter(frameContextMenu, {});
- yield popupShownPromise;
-
- let newTabPromise = BrowserTestUtils.waitForNewTab(gBrowser, null);
-
- let popupHiddenPromise =
- BrowserTestUtils.waitForEvent(frameContextMenu, "popuphidden");
- let item = document.getElementById("context-viewframesource");
- EventUtils.synthesizeMouseAtCenter(item, {});
- yield popupHiddenPromise;
-
- return (yield newTabPromise);
-}
-
-registerCleanupFunction(function() {
- var windows = Services.wm.getEnumerator(WINDOW_TYPE);
- ok(!windows.hasMoreElements(), "No remaining view source windows still open");
- while (windows.hasMoreElements())
- windows.getNext().close();
-});
-
-/**
- * For a given view source tab / window, wait for the source loading step to
- * complete.
- */
-function waitForSourceLoaded(tabOrWindow) {
- return new Promise(resolve => {
- let mm = tabOrWindow.messageManager ||
- tabOrWindow.linkedBrowser.messageManager;
- mm.addMessageListener("ViewSource:SourceLoaded", function sourceLoaded() {
- mm.removeMessageListener("ViewSource:SourceLoaded", sourceLoaded);
- setTimeout(resolve, 0);
- });
- });
-}
-
-/**
- * Open a new document in a new tab, select part of it, and view the source of
- * that selection. The document is not closed afterwards.
- *
- * @param aURI - url to load
- * @param aCSSSelector - used to specify a node to select. All of this node's
- * children will be selected.
- * @returns the new tab / window which shows the source.
- */
-function* openDocumentSelect(aURI, aCSSSelector) {
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, aURI);
- registerCleanupFunction(function() {
- gBrowser.removeTab(tab);
- });
-
- yield ContentTask.spawn(gBrowser.selectedBrowser, { selector: aCSSSelector }, function* (arg) {
- let element = content.document.querySelector(arg.selector);
- content.getSelection().selectAllChildren(element);
- });
-
- let tabOrWindow = yield openViewPartialSource(aCSSSelector);
-
- // Wait until the source has been loaded.
- yield waitForSourceLoaded(tabOrWindow);
-
- return tabOrWindow;
-}
-
-function pushPrefs(...aPrefs) {
- return new Promise(resolve => {
- SpecialPowers.pushPrefEnv({"set": aPrefs}, resolve);
- });
-}
-
-function waitForPrefChange(pref) {
- let deferred = PromiseUtils.defer();
- let observer = () => {
- Preferences.ignore(pref, observer);
- deferred.resolve();
- };
- Preferences.observe(pref, observer);
- return deferred.promise;
-}
diff --git a/toolkit/components/viewsource/test/chrome.ini b/toolkit/components/viewsource/test/chrome.ini
deleted file mode 100644
index bd013ab6c..000000000
--- a/toolkit/components/viewsource/test/chrome.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[DEFAULT]
-
-[test_bug428653.html]
-support-files = file_empty.html
diff --git a/toolkit/components/viewsource/test/file_empty.html b/toolkit/components/viewsource/test/file_empty.html
deleted file mode 100644
index 495c23ec8..000000000
--- a/toolkit/components/viewsource/test/file_empty.html
+++ /dev/null
@@ -1 +0,0 @@
-<!DOCTYPE html><html><body></body></html>
diff --git a/toolkit/components/viewsource/test/test_bug428653.html b/toolkit/components/viewsource/test/test_bug428653.html
deleted file mode 100644
index b1d48bfb3..000000000
--- a/toolkit/components/viewsource/test/test_bug428653.html
+++ /dev/null
@@ -1,45 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=428653
--->
-<head>
- <title>View Source Test (bug 428653)</title>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
-</head>
-<body>
-
- <iframe id="content" src="http://example.org/tests/toolkit/components/viewsource/test/file_empty.html"></iframe>
-
- <script type="application/javascript">
- /*
- Test that we can't call the content browser's document.open() over Xrays.
- See the security checks in nsHTMLDocument::Open, which make sure that the
- entry global's principal matches that of the document.
- */
- SimpleTest.waitForExplicitFinish();
-
- addLoadEvent(function testDocumentOpen() {
- var browser = document.getElementById("content");
- ok(browser, "got browser");
- var doc = browser.contentDocument;
- ok(doc, "got content document");
-
- var opened = false;
- try {
- doc.open("text/html", "replace");
- opened = true;
- } catch (e) {
- is(e.name, "SecurityError", "Unexpected exception")
- }
- is(opened, false, "Shouldn't have opened document");
-
- doc.wrappedJSObject.open("text/html", "replace");
- ok(true, "Should be able to open document via Xray Waiver");
-
- SimpleTest.finish();
- });
- </script>
-</body>
-</html>
diff --git a/toolkit/components/workerloader/moz.build b/toolkit/components/workerloader/moz.build
index 145f7adc0..f81309dcc 100644
--- a/toolkit/components/workerloader/moz.build
+++ b/toolkit/components/workerloader/moz.build
@@ -4,11 +4,4 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-MOCHITEST_CHROME_MANIFESTS += ['tests/chrome.ini']
-
-EXTRA_JS_MODULES.workers += [
- 'require.js'
-]
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Async Tooling')
+EXTRA_JS_MODULES.workers += ['require.js']
diff --git a/toolkit/components/workerloader/tests/.eslintrc.js b/toolkit/components/workerloader/tests/.eslintrc.js
deleted file mode 100644
index 2c669d844..000000000
--- a/toolkit/components/workerloader/tests/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/workerloader/tests/chrome.ini b/toolkit/components/workerloader/tests/chrome.ini
deleted file mode 100644
index c83a0b081..000000000
--- a/toolkit/components/workerloader/tests/chrome.ini
+++ /dev/null
@@ -1,15 +0,0 @@
-[DEFAULT]
-support-files =
- moduleA-depends.js
- moduleB-dependency.js
- moduleC-circular.js
- moduleD-circular.js
- moduleE-throws-during-require.js
- moduleF-syntax-error.js
- moduleG-throws-later.js
- moduleH-module-dot-exports.js
- utils_mainthread.js
- utils_worker.js
- worker_test_loading.js
-
-[test_loading.xul]
diff --git a/toolkit/components/workerloader/tests/moduleA-depends.js b/toolkit/components/workerloader/tests/moduleA-depends.js
deleted file mode 100644
index 0e1cc7c8b..000000000
--- a/toolkit/components/workerloader/tests/moduleA-depends.js
+++ /dev/null
@@ -1,14 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// A trivial module that depends on an equally trivial module
-var B = require("chrome://mochitests/content/chrome/toolkit/components/workerloader/tests/moduleB-dependency.js");
-
-// Ensure that the initial set of exports is empty
-if (Object.keys(exports).length) {
- throw new Error("exports should be empty, initially");
-}
-
-// Export some values
-exports.A = true;
-exports.importedFoo = B.foo;
diff --git a/toolkit/components/workerloader/tests/moduleB-dependency.js b/toolkit/components/workerloader/tests/moduleB-dependency.js
deleted file mode 100644
index 5c9831fc3..000000000
--- a/toolkit/components/workerloader/tests/moduleB-dependency.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-exports.B = true;
-exports.foo = "foo";
-
-// Side-effect to detect if we attempt to re-execute this module.
-if ("loadedB" in self) {
- throw new Error("B has been evaluted twice");
-}
-self.loadedB = true;
diff --git a/toolkit/components/workerloader/tests/moduleC-circular.js b/toolkit/components/workerloader/tests/moduleC-circular.js
deleted file mode 100644
index 5dc14259a..000000000
--- a/toolkit/components/workerloader/tests/moduleC-circular.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Module C and module D have circular dependencies.
-// This should not prevent from loading them.
-
-// This value is set before any circular dependency, it should be visible
-// in D.
-exports.enteredC = true;
-
-var D = require("chrome://mochitests/content/chrome/toolkit/components/workerloader/tests/moduleD-circular.js");
-
-// The following values are set after importing D.
-// copiedFromD.copiedFromC should have only one field |enteredC|
-exports.copiedFromD = JSON.parse(JSON.stringify(D));
-// exportedFromD.copiedFromC should have all the fields defined in |exports|
-exports.exportedFromD = D;
-exports.finishedC = true;
diff --git a/toolkit/components/workerloader/tests/moduleD-circular.js b/toolkit/components/workerloader/tests/moduleD-circular.js
deleted file mode 100644
index d77bdc74d..000000000
--- a/toolkit/components/workerloader/tests/moduleD-circular.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Module C and module D have circular dependencies.
-// This should not prevent from loading them.
-
-exports.enteredD = true;
-var C = require("chrome://mochitests/content/chrome/toolkit/components/workerloader/tests/moduleC-circular.js");
-exports.copiedFromC = JSON.parse(JSON.stringify(C));
-exports.exportedFromC = C;
-exports.finishedD = true;
diff --git a/toolkit/components/workerloader/tests/moduleE-throws-during-require.js b/toolkit/components/workerloader/tests/moduleE-throws-during-require.js
deleted file mode 100644
index b0be0449f..000000000
--- a/toolkit/components/workerloader/tests/moduleE-throws-during-require.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Skip a few lines
-// 5
-// 6
-// 7
-// 8
-// 9
-throw new Error("Let's see if this error is obtained with the right origin");
diff --git a/toolkit/components/workerloader/tests/moduleF-syntax-error.js b/toolkit/components/workerloader/tests/moduleF-syntax-error.js
deleted file mode 100644
index c03fa32f8..000000000
--- a/toolkit/components/workerloader/tests/moduleF-syntax-error.js
+++ /dev/null
@@ -1,6 +0,0 @@
-<!--
-Any copyright is dedicated to the Public Domain.
-http://creativecommons.org/publicdomain/zero/1.0/
--->
-<?xml version="1.0" encoding="UTF-8" ?>
-<foo>Anything that doesn't parse as JavaScript</foo>
diff --git a/toolkit/components/workerloader/tests/moduleG-throws-later.js b/toolkit/components/workerloader/tests/moduleG-throws-later.js
deleted file mode 100644
index 8a24bc7e4..000000000
--- a/toolkit/components/workerloader/tests/moduleG-throws-later.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// Skip a few lines
-// 5
-// 6
-// 7
-// 8
-// 9
-exports.doThrow = function doThrow() {
- Array.prototype.sort.apply("foo"); // This will raise a native TypeError
-};
diff --git a/toolkit/components/workerloader/tests/moduleH-module-dot-exports.js b/toolkit/components/workerloader/tests/moduleH-module-dot-exports.js
deleted file mode 100644
index a6b93bbcc..000000000
--- a/toolkit/components/workerloader/tests/moduleH-module-dot-exports.js
+++ /dev/null
@@ -1,12 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// This should be overwritten by module.exports
-exports.key = "wrong value";
-
-module.exports = {
- key: "value"
-};
-
-// This should also be overwritten by module.exports
-exports.key = "another wrong value";
diff --git a/toolkit/components/workerloader/tests/test_loading.xul b/toolkit/components/workerloader/tests/test_loading.xul
deleted file mode 100644
index 2744270e1..000000000
--- a/toolkit/components/workerloader/tests/test_loading.xul
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
--->
-<window title="Testing the worker loader"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="test();">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
- <script type="application/javascript"
- src="utils_mainthread.js"/>
- <script type="application/javascript">
- <![CDATA[
-
-let worker;
-let main = this;
-
-function test() {
- info("Starting test " + document.uri);
-
- worker = new ChromeWorker("worker_test_loading.js");
- SimpleTest.waitForExplicitFinish();
- info("Chrome worker created");
- worker_handler(worker);
- worker.postMessage(document.uri);
- ok(true, "Test in progress");
-};
-]]>
- </script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display:none;"></div>
- <pre id="test"></pre>
- </body>
- <label id="test-result"/>
-</window>
diff --git a/toolkit/components/workerloader/tests/utils_mainthread.js b/toolkit/components/workerloader/tests/utils_mainthread.js
deleted file mode 100644
index 148591c3d..000000000
--- a/toolkit/components/workerloader/tests/utils_mainthread.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function worker_handler(worker) {
- worker.onerror = function(error) {
- error.preventDefault();
- ok(false, "error "+ error.message);
- };
- worker.onmessage = function(msg) {
-// ok(true, "MAIN: onmessage " + JSON.stringify(msg.data));
- switch (msg.data.kind) {
- case "is":
- SimpleTest.ok(msg.data.outcome, msg.data.description +
- "( "+ msg.data.a + " ==? " + msg.data.b + ")" );
- return;
- case "isnot":
- SimpleTest.ok(msg.data.outcome, msg.data.description +
- "( "+ msg.data.a + " !=? " + msg.data.b + ")" );
- return;
- case "ok":
- SimpleTest.ok(msg.data.condition, msg.data.description);
- return;
- case "info":
- SimpleTest.info(msg.data.description);
- return;
- case "finish":
- SimpleTest.finish();
- return;
- default:
- SimpleTest.ok(false, "test_osfile.xul: wrong message " + JSON.stringify(msg.data));
- return;
- }
- };
-}
diff --git a/toolkit/components/workerloader/tests/utils_worker.js b/toolkit/components/workerloader/tests/utils_worker.js
deleted file mode 100644
index da82d4b0a..000000000
--- a/toolkit/components/workerloader/tests/utils_worker.js
+++ /dev/null
@@ -1,32 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function log(text) {
- dump("WORKER " + text + "\n");
-}
-
-function send(message) {
- self.postMessage(message);
-}
-
-function finish() {
- send({kind: "finish"});
-}
-
-function ok(condition, description) {
- send({kind: "ok", condition: !!condition, description: "" + description});
-}
-
-function is(a, b, description) {
- let outcome = a == b; // Need to decide outcome here, as not everything can be serialized
- send({kind: "is", outcome: outcome, description: "" + description, a: "" + a, b: "" + b});
-}
-
-function isnot(a, b, description) {
- let outcome = a != b; // Need to decide outcome here, as not everything can be serialized
- send({kind: "isnot", outcome: outcome, description: "" + description, a: "" + a, b: "" + b});
-}
-
-function info(description) {
- send({kind: "info", description: "" + description});
-}
diff --git a/toolkit/components/workerloader/tests/worker_handler.js b/toolkit/components/workerloader/tests/worker_handler.js
deleted file mode 100644
index b09b8c34c..000000000
--- a/toolkit/components/workerloader/tests/worker_handler.js
+++ /dev/null
@@ -1,34 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-function worker_handler(worker) {
- worker.onerror = function(error) {
- error.preventDefault();
- ok(false, "error "+error);
- }
- worker.onmessage = function(msg) {
- ok(true, "MAIN: onmessage " + JSON.stringify(msg.data));
- switch (msg.data.kind) {
- case "is":
- SimpleTest.ok(msg.data.outcome, msg.data.description +
- "( "+ msg.data.a + " ==? " + msg.data.b + ")" );
- return;
- case "isnot":
- SimpleTest.ok(msg.data.outcome, msg.data.description +
- "( "+ msg.data.a + " !=? " + msg.data.b + ")" );
- return;
- case "ok":
- SimpleTest.ok(msg.data.condition, msg.data.description);
- return;
- case "info":
- SimpleTest.info(msg.data.description);
- return;
- case "finish":
- SimpleTest.finish();
- return;
- default:
- SimpleTest.ok(false, "test_osfile.xul: wrong message " + JSON.stringify(msg.data));
- return;
- }
- };
-}
diff --git a/toolkit/components/workerloader/tests/worker_test_loading.js b/toolkit/components/workerloader/tests/worker_test_loading.js
deleted file mode 100644
index 40702e4e1..000000000
--- a/toolkit/components/workerloader/tests/worker_test_loading.js
+++ /dev/null
@@ -1,121 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-importScripts("utils_worker.js"); // Test suite code
-info("Test suite configured");
-
-importScripts("resource://gre/modules/workers/require.js");
-info("Loader imported");
-
-var PATH = "chrome://mochitests/content/chrome/toolkit/components/workerloader/tests/";
-var tests = [];
-var add_test = function(test) {
- tests.push(test);
-};
-
-add_test(function test_setup() {
- ok(typeof require != "undefined", "Function |require| is defined");
-});
-
-// Test simple loading (moduleA-depends.js requires moduleB-dependency.js)
-add_test(function test_load() {
- let A = require(PATH + "moduleA-depends.js");
- ok(true, "Opened module A");
-
- is(A.A, true, "Module A exported value A");
- ok(!("B" in A), "Module A did not export value B");
- is(A.importedFoo, "foo", "Module A re-exported B.foo");
-
- // re-evaluating moduleB-dependency.js would cause an error, but re-requiring it shouldn't
- let B = require(PATH + "moduleB-dependency.js");
- ok(true, "Managed to re-require module B");
- is(B.B, true, "Module B exported value B");
- is(B.foo, "foo", "Module B exported value foo");
-});
-
-// Test simple circular loading (moduleC-circular.js and moduleD-circular.js require each other)
-add_test(function test_circular() {
- let C = require(PATH + "moduleC-circular.js");
- ok(true, "Loaded circular modules C and D");
- is(C.copiedFromD.copiedFromC.enteredC, true, "Properties exported by C before requiring D can be seen by D immediately");
-
- let D = require(PATH + "moduleD-circular.js");
- is(D.exportedFromC.finishedC, true, "Properties exported by C after requiring D can be seen by D eventually");
-});
-
-// Testing error cases
-add_test(function test_exceptions() {
- let should_throw = function(f) {
- try {
- f();
- return null;
- } catch (ex) {
- return ex;
- }
- };
-
- let exn = should_throw(() => require(PATH + "this module doesn't exist"));
- ok(!!exn, "Attempting to load a module that doesn't exist raises an error");
-
- exn = should_throw(() => require(PATH + "moduleE-throws-during-require.js"));
- ok(!!exn, "Attempting to load a module that throws at toplevel raises an error");
- is(exn.moduleName, PATH + "moduleE-throws-during-require.js",
- "moduleName is correct");
- isnot(exn.moduleStack.indexOf("moduleE-throws-during-require.js"), -1,
- "moduleStack contains the name of the module");
- is(exn.lineNumber, 10, "The error comes with the right line number");
-
- exn = should_throw(() => require(PATH + "moduleF-syntaxerror.xml"));
- ok(!!exn, "Attempting to load a non-well formatted module raises an error");
-
- exn = should_throw(() => require(PATH + "moduleG-throws-later.js").doThrow());
- ok(!!exn, "G.doThrow() has raised an error");
- info(exn);
- ok(exn.toString().startsWith("TypeError"), "The exception is a TypeError.");
- is(exn.moduleName, PATH + "moduleG-throws-later.js", "The name of the module is correct");
- isnot(exn.moduleStack.indexOf("moduleG-throws-later.js"), -1,
- "The name of the right file appears somewhere in the stack");
- is(exn.lineNumber, 11, "The error comes with the right line number");
-});
-
-function get_exn(f) {
- try {
- f();
- return undefined;
- } catch (ex) {
- return ex;
- }
-}
-
-// Test module.exports
-add_test(function test_module_dot_exports() {
- let H = require(PATH + "moduleH-module-dot-exports.js");
- is(H.key, "value", "module.exports worked");
- let H2 = require(PATH + "moduleH-module-dot-exports.js");
- is(H2.key, "value", "module.exports returned the same key");
- ok(H2 === H, "module.exports returned the same module the second time");
- let exn = get_exn(() => H.key = "this should not be accepted");
- ok(exn instanceof TypeError, "Cannot alter value in module.exports after export");
- exn = get_exn(() => H.key2 = "this should not be accepted, either");
- ok(exn instanceof TypeError, "Cannot add value to module.exports after export");
-});
-
-self.onmessage = function(message) {
- for (let test of tests) {
- info("Entering " + test.name);
- try {
- test();
- } catch (ex) {
- ok(false, "Test " + test.name + " failed");
- info(ex);
- info(ex.stack);
- }
- info("Leaving " + test.name);
- }
- finish();
-};
-
-
-
diff --git a/toolkit/components/xulstore/moz.build b/toolkit/components/xulstore/moz.build
index 30559fccb..4ee7a5d27 100644
--- a/toolkit/components/xulstore/moz.build
+++ b/toolkit/components/xulstore/moz.build
@@ -4,12 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-MOCHITEST_CHROME_MANIFESTS += ['tests/chrome/chrome.ini']
-XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
-
-XPIDL_SOURCES += [
- 'nsIXULStore.idl',
-]
+XPIDL_SOURCES += ['nsIXULStore.idl']
XPIDL_MODULE = 'toolkit_xulstore'
diff --git a/toolkit/components/xulstore/tests/chrome/.eslintrc.js b/toolkit/components/xulstore/tests/chrome/.eslintrc.js
deleted file mode 100644
index 8c0f4f574..000000000
--- a/toolkit/components/xulstore/tests/chrome/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/xulstore/tests/chrome/animals.rdf b/toolkit/components/xulstore/tests/chrome/animals.rdf
deleted file mode 100644
index c7319e641..000000000
--- a/toolkit/components/xulstore/tests/chrome/animals.rdf
+++ /dev/null
@@ -1,142 +0,0 @@
-<?xml version="1.0"?>
-
-<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:NC="http://home.netscape.com/NC-rdf#"
- xmlns:ANIMALS="http://www.some-fictitious-zoo.com/rdf#">
-
- <ANIMALS:Class RDF:about="http://www.some-fictitious-zoo.com/arachnids">
- <ANIMALS:name>Arachnids</ANIMALS:name>
- </ANIMALS:Class>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/arachnids/tarantula">
- <ANIMALS:name>Tarantula</ANIMALS:name>
- </RDF:Description>
-
- <ANIMALS:Class RDF:about="http://www.some-fictitious-zoo.com/birds">
- <ANIMALS:name>Birds</ANIMALS:name>
- </ANIMALS:Class>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/birds/emu">
- <ANIMALS:name>Emu</ANIMALS:name>
- </RDF:Description>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/birds/barnowl">
- <ANIMALS:name>Barn Owl</ANIMALS:name>
- </RDF:Description>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/birds/raven">
- <ANIMALS:name>Raven</ANIMALS:name>
- </RDF:Description>
-
- <ANIMALS:Class RDF:about="http://www.some-fictitious-zoo.com/crustaceans">
- <ANIMALS:name>Crustaceans</ANIMALS:name>
- </ANIMALS:Class>
-
- <ANIMALS:Class RDF:about="http://www.some-fictitious-zoo.com/fish">
- <ANIMALS:name>Fish</ANIMALS:name>
- </ANIMALS:Class>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/fish/cod">
- <ANIMALS:name>Cod</ANIMALS:name>
- </RDF:Description>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/fish/swordfish">
- <ANIMALS:name>Swordfish</ANIMALS:name>
- </RDF:Description>
-
- <ANIMALS:Class RDF:about="http://www.some-fictitious-zoo.com/mammals">
- <ANIMALS:name>Mammals</ANIMALS:name>
- </ANIMALS:Class>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/lion">
- <ANIMALS:name>Lion</ANIMALS:name>
- </RDF:Description>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/hippopotamus">
- <ANIMALS:name>HIPPOPOTAMUS</ANIMALS:name>
- </RDF:Description>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/africanelephant">
- <ANIMALS:name>African Elephant</ANIMALS:name>
- </RDF:Description>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/llama">
- <ANIMALS:name>LLAMA</ANIMALS:name>
- </RDF:Description>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/polarbear">
- <ANIMALS:name>Polar Bear</ANIMALS:name>
- </RDF:Description>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/aardvark">
- <ANIMALS:name>aardvark</ANIMALS:name>
- </RDF:Description>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/ninebandedarmadillo">
- <ANIMALS:name>Nine-banded Armadillo</ANIMALS:name>
- </RDF:Description>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/mammals/gorilla">
- <ANIMALS:name>Gorilla</ANIMALS:name>
- </RDF:Description>
-
- <ANIMALS:Class RDF:about="http://www.some-fictitious-zoo.com/reptiles">
- <ANIMALS:name>Reptiles</ANIMALS:name>
- </ANIMALS:Class>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/reptiles/anaconda">
- <ANIMALS:name>Anaconda</ANIMALS:name>
- </RDF:Description>
-
- <RDF:Description RDF:about="http://www.some-fictitious-zoo.com/reptiles/chameleon">
- <ANIMALS:name>Chameleon</ANIMALS:name>
- </RDF:Description>
-
- <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/some-animals" ANIMALS:name="Zoo Animals">
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/arachnids"/>
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/birds"/>
- </RDF:Seq>
-
- <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/all-animals" ANIMALS:name="Zoo Animals">
- <RDF:li>
- <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/arachnids">
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/arachnids/tarantula"/>
- </RDF:Seq>
- </RDF:li>
- <RDF:li>
- <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/birds">
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/birds/emu"/>
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/birds/barnowl"/>
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/birds/raven"/>
- </RDF:Seq>
- </RDF:li>
- <RDF:li>
- <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/crustaceans"/>
- </RDF:li>
- <RDF:li>
- <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/fish">
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/fish/cod"/>
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/fish/swordfish"/>
- </RDF:Seq>
- </RDF:li>
- <RDF:li>
- <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/mammals">
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/lion"/>
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/hippopotamus"/>
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/africanelephant"/>
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/llama"/>
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/polarbear"/>
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/aardvark"/>
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/ninebandedarmadillo"/>
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/mammals/gorilla"/>
- </RDF:Seq>
- </RDF:li>
- <RDF:li>
- <RDF:Seq RDF:about="http://www.some-fictitious-zoo.com/reptiles">
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/reptiles/anaconda"/>
- <RDF:li RDF:resource="http://www.some-fictitious-zoo.com/reptiles/chameleon"/>
- </RDF:Seq>
- </RDF:li>
- </RDF:Seq>
-
-</RDF:RDF>
diff --git a/toolkit/components/xulstore/tests/chrome/chrome.ini b/toolkit/components/xulstore/tests/chrome/chrome.ini
deleted file mode 100644
index 91efd5455..000000000
--- a/toolkit/components/xulstore/tests/chrome/chrome.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-support-files =
- window_persistence.xul
- animals.rdf
-
-[test_persistence.xul]
diff --git a/toolkit/components/xulstore/tests/chrome/test_persistence.xul b/toolkit/components/xulstore/tests/chrome/test_persistence.xul
deleted file mode 100644
index 736a067ed..000000000
--- a/toolkit/components/xulstore/tests/chrome/test_persistence.xul
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Persistence Tests"
- onload="runTest()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <script>
- SimpleTest.waitForExplicitFinish();
- function runTest() {
- window.openDialog("window_persistence.xul", "_blank", "chrome", true);
- }
-
- function windowOpened() {
- window.openDialog("window_persistence.xul", "_blank", "chrome", false);
- }
-
- function testDone() {
- SimpleTest.finish();
- }
- </script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"/>
-</body>
-
-</window>
diff --git a/toolkit/components/xulstore/tests/chrome/window_persistence.xul b/toolkit/components/xulstore/tests/chrome/window_persistence.xul
deleted file mode 100644
index 4d76fe11d..000000000
--- a/toolkit/components/xulstore/tests/chrome/window_persistence.xul
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Persistence Tests"
- onload="opened()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- persist="screenX screenY width height">
-
-<button id="button1" label="Button1" persist="value"/>
-<button id="button2" label="Button2" value="Normal" persist="value"/>
-
-<tree id="tree" datasources="animals.rdf" ref="http://www.some-fictitious-zoo.com/all-animals"
- flags="dont-build-content" width="200" height="200">
- <treecols orient="horizontal" id="treecols">
- <treecol id="treecol" primary="true" label="Name" flex="1"/>
- </treecols>
- <template id="template">
- <treechildren>
- <treeitem uri="rdf:*">
- <treerow>
- <treecell label="rdf:http://www.some-fictitious-zoo.com/rdf#name"/>
- <treecell/>
- </treerow>
- </treeitem>
- </treechildren>
- </template>
-</tree>
-
-<script>
-<![CDATA[
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-
-let XULStore = Cc["@mozilla.org/xul/xulstore;1"].getService(Ci.nsIXULStore);
-let URI = "chrome://mochitests/content/chrome/toolkit/components/xulstore/tests/chrome/window_persistence.xul";
-
-function opened()
-{
- // If the data in the tree has not been loaded yet, wait a bit and try again.
- var treeView = document.getElementById("tree").view;
- if (treeView.rowCount != 6 && treeView.rowCount != 17) {
- setTimeout(opened, 50);
- return;
- }
-
- runTest(treeView);
-}
-
-function runTest(treeView)
-{
- var firstRun = window.arguments[0];
- if (firstRun) {
- document.getElementById("button1").setAttribute("value", "Pressed");
- document.getElementById("button2").removeAttribute("value");
-
- document.getElementById("button2").setAttribute("foo", "bar");
- document.persist("button2", "foo");
- is(XULStore.getValue(URI, "button2", "foo"), "bar", "attribute persisted")
- document.getElementById("button2").removeAttribute("foo");
- document.persist("button2", "foo");
- is(XULStore.hasValue(URI, "button2", "foo"), false, "attribute removed")
-
- is(treeView.rowCount, 6, "tree rows are closed");
- treeView.toggleOpenState(1);
- treeView.toggleOpenState(7);
-
- window.close();
- window.opener.windowOpened();
- }
- else {
- is(document.getElementById("button1").getAttribute("value"), "Pressed",
- "Attribute set");
- is(document.getElementById("button2").hasAttribute("value"), true,
- "Attribute cleared");
- is(document.getElementById("button2").getAttribute("value"), "",
- "Attribute cleared");
- is(document.getElementById("button2").hasAttribute("foo"), false,
- "Attribute cleared");
- is(document.getElementById("button2").getAttribute("foo"), "",
- "Attribute cleared");
-
- is(treeView.rowCount, 17, "tree rows are open");
- is(treeView.isContainerOpen(0), false, "first closed row");
- is(treeView.isContainerOpen(1), true, "first open row");
- is(treeView.isContainerOpen(7), true, "second open row");
-
- window.close();
- window.opener.testDone();
- }
-}
-
-function is(l, r, n) { window.opener.wrappedJSObject.SimpleTest.is(l,r,n); }
-
-]]></script>
-
-</window>
diff --git a/toolkit/components/xulstore/tests/xpcshell/.eslintrc.js b/toolkit/components/xulstore/tests/xpcshell/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/components/xulstore/tests/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/components/xulstore/tests/xpcshell/localstore.rdf b/toolkit/components/xulstore/tests/xpcshell/localstore.rdf
deleted file mode 100644
index 458eb50ea..000000000
--- a/toolkit/components/xulstore/tests/xpcshell/localstore.rdf
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<RDF:RDF xmlns:NC="http://home.netscape.com/NC-rdf#"
- xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
- <RDF:Description RDF:about="chrome://browser/content/browser.xul#sidebar-title"
- value="" />
- <RDF:Description RDF:about="about:config#prefCol"
- ordinal="1"
- sortDirection="ascending" />
- <RDF:Description RDF:about="chrome://browser/content/browser.xul#addon-bar"
- collapsed="true" />
- <RDF:Description RDF:about="about:config">
- <NC:persist RDF:resource="about:config#prefCol"/>
- <NC:persist RDF:resource="about:config#lockCol"/>
- <NC:persist RDF:resource="about:config#typeCol"/>
- <NC:persist RDF:resource="about:config#valueCol"/>
- </RDF:Description>
- <RDF:Description RDF:about="about:config#lockCol"
- ordinal="3" />
- <RDF:Description RDF:about="chrome://browser/content/browser.xul">
- <NC:persist RDF:resource="chrome://browser/content/browser.xul#main-window"/>
- <NC:persist RDF:resource="chrome://browser/content/browser.xul#addon-bar"/>
- <NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-box"/>
- <NC:persist RDF:resource="chrome://browser/content/browser.xul#sidebar-title"/>
- </RDF:Description>
- <RDF:Description RDF:about="chrome://browser/content/browser.xul#main-window"
- width="994"
- height="768"
- screenX="4"
- screenY="22"
- sizemode="normal" />
-</RDF:RDF>
diff --git a/toolkit/components/xulstore/tests/xpcshell/test_XULStore.js b/toolkit/components/xulstore/tests/xpcshell/test_XULStore.js
deleted file mode 100644
index c3c96654b..000000000
--- a/toolkit/components/xulstore/tests/xpcshell/test_XULStore.js
+++ /dev/null
@@ -1,199 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/â—¦
-*/
-
-"use strict"
-
-const Cc = Components.classes;
-const Ci = Components.interfaces;
-const Cu = Components.utils;
-const Cr = Components.results;
-
-Cu.import("resource://gre/modules/osfile.jsm")
-
-var XULStore = null;
-var browserURI = "chrome://browser/content/browser.xul";
-var aboutURI = "about:config";
-
-function run_test() {
- do_get_profile();
- run_next_test();
-}
-
-function checkValue(uri, id, attr, reference) {
- let value = XULStore.getValue(uri, id, attr);
- do_check_true(value === reference);
-}
-
-function checkValueExists(uri, id, attr, exists) {
- do_check_eq(XULStore.hasValue(uri, id, attr), exists);
-}
-
-function getIDs(uri) {
- let it = XULStore.getIDsEnumerator(uri);
- let result = [];
-
- while (it.hasMore()) {
- let value = it.getNext();
- result.push(value);
- }
-
- result.sort();
- return result;
-}
-
-function getAttributes(uri, id) {
- let it = XULStore.getAttributeEnumerator(uri, id);
-
- let result = [];
-
- while (it.hasMore()) {
- let value = it.getNext();
- result.push(value);
- }
-
- result.sort();
- return result;
-}
-
-function checkArrays(a, b) {
- a.sort();
- b.sort();
- do_check_true(a.toString() == b.toString());
-}
-
-function checkOldStore() {
- checkArrays(['addon-bar', 'main-window', 'sidebar-title'], getIDs(browserURI));
- checkArrays(['collapsed'], getAttributes(browserURI, 'addon-bar'));
- checkArrays(['height', 'screenX', 'screenY', 'sizemode', 'width'],
- getAttributes(browserURI, 'main-window'));
- checkArrays(['value'], getAttributes(browserURI, 'sidebar-title'));
-
- checkValue(browserURI, "addon-bar", "collapsed", "true");
- checkValue(browserURI, "main-window", "width", "994");
- checkValue(browserURI, "main-window", "height", "768");
- checkValue(browserURI, "main-window", "screenX", "4");
- checkValue(browserURI, "main-window", "screenY", "22");
- checkValue(browserURI, "main-window", "sizemode", "normal");
- checkValue(browserURI, "sidebar-title", "value", "");
-
- checkArrays(['lockCol', 'prefCol'], getIDs(aboutURI));
- checkArrays(['ordinal'], getAttributes(aboutURI, 'lockCol'));
- checkArrays(['ordinal', 'sortDirection'], getAttributes(aboutURI, 'prefCol'));
-
- checkValue(aboutURI, "prefCol", "ordinal", "1");
- checkValue(aboutURI, "prefCol", "sortDirection", "ascending");
- checkValue(aboutURI, "lockCol", "ordinal", "3");
-}
-
-add_task(function* testImport() {
- let src = "localstore.rdf";
- let dst = OS.Path.join(OS.Constants.Path.profileDir, src);
-
- yield OS.File.copy(src, dst);
-
- // Importing relies on XULStore not yet being loaded before this point.
- XULStore = Cc["@mozilla.org/xul/xulstore;1"].getService(Ci.nsIXULStore);
- checkOldStore();
-});
-
-add_task(function* testTruncation() {
- let dos = Array(8192).join("~");
- // Long id names should trigger an exception
- Assert.throws(() => XULStore.setValue(browserURI, dos, "foo", "foo"), /NS_ERROR_ILLEGAL_VALUE/);
-
- // Long attr names should trigger an exception
- Assert.throws(() => XULStore.setValue(browserURI, "foo", dos, "foo"), /NS_ERROR_ILLEGAL_VALUE/);
-
- // Long values should be truncated
- XULStore.setValue(browserURI, "dos", "dos", dos);
- dos =XULStore.getValue(browserURI, "dos", "dos");
- do_check_true(dos.length == 4096)
- XULStore.removeValue(browserURI, "dos", "dos")
-});
-
-add_task(function* testGetValue() {
- // Get non-existing property
- checkValue(browserURI, "side-window", "height", "");
-
- // Get existing property
- checkValue(browserURI, "main-window", "width", "994");
-});
-
-add_task(function* testHasValue() {
- // Check non-existing property
- checkValueExists(browserURI, "side-window", "height", false);
-
- // Check existing property
- checkValueExists(browserURI, "main-window", "width", true);
-});
-
-add_task(function* testSetValue() {
- // Set new attribute
- checkValue(browserURI, "side-bar", "width", "");
- XULStore.setValue(browserURI, "side-bar", "width", "1000");
- checkValue(browserURI, "side-bar", "width", "1000");
- checkArrays(["addon-bar", "main-window", "side-bar", "sidebar-title"], getIDs(browserURI));
- checkArrays(["width"], getAttributes(browserURI, 'side-bar'));
-
- // Modify existing property
- checkValue(browserURI, "side-bar", "width", "1000");
- XULStore.setValue(browserURI, "side-bar", "width", "1024");
- checkValue(browserURI, "side-bar", "width", "1024");
- checkArrays(["addon-bar", "main-window", "side-bar", "sidebar-title"], getIDs(browserURI));
- checkArrays(["width"], getAttributes(browserURI, 'side-bar'));
-
- // Add another attribute
- checkValue(browserURI, "side-bar", "height", "");
- XULStore.setValue(browserURI, "side-bar", "height", "1000");
- checkValue(browserURI, "side-bar", "height", "1000");
- checkArrays(["addon-bar", "main-window", "side-bar", "sidebar-title"], getIDs(browserURI));
- checkArrays(["width", "height"], getAttributes(browserURI, 'side-bar'));
-});
-
-add_task(function* testRemoveValue() {
- // Remove first attribute
- checkValue(browserURI, "side-bar", "width", "1024");
- XULStore.removeValue(browserURI, "side-bar", "width");
- checkValue(browserURI, "side-bar", "width", "");
- checkValueExists(browserURI, "side-bar", "width", false);
- checkArrays(["addon-bar", "main-window", "side-bar", "sidebar-title"], getIDs(browserURI));
- checkArrays(["height"], getAttributes(browserURI, 'side-bar'));
-
- // Remove second attribute
- checkValue(browserURI, "side-bar", "height", "1000");
- XULStore.removeValue(browserURI, "side-bar", "height");
- checkValue(browserURI, "side-bar", "height", "");
- checkArrays(["addon-bar", "main-window", "sidebar-title"], getIDs(browserURI));
-
- // Removing an attribute that doesn't exists shouldn't fail
- XULStore.removeValue(browserURI, "main-window", "bar");
-
- // Removing from an id that doesn't exists shouldn't fail
- XULStore.removeValue(browserURI, "foo", "bar");
-
- // Removing from a document that doesn't exists shouldn't fail
- let nonDocURI = "chrome://example/content/other.xul";
- XULStore.removeValue(nonDocURI, "foo", "bar");
-
- // Remove all attributes in browserURI
- XULStore.removeValue(browserURI, "addon-bar", "collapsed");
- checkArrays([], getAttributes(browserURI, "addon-bar"));
- XULStore.removeValue(browserURI, "main-window", "width");
- XULStore.removeValue(browserURI, "main-window", "height");
- XULStore.removeValue(browserURI, "main-window", "screenX");
- XULStore.removeValue(browserURI, "main-window", "screenY");
- XULStore.removeValue(browserURI, "main-window", "sizemode");
- checkArrays([], getAttributes(browserURI, "main-window"));
- XULStore.removeValue(browserURI, "sidebar-title", "value");
- checkArrays([], getAttributes(browserURI, "sidebar-title"));
- checkArrays([], getIDs(browserURI));
-
- // Remove all attributes in aboutURI
- XULStore.removeValue(aboutURI, "prefCol", "ordinal");
- XULStore.removeValue(aboutURI, "prefCol", "sortDirection");
- checkArrays([], getAttributes(aboutURI, "prefCol"));
- XULStore.removeValue(aboutURI, "lockCol", "ordinal");
- checkArrays([], getAttributes(aboutURI, "lockCol"));
- checkArrays([], getIDs(aboutURI));
-});
diff --git a/toolkit/components/xulstore/tests/xpcshell/xpcshell.ini b/toolkit/components/xulstore/tests/xpcshell/xpcshell.ini
deleted file mode 100644
index d483dae02..000000000
--- a/toolkit/components/xulstore/tests/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,6 +0,0 @@
-[DEFAULT]
-skip-if = toolkit == 'android'
-support-files =
- localstore.rdf
-
-[test_XULStore.js]
diff --git a/toolkit/content/aboutProfiles.js b/toolkit/content/aboutProfiles.js
index cddf88819..29c5f67ad 100644
--- a/toolkit/content/aboutProfiles.js
+++ b/toolkit/content/aboutProfiles.js
@@ -8,7 +8,6 @@ const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import('resource://gre/modules/Services.jsm');
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
-Cu.import('resource://gre/modules/AppConstants.jsm');
XPCOMUtils.defineLazyServiceGetter(
this,
@@ -130,12 +129,13 @@ function display(profileData) {
if (dir) {
td.appendChild(document.createTextNode(' '));
let button = document.createElement('button');
+#ifdef XP_WIN
+ let string = 'winOpenDir2';
+#elifdef XP_MACOSX
+ let string = 'macOpenDir';
+#else
let string = 'openDir';
- if (AppConstants.platform == "win") {
- string = 'winOpenDir2';
- } else if (AppConstants.platform == "macosx") {
- string = 'macOpenDir';
- }
+#endif
let buttonText = document.createTextNode(bundle.GetStringFromName(string));
button.appendChild(buttonText);
td.appendChild(button);
diff --git a/toolkit/content/aboutSupport.js b/toolkit/content/aboutSupport.js
index 5c889c18f..f9a0abcb0 100644
--- a/toolkit/content/aboutSupport.js
+++ b/toolkit/content/aboutSupport.js
@@ -10,7 +10,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Troubleshoot.jsm");
Cu.import("resource://gre/modules/ResetProfile.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
@@ -42,7 +41,7 @@ var snapshotFormatters = {
$("os-box").textContent = data.osVersion;
$("binary-box").textContent = Services.dirsvc.get("XREExeF", Ci.nsIFile).path;
$("supportLink").href = data.supportURL;
- let version = AppConstants.MOZ_APP_VERSION_DISPLAY;
+ let version = Services.appinfo.version;
if (data.versionArch) {
version += " (" + data.versionArch + ")";
}
@@ -197,23 +196,23 @@ var snapshotFormatters = {
delete data.info;
}
- if (AppConstants.NIGHTLY_BUILD) {
- let windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils);
- let gpuProcessPid = windowUtils.gpuProcessPid;
+#ifdef NIGHTLY_BUILD
+ let windowUtils = window.QueryInterface(Ci.nsIInterfaceRequestor)
+ .getInterface(Ci.nsIDOMWindowUtils);
+ let gpuProcessPid = windowUtils.gpuProcessPid;
- if (gpuProcessPid != -1) {
- let gpuProcessKillButton = $.new("button");
+ if (gpuProcessPid != -1) {
+ let gpuProcessKillButton = $.new("button");
- gpuProcessKillButton.addEventListener("click", function() {
- windowUtils.terminateGPUProcess();
- });
+ gpuProcessKillButton.addEventListener("click", function() {
+ windowUtils.terminateGPUProcess();
+ });
- gpuProcessKillButton.textContent = strings.GetStringFromName("gpuProcessKillButton");
- addRow("diagnostics", "GPUProcessPid", gpuProcessPid);
- addRow("diagnostics", "GPUProcess", [gpuProcessKillButton]);
- }
+ gpuProcessKillButton.textContent = strings.GetStringFromName("gpuProcessKillButton");
+ addRow("diagnostics", "GPUProcessPid", gpuProcessPid);
+ addRow("diagnostics", "GPUProcess", [gpuProcessKillButton]);
}
+#endif
// graphics-failures-tbody tbody
if ("failures" in data) {
@@ -565,42 +564,6 @@ function sortedArrayFromObject(obj) {
return tuples;
}
-function copyRawDataToClipboard(button) {
- if (button)
- button.disabled = true;
- try {
- Troubleshoot.snapshot(function (snapshot) {
- if (button)
- button.disabled = false;
- let str = Cc["@mozilla.org/supports-string;1"].
- createInstance(Ci.nsISupportsString);
- str.data = JSON.stringify(snapshot, undefined, 2);
- let transferable = Cc["@mozilla.org/widget/transferable;1"].
- createInstance(Ci.nsITransferable);
- transferable.init(getLoadContext());
- transferable.addDataFlavor("text/unicode");
- transferable.setTransferData("text/unicode", str, str.data.length * 2);
- Cc["@mozilla.org/widget/clipboard;1"].
- getService(Ci.nsIClipboard).
- setData(transferable, null, Ci.nsIClipboard.kGlobalClipboard);
- if (AppConstants.platform == "android") {
- // Present a toast notification.
- let message = {
- type: "Toast:Show",
- message: stringBundle().GetStringFromName("rawDataCopied"),
- duration: "short"
- };
- Services.androidBridge.handleGeckoMessage(message);
- }
- });
- }
- catch (err) {
- if (button)
- button.disabled = false;
- throw err;
- }
-}
-
function getLoadContext() {
return window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
@@ -636,16 +599,6 @@ function copyContentsToClipboard() {
let clipboard = Cc["@mozilla.org/widget/clipboard;1"]
.getService(Ci.nsIClipboard);
clipboard.setData(transferable, null, clipboard.kGlobalClipboard);
-
- if (AppConstants.platform == "android") {
- // Present a toast notification.
- let message = {
- type: "Toast:Show",
- message: stringBundle().GetStringFromName("textCopied"),
- duration: "short"
- };
- Services.androidBridge.handleGeckoMessage(message);
- }
}
// Return the plain text representation of an element. Do a little bit
@@ -654,10 +607,10 @@ function createTextForElement(elem) {
let serializer = new Serializer();
let text = serializer.serialize(elem);
+#ifdef XP_WIN
// Actual CR/LF pairs are needed for some Windows text editors.
- if (AppConstants.platform == "win") {
- text = text.replace(/\n/g, "\r\n");
- }
+ text = text.replace(/\n/g, "\r\n");
+#endif
return text;
}
@@ -913,9 +866,6 @@ function setupEventListeners() {
$("reset-box-button").addEventListener("click", function(event) {
ResetProfile.openConfirmationDialog(window);
});
- $("copy-raw-data-to-clipboard").addEventListener("click", function(event) {
- copyRawDataToClipboard(this);
- });
$("copy-to-clipboard").addEventListener("click", function(event) {
copyContentsToClipboard();
});
diff --git a/toolkit/content/aboutSupport.xhtml b/toolkit/content/aboutSupport.xhtml
index fff86dff6..8afee1867 100644
--- a/toolkit/content/aboutSupport.xhtml
+++ b/toolkit/content/aboutSupport.xhtml
@@ -61,9 +61,6 @@
</div>
<div>
- <button id="copy-raw-data-to-clipboard">
- &aboutSupport.copyRawDataToClipboard.label;
- </button>
<button id="copy-to-clipboard">
&aboutSupport.copyTextToClipboard.label;
</button>
@@ -104,7 +101,6 @@
<td id="buildid-box"></td>
</tr>
-#ifndef ANDROID
#ifdef MOZ_UPDATER
<tr class="no-copy">
<th class="column">
@@ -118,7 +114,6 @@
</td>
</tr>
#endif
-#endif
#ifdef MOZ_UPDATER
<tr>
@@ -243,7 +238,6 @@
</td>
</tr>
-#ifndef ANDROID
<tr class="no-copy">
<th class="column">
&aboutSupport.appBasicsProfiles;
@@ -253,8 +247,6 @@
<a href="about:profiles">about:profiles</a>
</td>
</tr>
-#endif
-
</tbody>
</table>
diff --git a/toolkit/content/aboutTelemetry.js b/toolkit/content/aboutTelemetry.js
index c73a979c6..97dcba9e2 100644
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -19,9 +19,6 @@ Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Task.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
-
const Telemetry = Services.telemetry;
const bundle = Services.strings.createBundle(
"chrome://global/locale/aboutTelemetry.properties");
@@ -236,17 +233,9 @@ var Settings = {
let elements = document.getElementsByClassName("change-data-choices-link");
for (let el of elements) {
el.addEventListener("click", function() {
- if (AppConstants.platform == "android") {
- Cu.import("resource://gre/modules/Messaging.jsm");
- Messaging.sendRequest({
- type: "Settings:Show",
- resource: "preferences_privacy",
- });
- } else {
- // Show the data choices preferences on desktop.
- let mainWindow = getMainWindowWithPreferencesPane();
- mainWindow.openAdvancedPreferences("dataChoicesTab");
- }
+ // Show the data choices preferences on desktop.
+ let mainWindow = getMainWindowWithPreferencesPane();
+ mainWindow.openAdvancedPreferences("dataChoicesTab");
}, false);
}
},
diff --git a/toolkit/content/browser-child.js b/toolkit/content/browser-child.js
index 7d0fe18c5..ffb07dde2 100644
--- a/toolkit/content/browser-child.js
+++ b/toolkit/content/browser-child.js
@@ -7,7 +7,6 @@ var Ci = Components.interfaces;
var Cu = Components.utils;
var Cr = Components.results;
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/BrowserUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
diff --git a/toolkit/content/buildconfig.html b/toolkit/content/buildconfig.html
index d3373f54c..322208189 100644
--- a/toolkit/content/buildconfig.html
+++ b/toolkit/content/buildconfig.html
@@ -58,9 +58,5 @@
</table>
<h2>Configure options</h2>
<p>@MOZ_CONFIGURE_OPTIONS@</p>
-#ifdef ANDROID
-<h2>Package name</h2>
-<p>@ANDROID_PACKAGE_NAME@</p>
-#endif
</body>
</html>
diff --git a/toolkit/content/contentAreaUtils.js b/toolkit/content/contentAreaUtils.js
index 736fb7dfc..17e463325 100644
--- a/toolkit/content/contentAreaUtils.js
+++ b/toolkit/content/contentAreaUtils.js
@@ -24,8 +24,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "Task",
"resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Deprecated",
"resource://gre/modules/Deprecated.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "NetUtil",
"resource://gre/modules/NetUtil.jsm");
@@ -1117,40 +1115,8 @@ function validateFileName(aFileName)
aFileName = aFileName.replace(/[\<]+/g, "(");
aFileName = aFileName.replace(/[\>]+/g, ")");
}
- else if (navigator.appVersion.indexOf("Macintosh") != -1)
+ else if (navigator.appVersion.indexOf("Macintosh") != -1) {
re = /[\:\/]+/g;
- else if (navigator.appVersion.indexOf("Android") != -1) {
- // On mobile devices, the filesystem may be very limited in what
- // it considers valid characters. To avoid errors, we sanitize
- // conservatively.
- const dangerousChars = "*?<>|\":/\\[];,+=";
- var processed = "";
- for (var i = 0; i < aFileName.length; i++)
- processed += aFileName.charCodeAt(i) >= 32 &&
- !(dangerousChars.indexOf(aFileName[i]) >= 0) ? aFileName[i]
- : "_";
-
- // Last character should not be a space
- processed = processed.trim();
-
- // If a large part of the filename has been sanitized, then we
- // will use a default filename instead
- if (processed.replace(/_/g, "").length <= processed.length/2) {
- // We purposefully do not use a localized default filename,
- // which we could have done using
- // ContentAreaUtils.stringBundle.GetStringFromName("DefaultSaveFileName")
- // since it may contain invalid characters.
- var original = processed;
- processed = "download";
-
- // Preserve a suffix, if there is one
- if (original.indexOf(".") >= 0) {
- var suffix = original.split(".").slice(-1)[0];
- if (suffix && suffix.indexOf("_") < 0)
- processed += "." + suffix;
- }
- }
- return processed;
}
return aFileName.replace(re, "_");
@@ -1161,10 +1127,10 @@ function getNormalizedLeafName(aFile, aDefaultExtension)
if (!aDefaultExtension)
return aFile;
- if (AppConstants.platform == "win") {
- // Remove trailing dots and spaces on windows
- aFile = aFile.replace(/[\s.]+$/, "");
- }
+#ifdef XP_WIN
+ // Remove trailing dots and spaces on windows
+ aFile = aFile.replace(/[\s.]+$/, "");
+#endif
// Remove leading dots
aFile = aFile.replace(/^\.+/, "");
diff --git a/toolkit/content/customizeToolbar.js b/toolkit/content/customizeToolbar.js
index 7400aaadc..05151b905 100644
--- a/toolkit/content/customizeToolbar.js
+++ b/toolkit/content/customizeToolbar.js
@@ -12,7 +12,6 @@ var gToolboxSheet = false;
var gPaletteBox = null;
Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
function onLoad()
{
@@ -213,10 +212,10 @@ function wrapToolbarItems()
{
forEachCustomizableToolbar(function (toolbar) {
Array.forEach(toolbar.childNodes, function (item) {
- if (AppConstants.platform == "macosx") {
- if (item.firstChild && item.firstChild.localName == "menubar")
- return;
- }
+#ifdef XP_MACOSX
+ if (item.firstChild && item.firstChild.localName == "menubar")
+ return;
+#endif
if (isToolbarItem(item)) {
let wrapper = wrapToolbarItem(item);
cleanupItemForToolbar(item, wrapper);
diff --git a/toolkit/content/globalOverlay.js b/toolkit/content/globalOverlay.js
index 1df3d65fc..d8467f0a1 100644
--- a/toolkit/content/globalOverlay.js
+++ b/toolkit/content/globalOverlay.js
@@ -4,32 +4,32 @@
function closeWindow(aClose, aPromptFunction)
{
- let { AppConstants } = Components.utils.import("resource://gre/modules/AppConstants.jsm");
-
+#ifdef XP_MACOSX
// Closing the last window doesn't quit the application on OS X.
- if (AppConstants.platform != "macosx") {
- var windowCount = 0;
- var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
- .getService(Components.interfaces.nsIWindowMediator);
- var e = wm.getEnumerator(null);
-
- while (e.hasMoreElements()) {
- var w = e.getNext();
- if (w.closed) {
- continue;
- }
- if (++windowCount == 2)
- break;
+ if (typeof(aPromptFunction) == "function" && !aPromptFunction()) {
+ return false;
+ }
+#else
+ var windowCount = 0;
+ var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"]
+ .getService(Components.interfaces.nsIWindowMediator);
+ var e = wm.getEnumerator(null);
+
+ while (e.hasMoreElements()) {
+ var w = e.getNext();
+ if (w.closed) {
+ continue;
}
+ if (++windowCount == 2)
+ break;
+ }
- // If we're down to the last window and someone tries to shut down, check to make sure we can!
- if (windowCount == 1 && !canQuitApplication("lastwindow"))
- return false;
- if (windowCount != 1 && typeof(aPromptFunction) == "function" && !aPromptFunction())
- return false;
- } else if (typeof(aPromptFunction) == "function" && !aPromptFunction()) {
+ // If we're down to the last window and someone tries to shut down, check to make sure we can!
+ if (windowCount == 1 && !canQuitApplication("lastwindow"))
return false;
- }
+ if (windowCount != 1 && typeof(aPromptFunction) == "function" && !aPromptFunction())
+ return false;
+#endif
if (aClose) {
window.close();
diff --git a/toolkit/content/jar.mn b/toolkit/content/jar.mn
index 5a940679b..8b7b35b61 100644
--- a/toolkit/content/jar.mn
+++ b/toolkit/content/jar.mn
@@ -19,10 +19,8 @@ toolkit.jar:
#endif
content/global/aboutNetworking.js
content/global/aboutNetworking.xhtml
-#ifndef ANDROID
- content/global/aboutProfiles.js
+* content/global/aboutProfiles.js
content/global/aboutProfiles.xhtml
-#endif
content/global/aboutServiceWorkers.js
content/global/aboutServiceWorkers.xhtml
#ifdef MOZ_WEBRTC
@@ -41,9 +39,9 @@ toolkit.jar:
content/global/browser-child.js
content/global/browser-content.js
* content/global/buildconfig.html
- content/global/contentAreaUtils.js
+* content/global/contentAreaUtils.js
content/global/customizeToolbar.css
- content/global/customizeToolbar.js
+* content/global/customizeToolbar.js
content/global/customizeToolbar.xul
content/global/datepicker.xhtml
content/global/editMenuOverlay.js
@@ -52,7 +50,7 @@ toolkit.jar:
* content/global/finddialog.xul
content/global/findUtils.js
content/global/filepicker.properties
- content/global/globalOverlay.js
+* content/global/globalOverlay.js
content/global/mozilla.xhtml
#ifdef MOZ_PHOENIX
content/global/logopage.xhtml
diff --git a/toolkit/content/moz.build b/toolkit/content/moz.build
index de50a82f5..0a08483b4 100644
--- a/toolkit/content/moz.build
+++ b/toolkit/content/moz.build
@@ -4,28 +4,19 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-TEST_DIRS += ['tests']
-
-for var in ('target', 'MOZ_CONFIGURE_OPTIONS', 'CC', 'CC_VERSION', 'CXX'):
+for var in ('target',
+ 'MOZ_CONFIGURE_OPTIONS',
+ 'CC',
+ 'CC_VERSION',
+ 'CXX'):
DEFINES[var] = CONFIG[var]
DEFINES['CFLAGS'] = CONFIG['OS_CFLAGS']
-
-if CONFIG['OS_TARGET'] == 'Android':
- DEFINES['ANDROID_PACKAGE_NAME'] = CONFIG['ANDROID_PACKAGE_NAME']
+DEFINES['TOPOBJDIR'] = TOPOBJDIR
if CONFIG['MOZ_ANDROID_CXX_STL'] == 'libc++':
DEFINES['MOZ_USE_LIBCXX'] = True
JAR_MANIFESTS += ['jar.mn']
-with Files('aboutTelemetry.*'):
- BUG_COMPONENT = ('Toolkit', 'Telemetry')
-with Files('customizeToolbar.*'):
- BUG_COMPONENT = ('Toolkit', 'Toolbars and Toolbar Customization')
-
-with Files('widgets/*'):
- BUG_COMPONENT = ('Toolkit', 'XUL Widgets')
-
-DEFINES['TOPOBJDIR'] = TOPOBJDIR
diff --git a/toolkit/content/tests/browser/.eslintrc.js b/toolkit/content/tests/browser/.eslintrc.js
deleted file mode 100644
index c764b133d..000000000
--- a/toolkit/content/tests/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/content/tests/browser/audio.ogg b/toolkit/content/tests/browser/audio.ogg
deleted file mode 100644
index 7f1833508..000000000
--- a/toolkit/content/tests/browser/audio.ogg
+++ /dev/null
Binary files differ
diff --git a/toolkit/content/tests/browser/browser.ini b/toolkit/content/tests/browser/browser.ini
deleted file mode 100644
index 67ba2f850..000000000
--- a/toolkit/content/tests/browser/browser.ini
+++ /dev/null
@@ -1,76 +0,0 @@
-[DEFAULT]
-support-files =
- head.js
- file_contentTitle.html
- audio.ogg
-
-[browser_audioCompeting.js]
-tags = audiochannel
-support-files =
- file_multipleAudio.html
-[browser_audioCompeting_onlyForActiveAgent.js]
-tags = audiochannel
-support-files =
- file_multiplePlayingAudio.html
-[browser_autoscroll_disabled.js]
-[browser_block_autoplay_media.js]
-tags = audiochannel
-support-files =
- file_multipleAudio.html
-[browser_bug295977_autoscroll_overflow.js]
-[browser_bug451286.js]
-skip-if = !e10s
-[browser_bug594509.js]
-[browser_bug982298.js]
-[browser_bug1198465.js]
-[browser_contentTitle.js]
-[browser_crash_previous_frameloader.js]
-run-if = e10s && crashreporter
-[browser_datetime_datepicker.js]
-[browser_default_image_filename.js]
-[browser_f7_caret_browsing.js]
-[browser_findbar.js]
-[browser_label_textlink.js]
-[browser_isSynthetic.js]
-support-files =
- empty.png
-[browser_keyevents_during_autoscrolling.js]
-[browser_save_resend_postdata.js]
-support-files =
- common/mockTransfer.js
- data/post_form_inner.sjs
- data/post_form_outer.sjs
-skip-if = e10s # Bug ?????? - test directly manipulates content (gBrowser.contentDocument.getElementById("postForm").submit();)
-[browser_content_url_annotation.js]
-skip-if = !e10s || !crashreporter
-support-files =
- file_redirect.html
- file_redirect_to.html
-[browser_bug1170531.js]
-[browser_mediaPlayback.js]
-tags = audiochannel
-support-files =
- file_mediaPlayback.html
- file_mediaPlaybackFrame.html
-[browser_mediaPlayback_mute.js]
-tags = audiochannel
-support-files =
- file_mediaPlayback2.html
- file_mediaPlaybackFrame2.html
-[browser_mediaPlayback_suspended.js]
-tags = audiochannel
-support-files =
- file_mediaPlayback2.html
-[browser_mediaPlayback_suspended_multipleAudio.js]
-tags = audiochannel
-support-files =
- file_multipleAudio.html
-[browser_mute.js]
-tags = audiochannel
-[browser_mute2.js]
-tags = audiochannel
-[browser_quickfind_editable.js]
-[browser_saveImageURL.js]
-support-files =
- image.jpg
- image_page.html
diff --git a/toolkit/content/tests/browser/browser_audioCompeting.js b/toolkit/content/tests/browser/browser_audioCompeting.js
deleted file mode 100644
index 7b6a76c1d..000000000
--- a/toolkit/content/tests/browser/browser_audioCompeting.js
+++ /dev/null
@@ -1,115 +0,0 @@
-const PAGE = "https://example.com/browser/toolkit/content/tests/browser/file_multipleAudio.html";
-
-function* wait_for_tab_playing_event(tab, expectPlaying) {
- if (tab.soundPlaying == expectPlaying) {
- ok(true, "The tab should " + (expectPlaying ? "" : "not ") + "be playing");
- } else {
- yield BrowserTestUtils.waitForEvent(tab, "TabAttrModified", false, (event) => {
- if (event.detail.changed.indexOf("soundplaying") >= 0) {
- is(tab.soundPlaying, expectPlaying, "The tab should " + (expectPlaying ? "" : "not ") + "be playing");
- return true;
- }
- return false;
- });
- }
-}
-
-function play_audio_from_invisible_tab () {
- return new Promise(resolve => {
- var autoPlay = content.document.getElementById('autoplay');
- if (!autoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- is(autoPlay.paused, true, "Audio in tab 1 was paused by audio competing.");
- autoPlay.play();
- autoPlay.onpause = function() {
- autoPlay.onpause = null;
- ok(true, "Audio in tab 1 can't playback when other tab is playing in foreground.");
- resolve();
- };
- });
-}
-
-function audio_should_keep_playing_even_go_to_background () {
- var autoPlay = content.document.getElementById('autoplay');
- if (!autoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- is(autoPlay.paused, false, "Audio in tab 2 is still playing in the background.");
-}
-
-function play_non_autoplay_audio () {
- return new Promise(resolve => {
- var autoPlay = content.document.getElementById('autoplay');
- var nonAutoPlay = content.document.getElementById('nonautoplay');
- if (!autoPlay || !nonAutoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- is(nonAutoPlay.paused, true, "Non-autoplay audio isn't started playing yet.");
- nonAutoPlay.play();
-
- nonAutoPlay.onplay = function() {
- nonAutoPlay.onplay = null;
- is(nonAutoPlay.paused, false, "Start Non-autoplay audio.");
- is(autoPlay.paused, false, "Autoplay audio is still playing.");
- resolve();
- };
- });
-}
-
-add_task(function* setup_test_preference() {
- yield new Promise(resolve => {
- SpecialPowers.pushPrefEnv({"set": [
- ["dom.audiochannel.audioCompeting", true],
- ["dom.ipc.processCount", 1]
- ]}, resolve);
- });
-});
-
-add_task(function* cross_tabs_audio_competing () {
- info("- open tab 1 in foreground -");
- let tab1 = yield BrowserTestUtils.openNewForegroundTab(window.gBrowser,
- "about:blank");
- tab1.linkedBrowser.loadURI(PAGE);
- yield wait_for_tab_playing_event(tab1, true);
-
- info("- open tab 2 in foreground -");
- let tab2 = yield BrowserTestUtils.openNewForegroundTab(window.gBrowser,
- "about:blank");
- tab2.linkedBrowser.loadURI(PAGE);
- yield wait_for_tab_playing_event(tab1, false);
-
- info("- open tab 3 in foreground -");
- let tab3 = yield BrowserTestUtils.openNewForegroundTab(window.gBrowser,
- "about:blank");
- yield ContentTask.spawn(tab2.linkedBrowser, null,
- audio_should_keep_playing_even_go_to_background);
-
- info("- play audio from background tab 1 -");
- yield ContentTask.spawn(tab1.linkedBrowser, null,
- play_audio_from_invisible_tab);
-
- info("- remove tabs -");
- yield BrowserTestUtils.removeTab(tab1);
- yield BrowserTestUtils.removeTab(tab2);
- yield BrowserTestUtils.removeTab(tab3);
-});
-
-add_task(function* within_one_tab_audio_competing () {
- info("- open tab and play audio1 -");
- let tab = yield BrowserTestUtils.openNewForegroundTab(window.gBrowser,
- "about:blank");
- tab.linkedBrowser.loadURI(PAGE);
- yield wait_for_tab_playing_event(tab, true);
-
- info("- play audio2 in the same tab -");
- yield ContentTask.spawn(tab.linkedBrowser, null,
- play_non_autoplay_audio);
-
- info("- remove tab -");
- yield BrowserTestUtils.removeTab(tab);
-});
-
diff --git a/toolkit/content/tests/browser/browser_audioCompeting_onlyForActiveAgent.js b/toolkit/content/tests/browser/browser_audioCompeting_onlyForActiveAgent.js
deleted file mode 100644
index 31cd3f624..000000000
--- a/toolkit/content/tests/browser/browser_audioCompeting_onlyForActiveAgent.js
+++ /dev/null
@@ -1,176 +0,0 @@
-const PAGE = "https://example.com/browser/toolkit/content/tests/browser/file_multiplePlayingAudio.html";
-
-var SuspendedType = {
- NONE_SUSPENDED : 0,
- SUSPENDED_PAUSE : 1,
- SUSPENDED_BLOCK : 2,
- SUSPENDED_PAUSE_DISPOSABLE : 3
-};
-
-function wait_for_event(browser, event) {
- return BrowserTestUtils.waitForEvent(browser, event, false, (event) => {
- is(event.originalTarget, browser, "Event must be dispatched to correct browser.");
- return true;
- });
-}
-
-function check_all_audio_suspended(suspendedType) {
- var audio1 = content.document.getElementById("audio1");
- var audio2 = content.document.getElementById("audio2");
- if (!audio1 || !audio2) {
- ok(false, "Can't get the audio element!");
- }
-
- is(audio1.computedSuspended, suspendedType,
- "The suspeded state of audio1 is correct.");
- is(audio2.computedSuspended, suspendedType,
- "The suspeded state of audio2 is correct.");
-}
-
-function check_audio1_suspended(suspendedType) {
- var audio1 = content.document.getElementById("audio1");
- if (!audio1) {
- ok(false, "Can't get the audio element!");
- }
-
- is(audio1.computedSuspended, suspendedType,
- "The suspeded state of audio1 is correct.");
-}
-
-function check_audio2_suspended(suspendedType) {
- var audio2 = content.document.getElementById("audio2");
- if (!audio2) {
- ok(false, "Can't get the audio element!");
- }
-
- is(audio2.computedSuspended, suspendedType,
- "The suspeded state of audio2 is correct.");
-}
-
-function check_all_audio_pause_state(expectedPauseState) {
- var audio1 = content.document.getElementById("audio1");
- var audio2 = content.document.getElementById("audio2");
- if (!audio1 | !audio2) {
- ok(false, "Can't get the audio element!");
- }
-
- is(audio1.paused, expectedPauseState,
- "The pause state of audio1 is correct.");
- is(audio2.paused, expectedPauseState,
- "The pause state of audio2 is correct.");
-}
-
-function check_audio1_pause_state(expectedPauseState) {
- var audio1 = content.document.getElementById("audio1");
- if (!audio1) {
- ok(false, "Can't get the audio element!");
- }
-
- is(audio1.paused, expectedPauseState,
- "The pause state of audio1 is correct.");
-}
-
-function check_audio2_pause_state(expectedPauseState) {
- var audio2 = content.document.getElementById("audio2");
- if (!audio2) {
- ok(false, "Can't get the audio element!");
- }
-
- is(audio2.paused, expectedPauseState,
- "The pause state of audio2 is correct.");
-}
-
-function play_audio1_from_page() {
- var audio1 = content.document.getElementById("audio1");
- if (!audio1) {
- ok(false, "Can't get the audio element!");
- }
-
- is(audio1.paused, true, "Audio1 is paused.");
- audio1.play();
- return new Promise(resolve => {
- audio1.onplay = function() {
- audio1.onplay = null;
- ok(true, "Audio1 started playing.");
- resolve();
- }
- });
-}
-
-function stop_audio1_from_page() {
- var audio1 = content.document.getElementById("audio1");
- if (!audio1) {
- ok(false, "Can't get the audio element!");
- }
-
- is(audio1.paused, false, "Audio1 is playing.");
- audio1.pause();
- return new Promise(resolve => {
- audio1.onpause = function() {
- audio1.onpause = null;
- ok(true, "Audio1 stopped playing.");
- resolve();
- }
- });
-}
-
-function* audio_competing_for_active_agent(url, browser) {
- browser.loadURI(url);
-
- info("- page should have playing audio -");
- yield wait_for_event(browser, "DOMAudioPlaybackStarted");
-
- info("- the default suspended state of all audio should be non-suspened -");
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_all_audio_suspended);
-
- info("- only pause playing audio in the page -");
- browser.pauseMedia(true /* disposable */);
-
- info("- page shouldn't have any playing audio -");
- yield wait_for_event(browser, "DOMAudioPlaybackStopped");
- yield ContentTask.spawn(browser, true /* expect for pause */,
- check_all_audio_pause_state);
- yield ContentTask.spawn(browser, SuspendedType.SUSPENDED_PAUSE_DISPOSABLE,
- check_all_audio_suspended);
-
- info("- resume audio1 from page -");
- yield ContentTask.spawn(browser, null,
- play_audio1_from_page);
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_audio1_suspended);
-
- info("- audio2 should still be suspended -");
- yield ContentTask.spawn(browser, SuspendedType.SUSPENDED_PAUSE_DISPOSABLE,
- check_audio2_suspended);
- yield ContentTask.spawn(browser, true /* expect for pause */,
- check_audio2_pause_state);
-
- info("- stop audio1 from page -");
- yield ContentTask.spawn(browser, null,
- stop_audio1_from_page);
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_audio1_suspended);
-
- info("- audio2 should still be suspended -");
- yield ContentTask.spawn(browser, SuspendedType.SUSPENDED_PAUSE_DISPOSABLE,
- check_audio2_suspended);
- yield ContentTask.spawn(browser, true /* expect for pause */,
- check_audio2_pause_state);
-
-}
-
-add_task(function* setup_test_preference() {
- yield SpecialPowers.pushPrefEnv({"set": [
- ["media.useAudioChannelService.testing", true],
- ["dom.audiochannel.audioCompeting", true],
- ["dom.audiochannel.audioCompeting.allAgents", true]
- ]});
-});
-
-add_task(function* test_suspended_pause_disposable() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank"
- }, audio_competing_for_active_agent.bind(this, PAGE));
-});
diff --git a/toolkit/content/tests/browser/browser_autoscroll_disabled.js b/toolkit/content/tests/browser/browser_autoscroll_disabled.js
deleted file mode 100644
index 07c6174ab..000000000
--- a/toolkit/content/tests/browser/browser_autoscroll_disabled.js
+++ /dev/null
@@ -1,67 +0,0 @@
-add_task(function* ()
-{
- const kPrefName_AutoScroll = "general.autoScroll";
- Services.prefs.setBoolPref(kPrefName_AutoScroll, false);
-
- let dataUri = 'data:text/html,<html><body id="i" style="overflow-y: scroll"><div style="height: 2000px"></div>\
- <iframe id="iframe" style="display: none;"></iframe>\
-</body></html>';
-
- let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
- gBrowser.loadURI(dataUri);
- yield loadedPromise;
-
- yield BrowserTestUtils.synthesizeMouse("#i", 50, 50, { button: 1 },
- gBrowser.selectedBrowser);
-
- yield ContentTask.spawn(gBrowser.selectedBrowser, { }, function* () {
- var iframe = content.document.getElementById("iframe");
-
- if (iframe) {
- var e = new iframe.contentWindow.PageTransitionEvent("pagehide",
- { bubbles: true,
- cancelable: true,
- persisted: false });
- iframe.contentDocument.dispatchEvent(e);
- iframe.contentDocument.documentElement.dispatchEvent(e);
- }
- });
-
- yield BrowserTestUtils.synthesizeMouse("#i", 100, 100,
- { type: "mousemove", clickCount: "0" },
- gBrowser.selectedBrowser);
-
- // If scrolling didn't work, we wouldn't do any redraws and thus time out, so
- // request and force redraws to get the chance to check for scrolling at all.
- yield new Promise(resolve => window.requestAnimationFrame(resolve));
-
- let msg = yield ContentTask.spawn(gBrowser.selectedBrowser, { }, function* () {
- // Skip the first animation frame callback as it's the same callback that
- // the browser uses to kick off the scrolling.
- return new Promise(resolve => {
- function checkScroll() {
- let msg = "";
- let elem = content.document.getElementById('i');
- if (elem.scrollTop != 0) {
- msg += "element should not have scrolled vertically";
- }
- if (elem.scrollLeft != 0) {
- msg += "element should not have scrolled horizontally";
- }
-
- resolve(msg);
- }
-
- content.requestAnimationFrame(checkScroll);
- });
- });
-
- ok(!msg, "element scroll " + msg);
-
- // restore the changed prefs
- if (Services.prefs.prefHasUserValue(kPrefName_AutoScroll))
- Services.prefs.clearUserPref(kPrefName_AutoScroll);
-
- // wait for focus to fix a failure in the next test if the latter runs too soon.
- yield SimpleTest.promiseFocus();
-});
diff --git a/toolkit/content/tests/browser/browser_block_autoplay_media.js b/toolkit/content/tests/browser/browser_block_autoplay_media.js
deleted file mode 100644
index 3b2a309b9..000000000
--- a/toolkit/content/tests/browser/browser_block_autoplay_media.js
+++ /dev/null
@@ -1,87 +0,0 @@
-const PAGE = "https://example.com/browser/toolkit/content/tests/browser/file_multipleAudio.html";
-
-var SuspendedType = {
- NONE_SUSPENDED : 0,
- SUSPENDED_PAUSE : 1,
- SUSPENDED_BLOCK : 2,
- SUSPENDED_PAUSE_DISPOSABLE : 3
-};
-
-function* wait_for_tab_playing_event(tab, expectPlaying) {
- if (tab.soundPlaying == expectPlaying) {
- ok(true, "The tab should " + (expectPlaying ? "" : "not ") + "be playing");
- } else {
- yield BrowserTestUtils.waitForEvent(tab, "TabAttrModified", false, (event) => {
- if (event.detail.changed.indexOf("soundplaying") >= 0) {
- is(tab.soundPlaying, expectPlaying, "The tab should " + (expectPlaying ? "" : "not ") + "be playing");
- return true;
- }
- return false;
- });
- }
-}
-
-function check_audio_suspended(suspendedType) {
- var autoPlay = content.document.getElementById('autoplay');
- if (!autoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- is(autoPlay.computedSuspended, suspendedType,
- "The suspeded state of autoplay audio is correct.");
-}
-
-add_task(function* setup_test_preference() {
- yield new Promise(resolve => {
- SpecialPowers.pushPrefEnv({"set": [
- ["media.useAudioChannelService.testing", true],
- ["media.block-autoplay-until-in-foreground", true]
- ]}, resolve);
- });
-});
-
-add_task(function* block_autoplay_media() {
- info("- open new background tab1 -");
- let tab1 = window.gBrowser.addTab("about:blank");
- tab1.linkedBrowser.loadURI(PAGE);
- yield BrowserTestUtils.browserLoaded(tab1.linkedBrowser);
-
- info("- should block autoplay media for non-visited tab1 -");
- yield ContentTask.spawn(tab1.linkedBrowser, SuspendedType.SUSPENDED_BLOCK,
- check_audio_suspended);
-
- info("- open new background tab2 -");
- let tab2 = window.gBrowser.addTab("about:blank");
- tab2.linkedBrowser.loadURI(PAGE);
- yield BrowserTestUtils.browserLoaded(tab2.linkedBrowser);
-
- info("- should block autoplay for non-visited tab2 -");
- yield ContentTask.spawn(tab2.linkedBrowser, SuspendedType.SUSPENDED_BLOCK,
- check_audio_suspended);
-
- info("- select tab1 as foreground tab -");
- yield BrowserTestUtils.switchTab(window.gBrowser, tab1);
-
- info("- media should be unblocked because the tab was visited -");
- yield wait_for_tab_playing_event(tab1, true);
- yield ContentTask.spawn(tab1.linkedBrowser, SuspendedType.NONE_SUSPENDED,
- check_audio_suspended);
-
- info("- open another new foreground tab3 -");
- let tab3 = yield BrowserTestUtils.openNewForegroundTab(window.gBrowser,
- "about:blank");
- info("- should still play media from tab1 -");
- yield wait_for_tab_playing_event(tab1, true);
- yield ContentTask.spawn(tab1.linkedBrowser, SuspendedType.NONE_SUSPENDED,
- check_audio_suspended);
-
- info("- should still block media from tab2 -");
- yield wait_for_tab_playing_event(tab2, false);
- yield ContentTask.spawn(tab2.linkedBrowser, SuspendedType.SUSPENDED_BLOCK,
- check_audio_suspended);
-
- info("- remove tabs -");
- yield BrowserTestUtils.removeTab(tab1);
- yield BrowserTestUtils.removeTab(tab2);
- yield BrowserTestUtils.removeTab(tab3);
-});
diff --git a/toolkit/content/tests/browser/browser_bug1170531.js b/toolkit/content/tests/browser/browser_bug1170531.js
deleted file mode 100644
index 49df5661a..000000000
--- a/toolkit/content/tests/browser/browser_bug1170531.js
+++ /dev/null
@@ -1,92 +0,0 @@
-// Test for bug 1170531
-// https://bugzilla.mozilla.org/show_bug.cgi?id=1170531
-
-add_task(function* () {
- // Get a bunch of DOM nodes
- let winUtils = window.QueryInterface(Ci.nsIInterfaceRequestor).
- getInterface(Ci.nsIDOMWindowUtils);
-
- let editMenu = document.getElementById("edit-menu");
- let menubar = editMenu.parentNode;
- let menuPopup = editMenu.menupopup;
- let editMenuIndex = -1;
- for (let i = 0; i < menubar.children.length; i++) {
- if (menubar.children[i] === editMenu) {
- editMenuIndex = i;
- break;
- }
- }
-
- let closeMenu = function(aCallback) {
- if (OS.Constants.Sys.Name == "Darwin") {
- executeSoon(aCallback);
- return;
- }
-
- menuPopup.addEventListener("popuphidden", function onPopupHidden() {
- menuPopup.removeEventListener("popuphidden", onPopupHidden, false);
- executeSoon(aCallback);
- }, false);
-
- executeSoon(function() {
- editMenu.open = false;
- });
- };
-
- let openMenu = function(aCallback) {
- if (OS.Constants.Sys.Name == "Darwin") {
- goUpdateGlobalEditMenuItems();
- // On OSX, we have a native menu, so it has to be updated. In single process browsers,
- // this happens synchronously, but in e10s, we have to wait for the main thread
- // to deal with it for us. 1 second should be plenty of time.
- setTimeout(aCallback, 1000);
- return;
- }
-
- menuPopup.addEventListener("popupshown", function onPopupShown() {
- menuPopup.removeEventListener("popupshown", onPopupShown, false);
- executeSoon(aCallback);
- }, false);
-
- executeSoon(function() {
- editMenu.open = true;
- });
- };
-
- yield BrowserTestUtils.withNewTab({ gBrowser: gBrowser, url: "about:blank" }, function* (browser) {
- let menu_cut_disabled, menu_copy_disabled;
-
- yield BrowserTestUtils.loadURI(browser, "data:text/html,<div>hello!</div>");
- yield BrowserTestUtils.browserLoaded(browser);
- browser.focus();
- yield new Promise(resolve => waitForFocus(resolve, window));
- yield new Promise(openMenu);
- menu_cut_disabled = menuPopup.querySelector("#menu_cut").getAttribute('disabled') == "true";
- is(menu_cut_disabled, false, "menu_cut should be enabled");
- menu_copy_disabled = menuPopup.querySelector("#menu_copy").getAttribute('disabled') == "true";
- is(menu_copy_disabled, false, "menu_copy should be enabled");
- yield new Promise(closeMenu);
-
- yield BrowserTestUtils.loadURI(browser, "data:text/html,<div contentEditable='true'>hello!</div>");
- yield BrowserTestUtils.browserLoaded(browser);
- browser.focus();
- yield new Promise(resolve => waitForFocus(resolve, window));
- yield new Promise(openMenu);
- menu_cut_disabled = menuPopup.querySelector("#menu_cut").getAttribute('disabled') == "true";
- is(menu_cut_disabled, false, "menu_cut should be enabled");
- menu_copy_disabled = menuPopup.querySelector("#menu_copy").getAttribute('disabled') == "true";
- is(menu_copy_disabled, false, "menu_copy should be enabled");
- yield new Promise(closeMenu);
-
- yield BrowserTestUtils.loadURI(browser, "about:preferences");
- yield BrowserTestUtils.browserLoaded(browser);
- browser.focus();
- yield new Promise(resolve => waitForFocus(resolve, window));
- yield new Promise(openMenu);
- menu_cut_disabled = menuPopup.querySelector("#menu_cut").getAttribute('disabled') == "true";
- is(menu_cut_disabled, true, "menu_cut should be disabled");
- menu_copy_disabled = menuPopup.querySelector("#menu_copy").getAttribute('disabled') == "true";
- is(menu_copy_disabled, true, "menu_copy should be disabled");
- yield new Promise(closeMenu);
- });
-});
diff --git a/toolkit/content/tests/browser/browser_bug1198465.js b/toolkit/content/tests/browser/browser_bug1198465.js
deleted file mode 100644
index a9cc83e12..000000000
--- a/toolkit/content/tests/browser/browser_bug1198465.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var kPrefName = "accessibility.typeaheadfind.prefillwithselection";
-var kEmptyURI = "data:text/html,";
-
-// This pref is false by default in OSX; ensure the test still works there.
-Services.prefs.setBoolPref(kPrefName, true);
-
-registerCleanupFunction(function() {
- Services.prefs.clearUserPref(kPrefName);
-});
-
-add_task(function* () {
- let aTab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, kEmptyURI);
- ok(!gFindBarInitialized, "findbar isn't initialized yet");
-
- // Note: the use case here is when the user types directly in the findbar
- // _before_ it's prefilled with a text selection in the page.
-
- // So `yield BrowserTestUtils.sendChar()` can't be used here:
- // - synthesizing a key in the browser won't actually send it to the
- // findbar; the findbar isn't part of the browser content.
- // - we need to _not_ wait for _startFindDeferred to be resolved; yielding
- // a synthesized keypress on the browser implicitely happens after the
- // browser has dispatched its return message with the prefill value for
- // the findbar, which essentially nulls these tests.
-
- let findBar = gFindBar;
- is(findBar._findField.value, "", "findbar is empty");
-
- // Test 1
- // Any input in the findbar should erase a previous search.
-
- findBar._findField.value = "xy";
- findBar.startFind();
- is(findBar._findField.value, "xy", "findbar should have xy initial query");
- is(findBar._findField.mInputField,
- document.activeElement,
- "findbar is now focused");
-
- EventUtils.sendChar("z", window);
- is(findBar._findField.value, "z", "z erases xy");
-
- findBar._findField.value = "";
- ok(!findBar._findField.value, "erase findbar after first test");
-
- // Test 2
- // Prefilling the findbar should be ignored if a search has been run.
-
- findBar.startFind();
- ok(findBar._startFindDeferred, "prefilled value hasn't been fetched yet");
- is(findBar._findField.mInputField,
- document.activeElement,
- "findbar is still focused");
-
- EventUtils.sendChar("a", window);
- EventUtils.sendChar("b", window);
- is(findBar._findField.value, "ab", "initial ab typed in the findbar");
-
- // This resolves _startFindDeferred if it's still pending; let's just skip
- // over waiting for the browser's return message that should do this as it
- // doesn't really matter.
- findBar.onCurrentSelection("foo", true);
- ok(!findBar._startFindDeferred, "prefilled value fetched");
- is(findBar._findField.value, "ab", "ab kept instead of prefill value");
-
- EventUtils.sendChar("c", window);
- is(findBar._findField.value, "abc", "c is appended after ab");
-
- // Clear the findField value to make the test run successfully
- // for multiple runs in the same browser session.
- findBar._findField.value = "";
- yield BrowserTestUtils.removeTab(aTab);
-});
diff --git a/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js b/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js
deleted file mode 100644
index 958afc868..000000000
--- a/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js
+++ /dev/null
@@ -1,214 +0,0 @@
-requestLongerTimeout(2);
-add_task(function* ()
-{
- function pushPref(name, value) {
- return new Promise(resolve => SpecialPowers.pushPrefEnv({"set": [[name, value]]}, resolve));
- }
-
- yield pushPref("general.autoScroll", true);
-
- const expectScrollNone = 0;
- const expectScrollVert = 1;
- const expectScrollHori = 2;
- const expectScrollBoth = 3;
-
- var allTests = [
- {dataUri: 'data:text/html,<html><head><meta charset="utf-8"></head><body><style type="text/css">div { display: inline-block; }</style>\
- <div id="a" style="width: 100px; height: 100px; overflow: hidden;"><div style="width: 200px; height: 200px;"></div></div>\
- <div id="b" style="width: 100px; height: 100px; overflow: auto;"><div style="width: 200px; height: 200px;"></div></div>\
- <div id="c" style="width: 100px; height: 100px; overflow-x: auto; overflow-y: hidden;"><div style="width: 200px; height: 200px;"></div></div>\
- <div id="d" style="width: 100px; height: 100px; overflow-y: auto; overflow-x: hidden;"><div style="width: 200px; height: 200px;"></div></div>\
- <select id="e" style="width: 100px; height: 100px;" multiple="multiple"><option>aaaaaaaaaaaaaaaaaaaaaaaa</option><option>a</option><option>a</option>\
- <option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option>\
- <option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option></select>\
- <select id="f" style="width: 100px; height: 100px;"><option>a</option><option>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</option><option>a</option>\
- <option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option>\
- <option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option></select>\
- <div id="g" style="width: 99px; height: 99px; border: 10px solid black; margin: 10px; overflow: auto;"><div style="width: 100px; height: 100px;"></div></div>\
- <div id="h" style="width: 100px; height: 100px; overflow: -moz-hidden-unscrollable;"><div style="width: 200px; height: 200px;"></div></div>\
- <iframe id="iframe" style="display: none;"></iframe>\
- </body></html>'},
- {elem: 'a', expected: expectScrollNone},
- {elem: 'b', expected: expectScrollBoth},
- {elem: 'c', expected: expectScrollHori},
- {elem: 'd', expected: expectScrollVert},
- {elem: 'e', expected: expectScrollVert},
- {elem: 'f', expected: expectScrollNone},
- {elem: 'g', expected: expectScrollBoth},
- {elem: 'h', expected: expectScrollNone},
- {dataUri: 'data:text/html,<html><head><meta charset="utf-8"></head><body id="i" style="overflow-y: scroll"><div style="height: 2000px"></div>\
- <iframe id="iframe" style="display: none;"></iframe>\
- </body></html>'},
- {elem: 'i', expected: expectScrollVert}, // bug 695121
- {dataUri: 'data:text/html,<html><head><meta charset="utf-8"></head><style>html, body { width: 100%; height: 100%; overflow-x: hidden; overflow-y: scroll; }</style>\
- <body id="j"><div style="height: 2000px"></div>\
- <iframe id="iframe" style="display: none;"></iframe>\
- </body></html>'},
- {elem: 'j', expected: expectScrollVert}, // bug 914251
- {dataUri: 'data:text/html,<html><head><meta charset="utf-8">\
-<style>\
-body > div {scroll-behavior: smooth;width: 300px;height: 300px;overflow: scroll;}\
-body > div > div {width: 1000px;height: 1000px;}\
-</style>\
-</head><body><div id="t"><div></div></div></body></html>'},
- {elem: 't', expected: expectScrollBoth}, // bug 1308775
- {dataUri: 'data:text/html,<html><head><meta charset="utf-8"></head><body>\
-<div id="k" style="height: 150px; width: 200px; overflow: scroll; border: 1px solid black;">\
-<iframe style="height: 200px; width: 300px;"></iframe>\
-</div>\
-<div id="l" style="height: 150px; width: 300px; overflow: scroll; border: 1px dashed black;">\
-<iframe style="height: 200px; width: 200px;" src="data:text/html,<div style=\'border: 5px solid blue; height: 200%; width: 200%;\'></div>"></iframe>\
-</div>\
-<iframe id="m"></iframe>\
-<div style="height: 200%; border: 5px dashed black;">filler to make document overflow: scroll;</div>\
-</body></html>'},
- {elem: 'k', expected: expectScrollBoth},
- {elem: 'k', expected: expectScrollNone, testwindow: true},
- {elem: 'l', expected: expectScrollNone},
- {elem: 'm', expected: expectScrollVert, testwindow: true},
- {dataUri: 'data:text/html,<html><head><meta charset="utf-8"></head><body>\
-<img width="100" height="100" alt="image map" usemap="%23planetmap">\
-<map name="planetmap">\
- <area id="n" shape="rect" coords="0,0,100,100" href="javascript:void(null)">\
-</map>\
-<a href="javascript:void(null)" id="o" style="width: 100px; height: 100px; border: 1px solid black; display: inline-block; vertical-align: top;">link</a>\
-<input id="p" style="width: 100px; height: 100px; vertical-align: top;">\
-<textarea id="q" style="width: 100px; height: 100px; vertical-align: top;"></textarea>\
-<div style="height: 200%; border: 1px solid black;"></div>\
-</body></html>'},
- {elem: 'n', expected: expectScrollNone, testwindow: true},
- {elem: 'o', expected: expectScrollNone, testwindow: true},
- {elem: 'p', expected: expectScrollVert, testwindow: true, middlemousepastepref: false},
- {elem: 'q', expected: expectScrollVert, testwindow: true, middlemousepastepref: false},
- {dataUri: 'data:text/html,<html><head><meta charset="utf-8"></head><body>\
-<input id="r" style="width: 100px; height: 100px; vertical-align: top;">\
-<textarea id="s" style="width: 100px; height: 100px; vertical-align: top;"></textarea>\
-<div style="height: 200%; border: 1px solid black;"></div>\
-</body></html>'},
- {elem: 'r', expected: expectScrollNone, testwindow: true, middlemousepastepref: true},
- {elem: 's', expected: expectScrollNone, testwindow: true, middlemousepastepref: true}
- ];
-
- for (let test of allTests) {
- if (test.dataUri) {
- let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
- gBrowser.loadURI(test.dataUri);
- yield loadedPromise;
- continue;
- }
-
- let prefsChanged = (test.middlemousepastepref == false || test.middlemousepastepref == true);
- if (prefsChanged) {
- yield pushPref("middlemouse.paste", test.middlemousepastepref);
- }
-
- yield BrowserTestUtils.synthesizeMouse("#" + test.elem, 50, 80, { button: 1 },
- gBrowser.selectedBrowser);
-
- // This ensures bug 605127 is fixed: pagehide in an unrelated document
- // should not cancel the autoscroll.
- yield ContentTask.spawn(gBrowser.selectedBrowser, { }, function* () {
- var iframe = content.document.getElementById("iframe");
-
- if (iframe) {
- var e = new iframe.contentWindow.PageTransitionEvent("pagehide",
- { bubbles: true,
- cancelable: true,
- persisted: false });
- iframe.contentDocument.dispatchEvent(e);
- iframe.contentDocument.documentElement.dispatchEvent(e);
- }
- });
-
- is(document.activeElement, gBrowser.selectedBrowser, "Browser still focused after autoscroll started");
-
- yield BrowserTestUtils.synthesizeMouse("#" + test.elem, 100, 100,
- { type: "mousemove", clickCount: "0" },
- gBrowser.selectedBrowser);
-
- if (prefsChanged) {
- yield new Promise(resolve => SpecialPowers.popPrefEnv(resolve));
- }
-
- // Start checking for the scroll.
- let firstTimestamp = undefined;
- let timeCompensation;
- do {
- let timestamp = yield new Promise(resolve => window.requestAnimationFrame(resolve));
- if (firstTimestamp === undefined) {
- firstTimestamp = timestamp;
- }
-
- // This value is calculated similarly to the value of the same name in
- // ClickEventHandler.autoscrollLoop, except here it's cumulative across
- // all frames after the first one instead of being based only on the
- // current frame.
- timeCompensation = (timestamp - firstTimestamp) / 20;
- info("timestamp=" + timestamp + " firstTimestamp=" + firstTimestamp +
- " timeCompensation=" + timeCompensation);
-
- // Try to wait until enough time has passed to allow the scroll to happen.
- // autoscrollLoop incrementally scrolls during each animation frame, but
- // due to how its calculations work, when a frame is very close to the
- // previous frame, no scrolling may actually occur during that frame.
- // After 100ms's worth of frames, timeCompensation will be 1, making it
- // more likely that the accumulated scroll in autoscrollLoop will be >= 1,
- // although it also depends on acceleration, which here in this test
- // should be > 1 due to how it synthesizes mouse events below.
- } while (timeCompensation < 5);
-
- // Close the autoscroll popup by synthesizing Esc.
- EventUtils.synthesizeKey("VK_ESCAPE", {});
- let scrollVert = test.expected & expectScrollVert;
- let scrollHori = test.expected & expectScrollHori;
-
- yield ContentTask.spawn(gBrowser.selectedBrowser,
- { scrollVert : scrollVert,
- scrollHori: scrollHori,
- elemid : test.elem,
- checkWindow: test.testwindow },
- function* (args) {
- let msg = "";
- if (args.checkWindow) {
- if (!((args.scrollVert && content.scrollY > 0) ||
- (!args.scrollVert && content.scrollY == 0))) {
- msg += "Failed: ";
- }
- msg += 'Window for ' + args.elemid + ' should' + (args.scrollVert ? '' : ' not') + ' have scrolled vertically\n';
-
- if (!((args.scrollHori && content.scrollX > 0) ||
- (!args.scrollHori && content.scrollX == 0))) {
- msg += "Failed: ";
- }
- msg += ' Window for ' + args.elemid + ' should' + (args.scrollHori ? '' : ' not') + ' have scrolled horizontally\n';
- } else {
- let elem = content.document.getElementById(args.elemid);
- if (!((args.scrollVert && elem.scrollTop > 0) ||
- (!args.scrollVert && elem.scrollTop == 0))) {
- msg += "Failed: ";
- }
- msg += ' ' + args.elemid + ' should' + (args.scrollVert ? '' : ' not') + ' have scrolled vertically\n';
- if (!((args.scrollHori && elem.scrollLeft > 0) ||
- (!args.scrollHori && elem.scrollLeft == 0))) {
- msg += "Failed: ";
- }
- msg += args.elemid + ' should' + (args.scrollHori ? '' : ' not') + ' have scrolled horizontally';
- }
-
- Assert.ok(msg.indexOf("Failed") == -1, msg);
- }
- );
-
- // Before continuing the test, we need to ensure that the IPC
- // message that stops autoscrolling has had time to arrive.
- yield new Promise(resolve => executeSoon(resolve));
- }
-
- // remove 2 tabs that were opened by middle-click on links
- while (gBrowser.visibleTabs.length > 1) {
- gBrowser.removeTab(gBrowser.visibleTabs[gBrowser.visibleTabs.length - 1]);
- }
-
- // wait for focus to fix a failure in the next test if the latter runs too soon.
- yield SimpleTest.promiseFocus();
-});
diff --git a/toolkit/content/tests/browser/browser_bug451286.js b/toolkit/content/tests/browser/browser_bug451286.js
deleted file mode 100644
index a5dadeb84..000000000
--- a/toolkit/content/tests/browser/browser_bug451286.js
+++ /dev/null
@@ -1,152 +0,0 @@
-Services.scriptloader.loadSubScript("chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js", this);
-
-add_task(function*() {
- const SEARCH_TEXT = "text";
- const DATAURI = "data:text/html," + SEARCH_TEXT;
-
- // Bug 451286. An iframe that should be highlighted
- let visible = "<iframe id='visible' src='" + DATAURI + "'></iframe>";
-
- // Bug 493658. An invisible iframe that shouldn't interfere with
- // highlighting matches lying after it in the document
- let invisible = "<iframe id='invisible' style='display: none;' " +
- "src='" + DATAURI + "'></iframe>";
-
- let uri = DATAURI + invisible + SEARCH_TEXT + visible + SEARCH_TEXT;
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, uri);
- let contentRect = tab.linkedBrowser.getBoundingClientRect();
- let noHighlightSnapshot = snapshotRect(window, contentRect);
- ok(noHighlightSnapshot, "Got noHighlightSnapshot");
-
- yield openFindBarAndWait();
- gFindBar._findField.value = SEARCH_TEXT;
- yield findAgainAndWait();
- var matchCase = gFindBar.getElement("find-case-sensitive");
- if (matchCase.checked)
- matchCase.doCommand();
-
- // Turn on highlighting
- yield toggleHighlightAndWait(true);
- yield closeFindBarAndWait();
-
- // Take snapshot of highlighting
- let findSnapshot = snapshotRect(window, contentRect);
- ok(findSnapshot, "Got findSnapshot");
-
- // Now, remove the highlighting, and take a snapshot to compare
- // to our original state
- yield openFindBarAndWait();
- yield toggleHighlightAndWait(false);
- yield closeFindBarAndWait();
-
- let unhighlightSnapshot = snapshotRect(window, contentRect);
- ok(unhighlightSnapshot, "Got unhighlightSnapshot");
-
- // Select the matches that should have been highlighted manually
- yield ContentTask.spawn(tab.linkedBrowser, null, function*() {
- let doc = content.document;
- let win = doc.defaultView;
-
- // Create a manual highlight in the visible iframe to test bug 451286
- let iframe = doc.getElementById("visible");
- let ifBody = iframe.contentDocument.body;
- let range = iframe.contentDocument.createRange();
- range.selectNodeContents(ifBody.childNodes[0]);
- let ifWindow = iframe.contentWindow;
- let ifDocShell = ifWindow.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell);
-
- let ifController = ifDocShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISelectionDisplay)
- .QueryInterface(Ci.nsISelectionController);
-
- let frameFindSelection =
- ifController.getSelection(ifController.SELECTION_FIND);
- frameFindSelection.addRange(range);
-
- // Create manual highlights in the main document (the matches that lie
- // before/after the iframes
- let docShell = win.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell);
-
- let controller = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISelectionDisplay)
- .QueryInterface(Ci.nsISelectionController);
-
- let docFindSelection =
- controller.getSelection(ifController.SELECTION_FIND);
-
- range = doc.createRange();
- range.selectNodeContents(doc.body.childNodes[0]);
- docFindSelection.addRange(range);
- range = doc.createRange();
- range.selectNodeContents(doc.body.childNodes[2]);
- docFindSelection.addRange(range);
- range = doc.createRange();
- range.selectNodeContents(doc.body.childNodes[4]);
- docFindSelection.addRange(range);
- });
-
- // Take snapshot of manual highlighting
- let manualSnapshot = snapshotRect(window, contentRect);
- ok(manualSnapshot, "Got manualSnapshot");
-
- // Test 1: Were the matches in iframe correctly highlighted?
- let res = compareSnapshots(findSnapshot, manualSnapshot, true);
- ok(res[0], "Matches found in iframe correctly highlighted");
-
- // Test 2: Were the matches in iframe correctly unhighlighted?
- res = compareSnapshots(noHighlightSnapshot, unhighlightSnapshot, true);
- ok(res[0], "Highlighting in iframe correctly removed");
-
- yield BrowserTestUtils.removeTab(tab);
-});
-
-function toggleHighlightAndWait(shouldHighlight) {
- return new Promise((resolve) => {
- let listener = {
- onFindResult() {},
- onHighlightFinished() {
- gFindBar.browser.finder.removeResultListener(listener);
- resolve();
- },
- onMatchesCountResult() {}
- };
- gFindBar.browser.finder.addResultListener(listener);
- gFindBar.toggleHighlight(shouldHighlight);
- });
-}
-
-function findAgainAndWait() {
- return new Promise(resolve => {
- let listener = {
- onFindResult() {
- gFindBar.browser.finder.removeResultListener(listener);
- resolve();
- },
- onHighlightFinished() {},
- onMatchesCountResult() {}
- };
- gFindBar.browser.finder.addResultListener(listener);
- gFindBar.onFindAgainCommand();
- });
-}
-
-function* openFindBarAndWait() {
- let awaitTransitionEnd = BrowserTestUtils.waitForEvent(gFindBar, "transitionend");
- gFindBar.open();
- yield awaitTransitionEnd;
-}
-
-// This test is comparing snapshots. It is necessary to wait for the gFindBar
-// to close before taking the snapshot so the gFindBar does not take up space
-// on the new snapshot.
-function* closeFindBarAndWait() {
- let awaitTransitionEnd = BrowserTestUtils.waitForEvent(gFindBar, "transitionend", false, event => {
- return event.propertyName == "visibility";
- });
- gFindBar.close();
- yield awaitTransitionEnd;
-}
diff --git a/toolkit/content/tests/browser/browser_bug594509.js b/toolkit/content/tests/browser/browser_bug594509.js
deleted file mode 100644
index e67b05f85..000000000
--- a/toolkit/content/tests/browser/browser_bug594509.js
+++ /dev/null
@@ -1,9 +0,0 @@
-add_task(function* () {
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, "about:rights");
-
- yield ContentTask.spawn(tab.linkedBrowser, null, function* () {
- Assert.ok(content.document.getElementById("your-rights"), "about:rights content loaded");
- });
-
- yield BrowserTestUtils.removeTab(tab);
-});
diff --git a/toolkit/content/tests/browser/browser_bug982298.js b/toolkit/content/tests/browser/browser_bug982298.js
deleted file mode 100644
index 047340c5c..000000000
--- a/toolkit/content/tests/browser/browser_bug982298.js
+++ /dev/null
@@ -1,70 +0,0 @@
-const scrollHtml =
- "<textarea id=\"textarea1\" row=2>Firefox\n\nFirefox\n\n\n\n\n\n\n\n\n\n" +
- "</textarea><a href=\"about:blank\">blank</a>";
-
-add_task(function*() {
- let url = "data:text/html;base64," + btoa(scrollHtml);
- yield BrowserTestUtils.withNewTab({gBrowser, url}, function*(browser) {
- let awaitFindResult = new Promise(resolve => {
- let listener = {
- onFindResult(aData) {
- info("got find result");
- browser.finder.removeResultListener(listener);
-
- ok(aData.result == Ci.nsITypeAheadFind.FIND_FOUND, "should find string");
- resolve();
- },
- onCurrentSelection() {},
- onMatchesCountResult() {}
- };
- info("about to add results listener, open find bar, and send 'F' string");
- browser.finder.addResultListener(listener);
- });
- gFindBar.onFindCommand();
- EventUtils.sendString("F");
- info("added result listener and sent string 'F'");
- yield awaitFindResult;
-
- let awaitScrollDone = BrowserTestUtils.waitForMessage(browser.messageManager, "ScrollDone");
- // scroll textarea to bottom
- const scrollTest =
- "var textarea = content.document.getElementById(\"textarea1\");" +
- "textarea.scrollTop = textarea.scrollHeight;" +
- "sendAsyncMessage(\"ScrollDone\", { });"
- browser.messageManager.loadFrameScript("data:text/javascript;base64," +
- btoa(scrollTest), false);
- yield awaitScrollDone;
- info("got ScrollDone event");
- yield BrowserTestUtils.loadURI(browser, "about:blank");
- yield BrowserTestUtils.browserLoaded(browser);
-
- ok(browser.currentURI.spec == "about:blank", "got load event for about:blank");
-
- let awaitFindResult2 = new Promise(resolve => {
- let listener = {
- onFindResult(aData) {
- info("got find result #2");
- browser.finder.removeResultListener(listener);
- resolve();
- },
- onCurrentSelection() {},
- onMatchesCountResult() {}
- };
-
- browser.finder.addResultListener(listener);
- info("added result listener");
- });
- // find again needs delay for crash test
- setTimeout(function() {
- // ignore exception if occured
- try {
- info("about to send find again command");
- gFindBar.onFindAgainCommand(false);
- info("sent find again command");
- } catch (e) {
- info("got exception from onFindAgainCommand: " + e);
- }
- }, 0);
- yield awaitFindResult2;
- });
-});
diff --git a/toolkit/content/tests/browser/browser_contentTitle.js b/toolkit/content/tests/browser/browser_contentTitle.js
deleted file mode 100644
index e7966e565..000000000
--- a/toolkit/content/tests/browser/browser_contentTitle.js
+++ /dev/null
@@ -1,16 +0,0 @@
-var url = "https://example.com/browser/toolkit/content/tests/browser/file_contentTitle.html";
-
-add_task(function*() {
- let tab = gBrowser.selectedTab = gBrowser.addTab(url);
- let browser = tab.linkedBrowser;
- yield new Promise((resolve) => {
- addEventListener("TestLocationChange", function listener() {
- removeEventListener("TestLocationChange", listener);
- resolve();
- }, true, true);
- });
-
- is(gBrowser.contentTitle, "Test Page", "Should have the right title.");
-
- gBrowser.removeTab(tab);
-});
diff --git a/toolkit/content/tests/browser/browser_content_url_annotation.js b/toolkit/content/tests/browser/browser_content_url_annotation.js
deleted file mode 100644
index 1a4cee4c6..000000000
--- a/toolkit/content/tests/browser/browser_content_url_annotation.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-/* global Services, requestLongerTimeout, TestUtils, BrowserTestUtils,
- ok, info, dump, is, Ci, Cu, Components, ctypes, privateNoteIntentionalCrash,
- gBrowser, add_task, addEventListener, removeEventListener, ContentTask */
-
-"use strict";
-
-// Running this test in ASAN is slow.
-requestLongerTimeout(2);
-
-/**
- * Removes a file from a directory. This is a no-op if the file does not
- * exist.
- *
- * @param directory
- * The nsIFile representing the directory to remove from.
- * @param filename
- * A string for the file to remove from the directory.
- */
-function removeFile(directory, filename) {
- let file = directory.clone();
- file.append(filename);
- if (file.exists()) {
- file.remove(false);
- }
-}
-
-/**
- * Returns the directory where crash dumps are stored.
- *
- * @return nsIFile
- */
-function getMinidumpDirectory() {
- let dir = Services.dirsvc.get('ProfD', Ci.nsIFile);
- dir.append("minidumps");
- return dir;
-}
-
-/**
- * Checks that the URL is correctly annotated on a content process crash.
- */
-add_task(function* test_content_url_annotation() {
- let url = "https://example.com/browser/toolkit/content/tests/browser/file_redirect.html";
- let redirect_url = "https://example.com/browser/toolkit/content/tests/browser/file_redirect_to.html";
-
- yield BrowserTestUtils.withNewTab({
- gBrowser: gBrowser
- }, function* (browser) {
- ok(browser.isRemoteBrowser, "Should be a remote browser");
-
- // file_redirect.html should send us to file_redirect_to.html
- let promise = ContentTask.spawn(browser, {}, function* () {
- dump('ContentTask starting...\n');
- yield new Promise((resolve) => {
- addEventListener("RedirectDone", function listener() {
- dump('Got RedirectDone\n');
- removeEventListener("RedirectDone", listener);
- resolve();
- }, true, true);
- });
- });
- browser.loadURI(url);
- yield promise;
-
- // Crash the tab
- let annotations = yield BrowserTestUtils.crashBrowser(browser);
-
- ok("URL" in annotations, "annotated a URL");
- is(annotations.URL, redirect_url,
- "Should have annotated the URL after redirect");
- });
-});
diff --git a/toolkit/content/tests/browser/browser_crash_previous_frameloader.js b/toolkit/content/tests/browser/browser_crash_previous_frameloader.js
deleted file mode 100644
index bd50c6ffd..000000000
--- a/toolkit/content/tests/browser/browser_crash_previous_frameloader.js
+++ /dev/null
@@ -1,108 +0,0 @@
-"use strict";
-
-/**
- * Cleans up the .dmp and .extra file from a crash.
- *
- * @param subject (nsISupports)
- * The subject passed through the ipc:content-shutdown
- * observer notification when a content process crash has
- * occurred.
- */
-function cleanUpMinidump(subject) {
- Assert.ok(subject instanceof Ci.nsIPropertyBag2,
- "Subject needs to be a nsIPropertyBag2 to clean up properly");
- let dumpID = subject.getPropertyAsAString("dumpID");
-
- Assert.ok(dumpID, "There should be a dumpID");
- if (dumpID) {
- let dir = Services.dirsvc.get("ProfD", Ci.nsIFile);
- dir.append("minidumps");
-
- let file = dir.clone();
- file.append(dumpID + ".dmp");
- file.remove(true);
-
- file = dir.clone();
- file.append(dumpID + ".extra");
- file.remove(true);
- }
-}
-
-/**
- * This test ensures that if a remote frameloader crashes after
- * the frameloader owner swaps it out for a new frameloader,
- * that a oop-browser-crashed event is not sent to the new
- * frameloader's browser element.
- */
-add_task(function* test_crash_in_previous_frameloader() {
- // On debug builds, crashing tabs results in much thinking, which
- // slows down the test and results in intermittent test timeouts,
- // so we'll pump up the expected timeout for this test.
- requestLongerTimeout(2);
-
- if (!gMultiProcessBrowser) {
- Assert.ok(false, "This test should only be run in multi-process mode.");
- return;
- }
-
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "http://example.com",
- }, function*(browser) {
- // First, sanity check...
- Assert.ok(browser.isRemoteBrowser,
- "This browser needs to be remote if this test is going to " +
- "work properly.");
-
- // We will wait for the oop-browser-crashed event to have
- // a chance to appear. That event is fired when TabParents
- // are destroyed, and that occurs _before_ ContentParents
- // are destroyed, so we'll wait on the ipc:content-shutdown
- // observer notification, which is fired when a ContentParent
- // goes away. After we see this notification, oop-browser-crashed
- // events should have fired.
- let contentProcessGone = TestUtils.topicObserved("ipc:content-shutdown");
- let sawTabCrashed = false;
- let onTabCrashed = () => {
- sawTabCrashed = true;
- };
-
- browser.addEventListener("oop-browser-crashed", onTabCrashed);
-
- // The name of the game is to cause a crash in a remote browser,
- // and then immediately swap out the browser for a non-remote one.
- yield ContentTask.spawn(browser, null, function() {
- const Cu = Components.utils;
- Cu.import("resource://gre/modules/ctypes.jsm");
- Cu.import("resource://gre/modules/Timer.jsm");
-
- let dies = function() {
- privateNoteIntentionalCrash();
- let zero = new ctypes.intptr_t(8);
- let badptr = ctypes.cast(zero, ctypes.PointerType(ctypes.int32_t));
- badptr.contents
- };
-
- // When the parent flips the remoteness of the browser, the
- // page should receive the pagehide event, which we'll then
- // use to crash the frameloader.
- addEventListener("pagehide", function() {
- dump("\nEt tu, Brute?\n");
- dies();
- });
- });
-
- gBrowser.updateBrowserRemoteness(browser, false);
- info("Waiting for content process to go away.");
- let [subject, data] = yield contentProcessGone;
-
- // If we don't clean up the minidump, the harness will
- // complain.
- cleanUpMinidump(subject);
-
- info("Content process is gone!");
- Assert.ok(!sawTabCrashed,
- "Should not have seen the oop-browser-crashed event.");
- browser.removeEventListener("oop-browser-crashed", onTabCrashed);
- });
-});
diff --git a/toolkit/content/tests/browser/browser_datetime_datepicker.js b/toolkit/content/tests/browser/browser_datetime_datepicker.js
deleted file mode 100644
index 966a74e7a..000000000
--- a/toolkit/content/tests/browser/browser_datetime_datepicker.js
+++ /dev/null
@@ -1,284 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-const MONTH_YEAR = ".month-year",
- DAYS_VIEW = ".days-view",
- BTN_PREV_MONTH = ".prev",
- BTN_NEXT_MONTH = ".next";
-const DATE_FORMAT = new Intl.DateTimeFormat("en-US", { year: "numeric", month: "long", timeZone: "UTC" }).format;
-
-// Create a list of abbreviations for calendar class names
-const W = "weekend",
- O = "outside",
- S = "selection",
- R = "out-of-range",
- T = "today",
- P = "off-step";
-
-// Calendar classlist for 2016-12. Used to verify the classNames are correct.
-const calendarClasslist_201612 = [
- [W, O], [O], [O], [O], [], [], [W],
- [W], [], [], [], [], [], [W],
- [W], [], [], [], [S], [], [W],
- [W], [], [], [], [], [], [W],
- [W], [], [], [], [], [], [W],
- [W, O], [O], [O], [O], [O], [O], [W, O],
-];
-
-function getCalendarText() {
- return helper.getChildren(DAYS_VIEW).map(child => child.textContent);
-}
-
-function getCalendarClassList() {
- return helper.getChildren(DAYS_VIEW).map(child => Array.from(child.classList));
-}
-
-function mergeArrays(a, b) {
- return a.map((classlist, index) => classlist.concat(b[index]));
-}
-
-let helper = new DateTimeTestHelper();
-
-registerCleanupFunction(() => {
- helper.cleanup();
-});
-
-/**
- * Test that date picker opens to today's date when input field is blank
- */
-add_task(async function test_datepicker_today() {
- const date = new Date();
-
- await helper.openPicker("data:text/html, <input type='date'>");
-
- Assert.equal(helper.getElement(MONTH_YEAR).textContent, DATE_FORMAT(date));
-
- await helper.tearDown();
-});
-
-/**
- * Test that date picker opens to the correct month, with calendar days
- * displayed correctly, given a date value is set.
- */
-add_task(async function test_datepicker_open() {
- const inputValue = "2016-12-15";
-
- await helper.openPicker(`data:text/html, <input type="date" value="${inputValue}">`);
-
- Assert.equal(helper.getElement(MONTH_YEAR).textContent, DATE_FORMAT(new Date(inputValue)));
- Assert.deepEqual(
- getCalendarText(),
- [
- "27", "28", "29", "30", "1", "2", "3",
- "4", "5", "6", "7", "8", "9", "10",
- "11", "12", "13", "14", "15", "16", "17",
- "18", "19", "20", "21", "22", "23", "24",
- "25", "26", "27", "28", "29", "30", "31",
- "1", "2", "3", "4", "5", "6", "7",
- ],
- "2016-12",
- );
- Assert.deepEqual(
- getCalendarClassList(),
- calendarClasslist_201612,
- "2016-12 classNames"
- );
-
- await helper.tearDown();
-});
-
-/**
- * When the prev month button is clicked, calendar should display the dates for
- * the previous month.
- */
-add_task(async function test_datepicker_prev_month_btn() {
- const inputValue = "2016-12-15";
- const prevMonth = "2016-11-01";
-
- await helper.openPicker(`data:text/html, <input type="date" value="${inputValue}">`);
- helper.click(helper.getElement(BTN_PREV_MONTH));
-
- Assert.equal(helper.getElement(MONTH_YEAR).textContent, DATE_FORMAT(new Date(prevMonth)));
- Assert.deepEqual(
- getCalendarText(),
- [
- "30", "31", "1", "2", "3", "4", "5",
- "6", "7", "8", "9", "10", "11", "12",
- "13", "14", "15", "16", "17", "18", "19",
- "20", "21", "22", "23", "24", "25", "26",
- "27", "28", "29", "30", "1", "2", "3",
- "4", "5", "6", "7", "8", "9", "10",
- ],
- "2016-11",
- );
-
- await helper.tearDown();
-});
-
-/**
- * When the next month button is clicked, calendar should display the dates for
- * the next month.
- */
-add_task(async function test_datepicker_next_month_btn() {
- const inputValue = "2016-12-15";
- const nextMonth = "2017-01-01";
-
- await helper.openPicker(`data:text/html, <input type="date" value="${inputValue}">`);
- helper.click(helper.getElement(BTN_NEXT_MONTH));
-
- Assert.equal(helper.getElement(MONTH_YEAR).textContent, DATE_FORMAT(new Date(nextMonth)));
- Assert.deepEqual(
- getCalendarText(),
- [
- "25", "26", "27", "28", "29", "30", "31",
- "1", "2", "3", "4", "5", "6", "7",
- "8", "9", "10", "11", "12", "13", "14",
- "15", "16", "17", "18", "19", "20", "21",
- "22", "23", "24", "25", "26", "27", "28",
- "29", "30", "31", "1", "2", "3", "4",
- ],
- "2017-01",
- );
-
- await helper.tearDown();
-});
-
-/**
- * When a date on the calendar is clicked, date picker should close and set
- * value to the input box.
- */
-add_task(async function test_datepicker_clicked() {
- const inputValue = "2016-12-15";
- const firstDayOnCalendar = "2016-11-27";
-
- await helper.openPicker(`data:text/html, <input type="date" value="${inputValue}">`);
- // Click the first item (top-left corner) of the calendar
- helper.click(helper.getElement(DAYS_VIEW).children[0]);
- await ContentTask.spawn(helper.tab.linkedBrowser, {}, async function() {
- let inputEl = content.document.querySelector("input");
- await ContentTaskUtils.waitForEvent(inputEl, "input");
- });
-
- Assert.equal(content.document.querySelector("input").value, firstDayOnCalendar);
-
- await helper.tearDown();
-});
-
-/**
- * Make sure picker is in correct state when it is reopened.
- */
-add_task(async function test_datepicker_reopen_state() {
- const inputValue = "2016-12-15";
- const nextMonth = "2017-01-01";
-
- await helper.openPicker(`data:text/html, <input type="date" value="${inputValue}">`);
- // Navigate to the next month but does not commit the change
- Assert.equal(helper.getElement(MONTH_YEAR).textContent, DATE_FORMAT(new Date(inputValue)));
- helper.click(helper.getElement(BTN_NEXT_MONTH));
- Assert.equal(helper.getElement(MONTH_YEAR).textContent, DATE_FORMAT(new Date(nextMonth)));
- EventUtils.synthesizeKey("VK_ESCAPE", {}, window);
-
- // Ensures the picker opens to the month of the input value
- await BrowserTestUtils.synthesizeMouseAtCenter("input", {}, gBrowser.selectedBrowser);
- await helper.waitForPickerReady();
- Assert.equal(helper.getElement(MONTH_YEAR).textContent, DATE_FORMAT(new Date(inputValue)));
-
- await helper.tearDown();
-});
-
-/**
- * When min and max attributes are set, calendar should show some dates as
- * out-of-range.
- */
-add_task(async function test_datepicker_min_max() {
- const inputValue = "2016-12-15";
- const inputMin = "2016-12-05";
- const inputMax = "2016-12-25";
-
- await helper.openPicker(`data:text/html, <input type="date" value="${inputValue}" min="${inputMin}" max="${inputMax}">`);
-
- Assert.deepEqual(
- getCalendarClassList(),
- mergeArrays(calendarClasslist_201612, [
- // R denotes out-of-range
- [R], [R], [R], [R], [R], [R], [R],
- [R], [], [], [], [], [], [],
- [], [], [], [], [], [], [],
- [], [], [], [], [], [], [],
- [], [R], [R], [R], [R], [R], [R],
- [R], [R], [R], [R], [R], [R], [R],
- ]),
- "2016-12 with min & max",
- );
-
- await helper.tearDown();
-});
-
-/**
- * When step attribute is set, calendar should show some dates as off-step.
- */
-add_task(async function test_datepicker_step() {
- const inputValue = "2016-12-15";
- const inputStep = "5";
-
- await helper.openPicker(`data:text/html, <input type="date" value="${inputValue}" step="${inputStep}">`);
-
- Assert.deepEqual(
- getCalendarClassList(),
- mergeArrays(calendarClasslist_201612, [
- // P denotes off-step
- [P], [P], [P], [], [P], [P], [P],
- [P], [], [P], [P], [P], [P], [],
- [P], [P], [P], [P], [], [P], [P],
- [P], [P], [], [P], [P], [P], [P],
- [], [P], [P], [P], [P], [], [P],
- [P], [P], [P], [], [P], [P], [P],
- ]),
- "2016-12 with step",
- );
-
- await helper.tearDown();
-});
-
-add_task(async function test_datepicker_abs_min() {
- const inputValue = "0001-01-01";
- await helper.openPicker(`data:text/html, <input type="date" value="${inputValue}">`);
-
- Assert.deepEqual(
- getCalendarText(),
- [
- "", "1", "2", "3", "4", "5", "6",
- "7", "8", "9", "10", "11", "12", "13",
- "14", "15", "16", "17", "18", "19", "20",
- "21", "22", "23", "24", "25", "26", "27",
- "28", "29", "30", "31", "1", "2", "3",
- "4", "5", "6", "7", "8", "9", "10",
- ],
- "0001-01",
- );
-
- await helper.tearDown();
-});
-
-add_task(async function test_datepicker_abs_max() {
- const inputValue = "275760-09-13";
- await helper.openPicker(`data:text/html, <input type="date" value="${inputValue}">`);
-
- Assert.deepEqual(
- getCalendarText(),
- [
- "31", "1", "2", "3", "4", "5", "6",
- "7", "8", "9", "10", "11", "12", "13",
- "", "", "", "", "", "", "",
- "", "", "", "", "", "", "",
- "", "", "", "", "", "", "",
- "", "", "", "", "", "", "",
- ],
- "275760-09",
- );
-
- await helper.tearDown();
-});
diff --git a/toolkit/content/tests/browser/browser_default_image_filename.js b/toolkit/content/tests/browser/browser_default_image_filename.js
deleted file mode 100644
index 2859d486f..000000000
--- a/toolkit/content/tests/browser/browser_default_image_filename.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var MockFilePicker = SpecialPowers.MockFilePicker;
-MockFilePicker.init(window);
-
-/**
- * TestCase for bug 564387
- * <https://bugzilla.mozilla.org/show_bug.cgi?id=564387>
- */
-add_task(function* () {
- let loadPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
- gBrowser.loadURI("data:image/gif;base64,R0lGODlhEAAOALMAAOazToeHh0tLS/7LZv/0jvb29t/f3//Ub//ge8WSLf/rhf/3kdbW1mxsbP//mf///yH5BAAAAAAALAAAAAAQAA4AAARe8L1Ekyky67QZ1hLnjM5UUde0ECwLJoExKcppV0aCcGCmTIHEIUEqjgaORCMxIC6e0CcguWw6aFjsVMkkIr7g77ZKPJjPZqIyd7sJAgVGoEGv2xsBxqNgYPj/gAwXEQA7");
- yield loadPromise;
-
- let popupShownPromise = BrowserTestUtils.waitForEvent(document, "popupshown");
-
- yield BrowserTestUtils.synthesizeMouseAtCenter("img",
- { type: "contextmenu", button: 2 },
- gBrowser.selectedBrowser);
-
- yield popupShownPromise;
-
- let showFilePickerPromise = new Promise(resolve => {
- MockFilePicker.showCallback = function(fp) {
- is(fp.defaultString, "index.gif");
- resolve();
- }
- });
-
- registerCleanupFunction(function () {
- MockFilePicker.cleanup();
- });
-
- // Select "Save Image As" option from context menu
- var saveImageAsCommand = document.getElementById("context-saveimage");
- saveImageAsCommand.doCommand();
-
- yield showFilePickerPromise;
-
- let contextMenu = document.getElementById("contentAreaContextMenu");
- let popupHiddenPromise = BrowserTestUtils.waitForEvent(contextMenu, "popuphidden");
- contextMenu.hidePopup();
- yield popupHiddenPromise;
-});
diff --git a/toolkit/content/tests/browser/browser_f7_caret_browsing.js b/toolkit/content/tests/browser/browser_f7_caret_browsing.js
deleted file mode 100644
index c4b6823d4..000000000
--- a/toolkit/content/tests/browser/browser_f7_caret_browsing.js
+++ /dev/null
@@ -1,227 +0,0 @@
-var gListener = null;
-const kURL = "data:text/html;charset=utf-8,Caret browsing is fun.<input id='in'>";
-
-const kPrefShortcutEnabled = "accessibility.browsewithcaret_shortcut.enabled";
-const kPrefWarnOnEnable = "accessibility.warn_on_browsewithcaret";
-const kPrefCaretBrowsingOn = "accessibility.browsewithcaret";
-
-var oldPrefs = {};
-for (let pref of [kPrefShortcutEnabled, kPrefWarnOnEnable, kPrefCaretBrowsingOn]) {
- oldPrefs[pref] = Services.prefs.getBoolPref(pref);
-}
-
-Services.prefs.setBoolPref(kPrefShortcutEnabled, true);
-Services.prefs.setBoolPref(kPrefWarnOnEnable, true);
-Services.prefs.setBoolPref(kPrefCaretBrowsingOn, false);
-
-registerCleanupFunction(function() {
- for (let pref of [kPrefShortcutEnabled, kPrefWarnOnEnable, kPrefCaretBrowsingOn]) {
- Services.prefs.setBoolPref(pref, oldPrefs[pref]);
- }
-});
-
-// NB: not using BrowserTestUtils.domWindowOpened here because there's no way to
-// undo waiting for a window open. If we don't want the window to be opened, and
-// wait for it to verify that it indeed does not open, we need to be able to
-// then "stop" waiting so that when we next *do* want it to open, our "old"
-// listener doesn't fire and do things we don't want (like close the window...).
-let gCaretPromptOpeningObserver;
-function promiseCaretPromptOpened() {
- return new Promise(resolve => {
- function observer(subject, topic, data) {
- if (topic == "domwindowopened") {
- Services.ww.unregisterNotification(observer);
- let win = subject.QueryInterface(Ci.nsIDOMWindow);
- BrowserTestUtils.waitForEvent(win, "load", false, e => e.target.location.href != "about:blank").then(() => resolve(win));
- gCaretPromptOpeningObserver = null;
- }
- }
- Services.ww.registerNotification(observer);
- gCaretPromptOpeningObserver = observer;
- });
-}
-
-function hitF7(async = true) {
- let f7 = () => EventUtils.sendKey("F7");
- // Need to not stop execution inside this task:
- if (async) {
- executeSoon(f7);
- } else {
- f7();
- }
-}
-
-function syncToggleCaretNoDialog(expected) {
- let openedDialog = false;
- promiseCaretPromptOpened().then(function(win) {
- openedDialog = true;
- win.close(); // This will eventually return focus here and allow the test to continue...
- });
- // Cause the dialog to appear sync, if it still does.
- hitF7(false);
-
- let expectedStr = expected ? "on." : "off.";
- ok(!openedDialog, "Shouldn't open a dialog to turn caret browsing " + expectedStr);
- // Need to clean up if the dialog wasn't opened, so the observer doesn't get
- // re-triggered later on causing "issues".
- if (!openedDialog) {
- Services.ww.unregisterNotification(gCaretPromptOpeningObserver);
- gCaretPromptOpeningObserver = null;
- }
- let prefVal = Services.prefs.getBoolPref(kPrefCaretBrowsingOn);
- is(prefVal, expected, "Caret browsing should now be " + expectedStr);
-}
-
-function waitForFocusOnInput(browser)
-{
- return ContentTask.spawn(browser, null, function* () {
- let textEl = content.document.getElementById("in");
- return ContentTaskUtils.waitForCondition(() => {
- return content.document.activeElement == textEl;
- }, "Input should get focused.");
- });
-}
-
-function focusInput(browser)
-{
- return ContentTask.spawn(browser, null, function* () {
- let textEl = content.document.getElementById("in");
- textEl.focus();
- });
-}
-
-add_task(function* checkTogglingCaretBrowsing() {
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, kURL);
- yield focusInput(tab.linkedBrowser);
-
- let promiseGotKey = promiseCaretPromptOpened();
- hitF7();
- let prompt = yield promiseGotKey;
- let doc = prompt.document;
- is(doc.documentElement.defaultButton, "cancel", "No button should be the default");
- ok(!doc.getElementById("checkbox").checked, "Checkbox shouldn't be checked by default.");
- let promiseDialogUnloaded = BrowserTestUtils.waitForEvent(prompt, "unload");
-
- doc.documentElement.cancelDialog();
- yield promiseDialogUnloaded;
- info("Dialog unloaded");
- yield waitForFocusOnInput(tab.linkedBrowser);
- ok(!Services.prefs.getBoolPref(kPrefCaretBrowsingOn), "Caret browsing should still be off after cancelling the dialog.");
-
- promiseGotKey = promiseCaretPromptOpened();
- hitF7();
- prompt = yield promiseGotKey;
-
- doc = prompt.document;
- is(doc.documentElement.defaultButton, "cancel", "No button should be the default");
- ok(!doc.getElementById("checkbox").checked, "Checkbox shouldn't be checked by default.");
- promiseDialogUnloaded = BrowserTestUtils.waitForEvent(prompt, "unload");
-
- doc.documentElement.acceptDialog();
- yield promiseDialogUnloaded;
- info("Dialog unloaded");
- yield waitForFocusOnInput(tab.linkedBrowser);
- ok(Services.prefs.getBoolPref(kPrefCaretBrowsingOn), "Caret browsing should be on after accepting the dialog.");
-
- syncToggleCaretNoDialog(false);
-
- promiseGotKey = promiseCaretPromptOpened();
- hitF7();
- prompt = yield promiseGotKey;
- doc = prompt.document;
-
- is(doc.documentElement.defaultButton, "cancel", "No button should be the default");
- ok(!doc.getElementById("checkbox").checked, "Checkbox shouldn't be checked by default.");
-
- promiseDialogUnloaded = BrowserTestUtils.waitForEvent(prompt, "unload");
- doc.documentElement.cancelDialog();
- yield promiseDialogUnloaded;
- info("Dialog unloaded");
- yield waitForFocusOnInput(tab.linkedBrowser);
-
- ok(!Services.prefs.getBoolPref(kPrefCaretBrowsingOn), "Caret browsing should still be off after cancelling the dialog.");
-
- Services.prefs.setBoolPref(kPrefShortcutEnabled, true);
- Services.prefs.setBoolPref(kPrefWarnOnEnable, true);
- Services.prefs.setBoolPref(kPrefCaretBrowsingOn, false);
-
- yield BrowserTestUtils.removeTab(tab);
-});
-
-add_task(function* toggleCheckboxNoCaretBrowsing() {
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, kURL);
- yield focusInput(tab.linkedBrowser);
-
- let promiseGotKey = promiseCaretPromptOpened();
- hitF7();
- let prompt = yield promiseGotKey;
- let doc = prompt.document;
- is(doc.documentElement.defaultButton, "cancel", "No button should be the default");
- let checkbox = doc.getElementById("checkbox");
- ok(!checkbox.checked, "Checkbox shouldn't be checked by default.");
-
- // Check the box:
- checkbox.click();
-
- let promiseDialogUnloaded = BrowserTestUtils.waitForEvent(prompt, "unload");
-
- // Say no:
- doc.documentElement.getButton("cancel").click();
-
- yield promiseDialogUnloaded;
- info("Dialog unloaded");
- yield waitForFocusOnInput(tab.linkedBrowser);
- ok(!Services.prefs.getBoolPref(kPrefCaretBrowsingOn), "Caret browsing should still be off.");
- ok(!Services.prefs.getBoolPref(kPrefShortcutEnabled), "Shortcut should now be disabled.");
-
- syncToggleCaretNoDialog(false);
- ok(!Services.prefs.getBoolPref(kPrefShortcutEnabled), "Shortcut should still be disabled.");
-
- Services.prefs.setBoolPref(kPrefShortcutEnabled, true);
- Services.prefs.setBoolPref(kPrefWarnOnEnable, true);
- Services.prefs.setBoolPref(kPrefCaretBrowsingOn, false);
-
- yield BrowserTestUtils.removeTab(tab);
-});
-
-
-add_task(function* toggleCheckboxWantCaretBrowsing() {
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, kURL);
- yield focusInput(tab.linkedBrowser);
-
- let promiseGotKey = promiseCaretPromptOpened();
- hitF7();
- let prompt = yield promiseGotKey;
- let doc = prompt.document;
- is(doc.documentElement.defaultButton, "cancel", "No button should be the default");
- let checkbox = doc.getElementById("checkbox");
- ok(!checkbox.checked, "Checkbox shouldn't be checked by default.");
-
- // Check the box:
- checkbox.click();
-
- let promiseDialogUnloaded = BrowserTestUtils.waitForEvent(prompt, "unload");
-
- // Say yes:
- doc.documentElement.acceptDialog();
- yield promiseDialogUnloaded;
- info("Dialog unloaded");
- yield waitForFocusOnInput(tab.linkedBrowser);
- ok(Services.prefs.getBoolPref(kPrefCaretBrowsingOn), "Caret browsing should now be on.");
- ok(Services.prefs.getBoolPref(kPrefShortcutEnabled), "Shortcut should still be enabled.");
- ok(!Services.prefs.getBoolPref(kPrefWarnOnEnable), "Should no longer warn when enabling.");
-
- syncToggleCaretNoDialog(false);
- syncToggleCaretNoDialog(true);
- syncToggleCaretNoDialog(false);
-
- Services.prefs.setBoolPref(kPrefShortcutEnabled, true);
- Services.prefs.setBoolPref(kPrefWarnOnEnable, true);
- Services.prefs.setBoolPref(kPrefCaretBrowsingOn, false);
-
- yield BrowserTestUtils.removeTab(tab);
-});
-
-
-
-
diff --git a/toolkit/content/tests/browser/browser_findbar.js b/toolkit/content/tests/browser/browser_findbar.js
deleted file mode 100644
index 1ab06f632..000000000
--- a/toolkit/content/tests/browser/browser_findbar.js
+++ /dev/null
@@ -1,249 +0,0 @@
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-Components.utils.import("resource://gre/modules/Timer.jsm", this);
-
-const TEST_PAGE_URI = "data:text/html;charset=utf-8,The letter s.";
-// Using 'javascript' schema to bypass E10SUtils.canLoadURIInProcess, because
-// it does not allow 'data:' URI to be loaded in the parent process.
-const E10S_PARENT_TEST_PAGE_URI = "javascript:document.write('The letter s.');";
-
-/**
- * Makes sure that the findbar hotkeys (' and /) event listeners
- * are added to the system event group and do not get blocked
- * by calling stopPropagation on a keypress event on a page.
- */
-add_task(function* test_hotkey_event_propagation() {
- info("Ensure hotkeys are not affected by stopPropagation.");
-
- // Opening new tab
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_PAGE_URI);
- let browser = gBrowser.getBrowserForTab(tab);
- let findbar = gBrowser.getFindBar();
-
- // Pressing these keys open the findbar.
- const HOTKEYS = ["/", "'"];
-
- // Checking if findbar appears when any hotkey is pressed.
- for (let key of HOTKEYS) {
- is(findbar.hidden, true, "Findbar is hidden now.");
- gBrowser.selectedTab = tab;
- yield SimpleTest.promiseFocus(gBrowser.selectedBrowser);
- yield BrowserTestUtils.sendChar(key, browser);
- is(findbar.hidden, false, "Findbar should not be hidden.");
- yield closeFindbarAndWait(findbar);
- }
-
- // Stop propagation for all keyboard events.
- let frameScript = () => {
- const stopPropagation = e => e.stopImmediatePropagation();
- let window = content.document.defaultView;
- window.removeEventListener("keydown", stopPropagation);
- window.removeEventListener("keypress", stopPropagation);
- window.removeEventListener("keyup", stopPropagation);
- };
-
- let mm = browser.messageManager;
- mm.loadFrameScript("data:,(" + frameScript.toString() + ")();", false);
-
- // Checking if findbar still appears when any hotkey is pressed.
- for (let key of HOTKEYS) {
- is(findbar.hidden, true, "Findbar is hidden now.");
- gBrowser.selectedTab = tab;
- yield SimpleTest.promiseFocus(gBrowser.selectedBrowser);
- yield BrowserTestUtils.sendChar(key, browser);
- is(findbar.hidden, false, "Findbar should not be hidden.");
- yield closeFindbarAndWait(findbar);
- }
-
- gBrowser.removeTab(tab);
-});
-
-add_task(function* test_not_found() {
- info("Check correct 'Phrase not found' on new tab");
-
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_PAGE_URI);
-
- // Search for the first word.
- yield promiseFindFinished("--- THIS SHOULD NEVER MATCH ---", false);
- let findbar = gBrowser.getFindBar();
- is(findbar._findStatusDesc.textContent, findbar._notFoundStr,
- "Findbar status text should be 'Phrase not found'");
-
- gBrowser.removeTab(tab);
-});
-
-add_task(function* test_found() {
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_PAGE_URI);
-
- // Search for a string that WILL be found, with 'Highlight All' on
- yield promiseFindFinished("S", true);
- ok(!gBrowser.getFindBar()._findStatusDesc.textContent,
- "Findbar status should be empty");
-
- gBrowser.removeTab(tab);
-});
-
-// Setting first findbar to case-sensitive mode should not affect
-// new tab find bar.
-add_task(function* test_tabwise_case_sensitive() {
- let tab1 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_PAGE_URI);
- let findbar1 = gBrowser.getFindBar();
-
- let tab2 = yield BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_PAGE_URI);
- let findbar2 = gBrowser.getFindBar();
-
- // Toggle case sensitivity for first findbar
- findbar1.getElement("find-case-sensitive").click();
-
- gBrowser.selectedTab = tab1;
-
- // Not found for first tab.
- yield promiseFindFinished("S", true);
- is(findbar1._findStatusDesc.textContent, findbar1._notFoundStr,
- "Findbar status text should be 'Phrase not found'");
-
- gBrowser.selectedTab = tab2;
-
- // But it didn't affect the second findbar.
- yield promiseFindFinished("S", true);
- ok(!findbar2._findStatusDesc.textContent, "Findbar status should be empty");
-
- gBrowser.removeTab(tab1);
- gBrowser.removeTab(tab2);
-});
-
-/**
- * Navigating from a web page (for example mozilla.org) to an internal page
- * (like about:addons) might trigger a change of browser's remoteness.
- * 'Remoteness change' means that rendering page content moves from child
- * process into the parent process or the other way around.
- * This test ensures that findbar properly handles such a change.
- */
-add_task(function* test_reinitialization_at_remoteness_change() {
- // This test only makes sence in e10s evironment.
- if (!gMultiProcessBrowser) {
- info("Skipping this test because of non-e10s environment.");
- return;
- }
-
- info("Ensure findbar re-initialization at remoteness change.");
-
- // Load a remote page and trigger findbar construction.
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_PAGE_URI);
- let browser = gBrowser.getBrowserForTab(tab);
- let findbar = gBrowser.getFindBar();
-
- // Findbar should operate normally.
- yield promiseFindFinished("z", false);
- is(findbar._findStatusDesc.textContent, findbar._notFoundStr,
- "Findbar status text should be 'Phrase not found'");
-
- yield promiseFindFinished("s", false);
- ok(!findbar._findStatusDesc.textContent, "Findbar status should be empty");
-
- // Moving browser into the parent process and reloading sample data.
- ok(browser.isRemoteBrowser, "Browser should be remote now.");
- yield promiseRemotenessChange(tab, false);
- yield BrowserTestUtils.loadURI(browser, E10S_PARENT_TEST_PAGE_URI);
- ok(!browser.isRemoteBrowser, "Browser should not be remote any more.");
-
- // Findbar should keep operating normally after remoteness change.
- yield promiseFindFinished("z", false);
- is(findbar._findStatusDesc.textContent, findbar._notFoundStr,
- "Findbar status text should be 'Phrase not found'");
-
- yield promiseFindFinished("s", false);
- ok(!findbar._findStatusDesc.textContent, "Findbar status should be empty");
-
- yield BrowserTestUtils.removeTab(tab);
-});
-
-/**
- * Ensure that the initial typed characters aren't lost immediately after
- * opening the find bar.
- */
-add_task(function* () {
- // This test only makes sence in e10s evironment.
- if (!gMultiProcessBrowser) {
- info("Skipping this test because of non-e10s environment.");
- return;
- }
-
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_PAGE_URI);
- let browser = tab.linkedBrowser;
-
- ok(!gFindBarInitialized, "findbar isn't initialized yet");
-
- let findBar = gFindBar;
- let initialValue = findBar._findField.value;
-
- EventUtils.synthesizeKey("f", { accelKey: true }, window);
-
- let promises = [
- BrowserTestUtils.sendChar("a", browser),
- BrowserTestUtils.sendChar("b", browser),
- BrowserTestUtils.sendChar("c", browser)
- ];
-
- isnot(document.activeElement, findBar._findField.inputField,
- "findbar is not yet focused");
- is(findBar._findField.value, initialValue, "still has initial find query");
-
- yield Promise.all(promises);
- is(document.activeElement, findBar._findField.inputField,
- "findbar is now focused");
- is(findBar._findField.value, "abc", "abc fully entered as find query");
-
- yield BrowserTestUtils.removeTab(tab);
-});
-
-function promiseFindFinished(searchText, highlightOn) {
- let deferred = Promise.defer();
-
- let findbar = gBrowser.getFindBar();
- findbar.startFind(findbar.FIND_NORMAL);
- let highlightElement = findbar.getElement("highlight");
- if (highlightElement.checked != highlightOn)
- highlightElement.click();
- executeSoon(() => {
- findbar._findField.value = searchText;
-
- let resultListener;
- // When highlighting is on the finder sends a second "FOUND" message after
- // the search wraps. This causes timing problems with e10s. waitMore
- // forces foundOrTimeout wait for the second "FOUND" message before
- // resolving the promise.
- let waitMore = highlightOn;
- let findTimeout = setTimeout(() => foundOrTimedout(null), 2000);
- let foundOrTimedout = function(aData) {
- if (aData !== null && waitMore) {
- waitMore = false;
- return;
- }
- if (aData === null)
- info("Result listener not called, timeout reached.");
- clearTimeout(findTimeout);
- findbar.browser.finder.removeResultListener(resultListener);
- deferred.resolve();
- }
-
- resultListener = {
- onFindResult: foundOrTimedout
- };
- findbar.browser.finder.addResultListener(resultListener);
- findbar._find();
- });
-
- return deferred.promise;
-}
-
-function promiseRemotenessChange(tab, shouldBeRemote) {
- return new Promise((resolve) => {
- let browser = gBrowser.getBrowserForTab(tab);
- tab.addEventListener("TabRemotenessChange", function listener() {
- tab.removeEventListener("TabRemotenessChange", listener);
- resolve();
- });
- gBrowser.updateBrowserRemoteness(browser, shouldBeRemote);
- });
-}
diff --git a/toolkit/content/tests/browser/browser_isSynthetic.js b/toolkit/content/tests/browser/browser_isSynthetic.js
deleted file mode 100644
index 15a341461..000000000
--- a/toolkit/content/tests/browser/browser_isSynthetic.js
+++ /dev/null
@@ -1,72 +0,0 @@
-function LocationChangeListener(browser) {
- this.browser = browser;
- browser.addProgressListener(this);
-}
-
-LocationChangeListener.prototype = {
- wasSynthetic: false,
- browser: null,
-
- destroy: function() {
- this.browser.removeProgressListener(this);
- },
-
- onLocationChange: function(webProgress, request, location, flags) {
- this.wasSynthetic = this.browser.isSyntheticDocument;
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
- Ci.nsISupportsWeakReference])
-}
-
-const FILES = gTestPath.replace("browser_isSynthetic.js", "")
- .replace("chrome://mochitests/content/", "http://example.com/");
-
-function waitForPageShow(browser) {
- return ContentTask.spawn(browser, null, function*() {
- Cu.import("resource://gre/modules/PromiseUtils.jsm");
- yield new Promise(resolve => {
- let listener = () => {
- removeEventListener("pageshow", listener, true);
- resolve();
- }
- addEventListener("pageshow", listener, true);
- });
- });
-}
-
-add_task(function*() {
- let tab = gBrowser.addTab("about:blank");
- let browser = tab.linkedBrowser;
- yield BrowserTestUtils.browserLoaded(browser);
- let listener = new LocationChangeListener(browser);
-
- is(browser.isSyntheticDocument, false, "Should not be synthetic");
-
- let loadPromise = waitForPageShow(browser);
- browser.loadURI("data:text/html;charset=utf-8,<html/>");
- yield loadPromise;
- is(listener.wasSynthetic, false, "Should not be synthetic");
- is(browser.isSyntheticDocument, false, "Should not be synthetic");
-
- loadPromise = waitForPageShow(browser);
- browser.loadURI(FILES + "empty.png");
- yield loadPromise;
- is(listener.wasSynthetic, true, "Should be synthetic");
- is(browser.isSyntheticDocument, true, "Should be synthetic");
-
- loadPromise = waitForPageShow(browser);
- browser.goBack();
- yield loadPromise;
- is(listener.wasSynthetic, false, "Should not be synthetic");
- is(browser.isSyntheticDocument, false, "Should not be synthetic");
-
- loadPromise = waitForPageShow(browser);
- browser.goForward();
- yield loadPromise;
- is(listener.wasSynthetic, true, "Should be synthetic");
- is(browser.isSyntheticDocument, true, "Should be synthetic");
-
- listener.destroy();
- gBrowser.removeTab(tab);
-});
diff --git a/toolkit/content/tests/browser/browser_keyevents_during_autoscrolling.js b/toolkit/content/tests/browser/browser_keyevents_during_autoscrolling.js
deleted file mode 100644
index 3fce47114..000000000
--- a/toolkit/content/tests/browser/browser_keyevents_during_autoscrolling.js
+++ /dev/null
@@ -1,120 +0,0 @@
-add_task(function * ()
-{
- const kPrefName_AutoScroll = "general.autoScroll";
- Services.prefs.setBoolPref(kPrefName_AutoScroll, true);
-
- const kNoKeyEvents = 0;
- const kKeyDownEvent = 1;
- const kKeyPressEvent = 2;
- const kKeyUpEvent = 4;
- const kAllKeyEvents = 7;
-
- var expectedKeyEvents;
- var dispatchedKeyEvents;
- var key;
- var root;
-
- /**
- * Encapsulates EventUtils.sendChar().
- */
- function sendChar(aChar)
- {
- key = aChar;
- dispatchedKeyEvents = kNoKeyEvents;
- EventUtils.sendChar(key);
- is(dispatchedKeyEvents, expectedKeyEvents,
- "unexpected key events were dispatched or not dispatched: " + key);
- }
-
- /**
- * Encapsulates EventUtils.sendKey().
- */
- function sendKey(aKey)
- {
- key = aKey;
- dispatchedKeyEvents = kNoKeyEvents;
- EventUtils.sendKey(key);
- is(dispatchedKeyEvents, expectedKeyEvents,
- "unexpected key events were dispatched or not dispatched: " + key);
- }
-
- function onKey(aEvent)
- {
-// if (aEvent.target != root && aEvent.target != root.ownerDocument.body) {
-// ok(false, "unknown target: " + aEvent.target.tagName);
-// return;
-// }
-
- var keyFlag;
- switch (aEvent.type) {
- case "keydown":
- keyFlag = kKeyDownEvent;
- break;
- case "keypress":
- keyFlag = kKeyPressEvent;
- break;
- case "keyup":
- keyFlag = kKeyUpEvent;
- break;
- default:
- ok(false, "Unknown events: " + aEvent.type);
- return;
- }
- dispatchedKeyEvents |= keyFlag;
- is(keyFlag, expectedKeyEvents & keyFlag, aEvent.type + " fired: " + key);
- }
-
- var dataUri = 'data:text/html,<body style="height:10000px;"></body>';
-
- let loadedPromise = BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
- gBrowser.loadURI(dataUri);
- yield loadedPromise;
-
- yield SimpleTest.promiseFocus(gBrowser.selectedBrowser);
-
- window.addEventListener("keydown", onKey, false);
- window.addEventListener("keypress", onKey, false);
- window.addEventListener("keyup", onKey, false);
-
- // Test whether the key events are handled correctly under normal condition
- expectedKeyEvents = kAllKeyEvents;
- sendChar("A");
-
- // Start autoscrolling by middle button click on the page
- let shownPromise = BrowserTestUtils.waitForEvent(window, "popupshown", false,
- event => event.originalTarget.className == "autoscroller");
- yield BrowserTestUtils.synthesizeMouseAtPoint(10, 10, { button: 1 },
- gBrowser.selectedBrowser);
- yield shownPromise;
-
- // Most key events should be eaten by the browser.
- expectedKeyEvents = kNoKeyEvents;
- sendChar("A");
- sendKey("DOWN");
- sendKey("RETURN");
- sendKey("RETURN");
- sendKey("HOME");
- sendKey("END");
- sendKey("TAB");
- sendKey("RETURN");
-
- // Finish autoscrolling by ESC key. Note that only keydown and keypress
- // events are eaten because keyup event is fired *after* the autoscrolling
- // is finished.
- expectedKeyEvents = kKeyUpEvent;
- sendKey("ESCAPE");
-
- // Test whether the key events are handled correctly under normal condition
- expectedKeyEvents = kAllKeyEvents;
- sendChar("A");
-
- window.removeEventListener("keydown", onKey, false);
- window.removeEventListener("keypress", onKey, false);
- window.removeEventListener("keyup", onKey, false);
-
- // restore the changed prefs
- if (Services.prefs.prefHasUserValue(kPrefName_AutoScroll))
- Services.prefs.clearUserPref(kPrefName_AutoScroll);
-
- finish();
-});
diff --git a/toolkit/content/tests/browser/browser_label_textlink.js b/toolkit/content/tests/browser/browser_label_textlink.js
deleted file mode 100644
index 861086707..000000000
--- a/toolkit/content/tests/browser/browser_label_textlink.js
+++ /dev/null
@@ -1,38 +0,0 @@
-add_task(function* () {
- yield BrowserTestUtils.withNewTab({gBrowser, url: "about:config"}, function*(browser) {
- let newTabURL = "http://www.example.com/";
- yield ContentTask.spawn(browser, newTabURL, function*(newTabURL) {
- let doc = content.document;
- let label = doc.createElement("label");
- label.href = newTabURL;
- label.id = "textlink-test";
- label.className = "text-link";
- label.textContent = "click me";
- doc.documentElement.append(label);
- });
-
- // Test that click will open tab in foreground.
- let awaitNewTab = BrowserTestUtils.waitForNewTab(gBrowser, newTabURL);
- yield BrowserTestUtils.synthesizeMouseAtCenter("#textlink-test", {}, browser);
- let newTab = yield awaitNewTab;
- is(newTab.linkedBrowser, gBrowser.selectedBrowser, "selected tab should be example page");
- yield BrowserTestUtils.removeTab(gBrowser.selectedTab);
-
- // Test that ctrl+shift+click/meta+shift+click will open tab in background.
- awaitNewTab = BrowserTestUtils.waitForNewTab(gBrowser, newTabURL);
- yield BrowserTestUtils.synthesizeMouseAtCenter("#textlink-test",
- {ctrlKey: true, metaKey: true, shiftKey: true},
- browser);
- yield awaitNewTab;
- is(gBrowser.selectedBrowser, browser, "selected tab should be original tab");
- yield BrowserTestUtils.removeTab(gBrowser.tabs[gBrowser.tabs.length - 1]);
-
- // Middle-clicking should open tab in foreground.
- awaitNewTab = BrowserTestUtils.waitForNewTab(gBrowser, newTabURL);
- yield BrowserTestUtils.synthesizeMouseAtCenter("#textlink-test",
- {button: 1}, browser);
- newTab = yield awaitNewTab;
- is(newTab.linkedBrowser, gBrowser.selectedBrowser, "selected tab should be example page");
- yield BrowserTestUtils.removeTab(gBrowser.tabs[gBrowser.tabs.length - 1]);
- });
-});
diff --git a/toolkit/content/tests/browser/browser_mediaPlayback.js b/toolkit/content/tests/browser/browser_mediaPlayback.js
deleted file mode 100644
index 1a6ebfcb8..000000000
--- a/toolkit/content/tests/browser/browser_mediaPlayback.js
+++ /dev/null
@@ -1,30 +0,0 @@
-const PAGE = "https://example.com/browser/toolkit/content/tests/browser/file_mediaPlayback.html";
-const FRAME = "https://example.com/browser/toolkit/content/tests/browser/file_mediaPlaybackFrame.html";
-
-function wait_for_event(browser, event) {
- return BrowserTestUtils.waitForEvent(browser, event, false, (event) => {
- is(event.originalTarget, browser, "Event must be dispatched to correct browser.");
- ok(!event.cancelable, "The event should not be cancelable");
- return true;
- });
-}
-
-function* test_on_browser(url, browser) {
- browser.loadURI(url);
- yield wait_for_event(browser, "DOMAudioPlaybackStarted");
- yield wait_for_event(browser, "DOMAudioPlaybackStopped");
-}
-
-add_task(function* test_page() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank",
- }, test_on_browser.bind(undefined, PAGE));
-});
-
-add_task(function* test_frame() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank",
- }, test_on_browser.bind(undefined, FRAME));
-});
diff --git a/toolkit/content/tests/browser/browser_mediaPlayback_mute.js b/toolkit/content/tests/browser/browser_mediaPlayback_mute.js
deleted file mode 100644
index 852fc56fb..000000000
--- a/toolkit/content/tests/browser/browser_mediaPlayback_mute.js
+++ /dev/null
@@ -1,104 +0,0 @@
-const PAGE = "https://example.com/browser/toolkit/content/tests/browser/file_mediaPlayback2.html";
-const FRAME = "https://example.com/browser/toolkit/content/tests/browser/file_mediaPlaybackFrame2.html";
-
-function wait_for_event(browser, event) {
- return BrowserTestUtils.waitForEvent(browser, event, false, (event) => {
- is(event.originalTarget, browser, "Event must be dispatched to correct browser.");
- return true;
- });
-}
-
-function* test_audio_in_browser() {
- function get_audio_element() {
- var doc = content.document;
- var list = doc.getElementsByTagName('audio');
- if (list.length == 1) {
- return list[0];
- }
-
- // iframe?
- list = doc.getElementsByTagName('iframe');
-
- var iframe = list[0];
- list = iframe.contentDocument.getElementsByTagName('audio');
- return list[0];
- }
-
- var audio = get_audio_element();
- return {
- computedVolume: audio.computedVolume,
- computedMuted: audio.computedMuted
- }
-}
-
-function* test_on_browser(url, browser) {
- browser.loadURI(url);
- yield wait_for_event(browser, "DOMAudioPlaybackStarted");
-
- var result = yield ContentTask.spawn(browser, null, test_audio_in_browser);
- is(result.computedVolume, 1, "Audio volume is 1");
- is(result.computedMuted, false, "Audio is not muted");
-
- ok(!browser.audioMuted, "Audio should not be muted by default");
- browser.mute();
- ok(browser.audioMuted, "Audio should be muted now");
-
- yield wait_for_event(browser, "DOMAudioPlaybackStopped");
-
- result = yield ContentTask.spawn(browser, null, test_audio_in_browser);
- is(result.computedVolume, 0, "Audio volume is 0 when muted");
- is(result.computedMuted, true, "Audio is muted");
-}
-
-function* test_visibility(url, browser) {
- browser.loadURI(url);
- yield wait_for_event(browser, "DOMAudioPlaybackStarted");
-
- var result = yield ContentTask.spawn(browser, null, test_audio_in_browser);
- is(result.computedVolume, 1, "Audio volume is 1");
- is(result.computedMuted, false, "Audio is not muted");
-
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank",
- }, function() {});
-
- ok(!browser.audioMuted, "Audio should not be muted by default");
- browser.mute();
- ok(browser.audioMuted, "Audio should be muted now");
-
- yield wait_for_event(browser, "DOMAudioPlaybackStopped");
-
- result = yield ContentTask.spawn(browser, null, test_audio_in_browser);
- is(result.computedVolume, 0, "Audio volume is 0 when muted");
- is(result.computedMuted, true, "Audio is muted");
-}
-
-add_task(function*() {
- yield new Promise((resolve) => {
- SpecialPowers.pushPrefEnv({"set": [
- ["media.useAudioChannelService.testing", true]
- ]}, resolve);
- });
-});
-
-add_task(function* test_page() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank",
- }, test_on_browser.bind(undefined, PAGE));
-});
-
-add_task(function* test_frame() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank",
- }, test_on_browser.bind(undefined, FRAME));
-});
-
-add_task(function* test_frame() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank",
- }, test_visibility.bind(undefined, PAGE));
-});
diff --git a/toolkit/content/tests/browser/browser_mediaPlayback_suspended.js b/toolkit/content/tests/browser/browser_mediaPlayback_suspended.js
deleted file mode 100644
index ef8bb9dc8..000000000
--- a/toolkit/content/tests/browser/browser_mediaPlayback_suspended.js
+++ /dev/null
@@ -1,191 +0,0 @@
-const PAGE = "https://example.com/browser/toolkit/content/tests/browser/file_mediaPlayback2.html";
-
-var SuspendedType = {
- NONE_SUSPENDED : 0,
- SUSPENDED_PAUSE : 1,
- SUSPENDED_BLOCK : 2,
- SUSPENDED_PAUSE_DISPOSABLE : 3
-};
-
-function wait_for_event(browser, event) {
- return BrowserTestUtils.waitForEvent(browser, event, false, (event) => {
- is(event.originalTarget, browser, "Event must be dispatched to correct browser.");
- return true;
- });
-}
-
-function check_audio_onplay() {
- var list = content.document.getElementsByTagName('audio');
- if (list.length != 1) {
- ok(false, "There should be only one audio element in page!")
- }
-
- var audio = list[0];
- return new Promise((resolve, reject) => {
- audio.onplay = () => {
- ok(needToReceiveOnPlay, "Should not receive play event!");
- this.onplay = null;
- reject();
- };
-
- audio.pause();
- audio.play();
-
- setTimeout(() => {
- ok(true, "Doesn't receive play event when media was blocked.");
- audio.onplay = null;
- resolve();
- }, 1000)
- });
-}
-
-function check_audio_suspended(suspendedType) {
- var list = content.document.getElementsByTagName('audio');
- if (list.length != 1) {
- ok(false, "There should be only one audio element in page!")
- }
-
- var audio = list[0];
- is(audio.computedSuspended, suspendedType,
- "The suspended state of MediaElement is correct.");
-}
-
-function check_audio_pause_state(expectedPauseState) {
- var list = content.document.getElementsByTagName('audio');
- if (list.length != 1) {
- ok(false, "There should be only one audio element in page!")
- }
-
- var audio = list[0];
- if (expectedPauseState) {
- is(audio.paused, true, "Audio is paused correctly.");
- } else {
- is(audio.paused, false, "Audio is resumed correctly.");
- }
-}
-
-function* suspended_pause(url, browser) {
- info("### Start test for suspended-pause ###");
- browser.loadURI(url);
-
- info("- page should have playing audio -");
- yield wait_for_event(browser, "DOMAudioPlaybackStarted");
-
- info("- the suspended state of audio should be non-suspened -");
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_audio_suspended);
-
- info("- pause playing audio -");
- browser.pauseMedia(false /* non-disposable */);
- yield ContentTask.spawn(browser, true /* expect for pause */,
- check_audio_pause_state);
- yield ContentTask.spawn(browser, SuspendedType.SUSPENDED_PAUSE,
- check_audio_suspended);
-
- info("- resume paused audio -");
- browser.resumeMedia();
- yield ContentTask.spawn(browser, false /* expect for playing */,
- check_audio_pause_state);
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_audio_suspended);
-}
-
-function* suspended_pause_disposable(url, browser) {
- info("### Start test for suspended-pause-disposable ###");
- browser.loadURI(url);
-
- info("- page should have playing audio -");
- yield wait_for_event(browser, "DOMAudioPlaybackStarted");
-
- info("- the suspended state of audio should be non-suspened -");
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_audio_suspended);
-
- info("- pause playing audio -");
- browser.pauseMedia(true /* disposable */);
- yield ContentTask.spawn(browser, true /* expect for pause */,
- check_audio_pause_state);
- yield ContentTask.spawn(browser, SuspendedType.SUSPENDED_PAUSE_DISPOSABLE,
- check_audio_suspended);
-
- info("- resume paused audio -");
- browser.resumeMedia();
- yield ContentTask.spawn(browser, false /* expect for playing */,
- check_audio_pause_state);
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_audio_suspended);
-}
-
-function* suspended_stop_disposable(url, browser) {
- info("### Start test for suspended-stop-disposable ###");
- browser.loadURI(url);
-
- info("- page should have playing audio -");
- yield wait_for_event(browser, "DOMAudioPlaybackStarted");
-
- info("- the suspended state of audio should be non-suspened -");
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_audio_suspended);
-
- info("- stop playing audio -");
- browser.stopMedia();
- yield wait_for_event(browser, "DOMAudioPlaybackStopped");
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_audio_suspended);
-}
-
-function* suspended_block(url, browser) {
- info("### Start test for suspended-block ###");
- browser.loadURI(url);
-
- info("- page should have playing audio -");
- yield wait_for_event(browser, "DOMAudioPlaybackStarted");
-
- info("- block playing audio -");
- browser.blockMedia();
- yield ContentTask.spawn(browser, SuspendedType.SUSPENDED_BLOCK,
- check_audio_suspended);
- yield ContentTask.spawn(browser, null,
- check_audio_onplay);
-
- info("- resume blocked audio -");
- browser.resumeMedia();
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_audio_suspended);
-}
-
-add_task(function* setup_test_preference() {
- yield new Promise(resolve => {
- SpecialPowers.pushPrefEnv({"set": [
- ["media.useAudioChannelService.testing", true]
- ]}, resolve);
- });
-});
-
-add_task(function* test_suspended_pause() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank"
- }, suspended_pause.bind(this, PAGE));
-});
-
-add_task(function* test_suspended_pause_disposable() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank"
- }, suspended_pause_disposable.bind(this, PAGE));
-});
-
-add_task(function* test_suspended_stop_disposable() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank"
- }, suspended_stop_disposable.bind(this, PAGE));
-});
-
-add_task(function* test_suspended_block() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank"
- }, suspended_block.bind(this, PAGE));
-});
diff --git a/toolkit/content/tests/browser/browser_mediaPlayback_suspended_multipleAudio.js b/toolkit/content/tests/browser/browser_mediaPlayback_suspended_multipleAudio.js
deleted file mode 100644
index 12e2ec077..000000000
--- a/toolkit/content/tests/browser/browser_mediaPlayback_suspended_multipleAudio.js
+++ /dev/null
@@ -1,311 +0,0 @@
-const PAGE = "https://example.com/browser/toolkit/content/tests/browser/file_multipleAudio.html";
-
-var SuspendedType = {
- NONE_SUSPENDED : 0,
- SUSPENDED_PAUSE : 1,
- SUSPENDED_BLOCK : 2,
- SUSPENDED_PAUSE_DISPOSABLE : 3
-};
-
-function wait_for_event(browser, event) {
- return BrowserTestUtils.waitForEvent(browser, event, false, (event) => {
- is(event.originalTarget, browser, "Event must be dispatched to correct browser.");
- return true;
- });
-}
-
-function check_all_audio_suspended(suspendedType) {
- var autoPlay = content.document.getElementById('autoplay');
- var nonAutoPlay = content.document.getElementById('nonautoplay');
- if (!autoPlay || !nonAutoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- is(autoPlay.computedSuspended, suspendedType,
- "The suspeded state of autoplay audio is correct.");
- is(nonAutoPlay.computedSuspended, suspendedType,
- "The suspeded state of non-autoplay audio is correct.");
-}
-
-function check_autoplay_audio_suspended(suspendedType) {
- var autoPlay = content.document.getElementById('autoplay');
- if (!autoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- is(autoPlay.computedSuspended, suspendedType,
- "The suspeded state of autoplay audio is correct.");
-}
-
-function check_nonautoplay_audio_suspended(suspendedType) {
- var nonAutoPlay = content.document.getElementById('nonautoplay');
- if (!nonAutoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- is(nonAutoPlay.computedSuspended, suspendedType,
- "The suspeded state of non-autoplay audio is correct.");
-}
-
-function check_autoplay_audio_pause_state(expectedPauseState) {
- var autoPlay = content.document.getElementById('autoplay');
- if (!autoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- if (autoPlay.paused == expectedPauseState) {
- if (expectedPauseState) {
- ok(true, "Audio is paused correctly.");
- } else {
- ok(true, "Audio is resumed correctly.");
- }
- } else if (expectedPauseState) {
- autoPlay.onpause = function () {
- autoPlay.onpause = null;
- ok(true, "Audio is paused correctly, checking from onpause.");
- }
- } else {
- autoPlay.onplay = function () {
- autoPlay.onplay = null;
- ok(true, "Audio is resumed correctly, checking from onplay.");
- }
- }
-}
-
-function play_nonautoplay_audio_should_be_paused() {
- var nonAutoPlay = content.document.getElementById('nonautoplay');
- if (!nonAutoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- nonAutoPlay.play();
- return new Promise(resolve => {
- nonAutoPlay.onpause = function () {
- nonAutoPlay.onpause = null;
- is(nonAutoPlay.ended, false, "Audio can't be playback.");
- resolve();
- }
- });
-}
-
-function all_audio_onresume() {
- var autoPlay = content.document.getElementById('autoplay');
- var nonAutoPlay = content.document.getElementById('nonautoplay');
- if (!autoPlay || !nonAutoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- is(autoPlay.paused, false, "Autoplay audio is resumed.");
- is(nonAutoPlay.paused, false, "Non-AutoPlay audio is resumed.");
-}
-
-function all_audio_onpause() {
- var autoPlay = content.document.getElementById('autoplay');
- var nonAutoPlay = content.document.getElementById('nonautoplay');
- if (!autoPlay || !nonAutoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- is(autoPlay.paused, true, "Autoplay audio is paused.");
- is(nonAutoPlay.paused, true, "Non-AutoPlay audio is paused.");
-}
-
-function play_nonautoplay_audio_should_play_until_ended() {
- var nonAutoPlay = content.document.getElementById('nonautoplay');
- if (!nonAutoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- nonAutoPlay.play();
- return new Promise(resolve => {
- nonAutoPlay.onended = function () {
- nonAutoPlay.onended = null;
- ok(true, "Audio can be playback until ended.");
- resolve();
- }
- });
-}
-
-function no_audio_resumed() {
- var autoPlay = content.document.getElementById('autoplay');
- var nonAutoPlay = content.document.getElementById('nonautoplay');
- if (!autoPlay || !nonAutoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- is(autoPlay.paused && nonAutoPlay.paused, true, "No audio was resumed.");
-}
-
-function play_nonautoplay_audio_should_be_blocked(suspendedType) {
- var nonAutoPlay = content.document.getElementById('nonautoplay');
- if (!nonAutoPlay) {
- ok(false, "Can't get the audio element!");
- }
-
- nonAutoPlay.play();
- ok(nonAutoPlay.paused, "The blocked audio can't be playback.");
-}
-
-function* suspended_pause(url, browser) {
- info("### Start test for suspended-pause ###");
- browser.loadURI(url);
-
- info("- page should have playing audio -");
- yield wait_for_event(browser, "DOMAudioPlaybackStarted");
-
- info("- the default suspended state of all audio should be non-suspened-");
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_all_audio_suspended);
-
- info("- pause all audio in the page -");
- browser.pauseMedia(false /* non-disposable */);
- yield ContentTask.spawn(browser, true /* expect for pause */,
- check_autoplay_audio_pause_state);
- yield ContentTask.spawn(browser, SuspendedType.SUSPENDED_PAUSE,
- check_autoplay_audio_suspended);
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_nonautoplay_audio_suspended);
-
- info("- no audio can be playback during suspended-paused -");
- yield ContentTask.spawn(browser, null,
- play_nonautoplay_audio_should_be_paused);
- yield ContentTask.spawn(browser, SuspendedType.SUSPENDED_PAUSE,
- check_nonautoplay_audio_suspended);
-
- info("- both audio should be resumed at the same time -");
- browser.resumeMedia();
- yield ContentTask.spawn(browser, null,
- all_audio_onresume);
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_all_audio_suspended);
-
- info("- both audio should be paused at the same time -");
- browser.pauseMedia(false /* non-disposable */);
- yield ContentTask.spawn(browser, null, all_audio_onpause);
-}
-
-function* suspended_pause_disposable(url, browser) {
- info("### Start test for suspended-pause-disposable ###");
- browser.loadURI(url);
-
- info("- page should have playing audio -");
- yield wait_for_event(browser, "DOMAudioPlaybackStarted");
-
- info("- the default suspended state of all audio should be non-suspened -");
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_all_audio_suspended);
-
- info("- only pause playing audio in the page -");
- browser.pauseMedia(true /* non-disposable */);
- yield ContentTask.spawn(browser, true /* expect for pause */,
- check_autoplay_audio_pause_state);
- yield ContentTask.spawn(browser, SuspendedType.SUSPENDED_PAUSE_DISPOSABLE,
- check_autoplay_audio_suspended);
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_nonautoplay_audio_suspended);
-
- info("- new playing audio should be playback correctly -");
- yield ContentTask.spawn(browser, null,
- play_nonautoplay_audio_should_play_until_ended);
-
- info("- should only resume one audio -");
- browser.resumeMedia();
- yield ContentTask.spawn(browser, false /* expect for playing */,
- check_autoplay_audio_pause_state);
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_all_audio_suspended);
-}
-
-function* suspended_stop_disposable(url, browser) {
- info("### Start test for suspended-stop-disposable ###");
- browser.loadURI(url);
-
- info("- page should have playing audio -");
- yield wait_for_event(browser, "DOMAudioPlaybackStarted");
-
- info("- the default suspended state of all audio should be non-suspened -");
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_all_audio_suspended);
-
- info("- only stop playing audio in the page -");
- browser.stopMedia();
- yield wait_for_event(browser, "DOMAudioPlaybackStopped");
- yield ContentTask.spawn(browser, true /* expect for pause */,
- check_autoplay_audio_pause_state);
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_all_audio_suspended);
-
- info("- new playing audio should be playback correctly -");
- yield ContentTask.spawn(browser, null,
- play_nonautoplay_audio_should_play_until_ended);
-
- info("- no any audio can be resumed by page -");
- browser.resumeMedia();
- yield ContentTask.spawn(browser, null, no_audio_resumed);
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_all_audio_suspended);
-}
-
-function* suspended_block(url, browser) {
- info("### Start test for suspended-block ###");
- browser.loadURI(url);
-
- info("- page should have playing audio -");
- yield wait_for_event(browser, "DOMAudioPlaybackStarted");
-
- info("- the default suspended state of all audio should be non-suspened-");
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_all_audio_suspended);
-
- info("- block autoplay audio -");
- browser.blockMedia();
- yield ContentTask.spawn(browser, SuspendedType.SUSPENDED_BLOCK,
- check_autoplay_audio_suspended);
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_nonautoplay_audio_suspended);
-
- info("- no audio can be playback during suspended-block -");
- yield ContentTask.spawn(browser, SuspendedType.SUSPENDED_BLOCK,
- play_nonautoplay_audio_should_be_blocked);
-
- info("- both audio should be resumed at the same time -");
- browser.resumeMedia();
- yield ContentTask.spawn(browser, SuspendedType.NONE_SUSPENDED,
- check_all_audio_suspended);
-}
-
-add_task(function* setup_test_preference() {
- yield new Promise(resolve => {
- SpecialPowers.pushPrefEnv({"set": [
- ["media.useAudioChannelService.testing", true]
- ]}, resolve);
- });
-});
-
-add_task(function* test_suspended_pause() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank"
- }, suspended_pause.bind(this, PAGE));
-});
-
-add_task(function* test_suspended_pause_disposable() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank"
- }, suspended_pause_disposable.bind(this, PAGE));
-});
-
-add_task(function* test_suspended_stop_disposable() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank"
- }, suspended_stop_disposable.bind(this, PAGE));
-});
-
-add_task(function* test_suspended_block() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: "about:blank"
- }, suspended_block.bind(this, PAGE));
-});
diff --git a/toolkit/content/tests/browser/browser_mute.js b/toolkit/content/tests/browser/browser_mute.js
deleted file mode 100644
index f4829b808..000000000
--- a/toolkit/content/tests/browser/browser_mute.js
+++ /dev/null
@@ -1,16 +0,0 @@
-const PAGE = "data:text/html,page";
-
-function* test_on_browser(browser) {
- ok(!browser.audioMuted, "Audio should not be muted by default");
- browser.mute();
- ok(browser.audioMuted, "Audio should be muted now");
- browser.unmute();
- ok(!browser.audioMuted, "Audio should be unmuted now");
-}
-
-add_task(function*() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: PAGE,
- }, test_on_browser);
-});
diff --git a/toolkit/content/tests/browser/browser_mute2.js b/toolkit/content/tests/browser/browser_mute2.js
deleted file mode 100644
index 38f415b71..000000000
--- a/toolkit/content/tests/browser/browser_mute2.js
+++ /dev/null
@@ -1,26 +0,0 @@
-const PAGE = "data:text/html,page";
-
-function* test_on_browser(browser) {
- ok(!browser.audioMuted, "Audio should not be muted by default");
- browser.mute();
- ok(browser.audioMuted, "Audio should be muted now");
-
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: PAGE,
- }, test_on_browser2);
-
- browser.unmute();
- ok(!browser.audioMuted, "Audio should be unmuted now");
-}
-
-function* test_on_browser2(browser) {
- ok(!browser.audioMuted, "Audio should not be muted by default");
-}
-
-add_task(function*() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: PAGE,
- }, test_on_browser);
-});
diff --git a/toolkit/content/tests/browser/browser_quickfind_editable.js b/toolkit/content/tests/browser/browser_quickfind_editable.js
deleted file mode 100644
index d4ab59744..000000000
--- a/toolkit/content/tests/browser/browser_quickfind_editable.js
+++ /dev/null
@@ -1,47 +0,0 @@
-const PAGE = "data:text/html,<div contenteditable>foo</div><input><textarea></textarea>";
-const DESIGNMODE_PAGE = "data:text/html,<body onload='document.designMode=\"on\";'>";
-const HOTKEYS = ["/", "'"];
-
-function* test_hotkeys(browser, expected) {
- let findbar = gBrowser.getFindBar();
- for (let key of HOTKEYS) {
- is(findbar.hidden, true, "findbar is hidden");
- yield BrowserTestUtils.sendChar(key, gBrowser.selectedBrowser);
- is(findbar.hidden, expected, "findbar should" + (expected ? "" : " not") + " be hidden");
- if (!expected) {
- yield closeFindbarAndWait(findbar);
- }
- }
-}
-
-function* focus_element(browser, query) {
- yield ContentTask.spawn(browser, query, function* focus(query) {
- let element = content.document.querySelector(query);
- element.focus();
- });
-}
-
-add_task(function* test_hotkey_on_editable_element() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: PAGE
- }, function* do_tests(browser) {
- yield test_hotkeys(browser, false);
- const ELEMENTS = ["div", "input", "textarea"];
- for (let elem of ELEMENTS) {
- yield focus_element(browser, elem);
- yield test_hotkeys(browser, true);
- yield focus_element(browser, ":root");
- yield test_hotkeys(browser, false);
- }
- });
-});
-
-add_task(function* test_hotkey_on_designMode_document() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: DESIGNMODE_PAGE
- }, function* do_tests(browser) {
- yield test_hotkeys(browser, true);
- });
-});
diff --git a/toolkit/content/tests/browser/browser_saveImageURL.js b/toolkit/content/tests/browser/browser_saveImageURL.js
deleted file mode 100644
index 75e1cfdcd..000000000
--- a/toolkit/content/tests/browser/browser_saveImageURL.js
+++ /dev/null
@@ -1,68 +0,0 @@
-"use strict";
-
-const IMAGE_PAGE = "https://example.com/browser/toolkit/content/tests/browser/image_page.html";
-const PREF_UNSAFE_FORBIDDEN = "dom.ipc.cpows.forbid-unsafe-from-browser";
-
-MockFilePicker.init(window);
-MockFilePicker.returnValue = MockFilePicker.returnCancel;
-
-registerCleanupFunction(function() {
- MockFilePicker.cleanup();
-});
-
-function waitForFilePicker() {
- return new Promise((resolve) => {
- MockFilePicker.showCallback = () => {
- MockFilePicker.showCallback = null;
- ok(true, "Saw the file picker");
- resolve();
- }
- })
-}
-
-/**
- * Test that saveImageURL works when we pass in the aIsContentWindowPrivate
- * argument instead of a document. This is the preferred API.
- */
-add_task(function* preferred_API() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: IMAGE_PAGE,
- }, function*(browser) {
- let url = yield ContentTask.spawn(browser, null, function*() {
- let image = content.document.getElementById("image");
- return image.href;
- });
-
- saveImageURL(url, "image.jpg", null, true, false, null, null, null, null, false);
- yield waitForFilePicker();
- });
-});
-
-/**
- * Test that saveImageURL will still work when passed a document instead
- * of the aIsContentWindowPrivate argument. This is the deprecated API, and
- * will not work in apps using remote browsers having PREF_UNSAFE_FORBIDDEN
- * set to true.
- */
-add_task(function* deprecated_API() {
- yield BrowserTestUtils.withNewTab({
- gBrowser,
- url: IMAGE_PAGE,
- }, function*(browser) {
- yield pushPrefs([PREF_UNSAFE_FORBIDDEN, false]);
-
- let url = yield ContentTask.spawn(browser, null, function*() {
- let image = content.document.getElementById("image");
- return image.href;
- });
-
- // Now get the document directly from content. If we run this test with
- // e10s-enabled, this will be a CPOW, which is forbidden. We'll just
- // pass the XUL document instead to test this interface.
- let doc = document;
-
- saveImageURL(url, "image.jpg", null, true, false, null, doc, null, null);
- yield waitForFilePicker();
- });
-});
diff --git a/toolkit/content/tests/browser/browser_save_resend_postdata.js b/toolkit/content/tests/browser/browser_save_resend_postdata.js
deleted file mode 100644
index 602a13d22..000000000
--- a/toolkit/content/tests/browser/browser_save_resend_postdata.js
+++ /dev/null
@@ -1,145 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var MockFilePicker = SpecialPowers.MockFilePicker;
-MockFilePicker.init(window);
-
-/**
- * Test for bug 471962 <https://bugzilla.mozilla.org/show_bug.cgi?id=471962>:
- * When saving an inner frame as file only, the POST data of the outer page is
- * sent to the address of the inner page.
- *
- * Test for bug 485196 <https://bugzilla.mozilla.org/show_bug.cgi?id=485196>:
- * Web page generated by POST is retried as GET when Save Frame As used, and the
- * page is no longer in the cache.
- */
-function test() {
- waitForExplicitFinish();
-
- gBrowser.loadURI("http://mochi.test:8888/browser/toolkit/content/tests/browser/data/post_form_outer.sjs");
-
- gBrowser.addEventListener("pageshow", function pageShown(event) {
- if (event.target.location == "about:blank")
- return;
- gBrowser.removeEventListener("pageshow", pageShown);
-
- // Submit the form in the outer page, then wait for both the outer
- // document and the inner frame to be loaded again.
- gBrowser.addEventListener("DOMContentLoaded", handleOuterSubmit);
- gBrowser.contentDocument.getElementById("postForm").submit();
- });
-
- var framesLoaded = 0;
- var innerFrame;
-
- function handleOuterSubmit() {
- if (++framesLoaded < 2)
- return;
-
- gBrowser.removeEventListener("DOMContentLoaded", handleOuterSubmit);
-
- innerFrame = gBrowser.contentDocument.getElementById("innerFrame");
-
- // Submit the form in the inner page.
- gBrowser.addEventListener("DOMContentLoaded", handleInnerSubmit);
- innerFrame.contentDocument.getElementById("postForm").submit();
- }
-
- function handleInnerSubmit() {
- gBrowser.removeEventListener("DOMContentLoaded", handleInnerSubmit);
-
- // Create the folder the page will be saved into.
- var destDir = createTemporarySaveDirectory();
- var file = destDir.clone();
- file.append("no_default_file_name");
- MockFilePicker.returnFiles = [file];
- MockFilePicker.showCallback = function(fp) {
- MockFilePicker.filterIndex = 1; // kSaveAsType_URL
- };
-
- mockTransferCallback = onTransferComplete;
- mockTransferRegisterer.register();
-
- registerCleanupFunction(function () {
- mockTransferRegisterer.unregister();
- MockFilePicker.cleanup();
- destDir.remove(true);
- });
-
- var docToSave = innerFrame.contentDocument;
- // We call internalSave instead of saveDocument to bypass the history
- // cache.
- internalSave(docToSave.location.href, docToSave, null, null,
- docToSave.contentType, false, null, null,
- docToSave.referrer ? makeURI(docToSave.referrer) : null,
- docToSave, false, null);
- }
-
- function onTransferComplete(downloadSuccess) {
- ok(downloadSuccess, "The inner frame should have been downloaded successfully");
-
- // Read the entire saved file.
- var file = MockFilePicker.returnFiles[0];
- var fileContents = readShortFile(file);
-
- // Check if outer POST data is found (bug 471962).
- is(fileContents.indexOf("inputfield=outer"), -1,
- "The saved inner frame does not contain outer POST data");
-
- // Check if inner POST data is found (bug 485196).
- isnot(fileContents.indexOf("inputfield=inner"), -1,
- "The saved inner frame was generated using the correct POST data");
-
- finish();
- }
-}
-
-Cc["@mozilla.org/moz/jssubscript-loader;1"]
- .getService(Ci.mozIJSSubScriptLoader)
- .loadSubScript("chrome://mochitests/content/browser/toolkit/content/tests/browser/common/mockTransfer.js",
- this);
-
-function createTemporarySaveDirectory() {
- var saveDir = Cc["@mozilla.org/file/directory_service;1"]
- .getService(Ci.nsIProperties)
- .get("TmpD", Ci.nsIFile);
- saveDir.append("testsavedir");
- if (!saveDir.exists())
- saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755);
- return saveDir;
-}
-
-/**
- * Reads the contents of the provided short file (up to 1 MiB).
- *
- * @param aFile
- * nsIFile object pointing to the file to be read.
- *
- * @return
- * String containing the raw octets read from the file.
- */
-function readShortFile(aFile) {
- var inputStream = Cc["@mozilla.org/network/file-input-stream;1"]
- .createInstance(Ci.nsIFileInputStream);
- inputStream.init(aFile, -1, 0, 0);
- try {
- var scrInputStream = Cc["@mozilla.org/scriptableinputstream;1"]
- .createInstance(Ci.nsIScriptableInputStream);
- scrInputStream.init(inputStream);
- try {
- // Assume that the file is much shorter than 1 MiB.
- return scrInputStream.read(1048576);
- }
- finally {
- // Close the scriptable stream after reading, even if the operation
- // failed.
- scrInputStream.close();
- }
- }
- finally {
- // Close the stream after reading, if it is still open, even if the read
- // operation failed.
- inputStream.close();
- }
-}
diff --git a/toolkit/content/tests/browser/common/mockTransfer.js b/toolkit/content/tests/browser/common/mockTransfer.js
deleted file mode 100644
index c8b8fc161..000000000
--- a/toolkit/content/tests/browser/common/mockTransfer.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-Cc["@mozilla.org/moz/jssubscript-loader;1"]
- .getService(Ci.mozIJSSubScriptLoader)
- .loadSubScript("chrome://mochikit/content/tests/SimpleTest/MockObjects.js", this);
-
-var mockTransferCallback;
-
-/**
- * This "transfer" object implementation continues the currently running test
- * when the download is completed, reporting true for success or false for
- * failure as the first argument of the testRunner.continueTest function.
- */
-function MockTransfer() {
- this._downloadIsSuccessful = true;
-}
-
-MockTransfer.prototype = {
- QueryInterface: XPCOMUtils.generateQI([
- Ci.nsIWebProgressListener,
- Ci.nsIWebProgressListener2,
- Ci.nsITransfer,
- ]),
-
- /* nsIWebProgressListener */
- onStateChange: function MTFC_onStateChange(aWebProgress, aRequest,
- aStateFlags, aStatus) {
- // If at least one notification reported an error, the download failed.
- if (!Components.isSuccessCode(aStatus))
- this._downloadIsSuccessful = false;
-
- // If the download is finished
- if ((aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) &&
- (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK))
- // Continue the test, reporting the success or failure condition.
- mockTransferCallback(this._downloadIsSuccessful);
- },
- onProgressChange: function () {},
- onLocationChange: function () {},
- onStatusChange: function MTFC_onStatusChange(aWebProgress, aRequest, aStatus,
- aMessage) {
- // If at least one notification reported an error, the download failed.
- if (!Components.isSuccessCode(aStatus))
- this._downloadIsSuccessful = false;
- },
- onSecurityChange: function () {},
-
- /* nsIWebProgressListener2 */
- onProgressChange64: function () {},
- onRefreshAttempted: function () {},
-
- /* nsITransfer */
- init: function() {},
- setSha256Hash: function() {},
- setSignatureInfo: function() {}
-};
-
-// Create an instance of a MockObjectRegisterer whose methods can be used to
-// temporarily replace the default "@mozilla.org/transfer;1" object factory with
-// one that provides the mock implementation above. To activate the mock object
-// factory, call the "register" method. Starting from that moment, all the
-// transfer objects that are requested will be mock objects, until the
-// "unregister" method is called.
-var mockTransferRegisterer =
- new MockObjectRegisterer("@mozilla.org/transfer;1", MockTransfer);
diff --git a/toolkit/content/tests/browser/data/post_form_inner.sjs b/toolkit/content/tests/browser/data/post_form_inner.sjs
deleted file mode 100644
index ce72159d8..000000000
--- a/toolkit/content/tests/browser/data/post_form_inner.sjs
+++ /dev/null
@@ -1,31 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const CC = Components.Constructor;
-const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
- "nsIBinaryInputStream",
- "setInputStream");
-
-function handleRequest(request, response)
-{
- var body =
- '<html>\
- <body>\
- Inner POST data: ';
-
- var bodyStream = new BinaryInputStream(request.bodyInputStream);
- var bytes = [], avail = 0;
- while ((avail = bodyStream.available()) > 0)
- body += String.fromCharCode.apply(String, bodyStream.readByteArray(avail));
-
- body +=
- '<form id="postForm" action="post_form_inner.sjs" method="post">\
- <input type="text" name="inputfield" value="inner">\
- <input type="submit">\
- </form>\
- </body>\
- </html>';
-
- response.bodyOutputStream.write(body, body.length);
-}
diff --git a/toolkit/content/tests/browser/data/post_form_outer.sjs b/toolkit/content/tests/browser/data/post_form_outer.sjs
deleted file mode 100644
index 89256fcfb..000000000
--- a/toolkit/content/tests/browser/data/post_form_outer.sjs
+++ /dev/null
@@ -1,34 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const CC = Components.Constructor;
-const BinaryInputStream = CC("@mozilla.org/binaryinputstream;1",
- "nsIBinaryInputStream",
- "setInputStream");
-
-function handleRequest(request, response)
-{
- var body =
- '<html>\
- <body>\
- Outer POST data: ';
-
- var bodyStream = new BinaryInputStream(request.bodyInputStream);
- var bytes = [], avail = 0;
- while ((avail = bodyStream.available()) > 0)
- body += String.fromCharCode.apply(String, bodyStream.readByteArray(avail));
-
- body +=
- '<form id="postForm" action="post_form_outer.sjs" method="post">\
- <input type="text" name="inputfield" value="outer">\
- <input type="submit">\
- </form>\
- \
- <iframe id="innerFrame" src="post_form_inner.sjs" width="400" height="200">\
- \
- </body>\
- </html>';
-
- response.bodyOutputStream.write(body, body.length);
-}
diff --git a/toolkit/content/tests/browser/empty.png b/toolkit/content/tests/browser/empty.png
deleted file mode 100644
index 17ddf0c3e..000000000
--- a/toolkit/content/tests/browser/empty.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/content/tests/browser/file_contentTitle.html b/toolkit/content/tests/browser/file_contentTitle.html
deleted file mode 100644
index 8d330aa0f..000000000
--- a/toolkit/content/tests/browser/file_contentTitle.html
+++ /dev/null
@@ -1,14 +0,0 @@
-<html>
-<head><title>Test Page</title></head>
-<body>
-<script type="text/javascript">
-dump("Script!\n");
-addEventListener("load", () => {
- // Trigger an onLocationChange event. We want to make sure the title is still correct afterwards.
- location.hash = "#x2";
- var event = new Event("TestLocationChange");
- document.dispatchEvent(event);
-}, false);
-</script>
-</body>
-</html>
diff --git a/toolkit/content/tests/browser/file_mediaPlayback.html b/toolkit/content/tests/browser/file_mediaPlayback.html
deleted file mode 100644
index 5df0bc154..000000000
--- a/toolkit/content/tests/browser/file_mediaPlayback.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<script type="text/javascript">
-var audio = new Audio();
-audio.oncanplay = function() {
- audio.oncanplay = null;
- audio.play();
-};
-audio.src = "audio.ogg";
-</script>
diff --git a/toolkit/content/tests/browser/file_mediaPlayback2.html b/toolkit/content/tests/browser/file_mediaPlayback2.html
deleted file mode 100644
index dffbd299b..000000000
--- a/toolkit/content/tests/browser/file_mediaPlayback2.html
+++ /dev/null
@@ -1,12 +0,0 @@
-<!DOCTYPE html>
-<body>
-<script type="text/javascript">
-var audio = new Audio();
-audio.oncanplay = function() {
- audio.oncanplay = null;
- audio.play();
-};
-audio.src = "audio.ogg";
-document.body.appendChild(audio);
-</script>
-</body>
diff --git a/toolkit/content/tests/browser/file_mediaPlaybackFrame.html b/toolkit/content/tests/browser/file_mediaPlaybackFrame.html
deleted file mode 100644
index 119db62ec..000000000
--- a/toolkit/content/tests/browser/file_mediaPlaybackFrame.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<!DOCTYPE html>
-<iframe src="file_mediaPlayback.html"></iframe>
diff --git a/toolkit/content/tests/browser/file_mediaPlaybackFrame2.html b/toolkit/content/tests/browser/file_mediaPlaybackFrame2.html
deleted file mode 100644
index d96a4cd4e..000000000
--- a/toolkit/content/tests/browser/file_mediaPlaybackFrame2.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<!DOCTYPE html>
-<iframe src="file_mediaPlayback2.html"></iframe>
diff --git a/toolkit/content/tests/browser/file_multipleAudio.html b/toolkit/content/tests/browser/file_multipleAudio.html
deleted file mode 100644
index 5dc37febb..000000000
--- a/toolkit/content/tests/browser/file_multipleAudio.html
+++ /dev/null
@@ -1,19 +0,0 @@
-<!DOCTYPE html>
-<head>
- <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
- <meta content="utf-8" http-equiv="encoding">
-</head>
-<body>
-<audio id="autoplay" src="audio.ogg"></audio>
-<audio id="nonautoplay" src="audio.ogg"></audio>
-<script type="text/javascript">
-
-// In linux debug on try server, sometimes the download process would fail, so
-// we can't activate the "auto-play" or playing after receving "oncanplay".
-// Therefore, we just call play here.
-var audio = document.getElementById("autoplay");
-audio.loop = true;
-audio.play();
-
-</script>
-</body>
diff --git a/toolkit/content/tests/browser/file_multiplePlayingAudio.html b/toolkit/content/tests/browser/file_multiplePlayingAudio.html
deleted file mode 100644
index ae122506f..000000000
--- a/toolkit/content/tests/browser/file_multiplePlayingAudio.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<!DOCTYPE html>
-<head>
- <meta content="text/html;charset=utf-8" http-equiv="Content-Type">
- <meta content="utf-8" http-equiv="encoding">
-</head>
-<body>
-<audio id="audio1" src="audio.ogg" controls></audio>
-<audio id="audio2" src="audio.ogg" controls></audio>
-<script type="text/javascript">
-
-// In linux debug on try server, sometimes the download process would fail, so
-// we can't activate the "auto-play" or playing after receving "oncanplay".
-// Therefore, we just call play here.
-var audio1 = document.getElementById("audio1");
-audio1.loop = true;
-audio1.play();
-
-var audio2 = document.getElementById("audio2");
-audio2.loop = true;
-audio2.play();
-
-</script>
-</body>
diff --git a/toolkit/content/tests/browser/file_redirect.html b/toolkit/content/tests/browser/file_redirect.html
deleted file mode 100644
index 4d5fa9dfd..000000000
--- a/toolkit/content/tests/browser/file_redirect.html
+++ /dev/null
@@ -1,13 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<title>redirecting...</title>
-<script>
-window.addEventListener("load",
- () => window.location = "file_redirect_to.html");
-</script>
-<body>
-redirectin u bro
-</body>
-</html>
diff --git a/toolkit/content/tests/browser/file_redirect_to.html b/toolkit/content/tests/browser/file_redirect_to.html
deleted file mode 100644
index 28c0b5371..000000000
--- a/toolkit/content/tests/browser/file_redirect_to.html
+++ /dev/null
@@ -1,15 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<title>redirected!</title>
-<script>
-window.addEventListener("load", () => {
- var event = new Event("RedirectDone");
- document.dispatchEvent(event);
-});
-</script>
-<body>
-u got redirected, bro
-</body>
-</html>
diff --git a/toolkit/content/tests/browser/head.js b/toolkit/content/tests/browser/head.js
deleted file mode 100644
index d7ed7a9ff..000000000
--- a/toolkit/content/tests/browser/head.js
+++ /dev/null
@@ -1,123 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-
-/**
- * A wrapper for the findbar's method "close", which is not synchronous
- * because of animation.
- */
-function closeFindbarAndWait(findbar) {
- return new Promise((resolve) => {
- if (findbar.hidden) {
- resolve();
- return;
- }
- findbar.addEventListener("transitionend", function cont(aEvent) {
- if (aEvent.propertyName != "visibility") {
- return;
- }
- findbar.removeEventListener("transitionend", cont);
- resolve();
- });
- findbar.close();
- });
-}
-
-function pushPrefs(...aPrefs) {
- let deferred = Promise.defer();
- SpecialPowers.pushPrefEnv({"set": aPrefs}, deferred.resolve);
- return deferred.promise;
-}
-
-/**
- * Helper class for testing datetime input picker widget
- */
-class DateTimeTestHelper {
- constructor() {
- this.panel = document.getElementById("DateTimePickerPanel");
- this.panel.setAttribute("animate", false);
- this.tab = null;
- this.frame = null;
- }
-
- /**
- * Opens a new tab with the URL of the test page, and make sure the picker is
- * ready for testing.
- *
- * @param {String} pageUrl
- */
- async openPicker(pageUrl) {
- this.tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, pageUrl);
- await BrowserTestUtils.synthesizeMouseAtCenter("input", {}, gBrowser.selectedBrowser);
- // If dateTimePopupFrame doesn't exist yet, wait for the binding to be attached
- if (!this.panel.dateTimePopupFrame) {
- await BrowserTestUtils.waitForEvent(this.panel, "DateTimePickerBindingReady")
- }
- this.frame = this.panel.dateTimePopupFrame;
- await this.waitForPickerReady();
- }
-
- async waitForPickerReady() {
- await BrowserTestUtils.waitForEvent(this.frame, "load", true);
- // Wait for picker elements to be ready
- await BrowserTestUtils.waitForEvent(this.frame.contentDocument, "PickerReady");
- }
-
- /**
- * Find an element on the picker.
- *
- * @param {String} selector
- * @return {DOMElement}
- */
- getElement(selector) {
- return this.frame.contentDocument.querySelector(selector);
- }
-
- /**
- * Find the children of an element on the picker.
- *
- * @param {String} selector
- * @return {Array<DOMElement>}
- */
- getChildren(selector) {
- return Array.from(this.getElement(selector).children);
- }
-
- /**
- * Click on an element
- *
- * @param {DOMElement} element
- */
- click(element) {
- EventUtils.synthesizeMouseAtCenter(element, {}, this.frame.contentWindow);
- }
-
- /**
- * Close the panel and the tab
- */
- async tearDown() {
- if (!this.panel.hidden) {
- let pickerClosePromise = new Promise(resolve => {
- this.panel.addEventListener("popuphidden", resolve, {once: true});
- });
- this.panel.hidePopup();
- this.panel.closePicker();
- await pickerClosePromise;
- }
- await BrowserTestUtils.removeTab(this.tab);
- this.tab = null;
- }
-
- /**
- * Clean up after tests. Remove the frame to prevent leak.
- */
- cleanup() {
- this.frame.remove();
- this.frame = null;
- this.panel.removeAttribute("animate");
- this.panel = null;
- }
-}
diff --git a/toolkit/content/tests/browser/image.jpg b/toolkit/content/tests/browser/image.jpg
deleted file mode 100644
index 5031808ad..000000000
--- a/toolkit/content/tests/browser/image.jpg
+++ /dev/null
Binary files differ
diff --git a/toolkit/content/tests/browser/image_page.html b/toolkit/content/tests/browser/image_page.html
deleted file mode 100644
index 522a1d8cf..000000000
--- a/toolkit/content/tests/browser/image_page.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
-<meta charset="utf-8">
-<title>OHAI</title>
-<body>
-<img id="image" src="image.jpg" />
-</body>
-</html>
diff --git a/toolkit/content/tests/chrome/.eslintrc.js b/toolkit/content/tests/chrome/.eslintrc.js
deleted file mode 100644
index 2c669d844..000000000
--- a/toolkit/content/tests/chrome/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/content/tests/chrome/RegisterUnregisterChrome.js b/toolkit/content/tests/chrome/RegisterUnregisterChrome.js
deleted file mode 100644
index 34f25d2f8..000000000
--- a/toolkit/content/tests/chrome/RegisterUnregisterChrome.js
+++ /dev/null
@@ -1,161 +0,0 @@
-/* This code is mostly copied from chrome/test/unit/head_crtestutils.js */
-
-const NS_CHROME_MANIFESTS_FILE_LIST = "ChromeML";
-const XUL_CACHE_PREF = "nglayout.debug.disable_xul_cache";
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-
-var gDirSvc = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIDirectoryService).QueryInterface(Ci.nsIProperties);
-var gChromeReg = Cc["@mozilla.org/chrome/chrome-registry;1"].
- getService(Ci.nsIXULChromeRegistry);
-var gPrefs = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
-
-// Create the temporary file in the profile, instead of in TmpD, because
-// we know the mochitest harness kills off the profile when it's done.
-function copyToTemporaryFile(f)
-{
- let tmpd = gDirSvc.get("ProfD", Ci.nsIFile);
- tmpf = tmpd.clone();
- tmpf.append("temp.manifest");
- tmpf.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, 0o600);
- tmpf.remove(false);
- f.copyTo(tmpd, tmpf.leafName);
- return tmpf;
-}
-
-function* dirIter(directory)
-{
- var ioSvc = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
- var testsDir = ioSvc.newURI(directory, null, null)
- .QueryInterface(Ci.nsIFileURL).file;
-
- let en = testsDir.directoryEntries;
- while (en.hasMoreElements()) {
- let file = en.getNext();
- yield file.QueryInterface(Ci.nsIFile);
- }
-}
-
-function getParent(path) {
- let lastSlash = path.lastIndexOf("/");
- if (lastSlash == -1) {
- lastSlash = path.lastIndexOf("\\");
- if (lastSlash == -1) {
- return "";
- }
- return '/' + path.substring(0, lastSlash).replace(/\\/g, '/');
- }
- return path.substring(0, lastSlash);
-}
-
-function copyDirToTempProfile(path, subdirname) {
-
- if (subdirname === undefined) {
- subdirname = "mochikit-tmp";
- }
-
- let tmpdir = gDirSvc.get("ProfD", Ci.nsIFile);
- tmpdir.append(subdirname);
- tmpdir.createUnique(Components.interfaces.nsIFile.DIRECTORY_TYPE, 0o777);
-
- let rootDir = getParent(path);
- if (rootDir == "") {
- return tmpdir;
- }
-
- // The SimpleTest directory is hidden
- var files = Array.from(dirIter('file://' + rootDir));
- for (f in files) {
- files[f].copyTo(tmpdir, "");
- }
- return tmpdir;
-
-}
-
-function convertChromeURI(chromeURI)
-{
- let uri = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService).newURI(chromeURI, null, null);
- return gChromeReg.convertChromeURL(uri);
-}
-
-function chromeURIToFile(chromeURI)
-{
- var jar = getJar(chromeURI);
- if (jar) {
- var tmpDir = extractJarToTmp(jar);
- let parts = chromeURI.split('/');
- if (parts[parts.length - 1] != '') {
- tmpDir.append(parts[parts.length - 1]);
- }
- return tmpDir;
- }
-
- return convertChromeURI(chromeURI).
- QueryInterface(Ci.nsIFileURL).file;
-}
-
-// Register a chrome manifest temporarily and return a function which un-does
-// the registrarion when no longer needed.
-function createManifestTemporarily(tempDir, manifestText)
-{
- gPrefs.setBoolPref(XUL_CACHE_PREF, true);
-
- tempDir.append("temp.manifest");
-
- let foStream = Cc["@mozilla.org/network/file-output-stream;1"]
- .createInstance(Ci.nsIFileOutputStream);
- foStream.init(tempDir,
- 0x02 | 0x08 | 0x20, 0o664, 0); // write, create, truncate
- foStream.write(manifestText, manifestText.length);
- foStream.close();
- let tempfile = copyToTemporaryFile(tempDir);
-
- Components.manager.QueryInterface(Ci.nsIComponentRegistrar).
- autoRegister(tempfile);
-
- gChromeReg.refreshSkins();
-
- return function() {
- tempfile.fileSize = 0; // truncate the manifest
- gChromeReg.checkForNewChrome();
- gChromeReg.refreshSkins();
- gPrefs.clearUserPref(XUL_CACHE_PREF);
- }
-}
-
-// Register a chrome manifest temporarily and return a function which un-does
-// the registrarion when no longer needed.
-function registerManifestTemporarily(manifestURI)
-{
- gPrefs.setBoolPref(XUL_CACHE_PREF, true);
-
- let file = chromeURIToFile(manifestURI);
-
- let tempfile = copyToTemporaryFile(file);
- Components.manager.QueryInterface(Ci.nsIComponentRegistrar).
- autoRegister(tempfile);
-
- gChromeReg.refreshSkins();
-
- return function() {
- tempfile.fileSize = 0; // truncate the manifest
- gChromeReg.checkForNewChrome();
- gChromeReg.refreshSkins();
- gPrefs.clearUserPref(XUL_CACHE_PREF);
- }
-}
-
-function registerManifestPermanently(manifestURI)
-{
- var chromepath = chromeURIToFile(manifestURI);
-
- Components.manager.QueryInterface(Ci.nsIComponentRegistrar).
- autoRegister(chromepath);
- return chromepath;
-}
diff --git a/toolkit/content/tests/chrome/bug263683_window.xul b/toolkit/content/tests/chrome/bug263683_window.xul
deleted file mode 100644
index 46985a7ad..000000000
--- a/toolkit/content/tests/chrome/bug263683_window.xul
+++ /dev/null
@@ -1,210 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-
-<window id="263683test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="600"
- height="600"
- onload="SimpleTest.executeSoon(startTest);"
- title="263683 test">
-
- <script type="application/javascript"><![CDATA[
- const {interfaces: Ci, classes: Cc, results: Cr, utils: Cu} = Components;
- Cu.import("resource://gre/modules/AppConstants.jsm");
- Cu.import("resource://gre/modules/Task.jsm");
- Cu.import("resource://testing-common/BrowserTestUtils.jsm");
- Cu.import("resource://testing-common/ContentTask.jsm");
- ContentTask.setTestScope(window.opener.wrappedJSObject);
-
- var gPrefsvc = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
- var gFindBar = null;
- var gBrowser;
-
- var imports = ["SimpleTest", "ok", "info", "is"];
- for (var name of imports) {
- window[name] = window.opener.wrappedJSObject[name];
- }
-
- function startTest() {
- Task.spawn(function* () {
- gFindBar = document.getElementById("FindToolbar");
- for (let browserId of ["content", "content-remote"]) {
- yield startTestWithBrowser(browserId);
- }
- }).then(() => {
- window.close();
- SimpleTest.finish();
- });
- }
-
- function* startTestWithBrowser(browserId) {
- // We're bailing out when testing a remote browser on OSX 10.6, because it
- // fails permanently.
- if (browserId.endsWith("remote") && AppConstants.isPlatformAndVersionAtMost("macosx", 11)) {
- return;
- }
-
- info("Starting test with browser '" + browserId + "'");
- gBrowser = document.getElementById(browserId);
- gFindBar.browser = gBrowser;
- let promise = BrowserTestUtils.browserLoaded(gBrowser);
- gBrowser.loadURI('data:text/html,<h2>Text mozilla</h2><input id="inp" type="text" />');
- yield promise;
- yield onDocumentLoaded();
- }
-
- function toggleHighlightAndWait(highlight) {
- return new Promise(resolve => {
- let listener = {
- onHighlightFinished: function() {
- gFindBar.browser.finder.removeResultListener(listener);
- resolve();
- }
- };
- gFindBar.browser.finder.addResultListener(listener);
- gFindBar.toggleHighlight(highlight);
- });
- }
-
- function* onDocumentLoaded() {
- gFindBar.open();
- var search = "mozilla";
- gFindBar._findField.focus();
- gFindBar._findField.value = search;
- var matchCase = gFindBar.getElement("find-case-sensitive");
- if (matchCase.checked) {
- matchCase.doCommand();
- }
-
- yield toggleHighlightAndWait(true);
- gFindBar._find();
-
- yield ContentTask.spawn(gBrowser, { search }, function* (args) {
- let controller = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISelectionDisplay)
- .QueryInterface(Ci.nsISelectionController);
- Assert.ok("SELECTION_FIND" in controller, "Correctly detects new selection type");
- let selection = controller.getSelection(controller.SELECTION_FIND);
-
- Assert.equal(selection.rangeCount, 1,
- "Correctly added a match to the selection type");
- Assert.equal(selection.getRangeAt(0).toString().toLowerCase(),
- args.search, "Added the correct match");
- });
-
- yield toggleHighlightAndWait(false);
-
- yield ContentTask.spawn(gBrowser, { search }, function* (args) {
- let controller = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISelectionDisplay)
- .QueryInterface(Ci.nsISelectionController);
- let selection = controller.getSelection(controller.SELECTION_FIND);
- Assert.equal(selection.rangeCount, 0, "Correctly removed the range");
-
- let input = content.document.getElementById("inp");
- input.value = args.search;
- });
-
- yield toggleHighlightAndWait(true);
-
- yield ContentTask.spawn(gBrowser, { search }, function* (args) {
- let input = content.document.getElementById("inp");
- let inputController = input.editor.selectionController;
- let inputSelection = inputController.getSelection(inputController.SELECTION_FIND);
-
- Assert.equal(inputSelection.rangeCount, 1,
- "Correctly added a match from input to the selection type");
- Assert.equal(inputSelection.getRangeAt(0).toString().toLowerCase(),
- args.search, "Added the correct match");
- });
-
- yield toggleHighlightAndWait(false);
-
- yield ContentTask.spawn(gBrowser, null, function* () {
- let input = content.document.getElementById("inp");
- let inputController = input.editor.selectionController;
- let inputSelection = inputController.getSelection(inputController.SELECTION_FIND);
-
- Assert.equal(inputSelection.rangeCount, 0, "Correctly removed the range");
- });
-
- // For posterity, test iframes too.
-
- let promise = BrowserTestUtils.browserLoaded(gBrowser);
- gBrowser.loadURI('data:text/html,<h2>Text mozilla</h2><iframe id="leframe" ' +
- 'src="data:text/html,Text mozilla"></iframe>');
- yield promise;
-
- yield toggleHighlightAndWait(true);
-
- yield ContentTask.spawn(gBrowser, { search }, function* (args) {
- function getSelection(docShell) {
- let controller = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISelectionDisplay)
- .QueryInterface(Ci.nsISelectionController);
- return controller.getSelection(controller.SELECTION_FIND);
- }
-
- let selection = getSelection(docShell);
- Assert.equal(selection.rangeCount, 1,
- "Correctly added a match to the selection type");
- Assert.equal(selection.getRangeAt(0).toString().toLowerCase(),
- args.search, "Added the correct match");
-
- // Check the iframe too:
- let frame = content.document.getElementById("leframe");
- // Hoops! Get the docShell first, then the selection.
- selection = getSelection(frame.contentWindow
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell));
- Assert.equal(selection.rangeCount, 1,
- "Correctly added a match to the selection type");
- Assert.equal(selection.getRangeAt(0).toString().toLowerCase(),
- args.search, "Added the correct match");
- });
-
- yield toggleHighlightAndWait(false);
-
- let matches = gFindBar._foundMatches.value.match(/([\d]*)\sof\s([\d]*)/);
- is(matches[1], "2", "Found correct amount of matches")
-
- yield ContentTask.spawn(gBrowser, null, function* (args) {
- function getSelection(docShell) {
- let controller = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISelectionDisplay)
- .QueryInterface(Ci.nsISelectionController);
- return controller.getSelection(controller.SELECTION_FIND);
- }
-
- let selection = getSelection(docShell);
- Assert.equal(selection.rangeCount, 0, "Correctly removed the range");
-
- // Check the iframe too:
- let frame = content.document.getElementById("leframe");
- // Hoops! Get the docShell first, then the selection.
- selection = getSelection(frame.contentWindow
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell));
- Assert.equal(selection.rangeCount, 0, "Correctly removed the range");
-
- content.document.documentElement.focus();
- });
-
- gFindBar.close(true);
- }
- ]]></script>
-
- <browser type="content-primary" flex="1" id="content" src="about:blank"/>
- <browser type="content-primary" flex="1" id="content-remote" remote="true" src="about:blank"/>
- <findbar id="FindToolbar" browserid="content"/>
-</window>
diff --git a/toolkit/content/tests/chrome/bug304188_window.xul b/toolkit/content/tests/chrome/bug304188_window.xul
deleted file mode 100644
index 931fd5c73..000000000
--- a/toolkit/content/tests/chrome/bug304188_window.xul
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="600"
- height="600"
- onload="onLoad();"
- title="FindbarTest for bug 304188 -
-find-menu appears in editor element which has had makeEditable() called but designMode not set">
-
- <script type="application/javascript"><![CDATA[
- const {interfaces: Ci, classes: Cc, results: Cr, utils: Cu} = Components;
- Cu.import("resource://gre/modules/Task.jsm");
- Cu.import("resource://testing-common/ContentTask.jsm");
- ContentTask.setTestScope(window.opener.wrappedJSObject);
-
- var gFindBar = null;
- var gBrowser;
-
- var imports = ["SimpleTest", "ok", "info"];
- for (var name of imports) {
- window[name] = window.opener.wrappedJSObject[name];
- }
-
- function onLoad() {
- Task.spawn(function* () {
- gFindBar = document.getElementById("FindToolbar");
- for (let browserId of ["content", "content-remote"]) {
- yield startTestWithBrowser(browserId);
- }
- }).then(() => {
- window.close();
- SimpleTest.finish();
- });
- }
-
- function* startTestWithBrowser(browserId) {
- info("Starting test with browser '" + browserId + "'");
- gBrowser = document.getElementById(browserId);
- gFindBar.browser = gBrowser;
- let promise = ContentTask.spawn(gBrowser, null, function* () {
- return new Promise(resolve => {
- addEventListener("DOMContentLoaded", function listener() {
- removeEventListener("DOMContentLoaded", listener);
- resolve();
- });
- });
- });
- gBrowser.loadURI("data:text/html;charset=utf-8,some%20random%20text");
- yield promise;
- yield onDocumentLoaded();
- }
-
- function* onDocumentLoaded() {
- yield ContentTask.spawn(gBrowser, null, function* () {
- var edsession = content.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIEditingSession);
- edsession.makeWindowEditable(content, "html", false, true, false);
- content.focus();
- });
-
- yield enterStringIntoEditor("'");
- yield enterStringIntoEditor("/");
-
- ok(gFindBar.hidden,
- "Findfield should have stayed hidden after entering editor test");
- }
-
- function* enterStringIntoEditor(aString) {
- for (let i = 0; i < aString.length; i++) {
- yield ContentTask.spawn(gBrowser, { charCode: aString.charCodeAt(i) }, function* (args) {
- let event = content.document.createEvent("KeyboardEvent");
- event.initKeyEvent("keypress", true, true, null, false, false,
- false, false, 0, args.charCode);
- content.document.body.dispatchEvent(event);
- });
- }
- }
- ]]></script>
-
- <browser id="content" flex="1" src="about:blank" type="content-primary"/>
- <browser id="content-remote" remote="true" flex="1" src="about:blank" type="content-primary"/>
- <findbar id="FindToolbar" browserid="content"/>
-</window>
diff --git a/toolkit/content/tests/chrome/bug331215_window.xul b/toolkit/content/tests/chrome/bug331215_window.xul
deleted file mode 100644
index 757ce61b8..000000000
--- a/toolkit/content/tests/chrome/bug331215_window.xul
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-
-<window id="331215test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="600"
- height="600"
- onload="SimpleTest.executeSoon(startTest);"
- title="331215 test">
-
- <script type="application/javascript"><![CDATA[
- const {interfaces: Ci, classes: Cc, results: Cr, utils: Cu} = Components;
- Cu.import("resource://gre/modules/Task.jsm");
- Cu.import("resource://testing-common/BrowserTestUtils.jsm");
- Cu.import("resource://testing-common/ContentTask.jsm");
- ContentTask.setTestScope(window.opener.wrappedJSObject);
-
- var gFindBar = null;
- var gBrowser;
-
- var imports = ["SimpleTest", "ok", "info"];
- for (var name of imports) {
- window[name] = window.opener.wrappedJSObject[name];
- }
- SimpleTest.requestLongerTimeout(2);
-
- function startTest() {
- Task.spawn(function* () {
- gFindBar = document.getElementById("FindToolbar");
- for (let browserId of ["content", "content-remote"]) {
- yield startTestWithBrowser(browserId);
- }
- }).then(() => {
- window.close();
- SimpleTest.finish();
- });
- }
-
- function* startTestWithBrowser(browserId) {
- info("Starting test with browser '" + browserId + "'");
- gBrowser = document.getElementById(browserId);
- gFindBar.browser = gBrowser;
- let promise = BrowserTestUtils.browserLoaded(gBrowser);
- gBrowser.loadURI("data:text/plain,latest");
- yield promise;
- yield onDocumentLoaded();
- }
-
- function* onDocumentLoaded() {
- document.getElementById("cmd_find").doCommand();
- yield promiseEnterStringIntoFindField("test");
- document.commandDispatcher
- .getControllerForCommand("cmd_moveTop")
- .doCommand("cmd_moveTop");
- yield promiseEnterStringIntoFindField("l");
- ok(gFindBar._findField.getAttribute("status") == "notfound",
- "Findfield status attribute should have been 'notfound' after entering test");
- yield promiseEnterStringIntoFindField("a");
- ok(gFindBar._findField.getAttribute("status") != "notfound",
- "Findfield status attribute should not have been 'notfound' after entering latest");
- }
-
- function promiseEnterStringIntoFindField(aString) {
- return new Promise(resolve => {
- let listener = {
- onFindResult: function(result) {
- if (result.result == Ci.nsITypeAheadFind.FIND_FOUND && result.searchString != aString)
- return;
- gFindBar.browser.finder.removeResultListener(listener);
- resolve();
- }
- };
- gFindBar.browser.finder.addResultListener(listener);
-
- for (let c of aString) {
- let code = c.charCodeAt(0);
- let ev = new KeyboardEvent("keypress", {
- keyCode: code,
- charCode: code,
- bubbles: true
- });
- gFindBar._findField.inputField.dispatchEvent(ev);
- }
- });
- }
- ]]></script>
-
- <commandset>
- <command id="cmd_find" oncommand="document.getElementById('FindToolbar').onFindCommand();"/>
- </commandset>
- <browser type="content-primary" flex="1" id="content" src="about:blank"/>
- <browser type="content-primary" flex="1" id="content-remote" remote="true" src="about:blank"/>
- <findbar id="FindToolbar" browserid="content"/>
-</window>
diff --git a/toolkit/content/tests/chrome/bug360437_window.xul b/toolkit/content/tests/chrome/bug360437_window.xul
deleted file mode 100644
index 08498b58b..000000000
--- a/toolkit/content/tests/chrome/bug360437_window.xul
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-
-<window id="360437Test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="600"
- height="600"
- onload="startTest();"
- title="360437 test">
-
- <script type="application/javascript"><![CDATA[
- const {interfaces: Ci, classes: Cc, results: Cr, utils: Cu} = Components;
- Cu.import("resource://gre/modules/Task.jsm");
- Cu.import("resource://testing-common/ContentTask.jsm");
- ContentTask.setTestScope(window.opener.wrappedJSObject);
-
- var gFindBar = null;
- var gBrowser;
-
- var imports = ["SimpleTest", "ok", "is", "info"];
- for (var name of imports) {
- window[name] = window.opener.wrappedJSObject[name];
- }
-
- function startTest() {
- Task.spawn(function* () {
- gFindBar = document.getElementById("FindToolbar");
- for (let browserId of ["content", "content-remote"]) {
- yield startTestWithBrowser(browserId);
- }
- }).then(() => {
- window.close();
- SimpleTest.finish();
- });
- }
-
- function* startTestWithBrowser(browserId) {
- info("Starting test with browser '" + browserId + "'");
- gBrowser = document.getElementById(browserId);
- gFindBar.browser = gBrowser;
- let promise = ContentTask.spawn(gBrowser, null, function* () {
- return new Promise(resolve => {
- addEventListener("DOMContentLoaded", function listener() {
- removeEventListener("DOMContentLoaded", listener);
- resolve();
- });
- });
- });
- gBrowser.loadURI("data:text/html,<form><input id='input' type='text' value='text inside an input element'></form>");
- yield promise;
- yield onDocumentLoaded();
- }
-
- function* onDocumentLoaded() {
- gFindBar.onFindCommand();
-
- // Make sure the findfield is correctly focused on open
- var searchStr = "text inside an input element";
- yield promiseEnterStringIntoFindField(searchStr);
- is(document.commandDispatcher.focusedElement,
- gFindBar._findField.inputField, "Find field isn't focused");
-
- // Make sure "find again" correctly transfers focus to the content element
- // when the find bar is closed.
- gFindBar.close();
- gFindBar.onFindAgainCommand(false);
- yield ContentTask.spawn(gBrowser, null, function* () {
- Assert.equal(content.document.activeElement,
- content.document.getElementById("input"), "Input Element isn't focused");
- });
-
- // Make sure "find again" doesn't focus the content element if focus
- // isn't in the content document.
- var textbox = document.getElementById("textbox");
- textbox.focus();
- gFindBar.close();
- gFindBar.onFindAgainCommand(false);
- ok(textbox.hasAttribute("focused"),
- "Focus was stolen from a chrome element");
- }
-
- function promiseFindResult(str = null) {
- return new Promise(resolve => {
- let listener = {
- onFindResult: function({ searchString }) {
- if (str !== null && str != searchString) {
- return;
- }
- gFindBar.browser.finder.removeResultListener(listener);
- resolve();
- }
- };
- gFindBar.browser.finder.addResultListener(listener);
- });
- }
-
- function promiseEnterStringIntoFindField(str) {
- let promise = promiseFindResult(str);
- for (let i = 0; i < str.length; i++) {
- let event = document.createEvent("KeyboardEvent");
- event.initKeyEvent("keypress", true, true, null, false, false,
- false, false, 0, str.charCodeAt(i));
- gFindBar._findField.inputField.dispatchEvent(event);
- }
- return promise;
- }
- ]]></script>
- <textbox id="textbox"/>
- <browser type="content-primary" flex="1" id="content" src="about:blank"/>
- <browser type="content-primary" flex="1" id="content-remote" remote="true" src="about:blank"/>
- <findbar id="FindToolbar" browserid="content"/>
-</window>
diff --git a/toolkit/content/tests/chrome/bug366992_window.xul b/toolkit/content/tests/chrome/bug366992_window.xul
deleted file mode 100644
index a1e2ae1af..000000000
--- a/toolkit/content/tests/chrome/bug366992_window.xul
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
-
-<window id="366992 test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="onLoad();"
- width="600"
- height="600"
- title="366992 test">
-
- <commandset id="editMenuCommands"/>
-
- <script type="application/javascript"
- src="chrome://global/content/globalOverlay.js"/>
- <script type="application/javascript"><![CDATA[
- // Without the fix for bug 366992, the delete command would be enabled
- // for the textbox even though the textbox's controller for this command
- // disables it.
- var gShouldNotBeReachedController = {
- supportsCommand: function(aCommand) {
- return aCommand == "cmd_delete";
- },
- isCommandEnabled: function(aCommand) {
- return aCommand == "cmd_delete";
- },
- doCommand: function(aCommand) { }
- }
-
- function ok(condition, message) {
- window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
- }
- function finish() {
- window.controllers.removeController(gShouldNotBeReachedController);
- window.close();
- window.opener.wrappedJSObject.SimpleTest.finish();
- }
-
- function onLoad() {
- document.getElementById("textbox").focus();
- var deleteDisabled = document.getElementById("cmd_delete")
- .getAttribute("disabled") == "true";
- ok(deleteDisabled,
- "cmd_delete should be disabled when the empty textbox is focused");
- finish();
- }
-
- window.controllers.appendController(gShouldNotBeReachedController);
- ]]></script>
-
- <textbox id="textbox"/>
-</window>
diff --git a/toolkit/content/tests/chrome/bug409624_window.xul b/toolkit/content/tests/chrome/bug409624_window.xul
deleted file mode 100644
index 002cbe042..000000000
--- a/toolkit/content/tests/chrome/bug409624_window.xul
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window id="409624test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="600"
- height="600"
- title="409624 test">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
- <script type="application/javascript"><![CDATA[
- var gFindBar = null;
- var gBrowser;
-
- var imports = ["SimpleTest", "ok", "is"];
- for (var name of imports) {
- window[name] = window.opener.wrappedJSObject[name];
- }
-
- function finish() {
- window.close();
- SimpleTest.finish();
- }
-
- function startTest() {
- gFindBar = document.getElementById("FindToolbar");
- gBrowser = document.getElementById("content");
- gBrowser.addEventListener("pageshow", onPageShow, false);
- gBrowser.loadURI('data:text/html,<h2>Text mozilla</h2><input id="inp" type="text" />');
- }
-
- function onPageShow() {
- gBrowser.removeEventListener("pageshow", onPageShow, false);
- gFindBar.clear();
- let textbox = gFindBar.getElement("findbar-textbox");
-
- // Clear should work regardless of whether the editor has been lazily
- // initialised yet
- ok(!gFindBar.hasTransactions, "No transactions when findbar empty");
- textbox.value = "mozilla";
- ok(gFindBar.hasTransactions, "Has transactions when findbar value set without editor init");
- gFindBar.clear();
- is(textbox.value, '', "findbar input value cleared after clear() call without editor init");
- ok(!gFindBar.hasTransactions, "No transactions after clear() call");
-
- gFindBar.open();
- let matchCaseCheckbox = gFindBar.getElement("find-case-sensitive");
- if (!matchCaseCheckbox.hidden && matchCaseCheckbox.checked)
- matchCaseCheckbox.click();
- ok(!matchCaseCheckbox.checked, "case-insensitivity correctly set");
-
- // Simulate typical input
- textbox.focus();
- gFindBar.clear();
- sendChar("m");
- ok(gFindBar.hasTransactions, "Has transactions after input");
- let preSelection = gBrowser.contentWindow.getSelection();
- ok(!preSelection.isCollapsed, "Found item and selected range");
- gFindBar.clear();
- is(textbox.value, '', "findbar input value cleared after clear() call");
- let postSelection = gBrowser.contentWindow.getSelection();
- ok(postSelection.isCollapsed, "item found deselected after clear() call");
- let fp = gFindBar.getElement("find-previous");
- ok(fp.disabled, "find-previous button disabled after clear() call");
- let fn = gFindBar.getElement("find-next");
- ok(fn.disabled, "find-next button disabled after clear() call");
-
- // Test status updated after a search for text not in page
- textbox.focus();
- sendChar("x");
- gFindBar.clear();
- let ftext = gFindBar.getElement("find-status");
- is(ftext.textContent, "", "status text disabled after clear() call");
-
- // Test input empty with undo stack non-empty
- textbox.focus();
- sendChar("m");
- sendKey("BACK_SPACE");
- ok(gFindBar.hasTransactions, "Has transactions when undo available");
- gFindBar.clear();
- gFindBar.close();
-
- finish();
- }
-
- SimpleTest.waitForFocus(startTest, window);
- ]]></script>
-
- <browser type="content-primary" flex="1" id="content" src="about:blank"/>
- <findbar id="FindToolbar" browserid="content"/>
-</window>
diff --git a/toolkit/content/tests/chrome/bug429723_window.xul b/toolkit/content/tests/chrome/bug429723_window.xul
deleted file mode 100644
index 28439ae8e..000000000
--- a/toolkit/content/tests/chrome/bug429723_window.xul
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window id="429723Test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="600"
- height="600"
- onload="onLoad();"
- title="429723 test">
-
- <script type="application/javascript"><![CDATA[
- var gFindBar = null;
- var gBrowser;
-
- function ok(condition, message) {
- window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
- }
-
- function finish() {
- window.close();
- window.opener.wrappedJSObject.SimpleTest.finish();
- }
-
- function onLoad() {
- var _delayedOnLoad = function() {
- gFindBar = document.getElementById("FindToolbar");
- gBrowser = document.getElementById("content");
- gBrowser.addEventListener("pageshow", onPageShow, false);
- gBrowser.loadURI("data:text/html,<h2 id='h2'>mozilla</h2>");
- }
- setTimeout(_delayedOnLoad, 1000);
- }
-
- function enterStringIntoFindField(aString) {
- for (var i=0; i < aString.length; i++) {
- var event = document.createEvent("KeyboardEvent");
- event.initKeyEvent("keypress", true, true, null, false, false,
- false, false, 0, aString.charCodeAt(i));
- gFindBar._findField.inputField.dispatchEvent(event);
- }
- }
-
- function onPageShow() {
- gBrowser.removeEventListener("pageshow", onPageShow, false);
- var findField = gFindBar._findField;
- document.getElementById("cmd_find").doCommand();
-
- var matchCaseCheckbox = gFindBar.getElement("find-case-sensitive");
- if (!matchCaseCheckbox.hidden & matchCaseCheckbox.checked)
- matchCaseCheckbox.click();
-
- // Perform search
- var searchStr = "z";
- enterStringIntoFindField(searchStr);
-
- // Highlight search term
- var highlight = gFindBar.getElement("highlight");
- if (!highlight.checked)
- highlight.click();
-
- // Delete search term
- var event = document.createEvent("KeyboardEvent");
- event.initKeyEvent("keypress", true, true, null, false, false,
- false, false, KeyEvent.DOM_VK_BACK_SPACE, 0);
- gFindBar._findField.inputField.dispatchEvent(event);
-
- var notRed = !findField.hasAttribute("status") ||
- (findField.getAttribute("status") != "notfound");
- ok(notRed, "Find Bar textbox is correct colour");
- finish();
- }
- ]]></script>
-
- <commandset>
- <command id="cmd_find" oncommand="document.getElementById('FindToolbar').onFindCommand();"/>
- </commandset>
- <browser type="content-primary" flex="1" id="content" src="about:blank"/>
- <findbar id="FindToolbar" browserid="content"/>
-</window>
diff --git a/toolkit/content/tests/chrome/bug451540_window.xul b/toolkit/content/tests/chrome/bug451540_window.xul
deleted file mode 100644
index 3c08c95c9..000000000
--- a/toolkit/content/tests/chrome/bug451540_window.xul
+++ /dev/null
@@ -1,248 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
-
-<window id="451540test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="600"
- height="600"
- title="451540 test">
-
- <script type="application/javascript"><![CDATA[
- const {interfaces: Ci, classes: Cc, results: Cr, utils: Cu} = Components;
- Cu.import("resource://gre/modules/Task.jsm");
- Cu.import("resource://testing-common/BrowserTestUtils.jsm");
- Cu.import("resource://testing-common/ContentTask.jsm");
- ContentTask.setTestScope(window.opener.wrappedJSObject);
- const SEARCH_TEXT = "minefield";
-
- let gFindBar = null;
- let gPrefsvc = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
- let gBrowser;
-
- let sendCtrl = true;
- let sendMeta = false;
- if (navigator.platform.indexOf("Mac") >= 0) {
- sendCtrl = false;
- sendMeta = true;
- }
-
- let imports = [ "SimpleTest", "ok", "is", "info"];
- for (let name of imports) {
- window[name] = window.opener.wrappedJSObject[name];
- }
-
- SimpleTest.requestLongerTimeout(2);
-
- function startTest() {
- gFindBar = document.getElementById("FindToolbar");
- gBrowser = document.getElementById("content");
- gBrowser.addEventListener("pageshow", onPageShow, false);
- let data = `data:text/html,<input id="inp" type="text" />
- <textarea id="tarea"/>`;
- gBrowser.loadURI(data);
- }
-
- function promiseHighlightFinished() {
- return new Promise(resolve => {
- let listener = {
- onHighlightFinished() {
- gFindBar.browser.finder.removeResultListener(listener);
- resolve();
- }
- };
- gFindBar.browser.finder.addResultListener(listener);
- });
- }
-
- function* resetForNextTest(elementId, aText) {
- if (!aText)
- aText = SEARCH_TEXT;
-
- // Turn off highlighting
- let highlightButton = gFindBar.getElement("highlight");
- if (highlightButton.checked) {
- highlightButton.click();
- }
-
- // Initialise input
- info(`setting element value to ${aText}`);
- yield ContentTask.spawn(gBrowser, {elementId, aText}, function*(args) {
- let {elementId, aText} = args;
- let doc = content.document;
- let element = doc.getElementById(elementId);
- element.value = aText;
- element.focus();
- });
- info(`just set element value to ${aText}`);
- gFindBar._findField.value = SEARCH_TEXT;
-
- // Perform search and turn on highlighting
- gFindBar._find();
- highlightButton.click();
- yield promiseHighlightFinished();
-
- // Move caret to start of element
- info(`focusing element`);
- yield ContentTask.spawn(gBrowser, elementId, function*(elementId) {
- let doc = content.document;
- let element = doc.getElementById(elementId);
- element.focus();
- });
- info(`focused element`);
- if (navigator.platform.indexOf("Mac") >= 0) {
- yield BrowserTestUtils.synthesizeKey("VK_LEFT", { metaKey: true }, gBrowser);
- } else {
- yield BrowserTestUtils.synthesizeKey("VK_HOME", {}, gBrowser);
- }
- }
-
- function* testSelection(elementId, expectedRangeCount, message) {
- yield ContentTask.spawn(gBrowser, {elementId, expectedRangeCount, message}, function*(args) {
- let {elementId, expectedRangeCount, message} = args;
- let doc = content.document;
- let element = doc.getElementById(elementId);
- let controller = element.editor.selectionController;
- let selection = controller.getSelection(controller.SELECTION_FIND);
- Assert.equal(selection.rangeCount, expectedRangeCount, message);
- });
- }
-
- function* testInput(elementId, testTypeText) {
- let isEditableElement = yield ContentTask.spawn(gBrowser, elementId, function*(elementId) {
- let doc = content.document;
- let element = doc.getElementById(elementId);
- return element instanceof Ci.nsIDOMNSEditableElement;
- });
- if (!isEditableElement) {
- return;
- }
-
- // Initialize the findbar
- let matchCase = gFindBar.getElement("find-case-sensitive");
- if (matchCase.checked) {
- matchCase.doCommand();
- }
-
- // First check match has been correctly highlighted
- yield resetForNextTest(elementId);
-
- yield testSelection(elementId, 1, testTypeText + " correctly highlighted match");
-
- // Test 2: check highlight removed when text added within the highlight
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", {}, gBrowser);
- yield BrowserTestUtils.synthesizeKey("a", {}, gBrowser);
-
- yield testSelection(elementId, 0, testTypeText + " correctly removed highlight on text insertion");
-
- // Test 3: check highlighting remains when text added before highlight
- yield resetForNextTest(elementId);
- yield BrowserTestUtils.synthesizeKey("a", {}, gBrowser);
- yield testSelection(elementId, 1, testTypeText + " highlight correctly remained on text insertion at start");
-
- // Test 4: check highlighting remains when text added after highlight
- yield resetForNextTest(elementId);
- for (let x = 0; x < SEARCH_TEXT.length; x++) {
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", {}, gBrowser);
- }
- yield BrowserTestUtils.synthesizeKey("a", {}, gBrowser);
- yield testSelection(elementId, 1, testTypeText + " highlight correctly remained on text insertion at end");
-
- // Test 5: deleting text within the highlight
- yield resetForNextTest(elementId);
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", {}, gBrowser);
- yield BrowserTestUtils.synthesizeKey("VK_BACK_SPACE", {}, gBrowser);
- yield testSelection(elementId, 0, testTypeText + " correctly removed highlight on text deletion");
-
- // Test 6: deleting text at end of highlight
- yield resetForNextTest(elementId, SEARCH_TEXT + "A");
- for (let x = 0; x < (SEARCH_TEXT + "A").length; x++) {
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", {}, gBrowser);
- }
- yield BrowserTestUtils.synthesizeKey("VK_BACK_SPACE", {}, gBrowser);
- yield testSelection(elementId, 1, testTypeText + " highlight correctly remained on text deletion at end");
-
- // Test 7: deleting text at start of highlight
- yield resetForNextTest(elementId, "A" + SEARCH_TEXT);
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", {}, gBrowser);
- yield BrowserTestUtils.synthesizeKey("VK_BACK_SPACE", {}, gBrowser);
- yield testSelection(elementId, 1, testTypeText + " highlight correctly remained on text deletion at start");
-
- // Test 8: deleting selection
- yield resetForNextTest(elementId);
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", { shiftKey: true }, gBrowser);
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", { shiftKey: true }, gBrowser);
- yield BrowserTestUtils.synthesizeKey("x", { ctrlKey: sendCtrl, metaKey: sendMeta }, gBrowser);
- yield testSelection(elementId, 0, testTypeText + " correctly removed highlight on selection deletion");
-
- // Test 9: Multiple matches within one editor (part 1)
- // Check second match remains highlighted after inserting text into
- // first match, and that its highlighting gets removed when the
- // second match is edited
- yield resetForNextTest(elementId, SEARCH_TEXT + " " + SEARCH_TEXT);
- yield testSelection(elementId, 2, testTypeText + " correctly highlighted both matches");
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", {}, gBrowser);
- yield BrowserTestUtils.synthesizeKey("a", {}, gBrowser);
- yield testSelection(elementId, 1, testTypeText + " correctly removed only the first highlight on text insertion");
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", { ctrlKey: sendCtrl, metaKey: sendMeta }, gBrowser);
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", { ctrlKey: sendCtrl, metaKey: sendMeta }, gBrowser);
- yield BrowserTestUtils.synthesizeKey("VK_LEFT", {}, gBrowser);
- yield BrowserTestUtils.synthesizeKey("a", {}, gBrowser);
- yield testSelection(elementId, 0, testTypeText + " correctly removed second highlight on text insertion");
-
- // Test 10: Multiple matches within one editor (part 2)
- // Check second match remains highlighted after deleting text in
- // first match, and that its highlighting gets removed when the
- // second match is edited
- yield resetForNextTest(elementId, SEARCH_TEXT + " " + SEARCH_TEXT);
- yield testSelection(elementId, 2, testTypeText + " correctly highlighted both matches");
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", {}, gBrowser);
- yield BrowserTestUtils.synthesizeKey("VK_BACK_SPACE", {}, gBrowser);
- yield testSelection(elementId, 1, testTypeText + " correctly removed only the first highlight on text deletion");
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", { ctrlKey: sendCtrl, metaKey: sendMeta }, gBrowser);
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", { ctrlKey: sendCtrl, metaKey: sendMeta }, gBrowser);
- yield BrowserTestUtils.synthesizeKey("VK_LEFT", {}, gBrowser);
- yield BrowserTestUtils.synthesizeKey("VK_BACK_SPACE", {}, gBrowser);
- yield testSelection(elementId, 0, testTypeText + " correctly removed second highlight on text deletion");
-
- // Test 11: Multiple matches within one editor (part 3)
- // Check second match remains highlighted after deleting selection
- // in first match, and that second match highlighting gets correctly
- // removed when it has a selection deleted from it
- yield resetForNextTest(elementId, SEARCH_TEXT + " " + SEARCH_TEXT);
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", { shiftKey: true }, gBrowser);
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", { shiftKey: true }, gBrowser);
- yield BrowserTestUtils.synthesizeKey("x", { ctrlKey: sendCtrl, metaKey: sendMeta }, gBrowser);
- yield testSelection(elementId, 1, testTypeText + " correctly removed only first highlight on selection deletion");
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", { ctrlKey: sendCtrl, metaKey: sendMeta }, gBrowser);
- yield BrowserTestUtils.synthesizeKey("VK_RIGHT", { ctrlKey: sendCtrl, metaKey: sendMeta }, gBrowser);
- yield BrowserTestUtils.synthesizeKey("VK_LEFT", { shiftKey: true }, gBrowser);
- yield BrowserTestUtils.synthesizeKey("VK_LEFT", { shiftKey: true }, gBrowser);
- yield BrowserTestUtils.synthesizeKey("x", { ctrlKey: sendCtrl, metaKey: sendMeta }, gBrowser);
- yield testSelection(elementId, 0, testTypeText + " correctly removed second highlight on selection deletion");
- }
-
- function onPageShow() {
- gBrowser.removeEventListener("load", onPageShow, true);
- Task.spawn(function*() {
- gFindBar.open();
- yield testInput("inp", "Input:");
- yield testInput("tarea", "Textarea:");
- }).then(() => {
- window.close();
- SimpleTest.finish();
- });
- }
-
- SimpleTest.waitForFocus(startTest, window);
- ]]></script>
-
- <browser type="content-primary" flex="1" id="content" src="about:blank"/>
- <browser type="content-primary" flex="1" id="content-remote" remote="true" src="about:blank"/>
- <findbar id="FindToolbar" browserid="content"/>
-</window>
diff --git a/toolkit/content/tests/chrome/bug624329_window.xul b/toolkit/content/tests/chrome/bug624329_window.xul
deleted file mode 100644
index efca39d3b..000000000
--- a/toolkit/content/tests/chrome/bug624329_window.xul
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window title="Test for bug 624329 context menu position"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- context="menu">
-
- <script>
- opener.SimpleTest.waitForFocus(opener.childFocused, window);
- </script>
-
- <menupopup id="menu">
- <!-- The bug demonstrated only when the accesskey was presented separately
- from the label.
- e.g. because the accesskey is not a letter in the label.
-
- The bug demonstrates only on the first show of the context menu
- unless menu items are removed/added each time the menu is
- constructed. -->
- <menuitem label="Long label to ensure the popup would hit the right of the screen" accesskey="1"/>
- </menupopup>
-</window>
diff --git a/toolkit/content/tests/chrome/chrome.ini b/toolkit/content/tests/chrome/chrome.ini
deleted file mode 100644
index 2b9be4c8e..000000000
--- a/toolkit/content/tests/chrome/chrome.ini
+++ /dev/null
@@ -1,199 +0,0 @@
-[DEFAULT]
-skip-if = os == 'android'
-support-files =
- ../widgets/popup_shared.js
- ../widgets/tree_shared.js
- RegisterUnregisterChrome.js
- bug263683_window.xul
- bug304188_window.xul
- bug331215_window.xul
- bug360437_window.xul
- bug366992_window.xul
- bug409624_window.xul
- bug429723_window.xul
- bug624329_window.xul
- dialog_dialogfocus.xul
- file_about_networking_wsh.py
- file_autocomplete_with_composition.js
- findbar_entireword_window.xul
- findbar_events_window.xul
- findbar_window.xul
- frame_popup_anchor.xul
- frame_popupremoving_frame.xul
- frame_subframe_origin_subframe1.xul
- frame_subframe_origin_subframe2.xul
- popup_childframe_node.xul
- popup_trigger.js
- sample_entireword_latin1.html
- window_browser_drop.xul
- window_keys.xul
- window_largemenu.xul
- window_panel.xul
- window_popup_anchor.xul
- window_popup_anchoratrect.xul
- window_popup_attribute.xul
- window_popup_button.xul
- window_popup_preventdefault_chrome.xul
- window_preferences.xul
- window_preferences2.xul
- window_preferences3.xul
- window_preferences_commandretarget.xul
- window_screenPosSize.xul
- window_showcaret.xul
- window_subframe_origin.xul
- window_titlebar.xul
- window_tooltip.xul
- xul_selectcontrol.js
- rtlchrome/rtl.css
- rtlchrome/rtl.dtd
- rtlchrome/rtl.manifest
- rtltest/righttoleft.manifest
- rtltest/content/dirtest.xul
-
-[test_about_networking.html]
-[test_arrowpanel.xul]
-[test_autocomplete2.xul]
-[test_autocomplete3.xul]
-[test_autocomplete4.xul]
-[test_autocomplete5.xul]
-[test_autocomplete_delayOnPaste.xul]
-subsuite = clipboard
-[test_autocomplete_emphasis.xul]
-[test_autocomplete_with_composition_on_input.html]
-[test_autocomplete_with_composition_on_textbox.xul]
-[test_autocomplete_placehold_last_complete.xul]
-[test_browser_drop.xul]
-[test_bug253481.xul]
-subsuite = clipboard
-[test_bug263683.xul]
-[test_bug304188.xul]
-[test_bug331215.xul]
-[test_bug360220.xul]
-[test_bug360437.xul]
-skip-if = os == 'linux' # Bug 1264604
-[test_bug365773.xul]
-[test_bug366992.xul]
-[test_bug382990.xul]
-[test_bug409624.xul]
-[test_bug418874.xul]
-[test_bug429723.xul]
-[test_bug437844.xul]
-[test_bug457632.xul]
-[test_bug460942.xul]
-[test_bug471776.xul]
-[test_bug509732.xul]
-[test_bug554279.xul]
-[test_bug557987.xul]
-[test_bug562554.xul]
-[test_bug570192.xul]
-[test_bug585946.xul]
-[test_bug624329.xul]
-skip-if = (os == 'mac' && os_version == '10.10') # Unexpectedly perma-passes on OSX 10.10
-[test_bug792324.xul]
-[test_bug1048178.xul]
-skip-if = toolkit == "cocoa"
-[test_button.xul]
-[test_closemenu_attribute.xul]
-[test_colorpicker_popup.xul]
-[test_contextmenu_list.xul]
-[test_datepicker.xul]
-[test_deck.xul]
-[test_dialogfocus.xul]
-[test_findbar.xul]
-subsuite = clipboard
-[test_findbar_entireword.xul]
-[test_findbar_events.xul]
-[test_focus_anons.xul]
-[test_hiddenitems.xul]
-[test_hiddenpaging.xul]
-[test_keys.xul]
-[test_labelcontrol.xul]
-[test_largemenu.xul]
-skip-if = os == 'linux' && !debug #Bug 1207174
-[test_menu.xul]
-[test_menu_anchored.xul]
-[test_menu_hide.xul]
-[test_menuchecks.xul]
-[test_menuitem_blink.xul]
-[test_menuitem_commands.xul]
-[test_menulist.xul]
-[test_menulist_keynav.xul]
-[test_menulist_null_value.xul]
-[test_menulist_paging.xul]
-[test_menulist_position.xul]
-[test_mousescroll.xul]
-[test_notificationbox.xul]
-[test_panel.xul]
-[test_panelfrommenu.xul]
-[test_popup_anchor.xul]
-[test_popup_anchoratrect.xul]
-skip-if = os == 'linux' # 1167694
-[test_popup_attribute.xul]
-skip-if = os == 'linux' && asan #Bug 1131634
-[test_popup_button.xul]
-skip-if = os == 'linux' && asan # Bug 1281360
-[test_popup_coords.xul]
-[test_popup_keys.xul]
-[test_popup_moveToAnchor.xul]
-[test_popup_preventdefault.xul]
-[test_popup_preventdefault_chrome.xul]
-[test_popup_recreate.xul]
-[test_popup_scaled.xul]
-[test_popup_tree.xul]
-[test_popuphidden.xul]
-[test_popupincontent.xul]
-[test_popupremoving.xul]
-[test_popupremoving_frame.xul]
-[test_position.xul]
-[test_preferences.xul]
-[test_preferences_beforeaccept.xul]
-support-files = window_preferences_beforeaccept.xul
-[test_preferences_onsyncfrompreference.xul]
-support-files = window_preferences_onsyncfrompreference.xul
-[test_progressmeter.xul]
-[test_props.xul]
-[test_radio.xul]
-[test_richlist_direction.xul]
-[test_righttoleft.xul]
-[test_scale.xul]
-[test_scaledrag.xul]
-[test_screenPersistence.xul]
-[test_scrollbar.xul]
-[test_showcaret.xul]
-[test_sorttemplate.xul]
-[test_statusbar.xul]
-[test_subframe_origin.xul]
-[test_tabbox.xul]
-[test_tabindex.xul]
-[test_textbox_dictionary.xul]
-[test_textbox_emptytext.xul]
-[test_textbox_number.xul]
-[test_textbox_search.xul]
-[test_timepicker.xul]
-[test_titlebar.xul]
-skip-if = os == "linux"
-[test_toolbar.xul]
-[test_tooltip.xul]
-skip-if = (os == 'mac' && os_version == '10.10') # Bug 1141245, frequent timeouts on OSX 10.10
-[test_tooltip_noautohide.xul]
-[test_tree.xul]
-[test_tree_hier.xul]
-[test_tree_hier_cell.xul]
-[test_tree_single.xul]
-[test_tree_view.xul]
-# test_panel_focus.xul won't work if the Full Keyboard Access preference is set to
-# textboxes and lists only, so skip this test on Mac
-[test_panel_focus.xul]
-support-files = window_panel_focus.xul
-skip-if = toolkit == "cocoa"
-[test_chromemargin.xul]
-support-files = window_chromemargin.xul
-skip-if = toolkit == "cocoa"
-[test_bug451540.xul]
-support-files = bug451540_window.xul
-[test_autocomplete_mac_caret.xul]
-skip-if = toolkit != "cocoa"
-[test_cursorsnap.xul]
-disabled =
-#skip-if = os != "win"
-support-files = window_cursorsnap_dialog.xul window_cursorsnap_wizard.xul
diff --git a/toolkit/content/tests/chrome/dialog_dialogfocus.xul b/toolkit/content/tests/chrome/dialog_dialogfocus.xul
deleted file mode 100644
index 770695ed3..000000000
--- a/toolkit/content/tests/chrome/dialog_dialogfocus.xul
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<dialog buttons="extra2,accept,cancel" onload="loaded()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<tabbox id="tabbox" hidden="true">
- <tabs>
- <tab id="tab" label="Tab"/>
- </tabs>
- <tabpanels>
- <tabpanel>
- <button id="tabbutton" label="Tab Button"/>
- <button id="tabbutton2" label="Tab Button 2"/>
- </tabpanel>
- </tabpanels>
-</tabbox>
-
-<textbox id="textbox-yes" value="textbox-yes" hidden="true"/>
-<textbox id="textbox-no" value="textbox-no" noinitialfocus="true" hidden="true"/>
-<button id="one" label="One"/>
-<button id="two" label="Two" hidden="true"/>
-
-<script>
-function loaded()
-{
- if (window.arguments) {
- var step = window.arguments[0];
- switch (step) {
- case 2:
- document.getElementById("one").setAttribute("noinitialfocus", "true");
- break;
- case 3:
- document.getElementById("one").hidden = true;
- case 4:
- document.getElementById("tabbutton2").setAttribute("noinitialfocus", "true");
- case 5:
- document.getElementById("tabbutton").setAttribute("noinitialfocus", "true");
- case 6:
- document.getElementById("tabbox").hidden = false;
- break;
- case 7:
- var two = document.getElementById("two");
- two.hidden = false;
- two.focus();
- break;
- case 8:
- document.getElementById("textbox-yes").hidden = false;
- break;
- case 9:
- document.getElementById("textbox-no").hidden = false;
- break;
- }
- }
-}
-</script>
-
-</dialog>
diff --git a/toolkit/content/tests/chrome/file_about_networking_wsh.py b/toolkit/content/tests/chrome/file_about_networking_wsh.py
deleted file mode 100644
index 17ad250e5..000000000
--- a/toolkit/content/tests/chrome/file_about_networking_wsh.py
+++ /dev/null
@@ -1,9 +0,0 @@
-from mod_pywebsocket import msgutil
-
-def web_socket_do_extra_handshake(request):
- pass
-
-def web_socket_transfer_data(request):
- while not request.client_terminated:
- msgutil.receive_message(request)
-
diff --git a/toolkit/content/tests/chrome/file_autocomplete_with_composition.js b/toolkit/content/tests/chrome/file_autocomplete_with_composition.js
deleted file mode 100644
index 881e772ad..000000000
--- a/toolkit/content/tests/chrome/file_autocomplete_with_composition.js
+++ /dev/null
@@ -1,540 +0,0 @@
-// nsDoTestsForAutoCompleteWithComposition tests autocomplete with composition.
-// Users must include SimpleTest.js and EventUtils.js.
-
-function waitForCondition(condition, nextTest) {
- var tries = 0;
- var interval = setInterval(function() {
- if (condition() || tries >= 30) {
- moveOn();
- }
- tries++;
- }, 100);
- var moveOn = function() { clearInterval(interval); nextTest(); };
-}
-
-function nsDoTestsForAutoCompleteWithComposition(aDescription,
- aWindow,
- aTarget,
- aAutoCompleteController,
- aIsFunc,
- aGetTargetValueFunc,
- aOnFinishFunc)
-{
- this._description = aDescription;
- this._window = aWindow;
- this._target = aTarget;
- this._controller = aAutoCompleteController;
-
- this._is = aIsFunc;
- this._getTargetValue = aGetTargetValueFunc;
- this._onFinish = aOnFinishFunc;
-
- this._target.focus();
-
- this._DefaultCompleteDefaultIndex =
- this._controller.input.completeDefaultIndex;
-
- this._doTests();
-}
-
-nsDoTestsForAutoCompleteWithComposition.prototype = {
- _window: null,
- _target: null,
- _controller: null,
- _DefaultCompleteDefaultIndex: false,
- _description: "",
-
- _is: null,
- _getTargetValue: function () { return "not initialized"; },
- _onFinish: null,
-
- _doTests: function ()
- {
- if (++this._testingIndex == this._tests.length) {
- this._controller.input.completeDefaultIndex =
- this._DefaultCompleteDefaultIndex;
- this._onFinish();
- return;
- }
-
- var test = this._tests[this._testingIndex];
- if (this._controller.input.completeDefaultIndex != test.completeDefaultIndex) {
- this._controller.input.completeDefaultIndex = test.completeDefaultIndex;
- }
- test.execute(this._window);
-
- waitForCondition(() => {
- return this._controller.searchStatus >=
- Components.interfaces.nsIAutoCompleteController.STATUS_COMPLETE_NO_MATCH;
- },
- this._checkResult.bind(this));
- },
-
- _checkResult: function ()
- {
- var test = this._tests[this._testingIndex];
- this._is(this._getTargetValue(), test.value,
- this._description + ", " + test.description + ": value");
- this._is(this._controller.searchString, test.searchString,
- this._description + ", " + test.description +": searchString");
- this._is(this._controller.input.popupOpen, test.popup,
- this._description + ", " + test.description + ": popupOpen");
- this._doTests();
- },
-
- _testingIndex: -1,
- _tests: [
- // Simple composition when popup hasn't been shown.
- // The autocomplete popup should not be shown during composition, but
- // after compositionend, the popup should be shown.
- { description: "compositionstart shouldn't open the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "M",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 },
- "key": { key: "M", code: "KeyM", keyCode: KeyboardEvent.DOM_VK_M,
- shiftKey: true },
- }, aWindow);
- }, popup: false, value: "M", searchString: ""
- },
- { description: "modifying composition string shouldn't open the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "Mo",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 },
- "key": { key: "o", code: "KeyO", keyCode: KeyboardEvent.DOM_VK_O },
- }, aWindow);
- }, popup: false, value: "Mo", searchString: ""
- },
- { description: "compositionend should open the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeComposition({ type: "compositioncommitasis",
- key: { key: "KEY_Enter", code: "Enter" } }, aWindow);
- }, popup: true, value: "Mo", searchString: "Mo"
- },
- // If composition starts when popup is shown, the compositionstart event
- // should cause closing the popup.
- { description: "compositionstart should close the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "z",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 },
- "key": { key: "z", code: "KeyZ", keyCode: KeyboardEvent.DOM_VK_Z },
- }, aWindow);
- }, popup: false, value: "Moz", searchString: "Mo"
- },
- { description: "modifying composition string shouldn't reopen the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "zi",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 },
- "key": { key: "i", code: "KeyI", keyCode: KeyboardEvent.DOM_VK_I },
- }, aWindow);
- }, popup: false, value: "Mozi", searchString: "Mo"
- },
- { description: "compositionend should research the result and open the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeComposition({ type: "compositioncommitasis",
- key: { key: "KEY_Enter", code: "Enter" } }, aWindow);
- }, popup: true, value: "Mozi", searchString: "Mozi"
- },
- // If composition is cancelled, the value shouldn't be changed.
- { description: "compositionstart should reclose the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "l",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 },
- "key": { key: "l", code: "KeyL", keyCode: KeyboardEvent.DOM_VK_L },
- }, aWindow);
- }, popup: false, value: "Mozil", searchString: "Mozi"
- },
- { description: "modifying composition string shouldn't reopen the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "ll",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 },
- "key": { key: "l", code: "KeyL", keyCode: KeyboardEvent.DOM_VK_L },
- }, aWindow);
- }, popup: false, value: "Mozill", searchString: "Mozi"
- },
- { description: "modifying composition string to empty string shouldn't reopen the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 0, "length": 0 }
- }, aWindow);
- }, popup: false, value: "Mozi", searchString: "Mozi"
- },
- { description: "cancled compositionend should reopen the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeComposition({ type: "compositioncommit", data: "",
- key: { key: "KEY_Escape", code: "Escape" } }, aWindow);
- }, popup: true, value: "Mozi", searchString: "Mozi"
- },
- // But if composition replaces some characters and canceled, the search
- // string should be the latest value.
- { description: "compositionstart with selected string should close the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeKey("VK_LEFT", { shiftKey: true }, aWindow);
- synthesizeKey("VK_LEFT", { shiftKey: true }, aWindow);
- synthesizeCompositionChange(
- { "composition":
- { "string": "z",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 },
- "key": { key: "z", code: "KeyZ", keyCode: KeyboardEvent.DOM_VK_Z },
- }, aWindow);
- }, popup: false, value: "Moz", searchString: "Mozi"
- },
- { description: "modifying composition string shouldn't reopen the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "zi",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 },
- "key": { key: "i", code: "KeyI", keyCode: KeyboardEvent.DOM_VK_I },
- }, aWindow);
- }, popup: false, value: "Mozi", searchString: "Mozi"
- },
- { description: "modifying composition string to empty string shouldn't reopen the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 0, "length": 0 }
- }, aWindow);
- }, popup: false, value: "Mo", searchString: "Mozi"
- },
- { description: "canceled compositionend should search the result with the latest value",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeComposition({ type: "compositioncommitasis",
- key: { key: "KEY_Escape", code: "Escape" } }, aWindow);
- }, popup: true, value: "Mo", searchString: "Mo"
- },
- // If all characters are removed, the popup should be closed.
- { description: "the value becomes empty by backspace, the popup should be closed",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeKey("VK_BACK_SPACE", {}, aWindow);
- synthesizeKey("VK_BACK_SPACE", {}, aWindow);
- }, popup: false, value: "", searchString: ""
- },
- // composition which is canceled shouldn't cause opening the popup.
- { description: "compositionstart shouldn't open the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "M",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 },
- "key": { key: "m", code: "KeyM", keyCode: KeyboardEvent.DOM_VK_M,
- shiftKey: true },
- }, aWindow);
- }, popup: false, value: "M", searchString: ""
- },
- { description: "modifying composition string shouldn't open the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "Mo",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 },
- "key": { key: "o", code: "KeyO", keyCode: KeyboardEvent.DOM_VK_O },
- }, aWindow);
- }, popup: false, value: "Mo", searchString: ""
- },
- { description: "modifying composition string to empty string shouldn't open the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 0, "length": 0 }
- }, aWindow);
- }, popup: false, value: "", searchString: ""
- },
- { description: "canceled compositionend shouldn't open the popup if it was closed",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeComposition({ type: "compositioncommitasis",
- key: { key: "KEY_Escape", code: "Escape" } }, aWindow);
- }, popup: false, value: "", searchString: ""
- },
- // Down key should open the popup even if the editor is empty.
- { description: "DOWN key should open the popup even if the value is empty",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeKey("VK_DOWN", {}, aWindow);
- }, popup: true, value: "", searchString: ""
- },
- // If popup is open at starting composition, the popup should be reopened
- // after composition anyway.
- { description: "compositionstart shouldn't open the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "M",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 },
- "key": { key: "M", code: "KeyM", keyCode: KeyboardEvent.DOM_VK_M,
- shiftKey: true },
- }, aWindow);
- }, popup: false, value: "M", searchString: ""
- },
- { description: "modifying composition string shouldn't open the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "Mo",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 },
- "key": { key: "o", code: "KeyO", keyCode: KeyboardEvent.DOM_VK_O },
- }, aWindow);
- }, popup: false, value: "Mo", searchString: ""
- },
- { description: "modifying composition string to empty string shouldn't open the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 0, "length": 0 }
- }, aWindow);
- }, popup: false, value: "", searchString: ""
- },
- { description: "canceled compositionend should open the popup if it was opened",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeComposition({ type: "compositioncommitasis",
- key: { key: "KEY_Escape", code: "Escape" } }, aWindow);
- }, popup: true, value: "", searchString: ""
- },
- // Type normally, and hit escape, the popup should be closed.
- { description: "ESCAPE should close the popup after typing something",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeKey("M", { shiftKey: true }, aWindow);
- synthesizeKey("o", { shiftKey: true }, aWindow);
- synthesizeKey("VK_ESCAPE", {}, aWindow);
- }, popup: false, value: "Mo", searchString: "Mo"
- },
- // Even if the popup is closed, composition which is canceled should open
- // the popup if the value isn't empty.
- // XXX This might not be good behavior, but anyway, this is minor issue...
- { description: "compositionstart shouldn't open the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "z",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 },
- "key": { key: "z", code: "KeyZ", keyCode: KeyboardEvent.DOM_VK_Z },
- }, aWindow);
- }, popup: false, value: "Moz", searchString: "Mo"
- },
- { description: "modifying composition string shouldn't open the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "zi",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 },
- "key": { key: "i", code: "KeyI", keyCode: KeyboardEvent.DOM_VK_I },
- }, aWindow);
- }, popup: false, value: "Mozi", searchString: "Mo"
- },
- { description: "modifying composition string to empty string shouldn't open the popup",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 0, "length": 0 }
- }, aWindow);
- }, popup: false, value: "Mo", searchString: "Mo"
- },
- { description: "canceled compositionend shouldn't open the popup if the popup was closed",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeComposition({ type: "compositioncommitasis",
- key: { key: "KEY_Escape", code: "Escape" } }, aWindow);
- }, popup: true, value: "Mo", searchString: "Mo"
- },
- // House keeping...
- { description: "house keeping for next tests",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeKey("VK_BACK_SPACE", {}, aWindow);
- synthesizeKey("VK_BACK_SPACE", {}, aWindow);
- }, popup: false, value: "", searchString: ""
- },
- // Testing for nsIAutoCompleteInput.completeDefaultIndex being true.
- { description: "compositionstart shouldn't open the popup (completeDefaultIndex is true)",
- completeDefaultIndex: true,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "M",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 },
- "key": { key: "M", code: "KeyM", keyCode: KeyboardEvent.DOM_VK_M,
- shiftKey: true },
- }, aWindow);
- }, popup: false, value: "M", searchString: ""
- },
- { description: "modifying composition string shouldn't open the popup (completeDefaultIndex is true)",
- completeDefaultIndex: true,
- execute: function (aWindow) {
- synthesizeCompositionChange(
- { "composition":
- { "string": "Mo",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 },
- "key": { key: "o", code: "KeyO", keyCode: KeyboardEvent.DOM_VK_O },
- }, aWindow);
- }, popup: false, value: "Mo", searchString: ""
- },
- { description: "compositionend should open the popup (completeDefaultIndex is true)",
- completeDefaultIndex: true,
- execute: function (aWindow) {
- synthesizeComposition({ type: "compositioncommitasis",
- key: { key: "KEY_Enter", code: "Enter" } }, aWindow);
- }, popup: true, value: "Mozilla", searchString: "Mo"
- },
- // House keeping...
- { description: "house keeping for next tests",
- completeDefaultIndex: false,
- execute: function (aWindow) {
- synthesizeKey("VK_BACK_SPACE", {}, aWindow);
- synthesizeKey("VK_BACK_SPACE", {}, aWindow);
- synthesizeKey("VK_BACK_SPACE", {}, aWindow);
- synthesizeKey("VK_BACK_SPACE", {}, aWindow);
- synthesizeKey("VK_BACK_SPACE", {}, aWindow);
- synthesizeKey("VK_BACK_SPACE", {}, aWindow);
- }, popup: false, value: "", searchString: ""
- }
- ]
-};
diff --git a/toolkit/content/tests/chrome/findbar_entireword_window.xul b/toolkit/content/tests/chrome/findbar_entireword_window.xul
deleted file mode 100644
index f0da61081..000000000
--- a/toolkit/content/tests/chrome/findbar_entireword_window.xul
+++ /dev/null
@@ -1,275 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
-
-<window id="FindbarEntireWordTest"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="600"
- height="600"
- onload="onLoad();"
- title="findbar test - entire words only">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/ChromeUtils.js"/>
-
- <script type="application/javascript"><![CDATA[
- const {interfaces: Ci, classes: Cc, results: Cr, utils: Cu} = Components;
- Cu.import("resource://gre/modules/Task.jsm");
- Cu.import("resource://testing-common/ContentTask.jsm");
- ContentTask.setTestScope(window.opener.wrappedJSObject);
-
- var gFindBar = null;
- var gBrowser;
-
- var imports = ["SimpleTest", "SpecialPowers", "ok", "is", "isnot", "info"];
- for (var name of imports) {
- window[name] = window.opener.wrappedJSObject[name];
- }
- SimpleTest.requestLongerTimeout(2);
-
- const kBaseURL = "chrome://mochitests/content/chrome/toolkit/content/tests/chrome";
- const kTests = {
- latin1: {
- testSimpleEntireWord: {
- "and": results => {
- isnot(results.find.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "'and' should've been found");
- is(results.matches.total, 6, "should've found 6 matches");
- },
- "an": results => {
- is(results.find.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "'an' shouldn't have been found");
- is(results.matches.total, 0, "should've found 0 matches");
- },
- "darkness": results => {
- isnot(results.find.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "'darkness' should've been found");
- is(results.matches.total, 3, "should've found 3 matches");
- },
- "mammon": results => {
- isnot(results.find.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "'mammon' should've been found");
- is(results.matches.total, 1, "should've found 1 match");
- }
- },
- testCaseSensitive: {
- "And": results => {
- isnot(results.find.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "'And' should've been found");
- is(results.matches.total, 1, "should've found 1 match");
- },
- "and": results => {
- isnot(results.find.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "'and' should've been found");
- is(results.matches.total, 5, "should've found 5 matches");
- },
- "Mammon": results => {
- isnot(results.find.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "'mammon' should've been found");
- is(results.matches.total, 1, "should've found 1 match");
- }
- },
- testWordBreakChars: {
- "a": results => {
- // 'a' is a common charactar, but there should only be one occurrence
- // separated by word boundaries.
- isnot(results.find.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "'a' should've been found");
- is(results.matches.total, 1, "should've found 1 match");
- },
- "quarrelled": results => {
- // 'quarrelled' is denoted as a word by a period char.
- isnot(results.find.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "'quarrelled' should've been found");
- is(results.matches.total, 1, "should've found 1 match");
- }
- },
- testQuickfind: {
- "and": results => {
- isnot(results.find.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "'and' should've been found");
- is(results.matches.total, 6, "should've found 6 matches");
- },
- "an": results => {
- is(results.find.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "'an' shouldn't have been found");
- is(results.matches.total, 0, "should've found 0 matches");
- },
- "darkness": results => {
- isnot(results.find.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "'darkness' should've been found");
- is(results.matches.total, 3, "should've found 3 matches");
- },
- "mammon": results => {
- isnot(results.find.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "'mammon' should've been found");
- is(results.matches.total, 1, "should've found 1 match");
- }
- }
- }
- };
-
- function onLoad() {
- Task.spawn(function* () {
- yield new Promise(resolve => {
- SpecialPowers.pushPrefEnv(
- { set: [["findbar.entireword", true]] }, resolve);
- });
-
- gFindBar = document.getElementById("FindToolbar");
- for (let browserId of ["content", "content-remote"]) {
- // XXXmikedeboer: when multiple test samples are available, make this
- // a nested loop that iterates over them. For now, only
- // latin is available.
- yield startTestWithBrowser("latin1", browserId);
- }
- }).then(() => {
- window.close();
- SimpleTest.finish();
- });
- }
-
- function* startTestWithBrowser(testName, browserId) {
- info("Starting test with browser '" + browserId + "'");
- gBrowser = document.getElementById(browserId);
- gFindBar.browser = gBrowser;
-
- let promise = ContentTask.spawn(gBrowser, null, function* () {
- return new Promise(resolve => {
- addEventListener("DOMContentLoaded", function listener() {
- removeEventListener("DOMContentLoaded", listener);
- resolve();
- });
- });
- });
- gBrowser.loadURI(kBaseURL + "/sample_entireword_" + testName + ".html");
- yield promise;
- yield onDocumentLoaded(testName);
- }
-
- function* onDocumentLoaded(testName) {
- let suite = kTests[testName];
- yield testSimpleEntireWord(suite.testSimpleEntireWord);
- yield testCaseSensitive(suite.testCaseSensitive);
- yield testWordBreakChars(suite.testWordBreakChars);
- yield testQuickfind(suite.testQuickfind);
- }
-
- var enterStringIntoFindField = Task.async(function* (str, waitForResult = true) {
- for (let promise, i = 0; i < str.length; i++) {
- if (waitForResult) {
- promise = promiseFindResult();
- }
- let event = document.createEvent("KeyboardEvent");
- event.initKeyEvent("keypress", true, true, null, false, false,
- false, false, 0, str.charCodeAt(i));
- gFindBar._findField.inputField.dispatchEvent(event);
- if (waitForResult) {
- yield promise;
- }
- }
- });
-
- function openFindbar() {
- document.getElementById("cmd_find").doCommand();
- return gFindBar._startFindDeferred && gFindBar._startFindDeferred.promise;
- }
-
- function promiseFindResult(searchString) {
- return new Promise(resolve => {
- let data = {};
- let listener = {
- onFindResult: res => {
- if (searchString && res.searchString != searchString)
- return;
-
- gFindBar.browser.finder.removeResultListener(listener);
- data.find = res;
- if (res.result == Ci.nsITypeAheadFind.FIND_NOTFOUND) {
- data.matches = { total: 0, current: 0 };
- resolve(data);
- return;
- }
- listener = {
- onMatchesCountResult: res => {
- gFindBar.browser.finder.removeResultListener(listener);
- data.matches = res;
- resolve(data);
- }
- };
- gFindBar.browser.finder.addResultListener(listener);
- }
- };
-
- gFindBar.browser.finder.addResultListener(listener);
- });
- }
-
- function* testIterator(tests) {
- for (let searchString of Object.getOwnPropertyNames(tests)) {
- gFindBar.clear();
-
- let promise = promiseFindResult(searchString);
-
- yield enterStringIntoFindField(searchString, false);
-
- let result = yield promise;
- tests[searchString](result);
- }
- }
-
- function* testSimpleEntireWord(tests) {
- yield openFindbar();
- ok(!gFindBar.hidden, "testSimpleEntireWord: findbar should be open");
-
- yield* testIterator(tests);
-
- gFindBar.close();
- }
-
- function* testCaseSensitive(tests) {
- yield openFindbar();
- ok(!gFindBar.hidden, "testCaseSensitive: findbar should be open");
-
- let matchCaseCheckbox = gFindBar.getElement("find-case-sensitive");
- if (!matchCaseCheckbox.hidden && !matchCaseCheckbox.checked)
- matchCaseCheckbox.click();
-
- yield* testIterator(tests);
-
- if (!matchCaseCheckbox.hidden)
- matchCaseCheckbox.click();
- gFindBar.close();
- }
-
- function* testWordBreakChars(tests) {
- yield openFindbar();
- ok(!gFindBar.hidden, "testWordBreakChars: findbar should be open");
-
- yield* testIterator(tests);
-
- gFindBar.close();
- }
-
- function* testQuickfind(tests) {
- yield ContentTask.spawn(gBrowser, null, function* () {
- let document = content.document;
- let event = document.createEvent("KeyboardEvent");
- event.initKeyEvent("keypress", true, true, null, false, false,
- false, false, 0, "/".charCodeAt(0));
- document.documentElement.dispatchEvent(event);
- });
-
- ok(!gFindBar.hidden, "testQuickfind: failed to open findbar");
- ok(document.commandDispatcher.focusedElement == gFindBar._findField.inputField,
- "testQuickfind: find field is not focused");
- ok(!gFindBar.getElement("entire-word-status").hidden,
- "testQuickfind: entire word mode status text should be visible");
-
- yield* testIterator(tests);
-
- gFindBar.close();
- }
- ]]></script>
-
- <commandset>
- <command id="cmd_find" oncommand="document.getElementById('FindToolbar').onFindCommand();"/>
- </commandset>
- <browser type="content-primary" flex="1" id="content" src="about:blank"/>
- <browser type="content-primary" flex="1" id="content-remote" remote="true" src="about:blank"/>
- <findbar id="FindToolbar" browserid="content"/>
-</window>
diff --git a/toolkit/content/tests/chrome/findbar_events_window.xul b/toolkit/content/tests/chrome/findbar_events_window.xul
deleted file mode 100644
index 2bfc52c14..000000000
--- a/toolkit/content/tests/chrome/findbar_events_window.xul
+++ /dev/null
@@ -1,173 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-
-<window id="FindbarTest"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="600"
- height="600"
- onload="SimpleTest.executeSoon(startTest);"
- title="findbar events test">
-
- <script type="application/javascript"><![CDATA[
- const {interfaces: Ci, classes: Cc, results: Cr, utils: Cu} = Components;
- Cu.import("resource://gre/modules/Task.jsm");
- Cu.import("resource://testing-common/BrowserTestUtils.jsm");
- Cu.import("resource://testing-common/ContentTask.jsm");
- ContentTask.setTestScope(window.opener.wrappedJSObject);
-
- var gFindBar = null;
- var gBrowser;
- const kTimeout = 5000; // 5 seconds.
-
- var imports = ["SimpleTest", "ok", "is", "info"];
- for (var name of imports) {
- window[name] = window.opener.wrappedJSObject[name];
- }
- SimpleTest.requestLongerTimeout(2);
-
- function startTest() {
- Task.spawn(function* () {
- gFindBar = document.getElementById("FindToolbar");
- for (let browserId of ["content", "content-remote"]) {
- yield startTestWithBrowser(browserId);
- }
- }).then(() => {
- window.close();
- SimpleTest.finish();
- });
- }
-
- function* startTestWithBrowser(browserId) {
- info("Starting test with browser '" + browserId + "'");
- gBrowser = document.getElementById(browserId);
- gFindBar.browser = gBrowser;
- let promise = BrowserTestUtils.browserLoaded(gBrowser);
- gBrowser.loadURI("data:text/html,hello there");
- yield promise;
- yield onDocumentLoaded();
- }
-
- function* onDocumentLoaded() {
- gFindBar.open();
- gFindBar.onFindCommand();
-
- yield testFind();
- yield testFindAgain();
- yield testCaseSensitivity();
- yield testHighlight();
- }
-
- function checkSelection() {
- return new Promise(resolve => {
- SimpleTest.executeSoon(() => {
- ContentTask.spawn(gBrowser, null, function* () {
- let selected = content.getSelection();
- Assert.equal(String(selected), "", "No text is selected");
-
- let controller = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISelectionDisplay)
- .QueryInterface(Ci.nsISelectionController);
- let selection = controller.getSelection(controller.SELECTION_FIND);
- Assert.equal(selection.rangeCount, 0, "No text is highlighted");
- }).then(resolve);
- });
- });
- }
-
- function once(node, eventName, preventDefault = true) {
- return new Promise((resolve, reject) => {
- let timeout = window.setTimeout(() => {
- reject("Event wasn't fired within " + kTimeout + "ms for event '" +
- eventName + "'.");
- }, kTimeout);
-
- node.addEventListener(eventName, function clb(e) {
- window.clearTimeout(timeout);
- node.removeEventListener(eventName, clb);
- if (preventDefault)
- e.preventDefault();
- resolve(e);
- });
- });
- }
-
- function* testFind() {
- info("Testing normal find.");
- let query = "t";
- let promise = once(gFindBar, "find");
-
- // Put some text in the find box.
- let event = document.createEvent("KeyboardEvent");
- event.initKeyEvent("keypress", true, true, null, false, false,
- false, false, 0, query.charCodeAt(0));
- gFindBar._findField.inputField.dispatchEvent(event);
-
- let e = yield promise;
- ok(e.detail.query === query, "find event query should match '" + query + "'");
- // Since we're preventing the default make sure nothing was selected.
- yield checkSelection();
- }
-
- function testFindAgain() {
- info("Testing repeating normal find.");
- let promise = once(gFindBar, "findagain");
-
- gFindBar.onFindAgainCommand();
-
- yield promise;
- // Since we're preventing the default make sure nothing was selected.
- yield checkSelection();
- }
-
- function* testCaseSensitivity() {
- info("Testing normal case sensitivity.");
- let promise = once(gFindBar, "findcasesensitivitychange", false);
-
- let matchCaseCheckbox = gFindBar.getElement("find-case-sensitive");
- matchCaseCheckbox.click();
-
- let e = yield promise;
- ok(e.detail.caseSensitive, "find should be case sensitive");
-
- // Toggle it back to the original setting.
- matchCaseCheckbox.click();
-
- // Changing case sensitivity does the search so clear the selected text
- // before the next test.
- yield ContentTask.spawn(gBrowser, null, () => content.getSelection().removeAllRanges());
- }
-
- function* testHighlight() {
- info("Testing find with highlight all.");
- // Update the find state so the highlight button is clickable.
- gFindBar.updateControlState(Ci.nsITypeAheadFind.FIND_FOUND, false);
-
- let promise = once(gFindBar, "findhighlightallchange");
-
- let highlightButton = gFindBar.getElement("highlight");
- if (!highlightButton.checked)
- highlightButton.click();
-
- let e = yield promise;
- ok(e.detail.highlightAll, "find event should have highlight all set");
- // Since we're preventing the default make sure nothing was highlighted.
- yield checkSelection();
-
- // Toggle it back to the original setting.
- if (highlightButton.checked)
- highlightButton.click();
- }
- ]]></script>
-
- <browser type="content-primary" flex="1" id="content" src="about:blank"/>
- <browser type="content-primary" flex="1" id="content-remote" remote="true" src="about:blank"/>
- <findbar id="FindToolbar" browserid="content"/>
-</window>
diff --git a/toolkit/content/tests/chrome/findbar_window.xul b/toolkit/content/tests/chrome/findbar_window.xul
deleted file mode 100644
index f17f760fe..000000000
--- a/toolkit/content/tests/chrome/findbar_window.xul
+++ /dev/null
@@ -1,756 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-
-<window id="FindbarTest"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="600"
- height="600"
- onload="onLoad();"
- title="findbar test">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
- <script type="application/javascript"><![CDATA[
- const {interfaces: Ci, classes: Cc, results: Cr, utils: Cu} = Components;
- Cu.import("resource://gre/modules/AppConstants.jsm");
- Cu.import("resource://gre/modules/Task.jsm");
- Cu.import("resource://testing-common/BrowserTestUtils.jsm");
- Cu.import("resource://testing-common/ContentTask.jsm");
- ContentTask.setTestScope(window.opener.wrappedJSObject);
-
- var gPrefsvc = Cc["@mozilla.org/preferences-service;1"].getService(Ci.nsIPrefBranch);
-
- const SAMPLE_URL = "http://www.mozilla.org/";
- const SAMPLE_TEXT = "Some text in a text field.";
- const SEARCH_TEXT = "Text Test";
- const NOT_FOUND_TEXT = "This text is not on the page."
- const ITERATOR_TIMEOUT = gPrefsvc.getIntPref("findbar.iteratorTimeout");
-
- var gFindBar = null;
- var gBrowser;
-
- var gClipboard = Cc["@mozilla.org/widget/clipboard;1"].getService(Ci.nsIClipboard);
- var gHasFindClipboard = gClipboard.supportsFindClipboard();
-
- var gStatusText;
- var gXULBrowserWindow = {
- QueryInterface: function(aIID) {
- if (aIID.Equals(Ci.nsIXULBrowserWindow) ||
- aIID.Equals(Ci.nsISupports))
- return this;
-
- throw Cr.NS_NOINTERFACE;
- },
-
- setJSStatus: function() { },
-
- setOverLink: function(aStatusText, aLink) {
- gStatusText = aStatusText;
- },
-
- onBeforeLinkTraversal: function() { }
- };
-
- var imports = ["SimpleTest", "ok", "is", "info"];
- for (var name of imports) {
- window[name] = window.opener.wrappedJSObject[name];
- }
- SimpleTest.requestLongerTimeout(2);
-
- function onLoad() {
- Task.spawn(function* () {
- window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShellTreeItem)
- .treeOwner
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIXULWindow)
- .XULBrowserWindow = gXULBrowserWindow;
-
- gFindBar = document.getElementById("FindToolbar");
- for (let browserId of ["content", "content-remote"]) {
- yield startTestWithBrowser(browserId);
- }
- }).then(() => {
- window.close();
- SimpleTest.finish();
- });
- }
-
- function* startTestWithBrowser(browserId) {
- info("Starting test with browser '" + browserId + "'");
- gBrowser = document.getElementById(browserId);
- gFindBar.browser = gBrowser;
-
- // Tests delays the loading of a document for one second.
- yield new Promise(resolve => setTimeout(resolve, 1000));
-
- let promise = BrowserTestUtils.browserLoaded(gBrowser);
- gBrowser.loadURI("data:text/html,<h2 id='h2'>" + SEARCH_TEXT +
- "</h2><h2><a href='" + SAMPLE_URL + "'>Link Test</a></h2><input id='text' type='text' value='" +
- SAMPLE_TEXT + "'></input><input id='button' type='button'></input><img id='img' width='50' height='50'/>");
- yield promise;
- yield onDocumentLoaded();
- }
-
- function* onDocumentLoaded() {
- yield testNormalFind();
- gFindBar.close();
- ok(gFindBar.hidden, "Failed to close findbar after testNormalFind");
- yield openFindbar();
- yield testNormalFindWithComposition();
- gFindBar.close();
- ok(gFindBar.hidden, "findbar should be hidden after testNormalFindWithComposition");
- yield openFindbar();
- yield testAutoCaseSensitivityUI();
- yield testQuickFindText();
- gFindBar.close();
- ok(gFindBar.hidden, "Failed to close findbar after testQuickFindText");
- // TODO: `testFindWithHighlight` tests fastFind integrity, which can not
- // be accessed with RemoteFinder. We're skipping it for now.
- if (gFindBar._browser.finder._fastFind) {
- yield testFindWithHighlight();
- gFindBar.close();
- ok(gFindBar.hidden, "Failed to close findbar after testFindWithHighlight");
- }
- yield testFindbarSelection();
- ok(gFindBar.hidden, "Failed to close findbar after testFindbarSelection");
- // TODO: I don't know how to drop a content element on a chrome input.
- if (!gBrowser.hasAttribute("remote"))
- testDrop();
- yield testQuickFindLink();
- if (gHasFindClipboard) {
- yield testStatusText();
- }
-
- if (!AppConstants.DEBUG) {
- yield testFindCountUI();
- gFindBar.close();
- ok(gFindBar.hidden, "Failed to close findbar after testFindCountUI");
- yield testFindCountUI(true);
- gFindBar.close();
- ok(gFindBar.hidden, "Failed to close findbar after testFindCountUI - linksOnly");
- }
-
- yield openFindbar();
- yield testFindAfterCaseChanged();
- gFindBar.close();
- yield openFindbar();
- yield testFailedStringReset();
- gFindBar.close();
- yield testQuickFindClose();
- // TODO: This doesn't seem to work when the findbar is connected to a
- // remote browser element.
- if (!gBrowser.hasAttribute("remote"))
- yield testFindAgainNotFound();
- yield testToggleEntireWord();
- }
-
- function* testFindbarSelection() {
- function checkFindbarState(aTestName, aExpSelection) {
- ok(!gFindBar.hidden, "testFindbarSelection: failed to open findbar: " + aTestName);
- ok(document.commandDispatcher.focusedElement == gFindBar._findField.inputField,
- "testFindbarSelection: find field is not focused: " + aTestName);
- if (!gHasFindClipboard) {
- ok(gFindBar._findField.value == aExpSelection,
- "Incorrect selection in testFindbarSelection: " + aTestName +
- ". Selection: " + gFindBar._findField.value);
- }
-
- // Clear the value, close the findbar.
- gFindBar._findField.value = "";
- gFindBar.close();
- }
-
- // Test normal selected text.
- yield ContentTask.spawn(gBrowser, null, function* () {
- let document = content.document;
- let cH2 = document.getElementById("h2");
- let cSelection = content.getSelection();
- let cRange = document.createRange();
- cRange.setStart(cH2, 0);
- cRange.setEnd(cH2, 1);
- cSelection.removeAllRanges();
- cSelection.addRange(cRange);
- });
- yield openFindbar();
- checkFindbarState("plain text", SEARCH_TEXT);
-
- // Test nsIDOMNSEditableElement with selection.
- yield ContentTask.spawn(gBrowser, null, function* () {
- let textInput = content.document.getElementById("text");
- textInput.focus();
- textInput.select();
- });
- yield openFindbar();
- checkFindbarState("text input", SAMPLE_TEXT);
-
- // Test non-editable nsIDOMNSEditableElement (button).
- yield ContentTask.spawn(gBrowser, null, function* () {
- content.document.getElementById("button").focus();
- });
- yield openFindbar();
- checkFindbarState("button", "");
- }
-
- function testDrop() {
- gFindBar.open();
- // use an dummy image to start the drag so it doesn't get interrupted by a selection
- var img = gBrowser.contentDocument.getElementById("img");
- synthesizeDrop(img, gFindBar._findField, [[ {type: "text/plain", data: "Rabbits" } ]], "copy", window);
- is(gFindBar._findField.inputField.value, "Rabbits", "drop on findbar");
- gFindBar.close();
- }
-
- function testQuickFindClose() {
- return new Promise(resolve => {
- var _isClosedCallback = function() {
- ok(gFindBar.hidden,
- "_isClosedCallback: Failed to auto-close quick find bar after " +
- gFindBar._quickFindTimeoutLength + "ms");
- resolve();
- };
- setTimeout(_isClosedCallback, gFindBar._quickFindTimeoutLength + 100);
- });
- }
-
- function testStatusText() {
- return new Promise(resolve => {
- var _delayedCheckStatusText = function() {
- ok(gStatusText == SAMPLE_URL, "testStatusText: Failed to set status text of found link");
- resolve();
- };
- setTimeout(_delayedCheckStatusText, 100);
- });
- }
-
- function promiseFindResult() {
- return new Promise(resolve => {
- let listener = {
- onFindResult: function(result) {
- gFindBar.browser.finder.removeResultListener(listener);
- resolve(result);
- }
- };
- gFindBar.browser.finder.addResultListener(listener);
- });
- }
-
- function promiseMatchesCountResult() {
- return new Promise(resolve => {
- let listener = {
- onMatchesCountResult: function() {
- gFindBar.browser.finder.removeResultListener(listener);
- resolve();
- }
- };
- gFindBar.browser.finder.addResultListener(listener);
- // Make sure we resolve _at least_ after five times the find iterator timeout.
- setTimeout(resolve, (ITERATOR_TIMEOUT * 5) + 20);
- });
- }
-
- function promiseHighlightFinished() {
- return new Promise(resolve => {
- let listener = {
- onHighlightFinished() {
- gFindBar.browser.finder.removeResultListener(listener);
- resolve();
- }
- };
- gFindBar.browser.finder.addResultListener(listener);
- });
- }
-
- var enterStringIntoFindField = Task.async(function* (str, waitForResult = true) {
- for (let promise, i = 0; i < str.length; i++) {
- if (waitForResult) {
- promise = promiseFindResult();
- }
- let event = document.createEvent("KeyboardEvent");
- event.initKeyEvent("keypress", true, true, null, false, false,
- false, false, 0, str.charCodeAt(i));
- gFindBar._findField.inputField.dispatchEvent(event);
- if (waitForResult) {
- yield promise;
- }
- }
- });
-
- function promiseExpectRangeCount(rangeCount) {
- return ContentTask.spawn(gBrowser, { rangeCount }, function* (args) {
- let controller = docShell.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsISelectionDisplay)
- .QueryInterface(Ci.nsISelectionController);
- let sel = controller.getSelection(Ci.nsISelectionController.SELECTION_FIND);
- Assert.equal(sel.rangeCount, args.rangeCount,
- "Expected the correct amount of ranges inside the Find selection");
- });
- }
-
- // also test match-case
- function* testNormalFind() {
- document.getElementById("cmd_find").doCommand();
-
- ok(!gFindBar.hidden, "testNormalFind: failed to open findbar");
- ok(document.commandDispatcher.focusedElement == gFindBar._findField.inputField,
- "testNormalFind: find field is not focused");
-
- let promise;
- let matchCaseCheckbox = gFindBar.getElement("find-case-sensitive");
- if (!matchCaseCheckbox.hidden && matchCaseCheckbox.checked) {
- promise = promiseFindResult();
- matchCaseCheckbox.click();
- yield promise;
- }
-
- var searchStr = "text tes";
- yield enterStringIntoFindField(searchStr);
-
- let sel = yield ContentTask.spawn(gBrowser, { searchStr }, function* (args) {
- let sel = content.getSelection().toString();
- Assert.equal(sel.toLowerCase(), args.searchStr,
- "testNormalFind: failed to find '" + args.searchStr + "'");
- return sel;
- });
- testClipboardSearchString(sel);
-
- if (!matchCaseCheckbox.hidden) {
- promise = promiseFindResult();
- matchCaseCheckbox.click();
- yield promise;
- enterStringIntoFindField("t");
- yield ContentTask.spawn(gBrowser, { searchStr }, function* (args) {
- Assert.notEqual(content.getSelection().toString(), args.searchStr,
- "testNormalFind: Case-sensitivy is broken '" + args.searchStr + "'");
- });
- promise = promiseFindResult();
- matchCaseCheckbox.click();
- yield promise;
- }
- }
-
- function openFindbar() {
- document.getElementById("cmd_find").doCommand();
- return gFindBar._startFindDeferred && gFindBar._startFindDeferred.promise;
- }
-
- function* testNormalFindWithComposition() {
- ok(!gFindBar.hidden, "testNormalFindWithComposition: findbar should be open");
- ok(document.commandDispatcher.focusedElement == gFindBar._findField.inputField,
- "testNormalFindWithComposition: find field should be focused");
-
- var matchCaseCheckbox = gFindBar.getElement("find-case-sensitive");
- var clicked = false;
- if (!matchCaseCheckbox.hidden & matchCaseCheckbox.checked) {
- matchCaseCheckbox.click();
- clicked = true;
- }
-
- gFindBar._findField.inputField.focus();
-
- var searchStr = "text";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": searchStr,
- "clauses":
- [
- { "length": searchStr.length, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": searchStr.length, "length": 0 }
- });
-
- yield ContentTask.spawn(gBrowser, { searchStr }, function* (args) {
- Assert.notEqual(content.getSelection().toString().toLowerCase(), args.searchStr,
- "testNormalFindWithComposition: text shouldn't be found during composition");
- });
-
- synthesizeComposition({ type: "compositioncommitasis" });
-
- let sel = yield ContentTask.spawn(gBrowser, { searchStr }, function* (args) {
- let sel = content.getSelection().toString();
- Assert.equal(sel.toLowerCase(), args.searchStr,
- "testNormalFindWithComposition: text should be found after committing composition");
- return sel;
- });
- testClipboardSearchString(sel);
-
- if (clicked) {
- matchCaseCheckbox.click();
- }
- }
-
- function* testAutoCaseSensitivityUI() {
- var matchCaseCheckbox = gFindBar.getElement("find-case-sensitive");
- var matchCaseLabel = gFindBar.getElement("match-case-status");
- ok(!matchCaseCheckbox.hidden, "match case box is hidden in manual mode");
- ok(matchCaseLabel.hidden, "match case label is visible in manual mode");
-
- gPrefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 2);
-
- ok(matchCaseCheckbox.hidden,
- "match case box is visible in automatic mode");
- ok(!matchCaseLabel.hidden,
- "match case label is hidden in automatic mode");
-
- yield enterStringIntoFindField("a");
- var insensitiveLabel = matchCaseLabel.value;
- yield enterStringIntoFindField("A");
- var sensitiveLabel = matchCaseLabel.value;
- ok(insensitiveLabel != sensitiveLabel,
- "Case Sensitive label was not correctly updated");
-
- // bug 365551
- gFindBar.onFindAgainCommand();
- ok(matchCaseCheckbox.hidden && !matchCaseLabel.hidden,
- "bug 365551: case sensitivity UI is broken after find-again");
- gPrefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 0);
- gFindBar.close();
- }
-
- function* clearFocus() {
- document.commandDispatcher.focusedElement = null;
- document.commandDispatcher.focusedWindow = null;
- yield ContentTask.spawn(gBrowser, null, function* () {
- content.focus();
- });
- }
-
- function* testQuickFindLink() {
- yield clearFocus();
-
- yield ContentTask.spawn(gBrowser, null, function* () {
- let document = content.document;
- let event = document.createEvent("KeyboardEvent");
- event.initKeyEvent("keypress", true, true, null, false, false,
- false, false, 0, "'".charCodeAt(0));
- document.documentElement.dispatchEvent(event);
- });
-
- ok(!gFindBar.hidden, "testQuickFindLink: failed to open findbar");
- ok(document.commandDispatcher.focusedElement == gFindBar._findField.inputField,
- "testQuickFindLink: find field is not focused");
-
- var searchStr = "Link Test";
- yield enterStringIntoFindField(searchStr);
- yield ContentTask.spawn(gBrowser, { searchStr }, function* (args) {
- Assert.equal(content.getSelection().toString(), args.searchStr,
- "testQuickFindLink: failed to find sample link");
- });
- testClipboardSearchString(searchStr);
- }
-
- // See bug 963925 for more details on this test.
- function* testFindWithHighlight() {
- gFindBar._findField.value = "";
-
- // For this test, we want to closely control the selection. The easiest
- // way to do so is to replace the implementation of
- // Finder.getInitialSelection with a no-op and call the findbar's callback
- // (onCurrentSelection(..., true)) ourselves with our hand-picked
- // selection.
- let oldGetInitialSelection = gFindBar.browser.finder.getInitialSelection;
- let searchStr;
- gFindBar.browser.finder.getInitialSelection = function(){};
-
- let findCommand = document.getElementById("cmd_find");
- findCommand.doCommand();
-
- gFindBar.onCurrentSelection("", true);
-
- searchStr = "e";
- yield enterStringIntoFindField(searchStr);
-
- let a = gFindBar._findField.value;
- let b = gFindBar._browser.finder._fastFind.searchString;
- let c = gFindBar._browser.finder.searchString;
- ok(a == b && b == c, "testFindWithHighlight 1: " + a + ", " + b + ", " + c + ".");
-
- searchStr = "t";
- findCommand.doCommand();
-
- gFindBar.onCurrentSelection(searchStr, true);
- gFindBar.browser.finder.getInitialSelection = oldGetInitialSelection;
-
- a = gFindBar._findField.value;
- b = gFindBar._browser.finder._fastFind.searchString;
- c = gFindBar._browser.finder.searchString;
- ok(a == searchStr && b == c, "testFindWithHighlight 2: " + searchStr +
- ", " + a + ", " + b + ", " + c + ".");
-
- let highlightButton = gFindBar.getElement("highlight");
- highlightButton.click();
- ok(highlightButton.checked, "testFindWithHighlight 3: Highlight All should be checked.");
-
- a = gFindBar._findField.value;
- b = gFindBar._browser.finder._fastFind.searchString;
- c = gFindBar._browser.finder.searchString;
- ok(a == searchStr && b == c, "testFindWithHighlight 4: " + a + ", " + b + ", " + c + ".");
-
- gFindBar.onFindAgainCommand();
- a = gFindBar._findField.value;
- b = gFindBar._browser.finder._fastFind.searchString;
- c = gFindBar._browser.finder.searchString;
- ok(a == b && b == c, "testFindWithHighlight 5: " + a + ", " + b + ", " + c + ".");
-
- highlightButton.click();
- ok(!highlightButton.checked, "testFindWithHighlight: Highlight All should be unchecked.");
-
- // Regression test for bug 1316515.
- searchStr = "e";
- gFindBar.clear();
- yield enterStringIntoFindField(searchStr);
- yield promiseExpectRangeCount(0);
-
- highlightButton.click();
- ok(highlightButton.checked, "testFindWithHighlight: Highlight All should be checked.");
- yield promiseHighlightFinished();
- yield promiseExpectRangeCount(3);
-
- synthesizeKey("VK_BACK_SPACE", {});
- yield promiseExpectRangeCount(0);
-
- // Regression test for bug 1316513.
- highlightButton.click();
- ok(!highlightButton.checked, "testFindWithHighlight - 1316513: Highlight All should be unchecked.");
- yield enterStringIntoFindField(searchStr);
-
- highlightButton.click();
- ok(highlightButton.checked, "testFindWithHighlight - 1316513: Highlight All should be checked.");
- yield promiseHighlightFinished();
- yield promiseExpectRangeCount(3);
-
- let promise = BrowserTestUtils.browserLoaded(gBrowser);
- gBrowser.reload();
- yield promise;
-
- ok(highlightButton.checked, "testFindWithHighlight - 1316513: Highlight All " +
- "should still be checked after a reload.");
- synthesizeKey("VK_RETURN", {});
- yield promiseHighlightFinished();
- yield promiseExpectRangeCount(3);
-
- // Uncheck at test end to not interfere with other test functions that are
- // run after this one.
- highlightButton.click();
- }
-
- function* testQuickFindText() {
- yield clearFocus();
-
- yield ContentTask.spawn(gBrowser, null, function* () {
- let document = content.document;
- let event = document.createEvent("KeyboardEvent");
- event.initKeyEvent("keypress", true, true, null, false, false,
- false, false, 0, "/".charCodeAt(0));
- document.documentElement.dispatchEvent(event);
- });
-
- ok(!gFindBar.hidden, "testQuickFindText: failed to open findbar");
- ok(document.commandDispatcher.focusedElement == gFindBar._findField.inputField,
- "testQuickFindText: find field is not focused");
-
- yield enterStringIntoFindField(SEARCH_TEXT);
- yield ContentTask.spawn(gBrowser, { SEARCH_TEXT }, function* (args) {
- Assert.equal(content.getSelection().toString(), args.SEARCH_TEXT,
- "testQuickFindText: failed to find '" + args.SEARCH_TEXT + "'");
- });
- testClipboardSearchString(SEARCH_TEXT);
- }
-
- function* testFindCountUI(linksOnly = false) {
- yield clearFocus();
-
- if (linksOnly) {
- yield ContentTask.spawn(gBrowser, null, function* () {
- let document = content.document;
- let event = document.createEvent("KeyboardEvent");
- event.initKeyEvent("keypress", true, true, null, false, false,
- false, false, 0, "'".charCodeAt(0));
- document.documentElement.dispatchEvent(event);
- });
- } else {
- document.getElementById("cmd_find").doCommand();
- }
-
- ok(!gFindBar.hidden, "testFindCountUI: failed to open findbar");
- ok(document.commandDispatcher.focusedElement == gFindBar._findField.inputField,
- "testFindCountUI: find field is not focused");
-
- let promise;
- let matchCase = gFindBar.getElement("find-case-sensitive");
- if (matchCase.checked) {
- promise = promiseFindResult();
- matchCase.click();
- yield new Promise(resolve => setTimeout(resolve, ITERATOR_TIMEOUT + 20));
- yield promise;
- }
-
- let foundMatches = gFindBar._foundMatches;
- let tests = [{
- text: "t",
- current: linksOnly ? 1 : 5,
- total: linksOnly ? 2 : 10,
- }, {
- text: "te",
- current: linksOnly ? 1 : 3,
- total: linksOnly ? 1 : 5,
- }, {
- text: "tes",
- current: 1,
- total: linksOnly ? 1 : 2,
- }, {
- text: "texxx",
- current: 0,
- total: 0
- }];
- let regex = /([\d]*)\sof\s([\d]*)/;
-
- function assertMatches(aTest, aMatches) {
- is(aMatches[1], String(aTest.current),
- `${linksOnly ? "[Links-only] " : ""}Currently highlighted match should be at ${aTest.current} for '${aTest.text}'`);
- is(aMatches[2], String(aTest.total),
- `${linksOnly ? "[Links-only] " : ""}Total amount of matches should be ${aTest.total} for '${aTest.text}'`);
- }
-
- for (let test of tests) {
- gFindBar._findField.select();
- gFindBar._findField.focus();
-
- let timeout = ITERATOR_TIMEOUT;
- if (test.text.length == 1)
- timeout *= 4;
- else if (test.text.length == 2)
- timeout *= 2;
- timeout += 20;
- yield new Promise(resolve => setTimeout(resolve, timeout));
- yield enterStringIntoFindField(test.text, false);
- yield promiseMatchesCountResult();
- let matches = foundMatches.value.match(regex);
- if (!test.total) {
- ok(!matches, "No message should be shown when 0 matches are expected");
- } else {
- assertMatches(test, matches);
- for (let i = 1; i < test.total; i++) {
- yield new Promise(resolve => setTimeout(resolve, timeout));
- gFindBar.onFindAgainCommand();
- yield promiseMatchesCountResult();
- // test.current + 1, test.current + 2, ..., test.total, 1, ..., test.current
- let current = (test.current + i - 1) % test.total + 1;
- assertMatches({
- text: test.text,
- current: current,
- total: test.total
- }, foundMatches.value.match(regex));
- }
- }
- }
- }
-
- // See bug 1051187.
- function* testFindAfterCaseChanged() {
- // Search to set focus on "Text Test" so that searching for "t" selects first
- // (upper case!) "T".
- yield enterStringIntoFindField(SEARCH_TEXT);
- gFindBar.clear();
-
- gPrefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 0);
-
- yield enterStringIntoFindField("t");
- yield ContentTask.spawn(gBrowser, null, function* () {
- Assert.equal(content.getSelection().toString(), "T", "First T should be selected.");
- });
-
- gPrefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 1);
- yield ContentTask.spawn(gBrowser, null, function* () {
- Assert.equal(content.getSelection().toString(), "t", "First t should be selected.");
- });
- }
-
- // Make sure that _findFailedString is cleared:
- // 1. Do a search that fails with case sensitivity but matches with no case sensitivity.
- // 2. Uncheck case sensitivity button to match the string.
- function* testFailedStringReset() {
- gPrefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 1);
-
- yield enterStringIntoFindField(SEARCH_TEXT.toUpperCase(), false);
- yield ContentTask.spawn(gBrowser, null, function* () {
- Assert.equal(content.getSelection().toString(), "", "Not found.");
- });
-
- gPrefsvc.setIntPref("accessibility.typeaheadfind.casesensitive", 0);
- yield ContentTask.spawn(gBrowser, { SEARCH_TEXT }, function* (args) {
- Assert.equal(content.getSelection().toString(), args.SEARCH_TEXT,
- "Search text should be selected.");
- });
- }
-
- function testClipboardSearchString(aExpected) {
- if (!gHasFindClipboard)
- return;
-
- if (!aExpected)
- aExpected = "";
- var searchStr = gFindBar.browser.finder.clipboardSearchString;
- ok(searchStr.toLowerCase() == aExpected.toLowerCase(),
- "testClipboardSearchString: search string not set to '" + aExpected +
- "', instead found '" + searchStr + "'");
- }
-
- // See bug 967982.
- function* testFindAgainNotFound() {
- yield openFindbar();
- yield enterStringIntoFindField(NOT_FOUND_TEXT, false);
- gFindBar.close();
- ok(gFindBar.hidden, "The findbar is closed.");
- let promise = promiseFindResult();
- gFindBar.onFindAgainCommand();
- yield promise;
- ok(!gFindBar.hidden, "Unsuccessful Find Again opens the find bar.");
-
- yield enterStringIntoFindField(SEARCH_TEXT);
- gFindBar.close();
- ok(gFindBar.hidden, "The findbar is closed.");
- promise = promiseFindResult();
- gFindBar.onFindAgainCommand();
- yield promise;
- ok(gFindBar.hidden, "Successful Find Again leaves the find bar closed.");
- }
-
- function* testToggleEntireWord() {
- yield openFindbar();
- let promise = promiseFindResult();
- yield enterStringIntoFindField("Tex", false);
- let result = yield promise;
- is(result.result, Ci.nsITypeAheadFind.FIND_FOUND, "Text should be found");
-
- yield new Promise(resolve => setTimeout(resolve, ITERATOR_TIMEOUT + 20));
- promise = promiseFindResult();
- let check = gFindBar.getElement("find-entire-word");
- check.click();
- result = yield promise;
- is(result.result, Ci.nsITypeAheadFind.FIND_NOTFOUND, "Text should NOT be found");
-
- check.click();
- gFindBar.close(true);
- }
- ]]></script>
-
- <commandset>
- <command id="cmd_find" oncommand="document.getElementById('FindToolbar').onFindCommand();"/>
- </commandset>
- <browser type="content-primary" flex="1" id="content" src="about:blank"/>
- <browser type="content-primary" flex="1" id="content-remote" remote="true" src="about:blank"/>
- <findbar id="FindToolbar" browserid="content"/>
-</window>
diff --git a/toolkit/content/tests/chrome/frame_popup_anchor.xul b/toolkit/content/tests/chrome/frame_popup_anchor.xul
deleted file mode 100644
index be6254ce0..000000000
--- a/toolkit/content/tests/chrome/frame_popup_anchor.xul
+++ /dev/null
@@ -1,82 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<page xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<menupopup id="popup" onpopupshowing="if (isSecondTest) popupShowing(event)" onpopupshown="popupShown()"
- onpopuphidden="nextTest()">
- <menuitem label="One"/>
- <menuitem label="Two"/>
-</menupopup>
-
-<button id="button" label="OK" popup="popup"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-var isSecondTest = false;
-
-function openPopup()
-{
- document.getElementById("popup").openPopup(parent.document.getElementById("outerbutton"), "after_start", 3, 1);
-}
-
-function popupShowing(event)
-{
- var buttonrect = document.getElementById("button").getBoundingClientRect();
- parent.opener.wrappedJSObject.SimpleTest.is(event.clientX, buttonrect.left + 6, "popup clientX with mouse");
- parent.opener.wrappedJSObject.SimpleTest.is(event.clientY, buttonrect.top + 6, "popup clientY with mouse");
-}
-
-function popupShown()
-{
- var left, top;
- var popuprect = document.getElementById("popup").getBoundingClientRect();
- if (isSecondTest) {
- var buttonrect = document.getElementById("button").getBoundingClientRect();
- left = buttonrect.left + 6;
- top = buttonrect.top + 6;
- }
- else {
- var iframerect = parent.document.getElementById("frame").getBoundingClientRect();
- var buttonrect = parent.document.getElementById("outerbutton").getBoundingClientRect();
-
- // The popup should appear anchored on the bottom left edge of the button, however
- // the client rectangle is relative to the iframe's document. Thus the coordinates
- // are:
- // left = iframe's left - anchor button's left - 3 pixel offset passed to openPopup +
- // iframe border (17px) + iframe padding (0)
- // top = iframe's top - anchor button's bottom - 1 pixel offset passed to openPopup +
- // iframe border (0) + iframe padding (3px);
- left = -(Math.round(iframerect.left) - Math.round(buttonrect.left) + 14);
- top = -(Math.round(iframerect.top) - Math.round(buttonrect.bottom) + 2);
- }
-
- var testid = isSecondTest ? "with mouse" : "anchored to parent frame";
- parent.opener.wrappedJSObject.SimpleTest.is(Math.round(popuprect.left), left, "popup left " + testid);
- parent.opener.wrappedJSObject.SimpleTest.is(Math.round(popuprect.top), top, "popup top " + testid);
-
- document.getElementById("popup").hidePopup();
-}
-
-function nextTest()
-{
- if (isSecondTest) {
- parent.opener.wrappedJSObject.SimpleTest.finish();
- parent.close();
- }
- else {
- // this second test ensures that the popupshowing coordinates when a popup in
- // a frame is opened are correct
- isSecondTest = true;
- synthesizeMouse(document.getElementById("button"), 6, 6, { });
- }
-}
-
-]]>
-</script>
-
-</page>
diff --git a/toolkit/content/tests/chrome/frame_popupremoving_frame.xul b/toolkit/content/tests/chrome/frame_popupremoving_frame.xul
deleted file mode 100644
index e8f00ce7a..000000000
--- a/toolkit/content/tests/chrome/frame_popupremoving_frame.xul
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window title="Popup Removing Frame Tests"
- onload="setTimeout(init, 0)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<hbox>
-
-<menu id="separatemenu1" label="Menu">
- <menupopup id="separatepopup1" onpopupshown="document.getElementById('separatemenu2').open = true">
- <menuitem label="L1 One"/>
- <menuitem label="L1 Two"/>
- <menuitem label="L1 Three"/>
- </menupopup>
-</menu>
-
-<menu id="separatemenu2" label="Menu">
- <menupopup id="separatepopup2" onpopupshown="document.getElementById('separatemenu3').open = true">
- <menuitem label="L2 One"/>
- <menuitem label="L2 Two"/>
- <menuitem label="L2 Three"/>
- </menupopup>
-</menu>
-
-<menu id="separatemenu3" label="Menu" onpopupshown="document.getElementById('separatemenu4').open = true">
- <menupopup id="separatepopup3">
- <menuitem label="L3 One"/>
- <menuitem label="L3 Two"/>
- <menuitem label="L3 Three"/>
- </menupopup>
-</menu>
-
-<menu id="separatemenu4" label="Menu" onpopupshown="document.getElementById('nestedmenu1').open = true">
- <menupopup id="separatepopup3">
- <menuitem label="L4 One"/>
- <menuitem label="L4 Two"/>
- <menuitem label="L4 Three"/>
- </menupopup>
-</menu>
-
-</hbox>
-
-<menu id="nestedmenu1" label="Menu">
- <menupopup id="nestedpopup1" onpopupshown="if (event.target == this) this.firstChild.open = true">
- <menu id="nestedmenu2" label="Menu">
- <menupopup id="nestedpopup2" onpopupshown="if (event.target == this) this.firstChild.open = true">
- <menu id="nestedmenu3" label="Menu">
- <menupopup id="nestedpopup3" onpopupshown="if (event.target == this) this.firstChild.open = true">
- <menu id="nestedmenu4" label="Menu" onpopupshown="parent.popupsOpened()">
- <menupopup id="nestedpopup4">
- <menuitem label="Nested One"/>
- <menuitem label="Nested Two"/>
- <menuitem label="Nested Three"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- </menupopup>
-</menu>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-function init()
-{
- document.getElementById("separatemenu1").open = true;
-}
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/frame_subframe_origin_subframe1.xul b/toolkit/content/tests/chrome/frame_subframe_origin_subframe1.xul
deleted file mode 100644
index c85083cb7..000000000
--- a/toolkit/content/tests/chrome/frame_subframe_origin_subframe1.xul
+++ /dev/null
@@ -1,43 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<page id="frame1"
- style="background-color:green;"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<spacer height="10px"/>
-<iframe
- style="margin:10px; min-height:170px; max-width:200px; max-height:200px; border:solid 1px white;"
- src="frame_subframe_origin_subframe2.xul"></iframe>
-<spacer height="3px"/>
-<caption id="cap1" style="min-width:200px; max-width:200px; background-color:white;" label=""/>
-<script class="testbody" type="application/javascript">
-
-// Fire a mouse move event aimed at this window, and check to be
-// sure the client coords translate from widget to the dom correctly.
-
-function runTests()
-{
- synthesizeMouse(document.getElementById("frame1"), 3, 4, { type: "mousemove" });
-}
-
-function mouseMove(e) {
- e.stopPropagation();
- var element = e.target;
- var el = document.getElementById("cap1");
- el.label = "client: (" + e.clientX + "," + e.clientY + ")";
- parent.opener.wrappedJSObject.SimpleTest.is(e.clientX, 3, "mouse event clientX on sub frame 1");
- parent.opener.wrappedJSObject.SimpleTest.is(e.clientY, 4, "mouse event clientY on sub frame 1");
- // fire the next test on the sub frame
- frames[0].runTests();
-}
-
-window.addEventListener("mousemove", mouseMove, false);
-
-</script>
-</page>
diff --git a/toolkit/content/tests/chrome/frame_subframe_origin_subframe2.xul b/toolkit/content/tests/chrome/frame_subframe_origin_subframe2.xul
deleted file mode 100644
index 92ef64b89..000000000
--- a/toolkit/content/tests/chrome/frame_subframe_origin_subframe2.xul
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<page id="frame2"
- style="background-color:red;"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<spacer height="10px"/>
-<caption id="cap2" style="background-color:white;" label=""/>
-<script class="testbody" type="application/javascript">
-
-// Fire a mouse move event aimed at this window, and check to be
-// sure the client coords translate from widget to the dom correctly.
-
-function runTests()
-{
- synthesizeMouse(document.getElementById("frame2"), 6, 5, { type: "mousemove" });
-}
-
-function mouseMove(e) {
- e.stopPropagation();
- var element = e.target;
- var el = document.getElementById("cap2");
- el.label = "client: (" + e.clientX + "," + e.clientY + ")";
- parent.parent.opener.wrappedJSObject.SimpleTest.is(e.clientX, 6, "mouse event clientX on sub frame 2");
- parent.parent.opener.wrappedJSObject.SimpleTest.is(e.clientY, 5, "mouse event clientY on sub frame 2");
- parent.parent.opener.wrappedJSObject.SimpleTest.finish();
- parent.parent.close();
-}
-
-window.addEventListener("mousemove",mouseMove, false);
-
-</script>
-</page>
diff --git a/toolkit/content/tests/chrome/popup_childframe_node.xul b/toolkit/content/tests/chrome/popup_childframe_node.xul
deleted file mode 100644
index 512f5f8c2..000000000
--- a/toolkit/content/tests/chrome/popup_childframe_node.xul
+++ /dev/null
@@ -1,2 +0,0 @@
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" width="80" height="80"
- onclick="document.documentElement.setAttribute('data', 'x' + document.popupNode)"/>
diff --git a/toolkit/content/tests/chrome/popup_trigger.js b/toolkit/content/tests/chrome/popup_trigger.js
deleted file mode 100644
index 920d4d070..000000000
--- a/toolkit/content/tests/chrome/popup_trigger.js
+++ /dev/null
@@ -1,859 +0,0 @@
-var gMenuPopup = null;
-var gTrigger = null;
-var gIsMenu = false;
-var gScreenX = -1, gScreenY = -1;
-var gCachedEvent = null;
-var gCachedEvent2 = null;
-
-function cacheEvent(modifiers)
-{
- var cachedEvent = null;
-
- var mouseFn = function(event) {
- cachedEvent = event;
- }
-
- window.addEventListener("mousedown", mouseFn, false);
- synthesizeMouse(document.documentElement, 0, 0, modifiers);
- window.removeEventListener("mousedown", mouseFn, false);
-
- return cachedEvent;
-}
-
-function runTests()
-{
- if (screen.height < 768) {
- ok(false, "popup tests are likely to fail for screen heights less than 768 pixels");
- }
-
- gMenuPopup = document.getElementById("thepopup");
- gTrigger = document.getElementById("trigger");
-
- gIsMenu = gTrigger.boxObject instanceof MenuBoxObject;
-
- // a hacky way to get the screen position of the document. Cache the event
- // so that we can use it in calls to openPopup.
- gCachedEvent = cacheEvent({ shiftKey: true });
- gScreenX = gCachedEvent.screenX;
- gScreenY = gCachedEvent.screenY;
- gCachedEvent2 = cacheEvent({ altKey: true, ctrlKey: true, shiftKey: true, metaKey: true });
-
- startPopupTests(popupTests);
-}
-
-var popupTests = [
-{
- testname: "mouse click on trigger",
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- test: function() {
- // for menus, no trigger will be set. For non-menus using the popup
- // attribute, the trigger will be set to the node with the popup attribute
- gExpectedTriggerNode = gIsMenu ? "notset" : gTrigger;
- synthesizeMouse(gTrigger, 4, 4, { });
- },
- result: function (testname) {
- gExpectedTriggerNode = null;
- // menus are the anchor but non-menus are opened at screen coordinates
- is(gMenuPopup.anchorNode, gIsMenu ? gTrigger : null, testname + " anchorNode");
- // menus are opened internally, but non-menus have a mouse event which
- // triggered them
- is(gMenuPopup.triggerNode, gIsMenu ? null : gTrigger, testname + " triggerNode");
- is(document.popupNode, gIsMenu ? null : gTrigger, testname + " document.popupNode");
- is(document.tooltipNode, null, testname + " document.tooltipNode");
- // check to ensure the popup node for a different document isn't used
- if (window.opener)
- is(window.opener.document.popupNode, null, testname + " opener.document.popupNode");
-
- // this will be used in some tests to ensure the size doesn't change
- var popuprect = gMenuPopup.getBoundingClientRect();
- gPopupWidth = Math.round(popuprect.width);
- gPopupHeight = Math.round(popuprect.height);
-
- checkActive(gMenuPopup, "", testname);
- checkOpen("trigger", testname);
- // if a menu, the popup should be opened underneath the menu in the
- // 'after_start' position, otherwise it is opened at the mouse position
- if (gIsMenu)
- compareEdge(gTrigger, gMenuPopup, "after_start", 0, 0, testname);
- }
-},
-{
- // check that pressing cursor down while there is no selection
- // highlights the first item
- testname: "cursor down no selection",
- events: [ "DOMMenuItemActive item1" ],
- test: function() { synthesizeKey("VK_DOWN", { }); },
- result: function(testname) { checkActive(gMenuPopup, "item1", testname); }
-},
-{
- // check that pressing cursor up wraps and highlights the last item
- testname: "cursor up wrap",
- events: [ "DOMMenuItemInactive item1", "DOMMenuItemActive last" ],
- test: function() { synthesizeKey("VK_UP", { }); },
- result: function(testname) {
- checkActive(gMenuPopup, "last", testname);
- }
-},
-{
- // check that pressing cursor down wraps and highlights the first item
- testname: "cursor down wrap",
- events: [ "DOMMenuItemInactive last", "DOMMenuItemActive item1" ],
- test: function() { synthesizeKey("VK_DOWN", { }); },
- result: function(testname) { checkActive(gMenuPopup, "item1", testname); }
-},
-{
- // check that pressing cursor down highlights the second item
- testname: "cursor down",
- events: [ "DOMMenuItemInactive item1", "DOMMenuItemActive item2" ],
- test: function() { synthesizeKey("VK_DOWN", { }); },
- result: function(testname) { checkActive(gMenuPopup, "item2", testname); }
-},
-{
- // check that pressing cursor up highlights the second item
- testname: "cursor up",
- events: [ "DOMMenuItemInactive item2", "DOMMenuItemActive item1" ],
- test: function() { synthesizeKey("VK_UP", { }); },
- result: function(testname) { checkActive(gMenuPopup, "item1", testname); }
-},
-{
- // cursor left should not do anything
- testname: "cursor left",
- test: function() { synthesizeKey("VK_LEFT", { }); },
- result: function(testname) { checkActive(gMenuPopup, "item1", testname); }
-},
-{
- // cursor right should not do anything
- testname: "cursor right",
- test: function() { synthesizeKey("VK_RIGHT", { }); },
- result: function(testname) { checkActive(gMenuPopup, "item1", testname); }
-},
-{
- // check cursor down when a disabled item exists in the menu
- testname: "cursor down disabled",
- events: function() {
- // On Windows, disabled items are included when navigating, but on
- // other platforms, disabled items are skipped over
- if (navigator.platform.indexOf("Win") == 0) {
- return [ "DOMMenuItemInactive item1", "DOMMenuItemActive item2" ];
- }
- return [ "DOMMenuItemInactive item1", "DOMMenuItemActive amenu" ];
- },
- test: function() {
- document.getElementById("item2").disabled = true;
- synthesizeKey("VK_DOWN", { });
- }
-},
-{
- // check cursor up when a disabled item exists in the menu
- testname: "cursor up disabled",
- events: function() {
- if (navigator.platform.indexOf("Win") == 0) {
- return [ "DOMMenuItemInactive item2", "DOMMenuItemActive amenu",
- "DOMMenuItemInactive amenu", "DOMMenuItemActive item2",
- "DOMMenuItemInactive item2", "DOMMenuItemActive item1" ];
- }
- return [ "DOMMenuItemInactive amenu", "DOMMenuItemActive item1" ];
- },
- test: function() {
- if (navigator.platform.indexOf("Win") == 0)
- synthesizeKey("VK_DOWN", { });
- synthesizeKey("VK_UP", { });
- if (navigator.platform.indexOf("Win") == 0)
- synthesizeKey("VK_UP", { });
- }
-},
-{
- testname: "mouse click outside",
- events: [ "popuphiding thepopup", "popuphidden thepopup",
- "DOMMenuItemInactive item1", "DOMMenuInactive thepopup" ],
- test: function() {
- gMenuPopup.hidePopup();
- // XXXndeakin event simulation fires events outside of the platform specific
- // widget code so the popup capturing isn't handled. Thus, the menu won't
- // rollup this way.
- // synthesizeMouse(gTrigger, 0, -12, { });
- },
- result: function(testname, step) {
- is(gMenuPopup.anchorNode, null, testname + " anchorNode");
- is(gMenuPopup.triggerNode, null, testname + " triggerNode");
- is(document.popupNode, null, testname + " document.popupNode");
- checkClosed("trigger", testname);
- }
-},
-{
- // these tests check to ensure that passing an anchor and position
- // puts the popup in the right place
- testname: "open popup anchored",
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- steps: ["before_start", "before_end", "after_start", "after_end",
- "start_before", "start_after", "end_before", "end_after", "after_pointer", "overlap",
- "topleft topleft", "topcenter topleft", "topright topleft",
- "leftcenter topright", "rightcenter topright",
- "bottomleft bottomleft", "bottomcenter bottomleft", "bottomright bottomleft",
- "topleft bottomright", "bottomcenter bottomright", "rightcenter topright"],
- test: function(testname, step) {
- gExpectedTriggerNode = "notset";
- gMenuPopup.openPopup(gTrigger, step, 0, 0, false, false);
- },
- result: function(testname, step) {
- // no triggerNode because it was opened without passing an event
- gExpectedTriggerNode = null;
- is(gMenuPopup.anchorNode, gTrigger, testname + " anchorNode");
- is(gMenuPopup.triggerNode, null, testname + " triggerNode");
- is(document.popupNode, null, testname + " document.popupNode");
- compareEdge(gTrigger, gMenuPopup, step, 0, 0, testname);
- }
-},
-{
- // these tests check the same but with a 10 pixel margin on the popup
- testname: "open popup anchored with margin",
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- steps: ["before_start", "before_end", "after_start", "after_end",
- "start_before", "start_after", "end_before", "end_after", "after_pointer", "overlap",
- "topleft topleft", "topcenter topleft", "topright topleft",
- "leftcenter topright", "rightcenter topright",
- "bottomleft bottomleft", "bottomcenter bottomleft", "bottomright bottomleft",
- "topleft bottomright", "bottomcenter bottomright", "rightcenter topright"],
- test: function(testname, step) {
- gMenuPopup.setAttribute("style", "margin: 10px;");
- gMenuPopup.openPopup(gTrigger, step, 0, 0, false, false);
- },
- result: function(testname, step) {
- var rightmod = step == "before_end" || step == "after_end" ||
- step == "start_before" || step == "start_after" ||
- step.match(/topright$/) || step.match(/bottomright$/);
- var bottommod = step == "before_start" || step == "before_end" ||
- step == "start_after" || step == "end_after" ||
- step.match(/bottomleft$/) || step.match(/bottomright$/);
- compareEdge(gTrigger, gMenuPopup, step, rightmod ? -10 : 10, bottommod ? -10 : 10, testname);
- gMenuPopup.removeAttribute("style");
- }
-},
-{
- // these tests check the same but with a -8 pixel margin on the popup
- testname: "open popup anchored with negative margin",
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- steps: ["before_start", "before_end", "after_start", "after_end",
- "start_before", "start_after", "end_before", "end_after", "after_pointer", "overlap"],
- test: function(testname, step) {
- gMenuPopup.setAttribute("style", "margin: -8px;");
- gMenuPopup.openPopup(gTrigger, step, 0, 0, false, false);
- },
- result: function(testname, step) {
- var rightmod = step == "before_end" || step == "after_end" ||
- step == "start_before" || step == "start_after";
- var bottommod = step == "before_start" || step == "before_end" ||
- step == "start_after" || step == "end_after";
- compareEdge(gTrigger, gMenuPopup, step, rightmod ? 8 : -8, bottommod ? 8 : -8, testname);
- gMenuPopup.removeAttribute("style");
- }
-},
- {
- testname: "open popup with large positive margin",
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- steps: ["before_start", "before_end", "after_start", "after_end",
- "start_before", "start_after", "end_before", "end_after", "after_pointer", "overlap"],
- test: function(testname, step) {
- gMenuPopup.setAttribute("style", "margin: 1000px;");
- gMenuPopup.openPopup(gTrigger, step, 0, 0, false, false);
- },
- result: function(testname, step) {
- var popuprect = gMenuPopup.getBoundingClientRect();
- // as there is more room on the 'end' or 'after' side, popups will always
- // appear on the right or bottom corners, depending on which side they are
- // allowed to be flipped by.
- var expectedleft = step == "before_end" || step == "after_end" ?
- 0 : Math.round(window.innerWidth - gPopupWidth);
- var expectedtop = step == "start_after" || step == "end_after" ?
- 0 : Math.round(window.innerHeight - gPopupHeight);
- is(Math.round(popuprect.left), expectedleft, testname + " x position " + step);
- is(Math.round(popuprect.top), expectedtop, testname + " y position " + step);
- gMenuPopup.removeAttribute("style");
- }
-},
-{
- testname: "open popup with large negative margin",
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- steps: ["before_start", "before_end", "after_start", "after_end",
- "start_before", "start_after", "end_before", "end_after", "after_pointer", "overlap"],
- test: function(testname, step) {
- gMenuPopup.setAttribute("style", "margin: -1000px;");
- gMenuPopup.openPopup(gTrigger, step, 0, 0, false, false);
- },
- result: function(testname, step) {
- var popuprect = gMenuPopup.getBoundingClientRect();
- // using negative margins causes the reverse of positive margins, and
- // popups will appear on the left or top corners.
- var expectedleft = step == "before_end" || step == "after_end" ?
- Math.round(window.innerWidth - gPopupWidth) : 0;
- var expectedtop = step == "start_after" || step == "end_after" ?
- Math.round(window.innerHeight - gPopupHeight) : 0;
- is(Math.round(popuprect.left), expectedleft, testname + " x position " + step);
- is(Math.round(popuprect.top), expectedtop, testname + " y position " + step);
- gMenuPopup.removeAttribute("style");
- }
-},
-{
- testname: "popup with unknown step",
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- test: function() {
- gMenuPopup.openPopup(gTrigger, "other", 0, 0, false, false);
- },
- result: function (testname) {
- var triggerrect = gMenuPopup.getBoundingClientRect();
- var popuprect = gMenuPopup.getBoundingClientRect();
- is(Math.round(popuprect.left), triggerrect.left, testname + " x position ");
- is(Math.round(popuprect.top), triggerrect.top, testname + " y position ");
- }
-},
-{
- // these tests check to ensure that the position attribute can be used
- // to set the position of a popup instead of passing it as an argument
- testname: "open popup anchored with attribute",
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- steps: ["before_start", "before_end", "after_start", "after_end",
- "start_before", "start_after", "end_before", "end_after", "after_pointer", "overlap",
- "topcenter topleft", "topright bottomright", "leftcenter topright"],
- test: function(testname, step) {
- gMenuPopup.setAttribute("position", step);
- gMenuPopup.openPopup(gTrigger, "", 0, 0, false, false);
- },
- result: function(testname, step) { compareEdge(gTrigger, gMenuPopup, step, 0, 0, testname); }
-},
-{
- // this test checks to ensure that the attributes override flag to openPopup
- // can be used to override the popup's position. This test also passes an
- // event to openPopup to check the trigger node.
- testname: "open popup anchored with override",
- events: [ "popupshowing thepopup 0010", "popupshown thepopup" ],
- test: function(testname, step) {
- // attribute overrides the position passed in
- gMenuPopup.setAttribute("position", "end_after");
- gExpectedTriggerNode = gCachedEvent.target;
- gMenuPopup.openPopup(gTrigger, "before_start", 0, 0, false, true, gCachedEvent);
- },
- result: function(testname, step) {
- gExpectedTriggerNode = null;
- is(gMenuPopup.anchorNode, gTrigger, testname + " anchorNode");
- is(gMenuPopup.triggerNode, gCachedEvent.target, testname + " triggerNode");
- is(document.popupNode, gCachedEvent.target, testname + " document.popupNode");
- compareEdge(gTrigger, gMenuPopup, "end_after", 0, 0, testname);
- }
-},
-{
- testname: "close popup with escape",
- events: [ "popuphiding thepopup", "popuphidden thepopup",
- "DOMMenuInactive thepopup", ],
- test: function(testname, step) {
- synthesizeKey("VK_ESCAPE", { });
- checkClosed("trigger", testname);
- }
-},
-{
- // check that offsets may be supplied to the openPopup method
- testname: "open popup anchored with offsets",
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- test: function(testname, step) {
- // attribute is empty so does not override
- gMenuPopup.setAttribute("position", "");
- gMenuPopup.openPopup(gTrigger, "before_start", 5, 10, true, true);
- },
- result: function(testname, step) { compareEdge(gTrigger, gMenuPopup, "before_start", 5, 10, testname); }
-},
-{
- // these tests check to ensure that passing an anchor and position
- // puts the popup in the right place
- testname: "show popup anchored",
- condition: function() {
- // only perform this test for popups not in a menu, such as those using
- // the popup attribute, as the showPopup implementation in popup.xml
- // calls openMenu if the popup is inside a menu
- return !gIsMenu;
- },
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- steps: [["topleft", "topleft"],
- ["topleft", "topright"], ["topleft", "bottomleft"],
- ["topright", "topleft"], ["topright", "bottomright"],
- ["bottomleft", "bottomright"], ["bottomleft", "topleft"],
- ["bottomright", "bottomleft"], ["bottomright", "topright"]],
- test: function(testname, step) {
- // the attributes should be ignored
- gMenuPopup.setAttribute("popupanchor", "topright");
- gMenuPopup.setAttribute("popupalign", "bottomright");
- gMenuPopup.setAttribute("position", "end_after");
- gMenuPopup.showPopup(gTrigger, -1, -1, "popup", step[0], step[1]);
- },
- result: function(testname, step) {
- var pos = convertPosition(step[0], step[1]);
- compareEdge(gTrigger, gMenuPopup, pos, 0, 0, testname);
- gMenuPopup.removeAttribute("popupanchor");
- gMenuPopup.removeAttribute("popupalign");
- gMenuPopup.removeAttribute("position");
- }
-},
-{
- testname: "show popup with position",
- condition: function() { return !gIsMenu; },
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- test: function(testname, step) {
- gMenuPopup.showPopup(gTrigger, gScreenX + 60, gScreenY + 15,
- "context", "topleft", "bottomright");
- },
- result: function(testname, step) {
- var rect = gMenuPopup.getBoundingClientRect();
- ok(true, gScreenX + "," + gScreenY);
- is(rect.left, 60, testname + " left");
- is(rect.top, 15, testname + " top");
- ok(rect.right, testname + " right is " + rect.right);
- ok(rect.bottom, testname + " bottom is " + rect.bottom);
- }
-},
-{
- // if no anchor is supplied to openPopup, it should be opened relative
- // to the viewport.
- testname: "open popup unanchored",
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- test: function(testname, step) { gMenuPopup.openPopup(null, "after_start", 6, 8, false); },
- result: function(testname, step) {
- var rect = gMenuPopup.getBoundingClientRect();
- ok(rect.left == 6 && rect.top == 8 && rect.right && rect.bottom, testname);
- }
-},
-{
- testname: "activate menuitem with mouse",
- events: [ "DOMMenuInactive thepopup", "command item3",
- "popuphiding thepopup", "popuphidden thepopup",
- "DOMMenuItemInactive item3" ],
- test: function(testname, step) {
- var item3 = document.getElementById("item3");
- synthesizeMouse(item3, 4, 4, { });
- },
- result: function(testname, step) { checkClosed("trigger", testname); }
-},
-{
- testname: "close popup",
- condition: function() { return false; },
- events: [ "popuphiding thepopup", "popuphidden thepopup",
- "DOMMenuInactive thepopup" ],
- test: function(testname, step) { gMenuPopup.hidePopup(); }
-},
-{
- testname: "open popup at screen",
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- test: function(testname, step) {
- gExpectedTriggerNode = "notset";
- gMenuPopup.openPopupAtScreen(gScreenX + 24, gScreenY + 20, false);
- },
- result: function(testname, step) {
- gExpectedTriggerNode = null;
- is(gMenuPopup.anchorNode, null, testname + " anchorNode");
- is(gMenuPopup.triggerNode, null, testname + " triggerNode");
- is(document.popupNode, null, testname + " document.popupNode");
- var rect = gMenuPopup.getBoundingClientRect();
- is(rect.left, 24, testname + " left");
- is(rect.top, 20, testname + " top");
- ok(rect.right, testname + " right is " + rect.right);
- ok(rect.bottom, testname + " bottom is " + rect.bottom);
- }
-},
-{
- // check that pressing a menuitem's accelerator selects it. Note that
- // the menuitem with the M accesskey overrides the earlier menuitem that
- // begins with M.
- testname: "menuitem accelerator",
- events: [ "DOMMenuItemActive amenu", "DOMMenuItemInactive amenu",
- "DOMMenuInactive thepopup",
- "command amenu", "popuphiding thepopup", "popuphidden thepopup",
- "DOMMenuItemInactive amenu"
- ],
- test: function() { synthesizeKey("M", { }); },
- result: function(testname) { checkClosed("trigger", testname); }
-},
-{
- testname: "open context popup at screen",
- events: [ "popupshowing thepopup 0010", "popupshown thepopup" ],
- test: function(testname, step) {
- gExpectedTriggerNode = gCachedEvent.target;
- gMenuPopup.openPopupAtScreen(gScreenX + 8, gScreenY + 16, true, gCachedEvent);
- },
- result: function(testname, step) {
- gExpectedTriggerNode = null;
- is(gMenuPopup.anchorNode, null, testname + " anchorNode");
- is(gMenuPopup.triggerNode, gCachedEvent.target, testname + " triggerNode");
- is(document.popupNode, gCachedEvent.target, testname + " document.popupNode");
-
- var childframe = document.getElementById("childframe");
- if (childframe) {
- for (var t = 0; t < 2; t++) {
- var child = childframe.contentDocument;
- var evt = child.createEvent("Event");
- evt.initEvent("click", true, true);
- child.documentElement.dispatchEvent(evt);
- is(child.documentElement.getAttribute("data"), "xnull",
- "cannot get popupNode from other document");
- child.documentElement.setAttribute("data", "none");
- // now try again with document.popupNode set explicitly
- document.popupNode = gCachedEvent.target;
- }
- }
-
- var openX = 8;
- var openY = 16;
- var rect = gMenuPopup.getBoundingClientRect();
- is(rect.left, openX + (platformIsMac() ? 1 : 2), testname + " left");
- is(rect.top, openY + (platformIsMac() ? -6 : 2), testname + " top");
- ok(rect.right, testname + " right is " + rect.right);
- ok(rect.bottom, testname + " bottom is " + rect.bottom);
- }
-},
-{
- // pressing a letter that doesn't correspond to an accelerator, but does
- // correspond to the first letter in a menu's label. The menu should not
- // close because there is more than one item corresponding to that letter
- testname: "menuitem with non accelerator",
- events: [ "DOMMenuItemActive one" ],
- test: function() { synthesizeKey("O", { }); },
- result: function(testname) {
- checkOpen("trigger", testname);
- checkActive(gMenuPopup, "one", testname);
- }
-},
-{
- // pressing the letter again should select the next one that starts with
- // that letter
- testname: "menuitem with non accelerator again",
- events: [ "DOMMenuItemInactive one", "DOMMenuItemActive submenu" ],
- test: function() { synthesizeKey("O", { }); },
- result: function(testname) {
- // 'submenu' is a menu but it should not be open
- checkOpen("trigger", testname);
- checkClosed("submenu", testname);
- checkActive(gMenuPopup, "submenu", testname);
- }
-},
-{
- // open the submenu with the cursor right key
- testname: "open submenu with cursor right",
- events: [ "popupshowing submenupopup", "DOMMenuItemActive submenuitem",
- "popupshown submenupopup" ],
- test: function() { synthesizeKey("VK_RIGHT", { }); },
- result: function(testname) {
- checkOpen("trigger", testname);
- checkOpen("submenu", testname);
- checkActive(gMenuPopup, "submenu", testname);
- checkActive(document.getElementById("submenupopup"), "submenuitem", testname);
- }
-},
-{
- // close the submenu with the cursor left key
- testname: "close submenu with cursor left",
- events: [ "popuphiding submenupopup", "popuphidden submenupopup",
- "DOMMenuItemInactive submenuitem", "DOMMenuInactive submenupopup",
- "DOMMenuItemActive submenu" ],
- test: function() { synthesizeKey("VK_LEFT", { }); },
- result: function(testname) {
- checkOpen("trigger", testname);
- checkClosed("submenu", testname);
- checkActive(gMenuPopup, "submenu", testname);
- checkActive(document.getElementById("submenupopup"), "", testname);
- }
-},
-{
- // open the submenu with the enter key
- testname: "open submenu with enter",
- events: [ "popupshowing submenupopup", "DOMMenuItemActive submenuitem",
- "popupshown submenupopup" ],
- test: function() { synthesizeKey("VK_RETURN", { }); },
- result: function(testname) {
- checkOpen("trigger", testname);
- checkOpen("submenu", testname);
- checkActive(gMenuPopup, "submenu", testname);
- checkActive(document.getElementById("submenupopup"), "submenuitem", testname);
- }
-},
-{
- // close the submenu with the escape key
- testname: "close submenu with escape",
- events: [ "popuphiding submenupopup", "popuphidden submenupopup",
- "DOMMenuItemInactive submenuitem", "DOMMenuInactive submenupopup",
- "DOMMenuItemActive submenu" ],
- test: function() { synthesizeKey("VK_ESCAPE", { }); },
- result: function(testname) {
- checkOpen("trigger", testname);
- checkClosed("submenu", testname);
- checkActive(gMenuPopup, "submenu", testname);
- checkActive(document.getElementById("submenupopup"), "", testname);
- }
-},
-{
- // pressing the letter again when the next item is disabled should still
- // select the disabled item on Windows, but select the next item on other
- // platforms
- testname: "menuitem with non accelerator disabled",
- events: function() {
- if (navigator.platform.indexOf("Win") == 0) {
- return [ "DOMMenuItemInactive submenu", "DOMMenuItemActive other",
- "DOMMenuItemInactive other", "DOMMenuItemActive item1" ];
- }
- return [ "DOMMenuItemInactive submenu", "DOMMenuItemActive last",
- "DOMMenuItemInactive last", "DOMMenuItemActive item1" ];
- },
- test: function() { synthesizeKey("O", { }); synthesizeKey("F", { }); },
- result: function(testname) {
- checkActive(gMenuPopup, "item1", testname);
- }
-},
-{
- // pressing a letter that doesn't correspond to an accelerator nor the
- // first letter of a menu. This should have no effect.
- testname: "menuitem with keypress no accelerator found",
- test: function() { synthesizeKey("G", { }); },
- result: function(testname) {
- checkOpen("trigger", testname);
- checkActive(gMenuPopup, "item1", testname);
- }
-},
-{
- // when only one menuitem starting with that letter exists, it should be
- // selected and the menu closed
- testname: "menuitem with non accelerator single",
- events: [ "DOMMenuItemInactive item1", "DOMMenuItemActive amenu",
- "DOMMenuItemInactive amenu", "DOMMenuInactive thepopup",
- "command amenu", "popuphiding thepopup", "popuphidden thepopup",
- "DOMMenuItemInactive amenu",
- ],
- test: function() { synthesizeKey("M", { }); },
- result: function(testname) {
- checkClosed("trigger", testname);
- checkActive(gMenuPopup, "", testname);
- }
-},
-{
- testname: "open context popup at screen with all modifiers set",
- events: [ "popupshowing thepopup 1111", "popupshown thepopup" ],
- autohide: "thepopup",
- test: function(testname, step) {
- gMenuPopup.openPopupAtScreen(gScreenX + 8, gScreenY + 16, true, gCachedEvent2);
- }
-},
-{
- testname: "open popup with open property",
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- test: function(testname, step) { openMenu(gTrigger); },
- result: function(testname, step) {
- checkOpen("trigger", testname);
- if (gIsMenu)
- compareEdge(gTrigger, gMenuPopup, "after_start", 0, 0, testname);
- }
-},
-{
- testname: "open submenu with open property",
- events: [ "popupshowing submenupopup", "DOMMenuItemActive submenu",
- "popupshown submenupopup" ],
- test: function(testname, step) { openMenu(document.getElementById("submenu")); },
- result: function(testname, step) {
- checkOpen("trigger", testname);
- checkOpen("submenu", testname);
- // XXXndeakin
- // getBoundingClientRect doesn't seem to working right for submenus
- // so disable this test for now
- // compareEdge(document.getElementById("submenu"),
- // document.getElementById("submenupopup"), "end_before", 0, 0, testname);
- }
-},
-{
- testname: "hidePopup hides entire chain",
- events: [ "popuphiding submenupopup", "popuphidden submenupopup",
- "popuphiding thepopup", "popuphidden thepopup",
- "DOMMenuInactive submenupopup",
- "DOMMenuItemInactive submenu", "DOMMenuItemInactive submenu",
- "DOMMenuInactive thepopup", ],
- test: function() { gMenuPopup.hidePopup(); },
- result: function(testname, step) {
- checkClosed("trigger", testname);
- checkClosed("submenu", testname);
- }
-},
-{
- testname: "open submenu with open property without parent open",
- test: function(testname, step) { openMenu(document.getElementById("submenu")); },
- result: function(testname, step) {
- checkClosed("trigger", testname);
- checkClosed("submenu", testname);
- }
-},
-{
- testname: "open popup with open property and position",
- condition: function() { return gIsMenu; },
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- test: function(testname, step) {
- gMenuPopup.setAttribute("position", "before_start");
- openMenu(gTrigger);
- },
- result: function(testname, step) {
- compareEdge(gTrigger, gMenuPopup, "before_start", 0, 0, testname);
- }
-},
-{
- testname: "close popup with open property",
- condition: function() { return gIsMenu; },
- events: [ "popuphiding thepopup", "popuphidden thepopup",
- "DOMMenuInactive thepopup" ],
- test: function(testname, step) { closeMenu(gTrigger, gMenuPopup); },
- result: function(testname, step) { checkClosed("trigger", testname); }
-},
-{
- testname: "open popup with open property, position, anchor and alignment",
- condition: function() { return gIsMenu; },
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- test: function(testname, step) {
- gMenuPopup.setAttribute("position", "start_after");
- gMenuPopup.setAttribute("popupanchor", "topright");
- gMenuPopup.setAttribute("popupalign", "bottomright");
- openMenu(gTrigger);
- },
- result: function(testname, step) {
- compareEdge(gTrigger, gMenuPopup, "start_after", 0, 0, testname);
- }
-},
-{
- testname: "open popup with open property, anchor and alignment",
- condition: function() { return gIsMenu; },
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- test: function(testname, step) {
- gMenuPopup.removeAttribute("position");
- gMenuPopup.setAttribute("popupanchor", "bottomright");
- gMenuPopup.setAttribute("popupalign", "topright");
- openMenu(gTrigger);
- },
- result: function(testname, step) {
- compareEdge(gTrigger, gMenuPopup, "after_end", 0, 0, testname);
- gMenuPopup.removeAttribute("popupanchor");
- gMenuPopup.removeAttribute("popupalign");
- }
-},
-{
- testname: "focus and cursor down on trigger",
- condition: function() { return gIsMenu; },
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- test: function(testname, step) {
- gTrigger.focus();
- synthesizeKey("VK_DOWN", { altKey: !platformIsMac() });
- },
- result: function(testname, step) {
- checkOpen("trigger", testname);
- checkActive(gMenuPopup, "", testname);
- }
-},
-{
- testname: "focus and cursor up on trigger",
- condition: function() { return gIsMenu; },
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- test: function(testname, step) {
- gTrigger.focus();
- synthesizeKey("VK_UP", { altKey: !platformIsMac() });
- },
- result: function(testname, step) {
- checkOpen("trigger", testname);
- checkActive(gMenuPopup, "", testname);
- }
-},
-{
- testname: "select and enter on menuitem",
- condition: function() { return gIsMenu; },
- events: [ "DOMMenuItemActive item1", "DOMMenuItemInactive item1",
- "DOMMenuInactive thepopup", "command item1",
- "popuphiding thepopup", "popuphidden thepopup",
- "DOMMenuItemInactive item1" ],
- test: function(testname, step) {
- synthesizeKey("VK_DOWN", { });
- synthesizeKey("VK_RETURN", { });
- },
- result: function(testname, step) { checkClosed("trigger", testname); }
-},
-{
- testname: "focus trigger and key to open",
- condition: function() { return gIsMenu; },
- events: [ "popupshowing thepopup", "popupshown thepopup" ],
- autohide: "thepopup",
- test: function(testname, step) {
- gTrigger.focus();
- synthesizeKey(platformIsMac() ? " " : "VK_F4", { });
- },
- result: function(testname, step) {
- checkOpen("trigger", testname);
- checkActive(gMenuPopup, "", testname);
- }
-},
-{
- // the menu should only open when the meta or alt key is not pressed
- testname: "focus trigger and key wrong modifier",
- condition: function() { return gIsMenu; },
- test: function(testname, step) {
- gTrigger.focus();
- if (platformIsMac())
- synthesizeKey("VK_F4", { altKey: true });
- else
- synthesizeKey("", { metaKey: true });
- },
- result: function(testname, step) {
- checkClosed("trigger", testname);
- }
-},
-{
- testname: "mouse click on disabled menu",
- condition: function() { return gIsMenu; },
- test: function(testname, step) {
- gTrigger.setAttribute("disabled", "true");
- synthesizeMouse(gTrigger, 4, 4, { });
- },
- result: function(testname, step) {
- checkClosed("trigger", testname);
- gTrigger.removeAttribute("disabled");
- }
-},
-{
- // openPopup should open the menu synchronously, however popupshown
- // is fired asynchronously
- testname: "openPopup synchronous",
- events: [ "popupshowing thepopup", "popupshowing submenupopup",
- "popupshown thepopup", "DOMMenuItemActive submenu",
- "popupshown submenupopup" ],
- test: function(testname, step) {
- gMenuPopup.openPopup(gTrigger, "after_start", 0, 0, false, true);
- document.getElementById("submenupopup").
- openPopup(gTrigger, "end_before", 0, 0, false, true);
- checkOpen("trigger", testname);
- checkOpen("submenu", testname);
- }
-},
-{
- // remove the content nodes for the popup
- testname: "remove content",
- test: function(testname, step) {
- var submenupopup = document.getElementById("submenupopup");
- submenupopup.parentNode.removeChild(submenupopup);
- var popup = document.getElementById("thepopup");
- popup.parentNode.removeChild(popup);
- }
-}
-
-];
-
-function platformIsMac()
-{
- return navigator.platform.indexOf("Mac") > -1;
-}
diff --git a/toolkit/content/tests/chrome/rtlchrome/rtl.css b/toolkit/content/tests/chrome/rtlchrome/rtl.css
deleted file mode 100644
index 0fea01001..000000000
--- a/toolkit/content/tests/chrome/rtlchrome/rtl.css
+++ /dev/null
@@ -1,2 +0,0 @@
-/* Imitate RTL UI */
-window { direction: rtl; }
diff --git a/toolkit/content/tests/chrome/rtlchrome/rtl.dtd b/toolkit/content/tests/chrome/rtlchrome/rtl.dtd
deleted file mode 100644
index 8b32de674..000000000
--- a/toolkit/content/tests/chrome/rtlchrome/rtl.dtd
+++ /dev/null
@@ -1 +0,0 @@
-<!ENTITY locale.dir "rtl">
diff --git a/toolkit/content/tests/chrome/rtlchrome/rtl.manifest b/toolkit/content/tests/chrome/rtlchrome/rtl.manifest
deleted file mode 100644
index a4cc6929b..000000000
--- a/toolkit/content/tests/chrome/rtlchrome/rtl.manifest
+++ /dev/null
@@ -1,5 +0,0 @@
-content rtlchrome /
-
-# Override intl.css with our own CSS file
-override chrome://global/locale/intl.css chrome://rtlchrome/rtl.css
-override chrome://global/locale/global.dtd chrome://rtlchrome/rtl.dtd
diff --git a/toolkit/content/tests/chrome/rtltest/content/dirtest.xul b/toolkit/content/tests/chrome/rtltest/content/dirtest.xul
deleted file mode 100644
index b75d41eaa..000000000
--- a/toolkit/content/tests/chrome/rtltest/content/dirtest.xul
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<html:style>
-hbox, vbox { background-color: white; }
-hbox:-moz-locale-dir(ltr) { background-color: yellow; }
-vbox:-moz-locale-dir(rtl) { background-color: green; }
-</html:style>
-
-<hbox id="hbox">
- <button label="One"/>
- <button label="Two"/>
- <button label="Three"/>
-</hbox>
-<vbox id="vbox">
- <button label="One"/>
- <button label="Two"/>
- <button label="Three"/>
-</vbox>
-
-</window>
diff --git a/toolkit/content/tests/chrome/rtltest/righttoleft.manifest b/toolkit/content/tests/chrome/rtltest/righttoleft.manifest
deleted file mode 100644
index db98656bc..000000000
--- a/toolkit/content/tests/chrome/rtltest/righttoleft.manifest
+++ /dev/null
@@ -1,3 +0,0 @@
-content ltrtest content/
-content rtltest content/
-locale rtltest ar-QA content/
diff --git a/toolkit/content/tests/chrome/sample_entireword_latin1.html b/toolkit/content/tests/chrome/sample_entireword_latin1.html
deleted file mode 100644
index b2d66fa3c..000000000
--- a/toolkit/content/tests/chrome/sample_entireword_latin1.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head><title>Latin entire-word find test page</title></head>
- <body>
- <!-- Feel free to extend the contents of this page with more comprehensive
- - Latin punctuation and/ or word markers.
- -->
- <p>The twins of Mammon quarrelled. Their warring plunged the world into a new darkness, and the beast abhorred the darkness. So it began to move swiftly, and grew more powerful, and went forth and multiplied. And the beasts brought fire and light to the darkness.</p>
- <p>from The Book of Mozilla, 15:1</p>
- </body>
-</html>
diff --git a/toolkit/content/tests/chrome/test_about_networking.html b/toolkit/content/tests/chrome/test_about_networking.html
deleted file mode 100644
index 6ffaf2ba7..000000000
--- a/toolkit/content/tests/chrome/test_about_networking.html
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=912103
--->
-<head>
- <meta charset="utf-8">
- <title>Test for Bug </title>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
- <script type="application/javascript">
-
- SimpleTest.waitForExplicitFinish();
-
- function runTest() {
- const Cc = Components.classes;
- const Ci = Components.interfaces;
-
- var dashboard = Cc['@mozilla.org/network/dashboard;1']
- .getService(Ci.nsIDashboard);
- dashboard.enableLogging = true;
-
- var wsURI = "ws://mochi.test:8888/chrome/toolkit/content/tests/chrome/file_about_networking";
- var websocket = new WebSocket(wsURI);
-
- websocket.addEventListener("open", function() {
- dashboard.requestWebsocketConnections(function(data) {
- var found = false;
- for (var i = 0; i < data.websockets.length; i++) {
- if (data.websockets[i].hostport == "mochi.test:8888") {
- found = true;
- break;
- }
- }
- isnot(found, false, "tested websocket entry not found");
- websocket.close();
- SimpleTest.finish();
- });
- });
- }
-
- window.addEventListener("DOMContentLoaded", function run() {
- window.removeEventListener("DOMContentLoaded", run);
- runTest();
- });
-
- </script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=912103">Mozilla Bug </a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/chrome/test_arrowpanel.xul b/toolkit/content/tests/chrome/test_arrowpanel.xul
deleted file mode 100644
index 671c33a15..000000000
--- a/toolkit/content/tests/chrome/test_arrowpanel.xul
+++ /dev/null
@@ -1,327 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Arrow Panels"
- style="padding: 10px;"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<stack flex="1">
- <label id="topleft" value="Top Left Corner" left="15" top="15"/>
- <label id="topright" value="Top Right" right="15" top="15"/>
- <label id="bottomleft" value="Bottom Left Corner" left="15" bottom="15"/>
- <label id="bottomright" value="Bottom Right" right="15" bottom="15"/>
- <!-- Our SimpleTest/TestRunner.js runs tests inside an iframe which sizes are W=500 H=300.
- 'left' and 'top' values need to be set so that the panel (popup) has enough room to display on its 4 sides. -->
- <label id="middle" value="+/- Centered" left="225" top="135"/>
- <iframe id="frame" type="content"
- src="data:text/html,&lt;input id='input'&gt;" width="100" height="100" left="225" top="120"/>
-</stack>
-
-<panel id="panel" type="arrow" animate="false"
- onpopupshown="checkPanelPosition(this)" onpopuphidden="runNextTest.next()">
- <box width="115" height="65"/>
-</panel>
-
-<panel id="bigpanel" type="arrow" animate="false"
- onpopupshown="checkBigPanel(this)" onpopuphidden="runNextTest.next()">
- <box width="125" height="3000"/>
-</panel>
-
-<panel id="animatepanel" type="arrow"
- onpopupshown="animatedPopupShown = true;"
- onpopuphidden="animatedPopupHidden = true; runNextTest.next();">
- <label value="Animate Closed" height="40"/>
-</panel>
-
-<script type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-const isOSXYosemite = navigator.userAgent.indexOf("Mac OS X 10.10") != -1;
-
-var expectedAnchor = null;
-var expectedSide = "", expectedAnchorEdge = "", expectedPack = "", expectedAlignment = "";
-var zoomFactor = 1;
-var animatedPopupShown = false;
-var animatedPopupHidden = false;
-var runNextTest;
-
-function startTest()
-{
- runNextTest = nextTest();
- runNextTest.next();
-}
-
-function nextTest()
-{
- var panel = $("panel");
-
- function openPopup(position, anchor, expected, anchorEdge, pack, alignment)
- {
- expectedAnchor = anchor instanceof Node ? anchor : $(anchor);
- expectedSide = expected;
- expectedAnchorEdge = anchorEdge;
- expectedPack = pack;
- expectedAlignment = alignment == undefined ? position : alignment;
-
- panel.removeAttribute("side");
- panel.openPopup(expectedAnchor, position, 0, 0, false, false, null);
- }
-
- for (var iter = 0; iter < 2; iter++) {
- openPopup("after_start", "topleft", "top", "left", "start");
- yield;
- openPopup("after_start", "bottomleft", "bottom", "left", "start", "before_start");
- yield;
- openPopup("before_start", "topleft", "top", "left", "start", "after_start");
- yield;
- openPopup("before_start", "bottomleft", "bottom", "left", "start");
- yield;
- openPopup("after_start", "middle", "top", "left", "start");
- yield;
- openPopup("before_start", "middle", "bottom", "left", "start");
- yield;
-
- openPopup("after_start", "topright", "top", "right", "end", "after_end");
- yield;
- openPopup("after_start", "bottomright", "bottom", "right", "end", "before_end");
- yield;
- openPopup("before_start", "topright", "top", "right", "end", "after_end");
- yield;
- openPopup("before_start", "bottomright", "bottom", "right", "end", "before_end");
- yield;
-
- openPopup("after_end", "middle", "top", "right", "end");
- yield;
- openPopup("before_end", "middle", "bottom", "right", "end");
- yield;
-
- openPopup("start_before", "topleft", "left", "top", "start", "end_before");
- yield;
- openPopup("start_before", "topright", "right", "top", "start");
- yield;
- openPopup("end_before", "topleft", "left", "top", "start");
- yield;
- openPopup("end_before", "topright", "right", "top", "start", "start_before");
- yield;
- openPopup("start_before", "middle", "right", "top", "start");
- yield;
- openPopup("end_before", "middle", "left", "top", "start");
- yield;
-
- openPopup("start_before", "bottomleft", "left", "bottom", "end", "end_after");
- yield;
- openPopup("start_before", "bottomright", "right", "bottom", "end", "start_after");
- yield;
- openPopup("end_before", "bottomleft", "left", "bottom", "end", "end_after");
- yield;
- openPopup("end_before", "bottomright", "right", "bottom", "end", "start_after");
- yield;
-
- openPopup("start_after", "middle", "right", "bottom", "end");
- yield;
- openPopup("end_after", "middle", "left", "bottom", "end");
- yield;
-
- openPopup("topcenter bottomleft", "bottomleft", "bottom", "center left", "start", "before_start");
- yield;
- openPopup("bottomcenter topleft", "topleft", "top", "center left", "start", "after_start");
- yield;
- openPopup("topcenter bottomright", "bottomright", "bottom", "center right", "end", "before_end");
- yield;
- openPopup("bottomcenter topright", "topright", "top", "center right", "end", "after_end");
- yield;
- openPopup("topcenter bottomleft", "middle", "bottom", "center left", "start", "before_start");
- yield;
- openPopup("bottomcenter topleft", "middle", "top", "center left", "start", "after_start");
- yield;
-
- openPopup("leftcenter topright", "middle", "right", "center top", "start", "start_before");
- yield;
- openPopup("rightcenter bottomleft", "middle", "left", "center bottom", "end", "end_after");
- yield;
-
-/*
- XXXndeakin disable these parts of the test which often cause problems, see bug 626563
-
- openPopup("after_start", frames[0].document.getElementById("input"), "top", "left", "start");
- yield;
-
- setScale(frames[0], 1.5);
- openPopup("after_start", frames[0].document.getElementById("input"), "top", "left", "start");
- yield;
-
- setScale(frames[0], 2.5);
- openPopup("before_start", frames[0].document.getElementById("input"), "bottom", "left", "start");
- yield;
-
- setScale(frames[0], 1);
-*/
-
- $("bigpanel").openPopup($("topleft"), "after_start", 0, 0, false, false, null, "start");
- yield;
-
- // switch to rtl mode
- document.documentElement.style.direction = "rtl";
- $("topleft").setAttribute("right", "15");
- $("topright").setAttribute("left", "15");
- $("bottomleft").setAttribute("right", "15");
- $("bottomright").setAttribute("left", "15");
- $("topleft").removeAttribute("left");
- $("topright").removeAttribute("right");
- $("bottomleft").removeAttribute("left");
- $("bottomright").removeAttribute("right");
- }
-
- // Test that a transition occurs when opening or closing the popup. The transition is
- // disabled on Linux.
- if (navigator.platform.indexOf("Linux") == -1) {
- function transitionEnded(event) {
- if ($("animatepanel").state != "open") {
- is($("animatepanel").state, "showing", "state is showing during transitionend");
- ok(!animatedPopupShown, "popupshown not fired yet")
- } else {
- is($("animatepanel").state, "open", "state is open after transitionend");
- ok(animatedPopupShown, "popupshown now fired")
- SimpleTest.executeSoon(() => runNextTest.next());
- }
- }
-
- // Check that the transition occurs for an arrow panel with animate="true"
- window.addEventListener("transitionend", transitionEnded, false);
- $("animatepanel").openPopup($("topleft"), "after_start", 0, 0, false, false, null, "start");
- is($("animatepanel").state, "showing", "state is showing");
- yield;
- window.removeEventListener("transitionend", transitionEnded, false);
-
- synthesizeKey("VK_ESCAPE", { });
- ok(!animatedPopupHidden, "animated popup not hidden yet");
- yield;
- }
-
- SimpleTest.finish()
- yield;
-}
-
-function setScale(win, scale)
-{
- var wn = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIWebNavigation);
- var shell = wn.QueryInterface(Components.interfaces.nsIDocShell);
- var docViewer = shell.contentViewer;
- docViewer.fullZoom = scale;
- zoomFactor = scale;
-}
-
-function checkPanelPosition(panel)
-{
- let anchor = panel.anchorNode;
- let adj = 0, hwinpos = 0, vwinpos = 0;
- if (anchor.ownerDocument != document) {
- var framerect = anchor.ownerDocument.defaultView.frameElement.getBoundingClientRect();
- hwinpos = framerect.left;
- vwinpos = framerect.top;
- }
-
- // Positions are reversed in rtl yet the coordinates used in the computations
- // are not, so flip the expected label side and anchor edge.
- var isRTL = (window.getComputedStyle(panel).direction == "rtl");
- if (isRTL) {
- var flipLeftRight = val => val == "left" ? "right" : "left";
- expectedAnchorEdge = expectedAnchorEdge.replace(/(left|right)/, flipLeftRight);
- expectedSide = expectedSide.replace(/(left|right)/, flipLeftRight);
- }
-
- var panelRect = panel.getBoundingClientRect();
- var anchorRect = anchor.getBoundingClientRect();
- var contentBO = panel.firstChild.boxObject;
- var contentRect = { top: contentBO.y,
- left: contentBO.x,
- bottom: contentBO.y + contentBO.height,
- right: contentBO.x + contentBO.width };
- switch (expectedSide) {
- case "top":
- ok(contentRect.top > vwinpos + anchorRect.bottom * zoomFactor + 5, "panel content is below");
- break;
- case "bottom":
- ok(contentRect.bottom < vwinpos + anchorRect.top * zoomFactor - 5, "panel content is above");
- break;
- case "left":
- ok(contentRect.left > hwinpos + anchorRect.right * zoomFactor + 5, "panel content is right");
- break;
- case "right":
- ok(contentRect.right < hwinpos + anchorRect.left * zoomFactor - 5, "panel content is left");
- break;
- }
-
- let iscentered = false;
- if (expectedAnchorEdge.indexOf("center ") == 0) {
- expectedAnchorEdge = expectedAnchorEdge.substring(7);
- iscentered = true;
- }
-
- switch (expectedAnchorEdge) {
- case "top":
- adj = vwinpos + parseInt(getComputedStyle(panel, "").marginTop);
- if (iscentered)
- adj += Math.round(anchorRect.height) / 2;
- isWithinHalfPixel(panelRect.top, anchorRect.top * zoomFactor + adj, "anchored on top");
- break;
- case "bottom":
- adj = vwinpos + parseInt(getComputedStyle(panel, "").marginBottom);
- if (iscentered)
- adj += Math.round(anchorRect.height) / 2;
- isWithinHalfPixel(panelRect.bottom, anchorRect.bottom * zoomFactor - adj, "anchored on bottom");
- break;
- case "left":
- adj = hwinpos + parseInt(getComputedStyle(panel, "").marginLeft);
- if (iscentered)
- adj += Math.round(anchorRect.width) / 2;
- isWithinHalfPixel(panelRect.left, anchorRect.left * zoomFactor + adj, "anchored on left ");
- break;
- case "right":
- adj = hwinpos + parseInt(getComputedStyle(panel, "").marginRight);
- if (iscentered)
- adj += Math.round(anchorRect.width) / 2;
- if (!isOSXYosemite)
- isWithinHalfPixel(panelRect.right, anchorRect.right * zoomFactor - adj, "anchored on right");
- break;
- }
-
- is(anchor, expectedAnchor, "anchor");
-
- var arrow = document.getAnonymousElementByAttribute(panel, "anonid", "arrow");
- is(arrow.getAttribute("side"), expectedSide, "panel arrow side");
- is(arrow.hidden, false, "panel hidden");
- is(arrow.parentNode.pack, expectedPack, "panel arrow pack");
- is(panel.alignmentPosition, expectedAlignment, "panel alignmentPosition");
-
- panel.hidePopup();
-}
-
-function isWithinHalfPixel(a, b, desc)
-{
- ok(Math.abs(a - b) <= 0.5, desc);
-}
-
-function checkBigPanel(panel)
-{
- ok(panel.firstChild.getBoundingClientRect().height < 2800, "big panel height");
- panel.hidePopup();
-}
-
-SimpleTest.waitForFocus(startTest);
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml"/>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_autocomplete2.xul b/toolkit/content/tests/chrome/test_autocomplete2.xul
deleted file mode 100644
index 875cddd07..000000000
--- a/toolkit/content/tests/chrome/test_autocomplete2.xul
+++ /dev/null
@@ -1,197 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Autocomplete Widget Test 2"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<textbox id="autocomplete" type="autocomplete"
- autocompletesearch="simple"
- onsearchcomplete="checkResult();"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-// Set to indicate whether or not we want autoCompleteSimple to return a result
-var returnResult = false;
-
-const ACR = Components.interfaces.nsIAutoCompleteResult;
-
-// This result can't be constructed in-line, because otherwise we leak memory.
-function nsAutoCompleteSimpleResult(aString)
-{
- this.searchString = aString;
- if (returnResult) {
- this.searchResult = ACR.RESULT_SUCCESS;
- this.matchCount = 1;
- this._param = "SUCCESS";
- }
-}
-
-nsAutoCompleteSimpleResult.prototype = {
- _param: "",
- searchString: null,
- searchResult: ACR.RESULT_FAILURE,
- defaultIndex: -1,
- errorDescription: null,
- matchCount: 0,
- getValueAt: function() { return this._param; },
- getCommentAt: function() { return null; },
- getStyleAt: function() { return null; },
- getImageAt: function() { return null; },
- getFinalCompleteValueAt: function() { return this.getValueAt(); },
- getLabelAt: function() { return null; },
- removeValueAt: function() {}
-};
-
-// A basic autocomplete implementation that either returns one result or none
-var autoCompleteSimpleID = Components.ID("0a2afbdb-f30e-47d1-9cb1-0cd160240aca");
-var autoCompleteSimpleName = "@mozilla.org/autocomplete/search;1?name=simple"
-var autoCompleteSimple = {
- QueryInterface: function(iid) {
- if (iid.equals(Components.interfaces.nsISupports) ||
- iid.equals(Components.interfaces.nsIFactory) ||
- iid.equals(Components.interfaces.nsIAutoCompleteSearch))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- createInstance: function(outer, iid) {
- return this.QueryInterface(iid);
- },
-
- startSearch: function(aString, aParam, aResult, aListener) {
- var result = new nsAutoCompleteSimpleResult(aString);
- aListener.onSearchResult(this, result);
- },
-
- stopSearch: function() {}
-};
-
-var componentManager = Components.manager
- .QueryInterface(Components.interfaces.nsIComponentRegistrar);
-componentManager.registerFactory(autoCompleteSimpleID, "Test Simple Autocomplete",
- autoCompleteSimpleName, autoCompleteSimple);
-
-
-// Test Bug 441530 - correctly setting "nomatch"
-// Test Bug 441526 - correctly setting style with "highlightnonmatches"
-
-SimpleTest.waitForExplicitFinish();
-setTimeout(startTest, 0);
-
-function startTest() {
- var autocomplete = $("autocomplete");
-
- // Ensure highlightNonMatches can be set correctly.
-
- // This should not be set by default.
- is(autocomplete.hasAttribute("highlightnonmatches"), false,
- "highlight nonmatches not set by default");
-
- autocomplete.highlightNonMatches = "true";
-
- is(autocomplete.getAttribute("highlightnonmatches"), "true",
- "highlight non matches attribute set correctly");
- is(autocomplete.highlightNonMatches, true,
- "highlight non matches getter returned correctly");
-
- autocomplete.highlightNonMatches = "false";
-
- is(autocomplete.getAttribute("highlightnonmatches"), "false",
- "highlight non matches attribute set to false correctly");
- is(autocomplete.highlightNonMatches, false,
- "highlight non matches getter returned false correctly");
-
- ok(!autocomplete.popup.hasAttribute("autocompleteinput"),
- "autocompleteinput on popup not set by default");
-
- check();
-}
-
-function check() {
- var autocomplete = $("autocomplete");
-
- // Toggle this value, so we can re-use the one function.
- returnResult = !returnResult;
-
- // blur the field to ensure that the popup is closed and that the previous
- // search has stopped, then start a new search.
- autocomplete.blur();
- autocomplete.focus();
- synthesizeKey("r", {});
-}
-
-function checkResult() {
- var autocomplete = $("autocomplete");
- var style = window.getComputedStyle(autocomplete, "");
-
- if (returnResult) {
- // Result was returned, so there should not be a nomatch attribute
- is(autocomplete.hasAttribute("nomatch"), false,
- "nomatch attribute shouldn't be present here");
-
- // Ensure that the style is set correctly whichever way highlightNonMatches
- // is set.
- autocomplete.highlightNonMatches = "true";
-
- isnot(style.getPropertyCSSValue("color").cssText, "rgb(255, 0, 0)",
- "not nomatch and highlightNonMatches - should not be red");
-
- autocomplete.highlightNonMatches = "false";
-
- isnot(style.getPropertyCSSValue("color").cssText, "rgb(255, 0, 0)",
- "not nomatch and not highlightNonMatches - should not be red");
-
- is (autocomplete.popup.getAttribute("autocompleteinput"), "autocomplete",
- "The popup's autocompleteinput attribute is set to the ID of the textbox");
-
- setTimeout(check, 0);
- }
- else {
- // No result was returned, so there should be nomatch attribute
- is(autocomplete.getAttribute("nomatch"), "true",
- "nomatch attribute not correctly set when expected");
-
- // Ensure that the style is set correctly whichever way highlightNonMatches
- // is set.
- autocomplete.highlightNonMatches = "true";
-
- is(style.getPropertyCSSValue("color").cssText, "rgb(255, 0, 0)",
- "nomatch and highlightNonMatches - should be red");
-
- autocomplete.highlightNonMatches = "false";
-
- isnot(style.getPropertyCSSValue("color").cssText, "rgb(255, 0, 0)",
- "nomatch and not highlightNonMatches - should not be red");
-
- ok(!autocomplete.popup.hasAttribute("autocompleteinput"),
- "autocompleteinput on popup not set when closed");
-
- setTimeout(function() {
- // Unregister the factory so that we don't get in the way of other tests
- componentManager.unregisterFactory(autoCompleteSimpleID, autoCompleteSimple);
- SimpleTest.finish();
- }, 0);
- }
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_autocomplete3.xul b/toolkit/content/tests/chrome/test_autocomplete3.xul
deleted file mode 100644
index 953fd15c8..000000000
--- a/toolkit/content/tests/chrome/test_autocomplete3.xul
+++ /dev/null
@@ -1,188 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Autocomplete Widget Test 3"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<textbox id="autocomplete" type="autocomplete"
- autocompletesearch="simple"
- onsearchcomplete="checkResult();"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-// Set to indicate whether or not we want autoCompleteSimple to return a result
-var returnResult = true;
-
-const ACR = Components.interfaces.nsIAutoCompleteResult;
-
-// This result can't be constructed in-line, because otherwise we leak memory.
-function nsAutoCompleteSimpleResult(aString)
-{
- this.searchString = aString;
- if (returnResult) {
- this.searchResult = ACR.RESULT_SUCCESS;
- this.matchCount = 1;
- this._param = "Result";
- }
-}
-
-nsAutoCompleteSimpleResult.prototype = {
- _param: "",
- searchString: null,
- searchResult: ACR.RESULT_FAILURE,
- defaultIndex: 0,
- errorDescription: null,
- matchCount: 0,
- getValueAt: function() { return this._param; },
- getCommentAt: function() { return null; },
- getStyleAt: function() { return null; },
- getImageAt: function() { return null; },
- getFinalCompleteValueAt: function() { return this.getValueAt(); },
- getLabelAt: function() { return null; },
- removeValueAt: function() {}
-};
-
-// A basic autocomplete implementation that either returns one result or none
-var autoCompleteSimpleID = Components.ID("0a2afbdb-f30e-47d1-9cb1-0cd160240aca");
-var autoCompleteSimpleName = "@mozilla.org/autocomplete/search;1?name=simple"
-var autoCompleteSimple = {
- QueryInterface: function(iid) {
- if (iid.equals(Components.interfaces.nsISupports) ||
- iid.equals(Components.interfaces.nsIFactory) ||
- iid.equals(Components.interfaces.nsIAutoCompleteSearch))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- createInstance: function(outer, iid) {
- return this.QueryInterface(iid);
- },
-
- startSearch: function(aString, aParam, aResult, aListener) {
- var result = new nsAutoCompleteSimpleResult(aString);
- aListener.onSearchResult(this, result);
- },
-
- stopSearch: function() {}
-};
-
-var componentManager = Components.manager
- .QueryInterface(Components.interfaces.nsIComponentRegistrar);
-componentManager.registerFactory(autoCompleteSimpleID, "Test Simple Autocomplete",
- autoCompleteSimpleName, autoCompleteSimple);
-
-
-// Test Bug 325842 - completeDefaultIndex
-
-SimpleTest.waitForExplicitFinish();
-setTimeout(startTest, 0);
-
-var currentTest = 0;
-
-// Note the entries for these tests (key) are incremental.
-const tests = [
- { completeDefaultIndex: "false", key: "r", result: "r",
- start: 1, end: 1 },
- { completeDefaultIndex: "true", key: "e", result: "result",
- start: 2, end: 6 },
- { completeDefaultIndex: "true", key: "t", result: "ret >> Result",
- start: 3, end: 13 }
-];
-
-function startTest() {
- var autocomplete = $("autocomplete");
-
- // These should not be set by default.
- is(autocomplete.hasAttribute("completedefaultindex"), false,
- "completedefaultindex not set by default");
-
- autocomplete.completeDefaultIndex = "true";
-
- is(autocomplete.getAttribute("completedefaultindex"), "true",
- "completedefaultindex attribute set correctly");
- is(autocomplete.completeDefaultIndex, true,
- "autoFill getter returned correctly");
-
- autocomplete.completeDefaultIndex = "false";
-
- is(autocomplete.getAttribute("completedefaultindex"), "false",
- "completedefaultindex attribute set to false correctly");
- is(autocomplete.completeDefaultIndex, false,
- "completeDefaultIndex getter returned false correctly");
-
- checkNext();
-}
-
-function checkNext() {
- var autocomplete = $("autocomplete");
-
- autocomplete.completeDefaultIndex = tests[currentTest].completeDefaultIndex;
- autocomplete.focus();
-
- synthesizeKey(tests[currentTest].key, {});
-}
-
-function checkResult() {
- var autocomplete = $("autocomplete");
- var style = window.getComputedStyle(autocomplete, "");
-
- is(autocomplete.value, tests[currentTest].result,
- "Test " + currentTest + ": autocomplete.value should equal '" +
- tests[currentTest].result + "'");
-
- is(autocomplete.selectionStart, tests[currentTest].start,
- "Test " + currentTest + ": autocomplete selection should start at " +
- tests[currentTest].start);
-
- is(autocomplete.selectionEnd, tests[currentTest].end,
- "Test " + currentTest + ": autocomplete selection should end at " +
- tests[currentTest].end);
-
- ++currentTest;
-
- if (currentTest < tests.length)
- setTimeout(checkNext, 0);
- else {
- // TODO (bug 494809): Autocomplete-in-the-middle should take in count RTL
- // and complete on VK_RIGHT or VK_LEFT based on that. It should also revert
- // what user has typed to far if he moves in the opposite direction.
- if (autocomplete.value.indexOf(">>") == -1) {
- // Test result if user accepts autocomplete suggestion.
- synthesizeKey("VK_RIGHT", {});
- is(autocomplete.value, "Result",
- "Test complete: autocomplete.value should equal 'Result'");
- is(autocomplete.selectionStart, 6,
- "Test complete: autocomplete selection should start at 6");
- is(autocomplete.selectionEnd, 6,
- "Test complete: autocomplete selection should end at 6");
- }
-
- setTimeout(function() {
- // Unregister the factory so that we don't get in the way of other tests
- componentManager.unregisterFactory(autoCompleteSimpleID, autoCompleteSimple);
- SimpleTest.finish();
- }, 0);
- }
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_autocomplete4.xul b/toolkit/content/tests/chrome/test_autocomplete4.xul
deleted file mode 100644
index 007e95661..000000000
--- a/toolkit/content/tests/chrome/test_autocomplete4.xul
+++ /dev/null
@@ -1,280 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Autocomplete Widget Test 4"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<textbox id="autocomplete"
- type="autocomplete"
- completedefaultindex="true"
-
- onsearchcomplete="searchComplete();"
- autocompletesearch="simple"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-// Set to indicate whether or not we want autoCompleteSimple to return a result
-var returnResult = true;
-
-const ACR = Components.interfaces.nsIAutoCompleteResult;
-
-// This result can't be constructed in-line, because otherwise we leak memory.
-function nsAutoCompleteSimpleResult(aString)
-{
- this.searchString = aString;
- if (returnResult) {
- this.searchResult = ACR.RESULT_SUCCESS;
- this.matchCount = 1;
- this._param = "Result";
- }
-}
-
-nsAutoCompleteSimpleResult.prototype = {
- _param: "",
- searchString: null,
- searchResult: ACR.RESULT_FAILURE,
- defaultIndex: 0,
- errorDescription: null,
- matchCount: 0,
- getValueAt: function() { return this._param; },
- getCommentAt: function() { return null; },
- getStyleAt: function() { return null; },
- getImageAt: function() { return null; },
- getFinalCompleteValueAt: function() { return this.getValueAt(); },
- getLabelAt: function() { return null; },
- removeValueAt: function() {}
-};
-
-// A basic autocomplete implementation that either returns one result or none
-var autoCompleteSimpleID = Components.ID("0a2afbdb-f30e-47d1-9cb1-0cd160240aca");
-var autoCompleteSimpleName = "@mozilla.org/autocomplete/search;1?name=simple"
-var autoCompleteSimple = {
- QueryInterface: function(iid) {
- if (iid.equals(Components.interfaces.nsISupports) ||
- iid.equals(Components.interfaces.nsIFactory) ||
- iid.equals(Components.interfaces.nsIAutoCompleteSearch))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- createInstance: function(outer, iid) {
- return this.QueryInterface(iid);
- },
-
- startSearch: function(aString, aParam, aResult, aListener) {
- var result = new nsAutoCompleteSimpleResult(aString);
- aListener.onSearchResult(this, result);
- },
-
- stopSearch: function() {}
-};
-
-var componentManager = Components.manager
- .QueryInterface(Components.interfaces.nsIComponentRegistrar);
-componentManager.registerFactory(autoCompleteSimpleID, "Test Simple Autocomplete",
- autoCompleteSimpleName, autoCompleteSimple);
-
-
-// Test Bug 325842 - completeDefaultIndex
-
-SimpleTest.waitForExplicitFinish();
-setTimeout(nextTest, 0);
-
-var currentTest = null;
-
-// Note the entries for these tests (key) are incremental.
-const tests = [
- {
- desc: "HOME key remove selection",
- key: "VK_HOME",
- removeSelection: true,
- result: "re",
- start: 0, end: 0
- },
- {
- desc: "LEFT key remove selection",
- key: "VK_LEFT",
- removeSelection: true,
- result: "re",
- start: 1, end: 1
- },
- { desc: "RIGHT key remove selection",
- key: "VK_RIGHT",
- removeSelection: true,
- result: "re",
- start: 2, end: 2
- },
- { desc: "ENTER key remove selection",
- key: "VK_RETURN",
- removeSelection: true,
- result: "re",
- start: 2, end: 2
- },
- {
- desc: "HOME key",
- key: "VK_HOME",
- removeSelection: false,
- result: "Result",
- start: 0, end: 0
- },
- {
- desc: "LEFT key",
- key: "VK_LEFT",
- removeSelection: false,
- result: "Result",
- start: 5, end: 5
- },
- { desc: "RIGHT key",
- key: "VK_RIGHT",
- removeSelection: false,
- result: "Result",
- start: 6, end: 6
- },
- { desc: "RETURN key",
- key: "VK_RETURN",
- removeSelection: false,
- result: "Result",
- start: 6, end: 6
- },
- { desc: "TAB key should confirm suggestion when forcecomplete is set",
- key: "VK_TAB",
- removeSelection: false,
- forceComplete: true,
- result: "Result",
- start: 6, end: 6
- },
-
- { desc: "RIGHT key complete from middle",
- key: "VK_RIGHT",
- forceComplete: true,
- completeFromMiddle: true,
- result: "Result",
- start: 6, end: 6
- },
- {
- desc: "RIGHT key w/ minResultsForPopup=2",
- key: "VK_RIGHT",
- removeSelection: false,
- minResultsForPopup: 2,
- result: "Result",
- start: 6, end: 6
- },
-];
-
-function nextTest() {
- if (!tests.length) {
- // No more tests to run, finish.
- setTimeout(function() {
- // Unregister the factory so that we don't get in the way of other tests
- componentManager.unregisterFactory(autoCompleteSimpleID, autoCompleteSimple);
- SimpleTest.finish();
- }, 0);
- return;
- }
-
- var autocomplete = $("autocomplete");
- autocomplete.value = "";
- currentTest = tests.shift();
-
- // HOME key works differently on Mac, so we skip tests using it.
- if (currentTest.key == "VK_HOME" && navigator.platform.indexOf("Mac") != -1)
- nextTest();
- else
- setTimeout(runCurrentTest, 0);
-}
-
-function runCurrentTest() {
- var autocomplete = $("autocomplete");
- if ("minResultsForPopup" in currentTest)
- autocomplete.setAttribute("minresultsforpopup", currentTest.minResultsForPopup)
- else
- autocomplete.removeAttribute("minresultsforpopup");
-
- autocomplete.focus();
-
- if (!currentTest.completeFromMiddle) {
- synthesizeKey("r", {});
- synthesizeKey("e", {});
- }
- else {
- synthesizeKey("l", {});
- synthesizeKey("t", {});
- }
-}
-
-function searchComplete() {
- var autocomplete = $("autocomplete");
- autocomplete.setAttribute("forcecomplete", currentTest.forceComplete ? true : false);
-
- if (currentTest.completeFromMiddle) {
- if (!currentTest.forceComplete) {
- synthesizeKey(currentTest.key, {});
- }
- else if (!/ >> /.test(autocomplete.value)) {
- // At this point we should have a value like "lt >> Result" showing.
- throw new Error("Expected an middle-completed value, got " + autocomplete.value);
- }
-
- // For forceComplete a blur should cause a value from the results to get
- // completed to. E.g. "lt >> Result" will turn into "Result".
- if (currentTest.forceComplete)
- autocomplete.blur();
-
- checkResult();
- return;
- }
-
- is(autocomplete.value, "result",
- "Test '" + currentTest.desc + "': autocomplete.value should equal 'result'");
-
- if (autocomplete.selectionStart == 2) { // Finished inserting "re" string.
- if (currentTest.removeSelection) {
- // remove current selection
- synthesizeKey("VK_DELETE", {});
- }
-
- synthesizeKey(currentTest.key, {});
-
- checkResult();
- }
-}
-
-function checkResult() {
- var autocomplete = $("autocomplete");
-
- is(autocomplete.value, currentTest.result,
- "Test '" + currentTest.desc + "': autocomplete.value should equal '" +
- currentTest.result + "'");
-
- is(autocomplete.selectionStart, currentTest.start,
- "Test '" + currentTest.desc + "': autocomplete selection should start at " +
- currentTest.start);
-
- is(autocomplete.selectionEnd, currentTest.end,
- "Test '" + currentTest.desc + "': autocomplete selection should end at " +
- currentTest.end);
-
- setTimeout(nextTest, 0);
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_autocomplete5.xul b/toolkit/content/tests/chrome/test_autocomplete5.xul
deleted file mode 100644
index 2f6dc5a30..000000000
--- a/toolkit/content/tests/chrome/test_autocomplete5.xul
+++ /dev/null
@@ -1,152 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Autocomplete Widget Test 5"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<textbox id="autocomplete" type="autocomplete"
- autocompletesearch="simple"
- ontextentered="checkTextEntered();"
- ontextreverted="checkTextReverted();"
- onsearchbegin="checkSearchBegin();"
- onsearchcomplete="checkSearchCompleted();"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-const ACR = Components.interfaces.nsIAutoCompleteResult;
-
-// This result can't be constructed in-line, because otherwise we leak memory.
-function nsAutoCompleteSimpleResult(aString)
-{
- this.searchString = aString;
- this.searchResult = ACR.RESULT_SUCCESS;
- this.matchCount = 1;
- this._param = "SUCCESS";
-}
-
-nsAutoCompleteSimpleResult.prototype = {
- _param: "",
- searchString: null,
- searchResult: ACR.RESULT_FAILURE,
- defaultIndex: -1,
- errorDescription: null,
- matchCount: 0,
- getValueAt: function() { return this._param; },
- getCommentAt: function() { return null; },
- getStyleAt: function() { return null; },
- getImageAt: function() { return null; },
- getFinalCompleteValueAt: function() { return this.getValueAt(); },
- getLabelAt: function() { return null; },
- removeValueAt: function() {}
-};
-
-// A basic autocomplete implementation that either returns one result or none
-var autoCompleteSimpleID = Components.ID("0a2afbdb-f30e-47d1-9cb1-0cd160240aca");
-var autoCompleteSimpleName = "@mozilla.org/autocomplete/search;1?name=simple"
-var autoCompleteSimple = {
- QueryInterface: function(iid) {
- if (iid.equals(Components.interfaces.nsISupports) ||
- iid.equals(Components.interfaces.nsIFactory) ||
- iid.equals(Components.interfaces.nsIAutoCompleteSearch))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- createInstance: function(outer, iid) {
- return this.QueryInterface(iid);
- },
-
- startSearch: function(aString, aParam, aResult, aListener) {
- var result = new nsAutoCompleteSimpleResult(aString);
- aListener.onSearchResult(this, result);
- },
-
- stopSearch: function() {}
-};
-
-var componentManager = Components.manager
- .QueryInterface(Components.interfaces.nsIComponentRegistrar);
-componentManager.registerFactory(autoCompleteSimpleID, "Test Simple Autocomplete",
- autoCompleteSimpleName, autoCompleteSimple);
-
-SimpleTest.waitForExplicitFinish();
-setTimeout(startTest, 0);
-
-function startTest() {
- let autocomplete = $("autocomplete");
-
- // blur the field to ensure that the popup is closed and that the previous
- // search has stopped, then start a new search.
- autocomplete.blur();
- autocomplete.focus();
- synthesizeKey("r", {});
-}
-
-let hasTextEntered = false;
-let hasSearchBegun = false;
-
-function checkSearchBegin() {
- hasSearchBegun = true;
-}
-
-let test = 0;
-function checkSearchCompleted() {
- is(hasSearchBegun, true, "onsearchbegin handler has been correctly called.");
-
- if (test == 0) {
- hasSearchBegun = false;
- synthesizeKey("VK_RETURN", { });
- } else if (test == 1) {
- hasSearchBegun = false;
- synthesizeKey("VK_ESCAPE", { });
- } else {
- throw "checkSearchCompleted should only be called twice.";
- }
-}
-
-function checkTextEntered() {
- is(test, 0, "checkTextEntered should be reached from first test.");
- is(hasSearchBegun, false, "onsearchbegin handler should not be called on text revert.");
-
- // fire second test
- test++;
-
- let autocomplete = $("autocomplete");
- autocomplete.textValue = "";
- autocomplete.blur();
- autocomplete.focus();
- synthesizeKey("r", {});
-}
-
-function checkTextReverted() {
- is(test, 1, "checkTextReverted should be the second test reached.");
- is(hasSearchBegun, false, "onsearchbegin handler should not be called on text revert.");
-
- setTimeout(function() {
- // Unregister the factory so that we don't get in the way of other tests
- componentManager.unregisterFactory(autoCompleteSimpleID, autoCompleteSimple);
- SimpleTest.finish();
- }, 0);
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_autocomplete_delayOnPaste.xul b/toolkit/content/tests/chrome/test_autocomplete_delayOnPaste.xul
deleted file mode 100644
index 19f54ac21..000000000
--- a/toolkit/content/tests/chrome/test_autocomplete_delayOnPaste.xul
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Autocomplete Widget Test 4"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTest();">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
- <script type="application/javascript"
- src="chrome://global/content/globalOverlay.js"/>
-
-<textbox id="autocomplete"
- type="autocomplete"
- completedefaultindex="true"
- onsearchcomplete="searchComplete();"
- timeout="0"
- autocompletesearch="simple"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-function autoCompleteSimpleResult(aString) {
- this.searchString = aString;
- this.searchResult = Components.interfaces.nsIAutoCompleteResult.RESULT_SUCCESS;
- this.matchCount = 1;
- this._param = "Result";
-}
-autoCompleteSimpleResult.prototype = {
- _param: "",
- searchString: null,
- searchResult: Components.interfaces.nsIAutoCompleteResult.RESULT_FAILURE,
- defaultIndex: 0,
- errorDescription: null,
- matchCount: 0,
- getValueAt: function() { return this._param; },
- getCommentAt: function() { return null; },
- getStyleAt: function() { return null; },
- getImageAt: function() { return null; },
- getFinalCompleteValueAt: function() { return this.getValueAt(); },
- getLabelAt: function() { return null; },
- removeValueAt: function() {}
-};
-
-// A basic autocomplete implementation that returns one result.
-let autoCompleteSimple = {
- classID: Components.ID("0a2afbdb-f30e-47d1-9cb1-0cd160240aca"),
- contractID: "@mozilla.org/autocomplete/search;1?name=simple",
- QueryInterface: XPCOMUtils.generateQI([
- Components.interfaces.nsIFactory,
- Components.interfaces.nsIAutoCompleteSearch
- ]),
- createInstance: function (outer, iid) {
- return this.QueryInterface(iid);
- },
-
- registerFactory: function () {
- let registrar =
- Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
- registrar.registerFactory(this.classID, "Test Simple Autocomplete",
- this.contractID, this);
- },
- unregisterFactory: function () {
- let registrar =
- Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
- registrar.unregisterFactory(this.classID, this);
- },
-
- startSearch: function (aString, aParam, aResult, aListener) {
- let result = new autoCompleteSimpleResult(aString);
- aListener.onSearchResult(this, result);
- },
- stopSearch: function () {}
-};
-
-SimpleTest.waitForExplicitFinish();
-
-// XPFE AutoComplete needs to register early.
-autoCompleteSimple.registerFactory();
-
-let gACTimer;
-let gAutoComplete;
-
-function searchComplete() {
- is(gAutoComplete.value, "result", "Value should be autocompleted now");
- ok(Date.now() - gACTimer > 500, "There should be a delay before autocomplete");
-
- // Unregister the factory so that we don't get in the way of other tests
- autoCompleteSimple.unregisterFactory();
- SimpleTest.finish();
-}
-
-function runTest() {
- gAutoComplete = $("autocomplete");
-
- const SEARCH_STRING = "res";
-
- function cbCallback() {
- gAutoComplete.focus();
- synthesizeKey("v", { accelKey: true });
- is(gAutoComplete.value, SEARCH_STRING, "Value should not be autocompleted immediately");
- }
-
- SimpleTest.waitForClipboard(SEARCH_STRING, function () {
- gACTimer = Date.now();
- Components.classes["@mozilla.org/widget/clipboardhelper;1"]
- .getService(Components.interfaces.nsIClipboardHelper)
- .copyStringToClipboard(SEARCH_STRING, Components.interfaces.nsIClipboard.kGlobalClipboard);
- }, cbCallback, cbCallback);
-}
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_autocomplete_emphasis.xul b/toolkit/content/tests/chrome/test_autocomplete_emphasis.xul
deleted file mode 100644
index b162742f1..000000000
--- a/toolkit/content/tests/chrome/test_autocomplete_emphasis.xul
+++ /dev/null
@@ -1,175 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Autocomplete emphasis test"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<textbox id="richautocomplete" type="autocomplete"
- autocompletesearch="simple"
- onsearchcomplete="checkSearchCompleted();"
- autocompletepopup="richpopup"/>
-<panel id="richpopup" type="autocomplete-richlistbox" noautofocus="true"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-const ACR = Components.interfaces.nsIAutoCompleteResult;
-
-// A global variable to hold the search result for the current search.
-var resultText = "";
-
-// This result can't be constructed in-line, because otherwise we leak memory.
-function nsAutoCompleteSimpleResult(aString)
-{
- this.searchString = aString;
- this.searchResult = ACR.RESULT_SUCCESS;
- this.matchCount = 1;
-}
-
-nsAutoCompleteSimpleResult.prototype = {
- searchString: null,
- searchResult: ACR.RESULT_FAILURE,
- defaultIndex: -1,
- errorDescription: null,
- matchCount: 0,
- getValueAt: function() { return resultText; },
- getCommentAt: function() { return this.getValueAt(); },
- getStyleAt: function() { return null; },
- getImageAt: function() { return null; },
- getFinalCompleteValueAt: function() { return this.getValueAt(); },
- getLabelAt: function() { return this.getValueAt(); },
- removeValueAt: function() {}
-};
-
-// A basic autocomplete implementation that returns the string contained in 'resultText'.
-var autoCompleteSimpleID = Components.ID("0a2afbdb-f30e-47d1-9cb1-0cd160240aca");
-var autoCompleteSimpleName = "@mozilla.org/autocomplete/search;1?name=simple"
-var autoCompleteSimple = {
- QueryInterface: function(iid) {
- if (iid.equals(Components.interfaces.nsISupports) ||
- iid.equals(Components.interfaces.nsIFactory) ||
- iid.equals(Components.interfaces.nsIAutoCompleteSearch))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- createInstance: function(outer, iid) {
- return this.QueryInterface(iid);
- },
-
- startSearch: function(aString, aParam, aResult, aListener) {
- var result = new nsAutoCompleteSimpleResult(aString);
- aListener.onSearchResult(this, result);
- },
-
- stopSearch: function() {}
-};
-
-var componentManager = Components.manager
- .QueryInterface(Components.interfaces.nsIComponentRegistrar);
-componentManager.registerFactory(autoCompleteSimpleID, "Test Simple Autocomplete",
- autoCompleteSimpleName, autoCompleteSimple);
-
-SimpleTest.waitForExplicitFinish();
-setTimeout(nextTest, 0);
-
-/* Test cases have the following attributes:
- * - search: A search string, to be emphasized in the result.
- * - result: A fixed result string, so we can hardcode the expected emphasis.
- * - emphasis: A list of chunks that should be emphasized or not, in strict alternation.
- * - emphasizeFirst: Whether the first element of 'emphasis' should be emphasized;
- * The emphasis of the other elements is defined by the strict alternation rule.
- */
-let testcases = [
- { search: "test",
- result: "A test string",
- emphasis: ["A ", "test", " string"],
- emphasizeFirst: false
- },
- { search: "tea two",
- result: "Tea for two, and two for tea...",
- emphasis: ["Tea", " for ", "two", ", and ", "two", " for ", "tea", "..."],
- emphasizeFirst: true
- },
- { search: "tat",
- result: "tatatat",
- emphasis: ["tatatat"],
- emphasizeFirst: true
- },
- { search: "cheval valise",
- result: "chevalise",
- emphasis: ["chevalise"],
- emphasizeFirst: true
- }
-];
-let test = -1;
-let currentTest = null;
-
-function nextTest() {
- test++;
-
- if (test >= testcases.length) {
- // Unregister the factory so that we don't get in the way of other tests
- componentManager.unregisterFactory(autoCompleteSimpleID, autoCompleteSimple);
- SimpleTest.finish();
- return;
- }
-
- // blur the field to ensure that the popup is closed and that the previous
- // search has stopped, then start a new search.
- let autocomplete = $("richautocomplete");
- autocomplete.blur();
- autocomplete.focus();
-
- currentTest = testcases[test];
- resultText = currentTest.result;
- autocomplete.value = currentTest.search;
- synthesizeKey("VK_DOWN", {});
-}
-
-function checkSearchCompleted() {
- let autocomplete = $("richautocomplete");
- let result = autocomplete.popup.richlistbox.firstChild;
-
- for (let attribute of [result._titleText, result._urlText]) {
- is(attribute.childNodes.length, currentTest.emphasis.length,
- "The element should have the expected number of children.");
- for (let i = 0; i < currentTest.emphasis.length; i++) {
- let node = attribute.childNodes[i];
- // Emphasized parts strictly alternate.
- if ((i % 2 == 0) == currentTest.emphasizeFirst) {
- // Check that this part is correctly emphasized.
- is(node.nodeName, "span", ". That child should be a span node");
- ok(node.classList.contains("ac-emphasize-text"), ". That child should be emphasized");
- is(node.textContent, currentTest.emphasis[i], ". That emphasis should be as expected.");
- } else {
- // Check that this part is _not_ emphasized.
- is(node.nodeName, "#text", ". That child should be a text node");
- is(node.textContent, currentTest.emphasis[i], ". That text should be as expected.");
- }
- }
- }
-
- setTimeout(nextTest, 0);
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xul b/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xul
deleted file mode 100644
index 21670215d..000000000
--- a/toolkit/content/tests/chrome/test_autocomplete_mac_caret.xul
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Autocomplete Widget Test"
- onload="setTimeout(keyCaretTest, 0);"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<textbox id="autocomplete" type="autocomplete"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function keyCaretTest()
-{
- var autocomplete = $("autocomplete");
-
- autocomplete.focus();
- checkKeyCaretTest("VK_UP", 0, 0, false, "no value up");
- checkKeyCaretTest("VK_DOWN", 0, 0, false, "no value down");
-
- autocomplete.value = "Sample";
-
- autocomplete.selectionStart = 3;
- autocomplete.selectionEnd = 3;
- checkKeyCaretTest("VK_UP", 0, 0, true, "value up with caret in middle");
- checkKeyCaretTest("VK_UP", 0, 0, false, "value up with caret in middle again");
-
- autocomplete.selectionStart = 2;
- autocomplete.selectionEnd = 2;
- checkKeyCaretTest("VK_DOWN", 6, 6, true, "value down with caret in middle");
- checkKeyCaretTest("VK_DOWN", 6, 6, false, "value down with caret in middle again");
-
- autocomplete.selectionStart = 1;
- autocomplete.selectionEnd = 4;
- checkKeyCaretTest("VK_UP", 0, 0, true, "value up with selection");
-
- autocomplete.selectionStart = 1;
- autocomplete.selectionEnd = 4;
- checkKeyCaretTest("VK_DOWN", 6, 6, true, "value down with selection");
-
- SimpleTest.finish();
-}
-
-function checkKeyCaretTest(key, expectedStart, expectedEnd, result, testid)
-{
- var autocomplete = $("autocomplete");
-
- var event = result ? "keypress" : "!keypress";
- synthesizeKeyExpectEvent(key, { }, autocomplete.inputField, event, testid);
- is(autocomplete.selectionStart, expectedStart, testid + " selectionStart");
- is(autocomplete.selectionEnd, expectedEnd, testid + " selectionEnd");
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_autocomplete_placehold_last_complete.xul b/toolkit/content/tests/chrome/test_autocomplete_placehold_last_complete.xul
deleted file mode 100644
index 01004327d..000000000
--- a/toolkit/content/tests/chrome/test_autocomplete_placehold_last_complete.xul
+++ /dev/null
@@ -1,309 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Autocomplete Widget Test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTest();">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
- <script type="application/javascript"
- src="chrome://global/content/globalOverlay.js"/>
-
-<textbox id="autocomplete"
- type="autocomplete"
- completedefaultindex="true"
- timeout="0"
- autocompletesearch="simple"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-function autoCompleteSimpleResult(aString, searchId) {
- this.searchString = aString;
- this.searchResult = Components.interfaces.nsIAutoCompleteResult.RESULT_SUCCESS;
- this.matchCount = 1;
- if (aString.startsWith('ret')) {
- this._param = autoCompleteSimpleResult.retireCompletion;
- } else {
- this._param = "Result";
- }
- this._searchId = searchId;
-}
-autoCompleteSimpleResult.retireCompletion = "Retire";
-autoCompleteSimpleResult.prototype = {
- _param: "",
- searchString: null,
- searchResult: Components.interfaces.nsIAutoCompleteResult.RESULT_FAILURE,
- defaultIndex: 0,
- errorDescription: null,
- matchCount: 0,
- getValueAt: function() { return this._param; },
- getCommentAt: function() { return null; },
- getStyleAt: function() { return null; },
- getImageAt: function() { return null; },
- getLabelAt: function() { return null; },
- removeValueAt: function() {}
-};
-
-var searchCounter = 0;
-
-// A basic autocomplete implementation that returns one result.
-let autoCompleteSimple = {
- classID: Components.ID("0a2afbdb-f30e-47d1-9cb1-0cd160240aca"),
- contractID: "@mozilla.org/autocomplete/search;1?name=simple",
- searchAsync: false,
- pendingSearch: null,
-
- QueryInterface: XPCOMUtils.generateQI([
- Components.interfaces.nsIFactory,
- Components.interfaces.nsIAutoCompleteSearch
- ]),
- createInstance: function (outer, iid) {
- return this.QueryInterface(iid);
- },
-
- registerFactory: function () {
- let registrar =
- Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
- registrar.registerFactory(this.classID, "Test Simple Autocomplete",
- this.contractID, this);
- },
- unregisterFactory: function () {
- let registrar =
- Components.manager.QueryInterface(Components.interfaces.nsIComponentRegistrar);
- registrar.unregisterFactory(this.classID, this);
- },
-
- startSearch: function (aString, aParam, aResult, aListener) {
- let result = new autoCompleteSimpleResult(aString);
-
- if (this.searchAsync) {
- // Simulate an async search by using a timeout before invoking the
- // |onSearchResult| callback.
- // Store the searchTimeout such that it can be canceled if stopSearch is called.
- this.pendingSearch = setTimeout(() => {
- this.pendingSearch = null;
-
- aListener.onSearchResult(this, result);
-
- // Move to the next step in the async test.
- asyncTest.next();
- }, 0);
- } else {
- aListener.onSearchResult(this, result);
- }
- },
- stopSearch: function () {
- clearTimeout(this.pendingSearch);
- }
-};
-
-SimpleTest.waitForExplicitFinish();
-
-// XPFE AutoComplete needs to register early.
-autoCompleteSimple.registerFactory();
-
-let gACTimer;
-let gAutoComplete;
-let asyncTest;
-
-let searchCompleteTimeoutId = null;
-
-function finishTest() {
- // Unregister the factory so that we don't get in the way of other tests
- autoCompleteSimple.unregisterFactory();
- SimpleTest.finish();
-}
-
-function runTest() {
- gAutoComplete = $("autocomplete");
- gAutoComplete.focus();
-
- // Return the search results synchronous, which also makes the completion
- // happen synchronous.
- autoCompleteSimple.searchAsync = false;
-
- synthesizeKey("r", {});
- is(gAutoComplete.value, "result", "Value should be autocompleted immediately");
-
- synthesizeKey("e", {});
- is(gAutoComplete.value, "result", "Value should be autocompleted immediately");
-
- synthesizeKey("VK_DELETE", {});
- is(gAutoComplete.value, "re", "Deletion should not complete value");
-
- synthesizeKey("VK_BACK_SPACE", {});
- is(gAutoComplete.value, "r", "Backspace should not complete value");
-
- synthesizeKey("VK_LEFT", {});
- is(gAutoComplete.value, "r", "Value should stay same when navigating with cursor");
-
- runAsyncTest();
-}
-
-function* asyncTestGenerator() {
- synthesizeKey("r", {});
- synthesizeKey("e", {});
- is(gAutoComplete.value, "re", "Value should not be autocompleted immediately");
-
- // Calling |yield undefined| makes this generator function wait until
- // |asyncTest.next();| is called. This happens from within the
- // |autoCompleteSimple.startSearch()| function once the simulated async
- // search has finished.
- // Therefore, the effect of the |yield undefined;| here (and the ones) below
- // is to wait until the async search result comes back.
- yield undefined;
-
- is(gAutoComplete.value, "result", "Value should be autocompleted");
-
- // Test if typing the `s` character completes directly based on the last
- // completion
- synthesizeKey("s", {});
- is(gAutoComplete.value, "result", "Value should be completed immediately");
-
- yield undefined;
-
- is(gAutoComplete.value, "result", "Value should be autocompleted to same value");
- synthesizeKey("VK_DELETE", {});
- is(gAutoComplete.value, "res", "Deletion should not complete value");
-
- // No |yield undefined| needed here as no completion is triggered by the deletion.
-
- is(gAutoComplete.value, "res", "Still no complete value after deletion");
-
- synthesizeKey("VK_BACK_SPACE", {});
- is(gAutoComplete.value, "re", "Backspace should not complete value");
-
- yield undefined;
-
- is(gAutoComplete.value, "re", "Value after search due to backspace should stay the same"); (3)
-
- // Typing a character that is not like the previous match. In this case, the
- // completion cannot happen directly and therefore the value will be completed
- // only after the search has finished.
- synthesizeKey("t", {});
- is(gAutoComplete.value, "ret", "Value should not be autocompleted immediately");
-
- yield undefined;
-
- is(gAutoComplete.value, "retire", "Value should be autocompleted");
-
- synthesizeKey("i", {});
- is(gAutoComplete.value, "retire", "Value should be autocompleted immediately");
-
- yield undefined;
-
- is(gAutoComplete.value, "retire", "Value should be autocompleted to the same value");
-
- // Setup the scene to test how the completion behaves once the placeholder
- // completion and the result from the search do not agree with each other.
- gAutoComplete.value = 'r';
- // Need to type two characters as the input was reset and the autocomplete
- // controller things, ther user hit the backspace button, in which case
- // no completion is performed. But as a completion is desired, another
- // character `t` is typed afterwards.
- synthesizeKey("e", {});
- yield undefined;
- synthesizeKey("t", {});
- is(gAutoComplete.value, "ret", "Value should not be autocompleted");
-
- yield undefined;
-
- is(gAutoComplete.value, "retire", "Value should be autocompleted");
-
- // The placeholder string is now set to "retire". Changing the completion
- // string to "retirement" and see what the completion will turn out like.
- autoCompleteSimpleResult.retireCompletion = "Retirement";
- synthesizeKey("i", {});
- is(gAutoComplete.value, "retire", "Value should be autocompleted based on placeholder");
-
- yield undefined;
-
- is(gAutoComplete.value, "retirement", "Value should be autocompleted based on search result");
-
- // Change the search result to `Retire` again and see if the new result is
- // complited.
- autoCompleteSimpleResult.retireCompletion = "Retire";
- synthesizeKey("r", {});
- is(gAutoComplete.value, "retirement", "Value should be autocompleted based on placeholder");
-
- yield undefined;
-
- is(gAutoComplete.value, "retire", "Value should be autocompleted based on search result");
-
- // Complete the value
- gAutoComplete.value = 're';
- synthesizeKey("t", {});
- yield undefined;
- synthesizeKey("i", {});
- is(gAutoComplete.value, "reti", "Value should not be autocompleted");
-
- yield undefined;
-
- is(gAutoComplete.value, "retire", "Value should be autocompleted");
-
- // Remove the selected text "re" (1) and the "et" (2). Afterwards, add it again (3).
- // This should not cause the completion to kick in.
- synthesizeKey("VK_DELETE", {}); // (1)
-
- is(gAutoComplete.value, "reti", "Value should not complete after deletion");
-
- gAutoComplete.selectionStart = 1;
- gAutoComplete.selectionEnd = 3;
- synthesizeKey("VK_DELETE", {}); // (2)
-
- is(gAutoComplete.value, "ri", "Value should stay unchanged after removing character in the middle");
-
- yield undefined;
-
- synthesizeKey("e", {}); // (3.1)
- is(gAutoComplete.value, "rei", "Inserting a character in the middle should not complete the value");
-
- yield undefined;
-
- synthesizeKey("t", {}); // (3.2)
- is(gAutoComplete.value, "reti", "Inserting a character in the middle should not complete the value");
-
- yield undefined;
-
- // Adding a new character at the end should not cause the completion to happen again
- // as the completion failed before.
- gAutoComplete.selectionStart = 4;
- gAutoComplete.selectionEnd = 4;
- synthesizeKey("r", {});
- is(gAutoComplete.value, "retir", "Value should not be autocompleted immediately");
-
- yield undefined;
-
- is(gAutoComplete.value, "retire", "Value should be autocompleted");
-
- finishTest();
- yield undefined;
-}
-
-function runAsyncTest() {
- gAutoComplete.value = '';
- autoCompleteSimple.searchAsync = true;
-
- asyncTest = asyncTestGenerator();
- asyncTest.next();
-}
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html b/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html
deleted file mode 100644
index 3f57a0d6e..000000000
--- a/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_input.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>autocomplete with composition tests on HTML input element</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="file_autocomplete_with_composition.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content">
- <iframe id="formTarget" name="formTarget"></iframe>
- <form action="data:text/html," target="formTarget">
- <input name="test" id="input"><input type="submit">
- </form>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-SimpleTest.waitForExplicitFinish();
-
-function runTests()
-{
- var formFillController =
- SpecialPowers.getFormFillController()
- .QueryInterface(Components.interfaces.nsIAutoCompleteInput);
- var originalFormFillTimeout = formFillController.timeout;
-
- SpecialPowers.attachFormFillControllerTo(window);
- var target = document.getElementById("input");
-
- // Register a word to the form history.
- target.focus();
- target.value = "Mozilla";
- synthesizeKey("VK_RETURN", {});
- target.value = "";
-
- var test1 = new nsDoTestsForAutoCompleteWithComposition(
- "Testing on HTML input (asynchronously search)",
- window, target, formFillController.controller, is,
- function () { return target.value; },
- function () {
- target.setAttribute("timeout", 0);
- var test2 = new nsDoTestsForAutoCompleteWithComposition(
- "Testing on HTML input (synchronously search)",
- window, target, formFillController.controller, is,
- function () { return target.value; },
- function () {
- formFillController.timeout = originalFormFillTimeout;
- SpecialPowers.detachFormFillControllerFrom(window);
- SimpleTest.finish();
- });
- });
-}
-
-SimpleTest.waitForFocus(runTests);
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_textbox.xul b/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_textbox.xul
deleted file mode 100644
index 90972b8da..000000000
--- a/toolkit/content/tests/chrome/test_autocomplete_with_composition_on_textbox.xul
+++ /dev/null
@@ -1,124 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Testing autocomplete with composition"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
- <script type="text/javascript"
- src="file_autocomplete_with_composition.js" />
-
- <textbox id="textbox" type="autocomplete"
- autocompletesearch="simpleForComposition"/>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-const nsIAutoCompleteResult = Components.interfaces.nsIAutoCompleteResult;
-
-// This result can't be constructed in-line, because otherwise we leak memory.
-function nsAutoCompleteSimpleResult(aString)
-{
- this.searchString = aString;
- if (aString == "" || aString == "Mozilla".substr(0, aString.length)) {
- this.searchResult = nsIAutoCompleteResult.RESULT_SUCCESS;
- this.matchCount = 1;
- this._value = "Mozilla";
- } else {
- this.searchResult = nsIAutoCompleteResult.RESULT_NOMATCH;
- this.matchCount = 0;
- this._value = "";
- }
-}
-
-nsAutoCompleteSimpleResult.prototype = {
- _value: "",
- searchString: null,
- searchResult: nsIAutoCompleteResult.RESULT_FAILURE,
- defaultIndex: 0,
- errorDescription: null,
- matchCount: 0,
- getValueAt: function(aIndex) { return aIndex == 0 ? this._value : null; },
- getCommentAt: function() { return null; },
- getStyleAt: function() { return null; },
- getImageAt: function() { return null; },
- getFinalCompleteValueAt: function(aIndex) { return this.getValueAt(aIndex); },
- getLabelAt: function() { return null; },
- removeValueAt: function() {}
-};
-
-// A basic autocomplete implementation that either returns one result or none
-var autoCompleteSimpleID =
- Components.ID("0a2afbdb-f30e-47d1-9cb1-0cd160240aca");
-var autoCompleteSimpleName =
- "@mozilla.org/autocomplete/search;1?name=simpleForComposition"
-var autoCompleteSimple = {
- QueryInterface: function(iid) {
- if (iid.equals(Components.interfaces.nsISupports) ||
- iid.equals(Components.interfaces.nsIFactory) ||
- iid.equals(Components.interfaces.nsIAutoCompleteSearch))
- return this;
-
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
-
- createInstance: function(outer, iid) {
- return this.QueryInterface(iid);
- },
-
- startSearch: function(aString, aParam, aResult, aListener) {
- var result = new nsAutoCompleteSimpleResult(aString);
- aListener.onSearchResult(this, result);
- },
-
- stopSearch: function() {}
-};
-
-var componentManager =
- Components.manager
- .QueryInterface(Components.interfaces.nsIComponentRegistrar);
-componentManager.registerFactory(autoCompleteSimpleID,
- "Test Simple Autocomplete for composition",
- autoCompleteSimpleName, autoCompleteSimple);
-
-function runTests()
-{
- var target = document.getElementById("textbox");
- target.setAttribute("timeout", 1);
- var test1 = new nsDoTestsForAutoCompleteWithComposition(
- "Testing on XUL textbox (asynchronously search)",
- window, target, target.controller, is,
- function () { return target.value; },
- function () {
- target.setAttribute("timeout", 0);
- var test2 = new nsDoTestsForAutoCompleteWithComposition(
- "Testing on XUL textbox (synchronously search)",
- window, target, target.controller, is,
- function () { return target.value; },
- function () {
- // Unregister the factory so that we don't get in the way of other
- // tests
- componentManager.unregisterFactory(autoCompleteSimpleID,
- autoCompleteSimple);
- SimpleTest.finish();
- });
- });
-}
-
-SimpleTest.waitForFocus(runTests);
-]]>
-</script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_browser_drop.xul b/toolkit/content/tests/chrome/test_browser_drop.xul
deleted file mode 100644
index 4ba21c514..000000000
--- a/toolkit/content/tests/chrome/test_browser_drop.xul
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Browser Drop Test"
- onload="setTimeout(runTest, 0);"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SpawnTask.js"/>
-
- <script><![CDATA[
-SimpleTest.waitForExplicitFinish();
-function runTest() {
- add_task(function*() {
- let win = window.open("window_browser_drop.xul", "_blank", "chrome,width=200,height=200");
- yield SimpleTest.promiseFocus(win);
- for (let browserType of ["content", "remote-content"]) {
- yield win.dropLinksOnBrowser(win.document.getElementById(browserType + "child"), browserType);
- }
- yield win.dropLinksOnBrowser(win.document.getElementById("chromechild"), "chrome");
- });
-}
-//]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug1048178.xul b/toolkit/content/tests/chrome/test_bug1048178.xul
deleted file mode 100644
index 79f3acad5..000000000
--- a/toolkit/content/tests/chrome/test_bug1048178.xul
+++ /dev/null
@@ -1,86 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1048178
--->
-<window title="Mozilla Bug 1048178"
- 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="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml"/>
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1048178"
- target="_blank">Mozilla Bug 1048178</a>
-
- <hbox>
- <scrollbar id="scroller"
- orient="horizontal"
- curpos="0"
- maxpos="500"
- pageincrement="500"
- width="500"
- style="margin:0"/>
- </hbox>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-/** Test for Bug 1048178 **/
-var scrollbarTester = {
- scrollbar: null,
- startTest: function() {
- this.scrollbar = $("scroller");
- this.setScrollToClick(false);
- this.testThumbDragging();
- SimpleTest.finish();
- },
- testThumbDragging: function() {
- var x = 400; // on the right half of the scroolbar
- var y = 5;
-
- this.mousedown(x, y, 0);
- this.mousedown(x, y, 2);
- this.mouseup(x, y, 2);
- this.mouseup(x, y, 0);
-
- var newPos = this.getPos(); // sould be '500'
-
- this.mousedown(x, y, 0);
- this.mousemove(x-1, y, 0);
- this.mouseup(x-1, y, 0);
-
- var newPos2 = this.getPos();
- ok(newPos2 < newPos,
- "Scrollbar thumb should follow the mouse when dragged.");
- },
- setScrollToClick: function(value) {
- var prefService = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefService);
- var uiBranch = prefService.getBranch("ui.");
- uiBranch.setIntPref("scrollToClick", value ? 1 : 0);
- },
- getPos: function() {
- return this.scrollbar.getAttribute("curpos");
- },
- mousedown: function(x, y, button) {
- synthesizeMouse(this.scrollbar, x, y, { type: "mousedown", 'button': button });
- },
- mousemove: function(x, y, button) {
- synthesizeMouse(this.scrollbar, x, y, { type: "mousemove", 'button': button });
- },
- mouseup: function(x, y, button) {
- synthesizeMouse(this.scrollbar, x, y, { type: "mouseup", 'button': button });
- }
-}
-
-function doTest() {
- setTimeout(function() { scrollbarTester.startTest(); }, 0);
-}
-
-SimpleTest.waitForExplicitFinish();
-addLoadEvent(doTest);
-
-]]></script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug253481.xul b/toolkit/content/tests/chrome/test_bug253481.xul
deleted file mode 100644
index aa5c017c6..000000000
--- a/toolkit/content/tests/chrome/test_bug253481.xul
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=253481
--->
-<window title="Mozilla Bug 253481"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=253481">Mozilla Bug 253481</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-</body>
-
-<description>
- Tests pasting of multi-line content into a single-line xul:textbox.
-</description>
-
-<vbox>
-<textbox id="pasteintact" newlines="pasteintact"/>
-<textbox id="pastetofirst" newlines="pastetofirst"/>
-<textbox id="replacewithspaces" newlines="replacewithspaces"/>
-<textbox id="strip" newlines="strip"/>
-<textbox id="replacewithcommas" newlines="replacewithcommas"/>
-<textbox id="stripsurroundingwhitespace" newlines="stripsurroundingwhitespace"/>
-</vbox>
-<script class="testbody" type="application/javascript;version=1.7">
-<![CDATA[
-/** Test for Bug 253481 **/
-function testPaste(name, element, expected) {
- element.value = "";
- element.focus();
- synthesizeKey("v", { accelKey: true });
- is(element.value, expected, name);
-}
-
-SimpleTest.waitForExplicitFinish();
-
-SimpleTest.waitForFocus(function() {
-setTimeout(function() {
-var testString = "\n hello hello \n world\nworld \n";
-var expectedResults = {
-// even "pasteintact" strips leading/trailing newlines
-"pasteintact": testString.replace(/^\n/, '').replace(/\n$/, ''),
-// "pastetofirst" strips leading newlines
-"pastetofirst": testString.replace(/^\n/, '').split(/\n/)[0],
-// "replacewithspaces" strips trailing newlines first - bug 432415
-"replacewithspaces": testString.replace(/\n$/, '').replace(/\n/g,' '),
-// "strip" is pretty straightforward
-"strip": testString.replace(/\n/g,''),
-// "replacewithcommas" strips leading and trailing newlines first
-"replacewithcommas": testString.replace(/^\n/, '').replace(/\n$/, '').replace(/\n/g,','),
-// "stripsurroundingwhitespace" strips all newlines and whitespace around them
-"stripsurroundingwhitespace": testString.replace(/\s*\n\s*/g,'')
-};
-
-// Put a multi-line string in the clipboard
-SimpleTest.waitForClipboard(testString, function() {
- var clip = Components.classes["@mozilla.org/widget/clipboardhelper;1"]
- .getService(Components.interfaces.nsIClipboardHelper);
- clip.copyString(testString);
-}, function() {
- for (let [item, expected] of Object.entries(expectedResults)) {
- testPaste(item, $(item), expected);
- }
-
- SimpleTest.finish();
-}, function() {
- ok(false, "Could not copy the string to clipboard, giving up");
-
- SimpleTest.finish();
-});
-}, 0);
-});
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug263683.xul b/toolkit/content/tests/chrome/test_bug263683.xul
deleted file mode 100644
index c5755c9f1..000000000
--- a/toolkit/content/tests/chrome/test_bug263683.xul
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=263683
--->
-<window title="Mozilla Bug 263683"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=263683">
- Mozilla Bug 263683
- </a>
-
- <p id="display"></p>
- <div id="content" style="display: none">
- </div>
- <pre id="test">
- </pre>
- </body>
-
- <script class="testbody" type="application/javascript">
- <![CDATA[
-
- /** Test for Bug 263683 **/
- SimpleTest.waitForExplicitFinish();
- window.open("bug263683_window.xul", "263683test",
- "chrome,width=600,height=600");
-
- ]]>
- </script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug304188.xul b/toolkit/content/tests/chrome/test_bug304188.xul
deleted file mode 100644
index f41d24f9b..000000000
--- a/toolkit/content/tests/chrome/test_bug304188.xul
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=304188
--->
-<window title="Mozilla Bug 304188"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=304188">Mozilla Bug 304188</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 304188 **/
-SimpleTest.waitForExplicitFinish();
-window.open("bug304188_window.xul", "findbartest",
- "chrome,width=600,height=600");
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug331215.xul b/toolkit/content/tests/chrome/test_bug331215.xul
deleted file mode 100644
index e0d0d1e0a..000000000
--- a/toolkit/content/tests/chrome/test_bug331215.xul
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=331215
--->
-<window title="Mozilla Bug 331215"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=331215">Mozilla Bug 331215</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 331215 **/
-
-SimpleTest.waitForExplicitFinish();
-window.open("bug331215_window.xul", "331215test",
- "chrome,width=600,height=600");
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug360220.xul b/toolkit/content/tests/chrome/test_bug360220.xul
deleted file mode 100644
index 3fcb2bf13..000000000
--- a/toolkit/content/tests/chrome/test_bug360220.xul
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=360220
--->
-<window title="Mozilla Bug 360220"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=360220">Mozilla Bug 360220</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<menulist id="menulist">
- <menupopup>
- <menuitem id="firstItem" label="foo" selected="true"/>
- <menuitem id="secondItem" label="bar"/>
- </menupopup>
-</menulist>
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-/** Test for Bug 360220 **/
-
-var menulist = document.getElementById("menulist");
-var secondItem = document.getElementById("secondItem");
-menulist.selectedItem = secondItem;
-
-is(menulist.label, "bar", "second item was not selected");
-
-let mutObserver = new MutationObserver(() => {
- is(menulist.label, "new label", "menulist label was not updated to the label of its selected item");
- done();
-});
-mutObserver.observe(menulist, { attributeFilter: ['label'] });
-secondItem.label = "new label";
-
-let failureTimeout = setTimeout(function() {
- ok(false, "menulist label should have updated");
- done();
-}, 2000);
-
-function done() {
- mutObserver.disconnect();
- clearTimeout(failureTimeout);
- SimpleTest.finish();
-}
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug360437.xul b/toolkit/content/tests/chrome/test_bug360437.xul
deleted file mode 100644
index eb17adcf5..000000000
--- a/toolkit/content/tests/chrome/test_bug360437.xul
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=360437
--->
-<window title="Mozilla Bug 360437"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=360437">Mozilla Bug 360437</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 360437 **/
-SimpleTest.waitForExplicitFinish();
-window.open("bug360437_window.xul", "360437test",
- "chrome,width=600,height=600");
-
-
-
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug365773.xul b/toolkit/content/tests/chrome/test_bug365773.xul
deleted file mode 100644
index 17385365a..000000000
--- a/toolkit/content/tests/chrome/test_bug365773.xul
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=365773
--->
-<window title="Mozilla Bug 365773"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=365773">Mozilla Bug 365773</a>
-<p id="display">
- <radiogroup id="group" collapsed="true" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <radio id="item" label="Item"/>
- </radiogroup>
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 365773 **/
-
-function selectItem(item, isIndex, testName) {
- var exception = null;
- try {
- if (isIndex)
- document.getElementById("group").selectedIndex = item;
- else
- document.getElementById("group").selectedItem = item;
- }
- catch(e) {
- exception = e;
- }
-
- ok(exception == null, testName);
-}
-
-SimpleTest.waitForExplicitFinish();
-
-window.onload = function runTests() {
- var item = document.getElementById("item");
-
- selectItem(item, false, "Radio button selected with selectedItem (not focused)");
- selectItem(null, false, "Radio button deselected with selectedItem (not focused)");
- selectItem(0, true, "Radio button selected with selectedIndex (not focused)");
- selectItem(-1, true, "Radio button deselected with selectedIndex (not focused)");
-
- document.getElementById("group").focus();
-
- selectItem(item, false, "Radio button selected with selectedItem (focused)");
- selectItem(null, false, "Radio button deselected with selectedItem (focused)");
- selectItem(0, true, "Radio button selected with selectedIndex (focused)");
- selectItem(-1, true, "Radio button deselected with selectedIndex (focused)");
-
- SimpleTest.finish();
-};
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug366992.xul b/toolkit/content/tests/chrome/test_bug366992.xul
deleted file mode 100644
index 2c92defc5..000000000
--- a/toolkit/content/tests/chrome/test_bug366992.xul
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=366992
--->
-<window title="Mozilla Bug 366992"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=366992">Mozilla Bug 366992</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 366992 **/
-SimpleTest.waitForExplicitFinish();
-window.open("bug366992_window.xul", "findbartest",
- "chrome,width=600,height=600");
-
-
-
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug382990.xul b/toolkit/content/tests/chrome/test_bug382990.xul
deleted file mode 100644
index aa3b00431..000000000
--- a/toolkit/content/tests/chrome/test_bug382990.xul
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=382990
--->
-<window title="Mozilla Bug 382990"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="startThisTest()">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=382990"
- target="_blank">Mozilla Bug 382990</a>
- </body>
-
- <tree id="testTree" height="200px">
- <treecols>
- <treecol flex="1" label="Name" id="name"/>
- </treecols>
- <treechildren>
- <treeitem><treerow><treecell label="a"/></treerow></treeitem>
- <treeitem><treerow><treecell label="z"/></treerow></treeitem>
- </treechildren>
- </tree>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
- /** Test for Bug 382990 **/
-
- SimpleTest.waitForExplicitFinish();
- function startThisTest()
- {
- var treeElem = document.getElementById("testTree");
- treeElem.view.selection.select(0);
- treeElem.focus();
- synthesizeKey("z", {ctrlKey: true});
- ok(!treeElem.view.selection.isSelected(1), "Tree selection should not change for key events with ctrl pressed.");
- SimpleTest.finish();
- }
- ]]></script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug409624.xul b/toolkit/content/tests/chrome/test_bug409624.xul
deleted file mode 100644
index 59a862cad..000000000
--- a/toolkit/content/tests/chrome/test_bug409624.xul
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=409624
--->
-<window title="Mozilla Bug 409624"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=409624">
- Mozilla Bug 409624
- </a>
-
- <p id="display"></p>
- <div id="content" style="display: none">
- </div>
- <pre id="test">
- </pre>
- </body>
-
- <script class="testbody" type="application/javascript">
- <![CDATA[
-
- /** Test for Bug 409624 **/
- SimpleTest.waitForExplicitFinish();
- window.open("bug409624_window.xul", "409624test",
- "chrome,width=600,height=600");
-
- ]]>
- </script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug418874.xul b/toolkit/content/tests/chrome/test_bug418874.xul
deleted file mode 100644
index 13f0a1453..000000000
--- a/toolkit/content/tests/chrome/test_bug418874.xul
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Textbox with placeholder test" width="500" height="600"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
- <hbox>
- <textbox id="t1" placeholder="empty"/>
- </hbox>
-
- <hbox>
- <textbox id="t2" placeholder="empty"/>
- </hbox>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;">
- <p id="display">
- </p>
- <div id="content" style="display: none">
- </div>
- <pre id="test">
- </pre>
- </body>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
- SimpleTest.waitForExplicitFinish();
-
- function doTest() {
- var t1 = $("t1");
- var t2 = $("t2");
- setTextboxValue(t1, "1");
- var t1Enabled = {};
- var t1CanUndo = {};
- t1.editor.canUndo(t1Enabled, t1CanUndo);
- is(t1CanUndo.value, true,
- "undo correctly enabled when placeholder was not changed through property");
-
- t2.placeholder = "reallyempty";
- setTextboxValue(t2, "2");
- var t2Enabled = {};
- var t2CanUndo = {};
- t2.editor.canUndo(t2Enabled, t2CanUndo);
- is(t2CanUndo.value, true,
- "undo correctly enabled when placeholder explicitly changed through property");
-
- SimpleTest.finish();
- }
-
- function setTextboxValue(textbox, value) {
- textbox.focus();
- for (var i = 0; i < value.length; ++i) {
- synthesizeKey(value.charAt(i), {});
- }
- textbox.blur();
- }
-
- SimpleTest.waitForFocus(doTest);
-
- ]]></script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug429723.xul b/toolkit/content/tests/chrome/test_bug429723.xul
deleted file mode 100644
index 99ee8acd9..000000000
--- a/toolkit/content/tests/chrome/test_bug429723.xul
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=429723
--->
-<window title="Mozilla Bug 429723"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=429723">Mozilla Bug 429723</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 429723 **/
-SimpleTest.waitForExplicitFinish();
-window.open("bug429723_window.xul", "429723test",
- "chrome,width=600,height=600");
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug437844.xul b/toolkit/content/tests/chrome/test_bug437844.xul
deleted file mode 100644
index b194b3041..000000000
--- a/toolkit/content/tests/chrome/test_bug437844.xul
+++ /dev/null
@@ -1,95 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=437844
-https://bugzilla.mozilla.org/show_bug.cgi?id=348233
--->
-<window title="Mozilla Bug 437844 and Bug 348233"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript"
- src="chrome://mochikit/content/chrome-harness.js"></script>
- <script type="application/javascript"
- src="RegisterUnregisterChrome.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=437844">
- Mozilla Bug 437844
- </a>
- <a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=348233">
- Mozilla Bug 348233
- </a>
-
- <p id="display"></p>
- <div id="content" style="display: none">
- </div>
- <pre id="test">
- </pre>
- </body>
-
- <script class="testbody" type="application/javascript">
- <![CDATA[
-
- SimpleTest.expectAssertions(18, 22);
-
- /** Test for Bug 437844 and Bug 348233 **/
- SimpleTest.waitForExplicitFinish();
-
- let prefs = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefBranch);
- prefs.setCharPref("intl.uidirection.en-US", "rtl");
-
- let rootDir = getRootDirectory(window.location.href);
- let manifest = rootDir + "rtlchrome/rtl.manifest";
-
- //copy rtlchrome to profile/rtlchrome and generate .manifest
- let filePath = chromeURIToFile(manifest);
- let tempProfileDir = copyDirToTempProfile(filePath.path, 'rtlchrome');
- if (tempProfileDir.path.lastIndexOf('\\') >= 0) {
- manifest = "content rtlchrome /" + tempProfileDir.path.replace(/\\/g, '/') + "\n";
- } else {
- manifest = "content rtlchrome " + tempProfileDir.path + "\n";
- }
- manifest += "override chrome://global/locale/intl.css chrome://rtlchrome/content/rtlchrome/rtl.css\n";
- manifest += "override chrome://global/locale/global.dtd chrome://rtlchrome/content/rtlchrome/rtl.dtd\n";
-
- let cleanupFunc = createManifestTemporarily(tempProfileDir, manifest);
-
- // Load about:plugins in an iframe
- let frame = document.createElement("iframe");
- frame.setAttribute("src", "about:plugins");
- frame.addEventListener("load", function () {
- frame.removeEventListener("load", arguments.callee, false);
- is(frame.contentDocument.dir, "rtl", "about:plugins should be RTL in RTL locales");
-
- let gDirSvc = Components.classes["@mozilla.org/file/directory_service;1"].
- getService(Components.interfaces.nsIDirectoryService).
- QueryInterface(Components.interfaces.nsIProperties);
- let tmpd = gDirSvc.get("ProfD", Components.interfaces.nsIFile);
-
- frame = document.createElement("iframe");
- frame.setAttribute("src", "file://" + tmpd.path); // a file:// URI, bug 348233
- frame.addEventListener("load", function () {
- frame.removeEventListener("load", arguments.callee, false);
-
- is(frame.contentDocument.body.dir, "rtl", "file:// listings should be RTL in RTL locales");
-
- cleanupFunc();
- prefs.clearUserPref("intl.uidirection.en-US");
- SimpleTest.finish();
- }, false);
- document.documentElement.appendChild(frame);
- }, false);
- document.documentElement.appendChild(frame);
-
- ]]>
- </script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug451540.xul b/toolkit/content/tests/chrome/test_bug451540.xul
deleted file mode 100644
index 64ae43c3c..000000000
--- a/toolkit/content/tests/chrome/test_bug451540.xul
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=451540
--->
-<window title="Mozilla Bug 451540"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=451540">
- Mozilla Bug 451540
- </a>
-
- <p id="display"></p>
- <div id="content" style="display: none">
- </div>
- <pre id="test">
- </pre>
- </body>
-
- <script class="testbody" type="application/javascript">
- <![CDATA[
-
- /** Test for Bug 451540 **/
- SimpleTest.waitForExplicitFinish();
- window.open("bug451540_window.xul", "451540test",
- "chrome,width=600,height=600");
-
- ]]>
- </script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug457632.xul b/toolkit/content/tests/chrome/test_bug457632.xul
deleted file mode 100644
index 7bc70f2cc..000000000
--- a/toolkit/content/tests/chrome/test_bug457632.xul
+++ /dev/null
@@ -1,178 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for bug 457632
- -->
-<window title="Bug 457632" width="500" height="600"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <notificationbox id="nb"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"
- onload="test()"/>
-
- <!-- test code goes here -->
-<script type="application/javascript">
-<![CDATA[
-var gNotificationBox;
-
-function completeAnimation(nextTest) {
- if (!gNotificationBox._animating) {
- nextTest();
- return;
- }
-
- setTimeout(completeAnimation, 50, nextTest);
-}
-
-function test() {
- SimpleTest.waitForExplicitFinish();
- gNotificationBox = document.getElementById("nb");
-
- is(gNotificationBox.allNotifications.length, 0, "There should be no initial notifications");
- gNotificationBox.appendNotification("Test notification",
- "notification1", null,
- gNotificationBox.PRIORITY_INFO_LOW,
- null);
- is(gNotificationBox.allNotifications.length, 1, "Notification exists while animating in");
- let notification = gNotificationBox.getNotificationWithValue("notification1");
- ok(notification, "Notification should exist while animating in");
-
- // Wait for the notificaton to finish displaying
- completeAnimation(test1);
-}
-
-// Tests that a notification that is fully animated in gets removed immediately
-function test1() {
- let notification = gNotificationBox.getNotificationWithValue("notification1");
- gNotificationBox.removeNotification(notification);
- notification = gNotificationBox.getNotificationWithValue("notification1");
- ok(!notification, "Test 1 showed notification was still present");
- ok(!gNotificationBox.currentNotification, "Test 1 said there was still a current notification");
- is(gNotificationBox.allNotifications.length, 0, "Test 1 should show no notifications present");
-
- // Wait for the notificaton to finish hiding
- completeAnimation(test2);
-}
-
-// Tests that a notification that is animating in gets removed immediately
-function test2() {
- let notification = gNotificationBox.appendNotification("Test notification",
- "notification2", null,
- gNotificationBox.PRIORITY_INFO_LOW,
- null);
- gNotificationBox.removeNotification(notification);
- notification = gNotificationBox.getNotificationWithValue("notification2");
- ok(!notification, "Test 2 showed notification was still present");
- ok(!gNotificationBox.currentNotification, "Test 2 said there was still a current notification");
- is(gNotificationBox.allNotifications.length, 0, "Test 2 should show no notifications present");
-
- // Get rid of the hiding notifications
- gNotificationBox.removeAllNotifications(true);
- test3();
-}
-
-// Tests that a background notification goes away immediately
-function test3() {
- let notification = gNotificationBox.appendNotification("Test notification",
- "notification3", null,
- gNotificationBox.PRIORITY_INFO_LOW,
- null);
- let notification2 = gNotificationBox.appendNotification("Test notification",
- "notification4", null,
- gNotificationBox.PRIORITY_INFO_LOW,
- null);
- is(gNotificationBox.allNotifications.length, 2, "Test 3 should show 2 notifications present");
- gNotificationBox.removeNotification(notification);
- is(gNotificationBox.allNotifications.length, 1, "Test 3 should show 1 notifications present");
- notification = gNotificationBox.getNotificationWithValue("notification3");
- ok(!notification, "Test 3 showed notification was still present");
- gNotificationBox.removeNotification(notification2);
- is(gNotificationBox.allNotifications.length, 0, "Test 3 should show 0 notifications present");
- notification2 = gNotificationBox.getNotificationWithValue("notification4");
- ok(!notification2, "Test 3 showed notification2 was still present");
- ok(!gNotificationBox.currentNotification, "Test 3 said there was still a current notification");
-
- // Get rid of the hiding notifications
- gNotificationBox.removeAllNotifications(true);
- test4();
-}
-
-// Tests that a foreground notification hiding a background one goes away
-function test4() {
- let notification = gNotificationBox.appendNotification("Test notification",
- "notification5", null,
- gNotificationBox.PRIORITY_INFO_LOW,
- null);
- let notification2 = gNotificationBox.appendNotification("Test notification",
- "notification6", null,
- gNotificationBox.PRIORITY_INFO_LOW,
- null);
- gNotificationBox.removeNotification(notification2);
- notification2 = gNotificationBox.getNotificationWithValue("notification6");
- ok(!notification2, "Test 4 showed notification2 was still present");
- is(gNotificationBox.currentNotification, notification, "Test 4 said the current notification was wrong");
- is(gNotificationBox.allNotifications.length, 1, "Test 4 should show 1 notifications present");
- gNotificationBox.removeNotification(notification);
- notification = gNotificationBox.getNotificationWithValue("notification5");
- ok(!notification, "Test 4 showed notification was still present");
- ok(!gNotificationBox.currentNotification, "Test 4 said there was still a current notification");
- is(gNotificationBox.allNotifications.length, 0, "Test 4 should show 0 notifications present");
-
- // Get rid of the hiding notifications
- gNotificationBox.removeAllNotifications(true);
- test5();
-}
-
-// Tests that removeAllNotifications gets rid of everything
-function test5() {
- let notification = gNotificationBox.appendNotification("Test notification",
- "notification7", null,
- gNotificationBox.PRIORITY_INFO_LOW,
- null);
- let notification2 = gNotificationBox.appendNotification("Test notification",
- "notification8", null,
- gNotificationBox.PRIORITY_INFO_LOW,
- null);
- gNotificationBox.removeAllNotifications();
- notification = gNotificationBox.getNotificationWithValue("notification7");
- notification2 = gNotificationBox.getNotificationWithValue("notification8");
- ok(!notification, "Test 5 showed notification was still present");
- ok(!notification2, "Test 5 showed notification2 was still present");
- ok(!gNotificationBox.currentNotification, "Test 5 said there was still a current notification");
- is(gNotificationBox.allNotifications.length, 0, "Test 5 should show 0 notifications present");
-
- gNotificationBox.appendNotification("Test notification",
- "notification9", null,
- gNotificationBox.PRIORITY_INFO_LOW,
- null);
-
- // Wait for the notificaton to finish displaying
- completeAnimation(test6);
-}
-
-// Tests whether removing an already removed notification doesn't break things
-function test6() {
- let notification = gNotificationBox.getNotificationWithValue("notification9");
- ok(notification, "Test 6 should have an initial notification");
- gNotificationBox.removeNotification(notification);
- gNotificationBox.removeNotification(notification);
-
- ok(!gNotificationBox.currentNotification, "Test 6 shouldn't be any current notification");
- is(gNotificationBox.allNotifications.length, 0, "Test 6 allNotifications.length should be 0");
- notification = gNotificationBox.appendNotification("Test notification",
- "notification10", null,
- gNotificationBox.PRIORITY_INFO_LOW,
- null);
- is(notification, gNotificationBox.currentNotification, "Test 6 should have made the current notification");
- gNotificationBox.removeNotification(notification);
-
- SimpleTest.finish();
-}
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug460942.xul b/toolkit/content/tests/chrome/test_bug460942.xul
deleted file mode 100644
index dae10da57..000000000
--- a/toolkit/content/tests/chrome/test_bug460942.xul
+++ /dev/null
@@ -1,42 +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"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=460942
--->
-<window title="Mozilla Bug 460942"
- onload="runTests()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=460942"
- target="_blank">Mozilla Bug 460942</a>
- </body>
-
- <!-- test code goes here -->
-
- <richlistbox>
- <richlistitem id="item1">
- <label value="one"/>
- <box>
- <label value="two"/>
- </box>
- </richlistitem>
- <richlistitem id="item2"><description>one</description><description>two</description></richlistitem>
- </richlistbox>
-
- <script type="application/javascript">
- <![CDATA[
- /** Test for Bug 460942 **/
- function runTests() {
- is ($("item1").label, "one two");
- is ($("item2").label, "");
- SimpleTest.finish();
- }
- SimpleTest.waitForExplicitFinish();
- ]]>
- </script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug471776.xul b/toolkit/content/tests/chrome/test_bug471776.xul
deleted file mode 100644
index 6002c691a..000000000
--- a/toolkit/content/tests/chrome/test_bug471776.xul
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Textbox with placeholder undo test" width="500" height="600"
- onload="doTest();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
- <hbox>
- <textbox id="t1" placeholder="empty"/>
- </hbox>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;">
- <p id="display">
- </p>
- <div id="content" style="display: none">
- </div>
- <pre id="test">
- </pre>
- </body>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
- SimpleTest.waitForExplicitFinish();
-
- function doTest() {
- var t1 = $("t1");
- t1.focus();
- var t1Enabled = {};
- var t1CanUndo = {};
- t1.editor.canUndo(t1Enabled, t1CanUndo);
- ok(!t1CanUndo.value, "undo correctly disabled when no user edits");
- SimpleTest.finish();
- }
-
- ]]></script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug509732.xul b/toolkit/content/tests/chrome/test_bug509732.xul
deleted file mode 100644
index cc7ce6807..000000000
--- a/toolkit/content/tests/chrome/test_bug509732.xul
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for bug 509732
- -->
-<window title="Bug 509732" width="500" height="600"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <notificationbox id="nb" hidden="true"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"
- onload="test()"/>
-
- <!-- test code goes here -->
-<script type="application/javascript">
-<![CDATA[
-var gNotificationBox;
-
-// Tests that a notification that is added in an hidden box didn't throw the animation
-function test() {
- SimpleTest.waitForExplicitFinish();
- gNotificationBox = document.getElementById("nb");
-
- is(gNotificationBox.allNotifications.length, 0, "There should be no initial notifications");
-
- gNotificationBox.appendNotification("Test notification",
- "notification1", null,
- gNotificationBox.PRIORITY_INFO_LOW,
- null);
-
- is(gNotificationBox.allNotifications.length, 1, "Notification exists");
- is(gNotificationBox._animating, false, "Notification shouldn't be animating");
-
- test1();
-}
-
-// Tests that a notification that is removed from an hidden box didn't throw the animation
-function test1() {
- let notification = gNotificationBox.getNotificationWithValue("notification1");
- gNotificationBox.removeNotification(notification);
- ok(!gNotificationBox.currentNotification, "Test 1 should show no current animation");
- is(gNotificationBox._animating, false, "Notification shouldn't be animating");
- is(gNotificationBox.allNotifications.length, 0, "Test 1 should show no notifications present");
-
- SimpleTest.finish();
-}
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug554279.xul b/toolkit/content/tests/chrome/test_bug554279.xul
deleted file mode 100644
index d4057b890..000000000
--- a/toolkit/content/tests/chrome/test_bug554279.xul
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Toolbar" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="startTest();">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <toolbox>
- <toolbarpalette id="palette"/>
-
- <toolbar id="tb1" currentset="p1"/>
- </toolbox>
-
- <!-- test resuls are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml"
- style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="text/javascript"><![CDATA[
- var toolbar = $("tb1");
-
- ok(toolbar, "got the toolbar, triggering the xbl constructor");
-
- var palette = $("palette");
- ok(palette, "palette is still in the document");
-
- var button = document.createElement("p1");
- button.id = button.label = "p1";
- palette.appendChild(button);
-
- SimpleTest.waitForExplicitFinish();
- function startTest() {
- is(button.parentNode, toolbar, "button has been added to the toolbar");
- SimpleTest.finish();
- }
- ]]></script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug557987.xul b/toolkit/content/tests/chrome/test_bug557987.xul
deleted file mode 100644
index ba680568f..000000000
--- a/toolkit/content/tests/chrome/test_bug557987.xul
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for bug 557987
- -->
-<window title="Bug 557987" width="400" height="400"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
- <toolbarbutton id="button" type="menu-button" label="Test bug 557987"
- onclick="eventReceived('click');"
- oncommand="eventReceived('command');">
- <menupopup onpopupshowing="eventReceived('popupshowing'); return false;" />
- </toolbarbutton>
- <menulist id="menulist" editable="true" value="Test bug 557987"
- onfocus="eventReceived('focus')" />
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-SimpleTest.waitForFocus(test);
-
-// Tests that mouse events are correctly dispatched to <toolbarbutton type="menu-button"/>
-function test() {
-
- disableNonTestMouseEvents(true);
-
- let button = $("button");
- let rightEdge = button.getBoundingClientRect().width - 2;
- let centerX = button.getBoundingClientRect().width / 2;
- let centerY = button.getBoundingClientRect().height / 2;
-
- synthesizeMouse(button, rightEdge, centerY, {}, window);
- synthesizeMouse(button, centerX, centerY, {}, window);
-
- let menulist = $("menulist");
- centerX = menulist.getBoundingClientRect().width / 2;
- centerY = menulist.getBoundingClientRect().height / 2;
- synthesizeMouse(menulist, centerX, centerY, {}, window);
-
- synthesizeMouse(document.getElementsByTagName("body")[0], 0, 0, {}, window);
-
- disableNonTestMouseEvents(false);
- SimpleTest.executeSoon(finishTest);
-
-}
-
-function finishTest() {
- is(eventCount.command, 1, "Correct number of command events received");
- is(eventCount.popupshowing, 1, "Correct number of popupshowing events received");
- is(eventCount.click, 2, "Correct number of click events received");
- is(eventCount.focus, 1, "Correct number of focus events received");
-
- SimpleTest.finish();
-}
-
-let eventCount = {
- command: 0,
- popupshowing: 0,
- click: 0,
- focus: 0
-};
-
-function eventReceived(eventName) {
- eventCount[eventName]++;
-}
-
-]]>
-</script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug562554.xul b/toolkit/content/tests/chrome/test_bug562554.xul
deleted file mode 100644
index 7ee9ef03d..000000000
--- a/toolkit/content/tests/chrome/test_bug562554.xul
+++ /dev/null
@@ -1,92 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for bug 562554
- -->
-<window title="Bug 562554" width="400" height="400"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<xbl:bindings xmlns:xbl="http://www.mozilla.org/xbl">
- <xbl:binding id="menu" display="xul:menu"
- extends="chrome://global/content/bindings/button.xml#button-base">
- <xbl:content>
- <xbl:children includes="menupopup"/>
- <xul:stack>
- <xul:button width="100" left="0" top="0" height="30" allowevents="true"
- onclick="eventReceived('clickbutton1'); return false;"/>
- <xul:button width="100" left="70" top="0" height="30"
- onclick="eventReceived('clickbutton2'); return false;"/>
- </xul:stack>
- </xbl:content>
- </xbl:binding>
-</xbl:bindings>
-
- <toolbarbutton type="menu" id="toolbarmenu" height="200" style="-moz-binding: url(#menu);">
- <menupopup id="menupopup" onpopupshowing="eventReceived('popupshowing'); return false;"/>
- </toolbarbutton>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.waitForFocus(test);
-
-// Tests that mouse events are correctly dispatched to <toolbarbutton type="menu"/>
-function test() {
- disableNonTestMouseEvents(true);
- nextTest();
-}
-
-let tests = [
- // Click on the toolbarbutton itself - should call popupshowing
- () => synthesizeMouse($("toolbarmenu"), 10, 50, {}, window),
-
- // Click on button1 which has allowevents="true" - should call clickbutton1
- () => synthesizeMouse($("toolbarmenu"), 10, 15, {}, window),
-
- // Click on button2 where it intersects with button1 - should call popupshowing
- () => synthesizeMouse($("toolbarmenu"), 85, 15, {}, window),
-
- // Click on button2 outside of intersection - should call popupshowing
- () => synthesizeMouse($("toolbarmenu"), 150, 15, {}, window)
-];
-
-function nextTest() {
- if (tests.length) {
- let func = tests.shift();
- func();
- SimpleTest.executeSoon(nextTest);
- } else {
- disableNonTestMouseEvents(false);
- SimpleTest.executeSoon(finishTest);
- }
-}
-
-function finishTest() {
- is(eventCount.clickbutton1, 1, "Correct number of clicks on button 1");
- is(eventCount.clickbutton2, 0, "Correct number of clicks on button 2");
- is(eventCount.popupshowing, 3, "Correct number of popupshowing events received");
-
- SimpleTest.finish();
-}
-
-let eventCount = {
- popupshowing: 0,
- clickbutton1: 0,
- clickbutton2: 0
-};
-
-function eventReceived(eventName) {
- eventCount[eventName]++;
-}
-
-]]>
-</script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug570192.xul b/toolkit/content/tests/chrome/test_bug570192.xul
deleted file mode 100644
index 09f73e932..000000000
--- a/toolkit/content/tests/chrome/test_bug570192.xul
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=570192
--->
-<window title="Mozilla Bug 558406"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script>
- <script type="application/javascript"
- src="RegisterUnregisterChrome.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=570192">
- Mozilla Bug 570192
- </a>
-
- <p id="display">
- </p>
- <div id="content" style="display: none">
- </div>
- <pre id="test">
- </pre>
- </body>
-
- <script type="application/javascript">
- <![CDATA[
-
- addLoadEvent(function() {
- try {
- var content = document.getElementById("content");
- content.innerHTML = '<textbox newlines="pasteintact" ' +
- 'xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>';
- var textbox = content.firstChild;
- ok(textbox, "created the textbox");
- ok(!textbox.editor, "do we have an editor?");
- } catch (e) {
- ok(false, "Got an exception: " + e);
- }
- SimpleTest.finish();
- });
- SimpleTest.waitForExplicitFinish();
-
- ]]>
- </script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug585946.xul b/toolkit/content/tests/chrome/test_bug585946.xul
deleted file mode 100644
index 738e46b1b..000000000
--- a/toolkit/content/tests/chrome/test_bug585946.xul
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Toolbar" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="startTest();">
-
- <script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <toolbox>
- <toolbarpalette/>
- <toolbar id="toolbar" defaultset="node1,node2">
- <toolbarbutton id="node1" label="node1" removable="true"/>
- <toolbarbutton id="node2" label="node2" removable="true"/>
- </toolbar>
- </toolbox>
-
- <!-- test resuls are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml"
- style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function startTest() {
- var toolbar = $("toolbar");
-
- var splitter = document.createElement("splitter");
- splitter.setAttribute("id", "dynsplitter");
- splitter.setAttribute("skipintoolbarset", "true");
-
- toolbar.insertBefore(splitter, $("node2"));
-
- function checkPos() {
- is($("dynsplitter").previousSibling, $("node1"));
- is($("dynsplitter").nextSibling, $("node2"));
- }
-
- checkPos();
- toolbar.style.MozBinding = "url(chrome://global/content/bindings/toolbar.xml#toolbar-drag)";
- toolbar.clientTop; // style flush
- checkPos();
-
- SimpleTest.finish();
-}
-
- ]]></script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug624329.xul b/toolkit/content/tests/chrome/test_bug624329.xul
deleted file mode 100644
index 893b38687..000000000
--- a/toolkit/content/tests/chrome/test_bug624329.xul
+++ /dev/null
@@ -1,160 +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"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=624329
--->
-<window title="Mozilla Bug 624329 context menu position"
- 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="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml"
- onload="openTestWindow()">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=624329"
- target="_blank">Mozilla Bug 624329</a>
- </body>
-
- <!-- test code goes here -->
- <script type="application/javascript">
- <![CDATA[
- /** Test for Bug 624329 **/
-
-SimpleTest.waitForExplicitFinish();
-
-var win;
-var timeoutID;
-var menu;
-
-function openTestWindow() {
- win = open("bug624329_window.xul", "_blank", "width=300,resizable=yes,chrome");
- // Close our window if the test times out so that it doesn't interfere
- // with later tests.
- timeoutID = setTimeout(function () {
- ok(false, "Test timed out.");
- // Provide some time for a screenshot
- setTimeout(finish, 1000);
- }, 20000);
-}
-
-function listenOnce(event, callback) {
- win.addEventListener(event, function listener() {
- win.removeEventListener(event, listener, false);
- callback();
- }, false);
-}
-
-function childFocused() {
- // maximizing the window is a simple way to ensure that the menu is near
- // the right edge of the screen.
-
- listenOnce("resize", childResized);
- win.maximize();
-}
-
-function childResized() {
- const isOSXLion = navigator.userAgent.indexOf("Mac OS X 10.7") != -1;
- const isOSXMtnLion = navigator.userAgent.indexOf("Mac OS X 10.8") != -1;
- const isOSXMavericks = navigator.userAgent.indexOf("Mac OS X 10.9") != -1;
- const isOSXYosemite = navigator.userAgent.indexOf("Mac OS X 10.10") != -1;
- if (isOSXLion || isOSXMtnLion || isOSXMavericks || isOSXYosemite) {
- todo_is(win.windowState, win.STATE_MAXIMIZED,
- "A resize before being maximized breaks this test on 10.7 and 10.8 and 10.9 and 10.10");
- finish();
- return;
- }
-
- is(win.windowState, win.STATE_MAXIMIZED,
- "window should be maximized");
-
- isnot(win.innerWidth, 300,
- "window inner width should have changed");
-
- openContextMenu();
-}
-
-function openContextMenu() {
- var mouseX = win.innerWidth - 10;
- var mouseY = 10;
-
- menu = win.document.getElementById("menu");
- var screenX = menu.boxObject.screenX;
- var screenY = menu.boxObject.screenY;
- var utils =
- win.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
-
- utils.sendMouseEvent("contextmenu", mouseX, mouseY, 2, 0, 0);
-
- var interval = setInterval(checkMoved, 200);
- function checkMoved() {
- if (menu.boxObject.screenX != screenX ||
- menu.boxObject.screenY != screenY) {
- clearInterval(interval);
- // Wait further to check that the window does not move again.
- setTimeout(checkPosition, 1000);
- }
- }
-
- function checkPosition() {
- var menubox = menu.boxObject;
- var winbox = win.document.documentElement.boxObject;
- var platformIsMac = navigator.userAgent.indexOf("Mac") > -1;
-
- var x = menubox.screenX - winbox.screenX;
- var y = menubox.screenY - winbox.screenY;
-
- if (platformIsMac)
- {
- // This check is alterered slightly for OSX which adds padding to the top
- // and bottom of its context menus. The menu position calculation must
- // be changed to allow for the pointer to be outside this padding
- // when the menu opens.
- // (Bug 1075089)
- ok(y + 6 >= mouseY,
- "menu top " + (y + 6) + " should be below click point " + mouseY);
- }
- else
- {
- ok(y >= mouseY,
- "menu top " + y + " should be below click point " + mouseY);
- }
-
- ok(y <= mouseY + 20,
- "menu top " + y + " should not be too far below click point " + mouseY);
-
- ok(x < mouseX,
- "menu left " + x + " should be left of click point " + mouseX);
- var right = x + menubox.width;
-
- if (platformIsMac) {
- // Rather than be constrained by the right hand screen edge, OSX menus flip
- // horizontally and appear to the left of the mouse pointer
- ok(right < mouseX,
- "menu right " + right + " should be left of click point " + mouseX);
- }
- else {
- ok(right > mouseX,
- "menu right " + right + " should be right of click point " + mouseX);
- }
-
- clearTimeout(timeoutID);
- finish();
- }
-
-}
-
-function finish() {
- if (menu && navigator.platform.indexOf("Win") >= 0) {
- todo(false, "Should not have to hide popup before closing its window");
- // This avoids mochitest "Unable to restore focus" errors (bug 670053).
- menu.hidePopup();
- }
- win.close();
- SimpleTest.finish();
-}
-
- ]]>
- </script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_bug792324.xul b/toolkit/content/tests/chrome/test_bug792324.xul
deleted file mode 100644
index a6fa42505..000000000
--- a/toolkit/content/tests/chrome/test_bug792324.xul
+++ /dev/null
@@ -1,75 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=792324
--->
-<window title="Mozilla Bug 792324"
- 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="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-<body xmlns="http://www.w3.org/1999/xhtml">
- <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=792324">Mozilla Bug 792324</a>
-
- <p id="display"></p>
-<div id="content" style="display: none">
-</div>
-</body>
-
-<panel id="panel-1">
- <button label="just a normal button"/>
- <button id="button-1"
- accesskey="X"
- oncommand="clicked(event)"
- label="Button in panel 1"
- />
-</panel>
-
-<panel id="panel-2">
- <button label="just a normal button"/>
- <button id="button-2"
- accesskey="X"
- oncommand="clicked(event)"
- label="Button in panel 2"
- />
-</panel>
-
-<script class="testbody" type="application/javascript;version=1.7"><![CDATA[
-
-/** Test for Bug 792324 **/
-let after_click;
-
-function clicked(event) {
- after_click(event);
-}
-
-function checkAccessKeyOnPanel(panelid, buttonid, cb) {
- let panel = document.getElementById(panelid);
- panel.addEventListener("popupshown", function onpopupshown() {
- panel.removeEventListener("popupshown", onpopupshown);
- panel.firstChild.focus();
- after_click = function(event) {
- is(event.target.id, buttonid, "Accesskey was directed to the button '" + buttonid + "'");
- panel.hidePopup();
- cb();
- }
- synthesizeKey("X", {});
- });
- panel.openPopup(null, "", 100, 100, false, false);
-}
-
-function test() {
- checkAccessKeyOnPanel("panel-1", "button-1", function() {
- checkAccessKeyOnPanel("panel-2", "button-2", function() {
- SimpleTest.finish();
- });
- });
-}
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.waitForFocus(test, window);
-
-]]></script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_button.xul b/toolkit/content/tests/chrome/test_button.xul
deleted file mode 100644
index fa4e7b003..000000000
--- a/toolkit/content/tests/chrome/test_button.xul
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for button
- -->
-<window title="Button Test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<button id="one" label="One" />
-<button id="two" label="Two"/>
-<hbox>
- <button id="three" label="Three" open="true"/>
-</hbox>
-<hbox>
- <button id="four" type="menu" label="Four"/>
- <button id="five" type="panel" label="Five"/>
- <button id="six" label="Six"/>
-</hbox>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function test_button()
-{
- synthesizeMouseExpectEvent($("one"), 2, 2, {}, $("one"), "command", "button press");
- $("one").focus();
- synthesizeKeyExpectEvent("VK_SPACE", { }, $("one"), "command", "key press");
- $("two").disabled = true;
- synthesizeMouseExpectEvent($("two"), 2, 2, {}, $("two"), "!command", "button press command when disabled");
- synthesizeMouseExpectEvent($("two"), 2, 2, {}, $("two"), "click", "button press click when disabled");
-
- if (navigator.platform.indexOf("Mac") == -1) {
- $("one").focus();
- synthesizeKey("VK_DOWN", { });
- is(document.activeElement, $("three"), "key cursor down on button");
-
- synthesizeKey("VK_RIGHT", { });
- is(document.activeElement, $("four"), "key cursor right on button");
- synthesizeKey("VK_DOWN", { });
- is(document.activeElement, $("four"), "key cursor down on menu button");
- $("five").focus();
- synthesizeKey("VK_DOWN", { });
- is(document.activeElement, $("five"), "key cursor down on panel button");
-
- $("three").focus();
- synthesizeKey("VK_UP", { });
- is(document.activeElement, $("one"), "key cursor up on button");
- }
-
- $("two").focus();
- ok(document.activeElement != $("two"), "focus disabled button");
-
- SimpleTest.finish();
-}
-
-SimpleTest.waitForFocus(test_button);
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_chromemargin.xul b/toolkit/content/tests/chrome/test_chromemargin.xul
deleted file mode 100644
index 79c4f7525..000000000
--- a/toolkit/content/tests/chrome/test_chromemargin.xul
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Custom chrome margin tests"
- onload="setTimeout(runTest, 0);"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-<script>
-
-// Tests parsing of the chrome margin attrib on a window.
-
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- window.open("window_chromemargin.xul", "_blank", "chrome,width=600,height=600");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_closemenu_attribute.xul b/toolkit/content/tests/chrome/test_closemenu_attribute.xul
deleted file mode 100644
index c1e93734f..000000000
--- a/toolkit/content/tests/chrome/test_closemenu_attribute.xul
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menu closemenu Attribute Tests"
- onload="setTimeout(nextTest, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<button id="menu" type="menu" label="Menu" onpopuphidden="popupHidden(event)">
- <menupopup id="p1" onpopupshown="if (event.target == this) this.firstChild.open = true">
- <menu id="l1" label="One">
- <menupopup id="p2" onpopupshown="if (event.target == this) this.firstChild.open = true">
- <menu id="l2" label="Two">
- <menupopup id="p3" onpopupshown="executeMenuItem()">
- <menuitem id="l3" label="Three"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- </menupopup>
-</button>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var gExpectedId = "p3";
-var gMode = -1;
-var gModes = ["", "auto", "single", "none"];
-
-function nextTest()
-{
- gMode++;
- if (gModes[gMode] != "none")
- gExpectedId = "p3";
-
- if (gMode != 0)
- $("l3").setAttribute("closemenu", gModes[gMode]);
- if (gModes[gMode] == "none")
- $("l2").open = true;
- else
- $("menu").open = true;
-}
-
-function executeMenuItem()
-{
- synthesizeKey("VK_DOWN", { });
- synthesizeKey("VK_RETURN", { });
- // after a couple of seconds, end the test, as the 'none' closemenu value
- // should not hide any popups
- if (gModes[gMode] == "none")
- setTimeout(function() { $("menu").open = false; }, 2000);
-}
-
-function popupHidden(event)
-{
- if (gModes[gMode] == "none") {
- if (event.target.id == "p1")
- SimpleTest.finish()
- return;
- }
-
- is(event.target.id, gExpectedId,
- "Expected event " + gModes[gMode] + " " + gExpectedId);
-
- gExpectedId = "";
- if (event.target.id == "p3") {
- if (gModes[gMode] == "" || gModes[gMode] == "auto")
- gExpectedId = "p2";
- }
- else if (event.target.id == "p2") {
- if (gModes[gMode] == "" || gModes[gMode] == "auto")
- gExpectedId = "p1";
- }
-
- if (!gExpectedId)
- nextTest();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_colorpicker_popup.xul b/toolkit/content/tests/chrome/test_colorpicker_popup.xul
deleted file mode 100644
index 3ac84260b..000000000
--- a/toolkit/content/tests/chrome/test_colorpicker_popup.xul
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Colorpicker Tests"
- onload="setTimeout(runTests, 0);"
- onpopupshown="popupShown();"
- onpopuphidden="popupHiding();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<colorpicker id="colorpicker-popup" type="button" color="#FF0000" tabindex="1"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-var gTestPhase = -1;
-var gCp = null;
-
-SimpleTest.waitForExplicitFinish();
-
-function preventDefault(event) {
- event.preventDefault();
-}
-
-function runTests()
-{
- gCp = document.getElementById("colorpicker-popup");
- is(gCp.color, "#FF0000", "popup color is initialized");
- is(gCp.tabIndex, 1, "button tabindex is initialized");
- is(gCp.disabled, false, "button is not disabled");
-
- document.addEventListener("keypress", preventDefault, false);
-
- goNext();
-}
-
-var phases = [ "mouse click", "showPopup",
- "key left", "key right", "key up", "key down", "key space" ];
-
-function popupShown()
-{
- if (gTestPhase >= phases.length)
- return;
-
- var phase = phases[gTestPhase];
-
- is(gCp.open, true, phase + " popup shown, open property is true");
-
- switch (phase) {
- case "mouse click":
- synthesizeMouse(gCp, 2, 2, { });
- break;
- case "showPopup":
- gCp.hidePopup();
- break;
- case "key left":
- synthesizeKey("VK_LEFT", { });
- synthesizeKeyExpectEvent("VK_RETURN", { });
- is(gCp.color, "#C0C0C0", "key left while open");
- break;
- case "key right":
- synthesizeKey("VK_RIGHT", { });
- synthesizeKeyExpectEvent("VK_SPACE", { });
- is(gCp.color, "#FF0000", "key right while open");
- break;
- case "key up":
- synthesizeKey("VK_UP", { });
- synthesizeKeyExpectEvent("VK_RETURN", { });
- is(gCp.color, "#FF6666", "key up while open");
- break;
- case "key down":
- synthesizeKey("VK_DOWN", { });
- synthesizeKeyExpectEvent("VK_SPACE", { });
- is(gCp.color, "#FF0000", "key down while open");
- break;
- default:
- synthesizeMouse(gCp, 2, 2, { });
-// this breaks on the Mac, so disable for now
-// synthesizeKey("VK_ESCAPE", { });
- break;
- }
-}
-
-function popupHiding()
-{
- var phase = phases[gTestPhase];
- if (phase == "showPopup")
- phase = "hidePopup";
- if (phase == "key left")
- phase = "escape";
- is(gCp.open, false, phase + " popup hidden, open property is false");
-
- goNext();
-}
-
-function goNext()
-{
- gTestPhase++;
- if (gTestPhase >= phases.length) {
- document.removeEventListener("keypress", preventDefault, false);
- SimpleTest.finish();
- return;
- }
-
- gCp.focus();
-
- var phase = phases[gTestPhase];
- switch (phase) {
- case "mouse click":
- synthesizeMouse(gCp, 2, 2, { });
- break;
- case "showPopup":
- gCp.showPopup();
- break;
- case "key left":
- synthesizeKey("VK_LEFT", { });
- break;
- case "key right":
- synthesizeKey("VK_RIGHT", { });
- break;
- case "key down":
- synthesizeKey("VK_UP", { });
- break;
- case "key up":
- synthesizeKey("VK_DOWN", { });
- break;
- case "key space":
- synthesizeKey("VK_SPACE", { });
- break;
- }
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_contextmenu_list.xul b/toolkit/content/tests/chrome/test_contextmenu_list.xul
deleted file mode 100644
index 157831a58..000000000
--- a/toolkit/content/tests/chrome/test_contextmenu_list.xul
+++ /dev/null
@@ -1,288 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Context Menu on List Tests"
- onload="setTimeout(startTest, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<spacer height="5"/>
-
-<hbox style="padding-left: 10px;">
- <spacer width="5"/>
- <richlistbox id="list" context="themenu" style="padding: 0;" oncontextmenu="checkContextMenu(event)">
- <richlistitem id="item1" style="padding-top: 3px; margin: 0;"><button label="One"/></richlistitem>
- <richlistitem id="item2" height="22"><checkbox label="Checkbox"/></richlistitem>
- <richlistitem id="item3"><button label="Three"/></richlistitem>
- <richlistitem id="item4"><checkbox label="Four"/></richlistitem>
- </richlistbox>
-
- <tree id="tree" rows="5" flex="1" context="themenu" style="-moz-appearance: none; border: 0">
- <treecols>
- <treecol label="Name" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol label="Moons"/>
- </treecols>
- <treechildren id="treechildren">
- <treeitem>
- <treerow>
- <treecell label="Mercury"/>
- <treecell label="0"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Venus"/>
- <treecell label="0"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Earth"/>
- <treecell label="1"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Mars"/>
- <treecell label="2"/>
- </treerow>
- </treeitem>
- </treechildren>
- </tree>
-
- <menu id="menu" label="Menu">
- <menupopup id="menupopup" onpopupshown="menuTests()" onpopuphidden="nextTest()"
- oncontextmenu="checkContextMenuForMenu(event)">
- <menuitem id="menu1" label="Menu 1"/>
- <menuitem id="menu2" label="Menu 2"/>
- <menuitem id="menu3" label="Menu 3"/>
- </menupopup>
- </menu>
-
-</hbox>
-
-<menupopup id="themenu" onpopupshowing="if (gTestId == -1) event.preventDefault()"
- onpopupshown="checkPopup()" onpopuphidden="setTimeout(nextTest, 0);">
- <menuitem label="Item"/>
-</menupopup>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var gTestId = -1;
-var gTestElement = "list";
-var gSelectionStep = 0;
-var gContextMenuFired = false;
-
-function startTest()
-{
- // first, check if the richlistbox selection changes on a contextmenu mouse event
- var element = $("list");
- synthesizeMouse(element.getItemAtIndex(3), 7, 1, { type : "mousedown", button: 2, ctrlKey: true });
- synthesizeMouse(element, 7, 4, { type : "contextmenu", button: 2 });
-
- gSelectionStep++;
- synthesizeMouse(element.getItemAtIndex(1), 7, 1, { type : "mousedown", button: 2, ctrlKey: true, shiftKey: true });
- synthesizeMouse(element, 7, 4, { type : "contextmenu", button: 2 });
-
- gSelectionStep++;
- synthesizeMouse(element.getItemAtIndex(1), 7, 1, { type : "mousedown", button: 2 });
- synthesizeMouse(element, 7, 4, { type : "contextmenu", button: 2 });
-
- $("menu").open = true;
-}
-
-function menuTests()
-{
- gSelectionStep = 0;
- var element = $("menu");
- synthesizeMouse(element, 0, 0, { type : "contextmenu", button: 0 });
- is(gContextMenuFired, true, "context menu fired when menu open");
-
- gSelectionStep = 1;
- $("menu").boxObject.activeChild = $("menu2");
- synthesizeMouse(element, 0, 0, { type : "contextmenu", button: 0 });
-
- $("menu").open = false;
-}
-
-function nextTest()
-{
- gTestId++;
- if (gTestId > 2) {
- if (gTestElement == "list") {
- gTestElement = "tree";
- gTestId = 0;
- }
- else {
- SimpleTest.finish();
- return;
- }
- }
- var element = $(gTestElement);
- element.focus();
- if (gTestId == 0) {
- if (gTestElement == "list")
- element.selectedIndex = 2;
- element.currentIndex = 2;
- synthesizeMouse(element, 0, 0, { type : "contextmenu", button: 0 });
- }
- else if (gTestId == 1) {
- synthesizeMouse(element, 7, 4, { type : "contextmenu", button: 2 });
- }
- else {
- element.currentIndex = -1;
- element.selectedIndex = -1;
- synthesizeMouse(element, 0, 0, { type : "contextmenu", button: 0 });
- }
-}
-
-// This is nasty so I'd better explain what's going on.
-// The basic problem is that the synthetic mouse coordinate generated
-// by DOMWindowUtils.sendMouseEvent and also the synthetic mouse coordinate
-// generated internally when contextmenu events are redirected to the focused
-// element are rounded to the nearest device pixel. But this rounding is done
-// while the coordinates are relative to the nearest widget. When this test
-// is run in the mochitest harness, the nearest widget is the main mochitest
-// window, and our document can have a fractional position within that
-// mochitest window. So when we round coordinates for comparison in this
-// test, we need to do so very carefully, especially if the target element
-// also has a fractional position within our document.
-//
-// For example, if the y-offset of our containing IFRAME is 100.4px,
-// and the offset of our expected point is 10.3px in our document, the actual
-// mouse event is dispatched to round(110.7) == 111px. This comes back
-// with a clientY of round(111 - 100.4) == round(10.6) == 11. This is not
-// equal to round(10.3) as you might expect.
-
-function isRoundedX(a, b, msg)
-{
- is(Math.round(a + mozInnerScreenX), Math.round(b + mozInnerScreenX), msg);
-}
-
-function isRoundedY(a, b, msg)
-{
- is(Math.round(a + mozInnerScreenY), Math.round(b + mozInnerScreenY), msg);
-}
-
-function checkContextMenu(event)
-{
- var rect = $(gTestElement).getBoundingClientRect();
-
- var frombase = (gTestId == -1 || gTestId == 1);
- if (!frombase)
- rect = event.originalTarget.getBoundingClientRect();
- var left = frombase ? rect.left + 7 : rect.left;
- var top = frombase ? rect.top + 4 : rect.bottom;
-
- isRoundedX(event.clientX, left, gTestElement + " clientX " + gSelectionStep + " " + gTestId + "," + frombase);
- isRoundedY(event.clientY, top, gTestElement + " clientY " + gSelectionStep + " " + gTestId);
- ok(event.screenX > left, gTestElement + " screenX " + gSelectionStep + " " + gTestId);
- ok(event.screenY > top, gTestElement + " screenY " + gSelectionStep + " " + gTestId);
-
- // context menu from mouse click
- switch (gTestId) {
- case -1:
- var expected = gSelectionStep == 2 ? 1 : (platformIsMac() ? 3 : 0);
- is($(gTestElement).selectedIndex, expected, "index after click " + gSelectionStep);
- break;
- case 0:
- if (gTestElement == "list")
- is(event.originalTarget, $("item3"), "list selection target");
- else
- is(event.originalTarget, $("treechildren"), "tree selection target");
- break;
- case 1:
- is(event.originalTarget.id, $("item1").id, "list mouse selection target");
- break;
- case 2:
- is(event.originalTarget, $("list"), "list no selection target");
- break;
- }
-}
-
-function checkContextMenuForMenu(event)
-{
- gContextMenuFired = true;
-
- var popuprect = (gSelectionStep ? $("menu2") : $("menupopup")).getBoundingClientRect();
- is(event.clientX, Math.round(popuprect.left), "menu left " + gSelectionStep);
- // the clientY is off by one sometimes on Windows (when loaded in the testing iframe
- // but not when loaded separately) so just check for both cases for now
- ok(event.clientY == Math.round(popuprect.bottom) ||
- event.clientY - 1 == Math.round(popuprect.bottom), "menu top " + gSelectionStep);
-}
-
-function checkPopup()
-{
- var menurect = $("themenu").getBoundingClientRect();
-
- // Context menus are offset by a number of pixels from the mouse click
- // which activates them. This is so that they don't appear exactly
- // under the mouse which can cause them to be mistakenly dismissed.
- // The number of pixels depends on the platform and is defined in
- // each platform's nsLookAndFeel
- var contextMenuOffsetX = platformIsMac() ? 1 : 2;
- var contextMenuOffsetY = platformIsMac() ? -6 : 2;
-
- if (gTestId == 0) {
- if (gTestElement == "list") {
- var itemrect = $("item3").getBoundingClientRect();
- isRoundedX(menurect.left, itemrect.left + contextMenuOffsetX,
- "list selection keyboard left");
- isRoundedY(menurect.top, itemrect.bottom + contextMenuOffsetY,
- "list selection keyboard top");
- }
- else {
- var tree = $("tree");
- var bodyrect = $("treechildren").getBoundingClientRect();
- isRoundedX(menurect.left, bodyrect.left + contextMenuOffsetX,
- "tree selection keyboard left");
- isRoundedY(menurect.top, bodyrect.top +
- tree.treeBoxObject.rowHeight * 3 + contextMenuOffsetY,
- "tree selection keyboard top");
- }
- }
- else if (gTestId == 1) {
- // activating a context menu with the mouse from position (7, 4).
- var elementrect = $(gTestElement).getBoundingClientRect();
- isRoundedX(menurect.left, elementrect.left + 7 + contextMenuOffsetX,
- gTestElement + " mouse left");
- isRoundedY(menurect.top, elementrect.top + 4 + contextMenuOffsetY,
- gTestElement + " mouse top");
- }
- else {
- var elementrect = $(gTestElement).getBoundingClientRect();
- isRoundedX(menurect.left, elementrect.left + contextMenuOffsetX,
- gTestElement + " no selection keyboard left");
- isRoundedY(menurect.top, elementrect.bottom + contextMenuOffsetY,
- gTestElement + " no selection keyboard top");
- }
-
- $("themenu").hidePopup();
-}
-
-function platformIsMac()
-{
- return navigator.platform.indexOf("Mac") > -1;
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_cursorsnap.xul b/toolkit/content/tests/chrome/test_cursorsnap.xul
deleted file mode 100644
index de153e704..000000000
--- a/toolkit/content/tests/chrome/test_cursorsnap.xul
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Cursor snapping test"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-const kMaxRetryCount = 4;
-const kTimeoutTime = [
- 100, 100, 1000, 1000, 5000
-];
-
-var gRetryCount;
-
-var gTestingCount = 0;
-var gTestingIndex = -1;
-var gDisable = false;
-var gHidden = false;
-
-function canRetryTest()
-{
- return gRetryCount <= kMaxRetryCount;
-}
-
-function getTimeoutTime()
-{
- return kTimeoutTime[gRetryCount];
-}
-
-function runNextTest()
-{
- gRetryCount = 0;
- gTestingIndex++;
- runCurrentTest();
-}
-
-function retryCurrentTest()
-{
- ok(canRetryTest(), "retry the current test...");
- gRetryCount++;
- runCurrentTest();
-}
-
-function runCurrentTest()
-{
- var position = "top=" + gTestingCount + ",left=" + gTestingCount + ",";
- gTestingCount++;
- switch (gTestingIndex) {
- case 0:
- gDisable = false;
- gHidden = false;
- window.open("window_cursorsnap_dialog.xul", "_blank",
- position + "chrome,width=100,height=100");
- break;
- case 1:
- gDisable = true;
- gHidden = false;
- window.open("window_cursorsnap_dialog.xul", "_blank",
- position + "chrome,width=100,height=100");
- break;
- case 2:
- gDisable = false;
- gHidden = true;
- window.open("window_cursorsnap_dialog.xul", "_blank",
- position + "chrome,width=100,height=100");
- break;
- case 3:
- gDisable = false;
- gHidden = false;
- window.open("window_cursorsnap_wizard.xul", "_blank",
- position + "chrome,width=100,height=100");
- break;
- case 4:
- gDisable = true;
- gHidden = false;
- window.open("window_cursorsnap_wizard.xul", "_blank",
- position + "chrome,width=100,height=100");
- break;
- case 5:
- gDisable = false;
- gHidden = true;
- window.open("window_cursorsnap_wizard.xul", "_blank",
- position + "chrome,width=100,height=100");
- break;
- default:
- SetPrefs(false);
- SimpleTest.finish();
- return;
- }
-}
-
-function SetPrefs(aSet)
-{
- var prefSvc = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefBranch);
- const kPrefName = "ui.cursor_snapping.always_enabled";
- if (aSet) {
- prefSvc.setBoolPref(kPrefName, true);
- } else if (prefSvc.prefHasUserValue(kPrefName)) {
- prefSvc.clearUserPref(kPrefName);
- }
-}
-
-SetPrefs(true);
-runNextTest();
-
-]]>
-</script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_datepicker.xul b/toolkit/content/tests/chrome/test_datepicker.xul
deleted file mode 100644
index e7a61f43b..000000000
--- a/toolkit/content/tests/chrome/test_datepicker.xul
+++ /dev/null
@@ -1,415 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for datepicker
- -->
-<window title="datepicker" width="500" height="600"
- onload="setTimeout(testtag_datepickers, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<hbox onpopupshown="testtag_datepicker_UI_popup()"
- onpopuphidden="testtag_finish()">
-<datepicker id="datepicker"/>
-<datepicker id="datepicker-popup" type="popup"/>
-<hbox onDOMMouseScroll="mouseScrolled = event.defaultPrevented;">
- <datepicker id="datepicker-grid" type="grid" value="2007-04-21"/>
-</hbox>
-</hbox>
-
-<!-- Test-only key bindings, but must not conflict with the application. -->
-<keyset id="mainKeyset">
- <key id="key_alt_z" key="Z" oncommand="return" modifiers="alt"/>
- <key id="key_ctrl_q" key="Q" oncommand="return" modifiers="control"/>
- <key id="key_meta_e" key="E" oncommand="return" modifiers="meta"/>
-</keyset>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script>
-<![CDATA[
-
-var mouseScrolled = false;
-
-SimpleTest.waitForExplicitFinish();
-
-function testtag_datepickers()
-{
- var dppopup = document.getElementById("datepicker-popup");
- testtag_datepicker(document.getElementById("datepicker"), "", "datepicker");
- testtag_datepicker(dppopup, "popup", "datepicker popup");
-
- var gridpicker = document.getElementById("datepicker-grid");
- is(gridpicker.monthField.selectedIndex, "3", "datepicker grid correct month is initially selected");
- testtag_datepicker(gridpicker, "grid", "datepicker grid");
- dppopup.open = true;
-}
-
-function testtag_finish()
-{
- ok(!document.getElementById("datepicker-popup").open, "datepicker popup open false again");
-
- var dpgrid = document.getElementById("datepicker-grid");
- synthesizeWheel(dpgrid, 5, 5, { deltaY: 10.0,
- deltaMode: WheelEvent.DOM_DELTA_LINE });
- is(mouseScrolled, true, "mouse scrolled");
- is(dpgrid.displayedMonth, 2, "mouse scroll changed month");
-
- SimpleTest.finish();
-}
-
-function testtag_datepicker(dp, type, testid)
-{
- testid += " ";
-
- var today = new Date();
- var tyear = today.getFullYear();
- var tmonth = today.getMonth();
- var tdate = today.getDate();
-
- // testtag_comparedate(dp, testid + "initial", tyear, tmonth, tdate);
-
- // check that setting the value property works
- dp.value = testtag_getdatestring(tyear, tmonth, tdate);
- testtag_comparedate(dp, testid + "set value", tyear, tmonth, tdate);
-
- // check that setting the dateValue property works
- dp.dateValue = today;
- testtag_comparedate(dp, testid + "set dateValue", tyear, tmonth, tdate);
- ok(dp.value !== today, testid + " set dateValue different date");
-
- ok(!dp.readOnly, testid + "readOnly");
- dp.readOnly = true;
- ok(dp.readOnly, testid + "set readOnly");
- dp.readOnly = false;
- ok(!dp.readOnly, testid + "clear readOnly");
-
- var setDateField = function(field, value, expectException,
- expectedYear, expectedMonth, expectedDate)
- {
- var exh = false;
- try {
- dp[field] = value;
- } catch (ex) { exh = true; }
- is(exh, expectException, testid + "set " + field + " " + value);
- testtag_comparedate(dp, testid + "set " + field + " " + value,
- expectedYear, expectedMonth, expectedDate);
- }
-
- // check the value property
- setDateField("value", "2003-1-27", false, 2003, 0, 27);
- setDateField("value", "2002-11-8", false, 2002, 10, 8);
- setDateField("value", "2001-07-02", false, 2001, 6, 2);
- setDateField("value", "2002-10-25", false, 2002, 9, 25);
-
- // check that the year, month and date fields can be set properly
- setDateField("year", 2002, false, 2002, 9, 25);
- setDateField("year", 0, true, 2002, 9, 25);
-
- setDateField("month", 6, false, 2002, 6, 25);
- setDateField("month", 9, false, 2002, 9, 25);
- setDateField("month", 10, false, 2002, 10, 25);
- setDateField("month", -1, true, 2002, 10, 25);
- setDateField("month", 12, true, 2002, 10, 25);
-
- setDateField("date", 9, false, 2002, 10, 9);
- setDateField("date", 10, false, 2002, 10, 10);
- setDateField("date", 15, false, 2002, 10, 15);
- setDateField("date", 0, true, 2002, 10, 15);
- setDateField("date", 32, true, 2002, 10, 15);
-
- // check leap year handling
- setDateField("value", "1600-2-29", false, 1600, 1, 29);
- setDateField("value", "2000-2-29", false, 2000, 1, 29);
- setDateField("value", "2003-2-29", false, 2003, 2, 1);
- setDateField("value", "2004-2-29", false, 2004, 1, 29);
- setDateField("value", "2100-2-29", false, 2100, 2, 1);
-
- // check invalid values for the value and dateValue properties
- dp.value = "2002-07-15";
- setDateField("value", "", true, 2002, 6, 15);
- setDateField("value", "2-2", true, 2002, 6, 15);
- setDateField("value", "2000-5-6-6", true, 2002, 6, 15);
- setDateField("value", "2000-a-19", true, 2002, 6, 15);
- setDateField("dateValue", "none", true, 2002, 6, 15);
-
- // grid and popup types can display a different month than the current one
- var isGridOrPopup = (type == "grid" || type == "popup");
- dp.displayedMonth = 3;
- testtag_comparedate(dp, testid + "set displayedMonth",
- 2002, isGridOrPopup ? 6 : 3, 15, 3);
-
- dp.displayedYear = 2009;
- testtag_comparedate(dp, testid + "set displayedYear",
- isGridOrPopup ? 2002 : 2009, isGridOrPopup ? 6 : 3, 15, 3, 2009);
-
- if (isGridOrPopup) {
- dp.value = "2008-02-29";
- dp.displayedYear = 2009;
- is(dp.displayedMonth, 1, "set displayedYear during leap year");
- }
-
- is(dp.open, false, testid + "open false");
- if (type != "popup") {
- dp.open = true;
- ok(!dp.open, testid + "open still false");
- }
-
- // check the fields
- if (type != "grid") {
- ok(dp.yearField instanceof HTMLInputElement, testid + "yearField");
- ok(dp.monthField instanceof HTMLInputElement, testid + "monthField");
- ok(dp.dateField instanceof HTMLInputElement, testid + "dateField");
-
- testtag_datepicker_UI_fields(dp, testid);
-
- dp.readOnly = true;
-
- // check that keyboard usage doesn't change the value when the datepicker
- // is read only
- testtag_datepicker_UI_key(dp, testid + "readonly ", "2003-01-29",
- dp.yearField, 2003, 0, 29, 2003, 0, 29);
- testtag_datepicker_UI_key(dp, testid + "readonly ", "2003-04-29",
- dp.monthField, 2003, 3, 29, 2003, 3, 29);
- testtag_datepicker_UI_key(dp, testid + "readonly ", "2003-06-15",
- dp.dateField, 2003, 5, 15, 2003, 5, 15);
-
- dp.readOnly = false;
- }
- else {
- testtag_datepicker_UI_grid(dp, "grid", testid);
- }
-}
-
-function testtag_datepicker_UI_fields(dp, testid)
-{
- testid += "UI";
- dp.focus();
-
- // test adjusting the date with the up and down keys
- testtag_datepicker_UI_key(dp, testid, "2003-01-29", dp.yearField, 2004, 0, 29, 2003, 0, 29);
- testtag_datepicker_UI_key(dp, testid, "1600-02-29", dp.yearField, 1601, 1, 28, 1600, 1, 28);
- testtag_datepicker_UI_key(dp, testid, "2000-02-29", dp.yearField, 2001, 1, 28, 2000, 1, 28);
- testtag_datepicker_UI_key(dp, testid, "2004-02-29", dp.yearField, 2005, 1, 28, 2004, 1, 28);
-
- testtag_datepicker_UI_key(dp, testid, "2003-04-29", dp.monthField, 2003, 4, 29, 2003, 3, 29);
- testtag_datepicker_UI_key(dp, testid, "2003-01-15", dp.monthField, 2003, 1, 15, 2003, 0, 15);
- testtag_datepicker_UI_key(dp, testid, "2003-12-29", dp.monthField, 2003, 0, 29, 2003, 11, 29);
- testtag_datepicker_UI_key(dp, testid, "2003-03-31", dp.monthField, 2003, 3, 30, 2003, 2, 30);
-
- testtag_datepicker_UI_key(dp, testid, "2003-06-15", dp.dateField, 2003, 5, 16, 2003, 5, 15);
- testtag_datepicker_UI_key(dp, testid, "2003-06-01", dp.dateField, 2003, 5, 2, 2003, 5, 1);
- testtag_datepicker_UI_key(dp, testid, "2003-06-30", dp.dateField, 2003, 5, 1, 2003, 5, 30);
- testtag_datepicker_UI_key(dp, testid, "1600-02-28", dp.dateField, 1600, 1, 29, 1600, 1, 28);
- testtag_datepicker_UI_key(dp, testid, "2000-02-28", dp.dateField, 2000, 1, 29, 2000, 1, 28);
- testtag_datepicker_UI_key(dp, testid, "2003-02-28", dp.dateField, 2003, 1, 1, 2003, 1, 28);
- testtag_datepicker_UI_key(dp, testid, "2004-02-28", dp.dateField, 2004, 1, 29, 2004, 1, 28);
- testtag_datepicker_UI_key(dp, testid, "2100-02-28", dp.dateField, 2100, 1, 1, 2100, 1, 28);
-
- synthesizeKeyExpectEvent('Z', { altKey: true }, $("key_alt_z"), "command", testid + " alt shortcut");
- synthesizeKeyExpectEvent('Q', { ctrlKey: true }, $("key_ctrl_q"), "command", testid + " ctrl shortcut");
- synthesizeKeyExpectEvent('E', { metaKey: true }, $("key_meta_e"), "command", testid + " meta shortcut");
-}
-
-function testtag_datepicker_UI_grid(dp, type, testid)
-{
- testid += "UI ";
-
- // check that pressing the cursor keys moves the date properly. For grid
- // types, focus the grid first. For popup types, the grid should be focused
- // automatically when opening the popup.
- var ktarget = dp;
- if (type == "grid")
- dp.focus();
- else
- ktarget = dp.attachedControl;
-
- dp.value = "2003-02-22";
-
- synthesizeKeyExpectEvent("VK_LEFT", { }, ktarget, "change", testid + "key left");
- is(dp.value, "2003-02-21", testid + "key left");
-
- synthesizeKeyExpectEvent("VK_RIGHT", { }, ktarget, "change", testid + "key right");
- is(dp.value, "2003-02-22", testid + "key right");
- synthesizeKeyExpectEvent("VK_RIGHT", { }, ktarget, "change", testid + "key right next week");
- is(dp.value, "2003-02-23", testid + "key right next week");
- synthesizeKeyExpectEvent("VK_LEFT", { }, ktarget, "change", testid + "key left previous week");
- is(dp.value, "2003-02-22", testid + "key left previous week");
-
- synthesizeKeyExpectEvent("VK_UP", { }, ktarget, "change", testid + "key up");
- is(dp.value, "2003-02-15", testid + "key up");
- synthesizeKeyExpectEvent("VK_DOWN", { }, ktarget, "change", testid + "key down");
- is(dp.value, "2003-02-22", testid + "key down");
- synthesizeKeyExpectEvent("VK_DOWN", { }, ktarget, "change");
- is(dp.value, "2003-03-01", testid + "key down next month", testid + "key down next month");
- synthesizeKeyExpectEvent("VK_UP", { }, ktarget, "change");
- is(dp.value, "2003-02-22", testid + "key up previous month", testid + "key up previous month");
-
- // the displayed month may be changed with the page up and page down keys,
- // however this only changes the displayed month, not the current value.
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { }, ktarget, "monthchange", testid + "key page down");
- is(dp.value, "2003-02-22", testid + "key page down");
-
- // the monthchange event is fired when the displayed month is changed
- synthesizeKeyExpectEvent("VK_UP", { }, ktarget, "monthchange", testid + "key up after month change");
- is(dp.value, "2003-02-15", testid + "key up after month change");
-
- synthesizeKeyExpectEvent("VK_PAGE_UP", { }, ktarget, "monthchange", testid + "key page up");
- is(dp.value, "2003-02-15", testid + "key page up");
-
- // check handling at the start and end of the month
- dp.value = "2010-10-01";
- synthesizeKeyExpectEvent("VK_PAGE_UP", { }, ktarget, "monthchange", testid + "key page up 2010-10-01");
- is(dp.displayedMonth, 8, testid + "key page up 2010-10-01 displayedMonth");
- is(dp.displayedYear, 2010, testid + "key page up 2010-10-01 displayedYear");
-
- dp.value = "2010-10-01";
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { }, ktarget, "monthchange", testid + "key page down 2010-10-01");
- is(dp.displayedMonth, 10, testid + "key page down 2010-10-01 displayedMonth");
- is(dp.displayedYear, 2010, testid + "key page down 2010-10-01 displayedYear");
-
- dp.value = "2010-10-31";
- synthesizeKeyExpectEvent("VK_PAGE_UP", { }, ktarget, "monthchange", testid + "key page up 2010-10-31");
- is(dp.displayedMonth, 8, testid + "key page up 2010-10-31 displayedMonth");
- is(dp.displayedYear, 2010, testid + "key page up 2010-10-01 displayedYear");
- dp.value = "2010-10-31";
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { }, ktarget, "monthchange", testid + "key page down 2010-10-31");
- is(dp.displayedMonth, 10, testid + "key page down 2010-10-31 displayedMonth");
- is(dp.displayedYear, 2010, testid + "key page up 2010-10-31 displayedYear");
-
- // check handling at the end of february
- dp.value = "2010-03-31";
- synthesizeKeyExpectEvent("VK_PAGE_UP", { }, ktarget, "monthchange", testid + "key page up 2010-03-31");
- is(dp.displayedMonth, 1, testid + "key page up 2010-03-31 displayedMonth");
- is(dp.displayedYear, 2010, testid + "key page up 2010-03-31 displayedYear");
- synthesizeKeyExpectEvent("VK_PAGE_UP", { }, ktarget, "monthchange", testid + "key page up 2010-02-28");
- is(dp.displayedMonth, 0, testid + "key page up 2010-02-28 displayedMonth");
- is(dp.displayedYear, 2010, testid + "key page up 2010-02-28 displayedYear");
-
- dp.value = "2010-01-31";
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { }, ktarget, "monthchange", testid + "key page down 2010-01-31");
- is(dp.displayedMonth, 1, testid + "key page down 2010-01-31 displayedMonth");
- is(dp.displayedYear, 2010, testid + "key page up 2010-01-31 displayedYear");
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { }, ktarget, "monthchange", testid + "key page down 2010-02-28");
- is(dp.displayedMonth, 2, testid + "key page down 2010-02-28 displayedMonth");
- is(dp.displayedYear, 2010, testid + "key page up 2010-02-28 displayedYear");
-
- // check handling at the end of february during a leap year
- dp.value = "2008-01-31";
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { }, ktarget, "monthchange", testid + "key page down 2008-01-31");
- is(dp.displayedMonth, 1, testid + "key page down 2008-01-31 displayedMonth");
- is(dp.displayedYear, 2008, testid + "key page up 2008-01-31 displayedYear");
- dp.value = "2008-03-31";
- synthesizeKeyExpectEvent("VK_PAGE_UP", { }, ktarget, "monthchange", testid + "key page up 2008-03-31");
- is(dp.displayedMonth, 1, testid + "key page up 2008-03-31 displayedMonth");
- is(dp.displayedYear, 2008, testid + "key page up 2008-03-31 displayedYear");
-
- // the value of a read only datepicker cannot be changed
- dp.value = "2003-02-15";
-
- dp.readOnly = true;
- synthesizeKeyExpectEvent("VK_LEFT", { }, ktarget, "!change", testid + "key left read only");
- is(dp.value, "2003-02-15", testid + "key left read only");
- synthesizeKeyExpectEvent("VK_RIGHT", { }, ktarget, "!change", testid + "key right read only");
- is(dp.value, "2003-02-15", testid + "key right read only");
- synthesizeKeyExpectEvent("VK_DOWN", { }, ktarget, "!change", testid + "key down read only");
- is(dp.value, "2003-02-15", testid + "key down read only");
- synthesizeKeyExpectEvent("VK_UP", { }, ktarget, "!change", testid + "key up read only");
- is(dp.value, "2003-02-15", testid + "key up read only");
-
- // month can still be changed even when readonly
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { }, ktarget, "monthchange",
- testid + "key page up read only");
- synthesizeKeyExpectEvent("VK_PAGE_UP", { }, ktarget, "monthchange",
- testid + "key page down read only");
-
- dp.readOnly = false;
- synthesizeKeyExpectEvent("VK_LEFT", { }, ktarget, "change", testid + "key left changeable again");
- is(dp.value, "2003-02-14", testid + "key left changeable again");
-
- // the value of a disabled datepicker cannot be changed
- dp.disabled = true;
- synthesizeKeyExpectEvent("VK_LEFT", { }, ktarget, "!change", testid + "key left disabled");
- is(dp.value, "2003-02-14", testid + "key left disabled");
- synthesizeKeyExpectEvent("VK_RIGHT", { }, ktarget, "!change", testid + "key right disabled");
- is(dp.value, "2003-02-14", testid + "key right disabled");
- synthesizeKeyExpectEvent("VK_DOWN", { }, ktarget, "!change", testid + "key down disabled");
- is(dp.value, "2003-02-14", testid + "key down disabled");
- synthesizeKeyExpectEvent("VK_UP", { }, ktarget, "!change", testid + "key up disabled");
- is(dp.value, "2003-02-14", testid + "key up disabled");
-
- // month cannot be changed even when disabled
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { }, ktarget, "!monthchange",
- testid + "key page down disabled");
- synthesizeKeyExpectEvent("VK_PAGE_UP", { }, ktarget, "!monthchange",
- testid + "key page up disabled");
-
- dp.disabled = false;
- synthesizeKeyExpectEvent("VK_RIGHT", { }, ktarget, "change", testid + "key right enabled again");
- is(dp.value, "2003-02-15", testid + "key right enabled again");
-}
-
-function testtag_datepicker_UI_popup()
-{
- var dppopup = document.getElementById("datepicker-popup");
- is(dppopup.open, true, "datepicker popup after open");
- testtag_datepicker_UI_grid(dppopup, "popup", "datepicker popup ");
- dppopup.open = false;
-}
-
-function testtag_datepicker_UI_key(dp, testid, value, field,
- uyear, umonth, udate,
- dyear, dmonth, ddate)
-{
- dp.value = value;
- field.focus();
-
- synthesizeKey("VK_UP", { });
- testtag_comparedate(dp, testid + " " + value + " key up", uyear, umonth, udate);
-
- synthesizeKey("VK_DOWN", { });
- testtag_comparedate(dp, testid + " " + value + " key down", dyear, dmonth, ddate);
-}
-
-function testtag_getdatestring(year, month, date)
-{
- month = (month < 9) ? ("0" + ++month) : month + 1;
- if (date < 10)
- date = "0" + date;
- return year + "-" + month + "-" + date;
-}
-
-function testtag_comparedate(dp, testid, year, month, date, displayedMonth, displayedYear)
-{
- is(dp.value, testtag_getdatestring(year, month, date), testid + " value");
- if (testid.indexOf("initial") == -1)
- is(dp.getAttribute("value"),
- testtag_getdatestring(year, month, date),
- testid + " value attribute");
-
- var dateValue = dp.dateValue;
- ok(dateValue.getFullYear() == year &&
- dateValue.getMonth() == month &&
- dateValue.getDate() == date,
- testid + " dateValue");
-
- is(dp.year, year, testid + " year");
- is(dp.month, month, testid + " month");
- is(dp.displayedMonth, displayedMonth ? displayedMonth : month, testid + " displayedMonth");
- is(dp.displayedYear, displayedYear ? displayedYear : year, testid + " displayedYear");
- is(dp.date, date, testid + " date");
-}
-
-]]>
-
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_deck.xul b/toolkit/content/tests/chrome/test_deck.xul
deleted file mode 100644
index 25c59c38a..000000000
--- a/toolkit/content/tests/chrome/test_deck.xul
+++ /dev/null
@@ -1,133 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for deck
- -->
-<window title="Deck Test"
- onload="setTimeout(run_tests, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<deck id="deck1" style="padding-top: 5px; padding-bottom: 12px;">
- <button id="d1b1" label="Button One"/>
- <button id="d1b2" label="Button Two is larger" height="80" style="margin: 1px;"/>
-</deck>
-<deck id="deck2" selectedIndex="1">
- <button id="d2b1" label="Button One"/>
- <button id="d2b2" label="Button Two"/>
-</deck>
-<deck id="deck3" selectedIndex="1">
- <button id="d3b1" label="Remove me"/>
- <button id="d3b2" label="Keep me selected"/>
-</deck>
-<deck id="deck4" selectedIndex="5">
- <button id="d4b1" label="Remove me"/>
- <button id="d4b2" label="Remove me"/>
- <button id="d4b3" label="Remove me"/>
- <button id="d4b4" label="Button 4"/>
- <button id="d4b5" label="Button 5"/>
- <button id="d4b6" label="Keep me selected"/>
- <button id="d4b7" label="Button 7"/>
-</deck>
-<deck id="deck5" selectedIndex="2">
- <button id="d5b1" label="Button 1"/>
- <button id="d5b2" label="Button 2"/>
- <button id="d5b3" label="Keep me selected"/>
- <button id="d5b4" label="Remove me"/>
- <button id="d5b5" label="Remove me"/>
- <button id="d5b6" label="Remove me"/>
-</deck>
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function run_tests() {
- test_deck();
- test_deck_child_removal();
- SimpleTest.finish();
-}
-
-function test_deck()
-{
- var deck = $("deck1");
- ok(deck.selectedIndex === '0', "deck one selectedIndex");
- // this size is the button height, 80, plus the button padding of 1px on each side,
- // plus the deck's 5px top padding and the 12px bottom padding.
- var rect = deck.getBoundingClientRect();
- is(Math.round(rect.bottom) - Math.round(rect.top), 99, "deck size of largest child");
- synthesizeMouseExpectEvent(deck, 12, 12, { }, $("d1b1"), "click", "mouse on deck one");
-
- // change the selected page of the deck and ensure that the mouse click goes
- // to the button on that page
- deck.selectedIndex = 1;
- ok(deck.selectedIndex === '1', "deck one selectedIndex after change");
- synthesizeMouseExpectEvent(deck, 9, 9, { }, $("d1b2"), "click", "mouse on deck one after change");
-
- deck = $("deck2");
- ok(deck.selectedIndex === '1', "deck two selectedIndex");
- synthesizeMouseExpectEvent(deck, 9, 9, { }, $("d2b2"), "click", "mouse on deck two");
-}
-
-function test_deck_child_removal()
-{
- // Start with a simple case where we have two child nodes in a deck, with
- // the second child (index 1) selected. Removing the first node should
- // automatically set the selectedIndex at 0.
- let deck = $("deck3");
- let child = $("d3b1");
- is(deck.selectedIndex, "1", "Should have the deck element at index 1 selected");
-
- // Remove the child at the 0th index. The deck should automatically
- // set the selectedIndex to "0".
- child.remove();
- is(deck.selectedIndex, "0", "Should have the deck element at index 0 selected");
-
- // Now scale it up by using a deck with 7 child nodes, and remove the
- // first three, making sure that the selectedIndex is decremented
- // each time.
- deck = $("deck4");
- let expectedIndex = 5;
- is(deck.selectedIndex, String(expectedIndex),
- "Should have the deck element at index " + expectedIndex + " selected");
-
- for (let i = 0; i < 3; ++i) {
- deck.firstChild.remove();
- expectedIndex--;
- is(deck.selectedIndex, String(expectedIndex),
- "Should have the deck element at index " + expectedIndex + " selected");
- }
-
- // Check that removing the currently selected node doesn't change
- // behaviour.
- deck.childNodes[expectedIndex].remove();
- is(deck.selectedIndex, String(expectedIndex),
- "The selectedIndex should not change when removing the node " +
- "at the selected index.");
-
- // Finally, make sure we haven't changed the behaviour when removing
- // nodes at indexes greater than the selected node.
- deck = $("deck5");
- expectedIndex = 2;
- is(deck.selectedIndex, String(expectedIndex),
- "Should have the deck element at index " + expectedIndex + " selected");
-
- // And then remove all of the nodes, starting from last to first, making
- // sure that the selectedIndex does not change.
- while (deck.lastChild) {
- deck.lastChild.remove();
- is(deck.selectedIndex, String(expectedIndex),
- "Should have the deck element at index " + expectedIndex + " selected");
- }
-}
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_dialogfocus.xul b/toolkit/content/tests/chrome/test_dialogfocus.xul
deleted file mode 100644
index 80474e2b9..000000000
--- a/toolkit/content/tests/chrome/test_dialogfocus.xul
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window width="500" height="600"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<button id="test" label="Test"/>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script>
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestCompleteLog();
-
-var expected = [ "one", "_extra2", "tab", "one", "tabbutton2", "tabbutton", "two", "textbox-yes", "one" ];
-// non-Mac will always focus the default button if any of the dialog buttons
-// would be focused
-if (navigator.platform.indexOf("Mac") == -1)
- expected[1] = "_accept";
-
-var step = 0;
-var fullKeyboardAccess = false;
-
-function startTest()
-{
- var testButton = document.getElementById("test");
- synthesizeKey("VK_TAB", { });
- fullKeyboardAccess = (document.activeElement == testButton);
- info("We " + (fullKeyboardAccess ? "have" : "don't have") + " full keyboard access");
- runTest();
-}
-
-function runTest()
-{
- step++;
- info("runTest(), step = " + step + ", expected = " + expected[step - 1]);
- if (step > expected.length || (!fullKeyboardAccess && step == 2)) {
- info("finishing");
- SimpleTest.finish();
- return;
- }
-
- var expectedFocus = expected[step - 1];
- var win = window.openDialog("dialog_dialogfocus.xul", "_new", "chrome,dialog", step);
-
- function checkDialogFocus(event)
- {
- info("checkDialogFocus()");
- // if full keyboard access is not on, just skip the tests
- var match = false;
- if (fullKeyboardAccess) {
- if (!(event.target instanceof Element)) {
- info("target not an Element");
- return;
- }
-
- if (expectedFocus == "textbox-yes")
- match = (win.document.activeElement == win.document.getElementById(expectedFocus).inputField);
- else if (expectedFocus[0] == "_")
- match = (win.document.activeElement.dlgType == expectedFocus.substring(1));
- else
- match = (win.document.activeElement.id == expectedFocus);
- info("match = " + match);
- if (!match)
- return;
- }
- else {
- match = (win.document.activeElement == win.document.documentElement);
- info("match = " + match);
- }
-
- win.removeEventListener("focus", checkDialogFocus, true);
- ok(match, "focus step " + step);
-
- win.close();
- SimpleTest.waitForFocus(runTest, window);
- }
-
- win.addEventListener("focus", checkDialogFocus, true);
-}
-
-SimpleTest.waitForFocus(startTest, window);
-
-]]>
-
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_findbar.xul b/toolkit/content/tests/chrome/test_findbar.xul
deleted file mode 100644
index 9cbe73c47..000000000
--- a/toolkit/content/tests/chrome/test_findbar.xul
+++ /dev/null
@@ -1,47 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=257061
-https://bugzilla.mozilla.org/show_bug.cgi?id=288254
--->
-<window title="Mozilla Bug 257061 and Bug 288254"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=257061">Mozilla Bug 257061</a>
-<a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=288254">Mozilla Bug 288254</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 257061 and Bug 288254 **/
-SimpleTest.waitForExplicitFinish();
-
-// Since bug 978861, this pref is set to `false` on OSX. For this test, we'll
-// set it `true` to disable the find clipboard on OSX, which interferes with
-// our tests.
-SpecialPowers.pushPrefEnv({
- set: [["accessibility.typeaheadfind.prefillwithselection", true]]
-}, () => {
- window.open("findbar_window.xul", "findbartest", "chrome,width=600,height=600");
-});
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_findbar_entireword.xul b/toolkit/content/tests/chrome/test_findbar_entireword.xul
deleted file mode 100644
index dc39fe09d..000000000
--- a/toolkit/content/tests/chrome/test_findbar_entireword.xul
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=269442
--->
-<window title="Mozilla Bug 269442"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/MochiKit/packed.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=269442">
- Mozilla Bug 269442
- </a>
-
- <p id="display"></p>
- <div id="content" style="display: none">
- </div>
- <pre id="test">
- </pre>
- </body>
-
- <script class="testbody" type="application/javascript">
- <![CDATA[
-
- /** Test for Bug 269442 **/
- SimpleTest.waitForExplicitFinish();
- window.open("findbar_entireword_window.xul", "269442test",
- "chrome,width=600,height=600");
-
- ]]>
- </script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_findbar_events.xul b/toolkit/content/tests/chrome/test_findbar_events.xul
deleted file mode 100644
index d75e5ccb5..000000000
--- a/toolkit/content/tests/chrome/test_findbar_events.xul
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=793275
--->
-<window title="Mozilla Bug 793275"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a target="_blank"
- href="https://bugzilla.mozilla.org/show_bug.cgi?id=793275">
- Mozilla Bug 793275
- </a>
-
- <p id="display"></p>
- <div id="content" style="display: none">
- </div>
- <pre id="test">
- </pre>
- </body>
-
- <script class="testbody" type="application/javascript">
- <![CDATA[
-
- /** Test for Bug 793275 **/
- SimpleTest.waitForExplicitFinish();
- window.open("findbar_events_window.xul", "793275test",
- "chrome,width=600,height=600");
-
- ]]>
- </script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_focus_anons.xul b/toolkit/content/tests/chrome/test_focus_anons.xul
deleted file mode 100644
index 848590887..000000000
--- a/toolkit/content/tests/chrome/test_focus_anons.xul
+++ /dev/null
@@ -1,119 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Tests for focus on elements with anonymous focusable children"
- onload="SimpleTest.waitForFocus(runTests);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<label accesskey="a" control="menulist"/>
-<label accesskey="b" control="textbox"/>
-<label accesskey="c" control="scale"/>
-
-<menulist id="menulist" editable="true">
- <menupopup>
- <menuitem label="One"/>
- </menupopup>
-</menulist>
-<textbox id="textbox"/>
-<scale id="scale"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var gBlurs = 0, gFocuses = 0;
-var gExpectedBlur = "";
-var gExpectedFocus = "";
-
-function blurOccurred(event) {
- gBlurs++;
- is(event.originalTarget, gExpectedBlur, "blur " + gBlurs + "," + event.originalTarget.localName);
-}
-
-function focusOccurred(event) {
- gFocuses++;
- is(event.originalTarget, gExpectedFocus, "focus " + gFocuses + "," + event.originalTarget.localName);
-}
-
-function runTests()
-{
- addEventListener("focus", focusOccurred, true);
- addEventListener("blur", blurOccurred, true);
-
- gExpectedBlur = null;
- gExpectedFocus = $("menulist").inputField;
- $("menulist").focus();
-
- gExpectedBlur = gExpectedFocus;
- gExpectedFocus = $("textbox").inputField;
- $("textbox").focus();
-
- gExpectedBlur = gExpectedFocus;
- gExpectedFocus = document.getAnonymousNodes($("scale"))[0];
- $("scale").focus();
-
- var accessKeyDetails = (navigator.platform.indexOf("Mac") >= 0) ?
- { altKey: true, ctrlKey : true } :
- { altKey : true, shiftKey: true };
-
- gExpectedBlur = document.getAnonymousNodes($("scale"))[0];
- gExpectedFocus = $("menulist").inputField;
- synthesizeKey("a", accessKeyDetails);
-
- gExpectedBlur = gExpectedFocus;
- gExpectedFocus = $("textbox").inputField;
- synthesizeKey("b", accessKeyDetails);
-
- gExpectedBlur = gExpectedFocus;
- gExpectedFocus = document.getAnonymousNodes($("scale"))[0];
- synthesizeKey("c", accessKeyDetails);
-
- if (navigator.platform.indexOf("Mac") == -1) {
- gExpectedBlur = gExpectedFocus;
- gExpectedFocus = $("textbox").inputField;
- synthesizeKey("VK_TAB", { shiftKey: true });
-
- gExpectedBlur = gExpectedFocus;
- gExpectedFocus = $("menulist").inputField;
- synthesizeKey("VK_TAB", { shiftKey: true });
-
- gExpectedBlur = gExpectedFocus;
- gExpectedFocus = $("textbox").inputField;
- synthesizeKey("VK_TAB", { });
-
- gExpectedBlur = gExpectedFocus;
- gExpectedFocus = document.getAnonymousNodes($("scale"))[0];
- synthesizeKey("VK_TAB", { });
-
- is(gBlurs, 9, "correct number of blurs");
- is(gFocuses, 10, "correct number of focuses");
- }
- else {
- is(gBlurs, 5, "correct number of blurs");
- is(gFocuses, 6, "correct number of focuses");
- }
-
- removeEventListener("focus", focusOccurred, true);
- removeEventListener("blur", blurOccurred, true);
-
- SimpleTest.finish();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_hiddenitems.xul b/toolkit/content/tests/chrome/test_hiddenitems.xul
deleted file mode 100644
index 7e44852df..000000000
--- a/toolkit/content/tests/chrome/test_hiddenitems.xul
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=317422
--->
-<window title="Mozilla Bug 317422"
- 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="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=317422"
- target="_blank">Mozilla Bug 317422</a>
- </body>
-
- <richlistbox id="richlistbox" seltype="multiple">
- <richlistitem id="richlistbox_item1"><label value="Item 1"/></richlistitem>
- <richlistitem id="richlistbox_item2"><label value="Item 2"/></richlistitem>
- <richlistitem id="richlistbox_item3" hidden="true"><label value="Item 3"/></richlistitem>
- <richlistitem id="richlistbox_item4"><label value="Item 4"/></richlistitem>
- <richlistitem id="richlistbox_item5" collapsed="true"><label value="Item 5"/></richlistitem>
- <richlistitem id="richlistbox_item6"><label value="Item 6"/></richlistitem>
- <richlistitem id="richlistbox_item7" hidden="true"><label value="Item 7"/></richlistitem>
- </richlistbox>
-
- <listbox id="listbox" seltype="multiple">
- <listitem id="listbox_item1" label="Item 1"/>
- <listitem id="listbox_item2" label="Item 2"/>
- <listitem id="listbox_item3" label="Item 3" hidden="true"/>
- <listitem id="listbox_item4" label="Item 4"/>
- <listitem id="listbox_item5" label="Item 5" collapsed="true"/>
- <listitem id="listbox_item6" label="Item 6"/>
- <listitem id="listbox_item7" label="Item 7" hidden="true"/>
- </listbox>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-/** Test for Bug 317422 **/
-SimpleTest.waitForExplicitFinish();
-
-function testListbox(id)
-{
- var listbox = document.getElementById(id);
- listbox.focus();
- is(listbox.getRowCount(), 7, id + ": Returned the wrong number of rows");
- is(listbox.getItemAtIndex(2).id, id + "_item3", id + ": Should still return hidden items");
- listbox.selectedIndex = 0;
- is(listbox.selectedItem.id, id + "_item1", id + ": First item was not selected");
- sendKey("DOWN");
- is(listbox.selectedItem.id, id + "_item2", id + ": Down didn't move to second item");
- sendKey("DOWN");
- is(listbox.selectedItem.id, id + "_item4", id + ": Down didn't skip hidden item");
- sendKey("DOWN");
- is(listbox.selectedItem.id, id + "_item6", id + ": Down didn't skip collapsed item");
- sendKey("UP");
- is(listbox.selectedItem.id, id + "_item4", id + ": Up didn't skip collapsed item");
- sendKey("UP");
- is(listbox.selectedItem.id, id + "_item2", id + ": Up didn't skip hidden item");
- listbox.selectAll();
- is(listbox.selectedItems.length, 7, id + ": Should have still selected all items");
- listbox.invertSelection();
- is(listbox.selectedItems.length, 0, id + ": Should have unselected all items");
- listbox.selectedIndex = 2;
- ok(listbox.selectedItem == listbox.getItemAtIndex(2), id + ": Should have selected the hidden item");
- listbox.selectedIndex = 0;
- sendKey("END");
- is(listbox.selectedItem.id, id + "_item6", id + ": Should have moved to the last unhidden item");
- sendMouseEvent({type: 'click'}, id + "_item1");
- ok(listbox.selectedItem == listbox.getItemAtIndex(0), id + ": Should have selected the first item");
- is(listbox.selectedItems.length, 1, id + ": Should only be one selected item");
- sendMouseEvent({type: 'click', shiftKey: true}, id + "_item6");
- is(listbox.selectedItems.length, 4, id + ": Should have selected all visible items");
- listbox.selectedIndex = 0;
- sendKey("PAGE_DOWN");
- is(listbox.selectedItem.id, id + "_item6", id + ": Page down should go to the last visible item");
- sendKey("PAGE_UP");
- is(listbox.selectedItem.id, id + "_item1", id + ": Page up should go to the first visible item");
-}
-
-window.onload = function runTests() {
- testListbox("richlistbox");
- testListbox("listbox");
- SimpleTest.finish();
-};
- ]]></script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_hiddenpaging.xul b/toolkit/content/tests/chrome/test_hiddenpaging.xul
deleted file mode 100644
index 37b109718..000000000
--- a/toolkit/content/tests/chrome/test_hiddenpaging.xul
+++ /dev/null
@@ -1,161 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=317422
--->
-<window title="Mozilla Bug 317422"
- 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="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
- <style xmlns="http://www.w3.org/1999/xhtml">
- /* This makes the richlistbox about 4.5 rows high */
- richlistitem {
- height: 30px;
- }
- richlistbox {
- height: 135px;
- }
- </style>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=317422"
- target="_blank">Mozilla Bug 317422</a>
- </body>
-
- <richlistbox id="richlistbox" seltype="multiple">
- <richlistitem id="richlistbox_item1"><label value="Item 1"/></richlistitem>
- <richlistitem id="richlistbox_item2"><label value="Item 2"/></richlistitem>
- <richlistitem id="richlistbox_item3" hidden="true"><label value="Item 3"/></richlistitem>
- <richlistitem id="richlistbox_item4"><label value="Item 4"/></richlistitem>
- <richlistitem id="richlistbox_item5" collapsed="true"><label value="Item 5"/></richlistitem>
- <richlistitem id="richlistbox_item6"><label value="Item 6"/></richlistitem>
- <richlistitem id="richlistbox_item7"><label value="Item 7"/></richlistitem>
- <richlistitem id="richlistbox_item8"><label value="Item 8"/></richlistitem>
- <richlistitem id="richlistbox_item9"><label value="Item 9"/></richlistitem>
- <richlistitem id="richlistbox_item10"><label value="Item 10"/></richlistitem>
- <richlistitem id="richlistbox_item11"><label value="Item 11"/></richlistitem>
- <richlistitem id="richlistbox_item12"><label value="Item 12"/></richlistitem>
- <richlistitem id="richlistbox_item13"><label value="Item 13"/></richlistitem>
- <richlistitem id="richlistbox_item14"><label value="Item 14"/></richlistitem>
- <richlistitem id="richlistbox_item15" hidden="true"><label value="Item 15"/></richlistitem>
- </richlistbox>
-
- <listbox id="listbox" seltype="multiple" rows="5">
- <listitem id="listbox_item1" label="Item 1"/>
- <listitem id="listbox_item2" label="Item 2"/>
- <listitem id="listbox_item3" label="Item 3" hidden="true"/>
- <listitem id="listbox_item4" label="Item 4"/>
- <listitem id="listbox_item5" label="Item 5" hidden="true"/>
- <listitem id="listbox_item6" label="Item 6"/>
- <listitem id="listbox_item7" label="Item 7"/>
- <listitem id="listbox_item8" label="Item 8"/>
- <listitem id="listbox_item9" label="Item 9"/>
- <listitem id="listbox_item10" label="Item 10"/>
- <listitem id="listbox_item11" label="Item 11"/>
- <listitem id="listbox_item12" label="Item 12"/>
- <listitem id="listbox_item13" label="Item 13"/>
- <listitem id="listbox_item14" label="Item 14"/>
- <listitem id="listbox_item15" label="Item 15" hidden="true"/>
- </listbox>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-/** Test for Bug 317422 **/
-SimpleTest.waitForExplicitFinish();
-
-function testRichlistbox()
-{
- var id = "richlistbox";
- var listbox = document.getElementById(id);
- listbox.focus();
- listbox.selectedIndex = 0;
- sendKey("PAGE_DOWN");
- is(listbox.selectedItem.id, id + "_item7", id + ": Page down should go to the item one visible page away");
- is(listbox.getIndexOfFirstVisibleRow(), 6, id + ": Page down should have scrolled down a visible page");
- sendKey("PAGE_DOWN");
- is(listbox.selectedItem.id, id + "_item11", id + ": Second page down should go to the item two visible pages away");
- is(listbox.getIndexOfFirstVisibleRow(), 9, id + ": Second page down should not scroll beyond the end");
- sendKey("PAGE_DOWN");
- is(listbox.selectedItem.id, id + "_item14", id + ": Third page down should go to the last visible item");
- is(listbox.getIndexOfFirstVisibleRow(), 9, id + ": Third page down should not have scrolled at all");
- sendKey("PAGE_UP");
- is(listbox.selectedItem.id, id + "_item10", id + ": Page up should go to the item one visible page away");
- is(listbox.getIndexOfFirstVisibleRow(), 5, id + ": Page up should scroll up a visible page");
- sendKey("PAGE_UP");
- is(listbox.selectedItem.id, id + "_item6", id + ": Second page up should go to the item two visible pages away");
- is(listbox.getIndexOfFirstVisibleRow(), 0, id + ": Second page up should not scroll beyond the start");
- sendKey("PAGE_UP");
- is(listbox.selectedItem.id, id + "_item1", id + ": Third page up should return to the first visible item");
- is(listbox.getIndexOfFirstVisibleRow(), 0, id + ": Third page up should not have scrolled at all");
-}
-
-function testListbox()
-{
- var id = "listbox";
- var listbox = document.getElementById(id);
-
- if (!window.matchMedia("(-moz-overlay-scrollbars)").matches) {
- // Check that a scrollbar is visible by comparing the width of the listitem
- // with the width of the listbox. This is a simple way to do this without
- // checking the anonymous content.
- ok(listbox.firstChild.getBoundingClientRect().width < listbox.getBoundingClientRect().width - 10,
- id + ": Scrollbar visible");
- }
-
- var rowHeight = listbox.firstChild.getBoundingClientRect().height;
-
- listbox.focus();
- listbox.selectedIndex = 0;
- sendKey("PAGE_DOWN");
- is(listbox.selectedItem.id, id + "_item8", id + ": Page down should go to the item one visible page away");
- is(listbox.getIndexOfFirstVisibleRow(), 7, id + ": Page down should have scrolled down a visible page");
- sendKey("PAGE_DOWN");
- is(listbox.selectedItem.id, id + "_item13", id + ": Second page down should go to the item two visible pages away");
- is(listbox.getIndexOfFirstVisibleRow(), 9, id + ": Second page down should not scroll beyond the end");
- sendKey("PAGE_DOWN");
- is(listbox.selectedItem.id, id + "_item14", id + ": Third page down should go to the last visible item");
- is(listbox.getIndexOfFirstVisibleRow(), 9, id + ": Third page down should not have scrolled at all");
- sendKey("PAGE_UP");
- is(listbox.selectedItem.id, id + "_item9", id + ": Page up should go to the item one visible page away");
- // the listScrollbox seems to go haywire when scrolling up with hidden listitems
- todo_is(listbox.getIndexOfFirstVisibleRow(), 3, id + ": Page up should scroll up a visible page");
- sendKey("PAGE_UP");
- is(listbox.selectedItem.id, id + "_item2", id + ": Second page up should go to the item two visible pages away");
- is(listbox.getIndexOfFirstVisibleRow(), 0, id + ": Second page up should not scroll beyond the start");
- sendKey("PAGE_UP");
- is(listbox.selectedItem.id, id + "_item1", id + ": Third page up should return to the first visible item");
- is(listbox.getIndexOfFirstVisibleRow(), 0, id + ": Third page up should not have scrolled at all");
-
- var scrollHeight = document.getAnonymousNodes(listbox)[1].lastChild.scrollHeight;
- is(scrollHeight, rowHeight * 15, id + ": scrollHeight when rows set");
-
- listbox.minHeight = 50;
- scrollHeight = document.getAnonymousNodes(listbox)[1].lastChild.scrollHeight;
- is(scrollHeight, rowHeight * 15, id + ": scrollHeight when rows and minimium height set");
-
- listbox.removeAttribute("rows");
-
- var availHeight = document.getAnonymousNodes(listbox)[1].lastChild.getBoundingClientRect().height;
- // The listbox layout adds this extra height in GetPrefSize. Not sure what it's for though.
- var e = (rowHeight * 15 - availHeight) % rowHeight;
- var extraHeight = (e == 0) ? 0 : rowHeight - e;
-
- scrollHeight = document.getAnonymousNodes(listbox)[1].lastChild.scrollHeight;
- is(scrollHeight, rowHeight * 15 + extraHeight, id + ": scrollHeight when minimium height set");
-
- listbox.removeAttribute("minheight");
- scrollHeight = document.getAnonymousNodes(listbox)[1].lastChild.scrollHeight;
- is(scrollHeight, rowHeight * 15 + extraHeight, id + ": scrollHeight");
-}
-
-window.onload = function runTests() {
- testRichlistbox();
- testListbox();
- SimpleTest.finish();
-};
- ]]></script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_keys.xul b/toolkit/content/tests/chrome/test_keys.xul
deleted file mode 100644
index 97cc8a241..000000000
--- a/toolkit/content/tests/chrome/test_keys.xul
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Keys Test"
- onload="setTimeout(runTest, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-<script>
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- window.open("window_keys.xul", "_blank", "chrome,width=200,height=200");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_labelcontrol.xul b/toolkit/content/tests/chrome/test_labelcontrol.xul
deleted file mode 100644
index b33667be0..000000000
--- a/toolkit/content/tests/chrome/test_labelcontrol.xul
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for label control="value"
- -->
-<window title="tabindex" width="500" height="600"
- onload="runTests()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<label id="lab" control="ctl"/>
-<textbox id="ctl" value="Test"/>
-<checkbox id="chk" value="Checkbox"/>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script>
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function runTests()
-{
- is($("lab").control, "ctl", "control");
- is($("lab").labeledControlElement, $("ctl"), "labeledControlElement");
- is($("ctl").labelElement, $("lab"), "labelElement");
- is($("chk").labelElement.className, "checkbox-label", "labelElement");
-
- SimpleTest.finish();
-}
-
-]]>
-
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_largemenu.xul b/toolkit/content/tests/chrome/test_largemenu.xul
deleted file mode 100644
index 8841e2b16..000000000
--- a/toolkit/content/tests/chrome/test_largemenu.xul
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Large Menu Tests"
- onload="setTimeout(runTest, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-<script>
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- window.open("window_largemenu.xul", "_blank", "chrome,width=200,height=200");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_menu.xul b/toolkit/content/tests/chrome/test_menu.xul
deleted file mode 100644
index 877efadb1..000000000
--- a/toolkit/content/tests/chrome/test_menu.xul
+++ /dev/null
@@ -1,85 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menu Destruction Test"
- onload="runTests();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
- <menubar>
- <menu label="top" id="top">
- <menupopup>
- <menuitem label="top item"/>
-
- <menu label="hello" id="nested">
- <menupopup>
- <menuitem label="item1"/>
- <menuitem label="item2" id="item2"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- </menubar>
-
- <script class="testbody" type="application/javascript">
- <![CDATA[
-
- SimpleTest.waitForExplicitFinish();
-
- function runTests()
- {
- var menu = document.getElementById("nested");
-
- // nsIDOMXULContainerElement::getIndexOfItem();
- var item = document.getElementById("item2");
- is(menu.getIndexOfItem(item), 1,
- "nsIDOMXULContainerElement::getIndexOfItem() failed.");
-
- // nsIDOMXULContainerElement::getItemAtIndex();
- var itemAtIdx = menu.getItemAtIndex(1);
- is(itemAtIdx, item,
- "nsIDOMXULContainerElement::getItemAtIndex() failed.");
-
- // nsIDOMXULContainerElement::itemCount
- is(menu.itemCount, 2, "nsIDOMXULContainerElement::itemCount failed.");
-
- // nsIDOMXULContainerElement::parentContainer
- var topmenu = document.getElementById("top");
- is(menu.parentContainer, topmenu,
- "nsIDOMXULContainerElement::parentContainer failed.");
-
- // nsIDOMXULContainerElement::appendItem();
- var item = menu.appendItem("item3");
- is(menu.getIndexOfItem(item), 2,
- "nsIDOMXULContainerElement::appendItem() failed.");
-
- // nsIDOMXULContainerElement::insertItemAt();
- var item = menu.insertItemAt(0, "itemZero");
- is(item, menu.getItemAtIndex(0),
- "nsIDOMXULContainerElement::insertItemAt() failed.");
-
- // nsIDOMXULContainerElement::removeItemAt();
- var item = menu.removeItemAt(0);
- is(3, menu.itemCount,
- "nsIDOMXULContainerElement::removeItemAt() failed.");
-
- SimpleTest.finish();
- }
-
- ]]>
- </script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display">
- </p>
- <div id="content" style="display: none">
- </div>
- <pre id="test">
- </pre>
- </body>
-
-</window>
-
diff --git a/toolkit/content/tests/chrome/test_menu_anchored.xul b/toolkit/content/tests/chrome/test_menu_anchored.xul
deleted file mode 100644
index 8fdda3f25..000000000
--- a/toolkit/content/tests/chrome/test_menu_anchored.xul
+++ /dev/null
@@ -1,77 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- Test for menus with the anchor attribute set
- -->
-<window title="Anchored Menus Test"
- align="start"
- onload="setTimeout(runTest, 0,'tb1');"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="application/javascript" src="xul_selectcontrol.js"/>
-
-<hbox>
-
-<toolbarbutton id="tb1" type="menu-button" label="Open" anchor="dropmarker">
- <menupopup id="popup1"
- onpopupshown="checkPopup(this, document.getAnonymousElementByAttribute(this.parentNode, 'anonid', 'dropmarker'))"
- onpopuphidden="runTest('tb2')">
- <menuitem label="Item"/>
- </menupopup>
-</toolbarbutton>
-
-<toolbarbutton id="tb2" type="menu-button" label="Open" anchor="someanchor">
- <menupopup id="popup2" onpopupshown="checkPopup(this, $('someanchor'))" onpopuphidden="runTest('tb3')">
- <menuitem label="Item"/>
- </menupopup>
-</toolbarbutton>
-
-<toolbarbutton id="tb3" type="menu-button" label="Open" anchor="noexist">
- <menupopup id="popup3" onpopupshown="checkPopup(this, this.parentNode)" onpopuphidden="SimpleTest.finish()">
- <menuitem label="Item"/>
- </menupopup>
-</toolbarbutton>
-
-</hbox>
-
-<hbox pack="end" width="180">
- <button id="someanchor" label="Anchor"/>
-</hbox>
-
-<!-- test results are displayed in the html:body -->
-<body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
-<script type="application/javascript"><![CDATA[
-
-function runTest(menuid)
-{
- let menu = $(menuid);
- let dropmarker = document.getAnonymousElementByAttribute(menu, "anonid", "dropmarker");
-
- synthesizeMouseAtCenter(dropmarker, { });
-}
-
-function isWithinHalfPixel(a, b)
-{
- return Math.abs(a - b) <= 0.5;
-}
-
-function checkPopup(popup, anchor)
-{
- let popupRect = popup.getBoundingClientRect();
- let anchorRect = anchor.getBoundingClientRect();
-
- ok(isWithinHalfPixel(popupRect.left, anchorRect.left), popup.id + " left");
- ok(isWithinHalfPixel(popupRect.top, anchorRect.bottom), popup.id + " top");
-
- popup.hidePopup();
-}
-
-SimpleTest.waitForExplicitFinish();
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_menu_hide.xul b/toolkit/content/tests/chrome/test_menu_hide.xul
deleted file mode 100644
index b5ce934db..000000000
--- a/toolkit/content/tests/chrome/test_menu_hide.xul
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menu Destruction Test"
- onload="setTimeout(runTests, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<menu id="menu">
- <menupopup onpopupshown="this.firstChild.open = true" onpopuphidden="if (event.target == this) done()">
- <menu id="submenu" label="One">
- <menupopup onpopupshown="submenuOpened();">
- <menuitem label="Two"/>
- </menupopup>
- </menu>
- </menupopup>
-</menu>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function runTests()
-{
- $("menu").open = true;
-}
-
-function submenuOpened()
-{
- var submenu = $("submenu")
- is(submenu.getAttribute('_moz-menuactive'), "true", "menu highlighted");
- submenu.hidden = true;
- $("menu").open = false;
-}
-
-function done()
-{
- ok(!$("submenu").hasAttribute('_moz-menuactive'), "menu unhighlighted");
- SimpleTest.finish();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_menuchecks.xul b/toolkit/content/tests/chrome/test_menuchecks.xul
deleted file mode 100644
index 8128b738c..000000000
--- a/toolkit/content/tests/chrome/test_menuchecks.xul
+++ /dev/null
@@ -1,147 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menu Checkbox and Radio Tests"
- onload="runTest()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
- <hbox>
- <button id="menu" type="menu" label="View">
- <menupopup id="popup" onpopupshown="popupShown()" onpopuphidden="popupHidden()">
- <menuitem id="toolbar" label="Show Toolbar" type="checkbox"/>
- <menuitem id="statusbar" label="Show Status Bar" type="checkbox" checked="true"/>
- <menuitem id="bookmarks" label="Show Bookmarks" type="checkbox" autocheck="false"/>
- <menuitem id="history" label="Show History" type="checkbox" autocheck="false" checked="true"/>
- <menuseparator/>
- <menuitem id="byname" label="By Name" type="radio" name="sort"/>
- <menuitem id="bydate" label="By Date" type="radio" name="sort" checked="true"/>
- <menuseparator/>
- <menuitem id="ascending" label="Ascending" type="radio" name="order" checked="true"/>
- <menuitem id="descending" label="Descending" type="radio" name="order" autocheck="false"/>
- <menuitem id="bysubject" label="By Subject" type="radio" name="sort"/>
- </menupopup>
- </button>
-
- </hbox>
-
- <!--
- This test checks that checkbox and radio menu items work properly
- -->
- <script class="testbody" type="application/javascript">
- <![CDATA[
-
- SimpleTest.waitForExplicitFinish();
- var gTestIndex = 0;
-
- // tests to perform
- var tests = [
- {
- testname: "select unchecked checkbox",
- item: "toolbar",
- checked: ["toolbar", "statusbar", "history", "bydate", "ascending"]
- },
- {
- testname: "select checked checkbox",
- item: "statusbar",
- checked: ["toolbar", "history", "bydate", "ascending"]
- },
- {
- testname: "select unchecked autocheck checkbox",
- item: "bookmarks",
- checked: ["toolbar", "history", "bydate", "ascending"]
- },
- {
- testname: "select checked autocheck checkbox",
- item: "history",
- checked: ["toolbar", "history", "bydate", "ascending"]
- },
- {
- testname: "select unchecked radio",
- item: "byname",
- checked: ["toolbar", "history", "byname", "ascending"]
- },
- {
- testname: "select checked radio",
- item: "byname",
- checked: ["toolbar", "history", "byname", "ascending"]
- },
- {
- testname: "select out of order checked radio",
- item: "bysubject",
- checked: ["toolbar", "history", "bysubject", "ascending"]
- },
- {
- testname: "select first radio again",
- item: "byname",
- checked: ["toolbar", "history", "byname", "ascending"]
- },
- {
- testname: "select autocheck radio",
- item: "descending",
- checked: ["toolbar", "history", "byname", "ascending"]
- }
- ];
-
- function runTest()
- {
- checkMenus(["statusbar", "history", "bydate", "ascending"], "initial");
- document.getElementById("menu").open = true;
- }
-
- function checkMenus(checkedItems, testname)
- {
- var isok = true;
- var children = document.getElementById("popup").childNodes;
- for (var c = 0; c < children.length; c++) {
- var child = children[c];
- if ((checkedItems.indexOf(child.id) != -1 && child.getAttribute("checked") != "true") ||
- (checkedItems.indexOf(child.id) == -1 && child.hasAttribute("checked"))) {
- isok = false;
- break;
- }
- }
-
- ok(isok, testname);
- }
-
- function popupShown()
- {
- var test = tests[gTestIndex];
- synthesizeMouse(document.getElementById(test.item), 4, 4, { });
- }
-
- function popupHidden()
- {
- if (gTestIndex < tests.length) {
- var test = tests[gTestIndex];
- checkMenus(test.checked, test.testname);
- gTestIndex++;
- if (gTestIndex < tests.length) {
- document.getElementById("menu").open = true;
- }
- else {
- // manually setting the checkbox should also update the radio state
- document.getElementById("bydate").setAttribute("checked", "true");
- checkMenus(["toolbar", "history", "bydate", "ascending"], "set checked attribute on radio");
- SimpleTest.finish();
- }
- }
- }
-
- ]]>
- </script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_menuitem_blink.xul b/toolkit/content/tests/chrome/test_menuitem_blink.xul
deleted file mode 100644
index 319c284fd..000000000
--- a/toolkit/content/tests/chrome/test_menuitem_blink.xul
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Blinking Context Menu Item Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
- <menulist id="menulist">
- <menupopup id="menupopup">
- <menuitem label="Menu Item" id="menuitem"/>
- </menupopup>
- </menulist>
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.waitForFocus(startTest);
-
-function startTest() {
- if (!/Mac/.test(navigator.platform)) {
- ok(true, "Nothing to test on non-Mac.");
- SimpleTest.finish();
- return;
- }
- // Destroy frame while removing the _moz-menuactive attribute.
- test_crash("REMOVAL", test2);
-}
-
-function test2() {
- // Destroy frame while adding the _moz-menuactive attribute.
- test_crash("ADDITION", test3);
-}
-
-function test3() {
- // Don't mess with the frame, just test whether we've blinked.
- test_crash("", SimpleTest.finish);
-}
-
-function test_crash(when, andThen) {
- var menupopup = document.getElementById("menupopup");
- var menuitem = document.getElementById("menuitem");
- var attrChanges = { "REMOVAL": 0, "ADDITION": 0 };
- var storedEvent = null;
- menupopup.addEventListener("popupshown", function () {
- menupopup.removeEventListener("popupshown", arguments.callee, false);
- menuitem.addEventListener("mouseup", function (e) {
- menuitem.removeEventListener("mouseup", arguments.callee, true);
- menuitem.addEventListener("DOMAttrModified", function (e) {
- if (e.attrName == "_moz-menuactive") {
- if (!attrChanges[e.attrChange])
- attrChanges[e.attrChange] = 1;
- else
- attrChanges[e.attrChange]++;
- storedEvent = e;
- if (e.attrChange == e[when]) {
- menuitem.hidden = true;
- menuitem.getBoundingClientRect();
- ok(true, "Didn't crash on _moz-menuactive " + when.toLowerCase() + " during blinking")
- menuitem.hidden = false;
- menuitem.removeEventListener("DOMAttrModified", arguments.callee, false);
- SimpleTest.executeSoon(function () {
- menupopup.hidePopup();
- });
- }
- }
- }, false);
- }, true);
- menupopup.addEventListener("popuphidden", function() {
- menupopup.removeEventListener("popuphidden", arguments.callee, false);
- if (!when) {
- // Test whether we've blinked at all.
- var shouldBlink = navigator.platform.match(/Mac/);
- var expectedNumRemoval = shouldBlink ? 2 : 1;
- var expectedNumAddition = shouldBlink ? 1 : 0;
- ok(storedEvent, "got DOMAttrModified events after clicking menuitem")
- is(attrChanges[storedEvent.REMOVAL], expectedNumRemoval, "blinking unset attributes correctly");
- is(attrChanges[storedEvent.ADDITION], expectedNumAddition, "blinking set attributes correctly");
- }
- SimpleTest.executeSoon(andThen);
- }, false);
- synthesizeMouse(menuitem, 10, 5, { type : "mousemove" });
- synthesizeMouse(menuitem, 10, 5, { type : "mousemove" });
- synthesizeMouse(menuitem, 10, 5, { type : "mousedown" });
- SimpleTest.executeSoon(function () {
- synthesizeMouse(menuitem, 10, 5, { type : "mouseup" });
- });
- }, false);
- document.getElementById("menulist").open = true;
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_menuitem_commands.xul b/toolkit/content/tests/chrome/test_menuitem_commands.xul
deleted file mode 100644
index e31774ccc..000000000
--- a/toolkit/content/tests/chrome/test_menuitem_commands.xul
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menuitem Commands Test"
- onload="runOrOpen()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-<script>
-<![CDATA[
-SimpleTest.waitForExplicitFinish();
-
-function checkAttributes(elem, label, accesskey, disabled, hidden, isAfter)
-{
- var is = window.opener.wrappedJSObject.SimpleTest.is;
-
- is(elem.getAttribute("label"), label, elem.id + " label " + (isAfter ? "after" : "before") + " open");
- is(elem.getAttribute("accesskey"), accesskey, elem.id + " accesskey " + (isAfter ? "after" : "before") + " open");
- is(elem.getAttribute("disabled"), disabled, elem.id + " disabled " + (isAfter ? "after" : "before") + " open");
- is(elem.getAttribute("hidden"), hidden, elem.id + " hidden " + (isAfter ? "after" : "before") + " open");
-}
-
-function runOrOpen()
-{
- if (window.opener) {
- SimpleTest.waitForFocus(runTest);
- }
- else {
- window.open("test_menuitem_commands.xul", "", "chrome");
- }
-}
-
-function runTest()
-{
- runTestSet("");
- runTestSet("bar");
- window.close();
- window.opener.wrappedJSObject.SimpleTest.finish();
-}
-
-function runTestSet(suffix)
-{
- var isMac = (navigator.platform.indexOf("Mac") >= 0);
-
- var one = $("one" + suffix);
- var two = $("two" + suffix);
- var three = $("three" + suffix);
- var four = $("four" + suffix);
-
- checkAttributes(one, "One", "", "", "true", false);
- checkAttributes(two, "", "", "false", "", false);
- checkAttributes(three, "Three", "T", "true", "", false);
- checkAttributes(four, "Four", "F", "", "", false);
-
- if (isMac && suffix) {
- var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
- utils.forceUpdateNativeMenuAt("0");
- }
- else {
- $("menu" + suffix).open = true;
- }
-
- checkAttributes(one, "One", "", "", "false", true);
- checkAttributes(two, "Cat", "C", "", "", true);
- checkAttributes(three, "Dog", "D", "false", "true", true);
- checkAttributes(four, "Four", "F", "true", "", true);
-
- $("menu" + suffix).open = false;
-}
-]]>
-</script>
-
-<command id="cmd_one" hidden="false"/>
-<command id="cmd_two" label="Cat" accesskey="C"/>
-<command id="cmd_three" label="Dog" accesskey="D" disabled="false" hidden="true"/>
-<command id="cmd_four" disabled="true"/>
-
-<button id="menu" type="menu">
- <menupopup>
- <menuitem id="one" label="One" hidden="true" command="cmd_one"/>
- <menuitem id="two" disabled="false" command="cmd_two"/>
- <menuitem id="three" label="Three" accesskey="T" disabled="true" command="cmd_three"/>
- <menuitem id="four" label="Four" accesskey="F" command="cmd_four"/>
- </menupopup>
-</button>
-
-<menubar>
- <menu id="menubar" label="Sample">
- <menupopup>
- <menuitem id="onebar" label="One" hidden="true" command="cmd_one"/>
- <menuitem id="twobar" disabled="false" command="cmd_two"/>
- <menuitem id="threebar" label="Three" accesskey="T" disabled="true" command="cmd_three"/>
- <menuitem id="fourbar" label="Four" accesskey="F" command="cmd_four"/>
- </menupopup>
- </menu>
-</menubar>
-
-<body xmlns="http://www.w3.org/1999/xhtml"><p id="display"/></body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_menulist.xul b/toolkit/content/tests/chrome/test_menulist.xul
deleted file mode 100644
index 4e3817d89..000000000
--- a/toolkit/content/tests/chrome/test_menulist.xul
+++ /dev/null
@@ -1,314 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menulist Tests"
- onload="setTimeout(testtag_menulists, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="application/javascript" src="xul_selectcontrol.js"></script>
-
-<vbox id="scroller" style="overflow: auto" height="60">
- <menulist id="menulist" onpopupshown="test_menulist_open(this, this.parentNode)"
- onpopuphidden="$('menulist-in-listbox').open = true;">
- <menupopup id="menulist-popup"/>
- </menulist>
- <button label="Two"/>
- <button label="Three"/>
-</vbox>
-<listbox id="scroller-in-listbox" style="overflow: auto" height="60">
- <listitem allowevents="true">
- <menulist id="menulist-in-listbox" onpopupshown="test_menulist_open(this, this.parentNode.parentNode)"
- onpopuphidden="SimpleTest.executeSoon(checkScrollAndFinish)">
- <menupopup id="menulist-in-listbox-popup">
- <menuitem label="One" value="one"/>
- <menuitem label="Two" value="two"/>
- </menupopup>
- </menulist>
- </listitem>
- <listitem label="Two"/>
- <listitem label="Three"/>
- <listitem label="Four"/>
- <listitem label="Five"/>
- <listitem label="Six"/>
-</listbox>
-
-<hbox>
- <menulist id="menulist-size">
- <menupopup>
- <menuitem label="Menuitem Label" width="200"/>
- </menupopup>
- </menulist>
-</hbox>
-
-<menulist id="menulist-editable" editable="true">
- <menupopup id="menulist-popup-editable"/>
-</menulist>
-
-<menulist id="menulist-initwithvalue" value="two">
- <menupopup>
- <menuitem label="One" value="one"/>
- <menuitem label="Two" value="two"/>
- <menuitem label="Three" value="three"/>
- </menupopup>
-</menulist>
-<menulist id="menulist-initwithselected" value="two">
- <menupopup>
- <menuitem label="One" value="one"/>
- <menuitem label="Two" value="two"/>
- <menuitem label="Three" value="three" selected="true"/>
- </menupopup>
-</menulist>
-<menulist id="menulist-editable-initwithvalue" editable="true" value="Two">
- <menupopup>
- <menuitem label="One" value="one"/>
- <menuitem label="Two" value="two"/>
- <menuitem label="Three" value="three"/>
- </menupopup>
-</menulist>
-<menulist id="menulist-editable-initwithselected" editable="true" value="two">
- <menupopup>
- <menuitem label="One" value="one"/>
- <menuitem label="Two" value="two"/>
- <menuitem label="Three" value="three" selected="true"/>
- </menupopup>
-</menulist>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function testtag_menulists()
-{
- testtag_menulist_UI_start($("menulist"), false);
-}
-
-function testtag_menulist_UI_start(element, editable)
-{
- var testprefix = editable ? "editable" : "";
-
- // check the menupopup property
- var popup = element.menupopup;
- ok(popup && popup.localName == "menupopup" &&
- popup.parentNode == element, testprefix + " menupopup");
-
- // test the interfaces that menulist implements
- test_nsIDOMXULMenuListElement(element, testprefix, editable);
-}
-
-function testtag_menulist_UI_finish(element, editable)
-{
- element.value = "";
-
- test_nsIDOMXULSelectControlElement(element, "menuitem",
- editable ? "editable" : null);
-
- if (!editable) {
- testtag_menulist_UI_start($("menulist-editable"), true);
- }
- else {
- // bug 566154, the menulist width should account for vertical scrollbar
- ok(document.getElementById("menulist-size").getBoundingClientRect().width >= 210,
- "menulist popup width includes scrollbar width");
-
- $("menulist").open = true;
- }
-}
-
-function test_nsIDOMXULMenuListElement(element, testprefix, editable)
-{
- is(element.open, false, testprefix + " open");
- is(element.editable, editable, testprefix + " editable");
-
- if (editable) {
- var inputField = element.inputField;
- is(inputField &&
- inputField instanceof Components.interfaces.nsIDOMHTMLInputElement,
- true, testprefix + " inputField");
-
- // check if the select method works
- inputField.select();
- is(inputField.selectionStart, 0, testprefix + " empty select selectionStart");
- is(inputField.selectionEnd, 0, testprefix + " empty select selectionEnd");
-
- element.value = "Some Text";
- inputField.select();
- is(inputField.selectionStart, 0, testprefix + " empty select selectionStart");
- is(inputField.selectionEnd, 9, testprefix + " empty select selectionEnd");
- }
- else {
- is(element.inputField, null , testprefix + " inputField");
- }
-
- element.appendItem("Item One", "one");
- var seconditem = element.appendItem("Item Two", "two");
- var thirditem = element.appendItem("Item Three", "three");
- element.appendItem("Item Four", "four");
-
- seconditem.image = "happy.png";
- seconditem.setAttribute("description", "This is the second description");
- thirditem.image = "happy.png";
- thirditem.setAttribute("description", "This is the third description");
-
- // check the image and description properties
- // editable menulists don't use the image or description properties currently
- if (editable) {
- element.selectedIndex = 1;
- is(element.image, "", testprefix + " image set to selected");
- is(element.description, "", testprefix + " description set to selected");
- test_nsIDOMXULMenuListElement_finish(element, testprefix, editable);
- }
- else {
- element.selectedIndex = 1;
- is(element.image, "happy.png", testprefix + " image set to selected");
- is(element.description, "This is the second description", testprefix + " description set to selected");
- element.selectedIndex = -1;
- is(element.image, "", testprefix + " image set when none selected");
- is(element.description, "", testprefix + " description set when none selected");
- element.selectedIndex = 2;
- is(element.image, "happy.png", testprefix + " image set to selected again");
- is(element.description, "This is the third description", testprefix + " description set to selected again");
-
- // check that changing the properties of the selected item changes the menulist's properties
- let properties = [{attr: "label", value: "Item Number Three"},
- {attr: "value", value: "item-three"},
- {attr: "image", value: "smile.png"},
- {attr: "description", value: "Changed description"}];
- test_nsIDOMXULMenuListElement_properties(element, testprefix, editable, thirditem, properties);
- }
-}
-
-function test_nsIDOMXULMenuListElement_properties(element, testprefix, editable, thirditem, properties)
-{
- let {attr, value} = properties.shift();
- let last = (properties.length == 0);
-
- let mutObserver = new MutationObserver(() => {
- is(element.getAttribute(attr), value, `${testprefix} ${attr} modified`);
- done();
- });
- mutObserver.observe(element, { attributeFilter: [attr] });
-
- let failureTimeout = setTimeout(() => {
- ok(false, `${testprefix} ${attr} should have updated`);
- done();
- }, 2000);
-
- function done()
- {
- clearTimeout(failureTimeout);
- mutObserver.disconnect();
- if (!last) {
- test_nsIDOMXULMenuListElement_properties(element, testprefix, editable, thirditem, properties);
- }
- else {
- test_nsIDOMXULMenuListElement_unselected(element, testprefix, editable, thirditem);
- }
- }
-
- thirditem.setAttribute(attr, value)
-}
-
-function test_nsIDOMXULMenuListElement_unselected(element, testprefix, editable, thirditem)
-{
- let seconditem = thirditem.previousElementSibling;
- seconditem.label = "Changed Label 2";
- is(element.label, "Item Number Three", testprefix + " label of another item modified");
-
- element.selectedIndex = 0;
- is(element.image, "", testprefix + " image set to selected with no image");
- is(element.description, "", testprefix + " description set to selected with no description");
- test_nsIDOMXULMenuListElement_finish(element, testprefix, editable);
-}
-
-function test_nsIDOMXULMenuListElement_finish(element, testprefix, editable)
-{
- // check the removeAllItems method
- element.appendItem("An Item", "anitem");
- element.appendItem("Another Item", "anotheritem");
- element.removeAllItems();
- is(element.itemCount, 0, testprefix + " removeAllItems");
-
- testtag_menulist_UI_finish(element, editable);
-}
-
-function test_menulist_open(element, scroller)
-{
- element.appendItem("Scroll Item 1", "scrollitem1");
- element.appendItem("Scroll Item 2", "scrollitem2");
- element.focus();
- element.selectedIndex = 0;
-
-/*
- // bug 530504, mousewheel while menulist is open should not scroll menulist
- // items or parent
- var scrolled = false;
- var mouseScrolled = function (event) { scrolled = true; }
- window.addEventListener("DOMMouseScroll", mouseScrolled, false);
- synthesizeWheel(element, 2, 2, { deltaY: 10,
- deltaMode: WheelEvent.DOM_DELTA_LINE });
- is(scrolled, true, "mousescroll " + element.id);
- is(scroller.scrollTop, 0, "scroll position on mousescroll " + element.id);
- window.removeEventListener("DOMMouseScroll", mouseScrolled, false);
-*/
-
- // bug 543065, hovering the mouse over an item should highlight it, not
- // scroll the parent, and not change the selected index.
- var item = element.menupopup.childNodes[1];
-
- synthesizeMouse(element.menupopup.childNodes[1], 2, 2, { type: "mousemove" });
- synthesizeMouse(element.menupopup.childNodes[1], 6, 6, { type: "mousemove" });
- is(element.menuBoxObject.activeChild, item, "activeChild after menu highlight " + element.id);
- is(element.selectedIndex, 0, "selectedIndex after menu highlight " + element.id);
- is(scroller.scrollTop, 0, "scroll position after menu highlight " + element.id);
-
- element.open = false;
-}
-
-function checkScrollAndFinish()
-{
- is($("scroller").scrollTop, 0, "mousewheel on menulist does not scroll vbox parent");
- is($("scroller-in-listbox").scrollTop, 0, "mousewheel on menulist does not scroll listbox parent");
-
- // bug 561243, outline causes the mouse click to be targeted incorrectly
- var editableMenulist = $("menulist-editable");
- editableMenulist.className = "outlined";
-
- synthesizeMouse(editableMenulist.inputField, 25, 8, { type: "mousedown" });
- synthesizeMouse(editableMenulist.inputField, 25, 8, { type: "mouseup" });
- isnot(editableMenulist.inputField.selectionStart, editableMenulist.inputField.textLength,
- "mouse event on editable menulist with outline caret position");
-
- let menulist = $("menulist-size");
- menulist.addEventListener("popupshown", function testAltClose() {
- menulist.removeEventListener("popupshown", testAltClose);
-
- sendKey("ALT");
- is(menulist.menupopup.state, "open", "alt doesn't close menulist");
- menulist.open = false;
-
- SimpleTest.finish();
- });
-
- menulist.open = true;
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<style>
-.outlined > .menulist-editable-box { outline: 1px solid black; }
-</style>
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_menulist_keynav.xul b/toolkit/content/tests/chrome/test_menulist_keynav.xul
deleted file mode 100644
index c2e404c09..000000000
--- a/toolkit/content/tests/chrome/test_menulist_keynav.xul
+++ /dev/null
@@ -1,272 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menulist Key Navigation Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<button id="button1" label="One"/>
-<menulist id="list">
- <menupopup id="popup" onpopupshowing="return gShowPopup;">
- <menuitem id="i1" label="One"/>
- <menuitem id="i2" label="Two"/>
- <menuitem id="i2b" disabled="true" label="Two and a Half"/>
- <menuitem id="i3" label="Three"/>
- <menuitem id="i4" label="Four"/>
- </menupopup>
-</menulist>
-<button id="button2" label="Two"/>
-<menulist id="list2">
- <menupopup id="popup" onpopupshown="checkCursorNavigation();">
- <menuitem id="b1" label="One"/>
- <menuitem id="b2" label="Two" selected="true"/>
- <menuitem id="b3" label="Three"/>
- <menuitem id="b4" label="Four"/>
- </menupopup>
-</menulist>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var gShowPopup = false;
-var gModifiers = 0;
-var gOpenPhase = false;
-
-var list = $("list");
-let expectCommandEvent;
-
-var iswin = (navigator.platform.indexOf("Win") == 0);
-var ismac = (navigator.platform.indexOf("Mac") == 0);
-
-function runTests()
-{
- list.focus();
-
- // on Mac, up and cursor keys open the menu, but on other platforms, the
- // cursor keys navigate between items without opening the menu
- if (navigator.platform.indexOf("Mac") == -1) {
- expectCommandEvent = true;
- keyCheck(list, "VK_DOWN", 2, "cursor down");
- keyCheck(list, "VK_DOWN", 3, "cursor down skip disabled");
- keyCheck(list, "VK_UP", 2, "cursor up skip disabled");
- keyCheck(list, "VK_UP", 1, "cursor up");
- keyCheck(list, "VK_UP", 4, "cursor up wrap");
- keyCheck(list, "VK_DOWN", 1, "cursor down wrap");
- }
-
- // check that attempting to open the menulist does not change the selection
- synthesizeKey("VK_DOWN", { altKey: navigator.platform.indexOf("Mac") == -1 });
- is(list.selectedItem, $("i1"), "open menulist down selectedItem");
- synthesizeKey("VK_UP", { altKey: navigator.platform.indexOf("Mac") == -1 });
- is(list.selectedItem, $("i1"), "open menulist up selectedItem");
-
- list.selectedItem = $("i1");
-
- pressLetter();
-}
-
-function pressLetter()
-{
- // A command event should be fired only if the menulist is closed, or on Windows,
- // where items are selected immediately.
- expectCommandEvent = !gOpenPhase || iswin;
-
- synthesizeKey("G", { });
- is(list.selectedItem, $("i1"), "letter pressed not found selectedItem");
-
- keyCheck(list, "T", 2, "letter pressed");
-
- if (!gOpenPhase) {
- SpecialPowers.setIntPref("ui.menu.incremental_search.timeout", 0); // prevent to timeout
- keyCheck(list, "T", 2, "same letter pressed");
- SpecialPowers.clearUserPref("ui.menu.incremental_search.timeout");
- }
-
- setTimeout(pressedAgain, 1200);
-}
-
-function pressedAgain()
-{
- keyCheck(list, "T", 3, "letter pressed again");
- SpecialPowers.setIntPref("ui.menu.incremental_search.timeout", 0); // prevent to timeout
- keyCheck(list, "W", 2, "second letter pressed");
- SpecialPowers.clearUserPref("ui.menu.incremental_search.timeout");
- setTimeout(differentPressed, 1200);
-}
-
-function differentPressed()
-{
- keyCheck(list, "O", 1, "different letter pressed");
-
- if (gOpenPhase) {
- list.open = false;
- tabAndScroll();
- }
- else {
- // Run the letter tests again with the popup open
- info("list open phase");
-
- list.selectedItem = $("i1");
-
- // Hide and show the list to avoid using any existing incremental key state.
- list.hidden = true;
- list.clientWidth;
- list.hidden = false;
-
- gShowPopup = true;
- gOpenPhase = true;
-
- list.addEventListener("popupshown", function popupShownListener() {
- list.removeEventListener("popupshown", popupShownListener, false);
- pressLetter();
- }, false);
-
- list.open = true;
- }
-}
-
-function tabAndScroll()
-{
- list = $("list");
-
- if (navigator.platform.indexOf("Mac") == -1) {
- $("button1").focus();
- synthesizeKeyExpectEvent("VK_TAB", { }, list, "focus", "focus to menulist");
- synthesizeKeyExpectEvent("VK_TAB", { }, $("button2"), "focus", "focus to button");
- is(document.activeElement, $("button2"), "tab from menulist focused button");
- }
-
- // now make sure that using a key scrolls the menu correctly
-
- for (let i = 0; i < 65; i++) {
- list.appendItem("Item" + i, "item" + i);
- }
- list.open = true;
- is(list.getBoundingClientRect().width, list.firstChild.getBoundingClientRect().width,
- "menu and popup width match");
- var minScrollbarWidth = window.matchMedia("(-moz-overlay-scrollbars)").matches ? 0 : 3;
- ok(list.getBoundingClientRect().width >= list.getItemAtIndex(0).getBoundingClientRect().width + minScrollbarWidth,
- "menuitem width accounts for scrollbar");
- list.open = false;
-
- list.menupopup.maxHeight = 100;
- list.open = true;
-
- var rowdiff = list.getItemAtIndex(1).getBoundingClientRect().top -
- list.getItemAtIndex(0).getBoundingClientRect().top;
-
- var item = list.getItemAtIndex(10);
- var originalPosition = item.getBoundingClientRect().top;
-
- list.menuBoxObject.activeChild = item;
- ok(item.getBoundingClientRect().top < originalPosition,
- "position of item 1: " + item.getBoundingClientRect().top + " -> " + originalPosition);
-
- originalPosition = item.getBoundingClientRect().top;
-
- synthesizeKey("VK_DOWN", { });
- is(item.getBoundingClientRect().top, originalPosition - rowdiff, "position of item 10");
-
- list.open = false;
-
- checkEnter();
-}
-
-function keyCheck(list, key, index, testname)
-{
- var item = $("i" + index);
- synthesizeKeyExpectEvent(key, { }, item, expectCommandEvent ? "command" : "!command", testname);
- is(list.selectedItem, expectCommandEvent ? item : $("i1"), testname + " selectedItem");
-}
-
-function checkModifiers(event)
-{
- var expectedModifiers = (gModifiers == 1);
- is(event.shiftKey, expectedModifiers, "shift key pressed");
- is(event.ctrlKey, expectedModifiers, "ctrl key pressed");
- is(event.altKey, expectedModifiers, "alt key pressed");
- is(event.metaKey, expectedModifiers, "meta key pressed");
- gModifiers++;
-}
-
-function checkEnter()
-{
- list.addEventListener("popuphidden", checkEnterWithModifiers, false);
- list.addEventListener("command", checkModifiers, false);
- list.open = true;
- synthesizeKey("VK_RETURN", { });
-}
-
-function checkEnterWithModifiers()
-{
- is(gModifiers, 1, "modifiers checked when not set");
-
- ok(!list.open, "list closed on enter press");
- list.removeEventListener("popuphidden", checkEnterWithModifiers, false);
-
- list.addEventListener("popuphidden", verifyPopupOnClose, false);
- list.open = true;
-
- synthesizeKey("VK_RETURN", { shiftKey: true, ctrlKey: true, altKey: true, metaKey: true });
-}
-
-function verifyPopupOnClose()
-{
- is(gModifiers, 2, "modifiers checked when set");
-
- ok(!list.open, "list closed on enter press with modifiers");
- list.removeEventListener("popuphidden", verifyPopupOnClose, false);
-
- list = $("list2");
- list.focus();
- list.open = true;
-}
-
-function checkCursorNavigation()
-{
- var commandEventsCount = 0;
- list.addEventListener("command", event => {
- is(event.target, list.selectedItem, "command event fired on selected item");
- commandEventsCount++;
- }, false);
-
- is(list.selectedIndex, 1, "selectedIndex before cursor down");
- synthesizeKey("VK_DOWN", { });
- is(list.selectedIndex, iswin ? 2 : 1, "selectedIndex after cursor down");
- is(commandEventsCount, iswin ? 1 : 0, "selectedIndex after cursor down command event");
- is(list.menupopup.state, "open", "cursor down popup state");
- synthesizeKey("VK_PAGE_DOWN", { });
- is(list.selectedIndex, iswin ? 3 : 1, "selectedIndex after page down");
- is(commandEventsCount, iswin ? 2 : 0, "selectedIndex after page down command event");
- is(list.menupopup.state, "open", "page down popup state");
-
- synthesizeKey("VK_UP", { altKey: true });
- is(list.open, ismac, "alt+up closes popup");
-
- if (ismac) {
- list.open = false;
- }
-
- SimpleTest.finish();
-}
-
-SimpleTest.waitForFocus(runTests);
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_menulist_null_value.xul b/toolkit/content/tests/chrome/test_menulist_null_value.xul
deleted file mode 100644
index 2545b6cde..000000000
--- a/toolkit/content/tests/chrome/test_menulist_null_value.xul
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menulist value property"
- onload="setTimeout(runTests, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<menulist id="list">
- <menupopup>
- <menuitem id="i0" label="Zero" value="0"/>
- <menuitem id="i1" label="One" value="item1"/>
- <menuitem id="i2" label="Two" value="item2"/>
- <menuitem id="ifalse" label="False" value="false"/>
- <menuitem id="iempty" label="Empty" value=""/>
- </menupopup>
-</menulist>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function runTests()
-{
- var list = document.getElementById("list");
-
- list.value = "item2";
- is(list.value, "item2", "Check list value after setting value");
- is(list.getAttribute("label"), "Two", "Check list label after setting value");
-
- list.selectedItem = null;
- is(list.value, "", "Check list value after setting selectedItem to null");
- is(list.getAttribute("label"), "", "Check list label after setting selectedItem to null");
-
- // select something again to make sure the label is not already empty
- list.selectedIndex = 1;
- is(list.value, "item1", "Check list value after setting selectedIndex");
- is(list.getAttribute("label"), "One", "Check list label after setting selectedIndex");
-
- // check that an item can have the "false" value
- list.value = false;
- is(list.value, "false", "Check list value after setting it to false");
- is(list.getAttribute("label"), "False", "Check list labem after setting value to false");
-
- // check that an item can have the "0" value
- list.value = 0;
- is(list.value, "0", "Check list value after setting it to 0");
- is(list.getAttribute("label"), "Zero", "Check list label after setting value to 0");
-
- // check that an item can have the empty string value.
- list.value = "";
- is(list.value, "", "Check list value after setting it to an empty string");
- is(list.getAttribute("label"), "Empty", "Check list label after setting value to an empty string");
-
- // select something again to make sure the label is not already empty
- list.selectedIndex = 1;
- // set the value to null and test it (bug 408940)
- list.value = null;
- is(list.value, "", "Check list value after setting value to null");
- is(list.getAttribute("label"), "", "Check list label after setting value to null");
-
- // select something again to make sure the label is not already empty
- list.selectedIndex = 1;
- // set the value to undefined and test it (bug 408940)
- list.value = undefined;
- is(list.value, "", "Check list value after setting value to undefined");
- is(list.getAttribute("label"), "", "Check list label after setting value to undefined");
-
- // select something again to make sure the label is not already empty
- list.selectedIndex = 1;
- // set the value to something that does not exist in any menuitem of the list
- // and make sure the previous label is removed
- list.value = "this does not exist";
- is(list.value, "this does not exist", "Check the list value after setting it to something not associated witn an existing menuitem");
- is(list.getAttribute("label"), "", "Check that the list label is empty after selecting a nonexistent item");
-
- SimpleTest.finish();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_menulist_paging.xul b/toolkit/content/tests/chrome/test_menulist_paging.xul
deleted file mode 100644
index c58e0328f..000000000
--- a/toolkit/content/tests/chrome/test_menulist_paging.xul
+++ /dev/null
@@ -1,163 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menulist Tests"
- onload="setTimeout(startTest, 0);"
- onpopupshown="menulistShown()" onpopuphidden="runTest()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<menulist id="menulist1">
- <menupopup id="menulist-popup1">
- <menuitem label="One"/>
- <menuitem label="Two"/>
- <menuitem label="Three"/>
- <menuitem label="Four"/>
- <menuitem label="Five"/>
- <menuitem label="Six"/>
- <menuitem label="Seven"/>
- <menuitem label="Eight"/>
- <menuitem label="Nine"/>
- <menuitem label="Ten"/>
- </menupopup>
-</menulist>
-
-<menulist id="menulist2">
- <menupopup id="menulist-popup2">
- <menuitem label="One" disabled="true"/>
- <menuitem label="Two" selected="true"/>
- <menuitem label="Three"/>
- <menuitem label="Four"/>
- <menuitem label="Five"/>
- <menuitem label="Six"/>
- <menuitem label="Seven"/>
- <menuitem label="Eight"/>
- <menuitem label="Nine"/>
- <menuitem label="Ten" disabled="true"/>
- </menupopup>
-</menulist>
-
-<menulist id="menulist3">
- <menupopup id="menulist-popup3">
- <label value="One"/>
- <menuitem label="Two" selected="true"/>
- <menuitem label="Three"/>
- <menuitem label="Four"/>
- <menuitem label="Five" disabled="true"/>
- <menuitem label="Six" disabled="true"/>
- <menuitem label="Seven"/>
- <menuitem label="Eight"/>
- <menuitem label="Nine"/>
- <label value="Ten"/>
- </menupopup>
-</menulist>
-
-<menulist id="menulist4">
- <menupopup id="menulist-popup4">
- <label value="One"/>
- <menuitem label="Two"/>
- <menuitem label="Three"/>
- <menuitem label="Four"/>
- <menuitem label="Five"/>
- <menuitem label="Six" selected="true"/>
- <menuitem label="Seven"/>
- <menuitem label="Eight"/>
- <menuitem label="Nine"/>
- <label value="Ten"/>
- </menupopup>
-</menulist>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-let test;
-
-// Fields:
-// list - menulist id
-// initial - initial selected index
-// scroll - index of item at top of the visible scrolled area, -1 to skip this test
-// downs - array of indicies that will be selected when pressing down in sequence
-// ups - array of indicies that will be selected when pressing up in sequence
-let tests = [
- { list: "menulist1", initial: 0, scroll: 0, downs: [3, 6, 9, 9],
- ups: [6, 3, 0, 0] },
- { list: "menulist2", initial: 1, scroll: 0, downs: [4, 7, 8, 8],
- ups: [5, 2, 1] },
- { list: "menulist3", initial: 1, scroll: -1, downs: [6, 8, 8],
- ups: [3, 1, 1] },
- { list: "menulist4", initial: 5, scroll: 2, downs: [], ups: [] }
-];
-
-function startTest()
-{
- let popup = document.getElementById("menulist-popup1");
- let menupopupHeight = popup.getBoundingClientRect().height;
- let menuitemHeight = popup.firstChild.getBoundingClientRect().height;
-
- // First, set the height of each popup to the height of four menuitems plus
- // any padding and border on the menupopup.
- let height = menuitemHeight * 4 + (menupopupHeight - menuitemHeight * 10);
- popup.height = height;
- document.getElementById("menulist-popup2").height = height;
- document.getElementById("menulist-popup3").height = height;
- document.getElementById("menulist-popup4").height = height;
-
- runTest();
-}
-
-function runTest()
-{
- if (!tests.length) {
- SimpleTest.finish();
- return;
- }
-
- test = tests.shift();
- document.getElementById(test.list).open = true;
-}
-
-function menulistShown()
-{
- let menulist = document.getElementById(test.list);
- is(menulist.menuBoxObject.activeChild.label, menulist.getItemAtIndex(test.initial).label, test.list + " initial selection");
-
- let cs = window.getComputedStyle(menulist.menupopup);
- let bpTop = parseFloat(cs.paddingTop) + parseFloat(cs.borderTopWidth);
-
- // Skip menulist3 as it has a label that scrolling doesn't need normally deal with.
- if (test.scroll >= 0) {
- is(menulist.menupopup.childNodes[test.scroll].getBoundingClientRect().top,
- menulist.menupopup.getBoundingClientRect().top + bpTop,
- "Popup scroll at correct position");
- }
-
- for (let i = 0; i < test.downs.length; i++) {
- sendKey("PAGE_DOWN");
- is(menulist.menuBoxObject.activeChild.label, menulist.getItemAtIndex(test.downs[i]).label, test.list + " page down " + i);
- }
-
- for (let i = 0; i < test.ups.length; i++) {
- sendKey("PAGE_UP");
- is(menulist.menuBoxObject.activeChild.label, menulist.getItemAtIndex(test.ups[i]).label, test.list + " page up " + i);
- }
-
- menulist.open = false;
-}
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_menulist_position.xul b/toolkit/content/tests/chrome/test_menulist_position.xul
deleted file mode 100644
index a146cb85e..000000000
--- a/toolkit/content/tests/chrome/test_menulist_position.xul
+++ /dev/null
@@ -1,97 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menulist position Test"
- onload="setTimeout(init, 0)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<!--
- This test checks the position of a menulist's popup.
- -->
-
-<script>
-<![CDATA[
-SimpleTest.waitForExplicitFinish();
-
-var menulist;
-
-function init()
-{
- menulist = document.getElementById("menulist");
- menulist.open = true;
-}
-
-function isWithinHalfPixel(a, b)
-{
- return Math.abs(a - b) <= 0.5;
-}
-
-function popupShown()
-{
- var menurect = menulist.getBoundingClientRect();
- var popuprect = menulist.menupopup.getBoundingClientRect();
-
- let marginLeft = parseFloat(getComputedStyle(menulist.menupopup).marginLeft);
- ok(isWithinHalfPixel(menurect.left + marginLeft, popuprect.left), "left position");
- ok(isWithinHalfPixel(menurect.right + marginLeft, popuprect.right), "right position");
-
- let index = menulist.selectedIndex;
- if (menulist.selectedItem && navigator.platform.indexOf("Mac") >= 0) {
- let menulistlabel = document.getAnonymousElementByAttribute(menulist, "class", "menulist-label");
- let mitemlabel = document.getAnonymousElementByAttribute(menulist.selectedItem, "class", "menu-iconic-text");
-
- ok(isWithinHalfPixel(menulistlabel.getBoundingClientRect().left,
- mitemlabel.getBoundingClientRect().left),
- "Labels horizontally aligned for index " + index);
- ok(isWithinHalfPixel(menulistlabel.getBoundingClientRect().top,
- mitemlabel.getBoundingClientRect().top),
- "Labels vertically aligned for index " + index);
- }
- else {
- let marginTop = parseFloat(getComputedStyle(menulist.menupopup).marginTop);
- ok(isWithinHalfPixel(menurect.bottom + marginTop, popuprect.top),
- "Vertical alignment with no selection for index " + index);
- }
-
- menulist.open = false;
-}
-
-function popupHidden()
-{
- if (!menulist.selectedItem) {
- SimpleTest.finish();
- }
- else {
- menulist.selectedItem = menulist.selectedItem.nextSibling;
- menulist.open = true;
- }
-}
-]]>
-</script>
-
-<hbox align="center" pack="center" style="margin-top: 100px;">
- <menulist id="menulist" onpopupshown="popupShown();" onpopuphidden="popupHidden();">
- <menupopup>
- <menuitem label="One"/>
- <menuitem label="Two"/>
- <menuitem label="Three"/>
- <menuitem label="Four"/>
- <menuitem label="Five"/>
- </menupopup>
- </menulist>
-</hbox>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_mousescroll.xul b/toolkit/content/tests/chrome/test_mousescroll.xul
deleted file mode 100644
index 91ccf5683..000000000
--- a/toolkit/content/tests/chrome/test_mousescroll.xul
+++ /dev/null
@@ -1,274 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=378028
--->
-<window title="Mozilla Bug 378028"
- 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="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/paint_listener.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=378028"
- target="_blank">Mozilla Bug 378028</a>
- </body>
-
- <!-- richlistbox currently has no way of giving us a defined number of
- rows, so we just choose an arbitrary height limit that should give
- us plenty of vertical scrollability -->
- <richlistbox id="richlistbox" style="height:50px;">
- <richlistitem id="richlistbox_item0" hidden="true"><label value="Item 0"/></richlistitem>
- <richlistitem id="richlistbox_item1"><label value="Item 1"/></richlistitem>
- <richlistitem id="richlistbox_item2"><label value="Item 2"/></richlistitem>
- <richlistitem id="richlistbox_item3"><label value="Item 3"/></richlistitem>
- <richlistitem id="richlistbox_item4"><label value="Item 4"/></richlistitem>
- <richlistitem id="richlistbox_item5"><label value="Item 5"/></richlistitem>
- <richlistitem id="richlistbox_item6"><label value="Item 6"/></richlistitem>
- <richlistitem id="richlistbox_item7"><label value="Item 7"/></richlistitem>
- <richlistitem id="richlistbox_item8"><label value="Item 8"/></richlistitem>
- </richlistbox>
-
- <listbox id="listbox" rows="2">
- <listitem id="listbox_item0" label="Item 0" hidden="true"/>
- <listitem id="listbox_item1" label="Item 1"/>
- <listitem id="listbox_item2" label="Item 2"/>
- <listitem id="listbox_item3" label="Item 3"/>
- <listitem id="listbox_item4" label="Item 4"/>
- <listitem id="listbox_item5" label="Item 5"/>
- <listitem id="listbox_item6" label="Item 6"/>
- <listitem id="listbox_item7" label="Item 7"/>
- <listitem id="listbox_item8" label="Item 8"/>
- </listbox>
-
- <box orient="horizontal">
- <arrowscrollbox id="hscrollbox" clicktoscroll="true" orient="horizontal"
- smoothscroll="false" style="max-width:80px;" flex="1">
- <hbox style="width:40px; height:20px; background:black;" hidden="true"/>
- <hbox style="width:40px; height:20px; background:white;"/>
- <hbox style="width:40px; height:20px; background:black;"/>
- <hbox style="width:40px; height:20px; background:white;"/>
- <hbox style="width:40px; height:20px; background:black;"/>
- <hbox style="width:40px; height:20px; background:white;"/>
- <hbox style="width:40px; height:20px; background:black;"/>
- <hbox style="width:40px; height:20px; background:white;"/>
- <hbox style="width:40px; height:20px; background:black;"/>
- </arrowscrollbox>
- </box>
-
- <arrowscrollbox id="vscrollbox" clicktoscroll="true" orient="vertical"
- smoothscroll="false" style="max-height:80px;" flex="1">
- <vbox style="width:100px; height:40px; background:black;" hidden="true"/>
- <vbox style="width:100px; height:40px; background:white;"/>
- <vbox style="width:100px; height:40px; background:black;"/>
- <vbox style="width:100px; height:40px; background:white;"/>
- <vbox style="width:100px; height:40px; background:black;"/>
- <vbox style="width:100px; height:40px; background:white;"/>
- <vbox style="width:100px; height:40px; background:black;"/>
- <vbox style="width:100px; height:40px; background:white;"/>
- <vbox style="width:100px; height:40px; background:black;"/>
- <vbox style="width:100px; height:40px; background:white;"/>
- <vbox style="width:100px; height:40px; background:black;"/>
- </arrowscrollbox>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-/** Test for Bug 378028 **/
-/* and for Bug 350471 **/
-var smoothScrollPref = "general.smoothScroll";
-SpecialPowers.setBoolPref(smoothScrollPref, false);
-SimpleTest.waitForExplicitFinish();
-
-const deltaModes = [
- WheelEvent.DOM_DELTA_PIXEL, // 0
- WheelEvent.DOM_DELTA_LINE, // 1
- WheelEvent.DOM_DELTA_PAGE // 2
-];
-
-function testListbox(id)
-{
- var listbox = document.getElementById(id);
-
- function helper(aStart, aDelta, aIntDelta, aDeltaMode)
- {
- listbox.scrollToIndex(aStart);
- synthesizeWheel(listbox, 10, 10,
- { deltaMode: aDeltaMode, deltaY: aDelta,
- lineOrPageDeltaY: aIntDelta });
- var expectedPos = aStart;
- if (aIntDelta) {
- if (aDeltaMode == WheelEvent.DOM_DELTA_PAGE) {
- expectedPos += aIntDelta > 0 ? listbox.getNumberOfVisibleRows() :
- -listbox.getNumberOfVisibleRows();
- } else {
- expectedPos += aIntDelta;
- }
- }
- is(listbox.getIndexOfFirstVisibleRow(), expectedPos,
- "testListbox(" + id + "): vertical, starting " + aStart +
- " delta " + aDelta + " lineOrPageDelta " + aIntDelta +
- " aDeltaMode " + aDeltaMode);
-
- // Check that horizontal scrolling has no effect
- listbox.scrollToIndex(aStart);
- synthesizeWheel(listbox, 10, 10,
- { deltaMode: aDeltaMode, deltaX: aDelta,
- lineOrPageDeltaX: aIntDelta });
- is(listbox.getIndexOfFirstVisibleRow(), aStart,
- "testListbox(" + id + "): horizontal, starting " + aStart +
- " delta " + aDelta + " lineOrPageDelta " + aIntDelta +
- " aDeltaMode " + aDeltaMode);
- }
- deltaModes.forEach(function(aDeltaMode) {
- let delta = (aDeltaMode == WheelEvent.DOM_DELTA_PIXEL) ? 5.0 : 0.3;
- helper(5, -delta, 0, aDeltaMode);
- helper(5, -delta, -1, aDeltaMode);
- helper(5, delta, 1, aDeltaMode);
- helper(5, delta, 0, aDeltaMode);
- });
-}
-
-function testRichListbox(id, andThen)
-{
- var listbox = document.getElementById(id);
- var tests = [];
-
- var winUtils = SpecialPowers.getDOMWindowUtils(window);
- winUtils.advanceTimeAndRefresh(100);
-
- function nextTest() {
- var [aStart, aDelta, aIntDelta, aDeltaMode] = tests.shift();
- listbox.scrollToIndex(aStart);
-
- let event = {
- deltaMode: aDeltaMode,
- deltaY: aDelta,
- lineOrPageDeltaY: aIntDelta
- };
- sendWheelAndPaint(listbox, 10, 10, event, function() {
- var change = listbox.getIndexOfFirstVisibleRow() - aStart;
- var direction = (change > 0) - (change < 0);
- var expected = (aDelta > 0) - (aDelta < 0);
- is(direction, expected,
- "testRichListbox(" + id + "): vertical, starting " + aStart +
- " delta " + aDelta + " lineOrPageDeltaY " + aIntDelta +
- " aDeltaMode " + aDeltaMode);
-
- // Check that horizontal scrolling has no effect
- let event = {
- deltaMode: aDeltaMode,
- deltaX: aDelta,
- lineOrPageDeltaX: aIntDelta
- };
-
- listbox.scrollToIndex(aStart);
- sendWheelAndPaint(listbox, 10, 10, event, function() {
- is(listbox.getIndexOfFirstVisibleRow(), aStart,
- "testRichListbox(" + id + "): horizontal, starting " + aStart +
- " delta " + aDelta + " lineOrPageDeltaX " + aIntDelta +
- " aDeltaMode " + aDeltaMode);
-
- if (!tests.length) {
- winUtils.restoreNormalRefresh();
- andThen();
- return;
- }
-
- nextTest();
- });
- });
- }
-
- // richlistbox currently uses native XUL scrolling, so the "line"
- // amounts don't necessarily correspond 1-to-1 with listbox items. So
- // we just check that scrolling up/down scrolls in the right direction.
- deltaModes.forEach(function(aDeltaMode) {
- let delta = (aDeltaMode == WheelEvent.DOM_DELTA_PIXEL) ? 32.0 : 2.0;
- tests.push([5, -delta, -1, aDeltaMode]);
- tests.push([5, -delta, 0, aDeltaMode]);
- tests.push([5, delta, 1, aDeltaMode]);
- tests.push([5, delta, 0, aDeltaMode]);
- });
-
- nextTest();
-}
-
-function testArrowScrollbox(id)
-{
- var scrollbox = document.getElementById(id);
- var scrollBoxObject = scrollbox.scrollBoxObject;
- var orient = scrollbox.getAttribute("orient");
-
- function helper(aStart, aDelta, aDeltaMode, aExpected)
- {
- var lineOrPageDelta = (aDeltaMode == WheelEvent.DOM_DELTA_PIXEL) ? aDelta / 10 : aDelta;
- var orientIsHorizontal = (orient == "horizontal");
-
- scrollBoxObject.scrollTo(aStart, aStart);
-
- for (var i = orientIsHorizontal ? 2 : 0; i >= 0; i--) {
- synthesizeWheel(scrollbox, 5, 5,
- { deltaMode: aDeltaMode, deltaY: aDelta,
- lineOrPageDeltaY: lineOrPageDelta });
-
- var pos = orientIsHorizontal ? scrollBoxObject.positionX :
- scrollBoxObject.positionY;
-
- // Note, vertical mouse scrolling is allowed to scroll horizontal
- // arrowscrollboxes, because many users have no horizontal mouse scroll
- // capability
- let expected = !i ? aExpected : aStart;
- is(pos, expected,
- "testArrowScrollbox(" + id + "): vertical, starting " + aStart +
- " delta " + aDelta + " lineOrPageDelta " + lineOrPageDelta +
- " aDeltaMode " + aDeltaMode);
- }
-
- scrollBoxObject.scrollTo(aStart, aStart);
- for (var i = orientIsHorizontal ? 2 : 0; i >= 0; i--) {
- synthesizeWheel(scrollbox, 5, 5,
- { deltaMode: aDeltaMode, deltaX: aDelta,
- lineOrPageDeltaX: lineOrPageDelta });
- // horizontal mouse scrolling is never allowed to scroll vertical
- // arrowscrollboxes
- var pos = orientIsHorizontal ? scrollBoxObject.positionX :
- scrollBoxObject.positionY;
- let expected = (!i && orientIsHorizontal) ? aExpected : aStart;
- is(pos, expected,
- "testArrowScrollbox(" + id + "): horizontal, starting " + aStart +
- " delta " + aDelta + " lineOrPageDelta " + lineOrPageDelta +
- " aDeltaMode " + aDeltaMode);
- }
- }
-
- var scrolledWidth = scrollBoxObject.scrolledWidth;
- var scrolledHeight = scrollBoxObject.scrolledHeight;
- var scrollMaxX = scrolledWidth - scrollBoxObject.width;
- var scrollMaxY = scrolledHeight - scrollBoxObject.height;
- var scrollMax = orient == "horizontal" ? scrollMaxX : scrollMaxY;
-
- deltaModes.forEach(function(aDeltaMode) {
- helper(50, -1000, aDeltaMode, 0);
- helper(50, 1000, aDeltaMode, scrollMax);
- helper(50, 0, aDeltaMode, 50);
- helper(50, 0, aDeltaMode, 50);
- });
-}
-
-function runTests()
-{
- testRichListbox("richlistbox", function() {
- testListbox("listbox");
- testArrowScrollbox("hscrollbox");
- testArrowScrollbox("vscrollbox");
- SpecialPowers.clearUserPref(smoothScrollPref);
- SimpleTest.finish();
- });
-}
-
-window.onload = function() { setTimeout(runTests, 0); };
- ]]></script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_notificationbox.xul b/toolkit/content/tests/chrome/test_notificationbox.xul
deleted file mode 100644
index a99d0824e..000000000
--- a/toolkit/content/tests/chrome/test_notificationbox.xul
+++ /dev/null
@@ -1,522 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for notificationbox
- -->
-<window title="Notification Box" width="500" height="600"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <notificationbox id="nb"/>
- <menupopup id="menupopup" onpopupshown="this.hidePopup()" onpopuphidden="checkPopupClosed()">
- <menuitem label="One"/>
- </menupopup>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-SimpleTest.waitForExplicitFinish();
-
-var testtag_notificationbox_buttons = [
- {
- label: "Button 1",
- accesskey: "u",
- callback: testtag_notificationbox_buttonpressed,
- popup: "menupopup"
- }
-];
-
-var NSXUL = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-
-function testtag_notificationbox_buttonpressed(event)
-{
-}
-
-function testtag_notificationbox(nb)
-{
- testtag_notificationbox_State(nb, "initial", null, 0);
-
- SimpleTest.is(nb.notificationsHidden, false, "initial notificationsHidden");
- SimpleTest.is(nb.removeAllNotifications(false), undefined, "initial removeAllNotifications");
- testtag_notificationbox_State(nb, "initial removeAllNotifications", null, 0);
- SimpleTest.is(nb.removeAllNotifications(true), undefined, "initial removeAllNotifications immediate");
- testtag_notificationbox_State(nb, "initial removeAllNotifications immediate", null, 0);
-
- runTimedTests(tests, -1, nb, null);
-}
-
-var notification_last_events = [];
-function notification_eventCallback(event)
-{
- notification_last_events.push({ actualEvent: event , item: this });
-}
-
-/**
- * For any notifications that have the notification_eventCallback on
- * them, we will have recorded instances of those callbacks firing
- * and stored them. This checks to see that the expected event types
- * are being fired in order, and targeting the right item.
- *
- * @param {Array<string>} expectedEvents
- * The list of event types, in order, that we expect to have been
- * fired on the item.
- * @param {<xul:notification>} ntf
- * The notification we expect the callback to have been fired from.
- * @param {string} testName
- * The name of the current test, for logging.
- */
-function testtag_notification_eventCallback(expectedEvents, ntf, testName)
-{
- for (let i = 0; i < expectedEvents; ++i) {
- let expected = expectedEvents[i];
- let { actualEvent, item } = notification_last_events[i];
- SimpleTest.is(actualEvent, expected, testName + ": event name");
- SimpleTest.is(item, ntf, testName + ": event item");
- }
- notification_last_events = [];
-}
-
-var tests =
-[
- {
- test: function(nb, ntf) {
- // append a new notification
- var ntf = nb.appendNotification("Notification", "note", "happy.png",
- nb.PRIORITY_INFO_LOW, testtag_notificationbox_buttons);
- SimpleTest.is(ntf && ntf.localName == "notification", true, "append notification");
- return ntf;
- },
- result: function(nb, ntf) {
- testtag_notificationbox_State(nb, "append", ntf, 1);
- testtag_notification_State(nb, ntf, "append", "Notification", "note",
- "happy.png", nb.PRIORITY_INFO_LOW);
-
- // check the getNotificationWithValue method
- var ntf_found = nb.getNotificationWithValue("note");
- SimpleTest.is(ntf, ntf_found, "getNotificationWithValue note");
-
- var none_found = nb.getNotificationWithValue("notenone");
- SimpleTest.is(none_found, null, "getNotificationWithValue null");
- return ntf;
- }
- },
- {
- test: function(nb, ntf) {
- // check that notifications can be removed properly
- nb.removeNotification(ntf);
- return ntf;
- },
- result: function(nb, ntf) {
- testtag_notificationbox_State(nb, "removeNotification", null, 0);
-
- // try removing the notification again to make sure an exception occurs
- var exh = false;
- try {
- nb.removeNotification(ntf);
- } catch (ex) { exh = true; }
- SimpleTest.is(exh, true, "removeNotification again");
- testtag_notificationbox_State(nb, "removeNotification again", null, 0);
-
- }
- },
- {
- test: function(nb, ntf) {
- // append a new notification, but now with an event callback
- var ntf = nb.appendNotification("Notification", "note", "happy.png",
- nb.PRIORITY_INFO_LOW,
- testtag_notificationbox_buttons,
- notification_eventCallback);
- SimpleTest.is(ntf && ntf.localName == "notification", true, "append notification with callback");
- return ntf;
- },
- result: function(nb, ntf) {
- testtag_notificationbox_State(nb, "append with callback", ntf, 1);
- return ntf;
- }
- },
- {
- test: function(nb, ntf) {
- nb.removeNotification(ntf);
- return ntf;
- },
- result: function(nb, ntf) {
- testtag_notificationbox_State(nb, "removeNotification with callback",
- null, 0);
-
- testtag_notification_eventCallback(["removed"], ntf, "removeNotification()");
- return ntf;
- }
- },
- {
- test: function(nb, ntf) {
- var ntf = nb.appendNotification("Notification", "note", "happy.png",
- nb.PRIORITY_INFO_LOW,
- testtag_notificationbox_buttons,
- notification_eventCallback);
- SimpleTest.is(ntf && ntf.localName == "notification", true, "append notification with callback");
- return ntf;
- },
- result: function(nb, ntf) {
- testtag_notificationbox_State(nb, "append with callback", ntf, 1);
- return ntf;
- }
- },
- {
- test: function(rb, ntf) {
- // Dismissing the notification instead of removing it should
- // fire a dismissed "event" on the callback, followed by
- // a removed "event".
- ntf.dismiss();
- return ntf;
- },
- result: function(nb, ntf) {
- testtag_notificationbox_State(nb, "called dismiss()", null, 0);
- testtag_notification_eventCallback(["dismissed", "removed"], ntf,
- "dismiss()");
- return ntf;
- }
- },
- {
- test: function(nb, ntf) {
- // Create a popup to be used by a menu-button.
- var doc = nb.ownerDocument;
- var menuPopup = doc.createElementNS(NSXUL, "menupopup");
- var menuItem = menuPopup.appendChild(doc.createElementNS(NSXUL, "menuitem"));
- menuItem.setAttribute("label", "Menu Item");
- // Append a notification with a button of type 'menu-button'.
- ntf = nb.appendNotification(
- "Notification", "note", "happy.png",
- nb.PRIORITY_WARNING_LOW,
- [{
- label: "Button",
- type: "menu-button",
- popup: menuPopup
- }]
- );
-
- return ntf;
- },
- result: function(nb, ntf) {
- testtag_notificationbox_State(nb, "append", ntf, 1);
- testtag_notification_State(nb, ntf, "append", "Notification", "note",
- "happy.png", nb.PRIORITY_WARNING_LOW);
- var button = ntf.querySelector(".notification-button");
- SimpleTest.is(button.type, "menu-button", "Button type should be set");
- var menuPopup = button.getElementsByTagNameNS(NSXUL, "menupopup");
- SimpleTest.is(menuPopup.length, 1, "There should be a menu attached");
- var menuItem = menuPopup[0].firstChild;
- SimpleTest.is(menuItem.localName, "menuitem", "There should be a menu item");
- SimpleTest.is(menuItem.getAttribute("label"), "Menu Item", "Label should match");
- // Clean up.
- nb.removeNotification(ntf);
-
- return [1, null];
- }
- },
- {
- repeat: true,
- test: function(nb, arr) {
- var idx = arr[0];
- var ntf = arr[1];
- switch (idx) {
- case 1:
- // append a new notification
- ntf = nb.appendNotification("Notification", "note", "happy.png",
- nb.PRIORITY_INFO_LOW, testtag_notificationbox_buttons);
- SimpleTest.is(ntf && ntf.localName == "notification", true, "append notification");
-
- // Test persistence
- ntf.persistence++;
-
- return [idx, ntf];
- case 2:
- case 3:
- nb.removeTransientNotifications();
-
- return [idx, ntf];
- }
- },
- result: function(nb, arr) {
- var idx = arr[0];
- var ntf = arr[1];
- switch (idx) {
- case 1:
- testtag_notificationbox_State(nb, "notification added", ntf, 1);
- testtag_notification_State(nb, ntf, "append", "Notification", "note",
- "happy.png", nb.PRIORITY_INFO_LOW);
- SimpleTest.is(ntf.persistence, 1, "persistence is 1");
-
- return [++idx, ntf];
- case 2:
- testtag_notificationbox_State(nb, "first removeTransientNotifications", ntf, 1);
- testtag_notification_State(nb, ntf, "append", "Notification", "note",
- "happy.png", nb.PRIORITY_INFO_LOW);
- SimpleTest.is(ntf.persistence, 0, "persistence is now 0");
-
- return [++idx, ntf];
- case 3:
- testtag_notificationbox_State(nb, "second removeTransientNotifications", null, 0);
-
- this.repeat = false;
- }
- }
- },
- {
- test: function(nb, ntf) {
- // append another notification
- var ntf = nb.appendNotification("Notification", "note", "happy.png",
- nb.PRIORITY_INFO_MEDIUM, testtag_notificationbox_buttons);
- SimpleTest.is(ntf && ntf.localName == "notification", true, "append notification again");
- return ntf;
- },
- result: function(nb, ntf) {
- // check that appending a second notification after removing the first one works
- testtag_notificationbox_State(nb, "append again", ntf, 1);
- testtag_notification_State(nb, ntf, "append again", "Notification", "note",
- "happy.png", nb.PRIORITY_INFO_MEDIUM);
- return ntf;
- }
- },
- {
- test: function(nb, ntf) {
- // check the removeCurrentNotification method
- nb.removeCurrentNotification();
- return ntf;
- },
- result: function(nb, ntf) {
- testtag_notificationbox_State(nb, "removeCurrentNotification", null, 0);
- }
- },
- {
- test: function(nb, ntf) {
- var ntf = nb.appendNotification("Notification", "note", "happy.png",
- nb.PRIORITY_INFO_HIGH, testtag_notificationbox_buttons);
- return ntf;
- },
- result: function(nb, ntf) {
- // test the removeAllNotifications method
- testtag_notificationbox_State(nb, "append info_high", ntf, 1);
- SimpleTest.is(ntf.priority, nb.PRIORITY_INFO_HIGH,
- "notification.priority " + nb.PRIORITY_INFO_HIGH);
- SimpleTest.is(nb.removeAllNotifications(false), undefined, "removeAllNotifications");
- }
- },
- {
- test: function(nb, unused) {
- // add a number of notifications and check that they are added in order
- nb.appendNotification("Four", "4", null, nb.PRIORITY_INFO_HIGH, testtag_notificationbox_buttons);
- nb.appendNotification("Seven", "7", null, nb.PRIORITY_WARNING_HIGH, testtag_notificationbox_buttons);
- nb.appendNotification("Two", "2", null, nb.PRIORITY_INFO_LOW, null);
- nb.appendNotification("Eight", "8", null, nb.PRIORITY_CRITICAL_LOW, null);
- nb.appendNotification("Five", "5", null, nb.PRIORITY_WARNING_LOW, null);
- nb.appendNotification("Six", "6", null, nb.PRIORITY_WARNING_HIGH, null);
- nb.appendNotification("One", "1", null, nb.PRIORITY_INFO_LOW, null);
- nb.appendNotification("Nine", "9", null, nb.PRIORITY_CRITICAL_MEDIUM, null);
- var ntf = nb.appendNotification("Ten", "10", null, nb.PRIORITY_CRITICAL_HIGH, null);
- nb.appendNotification("Three", "3", null, nb.PRIORITY_INFO_MEDIUM, null);
- return ntf;
- },
- result: function(nb, ntf) {
- SimpleTest.is(nb.currentNotification == ntf ?
- nb.currentNotification.value : null, "10", "appendNotification order");
- return 1;
- }
- },
- {
- // test closing notifications to make sure that the current notification is still set properly
- repeat: true,
- test: function(nb, testidx) {
- switch (testidx) {
- case 1:
- nb.getNotificationWithValue("10").close();
- return [1, 9];
- case 2:
- nb.removeNotification(nb.getNotificationWithValue("9"));
- return [2, 8];
- case 3:
- nb.removeCurrentNotification();
- return [3, 7];
- case 4:
- nb.getNotificationWithValue("6").close();
- return [4, 7];
- case 5:
- nb.removeNotification(nb.getNotificationWithValue("5"));
- return [5, 7];
- case 6:
- nb.removeCurrentNotification();
- return [6, 4];
- }
- },
- result: function(nb, arr) {
- // arr is [testindex, expectedvalue]
- SimpleTest.is(nb.currentNotification.value, "" + arr[1], "close order " + arr[0]);
- SimpleTest.is(nb.allNotifications.length, 10 - arr[0], "close order " + arr[0] + " count");
- if (arr[0] == 6)
- this.repeat = false;
- return ++arr[0];
- }
- },
- {
- test: function(nb, ntf) {
- var exh = false;
- try {
- nb.appendNotification("no", "no", "no", 0, null);
- } catch (ex) { exh = true; }
- SimpleTest.is(exh, true, "appendNotification priority too low");
-
- exh = false;
- try {
- nb.appendNotification("no", "no", "no", 11, null);
- } catch (ex) { exh = true; }
- SimpleTest.is(exh, true, "appendNotification priority too high");
-
- // check that the other priority types work properly
- runTimedTests(appendPriorityTests, -1, nb, nb.PRIORITY_WARNING_LOW);
- }
- }
-];
-
-var appendPriorityTests = [
- {
- test: function(nb, priority) {
- var ntf = nb.appendNotification("Notification", "note", "happy.png",
- priority, testtag_notificationbox_buttons);
- SimpleTest.is(ntf && ntf.localName == "notification", true, "append notification " + priority);
- return [ntf, priority];
- },
- result: function(nb, obj) {
- SimpleTest.is(obj[0].priority, obj[1], "notification.priority " + obj[1]);
- return obj[1];
- }
- },
- {
- test: function(nb, priority) {
- nb.removeCurrentNotification();
- return priority;
- },
- result: function(nb, priority) {
- if (priority == nb.PRIORITY_CRITICAL_BLOCK) {
- let ntf = nb.appendNotification("Notification", "note", "happy.png",
- nb.PRIORITY_INFO_LOW, testtag_notificationbox_buttons);
- setTimeout(checkPopupTest, 50, nb, ntf);
- }
- else {
- runTimedTests(appendPriorityTests, -1, nb, ++priority);
- }
- }
- }
-];
-
-function testtag_notificationbox_State(nb, testid, expecteditem, expectedcount)
-{
- SimpleTest.is(nb.currentNotification, expecteditem, testid + " currentNotification");
- SimpleTest.is(nb.allNotifications ? nb.allNotifications.length : "no value",
- expectedcount, testid + " allNotifications");
-}
-
-function testtag_notification_State(nb, ntf, testid, label, value, image, priority)
-{
- SimpleTest.is(ntf.control, nb, testid + " notification.control");
- SimpleTest.is(ntf.label, label, testid + " notification.label");
- SimpleTest.is(ntf.value, value, testid + " notification.value");
- SimpleTest.is(ntf.image, image, testid + " notification.image");
- SimpleTest.is(ntf.priority, priority, testid + " notification.priority");
-
- var type;
- switch (priority) {
- case nb.PRIORITY_INFO_LOW:
- case nb.PRIORITY_INFO_MEDIUM:
- case nb.PRIORITY_INFO_HIGH:
- type = "info";
- break;
- case nb.PRIORITY_WARNING_LOW:
- case nb.PRIORITY_WARNING_MEDIUM:
- case nb.PRIORITY_WARNING_HIGH:
- type = "warning";
- break;
- case nb.PRIORITY_CRITICAL_LOW:
- case nb.PRIORITY_CRITICAL_MEDIUM:
- case nb.PRIORITY_CRITICAL_HIGH:
- case nb.PRIORITY_CRITICAL_BLOCK:
- type = "critical";
- break;
- }
-
- SimpleTest.is(ntf.type, type, testid + " notification.type");
-}
-
-function checkPopupTest(nb, ntf)
-{
- if (nb._animating)
- setTimeout(checkPopupTest, ntf);
- else {
- var evt = new Event("");
- ntf.dispatchEvent(evt);
- evt.target.buttonInfo = testtag_notificationbox_buttons[0];
- ntf._doButtonCommand(evt);
- }
-}
-
-function checkPopupClosed()
-{
- is(document.popupNode, null, "popupNode null after popup is closed");
- SimpleTest.finish();
-}
-
-/**
- * run one or more tests which perform a test operation, wait for a delay,
- * then perform a result operation.
- *
- * tests - array of objects where each object is :
- * {
- * test: test function,
- * result: result function
- * repeat: true to repeat the test
- * }
- * idx - starting index in tests
- * element - element to run tests on
- * arg - argument to pass between test functions
- *
- * If, after executing the result part, the repeat property of the test is
- * true, then the test is repeated. If the repeat property is not true,
- * continue on to the next test.
- *
- * The test and result functions take two arguments, the element and the arg.
- * The test function may return a value which will passed to the result
- * function as its arg. The result function may also return a value which
- * will be passed to the next repetition or the next test in the array.
- */
-function runTimedTests(tests, idx, element, arg)
-{
- if (idx >= 0 && "result" in tests[idx])
- arg = tests[idx].result(element, arg);
-
- // if not repeating, move on to the next test
- if (idx == -1 || !tests[idx].repeat)
- idx++;
-
- if (idx < tests.length) {
- var result = tests[idx].test(element, arg);
- setTimeout(runTimedTestsWait, 50, tests, idx, element, result);
- }
-}
-
-function runTimedTestsWait(tests, idx, element, arg)
-{
- // use this secret property to check if the animation is still running. If it
- // is, then the notification hasn't fully opened or closed yet
- if (element._animating)
- setTimeout(runTimedTestsWait, 50, tests, idx, element, arg);
- else
- runTimedTests(tests, idx, element, arg);
-}
-
-setTimeout(testtag_notificationbox, 0, document.getElementById('nb'));
-]]>
-</script>
-
-</window>
-
diff --git a/toolkit/content/tests/chrome/test_panel.xul b/toolkit/content/tests/chrome/test_panel.xul
deleted file mode 100644
index 3b2188d9e..000000000
--- a/toolkit/content/tests/chrome/test_panel.xul
+++ /dev/null
@@ -1,31 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Panel Tests"
- onload="runTest()"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<script>
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- window.open("window_panel.xul", "_blank", "chrome,left=200,top=200,width=200,height=200");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_panel_focus.xul b/toolkit/content/tests/chrome/test_panel_focus.xul
deleted file mode 100644
index e18f28ca8..000000000
--- a/toolkit/content/tests/chrome/test_panel_focus.xul
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Panel Focus Tests"
- onload="setTimeout(runTest, 0);"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<script>
-// use a chrome window for this test as the focus in content windows can be
-// adjusted by the current selection position
-
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- // move the mouse so any tooltips that might be open go away, otherwise this
- // test can fail on Mac
- synthesizeMouse(document.documentElement, 1, 1, { type: "mousemove" });
-
- window.open("window_panel_focus.xul", "_blank", "chrome,width=600,height=600");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_panelfrommenu.xul b/toolkit/content/tests/chrome/test_panelfrommenu.xul
deleted file mode 100644
index 72e396516..000000000
--- a/toolkit/content/tests/chrome/test_panelfrommenu.xul
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Open panel from menuitem"
- onload="setTimeout(runTests, 0);"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<!--
- This test does the following:
- 1. Opens the menu, causing the popupshown event to fire, which will call menuOpened.
- 2. Keyboard events are fired to cause the first item on the menu to be executed.
- 3. The command event handler for the first menuitem opens the panel.
- 4. As a menuitem was executed, the menu will roll up, hiding it.
- 5. The popuphidden event for the menu calls menuClosed which tests the popup states.
- 6. The panelOpened function tests the popup states again and hides the popup.
- 7. Once the panel's popuphidden event fires, tests are performed to see if
- panels inside buttons and toolbarbuttons work. Each is opened and the closed.
- -->
-
-<menu id="menu" onpopupshown="menuOpened()" onpopuphidden="menuClosed();">
- <menupopup>
- <menuitem id="i1" label="One" oncommand="$('panel').openPopup($('menu'), 'after_start');"/>
- <menuitem id="i2" label="Two"/>
- </menupopup>
-</menu>
-
-<panel id="hiddenpanel" hidden="true"/>
-
-<panel id="panel" onpopupshown="panelOpened()"
- onpopuphidden="$('button').focus(); $('button').open = true">
- <textbox/>
-</panel>
-
-<button id="button" type="panel" label="Button">
- <panel onpopupshown="panelOnButtonOpened(this)"
- onpopuphidden="$('tbutton').open = true;">
- <button label="OK" oncommand="this.parentNode.parentNode.open = false"/>
- </panel>
-</button>
-
-<toolbarbutton id="tbutton" type="panel" label="Toolbarbutton">
- <panel onpopupshown="panelOnToolbarbuttonOpened(this)"
- onpopuphidden="SimpleTest.finish()">
- <textbox/>
- </panel>
-</toolbarbutton>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function runTests()
-{
- is($("hiddenpanel").state, "closed", "hidden popup is closed");
-
- var menu = $("menu");
- menu.open = true;
-}
-
-function menuOpened()
-{
- synthesizeKey("VK_DOWN", { });
- synthesizeKey("VK_RETURN", { });
-}
-
-function menuClosed()
-{
- // the panel will be open at this point, but the popupshown event
- // still needs to fire
- is($("panel").state, "showing", "panel is open after menu hide");
- is($("menu").firstChild.state, "closed", "menu is closed after menu hide");
-}
-
-function panelOpened()
-{
- is($("panel").state, "open", "panel is open");
- is($("menu").firstChild.state, "closed", "menu is closed");
- $("panel").hidePopup();
-}
-
-function panelOnButtonOpened(panel)
-{
- is(panel.state, 'open', 'button panel is open');
- is(document.activeElement, document.documentElement, "focus blurred on panel from button open");
- synthesizeKey("VK_DOWN", { });
- is(document.activeElement, document.documentElement, "focus not modified on cursor down from button");
- panel.firstChild.doCommand()
-}
-
-function panelOnToolbarbuttonOpened(panel)
-{
- is(panel.state, 'open', 'toolbarbutton panel is open');
- is(document.activeElement, document.documentElement, "focus blurred on panel from toolbarbutton open");
- panel.firstChild.focus();
- synthesizeKey("VK_DOWN", { });
- is(document.activeElement, panel.firstChild.inputField, "focus not modified on cursor down from toolbarbutton");
- panel.parentNode.open = false;
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popup_anchor.xul b/toolkit/content/tests/chrome/test_popup_anchor.xul
deleted file mode 100644
index 5839c52a3..000000000
--- a/toolkit/content/tests/chrome/test_popup_anchor.xul
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Popup Anchor Tests"
- onload="setTimeout(runTest, 0);"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-<script>
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- window.open("window_popup_anchor.xul", "_blank", "chrome,width=600,height=600");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popup_anchoratrect.xul b/toolkit/content/tests/chrome/test_popup_anchoratrect.xul
deleted file mode 100644
index c12e22502..000000000
--- a/toolkit/content/tests/chrome/test_popup_anchoratrect.xul
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menu Button Popup Tests"
- onload="setTimeout(runTest, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<script>
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- window.open("window_popup_anchoratrect.xul", "_blank", "chrome,width=200,height=200");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popup_attribute.xul b/toolkit/content/tests/chrome/test_popup_attribute.xul
deleted file mode 100644
index 2a256078d..000000000
--- a/toolkit/content/tests/chrome/test_popup_attribute.xul
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Popup Attribute Tests"
- onload="setTimeout(runTest, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<script>
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- window.open("window_popup_attribute.xul", "_blank", "width=600,height=700");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popup_button.xul b/toolkit/content/tests/chrome/test_popup_button.xul
deleted file mode 100644
index 3803e465f..000000000
--- a/toolkit/content/tests/chrome/test_popup_button.xul
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menu Button Popup Tests"
- onload="setTimeout(runTest, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<script>
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- window.open("window_popup_button.xul", "_blank", "width=700,height=700");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popup_coords.xul b/toolkit/content/tests/chrome/test_popup_coords.xul
deleted file mode 100644
index 4597b5cc0..000000000
--- a/toolkit/content/tests/chrome/test_popup_coords.xul
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Popup Coordinate Tests"
- onload="setTimeout(openThePopup, 0, 'outer');"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<deck style="margin-top: 5px; padding-top: 5px;">
- <label id="outer" popup="outerpopup" value="Popup"/>
-</deck>
-
-<panel id="outerpopup"
- onpopupshowing="popupShowingEventOccurred(event);"
- onpopupshown="eventOccurred(event); openThePopup('inner')"
- onpopuphiding="eventOccurred(event);"
- onpopuphidden="eventOccurred(event); SimpleTest.finish();">
- <button id="item1" label="First"/>
- <label id="inner" value="Second" popup="innerpopup"/>
- <button id="item2" label="Third"/>
-</panel>
-
-<menupopup id="innerpopup"
- onpopupshowing="popupShowingEventOccurred(event);"
- onpopupshown="eventOccurred(event); event.target.hidePopup();"
- onpopuphiding="eventOccurred(event);"
- onpopuphidden="eventOccurred(event); document.getElementById('outerpopup').hidePopup();">
- <menuitem id="inner1" label="Inner First"/>
- <menuitem id="inner2" label="Inner Second"/>
-</menupopup>
-
-<script>
-SimpleTest.waitForExplicitFinish();
-
-function openThePopup(id)
-{
- if (id == "inner")
- document.getElementById("item1").focus();
-
- var trigger = document.getElementById(id);
- synthesizeMouse(trigger, 4, 5, { });
-}
-
-function eventOccurred(event)
-{
- var testname = event.type + " on " + event.target.id + " ";
- ok(event instanceof MouseEvent, testname + "is a mouse event");
- is(event.clientX, 0, testname + "clientX");
- is(event.clientY, 0, testname + "clientY");
- is(event.rangeParent, null, testname + "rangeParent");
- is(event.rangeOffset, 0, testname + "rangeOffset");
-}
-
-function popupShowingEventOccurred(event)
-{
- // the popupshowing event should have the event coordinates and
- // range position filled in.
- var testname = "popupshowing on " + event.target.id + " ";
- ok(event instanceof MouseEvent, testname + "is a mouse event");
-
- var trigger = document.getElementById(event.target.id == "outerpopup" ? "outer" : "inner");
- var rect = trigger.getBoundingClientRect();
- is(event.clientX, Math.round(rect.left + 4), testname + "clientX");
- is(event.clientY, Math.round(rect.top + 5), testname + "clientY");
- // rangeOffset should be just after the trigger element. As rangeOffset
- // considers the zeroth position to be before the first element, the value
- // should be one higher than its index within its parent.
- is(event.rangeParent, trigger.parentNode, testname + "rangeParent");
- is(event.rangeOffset, Array.indexOf(trigger.parentNode.childNodes, trigger) + 1, testname + "rangeOffset");
-
- var popuprect = event.target.getBoundingClientRect();
- is(Math.round(popuprect.left), Math.round(rect.left + 4), "popup left");
- is(Math.round(popuprect.top), Math.round(rect.top + 5), "popup top");
- ok(popuprect.width > 0, "popup width");
- ok(popuprect.height > 0, "popup height");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popup_keys.xul b/toolkit/content/tests/chrome/test_popup_keys.xul
deleted file mode 100644
index 37135af57..000000000
--- a/toolkit/content/tests/chrome/test_popup_keys.xul
+++ /dev/null
@@ -1,148 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menu ignorekeys Test"
- onkeydown="keyDown()" onkeypress="gKeyPressCount++; event.stopPropagation(); event.preventDefault();"
- onload="runTests();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<!--
- This test checks that the ignorekeys attribute can be used on a menu to
- disable key navigation. The test is performed twice by opening the menu,
- simulating a cursor down key, and closing the popup. When keys are enabled,
- the first item on the menu should be highlighted, otherwise the first item
- should not be highlighted.
- -->
-
-<menupopup id="popup">
- <menuitem id="i1" label="One" onDOMAttrModified="attrModified(event)"/>
- <menuitem id="i2" label="Two"/>
- <menuitem id="i3" label="Three"/>
- <menuitem id="i4" label="Four"/>
-</menupopup>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var gIgnoreKeys = false;
-var gIgnoreAttrChange = false;
-var gKeyPressCount = 0;
-
-let {Task} = Components.utils.import("resource://gre/modules/Task.jsm", {});
-
-function waitForEvent(target, eventName) {
- return new Promise(resolve => {
- target.addEventListener(eventName, function eventOccurred(event) {
- target.removeEventListener(eventName, eventOccurred, false);
- resolve();
- }, false);
- });
-}
-
-function runTests()
-{
- Task.async(function* () {
- var popup = $("popup");
- popup.enableKeyboardNavigator(false);
- is(popup.getAttribute("ignorekeys"), "true", "keys disabled");
- popup.enableKeyboardNavigator(true);
- is(popup.hasAttribute("ignorekeys"), false, "keys enabled");
-
- let popupShownPromise = waitForEvent(popup, "popupshown");
- popup.openPopup(null, "after_start");
- yield popupShownPromise;
-
- let popupHiddenPromise = waitForEvent(popup, "popuphidden");
- synthesizeKey("VK_DOWN", { });
- yield popupHiddenPromise;
-
- is(gKeyPressCount, 0, "keypresses with ignorekeys='false'");
-
- gIgnoreKeys = true;
- popup.setAttribute("ignorekeys", "true");
- // clear this first to avoid confusion
- gIgnoreAttrChange = true;
- $("i1").removeAttribute("_moz-menuactive")
- gIgnoreAttrChange = false;
-
- popupShownPromise = waitForEvent(popup, "popupshown");
- popup.openPopup(null, "after_start");
- yield popupShownPromise;
-
- synthesizeKey("VK_DOWN", { });
-
- yield new Promise(resolve => setTimeout(() => resolve(), 1000));
- popupHiddenPromise = waitForEvent(popup, "popuphidden");
- popup.hidePopup();
- yield popupHiddenPromise;
-
- is(gKeyPressCount, 1, "keypresses with ignorekeys='true'");
-
- popup.setAttribute("ignorekeys", "shortcuts");
- // clear this first to avoid confusion
- gIgnoreAttrChange = true;
- $("i1").removeAttribute("_moz-menuactive")
- gIgnoreAttrChange = false;
-
- popupShownPromise = waitForEvent(popup, "popupshown");
- popup.openPopup(null, "after_start");
- yield popupShownPromise;
-
- // When ignorekeys="shortcuts", T should be handled but accel+T should propagate.
- synthesizeKey("t", { });
- is(gKeyPressCount, 1, "keypresses after t pressed with ignorekeys='shortcuts'");
-
- synthesizeKey("t", { accelKey: true });
- is(gKeyPressCount, 2, "keypresses after accel+t pressed with ignorekeys='shortcuts'");
-
- popupHiddenPromise = waitForEvent(popup, "popuphidden");
- popup.hidePopup();
- yield popupHiddenPromise;
-
- SimpleTest.finish();
- })();
-}
-
-function attrModified(event)
-{
- if (gIgnoreAttrChange || event.attrName != "_moz-menuactive")
- return;
-
- // the attribute should not be changed when ignorekeys is enabled
- if (gIgnoreKeys) {
- ok(false, "move key with keys disabled");
- }
- else {
- is($("i1").getAttribute("_moz-menuactive"), "true", "move key with keys enabled");
- $("popup").hidePopup();
- }
-}
-
-function keyDown()
-{
- // when keys are enabled, the menu should have stopped propagation of the
- // event, so a bubbling listener for a keydown event should only occur
- // when keys are disabled.
- ok(gIgnoreKeys, "key listener fired with keys " +
- (gIgnoreKeys ? "disabled" : "enabled"));
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popup_moveToAnchor.xul b/toolkit/content/tests/chrome/test_popup_moveToAnchor.xul
deleted file mode 100644
index 344002fdf..000000000
--- a/toolkit/content/tests/chrome/test_popup_moveToAnchor.xul
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<vbox align="start">
- <button id="button1" label="Button 1" style="margin-top: 50px;"/>
- <button id="button2" label="Button 2" style="margin-top: 60px;"/>
-</vbox>
-
-<menupopup id="popup" onpopupshown="popupshown()" onpopuphidden="SimpleTest.finish()">
- <menuitem label="One"/>
- <menuitem label="Two"/>
-</menupopup>
-
-<script>
-SimpleTest.waitForExplicitFinish();
-
-function runTest(id)
-{
- $("popup").openPopup($("button1"), "after_start");
-}
-
-function popupshown()
-{
- var popup = $("popup");
- var popupheight = popup.getBoundingClientRect().height;
- var button1rect = $("button1").getBoundingClientRect();
- var button2rect = $("button2").getBoundingClientRect();
-
- checkCoords(popup, button1rect.left, button1rect.bottom, "initial");
-
- popup.moveToAnchor($("button1"), "after_start", 0, 8);
- checkCoords(popup, button1rect.left, button1rect.bottom + 8, "move anchor top + 8");
-
- popup.moveToAnchor($("button1"), "after_start", 6, -10);
- checkCoords(popup, button1rect.left + 6, button1rect.bottom - 10, "move anchor left + 6, top - 10");
-
- popup.moveToAnchor($("button1"), "before_start", -2, 0);
- checkCoords(popup, button1rect.left - 2, button1rect.top - popupheight, "move anchor before_start");
-
- popup.moveToAnchor($("button2"), "before_start");
- checkCoords(popup, button2rect.left, button2rect.top - popupheight, "move button2");
-
- popup.moveToAnchor($("button1"), "end_before");
- checkCoords(popup, button1rect.right, button1rect.top, "move anchor end_before");
-
- popup.moveToAnchor($("button2"), "after_start", 5, 4);
- checkCoords(popup, button2rect.left + 5, button2rect.bottom + 4, "move button2 left + 5, top + 4");
-
- popup.moveTo($("button1").boxObject.screenX + 10, $("button1").boxObject.screenY + 12);
- checkCoords(popup, button1rect.left + 10, button1rect.top + 12, "move to button1 screen with offset");
-
- popup.moveToAnchor($("button1"), "after_start", 1, 2);
- checkCoords(popup, button1rect.left + 1, button1rect.bottom + 2, "move button2 after screen");
-
- popup.hidePopup();
-}
-
-function checkCoords(popup, expectedx, expectedy, testid)
-{
- var rect = popup.getBoundingClientRect();
- is(Math.round(rect.left), Math.round(expectedx), testid + " left");
- is(Math.round(rect.top), Math.round(expectedy), testid + " top");
-}
-
-SimpleTest.waitForFocus(runTest);
-
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popup_preventdefault.xul b/toolkit/content/tests/chrome/test_popup_preventdefault.xul
deleted file mode 100644
index 7de5dc3be..000000000
--- a/toolkit/content/tests/chrome/test_popup_preventdefault.xul
+++ /dev/null
@@ -1,76 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Popup Prevent Default Tests"
- onload="setTimeout(runTest, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<!--
- This tests checks that preventDefault can be called on a popupshowing
- event and that preventDefault has no effect for the popuphiding event.
- -->
-
-<script>
-SimpleTest.waitForExplicitFinish();
-
-var gBlockShowing = true;
-var gShownNotAllowed = true;
-
-function runTest()
-{
- document.getElementById("menu").open = true;
-}
-
-function popupShowing(event)
-{
- if (gBlockShowing) {
- event.preventDefault();
- gBlockShowing = false;
- setTimeout(function() {
- gShownNotAllowed = false;
- document.getElementById("menu").open = true;
- }, 3000, true);
- }
-}
-
-function popupShown()
-{
- ok(!gShownNotAllowed, "popupshowing preventDefault");
- document.getElementById("menu").open = false;
-}
-
-function popupHiding(event)
-{
- // since this is a content test, preventDefault should have no effect
- event.preventDefault();
-}
-
-function popupHidden()
-{
- ok(true, "popuphiding preventDefault not allowed");
- SimpleTest.finish();
-}
-</script>
-
-<button id="menu" type="menu" label="Menu">
- <menupopup onpopupshowing="popupShowing(event);"
- onpopupshown="popupShown();"
- onpopuphiding="popupHiding(event);"
- onpopuphidden="popupHidden();">
- <menuitem label="Item"/>
- </menupopup>
-</button>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popup_preventdefault_chrome.xul b/toolkit/content/tests/chrome/test_popup_preventdefault_chrome.xul
deleted file mode 100644
index 46f14cd6a..000000000
--- a/toolkit/content/tests/chrome/test_popup_preventdefault_chrome.xul
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Popup Attribute Tests"
- onload="setTimeout(runTest, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-<script>
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- window.open("window_popup_preventdefault_chrome.xul", "_blank", "chrome,width=600,height=600");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popup_recreate.xul b/toolkit/content/tests/chrome/test_popup_recreate.xul
deleted file mode 100644
index 14822acbd..000000000
--- a/toolkit/content/tests/chrome/test_popup_recreate.xul
+++ /dev/null
@@ -1,83 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Popup Recreate Test"
- onload="setTimeout(init, 0)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<!--
- This is a test for bug 388361.
-
- This test checks that a menulist's popup is properly created and sized when
- the popup node is removed and another added in its place.
-
- -->
-
-<script>
-<![CDATA[
-SimpleTest.waitForExplicitFinish();
-
-var gState = "before";
-
-function init()
-{
- document.getElementById("menulist").open = true;
-}
-
-function isWithinHalfPixel(a, b)
-{
- return Math.abs(a - b) <= 0.5;
-}
-
-function recreate()
-{
- if (gState == "before") {
- var element = document.getElementById("menulist");
- while (element.hasChildNodes())
- element.removeChild(element.firstChild);
- element.appendItem("Cat");
- gState = "after";
- document.getElementById("menulist").open = true;
- }
- else {
- SimpleTest.finish();
- }
-}
-
-function checkSize()
-{
- var menulist = document.getElementById("menulist");
- var menurect = menulist.getBoundingClientRect();
- var popuprect = menulist.menupopup.getBoundingClientRect();
-
- let marginLeft = parseFloat(getComputedStyle(menulist.menupopup).marginLeft);
- ok(isWithinHalfPixel(menurect.left + marginLeft, popuprect.left), "left position " + gState);
- ok(isWithinHalfPixel(menurect.right + marginLeft, popuprect.right), "right position " + gState);
- ok(Math.round(popuprect.right) - Math.round(popuprect.left) > 0, "height " + gState)
- document.getElementById("menulist").open = false;
-}
-]]>
-</script>
-
-<hbox align="center" pack="center">
- <menulist id="menulist" onpopupshown="checkSize();" onpopuphidden="recreate();">
- <menupopup position="after_start">
- <menuitem label="Cat"/>
- </menupopup>
- </menulist>
-</hbox>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popup_scaled.xul b/toolkit/content/tests/chrome/test_popup_scaled.xul
deleted file mode 100644
index 6bbf6c653..000000000
--- a/toolkit/content/tests/chrome/test_popup_scaled.xul
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Popups in Scaled Content"
- onload="setTimeout(runTests, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<!-- This test checks that the position is correct in two cases:
- - a popup anchored at an element in a scaled document
- - a popup opened at a screen coordinate in a scaled window
- -->
-
-<iframe id="frame" width="60" height="140"
- src="data:text/html,&lt;html&gt;&lt;body&gt;&lt;input size='4' id='one'&gt;&lt;input size='4' id='two'&gt;&lt;/body&gt;&lt;/html&gt;"/>
-
-<menupopup id="popup" onpopupshown="shown()" onpopuphidden="nextTest()">
- <menuitem label="One"/>
-</menupopup>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-var screenTest = false;
-var screenx = -1, screeny = -1;
-
-SimpleTest.waitForExplicitFinish();
-
-function runTests()
-{
- setScale($("frame").contentWindow, 2);
-
- var anchor = $("frame").contentDocument.getElementById("two");
- anchor.getBoundingClientRect(); // flush to update display after scale change
- $("popup").openPopup(anchor, "after_start");
-}
-
-function setScale(win, scale)
-{
- var wn = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIWebNavigation);
- var shell = wn.QueryInterface(Components.interfaces.nsIDocShell);
- var docViewer = shell.contentViewer;
- docViewer.fullZoom = scale;
-}
-
-function shown()
-{
- if (screenTest) {
- var box = $("popup").boxObject;
- is(box.screenX, screenx, "screen left position");
- is(box.screenY, screeny, "screen top position");
- }
- else {
- var anchor = $("frame").contentDocument.getElementById("two");
-
- is(Math.round(anchor.getBoundingClientRect().left * 2),
- Math.round($("popup").getBoundingClientRect().left), "anchored left position");
- is(Math.round(anchor.getBoundingClientRect().bottom * 2),
- Math.round($("popup").getBoundingClientRect().top), "anchored top position");
- }
-
- $("popup").hidePopup();
-}
-
-function nextTest()
-{
- if (screenTest) {
- setScale(window, 1);
- SimpleTest.finish();
- }
- else {
- screenTest = true;
- var box = document.documentElement.boxObject;
-
- // - the iframe is at 4×, but out here css pixels are only 2× device pixels
- // - the popup manager rounds off (or truncates) the coordinates to
- // integers, so ensure we pass in even numbers to openPopupAtScreen
- screenx = (x = even(box.screenX + 120))/2;
- screeny = (y = even(box.screenY + 120))/2;
- setScale(window, 2);
- $("popup").openPopupAtScreen(x, y);
- }
-}
-
-function even(n)
-{
- return (n % 2) ? n+1 : n;
-}
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popup_tree.xul b/toolkit/content/tests/chrome/test_popup_tree.xul
deleted file mode 100644
index 779f13e68..000000000
--- a/toolkit/content/tests/chrome/test_popup_tree.xul
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Tree in Popup Test"
- onload="setTimeout(runTests, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<panel id="panel" onpopupshown="treeClick()" onpopuphidden="SimpleTest.finish()">
- <tree id="tree" width="350" rows="5">
- <treecols>
- <treecol id="name" label="Name" flex="1"/>
- <treecol id="address" label="Street" flex="1"/>
- </treecols>
- <treechildren id="treechildren">
- <treeitem>
- <treerow>
- <treecell label="Justin Thyme"/>
- <treecell label="800 Bay Street"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Mary Goround"/>
- <treecell label="47 University Avenue"/>
- </treerow>
- </treeitem>
- </treechildren>
- </tree>
-</panel>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function runTests()
-{
- $("panel").openPopup(null, "overlap", 2, 2);
-}
-
-function treeClick()
-{
- var tree = $("tree");
- is(tree.currentIndex, -1, "selectedIndex before click");
- synthesizeMouseExpectEvent($("treechildren"), 2, 2, { }, $("treechildren"), "click", "");
- is(tree.currentIndex, 0, "selectedIndex after click");
-
- var rect = tree.treeBoxObject.getCoordsForCellItem(1, tree.columns.address, "");
- synthesizeMouseExpectEvent($("treechildren"), rect.x, rect.y + 2,
- { }, $("treechildren"), "click", "");
- is(tree.currentIndex, 1, "selectedIndex after second click " + rect.x + "," + rect.y);
-
- $("panel").hidePopup();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popuphidden.xul b/toolkit/content/tests/chrome/test_popuphidden.xul
deleted file mode 100644
index 4c344b3d2..000000000
--- a/toolkit/content/tests/chrome/test_popuphidden.xul
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Hidden Popup Test"
- onload="setTimeout(runTests, 0, $('popup'));"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<menupopup id="popup" hidden="true" onpopupshown="ok(true, 'popupshown'); this.hidePopup()"
- onpopuphidden="$('popup-hideonshow').openPopup(null, 'after_start')">
- <menuitem id="i1" label="One"/>
- <menuitem id="i2" label="Two"/>
-</menupopup>
-
-<menupopup id="popup-hideonshow" onpopupshowing="hidePopupWhileShowing(this)"
- onpopupshown="ok(false, 'popupshown when hidden')">
- <menuitem id="i1" label="One"/>
- <menuitem id="i2" label="Two"/>
-</menupopup>
-
-<button id="button" type="menu" label="Menu" onDOMAttrModified="checkEndTest(event)">
- <menupopup id="popupinbutton" hidden="true"
- onpopupshown="ok(true, 'popupshown'); ok($('button').open, 'open'); this.hidden = true;">
- <menuitem id="i1" label="One"/>
- <menuitem id="i2" label="Two"/>
- </menupopup>
-</button>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function runTests(popup)
-{
- popup.hidden = false;
- popup.openPopup(null, "after_start");
-}
-
-function hidePopupWhileShowing(popup)
-{
- popup.hidden = true;
- popup.clientWidth; // flush layout
- is(popup.state, 'closed', 'popupshowing hidden');
- SimpleTest.executeSoon(() => runTests($('popupinbutton')));
-}
-
-function checkEndTest(event)
-{
- var button = $("button");
- if (event.originalTarget != button || event.attrName != 'open' || event.attrChange != event.REMOVAL)
- return;
-
- ok($("popupinbutton").hidden, "popup hidden");
- is($("popupinbutton").state, "closed", "popup state");
- ok(!button.open, "not open after hidden");
- SimpleTest.finish();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popupincontent.xul b/toolkit/content/tests/chrome/test_popupincontent.xul
deleted file mode 100644
index dafcd09e5..000000000
--- a/toolkit/content/tests/chrome/test_popupincontent.xul
+++ /dev/null
@@ -1,131 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Popup in Content Positioning Tests"
- onload="setTimeout(nextTest, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<!--
- This test checks that popups in content areas don't extend past the content area.
- -->
-
-<hbox>
- <spacer width="100"/>
- <menu id="menu" label="Menu">
- <menupopup style="margin:10px;" id="popup" onpopupshown="popupShown()" onpopuphidden="nextTest()">
- <menuitem label="One"/>
- <menuitem label="Two"/>
- <menuitem label="Three"/>
- <menuitem label="A final longer label that is actually quite long. Very long indeed."/>
- </menupopup>
- </menu>
-</hbox>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var step = "";
-var originalHeight = -1;
-
-function nextTest()
-{
- // there are five tests here:
- // openPopupAtScreen - checks that opening a popup using openPopupAtScreen
- // constrains the popup to the content area
- // left and top - check with the left and top attributes set
- // open near bottom - open the menu near the bottom of the window
- // large menu - try with a menu that is very large and should be scaled
- // shorter menu again - try with a menu that is shorter again. It should have
- // the same height as the 'left and top' test
- var popup = $("popup");
- var menu = $("menu");
- switch (step) {
- case "":
- step = "openPopupAtScreen";
- popup.openPopupAtScreen(1000, 1200);
- break;
- case "openPopupAtScreen":
- step = "left and top";
- popup.setAttribute("left", "800");
- popup.setAttribute("top", "2900");
- synthesizeMouse(menu, 2, 2, { });
- break;
- case "left and top":
- step = "open near bottom";
- // request that the menu be opened with a target point near the bottom of the window,
- // so that the menu's top margin will push it completely outside the window.
- var bo = document.documentElement.boxObject;
- popup.setAttribute("top", bo.screenY + window.innerHeight - 5);
- synthesizeMouse(menu, 2, 2, { });
- break;
- case "open near bottom":
- step = "large menu";
- popup.removeAttribute("left");
- popup.removeAttribute("top");
- for (var i = 0; i < 80; i++)
- menu.appendItem("Test", "");
- synthesizeMouse(menu, 2, 2, { });
- break;
- case "large menu":
- step = "shorter menu again";
- for (var i = 0; i < 80; i++)
- menu.removeItemAt(menu.itemCount - 1);
- synthesizeMouse(menu, 2, 2, { });
- break;
- case "shorter menu again":
- SimpleTest.finish();
- break;
- }
-}
-
-function popupShown()
-{
- var windowrect = document.documentElement.getBoundingClientRect();
- var popuprect = $("popup").getBoundingClientRect();
-
- // subtract one off the edge due to a rounding issue
- ok(popuprect.left >= windowrect.left, step + " left");
- ok(popuprect.right - 1 <= windowrect.right, step + " right");
-
- if (step == "left and top") {
- originalHeight = popuprect.bottom - popuprect.top;
- }
- else if (step == "open near bottom") {
- // check that the menu flipped up so it's above our requested point
- ok(popuprect.bottom - 1 <= windowrect.bottom - 5, step + " bottom");
- }
- else if (step == "large menu") {
- // add 10 to account for the margin
- is(popuprect.top, $("menu").getBoundingClientRect().bottom + 10, step + " top");
- ok(popuprect.bottom == windowrect.bottom ||
- popuprect.bottom - 1 == windowrect.bottom, step + " bottom");
- }
- else {
- ok(popuprect.top >= windowrect.top, step + " top");
- ok(popuprect.bottom - 1 <= windowrect.bottom, step + " bottom");
- if (step == "shorter menu again")
- is(popuprect.bottom - popuprect.top, originalHeight, step + " height shortened");
- }
-
- $("menu").open = false;
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popupremoving.xul b/toolkit/content/tests/chrome/test_popupremoving.xul
deleted file mode 100644
index f795590f5..000000000
--- a/toolkit/content/tests/chrome/test_popupremoving.xul
+++ /dev/null
@@ -1,165 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Popup Removing Tests"
- onload="setTimeout(nextTest, 0)"
- onDOMAttrModified="modified(event)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!--
- This test checks that popup elements can be removed in various ways without
- crashing. It tests two situations, one with menus that are 'separate', and
- one with menus that are 'nested'. In each case, there are four levels of menu.
-
- The nextTest function starts the process by opening the first menu. A set of
- popupshown event listeners are used to open the next menu until all four are
- showing. This last one calls removePopup to remove the menu node from the
- tree. This should hide the popups as they are no longer in a document.
-
- A mutation listener is triggered when the fourth menu closes by having its
- open attribute cleared. This listener hides the third popup which causes
- its frame to be removed. Naturally, we want to ensure that this doesn't
- crash when the third menu is removed.
- -->
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<hbox>
-
-<menu id="nestedmenu1" label="1">
- <menupopup id="nestedpopup1" onpopupshown="if (event.target == this) this.firstChild.open = true">
- <menu id="nestedmenu2" label="2">
- <menupopup id="nestedpopup2" onpopupshown="if (event.target == this) this.firstChild.open = true">
- <menu id="nestedmenu3" label="3">
- <menupopup id="nestedpopup3" onpopupshown="if (event.target == this) this.firstChild.open = true">
- <menu id="nestedmenu4" label="4" onpopupshown="removePopups()">
- <menupopup id="nestedpopup4">
- <menuitem label="Nested 1"/>
- <menuitem label="Nested 2"/>
- <menuitem label="Nested 3"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- </menupopup>
-</menu>
-
-<menu id="separatemenu1" label="1">
- <menupopup id="separatepopup1" onpopupshown="$('separatemenu2').open = true">
- <menuitem label="L1 One"/>
- <menuitem label="L1 Two"/>
- <menuitem label="L1 Three"/>
- </menupopup>
-</menu>
-
-<menu id="separatemenu2" label="2">
- <menupopup id="separatepopup2" onpopupshown="$('separatemenu3').open = true"
- onpopuphidden="popup2Hidden()">
- <menuitem label="L2 One"/>
- <menuitem label="L2 Two"/>
- <menuitem label="L2 Three"/>
- </menupopup>
-</menu>
-
-<menu id="separatemenu3" label="3" onpopupshown="$('separatemenu4').open = true">
- <menupopup id="separatepopup3">
- <menuitem label="L3 One"/>
- <menuitem label="L3 Two"/>
- <menuitem label="L3 Three"/>
- </menupopup>
-</menu>
-
-<menu id="separatemenu4" label="4" onpopupshown="removePopups()"
- onpopuphidden="$('separatemenu2').open = false">
- <menupopup id="separatepopup3">
- <menuitem label="L4 One"/>
- <menuitem label="L4 Two"/>
- <menuitem label="L4 Three"/>
- </menupopup>
-</menu>
-
-</hbox>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var gKey = "";
-gTriggerMutation = null;
-gChangeMutation = null;
-
-function nextTest()
-{
- if (gKey == "") {
- gKey = "separate";
- }
- else if (gKey == "separate") {
- gKey = "nested";
- }
- else {
- SimpleTest.finish();
- return;
- }
-
- $(gKey + "menu1").open = true;
-}
-
-function modified(event)
-{
- // use this mutation listener to hide the third popup, destroying its frame.
- // It gets triggered when the open attribute is cleared on the fourth menu.
-
- if (event.target == gTriggerMutation &&
- event.attrName == "open") {
- gChangeMutation.hidden = true;
- // force a layout flush
- document.documentElement.boxObject.width;
- gTriggerMutation = null;
- gChangeMutation = null;
- }
-}
-
-function removePopups()
-{
- var menu2 = $(gKey + "menu2");
- var menu3 = $(gKey + "menu3");
- is(menu2.getAttribute("open"), "true", gKey + " menu 2 open before");
- is(menu3.getAttribute("open"), "true", gKey + " menu 3 open before");
-
- gTriggerMutation = menu3;
- gChangeMutation = $(gKey + "menu4");
- var menu = $(gKey + "menu1");
- menu.parentNode.removeChild(menu);
-
- if (gKey == "nested") {
- // the 'separate' test checks this during the popup2 hidden event handler
- is(menu2.hasAttribute("open"), false, gKey + " menu 2 open after");
- is(menu3.hasAttribute("open"), false, gKey + " menu 3 open after");
- nextTest();
- }
-}
-
-function popup2Hidden()
-{
- is($(gKey + "menu2").hasAttribute("open"), false, gKey + " menu 2 open after");
- nextTest();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_popupremoving_frame.xul b/toolkit/content/tests/chrome/test_popupremoving_frame.xul
deleted file mode 100644
index dec73c7f7..000000000
--- a/toolkit/content/tests/chrome/test_popupremoving_frame.xul
+++ /dev/null
@@ -1,80 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Popup Unload Test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!--
- This test checks that popup elements are removed when the document is changed.
- -->
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<iframe id="frame" width="300" height="150" src="frame_popupremoving_frame.xul"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var gMenus = [];
-
-function popupsOpened()
-{
- var framedoc = $("frame").contentDocument;
- framedoc.addEventListener("DOMAttrModified", modified, false);
-
- // this is the order in which the menus should be hidden (reverse of the
- // order they were opened in). The second menu is removed during the
- // mutation listener, so gets the event afterwards.
- gMenus.push(framedoc.getElementById("nestedmenu4"));
- gMenus.push(framedoc.getElementById("nestedmenu2"));
- gMenus.push(framedoc.getElementById("nestedmenu3"));
- gMenus.push(framedoc.getElementById("nestedmenu1"));
- gMenus.push(framedoc.getElementById("separatemenu4"));
- gMenus.push(framedoc.getElementById("separatemenu2"));
- gMenus.push(framedoc.getElementById("separatemenu3"));
- gMenus.push(framedoc.getElementById("separatemenu1"));
-
- framedoc.location = "about:blank";
-}
-
-function modified(event)
-{
- if (event.attrName != "open")
- return;
-
- var framedoc = $("frame").contentDocument;
-
- var tohide = null;
- if (event.target.id == "separatemenu3")
- tohide = framedoc.getElementById("separatemenu2");
- else if (event.target.id == "nestedmenu3")
- tohide = framedoc.getElementById("nestedmenu2");
-
- if (tohide) {
- tohide.hidden = true;
- // force a layout flush
- $("frame").contentDocument.documentElement.boxObject.width;
- }
-
- is(event.target, gMenus.shift(), event.target.id + " hidden");
- if (gMenus.length == 0)
- SimpleTest.finish();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_position.xul b/toolkit/content/tests/chrome/test_position.xul
deleted file mode 100644
index 695c1bf22..000000000
--- a/toolkit/content/tests/chrome/test_position.xul
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for positioning
- -->
-<window title="position" width="500" height="600"
- onload="setTimeout(runTest, 0);"
- style="margin: 0; border: 0; padding; 0;"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-
-<hbox id="box1">
- <button label="0" width="100" height="40" style="margin: 3px;"/>
-</hbox>
-<scrollbox id="box2" orient="vertical" align="start" width="200" height="50"
- style="overflow: hidden; margin-left: 2px; padding: 1px;">
- <deck>
- <scrollbox id="box3" orient="vertical" align="start" height="100"
- style="overflow: scroll; margin: 1px; padding: 0;">
- <vbox id="innerscroll" width="200" align="start">
- <button id="button1" label="1" width="90" maxwidth="100"
- minheight="25" height="35" maxheight="50"
- style="min-width: 80px; margin: 5px; border: 4px; padding: 7px;
- -moz-appearance: none;"/>
- <menu id="menu">
- <menupopup id="popup" style="-moz-appearance: none; margin:0; border: 0; padding: 0;"
- onpopupshown="menuOpened()"
- onpopuphidden="if (event.target == this) SimpleTest.finish()">
- <menuitem label="One"/>
- <menu id="submenu" label="Three">
- <menupopup id="subpopup" style="-moz-appearance: none; margin:0; border: 0; padding: 0;"
- onpopupshown="submenuOpened()">
- <menuitem label="Four"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- <button label="2" maxwidth="100" maxheight="20" style="margin: 5px;"/>
- <button label="3" maxwidth="100" maxheight="20" style="margin: 5px;"/>
- <button label="4" maxwidth="100" maxheight="20" style="margin: 5px;"/>
- </vbox>
- <box height="200"/>
- </scrollbox>
- </deck>
-</scrollbox>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script>
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function runTest()
-{
- var winwidth = document.documentElement.boxObject.width;
- var innerscroll = $("innerscroll").boxObject.width;
-
- var box1 = $("box1");
- checkPosition("box1", box1, 0, 0, winwidth, 46);
-
- var box2 = $("box2");
- checkPosition("box2", box2, 2, 46, winwidth, 96);
-
- // height is height(box1) = 46 + margin-top(box3) = 1 + margin-top(button1) = 5
- var button1 = $("button1");
- checkPosition("button1", button1, 9, 53, 99, 88);
-
- var sbo = box2.boxObject;
- sbo.scrollTo(7, 16);
-
- // clientRect height is offset from root so is 16 pixels vertically less
- checkPosition("button1 scrolled", button1, 9, 37, 99, 72);
-
- var box3 = $("box3");
- sbo = box3.boxObject;
- sbo.scrollTo(1, 2);
-
- checkPosition("button1 scrolled", button1, 9, 35, 99, 70);
-
- $("menu").open = true;
-}
-
-function menuOpened()
-{
- $("submenu").open = true;
-}
-
-function submenuOpened()
-{
- var menu = $("menu");
- var menuleft = Math.round(menu.getBoundingClientRect().left);
- var menubottom = Math.round(menu.getBoundingClientRect().bottom);
-
- var submenu = $("submenu");
- var submenutop = Math.round(submenu.getBoundingClientRect().top);
- var submenuright = Math.round(submenu.getBoundingClientRect().right);
-
- checkPosition("popup", $("popup"), menuleft, menubottom, -1, -1);
- checkPosition("subpopup", $("subpopup"), submenuright, submenutop, -1, -1);
-
- menu.open = false;
-}
-
-function checkPosition(testid, elem, cleft, ctop, cright, cbottom)
-{
- // -1 for right or bottom means that the exact size should not be
- // checked, just ensure it is larger then the left or top position
- var rect = elem.getBoundingClientRect();
- is(Math.round(rect.left), cleft, testid + " client rect left");
- if (testid != "popup")
- is(Math.round(rect.top), ctop, testid + " client rect top");
- if (cright >= 0)
- is(Math.round(rect.right), cright, testid + " client rect right");
- else
- ok(rect.right - rect.left > 20, testid + " client rect right");
- if (cbottom >= 0)
- is(Math.round(rect.bottom), cbottom, testid + " client rect bottom");
- else
- ok(rect.bottom - rect.top > 15, testid + " client rect bottom");
-}
-
-]]>
-
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_preferences.xul b/toolkit/content/tests/chrome/test_preferences.xul
deleted file mode 100644
index 22e7e2fe9..000000000
--- a/toolkit/content/tests/chrome/test_preferences.xul
+++ /dev/null
@@ -1,533 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Preferences Window Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="RunTest();">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <script type="application/javascript">
- <![CDATA[
- SimpleTest.waitForExplicitFinish();
-
- const kPref = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefBranch);
-
- // preference values, set 1
- const kPrefValueSet1 =
- {
- int: 23,
- bool: true,
- string: "rheeet!",
- wstring_data: "日本語",
- unichar_data: "äöüßÄÖÜ",
- file_data: "/",
-
- wstring: Components.classes["@mozilla.org/pref-localizedstring;1"]
- .createInstance(Components.interfaces.nsIPrefLocalizedString),
- unichar: Components.classes["@mozilla.org/supports-string;1"]
- .createInstance(Components.interfaces.nsISupportsString),
- file: Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile)
- };
- kPrefValueSet1.wstring.data = kPrefValueSet1.wstring_data;
- kPrefValueSet1.unichar.data = kPrefValueSet1.unichar_data;
- SafeFileInit(kPrefValueSet1.file, kPrefValueSet1.file_data);
-
- // preference values, set 2
- const kPrefValueSet2 =
- {
- int: 42,
- bool: false,
- string: "Mozilla",
- wstring_data: "헤드ë¼ì¸A",
- unichar_data: "áôùšŽ",
- file_data: "/home",
-
- wstring: Components.classes["@mozilla.org/pref-localizedstring;1"]
- .createInstance(Components.interfaces.nsIPrefLocalizedString),
- unichar: Components.classes["@mozilla.org/supports-string;1"]
- .createInstance(Components.interfaces.nsISupportsString),
- file: Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile)
- };
- kPrefValueSet2.wstring.data = kPrefValueSet2.wstring_data;
- kPrefValueSet2.unichar.data = kPrefValueSet2.unichar_data;
- SafeFileInit(kPrefValueSet2.file, kPrefValueSet2.file_data);
-
-
- function SafeFileInit(aFile, aPath)
- {
- // set file path without dying for exceptions
- try
- {
- aFile.initWithPath(aPath);
- }
- catch (ignored) {}
- }
-
- function CreateEmptyPrefValueSet()
- {
- var result =
- {
- int: undefined,
- bool: undefined,
- string: undefined,
- wstring_data: undefined,
- unichar_data: undefined,
- file_data: undefined,
- wstring: undefined,
- unichar: undefined,
- file: undefined
- };
- return result;
- }
-
- function WritePrefsToSystem(aPrefValueSet)
- {
- // write preference data via XPCOM
- kPref.setIntPref ("tests.static_preference_int", aPrefValueSet.int);
- kPref.setBoolPref("tests.static_preference_bool", aPrefValueSet.bool);
- kPref.setCharPref("tests.static_preference_string", aPrefValueSet.string);
- kPref.setComplexValue("tests.static_preference_wstring",
- Components.interfaces.nsIPrefLocalizedString,
- aPrefValueSet.wstring);
- kPref.setComplexValue("tests.static_preference_unichar",
- Components.interfaces.nsISupportsString,
- aPrefValueSet.unichar);
- kPref.setComplexValue("tests.static_preference_file",
- Components.interfaces.nsILocalFile,
- aPrefValueSet.file);
- }
-
- function ReadPrefsFromSystem()
- {
- // read preference data via XPCOM
- var result = CreateEmptyPrefValueSet();
- try {result.int = kPref.getIntPref ("tests.static_preference_int") } catch (ignored) {};
- try {result.bool = kPref.getBoolPref("tests.static_preference_bool") } catch (ignored) {};
- try {result.string = kPref.getCharPref("tests.static_preference_string")} catch (ignored) {};
- try
- {
- result.wstring = kPref.getComplexValue("tests.static_preference_wstring",
- Components.interfaces.nsIPrefLocalizedString);
- result.wstring_data = result.wstring.data;
- }
- catch (ignored) {};
- try
- {
- result.unichar = kPref.getComplexValue("tests.static_preference_unichar",
- Components.interfaces.nsISupportsString);
- result.unichar_data = result.unichar.data;
- }
- catch (ignored) {};
- try
- {
- result.file = kPref.getComplexValue("tests.static_preference_file",
- Components.interfaces.nsILocalFile);
- result.file_data = result.file.data;
- }
- catch (ignored) {};
- return result;
- }
-
- function GetXULElement(aPrefWindow, aID)
- {
- return aPrefWindow.document.getElementById(aID);
- }
-
- function WritePrefsToPreferences(aPrefWindow, aPrefValueSet)
- {
- // write preference data into <preference>s
- GetXULElement(aPrefWindow, "tests.static_preference_int" ).value = aPrefValueSet.int;
- GetXULElement(aPrefWindow, "tests.static_preference_bool" ).value = aPrefValueSet.bool;
- GetXULElement(aPrefWindow, "tests.static_preference_string" ).value = aPrefValueSet.string;
- GetXULElement(aPrefWindow, "tests.static_preference_wstring").value = aPrefValueSet.wstring_data;
- GetXULElement(aPrefWindow, "tests.static_preference_unichar").value = aPrefValueSet.unichar_data;
- GetXULElement(aPrefWindow, "tests.static_preference_file" ).value = aPrefValueSet.file_data;
- }
-
- function ReadPrefsFromPreferences(aPrefWindow)
- {
- // read preference data from <preference>s
- var result =
- {
- int: GetXULElement(aPrefWindow, "tests.static_preference_int" ).value,
- bool: GetXULElement(aPrefWindow, "tests.static_preference_bool" ).value,
- string: GetXULElement(aPrefWindow, "tests.static_preference_string" ).value,
- wstring_data: GetXULElement(aPrefWindow, "tests.static_preference_wstring").value,
- unichar_data: GetXULElement(aPrefWindow, "tests.static_preference_unichar").value,
- file_data: GetXULElement(aPrefWindow, "tests.static_preference_file" ).value,
- wstring: Components.classes["@mozilla.org/pref-localizedstring;1"]
- .createInstance(Components.interfaces.nsIPrefLocalizedString),
- unichar: Components.classes["@mozilla.org/supports-string;1"]
- .createInstance(Components.interfaces.nsISupportsString),
- file: Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile)
- }
- result.wstring.data = result.wstring_data;
- result.unichar.data = result.unichar_data;
- SafeFileInit(result.file, result.file_data);
- return result;
- }
-
- function WritePrefsToUI(aPrefWindow, aPrefValueSet)
- {
- // write preference data into UI elements
- GetXULElement(aPrefWindow, "static_element_int" ).value = aPrefValueSet.int;
- GetXULElement(aPrefWindow, "static_element_bool" ).checked = aPrefValueSet.bool;
- GetXULElement(aPrefWindow, "static_element_string" ).value = aPrefValueSet.string;
- GetXULElement(aPrefWindow, "static_element_wstring").value = aPrefValueSet.wstring_data;
- GetXULElement(aPrefWindow, "static_element_unichar").value = aPrefValueSet.unichar_data;
- GetXULElement(aPrefWindow, "static_element_file" ).value = aPrefValueSet.file_data;
- }
-
- function ReadPrefsFromUI(aPrefWindow)
- {
- // read preference data from <preference>s
- var result =
- {
- int: GetXULElement(aPrefWindow, "static_element_int" ).value,
- bool: GetXULElement(aPrefWindow, "static_element_bool" ).checked,
- string: GetXULElement(aPrefWindow, "static_element_string" ).value,
- wstring_data: GetXULElement(aPrefWindow, "static_element_wstring").value,
- unichar_data: GetXULElement(aPrefWindow, "static_element_unichar").value,
- file_data: GetXULElement(aPrefWindow, "static_element_file" ).value,
- wstring: Components.classes["@mozilla.org/pref-localizedstring;1"]
- .createInstance(Components.interfaces.nsIPrefLocalizedString),
- unichar: Components.classes["@mozilla.org/supports-string;1"]
- .createInstance(Components.interfaces.nsISupportsString),
- file: Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile)
- }
- result.wstring.data = result.wstring_data;
- result.unichar.data = result.unichar_data;
- SafeFileInit(result.file, result.file_data);
- return result;
- }
-
-
- function RunInstantPrefTest(aPrefWindow)
- {
- // remark: there's currently no UI element binding for files
-
- // were all <preferences> correctly initialized?
- var expected = kPrefValueSet1;
- var found = ReadPrefsFromPreferences(aPrefWindow);
- ok(found.int === expected.int, "instant pref init int" );
- ok(found.bool === expected.bool, "instant pref init bool" );
- ok(found.string === expected.string, "instant pref init string" );
- ok(found.wstring_data === expected.wstring_data, "instant pref init wstring");
- ok(found.unichar_data === expected.unichar_data, "instant pref init unichar");
- todo(found.file_data === expected.file_data, "instant pref init file" );
-
- // were all elements correctly initialized? (loose check)
- found = ReadPrefsFromUI(aPrefWindow);
- ok(found.int == expected.int, "instant element init int" );
- ok(found.bool == expected.bool, "instant element init bool" );
- ok(found.string == expected.string, "instant element init string" );
- ok(found.wstring_data == expected.wstring_data, "instant element init wstring");
- ok(found.unichar_data == expected.unichar_data, "instant element init unichar");
- todo(found.file_data == expected.file_data, "instant element init file" );
-
- // do some changes in the UI
- expected = kPrefValueSet2;
- WritePrefsToUI(aPrefWindow, expected);
-
- // UI changes should get passed to the <preference>s,
- // but currently they aren't if the changes are made programmatically
- // (the handlers preference.change/prefpane.input and prefpane.change
- // are called for manual changes, though).
- found = ReadPrefsFromPreferences(aPrefWindow);
- todo(found.int === expected.int, "instant change pref int" );
- todo(found.bool === expected.bool, "instant change pref bool" );
- todo(found.string === expected.string, "instant change pref string" );
- todo(found.wstring_data === expected.wstring_data, "instant change pref wstring");
- todo(found.unichar_data === expected.unichar_data, "instant change pref unichar");
- todo(found.file_data === expected.file_data, "instant change pref file" );
-
- // and these changes should get passed to the system instantly
- // (which obviously can't pass with the above failing)
- found = ReadPrefsFromSystem();
- todo(found.int === expected.int, "instant change element int" );
- todo(found.bool === expected.bool, "instant change element bool" );
- todo(found.string === expected.string, "instant change element string" );
- todo(found.wstring_data === expected.wstring_data, "instant change element wstring");
- todo(found.unichar_data === expected.unichar_data, "instant change element unichar");
- todo(found.file_data === expected.file_data, "instant change element file" );
-
- // try resetting the prefs to default values (which should be empty here)
- GetXULElement(aPrefWindow, "tests.static_preference_int" ).reset();
- GetXULElement(aPrefWindow, "tests.static_preference_bool" ).reset();
- GetXULElement(aPrefWindow, "tests.static_preference_string" ).reset();
- GetXULElement(aPrefWindow, "tests.static_preference_wstring").reset();
- GetXULElement(aPrefWindow, "tests.static_preference_unichar").reset();
- GetXULElement(aPrefWindow, "tests.static_preference_file" ).reset();
-
- // check system
- expected = CreateEmptyPrefValueSet();
- found = ReadPrefsFromSystem();
- ok(found.int === expected.int, "instant reset system int" );
- ok(found.bool === expected.bool, "instant reset system bool" );
- ok(found.string === expected.string, "instant reset system string" );
- ok(found.wstring_data === expected.wstring_data, "instant reset system wstring");
- ok(found.unichar_data === expected.unichar_data, "instant reset system unichar");
- ok(found.file_data === expected.file_data, "instant reset system file" );
-
- // check UI
- expected =
- {
- // alas, we don't have XUL elements with typeof(value) == int :(
- // int: 0,
- int: "",
- bool: false,
- string: "",
- wstring_data: "",
- unichar_data: "",
- file_data: "",
- wstring: {},
- unichar: {},
- file: {}
- };
- found = ReadPrefsFromUI(aPrefWindow);
- ok(found.int === expected.int, "instant reset element int" );
- ok(found.bool === expected.bool, "instant reset element bool" );
- ok(found.string === expected.string, "instant reset element string" );
- ok(found.wstring_data === expected.wstring_data, "instant reset element wstring");
- ok(found.unichar_data === expected.unichar_data, "instant reset element unichar");
-// ok(found.file_data === expected.file_data, "instant reset element file" );
-
- // check hasUserValue
- ok(GetXULElement(aPrefWindow, "tests.static_preference_int" ).hasUserValue === false, "instant reset hasUserValue int" );
- ok(GetXULElement(aPrefWindow, "tests.static_preference_bool" ).hasUserValue === false, "instant reset hasUserValue bool" );
- ok(GetXULElement(aPrefWindow, "tests.static_preference_string" ).hasUserValue === false, "instant reset hasUserValue string" );
- ok(GetXULElement(aPrefWindow, "tests.static_preference_wstring").hasUserValue === false, "instant reset hasUserValue wstring");
- ok(GetXULElement(aPrefWindow, "tests.static_preference_unichar").hasUserValue === false, "instant reset hasUserValue unichar");
- ok(GetXULElement(aPrefWindow, "tests.static_preference_file" ).hasUserValue === false, "instant reset hasUserValue file" );
-
- // done with instant apply checks
- }
-
- function RunNonInstantPrefTestGeneral(aPrefWindow)
- {
- // Non-instant apply tests are harder: not only do we need to check that
- // fiddling with the values does *not* change the system settings, but
- // also that they *are* (not) set after closing (cancelling) the dialog...
-
- // remark: there's currently no UI element binding for files
-
- // were all <preferences> correctly initialized?
- var expected = kPrefValueSet1;
- var found = ReadPrefsFromPreferences(aPrefWindow);
- ok(found.int === expected.int, "non-instant pref init int" );
- ok(found.bool === expected.bool, "non-instant pref init bool" );
- ok(found.string === expected.string, "non-instant pref init string" );
- ok(found.wstring_data === expected.wstring_data, "non-instant pref init wstring");
- ok(found.unichar_data === expected.unichar_data, "non-instant pref init unichar");
- todo(found.file_data === expected.file_data, "non-instant pref init file" );
-
- // were all elements correctly initialized? (loose check)
- found = ReadPrefsFromUI(aPrefWindow);
- ok(found.int == expected.int, "non-instant element init int" );
- ok(found.bool == expected.bool, "non-instant element init bool" );
- ok(found.string == expected.string, "non-instant element init string" );
- ok(found.wstring_data == expected.wstring_data, "non-instant element init wstring");
- ok(found.unichar_data == expected.unichar_data, "non-instant element init unichar");
- todo(found.file_data == expected.file_data, "non-instant element init file" );
-
- // do some changes in the UI
- expected = kPrefValueSet2;
- WritePrefsToUI(aPrefWindow, expected);
-
- // UI changes should get passed to the <preference>s,
- // but currently they aren't if the changes are made programmatically
- // (the handlers preference.change/prefpane.input and prefpane.change
- // are called for manual changes, though).
- found = ReadPrefsFromPreferences(aPrefWindow);
- todo(found.int === expected.int, "non-instant change pref int" );
- todo(found.bool === expected.bool, "non-instant change pref bool" );
- todo(found.string === expected.string, "non-instant change pref string" );
- todo(found.wstring_data === expected.wstring_data, "non-instant change pref wstring");
- todo(found.unichar_data === expected.unichar_data, "non-instant change pref unichar");
- todo(found.file_data === expected.file_data, "non-instant change pref file" );
-
- // and these changes should *NOT* get passed to the system
- // (which obviously always passes with the above failing)
- expected = kPrefValueSet1;
- found = ReadPrefsFromSystem();
- ok(found.int === expected.int, "non-instant change element int" );
- ok(found.bool === expected.bool, "non-instant change element bool" );
- ok(found.string === expected.string, "non-instant change element string" );
- ok(found.wstring_data === expected.wstring_data, "non-instant change element wstring");
- ok(found.unichar_data === expected.unichar_data, "non-instant change element unichar");
- todo(found.file_data === expected.file_data, "non-instant change element file" );
-
- // try resetting the prefs to default values (which should be empty here)
- GetXULElement(aPrefWindow, "tests.static_preference_int" ).reset();
- GetXULElement(aPrefWindow, "tests.static_preference_bool" ).reset();
- GetXULElement(aPrefWindow, "tests.static_preference_string" ).reset();
- GetXULElement(aPrefWindow, "tests.static_preference_wstring").reset();
- GetXULElement(aPrefWindow, "tests.static_preference_unichar").reset();
- GetXULElement(aPrefWindow, "tests.static_preference_file" ).reset();
-
- // check system: the current values *MUST NOT* change
- expected = kPrefValueSet1;
- found = ReadPrefsFromSystem();
- ok(found.int === expected.int, "non-instant reset system int" );
- ok(found.bool === expected.bool, "non-instant reset system bool" );
- ok(found.string === expected.string, "non-instant reset system string" );
- ok(found.wstring_data === expected.wstring_data, "non-instant reset system wstring");
- ok(found.unichar_data === expected.unichar_data, "non-instant reset system unichar");
- todo(found.file_data === expected.file_data, "non-instant reset system file" );
-
- // check UI: these values should be reset
- expected =
- {
- // alas, we don't have XUL elements with typeof(value) == int :(
- // int: 0,
- int: "",
- bool: false,
- string: "",
- wstring_data: "",
- unichar_data: "",
- file_data: "",
- wstring: {},
- unichar: {},
- file: {}
- };
- found = ReadPrefsFromUI(aPrefWindow);
- ok(found.int === expected.int, "non-instant reset element int" );
- ok(found.bool === expected.bool, "non-instant reset element bool" );
- ok(found.string === expected.string, "non-instant reset element string" );
- ok(found.wstring_data === expected.wstring_data, "non-instant reset element wstring");
- ok(found.unichar_data === expected.unichar_data, "non-instant reset element unichar");
-// ok(found.file_data === expected.file_data, "non-instant reset element file" );
-
- // check hasUserValue
- ok(GetXULElement(aPrefWindow, "tests.static_preference_int" ).hasUserValue === false, "non-instant reset hasUserValue int" );
- ok(GetXULElement(aPrefWindow, "tests.static_preference_bool" ).hasUserValue === false, "non-instant reset hasUserValue bool" );
- ok(GetXULElement(aPrefWindow, "tests.static_preference_string" ).hasUserValue === false, "non-instant reset hasUserValue string" );
- ok(GetXULElement(aPrefWindow, "tests.static_preference_wstring").hasUserValue === false, "non-instant reset hasUserValue wstring");
- ok(GetXULElement(aPrefWindow, "tests.static_preference_unichar").hasUserValue === false, "non-instant reset hasUserValue unichar");
- ok(GetXULElement(aPrefWindow, "tests.static_preference_file" ).hasUserValue === false, "non-instant reset hasUserValue file" );
- }
-
- function RunNonInstantPrefTestClose(aPrefWindow)
- {
- WritePrefsToPreferences(aPrefWindow, kPrefValueSet2);
- }
-
- function RunCheckCommandRedirect(aPrefWindow)
- {
- GetXULElement(aPrefWindow, "checkbox").click();
- ok(GetXULElement(aPrefWindow, "tests.static_preference_bool").value, "redirected command bool");
- GetXULElement(aPrefWindow, "checkbox").click();
- ok(!GetXULElement(aPrefWindow, "tests.static_preference_bool").value, "redirected command bool");
- }
-
- function RunResetPrefTest(aPrefWindow)
- {
- // try resetting the prefs to default values
- GetXULElement(aPrefWindow, "tests.static_preference_int" ).reset();
- GetXULElement(aPrefWindow, "tests.static_preference_bool" ).reset();
- GetXULElement(aPrefWindow, "tests.static_preference_string" ).reset();
- GetXULElement(aPrefWindow, "tests.static_preference_wstring").reset();
- GetXULElement(aPrefWindow, "tests.static_preference_unichar").reset();
- GetXULElement(aPrefWindow, "tests.static_preference_file" ).reset();
- }
-
- function InitTestPrefs(aInstantApply)
- {
- // set instant apply mode and init prefs to set 1
- kPref.setBoolPref("browser.preferences.instantApply", aInstantApply);
- WritePrefsToSystem(kPrefValueSet1);
- }
-
- function RunTestInstant()
- {
- // test with instantApply
- InitTestPrefs(true);
- openDialog("window_preferences.xul", "", "modal", RunInstantPrefTest, false);
-
- // - test deferred reset in child window
- InitTestPrefs(true);
- openDialog("window_preferences2.xul", "", "modal", RunResetPrefTest, false);
- expected = kPrefValueSet1;
- found = ReadPrefsFromSystem();
- ok(found.int === expected.int, "instant reset deferred int" );
- ok(found.bool === expected.bool, "instant reset deferred bool" );
- ok(found.string === expected.string, "instant reset deferred string" );
- ok(found.wstring_data === expected.wstring_data, "instant reset deferred wstring");
- ok(found.unichar_data === expected.unichar_data, "instant reset deferred unichar");
- todo(found.file_data === expected.file_data, "instant reset deferred file" );
- }
-
- function RunTestNonInstant()
- {
- // test without instantApply
- // - general tests, similar to instant apply
- InitTestPrefs(false);
- openDialog("window_preferences.xul", "", "modal", RunNonInstantPrefTestGeneral, false);
-
- // - test Cancel
- InitTestPrefs(false);
- openDialog("window_preferences.xul", "", "modal", RunNonInstantPrefTestClose, false);
- var expected = kPrefValueSet1;
- var found = ReadPrefsFromSystem();
- ok(found.int === expected.int, "non-instant cancel system int" );
- ok(found.bool === expected.bool, "non-instant cancel system bool" );
- ok(found.string === expected.string, "non-instant cancel system string" );
- ok(found.wstring_data === expected.wstring_data, "non-instant cancel system wstring");
- ok(found.unichar_data === expected.unichar_data, "non-instant cancel system unichar");
- todo(found.file_data === expected.file_data, "non-instant cancel system file" );
-
- // - test Accept
- InitTestPrefs(false);
- openDialog("window_preferences.xul", "", "modal", RunNonInstantPrefTestClose, true);
- expected = kPrefValueSet2;
- found = ReadPrefsFromSystem();
- ok(found.int === expected.int, "non-instant accept system int" );
- ok(found.bool === expected.bool, "non-instant accept system bool" );
- ok(found.string === expected.string, "non-instant accept system string" );
- ok(found.wstring_data === expected.wstring_data, "non-instant accept system wstring");
- ok(found.unichar_data === expected.unichar_data, "non-instant accept system unichar");
- todo(found.file_data === expected.file_data, "non-instant accept system file" );
-
- // - test deferred reset in child window
- InitTestPrefs(false);
- openDialog("window_preferences2.xul", "", "modal", RunResetPrefTest, true);
- expected = CreateEmptyPrefValueSet();
- found = ReadPrefsFromSystem();
- ok(found.int === expected.int, "non-instant reset deferred int" );
- ok(found.bool === expected.bool, "non-instant reset deferred bool" );
- ok(found.string === expected.string, "non-instant reset deferred string" );
- ok(found.wstring_data === expected.wstring_data, "non-instant reset deferred wstring");
- ok(found.unichar_data === expected.unichar_data, "non-instant reset deferred unichar");
- ok(found.file_data === expected.file_data, "non-instant reset deferred file" );
- }
-
- function RunTestCommandRedirect()
- {
- openDialog("window_preferences_commandretarget.xul", "", "modal", RunCheckCommandRedirect, true);
- }
-
- function RunTest()
- {
- RunTestInstant();
- RunTestNonInstant();
- RunTestCommandRedirect();
- SimpleTest.finish();
- }
- ]]>
- </script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
- </body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_preferences_beforeaccept.xul b/toolkit/content/tests/chrome/test_preferences_beforeaccept.xul
deleted file mode 100644
index a1abad3cc..000000000
--- a/toolkit/content/tests/chrome/test_preferences_beforeaccept.xul
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Preferences Window beforeaccept Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/MochiKit/packed.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <script type="application/javascript">
- <![CDATA[
- SimpleTest.waitForExplicitFinish();
- SpecialPowers.pushPrefEnv({"set":[["browser.preferences.instantApply", false]]}, function() {
-
- // No instant-apply for this test
- var prefWindow = openDialog("window_preferences_beforeaccept.xul", "", "", windowOnload);
-
- function windowOnload() {
- var dialogShown = prefWindow.document.getElementById("tests.beforeaccept.dialogShown");
- var called = prefWindow.document.getElementById("tests.beforeaccept.called");
- is(dialogShown.value, true, "dialog opened, shown pref set");
- is(dialogShown.valueFromPreferences, null, "shown pref not committed");
- is(called.value, null, "beforeaccept not yet called");
- is(called.valueFromPreferences, null, "beforeaccept not yet called, pref not committed");
-
- // try to accept the dialog, should fail the first time
- prefWindow.document.documentElement.acceptDialog();
- is(prefWindow.closed, false, "window not closed");
- is(dialogShown.value, true, "shown pref still set");
- is(dialogShown.valueFromPreferences, null, "shown pref still not committed");
- is(called.value, true, "beforeaccept called");
- is(called.valueFromPreferences, null, "called pref not committed");
-
- // try again, this one should succeed
- prefWindow.document.documentElement.acceptDialog();
- is(prefWindow.closed, true, "window now closed");
- is(dialogShown.valueFromPreferences, true, "shown pref committed");
- is(called.valueFromPreferences, true, "called pref committed");
-
- SimpleTest.finish();
- }
-});
- ]]>
- </script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
- </body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_preferences_onsyncfrompreference.xul b/toolkit/content/tests/chrome/test_preferences_onsyncfrompreference.xul
deleted file mode 100644
index 8a191d97a..000000000
--- a/toolkit/content/tests/chrome/test_preferences_onsyncfrompreference.xul
+++ /dev/null
@@ -1,62 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- - You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<window title="Preferences Window beforeaccept Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/MochiKit/packed.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <script type="application/javascript">
- <![CDATA[
- const PREFS = ['tests.onsyncfrompreference.pref1',
- 'tests.onsyncfrompreference.pref2',
- 'tests.onsyncfrompreference.pref3'];
-
- SimpleTest.waitForExplicitFinish();
-
- for (let pref of PREFS) {
- SpecialPowers.setIntPref(pref, 1);
- }
-
- let counter = 0;
- let prefWindow = openDialog("window_preferences_onsyncfrompreference.xul", "", "", onSync);
-
- SimpleTest.registerCleanupFunction(() => {
- for (let pref of PREFS) {
- SpecialPowers.clearUserPref(pref);
- }
- prefWindow.close();
- });
-
- // Onsyncfrompreference handler for the prefs
- function onSync() {
- for (let pref of PREFS) {
- // The `value` field of each <preference> element should be initialized by now.
-
- is(SpecialPowers.getIntPref(pref), prefWindow.document.getElementById(pref).value,
- "Pref constructor was called correctly")
- }
-
- counter++;
-
- if (counter == PREFS.length) {
- SimpleTest.finish();
- }
- return true;
- }
- ]]>
- </script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
- </body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_progressmeter.xul b/toolkit/content/tests/chrome/test_progressmeter.xul
deleted file mode 100644
index 7810f6991..000000000
--- a/toolkit/content/tests/chrome/test_progressmeter.xul
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for progressmeter
- -->
-<window title="Progressmeter" width="500" height="600"
- onload="doTests()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <progressmeter id="n1"/>
- <progressmeter id="n2" mode="undetermined"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-SimpleTest.waitForExplicitFinish();
-
-function doTests() {
- var n1 = document.getElementById("n1");
- var n2 = document.getElementById("n2");
-
- SimpleTest.is(n1.mode, "", "mode determined");
- SimpleTest.is(n2.mode, "undetermined", "mode undetermined");
-
- SimpleTest.is(n1.value, "0", "determined value");
- SimpleTest.is(n2.value, "0", "undetermined value");
-
- // values can only be incremented in multiples of 4
- n1.value = 2;
- SimpleTest.is(n1.value, "0", "determined value set 2");
- n1.value = -1;
- SimpleTest.is(n1.value, "0", "determined value set -1");
- n1.value = 125;
- SimpleTest.is(n1.value, "100", "determined value set 125");
- n1.value = 7;
- SimpleTest.is(n1.value, "7", "determined value set 7");
- n1.value = "17";
- SimpleTest.is(n1.value, "17", "determined value set 17 string");
- n1.value = 18;
- SimpleTest.is(n1.value, "17", "determined value set 18");
- n1.value = "Cat";
- SimpleTest.is(n1.value, "17", "determined value set invalid");
-
- n1.max = 200;
- is(n1.max, "200", "max changed");
- n1.value = 150;
- n1.max = 120;
- is(n1.value, "120", "max lowered below value");
-
- n2.value = 2;
- SimpleTest.is(n2.value, "0", "undetermined value set 2");
- n2.value = -1;
- SimpleTest.is(n2.value, "0", "undetermined value set -1");
- n2.value = 125;
- SimpleTest.is(n2.value, "100", "undetermined value set 125");
- n2.value = 7;
- SimpleTest.is(n2.value, "7", "undetermined value set 7");
- n2.value = "17";
- SimpleTest.is(n2.value, "17", "undetermined value set 17 string");
- n2.value = 18;
- SimpleTest.is(n2.value, "17", "undetermined value set 18");
- n2.value = "Cat";
- SimpleTest.is(n2.value, "17", "determined value set invalid");
-
- SimpleTest.finish();
-}
-
-]]></script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_props.xul b/toolkit/content/tests/chrome/test_props.xul
deleted file mode 100644
index 17513df5c..000000000
--- a/toolkit/content/tests/chrome/test_props.xul
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for basic properties - this test checks that the basic
- properties defined in general.xml and inherited by a number of elements
- work properly.
- -->
-<window title="Basic Properties Test"
- onload="setTimeout(test_props, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<command id="cmd_nothing"/>
-<command id="cmd_action"/>
-
-<button id="button" label="Button" accesskey="B"
- crop="end" image="happy.png" command="cmd_nothing"/>
-<checkbox id="checkbox" label="Checkbox" accesskey="B"
- crop="end" image="happy.png" command="cmd_nothing"/>
-<radiogroup>
- <radio id="radio" label="Radio Button" value="rb1" accesskey="B"
- crop="end" image="happy.png" command="cmd_nothing"/>
-</radiogroup>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function test_props()
-{
- test_props_forelement($("button"), "Button", null);
- test_props_forelement($("checkbox"), "Checkbox", null);
- test_props_forelement($("radio"), "Radio Button", "rb1");
-
- SimpleTest.finish();
-}
-
-function test_props_forelement(element, label, value)
-{
- // check the initial values
- is(element.label, label, "element label");
- if (value)
- is(element.value, value, "element value");
- is(element.accessKey, "B", "element accessKey");
- is(element.crop, "end", "element crop");
- is(element.image, "happy.png", "element image");
- is(element.command, "cmd_nothing", "element command");
- ok(element.tabIndex === 0, "element tabIndex");
-
- synthesizeMouseExpectEvent(element, 4, 4, { }, $("cmd_nothing"), "command", "element");
-
- // make sure that setters return the value
- is(element.label = "Label", "Label", "element label setter return");
- if (value)
- is(element.value = "lb", "lb", "element value setter return");
- is(element.accessKey = "L", "L", "element accessKey setter return");
- is(element.crop = "start", "start", "element crop setter return");
- is(element.image = "sad.png", "sad.png", "element image setter return");
- is(element.command = "cmd_action", "cmd_action", "element command setter return");
-
- // check the value after it was changed
- is(element.label, "Label", "element label after set");
- if (value)
- is(element.value, "lb", "element value after set");
- is(element.accessKey, "L", "element accessKey after set");
- is(element.crop, "start", "element crop after set");
- is(element.image, "sad.png", "element image after set");
- is(element.command, "cmd_action", "element command after set");
-
- synthesizeMouseExpectEvent(element, 4, 4, { }, $("cmd_action"), "command", "element");
-
- // check that clicks on disabled items don't fire a command event
- ok((element.disabled = true) === true, "element disabled setter return");
- ok(element.disabled === true, "element disabled after set");
- synthesizeMouseExpectEvent(element, 4, 4, { }, $("cmd_action"), "!command", "element");
-
- element.disabled = false;
-}
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_radio.xul b/toolkit/content/tests/chrome/test_radio.xul
deleted file mode 100644
index 74ab66a34..000000000
--- a/toolkit/content/tests/chrome/test_radio.xul
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for radio buttons
- -->
-<window title="Radio Buttons" width="500" height="600"
- onload="setTimeout(test_radio, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="application/javascript" src="xul_selectcontrol.js"/>
-
-<radiogroup id="radiogroup"/>
-
-<radiogroup id="radiogroup-initwithvalue" value="two">
- <radio label="One" value="one"/>
- <radio label="Two" value="two"/>
- <radio label="Three" value="three"/>
-</radiogroup>
-<radiogroup id="radiogroup-initwithselected" value="two">
- <radio id="one" label="One" value="one" accesskey="o"/>
- <radio id="two" label="Two" value="two" accesskey="t"/>
- <radio label="Three" value="three" selected="true"/>
-</radiogroup>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function test_radio()
-{
- var element = document.getElementById("radiogroup");
- test_nsIDOMXULSelectControlElement(element, "radio", null);
- test_nsIDOMXULSelectControlElement_UI(element, null);
-
- window.blur();
-
- var accessKeyDetails = (navigator.platform.indexOf("Mac") >= 0) ?
- { altKey : true, ctrlKey : true } :
- { altKey : true, shiftKey: true };
- synthesizeKey("t", accessKeyDetails);
-
- var radiogroup = $("radiogroup-initwithselected");
- is(document.activeElement, radiogroup, "accesskey focuses radiogroup");
- is(radiogroup.selectedItem, $("two"), "accesskey selects radio");
-
- $("radiogroup-initwithvalue").focus();
-
- $("one").disabled = true;
- synthesizeKey("o", accessKeyDetails);
-
- is(document.activeElement, $("radiogroup-initwithvalue"), "accesskey on disabled radio doesn't focus");
- is(radiogroup.selectedItem, $("two"), "accesskey on disabled radio doesn't change selection");
-
- SimpleTest.finish();
-}
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_richlist_direction.xul b/toolkit/content/tests/chrome/test_richlist_direction.xul
deleted file mode 100644
index f94f1b3ba..000000000
--- a/toolkit/content/tests/chrome/test_richlist_direction.xul
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for listbox direction
- -->
-<window title="Listbox direction test"
- onload="test_richlistbox()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
- <richlistbox seltype="multiple" id="richlistbox" flex="1" minheight="80" maxheight="80" height="80" />
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var richListBox = document.getElementById("richlistbox");
-
-function getScrollIndexAmount(aDirection) {
- return (4 * aDirection + richListBox.currentIndex);
-}
-
-function test_richlistbox()
-{
- richListBox.minHeight = richListBox.maxHeight = richListBox.height =
- 80 + (80 - richListBox.scrollBoxObject.height);
- var height = richListBox.scrollBoxObject.height;
- var item;
- do {
- item = richListBox.appendItem("Test", "");
- item.height = item.minHeight = item.maxHeight = Math.floor(height / 4);
- } while (item.getBoundingClientRect().bottom < (height * 2))
- richListBox.appendItem("Test", "");
- richListBox.firstChild.nextSibling.id = "list-box-first";
- richListBox.lastChild.previousSibling.id = "list-box-last";
-
- // direction = "reverse", the values here are backwards due to the fact that
- // richlistboxes respond differently when a user initiates a selection
- richListBox.dir = "reverse";
- var count = richListBox.itemCount;
- richListBox.focus();
- richListBox.selectedIndex = count - 1;
- sendKey("DOWN");
- is(richListBox.currentIndex, count - 2, "Selection should move to the next item");
- sendKey("UP");
- is(richListBox.currentIndex, count - 1, "Selection should move to the previous item");
- sendKey("END");
- is(richListBox.currentIndex, 0, "Selection should move to the last item");
- sendKey("HOME");
- is(richListBox.currentIndex, count - 1, "Selection should move to the first item");
- var currentIndex = richListBox.currentIndex;
- var index = getScrollIndexAmount(-1);
- sendKey("PAGE_DOWN");
- is(richListBox.currentIndex, index, "Selection should move to one page down");
- ok(richListBox.currentIndex < currentIndex, "Selection should move downwards");
- sendKey("END");
- currentIndex = richListBox.currentIndex;
- index = getScrollIndexAmount(1);
- sendKey("PAGE_UP");
- is(richListBox.currentIndex, index, "Selection should move to one page up");
- ok(richListBox.currentIndex > currentIndex, "Selection should move upwards");
- richListBox.selectedItem = richListBox.lastChild;
- richListBox.focus();
- synthesizeKey("KEY_ArrowDown", { shiftKey: true, code: "ArrowDown" }, window);
- let items = [richListBox.selectedItems[0],
- richListBox.selectedItems[1]];
- is(items[0], richListBox.lastChild, "The last element should still be selected");
- is(items[1], richListBox.lastChild.previousSibling, "Both elements should now be selected");
- richListBox.clearSelection();
- richListBox.selectedItem = richListBox.lastChild;
- sendMouseEvent({type: "click", shiftKey: true, clickCount: 1},
- "list-box-last",
- window);
- items = [richListBox.selectedItems[0],
- richListBox.selectedItems[1]];
- is(items[0], richListBox.lastChild, "The last element should still be selected");
- is(items[1], richListBox.lastChild.previousSibling, "Both elements should now be selected");
- richListBox.addEventListener("keypress", function(aEvent) {
- richListBox.removeEventListener("keypress", arguments.callee, true);
- aEvent.preventDefault();
- }, true);
- richListBox.selectedIndex = 1;
- sendKey("HOME");
- is(richListBox.selectedIndex, 1, "A stopped event should return indexing to normal");
-
- // direction = "normal"
- richListBox.dir = "normal";
- richListBox.selectedIndex = 0;
- sendKey("DOWN");
- is(richListBox.currentIndex, 1, "Selection should move to the next item");
- sendKey("UP");
- is(richListBox.currentIndex, 0, "Selection should move to the previous item");
- sendKey("END");
- is(richListBox.currentIndex, count - 1, "Selection should move to the last item");
- sendKey("HOME");
- is(richListBox.currentIndex, 0, "Selection should move to the first item");
- var currentIndex = richListBox.currentIndex;
- var index = richListBox.scrollOnePage(1);
- sendKey("PAGE_DOWN");
- is(richListBox.currentIndex, index, "Selection should move to one page down");
- ok(richListBox.currentIndex > currentIndex, "Selection should move downwards");
- sendKey("END");
- currentIndex = richListBox.currentIndex;
- index = richListBox.scrollOnePage(-1) + richListBox.currentIndex;
- sendKey("PAGE_UP");
- is(richListBox.currentIndex, index, "Selection should move to one page up");
- ok(richListBox.currentIndex < currentIndex, "Selection should move upwards");
- richListBox.selectedItem = richListBox.firstChild;
- richListBox.focus();
- synthesizeKey("KEY_ArrowDown", { shiftKey: true, code: "ArrowDown" }, window);
- items = [richListBox.selectedItems[0],
- richListBox.selectedItems[1]];
- is(items[0], richListBox.firstChild, "The last element should still be selected");
- is(items[1], richListBox.firstChild.nextSibling, "Both elements should now be selected");
- richListBox.clearSelection();
- richListBox.selectedItem = richListBox.firstChild;
- sendMouseEvent({type: "click", shiftKey: true, clickCount: 1},
- "list-box-first",
- window);
- items = [richListBox.selectedItems[0],
- richListBox.selectedItems[1]];
- is(items[0], richListBox.firstChild, "The last element should still be selected");
- is(items[1], richListBox.firstChild.nextSibling, "Both elements should now be selected");
- SimpleTest.finish();
-}
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_righttoleft.xul b/toolkit/content/tests/chrome/test_righttoleft.xul
deleted file mode 100644
index 64b1419da..000000000
--- a/toolkit/content/tests/chrome/test_righttoleft.xul
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet
- href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-
-<window title="Right to Left UI Test"
- onload="runTest()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript"
- src="chrome://mochikit/content/chrome-harness.js"></script>
- <script type="application/javascript"
- src="RegisterUnregisterChrome.js"></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none">
- </div>
- <pre id="test">
- </pre>
- </body>
-
- <iframe id="subframe" width="100" height="100" onload="frameLoaded();"/>
-
- <script type="application/javascript">
- <![CDATA[
-
- SimpleTest.waitForExplicitFinish();
-
- let prefs = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefBranch);
- const UI_DIRECTION_PREF = "intl.uidirection.ar";
- prefs.setCharPref(UI_DIRECTION_PREF, "rtl");
-
- let rootDir = getRootDirectory(window.location.href);
- registerManifestPermanently(rootDir + "rtltest/righttoleft.manifest");
-
- function runTest()
- {
- var subframe = document.getElementById("subframe");
- subframe.setAttribute("src", "chrome://ltrtest/content/dirtest.xul");
- }
-
- function frameLoaded()
- {
- var subframe = document.getElementById("subframe");
- var subwin = subframe.contentWindow;
- var subdoc = subframe.contentDocument;
- var url = String(subwin.location);
- if (url.indexOf("chrome://ltrtest") == 0) {
- is(subwin.getComputedStyle(subdoc.getElementById("hbox"), "").backgroundColor,
- "rgb(255, 255, 0)", "left to right with :-moz-locale-dir(ltr)");
- is(subwin.getComputedStyle(subdoc.getElementById("vbox"), "").backgroundColor,
- "rgb(255, 255, 255)", "left to right with :-moz-locale-dir(rtl)");
-
- is(subwin.getComputedStyle(subdoc.documentElement, "").direction, "ltr",
- "left to right direction");
-
- subdoc.documentElement.setAttribute("localedir", "rtl");
-
- is(subwin.getComputedStyle(subdoc.getElementById("hbox"), "").backgroundColor,
- "rgb(255, 255, 255)", "left to right with :-moz-locale-dir(ltr) and localedir='rtl'");
- is(subwin.getComputedStyle(subdoc.getElementById("vbox"), "").backgroundColor,
- "rgb(0, 128, 0)", "left to right with :-moz-locale-dir(rtl) and localedir='rtl'");
- is(subwin.getComputedStyle(subdoc.documentElement, "").direction, "rtl",
- "left to right direction with localedir='rtl'");
-
- subdoc.documentElement.removeAttribute("localedir");
-
- is(subwin.getComputedStyle(subdoc.getElementById("hbox"), "").backgroundColor,
- "rgb(255, 255, 0)", "left to right with :-moz-locale-dir(ltr) and localedir removed");
- is(subwin.getComputedStyle(subdoc.getElementById("vbox"), "").backgroundColor,
- "rgb(255, 255, 255)", "left to right with :-moz-locale-dir(rtl) and localedir removed");
- is(subwin.getComputedStyle(subdoc.documentElement, "").direction, "ltr",
- "left to right direction with localedir removed");
-
- subframe.setAttribute("src", "chrome://rtltest/content/dirtest.xul");
- }
- else if (url.indexOf("chrome://rtltest") == 0) {
- is(subwin.getComputedStyle(subdoc.getElementById("hbox"), "").backgroundColor,
- "rgb(255, 255, 255)", "right to left with :-moz-locale-dir(ltr)");
- is(subwin.getComputedStyle(subdoc.getElementById("vbox"), "").backgroundColor,
- "rgb(0, 128, 0)", "right to left with :-moz-locale-dir(rtl)");
- is(subwin.getComputedStyle(subdoc.documentElement, "").direction, "rtl",
- "right to left direction");
-
- subdoc.documentElement.setAttribute("localedir", "ltr");
-
- is(subwin.getComputedStyle(subdoc.getElementById("hbox"), "").backgroundColor,
- "rgb(255, 255, 0)", "right to left with :-moz-locale-dir(ltr) and localedir='ltr'");
- is(subwin.getComputedStyle(subdoc.getElementById("vbox"), "").backgroundColor,
- "rgb(255, 255, 255)", "right to left with :-moz-locale-dir(rtl) and localedir='ltr'");
- is(subwin.getComputedStyle(subdoc.documentElement, "").direction, "ltr",
- "right to left direction with localedir='ltr'");
-
- subdoc.documentElement.removeAttribute("localedir");
-
- prefs.setCharPref(UI_DIRECTION_PREF, "");
- is(subwin.getComputedStyle(subdoc.documentElement, "").direction, "ltr",
- "left to right direction with no preference set");
- prefs.setCharPref(UI_DIRECTION_PREF + "-QA", "rtl");
- is(subwin.getComputedStyle(subdoc.documentElement, "").direction, "rtl",
- "right to left direction with more specific preference set");
- prefs.setCharPref(UI_DIRECTION_PREF, "ltr");
- is(subwin.getComputedStyle(subdoc.documentElement, "").direction, "rtl",
- "right to left direction with less specific and more specific preference set");
- prefs.setCharPref(UI_DIRECTION_PREF, "rtl");
- prefs.setCharPref(UI_DIRECTION_PREF + "-QA", "ltr");
- is(subwin.getComputedStyle(subdoc.documentElement, "").direction, "ltr",
- "left to right direction specific preference overrides");
- if (prefs.prefHasUserValue(UI_DIRECTION_PREF + "-QA"))
- prefs.clearUserPref(UI_DIRECTION_PREF + "-QA");
-
- if (prefs.prefHasUserValue(UI_DIRECTION_PREF))
- prefs.clearUserPref(UI_DIRECTION_PREF);
-
- SimpleTest.finish();
- }
- }
- ]]>
- </script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_scale.xul b/toolkit/content/tests/chrome/test_scale.xul
deleted file mode 100644
index c1adea7ff..000000000
--- a/toolkit/content/tests/chrome/test_scale.xul
+++ /dev/null
@@ -1,277 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for scale
- -->
-<window title="scale" width="500" height="600"
- onload="setTimeout(testtag_scale, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<hbox>
- <vbox>
- <scale id="scale-horizontal-normal"/>
- <scale id="scale-horizontal-reverse" dir="reverse"/>
- </vbox>
- <scale id="scale-vertical-normal" orient="vertical"/>
- <scale id="scale-vertical-reverse" orient="vertical" dir="reverse"/>
-</hbox>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script>
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function testtag_scale()
-{
- testtag_scale_inner("scale-horizontal-normal", true, false);
- testtag_scale_inner("scale-horizontal-reverse", true, true);
- testtag_scale_inner("scale-vertical-normal", false, false);
- testtag_scale_inner("scale-vertical-reverse", false, true);
-
- SimpleTest.finish();
-}
-
-function testtag_scale_inner(elementid, horiz, reverse)
-{
- var testid = (horiz ? "horizontal " : "vertical ") +
- (reverse ? "reverse " : "normal ");
-
- var element = document.getElementById(elementid);
-
- testtag_scale_States(element, 0, "", 0, 100, testid + "initial");
-
- element.min = 0;
- element.max = 10;
- testtag_scale_States(element, 0, "", 0, 10, testid + "first set");
-
- element.decrease();
- is(element.value, 0, testid + "decrease");
- element.increase();
- is(element.value, 1, testid + "increase");
- element.value = 0;
- is(element.value, 0, testid + "set value");
-
- testtag_scale_Increments(element, 0, 10, 6, 7, testid + "increase decrease");
-
- // check if changing the min and max adjusts the value to fit in range
- element.min = 5;
- testtag_scale_States(element, 5, "5", 5, 10, testid + "change min");
- element.value = 15;
- is(element.value, 10, testid + "change minmax value set too high");
- element.max = 8;
- is(element.value, 8, testid + "change max");
- element.value = 2;
- is(element.value, 5, testid + "change minmax set too low");
-
- // check negative values
- element.min = -15;
- element.max = -5;
- testtag_scale_States(element, -5, "-5", -15, -5, testid + "minmax negative");
- element.value = -15;
- is(element.value, -15, testid + "change max negative");
- testtag_scale_Increments(element, -15, -5, 7, 8, testid + "increase decrease negative");
-
- // check case when min is negative and max is positive
- element.min = -10;
- element.max = 35;
- testtag_scale_States(element, -10, "-10", -10, 35, testid + "minmax mixed sign");
- testtag_scale_Increments(element, -10, 35, 25, 30, testid + "increase decrease mixed sign");
-
- testtag_scale_UI(element, testid, horiz, reverse);
-}
-
-function testtag_scale_UI(element, testid, horiz, reverse)
-{
- element.min = 0;
- element.max = 20;
- element.value = 7;
- element.increment = 2;
- element.pageIncrement = 4;
-
- element.focus();
-
- var leftIncrements = horiz && reverse;
- var upDecrements = !horiz && !reverse;
- synthesizeKeyExpectEvent("VK_LEFT", { }, element, "change", testid + "key left");
- is(element.value, leftIncrements ? 9 : 5, testid + " key left");
- synthesizeKeyExpectEvent("VK_RIGHT", { }, element, "change", testid + "key right");
- is(element.value, 7, testid + " key right");
- synthesizeKeyExpectEvent("VK_UP", { }, element, "change", testid + "key up");
- is(element.value, upDecrements ? 5 : 9, testid + " key up");
- synthesizeKeyExpectEvent("VK_DOWN", { }, element, "change", testid + "key down");
- is(element.value, 7, testid + " key down");
-
- synthesizeKeyExpectEvent("VK_PAGE_UP", { }, element, "change", testid + "key page up");
- is(element.value, upDecrements ? 3 : 11, testid + " key page up");
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { }, element, "change", testid + "key page down");
- is(element.value, 7, testid + " key page down");
-
- synthesizeKeyExpectEvent("VK_HOME", { }, element, "change", testid + "key home");
- is(element.value, reverse ? 20 : 0, testid + " key home");
- synthesizeKeyExpectEvent("VK_END", { }, element, "change", testid + "key end");
- is(element.value, reverse ? 0 : 20, testid + " key end");
-
- testtag_scale_UI_Mouse(element, testid, horiz, reverse, 4);
-
- element.min = 4;
- element.pageIncrement = 3;
- testtag_scale_UI_Mouse(element, testid + " with min", horiz, reverse, 3);
-
- element.pageIncrement = 30;
- testtag_scale_UI_Mouse(element, testid + " with min past", horiz, reverse, 30);
-}
-
-function testtag_scale_UI_Mouse(element, testid, horiz, reverse, pinc)
-{
- var initial = reverse ? 8 : 12;
- var newval = initial + (reverse ? pinc : -pinc);
- var endval = initial;
- // in the pinc == 30 case, the page increment is large enough that it would
- // just cause the thumb to reach the end of the scale. Make sure that the
- // mouse click does not go past the end.
- if (pinc == 30) {
- newval = reverse ? 20 : 4;
- endval = reverse ? 4 : 20;
- }
- element.value = initial;
-
- var hmove = horiz ? 25 : 10;
- var vmove = horiz ? 10 : 25;
-
- var leftFn = function () { return reverse ? element.value < newval + 3 : element.value > newval - 3; }
- var rightFn = function () { return reverse ? element.value < endval - 3 : element.value < endval + 3; }
-
- // check that clicking the mouse on the trough moves the thumb properly
- synthesizeMouseExpectEvent(element, hmove, vmove, { }, element, "change", testid + "mouse on left movetoclick=default");
-
- if (navigator.platform.indexOf("Mac") >= 0) {
- if (pinc == 30)
- ok(element.value > 4, testid + " mouse on left movetoclick=default");
- else
- ok(leftFn, testid + " mouse on left movetoclick=default");
- }
- else {
- is(element.value, newval, testid + " mouse on left movetoclick=default");
- }
-
- var rect = element.getBoundingClientRect();
- synthesizeMouseExpectEvent(element, rect.right - rect.left - hmove,
- rect.bottom - rect.top - vmove, { },
- element, "change", testid + " mouse on right movetoclick=default");
-
- if (navigator.platform.indexOf("Mac") >= 0) {
- if (pinc == 30)
- ok(element.value < 20, testid + " mouse on right movetoclick=default");
- else
- ok(rightFn, testid + " mouse on right movetoclick=default");
- }
- else {
- is(element.value, endval, testid + " mouse on right movetoclick=default");
- }
-
- element.setAttribute("movetoclick", "true");
- element.value = initial;
-
- synthesizeMouseExpectEvent(element, hmove, vmove, { }, element, "change", testid + "mouse on left movetoclick=true");
- if (pinc == 30)
- ok(element.value > 4, testid + " mouse on left movetoclick=true");
- else
- ok(leftFn, testid + " mouse on left movetoclick=true");
-
- var rect = element.getBoundingClientRect();
- synthesizeMouseExpectEvent(element, rect.right - rect.left - hmove,
- rect.bottom - rect.top - vmove, { },
- element, "change", testid + " mouse on right movetoclick=true");
- if (pinc == 30)
- ok(element.value < 20, testid + " mouse on right movetoclick=true");
- else
- ok(rightFn, testid + " mouse on right movetoclick=true");
-
- element.setAttribute("movetoclick", "false");
- element.value = initial;
-
- synthesizeMouseExpectEvent(element, hmove, vmove, { }, element, "change", testid + "mouse on left movetoclick=false");
- is(element.value, newval, testid + " mouse on left movetoclick=false");
-
- var rect = element.getBoundingClientRect();
- synthesizeMouseExpectEvent(element, rect.right - rect.left - hmove,
- rect.bottom - rect.top - vmove, { },
- element, "change", testid + " mouse on right movetoclick=false");
- is(element.value, endval, testid + " mouse on right movetoclick=false");
-
- element.removeAttribute("movetoclick");
-
- element.value = reverse ? element.max : element.min;
-
- synthesizeMouse(element, 8, 8, { type: "mousedown" });
- synthesizeMouse(element, horiz ? 2000 : 8, horiz ? 8 : 2000, { type: "mousemove" });
- is(element.value, reverse ? element.min : element.max, testid + " move mouse too far after end");
- synthesizeMouse(element, 2, 2, { type: "mouseup" });
-
- synthesizeMouse(element, rect.width - 8, rect.height - 8, { type: "mousedown" });
- synthesizeMouse(element, horiz ? -2000 : rect.width - 8, horiz ? rect.height - 8 : -2000, { type: "mousemove" });
- is(element.value, reverse ? element.max : element.min, testid + " move mouse too far before start");
-
- synthesizeMouse(element, 2, 2, { type: "mouseup" });
-
- // now check if moving outside in both directions works. On Windows,
- // it should snap back to the original location.
- element.value = reverse ? element.max : element.min;
-
- var expected = (navigator.platform.indexOf("Win") >= 0) ? element.value :
- (reverse ? element.min : element.max);
- synthesizeMouse(element, 7, 7, { type: "mousedown" });
- synthesizeMouse(element, 2000, 2000, { type: "mousemove" });
- is(element.value, expected, testid + " move mouse ouside in both directions");
- synthesizeMouse(element, 2, 2, { type: "mouseup" });
-}
-
-function testtag_scale_States(element, evalue, evalueattr, emin, emax, testid)
-{
- is(element.getAttribute("value"), evalueattr, testid + " value attribute");
- is(element.value, evalue, testid + " value");
- is(element.min, emin, testid + " min");
- is(element.max, emax, testid + " max");
-}
-
-function testtag_scale_Increments(element, min, max, increment, pageIncrement, testid)
-{
- // check the increase and decrease methods
- element.increment = increment;
- element.increase();
- is(element.value, min + increment, testid + " increase 1");
- element.increase();
- is(element.value, max, testid + " increase 2");
- element.decrease();
- is(element.value, max - increment, testid + " decrease 1");
- element.decrease();
- is(element.value, min, testid + " decrease 2");
-
- // check the increasePage and decreasePage methods
- element.pageIncrement = pageIncrement;
- element.increasePage();
- is(element.value, min + pageIncrement, testid + " increasePage 1");
- element.increasePage();
- is(element.value, max, testid + " increasePage 2");
- element.decreasePage();
- is(element.value, max - pageIncrement, testid + " decreasePage 1");
- element.decreasePage();
- is(element.value, min, testid + " decreasePage 2");
-}
-
-]]>
-
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_scaledrag.xul b/toolkit/content/tests/chrome/test_scaledrag.xul
deleted file mode 100644
index 82356ca1e..000000000
--- a/toolkit/content/tests/chrome/test_scaledrag.xul
+++ /dev/null
@@ -1,197 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
-XUL <scale> dragging tests
--->
-<window title="Dragging XUL scale tests" width="500" height="600"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
- <hbox flex="1">
- <scale id="scale1" orient="horizontal" flex="1" min="0" max="4" value="2"/>
- <scale id="scale2" orient="vertical" flex="1" min="0" max="4" value="2"/>
- <scale id="scale3" orient="horizontal" flex="1" movetoclick="true" min="0" max="4" value="2"/>
- </hbox>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script>
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-function getThumb(aScale) {
- return document.getAnonymousElementByAttribute(aScale, "class", "scale-thumb");
-}
-
-function sendTouch(aType, aRect, aDX, aDY, aMods) {
- var cwu = SpecialPowers.getDOMWindowUtils(window);
- var x = aRect.left + aRect.width/2 + aDX;
- var y = aRect.top + aRect.height/2 + aDY;
- if (/mouse/.test(aType))
- cwu.sendMouseEvent(aType, x, y, 0, 1, aMods || 0, false);
- else
- cwu.sendTouchEvent(aType, [0], [x], [y], [1], [1], [0], [1], 1, aMods || 0, true);
-}
-
-function getOffset(aScale, aDir) {
- var rect = aScale.getBoundingClientRect();
- var d = aScale.orient == "horizontal" ? rect.width/4 : rect.height/4;
- switch (aDir) {
- case "right": return [ d, 0];
- case "left": return [-1*d, 0];
- case "up": return [ 0,-1*d];
- case "down": return [ 0, d];
- case "downleft": return [ -1*d, d];
- case "upleft": return [ -1*d,-1*d];
- case "downright": return [d, d];
- case "upright": return [d,-1*d];
- }
- return [0,0];
-}
-
-function testTouchDragThumb(aDesc, aId, aDir, aVal1, aVal2, aMods) {
- info(aDesc);
- var scale = document.getElementById(aId);
- var [x,y] = getOffset(scale, aDir);
-
- sendTouch("touchstart", getThumb(scale).getBoundingClientRect(), 0, 0, aMods);
- is(scale.value, aVal1, "Touchstart on thumb has correct value");
- sendTouch("touchmove", getThumb(scale).getBoundingClientRect(), x, y, aMods);
- sendTouch("touchend", getThumb(scale).getBoundingClientRect(), 0, 0, aMods);
- is(scale.value, aVal2, "After touch " + (aDir ? ("and drag " + aDir + " ") : "") + "on thumb, scale has correct value");
-
- scale.value = 2;
-}
-
-function testMouseDragThumb(aDesc, aId, aDir, aVal1, aVal2, aMods) {
- info(aDesc);
- var scale = document.getElementById(aId);
- var [x,y] = getOffset(scale, aDir);
-
- sendTouch("mousedown", getThumb(scale).getBoundingClientRect(), 0, 0, aMods);
- is(scale.value, aVal1, "Mousedown on thumb has correct value");
- sendTouch("mousemove", getThumb(scale).getBoundingClientRect(), x, y, aMods);
- sendTouch("mouseup", getThumb(scale).getBoundingClientRect(), 0, 0, aMods);
- is(scale.value, aVal2, "After mouseup " + (aDir ? ("and drag " + aDir + " ") : "") + "on thumb, scale has correct value");
-
- scale.value = 2;
-}
-
-function testTouchDragSlider(aDesc, aId, aDir, aVal1, aVal2, aMods) {
- info(aDesc);
- var scale = document.getElementById(aId);
- var [x,y] = getOffset(scale, aDir);
-
- sendTouch("touchstart", getThumb(scale).getBoundingClientRect(), x, y, aMods);
- is(scale.value, aVal1, "Touchstart on slider has correct value");
- sendTouch("touchmove", getThumb(scale).getBoundingClientRect(), -x, -y, aMods);
- sendTouch("touchend", getThumb(scale).getBoundingClientRect(), 0, 0, aMods);
- is(scale.value, aVal2, "After touch " + (aDir ? ("and drag " + aDir + " ") : "") + "on slider, scale has correct value");
-
- scale.value = 2;
-}
-
-function testMouseDragSlider(aDesc, aId, aDir, aVal1, aVal2, aMods) {
- info(aDesc);
- var scale = document.getElementById(aId);
- var [x,y] = getOffset(scale, aDir);
-
- sendTouch("mousedown", getThumb(scale).getBoundingClientRect(), x, y, aMods);
- is(scale.value, aVal1, "Mousedown on slider has correct value");
- sendTouch("mousemove", getThumb(scale).getBoundingClientRect(), -x, -y, aMods);
- sendTouch("mouseup", getThumb(scale).getBoundingClientRect(), 0, 0, aMods);
- is(scale.value, aVal2, "After mouseup " + (aDir ? ("and drag " + aDir + " ") : "") + "on slider, scale has correct value");
-
- scale.value = 2;
-}
-
-function runTests() {
- // test dragging a horizontal slider with touch events by tapping on the thumb
- testTouchDragThumb("Touch Horizontal Thumb", "scale1", "", 2, 2);
- testTouchDragThumb("TouchDrag Horizontal Thumb Left", "scale1", "left", 2, 1);
- testTouchDragThumb("TouchDrag Horizontal Thumb Right", "scale1", "right", 2, 3);
- testTouchDragThumb("TouchDrag Horizontal Thumb Up", "scale1", "up", 2, 2);
- testTouchDragThumb("TouchDrag Horizontal Thumb Down", "scale1", "down", 2, 2);
- testTouchDragThumb("TouchDrag Horizontal Thumb Downleft", "scale1", "downleft", 2, 1);
- testTouchDragThumb("TouchDrag Horizontal Thumb Upleft", "scale1", "upleft", 2, 1);
- testTouchDragThumb("TouchDrag Horizontal Thumb Upright", "scale1", "upright", 2, 3);
- testTouchDragThumb("TouchDrag Horizontal Thumb Downright", "scale1", "downright", 2, 3);
-
- // test dragging a horizontal slider with mouse events by clicking on the thumb
- testMouseDragThumb("Click Horizontal Thumb", "scale1", "", 2, 2);
- testMouseDragThumb("MouseDrag Horizontal Thumb Left", "scale1", "left", 2, 1);
- testMouseDragThumb("MouseDrag Horizontal Thumb Right", "scale1", "right", 2, 3);
- testMouseDragThumb("MouseDrag Horizontal Thumb Up", "scale1", "up", 2, 2);
- testMouseDragThumb("MouseDrag Horizontal Thumb Down", "scale1", "down", 2, 2);
- testMouseDragThumb("MouseDrag Horizontal Thumb Downleft", "scale1", "downleft", 2, 1);
- testMouseDragThumb("MouseDrag Horizontal Thumb Upleft", "scale1", "upleft", 2, 1);
- testMouseDragThumb("MouseDrag Horizontal Thumb Upright", "scale1", "upright", 2, 3);
- testMouseDragThumb("MouseDrag Horizontal Thumb Downright", "scale1", "downright", 2, 3);
-
- // test dragging a vertical slider with touch events by tapping on the thumb
- testTouchDragThumb("Touch Vertical Thumb", "scale2", "", 2, 2);
- testTouchDragThumb("TouchDrag Vertical Thumb Left", "scale2", "left", 2, 2);
- testTouchDragThumb("TouchDrag Vertical Thumb Right", "scale2", "right", 2, 2);
- testTouchDragThumb("TouchDrag Vertical Thumb Up", "scale2", "up", 2, 1);
- testTouchDragThumb("TouchDrag Vertical Thumb Down", "scale2", "down", 2, 3);
- testTouchDragThumb("TouchDrag Vertical Thumb Downleft", "scale2", "downleft", 2, 3);
- testTouchDragThumb("TouchDrag Vertical Thumb Upleft", "scale2", "upleft", 2, 1);
- testTouchDragThumb("TouchDrag Vertical Thumb Upright", "scale2", "upright", 2, 1);
- testTouchDragThumb("TouchDrag Vertical Thumb Downright", "scale2", "downright", 2, 3);
-
- // test dragging a vertical slider with mouse events by clicking on the thumb
- testMouseDragThumb("Click Vertical Thumb", "scale2", "", 2, 2);
- testMouseDragThumb("MouseDrag Vertical Thumb Left", "scale2", "left", 2, 2);
- testMouseDragThumb("MouseDrag Vertical Thumb Right", "scale2", "right", 2, 2);
- testMouseDragThumb("MouseDrag Vertical Thumb Up", "scale2", "up", 2, 1);
- testMouseDragThumb("MouseDrag Vertical Thumb Down", "scale2", "down", 2, 3);
- testMouseDragThumb("MouseDrag Vertical Thumb Downleft", "scale2", "downleft", 2, 3);
- testMouseDragThumb("MouseDrag Vertical Thumb Upleft", "scale2", "upleft", 2, 1);
- testMouseDragThumb("MouseDrag Vertical Thumb Upright", "scale2", "upright", 2, 1);
- testMouseDragThumb("MouseDrag Vertical Thumb Downright", "scale2", "downright", 2, 3);
-
- var isMac = /Mac/.test(navigator.platform);
-
- // test dragging a slider by tapping off the thumb
- testTouchDragSlider("TouchDrag Slider Left", "scale1", "left", isMac ? 1 : 0, isMac ? 2 : 0);
- testTouchDragSlider("TouchDrag Slider Right", "scale1", "right", isMac ? 3 : 4, isMac ? 2 : 4);
- testMouseDragSlider("MouseDrag Slider Left", "scale1", "left", isMac ? 1 : 0, isMac ? 2 : 0);
- testMouseDragSlider("MouseDrag Slider Right", "scale1", "right", isMac ? 3 : 4, isMac ? 2 : 4);
-
- // test dragging a slider by tapping off the thumb and holding shift
- // modifiers don't affect touch events
- var mods = /Mac/.test(navigator.platform) ? Components.interfaces.nsIDOMNSEvent.ALT_MASK :
- Components.interfaces.nsIDOMNSEvent.SHIFT_MASK;
- testTouchDragSlider("TouchDrag Slider Left+Shift", "scale1", "left", isMac ? 1 : 0, isMac ? 2 : 0, mods);
- testTouchDragSlider("TouchDrag Slider Right+Shift", "scale1", "right", isMac ? 3 : 4, isMac ? 2 : 4, mods);
- testMouseDragSlider("MouseDrag Slider Left+Shift", "scale1", "left", isMac ? 0 : 1, isMac ? 0 : 2, mods);
- testMouseDragSlider("MouseDrag Slider Right+Shift", "scale1", "right", isMac ? 4 : 3, isMac ? 4 : 2, mods);
-
- // test dragging a slider with movetoclick="true" by tapping off the thumb
- testTouchDragSlider("TouchDrag Slider Left+MoveToClick", "scale3", "left", 1, 2);
- testTouchDragSlider("TouchDrag Slider Right+MoveToClick", "scale3", "right", 3, 2);
- testMouseDragSlider("MouseDrag Slider Left+MoveToClick", "scale3", "left", 1, 2);
- testMouseDragSlider("MouseDrag Slider Right+MoveToClick", "scale3", "right", 3, 2);
-
- // test dragging a slider by tapping off the thumb and holding shift
- // modifiers don't affect touch events
- testTouchDragSlider("MouseDrag Slider Left+MoveToClick+Shift", "scale3", "left", 1, 2, mods);
- testTouchDragSlider("MouseDrag Slider Right+MoveToClick+Shift", "scale3", "right", 3, 2, mods);
- testMouseDragSlider("MouseDrag Slider Left+MoveToClick+Shift", "scale3", "left", 0, 0, mods);
- testMouseDragSlider("MouseDrag Slider Right+MoveToClick+Shift", "scale3", "right", 4, 4, mods);
-
- SimpleTest.finish();
-}
-
-addLoadEvent(function() { SimpleTest.executeSoon(runTests); });
-]]></script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_screenPersistence.xul b/toolkit/content/tests/chrome/test_screenPersistence.xul
deleted file mode 100644
index 7d6325293..000000000
--- a/toolkit/content/tests/chrome/test_screenPersistence.xul
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Window Open Test"
- onload="runTest()"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<script class="testbody" type="application/javascript"><![CDATA[
- SimpleTest.waitForExplicitFinish();
- let win;
- var left = 60 + screen.availLeft;
- var upper = 60 + screen.availTop;
-
- function runTest() {
- win = window.openDialog("window_screenPosSize.xul",
- null,
- "chrome,dialog=no,all,screenX=" + left + ",screenY=" + upper + ",outerHeight=200,outerWidth=200");
- SimpleTest.waitForFocus(checkTest, win);
- }
- function checkTest() {
- is(win.screenX, left, "The window should be placed now at x=" + left + "px");
- is(win.screenY, upper, "The window should be placed now at y=" + upper + "px");
- is(win.outerHeight, 200, "The window size should be height=200px");
- is(win.outerWidth, 200, "The window size should be width=200px");
- runTest2();
- }
- function runTest2() {
- win.close();
- win = window.openDialog("window_screenPosSize.xul",
- null,
- "chrome,dialog=no,all");
- SimpleTest.waitForFocus(checkTest2, win);
- }
- function checkTest2() {
- let runTime = Components.classes["@mozilla.org/xre/app-info;1"]
- .getService(Components.interfaces.nsIXULRuntime);
- if (runTime.OS != "Linux") {
- is(win.screenX, 80, "The window should be placed now at x=80px");
- is(win.screenY, 80, "The window should be placed now at y=80px");
- }
- is(win.outerHeight, 300, "The window size should be height=300px");
- is(win.outerWidth, 300, "The window size should be width=300px");
- win.close();
- SimpleTest.finish();
- }
-]]></script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_scrollbar.xul b/toolkit/content/tests/chrome/test_scrollbar.xul
deleted file mode 100644
index 11dccbee9..000000000
--- a/toolkit/content/tests/chrome/test_scrollbar.xul
+++ /dev/null
@@ -1,137 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for scrollbars
- -->
-<window title="Scrollbar"
- 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="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml"/>
-
- <hbox>
- <scrollbar orient="horizontal"
- id="scroller"
- curpos="0"
- maxpos="600"
- pageincrement="400"
- width="500"
- style="margin:0"/>
- </hbox>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-/** Test for Scrollbar **/
-var scrollbarTester = {
- scrollbar: null,
- middlePref: false,
- startTest: function() {
- this.scrollbar = $("scroller");
- this.middlePref = this.getMiddlePref();
- var self = this;
- [0, 1, 2].map(function(button) {
- [false, true].map(function(alt) {
- [false, true].map(function(shift) {
- self.testThumbDragging(button, alt, shift);
- })
- })
- });
- SimpleTest.finish();
- },
- testThumbDragging: function(button, withAlt, withShift) {
- this.reset();
- var x = 160; // on the right half of the thumb
- var y = 5;
-
- var isMac = navigator.platform.indexOf("Mac") != -1;
- var runtime = Components.classes["@mozilla.org/xre/app-info;1"]
- .getService(Components.interfaces.nsIXULRuntime);
- var isGtk = runtime.widgetToolkit.indexOf("gtk") != -1;
-
- // Start the drag.
- this.mousedown(x, y, button, withAlt, withShift);
- var newPos = this.getPos();
- var scrollToClick = (newPos != 0);
- if (isMac || isGtk) {
- ok(!scrollToClick, "On Linux and Mac OS X, clicking the scrollbar thumb "+
- "should never move it.");
- } else if (button == 0 && withShift) {
- ok(scrollToClick, "On platforms other than Linux and Mac OS X, holding "+
- "shift should enable scroll-to-click on the scrollbar thumb.");
- } else if (button == 1 && this.middlePref) {
- ok(scrollToClick, "When middlemouse.scrollbarPosition is on, clicking the "+
- "thumb with the middle mouse button should center it "+
- "around the cursor.")
- }
-
- // Move one pixel to the right.
- this.mousemove(x+1, y, button, withAlt, withShift);
- var newPos2 = this.getPos();
- if (newPos2 != newPos) {
- ok(newPos2 > newPos, "Scrollbar thumb should follow the mouse when dragged.");
- ok(newPos2 - newPos < 3, "Scrollbar shouldn't move further than the mouse when dragged.");
- ok(button == 0 || (button == 1 && this.middlePref) || (button == 2 && isGtk),
- "Dragging the scrollbar should only be possible with the left mouse button.");
- } else {
- // Dragging had no effect.
- if (button == 0) {
- ok(false, "Dragging the scrollbar thumb should work.");
- } else if (button == 1 && this.middlePref && (!isGtk && !isMac)) {
- ok(false, "When middlemouse.scrollbarPosition is on, dragging the "+
- "scrollbar thumb should be possible using the middle mouse button.");
- } else {
- ok(true, "Dragging works correctly.");
- }
- }
-
- // Release the mouse button.
- this.mouseup(x+1, y, button, withAlt, withShift);
- var newPos3 = this.getPos();
- ok(newPos3 == newPos2,
- "Releasing the mouse button after dragging the thumb shouldn't move it.");
- },
- getMiddlePref: function() {
- // It would be better to test with different middlePref settings,
- // but the setting is only queried once, at browser startup, so
- // changing it here wouldn't have any effect
- var prefService = Components.classes["@mozilla.org/preferences-service;1"]
- .getService(Components.interfaces.nsIPrefService);
- var mouseBranch = prefService.getBranch("middlemouse.");
- return mouseBranch.getBoolPref("scrollbarPosition");
- },
- setPos: function(pos) {
- this.scrollbar.setAttribute("curpos", pos);
- },
- getPos: function() {
- return this.scrollbar.getAttribute("curpos");
- },
- reset: function() {
- this.setPos(0);
- },
- mousedown: function(x, y, button, alt, shift) {
- synthesizeMouse(this.scrollbar, x, y, { type: "mousedown", 'button': button,
- altKey: alt, shiftKey: shift });
- },
- mousemove: function(x, y, button, alt, shift) {
- synthesizeMouse(this.scrollbar, x, y, { type: "mousemove", 'button': button,
- altKey: alt, shiftKey: shift });
- },
- mouseup: function(x, y, button, alt, shift) {
- synthesizeMouse(this.scrollbar, x, y, { type: "mouseup", 'button': button,
- altKey: alt, shiftKey: shift });
- }
-}
-
-function doTest() {
- setTimeout(function() { scrollbarTester.startTest(); }, 0);
-}
-
-SimpleTest.waitForExplicitFinish();
-addLoadEvent(doTest);
-
-]]></script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_showcaret.xul b/toolkit/content/tests/chrome/test_showcaret.xul
deleted file mode 100644
index 75a8cf6a2..000000000
--- a/toolkit/content/tests/chrome/test_showcaret.xul
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Show Caret Test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-<iframe id="f1" width="100" height="100" onload="frameLoaded()"
- src="data:text/html,%3Cbody%20style='height:%208000px'%3E%3Cp%3EHello%3C/p%3EGoodbye%3C/body%3E"/>
-<!-- <body style='height: 8000px'><p>Hello</p><span id='s'>Goodbye<span></body> -->
-<iframe id="f2" type="content" showcaret="true" width="100" height="100" onload="frameLoaded()"
- src="data:text/html,%3Cbody%20style%3D%27height%3A%208000px%27%3E%3Cp%3EHello%3C%2Fp%3E%3Cspan%20id%3D%27s%27%3EGoodbye%3Cspan%3E%3C%2Fbody%3E"/>
-
-<script>
-<![CDATA[
-
-var framesLoaded = 0;
-var otherWindow = null;
-
-function frameLoaded() { if (++framesLoaded == 2) SimpleTest.waitForFocus(runTest); }
-
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- var sel1 = frames[0].getSelection();
- sel1.collapse(frames[0].document.body, 0);
-
- var sel2 = frames[1].getSelection();
- sel2.collapse(frames[1].document.body, 0);
- window.frames[0].focus();
- document.commandDispatcher.getControllerForCommand("cmd_moveBottom").doCommand("cmd_moveBottom");
-
- var listener = function() {
- if (!(frames[0].scrollY > 0)) {
- window.content.removeEventListener("scroll", listener, false);
- }
- }
- window.frames[0].addEventListener("scroll", listener, false);
-
- var sel1 = frames[0].getSelection();
- sel1.collapse(frames[0].document.body, 0);
-
- var sel2 = frames[1].getSelection();
- sel2.collapse(frames[1].document.body, 0);
-
- window.frames[0].focus();
- document.commandDispatcher.getControllerForCommand("cmd_moveBottom").doCommand("cmd_moveBottom");
- is(sel1.focusNode, frames[0].document.body, "focusNode for non-showcaret");
- is(sel1.focusOffset, 0, "focusOffset for non-showcaret");
-
- window.frames[1].focus();
- document.commandDispatcher.getControllerForCommand("cmd_moveBottom").doCommand("cmd_moveBottom");
-
- ok(frames[1].scrollY <
- frames[1].document.getElementById('s').getBoundingClientRect().top,
- "scrollY for showcaret");
- isnot(sel2.focusNode, frames[1].document.body, "focusNode for showcaret");
- ok(sel2.anchorOffset > 0, "focusOffset for showcaret");
-
- otherWindow = window.open("window_showcaret.xul", "_blank", "chrome,width=400,height=200");
- otherWindow.addEventListener("focus", otherWindowFocused, false);
-}
-
-function otherWindowFocused()
-{
- otherWindow.removeEventListener("focus", otherWindowFocused, false);
-
- // enable caret browsing temporarily to test caret movement
- var prefs = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefBranch);
- prefs.setBoolPref("accessibility.browsewithcaret", true);
-
- var hbox = otherWindow.document.documentElement.firstChild;
- hbox.focus();
- is(otherWindow.document.activeElement, hbox, "hbox in other window is focused");
-
- document.commandDispatcher.getControllerForCommand("cmd_lineNext").doCommand("cmd_lineNext");
- is(otherWindow.document.activeElement, hbox, "hbox still focused in other window after down movement");
-
- prefs.setBoolPref("accessibility.browsewithcaret", false);
-
- otherWindow.close();
- SimpleTest.finish();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_sorttemplate.xul b/toolkit/content/tests/chrome/test_sorttemplate.xul
deleted file mode 100644
index a08e3b6a8..000000000
--- a/toolkit/content/tests/chrome/test_sorttemplate.xul
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<?xml-stylesheet href="data:text/css,window > |people { display: none }" type="text/css"?>
-<!--
- XUL Widget Test for tabindex
- -->
-<window title="tabindex" width="500" height="600"
- onfocus="runTest()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<people id="famouspeople" xmlns="">
- <person name="Napoleon Bonaparte" gender="male"/>
- <person name="Cleopatra" gender="female"/>
- <person name="Julius Caesar" gender="male"/>
- <person name="Ferdinand Magellan" gender="male"/>
- <person name="Laura Secord" gender="female"/>
-</people>
-
-<tree id="tree" datasources="#famouspeople" ref="*" querytype="xml" flex="1">
- <treecols>
- <treecol label="Name" flex="1" sort="?name"/>
- <treecol label="Gender" flex="1" sort="?gender"/>
- </treecols>
- <template>
- <query/>
- <rule>
- <action>
- <treechildren id="treechildren-strings">
- <treeitem uri="?">
- <treerow>
- <treecell label="?name"/>
- <treecell label="?gender"/>
- </treerow>
- </treeitem>
- </treechildren>
- </action>
- </rule>
- </template>
-</tree>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script>
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function runTest()
-{
- var tree = $("tree");
- var col = tree.columns[0].element;
- synthesizeMouse(col, 12, 2, { });
- checkRowOrder(tree, ["Cleopatra", "Ferdinand Magellan", "Julius Caesar", "Laura Secord", "Napoleon Bonaparte"], "acsending");
-
- synthesizeMouse(col, 12, 2, { });
- checkRowOrder(tree, ["Napoleon Bonaparte", "Laura Secord", "Julius Caesar", "Ferdinand Magellan", "Cleopatra"], "descending");
-
- synthesizeMouse(col, 12, 2, { });
- checkRowOrder(tree, ["Napoleon Bonaparte", "Laura Secord", "Julius Caesar", "Ferdinand Magellan", "Cleopatra"], "natural");
-
- SimpleTest.finish();
-}
-
-function checkRowOrder(tree, expected, testid)
-{
- var index = 0;
- var item = tree.firstChild.nextSibling.nextSibling.firstChild;
- while (item && index < expected.length) {
- if (item.firstChild.firstChild.getAttribute("label") != expected[index++])
- break;
- item = item.nextSibling;
- }
- ok(index == expected.length && !item, testid + " row order");
-}
-
-]]>
-
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_statusbar.xul b/toolkit/content/tests/chrome/test_statusbar.xul
deleted file mode 100644
index 160cc25d0..000000000
--- a/toolkit/content/tests/chrome/test_statusbar.xul
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for statusbar
- -->
-<window title="Statusbar Test"
- onload="setTimeout(test_statusbar, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<statusbar>
- <statusbarpanel id="panel" label="OK" image="happy.png"/>
-</statusbar>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function test_statusbar()
-{
- var panel = $("panel");
- ok(panel.label, "OK", "statusbarpanel label");
- ok(panel.image, "happy.png", "statusbarpanel image");
- panel.src = "sad.png";
- ok(panel.src, "sad.png", "statusbarpanel set src");
- ok(panel.getAttribute("src"), "sad.png", "statusbarpanel set src attribute");
-
- SimpleTest.finish();
-}
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_subframe_origin.xul b/toolkit/content/tests/chrome/test_subframe_origin.xul
deleted file mode 100644
index bde1e4945..000000000
--- a/toolkit/content/tests/chrome/test_subframe_origin.xul
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Subframe Event Tests"
- onload="setTimeout(runTest, 0);"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-<script>
-
-// Added after content child widgets were removed from ui windows. Tests sub frame
-// event client coordinate offsets.
-
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- window.open("window_subframe_origin.xul", "_blank", "chrome,width=600,height=600");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_tabbox.xul b/toolkit/content/tests/chrome/test_tabbox.xul
deleted file mode 100644
index 3cbacb15a..000000000
--- a/toolkit/content/tests/chrome/test_tabbox.xul
+++ /dev/null
@@ -1,224 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for tabboxes
- -->
-<window title="Tabbox Test" width="500" height="600"
- onload="setTimeout(test_tabbox, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="application/javascript" src="xul_selectcontrol.js"/>
-
-<vbox id="tabboxes">
-
-<tabbox id="tabbox">
- <tabs id="tabs">
- <tab id="tab1" label="Tab 1"/>
- <tab id="tab2" label="Tab 2"/>
- </tabs>
- <tabpanels id="tabpanels">
- <button id="panel1" label="Panel 1"/>
- <button id="panel2" label="Panel 2"/>
- </tabpanels>
-</tabbox>
-
-<tabbox id="tabbox-initwithvalue">
- <tabs id="tabs-initwithvalue" value="two">
- <tab label="Tab 1" value="one"/>
- <tab label="Tab 2" value="two"/>
- <tab label="Tab 3" value="three"/>
- </tabs>
- <tabpanels id="tabpanels-initwithvalue">
- <button label="Panel 1"/>
- <button label="Panel 2"/>
- <button label="Panel 3"/>
- </tabpanels>
-</tabbox>
-
-<tabbox id="tabbox-initwithselected">
- <tabs id="tabs-initwithselected" value="two">
- <tab label="Tab 1" value="one"/>
- <tab label="Tab 2" value="two"/>
- <tab label="Tab 3" value="three" selected="true"/>
- </tabs>
- <tabpanels id="tabpanels-initwithselected">
- <button label="Panel 1"/>
- <button label="Panel 2"/>
- <button label="Panel 3"/>
- </tabpanels>
-</tabbox>
-
-</vbox>
-
-<tabbox id="tabbox-nofocus">
- <textbox id="textbox-extra" hidden="true"/>
- <tabs>
- <tab label="Tab 1" value="one"/>
- <tab id="tab-nofocus" label="Tab 2" value="two"/>
- </tabs>
- <tabpanels>
- <tabpanel>
- <button id="tab-nofocus-button" label="Label"/>
- </tabpanel>
- <tabpanel id="tabpanel-nofocusinpaneltab">
- <label id="tablabel" value="Label"/>
- </tabpanel>
- </tabpanels>
-</tabbox>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function test_tabbox()
-{
- var tabbox = document.getElementById("tabbox");
- var tabs = document.getElementById("tabs");
- var tabpanels = document.getElementById("tabpanels");
-
- test_tabbox_State(tabbox, "tabbox initial", 0, tabs.firstChild, tabpanels.firstChild);
-
- // check the selectedIndex property
- tabbox.selectedIndex = 1;
- test_tabbox_State(tabbox, "tabbox selectedIndex 1", 1, tabs.lastChild, tabpanels.lastChild);
-
- tabbox.selectedIndex = 2;
- test_tabbox_State(tabbox, "tabbox selectedIndex 2", 1, tabs.lastChild, tabpanels.lastChild);
-
- // tabbox must have a selection, so setting to -1 should do nothing
- tabbox.selectedIndex = -1;
- test_tabbox_State(tabbox, "tabbox selectedIndex -1", 1, tabs.lastChild, tabpanels.lastChild);
-
- // check the selectedTab property
- tabbox.selectedTab = tabs.firstChild;
- test_tabbox_State(tabbox, "tabbox selected", 0, tabs.firstChild, tabpanels.firstChild);
-
- // setting selectedTab to null should not do anything
- tabbox.selectedTab = null;
- test_tabbox_State(tabbox, "tabbox selectedTab null", 0, tabs.firstChild, tabpanels.firstChild);
-
- // check the selectedPanel property
- tabbox.selectedPanel = tabpanels.lastChild;
- test_tabbox_State(tabbox, "tabbox selectedPanel", 0, tabs.firstChild, tabpanels.lastChild);
-
- // setting selectedPanel to null should not do anything
- tabbox.selectedPanel = null;
- test_tabbox_State(tabbox, "tabbox selectedPanel null", 0, tabs.firstChild, tabpanels.lastChild);
-
- tabbox.selectedIndex = 0;
- test_tabpanels(tabpanels, tabbox);
-
- tabs.removeChild(tabs.firstChild);
- tabs.removeChild(tabs.firstChild);
-
- test_tabs(tabs);
-
- test_tabbox_focus();
-}
-
-function test_tabpanels(tabpanels, tabbox)
-{
- var tab = tabbox.selectedTab;
-
- // changing the selection on the tabpanels should not affect the tabbox
- // or tabs within
- // check the selectedIndex property
- tabpanels.selectedIndex = 1;
- test_tabbox_State(tabbox, "tabpanels tabbox selectedIndex 1", 0, tab, tabpanels.lastChild);
- test_tabpanels_State(tabpanels, "tabpanels selectedIndex 1", 1, tabpanels.lastChild);
-
- tabpanels.selectedIndex = 0;
- test_tabbox_State(tabbox, "tabpanels tabbox selectedIndex 2", 0, tab, tabpanels.firstChild);
- test_tabpanels_State(tabpanels, "tabpanels selectedIndex 2", 0, tabpanels.firstChild);
-
- // setting selectedIndex to -1 should do nothing
- tabpanels.selectedIndex = 1;
- tabpanels.selectedIndex = -1;
- test_tabbox_State(tabbox, "tabpanels tabbox selectedIndex -1", 0, tab, tabpanels.lastChild);
- test_tabpanels_State(tabpanels, "tabpanels selectedIndex -1", 1, tabpanels.lastChild);
-
- // check the tabpanels.selectedPanel property
- tabpanels.selectedPanel = tabpanels.lastChild;
- test_tabbox_State(tabbox, "tabpanels tabbox selectedPanel", 0, tab, tabpanels.lastChild);
- test_tabpanels_State(tabpanels, "tabpanels selectedPanel", 1, tabpanels.lastChild);
-
- // check setting the tabpanels.selectedPanel property to null
- tabpanels.selectedPanel = null;
- test_tabbox_State(tabbox, "tabpanels selectedPanel null", 0, tab, tabpanels.lastChild);
-}
-
-function test_tabs(tabs)
-{
- test_nsIDOMXULSelectControlElement(tabs, "tab", "tabs");
- // XXXndeakin would test the UI aspect of tabs, but the mouse
- // events on tabs are fired in a timeout causing the generic
- // test_nsIDOMXULSelectControlElement_UI method not to work
- // test_nsIDOMXULSelectControlElement_UI(tabs, null);
-}
-
-function test_tabbox_State(tabbox, testid, index, tab, panel)
-{
- is(tabbox.selectedIndex, index, testid + " selectedIndex");
- is(tabbox.selectedTab, tab, testid + " selectedTab");
- is(tabbox.selectedPanel, panel, testid + " selectedPanel");
-}
-
-function test_tabpanels_State(tabpanels, testid, index, panel)
-{
- is(tabpanels.selectedIndex, index, testid + " selectedIndex");
- is(tabpanels.selectedPanel, panel, testid + " selectedPanel");
-}
-
-function test_tabbox_focus()
-{
- $("tabboxes").hidden = true;
- $(document.activeElement).blur();
-
- var tabbox = $("tabbox-nofocus");
- var tab = $("tab-nofocus");
-
- when_tab_focused(tab, function () {
- ok(document.activeElement, tab, "focus in tab with no focusable elements");
-
- tabbox.selectedIndex = 0;
- $("tab-nofocus-button").focus();
-
- when_tab_focused(tab, function () {
- ok(document.activeElement, tab, "focus in tab with no focusable elements, but with something in another tab focused");
-
- var textboxExtra = $("textbox-extra");
- textboxExtra.addEventListener("focus", function () {
- textboxExtra.removeEventListener("focus", arguments.callee, true);
- ok(document.activeElement, textboxExtra, "focus in tab with focus currently in textbox that is sibling of tabs");
-
- SimpleTest.finish();
- }, true);
-
- tabbox.selectedIndex = 0;
- textboxExtra.hidden = false;
- synthesizeMouseAtCenter(tab, { });
- });
-
- synthesizeMouseAtCenter(tab, { });
- });
-
- synthesizeMouseAtCenter(tab, { });
-}
-
-function when_tab_focused(tab, callback) {
- tab.addEventListener("focus", function onFocused() {
- tab.removeEventListener("focus", onFocused, true);
- SimpleTest.executeSoon(callback);
- }, true);
-}
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_tabindex.xul b/toolkit/content/tests/chrome/test_tabindex.xul
deleted file mode 100644
index 425cb7b9e..000000000
--- a/toolkit/content/tests/chrome/test_tabindex.xul
+++ /dev/null
@@ -1,120 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for tabindex
- -->
-<window title="tabindex" width="500" height="600"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<!--
- Elements are navigated in the following order:
- 1. tabindex > 0 in tree order
- 2. tabindex = 0 in tree order
- Elements with tabindex = -1 are not in the tab order
- -->
-<hbox>
- <button id="t5" label="One"/>
- <checkbox id="no1" label="Two" tabindex="-1"/>
- <button id="t6" label="Three" tabindex="0"/>
- <checkbox id="t1" label="Four" tabindex="1"/>
-</hbox>
-<hbox>
- <textbox id="t7" idmod="t3" size="3"/>
- <textbox id="no2" size="3" tabindex="-1"/>
- <textbox id="t8" idmod="t4" size="3" tabindex="0"/>
- <textbox id="t2" idmod="t1" size="3" tabindex="1"/>
-</hbox>
-<hbox>
- <button id="no3" style="-moz-user-focus: ignore;" label="One"/>
- <checkbox id="no4" style="-moz-user-focus: ignore;" label="Two" tabindex="-1"/>
- <button id="t9" style="-moz-user-focus: ignore;" label="Three" tabindex="0"/>
- <checkbox id="t3" style="-moz-user-focus: ignore;" label="Four" tabindex="1"/>
-</hbox>
-<hbox>
- <textbox id="t10" idmod="t5" style="-moz-user-focus: ignore;" size="3"/>
- <textbox id="no5" style="-moz-user-focus: ignore;" size="3" tabindex="-1"/>
- <textbox id="t11" idmod="t6" style="-moz-user-focus: ignore;" size="3" tabindex="0"/>
- <textbox id="t4" idmod="t2" style="-moz-user-focus: ignore;" size="3" tabindex="1"/>
-</hbox>
-<listbox id="t12" idmod="t7">
- <listitem label="Item One"/>
-</listbox>
-
-<hbox>
- <!-- the tabindex attribute does not apply to non-controls, so it
- should be treated as -1 for non-focusable dropmarkers, and 0
- for focusable dropmarkers. Thus, the first four dropmarkers
- are not in the tab order, and the last four dropmarkers should
- be in the tab order just after the listbox above.
- -->
- <dropmarker id="no6"/>
- <dropmarker id="no7" tabindex="-1"/>
- <dropmarker id="no8" tabindex="0"/>
- <dropmarker id="no9" tabindex="1"/>
- <dropmarker id="t13" style="-moz-user-focus: normal;"/>
- <dropmarker id="t14" style="-moz-user-focus: normal;" tabindex="-1"/>
- <dropmarker id="t15" style="-moz-user-focus: normal;" tabindex="0"/>
- <dropmarker id="t16" style="-moz-user-focus: normal;" tabindex="1"/>
-</hbox>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script>
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var gAdjustedTabFocusModel = false;
-var gTestCount = 16;
-var gTestsOccurred = 0;
-
-function runTests()
-{
- var t;
- window.addEventListener("focus", function (event) {
- if (t == 1 && event.target.id == "t2") {
- // looks to be using the MacOSX Full Keyboard Access set to Textboxes
- // and lists only so use the idmod attribute instead
- gAdjustedTabFocusModel = true;
- gTestCount = 7;
- }
-
- var attrcompare = gAdjustedTabFocusModel ? "idmod" : "id";
-
- // check for the last test which should wrap aorund to the first item
- // consider the focus event on the inner input of textboxes instead
- if (event.originalTarget.localName == "input") {
- is(document.getBindingParent(event.originalTarget).getAttribute(attrcompare),
- "t" + t, "tab " + t + " to inner input");
- gTestsOccurred++;
- }
- else {
- is(event.target.getAttribute(attrcompare), "t" + t, "tab " + t + " to " + event.target.localName)
- if (event.target.localName != "textbox")
- gTestsOccurred++;
- }
- }, true);
-
- for (t = 1; t <= gTestCount; t++)
- synthesizeKey("VK_TAB", { });
-
- is(gTestsOccurred, gTestCount, "test count");
- SimpleTest.finish();
-}
-
-SimpleTest.waitForFocus(runTests);
-
-]]>
-
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_textbox_dictionary.xul b/toolkit/content/tests/chrome/test_textbox_dictionary.xul
deleted file mode 100644
index 8e69dd15e..000000000
--- a/toolkit/content/tests/chrome/test_textbox_dictionary.xul
+++ /dev/null
@@ -1,98 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for textbox with Add and Undo Add to Dictionary
- -->
-<window title="Textbox Add and Undo Add to Dictionary Test" width="500" height="600"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
- <hbox>
- <textbox id="t1" value="Hellop" oncontextmenu="runContextMenuTest()" spellcheck="true"/>
- </hbox>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var textbox;
-var testNum;
-
-function bringUpContextMenu(element)
-{
- synthesizeMouseAtCenter(element, { type: "contextmenu", button: 2});
-}
-
-function leftClickElement(element)
-{
- synthesizeMouseAtCenter(element, { button: 0 });
-}
-
-function startTests()
-{
- textbox = document.getElementById("t1");
- textbox.focus();
- testNum = 0;
-
- Components.utils.import("resource://gre/modules/AsyncSpellCheckTestHelper.jsm");
- onSpellCheck(textbox, function () {
- bringUpContextMenu(textbox);
- });
-}
-
-function runContextMenuTest()
-{
- SimpleTest.executeSoon( function() {
- // The textbox has its children in an hbox XUL element, so get that first
- var hbox = document.getAnonymousNodes(textbox).item(0);
-
- var contextMenu = document.getAnonymousElementByAttribute(hbox, "anonid", "input-box-contextmenu");
-
- switch(testNum)
- {
- case 0: // "Add to Dictionary" button
- var addToDict = contextMenu.querySelector("[anonid=spell-add-to-dictionary]");
- ok(!addToDict.hidden, "Is Add to Dictionary visible?");
-
- var separator = contextMenu.querySelector("[anonid=spell-suggestions-separator]");
- ok(!separator.hidden, "Is separator visible?");
-
- addToDict.doCommand();
-
- contextMenu.hidePopup();
- testNum++;
-
- onSpellCheck(textbox, function () {
- bringUpContextMenu(textbox);
- });
- break;
-
- case 1: // "Undo Add to Dictionary" button
- var undoAddDict = contextMenu.querySelector("[anonid=spell-undo-add-to-dictionary]");
- ok(!undoAddDict.hidden, "Is Undo Add to Dictioanry visible?");
-
- var separator = contextMenu.querySelector("[anonid=spell-suggestions-separator]");
- ok(!separator.hidden, "Is separator hidden?");
-
- undoAddDict.doCommand();
-
- contextMenu.hidePopup();
- onSpellCheck(textbox, function () {
- SimpleTest.finish();
- });
- break;
- }
- });
-}
-
-SimpleTest.waitForFocus(startTests);
-
- ]]></script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_textbox_emptytext.xul b/toolkit/content/tests/chrome/test_textbox_emptytext.xul
deleted file mode 100644
index 41c702a90..000000000
--- a/toolkit/content/tests/chrome/test_textbox_emptytext.xul
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for textbox with placeholder
- -->
-<window title="Textbox with placeholder test" width="500" height="600"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <hbox>
- <textbox id="t1"/>
- </hbox>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function doTests() {
- var t1 = $("t1");
-
- t1.placeholder = 1;
- ok("1" === t1.label, "placeholder exposed as label");
- ok("" === t1.value, "placeholder not exposed as value");
-
- t1.label = 2;
- ok("2" === t1.label, "label can be set explicitly");
- ok("1" === t1.placeholder, "placeholder persists after setting label");
-
- t1.value = 3;
- ok("3" === t1.value, "value setter/getter works while placeholder is present");
- ok("1" === t1.placeholder, "placeholder persists after setting value");
-
- t1.value = "";
- is(t1.textLength, 0, "textLength while placeholder is displayed");
-
- SimpleTest.finish();
-}
-
-SimpleTest.waitForFocus(doTests);
-
- ]]></script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_textbox_number.xul b/toolkit/content/tests/chrome/test_textbox_number.xul
deleted file mode 100644
index 369e92785..000000000
--- a/toolkit/content/tests/chrome/test_textbox_number.xul
+++ /dev/null
@@ -1,353 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for textbox type="number"
- -->
-<window title="Textbox type='number' test" width="500" height="600"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<hbox>
- <textbox id="n1" type="number" size="4"/>
- <textbox id="n2" type="number" value="10" min="5" max="15" wraparound="true"/>
-</hbox>
-<hbox>
- <textbox id="n3" type="number" size="4" value="25" min="1" max="12" increment="3"/>
-</hbox>
-<hbox>
- <textbox id="n4" type="number" size="4" value="-2" min="-8" max="18"/>
- <textbox id="n5" type="number" value="-17" min="-10" max="-3"/>
-</hbox>
-<hbox>
- <textbox id="n6" type="number" size="4" value="9" min="12" max="8"/>
-</hbox>
-<hbox>
- <textbox id="n7" type="number" size="4" value="4.678" min="2" max="10.5" decimalplaces="2"/>
- <textbox id="n8" type="number" hidespinbuttons="true"/>
-</hbox>
-<hbox>
- <textbox id="n9" type="number" size="4" oninput="updateInputEventCount();"/>
-</hbox>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-SimpleTest.waitForExplicitFinish();
-
-// ---- NOTE: the numbers used in these tests are carefully chosen to avoid
-// ---- floating point rounding issues
-
-function doTests() {
- var n1 = $("n1");
- var n2 = $("n2");
- var n3 = $("n3");
- var n4 = $("n4");
- var n5 = $("n5");
- var n6 = $("n6");
- var n7 = $("n7");
-
- testValsMinMax(n1, "initial n1", 0, 0, Infinity);
- testValsMinMax(n2, "initial n2", 10, 5, 15);
- testValsMinMax(n3, "initial n3", 12, 1, 12);
- testValsMinMax(n4, "initial n4", -2, -8, 18);
- testValsMinMax(n5, "initial n5", -10, -10, -3);
- testValsMinMax(n6, "initial n6", 12, 12, 12);
- testValsMinMax(n7, "initial n7", 4.68, 2, 10.5); // value should be rounded
-
- ok(n1.spinButtons != null && n1.spinButtons.localName == "spinbuttons", "spinButtons set");
- isnot(n1.decimalSymbol, "", "n1.decimalSymbol is set to something");
- n1.decimalSymbol = ".";
- SimpleTest.is(n1.decimalSymbol, ".", "n1.decimalSymbol set to '.'");
- SimpleTest.is(n1.wrapAround, false, "wrapAround defaults to false");
- SimpleTest.is(n1.increment, 1, "increment defaults to 1");
- SimpleTest.is(n1.decimalPlaces, 0, "decimalPlaces defaults to 0");
-
- SimpleTest.is(n2.wrapAround, true, "wrapAround when set to true");
- SimpleTest.is(n3.increment, 3, "increment when set to 1");
- SimpleTest.is(n7.decimalPlaces, 2, "decimalPlaces when set to 2");
-
- // test changing the value
- n1.value = "1700";
- testVals(n1, "set value,", 1700);
- n1.value = 1600;
- testVals(n1, "set value int,", 1600);
- n2.value = "2";
- testVals(n2, "set value below min,", 5);
- n2.value = 2;
- testVals(n2, "set value below min int,", 5);
- n2.value = 18;
- testVals(n2, "set value above max,", 15);
- n2.value = -6;
- testVals(n2, "set value below min negative,", 5);
- n5.value = -2;
- testVals(n5, "set value above max positive,", -3);
- n7.value = 5.999;
- testVals(n7, "set value to decimal,", 6, "6.00");
- n7.value = "1.42";
- testVals(n7, "set value to decimal below min,", 2.00, "2.00");
- n7.value = 24.1;
- testVals(n7, "set value to decimal above max,", 10.5, "10.50");
- n1.value = 4.75;
- testVals(n1, "set value to decimal round,", 5);
-
- // test changing the valueNumber
- n1.valueNumber = 27;
- testVals(n1, "set valueNumber,", 27);
- n2.valueNumber = 1;
- testVals(n2, "set valueNumber below min,", 5);
- n2.valueNumber = 77;
- testVals(n2, "set valueNumber above max,", 15);
- n2.valueNumber = -5;
- testVals(n2, "set valueNumber below min negative,", 5);
- n5.valueNumber = -8;
- n5.valueNumber = -1;
- testVals(n5, "set valueNumber above max positive,", -3);
- n7.valueNumber = 8.23;
- testVals(n7, "set valueNumber to decimal,", 8.23);
- n7.valueNumber = 0.77;
- testVals(n7, "set valueNumber to decimal below min,", 2.00, "2.00");
- n7.valueNumber = 29.157;
- testVals(n7, "set valueNumber to decimal above max,", 10.5, "10.50");
- n1.value = 8.9;
- testVals(n1, "set valueNumber to decimal round,", 9);
-
- // test changing the min
- n1.value = 6;
- n1.min = 8;
- testValsMinMax(n1, "set integer min,", 8, 8, Infinity);
- n7.value = 5.5;
- n7.min = 6.7;
- testValsMinMax(n7, "set decimal min,", 6.7, 6.7, 10.5, "6.70");
-
- // test changing the max
- n1.value = 25;
- n1.max = 22;
- testValsMinMax(n1, "set integer max,", 22, 8, 22);
- n7.value = 10.2;
- n7.max = 10.1;
- testValsMinMax(n7, "set decimal max,", 10.1, 6.7, 10.1, "10.10");
-
- // test decrease() and increase() methods
- testIncreaseDecrease(n1, "integer", 1, 0, 8, 22);
- testIncreaseDecrease(n7, "decimal", 1, 2, 6.7, 10.1);
- testIncreaseDecrease(n3, "integer with increment", 3, 0, 1, 12);
-
- n7.min = 2.7;
- n7.value = 10.1;
- n7.increment = 4.3;
- SimpleTest.is(n7.increment, 4.3, "increment changed");
- testIncreaseDecrease(n7, "integer with increment", 4.3, 2, 2.7, 10.1);
-
- n2.value = n2.min;
- n2.decrease();
- testVals(n2, "integer wraparound decrease method", n2.max);
- n2.increase();
- testVals(n2, "integer wraparound decrease method", n2.min);
-
- n7.wrapAround = true;
- SimpleTest.is(n7.wrapAround, true, "change wrapAround");
- n7.value = n7.min + 0.01;
- n7.decrease();
- testVals(n7, "decimal wraparound decrease method", n7.max, n7.max.toFixed(2));
- n7.increase();
- testVals(n7, "decimal wraparound decrease method", n7.min, n7.min.toFixed(2));
-
- n1.value = 22;
- n1.decimalPlaces = 3;
- testVals(n1, "set decimalPlaces 3", 22, "22.000");
- n1.value = 10.624;
- testVals(n1, "set decimalPlaces 3 set value,", 10.624);
- n1.decimalPlaces = 0;
- testVals(n1, "set decimalPlaces 0 set value,", 11);
- n1.decimalPlaces = Infinity;
- n1.value = 10.678123;
- testVals(n1, "set decimalPlaces Infinity set value,", 10.678123);
-
- n1.decimalSymbol = ",";
- SimpleTest.is(n1.decimalSymbol, ",", "n1.decimalSymbol set to ','");
- n1.value = "9.67";
- testVals(n1, "set decimalPlaces set value,", 9.67);
-
- n1.decimalSymbol = ".";
- SimpleTest.is(n1.decimalSymbol, ".", "n1.decimalSymbol set back to '.'");
- n1.decimalPlaces = 0;
-
- // UI tests
- n1.min = 5;
- n1.max = 15;
- n1.value = 5;
- n1.focus();
-
- var sb = n1.spinButtons;
- var sbbottom = sb.getBoundingClientRect().bottom - sb.getBoundingClientRect().top - 2;
-
- synthesizeKey("VK_UP", {});
- testVals(n1, "key up", 6);
-
- synthesizeKey("VK_DOWN", {});
- testVals(n1, "key down", 5);
-
- synthesizeMouse(sb, 2, 2, {});
- testVals(n1, "spinbuttons up", 6);
- synthesizeMouse(sb, 2, sbbottom, {});
- testVals(n1, "spinbuttons down", 5);
-
- n1.value = 15;
- synthesizeKey("VK_UP", {});
- testVals(n1, "key up at max", 15);
- synthesizeMouse(sb, 2, 2, {});
- testVals(n1, "spinbuttons up at max", 15);
-
- n1.value = 5;
- synthesizeKey("VK_DOWN", {});
- testVals(n1, "key down at min", 5);
- synthesizeMouse(sb, 2, sbbottom, {});
- testVals(n1, "spinbuttons down at min", 5);
-
- n1.wrapAround = true;
- n1.value = 15;
- synthesizeKey("VK_UP", {});
- testVals(n1, "key up wraparound at max", 5);
- n1.value = 5;
- synthesizeKey("VK_DOWN", {});
- testVals(n1, "key down wraparound at min", 15);
-
- n1.value = 15;
- synthesizeMouse(sb, 2, 2, {});
- testVals(n1, "spinbuttons up wraparound at max", 5);
- n1.value = 5;
- synthesizeMouse(sb, 2, sbbottom, {});
- testVals(n1, "spinbuttons down wraparound at min", 15);
-
- // check read only state
- n1.readOnly = true;
- n1.min = -10;
- n1.max = 15;
- n1.value = 12;
- // no events should fire and no changes should occur when the field is read only
- synthesizeKeyExpectEvent("VK_UP", { }, n1, "!change", "key up read only");
- is(n1.value, "12", "key up read only value");
- synthesizeKeyExpectEvent("VK_DOWN", { }, n1, "!change", "key down read only");
- is(n1.value, "12", "key down read only value");
-
- synthesizeMouseExpectEvent(sb, 2, 2, { }, n1, "!change", "mouse up read only");
- is(n1.value, "12", "mouse up read only value");
- synthesizeMouseExpectEvent(sb, 2, sbbottom, { }, n1, "!change", "mouse down read only");
- is(n1.value, "12", "mouse down read only value");
-
- n1.readOnly = false;
- n1.disabled = true;
- synthesizeMouseExpectEvent(sb, 2, 2, { }, n1, "!change", "mouse up disabled");
- is(n1.value, "12", "mouse up disabled value");
- synthesizeMouseExpectEvent(sb, 2, sbbottom, { }, n1, "!change", "mouse down disabled");
- is(n1.value, "12", "mouse down disabled value");
-
- var nsbrect = $("n8").spinButtons.getBoundingClientRect();
- ok(nsbrect.left == 0 && nsbrect.top == 0 && nsbrect.right == 0, nsbrect.bottom == 0,
- "hidespinbuttons");
-
- var n9 = $("n9");
- is(n9.value, "0", "initial value");
- n9.select();
- synthesizeKey("4", {});
- is(inputEventCount, 1, "input event count");
- is(inputEventValue, "4", "input value");
- is(n9.value, "4", "updated value");
- synthesizeKey("2", {});
- is(inputEventCount, 2, "input event count");
- is(inputEventValue, "42", "input value");
- is(n9.value, "42", "updated value");
- synthesizeKey("VK_BACK_SPACE", {});
- is(inputEventCount, 3, "input event count");
- is(inputEventValue, "4", "input value");
- is(n9.value, "4", "updated value");
- synthesizeKey("A", {accelKey: true});
- synthesizeKey("VK_DELETE", {});
- is(inputEventCount, 4, "input event count");
- is(inputEventValue, "0", "input value");
- is(n9.value, "0", "updated value");
-
- SimpleTest.finish();
-}
-
-var inputEventCount = 0;
-var inputEventValue = null;
-function updateInputEventCount() {
- inputEventValue = $("n9").value;
- inputEventCount++;
-};
-
-function testVals(nb, name, valueNumber, valueFieldNumber) {
- if (valueFieldNumber === undefined)
- valueFieldNumber = "" + valueNumber;
-
- SimpleTest.is(nb.value, "" + valueNumber, name + " value is '" + valueNumber + "'");
- SimpleTest.is(nb.valueNumber, valueNumber, name + " valueNumber is " + valueNumber);
-
- // This value format depends on the localized decimal symbol.
- var localizedValue = valueFieldNumber.replace(/\./, nb.decimalSymbol);
- SimpleTest.is(nb.inputField.value, localizedValue,
- name + " inputField value is '" + localizedValue + "'");
-}
-
-function testValsMinMax(nb, name, valueNumber, min, max, valueFieldNumber) {
- testVals(nb, name, valueNumber, valueFieldNumber);
- SimpleTest.is(nb.min, min, name + " min is " + min);
- SimpleTest.is(nb.max, max, name + " max is " + max);
-}
-
-function testIncreaseDecrease(nb, testid, increment, fixedCount, min, max)
-{
- testid += " ";
-
- nb.value = max;
- nb.decrease();
- testVals(nb, testid + "decrease method", max - increment,
- (max - increment).toFixed(fixedCount));
- nb.increase();
- testVals(nb, testid + "increase method", max, max.toFixed(fixedCount));
- nb.value = min;
- nb.decrease();
- testVals(nb, testid + "decrease method at min", min, min.toFixed(fixedCount));
- nb.value = max;
- nb.increase();
- testVals(nb, testid + "increase method at max", max, max.toFixed(fixedCount));
-
- nb.focus();
- nb.value = min;
-
- // pressing the cursor up and down keys should adjust the value
- synthesizeKeyExpectEvent("VK_UP", { }, nb, "change", testid + "key up");
- is(nb.value, String(min + increment), testid + "key up");
- nb.value = max;
- synthesizeKeyExpectEvent("VK_UP", { }, nb, "!change", testid + "key up at max");
- is(nb.value, String(max), testid + "key up at max");
- synthesizeKeyExpectEvent("VK_DOWN", { }, nb, "change", testid + "key down");
- is(nb.value, String(max - increment), testid + "key down");
- nb.value = min;
- synthesizeKeyExpectEvent("VK_DOWN", { }, nb, "!change", testid + "key down at min");
- is(nb.value, String(min), testid + "key down at min");
-
- // check pressing the spinbutton arrows
- var sb = nb.spinButtons;
- var sbbottom = sb.getBoundingClientRect().bottom - sb.getBoundingClientRect().top - 2;
- nb.value = min;
- synthesizeMouseExpectEvent(sb, 2, 2, { }, nb, "change", testid + "mouse up");
- is(nb.value, String(min + increment), testid + "mouse up");
- nb.value = max;
- synthesizeMouseExpectEvent(sb, 2, 2, { }, nb, "!change", testid + "mouse up at max");
- synthesizeMouseExpectEvent(sb, 2, sbbottom, { }, nb, "change", testid + "mouse down");
- is(nb.value, String(max - increment), testid + "mouse down");
- nb.value = min;
- synthesizeMouseExpectEvent(sb, 2, sbbottom, { }, nb, "!change", testid + "mouse down at min");
-}
-
-SimpleTest.waitForFocus(doTests);
-
- ]]></script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_textbox_search.xul b/toolkit/content/tests/chrome/test_textbox_search.xul
deleted file mode 100644
index ae6153361..000000000
--- a/toolkit/content/tests/chrome/test_textbox_search.xul
+++ /dev/null
@@ -1,170 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for search textbox
- -->
-<window title="Search textbox test" width="500" height="600"
- 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="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
- <hbox>
- <textbox id="searchbox"
- type="search"
- oncommand="doSearch(this.value);"
- placeholder="random placeholder"
- timeout="1"/>
- </hbox>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var gExpectedValue;
-var gLastTest;
-
-function doTests() {
- var textbox = $("searchbox");
- var icons = document.getAnonymousElementByAttribute(textbox, "anonid", "search-icons");
- var searchIcon = document.getAnonymousElementByAttribute(textbox, "class", "textbox-search-icon");
- var clearIcon = document.getAnonymousElementByAttribute(textbox, "class", "textbox-search-clear");
-
- ok(icons, "icon deck found");
- ok(searchIcon, "search icon found");
- ok(clearIcon, "clear icon found");
- is(icons.selectedPanel, searchIcon, "search icon is displayed");
-
- is(textbox.placeholder, "random placeholder", "search textbox supports placeholder");
- is(textbox.value, "", "placeholder doesn't interfere with the real value");
-
- function iconClick(aIcon) {
- is(icons.selectedPanel, aIcon, aIcon.className + " icon must be displayed in order to be clickable");
-
- //XXX synthesizeMouse worked on Linux but failed on Windows an Mac
- // for unknown reasons. Manually dispatch the event for now.
- //synthesizeMouse(aIcon, 0, 0, {});
-
- var event = document.createEvent("MouseEvent");
- event.initMouseEvent("click", true, true, window, 1,
- 0, 0, 0, 0,
- false, false, false, false,
- 0, null);
- aIcon.dispatchEvent(event);
- }
-
- iconClick(searchIcon);
- is(textbox.getAttribute("focused"), "true", "clicking the search icon focuses the textbox");
-
- textbox.value = "foo";
- is(icons.selectedPanel, clearIcon, "clear icon is displayed when setting a value");
-
- textbox.reset();
- is(textbox.defaultValue, "", "defaultValue is empty");
- is(textbox.value, "", "reset method clears the textbox");
- is(icons.selectedPanel, searchIcon, "search icon is displayed after textbox.reset()");
-
- textbox.value = "foo";
- gExpectedValue = "";
- iconClick(clearIcon);
- is(textbox.value, "", "clicking the clear icon clears the textbox");
- ok(gExpectedValue == null, "search triggered when clearing the textbox with the clear icon");
-
- textbox.value = "foo";
- gExpectedValue = "";
- synthesizeKey("VK_ESCAPE", {});
- is(textbox.value, "", "escape key clears the textbox");
- ok(gExpectedValue == null, "search triggered when clearing the textbox with the escape key");
-
- textbox.value = "bar";
- gExpectedValue = "bar";
- textbox.doCommand();
- ok(gExpectedValue == null, "search triggered with doCommand");
-
- gExpectedValue = "bar";
- synthesizeKey("VK_RETURN", {});
- ok(gExpectedValue == null, "search triggered with enter key");
-
- textbox.value = "";
- textbox.searchButton = true;
- is(textbox.getAttribute("searchbutton"), "true", "searchbutton attribute set on the textbox");
- is(searchIcon.getAttribute("searchbutton"), "true", "searchbutton attribute inherited to the search icon");
-
- textbox.value = "foo";
- is(icons.selectedPanel, searchIcon, "search icon displayed in search button mode if there's a value");
-
- gExpectedValue = "foo";
- iconClick(searchIcon);
- ok(gExpectedValue == null, "search triggered when clicking the search icon in search button mode");
- is(icons.selectedPanel, clearIcon, "clear icon displayed in search button mode after submitting");
-
- synthesizeKey("o", {});
- is(icons.selectedPanel, searchIcon, "search icon displayed in search button mode when typing a key");
-
- gExpectedValue = "fooo";
- iconClick(searchIcon); // display the clear icon (tested above)
-
- textbox.value = "foo";
- is(icons.selectedPanel, searchIcon, "search icon displayed in search button mode when the value is changed");
-
- gExpectedValue = "foo";
- synthesizeKey("VK_RETURN", {});
- ok(gExpectedValue == null, "search triggered with enter key in search button mode");
- is(icons.selectedPanel, clearIcon, "clear icon displayed in search button mode after submitting with enter key");
-
- textbox.value = "x";
- synthesizeKey("VK_BACK_SPACE", {});
- is(icons.selectedPanel, searchIcon, "search icon displayed in search button mode when deleting the value with the backspace key");
-
- gExpectedValue = "";
- synthesizeKey("VK_RETURN", {});
- ok(gExpectedValue == null, "search triggered with enter key in search button mode");
- is(icons.selectedPanel, searchIcon, "search icon displayed in search button mode after submitting an empty string");
-
- textbox.readOnly = true;
- gExpectedValue = "foo";
- textbox.value = "foo";
- iconClick(searchIcon);
- ok(gExpectedValue == null, "search triggered when clicking the search icon in search button mode while the textbox is read-only");
- is(icons.selectedPanel, searchIcon, "search icon persists in search button mode after submitting while the textbox is read-only");
- textbox.readOnly = false;
-
- textbox.disabled = true;
- is(searchIcon.getAttribute("disabled"), "true", "disabled attribute inherited to the search icon");
- is(clearIcon.getAttribute("disabled"), "true", "disabled attribute inherited to the clear icon");
- gExpectedValue = false;
- textbox.value = "foo";
- iconClick(searchIcon);
- ok(gExpectedValue == false, "search *not* triggered when clicking the search icon in search button mode while the textbox is disabled");
- is(icons.selectedPanel, searchIcon, "search icon persists in search button mode when trying to submit while the textbox is disabled");
- textbox.disabled = false;
- ok(!searchIcon.hasAttribute("disabled"), "disabled attribute removed from the search icon");
- ok(!clearIcon.hasAttribute("disabled"), "disabled attribute removed from the clear icon");
-
- textbox.searchButton = false;
- ok(!textbox.hasAttribute("searchbutton"), "searchbutton attribute removed from the textbox");
- ok(!searchIcon.hasAttribute("searchbutton"), "searchbutton attribute removed from the search icon");
-
- gLastTest = true;
- gExpectedValue = "123";
- textbox.value = "1";
- synthesizeKey("2", {});
- synthesizeKey("3", {});
-}
-
-function doSearch(aValue) {
- is(aValue, gExpectedValue, "search triggered with expected value");
- gExpectedValue = null;
- if (gLastTest)
- SimpleTest.finish();
-}
-
-SimpleTest.waitForFocus(doTests);
-
- ]]></script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_timepicker.xul b/toolkit/content/tests/chrome/test_timepicker.xul
deleted file mode 100644
index 98e370137..000000000
--- a/toolkit/content/tests/chrome/test_timepicker.xul
+++ /dev/null
@@ -1,207 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for timepicker
- -->
-<window title="timepicker" width="500" height="600"
- onload="setTimeout(testtag_timepicker, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<timepicker id="timepicker"/>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script>
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function testtag_timepicker()
-{
- var tp = document.getElementById("timepicker");
-
- var testid = "timepicker ";
-
- var today = new Date();
- var thour = today.getHours();
- var tminute = today.getMinutes();
- var tsecond = today.getSeconds();
-
- // testtag_comparetime(tp, testid + "initial", thour, tminute, tsecond);
-
- // check that setting the value property works
- tp.value = testtag_gettimestring(thour, tminute, tsecond);
- testtag_comparetime(tp, testid + "set value", thour, tminute, tsecond);
-
- var numberOrder = /^(\D*)\s*(\d+)(\D*)(\d+)(\D*)(\d+)\s*(\D*)$/;
- var locale = Intl.DateTimeFormat().resolvedOptions().locale + "-u-ca-gregory-nu-latn";
- var fdt = new Date(2000,0,1,16,7,9).toLocaleTimeString(locale);
- is(tp.is24HourClock, Number(fdt.match(numberOrder)[2]) > 12, "is24HourClock");
-
- // check that setting the dateValue property works
- tp.dateValue = today;
- testtag_comparetime(tp, testid + "set dateValue", thour, tminute, tsecond);
- ok(tp.value !== today, testid + " set dateValue different time");
-
- ok(!tp.readOnly, testid + "readOnly");
- tp.readOnly = true;
- ok(tp.readOnly, testid + "set readOnly");
- tp.readOnly = false;
- ok(!tp.readOnly, testid + "clear readOnly");
-
- function setTimeField(field, value, expectException,
- expectedHour, expectedMinute, expectedSecond)
- {
- var exh = false;
- try {
- tp[field] = value;
- } catch (ex) { exh = true; }
- is(exh, expectException, testid + "set " + field + " " + value);
- testtag_comparetime(tp, testid + "set " + field + " " + value,
- expectedHour, expectedMinute, expectedSecond);
- }
-
- // check the value property
- setTimeField("value", "0:0:0", false, 0, 0, 0);
- setTimeField("value", "21:1:40", false, 21, 1, 40);
- setTimeField("value", "7:11:8", false, 7, 11, 8);
- setTimeField("value", "04:07:02", false, 4, 7, 2);
- setTimeField("value", "10:42:20", false, 10, 42, 20);
-
- // check that the hour, minute and second fields can be set properly
- setTimeField("hour", 7, false, 7, 42, 20);
- setTimeField("hour", 0, false, 0, 42, 20);
- setTimeField("hour", 21, false, 21, 42, 20);
- setTimeField("hour", -1, true, 21, 42, 20);
- setTimeField("hour", 24, true, 21, 42, 20);
-
- setTimeField("minute", 0, false, 21, 0, 20);
- setTimeField("minute", 9, false, 21, 9, 20);
- setTimeField("minute", 10, false, 21, 10, 20);
- setTimeField("minute", 35, false, 21, 35, 20);
- setTimeField("minute", -1, true, 21, 35, 20);
- setTimeField("minute", 60, true, 21, 35, 20);
-
- setTimeField("second", 0, false, 21, 35, 0);
- setTimeField("second", 9, false, 21, 35, 9);
- setTimeField("second", 10, false, 21, 35, 10);
- setTimeField("second", 51, false, 21, 35, 51);
- setTimeField("second", -1, true, 21, 35, 51);
- setTimeField("second", 60, true, 21, 35, 51);
-
- // check when seconds is not specified
- setTimeField("value", "06:05", false, 6, 5, 0);
- setTimeField("value", "06:15", false, 6, 15, 0);
- setTimeField("value", "16:15", false, 16, 15, 0);
-
- // check that times overflow properly
- setTimeField("value", "5:65:21", false, 6, 5, 21);
- setTimeField("value", "5:25:72", false, 5, 26, 12);
-
- // check invalid values for the value and dateValue properties
- tp.value = "14:25:48";
- setTimeField("value", "", true, 14, 25, 48);
- setTimeField("value", "1:5:6:6", true, 14, 25, 48);
- setTimeField("value", "2:a:19", true, 14, 25, 48);
- setTimeField("dateValue", "none", true, 14, 25, 48);
-
- // check the fields
- ok(tp.hourField instanceof HTMLInputElement, testid + "hourField");
- ok(tp.minuteField instanceof HTMLInputElement, testid + "minuteField");
- ok(tp.secondField instanceof HTMLInputElement, testid + "secondField");
-
- testtag_timepicker_UI(tp, testid);
-
- tp.readOnly = true;
-
- // check that keyboard usage doesn't change the value when the timepicker
- // is read only
- testtag_timepicker_UI_key(tp, testid + "readonly ", "14:25:48",
- tp.hourField, 14, 25, 48, 14, 25, 48);
- testtag_timepicker_UI_key(tp, testid + "readonly ", "14:25:48",
- tp.minuteField, 14, 25, 48, 14, 25, 48);
- testtag_timepicker_UI_key(tp, testid + "readonly ", "14:25:48",
- tp.secondField, 14, 25, 48, 14, 25, 48);
-
- SimpleTest.finish();
-}
-
-function testtag_timepicker_UI(tp, testid)
-{
- testid += "UI";
-
- // test adjusting the time with the up and down keys
- testtag_timepicker_UI_key(tp, testid, "0:12:25", tp.hourField, 1, 12, 25, 0, 12, 25);
- testtag_timepicker_UI_key(tp, testid, "11:12:25", tp.hourField, 12, 12, 25, 11, 12, 25);
- testtag_timepicker_UI_key(tp, testid, "7:12:25", tp.hourField, 8, 12, 25, 7, 12, 25);
- testtag_timepicker_UI_key(tp, testid, "16:12:25", tp.hourField, 17, 12, 25, 16, 12, 25);
- testtag_timepicker_UI_key(tp, testid, "23:12:25", tp.hourField, 0, 12, 25, 23, 12, 25);
-
- testtag_timepicker_UI_key(tp, testid, "15:23:46", tp.minuteField, 15, 24, 46, 15, 23, 46);
- testtag_timepicker_UI_key(tp, testid, "15:0:46", tp.minuteField, 15, 1, 46, 15, 0, 46);
- testtag_timepicker_UI_key(tp, testid, "15:59:46", tp.minuteField, 15, 0, 46, 15, 59, 46);
-
- testtag_timepicker_UI_key(tp, testid, "11:50:46", tp.secondField, 11, 50, 47, 11, 50, 46);
- testtag_timepicker_UI_key(tp, testid, "11:50:0", tp.secondField, 11, 50, 1, 11, 50, 0);
- testtag_timepicker_UI_key(tp, testid, "11:50:59", tp.secondField, 11, 50, 0, 11, 50, 59);
-}
-
-function testtag_timepicker_UI_key(tp, testid, value, field,
- uhour, uminute, usecond,
- dhour, dminute, dsecond)
-{
- tp.value = value;
- field.focus();
-
- var eventTarget = tp.readOnly ? null : tp;
-
- var testname = testid + " " + value + " key up";
- synthesizeKeyExpectEvent("VK_UP", { }, eventTarget, "change", testname);
- testtag_comparetime(tp, testname, uhour, uminute, usecond);
-
- testname = testid + " " + value + " key down";
- synthesizeKeyExpectEvent("VK_DOWN", { }, eventTarget, "change", testname);
- testtag_comparetime(tp, testname, dhour, dminute, dsecond);
-}
-
-function testtag_gettimestring(hour, minute, second)
-{
- if (minute < 10)
- minute = "0" + minute;
- if (second < 10)
- second = "0" + second;
- return hour + ":" + minute + ":" + second;
-}
-
-function testtag_comparetime(tp, testid, hour, minute, second)
-{
- is(tp.value, testtag_gettimestring(hour, minute, second), testid + " value");
- is(tp.getAttribute("value"),
- testtag_gettimestring(hour, minute, second),
- testid + " value attribute");
-
- var dateValue = tp.dateValue;
- ok(dateValue.getHours() == hour &&
- dateValue.getMinutes() == minute &&
- dateValue.getSeconds() == second,
- testid + " dateValue");
-
- is(tp.hour, hour, testid + " hour");
- is(tp.minute, minute, testid + " minute");
- is(tp.second, second, testid + " second");
-}
-
-]]>
-
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_titlebar.xul b/toolkit/content/tests/chrome/test_titlebar.xul
deleted file mode 100644
index d48e04a12..000000000
--- a/toolkit/content/tests/chrome/test_titlebar.xul
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for the titlebar element and window dragging
- -->
-<window title="Titlebar" width="200" height="200"
- onload="setTimeout(test_titlebar, 0);"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function test_titlebar()
-{
- window.open("window_titlebar.xul", "_blank", "chrome,left=200,top=200");
-}
-
-function done(testWindow)
-{
- testWindow.close();
- SimpleTest.finish();
-}
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_toolbar.xul b/toolkit/content/tests/chrome/test_toolbar.xul
deleted file mode 100644
index 7adaa6aa3..000000000
--- a/toolkit/content/tests/chrome/test_toolbar.xul
+++ /dev/null
@@ -1,227 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Toolbar" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="startTest();">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <toolbox id="toolbox">
- <toolbarpalette>
- <toolbarbutton id="p1" label="p1"/>
- <toolbarbutton id="p2" label="p2"/>
- <toolbarbutton id="p3" label="p3"/>
- <toolbarbutton id="p4" label="p4"/>
- <toolbarbutton id="p5" label="p5"/>
- <toolbarbutton id="p6" label="p6"/>
- <toolbarbutton id="p7" label="p7"/>
- <toolbarbutton id="p8" label="p8"/>
- <toolbarbutton id="p9" label="p9"/>
- <toolbarbutton id="p10" label="p10"/>
- <toolbarbutton id="p11" label="p11"/>
- <toolbarbutton id="p12" label="p12"/>
- </toolbarpalette>
-
- <toolbar id="tb1" defaultset="p1,p2"/>
- <toolbar id="tb2" defaultset="p4,p3"/>
- <toolbar id="tb3" defaultset="p5,p6,t31">
- <toolbarbutton id="t31" label="t31" removable="true"/>
- </toolbar>
- <toolbar id="tb4" defaultset="t41,p7,p8">
- <toolbarbutton id="t41" label="t41" removable="true"/>
- </toolbar>
- <toolbar id="tb5" defaultset="p9,t51,p10">
- <toolbarbutton id="t51" label="t51" removable="true"/>
- </toolbar>
-
- <toolbar id="tb-test" defaultset="p11,p12"/>
- <toolbar id="tb-test2" defaultset=""/>
- <!-- fixed toolbarbuttons always have 'fixed' in their id -->
- <toolbar id="tb-test3" defaultset="">
- <toolbarbutton id="tb-fixed-1" label="tb-test3-1"/>
- <toolbarbutton id="tb-fixed-2" label="tb-test3-2" removable="false"/>
- <toolbarbutton id="tb-fixed-3" label="tb-test3-3"/>
- </toolbar>
- </toolbox>
-
- <toolbar id="notoolbox"/>
-
- <!-- test resuls are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml"
- style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="text/javascript"><![CDATA[
- const SPACER = /^spacer\d+/;
- const SEPARATOR = /^separator\d+/;
- const SPRING = /^spring\d+/;
-
- function testSet(aTb, aIDs, aResultIDs, aUseFixed) {
- // build a list of the fixed items in the order they appear on the toolbar
- var fixedSet = [];
- if (aUseFixed) {
- for (let i = 0; i < aTb.childNodes.length; i++) {
- var id = aTb.childNodes[i].id;
- if (id.indexOf("fixed") >= 0)
- fixedSet.push(id);
- }
- }
-
- var currentSet = aIDs.join(",");
- ok(currentSet, "setting currentSet: " + currentSet);
- aTb.currentSet = currentSet;
- var resultIDs = aResultIDs || aIDs;
- checkSet(aTb, resultIDs, fixedSet);
- }
-
- var checkSetCount = 0;
- function checkSet(aTb, aResultIDs, aFixedSet) {
- checkSetCount++;
- var testID = "checkSet(" + checkSetCount + ") ";
-
- for (let i = 0; i < aTb.childNodes.length; i++) {
- let id = aTb.childNodes[i].id;
- if (aResultIDs[i] instanceof RegExp) {
- ok(aResultIDs[i].test(id),
- testID + "correct ID " + aResultIDs[i] + " for toolbar " + aTb.id + "; got: " + id);
- }
- else if (aResultIDs[i] == "*") {
- is(id, aFixedSet.shift(), testID + "is fixed with ID " + id + " for toolbar " + aTb.id);
- }
- else {
- is(id, aResultIDs[i],
- testID + "correct ID " + aResultIDs[i] + " for toolbar " + aTb.id +
- "****" + aResultIDs + "," + i + ",");
- // remove the item from the fixed set once found
- if (aFixedSet && id.indexOf("fixed") >= 0)
- aFixedSet.splice(aFixedSet.indexOf(id), 1);
- }
- }
-
- if (aFixedSet)
- is(aFixedSet.length, 0, testID + "extra fixed items for " + aTb.id);
- is(aTb.childNodes.length, aResultIDs.length,
- testID + "correct number of children for " + aTb.id);
- }
-
- function test_defaultSet() {
- checkSet($("tb1"), ["p1", "p2"]);
- checkSet($("tb2"), ["p4", "p3"]);
- checkSet($("tb3"), ["p5", "p6", "t31"]);
- checkSet($("tb4"), ["t41", "p7", "p8"]);
- checkSet($("tb5"), ["p9", "t51", "p10"]);
- }
-
- function test_currentSet(aTb) {
- ok(aTb, "have toolbar");
- var defaultSet = aTb.getAttribute("defaultset");
- var setLength = (defaultSet && defaultSet.split(",").length) || 0;
- is(setLength, aTb.childNodes.length, "correct # of children initially");
-
- var emptySet = [["__empty"], []];
- var testSets = [
- emptySet,
- [["p11"]],
- [["p11","p12"]],
- [["p11","p12","bogus"], ["p11","p12"]],
- [["p11"]],
- emptySet,
- [["spacer"], [SPACER]],
- [["spring"], [SPRING]],
- [["separator"], [SEPARATOR]],
- [["p11", "p11", "p12", "spacer", "p11"], ["p11", "p12", SPACER]],
- [["separator", "separator", "p11", "spring", "spacer"],
- [SEPARATOR, SEPARATOR, "p11", SPRING, SPACER]],
- [["separator", "spacer", "separator", "p11", "spring", "spacer", "p12", "spring"],
- [SEPARATOR, SPACER, SEPARATOR, "p11", SPRING, SPACER, "p12", SPRING]],
- emptySet
- ];
-
- cycleSets(aTb, testSets, emptySet, false);
- }
-
- function test_currentSet_nonremovable() {
- var tb = $("tb-test3");
- ok(tb, "have tb-test-3");
-
- // the * used in the tests below means that any fixed item can appear in that position
- var emptySet = [["__empty"], ["*", "*", "*"]];
- var testSets = [
- [["p1", "tb-fixed-1", "p2"],
- ["p1", "tb-fixed-1", "p2", "*", "*"]],
- [["p1", "tb-fixed-2", "p2"],
- ["p1", "tb-fixed-2", "p2", "*", "*"]],
- [["p1", "tb-fixed-3", "p2"],
- ["p1", "tb-fixed-3", "p2", "*", "*"]],
- emptySet,
-
- [["tb-fixed-1", "tb-fixed-2", "tb-fixed-3"],
- ["tb-fixed-1", "tb-fixed-2", "tb-fixed-3"]],
- [["tb-fixed-3", "tb-fixed-2", "tb-fixed-1"],
- ["tb-fixed-3", "tb-fixed-2", "tb-fixed-1"]],
-
- [["tb-fixed-1", "tb-fixed-2", "tb-fixed-3", "p1", "p2"],
- ["tb-fixed-1", "tb-fixed-2", "tb-fixed-3", "p1", "p2"]],
-
- [["tb-fixed-1", "p2", "p1"],
- ["tb-fixed-1", "p2", "p1", "*", "*"]],
-
- [["tb-fixed-1", "p2"],
- ["tb-fixed-1", "p2", "*", "*"]],
-
- [["p1", "p2"], ["p1", "p2", "*", "*", "*"]],
- [["p2", "p1"], ["p2", "p1", "*", "*", "*"]],
-
- [["tb-fixed-3", "spacer", "p1"],
- ["tb-fixed-3", SPACER, "p1", "*", "*"]]
- ];
-
- cycleSets(tb, testSets, emptySet, true);
- }
-
- function cycleSets(aTb, aSets, aEmptySet, aUseFixed) {
- // Since a lot of the tricky cases handled in the currentSet setter
- // depend on going from one state to another, run through the test set
- // multiple times in different orders.
- var length = aSets.length;
-
- for (var i = 0; i < length; i++) {
- testSet(aTb, aSets[i][0], aSets[i][1], aUseFixed);
- }
- for (var i = length - 1; i >= 0; i--) {
- testSet(aTb, aSets[i][0], aSets[i][1], aUseFixed);
- }
- for (var i = 0; i < length; i++) {
- testSet(aTb, aSets[i][0], aSets[i][1], aUseFixed);
- testSet(aTb, aSets[length - i - 1][0], aSets[length - i - 1][1], aUseFixed);
- testSet(aTb, aSets[i][0], aSets[i][1], aUseFixed);
- testSet(aTb, aSets[i][0], aSets[i][1], aUseFixed);
- }
- for (var i = 0; i < length; i++) {
- testSet(aTb, aEmptySet[0], aEmptySet[1], aUseFixed);
- testSet(aTb, aSets[i][0], aSets[i][1], aUseFixed);
- }
- }
-
- SimpleTest.waitForExplicitFinish();
- function startTest() {
- test_defaultSet();
- test_currentSet($("tb-test"));
- test_currentSet($("tb-test2"));
- test_currentSet_nonremovable();
-
- var toolbox = $("toolbox");
- var toolbars = document.getElementsByTagName("toolbar");
- for (var t = 0; t < toolbars.length; t++) {
- var toolbar = toolbars[t];
- is(toolbar.toolbox, toolbar.id == "notoolbox" ? null : toolbox,
- "toolbar " + toolbar.id + " has correct toolbox");
- }
-
- $("tb1").toolbox = document.documentElement;
- is($("tb1").toolbox, toolbox, "toolbox still correct after set");
- SimpleTest.finish();
- }
- ]]></script>
-</window>
diff --git a/toolkit/content/tests/chrome/test_tooltip.xul b/toolkit/content/tests/chrome/test_tooltip.xul
deleted file mode 100644
index b5650352d..000000000
--- a/toolkit/content/tests/chrome/test_tooltip.xul
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Tooltip Tests"
- onload="setTimeout(runTest, 0)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<script>
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- window.open("window_tooltip.xul", "_blank", "chrome,width=700,height=700");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_tooltip_noautohide.xul b/toolkit/content/tests/chrome/test_tooltip_noautohide.xul
deleted file mode 100644
index 979e42477..000000000
--- a/toolkit/content/tests/chrome/test_tooltip_noautohide.xul
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Tooltip Noautohide Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<tooltip id="thetooltip" noautohide="true"
- onpopupshown="setTimeout(tooltipStillShown, 6000)"
- onpopuphidden="ok(gChecked, 'tooltip did not hide'); SimpleTest.finish()">
- <label id="label" value="This is a tooltip"/>
-</tooltip>
-
-<button id="button" label="Tooltip Text" tooltip="thetooltip"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-var gChecked = false;
-
-function runTests()
-{
- var button = document.getElementById("button");
- var windowUtils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIDOMWindowUtils);
- windowUtils.disableNonTestMouseEvents(true);
- synthesizeMouse(button, 2, 2, { type: "mouseover" });
- synthesizeMouse(button, 4, 4, { type: "mousemove" });
- synthesizeMouse(button, 6, 6, { type: "mousemove" });
- windowUtils.disableNonTestMouseEvents(false);
-}
-
-function tooltipStillShown()
-{
- gChecked = true;
- document.getElementById("thetooltip").hidePopup();
-}
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.waitForFocus(runTests);
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_tree.xul b/toolkit/content/tests/chrome/test_tree.xul
deleted file mode 100644
index 52de74e46..000000000
--- a/toolkit/content/tests/chrome/test_tree.xul
+++ /dev/null
@@ -1,84 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for tree using multiple row selection
- -->
-<window title="Tree" width="500" height="600"
- onload="setTimeout(testtag_tree, 0, 'tree-simple', 'treechildren-simple', 'multiple', 'simple', 'tree');"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<script src="tree_shared.js"/>
-
-<tree id="tree-simple" rows="4">
- <treecols>
- <treecol id="name" label="Name" sort="label" properties="one two" flex="1"/>
- <treecol id="address" label="Address" flex="1"/>
- </treecols>
- <treechildren id="treechildren-simple">
- <treeitem>
- <treerow>
- <treecell label="Mary"/>
- <treecell label="206 Garden Avenue"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Chris"/>
- <treecell label="19 Marion Street"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Sarah"/>
- <treecell label="702 Fern Avenue" editable="false"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="John"/>
- <treecell label="99 Westminster Avenue"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Mary"/>
- <treecell label="206 Garden Avenue"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Chris"/>
- <treecell label="19 Marion Street"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Sarah"/>
- <treecell label="702 Fern Avenue"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="John"/>
- <treecell label="99 Westminster Avenue"/>
- </treerow>
- </treeitem>
- </treechildren>
-</tree>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-]]>
-</script>
-
-</window>
-
diff --git a/toolkit/content/tests/chrome/test_tree_hier.xul b/toolkit/content/tests/chrome/test_tree_hier.xul
deleted file mode 100644
index d1a599eaa..000000000
--- a/toolkit/content/tests/chrome/test_tree_hier.xul
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for hierarchical tree
- -->
-<window title="Hierarchical Tree" width="500" height="600"
- onload="setTimeout(testtag_tree, 0, 'tree-hier', 'treechildren-hier', 'multiple', '', 'hierarchical tree');"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<script src="tree_shared.js"/>
-
-<tree id="tree-hier" rows="4">
- <treecols>
- <treecol id="name" label="Name" primary="true"
- sort="label" properties="one two" flex="1"/>
- <treecol id="address" label="Address" flex="2"/>
- <treecol id="planet" label="Planet" flex="1"/>
- <treecol id="gender" label="Gender" flex="1" cycler="true"/>
- </treecols>
- <treechildren id="treechildren-hier">
- <treeitem>
- <treerow properties="firstrow">
- <treecell label="Mary" value="mary" properties="firstname"/>
- <treecell label="206 Garden Avenue" value="206ga"/>
- <treecell label="Earth"/>
- <treecell label="Female" value="f"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell/>
- <treecell value="19ms"/>
- <treecell label="Earth"/>
- <treecell label="Male" value="m"/>
- </treerow>
- </treeitem>
- <treeitem container="true">
- <treerow>
- <treecell label="Sarah"/>
- <treecell label="702 Fern Avenue" editable="false"/>
- <treecell label="Saturn"/>
- <treecell label="Female" value="f"/>
- </treerow>
- <treechildren>
- <treeitem>
- <treerow>
- <treecell label="Mary"/>
- <treecell label="206 Garden Avenue"/>
- <treecell label="Female" value="f"/>
- <treecell label="Neptune"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Chris"/>
- <treecell label="19 Marion Street"/>
- <treecell label="Omicron Persei 8"/>
- <treecell label="Male" value="m"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Sarah"/>
- <treecell label="702 Fern Avenue" editable="false"/>
- <treecell label="Earth"/>
- <treecell label="Female" value="f"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="John"/>
- <treecell label="99 Westminster Avenue"/>
- <treecell label="Neptune"/>
- <treecell label="Male" value="m"/>
- </treerow>
- </treeitem>
- </treechildren>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="John"/>
- <treecell label="99 Westminster Avenue"/>
- <treecell/>
- <treecell label="Male" value="m"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Mary"/>
- <treecell label="206 Garden Avenue" selectable="false"/>
- <treecell label=""/>
- <treecell label="Female" value="f"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Chris"/>
- <treecell label="19 Marion Street"/>
- <treecell label="Neptune"/>
- <treecell label="Male" value="m"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Sarah"/>
- <treecell label="702 Fern Avenue"/>
- <treecell label="Earth"/>
- <treecell label="Female" value="f"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="John"/>
- <treecell label="99 Westminster Avenue"/>
- <treecell label="Mars"/>
- <treecell label="Male" value="m"/>
- </treerow>
- </treeitem>
- </treechildren>
-</tree>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_tree_hier_cell.xul b/toolkit/content/tests/chrome/test_tree_hier_cell.xul
deleted file mode 100644
index 29e92ba3b..000000000
--- a/toolkit/content/tests/chrome/test_tree_hier_cell.xul
+++ /dev/null
@@ -1,136 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for cell selection tree
- -->
-<window title="Cell Selection Tree" width="500" height="600"
- onload="setTimeout(testtag_tree, 0, 'tree-cell', 'treechildren-cell', 'cell', '', 'cell selection tree');"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<script src="tree_shared.js"/>
-
-<tree id="tree-cell" rows="4" seltype="cell">
- <treecols>
- <treecol id="name" label="Name" primary="true"
- sort="label" properties="one two" flex="1"/>
- <treecol id="address" label="Address" flex="2"/>
- <treecol id="planet" label="Planet" flex="1"/>
- <treecol id="gender" label="Gender" flex="1" cycler="true"/>
- </treecols>
- <treechildren id="treechildren-cell">
- <treeitem>
- <treerow properties="firstrow">
- <treecell label="Mary" value="mary" properties="firstname"/>
- <treecell label="206 Garden Avenue" value="206ga"/>
- <treecell label="Earth"/>
- <treecell label="Female" value="f"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell/>
- <treecell value="19ms"/>
- <treecell label="Earth"/>
- <treecell label="Male" value="m"/>
- </treerow>
- </treeitem>
- <treeitem container="true">
- <treerow>
- <treecell label="Sarah"/>
- <treecell label="702 Fern Avenue" editable="false"/>
- <treecell label="Saturn"/>
- <treecell label="Female" value="f"/>
- </treerow>
- <treechildren>
- <treeitem>
- <treerow>
- <treecell label="Mary"/>
- <treecell label="206 Garden Avenue"/>
- <treecell label="Female" value="f"/>
- <treecell label="Neptune"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Chris"/>
- <treecell label="19 Marion Street"/>
- <treecell label="Omicron Persei 8"/>
- <treecell label="Male" value="m"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Sarah"/>
- <treecell label="702 Fern Avenue" editable="false"/>
- <treecell label="Earth"/>
- <treecell label="Female" value="f"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="John"/>
- <treecell label="99 Westminster Avenue"/>
- <treecell label="Neptune"/>
- <treecell label="Male" value="m"/>
- </treerow>
- </treeitem>
- </treechildren>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="John"/>
- <treecell label="99 Westminster Avenue"/>
- <treecell/>
- <treecell label="Male" value="m"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Mary"/>
- <treecell label="206 Garden Avenue" selectable="false"/>
- <treecell label=""/>
- <treecell label="Female" value="f"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Chris"/>
- <treecell label="19 Marion Street"/>
- <treecell label="Neptune"/>
- <treecell label="Male" value="m"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Sarah"/>
- <treecell label="702 Fern Avenue"/>
- <treecell label="Earth"/>
- <treecell label="Female" value="f"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="John"/>
- <treecell label="99 Westminster Avenue"/>
- <treecell label="Mars"/>
- <treecell label="Male" value="m"/>
- </treerow>
- </treeitem>
- </treechildren>
-</tree>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_tree_single.xul b/toolkit/content/tests/chrome/test_tree_single.xul
deleted file mode 100644
index 9b64cb488..000000000
--- a/toolkit/content/tests/chrome/test_tree_single.xul
+++ /dev/null
@@ -1,110 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for single selection tree
- -->
-<window title="Single Selection Tree" width="500" height="600"
- onload="setTimeout(testtag_tree, 0, 'tree-single', 'treechildren-single',
- 'single', 'simple', 'single selection tree');"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<script src="tree_shared.js"/>
-
-<tree id="tree-single" rows="4" seltype="single">
- <treecols>
- <treecol id="name" label="Name" sort="label" properties="one two" flex="1"/>
- <treecol id="address" label="Address" flex="1"/>
- </treecols>
- <treechildren id="treechildren-single">
- <treeitem>
- <treerow properties="firstrow">
- <treecell label="Mary" value="mary" properties="firstname"/>
- <treecell label="206 Garden Avenue" value="206ga"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell/>
- <treecell value="19ms"/>
- </treerow>
- </treeitem>
- <treeitem container="true">
- <treerow>
- <treecell label="Sarah"/>
- <treecell label="702 Fern Avenue" editable="false"/>
- </treerow>
- <treechildren>
- <treeitem>
- <treerow>
- <treecell label="Mary"/>
- <treecell label="206 Garden Avenue"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Chris"/>
- <treecell label="19 Marion Street"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Sarah"/>
- <treecell label="702 Fern Avenue" editable="false"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="John"/>
- <treecell label="99 Westminster Avenue"/>
- </treerow>
- </treeitem>
- </treechildren>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="John"/>
- <treecell label="99 Westminster Avenue"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Mary"/>
- <treecell label="206 Garden Avenue" selectable="false"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Chris"/>
- <treecell label="19 Marion Street"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="Sarah"/>
- <treecell label="702 Fern Avenue"/>
- </treerow>
- </treeitem>
- <treeitem>
- <treerow>
- <treecell label="John"/>
- <treecell label="99 Westminster Avenue"/>
- </treerow>
- </treeitem>
- </treechildren>
-</tree>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/test_tree_view.xul b/toolkit/content/tests/chrome/test_tree_view.xul
deleted file mode 100644
index 235e3a594..000000000
--- a/toolkit/content/tests/chrome/test_tree_view.xul
+++ /dev/null
@@ -1,118 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for tree using a custom nsITreeView
- -->
-<window title="Tree" onload="init()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<script src="tree_shared.js"/>
-
-<script>
-<![CDATA[
-
-// This is our custom view, based on the treeview interface
-var view =
-{
- treeData: [["Mary", "206 Garden Avenue"],
- ["Chris", "19 Marion Street"],
- ["Sarah", "702 Fern Avenue"],
- ["John", "99 Westminster Avenue"]],
- value: "",
- rowCount: 8,
- getCellText: function(row, column) { return this.treeData[row % 4][column.index]; },
- getCellValue: function(row, column) { return this.value; },
- setCellText: function(row, column, val) { this.treeData[row % 4][column.index] = val; },
- setCellValue: function(row, column, val) { this.value = val; },
- setTree: function(tree) { this.tree = tree; },
- isContainer: function(row) { return false; },
- isContainerOpen: function(row) { return false; },
- isContainerEmpty: function(row) { return false; },
- isSeparator: function(row) { return false; },
- isSorted: function(row) { return false; },
- isSelectable: function(row, column) { return true; },
- isEditable: function(row, column) { return row != 2 || column.index != 1; },
- getProgressMode: function(row, column) { return Components.interfaces.nsITreeView.PROGRESS_NORMAL; },
- getParentIndex: function(row, column) { return -1; },
- getLevel: function(row) { return 0; },
- hasNextSibling: function(row, column) { return row != this.rowCount - 1; },
- getImageSrc: function(row, column) { return ""; },
- cycleHeader: function(column) { },
- getRowProperties: function(row) { return ""; },
- getCellProperties: function(row, column) { return ""; },
- getColumnProperties: function(column)
- {
- if (!column.index) {
- return "one two";
- }
-
- return "";
- }
-}
-
-function getCustomTreeViewCellInfo()
-{
- var obj = { rows: [] };
-
- for (var row = 0; row < view.rowCount; row++) {
- var cellInfo = [ ];
- for (var column = 0; column < 1; column++) {
- cellInfo.push({ label: "" + view.treeData[row % 4][column],
- value: "",
- properties: "",
- editable: row != 2 || column.index != 1,
- selectable: true,
- image: "",
- mode: Components.interfaces.nsITreeView.PROGRESS_NORMAL });
- }
-
- obj.rows.push({ cells: cellInfo,
- properties: "",
- container: false,
- separator: false,
- children: null,
- level: 0,
- parent: -1 });
- }
-
- return obj;
-}
-
-function init()
-{
- var tree = document.getElementById("tree-view");
- tree.view = view;
- tree.treeBoxObject.ensureRowIsVisible(0);
- is(tree.treeBoxObject.getFirstVisibleRow(), 0, "first visible after ensureRowIsVisible on load");
- tree.setAttribute("rows", "4");
-
- setTimeout(testtag_tree, 0, "tree-view", "treechildren-view", "multiple", "simple", "tree view");
-}
-
-]]>
-</script>
-
-<tree id="tree-view">
- <treecols>
- <treecol id="name" label="Name" sort="label" flex="1"/>
- <treecol id="address" label="Address" flex="1"/>
- </treecols>
- <treechildren id="treechildren-view"/>
-</tree>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-]]>
-</script>
-
-</window>
-
diff --git a/toolkit/content/tests/chrome/window_browser_drop.xul b/toolkit/content/tests/chrome/window_browser_drop.xul
deleted file mode 100644
index 2d9bcd2a1..000000000
--- a/toolkit/content/tests/chrome/window_browser_drop.xul
+++ /dev/null
@@ -1,242 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window title="Browser Drop Tests"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<script>
-<![CDATA[
-
-Components.utils.import("resource://testing-common/ContentTask.jsm");
-
-function dropOnRemoteBrowserAsync(browser, data, shouldExpectStateChange) {
- ContentTask.setTestScope(window); // Need this so is/isnot/ok are available inside the contenttask
- return ContentTask.spawn(browser, {data, shouldExpectStateChange}, function*({data, shouldExpectStateChange}) {
- let { interfaces: Ci, utils: Cu } = Components;
- Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
- if (!content.document.documentElement) {
- // Wait until the testing document gets loaded.
- yield new Promise(resolve => {
- let onload = function() {
- content.window.removeEventListener("load", onload);
- resolve();
- };
- content.window.addEventListener("load", onload);
- });
- }
-
- let dataTransfer = new content.DataTransfer();
- for (let i = 0; i < data.length; i++) {
- let types = data[i];
- for (let j = 0; j < types.length; j++) {
- dataTransfer.mozSetDataAt(types[j].type, types[j].data, i);
- }
- }
- let event = content.document.createEvent("DragEvent");
- event.initDragEvent("drop", true, true, content, 0, 0, 0, 0, 0,
- false, false, false, false, 0, null, dataTransfer);
- content.document.body.dispatchEvent(event);
-
- let links = [];
- try {
- links = Services.droppedLinkHandler.dropLinks(event, true);
- } catch (ex) {
- if (shouldExpectStateChange) {
- ok(false, "Should not have gotten an exception from the dropped link handler, but got: " + ex);
- Cu.reportError(ex);
- }
- }
-
- return links;
- });
-}
-
-function* expectLink(browser, expectedLinks, data, testid, onbody=false) {
- let lastLinks = [];
- let lastLinksPromise = new Promise(resolve => {
- browser.droppedLinkHandler = function(event, links) {
- info(`droppedLinkHandler called, received links ${JSON.stringify(links)}`);
- if (expectedLinks.length == 0) {
- ok(false, `droppedLinkHandler called for ${JSON.stringify(links)} which we didn't expect.`);
- }
- lastLinks = links;
- resolve(links);
- };
- });
-
- function dropOnBrowserSync() {
- let dropEl = onbody ? browser.contentDocument.body : browser;
- synthesizeDrop(dropEl, dropEl, data, "", dropEl.ownerDocument.defaultView);
- }
- let links;
- if (browser.isRemoteBrowser) {
- let remoteLinks = yield dropOnRemoteBrowserAsync(browser, data, expectedLinks.length != 0);
- is(remoteLinks.length, expectedLinks.length, testid + " remote links length");
- for (let i = 0, length = remoteLinks.length; i < length; i++) {
- is(remoteLinks[i].url, expectedLinks[i].url, testid + "[" + i + "] remote link");
- is(remoteLinks[i].name, expectedLinks[i].name, testid + "[" + i + "] remote name");
- }
-
- if (expectedLinks.length == 0) {
- // There is no way to check if nothing happens asynchronously.
- return;
- }
-
- links = yield lastLinksPromise;
- } else {
- dropOnBrowserSync();
- links = lastLinks;
- }
-
- is(links.length, expectedLinks.length, testid + " links length");
- for (let i = 0, length = links.length; i < length; i++) {
- is(links[i].url, expectedLinks[i].url, testid + "[" + i + "] link");
- is(links[i].name, expectedLinks[i].name, testid + "[" + i + "] name");
- }
-};
-
-function* dropLinksOnBrowser(browser, type) {
- // Dropping single text/plain item with single link should open single
- // page.
- yield* expectLink(browser,
- [ { url: "http://www.mozilla.org/",
- name: "http://www.mozilla.org/" } ],
- [ [ { type: "text/plain",
- data: "http://www.mozilla.org/" } ] ],
- "text/plain drop on browser " + type);
-
- // Dropping single text/plain item with multiple links should open
- // multiple pages.
- yield* expectLink(browser,
- [ { url: "http://www.mozilla.org/",
- name: "http://www.mozilla.org/" },
- { url: "http://www.example.com/",
- name: "http://www.example.com/" } ],
- [ [ { type: "text/plain",
- data: "http://www.mozilla.org/\nhttp://www.example.com/" } ] ],
- "text/plain with 2 URLs drop on browser " + type);
-
- // Dropping sinlge unsupported type item should not open anything.
- yield* expectLink(browser,
- [],
- [ [ { type: "text/link",
- data: "http://www.mozilla.org/" } ] ],
- "text/link drop on browser " + type);
-
- // Dropping single text/uri-list item with single link should open single
- // page.
- yield* expectLink(browser,
- [ { url: "http://www.example.com/",
- name: "http://www.example.com/" } ],
- [ [ { type: "text/uri-list",
- data: "http://www.example.com/" } ] ],
- "text/uri-list drop on browser " + type);
-
- // Dropping single text/uri-list item with multiple links should open
- // multiple pages.
- yield* expectLink(browser,
- [ { url: "http://www.example.com/",
- name: "http://www.example.com/" },
- { url: "http://www.mozilla.org/",
- name: "http://www.mozilla.org/" }],
- [ [ { type: "text/uri-list",
- data: "http://www.example.com/\nhttp://www.mozilla.org/" } ] ],
- "text/uri-list with 2 URLs drop on browser " + type);
-
- // Name in text/x-moz-url should be handled.
- yield* expectLink(browser,
- [ { url: "http://www.example.com/",
- name: "Example.com" } ],
- [ [ { type: "text/x-moz-url",
- data: "http://www.example.com/\nExample.com" } ] ],
- "text/x-moz-url drop on browser " + type);
-
- yield* expectLink(browser,
- [ { url: "http://www.mozilla.org/",
- name: "Mozilla.org" },
- { url: "http://www.example.com/",
- name: "Example.com" } ],
- [ [ { type: "text/x-moz-url",
- data: "http://www.mozilla.org/\nMozilla.org\nhttp://www.example.com/\nExample.com" } ] ],
- "text/x-moz-url with 2 URLs drop on browser " + type);
-
- // Dropping single item with multiple types should open single page.
- yield* expectLink(browser,
- [ { url: "http://www.example.org/",
- name: "Example.com" } ],
- [ [ { type: "text/plain",
- data: "http://www.mozilla.org/" },
- { type: "text/x-moz-url",
- data: "http://www.example.org/\nExample.com" } ] ],
- "text/plain and text/x-moz-url drop on browser " + type);
-
- // Dropping javascript or data: URLs should fail:
- yield* expectLink(browser,
- [],
- [ [ { type: "text/plain",
- data: "javascript:'bad'" } ] ],
- "text/plain javascript url drop on browser " + type);
- yield* expectLink(browser,
- [],
- [ [ { type: "text/plain",
- data: "jAvascript:'also bad'" } ] ],
- "text/plain mixed-case javascript url drop on browser " + type);
- yield* expectLink(browser,
- [],
- [ [ { type: "text/plain",
- data: "data:text/html,bad" } ] ],
- "text/plain data url drop on browser " + type);
-
- // Dropping a chrome url should fail as we don't have a source node set,
- // defaulting to a source of file:///
- yield* expectLink(browser,
- [],
- [ [ { type: "text/x-moz-url",
- data: "chrome://browser/content/browser.xul" } ] ],
- "text/x-moz-url chrome url drop on browser " + type);
-
- if (browser.type == "content") {
- yield ContentTask.spawn(browser, null, function() {
- content.window.stopMode = true;
- });
-
- // stopPropagation should not prevent the browser link handling from occuring
- yield* expectLink(browser,
- [ { url: "http://www.mozilla.org/",
- name: "http://www.mozilla.org/" } ],
- [ [ { type: "text/uri-list",
- data: "http://www.mozilla.org/" } ] ],
- "text/x-moz-url drop on browser with stopPropagation drop event", true);
-
- yield ContentTask.spawn(browser, null, function() {
- content.window.cancelMode = true;
- });
-
- // Canceling the event, however, should prevent the link from being handled.
- yield* expectLink(browser,
- [],
- [ [ { type: "text/uri-list", data: "http://www.mozilla.org/" } ] ],
- "text/x-moz-url drop on browser with cancelled drop event", true);
- }
-}
-
-function info(msg) { window.opener.wrappedJSObject.SimpleTest.info(msg); }
-function is(l, r, n) { window.opener.wrappedJSObject.SimpleTest.is(l,r,n); }
-function ok(v, n) { window.opener.wrappedJSObject.SimpleTest.ok(v,n); }
-
-]]>
-</script>
-
-<browser id="chromechild" src="about:blank"/>
-<browser id="contentchild" type="content" width="100" height="100"
- src="data:text/html,&lt;html draggable='true'&gt;&lt;body draggable='true' style='width: 100px; height: 100px;' ondragover='event.preventDefault()' ondrop='if (window.stopMode) event.stopPropagation(); if (window.cancelMode) event.preventDefault();'&gt;&lt;/body&gt;&lt;/html&gt;"/>
-
-<browser id="remote-contentchild" type="content" width="100" height="100" remote="true"
- src="data:text/html,&lt;html draggable='true'&gt;&lt;body draggable='true' style='width: 100px; height: 100px;' ondragover='event.preventDefault()' ondrop='if (window.stopMode) event.stopPropagation(); if (window.cancelMode) event.preventDefault();'&gt;&lt;/body&gt;&lt;/html&gt;"/>
-</window>
diff --git a/toolkit/content/tests/chrome/window_chromemargin.xul b/toolkit/content/tests/chrome/window_chromemargin.xul
deleted file mode 100644
index 3dec6d137..000000000
--- a/toolkit/content/tests/chrome/window_chromemargin.xul
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window id="window" title="Subframe Origin Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-chrome margins rock!
-<script>
-
-// Tests parsing of the chrome margin attrib on a window.
-
-function ok(condition, message) {
- window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
-}
-
-function doSingleTest(param, shouldSucceed)
-{
- var exception = null;
- try {
- document.documentElement.removeAttribute("chromemargin");
- document.documentElement.setAttribute("chromemargin", param);
- ok(document.
- documentElement.
- getAttribute("chromemargin") == param, "couldn't set/get chromemargin?");
- } catch (ex) {
- exception = ex;
- }
- if (shouldSucceed)
- ok(!exception, "failed for param:'" + param + "'");
- else
- ok(exception, "did not fail for invalid param:'" + param + "'");
- return true;
-}
-
-function runTests()
-{
- var doc = document.documentElement;
-
- // make sure we can set and get
- doc.setAttribute("chromemargin", "0,0,0,0");
- ok(doc.getAttribute("chromemargin") == "0,0,0,0", "couldn't set/get chromemargin?");
- doc.setAttribute("chromemargin", "-1,-1,-1,-1");
- ok(doc.getAttribute("chromemargin") == "-1,-1,-1,-1", "couldn't set/get chromemargin?");
-
- // test remove
- doc.removeAttribute("chromemargin");
- ok(doc.getAttribute("chromemargin") == "", "couldn't remove chromemargin?");
-
- // we already test these really well in a c++ test in widget
- doSingleTest("1,2,3,4", true);
- doSingleTest("-2,-2,-2,-2", true);
- doSingleTest("1,1,1,1", true);
- doSingleTest("", false);
- doSingleTest("12123123", false);
- doSingleTest("0,-1,-1,-1", true);
- doSingleTest("-1,0,-1,-1", true);
- doSingleTest("-1,-1,0,-1", true);
- doSingleTest("-1,-1,-1,0", true);
- doSingleTest("1234567890,1234567890,1234567890,1234567890", true);
- doSingleTest("-1,-1,-1,-1", true);
-
- window.opener.wrappedJSObject.SimpleTest.finish();
- window.close();
-}
-
-window.opener.wrappedJSObject.SimpleTest.waitForFocus(runTests, window);
-
-</script>
-</window>
diff --git a/toolkit/content/tests/chrome/window_cursorsnap_dialog.xul b/toolkit/content/tests/chrome/window_cursorsnap_dialog.xul
deleted file mode 100644
index df6f0bf02..000000000
--- a/toolkit/content/tests/chrome/window_cursorsnap_dialog.xul
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<dialog title="Cursor snapping test" id="dialog"
- width="600" height="600"
- onload="onload();"
- onunload="onunload();"
- buttons="accept,cancel"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-function ok(aCondition, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.ok(aCondition, aMessage);
-}
-
-function is(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.is(aLeft, aRight, aMessage);
-}
-
-function isnot(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.isnot(aLeft, aRight, aMessage);
-}
-
-function canRetryTest()
-{
- return window.opener.wrappedJSObject.canRetryTest();
-}
-
-function getTimeoutTime()
-{
- return window.opener.wrappedJSObject.getTimeoutTime();
-}
-
-var gTimer;
-var gRetry;
-
-function finishByTimeout()
-{
- var button = document.getElementById("dialog").getButton("accept");
- if (button.disabled)
- ok(true, "cursor is NOT snapped to the disabled button (dialog)");
- else if (button.hidden)
- ok(true, "cursor is NOT snapped to the hidden button (dialog)");
- else {
- if (!canRetryTest()) {
- ok(false, "cursor is NOT snapped to the default button (dialog)");
- } else {
- // otherwise, this may be unexpected timeout, we should retry the test.
- gRetry = true;
- }
- }
- finish();
-}
-
-function finish()
-{
- window.close();
-}
-
-function onMouseMove(aEvent)
-{
- var button = document.getElementById("dialog").getButton("accept");
- if (button.disabled)
- ok(false, "cursor IS snapped to the disabled button (dialog)");
- else if (button.hidden)
- ok(false, "cursor IS snapped to the hidden button (dialog)");
- else
- ok(true, "cursor IS snapped to the default button (dialog)");
- clearTimeout(gTimer);
- finish();
-}
-
-function onload()
-{
- var button = document.getElementById("dialog").getButton("accept");
- button.addEventListener("mousemove", onMouseMove, false);
-
- if (window.opener.wrappedJSObject.gDisable) {
- button.disabled = true;
- }
- if (window.opener.wrappedJSObject.gHidden) {
- button.hidden = true;
- }
- gRetry = false;
- gTimer = setTimeout(finishByTimeout, getTimeoutTime());
-}
-
-function onunload()
-{
- if (gRetry) {
- window.opener.wrappedJSObject.retryCurrentTest();
- } else {
- window.opener.wrappedJSObject.runNextTest();
- }
-}
-
-]]>
-</script>
-
-</dialog>
diff --git a/toolkit/content/tests/chrome/window_cursorsnap_wizard.xul b/toolkit/content/tests/chrome/window_cursorsnap_wizard.xul
deleted file mode 100644
index a226d02b7..000000000
--- a/toolkit/content/tests/chrome/window_cursorsnap_wizard.xul
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<wizard title="Cursor snapping test" id="wizard"
- width="600" height="600"
- onload="onload();"
- onunload="onunload();"
- buttons="accept,cancel"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <wizardpage>
- <label value="first page"/>
- </wizardpage>
-
- <wizardpage>
- <label value="second page"/>
- </wizardpage>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-function ok(aCondition, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.ok(aCondition, aMessage);
-}
-
-function is(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.is(aLeft, aRight, aMessage);
-}
-
-function isnot(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.isnot(aLeft, aRight, aMessage);
-}
-
-function canRetryTest()
-{
- return window.opener.wrappedJSObject.canRetryTest();
-}
-
-function getTimeoutTime()
-{
- return window.opener.wrappedJSObject.getTimeoutTime();
-}
-
-var gTimer;
-var gRetry = false;
-
-function finishByTimeout()
-{
- var button = document.getElementById("wizard").getButton("next");
- if (button.disabled)
- ok(true, "cursor is NOT snapped to the disabled button (wizard)");
- else if (button.hidden)
- ok(true, "cursor is NOT snapped to the hidden button (wizard)");
- else {
- if (!canRetryTest()) {
- ok(false, "cursor is NOT snapped to the default button (wizard)");
- } else {
- // otherwise, this may be unexpected timeout, we should retry the test.
- gRetry = true;
- }
- }
- finish();
-}
-
-function finish()
-{
- window.close();
-}
-
-function onMouseMove()
-{
- var button = document.getElementById("wizard").getButton("next");
- if (button.disabled)
- ok(false, "cursor IS snapped to the disabled button (wizard)");
- else if (button.hidden)
- ok(false, "cursor IS snapped to the hidden button (wizard)");
- else
- ok(true, "cursor IS snapped to the default button (wizard)");
- clearTimeout(gTimer);
- finish();
-}
-
-function onload()
-{
- var button = document.getElementById("wizard").getButton("next");
- button.addEventListener("mousemove", onMouseMove, false);
-
- if (window.opener.wrappedJSObject.gDisable) {
- button.disabled = true;
- }
- if (window.opener.wrappedJSObject.gHidden) {
- button.hidden = true;
- }
- gTimer = setTimeout(finishByTimeout, getTimeoutTime());
-}
-
-function onunload()
-{
- if (gRetry) {
- window.opener.wrappedJSObject.retryCurrentTest();
- } else {
- window.opener.wrappedJSObject.runNextTest();
- }
-}
-
-]]>
-</script>
-
-</wizard>
diff --git a/toolkit/content/tests/chrome/window_keys.xul b/toolkit/content/tests/chrome/window_keys.xul
deleted file mode 100644
index 79de9ac45..000000000
--- a/toolkit/content/tests/chrome/window_keys.xul
+++ /dev/null
@@ -1,202 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Key Tests"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<script>
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var gExpected = null;
-
-const kIsWin = navigator.platform.indexOf("Win") >= 0;
-
-// Only on Windows, osKey state is ignored when there is no shortcut key handler
-// which exactly matches with osKey state.
-var keysToTest = [
- ["k-v", "V", { } ],
- ["", "V", { shiftKey: true } ],
- ["k-v-scy", "V", { ctrlKey: true } ],
- ["", "V", { altKey: true } ],
- ["", "V", { metaKey: true } ],
- [kIsWin ? "k-v" : "", "V", { osKey: true } ],
- ["k-v-scy", "V", { shiftKey: true, ctrlKey: true } ],
- ["", "V", { shiftKey: true, ctrlKey: true, altKey: true } ],
- ["k-e-y", "E", { } ],
- ["", "E", { shiftKey: true } ],
- ["", "E", { ctrlKey: true } ],
- ["", "E", { altKey: true } ],
- ["", "E", { metaKey: true } ],
- [kIsWin ? "k-e-y" : "", "E", { osKey: true } ],
- ["k-d-a", "D", { altKey: true } ],
- ["k-8-m", "8", { metaKey: true } ],
- [kIsWin ? "k-8-m" : "", "8", { metaKey: true, osKey: true } ],
- ["k-a-o", "A", { osKey: true } ],
- ["", "A", { osKey: true, metaKey: true } ],
- ["", "B", {} ],
- ["k-b-myo", "B", { osKey: true } ],
- ["k-b-myo", "B", { osKey: true, metaKey: true } ],
- ["k-f-oym", "F", { metaKey: true } ],
- ["k-f-oym", "F", { metaKey: true, osKey: true } ],
- ["k-c-scaym", "C", { metaKey: true } ],
- ["k-c-scaym", "C", { shiftKey: true, ctrlKey: true, altKey: true, metaKey: true } ],
- [kIsWin ? "k-c-scaym" : "", "C", { shiftKey: true, ctrlKey: true, altKey: true, metaKey: true, osKey: true } ],
- ["", "V", { shiftKey: true, ctrlKey: true, altKey: true } ],
- ["k-h-l", "H", { accelKey: true } ],
-// ["k-j-s", "J", { accessKey: true } ],
- ["", "T", { } ],
- ["k-g-c", "G", { ctrlKey: true } ],
- ["k-g-co", "G", { ctrlKey: true, osKey: true } ],
- ["scommand", "Y", { } ],
- ["", "U", { } ],
-];
-
-function runTest()
-{
- iterateKeys(true, "normal");
-
- var keyset = document.getElementById("keyset");
- keyset.setAttribute("disabled", "true");
- iterateKeys(false, "disabled");
-
- var keyset = document.getElementById("keyset");
- keyset.removeAttribute("disabled");
- iterateKeys(true, "reenabled");
-
- keyset.parentNode.removeChild(keyset);
- iterateKeys(false, "removed");
-
- document.documentElement.appendChild(keyset);
- iterateKeys(true, "appended");
-
- var accelText = menuitem => menuitem.getAttribute("acceltext").toLowerCase();
-
- $("menubutton").open = true;
-
- // now check if a menu updates its accelerator text when a key attribute is changed
- var menuitem1 = $("menuitem1");
- ok(accelText(menuitem1).indexOf("d") >= 0, "menuitem1 accelText before");
- if (kIsWin) {
- ok(accelText(menuitem1).indexOf("alt") >= 0, "menuitem1 accelText modifier before");
- }
-
- menuitem1.setAttribute("key", "k-s-c");
- ok(accelText(menuitem1).indexOf("s") >= 0, "menuitem1 accelText after");
- if (kIsWin) {
- ok(accelText(menuitem1).indexOf("ctrl") >= 0, "menuitem1 accelText modifier after");
- }
-
- menuitem1.setAttribute("acceltext", "custom");
- is(accelText(menuitem1), "custom", "menuitem1 accelText set custom");
- menuitem1.removeAttribute("acceltext");
- ok(accelText(menuitem1).indexOf("s") >= 0, "menuitem1 accelText remove");
- if (kIsWin) {
- ok(accelText(menuitem1).indexOf("ctrl") >= 0, "menuitem1 accelText modifier remove");
- }
-
- var menuitem2 = $("menuitem2");
- is(accelText(menuitem2), "", "menuitem2 accelText before");
- menuitem2.setAttribute("key", "k-s-c");
- ok(accelText(menuitem2).indexOf("s") >= 0, "menuitem2 accelText before");
- if (kIsWin) {
- ok(accelText(menuitem2).indexOf("ctrl") >= 0, "menuitem2 accelText modifier before");
- }
-
- menuitem2.setAttribute("key", "k-h-l");
- ok(accelText(menuitem2).indexOf("h") >= 0, "menuitem2 accelText after");
- if (kIsWin) {
- ok(accelText(menuitem2).indexOf("ctrl") >= 0, "menuitem2 accelText modifier after");
- }
-
- menuitem2.removeAttribute("key");
- is(accelText(menuitem2), "", "menuitem2 accelText after remove");
-
- $("menubutton").open = false;
-
- window.close();
- window.opener.wrappedJSObject.SimpleTest.finish();
-}
-
-function iterateKeys(enabled, testid)
-{
- for (var k = 0; k < keysToTest.length; k++) {
- gExpected = keysToTest[k];
- var expectedKey = gExpected[0];
- if (!gExpected[2].accessKey || navigator.platform.indexOf("Mac") == -1) {
- synthesizeKey(gExpected[1], gExpected[2]);
- ok((enabled && expectedKey) || expectedKey == "k-d-a" ?
- !gExpected : gExpected, testid + " key step " + (k + 1));
- }
- }
-}
-
-function checkKey(event)
-{
- // the first element of the gExpected array holds the id of the <key> element
- // that was expected. If this is empty, a handler wasn't expected to be called
- if (gExpected[0])
- is(event.originalTarget.id, gExpected[0], "key " + gExpected[1]);
- else
- is("key " + event.originalTarget.id + " was activated", "", "key " + gExpected[1]);
- gExpected = null;
-}
-
-function is(l, r, n) { window.opener.wrappedJSObject.SimpleTest.is(l,r,n); }
-function ok(v, n) { window.opener.wrappedJSObject.SimpleTest.ok(v,n); }
-
-SimpleTest.waitForFocus(runTest);
-
-]]>
-</script>
-
-<command id="scommand" oncommand="checkKey(event)"/>
-<command id="scommand-disabled" disabled="true"/>
-
-<keyset id="keyset">
- <key id="k-v" key="v" oncommand="checkKey(event)"/>
- <key id="k-v-scy" key="v" modifiers="shift any control" oncommand="checkKey(event)"/>
- <key id="k-e-y" key="e" modifiers="any" oncommand="checkKey(event)"/>
- <key id="k-8-m" key="8" modifiers="meta" oncommand="checkKey(event)"/>
- <key id="k-a-o" key="a" modifiers="os" oncommand="checkKey(event)"/>
- <key id="k-b-myo" key="b" modifiers="meta any os" oncommand="checkKey(event)"/>
- <key id="k-f-oym" key="f" modifiers="os any meta" oncommand="checkKey(event)"/>
- <key id="k-c-scaym" key="c" modifiers="shift control alt any meta" oncommand="checkKey(event)"/>
- <key id="k-h-l" key="h" modifiers="accel" oncommand="checkKey(event)"/>
- <key id="k-j-s" key="j" modifiers="access" oncommand="checkKey(event)"/>
- <key id="k-t-y" disabled="true" key="t" oncommand="checkKey(event)"/>
- <key id="k-g-c" key="g" modifiers="control" oncommand="checkKey(event)"/>
- <key id="k-g-co" key="g" modifiers="control os" oncommand="checkKey(event)"/>
- <key id="k-y" key="y" command="scommand"/>
- <key id="k-u" key="u" command="scommand-disabled"/>
-</keyset>
-
-<keyset id="keyset2">
- <key id="k-d-a" key="d" modifiers="alt" oncommand="checkKey(event)"/>
- <key id="k-s-c" key="s" modifiers="control" oncommand="checkKey(event)"/>
-</keyset>
-
-<button id="menubutton" label="Menu" type="menu">
- <menupopup>
- <menuitem id="menuitem1" label="Item 1" key="k-d-a"/>
- <menuitem id="menuitem2" label="Item 2"/>
- </menupopup>
-</button>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/window_largemenu.xul b/toolkit/content/tests/chrome/window_largemenu.xul
deleted file mode 100644
index 72e1c077d..000000000
--- a/toolkit/content/tests/chrome/window_largemenu.xul
+++ /dev/null
@@ -1,425 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window title="Large Menu Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<!--
- This test checks that a large menu is displayed with arrow buttons
- and is on the screen.
- -->
-
-<script>
-<![CDATA[
-
-var gOverflowed = false, gUnderflowed = false;
-var gContextMenuTests = false;
-var gScreenY = -1;
-var gTestIndex = 0;
-var gTests = ["open normal", "open when bottom would overlap", "open with scrolling",
- "open after scrolling", "open small again",
- "menu movement", "panel movement",
- "context menu enough space below",
- "context menu more space above",
- "context menu too big either side",
- "context menu larger than screen",
- "context menu flips horizontally on osx"];
-function getScreenXY(element)
-{
- var screenX, screenY;
- var mouseFn = function(event) {
- screenX = event.screenX - 1;
- screenY = event.screenY - 1;
- }
-
- // a hacky way to get the screen position of an element without using the box object
- window.addEventListener("mousedown", mouseFn, false);
- synthesizeMouse(element, 1, 1, { });
- window.removeEventListener("mousedown", mouseFn, false);
-
- return [screenX, screenY];
-}
-
-function hidePopup() {
- window.requestAnimationFrame(
- function() {
- setTimeout(
- function() {
- document.getElementById("popup").hidePopup();
- }, 0);
- });
-}
-
-function runTests()
-{
- [, gScreenY] = getScreenXY(document.documentElement);
- nextTest();
-}
-
-function nextTest()
-{
- gOverflowed = false, gUnderflowed = false;
-
- var y = screen.height;
- if (gTestIndex == 1) // open with bottom overlap test:
- y -= 100;
- else
- y /= 2;
-
- var popup = document.getElementById("popup");
- if (gTestIndex == 2) {
- // add some more menuitems so that scrolling will be necessary
- var moreItemCount = Math.round(screen.height / popup.firstChild.getBoundingClientRect().height);
- for (var t = 1; t <= moreItemCount; t++) {
- var menu = document.createElement("menuitem");
- menu.setAttribute("label", "More" + t);
- popup.appendChild(menu);
- }
- }
- else if (gTestIndex == 4) {
- // remove the items added in test 2 above
- while (popup.childNodes.length > 15)
- popup.removeChild(popup.lastChild);
- }
-
- window.requestAnimationFrame(function() {
- setTimeout(
- function() {
- popup.openPopupAtScreen(100, y, false);
- }, 0);
- });
-}
-
-function popupShown()
-{
- if (gTests[gTestIndex] == "menu movement")
- return testPopupMovement();
-
- if (gContextMenuTests)
- return contextMenuPopupShown();
-
- var popup = document.getElementById("popup");
- var rect = popup.getBoundingClientRect();
- var sbo = document.getAnonymousNodes(popup)[0].scrollBoxObject;
- var expectedScrollPos = 0;
-
- if (gTestIndex == 0) {
- // the popup should be in the center of the screen
- // note that if the height is odd, the y-offset will have been rounded
- // down when we pass the fractional value to openPopupAtScreen above.
- is(Math.round(rect.top) + gScreenY, Math.floor(screen.height / 2),
- gTests[gTestIndex] + " top");
- ok(Math.round(rect.bottom) + gScreenY < screen.height,
- gTests[gTestIndex] + " bottom");
- ok(!gOverflowed && !gUnderflowed, gTests[gTestIndex] + " overflow")
- }
- else if (gTestIndex == 1) {
- // the popup was supposed to open 100 pixels from the bottom, but that
- // would put it off screen so ...
- if (platformIsMac()) {
- // On OSX the popup is constrained so it remains within the
- // bounds of the screen
- ok(Math.round(rect.top) + gScreenY >= screen.top, gTests[gTestIndex] + " top");
- is(Math.round(rect.bottom) + gScreenY, screen.availTop + screen.availHeight, gTests[gTestIndex] + " bottom");
- ok(!gOverflowed && !gUnderflowed, gTests[gTestIndex] + " overflow");
- }
- else {
- // On other platforms the menu should be flipped to have its bottom
- // edge 100 pixels from the bottom
- ok(Math.round(rect.top) + gScreenY >= screen.top, gTests[gTestIndex] + " top");
- is(Math.round(rect.bottom) + gScreenY, screen.height - 100,
- gTests[gTestIndex] + " bottom");
- ok(!gOverflowed && !gUnderflowed, gTests[gTestIndex] + " overflow");
- }
- }
- else if (gTestIndex == 2) {
- // the popup is too large so ensure that it is on screen
- ok(Math.round(rect.top) + gScreenY >= screen.top, gTests[gTestIndex] + " top");
- ok(Math.round(rect.bottom) + gScreenY <= screen.height, gTests[gTestIndex] + " bottom");
- ok(gOverflowed && !gUnderflowed, gTests[gTestIndex] + " overflow")
-
- sbo.scrollTo(0, 40);
- expectedScrollPos = 40;
- }
- else if (gTestIndex == 3) {
- expectedScrollPos = 40;
- }
- else if (gTestIndex == 4) {
- // note that if the height is odd, the y-offset will have been rounded
- // down when we pass the fractional value to openPopupAtScreen above.
- is(Math.round(rect.top) + gScreenY, Math.floor(screen.height / 2),
- gTests[gTestIndex] + " top");
- ok(Math.round(rect.bottom) + gScreenY < screen.height,
- gTests[gTestIndex] + " bottom");
- ok(!gOverflowed && gUnderflowed, gTests[gTestIndex] + " overflow");
- }
-
- is(sbo.positionY, expectedScrollPos, "menu scroll position");
-
- hidePopup();
-}
-
-function is(l, r, n) { window.opener.wrappedJSObject.SimpleTest.is(l,r,n); }
-function ok(v, n) { window.opener.wrappedJSObject.SimpleTest.ok(v,n); }
-
-var oldx, oldy, waitSteps = 0;
-function moveWindowTo(x, y, callback, arg)
-{
- if (!waitSteps) {
- oldx = window.screenX;
- oldy = window.screenY;
- window.moveTo(x, y);
-
- waitSteps++;
- setTimeout(moveWindowTo, 100, x, y, callback, arg);
- return;
- }
-
- if (window.screenX == oldx && window.screenY == oldy) {
- if (waitSteps++ > 10) {
- ok(false, "Window never moved properly to " + x + "," + y);
- window.opener.wrappedJSObject.SimpleTest.finish();
- window.close();
- }
-
- setTimeout(moveWindowTo, 100, x, y, callback, arg);
- }
- else {
- waitSteps = 0;
- callback(arg);
- }
-}
-
-function popupHidden()
-{
- gTestIndex++;
- if (gTestIndex == gTests.length) {
- window.opener.wrappedJSObject.SimpleTest.finish();
- window.close();
- }
- else if (gTests[gTestIndex] == "context menu enough space below") {
- gContextMenuTests = true;
- moveWindowTo(window.screenX, screen.availTop + 10,
- () => synthesizeMouse(document.getElementById("label"), 4, 4, { type: "contextmenu", button: 2 }));
- }
- else if (gTests[gTestIndex] == "menu movement") {
- document.getElementById("popup").openPopup(
- document.getElementById("label"), "after_start", 0, 0, false, false);
- }
- else if (gTests[gTestIndex] == "panel movement") {
- document.getElementById("panel").openPopup(
- document.getElementById("label"), "after_start", 0, 0, false, false);
- }
- else if (gContextMenuTests) {
- contextMenuPopupHidden();
- }
- else {
- nextTest();
- }
-}
-
-function contextMenuPopupShown()
-{
- var popup = document.getElementById("popup");
- var rect = popup.getBoundingClientRect();
- var labelrect = document.getElementById("label").getBoundingClientRect();
-
- // Click to open popup in popupHidden() occurs at (4,4) in label's coordinate space
- var clickX = clickY = 4;
-
- var testPopupAppearedRightOfCursor = true;
- switch (gTests[gTestIndex]) {
- case "context menu enough space below":
- is(rect.top, labelrect.top + clickY + (platformIsMac() ? -6 : 2), gTests[gTestIndex] + " top");
- break;
- case "context menu more space above":
- if (platformIsMac()) {
- let screenY;
- [, screenY] = getScreenXY(popup);
- // Macs constrain their popup menus vertically rather than flip them.
- is(screenY, screen.availTop + screen.availHeight - rect.height, gTests[gTestIndex] + " top");
- } else {
- is(rect.top, labelrect.top + clickY - rect.height - 2, gTests[gTestIndex] + " top");
- }
-
- break;
- case "context menu too big either side":
- [, gScreenY] = getScreenXY(document.documentElement);
- // compare against the available size as well as the total size, as some
- // platforms allow the menu to overlap os chrome and others do not
- var pos = (screen.availTop + screen.availHeight - rect.height) - gScreenY;
- var availPos = (screen.top + screen.height - rect.height) - gScreenY;
- ok(rect.top == pos || rect.top == availPos,
- gTests[gTestIndex] + " top");
- break;
- case "context menu larger than screen":
- ok(rect.top == -(gScreenY - screen.availTop) || rect.top == -(gScreenY - screen.top), gTests[gTestIndex] + " top");
- break;
- case "context menu flips horizontally on osx":
- testPopupAppearedRightOfCursor = false;
- if (platformIsMac()) {
- is(Math.round(rect.right), labelrect.left + clickX - 1, gTests[gTestIndex] + " right");
- }
- break;
- }
-
- if (testPopupAppearedRightOfCursor) {
- is(rect.left, labelrect.left + clickX + (platformIsMac() ? 1 : 2), gTests[gTestIndex] + " left");
- }
-
- hidePopup();
-}
-
-function contextMenuPopupHidden()
-{
- var screenAvailBottom = screen.availTop + screen.availHeight;
-
- if (gTests[gTestIndex] == "context menu more space above") {
- moveWindowTo(window.screenX, screenAvailBottom - 80, nextContextMenuTest, -1);
- }
- else if (gTests[gTestIndex] == "context menu too big either side") {
- moveWindowTo(window.screenX, screenAvailBottom / 2 - 80, nextContextMenuTest, screenAvailBottom / 2 + 120);
- }
- else if (gTests[gTestIndex] == "context menu larger than screen") {
- nextContextMenuTest(screen.availHeight + 80);
- }
- else if (gTests[gTestIndex] == "context menu flips horizontally on osx") {
- var popup = document.getElementById("popup");
- var popupWidth = popup.getBoundingClientRect().width;
- moveWindowTo(screen.availLeft + screen.availWidth - popupWidth, 100, nextContextMenuTest, -1);
- }
-}
-
-function nextContextMenuTest(desiredHeight)
-{
- if (desiredHeight >= 0) {
- var popup = document.getElementById("popup");
- var height = popup.getBoundingClientRect().height;
- var itemheight = document.getElementById("firstitem").getBoundingClientRect().height;
- while (height < desiredHeight) {
- var menu = document.createElement("menuitem");
- menu.setAttribute("label", "Item");
- popup.appendChild(menu);
- height += itemheight;
- }
- }
-
- synthesizeMouse(document.getElementById("label"), 4, 4, { type: "contextmenu", button: 2 });
-}
-
-function testPopupMovement()
-{
- var button = document.getElementById("label");
- var isPanelTest = (gTests[gTestIndex] == "panel movement");
- var popup = document.getElementById(isPanelTest ? "panel" : "popup");
-
- var screenX, screenY, buttonScreenX, buttonScreenY;
- var rect = popup.getBoundingClientRect();
-
- var overlapOSChrome = !platformIsMac();
- popup.moveTo(1, 1);
- [screenX, screenY] = getScreenXY(popup);
-
- var expectedx = 1, expectedy = 1;
- if (!isPanelTest && !overlapOSChrome) {
- if (screen.availLeft >= 1) expectedx = screen.availLeft;
- if (screen.availTop >= 1) expectedy = screen.availTop;
- }
- is(screenX, expectedx, gTests[gTestIndex] + " (1, 1) x");
- is(screenY, expectedy, gTests[gTestIndex] + " (1, 1) y");
-
- popup.moveTo(100, 8000);
- if (isPanelTest) {
- expectedy = 8000;
- }
- else {
- expectedy = (overlapOSChrome ? screen.height + screen.top : screen.availHeight + screen.availTop) -
- Math.round(rect.height);
- }
-
- [screenX, screenY] = getScreenXY(popup);
- is(screenX, 100, gTests[gTestIndex] + " (100, 8000) x");
- is(screenY, expectedy, gTests[gTestIndex] + " (100, 8000) y");
-
- popup.moveTo(6000, 100);
-
- if (isPanelTest) {
- expectedx = 6000;
- }
- else {
- expectedx = (overlapOSChrome ? screen.width + screen.left : screen.availWidth + screen.availLeft) -
- Math.round(rect.width);
- }
-
- [screenX, screenY] = getScreenXY(popup);
- is(screenX, expectedx, gTests[gTestIndex] + " (6000, 100) x");
- is(screenY, 100, gTests[gTestIndex] + " (6000, 100) y");
-
- is(popup.left, "", gTests[gTestIndex] + " left is empty after moving");
- is(popup.top, "", gTests[gTestIndex] + " top is empty after moving");
- popup.setAttribute("left", "80");
- popup.setAttribute("top", "82");
- [screenX, screenY] = getScreenXY(popup);
- is(screenX, 80, gTests[gTestIndex] + " set left and top x");
- is(screenY, 82, gTests[gTestIndex] + " set left and top y");
- popup.moveTo(95, 98);
- [screenX, screenY] = getScreenXY(popup);
- is(screenX, 95, gTests[gTestIndex] + " move after set left and top x");
- is(screenY, 98, gTests[gTestIndex] + " move after set left and top y");
- is(popup.left, "95", gTests[gTestIndex] + " left is set after moving");
- is(popup.top, "98", gTests[gTestIndex] + " top is set after moving");
- popup.removeAttribute("left");
- popup.removeAttribute("top");
-
- popup.moveTo(-1, -1);
- [screenX, screenY] = getScreenXY(popup);
-
- expectedx = (overlapOSChrome ? screen.left : screen.availLeft);
- expectedy = (overlapOSChrome ? screen.top : screen.availTop);
-
- is(screenX, expectedx, gTests[gTestIndex] + " move after set left and top x to -1");
- is(screenY, expectedy, gTests[gTestIndex] + " move after set left and top y to -1");
- is(popup.left, "", gTests[gTestIndex] + " left is not set after moving to -1");
- is(popup.top, "", gTests[gTestIndex] + " top is not set after moving to -1");
-
- popup.hidePopup();
-}
-
-function platformIsMac()
-{
- return navigator.platform.indexOf("Mac") > -1;
-}
-
-window.opener.wrappedJSObject.SimpleTest.waitForFocus(runTests, window);
-
-]]>
-</script>
-
-<button id="label" label="OK" context="popup"/>
-<menupopup id="popup" onpopupshown="popupShown();" onpopuphidden="popupHidden();"
- onoverflow="gOverflowed = true" onunderflow="gUnderflowed = true;">
- <menuitem id="firstitem" label="1"/>
- <menuitem label="2"/>
- <menuitem label="3"/>
- <menuitem label="4"/>
- <menuitem label="5"/>
- <menuitem label="6"/>
- <menuitem label="7"/>
- <menuitem label="8"/>
- <menuitem label="9"/>
- <menuitem label="10"/>
- <menuitem label="11"/>
- <menuitem label="12"/>
- <menuitem label="13"/>
- <menuitem label="14"/>
- <menuitem label="15"/>
-</menupopup>
-
-<panel id="panel" onpopupshown="testPopupMovement();" onpopuphidden="popupHidden();" style="margin: 0">
- <button label="OK"/>
-</panel>
-
-</window>
diff --git a/toolkit/content/tests/chrome/window_panel.xul b/toolkit/content/tests/chrome/window_panel.xul
deleted file mode 100644
index b99b52dfa..000000000
--- a/toolkit/content/tests/chrome/window_panel.xul
+++ /dev/null
@@ -1,312 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-<!--
- XUL Widget Test for panels
- -->
-<window title="Titlebar" width="200" height="200"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<tree id="tree" seltype="single" width="100" height="100">
- <treecols>
- <treecol flex="1"/>
- <treecol flex="1"/>
- </treecols>
- <treechildren id="treechildren">
- <treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
- <treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
- <treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
- <treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
- <treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
- <treeitem><treerow><treecell label="One"/><treecell label="Two"/></treerow></treeitem>
- </treechildren>
-</tree>
-
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var currentTest = null;
-
-function ok(condition, message) {
- window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
-}
-
-function is(left, right, message) {
- window.opener.wrappedJSObject.SimpleTest.is(left, right, message);
-}
-
-function test_panels()
-{
- checkTreeCoords();
-
- addEventListener("popupshowing", popupShowing, false);
- addEventListener("popupshown", popupShown, false);
- addEventListener("popuphidden", nextTest, false);
- nextTest();
-}
-
-function nextTest()
-{
- if (!tests.length) {
- window.close();
- window.opener.wrappedJSObject.SimpleTest.finish();
- return;
- }
-
- currentTest = tests.shift();
- var panel = createPanel(currentTest.attrs);
- currentTest.test(panel);
-}
-
-function popupShowing(event)
-{
- var rect = event.target.getOuterScreenRect();
- ok(!rect.left && !rect.top && !rect.width && !rect.height,
- currentTest.testname + " empty rectangle during popupshowing");
-}
-
-var waitSteps = 0;
-function popupShown(event)
-{
- var panel = event.target;
-
- if (waitSteps > 0 && navigator.platform.indexOf("Linux") >= 0 &&
- panel.boxObject.screenY == 210) {
- waitSteps--;
- setTimeout(popupShown, 10, event);
- return;
- }
-
- currentTest.result(currentTest.testname + " ", panel);
- panel.hidePopup();
-}
-
-function createPanel(attrs)
-{
- var panel = document.createElement("panel");
- for (var a in attrs) {
- panel.setAttribute(a, attrs[a]);
- }
-
- var button = document.createElement("button");
- panel.appendChild(button);
- button.label = "OK";
- button.width = 120;
- button.height = 40;
- button.setAttribute("style", "-moz-appearance: none; border: 0; margin: 0;");
- panel.setAttribute("style", "-moz-appearance: none; border: 0; margin: 0;");
- return document.documentElement.appendChild(panel);
-}
-
-function checkTreeCoords()
-{
- var tree = $("tree");
- var treechildren = $("treechildren");
- tree.currentIndex = 0;
- tree.treeBoxObject.scrollToRow(0);
- synthesizeMouse(treechildren, 10, tree.treeBoxObject.rowHeight + 2, { });
- is(tree.currentIndex, 1, "tree selection");
-
- tree.treeBoxObject.scrollToRow(2);
- synthesizeMouse(treechildren, 10, tree.treeBoxObject.rowHeight + 2, { });
- is(tree.currentIndex, 3, "tree selection after scroll");
-}
-
-var tests = [
- {
- testname: "normal panel",
- attrs: { },
- test: function(panel) {
- var screenRect = panel.getOuterScreenRect();
- is(screenRect.left, 0, this.testname + " screen left before open");
- is(screenRect.top, 0, this.testname + " screen top before open");
- is(screenRect.width, 0, this.testname + " screen width before open");
- is(screenRect.height, 0, this.testname + " screen height before open");
-
- panel.openPopupAtScreen(200, 210);
- },
- result: function(testname, panel) {
- var panelrect = panel.getBoundingClientRect();
- is(panelrect.left, 200 - mozInnerScreenX, testname + "left");
- is(panelrect.top, 210 - mozInnerScreenY, testname + "top");
- is(panelrect.width, 120, testname + "width");
- is(panelrect.height, 40, testname + "height");
-
- var screenRect = panel.getOuterScreenRect();
- is(screenRect.left, 200, testname + " screen left");
- is(screenRect.top, 210, testname + " screen top");
- is(screenRect.width, 120, testname + " screen width");
- is(screenRect.height, 40, testname + " screen height");
- }
- },
- {
- // only noautohide panels support titlebars, so one shouldn't be shown here
- testname: "autohide panel with titlebar",
- attrs: { titlebar: "normal" },
- test: function(panel) {
- var screenRect = panel.getOuterScreenRect();
- is(screenRect.left, 0, this.testname + " screen left before open");
- is(screenRect.top, 0, this.testname + " screen top before open");
- is(screenRect.width, 0, this.testname + " screen width before open");
- is(screenRect.height, 0, this.testname + " screen height before open");
-
- panel.openPopupAtScreen(200, 210);
- },
- result: function(testname, panel) {
- var panelrect = panel.getBoundingClientRect();
- is(panelrect.left, 200 - mozInnerScreenX, testname + "left");
- is(panelrect.top, 210 - mozInnerScreenY, testname + "top");
- is(panelrect.width, 120, testname + "width");
- is(panelrect.height, 40, testname + "height");
-
- var screenRect = panel.getOuterScreenRect();
- is(screenRect.left, 200, testname + " screen left");
- is(screenRect.top, 210, testname + " screen top");
- is(screenRect.width, 120, testname + " screen width");
- is(screenRect.height, 40, testname + " screen height");
- }
- },
- {
- testname: "noautohide panel with titlebar",
- attrs: { noautohide: true, titlebar: "normal" },
- test: function(panel) {
- waitSteps = 25;
-
- var screenRect = panel.getOuterScreenRect();
- is(screenRect.left, 0, this.testname + " screen left before open");
- is(screenRect.top, 0, this.testname + " screen top before open");
- is(screenRect.width, 0, this.testname + " screen width before open");
- is(screenRect.height, 0, this.testname + " screen height before open");
-
- panel.openPopupAtScreen(200, 210);
- },
- result: function(testname, panel) {
- var panelrect = panel.getBoundingClientRect();
- ok(panelrect.left >= 200 - mozInnerScreenX, testname + "left");
- if (navigator.platform.indexOf("Linux") < 0) {
- ok(panelrect.top >= 210 - mozInnerScreenY + 10, testname + "top greater");
- }
- ok(panelrect.top <= 210 - mozInnerScreenY + 32, testname + "top less");
- is(panelrect.width, 120, testname + "width");
- is(panelrect.height, 40, testname + "height");
-
- var screenRect = panel.getOuterScreenRect();
- if (navigator.platform.indexOf("Linux") < 0) {
- is(screenRect.left, 200, testname + " screen left");
- is(screenRect.top, 210, testname + " screen top");
- }
- ok(screenRect.width >= 120 && screenRect.width <= 140, testname + " screen width");
- ok(screenRect.height >= 40 && screenRect.height <= 80, testname + " screen height");
-
- var gotMouseEvent = false;
- function mouseMoved(event)
- {
- is(event.clientY, panelrect.top + 10,
- "popup clientY");
- is(event.screenY, panel.boxObject.screenY + 10,
- "popup screenY");
- is(event.originalTarget, panel.firstChild, "popup target");
- gotMouseEvent = true;
- }
-
- panel.addEventListener("mousemove", mouseMoved, true);
- synthesizeMouse(panel, 10, 10, { type: "mousemove" });
- ok(gotMouseEvent, "mouse event on panel");
- panel.removeEventListener("mousemove", mouseMoved, true);
-
- var tree = $("tree");
- tree.currentIndex = 0;
- panel.appendChild(tree);
- checkTreeCoords();
- }
- },
- {
- testname: "noautohide panel with backdrag",
- attrs: { noautohide: true, backdrag: "true" },
- test: function(panel) {
- var label = document.createElement("label");
- label.id = "backdragspot";
- label.setAttribute("value", "Hello There");
- panel.appendChild(label);
- panel.openPopupAtScreen(200, 230);
- },
- result: function(testname, panel) {
- var oldrect = panel.getOuterScreenRect();
-
- // Linux uses native window moving
- if (navigator.platform.indexOf("Linux") == -1) {
- var backdragspot = document.getElementById("backdragspot");
- synthesizeMouse(backdragspot, 5, 5, { type: "mousedown" });
- synthesizeMouse(backdragspot, 15, 20, { type: "mousemove" });
- synthesizeMouse(backdragspot, 15, 20, { type: "mouseup" });
-
- is(panel.getOuterScreenRect().left, 210, testname + "left");
- is(panel.getOuterScreenRect().top, 245, testname + "top");
- }
- }
- },
- {
- // The panel should be allowed to appear and remain offscreen
- testname: "normal panel with flip='none' off-screen",
- attrs: { "flip": "none" },
- test: function(panel) {
- panel.openPopup(document.documentElement, "", -100 - mozInnerScreenX, -100 - mozInnerScreenY, false, false, null);
- },
- result: function(testname, panel) {
- var panelrect = panel.getBoundingClientRect();
- is(panelrect.left, -100 - mozInnerScreenX, testname + "left");
- is(panelrect.top, -100 - mozInnerScreenY, testname + "top");
- is(panelrect.width, 120, testname + "width");
- is(panelrect.height, 40, testname + "height");
-
- var screenRect = panel.getOuterScreenRect();
- is(screenRect.left, -100, testname + " screen left");
- is(screenRect.top, -100, testname + " screen top");
- is(screenRect.width, 120, testname + " screen width");
- is(screenRect.height, 40, testname + " screen height");
- }
- },
- {
- // The panel should be allowed to remain offscreen after moving and it should follow the anchor
- testname: "normal panel with flip='none' moved off-screen",
- attrs: { "flip": "none" },
- test: function(panel) {
- panel.openPopup(document.documentElement, "", -100 - mozInnerScreenX, -100 - mozInnerScreenY, false, false, null);
- window.moveBy(-50, -50);
- },
- result: function(testname, panel) {
- if (navigator.platform.indexOf("Linux") >= 0) {
- // The window position doesn't get updated immediately on Linux.
- return;
- }
- var panelrect = panel.getBoundingClientRect();
- is(panelrect.left, -150 - mozInnerScreenX, testname + "left");
- is(panelrect.top, -150 - mozInnerScreenY, testname + "top");
- is(panelrect.width, 120, testname + "width");
- is(panelrect.height, 40, testname + "height");
-
- var screenRect = panel.getOuterScreenRect();
- is(screenRect.left, -150, testname + " screen left");
- is(screenRect.top, -150, testname + " screen top");
- is(screenRect.width, 120, testname + " screen width");
- is(screenRect.height, 40, testname + " screen height");
- }
- },
-];
-
-window.opener.wrappedJSObject.SimpleTest.waitForFocus(test_panels, window);
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/window_panel_focus.xul b/toolkit/content/tests/chrome/window_panel_focus.xul
deleted file mode 100644
index 6ac1abdc0..000000000
--- a/toolkit/content/tests/chrome/window_panel_focus.xul
+++ /dev/null
@@ -1,132 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Panel Focus Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<checkbox id="b1" label="Item 1"/>
-
-<!-- Focus should be in this order: 2 6 3 8 1 4 5 7 9 -->
-<panel id="panel" norestorefocus="true" onpopupshown="panelShown()" onpopuphidden="panelHidden()">
- <button id="t1" label="Button One"/>
- <button id="t2" tabindex="1" label="Button Two" onblur="gButtonBlur++;"/>
- <button id="t3" tabindex="2" label="Button Three"/>
- <button id="t4" tabindex="0" label="Button Four"/>
- <button id="t5" label="Button Five"/>
- <button id="t6" tabindex="1" label="Button Six"/>
- <button id="t7" label="Button Seven"/>
- <button id="t8" tabindex="4" label="Button Eight"/>
- <button id="t9" label="Button Nine"/>
-</panel>
-
-<panel id="noautofocusPanel" noautofocus="true"
- onpopupshown="noautofocusPanelShown()" onpopuphidden="noautofocusPanelHidden()">
- <textbox id="tb3"/>
-</panel>
-
-<checkbox id="b2" label="Item 2" popup="panel" onblur="gButtonBlur++;"/>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-var gButtonBlur = 0;
-
-function showPanel()
-{
- // click on the document so that the window has focus
- synthesizeMouse(document.documentElement, 1, 1, { });
-
- // focus the button
- synthesizeKeyExpectEvent("VK_TAB", { }, $("b1"), "focus", "button focus");
- // tabbing again should skip the popup
- synthesizeKeyExpectEvent("VK_TAB", { }, $("b2"), "focus", "popup skipped in focus navigation");
-
- $("panel").openPopup(null, "", 10, 10, false, false);
-}
-
-function panelShown()
-{
- // the focus on the button should have been removed when the popup was opened
- is(gButtonBlur, 1, "focus removed when popup opened");
-
- // press tab numerous times to cycle through the buttons. The t2 button will
- // be blurred twice, so gButtonBlur will be 3 afterwards.
- synthesizeKeyExpectEvent("VK_TAB", { }, $("t2"), "focus", "tabindex 1");
- synthesizeKeyExpectEvent("VK_TAB", { }, $("t6"), "focus", "tabindex 2");
- synthesizeKeyExpectEvent("VK_TAB", { }, $("t3"), "focus", "tabindex 3");
- synthesizeKeyExpectEvent("VK_TAB", { }, $("t8"), "focus", "tabindex 4");
- synthesizeKeyExpectEvent("VK_TAB", { }, $("t1"), "focus", "tabindex 5");
- synthesizeKeyExpectEvent("VK_TAB", { }, $("t4"), "focus", "tabindex 6");
- synthesizeKeyExpectEvent("VK_TAB", { }, $("t5"), "focus", "tabindex 7");
- synthesizeKeyExpectEvent("VK_TAB", { }, $("t7"), "focus", "tabindex 8");
- synthesizeKeyExpectEvent("VK_TAB", { }, $("t9"), "focus", "tabindex 9");
- synthesizeKeyExpectEvent("VK_TAB", { }, $("t2"), "focus", "tabindex 10");
-
- synthesizeKeyExpectEvent("VK_TAB", { shiftKey: true }, $("t9"), "focus", "back tabindex 1");
- synthesizeKeyExpectEvent("VK_TAB", { shiftKey: true }, $("t7"), "focus", "back tabindex 2");
- synthesizeKeyExpectEvent("VK_TAB", { shiftKey: true }, $("t5"), "focus", "back tabindex 3");
- synthesizeKeyExpectEvent("VK_TAB", { shiftKey: true }, $("t4"), "focus", "back tabindex 4");
- synthesizeKeyExpectEvent("VK_TAB", { shiftKey: true }, $("t1"), "focus", "back tabindex 5");
- synthesizeKeyExpectEvent("VK_TAB", { shiftKey: true }, $("t8"), "focus", "back tabindex 6");
- synthesizeKeyExpectEvent("VK_TAB", { shiftKey: true }, $("t3"), "focus", "back tabindex 7");
- synthesizeKeyExpectEvent("VK_TAB", { shiftKey: true }, $("t6"), "focus", "back tabindex 8");
- synthesizeKeyExpectEvent("VK_TAB", { shiftKey: true }, $("t2"), "focus", "back tabindex 9");
-
- is(gButtonBlur, 3, "blur events fired within popup");
-
- synthesizeKey("VK_ESCAPE", { });
-}
-
-function ok(condition, message) {
- window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
-}
-
-function is(left, right, message) {
- window.opener.wrappedJSObject.SimpleTest.is(left, right, message);
-}
-
-function panelHidden()
-{
- // closing the popup should have blurred the focused element
- is(gButtonBlur, 4, "focus removed when popup closed");
-
- // now that the panel is hidden, pressing tab should focus the elements in
- // the main window again
- synthesizeKeyExpectEvent("VK_TAB", { }, $("b1"), "focus", "focus after popup closed");
-
- $("noautofocusPanel").openPopup(null, "", 10, 10, false, false);
-}
-
-function noautofocusPanelShown()
-{
- // with noautofocus="true", the focus should not be removed when the panel is
- // opened, so key events should still be fired at the checkbox.
- synthesizeKeyExpectEvent("VK_SPACE", { }, $("b1"), "command", "noautofocus");
- $("noautofocusPanel").hidePopup();
-}
-
-function noautofocusPanelHidden()
-{
- window.close();
- window.opener.wrappedJSObject.SimpleTest.finish();
-}
-
-window.opener.wrappedJSObject.SimpleTest.waitForFocus(showPanel, window);
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/window_popup_anchor.xul b/toolkit/content/tests/chrome/window_popup_anchor.xul
deleted file mode 100644
index 45f5fe365..000000000
--- a/toolkit/content/tests/chrome/window_popup_anchor.xul
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window title="Popup Anchor Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<script>
-function runTests()
-{
- frames[0].openPopup();
-}
-
-window.opener.wrappedJSObject.SimpleTest.waitForFocus(runTests, window);
-</script>
-
-<spacer height="13"/>
-<button id="outerbutton" label="Button One" style="margin-left: 6px; -moz-appearance: none;"/>
-<hbox>
- <spacer width="20"/>
- <deck>
- <vbox>
- <iframe id="frame" style="margin-left: 60px; margin-top: 10px; border-left: 17px solid red; padding-left: 0 !important; padding-top: 3px;"
- width="250" height="80" src="frame_popup_anchor.xul"/>
- </vbox>
- </deck>
-</hbox>
-
-</window>
diff --git a/toolkit/content/tests/chrome/window_popup_anchoratrect.xul b/toolkit/content/tests/chrome/window_popup_anchoratrect.xul
deleted file mode 100644
index ff37afee7..000000000
--- a/toolkit/content/tests/chrome/window_popup_anchoratrect.xul
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onpopupshown="popupshown(event.target)" onpopuphidden="nextTest()">
-
-<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<label value="Popup Test"/>
-
-<menupopup id="popup">
- <menuitem label="One"/>
- <menuitem label="Two"/>
-</menupopup>
-
-<panel id="panel" noautohide="true" height="20">
- <label value="OK"/>
-</panel>
-
-<script>
-<![CDATA[
-
-let menupopup;
-
-let tests = [
- {
- test: () => menupopup.openPopupAtScreenRect("after_start", 150, 250, 30, 40),
- verify: popup => {
- let rect = popup.getOuterScreenRect();
- is(rect.left, 150, "popup at screen position x");
- is(rect.top, 290, "popup at screen position y");
- }
- },
- {
- test: () => menupopup.openPopupAtScreenRect("after_start", 150, 350, 30, 9000),
- verify: popup => {
- let rect = popup.getOuterScreenRect();
- is(rect.left, 150, "flipped popup at screen position x");
- is(rect.bottom, 350, "flipped popup at screen position y");
- }
- },
- {
- test: () => menupopup.openPopupAtScreenRect("end_before", 150, 250, 30, 40),
- verify: popup => {
- let rect = popup.getOuterScreenRect();
- is(rect.left, 180, "popup at end_before screen position x");
- is(rect.top, 250, "popup at end_before screen position y");
- }
- },
- {
- test: () => $("panel").openPopupAtScreenRect("after_start", 150, 250, 30, 40),
- verify: popup => {
- let rect = popup.getOuterScreenRect();
- is(rect.left, 150, "panel at screen position x");
- is(rect.top, 290, "panel at screen position y");
- }
- },
- {
- test: () => $("panel").openPopupAtScreenRect("before_start", 150, 250, 30, 40),
- verify: popup => {
- let rect = popup.getOuterScreenRect();
- is(rect.left, 150, "panel at before_start screen position x");
- is(rect.bottom, 250, "panel at before_start screen position y");
- }
- },
-];
-
-function runTest(id)
-{
- menupopup = $("popup");
- nextTest();
-}
-
-function nextTest()
-{
- if (!tests.length) {
- window.close();
- window.opener.SimpleTest.finish();
- return;
- }
-
- tests[0].test();
-}
-
-function popupshown(popup)
-{
- tests[0].verify(popup);
- tests.shift();
- popup.hidePopup();
-}
-
-function is(left, right, message)
-{
- window.opener.SimpleTest.is(left, right, message);
-}
-
-function ok(value, message)
-{
- window.opener.SimpleTest.ok(value, message);
-}
-
-window.opener.wrappedJSObject.SimpleTest.waitForFocus(runTest, window);
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/window_popup_attribute.xul b/toolkit/content/tests/chrome/window_popup_attribute.xul
deleted file mode 100644
index 9316d31c4..000000000
--- a/toolkit/content/tests/chrome/window_popup_attribute.xul
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window title="Popup Attribute Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="application/javascript" src="popup_shared.js"></script>
- <script type="application/javascript" src="popup_trigger.js"></script>
-
-<script>
-window.opener.SimpleTest.waitForFocus(runTests, window);
-</script>
-
-<hbox style="margin-left: 200px; margin-top: 270px;">
- <label id="trigger" popup="thepopup" value="Popup" height="60"/>
-</hbox>
-<!-- this frame is used to check that document.popupNode
- is inaccessible from different sources -->
-<iframe id="childframe" type="content" width="10" height="10"
- src="http://sectest2.example.org:80/chrome/toolkit/content/tests/chrome/popup_childframe_node.xul"/>
-
-<menupopup id="thepopup">
- <menuitem id="item1" label="First"/>
- <menuitem id="item2" label="Main Item"/>
- <menuitem id="amenu" label="A Menu" accesskey="M"/>
- <menuitem id="item3" label="Third"/>
- <menuitem id="one" label="One"/>
- <menuitem id="fancier" label="Fancier Menu"/>
- <menu id="submenu" label="Only Menu">
- <menupopup id="submenupopup">
- <menuitem id="submenuitem" label="Test Submenu"/>
- </menupopup>
- </menu>
- <menuitem id="other" disabled="true" label="Other Menu"/>
- <menuitem id="secondlast" label="Second Last Menu" accesskey="T"/>
- <menuitem id="last" label="One Other Menu"/>
-</menupopup>
-
-</window>
diff --git a/toolkit/content/tests/chrome/window_popup_button.xul b/toolkit/content/tests/chrome/window_popup_button.xul
deleted file mode 100644
index 125e6886c..000000000
--- a/toolkit/content/tests/chrome/window_popup_button.xul
+++ /dev/null
@@ -1,41 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window title="Popup Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="application/javascript" src="popup_shared.js"></script>
- <script type="application/javascript" src="popup_trigger.js"></script>
-
-<script>
-window.opener.SimpleTest.waitForFocus(runTests, window);
-</script>
-
-<hbox style="margin-left: 200px; margin-top: 270px;">
- <button id="trigger" type="menu" label="Popup" width="100" height="50">
- <menupopup id="thepopup">
- <menuitem id="item1" label="First"/>
- <menuitem id="item2" label="Main Item"/>
- <menuitem id="amenu" label="A Menu" accesskey="M"/>
- <menuitem id="item3" label="Third"/>
- <menuitem id="one" label="One"/>
- <menuitem id="fancier" label="Fancier Menu"/>
- <menu id="submenu" label="Only Menu">
- <menupopup id="submenupopup">
- <menuitem id="submenuitem" label="Test Submenu"/>
- </menupopup>
- </menu>
- <menuitem id="other" disabled="true" label="Other Menu"/>
- <menuitem id="secondlast" label="Second Last Menu" accesskey="T"/>
- <menuitem id="last" label="One Other Menu"/>
- </menupopup>
- </button>
-</hbox>
-
-<!-- this frame is used to check that document.popupNode
- is inaccessible from different sources -->
-<iframe id="childframe" type="content" width="10" height="10"
- src="http://sectest2.example.org:80/chrome/toolkit/content/tests/chrome/popup_childframe_node.xul"/>
-
-</window>
diff --git a/toolkit/content/tests/chrome/window_popup_preventdefault_chrome.xul b/toolkit/content/tests/chrome/window_popup_preventdefault_chrome.xul
deleted file mode 100644
index 4d10d7fc7..000000000
--- a/toolkit/content/tests/chrome/window_popup_preventdefault_chrome.xul
+++ /dev/null
@@ -1,113 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window title="Popup Prevent Default Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<!--
- This tests checks that preventDefault can be called on a popupshowing
- event or popuphiding event to prevent the default behaviour.
- -->
-
-<script>
-
-var gBlockShowing = true;
-var gBlockHiding = true;
-var gShownNotAllowed = true;
-var gHiddenNotAllowed = true;
-
-var fm = Components.classes["@mozilla.org/focus-manager;1"].
- getService(Components.interfaces.nsIFocusManager);
-
-var is = function(l, r, v) { window.opener.wrappedJSObject.SimpleTest.is(l, r, v); }
-var isnot = function(l, r, v) { window.opener.wrappedJSObject.SimpleTest.isnot(l, r, v); }
-
-function runTest()
-{
- var menu = document.getElementById("menu");
-
- is(fm.activeWindow, window, "active window at start");
- is(fm.focusedWindow, window, "focused window at start");
-
- is(window.windowState, window.STATE_NORMAL, "window is normal");
- // the minimizing test sometimes fails on Linux so don't test it there
- if (navigator.platform.indexOf("Lin") == 0) {
- menu.open = true;
- return;
- }
- window.minimize();
- is(window.windowState, window.STATE_MINIMIZED, "window is minimized");
-
- isnot(fm.activeWindow, window, "active window after minimize");
- isnot(fm.focusedWindow, window, "focused window after minimize");
-
- menu.open = true;
-
- setTimeout(runTestAfterMinimize, 0);
-}
-
-function runTestAfterMinimize()
-{
- var menu = document.getElementById("menu");
- is(menu.firstChild.state, "closed", "popup not opened when window minimized");
-
- window.restore();
- is(window.windowState, window.STATE_NORMAL, "window is restored");
-
- is(fm.activeWindow, window, "active window after restore");
- is(fm.focusedWindow, window, "focused window after restore");
-
- menu.open = true;
-}
-
-function popupShowing(event)
-{
- if (gBlockShowing) {
- event.preventDefault();
- gBlockShowing = false;
- setTimeout(function() {
- gShownNotAllowed = false;
- document.getElementById("menu").open = true;
- }, 3000, true);
- }
-}
-
-function popupShown()
-{
- window.opener.wrappedJSObject.SimpleTest.ok(!gShownNotAllowed, "popupshowing preventDefault");
- document.getElementById("menu").open = false;
-}
-
-function popupHiding(event)
-{
- if (gBlockHiding) {
- event.preventDefault();
- gBlockHiding = false;
- setTimeout(function() {
- gHiddenNotAllowed = false;
- document.getElementById("menu").open = false;
- }, 3000, true);
- }
-}
-
-function popupHidden()
-{
- window.opener.wrappedJSObject.SimpleTest.ok(!gHiddenNotAllowed, "popuphiding preventDefault");
- window.opener.wrappedJSObject.SimpleTest.finish();
- window.close();
-}
-
-window.opener.wrappedJSObject.SimpleTest.waitForFocus(runTest, window);
-</script>
-
-<button id="menu" type="menu" label="Menu">
- <menupopup onpopupshowing="popupShowing(event);"
- onpopupshown="popupShown();"
- onpopuphiding="popupHiding(event);"
- onpopuphidden="popupHidden();">
- <menuitem label="Item"/>
- </menupopup>
-</button>
-
-
-</window>
diff --git a/toolkit/content/tests/chrome/window_preferences.xul b/toolkit/content/tests/chrome/window_preferences.xul
deleted file mode 100644
index 25ee4b5b2..000000000
--- a/toolkit/content/tests/chrome/window_preferences.xul
+++ /dev/null
@@ -1,73 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<!--
- XUL Widget Test for preferences window
--->
-<prefwindow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="preferences window"
- windowtype="test:preferences"
- buttons="accept,cancel"
- onload="RunTest(window.arguments)"
->
- <script type="application/javascript">
- <![CDATA[
- function RunTest(aArgs)
- {
- // run test
- aArgs[0](this);
- // close dialog
- document.documentElement[aArgs[1] ? "acceptDialog" : "cancelDialog"]();
- }
- ]]>
- </script>
-
- <prefpane id="sample_pane" label="Sample Prefpane">
- <preferences id="sample_preferences">
- <!-- one of each type known to <preferences>.valueFromPreferences -->
- <preference id ="tests.static_preference_int"
- name="tests.static_preference_int"
- type="int"/>
- <preference id ="tests.static_preference_bool"
- name="tests.static_preference_bool"
- type="bool"/>
- <preference id ="tests.static_preference_string"
- name="tests.static_preference_string"
- type="string"/>
- <preference id ="tests.static_preference_wstring"
- name="tests.static_preference_wstring"
- type="wstring"/>
- <preference id ="tests.static_preference_unichar"
- name="tests.static_preference_unichar"
- type="unichar"/>
- <preference id ="tests.static_preference_file"
- name="tests.static_preference_file"
- type="file"/>
- </preferences>
-
- <!-- one element for each preference type above -->
- <hbox>
- <label flex="1" value="int"/>
- <textbox id="static_element_int" preference="tests.static_preference_int"/>
- </hbox>
- <hbox>
- <label flex="1" value="bool"/>
- <checkbox id="static_element_bool" preference="tests.static_preference_bool"/>
- </hbox>
- <hbox>
- <label flex="1" value="string"/>
- <textbox id="static_element_string" preference="tests.static_preference_string"/>
- </hbox>
- <hbox>
- <label flex="1" value="wstring"/>
- <textbox id="static_element_wstring" preference="tests.static_preference_wstring"/>
- </hbox>
- <hbox>
- <label flex="1" value="unichar"/>
- <textbox id="static_element_unichar" preference="tests.static_preference_unichar"/>
- </hbox>
- <hbox>
- <label flex="1" value="file"/>
- <textbox id="static_element_file" preference="tests.static_preference_file"/>
- </hbox>
- </prefpane>
-</prefwindow>
diff --git a/toolkit/content/tests/chrome/window_preferences2.xul b/toolkit/content/tests/chrome/window_preferences2.xul
deleted file mode 100644
index 87158c9c7..000000000
--- a/toolkit/content/tests/chrome/window_preferences2.xul
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<!--
- XUL Widget Test for preferences window
--->
-<prefwindow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="preferences window"
- windowtype="test:preferences2"
- buttons="accept,cancel"
- onload="RunTest(window.arguments)"
->
- <script type="application/javascript">
- <![CDATA[
- function RunTest(aArgs)
- {
- // open child
- document.documentElement.openSubDialog("window_preferences3.xul", "", {test: aArgs[0], accept: aArgs[1]});
- // close dialog
- document.documentElement[aArgs[1] ? "acceptDialog" : "cancelDialog"]();
- }
- ]]>
- </script>
-
- <prefpane id="sample_pane" label="Sample Prefpane"/>
-</prefwindow>
diff --git a/toolkit/content/tests/chrome/window_preferences3.xul b/toolkit/content/tests/chrome/window_preferences3.xul
deleted file mode 100644
index c37893a67..000000000
--- a/toolkit/content/tests/chrome/window_preferences3.xul
+++ /dev/null
@@ -1,74 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<!--
- XUL Widget Test for preferences window
--->
-<prefwindow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="preferences window"
- windowtype="test:preferences3"
- buttons="accept,cancel"
- onload="RunTest(window.arguments)"
- type="child"
->
- <script type="application/javascript">
- <![CDATA[
- function RunTest(aArgs)
- {
- // run test
- aArgs[0].test(this);
- // close dialog
- document.documentElement[aArgs[0].accept ? "acceptDialog" : "cancelDialog"]();
- }
- ]]>
- </script>
-
- <prefpane id="sample_pane" label="Sample Prefpane">
- <preferences id="sample_preferences">
- <!-- one of each type known to <preferences>.valueFromPreferences -->
- <preference id ="tests.static_preference_int"
- name="tests.static_preference_int"
- type="int"/>
- <preference id ="tests.static_preference_bool"
- name="tests.static_preference_bool"
- type="bool"/>
- <preference id ="tests.static_preference_string"
- name="tests.static_preference_string"
- type="string"/>
- <preference id ="tests.static_preference_wstring"
- name="tests.static_preference_wstring"
- type="wstring"/>
- <preference id ="tests.static_preference_unichar"
- name="tests.static_preference_unichar"
- type="unichar"/>
- <preference id ="tests.static_preference_file"
- name="tests.static_preference_file"
- type="file"/>
- </preferences>
-
- <!-- one element for each preference type above -->
- <hbox>
- <label flex="1" value="int"/>
- <textbox id="static_element_int" preference="tests.static_preference_int"/>
- </hbox>
- <hbox>
- <label flex="1" value="bool"/>
- <checkbox id="static_element_bool" preference="tests.static_preference_bool"/>
- </hbox>
- <hbox>
- <label flex="1" value="string"/>
- <textbox id="static_element_string" preference="tests.static_preference_string"/>
- </hbox>
- <hbox>
- <label flex="1" value="wstring"/>
- <textbox id="static_element_wstring" preference="tests.static_preference_wstring"/>
- </hbox>
- <hbox>
- <label flex="1" value="unichar"/>
- <textbox id="static_element_unichar" preference="tests.static_preference_unichar"/>
- </hbox>
- <hbox>
- <label flex="1" value="file"/>
- <textbox id="static_element_file" preference="tests.static_preference_file"/>
- </hbox>
- </prefpane>
-</prefwindow>
diff --git a/toolkit/content/tests/chrome/window_preferences_beforeaccept.xul b/toolkit/content/tests/chrome/window_preferences_beforeaccept.xul
deleted file mode 100644
index ba200b614..000000000
--- a/toolkit/content/tests/chrome/window_preferences_beforeaccept.xul
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<!--
- XUL Widget Test for preferences window with beforeaccept
--->
-<prefwindow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="preferences window"
- width="300" height="300"
- windowtype="test:preferences"
- buttons="accept,cancel"
- onbeforeaccept="return beforeAccept();"
- onload="onDialogLoad();"
->
- <script type="application/javascript">
- <![CDATA[
- function onDialogLoad() {
- var pref = document.getElementById("tests.beforeaccept.dialogShown");
- pref.value = true;
-
- // call the onload handler we were passed
- window.arguments[0]();
- }
-
- function beforeAccept() {
- var beforeAcceptPref = document.getElementById("tests.beforeaccept.called");
- var oldValue = beforeAcceptPref.value;
- beforeAcceptPref.value = true;
-
- return !!oldValue;
- }
- ]]>
- </script>
-
- <prefpane id="sample_pane" label="Sample Prefpane">
- <preferences id="sample_preferences">
- <preference id="tests.beforeaccept.called"
- name="tests.beforeaccept.called"
- type="bool"/>
- <preference id="tests.beforeaccept.dialogShown"
- name="tests.beforeaccept.dialogShown"
- type="bool"/>
- </preferences>
- </prefpane>
- <label>Test Prefpane</label>
-</prefwindow>
diff --git a/toolkit/content/tests/chrome/window_preferences_commandretarget.xul b/toolkit/content/tests/chrome/window_preferences_commandretarget.xul
deleted file mode 100644
index 77c6fd18c..000000000
--- a/toolkit/content/tests/chrome/window_preferences_commandretarget.xul
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<!--
- XUL Widget Test for preferences window. This particular test ensures that
- a checkbox with a command attribute properly updates even though the command
- event gets retargeted.
--->
-<prefwindow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="preferences window"
- windowtype="test:preferences"
- buttons="accept,cancel"
- onload="RunTest(window.arguments)">
- <script type="application/javascript">
- <![CDATA[
- function RunTest(aArgs)
- {
- aArgs[0](this);
- document.documentElement.cancelDialog();
- }
- ]]>
- </script>
-
- <prefpane id="sample_pane" label="Sample Prefpane">
- <preferences id="sample_preferences">
- <preference id="tests.static_preference_bool"
- name="tests.static_preference_bool"
- type="bool"/>
- </preferences>
-
- <commandset>
- <command id="cmd_test" preference="tests.static_preference_bool"/>
- </commandset>
-
- <checkbox id="checkbox" label="Enable Option" preference="tests.static_preference_bool" command="cmd_test"/>
- </prefpane>
-</prefwindow>
diff --git a/toolkit/content/tests/chrome/window_preferences_onsyncfrompreference.xul b/toolkit/content/tests/chrome/window_preferences_onsyncfrompreference.xul
deleted file mode 100644
index e0366f989..000000000
--- a/toolkit/content/tests/chrome/window_preferences_onsyncfrompreference.xul
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this file,
- - You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<!--
- XUL Widget Test for preferences window with onsyncfrompreference
- This test ensures that onsyncfrompreference handlers are called after all the
- values of the corresponding preference element have been set correctly
--->
-<prefwindow xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="preferences window"
- width="300" height="300"
- windowtype="test:preferences">
-
- <prefpane id="sample_pane" label="Sample Prefpane">
- <preferences id="sample_preferences">
- <preference id="tests.onsyncfrompreference.pref1"
- name="tests.onsyncfrompreference.pref1"
- type="int"/>
- <preference id="tests.onsyncfrompreference.pref2"
- name="tests.onsyncfrompreference.pref2"
- type="int"/>
- <preference id="tests.onsyncfrompreference.pref3"
- name="tests.onsyncfrompreference.pref3"
- type="int"/>
- </preferences>
- </prefpane>
- <label>Test Prefpane</label>
- <checkbox id="check1" label="Label1"
- preference="tests.onsyncfrompreference.pref1"
- onsyncfrompreference="return window.arguments[0]();"
- onsynctopreference="return 1;"/>
- <checkbox id="check2" label="Label2"
- preference="tests.onsyncfrompreference.pref2"
- onsyncfrompreference="return window.arguments[0]();"
- onsynctopreference="return 1;"/>
- <checkbox id="check3" label="Label3"
- preference="tests.onsyncfrompreference.pref3"
- onsyncfrompreference="return window.arguments[0]();"
- onsynctopreference="return 1;"/>
-</prefwindow>
diff --git a/toolkit/content/tests/chrome/window_screenPosSize.xul b/toolkit/content/tests/chrome/window_screenPosSize.xul
deleted file mode 100644
index accc10d8f..000000000
--- a/toolkit/content/tests/chrome/window_screenPosSize.xul
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Window Open Test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- screenX="80"
- screenY="80"
- height="300"
- width="300"
- persist="screenX screenY height width">
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/window_showcaret.xul b/toolkit/content/tests/chrome/window_showcaret.xul
deleted file mode 100644
index cb26658a1..000000000
--- a/toolkit/content/tests/chrome/window_showcaret.xul
+++ /dev/null
@@ -1,10 +0,0 @@
-<?xml version='1.0'?>
-
-<?xml-stylesheet href='chrome://global/skin' type='text/css'?>
-
-<window xmlns='http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul'>
-
-<hbox style='-moz-user-focus: normal;' width='20' height='20'/>
-<textbox/>
-
-</window>
diff --git a/toolkit/content/tests/chrome/window_subframe_origin.xul b/toolkit/content/tests/chrome/window_subframe_origin.xul
deleted file mode 100644
index a060929a6..000000000
--- a/toolkit/content/tests/chrome/window_subframe_origin.xul
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window id="window" title="Subframe Origin Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<iframe
- style="margin-left:20px; margin-top:20px; min-height:300px; max-width:300px; max-height:300px; border:solid 1px black;"
- src="frame_subframe_origin_subframe1.xul"></iframe>
-<caption id="parentcap" label=""/>
-
-<script>
-
-// Fire a mouse move event aimed at this window, and check to be
-// sure the client coords translate from widget to the dom correctly.
-
-function runTests()
-{
- synthesizeMouse(document.getElementById("window"), 1, 2, { type: "mousemove" });
-}
-
-window.opener.wrappedJSObject.SimpleTest.waitForFocus(runTests, window);
-
-function mouseMove(e) {
- var element = e.target;
- var el = document.getElementById("parentcap");
- el.label = "client: (" + e.clientX + "," + e.clientY + ")";
- window.opener.wrappedJSObject.SimpleTest.is(e.clientX, 1, "mouse event clientX");
- window.opener.wrappedJSObject.SimpleTest.is(e.clientY, 2, "mouse event clientY");
- // fire the next test on the sub frame
- frames[0].runTests();
-}
-
-window.addEventListener("mousemove",mouseMove, false);
-
-</script>
-</window>
diff --git a/toolkit/content/tests/chrome/window_titlebar.xul b/toolkit/content/tests/chrome/window_titlebar.xul
deleted file mode 100644
index e27782153..000000000
--- a/toolkit/content/tests/chrome/window_titlebar.xul
+++ /dev/null
@@ -1,223 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<!--
- XUL Widget Test for the titlebar element and window dragging
- -->
-<window title="Titlebar" width="200" height="200"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
- <titlebar id="titlebar">
- <label id="label" value="Titlebar"/>
- </titlebar>
-
- <!-- a non-noautohide panel is treated as anchored -->
- <panel id="panel" onpopupshown="popupshown(this, false)" onpopuphidden="popuphidden('panelnoautohide')">
- <titlebar>
- <label id="panellabel" value="Titlebar"/>
- </titlebar>
- </panel>
-
- <panel id="panelnoautohide" noautohide="true"
- onpopupshown="popupshown(this, false)" onpopuphidden="popuphidden('panelanchored')">
- <titlebar>
- <label id="panellabelnoautohide" value="Titlebar"/>
- </titlebar>
- </panel>
-
- <panel id="panelanchored" noautohide="true"
- onpopupshown="popupshown(this, true)" onpopuphidden="popuphidden('paneltop')">
- <titlebar>
- <label id="panellabelanchored" value="Titlebar"/>
- </titlebar>
- </panel>
-
- <panel id="paneltop" noautohide="true" level="top"
- onpopupshown="popupshown(this, false)" onpopuphidden="popuphidden('panelfloating')">
- <titlebar>
- <label id="panellabeltop" value="Titlebar"/>
- </titlebar>
- </panel>
-
- <panel id="panelfloating" noautohide="true" level="floating"
- onpopupshown="popupshown(this, false)" onpopuphidden="popuphidden('')">
- <titlebar>
- <label id="panellabelfloating" value="Titlebar"/>
- </titlebar>
- </panel>
-
- <button id="button" label="OK"/>
-
-<script>
-<![CDATA[
-
-var SimpleTest = window.opener.wrappedJSObject.SimpleTest;
-
-SimpleTest.waitForFocus(test_titlebar, window);
-
-var mouseDownTarget;
-var origoldx, origoldy, oldx, oldy, waitSteps = 0;
-function waitForWindowMove(element, x, y, callback, arg, panel, anchored)
-{
- var isPanelMove = (element.id != "label");
-
- if (!waitSteps) {
- oldx = isPanelMove ? panel.getBoundingClientRect().left : window.screenX;
- oldy = isPanelMove ? panel.getBoundingClientRect().top : window.screenY;
- synthesizeMouse(element, x, y, { type: "mousemove" });
- }
-
- var newx = isPanelMove ? panel.getBoundingClientRect().left : window.screenX;
- var newy = isPanelMove ? panel.getBoundingClientRect().top : window.screenY;
- if (newx == oldx && newy == oldy) {
- if (waitSteps++ > 10) {
- SimpleTest.is(window.screenX + "," + window.screenY, oldx + "," + oldy + " ",
- "Window never moved properly to " + x + "," + y + (panel ? " " + panel.id : ""));
- window.opener.wrappedJSObject.SimpleTest.finish();
- window.close();
- return;
- }
-
- setTimeout(waitForWindowMove, 100, element, x, y, callback, arg, panel, anchored);
- }
- else {
- waitSteps = 0;
-
- // on Linux, we need to wait a bit for the popup to be moved as well
- if (navigator.platform.indexOf("Linux") >= 0) {
- setTimeout(callback, 0, arg, panel, anchored);
- }
- else {
- callback(arg, panel, anchored);
- }
- }
-}
-
-function test_titlebar()
-{
- var titlebar = document.getElementById("titlebar");
- var label = document.getElementById("label");
-
- origoldx = window.screenX;
- origoldy = window.screenY;
-
- var mousedownListener = event => mouseDownTarget = event.originalTarget;
- window.addEventListener("mousedown", mousedownListener, false);
- synthesizeMouse(label, 2, 2, { type: "mousedown" });
- SimpleTest.is(mouseDownTarget, titlebar, "movedown on titlebar");
- waitForWindowMove(label, 22, 22, test_titlebar_step2, mousedownListener);
-}
-
-function test_titlebar_step2(mousedownListener)
-{
- var titlebar = document.getElementById("titlebar");
- var label = document.getElementById("label");
-
- SimpleTest.is(window.screenX, origoldx + 20, "move window horizontal");
- SimpleTest.is(window.screenY, origoldy + 20, "move window vertical");
- synthesizeMouse(label, 22, 22, { type: "mouseup" });
-
- // with allowEvents set to true, the mouse should target the label instead
- // and not move the window
- titlebar.allowEvents = true;
-
- synthesizeMouse(label, 2, 2, { type: "mousedown" });
- SimpleTest.is(mouseDownTarget, label, "movedown on titlebar with allowevents");
- synthesizeMouse(label, 22, 22, { type: "mousemove" });
- SimpleTest.is(window.screenX, origoldx + 20, "mouse on label move window horizontal");
- SimpleTest.is(window.screenY, origoldy + 20, "mouse on label move window vertical");
- synthesizeMouse(label, 22, 22, { type: "mouseup" });
-
- window.removeEventListener("mousedown", mousedownListener, false);
-
- document.getElementById("panel").openPopupAtScreen(window.screenX + 50, window.screenY + 60, false);
-}
-
-function popupshown(panel, anchored)
-{
- var rect = panel.getBoundingClientRect();
-
- // skip this check for non-noautohide panels
- if (panel.id == "panel") {
- var panellabel = panel.firstChild.firstChild;
- synthesizeMouse(panellabel, 2, 2, { type: "mousedown" });
- waitForWindowMove(panellabel, 22, 22, popupshown_step3, rect, panel, anchored);
- return;
- }
-
- // now, try moving the window. If anchored, the popup should move with the
- // window. If not anchored, the popup should remain at its current screen location.
- window.moveBy(10, 10);
- waitSteps = 1;
- waitForWindowMove(document.getElementById("label"), 1, 1, popupshown_step2, rect, panel, anchored);
-}
-
-function popupshown_step2(oldrect, panel, anchored)
-{
- var newrect = panel.getBoundingClientRect();
-
- // The window movement that occured long ago at the beginning of the test
- // on Linux is delayed and there isn't any way to tell when the move
- // actually happened. This causes the checks here to fail. Instead, just
- // wait a bit for the test to be ready.
- if (navigator.platform.indexOf("Linux") >= 0 &&
- newrect.left != oldrect.left - (anchored ? 0 : 10)) {
- setTimeout(popupshown_step2, 10, oldrect, panel, anchored);
- return;
- }
-
- // anchored popups should still be at the same offset. Non-anchored popups will
- // now be offset by 10 pixels less.
- SimpleTest.is(newrect.left, oldrect.left - (anchored ? 0 : 10),
- panel.id + " horizontal after window move");
- SimpleTest.is(newrect.top, oldrect.top - (anchored ? 0 : 10),
- panel.id + " vertical after window move");
-
- var panellabel = panel.firstChild.firstChild;
- synthesizeMouse(panellabel, 2, 2, { type: "mousedown" });
- waitForWindowMove(panellabel, 22, 22, popupshown_step3, newrect, panel, anchored);
-}
-
-function popupshown_step3(oldrect, panel, anchored)
-{
- // skip this check on Linux for the same window positioning reasons as above
- if (navigator.platform.indexOf("Linux") == -1 || (panel.id != "panelanchored" && panel.id != "paneltop")) {
- // next, drag the titlebar in the panel
- var newrect = panel.getBoundingClientRect();
- SimpleTest.is(newrect.left, oldrect.left + 20, panel.id + " move popup horizontal");
- SimpleTest.is(newrect.top, oldrect.top + 20, panel.id + " move popup vertical");
- synthesizeMouse(document.getElementById("panellabel"), 22, 22, { type: "mouseup" });
-
- synthesizeMouse(document.getElementById("button"), 5, 5, { type: "mousemove" });
- newrect = panel.getBoundingClientRect();
- SimpleTest.is(newrect.left, oldrect.left + 20, panel.id + " horizontal after mouse on button");
- SimpleTest.is(newrect.top, oldrect.top + 20, panel.id + " vertical after mouse on button");
- }
- else {
- synthesizeMouse(document.getElementById("panellabel"), 22, 22, { type: "mouseup" });
- }
-
- panel.hidePopup();
-}
-
-function popuphidden(nextPopup)
-{
- if (nextPopup) {
- var panel = document.getElementById(nextPopup);
- if (panel.id == "panelnoautohide") {
- panel.openPopupAtScreen(window.screenX + 50, window.screenY + 60, false);
- }
- else {
- panel.openPopup(document.getElementById("button"), "after_start");
- }
- }
- else
- window.opener.wrappedJSObject.done(window);
-}
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/content/tests/chrome/window_tooltip.xul b/toolkit/content/tests/chrome/window_tooltip.xul
deleted file mode 100644
index 087c91c3e..000000000
--- a/toolkit/content/tests/chrome/window_tooltip.xul
+++ /dev/null
@@ -1,311 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Tooltip Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="application/javascript" src="popup_shared.js"></script>
-
-<tooltip id="thetooltip">
- <label id="label" value="This is a tooltip"/>
-</tooltip>
-
-<box id="parent" tooltiptext="Box Tooltip" style="margin: 10px">
- <button id="withtext" label="Tooltip Text" tooltiptext="Button Tooltip"
- style="-moz-appearance: none; padding: 0;"/>
- <button id="without" label="No Tooltip" style="-moz-appearance: none; padding: 0;"/>
- <!-- remove the native theme and borders to avoid some platform
- specific sizing differences -->
- <button id="withtooltip" label="Tooltip Element" tooltip="thetooltip"
- class="plain" style="-moz-appearance: none; padding: 0;"/>
- <iframe id="childframe" type="content" width="10" height="10"
- src="http://sectest2.example.org:80/chrome/toolkit/content/tests/chrome/popup_childframe_node.xul"/>
-</box>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-var gOriginalWidth = -1;
-var gOriginalHeight = -1;
-var gButton = null;
-
-function runTest()
-{
- startPopupTests(popupTests);
-}
-
-function checkCoords(event)
-{
- // all but one test open the tooltip at the button location offset by 6
- // in each direction. Test 5 opens it at 4 in each direction.
- var mod = (gTestIndex == 5) ? 4 : 6;
-
- var rect = gButton.getBoundingClientRect();
- var popupstyle = window.getComputedStyle(gButton, "");
- is(event.clientX, Math.round(rect.left + mod),
- "step " + (gTestIndex + 1) + " clientX");
- is(event.clientY, Math.round(rect.top + mod),
- "step " + (gTestIndex + 1) + " clientY");
- ok(event.screenX > 0, "step " + (gTestIndex + 1) + " screenX");
- ok(event.screenY > 0, "step " + (gTestIndex + 1) + " screenY");
-}
-
-var popupTests = [
-{
- testname: "hover tooltiptext attribute",
- events: [ "popupshowing #tooltip", "popupshown #tooltip" ],
- test: function() {
- gButton = document.getElementById("withtext");
- disableNonTestMouse(true);
- synthesizeMouse(gButton, 2, 2, { type: "mouseover" });
- synthesizeMouse(gButton, 4, 4, { type: "mousemove" });
- synthesizeMouse(gButton, 6, 6, { type: "mousemove" });
- disableNonTestMouse(false);
- }
-},
-{
- testname: "close tooltip",
- events: [ "popuphiding #tooltip", "popuphidden #tooltip",
- "DOMMenuInactive #tooltip" ],
- test: function() {
- disableNonTestMouse(true);
- synthesizeMouse(document.documentElement, 2, 2, { type: "mousemove" });
- disableNonTestMouse(false);
- }
-},
-{
- testname: "hover inherited tooltip",
- events: [ "popupshowing #tooltip", "popupshown #tooltip" ],
- test: function() {
- gButton = document.getElementById("without");
- disableNonTestMouse(true);
- synthesizeMouse(gButton, 2, 2, { type: "mouseover" });
- synthesizeMouse(gButton, 4, 4, { type: "mousemove" });
- synthesizeMouse(gButton, 6, 6, { type: "mousemove" });
- disableNonTestMouse(false);
- }
-},
-{
- testname: "hover tooltip attribute",
- events: [ "popuphiding #tooltip", "popuphidden #tooltip",
- "DOMMenuInactive #tooltip",
- "popupshowing thetooltip", "popupshown thetooltip" ],
- test: function() {
- gButton = document.getElementById("withtooltip");
- gExpectedTriggerNode = gButton;
- disableNonTestMouse(true);
- synthesizeMouse(gButton, 2, 2, { type: "mouseover" });
- synthesizeMouse(gButton, 4, 4, { type: "mousemove" });
- synthesizeMouse(gButton, 6, 6, { type: "mousemove" });
- disableNonTestMouse(false);
- },
- result: function(testname) {
- var tooltip = document.getElementById("thetooltip");
- gExpectedTriggerNode = null;
- is(tooltip.triggerNode, gButton, testname + " triggerNode");
- is(document.popupNode, null, testname + " document.popupNode");
- is(document.tooltipNode, gButton, testname + " document.tooltipNode");
-
- var child = $("childframe").contentDocument;
- var evt = child.createEvent("Event");
- evt.initEvent("click", true, true);
- child.documentElement.dispatchEvent(evt);
- is(child.documentElement.getAttribute("data"), "xnull",
- "cannot get tooltipNode from other document");
-
- var buttonrect = document.getElementById("withtooltip").getBoundingClientRect();
- var rect = tooltip.getBoundingClientRect();
- var popupstyle = window.getComputedStyle(document.getElementById("thetooltip"), "");
-
- is(Math.round(rect.left),
- Math.round(buttonrect.left + parseFloat(popupstyle.marginLeft) + 6),
- testname + " left position of tooltip");
- is(Math.round(rect.top),
- Math.round(buttonrect.top + parseFloat(popupstyle.marginTop) + 6),
- testname + " top position of tooltip");
-
- var labelrect = document.getElementById("label").getBoundingClientRect();
- ok(labelrect.right < rect.right, testname + " tooltip width");
- ok(labelrect.bottom < rect.bottom, testname + " tooltip height");
-
- gOriginalWidth = rect.right - rect.left;
- gOriginalHeight = rect.bottom - rect.top;
- }
-},
-{
- testname: "click to close tooltip",
- events: [ "popuphiding thetooltip", "popuphidden thetooltip",
- "command withtooltip", "DOMMenuInactive thetooltip" ],
- test: function() {
- gButton = document.getElementById("withtooltip");
- synthesizeMouse(gButton, 2, 2, { });
- },
- result: function(testname) {
- var tooltip = document.getElementById("thetooltip");
- is(tooltip.triggerNode, null, testname + " triggerNode");
- is(document.popupNode, null, testname + " document.popupNode");
- is(document.tooltipNode, null, testname + " document.tooltipNode");
- }
-},
-{
- testname: "hover tooltip after size increased",
- events: [ "popupshowing thetooltip", "popupshown thetooltip" ],
- test: function() {
- var label = document.getElementById("label");
- label.removeAttribute("value");
- label.textContent = "This is a longer tooltip than before\nIt has multiple lines\nIt is testing tooltip sizing\n";
- gButton = document.getElementById("withtooltip");
- disableNonTestMouse(true);
- synthesizeMouse(gButton, 2, 2, { type: "mouseover" });
- synthesizeMouse(gButton, 6, 6, { type: "mousemove" });
- synthesizeMouse(gButton, 4, 4, { type: "mousemove" });
- disableNonTestMouse(false);
- },
- result: function(testname) {
- var buttonrect = document.getElementById("withtooltip").getBoundingClientRect();
- var rect = document.getElementById("thetooltip").getBoundingClientRect();
- var popupstyle = window.getComputedStyle(document.getElementById("thetooltip"), "");
- var buttonstyle = window.getComputedStyle(document.getElementById("withtooltip"), "");
-
- is(Math.round(rect.left),
- Math.round(buttonrect.left + parseFloat(popupstyle.marginLeft) + 4),
- testname + " left position of tooltip");
- is(Math.round(rect.top),
- Math.round(buttonrect.top + parseFloat(popupstyle.marginTop) + 4),
- testname + " top position of tooltip");
-
- var labelrect = document.getElementById("label").getBoundingClientRect();
- ok(labelrect.right < rect.right, testname + " tooltip width");
- ok(labelrect.bottom < rect.bottom, testname + " tooltip height");
-
- // make sure that the tooltip is larger than it was before by just
- // checking against the original height plus an arbitrary 15 pixels
- ok(gOriginalWidth + 15 < rect.right - rect.left, testname + " tooltip is wider");
- ok(gOriginalHeight + 15 < rect.bottom - rect.top, testname + " tooltip is taller");
- }
-},
-{
- testname: "close tooltip with hidePopup",
- events: [ "popuphiding thetooltip", "popuphidden thetooltip",
- "DOMMenuInactive thetooltip" ],
- test: function() {
- document.getElementById("thetooltip").hidePopup();
- },
-},
-{
- testname: "hover tooltip after size decreased",
- events: [ "popupshowing thetooltip", "popupshown thetooltip" ],
- autohide: "thetooltip",
- test: function() {
- var label = document.getElementById("label");
- label.value = "This is a tooltip";
- gButton = document.getElementById("withtooltip");
- disableNonTestMouse(true);
- synthesizeMouse(gButton, 2, 2, { type: "mouseover" });
- synthesizeMouse(gButton, 4, 4, { type: "mousemove" });
- synthesizeMouse(gButton, 6, 6, { type: "mousemove" });
- disableNonTestMouse(false);
- },
- result: function(testname) {
- var buttonrect = document.getElementById("withtooltip").getBoundingClientRect();
- var rect = document.getElementById("thetooltip").getBoundingClientRect();
- var popupstyle = window.getComputedStyle(document.getElementById("thetooltip"), "");
- var buttonstyle = window.getComputedStyle(document.getElementById("withtooltip"), "");
-
- is(Math.round(rect.left),
- Math.round(buttonrect.left + parseFloat(popupstyle.marginLeft) + 6),
- testname + " left position of tooltip");
- is(Math.round(rect.top),
- Math.round(buttonrect.top + parseFloat(popupstyle.marginTop) + 6),
- testname + " top position of tooltip");
-
- var labelrect = document.getElementById("label").getBoundingClientRect();
- ok(labelrect.right < rect.right, testname + " tooltip width");
- ok(labelrect.bottom < rect.bottom, testname + " tooltip height");
-
- is(gOriginalWidth, rect.right - rect.left, testname + " tooltip is original width");
- is(gOriginalHeight, rect.bottom - rect.top, testname + " tooltip is original height");
- }
-},
-{
- testname: "hover tooltip at bottom edge of screen",
- events: [ "popupshowing thetooltip", "popupshown thetooltip" ],
- autohide: "thetooltip",
- condition: function() {
- // Only checking OSX here because on other platforms popups and tooltips behave the same way
- // when there's not enough space to show them below (by flipping vertically)
- // However, on OSX most popups are not flipped but tooltips are.
- return navigator.platform.indexOf("Mac") > -1;
- },
- test: function() {
- var buttonRect = document.getElementById("withtext").getBoundingClientRect();
- var windowY = screen.height -
- (window.mozInnerScreenY - window.screenY ) - buttonRect.bottom;
-
- moveWindowTo(window.screenX, windowY, function() {
- gButton = document.getElementById("withtooltip");
- disableNonTestMouse(true);
- synthesizeMouse(gButton, 2, 2, { type: "mouseover" });
- synthesizeMouse(gButton, 6, 6, { type: "mousemove" });
- synthesizeMouse(gButton, 4, 4, { type: "mousemove" });
- disableNonTestMouse(false);
- });
- },
- result: function(testname) {
- var buttonrect = document.getElementById("withtooltip").getBoundingClientRect();
- var rect = document.getElementById("thetooltip").getBoundingClientRect();
- var popupstyle = window.getComputedStyle(document.getElementById("thetooltip"), "");
-
- is(Math.round(rect.y + rect.height),
- Math.round(buttonrect.top + 4 - parseFloat(popupstyle.marginTop)),
- testname + " position of tooltip above button");
- }
-}
-
-];
-
-var waitSteps = 0;
-function moveWindowTo(x, y, callback, arg)
-{
- if (!waitSteps) {
- oldx = window.screenX;
- oldy = window.screenY;
- window.moveTo(x, y);
-
- waitSteps++;
- setTimeout(moveWindowTo, 100, x, y, callback, arg);
- return;
- }
-
- if (window.screenX == oldx && window.screenY == oldy) {
- if (waitSteps++ > 10) {
- ok(false, "Window never moved properly to " + x + "," + y);
- window.opener.wrappedJSObject.SimpleTest.finish();
- window.close();
- }
-
- setTimeout(moveWindowTo, 100, x, y, callback, arg);
- }
- else {
- waitSteps = 0;
- callback(arg);
- }
-}
-
-window.opener.wrappedJSObject.SimpleTest.waitForFocus(runTest, window);
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/chrome/xul_selectcontrol.js b/toolkit/content/tests/chrome/xul_selectcontrol.js
deleted file mode 100644
index d6518c150..000000000
--- a/toolkit/content/tests/chrome/xul_selectcontrol.js
+++ /dev/null
@@ -1,390 +0,0 @@
-// This script is used to test elements that implement
-// nsIDOMXULSelectControlElement. This currently is the following elements:
-// listbox, menulist, radiogroup, richlistbox, tabs
-//
-// flag behaviours that differ for certain elements
-// allow-other-value - alternate values for the value property may be used
-// besides those in the list
-// other-value-clears-selection - alternative values for the value property
-// clears the selected item
-// selection-required - an item must be selected in the list, unless there
-// aren't any to select
-// activate-disabled-menuitem - disabled menuitems can be highlighted
-// select-keynav-wraps - key navigation over a selectable list wraps
-// select-extended-keynav - home, end, page up and page down keys work to
-// navigate over a selectable list
-// keynav-leftright - key navigation is left/right rather than up/down
-// The win:, mac: and gtk: or other prefixes may be used for platform specific behaviour
-var behaviours = {
- menu: "win:activate-disabled-menuitem activate-disabled-menuitem-mousemove select-keynav-wraps select-extended-keynav",
- menulist: "allow-other-value other-value-clears-selection",
- listbox: "select-extended-keynav",
- richlistbox: "select-extended-keynav",
- radiogroup: "select-keynav-wraps dont-select-disabled allow-other-value",
- tabs: "select-extended-keynav mac:select-keynav-wraps allow-other-value selection-required keynav-leftright"
-};
-
-function behaviourContains(tag, behaviour)
-{
- var platform = "none:";
- if (navigator.platform.indexOf("Mac") >= 0)
- platform = "mac:";
- else if (navigator.platform.indexOf("Win") >= 0)
- platform = "win:";
- else if (navigator.platform.indexOf("X") >= 0)
- platform = "gtk:";
-
- var re = new RegExp("\\s" + platform + behaviour + "\\s|\\s" + behaviour + "\\s");
- return re.test(" " + behaviours[tag] + " ");
-}
-
-function test_nsIDOMXULSelectControlElement(element, childtag, testprefix)
-{
- var testid = (testprefix) ? testprefix + " " : "";
- testid += element.localName + " nsIDOMXULSelectControlElement ";
-
- // editable menulists use the label as the value instead
- var firstvalue = "first", secondvalue = "second", fourthvalue = "fourth";
- if (element.localName == "menulist" && element.editable) {
- firstvalue = "First Item";
- secondvalue = "Second Item"
- fourthvalue = "Fourth Item";
- }
-
- // 'initial' - check if the initial state of the element is correct
- test_nsIDOMXULSelectControlElement_States(element, testid + "initial", 0, null, -1, "");
-
- test_nsIDOMXULSelectControlElement_init(element, testid);
-
- // 'appendItem' - check if appendItem works to add a new item
- var firstitem = element.appendItem("First Item", "first");
- is(firstitem.localName, childtag,
- testid + "appendItem - first item is " + childtag);
- test_nsIDOMXULSelectControlElement_States(element, testid + "appendItem", 1, null, -1, "");
-
- is(firstitem.control, element, testid + "control");
-
- // 'selectedIndex' - check if an item may be selected
- element.selectedIndex = 0;
- test_nsIDOMXULSelectControlElement_States(element, testid + "selectedIndex", 1, firstitem, 0, firstvalue);
-
- // 'appendItem 2' - check if a second item may be added
- var seconditem = element.appendItem("Second Item", "second");
- test_nsIDOMXULSelectControlElement_States(element, testid + "appendItem 2", 2, firstitem, 0, firstvalue);
-
- // 'selectedItem' - check if the second item may be selected
- element.selectedItem = seconditem;
- test_nsIDOMXULSelectControlElement_States(element, testid + "selectedItem", 2, seconditem, 1, secondvalue);
-
- // 'selectedIndex 2' - check if selectedIndex may be set to -1 to deselect items
- var selectionRequired = behaviourContains(element.localName, "selection-required");
- element.selectedIndex = -1;
- test_nsIDOMXULSelectControlElement_States(element, testid + "selectedIndex 2", 2,
- selectionRequired ? seconditem : null, selectionRequired ? 1 : -1,
- selectionRequired ? secondvalue : "");
-
- // 'selectedItem 2' - check if the selectedItem property may be set to null
- element.selectedIndex = 1;
- element.selectedItem = null;
- test_nsIDOMXULSelectControlElement_States(element, testid + "selectedItem 2", 2,
- selectionRequired ? seconditem : null, selectionRequired ? 1 : -1,
- selectionRequired ? secondvalue : "");
-
- // 'getIndexOfItem' - check if getIndexOfItem returns the right index
- is(element.getIndexOfItem(firstitem), 0, testid + "getIndexOfItem - first item at index 0");
- is(element.getIndexOfItem(seconditem), 1, testid + "getIndexOfItem - second item at index 1");
-
- var otheritem = element.ownerDocument.createElement(childtag);
- is(element.getIndexOfItem(otheritem), -1, testid + "getIndexOfItem - other item not found");
-
- // 'getItemAtIndex' - check if getItemAtIndex returns the right item
- is(element.getItemAtIndex(0), firstitem, testid + "getItemAtIndex - index 0 is first item");
- is(element.getItemAtIndex(1), seconditem, testid + "getItemAtIndex - index 0 is second item");
- is(element.getItemAtIndex(-1), null, testid + "getItemAtIndex - index -1 is null");
- is(element.getItemAtIndex(2), null, testid + "getItemAtIndex - index 2 is null");
-
- // check if setting the value changes the selection
- element.value = firstvalue;
- test_nsIDOMXULSelectControlElement_States(element, testid + "set value 1", 2, firstitem, 0, firstvalue);
- element.value = secondvalue;
- test_nsIDOMXULSelectControlElement_States(element, testid + "set value 2", 2, seconditem, 1, secondvalue);
- // setting the value attribute to one not in the list doesn't change the selection.
- // The value is only changed for elements which support having a value other than the
- // selection.
- element.value = "other";
- var allowOtherValue = behaviourContains(element.localName, "allow-other-value");
- var otherValueClearsSelection = behaviourContains(element.localName, "other-value-clears-selection");
- test_nsIDOMXULSelectControlElement_States(element, testid + "set value other", 2,
- otherValueClearsSelection ? null : seconditem,
- otherValueClearsSelection ? -1 : 1,
- allowOtherValue ? "other" : secondvalue);
- if (allowOtherValue)
- element.value = "";
-
- // 'removeItemAt' - check if removeItemAt removes the right item
- if (selectionRequired)
- element.value = secondvalue;
- else
- element.selectedIndex = -1;
-
- var removeditem = element.removeItemAt(0);
- is(removeditem, firstitem, testid + "removeItemAt return value");
- test_nsIDOMXULSelectControlElement_States(element, testid + "removeItemAt", 1,
- selectionRequired ? seconditem : null, selectionRequired ? 0 : -1,
- selectionRequired ? secondvalue : "");
-
- is(removeditem.control, undefined, testid + "control not set");
-
- var thirditem = element.appendItem("Third Item", "third");
- var fourthitem = element.appendItem("Fourth Item", fourthvalue);
- var fifthitem = element.appendItem("Fifth Item", "fifth");
-
- // 'removeItemAt 2' - check if removeItemAt removes the selected item and
- // adjusts the selection to the next item
- element.selectedItem = thirditem;
- is(element.removeItemAt(1), thirditem, testid + "removeItemAt 2 return value");
-
- // radio buttons don't handle removing quite right due to XBL issues,
- // so disable testing some of these remove tests for now - bug 367400
- var isnotradio = (element.localName != "radiogroup");
- // XXXndeakin disable these tests for all widgets for now. They require bug 331513.
- isnotradio = false;
- if (isnotradio)
- test_nsIDOMXULSelectControlElement_States(element, testid + "removeItemAt 2", 3, fourthitem, 1, fourthvalue);
-
- // 'removeItemAt 3' - check if removeItemAt adjusts the selection
- // if an earlier item is removed
- element.selectedItem = fourthitem;
- element.removeItemAt(0);
- test_nsIDOMXULSelectControlElement_States(element, testid + "removeItemAt 3", 2, fourthitem, 0, fourthvalue);
-
- // 'removeItemAt 4' - check if removeItemAt adjusts the selection if the
- // last item is selected and removed
- element.selectedItem = fifthitem;
- element.removeItemAt(1);
- if (isnotradio)
- test_nsIDOMXULSelectControlElement_States(element, testid + "removeItemAt 4", 1, fourthitem, 0, fourthvalue);
-
- // 'removeItemAt 5' - check that removeItemAt doesn't fail when removing invalid items
- is(element.removeItemAt(-1), null, testid + "removeItemAt 5 return value");
- if (isnotradio)
- test_nsIDOMXULSelectControlElement_States(element, testid + "removeItemAt 5", 1, fourthitem, 0, fourthvalue);
-
- // 'removeItemAt 6' - check that removeItemAt doesn't fail when removing invalid items
- is(element.removeItemAt(1), null, testid + "removeItemAt 6 return value");
- is("item removed", "item removed", testid + "removeItemAt 6");
- if (isnotradio)
- test_nsIDOMXULSelectControlElement_States(element, testid + "removeItemAt 6", 1, fourthitem, 0, fourthvalue);
-
- // 'insertItemAt' - check if insertItemAt inserts items at the right locations
- element.selectedIndex = 0;
- test_nsIDOMXULSelectControlElement_insertItemAt(element, 0, 0, testid, 5);
- test_nsIDOMXULSelectControlElement_insertItemAt(element, 2, 2, testid, 6);
- test_nsIDOMXULSelectControlElement_insertItemAt(element, -1, 3, testid, 7);
- test_nsIDOMXULSelectControlElement_insertItemAt(element, 6, 4, testid, 8);
-
- element.selectedIndex = 0;
- fourthitem.disabled = true;
- element.selectedIndex = 1;
- test_nsIDOMXULSelectControlElement_States(element, testid + "selectedIndex disabled", 5, fourthitem, 1, fourthvalue);
-
- element.selectedIndex = 0;
- element.selectedItem = fourthitem;
- test_nsIDOMXULSelectControlElement_States(element, testid + "selectedIndex disabled", 5, fourthitem, 1, fourthvalue);
-
- // 'removeall' - check if all items are removed
- while (element.itemCount)
- element.removeItemAt(0);
- if (isnotradio)
- test_nsIDOMXULSelectControlElement_States(element, testid + "remove all", 0, null, -1,
- allowOtherValue ? "number8" : "");
-}
-
-function test_nsIDOMXULSelectControlElement_init(element, testprefix)
-{
- // editable menulists use the label as the value
- var isEditable = (element.localName == "menulist" && element.editable);
-
- var id = element.id;
- element = document.getElementById(id + "-initwithvalue");
- if (element) {
- var seconditem = element.getItemAtIndex(1);
- test_nsIDOMXULSelectControlElement_States(element, testprefix + " value initialization",
- 3, seconditem, 1,
- isEditable ? seconditem.label : seconditem.value);
- }
-
- element = document.getElementById(id + "-initwithselected");
- if (element) {
- var thirditem = element.getItemAtIndex(2);
- test_nsIDOMXULSelectControlElement_States(element, testprefix + " selected initialization",
- 3, thirditem, 2,
- isEditable ? thirditem.label : thirditem.value);
- }
-}
-
-function test_nsIDOMXULSelectControlElement_States(element, testid,
- expectedcount, expecteditem,
- expectedindex, expectedvalue)
-{
- // need an itemCount property here
- var count = element.itemCount;
- is(count, expectedcount, testid + " item count");
- is(element.selectedItem, expecteditem, testid + " selectedItem");
- is(element.selectedIndex, expectedindex, testid + " selectedIndex");
- is(element.value, expectedvalue, testid + " value");
- if (element.selectedItem) {
- is(element.selectedItem.selected, true,
- testid + " selectedItem marked as selected");
- }
-}
-
-function test_nsIDOMXULSelectControlElement_insertItemAt(element, index, expectedindex, testid, number)
-{
- var expectedCount = element.itemCount;
- var expectedSelItem = element.selectedItem;
- var expectedSelIndex = element.selectedIndex;
- var expectedSelValue = element.value;
-
- var newitem = element.insertItemAt(index, "Item " + number, "number" + number);
- is(element.getIndexOfItem(newitem), expectedindex,
- testid + "insertItemAt " + expectedindex + " - get inserted item");
- expectedCount++;
- if (expectedSelIndex >= expectedindex)
- expectedSelIndex++;
-
- test_nsIDOMXULSelectControlElement_States(element, testid + "insertItemAt " + index,
- expectedCount, expectedSelItem,
- expectedSelIndex, expectedSelValue);
- return newitem;
-}
-
-/** test_nsIDOMXULSelectControlElement_UI
- *
- * Test the UI aspects of an element which implements nsIDOMXULSelectControlElement
- *
- * Parameters:
- * element - element to test
- */
-function test_nsIDOMXULSelectControlElement_UI(element, testprefix)
-{
- var testid = (testprefix) ? testprefix + " " : "";
- testid += element.localName + " nsIDOMXULSelectControlElement UI ";
-
- while (element.itemCount)
- element.removeItemAt(0);
-
- var firstitem = element.appendItem("First Item", "first");
- var seconditem = element.appendItem("Second Item", "second");
-
- // 'mouse select' - check if clicking an item selects it
- synthesizeMouseExpectEvent(firstitem, 2, 2, {}, element, "select", testid + "mouse select");
- test_nsIDOMXULSelectControlElement_States(element, testid + "mouse select", 2, firstitem, 0, "first");
-
- synthesizeMouseExpectEvent(seconditem, 2, 2, {}, element, "select", testid + "mouse select 2");
- test_nsIDOMXULSelectControlElement_States(element, testid + "mouse select 2", 2, seconditem, 1, "second");
-
- // make sure the element is focused so keyboard navigation will apply
- element.selectedIndex = 1;
- element.focus();
-
- var navLeftRight = behaviourContains(element.localName, "keynav-leftright");
- var backKey = navLeftRight ? "VK_LEFT" : "VK_UP";
- var forwardKey = navLeftRight ? "VK_RIGHT" : "VK_DOWN";
-
- // 'key select' - check if keypresses move between items
- synthesizeKeyExpectEvent(backKey, {}, element, "select", testid + "key up");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key up", 2, firstitem, 0, "first");
-
- var keyWrap = behaviourContains(element.localName, "select-keynav-wraps");
-
- var expectedItem = keyWrap ? seconditem : firstitem;
- var expectedIndex = keyWrap ? 1 : 0;
- var expectedValue = keyWrap ? "second" : "first";
- synthesizeKeyExpectEvent(backKey, {}, keyWrap ? element : null, "select", testid + "key up 2");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key up 2", 2,
- expectedItem, expectedIndex, expectedValue);
-
- element.selectedIndex = 0;
- synthesizeKeyExpectEvent(forwardKey, {}, element, "select", testid + "key down");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key down", 2, seconditem, 1, "second");
-
- expectedItem = keyWrap ? firstitem : seconditem;
- expectedIndex = keyWrap ? 0 : 1;
- expectedValue = keyWrap ? "first" : "second";
- synthesizeKeyExpectEvent(forwardKey, {}, keyWrap ? element : null, "select", testid + "key down 2");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key down 2", 2,
- expectedItem, expectedIndex, expectedValue);
-
- var thirditem = element.appendItem("Third Item", "third");
- var fourthitem = element.appendItem("Fourth Item", "fourth");
- if (behaviourContains(element.localName, "select-extended-keynav")) {
- var fifthitem = element.appendItem("Fifth Item", "fifth");
- var sixthitem = element.appendItem("Sixth Item", "sixth");
-
- synthesizeKeyExpectEvent("VK_END", {}, element, "select", testid + "key end");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key end", 6, sixthitem, 5, "sixth");
-
- synthesizeKeyExpectEvent("VK_HOME", {}, element, "select", testid + "key home");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key home", 6, firstitem, 0, "first");
-
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", {}, element, "select", testid + "key page down");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key page down", 6, fourthitem, 3, "fourth");
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", {}, element, "select", testid + "key page down to end");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key page down to end", 6, sixthitem, 5, "sixth");
-
- synthesizeKeyExpectEvent("VK_PAGE_UP", {}, element, "select", testid + "key page up");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key page up", 6, thirditem, 2, "third");
- synthesizeKeyExpectEvent("VK_PAGE_UP", {}, element, "select", testid + "key page up to start");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key page up to start", 6, firstitem, 0, "first");
-
- element.removeItemAt(5);
- element.removeItemAt(4);
- }
-
- // now test whether a disabled item works.
- element.selectedIndex = 0;
- seconditem.disabled = true;
-
- var dontSelectDisabled = (behaviourContains(element.localName, "dont-select-disabled"));
-
- // 'mouse select' - check if clicking an item selects it
- synthesizeMouseExpectEvent(seconditem, 2, 2, {}, element,
- dontSelectDisabled ? "!select" : "select",
- testid + "mouse select disabled");
- test_nsIDOMXULSelectControlElement_States(element, testid + "mouse select disabled", 4,
- dontSelectDisabled ? firstitem: seconditem, dontSelectDisabled ? 0 : 1,
- dontSelectDisabled ? "first" : "second");
-
- if (dontSelectDisabled) {
- // test whether disabling an item won't allow it to be selected
- synthesizeKeyExpectEvent(forwardKey, {}, element, "select", testid + "key down disabled");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key down disabled", 4, thirditem, 2, "third");
-
- synthesizeKeyExpectEvent(backKey, {}, element, "select", testid + "key up disabled");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key up disabled", 4, firstitem, 0, "first");
-
- element.selectedIndex = 2;
- firstitem.disabled = true;
-
- synthesizeKeyExpectEvent(backKey, {}, keyWrap ? element : null, "select", testid + "key up disabled 2");
- expectedItem = keyWrap ? fourthitem : thirditem;
- expectedIndex = keyWrap ? 3 : 2;
- expectedValue = keyWrap ? "fourth" : "third";
- test_nsIDOMXULSelectControlElement_States(element, testid + "key up disabled 2", 4,
- expectedItem, expectedIndex, expectedValue);
- }
- else {
- // in this case, disabled items should behave the same as non-disabled items.
- element.selectedIndex = 0;
- synthesizeKeyExpectEvent(forwardKey, {}, element, "select", testid + "key down disabled");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key down disabled", 4, seconditem, 1, "second");
- synthesizeKeyExpectEvent(forwardKey, {}, element, "select", testid + "key down disabled again");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key down disabled again", 4, thirditem, 2, "third");
-
- synthesizeKeyExpectEvent(backKey, {}, element, "select", testid + "key up disabled");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key up disabled", 4, seconditem, 1, "second");
- synthesizeKeyExpectEvent(backKey, {}, element, "select", testid + "key up disabled again");
- test_nsIDOMXULSelectControlElement_States(element, testid + "key up disabled again", 4, firstitem, 0, "first");
- }
-}
diff --git a/toolkit/content/tests/fennec-tile-testapp/application.ini b/toolkit/content/tests/fennec-tile-testapp/application.ini
deleted file mode 100644
index 510d48180..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/application.ini
+++ /dev/null
@@ -1,11 +0,0 @@
-[App]
-Vendor=venderr
-Name=tile
-Version=1.0
-BuildID=20060101
-Copyright=Copyright (c) 2006 Mark Finkle
-ID=xulapp@starkravingfinkle.org
-
-[Gecko]
-MinVersion=1.8
-MaxVersion=2.0
diff --git a/toolkit/content/tests/fennec-tile-testapp/chrome/chrome.manifest b/toolkit/content/tests/fennec-tile-testapp/chrome/chrome.manifest
deleted file mode 100644
index 118354c81..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/chrome.manifest
+++ /dev/null
@@ -1 +0,0 @@
-content tile file:content/
diff --git a/toolkit/content/tests/fennec-tile-testapp/chrome/content/BrowserView.js b/toolkit/content/tests/fennec-tile-testapp/chrome/content/BrowserView.js
deleted file mode 100644
index c498810df..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/BrowserView.js
+++ /dev/null
@@ -1,694 +0,0 @@
-// -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-
-// --- REMOVE ---
-var noop = function() {};
-var endl = '\n';
-// --------------
-
-function BrowserView(container, visibleRect) {
- bindAll(this);
- this.init(container, visibleRect);
-}
-
-/**
- * A BrowserView maintains state of the viewport (browser, zoom level,
- * dimensions) and the visible rectangle into the viewport, for every
- * browser it is given (cf setBrowser()). In updates to the viewport state,
- * a BrowserView (using its TileManager) renders parts of the page quasi-
- * intelligently, with guarantees of having rendered and appended all of the
- * visible browser content (aka the "critical rectangle").
- *
- * State is characterized in large part by two rectangles (and an implicit third):
- * - Viewport: Always rooted at the origin, ie with (left, top) at (0, 0). The
- * width and height (right and bottom) of this rectangle are that of the
- * current viewport, which corresponds more or less to the transformed
- * browser content (scaled by zoom level).
- * - Visible: Corresponds to the client's viewing rectangle in viewport
- * coordinates. Has (top, left) corresponding to position, and width & height
- * corresponding to the clients viewing dimensions. Take note that the top
- * and left of the visible rect are per-browser state, but that the width
- * and height persist across setBrowser() calls. This is best explained by
- * a simple example: user views browser A, pans to position (x0, y0), switches
- * to browser B, where she finds herself at position (x1, y1), tilts her
- * device so that visible rectangle's width and height change, and switches
- * back to browser A. She expects to come back to position (x0, y0), but her
- * device remains tilted.
- * - Critical (the implicit one): The critical rectangle is the (possibly null)
- * intersection of the visible and viewport rectangles. That is, it is that
- * region of the viewport which is visible to the user. We care about this
- * because it tells us which region must be rendered as soon as it is dirtied.
- * The critical rectangle is mostly state that we do not keep in BrowserView
- * but that our TileManager maintains.
- *
- * Example rectangle state configurations:
- *
- *
- * +-------------------------------+
- * |A |
- * | |
- * | |
- * | |
- * | +----------------+ |
- * | |B,C | |
- * | | | |
- * | | | |
- * | | | |
- * | +----------------+ |
- * | |
- * | |
- * | |
- * | |
- * | |
- * +-------------------------------+
- *
- *
- * A = viewport ; at (0, 0)
- * B = visible ; at (x, y) where x > 0, y > 0
- * C = critical ; at (x, y)
- *
- *
- *
- * +-------------------------------+
- * |A |
- * | |
- * | |
- * | |
- * +----+-----------+ |
- * |B .C | |
- * | . | |
- * | . | |
- * | . | |
- * +----+-----------+ |
- * | |
- * | |
- * | |
- * | |
- * | |
- * +-------------------------------+
- *
- *
- * A = viewport ; at (0, 0)
- * B = visible ; at (x, y) where x < 0, y > 0
- * C = critical ; at (0, y)
- *
- *
- * Maintaining per-browser state is a little bit of a hack involving attaching
- * an object as the obfuscated dynamic JS property of the browser object, that
- * hopefully no one but us will touch. See getViewportStateFromBrowser() for
- * the property name.
- */
-BrowserView.prototype = (
-function() {
-
- // -----------------------------------------------------------
- // Privates
- //
-
- const kZoomLevelMin = 0.2;
- const kZoomLevelMax = 4.0;
- const kZoomLevelPrecision = 10000;
-
- function visibleRectToCriticalRect(visibleRect, browserViewportState) {
- return visibleRect.intersect(browserViewportState.viewportRect);
- }
-
- function clampZoomLevel(zl) {
- let bounded = Math.min(Math.max(kZoomLevelMin, zl), kZoomLevelMax);
- return Math.round(bounded * kZoomLevelPrecision) / kZoomLevelPrecision;
- }
-
- function pageZoomLevel(visibleRect, browserW, browserH) {
- return clampZoomLevel(visibleRect.width / browserW);
- }
-
- function seenBrowser(browser) {
- return !!(browser.__BrowserView__vps);
- }
-
- function initBrowserState(browser, visibleRect) {
- let [browserW, browserH] = getBrowserDimensions(browser);
-
- let zoomLevel = pageZoomLevel(visibleRect, browserW, browserH);
- let viewportRect = (new wsRect(0, 0, browserW, browserH)).scale(zoomLevel, zoomLevel);
-
- dump('--- initing browser to ---' + endl);
- browser.__BrowserView__vps = new BrowserView.BrowserViewportState(viewportRect,
- visibleRect.x,
- visibleRect.y,
- zoomLevel);
- dump(browser.__BrowserView__vps.toString() + endl);
- dump('--------------------------' + endl);
- }
-
- function getViewportStateFromBrowser(browser) {
- return browser.__BrowserView__vps;
- }
-
- function getBrowserDimensions(browser) {
- return [browser.scrollWidth, browser.scrollHeight];
- }
-
- function getContentScrollValues(browser) {
- let cwu = getBrowserDOMWindowUtils(browser);
- let scrollX = {};
- let scrollY = {};
- cwu.getScrollXY(false, scrollX, scrollY);
-
- return [scrollX.value, scrollY.value];
- }
-
- function getBrowserDOMWindowUtils(browser) {
- return browser.contentWindow
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils);
- }
-
- function getNewBatchOperationState() {
- return {
- viewportSizeChanged: false,
- dirtyAll: false
- };
- }
-
- function clampViewportWH(width, height, visibleRect) {
- let minW = visibleRect.width;
- let minH = visibleRect.height;
- return [Math.max(width, minW), Math.max(height, minH)];
- }
-
- function initContainer(container, visibleRect) {
- container.style.width = visibleRect.width + 'px';
- container.style.height = visibleRect.height + 'px';
- container.style.overflow = '-moz-hidden-unscrollable';
- }
-
- function resizeContainerToViewport(container, viewportRect) {
- container.style.width = viewportRect.width + 'px';
- container.style.height = viewportRect.height + 'px';
- }
-
- // !!! --- RESIZE HACK BEGIN -----
- function simulateMozAfterSizeChange(browser, width, height) {
- let ev = document.createElement("MouseEvents");
- ev.initEvent("FakeMozAfterSizeChange", false, false, window, 0, width, height);
- browser.dispatchEvent(ev);
- }
- // !!! --- RESIZE HACK END -------
-
- // --- Change of coordinates functions --- //
-
-
- // The following returned object becomes BrowserView.prototype
- return {
-
- // -----------------------------------------------------------
- // Public instance methods
- //
-
- init: function init(container, visibleRect) {
- this._batchOps = [];
- this._container = container;
- this._browserViewportState = null;
- this._renderMode = 0;
- this._tileManager = new TileManager(this._appendTile, this._removeTile, this);
- this.setVisibleRect(visibleRect);
-
- // !!! --- RESIZE HACK BEGIN -----
- // remove this eventually
- this._resizeHack = {
- maxSeenW: 0,
- maxSeenH: 0
- };
- // !!! --- RESIZE HACK END -------
- },
-
- setVisibleRect: function setVisibleRect(r) {
- let bvs = this._browserViewportState;
- let vr = this._visibleRect;
-
- if (!vr)
- this._visibleRect = vr = r.clone();
- else
- vr.copyFrom(r);
-
- if (bvs) {
- bvs.visibleX = vr.left;
- bvs.visibleY = vr.top;
-
- // reclamp minimally to the new visible rect
- // this.setViewportDimensions(bvs.viewportRect.right, bvs.viewportRect.bottom);
- } else
- this._viewportChanged(false, false);
- },
-
- getVisibleRect: function getVisibleRect() {
- return this._visibleRect.clone();
- },
-
- getVisibleRectX: function getVisibleRectX() { return this._visibleRect.x; },
- getVisibleRectY: function getVisibleRectY() { return this._visibleRect.y; },
- getVisibleRectWidth: function getVisibleRectWidth() { return this._visibleRect.width; },
- getVisibleRectHeight: function getVisibleRectHeight() { return this._visibleRect.height; },
-
- setViewportDimensions: function setViewportDimensions(width, height, causedByZoom) {
- let bvs = this._browserViewportState;
- let vis = this._visibleRect;
-
- if (!bvs)
- return;
-
- // [width, height] = clampViewportWH(width, height, vis);
- bvs.viewportRect.right = width;
- bvs.viewportRect.bottom = height;
-
- // XXX we might not want the user's page to disappear from under them
- // at this point, which could happen if the container gets resized such
- // that visible rect becomes entirely outside of viewport rect. might
- // be wise to define what UX should be in this case, like a move occurs.
- // then again, we could also argue this is the responsibility of the
- // caller who would do such a thing...
-
- this._viewportChanged(true, !!causedByZoom);
- },
-
- setZoomLevel: function setZoomLevel(zl) {
- let bvs = this._browserViewportState;
-
- if (!bvs)
- return;
-
- let newZL = clampZoomLevel(zl);
-
- if (newZL != bvs.zoomLevel) {
- let browserW = this.viewportToBrowser(bvs.viewportRect.right);
- let browserH = this.viewportToBrowser(bvs.viewportRect.bottom);
- bvs.zoomLevel = newZL; // side-effect: now scale factor in transformations is newZL
- this.setViewportDimensions(this.browserToViewport(browserW),
- this.browserToViewport(browserH));
- }
- },
-
- getZoomLevel: function getZoomLevel() {
- let bvs = this._browserViewportState;
- if (!bvs)
- return undefined;
-
- return bvs.zoomLevel;
- },
-
- beginBatchOperation: function beginBatchOperation() {
- this._batchOps.push(getNewBatchOperationState());
- this.pauseRendering();
- },
-
- commitBatchOperation: function commitBatchOperation() {
- let bops = this._batchOps;
-
- if (bops.length == 0)
- return;
-
- let opState = bops.pop();
- this._viewportChanged(opState.viewportSizeChanged, opState.dirtyAll);
- this.resumeRendering();
- },
-
- discardBatchOperation: function discardBatchOperation() {
- let bops = this._batchOps;
- bops.pop();
- this.resumeRendering();
- },
-
- discardAllBatchOperations: function discardAllBatchOperations() {
- let bops = this._batchOps;
- while (bops.length > 0)
- this.discardBatchOperation();
- },
-
- moveVisibleBy: function moveVisibleBy(dx, dy) {
- let vr = this._visibleRect;
- let vs = this._browserViewportState;
-
- this.onBeforeVisibleMove(dx, dy);
- this.onAfterVisibleMove(dx, dy);
- },
-
- moveVisibleTo: function moveVisibleTo(x, y) {
- let visibleRect = this._visibleRect;
- let dx = x - visibleRect.x;
- let dy = y - visibleRect.y;
- this.moveBy(dx, dy);
- },
-
- /**
- * Calls to this function need to be one-to-one with calls to
- * resumeRendering()
- */
- pauseRendering: function pauseRendering() {
- this._renderMode++;
- },
-
- /**
- * Calls to this function need to be one-to-one with calls to
- * pauseRendering()
- */
- resumeRendering: function resumeRendering(renderNow) {
- if (this._renderMode > 0)
- this._renderMode--;
-
- if (renderNow || this._renderMode == 0)
- this._tileManager.criticalRectPaint();
- },
-
- isRendering: function isRendering() {
- return (this._renderMode == 0);
- },
-
- /**
- * @param dx Guess delta to destination x coordinate
- * @param dy Guess delta to destination y coordinate
- */
- onBeforeVisibleMove: function onBeforeVisibleMove(dx, dy) {
- let vs = this._browserViewportState;
- let vr = this._visibleRect;
-
- let destCR = visibleRectToCriticalRect(vr.clone().translate(dx, dy), vs);
-
- this._tileManager.beginCriticalMove(destCR);
- },
-
- /**
- * @param dx Actual delta to destination x coordinate
- * @param dy Actual delta to destination y coordinate
- */
- onAfterVisibleMove: function onAfterVisibleMove(dx, dy) {
- let vs = this._browserViewportState;
- let vr = this._visibleRect;
-
- vr.translate(dx, dy);
- vs.visibleX = vr.left;
- vs.visibleY = vr.top;
-
- let cr = visibleRectToCriticalRect(vr, vs);
-
- this._tileManager.endCriticalMove(cr, this.isRendering());
- },
-
- setBrowser: function setBrowser(browser, skipZoom) {
- let currentBrowser = this._browser;
-
- let browserChanged = (currentBrowser !== browser);
-
- if (currentBrowser) {
- currentBrowser.removeEventListener("MozAfterPaint", this.handleMozAfterPaint, false);
-
- // !!! --- RESIZE HACK BEGIN -----
- // change to the real event type and perhaps refactor the handler function name
- currentBrowser.removeEventListener("FakeMozAfterSizeChange", this.handleMozAfterSizeChange, false);
- // !!! --- RESIZE HACK END -------
-
- this.discardAllBatchOperations();
-
- currentBrowser.setAttribute("type", "content");
- currentBrowser.docShell.isOffScreenBrowser = false;
- }
-
- this._restoreBrowser(browser);
-
- browser.setAttribute("type", "content-primary");
-
- this.beginBatchOperation();
-
- browser.addEventListener("MozAfterPaint", this.handleMozAfterPaint, false);
-
- // !!! --- RESIZE HACK BEGIN -----
- // change to the real event type and perhaps refactor the handler function name
- browser.addEventListener("FakeMozAfterSizeChange", this.handleMozAfterSizeChange, false);
- // !!! --- RESIZE HACK END -------
-
- if (!skipZoom) {
- browser.docShell.isOffScreenBrowser = true;
- this.zoomToPage();
- }
-
- this._viewportChanged(browserChanged, browserChanged);
-
- this.commitBatchOperation();
- },
-
- handleMozAfterPaint: function handleMozAfterPaint(ev) {
- let browser = this._browser;
- let tm = this._tileManager;
- let vs = this._browserViewportState;
-
- let [scrollX, scrollY] = getContentScrollValues(browser);
- let clientRects = ev.clientRects;
-
- // !!! --- RESIZE HACK BEGIN -----
- // remove this, cf explanation in loop below
- let hack = this._resizeHack;
- let hackSizeChanged = false;
- // !!! --- RESIZE HACK END -------
-
- let rects = [];
- // loop backwards to avoid xpconnect penalty for .length
- for (let i = clientRects.length - 1; i >= 0; --i) {
- let e = clientRects.item(i);
- let r = new wsRect(e.left + scrollX,
- e.top + scrollY,
- e.width, e.height);
-
- this.browserToViewportRect(r);
- r.round();
-
- if (r.right < 0 || r.bottom < 0)
- continue;
-
- // !!! --- RESIZE HACK BEGIN -----
- // remove this. this is where we make 'lazy' calculations
- // that hint at a browser size change and fake the size change
- // event dispach
- if (r.right > hack.maxW) {
- hack.maxW = rect.right;
- hackSizeChanged = true;
- }
- if (r.bottom > hack.maxH) {
- hack.maxH = rect.bottom;
- hackSizeChanged = true;
- }
- // !!! --- RESIZE HACK END -------
-
- r.restrictTo(vs.viewportRect);
- rects.push(r);
- }
-
- // !!! --- RESIZE HACK BEGIN -----
- // remove this, cf explanation in loop above
- if (hackSizeChanged)
- simulateMozAfterSizeChange(browser, hack.maxW, hack.maxH);
- // !!! --- RESIZE HACK END -------
-
- tm.dirtyRects(rects, this.isRendering());
- },
-
- handleMozAfterSizeChange: function handleMozAfterPaint(ev) {
- // !!! --- RESIZE HACK BEGIN -----
- // get the correct properties off of the event, these are wrong because
- // we're using a MouseEvent since it has an X and Y prop of some sort and
- // we piggyback on that.
- let w = ev.screenX;
- let h = ev.screenY;
- // !!! --- RESIZE HACK END -------
-
- this.setViewportDimensions(w, h);
- },
-
- zoomToPage: function zoomToPage() {
- let browser = this._browser;
-
- if (!browser)
- return;
-
- let [w, h] = getBrowserDimensions(browser);
- this.setZoomLevel(pageZoomLevel(this._visibleRect, w, h));
- },
-
- zoom: function zoom(aDirection) {
- if (aDirection == 0)
- return;
-
- var zoomDelta = 0.05; // 1/20
- if (aDirection >= 0)
- zoomDelta *= -1;
-
- this.zoomLevel = this._zoomLevel + zoomDelta;
- },
-
- viewportToBrowser: function viewportToBrowser(x) {
- let bvs = this._browserViewportState;
-
- if (!bvs)
- throw "No browser is set";
-
- return x / bvs.zoomLevel;
- },
-
- browserToViewport: function browserToViewport(x) {
- let bvs = this._browserViewportState;
-
- if (!bvs)
- throw "No browser is set";
-
- return x * bvs.zoomLevel;
- },
-
- viewportToBrowserRect: function viewportToBrowserRect(rect) {
- let f = this.viewportToBrowser(1.0);
- return rect.scale(f, f);
- },
-
- browserToViewportRect: function browserToViewportRect(rect) {
- let f = this.browserToViewport(1.0);
- return rect.scale(f, f);
- },
-
- browserToViewportCanvasContext: function browserToViewportCanvasContext(ctx) {
- let f = this.browserToViewport(1.0);
- ctx.scale(f, f);
- },
-
-
- // -----------------------------------------------------------
- // Private instance methods
- //
-
- _restoreBrowser: function _restoreBrowser(browser) {
- let vr = this._visibleRect;
-
- if (!seenBrowser(browser))
- initBrowserState(browser, vr);
-
- let bvs = getViewportStateFromBrowser(browser);
-
- this._contentWindow = browser.contentWindow;
- this._browser = browser;
- this._browserViewportState = bvs;
- vr.left = bvs.visibleX;
- vr.top = bvs.visibleY;
- this._tileManager.setBrowser(browser);
- },
-
- _viewportChanged: function _viewportChanged(viewportSizeChanged, dirtyAll) {
- let bops = this._batchOps;
-
- if (bops.length > 0) {
- let opState = bops[bops.length - 1];
-
- if (viewportSizeChanged)
- opState.viewportSizeChanged = viewportSizeChanged;
-
- if (dirtyAll)
- opState.dirtyAll = dirtyAll;
-
- return;
- }
-
- let bvs = this._browserViewportState;
- let vis = this._visibleRect;
-
- // !!! --- RESIZE HACK BEGIN -----
- // We want to uncomment this for perf, but we can't with the hack in place
- // because the mozAfterPaint gives us rects that we use to create the
- // fake mozAfterResize event, so we can't just clear things.
- /*
- if (dirtyAll) {
- // We're about to mark the entire viewport dirty, so we can clear any
- // queued afterPaint events that will cause redundant draws
- getBrowserDOMWindowUtils(this._browser).clearMozAfterPaintEvents();
- }
- */
- // !!! --- RESIZE HACK END -------
-
- if (bvs) {
- resizeContainerToViewport(this._container, bvs.viewportRect);
-
- this._tileManager.viewportChangeHandler(bvs.viewportRect,
- visibleRectToCriticalRect(vis, bvs),
- viewportSizeChanged,
- dirtyAll);
- }
- },
-
- _appendTile: function _appendTile(tile) {
- let canvas = tile.getContentImage();
-
- /*
- canvas.style.position = "absolute";
- canvas.style.left = tile.x + "px";
- canvas.style.top = tile.y + "px";
- */
-
- canvas.setAttribute("style", "position: absolute; left: " + tile.boundRect.left + "px; " + "top: " + tile.boundRect.top + "px;");
-
- this._container.appendChild(canvas);
-
- // dump('++ ' + tile.toString(true) + endl);
- },
-
- _removeTile: function _removeTile(tile) {
- let canvas = tile.getContentImage();
-
- this._container.removeChild(canvas);
-
- // dump('-- ' + tile.toString(true) + endl);
- }
-
- };
-
-}
-)();
-
-
-// -----------------------------------------------------------
-// Helper structures
-//
-
-BrowserView.BrowserViewportState = function(viewportRect,
- visibleX,
- visibleY,
- zoomLevel) {
-
- this.init(viewportRect, visibleX, visibleY, zoomLevel);
-};
-
-BrowserView.BrowserViewportState.prototype = {
-
- init: function init(viewportRect, visibleX, visibleY, zoomLevel) {
- this.viewportRect = viewportRect;
- this.visibleX = visibleX;
- this.visibleY = visibleY;
- this.zoomLevel = zoomLevel;
- },
-
- clone: function clone() {
- return new BrowserView.BrowserViewportState(this.viewportRect,
- this.visibleX,
- this.visibleY,
- this.zoomLevel);
- },
-
- toString: function toString() {
- let props = ['\tviewportRect=' + this.viewportRect.toString(),
- '\tvisibleX=' + this.visibleX,
- '\tvisibleY=' + this.visibleY,
- '\tzoomLevel=' + this.zoomLevel];
-
- return '[BrowserViewportState] {\n' + props.join(',\n') + '\n}';
- }
-
-};
-
diff --git a/toolkit/content/tests/fennec-tile-testapp/chrome/content/FooScript.js b/toolkit/content/tests/fennec-tile-testapp/chrome/content/FooScript.js
deleted file mode 100644
index 49cbbed66..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/FooScript.js
+++ /dev/null
@@ -1,352 +0,0 @@
-var noop = function() {};
-Browser = {
- updateViewportSize: noop
- /** ***********************************************************
- function
- let browser = document.getElementById("googlenews");
- let cdoc = browser.contentDocument;
-
- // These might not exist yet depending on page load state
- var body = cdoc.body || {};
- var html = cdoc.documentElement || {};
-
- var w = Math.max(body.scrollWidth || 0, html.scrollWidth);
- var h = Math.max(body.scrollHeight || 0, html.scrollHeight);
-
- window.tileManager.viewportHandler(new wsRect(0, 0, w, h),
- window.innerWidth,
- new wsRect(0, 0, window.innerWidth, window.innerHeight),
- false);
- *************************************************************/
-};
-var ws = {
- beginUpdateBatch: noop,
- panTo: noop,
- endUpdateBatch: noop
-};
-var Ci = Components.interfaces;
-var bv = null;
-var endl = "\n";
-
-
-function BrowserView() {
- this.init();
- bindAll(this);
-}
-
-BrowserView.prototype = {
-
- // --- PROPERTIES ---
- // public:
- // init()
- // getViewportInnerBoundsRect(dx, dy)
- // tileManager
- // scrollbox
- //
- // private:
- // _scrollbox
- // _leftbar
- // _rightbar
- // _topbar
- // _browser
- // _tileManager
- // _viewportRect
- // _viewportInnerBoundsRect
- //
-
- get tileManager() { return this._tileManager; },
- get scrollbox() { return this._scrollbox; },
-
- init: function init() {
- let scrollbox = document.getElementById("scrollbox").boxObject;
- this._scrollbox = scrollbox;
-
- let leftbar = document.getElementById("left_sidebar");
- let rightbar = document.getElementById("right_sidebar");
- let topbar = document.getElementById("top_urlbar");
- this._leftbar = leftbar;
- this._rightbar = rightbar;
- this._topbar = topbar;
-
- scrollbox.scrollTo(Math.round(leftbar.getBoundingClientRect().right), 0);
-
- let tileContainer = document.getElementById("tile_container");
- tileContainer.addEventListener("mousedown", onMouseDown, true);
- tileContainer.addEventListener("mouseup", onMouseUp, true);
- tileContainer.addEventListener("mousemove", onMouseMove, true);
- this._tileContainer = tileContainer;
-
- let tileManager = new TileManager(this.appendTile, this.removeTile, window.innerWidth);
- this._tileManager = tileManager;
-
- let browser = document.getElementById("googlenews");
- this.setCurrentBrowser(browser, false); // sets this._browser
-
- let cdoc = browser.contentDocument;
-
- // These might not exist yet depending on page load state
- let body = cdoc.body || {};
- let html = cdoc.documentElement || {};
-
- let w = Math.max(body.scrollWidth || 0, html.scrollWidth);
- let h = Math.max(body.scrollHeight || 0, html.scrollHeight);
-
- let viewportRect = new wsRect(0, 0, w, h);
- this._viewportRect = viewportRect;
-
- let viewportInnerBoundsRect = this.getViewportInnerBoundsRect();
- this._viewportInnerBoundsRect = viewportInnerBoundsRect;
-
- tileManager.viewportHandler(viewportRect,
- window.innerWidth,
- viewportInnerBoundsRect,
- true);
- },
-
- resizeTileContainer: function resizeTileContainer() {
-
- },
-
- scrollboxToViewportRect: function scrollboxToViewportRect(rect, clip) {
- let leftbar = this._leftbar.getBoundingClientRect();
- let rightbar = this._rightbar.getBoundingClientRect();
- let topbar = this._topbar.getBoundingClientRect();
-
- let xtrans = -leftbar.width;
- let ytrans = -topbar.height;
- let x = rect.x + xtrans;
- let y = rect.y + ytrans;
-
- // XXX we're cheating --- this is not really a clip, but its the only
- // way this function is used
- rect.x = (clip) ? Math.max(x, 0) : x;
- rect.y = (clip) ? Math.max(y, 0) : y;
-
- return rect;
- },
-
- getScrollboxPosition: function getScrollboxPosition() {
- return [this._scrollbox.positionX, this._scrollbox.positionY];
- },
-
- getViewportInnerBoundsRect: function getViewportInnerBoundsRect(dx, dy) {
- if (!dx) dx = 0;
- if (!dy) dy = 0;
-
- let w = window.innerWidth;
- let h = window.innerHeight;
-
- let leftbar = this._leftbar.getBoundingClientRect();
- let rightbar = this._rightbar.getBoundingClientRect();
- let topbar = this._topbar.getBoundingClientRect();
-
- let leftinner = Math.max(leftbar.right - dx, 0);
- let rightinner = Math.min(rightbar.left - dx, w);
- let topinner = Math.max(topbar.bottom - dy, 0);
-
- let [x, y] = this.getScrollboxPosition();
-
- return this.scrollboxToViewportRect(new wsRect(x + dx, y + dy, rightinner - leftinner, h - topinner),
- true);
- },
-
- appendTile: function appendTile(tile) {
- let canvas = tile.contentImage;
-
- canvas.style.position = "absolute";
- canvas.style.left = tile.x + "px";
- canvas.style.top = tile.y + "px";
-
- let tileContainer = document.getElementById("tile_container");
- tileContainer.appendChild(canvas);
-
- dump('++ ' + tile.toString() + endl);
- },
-
- removeTile: function removeTile(tile) {
- let canvas = tile.contentImage;
-
- let tileContainer = document.getElementById("tile_container");
- tileContainer.removeChild(canvas);
-
- dump('-- ' + tile.toString() + endl);
- },
-
- scrollBy: function scrollBy(dx, dy) {
- // TODO
- this.onBeforeScroll();
- this.onAfterScroll();
- },
-
- // x: current x
- // y: current y
- // dx: delta to get to x from current x
- // dy: delta to get to y from current y
- onBeforeScroll: function onBeforeScroll(x, y, dx, dy) {
- this.tileManager.onBeforeScroll(this.getViewportInnerBoundsRect(dx, dy));
-
- // shouldn't update margin if it doesn't need to be changed
- let sidebars = document.getElementsByClassName("sidebar");
- for (let i = 0; i < sidebars.length; i++) {
- let sidebar = sidebars[i];
- sidebar.style.margin = (y + dy) + "px 0px 0px 0px";
- }
-
- let urlbar = document.getElementById("top_urlbar");
- urlbar.style.margin = "0px 0px 0px " + (x + dx) + "px";
- },
-
- onAfterScroll: function onAfterScroll(x, y, dx, dy) {
- this.tileManager.onAfterScroll(this.getViewportInnerBoundsRect());
- },
-
- setCurrentBrowser: function setCurrentBrowser(browser, skipZoom) {
- let currentBrowser = this._browser;
- if (currentBrowser) {
- // backup state
- currentBrowser.mZoomLevel = this.zoomLevel;
- currentBrowser.mPanX = ws._viewingRect.x;
- currentBrowser.mPanY = ws._viewingRect.y;
-
- // stop monitor paint events for this browser
- currentBrowser.removeEventListener("MozAfterPaint", this.handleMozAfterPaint, false);
- currentBrowser.setAttribute("type", "content");
- currentBrowser.docShell.isOffScreenBrowser = false;
- }
-
- browser.setAttribute("type", "content-primary");
- if (!skipZoom)
- browser.docShell.isOffScreenBrowser = true;
-
- // start monitoring paint events for this browser
- browser.addEventListener("MozAfterPaint", this.handleMozAfterPaint, false);
-
- this._browser = browser;
-
- // endLoading(and startLoading in most cases) calls zoom anyway
- if (!skipZoom) {
- this.zoomToPage();
- }
-
- if ("mZoomLevel" in browser) {
- // restore last state
- ws.beginUpdateBatch();
- ws.panTo(browser.mPanX, browser.mPanY);
- this.zoomLevel = browser.mZoomLevel;
- ws.endUpdateBatch(true);
-
- // drop the cache
- delete browser.mZoomLevel;
- delete browser.mPanX;
- delete browser.mPanY;
- }
-
- this.tileManager.browser = browser;
- },
-
- handleMozAfterPaint: function handleMozAfterPaint(ev) {
- this.tileManager.handleMozAfterPaint(ev);
- },
-
- zoomToPage: function zoomToPage() {
- /** ******************************************************
- let needToPanToTop = this._needToPanToTop;
- // Ensure pages are panned at the top before zooming/painting
- // combine the initial pan + zoom into a transaction
- if (needToPanToTop) {
- ws.beginUpdateBatch();
- this._needToPanToTop = false;
- ws.panTo(0, -BrowserUI.toolbarH);
- }
- // Adjust the zoomLevel to fit the page contents in our window width
- let [contentW, ] = this._contentAreaDimensions;
- let fakeW = this._fakeWidth;
-
- if (contentW > fakeW)
- this.zoomLevel = fakeW / contentW;
-
- if (needToPanToTop)
- ws.endUpdateBatch();
- ********************************************************/
- }
-
-};
-
-
-function onResize(e) {
- let browser = document.getElementById("googlenews");
- let cdoc = browser.contentDocument;
-
- // These might not exist yet depending on page load state
- var body = cdoc.body || {};
- var html = cdoc.documentElement || {};
-
- var w = Math.max(body.scrollWidth || 0, html.scrollWidth);
- var h = Math.max(body.scrollHeight || 0, html.scrollHeight);
-
- if (bv)
- bv.tileManager.viewportHandler(new wsRect(0, 0, w, h),
- window.innerWidth,
- bv.getViewportInnerBoundsRect(),
- true);
-}
-
-function onMouseDown(e) {
- window._isDragging = true;
- window._dragStart = {x: e.clientX, y: e.clientY};
-
- bv.tileManager.startPanning();
-}
-
-function onMouseUp() {
- window._isDragging = false;
-
- bv.tileManager.endPanning();
-}
-
-function onMouseMove(e) {
- if (window._isDragging) {
- let scrollbox = bv.scrollbox;
-
- let x = scrollbox.positionX;
- let y = scrollbox.positionY;
- let w = scrollbox.scrolledWidth;
- let h = scrollbox.scrolledHeight;
-
- let dx = window._dragStart.x - e.clientX;
- let dy = window._dragStart.y - e.clientY;
-
- // XXX if max(x, 0) > scrollwidth we shouldn't do anything (same for y/height)
- let newX = Math.max(x + dx, 0);
- let newY = Math.max(y + dy, 0);
-
- if (newX < w || newY < h) {
- // clip dx and dy to prevent us from going below 0
- dx = Math.max(dx, -x);
- dy = Math.max(dy, -y);
-
- bv.onBeforeScroll(x, y, dx, dy);
-
- /* dump("==========scroll==========" + endl);
- dump("delta: " + dx + "," + dy + endl);
- let xx = {};
- let yy = {};
- scrollbox.getPosition(xx, yy);
- dump(xx.value + "," + yy.value + endl);*/
-
- scrollbox.scrollBy(dx, dy);
-
- /* scrollbox.getPosition(xx, yy);
- dump(xx.value + "," + yy.value + endl);
- dump("==========================" + endl);*/
-
- bv.onAfterScroll();
- }
- }
-
- window._dragStart = {x: e.clientX, y: e.clientY};
-}
-
-function onLoad() {
- bv = new BrowserView();
-}
diff --git a/toolkit/content/tests/fennec-tile-testapp/chrome/content/TileManager.js b/toolkit/content/tests/fennec-tile-testapp/chrome/content/TileManager.js
deleted file mode 100644
index 52beb6e36..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/TileManager.js
+++ /dev/null
@@ -1,1018 +0,0 @@
-// -*- tab-width: 2; indent-tabs-mode: nil; js-indent-level: 2 -*-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const kXHTMLNamespaceURI = "http://www.w3.org/1999/xhtml";
-
-// base-2 exponent for width, height of a single tile.
-const kTileExponentWidth = 7;
-const kTileExponentHeight = 7;
-const kTileWidth = Math.pow(2, kTileExponentWidth); // 2^7 = 128
-const kTileHeight = Math.pow(2, kTileExponentHeight); // 2^7 = 128
-const kLazyRoundTimeCap = 500; // millis
-
-
-function bind(f, thisObj) {
- return function() {
- return f.apply(thisObj, arguments);
- };
-}
-
-function bindSome(instance, methodNames) {
- for (let methodName of methodNames)
- if (methodName in instance)
- instance[methodName] = bind(instance[methodName], instance);
-}
-
-function bindAll(instance) {
- for (let key in instance)
- if (instance[key] instanceof Function)
- instance[key] = bind(instance[key], instance);
-}
-
-
-/**
- * The Tile Manager!
- *
- * @param appendTile The function the tile manager should call in order to
- * "display" a tile (e.g. append it to the DOM). The argument to this
- * function is a TileManager.Tile object.
- * @param removeTile The function the tile manager should call in order to
- * "undisplay" a tile (e.g. remove it from the DOM). The argument to this
- * function is a TileManager.Tile object.
- * @param fakeWidth The width of the widest possible visible rectangle, e.g.
- * the width of the screen. This is used in setting the zoomLevel.
- */
-function TileManager(appendTile, removeTile, browserView) {
- // backref to the BrowserView object that owns us
- this._browserView = browserView;
-
- // callbacks to append / remove a tile to / from the parent
- this._appendTile = appendTile;
- this._removeTile = removeTile;
-
- // tile cache holds tile objects and pools them under a given capacity
- let self = this;
- this._tileCache = new TileManager.TileCache(function(tile) { self._removeTileSafe(tile); },
- -1, -1, 110);
-
- // Rectangle within the viewport that is visible to the user. It is "critical"
- // in the sense that it must be rendered as soon as it becomes dirty
- this._criticalRect = null;
-
- // Current <browser> DOM element, holding the content we wish to render.
- // This is null when no browser is attached
- this._browser = null;
-
- // if we have an outstanding paint timeout, its value is stored here
- // for cancelling when we end page loads
- // this._drawTimeout = 0;
- this._pageLoadResizerTimeout = 0;
-
- // timeout of the non-visible-tiles-crawler to cache renders from the browser
- this._idleTileCrawlerTimeout = 0;
-
- // object that keeps state on our current lazyload crawl
- this._crawler = null;
-
- // the max right coordinate we've seen from paint events
- // while we were loading a page. If we see something that's bigger than
- // our width, we'll trigger a page zoom.
- this._pageLoadMaxRight = 0;
- this._pageLoadMaxBottom = 0;
-
- // Tells us to pan to top before first draw
- this._needToPanToTop = false;
-}
-
-TileManager.prototype = {
-
- setBrowser: function setBrowser(b) { this._browser = b; },
-
- // This is the callback fired by our client whenever the viewport
- // changed somehow (or didn't change but someone asked it to update).
- viewportChangeHandler: function viewportChangeHandler(viewportRect,
- criticalRect,
- boundsSizeChanged,
- dirtyAll) {
- // !!! --- DEBUG BEGIN -----
- dump("***vphandler***\n");
- dump(viewportRect.toString() + "\n");
- dump(criticalRect.toString() + "\n");
- dump(boundsSizeChanged + "\n");
- dump(dirtyAll + "\n***************\n");
- // !!! --- DEBUG END -------
-
- let tc = this._tileCache;
-
- tc.iBound = Math.ceil(viewportRect.right / kTileWidth);
- tc.jBound = Math.ceil(viewportRect.bottom / kTileHeight);
-
- if (!criticalRect || !criticalRect.equals(this._criticalRect)) {
- this.beginCriticalMove(criticalRect);
- this.endCriticalMove(criticalRect, !boundsSizeChanged);
- }
-
- if (boundsSizeChanged) {
- // TODO fastpath if !dirtyAll
- this.dirtyRects([viewportRect.clone()], true);
- }
- },
-
- dirtyRects: function dirtyRects(rects, doCriticalRender) {
- let criticalIsDirty = false;
- let criticalRect = this._criticalRect;
-
- for (let rect of rects) {
- this._tileCache.forEachIntersectingRect(rect, false, this._dirtyTile, this);
-
- if (criticalRect && rect.intersects(criticalRect))
- criticalIsDirty = true;
- }
-
- if (criticalIsDirty && doCriticalRender)
- this.criticalRectPaint();
- },
-
- criticalRectPaint: function criticalRectPaint() {
- let cr = this._criticalRect;
-
- if (cr) {
- let [ctrx, ctry] = cr.centerRounded();
- this.recenterEvictionQueue(ctrx, ctry);
- this._renderAppendHoldRect(cr);
- }
- },
-
- beginCriticalMove2: function beginCriticalMove(destCriticalRect) {
- let start = Date.now();
- function appendNonDirtyTile(tile) {
- if (!tile.isDirty())
- this._appendTileSafe(tile);
- }
-
- if (destCriticalRect)
- this._tileCache.forEachIntersectingRect(destCriticalRect, false, appendNonDirtyTile, this);
- let end = Date.now();
- dump("start: " + (end-start) + "\n")
- },
-
- beginCriticalMove: function beginCriticalMove(destCriticalRect) {
- /*
- function appendNonDirtyTile(tile) {
- if (!tile.isDirty())
- this._appendTileSafe(tile);
- }
- */
-
- let start = Date.now();
-
- if (destCriticalRect) {
-
- let rect = destCriticalRect;
-
- let create = false;
-
- // this._tileCache.forEachIntersectingRect(destCriticalRect, false, appendNonDirtyTile, this);
- let visited = {};
- let evictGuard = null;
- if (create) {
- evictGuard = function evictGuard(tile) {
- return !visited[tile.toString()];
- };
- }
-
- let starti = rect.left >> kTileExponentWidth;
- let endi = rect.right >> kTileExponentWidth;
-
- let startj = rect.top >> kTileExponentHeight;
- let endj = rect.bottom >> kTileExponentHeight;
-
- let tile = null;
- let tc = this._tileCache;
-
- for (var j = startj; j <= endj; ++j) {
- for (var i = starti; i <= endi; ++i) {
-
- // 'this' for getTile needs to be tc
-
- // tile = this.getTile(i, j, create, evictGuard);
- // if (!tc.inBounds(i, j)) {
- if (0 <= i && 0 <= j && i <= tc.iBound && j <= tc.jBound) {
- // return null;
- break;
- }
-
- tile = null;
-
- // if (tc._isOccupied(i, j)) {
- if (tc._tiles[i] && tc._tiles[i][j]) {
- tile = tc._tiles[i][j];
- } else if (create) {
- // NOTE: create is false here
- tile = tc._createTile(i, j, evictionGuard);
- if (tile) tile.markDirty();
- }
-
- if (tile) {
- visited[tile.toString()] = true;
- // fn.call(thisObj, tile);
- // function appendNonDirtyTile(tile) {
- // if (!tile.isDirty())
- if (!tile._dirtyTileCanvas) {
- // this._appendTileSafe(tile);
- if (!tile._appended) {
- let astart = Date.now();
- this._appendTile(tile);
- tile._appended = true;
- let aend = Date.now();
- dump("append: " + (aend - astart) + "\n");
- }
- }
- // }
- }
- }
- }
- }
-
- let end = Date.now();
- dump("start: " + (end-start) + "\n")
- },
-
- endCriticalMove: function endCriticalMove(destCriticalRect, doCriticalPaint) {
- let start = Date.now();
-
- let tc = this._tileCache;
- let cr = this._criticalRect;
-
- let dcr = destCriticalRect.clone();
-
- let f = function releaseOldTile(tile) {
- // release old tile
- if (!tile.boundRect.intersects(dcr))
- tc.releaseTile(tile);
- }
-
- if (cr)
- tc.forEachIntersectingRect(cr, false, f, this);
-
- this._holdRect(destCriticalRect);
-
- if (cr)
- cr.copyFrom(destCriticalRect);
- else
- this._criticalRect = cr = destCriticalRect;
-
- let crpstart = Date.now();
- if (doCriticalPaint)
- this.criticalRectPaint();
- dump(" crp: " + (Date.now() - crpstart) + "\n");
-
- let end = Date.now();
- dump("end: " + (end - start) + "\n");
- },
-
- restartLazyCrawl: function restartLazyCrawl(startRectOrQueue) {
- if (!startRectOrQueue || startRectOrQueue instanceof Array) {
- this._crawler = new TileManager.CrawlIterator(this._tileCache);
-
- if (startRectOrQueue) {
- let len = startRectOrQueue.length;
- for (let k = 0; k < len; ++k)
- this._crawler.enqueue(startRectOrQueue[k].i, startRectOrQueue[k].j);
- }
- } else {
- this._crawler = new TileManager.CrawlIterator(this._tileCache, startRectOrQueue);
- }
-
- if (!this._idleTileCrawlerTimeout)
- this._idleTileCrawlerTimeout = setTimeout(this._idleTileCrawler, 2000, this);
- },
-
- stopLazyCrawl: function stopLazyCrawl() {
- this._idleTileCrawlerTimeout = 0;
- this._crawler = null;
-
- let cr = this._criticalRect;
- if (cr) {
- let [ctrx, ctry] = cr.centerRounded();
- this.recenterEvictionQueue(ctrx, ctry);
- }
- },
-
- recenterEvictionQueue: function recenterEvictionQueue(ctrx, ctry) {
- let ctri = ctrx >> kTileExponentWidth;
- let ctrj = ctry >> kTileExponentHeight;
-
- function evictFarTiles(a, b) {
- let dista = Math.max(Math.abs(a.i - ctri), Math.abs(a.j - ctrj));
- let distb = Math.max(Math.abs(b.i - ctri), Math.abs(b.j - ctrj));
- return dista - distb;
- }
-
- this._tileCache.sortEvictionQueue(evictFarTiles);
- },
-
- _renderTile: function _renderTile(tile) {
- if (tile.isDirty())
- tile.render(this._browser, this._browserView);
- },
-
- _appendTileSafe: function _appendTileSafe(tile) {
- if (!tile._appended) {
- this._appendTile(tile);
- tile._appended = true;
- }
- },
-
- _removeTileSafe: function _removeTileSafe(tile) {
- if (tile._appended) {
- this._removeTile(tile);
- tile._appended = false;
- }
- },
-
- _dirtyTile: function _dirtyTile(tile) {
- if (!this._criticalRect || !tile.boundRect.intersects(this._criticalRect))
- this._removeTileSafe(tile);
-
- tile.markDirty();
-
- if (this._crawler)
- this._crawler.enqueue(tile.i, tile.j);
- },
-
- _holdRect: function _holdRect(rect) {
- this._tileCache.holdTilesIntersectingRect(rect);
- },
-
- _releaseRect: function _releaseRect(rect) {
- this._tileCache.releaseTilesIntersectingRect(rect);
- },
-
- _renderAppendHoldRect: function _renderAppendHoldRect(rect) {
- function renderAppendHoldTile(tile) {
- if (tile.isDirty())
- this._renderTile(tile);
-
- this._appendTileSafe(tile);
- this._tileCache.holdTile(tile);
- }
-
- this._tileCache.forEachIntersectingRect(rect, true, renderAppendHoldTile, this);
- },
-
- _idleTileCrawler: function _idleTileCrawler(self) {
- if (!self) self = this;
- dump('crawl pass.\n');
- let itered = 0, rendered = 0;
-
- let start = Date.now();
- let comeAgain = true;
-
- while ((Date.now() - start) <= kLazyRoundTimeCap) {
- let tile = self._crawler.next();
-
- if (!tile) {
- comeAgain = false;
- break;
- }
-
- if (tile.isDirty()) {
- self._renderTile(tile);
- ++rendered;
- }
- ++itered;
- }
-
- dump('crawl itered:' + itered + ' rendered:' + rendered + '\n');
-
- if (comeAgain) {
- self._idleTileCrawlerTimeout = setTimeout(self._idleTileCrawler, 2000, self);
- } else {
- self.stopLazyCrawl();
- dump('crawl end\n');
- }
- }
-
-};
-
-
-/**
- * The tile cache used by the tile manager to hold and index all
- * tiles. Also responsible for pooling tiles and maintaining the
- * number of tiles under given capacity.
- *
- * @param onBeforeTileDetach callback set by the TileManager to call before
- * we must "detach" a tile from a tileholder due to needing it elsewhere or
- * having to discard it on capacity decrease
- * @param capacity the initial capacity of the tile cache, i.e. the max number
- * of tiles the cache can have allocated
- */
-TileManager.TileCache = function TileCache(onBeforeTileDetach, iBound, jBound, capacity) {
- if (arguments.length <= 3 || capacity < 0)
- capacity = Infinity;
-
- // We track all pooled tiles in a 2D array (row, column) ordered as
- // they "appear on screen". The array is a grid that functions for
- // storage of the tiles and as a lookup map. Each array entry is
- // a reference to the tile occupying that space ("tileholder"). Entries
- // are not unique, so a tile could be referenced by multiple array entries,
- // i.e. a tile could "span" many tile placeholders (e.g. if we merge
- // neighbouring tiles).
- this._tiles = [];
-
- // holds the same tiles that _tiles holds, but as contiguous array
- // elements, for pooling tiles for reuse under finite capacity
- this._tilePool = (capacity == Infinity) ? new Array() : new Array(capacity);
-
- this._capacity = capacity;
- this._nTiles = 0;
- this._numFree = 0;
-
- this._onBeforeTileDetach = onBeforeTileDetach;
-
- this.iBound = iBound;
- this.jBound = jBound;
-};
-
-TileManager.TileCache.prototype = {
-
- get size() { return this._nTiles; },
- get numFree() { return this._numFree; },
-
- // A comparison function that will compare all free tiles as greater
- // than all non-free tiles. Useful because, for instance, to shrink
- // the tile pool when capacity is lowered, we want to remove all tiles
- // at the new cap and beyond, favoring removal of free tiles first.
- evictionCmp: function freeTilesLast(a, b) {
- if (a.free == b.free) return (a.j == b.j) ? b.i - a.i : b.j - a.j;
- return (a.free) ? 1 : -1;
- },
-
- getCapacity: function getCapacity() { return this._capacity; },
-
- setCapacity: function setCapacity(newCap, skipEvictionQueueSort) {
- if (newCap < 0)
- throw "Cannot set a negative tile cache capacity";
-
- if (newCap == Infinity) {
- this._capacity = Infinity;
- return;
- } else if (this._capacity == Infinity) {
- // pretend we had a finite capacity all along and proceed normally
- this._capacity = this._tilePool.length;
- }
-
- let rem = null;
-
- if (newCap < this._capacity) {
- // This case is obnoxious. We're decreasing our capacity which means
- // we may have to get rid of tiles. Depending on our eviction comparator,
- // we probably try to get rid free tiles first, but we might have to throw
- // out some nonfree ones too. Note that "throwing out" means the cache
- // won't keep them, and they'll get GC'ed as soon as all other refholders
- // let go of their refs to the tile.
- if (!skipEvictionQueueSort)
- this.sortEvictionQueue();
-
- rem = this._tilePool.splice(newCap, this._tilePool.length);
-
- } else {
- // This case is win. Extend our tile pool array with new empty space.
- this._tilePool.push.apply(this._tilePool, new Array(newCap - this._capacity));
- }
-
- // update state in the case that we threw things out.
- let nTilesDeleted = this._nTiles - newCap;
- if (nTilesDeleted > 0) {
- let nFreeDeleted = 0;
- for (let k = 0; k < nTilesDeleted; ++k) {
- if (rem[k].free)
- nFreeDeleted++;
-
- this._detachTile(rem[k].i, rem[k].j);
- }
-
- this._nTiles -= nTilesDeleted;
- this._numFree -= nFreeDeleted;
- }
-
- this._capacity = newCap;
- },
-
- _isOccupied: function _isOccupied(i, j) {
- return !!(this._tiles[i] && this._tiles[i][j]);
- },
-
- _detachTile: function _detachTile(i, j) {
- let tile = null;
- if (this._isOccupied(i, j)) {
- tile = this._tiles[i][j];
-
- if (this._onBeforeTileDetach)
- this._onBeforeTileDetach(tile);
-
- this.releaseTile(tile);
- delete this._tiles[i][j];
- }
- return tile;
- },
-
- _reassignTile: function _reassignTile(tile, i, j) {
- this._detachTile(tile.i, tile.j); // detach
- tile.init(i, j); // re-init
- this._tiles[i][j] = tile; // attach
- return tile;
- },
-
- _evictTile: function _evictTile(evictionGuard) {
- let k = this._nTiles - 1;
- let pool = this._tilePool;
- let victim = null;
-
- for (; k >= 0; --k) {
- if (pool[k].free &&
- (!evictionGuard || evictionGuard(pool[k])))
- {
- victim = pool[k];
- break;
- }
- }
-
- return victim;
- },
-
- _createTile: function _createTile(i, j, evictionGuard) {
- if (!this._tiles[i])
- this._tiles[i] = [];
-
- let tile = null;
-
- if (this._nTiles < this._capacity) {
- // either capacity is infinite, or we still have room to allocate more
- tile = new TileManager.Tile(i, j);
- this._tiles[i][j] = tile;
- this._tilePool[this._nTiles++] = tile;
- this._numFree++;
-
- } else {
- // assert: nTiles == capacity
- dump("\nevicting\n");
- tile = this._evictTile(evictionGuard);
- if (tile)
- this._reassignTile(tile, i, j);
- }
-
- return tile;
- },
-
- inBounds: function inBounds(i, j) {
- return 0 <= i && 0 <= j && i <= this.iBound && j <= this.jBound;
- },
-
- sortEvictionQueue: function sortEvictionQueue(cmp) {
- if (!cmp) cmp = this.evictionCmp;
- this._tilePool.sort(cmp);
- },
-
- /**
- * Get a tile by its indices
- *
- * @param i Column
- * @param j Row
- * @param create Flag true if the tile should be created in case there is no
- * tile at (i, j)
- * @param reuseCondition Boolean-valued function to restrict conditions under
- * which an old tile may be reused for creating this one. This can happen if
- * the cache has reached its capacity and must reuse existing tiles in order to
- * create this one. The function is given a Tile object as its argument and
- * returns true if the tile is OK for reuse. This argument has no effect if the
- * create argument is false.
- */
- getTile: function getTile(i, j, create, evictionGuard) {
- if (!this.inBounds(i, j))
- return null;
-
- let tile = null;
-
- if (this._isOccupied(i, j)) {
- tile = this._tiles[i][j];
- } else if (create) {
- tile = this._createTile(i, j, evictionGuard);
- if (tile) tile.markDirty();
- }
-
- return tile;
- },
-
- /**
- * Look up (possibly creating) a tile from its viewport coordinates.
- *
- * @param x
- * @param y
- * @param create Flag true if the tile should be created in case it doesn't
- * already exist at the tileholder corresponding to (x, y)
- */
- tileFromPoint: function tileFromPoint(x, y, create) {
- let i = x >> kTileExponentWidth;
- let j = y >> kTileExponentHeight;
-
- return this.getTile(i, j, create);
- },
-
- /**
- * Hold a tile (i.e. mark it non-free). Returns true if the operation
- * actually did something, false elsewise.
- */
- holdTile: function holdTile(tile) {
- if (tile && tile.free) {
- tile._hold();
- this._numFree--;
- return true;
- }
- return false;
- },
-
- /**
- * Release a tile (i.e. mark it free). Returns true if the operation
- * actually did something, false elsewise.
- */
- releaseTile: function releaseTile(tile) {
- if (tile && !tile.free) {
- tile._release();
- this._numFree++;
- return true;
- }
- return false;
- },
-
- // XXX the following two functions will iterate through duplicate tiles
- // once we begin to merge tiles.
- /**
- * Fetch all tiles that share at least one point with this rect. If `create'
- * is true then any tileless tileholders will have tiles created for them.
- */
- tilesIntersectingRect: function tilesIntersectingRect(rect, create) {
- let dx = (rect.right % kTileWidth) - (rect.left % kTileWidth);
- let dy = (rect.bottom % kTileHeight) - (rect.top % kTileHeight);
- let tiles = [];
-
- for (let y = rect.top; y <= rect.bottom - dy; y += kTileHeight) {
- for (let x = rect.left; x <= rect.right - dx; x += kTileWidth) {
- let tile = this.tileFromPoint(x, y, create);
- if (tile)
- tiles.push(tile);
- }
- }
-
- return tiles;
- },
-
- forEachIntersectingRect: function forEachIntersectingRect(rect, create, fn, thisObj) {
- let visited = {};
- let evictGuard = null;
- if (create) {
- evictGuard = function evictGuard(tile) {
- return !visited[tile.toString()];
- };
- }
-
- let starti = rect.left >> kTileExponentWidth;
- let endi = rect.right >> kTileExponentWidth;
-
- let startj = rect.top >> kTileExponentHeight;
- let endj = rect.bottom >> kTileExponentHeight;
-
- let tile = null;
- for (var j = startj; j <= endj; ++j) {
- for (var i = starti; i <= endi; ++i) {
- tile = this.getTile(i, j, create, evictGuard);
- if (tile) {
- visited[tile.toString()] = true;
- fn.call(thisObj, tile);
- }
- }
- }
- },
-
- holdTilesIntersectingRect: function holdTilesIntersectingRect(rect) {
- this.forEachIntersectingRect(rect, false, this.holdTile, this);
- },
-
- releaseTilesIntersectingRect: function releaseTilesIntersectingRect(rect) {
- this.forEachIntersectingRect(rect, false, this.releaseTile, this);
- }
-
-};
-
-
-
-TileManager.Tile = function Tile(i, j) {
- // canvas element is where we keep paint data from browser for this tile
- this._canvas = document.createElementNS(kXHTMLNamespaceURI, "canvas");
- this._canvas.setAttribute("width", String(kTileWidth));
- this._canvas.setAttribute("height", String(kTileHeight));
- this._canvas.setAttribute("moz-opaque", "true");
- // this._canvas.style.border = "1px solid red";
-
- this.init(i, j); // defines more properties, cf below
-};
-
-TileManager.Tile.prototype = {
-
- // essentially, this is part of constructor code, but since we reuse tiles
- // in the tile cache, this is here so that we can reinitialize tiles when we
- // reuse them
- init: function init(i, j) {
- if (!this.boundRect)
- this.boundRect = new wsRect(i * kTileWidth, j * kTileHeight, kTileWidth, kTileHeight);
- else
- this.boundRect.setRect(i * kTileWidth, j * kTileHeight, kTileWidth, kTileHeight);
-
- // indices!
- this.i = i;
- this.j = j;
-
- // flags true if we need to repaint our own local canvas
- this._dirtyTileCanvas = false;
-
- // keep a dirty rectangle (i.e. only part of the tile is dirty)
- this._dirtyTileCanvasRect = null;
-
- // flag used by TileManager to avoid re-appending tiles that have already
- // been appended
- this._appended = false;
-
- // We keep tile objects around after their use for later reuse, so this
- // flags true for an unused pooled tile. We don't actually care about
- // this from within the Tile prototype, it is here for the cache to use.
- this.free = true;
- },
-
- // viewport coordinates
- get x() { return this.boundRect.left; },
- get y() { return this.boundRect.top; },
-
- // the actual canvas that holds the most recently rendered image of this
- // canvas
- getContentImage: function getContentImage() { return this._canvas; },
-
- isDirty: function isDirty() { return this._dirtyTileCanvas; },
-
- /**
- * Mark this entire tile as dirty (i.e. the whole tile needs to be rendered
- * on next render).
- */
- markDirty: function markDirty() { this.updateDirtyRegion(); },
-
- unmarkDirty: function unmarkDirty() {
- this._dirtyTileCanvasRect = null;
- this._dirtyTileCanvas = false;
- },
-
- /**
- * This will mark dirty at least everything in dirtyRect (which must be
- * specified in canvas coordinates). If dirtyRect is not given then
- * the entire tile is marked dirty.
- */
- updateDirtyRegion: function updateDirtyRegion(dirtyRect) {
- if (!dirtyRect) {
-
- if (!this._dirtyTileCanvasRect)
- this._dirtyTileCanvasRect = this.boundRect.clone();
- else
- this._dirtyTileCanvasRect.copyFrom(this.boundRect);
-
- } else if (!this._dirtyTileCanvasRect) {
- this._dirtyTileCanvasRect = dirtyRect.intersect(this.boundRect);
- } else if (dirtyRect.intersects(this.boundRect)) {
- this._dirtyTileCanvasRect.expandToContain(dirtyRect.intersect(this.boundRect));
- }
-
- // TODO if after the above, the dirty rectangle is large enough,
- // mark the whole tile dirty.
-
- if (this._dirtyTileCanvasRect)
- this._dirtyTileCanvas = true;
- },
-
- /**
- * Actually draw the browser content into the dirty region of this
- * tile. This requires us to actually draw with the
- * nsIDOMCanvasRenderingContext2D object's drawWindow method, which
- * we expect to be a relatively heavy operation.
- *
- * You likely want to check if the tile isDirty() before asking it
- * to render, as this will cause the entire tile to re-render in the
- * case that it is not dirty.
- */
- render: function render(browser, browserView) {
- if (!this.isDirty())
- this.markDirty();
-
- let rect = this._dirtyTileCanvasRect;
-
- let x = rect.left - this.boundRect.left;
- let y = rect.top - this.boundRect.top;
-
- // content process is not being scaled, so don't scale our rect either
- // browserView.viewportToBrowserRect(rect);
- // rect.round(); // snap outward to get whole "pixel" (in browser coords)
-
- let ctx = this._canvas.getContext("2d");
- ctx.save();
-
- browserView.browserToViewportCanvasContext(ctx);
-
- ctx.translate(x, y);
-
- let cw = browserView._contentWindow;
- // let cw = browser.contentWindow;
- ctx.asyncDrawXULElement(browserView._browser,
- rect.left, rect.top,
- rect.right - rect.left, rect.bottom - rect.top,
- "grey",
- (ctx.DRAWWINDOW_DO_NOT_FLUSH | ctx.DRAWWINDOW_DRAW_CARET));
-
- ctx.restore();
-
- this.unmarkDirty();
- },
-
- toString: function toString(more) {
- if (more) {
- return 'Tile(' + [this.i,
- this.j,
- "dirty=" + this.isDirty(),
- "boundRect=" + this.boundRect].join(', ')
- + ')';
- }
-
- return 'Tile(' + this.i + ', ' + this.j + ')';
- },
-
- _hold: function hold() { this.free = false; },
- _release: function release() { this.free = true; }
-
-};
-
-
-/**
- * A CrawlIterator is in charge of creating and returning subsequent tiles "crawled"
- * over as we render tiles lazily. It supports iterator semantics so you can use
- * CrawlIterator objects in for..in loops.
- *
- * Currently the CrawlIterator is built to expand a rectangle iteratively and return
- * subsequent tiles that intersect the boundary of the rectangle. Each expansion of
- * the rectangle is one unit of tile dimensions in each direction. This is repeated
- * until all tiles from elsewhere have been reused (assuming the cache has finite
- * capacity) in this crawl, so that we don't start reusing tiles from the beginning
- * of our crawl. Afterward, the CrawlIterator enters a state where it operates as a
- * FIFO queue, and calls to next() simply dequeue elements, which must be added with
- * enqueue().
- *
- * @param tileCache The TileCache over whose tiles this CrawlIterator will crawl
- * @param startRect [optional] The rectangle that we grow in the first (rectangle
- * expansion) iteration state.
- */
-TileManager.CrawlIterator = function CrawlIterator(tileCache, startRect) {
- this._tileCache = tileCache;
- this._stepRect = startRect;
-
- // used to remember tiles that we've reused during this crawl
- this._visited = {};
-
- // filters the tiles we've already reused once from being considered victims
- // for reuse when we ask the tile cache to create a new tile
- let visited = this._visited;
- this._notVisited = function(tile) { return !visited[tile]; };
-
- // a generator that generates tile indices corresponding to tiles intersecting
- // the boundary of an expanding rectangle
- this._crawlIndices = !startRect ? null : (function indicesGenerator(rect, tc) {
- let outOfBounds = false;
- while (!outOfBounds) {
- // expand rect
- rect.left -= kTileWidth;
- rect.right += kTileWidth;
- rect.top -= kTileHeight;
- rect.bottom += kTileHeight;
-
- let dx = (rect.right % kTileWidth) - (rect.left % kTileWidth);
- let dy = (rect.bottom % kTileHeight) - (rect.top % kTileHeight);
-
- outOfBounds = true;
-
- // top, bottom borders
- for (let y of [rect.top, rect.bottom]) {
- for (let x = rect.left; x <= rect.right - dx; x += kTileWidth) {
- let i = x >> kTileExponentWidth;
- let j = y >> kTileExponentHeight;
- if (tc.inBounds(i, j)) {
- outOfBounds = false;
- yield [i, j];
- }
- }
- }
-
- // left, right borders
- for (let x of [rect.left, rect.right]) {
- for (let y = rect.top; y <= rect.bottom - dy; y += kTileHeight) {
- let i = x >> kTileExponentWidth;
- let j = y >> kTileExponentHeight;
- if (tc.inBounds(i, j)) {
- outOfBounds = false;
- yield [i, j];
- }
- }
- }
- }
- })(this._stepRect, this._tileCache), // instantiate the generator
-
- // after we finish the rectangle iteration state, we enter the FIFO queue state
- this._queueState = !startRect;
- this._queue = [];
-
- // used to prevent tiles from being enqueued twice --- "patience, we'll get to
- // it in a moment"
- this._enqueued = {};
-};
-
-TileManager.CrawlIterator.prototype = {
- __iterator__: function*() {
- while (true) {
- let tile = this.next();
- if (!tile) break;
- yield tile;
- }
- },
-
- becomeQueue: function becomeQueue() {
- this._queueState = true;
- },
-
- unbecomeQueue: function unbecomeQueue() {
- this._queueState = false;
- },
-
- next: function next() {
- if (this._queueState)
- return this.dequeue();
-
- let tile = null;
-
- if (this._crawlIndices) {
- try {
- let [i, j] = this._crawlIndices.next();
- tile = this._tileCache.getTile(i, j, true, this._notVisited);
- } catch (e) {
- if (!(e instanceof StopIteration))
- throw e;
- }
- }
-
- if (tile) {
- this._visited[tile] = true;
- } else {
- this.becomeQueue();
- return this.next();
- }
-
- return tile;
- },
-
- dequeue: function dequeue() {
- let tile = null;
- do {
- let idx = this._queue.shift();
- if (!idx)
- return null;
-
- delete this._enqueued[idx];
- let [i, j] = this._unstrIndices(idx);
- tile = this._tileCache.getTile(i, j, false);
-
- } while (!tile);
-
- return tile;
- },
-
- enqueue: function enqueue(i, j) {
- let idx = this._strIndices(i, j);
- if (!this._enqueued[idx]) {
- this._queue.push(idx);
- this._enqueued[idx] = true;
- }
- },
-
- _strIndices: function _strIndices(i, j) {
- return i + "," + j;
- },
-
- _unstrIndices: function _unstrIndices(str) {
- return str.split(',');
- }
-
-};
diff --git a/toolkit/content/tests/fennec-tile-testapp/chrome/content/WidgetStack.js b/toolkit/content/tests/fennec-tile-testapp/chrome/content/WidgetStack.js
deleted file mode 100644
index 69288e725..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/WidgetStack.js
+++ /dev/null
@@ -1,1438 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var gWsDoLog = false;
-var gWsLogDiv = null;
-
-function logbase() {
- if (!gWsDoLog)
- return;
-
- if (gWsLogDiv == null && "console" in window) {
- console.log.apply(console, arguments);
- } else {
- var s = "";
- for (var i = 0; i < arguments.length; i++) {
- s += arguments[i] + " ";
- }
- s += "\n";
- if (gWsLogDiv) {
- gWsLogDiv.appendChild(document.createElementNS("http://www.w3.org/1999/xhtml", "br"));
- gWsLogDiv.appendChild(document.createTextNode(s));
- }
-
- dump(s);
- }
-}
-
-function dumpJSStack(stopAtNamedFunction) {
- let caller = Components.stack.caller;
- dump("\tStack: " + caller.name);
- while ((caller = caller.caller)) {
- dump(" <- " + caller.name);
- if (stopAtNamedFunction && caller.name != "anonymous")
- break;
- }
- dump("\n");
-}
-
-function log() {
- // logbase.apply(window, arguments);
-}
-
-function log2() {
- // logbase.apply(window, arguments);
-}
-
-var reportError = log;
-
-/*
- * wsBorder class
- *
- * Simple container for top,left,bottom,right "border" values
- */
-function wsBorder(t, l, b, r) {
- this.setBorder(t, l, b, r);
-}
-
-wsBorder.prototype = {
-
- setBorder: function (t, l, b, r) {
- this.top = t;
- this.left = l;
- this.bottom = b;
- this.right = r;
- },
-
- toString: function () {
- return "[l:" + this.left + ",t:" + this.top + ",r:" + this.right + ",b:" + this.bottom + "]";
- }
-};
-
-/*
- * wsRect class
- *
- * Rectangle class, with both x/y/w/h and t/l/b/r accessors.
- */
-function wsRect(x, y, w, h) {
- this.left = x;
- this.top = y;
- this.right = x+w;
- this.bottom = y+h;
-}
-
-wsRect.prototype = {
-
- get x() { return this.left; },
- get y() { return this.top; },
- get width() { return this.right - this.left; },
- get height() { return this.bottom - this.top; },
- set x(v) {
- let diff = this.left - v;
- this.left = v;
- this.right -= diff;
- },
- set y(v) {
- let diff = this.top - v;
- this.top = v;
- this.bottom -= diff;
- },
- set width(v) { this.right = this.left + v; },
- set height(v) { this.bottom = this.top + v; },
-
- setRect: function(x, y, w, h) {
- this.left = x;
- this.top = y;
- this.right = x+w;
- this.bottom = y+h;
-
- return this;
- },
-
- setBounds: function(t, l, b, r) {
- this.top = t;
- this.left = l;
- this.bottom = b;
- this.right = r;
-
- return this;
- },
-
- equals: function equals(r) {
- return (r != null &&
- this.top == r.top &&
- this.left == r.left &&
- this.bottom == r.bottom &&
- this.right == r.right);
- },
-
- clone: function clone() {
- return new wsRect(this.left, this.top, this.right - this.left, this.bottom - this.top);
- },
-
- center: function center() {
- return [this.left + (this.right - this.left) / 2,
- this.top + (this.bottom - this.top) / 2];
- },
-
- centerRounded: function centerRounded() {
- return this.center().map(Math.round);
- },
-
- copyFrom: function(r) {
- this.top = r.top;
- this.left = r.left;
- this.bottom = r.bottom;
- this.right = r.right;
-
- return this;
- },
-
- copyFromTLBR: function(r) {
- this.left = r.left;
- this.top = r.top;
- this.right = r.right;
- this.bottom = r.bottom;
-
- return this;
- },
-
- translate: function(x, y) {
- this.left += x;
- this.right += x;
- this.top += y;
- this.bottom += y;
-
- return this;
- },
-
- // return a new wsRect that is the union of that one and this one
- union: function(rect) {
- let l = Math.min(this.left, rect.left);
- let r = Math.max(this.right, rect.right);
- let t = Math.min(this.top, rect.top);
- let b = Math.max(this.bottom, rect.bottom);
-
- return new wsRect(l, t, r-l, b-t);
- },
-
- toString: function() {
- return "[" + this.x + "," + this.y + "," + this.width + "," + this.height + "]";
- },
-
- expandBy: function(b) {
- this.left += b.left;
- this.right += b.right;
- this.top += b.top;
- this.bottom += b.bottom;
- return this;
- },
-
- contains: function(other) {
- return !!(other.left >= this.left &&
- other.right <= this.right &&
- other.top >= this.top &&
- other.bottom <= this.bottom);
- },
-
- intersect: function(r2) {
- let xmost1 = this.right;
- let xmost2 = r2.right;
-
- let x = Math.max(this.left, r2.left);
-
- let temp = Math.min(xmost1, xmost2);
- if (temp <= x)
- return null;
-
- let width = temp - x;
-
- let ymost1 = this.bottom;
- let ymost2 = r2.bottom;
- let y = Math.max(this.top, r2.top);
-
- temp = Math.min(ymost1, ymost2);
- if (temp <= y)
- return null;
-
- let height = temp - y;
-
- return new wsRect(x, y, width, height);
- },
-
- intersects: function(other) {
- let xok = (other.left > this.left && other.left < this.right) ||
- (other.right > this.left && other.right < this.right) ||
- (other.left <= this.left && other.right >= this.right);
- let yok = (other.top > this.top && other.top < this.bottom) ||
- (other.bottom > this.top && other.bottom < this.bottom) ||
- (other.top <= this.top && other.bottom >= this.bottom);
- return xok && yok;
- },
-
- /**
- * Similar to (and most code stolen from) intersect(). A restriction
- * is an intersection, but this modifies the receiving object instead
- * of returning a new rect.
- */
- restrictTo: function restrictTo(r2) {
- let xmost1 = this.right;
- let xmost2 = r2.right;
-
- let x = Math.max(this.left, r2.left);
-
- let temp = Math.min(xmost1, xmost2);
- if (temp <= x)
- throw "Intersection is empty but rects cannot be empty";
-
- let width = temp - x;
-
- let ymost1 = this.bottom;
- let ymost2 = r2.bottom;
- let y = Math.max(this.top, r2.top);
-
- temp = Math.min(ymost1, ymost2);
- if (temp <= y)
- throw "Intersection is empty but rects cannot be empty";
-
- let height = temp - y;
-
- return this.setRect(x, y, width, height);
- },
-
- /**
- * Similar to (and most code stolen from) union(). An extension is a
- * union (in our sense of the term, not the common set-theoretic sense),
- * but this modifies the receiving object instead of returning a new rect.
- * Effectively, this rectangle is expanded minimally to contain all of the
- * other rect. "Expanded minimally" means that the rect may shrink if
- * given a strict subset rect as the argument.
- */
- expandToContain: function extendTo(rect) {
- let l = Math.min(this.left, rect.left);
- let r = Math.max(this.right, rect.right);
- let t = Math.min(this.top, rect.top);
- let b = Math.max(this.bottom, rect.bottom);
-
- return this.setRect(l, t, r-l, b-t);
- },
-
- round: function round(scale) {
- if (!scale) scale = 1;
-
- this.left = Math.floor(this.left * scale) / scale;
- this.top = Math.floor(this.top * scale) / scale;
- this.right = Math.ceil(this.right * scale) / scale;
- this.bottom = Math.ceil(this.bottom * scale) / scale;
-
- return this;
- },
-
- scale: function scale(xscl, yscl) {
- this.left *= xscl;
- this.right *= xscl;
- this.top *= yscl;
- this.bottom *= yscl;
-
- return this;
- }
-};
-
-/*
- * The "Widget Stack"
- *
- * Manages a <xul:stack>'s children, allowing them to be dragged around
- * the stack, subject to specified constraints. Optionally supports
- * one widget designated as the viewport, which can be panned over a virtual
- * area without needing to draw that area entirely. The viewport widget
- * is designated by a 'viewport' attribute on the child element.
- *
- * Widgets are subject to various constraints, specified in xul via the
- * 'constraint' attribute. Current constraints are:
- * ignore-x: When panning, ignore any changes to the widget's x position
- * ignore-y: When panning, ignore any changes to the widget's y position
- * vp-relative: This widget's position should be claculated relative to
- * the viewport widget. It will always keep the same offset from that
- * widget as initially laid out, regardless of changes to the viewport
- * bounds.
- * frozen: This widget is in a fixed position and should never pan.
- */
-function WidgetStack(el, ew, eh) {
- this.init(el, ew, eh);
-}
-
-WidgetStack.prototype = {
- // the <stack> element
- _el: null,
-
- // object indexed by widget id, with state struct for each object (see _addNewWidget)
- _widgetState: null,
-
- // any barriers
- _barriers: null,
-
- // If a viewport widget is present, this will point to its state object;
- // otherwise null.
- _viewport: null,
-
- // a wsRect; the inner bounds of the viewport content
- _viewportBounds: null,
- // a wsBorder; the overflow area to the side of the bounds where our
- // viewport-relative widgets go
- _viewportOverflow: null,
-
- // a wsRect; the viewportBounds expanded by the viewportOverflow
- _pannableBounds: null,
- get pannableBounds() {
- if (!this._pannableBounds) {
- this._pannableBounds = this._viewportBounds.clone()
- .expandBy(this._viewportOverflow);
- }
- return this._pannableBounds.clone();
- },
-
- // a wsRect; the currently visible part of pannableBounds.
- _viewingRect: null,
-
- // the amount of current global offset applied to all widgets (whether
- // static or not). Set via offsetAll(). Can be used to push things
- // out of the way for overlaying some other UI.
- globalOffsetX: 0,
- globalOffsetY: 0,
-
- // if true (default), panning is constrained to the pannable bounds.
- _constrainToViewport: true,
-
- _viewportUpdateInterval: -1,
- _viewportUpdateTimeout: -1,
-
- _viewportUpdateHandler: null,
- _panHandler: null,
-
- _dragState: null,
-
- _skipViewportUpdates: 0,
- _forceViewportUpdate: false,
-
- //
- // init:
- // el: the <stack> element whose children are to be managed
- //
- init: function (el, ew, eh) {
- this._el = el;
- this._widgetState = {};
- this._barriers = [];
-
- let rect = this._el.getBoundingClientRect();
- let width = rect.width;
- let height = rect.height;
-
- if (ew != undefined && eh != undefined) {
- width = ew;
- height = eh;
- }
-
- this._viewportOverflow = new wsBorder(0, 0, 0, 0);
-
- this._viewingRect = new wsRect(0, 0, width, height);
-
- // listen for DOMNodeInserted/DOMNodeRemoved/DOMAttrModified
- let children = this._el.childNodes;
- for (let i = 0; i < children.length; i++) {
- let c = this._el.childNodes[i];
- if (c.tagName == "spacer")
- this._addNewBarrierFromSpacer(c);
- else
- this._addNewWidget(c);
- }
-
- // this also updates the viewportOverflow and pannableBounds
- this._updateWidgets();
-
- if (this._viewport) {
- this._viewportBounds = new wsRect(0, 0, this._viewport.rect.width, this._viewport.rect.height);
- } else {
- this._viewportBounds = new wsRect(0, 0, 0, 0);
- }
- },
-
- // moveWidgetBy: move the widget with the given id by x,y. Should
- // not be used on vp-relative or otherwise frozen widgets (using it
- // on the x coordinate for x-ignore widgets and similarily for y is
- // ok, as long as the other coordinate remains 0.)
- moveWidgetBy: function (wid, x, y) {
- let state = this._getState(wid);
-
- state.rect.x += x;
- state.rect.y += y;
-
- this._commitState(state);
- },
-
- // panBy: pan the entire set of widgets by the given x and y amounts.
- // This does the same thing as if the user dragged by the given amount.
- // If this is called with an outstanding drag, weirdness might happen,
- // but it also might work, so not disabling that.
- //
- // if ignoreBarriers is true, then barriers are ignored for the pan.
- panBy: function panBy(dx, dy, ignoreBarriers) {
- dx = Math.round(dx);
- dy = Math.round(dy);
-
- if (dx == 0 && dy == 0)
- return false;
-
- let needsDragWrap = !this._dragging;
-
- if (needsDragWrap)
- this.dragStart(0, 0);
-
- let panned = this._panBy(dx, dy, ignoreBarriers);
-
- if (needsDragWrap)
- this.dragStop();
-
- return panned;
- },
-
- // panTo: pan the entire set of widgets so that the given x,y
- // coordinates are in the upper left of the stack. If either is
- // null or undefined, only move the other axis
- panTo: function panTo(x, y) {
- if (x == undefined || x == null)
- x = this._viewingRect.x;
- if (y == undefined || y == null)
- y = this._viewingRect.y;
- this.panBy(x - this._viewingRect.x, y - this._viewingRect.y, true);
- },
-
- // freeze: set a widget as frozen. A frozen widget won't be moved
- // in the stack -- its x,y position will still be tracked in the
- // state, but the left/top attributes won't be overwritten. Call unfreeze
- // to move the widget back to where the ws thinks it should be.
- freeze: function (wid) {
- let state = this._getState(wid);
-
- state.frozen = true;
- },
-
- unfreeze: function (wid) {
- let state = this._getState(wid);
- if (!state.frozen)
- return;
-
- state.frozen = false;
- this._commitState(state);
- },
-
- // moveFrozenTo: move a frozen widget with id wid to x, y in the stack.
- // can only be used on frozen widgets
- moveFrozenTo: function (wid, x, y) {
- let state = this._getState(wid);
- if (!state.frozen)
- throw "moveFrozenTo on non-frozen widget " + wid;
-
- state.widget.setAttribute("left", x);
- state.widget.setAttribute("top", y);
- },
-
- // moveUnfrozenTo: move an unfrozen, pannable widget with id wid to x, y in
- // the stack. should only be used on unfrozen widgets when a dynamic change
- // in position needs to be made. we basically remove, adjust and re-add
- // the widget
- moveUnfrozenTo: function (wid, x, y) {
- delete this._widgetState[wid];
- let widget = document.getElementById(wid);
- if (x) widget.setAttribute("left", x);
- if (y) widget.setAttribute("top", y);
- this._addNewWidget(widget);
- this._updateWidgets();
- },
-
- // we're relying on viewportBounds and viewingRect having the same origin
- get viewportVisibleRect () {
- let rect = this._viewportBounds.intersect(this._viewingRect);
- if (!rect)
- rect = new wsRect(0, 0, 0, 0);
- return rect;
- },
-
- isWidgetFrozen: function isWidgetFrozen(wid) {
- return this._getState(wid).frozen;
- },
-
- // isWidgetVisible: return true if any portion of widget with id wid is
- // visible; otherwise return false.
- isWidgetVisible: function (wid) {
- let state = this._getState(wid);
- let visibleStackRect = new wsRect(0, 0, this._viewingRect.width, this._viewingRect.height);
-
- return visibleStackRect.intersects(state.rect);
- },
-
- // getWidgetVisibility: returns the percentage that the widget is visible
- getWidgetVisibility: function (wid) {
- let state = this._getState(wid);
- let visibleStackRect = new wsRect(0, 0, this._viewingRect.width, this._viewingRect.height);
-
- let visibleRect = visibleStackRect.intersect(state.rect);
- if (visibleRect)
- return [visibleRect.width / state.rect.width, visibleRect.height / state.rect.height]
-
- return [0, 0];
- },
-
- // offsetAll: add an offset to all widgets
- offsetAll: function (x, y) {
- this.globalOffsetX += x;
- this.globalOffsetY += y;
-
- for (let wid in this._widgetState) {
- let state = this._widgetState[wid];
- state.rect.x += x;
- state.rect.y += y;
-
- this._commitState(state);
- }
- },
-
- // setViewportBounds
- // nb: an object containing top, left, bottom, right properties
- // OR
- // width, height: integer values; origin assumed to be 0,0
- // OR
- // top, left, bottom, right: integer values
- //
- // Set the bounds of the viewport area; that is, set the size of the
- // actual content that the viewport widget will be providing a view
- // over. For example, in the case of a 100x100 viewport showing a
- // view into a 100x500 webpage, the viewport bounds would be
- // { top: 0, left: 0, bottom: 500, right: 100 }.
- //
- // setViewportBounds will move all the viewport-relative widgets into
- // place based on the new viewport bounds.
- setViewportBounds: function setViewportBounds() {
- let oldBounds = this._viewportBounds.clone();
-
- if (arguments.length == 1) {
- this._viewportBounds.copyFromTLBR(arguments[0]);
- } else if (arguments.length == 2) {
- this._viewportBounds.setRect(0, 0, arguments[0], arguments[1]);
- } else if (arguments.length == 4) {
- this._viewportBounds.setBounds(arguments[0],
- arguments[1],
- arguments[2],
- arguments[3]);
- } else {
- throw "Invalid number of arguments to setViewportBounds";
- }
-
- let vp = this._viewport;
-
- let dleft = this._viewportBounds.left - oldBounds.left;
- let dright = this._viewportBounds.right - oldBounds.right;
- let dtop = this._viewportBounds.top - oldBounds.top;
- let dbottom = this._viewportBounds.bottom - oldBounds.bottom;
-
- // log2("setViewportBounds dltrb", dleft, dtop, dright, dbottom);
-
- // move all vp-relative widgets to be the right offset from the bounds again
- for (let wid in this._widgetState) {
- let state = this._widgetState[wid];
- if (state.vpRelative) {
- // log2("vpRelative widget", state.id, state.rect.x, dleft, dright);
- if (state.vpOffsetXBefore) {
- state.rect.x += dleft;
- } else {
- state.rect.x += dright;
- }
-
- if (state.vpOffsetYBefore) {
- state.rect.y += dtop;
- } else {
- state.rect.y += dbottom;
- }
-
- // log2("vpRelative widget", state.id, state.rect.x, dleft, dright);
- this._commitState(state);
- }
- }
-
- for (let bid in this._barriers) {
- let barrier = this._barriers[bid];
-
- // log2("setViewportBounds: looking at barrier", bid, barrier.vpRelative, barrier.type);
-
- if (barrier.vpRelative) {
- if (barrier.type == "vertical") {
- let q = "v barrier moving from " + barrier.x + " to ";
- if (barrier.vpOffsetXBefore) {
- barrier.x += dleft;
- } else {
- barrier.x += dright;
- }
- // log2(q += barrier.x);
- } else if (barrier.type == "horizontal") {
- let q = "h barrier moving from " + barrier.y + " to ";
- if (barrier.vpOffsetYBefore) {
- barrier.y += dtop;
- } else {
- barrier.y += dbottom;
- }
- // log2(q += barrier.y);
- }
- }
- }
-
- // clear the pannable bounds cache to make sure it gets rebuilt
- this._pannableBounds = null;
-
- // now let's make sure that the viewing rect and inner bounds are still valid
- this._adjustViewingRect();
-
- this._viewportUpdate(0, 0, true);
- },
-
- // setViewportHandler
- // uh: A function object
- //
- // The given function object is called at the end of every drag and viewport
- // bounds change, passing in the new rect that's to be displayed in the
- // viewport.
- //
- setViewportHandler: function (uh) {
- this._viewportUpdateHandler = uh;
- },
-
- // setPanHandler
- // uh: A function object
- //
- // The given functin object is called whenever elements pan; it provides
- // the new area of the pannable bounds that's visible in the stack.
- setPanHandler: function (uh) {
- this._panHandler = uh;
- },
-
- // dragStart: start a drag, with the current coordinates being clientX,clientY
- dragStart: function dragStart(clientX, clientY) {
- log("(dragStart)", clientX, clientY);
-
- if (this._dragState) {
- reportError("dragStart with drag already in progress? what?");
- this._dragState = null;
- }
-
- this._dragState = { };
-
- let t = Date.now();
-
- this._dragState.barrierState = [];
-
- this._dragState.startTime = t;
- // outer x, that is outer from the viewport coordinates. In stack-relative coords.
- this._dragState.outerStartX = clientX;
- this._dragState.outerStartY = clientY;
-
- this._dragCoordsFromClient(clientX, clientY, t);
-
- this._dragState.outerLastUpdateDX = 0;
- this._dragState.outerLastUpdateDY = 0;
-
- if (this._viewport) {
- // create a copy of these so that we can compute
- // deltas correctly to update the viewport
- this._viewport.dragStartRect = this._viewport.rect.clone();
- }
-
- this._dragState.dragging = true;
- },
-
- _viewportDragUpdate: function viewportDragUpdate() {
- let vws = this._viewport;
- this._viewportUpdate((vws.dragStartRect.x - vws.rect.x),
- (vws.dragStartRect.y - vws.rect.y));
- },
-
- // dragStop: stop any drag in progress
- dragStop: function dragStop() {
- log("(dragStop)");
-
- if (!this._dragging)
- return;
-
- if (this._viewportUpdateTimeout != -1)
- clearTimeout(this._viewportUpdateTimeout);
-
- this._viewportDragUpdate();
-
- this._dragState = null;
- },
-
- // dragMove: process a mouse move to clientX,clientY for an ongoing drag
- dragMove: function dragMove(clientX, clientY) {
- if (!this._dragging)
- return false;
-
- this._dragCoordsFromClient(clientX, clientY);
-
- let panned = this._dragUpdate();
-
- if (this._viewportUpdateInterval != -1) {
- if (this._viewportUpdateTimeout != -1)
- clearTimeout(this._viewportUpdateTimeout);
- let self = this;
- this._viewportUpdateTimeout = setTimeout(function () { self._viewportDragUpdate(); }, this._viewportUpdateInterval);
- }
-
- return panned;
- },
-
- // dragBy: process a mouse move by dx,dy for an ongoing drag
- dragBy: function dragBy(dx, dy) {
- return this.dragMove(this._dragState.outerCurX + dx, this._dragState.outerCurY + dy);
- },
-
- // updateSize: tell the WidgetStack to update its size, because it
- // was either resized or some other event took place.
- updateSize: function updateSize(width, height) {
- if (width == undefined || height == undefined) {
- let rect = this._el.getBoundingClientRect();
- width = rect.width;
- height = rect.height;
- }
-
- // update widget rects and viewportOverflow, since the resize might have
- // caused them to change (widgets first, since the viewportOverflow depends
- // on them).
-
- // XXX these methods aren't working correctly yet, but they aren't strictly
- // necessary in Fennec's default config
- // for (let wid in this._widgetState) {
- // let s = this._widgetState[wid];
- // this._updateWidgetRect(s);
- // }
- // this._updateViewportOverflow();
-
- this._viewingRect.width = width;
- this._viewingRect.height = height;
-
- // Wrap this call in a batch to ensure that we always call the
- // viewportUpdateHandler, even if _adjustViewingRect doesn't trigger a pan.
- // If it does, the batch also ensures that we don't call the handler twice.
- this.beginUpdateBatch();
- this._adjustViewingRect();
- this.endUpdateBatch();
- },
-
- beginUpdateBatch: function startUpdate() {
- if (!this._skipViewportUpdates) {
- this._startViewportBoundsString = this._viewportBounds.toString();
- this._forceViewportUpdate = false;
- }
- this._skipViewportUpdates++;
- },
-
- endUpdateBatch: function endUpdate(aForceRedraw) {
- if (!this._skipViewportUpdates)
- throw new Error("Unbalanced call to endUpdateBatch");
-
- this._forceViewportUpdate = this._forceViewportUpdate || aForceRedraw;
-
- this._skipViewportUpdates--;
- if (this._skipViewportUpdates)
- return;
-
- let boundsSizeChanged =
- this._startViewportBoundsString != this._viewportBounds.toString();
- this._callViewportUpdateHandler(boundsSizeChanged || this._forceViewportUpdate);
- },
-
- //
- // Internal code
- //
-
- _updateWidgetRect: function(state) {
- // don't need to support updating the viewport rect at the moment
- // (we'd need to duplicate the vptarget* code from _addNewWidget if we did)
- if (state == this._viewport)
- return;
-
- let w = state.widget;
- let x = w.getAttribute("left") || 0;
- let y = w.getAttribute("top") || 0;
- let rect = w.getBoundingClientRect();
- state.rect = new wsRect(parseInt(x), parseInt(y),
- rect.right - rect.left,
- rect.bottom - rect.top);
- if (w.hasAttribute("widgetwidth") && w.hasAttribute("widgetheight")) {
- state.rect.width = parseInt(w.getAttribute("widgetwidth"));
- state.rect.height = parseInt(w.getAttribute("widgetheight"));
- }
- },
-
- _dumpRects: function () {
- dump("WidgetStack:\n");
- dump("\tthis._viewportBounds: " + this._viewportBounds + "\n");
- dump("\tthis._viewingRect: " + this._viewingRect + "\n");
- dump("\tthis._viewport.viewportInnerBounds: " + this._viewport.viewportInnerBounds + "\n");
- dump("\tthis._viewport.rect: " + this._viewport.rect + "\n");
- dump("\tthis._viewportOverflow: " + this._viewportOverflow + "\n");
- dump("\tthis.pannableBounds: " + this.pannableBounds + "\n");
- },
-
- // Ensures that _viewingRect is within _pannableBounds (call this when either
- // one is resized)
- _adjustViewingRect: function _adjustViewingRect() {
- let vr = this._viewingRect;
- let pb = this.pannableBounds;
-
- if (pb.contains(vr))
- return; // nothing to do here
-
- // don't bother adjusting _viewingRect if it can't fit into
- // _pannableBounds
- if (vr.height > pb.height || vr.width > pb.width)
- return;
-
- let panX = 0, panY = 0;
- if (vr.right > pb.right)
- panX = pb.right - vr.right;
- else if (vr.left < pb.left)
- panX = pb.left - vr.left;
-
- if (vr.bottom > pb.bottom)
- panY = pb.bottom - vr.bottom;
- else if (vr.top < pb.top)
- panY = pb.top - vr.top;
-
- this.panBy(panX, panY, true);
- },
-
- _getState: function (wid) {
- let w = this._widgetState[wid];
- if (!w)
- throw "Unknown widget id '" + wid + "'; widget not in stack";
- return w;
- },
-
- get _dragging() {
- return this._dragState && this._dragState.dragging;
- },
-
- _viewportUpdate: function _viewportUpdate(dX, dY, boundsChanged) {
- if (!this._viewport)
- return;
-
- this._viewportUpdateTimeout = -1;
-
- let vws = this._viewport;
- let vwib = vws.viewportInnerBounds;
- let vpb = this._viewportBounds;
-
- // recover the amount the inner bounds moved by the amount the viewport
- // widget moved, but don't include offsets that we're making up from previous
- // drags that didn't affect viewportInnerBounds
- let [ignoreX, ignoreY] = this._offsets || [0, 0];
- let rx = dX - ignoreX;
- let ry = dY - ignoreY;
-
- [dX, dY] = this._rectTranslateConstrain(rx, ry, vwib, vpb);
-
- // record the offsets that correspond to the amount of the drag we're ignoring
- // to ensure the viewportInnerBounds remains within the viewportBounds
- this._offsets = [dX - rx, dY - ry];
-
- // adjust the viewportInnerBounds, and snap the viewport back
- vwib.translate(dX, dY);
- vws.rect.translate(dX, dY);
- this._commitState(vws);
-
- // update this so that we can call this function again during the same drag
- // and get the right values.
- vws.dragStartRect = vws.rect.clone();
-
- this._callViewportUpdateHandler(boundsChanged);
- },
-
- _callViewportUpdateHandler: function _callViewportUpdateHandler(boundsChanged) {
- if (!this._viewport || !this._viewportUpdateHandler || this._skipViewportUpdates)
- return;
-
- let vwb = this._viewportBounds.clone();
-
- let vwib = this._viewport.viewportInnerBounds.clone();
-
- let vis = this.viewportVisibleRect;
-
- vwib.left += this._viewport.offsetLeft;
- vwib.top += this._viewport.offsetTop;
- vwib.right += this._viewport.offsetRight;
- vwib.bottom += this._viewport.offsetBottom;
-
- this._viewportUpdateHandler.apply(window, [vwb, vwib, vis, boundsChanged]);
- },
-
- _dragCoordsFromClient: function (cx, cy, t) {
- this._dragState.curTime = t ? t : Date.now();
- this._dragState.outerCurX = cx;
- this._dragState.outerCurY = cy;
-
- let dx = this._dragState.outerCurX - this._dragState.outerStartX;
- let dy = this._dragState.outerCurY - this._dragState.outerStartY;
- this._dragState.outerDX = dx;
- this._dragState.outerDY = dy;
- },
-
- _panHandleBarriers: function (dx, dy) {
- // XXX unless the barriers are sorted by position, this will break
- // with multiple barriers that are near enough to eachother that a
- // drag could cross more than one.
-
- let vr = this._viewingRect;
-
- // XXX this just stops at the first horizontal and vertical barrier it finds
-
- // barrier_[xy] is the barrier that was used to get to the final
- // barrier_d[xy] value. if null, no barrier, and dx/dy shouldn't
- // be replaced with barrier_d[xy].
- let barrier_y = null, barrier_x = null;
- let barrier_dy = 0, barrier_dx = 0;
-
- for (let i = 0; i < this._barriers.length; i++) {
- let b = this._barriers[i];
-
- // log2("barrier", i, b.type, b.x, b.y);
-
- if (dx != 0 && b.type == "vertical") {
- if (barrier_x != null) {
- delete this._dragState.barrierState[i];
- continue;
- }
-
- let alreadyKnownDistance = this._dragState.barrierState[i] || 0;
-
- // log2("alreadyKnownDistance", alreadyKnownDistance);
-
- let dbx = 0;
-
- // 100 <= 100 && 100-(-5) > 100
-
- if ((vr.left <= b.x && vr.left+dx > b.x) ||
- (vr.left >= b.x && vr.left+dx < b.x))
- {
- dbx = b.x - vr.left;
- } else if ((vr.right <= b.x && vr.right+dx > b.x) ||
- (vr.right >= b.x && vr.right+dx < b.x))
- {
- dbx = b.x - vr.right;
- } else {
- delete this._dragState.barrierState[i];
- continue;
- }
-
- let leftoverDistance = dbx - dx;
-
- // log2("initial dbx", dbx, leftoverDistance);
-
- let dist = Math.abs(leftoverDistance + alreadyKnownDistance) - b.size;
-
- if (dist >= 0) {
- if (dx < 0)
- dbx -= dist;
- else
- dbx += dist;
- delete this._dragState.barrierState[i];
- } else {
- dbx = 0;
- this._dragState.barrierState[i] = leftoverDistance + alreadyKnownDistance;
- }
-
- // log2("final dbx", dbx, "state", this._dragState.barrierState[i]);
-
- if (Math.abs(barrier_dx) <= Math.abs(dbx)) {
- barrier_x = b;
- barrier_dx = dbx;
-
- // log2("new barrier_dx", barrier_dx);
- }
- }
-
- if (dy != 0 && b.type == "horizontal") {
- if (barrier_y != null) {
- delete this._dragState.barrierState[i];
- continue;
- }
-
- let alreadyKnownDistance = this._dragState.barrierState[i] || 0;
-
- // log2("alreadyKnownDistance", alreadyKnownDistance);
-
- let dby = 0;
-
- // 100 <= 100 && 100-(-5) > 100
-
- if ((vr.top <= b.y && vr.top+dy > b.y) ||
- (vr.top >= b.y && vr.top+dy < b.y))
- {
- dby = b.y - vr.top;
- } else if ((vr.bottom <= b.y && vr.bottom+dy > b.y) ||
- (vr.bottom >= b.y && vr.bottom+dy < b.y))
- {
- dby = b.y - vr.bottom;
- } else {
- delete this._dragState.barrierState[i];
- continue;
- }
-
- let leftoverDistance = dby - dy;
-
- // log2("initial dby", dby, leftoverDistance);
-
- let dist = Math.abs(leftoverDistance + alreadyKnownDistance) - b.size;
-
- if (dist >= 0) {
- if (dy < 0)
- dby -= dist;
- else
- dby += dist;
- delete this._dragState.barrierState[i];
- } else {
- dby = 0;
- this._dragState.barrierState[i] = leftoverDistance + alreadyKnownDistance;
- }
-
- // log2("final dby", dby, "state", this._dragState.barrierState[i]);
-
- if (Math.abs(barrier_dy) <= Math.abs(dby)) {
- barrier_y = b;
- barrier_dy = dby;
-
- // log2("new barrier_dy", barrier_dy);
- }
- }
- }
-
- if (barrier_x) {
- // log2("did barrier_x", barrier_x, "barrier_dx", barrier_dx);
- dx = barrier_dx;
- }
-
- if (barrier_y) {
- dy = barrier_dy;
- }
-
- return [dx, dy];
- },
-
- _panBy: function _panBy(dx, dy, ignoreBarriers) {
- let vr = this._viewingRect;
-
- // check if any barriers would be crossed by this pan, and take them
- // into account. do this first.
- if (!ignoreBarriers)
- [dx, dy] = this._panHandleBarriers(dx, dy);
-
- // constrain the full drag of the viewingRect to the pannableBounds.
- // note that the viewingRect needs to move in the opposite
- // direction of the pan, so we fiddle with the signs here (as you
- // pan to the upper left, more of the bottom right becomes visible,
- // so the viewing rect moves to the bottom right of the virtual surface).
- [dx, dy] = this._rectTranslateConstrain(dx, dy, vr, this.pannableBounds);
-
- // If the net result is that we don't have any room to move, then
- // just return.
- if (dx == 0 && dy == 0)
- return false;
-
- // the viewingRect moves opposite of the actual pan direction, see above
- vr.x += dx;
- vr.y += dy;
-
- // Go through each widget and move it by dx,dy. Frozen widgets
- // will be ignored in commitState.
- // The widget rects are in real stack space though, so we need to subtract
- // our (now negated) dx, dy from their coordinates.
- for (let wid in this._widgetState) {
- let state = this._widgetState[wid];
- if (!state.ignoreX)
- state.rect.x -= dx;
- if (!state.ignoreY)
- state.rect.y -= dy;
-
- this._commitState(state);
- }
-
- /* Do not call panhandler during pans within a transaction.
- * Those pans always end-up covering up the checkerboard and
- * do not require sliding out the location bar
- */
- if (!this._skipViewportUpdates && this._panHandler)
- this._panHandler.apply(window, [vr.clone(), dx, dy]);
-
- return true;
- },
-
- _dragUpdate: function _dragUpdate() {
- let dx = this._dragState.outerLastUpdateDX - this._dragState.outerDX;
- let dy = this._dragState.outerLastUpdateDY - this._dragState.outerDY;
-
- this._dragState.outerLastUpdateDX = this._dragState.outerDX;
- this._dragState.outerLastUpdateDY = this._dragState.outerDY;
-
- return this.panBy(dx, dy);
- },
-
- //
- // widget addition/removal
- //
- _addNewWidget: function (w) {
- let wid = w.getAttribute("id");
- if (!wid) {
- reportError("WidgetStack: child widget without id!");
- return;
- }
-
- if (w.getAttribute("hidden") == "true")
- return;
-
- let state = {
- widget: w,
- id: wid,
-
- viewport: false,
- ignoreX: false,
- ignoreY: false,
- sticky: false,
- frozen: false,
- vpRelative: false,
-
- offsetLeft: 0,
- offsetTop: 0,
- offsetRight: 0,
- offsetBottom: 0
- };
-
- this._updateWidgetRect(state);
-
- if (w.hasAttribute("constraint")) {
- let cs = w.getAttribute("constraint").split(",");
- for (let s of cs) {
- if (s == "ignore-x")
- state.ignoreX = true;
- else if (s == "ignore-y")
- state.ignoreY = true;
- else if (s == "sticky")
- state.sticky = true;
- else if (s == "frozen") {
- state.frozen = true;
- } else if (s == "vp-relative")
- state.vpRelative = true;
- }
- }
-
- if (w.hasAttribute("viewport")) {
- if (this._viewport)
- reportError("WidgetStack: more than one viewport canvas in stack!");
-
- this._viewport = state;
- state.viewport = true;
-
- if (w.hasAttribute("vptargetx") && w.hasAttribute("vptargety") &&
- w.hasAttribute("vptargetw") && w.hasAttribute("vptargeth"))
- {
- let wx = parseInt(w.getAttribute("vptargetx"));
- let wy = parseInt(w.getAttribute("vptargety"));
- let ww = parseInt(w.getAttribute("vptargetw"));
- let wh = parseInt(w.getAttribute("vptargeth"));
-
- state.offsetLeft = state.rect.left - wx;
- state.offsetTop = state.rect.top - wy;
- state.offsetRight = state.rect.right - (wx + ww);
- state.offsetBottom = state.rect.bottom - (wy + wh);
-
- state.rect = new wsRect(wx, wy, ww, wh);
- }
-
- // initialize inner bounds to top-left
- state.viewportInnerBounds = new wsRect(0, 0, state.rect.width, state.rect.height);
- }
-
- this._widgetState[wid] = state;
-
- log ("(New widget: " + wid + (state.viewport ? " [viewport]" : "") + " at: " + state.rect + ")");
- },
-
- _removeWidget: function (w) {
- let wid = w.getAttribute("id");
- delete this._widgetState[wid];
- this._updateWidgets();
- },
-
- // updateWidgets:
- // Go through all the widgets and figure out their viewport-relative offsets.
- // If the widget goes to the left or above the viewport widget, then
- // vpOffsetXBefore or vpOffsetYBefore is set.
- // See setViewportBounds for use of vpOffset* state variables, and for how
- // the actual x and y coords of each widget are calculated based on their offsets
- // and the viewport bounds.
- _updateWidgets: function () {
- let vp = this._viewport;
-
- let ofRect = this._viewingRect.clone();
-
- for (let wid in this._widgetState) {
- let state = this._widgetState[wid];
- if (vp && state.vpRelative) {
- // compute the vpOffset from 0,0 assuming that the viewport rect is 0,0
- if (state.rect.left >= vp.rect.right) {
- state.vpOffsetXBefore = false;
- state.vpOffsetX = state.rect.left - vp.rect.width;
- } else {
- state.vpOffsetXBefore = true;
- state.vpOffsetX = state.rect.left - vp.rect.left;
- }
-
- if (state.rect.top >= vp.rect.bottom) {
- state.vpOffsetYBefore = false;
- state.vpOffsetY = state.rect.top - vp.rect.height;
- } else {
- state.vpOffsetYBefore = true;
- state.vpOffsetY = state.rect.top - vp.rect.top;
- }
-
- log("widget", state.id, "offset", state.vpOffsetX, state.vpOffsetXBefore ? "b" : "a", state.vpOffsetY, state.vpOffsetYBefore ? "b" : "a", "rect", state.rect);
- }
- }
-
- this._updateViewportOverflow();
- },
-
- // updates the viewportOverflow/pannableBounds
- _updateViewportOverflow: function() {
- let vp = this._viewport;
- if (!vp)
- return;
-
- let ofRect = new wsRect(0, 0, this._viewingRect.width, this._viewingRect.height);
-
- for (let wid in this._widgetState) {
- let state = this._widgetState[wid];
- if (vp && state.vpRelative) {
- ofRect.left = Math.min(ofRect.left, state.rect.left);
- ofRect.top = Math.min(ofRect.top, state.rect.top);
- ofRect.right = Math.max(ofRect.right, state.rect.right);
- ofRect.bottom = Math.max(ofRect.bottom, state.rect.bottom);
- }
- }
-
- // prevent the viewportOverflow from having positive top/left or negative
- // bottom/right values, which would otherwise happen if there aren't widgets
- // beyond each of those edges
- this._viewportOverflow = new wsBorder(
- /* top*/ Math.round(Math.min(ofRect.top, 0)),
- /* left*/ Math.round(Math.min(ofRect.left, 0)),
- /* bottom*/ Math.round(Math.max(ofRect.bottom - vp.rect.height, 0)),
- /* right*/ Math.round(Math.max(ofRect.right - vp.rect.width, 0))
- );
-
- // clear the _pannableBounds cache, since it depends on the
- // viewportOverflow
- this._pannableBounds = null;
- },
-
- _widgetBounds: function () {
- let r = new wsRect(0, 0, 0, 0);
-
- for (let wid in this._widgetState) {
- let state = this._widgetState[wid];
- r = r.union(state.rect);
- }
-
- return r;
- },
-
- _commitState: function (state) {
- // if the widget is frozen, don't actually update its left/top;
- // presumably the caller is managing those directly for now.
- if (state.frozen)
- return;
- let w = state.widget;
- let l = state.rect.x + state.offsetLeft;
- let t = state.rect.y + state.offsetTop;
-
- // cache left/top to avoid calling setAttribute unnessesarily
- if (state._left != l) {
- state._left = l;
- w.setAttribute("left", l);
- }
-
- if (state._top != t) {
- state._top = t;
- w.setAttribute("top", t);
- }
- },
-
- // constrain translate of rect by dx dy to bounds; return dx dy that can
- // be used to bring rect up to the edge of bounds if we'd go over.
- _rectTranslateConstrain: function (dx, dy, rect, bounds) {
- let newX, newY;
-
- // If the rect is larger than the bounds, allow it to increase its overlap
- let woverflow = rect.width > bounds.width;
- let hoverflow = rect.height > bounds.height;
- if (woverflow || hoverflow) {
- let intersection = rect.intersect(bounds);
- let newIntersection = rect.clone().translate(dx, dy).intersect(bounds);
- if (woverflow)
- newX = (newIntersection.width > intersection.width) ? rect.x + dx : rect.x;
- if (hoverflow)
- newY = (newIntersection.height > intersection.height) ? rect.y + dy : rect.y;
- }
-
- // Common case, rect fits within the bounds
- // clamp new X to within [bounds.left, bounds.right - rect.width],
- // new Y to within [bounds.top, bounds.bottom - rect.height]
- if (isNaN(newX))
- newX = Math.min(Math.max(bounds.left, rect.x + dx), bounds.right - rect.width);
- if (isNaN(newY))
- newY = Math.min(Math.max(bounds.top, rect.y + dy), bounds.bottom - rect.height);
-
- return [newX - rect.x, newY - rect.y];
- },
-
- // add a new barrier from a <spacer>
- _addNewBarrierFromSpacer: function (el) {
- let t = el.getAttribute("barriertype");
-
- // XXX implement these at some point
- // t != "lr" && t != "rl" &&
- // t != "tb" && t != "bt" &&
-
- if (t != "horizontal" &&
- t != "vertical")
- {
- throw "Invalid barrier type: " + t;
- }
-
- let x, y;
-
- let barrier = {};
- let vp = this._viewport;
-
- barrier.type = t;
-
- if (el.getAttribute("left"))
- barrier.x = parseInt(el.getAttribute("left"));
- else if (el.getAttribute("top"))
- barrier.y = parseInt(el.getAttribute("top"));
- else
- throw "Barrier without top or left attribute";
-
- if (el.getAttribute("size"))
- barrier.size = parseInt(el.getAttribute("size"));
- else
- barrier.size = 10;
-
- if (el.hasAttribute("constraint")) {
- let cs = el.getAttribute("constraint").split(",");
- for (let s of cs) {
- if (s == "ignore-x")
- barrier.ignoreX = true;
- else if (s == "ignore-y")
- barrier.ignoreY = true;
- else if (s == "sticky")
- barrier.sticky = true;
- else if (s == "frozen") {
- barrier.frozen = true;
- } else if (s == "vp-relative")
- barrier.vpRelative = true;
- }
- }
-
- if (barrier.vpRelative) {
- if (barrier.type == "vertical") {
- if (barrier.x >= vp.rect.right) {
- barrier.vpOffsetXBefore = false;
- barrier.vpOffsetX = barrier.x - vp.rect.right;
- } else {
- barrier.vpOffsetXBefore = true;
- barrier.vpOffsetX = barrier.x - vp.rect.left;
- }
- } else if (barrier.type == "horizontal") {
- if (barrier.y >= vp.rect.bottom) {
- barrier.vpOffsetYBefore = false;
- barrier.vpOffsetY = barrier.y - vp.rect.bottom;
- } else {
- barrier.vpOffsetYBefore = true;
- barrier.vpOffsetY = barrier.y - vp.rect.top;
- }
-
- // log2("h barrier relative", barrier.vpOffsetYBefore, barrier.vpOffsetY);
- }
- }
-
- this._barriers.push(barrier);
- }
-};
diff --git a/toolkit/content/tests/fennec-tile-testapp/chrome/content/firefoxOverlay.xul b/toolkit/content/tests/fennec-tile-testapp/chrome/content/firefoxOverlay.xul
deleted file mode 100644
index 612f8bb9f..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/firefoxOverlay.xul
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet href="chrome://tile/skin/overlay.css" type="text/css"?>
-<!DOCTYPE overlay SYSTEM "chrome://tile/locale/tile.dtd">
-<overlay id="tile-overlay"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script src="overlay.js"/>
- <stringbundleset id="stringbundleset">
- <stringbundle id="tile-strings" src="chrome://tile/locale/tile.properties"/>
- </stringbundleset>
-
- <menupopup id="menu_ToolsPopup">
- <menuitem id="tile-hello" label="&tile.label;"
- oncommand="tile.onMenuItemCommand(event);"/>
- </menupopup>
-</overlay>
diff --git a/toolkit/content/tests/fennec-tile-testapp/chrome/content/foo.xul b/toolkit/content/tests/fennec-tile-testapp/chrome/content/foo.xul
deleted file mode 100644
index cdc01658a..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/foo.xul
+++ /dev/null
@@ -1,460 +0,0 @@
-<window
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:html="http://www.w3.org/1999/xhtml"
- onload="onAlmostLoad();"
- style="background-color:white;"
- width="800"
- height="480"
- onresize="onResize();"
- onkeypress="onKeyPress(event);">
-
-<script type="application/javascript" src="WidgetStack.js"/>
-<script type="application/javascript" src="TileManager.js"/>
-<script type="application/javascript" src="BrowserView.js"/>
-<script type="application/javascript">
-<![CDATA[
-
-// We do not endorse the use of globals, but this is just a closed lab
-// environment. What could possibly go wrong? ...
-let bv = null;
-let scrollbox = null;
-let leftbar = null;
-let rightbar = null;
-let topbar = null;
-
-function debug() {
- let w = scrollbox.scrolledWidth;
- let h = scrollbox.scrolledHeight;
- let container = document.getElementById("tile_container");
- let [x, y] = getScrollboxPosition();
- if (bv) {
- dump('----------------------DEBUG!-------------------------\n');
- dump(bv._browserViewportState.toString() + endl);
-
- dump(endl);
-
- let cr = bv._tileManager._criticalRect;
- dump('criticalRect from BV: ' + (cr ? cr.toString() : null) + endl);
- dump('visibleRect from BV : ' + bv._visibleRect.toString() + endl);
- dump('visibleRect from foo: ' + scrollboxToViewportRect(getVisibleRect()) + endl);
-
- dump(endl);
-
- dump('container width,height from BV: ' + bv._container.style.width + ', '
- + bv._container.style.height + endl);
- dump('container width,height via DOM: ' + container.style.width + ', '
- + container.style.height + endl);
-
- dump(endl);
-
- dump('scrollbox position : ' + x + ', ' + y + endl);
- dump('scrollbox scrolledsize: ' + w + ', ' + h + endl);
-
- dump(endl);
-
- dump('tilecache capacity: ' + bv._tileManager._tileCache.getCapacity() + endl);
- dump('tilecache size : ' + bv._tileManager._tileCache.size + endl);
- dump('tilecache numFree : ' + bv._tileManager._tileCache.numFree + endl);
- dump('tilecache iBound : ' + bv._tileManager._tileCache.iBound + endl);
- dump('tilecache jBound : ' + bv._tileManager._tileCache.jBound + endl);
- dump('tilecache _lru : ' + bv._tileManager._tileCache._lru + endl);
-
- dump('-----------------------------------------------------\n');
- }
-}
-
-function debugTile(i, j) {
- let tc = bv._tileManager._tileCache;
- let t = tc.getTile(i, j);
-
- dump('------ DEBUGGING TILE (' + i + ',' + j + ') --------\n');
-
- dump('in bounds: ' + tc.inBounds(i, j) + endl);
- dump('occupied : ' + tc._isOccupied(i, j) + endl);
- if (t)
- {
- dump('toString : ' + t.toString(true) + endl);
- dump('free : ' + t.free + endl);
- dump('dirtyRect: ' + t._dirtyTileCanvasRect + endl);
-
- let len = tc._tilePool.length;
- for (let k = 0; k < len; ++k)
- if (tc._tilePool[k] === t)
- dump('found in tilePool at index ' + k + endl);
- }
-
- dump('------------------------------------\n');
-}
-
-function onKeyPress(e) {
- const a = 97; // debug all critical tiles
- const c = 99; // set tilecache capacity
- const d = 100; // debug dump
- const f = 102; // run noop() through forEachIntersectingRect (for timing)
- const i = 105; // toggle info click mode
- const l = 108; // restart lazy crawl
- const m = 109; // fix mouseout
- const t = 116; // debug given list of tiles separated by space
-
- switch (e.charCode) {
- case d:
- debug();
-
- break;
- case l:
- bv._tileManager.restartLazyCrawl(bv._tileManager._criticalRect);
-
- break;
- case c:
- let cap = parseInt(window.prompt('new capacity'));
- bv._tileManager._tileCache.setCapacity(cap);
-
- break;
- case f:
- let noop = function noop() { for (let i = 0; i < 10; ++i); };
- bv._tileManager._tileCache.forEachIntersectingRect(bv._tileManager._criticalRect,
- false, noop, window);
-
- break;
- case t:
- let ijstrs = window.prompt('row,col plz').split(' ');
- for (let ijstr of ijstrs) {
- let [i, j] = ijstr.split(',').map(x => parseInt(x));
- debugTile(i, j);
- }
-
- break;
- case a:
- let cr = bv._tileManager._criticalRect;
- dump('>>>>>> critical rect is ' + (cr ? cr.toString() : cr) + endl);
- if (cr) {
- let starti = cr.left >> kTileExponentWidth;
- let endi = cr.right >> kTileExponentWidth;
-
- let startj = cr.top >> kTileExponentHeight;
- let endj = cr.bottom >> kTileExponentHeight;
-
- for (var jj = startj; jj <= endj; ++jj)
- for (var ii = starti; ii <= endi; ++ii)
- debugTile(ii, jj);
- }
-
- break;
- case i:
- window.infoMode = !window.infoMode;
- break;
- case m:
- onMouseUp();
- break;
- default:
- break;
- }
-}
-
-function onResize(e) {
- if (bv) {
- bv.beginBatchOperation();
- bv.setVisibleRect(scrollboxToViewportRect(getVisibleRect()));
- bv.zoomToPage();
- bv.commitBatchOperation();
- }
-}
-
-function onMouseDown(e) {
- if (window.infoMode) {
- let [basex, basey] = getScrollboxPosition();
- let [x, y] = scrollboxToViewportXY(basex + e.clientX, basey + e.clientY);
- let i = x >> kTileExponentWidth;
- let j = y >> kTileExponentHeight;
-
- debugTile(i, j);
- }
-
- window._isDragging = true;
- window._dragStart = {x: e.clientX, y: e.clientY};
-
- bv.pauseRendering();
-}
-
-function onMouseUp() {
- window._isDragging = false;
- bv.resumeRendering();
-}
-
-function onMouseMove(e) {
- if (window._isDragging) {
- let x = scrollbox.positionX;
- let y = scrollbox.positionY;
- let w = scrollbox.scrolledWidth;
- let h = scrollbox.scrolledHeight;
-
- let dx = window._dragStart.x - e.clientX;
- let dy = window._dragStart.y - e.clientY;
-
- // XXX if max(x, 0) > scrollwidth we shouldn't do anything (same for y/height)
- let newX = Math.max(x + dx, 0);
- let newY = Math.max(y + dy, 0);
-
- if (newX < w || newY < h) {
- // clip dx and dy to prevent us from going below 0
- dx = Math.max(dx, -x);
- dy = Math.max(dy, -y);
-
- let oldx = x;
- let oldy = y;
-
- bv.onBeforeVisibleMove(dx, dy);
-
- updateBars(oldx, oldy, dx, dy);
- scrollbox.scrollBy(dx, dy);
-
- let [newx, newy] = getScrollboxPosition();
- let realdx = newx - oldx;
- let realdy = newy - oldy;
-
- updateBars(oldx, oldy, realdx, realdy);
- bv.onAfterVisibleMove(realdx, realdy);
- }
- window._dragStart = {x: e.clientX, y: e.clientY};
- }
-}
-
-function onAlmostLoad() {
- window._isDragging = false;
- window.infoMode = false;
- window.setTimeout(onLoad, 1500);
-}
-
-function onLoad() {
- // ----------------------------------------------------
- scrollbox = document.getElementById("scrollbox").boxObject;
- leftbar = document.getElementById("left_sidebar");
- rightbar = document.getElementById("right_sidebar");
- topbar = document.getElementById("top_urlbar");
- // ----------------------------------------------------
-
- let initX = Math.round(leftbar.getBoundingClientRect().right);
- dump('scrolling to ' + initX + endl);
- scrollbox.scrollTo(initX, 0);
- let [x, y] = getScrollboxPosition();
- dump(' scrolled to ' + x + ',' + y + endl);
-
- let container = document.getElementById("tile_container");
- container.addEventListener("mousedown", onMouseDown, true);
- container.addEventListener("mouseup", onMouseUp, true);
- container.addEventListener("mousemove", onMouseMove, true);
-
- bv = new BrowserView(container, scrollboxToViewportRect(getVisibleRect()));
-
- let browser = document.getElementById("googlenews");
- bv.setBrowser(browser, false);
-}
-
-function updateBars(x, y, dx, dy) {
-return;
- // shouldn't update margin if it doesn't need to be changed
- let sidebars = document.getElementsByClassName("sidebar");
- for (let i = 0; i < sidebars.length; i++) {
- let sidebar = sidebars[i];
- sidebar.style.margin = (y + dy) + "px 0px 0px 0px";
- }
-
- let urlbar = document.getElementById("top_urlbar");
- urlbar.style.margin = "0px 0px 0px " + (x + dx) + "px";
-}
-
-function viewportToScrollboxXY(x, y) {
- return scrollboxToViewportXY(x, y, -1);
-}
-
-function scrollboxToViewportXY(x, y) {
- if (!x) x = 0;
- if (!y) y = 0;
-
- // shield your eyes!
- let direction = (arguments.length >= 3) ? arguments[2] : 1;
-
- let leftbarcr = leftbar.getBoundingClientRect();
- let rightbarcr = rightbar.getBoundingClientRect();
- let topbarcr = topbar.getBoundingClientRect();
-
- let xtrans = direction * (-leftbarcr.width);
- let ytrans = direction * (-topbarcr.height);
- x += xtrans;
- y += ytrans;
-
- return [x, y];
-}
-
-function scrollboxToBrowserXY(browserView, x, y) {
- [x, y] = scrollboxToViewportXY(x, y);
- return [browserView.viewportToBrowser(x),
- browserView.viewportToBrowser(y)];
-}
-
-function scrollboxToViewportRect(rect) {
- let leftbarcr = leftbar.getBoundingClientRect();
- let topbarcr = topbar.getBoundingClientRect();
-
- let xtrans = -leftbarcr.width;
- let ytrans = -topbarcr.height;
-
- rect.translate(xtrans, ytrans);
-
- return rect;
-}
-
-function getScrollboxPosition() {
- return [scrollbox.positionX, scrollbox.positionY];
-}
-
-function getContentScrollValues(browser) {
- let cwu = getBrowserDOMWindowUtils(browser);
- let scrollX = {};
- let scrollY = {};
- cwu.getScrollXY(false, scrollX, scrollY);
-
- return [scrollX.value, scrollY.value];
-}
-
-function getBrowserDOMWindowUtils(browser) {
- return browser.contentWindow
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils);
-}
-
-function getBrowserClientRect(browser, el) {
- let [scrollX, scrollY] = getContentScrollValues(browser);
- let r = el.getBoundingClientRect();
-
- return new wsRect(r.left + scrollX,
- r.top + scrollY,
- r.width, r.height);
-}
-
-function scrollToElement(browser, el) {
- var elRect = getPagePosition(browser, el);
- bv.browserToViewportRect(elRect);
- elRect.round();
- this.scrollTo(elRect.x, elRect.y);
-}
-
-function zoomToElement(aElement) {
- const margin = 15;
-
- let elRect = getBrowserClientRect(browser, aElement);
- let elWidth = elRect.width;
- let vrWidth = bv.visibleRect.width;
- /* Try to set zoom-level such that once zoomed element is as wide
- * as the visible rect */
- let zoomLevel = vrtWidth / (elWidth + (2 * margin));
-
- bv.beginBatchOperation();
-
- bv.setZoomLevel(zoomLevel);
-
- /* If zoomLevel ends up clamped to less than asked for, calculate
- * how many more screen pixels will fit horizontally in addition to
- * element's width. This ensures that more of the webpage is
- * showing instead of the navbar. Bug 480595. */
- let xpadding = Math.max(margin, vrWidth - bv.browserToViewport(elWidth));
-
- // XXX TODO these arguments are wrong, we still have to transform the coordinates
- // from viewport to scrollbox before sending them to scrollTo
- this.scrollTo(Math.floor(Math.max(bv.browserToViewport(elRect.x) - xpadding, 0)),
- Math.floor(Math.max(bv.browserToViewport(elRect.y) - margin, 0)));
-
- bv.commitBatchOperation();
-}
-
-function zoomFromElement(browser, aElement) {
- let elRect = getBrowserClientRect(browser, aElement);
-
- bv.beginBatchOperation();
-
- // pan to the element
- // don't bother with x since we're zooming all the way out
- bv.zoomToPage();
-
- // XXX have this center the element on the page
- // XXX TODO these arguments are wrong, we still have to transform the coordinates
- // from viewport to scrollbox before sending them to scrollTo
- this.scrollTo(0, Math.floor(Math.max(0, bv.browserToViewport(elRect.y))));
-
- bv.commitBatchOperation();
-}
-
-/**
- * Retrieve the content element for a given point in client coordinates
- * (relative to the top left corner of the chrome window).
- */
-function elementFromPoint(browser, browserView, x, y) {
- [x, y] = scrollboxToBrowserXY(browserView, x, y);
- let cwu = getBrowserDOMWindowUtils(browser);
- return cwu.elementFromPoint(x, y,
- true, /* ignore root scroll frame*/
- false); /* don't flush layout */
-}
-
-/* ensures that a given content element is visible */
-function ensureElementIsVisible(browser, aElement) {
- let elRect = getBrowserClientRect(browser, aElement);
-
- bv.browserToViewportRect(elRect);
-
- let curRect = bv.visibleRect;
- let newx = curRect.x;
- let newy = curRect.y;
-
- if (elRect.x < curRect.x || elRect.width > curRect.width) {
- newx = elRect.x;
- } else if (elRect.x + elRect.width > curRect.x + curRect.width) {
- newx = elRect.x - curRect.width + elRect.width;
- }
-
- if (elRect.y < curRect.y || elRect.height > curRect.height) {
- newy = elRect.y;
- } else if (elRect.y + elRect.height > curRect.y + curRect.height) {
- newy = elRect.y - curRect.height + elRect.height;
- }
-
- // XXX TODO these arguments are wrong, we still have to transform the coordinates
- // from viewport to scrollbox before sending them to scrollTo
- this.scrollTo(newx, newy);
-}
-
-// this is a mehful way of getting the visible rect in scrollbox coordinates
-// that we use in this here lab environment and hopefully nowhere in real fennec
-function getVisibleRect() {
- let w = window.innerWidth;
- let h = window.innerHeight;
-
- let [x, y] = getScrollboxPosition();
-
- return new wsRect(x, y, w, h);
-}
-
-]]>
-</script>
-
-<scrollbox id="scrollbox" style="-moz-box-orient: vertical; overflow: scroll;" flex="1">
- <hbox id="top_urlbar" style="background-color: pink"><textbox flex="1"/></hbox>
- <hbox style="position: relative">
- <vbox id="left_sidebar" class="sidebar" style="background-color: red"><button label="left sidebar"/></vbox>
- <box>
- <html:div id="tile_container" style="position: relative; width: 800px; height: 480px; overflow: -moz-hidden-unscrollable;"/>
- </box>
- <vbox id="right_sidebar" class="sidebar" style="background-color: blue"><button label="right sidebar"/></vbox>
- </hbox>
-</scrollbox>
-
- <box>
- <html:div style="position: relative; overflow: hidden; max-width: 0px; max-height: 0px; visibility: hidden;">
- <html:div id="browsers" style="position: absolute;">
- <!-- <browser id="googlenews" src="http://www.webhamster.com/" type="content" remote="true" style="width: 1024px; height: 614px"/> -->
- <iframe id="googlenews" src="http://news.google.com/" type="content" remote="true" style="width: 1024px; height: 614px"/>
- </html:div>
- </html:div>
- </box>
-
-</window>
diff --git a/toolkit/content/tests/fennec-tile-testapp/chrome/content/main.xul b/toolkit/content/tests/fennec-tile-testapp/chrome/content/main.xul
deleted file mode 100644
index f829b3f4a..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/main.xul
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<window id="main" title="My App" width="300" height="300"
-xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <caption label="Hello World"/>
-</window>
diff --git a/toolkit/content/tests/fennec-tile-testapp/chrome/content/overlay.js b/toolkit/content/tests/fennec-tile-testapp/chrome/content/overlay.js
deleted file mode 100644
index 8dd09af00..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/content/overlay.js
+++ /dev/null
@@ -1,15 +0,0 @@
-var tile = {
- onLoad: function() {
- // initialization code
- this.initialized = true;
- this.strings = document.getElementById("tile-strings");
- },
- onMenuItemCommand: function(e) {
- var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
- .getService(Components.interfaces.nsIPromptService);
- promptService.alert(window, this.strings.getString("helloMessageTitle"),
- this.strings.getString("helloMessage"));
- },
-
-};
-window.addEventListener("load", function(e) { tile.onLoad(e); }, false);
diff --git a/toolkit/content/tests/fennec-tile-testapp/chrome/locale/en-US/tile.dtd b/toolkit/content/tests/fennec-tile-testapp/chrome/locale/en-US/tile.dtd
deleted file mode 100644
index 8cffbce35..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/locale/en-US/tile.dtd
+++ /dev/null
@@ -1 +0,0 @@
-<!ENTITY tile.label "Your localized menuitem">
diff --git a/toolkit/content/tests/fennec-tile-testapp/chrome/locale/en-US/tile.properties b/toolkit/content/tests/fennec-tile-testapp/chrome/locale/en-US/tile.properties
deleted file mode 100644
index 72062a4f0..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/locale/en-US/tile.properties
+++ /dev/null
@@ -1,3 +0,0 @@
-helloMessage=Hello World!
-helloMessageTitle=Hello
-prefMessage=Int Pref Value: %d
diff --git a/toolkit/content/tests/fennec-tile-testapp/chrome/skin/overlay.css b/toolkit/content/tests/fennec-tile-testapp/chrome/skin/overlay.css
deleted file mode 100644
index 98718057f..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/chrome/skin/overlay.css
+++ /dev/null
@@ -1,5 +0,0 @@
-/* This is just an example. You shouldn't do this. */
-#tile-hello
-{
- color: red ! important;
-}
diff --git a/toolkit/content/tests/fennec-tile-testapp/defaults/preferences/prefs.js b/toolkit/content/tests/fennec-tile-testapp/defaults/preferences/prefs.js
deleted file mode 100644
index 823196f8b..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/defaults/preferences/prefs.js
+++ /dev/null
@@ -1,2 +0,0 @@
-pref("toolkit.defaultChromeURI", "chrome://tile/content/foo.xul");
-pref("browser.dom.window.dump.enabled", true);
diff --git a/toolkit/content/tests/fennec-tile-testapp/install.rdf b/toolkit/content/tests/fennec-tile-testapp/install.rdf
deleted file mode 100644
index e80fb845c..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/install.rdf
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<RDF xmlns="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:em="http://www.mozilla.org/2004/em-rdf#">
- <Description about="urn:mozilla:install-manifest">
- <em:id>tile@roy</em:id>
- <em:name>tile</em:name>
- <em:version>1.0</em:version>
- <em:creator>Roy</em:creator>
- <em:targetApplication>
- <Description>
- <em:id>{ec8030f7-c20a-464f-9b0e-13a3a9e97384}</em:id> <!-- firefox -->
- <em:minVersion>1.5</em:minVersion>
- <em:maxVersion>3.5.*</em:maxVersion>
- </Description>
- </em:targetApplication>
- </Description>
-</RDF>
diff --git a/toolkit/content/tests/fennec-tile-testapp/logread.py b/toolkit/content/tests/fennec-tile-testapp/logread.py
deleted file mode 100644
index afa1fa524..000000000
--- a/toolkit/content/tests/fennec-tile-testapp/logread.py
+++ /dev/null
@@ -1,104 +0,0 @@
-#!/usr/bin/python
-import re, sys
-
-interesting_re = re.compile("(js_Execute|CallHook) ([^ ]+) ([^ ]+ )?([^ ]+ms)")
-class Entry:
- def __init__(self, kind, depth, file, linenum, func, timetaken):
- self.kind = kind
- self.depth = depth
- self.file = file
- self.linenum = linenum
- self.func = func
- self.timetaken = timetaken
- self.calls = 0
- self.duration = 0
-
- def __str__(self):
- return " ".join(map(str,[self.kind, self.depth, self.file, self.linenum, self.func, self.timetaken]))
-
- def id(self):
- if self.kind == "js_Execute":
- return self.file
- else:
- if self.file and self.linenum:
- strout = "%s:%d" % (self.file, self.linenum)
- if self.func:
- strout = "%s %s" % (self.func, strout)
- return strout
- elif self.func:
- return self.func
- else:
- print("No clue what my id is:"+self)
-
- def call(self, timetaken):
- self.calls += 1
- self.duration += timetaken
-
-def parse_line(line):
- m = interesting_re.search(line)
- if not m:
- return None
-
- ms_index = line.find("ms")
- depth = m.start() - ms_index - 3
- kind = m.group(1)
- func = None
- file = None
- linenum = None
- if kind == "CallHook":
- func = m.group(2)
- file = m.group(3)
- colpos = file.rfind(":")
- (file,linenum) = file[:colpos], file[colpos+1:-1]
- if linenum == "0":
- linenum = None
- else:
- linenum = int(linenum)
- offset = 1
- else:
- file = m.group(3)
-
- timetaken = None
- try:
- timetaken = float(m.group(4)[:-2])
- except:
- return None
- return Entry(kind, depth, file, linenum, func, timetaken)
-
-def compare(x,y):
- diff = x[1].calls - y[1].calls
- if diff == 0:
- return int(x[1].duration - y[1].duration)
- elif diff > 0:
- return 1
- elif diff < 0:
- return -1
-
-def frequency(ls):
- dict = {}
- for item in ls:
- id = item.id()
- stat = None
- if not id in dict:
- stat = dict[id] = item
- else:
- stat = dict[id]
- stat.call(item.timetaken)
-
- ls = dict.items()
- ls.sort(compare)
- ls = filter(lambda (_,item): item.duration > 20, ls)
-# ls = filter(lambda (_,item): item.file and item.file.find("browser.js") != -1 and item.linenum <= 1223 and item.linenum >1067, ls)
- for key, item in ls:
- print(item.calls,key, str(item.duration)+"ms")
-
-def go():
- file = sys.argv[1]
-
- ls = filter(lambda x: x != None, map(parse_line, open(file).readlines()))
-
- frequency(ls)
- print ls[0]
-
-go()
-
diff --git a/toolkit/content/tests/mochitest/mochitest.ini b/toolkit/content/tests/mochitest/mochitest.ini
deleted file mode 100644
index 1ef68c022..000000000
--- a/toolkit/content/tests/mochitest/mochitest.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[test_autocomplete_change_after_focus.html]
-skip-if = toolkit == "android"
-[test_mousecapture.xhtml]
-skip-if = toolkit == "android"
-
diff --git a/toolkit/content/tests/mochitest/test_autocomplete_change_after_focus.html b/toolkit/content/tests/mochitest/test_autocomplete_change_after_focus.html
deleted file mode 100644
index 540eeacf4..000000000
--- a/toolkit/content/tests/mochitest/test_autocomplete_change_after_focus.html
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=998893
--->
-<head>
- <meta charset="utf-8">
- <title>Test for Bug 998893 - Ensure that input.value changes affect autocomplete</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SpawnTask.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="text/javascript">
- /** Test for Bug 998893 **/
- add_task(function* waitForFocus() {
- yield new Promise(resolve => SimpleTest.waitForFocus(resolve));
- });
-
- add_task(function* setup() {
- yield new Promise(resolve => {
- let chromeScript = SpecialPowers.loadChromeScript(function() {
- const {FormHistory} = Components.utils.import("resource://gre/modules/FormHistory.jsm", null);
- FormHistory.update([
- { op : "bump", fieldname: "field1", value: "Default text option" },
- { op : "bump", fieldname: "field1", value: "New value option" },
- ], {
- handleCompletion: function() {
- sendAsyncMessage("Test:Resume");
- },
- });
- });
-
- chromeScript.addMessageListener("Test:Resume", function resumeListener() {
- chromeScript.removeMessageListener("Test:Resume", resumeListener);
- chromeScript.destroy();
- resolve();
- });
- });
- });
-
- add_task(function* runTest() {
- let promisePopupShown = new Promise(resolve => {
- let chromeScript = SpecialPowers.loadChromeScript(function() {
- Components.utils.import("resource://gre/modules/Services.jsm");
- let window = Services.wm.getMostRecentWindow("navigator:browser");
- let popup = window.document.getElementById("PopupAutoComplete");
- popup.addEventListener("popupshown", function popupShown() {
- popup.removeEventListener("popupshown", popupShown);
- sendAsyncMessage("Test:Resume");
- });
- });
-
- chromeScript.addMessageListener("Test:Resume", function resumeListener() {
- chromeScript.removeMessageListener("Test:Resume", resumeListener);
- chromeScript.destroy();
- resolve();
- });
- });
-
- let field = document.getElementById("field1");
-
- let promiseFieldFocus = new Promise(resolve => {
- field.addEventListener("focus", function onFocus() {
- info("field focused");
- field.value = "New value";
- sendKey("DOWN");
- resolve();
- });
- });
-
- let handleEnterPromise = new Promise(resolve => {
- function handleEnter(evt) {
- if (evt.keyCode != KeyEvent.DOM_VK_RETURN) {
- return;
- }
- info("RETURN received for phase: " + evt.eventPhase);
- is(evt.target.value, "New value option", "Check that the correct autocomplete entry was used");
- resolve();
- }
-
- field.addEventListener("keypress", handleEnter, true);
- });
-
- field.focus();
-
- yield promiseFieldFocus;
-
- yield promisePopupShown;
-
- sendKey("DOWN");
- sendKey("RETURN");
- sendKey("RETURN");
-
- yield handleEnterPromise;
- });
- </script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=998893">Mozilla Bug 998893</a>
-<p id="display"><input id="field1" value="Default text"></p>
-<div id="content" style="display: none"></div>
-<pre id="test">
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/mochitest/test_mousecapture.xhtml b/toolkit/content/tests/mochitest/test_mousecapture.xhtml
deleted file mode 100644
index d4ae945bb..000000000
--- a/toolkit/content/tests/mochitest/test_mousecapture.xhtml
+++ /dev/null
@@ -1,340 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE HTML>
-<html xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <title>Mouse Capture Tests</title>
- <link rel="stylesheet" href="chrome://global/skin/" type="text/css"/>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
-</head>
-<body id="body" xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"/><div id="content" style="display: none"/><pre id="test"/>
-
-<script><![CDATA[
-
-SimpleTest.expectAssertions(6, 12);
-
-SimpleTest.waitForExplicitFinish();
-
-var captureRetargetMode = false;
-var cachedMouseDown = null;
-var previousWidth = 0, originalWidth = 0;
-var loadInWindow = false;
-
-function splitterCallback(adjustment)
-{
- var newWidth = Number($("leftbox").width); // getBoundingClientRect().width;
- var expectedWidth = previousWidth + adjustment;
- if (expectedWidth > $("splitterbox").getBoundingClientRect().width)
- expectedWidth = $("splitterbox").getBoundingClientRect().width - $("splitter").getBoundingClientRect().width;
- is(newWidth, expectedWidth, "splitter left box size (" + adjustment + ")");
- previousWidth = newWidth;
-}
-
-function selectionCallback(adjustment)
-{
- if (adjustment == 4000) {
- is(frames[0].getSelection().toString(), "This is some text", "selection after drag (" + adjustment + ")");
- ok(frames[0].scrollY > 40, "selection caused scroll down (" + adjustment + ")");
- }
- else {
- if (adjustment == 0) {
- is(frames[0].getSelection().toString(), ".", "selection after drag (" + adjustment + ")");
- }
- is(frames[0].scrollY, 0, "selection scrollY (" + adjustment + ")");
- }
-}
-
-function framesetCallback(adjustment)
-{
- var newWidth = frames[1].frames[0].document.documentElement.clientWidth;
- var expectedWidth = originalWidth + adjustment;
- if (adjustment == 0)
- expectedWidth = originalWidth - 12;
- else if (expectedWidth >= 4000)
- expectedWidth = originalWidth * 2 - 2;
-
- ok(Math.abs(newWidth - expectedWidth) <= 1, "frameset after drag (" + adjustment + "), new width " + newWidth + ", expected " + expectedWidth);
-}
-
-var otherWindow = null;
-
-function selectionScrollCheck()
-{
- var element = otherWindow.document.documentElement;
-
- var count = 0;
- function selectionScrollDone() {
- // wait for 6 scroll events to occur
- if (count++ < 6)
- return;
-
- otherWindow.removeEventListener("scroll", selectionScrollDone, false);
-
- var selectedText = otherWindow.getSelection().toString().replace(/\r/g, "");
- is(selectedText, "One\n\nTwo", "text is selected");
-
- // should have scrolled 20 pixels from the mousemove above and at least 6
- // extra 20-pixel increments from the selection scroll timer. "At least 6"
- // because we waited for 6 scroll events but multiple scrolls could get
- // coalesced into a single scroll event, and paints could be delayed when
- // the window loads when the compositor is busy. As a result, we have no
- // real guarantees about the upper bound here, and as the upper bound is
- // not important for what we're testing here, we don't check it.
- var scrollY = otherWindow.scrollY;
- info(`Scrolled ${scrollY} pixels`);
- ok(scrollY >= 140, "selection scroll position after timer is at least 140");
- ok((scrollY % 20) == 0, "selection scroll position after timer is multiple of 20");
-
- synthesizeMouse(element, 4, otherWindow.innerHeight + 25, { type: "mouseup" }, otherWindow);
- disableNonTestMouseEvents(false);
- otherWindow.close();
-
- if (loadInWindow) {
- SimpleTest.finish();
- }
- else {
- // now try again, but open the page in a new window
- loadInWindow = true;
- synthesizeMouse(document.getElementById("custom"), 2, 2, { type: "mousedown" });
-
- // check to ensure that selection dragging scrolls the right scrollable area
- otherWindow = window.open("data:text/html,<html><p>One</p><p style='margin-top: 200px;'>Two</p><p style='margin-top: 4000px'>This is some text</p></html>", "_blank", "width=200,height=200,scrollbars=yes");
- SimpleTest.waitForFocus(selectionScrollCheck, otherWindow);
- }
- }
-
- SimpleTest.executeSoon(function () {
- disableNonTestMouseEvents(true);
- synthesizeMouse(element, 2, 2, { type: "mousedown" }, otherWindow);
- synthesizeMouse(element, 100, otherWindow.innerHeight + 20, { type: "mousemove" }, otherWindow);
- otherWindow.addEventListener("scroll", selectionScrollDone, false);
- });
-}
-
-function runTests()
-{
- previousWidth = $("leftbox").getBoundingClientRect().width;
- runCaptureTest($("splitter"), splitterCallback);
-
- var custom = document.getElementById("custom");
- runCaptureTest(custom);
-
- synthesizeMouseExpectEvent($("rightbox"), 2, 2, { type: "mousemove" },
- $("rightbox"), "mousemove", "setCapture and releaseCapture");
-
- custom.setCapture();
- synthesizeMouseExpectEvent($("leftbox"), 2, 2, { type: "mousemove" },
- $("leftbox"), "mousemove", "setCapture fails on non mousedown");
-
- var custom2 = document.getElementById("custom2");
- synthesizeMouse(custom2, 2, 2, { type: "mousedown" });
- synthesizeMouseExpectEvent($("leftbox"), 2, 2, { type: "mousemove" },
- $("leftbox"), "mousemove", "document.releaseCapture releases capture");
-
- var custom3 = document.getElementById("custom3");
- synthesizeMouse(custom3, 2, 2, { type: "mousedown" });
- synthesizeMouseExpectEvent($("leftbox"), 2, 2, { type: "mousemove" },
- $("leftbox"), "mousemove", "element.releaseCapture releases capture");
-
- var custom4 = document.getElementById("custom4");
- synthesizeMouse(custom4, 2, 2, { type: "mousedown" });
- synthesizeMouseExpectEvent($("leftbox"), 2, 2, { type: "mousemove" },
- custom4, "mousemove", "element.releaseCapture during mousemove before releaseCapture");
- synthesizeMouseExpectEvent($("leftbox"), 2, 2, { type: "mousemove" },
- $("leftbox"), "mousemove", "element.releaseCapture during mousemove after releaseCapture");
-
- var custom5 = document.getElementById("custom5");
- runCaptureTest(custom5);
- captureRetargetMode = true;
- runCaptureTest(custom5);
- captureRetargetMode = false;
-
- var custom6 = document.getElementById("custom6");
- synthesizeMouse(custom6, 2, 2, { type: "mousedown" });
- synthesizeMouseExpectEvent($("leftbox"), 2, 2, { type: "mousemove" },
- $("leftbox"), "mousemove", "setCapture only works on elements in documents");
- synthesizeMouse(custom6, 2, 2, { type: "mouseup" });
-
- // test that mousedown on an image with setCapture followed by a big enough
- // mouse move does not start a drag (bug 517737)
- var image = document.getElementById("image");
- image.scrollIntoView();
- synthesizeMouse(image, 2, 2, { type: "mousedown" });
- synthesizeMouseExpectEvent($("leftbox"), 2, 2, { type: "mousemove" },
- image, "mousemove", "setCapture works on images");
- synthesizeMouse(image, 2, 2, { type: "mouseup" });
-
- window.scroll(0, 0);
-
- // save scroll
- var scrollX = parent ? parent.scrollX : 0;
- var scrollY = parent ? parent.scrollY : 0;
-
- var b = frames[0].document.getElementById("b");
-// runCaptureTest(b, selectionCallback);
-
- // restore scroll
- if (parent) parent.scroll(scrollX, scrollY);
-
-// frames[0].getSelection().collapseToStart();
-
- var body = frames[0].document.body;
- var fixed = frames[0].document.getElementById("fixed");
- function captureOnBody() { body.setCapture() }
- body.addEventListener("mousedown", captureOnBody, true);
- synthesizeMouse(body, 8, 8, { type: "mousedown" }, frames[0]);
- body.removeEventListener("mousedown", captureOnBody, true);
- synthesizeMouseExpectEvent(fixed, 2, 2, { type: "mousemove" },
- fixed, "mousemove", "setCapture on body retargets to root node", frames[0]);
- synthesizeMouse(body, 8, 8, { type: "mouseup" }, frames[0]);
-
- previousWidth = frames[1].frames[0].document.documentElement.clientWidth;
- originalWidth = previousWidth;
- runCaptureTest(frames[1].document.documentElement.lastChild, framesetCallback);
-
- // ensure that clicking on an element where the frame disappears doesn't crash
- synthesizeMouse(frames[2].document.getElementById("input"), 8, 8, { type: "mousedown" }, frames[2]);
- synthesizeMouse(frames[2].document.getElementById("input"), 8, 8, { type: "mouseup" }, frames[2]);
-
- var select = document.getElementById("select");
- select.scrollIntoView();
-
- synthesizeMouse(document.getElementById("option3"), 2, 2, { type: "mousedown" });
- synthesizeMouse(document.getElementById("option3"), 2, 1000, { type: "mousemove" });
- is(select.selectedIndex, 2, "scroll select");
- synthesizeMouse(document.getElementById("select"), 2, 2, { type: "mouseup" });
- window.scroll(0, 0);
-
- synthesizeMouse(custom, 2, 2, { type: "mousedown" });
-
- // check to ensure that selection dragging scrolls the right scrollable area.
- // This should open the page in a new tab.
-
- var topPos = window.innerHeight;
- otherWindow = window.open("data:text/html,<html><p>One</p><p style='margin-top: " + topPos + "'>Two</p><p style='margin-top: 4000px'>This is some text</p></html>", "_blank");
- SimpleTest.waitForFocus(selectionScrollCheck, otherWindow);
-}
-
-function runCaptureTest(element, callback)
-{
- var expectedTarget = null;
-
- var win = element.ownerDocument.defaultView;
-
- function mouseMoved(event) {
- is(event.originalTarget, expectedTarget,
- expectedTarget.id + " target for point " + event.clientX + "," + event.clientY);
- }
- win.addEventListener("mousemove", mouseMoved, false);
-
- expectedTarget = element;
-
- var basepoint = element.localName == "frameset" ? 50 : 2;
- synthesizeMouse(element, basepoint, basepoint, { type: "mousedown" }, win);
-
- // in setCapture(true) mode, all events should fire on custom5. In
- // setCapture(false) mode, events can fire at a descendant
- if (expectedTarget == $("custom5") && !captureRetargetMode)
- expectedTarget = $("custom5spacer");
-
- // releaseCapture should do nothing for an element which isn't capturing
- $("splitterbox").releaseCapture();
-
- synthesizeMouse(element, basepoint + 2, basepoint + 2, { type: "mousemove" }, win);
- if (callback)
- callback(2);
-
- if (expectedTarget == $("custom5spacer") && !captureRetargetMode)
- expectedTarget = $("custom5inner");
-
- if (element.id == "b") {
- var tooltip = document.getElementById("tooltip");
- tooltip.openPopup();
- tooltip.hidePopup();
- }
-
- synthesizeMouse(element, basepoint + 25, basepoint + 25, { type: "mousemove" }, win);
- if (callback)
- callback(25);
-
- expectedTarget = element.localName == "b" ? win.document.documentElement : element;
- synthesizeMouse(element, basepoint + 4000, basepoint + 4000, { type: "mousemove" }, win);
- if (callback)
- callback(4000);
- synthesizeMouse(element, basepoint - 12, basepoint - 12, { type: "mousemove" }, win);
- if (callback)
- callback(-12);
-
- expectedTarget = element.localName == "frameset" ? element : win.document.documentElement;
- synthesizeMouse(element, basepoint + 30, basepoint + 30, { type: "mouseup" }, win);
- synthesizeMouse(win.document.documentElement, 2, 2, { type: "mousemove" }, win);
- if (callback)
- callback(0);
-
- win.removeEventListener("mousemove", mouseMoved, false);
-}
-
-SimpleTest.waitForFocus(runTests);
-
-]]>
-</script>
-
-<xul:vbox xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" align="start">
- <tooltip id="tooltip">
- <label value="Test"/>
- </tooltip>
-
- <hbox id="splitterbox" style="margin-top: 5px;" onmousedown="this.setCapture()">
- <hbox id="leftbox" width="100" flex="1"/>
- <splitter id="splitter" height="5"/>
- <hbox id="rightbox" width="100" flex="1"/>
- </hbox>
-
- <vbox id="custom" width="10" height="10" onmousedown="this.setCapture(); cachedMouseDown = event;"/>
- <vbox id="custom2" width="10" height="10" onmousedown="this.setCapture(); document.releaseCapture();"/>
- <vbox id="custom3" width="10" height="10" onmousedown="this.setCapture(); this.releaseCapture();"/>
- <vbox id="custom4" width="10" height="10" onmousedown="this.setCapture();"
- onmousemove="this.releaseCapture();"/>
- <hbox id="custom5" width="40" height="40"
- onmousedown="this.setCapture(captureRetargetMode);">
- <spacer id="custom5spacer" width="5"/>
- <hbox id="custom5inner" width="35" height="35"/>
- </hbox>
- <vbox id="custom6" width="10" height="10"
- onmousedown="document.createElement('hbox').setCapture();"/>
-</xul:vbox>
-
- <iframe width="100" height="100"
- src="data:text/html,%3Cbody style%3D'font-size%3A 40pt%3B'%3E.%3Cb id%3D'b'%3EThis%3C/b%3E is some text%3Cdiv id='fixed' style='position: fixed; left: 55px; top: 5px; width: 10px; height: 10px'%3E.%3C/div%3E%3C/body%3E"/>
-
- <iframe width="100" height="100"
- src="data:text/html,%3Cframeset cols='50%, 50%'%3E%3Cframe src='about:blank'%3E%3Cframe src='about:blank'%3E%3C/frameset%3E"/>
-
- <iframe width="100" height="100"
- src="data:text/html,%3Cinput id='input' onfocus='this.style.display = &quot;none&quot;' style='float: left;'>"/>
-
- <select id="select" xmlns="http://www.w3.org/1999/xhtml" size="4">
- <option id="option1">One</option>
- <option id="option2">Two</option>
- <option id="option3">Three</option>
- <option id="option4">Four</option>
- <option id="option5">Five</option>
- <option id="option6">Six</option>
- <option id="option7">Seven</option>
- <option id="option8">Eight</option>
- <option id="option9">Nine</option>
- <option id="option10">Ten</option>
- </select>
-
- <img id="image" xmlns="http://www.w3.org/1999/xhtml"
- onmousedown="this.setCapture();" onmouseup="this.releaseCapture();"
- ondragstart="ok(false, 'should not get a drag when a setCapture is active');"
- src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAG0lEQVR42mP8z0A%2BYKJA76jmUc2jmkc1U0EzACKcASfOgGoMAAAAAElFTkSuQmCC"/>
-
-</body>
-
-</html>
-
diff --git a/toolkit/content/tests/moz.build b/toolkit/content/tests/moz.build
deleted file mode 100644
index e540fa11f..000000000
--- a/toolkit/content/tests/moz.build
+++ /dev/null
@@ -1,19 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
-
-BROWSER_CHROME_MANIFESTS += ['browser/browser.ini']
-
-MOCHITEST_CHROME_MANIFESTS += [
- 'chrome/chrome.ini',
- 'widgets/chrome.ini',
-]
-
-MOCHITEST_MANIFESTS += [
- 'mochitest/mochitest.ini',
- 'widgets/mochitest.ini',
-]
diff --git a/toolkit/content/tests/reftests/bug-442419-progressmeter-max-ref.xul b/toolkit/content/tests/reftests/bug-442419-progressmeter-max-ref.xul
deleted file mode 100644
index a034b6e67..000000000
--- a/toolkit/content/tests/reftests/bug-442419-progressmeter-max-ref.xul
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <progressmeter value="50"/> <!-- default is max = 100 -->
-</window>
-
diff --git a/toolkit/content/tests/reftests/bug-442419-progressmeter-max.xul b/toolkit/content/tests/reftests/bug-442419-progressmeter-max.xul
deleted file mode 100644
index 622596406..000000000
--- a/toolkit/content/tests/reftests/bug-442419-progressmeter-max.xul
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <progressmeter max="198" value="99"/> <!-- 50% -->
-</window>
-
diff --git a/toolkit/content/tests/reftests/textbox-multiline-default-value.xul b/toolkit/content/tests/reftests/textbox-multiline-default-value.xul
deleted file mode 100644
index 31a5bc556..000000000
--- a/toolkit/content/tests/reftests/textbox-multiline-default-value.xul
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version='1.0'?>
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="test textbox multiline">
- <textbox multiline='true' value='foobar'></textbox>
-</window>
diff --git a/toolkit/content/tests/reftests/textbox-multiline-empty.xul b/toolkit/content/tests/reftests/textbox-multiline-empty.xul
deleted file mode 100644
index c48f2c988..000000000
--- a/toolkit/content/tests/reftests/textbox-multiline-empty.xul
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version='1.0'?>
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="test textbox multiline">
- <textbox multiline='true'></textbox>
-</window>
diff --git a/toolkit/content/tests/unit/.eslintrc.js b/toolkit/content/tests/unit/.eslintrc.js
deleted file mode 100644
index fee088c17..000000000
--- a/toolkit/content/tests/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/content/tests/unit/test_contentAreaUtils.js b/toolkit/content/tests/unit/test_contentAreaUtils.js
deleted file mode 100644
index 970e779ce..000000000
--- a/toolkit/content/tests/unit/test_contentAreaUtils.js
+++ /dev/null
@@ -1,80 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cr = Components.results;
-
-function loadUtilsScript() {
- var loader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
- getService(Ci.mozIJSSubScriptLoader);
- loader.loadSubScript("chrome://global/content/contentAreaUtils.js");
-}
-
-function test_urlSecurityCheck() {
- var nullPrincipal = Cc["@mozilla.org/nullprincipal;1"].
- createInstance(Ci.nsIPrincipal);
-
- const HTTP_URI = "http://www.mozilla.org/";
- const CHROME_URI = "chrome://browser/content/browser.xul";
- const DISALLOW_INHERIT_PRINCIPAL =
- Ci.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL;
-
- try {
- urlSecurityCheck(makeURI(HTTP_URI), nullPrincipal,
- DISALLOW_INHERIT_PRINCIPAL);
- }
- catch (ex) {
- do_throw("urlSecurityCheck should not throw when linking to a http uri with a null principal");
- }
-
- // urlSecurityCheck also supports passing the url as a string
- try {
- urlSecurityCheck(HTTP_URI, nullPrincipal,
- DISALLOW_INHERIT_PRINCIPAL);
- }
- catch (ex) {
- do_throw("urlSecurityCheck failed to handle the http URI as a string (uri spec)");
- }
-
- let shouldThrow = true;
- try {
- urlSecurityCheck(CHROME_URI, nullPrincipal,
- DISALLOW_INHERIT_PRINCIPAL);
- }
- catch (ex) {
- shouldThrow = false;
- }
- if (shouldThrow)
- do_throw("urlSecurityCheck should throw when linking to a chrome uri with a null principal");
-}
-
-function test_stringBundle() {
- // This test verifies that the elements that can be used as file picker title
- // keys in the save* functions are actually present in the string bundle.
- // These keys are part of the contentAreaUtils.js public API.
- var validFilePickerTitleKeys = [
- "SaveImageTitle",
- "SaveVideoTitle",
- "SaveAudioTitle",
- "SaveLinkTitle",
- ];
-
- for (let filePickerTitleKey of validFilePickerTitleKeys) {
- // Just check that the string exists
- try {
- ContentAreaUtils.stringBundle.GetStringFromName(filePickerTitleKey);
- } catch (e) {
- do_throw("Error accessing file picker title key: " + filePickerTitleKey);
- }
- }
-}
-
-function run_test()
-{
- loadUtilsScript();
- test_urlSecurityCheck();
- test_stringBundle();
-}
diff --git a/toolkit/content/tests/unit/xpcshell.ini b/toolkit/content/tests/unit/xpcshell.ini
deleted file mode 100644
index 33a0383bd..000000000
--- a/toolkit/content/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,5 +0,0 @@
-[DEFAULT]
-head =
-tail =
-
-[test_contentAreaUtils.js]
diff --git a/toolkit/content/tests/widgets/.eslintrc.js b/toolkit/content/tests/widgets/.eslintrc.js
deleted file mode 100644
index e14919375..000000000
--- a/toolkit/content/tests/widgets/.eslintrc.js
+++ /dev/null
@@ -1,8 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/mochitest.eslintrc.js",
- "../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/content/tests/widgets/audio.ogg b/toolkit/content/tests/widgets/audio.ogg
deleted file mode 100644
index a553c23e7..000000000
--- a/toolkit/content/tests/widgets/audio.ogg
+++ /dev/null
Binary files differ
diff --git a/toolkit/content/tests/widgets/audio.wav b/toolkit/content/tests/widgets/audio.wav
deleted file mode 100644
index c6fd5cb86..000000000
--- a/toolkit/content/tests/widgets/audio.wav
+++ /dev/null
Binary files differ
diff --git a/toolkit/content/tests/widgets/chrome.ini b/toolkit/content/tests/widgets/chrome.ini
deleted file mode 100644
index 841b86c0f..000000000
--- a/toolkit/content/tests/widgets/chrome.ini
+++ /dev/null
@@ -1,20 +0,0 @@
-[DEFAULT]
-skip-if = os == 'android'
-support-files =
- tree_shared.js
- popup_shared.js
- window_menubar.xul
- seek_with_sound.ogg
-
-[test_contextmenu_nested.xul]
-skip-if = os == 'linux' # Bug 1116215
-[test_contextmenu_menugroup.xul]
-skip-if = os == 'linux' # Bug 1115088
-[test_editor_currentURI.xul]
-[test_menubar.xul]
-skip-if = os == 'mac'
-[test_popupanchor.xul]
-skip-if = os == 'android'
-[test_popupreflows.xul]
-[test_tree_column_reorder.xul]
-[test_videocontrols_onclickplay.html]
diff --git a/toolkit/content/tests/widgets/head.js b/toolkit/content/tests/widgets/head.js
deleted file mode 100644
index c2ae0c7ae..000000000
--- a/toolkit/content/tests/widgets/head.js
+++ /dev/null
@@ -1,23 +0,0 @@
-"use strict";
-
-function waitForCondition(condition, nextTest, errorMsg) {
- var tries = 0;
- var interval = setInterval(function() {
- if (tries >= 30) {
- ok(false, errorMsg);
- moveOn();
- }
- var conditionPassed;
- try {
- conditionPassed = condition();
- } catch (e) {
- ok(false, e + "\n" + e.stack);
- conditionPassed = false;
- }
- if (conditionPassed) {
- moveOn();
- }
- tries++;
- }, 100);
- var moveOn = function() { clearInterval(interval); nextTest(); };
-}
diff --git a/toolkit/content/tests/widgets/mochitest.ini b/toolkit/content/tests/widgets/mochitest.ini
deleted file mode 100644
index abc77c80b..000000000
--- a/toolkit/content/tests/widgets/mochitest.ini
+++ /dev/null
@@ -1,40 +0,0 @@
-[DEFAULT]
-support-files =
- audio.wav
- audio.ogg
- seek_with_sound.ogg
- head.js
- tree_shared.js
- videocontrols_direction-1-ref.html
- videocontrols_direction-1a.html
- videocontrols_direction-1b.html
- videocontrols_direction-1c.html
- videocontrols_direction-1d.html
- videocontrols_direction-1e.html
- videocontrols_direction-2-ref.html
- videocontrols_direction-2a.html
- videocontrols_direction-2b.html
- videocontrols_direction-2c.html
- videocontrols_direction-2d.html
- videocontrols_direction-2e.html
- videocontrols_direction_test.js
- videomask.css
-
-[test_audiocontrols_dimensions.html]
-skip-if = toolkit == 'android'
-[test_mousecapture_area.html]
-[test_videocontrols.html]
-tags = fullscreen
-skip-if = toolkit == 'android' #TIMED_OUT
-[test_videocontrols_vtt.html]
-skip-if = toolkit == 'android'
-[test_videocontrols_iframe_fullscreen.html]
-[test_videocontrols_audio.html]
-[test_videocontrols_audio_direction.html]
-[test_videocontrols_jsdisabled.html]
-skip-if = toolkit == 'android' # bug 1272646
-[test_videocontrols_standalone.html]
-skip-if = true # bug 1075573, bug 1262130
-[test_videocontrols_video_direction.html]
-skip-if = os == 'win'
-[test_bug898940.html]
diff --git a/toolkit/content/tests/widgets/popup_shared.js b/toolkit/content/tests/widgets/popup_shared.js
deleted file mode 100644
index 49735c5ad..000000000
--- a/toolkit/content/tests/widgets/popup_shared.js
+++ /dev/null
@@ -1,424 +0,0 @@
-/*
- * This script is used for menu and popup tests. Call startPopupTests to start
- * the tests, passing an array of tests as an argument. Each test is an object
- * with the following properties:
- * testname - name of the test
- * test - function to call to perform the test
- * events - a list of events that are expected to be fired in sequence
- * as a result of calling the 'test' function. This list should be
- * an array of strings of the form "eventtype targetid" where
- * 'eventtype' is the event type and 'targetid' is the id of
- * target of the event. This function will be passed two
- * arguments, the testname and the step argument.
- * Alternatively, events may be a function which returns the array
- * of events. This can be used when the events vary per platform.
- * result - function to call after all the events have fired to check
- * for additional results. May be null. This function will be
- * passed two arguments, the testname and the step argument.
- * steps - optional array of values. The test will be repeated for
- * each step, passing each successive value within the array to
- * the test and result functions
- * autohide - if set, should be set to the id of a popup to hide after
- * the test is complete. This is a convenience for some tests.
- * condition - an optional function which, if it returns false, causes the
- * test to be skipped.
- * end - used for debugging. Set to true to stop the tests after running
- * this one.
- */
-
-const menuactiveAttribute = "_moz-menuactive";
-
-var gPopupTests = null;
-var gTestIndex = -1;
-var gTestStepIndex = 0;
-var gTestEventIndex = 0;
-var gAutoHide = false;
-var gExpectedEventDetails = null;
-var gExpectedTriggerNode = null;
-var gWindowUtils;
-var gPopupWidth = -1, gPopupHeight = -1;
-
-function startPopupTests(tests)
-{
- document.addEventListener("popupshowing", eventOccurred, false);
- document.addEventListener("popupshown", eventOccurred, false);
- document.addEventListener("popuphiding", eventOccurred, false);
- document.addEventListener("popuphidden", eventOccurred, false);
- document.addEventListener("command", eventOccurred, false);
- document.addEventListener("DOMMenuItemActive", eventOccurred, false);
- document.addEventListener("DOMMenuItemInactive", eventOccurred, false);
- document.addEventListener("DOMMenuInactive", eventOccurred, false);
- document.addEventListener("DOMMenuBarActive", eventOccurred, false);
- document.addEventListener("DOMMenuBarInactive", eventOccurred, false);
-
- gPopupTests = tests;
- gWindowUtils = SpecialPowers.getDOMWindowUtils(window);
-
- goNext();
-}
-
-function finish()
-{
- if (window.opener) {
- window.close();
- window.opener.SimpleTest.finish();
- return;
- }
- SimpleTest.finish();
- return;
-}
-
-function ok(condition, message) {
- if (window.opener)
- window.opener.SimpleTest.ok(condition, message);
- else
- SimpleTest.ok(condition, message);
-}
-
-function is(left, right, message) {
- if (window.opener)
- window.opener.SimpleTest.is(left, right, message);
- else
- SimpleTest.is(left, right, message);
-}
-
-function disableNonTestMouse(aDisable) {
- gWindowUtils.disableNonTestMouseEvents(aDisable);
-}
-
-function eventOccurred(event)
-{
- if (gPopupTests.length <= gTestIndex) {
- ok(false, "Extra " + event.type + " event fired");
- return;
- }
-
- var test = gPopupTests[gTestIndex];
- if ("autohide" in test && gAutoHide) {
- if (event.type == "DOMMenuInactive") {
- gAutoHide = false;
- setTimeout(goNextStep, 0);
- }
- return;
- }
-
- var events = test.events;
- if (typeof events == "function")
- events = events();
- if (events) {
- if (events.length <= gTestEventIndex) {
- ok(false, "Extra " + event.type + " event fired for " + event.target.id +
- " " +gPopupTests[gTestIndex].testname);
- return;
- }
-
- var eventitem = events[gTestEventIndex].split(" ");
- var matches;
- if (eventitem[1] == "#tooltip") {
- is(event.originalTarget.localName, "tooltip",
- test.testname + " event.originalTarget.localName is 'tooltip'");
- is(event.originalTarget.getAttribute("default"), "true",
- test.testname + " event.originalTarget default attribute is 'true'");
- matches = event.originalTarget.localName == "tooltip" &&
- event.originalTarget.getAttribute("default") == "true";
- } else {
- is(event.type, eventitem[0],
- test.testname + " event type " + event.type + " fired");
- is(event.target.id, eventitem[1],
- test.testname + " event target ID " + event.target.id);
- matches = eventitem[0] == event.type && eventitem[1] == event.target.id;
- }
-
- var modifiersMask = eventitem[2];
- if (modifiersMask) {
- var m = "";
- m += event.altKey ? '1' : '0';
- m += event.ctrlKey ? '1' : '0';
- m += event.shiftKey ? '1' : '0';
- m += event.metaKey ? '1' : '0';
- is(m, modifiersMask, test.testname + " modifiers mask matches");
- }
-
- var expectedState;
- switch (event.type) {
- case "popupshowing": expectedState = "showing"; break;
- case "popupshown": expectedState = "open"; break;
- case "popuphiding": expectedState = "hiding"; break;
- case "popuphidden": expectedState = "closed"; break;
- }
-
- if (gExpectedTriggerNode && event.type == "popupshowing") {
- if (gExpectedTriggerNode == "notset") // check against null instead
- gExpectedTriggerNode = null;
-
- is(event.originalTarget.triggerNode, gExpectedTriggerNode, test.testname + " popupshowing triggerNode");
- var isTooltip = (event.target.localName == "tooltip");
- is(document.popupNode, isTooltip ? null : gExpectedTriggerNode,
- test.testname + " popupshowing document.popupNode");
- is(document.tooltipNode, isTooltip ? gExpectedTriggerNode : null,
- test.testname + " popupshowing document.tooltipNode");
- }
-
- if (expectedState)
- is(event.originalTarget.state, expectedState,
- test.testname + " " + event.type + " state");
-
- if (matches) {
- gTestEventIndex++
- if (events.length <= gTestEventIndex)
- setTimeout(checkResult, 0);
- }
- }
-}
-
-function checkResult()
-{
- var step = null;
- var test = gPopupTests[gTestIndex];
- if ("steps" in test)
- step = test.steps[gTestStepIndex];
-
- if ("result" in test)
- test.result(test.testname, step);
-
- if ("autohide" in test) {
- gAutoHide = true;
- document.getElementById(test.autohide).hidePopup();
- return;
- }
-
- goNextStep();
-}
-
-function goNextStep()
-{
- gTestEventIndex = 0;
-
- var step = null;
- var test = gPopupTests[gTestIndex];
- if ("steps" in test) {
- gTestStepIndex++;
- step = test.steps[gTestStepIndex];
- if (gTestStepIndex < test.steps.length) {
- test.test(test.testname, step);
- return;
- }
- }
-
- goNext();
-}
-
-function goNext()
-{
- // We want to continue after the next animation frame so that
- // we're in a stable state and don't get spurious mouse events at unexpected targets.
- window.requestAnimationFrame(
- function() {
- setTimeout(goNextStepSync, 0);
- }
- );
-}
-
-function goNextStepSync()
-{
- if (gTestIndex >= 0 && "end" in gPopupTests[gTestIndex] && gPopupTests[gTestIndex].end) {
- finish();
- return;
- }
-
- gTestIndex++;
- gTestStepIndex = 0;
- if (gTestIndex < gPopupTests.length) {
- var test = gPopupTests[gTestIndex];
- // Set the location hash so it's easy to see which test is running
- document.location.hash = test.testname;
-
- // skip the test if the condition returns false
- if ("condition" in test && !test.condition()) {
- goNext();
- return;
- }
-
- // start with the first step if there are any
- var step = null;
- if ("steps" in test)
- step = test.steps[gTestStepIndex];
-
- test.test(test.testname, step);
-
- // no events to check for so just check the result
- if (!("events" in test))
- checkResult();
- }
- else {
- finish();
- }
-}
-
-function openMenu(menu)
-{
- if ("open" in menu) {
- menu.open = true;
- }
- else {
- var bo = menu.boxObject;
- if (bo instanceof MenuBoxObject)
- bo.openMenu(true);
- else
- synthesizeMouse(menu, 4, 4, { });
- }
-}
-
-function closeMenu(menu, popup)
-{
- if ("open" in menu) {
- menu.open = false;
- }
- else {
- var bo = menu.boxObject;
- if (bo instanceof MenuBoxObject)
- bo.openMenu(false);
- else
- popup.hidePopup();
- }
-}
-
-function checkActive(popup, id, testname)
-{
- var activeok = true;
- var children = popup.childNodes;
- for (var c = 0; c < children.length; c++) {
- var child = children[c];
- if ((id == child.id && child.getAttribute(menuactiveAttribute) != "true") ||
- (id != child.id && child.hasAttribute(menuactiveAttribute) != "")) {
- activeok = false;
- break;
- }
- }
- ok(activeok, testname + " item " + (id ? id : "none") + " active");
-}
-
-function checkOpen(menuid, testname)
-{
- var menu = document.getElementById(menuid);
- if ("open" in menu)
- ok(menu.open, testname + " " + menuid + " menu is open");
- else if (menu.boxObject instanceof MenuBoxObject)
- ok(menu.getAttribute("open") == "true", testname + " " + menuid + " menu is open");
-}
-
-function checkClosed(menuid, testname)
-{
- var menu = document.getElementById(menuid);
- if ("open" in menu)
- ok(!menu.open, testname + " " + menuid + " menu is open");
- else if (menu.boxObject instanceof MenuBoxObject)
- ok(!menu.hasAttribute("open"), testname + " " + menuid + " menu is closed");
-}
-
-function convertPosition(anchor, align)
-{
- if (anchor == "topleft" && align == "topleft") return "overlap";
- if (anchor == "topleft" && align == "topright") return "start_before";
- if (anchor == "topleft" && align == "bottomleft") return "before_start";
- if (anchor == "topright" && align == "topleft") return "end_before";
- if (anchor == "topright" && align == "bottomright") return "before_end";
- if (anchor == "bottomleft" && align == "bottomright") return "start_after";
- if (anchor == "bottomleft" && align == "topleft") return "after_start";
- if (anchor == "bottomright" && align == "bottomleft") return "end_after";
- if (anchor == "bottomright" && align == "topright") return "after_end";
- return "";
-}
-
-/*
- * When checking position of the bottom or right edge of the popup's rect,
- * use this instead of strict equality check of rounded values,
- * because we snap the top/left edges to pixel boundaries,
- * which can shift the bottom/right up to 0.5px from its "ideal" location,
- * and could cause it to round differently. (See bug 622507.)
- */
-function isWithinHalfPixel(a, b)
-{
- return Math.abs(a - b) <= 0.5;
-}
-
-function compareEdge(anchor, popup, edge, offsetX, offsetY, testname)
-{
- testname += " " + edge;
-
- checkOpen(anchor.id, testname);
-
- var anchorrect = anchor.getBoundingClientRect();
- var popuprect = popup.getBoundingClientRect();
- var check1 = false, check2 = false;
-
- if (gPopupWidth == -1) {
- ok((Math.round(popuprect.right) - Math.round(popuprect.left)) &&
- (Math.round(popuprect.bottom) - Math.round(popuprect.top)),
- testname + " size");
- }
- else {
- is(Math.round(popuprect.width), gPopupWidth, testname + " width");
- is(Math.round(popuprect.height), gPopupHeight, testname + " height");
- }
-
- var spaceIdx = edge.indexOf(" ");
- if (spaceIdx > 0) {
- let cornerX, cornerY;
- let [position, align] = edge.split(" ");
- switch (position) {
- case "topleft": cornerX = anchorrect.left; cornerY = anchorrect.top; break;
- case "topcenter": cornerX = anchorrect.left + anchorrect.width / 2; cornerY = anchorrect.top; break;
- case "topright": cornerX = anchorrect.right; cornerY = anchorrect.top; break;
- case "leftcenter": cornerX = anchorrect.left; cornerY = anchorrect.top + anchorrect.height / 2; break;
- case "rightcenter": cornerX = anchorrect.right; cornerY = anchorrect.top + anchorrect.height / 2; break;
- case "bottomleft": cornerX = anchorrect.left; cornerY = anchorrect.bottom; break;
- case "bottomcenter": cornerX = anchorrect.left + anchorrect.width / 2; cornerY = anchorrect.bottom; break;
- case "bottomright": cornerX = anchorrect.right; cornerY = anchorrect.bottom; break;
- }
-
- switch (align) {
- case "topleft": cornerX += offsetX; cornerY += offsetY; break;
- case "topright": cornerX += -popuprect.width + offsetX; cornerY += offsetY; break;
- case "bottomleft": cornerX += offsetX; cornerY += -popuprect.height + offsetY; break;
- case "bottomright": cornerX += -popuprect.width + offsetX; cornerY += -popuprect.height + offsetY; break;
- }
-
- is(Math.round(popuprect.left), Math.round(cornerX), testname + " x position");
- is(Math.round(popuprect.top), Math.round(cornerY), testname + " y position");
- return;
- }
-
- if (edge == "after_pointer") {
- is(Math.round(popuprect.left), Math.round(anchorrect.left) + offsetX, testname + " x position");
- is(Math.round(popuprect.top), Math.round(anchorrect.top) + offsetY + 21, testname + " y position");
- return;
- }
-
- if (edge == "overlap") {
- ok(Math.round(anchorrect.left) + offsetY == Math.round(popuprect.left) &&
- Math.round(anchorrect.top) + offsetY == Math.round(popuprect.top),
- testname + " position");
- return;
- }
-
- if (edge.indexOf("before") == 0)
- check1 = isWithinHalfPixel(anchorrect.top + offsetY, popuprect.bottom);
- else if (edge.indexOf("after") == 0)
- check1 = (Math.round(anchorrect.bottom) + offsetY == Math.round(popuprect.top));
- else if (edge.indexOf("start") == 0)
- check1 = isWithinHalfPixel(anchorrect.left + offsetX, popuprect.right);
- else if (edge.indexOf("end") == 0)
- check1 = (Math.round(anchorrect.right) + offsetX == Math.round(popuprect.left));
-
- if (0 < edge.indexOf("before"))
- check2 = (Math.round(anchorrect.top) + offsetY == Math.round(popuprect.top));
- else if (0 < edge.indexOf("after"))
- check2 = isWithinHalfPixel(anchorrect.bottom + offsetY, popuprect.bottom);
- else if (0 < edge.indexOf("start"))
- check2 = (Math.round(anchorrect.left) + offsetX == Math.round(popuprect.left));
- else if (0 < edge.indexOf("end"))
- check2 = isWithinHalfPixel(anchorrect.right + offsetX, popuprect.right);
-
- ok(check1 && check2, testname + " position");
-}
diff --git a/toolkit/content/tests/widgets/seek_with_sound.ogg b/toolkit/content/tests/widgets/seek_with_sound.ogg
deleted file mode 100644
index c86d9946b..000000000
--- a/toolkit/content/tests/widgets/seek_with_sound.ogg
+++ /dev/null
Binary files differ
diff --git a/toolkit/content/tests/widgets/test_audiocontrols_dimensions.html b/toolkit/content/tests/widgets/test_audiocontrols_dimensions.html
deleted file mode 100644
index 0f295cce9..000000000
--- a/toolkit/content/tests/widgets/test_audiocontrols_dimensions.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Audio controls test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content">
- <audio id="audio" controls preload="auto"></audio>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
- function loadedmetadata(event) {
- is(event.type, "loadedmetadata", "checking event type");
- is(audio.clientHeight, 28, "checking height of audio element");
-
- SimpleTest.finish();
- }
-
- var audio = document.getElementById("audio");
-
- SpecialPowers.pushPrefEnv({"set": [["media.cache_size", 40000]]}, startTest);
- function startTest() {
- // Kick off test once audio has loaded.
- audio.addEventListener("loadedmetadata", loadedmetadata, false);
- audio.src = "audio.wav";
- }
-
- SimpleTest.waitForExplicitFinish();
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/test_bug898940.html b/toolkit/content/tests/widgets/test_bug898940.html
deleted file mode 100644
index 10a6a80d9..000000000
--- a/toolkit/content/tests/widgets/test_bug898940.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test that an audio element that's already playing when controls are attached displays the controls</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content">
- <audio id="audio" controls src="audio.ogg"></audio>
-</div>
-
-<pre id="test">
-<script class="testbody">
- var audio = document.getElementById("audio");
- audio.play();
- audio.ontimeupdate = function doTest() {
- ok(audio.getBoundingClientRect().height > 0,
- "checking audio element height is greater than zero");
- audio.ontimeupdate = null;
- SimpleTest.finish();
- }
-
- SimpleTest.waitForExplicitFinish();
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/test_contextmenu_menugroup.xul b/toolkit/content/tests/widgets/test_contextmenu_menugroup.xul
deleted file mode 100644
index 594c0264d..000000000
--- a/toolkit/content/tests/widgets/test_contextmenu_menugroup.xul
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Context menugroup Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="application/javascript" src="popup_shared.js"></script>
-
-<menupopup id="context">
- <menugroup>
- <menuitem id="a"/>
- <menuitem id="b"/>
- </menugroup>
- <menuitem id="c" label="c"/>
- <menugroup/>
-</menupopup>
-
-<button label="Check"/>
-
-<vbox id="popuparea" popup="context" width="20" height="20"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var gMenuPopup = $("context");
-ok(gMenuPopup, "Got the reference to the context menu");
-
-var popupTests = [
-{
- testname: "one-down-key",
- condition: function() { return (navigator.platform.indexOf("Mac") == -1); },
- events: [ "popupshowing context", "popupshown context", "DOMMenuItemActive a" ],
- test: function () {
- synthesizeMouse($("popuparea"), 4, 4, {});
- synthesizeKey("VK_DOWN", {});
- },
- result: function (testname) {
- checkActive(gMenuPopup, "a", testname);
- }
-},
-{
- testname: "two-down-keys",
- condition: function() { return (navigator.platform.indexOf("Mac") == -1); },
- events: [ "DOMMenuItemInactive a", "DOMMenuItemActive b" ],
- test: () => synthesizeKey("VK_DOWN", {}),
- result: function (testname) {
- checkActive(gMenuPopup, "b", testname);
- }
-},
-{
- testname: "three-down-keys",
- condition: function() { return (navigator.platform.indexOf("Mac") == -1); },
- events: [ "DOMMenuItemInactive b", "DOMMenuItemActive c" ],
- test: () => synthesizeKey("VK_DOWN", {}),
- result: function (testname) {
- checkActive(gMenuPopup, "c", testname);
- }
-},
-{
- testname: "three-down-keys-one-up-key",
- condition: function() { return (navigator.platform.indexOf("Mac") == -1); },
- events: [ "DOMMenuItemInactive c", "DOMMenuItemActive b" ],
- test: () => synthesizeKey("VK_UP", {}),
- result: function (testname) {
- checkActive(gMenuPopup, "b", testname);
- }
-},
-{
- testname: "three-down-keys-two-up-keys",
- condition: function() { return (navigator.platform.indexOf("Mac") == -1); },
- events: [ "DOMMenuItemInactive b", "DOMMenuItemActive a" ],
- test: () => synthesizeKey("VK_UP", {}),
- result: function (testname) {
- checkActive(gMenuPopup, "a", testname);
- }
-},
-{
- testname: "three-down-keys-three-up-key",
- condition: function() { return (navigator.platform.indexOf("Mac") == -1); },
- events: [ "DOMMenuItemInactive a", "DOMMenuItemActive c" ],
- test: () => synthesizeKey("VK_UP", {}),
- result: function (testname) {
- checkActive(gMenuPopup, "c", testname);
- }
-},
-];
-
-SimpleTest.waitForFocus(function runTest() {
- startPopupTests(popupTests);
-});
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml"><p id="display"/></body>
-
-</window>
diff --git a/toolkit/content/tests/widgets/test_contextmenu_nested.xul b/toolkit/content/tests/widgets/test_contextmenu_nested.xul
deleted file mode 100644
index 9eb42a1ed..000000000
--- a/toolkit/content/tests/widgets/test_contextmenu_nested.xul
+++ /dev/null
@@ -1,138 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Nested Context Menu Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="application/javascript" src="popup_shared.js"></script>
-
-<menupopup id="outercontext">
- <menuitem label="Context One"/>
- <menu id="outercontextmenu" label="Sub">
- <menupopup id="innercontext">
- <menuitem id="innercontextmenu" label="Sub Context One"/>
- </menupopup>
- </menu>
-</menupopup>
-
-<menupopup id="outermain">
- <menuitem label="One"/>
- <menu id="outermenu" label="Sub">
- <menupopup id="innermain">
- <menuitem id="innermenu" label="Sub One" context="outercontext"/>
- </menupopup>
- </menu>
-</menupopup>
-
-<button label="Check"/>
-
-<vbox id="popuparea" popup="outermain" width="20" height="20"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-var popupTests = [
-{
- testname: "open outer popup",
- events: [ "popupshowing outermain", "popupshown outermain" ],
- test: () => synthesizeMouse($("popuparea"), 4, 4, {}),
- result: function (testname) {
- is($("outermain").triggerNode, $("popuparea"), testname);
- is(document.popupNode, $("popuparea"), testname + " document.popupNode");
- }
-},
-{
- testname: "open inner popup",
- events: [ "DOMMenuItemActive outermenu", "popupshowing innermain", "popupshown innermain" ],
- test: function () {
- synthesizeMouse($("outermenu"), 4, 4, { type: "mousemove" });
- synthesizeMouse($("outermenu"), 2, 2, { type: "mousemove" });
- },
- result: function (testname) {
- is($("outermain").triggerNode, $("popuparea"), testname + " outer");
- is($("innermain").triggerNode, $("popuparea"), testname + " inner");
- is($("outercontext").triggerNode, null, testname + " outer context");
- is(document.popupNode, $("popuparea"), testname + " document.popupNode");
- }
-},
-{
- testname: "open outer context",
- condition: function() { return (navigator.platform.indexOf("Mac") == -1); },
- events: [ "popupshowing outercontext", "popupshown outercontext" ],
- test: () => synthesizeMouse($("innermenu"), 4, 4, { type: "contextmenu", button: 2 }),
- result: function (testname) {
- is($("outermain").triggerNode, $("popuparea"), testname + " outer");
- is($("innermain").triggerNode, $("popuparea"), testname + " inner");
- is($("outercontext").triggerNode, $("innermenu"), testname + " outer context");
- is(document.popupNode, $("innermenu"), testname + " document.popupNode");
- }
-},
-{
- testname: "open inner context",
- condition: function() { return (navigator.platform.indexOf("Mac") == -1); },
- events: [ "DOMMenuItemActive outercontextmenu", "popupshowing innercontext", "popupshown innercontext" ],
- test: function () {
- synthesizeMouse($("outercontextmenu"), 4, 4, { type: "mousemove" });
- setTimeout(function() {
- synthesizeMouse($("outercontextmenu"), 2, 2, { type: "mousemove" });
- }, 1000);
- },
- result: function (testname) {
- is($("outermain").triggerNode, $("popuparea"), testname + " outer");
- is($("innermain").triggerNode, $("popuparea"), testname + " inner");
- is($("outercontext").triggerNode, $("innermenu"), testname + " outer context");
- is($("innercontext").triggerNode, $("innermenu"), testname + " inner context");
- is(document.popupNode, $("innermenu"), testname + " document.popupNode");
- }
-},
-{
- testname: "close context",
- condition: function() { return (navigator.platform.indexOf("Mac") == -1); },
- events: [ "popuphiding innercontext", "popuphidden innercontext",
- "popuphiding outercontext", "popuphidden outercontext",
- "DOMMenuInactive innercontext",
- "DOMMenuItemInactive outercontextmenu", "DOMMenuItemInactive outercontextmenu",
- "DOMMenuInactive outercontext" ],
- test: () => $("outercontext").hidePopup(),
- result: function (testname) {
- is($("outermain").triggerNode, $("popuparea"), testname + " outer");
- is($("innermain").triggerNode, $("popuparea"), testname + " inner");
- is($("outercontext").triggerNode, null, testname + " outer context");
- is($("innercontext").triggerNode, null, testname + " inner context");
- is(document.popupNode, $("popuparea"), testname + " document.popupNode");
- }
-},
-{
- testname: "hide menus",
- events: [ "popuphiding innermain", "popuphidden innermain",
- "popuphiding outermain", "popuphidden outermain",
- "DOMMenuInactive innermain",
- "DOMMenuItemInactive outermenu", "DOMMenuItemInactive outermenu",
- "DOMMenuInactive outermain" ],
-
- test: () => $("outermain").hidePopup(),
- result: function (testname) {
- is($("outermain").triggerNode, null, testname + " outer");
- is($("innermain").triggerNode, null, testname + " inner");
- is($("outercontext").triggerNode, null, testname + " outer context");
- is($("innercontext").triggerNode, null, testname + " inner context");
- is(document.popupNode, null, testname + " document.popupNode");
- }
-}
-];
-
-SimpleTest.waitForFocus(function runTest() {
- return startPopupTests(popupTests);
-});
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml"><p id="display"/></body>
-
-</window>
diff --git a/toolkit/content/tests/widgets/test_editor_currentURI.xul b/toolkit/content/tests/widgets/test_editor_currentURI.xul
deleted file mode 100644
index 20ab3af7c..000000000
--- a/toolkit/content/tests/widgets/test_editor_currentURI.xul
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin"
- type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="Editor currentURI Tests" onload="runTest();">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p/>
- <editor xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- id="editor"
- type="content"
- editortype="html"
- style="width: 400px; height: 100px;"/>
- <p/>
- <pre id="test">
- </pre>
- </body>
- <script class="testbody" type="application/javascript">
- <![CDATA[
-
- SimpleTest.waitForExplicitFinish();
-
- function runTest() {
- var editor = document.getElementById("editor");
- // Check that currentURI is a property of editor.
- var result = "currentURI" in editor;
- is(result, true, "currentURI is a property of editor");
- is(editor.currentURI.spec, "about:blank", "currentURI.spec is about:blank");
- SimpleTest.finish();
- }
-]]>
-</script>
-</window>
diff --git a/toolkit/content/tests/widgets/test_menubar.xul b/toolkit/content/tests/widgets/test_menubar.xul
deleted file mode 100644
index 7aa15fb2a..000000000
--- a/toolkit/content/tests/widgets/test_menubar.xul
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Menubar Popup Tests"
- onload="setTimeout(runTest, 0);"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <title>Menubar Popup Tests</title>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<script>
-SimpleTest.waitForExplicitFinish();
-function runTest()
-{
- window.open("window_menubar.xul", "_blank", "width=600,height=600");
-}
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/widgets/test_mousecapture_area.html b/toolkit/content/tests/widgets/test_mousecapture_area.html
deleted file mode 100644
index 532f41a5a..000000000
--- a/toolkit/content/tests/widgets/test_mousecapture_area.html
+++ /dev/null
@@ -1,109 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Mouse capture on area elements tests</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content">
- <!-- The border="0" on the images is needed so that when we use
- synthesizeMouse we don't accidentally target the border of the image and
- miss the area because synthesizeMouse gets the rect of the primary frame
- of the target (the area), which is the image due to bug 135040, which
- includes the border, but the events targetted at the border aren't
- targeted at the area. -->
-
- <!-- 20x20 of red -->
- <img id="image" border="0"
- src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAG0lEQVR42mP8z0A%2BYKJA76jmUc2jmkc1U0EzACKcASfOgGoMAAAAAElFTkSuQmCC"
- usemap="#Map"/>
-
- <map name="Map">
- <!-- area over the whole image -->
- <area id="area" onmousedown="this.setCapture();" onmouseup="this.releaseCapture();"
- shape="poly" coords="0,0, 0,20, 20,20, 20,0" href="javascript:void(0);"/>
- </map>
-
-
- <!-- 20x20 of red -->
- <img id="img1" border="0"
- src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAG0lEQVR42mP8z0A%2BYKJA76jmUc2jmkc1U0EzACKcASfOgGoMAAAAAElFTkSuQmCC"
- usemap="#sharedMap"/>
-
- <!-- 20x20 of red -->
- <img id="img2" border="0"
- src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAG0lEQVR42mP8z0A%2BYKJA76jmUc2jmkc1U0EzACKcASfOgGoMAAAAAElFTkSuQmCC"
- usemap="#sharedMap"/>
-
- <map name="sharedMap">
- <!-- area over the whole image -->
- <area id="sharedarea" onmousedown="this.setCapture();" onmouseup="this.releaseCapture();"
- shape="poly" coords="0,0, 0,20, 20,20, 20,0" href="javascript:void(0);"/>
- </map>
-
-
- <div id="otherelement" style="width: 100px; height: 100px;"></div>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-SimpleTest.expectAssertions(3);
-
-SimpleTest.waitForExplicitFinish();
-
-function runTests()
-{
- // XXX We send a useless click to each image to force it to setup its image
- // map, because flushing layout won't do it. Hopefully bug 135040 will make
- // this not suck.
- synthesizeMouse($("image"), 5, 5, { type: "mousedown" });
- synthesizeMouse($("image"), 5, 5, { type: "mouseup" });
- synthesizeMouse($("img1"), 5, 5, { type: "mousedown" });
- synthesizeMouse($("img1"), 5, 5, { type: "mouseup" });
- synthesizeMouse($("img2"), 5, 5, { type: "mousedown" });
- synthesizeMouse($("img2"), 5, 5, { type: "mouseup" });
-
-
- // test that setCapture works on an area element (bug 517737)
- var area = document.getElementById("area");
- synthesizeMouse(area, 5, 5, { type: "mousedown" });
- synthesizeMouseExpectEvent($("otherelement"), 5, 5, { type: "mousemove" },
- area, "mousemove", "setCapture works on areas");
- synthesizeMouse(area, 5, 5, { type: "mouseup" });
-
- // test that setCapture works on an area element when it is part of an image
- // map that is used by two images
-
- var img1 = document.getElementById("img1");
- var sharedarea = document.getElementById("sharedarea");
- // synthesizeMouse just sends the event by coordinates, so this is really a click on the area
- synthesizeMouse(img1, 5, 5, { type: "mousedown" });
- synthesizeMouseExpectEvent($("otherelement"), 5, 5, { type: "mousemove" },
- sharedarea, "mousemove", "setCapture works on areas with multiple images");
- synthesizeMouse(img1, 5, 5, { type: "mouseup" });
-
- var img2 = document.getElementById("img2");
- // synthesizeMouse just sends the event by coordinates, so this is really a click on the area
- synthesizeMouse(img2, 5, 5, { type: "mousedown" });
- synthesizeMouseExpectEvent($("otherelement"), 5, 5, { type: "mousemove" },
- sharedarea, "mousemove", "setCapture works on areas with multiple images");
- synthesizeMouse(img2, 5, 5, { type: "mouseup" });
-
- // Bug 862673 - nuke all content so assertions in this test are attributed to
- // this test rather than the one which happens to follow.
- var content = document.getElementById("content");
- content.parentNode.removeChild(content);
- SimpleTest.finish();
-}
-
-SimpleTest.waitForFocus(runTests);
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/test_popupanchor.xul b/toolkit/content/tests/widgets/test_popupanchor.xul
deleted file mode 100644
index 814d9272f..000000000
--- a/toolkit/content/tests/widgets/test_popupanchor.xul
+++ /dev/null
@@ -1,430 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Popup Anchor Tests"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <panel id="testPanel"
- type="arrow"
- animate="false"
- noautohide="true">
- </panel>
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<script>
-<![CDATA[
-var anchor, panel, arrow;
-
-function is_close(got, exp, msg) {
- // on some platforms we see differences of a fraction of a pixel - so
- // allow any difference of < 1 pixels as being OK.
- ok(Math.abs(got - exp) < 1, msg + ": " + got + " should be equal(-ish) to " + exp);
-}
-
-function isArrowPositionedOn(side, offset) {
- var arrowRect = arrow.getBoundingClientRect();
- var arrowMidX = (arrowRect.left + arrowRect.right) / 2;
- var arrowMidY = (arrowRect.top + arrowRect.bottom) / 2;
- var panelRect = panel.getBoundingClientRect();
- var panelMidX = (panelRect.left + panelRect.right) / 2;
- var panelMidY = (panelRect.top + panelRect.bottom) / 2;
- // First check the "flip" of the panel is correct. If we are expecting the
- // arrow to be pointing to the left side of the anchor, the arrow must
- // also be on the left side of the panel (and vice-versa)
- // XXX - on OSX, the arrow seems to always be exactly in the center, hence
- // the 'equals' sign in the "<=" and ">=" comparisons. NFI why though...
- switch (side) {
- case "left":
- ok(arrowMidX <= panelMidX, "arrow should be on the left of the panel");
- break;
- case "right":
- ok(arrowMidX >= panelMidX, "arrow should be on the right of the panel");
- break;
- case "top":
- ok(arrowMidY <= panelMidY, "arrow should be on the top of the panel");
- break;
- case "bottom":
- ok(arrowMidY >= panelMidY, "arrow should be on the bottom of the panel");
- break;
- default:
- ok(false, "invalid position " + where);
- break;
- }
- // Now check the arrow really is pointing where we expect. The middle of
- // the arrow should be pointing exactly to the left (or right) side of the
- // anchor rect, +- any offsets.
- if (offset === null) // special case - explicit 'null' means 'don't check offset'
- return;
- offset = offset || 0; // no param means no offset expected.
- var anchorRect = anchor.getBoundingClientRect();
- var anchorPos = anchorRect[side];
- switch (side) {
- case "left":
- case "right":
- is_close(arrowMidX - anchorPos, offset, "arrow should be " + offset + "px from " + side + " side of anchor");
- is_close(panelRect.top, anchorRect.bottom, "top of panel should be at bottom of anchor");
- break;
- case "top":
- case "bottom":
- is_close(arrowMidY - anchorPos, offset, "arrow should be " + offset + "px from " + side + " side of anchor");
- is_close(panelRect.right, anchorRect.left, "right of panel should be left of anchor");
- break;
- default:
- ok(false, "unknown side " + side);
- break;
- }
-}
-
-function openSlidingPopup(position, callback) {
- panel.setAttribute("flip", "slide");
- _openPopup(position, callback);
-}
-
-function openPopup(position, callback) {
- panel.setAttribute("flip", "both");
- _openPopup(position, callback);
-}
-
-function waitForPopupPositioned(actionFn, callback)
-{
- panel.addEventListener("popuppositioned", function listener() {
- panel.removeEventListener("popuppositioned", listener, false);
- callback();
- }, false);
- actionFn();
-}
-
-function _openPopup(position, callback) {
- // this is very ugly: the panel CSS sets the arrow's list-style-image based
- // on the 'side' attribute. If the setting of the 'side' attribute causes
- // the image to change, we may get the popupshown event before the new
- // image has loaded - which causes the size of the arrow to be incorrect
- // for a brief moment - right when we are measuring it!
- // So we work around this in 2 steps:
- // * Force the 'side' attribute to a value which causes the CSS to not
- // specify an image - then when the popup gets shown, the correct image
- // is set, causing a load() event on the image element.
- // * Listen to *both* popupshown and the image load event. When both have
- // fired (the order is indeterminate) we start the test.
- panel.setAttribute("side", "noside");
- var numEvents = 0;
- function onEvent() {
- if (++numEvents == 2) // after both panel 'popupshown' and image 'load'
- callback();
- };
- panel.addEventListener("popupshown", function popupshown() {
- panel.removeEventListener("popupshown", popupshown);
- onEvent();
- });
- arrow.addEventListener("load", function imageload() {
- arrow.removeEventListener("load", imageload);
- onEvent();
- });
- panel.openPopup(anchor, position);
-}
-
-var tests = [
- // A panel with the anchor after_end - the anchor should not move on resize
- ['simpleResizeHorizontal', 'middle', function(next) {
- openPopup("after_end", function() {
- isArrowPositionedOn("right");
- var origPanelRect = panel.getBoundingClientRect();
- panel.sizeTo(100, 100);
- isArrowPositionedOn("right"); // should not have flipped, so still "right"
- panel.sizeTo(origPanelRect.width, origPanelRect.height);
- isArrowPositionedOn("right"); // should not have flipped, so still "right"
- next();
- });
- }],
-
- ['simpleResizeVertical', 'middle', function(next) {
- openPopup("start_after", function() {
- isArrowPositionedOn("bottom");
- var origPanelRect = panel.getBoundingClientRect();
- panel.sizeTo(100, 100);
- isArrowPositionedOn("bottom"); // should not have flipped
- panel.sizeTo(origPanelRect.width, origPanelRect.height);
- isArrowPositionedOn("bottom"); // should not have flipped
- next();
- });
- }],
-
- ['flippingResizeHorizontal', 'middle', function(next) {
- openPopup("after_end", function() {
- isArrowPositionedOn("right");
- panel.sizeTo(anchor.getBoundingClientRect().left + 50, 50);
- isArrowPositionedOn("left"); // check it flipped and has zero offset.
- next();
- });
- }],
-
- ['flippingResizeVertical', 'middle', function(next) {
- openPopup("start_after", function() {
- isArrowPositionedOn("bottom");
- panel.sizeTo(50, anchor.getBoundingClientRect().top + 50);
- isArrowPositionedOn("top"); // check it flipped and has zero offset.
- next();
- });
- }],
-
- ['simpleMoveToAnchorHorizontal', 'middle', function(next) {
- openPopup("after_end", function() {
- isArrowPositionedOn("right");
- panel.moveToAnchor(anchor, "after_end", 20, 0);
- // the anchor and the panel should have moved 20px right without flipping.
- isArrowPositionedOn("right", 20);
- panel.moveToAnchor(anchor, "after_end", -20, 0);
- // the anchor and the panel should have moved 20px left without flipping.
- isArrowPositionedOn("right", -20);
- next();
- });
- }],
-
- ['simpleMoveToAnchorVertical', 'middle', function(next) {
- openPopup("start_after", function() {
- isArrowPositionedOn("bottom");
- panel.moveToAnchor(anchor, "start_after", 0, 20);
- // the anchor and the panel should have moved 20px down without flipping.
- isArrowPositionedOn("bottom", 20);
- panel.moveToAnchor(anchor, "start_after", 0, -20);
- // the anchor and the panel should have moved 20px up without flipping.
- isArrowPositionedOn("bottom", -20);
- next();
- });
- }],
-
- // Do a moveToAnchor that causes the panel to flip horizontally
- ['flippingMoveToAnchorHorizontal', 'middle', function(next) {
- var anchorRight = anchor.getBoundingClientRect().right;
- // Size the panel such that it only just fits from the left-hand side of
- // the window to the right of the anchor - thus, it will fit when
- // anchored to the right-hand side of the anchor.
- panel.sizeTo(anchorRight - 10, 100);
- openPopup("after_end", function() {
- isArrowPositionedOn("right");
- // Ask for it to be anchored 1/2 way between the left edge of the window
- // and the anchor right - it can't fit with the panel on the left/arrow
- // on the right, so it must flip (arrow on the left, panel on the right)
- var offset = Math.floor(-anchorRight / 2);
-
- waitForPopupPositioned(
- () => panel.moveToAnchor(anchor, "after_end", offset, 0),
- () => {
- isArrowPositionedOn("left", offset); // should have flipped and have the offset.
- // resize back to original and move to a zero offset - it should flip back.
-
- panel.sizeTo(anchorRight - 10, 100);
- waitForPopupPositioned(
- () => panel.moveToAnchor(anchor, "after_end", 0, 0),
- () => {
- isArrowPositionedOn("right"); // should have flipped back and no offset
- next();
- });
- });
- });
- }],
-
- // Do a moveToAnchor that causes the panel to flip vertically
- ['flippingMoveToAnchorVertical', 'middle', function(next) {
- var anchorBottom = anchor.getBoundingClientRect().bottom;
- // See comments above in flippingMoveToAnchorHorizontal, but read
- // "top/bottom" instead of "left/right"
- panel.sizeTo(100, anchorBottom - 10);
- openPopup("start_after", function() {
- isArrowPositionedOn("bottom");
- var offset = Math.floor(-anchorBottom / 2);
-
- waitForPopupPositioned(
- () => panel.moveToAnchor(anchor, "start_after", 0, offset),
- () => {
- isArrowPositionedOn("top", offset);
- panel.sizeTo(100, anchorBottom - 10);
-
- waitForPopupPositioned(
- () => panel.moveToAnchor(anchor, "start_after", 0, 0),
- () => {
- isArrowPositionedOn("bottom");
- next();
- });
- });
- });
- }],
-
- ['veryWidePanel-after_end', 'middle', function(next) {
- openSlidingPopup("after_end", function() {
- var origArrowRect = arrow.getBoundingClientRect();
- // Now move it such that the arrow can't be at either end of the panel but
- // instead somewhere in the middle as that is the only way things fit,
- // meaning the arrow should "slide" down the panel.
- panel.sizeTo(window.innerWidth - 10, 60);
- is(panel.getBoundingClientRect().width, window.innerWidth - 10, "width is what we requested.")
- // the arrow should not have moved.
- var curArrowRect = arrow.getBoundingClientRect();
- is_close(curArrowRect.left, origArrowRect.left, "arrow should not have moved");
- is_close(curArrowRect.top, origArrowRect.top, "arrow should not have moved up or down");
- next();
- });
- }],
-
- ['veryWidePanel-before_start', 'middle', function(next) {
- openSlidingPopup("before_start", function() {
- var origArrowRect = arrow.getBoundingClientRect();
- // Now size it such that the arrow can't be at either end of the panel but
- // instead somewhere in the middle as that is the only way things fit.
- panel.sizeTo(window.innerWidth - 10, 60);
- is(panel.getBoundingClientRect().width, window.innerWidth - 10, "width is what we requested")
- // the arrow should not have moved.
- var curArrowRect = arrow.getBoundingClientRect();
- is_close(curArrowRect.left, origArrowRect.left, "arrow should not have moved");
- is_close(curArrowRect.top, origArrowRect.top, "arrow should not have moved up or down");
- next();
- });
- }],
-
- ['veryTallPanel-start_after', 'middle', function(next) {
- openSlidingPopup("start_after", function() {
- var origArrowRect = arrow.getBoundingClientRect();
- // Now move it such that the arrow can't be at either end of the panel but
- // instead somewhere in the middle as that is the only way things fit,
- // meaning the arrow should "slide" down the panel.
- panel.sizeTo(100, window.innerHeight - 10);
- is(panel.getBoundingClientRect().height, window.innerHeight - 10, "height is what we requested.")
- // the arrow should not have moved.
- var curArrowRect = arrow.getBoundingClientRect();
- is_close(curArrowRect.left, origArrowRect.left, "arrow should not have moved");
- is_close(curArrowRect.top, origArrowRect.top, "arrow should not have moved up or down");
- next();
- });
- }],
-
- ['veryTallPanel-start_before', 'middle', function(next) {
- openSlidingPopup("start_before", function() {
- var origArrowRect = arrow.getBoundingClientRect();
- // Now size it such that the arrow can't be at either end of the panel but
- // instead somewhere in the middle as that is the only way things fit.
- panel.sizeTo(100, window.innerHeight - 10);
- is(panel.getBoundingClientRect().height, window.innerHeight - 10, "height is what we requested")
- // the arrow should not have moved.
- var curArrowRect = arrow.getBoundingClientRect();
- is_close(curArrowRect.left, origArrowRect.left, "arrow should not have moved");
- is_close(curArrowRect.top, origArrowRect.top, "arrow should not have moved up or down");
- next();
- });
- }],
-
- // Tests against the anchor at the right-hand side of the window
- ['afterend', 'right', function(next) {
- openPopup("after_end", function() {
- // when we request too far to the right/bottom, the panel gets shrunk
- // and moved. The amount it is shrunk by is how far it is moved.
- var panelRect = panel.getBoundingClientRect();
- // panel was requested 100px wide - calc offset based on actual width.
- var offset = panelRect.width - 100;
- isArrowPositionedOn("right", offset);
- next();
- });
- }],
-
- ['after_start', 'right', function(next) {
- openPopup("after_start", function() {
- // See above - we are still too far to the right, but the anchor is
- // on the other side.
- var panelRect = panel.getBoundingClientRect();
- var offset = panelRect.width - 100;
- isArrowPositionedOn("right", offset);
- next();
- });
- }],
-
- // Tests against the anchor at the left-hand side of the window
- ['after_start', 'left', function(next) {
- openPopup("after_start", function() {
- var panelRect = panel.getBoundingClientRect();
- is(panelRect.left, 0, "panel remains within the screen");
- // not sure how to determine the offset here, so given we have checked
- // the panel is as left as possible while still being inside the window,
- // we just don't check the offset.
- isArrowPositionedOn("left", null);
- next();
- });
- }],
-]
-
-function runTests() {
- function runNextTest() {
- let result = tests.shift();
- if (!result) {
- // out of tests
- panel.hidePopup();
- SimpleTest.finish();
- return;
- }
- let [name, anchorPos, test] = result;
- SimpleTest.info("sub-test " + anchorPos + "." + name + " starting");
- // first arrange for the anchor to be where the test requires it.
- panel.hidePopup();
- panel.sizeTo(100, 50);
- // hide all the anchors here, then later we make one of them visible.
- document.getElementById("anchor-left-wrapper").style.display = "none";
- document.getElementById("anchor-middle-wrapper").style.display = "none";
- document.getElementById("anchor-right-wrapper").style.display = "none";
- switch(anchorPos) {
- case 'middle':
- anchor = document.getElementById("anchor-middle");
- document.getElementById("anchor-middle-wrapper").style.display = "block";
- break;
- case 'left':
- anchor = document.getElementById("anchor-left");
- document.getElementById("anchor-left-wrapper").style.display = "block";
- break;
- case 'right':
- anchor = document.getElementById("anchor-right");
- document.getElementById("anchor-right-wrapper").style.display = "block";
- break;
- default:
- SimpleTest.ok(false, "Bad anchorPos: " + anchorPos);
- runNextTest();
- return;
- }
- try {
- test(runNextTest);
- } catch (ex) {
- SimpleTest.ok(false, "sub-test " + anchorPos + "." + name + " failed: " + ex.toString() + "\n" + ex.stack);
- runNextTest();
- }
- }
- runNextTest();
-}
-
-SimpleTest.waitForExplicitFinish();
-
-addEventListener("load", function() {
- // anchor is set by the test runner above
- panel = document.getElementById("testPanel");
-
- arrow = SpecialPowers.wrap(document).getAnonymousElementByAttribute(panel, "anonid", "arrow");
- runTests();
-});
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<!-- Our tests assume at least 100px around the anchor on all sides, else the
- panel may flip when we don't expect it to
--->
-<div id="anchor-middle-wrapper" style="margin: 100px 100px 100px 100px;">
- <p>The anchor --&gt; <span id="anchor-middle">v</span> &lt;--</p>
-</div>
-<div id="anchor-left-wrapper" style="text-align: left; display: none;">
- <p><span id="anchor-left">v</span> &lt;-- The anchor;</p>
-</div>
-<div id="anchor-right-wrapper" style="text-align: right; display: none;">
- <p>The anchor --&gt; <span id="anchor-right">v</span></p>
-</div>
-</body>
-
-</window>
diff --git a/toolkit/content/tests/widgets/test_popupreflows.xul b/toolkit/content/tests/widgets/test_popupreflows.xul
deleted file mode 100644
index 6969f7767..000000000
--- a/toolkit/content/tests/widgets/test_popupreflows.xul
+++ /dev/null
@@ -1,111 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Popup Reflow Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <panel id="testPanel"
- type="arrow"
- noautohide="true">
- </panel>
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
-<script>
-<![CDATA[
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-
-let panel, anchor, arrow;
-
-// A reflow observer - it just remembers the stack trace of all sync reflows
-// done by the panel.
-let observer = {
- reflows: [],
- reflow: function (start, end) {
- // Ignore reflows triggered by native code
- // (Reflows from native code only have an empty stack after the first frame)
- var path = (new Error().stack).split("\n").slice(1).join("");
- if (path === "") {
- return;
- }
-
- this.reflows.push(new Error().stack);
- },
-
- reflowInterruptible: function (start, end) {
- // We're not interested in interruptible reflows. Why, you ask? Because
- // we've simply cargo-culted this test from browser_tabopen_reflows.js!
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIReflowObserver,
- Ci.nsISupportsWeakReference])
-};
-
-// A test utility that counts the reflows caused by a test function. If the
-// count of reflows isn't what is expected, it causes a test failure and logs
-// the stack trace of all seen reflows.
-function countReflows(testfn, expected) {
- let deferred = Promise.defer();
- observer.reflows = [];
- let docShell = panel.ownerDocument.defaultView
- .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIWebNavigation)
- .QueryInterface(Components.interfaces.nsIDocShell);
- docShell.addWeakReflowObserver(observer);
- testfn().then(() => {
- docShell.removeWeakReflowObserver(observer);
- SimpleTest.is(observer.reflows.length, expected, "correct number of reflows");
- if (observer.reflows.length != expected) {
- SimpleTest.info("stack traces of reflows:\n" + observer.reflows.join("\n") + "\n");
- }
- deferred.resolve();
- });
- return deferred.promise
-}
-
-function openPopup() {
- let deferred = Promise.defer();
- panel.addEventListener("popupshown", function popupshown() {
- panel.removeEventListener("popupshown", popupshown);
- deferred.resolve();
- });
- panel.openPopup(anchor, "before_start");
- return deferred.promise
-}
-
-// ********************
-// The actual tests...
-// We only have one atm - simply open a popup.
-//
-function testSimplePanel() {
- return openPopup();
-}
-
-// ********************
-// The test harness...
-//
-SimpleTest.waitForExplicitFinish();
-
-addEventListener("load", function() {
- anchor = document.getElementById("anchor");
- panel = document.getElementById("testPanel");
- arrow = document.getAnonymousElementByAttribute(panel, "anonid", "arrow");
-
- // Cancel the arrow panel slide-in transition (bug 767133) - we are only
- // testing reflows in the core panel implementation and not reflows that may
- // or may not be caused by transitioning....
- arrow.style.transition = "none";
-
- // and off we go...
- countReflows(testSimplePanel, 1).then(SimpleTest.finish);
-});
-]]>
-</script>
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p>The anchor --&gt; <span id="anchor">v</span> &lt;--</p>
-</body>
-</window>
diff --git a/toolkit/content/tests/widgets/test_tree_column_reorder.xul b/toolkit/content/tests/widgets/test_tree_column_reorder.xul
deleted file mode 100644
index 5315fee43..000000000
--- a/toolkit/content/tests/widgets/test_tree_column_reorder.xul
+++ /dev/null
@@ -1,76 +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"?>
-<!--
- XUL Widget Test for reordering tree columns
- -->
-<window title="Tree" width="500" height="600"
- onload="setTimeout(testtag_tree_column_reorder, 0);"
- 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="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<script src="tree_shared.js"/>
-
-<tree id="tree-column-reorder" rows="1" enableColumnDrag="true">
- <treecols>
- <treecol id="col_0" label="col_0" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="col_1" label="col_1" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="col_2" label="col_2" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="col_3" label="col_3" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="col_4" label="col_4" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="col_5" label="col_5" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="col_6" label="col_6" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="col_7" label="col_7" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="col_8" label="col_8" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="col_9" label="col_9" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="col_10" label="col_10" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="col_11" label="col_11" flex="1"/>
- <splitter class="tree-splitter"/>
- <treecol id="col_12" label="col_12" flex="1"/>
- </treecols>
- <treechildren id="treechildren-column-reorder">
- <treeitem>
- <treerow>
- <treecell label="col_0"/>
- <treecell label="col_1"/>
- <treecell label="col_2"/>
- <treecell label="col_3"/>
- <treecell label="col_4"/>
- <treecell label="col_5"/>
- <treecell label="col_6"/>
- <treecell label="col_7"/>
- <treecell label="col_8"/>
- <treecell label="col_9"/>
- <treecell label="col_10"/>
- <treecell label="col_11"/>
- <treecell label="col_12"/>
- </treerow>
- </treeitem>
- </treechildren>
-</tree>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-]]>
-</script>
-
-</window>
-
diff --git a/toolkit/content/tests/widgets/test_videocontrols.html b/toolkit/content/tests/widgets/test_videocontrols.html
deleted file mode 100644
index 146c63a72..000000000
--- a/toolkit/content/tests/widgets/test_videocontrols.html
+++ /dev/null
@@ -1,411 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Video controls test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content">
- <video width="320" height="240" id="video" controls mozNoDynamicControls preload="auto"></video>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-/*
- * Positions of the UI elements, relative to the upper-left corner of the
- * <video> box.
- */
-const videoWidth = 320;
-const videoHeight = 240;
-const videoDuration = 3.8329999446868896;
-
-const playButtonWidth = 28;
-const playButtonHeight = 28;
-const muteButtonWidth = 33;
-const muteButtonHeight = 28;
-const durationWidth = 34;
-const fullscreenButtonWidth = 28;
-const fullscreenButtonHeight = 28;
-const volumeSliderWidth = 32;
-const scrubberWidth = videoWidth - playButtonWidth - durationWidth - muteButtonWidth - volumeSliderWidth - fullscreenButtonWidth;
-const scrubberHeight = 28;
-
-// Play button is on the bottom-left
-const playButtonCenterX = 0 + Math.round(playButtonWidth / 2);
-const playButtonCenterY = videoHeight - Math.round(playButtonHeight / 2);
-// Mute button is on the bottom-right before the full screen button and volume slider
-const muteButtonCenterX = videoWidth - Math.round(muteButtonWidth / 2) - volumeSliderWidth - fullscreenButtonWidth;
-const muteButtonCenterY = videoHeight - Math.round(muteButtonHeight / 2);
-// Fullscreen button is on the bottom-right at the far end
-const fullscreenButtonCenterX = videoWidth - Math.round(fullscreenButtonWidth / 2);
-const fullscreenButtonCenterY = videoHeight - Math.round(fullscreenButtonHeight / 2);
-// Scrubber bar is between the play and mute buttons. We don't need it's
-// X center, just the offset of its box.
-const scrubberOffsetX = 0 + playButtonWidth;
-const scrubberCenterY = videoHeight - Math.round(scrubberHeight / 2);
-
-var testnum = 1;
-var video = document.getElementById("video");
-
-const domUtil = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"]
- .getService(SpecialPowers.Ci.inIDOMUtils);
-
-function getButtonByAttribute(aName, aValue) {
- var kids = domUtil.getChildrenForNode(video, true);
- var videocontrols = kids[1];
- return SpecialPowers.wrap(document)
- .getAnonymousElementByAttribute(videocontrols, aName, aValue);
-}
-
-function isMuteButtonMuted() {
- var muteButton = getButtonByAttribute('class', 'muteButton');
- return muteButton.getAttribute('muted') === 'true';
-}
-
-function isVolumeSliderShowingCorrectVolume(expectedVolume) {
- var volumeButton = getButtonByAttribute('anonid', 'volumeForeground');
- let expectedPaddingRight = (1 - expectedVolume) * volumeSliderWidth + "px";
- is(volumeButton.style.paddingRight, expectedPaddingRight,
- "volume slider should match expected volume");
-}
-
-function forceReframe() {
- // Setting display then getting the bounding rect to force a frame
- // reconstruction on the video element.
- video.style.display = "block";
- video.getBoundingClientRect();
- video.style.display = "";
- video.getBoundingClientRect();
-}
-
-function runTest(event) {
- ok(true, "----- test #" + testnum + " -----");
-
- switch (testnum) {
- /*
- * Check operation of play/pause/mute/unmute buttons.
- */
- case 1:
- // Check initial state upon load
- is(event.type, "canplaythrough", "checking event type");
- is(video.paused, true, "checking video play state");
- is(video.muted, false, "checking video mute state");
-
- // Click the play button
- SimpleTest.executeSoon(() => {
- synthesizeMouse(video, playButtonCenterX, playButtonCenterY, { });
- });
- break;
-
- case 2:
- is(event.type, "play", "checking event type");
- is(video.paused, false, "checking video play state");
- is(video.muted, false, "checking video mute state");
-
- // Click the pause button
- SimpleTest.executeSoon(() => {
- synthesizeMouse(video, playButtonCenterX, playButtonCenterY, { });
- });
- break;
-
- case 3:
- is(event.type, "pause", "checking event type");
- is(video.paused, true, "checking video play state");
- is(video.muted, false, "checking video mute state");
-
- SimpleTest.executeSoon(() => {
- synthesizeMouse(video, muteButtonCenterX, muteButtonCenterY, { }); // Mute.
- });
- break;
-
- case 4:
- is(event.type, "volumechange", "checking event type");
- is(video.paused, true, "checking video play state");
- is(video.muted, true, "checking video mute state");
-
- SimpleTest.executeSoon(() => {
- synthesizeMouse(video, muteButtonCenterX, muteButtonCenterY, { }); // Unmute.
- });
- break;
-
- /*
- * Bug 470596: Make sure that having CSS border or padding doesn't
- * break the controls (though it should move them)
- */
- case 5:
- is(event.type, "volumechange", "checking event type");
- is(video.paused, true, "checking video play state");
- is(video.muted, false, "checking video mute state");
-
- video.style.border = "medium solid purple";
- video.style.borderWidth = "30px 40px 50px 60px";
- video.style.padding = "10px 20px 30px 40px";
- // totals: top: 40px, right: 60px, bottom: 80px, left: 100px
-
- // Click the play button
- SimpleTest.executeSoon(() => {
- synthesizeMouse(video, 100 + playButtonCenterX, 40 + playButtonCenterY, { });
- });
- break;
-
- case 6:
- is(event.type, "play", "checking event type");
- is(video.paused, false, "checking video play state");
- is(video.muted, false, "checking video mute state");
- video.pause();
- break;
-
- case 7:
- is(event.type, "pause", "checking event type");
- is(video.paused, true, "checking video play state");
- is(video.muted, false, "checking video mute state");
-
- // Click the mute button
- SimpleTest.executeSoon(() => {
- synthesizeMouse(video, 100 + muteButtonCenterX, 40 + muteButtonCenterY, { });
- });
- break;
-
- case 8:
- is(event.type, "volumechange", "checking event type");
- is(video.paused, true, "checking video play state");
- is(video.muted, true, "checking video mute state");
- // Clear the style set in test 5.
- video.style.border = "";
- video.style.borderWidth = "";
- video.style.padding = "";
-
- video.muted = false;
- break;
-
- /*
- * Previous tests have moved playback postion, reset it to 0.
- */
- case 9:
- is(event.type, "volumechange", "checking event type");
- is(video.paused, true, "checking video play state");
- is(video.muted, false, "checking video mute state");
- ok(true, "video position is at " + video.currentTime);
- video.currentTime = 0.0;
- break;
-
- case 10:
- is(event.type, "seeking", "checking event type");
- ok(true, "video position is at " + video.currentTime);
- break;
-
- /*
- * Drag the slider's thumb to the halfway point with the mouse.
- */
- case 11:
- is(event.type, "seeked", "checking event type");
- ok(true, "video position is at " + video.currentTime);
- // Bug 477434 -- sometimes we get 0.098999 here instead of 0!
- // is(video.currentTime, 0.0, "checking playback position");
-
- SimpleTest.executeSoon(() => {
- var beginDragX = scrubberOffsetX;
- var endDragX = scrubberOffsetX + (scrubberWidth / 2);
- synthesizeMouse(video, beginDragX, scrubberCenterY, { type: "mousedown", button: 0 });
- synthesizeMouse(video, endDragX, scrubberCenterY, { type: "mousemove", button: 0 });
- synthesizeMouse(video, endDragX, scrubberCenterY, { type: "mouseup", button: 0 });
- });
- break;
-
- case 12:
- is(event.type, "seeking", "checking event type");
- ok(true, "video position is at " + video.currentTime);
- break;
-
- /*
- * Click the slider at the 1/4 point with the mouse (jump backwards)
- */
- case 13:
- is(event.type, "seeked", "checking event type");
- ok(true, "video position is at " + video.currentTime);
- var expectedTime = videoDuration / 2;
- ok(Math.abs(video.currentTime - expectedTime) < 0.1, "checking expected playback position Math.abs(" + video.currentTime + " - " + expectedTime + ") < .1");
-
- SimpleTest.executeSoon(() => {
- synthesizeMouse(video, scrubberOffsetX + (scrubberWidth / 4), scrubberCenterY, { });
- });
- break;
-
- case 14:
- is(event.type, "seeking", "checking event type");
- ok(true, "video position is at " + video.currentTime);
- break;
-
- case 15:
- is(event.type, "seeked", "checking event type");
- ok(true, "video position is at " + video.currentTime);
- // The scrubber currently just jumps towards the nearest pageIncrement point, not
- // precisely to the point clicked. So, expectedTime isn't (videoDuration / 4).
- // We should end up at 1.733, but sometimes we end up at 1.498. I guess
- // it's timing depending if the <scale> things it's click-and-hold, or a
- // single click. So, just make sure we end up less that the previous
- // position.
- lastPosition = (videoDuration / 2) - 0.1;
- ok(video.currentTime < lastPosition, "checking expected playback position");
-
- // Set volume to 0.1 so one down arrow hit will decrease it to 0.
- video.volume = 0.1;
- break;
-
- // See bug 694696.
- case 16:
- is(event.type, "volumechange", "checking event type");
- is(video.volume, 0.1, "Volume should be set.");
- ok(!video.muted, "Video is not muted.");
-
- video.focus();
- SimpleTest.executeSoon(() => synthesizeKey("VK_DOWN", {}));
- break;
-
- case 17:
- is(event.type, "volumechange", "checking event type");
- is(video.volume, 0, "Volume should be 0.");
- ok(!video.muted, "Video is not muted.");
-
- SimpleTest.executeSoon(() => {
- ok(isMuteButtonMuted(), "Mute button says it's muted");
- synthesizeKey("VK_UP", {});
- });
- break;
-
- case 18:
- is(event.type, "volumechange", "checking event type");
- is(video.volume, 0.1, "Volume is increased.");
- ok(!video.muted, "Video is not muted.");
-
- SimpleTest.executeSoon(() => {
- ok(!isMuteButtonMuted(), "Mute button says it's not muted");
- synthesizeKey("VK_DOWN", {});
- });
- break;
-
- case 19:
- is(event.type, "volumechange", "checking event type");
- is(video.volume, 0, "Volume should be 0.");
- ok(!video.muted, "Video is not muted.");
-
- SimpleTest.executeSoon(() => {
- ok(isMuteButtonMuted(), "Mute button says it's muted");
- synthesizeMouse(video, muteButtonCenterX, muteButtonCenterY, { });
- });
- break;
-
- case 20:
- is(event.type, "volumechange", "checking event type");
- is(video.volume, 0.5, "Volume should be 0.5.");
- ok(!video.muted, "Video is not muted.");
-
- SimpleTest.executeSoon(() => synthesizeKey("VK_UP", {}));
- break;
-
- case 21:
- is(event.type, "volumechange", "checking event type");
- is(video.volume, 0.6, "Volume should be 0.6.");
- ok(!video.muted, "Video is not muted.");
-
- SimpleTest.executeSoon(() => {
- synthesizeMouse(video, muteButtonCenterX, muteButtonCenterY, { });
- });
- break;
-
- case 22:
- is(event.type, "volumechange", "checking event type");
- is(video.volume, 0.6, "Volume should be 0.6.");
- ok(video.muted, "Video is muted.");
-
- SimpleTest.executeSoon(() => {
- ok(isMuteButtonMuted(), "Mute button says it's muted");
- synthesizeMouse(video, muteButtonCenterX, muteButtonCenterY, { });
- });
- break;
-
- case 23:
- is(event.type, "volumechange", "checking event type");
- is(video.volume, 0.6, "Volume should be 0.6.");
- ok(!video.muted, "Video is not muted.");
-
- SimpleTest.executeSoon(() => {
- ok(!isMuteButtonMuted(), "Mute button says it's not muted");
- synthesizeMouse(video, fullscreenButtonCenterX, fullscreenButtonCenterY, { });
- });
- break;
-
- case 24:
- is(event.type, "mozfullscreenchange", "checking event type");
- is(video.volume, 0.6, "Volume should still be 0.6");
- SimpleTest.executeSoon(function() {
- isVolumeSliderShowingCorrectVolume(video.volume);
- synthesizeKey("VK_ESCAPE", {});
- });
- break;
-
- case 25:
- is(event.type, "mozfullscreenchange", "checking event type");
- is(video.volume, 0.6, "Volume should still be 0.6");
- SimpleTest.executeSoon(function() {
- isVolumeSliderShowingCorrectVolume(video.volume);
- forceReframe();
- video.focus();
- synthesizeKey("VK_DOWN", {});
- });
- break;
-
- case 26:
- is(event.type, "volumechange", "checking event type");
- is(video.volume, 0.5, "Volume should be decreased by 0.1");
- SimpleTest.executeSoon(function() {
- isVolumeSliderShowingCorrectVolume(video.volume);
- SimpleTest.finish();
- });
- break;
-
- default:
- throw "unexpected test #" + testnum + " w/ event " + event.type;
- }
-
- testnum++;
-}
-
-
-
-function canplaythroughevent(event) {
- video.removeEventListener("canplaythrough", canplaythroughevent, false);
- // Other events expected by the test.
- video.addEventListener("play", runTest, false);
- video.addEventListener("pause", runTest, false);
- video.addEventListener("volumechange", runTest, false);
- video.addEventListener("seeking", runTest, false);
- video.addEventListener("seeked", runTest, false);
- document.addEventListener("mozfullscreenchange", runTest, false);
- // Begin the test.
- runTest(event);
-}
-
-function startMediaLoad() {
- // Kick off test once video has loaded, in its canplaythrough event handler.
- video.src = "seek_with_sound.ogg";
- video.addEventListener("canplaythrough", canplaythroughevent, false);
-}
-
-function loadevent(event) {
- SpecialPowers.pushPrefEnv({"set": [["media.cache_size", 40000]]}, startMediaLoad);
-}
-
-window.addEventListener("load", loadevent, false);
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/test_videocontrols_audio.html b/toolkit/content/tests/widgets/test_videocontrols_audio.html
deleted file mode 100644
index 7d1dc32e3..000000000
--- a/toolkit/content/tests/widgets/test_videocontrols_audio.html
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Video controls with Audio file test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content">
- <video id="video" controls preload="metadata"></video>
-</div>
-
-<pre id="test">
-<script class="testbody" type="application/javascript;version=1.7">
-
- var domUtils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"].
- getService(SpecialPowers.Ci.inIDOMUtils);
-
- function findElementByAttribute(element, aName, aValue) {
- if (!('getAttribute' in element)) {
- return false;
- }
- if (element.getAttribute(aName) === aValue) {
- return element;
- }
- let children = domUtils.getChildrenForNode(element, true);
- for (let child of children) {
- var result = findElementByAttribute(child, aName, aValue);
- if (result) {
- return result;
- }
- }
- return false;
- }
-
- function loadedmetadata(event) {
- SimpleTest.executeSoon(function() {
- var controlBar = findElementByAttribute(video, "class", "controlBar");
- is(controlBar.getAttribute("fullscreen-unavailable"), "true", "Fullscreen button is hidden");
- SimpleTest.finish();
- });
- }
-
- var video = document.getElementById("video");
-
- SpecialPowers.pushPrefEnv({"set": [["media.cache_size", 40000]]}, startTest);
- function startTest() {
- // Kick off test once audio has loaded.
- video.addEventListener("loadedmetadata", loadedmetadata, false);
- video.src = "audio.ogg";
- }
-
- SimpleTest.waitForExplicitFinish();
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/test_videocontrols_audio_direction.html b/toolkit/content/tests/widgets/test_videocontrols_audio_direction.html
deleted file mode 100644
index 2512b997a..000000000
--- a/toolkit/content/tests/widgets/test_videocontrols_audio_direction.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Video controls directionality test</title>
- <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content">
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-var tests = [
- {op: "==", test: "videocontrols_direction-2a.html", ref: "videocontrols_direction-2-ref.html"},
- {op: "==", test: "videocontrols_direction-2b.html", ref: "videocontrols_direction-2-ref.html"},
- {op: "==", test: "videocontrols_direction-2c.html", ref: "videocontrols_direction-2-ref.html"},
- {op: "==", test: "videocontrols_direction-2d.html", ref: "videocontrols_direction-2-ref.html"},
- {op: "==", test: "videocontrols_direction-2e.html", ref: "videocontrols_direction-2-ref.html"}
-];
-
-</script>
-<script type="text/javascript" src="videocontrols_direction_test.js"></script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/test_videocontrols_iframe_fullscreen.html b/toolkit/content/tests/widgets/test_videocontrols_iframe_fullscreen.html
deleted file mode 100644
index 6391dcc1b..000000000
--- a/toolkit/content/tests/widgets/test_videocontrols_iframe_fullscreen.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Video controls test - iframe</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content">
-<iframe id="ifr1"></iframe>
-<iframe id="ifr2" allowfullscreen></iframe>
-</div>
-
-<pre id="test">
-<script clas="testbody" type="application/javascript">
- SimpleTest.waitForExplicitFinish();
-
- const domUtils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"].
- getService(SpecialPowers.Ci.inIDOMUtils);
- const iframe1 = SpecialPowers.wrap(document.getElementById("ifr1"));
- const iframe2 = SpecialPowers.wrap(document.getElementById("ifr2"));
- const testCases = [];
-
- function checkIframeFullscreenAvailable(ifr) {
- const available = ifr.hasAttribute("allowfullscreen");
- let video;
-
- return () => new Promise(resolve => {
- ifr.srcdoc = `<video id="video" controls preload="auto"></video>`;
- ifr.addEventListener("load", resolve, false);
- }).then(() => new Promise(resolve => {
- video = ifr.contentDocument.getElementById("video");
- video.src = "seek_with_sound.ogg";
- video.addEventListener("loadedmetadata", resolve, false);
- })).then(() => new Promise(resolve => {
- const videoControl = domUtils.getChildrenForNode(video, true)[1];
- const controlBar = video.ownerDocument.getAnonymousElementByAttribute(
- videoControl, "class", "controlBar");
-
- is(controlBar.getAttribute("fullscreen-unavailable") == "true", !available, "The controlbar should have an attribute marking whether fullscreen is available that corresponds to if the iframe has the allowfullscreen attribute.");
- resolve();
- }));
- }
-
- function start() {
- testCases.reduce((promise, task) => promise.then(task), Promise.resolve());
- }
-
- function load() {
- SpecialPowers.pushPrefEnv({"set": [["media.cache_size", 40000]]}, start);
- }
-
- testCases.push(checkIframeFullscreenAvailable(iframe1));
- testCases.push(checkIframeFullscreenAvailable(iframe2));
- testCases.push(SimpleTest.finish);
-
- window.addEventListener("load", load, false);
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/test_videocontrols_jsdisabled.html b/toolkit/content/tests/widgets/test_videocontrols_jsdisabled.html
deleted file mode 100644
index f57cda063..000000000
--- a/toolkit/content/tests/widgets/test_videocontrols_jsdisabled.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Video controls test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-function runTest(event) {
- info(true, "----- test #" + testnum + " -----");
-
- switch (testnum) {
- case 1:
- is(event.type, "timeupdate", "checking event type");
- is(video.paused, false, "checking video play state");
- video.removeEventListener("timeupdate", runTest);
-
- // Click to toggle play/pause (now pausing)
- synthesizeMouseAtCenter(video, {}, win);
- break;
-
- case 2:
- is(event.type, "pause", "checking event type");
- is(video.paused, true, "checking video play state");
- win.close();
-
- SimpleTest.finish();
- break;
-
- default:
- ok(false, "unexpected test #" + testnum + " w/ event " + event.type);
- throw "unexpected test #" + testnum + " w/ event " + event.type;
- }
-
- testnum++;
-}
-
-SpecialPowers.pushPrefEnv({"set": [["javascript.enabled", false]]}, startTest);
-
-var testnum = 1;
-
-var video;
-function loadevent(event) {
- is(win["testExpando"], undefined, "expando shouldn't exist because js is disabled");
- video = win.document.querySelector("video");
- // Other events expected by the test.
- video.addEventListener("timeupdate", runTest, false);
- video.addEventListener("pause", runTest, false);
-}
-
-var win;
-function startTest() {
- var videoURL = new URL("seek_with_sound.ogg", document.documentURI).href;
- var url = "data:text/html,<video src=" + videoURL + " controls autoplay=true></video><script>window.testExpando = true;</scr" + "ipt>";
-
- win = window.open(url);
- win.addEventListener("load", loadevent, false);
-}
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/test_videocontrols_onclickplay.html b/toolkit/content/tests/widgets/test_videocontrols_onclickplay.html
deleted file mode 100644
index d681b3158..000000000
--- a/toolkit/content/tests/widgets/test_videocontrols_onclickplay.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Video controls test</title>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content">
- <video id="video" controls mozNoDynamicControls preload="auto"></video>
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-SimpleTest.waitForExplicitFinish();
-var video = document.getElementById("video");
-
-function startMediaLoad() {
- // Kick off test once video has loaded, in its canplaythrough event handler.
- video.src = "seek_with_sound.ogg";
- video.addEventListener("canplaythrough", runTest, false);
-}
-
-function loadevent(event) {
- SpecialPowers.pushPrefEnv({"set": [["media.cache_size", 40000]]}, startMediaLoad);
-}
-
-window.addEventListener("load", loadevent, false);
-
-function runTest() {
- video.addEventListener("click", function() {
- this.play();
- });
- ok(video.paused, "video should be paused initially");
-
- new Promise(resolve => {
- let timeupdates = 0;
- video.addEventListener("timeupdate", function timeupdate() {
- ok(!video.paused, "video should not get paused after clicking in middle");
-
- if (++timeupdates == 3) {
- video.removeEventListener("timeupdate", timeupdate);
- resolve();
- }
- });
-
- synthesizeMouseAtCenter(video, {}, window);
- }).then(function() {
- new Promise(resolve => {
- video.addEventListener("pause", function onpause() {
- setTimeout(() => {
- ok(video.paused, "video should still be paused 200ms after pause request");
- // When the video reaches the end of playback it is automatically paused.
- // Check during the pause event that the video has not reachd the end
- // of playback.
- ok(!video.ended, "video should not have paused due to playback ending");
- resolve();
- }, 200);
- });
-
- synthesizeMouse(video, 10, video.clientHeight - 10, {}, window);
- }).then(SimpleTest.finish);
- });
-}
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/test_videocontrols_standalone.html b/toolkit/content/tests/widgets/test_videocontrols_standalone.html
deleted file mode 100644
index 8d1ce8984..000000000
--- a/toolkit/content/tests/widgets/test_videocontrols_standalone.html
+++ /dev/null
@@ -1,90 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Video controls test</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="head.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-const videoWidth = 320;
-const videoHeight = 240;
-
-function getMediaElement(aWindow) {
- return aWindow.document.getElementsByTagName("video")[0];
-}
-
-var popup = window.open("seek_with_sound.ogg");
-popup.addEventListener("load", function onLoad() {
- popup.removeEventListener("load", onLoad);
- var video = getMediaElement(popup);
- if (!video.paused)
- runTestVideo(video);
- else {
- video.addEventListener("play", function onPlay() {
- video.removeEventListener("play", onPlay);
- runTestVideo(video);
- });
- }
-});
-
-function runTestVideo(aVideo) {
- var condition = function() {
- var boundingRect = aVideo.getBoundingClientRect();
- return boundingRect.width == videoWidth &&
- boundingRect.height == videoHeight;
- };
- waitForCondition(condition, function() {
- var boundingRect = aVideo.getBoundingClientRect();
- is(boundingRect.width, videoWidth, "Width of the video should match expectation");
- is(boundingRect.height, videoHeight, "Height of video should match expectation");
- popup.close();
- runTestAudioPre();
- }, "The media element should eventually be resized to match the intrinsic size of the video.");
-}
-
-function runTestAudioPre() {
- popup = window.open("audio.ogg");
- popup.addEventListener("load", function onLoad() {
- popup.removeEventListener("load", onLoad);
- var audio = getMediaElement(popup);
- if (!audio.paused)
- runTestAudio(audio);
- else {
- audio.addEventListener("play", function onPlay() {
- audio.removeEventListener("play", onPlay);
- runTestAudio(audio);
- })
- }
- })
-}
-
-function runTestAudio(aAudio) {
- info("User agent (help diagnose bug #943556): " + navigator.userAgent);
- var isAndroid = navigator.userAgent.includes("Android");
- var expectedHeight = isAndroid ? 103 : 28;
- var condition = function () {
- var boundingRect = aAudio.getBoundingClientRect();
- return boundingRect.height == expectedHeight;
- };
- waitForCondition(condition, function () {
- var boundingRect = aAudio.getBoundingClientRect();
- is(boundingRect.height, expectedHeight,
- "Height of audio element should be " + expectedHeight + ", which is equal to the controls bar.");
- popup.close();
- SimpleTest.finish();
- }, "The media element should eventually be resized to match the height of the audio controls.");
-}
-
-SimpleTest.waitForExplicitFinish();
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/test_videocontrols_video_direction.html b/toolkit/content/tests/widgets/test_videocontrols_video_direction.html
deleted file mode 100644
index 54e0d5e72..000000000
--- a/toolkit/content/tests/widgets/test_videocontrols_video_direction.html
+++ /dev/null
@@ -1,31 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Video controls directionality test</title>
- <script type="text/javascript" src="/MochiKit/MochiKit.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/WindowSnapshot.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content">
-</div>
-
-<pre id="test">
-<script class="testbody" type="text/javascript">
-
-var tests = [
- {op: "==", test: "videocontrols_direction-1a.html", ref: "videocontrols_direction-1-ref.html"},
- {op: "==", test: "videocontrols_direction-1b.html", ref: "videocontrols_direction-1-ref.html"},
- {op: "==", test: "videocontrols_direction-1c.html", ref: "videocontrols_direction-1-ref.html"},
- {op: "==", test: "videocontrols_direction-1d.html", ref: "videocontrols_direction-1-ref.html"},
- {op: "==", test: "videocontrols_direction-1e.html", ref: "videocontrols_direction-1-ref.html"},
-];
-
-</script>
-<script type="text/javascript" src="videocontrols_direction_test.js"></script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/test_videocontrols_vtt.html b/toolkit/content/tests/widgets/test_videocontrols_vtt.html
deleted file mode 100644
index 27052b770..000000000
--- a/toolkit/content/tests/widgets/test_videocontrols_vtt.html
+++ /dev/null
@@ -1,133 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Video controls test - VTT</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
-</head>
-<body>
-<p id="display"></p>
-
-<div id="content">
- <video id="video" controls preload="auto"></video>
-</div>
-
-<pre id="test">
-<script clas="testbody" type="application/javascript">
- SimpleTest.waitForExplicitFinish();
-
- const domUtils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"].
- getService(SpecialPowers.Ci.inIDOMUtils);
- const video = document.getElementById("video");
- const ccBtn = getElementByAttribute("class", "closedCaptionButton");
- const ttList = getElementByAttribute("class", "textTrackList");
- const testCases = [];
-
- testCases.push(() => new Promise(resolve => {
- is(ccBtn.getAttribute("hidden"), "true", "CC button should hide");
-
- resolve();
- }));
-
- testCases.push(() => new Promise(resolve => {
- video.addTextTrack("descriptions", "English", "en");
- video.addTextTrack("chapters", "English", "en");
- video.addTextTrack("metadata", "English", "en");
-
- SimpleTest.executeSoon(() => {
- is(ccBtn.getAttribute("hidden"), "true", "CC button should hide if no supported tracks provided");
-
- resolve();
- });
- }));
-
- testCases.push(() => new Promise(resolve => {
- const sub = video.addTextTrack("subtitles", "English", "en");
- sub.mode = "disabled";
-
- SimpleTest.executeSoon(() => {
- is(ccBtn.getAttribute("hidden"), "", "CC button should show");
- is(ccBtn.getAttribute("enabled"), "", "CC button should be disabled");
-
- resolve();
- });
- }));
-
- testCases.push(() => new Promise(resolve => {
- const subtitle = video.addTextTrack("subtitles", "English", "en");
- subtitle.mode = "showing";
-
- SimpleTest.executeSoon(() => {
- is(ccBtn.getAttribute("enabled"), "true", "CC button should be enabled");
- subtitle.mode = "disabled";
-
- resolve();
- });
- }));
-
- testCases.push(() => new Promise(resolve => {
- const caption = video.addTextTrack("captions", "English", "en");
- caption.mode = "showing";
-
- SimpleTest.executeSoon(() => {
- is(ccBtn.getAttribute("enabled"), "true", "CC button should be enabled");
-
- resolve();
- });
- }));
-
- testCases.push(() => new Promise(resolve => {
- synthesizeMouseAtCenter(ccBtn, {});
-
- SimpleTest.executeSoon(() => {
- is(ttList.hasAttribute("hidden"), false, "Texttrack menu should show up");
- is(ttList.lastChild.getAttribute("on"), "true", "The last added item should be highlighted");
-
- resolve();
- });
- }));
-
- testCases.push(() => new Promise(resolve => {
- const tt = ttList.children[1];
-
- isnot(tt.getAttribute("on"), "true", "Item should be off before click");
- synthesizeMouseAtCenter(tt, {});
-
- SimpleTest.executeSoon(() => {
- is(tt.getAttribute("on"), "true", "Selected item should be enabled");
- is(ttList.getAttribute("hidden"), "true", "Should hide texttrack menu once clicked on an item");
-
- resolve();
- });
- }));
-
- function executeTestCases(tasks) {
- return tasks.reduce((promise, task) => promise.then(task), Promise.resolve());
- }
-
- function getElementByAttribute(aName, aValue) {
- const videoControl = domUtils.getChildrenForNode(video, true)[1];
-
- return SpecialPowers.wrap(document)
- .getAnonymousElementByAttribute(videoControl, aName, aValue);
- }
-
- function loadedmetadata() {
- executeTestCases(testCases).then(SimpleTest.finish);
- }
-
- function startMediaLoad() {
- video.src = "seek_with_sound.ogg";
- video.addEventListener("loadedmetadata", loadedmetadata, false);
- }
-
- function loadevent() {
- SpecialPowers.pushPrefEnv({"set": [["media.cache_size", 40000]]}, startMediaLoad);
- }
-
- window.addEventListener("load", loadevent, false);
-</script>
-</pre>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/tree_shared.js b/toolkit/content/tests/widgets/tree_shared.js
deleted file mode 100644
index b157bdf56..000000000
--- a/toolkit/content/tests/widgets/tree_shared.js
+++ /dev/null
@@ -1,1405 +0,0 @@
-var columns_simpletree =
-[
- { name: "name", label: "Name", key: true, properties: "one two" },
- { name: "address", label: "Address" }
-];
-
-var columns_hiertree =
-[
- { name: "name", label: "Name", primary: true, key: true, properties: "one two" },
- { name: "address", label: "Address" },
- { name: "planet", label: "Planet" },
- { name: "gender", label: "Gender", cycler: true }
-];
-
-// XXXndeakin still to add some tests for:
-// cycler columns, checkbox cells, progressmeter cells
-
-// this test function expects a tree to have 8 rows in it when it isn't
-// expanded. The tree should only display four rows at a time. If editable,
-// the cell at row 1 and column 0 must be editable, and the cell at row 2 and
-// column 1 must not be editable.
-function testtag_tree(treeid, treerowinfoid, seltype, columnstype, testid)
-{
- // Stop keystrokes that aren't handled by the tree from leaking out and
- // scrolling the main Mochitests window!
- function preventDefault(event) {
- event.preventDefault();
- }
- document.addEventListener("keypress", preventDefault, false);
-
- var multiple = (seltype == "multiple");
-
- var tree = document.getElementById(treeid);
- var treerowinfo = document.getElementById(treerowinfoid);
- var rowInfo;
- if (testid =="tree view")
- rowInfo = getCustomTreeViewCellInfo();
- else
- rowInfo = convertDOMtoTreeRowInfo(treerowinfo, 0, { value: -1 });
- var columnInfo = (columnstype == "simple") ? columns_simpletree : columns_hiertree;
-
- is(tree.view.selection.currentColumn, null, testid + " initial currentColumn");
- is(tree.selType, seltype == "multiple" ? "" : seltype, testid + " seltype");
-
- // note: the functions below should be in this order due to changes made in later tests
-
- // select the first column in cell selection mode so that the selection
- // functions can be tested
- if (seltype == "cell")
- tree.view.selection.currentColumn = tree.columns[0];
-
- testtag_tree_columns(tree, columnInfo, testid);
- testtag_tree_TreeSelection(tree, testid, multiple);
- testtag_tree_TreeSelection_UI(tree, testid, multiple);
- if (seltype == "cell")
- testtag_tree_TreeSelection_UI_cell(tree, testid, rowInfo);
-
- testtag_tree_TreeView(tree, testid, rowInfo);
-
- is(tree.editable, false, "tree should not be editable");
- // currently, the editable flag means that tree editing cannot be invoked
- // by the user. However, editing can still be started with a script.
- is(tree.editingRow, -1, testid + " initial editingRow");
- is(tree.editingColumn, null, testid + " initial editingColumn");
-
- testtag_tree_UI_editing(tree, testid, rowInfo);
-
- is(tree.editable, false, "tree should not be editable after testtag_tree_UI_editing");
- // currently, the editable flag means that tree editing cannot be invoked
- // by the user. However, editing can still be started with a script.
- is(tree.editingRow, -1, testid + " initial editingRow (continued)");
- is(tree.editingColumn, null, testid + " initial editingColumn (continued)");
-
- var ecolumn = tree.columns[0];
- ok(!tree.startEditing(1, ecolumn), "non-editable trees shouldn't start editing");
- is(tree.editingRow, -1, testid + " failed startEditing shouldn't set editingRow");
- is(tree.editingColumn, null, testid + " failed startEditing shouldn't set editingColumn");
-
- tree.editable = true;
-
- ok(tree.startEditing(1, ecolumn), "startEditing should have returned true");
- is(tree.editingRow, 1, testid + " startEditing editingRow");
- is(tree.editingColumn, ecolumn, testid + " startEditing editingColumn");
- is(tree.getAttribute("editing"), "true", testid + " startEditing editing attribute");
-
- tree.stopEditing(true);
- is(tree.editingRow, -1, testid + " stopEditing editingRow");
- is(tree.editingColumn, null, testid + " stopEditing editingColumn");
- is(tree.hasAttribute("editing"), false, testid + " stopEditing editing attribute");
-
- tree.startEditing(-1, ecolumn);
- is(tree.editingRow == -1 && tree.editingColumn == null, true, testid + " startEditing -1 editingRow");
- tree.startEditing(15, ecolumn);
- is(tree.editingRow == -1 && tree.editingColumn == null, true, testid + " startEditing 15 editingRow");
- tree.startEditing(1, null);
- is(tree.editingRow == -1 && tree.editingColumn == null, true, testid + " startEditing null column editingRow");
- tree.startEditing(2, tree.columns[1]);
- is(tree.editingRow == -1 && tree.editingColumn == null, true, testid + " startEditing non editable cell editingRow");
-
- tree.startEditing(1, ecolumn);
- var inputField = tree.inputField;
- is(inputField instanceof Components.interfaces.nsIDOMXULTextBoxElement, true, testid + "inputField");
- inputField.value = "Changed Value";
- tree.stopEditing(true);
- is(tree.view.getCellText(1, ecolumn), "Changed Value", testid + "edit cell accept");
-
- // this cell can be edited, but stopEditing(false) means don't accept the change.
- tree.startEditing(1, ecolumn);
- inputField.value = "Second Value";
- tree.stopEditing(false);
- is(tree.view.getCellText(1, ecolumn), "Changed Value", testid + "edit cell no accept");
-
- tree.editable = false;
-
- // do the sorting tests last as it will cause the rows to rearrange
- // skip them for the custom tree view
- if (testid !="tree view")
- testtag_tree_TreeView_rows_sort(tree, testid, rowInfo);
-
- testtag_tree_wheel(tree);
-
- document.removeEventListener("keypress", preventDefault, false);
-
- SimpleTest.finish();
-}
-
-function testtag_tree_columns(tree, expectedColumns, testid)
-{
- testid += " ";
-
- var columns = tree.columns;
-
- is(columns instanceof TreeColumns, true, testid + "columns is a TreeColumns");
- is(columns.count, expectedColumns.length, testid + "TreeColumns count");
- is(columns.length, expectedColumns.length, testid + "TreeColumns length");
-
- var treecols = tree.getElementsByTagName("treecols")[0];
- var treecol = treecols.getElementsByTagName("treecol");
-
- var x = 0;
- var primary = null, sorted = null, key = null;
- for (var c = 0; c < expectedColumns.length; c++) {
- var adjtestid = testid + " column " + c + " ";
- var column = columns[c];
- var expectedColumn = expectedColumns[c];
- is(columns.getColumnAt(c), column, adjtestid + "getColumnAt");
- is(columns.getNamedColumn(expectedColumn.name), column, adjtestid + "getNamedColumn");
- is(columns.getColumnFor(treecol[c]), column, adjtestid + "getColumnFor");
- if (expectedColumn.primary)
- primary = column;
- if (expectedColumn.sorted)
- sorted = column;
- if (expectedColumn.key)
- key = column;
-
- // XXXndeakin on Windows and Linux, some columns are one pixel to the
- // left of where they should be. Could just be a rounding issue.
- var adj = 1;
- is(column.x + adj >= x, true, adjtestid + "position is after last column " +
- column.x + "," + column.width + "," + x);
- is(column.width > 0, true, adjtestid + "width is greater than 0");
- x = column.x + column.width;
-
- // now check the TreeColumn properties
- is(column instanceof TreeColumn, true, adjtestid + "is a TreeColumn");
- is(column.element, treecol[c], adjtestid + "element is treecol");
- is(column.columns, columns, adjtestid + "columns is TreeColumns");
- is(column.id, expectedColumn.name, adjtestid + "name");
- is(column.index, c, adjtestid + "index");
- is(column.primary, primary == column, adjtestid + "column is primary");
-
- is(column.cycler, "cycler" in expectedColumn && expectedColumn.cycler,
- adjtestid + "column is cycler");
- is(column.selectable, true, adjtestid + "column is selectable");
- is(column.editable, "editable" in expectedColumn && expectedColumn.editable,
- adjtestid + "column is editable");
-
- is(column.type, "type" in expectedColumn ? expectedColumn.type : 1, adjtestid + "type");
-
- is(column.getPrevious(), c > 0 ? columns[c - 1] : null, adjtestid + "getPrevious");
- is(column.getNext(), c < columns.length - 1 ? columns[c + 1] : null, adjtestid + "getNext");
-
- // check the view's getColumnProperties method
- var properties = tree.view.getColumnProperties(column);
- var expectedProperties = expectedColumn.properties;
- is(properties, expectedProperties ? expectedProperties : "", adjtestid + "getColumnProperties");
- }
-
- is(columns.getFirstColumn(), columns[0], testid + "getFirstColumn");
- is(columns.getLastColumn(), columns[columns.length - 1], testid + "getLastColumn");
- is(columns.getPrimaryColumn(), primary, testid + "getPrimaryColumn");
- is(columns.getSortedColumn(), sorted, testid + "getSortedColumn");
- is(columns.getKeyColumn(), key, testid + "getKeyColumn");
-
- is(columns.getColumnAt(-1), null, testid + "getColumnAt under");
- is(columns.getColumnAt(columns.length), null, testid + "getColumnAt over");
- is(columns.getNamedColumn(""), null, testid + "getNamedColumn null");
- is(columns.getNamedColumn("unknown"), null, testid + "getNamedColumn unknown");
- is(columns.getColumnFor(null), null, testid + "getColumnFor null");
- is(columns.getColumnFor(tree), null, testid + "getColumnFor other");
-}
-
-function testtag_tree_TreeSelection(tree, testid, multiple)
-{
- testid += " selection ";
-
- var selection = tree.view.selection;
- is(selection instanceof Components.interfaces.nsITreeSelection, true,
- testid + "selection is a TreeSelection");
- is(selection.single, !multiple, testid + "single");
-
- testtag_tree_TreeSelection_State(tree, testid + "initial", -1, []);
- is(selection.shiftSelectPivot, -1, testid + "initial shiftSelectPivot");
-
- selection.currentIndex = 2;
- testtag_tree_TreeSelection_State(tree, testid + "set currentIndex", 2, []);
- tree.currentIndex = 3;
- testtag_tree_TreeSelection_State(tree, testid + "set tree.currentIndex", 3, []);
-
- // test the select() method, which should deselect all rows and select
- // a single row
- selection.select(1);
- testtag_tree_TreeSelection_State(tree, testid + "select 1", 1, [1]);
- selection.select(3);
- testtag_tree_TreeSelection_State(tree, testid + "select 2", 3, [3]);
- selection.select(3);
- testtag_tree_TreeSelection_State(tree, testid + "select same", 3, [3]);
-
- selection.currentIndex = 1;
- testtag_tree_TreeSelection_State(tree, testid + "set currentIndex with single selection", 1, [3]);
-
- tree.currentIndex = 2;
- testtag_tree_TreeSelection_State(tree, testid + "set tree.currentIndex with single selection", 2, [3]);
-
- // check the toggleSelect method. In single selection mode, it only toggles on when
- // there isn't currently a selection.
- selection.toggleSelect(2);
- testtag_tree_TreeSelection_State(tree, testid + "toggleSelect 1", 2, multiple ? [2, 3] : [3]);
- selection.toggleSelect(2);
- selection.toggleSelect(3);
- testtag_tree_TreeSelection_State(tree, testid + "toggleSelect 2", 3, []);
-
- // the current index doesn't change after a selectAll, so it should still be set to 1
- // selectAll has no effect on single selection trees
- selection.currentIndex = 1;
- selection.selectAll();
- testtag_tree_TreeSelection_State(tree, testid + "selectAll 1", 1, multiple ? [0, 1, 2, 3, 4, 5, 6, 7] : []);
- selection.toggleSelect(2);
- testtag_tree_TreeSelection_State(tree, testid + "toggleSelect after selectAll", 2,
- multiple ? [0, 1, 3, 4, 5, 6, 7] : [2]);
- selection.clearSelection();
- testtag_tree_TreeSelection_State(tree, testid + "clearSelection", 2, []);
- selection.toggleSelect(3);
- selection.toggleSelect(1);
- if (multiple) {
- selection.selectAll();
- testtag_tree_TreeSelection_State(tree, testid + "selectAll 2", 1, [0, 1, 2, 3, 4, 5, 6, 7]);
- }
- selection.currentIndex = 2;
- selection.clearSelection();
- testtag_tree_TreeSelection_State(tree, testid + "clearSelection after selectAll", 2, []);
-
- // XXXndeakin invertSelection isn't implemented
- // selection.invertSelection();
-
- is(selection.shiftSelectPivot, -1, testid + "shiftSelectPivot set to -1");
-
- // rangedSelect and clearRange set the currentIndex to the endIndex. The
- // shiftSelectPivot property will be set to startIndex.
- selection.rangedSelect(1, 3, false);
- testtag_tree_TreeSelection_State(tree, testid + "rangedSelect no augment",
- multiple ? 3 : 2, multiple ? [1, 2, 3] : []);
- is(selection.shiftSelectPivot, multiple ? 1 : -1,
- testid + "shiftSelectPivot after rangedSelect no augment");
- if (multiple) {
- selection.select(1);
- selection.rangedSelect(0, 2, true);
- testtag_tree_TreeSelection_State(tree, testid + "rangedSelect augment", 2, [0, 1, 2]);
- is(selection.shiftSelectPivot, 0, testid + "shiftSelectPivot after rangedSelect augment");
-
- selection.clearRange(1, 3);
- testtag_tree_TreeSelection_State(tree, testid + "rangedSelect augment", 3, [0]);
-
- // check that rangedSelect can take a start value higher than end
- selection.rangedSelect(3, 1, false);
- testtag_tree_TreeSelection_State(tree, testid + "rangedSelect reverse", 1, [1, 2, 3]);
- is(selection.shiftSelectPivot, 3, testid + "shiftSelectPivot after rangedSelect reverse");
-
- // check that setting the current index doesn't change the selection
- selection.currentIndex = 0;
- testtag_tree_TreeSelection_State(tree, testid + "currentIndex with range selection", 0, [1, 2, 3]);
- }
-
- // both values of rangedSelect may be the same
- selection.rangedSelect(2, 2, false);
- testtag_tree_TreeSelection_State(tree, testid + "rangedSelect one row", 2, [2]);
- is(selection.shiftSelectPivot, 2, testid + "shiftSelectPivot after selecting one row");
-
- if (multiple) {
- selection.rangedSelect(2, 3, true);
-
- // a start index of -1 means from the last point
- selection.rangedSelect(-1, 0, true);
- testtag_tree_TreeSelection_State(tree, testid + "rangedSelect -1 existing selection", 0, [0, 1, 2, 3]);
- is(selection.shiftSelectPivot, 2, testid + "shiftSelectPivot after -1 existing selection");
-
- selection.currentIndex = 2;
- selection.rangedSelect(-1, 0, false);
- testtag_tree_TreeSelection_State(tree, testid + "rangedSelect -1 from currentIndex", 0, [0, 1, 2]);
- is(selection.shiftSelectPivot, 2, testid + "shiftSelectPivot -1 from currentIndex");
- }
-
- // XXXndeakin need to test out of range values but these don't work properly
-/*
- selection.select(-1);
- testtag_tree_TreeSelection_State(tree, testid + "rangedSelect augment -1", -1, []);
-
- selection.select(8);
- testtag_tree_TreeSelection_State(tree, testid + "rangedSelect augment 8", 3, [0]);
-*/
-}
-
-function testtag_tree_TreeSelection_UI(tree, testid, multiple)
-{
- testid += " selection UI ";
-
- var selection = tree.view.selection;
- selection.clearSelection();
- selection.currentIndex = 0;
- tree.focus();
-
- var keydownFired = 0;
- var keypressFired = 0;
- function keydownListener(event)
- {
- keydownFired++;
- }
- function keypressListener(event) {
- keypressFired++;
- }
-
- // check that cursor up and down keys navigate up and down
- // select event fires after a delay so don't expect it. The reason it fires after a delay
- // is so that cursor navigation allows quicking skimming over a set of items without
- // actually firing events in-between, improving performance. The select event will only
- // be fired on the row where the cursor stops.
- window.addEventListener("keydown", keydownListener, false);
- window.addEventListener("keypress", keypressListener, false);
-
- synthesizeKeyExpectEvent("VK_DOWN", {}, tree, "!select", "key down");
- testtag_tree_TreeSelection_State(tree, testid + "key down", 1, [1], 0);
-
- synthesizeKeyExpectEvent("VK_UP", {}, tree, "!select", "key up");
- testtag_tree_TreeSelection_State(tree, testid + "key up", 0, [0], 0);
-
- synthesizeKeyExpectEvent("VK_UP", {}, tree, "!select", "key up at start");
- testtag_tree_TreeSelection_State(tree, testid + "key up at start", 0, [0], 0);
-
- // pressing down while the last row is selected should not fire a select event,
- // as the selection won't have changed. Also the view is not scrolled in this case.
- selection.select(7);
- synthesizeKeyExpectEvent("VK_DOWN", {}, tree, "!select", "key down at end");
- testtag_tree_TreeSelection_State(tree, testid + "key down at end", 7, [7], 0);
-
- // pressing keys while at the edge of the visible rows should scroll the list
- tree.treeBoxObject.scrollToRow(4);
- selection.select(4);
- synthesizeKeyExpectEvent("VK_UP", {}, tree, "!select", "key up with scroll");
- is(tree.treeBoxObject.getFirstVisibleRow(), 3, testid + "key up with scroll");
-
- tree.treeBoxObject.scrollToRow(0);
- selection.select(3);
- synthesizeKeyExpectEvent("VK_DOWN", {}, tree, "!select", "key down with scroll");
- is(tree.treeBoxObject.getFirstVisibleRow(), 1, testid + "key down with scroll");
-
- // accel key and cursor movement adjust currentIndex but should not change
- // the selection. In single selection mode, the selection will not change,
- // but instead will just scroll up or down a line
- tree.treeBoxObject.scrollToRow(0);
- selection.select(1);
- synthesizeKeyExpectEvent("VK_DOWN", { accelKey: true }, tree, "!select", "key down with accel");
- testtag_tree_TreeSelection_State(tree, testid + "key down with accel", multiple ? 2 : 1, [1]);
- if (!multiple)
- is(tree.treeBoxObject.getFirstVisibleRow(), 1, testid + "key down with accel and scroll");
-
- tree.treeBoxObject.scrollToRow(4);
- selection.select(4);
- synthesizeKeyExpectEvent("VK_UP", { accelKey: true }, tree, "!select", "key up with accel");
- testtag_tree_TreeSelection_State(tree, testid + "key up with accel", multiple ? 3 : 4, [4]);
- if (!multiple)
- is(tree.treeBoxObject.getFirstVisibleRow(), 3, testid + "key up with accel and scroll");
-
- // do this three times, one for each state of pageUpOrDownMovesSelection,
- // and then once with the accel key pressed
- for (let t = 0; t < 3; t++) {
- let testidmod = "";
- if (t == 2)
- testidmod = " with accel"
- else if (t == 1)
- testidmod = " rev";
- var keymod = (t == 2) ? { accelKey: true } : { };
-
- var moveselection = tree.pageUpOrDownMovesSelection;
- if (t == 2)
- moveselection = !moveselection;
-
- tree.treeBoxObject.scrollToRow(4);
- selection.currentIndex = 6;
- selection.select(6);
- var expected = moveselection ? 4 : 6;
- synthesizeKeyExpectEvent("VK_PAGE_UP", keymod, tree, "!select", "key page up");
- testtag_tree_TreeSelection_State(tree, testid + "key page up" + testidmod,
- expected, [expected], moveselection ? 4 : 0);
-
- expected = moveselection ? 0 : 6;
- synthesizeKeyExpectEvent("VK_PAGE_UP", keymod, tree, "!select", "key page up again");
- testtag_tree_TreeSelection_State(tree, testid + "key page up again" + testidmod,
- expected, [expected], 0);
-
- expected = moveselection ? 0 : 6;
- synthesizeKeyExpectEvent("VK_PAGE_UP", keymod, tree, "!select", "key page up at start");
- testtag_tree_TreeSelection_State(tree, testid + "key page up at start" + testidmod,
- expected, [expected], 0);
-
- tree.treeBoxObject.scrollToRow(0);
- selection.currentIndex = 1;
- selection.select(1);
- expected = moveselection ? 3 : 1;
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", keymod, tree, "!select", "key page down");
- testtag_tree_TreeSelection_State(tree, testid + "key page down" + testidmod,
- expected, [expected], moveselection ? 0 : 4);
-
- expected = moveselection ? 7 : 1;
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", keymod, tree, "!select", "key page down again");
- testtag_tree_TreeSelection_State(tree, testid + "key page down again" + testidmod,
- expected, [expected], 4);
-
- expected = moveselection ? 7 : 1;
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", keymod, tree, "!select", "key page down at start");
- testtag_tree_TreeSelection_State(tree, testid + "key page down at start" + testidmod,
- expected, [expected], 4);
-
- if (t < 2)
- tree.pageUpOrDownMovesSelection = !tree.pageUpOrDownMovesSelection;
- }
-
- tree.treeBoxObject.scrollToRow(4);
- selection.select(6);
- synthesizeKeyExpectEvent("VK_HOME", {}, tree, "!select", "key home");
- testtag_tree_TreeSelection_State(tree, testid + "key home", 0, [0], 0);
-
- tree.treeBoxObject.scrollToRow(0);
- selection.select(1);
- synthesizeKeyExpectEvent("VK_END", {}, tree, "!select", "key end");
- testtag_tree_TreeSelection_State(tree, testid + "key end", 7, [7], 4);
-
- // in single selection mode, the selection doesn't change in this case
- tree.treeBoxObject.scrollToRow(4);
- selection.select(6);
- synthesizeKeyExpectEvent("VK_HOME", { accelKey: true }, tree, "!select", "key home with accel");
- testtag_tree_TreeSelection_State(tree, testid + "key home with accel", multiple ? 0 : 6, [6], 0);
-
- tree.treeBoxObject.scrollToRow(0);
- selection.select(1);
- synthesizeKeyExpectEvent("VK_END", { accelKey: true }, tree, "!select", "key end with accel");
- testtag_tree_TreeSelection_State(tree, testid + "key end with accel", multiple ? 7 : 1, [1], 4);
-
- // next, test cursor navigation with selection. Here the select event will be fired
- selection.select(1);
- var eventExpected = multiple ? "select" : "!select";
- synthesizeKeyExpectEvent("VK_DOWN", { shiftKey: true }, tree, eventExpected, "key shift down to select");
- testtag_tree_TreeSelection_State(tree, testid + "key shift down to select",
- multiple ? 2 : 1, multiple ? [1, 2] : [1]);
- is(selection.shiftSelectPivot, multiple ? 1 : -1,
- testid + "key shift down to select shiftSelectPivot");
- synthesizeKeyExpectEvent("VK_UP", { shiftKey: true }, tree, eventExpected, "key shift up to unselect");
- testtag_tree_TreeSelection_State(tree, testid + "key shift up to unselect", 1, [1]);
- is(selection.shiftSelectPivot, multiple ? 1 : -1,
- testid + "key shift up to unselect shiftSelectPivot");
- if (multiple) {
- synthesizeKeyExpectEvent("VK_UP", { shiftKey: true }, tree, "select", "key shift up to select");
- testtag_tree_TreeSelection_State(tree, testid + "key shift up to select", 0, [0, 1]);
- is(selection.shiftSelectPivot, 1, testid + "key shift up to select shiftSelectPivot");
- synthesizeKeyExpectEvent("VK_DOWN", { shiftKey: true }, tree, "select", "key shift down to unselect");
- testtag_tree_TreeSelection_State(tree, testid + "key shift down to unselect", 1, [1]);
- is(selection.shiftSelectPivot, 1, testid + "key shift down to unselect shiftSelectPivot");
- }
-
- // do this twice, one for each state of pageUpOrDownMovesSelection, however
- // when selecting with the shift key, pageUpOrDownMovesSelection is ignored
- // and the selection always changes
- var lastidx = tree.view.rowCount - 1;
- for (let t = 0; t < 2; t++) {
- let testidmod = (t == 0) ? "" : " rev";
-
- // If the top or bottom visible row is the current row, pressing shift and
- // page down / page up selects one page up or one page down. Otherwise, the
- // selection is made to the top or bottom of the visible area.
- tree.treeBoxObject.scrollToRow(lastidx - 3);
- selection.currentIndex = 6;
- selection.select(6);
- synthesizeKeyExpectEvent("VK_PAGE_UP", { shiftKey: true }, tree, eventExpected, "key shift page up");
- testtag_tree_TreeSelection_State(tree, testid + "key shift page up" + testidmod,
- multiple ? 4 : 6, multiple ? [4, 5, 6] : [6]);
- if (multiple) {
- synthesizeKeyExpectEvent("VK_PAGE_UP", { shiftKey: true }, tree, "select", "key shift page up again");
- testtag_tree_TreeSelection_State(tree, testid + "key shift page up again" + testidmod,
- 0, [0, 1, 2, 3, 4, 5, 6]);
- // no change in the selection, so no select event should be fired
- synthesizeKeyExpectEvent("VK_PAGE_UP", { shiftKey: true }, tree, "!select", "key shift page up at start");
- testtag_tree_TreeSelection_State(tree, testid + "key shift page up at start" + testidmod,
- 0, [0, 1, 2, 3, 4, 5, 6]);
- // deselect by paging down again
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { shiftKey: true }, tree, "select", "key shift page down deselect");
- testtag_tree_TreeSelection_State(tree, testid + "key shift page down deselect" + testidmod,
- 3, [3, 4, 5, 6]);
- }
-
- tree.treeBoxObject.scrollToRow(1);
- selection.currentIndex = 2;
- selection.select(2);
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { shiftKey: true }, tree, eventExpected, "key shift page down");
- testtag_tree_TreeSelection_State(tree, testid + "key shift page down" + testidmod,
- multiple ? 4 : 2, multiple ? [2, 3, 4] : [2]);
- if (multiple) {
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { shiftKey: true }, tree, "select", "key shift page down again");
- testtag_tree_TreeSelection_State(tree, testid + "key shift page down again" + testidmod,
- 7, [2, 3, 4, 5, 6, 7]);
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { shiftKey: true }, tree, "!select", "key shift page down at start");
- testtag_tree_TreeSelection_State(tree, testid + "key shift page down at start" + testidmod,
- 7, [2, 3, 4, 5, 6, 7]);
- synthesizeKeyExpectEvent("VK_PAGE_UP", { shiftKey: true }, tree, "select", "key shift page up deselect");
- testtag_tree_TreeSelection_State(tree, testid + "key shift page up deselect" + testidmod,
- 4, [2, 3, 4]);
- }
-
- // test when page down / page up is pressed when the view is scrolled such
- // that the selection is not visible
- if (multiple) {
- tree.treeBoxObject.scrollToRow(3);
- selection.currentIndex = 1;
- selection.select(1);
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { shiftKey: true }, tree, eventExpected,
- "key shift page down with view scrolled down");
- testtag_tree_TreeSelection_State(tree, testid + "key shift page down with view scrolled down" + testidmod,
- 6, [1, 2, 3, 4, 5, 6], 3);
-
- tree.treeBoxObject.scrollToRow(2);
- selection.currentIndex = 6;
- selection.select(6);
- synthesizeKeyExpectEvent("VK_PAGE_UP", { shiftKey: true }, tree, eventExpected,
- "key shift page up with view scrolled up");
- testtag_tree_TreeSelection_State(tree, testid + "key shift page up with view scrolled up" + testidmod,
- 2, [2, 3, 4, 5, 6], 2);
-
- tree.treeBoxObject.scrollToRow(2);
- selection.currentIndex = 0;
- selection.select(0);
- // don't expect the select event, as the selection won't have changed
- synthesizeKeyExpectEvent("VK_PAGE_UP", { shiftKey: true }, tree, "!select",
- "key shift page up at start with view scrolled down");
- testtag_tree_TreeSelection_State(tree, testid + "key shift page up at start with view scrolled down" + testidmod,
- 0, [0], 0);
-
- tree.treeBoxObject.scrollToRow(0);
- selection.currentIndex = 7;
- selection.select(7);
- // don't expect the select event, as the selection won't have changed
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", { shiftKey: true }, tree, "!select",
- "key shift page down at end with view scrolled up");
- testtag_tree_TreeSelection_State(tree, testid + "key shift page down at end with view scrolled up" + testidmod,
- 7, [7], 4);
- }
-
- tree.pageUpOrDownMovesSelection = !tree.pageUpOrDownMovesSelection;
- }
-
- tree.treeBoxObject.scrollToRow(4);
- selection.select(5);
- synthesizeKeyExpectEvent("VK_HOME", { shiftKey: true }, tree, eventExpected, "key shift home");
- testtag_tree_TreeSelection_State(tree, testid + "key shift home",
- multiple ? 0 : 5, multiple ? [0, 1, 2, 3, 4, 5] : [5], multiple ? 0 : 4);
-
- tree.treeBoxObject.scrollToRow(0);
- selection.select(3);
- synthesizeKeyExpectEvent("VK_END", { shiftKey: true }, tree, eventExpected, "key shift end");
- testtag_tree_TreeSelection_State(tree, testid + "key shift end",
- multiple ? 7 : 3, multiple ? [3, 4, 5, 6, 7] : [3], multiple ? 4 : 0);
-
- // pressing space selects a row, pressing accel + space unselects a row
- selection.select(2);
- selection.currentIndex = 4;
- synthesizeKeyExpectEvent(" ", {}, tree, "select", "key space on");
- // in single selection mode, space shouldn't do anything
- testtag_tree_TreeSelection_State(tree, testid + "key space on", 4, multiple ? [2, 4] : [2]);
-
- if (multiple) {
- synthesizeKeyExpectEvent(" ", { accelKey: true }, tree, "select", "key space off");
- testtag_tree_TreeSelection_State(tree, testid + "key space off", 4, [2]);
- }
-
- // check that clicking on a row selects it
- tree.treeBoxObject.scrollToRow(0);
- selection.select(2);
- selection.currentIndex = 2;
- if (0) { // XXXndeakin disable these tests for now
- mouseOnCell(tree, 1, tree.columns[1], "mouse on row");
- testtag_tree_TreeSelection_State(tree, testid + "mouse on row", 1, [1], 0,
- tree.selType == "cell" ? tree.columns[1] : null);
- }
-
- // restore the scroll position to the start of the page
- sendKey("HOME");
-
- window.removeEventListener("keydown", keydownListener, false);
- window.removeEventListener("keypress", keypressListener, false);
- is(keydownFired, multiple ? 63 : 40, "keydown event wasn't fired properly");
- is(keypressFired, multiple ? 2 : 1, "keypress event wasn't fired properly");
-}
-
-function testtag_tree_UI_editing(tree, testid, rowInfo)
-{
- testid += " editing UI ";
-
- // check editing UI
- var ecolumn = tree.columns[0];
- var rowIndex = 2;
- var inputField = tree.inputField;
-
- // temporary make the tree editable to test mouse double click
- var wasEditable = tree.editable;
- if (!wasEditable)
- tree.editable = true;
-
- // if this is a container save its current open status
- var row = rowInfo.rows[rowIndex];
- var wasOpen = null;
- if (tree.view.isContainer(row))
- wasOpen = tree.view.isContainerOpen(row);
-
- // Test whether a keystroke can enter text entry, and another can exit.
- if (tree.selType == "cell")
- {
- tree.stopEditing(false);
- ok(!tree.editingColumn, "Should not be editing tree cell now");
- tree.view.selection.currentColumn = ecolumn;
- tree.currentIndex = rowIndex;
-
- const isMac = (navigator.platform.indexOf("Mac") >= 0);
- const StartEditingKey = isMac ? "RETURN" : "F2";
- sendKey(StartEditingKey);
- is(tree.editingColumn, ecolumn, "Should be editing tree cell now");
- sendKey("ESCAPE");
- ok(!tree.editingColumn, "Should not be editing tree cell now");
- is(tree.currentIndex, rowIndex, "Current index should not have changed");
- is(tree.view.selection.currentColumn, ecolumn, "Current column should not have changed");
- }
-
- mouseDblClickOnCell(tree, rowIndex, ecolumn, testid + "edit on double click");
- is(tree.editingColumn, ecolumn, testid + "editing column");
- is(tree.editingRow, rowIndex, testid + "editing row");
-
- // ensure that we don't expand an expandable container on edit
- if (wasOpen != null)
- is(tree.view.isContainerOpen(row), wasOpen, testid + "opened container node on edit");
-
- // ensure to restore editable attribute
- if (!wasEditable)
- tree.editable = false;
-
- var ci = tree.currentIndex;
-
- // cursor navigation should not change the selection while editing
- var testKey = function(key) {
- synthesizeKeyExpectEvent(key, {}, tree, "!select", "key " + key + " with editing");
- is(tree.editingRow == rowIndex && tree.editingColumn == ecolumn && tree.currentIndex == ci,
- true, testid + "key " + key + " while editing");
- }
-
- testKey("VK_DOWN");
- testKey("VK_UP");
- testKey("VK_PAGE_DOWN");
- testKey("VK_PAGE_UP");
- testKey("VK_HOME");
- testKey("VK_END");
-
- // XXXndeakin figure out how to send characters to the textbox
- // inputField.inputField.focus()
- // synthesizeKeyExpectEvent(inputField.inputField, "b", null, "");
- // tree.stopEditing(true);
- // is(tree.view.getCellText(0, ecolumn), "b", testid + "edit cell");
-
- // Restore initial state.
- tree.stopEditing(false);
-}
-
-function testtag_tree_TreeSelection_UI_cell(tree, testid, rowInfo)
-{
- testid += " selection UI cell ";
-
- var columns = tree.columns;
- var firstcolumn = columns[0];
- var secondcolumn = columns[1];
- var lastcolumn = columns[columns.length - 1];
- var secondlastcolumn = columns[columns.length - 2];
- var selection = tree.view.selection;
-
- selection.clearSelection();
- selection.currentIndex = -1;
- selection.currentColumn = firstcolumn;
- is(selection.currentColumn, firstcolumn, testid + " first currentColumn");
-
- // no selection yet so nothing should happen when the left and right cursor keys are pressed
- synthesizeKeyExpectEvent("VK_RIGHT", {}, tree, "!select", "key right no selection");
- testtag_tree_TreeSelection_State(tree, testid + "key right no selection", -1, [], null, firstcolumn);
-
- selection.currentColumn = secondcolumn;
- synthesizeKeyExpectEvent("VK_LEFT", {}, tree, "!select", "key left no selection");
- testtag_tree_TreeSelection_State(tree, testid + "key left no selection", -1, [], null, secondcolumn);
-
- selection.select(2);
- selection.currentIndex = 2;
- if (0) { // XXXndeakin disable these tests for now
- mouseOnCell(tree, 1, secondlastcolumn, "mouse on cell");
- testtag_tree_TreeSelection_State(tree, testid + "mouse on cell", 1, [1], null, secondlastcolumn);
- }
-
- tree.focus();
-
- // selection is set, so it should move when the left and right cursor keys are pressed
- tree.treeBoxObject.scrollToRow(0);
- selection.select(1);
- selection.currentIndex = 1;
- selection.currentColumn = secondcolumn;
- synthesizeKeyExpectEvent("VK_LEFT", {}, tree, "!select", "key left in second column");
- testtag_tree_TreeSelection_State(tree, testid + "key left in second column", 1, [1], 0, firstcolumn);
-
- synthesizeKeyExpectEvent("VK_LEFT", {}, tree, "!select", "key left in first column");
- testtag_tree_TreeSelection_State(tree, testid + "key left in first column", 1, [1], 0, firstcolumn);
-
- selection.currentColumn = secondlastcolumn;
- synthesizeKeyExpectEvent("VK_RIGHT", {}, tree, "!select", "key right in second last column");
- testtag_tree_TreeSelection_State(tree, testid + "key right in second last column", 1, [1], 0, lastcolumn);
-
- synthesizeKeyExpectEvent("VK_RIGHT", {}, tree, "!select", "key right in last column");
- testtag_tree_TreeSelection_State(tree, testid + "key right in last column", 1, [1], 0, lastcolumn);
-
- synthesizeKeyExpectEvent("VK_UP", {}, tree, "!select", "key up in second row");
- testtag_tree_TreeSelection_State(tree, testid + "key up in second row", 0, [0], 0, lastcolumn);
-
- synthesizeKeyExpectEvent("VK_UP", {}, tree, "!select", "key up in first row");
- testtag_tree_TreeSelection_State(tree, testid + "key up in first row", 0, [0], 0, lastcolumn);
-
- synthesizeKeyExpectEvent("VK_DOWN", {}, tree, "!select", "key down in first row");
- testtag_tree_TreeSelection_State(tree, testid + "key down in first row", 1, [1], 0, lastcolumn);
-
- var lastidx = tree.view.rowCount - 1;
- tree.treeBoxObject.scrollToRow(lastidx - 3);
- selection.select(lastidx);
- selection.currentIndex = lastidx;
- synthesizeKeyExpectEvent("VK_DOWN", {}, tree, "!select", "key down in last row");
- testtag_tree_TreeSelection_State(tree, testid + "key down in last row", lastidx, [lastidx], lastidx - 3, lastcolumn);
-
- synthesizeKeyExpectEvent("VK_HOME", {}, tree, "!select", "key home");
- testtag_tree_TreeSelection_State(tree, testid + "key home", 0, [0], 0, lastcolumn);
-
- synthesizeKeyExpectEvent("VK_END", {}, tree, "!select", "key end");
- testtag_tree_TreeSelection_State(tree, testid + "key end", lastidx, [lastidx], lastidx - 3, lastcolumn);
-
- for (var t = 0; t < 2; t++) {
- var testidmod = (t == 0) ? "" : " rev";
-
- // scroll to the end, subtract 3 because we want lastidx to appear
- // at the end of view
- tree.treeBoxObject.scrollToRow(lastidx - 3);
- selection.select(lastidx);
- selection.currentIndex = lastidx;
- var expectedrow = tree.pageUpOrDownMovesSelection ? lastidx - 3 : lastidx;
- synthesizeKeyExpectEvent("VK_PAGE_UP", {}, tree, "!select", "key page up");
- testtag_tree_TreeSelection_State(tree, testid + "key page up" + testidmod,
- expectedrow, [expectedrow],
- tree.pageUpOrDownMovesSelection ? lastidx - 3 : 0, lastcolumn);
-
- tree.treeBoxObject.scrollToRow(1);
- selection.select(1);
- selection.currentIndex = 1;
- expectedrow = tree.pageUpOrDownMovesSelection ? 4 : 1;
- synthesizeKeyExpectEvent("VK_PAGE_DOWN", {}, tree, "!select", "key page down");
- testtag_tree_TreeSelection_State(tree, testid + "key page down" + testidmod,
- expectedrow, [expectedrow],
- tree.pageUpOrDownMovesSelection ? 1 : lastidx - 3, lastcolumn);
-
- tree.pageUpOrDownMovesSelection = !tree.pageUpOrDownMovesSelection;
- }
-
- // now check navigation when there is unselctable column
- secondcolumn.element.setAttribute("selectable", "false");
- secondcolumn.invalidate();
- is(secondcolumn.selectable, false, testid + "set selectable attribute");
-
- if (columns.length >= 3) {
- selection.select(3);
- selection.currentIndex = 3;
- // check whether unselectable columns are skipped over
- selection.currentColumn = firstcolumn;
- synthesizeKeyExpectEvent("VK_RIGHT", {}, tree, "!select", "key right unselectable column");
- testtag_tree_TreeSelection_State(tree, testid + "key right unselectable column",
- 3, [3], null, secondcolumn.getNext());
-
- synthesizeKeyExpectEvent("VK_LEFT", {}, tree, "!select", "key left unselectable column");
- testtag_tree_TreeSelection_State(tree, testid + "key left unselectable column",
- 3, [3], null, firstcolumn);
- }
-
- secondcolumn.element.removeAttribute("selectable");
- secondcolumn.invalidate();
- is(secondcolumn.selectable, true, testid + "clear selectable attribute");
-
- // check to ensure that navigation isn't allowed if the first column is not selectable
- selection.currentColumn = secondcolumn;
- firstcolumn.element.setAttribute("selectable", "false");
- firstcolumn.invalidate();
- synthesizeKeyExpectEvent("VK_LEFT", {}, tree, "!select", "key left unselectable first column");
- testtag_tree_TreeSelection_State(tree, testid + "key left unselectable first column",
- 3, [3], null, secondcolumn);
- firstcolumn.element.removeAttribute("selectable");
- firstcolumn.invalidate();
-
- // check to ensure that navigation isn't allowed if the last column is not selectable
- selection.currentColumn = secondlastcolumn;
- lastcolumn.element.setAttribute("selectable", "false");
- lastcolumn.invalidate();
- synthesizeKeyExpectEvent("VK_RIGHT", {}, tree, "!select", "key right unselectable last column");
- testtag_tree_TreeSelection_State(tree, testid + "key right unselectable last column",
- 3, [3], null, secondlastcolumn);
- lastcolumn.element.removeAttribute("selectable");
- lastcolumn.invalidate();
-
- // now check for cells with selectable false
- if (!rowInfo.rows[4].cells[1].selectable && columns.length >= 3) {
- // check whether unselectable cells are skipped over
- selection.select(4);
- selection.currentIndex = 4;
-
- selection.currentColumn = firstcolumn;
- synthesizeKeyExpectEvent("VK_RIGHT", {}, tree, "!select", "key right unselectable cell");
- testtag_tree_TreeSelection_State(tree, testid + "key right unselectable cell",
- 4, [4], null, secondcolumn.getNext());
-
- synthesizeKeyExpectEvent("VK_LEFT", {}, tree, "!select", "key left unselectable cell");
- testtag_tree_TreeSelection_State(tree, testid + "key left unselectable cell",
- 4, [4], null, firstcolumn);
-
- tree.treeBoxObject.scrollToRow(1);
- selection.select(3);
- selection.currentIndex = 3;
- selection.currentColumn = secondcolumn;
-
- synthesizeKeyExpectEvent("VK_DOWN", {}, tree, "!select", "key down unselectable cell");
- testtag_tree_TreeSelection_State(tree, testid + "key down unselectable cell",
- 5, [5], 2, secondcolumn);
-
- tree.treeBoxObject.scrollToRow(4);
- synthesizeKeyExpectEvent("VK_UP", {}, tree, "!select", "key up unselectable cell");
- testtag_tree_TreeSelection_State(tree, testid + "key up unselectable cell",
- 3, [3], 3, secondcolumn);
- }
-
- // restore the scroll position to the start of the page
- sendKey("HOME");
-}
-
-function testtag_tree_TreeView(tree, testid, rowInfo)
-{
- testid += " view ";
-
- var columns = tree.columns;
- var view = tree.view;
-
- is(view instanceof Components.interfaces.nsITreeView, true, testid + "view is a TreeView");
- is(view.rowCount, rowInfo.rows.length, testid + "rowCount");
-
- testtag_tree_TreeView_rows(tree, testid, rowInfo, 0);
-
- // note that this will only work for content trees currently
- view.setCellText(0, columns[1], "Changed Value");
- is(view.getCellText(0, columns[1]), "Changed Value", "setCellText");
-
- view.setCellValue(1, columns[0], "Another Changed Value");
- is(view.getCellValue(1, columns[0]), "Another Changed Value", "setCellText");
-}
-
-function testtag_tree_TreeView_rows(tree, testid, rowInfo, startRow)
-{
- var r;
- var columns = tree.columns;
- var view = tree.view;
- var length = rowInfo.rows.length;
-
- // methods to test along with the functions which determine the expected value
- var checkRowMethods =
- {
- isContainer: function(row) { return row.container },
- isContainerOpen: function(row) { return false },
- isContainerEmpty: function(row) { return (row.children != null && row.children.rows.length == 0) },
- isSeparator: function(row) { return row.separator },
- getRowProperties: function(row) { return row.properties },
- getLevel: function(row) { return row.level },
- getParentIndex: function(row) { return row.parent },
- hasNextSibling: function(row) { return r < startRow + length - 1; }
- };
-
- var checkCellMethods =
- {
- getCellText: function(row, cell) { return cell.label },
- getCellValue: function(row, cell) { return cell.value },
- getCellProperties: function(row, cell) { return cell.properties },
- isEditable: function(row, cell) { return cell.editable },
- isSelectable: function(row, cell) { return cell.selectable },
- getImageSrc: function(row, cell) { return cell.image },
- getProgressMode: function(row, cell) { return cell.mode }
- };
-
- var failedMethods = { };
- var checkMethod, actual, expected;
- var containerInfo = null;
- var toggleOpenStateOK = true;
-
- for (r = startRow; r < length; r++) {
- var row = rowInfo.rows[r];
- for (var c = 0; c < row.cells.length; c++) {
- var cell = row.cells[c];
-
- for (checkMethod in checkCellMethods) {
- expected = checkCellMethods[checkMethod](row, cell);
- actual = view[checkMethod](r, columns[c]);
- if (actual !== expected) {
- failedMethods[checkMethod] = true;
- is(actual, expected, testid + "row " + r + " column " + c + " " + checkMethod + " is incorrect");
- }
- }
- }
-
- // compare row properties
- for (checkMethod in checkRowMethods) {
- expected = checkRowMethods[checkMethod](row, r);
- if (checkMethod == "hasNextSibling") {
- actual = view[checkMethod](r, r);
- }
- else {
- actual = view[checkMethod](r);
- }
- if (actual !== expected) {
- failedMethods[checkMethod] = true;
- is(actual, expected, testid + "row " + r + " " + checkMethod + " is incorrect");
- }
- }
-/*
- // open and recurse into containers
- if (row.container) {
- view.toggleOpenState(r);
- if (!view.isContainerOpen(r)) {
- toggleOpenStateOK = false;
- is(view.isContainerOpen(r), true, testid + "row " + r + " toggleOpenState open");
- }
- testtag_tree_TreeView_rows(tree, testid + "container " + r + " ", row.children, r + 1);
- view.toggleOpenState(r);
- if (view.isContainerOpen(r)) {
- toggleOpenStateOK = false;
- is(view.isContainerOpen(r), false, testid + "row " + r + " toggleOpenState close");
- }
- }
-*/
- }
-
- for (var failedMethod in failedMethods) {
- if (failedMethod in checkRowMethods)
- delete checkRowMethods[failedMethod];
- if (failedMethod in checkCellMethods)
- delete checkCellMethods[failedMethod];
- }
-
- for (checkMethod in checkRowMethods)
- is(checkMethod + " ok", checkMethod + " ok", testid + checkMethod);
- for (checkMethod in checkCellMethods)
- is(checkMethod + " ok", checkMethod + " ok", testid + checkMethod);
- if (toggleOpenStateOK)
- is("toggleOpenState ok", "toggleOpenState ok", testid + "toggleOpenState");
-}
-
-function testtag_tree_TreeView_rows_sort(tree, testid, rowInfo)
-{
- // check if cycleHeader sorts the columns
- var columnIndex = 0;
- var view = tree.view;
- var column = tree.columns[columnIndex];
- var columnElement = column.element;
- var sortkey = columnElement.getAttribute("sort");
- if (sortkey) {
- view.cycleHeader(column);
- is(tree.getAttribute("sort"), sortkey, "cycleHeader sort");
- is(tree.getAttribute("sortDirection"), "ascending", "cycleHeader sortDirection ascending");
- is(columnElement.getAttribute("sortDirection"), "ascending", "cycleHeader column sortDirection");
- is(columnElement.getAttribute("sortActive"), "true", "cycleHeader column sortActive");
- view.cycleHeader(column);
- is(tree.getAttribute("sortDirection"), "descending", "cycleHeader sortDirection descending");
- is(columnElement.getAttribute("sortDirection"), "descending", "cycleHeader column sortDirection descending");
- view.cycleHeader(column);
- is(tree.getAttribute("sortDirection"), "", "cycleHeader sortDirection natural");
- is(columnElement.getAttribute("sortDirection"), "", "cycleHeader column sortDirection natural");
- // XXXndeakin content view isSorted needs to be tested
- }
-
- // Check that clicking on column header sorts the column.
- var columns = getSortedColumnArray(tree);
- is(columnElement.getAttribute("sortDirection"), "",
- "cycleHeader column sortDirection");
-
- // Click once on column header and check sorting has cycled once.
- mouseClickOnColumnHeader(columns, columnIndex, 0, 1);
- is(columnElement.getAttribute("sortDirection"), "ascending",
- "single click cycleHeader column sortDirection ascending");
-
- // Now simulate a double click.
- mouseClickOnColumnHeader(columns, columnIndex, 0, 2);
- if (navigator.platform.indexOf("Win") == 0) {
- // Windows cycles only once on double click.
- is(columnElement.getAttribute("sortDirection"), "descending",
- "double click cycleHeader column sortDirection descending");
- // 1 single clicks should restore natural sorting.
- mouseClickOnColumnHeader(columns, columnIndex, 0, 1);
- }
-
- // Check we have gone back to natural sorting.
- is(columnElement.getAttribute("sortDirection"), "",
- "cycleHeader column sortDirection");
-
- columnElement.setAttribute("sorthints", "twostate");
- view.cycleHeader(column);
- is(tree.getAttribute("sortDirection"), "ascending", "cycleHeader sortDirection ascending twostate");
- view.cycleHeader(column);
- is(tree.getAttribute("sortDirection"), "descending", "cycleHeader sortDirection ascending twostate");
- view.cycleHeader(column);
- is(tree.getAttribute("sortDirection"), "ascending", "cycleHeader sortDirection ascending twostate again");
- columnElement.removeAttribute("sorthints");
- view.cycleHeader(column);
- view.cycleHeader(column);
-
- is(columnElement.getAttribute("sortDirection"), "",
- "cycleHeader column sortDirection reset");
-}
-
-// checks if the current and selected rows are correct
-// current is the index of the current row
-// selected is an array of the indicies of the selected rows
-// column is the selected column
-// viewidx is the row that should be visible at the top of the tree
-function testtag_tree_TreeSelection_State(tree, testid, current, selected, viewidx, column)
-{
- var selection = tree.view.selection;
-
- if (!column)
- column = (tree.selType == "cell") ? tree.columns[0] : null;
-
- is(selection.count, selected.length, testid + " count");
- is(tree.currentIndex, current, testid + " currentIndex");
- is(selection.currentIndex, current, testid + " TreeSelection currentIndex");
- is(selection.currentColumn, column, testid + " currentColumn");
- if (viewidx !== null && viewidx !== undefined)
- is(tree.treeBoxObject.getFirstVisibleRow(), viewidx, testid + " first visible row");
-
- var actualSelected = [];
- var count = tree.view.rowCount;
- for (var s = 0; s < count; s++) {
- if (selection.isSelected(s))
- actualSelected.push(s);
- }
-
- is(compareArrays(selected, actualSelected), true, testid + " selection [" + selected + "]");
-
- actualSelected = [];
- var rangecount = selection.getRangeCount();
- for (var r = 0; r < rangecount; r++) {
- var start = {}, end = {};
- selection.getRangeAt(r, start, end);
- for (var rs = start.value; rs <= end.value; rs++)
- actualSelected.push(rs);
- }
-
- is(compareArrays(selected, actualSelected), true, testid + " range selection [" + selected + "]");
-}
-
-function testtag_tree_column_reorder()
-{
- // Make sure the tree is scrolled into the view, otherwise the test will
- // fail
- var testframe = window.parent.document.getElementById("testframe");
- if (testframe) {
- testframe.scrollIntoView();
- }
-
- var tree = document.getElementById("tree-column-reorder");
- var numColumns = tree.columns.count;
-
- var reference = [];
- for (let i = 0; i < numColumns; i++) {
- reference.push("col_" + i);
- }
-
- // Drag the first column to each position
- for (let i = 0; i < numColumns - 1; i++) {
- synthesizeColumnDrag(tree, i, i + 1, true);
- arrayMove(reference, i, i + 1, true);
- checkColumns(tree, reference, "drag first column right");
- }
-
- // And back
- for (let i = numColumns - 1; i >= 1; i--) {
- synthesizeColumnDrag(tree, i, i - 1, false);
- arrayMove(reference, i, i - 1, false);
- checkColumns(tree, reference, "drag last column left");
- }
-
- // Drag each column one column left
- for (let i = 1; i < numColumns; i++) {
- synthesizeColumnDrag(tree, i, i - 1, false);
- arrayMove(reference, i, i - 1, false);
- checkColumns(tree, reference, "drag each column left");
- }
-
- // And back
- for (let i = numColumns - 2; i >= 0; i--) {
- synthesizeColumnDrag(tree, i, i + 1, true);
- arrayMove(reference, i, i + 1, true);
- checkColumns(tree, reference, "drag each column right");
- }
-
- // Drag each column 5 to the right
- for (let i = 0; i < numColumns - 5; i++) {
- synthesizeColumnDrag(tree, i, i + 5, true);
- arrayMove(reference, i, i + 5, true);
- checkColumns(tree, reference, "drag each column 5 to the right");
- }
-
- // And to the left
- for (let i = numColumns - 6; i >= 5; i--) {
- synthesizeColumnDrag(tree, i, i - 5, false);
- arrayMove(reference, i, i - 5, false);
- checkColumns(tree, reference, "drag each column 5 to the left");
- }
-
- // Test that moving a column after itself does not move anything
- synthesizeColumnDrag(tree, 0, 0, true);
- checkColumns(tree, reference, "drag to itself");
- is(document.treecolDragging, null, "drag to itself completed");
-
- // XXX roc should this be here???
- SimpleTest.finish();
-}
-
-function testtag_tree_wheel(aTree)
-{
- const deltaModes = [
- WheelEvent.DOM_DELTA_PIXEL, // 0
- WheelEvent.DOM_DELTA_LINE, // 1
- WheelEvent.DOM_DELTA_PAGE // 2
- ];
- function helper(aStart, aDelta, aIntDelta, aDeltaMode)
- {
- aTree.treeBoxObject.scrollToRow(aStart);
- var expected;
- if (!aIntDelta) {
- expected = aStart;
- }
- else if (aDeltaMode != WheelEvent.DOM_DELTA_PAGE) {
- expected = aStart + aIntDelta;
- }
- else if (aIntDelta > 0) {
- expected = aStart + aTree.treeBoxObject.getPageLength();
- }
- else {
- expected = aStart - aTree.treeBoxObject.getPageLength();
- }
-
- if (expected < 0) {
- expected = 0;
- }
- if (expected > aTree.view.rowCount - aTree.treeBoxObject.getPageLength()) {
- expected = aTree.view.rowCount - aTree.treeBoxObject.getPageLength();
- }
- synthesizeWheel(aTree.body, 1, 1,
- { deltaMode: aDeltaMode, deltaY: aDelta,
- lineOrPageDeltaY: aIntDelta });
- is(aTree.treeBoxObject.getFirstVisibleRow(), expected,
- "testtag_tree_wheel: vertical, starting " + aStart +
- " delta " + aDelta + " lineOrPageDelta " + aIntDelta +
- " aDeltaMode " + aDeltaMode);
-
- aTree.treeBoxObject.scrollToRow(aStart);
- // Check that horizontal scrolling has no effect
- synthesizeWheel(aTree.body, 1, 1,
- { deltaMode: aDeltaMode, deltaX: aDelta,
- lineOrPageDeltaX: aIntDelta });
- is(aTree.treeBoxObject.getFirstVisibleRow(), aStart,
- "testtag_tree_wheel: horizontal, starting " + aStart +
- " delta " + aDelta + " lineOrPageDelta " + aIntDelta +
- " aDeltaMode " + aDeltaMode);
- }
-
- var defaultPrevented = 0;
-
- function wheelListener(event) {
- defaultPrevented++;
- }
- window.addEventListener("wheel", wheelListener, false);
-
- deltaModes.forEach(function(aDeltaMode) {
- var delta = (aDeltaMode == WheelEvent.DOM_DELTA_PIXEL) ? 5.0 : 0.3;
- helper(2, -delta, 0, aDeltaMode);
- helper(2, -delta, -1, aDeltaMode);
- helper(2, delta, 0, aDeltaMode);
- helper(2, delta, 1, aDeltaMode);
- helper(2, -2 * delta, 0, aDeltaMode);
- helper(2, -2 * delta, -1, aDeltaMode);
- helper(2, 2 * delta, 0, aDeltaMode);
- helper(2, 2 * delta, 1, aDeltaMode);
- });
-
- window.removeEventListener("wheel", wheelListener, false);
- is(defaultPrevented, 48, "wheel event default prevented");
-}
-
-function synthesizeColumnDrag(aTree, aMouseDownColumnNumber, aMouseUpColumnNumber, aAfter)
-{
- var columns = getSortedColumnArray(aTree);
-
- var down = columns[aMouseDownColumnNumber].element;
- var up = columns[aMouseUpColumnNumber].element;
-
- // Target the initial mousedown in the middle of the column header so we
- // avoid the extra hit test space given to the splitter
- var columnWidth = down.boxObject.width;
- var splitterHitWidth = columnWidth / 2;
- synthesizeMouse(down, splitterHitWidth, 3, { type: "mousedown"});
-
- var offsetX = 0;
- if (aAfter) {
- offsetX = columnWidth;
- }
-
- if (aMouseUpColumnNumber > aMouseDownColumnNumber) {
- for (let i = aMouseDownColumnNumber; i <= aMouseUpColumnNumber; i++) {
- let move = columns[i].element;
- synthesizeMouse(move, offsetX, 3, { type: "mousemove"});
- }
- }
- else {
- for (let i = aMouseDownColumnNumber; i >= aMouseUpColumnNumber; i--) {
- let move = columns[i].element;
- synthesizeMouse(move, offsetX, 3, { type: "mousemove"});
- }
- }
-
- synthesizeMouse(up, offsetX, 3, { type: "mouseup"});
-}
-
-function arrayMove(aArray, aFrom, aTo, aAfter)
-{
- var o = aArray.splice(aFrom, 1)[0];
- if (aTo > aFrom) {
- aTo--;
- }
-
- if (aAfter) {
- aTo++;
- }
-
- aArray.splice(aTo, 0, o);
-}
-
-function getSortedColumnArray(aTree)
-{
- var columns = aTree.columns;
- var array = [];
- for (let i = 0; i < columns.length; i++) {
- array.push(columns.getColumnAt(i));
- }
-
- array.sort(function(a, b) {
- var o1 = parseInt(a.element.getAttribute("ordinal"));
- var o2 = parseInt(b.element.getAttribute("ordinal"));
- return o1 - o2;
- });
- return array;
-}
-
-function checkColumns(aTree, aReference, aMessage)
-{
- var columns = getSortedColumnArray(aTree);
- var ids = [];
- columns.forEach(function(e) {
- ids.push(e.element.id);
- });
- is(compareArrays(ids, aReference), true, aMessage);
-}
-
-function mouseOnCell(tree, row, column, testname)
-{
- var rect = tree.boxObject.getCoordsForCellItem(row, column, "text");
-
- synthesizeMouseExpectEvent(tree.body, rect.x, rect.y, {}, tree, "select", testname);
-}
-
-function mouseClickOnColumnHeader(aColumns, aColumnIndex, aButton, aClickCount)
-{
- var columnHeader = aColumns[aColumnIndex].element;
- var columnHeaderRect = columnHeader.getBoundingClientRect();
- var columnWidth = columnHeaderRect.right - columnHeaderRect.left;
- // For multiple click we send separate click events, with increasing
- // clickCount. This simulates the common behavior of multiple clicks.
- for (let i = 1; i <= aClickCount; i++) {
- // Target the middle of the column header.
- synthesizeMouse(columnHeader, columnWidth / 2, 3,
- { button: aButton,
- clickCount: i }, null);
- }
-}
-
-function mouseDblClickOnCell(tree, row, column, testname)
-{
- // select the row we will edit
- var selection = tree.view.selection;
- selection.select(row);
- tree.treeBoxObject.ensureRowIsVisible(row);
-
- // get cell coordinates
- var rect = tree.treeBoxObject.getCoordsForCellItem(row, column, "text");
-
- synthesizeMouse(tree.body, rect.x, rect.y, { clickCount: 2 }, null);
-}
-
-function compareArrays(arr1, arr2)
-{
- if (arr1.length != arr2.length)
- return false;
-
- for (let i = 0; i < arr1.length; i++) {
- if (arr1[i] != arr2[i])
- return false;
- }
-
- return true;
-}
-
-function convertProperties(arr)
-{
- var results = [];
- var count = arr.Count();
- for (let i = 0; i < count; i++)
- results.push(arr.GetElementAt(i).QueryInterface(Components.interfaces.nsIAtom).toString());
-
- results.sort();
- return results.join(" ");
-}
-
-function convertDOMtoTreeRowInfo(treechildren, level, rowidx)
-{
- var obj = { rows: [] };
-
- var parentidx = rowidx.value;
-
- treechildren = treechildren.childNodes;
- for (var r = 0; r < treechildren.length; r++) {
- rowidx.value++;
-
- var treeitem = treechildren[r];
- if (treeitem.hasChildNodes()) {
- var treerow = treeitem.firstChild;
- var cellInfo = [];
- for (var c = 0; c < treerow.childNodes.length; c++) {
- var cell = treerow.childNodes[c];
- cellInfo.push({ label: "" + cell.getAttribute("label"),
- value: cell.getAttribute("value"),
- properties: cell.getAttribute("properties"),
- editable: cell.getAttribute("editable") != "false",
- selectable: cell.getAttribute("selectable") != "false",
- image: cell.getAttribute("src"),
- mode: cell.hasAttribute("mode") ? parseInt(cell.getAttribute("mode")) : 3 });
- }
-
- var descendants = treeitem.lastChild;
- var children = (treerow == descendants) ? null :
- convertDOMtoTreeRowInfo(descendants, level + 1, rowidx);
- obj.rows.push({ cells: cellInfo,
- properties: treerow.getAttribute("properties"),
- container: treeitem.getAttribute("container") == "true",
- separator: treeitem.localName == "treeseparator",
- children: children,
- level: level,
- parent: parentidx });
- }
- }
-
- return obj;
-}
diff --git a/toolkit/content/tests/widgets/video.ogg b/toolkit/content/tests/widgets/video.ogg
deleted file mode 100644
index ac7ece351..000000000
--- a/toolkit/content/tests/widgets/video.ogg
+++ /dev/null
Binary files differ
diff --git a/toolkit/content/tests/widgets/videocontrols_direction-1-ref.html b/toolkit/content/tests/widgets/videocontrols_direction-1-ref.html
deleted file mode 100644
index 1f7e76a7d..000000000
--- a/toolkit/content/tests/widgets/videocontrols_direction-1-ref.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<link rel="stylesheet" type="text/css" href="videomask.css">
-</head>
-<body style="text-align: right;">
-<video controls preload="none" id="av" source="audio.wav"></video>
-<div id="mask"></div>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/videocontrols_direction-1a.html b/toolkit/content/tests/widgets/videocontrols_direction-1a.html
deleted file mode 100644
index a4d354629..000000000
--- a/toolkit/content/tests/widgets/videocontrols_direction-1a.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<html dir="rtl">
-<head>
-<link rel="stylesheet" type="text/css" href="videomask.css">
-</head>
-<body>
-<video controls preload="none" id="av" source="audio.wav"></video>
-<div id="mask"></div>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/videocontrols_direction-1b.html b/toolkit/content/tests/widgets/videocontrols_direction-1b.html
deleted file mode 100644
index a14b11d5f..000000000
--- a/toolkit/content/tests/widgets/videocontrols_direction-1b.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<html style="direction: rtl">
-<head>
-<link rel="stylesheet" type="text/css" href="videomask.css">
-</head>
-<body>
-<video controls preload="none" id="av" source="audio.wav"></video>
-<div id="mask"></div>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/videocontrols_direction-1c.html b/toolkit/content/tests/widgets/videocontrols_direction-1c.html
deleted file mode 100644
index 0885ebd89..000000000
--- a/toolkit/content/tests/widgets/videocontrols_direction-1c.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<link rel="stylesheet" type="text/css" href="videomask.css">
-</head>
-<body style="direction: rtl">
-<video controls preload="none" id="av" source="audio.wav"></video>
-<div id="mask"></div>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/videocontrols_direction-1d.html b/toolkit/content/tests/widgets/videocontrols_direction-1d.html
deleted file mode 100644
index a39accec7..000000000
--- a/toolkit/content/tests/widgets/videocontrols_direction-1d.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<link rel="stylesheet" type="text/css" href="videomask.css">
-</head>
-<body style="text-align: right;">
-<video controls preload="none" id="av" source="audio.wav" dir="rtl"></video>
-<div id="mask"></div>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/videocontrols_direction-1e.html b/toolkit/content/tests/widgets/videocontrols_direction-1e.html
deleted file mode 100644
index 25e7c2c1f..000000000
--- a/toolkit/content/tests/widgets/videocontrols_direction-1e.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<link rel="stylesheet" type="text/css" href="videomask.css">
-</head>
-<body style="text-align: right;">
-<video controls preload="none" id="av" source="audio.wav" style="direction: rtl;"></video>
-<div id="mask"></div>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/videocontrols_direction-2-ref.html b/toolkit/content/tests/widgets/videocontrols_direction-2-ref.html
deleted file mode 100644
index 630177883..000000000
--- a/toolkit/content/tests/widgets/videocontrols_direction-2-ref.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<link rel="stylesheet" type="text/css" href="videomask.css">
-</head>
-<body style="text-align: right;">
-<audio controls preload="none" id="av" source="audio.wav"></audio>
-<div id="mask"></div>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/videocontrols_direction-2a.html b/toolkit/content/tests/widgets/videocontrols_direction-2a.html
deleted file mode 100644
index 2e40cdc1a..000000000
--- a/toolkit/content/tests/widgets/videocontrols_direction-2a.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<html dir="rtl">
-<head>
-<link rel="stylesheet" type="text/css" href="videomask.css">
-</head>
-<body>
-<audio controls preload="none" id="av" source="audio.wav"></audio>
-<div id="mask"></div>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/videocontrols_direction-2b.html b/toolkit/content/tests/widgets/videocontrols_direction-2b.html
deleted file mode 100644
index 2e4dadb6f..000000000
--- a/toolkit/content/tests/widgets/videocontrols_direction-2b.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<html style="direction: rtl">
-<head>
-<link rel="stylesheet" type="text/css" href="videomask.css">
-</head>
-<body>
-<audio controls preload="none" id="av" source="audio.wav"></audio>
-<div id="mask"></div>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/videocontrols_direction-2c.html b/toolkit/content/tests/widgets/videocontrols_direction-2c.html
deleted file mode 100644
index a43b03e8f..000000000
--- a/toolkit/content/tests/widgets/videocontrols_direction-2c.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<link rel="stylesheet" type="text/css" href="videomask.css">
-</head>
-<body style="direction: rtl">
-<audio controls preload="none" id="av" source="audio.wav"></audio>
-<div id="mask"></div>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/videocontrols_direction-2d.html b/toolkit/content/tests/widgets/videocontrols_direction-2d.html
deleted file mode 100644
index 52d56f1cc..000000000
--- a/toolkit/content/tests/widgets/videocontrols_direction-2d.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<link rel="stylesheet" type="text/css" href="videomask.css">
-</head>
-<body style="text-align: right;">
-<audio controls preload="none" id="av" source="audio.wav" dir="rtl"></audio>
-<div id="mask"></div>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/videocontrols_direction-2e.html b/toolkit/content/tests/widgets/videocontrols_direction-2e.html
deleted file mode 100644
index 58bc30e2b..000000000
--- a/toolkit/content/tests/widgets/videocontrols_direction-2e.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
-<link rel="stylesheet" type="text/css" href="videomask.css">
-</head>
-<body style="text-align: right;">
-<audio controls preload="none" id="av" source="audio.wav" style="direction: rtl;"></audio>
-<div id="mask"></div>
-</body>
-</html>
diff --git a/toolkit/content/tests/widgets/videocontrols_direction_test.js b/toolkit/content/tests/widgets/videocontrols_direction_test.js
deleted file mode 100644
index 8ad76c064..000000000
--- a/toolkit/content/tests/widgets/videocontrols_direction_test.js
+++ /dev/null
@@ -1,90 +0,0 @@
-var RemoteCanvas = function(url, id) {
- this.url = url;
- this.id = id;
- this.snapshot = null;
-};
-
-RemoteCanvas.CANVAS_WIDTH = 200;
-RemoteCanvas.CANVAS_HEIGHT = 200;
-
-RemoteCanvas.prototype.compare = function(otherCanvas, expected) {
- return compareSnapshots(this.snapshot, otherCanvas.snapshot, expected)[0];
-}
-
-RemoteCanvas.prototype.load = function(callback) {
- var iframe = document.createElement("iframe");
- iframe.id = this.id + "-iframe";
- iframe.width = RemoteCanvas.CANVAS_WIDTH + "px";
- iframe.height = RemoteCanvas.CANVAS_HEIGHT + "px";
- iframe.src = this.url;
- var me = this;
- iframe.addEventListener("load", function() {
- info("iframe loaded");
- var m = iframe.contentDocument.getElementById("av");
- m.addEventListener("suspend", function(aEvent) {
- m.removeEventListener("suspend", arguments.callee, false);
- setTimeout(function() {
- me.remotePageLoaded(callback);
- }, 0);
- }, false);
- m.src = m.getAttribute("source");
- }, false);
- window.document.body.appendChild(iframe);
-};
-
-RemoteCanvas.prototype.remotePageLoaded = function(callback) {
- var ldrFrame = document.getElementById(this.id + "-iframe");
- this.snapshot = snapshotWindow(ldrFrame.contentWindow);
- this.snapshot.id = this.id + "-canvas";
- window.document.body.appendChild(this.snapshot);
- callback(this);
-};
-
-RemoteCanvas.prototype.cleanup = function() {
- var iframe = document.getElementById(this.id + "-iframe");
- iframe.parentNode.removeChild(iframe);
- var canvas = document.getElementById(this.id + "-canvas");
- canvas.parentNode.removeChild(canvas);
-};
-
-function runTest(index) {
- var canvases = [];
- function testCallback(canvas) {
- canvases.push(canvas);
-
- if (canvases.length == 2) { // when both canvases are loaded
- var expectedEqual = currentTest.op == "==";
- var result = canvases[0].compare(canvases[1], expectedEqual);
- ok(result, "Rendering of reftest " + currentTest.test + " should " +
- (expectedEqual ? "not " : "") + "be different to the reference");
-
- if (result) {
- canvases[0].cleanup();
- canvases[1].cleanup();
- }
- else {
- info("Snapshot of canvas 1: " + canvases[0].snapshot.toDataURL());
- info("Snapshot of canvas 2: " + canvases[1].snapshot.toDataURL());
- }
-
- if (index < tests.length - 1)
- runTest(index + 1);
- else
- SimpleTest.finish();
- }
- }
-
- var currentTest = tests[index];
- var testCanvas = new RemoteCanvas(currentTest.test, "test-" + index);
- testCanvas.load(testCallback);
-
- var refCanvas = new RemoteCanvas(currentTest.ref, "ref-" + index);
- refCanvas.load(testCallback);
-}
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestCompleteLog();
-
-window.addEventListener("load", function() {
- SpecialPowers.pushPrefEnv({"set": [["media.cache_size", 40000]]}, function() { runTest(0); });
-}, true);
diff --git a/toolkit/content/tests/widgets/videomask.css b/toolkit/content/tests/widgets/videomask.css
deleted file mode 100644
index 066d44138..000000000
--- a/toolkit/content/tests/widgets/videomask.css
+++ /dev/null
@@ -1,23 +0,0 @@
-html, body {
- margin: 0;
- padding: 0;
-}
-
-audio, video {
- width: 140px;
- height: 100px;
- background-color: black;
-}
-
-/**
- * Create a mask for the video direction tests which covers up the throbber.
- */
-#mask {
- position: absolute;
- z-index: 3;
- width: 140px;
- height: 72px;
- background-color: green;
- top: 0;
- right: 0;
-}
diff --git a/toolkit/content/tests/widgets/window_menubar.xul b/toolkit/content/tests/widgets/window_menubar.xul
deleted file mode 100644
index b7669e0b3..000000000
--- a/toolkit/content/tests/widgets/window_menubar.xul
+++ /dev/null
@@ -1,820 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<!-- the condition in the focus event handler is because pressing Tab
- unfocuses and refocuses the window on Windows -->
-
-<window title="Popup Tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="application/javascript" src="popup_shared.js"></script>
-
-<!--
- Need to investigate these tests a bit more. Some of the accessibility events
- are firing multiple times or in different orders in different circumstances.
- Note that this was also the case before bug 279703.
- -->
-
-<hbox style="margin-left: 275px; margin-top: 275px;">
-<menubar id="menubar">
- <menu id="filemenu" label="File" accesskey="F">
- <menupopup id="filepopup">
- <menuitem id="item1" label="Open" accesskey="O"/>
- <menuitem id="item2" label="Save" accesskey="S"/>
- <menuitem id="item3" label="Close" accesskey="C"/>
- </menupopup>
- </menu>
- <menu id="secretmenu" label="Secret Menu" accesskey="S" disabled="true">
- <menupopup>
- <menuitem label="Secret Command" accesskey="S"/>
- </menupopup>
- </menu>
- <menu id="editmenu" label="Edit" accesskey="E">
- <menupopup id="editpopup">
- <menuitem id="cut" label="Cut" accesskey="t" disabled="true"/>
- <menuitem id="copy" label="Copy" accesskey="C"/>
- <menuitem id="paste" label="Paste" accesskey="P"/>
- </menupopup>
- </menu>
- <menu id="viewmenu" label="View" accesskey="V">
- <menupopup id="viewpopup">
- <menu id="toolbar" label="Toolbar" accesskey="T">
- <menupopup id="toolbarpopup">
- <menuitem id="navigation" label="Navigation" accesskey="N" disabled="true"/>
- <menuitem label="Bookmarks" accesskey="B" disabled="true"/>
- </menupopup>
- </menu>
- <menuitem label="Status Bar" accesskey="S"/>
- <menu label="Sidebar" accesskey="d">
- <menupopup>
- <menuitem label="Bookmarks" accesskey="B"/>
- <menuitem label="History" accesskey="H"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- <menu id="helpmenu" label="Help" accesskey="H">
- <menupopup id="helppopup" >
- <label value="Unselectable"/>
- <menuitem id="contents" label="Contents" accesskey="C"/>
- <menuitem label="More Info" accesskey="I"/>
- <menuitem id="amenu" label="A Menu" accesskey="M"/>
- <menuitem label="Another Menu"/>
- <menuitem id="one" label="One"/>
- <menu id="only" label="Only Menu">
- <menupopup>
- <menuitem label="Test Submenu"/>
- </menupopup>
- </menu>
- <menuitem label="Second Menu"/>
- <menuitem id="other" disabled="true" label="Other Menu"/>
- <menuitem id="third" label="Third Menu"/>
- <menuitem label="One Other Menu"/>
- <label value="Unselectable"/>
- <menuitem id="about" label="About" accesskey="A"/>
- </menupopup>
- </menu>
-</menubar>
-</hbox>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-window.opener.SimpleTest.waitForFocus(function () {
- gFilePopup = document.getElementById("filepopup");
- var filemenu = document.getElementById("filemenu");
- filemenu.focus();
- is(filemenu.openedWithKey, false, "initial openedWithKey");
- startPopupTests(popupTests);
-}, window);
-
-// On Linux, the first menu opens when F10 is pressed, but on other platforms
-// the menubar is focused but no menu is opened. This means that different events
-// fire.
-function pressF10Events()
-{
- return navigator.platform.indexOf("Linux") >= 0 ?
- [ "DOMMenuBarActive menubar", "DOMMenuItemActive filemenu", "popupshowing filepopup", "DOMMenuItemActive item1", "popupshown filepopup"] :
- [ "DOMMenuBarActive menubar", "DOMMenuItemActive filemenu" ];
-}
-
-function closeAfterF10Events(extraInactive)
-{
- if (navigator.platform.indexOf("Linux") >= 0) {
- var events = [ "popuphiding filepopup", "popuphidden filepopup", "DOMMenuItemInactive item1",
- "DOMMenuInactive filepopup", "DOMMenuBarInactive menubar",
- "DOMMenuItemInactive filemenu" ];
- if (extraInactive)
- events.push("DOMMenuItemInactive filemenu");
- return events;
- }
-
- return [ "DOMMenuBarInactive menubar", "DOMMenuItemInactive filemenu" ];
-}
-
-var popupTests = [
-{
- testname: "press on menu",
- events: [ "popupshowing filepopup", "DOMMenuBarActive menubar",
- "DOMMenuItemActive filemenu", "popupshown filepopup" ],
- test: function() { synthesizeMouse(document.getElementById("filemenu"), 8, 8, { }); },
- result: function (testname) {
- checkActive(gFilePopup, "", testname);
- checkOpen("filemenu", testname);
- is(document.getElementById("filemenu").openedWithKey, false, testname + " openedWithKey");
- }
-},
-{
- // check that pressing cursor down while there is no selection
- // highlights the first item
- testname: "cursor down no selection",
- events: [ "DOMMenuItemActive item1" ],
- test: function() { sendKey("DOWN"); },
- result: function(testname) { checkActive(gFilePopup, "item1", testname); }
-},
-{
- // check that pressing cursor up wraps and highlights the last item
- testname: "cursor up wrap",
- events: [ "DOMMenuItemInactive item1", "DOMMenuItemActive item3" ],
- test: function() { sendKey("UP"); },
- result: function(testname) { checkActive(gFilePopup, "item3", testname); }
-},
-{
- // check that pressing cursor down wraps and highlights the first item
- testname: "cursor down wrap",
- events: [ "DOMMenuItemInactive item3", "DOMMenuItemActive item1" ],
- test: function() { sendKey("DOWN"); },
- result: function(testname) { checkActive(gFilePopup, "item1", testname); }
-},
-{
- // check that pressing cursor down highlights the second item
- testname: "cursor down",
- events: [ "DOMMenuItemInactive item1", "DOMMenuItemActive item2" ],
- test: function() { sendKey("DOWN"); },
- result: function(testname) { checkActive(gFilePopup, "item2", testname); }
-},
-{
- // check that pressing cursor up highlights the second item
- testname: "cursor up",
- events: [ "DOMMenuItemInactive item2", "DOMMenuItemActive item1" ],
- test: function() { sendKey("UP"); },
- result: function(testname) { checkActive(gFilePopup, "item1", testname); }
-},
-
-{
- // cursor right should skip the disabled menu and move to the edit menu
- testname: "cursor right skip disabled",
- events: function() {
- var elist = [
- // the file menu gets deactivated, the file menu gets hidden, then
- // the edit menu is activated
- "DOMMenuItemInactive filemenu", "DOMMenuItemActive editmenu",
- "popuphiding filepopup", "popuphidden filepopup",
- // the popupshowing event gets fired when showing the edit menu.
- // The item from the file menu doesn't get deactivated until the
- // next item needs to be selected
- "popupshowing editpopup", "DOMMenuItemInactive item1",
- // not sure why the menu inactivated event is firing so late
- "DOMMenuInactive filepopup"
- ];
- // finally, the first item is activated and popupshown is fired.
- // On Windows, don't skip disabled items.
- if (navigator.platform.indexOf("Win") == 0)
- elist.push("DOMMenuItemActive cut");
- else
- elist.push("DOMMenuItemActive copy");
- elist.push("popupshown editpopup");
- return elist;
- },
- test: function() { sendKey("RIGHT"); },
- result: function(testname) {
- var expected = (navigator.platform.indexOf("Win") == 0) ? "cut" : "copy";
- checkActive(document.getElementById("editpopup"), expected, testname);
- checkClosed("filemenu", testname);
- checkOpen("editmenu", testname);
- is(document.getElementById("editmenu").openedWithKey, false, testname + " openedWithKey");
- }
-},
-{
- // on Windows, a disabled item is selected, so pressing RETURN should close
- // the menu but not fire a command event
- testname: "enter on disabled",
- events: function() {
- if (navigator.platform.indexOf("Win") == 0)
- return [ "popuphiding editpopup", "popuphidden editpopup",
- "DOMMenuItemInactive cut", "DOMMenuInactive editpopup",
- "DOMMenuBarInactive menubar",
- "DOMMenuItemInactive editmenu", "DOMMenuItemInactive editmenu" ];
- else
- return [ "DOMMenuItemInactive copy", "DOMMenuInactive editpopup",
- "DOMMenuBarInactive menubar",
- "DOMMenuItemInactive editmenu", "DOMMenuItemInactive editmenu",
- "command copy", "popuphiding editpopup", "popuphidden editpopup",
- "DOMMenuItemInactive copy" ];
- },
- test: function() { sendKey("RETURN"); },
- result: function(testname) {
- checkClosed("editmenu", testname);
- is(document.getElementById("editmenu").openedWithKey, false, testname + " openedWithKey");
- }
-},
-{
- // pressing Alt + a key should open the corresponding menu
- testname: "open with accelerator",
- events: function() {
- return [ "DOMMenuBarActive menubar",
- "popupshowing viewpopup", "DOMMenuItemActive viewmenu",
- "DOMMenuItemActive toolbar", "popupshown viewpopup" ];
- },
- test: function() { synthesizeKey("V", { altKey: true }); },
- result: function(testname) {
- checkOpen("viewmenu", testname);
- is(document.getElementById("viewmenu").openedWithKey, true, testname + " openedWithKey");
- }
-},
-{
- // open the submenu with the cursor right key
- testname: "open submenu with cursor right",
- events: function() {
- // on Windows, the disabled 'navigation' item can stll be highlihted
- if (navigator.platform.indexOf("Win") == 0)
- return [ "popupshowing toolbarpopup", "DOMMenuItemActive navigation",
- "popupshown toolbarpopup" ];
- else
- return [ "popupshowing toolbarpopup", "popupshown toolbarpopup" ];
- },
- test: function() { sendKey("RIGHT"); },
- result: function(testname) {
- checkOpen("viewmenu", testname);
- checkOpen("toolbar", testname);
- }
-},
-{
- // close the submenu with the cursor left key
- testname: "close submenu with cursor left",
- events: function() {
- if (navigator.platform.indexOf("Win") == 0)
- return [ "popuphiding toolbarpopup", "popuphidden toolbarpopup",
- "DOMMenuItemInactive navigation", "DOMMenuInactive toolbarpopup",
- "DOMMenuItemActive toolbar" ];
- else
- return [ "popuphiding toolbarpopup", "popuphidden toolbarpopup",
- "DOMMenuInactive toolbarpopup",
- "DOMMenuItemActive toolbar" ];
- },
- test: function() { sendKey("LEFT"); },
- result: function(testname) {
- checkOpen("viewmenu", testname);
- checkClosed("toolbar", testname);
- }
-},
-{
- // open the submenu with the enter key
- testname: "open submenu with enter",
- events: function() {
- // on Windows, the disabled 'navigation' item can stll be highlighted
- if (navigator.platform.indexOf("Win") == 0)
- return [ "popupshowing toolbarpopup", "DOMMenuItemActive navigation",
- "popupshown toolbarpopup" ];
- else
- return [ "popupshowing toolbarpopup", "popupshown toolbarpopup" ];
- },
- test: function() { sendKey("RETURN"); },
- result: function(testname) {
- checkOpen("viewmenu", testname);
- checkOpen("toolbar", testname);
- },
-},
-{
- // close the submenu with the escape key
- testname: "close submenu with escape",
- events: function() {
- if (navigator.platform.indexOf("Win") == 0)
- return [ "popuphiding toolbarpopup", "popuphidden toolbarpopup",
- "DOMMenuItemInactive navigation", "DOMMenuInactive toolbarpopup",
- "DOMMenuItemActive toolbar" ];
- else
- return [ "popuphiding toolbarpopup", "popuphidden toolbarpopup",
- "DOMMenuInactive toolbarpopup",
- "DOMMenuItemActive toolbar" ];
- },
- test: function() { sendKey("ESCAPE"); },
- result: function(testname) {
- checkOpen("viewmenu", testname);
- checkClosed("toolbar", testname);
- },
-},
-{
- // open the submenu with the enter key again
- testname: "open submenu with enter again",
- condition: function() { return (navigator.platform.indexOf("Win") == 0) },
- events: function() {
- // on Windows, the disabled 'navigation' item can stll be highlighted
- if (navigator.platform.indexOf("Win") == 0)
- return [ "popupshowing toolbarpopup", "DOMMenuItemActive navigation",
- "popupshown toolbarpopup" ];
- else
- return [ "popupshowing toolbarpopup", "popupshown toolbarpopup" ];
- },
- test: function() { sendKey("RETURN"); },
- result: function(testname) {
- checkOpen("viewmenu", testname);
- checkOpen("toolbar", testname);
- },
-},
-{
- // while a submenu is open, switch to the next toplevel menu with the cursor right key
- testname: "while a submenu is open, switch to the next menu with the cursor right",
- condition: function() { return (navigator.platform.indexOf("Win") == 0) },
- events: [ "DOMMenuItemInactive viewmenu", "DOMMenuItemActive helpmenu",
- "popuphiding toolbarpopup", "popuphidden toolbarpopup",
- "popuphiding viewpopup", "popuphidden viewpopup",
- "popupshowing helppopup", "DOMMenuItemInactive navigation",
- "DOMMenuInactive toolbarpopup", "DOMMenuItemInactive toolbar",
- "DOMMenuInactive viewpopup", "DOMMenuItemActive contents",
- "popupshown helppopup" ],
- test: function() { sendKey("RIGHT"); },
- result: function(testname) {
- checkOpen("helpmenu", testname);
- checkClosed("toolbar", testname);
- checkClosed("viewmenu", testname);
- }
-},
-{
- // close the main menu with the escape key
- testname: "close menubar menu with escape",
- condition: function() { return (navigator.platform.indexOf("Win") == 0) },
- events: [ "popuphiding helppopup", "popuphidden helppopup",
- "DOMMenuItemInactive contents", "DOMMenuInactive helppopup",
- "DOMMenuBarInactive menubar", "DOMMenuItemInactive helpmenu" ],
- test: function() { sendKey("ESCAPE"); },
- result: function(testname) { checkClosed("viewmenu", testname); },
-},
-{
- // close the main menu with the escape key
- testname: "close menubar menu with escape",
- condition: function() { return (navigator.platform.indexOf("Win") != 0) },
- events: [ "popuphiding viewpopup", "popuphidden viewpopup",
- "DOMMenuItemInactive toolbar", "DOMMenuInactive viewpopup",
- "DOMMenuBarInactive menubar",
- "DOMMenuItemInactive viewmenu" ],
- test: function() { sendKey("ESCAPE"); },
- result: function(testname) { checkClosed("viewmenu", testname); },
-},
-{
- // Pressing Alt should highlight the first menu but not open it,
- // but it should be ignored if the alt keydown event is consumed.
- testname: "alt shouldn't activate menubar if keydown event is consumed",
- test: function() {
- document.addEventListener("keydown", function (aEvent) {
- document.removeEventListener("keydown", arguments.callee, true);
- aEvent.preventDefault();
- }, true);
- sendKey("ALT");
- },
- result: function(testname) {
- ok(!document.getElementById("filemenu").openedWithKey, testname);
- checkClosed("filemenu", testname);
- },
-},
-{
- // Pressing Alt should highlight the first menu but not open it,
- // but it should be ignored if the alt keyup event is consumed.
- testname: "alt shouldn't activate menubar if keyup event is consumed",
- test: function() {
- document.addEventListener("keyup", function (aEvent) {
- document.removeEventListener("keyup", arguments.callee, true);
- aEvent.preventDefault();
- }, true);
- sendKey("ALT");
- },
- result: function(testname) {
- ok(!document.getElementById("filemenu").openedWithKey, testname);
- checkClosed("filemenu", testname);
- },
-},
-{
- // Pressing Alt should highlight the first menu but not open it.
- testname: "alt to activate menubar",
- events: [ "DOMMenuBarActive menubar", "DOMMenuItemActive filemenu" ],
- test: function() { sendKey("ALT"); },
- result: function(testname) {
- is(document.getElementById("filemenu").openedWithKey, true, testname + " openedWithKey");
- checkClosed("filemenu", testname);
- },
-},
-{
- // pressing cursor left should select the previous menu but not open it
- testname: "cursor left on active menubar",
- events: [ "DOMMenuItemInactive filemenu", "DOMMenuItemActive helpmenu" ],
- test: function() { sendKey("LEFT"); },
- result: function(testname) { checkClosed("helpmenu", testname); },
-},
-{
- // pressing cursor right should select the previous menu but not open it
- testname: "cursor right on active menubar",
- events: [ "DOMMenuItemInactive helpmenu", "DOMMenuItemActive filemenu" ],
- test: function() { sendKey("RIGHT"); },
- result: function(testname) { checkClosed("filemenu", testname); },
-},
-{
- // pressing a character should act as an accelerator and open the menu
- testname: "accelerator on active menubar",
- events: [ "popupshowing helppopup",
- "DOMMenuItemInactive filemenu", "DOMMenuItemActive helpmenu",
- "DOMMenuItemActive contents", "popupshown helppopup" ],
- test: function() { sendChar("h"); },
- result: function(testname) {
- checkOpen("helpmenu", testname);
- is(document.getElementById("helpmenu").openedWithKey, true, testname + " openedWithKey");
- },
-},
-{
- // check that pressing cursor up skips non menuitems
- testname: "cursor up wrap",
- events: [ "DOMMenuItemInactive contents", "DOMMenuItemActive about" ],
- test: function() { sendKey("UP"); },
- result: function(testname) { }
-},
-{
- // check that pressing cursor down skips non menuitems
- testname: "cursor down wrap",
- events: [ "DOMMenuItemInactive about", "DOMMenuItemActive contents" ],
- test: function() { sendKey("DOWN"); },
- result: function(testname) { }
-},
-{
- // check that pressing a menuitem's accelerator selects it
- testname: "menuitem accelerator",
- events: [ "DOMMenuItemInactive contents", "DOMMenuItemActive amenu",
- "DOMMenuItemInactive amenu", "DOMMenuInactive helppopup",
- "DOMMenuBarInactive menubar", "DOMMenuItemInactive helpmenu",
- "DOMMenuItemInactive helpmenu",
- "command amenu", "popuphiding helppopup", "popuphidden helppopup",
- "DOMMenuItemInactive amenu",
- ],
- test: function() { sendChar("m"); },
- result: function(testname) { checkClosed("helpmenu", testname); }
-},
-{
- // pressing F10 should highlight the first menu. On Linux, the menu is opened.
- testname: "F10 to activate menubar",
- events: pressF10Events(),
- test: function() { sendKey("F10"); },
- result: function(testname) {
- is(document.getElementById("filemenu").openedWithKey, true, testname + " openedWithKey");
- if (navigator.platform.indexOf("Linux") >= 0)
- checkOpen("filemenu", testname);
- else
- checkClosed("filemenu", testname);
- },
-},
-{
- // pressing cursor left then down should open a menu
- testname: "cursor down on menu",
- events: (navigator.platform.indexOf("Linux") >= 0) ?
- [ "DOMMenuItemInactive filemenu", "DOMMenuItemActive helpmenu",
- // This is in a different order than the
- // "accelerator on active menubar" because menus opened from a
- // shortcut key are fired asynchronously
- "popuphiding filepopup", "popuphidden filepopup",
- "popupshowing helppopup", "DOMMenuItemInactive item1",
- "DOMMenuItemActive item2", "DOMMenuItemInactive item2",
- "DOMMenuInactive filepopup", "DOMMenuItemActive contents",
- "popupshown helppopup" ] :
- [ "popupshowing helppopup", "DOMMenuItemInactive filemenu",
- "DOMMenuItemActive helpmenu",
- // This is in a different order than the
- // "accelerator on active menubar" because menus opened from a
- // shortcut key are fired asynchronously
- "DOMMenuItemActive contents", "popupshown helppopup" ],
- test: function() { sendKey("LEFT"); sendKey("DOWN"); },
- result: function(testname) {
- is(document.getElementById("helpmenu").openedWithKey, true, testname + " openedWithKey");
- }
-},
-{
- // pressing a letter that doesn't correspond to an accelerator. The menu
- // should not close because there is more than one item corresponding to
- // that letter
- testname: "menuitem with no accelerator",
- events: [ "DOMMenuItemInactive contents", "DOMMenuItemActive one" ],
- test: function() { sendChar("o"); },
- result: function(testname) { checkOpen("helpmenu", testname); }
-},
-{
- // pressing the letter again should select the next one that starts with
- // that letter
- testname: "menuitem with no accelerator again",
- events: [ "DOMMenuItemInactive one", "DOMMenuItemActive only" ],
- test: function() { sendChar("o"); },
- result: function(testname) {
- // 'only' is a menu but it should not be open
- checkOpen("helpmenu", testname);
- checkClosed("only", testname);
- }
-},
-{
- // pressing the letter again when the next item is disabled should still
- // select the disabled item
- testname: "menuitem with no accelerator disabled",
- condition: function() { return (navigator.platform.indexOf("Win") == 0) },
- events: [ "DOMMenuItemInactive only", "DOMMenuItemActive other" ],
- test: function() { sendChar("o"); },
- result: function(testname) { }
-},
-{
- // when only one menuitem starting with that letter exists, it should be
- // selected and the menu closed
- testname: "menuitem with no accelerator single",
- events: function() {
- var elist = [ "DOMMenuItemInactive other", "DOMMenuItemActive third",
- "DOMMenuItemInactive third", "DOMMenuInactive helppopup",
- "DOMMenuBarInactive menubar",
- "DOMMenuItemInactive helpmenu",
- "DOMMenuItemInactive helpmenu",
- "command third", "popuphiding helppopup",
- "popuphidden helppopup", "DOMMenuItemInactive third",
- ];
- if (navigator.platform.indexOf("Win") == -1)
- elist[0] = "DOMMenuItemInactive only";
- return elist;
- },
- test: function() { sendChar("t"); },
- result: function(testname) { checkClosed("helpmenu", testname); }
-},
-{
- // pressing F10 should highlight the first menu but not open it
- testname: "F10 to activate menubar again",
- condition: function() { return (navigator.platform.indexOf("Win") == 0) },
- events: [ "DOMMenuBarActive menubar", "DOMMenuItemActive filemenu" ],
- test: function() { sendKey("F10"); },
- result: function(testname) { checkClosed("filemenu", testname); },
-},
-{
- // pressing an accelerator for a disabled item should deactivate the menubar
- testname: "accelerator for disabled menu",
- condition: function() { return (navigator.platform.indexOf("Win") == 0) },
- events: [ "DOMMenuItemInactive filemenu", "DOMMenuBarInactive menubar" ],
- test: function() { sendChar("s"); },
- result: function(testname) {
- checkClosed("secretmenu", testname);
- is(document.getElementById("filemenu").openedWithKey, false, testname + " openedWithKey");
- },
-},
-{
- testname: "press on disabled menu",
- test: function() {
- synthesizeMouse(document.getElementById("secretmenu"), 8, 8, { });
- },
- result: function (testname) {
- checkClosed("secretmenu", testname);
- }
-},
-{
- testname: "press on second menu with shift",
- events: [ "popupshowing editpopup", "DOMMenuBarActive menubar",
- "DOMMenuItemActive editmenu", "popupshown editpopup" ],
- test: function() {
- synthesizeMouse(document.getElementById("editmenu"), 8, 8, { shiftKey : true });
- },
- result: function (testname) {
- checkOpen("editmenu", testname);
- checkActive(document.getElementById("menubar"), "editmenu", testname);
- }
-},
-{
- testname: "press on disabled menuitem",
- test: function() {
- synthesizeMouse(document.getElementById("cut"), 8, 8, { });
- },
- result: function (testname) {
- checkOpen("editmenu", testname);
- }
-},
-{
- testname: "press on menuitem",
- events: [ "DOMMenuInactive editpopup",
- "DOMMenuBarInactive menubar",
- "DOMMenuItemInactive editmenu",
- "DOMMenuItemInactive editmenu",
- "command copy", "popuphiding editpopup", "popuphidden editpopup",
- "DOMMenuItemInactive copy",
- ],
- test: function() {
- synthesizeMouse(document.getElementById("copy"), 8, 8, { });
- },
- result: function (testname) {
- checkClosed("editmenu", testname);
- }
-},
-{
- // this test ensures that the menu can still be opened by clicking after selecting
- // a menuitem from the menu. See bug 399350.
- testname: "press on menu after menuitem selected",
- events: [ "popupshowing editpopup", "DOMMenuBarActive menubar",
- "DOMMenuItemActive editmenu", "popupshown editpopup" ],
- test: function() { synthesizeMouse(document.getElementById("editmenu"), 8, 8, { }); },
- result: function (testname) {
- checkActive(document.getElementById("editpopup"), "", testname);
- checkOpen("editmenu", testname);
- }
-},
-{ // try selecting a different command
- testname: "press on menuitem again",
- events: [ "DOMMenuInactive editpopup",
- "DOMMenuBarInactive menubar",
- "DOMMenuItemInactive editmenu",
- "DOMMenuItemInactive editmenu",
- "command paste", "popuphiding editpopup", "popuphidden editpopup",
- "DOMMenuItemInactive paste",
- ],
- test: function() {
- synthesizeMouse(document.getElementById("paste"), 8, 8, { });
- },
- result: function (testname) {
- checkClosed("editmenu", testname);
- }
-},
-{
- testname: "F10 to activate menubar for tab deactivation",
- events: pressF10Events(),
- test: function() { sendKey("F10"); },
-},
-{
- testname: "Deactivate menubar with tab key",
- events: closeAfterF10Events(true),
- test: function() { sendKey("TAB"); },
- result: function(testname) {
- is(document.getElementById("filemenu").openedWithKey, false, testname + " openedWithKey");
- }
-},
-{
- testname: "F10 to activate menubar for escape deactivation",
- events: pressF10Events(),
- test: function() { sendKey("F10"); },
-},
-{
- testname: "Deactivate menubar with escape key",
- events: closeAfterF10Events(false),
- test: function() { sendKey("ESCAPE"); },
- result: function(testname) {
- is(document.getElementById("filemenu").openedWithKey, false, testname + " openedWithKey");
- }
-},
-{
- testname: "F10 to activate menubar for f10 deactivation",
- events: pressF10Events(),
- test: function() { sendKey("F10"); },
-},
-{
- testname: "Deactivate menubar with f10 key",
- events: closeAfterF10Events(true),
- test: function() { sendKey("F10"); },
- result: function(testname) {
- is(document.getElementById("filemenu").openedWithKey, false, testname + " openedWithKey");
- }
-},
-{
- testname: "F10 to activate menubar for alt deactivation",
- condition: function() { return (navigator.platform.indexOf("Win") == 0) },
- events: [ "DOMMenuBarActive menubar", "DOMMenuItemActive filemenu" ],
- test: function() { sendKey("F10"); },
-},
-{
- testname: "Deactivate menubar with alt key",
- condition: function() { return (navigator.platform.indexOf("Win") == 0) },
- events: [ "DOMMenuBarInactive menubar", "DOMMenuItemInactive filemenu" ],
- test: function() { sendKey("ALT"); },
- result: function(testname) {
- is(document.getElementById("filemenu").openedWithKey, false, testname + " openedWithKey");
- }
-},
-{
- testname: "Don't activate menubar with mousedown during alt key auto-repeat",
- test: function() {
- synthesizeKey("VK_ALT", { type: "keydown" });
- synthesizeMouse(document.getElementById("menubar"), 8, -30, { type: "mousedown", altKey: true });
- synthesizeKey("VK_ALT", { type: "keydown" });
- synthesizeMouse(document.getElementById("menubar"), 8, -30, { type: "mouseup", altKey: true });
- synthesizeKey("VK_ALT", { type: "keydown" });
- synthesizeKey("VK_ALT", { type: "keyup" });
- },
- result: function (testname) {
- checkActive(document.getElementById("menubar"), "", testname);
- }
-},
-
-{
- testname: "Open menu and press alt key by itself - open menu",
- events: [ "DOMMenuBarActive menubar",
- "popupshowing filepopup", "DOMMenuItemActive filemenu",
- "DOMMenuItemActive item1", "popupshown filepopup" ],
- test: function() { synthesizeKey("F", { altKey: true }); },
- result: function (testname) {
- checkOpen("filemenu", testname);
- }
-},
-{
- testname: "Open menu and press alt key by itself - close menu",
- events: [ "popuphiding filepopup", "popuphidden filepopup",
- "DOMMenuItemInactive item1", "DOMMenuInactive filepopup",
- "DOMMenuBarInactive menubar", "DOMMenuItemInactive filemenu",
- "DOMMenuItemInactive filemenu" ],
- test: function() {
- synthesizeKey("VK_ALT", { });
- },
- result: function (testname) {
- checkClosed("filemenu", testname);
- }
-},
-
-// Fllowing 4 tests are a test of bug 616797, don't insert any new tests
-// between them.
-{
- testname: "Open file menu by accelerator",
- condition: function() { return (navigator.platform.indexOf("Win") == 0) },
- events: function() {
- return [ "DOMMenuBarActive menubar", "popupshowing filepopup",
- "DOMMenuItemActive filemenu", "DOMMenuItemActive item1",
- "popupshown filepopup" ];
- },
- test: function() {
- synthesizeKey("VK_ALT", { type: "keydown" });
- synthesizeKey("F", { altKey: true });
- synthesizeKey("VK_ALT", { type: "keyup" });
- }
-},
-{
- testname: "Close file menu by click at outside of popup menu",
- condition: function() { return (navigator.platform.indexOf("Win") == 0) },
- events: function() {
- return [ "popuphiding filepopup", "popuphidden filepopup",
- "DOMMenuItemInactive item1", "DOMMenuInactive filepopup",
- "DOMMenuBarInactive menubar", "DOMMenuItemInactive filemenu",
- "DOMMenuItemInactive filemenu" ];
- },
- test: function() {
- // XXX hidePopup() causes DOMMenuItemInactive event to be fired twice.
- document.getElementById("filepopup").hidePopup();
- }
-},
-{
- testname: "Alt keydown set focus the menubar",
- condition: function() { return (navigator.platform.indexOf("Win") == 0) },
- events: function() {
- return [ "DOMMenuBarActive menubar", "DOMMenuItemActive filemenu" ];
- },
- test: function() {
- sendKey("ALT");
- },
- result: function (testname) {
- checkClosed("filemenu", testname);
- }
-},
-{
- testname: "unset focus the menubar",
- condition: function() { return (navigator.platform.indexOf("Win") == 0) },
- events: function() {
- return [ "DOMMenuBarInactive menubar", "DOMMenuItemInactive filemenu" ];
- },
- test: function() {
- sendKey("ALT");
- }
-},
-
-// bug 625151
-{
- testname: "Alt key state before deactivating the window shouldn't prevent " +
- "next Alt key handling",
- condition: function() { return (navigator.platform.indexOf("Win") == 0) },
- events: function() {
- return [ "DOMMenuBarActive menubar", "DOMMenuItemActive filemenu" ];
- },
- test: function() {
- synthesizeKey("VK_ALT", { type: "keydown" });
- synthesizeKey("VK_TAB", { type: "keydown" }); // cancels the Alt key
- var thisWindow = window;
- var newWindow =
- window.open("data:text/html,", "_blank", "width=100,height=100");
- newWindow.addEventListener("focus", function () {
- newWindow.removeEventListener("focus", arguments.callee, false);
- thisWindow.addEventListener("focus", function () {
- thisWindow.removeEventListener("focus", arguments.callee, false);
- setTimeout(function () {
- sendKey("ALT", thisWindow);
- }, 0);
- }, false);
- newWindow.close();
- thisWindow.focus();
- }, false);
- }
-}
-
-];
-
-]]>
-</script>
-
-</window>
diff --git a/toolkit/forgetaboutsite/ForgetAboutSite.jsm b/toolkit/forgetaboutsite/ForgetAboutSite.jsm
index 8c7825392..9d7e512a8 100644
--- a/toolkit/forgetaboutsite/ForgetAboutSite.jsm
+++ b/toolkit/forgetaboutsite/ForgetAboutSite.jsm
@@ -216,8 +216,8 @@ this.ForgetAboutSite = {
});
}));
- // HSTS and HPKP
- // TODO (bug 1290529): also remove HSTS/HPKP information for subdomains.
+ // HSTS
+ // TODO (bug 1290529): also remove HSTS information for subdomains.
// Since we can't enumerate the information in the site security service
// (bug 1115712), we can't implement this right now.
promises.push(Task.spawn(function*() {
@@ -225,9 +225,8 @@ this.ForgetAboutSite = {
getService(Ci.nsISiteSecurityService);
let httpsURI = NetUtil.newURI("https://" + aDomain);
sss.removeState(Ci.nsISiteSecurityService.HEADER_HSTS, httpsURI, 0);
- sss.removeState(Ci.nsISiteSecurityService.HEADER_HPKP, httpsURI, 0);
}).catch(ex => {
- throw new Error("Exception thrown while clearing HSTS/HPKP: " + ex);
+ throw new Error("Exception thrown while clearing HSTS: " + ex);
}));
let ErrorCount = 0;
diff --git a/toolkit/forgetaboutsite/moz.build b/toolkit/forgetaboutsite/moz.build
index 73bb42b0b..9f77df751 100644
--- a/toolkit/forgetaboutsite/moz.build
+++ b/toolkit/forgetaboutsite/moz.build
@@ -4,12 +4,4 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-BROWSER_CHROME_MANIFESTS += ['test/browser/browser.ini']
-XPCSHELL_TESTS_MANIFESTS += ['test/unit/xpcshell.ini']
-
-EXTRA_JS_MODULES += [
- 'ForgetAboutSite.jsm',
-]
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Forget About Site')
+EXTRA_JS_MODULES += ['ForgetAboutSite.jsm']
diff --git a/toolkit/forgetaboutsite/test/browser/.eslintrc.js b/toolkit/forgetaboutsite/test/browser/.eslintrc.js
deleted file mode 100644
index c764b133d..000000000
--- a/toolkit/forgetaboutsite/test/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/forgetaboutsite/test/browser/browser.ini b/toolkit/forgetaboutsite/test/browser/browser.ini
deleted file mode 100644
index 517d89d78..000000000
--- a/toolkit/forgetaboutsite/test/browser/browser.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[DEFAULT]
-support-files = browser_clearplugindata.html
-
-[browser_clearplugindata.js]
diff --git a/toolkit/forgetaboutsite/test/browser/browser_clearplugindata.html b/toolkit/forgetaboutsite/test/browser/browser_clearplugindata.html
deleted file mode 100644
index b2bba12ce..000000000
--- a/toolkit/forgetaboutsite/test/browser/browser_clearplugindata.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<!--
- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/
--->
-<html>
- <head>
- <title>Plugin Clear Site Data clear by domain test</title>
-
- <embed id="plugin1" type="application/x-test" width="200" height="200"></embed>
-
- <script type="application/javascript">
- function testSteps()
- {
- var p = document.getElementById("plugin1");
-
- p.setSitesWithData(
- "foo.com:0:0," +
- "bar.foo.com:0:0," +
- "baz.foo.com:0:0," +
- "bar.com:1:0," +
- "[192.168.1.1]:0:0," +
- "localhost:0:0"
- );
- }
- </script>
- </head>
-
- <body></body>
-
-</html>
diff --git a/toolkit/forgetaboutsite/test/browser/browser_clearplugindata.js b/toolkit/forgetaboutsite/test/browser/browser_clearplugindata.js
deleted file mode 100644
index ca0d394c3..000000000
--- a/toolkit/forgetaboutsite/test/browser/browser_clearplugindata.js
+++ /dev/null
@@ -1,86 +0,0 @@
-/**
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-Components.utils.import("resource://gre/modules/ForgetAboutSite.jsm");
-
-// Test clearing plugin data by domain using ForgetAboutSite.
-const testURL = "http://mochi.test:8888/browser/toolkit/forgetaboutsite/test/browser/browser_clearplugindata.html";
-
-const pluginHostIface = Ci.nsIPluginHost;
-var pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
-pluginHost.QueryInterface(pluginHostIface);
-
-var pluginTag;
-
-function stored(needles) {
- var something = pluginHost.siteHasData(this.pluginTag, null);
- if (!needles)
- return something;
-
- if (!something)
- return false;
-
- for (var i = 0; i < needles.length; ++i) {
- if (!pluginHost.siteHasData(this.pluginTag, needles[i]))
- return false;
- }
- return true;
-}
-
-function setTestPluginEnabledState(newEnabledState, plugin) {
- var oldEnabledState = plugin.enabledState;
- plugin.enabledState = newEnabledState;
- SimpleTest.registerCleanupFunction(function() {
- plugin.enabledState = oldEnabledState;
- });
-}
-
-add_task(function* () {
- var tags = pluginHost.getPluginTags();
-
- // Find the test plugin
- for (var i = 0; i < tags.length; i++)
- {
- if (tags[i].name == "Test Plug-in")
- {
- pluginTag = tags[i];
- }
- }
- if (!pluginTag) {
- ok(false, "Test Plug-in not available, can't run test");
- return;
- }
- setTestPluginEnabledState(Ci.nsIPluginTag.STATE_ENABLED, pluginTag);
- yield BrowserTestUtils.openNewForegroundTab(gBrowser, testURL);
-
- // Set data for the plugin after the page load.
- yield ContentTask.spawn(gBrowser.selectedBrowser, null, function*() {
- content.wrappedJSObject.testSteps();
- });
-
- ok(stored(["192.168.1.1", "foo.com", "nonexistent.foo.com", "bar.com", "localhost"]),
- "Data stored for sites");
-
- // Clear data for "foo.com" and its subdomains.
- yield ForgetAboutSite.removeDataFromDomain("foo.com");
-
- ok(stored(["bar.com", "192.168.1.1", "localhost"]), "Data stored for sites");
- ok(!stored(["foo.com"]), "Data cleared for foo.com");
- ok(!stored(["bar.foo.com"]), "Data cleared for subdomains of foo.com");
-
- // Clear data for "bar.com" using a subdomain.
- yield ForgetAboutSite.removeDataFromDomain("foo.bar.com");
- ok(!stored(["bar.com"]), "Data cleared for bar.com");
-
- // Clear data for "192.168.1.1".
- yield ForgetAboutSite.removeDataFromDomain("192.168.1.1");
- ok(!stored(["192.168.1.1"]), "Data cleared for 192.168.1.1");
-
- // Clear data for "localhost".
- yield ForgetAboutSite.removeDataFromDomain("localhost");
- ok(!stored(null), "All data cleared");
-
- gBrowser.removeCurrentTab();
-});
diff --git a/toolkit/forgetaboutsite/test/unit/.eslintrc.js b/toolkit/forgetaboutsite/test/unit/.eslintrc.js
deleted file mode 100644
index fee088c17..000000000
--- a/toolkit/forgetaboutsite/test/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/forgetaboutsite/test/unit/head_forgetaboutsite.js b/toolkit/forgetaboutsite/test/unit/head_forgetaboutsite.js
deleted file mode 100644
index d3828d5d8..000000000
--- a/toolkit/forgetaboutsite/test/unit/head_forgetaboutsite.js
+++ /dev/null
@@ -1,31 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-
-var dirSvc = Cc["@mozilla.org/file/directory_service;1"].getService(Ci.nsIProperties);
-var profileDir = do_get_profile();
-
-/**
- * Removes any files that could make our tests fail.
- */
-function cleanUp()
-{
- let files = [
- "places.sqlite",
- "cookies.sqlite",
- "signons.sqlite",
- "permissions.sqlite"
- ];
-
- for (let i = 0; i < files.length; i++) {
- let file = dirSvc.get("ProfD", Ci.nsIFile);
- file.append(files[i]);
- if (file.exists())
- file.remove(false);
- }
-}
-cleanUp();
diff --git a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js b/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
deleted file mode 100644
index d2db95e6a..000000000
--- a/toolkit/forgetaboutsite/test/unit/test_removeDataFromDomain.js
+++ /dev/null
@@ -1,647 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
- * vim: sw=2 ts=2 sts=2
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test added with bug 460086 to test the behavior of the new API that was added
- * to remove all traces of visiting a site.
- */
-
-// Globals
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/PlacesUtils.jsm");
-Cu.import("resource://gre/modules/ForgetAboutSite.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
- "resource://testing-common/PlacesTestUtils.jsm");
-
-const COOKIE_EXPIRY = Math.round(Date.now() / 1000) + 60;
-const COOKIE_NAME = "testcookie";
-const COOKIE_PATH = "/";
-
-const LOGIN_USERNAME = "username";
-const LOGIN_PASSWORD = "password";
-const LOGIN_USERNAME_FIELD = "username_field";
-const LOGIN_PASSWORD_FIELD = "password_field";
-
-const PERMISSION_TYPE = "test-perm";
-const PERMISSION_VALUE = Ci.nsIPermissionManager.ALLOW_ACTION;
-
-const PREFERENCE_NAME = "test-pref";
-
-// Utility Functions
-
-/**
- * Creates an nsIURI object for the given string representation of a URI.
- *
- * @param aURIString
- * The spec of the URI to create.
- * @returns an nsIURI representing aURIString.
- */
-function uri(aURIString)
-{
- return Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService).
- newURI(aURIString, null, null);
-}
-
-/**
- * Asynchronously check a url is visited.
- *
- * @param aURI
- * The URI.
- *
- * @return {Promise}
- * @resolves When the check has been added successfully.
- * @rejects JavaScript exception.
- */
-function promiseIsURIVisited(aURI)
-{
- let deferred = Promise.defer();
- PlacesUtils.asyncHistory.isURIVisited(aURI, function(unused, aIsVisited) {
- deferred.resolve(aIsVisited);
- });
-
- return deferred.promise;
-}
-
-/**
- * Add a cookie to the cookie service.
- *
- * @param aDomain
- */
-function add_cookie(aDomain)
-{
- check_cookie_exists(aDomain, false);
- let cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
- cm.add(aDomain, COOKIE_PATH, COOKIE_NAME, "", false, false, false,
- COOKIE_EXPIRY, {});
- check_cookie_exists(aDomain, true);
-}
-
-/**
- * Checks to ensure that a cookie exists or not for a domain.
- *
- * @param aDomain
- * The domain to check for the cookie.
- * @param aExists
- * True if the cookie should exist, false otherwise.
- */
-function check_cookie_exists(aDomain, aExists)
-{
- let cm = Cc["@mozilla.org/cookiemanager;1"].getService(Ci.nsICookieManager2);
- let cookie = {
- host: aDomain,
- name: COOKIE_NAME,
- path: COOKIE_PATH
- }
- let checker = aExists ? do_check_true : do_check_false;
- checker(cm.cookieExists(cookie));
-}
-
-/**
- * Adds a disabled host to the login manager.
- *
- * @param aHost
- * The host to add to the list of disabled hosts.
- */
-function add_disabled_host(aHost)
-{
- check_disabled_host(aHost, false);
- let lm = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
- lm.setLoginSavingEnabled(aHost, false);
- check_disabled_host(aHost, true);
-}
-
-/**
- * Checks to see if a host is disabled for storing logins or not.
- *
- * @param aHost
- * The host to check if it is disabled.
- * @param aIsDisabled
- * True if the host should be disabled, false otherwise.
- */
-function check_disabled_host(aHost, aIsDisabled)
-{
- let lm = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
- let checker = aIsDisabled ? do_check_false : do_check_true;
- checker(lm.getLoginSavingEnabled(aHost));
-}
-
-/**
- * Adds a login for the specified host to the login manager.
- *
- * @param aHost
- * The host to add the login for.
- */
-function add_login(aHost)
-{
- check_login_exists(aHost, false);
- let login = Cc["@mozilla.org/login-manager/loginInfo;1"].
- createInstance(Ci.nsILoginInfo);
- login.init(aHost, "", null, LOGIN_USERNAME, LOGIN_PASSWORD,
- LOGIN_USERNAME_FIELD, LOGIN_PASSWORD_FIELD);
- let lm = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
- lm.addLogin(login);
- check_login_exists(aHost, true);
-}
-
-/**
- * Checks to see if a login exists for a host.
- *
- * @param aHost
- * The host to check for the test login.
- * @param aExists
- * True if the login should exist, false otherwise.
- */
-function check_login_exists(aHost, aExists)
-{
- let lm = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
- let count = { value: 0 };
- lm.findLogins(count, aHost, "", null);
- do_check_eq(count.value, aExists ? 1 : 0);
-}
-
-/**
- * Adds a permission for the specified URI to the permission manager.
- *
- * @param aURI
- * The URI to add the test permission for.
- */
-function add_permission(aURI)
-{
- check_permission_exists(aURI, false);
- let pm = Cc["@mozilla.org/permissionmanager;1"].
- getService(Ci.nsIPermissionManager);
- let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
- .getService(Ci.nsIScriptSecurityManager);
- let principal = ssm.createCodebasePrincipal(aURI, {});
-
- pm.addFromPrincipal(principal, PERMISSION_TYPE, PERMISSION_VALUE);
- check_permission_exists(aURI, true);
-}
-
-/**
- * Checks to see if a permission exists for the given URI.
- *
- * @param aURI
- * The URI to check if a permission exists.
- * @param aExists
- * True if the permission should exist, false otherwise.
- */
-function check_permission_exists(aURI, aExists)
-{
- let pm = Cc["@mozilla.org/permissionmanager;1"].
- getService(Ci.nsIPermissionManager);
- let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
- .getService(Ci.nsIScriptSecurityManager);
- let principal = ssm.createCodebasePrincipal(aURI, {});
-
- let perm = pm.testExactPermissionFromPrincipal(principal, PERMISSION_TYPE);
- let checker = aExists ? do_check_eq : do_check_neq;
- checker(perm, PERMISSION_VALUE);
-}
-
-/**
- * Adds a content preference for the specified URI.
- *
- * @param aURI
- * The URI to add a preference for.
- */
-function add_preference(aURI)
-{
- let deferred = Promise.defer();
- let cp = Cc["@mozilla.org/content-pref/service;1"].
- getService(Ci.nsIContentPrefService2);
- cp.set(aURI.spec, PREFERENCE_NAME, "foo", null, {
- handleCompletion: () => deferred.resolve()
- });
- return deferred.promise;
-}
-
-/**
- * Checks to see if a content preference exists for the given URI.
- *
- * @param aURI
- * The URI to check if a preference exists.
- */
-function preference_exists(aURI)
-{
- let deferred = Promise.defer();
- let cp = Cc["@mozilla.org/content-pref/service;1"].
- getService(Ci.nsIContentPrefService2);
- let exists = false;
- cp.getByDomainAndName(aURI.spec, PREFERENCE_NAME, null, {
- handleResult: () => exists = true,
- handleCompletion: () => deferred.resolve(exists)
- });
- return deferred.promise;
-}
-
-// Test Functions
-
-// History
-function* test_history_cleared_with_direct_match()
-{
- const TEST_URI = uri("http://mozilla.org/foo");
- do_check_false(yield promiseIsURIVisited(TEST_URI));
- yield PlacesTestUtils.addVisits(TEST_URI);
- do_check_true(yield promiseIsURIVisited(TEST_URI));
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- do_check_false(yield promiseIsURIVisited(TEST_URI));
-}
-
-function* test_history_cleared_with_subdomain()
-{
- const TEST_URI = uri("http://www.mozilla.org/foo");
- do_check_false(yield promiseIsURIVisited(TEST_URI));
- yield PlacesTestUtils.addVisits(TEST_URI);
- do_check_true(yield promiseIsURIVisited(TEST_URI));
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- do_check_false(yield promiseIsURIVisited(TEST_URI));
-}
-
-function* test_history_not_cleared_with_uri_contains_domain()
-{
- const TEST_URI = uri("http://ilovemozilla.org/foo");
- do_check_false(yield promiseIsURIVisited(TEST_URI));
- yield PlacesTestUtils.addVisits(TEST_URI);
- do_check_true(yield promiseIsURIVisited(TEST_URI));
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- do_check_true(yield promiseIsURIVisited(TEST_URI));
-
- // Clear history since we left something there from this test.
- yield PlacesTestUtils.clearHistory();
-}
-
-// Cookie Service
-function* test_cookie_cleared_with_direct_match()
-{
- const TEST_DOMAIN = "mozilla.org";
- add_cookie(TEST_DOMAIN);
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- check_cookie_exists(TEST_DOMAIN, false);
-}
-
-function* test_cookie_cleared_with_subdomain()
-{
- const TEST_DOMAIN = "www.mozilla.org";
- add_cookie(TEST_DOMAIN);
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- check_cookie_exists(TEST_DOMAIN, false);
-}
-
-function* test_cookie_not_cleared_with_uri_contains_domain()
-{
- const TEST_DOMAIN = "ilovemozilla.org";
- add_cookie(TEST_DOMAIN);
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- check_cookie_exists(TEST_DOMAIN, true);
-}
-
-// Login Manager
-function* test_login_manager_disabled_hosts_cleared_with_direct_match()
-{
- const TEST_HOST = "http://mozilla.org";
- add_disabled_host(TEST_HOST);
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- check_disabled_host(TEST_HOST, false);
-}
-
-function* test_login_manager_disabled_hosts_cleared_with_subdomain()
-{
- const TEST_HOST = "http://www.mozilla.org";
- add_disabled_host(TEST_HOST);
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- check_disabled_host(TEST_HOST, false);
-}
-
-function* test_login_manager_disabled_hosts_not_cleared_with_uri_contains_domain()
-{
- const TEST_HOST = "http://ilovemozilla.org";
- add_disabled_host(TEST_HOST);
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- check_disabled_host(TEST_HOST, true);
-
- // Reset state
- let lm = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
- lm.setLoginSavingEnabled(TEST_HOST, true);
- check_disabled_host(TEST_HOST, false);
-}
-
-function* test_login_manager_logins_cleared_with_direct_match()
-{
- const TEST_HOST = "http://mozilla.org";
- add_login(TEST_HOST);
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- check_login_exists(TEST_HOST, false);
-}
-
-function* test_login_manager_logins_cleared_with_subdomain()
-{
- const TEST_HOST = "http://www.mozilla.org";
- add_login(TEST_HOST);
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- check_login_exists(TEST_HOST, false);
-}
-
-function* test_login_manager_logins_not_cleared_with_uri_contains_domain()
-{
- const TEST_HOST = "http://ilovemozilla.org";
- add_login(TEST_HOST);
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- check_login_exists(TEST_HOST, true);
-
- let lm = Cc["@mozilla.org/login-manager;1"].
- getService(Ci.nsILoginManager);
- lm.removeAllLogins();
- check_login_exists(TEST_HOST, false);
-}
-
-// Permission Manager
-function* test_permission_manager_cleared_with_direct_match()
-{
- const TEST_URI = uri("http://mozilla.org");
- add_permission(TEST_URI);
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- check_permission_exists(TEST_URI, false);
-}
-
-function* test_permission_manager_cleared_with_subdomain()
-{
- const TEST_URI = uri("http://www.mozilla.org");
- add_permission(TEST_URI);
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- check_permission_exists(TEST_URI, false);
-}
-
-function* test_permission_manager_not_cleared_with_uri_contains_domain()
-{
- const TEST_URI = uri("http://ilovemozilla.org");
- add_permission(TEST_URI);
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- check_permission_exists(TEST_URI, true);
-
- // Reset state
- let pm = Cc["@mozilla.org/permissionmanager;1"].
- getService(Ci.nsIPermissionManager);
- pm.removeAll();
- check_permission_exists(TEST_URI, false);
-}
-
-function waitForPurgeNotification() {
- let deferred = Promise.defer();
-
- let observer = {
- observe: function(aSubject, aTopic, aData)
- {
- Services.obs.removeObserver(observer, "browser:purge-domain-data");
- // test_storage_cleared needs this extra executeSoon because
- // the DOMStorage clean-up is also listening to this same observer
- // which is run synchronously.
- Services.tm.mainThread.dispatch(function() {
- deferred.resolve();
- }, Components.interfaces.nsIThread.DISPATCH_NORMAL);
- }
- };
- Services.obs.addObserver(observer, "browser:purge-domain-data", false);
-
- return deferred.promise;
-}
-
-// Content Preferences
-function* test_content_preferences_cleared_with_direct_match()
-{
- const TEST_URI = uri("http://mozilla.org");
- do_check_false(yield preference_exists(TEST_URI));
- yield add_preference(TEST_URI);
- do_check_true(yield preference_exists(TEST_URI));
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- yield waitForPurgeNotification();
- do_check_false(yield preference_exists(TEST_URI));
-}
-
-function* test_content_preferences_cleared_with_subdomain()
-{
- const TEST_URI = uri("http://www.mozilla.org");
- do_check_false(yield preference_exists(TEST_URI));
- yield add_preference(TEST_URI);
- do_check_true(yield preference_exists(TEST_URI));
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- yield waitForPurgeNotification();
- do_check_false(yield preference_exists(TEST_URI));
-}
-
-function* test_content_preferences_not_cleared_with_uri_contains_domain()
-{
- const TEST_URI = uri("http://ilovemozilla.org");
- do_check_false(yield preference_exists(TEST_URI));
- yield add_preference(TEST_URI);
- do_check_true(yield preference_exists(TEST_URI));
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- yield waitForPurgeNotification();
- do_check_true(yield preference_exists(TEST_URI));
-
- // Reset state
- yield ForgetAboutSite.removeDataFromDomain("ilovemozilla.org");
- yield waitForPurgeNotification();
- do_check_false(yield preference_exists(TEST_URI));
-}
-
-function push_registration_exists(aURL, ps)
-{
- return new Promise(resolve => {
- let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
- .getService(Ci.nsIScriptSecurityManager);
- let principal = ssm.createCodebasePrincipalFromOrigin(aURL);
- return ps.getSubscription(aURL, principal, (status, record) => {
- if (!Components.isSuccessCode(status)) {
- resolve(false);
- } else {
- resolve(!!record);
- }
- });
- });
-}
-
-// Push
-function* test_push_cleared()
-{
- let ps;
- try {
- ps = Cc["@mozilla.org/push/Service;1"].
- getService(Ci.nsIPushService);
- } catch (e) {
- // No push service, skip test.
- return;
- }
-
- do_get_profile();
- setPrefs();
- const {PushDB, PushService, PushServiceWebSocket} = serviceExports;
- const userAgentID = 'bd744428-f125-436a-b6d0-dd0c9845837f';
- const channelID = '0ef2ad4a-6c49-41ad-af6e-95d2425276bf';
-
- let db = PushServiceWebSocket.newPushDB();
-
- try {
- PushService.init({
- serverURI: "wss://push.example.org/",
- db,
- makeWebSocket(uriObj) {
- return new MockWebSocket(uriObj, {
- onHello(request) {
- this.serverSendMsg(JSON.stringify({
- messageType: 'hello',
- status: 200,
- uaid: userAgentID,
- }));
- },
- });
- }
- });
-
- const TEST_URL = "https://www.mozilla.org/scope/";
- do_check_false(yield push_registration_exists(TEST_URL, ps));
- yield db.put({
- channelID,
- pushEndpoint: 'https://example.org/update/clear-success',
- scope: TEST_URL,
- version: 1,
- originAttributes: '',
- quota: Infinity,
- });
- do_check_true(yield push_registration_exists(TEST_URL, ps));
-
- let promisePurgeNotification = waitForPurgeNotification();
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- yield promisePurgeNotification;
-
- do_check_false(yield push_registration_exists(TEST_URL, ps));
- } finally {
- yield PushService._shutdownService();
- }
-}
-
-// Cache
-function* test_cache_cleared()
-{
- // Because this test is asynchronous, it should be the last test
- do_check_true(tests[tests.length - 1] == arguments.callee);
-
- // NOTE: We could be more extensive with this test and actually add an entry
- // to the cache, and then make sure it is gone. However, we trust that
- // the API is well tested, and that when we get the observer
- // notification, we have actually cleared the cache.
- // This seems to happen asynchronously...
- let os = Cc["@mozilla.org/observer-service;1"].
- getService(Ci.nsIObserverService);
- let observer = {
- observe: function(aSubject, aTopic, aData)
- {
- os.removeObserver(observer, "cacheservice:empty-cache");
- // Shutdown the download manager.
- Services.obs.notifyObservers(null, "quit-application", null);
- do_test_finished();
- }
- };
- os.addObserver(observer, "cacheservice:empty-cache", false);
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- do_test_pending();
-}
-
-function* test_storage_cleared()
-{
- function getStorageForURI(aURI)
- {
- let ssm = Cc["@mozilla.org/scriptsecuritymanager;1"]
- .getService(Ci.nsIScriptSecurityManager);
- let principal = ssm.createCodebasePrincipal(aURI, {});
-
- let dsm = Cc["@mozilla.org/dom/localStorage-manager;1"].
- getService(Ci.nsIDOMStorageManager);
- return dsm.createStorage(null, principal, "");
- }
-
- let s = [
- getStorageForURI(uri("http://mozilla.org")),
- getStorageForURI(uri("http://my.mozilla.org")),
- getStorageForURI(uri("http://ilovemozilla.org")),
- ];
-
- for (let i = 0; i < s.length; ++i) {
- let storage = s[i];
- storage.setItem("test", "value" + i);
- do_check_eq(storage.length, 1);
- do_check_eq(storage.key(0), "test");
- do_check_eq(storage.getItem("test"), "value" + i);
- }
-
- yield ForgetAboutSite.removeDataFromDomain("mozilla.org");
- yield waitForPurgeNotification();
-
- do_check_eq(s[0].getItem("test"), null);
- do_check_eq(s[0].length, 0);
- do_check_eq(s[1].getItem("test"), null);
- do_check_eq(s[1].length, 0);
- do_check_eq(s[2].getItem("test"), "value2");
- do_check_eq(s[2].length, 1);
-}
-
-var tests = [
- // History
- test_history_cleared_with_direct_match,
- test_history_cleared_with_subdomain,
- test_history_not_cleared_with_uri_contains_domain,
-
- // Cookie Service
- test_cookie_cleared_with_direct_match,
- test_cookie_cleared_with_subdomain,
- test_cookie_not_cleared_with_uri_contains_domain,
-
- // Login Manager
- test_login_manager_disabled_hosts_cleared_with_direct_match,
- test_login_manager_disabled_hosts_cleared_with_subdomain,
- test_login_manager_disabled_hosts_not_cleared_with_uri_contains_domain,
- test_login_manager_logins_cleared_with_direct_match,
- test_login_manager_logins_cleared_with_subdomain,
- test_login_manager_logins_not_cleared_with_uri_contains_domain,
-
- // Permission Manager
- test_permission_manager_cleared_with_direct_match,
- test_permission_manager_cleared_with_subdomain,
- test_permission_manager_not_cleared_with_uri_contains_domain,
-
- // Content Preferences
- test_content_preferences_cleared_with_direct_match,
- test_content_preferences_cleared_with_subdomain,
- test_content_preferences_not_cleared_with_uri_contains_domain,
-
- // Push
- test_push_cleared,
-
- // Storage
- test_storage_cleared,
-
- // Cache
- test_cache_cleared,
-];
-
-function run_test()
-{
- for (let i = 0; i < tests.length; i++)
- add_task(tests[i]);
-
- run_next_test();
-}
diff --git a/toolkit/forgetaboutsite/test/unit/xpcshell.ini b/toolkit/forgetaboutsite/test/unit/xpcshell.ini
deleted file mode 100644
index a18fa718a..000000000
--- a/toolkit/forgetaboutsite/test/unit/xpcshell.ini
+++ /dev/null
@@ -1,8 +0,0 @@
-[DEFAULT]
-head = head_forgetaboutsite.js ../../../../dom/push/test/xpcshell/head.js
-tail =
-skip-if = toolkit == 'android'
-support-files =
- !/dom/push/test/xpcshell/head.js
-
-[test_removeDataFromDomain.js]
diff --git a/toolkit/identity/moz.build b/toolkit/identity/moz.build
index ba9697bd6..fd2ba9c8c 100644
--- a/toolkit/identity/moz.build
+++ b/toolkit/identity/moz.build
@@ -4,18 +4,11 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-MOCHITEST_CHROME_MANIFESTS += ['tests/chrome/chrome.ini']
-XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
-
-XPIDL_SOURCES += [
- 'nsIIdentityCryptoService.idl',
-]
+XPIDL_SOURCES += ['nsIIdentityCryptoService.idl']
XPIDL_MODULE = 'identity'
-SOURCES += [
- 'IdentityCryptoService.cpp',
-]
+SOURCES += ['IdentityCryptoService.cpp']
EXTRA_JS_MODULES.identity += [
'Identity.jsm',
diff --git a/toolkit/identity/tests/chrome/.eslintrc.js b/toolkit/identity/tests/chrome/.eslintrc.js
deleted file mode 100644
index 2c669d844..000000000
--- a/toolkit/identity/tests/chrome/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/identity/tests/chrome/chrome.ini b/toolkit/identity/tests/chrome/chrome.ini
deleted file mode 100644
index ffaff0fb1..000000000
--- a/toolkit/identity/tests/chrome/chrome.ini
+++ /dev/null
@@ -1,13 +0,0 @@
-[DEFAULT]
-skip-if = buildapp == 'b2g' || os == 'android'
-support-files =
- sandbox_content.html
- sandbox_content.sjs
- sandbox_content_alert.html
- sandbox_content_framed.html
- sandbox_content_perms.html
- sandbox_content_popup.html
- sandbox_content_redirect.html
- sandbox_content_redirect.html^headers^
-
-[test_sandbox.xul]
diff --git a/toolkit/identity/tests/chrome/sandbox_content.html b/toolkit/identity/tests/chrome/sandbox_content.html
deleted file mode 100644
index 9a9b63ac2..000000000
--- a/toolkit/identity/tests/chrome/sandbox_content.html
+++ /dev/null
@@ -1,32 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
-<meta charset="utf-8">
-<title>Page testing blocked content in the Sandbox</title>
-
-<link rel="stylesheet" src="sandbox_content.sjs?text/css"/>
-
-<script src="sandbox_content.sjs?application/javascript"></script>
-
-</head>
-
-<body>
-
-<img src="sandbox_content.sjs?image/jpeg"/>
-
-<!-- media -->
-<video src="sandbox_content.sjs?video/webm" autoplay="true"></video>
-<audio src="sandbox_content.sjs?audio/ogg" autoplay="true"></audio>
-
-<!-- plugins -->
-<embed src="sandbox_content.sjs?application/x-test"/>
-<object data="sandbox_content.sjs?application/x-test"></object>
-<applet code="sandbox_content.sjs?application/x-java-applet"></applet>
-
-<iframe src="sandbox_content.sjs?text/html"></iframe>
-
-</body>
-
-</html>
diff --git a/toolkit/identity/tests/chrome/sandbox_content.sjs b/toolkit/identity/tests/chrome/sandbox_content.sjs
deleted file mode 100644
index 2f562f214..000000000
--- a/toolkit/identity/tests/chrome/sandbox_content.sjs
+++ /dev/null
@@ -1,36 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * * License, v. 2.0. If a copy of the MPL was not distributed with this
- * * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-function handleRequest(request, response) {
- response.setHeader("Cache-Control", "no-cache", false);
-
- let loadedStateKey = "sandbox_content_loaded";
- switch(request.queryString) {
- case "reset": {
- setState(loadedStateKey, "");
- response.write("reset");
- break;
- }
- case "get_loaded": {
- response.setHeader("Content-Type", "text/plain", false);
- let loaded = getState(loadedStateKey);
- if (loaded)
- response.write(loaded);
- else
- response.write("NOTHING");
- break;
- }
- default: {
- let contentType = decodeURIComponent(request.queryString);
- // set the Content-Type equal to the query string
- response.setHeader("Content-Type", contentType, false);
- // If any content is loaded, append it's content type in state
- let loaded = getState(loadedStateKey);
- if (loaded)
- loaded += ",";
- setState(loadedStateKey, loaded + contentType);
- break;
- }
- }
-}
diff --git a/toolkit/identity/tests/chrome/sandbox_content_alert.html b/toolkit/identity/tests/chrome/sandbox_content_alert.html
deleted file mode 100644
index f07308e84..000000000
--- a/toolkit/identity/tests/chrome/sandbox_content_alert.html
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
-<meta charset="utf-8">
-<title>Page creating an alert inside the Sandbox</title>
-
-<script>
-
-alert("The user shouldn't see this");
-
-</script>
-
-</head>
-
-<body>
-
-</body>
-</html>
diff --git a/toolkit/identity/tests/chrome/sandbox_content_framed.html b/toolkit/identity/tests/chrome/sandbox_content_framed.html
deleted file mode 100644
index 72b0c49d0..000000000
--- a/toolkit/identity/tests/chrome/sandbox_content_framed.html
+++ /dev/null
@@ -1,17 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
-<meta charset="utf-8">
-<title>Page testing blocked content in an iframe inside the Sandbox</title>
-
-</head>
-
-<body>
-
-<iframe src="sandbox_content.html"></iframe>
-
-</body>
-
-</html>
diff --git a/toolkit/identity/tests/chrome/sandbox_content_perms.html b/toolkit/identity/tests/chrome/sandbox_content_perms.html
deleted file mode 100644
index d24c683f8..000000000
--- a/toolkit/identity/tests/chrome/sandbox_content_perms.html
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE html>
-<html>
- <!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
- <head>
- <meta charset="utf-8">
- <title>Page testing content in the Sandbox can't escape</title>
- <script type="application/javascript;version=1.8">
- const TEST_BASE = "http://mochi.test:8888/chrome/toolkit/identity/tests/chrome/"
- const Ci = SpecialPowers.Ci;
-
- function expectException(aFunc) {
- try {
- aFunc();
- } catch (ex) {
- return true;
- }
- return false;
- }
-
- function CcNotPresent() {
- if (typeof Components === 'undefined')
- return true;
- // Components shim doesn't define Components.classes.
- try {
- return typeof Components.classes === 'undefined';
- } catch (e) {
- return false;
- }
- }
-
- // Build an object with test results (true = pass)
- let results = {
- windowTop: window.top == window,
-
- qiWindow: expectException(function() {
- let isForced = window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils)
- .docCharsetIsForced;
- }),
-
- ccAccess: !!CcNotPresent(),
- };
-
- let resultsJSON = JSON.stringify(results);
-
- // Send the results to the mochitest server so the test file can retrieve them.
- let stateURL = TEST_BASE + "sandbox_content.sjs"
- let xhr = new XMLHttpRequest();
- xhr.open("GET", stateURL + "?" + encodeURIComponent(resultsJSON), true);
- xhr.onload = function() {
- if (xhr.status != 200) {
- dump("Failed sending results\n");
- }
- };
- xhr.send();
-
- </script>
- </head>
-
- <body>
-
- </body>
-</html>
diff --git a/toolkit/identity/tests/chrome/sandbox_content_popup.html b/toolkit/identity/tests/chrome/sandbox_content_popup.html
deleted file mode 100644
index cb21f706f..000000000
--- a/toolkit/identity/tests/chrome/sandbox_content_popup.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE html>
-<html>
-<!-- Any copyright is dedicated to the Public Domain.
- - http://creativecommons.org/publicdomain/zero/1.0/ -->
-<head>
-<meta charset="utf-8">
-<title>Page creating an popup inside the Sandbox</title>
-
-<script>
-
-var strWindowFeatures = "menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes";
-
-var uri = "data:text/html,";
-uri += encodeURI("<body onload='setTimeout(window.close, 1000)'>");
-
-var win = window.open(uri, "sandbox_popup", strWindowFeatures);
-
-</script>
-
-</head>
-
-<body>
-
-</body>
-</html>
diff --git a/toolkit/identity/tests/chrome/sandbox_content_redirect.html b/toolkit/identity/tests/chrome/sandbox_content_redirect.html
deleted file mode 100644
index 7570ffad8..000000000
--- a/toolkit/identity/tests/chrome/sandbox_content_redirect.html
+++ /dev/null
@@ -1,2 +0,0 @@
-<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
diff --git a/toolkit/identity/tests/chrome/sandbox_content_redirect.html^headers^ b/toolkit/identity/tests/chrome/sandbox_content_redirect.html^headers^
deleted file mode 100644
index 7c06340b9..000000000
--- a/toolkit/identity/tests/chrome/sandbox_content_redirect.html^headers^
+++ /dev/null
@@ -1,2 +0,0 @@
-HTTP 302 Found
-Location: http://mochi.test:8888/chrome/toolkit/identity/tests/chrome/sandbox_content.html
diff --git a/toolkit/identity/tests/chrome/test_sandbox.xul b/toolkit/identity/tests/chrome/test_sandbox.xul
deleted file mode 100644
index 2b353c53b..000000000
--- a/toolkit/identity/tests/chrome/test_sandbox.xul
+++ /dev/null
@@ -1,324 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet type="text/css" href="/tests/SimpleTest/test.css"?>
-<!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=762993
--->
-<window title="Mozilla Bug 762993"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="run_next_test();">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=762993"
- target="_blank">Mozilla Bug 762993</a>
- </body>
-
- <!-- test code goes here -->
- <script type="application/javascript;version=1.8">
- <![CDATA[
-
- /** Test for Bug 762993 **/
-
-"use strict";
-
-SimpleTest.expectAssertions(1);
-
-SimpleTest.waitForExplicitFinish();
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-
-const secMan = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager);
-
-const TEST_URL_1 = "https://example.com/";
-// No trailing slash plus port to test normalization
-const TEST_URL_2 = "https://example.com:443";
-
-const TEST_BASE = "http://mochi.test:8888/chrome/toolkit/identity/tests/chrome/"
-const STATE_URL = TEST_BASE + "sandbox_content.sjs"
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-Services.prefs.setBoolPref("toolkit.identity.debug", true);
-
-XPCOMUtils.defineLazyModuleGetter(this, "Sandbox",
- "resource://gre/modules/identity/Sandbox.jsm");
-
-function check_sandbox(aSandbox, aURL) {
- ok(aSandbox.id > 0, "valid ID");
- is(aSandbox._url, aURL, "matching URL (with normalization)");
- isnot(aSandbox._frame, null, "frame");
- isnot(aSandbox._container, null, "container");
- let docPrincipal = aSandbox._frame.contentDocument.nodePrincipal;
- is(secMan.isSystemPrincipal(docPrincipal), false,
- "principal must not be system");
-}
-
-/**
- * Free the sandbox and make sure all properties that are not booleans,
- * functions or numbers were freed.
- */
-function free_and_check_sandbox(aSandbox) {
- SimpleTest.executeSoon(function() {
- aSandbox.free();
-
- for(let prop in aSandbox) {
- // Don't trigger the "id" getter when the frame is supposed to be freed already
- if (prop == "id")
- continue;
- let propType = typeof(aSandbox[prop]);
- if (propType == "boolean" || propType == "function" || propType == "number")
- continue;
- is(aSandbox[prop], null, "freed " + prop);
- }
- run_next_test();
- });
-}
-
-function reset_server_state() {
- // Now reset the server state
- let resetReq = new XMLHttpRequest();
- resetReq.open("GET", STATE_URL + "?reset", false);
- resetReq.send();
-}
-
-function test_creation() {
- new Sandbox(TEST_URL_1, function sandboxCB(aSandbox) {
- check_sandbox(aSandbox, TEST_URL_1);
- free_and_check_sandbox(aSandbox);
- });
-}
-
-function test_reload() {
- new Sandbox(TEST_URL_1, function sandboxCB(aSandbox) {
- check_sandbox(aSandbox, TEST_URL_1);
- let originalId = aSandbox.id;
-
- aSandbox.reload(function sandboxReloadCB(aSandbox) {
- check_sandbox(aSandbox, TEST_URL_1);
- is(aSandbox.id, originalId, "Sandbox ID should be the same after reload");
- free_and_check_sandbox(aSandbox);
- });
- });
-}
-
-function test_url_normalization() {
- new Sandbox(TEST_URL_2, function sandboxCB(aSandbox) {
- // TEST_URL_2 should be normalized into the form of TEST_URL_1
- check_sandbox(aSandbox, TEST_URL_1);
- free_and_check_sandbox(aSandbox);
- });
-}
-
-/**
- * Check with the server's state to see what content was loaded then reset it.
- */
-function check_loaded_content(aSandbox, aNothingShouldLoad, aCallback) {
-
- let xhr = new XMLHttpRequest();
- xhr.open("GET", STATE_URL + "?get_loaded", true);
- xhr.onload = function() {
- let res = xhr.responseText;
- is(xhr.status, 200, "Check successful response");
-
- if (aNothingShouldLoad) {
- is(res, "NOTHING", "Check that nothing was loaded on the server");
- } else {
- let allowedTypes = [ "application/javascript", "text/html", "application/x-test" ];
- let loadedTypes = res == "NOTHING" ? [] : res.split(",");
-
- for (let loadedType of loadedTypes) {
- isnot(allowedTypes.indexOf(loadedType), -1, "Check that " + loadedType + " was expected to load"); // TODO
- }
-
- isnot(loadedTypes.indexOf("application/javascript"), -1, "Check JS was loaded");
- isnot(loadedTypes.indexOf("text/html"), -1, "Check iframe was loaded");
- is(loadedTypes.indexOf("video/webm"), -1, "Check webm was not loaded");
- is(loadedTypes.indexOf("audio/ogg"), -1, "Check ogg was not loaded");
-
- // Check that no plugin tags have a type other than TYPE_NULL (failed load)
- // --
- // Checking if a channel was opened is not sufficient for plugin tags --
- // An object tag may still be allowed to load a sub-document, but not a
- // plugin, so it will open a channel but then abort when it gets a
- // plugin-type.
- let doc = aSandbox._frame.contentDocument;
- let nullType = Components.interfaces.nsIObjectLoadingContent.TYPE_NULL;
- for (let tag of doc.querySelectorAll("embed, object, applet")) {
- tag instanceof Components.interfaces.nsIObjectLoadingContent;
- is(tag.displayedType, nullType, "Check that plugin did not load content");
- }
- }
-
- reset_server_state();
-
- aCallback();
- };
- xhr.send();
-}
-
-/**
- * Helper to check that only certain content is loaded on creation and during reload.
- */
-function check_disabled_content(aSandboxURL, aNothingShouldLoad = false) {
- new Sandbox(aSandboxURL, function sandboxCB(aSandbox) {
- check_sandbox(aSandbox, aSandboxURL);
- let originalId = aSandbox.id;
-
- setTimeout(function() {
- check_loaded_content(aSandbox, aNothingShouldLoad, function checkFinished() {
-
- info("reload the sandbox content");
- aSandbox.reload(function sandboxReloadCB(aSandbox) {
- check_sandbox(aSandbox, aSandboxURL);
- is(aSandbox.id, originalId, "Sandbox ID should be the same after reload");
-
- setTimeout(function() {
- check_loaded_content(aSandbox, aNothingShouldLoad, function reloadCheckFinished() {
- free_and_check_sandbox(aSandbox);
- });
- }, 5000);
- });
- });
- }, 5000);
- });
-}
-
-function test_disabled_content() {
- let url = TEST_BASE + "sandbox_content.html";
- check_disabled_content(url);
-}
-
-// Same as test above but with content in an iframe.
-function test_disabled_content_framed() {
- let url = TEST_BASE + "sandbox_content_framed.html";
- check_disabled_content(url);
-}
-
-function test_redirect() {
- let url = TEST_BASE + "sandbox_content_redirect.html";
- check_disabled_content(url);
-}
-
-function WindowObserver(aCallback) {
- this.observe = function(aSubject, aTopic, aData) {
- if (aTopic != "domwindowopened") {
- return;
- }
- Services.ww.unregisterNotification(this);
-
- let domWin = aSubject.QueryInterface(Ci.nsIDOMWindow);
- ok(!domWin, "No window should be opened");
- SimpleTest.executeSoon(function() {
- info("Closing opened window");
- domWin.close();
- aCallback();
- });
- }
-}
-
-// Can the sandbox call window.alert() or popup other UI?
-function test_alert() {
- let alertURL = TEST_BASE + "sandbox_content_alert.html";
-
- new Sandbox(alertURL, function sandboxCB(aSandbox) {
- check_sandbox(aSandbox, alertURL);
- setTimeout(function() {
-
- let win = Services.wm.getMostRecentWindow(null);
- isnot(win.document.documentElement.getAttribute("id"), "commonDialog",
- "Make sure most recent window is not a dialog");
- if (win.document.documentElement.getAttribute("id") == "commonDialog") {
- // If a dialog did open, close it so we don't interfere with future tests
- win.close()
- }
-
- free_and_check_sandbox(aSandbox);
- }, 1000);
- });
-}
-
-// Can the sandboxed page open a popup with window.open?
-function test_popup() {
- let alertURL = TEST_BASE + "sandbox_content_popup.html";
- let theSandbox;
- function continueTest() {
- // avoid double-free
- if (!theSandbox)
- return;
- free_and_check_sandbox(theSandbox);
- theSandbox = null;
- }
- let winObs = new WindowObserver(continueTest);
- Services.ww.registerNotification(winObs);
- new Sandbox(alertURL, function sandboxCB(aSandbox) {
- theSandbox = aSandbox;
- check_sandbox(aSandbox, alertURL);
- // Wait 5 seconds to see if the window is going to open.
- setTimeout(function() {
- Services.ww.unregisterNotification(winObs);
- continueTest();
- }, 5000);
- });
-}
-
-// Loading a page with a bad cert
-function test_bad_cert() {
- let url = TEST_BASE + "sandbox_content.sjs?text/html";
- url = url.replace("http://mochi.test:8888", "https://untrusted.example.com");
- check_disabled_content(url, /*nothingShouldLoad=*/true);
-}
-
-// Loading a page to check window.top and other permissions.
-function test_frame_perms() {
- let url = TEST_BASE + "sandbox_content_perms.html";
- new Sandbox(url, function sandboxCB(aSandbox) {
- check_sandbox(aSandbox, url);
-
- // Give the content time to load
- setTimeout(function() {
- let xhr = new XMLHttpRequest();
- xhr.open("GET", STATE_URL + "?get_loaded", true);
- xhr.responseType = "json";
- xhr.onload = function() {
- is(xhr.status, 200, "Check successful response");
- is(typeof(xhr.response), "object", "Check response is object");
- is(Object.keys(xhr.response).length, 3, "Check the number of perm. tests");
- for (let test in xhr.response) {
- ok(xhr.response[test], "Check result of " + test);
- }
-
- reset_server_state();
- free_and_check_sandbox(aSandbox);
- };
- xhr.send();
- }, 3000);
- });
-}
-
-let TESTS = [test_creation, test_reload, test_url_normalization];
-TESTS.push(test_disabled_content, test_disabled_content_framed);
-TESTS.push(test_alert, test_popup, test_bad_cert);
-TESTS.push(test_redirect, test_frame_perms);
-
-function run_next_test() {
- if (TESTS.length) {
- let test = TESTS.shift();
- info(test.name);
- test();
- } else {
- Services.prefs.clearUserPref("toolkit.identity.debug");
- SimpleTest.finish();
- }
-}
-
- ]]>
- </script>
-</window>
diff --git a/toolkit/identity/tests/unit/.eslintrc.js b/toolkit/identity/tests/unit/.eslintrc.js
deleted file mode 100644
index fee088c17..000000000
--- a/toolkit/identity/tests/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/identity/tests/unit/data/idp_1/.well-known/browserid b/toolkit/identity/tests/unit/data/idp_1/.well-known/browserid
deleted file mode 100644
index c7390457d..000000000
--- a/toolkit/identity/tests/unit/data/idp_1/.well-known/browserid
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "public-key": {"algorithm":"RS","n":"65718905405105134410187227495885391609221288015566078542117409373192106382993306537273677557482085204736975067567111831005921322991127165013340443563713385983456311886801211241492470711576322130577278575529202840052753612576061450560588102139907846854501252327551303482213505265853706269864950437458242988327","e":"65537"},
- "authentication": "/browserid/sign_in.html",
- "provisioning": "/browserid/provision.html"
-}
diff --git a/toolkit/identity/tests/unit/data/idp_invalid_1/.well-known/browserid b/toolkit/identity/tests/unit/data/idp_invalid_1/.well-known/browserid
deleted file mode 100644
index 6bcd9de91..000000000
--- a/toolkit/identity/tests/unit/data/idp_invalid_1/.well-known/browserid
+++ /dev/null
@@ -1,5 +0,0 @@
-{
- "public-key": {"algorithm":"RS","n":"65718905405105134410187227495885391609221288015566078542117409373192106382993306537273677557482085204736975067567111831005921322991127165013340443563713385983456311886801211241492470711576322130577278575529202840052753612576061450560588102139907846854501252327551303482213505265853706269864950437458242988327","e":"65537"},
- "authentication": "/browserid/sign_in.html",
- // missing "provisioning"
-}
diff --git a/toolkit/identity/tests/unit/head_identity.js b/toolkit/identity/tests/unit/head_identity.js
deleted file mode 100644
index c63261b95..000000000
--- a/toolkit/identity/tests/unit/head_identity.js
+++ /dev/null
@@ -1,248 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://testing-common/httpd.js");
-
-// XXX until bug 937114 is fixed
-Cu.importGlobalProperties(["atob"]);
-
-// The following boilerplate makes sure that XPCOM calls
-// that use the profile directory work.
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "jwcrypto",
- "resource://gre/modules/identity/jwcrypto.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "IDService",
- "resource://gre/modules/identity/Identity.jsm",
- "IdentityService");
-
-XPCOMUtils.defineLazyModuleGetter(this,
- "IdentityStore",
- "resource://gre/modules/identity/IdentityStore.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this,
- "Logger",
- "resource://gre/modules/identity/LogUtils.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this,
- "uuidGenerator",
- "@mozilla.org/uuid-generator;1",
- "nsIUUIDGenerator");
-
-const TEST_MESSAGE_MANAGER = "Mr McFeeley";
-const TEST_URL = "https://myfavoritebacon.com";
-const TEST_URL2 = "https://myfavoritebaconinacan.com";
-const TEST_USER = "user@mozilla.com";
-const TEST_PRIVKEY = "fake-privkey";
-const TEST_CERT = "fake-cert";
-const TEST_ASSERTION = "fake-assertion";
-const TEST_IDPPARAMS = {
- domain: "myfavoriteflan.com",
- authentication: "/foo/authenticate.html",
- provisioning: "/foo/provision.html"
-};
-
-// The following are utility functions for Identity testing
-
-function log(...aMessageArgs) {
- Logger.log.apply(Logger, ["test"].concat(aMessageArgs));
-}
-
-function get_idstore() {
- return IdentityStore;
-}
-
-function partial(fn) {
- let args = Array.prototype.slice.call(arguments, 1);
- return function() {
- return fn.apply(this, args.concat(Array.prototype.slice.call(arguments)));
- };
-}
-
-function uuid() {
- return uuidGenerator.generateUUID().toString();
-}
-
-function base64UrlDecode(s) {
- s = s.replace(/-/g, "+");
- s = s.replace(/_/g, "/");
-
- // Replace padding if it was stripped by the sender.
- // See http://tools.ietf.org/html/rfc4648#section-4
- switch (s.length % 4) {
- case 0:
- break; // No pad chars in this case
- case 2:
- s += "==";
- break; // Two pad chars
- case 3:
- s += "=";
- break; // One pad char
- default:
- throw new InputException("Illegal base64url string!");
- }
-
- // With correct padding restored, apply the standard base64 decoder
- return atob(s);
-}
-
-// create a mock "doc" object, which the Identity Service
-// uses as a pointer back into the doc object
-function mock_doc(aIdentity, aOrigin, aDoFunc) {
- let mockedDoc = {};
- mockedDoc.id = uuid();
- mockedDoc.loggedInUser = aIdentity;
- mockedDoc.origin = aOrigin;
- mockedDoc["do"] = aDoFunc;
- mockedDoc._mm = TEST_MESSAGE_MANAGER;
- mockedDoc.doReady = partial(aDoFunc, "ready");
- mockedDoc.doLogin = partial(aDoFunc, "login");
- mockedDoc.doLogout = partial(aDoFunc, "logout");
- mockedDoc.doError = partial(aDoFunc, "error");
- mockedDoc.doCancel = partial(aDoFunc, "cancel");
- mockedDoc.doCoffee = partial(aDoFunc, "coffee");
- mockedDoc.childProcessShutdown = partial(aDoFunc, "child-process-shutdown");
-
- mockedDoc.RP = mockedDoc;
-
- return mockedDoc;
-}
-
-function mock_fxa_rp(aIdentity, aOrigin, aDoFunc) {
- let mockedDoc = {};
- mockedDoc.id = uuid();
- mockedDoc.emailHint = aIdentity;
- mockedDoc.origin = aOrigin;
- mockedDoc.wantIssuer = "firefox-accounts";
- mockedDoc._mm = TEST_MESSAGE_MANAGER;
-
- mockedDoc.doReady = partial(aDoFunc, "ready");
- mockedDoc.doLogin = partial(aDoFunc, "login");
- mockedDoc.doLogout = partial(aDoFunc, "logout");
- mockedDoc.doError = partial(aDoFunc, "error");
- mockedDoc.doCancel = partial(aDoFunc, "cancel");
- mockedDoc.childProcessShutdown = partial(aDoFunc, "child-process-shutdown");
-
- mockedDoc.RP = mockedDoc;
-
- return mockedDoc;
-}
-
-// mimicking callback funtionality for ease of testing
-// this observer auto-removes itself after the observe function
-// is called, so this is meant to observe only ONE event.
-function makeObserver(aObserveTopic, aObserveFunc) {
- let observer = {
- // nsISupports provides type management in C++
- // nsIObserver is to be an observer
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIObserver]),
-
- observe: function (aSubject, aTopic, aData) {
- if (aTopic == aObserveTopic) {
- aObserveFunc(aSubject, aTopic, aData);
- Services.obs.removeObserver(observer, aObserveTopic);
- }
- }
- };
-
- Services.obs.addObserver(observer, aObserveTopic, false);
-}
-
-// set up the ID service with an identity with keypair and all
-// when ready, invoke callback with the identity
-function setup_test_identity(identity, cert, cb) {
- // set up the store so that we're supposed to be logged in
- let store = get_idstore();
-
- function keyGenerated(err, kpo) {
- store.addIdentity(identity, kpo, cert);
- cb();
- }
-
- jwcrypto.generateKeyPair("DS160", keyGenerated);
-}
-
-// takes a list of functions and returns a function that
-// when called the first time, calls the first func,
-// then the next time the second, etc.
-function call_sequentially() {
- let numCalls = 0;
- let funcs = arguments;
-
- return function() {
- if (!funcs[numCalls]) {
- let argString = Array.prototype.slice.call(arguments).join(",");
- do_throw("Too many calls: " + argString);
- return;
- }
- funcs[numCalls].apply(funcs[numCalls], arguments);
- numCalls += 1;
- };
-}
-
-/*
- * Setup a provisioning workflow with appropriate callbacks
- *
- * identity is the email we're provisioning.
- *
- * afterSetupCallback is required.
- *
- * doneProvisioningCallback is optional, if the caller
- * wants to be notified when the whole provisioning workflow is done
- *
- * frameCallbacks is optional, contains the callbacks that the sandbox
- * frame would provide in response to DOM calls.
- */
-function setup_provisioning(identity, afterSetupCallback, doneProvisioningCallback, callerCallbacks) {
- IDService.reset();
-
- let provId = uuid();
- IDService.IDP._provisionFlows[provId] = {
- identity : identity,
- idpParams: TEST_IDPPARAMS,
- callback: function(err) {
- if (doneProvisioningCallback)
- doneProvisioningCallback(err);
- },
- sandbox: {
- // Emulate the free() method on the iframe sandbox
- free: function() {}
- }
- };
-
- let caller = {};
- caller.id = provId;
- caller.doBeginProvisioningCallback = function(id, duration_s) {
- if (callerCallbacks && callerCallbacks.beginProvisioningCallback)
- callerCallbacks.beginProvisioningCallback(id, duration_s);
- };
- caller.doGenKeyPairCallback = function(pk) {
- if (callerCallbacks && callerCallbacks.genKeyPairCallback)
- callerCallbacks.genKeyPairCallback(pk);
- };
-
- afterSetupCallback(caller);
-}
-
-// Switch debug messages on by default
-var initialPrefDebugValue = false;
-try {
- initialPrefDebugValue = Services.prefs.getBoolPref("toolkit.identity.debug");
-} catch (noPref) {}
-Services.prefs.setBoolPref("toolkit.identity.debug", true);
-
-// after execution, restore prefs
-do_register_cleanup(function() {
- log("restoring prefs to their initial values");
- Services.prefs.setBoolPref("toolkit.identity.debug", initialPrefDebugValue);
-});
-
-
diff --git a/toolkit/identity/tests/unit/tail_identity.js b/toolkit/identity/tests/unit/tail_identity.js
deleted file mode 100644
index c263f8369..000000000
--- a/toolkit/identity/tests/unit/tail_identity.js
+++ /dev/null
@@ -1,8 +0,0 @@
-
-// pre-emptively shut down to clear resources
-if (typeof IdentityService !== "undefined") {
- IdentityService.shutdown();
-} else if (typeof IDService !== "undefined") {
- IDService.shutdown();
-}
-
diff --git a/toolkit/identity/tests/unit/test_authentication.js b/toolkit/identity/tests/unit/test_authentication.js
deleted file mode 100644
index 3f24e2e37..000000000
--- a/toolkit/identity/tests/unit/test_authentication.js
+++ /dev/null
@@ -1,159 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "IDService",
- "resource://gre/modules/identity/Identity.jsm",
- "IdentityService");
-
-XPCOMUtils.defineLazyModuleGetter(this, "jwcrypto",
- "resource://gre/modules/identity/jwcrypto.jsm");
-
-function test_begin_authentication_flow() {
- do_test_pending();
- let _provId = null;
-
- // set up a watch, to be consistent
- let mockedDoc = mock_doc(null, TEST_URL, function(action, params) {});
- IDService.RP.watch(mockedDoc);
-
- // The identity-auth notification is sent up to the UX from the
- // _doAuthentication function. Be ready to receive it and call
- // beginAuthentication
- makeObserver("identity-auth", function (aSubject, aTopic, aData) {
- do_check_neq(aSubject, null);
-
- do_check_eq(aSubject.wrappedJSObject.provId, _provId);
-
- do_test_finished();
- run_next_test();
- });
-
- setup_provisioning(
- TEST_USER,
- function(caller) {
- _provId = caller.id;
- IDService.IDP.beginProvisioning(caller);
- }, function() {},
- {
- beginProvisioningCallback: function(email, duration_s) {
-
- // let's say this user needs to authenticate
- IDService.IDP._doAuthentication(_provId, {idpParams:TEST_IDPPARAMS});
- }
- }
- );
-}
-
-function test_complete_authentication_flow() {
- do_test_pending();
- let _provId = null;
- let _authId = null;
- let id = TEST_USER;
-
- let callbacksFired = false;
- let loginStateChanged = false;
- let identityAuthComplete = false;
-
- // The result of authentication should be a successful login
- IDService.reset();
-
- setup_test_identity(id, TEST_CERT, function() {
- // set it up so we're supposed to be logged in to TEST_URL
-
- get_idstore().setLoginState(TEST_URL, true, id);
-
- // When we authenticate, our ready callback will be fired.
- // At the same time, a separate topic will be sent up to the
- // the observer in the UI. The test is complete when both
- // events have occurred.
- let mockedDoc = mock_doc(id, TEST_URL, call_sequentially(
- function(action, params) {
- do_check_eq(action, 'ready');
- do_check_eq(params, undefined);
-
- // if notification already received by observer, test is done
- callbacksFired = true;
- if (loginStateChanged && identityAuthComplete) {
- do_test_finished();
- run_next_test();
- }
- }
- ));
-
- makeObserver("identity-auth-complete", function(aSubject, aTopic, aData) {
- identityAuthComplete = true;
- do_test_finished();
- run_next_test();
- });
-
- makeObserver("identity-login-state-changed", function (aSubject, aTopic, aData) {
- do_check_neq(aSubject, null);
-
- do_check_eq(aSubject.wrappedJSObject.rpId, mockedDoc.id);
- do_check_eq(aData, id);
-
- // if callbacks in caller doc already fired, test is done.
- loginStateChanged = true;
- if (callbacksFired && identityAuthComplete) {
- do_test_finished();
- run_next_test();
- }
- });
-
- IDService.RP.watch(mockedDoc);
-
- // Create a provisioning flow for our auth flow to attach to
- setup_provisioning(
- TEST_USER,
- function(provFlow) {
- _provId = provFlow.id;
-
- IDService.IDP.beginProvisioning(provFlow);
- }, function() {},
- {
- beginProvisioningCallback: function(email, duration_s) {
- // let's say this user needs to authenticate
- IDService.IDP._doAuthentication(_provId, {idpParams:TEST_IDPPARAMS});
-
- // test_begin_authentication_flow verifies that the right
- // message is sent to the UI. So that works. Moving on,
- // the UI calls setAuthenticationFlow ...
- _authId = uuid();
- IDService.IDP.setAuthenticationFlow(_authId, _provId);
-
- // ... then the UI calls beginAuthentication ...
- authCaller.id = _authId;
- IDService.IDP._provisionFlows[_provId].caller = authCaller;
- IDService.IDP.beginAuthentication(authCaller);
- }
- }
- );
- });
-
- // A mock calling context
- let authCaller = {
- doBeginAuthenticationCallback: function doBeginAuthenticationCallback(identity) {
- do_check_eq(identity, TEST_USER);
- // completeAuthentication will emit "identity-auth-complete"
- IDService.IDP.completeAuthentication(_authId);
- },
-
- doError: function(err) {
- log("OW! My doError callback hurts!", err);
- },
- };
-
-}
-
-var TESTS = [];
-
-TESTS.push(test_begin_authentication_flow);
-TESTS.push(test_complete_authentication_flow);
-
-TESTS.forEach(add_test);
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/identity/tests/unit/test_crypto_service.js b/toolkit/identity/tests/unit/test_crypto_service.js
deleted file mode 100644
index 561c3804a..000000000
--- a/toolkit/identity/tests/unit/test_crypto_service.js
+++ /dev/null
@@ -1,122 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import('resource://gre/modules/identity/LogUtils.jsm');
-
-const idService = Cc["@mozilla.org/identity/crypto-service;1"]
- .getService(Ci.nsIIdentityCryptoService);
-
-const ALG_DSA = "DS160";
-const ALG_RSA = "RS256";
-
-const BASE64_URL_ENCODINGS = [
- // The vectors from RFC 4648 are very silly, but we may as well include them.
- ["", ""],
- ["f", "Zg=="],
- ["fo", "Zm8="],
- ["foo", "Zm9v"],
- ["foob", "Zm9vYg=="],
- ["fooba", "Zm9vYmE="],
- ["foobar", "Zm9vYmFy"],
-
- // It's quite likely you could get a string like this in an assertion audience
- ["i-like-pie.com", "aS1saWtlLXBpZS5jb20="],
-
- // A few extra to be really sure
- ["andré@example.com", "YW5kcsOpQGV4YW1wbGUuY29t"],
- ["πόλλ' οἶδ' ἀλώπηξ, ἀλλ' á¼Ï‡á¿–νος ἓν μέγα",
- "z4DPjM67zrsnIM6_4by2zrQnIOG8gM67z47PgM63zr4sIOG8gM67zrsnIOG8kM-H4b-Wzr3Ov8-CIOG8k869IM68zq3Os86x"],
-];
-
-// When the output of an operation is a
-function do_check_eq_or_slightly_less(x, y) {
- do_check_true(x >= y - (3 * 8));
-}
-
-function test_base64_roundtrip() {
- let message = "Attack at dawn!";
- let encoded = idService.base64UrlEncode(message);
- let decoded = base64UrlDecode(encoded);
- do_check_neq(message, encoded);
- do_check_eq(decoded, message);
- run_next_test();
-}
-
-function test_dsa() {
- idService.generateKeyPair(ALG_DSA, function (rv, keyPair) {
- log("DSA generateKeyPair finished ", rv);
- do_check_true(Components.isSuccessCode(rv));
- do_check_eq(typeof keyPair.sign, "function");
- do_check_eq(keyPair.keyType, ALG_DSA);
- do_check_eq_or_slightly_less(keyPair.hexDSAGenerator.length, 1024 / 8 * 2);
- do_check_eq_or_slightly_less(keyPair.hexDSAPrime.length, 1024 / 8 * 2);
- do_check_eq_or_slightly_less(keyPair.hexDSASubPrime.length, 160 / 8 * 2);
- do_check_eq_or_slightly_less(keyPair.hexDSAPublicValue.length, 1024 / 8 * 2);
- // XXX: test that RSA parameters throw the correct error
-
- log("about to sign with DSA key");
- keyPair.sign("foo", function (rv2, signature) {
- log("DSA sign finished ", rv2, signature);
- do_check_true(Components.isSuccessCode(rv2));
- do_check_true(signature.length > 1);
- // TODO: verify the signature with the public key
- run_next_test();
- });
- });
-}
-
-function test_rsa() {
- idService.generateKeyPair(ALG_RSA, function (rv, keyPair) {
- log("RSA generateKeyPair finished ", rv);
- do_check_true(Components.isSuccessCode(rv));
- do_check_eq(typeof keyPair.sign, "function");
- do_check_eq(keyPair.keyType, ALG_RSA);
- do_check_eq_or_slightly_less(keyPair.hexRSAPublicKeyModulus.length,
- 2048 / 8);
- do_check_true(keyPair.hexRSAPublicKeyExponent.length > 1);
-
- log("about to sign with RSA key");
- keyPair.sign("foo", function (rv2, signature) {
- log("RSA sign finished ", rv2, signature);
- do_check_true(Components.isSuccessCode(rv2));
- do_check_true(signature.length > 1);
- run_next_test();
- });
- });
-}
-
-function test_base64UrlEncode() {
- for (let [source, target] of BASE64_URL_ENCODINGS) {
- do_check_eq(target, idService.base64UrlEncode(source));
- }
- run_next_test();
-}
-
-function test_base64UrlDecode() {
- let utf8Converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"]
- .createInstance(Ci.nsIScriptableUnicodeConverter);
- utf8Converter.charset = "UTF-8";
-
- // We know the encoding of our inputs - on conversion back out again, make
- // sure they're the same.
- for (let [source, target] of BASE64_URL_ENCODINGS) {
- let result = utf8Converter.ConvertToUnicode(base64UrlDecode(target));
- result += utf8Converter.Finish();
- do_check_eq(source, result);
- }
- run_next_test();
-}
-
-add_test(test_base64_roundtrip);
-add_test(test_dsa);
-add_test(test_rsa);
-add_test(test_base64UrlEncode);
-add_test(test_base64UrlDecode);
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/identity/tests/unit/test_identity.js b/toolkit/identity/tests/unit/test_identity.js
deleted file mode 100644
index 5e2206c2a..000000000
--- a/toolkit/identity/tests/unit/test_identity.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "IDService",
- "resource://gre/modules/identity/Identity.jsm",
- "IdentityService");
-
-function test_overall() {
- do_check_neq(IDService, null);
- run_next_test();
-}
-
-function test_mock_doc() {
- do_test_pending();
- let mockedDoc = mock_doc(null, TEST_URL, function(action, params) {
- do_check_eq(action, 'coffee');
- do_test_finished();
- run_next_test();
- });
-
- mockedDoc.doCoffee();
-}
-
-function test_add_identity() {
- IDService.reset();
-
- IDService.addIdentity(TEST_USER);
-
- let identities = IDService.RP.getIdentitiesForSite(TEST_URL);
- do_check_eq(identities.result.length, 1);
- do_check_eq(identities.result[0], TEST_USER);
-
- run_next_test();
-}
-
-function test_select_identity() {
- do_test_pending();
-
- IDService.reset();
-
- let id = "ishtar@mockmyid.com";
- setup_test_identity(id, TEST_CERT, function() {
- let gotAssertion = false;
- let mockedDoc = mock_doc(null, TEST_URL, call_sequentially(
- function(action, params) {
- // ready emitted from first watch() call
- do_check_eq(action, 'ready');
- do_check_null(params);
- },
- // first the login call
- function(action, params) {
- do_check_eq(action, 'login');
- do_check_neq(params, null);
-
- // XXX - check that the assertion is for the right email
-
- gotAssertion = true;
- },
- // then the ready call
- function(action, params) {
- do_check_eq(action, 'ready');
- do_check_null(params);
-
- // we should have gotten the assertion already
- do_check_true(gotAssertion);
-
- do_test_finished();
- run_next_test();
- }));
-
- // register the callbacks
- IDService.RP.watch(mockedDoc);
-
- // register the request UX observer
- makeObserver("identity-request", function (aSubject, aTopic, aData) {
- // do the select identity
- // we expect this to succeed right away because of test_identity
- // so we don't mock network requests or otherwise
- IDService.selectIdentity(aSubject.wrappedJSObject.rpId, id);
- });
-
- // do the request
- IDService.RP.request(mockedDoc.id, {});
- });
-}
-
-function test_parse_good_email() {
- var parsed = IDService.parseEmail('prime-minister@jed.gov');
- do_check_eq(parsed.username, 'prime-minister');
- do_check_eq(parsed.domain, 'jed.gov');
- run_next_test();
-}
-
-function test_parse_bogus_emails() {
- do_check_eq(null, IDService.parseEmail('@evil.org'));
- do_check_eq(null, IDService.parseEmail('foo@bar@baz.com'));
- do_check_eq(null, IDService.parseEmail('you@wellsfargo.com/accounts/transfer?to=dolske&amt=all'));
- run_next_test();
-}
-
-var TESTS = [test_overall, test_mock_doc];
-
-TESTS.push(test_add_identity);
-TESTS.push(test_select_identity);
-TESTS.push(test_parse_good_email);
-TESTS.push(test_parse_bogus_emails);
-
-TESTS.forEach(add_test);
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/identity/tests/unit/test_identity_utils.js b/toolkit/identity/tests/unit/test_identity_utils.js
deleted file mode 100644
index 6ccc4e311..000000000
--- a/toolkit/identity/tests/unit/test_identity_utils.js
+++ /dev/null
@@ -1,46 +0,0 @@
-
-"use strict";
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import('resource://gre/modules/Services.jsm');
-Cu.import('resource://gre/modules/identity/IdentityUtils.jsm');
-
-function test_check_deprecated() {
- let options = {
- id: 123,
- loggedInEmail: "jed@foo.com",
- pies: 42
- };
-
- do_check_true(checkDeprecated(options, "loggedInEmail"));
- do_check_false(checkDeprecated(options, "flans"));
-
- run_next_test();
-}
-
-function test_check_renamed() {
- let options = {
- id: 123,
- loggedInEmail: "jed@foo.com",
- pies: 42
- };
-
- checkRenamed(options, "loggedInEmail", "loggedInUser");
-
- // It moves loggedInEmail to loggedInUser
- do_check_false(!!options.loggedInEmail);
- do_check_eq(options.loggedInUser, "jed@foo.com");
-
- run_next_test();
-}
-
-var TESTS = [
- test_check_deprecated,
- test_check_renamed
-];
-
-TESTS.forEach(add_test);
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/identity/tests/unit/test_jwcrypto.js b/toolkit/identity/tests/unit/test_jwcrypto.js
deleted file mode 100644
index f8fe82453..000000000
--- a/toolkit/identity/tests/unit/test_jwcrypto.js
+++ /dev/null
@@ -1,281 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict"
-
-Cu.import('resource://gre/modules/identity/LogUtils.jsm');
-
-XPCOMUtils.defineLazyModuleGetter(this, "IDService",
- "resource://gre/modules/identity/Identity.jsm",
- "IdentityService");
-
-XPCOMUtils.defineLazyModuleGetter(this, "jwcrypto",
- "resource://gre/modules/identity/jwcrypto.jsm");
-
-XPCOMUtils.defineLazyServiceGetter(this,
- "CryptoService",
- "@mozilla.org/identity/crypto-service;1",
- "nsIIdentityCryptoService");
-
-const RP_ORIGIN = "http://123done.org";
-const INTERNAL_ORIGIN = "browserid://";
-
-const SECOND_MS = 1000;
-const MINUTE_MS = SECOND_MS * 60;
-const HOUR_MS = MINUTE_MS * 60;
-
-function test_sanity() {
- do_test_pending();
-
- jwcrypto.generateKeyPair("DS160", function(err, kp) {
- do_check_null(err);
-
- do_test_finished();
- run_next_test();
- });
-}
-
-function test_generate() {
- do_test_pending();
- jwcrypto.generateKeyPair("DS160", function(err, kp) {
- do_check_null(err);
- do_check_neq(kp, null);
-
- do_test_finished();
- run_next_test();
- });
-}
-
-function test_get_assertion() {
- do_test_pending();
-
- jwcrypto.generateKeyPair(
- "DS160",
- function(err, kp) {
- jwcrypto.generateAssertion("fake-cert", kp, RP_ORIGIN, (err2, backedAssertion) => {
- do_check_null(err2);
-
- do_check_eq(backedAssertion.split("~").length, 2);
- do_check_eq(backedAssertion.split(".").length, 3);
-
- do_test_finished();
- run_next_test();
- });
- });
-}
-
-function test_rsa() {
- do_test_pending();
- function checkRSA(err, kpo) {
- do_check_neq(kpo, undefined);
- log(kpo.serializedPublicKey);
- let pk = JSON.parse(kpo.serializedPublicKey);
- do_check_eq(pk.algorithm, "RS");
-/* TODO
- do_check_neq(kpo.sign, null);
- do_check_eq(typeof kpo.sign, "function");
- do_check_neq(kpo.userID, null);
- do_check_neq(kpo.url, null);
- do_check_eq(kpo.url, INTERNAL_ORIGIN);
- do_check_neq(kpo.exponent, null);
- do_check_neq(kpo.modulus, null);
-
- // TODO: should sign be async?
- let sig = kpo.sign("This is a message to sign");
-
- do_check_neq(sig, null);
- do_check_eq(typeof sig, "string");
- do_check_true(sig.length > 1);
-*/
- do_test_finished();
- run_next_test();
- }
-
- jwcrypto.generateKeyPair("RS256", checkRSA);
-}
-
-function test_dsa() {
- do_test_pending();
- function checkDSA(err, kpo) {
- do_check_neq(kpo, undefined);
- log(kpo.serializedPublicKey);
- let pk = JSON.parse(kpo.serializedPublicKey);
- do_check_eq(pk.algorithm, "DS");
-/* TODO
- do_check_neq(kpo.sign, null);
- do_check_eq(typeof kpo.sign, "function");
- do_check_neq(kpo.userID, null);
- do_check_neq(kpo.url, null);
- do_check_eq(kpo.url, INTERNAL_ORIGIN);
- do_check_neq(kpo.generator, null);
- do_check_neq(kpo.prime, null);
- do_check_neq(kpo.subPrime, null);
- do_check_neq(kpo.publicValue, null);
-
- let sig = kpo.sign("This is a message to sign");
-
- do_check_neq(sig, null);
- do_check_eq(typeof sig, "string");
- do_check_true(sig.length > 1);
-*/
- do_test_finished();
- run_next_test();
- }
-
- jwcrypto.generateKeyPair("DS160", checkDSA);
-}
-
-function test_get_assertion_with_offset() {
- do_test_pending();
-
-
- // Use an arbitrary date in the past to ensure we don't accidentally pass
- // this test with current dates, missing offsets, etc.
- let serverMsec = Date.parse("Tue Oct 31 2000 00:00:00 GMT-0800");
-
- // local clock skew
- // clock is 12 hours fast; -12 hours offset must be applied
- let localtimeOffsetMsec = -1 * 12 * HOUR_MS;
- let localMsec = serverMsec - localtimeOffsetMsec;
-
- jwcrypto.generateKeyPair(
- "DS160",
- function(err, kp) {
- jwcrypto.generateAssertion("fake-cert", kp, RP_ORIGIN,
- { duration: MINUTE_MS,
- localtimeOffsetMsec: localtimeOffsetMsec,
- now: localMsec},
- function(err2, backedAssertion) {
- do_check_null(err2);
-
- // properly formed
- let cert;
- let assertion;
- [cert, assertion] = backedAssertion.split("~");
-
- do_check_eq(cert, "fake-cert");
- do_check_eq(assertion.split(".").length, 3);
-
- let components = extractComponents(assertion);
-
- // Expiry is within two minutes, corrected for skew
- let exp = parseInt(components.payload.exp, 10);
- do_check_true(exp - serverMsec === MINUTE_MS);
-
- do_test_finished();
- run_next_test();
- }
- );
- }
- );
-}
-
-function test_assertion_lifetime() {
- do_test_pending();
-
- jwcrypto.generateKeyPair(
- "DS160",
- function(err, kp) {
- jwcrypto.generateAssertion("fake-cert", kp, RP_ORIGIN,
- {duration: MINUTE_MS},
- function(err2, backedAssertion) {
- do_check_null(err2);
-
- // properly formed
- let cert;
- let assertion;
- [cert, assertion] = backedAssertion.split("~");
-
- do_check_eq(cert, "fake-cert");
- do_check_eq(assertion.split(".").length, 3);
-
- let components = extractComponents(assertion);
-
- // Expiry is within one minute, as we specified above
- let exp = parseInt(components.payload.exp, 10);
- do_check_true(Math.abs(Date.now() - exp) > 50 * SECOND_MS);
- do_check_true(Math.abs(Date.now() - exp) <= MINUTE_MS);
-
- do_test_finished();
- run_next_test();
- }
- );
- }
- );
-}
-
-function test_audience_encoding_bug972582() {
- let audience = "i-like-pie.com";
-
- jwcrypto.generateKeyPair(
- "DS160",
- function(err, kp) {
- do_check_null(err);
- jwcrypto.generateAssertion("fake-cert", kp, audience,
- function(err2, backedAssertion) {
- do_check_null(err2);
-
- let [cert, assertion] = backedAssertion.split("~");
- let components = extractComponents(assertion);
- do_check_eq(components.payload.aud, audience);
-
- do_test_finished();
- run_next_test();
- }
- );
- }
- );
-}
-
-// End of tests
-// Helper function follow
-
-function extractComponents(signedObject) {
- if (typeof(signedObject) != 'string') {
- throw new Error("malformed signature " + typeof(signedObject));
- }
-
- let parts = signedObject.split(".");
- if (parts.length != 3) {
- throw new Error("signed object must have three parts, this one has " + parts.length);
- }
-
- let headerSegment = parts[0];
- let payloadSegment = parts[1];
- let cryptoSegment = parts[2];
-
- let header = JSON.parse(base64UrlDecode(headerSegment));
- let payload = JSON.parse(base64UrlDecode(payloadSegment));
-
- // Ensure well-formed header
- do_check_eq(Object.keys(header).length, 1);
- do_check_true(!!header.alg);
-
- // Ensure well-formed payload
- for (let field of ["exp", "aud"]) {
- do_check_true(!!payload[field]);
- }
-
- return {header: header,
- payload: payload,
- headerSegment: headerSegment,
- payloadSegment: payloadSegment,
- cryptoSegment: cryptoSegment};
-}
-
-var TESTS = [
- test_sanity,
- test_generate,
- test_get_assertion,
- test_get_assertion_with_offset,
- test_assertion_lifetime,
- test_audience_encoding_bug972582,
-];
-
-TESTS = TESTS.concat([test_rsa, test_dsa]);
-
-TESTS.forEach(add_test);
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/identity/tests/unit/test_load_modules.js b/toolkit/identity/tests/unit/test_load_modules.js
deleted file mode 100644
index 4c531312c..000000000
--- a/toolkit/identity/tests/unit/test_load_modules.js
+++ /dev/null
@@ -1,20 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-const modules = [
- "Identity.jsm",
- "IdentityProvider.jsm",
- "IdentityStore.jsm",
- "jwcrypto.jsm",
- "RelyingParty.jsm",
- "Sandbox.jsm",
-];
-
-function run_test() {
- for (let m of modules) {
- let resource = "resource://gre/modules/identity/" + m;
- Components.utils.import(resource, {});
- do_print("loaded " + resource);
- }
-}
diff --git a/toolkit/identity/tests/unit/test_log_utils.js b/toolkit/identity/tests/unit/test_log_utils.js
deleted file mode 100644
index ac43c297d..000000000
--- a/toolkit/identity/tests/unit/test_log_utils.js
+++ /dev/null
@@ -1,74 +0,0 @@
-
-"use strict";
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import('resource://gre/modules/Services.jsm');
-Cu.import('resource://gre/modules/identity/LogUtils.jsm');
-
-function toggle_debug() {
- do_test_pending();
-
- function Wrapper() {
- this.init();
- }
- Wrapper.prototype = {
- QueryInterface: XPCOMUtils.generateQI([Ci.nsISupports, Ci.nsIObserver]),
-
- observe: function observe(aSubject, aTopic, aData) {
- if (aTopic === "nsPref:changed") {
- // race condition?
- do_check_eq(Logger._debug, true);
- do_test_finished();
- run_next_test();
- }
- },
-
- init: function() {
- Services.prefs.addObserver('toolkit.identity.debug', this, false);
- }
- };
-
- var wrapper = new Wrapper();
- Services.prefs.setBoolPref('toolkit.identity.debug', true);
-}
-
-// test that things don't break
-
-function logAlias(...args) {
- Logger.log.apply(Logger, ["log alias"].concat(args));
-}
-function reportErrorAlias(...args) {
- Logger.reportError.apply(Logger, ["report error alias"].concat(args));
-}
-
-function test_log() {
- Logger.log("log test", "I like pie");
- do_test_finished();
- run_next_test();
-}
-
-function test_reportError() {
- Logger.reportError("log test", "We are out of pies!!!");
- do_test_finished();
- run_next_test();
-}
-
-function test_wrappers() {
- logAlias("I like potatoes");
- do_test_finished();
- reportErrorAlias("Too much red bull");
-}
-
-var TESTS = [
-// XXX fix me
-// toggle_debug,
- test_log,
- test_reportError,
- test_wrappers,
-];
-
-TESTS.forEach(add_test);
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/identity/tests/unit/test_minimalidentity.js b/toolkit/identity/tests/unit/test_minimalidentity.js
deleted file mode 100644
index 77c30c84f..000000000
--- a/toolkit/identity/tests/unit/test_minimalidentity.js
+++ /dev/null
@@ -1,223 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "MinimalIDService",
- "resource://gre/modules/identity/MinimalIdentity.jsm",
- "IdentityService");
-
-Cu.import("resource://gre/modules/identity/LogUtils.jsm");
-Cu.import("resource://gre/modules/DOMIdentity.jsm");
-
-function log(...aMessageArgs) {
- Logger.log.apply(Logger, ["test_minimalidentity"].concat(aMessageArgs));
-}
-
-function test_overall() {
- do_check_neq(MinimalIDService, null);
- run_next_test();
-}
-
-function test_mock_doc() {
- do_test_pending();
- let mockedDoc = mock_doc(null, TEST_URL, function(action, params) {
- do_check_eq(action, 'coffee');
- do_test_finished();
- run_next_test();
- });
-
- mockedDoc.doCoffee();
-}
-
-/*
- * Test that the "identity-controller-watch" signal is emitted correctly
- */
-function test_watch() {
- do_test_pending();
-
- let mockedDoc = mock_doc(null, TEST_URL);
- makeObserver("identity-controller-watch", function (aSubject, aTopic, aData) {
- do_check_eq(aSubject.wrappedJSObject.id, mockedDoc.id);
- do_check_eq(aSubject.wrappedJSObject.origin, TEST_URL);
- do_test_finished();
- run_next_test();
- });
-
- MinimalIDService.RP.watch(mockedDoc);
-}
-
-/*
- * Test that the "identity-controller-request" signal is emitted correctly
- */
-function test_request() {
- do_test_pending();
-
- let mockedDoc = mock_doc(null, TEST_URL);
- makeObserver("identity-controller-request", function (aSubject, aTopic, aData) {
- do_check_eq(aSubject.wrappedJSObject.id, mockedDoc.id);
- do_check_eq(aSubject.wrappedJSObject.origin, TEST_URL);
- do_test_finished();
- run_next_test();
- });
-
- MinimalIDService.RP.watch(mockedDoc);
- MinimalIDService.RP.request(mockedDoc.id, {});
-}
-
-/*
- * Test that the forceAuthentication flag can be sent
- */
-function test_request_forceAuthentication() {
- do_test_pending();
-
- let mockedDoc = mock_doc(null, TEST_URL);
- makeObserver("identity-controller-request", function (aSubject, aTopic, aData) {
- do_check_eq(aSubject.wrappedJSObject.id, mockedDoc.id);
- do_check_eq(aSubject.wrappedJSObject.origin, TEST_URL);
- do_check_eq(aSubject.wrappedJSObject.forceAuthentication, true);
- do_test_finished();
- run_next_test();
- });
-
- MinimalIDService.RP.watch(mockedDoc);
- MinimalIDService.RP.request(mockedDoc.id, {forceAuthentication: true});
-}
-
-/*
- * Test that the issuer can be forced
- */
-function test_request_forceIssuer() {
- do_test_pending();
-
- let mockedDoc = mock_doc(null, TEST_URL);
- makeObserver("identity-controller-request", function (aSubject, aTopic, aData) {
- do_check_eq(aSubject.wrappedJSObject.id, mockedDoc.id);
- do_check_eq(aSubject.wrappedJSObject.origin, TEST_URL);
- do_check_eq(aSubject.wrappedJSObject.issuer, "https://jed.gov");
- do_test_finished();
- run_next_test();
- });
-
- MinimalIDService.RP.watch(mockedDoc);
- MinimalIDService.RP.request(mockedDoc.id, {issuer: "https://jed.gov"});
-}
-
-/*
- * Test that the "identity-controller-logout" signal is emitted correctly
- */
-function test_logout() {
- do_test_pending();
-
- let mockedDoc = mock_doc(null, TEST_URL);
- makeObserver("identity-controller-logout", function (aSubject, aTopic, aData) {
- do_check_eq(aSubject.wrappedJSObject.id, mockedDoc.id);
- do_test_finished();
- run_next_test();
- });
-
- MinimalIDService.RP.watch(mockedDoc);
- MinimalIDService.RP.logout(mockedDoc.id, {});
-}
-
-/*
- * Test that logout() before watch() fails gently
- */
-
-function test_logoutBeforeWatch() {
- do_test_pending();
-
- let mockedDoc = mock_doc(null, TEST_URL);
- makeObserver("identity-controller-logout", function() {
- do_throw("How can we logout when watch was not called?");
- });
-
- MinimalIDService.RP.logout(mockedDoc.id, {});
- do_test_finished();
- run_next_test();
-}
-
-/*
- * Test that request() before watch() fails gently
- */
-
-function test_requestBeforeWatch() {
- do_test_pending();
-
- let mockedDoc = mock_doc(null, TEST_URL);
- makeObserver("identity-controller-request", function() {
- do_throw("How can we request when watch was not called?");
- });
-
- MinimalIDService.RP.request(mockedDoc.id, {});
- do_test_finished();
- run_next_test();
-}
-
-/*
- * Test that internal unwatch() before watch() fails gently
- */
-
-function test_unwatchBeforeWatch() {
- do_test_pending();
-
- let mockedDoc = mock_doc(null, TEST_URL);
-
- MinimalIDService.RP.unwatch(mockedDoc.id, {});
- do_test_finished();
- run_next_test();
-}
-
-/*
- * Test that the RP flow is cleaned up on child process shutdown
- */
-
-function test_childProcessShutdown() {
- do_test_pending();
- let UNIQUE_MESSAGE_MANAGER = "i am a beautiful snowflake";
- let initialRPCount = Object.keys(MinimalIDService.RP._rpFlows).length;
-
- let mockedDoc = mock_doc(null, TEST_URL, (action, params) => {
- if (action == "child-process-shutdown") {
- // since there's no actual dom window connection, we have to
- // do this bit manually here.
- MinimalIDService.RP.childProcessShutdown(UNIQUE_MESSAGE_MANAGER);
- }
- });
- mockedDoc._mm = UNIQUE_MESSAGE_MANAGER;
-
- makeObserver("identity-controller-watch", function (aSubject, aTopic, aData) {
- DOMIdentity._childProcessShutdown(UNIQUE_MESSAGE_MANAGER);
- });
-
- makeObserver("identity-child-process-shutdown", (aTopic, aSubject, aData) => {
- do_check_eq(Object.keys(MinimalIDService.RP._rpFlows).length, initialRPCount);
- do_test_finished();
- run_next_test();
- });
-
- // fake a dom window context
- DOMIdentity.newContext(mockedDoc, UNIQUE_MESSAGE_MANAGER);
-
- MinimalIDService.RP.watch(mockedDoc);
-}
-
-var TESTS = [
- test_overall,
- test_mock_doc,
- test_watch,
- test_request,
- test_request_forceAuthentication,
- test_request_forceIssuer,
- test_logout,
- test_logoutBeforeWatch,
- test_requestBeforeWatch,
- test_unwatchBeforeWatch,
- test_childProcessShutdown,
-];
-
-TESTS.forEach(add_test);
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/identity/tests/unit/test_observer_topics.js b/toolkit/identity/tests/unit/test_observer_topics.js
deleted file mode 100644
index 8e5a89c91..000000000
--- a/toolkit/identity/tests/unit/test_observer_topics.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * By their nature, these tests duplicate some of the functionality of
- * other tests for Identity, RelyingParty, and IdentityProvider.
- *
- * In particular, "identity-auth-complete" and
- * "identity-login-state-changed" are tested in test_authentication.js
- */
-
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "IDService",
- "resource://gre/modules/identity/Identity.jsm",
- "IdentityService");
-
-function test_smoke() {
- do_check_neq(IDService, null);
- run_next_test();
-}
-
-function test_identity_request() {
- // In response to navigator.id.request(), initiate a login with user
- // interaction by notifying observers of 'identity-request'
-
- do_test_pending();
-
- IDService.reset();
-
- let id = "landru@mockmyid.com";
- setup_test_identity(id, TEST_CERT, function() {
- // deliberately adding a trailing final slash on the domain
- // to test path composition
- let mockedDoc = mock_doc(null, "http://jed.gov/", function() {});
-
- // by calling watch() we create an rp flow.
- IDService.RP.watch(mockedDoc);
-
- // register the request UX observer
- makeObserver("identity-request", function (aSubject, aTopic, aData) {
- do_check_eq(aTopic, "identity-request");
- do_check_eq(aData, null);
-
- // check that all the URLs are properly resolved
- let subj = aSubject.wrappedJSObject;
- do_check_eq(subj.privacyPolicy, "http://jed.gov/pp.html");
- do_check_eq(subj.termsOfService, "http://jed.gov/tos.html");
-
- do_test_finished();
- run_next_test();
- });
-
- let requestOptions = {
- privacyPolicy: "/pp.html",
- termsOfService: "/tos.html"
- };
- IDService.RP.request(mockedDoc.id, requestOptions);
- });
-
-}
-
-function test_identity_auth() {
- // see test_authentication.js for "identity-auth-complete"
- // and "identity-login-state-changed"
-
- do_test_pending();
- let _provId = "bogus";
-
- // Simulate what would be returned by IDService._fetchWellKnownFile
- // for a given domain.
- let idpParams = {
- domain: "myfavoriteflan.com",
- idpParams: {
- authentication: "/foo/authenticate.html",
- provisioning: "/foo/provision.html"
- }
- };
-
- // Create an RP flow
- let mockedDoc = mock_doc(null, TEST_URL, function(action, params) {});
- IDService.RP.watch(mockedDoc);
-
- // The identity-auth notification is sent up to the UX from the
- // _doAuthentication function. Be ready to receive it and call
- // beginAuthentication
- makeObserver("identity-auth", function (aSubject, aTopic, aData) {
- do_check_neq(aSubject, null);
- do_check_eq(aTopic, "identity-auth");
- do_check_eq(aData, "https://myfavoriteflan.com/foo/authenticate.html");
-
- do_check_eq(aSubject.wrappedJSObject.provId, _provId);
- do_test_finished();
- run_next_test();
- });
-
- // Even though our provisioning flow id is bogus, IdentityProvider
- // won't look at it until farther along in the authentication
- // process. So this test can pass with a fake provId.
- IDService.IDP._doAuthentication(_provId, idpParams);
-}
-
-var TESTS = [
- test_smoke,
- test_identity_request,
- test_identity_auth,
- ];
-
-
-TESTS.forEach(add_test);
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/identity/tests/unit/test_provisioning.js b/toolkit/identity/tests/unit/test_provisioning.js
deleted file mode 100644
index c05805bef..000000000
--- a/toolkit/identity/tests/unit/test_provisioning.js
+++ /dev/null
@@ -1,242 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Cu.import("resource://gre/modules/identity/IdentityProvider.jsm");
-
-function check_provision_flow_done(provId) {
- do_check_null(IdentityProvider._provisionFlows[provId]);
-}
-
-function test_begin_provisioning() {
- do_test_pending();
-
- setup_provisioning(
- TEST_USER,
- function(caller) {
- // call .beginProvisioning()
- IdentityProvider.beginProvisioning(caller);
- }, function() {},
- {
- beginProvisioningCallback: function(email, duration_s) {
- do_check_eq(email, TEST_USER);
- do_check_true(duration_s > 0);
- do_check_true(duration_s <= (24 * 3600));
-
- do_test_finished();
- run_next_test();
- }
- });
-}
-
-function test_raise_provisioning_failure() {
- do_test_pending();
- let _callerId = null;
-
- setup_provisioning(
- TEST_USER,
- function(caller) {
- // call .beginProvisioning()
- _callerId = caller.id;
- IdentityProvider.beginProvisioning(caller);
- }, function(err) {
- // this should be invoked with a populated error
- do_check_neq(err, null);
- do_check_true(err.indexOf("can't authenticate this email") > -1);
-
- do_test_finished();
- run_next_test();
- },
- {
- beginProvisioningCallback: function(email, duration_s) {
- // raise the failure as if we can't provision this email
- IdentityProvider.raiseProvisioningFailure(_callerId, "can't authenticate this email");
- }
- });
-}
-
-function test_genkeypair_before_begin_provisioning() {
- do_test_pending();
-
- setup_provisioning(
- TEST_USER,
- function(caller) {
- // call genKeyPair without beginProvisioning
- IdentityProvider.genKeyPair(caller.id);
- },
- // expect this to be called with an error
- function(err) {
- do_check_neq(err, null);
-
- do_test_finished();
- run_next_test();
- },
- {
- // this should not be called at all!
- genKeyPairCallback: function(pk) {
- // a test that will surely fail because we shouldn't be here.
- do_check_true(false);
-
- do_test_finished();
- run_next_test();
- }
- }
- );
-}
-
-function test_genkeypair() {
- do_test_pending();
- let _callerId = null;
-
- setup_provisioning(
- TEST_USER,
- function(caller) {
- _callerId = caller.id;
- IdentityProvider.beginProvisioning(caller);
- },
- function(err) {
- // should not be called!
- do_check_true(false);
-
- do_test_finished();
- run_next_test();
- },
- {
- beginProvisioningCallback: function(email, time_s) {
- IdentityProvider.genKeyPair(_callerId);
- },
- genKeyPairCallback: function(kp) {
- do_check_neq(kp, null);
-
- // yay!
- do_test_finished();
- run_next_test();
- }
- }
- );
-}
-
-// we've already ensured that genkeypair can't be called
-// before beginProvisioning, so this test should be enough
-// to ensure full sequential call of the 3 APIs.
-function test_register_certificate_before_genkeypair() {
- do_test_pending();
- let _callerID = null;
-
- setup_provisioning(
- TEST_USER,
- function(caller) {
- // do the right thing for beginProvisioning
- _callerID = caller.id;
- IdentityProvider.beginProvisioning(caller);
- },
- // expect this to be called with an error
- function(err) {
- do_check_neq(err, null);
-
- do_test_finished();
- run_next_test();
- },
- {
- beginProvisioningCallback: function(email, duration_s) {
- // now we try to register cert but no keygen has been done
- IdentityProvider.registerCertificate(_callerID, "fake-cert");
- }
- }
- );
-}
-
-function test_register_certificate() {
- do_test_pending();
- let _callerId = null;
-
- setup_provisioning(
- TEST_USER,
- function(caller) {
- _callerId = caller.id;
- IdentityProvider.beginProvisioning(caller);
- },
- function(err) {
- // we should be cool!
- do_check_null(err);
-
- // check that the cert is there
- let identity = get_idstore().fetchIdentity(TEST_USER);
- do_check_neq(identity, null);
- do_check_eq(identity.cert, "fake-cert-42");
-
- do_execute_soon(function check_done() {
- // cleanup will happen after the callback is called
- check_provision_flow_done(_callerId);
-
- do_test_finished();
- run_next_test();
- });
- },
- {
- beginProvisioningCallback: function(email, duration_s) {
- IdentityProvider.genKeyPair(_callerId);
- },
- genKeyPairCallback: function(pk) {
- IdentityProvider.registerCertificate(_callerId, "fake-cert-42");
- }
- }
- );
-}
-
-
-function test_get_assertion_after_provision() {
- do_test_pending();
- let _callerId = null;
-
- setup_provisioning(
- TEST_USER,
- function(caller) {
- _callerId = caller.id;
- IdentityProvider.beginProvisioning(caller);
- },
- function(err) {
- // we should be cool!
- do_check_null(err);
-
- // check that the cert is there
- let identity = get_idstore().fetchIdentity(TEST_USER);
- do_check_neq(identity, null);
- do_check_eq(identity.cert, "fake-cert-42");
-
- do_execute_soon(function check_done() {
- // cleanup will happen after the callback is called
- check_provision_flow_done(_callerId);
-
- do_test_finished();
- run_next_test();
- });
- },
- {
- beginProvisioningCallback: function(email, duration_s) {
- IdentityProvider.genKeyPair(_callerId);
- },
- genKeyPairCallback: function(pk) {
- IdentityProvider.registerCertificate(_callerId, "fake-cert-42");
- }
- }
- );
-
-}
-
-var TESTS = [];
-
-TESTS.push(test_begin_provisioning);
-TESTS.push(test_raise_provisioning_failure);
-TESTS.push(test_genkeypair_before_begin_provisioning);
-TESTS.push(test_genkeypair);
-TESTS.push(test_register_certificate_before_genkeypair);
-TESTS.push(test_register_certificate);
-TESTS.push(test_get_assertion_after_provision);
-
-TESTS.forEach(add_test);
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/identity/tests/unit/test_relying_party.js b/toolkit/identity/tests/unit/test_relying_party.js
deleted file mode 100644
index e78d22779..000000000
--- a/toolkit/identity/tests/unit/test_relying_party.js
+++ /dev/null
@@ -1,255 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "RelyingParty",
- "resource://gre/modules/identity/RelyingParty.jsm");
-
-function resetState() {
- get_idstore().reset();
- RelyingParty.reset();
-}
-
-function test_watch_loggedin_ready() {
- do_test_pending();
-
- resetState();
-
- let id = TEST_USER;
- setup_test_identity(id, TEST_CERT, function() {
- let store = get_idstore();
-
- // set it up so we're supposed to be logged in to TEST_URL
- store.setLoginState(TEST_URL, true, id);
- RelyingParty.watch(mock_doc(id, TEST_URL, function(action, params) {
- do_check_eq(action, 'ready');
- do_check_eq(params, undefined);
-
- do_test_finished();
- run_next_test();
- }));
- });
-}
-
-function test_watch_loggedin_login() {
- do_test_pending();
-
- resetState();
-
- let id = TEST_USER;
- setup_test_identity(id, TEST_CERT, function() {
- let store = get_idstore();
-
- // set it up so we're supposed to be logged in to TEST_URL
- store.setLoginState(TEST_URL, true, id);
-
- // check for first a login() call, then a ready() call
- RelyingParty.watch(mock_doc(null, TEST_URL, call_sequentially(
- function(action, params) {
- do_check_eq(action, 'login');
- do_check_neq(params, null);
- },
- function(action, params) {
- do_check_eq(action, 'ready');
- do_check_null(params);
-
- do_test_finished();
- run_next_test();
- }
- )));
- });
-}
-
-function test_watch_loggedin_logout() {
- do_test_pending();
-
- resetState();
-
- let id = TEST_USER;
- let other_id = "otherid@foo.com";
- setup_test_identity(other_id, TEST_CERT, function() {
- setup_test_identity(id, TEST_CERT, function() {
- let store = get_idstore();
-
- // set it up so we're supposed to be logged in to TEST_URL
- // with id, not other_id
- store.setLoginState(TEST_URL, true, id);
-
- // this should cause a login with an assertion for id,
- // not for other_id
- RelyingParty.watch(mock_doc(other_id, TEST_URL, call_sequentially(
- function(action, params) {
- do_check_eq(action, 'login');
- do_check_neq(params, null);
- },
- function(action, params) {
- do_check_eq(action, 'ready');
- do_check_null(params);
-
- do_test_finished();
- run_next_test();
- }
- )));
- });
- });
-}
-
-function test_watch_notloggedin_ready() {
- do_test_pending();
-
- resetState();
-
- RelyingParty.watch(mock_doc(null, TEST_URL, function(action, params) {
- do_check_eq(action, 'ready');
- do_check_eq(params, undefined);
-
- do_test_finished();
- run_next_test();
- }));
-}
-
-function test_watch_notloggedin_logout() {
- do_test_pending();
-
- resetState();
-
- RelyingParty.watch(mock_doc(TEST_USER, TEST_URL, call_sequentially(
- function(action, params) {
- do_check_eq(action, 'logout');
- do_check_eq(params, undefined);
-
- let store = get_idstore();
- do_check_null(store.getLoginState(TEST_URL));
- },
- function(action, params) {
- do_check_eq(action, 'ready');
- do_check_eq(params, undefined);
- do_test_finished();
- run_next_test();
- }
- )));
-}
-
-function test_request() {
- do_test_pending();
-
- // set up a watch, to be consistent
- let mockedDoc = mock_doc(null, TEST_URL, function(action, params) {
- // this isn't going to be called for now
- // XXX but it is called - is that bad?
- });
-
- RelyingParty.watch(mockedDoc);
-
- // be ready for the UX identity-request notification
- makeObserver("identity-request", function (aSubject, aTopic, aData) {
- do_check_neq(aSubject, null);
-
- do_check_eq(aSubject.wrappedJSObject.rpId, mockedDoc.id);
-
- do_test_finished();
- run_next_test();
- });
-
- RelyingParty.request(mockedDoc.id, {});
-}
-
-/*
- * ensure the forceAuthentication param can be passed through
- */
-function test_request_forceAuthentication() {
- do_test_pending();
-
- let mockedDoc = mock_doc(null, TEST_URL, function(action, params) {});
-
- RelyingParty.watch(mockedDoc);
-
- makeObserver("identity-request", function(aSubject, aTopic, aData) {
- do_check_eq(aSubject.wrappedJSObject.rpId, mockedDoc.id);
- do_check_eq(aSubject.wrappedJSObject.forceAuthentication, true);
- do_test_finished();
- run_next_test();
- });
-
- RelyingParty.request(mockedDoc.id, {forceAuthentication: true});
-}
-
-/*
- * ensure the issuer can be forced
- */
-function test_request_forceIssuer() {
- do_test_pending();
-
- let mockedDoc = mock_doc(null, TEST_URL, function(action, params) {});
-
- RelyingParty.watch(mockedDoc);
-
- makeObserver("identity-request", function(aSubject, aTopic, aData) {
- do_check_eq(aSubject.wrappedJSObject.rpId, mockedDoc.id);
- do_check_eq(aSubject.wrappedJSObject.issuer, "https://ozten.co.uk");
- do_test_finished();
- run_next_test();
- });
-
- RelyingParty.request(mockedDoc.id, {issuer: "https://ozten.co.uk"});
-}
-function test_logout() {
- do_test_pending();
-
- resetState();
-
- let id = TEST_USER;
- setup_test_identity(id, TEST_CERT, function() {
- let store = get_idstore();
-
- // set it up so we're supposed to be logged in to TEST_URL
- store.setLoginState(TEST_URL, true, id);
-
- let doLogout;
- let mockedDoc = mock_doc(id, TEST_URL, call_sequentially(
- function(action, params) {
- do_check_eq(action, 'ready');
- do_check_eq(params, undefined);
-
- do_timeout(100, doLogout);
- },
- function(action, params) {
- do_check_eq(action, 'logout');
- do_check_eq(params, undefined);
- },
- function(action, params) {
- do_check_eq(action, 'ready');
- do_check_eq(params, undefined);
-
- do_test_finished();
- run_next_test();
- }));
-
- doLogout = function() {
- RelyingParty.logout(mockedDoc.id);
- do_check_false(store.getLoginState(TEST_URL).isLoggedIn);
- do_check_eq(store.getLoginState(TEST_URL).email, TEST_USER);
- };
-
- RelyingParty.watch(mockedDoc);
- });
-}
-
-var TESTS = [
- test_watch_loggedin_ready,
- test_watch_loggedin_login,
- test_watch_loggedin_logout,
- test_watch_notloggedin_ready,
- test_watch_notloggedin_logout,
- test_request,
- test_request_forceAuthentication,
- test_request_forceIssuer,
- test_logout,
-];
-
-TESTS.forEach(add_test);
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/identity/tests/unit/test_store.js b/toolkit/identity/tests/unit/test_store.js
deleted file mode 100644
index 1cd9cc4dd..000000000
--- a/toolkit/identity/tests/unit/test_store.js
+++ /dev/null
@@ -1,64 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-XPCOMUtils.defineLazyModuleGetter(this, "IDService",
- "resource://gre/modules/identity/Identity.jsm",
- "IdentityService");
-
-function test_id_store() {
- // XXX - this is ugly, peaking in like this into IDService
- // probably should instantiate our own.
- var store = get_idstore();
-
- // try adding an identity
- store.addIdentity(TEST_USER, TEST_PRIVKEY, TEST_CERT);
- do_check_neq(store.getIdentities()[TEST_USER], null);
- do_check_eq(store.getIdentities()[TEST_USER].cert, TEST_CERT);
-
- // does fetch identity work?
- do_check_neq(store.fetchIdentity(TEST_USER), null);
- do_check_eq(store.fetchIdentity(TEST_USER).cert, TEST_CERT);
-
- // clear the cert should keep the identity but not the cert
- store.clearCert(TEST_USER);
- do_check_neq(store.getIdentities()[TEST_USER], null);
- do_check_null(store.getIdentities()[TEST_USER].cert);
-
- // remove it should remove everything
- store.removeIdentity(TEST_USER);
- do_check_eq(store.getIdentities()[TEST_USER], undefined);
-
- // act like we're logged in to TEST_URL
- store.setLoginState(TEST_URL, true, TEST_USER);
- do_check_neq(store.getLoginState(TEST_URL), null);
- do_check_true(store.getLoginState(TEST_URL).isLoggedIn);
- do_check_eq(store.getLoginState(TEST_URL).email, TEST_USER);
-
- // log out
- store.setLoginState(TEST_URL, false, TEST_USER);
- do_check_neq(store.getLoginState(TEST_URL), null);
- do_check_false(store.getLoginState(TEST_URL).isLoggedIn);
-
- // email is still set
- do_check_eq(store.getLoginState(TEST_URL).email, TEST_USER);
-
- // not logged into other site
- do_check_null(store.getLoginState(TEST_URL2));
-
- // clear login state
- store.clearLoginState(TEST_URL);
- do_check_null(store.getLoginState(TEST_URL));
- do_check_null(store.getLoginState(TEST_URL2));
-
- run_next_test();
-}
-
-var TESTS = [test_id_store, ];
-
-TESTS.forEach(add_test);
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/identity/tests/unit/test_well-known.js b/toolkit/identity/tests/unit/test_well-known.js
deleted file mode 100644
index 5e86f5ae4..000000000
--- a/toolkit/identity/tests/unit/test_well-known.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "IDService",
- "resource://gre/modules/identity/Identity.jsm",
- "IdentityService");
-
-const WELL_KNOWN_PATH = "/.well-known/browserid";
-
-var SERVER_PORT = 8080;
-
-// valid IDP
-function test_well_known_1() {
- do_test_pending();
-
- let server = new HttpServer();
- server.registerFile(WELL_KNOWN_PATH, do_get_file("data/idp_1" + WELL_KNOWN_PATH));
- server.start(SERVER_PORT);
- let hostPort = "localhost:" + SERVER_PORT;
-
- function check_well_known(aErr, aCallbackObj) {
- do_check_null(aErr);
- do_check_eq(aCallbackObj.domain, hostPort);
- let idpParams = aCallbackObj.idpParams;
- do_check_eq(idpParams['public-key'].algorithm, "RS");
- do_check_eq(idpParams.authentication, "/browserid/sign_in.html");
- do_check_eq(idpParams.provisioning, "/browserid/provision.html");
-
- do_test_finished();
- server.stop(run_next_test);
- }
-
- IDService._fetchWellKnownFile(hostPort, check_well_known, "http");
-}
-
-// valid domain, non-exixtent browserid file
-function test_well_known_404() {
- do_test_pending();
-
- let server = new HttpServer();
- // Don't register the well-known file
- // Change ports to avoid HTTP caching
- SERVER_PORT++;
- server.start(SERVER_PORT);
-
- let hostPort = "localhost:" + SERVER_PORT;
-
- function check_well_known_404(aErr, aCallbackObj) {
- do_check_eq("Error", aErr);
- do_check_eq(undefined, aCallbackObj);
- do_test_finished();
- server.stop(run_next_test);
- }
-
- IDService._fetchWellKnownFile(hostPort, check_well_known_404, "http");
-}
-
-// valid domain, invalid browserid file (no "provisioning" member)
-function test_well_known_invalid_1() {
- do_test_pending();
-
- let server = new HttpServer();
- server.registerFile(WELL_KNOWN_PATH, do_get_file("data/idp_invalid_1" + WELL_KNOWN_PATH));
- // Change ports to avoid HTTP caching
- SERVER_PORT++;
- server.start(SERVER_PORT);
-
- let hostPort = "localhost:" + SERVER_PORT;
-
- function check_well_known_invalid_1(aErr, aCallbackObj) {
- // check for an error message
- do_check_true(aErr && aErr.length > 0);
- do_check_eq(undefined, aCallbackObj);
- do_test_finished();
- server.stop(run_next_test);
- }
-
- IDService._fetchWellKnownFile(hostPort, check_well_known_invalid_1, "http");
-}
-
-var TESTS = [test_well_known_1, test_well_known_404, test_well_known_invalid_1];
-
-TESTS.forEach(add_test);
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/identity/tests/unit/xpcshell.ini b/toolkit/identity/tests/unit/xpcshell.ini
deleted file mode 100644
index 309e4791c..000000000
--- a/toolkit/identity/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,23 +0,0 @@
-[DEFAULT]
-head = head_identity.js
-tail = tail_identity.js
-skip-if = true
-support-files =
- data/idp_1/.well-known/browserid
- data/idp_invalid_1/.well-known/browserid
-
-# Test load modules first so syntax failures are caught early.
-[test_load_modules.js]
-[test_minimalidentity.js]
-
-[test_identity_utils.js]
-[test_log_utils.js]
-[test_authentication.js]
-[test_crypto_service.js]
-[test_identity.js]
-[test_jwcrypto.js]
-[test_observer_topics.js]
-[test_provisioning.js]
-[test_relying_party.js]
-[test_store.js]
-[test_well-known.js]
diff --git a/toolkit/library/libxul.mk b/toolkit/library/libxul.mk
index 80f934e60..d09a3962f 100644
--- a/toolkit/library/libxul.mk
+++ b/toolkit/library/libxul.mk
@@ -5,7 +5,6 @@
EXTRA_DEPS += $(topsrcdir)/toolkit/library/libxul.mk
ifeq (Linux,$(OS_ARCH))
-ifneq (Android,$(OS_TARGET))
OS_LDFLAGS += -Wl,-version-script,symverscript
symverscript: $(topsrcdir)/toolkit/library/symverscript.in
@@ -14,7 +13,6 @@ symverscript: $(topsrcdir)/toolkit/library/symverscript.in
EXTRA_DEPS += symverscript
endif
-endif
# Generate GDB pretty printer-autoload files on Linux and Solaris. OSX's GDB is
# too old to support Python pretty-printers; if this changes, we could make
diff --git a/toolkit/library/moz.build b/toolkit/library/moz.build
index 85a7351ba..d9b167547 100644
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -178,7 +178,7 @@ if CONFIG['OS_ARCH'] == 'WINNT':
'winspool',
]
-if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TARGET'] != 'Android':
+if CONFIG['OS_ARCH'] == 'Linux':
OS_LIBS += [
'rt',
]
@@ -195,15 +195,9 @@ if CONFIG['SERVO_TARGET_DIR']:
if CONFIG['MOZ_SYSTEM_JPEG']:
OS_LIBS += CONFIG['MOZ_JPEG_LIBS']
-if CONFIG['MOZ_SYSTEM_PNG']:
- OS_LIBS += CONFIG['MOZ_PNG_LIBS']
-
if CONFIG['MOZ_SYSTEM_HUNSPELL']:
OS_LIBS += CONFIG['MOZ_HUNSPELL_LIBS']
-if CONFIG['MOZ_SYSTEM_LIBVPX']:
- OS_LIBS += CONFIG['MOZ_LIBVPX_LIBS']
-
if not CONFIG['MOZ_TREE_PIXMAN']:
OS_LIBS += CONFIG['MOZ_PIXMAN_LIBS']
diff --git a/toolkit/locales/Makefile.in b/toolkit/locales/Makefile.in
index 198d9aaa8..585c70986 100644
--- a/toolkit/locales/Makefile.in
+++ b/toolkit/locales/Makefile.in
@@ -29,6 +29,3 @@ chrome-%:
@$(MAKE) -C $(DEPTH)/security/manager/locales/ chrome AB_CD=$*
@$(MAKE) chrome AB_CD=$*
-libs:: update.locale
- sed -e 's/%AB_CD%/$(AB_CD)/' $< > $(FINAL_TARGET)/update.locale
-
diff --git a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
index 34db4e4c4..02eb34664 100644
--- a/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
+++ b/toolkit/locales/en-US/chrome/global/aboutSupport.dtd
@@ -106,7 +106,6 @@ variant of aboutSupport.showDir.label. -->
<!ENTITY aboutSupport.updateHistoryTitle "Update History">
<!ENTITY aboutSupport.copyTextToClipboard.label "Copy text to clipboard">
-<!ENTITY aboutSupport.copyRawDataToClipboard.label "Copy raw data to clipboard">
<!ENTITY aboutSupport.safeModeTitle "Try Safe Mode">
<!ENTITY aboutSupport.restartInSafeMode.label "Restart in Safe Mode…">
diff --git a/toolkit/locales/en-US/chrome/global/aboutSupport.properties b/toolkit/locales/en-US/chrome/global/aboutSupport.properties
index e780bfb67..46e445f66 100644
--- a/toolkit/locales/en-US/chrome/global/aboutSupport.properties
+++ b/toolkit/locales/en-US/chrome/global/aboutSupport.properties
@@ -33,10 +33,6 @@ pendingReports=All Crash Reports (including #1 pending crash in the given time r
# "GPU Accelerated Windows: 0/2"
acceleratedWindows = GPU Accelerated Windows
-# LOCALIZATION NOTE (rawDataCopied) Text displayed in a mobile "Toast" to user when the
-# raw data is successfully copied to the clipboard via button press.
-rawDataCopied=Raw data copied to clipboard
-
# LOCALIZATION NOTE (textCopied) Text displayed in a mobile "Toast" to user when the
# text is successfully copied to the clipboard via button press.
textCopied=Text copied to clipboard
diff --git a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
index febc18dfd..a99c825f1 100644
--- a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
+++ b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.dtd
@@ -211,9 +211,6 @@
<!ENTITY addon.loadingReleaseNotes.label "Loading…">
<!ENTITY addon.errorLoadingReleaseNotes.label "Sorry, but there was an error loading the release notes.">
-<!ENTITY addon.nativeAddon "This add-on directly targets &brandFullName;">
-<!ENTITY addon.compatAddon "This add-on targets Mozilla Firefox and runs in compatibility mode">
-
<!ENTITY addon.createdBy.label "By ">
<!ENTITY eula.title "End-User License Agreement">
diff --git a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties
index 370198f56..0b5ec69a1 100644
--- a/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties
+++ b/toolkit/locales/en-US/chrome/mozapps/extensions/extensions.properties
@@ -30,6 +30,9 @@ notification.blocked.link=More Information
#LOCALIZATION NOTE (notification.softblocked) %1$S is the add-on name
notification.softblocked=%1$S is known to cause issues.
notification.softblocked.link=More Information
+#LOCALIZATION NOTE (notification.compatibility) %1$S is the add-on name, %2$S is brand name
+notification.compatibility=%1$S was not designed for %2$S. It may not function properly or cease to function.
+notification.compatibility.link=More Information
#LOCALIZATION NOTE (notification.outdated) %1$S is the add-on name
notification.outdated=An important update is available for %1$S.
notification.outdated.link=Update Now
@@ -78,6 +81,9 @@ details.notification.incompatible=%1$S is incompatible with %2$S %3$S.
#LOCALIZATION NOTE (details.notification.blocked) %1$S is the add-on name
details.notification.blocked=%1$S has been disabled due to security or stability issues.
details.notification.blocked.link=More Information
+#LOCALIZATION NOTE (details.notification.compatibility) %1$S is the add-on name, %2$S is brand name
+details.notification.compatibility=%1$S was not designed for %2$S. It may not function properly or cease to function.
+details.notification.compatibility.link=More Information
#LOCALIZATION NOTE (details.notification.softblocked) %1$S is the add-on name
details.notification.softblocked=%1$S is known to cause issues.
details.notification.softblocked.link=More Information
diff --git a/toolkit/locales/jar.mn b/toolkit/locales/jar.mn
index ad93985f1..5d9da5224 100644
--- a/toolkit/locales/jar.mn
+++ b/toolkit/locales/jar.mn
@@ -11,10 +11,8 @@
locale/@AB_CD@/global/aboutReader.properties (%chrome/global/aboutReader.properties)
locale/@AB_CD@/global/aboutRights.dtd (%chrome/global/aboutRights.dtd)
locale/@AB_CD@/global/aboutNetworking.dtd (%chrome/global/aboutNetworking.dtd)
-#ifndef ANDROID
locale/@AB_CD@/global/aboutProfiles.dtd (%chrome/global/aboutProfiles.dtd)
locale/@AB_CD@/global/aboutProfiles.properties (%chrome/global/aboutProfiles.properties)
-#endif
locale/@AB_CD@/global/aboutServiceWorkers.dtd (%chrome/global/aboutServiceWorkers.dtd)
locale/@AB_CD@/global/aboutServiceWorkers.properties (%chrome/global/aboutServiceWorkers.properties)
locale/@AB_CD@/global/aboutSupport.dtd (%chrome/global/aboutSupport.dtd)
diff --git a/toolkit/locales/update.locale b/toolkit/locales/update.locale
deleted file mode 100644
index 7c1f386ee..000000000
--- a/toolkit/locales/update.locale
+++ /dev/null
@@ -1 +0,0 @@
-%AB_CD%
diff --git a/toolkit/modules/AppConstants.jsm b/toolkit/modules/AppConstants.jsm
index 40ceb15ba..41b398efc 100644
--- a/toolkit/modules/AppConstants.jsm
+++ b/toolkit/modules/AppConstants.jsm
@@ -187,13 +187,6 @@ MOZ_SAFE_BROWSING:
false,
#endif
- MOZ_SYSTEM_NSS:
-#ifdef MOZ_SYSTEM_NSS
- true,
-#else
- false,
-#endif
-
MOZ_PLACES:
#ifdef MOZ_PLACES
true,
diff --git a/toolkit/modules/ExtensionStorage.jsm b/toolkit/modules/ExtensionStorage.jsm
new file mode 100644
index 000000000..0b0ffb000
--- /dev/null
+++ b/toolkit/modules/ExtensionStorage.jsm
@@ -0,0 +1,241 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+"use strict";
+
+this.EXPORTED_SYMBOLS = ["ExtensionStorage"];
+
+const Ci = Components.interfaces;
+const Cc = Components.classes;
+const Cu = Components.utils;
+const Cr = Components.results;
+
+Cu.import("resource://gre/modules/XPCOMUtils.jsm");
+Cu.import("resource://gre/modules/Services.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "OS",
+ "resource://gre/modules/osfile.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "AsyncShutdown",
+ "resource://gre/modules/AsyncShutdown.jsm");
+
+function jsonReplacer(key, value) {
+ switch (typeof(value)) {
+ // Serialize primitive types as-is.
+ case "string":
+ case "number":
+ case "boolean":
+ return value;
+
+ case "object":
+ if (value === null) {
+ return value;
+ }
+
+ switch (Cu.getClassName(value, true)) {
+ // Serialize arrays and ordinary objects as-is.
+ case "Array":
+ case "Object":
+ return value;
+
+ // Serialize Date objects and regular expressions as their
+ // string representations.
+ case "Date":
+ case "RegExp":
+ return String(value);
+ }
+ break;
+ }
+
+ if (!key) {
+ // If this is the root object, and we can't serialize it, serialize
+ // the value to an empty object.
+ return {};
+ }
+
+ // Everything else, omit entirely.
+ return undefined;
+}
+
+this.ExtensionStorage = {
+ cache: new Map(),
+ listeners: new Map(),
+
+ /**
+ * Sanitizes the given value, and returns a JSON-compatible
+ * representation of it, based on the privileges of the given global.
+ *
+ * @param {value} value
+ * The value to sanitize.
+ * @param {Context} context
+ * The extension context in which to sanitize the value
+ * @returns {value}
+ * The sanitized value.
+ */
+ sanitize(value, context) {
+ let json = context.jsonStringify(value, jsonReplacer);
+ return JSON.parse(json);
+ },
+
+ getExtensionDir(extensionId) {
+ return OS.Path.join(this.extensionDir, extensionId);
+ },
+
+ getStorageFile(extensionId) {
+ return OS.Path.join(this.extensionDir, extensionId, "storage.js");
+ },
+
+ read(extensionId) {
+ if (this.cache.has(extensionId)) {
+ return this.cache.get(extensionId);
+ }
+
+ let path = this.getStorageFile(extensionId);
+ let decoder = new TextDecoder();
+ let promise = OS.File.read(path);
+ promise = promise.then(array => {
+ return JSON.parse(decoder.decode(array));
+ }).catch((error) => {
+ if (!error.becauseNoSuchFile) {
+ Cu.reportError("Unable to parse JSON data for extension storage.");
+ }
+ return {};
+ });
+ this.cache.set(extensionId, promise);
+ return promise;
+ },
+
+ write(extensionId) {
+ let promise = this.read(extensionId).then(extData => {
+ let encoder = new TextEncoder();
+ let array = encoder.encode(JSON.stringify(extData));
+ let path = this.getStorageFile(extensionId);
+ OS.File.makeDir(this.getExtensionDir(extensionId), {
+ ignoreExisting: true,
+ from: OS.Constants.Path.profileDir,
+ });
+ let promise = OS.File.writeAtomic(path, array);
+ return promise;
+ }).catch(() => {
+ // Make sure this promise is never rejected.
+ Cu.reportError("Unable to write JSON data for extension storage.");
+ });
+
+ AsyncShutdown.profileBeforeChange.addBlocker(
+ "ExtensionStorage: Finish writing extension data",
+ promise);
+
+ return promise.then(() => {
+ AsyncShutdown.profileBeforeChange.removeBlocker(promise);
+ });
+ },
+
+ set(extensionId, items, context) {
+ return this.read(extensionId).then(extData => {
+ let changes = {};
+ for (let prop in items) {
+ let item = this.sanitize(items[prop], context);
+ changes[prop] = {oldValue: extData[prop], newValue: item};
+ extData[prop] = item;
+ }
+
+ this.notifyListeners(extensionId, changes);
+
+ return this.write(extensionId);
+ });
+ },
+
+ remove(extensionId, items) {
+ return this.read(extensionId).then(extData => {
+ let changes = {};
+ for (let prop of [].concat(items)) {
+ changes[prop] = {oldValue: extData[prop]};
+ delete extData[prop];
+ }
+
+ this.notifyListeners(extensionId, changes);
+
+ return this.write(extensionId);
+ });
+ },
+
+ clear(extensionId) {
+ return this.read(extensionId).then(extData => {
+ let changes = {};
+ for (let prop of Object.keys(extData)) {
+ changes[prop] = {oldValue: extData[prop]};
+ delete extData[prop];
+ }
+
+ this.notifyListeners(extensionId, changes);
+
+ return this.write(extensionId);
+ });
+ },
+
+ get(extensionId, keys) {
+ return this.read(extensionId).then(extData => {
+ let result = {};
+ if (keys === null) {
+ Object.assign(result, extData);
+ } else if (typeof(keys) == "object" && !Array.isArray(keys)) {
+ for (let prop in keys) {
+ if (prop in extData) {
+ result[prop] = extData[prop];
+ } else {
+ result[prop] = keys[prop];
+ }
+ }
+ } else {
+ for (let prop of [].concat(keys)) {
+ if (prop in extData) {
+ result[prop] = extData[prop];
+ }
+ }
+ }
+
+ return result;
+ });
+ },
+
+ addOnChangedListener(extensionId, listener) {
+ let listeners = this.listeners.get(extensionId) || new Set();
+ listeners.add(listener);
+ this.listeners.set(extensionId, listeners);
+ },
+
+ removeOnChangedListener(extensionId, listener) {
+ let listeners = this.listeners.get(extensionId);
+ listeners.delete(listener);
+ },
+
+ notifyListeners(extensionId, changes) {
+ let listeners = this.listeners.get(extensionId);
+ if (listeners) {
+ for (let listener of listeners) {
+ listener(changes);
+ }
+ }
+ },
+
+ init() {
+ if (Services.appinfo.processType != Services.appinfo.PROCESS_TYPE_DEFAULT) {
+ return;
+ }
+ Services.obs.addObserver(this, "extension-invalidate-storage-cache", false);
+ Services.obs.addObserver(this, "xpcom-shutdown", false);
+ },
+
+ observe(subject, topic, data) {
+ if (topic == "xpcom-shutdown") {
+ Services.obs.removeObserver(this, "extension-invalidate-storage-cache");
+ Services.obs.removeObserver(this, "xpcom-shutdown");
+ } else if (topic == "extension-invalidate-storage-cache") {
+ this.cache.clear();
+ }
+ },
+};
+
+XPCOMUtils.defineLazyGetter(ExtensionStorage, "extensionDir",
+ () => OS.Path.join(OS.Constants.Path.profileDir, "browser-extension-data"));
+
+ExtensionStorage.init();
diff --git a/toolkit/modules/LightweightThemeConsumer.jsm b/toolkit/modules/LightweightThemeConsumer.jsm
index cd456eac2..325f711b7 100644
--- a/toolkit/modules/LightweightThemeConsumer.jsm
+++ b/toolkit/modules/LightweightThemeConsumer.jsm
@@ -8,7 +8,6 @@ const {utils: Cu} = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "LightweightThemeImageOptimizer",
"resource://gre/modules/addons/LightweightThemeImageOptimizer.jsm");
@@ -148,12 +147,13 @@ LightweightThemeConsumer.prototype = {
footer.removeAttribute("lwthemefooter");
}
+#ifdef XP_MACOSX
// On OS X, we extend the lightweight theme into the titlebar, which means setting
// the chromemargin attribute. Some XUL applications already draw in the titlebar,
// so we need to save the chromemargin value before we overwrite it with the value
// that lets us draw in the titlebar. We stash this value on the root attribute so
// that XUL applications have the ability to invalidate the saved value.
- if (AppConstants.platform == "macosx" && stateChanging) {
+ if (stateChanging) {
if (!root.hasAttribute("chromemargin-nonlwtheme")) {
root.setAttribute("chromemargin-nonlwtheme", root.getAttribute("chromemargin"));
}
@@ -169,6 +169,7 @@ LightweightThemeConsumer.prototype = {
}
}
}
+#endif
Services.obs.notifyObservers(this._win, "lightweight-theme-window-updated",
JSON.stringify(aData));
}
diff --git a/toolkit/modules/ResetProfile.jsm b/toolkit/modules/ResetProfile.jsm
index c1839af4f..25ab8b966 100644
--- a/toolkit/modules/ResetProfile.jsm
+++ b/toolkit/modules/ResetProfile.jsm
@@ -9,14 +9,21 @@ this.EXPORTED_SYMBOLS = ["ResetProfile"];
const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
-// For Basilisk and Pale Moon
-// Hard-code MOZ_APP_NAME to firefox because of hard-coded type in migrator.
-const MOZ_APP_NAME = (((AppConstants.MOZ_APP_NAME == "basilisk")
- || (AppConstants.MOZ_APP_NAME == "palemoon"))
- ? "firefox" : AppConstants.MOZ_APP_NAME);
-const MOZ_BUILD_APP = AppConstants.MOZ_BUILD_APP;
+// We need to tell the migrator that many different applications are Mozilla applications
+#ifdef MOZ_PHOENIX
+const MOZ_APP_NAME = "firefox";
+const MOZ_BUILD_APP = "browser";
+#elifdef MOZ_THUNDERBIRD
+const MOZ_APP_NAME = "thunderbird";
+const MOZ_BUILD_APP = "mail";
+#elif defined(MOZ_SUITE) && !defined(BINOC_BOREALIS)
+const MOZ_APP_NAME = "seamonkey";
+const MOZ_BUILD_APP = "suite";
+#else
+#expand const MOZ_APP_NAME = "__MOZ_APP_NAME__";
+#expand const MOZ_BUILD_APP = "__MOZ_BUILD_APP__".match(/([^\/]*)\/*$/)[1];
+#endif
this.ResetProfile = {
/**
diff --git a/toolkit/modules/Services.jsm b/toolkit/modules/Services.jsm
index 1796acd4c..09e5df077 100644
--- a/toolkit/modules/Services.jsm
+++ b/toolkit/modules/Services.jsm
@@ -8,7 +8,6 @@ const Ci = Components.interfaces;
const Cc = Components.classes;
const Cr = Components.results;
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
this.Services = {};
@@ -52,9 +51,6 @@ XPCOMUtils.defineLazyGetter(Services, "ppmm", () => {
});
var initTable = [
-#ifdef MOZ_WIDGET_ANDROID
- ["androidBridge", "@mozilla.org/android/bridge;1", "nsIAndroidBridge"],
-#endif
["appShell", "@mozilla.org/appshell/appShellService;1", "nsIAppShellService"],
["cache", "@mozilla.org/network/cache-service;1", "nsICacheService"],
["cache2", "@mozilla.org/netwerk/cache-storage-service;1", "nsICacheStorageService"],
diff --git a/toolkit/modules/UpdateUtils.jsm b/toolkit/modules/UpdateUtils.jsm
index 4c6e7776d..5acf395d3 100644
--- a/toolkit/modules/UpdateUtils.jsm
+++ b/toolkit/modules/UpdateUtils.jsm
@@ -3,178 +3,97 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#filter substitution
+#if !MOZ_PKG_SPECIAL
+#define MOZ_PKG_SPECIAL false
+#endif
this.EXPORTED_SYMBOLS = ["UpdateUtils"];
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
+#ifdef XP_WIN
Cu.import("resource://gre/modules/ctypes.jsm");
+Cu.import("resource://gre/modules/WindowsRegistry.jsm");
-const FILE_UPDATE_LOCALE = "update.locale";
+const WINREG_HKLM = Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE;
+const WINREG_WINNT = "Software\\Microsoft\\Windows NT\\CurrentVersion";
+#endif
const PREF_APP_DISTRIBUTION = "distribution.id";
const PREF_APP_DISTRIBUTION_VERSION = "distribution.version";
-const PREF_APP_B2G_VERSION = "b2g.version";
+const PREF_APP_UPDATE_CHANNEL = "app.update.channel";
const PREF_APP_UPDATE_CUSTOM = "app.update.custom";
const PREF_APP_UPDATE_IMEI_HASH = "app.update.imei_hash";
-
+const PREF_LOCALE = "general.useragent.locale";
this.UpdateUtils = {
- /**
- * Read the update channel from defaults only. We do this to ensure that
- * the channel is tightly coupled with the application and does not apply
- * to other instances of the application that may use the same profile.
- *
- * @param [optional] aIncludePartners
- * Whether or not to include the partner bits. Default: true.
- */
- getUpdateChannel(aIncludePartners = true) {
- let defaults = Services.prefs.getDefaultBranch(null);
- let channel = defaults.getCharPref("app.update.channel",
- AppConstants.MOZ_UPDATE_CHANNEL);
-
- if (aIncludePartners) {
- try {
- let partners = Services.prefs.getChildList("app.partner.").sort();
- if (partners.length) {
- channel += "-cck";
- partners.forEach(function (prefName) {
- channel += "-" + Services.prefs.getCharPref(prefName);
- });
- }
- } catch (e) {
- Cu.reportError(e);
- }
- }
-
- return channel;
+ get UpdateChannel() {
+ return Services.prefs.getDefaultBranch(null)
+ .getCharPref(PREF_APP_UPDATE_CHANNEL, "@MOZ_UPDATE_CHANNEL@");
},
- get UpdateChannel() {
- return this.getUpdateChannel();
+ get Locale() {
+ return Services.prefs.getDefaultBranch(null)
+ .getCharPref(PREF_LOCALE, "en-US");
},
/**
* Formats a URL by replacing %...% values with OS, build and locale specific
* values.
*
- * @param url
+ * @param aUpdateURL
* The URL to format.
+ * @param aAdditionalSubsts
* @return The formatted URL.
*/
- formatUpdateURL(url) {
- url = url.replace(/%ID%/g, Services.appinfo.ID);
- url = url.replace(/%PRODUCT%/g, Services.appinfo.name);
- url = url.replace(/%VERSION%/g, Services.appinfo.version);
- url = url.replace(/%BUILD_ID%/g, Services.appinfo.appBuildID);
- url = url.replace(/%BUILD_TARGET%/g, Services.appinfo.OS + "_" + this.ABI);
- url = url.replace(/%OS_VERSION%/g, this.OSVersion);
- url = url.replace(/%WIDGET_TOOLKIT%/g, "@MOZ_WIDGET_TOOLKIT@");
- url = url.replace(/%CHANNEL%/g, this.UpdateChannel);
-
- if (/%LOCALE%/.test(url)) {
- url = url.replace(/%LOCALE%/g, this.Locale);
- }
-
- url = url.replace(/%CUSTOM%/g, Preferences.get(PREF_APP_UPDATE_CUSTOM, ""));
- url = url.replace(/\+/g, "%2B");
-
- url = url.replace(/%SYSTEM_CAPABILITIES%/g, gSystemCapabilities);
- url = url.replace(/%PLATFORM_VERSION%/g, Services.appinfo.platformVersion);
- url = url.replace(/%DISTRIBUTION%/g,
- getDistributionPrefValue(PREF_APP_DISTRIBUTION));
- url = url.replace(/%DISTRIBUTION_VERSION%/g,
- getDistributionPrefValue(PREF_APP_DISTRIBUTION_VERSION));
-
- return url;
- }
-};
-
-/* Get the distribution pref values, from defaults only */
-function getDistributionPrefValue(aPrefName) {
- return prefValue = Services.prefs.getDefaultBranch(null).getCharPref(aPrefName, "default");
-}
-
-/**
- * Gets the locale from the update.locale file for replacing %LOCALE% in the
- * update url. The update.locale file can be located in the application
- * directory or the GRE directory with preference given to it being located in
- * the application directory.
- */
-XPCOMUtils.defineLazyGetter(UpdateUtils, "Locale", function() {
- let channel;
- let locale;
- for (let res of ['app', 'gre']) {
- channel = NetUtil.newChannel({
- uri: "resource://" + res + "/" + FILE_UPDATE_LOCALE,
- contentPolicyType: Ci.nsIContentPolicy.TYPE_INTERNAL_XMLHTTPREQUEST,
- loadUsingSystemPrincipal: true
- });
- try {
- let inputStream = channel.open2();
- locale = NetUtil.readInputStreamToString(inputStream, inputStream.available());
- } catch (e) {}
- if (locale)
- return locale.trim();
- }
-
- Cu.reportError(FILE_UPDATE_LOCALE + " file doesn't exist in either the " +
- "application or GRE directories");
-
- return null;
-});
-
-/**
- * Provides adhoc system capability information for application update.
- */
-XPCOMUtils.defineLazyGetter(this, "gSystemCapabilities", function aus_gSC() {
- if (AppConstants.platform == "win") {
- const PF_MMX_INSTRUCTIONS_AVAILABLE = 3; // MMX
- const PF_XMMI_INSTRUCTIONS_AVAILABLE = 6; // SSE
- const PF_XMMI64_INSTRUCTIONS_AVAILABLE = 10; // SSE2
- const PF_SSE3_INSTRUCTIONS_AVAILABLE = 13; // SSE3
-
- let lib = ctypes.open("kernel32.dll");
- let IsProcessorFeaturePresent = lib.declare("IsProcessorFeaturePresent",
- ctypes.winapi_abi,
- ctypes.int32_t, /* success */
- ctypes.uint32_t); /* DWORD */
- let instructionSet = "unknown";
- try {
- if (IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) {
- instructionSet = "SSE3";
- } else if (IsProcessorFeaturePresent(PF_XMMI64_INSTRUCTIONS_AVAILABLE)) {
- instructionSet = "SSE2";
- } else if (IsProcessorFeaturePresent(PF_XMMI_INSTRUCTIONS_AVAILABLE)) {
- instructionSet = "SSE";
- } else if (IsProcessorFeaturePresent(PF_MMX_INSTRUCTIONS_AVAILABLE)) {
- instructionSet = "MMX";
+ formatUpdateURL: function(aUpdateURL, aAdditionalSubsts = null) {
+ // We want to be able to accept additional substs but also to have them be able to
+ // override the default ones below
+ if (aAdditionalSubsts) {
+ try {
+ aAdditionalSubsts.forEach(([_subst, _value]) => aUpdateURL = aUpdateURL.replace(_subst, _value));
+ } catch(ex) {
+ Cu.reportError(ex);
}
- } catch (e) {
- instructionSet = "error";
- Cu.reportError("Error getting processor instruction set. " +
- "Exception: " + e);
}
- lib.close();
- return instructionSet;
- }
-
- if (AppConstants == "linux") {
- let instructionSet = "unknown";
- if (navigator.cpuHasSSE2) {
- instructionSet = "SSE2";
- }
- return instructionSet;
+ // appName SHOULD be lower case and not contain spaces even if it has in the past
+ let appName = Services.appinfo.name.replace(/\s+/g, '').toLowerCase()
+
+ // We want default pref values if they exist
+ let prefBranch = Services.prefs.getDefaultBranch(null)
+ let custom = prefBranch.getCharPref(PREF_APP_UPDATE_CUSTOM, "");
+ let distribution = prefBranch.getCharPref(PREF_APP_DISTRIBUTION, "default");
+ let distributionVersion = prefBranch.getCharPref(PREF_APP_DISTRIBUTION_VERSION, "default");
+
+ let substs = [
+ [/%ID%/g, Services.appinfo.ID],
+ [/%PRODUCT%/g, appName],
+ [/%VERSION%/g, Services.appinfo.version],
+ [/%BUILD_ID%/g, Services.appinfo.appBuildID],
+ [/%BUILD_TARGET%/g, Services.appinfo.OS + "_" + this.ABI],
+ [/%BUILD_SPECIAL%/g, "@MOZ_PKG_SPECIAL@"],
+ [/%OS_VERSION%/g, this.OSVersion],
+ [/%WIDGET_TOOLKIT%/g, "@MOZ_WIDGET_TOOLKIT@"],
+ [/%CHANNEL%/g, this.UpdateChannel],
+ [/%CUSTOM%/g, custom],
+ [/%PLATFORM_VERSION%/g, Services.appinfo.platformVersion],
+ [/%DISTRIBUTION%/g, distribution],
+ [/%DISTRIBUTION_VERSION%/g, distributionVersion],
+ [/%LOCALE%/g, this.Locale]
+ ];
+
+ substs.forEach(([_subst, _value]) => aUpdateURL = aUpdateURL.replace(_subst, _value));
+
+ // We do this last to make sure all pluses are converted
+ aUpdateURL = aUpdateURL.replace(/\+/g, "%2B");
+
+ return aUpdateURL;
}
+};
- return "NA"
-});
-
+#ifdef XP_WIN
/* Windows only getter that returns the processor architecture. */
XPCOMUtils.defineLazyGetter(this, "gWinCPUArch", function aus_gWinCPUArch() {
// Get processor architecture
@@ -187,24 +106,24 @@ XPCOMUtils.defineLazyGetter(this, "gWinCPUArch", function aus_gWinCPUArch() {
// http://msdn.microsoft.com/en-us/library/ms724958%28v=vs.85%29.aspx
const SYSTEM_INFO = new ctypes.StructType('SYSTEM_INFO',
[
- {wProcessorArchitecture: WORD},
- {wReserved: WORD},
- {dwPageSize: DWORD},
- {lpMinimumApplicationAddress: ctypes.voidptr_t},
- {lpMaximumApplicationAddress: ctypes.voidptr_t},
- {dwActiveProcessorMask: DWORD.ptr},
- {dwNumberOfProcessors: DWORD},
- {dwProcessorType: DWORD},
- {dwAllocationGranularity: DWORD},
- {wProcessorLevel: WORD},
- {wProcessorRevision: WORD}
+ {wProcessorArchitecture: WORD},
+ {wReserved: WORD},
+ {dwPageSize: DWORD},
+ {lpMinimumApplicationAddress: ctypes.voidptr_t},
+ {lpMaximumApplicationAddress: ctypes.voidptr_t},
+ {dwActiveProcessorMask: DWORD.ptr},
+ {dwNumberOfProcessors: DWORD},
+ {dwProcessorType: DWORD},
+ {dwAllocationGranularity: DWORD},
+ {wProcessorLevel: WORD},
+ {wProcessorRevision: WORD}
]);
let kernel32 = false;
try {
kernel32 = ctypes.open("Kernel32");
- } catch (e) {
- Cu.reportError("Unable to open kernel32! Exception: " + e);
+ } catch (ex) {
+ Cu.reportError("Unable to open kernel32! Exception: " + ex);
}
if (kernel32) {
@@ -229,9 +148,9 @@ XPCOMUtils.defineLazyGetter(this, "gWinCPUArch", function aus_gWinCPUArch() {
arch = "x86";
break;
}
- } catch (e) {
+ } catch (ex) {
Cu.reportError("Error getting processor architecture. " +
- "Exception: " + e);
+ "Exception: " + ex);
} finally {
kernel32.close();
}
@@ -239,29 +158,27 @@ XPCOMUtils.defineLazyGetter(this, "gWinCPUArch", function aus_gWinCPUArch() {
return arch;
});
+#endif
XPCOMUtils.defineLazyGetter(UpdateUtils, "ABI", function() {
let abi = null;
try {
abi = Services.appinfo.XPCOMABI;
- }
- catch (e) {
+ } catch (ex) {
Cu.reportError("XPCOM ABI unknown");
}
- if (AppConstants.platform == "macosx") {
- // Mac universal build should report a different ABI than either macppc
- // or mactel.
- let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].
- getService(Ci.nsIMacUtils);
+#ifdef XP_MACOSX
+ // Mac universal build should report a different ABI than either macppc
+ // or mactel.
+ let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].
+ getService(Ci.nsIMacUtils);
- if (macutils.isUniversalBinary) {
- abi += "-u-" + macutils.architecturesInBinary;
- }
- } else if (AppConstants.platform == "win") {
- // Windows build should report the CPU architecture that it's running on.
- abi += "-" + gWinCPUArch;
+ if (macutils.isUniversalBinary) {
+ abi += "-u-" + macutils.architecturesInBinary;
}
+#endif
+
return abi;
});
@@ -270,100 +187,34 @@ XPCOMUtils.defineLazyGetter(UpdateUtils, "OSVersion", function() {
try {
osVersion = Services.sysinfo.getProperty("name") + " " +
Services.sysinfo.getProperty("version");
- }
- catch (e) {
+ } catch(ex) {
Cu.reportError("OS Version unknown.");
}
+#ifdef XP_WIN
if (osVersion) {
- if (AppConstants.platform == "win") {
- const BYTE = ctypes.uint8_t;
- const WORD = ctypes.uint16_t;
- const DWORD = ctypes.uint32_t;
- const WCHAR = ctypes.char16_t;
- const BOOL = ctypes.int;
-
- // This structure is described at:
- // http://msdn.microsoft.com/en-us/library/ms724833%28v=vs.85%29.aspx
- const SZCSDVERSIONLENGTH = 128;
- const OSVERSIONINFOEXW = new ctypes.StructType('OSVERSIONINFOEXW',
- [
- {dwOSVersionInfoSize: DWORD},
- {dwMajorVersion: DWORD},
- {dwMinorVersion: DWORD},
- {dwBuildNumber: DWORD},
- {dwPlatformId: DWORD},
- {szCSDVersion: ctypes.ArrayType(WCHAR, SZCSDVERSIONLENGTH)},
- {wServicePackMajor: WORD},
- {wServicePackMinor: WORD},
- {wSuiteMask: WORD},
- {wProductType: BYTE},
- {wReserved: BYTE}
- ]);
-
- // This structure is described at:
- // http://msdn.microsoft.com/en-us/library/ms724958%28v=vs.85%29.aspx
- const SYSTEM_INFO = new ctypes.StructType('SYSTEM_INFO',
- [
- {wProcessorArchitecture: WORD},
- {wReserved: WORD},
- {dwPageSize: DWORD},
- {lpMinimumApplicationAddress: ctypes.voidptr_t},
- {lpMaximumApplicationAddress: ctypes.voidptr_t},
- {dwActiveProcessorMask: DWORD.ptr},
- {dwNumberOfProcessors: DWORD},
- {dwProcessorType: DWORD},
- {dwAllocationGranularity: DWORD},
- {wProcessorLevel: WORD},
- {wProcessorRevision: WORD}
- ]);
-
- let kernel32 = false;
- try {
- kernel32 = ctypes.open("Kernel32");
- } catch (e) {
- Cu.reportError("Unable to open kernel32! " + e);
- osVersion += ".unknown (unknown)";
- }
-
- if (kernel32) {
- try {
- // Get Service pack info
- try {
- let GetVersionEx = kernel32.declare("GetVersionExW",
- ctypes.default_abi,
- BOOL,
- OSVERSIONINFOEXW.ptr);
- let winVer = OSVERSIONINFOEXW();
- winVer.dwOSVersionInfoSize = OSVERSIONINFOEXW.size;
-
- if (0 !== GetVersionEx(winVer.address())) {
- osVersion += "." + winVer.wServicePackMajor +
- "." + winVer.wServicePackMinor;
- } else {
- Cu.reportError("Unknown failure in GetVersionEX (returned 0)");
- osVersion += ".unknown";
- }
- } catch (e) {
- Cu.reportError("Error getting service pack information. Exception: " + e);
- osVersion += ".unknown";
- }
- } finally {
- kernel32.close();
- }
-
- // Add processor architecture
- osVersion += " (" + gWinCPUArch + ")";
- }
+ let currentBuild = WindowsRegistry.readRegKey(WINREG_HKLM, WINREG_WINNT, "CurrentBuild");
+ let CSDBuildNumber = WindowsRegistry.readRegKey(WINREG_HKLM, WINREG_WINNT, "CSDBuildNumber");
+
+ if (!CSDBuildNumber) {
+ CSDBuildNumber = "0";
}
- try {
- osVersion += " (" + Services.sysinfo.getProperty("secondaryLibrary") + ")";
- }
- catch (e) {
- // Not all platforms have a secondary widget library, so an error is nothing to worry about.
- }
- osVersion = encodeURIComponent(osVersion);
+ osVersion = osVersion.replace(/Windows_NT/g, "WINNT");
+ osVersion += "." + currentBuild + "." + CSDBuildNumber
+
+ // Add processor architecture
+ osVersion += " (" + gWinCPUArch + ")";
+ }
+#endif
+
+ try {
+ osVersion += " (" + Services.sysinfo.getProperty("secondaryLibrary") + ")";
+ } catch(ex) {
+ // Not all platforms have a secondary widget library, so an error is nothing to worry about.
}
+
+ osVersion = encodeURIComponent(osVersion);
+
return osVersion;
});
diff --git a/toolkit/modules/WindowDraggingUtils.jsm b/toolkit/modules/WindowDraggingUtils.jsm
index 0cc2e88e9..a7986c8b4 100644
--- a/toolkit/modules/WindowDraggingUtils.jsm
+++ b/toolkit/modules/WindowDraggingUtils.jsm
@@ -2,9 +2,11 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
-
-const HAVE_CSS_WINDOW_DRAG_SUPPORT = ["win", "macosx"].includes(AppConstants.platform);
+#if defined(XP_WIN) || defined(XP_MACOSX)
+const HAVE_CSS_WINDOW_DRAG_SUPPORT = true;
+#else
+const HAVE_CSS_WINDOW_DRAG_SUPPORT = false;
+#endif
this.EXPORTED_SYMBOLS = [ "WindowDraggingElement" ];
@@ -62,12 +64,13 @@ WindowDraggingElement.prototype = {
if (!this.shouldDrag(aEvent))
return;
- if (/^gtk/i.test(AppConstants.MOZ_WIDGET_TOOLKIT)) {
- // On GTK, there is a toolkit-level function which handles
- // window dragging, which must be used.
- this._window.beginWindowMove(aEvent, isPanel ? this._elem : null);
- break;
- }
+#ifdef MOZ_WIDGET_GTK
+ // On GTK, there is a toolkit-level function which handles
+ // window dragging, which must be used.
+ this._window.beginWindowMove(aEvent, isPanel ? this._elem : null);
+ break;
+#endif
+
if (isPanel) {
let screenRect = this._elem.getOuterScreenRect();
this._deltaX = aEvent.screenX - screenRect.left;
diff --git a/toolkit/modules/addons/.eslintrc.js b/toolkit/modules/addons/.eslintrc.js
index 019759c87..32c92be0a 100644
--- a/toolkit/modules/addons/.eslintrc.js
+++ b/toolkit/modules/addons/.eslintrc.js
@@ -8,7 +8,6 @@ module.exports = { // eslint-disable-line no-undef
"addMessageListener": false,
"removeEventListener": false,
"sendAsyncMessage": false,
- "AddonManagerPermissions": false,
"initialProcessData": true,
},
diff --git a/toolkit/modules/addons/WebRequest.jsm b/toolkit/modules/addons/WebRequest.jsm
index c720dae5d..26118e43f 100644
--- a/toolkit/modules/addons/WebRequest.jsm
+++ b/toolkit/modules/addons/WebRequest.jsm
@@ -19,8 +19,6 @@ Cu.import("resource://gre/modules/Services.jsm");
Cu.import("resource://gre/modules/Task.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "BrowserUtils",
"resource://gre/modules/BrowserUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "ExtensionUtils",
@@ -720,11 +718,7 @@ HttpObserverManager = {
try {
let result = callback(data);
- if (result && typeof result === "object" && opts.blocking
- && !AddonManagerPermissions.isHostPermitted(uri.host)
- && (!loadInfo || !loadInfo.loadingPrincipal
- || !loadInfo.loadingPrincipal.URI
- || !AddonManagerPermissions.isHostPermitted(loadInfo.loadingPrincipal.URI.host))) {
+ if (result && typeof result === "object" && opts.blocking) {
handlerResults.push({opts, result});
}
} catch (e) {
@@ -846,9 +840,9 @@ var onBeforeRequest = {
get allowedOptions() {
delete this.allowedOptions;
this.allowedOptions = ["blocking"];
- if (!AppConstants.RELEASE_OR_BETA) {
- this.allowedOptions.push("requestBody");
- }
+#ifndef RELEASE_OR_BETA
+ this.allowedOptions.push("requestBody");
+#endif
return this.allowedOptions;
},
addListener(callback, filter = null, opt_extraInfoSpec = null) {
diff --git a/toolkit/modules/moz.build b/toolkit/modules/moz.build
index 4e647bd7f..8a364df8c 100644
--- a/toolkit/modules/moz.build
+++ b/toolkit/modules/moz.build
@@ -4,17 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-XPCSHELL_TESTS_MANIFESTS += ['tests/xpcshell/xpcshell.ini']
-BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
-MOCHITEST_MANIFESTS += ['tests/mochitest/mochitest.ini']
-MOCHITEST_CHROME_MANIFESTS += ['tests/chrome/chrome.ini']
-
-TESTING_JS_MODULES += [
- 'tests/MockDocument.jsm',
- 'tests/PromiseTestUtils.jsm',
- 'tests/xpcshell/TestIntegration.jsm',
-]
-
SPHINX_TREES['toolkit_modules'] = 'docs'
EXTRA_JS_MODULES += [
@@ -22,7 +11,6 @@ EXTRA_JS_MODULES += [
'addons/WebNavigation.jsm',
'addons/WebNavigationContent.js',
'addons/WebNavigationFrames.jsm',
- 'addons/WebRequest.jsm',
'addons/WebRequestCommon.jsm',
'addons/WebRequestContent.js',
'addons/WebRequestUpload.jsm',
@@ -40,6 +28,7 @@ EXTRA_JS_MODULES += [
'debug.js',
'DeferredTask.jsm',
'Deprecated.jsm',
+ 'ExtensionStorage.jsm',
'FileUtils.jsm',
'Finder.jsm',
'FinderHighlighter.jsm',
@@ -55,6 +44,7 @@ EXTRA_JS_MODULES += [
'Locale.jsm',
'Log.jsm',
'Memory.jsm',
+ 'NewTabUtils.jsm',
'NLP.jsm',
'ObjectUtils.jsm',
'PageMenu.jsm',
@@ -74,11 +64,7 @@ EXTRA_JS_MODULES += [
'RemotePageManager.jsm',
'RemoteSecurityUI.jsm',
'RemoteWebProgress.jsm',
- 'ResetProfile.jsm',
'ResponsivenessMonitor.jsm',
- 'secondscreen/PresentationApp.jsm',
- 'secondscreen/RokuApp.jsm',
- 'secondscreen/SimpleServiceDiscovery.jsm',
'SelectContentHelper.jsm',
'SelectParentHelper.jsm',
'ServiceRequest.jsm',
@@ -93,16 +79,17 @@ EXTRA_JS_MODULES += [
'Task.jsm',
'Timer.jsm',
'WebChannel.jsm',
- 'WindowDraggingUtils.jsm',
'ZipUtils.jsm',
]
EXTRA_JS_MODULES.third_party.jsesc += ['third_party/jsesc/jsesc.js']
EXTRA_JS_MODULES.sessionstore += ['sessionstore/Utils.jsm']
EXTRA_PP_JS_MODULES += [
- 'NewTabUtils.jsm',
+ 'addons/WebRequest.jsm',
+ 'ResetProfile.jsm',
'Troubleshoot.jsm',
'UpdateUtils.jsm',
+ 'WindowDraggingUtils.jsm',
]
if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'cocoa'):
@@ -119,16 +106,14 @@ EXTRA_PP_JS_MODULES += [
'Services.jsm',
]
-if 'Android' != CONFIG['OS_TARGET']:
- EXTRA_JS_MODULES += [
- 'LightweightThemeConsumer.jsm',
- ]
- DIRS += [
- 'subprocess',
- ]
-else:
- DEFINES['ANDROID'] = True
+EXTRA_PP_JS_MODULES += [
+ 'LightweightThemeConsumer.jsm',
+]
+
+DIRS += [
+ 'subprocess',
+]
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
@@ -142,13 +127,13 @@ for var in ('ANDROID_PACKAGE_NAME',
'MOZ_APP_VERSION_DISPLAY',
'MOZ_MACBUNDLE_NAME',
'MOZ_WIDGET_TOOLKIT',
+ 'MOZ_PKG_SPECIAL',
'DLL_PREFIX',
'DLL_SUFFIX',
'DEBUG_JS_MODULES'):
DEFINES[var] = CONFIG[var]
for var in ('MOZ_TOOLKIT_SEARCH',
- 'MOZ_SYSTEM_NSS',
'MOZ_UPDATER',
'MOZ_SWITCHBOARD'):
if CONFIG[var]:
diff --git a/toolkit/modules/secondscreen/PresentationApp.jsm b/toolkit/modules/secondscreen/PresentationApp.jsm
deleted file mode 100644
index b7d8e05a8..000000000
--- a/toolkit/modules/secondscreen/PresentationApp.jsm
+++ /dev/null
@@ -1,190 +0,0 @@
-// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["PresentationApp"];
-
-const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyGetter(this, "sysInfo", () => {
- return Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
-});
-
-const DEBUG = false;
-
-const STATE_UNINIT = "uninitialized" // RemoteMedia status
-const STATE_STARTED = "started"; // RemoteMedia status
-const STATE_PAUSED = "paused"; // RemoteMedia status
-const STATE_SHUTDOWN = "shutdown"; // RemoteMedia status
-
-function debug(msg) {
- Services.console.logStringMessage("PresentationApp: " + msg);
-}
-
-// PresentationApp is a wrapper for interacting with a Presentation Receiver Device.
-function PresentationApp(service, request) {
- this.service = service;
- this.request = request;
-}
-
-PresentationApp.prototype = {
- start: function start(callback) {
- this.request.startWithDevice(this.service.uuid)
- .then((session) => {
- this._session = session;
- if (callback) {
- session.addEventListener('connect', () => {
- callback(true);
- });
- }
- }, () => {
- if (callback) {
- callback(false);
- }
- });
- },
-
- stop: function stop(callback) {
- if (this._session && this._session.state === "connected") {
- this._session.terminate();
- }
-
- delete this._session;
-
- if (callback) {
- callback(true);
- }
- },
-
- remoteMedia: function remoteMedia(callback, listener) {
- if (callback) {
- if (!this._session) {
- callback();
- return;
- }
-
- callback(new RemoteMedia(this._session, listener));
- }
- }
-}
-
-/* RemoteMedia provides a wrapper for using Presentation API to control Firefox TV app.
- * The server implementation must be built into the Firefox TV receiver app.
- * see https://github.com/mozilla-b2g/gaia/tree/master/tv_apps/fling-player
- */
-function RemoteMedia(session, listener) {
- this._session = session ;
- this._listener = listener;
- this._status = STATE_UNINIT;
-
- this._session.addEventListener("message", this);
- this._session.addEventListener("terminate", this);
-
- if (this._listener && "onRemoteMediaStart" in this._listener) {
- Services.tm.mainThread.dispatch((function() {
- this._listener.onRemoteMediaStart(this);
- }).bind(this), Ci.nsIThread.DISPATCH_NORMAL);
- }
-}
-
-RemoteMedia.prototype = {
- _seq: 0,
-
- handleEvent: function(e) {
- switch (e.type) {
- case "message":
- this._onmessage(e);
- break;
- case "terminate":
- this._onterminate(e);
- break;
- }
- },
-
- _onmessage: function(e) {
- DEBUG && debug("onmessage: " + e.data);
- if (this.status === STATE_SHUTDOWN) {
- return;
- }
-
- if (e.data.indexOf("stopped") > -1) {
- if (this.status !== STATE_PAUSED) {
- this._status = STATE_PAUSED;
- if (this._listener && "onRemoteMediaStatus" in this._listener) {
- this._listener.onRemoteMediaStatus(this);
- }
- }
- } else if (e.data.indexOf("playing") > -1) {
- if (this.status !== STATE_STARTED) {
- this._status = STATE_STARTED;
- if (this._listener && "onRemoteMediaStatus" in this._listener) {
- this._listener.onRemoteMediaStatus(this);
- }
- }
- }
- },
-
- _onterminate: function(e) {
- DEBUG && debug("onterminate: " + this._session.state);
- this._status = STATE_SHUTDOWN;
- if (this._listener && "onRemoteMediaStop" in this._listener) {
- this._listener.onRemoteMediaStop(this);
- }
- },
-
- _sendCommand: function(command, data) {
- let msg = {
- 'type': command,
- 'seq': ++this._seq
- };
-
- if (data) {
- for (var k in data) {
- msg[k] = data[k];
- }
- }
-
- let raw = JSON.stringify(msg);
- DEBUG && debug("send command: " + raw);
-
- this._session.send(raw);
- },
-
- shutdown: function shutdown() {
- DEBUG && debug("RemoteMedia - shutdown");
- this._sendCommand("close");
- },
-
- play: function play() {
- DEBUG && debug("RemoteMedia - play");
- this._sendCommand("play");
- },
-
- pause: function pause() {
- DEBUG && debug("RemoteMedia - pause");
- this._sendCommand("pause");
- },
-
- load: function load(data) {
- DEBUG && debug("RemoteMedia - load: " + data);
- this._sendCommand("load", { "url": data.source });
-
- let deviceName;
- if (Services.appinfo.widgetToolkit == "android") {
- deviceName = sysInfo.get("device");
- } else {
- deviceName = sysInfo.get("host");
- }
- this._sendCommand("device-info", { "displayName": deviceName });
- },
-
- get status() {
- return this._status;
- }
-}
diff --git a/toolkit/modules/secondscreen/RokuApp.jsm b/toolkit/modules/secondscreen/RokuApp.jsm
deleted file mode 100644
index b37a688cd..000000000
--- a/toolkit/modules/secondscreen/RokuApp.jsm
+++ /dev/null
@@ -1,230 +0,0 @@
-// -*- indent-tabs-mode: nil; js-indent-level: 2 -*-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["RokuApp"];
-
-const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
-
-function log(msg) {
- // Services.console.logStringMessage(msg);
-}
-
-const PROTOCOL_VERSION = 1;
-
-/* RokuApp is a wrapper for interacting with a Roku channel.
- * The basic interactions all use a REST API.
- * spec: http://sdkdocs.roku.com/display/sdkdoc/External+Control+Guide
- */
-function RokuApp(service) {
- this.service = service;
- this.resourceURL = this.service.location;
- this.app = AppConstants.RELEASE_OR_BETA ? "Firefox" : "Firefox Nightly";
- this.mediaAppID = -1;
-}
-
-RokuApp.prototype = {
- status: function status(callback) {
- // We have no way to know if the app is running, so just return "unknown"
- // but we use this call to fetch the mediaAppID for the given app name
- let url = this.resourceURL + "query/apps";
- let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
- xhr.open("GET", url, true);
- xhr.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
- xhr.overrideMimeType("text/xml");
-
- xhr.addEventListener("load", (function() {
- if (xhr.status == 200) {
- let doc = xhr.responseXML;
- let apps = doc.querySelectorAll("app");
- for (let app of apps) {
- if (app.textContent == this.app) {
- this.mediaAppID = app.id;
- }
- }
- }
-
- // Since ECP has no way of telling us if an app is running, we always return "unknown"
- if (callback) {
- callback({ state: "unknown" });
- }
- }).bind(this), false);
-
- xhr.addEventListener("error", (function() {
- if (callback) {
- callback({ state: "unknown" });
- }
- }).bind(this), false);
-
- xhr.send(null);
- },
-
- start: function start(callback) {
- // We need to make sure we have cached the mediaAppID
- if (this.mediaAppID == -1) {
- this.status(function() {
- // If we found the mediaAppID, use it to make a new start call
- if (this.mediaAppID != -1) {
- this.start(callback);
- } else {
- // We failed to start the app, so let the caller know
- callback(false);
- }
- }.bind(this));
- return;
- }
-
- // Start a given app with any extra query data. Each app uses it's own data scheme.
- // NOTE: Roku will also pass "source=external-control" as a param
- let url = this.resourceURL + "launch/" + this.mediaAppID + "?version=" + parseInt(PROTOCOL_VERSION);
- let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
- xhr.open("POST", url, true);
- xhr.overrideMimeType("text/plain");
-
- xhr.addEventListener("load", (function() {
- if (callback) {
- callback(xhr.status === 200);
- }
- }).bind(this), false);
-
- xhr.addEventListener("error", (function() {
- if (callback) {
- callback(false);
- }
- }).bind(this), false);
-
- xhr.send(null);
- },
-
- stop: function stop(callback) {
- // Roku doesn't seem to support stopping an app, so let's just go back to
- // the Home screen
- let url = this.resourceURL + "keypress/Home";
- let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
- xhr.open("POST", url, true);
- xhr.overrideMimeType("text/plain");
-
- xhr.addEventListener("load", (function() {
- if (callback) {
- callback(xhr.status === 200);
- }
- }).bind(this), false);
-
- xhr.addEventListener("error", (function() {
- if (callback) {
- callback(false);
- }
- }).bind(this), false);
-
- xhr.send(null);
- },
-
- remoteMedia: function remoteMedia(callback, listener) {
- if (this.mediaAppID != -1) {
- if (callback) {
- callback(new RemoteMedia(this.resourceURL, listener));
- }
- } else if (callback) {
- callback();
- }
- }
-}
-
-/* RemoteMedia provides a wrapper for using TCP socket to control Roku apps.
- * The server implementation must be built into the Roku receiver app.
- */
-function RemoteMedia(url, listener) {
- this._url = url;
- this._listener = listener;
- this._status = "uninitialized";
-
- let serverURI = Services.io.newURI(this._url, null, null);
- this._socket = Cc["@mozilla.org/network/socket-transport-service;1"].getService(Ci.nsISocketTransportService).createTransport(null, 0, serverURI.host, 9191, null);
- this._outputStream = this._socket.openOutputStream(0, 0, 0);
-
- this._scriptableStream = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(Ci.nsIScriptableInputStream);
-
- this._inputStream = this._socket.openInputStream(0, 0, 0);
- this._pump = Cc["@mozilla.org/network/input-stream-pump;1"].createInstance(Ci.nsIInputStreamPump);
- this._pump.init(this._inputStream, -1, -1, 0, 0, true);
- this._pump.asyncRead(this, null);
-}
-
-RemoteMedia.prototype = {
- onStartRequest: function(request, context) {
- },
-
- onDataAvailable: function(request, context, stream, offset, count) {
- this._scriptableStream.init(stream);
- let data = this._scriptableStream.read(count);
- if (!data) {
- return;
- }
-
- let msg = JSON.parse(data);
- if (this._status === msg._s) {
- return;
- }
-
- this._status = msg._s;
-
- if (this._listener) {
- // Check to see if we are getting the initial "connected" message
- if (this._status == "connected" && "onRemoteMediaStart" in this._listener) {
- this._listener.onRemoteMediaStart(this);
- }
-
- if ("onRemoteMediaStatus" in this._listener) {
- this._listener.onRemoteMediaStatus(this);
- }
- }
- },
-
- onStopRequest: function(request, context, result) {
- if (this._listener && "onRemoteMediaStop" in this._listener)
- this._listener.onRemoteMediaStop(this);
- },
-
- _sendMsg: function _sendMsg(data) {
- if (!data)
- return;
-
- // Add the protocol version
- data["_v"] = PROTOCOL_VERSION;
-
- let raw = JSON.stringify(data);
- this._outputStream.write(raw, raw.length);
- },
-
- shutdown: function shutdown() {
- this._outputStream.close();
- this._inputStream.close();
- },
-
- get active() {
- return (this._socket && this._socket.isAlive());
- },
-
- play: function play() {
- // TODO: add position support
- this._sendMsg({ type: "PLAY" });
- },
-
- pause: function pause() {
- this._sendMsg({ type: "STOP" });
- },
-
- load: function load(data) {
- this._sendMsg({ type: "LOAD", title: data.title, source: data.source, poster: data.poster });
- },
-
- get status() {
- return this._status;
- }
-}
diff --git a/toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm b/toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm
deleted file mode 100644
index 4abc93ad1..000000000
--- a/toolkit/modules/secondscreen/SimpleServiceDiscovery.jsm
+++ /dev/null
@@ -1,432 +0,0 @@
-// -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*-
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["SimpleServiceDiscovery"];
-
-const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-
-var log = Cu.reportError;
-
-XPCOMUtils.defineLazyGetter(this, "converter", function () {
- let conv = Cc["@mozilla.org/intl/scriptableunicodeconverter"].createInstance(Ci.nsIScriptableUnicodeConverter);
- conv.charset = "utf8";
- return conv;
-});
-
-// Spec information:
-// https://tools.ietf.org/html/draft-cai-ssdp-v1-03
-// http://www.dial-multiscreen.org/dial-protocol-specification
-const SSDP_PORT = 1900;
-const SSDP_ADDRESS = "239.255.255.250";
-
-const SSDP_DISCOVER_PACKET =
- "M-SEARCH * HTTP/1.1\r\n" +
- "HOST: " + SSDP_ADDRESS + ":" + SSDP_PORT + "\r\n" +
- "MAN: \"ssdp:discover\"\r\n" +
- "MX: 2\r\n" +
- "ST: %SEARCH_TARGET%\r\n\r\n";
-
-const SSDP_DISCOVER_ATTEMPTS = 3;
-const SSDP_DISCOVER_DELAY = 500;
-const SSDP_DISCOVER_TIMEOUT_MULTIPLIER = 2;
-const SSDP_TRANSMISSION_INTERVAL = 1000;
-
-const EVENT_SERVICE_FOUND = "ssdp-service-found";
-const EVENT_SERVICE_LOST = "ssdp-service-lost";
-
-/*
- * SimpleServiceDiscovery manages any discovered SSDP services. It uses a UDP
- * broadcast to locate available services on the local network.
- */
-var SimpleServiceDiscovery = {
- get EVENT_SERVICE_FOUND() { return EVENT_SERVICE_FOUND; },
- get EVENT_SERVICE_LOST() { return EVENT_SERVICE_LOST; },
-
- _devices: new Map(),
- _services: new Map(),
- _searchSocket: null,
- _searchInterval: 0,
- _searchTimestamp: 0,
- _searchTimeout: Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer),
- _searchRepeat: Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer),
- _discoveryMethods: [],
-
- _forceTrailingSlash: function(aURL) {
- // Cleanup the URL to make it consistent across devices
- try {
- aURL = Services.io.newURI(aURL, null, null).spec;
- } catch (e) {}
- return aURL;
- },
-
- // nsIUDPSocketListener implementation
- onPacketReceived: function(aSocket, aMessage) {
- // Listen for responses from specific devices. There could be more than one
- // available.
- let response = aMessage.data.split("\n");
- let service = {};
- response.forEach(function(row) {
- let name = row.toUpperCase();
- if (name.startsWith("LOCATION")) {
- service.location = row.substr(10).trim();
- } else if (name.startsWith("ST")) {
- service.target = row.substr(4).trim();
- }
- }.bind(this));
-
- if (service.location && service.target) {
- service.location = this._forceTrailingSlash(service.location);
-
- // When we find a valid response, package up the service information
- // and pass it on.
- try {
- this._processService(service);
- } catch (e) {}
- }
- },
-
- onStopListening: function(aSocket, aStatus) {
- // This is fired when the socket is closed expectedly or unexpectedly.
- // nsITimer.cancel() is a no-op if the timer is not active.
- this._searchTimeout.cancel();
- this._searchSocket = null;
- },
-
- // Start a search. Make it continuous by passing an interval (in milliseconds).
- // This will stop a current search loop because the timer resets itself.
- // Returns the existing search interval.
- search: function search(aInterval) {
- let existingSearchInterval = this._searchInterval;
- if (aInterval > 0) {
- this._searchInterval = aInterval || 0;
- this._searchRepeat.initWithCallback(this._search.bind(this), this._searchInterval, Ci.nsITimer.TYPE_REPEATING_SLACK);
- }
- this._search();
- return existingSearchInterval;
- },
-
- // Stop the current continuous search
- stopSearch: function stopSearch() {
- this._searchRepeat.cancel();
- },
-
- _usingLAN: function() {
- let network = Cc["@mozilla.org/network/network-link-service;1"].getService(Ci.nsINetworkLinkService);
- return (network.linkType == Ci.nsINetworkLinkService.LINK_TYPE_WIFI ||
- network.linkType == Ci.nsINetworkLinkService.LINK_TYPE_ETHERNET ||
- network.linkType == Ci.nsINetworkLinkService.LINK_TYPE_UNKNOWN);
- },
-
- _search: function _search() {
- // If a search is already active, shut it down.
- this._searchShutdown();
-
- // We only search if on local network
- if (!this._usingLAN()) {
- return;
- }
-
- // Update the timestamp so we can use it to clean out stale services the
- // next time we search.
- this._searchTimestamp = Date.now();
-
- // Look for any fixed IP devices. Some routers might be configured to block
- // UDP broadcasts, so this is a way to skip discovery.
- this._searchFixedDevices();
-
- // Look for any devices via registered external discovery mechanism.
- this._startExternalDiscovery();
-
- // Perform a UDP broadcast to search for SSDP devices
- let socket = Cc["@mozilla.org/network/udp-socket;1"].createInstance(Ci.nsIUDPSocket);
- try {
- socket.init(SSDP_PORT, false, Services.scriptSecurityManager.getSystemPrincipal());
- socket.joinMulticast(SSDP_ADDRESS);
- socket.asyncListen(this);
- } catch (e) {
- // We were unable to create the broadcast socket. Just return, but don't
- // kill the interval timer. This might work next time.
- log("failed to start socket: " + e);
- return;
- }
-
- // Make the timeout SSDP_DISCOVER_TIMEOUT_MULTIPLIER times as long as the time needed to send out the discovery packets.
- const SSDP_DISCOVER_TIMEOUT = this._devices.size * SSDP_DISCOVER_ATTEMPTS * SSDP_TRANSMISSION_INTERVAL * SSDP_DISCOVER_TIMEOUT_MULTIPLIER;
- this._searchSocket = socket;
- this._searchTimeout.initWithCallback(this._searchShutdown.bind(this), SSDP_DISCOVER_TIMEOUT, Ci.nsITimer.TYPE_ONE_SHOT);
-
- let data = SSDP_DISCOVER_PACKET;
-
- // Send discovery packets out at 1 per SSDP_TRANSMISSION_INTERVAL and send each SSDP_DISCOVER_ATTEMPTS times
- // to allow for packet loss on noisy networks.
- let timeout = SSDP_DISCOVER_DELAY;
- for (let attempts = 0; attempts < SSDP_DISCOVER_ATTEMPTS; attempts++) {
- for (let [key, device] of this._devices) {
- let target = device.target;
- setTimeout(function() {
- let msgData = data.replace("%SEARCH_TARGET%", target);
- try {
- let msgRaw = converter.convertToByteArray(msgData);
- socket.send(SSDP_ADDRESS, SSDP_PORT, msgRaw, msgRaw.length);
- } catch (e) {
- log("failed to convert to byte array: " + e);
- }
- }, timeout);
- timeout += SSDP_TRANSMISSION_INTERVAL;
- }
- }
- },
-
- _searchFixedDevices: function _searchFixedDevices() {
- let fixedDevices = Services.prefs.getCharPref("browser.casting.fixedDevices", "");
-
- if (!fixedDevices) {
- return;
- }
-
- fixedDevices = JSON.parse(fixedDevices);
- for (let fixedDevice of fixedDevices) {
- // Verify we have the right data
- if (!("location" in fixedDevice) || !("target" in fixedDevice)) {
- continue;
- }
-
- fixedDevice.location = this._forceTrailingSlash(fixedDevice.location);
-
- let service = {
- location: fixedDevice.location,
- target: fixedDevice.target
- };
-
- // We don't assume the fixed target is ready. We still need to ping it.
- try {
- this._processService(service);
- } catch (e) {}
- }
- },
-
- // Called when the search timeout is hit. We use it to cleanup the socket and
- // perform some post-processing on the services list.
- _searchShutdown: function _searchShutdown() {
- if (this._searchSocket) {
- // This will call onStopListening.
- this._searchSocket.close();
-
- // Clean out any stale services
- for (let [key, service] of this._services) {
- if (service.lastPing != this._searchTimestamp) {
- this.removeService(service.uuid);
- }
- }
- }
-
- this._stopExternalDiscovery();
- },
-
- getSupportedExtensions: function() {
- let extensions = [];
- this.services.forEach(function(service) {
- extensions = extensions.concat(service.extensions);
- }, this);
- return extensions.filter(function(extension, pos) {
- return extensions.indexOf(extension) == pos;
- });
- },
-
- getSupportedMimeTypes: function() {
- let types = [];
- this.services.forEach(function(service) {
- types = types.concat(service.types);
- }, this);
- return types.filter(function(type, pos) {
- return types.indexOf(type) == pos;
- });
- },
-
- registerDevice: function registerDevice(aDevice) {
- // We must have "id", "target" and "factory" defined
- if (!("id" in aDevice) || !("target" in aDevice) || !("factory" in aDevice)) {
- // Fatal for registration
- throw "Registration requires an id, a target and a location";
- }
-
- // Only add if we don't already know about this device
- if (!this._devices.has(aDevice.id)) {
- this._devices.set(aDevice.id, aDevice);
- } else {
- log("device was already registered: " + aDevice.id);
- }
- },
-
- unregisterDevice: function unregisterDevice(aDevice) {
- // We must have "id", "target" and "factory" defined
- if (!("id" in aDevice) || !("target" in aDevice) || !("factory" in aDevice)) {
- return;
- }
-
- // Only remove if we know about this device
- if (this._devices.has(aDevice.id)) {
- this._devices.delete(aDevice.id);
- } else {
- log("device was not registered: " + aDevice.id);
- }
- },
-
- findAppForService: function findAppForService(aService) {
- if (!aService || !aService.deviceID) {
- return null;
- }
-
- // Find the registration for the device
- if (this._devices.has(aService.deviceID)) {
- return this._devices.get(aService.deviceID).factory(aService);
- }
- return null;
- },
-
- findServiceForID: function findServiceForID(aUUID) {
- if (this._services.has(aUUID)) {
- return this._services.get(aUUID);
- }
- return null;
- },
-
- // Returns an array copy of the active services
- get services() {
- let array = [];
- for (let [key, service] of this._services) {
- let target = this._devices.get(service.deviceID);
- service.extensions = target.extensions;
- service.types = target.types;
- array.push(service);
- }
- return array;
- },
-
- // Returns false if the service does not match the device's filters
- _filterService: function _filterService(aService) {
- // Loop over all the devices, looking for one that matches the service
- for (let [key, device] of this._devices) {
- // First level of match is on the target itself
- if (device.target != aService.target) {
- continue;
- }
-
- // If we have no filter, everything passes
- if (!("filters" in device)) {
- aService.deviceID = device.id;
- return true;
- }
-
- // If all the filters pass, we have a match
- let failed = false;
- let filters = device.filters;
- for (let filter in filters) {
- if (filter in aService && aService[filter] != filters[filter]) {
- failed = true;
- }
- }
-
- // We found a match, so link the service to the device
- if (!failed) {
- aService.deviceID = device.id;
- return true;
- }
- }
-
- // We didn't find any matches
- return false;
- },
-
- _processService: function _processService(aService) {
- // Use the REST api to request more information about this service
- let xhr = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].createInstance(Ci.nsIXMLHttpRequest);
- xhr.open("GET", aService.location, true);
- xhr.channel.loadFlags |= Ci.nsIRequest.INHIBIT_CACHING;
- xhr.overrideMimeType("text/xml");
-
- xhr.addEventListener("load", (function() {
- if (xhr.status == 200) {
- let doc = xhr.responseXML;
- aService.appsURL = xhr.getResponseHeader("Application-URL");
- if (aService.appsURL && !aService.appsURL.endsWith("/"))
- aService.appsURL += "/";
- aService.friendlyName = doc.querySelector("friendlyName").textContent;
- aService.uuid = doc.querySelector("UDN").textContent;
- aService.manufacturer = doc.querySelector("manufacturer").textContent;
- aService.modelName = doc.querySelector("modelName").textContent;
-
- this.addService(aService);
- }
- }).bind(this), false);
-
- xhr.send(null);
- },
-
- // Add a service to the WeakMap, even if one already exists with this id.
- // Returns true if this succeeded or false if it failed
- _addService: function(service) {
- // Filter out services that do not match the device filter
- if (!this._filterService(service)) {
- return false;
- }
-
- let device = this._devices.get(service.target);
- if (device && device.mirror) {
- service.mirror = true;
- }
- this._services.set(service.uuid, service);
- return true;
- },
-
- addService: function(service) {
- // Only add and notify if we don't already know about this service
- if (!this._services.has(service.uuid)) {
- if (!this._addService(service)) {
- return;
- }
- Services.obs.notifyObservers(null, EVENT_SERVICE_FOUND, service.uuid);
- }
-
- // Make sure we remember this service is not stale
- this._services.get(service.uuid).lastPing = this._searchTimestamp;
- },
-
- removeService: function(uuid) {
- Services.obs.notifyObservers(null, EVENT_SERVICE_LOST, uuid);
- this._services.delete(uuid);
- },
-
- updateService: function(service) {
- if (!this._addService(service)) {
- return;
- }
-
- // Make sure we remember this service is not stale
- this._services.get(service.uuid).lastPing = this._searchTimestamp;
- },
-
- addExternalDiscovery: function(discovery) {
- this._discoveryMethods.push(discovery);
- },
-
- _startExternalDiscovery: function() {
- for (let discovery of this._discoveryMethods) {
- discovery.startDiscovery();
- }
- },
-
- _stopExternalDiscovery: function() {
- for (let discovery of this._discoveryMethods) {
- discovery.stopDiscovery();
- }
- },
-}
diff --git a/toolkit/modules/subprocess/Subprocess.jsm b/toolkit/modules/subprocess/Subprocess.jsm
index 6d0d27d77..e4e4156df 100644
--- a/toolkit/modules/subprocess/Subprocess.jsm
+++ b/toolkit/modules/subprocess/Subprocess.jsm
@@ -18,17 +18,16 @@ let EXPORTED_SYMBOLS = ["Subprocess"];
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/subprocess/subprocess_common.jsm");
-if (AppConstants.platform == "win") {
- XPCOMUtils.defineLazyModuleGetter(this, "SubprocessImpl",
- "resource://gre/modules/subprocess/subprocess_win.jsm");
-} else {
- XPCOMUtils.defineLazyModuleGetter(this, "SubprocessImpl",
- "resource://gre/modules/subprocess/subprocess_unix.jsm");
-}
+#ifdef XP_WIN
+XPCOMUtils.defineLazyModuleGetter(this, "SubprocessImpl",
+ "resource://gre/modules/subprocess/subprocess_win.jsm");
+#else
+XPCOMUtils.defineLazyModuleGetter(this, "SubprocessImpl",
+ "resource://gre/modules/subprocess/subprocess_unix.jsm");
+#endif
/**
* Allows for creation of and communication with OS-level sub-processes.
diff --git a/toolkit/modules/subprocess/moz.build b/toolkit/modules/subprocess/moz.build
index e7a1f526a..e9c6e1198 100644
--- a/toolkit/modules/subprocess/moz.build
+++ b/toolkit/modules/subprocess/moz.build
@@ -4,9 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-EXTRA_JS_MODULES += [
- 'Subprocess.jsm',
-]
+EXTRA_PP_JS_MODULES += ['Subprocess.jsm']
EXTRA_JS_MODULES.subprocess += [
'subprocess_common.jsm',
@@ -27,6 +25,4 @@ else:
'subprocess_worker_unix.js',
]
-XPCSHELL_TESTS_MANIFESTS += ['test/xpcshell/xpcshell.ini']
-
SPHINX_TREES['toolkit_modules/subprocess'] = ['docs']
diff --git a/toolkit/modules/subprocess/subprocess_win.jsm b/toolkit/modules/subprocess/subprocess_win.jsm
index aac625f72..aceedd3e8 100644
--- a/toolkit/modules/subprocess/subprocess_win.jsm
+++ b/toolkit/modules/subprocess/subprocess_win.jsm
@@ -15,7 +15,6 @@ var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var EXPORTED_SYMBOLS = ["SubprocessImpl"];
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/ctypes.jsm");
Cu.import("resource://gre/modules/osfile.jsm");
Cu.import("resource://gre/modules/Services.jsm");
@@ -35,7 +34,7 @@ class WinPromiseWorker extends PromiseWorker {
this.signalEvent = libc.CreateSemaphoreW(null, 0, 32, null);
this.call("init", [{
- breakAwayFromJob: !AppConstants.isPlatformAndVersionAtLeast("win", "6.2"),
+ breakAwayFromJob: Services.vc.compare(Services.sysinfo.getProperty("version"), "6.2") <= 0,
comspec: env.get("COMSPEC"),
signalEvent: String(ctypes.cast(this.signalEvent, ctypes.uintptr_t).value),
}]);
diff --git a/toolkit/modules/subprocess/test/xpcshell/.eslintrc.js b/toolkit/modules/subprocess/test/xpcshell/.eslintrc.js
deleted file mode 100644
index fc63a79b7..000000000
--- a/toolkit/modules/subprocess/test/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,5 +0,0 @@
-"use strict";
-
-module.exports = { // eslint-disable-line no-undef
- "extends": "../../../../../testing/xpcshell/xpcshell.eslintrc.js",
-};
diff --git a/toolkit/modules/subprocess/test/xpcshell/data_test_script.py b/toolkit/modules/subprocess/test/xpcshell/data_test_script.py
deleted file mode 100644
index 035d8ac56..000000000
--- a/toolkit/modules/subprocess/test/xpcshell/data_test_script.py
+++ /dev/null
@@ -1,55 +0,0 @@
-#!/usr/bin/env python2
-from __future__ import print_function
-
-import os
-import signal
-import struct
-import sys
-
-
-def output(line):
- sys.stdout.write(struct.pack('@I', len(line)))
- sys.stdout.write(line)
- sys.stdout.flush()
-
-
-def echo_loop():
- while True:
- line = sys.stdin.readline()
- if not line:
- break
-
- output(line)
-
-
-if sys.platform == "win32":
- import msvcrt
- msvcrt.setmode(sys.stderr.fileno(), os.O_BINARY)
-
-
-cmd = sys.argv[1]
-if cmd == 'echo':
- echo_loop()
-elif cmd == 'exit':
- sys.exit(int(sys.argv[2]))
-elif cmd == 'env':
- for var in sys.argv[2:]:
- output(os.environ.get(var, ''))
-elif cmd == 'pwd':
- output(os.path.abspath(os.curdir))
-elif cmd == 'print_args':
- for arg in sys.argv[2:]:
- output(arg)
-elif cmd == 'ignore_sigterm':
- signal.signal(signal.SIGTERM, signal.SIG_IGN)
-
- output('Ready')
- while True:
- try:
- signal.pause()
- except AttributeError:
- import time
- time.sleep(3600)
-elif cmd == 'print':
- sys.stdout.write(sys.argv[2])
- sys.stderr.write(sys.argv[3])
diff --git a/toolkit/modules/subprocess/test/xpcshell/data_text_file.txt b/toolkit/modules/subprocess/test/xpcshell/data_text_file.txt
deleted file mode 100644
index e69de29bb..000000000
--- a/toolkit/modules/subprocess/test/xpcshell/data_text_file.txt
+++ /dev/null
diff --git a/toolkit/modules/subprocess/test/xpcshell/head.js b/toolkit/modules/subprocess/test/xpcshell/head.js
deleted file mode 100644
index b3175d08a..000000000
--- a/toolkit/modules/subprocess/test/xpcshell/head.js
+++ /dev/null
@@ -1,14 +0,0 @@
-"use strict";
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "AppConstants",
- "resource://gre/modules/AppConstants.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Subprocess",
- "resource://gre/modules/Subprocess.jsm");
diff --git a/toolkit/modules/subprocess/test/xpcshell/test_subprocess.js b/toolkit/modules/subprocess/test/xpcshell/test_subprocess.js
deleted file mode 100644
index 1b8e02820..000000000
--- a/toolkit/modules/subprocess/test/xpcshell/test_subprocess.js
+++ /dev/null
@@ -1,769 +0,0 @@
-"use strict";
-
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Timer.jsm");
-
-
-const env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
-
-const MAX_ROUND_TRIP_TIME_MS = AppConstants.DEBUG || AppConstants.ASAN ? 18 : 9;
-const MAX_RETRIES = 5;
-
-let PYTHON;
-let PYTHON_BIN;
-let PYTHON_DIR;
-
-const TEST_SCRIPT = do_get_file("data_test_script.py").path;
-
-let read = pipe => {
- return pipe.readUint32().then(count => {
- return pipe.readString(count);
- });
-};
-
-
-let readAll = Task.async(function* (pipe) {
- let result = [];
- let string;
- while ((string = yield pipe.readString())) {
- result.push(string);
- }
-
- return result.join("");
-});
-
-
-add_task(function* setup() {
- PYTHON = yield Subprocess.pathSearch(env.get("PYTHON"));
-
- PYTHON_BIN = OS.Path.basename(PYTHON);
- PYTHON_DIR = OS.Path.dirname(PYTHON);
-});
-
-
-add_task(function* test_subprocess_io() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "echo"],
- });
-
- Assert.throws(() => { proc.stdout.read(-1); },
- /non-negative integer/);
- Assert.throws(() => { proc.stdout.read(1.1); },
- /non-negative integer/);
-
- Assert.throws(() => { proc.stdout.read(Infinity); },
- /non-negative integer/);
- Assert.throws(() => { proc.stdout.read(NaN); },
- /non-negative integer/);
-
- Assert.throws(() => { proc.stdout.readString(-1); },
- /non-negative integer/);
- Assert.throws(() => { proc.stdout.readString(1.1); },
- /non-negative integer/);
-
- Assert.throws(() => { proc.stdout.readJSON(-1); },
- /positive integer/);
- Assert.throws(() => { proc.stdout.readJSON(0); },
- /positive integer/);
- Assert.throws(() => { proc.stdout.readJSON(1.1); },
- /positive integer/);
-
-
- const LINE1 = "I'm a leaf on the wind.\n";
- const LINE2 = "Watch how I soar.\n";
-
-
- let outputPromise = read(proc.stdout);
-
- yield new Promise(resolve => setTimeout(resolve, 100));
-
- let [output] = yield Promise.all([
- outputPromise,
- proc.stdin.write(LINE1),
- ]);
-
- equal(output, LINE1, "Got expected output");
-
-
- // Make sure it succeeds whether the write comes before or after the
- // read.
- let inputPromise = proc.stdin.write(LINE2);
-
- yield new Promise(resolve => setTimeout(resolve, 100));
-
- [output] = yield Promise.all([
- read(proc.stdout),
- inputPromise,
- ]);
-
- equal(output, LINE2, "Got expected output");
-
-
- let JSON_BLOB = {foo: {bar: "baz"}};
-
- inputPromise = proc.stdin.write(JSON.stringify(JSON_BLOB) + "\n");
-
- output = yield proc.stdout.readUint32().then(count => {
- return proc.stdout.readJSON(count);
- });
-
- Assert.deepEqual(output, JSON_BLOB, "Got expected JSON output");
-
-
- yield proc.stdin.close();
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
-});
-
-
-add_task(function* test_subprocess_large_io() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "echo"],
- });
-
- const LINE = "I'm a leaf on the wind.\n";
- const BUFFER_SIZE = 4096;
-
- // Create a message that's ~3/4 the input buffer size.
- let msg = Array(BUFFER_SIZE * .75 / 16 | 0).fill("0123456789abcdef").join("") + "\n";
-
- // This sequence of writes and reads crosses several buffer size
- // boundaries, and causes some branches of the read buffer code to be
- // exercised which are not exercised by other tests.
- proc.stdin.write(msg);
- proc.stdin.write(msg);
- proc.stdin.write(LINE);
-
- let output = yield read(proc.stdout);
- equal(output, msg, "Got the expected output");
-
- output = yield read(proc.stdout);
- equal(output, msg, "Got the expected output");
-
- output = yield read(proc.stdout);
- equal(output, LINE, "Got the expected output");
-
- proc.stdin.close();
-
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
-});
-
-
-add_task(function* test_subprocess_huge() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "echo"],
- });
-
- // This should be large enough to fill most pipe input/output buffers.
- const MESSAGE_SIZE = 1024 * 16;
-
- let msg = Array(MESSAGE_SIZE).fill("0123456789abcdef").join("") + "\n";
-
- proc.stdin.write(msg);
-
- let output = yield read(proc.stdout);
- equal(output, msg, "Got the expected output");
-
- proc.stdin.close();
-
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
-});
-
-
-add_task(function* test_subprocess_round_trip_perf() {
- let roundTripTime = Infinity;
- for (let i = 0; i < MAX_RETRIES && roundTripTime > MAX_ROUND_TRIP_TIME_MS; i++) {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "echo"],
- });
-
-
- const LINE = "I'm a leaf on the wind.\n";
-
- let now = Date.now();
- const COUNT = 1000;
- for (let j = 0; j < COUNT; j++) {
- let [output] = yield Promise.all([
- read(proc.stdout),
- proc.stdin.write(LINE),
- ]);
-
- // We don't want to log this for every iteration, but we still need
- // to fail if it goes wrong.
- if (output !== LINE) {
- equal(output, LINE, "Got expected output");
- }
- }
-
- roundTripTime = (Date.now() - now) / COUNT;
-
- yield proc.stdin.close();
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
- }
-
- ok(roundTripTime <= MAX_ROUND_TRIP_TIME_MS,
- `Expected round trip time (${roundTripTime}ms) to be less than ${MAX_ROUND_TRIP_TIME_MS}ms`);
-});
-
-
-add_task(function* test_subprocess_stderr_default() {
- const LINE1 = "I'm a leaf on the wind.\n";
- const LINE2 = "Watch how I soar.\n";
-
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "print", LINE1, LINE2],
- });
-
- equal(proc.stderr, undefined, "There should be no stderr pipe by default");
-
- let stdout = yield readAll(proc.stdout);
-
- equal(stdout, LINE1, "Got the expected stdout output");
-
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
-});
-
-
-add_task(function* test_subprocess_stderr_pipe() {
- const LINE1 = "I'm a leaf on the wind.\n";
- const LINE2 = "Watch how I soar.\n";
-
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "print", LINE1, LINE2],
- stderr: "pipe",
- });
-
- let [stdout, stderr] = yield Promise.all([
- readAll(proc.stdout),
- readAll(proc.stderr),
- ]);
-
- equal(stdout, LINE1, "Got the expected stdout output");
- equal(stderr, LINE2, "Got the expected stderr output");
-
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
-});
-
-
-add_task(function* test_subprocess_stderr_merged() {
- const LINE1 = "I'm a leaf on the wind.\n";
- const LINE2 = "Watch how I soar.\n";
-
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "print", LINE1, LINE2],
- stderr: "stdout",
- });
-
- equal(proc.stderr, undefined, "There should be no stderr pipe by default");
-
- let stdout = yield readAll(proc.stdout);
-
- equal(stdout, LINE1 + LINE2, "Got the expected merged stdout output");
-
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
-});
-
-
-add_task(function* test_subprocess_read_after_exit() {
- const LINE1 = "I'm a leaf on the wind.\n";
- const LINE2 = "Watch how I soar.\n";
-
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "print", LINE1, LINE2],
- stderr: "pipe",
- });
-
-
- let {exitCode} = yield proc.wait();
- equal(exitCode, 0, "Process exited with expected code");
-
-
- let [stdout, stderr] = yield Promise.all([
- readAll(proc.stdout),
- readAll(proc.stderr),
- ]);
-
- equal(stdout, LINE1, "Got the expected stdout output");
- equal(stderr, LINE2, "Got the expected stderr output");
-});
-
-
-add_task(function* test_subprocess_lazy_close_output() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "echo"],
- });
-
- const LINE1 = "I'm a leaf on the wind.\n";
- const LINE2 = "Watch how I soar.\n";
-
- let writePromises = [
- proc.stdin.write(LINE1),
- proc.stdin.write(LINE2),
- ];
- let closedPromise = proc.stdin.close();
-
-
- let output1 = yield read(proc.stdout);
- let output2 = yield read(proc.stdout);
-
- yield Promise.all([...writePromises, closedPromise]);
-
- equal(output1, LINE1, "Got expected output");
- equal(output2, LINE2, "Got expected output");
-
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
-});
-
-
-add_task(function* test_subprocess_lazy_close_input() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "echo"],
- });
-
- let readPromise = proc.stdout.readUint32();
- let closedPromise = proc.stdout.close();
-
-
- const LINE = "I'm a leaf on the wind.\n";
-
- proc.stdin.write(LINE);
- proc.stdin.close();
-
- let len = yield readPromise;
- equal(len, LINE.length);
-
- yield closedPromise;
-
-
- // Don't test for a successful exit here. The process may exit with a
- // write error if we close the pipe after it's written the message
- // size but before it's written the message.
- yield proc.wait();
-});
-
-
-add_task(function* test_subprocess_force_close() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "echo"],
- });
-
- let readPromise = proc.stdout.readUint32();
- let closedPromise = proc.stdout.close(true);
-
- yield Assert.rejects(
- readPromise,
- function(e) {
- equal(e.errorCode, Subprocess.ERROR_END_OF_FILE,
- "Got the expected error code");
- return /File closed/.test(e.message);
- },
- "Promise should be rejected when file is closed");
-
- yield closedPromise;
- yield proc.stdin.close();
-
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
-});
-
-
-add_task(function* test_subprocess_eof() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "echo"],
- });
-
- let readPromise = proc.stdout.readUint32();
-
- yield proc.stdin.close();
-
- yield Assert.rejects(
- readPromise,
- function(e) {
- equal(e.errorCode, Subprocess.ERROR_END_OF_FILE,
- "Got the expected error code");
- return /File closed/.test(e.message);
- },
- "Promise should be rejected on EOF");
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
-});
-
-
-add_task(function* test_subprocess_invalid_json() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "echo"],
- });
-
- const LINE = "I'm a leaf on the wind.\n";
-
- proc.stdin.write(LINE);
- proc.stdin.close();
-
- let count = yield proc.stdout.readUint32();
- let readPromise = proc.stdout.readJSON(count);
-
- yield Assert.rejects(
- readPromise,
- function(e) {
- equal(e.errorCode, Subprocess.ERROR_INVALID_JSON,
- "Got the expected error code");
- return /SyntaxError/.test(e);
- },
- "Promise should be rejected on EOF");
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
-});
-
-
-if (AppConstants.isPlatformAndVersionAtLeast("win", "6")) {
- add_task(function* test_subprocess_inherited_descriptors() {
- let {ctypes, libc, win32} = Cu.import("resource://gre/modules/subprocess/subprocess_win.jsm");
-
- let secAttr = new win32.SECURITY_ATTRIBUTES();
- secAttr.nLength = win32.SECURITY_ATTRIBUTES.size;
- secAttr.bInheritHandle = true;
-
- let handles = win32.createPipe(secAttr, 0);
-
-
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "echo"],
- });
-
-
- // Close the output end of the pipe.
- // Ours should be the only copy, so reads should fail after this.
- handles[1].dispose();
-
- let buffer = new ArrayBuffer(1);
- let succeeded = libc.ReadFile(handles[0], buffer, buffer.byteLength,
- null, null);
-
- ok(!succeeded, "ReadFile should fail on broken pipe");
- equal(ctypes.winLastError, win32.ERROR_BROKEN_PIPE, "Read should fail with ERROR_BROKEN_PIPE");
-
-
- proc.stdin.close();
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
- });
-}
-
-
-add_task(function* test_subprocess_wait() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "exit", "42"],
- });
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 42, "Got expected exit code");
-});
-
-
-add_task(function* test_subprocess_pathSearch() {
- let promise = Subprocess.call({
- command: PYTHON_BIN,
- arguments: ["-u", TEST_SCRIPT, "exit", "13"],
- environment: {
- PATH: PYTHON_DIR,
- },
- });
-
- yield Assert.rejects(
- promise,
- function(error) {
- return error.errorCode == Subprocess.ERROR_BAD_EXECUTABLE;
- },
- "Subprocess.call should fail for a bad executable");
-});
-
-
-add_task(function* test_subprocess_workdir() {
- let procDir = yield OS.File.getCurrentDirectory();
- let tmpDirFile = Components.classes["@mozilla.org/file/local;1"]
- .createInstance(Components.interfaces.nsILocalFile);
- tmpDirFile.initWithPath(OS.Constants.Path.tmpDir);
- tmpDirFile.normalize();
- let tmpDir = tmpDirFile.path;
-
- notEqual(procDir, tmpDir,
- "Current process directory must not be the current temp directory");
-
- function* pwd(options) {
- let proc = yield Subprocess.call(Object.assign({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "pwd"],
- }, options));
-
- let pwdOutput = read(proc.stdout);
-
- let {exitCode} = yield proc.wait();
- equal(exitCode, 0, "Got expected exit code");
-
- return pwdOutput;
- }
-
- let dir = yield pwd({});
- equal(dir, procDir, "Process should normally launch in current process directory");
-
- dir = yield pwd({workdir: tmpDir});
- equal(dir, tmpDir, "Process should launch in the directory specified in `workdir`");
-
- dir = yield OS.File.getCurrentDirectory();
- equal(dir, procDir, "`workdir` should not change the working directory of the current process");
-});
-
-
-add_task(function* test_subprocess_term() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "echo"],
- });
-
- // Windows does not support killing processes gracefully, so they will
- // always exit with -9 there.
- let retVal = AppConstants.platform == "win" ? -9 : -15;
-
- // Kill gracefully with the default timeout of 300ms.
- let {exitCode} = yield proc.kill();
-
- equal(exitCode, retVal, "Got expected exit code");
-
- ({exitCode} = yield proc.wait());
-
- equal(exitCode, retVal, "Got expected exit code");
-});
-
-
-add_task(function* test_subprocess_kill() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "echo"],
- });
-
- // Force kill with no gracefull termination timeout.
- let {exitCode} = yield proc.kill(0);
-
- equal(exitCode, -9, "Got expected exit code");
-
- ({exitCode} = yield proc.wait());
-
- equal(exitCode, -9, "Got expected exit code");
-});
-
-
-add_task(function* test_subprocess_kill_timeout() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "ignore_sigterm"],
- });
-
- // Wait for the process to set up its signal handler and tell us it's
- // ready.
- let msg = yield read(proc.stdout);
- equal(msg, "Ready", "Process is ready");
-
- // Kill gracefully with the default timeout of 300ms.
- // Expect a force kill after 300ms, since the process traps SIGTERM.
- const TIMEOUT = 300;
- let startTime = Date.now();
-
- let {exitCode} = yield proc.kill(TIMEOUT);
-
- // Graceful termination is not supported on Windows, so don't bother
- // testing the timeout there.
- if (AppConstants.platform != "win") {
- let diff = Date.now() - startTime;
- ok(diff >= TIMEOUT, `Process was killed after ${diff}ms (expected ~${TIMEOUT}ms)`);
- }
-
- equal(exitCode, -9, "Got expected exit code");
-
- ({exitCode} = yield proc.wait());
-
- equal(exitCode, -9, "Got expected exit code");
-});
-
-
-add_task(function* test_subprocess_arguments() {
- let args = [
- String.raw`C:\Program Files\Company\Program.exe`,
- String.raw`\\NETWORK SHARE\Foo Directory${"\\"}`,
- String.raw`foo bar baz`,
- String.raw`"foo bar baz"`,
- String.raw`foo " bar`,
- String.raw`Thing \" with "" "\" \\\" \\\\" quotes\\" \\`,
- ];
-
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "print_args", ...args],
- });
-
- for (let [i, arg] of args.entries()) {
- let val = yield read(proc.stdout);
- equal(val, arg, `Got correct value for args[${i}]`);
- }
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
-});
-
-
-// Windows XP can't handle launching Python with a partial environment.
-if (!AppConstants.isPlatformAndVersionAtMost("win", "5.2")) {
- add_task(function* test_subprocess_environment() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "env", "PATH", "FOO"],
- environment: {
- FOO: "BAR",
- },
- });
-
- let path = yield read(proc.stdout);
- let foo = yield read(proc.stdout);
-
- equal(path, "", "Got expected $PATH value");
- equal(foo, "BAR", "Got expected $FOO value");
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
- });
-}
-
-
-add_task(function* test_subprocess_environmentAppend() {
- let proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "env", "PATH", "FOO"],
- environmentAppend: true,
- environment: {
- FOO: "BAR",
- },
- });
-
- let path = yield read(proc.stdout);
- let foo = yield read(proc.stdout);
-
- equal(path, env.get("PATH"), "Got expected $PATH value");
- equal(foo, "BAR", "Got expected $FOO value");
-
- let {exitCode} = yield proc.wait();
-
- equal(exitCode, 0, "Got expected exit code");
-
- proc = yield Subprocess.call({
- command: PYTHON,
- arguments: ["-u", TEST_SCRIPT, "env", "PATH", "FOO"],
- environmentAppend: true,
- });
-
- path = yield read(proc.stdout);
- foo = yield read(proc.stdout);
-
- equal(path, env.get("PATH"), "Got expected $PATH value");
- equal(foo, "", "Got expected $FOO value");
-
- ({exitCode} = yield proc.wait());
-
- equal(exitCode, 0, "Got expected exit code");
-});
-
-
-add_task(function* test_bad_executable() {
- // Test with a non-executable file.
-
- let textFile = do_get_file("data_text_file.txt").path;
-
- let promise = Subprocess.call({
- command: textFile,
- arguments: [],
- });
-
- yield Assert.rejects(
- promise,
- function(error) {
- if (AppConstants.platform == "win") {
- return /Failed to create process/.test(error.message);
- }
- return error.errorCode == Subprocess.ERROR_BAD_EXECUTABLE;
- },
- "Subprocess.call should fail for a bad executable");
-
- // Test with a nonexistent file.
- promise = Subprocess.call({
- command: textFile + ".doesNotExist",
- arguments: [],
- });
-
- yield Assert.rejects(
- promise,
- function(error) {
- return error.errorCode == Subprocess.ERROR_BAD_EXECUTABLE;
- },
- "Subprocess.call should fail for a bad executable");
-});
-
-
-add_task(function* test_cleanup() {
- let {SubprocessImpl} = Cu.import("resource://gre/modules/Subprocess.jsm");
-
- let worker = SubprocessImpl.Process.getWorker();
-
- let openFiles = yield worker.call("getOpenFiles", []);
- let processes = yield worker.call("getProcesses", []);
-
- equal(openFiles.size, 0, "No remaining open files");
- equal(processes.size, 0, "No remaining processes");
-});
diff --git a/toolkit/modules/subprocess/test/xpcshell/test_subprocess_getEnvironment.js b/toolkit/modules/subprocess/test/xpcshell/test_subprocess_getEnvironment.js
deleted file mode 100644
index 4606aec04..000000000
--- a/toolkit/modules/subprocess/test/xpcshell/test_subprocess_getEnvironment.js
+++ /dev/null
@@ -1,17 +0,0 @@
-"use strict";
-
-let env = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
-
-add_task(function* test_getEnvironment() {
- env.set("FOO", "BAR");
-
- let environment = Subprocess.getEnvironment();
-
- equal(environment.FOO, "BAR");
- equal(environment.PATH, env.get("PATH"));
-
- env.set("FOO", null);
-
- environment = Subprocess.getEnvironment();
- equal(environment.FOO || "", "");
-});
diff --git a/toolkit/modules/subprocess/test/xpcshell/test_subprocess_pathSearch.js b/toolkit/modules/subprocess/test/xpcshell/test_subprocess_pathSearch.js
deleted file mode 100644
index 5eb4cd412..000000000
--- a/toolkit/modules/subprocess/test/xpcshell/test_subprocess_pathSearch.js
+++ /dev/null
@@ -1,73 +0,0 @@
-"use strict";
-
-let envService = Cc["@mozilla.org/process/environment;1"].getService(Ci.nsIEnvironment);
-
-const PYTHON = envService.get("PYTHON");
-
-const PYTHON_BIN = OS.Path.basename(PYTHON);
-const PYTHON_DIR = OS.Path.dirname(PYTHON);
-
-const DOES_NOT_EXIST = OS.Path.join(OS.Constants.Path.tmpDir,
- "ThisPathDoesNotExist");
-
-const PATH_SEP = AppConstants.platform == "win" ? ";" : ":";
-
-
-add_task(function* test_pathSearchAbsolute() {
- let env = {};
-
- let path = yield Subprocess.pathSearch(PYTHON, env);
- equal(path, PYTHON, "Full path resolves even with no PATH.");
-
- env.PATH = "";
- path = yield Subprocess.pathSearch(PYTHON, env);
- equal(path, PYTHON, "Full path resolves even with empty PATH.");
-
- yield Assert.rejects(
- Subprocess.pathSearch(DOES_NOT_EXIST, env),
- function(e) {
- equal(e.errorCode, Subprocess.ERROR_BAD_EXECUTABLE,
- "Got the expected error code");
- return /File at path .* does not exist, or is not (executable|a normal file)/.test(e.message);
- },
- "Absolute path should throw for a nonexistent execuable");
-});
-
-
-add_task(function* test_pathSearchRelative() {
- let env = {};
-
- yield Assert.rejects(
- Subprocess.pathSearch(PYTHON_BIN, env),
- function(e) {
- equal(e.errorCode, Subprocess.ERROR_BAD_EXECUTABLE,
- "Got the expected error code");
- return /Executable not found:/.test(e.message);
- },
- "Relative path should not be found when PATH is missing");
-
- env.PATH = [DOES_NOT_EXIST, PYTHON_DIR].join(PATH_SEP);
-
- let path = yield Subprocess.pathSearch(PYTHON_BIN, env);
- equal(path, PYTHON, "Correct executable should be found in the path");
-});
-
-
-add_task({
- skip_if: () => AppConstants.platform != "win",
-}, function* test_pathSearch_PATHEXT() {
- ok(PYTHON_BIN.endsWith(".exe"), "Python executable must end with .exe");
-
- const python_bin = PYTHON_BIN.slice(0, -4);
-
- let env = {
- PATH: PYTHON_DIR,
- PATHEXT: [".com", ".exe", ".foobar"].join(";"),
- };
-
- let path = yield Subprocess.pathSearch(python_bin, env);
- equal(path, PYTHON, "Correct executable should be found in the path, with guessed extension");
-});
-// IMPORTANT: Do not add any tests beyond this point without removing
-// the `skip_if` condition from the previous task, or it will prevent
-// all succeeding tasks from running when it does not match.
diff --git a/toolkit/modules/subprocess/test/xpcshell/xpcshell.ini b/toolkit/modules/subprocess/test/xpcshell/xpcshell.ini
deleted file mode 100644
index 7b7d49a73..000000000
--- a/toolkit/modules/subprocess/test/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,14 +0,0 @@
-[DEFAULT]
-head = head.js
-tail =
-firefox-appdir = browser
-skip-if = os == 'android'
-subprocess = true
-support-files =
- data_text_file.txt
- data_test_script.py
-
-[test_subprocess.js]
-skip-if = os == 'win' # Path issues due to venv changes on the test machines
-[test_subprocess_getEnvironment.js]
-[test_subprocess_pathSearch.js]
diff --git a/toolkit/modules/tests/MockDocument.jsm b/toolkit/modules/tests/MockDocument.jsm
deleted file mode 100644
index 3cae9bb91..000000000
--- a/toolkit/modules/tests/MockDocument.jsm
+++ /dev/null
@@ -1,50 +0,0 @@
-/**
- * Provides infrastructure for tests that would require mock document.
- */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = ["MockDocument"]
-
-const {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
-
-Cu.importGlobalProperties(["URL"]);
-
-const MockDocument = {
- /**
- * Create a document for the given URL containing the given HTML with the ownerDocument of all <form>s having a mocked location.
- */
- createTestDocument(aDocumentURL, aContent = "<form>", aType = "text/html") {
- let parser = Cc["@mozilla.org/xmlextras/domparser;1"].
- createInstance(Ci.nsIDOMParser);
- parser.init();
- let parsedDoc = parser.parseFromString(aContent, aType);
-
- for (let element of parsedDoc.forms) {
- this.mockOwnerDocumentProperty(element, parsedDoc, aDocumentURL);
- }
- return parsedDoc;
- },
-
- mockOwnerDocumentProperty(aElement, aDoc, aURL) {
- // Mock the document.location object so we can unit test without a frame. We use a proxy
- // instead of just assigning to the property since it's not configurable or writable.
- let document = new Proxy(aDoc, {
- get(target, property, receiver) {
- // document.location is normally null when a document is outside of a "browsing context".
- // See https://html.spec.whatwg.org/#the-location-interface
- if (property == "location") {
- return new URL(aURL);
- }
- return target[property];
- },
- });
-
- // Assign element.ownerDocument to the proxy so document.location works.
- Object.defineProperty(aElement, "ownerDocument", {
- value: document,
- });
- },
-
-};
-
diff --git a/toolkit/modules/tests/PromiseTestUtils.jsm b/toolkit/modules/tests/PromiseTestUtils.jsm
deleted file mode 100644
index d60b785a5..000000000
--- a/toolkit/modules/tests/PromiseTestUtils.jsm
+++ /dev/null
@@ -1,241 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Detects and reports unhandled rejections during test runs. Test harnesses
- * will fail tests in this case, unless the test whitelists itself.
- */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = [
- "PromiseTestUtils",
-];
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-
-// Keep "JSMPromise" separate so "Promise" still refers to DOM Promises.
-let JSMPromise = Cu.import("resource://gre/modules/Promise.jsm", {}).Promise;
-
-// For now, we need test harnesses to provide a reference to Assert.jsm.
-let Assert = null;
-
-this.PromiseTestUtils = {
- /**
- * Array of objects containing the details of the Promise rejections that are
- * currently left uncaught. This includes DOM Promise and Promise.jsm. When
- * rejections in DOM Promises are consumed, they are removed from this list.
- *
- * The objects contain at least the following properties:
- * {
- * message: The error message associated with the rejection, if any.
- * date: Date object indicating when the rejection was observed.
- * id: For DOM Promise only, the Promise ID from PromiseDebugging. This is
- * only used for tracking and should not be checked by the callers.
- * stack: nsIStackFrame, SavedFrame, or string indicating the stack at the
- * time the rejection was triggered. May also be null if the
- * rejection was triggered while a script was on the stack.
- * }
- */
- _rejections: [],
-
- /**
- * When an uncaught rejection is detected, it is ignored if one of the
- * functions in this array returns true when called with the rejection details
- * as its only argument. When a function matches an expected rejection, it is
- * then removed from the array.
- */
- _rejectionIgnoreFns: [],
-
- /**
- * Called only by the test infrastructure, registers the rejection observers.
- *
- * This should be called only once, and a matching "uninit" call must be made
- * or the tests will crash on shutdown.
- */
- init() {
- if (this._initialized) {
- Cu.reportError("This object was already initialized.");
- return;
- }
-
- PromiseDebugging.addUncaughtRejectionObserver(this);
-
- // Promise.jsm rejections are only reported to this observer when requested,
- // so we don't have to store a key to remove them when consumed.
- JSMPromise.Debugging.addUncaughtErrorObserver(
- rejection => this._rejections.push(rejection));
-
- this._initialized = true;
- },
- _initialized: false,
-
- /**
- * Called only by the test infrastructure, unregisters the observers.
- */
- uninit() {
- if (!this._initialized) {
- return;
- }
-
- PromiseDebugging.removeUncaughtRejectionObserver(this);
- JSMPromise.Debugging.clearUncaughtErrorObservers();
-
- this._initialized = false;
- },
-
- /**
- * Called only by the test infrastructure, spins the event loop until the
- * messages for pending DOM Promise rejections have been processed.
- */
- ensureDOMPromiseRejectionsProcessed() {
- let observed = false;
- let observer = {
- onLeftUncaught: promise => {
- if (PromiseDebugging.getState(promise).reason ===
- this._ensureDOMPromiseRejectionsProcessedReason) {
- observed = true;
- }
- },
- onConsumed() {},
- };
-
- PromiseDebugging.addUncaughtRejectionObserver(observer);
- Promise.reject(this._ensureDOMPromiseRejectionsProcessedReason);
- while (!observed) {
- Services.tm.mainThread.processNextEvent(true);
- }
- PromiseDebugging.removeUncaughtRejectionObserver(observer);
- },
- _ensureDOMPromiseRejectionsProcessedReason: {},
-
- /**
- * Called only by the tests for PromiseDebugging.addUncaughtRejectionObserver
- * and for JSMPromise.Debugging, disables the observers in this module.
- */
- disableUncaughtRejectionObserverForSelfTest() {
- this.uninit();
- },
-
- /**
- * Called by tests that have been whitelisted, disables the observers in this
- * module. For new tests where uncaught rejections are expected, you should
- * use the more granular expectUncaughtRejection function instead.
- */
- thisTestLeaksUncaughtRejectionsAndShouldBeFixed() {
- this.uninit();
- },
-
- /**
- * Sets or updates the Assert object instance to be used for error reporting.
- */
- set Assert(assert) {
- Assert = assert;
- },
-
- // UncaughtRejectionObserver
- onLeftUncaught(promise) {
- let message = "(Unable to convert rejection reason to string.)";
- try {
- let reason = PromiseDebugging.getState(promise).reason;
- if (reason === this._ensureDOMPromiseRejectionsProcessedReason) {
- // Ignore the special promise for ensureDOMPromiseRejectionsProcessed.
- return;
- }
- message = reason.message || ("" + reason);
- } catch (ex) {}
-
- // It's important that we don't store any reference to the provided Promise
- // object or its value after this function returns in order to avoid leaks.
- this._rejections.push({
- id: PromiseDebugging.getPromiseID(promise),
- message,
- date: new Date(),
- stack: PromiseDebugging.getRejectionStack(promise),
- });
- },
-
- // UncaughtRejectionObserver
- onConsumed(promise) {
- // We don't expect that many unhandled rejections will appear at the same
- // time, so the algorithm doesn't need to be optimized for that case.
- let id = PromiseDebugging.getPromiseID(promise);
- let index = this._rejections.findIndex(rejection => rejection.id == id);
- // If we get a consumption notification for a rejection that was left
- // uncaught before this module was initialized, we can safely ignore it.
- if (index != -1) {
- this._rejections.splice(index, 1);
- }
- },
-
- /**
- * Informs the test suite that the test code will generate a Promise rejection
- * that will still be unhandled when the test file terminates.
- *
- * This method must be called once for each instance of Promise that is
- * expected to be uncaught, even if the rejection reason is the same for each
- * instance.
- *
- * If the expected rejection does not occur, the test will fail.
- *
- * @param regExpOrCheckFn
- * This can either be a regular expression that should match the error
- * message of the rejection, or a check function that is invoked with
- * the rejection details object as its first argument.
- */
- expectUncaughtRejection(regExpOrCheckFn) {
- let checkFn = !("test" in regExpOrCheckFn) ? regExpOrCheckFn :
- rejection => regExpOrCheckFn.test(rejection.message);
- this._rejectionIgnoreFns.push(checkFn);
- },
-
- /**
- * Fails the test if there are any uncaught rejections at this time that have
- * not been whitelisted using expectUncaughtRejection.
- *
- * Depending on the configuration of the test suite, this function might only
- * report the details of the first uncaught rejection that was generated.
- *
- * This is called by the test suite at the end of each test function.
- */
- assertNoUncaughtRejections() {
- // Ask Promise.jsm to report all uncaught rejections to the observer now.
- JSMPromise.Debugging.flushUncaughtErrors();
-
- // If there is any uncaught rejection left at this point, the test fails.
- while (this._rejections.length > 0) {
- let rejection = this._rejections.shift();
-
- // If one of the ignore functions matches, ignore the rejection, then
- // remove the function so that each function only matches one rejection.
- let index = this._rejectionIgnoreFns.findIndex(f => f(rejection));
- if (index != -1) {
- this._rejectionIgnoreFns.splice(index, 1);
- continue;
- }
-
- // Report the error. This operation can throw an exception, depending on
- // the configuration of the test suite that handles the assertion.
- Assert.ok(false,
- `A promise chain failed to handle a rejection:` +
- ` ${rejection.message} - rejection date: ${rejection.date}`+
- ` - stack: ${rejection.stack}`);
- }
- },
-
- /**
- * Fails the test if any rejection indicated by expectUncaughtRejection has
- * not yet been reported at this time.
- *
- * This is called by the test suite at the end of each test file.
- */
- assertNoMoreExpectedRejections() {
- // Only log this condition is there is a failure.
- if (this._rejectionIgnoreFns.length > 0) {
- Assert.equal(this._rejectionIgnoreFns.length, 0,
- "Unable to find a rejection expected by expectUncaughtRejection.");
- }
- },
-};
diff --git a/toolkit/modules/tests/browser/.eslintrc.js b/toolkit/modules/tests/browser/.eslintrc.js
deleted file mode 100644
index c764b133d..000000000
--- a/toolkit/modules/tests/browser/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/browser.eslintrc.js"
- ]
-};
diff --git a/toolkit/modules/tests/browser/WebRequest_dynamic.sjs b/toolkit/modules/tests/browser/WebRequest_dynamic.sjs
deleted file mode 100644
index 7b34a377d..000000000
--- a/toolkit/modules/tests/browser/WebRequest_dynamic.sjs
+++ /dev/null
@@ -1,13 +0,0 @@
-function handleRequest(aRequest, aResponse) {
- aResponse.setStatusLine(aRequest.httpVersion, 200);
- if (aRequest.hasHeader('Cookie')) {
- let value = aRequest.getHeader("Cookie");
- if (value == "blinky=1") {
- aResponse.setHeader("Set-Cookie", "dinky=1");
- }
- aResponse.write("cookie-present");
- } else {
- aResponse.setHeader("Set-Cookie", "foopy=1");
- aResponse.write("cookie-not-present");
- }
-}
diff --git a/toolkit/modules/tests/browser/WebRequest_redirection.sjs b/toolkit/modules/tests/browser/WebRequest_redirection.sjs
deleted file mode 100644
index 370ecd213..000000000
--- a/toolkit/modules/tests/browser/WebRequest_redirection.sjs
+++ /dev/null
@@ -1,4 +0,0 @@
-function handleRequest(aRequest, aResponse) {
- aResponse.setStatusLine(aRequest.httpVersion, 302);
- aResponse.setHeader("Location", "./dummy_page.html");
-}
diff --git a/toolkit/modules/tests/browser/browser.ini b/toolkit/modules/tests/browser/browser.ini
deleted file mode 100644
index e82feaa42..000000000
--- a/toolkit/modules/tests/browser/browser.ini
+++ /dev/null
@@ -1,41 +0,0 @@
-[DEFAULT]
-support-files =
- dummy_page.html
- metadata_*.html
- testremotepagemanager.html
- file_WebNavigation_page1.html
- file_WebNavigation_page2.html
- file_WebNavigation_page3.html
- file_WebRequest_page1.html
- file_WebRequest_page2.html
- file_image_good.png
- file_image_bad.png
- file_image_redirect.png
- file_style_good.css
- file_style_bad.css
- file_style_redirect.css
- file_script_good.js
- file_script_bad.js
- file_script_redirect.js
- file_script_xhr.js
- WebRequest_dynamic.sjs
- WebRequest_redirection.sjs
-
-[browser_AsyncPrefs.js]
-[browser_Battery.js]
-[browser_Deprecated.js]
-[browser_Finder.js]
-[browser_Finder_hidden_textarea.js]
-[browser_FinderHighlighter.js]
-skip-if = debug || os = "linux"
-support-files = file_FinderSample.html
-[browser_Geometry.js]
-[browser_InlineSpellChecker.js]
-[browser_WebNavigation.js]
-[browser_WebRequest.js]
-[browser_WebRequest_cookies.js]
-[browser_WebRequest_filtering.js]
-[browser_PageMetadata.js]
-[browser_PromiseMessage.js]
-[browser_RemotePageManager.js]
-[browser_Troubleshoot.js]
diff --git a/toolkit/modules/tests/browser/browser_AsyncPrefs.js b/toolkit/modules/tests/browser/browser_AsyncPrefs.js
deleted file mode 100644
index 1d20a3789..000000000
--- a/toolkit/modules/tests/browser/browser_AsyncPrefs.js
+++ /dev/null
@@ -1,97 +0,0 @@
-"use strict";
-
-const kWhiteListedBool = "testing.allowed-prefs.some-bool-pref";
-const kWhiteListedChar = "testing.allowed-prefs.some-char-pref";
-const kWhiteListedInt = "testing.allowed-prefs.some-int-pref";
-
-function resetPrefs() {
- for (let pref of [kWhiteListedBool, kWhiteListedChar, kWhiteListedBool]) {
- Services.prefs.clearUserPref(pref);
- }
-}
-
-registerCleanupFunction(resetPrefs);
-
-Services.prefs.getDefaultBranch("testing.allowed-prefs.").setBoolPref("some-bool-pref", false);
-Services.prefs.getDefaultBranch("testing.allowed-prefs.").setCharPref("some-char-pref", "");
-Services.prefs.getDefaultBranch("testing.allowed-prefs.").setIntPref("some-int-pref", 0);
-
-function* runTest() {
- let {AsyncPrefs} = Cu.import("resource://gre/modules/AsyncPrefs.jsm", {});
- const kInChildProcess = Services.appinfo.processType == Services.appinfo.PROCESS_TYPE_CONTENT;
-
- // Need to define these again because when run in a content task we have no scope access.
- const kNotWhiteListed = "some.pref.thats.not.whitelisted";
- const kWhiteListedBool = "testing.allowed-prefs.some-bool-pref";
- const kWhiteListedChar = "testing.allowed-prefs.some-char-pref";
- const kWhiteListedInt = "testing.allowed-prefs.some-int-pref";
-
- const procDesc = kInChildProcess ? "child process" : "parent process";
-
- const valueResultMap = [
- [true, "Bool"],
- [false, "Bool"],
- [10, "Int"],
- [-1, "Int"],
- ["", "Char"],
- ["stuff", "Char"],
- [[], false],
- [{}, false],
- [BrowserUtils.makeURI("http://mozilla.org/"), false],
- ];
-
- const prefMap = [
- ["Bool", kWhiteListedBool],
- ["Char", kWhiteListedChar],
- ["Int", kWhiteListedInt],
- ];
-
- function doesFail(pref, value) {
- let msg = `Should not succeed setting ${pref} to ${value} in ${procDesc}`;
- return AsyncPrefs.set(pref, value).then(() => ok(false, msg), error => ok(true, msg + "; " + error));
- }
-
- function doesWork(pref, value) {
- let msg = `Should be able to set ${pref} to ${value} in ${procDesc}`;
- return AsyncPrefs.set(pref, value).then(() => ok(true, msg), error => ok(false, msg + "; " + error));
- }
-
- function doReset(pref) {
- let msg = `Should be able to reset ${pref} in ${procDesc}`;
- return AsyncPrefs.reset(pref).then(() => ok(true, msg), () => ok(false, msg));
- }
-
- for (let [val, ] of valueResultMap) {
- yield doesFail(kNotWhiteListed, val);
- is(Services.prefs.prefHasUserValue(kNotWhiteListed), false, "Pref shouldn't get changed");
- }
-
- let resetMsg = `Should not succeed resetting ${kNotWhiteListed} in ${procDesc}`;
- AsyncPrefs.reset(kNotWhiteListed).then(() => ok(false, resetMsg), error => ok(true, resetMsg + "; " + error));
-
- for (let [type, pref] of prefMap) {
- for (let [val, result] of valueResultMap) {
- if (result == type) {
- yield doesWork(pref, val);
- is(Services.prefs["get" + type + "Pref"](pref), val, "Pref should have been updated");
- yield doReset(pref);
- } else {
- yield doesFail(pref, val);
- is(Services.prefs.prefHasUserValue(pref), false, `Pref ${pref} shouldn't get changed`);
- }
- }
- }
-}
-
-add_task(function* runInParent() {
- yield runTest();
- resetPrefs();
-});
-
-if (gMultiProcessBrowser) {
- add_task(function* runInChild() {
- ok(gBrowser.selectedBrowser.isRemoteBrowser, "Should actually run this in child process");
- yield ContentTask.spawn(gBrowser.selectedBrowser, null, runTest);
- resetPrefs();
- });
-}
diff --git a/toolkit/modules/tests/browser/browser_Battery.js b/toolkit/modules/tests/browser/browser_Battery.js
deleted file mode 100644
index 2d3ba5da1..000000000
--- a/toolkit/modules/tests/browser/browser_Battery.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-var imported = Components.utils.import("resource://gre/modules/Battery.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-
-function test() {
- waitForExplicitFinish();
-
- is(imported.Debugging.fake, false, "Battery spoofing is initially false")
-
- GetBattery().then(function (battery) {
- for (let k of ["charging", "chargingTime", "dischargingTime", "level"]) {
- let backup = battery[k];
- try {
- battery[k] = "__magic__";
- } catch (e) {
- // We are testing that we cannot set battery to new values
- // when "use strict" is enabled, this throws a TypeError
- if (e.name != "TypeError")
- throw e;
- }
- is(battery[k], backup, "Setting battery " + k + " preference without spoofing enabled should fail");
- }
-
- imported.Debugging.fake = true;
-
- // reload again to get the fake one
- GetBattery().then(function (battery) {
- battery.charging = true;
- battery.chargingTime = 100;
- battery.level = 0.5;
- ok(battery.charging, "Test for charging setter");
- is(battery.chargingTime, 100, "Test for chargingTime setter");
- is(battery.level, 0.5, "Test for level setter");
-
- battery.charging = false;
- battery.dischargingTime = 50;
- battery.level = 0.7;
- ok(!battery.charging, "Test for charging setter");
- is(battery.dischargingTime, 50, "Test for dischargingTime setter");
- is(battery.level, 0.7, "Test for level setter");
-
- // Resetting the value to make the test run successful
- // for multiple runs in same browser session.
- imported.Debugging.fake = false;
- finish();
- });
- });
-}
diff --git a/toolkit/modules/tests/browser/browser_Deprecated.js b/toolkit/modules/tests/browser/browser_Deprecated.js
deleted file mode 100644
index 3217bdd22..000000000
--- a/toolkit/modules/tests/browser/browser_Deprecated.js
+++ /dev/null
@@ -1,157 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-const PREF_DEPRECATION_WARNINGS = "devtools.errorconsole.deprecation_warnings";
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/Deprecated.jsm", this);
-
-// Using this named functions to test deprecation and the properly logged
-// callstacks.
-function basicDeprecatedFunction () {
- Deprecated.warning("this method is deprecated.", "http://example.com");
- return true;
-}
-
-function deprecationFunctionBogusCallstack () {
- Deprecated.warning("this method is deprecated.", "http://example.com", {
- caller: {}
- });
- return true;
-}
-
-function deprecationFunctionCustomCallstack () {
- // Get the nsIStackFrame that will contain the name of this function.
- function getStack () {
- return Components.stack;
- }
- Deprecated.warning("this method is deprecated.", "http://example.com",
- getStack());
- return true;
-}
-
-var tests = [
-// Test deprecation warning without passing the callstack.
-{
- deprecatedFunction: basicDeprecatedFunction,
- expectedObservation: function (aMessage) {
- testAMessage(aMessage);
- ok(aMessage.errorMessage.indexOf("basicDeprecatedFunction") > 0,
- "Callstack is correctly logged.");
- }
-},
-// Test a reported error when URL to documentation is not passed.
-{
- deprecatedFunction: function () {
- Deprecated.warning("this method is deprecated.");
- return true;
- },
- expectedObservation: function (aMessage) {
- ok(aMessage.errorMessage.indexOf("must provide a URL") > 0,
- "Deprecation warning logged an empty URL argument.");
- }
-},
-// Test deprecation with a bogus callstack passed as an argument (it will be
-// replaced with the current call stack).
-{
- deprecatedFunction: deprecationFunctionBogusCallstack,
- expectedObservation: function (aMessage) {
- testAMessage(aMessage);
- ok(aMessage.errorMessage.indexOf("deprecationFunctionBogusCallstack") > 0,
- "Callstack is correctly logged.");
- }
-},
-// When pref is unset Deprecated.warning should not log anything.
-{
- deprecatedFunction: basicDeprecatedFunction,
- expectedObservation: null,
- // Set pref to false.
- logWarnings: false
-},
-// Test deprecation with a valid custom callstack passed as an argument.
-{
- deprecatedFunction: deprecationFunctionCustomCallstack,
- expectedObservation: function (aMessage) {
- testAMessage(aMessage);
- ok(aMessage.errorMessage.indexOf("deprecationFunctionCustomCallstack") > 0,
- "Callstack is correctly logged.");
- },
- // Set pref to true.
- logWarnings: true
-}];
-
-// Which test are we running now?
-var idx = -1;
-
-function test() {
- waitForExplicitFinish();
-
- // Check if Deprecated is loaded.
- ok(Deprecated, "Deprecated object exists");
-
- nextTest();
-}
-
-// Test Consle Message attributes.
-function testAMessage (aMessage) {
- ok(aMessage.errorMessage.indexOf("DEPRECATION WARNING: " +
- "this method is deprecated.") === 0,
- "Deprecation is correctly logged.");
- ok(aMessage.errorMessage.indexOf("http://example.com") > 0,
- "URL is correctly logged.");
-}
-
-function nextTest() {
- idx++;
-
- if (idx == tests.length) {
- finish();
- return;
- }
-
- info("Running test #" + idx);
- let test = tests[idx];
-
- // Deprecation warnings will be logged only when the preference is set.
- if (typeof test.logWarnings !== "undefined") {
- Services.prefs.setBoolPref(PREF_DEPRECATION_WARNINGS, test.logWarnings);
- }
-
- // Create a console listener.
- let consoleListener = {
- observe: function (aMessage) {
- // Ignore unexpected messages.
- if (!(aMessage instanceof Ci.nsIScriptError)) {
- return;
- }
- if (aMessage.errorMessage.indexOf("DEPRECATION WARNING: ") < 0 &&
- aMessage.errorMessage.indexOf("must provide a URL") < 0) {
- return;
- }
- ok(aMessage instanceof Ci.nsIScriptError,
- "Deprecation log message is an instance of type nsIScriptError.");
-
-
- if (test.expectedObservation === null) {
- ok(false, "Deprecated warning not expected");
- }
- else {
- test.expectedObservation(aMessage);
- }
-
- Services.console.unregisterListener(consoleListener);
- executeSoon(nextTest);
- }
- };
- Services.console.registerListener(consoleListener);
- test.deprecatedFunction();
- if (test.expectedObservation === null) {
- executeSoon(function() {
- Services.console.unregisterListener(consoleListener);
- executeSoon(nextTest);
- });
- }
-}
diff --git a/toolkit/modules/tests/browser/browser_Finder.js b/toolkit/modules/tests/browser/browser_Finder.js
deleted file mode 100644
index 4dfd921d0..000000000
--- a/toolkit/modules/tests/browser/browser_Finder.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Ci = Components.interfaces;
-
-add_task(function* () {
- const url = "data:text/html;base64," +
- btoa("<body><iframe srcdoc=\"content\"/></iframe>" +
- "<a href=\"http://test.com\">test link</a>");
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, url);
-
- let finder = tab.linkedBrowser.finder;
- let listener = {
- onFindResult: function () {
- ok(false, "onFindResult callback wasn't replaced");
- },
- onHighlightFinished: function () {
- ok(false, "onHighlightFinished callback wasn't replaced");
- }
- };
- finder.addResultListener(listener);
-
- function waitForFind(which = "onFindResult") {
- return new Promise(resolve => {
- listener[which] = resolve;
- })
- }
-
- let promiseFind = waitForFind("onHighlightFinished");
- finder.highlight(true, "content");
- let findResult = yield promiseFind;
- Assert.ok(findResult.found, "should find string");
-
- promiseFind = waitForFind("onHighlightFinished");
- finder.highlight(true, "Bla");
- findResult = yield promiseFind;
- Assert.ok(!findResult.found, "should not find string");
-
- // Search only for links and draw outlines.
- promiseFind = waitForFind();
- finder.fastFind("test link", true, true);
- findResult = yield promiseFind;
- is(findResult.result, Ci.nsITypeAheadFind.FIND_FOUND, "should find link");
-
- yield ContentTask.spawn(tab.linkedBrowser, {}, function* (arg) {
- Assert.ok(!!content.document.getElementsByTagName("a")[0].style.outline, "outline set");
- });
-
- // Just a simple search for "test link".
- promiseFind = waitForFind();
- finder.fastFind("test link", false, false);
- findResult = yield promiseFind;
- is(findResult.result, Ci.nsITypeAheadFind.FIND_FOUND, "should find link again");
-
- yield ContentTask.spawn(tab.linkedBrowser, {}, function* (arg) {
- Assert.ok(!content.document.getElementsByTagName("a")[0].style.outline, "outline not set");
- });
-
- finder.removeResultListener(listener);
- gBrowser.removeTab(tab);
-});
diff --git a/toolkit/modules/tests/browser/browser_FinderHighlighter.js b/toolkit/modules/tests/browser/browser_FinderHighlighter.js
deleted file mode 100644
index cd7eefa11..000000000
--- a/toolkit/modules/tests/browser/browser_FinderHighlighter.js
+++ /dev/null
@@ -1,460 +0,0 @@
-"use strict";
-
-Cu.import("resource://testing-common/BrowserTestUtils.jsm", this);
-Cu.import("resource://testing-common/ContentTask.jsm", this);
-Cu.import("resource://gre/modules/Promise.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm", this);
-Cu.import("resource://gre/modules/Timer.jsm", this);
-Cu.import("resource://gre/modules/AppConstants.jsm");
-
-const kHighlightAllPref = "findbar.highlightAll";
-const kPrefModalHighlight = "findbar.modalHighlight";
-const kFixtureBaseURL = "https://example.com/browser/toolkit/modules/tests/browser/";
-const kIteratorTimeout = Services.prefs.getIntPref("findbar.iteratorTimeout");
-
-function promiseOpenFindbar(findbar) {
- findbar.onFindCommand()
- return gFindBar._startFindDeferred && gFindBar._startFindDeferred.promise;
-}
-
-function promiseFindResult(findbar, str = null) {
- let highlightFinished = false;
- let findFinished = false;
- return new Promise(resolve => {
- let listener = {
- onFindResult({ searchString }) {
- if (str !== null && str != searchString) {
- return;
- }
- findFinished = true;
- if (highlightFinished) {
- findbar.browser.finder.removeResultListener(listener);
- resolve();
- }
- },
- onHighlightFinished() {
- highlightFinished = true;
- if (findFinished) {
- findbar.browser.finder.removeResultListener(listener);
- resolve();
- }
- },
- onMatchesCountResult: () => {}
- };
- findbar.browser.finder.addResultListener(listener);
- });
-}
-
-function promiseEnterStringIntoFindField(findbar, str) {
- let promise = promiseFindResult(findbar, str);
- for (let i = 0; i < str.length; i++) {
- let event = document.createEvent("KeyboardEvent");
- event.initKeyEvent("keypress", true, true, null, false, false,
- false, false, 0, str.charCodeAt(i));
- findbar._findField.inputField.dispatchEvent(event);
- }
- return promise;
-}
-
-function promiseTestHighlighterOutput(browser, word, expectedResult, extraTest = () => {}) {
- return ContentTask.spawn(browser, { word, expectedResult, extraTest: extraTest.toSource() },
- function* ({ word, expectedResult, extraTest }) {
- Cu.import("resource://gre/modules/Timer.jsm", this);
-
- return new Promise((resolve, reject) => {
- let stubbed = {};
- let callCounts = {
- insertCalls: [],
- removeCalls: []
- };
- let lastMaskNode, lastOutlineNode;
- let rects = [];
-
- // Amount of milliseconds to wait after the last time one of our stubs
- // was called.
- const kTimeoutMs = 1000;
- // The initial timeout may wait for a while for results to come in.
- let timeout = setTimeout(() => finish(false, "Timeout"), kTimeoutMs * 5);
-
- function finish(ok = true, message = "finished with error") {
- // Restore the functions we stubbed out.
- try {
- content.document.insertAnonymousContent = stubbed.insert;
- content.document.removeAnonymousContent = stubbed.remove;
- } catch (ex) {}
- stubbed = {};
- clearTimeout(timeout);
-
- if (expectedResult.rectCount !== 0)
- Assert.ok(ok, message);
-
- Assert.greaterOrEqual(callCounts.insertCalls.length, expectedResult.insertCalls[0],
- `Min. insert calls should match for '${word}'.`);
- Assert.lessOrEqual(callCounts.insertCalls.length, expectedResult.insertCalls[1],
- `Max. insert calls should match for '${word}'.`);
- Assert.greaterOrEqual(callCounts.removeCalls.length, expectedResult.removeCalls[0],
- `Min. remove calls should match for '${word}'.`);
- Assert.lessOrEqual(callCounts.removeCalls.length, expectedResult.removeCalls[1],
- `Max. remove calls should match for '${word}'.`);
-
- // We reached the amount of calls we expected, so now we can check
- // the amount of rects.
- if (!lastMaskNode && expectedResult.rectCount !== 0) {
- Assert.ok(false, `No mask node found, but expected ${expectedResult.rectCount} rects.`);
- }
-
- Assert.equal(rects.length, expectedResult.rectCount,
- `Amount of inserted rects should match for '${word}'.`);
-
- // Allow more specific assertions to be tested in `extraTest`.
- extraTest = eval(extraTest);
- extraTest(lastMaskNode, lastOutlineNode, rects);
-
- resolve();
- }
-
- function stubAnonymousContentNode(domNode, anonNode) {
- let originals = [anonNode.setTextContentForElement,
- anonNode.setAttributeForElement, anonNode.removeAttributeForElement,
- anonNode.setCutoutRectsForElement];
- anonNode.setTextContentForElement = (id, text) => {
- try {
- (domNode.querySelector("#" + id) || domNode).textContent = text;
- } catch (ex) {}
- return originals[0].call(anonNode, id, text);
- };
- anonNode.setAttributeForElement = (id, attrName, attrValue) => {
- try {
- (domNode.querySelector("#" + id) || domNode).setAttribute(attrName, attrValue);
- } catch (ex) {}
- return originals[1].call(anonNode, id, attrName, attrValue);
- };
- anonNode.removeAttributeForElement = (id, attrName) => {
- try {
- let node = domNode.querySelector("#" + id) || domNode;
- if (node.hasAttribute(attrName))
- node.removeAttribute(attrName);
- } catch (ex) {}
- return originals[2].call(anonNode, id, attrName);
- };
- anonNode.setCutoutRectsForElement = (id, cutoutRects) => {
- rects = cutoutRects;
- return originals[3].call(anonNode, id, cutoutRects);
- };
- }
-
- // Create a function that will stub the original version and collects
- // the arguments so we can check the results later.
- function stub(which) {
- stubbed[which] = content.document[which + "AnonymousContent"];
- let prop = which + "Calls";
- return function(node) {
- callCounts[prop].push(node);
- if (which == "insert") {
- if (node.outerHTML.indexOf("outlineMask") > -1)
- lastMaskNode = node;
- else
- lastOutlineNode = node;
- }
- clearTimeout(timeout);
- timeout = setTimeout(() => {
- finish();
- }, kTimeoutMs);
- let res = stubbed[which].call(content.document, node);
- if (which == "insert")
- stubAnonymousContentNode(node, res);
- return res;
- };
- }
- content.document.insertAnonymousContent = stub("insert");
- content.document.removeAnonymousContent = stub("remove");
- });
- });
-}
-
-add_task(function* setup() {
- yield SpecialPowers.pushPrefEnv({ set: [
- [kHighlightAllPref, true],
- [kPrefModalHighlight, true]
- ]});
-});
-
-// Test the results of modal highlighting, which is on by default.
-add_task(function* testModalResults() {
- let tests = new Map([
- ["Roland", {
- rectCount: 2,
- insertCalls: [2, 4],
- removeCalls: [0, 1]
- }],
- ["their law might propagate their kind", {
- rectCount: 2,
- insertCalls: [5, 6],
- removeCalls: [4, 5],
- extraTest: function(maskNode, outlineNode, rects) {
- Assert.equal(outlineNode.getElementsByTagName("div").length, 2,
- "There should be multiple rects drawn");
- }
- }],
- ["ro", {
- rectCount: 41,
- insertCalls: [1, 4],
- removeCalls: [1, 3]
- }],
- ["new", {
- rectCount: 2,
- insertCalls: [1, 4],
- removeCalls: [0, 2]
- }],
- ["o", {
- rectCount: 492,
- insertCalls: [1, 4],
- removeCalls: [0, 2]
- }]
- ]);
- let url = kFixtureBaseURL + "file_FinderSample.html";
- yield BrowserTestUtils.withNewTab(url, function* (browser) {
- let findbar = gBrowser.getFindBar();
-
- for (let [word, expectedResult] of tests) {
- yield promiseOpenFindbar(findbar);
- Assert.ok(!findbar.hidden, "Findbar should be open now.");
-
- let timeout = kIteratorTimeout;
- if (word.length == 1)
- timeout *= 4;
- else if (word.length == 2)
- timeout *= 2;
- yield new Promise(resolve => setTimeout(resolve, timeout));
- let promise = promiseTestHighlighterOutput(browser, word, expectedResult,
- expectedResult.extraTest);
- yield promiseEnterStringIntoFindField(findbar, word);
- yield promise;
-
- findbar.close(true);
- }
- });
-});
-
-// Test if runtime switching of highlight modes between modal and non-modal works
-// as expected.
-add_task(function* testModalSwitching() {
- let url = kFixtureBaseURL + "file_FinderSample.html";
- yield BrowserTestUtils.withNewTab(url, function* (browser) {
- let findbar = gBrowser.getFindBar();
-
- yield promiseOpenFindbar(findbar);
- Assert.ok(!findbar.hidden, "Findbar should be open now.");
-
- let word = "Roland";
- let expectedResult = {
- rectCount: 2,
- insertCalls: [2, 4],
- removeCalls: [0, 1]
- };
- let promise = promiseTestHighlighterOutput(browser, word, expectedResult);
- yield promiseEnterStringIntoFindField(findbar, word);
- yield promise;
-
- yield SpecialPowers.pushPrefEnv({ "set": [[ kPrefModalHighlight, false ]] });
-
- expectedResult = {
- rectCount: 0,
- insertCalls: [0, 0],
- removeCalls: [0, 0]
- };
- promise = promiseTestHighlighterOutput(browser, word, expectedResult);
- findbar.clear();
- yield promiseEnterStringIntoFindField(findbar, word);
- yield promise;
-
- findbar.close(true);
- });
-
- yield SpecialPowers.pushPrefEnv({ "set": [[ kPrefModalHighlight, true ]] });
-});
-
-// Test if highlighting a dark page is detected properly.
-add_task(function* testDarkPageDetection() {
- let url = kFixtureBaseURL + "file_FinderSample.html";
- yield BrowserTestUtils.withNewTab(url, function* (browser) {
- let findbar = gBrowser.getFindBar();
-
- yield promiseOpenFindbar(findbar);
-
- let word = "Roland";
- let expectedResult = {
- rectCount: 2,
- insertCalls: [1, 3],
- removeCalls: [0, 1]
- };
- let promise = promiseTestHighlighterOutput(browser, word, expectedResult, function(node) {
- Assert.ok(node.style.background.startsWith("rgba(0, 0, 0"),
- "White HTML page should have a black background color set for the mask");
- });
- yield promiseEnterStringIntoFindField(findbar, word);
- yield promise;
-
- findbar.close(true);
- });
-
- yield BrowserTestUtils.withNewTab(url, function* (browser) {
- let findbar = gBrowser.getFindBar();
-
- yield promiseOpenFindbar(findbar);
-
- let word = "Roland";
- let expectedResult = {
- rectCount: 2,
- insertCalls: [2, 4],
- removeCalls: [0, 1]
- };
-
- yield ContentTask.spawn(browser, null, function* () {
- let dwu = content.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIDOMWindowUtils);
- let uri = "data:text/css;charset=utf-8," + encodeURIComponent(`
- body {
- background: maroon radial-gradient(circle, #a01010 0%, #800000 80%) center center / cover no-repeat;
- color: white;
- }`);
- try {
- dwu.loadSheetUsingURIString(uri, dwu.USER_SHEET);
- } catch (e) {}
- });
-
- let promise = promiseTestHighlighterOutput(browser, word, expectedResult, node => {
- Assert.ok(node.style.background.startsWith("rgba(255, 255, 255"),
- "Dark HTML page should have a white background color set for the mask");
- });
- yield promiseEnterStringIntoFindField(findbar, word);
- yield promise;
-
- findbar.close(true);
- });
-});
-
-add_task(function* testHighlightAllToggle() {
- let url = kFixtureBaseURL + "file_FinderSample.html";
- yield BrowserTestUtils.withNewTab(url, function* (browser) {
- let findbar = gBrowser.getFindBar();
-
- yield promiseOpenFindbar(findbar);
-
- let word = "Roland";
- let expectedResult = {
- rectCount: 2,
- insertCalls: [2, 4],
- removeCalls: [0, 1]
- };
- let promise = promiseTestHighlighterOutput(browser, word, expectedResult);
- yield promiseEnterStringIntoFindField(findbar, word);
- yield promise;
-
- // We now know we have multiple rectangles highlighted, so it's a good time
- // to flip the pref.
- expectedResult = {
- rectCount: 0,
- insertCalls: [0, 1],
- removeCalls: [0, 1]
- };
- promise = promiseTestHighlighterOutput(browser, word, expectedResult);
- yield SpecialPowers.pushPrefEnv({ "set": [[ kHighlightAllPref, false ]] });
- yield promise;
-
- // For posterity, let's switch back.
- expectedResult = {
- rectCount: 2,
- insertCalls: [1, 3],
- removeCalls: [0, 1]
- };
- promise = promiseTestHighlighterOutput(browser, word, expectedResult);
- yield SpecialPowers.pushPrefEnv({ "set": [[ kHighlightAllPref, true ]] });
- yield promise;
- });
-});
-
-add_task(function* testXMLDocument() {
- let url = "data:text/xml;charset=utf-8," + encodeURIComponent(`<?xml version="1.0"?>
-<result>
- <Title>Example</Title>
- <Error>Error</Error>
-</result>`);
- yield BrowserTestUtils.withNewTab(url, function* (browser) {
- let findbar = gBrowser.getFindBar();
-
- yield promiseOpenFindbar(findbar);
-
- let word = "Example";
- let expectedResult = {
- rectCount: 0,
- insertCalls: [1, 4],
- removeCalls: [0, 1]
- };
- let promise = promiseTestHighlighterOutput(browser, word, expectedResult);
- yield promiseEnterStringIntoFindField(findbar, word);
- yield promise;
-
- findbar.close(true);
- });
-});
-
-add_task(function* testHideOnLocationChange() {
- let url = kFixtureBaseURL + "file_FinderSample.html";
- let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, url);
- let browser = tab.linkedBrowser;
- let findbar = gBrowser.getFindBar();
-
- yield promiseOpenFindbar(findbar);
-
- let word = "Roland";
- let expectedResult = {
- rectCount: 2,
- insertCalls: [2, 4],
- removeCalls: [0, 1]
- };
- let promise = promiseTestHighlighterOutput(browser, word, expectedResult);
- yield promiseEnterStringIntoFindField(findbar, word);
- yield promise;
-
- // Now we try to navigate away! (Using the same page)
- promise = promiseTestHighlighterOutput(browser, word, {
- rectCount: 0,
- insertCalls: [0, 0],
- removeCalls: [1, 2]
- });
- yield BrowserTestUtils.loadURI(browser, url);
- yield promise;
-
- yield BrowserTestUtils.removeTab(tab);
-});
-
-add_task(function* testHideOnClear() {
- let url = kFixtureBaseURL + "file_FinderSample.html";
- yield BrowserTestUtils.withNewTab(url, function* (browser) {
- let findbar = gBrowser.getFindBar();
- yield promiseOpenFindbar(findbar);
-
- let word = "Roland";
- let expectedResult = {
- rectCount: 2,
- insertCalls: [2, 4],
- removeCalls: [0, 2]
- };
- let promise = promiseTestHighlighterOutput(browser, word, expectedResult);
- yield promiseEnterStringIntoFindField(findbar, word);
- yield promise;
-
- yield new Promise(resolve => setTimeout(resolve, kIteratorTimeout));
- promise = promiseTestHighlighterOutput(browser, "", {
- rectCount: 0,
- insertCalls: [0, 0],
- removeCalls: [1, 2]
- });
- findbar.clear();
- yield promise;
-
- findbar.close(true);
- });
-});
diff --git a/toolkit/modules/tests/browser/browser_Finder_hidden_textarea.js b/toolkit/modules/tests/browser/browser_Finder_hidden_textarea.js
deleted file mode 100644
index 99d838ada..000000000
--- a/toolkit/modules/tests/browser/browser_Finder_hidden_textarea.js
+++ /dev/null
@@ -1,52 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-add_task(function* test_bug1174036() {
- const URI =
- "<body><textarea>e1</textarea><textarea>e2</textarea><textarea>e3</textarea></body>";
- yield BrowserTestUtils.withNewTab({ gBrowser, url: "data:text/html;charset=utf-8," + encodeURIComponent(URI) },
- function* (browser) {
- // Hide the first textarea.
- yield ContentTask.spawn(browser, null, function() {
- content.document.getElementsByTagName("textarea")[0].style.display = "none";
- });
-
- let finder = browser.finder;
- let listener = {
- onFindResult: function () {
- ok(false, "callback wasn't replaced");
- }
- };
- finder.addResultListener(listener);
-
- function waitForFind() {
- return new Promise(resolve => {
- listener.onFindResult = resolve;
- })
- }
-
- // Find the first 'e' (which should be in the second textarea).
- let promiseFind = waitForFind();
- finder.fastFind("e", false, false);
- let findResult = yield promiseFind;
- is(findResult.result, Ci.nsITypeAheadFind.FIND_FOUND, "find first string");
-
- let firstRect = findResult.rect;
-
- // Find the second 'e' (in the third textarea).
- promiseFind = waitForFind();
- finder.findAgain(false, false, false);
- findResult = yield promiseFind;
- is(findResult.result, Ci.nsITypeAheadFind.FIND_FOUND, "find second string");
- ok(!findResult.rect.equals(firstRect), "found new string");
-
- // Ensure that we properly wrap to the second textarea.
- promiseFind = waitForFind();
- finder.findAgain(false, false, false);
- findResult = yield promiseFind;
- is(findResult.result, Ci.nsITypeAheadFind.FIND_WRAPPED, "wrapped to first string");
- ok(findResult.rect.equals(firstRect), "wrapped to original string");
-
- finder.removeResultListener(listener);
- });
-});
diff --git a/toolkit/modules/tests/browser/browser_Geometry.js b/toolkit/modules/tests/browser/browser_Geometry.js
deleted file mode 100644
index aaca79a06..000000000
--- a/toolkit/modules/tests/browser/browser_Geometry.js
+++ /dev/null
@@ -1,111 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var tempScope = {};
-Components.utils.import("resource://gre/modules/Geometry.jsm", tempScope);
-var Point = tempScope.Point;
-var Rect = tempScope.Rect;
-
-function test() {
- ok(Rect, "Rect class exists");
- for (var fname in tests) {
- tests[fname]();
- }
-}
-
-var tests = {
- testGetDimensions: function() {
- let r = new Rect(5, 10, 100, 50);
- ok(r.left == 5, "rect has correct left value");
- ok(r.top == 10, "rect has correct top value");
- ok(r.right == 105, "rect has correct right value");
- ok(r.bottom == 60, "rect has correct bottom value");
- ok(r.width == 100, "rect has correct width value");
- ok(r.height == 50, "rect has correct height value");
- ok(r.x == 5, "rect has correct x value");
- ok(r.y == 10, "rect has correct y value");
- },
-
- testIsEmpty: function() {
- let r = new Rect(0, 0, 0, 10);
- ok(r.isEmpty(), "rect with nonpositive width is empty");
- r = new Rect(0, 0, 10, 0);
- ok(r.isEmpty(), "rect with nonpositive height is empty");
- r = new Rect(0, 0, 10, 10);
- ok(!r.isEmpty(), "rect with positive dimensions is not empty");
- },
-
- testRestrictTo: function() {
- let r1 = new Rect(10, 10, 100, 100);
- let r2 = new Rect(50, 50, 100, 100);
- r1.restrictTo(r2);
- ok(r1.equals(new Rect(50, 50, 60, 60)), "intersection is non-empty");
-
- r1 = new Rect(10, 10, 100, 100);
- r2 = new Rect(120, 120, 100, 100);
- r1.restrictTo(r2);
- ok(r1.isEmpty(), "intersection is empty");
-
- r1 = new Rect(10, 10, 100, 100);
- r2 = new Rect(0, 0, 0, 0);
- r1.restrictTo(r2);
- ok(r1.isEmpty(), "intersection of rect and empty is empty");
-
- r1 = new Rect(0, 0, 0, 0);
- r2 = new Rect(0, 0, 0, 0);
- r1.restrictTo(r2);
- ok(r1.isEmpty(), "intersection of empty and empty is empty");
- },
-
- testExpandToContain: function() {
- let r1 = new Rect(10, 10, 100, 100);
- let r2 = new Rect(50, 50, 100, 100);
- r1.expandToContain(r2);
- ok(r1.equals(new Rect(10, 10, 140, 140)), "correct expandToContain on intersecting rectangles");
-
- r1 = new Rect(10, 10, 100, 100);
- r2 = new Rect(120, 120, 100, 100);
- r1.expandToContain(r2);
- ok(r1.equals(new Rect(10, 10, 210, 210)), "correct expandToContain on non-intersecting rectangles");
-
- r1 = new Rect(10, 10, 100, 100);
- r2 = new Rect(0, 0, 0, 0);
- r1.expandToContain(r2);
- ok(r1.equals(new Rect(10, 10, 100, 100)), "expandToContain of rect and empty is rect");
-
- r1 = new Rect(10, 10, 0, 0);
- r2 = new Rect(0, 0, 0, 0);
- r1.expandToContain(r2);
- ok(r1.isEmpty(), "expandToContain of empty and empty is empty");
- },
-
- testSubtract: function testSubtract() {
- function equals(rects1, rects2) {
- return rects1.length == rects2.length && rects1.every(function(r, i) {
- return r.equals(rects2[i]);
- });
- }
-
- let r1 = new Rect(0, 0, 100, 100);
- let r2 = new Rect(500, 500, 100, 100);
- ok(equals(r1.subtract(r2), [r1]), "subtract area outside of region yields same region");
-
- r1 = new Rect(0, 0, 100, 100);
- r2 = new Rect(-10, -10, 50, 120);
- ok(equals(r1.subtract(r2), [new Rect(40, 0, 60, 100)]), "subtracting vertical bar from edge leaves one rect");
-
- r1 = new Rect(0, 0, 100, 100);
- r2 = new Rect(-10, -10, 120, 50);
- ok(equals(r1.subtract(r2), [new Rect(0, 40, 100, 60)]), "subtracting horizontal bar from edge leaves one rect");
-
- r1 = new Rect(0, 0, 100, 100);
- r2 = new Rect(40, 40, 20, 20);
- ok(equals(r1.subtract(r2), [
- new Rect(0, 0, 40, 100),
- new Rect(40, 0, 20, 40),
- new Rect(40, 60, 20, 40),
- new Rect(60, 0, 40, 100)]),
- "subtracting rect in middle leaves union of rects");
- },
-};
diff --git a/toolkit/modules/tests/browser/browser_InlineSpellChecker.js b/toolkit/modules/tests/browser/browser_InlineSpellChecker.js
deleted file mode 100644
index 2bffc9722..000000000
--- a/toolkit/modules/tests/browser/browser_InlineSpellChecker.js
+++ /dev/null
@@ -1,121 +0,0 @@
-function test() {
- let tempScope = {};
- Components.utils.import("resource://gre/modules/InlineSpellChecker.jsm", tempScope);
- let InlineSpellChecker = tempScope.InlineSpellChecker;
-
- ok(InlineSpellChecker, "InlineSpellChecker class exists");
- for (var fname in tests) {
- tests[fname]();
- }
-}
-
-var tests = {
- // Test various possible dictionary name to ensure they display as expected.
- // XXX: This only works for the 'en-US' locale, as the testing involves localized output.
- testDictionaryDisplayNames: function() {
- let isc = new InlineSpellChecker();
-
- // Check non-well-formed language tag.
- is(isc.getDictionaryDisplayName("-invalid-"), "-invalid-", "'-invalid-' should display as '-invalid-'");
-
- // XXX: It isn't clear how we'd ideally want to display variant subtags.
-
- // Check valid language subtag.
- is(isc.getDictionaryDisplayName("en"), "English", "'en' should display as 'English'");
- is(isc.getDictionaryDisplayName("en-fonipa"), "English (fonipa)", "'en-fonipa' should display as 'English (fonipa)'");
- is(isc.getDictionaryDisplayName("en-qxqaaaaz"), "English (qxqaaaaz)", "'en-qxqaaaaz' should display as 'English (qxqaaaaz)'");
-
- // Check valid language subtag and valid region subtag.
- is(isc.getDictionaryDisplayName("en-US"), "English (United States)", "'en-US' should display as 'English (United States)'");
- is(isc.getDictionaryDisplayName("en-US-fonipa"), "English (United States) (fonipa)", "'en-US-fonipa' should display as 'English (United States) (fonipa)'");
- is(isc.getDictionaryDisplayName("en-US-qxqaaaaz"), "English (United States) (qxqaaaaz)", "'en-US-qxqaaaaz' should display as 'English (United States) (qxqaaaaz)'");
-
- // Check valid language subtag and invalid but well-formed region subtag.
- is(isc.getDictionaryDisplayName("en-WO"), "English (WO)", "'en-WO' should display as 'English (WO)'");
- is(isc.getDictionaryDisplayName("en-WO-fonipa"), "English (WO) (fonipa)", "'en-WO-fonipa' should display as 'English (WO) (fonipa)'");
- is(isc.getDictionaryDisplayName("en-WO-qxqaaaaz"), "English (WO) (qxqaaaaz)", "'en-WO-qxqaaaaz' should display as 'English (WO) (qxqaaaaz)'");
-
- // Check valid language subtag and valid script subtag.
- todo_is(isc.getDictionaryDisplayName("en-Cyrl"), "English / Cyrillic", "'en-Cyrl' should display as 'English / Cyrillic'");
- todo_is(isc.getDictionaryDisplayName("en-Cyrl-fonipa"), "English / Cyrillic (fonipa)", "'en-Cyrl-fonipa' should display as 'English / Cyrillic (fonipa)'");
- todo_is(isc.getDictionaryDisplayName("en-Cyrl-qxqaaaaz"), "English / Cyrillic (qxqaaaaz)", "'en-Cyrl-qxqaaaaz' should display as 'English / Cyrillic (qxqaaaaz)'");
- todo_is(isc.getDictionaryDisplayName("en-Cyrl-US"), "English (United States) / Cyrillic", "'en-Cyrl-US' should display as 'English (United States) / Cyrillic'");
- todo_is(isc.getDictionaryDisplayName("en-Cyrl-US-fonipa"), "English (United States) / Cyrillic (fonipa)", "'en-Cyrl-US-fonipa' should display as 'English (United States) / Cyrillic (fonipa)'");
- todo_is(isc.getDictionaryDisplayName("en-Cyrl-US-qxqaaaaz"), "English (United States) / Cyrillic (qxqaaaaz)", "'en-Cyrl-US-qxqaaaaz' should display as 'English (United States) / Cyrillic (qxqaaaaz)'");
- todo_is(isc.getDictionaryDisplayName("en-Cyrl-WO"), "English (WO) / Cyrillic", "'en-Cyrl-WO' should display as 'English (WO) / Cyrillic'");
- todo_is(isc.getDictionaryDisplayName("en-Cyrl-WO-fonipa"), "English (WO) / Cyrillic (fonipa)", "'en-Cyrl-WO-fonipa' should display as 'English (WO) / Cyrillic (fonipa)'");
- todo_is(isc.getDictionaryDisplayName("en-Cyrl-WO-qxqaaaaz"), "English (WO) / Cyrillic (qxqaaaaz)", "'en-Cyrl-WO-qxqaaaaz' should display as 'English (WO) / Cyrillic (qxqaaaaz)'");
-
- // Check valid language subtag and invalid but well-formed script subtag.
- is(isc.getDictionaryDisplayName("en-Qaaz"), "English / Qaaz", "'en-Qaaz' should display as 'English / Qaaz'");
- is(isc.getDictionaryDisplayName("en-Qaaz-fonipa"), "English / Qaaz (fonipa)", "'en-Qaaz-fonipa' should display as 'English / Qaaz (fonipa)'");
- is(isc.getDictionaryDisplayName("en-Qaaz-qxqaaaaz"), "English / Qaaz (qxqaaaaz)", "'en-Qaaz-qxqaaaaz' should display as 'English / Qaaz (qxqaaaaz)'");
- is(isc.getDictionaryDisplayName("en-Qaaz-US"), "English (United States) / Qaaz", "'en-Qaaz-US' should display as 'English (United States) / Qaaz'");
- is(isc.getDictionaryDisplayName("en-Qaaz-US-fonipa"), "English (United States) / Qaaz (fonipa)", "'en-Qaaz-US-fonipa' should display as 'English (United States) / Qaaz (fonipa)'");
- is(isc.getDictionaryDisplayName("en-Qaaz-US-qxqaaaaz"), "English (United States) / Qaaz (qxqaaaaz)", "'en-Qaaz-US-qxqaaaaz' should display as 'English (United States) / Qaaz (qxqaaaaz)'");
- is(isc.getDictionaryDisplayName("en-Qaaz-WO"), "English (WO) / Qaaz", "'en-Qaaz-WO' should display as 'English (WO) / Qaaz'");
- is(isc.getDictionaryDisplayName("en-Qaaz-WO-fonipa"), "English (WO) / Qaaz (fonipa)", "'en-Qaaz-WO-fonipa' should display as 'English (WO) / Qaaz (fonipa)'");
- is(isc.getDictionaryDisplayName("en-Qaaz-WO-qxqaaaaz"), "English (WO) / Qaaz (qxqaaaaz)", "'en-Qaaz-WO-qxqaaaaz' should display as 'English (WO) / Qaaz (qxqaaaaz)'");
-
- // Check invalid but well-formed language subtag.
- is(isc.getDictionaryDisplayName("qaz"), "qaz", "'qaz' should display as 'qaz'");
- is(isc.getDictionaryDisplayName("qaz-fonipa"), "qaz (fonipa)", "'qaz-fonipa' should display as 'qaz (fonipa)'");
- is(isc.getDictionaryDisplayName("qaz-qxqaaaaz"), "qaz (qxqaaaaz)", "'qaz-qxqaaaaz' should display as 'qaz (qxqaaaaz)'");
-
- // Check invalid but well-formed language subtag and valid region subtag.
- is(isc.getDictionaryDisplayName("qaz-US"), "qaz (United States)", "'qaz-US' should display as 'qaz (United States)'");
- is(isc.getDictionaryDisplayName("qaz-US-fonipa"), "qaz (United States) (fonipa)", "'qaz-US-fonipa' should display as 'qaz (United States) (fonipa)'");
- is(isc.getDictionaryDisplayName("qaz-US-qxqaaaaz"), "qaz (United States) (qxqaaaaz)", "'qaz-US-qxqaaaaz' should display as 'qaz (United States) (qxqaaaaz)'");
-
- // Check invalid but well-formed language subtag and invalid but well-formed region subtag.
- is(isc.getDictionaryDisplayName("qaz-WO"), "qaz (WO)", "'qaz-WO' should display as 'qaz (WO)'");
- is(isc.getDictionaryDisplayName("qaz-WO-fonipa"), "qaz (WO) (fonipa)", "'qaz-WO-fonipa' should display as 'qaz (WO) (fonipa)'");
- is(isc.getDictionaryDisplayName("qaz-WO-qxqaaaaz"), "qaz (WO) (qxqaaaaz)", "'qaz-WO-qxqaaaaz' should display as 'qaz (WO) (qxqaaaaz)'");
-
- // Check invalid but well-formed language subtag and valid script subtag.
- todo_is(isc.getDictionaryDisplayName("qaz-Cyrl"), "qaz / Cyrillic", "'qaz-Cyrl' should display as 'qaz / Cyrillic'");
- todo_is(isc.getDictionaryDisplayName("qaz-Cyrl-fonipa"), "qaz / Cyrillic (fonipa)", "'qaz-Cyrl-fonipa' should display as 'qaz / Cyrillic (fonipa)'");
- todo_is(isc.getDictionaryDisplayName("qaz-Cyrl-qxqaaaaz"), "qaz / Cyrillic (qxqaaaaz)", "'qaz-Cyrl-qxqaaaaz' should display as 'qaz / Cyrillic (qxqaaaaz)'");
- todo_is(isc.getDictionaryDisplayName("qaz-Cyrl-US"), "qaz (United States) / Cyrillic", "'qaz-Cyrl-US' should display as 'qaz (United States) / Cyrillic'");
- todo_is(isc.getDictionaryDisplayName("qaz-Cyrl-US-fonipa"), "qaz (United States) / Cyrillic (fonipa)", "'qaz-Cyrl-US-fonipa' should display as 'qaz (United States) / Cyrillic (fonipa)'");
- todo_is(isc.getDictionaryDisplayName("qaz-Cyrl-US-qxqaaaaz"), "qaz (United States) / Cyrillic (qxqaaaaz)", "'qaz-Cyrl-US-qxqaaaaz' should display as 'qaz (United States) / Cyrillic (qxqaaaaz)'");
- todo_is(isc.getDictionaryDisplayName("qaz-Cyrl-WO"), "qaz (WO) / Cyrillic", "'qaz-Cyrl-WO' should display as 'qaz (WO) / Cyrillic'");
- todo_is(isc.getDictionaryDisplayName("qaz-Cyrl-WO-fonipa"), "qaz (WO) / Cyrillic (fonipa)", "'qaz-Cyrl-WO-fonipa' should display as 'qaz (WO) / Cyrillic (fonipa)'");
- todo_is(isc.getDictionaryDisplayName("qaz-Cyrl-WO-qxqaaaaz"), "qaz (WO) / Cyrillic (qxqaaaaz)", "'qaz-Cyrl-WO-qxqaaaaz' should display as 'qaz (WO) / Cyrillic (qxqaaaaz)'");
-
- // Check invalid but well-formed language subtag and invalid but well-formed script subtag.
- is(isc.getDictionaryDisplayName("qaz-Qaaz"), "qaz / Qaaz", "'qaz-Qaaz' should display as 'qaz / Qaaz'");
- is(isc.getDictionaryDisplayName("qaz-Qaaz-fonipa"), "qaz / Qaaz (fonipa)", "'qaz-Qaaz-fonipa' should display as 'qaz / Qaaz (fonipa)'");
- is(isc.getDictionaryDisplayName("qaz-Qaaz-qxqaaaaz"), "qaz / Qaaz (qxqaaaaz)", "'qaz-Qaaz-qxqaaaaz' should display as 'qaz / Qaaz (qxqaaaaz)'");
- is(isc.getDictionaryDisplayName("qaz-Qaaz-US"), "qaz (United States) / Qaaz", "'qaz-Qaaz-US' should display as 'qaz (United States) / Qaaz'");
- is(isc.getDictionaryDisplayName("qaz-Qaaz-US-fonipa"), "qaz (United States) / Qaaz (fonipa)", "'qaz-Qaaz-US-fonipa' should display as 'qaz (United States) / Qaaz (fonipa)'");
- is(isc.getDictionaryDisplayName("qaz-Qaaz-US-qxqaaaaz"), "qaz (United States) / Qaaz (qxqaaaaz)", "'qaz-Qaaz-US-qxqaaaaz' should display as 'qaz (United States) / Qaaz (qxqaaaaz)'");
- is(isc.getDictionaryDisplayName("qaz-Qaaz-WO"), "qaz (WO) / Qaaz", "'qaz-Qaaz-WO' should display as 'qaz (WO) / Qaaz'");
- is(isc.getDictionaryDisplayName("qaz-Qaaz-WO-fonipa"), "qaz (WO) / Qaaz (fonipa)", "'qaz-Qaaz-WO-fonipa' should display as 'qaz (WO) / Qaaz (fonipa)'");
- is(isc.getDictionaryDisplayName("qaz-Qaaz-WO-qxqaaaaz"), "qaz (WO) / Qaaz (qxqaaaaz)", "'qaz-Qaaz-WO-qxqaaaaz' should display as 'qaz (WO) / Qaaz (qxqaaaaz)'");
-
- // Check multiple variant subtags.
- todo_is(isc.getDictionaryDisplayName("en-Cyrl-US-fonipa-fonxsamp"), "English (United States) / Cyrillic (fonipa / fonxsamp)", "'en-Cyrl-US-fonipa-fonxsamp' should display as 'English (United States) / Cyrillic (fonipa / fonxsamp)'");
- todo_is(isc.getDictionaryDisplayName("en-Cyrl-US-fonipa-qxqaaaaz"), "English (United States) / Cyrillic (fonipa / qxqaaaaz)", "'en-Cyrl-US-fonipa-qxqaaaaz' should display as 'English (United States) / Cyrillic (fonipa / qxqaaaaz)'");
- todo_is(isc.getDictionaryDisplayName("en-Cyrl-US-fonipa-fonxsamp-qxqaaaaz"), "English (United States) / Cyrillic (fonipa / fonxsamp / qxqaaaaz)", "'en-Cyrl-US-fonipa-fonxsamp-qxqaaaaz' should display as 'English (United States) / Cyrillic (fonipa / fonxsamp / qxqaaaaz)'");
- is(isc.getDictionaryDisplayName("qaz-Qaaz-WO-fonipa-fonxsamp"), "qaz (WO) / Qaaz (fonipa / fonxsamp)", "'qaz-Qaaz-WO-fonipa-fonxsamp' should display as 'qaz (WO) / Qaaz (fonipa / fonxsamp)'");
- is(isc.getDictionaryDisplayName("qaz-Qaaz-WO-fonipa-qxqaaaaz"), "qaz (WO) / Qaaz (fonipa / qxqaaaaz)", "'qaz-Qaaz-WO-fonipa-qxqaaaaz' should display as 'qaz (WO) / Qaaz (fonipa / qxqaaaaz)'");
- is(isc.getDictionaryDisplayName("qaz-Qaaz-WO-fonipa-fonxsamp-qxqaaaaz"), "qaz (WO) / Qaaz (fonipa / fonxsamp / qxqaaaaz)", "'qaz-Qaaz-WO-fonipa-fonxsamp-qxqaaaaz' should display as 'qaz (WO) / Qaaz (fonipa / fonxsamp / qxqaaaaz)'");
-
- // Check numeric region subtag.
- todo_is(isc.getDictionaryDisplayName("es-419"), "Spanish (Latin America and the Caribbean)", "'es-419' should display as 'Spanish (Latin America and the Caribbean)'");
-
- // Check that extension subtags are ignored.
- todo_is(isc.getDictionaryDisplayName("en-Cyrl-t-en-latn-m0-ungegn-2007"), "English / Cyrillic", "'en-Cyrl-t-en-latn-m0-ungegn-2007' should display as 'English / Cyrillic'");
-
- // Check that privateuse subtags are ignored.
- is(isc.getDictionaryDisplayName("en-x-ignore"), "English", "'en-x-ignore' should display as 'English'");
- is(isc.getDictionaryDisplayName("en-x-ignore-this"), "English", "'en-x-ignore-this' should display as 'English'");
- is(isc.getDictionaryDisplayName("en-x-ignore-this-subtag"), "English", "'en-x-ignore-this-subtag' should display as 'English'");
-
- // Check that both extension and privateuse subtags are ignored.
- todo_is(isc.getDictionaryDisplayName("en-Cyrl-t-en-latn-m0-ungegn-2007-x-ignore-this-subtag"), "English / Cyrillic", "'en-Cyrl-t-en-latn-m0-ungegn-2007-x-ignore-this-subtag' should display as 'English / Cyrillic'");
-
- // XXX: Check grandfathered tags.
- },
-};
diff --git a/toolkit/modules/tests/browser/browser_PageMetadata.js b/toolkit/modules/tests/browser/browser_PageMetadata.js
deleted file mode 100644
index ca6e18368..000000000
--- a/toolkit/modules/tests/browser/browser_PageMetadata.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/**
- * Tests PageMetadata.jsm, which extracts metadata and microdata from a
- * document.
- */
-
-var {PageMetadata} = Cu.import("resource://gre/modules/PageMetadata.jsm", {});
-
-var rootURL = "http://example.com/browser/toolkit/modules/tests/browser/";
-
-function promiseDocument(fileName) {
- let url = rootURL + fileName;
-
- return new Promise((resolve, reject) => {
- let xhr = new XMLHttpRequest();
- xhr.onload = () => resolve(xhr.responseXML);
- xhr.onerror = () => reject(new Error("Error loading document"));
- xhr.open("GET", url);
- xhr.responseType = "document";
- xhr.send();
- });
-}
-
-/**
- * Load a simple document.
- */
-add_task(function* simpleDoc() {
- let fileName = "metadata_simple.html";
- info(`Loading a simple page, ${fileName}`);
-
- let doc = yield promiseDocument(fileName);
- Assert.notEqual(doc, null,
- "Should have a document to analyse");
-
- let data = PageMetadata.getData(doc);
- Assert.notEqual(data, null,
- "Should have non-null result");
- Assert.equal(data.url, rootURL + fileName,
- "Should have expected url property");
- Assert.equal(data.title, "Test Title",
- "Should have expected title property");
- Assert.equal(data.description, "A very simple test page",
- "Should have expected title property");
-});
-
-add_task(function* titlesDoc() {
- let fileName = "metadata_titles.html";
- info(`Loading titles page, ${fileName}`);
-
- let doc = yield promiseDocument(fileName);
- Assert.notEqual(doc, null,
- "Should have a document to analyse");
-
- let data = PageMetadata.getData(doc);
- Assert.notEqual(data, null,
- "Should have non-null result");
- Assert.equal(data.title, "Test Titles",
- "Should use the page title, not the open graph title");
-});
-
-add_task(function* titlesFallbackDoc() {
- let fileName = "metadata_titles_fallback.html";
- info(`Loading titles page, ${fileName}`);
-
- let doc = yield promiseDocument(fileName);
- Assert.notEqual(doc, null,
- "Should have a document to analyse");
-
- let data = PageMetadata.getData(doc);
- Assert.notEqual(data, null,
- "Should have non-null result");
- Assert.equal(data.title, "Title",
- "Should use the open graph title");
-});
diff --git a/toolkit/modules/tests/browser/browser_PromiseMessage.js b/toolkit/modules/tests/browser/browser_PromiseMessage.js
deleted file mode 100644
index e967ac4c9..000000000
--- a/toolkit/modules/tests/browser/browser_PromiseMessage.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-/* global Cu, BrowserTestUtils, is, ok, add_task, gBrowser */
-"use strict";
-Cu.import("resource://gre/modules/PromiseMessage.jsm", this);
-
-
-const url = "http://example.org/tests/dom/manifest/test/resource.sjs";
-
-/**
- * Test basic API error conditions
- */
-add_task(function* () {
- yield BrowserTestUtils.withNewTab({gBrowser, url}, testPromiseMessageAPI)
-});
-
-function* testPromiseMessageAPI(aBrowser) {
- // Reusing an existing message.
- const msgKey = "DOM:WebManifest:hasManifestLink";
- const mm = aBrowser.messageManager;
- const id = "this should not change";
- const foo = "neitherShouldThis";
- const data = {id, foo};
-
- // This just returns false, and it doesn't matter for this test.
- yield PromiseMessage.send(mm, msgKey, data);
-
- // Check that no new props were added
- const props = Object.getOwnPropertyNames(data);
- ok(props.length === 2, "There should only be 2 props");
- ok(props.includes("id"), "Has the id property");
- ok(props.includes("foo"), "Has the foo property");
-
- // Check that the props didn't change.
- is(data.id, id, "The id prop must not change.");
- is(data.foo, foo, "The foo prop must not change.");
-}
diff --git a/toolkit/modules/tests/browser/browser_RemotePageManager.js b/toolkit/modules/tests/browser/browser_RemotePageManager.js
deleted file mode 100644
index 774d33034..000000000
--- a/toolkit/modules/tests/browser/browser_RemotePageManager.js
+++ /dev/null
@@ -1,400 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-const TEST_URL = "http://www.example.com/browser/toolkit/modules/tests/browser/testremotepagemanager.html";
-
-var { RemotePages, RemotePageManager } = Cu.import("resource://gre/modules/RemotePageManager.jsm", {});
-
-function failOnMessage(message) {
- ok(false, "Should not have seen message " + message.name);
-}
-
-function waitForMessage(port, message, expectedPort = port) {
- return new Promise((resolve) => {
- function listener(message) {
- is(message.target, expectedPort, "Message should be from the right port.");
-
- port.removeMessageListener(listener);
- resolve(message);
- }
-
- port.addMessageListener(message, listener);
- });
-}
-
-function waitForPort(url, createTab = true) {
- return new Promise((resolve) => {
- RemotePageManager.addRemotePageListener(url, (port) => {
- RemotePageManager.removeRemotePageListener(url);
-
- waitForMessage(port, "RemotePage:Load").then(() => resolve(port));
- });
-
- if (createTab)
- gBrowser.selectedTab = gBrowser.addTab(url);
- });
-}
-
-function waitForPage(pages) {
- return new Promise((resolve) => {
- function listener({ target }) {
- pages.removeMessageListener("RemotePage:Init", listener);
-
- waitForMessage(target, "RemotePage:Load").then(() => resolve(target));
- }
-
- pages.addMessageListener("RemotePage:Init", listener);
- gBrowser.selectedTab = gBrowser.addTab(TEST_URL);
- });
-}
-
-function swapDocShells(browser1, browser2) {
- // Swap frameLoaders.
- browser1.swapDocShells(browser2);
-
- // Swap permanentKeys.
- let tmp = browser1.permanentKey;
- browser1.permanentKey = browser2.permanentKey;
- browser2.permanentKey = tmp;
-}
-
-// Test that opening a page creates a port, sends the load event and then
-// navigating to a new page sends the unload event. Going back should create a
-// new port
-add_task(function* init_navigate() {
- let port = yield waitForPort(TEST_URL);
- is(port.browser, gBrowser.selectedBrowser, "Port is for the correct browser");
-
- let loaded = new Promise(resolve => {
- function listener() {
- gBrowser.selectedBrowser.removeEventListener("load", listener, true);
- resolve();
- }
- gBrowser.selectedBrowser.addEventListener("load", listener, true);
- gBrowser.loadURI("about:blank");
- });
-
- yield waitForMessage(port, "RemotePage:Unload");
-
- // Port should be destroyed now
- try {
- port.addMessageListener("Foo", failOnMessage);
- ok(false, "Should have seen exception");
- }
- catch (e) {
- ok(true, "Should have seen exception");
- }
-
- try {
- port.sendAsyncMessage("Foo");
- ok(false, "Should have seen exception");
- }
- catch (e) {
- ok(true, "Should have seen exception");
- }
-
- yield loaded;
-
- gBrowser.goBack();
- port = yield waitForPort(TEST_URL, false);
-
- port.sendAsyncMessage("Ping2");
- let message = yield waitForMessage(port, "Pong2");
- port.destroy();
-
- gBrowser.removeCurrentTab();
-});
-
-// Test that opening a page creates a port, sends the load event and then
-// closing the tab sends the unload event
-add_task(function* init_close() {
- let port = yield waitForPort(TEST_URL);
- is(port.browser, gBrowser.selectedBrowser, "Port is for the correct browser");
-
- let unloadPromise = waitForMessage(port, "RemotePage:Unload");
- gBrowser.removeCurrentTab();
- yield unloadPromise;
-
- // Port should be destroyed now
- try {
- port.addMessageListener("Foo", failOnMessage);
- ok(false, "Should have seen exception");
- }
- catch (e) {
- ok(true, "Should have seen exception");
- }
-
- try {
- port.sendAsyncMessage("Foo");
- ok(false, "Should have seen exception");
- }
- catch (e) {
- ok(true, "Should have seen exception");
- }
-});
-
-// Tests that we can send messages to individual pages even when more than one
-// is open
-add_task(function* multiple_ports() {
- let port1 = yield waitForPort(TEST_URL);
- is(port1.browser, gBrowser.selectedBrowser, "Port is for the correct browser");
-
- let port2 = yield waitForPort(TEST_URL);
- is(port2.browser, gBrowser.selectedBrowser, "Port is for the correct browser");
-
- port2.addMessageListener("Pong", failOnMessage);
- port1.sendAsyncMessage("Ping", { str: "foobar", counter: 0 });
- let message = yield waitForMessage(port1, "Pong");
- port2.removeMessageListener("Pong", failOnMessage);
- is(message.data.str, "foobar", "String should pass through");
- is(message.data.counter, 1, "Counter should be incremented");
-
- port1.addMessageListener("Pong", failOnMessage);
- port2.sendAsyncMessage("Ping", { str: "foobaz", counter: 5 });
- message = yield waitForMessage(port2, "Pong");
- port1.removeMessageListener("Pong", failOnMessage);
- is(message.data.str, "foobaz", "String should pass through");
- is(message.data.counter, 6, "Counter should be incremented");
-
- let unloadPromise = waitForMessage(port2, "RemotePage:Unload");
- gBrowser.removeTab(gBrowser.getTabForBrowser(port2.browser));
- yield unloadPromise;
-
- try {
- port2.addMessageListener("Pong", failOnMessage);
- ok(false, "Should not have been able to add a new message listener to a destroyed port.");
- }
- catch (e) {
- ok(true, "Should not have been able to add a new message listener to a destroyed port.");
- }
-
- port1.sendAsyncMessage("Ping", { str: "foobar", counter: 0 });
- message = yield waitForMessage(port1, "Pong");
- is(message.data.str, "foobar", "String should pass through");
- is(message.data.counter, 1, "Counter should be incremented");
-
- unloadPromise = waitForMessage(port1, "RemotePage:Unload");
- gBrowser.removeTab(gBrowser.getTabForBrowser(port1.browser));
- yield unloadPromise;
-});
-
-// Tests that swapping browser docshells doesn't break the ports
-add_task(function* browser_switch() {
- let port1 = yield waitForPort(TEST_URL);
- is(port1.browser, gBrowser.selectedBrowser, "Port is for the correct browser");
- let browser1 = gBrowser.selectedBrowser;
- port1.sendAsyncMessage("SetCookie", { value: "om nom" });
-
- let port2 = yield waitForPort(TEST_URL);
- is(port2.browser, gBrowser.selectedBrowser, "Port is for the correct browser");
- let browser2 = gBrowser.selectedBrowser;
- port2.sendAsyncMessage("SetCookie", { value: "om nom nom" });
-
- port2.addMessageListener("Cookie", failOnMessage);
- port1.sendAsyncMessage("GetCookie");
- let message = yield waitForMessage(port1, "Cookie");
- port2.removeMessageListener("Cookie", failOnMessage);
- is(message.data.value, "om nom", "Should have the right cookie");
-
- port1.addMessageListener("Cookie", failOnMessage);
- port2.sendAsyncMessage("GetCookie", { str: "foobaz", counter: 5 });
- message = yield waitForMessage(port2, "Cookie");
- port1.removeMessageListener("Cookie", failOnMessage);
- is(message.data.value, "om nom nom", "Should have the right cookie");
-
- swapDocShells(browser1, browser2);
- is(port1.browser, browser2, "Should have noticed the swap");
- is(port2.browser, browser1, "Should have noticed the swap");
-
- // Cookies should have stayed the same
- port2.addMessageListener("Cookie", failOnMessage);
- port1.sendAsyncMessage("GetCookie");
- message = yield waitForMessage(port1, "Cookie");
- port2.removeMessageListener("Cookie", failOnMessage);
- is(message.data.value, "om nom", "Should have the right cookie");
-
- port1.addMessageListener("Cookie", failOnMessage);
- port2.sendAsyncMessage("GetCookie", { str: "foobaz", counter: 5 });
- message = yield waitForMessage(port2, "Cookie");
- port1.removeMessageListener("Cookie", failOnMessage);
- is(message.data.value, "om nom nom", "Should have the right cookie");
-
- swapDocShells(browser1, browser2);
- is(port1.browser, browser1, "Should have noticed the swap");
- is(port2.browser, browser2, "Should have noticed the swap");
-
- // Cookies should have stayed the same
- port2.addMessageListener("Cookie", failOnMessage);
- port1.sendAsyncMessage("GetCookie");
- message = yield waitForMessage(port1, "Cookie");
- port2.removeMessageListener("Cookie", failOnMessage);
- is(message.data.value, "om nom", "Should have the right cookie");
-
- port1.addMessageListener("Cookie", failOnMessage);
- port2.sendAsyncMessage("GetCookie", { str: "foobaz", counter: 5 });
- message = yield waitForMessage(port2, "Cookie");
- port1.removeMessageListener("Cookie", failOnMessage);
- is(message.data.value, "om nom nom", "Should have the right cookie");
-
- let unloadPromise = waitForMessage(port2, "RemotePage:Unload");
- gBrowser.removeTab(gBrowser.getTabForBrowser(browser2));
- yield unloadPromise;
-
- unloadPromise = waitForMessage(port1, "RemotePage:Unload");
- gBrowser.removeTab(gBrowser.getTabForBrowser(browser1));
- yield unloadPromise;
-});
-
-// Tests that removeMessageListener in chrome works
-add_task(function* remove_chrome_listener() {
- let port = yield waitForPort(TEST_URL);
- is(port.browser, gBrowser.selectedBrowser, "Port is for the correct browser");
-
- // This relies on messages sent arriving in the same order. Pong will be
- // sent back before Pong2 so if removeMessageListener fails the test will fail
- port.addMessageListener("Pong", failOnMessage);
- port.removeMessageListener("Pong", failOnMessage);
- port.sendAsyncMessage("Ping", { str: "remove_listener", counter: 27 });
- port.sendAsyncMessage("Ping2");
- yield waitForMessage(port, "Pong2");
-
- let unloadPromise = waitForMessage(port, "RemotePage:Unload");
- gBrowser.removeCurrentTab();
- yield unloadPromise;
-});
-
-// Tests that removeMessageListener in content works
-add_task(function* remove_content_listener() {
- let port = yield waitForPort(TEST_URL);
- is(port.browser, gBrowser.selectedBrowser, "Port is for the correct browser");
-
- // This relies on messages sent arriving in the same order. Pong3 would be
- // sent back before Pong2 so if removeMessageListener fails the test will fail
- port.addMessageListener("Pong3", failOnMessage);
- port.sendAsyncMessage("Ping3");
- port.sendAsyncMessage("Ping2");
- yield waitForMessage(port, "Pong2");
-
- let unloadPromise = waitForMessage(port, "RemotePage:Unload");
- gBrowser.removeCurrentTab();
- yield unloadPromise;
-});
-
-// Test RemotePages works
-add_task(function* remote_pages_basic() {
- let pages = new RemotePages(TEST_URL);
- let port = yield waitForPage(pages);
- is(port.browser, gBrowser.selectedBrowser, "Port is for the correct browser");
-
- // Listening to global messages should work
- let unloadPromise = waitForMessage(pages, "RemotePage:Unload", port);
- gBrowser.removeCurrentTab();
- yield unloadPromise;
-
- pages.destroy();
-
- // RemotePages should be destroyed now
- try {
- pages.addMessageListener("Foo", failOnMessage);
- ok(false, "Should have seen exception");
- }
- catch (e) {
- ok(true, "Should have seen exception");
- }
-
- try {
- pages.sendAsyncMessage("Foo");
- ok(false, "Should have seen exception");
- }
- catch (e) {
- ok(true, "Should have seen exception");
- }
-});
-
-// Test sending messages to all remote pages works
-add_task(function* remote_pages_multiple() {
- let pages = new RemotePages(TEST_URL);
- let port1 = yield waitForPage(pages);
- let port2 = yield waitForPage(pages);
-
- let pongPorts = [];
- yield new Promise((resolve) => {
- function listener({ name, target, data }) {
- is(name, "Pong", "Should have seen the right response.");
- is(data.str, "remote_pages", "String should pass through");
- is(data.counter, 43, "Counter should be incremented");
- pongPorts.push(target);
- if (pongPorts.length == 2)
- resolve();
- }
-
- pages.addMessageListener("Pong", listener);
- pages.sendAsyncMessage("Ping", { str: "remote_pages", counter: 42 });
- });
-
- // We don't make any guarantees about which order messages are sent to known
- // pages so the pongs could have come back in any order.
- isnot(pongPorts[0], pongPorts[1], "Should have received pongs from different ports");
- ok(pongPorts.indexOf(port1) >= 0, "Should have seen a pong from port1");
- ok(pongPorts.indexOf(port2) >= 0, "Should have seen a pong from port2");
-
- // After destroy we should see no messages
- pages.addMessageListener("RemotePage:Unload", failOnMessage);
- pages.destroy();
-
- gBrowser.removeTab(gBrowser.getTabForBrowser(port1.browser));
- gBrowser.removeTab(gBrowser.getTabForBrowser(port2.browser));
-});
-
-// Test sending various types of data across the boundary
-add_task(function* send_data() {
- let port = yield waitForPort(TEST_URL);
- is(port.browser, gBrowser.selectedBrowser, "Port is for the correct browser");
-
- let data = {
- integer: 45,
- real: 45.78,
- str: "foobar",
- array: [1, 2, 3, 5, 27]
- };
-
- port.sendAsyncMessage("SendData", data);
- let message = yield waitForMessage(port, "ReceivedData");
-
- ok(message.data.result, message.data.status);
-
- gBrowser.removeCurrentTab();
-});
-
-// Test sending an object of data across the boundary
-add_task(function* send_data2() {
- let port = yield waitForPort(TEST_URL);
- is(port.browser, gBrowser.selectedBrowser, "Port is for the correct browser");
-
- let data = {
- integer: 45,
- real: 45.78,
- str: "foobar",
- array: [1, 2, 3, 5, 27]
- };
-
- port.sendAsyncMessage("SendData2", {data});
- let message = yield waitForMessage(port, "ReceivedData2");
-
- ok(message.data.result, message.data.status);
-
- gBrowser.removeCurrentTab();
-});
-
-add_task(function* get_ports_for_browser() {
- let pages = new RemotePages(TEST_URL);
- let port = yield waitForPage(pages);
- // waitForPage creates a new tab and selects it by default, so
- // the selected tab should be the one hosting this port.
- let browser = gBrowser.selectedBrowser;
- let foundPorts = pages.portsForBrowser(browser);
- is(foundPorts.length, 1, "There should only be one port for this simple page");
- is(foundPorts[0], port, "Should find the port");
- gBrowser.removeCurrentTab();
-});
diff --git a/toolkit/modules/tests/browser/browser_Troubleshoot.js b/toolkit/modules/tests/browser/browser_Troubleshoot.js
deleted file mode 100644
index ebc4de1f9..000000000
--- a/toolkit/modules/tests/browser/browser_Troubleshoot.js
+++ /dev/null
@@ -1,559 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// Ideally this would be an xpcshell test, but Troubleshoot relies on things
-// that aren't initialized outside of a XUL app environment like AddonManager
-// and the "@mozilla.org/xre/app-info;1" component.
-
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/Troubleshoot.jsm");
-
-function test() {
- waitForExplicitFinish();
- function doNextTest() {
- if (!tests.length) {
- finish();
- return;
- }
- tests.shift()(doNextTest);
- }
- doNextTest();
-}
-
-registerCleanupFunction(function () {
- // Troubleshoot.jsm is imported into the global scope -- the window -- above.
- // If it's not deleted, it outlives the test and is reported as a leak.
- delete window.Troubleshoot;
-});
-
-var tests = [
-
- function snapshotSchema(done) {
- Troubleshoot.snapshot(function (snapshot) {
- try {
- validateObject(snapshot, SNAPSHOT_SCHEMA);
- ok(true, "The snapshot should conform to the schema.");
- }
- catch (err) {
- ok(false, "Schema mismatch, " + err);
- }
- done();
- });
- },
-
- function modifiedPreferences(done) {
- let prefs = [
- "javascript.troubleshoot",
- "troubleshoot.foo",
- "javascript.print_to_filename",
- "network.proxy.troubleshoot",
- ];
- prefs.forEach(function (p) {
- Services.prefs.setBoolPref(p, true);
- is(Services.prefs.getBoolPref(p), true, "The pref should be set: " + p);
- });
- Troubleshoot.snapshot(function (snapshot) {
- let p = snapshot.modifiedPreferences;
- is(p["javascript.troubleshoot"], true,
- "The pref should be present because it's whitelisted " +
- "but not blacklisted.");
- ok(!("troubleshoot.foo" in p),
- "The pref should be absent because it's not in the whitelist.");
- ok(!("javascript.print_to_filename" in p),
- "The pref should be absent because it's blacklisted.");
- ok(!("network.proxy.troubleshoot" in p),
- "The pref should be absent because it's blacklisted.");
- prefs.forEach(p => Services.prefs.deleteBranch(p));
- done();
- });
- },
-
- function unicodePreferences(done) {
- let name = "font.name.sans-serif.x-western";
- let utf8Value = "\xc4\x8capk\xc5\xafv Krasopis"
- let unicodeValue = "\u010Capk\u016Fv Krasopis";
-
- // set/getCharPref work with 8bit strings (utf8)
- Services.prefs.setCharPref(name, utf8Value);
-
- Troubleshoot.snapshot(function (snapshot) {
- let p = snapshot.modifiedPreferences;
- is(p[name], unicodeValue, "The pref should have correct Unicode value.");
- Services.prefs.deleteBranch(name);
- done();
- });
- }
-];
-
-// This is inspired by JSON Schema, or by the example on its Wikipedia page
-// anyway.
-const SNAPSHOT_SCHEMA = {
- type: "object",
- required: true,
- properties: {
- application: {
- required: true,
- type: "object",
- properties: {
- name: {
- required: true,
- type: "string",
- },
- version: {
- required: true,
- type: "string",
- },
- buildID: {
- required: true,
- type: "string",
- },
- userAgent: {
- required: true,
- type: "string",
- },
- osVersion: {
- required: true,
- type: "string",
- },
- vendor: {
- type: "string",
- },
- updateChannel: {
- type: "string",
- },
- supportURL: {
- type: "string",
- },
- numTotalWindows: {
- type: "number",
- },
- numRemoteWindows: {
- type: "number",
- },
- safeMode: {
- type: "boolean",
- },
- },
- },
- crashes: {
- required: false,
- type: "object",
- properties: {
- pending: {
- required: true,
- type: "number",
- },
- submitted: {
- required: true,
- type: "array",
- items: {
- type: "object",
- properties: {
- id: {
- required: true,
- type: "string",
- },
- date: {
- required: true,
- type: "number",
- },
- pending: {
- required: true,
- type: "boolean",
- },
- },
- },
- },
- },
- },
- extensions: {
- required: true,
- type: "array",
- items: {
- type: "object",
- properties: {
- name: {
- required: true,
- type: "string",
- },
- version: {
- required: true,
- type: "string",
- },
- id: {
- required: true,
- type: "string",
- },
- isActive: {
- required: true,
- type: "boolean",
- },
- },
- },
- },
- modifiedPreferences: {
- required: true,
- type: "object",
- },
- lockedPreferences: {
- required: true,
- type: "object",
- },
- graphics: {
- required: true,
- type: "object",
- properties: {
- numTotalWindows: {
- required: true,
- type: "number",
- },
- numAcceleratedWindows: {
- required: true,
- type: "number",
- },
- windowLayerManagerType: {
- type: "string",
- },
- windowLayerManagerRemote: {
- type: "boolean",
- },
- supportsHardwareH264: {
- type: "string",
- },
- currentAudioBackend: {
- type: "string",
- },
- numAcceleratedWindowsMessage: {
- type: "array",
- },
- adapterDescription: {
- type: "string",
- },
- adapterVendorID: {
- type: "string",
- },
- adapterDeviceID: {
- type: "string",
- },
- adapterSubsysID: {
- type: "string",
- },
- adapterRAM: {
- type: "string",
- },
- adapterDrivers: {
- type: "string",
- },
- driverVersion: {
- type: "string",
- },
- driverDate: {
- type: "string",
- },
- adapterDescription2: {
- type: "string",
- },
- adapterVendorID2: {
- type: "string",
- },
- adapterDeviceID2: {
- type: "string",
- },
- adapterSubsysID2: {
- type: "string",
- },
- adapterRAM2: {
- type: "string",
- },
- adapterDrivers2: {
- type: "string",
- },
- driverVersion2: {
- type: "string",
- },
- driverDate2: {
- type: "string",
- },
- isGPU2Active: {
- type: "boolean",
- },
- direct2DEnabled: {
- type: "boolean",
- },
- directWriteEnabled: {
- type: "boolean",
- },
- directWriteVersion: {
- type: "string",
- },
- clearTypeParameters: {
- type: "string",
- },
- webgl1Renderer: {
- type: "string",
- },
- webgl1Version: {
- type: "string",
- },
- webgl1DriverExtensions: {
- type: "string",
- },
- webgl1Extensions: {
- type: "string",
- },
- webgl1WSIInfo: {
- type: "string",
- },
- webgl2Renderer: {
- type: "string",
- },
- webgl2Version: {
- type: "string",
- },
- webgl2DriverExtensions: {
- type: "string",
- },
- webgl2Extensions: {
- type: "string",
- },
- webgl2WSIInfo: {
- type: "string",
- },
- info: {
- type: "object",
- },
- failures: {
- type: "array",
- items: {
- type: "string",
- },
- },
- indices: {
- type: "array",
- items: {
- type: "number",
- },
- },
- featureLog: {
- type: "object",
- },
- crashGuards: {
- type: "array",
- },
- direct2DEnabledMessage: {
- type: "array",
- },
- },
- },
- javaScript: {
- required: true,
- type: "object",
- properties: {
- incrementalGCEnabled: {
- type: "boolean",
- },
- },
- },
- accessibility: {
- required: true,
- type: "object",
- properties: {
- isActive: {
- required: true,
- type: "boolean",
- },
- forceDisabled: {
- type: "number",
- },
- },
- },
- libraryVersions: {
- required: true,
- type: "object",
- properties: {
- NSPR: {
- required: true,
- type: "object",
- properties: {
- minVersion: {
- required: true,
- type: "string",
- },
- version: {
- required: true,
- type: "string",
- },
- },
- },
- NSS: {
- required: true,
- type: "object",
- properties: {
- minVersion: {
- required: true,
- type: "string",
- },
- version: {
- required: true,
- type: "string",
- },
- },
- },
- NSSUTIL: {
- required: true,
- type: "object",
- properties: {
- minVersion: {
- required: true,
- type: "string",
- },
- version: {
- required: true,
- type: "string",
- },
- },
- },
- NSSSSL: {
- required: true,
- type: "object",
- properties: {
- minVersion: {
- required: true,
- type: "string",
- },
- version: {
- required: true,
- type: "string",
- },
- },
- },
- NSSSMIME: {
- required: true,
- type: "object",
- properties: {
- minVersion: {
- required: true,
- type: "string",
- },
- version: {
- required: true,
- type: "string",
- },
- },
- },
- },
- },
- userJS: {
- required: true,
- type: "object",
- properties: {
- exists: {
- required: true,
- type: "boolean",
- },
- },
- },
- experiments: {
- type: "array",
- },
- sandbox: {
- required: false,
- type: "object",
- properties: {
- hasSeccompBPF: {
- required: AppConstants.platform == "linux",
- type: "boolean"
- },
- hasSeccompTSync: {
- required: AppConstants.platform == "linux",
- type: "boolean"
- },
- hasUserNamespaces: {
- required: AppConstants.platform == "linux",
- type: "boolean"
- },
- hasPrivilegedUserNamespaces: {
- required: AppConstants.platform == "linux",
- type: "boolean"
- },
- canSandboxContent: {
- required: false,
- type: "boolean"
- },
- canSandboxMedia: {
- required: false,
- type: "boolean"
- },
- },
- },
- },
-};
-
-/**
- * Throws an Error if obj doesn't conform to schema. That way you get a nice
- * error message and a stack to help you figure out what went wrong, which you
- * wouldn't get if this just returned true or false instead. There's still
- * room for improvement in communicating validation failures, however.
- *
- * @param obj The object to validate.
- * @param schema The schema that obj should conform to.
- */
-function validateObject(obj, schema) {
- if (obj === undefined && !schema.required)
- return;
- if (typeof(schema.type) != "string")
- throw schemaErr("'type' must be a string", schema);
- if (objType(obj) != schema.type)
- throw validationErr("Object is not of the expected type", obj, schema);
- let validatorFnName = "validateObject_" + schema.type;
- if (!(validatorFnName in this))
- throw schemaErr("Validator function not defined for type", schema);
- this[validatorFnName](obj, schema);
-}
-
-function validateObject_object(obj, schema) {
- if (typeof(schema.properties) != "object")
- // Don't care what obj's properties are.
- return;
- // First check that all the schema's properties match the object.
- for (let prop in schema.properties)
- validateObject(obj[prop], schema.properties[prop]);
- // Now check that the object doesn't have any properties not in the schema.
- for (let prop in obj)
- if (!(prop in schema.properties))
- throw validationErr("Object has property "+prop+" not in schema", obj, schema);
-}
-
-function validateObject_array(array, schema) {
- if (typeof(schema.items) != "object")
- // Don't care what the array's elements are.
- return;
- array.forEach(elt => validateObject(elt, schema.items));
-}
-
-function validateObject_string(str, schema) {}
-function validateObject_boolean(bool, schema) {}
-function validateObject_number(num, schema) {}
-
-function validationErr(msg, obj, schema) {
- return new Error("Validation error: " + msg +
- ": object=" + JSON.stringify(obj) +
- ", schema=" + JSON.stringify(schema));
-}
-
-function schemaErr(msg, schema) {
- return new Error("Schema error: " + msg + ": " + JSON.stringify(schema));
-}
-
-function objType(obj) {
- let type = typeof(obj);
- if (type != "object")
- return type;
- if (Array.isArray(obj))
- return "array";
- if (obj === null)
- return "null";
- return type;
-}
diff --git a/toolkit/modules/tests/browser/browser_WebNavigation.js b/toolkit/modules/tests/browser/browser_WebNavigation.js
deleted file mode 100644
index e09cb1994..000000000
--- a/toolkit/modules/tests/browser/browser_WebNavigation.js
+++ /dev/null
@@ -1,140 +0,0 @@
-"use strict";
-
-var { interfaces: Ci, classes: Cc, utils: Cu, results: Cr } = Components;
-
-var {WebNavigation} = Cu.import("resource://gre/modules/WebNavigation.jsm", {});
-
-const BASE = "http://example.com/browser/toolkit/modules/tests/browser";
-const URL = BASE + "/file_WebNavigation_page1.html";
-const FRAME = BASE + "/file_WebNavigation_page2.html";
-const FRAME2 = BASE + "/file_WebNavigation_page3.html";
-
-const EVENTS = [
- "onBeforeNavigate",
- "onCommitted",
- "onDOMContentLoaded",
- "onCompleted",
- "onErrorOccurred",
- "onReferenceFragmentUpdated",
-];
-
-const REQUIRED = [
- "onBeforeNavigate",
- "onCommitted",
- "onDOMContentLoaded",
- "onCompleted",
-];
-
-var expectedBrowser;
-var received = [];
-var completedResolve;
-var waitingURL, waitingEvent;
-var rootWindowID;
-
-function gotEvent(event, details)
-{
- if (!details.url.startsWith(BASE)) {
- return;
- }
- info(`Got ${event} ${details.url} ${details.windowId} ${details.parentWindowId}`);
-
- is(details.browser, expectedBrowser, "correct <browser> element");
-
- received.push({url: details.url, event});
-
- if (typeof(rootWindowID) == "undefined") {
- rootWindowID = details.windowId;
- }
-
- if (details.url == URL) {
- is(details.windowId, rootWindowID, "root window ID correct");
- } else {
- is(details.parentWindowId, rootWindowID, "parent window ID correct");
- isnot(details.windowId, rootWindowID, "window ID probably okay");
- }
-
- isnot(details.windowId, undefined);
- isnot(details.parentWindowId, undefined);
-
- if (details.url == waitingURL && event == waitingEvent) {
- completedResolve();
- }
-}
-
-function loadViaFrameScript(url, event, script)
-{
- // Loading via a frame script ensures that the chrome process never
- // "gets ahead" of frame scripts in non-e10s mode.
- received = [];
- waitingURL = url;
- waitingEvent = event;
- expectedBrowser.messageManager.loadFrameScript("data:," + script, false);
- return new Promise(resolve => { completedResolve = resolve; });
-}
-
-add_task(function* webnav_ordering() {
- let listeners = {};
- for (let event of EVENTS) {
- listeners[event] = gotEvent.bind(null, event);
- WebNavigation[event].addListener(listeners[event]);
- }
-
- gBrowser.selectedTab = gBrowser.addTab();
- let browser = gBrowser.selectedBrowser;
- expectedBrowser = browser;
-
- yield BrowserTestUtils.browserLoaded(browser);
-
- yield loadViaFrameScript(URL, "onCompleted", `content.location = "${URL}";`);
-
- function checkRequired(url) {
- for (let event of REQUIRED) {
- let found = false;
- for (let r of received) {
- if (r.url == url && r.event == event) {
- found = true;
- }
- }
- ok(found, `Received event ${event} from ${url}`);
- }
- }
-
- checkRequired(URL);
- checkRequired(FRAME);
-
- function checkBefore(action1, action2) {
- function find(action) {
- for (let i = 0; i < received.length; i++) {
- if (received[i].url == action.url && received[i].event == action.event) {
- return i;
- }
- }
- return -1;
- }
-
- let index1 = find(action1);
- let index2 = find(action2);
- ok(index1 != -1, `Action ${JSON.stringify(action1)} happened`);
- ok(index2 != -1, `Action ${JSON.stringify(action2)} happened`);
- ok(index1 < index2, `Action ${JSON.stringify(action1)} happened before ${JSON.stringify(action2)}`);
- }
-
- checkBefore({url: URL, event: "onCommitted"}, {url: FRAME, event: "onBeforeNavigate"});
- checkBefore({url: FRAME, event: "onCompleted"}, {url: URL, event: "onCompleted"});
-
- yield loadViaFrameScript(FRAME2, "onCompleted", `content.frames[0].location = "${FRAME2}";`);
-
- checkRequired(FRAME2);
-
- yield loadViaFrameScript(FRAME2 + "#ref", "onReferenceFragmentUpdated",
- "content.frames[0].document.getElementById('elt').click();");
-
- info("Received onReferenceFragmentUpdated from FRAME2");
-
- gBrowser.removeCurrentTab();
-
- for (let event of EVENTS) {
- WebNavigation[event].removeListener(listeners[event]);
- }
-});
-
diff --git a/toolkit/modules/tests/browser/browser_WebRequest.js b/toolkit/modules/tests/browser/browser_WebRequest.js
deleted file mode 100644
index cdb28b16c..000000000
--- a/toolkit/modules/tests/browser/browser_WebRequest.js
+++ /dev/null
@@ -1,214 +0,0 @@
-"use strict";
-
-var { interfaces: Ci, classes: Cc, utils: Cu, results: Cr } = Components;
-
-var {WebRequest} = Cu.import("resource://gre/modules/WebRequest.jsm", {});
-
-const BASE = "http://example.com/browser/toolkit/modules/tests/browser";
-const URL = BASE + "/file_WebRequest_page1.html";
-
-var expected_browser;
-
-function checkType(details)
-{
- let expected_type = "???";
- if (details.url.indexOf("style") != -1) {
- expected_type = "stylesheet";
- } else if (details.url.indexOf("image") != -1) {
- expected_type = "image";
- } else if (details.url.indexOf("script") != -1) {
- expected_type = "script";
- } else if (details.url.indexOf("page1") != -1) {
- expected_type = "main_frame";
- } else if (/page2|_redirection\.|dummy_page/.test(details.url)) {
- expected_type = "sub_frame";
- } else if (details.url.indexOf("xhr") != -1) {
- expected_type = "xmlhttprequest";
- }
- is(details.type, expected_type, "resource type is correct");
-}
-
-var windowIDs = new Map();
-
-var requested = [];
-
-function onBeforeRequest(details)
-{
- info(`onBeforeRequest ${details.url}`);
- if (details.url.startsWith(BASE)) {
- requested.push(details.url);
-
- is(details.browser, expected_browser, "correct <browser> element");
- checkType(details);
-
- windowIDs.set(details.url, details.windowId);
- if (details.url.indexOf("page2") != -1) {
- let page1id = windowIDs.get(URL);
- ok(details.windowId != page1id, "sub-frame gets its own window ID");
- is(details.parentWindowId, page1id, "parent window id is correct");
- }
- }
- if (details.url.indexOf("_bad.") != -1) {
- return {cancel: true};
- }
- return undefined;
-}
-
-var sendHeaders = [];
-
-function onBeforeSendHeaders(details)
-{
- info(`onBeforeSendHeaders ${details.url}`);
- if (details.url.startsWith(BASE)) {
- sendHeaders.push(details.url);
-
- is(details.browser, expected_browser, "correct <browser> element");
- checkType(details);
-
- let id = windowIDs.get(details.url);
- is(id, details.windowId, "window ID same in onBeforeSendHeaders as onBeforeRequest");
- }
- if (details.url.indexOf("_redirect.") != -1) {
- return {redirectUrl: details.url.replace("_redirect.", "_good.")};
- }
- return undefined;
-}
-
-var beforeRedirect = [];
-
-function onBeforeRedirect(details)
-{
- info(`onBeforeRedirect ${details.url} -> ${details.redirectUrl}`);
- checkType(details);
- if (details.url.startsWith(BASE)) {
- beforeRedirect.push(details.url);
-
- is(details.browser, expected_browser, "correct <browser> element");
- checkType(details);
-
- let expectedUrl = details.url.replace("_redirect.", "_good.").replace(/\w+_redirection\..*/, "dummy_page.html")
- is(details.redirectUrl, expectedUrl, "Correct redirectUrl value");
- }
- let id = windowIDs.get(details.url);
- is(id, details.windowId, "window ID same in onBeforeRedirect as onBeforeRequest");
- // associate stored windowId with final url
- windowIDs.set(details.redirectUrl, details.windowId);
- return {};
-}
-
-var headersReceived = [];
-
-function onResponseStarted(details)
-{
- if (details.url.startsWith(BASE)) {
- headersReceived.push(details.url);
- }
-}
-
-const expected_requested = [BASE + "/file_WebRequest_page1.html",
- BASE + "/file_style_good.css",
- BASE + "/file_style_bad.css",
- BASE + "/file_style_redirect.css",
- BASE + "/file_image_good.png",
- BASE + "/file_image_bad.png",
- BASE + "/file_image_redirect.png",
- BASE + "/file_script_good.js",
- BASE + "/file_script_bad.js",
- BASE + "/file_script_redirect.js",
- BASE + "/file_script_xhr.js",
- BASE + "/file_WebRequest_page2.html",
- BASE + "/nonexistent_script_url.js",
- BASE + "/WebRequest_redirection.sjs",
- BASE + "/dummy_page.html",
- BASE + "/xhr_resource"];
-
-const expected_sendHeaders = [BASE + "/file_WebRequest_page1.html",
- BASE + "/file_style_good.css",
- BASE + "/file_style_redirect.css",
- BASE + "/file_image_good.png",
- BASE + "/file_image_redirect.png",
- BASE + "/file_script_good.js",
- BASE + "/file_script_redirect.js",
- BASE + "/file_script_xhr.js",
- BASE + "/file_WebRequest_page2.html",
- BASE + "/nonexistent_script_url.js",
- BASE + "/WebRequest_redirection.sjs",
- BASE + "/dummy_page.html",
- BASE + "/xhr_resource"];
-
-const expected_beforeRedirect = expected_sendHeaders.filter(u => /_redirect\./.test(u))
- .concat(BASE + "/WebRequest_redirection.sjs");
-
-const expected_headersReceived = [BASE + "/file_WebRequest_page1.html",
- BASE + "/file_style_good.css",
- BASE + "/file_image_good.png",
- BASE + "/file_script_good.js",
- BASE + "/file_script_xhr.js",
- BASE + "/file_WebRequest_page2.html",
- BASE + "/nonexistent_script_url.js",
- BASE + "/dummy_page.html",
- BASE + "/xhr_resource"];
-
-function removeDupes(list)
-{
- let j = 0;
- for (let i = 1; i < list.length; i++) {
- if (list[i] != list[j]) {
- j++;
- if (i != j) {
- list[j] = list[i];
- }
- }
- }
- list.length = j + 1;
-}
-
-function compareLists(list1, list2, kind)
-{
- list1.sort();
- removeDupes(list1);
- list2.sort();
- removeDupes(list2);
- is(String(list1), String(list2), `${kind} URLs correct`);
-}
-
-function* test_once()
-{
- WebRequest.onBeforeRequest.addListener(onBeforeRequest, null, ["blocking"]);
- WebRequest.onBeforeSendHeaders.addListener(onBeforeSendHeaders, null, ["blocking"]);
- WebRequest.onBeforeRedirect.addListener(onBeforeRedirect);
- WebRequest.onResponseStarted.addListener(onResponseStarted);
-
- yield BrowserTestUtils.withNewTab({ gBrowser, url: "about:blank" },
- function* (browser) {
- expected_browser = browser;
- BrowserTestUtils.loadURI(browser, URL);
- yield BrowserTestUtils.browserLoaded(expected_browser);
-
- expected_browser = null;
-
- yield ContentTask.spawn(browser, null, function() {
- let win = content.wrappedJSObject;
- is(win.success, 2, "Good script ran");
- is(win.failure, undefined, "Failure script didn't run");
-
- let style =
- content.getComputedStyle(content.document.getElementById("test"), null);
- is(style.getPropertyValue("color"), "rgb(255, 0, 0)", "Good CSS loaded");
- });
- });
-
- compareLists(requested, expected_requested, "requested");
- compareLists(sendHeaders, expected_sendHeaders, "sendHeaders");
- compareLists(beforeRedirect, expected_beforeRedirect, "beforeRedirect");
- compareLists(headersReceived, expected_headersReceived, "headersReceived");
-
- WebRequest.onBeforeRequest.removeListener(onBeforeRequest);
- WebRequest.onBeforeSendHeaders.removeListener(onBeforeSendHeaders);
- WebRequest.onBeforeRedirect.removeListener(onBeforeRedirect);
- WebRequest.onResponseStarted.removeListener(onResponseStarted);
-}
-
-// Run the test twice to make sure it works with caching.
-add_task(test_once);
-add_task(test_once);
diff --git a/toolkit/modules/tests/browser/browser_WebRequest_cookies.js b/toolkit/modules/tests/browser/browser_WebRequest_cookies.js
deleted file mode 100644
index b8c4f24cb..000000000
--- a/toolkit/modules/tests/browser/browser_WebRequest_cookies.js
+++ /dev/null
@@ -1,89 +0,0 @@
-"use strict";
-
-var { interfaces: Ci, classes: Cc, utils: Cu, results: Cr } = Components;
-
-var {WebRequest} = Cu.import("resource://gre/modules/WebRequest.jsm", {});
-
-const BASE = "http://example.com/browser/toolkit/modules/tests/browser";
-const URL = BASE + "/WebRequest_dynamic.sjs";
-
-var countBefore = 0;
-var countAfter = 0;
-
-function onBeforeSendHeaders(details)
-{
- if (details.url != URL) {
- return undefined;
- }
-
- countBefore++;
-
- info(`onBeforeSendHeaders ${details.url}`);
- let found = false;
- let headers = [];
- for (let {name, value} of details.requestHeaders) {
- info(`Saw header ${name} '${value}'`);
- if (name == "Cookie") {
- is(value, "foopy=1", "Cookie is correct");
- headers.push({name, value: "blinky=1"});
- found = true;
- } else {
- headers.push({name, value});
- }
- }
- ok(found, "Saw cookie header");
-
- return {requestHeaders: headers};
-}
-
-function onResponseStarted(details)
-{
- if (details.url != URL) {
- return;
- }
-
- countAfter++;
-
- info(`onResponseStarted ${details.url}`);
- let found = false;
- for (let {name, value} of details.responseHeaders) {
- info(`Saw header ${name} '${value}'`);
- if (name == "Set-Cookie") {
- is(value, "dinky=1", "Cookie is correct");
- found = true;
- }
- }
- ok(found, "Saw cookie header");
-}
-
-add_task(function* filter_urls() {
- // First load the URL so that we set cookie foopy=1.
- gBrowser.selectedTab = gBrowser.addTab(URL);
- yield waitForLoad();
- gBrowser.removeCurrentTab();
-
- // Now load with WebRequest set up.
- WebRequest.onBeforeSendHeaders.addListener(onBeforeSendHeaders, null, ["blocking"]);
- WebRequest.onResponseStarted.addListener(onResponseStarted, null);
-
- gBrowser.selectedTab = gBrowser.addTab(URL);
-
- yield waitForLoad();
-
- gBrowser.removeCurrentTab();
-
- WebRequest.onBeforeSendHeaders.removeListener(onBeforeSendHeaders);
- WebRequest.onResponseStarted.removeListener(onResponseStarted);
-
- is(countBefore, 1, "onBeforeSendHeaders hit once");
- is(countAfter, 1, "onResponseStarted hit once");
-});
-
-function waitForLoad(browser = gBrowser.selectedBrowser) {
- return new Promise(resolve => {
- browser.addEventListener("load", function listener() {
- browser.removeEventListener("load", listener, true);
- resolve();
- }, true);
- });
-}
diff --git a/toolkit/modules/tests/browser/browser_WebRequest_filtering.js b/toolkit/modules/tests/browser/browser_WebRequest_filtering.js
deleted file mode 100644
index a456678c1..000000000
--- a/toolkit/modules/tests/browser/browser_WebRequest_filtering.js
+++ /dev/null
@@ -1,118 +0,0 @@
-"use strict";
-
-var { interfaces: Ci, classes: Cc, utils: Cu, results: Cr } = Components;
-
-var {WebRequest} = Cu.import("resource://gre/modules/WebRequest.jsm", {});
-var {MatchPattern} = Cu.import("resource://gre/modules/MatchPattern.jsm", {});
-
-const BASE = "http://example.com/browser/toolkit/modules/tests/browser";
-const URL = BASE + "/file_WebRequest_page2.html";
-
-var requested = [];
-
-function onBeforeRequest(details)
-{
- info(`onBeforeRequest ${details.url}`);
- if (details.url.startsWith(BASE)) {
- requested.push(details.url);
- }
-}
-
-var sendHeaders = [];
-
-function onBeforeSendHeaders(details)
-{
- info(`onBeforeSendHeaders ${details.url}`);
- if (details.url.startsWith(BASE)) {
- sendHeaders.push(details.url);
- }
-}
-
-var completed = [];
-
-function onResponseStarted(details)
-{
- if (details.url.startsWith(BASE)) {
- completed.push(details.url);
- }
-}
-
-const expected_urls = [BASE + "/file_style_good.css",
- BASE + "/file_style_bad.css",
- BASE + "/file_style_redirect.css"];
-
-function removeDupes(list)
-{
- let j = 0;
- for (let i = 1; i < list.length; i++) {
- if (list[i] != list[j]) {
- j++;
- if (i != j) {
- list[j] = list[i];
- }
- }
- }
- list.length = j + 1;
-}
-
-function compareLists(list1, list2, kind)
-{
- list1.sort();
- removeDupes(list1);
- list2.sort();
- removeDupes(list2);
- is(String(list1), String(list2), `${kind} URLs correct`);
-}
-
-add_task(function* filter_urls() {
- let filter = {urls: new MatchPattern("*://*/*_style_*")};
-
- WebRequest.onBeforeRequest.addListener(onBeforeRequest, filter, ["blocking"]);
- WebRequest.onBeforeSendHeaders.addListener(onBeforeSendHeaders, filter, ["blocking"]);
- WebRequest.onResponseStarted.addListener(onResponseStarted, filter);
-
- gBrowser.selectedTab = gBrowser.addTab(URL);
-
- yield waitForLoad();
-
- gBrowser.removeCurrentTab();
-
- compareLists(requested, expected_urls, "requested");
- compareLists(sendHeaders, expected_urls, "sendHeaders");
- compareLists(completed, expected_urls, "completed");
-
- WebRequest.onBeforeRequest.removeListener(onBeforeRequest);
- WebRequest.onBeforeSendHeaders.removeListener(onBeforeSendHeaders);
- WebRequest.onResponseStarted.removeListener(onResponseStarted);
-});
-
-add_task(function* filter_types() {
- let filter = {types: ["stylesheet"]};
-
- WebRequest.onBeforeRequest.addListener(onBeforeRequest, filter, ["blocking"]);
- WebRequest.onBeforeSendHeaders.addListener(onBeforeSendHeaders, filter, ["blocking"]);
- WebRequest.onResponseStarted.addListener(onResponseStarted, filter);
-
- gBrowser.selectedTab = gBrowser.addTab(URL);
-
- yield waitForLoad();
-
- gBrowser.removeCurrentTab();
-
- compareLists(requested, expected_urls, "requested");
- compareLists(sendHeaders, expected_urls, "sendHeaders");
- compareLists(completed, expected_urls, "completed");
-
- WebRequest.onBeforeRequest.removeListener(onBeforeRequest);
- WebRequest.onBeforeSendHeaders.removeListener(onBeforeSendHeaders);
- WebRequest.onResponseStarted.removeListener(onResponseStarted);
-});
-
-function waitForLoad(browser = gBrowser.selectedBrowser) {
- return new Promise(resolve => {
- browser.addEventListener("load", function listener() {
- browser.removeEventListener("load", listener, true);
- resolve();
- }, true);
- });
-}
diff --git a/toolkit/modules/tests/browser/dummy_page.html b/toolkit/modules/tests/browser/dummy_page.html
deleted file mode 100644
index c1c9a4e04..000000000
--- a/toolkit/modules/tests/browser/dummy_page.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE html>
-
-<html>
-<body>
-<p>Page</p>
-</body>
-</html>
diff --git a/toolkit/modules/tests/browser/file_FinderSample.html b/toolkit/modules/tests/browser/file_FinderSample.html
deleted file mode 100644
index e952d1fe9..000000000
--- a/toolkit/modules/tests/browser/file_FinderSample.html
+++ /dev/null
@@ -1,824 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Childe Roland</title>
-</head>
-<body>
-<h1>"Childe Roland to the Dark Tower Came"</h1><h5>Robert Browning</h5>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>I.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>My first thought was, he lied in every word,
-<dl>
-<dd>That hoary cripple, with malicious eye</dd>
-<dd>Askance to watch the working of his lie</dd>
-</dl>
-</dd>
-<dd>On mine, and mouth scarce able to afford</dd>
-<dd>Suppression of the glee that pursed and scored
-<dl>
-<dd>Its edge, at one more victim gained thereby.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>II.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>What else should he be set for, with his staff?
-<dl>
-<dd>What, save to waylay with his lies, ensnare</dd>
-<dd>All travellers who might find him posted there,</dd>
-</dl>
-</dd>
-<dd>And ask the road? I guessed what skull-like laugh</dd>
-<dd>Would break, what crutch 'gin write my epitaph
-<dl>
-<dd>For pastime in the dusty thoroughfare,</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>III.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>If at his counsel I should turn aside
-<dl>
-<dd>Into that ominous tract which, all agree,</dd>
-<dd>Hides the Dark Tower. Yet acquiescingly</dd>
-</dl>
-</dd>
-<dd>I did turn as he pointed: neither pride</dd>
-<dd>Nor hope rekindling at the end descried,
-<dl>
-<dd>So much as gladness that some end might be.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>IV.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>For, what with my whole world-wide wandering,
-<dl>
-<dd>What with my search drawn out thro' years, my hope</dd>
-<dd>Dwindled into a ghost not fit to cope</dd>
-</dl>
-</dd>
-<dd>With that obstreperous joy success would bring,</dd>
-<dd>I hardly tried now to rebuke the spring
-<dl>
-<dd>My heart made, finding failure in its scope.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>V.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>As when a sick man very near to death
-<dl>
-<dd>Seems dead indeed, and feels begin and end</dd>
-<dd>The tears and takes the farewell of each friend,</dd>
-</dl>
-</dd>
-<dd>And hears one bid the other go, draw breath</dd>
-<dd>Freelier outside ("since all is o'er," he saith,
-<dl>
-<dd>"And the blow fallen no grieving can amend;")</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>VI.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>While some discuss if near the other graves
-<dl>
-<dd>Be room enough for this, and when a day</dd>
-<dd>Suits best for carrying the corpse away,</dd>
-</dl>
-</dd>
-<dd>With care about the banners, scarves and staves:</dd>
-<dd>And still the man hears all, and only craves
-<dl>
-<dd>He may not shame such tender love and stay.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>VII.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>Thus, I had so long suffered in this quest,
-<dl>
-<dd>Heard failure prophesied so oft, been writ</dd>
-<dd>So many times among "The Band" - to wit,</dd>
-</dl>
-</dd>
-<dd>The knights who to the Dark Tower's search addressed</dd>
-<dd>Their steps - that just to fail as they, seemed best,
-<dl>
-<dd>And all the doubt was now—should I be fit?</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>VIII.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>So, quiet as despair, I turned from him,
-<dl>
-<dd>That hateful cripple, out of his highway</dd>
-<dd>Into the path he pointed. All the day</dd>
-</dl>
-</dd>
-<dd>Had been a dreary one at best, and dim</dd>
-<dd>Was settling to its close, yet shot one grim
-<dl>
-<dd>Red leer to see the plain catch its estray.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>IX.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>For mark! no sooner was I fairly found
-<dl>
-<dd>Pledged to the plain, after a pace or two,</dd>
-<dd>Than, pausing to throw backward a last view</dd>
-</dl>
-</dd>
-<dd>O'er the safe road, 'twas gone; grey plain all round:</dd>
-<dd>Nothing but plain to the horizon's bound.
-<dl>
-<dd>I might go on; nought else remained to do.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>X.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>So, on I went. I think I never saw
-<dl>
-<dd>Such starved ignoble nature; nothing throve:</dd>
-<dd>For flowers - as well expect a cedar grove!</dd>
-</dl>
-</dd>
-<dd>But cockle, spurge, according to their law</dd>
-<dd>Might propagate their kind, with none to awe,
-<dl>
-<dd>You'd think; a burr had been a treasure trove.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XI.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>No! penury, inertness and grimace,
-<dl>
-<dd>In some strange sort, were the land's portion. "See</dd>
-<dd>Or shut your eyes," said Nature peevishly,</dd>
-</dl>
-</dd>
-<dd>"It nothing skills: I cannot help my case:</dd>
-<dd>'Tis the Last Judgment's fire must cure this place,
-<dl>
-<dd>Calcine its clods and set my prisoners free."</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XII.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>If there pushed any ragged thistle-stalk
-<dl>
-<dd>Above its mates, the head was chopped; the bents</dd>
-<dd>Were jealous else. What made those holes and rents</dd>
-</dl>
-</dd>
-<dd>In the dock's harsh swarth leaves, bruised as to baulk</dd>
-<dd>All hope of greenness? 'tis a brute must walk
-<dl>
-<dd>Pashing their life out, with a brute's intents.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XIII.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>As for the grass, it grew as scant as hair
-<dl>
-<dd>In leprosy; thin dry blades pricked the mud</dd>
-<dd>Which underneath looked kneaded up with blood.</dd>
-</dl>
-</dd>
-<dd>One stiff blind horse, his every bone a-stare,</dd>
-<dd>Stood stupefied, however he came there:
-<dl>
-<dd>Thrust out past service from the devil's stud!</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XIV.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>Alive? he might be dead for aught I know,
-<dl>
-<dd>With that red gaunt and colloped neck a-strain,</dd>
-<dd>And shut eyes underneath the rusty mane;</dd>
-</dl>
-</dd>
-<dd>Seldom went such grotesqueness with such woe;</dd>
-<dd>I never saw a brute I hated so;
-<dl>
-<dd>He must be wicked to deserve such pain.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XV.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>I shut my eyes and turned them on my heart.
-<dl>
-<dd>As a man calls for wine before he fights,</dd>
-<dd>I asked one draught of earlier, happier sights,</dd>
-</dl>
-</dd>
-<dd>Ere fitly I could hope to play my part.</dd>
-<dd>Think first, fight afterwards - the soldier's art:
-<dl>
-<dd>One taste of the old time sets all to rights.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XVI.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>Not it! I fancied Cuthbert's reddening face
-<dl>
-<dd>Beneath its garniture of curly gold,</dd>
-<dd>Dear fellow, till I almost felt him fold</dd>
-</dl>
-</dd>
-<dd>An arm in mine to fix me to the place</dd>
-<dd>That way he used. Alas, one night's disgrace!
-<dl>
-<dd>Out went my heart's new fire and left it cold.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XVII.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>Giles then, the soul of honour - there he stands
-<dl>
-<dd>Frank as ten years ago when knighted first.</dd>
-<dd>What honest men should dare (he said) he durst.</dd>
-</dl>
-</dd>
-<dd>Good - but the scene shifts - faugh! what hangman hands</dd>
-<dd>Pin to his breast a parchment? His own bands
-<dl>
-<dd>Read it. Poor traitor, spit upon and curst!</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XVIII.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>Better this present than a past like that;
-<dl>
-<dd>Back therefore to my darkening path again!</dd>
-<dd>No sound, no sight as far as eye could strain.</dd>
-</dl>
-</dd>
-<dd>Will the night send a howlet or a bat?</dd>
-<dd>I asked: when something on the dismal flat
-<dl>
-<dd>Came to arrest my thoughts and change their train.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XIX.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>A sudden little river crossed my path
-<dl>
-<dd>As unexpected as a serpent comes.</dd>
-<dd>No sluggish tide congenial to the glooms;</dd>
-</dl>
-</dd>
-<dd>This, as it frothed by, might have been a bath</dd>
-<dd>For the fiend's glowing hoof - to see the wrath
-<dl>
-<dd>Of its black eddy bespate with flakes and spumes.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XX.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>So petty yet so spiteful! All along
-<dl>
-<dd>Low scrubby alders kneeled down over it;</dd>
-<dd>Drenched willows flung them headlong in a fit</dd>
-</dl>
-</dd>
-<dd>Of mute despair, a suicidal throng:</dd>
-<dd>The river which had done them all the wrong,
-<dl>
-<dd>Whate'er that was, rolled by, deterred no whit.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXI.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>Which, while I forded, - good saints, how I feared
-<dl>
-<dd>To set my foot upon a dead man's cheek,</dd>
-<dd>Each step, or feel the spear I thrust to seek</dd>
-</dl>
-</dd>
-<dd>For hollows, tangled in his hair or beard!</dd>
-<dd>—It may have been a water-rat I speared,
-<dl>
-<dd>But, ugh! it sounded like a baby's shriek.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXII.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>Glad was I when I reached the other bank.
-<dl>
-<dd>Now for a better country. Vain presage!</dd>
-<dd>Who were the strugglers, what war did they wage,</dd>
-</dl>
-</dd>
-<dd>Whose savage trample thus could pad the dank</dd>
-<dd>Soil to a plash? Toads in a poisoned tank,
-<dl>
-<dd>Or wild cats in a red-hot iron cage—</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXIII.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>The fight must so have seemed in that fell cirque.
-<dl>
-<dd>What penned them there, with all the plain to choose?</dd>
-<dd>No foot-print leading to that horrid mews,</dd>
-</dl>
-</dd>
-<dd>None out of it. Mad brewage set to work</dd>
-<dd>Their brains, no doubt, like galley-slaves the Turk
-<dl>
-<dd>Pits for his pastime, Christians against Jews.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXIV.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>And more than that - a furlong on - why, there!
-<dl>
-<dd>What bad use was that engine for, that wheel,</dd>
-<dd>Or brake, not wheel - that harrow fit to reel</dd>
-</dl>
-</dd>
-<dd>Men's bodies out like silk? with all the air</dd>
-<dd>Of Tophet's tool, on earth left unaware,
-<dl>
-<dd>Or brought to sharpen its rusty teeth of steel.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXV.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>Then came a bit of stubbed ground, once a wood,
-<dl>
-<dd>Next a marsh, it would seem, and now mere earth</dd>
-<dd>Desperate and done with; (so a fool finds mirth,</dd>
-</dl>
-</dd>
-<dd>Makes a thing and then mars it, till his mood</dd>
-<dd>Changes and off he goes!) within a rood—
-<dl>
-<dd>Bog, clay and rubble, sand and stark black dearth.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXVI.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>Now blotches rankling, coloured gay and grim,
-<dl>
-<dd>Now patches where some leanness of the soil's</dd>
-<dd>Broke into moss or substances like boils;</dd>
-</dl>
-</dd>
-<dd>Then came some palsied oak, a cleft in him</dd>
-<dd>Like a distorted mouth that splits its rim
-<dl>
-<dd>Gaping at death, and dies while it recoils.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXVII.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>And just as far as ever from the end!
-<dl>
-<dd>Nought in the distance but the evening, nought</dd>
-<dd>To point my footstep further! At the thought,</dd>
-</dl>
-</dd>
-<dd>A great black bird, Apollyon's bosom-friend,</dd>
-<dd>Sailed past, nor beat his wide wing dragon-penned
-<dl>
-<dd>That brushed my cap—perchance the guide I sought.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXVIII.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>For, looking up, aware I somehow grew,
-<dl>
-<dd>'Spite of the dusk, the plain had given place</dd>
-<dd>All round to mountains - with such name to grace</dd>
-</dl>
-</dd>
-<dd>Mere ugly heights and heaps now stolen in view.</dd>
-<dd>How thus they had surprised me, - solve it, you!
-<dl>
-<dd>How to get from them was no clearer case.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXIX.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>Yet half I seemed to recognise some trick
-<dl>
-<dd>Of mischief happened to me, God knows when—</dd>
-<dd>In a bad dream perhaps. Here ended, then,</dd>
-</dl>
-</dd>
-<dd>Progress this way. When, in the very nick</dd>
-<dd>Of giving up, one time more, came a click
-<dl>
-<dd>As when a trap shuts - you're inside the den!</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXX.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>Burningly it came on me all at once,
-<dl>
-<dd>This was the place! those two hills on the right,</dd>
-<dd>Crouched like two bulls locked horn in horn in fight;</dd>
-</dl>
-</dd>
-<dd>While to the left, a tall scalped mountain... Dunce,</dd>
-<dd>Dotard, a-dozing at the very nonce,
-<dl>
-<dd>After a life spent training for the sight!</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXXI.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>What in the midst lay but the Tower itself?
-<dl>
-<dd>The round squat turret, blind as the fool's heart</dd>
-<dd>Built of brown stone, without a counterpart</dd>
-</dl>
-</dd>
-<dd>In the whole world. The tempest's mocking elf</dd>
-<dd>Points to the shipman thus the unseen shelf
-<dl>
-<dd>He strikes on, only when the timbers start.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXXII.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>Not see? because of night perhaps? - why, day
-<dl>
-<dd>Came back again for that! before it left,</dd>
-<dd>The dying sunset kindled through a cleft:</dd>
-</dl>
-</dd>
-<dd>The hills, like giants at a hunting, lay</dd>
-<dd>Chin upon hand, to see the game at bay,—
-<dl>
-<dd>"Now stab and end the creature - to the heft!"</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXXIII.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>Not hear? when noise was everywhere! it tolled
-<dl>
-<dd>Increasing like a bell. Names in my ears</dd>
-<dd>Of all the lost adventurers my peers,—</dd>
-</dl>
-</dd>
-<dd>How such a one was strong, and such was bold,</dd>
-<dd>And such was fortunate, yet each of old
-<dl>
-<dd>Lost, lost! one moment knelled the woe of years.</dd>
-</dl>
-</dd>
-</dl>
-<p><br /></p>
-<dl>
-<dd>
-<dl>
-<dd>
-<dl>
-<dd>XXXIV.</dd>
-</dl>
-</dd>
-</dl>
-</dd>
-<dd>There they stood, ranged along the hillsides, met
-<dl>
-<dd>To view the last of me, a living frame</dd>
-<dd>For one more picture! in a sheet of flame</dd>
-</dl>
-</dd>
-<dd>I saw them and I knew them all. And yet</dd>
-<dd>Dauntless the slug-horn to my lips I set,
-<dl>
-<dd>And blew "<i>Childe Roland to the Dark Tower came.</i>"</dd>
-</dl>
-</dd>
-</dl>
-</body>
-</html>
diff --git a/toolkit/modules/tests/browser/file_WebNavigation_page1.html b/toolkit/modules/tests/browser/file_WebNavigation_page1.html
deleted file mode 100644
index 1b6869756..000000000
--- a/toolkit/modules/tests/browser/file_WebNavigation_page1.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<body>
-
-<iframe src="file_WebNavigation_page2.html" width="200" height="200"></iframe>
-
-</body>
-</html>
diff --git a/toolkit/modules/tests/browser/file_WebNavigation_page2.html b/toolkit/modules/tests/browser/file_WebNavigation_page2.html
deleted file mode 100644
index cc1acc83d..000000000
--- a/toolkit/modules/tests/browser/file_WebNavigation_page2.html
+++ /dev/null
@@ -1,7 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<body>
-
-</body>
-</html>
diff --git a/toolkit/modules/tests/browser/file_WebNavigation_page3.html b/toolkit/modules/tests/browser/file_WebNavigation_page3.html
deleted file mode 100644
index a0a26a2e9..000000000
--- a/toolkit/modules/tests/browser/file_WebNavigation_page3.html
+++ /dev/null
@@ -1,9 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<body>
-
-<a id="elt" href="file_WebNavigation_page3.html#ref">click me</a>
-
-</body>
-</html>
diff --git a/toolkit/modules/tests/browser/file_WebRequest_page1.html b/toolkit/modules/tests/browser/file_WebRequest_page1.html
deleted file mode 100644
index 00a0b9b4b..000000000
--- a/toolkit/modules/tests/browser/file_WebRequest_page1.html
+++ /dev/null
@@ -1,29 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<head>
-<meta charset="utf-8">
-<link rel="stylesheet" href="file_style_good.css">
-<link rel="stylesheet" href="file_style_bad.css">
-<link rel="stylesheet" href="file_style_redirect.css">
-</head>
-<body>
-
-<div id="test">Sample text</div>
-
-<img id="img_good" src="file_image_good.png">
-<img id="img_bad" src="file_image_bad.png">
-<img id="img_redirect" src="file_image_redirect.png">
-
-<script src="file_script_good.js"></script>
-<script src="file_script_bad.js"></script>
-<script src="file_script_redirect.js"></script>
-
-<script src="file_script_xhr.js"></script>
-
-<script src="nonexistent_script_url.js"></script>
-
-<iframe src="file_WebRequest_page2.html" width="200" height="200"></iframe>
-<iframe src="WebRequest_redirection.sjs" width="200" height="50"></iframe>
-</body>
-</html>
diff --git a/toolkit/modules/tests/browser/file_WebRequest_page2.html b/toolkit/modules/tests/browser/file_WebRequest_page2.html
deleted file mode 100644
index b2cf48f9e..000000000
--- a/toolkit/modules/tests/browser/file_WebRequest_page2.html
+++ /dev/null
@@ -1,25 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<head>
-<meta charset="utf-8">
-<link rel="stylesheet" href="file_style_good.css">
-<link rel="stylesheet" href="file_style_bad.css">
-<link rel="stylesheet" href="file_style_redirect.css">
-</head>
-<body>
-
-<div class="test">Sample text</div>
-
-<img id="img_good" src="file_image_good.png">
-<img id="img_bad" src="file_image_bad.png">
-<img id="img_redirect" src="file_image_redirect.png">
-
-<script src="file_script_good.js"></script>
-<script src="file_script_bad.js"></script>
-<script src="file_script_redirect.js"></script>
-
-<script src="nonexistent_script_url.js"></script>
-
-</body>
-</html>
diff --git a/toolkit/modules/tests/browser/file_image_bad.png b/toolkit/modules/tests/browser/file_image_bad.png
deleted file mode 100644
index 4c3be5084..000000000
--- a/toolkit/modules/tests/browser/file_image_bad.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/modules/tests/browser/file_image_good.png b/toolkit/modules/tests/browser/file_image_good.png
deleted file mode 100644
index 769c63634..000000000
--- a/toolkit/modules/tests/browser/file_image_good.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/modules/tests/browser/file_image_redirect.png b/toolkit/modules/tests/browser/file_image_redirect.png
deleted file mode 100644
index 4c3be5084..000000000
--- a/toolkit/modules/tests/browser/file_image_redirect.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/modules/tests/browser/file_script_bad.js b/toolkit/modules/tests/browser/file_script_bad.js
deleted file mode 100644
index 90655f136..000000000
--- a/toolkit/modules/tests/browser/file_script_bad.js
+++ /dev/null
@@ -1 +0,0 @@
-window.failure = true;
diff --git a/toolkit/modules/tests/browser/file_script_good.js b/toolkit/modules/tests/browser/file_script_good.js
deleted file mode 100644
index b128e54a1..000000000
--- a/toolkit/modules/tests/browser/file_script_good.js
+++ /dev/null
@@ -1 +0,0 @@
-window.success = window.success ? window.success + 1 : 1;
diff --git a/toolkit/modules/tests/browser/file_script_redirect.js b/toolkit/modules/tests/browser/file_script_redirect.js
deleted file mode 100644
index 917b5d620..000000000
--- a/toolkit/modules/tests/browser/file_script_redirect.js
+++ /dev/null
@@ -1,2 +0,0 @@
-window.failure = true;
-
diff --git a/toolkit/modules/tests/browser/file_script_xhr.js b/toolkit/modules/tests/browser/file_script_xhr.js
deleted file mode 100644
index bc1f65eae..000000000
--- a/toolkit/modules/tests/browser/file_script_xhr.js
+++ /dev/null
@@ -1,3 +0,0 @@
-var request = new XMLHttpRequest();
-request.open("get", "http://example.com/browser/toolkit/modules/tests/browser/xhr_resource", false);
-request.send();
diff --git a/toolkit/modules/tests/browser/file_style_bad.css b/toolkit/modules/tests/browser/file_style_bad.css
deleted file mode 100644
index 8dbc8dc7a..000000000
--- a/toolkit/modules/tests/browser/file_style_bad.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#test {
- color: green !important;
-}
diff --git a/toolkit/modules/tests/browser/file_style_good.css b/toolkit/modules/tests/browser/file_style_good.css
deleted file mode 100644
index 46f9774b5..000000000
--- a/toolkit/modules/tests/browser/file_style_good.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#test {
- color: red;
-}
diff --git a/toolkit/modules/tests/browser/file_style_redirect.css b/toolkit/modules/tests/browser/file_style_redirect.css
deleted file mode 100644
index 8dbc8dc7a..000000000
--- a/toolkit/modules/tests/browser/file_style_redirect.css
+++ /dev/null
@@ -1,3 +0,0 @@
-#test {
- color: green !important;
-}
diff --git a/toolkit/modules/tests/browser/head.js b/toolkit/modules/tests/browser/head.js
deleted file mode 100644
index 777e087e1..000000000
--- a/toolkit/modules/tests/browser/head.js
+++ /dev/null
@@ -1,23 +0,0 @@
-function removeDupes(list)
-{
- let j = 0;
- for (let i = 1; i < list.length; i++) {
- if (list[i] != list[j]) {
- j++;
- if (i != j) {
- list[j] = list[i];
- }
- }
- }
- list.length = j + 1;
-}
-
-function compareLists(list1, list2, kind)
-{
- list1.sort();
- removeDupes(list1);
- list2.sort();
- removeDupes(list2);
- is(String(list1), String(list2), `${kind} URLs correct`);
-}
-
diff --git a/toolkit/modules/tests/browser/metadata_simple.html b/toolkit/modules/tests/browser/metadata_simple.html
deleted file mode 100644
index 18089e399..000000000
--- a/toolkit/modules/tests/browser/metadata_simple.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Test Title</title>
- <meta property="description" content="A very simple test page">
- </head>
- <body>
- Llama.
- </body>
-</html>
diff --git a/toolkit/modules/tests/browser/metadata_titles.html b/toolkit/modules/tests/browser/metadata_titles.html
deleted file mode 100644
index bd4201304..000000000
--- a/toolkit/modules/tests/browser/metadata_titles.html
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>Test Titles</title>
- <meta property="description" content="A very simple test page" />
- <meta property="og:title" content="Title" />
- </head>
- <body>
- Llama.
- </body>
-</html>
diff --git a/toolkit/modules/tests/browser/metadata_titles_fallback.html b/toolkit/modules/tests/browser/metadata_titles_fallback.html
deleted file mode 100644
index 5b71879b2..000000000
--- a/toolkit/modules/tests/browser/metadata_titles_fallback.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <meta property="description" content="A very simple test page" />
- <meta property="og:title" content="Title" />
- </head>
- <body>
- Llama.
- </body>
-</html>
diff --git a/toolkit/modules/tests/browser/testremotepagemanager.html b/toolkit/modules/tests/browser/testremotepagemanager.html
deleted file mode 100644
index 4303a38f5..000000000
--- a/toolkit/modules/tests/browser/testremotepagemanager.html
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE HTML>
-
-<html>
-<head>
-<script type="text/javascript">
-addMessageListener("Ping", function(message) {
- sendAsyncMessage("Pong", {
- str: message.data.str,
- counter: message.data.counter + 1
- });
-});
-
-addMessageListener("Ping2", function(message) {
- sendAsyncMessage("Pong2", message.data);
-});
-
-function neverCalled() {
- sendAsyncMessage("Pong3");
-}
-addMessageListener("Pong3", neverCalled);
-removeMessageListener("Pong3", neverCalled);
-
-function testData(data) {
- var response = {
- result: true,
- status: "All data correctly received"
- }
-
- function compare(prop, expected) {
- if (uneval(data[prop]) == uneval(expected))
- return;
- if (response.result)
- response.status = "";
- response.result = false;
- response.status += "Property " + prop + " should have been " + expected + " but was " + data[prop] + "\n";
- }
-
- compare("integer", 45);
- compare("real", 45.78);
- compare("str", "foobar");
- compare("array", [1, 2, 3, 5, 27]);
-
- return response;
-}
-
-addMessageListener("SendData", function(message) {
- sendAsyncMessage("ReceivedData", testData(message.data));
-});
-
-addMessageListener("SendData2", function(message) {
- sendAsyncMessage("ReceivedData2", testData(message.data.data));
-});
-
-var cookie = "nom";
-addMessageListener("SetCookie", function(message) {
- cookie = message.data.value;
-});
-
-addMessageListener("GetCookie", function(message) {
- sendAsyncMessage("Cookie", { value: cookie });
-});
-</script>
-</head>
-<body>
-</body>
-</html>
diff --git a/toolkit/modules/tests/chrome/.eslintrc.js b/toolkit/modules/tests/chrome/.eslintrc.js
deleted file mode 100644
index 2c669d844..000000000
--- a/toolkit/modules/tests/chrome/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/modules/tests/chrome/chrome.ini b/toolkit/modules/tests/chrome/chrome.ini
deleted file mode 100644
index a27230919..000000000
--- a/toolkit/modules/tests/chrome/chrome.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[DEFAULT]
-
-[test_bug544442_checkCert.xul]
diff --git a/toolkit/modules/tests/chrome/test_bug544442_checkCert.xul b/toolkit/modules/tests/chrome/test_bug544442_checkCert.xul
deleted file mode 100644
index dd0ce8fbd..000000000
--- a/toolkit/modules/tests/chrome/test_bug544442_checkCert.xul
+++ /dev/null
@@ -1,155 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Test CertUtils.jsm checkCert - bug 340198 and bug 544442"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="testStart();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cr = Components.results;
-
-SimpleTest.waitForExplicitFinish();
-
-Components.utils.import("resource://gre/modules/CertUtils.jsm");
-
-function testStart() {
- ok(true, "Entering testStart");
-
- var request = Cc["@mozilla.org/xmlextras/xmlhttprequest;1"].
- createInstance(Ci.nsIXMLHttpRequest);
- request.open("GET", "https://example.com/", true);
- request.channel.notificationCallbacks = new BadCertHandler(true);
- request.onerror = function(event) { testXHRError(event); };
- request.onload = function(event) { testXHRLoad(event); };
- request.send(null);
-}
-
-function testXHRError(aEvent) {
- ok(true, "Entering testXHRError - something went wrong");
-
- var request = aEvent.target;
- var status = 0;
- try {
- status = request.status;
- }
- catch (e) {
- }
-
- if (status == 0)
- status = request.channel.QueryInterface(Ci.nsIRequest).status;
-
- ok(false, "XHR onerror called: " + status);
-
- SimpleTest.finish();
-}
-
-function getCheckCertResult(aChannel, aAllowNonBuiltIn, aCerts) {
- try {
- checkCert(aChannel, aAllowNonBuiltIn, aCerts);
- }
- catch (e) {
- return e.result;
- }
- return Cr.NS_OK;
-}
-
-function testXHRLoad(aEvent) {
- ok(true, "Entering testXHRLoad");
-
- var channel = aEvent.target.channel;
-
- var certs = null;
- is(getCheckCertResult(channel, false, certs), Cr.NS_ERROR_ABORT,
- "checkCert should throw NS_ERROR_ABORT when the certificate attributes " +
- "array passed to checkCert is null and the certificate is not builtin");
-
- is(getCheckCertResult(channel, true, certs), Cr.NS_OK,
- "checkCert should not throw when the certificate attributes array " +
- "passed to checkCert is null and builtin certificates aren't enforced");
-
- certs = [ { invalidAttribute: "Invalid attribute" } ];
- is(getCheckCertResult(channel, false, certs), Cr.NS_ERROR_ILLEGAL_VALUE,
- "checkCert should throw NS_ERROR_ILLEGAL_VALUE when the certificate " +
- "attributes array passed to checkCert has an element that has an " +
- "attribute that does not exist on the certificate");
-
- certs = [ { issuerName: "Incorrect issuerName" } ];
- is(getCheckCertResult(channel, false, certs), Cr.NS_ERROR_ILLEGAL_VALUE,
- "checkCert should throw NS_ERROR_ILLEGAL_VALUE when the certificate " +
- "attributes array passed to checkCert has an element that has an " +
- "issuerName that is not the same as the certificate's");
-
- var cert = channel.securityInfo.QueryInterface(Ci.nsISSLStatusProvider).
- SSLStatus.QueryInterface(Ci.nsISSLStatus).serverCert;
-
- certs = [ { issuerName: cert.issuerName,
- commonName: cert.commonName } ];
- is(getCheckCertResult(channel, false, certs), Cr.NS_ERROR_ABORT,
- "checkCert should throw NS_ERROR_ABORT when the certificate attributes " +
- "array passed to checkCert has a single element that has the same " +
- "issuerName and commonName as the certificate's and the certificate is " +
- "not builtin");
-
- is(getCheckCertResult(channel, true, certs), Cr.NS_OK,
- "checkCert should not throw when the certificate attributes array " +
- "passed to checkCert has a single element that has the same issuerName " +
- "and commonName as the certificate's and and builtin certificates " +
- "aren't enforced");
-
- certs = [ { issuerName: "Incorrect issuerName",
- invalidAttribute: "Invalid attribute" },
- { issuerName: cert.issuerName,
- commonName: "Invalid Common Name" },
- { issuerName: cert.issuerName,
- commonName: cert.commonName } ];
- is(getCheckCertResult(channel, false, certs), Cr.NS_ERROR_ABORT,
- "checkCert should throw NS_ERROR_ABORT when the certificate attributes " +
- "array passed to checkCert has an element that has the same issuerName " +
- "and commonName as the certificate's and the certificate is not builtin");
-
- is(getCheckCertResult(channel, true, certs), Cr.NS_OK,
- "checkCert should not throw when the certificate attributes array " +
- "passed to checkCert has an element that has the same issuerName and " +
- "commonName as the certificate's and builtin certificates aren't enforced");
-
- var mockChannel = { originalURI: Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService).
- newURI("http://example.com/", null, null) };
-
- certs = [ ];
- is(getCheckCertResult(mockChannel, false, certs), Cr.NS_ERROR_UNEXPECTED,
- "checkCert should throw NS_ERROR_UNEXPECTED when the certificate " +
- "attributes array passed to checkCert is not null and the channel's " +
- "originalURI is not https");
-
- certs = null;
- is(getCheckCertResult(mockChannel, false, certs), Cr.NS_OK,
- "checkCert should not throw when the certificate attributes object " +
- "passed to checkCert is null and the the channel's originalURI is not " +
- "https");
-
- SimpleTest.finish();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/modules/tests/mochitest/.eslintrc.js b/toolkit/modules/tests/mochitest/.eslintrc.js
deleted file mode 100644
index 3c788d6d6..000000000
--- a/toolkit/modules/tests/mochitest/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/mochitest/mochitest.eslintrc.js"
- ]
-};
diff --git a/toolkit/modules/tests/mochitest/mochitest.ini b/toolkit/modules/tests/mochitest/mochitest.ini
deleted file mode 100644
index 852d95539..000000000
--- a/toolkit/modules/tests/mochitest/mochitest.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[DEFAULT]
-
-[test_spatial_navigation.html]
diff --git a/toolkit/modules/tests/mochitest/test_spatial_navigation.html b/toolkit/modules/tests/mochitest/test_spatial_navigation.html
deleted file mode 100644
index c1fbb0eec..000000000
--- a/toolkit/modules/tests/mochitest/test_spatial_navigation.html
+++ /dev/null
@@ -1,76 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=698437
--->
-<head>
- <meta charset="utf-8">
- <title>Test for Bug 698437</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="application/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
- <script type="application/javascript">
-
- /** Test for Bug 698437 **/
-
- SimpleTest.waitForExplicitFinish();
-
- function Test() {
- if (!SpecialPowers.getBoolPref("snav.enabled")) {
- todo(false, "Enable spatial navigiation on this platform.");
- SimpleTest.finish();
- return;
- }
-
- var center = document.getElementById("center");
- var right = document.getElementById("right");
- var left = document.getElementById("left");
- var top = document.getElementById("top");
- var bottom = document.getElementById("bottom");
-
- console.log(top);
- console.log(bottom);
- console.log(center);
- console.log(left);
- console.log(right);
-
- center.focus();
- is(center.id, document.activeElement.id, "How did we call focus on center and it did" +
- " not become the active element?");
-
- synthesizeKey("VK_UP", { });
- is(document.activeElement.id, top.id,
- "Spatial navigation up key is not handled correctly.");
-
- center.focus();
- synthesizeKey("VK_DOWN", { });
- is(document.activeElement.id, bottom.id,
- "Spatial navigation down key is not handled correctly.");
-
- center.focus();
- synthesizeKey("VK_RIGHT", { });
- is(document.activeElement.id, right.id,
- "Spatial navigation right key is not handled correctly.");
-
- center.focus();
- synthesizeKey("VK_LEFT", { });
- is(document.activeElement.id, left.id,
- "Spatial navigation left key is not handled correctly.");
-
- SimpleTest.finish();
- }
-
- </script>
-</head>
-<body onload="Test();">
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=698437">Mozilla Bug 698437</a>
-<p id="display"></p>
-<div id="content">
- <button id="lefttop">1</button><button id="top">2</button><button id="righttop">3</button><br>
- <button id="left">4</button><button id="center">5</button><button id="right">6</button><br>
- <button id="leftbottom">7</button><button id="bottom">8</button><button id="rightbottom">9</button><br>
-</div>
-<pre id="test">
-</pre>
-</body>
-</html>
diff --git a/toolkit/modules/tests/xpcshell/.eslintrc.js b/toolkit/modules/tests/xpcshell/.eslintrc.js
deleted file mode 100644
index fee088c17..000000000
--- a/toolkit/modules/tests/xpcshell/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/modules/tests/xpcshell/TestIntegration.jsm b/toolkit/modules/tests/xpcshell/TestIntegration.jsm
deleted file mode 100644
index 78a0b7267..000000000
--- a/toolkit/modules/tests/xpcshell/TestIntegration.jsm
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Internal module used to test the generation of Integration.jsm getters.
- */
-
-"use strict";
-
-this.EXPORTED_SYMBOLS = [
- "TestIntegration",
-];
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/Task.jsm");
-
-this.TestIntegration = {
- value: "value",
-
- get valueFromThis() {
- return this.value;
- },
-
- get property() {
- return this._property;
- },
-
- set property(value) {
- this._property = value;
- },
-
- method(argument) {
- this.methodArgument = argument;
- return "method" + argument;
- },
-
- asyncMethod: Task.async(function* (argument) {
- this.asyncMethodArgument = argument;
- return "asyncMethod" + argument;
- }),
-};
diff --git a/toolkit/modules/tests/xpcshell/chromeappsstore.sqlite b/toolkit/modules/tests/xpcshell/chromeappsstore.sqlite
deleted file mode 100644
index 15d309df5..000000000
--- a/toolkit/modules/tests/xpcshell/chromeappsstore.sqlite
+++ /dev/null
Binary files differ
diff --git a/toolkit/modules/tests/xpcshell/propertyLists/bug710259_propertyListBinary.plist b/toolkit/modules/tests/xpcshell/propertyLists/bug710259_propertyListBinary.plist
deleted file mode 100644
index 5888c9c9c..000000000
--- a/toolkit/modules/tests/xpcshell/propertyLists/bug710259_propertyListBinary.plist
+++ /dev/null
Binary files differ
diff --git a/toolkit/modules/tests/xpcshell/propertyLists/bug710259_propertyListXML.plist b/toolkit/modules/tests/xpcshell/propertyLists/bug710259_propertyListXML.plist
deleted file mode 100644
index 9b6decc1e..000000000
--- a/toolkit/modules/tests/xpcshell/propertyLists/bug710259_propertyListXML.plist
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
-<plist version="1.0">
-<dict>
- <key>Boolean</key>
- <false/>
- <key>Array</key>
- <array>
- <string>abc</string>
- <string>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</string>
- <string>×××</string>
- <string>××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××××</string>
- <string>ð€€ð€€ð€€</string>
- <date>2011-12-31T11:15:23Z</date>
- <data>MjAxMS0xMi0zMVQxMToxNTozM1o=</data>
- <dict>
- <key>Negative Number</key>
- <integer>-400</integer>
- <key>Real Number</key>
- <real>2.71828183</real>
- <key>Big Int</key>
- <integer>9007199254740993</integer>
- <key>Negative Big Int</key>
- <integer>-9007199254740993</integer>
- </dict>
- </array>
-</dict>
-</plist>
diff --git a/toolkit/modules/tests/xpcshell/test_BinarySearch.js b/toolkit/modules/tests/xpcshell/test_BinarySearch.js
deleted file mode 100644
index f48b0bccf..000000000
--- a/toolkit/modules/tests/xpcshell/test_BinarySearch.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Components.utils.import("resource://gre/modules/BinarySearch.jsm");
-
-function run_test() {
- // empty array
- ok([], 1, false, 0);
-
- // one-element array
- ok([2], 2, true, 0);
- ok([2], 1, false, 0);
- ok([2], 3, false, 1);
-
- // two-element array
- ok([2, 4], 2, true, 0);
- ok([2, 4], 4, true, 1);
- ok([2, 4], 1, false, 0);
- ok([2, 4], 3, false, 1);
- ok([2, 4], 5, false, 2);
-
- // three-element array
- ok([2, 4, 6], 2, true, 0);
- ok([2, 4, 6], 4, true, 1);
- ok([2, 4, 6], 6, true, 2);
- ok([2, 4, 6], 1, false, 0);
- ok([2, 4, 6], 3, false, 1);
- ok([2, 4, 6], 5, false, 2);
- ok([2, 4, 6], 7, false, 3);
-
- // duplicates
- ok([2, 2], 2, true, 0);
- ok([2, 2], 1, false, 0);
- ok([2, 2], 3, false, 2);
-
- // duplicates on the left
- ok([2, 2, 4], 2, true, 1);
- ok([2, 2, 4], 4, true, 2);
- ok([2, 2, 4], 1, false, 0);
- ok([2, 2, 4], 3, false, 2);
- ok([2, 2, 4], 5, false, 3);
-
- // duplicates on the right
- ok([2, 4, 4], 2, true, 0);
- ok([2, 4, 4], 4, true, 1);
- ok([2, 4, 4], 1, false, 0);
- ok([2, 4, 4], 3, false, 1);
- ok([2, 4, 4], 5, false, 3);
-
- // duplicates in the middle
- ok([2, 4, 4, 6], 2, true, 0);
- ok([2, 4, 4, 6], 4, true, 1);
- ok([2, 4, 4, 6], 6, true, 3);
- ok([2, 4, 4, 6], 1, false, 0);
- ok([2, 4, 4, 6], 3, false, 1);
- ok([2, 4, 4, 6], 5, false, 3);
- ok([2, 4, 4, 6], 7, false, 4);
-
- // duplicates all around
- ok([2, 2, 4, 4, 6, 6], 2, true, 0);
- ok([2, 2, 4, 4, 6, 6], 4, true, 2);
- ok([2, 2, 4, 4, 6, 6], 6, true, 4);
- ok([2, 2, 4, 4, 6, 6], 1, false, 0);
- ok([2, 2, 4, 4, 6, 6], 3, false, 2);
- ok([2, 2, 4, 4, 6, 6], 5, false, 4);
- ok([2, 2, 4, 4, 6, 6], 7, false, 6);
-}
-
-function ok(array, target, expectedFound, expectedIdx) {
- let [found, idx] = BinarySearch.search(cmp, array, target);
- do_check_eq(found, expectedFound);
- do_check_eq(idx, expectedIdx);
-
- idx = expectedFound ? expectedIdx : -1;
- do_check_eq(BinarySearch.indexOf(cmp, array, target), idx);
- do_check_eq(BinarySearch.insertionIndexOf(cmp, array, target), expectedIdx);
-}
-
-function cmp(num1, num2) {
- return num1 - num2;
-}
diff --git a/toolkit/modules/tests/xpcshell/test_CanonicalJSON.js b/toolkit/modules/tests/xpcshell/test_CanonicalJSON.js
deleted file mode 100644
index fa61f5a01..000000000
--- a/toolkit/modules/tests/xpcshell/test_CanonicalJSON.js
+++ /dev/null
@@ -1,146 +0,0 @@
-const { CanonicalJSON } = Components.utils.import("resource://gre/modules/CanonicalJSON.jsm");
-
-function stringRepresentation(obj) {
- const clone = JSON.parse(JSON.stringify(obj));
- return JSON.stringify(clone);
-}
-
-add_task(function* test_canonicalJSON_should_preserve_array_order() {
- const input = ['one', 'two', 'three'];
- // No sorting should be done on arrays.
- do_check_eq(CanonicalJSON.stringify(input), '["one","two","three"]');
-});
-
-add_task(function* test_canonicalJSON_orders_object_keys() {
- const input = [{
- b: ['two', 'three'],
- a: ['zero', 'one']
- }];
- do_check_eq(
- CanonicalJSON.stringify(input),
- '[{"a":["zero","one"],"b":["two","three"]}]'
- );
-});
-
-add_task(function* test_canonicalJSON_orders_nested_object_keys() {
- const input = [{
- b: {d: 'd', c: 'c'},
- a: {b: 'b', a: 'a'}
- }];
- do_check_eq(
- CanonicalJSON.stringify(input),
- '[{"a":{"a":"a","b":"b"},"b":{"c":"c","d":"d"}}]'
- );
-});
-
-add_task(function* test_canonicalJSON_escapes_unicode_values() {
- do_check_eq(
- CanonicalJSON.stringify([{key: '✓'}]),
- '[{"key":"\\u2713"}]'
- );
- // Unicode codepoints should be output in lowercase.
- do_check_eq(
- CanonicalJSON.stringify([{key: 'é'}]),
- '[{"key":"\\u00e9"}]'
- );
-});
-
-add_task(function* test_canonicalJSON_escapes_unicode_object_keys() {
- do_check_eq(
- CanonicalJSON.stringify([{'é': 'check'}]),
- '[{"\\u00e9":"check"}]'
- );
-});
-
-
-add_task(function* test_canonicalJSON_does_not_alter_input() {
- const records = [
- {'foo': 'bar', 'last_modified': '12345', 'id': '1'},
- {'bar': 'baz', 'last_modified': '45678', 'id': '2'}
- ];
- const serializedJSON = JSON.stringify(records);
- CanonicalJSON.stringify(records);
- do_check_eq(JSON.stringify(records), serializedJSON);
-});
-
-
-add_task(function* test_canonicalJSON_preserves_data() {
- const records = [
- {'foo': 'bar', 'last_modified': '12345', 'id': '1'},
- {'bar': 'baz', 'last_modified': '45678', 'id': '2'},
- ]
- const serialized = CanonicalJSON.stringify(records);
- const expected = '[{"foo":"bar","id":"1","last_modified":"12345"},' +
- '{"bar":"baz","id":"2","last_modified":"45678"}]';
- do_check_eq(CanonicalJSON.stringify(records), expected);
-});
-
-add_task(function* test_canonicalJSON_does_not_add_space_separators() {
- const records = [
- {'foo': 'bar', 'last_modified': '12345', 'id': '1'},
- {'bar': 'baz', 'last_modified': '45678', 'id': '2'},
- ]
- const serialized = CanonicalJSON.stringify(records);
- do_check_false(serialized.includes(" "));
-});
-
-add_task(function* test_canonicalJSON_serializes_empty_object() {
- do_check_eq(CanonicalJSON.stringify({}), "{}");
-});
-
-add_task(function* test_canonicalJSON_serializes_empty_array() {
- do_check_eq(CanonicalJSON.stringify([]), "[]");
-});
-
-add_task(function* test_canonicalJSON_serializes_NaN() {
- do_check_eq(CanonicalJSON.stringify(NaN), "null");
-});
-
-add_task(function* test_canonicalJSON_serializes_inf() {
- // This isn't part of the JSON standard.
- do_check_eq(CanonicalJSON.stringify(Infinity), "null");
-});
-
-
-add_task(function* test_canonicalJSON_serializes_empty_string() {
- do_check_eq(CanonicalJSON.stringify(""), '""');
-});
-
-add_task(function* test_canonicalJSON_escapes_backslashes() {
- do_check_eq(CanonicalJSON.stringify("This\\and this"), '"This\\\\and this"');
-});
-
-add_task(function* test_canonicalJSON_handles_signed_zeros() {
- // do_check_eq doesn't support comparison of -0 and 0 properly.
- do_check_true(CanonicalJSON.stringify(-0) === '-0');
- do_check_true(CanonicalJSON.stringify(0) === '0');
-});
-
-
-add_task(function* test_canonicalJSON_with_deeply_nested_dicts() {
- const records = [{
- 'a': {
- 'b': 'b',
- 'a': 'a',
- 'c': {
- 'b': 'b',
- 'a': 'a',
- 'c': ['b', 'a', 'c'],
- 'd': {'b': 'b', 'a': 'a'},
- 'id': '1',
- 'e': 1,
- 'f': [2, 3, 1],
- 'g': {2: 2, 3: 3, 1: {
- 'b': 'b', 'a': 'a', 'c': 'c'}}}},
- 'id': '1'}]
- const expected =
- '[{"a":{"a":"a","b":"b","c":{"a":"a","b":"b","c":["b","a","c"],' +
- '"d":{"a":"a","b":"b"},"e":1,"f":[2,3,1],"g":{' +
- '"1":{"a":"a","b":"b","c":"c"},"2":2,"3":3},"id":"1"}},"id":"1"}]';
-
- do_check_eq(CanonicalJSON.stringify(records), expected);
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/modules/tests/xpcshell/test_Color.js b/toolkit/modules/tests/xpcshell/test_Color.js
deleted file mode 100644
index 9bf9bf861..000000000
--- a/toolkit/modules/tests/xpcshell/test_Color.js
+++ /dev/null
@@ -1,53 +0,0 @@
-"use strict";
-
-Components.utils.import("resource://gre/modules/Color.jsm");
-
-function run_test() {
- testRelativeLuminance();
- testIsBright();
- testContrastRatio();
- testIsContrastRatioAcceptable();
-}
-
-function testRelativeLuminance() {
- let c = new Color(0, 0, 0);
- Assert.equal(c.relativeLuminance, 0, "Black is not illuminating");
-
- c = new Color(255, 255, 255);
- Assert.equal(c.relativeLuminance, 1, "White is quite the luminant one");
-
- c = new Color(142, 42, 142);
- Assert.equal(c.relativeLuminance, 0.25263952353998204,
- "This purple is not that luminant");
-}
-
-function testIsBright() {
- let c = new Color(0, 0, 0);
- Assert.equal(c.isBright, 0, "Black is bright");
-
- c = new Color(255, 255, 255);
- Assert.equal(c.isBright, 1, "White is bright");
-}
-
-function testContrastRatio() {
- let c = new Color(0, 0, 0);
- let c2 = new Color(255, 255, 255);
- Assert.equal(c.contrastRatio(c2), 21, "Contrast between black and white is max");
- Assert.equal(c.contrastRatio(c), 1, "Contrast between equals is min");
-
- let c3 = new Color(142, 42, 142);
- Assert.equal(c.contrastRatio(c3), 6.05279047079964, "Contrast between black and purple");
- Assert.equal(c2.contrastRatio(c3), 3.469474137806338, "Contrast between white and purple");
-}
-
-function testIsContrastRatioAcceptable() {
- // Let's assert what browser.js is doing for window frames.
- let c = new Color(...[55, 156, 152]);
- let c2 = new Color(0, 0, 0);
- Assert.equal(c.r, 55, "Reds should match");
- Assert.equal(c.g, 156, "Greens should match");
- Assert.equal(c.b, 152, "Blues should match");
- Assert.ok(c.isContrastRatioAcceptable(c2), "The blue is high contrast enough");
- c = new Color(...[35, 65, 100]);
- Assert.ok(!c.isContrastRatioAcceptable(c2), "The blue is not high contrast enough");
-}
diff --git a/toolkit/modules/tests/xpcshell/test_DeferredTask.js b/toolkit/modules/tests/xpcshell/test_DeferredTask.js
deleted file mode 100644
index 441f9054c..000000000
--- a/toolkit/modules/tests/xpcshell/test_DeferredTask.js
+++ /dev/null
@@ -1,390 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests the DeferredTask.jsm module.
- */
-
-// Globals
-
-var { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "DeferredTask",
- "resource://gre/modules/DeferredTask.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-
-/**
- * Due to the nature of this module, most of the tests are time-dependent. All
- * the timeouts are designed to occur at multiples of this granularity value,
- * in milliseconds, that should be high enough to prevent intermittent failures,
- * but low enough to prevent an excessive overall test execution time.
- */
-const T = 100;
-
-/**
- * Waits for the specified timeout before resolving the returned promise.
- */
-function promiseTimeout(aTimeoutMs)
-{
- let deferred = Promise.defer();
- do_timeout(aTimeoutMs, deferred.resolve);
- return deferred.promise;
-}
-
-function run_test()
-{
- run_next_test();
-}
-
-// Tests
-
-/**
- * Creates a simple DeferredTask and executes it once.
- */
-add_test(function test_arm_simple()
-{
- new DeferredTask(run_next_test, 10).arm();
-});
-
-/**
- * Checks that the delay set for the task is respected.
- */
-add_test(function test_arm_delay_respected()
-{
- let executed1 = false;
- let executed2 = false;
-
- new DeferredTask(function () {
- executed1 = true;
- do_check_false(executed2);
- }, 1*T).arm();
-
- new DeferredTask(function () {
- executed2 = true;
- do_check_true(executed1);
- run_next_test();
- }, 2*T).arm();
-});
-
-/**
- * Checks that calling "arm" again does not introduce further delay.
- */
-add_test(function test_arm_delay_notrestarted()
-{
- let executed = false;
-
- // Create a task that will run later.
- let deferredTask = new DeferredTask(() => { executed = true; }, 4*T);
- deferredTask.arm();
-
- // Before the task starts, call "arm" again.
- do_timeout(2*T, () => deferredTask.arm());
-
- // The "arm" call should not have introduced further delays.
- do_timeout(5*T, function () {
- do_check_true(executed);
- run_next_test();
- });
-});
-
-/**
- * Checks that a task runs only once when armed multiple times synchronously.
- */
-add_test(function test_arm_coalesced()
-{
- let executed = false;
-
- let deferredTask = new DeferredTask(function () {
- do_check_false(executed);
- executed = true;
- run_next_test();
- }, 50);
-
- deferredTask.arm();
- deferredTask.arm();
-});
-
-/**
- * Checks that a task runs only once when armed multiple times synchronously,
- * even when it has been created with a delay of zero milliseconds.
- */
-add_test(function test_arm_coalesced_nodelay()
-{
- let executed = false;
-
- let deferredTask = new DeferredTask(function () {
- do_check_false(executed);
- executed = true;
- run_next_test();
- }, 0);
-
- deferredTask.arm();
- deferredTask.arm();
-});
-
-/**
- * Checks that a task can be armed again while running.
- */
-add_test(function test_arm_recursive()
-{
- let executed = false;
-
- let deferredTask = new DeferredTask(function () {
- if (!executed) {
- executed = true;
- deferredTask.arm();
- } else {
- run_next_test();
- }
- }, 50);
-
- deferredTask.arm();
-});
-
-/**
- * Checks that calling "arm" while an asynchronous task is running waits until
- * the task is finished before restarting the delay.
- */
-add_test(function test_arm_async()
-{
- let finishedExecution = false;
- let finishedExecutionAgain = false;
-
- // Create a task that will run later.
- let deferredTask = new DeferredTask(function* () {
- yield promiseTimeout(4*T);
- if (!finishedExecution) {
- finishedExecution = true;
- } else if (!finishedExecutionAgain) {
- finishedExecutionAgain = true;
- }
- }, 2*T);
- deferredTask.arm();
-
- // While the task is running, call "arm" again. This will result in a wait
- // of 2*T until the task finishes, then another 2*T for the normal task delay
- // specified on construction.
- do_timeout(4*T, function () {
- do_check_true(deferredTask.isRunning);
- do_check_false(finishedExecution);
- deferredTask.arm();
- });
-
- // This will fail in case the task was started without waiting 2*T after it
- // has finished.
- do_timeout(7*T, function () {
- do_check_false(deferredTask.isRunning);
- do_check_true(finishedExecution);
- });
-
- // This is in the middle of the second execution.
- do_timeout(10*T, function () {
- do_check_true(deferredTask.isRunning);
- do_check_false(finishedExecutionAgain);
- });
-
- // Wait enough time to verify that the task was executed as expected.
- do_timeout(13*T, function () {
- do_check_false(deferredTask.isRunning);
- do_check_true(finishedExecutionAgain);
- run_next_test();
- });
-});
-
-/**
- * Checks that an armed task can be disarmed.
- */
-add_test(function test_disarm()
-{
- // Create a task that will run later.
- let deferredTask = new DeferredTask(function () {
- do_throw("This task should not run.");
- }, 2*T);
- deferredTask.arm();
-
- // Disable execution later, but before the task starts.
- do_timeout(1*T, () => deferredTask.disarm());
-
- // Wait enough time to verify that the task did not run.
- do_timeout(3*T, run_next_test);
-});
-
-/**
- * Checks that calling "disarm" allows the delay to be restarted.
- */
-add_test(function test_disarm_delay_restarted()
-{
- let executed = false;
-
- let deferredTask = new DeferredTask(() => { executed = true; }, 4*T);
- deferredTask.arm();
-
- do_timeout(2*T, function () {
- deferredTask.disarm();
- deferredTask.arm();
- });
-
- do_timeout(5*T, function () {
- do_check_false(executed);
- });
-
- do_timeout(7*T, function () {
- do_check_true(executed);
- run_next_test();
- });
-});
-
-/**
- * Checks that calling "disarm" while an asynchronous task is running does not
- * prevent the task to finish.
- */
-add_test(function test_disarm_async()
-{
- let finishedExecution = false;
-
- let deferredTask = new DeferredTask(function* () {
- deferredTask.arm();
- yield promiseTimeout(2*T);
- finishedExecution = true;
- }, 1*T);
- deferredTask.arm();
-
- do_timeout(2*T, function () {
- do_check_true(deferredTask.isRunning);
- do_check_true(deferredTask.isArmed);
- do_check_false(finishedExecution);
- deferredTask.disarm();
- });
-
- do_timeout(4*T, function () {
- do_check_false(deferredTask.isRunning);
- do_check_false(deferredTask.isArmed);
- do_check_true(finishedExecution);
- run_next_test();
- });
-});
-
-/**
- * Checks that calling "arm" immediately followed by "disarm" while an
- * asynchronous task is running does not cause it to run again.
- */
-add_test(function test_disarm_immediate_async()
-{
- let executed = false;
-
- let deferredTask = new DeferredTask(function* () {
- do_check_false(executed);
- executed = true;
- yield promiseTimeout(2*T);
- }, 1*T);
- deferredTask.arm();
-
- do_timeout(2*T, function () {
- do_check_true(deferredTask.isRunning);
- do_check_false(deferredTask.isArmed);
- deferredTask.arm();
- deferredTask.disarm();
- });
-
- do_timeout(4*T, function () {
- do_check_true(executed);
- do_check_false(deferredTask.isRunning);
- do_check_false(deferredTask.isArmed);
- run_next_test();
- });
-});
-
-/**
- * Checks the isArmed and isRunning properties with a synchronous task.
- */
-add_test(function test_isArmed_isRunning()
-{
- let deferredTask = new DeferredTask(function () {
- do_check_true(deferredTask.isRunning);
- do_check_false(deferredTask.isArmed);
- deferredTask.arm();
- do_check_true(deferredTask.isArmed);
- deferredTask.disarm();
- do_check_false(deferredTask.isArmed);
- run_next_test();
- }, 50);
-
- do_check_false(deferredTask.isArmed);
- deferredTask.arm();
- do_check_true(deferredTask.isArmed);
- do_check_false(deferredTask.isRunning);
-});
-
-/**
- * Checks that the "finalize" method executes a synchronous task.
- */
-add_test(function test_finalize()
-{
- let executed = false;
- let timePassed = false;
-
- let deferredTask = new DeferredTask(function () {
- do_check_false(timePassed);
- executed = true;
- }, 2*T);
- deferredTask.arm();
-
- do_timeout(1*T, () => { timePassed = true; });
-
- // This should trigger the immediate execution of the task.
- deferredTask.finalize().then(function () {
- do_check_true(executed);
- run_next_test();
- });
-});
-
-/**
- * Checks that the "finalize" method executes the task again from start to
- * finish in case it is already running.
- */
-add_test(function test_finalize_executes_entirely()
-{
- let executed = false;
- let executedAgain = false;
- let timePassed = false;
-
- let deferredTask = new DeferredTask(function* () {
- // The first time, we arm the timer again and set up the finalization.
- if (!executed) {
- deferredTask.arm();
- do_check_true(deferredTask.isArmed);
- do_check_true(deferredTask.isRunning);
-
- deferredTask.finalize().then(function () {
- // When we reach this point, the task must be finished.
- do_check_true(executedAgain);
- do_check_false(timePassed);
- do_check_false(deferredTask.isArmed);
- do_check_false(deferredTask.isRunning);
- run_next_test();
- });
-
- // The second execution triggered by the finalization waits 1*T for the
- // current task to finish (see the timeout below), but then it must not
- // wait for the 2*T specified on construction as normal task delay. The
- // second execution will finish after the timeout below has passed again,
- // for a total of 2*T of wait time.
- do_timeout(3*T, () => { timePassed = true; });
- }
-
- yield promiseTimeout(1*T);
-
- // Just before finishing, indicate if we completed the second execution.
- if (executed) {
- do_check_true(deferredTask.isRunning);
- executedAgain = true;
- } else {
- executed = true;
- }
- }, 2*T);
-
- deferredTask.arm();
-});
diff --git a/toolkit/modules/tests/xpcshell/test_FileUtils.js b/toolkit/modules/tests/xpcshell/test_FileUtils.js
deleted file mode 100644
index 86ac74389..000000000
--- a/toolkit/modules/tests/xpcshell/test_FileUtils.js
+++ /dev/null
@@ -1,226 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Components.utils.import("resource://gre/modules/FileUtils.jsm");
-
-function do_check_throws(f, result, stack) {
- if (!stack)
- stack = Components.stack.caller;
-
- try {
- f();
- } catch (exc) {
- if (exc.result == result)
- return;
- do_throw("expected result " + result + ", caught " + exc, stack);
- }
- do_throw("expected result " + result + ", none thrown", stack);
-}
-
-const gProfD = do_get_profile();
-
-add_test(function test_getFile() {
- let file = FileUtils.getFile("ProfD", ["foobar"]);
- do_check_true(file instanceof Components.interfaces.nsIFile);
- do_check_false(file.exists());
-
- let other = gProfD.clone();
- other.append("foobar");
- do_check_true(file.equals(other));
-
- run_next_test();
-});
-
-add_test(function test_getFile_nonexistentDir() {
- do_check_throws(function () {
- let file = FileUtils.getFile("NonexistentD", ["foobar"]);
- }, Components.results.NS_ERROR_FAILURE);
-
- run_next_test();
-});
-
-add_test(function test_getFile_createDirs() {
- let file = FileUtils.getFile("ProfD", ["a", "b", "foobar"]);
- do_check_true(file instanceof Components.interfaces.nsIFile);
- do_check_false(file.exists());
-
- let other = gProfD.clone();
- other.append("a");
- do_check_true(other.isDirectory());
- other.append("b");
- do_check_true(other.isDirectory());
- other.append("foobar");
- do_check_true(file.equals(other));
-
- run_next_test();
-});
-
-add_test(function test_getDir() {
- let dir = FileUtils.getDir("ProfD", ["foodir"]);
- do_check_true(dir instanceof Components.interfaces.nsIFile);
- do_check_false(dir.exists());
-
- let other = gProfD.clone();
- other.append("foodir");
- do_check_true(dir.equals(other));
-
- run_next_test();
-});
-
-add_test(function test_getDir_nonexistentDir() {
- do_check_throws(function () {
- let file = FileUtils.getDir("NonexistentD", ["foodir"]);
- }, Components.results.NS_ERROR_FAILURE);
-
- run_next_test();
-});
-
-add_test(function test_getDir_shouldCreate() {
- let dir = FileUtils.getDir("ProfD", ["c", "d", "foodir"], true);
- do_check_true(dir instanceof Components.interfaces.nsIFile);
- do_check_true(dir.exists());
-
- let other = gProfD.clone();
- other.append("c");
- do_check_true(other.isDirectory());
- other.append("d");
- do_check_true(other.isDirectory());
- other.append("foodir");
- do_check_true(dir.equals(other));
-
- run_next_test();
-});
-
-var openFileOutputStream_defaultFlags = function (aKind, aFileName) {
- let file = FileUtils.getFile("ProfD", [aFileName]);
- let fos;
- do_check_true(aKind == "atomic" || aKind == "safe" || aKind == "");
- if (aKind == "atomic") {
- fos = FileUtils.openAtomicFileOutputStream(file);
- } else if (aKind == "safe") {
- fos = FileUtils.openSafeFileOutputStream(file);
- } else {
- fos = FileUtils.openFileOutputStream(file);
- }
- do_check_true(fos instanceof Components.interfaces.nsIFileOutputStream);
- if (aKind == "atomic" || aKind == "safe") {
- do_check_true(fos instanceof Components.interfaces.nsISafeOutputStream);
- }
-
- // FileUtils.openFileOutputStream or FileUtils.openAtomicFileOutputStream()
- // or FileUtils.openSafeFileOutputStream() opens the stream with DEFER_OPEN
- // which means the file will not be open until we write to it.
- do_check_false(file.exists());
-
- let data = "test_default_flags";
- fos.write(data, data.length);
- do_check_true(file.exists());
-
- // No nsIXULRuntime in xpcshell, so use this trick to determine whether we're
- // on Windows.
- if ("@mozilla.org/windows-registry-key;1" in Components.classes) {
- do_check_eq(file.permissions, 0o666);
- } else {
- do_check_eq(file.permissions, FileUtils.PERMS_FILE);
- }
-
- run_next_test();
-};
-
-var openFileOutputStream_modeFlags = function(aKind, aFileName) {
- let file = FileUtils.getFile("ProfD", [aFileName]);
- let fos;
- do_check_true(aKind == "atomic" || aKind == "safe" || aKind == "");
- if (aKind == "atomic") {
- fos = FileUtils.openAtomicFileOutputStream(file, FileUtils.MODE_WRONLY);
- } else if (aKind == "safe") {
- fos = FileUtils.openSafeFileOutputStream(file, FileUtils.MODE_WRONLY);
- } else {
- fos = FileUtils.openFileOutputStream(file, FileUtils.MODE_WRONLY);
- }
- let data = "test_modeFlags";
- do_check_throws(function () {
- fos.write(data, data.length);
- }, Components.results.NS_ERROR_FILE_NOT_FOUND);
- do_check_false(file.exists());
-
- run_next_test();
-};
-
-var closeFileOutputStream = function(aKind, aFileName) {
- let file = FileUtils.getFile("ProfD", [aFileName]);
- let fos;
- do_check_true(aKind == "atomic" || aKind == "safe");
- if (aKind == "atomic") {
- fos = FileUtils.openAtomicFileOutputStream(file);
- } else if (aKind == "safe") {
- fos = FileUtils.openSafeFileOutputStream(file);
- }
-
- // We can write data to the stream just fine while it's open.
- let data = "testClose";
- fos.write(data, data.length);
-
- // But once we close it, we can't anymore.
- if (aKind == "atomic") {
- FileUtils.closeAtomicFileOutputStream(fos);
- } else if (aKind == "safe") {
- FileUtils.closeSafeFileOutputStream(fos);
- }
- do_check_throws(function () {
- fos.write(data, data.length);
- }, Components.results.NS_BASE_STREAM_CLOSED);
- run_next_test();
-};
-
-add_test(function test_openFileOutputStream_defaultFlags() {
- openFileOutputStream_defaultFlags("", "george");
-});
-
-// openFileOutputStream will uses MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE
-// as the default mode flags, but we can pass in our own if we want to.
-add_test(function test_openFileOutputStream_modeFlags() {
- openFileOutputStream_modeFlags("", "ringo");
-});
-
-add_test(function test_openAtomicFileOutputStream_defaultFlags() {
- openFileOutputStream_defaultFlags("atomic", "peiyong");
-});
-
-// openAtomicFileOutputStream will uses MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE
-// as the default mode flags, but we can pass in our own if we want to.
-add_test(function test_openAtomicFileOutputStream_modeFlags() {
- openFileOutputStream_modeFlags("atomic", "lin");
-});
-
-add_test(function test_closeAtomicFileOutputStream() {
- closeFileOutputStream("atomic", "peiyonglin");
-});
-
-add_test(function test_openSafeFileOutputStream_defaultFlags() {
- openFileOutputStream_defaultFlags("safe", "john");
-});
-
-// openSafeFileOutputStream will uses MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE
-// as the default mode flags, but we can pass in our own if we want to.
-add_test(function test_openSafeFileOutputStream_modeFlags() {
- openFileOutputStream_modeFlags("safe", "paul");
-});
-
-add_test(function test_closeSafeFileOutputStream() {
- closeFileOutputStream("safe", "georgee");
-});
-
-add_test(function test_newFile() {
- let testfile = FileUtils.getFile("ProfD", ["test"]);
- let testpath = testfile.path;
- let file = new FileUtils.File(testpath);
- do_check_true(file instanceof Components.interfaces.nsILocalFile);
- do_check_true(file.equals(testfile));
- do_check_eq(file.path, testpath);
- run_next_test();
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/modules/tests/xpcshell/test_FinderIterator.js b/toolkit/modules/tests/xpcshell/test_FinderIterator.js
deleted file mode 100644
index 02c923a00..000000000
--- a/toolkit/modules/tests/xpcshell/test_FinderIterator.js
+++ /dev/null
@@ -1,265 +0,0 @@
-const { interfaces: Ci, classes: Cc, utils: Cu } = Components;
-const { FinderIterator } = Cu.import("resource://gre/modules/FinderIterator.jsm", {});
-Cu.import("resource://gre/modules/Promise.jsm");
-
-var gFindResults = [];
-// Stub the method that instantiates nsIFind and does all the interaction with
-// the docShell to be searched through.
-FinderIterator._iterateDocument = function* (word, window, finder) {
- for (let range of gFindResults)
- yield range;
-};
-
-FinderIterator._rangeStartsInLink = fakeRange => fakeRange.startsInLink;
-
-function FakeRange(textContent, startsInLink = false) {
- this.startContainer = {};
- this.startsInLink = startsInLink;
- this.toString = () => textContent;
-}
-
-var gMockWindow = {
- setTimeout(cb, delay) {
- Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer)
- .initWithCallback(cb, delay, Ci.nsITimer.TYPE_ONE_SHOT);
- }
-};
-
-var gMockFinder = {
- _getWindow() { return gMockWindow; }
-};
-
-function prepareIterator(findText, rangeCount) {
- gFindResults = [];
- for (let i = rangeCount; --i >= 0;)
- gFindResults.push(new FakeRange(findText));
-}
-
-add_task(function* test_start() {
- let findText = "test";
- let rangeCount = 300;
- prepareIterator(findText, rangeCount);
-
- let count = 0;
- yield FinderIterator.start({
- caseSensitive: false,
- entireWord: false,
- finder: gMockFinder,
- listener: {
- onIteratorRangeFound(range) {
- ++count;
- Assert.equal(range.toString(), findText, "Text content should match");
- }
- },
- word: findText
- });
-
- Assert.equal(rangeCount, count, "Amount of ranges yielded should match!");
- Assert.ok(!FinderIterator.running, "Running state should match");
- Assert.equal(FinderIterator._previousRanges.length, rangeCount, "Ranges cache should match");
-
- FinderIterator.reset();
-});
-
-add_task(function* test_valid_arguments() {
- let findText = "foo";
- let rangeCount = 20;
- prepareIterator(findText, rangeCount);
-
- let count = 0;
-
- yield FinderIterator.start({
- caseSensitive: false,
- entireWord: false,
- finder: gMockFinder,
- listener: { onIteratorRangeFound(range) { ++count; } },
- word: findText
- });
-
- let params = FinderIterator._previousParams;
- Assert.ok(!params.linksOnly, "Default for linksOnly is false");
- Assert.ok(!params.useCache, "Default for useCache is false");
- Assert.equal(params.word, findText, "Words should match");
-
- count = 0;
- Assert.throws(() => FinderIterator.start({
- entireWord: false,
- listener: { onIteratorRangeFound(range) { ++count; } },
- word: findText
- }), /Missing required option 'caseSensitive'/, "Should throw when missing an argument");
- FinderIterator.reset();
-
- Assert.throws(() => FinderIterator.start({
- caseSensitive: false,
- listener: { onIteratorRangeFound(range) { ++count; } },
- word: findText
- }), /Missing required option 'entireWord'/, "Should throw when missing an argument");
- FinderIterator.reset();
-
- Assert.throws(() => FinderIterator.start({
- caseSensitive: false,
- entireWord: false,
- listener: { onIteratorRangeFound(range) { ++count; } },
- word: findText
- }), /Missing required option 'finder'/, "Should throw when missing an argument");
- FinderIterator.reset();
-
- Assert.throws(() => FinderIterator.start({
- caseSensitive: true,
- entireWord: false,
- finder: gMockFinder,
- word: findText
- }), /Missing valid, required option 'listener'/, "Should throw when missing an argument");
- FinderIterator.reset();
-
- Assert.throws(() => FinderIterator.start({
- caseSensitive: false,
- entireWord: true,
- finder: gMockFinder,
- listener: { onIteratorRangeFound(range) { ++count; } },
- }), /Missing required option 'word'/, "Should throw when missing an argument");
- FinderIterator.reset();
-
- Assert.equal(count, 0, "No ranges should've been counted");
-});
-
-add_task(function* test_stop() {
- let findText = "bar";
- let rangeCount = 120;
- prepareIterator(findText, rangeCount);
-
- let count = 0;
- let whenDone = FinderIterator.start({
- caseSensitive: false,
- entireWord: false,
- finder: gMockFinder,
- listener: { onIteratorRangeFound(range) { ++count; } },
- word: findText
- });
-
- FinderIterator.stop();
-
- yield whenDone;
-
- Assert.equal(count, 0, "Number of ranges should be 0");
-
- FinderIterator.reset();
-});
-
-add_task(function* test_reset() {
- let findText = "tik";
- let rangeCount = 142;
- prepareIterator(findText, rangeCount);
-
- let count = 0;
- let whenDone = FinderIterator.start({
- caseSensitive: false,
- entireWord: false,
- finder: gMockFinder,
- listener: { onIteratorRangeFound(range) { ++count; } },
- word: findText
- });
-
- Assert.ok(FinderIterator.running, "Yup, running we are");
- Assert.equal(count, 0, "Number of ranges should match 0");
- Assert.equal(FinderIterator.ranges.length, 0, "Number of ranges should match 0");
-
- FinderIterator.reset();
-
- Assert.ok(!FinderIterator.running, "Nope, running we are not");
- Assert.equal(FinderIterator.ranges.length, 0, "No ranges after reset");
- Assert.equal(FinderIterator._previousRanges.length, 0, "No ranges after reset");
-
- yield whenDone;
-
- Assert.equal(count, 0, "Number of ranges should match 0");
-});
-
-add_task(function* test_parallel_starts() {
- let findText = "tak";
- let rangeCount = 2143;
- prepareIterator(findText, rangeCount);
-
- // Start off the iterator.
- let count = 0;
- let whenDone = FinderIterator.start({
- caseSensitive: false,
- entireWord: false,
- finder: gMockFinder,
- listener: { onIteratorRangeFound(range) { ++count; } },
- word: findText
- });
-
- yield new Promise(resolve => gMockWindow.setTimeout(resolve, 120));
- Assert.ok(FinderIterator.running, "We ought to be running here");
-
- let count2 = 0;
- let whenDone2 = FinderIterator.start({
- caseSensitive: false,
- entireWord: false,
- finder: gMockFinder,
- listener: { onIteratorRangeFound(range) { ++count2; } },
- word: findText
- });
-
- // Let the iterator run for a little while longer before we assert the world.
- yield new Promise(resolve => gMockWindow.setTimeout(resolve, 10));
- FinderIterator.stop();
-
- Assert.ok(!FinderIterator.running, "Stop means stop");
-
- yield whenDone;
- yield whenDone2;
-
- Assert.greater(count, FinderIterator.kIterationSizeMax, "At least one range should've been found");
- Assert.less(count, rangeCount, "Not all ranges should've been found");
- Assert.greater(count2, FinderIterator.kIterationSizeMax, "At least one range should've been found");
- Assert.less(count2, rangeCount, "Not all ranges should've been found");
-
- Assert.equal(count2, count, "The second start was later, but should have caught up");
-
- FinderIterator.reset();
-});
-
-add_task(function* test_allowDistance() {
- let findText = "gup";
- let rangeCount = 20;
- prepareIterator(findText, rangeCount);
-
- // Start off the iterator.
- let count = 0;
- let whenDone = FinderIterator.start({
- caseSensitive: false,
- entireWord: false,
- finder: gMockFinder,
- listener: { onIteratorRangeFound(range) { ++count; } },
- word: findText
- });
-
- let count2 = 0;
- let whenDone2 = FinderIterator.start({
- caseSensitive: false,
- entireWord: false,
- finder: gMockFinder,
- listener: { onIteratorRangeFound(range) { ++count2; } },
- word: "gu"
- });
-
- let count3 = 0;
- let whenDone3 = FinderIterator.start({
- allowDistance: 1,
- caseSensitive: false,
- entireWord: false,
- finder: gMockFinder,
- listener: { onIteratorRangeFound(range) { ++count3; } },
- word: "gu"
- });
-
- yield Promise.all([whenDone, whenDone2, whenDone3]);
-
- Assert.equal(count, rangeCount, "The first iterator invocation should yield all results");
- Assert.equal(count2, 0, "The second iterator invocation should yield _no_ results");
- Assert.equal(count3, rangeCount, "The first iterator invocation should yield all results");
-
- FinderIterator.reset();
-});
diff --git a/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js b/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
deleted file mode 100644
index 74d5ad43d..000000000
--- a/toolkit/modules/tests/xpcshell/test_GMPInstallManager.js
+++ /dev/null
@@ -1,794 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu, manager: Cm} = Components;
-const URL_HOST = "http://localhost";
-
-var GMPScope = Cu.import("resource://gre/modules/GMPInstallManager.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://testing-common/httpd.js");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm")
-Cu.import("resource://gre/modules/UpdateUtils.jsm");
-
-var { computeHash } = Cu.import("resource://gre/modules/addons/ProductAddonChecker.jsm");
-var ProductAddonCheckerScope = Cu.import("resource://gre/modules/addons/ProductAddonChecker.jsm");
-
-do_get_profile();
-
-function run_test() { Cu.import("resource://gre/modules/Preferences.jsm")
- Preferences.set("media.gmp.log.dump", true);
- Preferences.set("media.gmp.log.level", 0);
- run_next_test();
-}
-
-/**
- * Tests that the helper used for preferences works correctly
- */
-add_task(function* test_prefs() {
- let addon1 = "addon1", addon2 = "addon2";
-
- GMPScope.GMPPrefs.set(GMPScope.GMPPrefs.KEY_URL, "http://not-really-used");
- GMPScope.GMPPrefs.set(GMPScope.GMPPrefs.KEY_URL_OVERRIDE, "http://not-really-used-2");
- GMPScope.GMPPrefs.set(GMPScope.GMPPrefs.KEY_PLUGIN_LAST_UPDATE, "1", addon1);
- GMPScope.GMPPrefs.set(GMPScope.GMPPrefs.KEY_PLUGIN_VERSION, "2", addon1);
- GMPScope.GMPPrefs.set(GMPScope.GMPPrefs.KEY_PLUGIN_LAST_UPDATE, "3", addon2);
- GMPScope.GMPPrefs.set(GMPScope.GMPPrefs.KEY_PLUGIN_VERSION, "4", addon2);
- GMPScope.GMPPrefs.set(GMPScope.GMPPrefs.KEY_PLUGIN_AUTOUPDATE, false, addon2);
- GMPScope.GMPPrefs.set(GMPScope.GMPPrefs.KEY_CERT_CHECKATTRS, true);
-
- do_check_eq(GMPScope.GMPPrefs.get(GMPScope.GMPPrefs.KEY_URL), "http://not-really-used");
- do_check_eq(GMPScope.GMPPrefs.get(GMPScope.GMPPrefs.KEY_URL_OVERRIDE),
- "http://not-really-used-2");
- do_check_eq(GMPScope.GMPPrefs.get(GMPScope.GMPPrefs.KEY_PLUGIN_LAST_UPDATE, "", addon1), "1");
- do_check_eq(GMPScope.GMPPrefs.get(GMPScope.GMPPrefs.KEY_PLUGIN_VERSION, "", addon1), "2");
- do_check_eq(GMPScope.GMPPrefs.get(GMPScope.GMPPrefs.KEY_PLUGIN_LAST_UPDATE, "", addon2), "3");
- do_check_eq(GMPScope.GMPPrefs.get(GMPScope.GMPPrefs.KEY_PLUGIN_VERSION, "", addon2), "4");
- do_check_eq(GMPScope.GMPPrefs.get(GMPScope.GMPPrefs.KEY_PLUGIN_AUTOUPDATE, undefined, addon2),
- false);
- do_check_true(GMPScope.GMPPrefs.get(GMPScope.GMPPrefs.KEY_CERT_CHECKATTRS));
- GMPScope.GMPPrefs.set(GMPScope.GMPPrefs.KEY_PLUGIN_AUTOUPDATE, true, addon2);
-});
-
-/**
- * Tests that an uninit without a check works fine
- */
-add_task(function* test_checkForAddons_uninitWithoutCheck() {
- let installManager = new GMPInstallManager();
- installManager.uninit();
-});
-
-/**
- * Tests that an uninit without an install works fine
- */
-add_test(function test_checkForAddons_uninitWithoutInstall() {
- overrideXHR(200, "");
- let installManager = new GMPInstallManager();
- let promise = installManager.checkForAddons();
- promise.then(res => {
- do_check_true(res.usedFallback);
- installManager.uninit();
- run_next_test();
- });
-});
-
-/**
- * Tests that no response returned rejects
- */
-add_test(function test_checkForAddons_noResponse() {
- overrideXHR(200, "");
- let installManager = new GMPInstallManager();
- let promise = installManager.checkForAddons();
- promise.then(res => {
- do_check_true(res.usedFallback);
- installManager.uninit();
- run_next_test();
- });
-});
-
-/**
- * Tests that no addons element returned resolves with no addons
- */
-add_task(function* test_checkForAddons_noAddonsElement() {
- overrideXHR(200, "<updates></updates>");
- let installManager = new GMPInstallManager();
- let res = yield installManager.checkForAddons();
- do_check_eq(res.gmpAddons.length, 0);
- installManager.uninit();
-});
-
-/**
- * Tests that empty addons element returned resolves with no addons
- */
-add_task(function* test_checkForAddons_emptyAddonsElement() {
- overrideXHR(200, "<updates><addons/></updates>");
- let installManager = new GMPInstallManager();
- let res = yield installManager.checkForAddons();
- do_check_eq(res.gmpAddons.length, 0);
- installManager.uninit();
-});
-
-/**
- * Tests that a response with the wrong root element rejects
- */
-add_test(function test_checkForAddons_wrongResponseXML() {
- overrideXHR(200, "<digits_of_pi>3.141592653589793....</digits_of_pi>");
- let installManager = new GMPInstallManager();
- let promise = installManager.checkForAddons();
- promise.then(res => {
- do_check_true(res.usedFallback);
- installManager.uninit();
- run_next_test();
- });
-});
-
-/**
- * Tests that a 404 error works as expected
- */
-add_test(function test_checkForAddons_404Error() {
- overrideXHR(404, "");
- let installManager = new GMPInstallManager();
- let promise = installManager.checkForAddons();
- promise.then(res => {
- do_check_true(res.usedFallback);
- installManager.uninit();
- run_next_test();
- });
-});
-
-/**
- * Tests that a xhr abort() works as expected
- */
-add_test(function test_checkForAddons_abort() {
- let overriddenXhr = overrideXHR(200, "", { dropRequest: true} );
- let installManager = new GMPInstallManager();
- let promise = installManager.checkForAddons();
- overriddenXhr.abort();
- promise.then(res => {
- do_check_true(res.usedFallback);
- installManager.uninit();
- run_next_test();
- });
-});
-
-/**
- * Tests that a defensive timeout works as expected
- */
-add_test(function test_checkForAddons_timeout() {
- overrideXHR(200, "", { dropRequest: true, timeout: true });
- let installManager = new GMPInstallManager();
- let promise = installManager.checkForAddons();
- promise.then(res => {
- do_check_true(res.usedFallback);
- installManager.uninit();
- run_next_test();
- });
-});
-
-/**
- * Tests that we throw correctly in case of ssl certification error.
- */
-add_test(function test_checkForAddons_bad_ssl() {
- //
- // Add random stuff that cause CertUtil to require https.
- //
- let PREF_KEY_URL_OVERRIDE_BACKUP =
- Preferences.get(GMPScope.GMPPrefs.KEY_URL_OVERRIDE, undefined);
- Preferences.reset(GMPScope.GMPPrefs.KEY_URL_OVERRIDE);
-
- let CERTS_BRANCH_DOT_ONE = GMPScope.GMPPrefs.KEY_CERTS_BRANCH + ".1";
- let PREF_CERTS_BRANCH_DOT_ONE_BACKUP =
- Preferences.get(CERTS_BRANCH_DOT_ONE, undefined);
- Services.prefs.setCharPref(CERTS_BRANCH_DOT_ONE, "funky value");
-
-
- overrideXHR(200, "");
- let installManager = new GMPInstallManager();
- let promise = installManager.checkForAddons();
- promise.then(res => {
- do_check_true(res.usedFallback);
- installManager.uninit();
- if (PREF_KEY_URL_OVERRIDE_BACKUP) {
- Preferences.set(GMPScope.GMPPrefs.KEY_URL_OVERRIDE,
- PREF_KEY_URL_OVERRIDE_BACKUP);
- }
- if (PREF_CERTS_BRANCH_DOT_ONE_BACKUP) {
- Preferences.set(CERTS_BRANCH_DOT_ONE,
- PREF_CERTS_BRANCH_DOT_ONE_BACKUP);
- }
- run_next_test();
- });
-});
-
-/**
- * Tests that gettinga a funky non XML response works as expected
- */
-add_test(function test_checkForAddons_notXML() {
- overrideXHR(200, "3.141592653589793....");
- let installManager = new GMPInstallManager();
- let promise = installManager.checkForAddons();
-
- promise.then(res => {
- do_check_true(res.usedFallback);
- installManager.uninit();
- run_next_test();
- });
-});
-
-/**
- * Tests that getting a response with a single addon works as expected
- */
-add_task(function* test_checkForAddons_singleAddon() {
- let responseXML =
- "<?xml version=\"1.0\"?>" +
- "<updates>" +
- " <addons>" +
- " <addon id=\"gmp-gmpopenh264\"" +
- " URL=\"http://127.0.0.1:8011/gmp-gmpopenh264-1.1.zip\"" +
- " hashFunction=\"sha256\"" +
- " hashValue=\"1118b90d6f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee\"" +
- " version=\"1.1\"/>" +
- " </addons>" +
- "</updates>"
- overrideXHR(200, responseXML);
- let installManager = new GMPInstallManager();
- let res = yield installManager.checkForAddons();
- do_check_eq(res.gmpAddons.length, 1);
- let gmpAddon = res.gmpAddons[0];
- do_check_eq(gmpAddon.id, "gmp-gmpopenh264");
- do_check_eq(gmpAddon.URL, "http://127.0.0.1:8011/gmp-gmpopenh264-1.1.zip");
- do_check_eq(gmpAddon.hashFunction, "sha256");
- do_check_eq(gmpAddon.hashValue, "1118b90d6f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee");
- do_check_eq(gmpAddon.version, "1.1");
- do_check_eq(gmpAddon.size, undefined);
- do_check_true(gmpAddon.isValid);
- do_check_false(gmpAddon.isInstalled);
- installManager.uninit();
-});
-
-/**
- * Tests that getting a response with a single addon with the optional size
- * attribute parses as expected.
- */
-add_task(function* test_checkForAddons_singleAddonWithSize() {
- let responseXML =
- "<?xml version=\"1.0\"?>" +
- "<updates>" +
- " <addons>" +
- " <addon id=\"openh264-plugin-no-at-symbol\"" +
- " URL=\"http://127.0.0.1:8011/gmp-gmpopenh264-1.1.zip\"" +
- " hashFunction=\"sha256\"" +
- " size=\"42\"" +
- " hashValue=\"1118b90d6f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee\"" +
- " version=\"1.1\"/>" +
- " </addons>" +
- "</updates>"
- overrideXHR(200, responseXML);
- let installManager = new GMPInstallManager();
- let res = yield installManager.checkForAddons();
- do_check_eq(res.gmpAddons.length, 1);
- let gmpAddon = res.gmpAddons[0];
- do_check_eq(gmpAddon.id, "openh264-plugin-no-at-symbol");
- do_check_eq(gmpAddon.URL, "http://127.0.0.1:8011/gmp-gmpopenh264-1.1.zip");
- do_check_eq(gmpAddon.hashFunction, "sha256");
- do_check_eq(gmpAddon.hashValue, "1118b90d6f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee");
- do_check_eq(gmpAddon.size, 42);
- do_check_eq(gmpAddon.version, "1.1");
- do_check_true(gmpAddon.isValid);
- do_check_false(gmpAddon.isInstalled);
- installManager.uninit();
-});
-
-/**
- * Tests that checking for multiple addons work correctly.
- * Also tests that invalid addons work correctly.
- */
-add_task(function* test_checkForAddons_multipleAddonNoUpdatesSomeInvalid() {
- let responseXML =
- "<?xml version=\"1.0\"?>" +
- "<updates>" +
- " <addons>" +
- // valid openh264
- " <addon id=\"gmp-gmpopenh264\"" +
- " URL=\"http://127.0.0.1:8011/gmp-gmpopenh264-1.1.zip\"" +
- " hashFunction=\"sha256\"" +
- " hashValue=\"1118b90d6f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee\"" +
- " version=\"1.1\"/>" +
- // valid not openh264
- " <addon id=\"NOT-gmp-gmpopenh264\"" +
- " URL=\"http://127.0.0.1:8011/NOT-gmp-gmpopenh264-1.1.zip\"" +
- " hashFunction=\"sha512\"" +
- " hashValue=\"141592656f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee\"" +
- " version=\"9.1\"/>" +
- // noid
- " <addon notid=\"NOT-gmp-gmpopenh264\"" +
- " URL=\"http://127.0.0.1:8011/NOT-gmp-gmpopenh264-1.1.zip\"" +
- " hashFunction=\"sha512\"" +
- " hashValue=\"141592656f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee\"" +
- " version=\"9.1\"/>" +
- // no URL
- " <addon id=\"NOT-gmp-gmpopenh264\"" +
- " notURL=\"http://127.0.0.1:8011/NOT-gmp-gmpopenh264-1.1.zip\"" +
- " hashFunction=\"sha512\"" +
- " hashValue=\"141592656f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee\"" +
- " version=\"9.1\"/>" +
- // no hash function
- " <addon id=\"NOT-gmp-gmpopenh264\"" +
- " URL=\"http://127.0.0.1:8011/NOT-gmp-gmpopenh264-1.1.zip\"" +
- " nothashFunction=\"sha512\"" +
- " hashValue=\"141592656f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee\"" +
- " version=\"9.1\"/>" +
- // no hash function
- " <addon id=\"NOT-gmp-gmpopenh264\"" +
- " URL=\"http://127.0.0.1:8011/NOT-gmp-gmpopenh264-1.1.zip\"" +
- " hashFunction=\"sha512\"" +
- " nothashValue=\"141592656f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee\"" +
- " version=\"9.1\"/>" +
- // not version
- " <addon id=\"NOT-gmp-gmpopenh264\"" +
- " URL=\"http://127.0.0.1:8011/NOT-gmp-gmpopenh264-1.1.zip\"" +
- " hashFunction=\"sha512\"" +
- " hashValue=\"141592656f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee\"" +
- " notversion=\"9.1\"/>" +
- " </addons>" +
- "</updates>"
- overrideXHR(200, responseXML);
- let installManager = new GMPInstallManager();
- let res = yield installManager.checkForAddons();
- do_check_eq(res.gmpAddons.length, 7);
- let gmpAddon = res.gmpAddons[0];
- do_check_eq(gmpAddon.id, "gmp-gmpopenh264");
- do_check_eq(gmpAddon.URL, "http://127.0.0.1:8011/gmp-gmpopenh264-1.1.zip");
- do_check_eq(gmpAddon.hashFunction, "sha256");
- do_check_eq(gmpAddon.hashValue, "1118b90d6f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee");
- do_check_eq(gmpAddon.version, "1.1");
- do_check_true(gmpAddon.isValid);
- do_check_false(gmpAddon.isInstalled);
-
- gmpAddon = res.gmpAddons[1];
- do_check_eq(gmpAddon.id, "NOT-gmp-gmpopenh264");
- do_check_eq(gmpAddon.URL, "http://127.0.0.1:8011/NOT-gmp-gmpopenh264-1.1.zip");
- do_check_eq(gmpAddon.hashFunction, "sha512");
- do_check_eq(gmpAddon.hashValue, "141592656f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee");
- do_check_eq(gmpAddon.version, "9.1");
- do_check_true(gmpAddon.isValid);
- do_check_false(gmpAddon.isInstalled);
-
- for (let i = 2; i < res.gmpAddons.length; i++) {
- do_check_false(res.gmpAddons[i].isValid);
- do_check_false(res.gmpAddons[i].isInstalled);
- }
- installManager.uninit();
-});
-
-/**
- * Tests that checking for addons when there are also updates available
- * works as expected.
- */
-add_task(function* test_checkForAddons_updatesWithAddons() {
- let responseXML =
- "<?xml version=\"1.0\"?>" +
- " <updates>" +
- " <update type=\"minor\" displayVersion=\"33.0a1\" appVersion=\"33.0a1\" platformVersion=\"33.0a1\" buildID=\"20140628030201\">" +
- " <patch type=\"complete\" URL=\"http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2014/06/2014-06-28-03-02-01-mozilla-central/firefox-33.0a1.en-US.mac.complete.mar\" hashFunction=\"sha512\" hashValue=\"f3f90d71dff03ae81def80e64bba3e4569da99c9e15269f731c2b167c4fc30b3aed9f5fee81c19614120230ca333e73a5e7def1b8e45d03135b2069c26736219\" size=\"85249896\"/>" +
- " </update>" +
- " <addons>" +
- " <addon id=\"gmp-gmpopenh264\"" +
- " URL=\"http://127.0.0.1:8011/gmp-gmpopenh264-1.1.zip\"" +
- " hashFunction=\"sha256\"" +
- " hashValue=\"1118b90d6f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee\"" +
- " version=\"1.1\"/>" +
- " </addons>" +
- "</updates>"
- overrideXHR(200, responseXML);
- let installManager = new GMPInstallManager();
- let res = yield installManager.checkForAddons();
- do_check_eq(res.gmpAddons.length, 1);
- let gmpAddon = res.gmpAddons[0];
- do_check_eq(gmpAddon.id, "gmp-gmpopenh264");
- do_check_eq(gmpAddon.URL, "http://127.0.0.1:8011/gmp-gmpopenh264-1.1.zip");
- do_check_eq(gmpAddon.hashFunction, "sha256");
- do_check_eq(gmpAddon.hashValue, "1118b90d6f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee");
- do_check_eq(gmpAddon.version, "1.1");
- do_check_true(gmpAddon.isValid);
- do_check_false(gmpAddon.isInstalled);
- installManager.uninit();
-});
-
-/**
- * Tests that installing found addons works as expected
- */
-function* test_checkForAddons_installAddon(id, includeSize, wantInstallReject) {
- do_print("Running installAddon for id: " + id +
- ", includeSize: " + includeSize +
- " and wantInstallReject: " + wantInstallReject);
- let httpServer = new HttpServer();
- let dir = FileUtils.getDir("TmpD", [], true);
- httpServer.registerDirectory("/", dir);
- httpServer.start(-1);
- let testserverPort = httpServer.identity.primaryPort;
- let zipFileName = "test_" + id + "_GMP.zip";
-
- let zipURL = URL_HOST + ":" + testserverPort + "/" + zipFileName;
- do_print("zipURL: " + zipURL);
-
- let data = "e~=0.5772156649";
- let zipFile = createNewZipFile(zipFileName, data);
- let hashFunc = "sha256";
- let expectedDigest = yield computeHash(hashFunc, zipFile.path);
- let fileSize = zipFile.fileSize;
- if (wantInstallReject) {
- fileSize = 1;
- }
-
- let responseXML =
- "<?xml version=\"1.0\"?>" +
- "<updates>" +
- " <addons>" +
- " <addon id=\"" + id + "-gmp-gmpopenh264\"" +
- " URL=\"" + zipURL + "\"" +
- " hashFunction=\"" + hashFunc + "\"" +
- " hashValue=\"" + expectedDigest + "\"" +
- (includeSize ? " size=\"" + fileSize + "\"" : "") +
- " version=\"1.1\"/>" +
- " </addons>" +
- "</updates>"
-
- overrideXHR(200, responseXML);
- let installManager = new GMPInstallManager();
- let res = yield installManager.checkForAddons();
- do_check_eq(res.gmpAddons.length, 1);
- let gmpAddon = res.gmpAddons[0];
- do_check_false(gmpAddon.isInstalled);
-
- try {
- let extractedPaths = yield installManager.installAddon(gmpAddon);
- if (wantInstallReject) {
- do_check_true(false); // installAddon() should have thrown.
- }
- do_check_eq(extractedPaths.length, 1);
- let extractedPath = extractedPaths[0];
-
- do_print("Extracted path: " + extractedPath);
-
- let extractedFile = Cc["@mozilla.org/file/local;1"].
- createInstance(Ci.nsIFile);
- extractedFile.initWithPath(extractedPath);
- do_check_true(extractedFile.exists());
- let readData = readStringFromFile(extractedFile);
- do_check_eq(readData, data);
-
- // Make sure the prefs are set correctly
- do_check_true(!!GMPScope.GMPPrefs.get(
- GMPScope.GMPPrefs.KEY_PLUGIN_LAST_UPDATE, "", gmpAddon.id));
- do_check_eq(GMPScope.GMPPrefs.get(GMPScope.GMPPrefs.KEY_PLUGIN_VERSION, "",
- gmpAddon.id),
- "1.1");
- do_check_eq(GMPScope.GMPPrefs.get(GMPScope.GMPPrefs.KEY_PLUGIN_ABI, "",
- gmpAddon.id),
- UpdateUtils.ABI);
- // Make sure it reports as being installed
- do_check_true(gmpAddon.isInstalled);
-
- // Cleanup
- extractedFile.parent.remove(true);
- zipFile.remove(false);
- httpServer.stop(function() {});
- installManager.uninit();
- } catch (ex) {
- zipFile.remove(false);
- if (!wantInstallReject) {
- do_throw("install update should not reject " + ex.message);
- }
- }
-}
-
-add_task(test_checkForAddons_installAddon.bind(null, "1", true, false));
-add_task(test_checkForAddons_installAddon.bind(null, "2", false, false));
-add_task(test_checkForAddons_installAddon.bind(null, "3", true, true));
-
-/**
- * Tests simpleCheckAndInstall when autoupdate is disabled for a GMP
- */
-add_task(function* test_simpleCheckAndInstall_autoUpdateDisabled() {
- GMPScope.GMPPrefs.set(GMPScope.GMPPrefs.KEY_PLUGIN_AUTOUPDATE, false, GMPScope.OPEN_H264_ID);
- let responseXML =
- "<?xml version=\"1.0\"?>" +
- "<updates>" +
- " <addons>" +
- // valid openh264
- " <addon id=\"gmp-gmpopenh264\"" +
- " URL=\"http://127.0.0.1:8011/gmp-gmpopenh264-1.1.zip\"" +
- " hashFunction=\"sha256\"" +
- " hashValue=\"1118b90d6f645eefc2b99af17bae396636ace1e33d079c88de715177584e2aee\"" +
- " version=\"1.1\"/>" +
- " </addons>" +
- "</updates>"
-
- overrideXHR(200, responseXML);
- let installManager = new GMPInstallManager();
- let result = yield installManager.simpleCheckAndInstall();
- do_check_eq(result.status, "nothing-new-to-install");
- Preferences.reset(GMPScope.GMPPrefs.KEY_UPDATE_LAST_CHECK);
- GMPScope.GMPPrefs.set(GMPScope.GMPPrefs.KEY_PLUGIN_AUTOUPDATE, true, GMPScope.OPEN_H264_ID);
-});
-
-/**
- * Tests simpleCheckAndInstall nothing to install
- */
-add_task(function* test_simpleCheckAndInstall_nothingToInstall() {
- let responseXML =
- "<?xml version=\"1.0\"?>" +
- "<updates>" +
- "</updates>"
-
- overrideXHR(200, responseXML);
- let installManager = new GMPInstallManager();
- let result = yield installManager.simpleCheckAndInstall();
- do_check_eq(result.status, "nothing-new-to-install");
-});
-
-/**
- * Tests simpleCheckAndInstall too frequent
- */
-add_task(function* test_simpleCheckAndInstall_tooFrequent() {
- let responseXML =
- "<?xml version=\"1.0\"?>" +
- "<updates>" +
- "</updates>"
-
- overrideXHR(200, responseXML);
- let installManager = new GMPInstallManager();
- let result = yield installManager.simpleCheckAndInstall();
- do_check_eq(result.status, "too-frequent-no-check");
-});
-
-/**
- * Tests that installing addons when there is no server works as expected
- */
-add_test(function test_installAddon_noServer() {
- let dir = FileUtils.getDir("TmpD", [], true);
- let zipFileName = "test_GMP.zip";
- let zipURL = URL_HOST + ":0/" + zipFileName;
-
- let data = "e~=0.5772156649";
- let zipFile = createNewZipFile(zipFileName, data);
-
- let responseXML =
- "<?xml version=\"1.0\"?>" +
- "<updates>" +
- " <addons>" +
- " <addon id=\"gmp-gmpopenh264\"" +
- " URL=\"" + zipURL + "\"" +
- " hashFunction=\"sha256\"" +
- " hashValue=\"11221cbda000347b054028b527a60e578f919cb10f322ef8077d3491c6fcb474\"" +
- " version=\"1.1\"/>" +
- " </addons>" +
- "</updates>"
-
- overrideXHR(200, responseXML);
- let installManager = new GMPInstallManager();
- let checkPromise = installManager.checkForAddons();
- checkPromise.then(res => {
- do_check_eq(res.gmpAddons.length, 1);
- let gmpAddon = res.gmpAddons[0];
-
- GMPInstallManager.overrideLeaveDownloadedZip = true;
- let installPromise = installManager.installAddon(gmpAddon);
- installPromise.then(extractedPaths => {
- do_throw("No server for install should reject");
- }, err => {
- do_check_true(!!err);
- installManager.uninit();
- run_next_test();
- });
- }, () => {
- do_throw("check should not reject for install no server");
- });
-});
-
-/**
- * Returns the read stream into a string
- */
-function readStringFromInputStream(inputStream) {
- let sis = Cc["@mozilla.org/scriptableinputstream;1"].
- createInstance(Ci.nsIScriptableInputStream);
- sis.init(inputStream);
- let text = sis.read(sis.available());
- sis.close();
- return text;
-}
-
-/**
- * Reads a string of text from a file.
- * This function only works with ASCII text.
- */
-function readStringFromFile(file) {
- if (!file.exists()) {
- do_print("readStringFromFile - file doesn't exist: " + file.path);
- return null;
- }
- let fis = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- fis.init(file, FileUtils.MODE_RDONLY, FileUtils.PERMS_FILE, 0);
- return readStringFromInputStream(fis);
-}
-
-/**
- * Bare bones XMLHttpRequest implementation for testing onprogress, onerror,
- * and onload nsIDomEventListener handleEvent.
- */
-function makeHandler(aVal) {
- if (typeof aVal == "function")
- return { handleEvent: aVal };
- return aVal;
-}
-/**
- * Constructs a mock xhr which is used for testing different aspects
- * of responses.
- */
-function xhr(inputStatus, inputResponse, options) {
- this.inputStatus = inputStatus;
- this.inputResponse = inputResponse;
- this.status = 0;
- this.responseXML = null;
- this._aborted = false;
- this._onabort = null;
- this._onprogress = null;
- this._onerror = null;
- this._onload = null;
- this._onloadend = null;
- this._ontimeout = null;
- this._url = null;
- this._method = null;
- this._timeout = 0;
- this._notified = false;
- this._options = options || {};
-}
-xhr.prototype = {
- overrideMimeType: function(aMimetype) { },
- setRequestHeader: function(aHeader, aValue) { },
- status: null,
- channel: { set notificationCallbacks(aVal) { } },
- open: function(aMethod, aUrl) {
- this.channel.originalURI = Services.io.newURI(aUrl, null, null);
- this._method = aMethod; this._url = aUrl;
- },
- abort: function() {
- this._dropRequest = true;
- this._notify(["abort", "loadend"]);
- },
- responseXML: null,
- responseText: null,
- send: function(aBody) {
- do_execute_soon(function() {
- try {
- if (this._options.dropRequest) {
- if (this._timeout > 0 && this._options.timeout) {
- this._notify(["timeout", "loadend"]);
- }
- return;
- }
- this.status = this.inputStatus;
- this.responseText = this.inputResponse;
- try {
- let parser = Cc["@mozilla.org/xmlextras/domparser;1"].
- createInstance(Ci.nsIDOMParser);
- this.responseXML = parser.parseFromString(this.inputResponse,
- "application/xml");
- } catch (e) {
- this.responseXML = null;
- }
- if (this.inputStatus === 200) {
- this._notify(["load", "loadend"]);
- } else {
- this._notify(["error", "loadend"]);
- }
- } catch (ex) {
- do_throw(ex);
- }
- }.bind(this));
- },
- set onabort(aValue) { this._onabort = makeHandler(aValue); },
- get onabort() { return this._onabort; },
- set onprogress(aValue) { this._onprogress = makeHandler(aValue); },
- get onprogress() { return this._onprogress; },
- set onerror(aValue) { this._onerror = makeHandler(aValue); },
- get onerror() { return this._onerror; },
- set onload(aValue) { this._onload = makeHandler(aValue); },
- get onload() { return this._onload; },
- set onloadend(aValue) { this._onloadend = makeHandler(aValue); },
- get onloadend() { return this._onloadend; },
- set ontimeout(aValue) { this._ontimeout = makeHandler(aValue); },
- get ontimeout() { return this._ontimeout; },
- set timeout(aValue) { this._timeout = aValue; },
- _notify: function(events) {
- if (this._notified) {
- return;
- }
- this._notified = true;
- for (let item of events) {
- let k = "on" + item;
- if (this[k]) {
- do_print("Notifying " + item);
- let e = {
- target: this,
- type: item,
- };
- this[k](e);
- } else {
- do_print("Notifying " + item + ", but there are no listeners");
- }
- }
- },
- addEventListener: function(aEvent, aValue, aCapturing) {
- eval("this._on" + aEvent + " = aValue");
- },
- flags: Ci.nsIClassInfo.SINGLETON,
- getScriptableHelper: () => null,
- getInterfaces: function(aCount) {
- let interfaces = [Ci.nsISupports];
- aCount.value = interfaces.length;
- return interfaces;
- },
- classDescription: "XMLHttpRequest",
- contractID: "@mozilla.org/xmlextras/xmlhttprequest;1",
- classID: Components.ID("{c9b37f43-4278-4304-a5e0-600991ab08cb}"),
- createInstance: function(aOuter, aIID) {
- if (aOuter == null)
- return this.QueryInterface(aIID);
- throw Cr.NS_ERROR_NO_AGGREGATION;
- },
- QueryInterface: function(aIID) {
- if (aIID.equals(Ci.nsIClassInfo) ||
- aIID.equals(Ci.nsISupports))
- return this;
- throw Cr.NS_ERROR_NO_INTERFACE;
- },
- get wrappedJSObject() { return this; }
-};
-
-/**
- * Helper used to overrideXHR requests (no matter to what URL) with the
- * specified status and response.
- * @param status The status you want to get back when an XHR request is made
- * @param response The response you want to get back when an XHR request is made
- */
-function overrideXHR(status, response, options) {
- overrideXHR.myxhr = new xhr(status, response, options);
- ProductAddonCheckerScope.CreateXHR = function() {
- return overrideXHR.myxhr;
- };
- return overrideXHR.myxhr;
-}
-
-/**
- * Creates a new zip file containing a file with the specified data
- * @param zipName The name of the zip file
- * @param data The data to go inside the zip for the filename entry1.info
- */
-function createNewZipFile(zipName, data) {
- // Create a zip file which will be used for extracting
- let stream = Cc["@mozilla.org/io/string-input-stream;1"].
- createInstance(Ci.nsIStringInputStream);
- stream.setData(data, data.length);
- let zipWriter = Cc["@mozilla.org/zipwriter;1"].
- createInstance(Components.interfaces.nsIZipWriter);
- let zipFile = FileUtils.getFile("TmpD", [zipName]);
- if (zipFile.exists()) {
- zipFile.remove(false);
- }
- // From prio.h
- const PR_RDWR = 0x04;
- const PR_CREATE_FILE = 0x08;
- const PR_TRUNCATE = 0x20;
- zipWriter.open(zipFile, PR_RDWR | PR_CREATE_FILE | PR_TRUNCATE);
- zipWriter.addEntryStream("entry1.info", Date.now(),
- Ci.nsIZipWriter.COMPRESSION_BEST, stream, false);
- zipWriter.close();
- stream.close();
- do_print("zip file created on disk at: " + zipFile.path);
- return zipFile;
-}
diff --git a/toolkit/modules/tests/xpcshell/test_Http.js b/toolkit/modules/tests/xpcshell/test_Http.js
deleted file mode 100644
index 3dfd769b7..000000000
--- a/toolkit/modules/tests/xpcshell/test_Http.js
+++ /dev/null
@@ -1,257 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Components.utils.import("resource://gre/modules/Http.jsm");
-Components.utils.import("resource://testing-common/httpd.js");
-
-const BinaryInputStream = Components.Constructor("@mozilla.org/binaryinputstream;1",
- "nsIBinaryInputStream", "setInputStream");
-
-var server;
-
-const kDefaultServerPort = 9000;
-const kSuccessPath = "/success";
-const kBaseUrl = "http://localhost:" + kDefaultServerPort;
-const kSuccessUrl = kBaseUrl + kSuccessPath;
-
-const kPostPath = "/post";
-const kPostUrl = kBaseUrl + kPostPath;
-const kPostDataSent = [["foo", "bar"], ["complex", "!*()@"]];
-const kPostDataReceived = "foo=bar&complex=%21%2A%28%29%40";
-const kPostMimeTypeReceived = "application/x-www-form-urlencoded; charset=utf-8";
-
-const kJsonPostPath = "/json_post";
-const kJsonPostUrl = kBaseUrl + kJsonPostPath;
-const kJsonPostData = JSON.stringify(kPostDataSent);
-const kJsonPostMimeType = "application/json";
-
-const kPutPath = "/put";
-const kPutUrl = kBaseUrl + kPutPath;
-const kPutDataSent = [["P", "NP"]];
-const kPutDataReceived = "P=NP";
-
-const kGetPath = "/get";
-const kGetUrl = kBaseUrl + kGetPath;
-
-function successResult(aRequest, aResponse) {
- aResponse.setStatusLine(null, 200, "OK");
- aResponse.setHeader("Content-Type", "application/json");
- aResponse.write("Success!");
-}
-
-function getDataChecker(aExpectedMethod, aExpectedData, aExpectedMimeType = null) {
- return function(aRequest, aResponse) {
- let body = new BinaryInputStream(aRequest.bodyInputStream);
- let bytes = [];
- let avail;
- while ((avail = body.available()) > 0)
- Array.prototype.push.apply(bytes, body.readByteArray(avail));
-
- do_check_eq(aRequest.method, aExpectedMethod);
-
- // Checking if the Content-Type is as expected.
- if (aExpectedMimeType) {
- let contentType = aRequest.getHeader("Content-Type");
- do_check_eq(contentType, aExpectedMimeType);
- }
-
- var data = String.fromCharCode.apply(null, bytes);
-
- do_check_eq(data, aExpectedData);
-
- aResponse.setStatusLine(null, 200, "OK");
- aResponse.setHeader("Content-Type", "application/json");
- aResponse.write("Success!");
- }
-}
-
-add_test(function test_successCallback() {
- do_test_pending();
- let options = {
- onLoad: function(aResponse) {
- do_check_eq(aResponse, "Success!");
- do_test_finished();
- run_next_test();
- },
- onError: function(e) {
- do_check_true(false);
- do_test_finished();
- run_next_test();
- }
- }
- httpRequest(kSuccessUrl, options);
-});
-
-add_test(function test_errorCallback() {
- do_test_pending();
- let options = {
- onSuccess: function(aResponse) {
- do_check_true(false);
- do_test_finished();
- run_next_test();
- },
- onError: function(e, aResponse) {
- do_check_eq(e, "404 - Not Found");
- do_test_finished();
- run_next_test();
- }
- }
- httpRequest(kBaseUrl + "/failure", options);
-});
-
-add_test(function test_PostData() {
- do_test_pending();
- let options = {
- onLoad: function(aResponse) {
- do_check_eq(aResponse, "Success!");
- do_test_finished();
- run_next_test();
- },
- onError: function(e) {
- do_check_true(false);
- do_test_finished();
- run_next_test();
- },
- postData: kPostDataSent
- }
- httpRequest(kPostUrl, options);
-});
-
-add_test(function test_PutData() {
- do_test_pending();
- let options = {
- method: "PUT",
- onLoad: function(aResponse) {
- do_check_eq(aResponse, "Success!");
- do_test_finished();
- run_next_test();
- },
- onError: function(e) {
- do_check_true(false);
- do_test_finished();
- run_next_test();
- },
- postData: kPutDataSent
- }
- httpRequest(kPutUrl, options);
-});
-
-add_test(function test_GetData() {
- do_test_pending();
- let options = {
- onLoad: function(aResponse) {
- do_check_eq(aResponse, "Success!");
- do_test_finished();
- run_next_test();
- },
- onError: function(e) {
- do_check_true(false);
- do_test_finished();
- run_next_test();
- },
- postData: null
- }
- httpRequest(kGetUrl, options);
-});
-
-add_test(function test_OptionalParameters() {
- let options = {
- onLoad: null,
- onError: null,
- logger: null
- };
- // Just make sure that nothing throws when doing this (i.e. httpRequest
- // doesn't try to access null options).
- httpRequest(kGetUrl, options);
- run_next_test();
-});
-
-/**
- * Makes sure that httpRequest API allows setting a custom Content-Type header
- * for POST requests when data is a string.
- */
-add_test(function test_CustomContentTypeOnPost() {
- do_test_pending();
-
- // Preparing the request parameters.
- let options = {
- onLoad: function(aResponse) {
- do_check_eq(aResponse, "Success!");
- do_test_finished();
- run_next_test();
- },
- onError: function(e) {
- do_check_true(false);
- do_test_finished();
- run_next_test();
- },
- postData: kJsonPostData,
- // Setting a custom Content-Type header.
- headers: [['Content-Type', "application/json"]]
- }
-
- // Firing the request.
- httpRequest(kJsonPostUrl, options);
-});
-
-/**
- * Ensures that the httpRequest API provides a way to override the response
- * MIME type.
- */
-add_test(function test_OverrideMimeType() {
- do_test_pending();
-
- // Preparing the request parameters.
- const kMimeType = 'text/xml; charset=UTF-8';
- let options = {
- onLoad: function(aResponse, xhr) {
- do_check_eq(aResponse, "Success!");
-
- // Set the expected MIME-type.
- let reportedMimeType = xhr.getResponseHeader("Content-Type");
- do_check_neq(reportedMimeType, kMimeType);
-
- // responseXML should not be not null if overriding mime type succeeded.
- do_check_true(xhr.responseXML != null);
-
- do_test_finished();
- run_next_test();
- },
- onError: function(e) {
- do_check_true(false);
- do_test_finished();
- run_next_test();
- }
- };
-
- // Firing the request.
- let xhr = httpRequest(kGetUrl, options);
-
- // Override the response MIME type.
- xhr.overrideMimeType(kMimeType);
-});
-
-function run_test() {
- // Set up a mock HTTP server to serve a success page.
- server = new HttpServer();
- server.registerPathHandler(kSuccessPath, successResult);
- server.registerPathHandler(kPostPath,
- getDataChecker("POST", kPostDataReceived,
- kPostMimeTypeReceived));
- server.registerPathHandler(kPutPath,
- getDataChecker("PUT", kPutDataReceived));
- server.registerPathHandler(kGetPath, getDataChecker("GET", ""));
- server.registerPathHandler(kJsonPostPath,
- getDataChecker("POST", kJsonPostData,
- kJsonPostMimeType));
-
- server.start(kDefaultServerPort);
-
- run_next_test();
-
- // Teardown.
- do_register_cleanup(function() {
- server.stop(function() { });
- });
-}
-
diff --git a/toolkit/modules/tests/xpcshell/test_Integration.js b/toolkit/modules/tests/xpcshell/test_Integration.js
deleted file mode 100644
index 808e2d34f..000000000
--- a/toolkit/modules/tests/xpcshell/test_Integration.js
+++ /dev/null
@@ -1,238 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/*
- * Tests the Integration.jsm module.
- */
-
-"use strict";
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/Integration.jsm", this);
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/Task.jsm", this);
-
-const TestIntegration = {
- value: "value",
-
- get valueFromThis() {
- return this.value;
- },
-
- get property() {
- return this._property;
- },
-
- set property(value) {
- this._property = value;
- },
-
- method(argument) {
- this.methodArgument = argument;
- return "method" + argument;
- },
-
- asyncMethod: Task.async(function* (argument) {
- this.asyncMethodArgument = argument;
- return "asyncMethod" + argument;
- }),
-};
-
-let overrideFn = base => ({
- value: "overridden-value",
-
- get property() {
- return "overridden-" + base.__lookupGetter__("property").call(this);
- },
-
- set property(value) {
- base.__lookupSetter__("property").call(this, "overridden-" + value);
- },
-
- method() {
- return "overridden-" + base.method.apply(this, arguments);
- },
-
- asyncMethod: Task.async(function* () {
- return "overridden-" + (yield base.asyncMethod.apply(this, arguments));
- }),
-});
-
-let superOverrideFn = base => ({
- __proto__: base,
-
- value: "overridden-value",
-
- get property() {
- return "overridden-" + super.property;
- },
-
- set property(value) {
- super.property = "overridden-" + value;
- },
-
- method() {
- return "overridden-" + super.method(...arguments);
- },
-
- asyncMethod: Task.async(function* () {
- // We cannot use the "super" keyword in methods defined using "Task.async".
- return "overridden-" + (yield base.asyncMethod.apply(this, arguments));
- }),
-});
-
-/**
- * Fails the test if the results of method invocations on the combined object
- * don't match the expected results based on how many overrides are registered.
- *
- * @param combined
- * The combined object based on the TestIntegration root.
- * @param overridesCount
- * Zero if the root object is not overridden, or a higher value to test
- * the presence of one or more integration overrides.
- */
-function* assertCombinedResults(combined, overridesCount) {
- let expectedValue = overridesCount > 0 ? "overridden-value" : "value";
- let prefix = "overridden-".repeat(overridesCount);
-
- Assert.equal(combined.value, expectedValue);
- Assert.equal(combined.valueFromThis, expectedValue);
-
- combined.property = "property";
- Assert.equal(combined.property, prefix.repeat(2) + "property");
-
- combined.methodArgument = "";
- Assert.equal(combined.method("-argument"), prefix + "method-argument");
- Assert.equal(combined.methodArgument, "-argument");
-
- combined.asyncMethodArgument = "";
- Assert.equal(yield combined.asyncMethod("-argument"),
- prefix + "asyncMethod-argument");
- Assert.equal(combined.asyncMethodArgument, "-argument");
-}
-
-/**
- * Fails the test if the results of method invocations on the combined object
- * for the "testModule" integration point don't match the expected results based
- * on how many overrides are registered.
- *
- * @param overridesCount
- * Zero if the root object is not overridden, or a higher value to test
- * the presence of one or more integration overrides.
- */
-function* assertCurrentCombinedResults(overridesCount) {
- let combined = Integration.testModule.getCombined(TestIntegration);
- yield assertCombinedResults(combined, overridesCount);
-}
-
-/**
- * Checks the initial state with no integration override functions registered.
- */
-add_task(function* test_base() {
- yield assertCurrentCombinedResults(0);
-});
-
-/**
- * Registers and unregisters an integration override function.
- */
-add_task(function* test_override() {
- Integration.testModule.register(overrideFn);
- yield assertCurrentCombinedResults(1);
-
- // Registering the same function more than once has no effect.
- Integration.testModule.register(overrideFn);
- yield assertCurrentCombinedResults(1);
-
- Integration.testModule.unregister(overrideFn);
- yield assertCurrentCombinedResults(0);
-});
-
-/**
- * Registers and unregisters more than one integration override function, of
- * which one uses the prototype and the "super" keyword to access the base.
- */
-add_task(function* test_override_super_multiple() {
- Integration.testModule.register(overrideFn);
- Integration.testModule.register(superOverrideFn);
- yield assertCurrentCombinedResults(2);
-
- Integration.testModule.unregister(overrideFn);
- yield assertCurrentCombinedResults(1);
-
- Integration.testModule.unregister(superOverrideFn);
- yield assertCurrentCombinedResults(0);
-});
-
-/**
- * Registers an integration override function that throws an exception, and
- * ensures that this does not block other functions from being registered.
- */
-add_task(function* test_override_error() {
- let errorOverrideFn = base => { throw "Expected error." };
-
- Integration.testModule.register(errorOverrideFn);
- Integration.testModule.register(overrideFn);
- yield assertCurrentCombinedResults(1);
-
- Integration.testModule.unregister(errorOverrideFn);
- Integration.testModule.unregister(overrideFn);
- yield assertCurrentCombinedResults(0);
-});
-
-/**
- * Checks that state saved using the "this" reference is preserved as a shallow
- * copy when registering new integration override functions.
- */
-add_task(function* test_state_preserved() {
- let valueObject = { toString: () => "toString" };
-
- let combined = Integration.testModule.getCombined(TestIntegration);
- combined.property = valueObject;
- Assert.ok(combined.property === valueObject);
-
- Integration.testModule.register(overrideFn);
- combined = Integration.testModule.getCombined(TestIntegration);
- Assert.equal(combined.property, "overridden-toString");
-
- Integration.testModule.unregister(overrideFn);
- combined = Integration.testModule.getCombined(TestIntegration);
- Assert.ok(combined.property === valueObject);
-});
-
-/**
- * Checks that the combined integration objects cannot be used with XPCOM.
- *
- * This is limited by the fact that interfaces with the "[function]" annotation,
- * for example nsIObserver, do not call the QueryInterface implementation.
- */
-add_task(function* test_xpcom_throws() {
- let combined = Integration.testModule.getCombined(TestIntegration);
-
- // This calls QueryInterface because it looks for nsISupportsWeakReference.
- Assert.throws(() => Services.obs.addObserver(combined, "test-topic", true),
- "NS_NOINTERFACE");
-});
-
-/**
- * Checks that getters defined by defineModuleGetter are able to retrieve the
- * latest version of the combined integration object.
- */
-add_task(function* test_defineModuleGetter() {
- let objectForGetters = {};
-
- // Test with and without the optional "symbol" parameter.
- Integration.testModule.defineModuleGetter(objectForGetters,
- "TestIntegration", "resource://testing-common/TestIntegration.jsm");
- Integration.testModule.defineModuleGetter(objectForGetters,
- "integration", "resource://testing-common/TestIntegration.jsm",
- "TestIntegration");
-
- Integration.testModule.register(overrideFn);
- yield assertCombinedResults(objectForGetters.integration, 1);
- yield assertCombinedResults(objectForGetters.TestIntegration, 1);
-
- Integration.testModule.unregister(overrideFn);
- yield assertCombinedResults(objectForGetters.integration, 0);
- yield assertCombinedResults(objectForGetters.TestIntegration, 0);
-});
diff --git a/toolkit/modules/tests/xpcshell/test_JSONFile.js b/toolkit/modules/tests/xpcshell/test_JSONFile.js
deleted file mode 100644
index 77e8c55b9..000000000
--- a/toolkit/modules/tests/xpcshell/test_JSONFile.js
+++ /dev/null
@@ -1,242 +0,0 @@
-/**
- * Tests the JSONFile object.
- */
-
-"use strict";
-
-// Globals
-
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "DownloadPaths",
- "resource://gre/modules/DownloadPaths.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "FileUtils",
- "resource://gre/modules/FileUtils.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "OS",
- "resource://gre/modules/osfile.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "JSONFile",
- "resource://gre/modules/JSONFile.jsm");
-
-let gFileCounter = Math.floor(Math.random() * 1000000);
-
-/**
- * Returns a reference to a temporary file, that is guaranteed not to exist, and
- * to have never been created before.
- *
- * @param aLeafName
- * Suggested leaf name for the file to be created.
- *
- * @return nsIFile pointing to a non-existent file in a temporary directory.
- *
- * @note It is not enough to delete the file if it exists, or to delete the file
- * after calling nsIFile.createUnique, because on Windows the delete
- * operation in the file system may still be pending, preventing a new
- * file with the same name to be created.
- */
-function getTempFile(aLeafName)
-{
- // Prepend a serial number to the extension in the suggested leaf name.
- let [base, ext] = DownloadPaths.splitBaseNameAndExtension(aLeafName);
- let leafName = base + "-" + gFileCounter + ext;
- gFileCounter++;
-
- // Get a file reference under the temporary directory for this test file.
- let file = FileUtils.getFile("TmpD", [leafName]);
- do_check_false(file.exists());
-
- do_register_cleanup(function () {
- if (file.exists()) {
- file.remove(false);
- }
- });
-
- return file;
-}
-
-const TEST_STORE_FILE_NAME = "test-store.json";
-
-const TEST_DATA = {
- number: 123,
- string: "test",
- object: {
- prop1: 1,
- prop2: 2,
- },
-};
-
-// Tests
-
-add_task(function* test_save_reload()
-{
- let storeForSave = new JSONFile({
- path: getTempFile(TEST_STORE_FILE_NAME).path,
- });
-
- yield storeForSave.load();
-
- do_check_true(storeForSave.dataReady);
- do_check_matches(storeForSave.data, {});
-
- Object.assign(storeForSave.data, TEST_DATA);
-
- yield new Promise((resolve) => {
- let save = storeForSave._save.bind(storeForSave);
- storeForSave._save = () => {
- save();
- resolve();
- };
- storeForSave.saveSoon();
- });
-
- let storeForLoad = new JSONFile({
- path: storeForSave.path,
- });
-
- yield storeForLoad.load();
-
- Assert.deepEqual(storeForLoad.data, TEST_DATA);
-});
-
-add_task(function* test_load_sync()
-{
- let storeForSave = new JSONFile({
- path: getTempFile(TEST_STORE_FILE_NAME).path
- });
- yield storeForSave.load();
- Object.assign(storeForSave.data, TEST_DATA);
- yield storeForSave._save();
-
- let storeForLoad = new JSONFile({
- path: storeForSave.path,
- });
- storeForLoad.ensureDataReady();
-
- Assert.deepEqual(storeForLoad.data, TEST_DATA);
-});
-
-add_task(function* test_load_with_dataPostProcessor()
-{
- let storeForSave = new JSONFile({
- path: getTempFile(TEST_STORE_FILE_NAME).path
- });
- yield storeForSave.load();
- Object.assign(storeForSave.data, TEST_DATA);
- yield storeForSave._save();
-
- let random = Math.random();
- let storeForLoad = new JSONFile({
- path: storeForSave.path,
- dataPostProcessor: (data) => {
- Assert.deepEqual(data, TEST_DATA);
-
- data.test = random;
- return data;
- },
- });
-
- yield storeForLoad.load();
-
- do_check_eq(storeForLoad.data.test, random);
-});
-
-add_task(function* test_load_with_dataPostProcessor_fails()
-{
- let store = new JSONFile({
- path: getTempFile(TEST_STORE_FILE_NAME).path,
- dataPostProcessor: () => {
- throw new Error("dataPostProcessor fails.");
- },
- });
-
- yield Assert.rejects(store.load(), /dataPostProcessor fails\./);
-
- do_check_false(store.dataReady);
-});
-
-add_task(function* test_load_sync_with_dataPostProcessor_fails()
-{
- let store = new JSONFile({
- path: getTempFile(TEST_STORE_FILE_NAME).path,
- dataPostProcessor: () => {
- throw new Error("dataPostProcessor fails.");
- },
- });
-
- Assert.throws(() => store.ensureDataReady(), /dataPostProcessor fails\./);
-
- do_check_false(store.dataReady);
-});
-
-/**
- * Loads data from a string in a predefined format. The purpose of this test is
- * to verify that the JSON format used in previous versions can be loaded.
- */
-add_task(function* test_load_string_predefined()
-{
- let store = new JSONFile({
- path: getTempFile(TEST_STORE_FILE_NAME).path,
- });
-
- let string =
- "{\"number\":123,\"string\":\"test\",\"object\":{\"prop1\":1,\"prop2\":2}}";
-
- yield OS.File.writeAtomic(store.path, new TextEncoder().encode(string),
- { tmpPath: store.path + ".tmp" });
-
- yield store.load();
-
- Assert.deepEqual(store.data, TEST_DATA);
-});
-
-/**
- * Loads data from a malformed JSON string.
- */
-add_task(function* test_load_string_malformed()
-{
- let store = new JSONFile({
- path: getTempFile(TEST_STORE_FILE_NAME).path,
- });
-
- let string = "{\"number\":123,\"string\":\"test\",\"object\":{\"prop1\":1,";
-
- yield OS.File.writeAtomic(store.path, new TextEncoder().encode(string),
- { tmpPath: store.path + ".tmp" });
-
- yield store.load();
-
- // A backup file should have been created.
- do_check_true(yield OS.File.exists(store.path + ".corrupt"));
- yield OS.File.remove(store.path + ".corrupt");
-
- // The store should be ready to accept new data.
- do_check_true(store.dataReady);
- do_check_matches(store.data, {});
-});
-
-/**
- * Loads data from a malformed JSON string, using the synchronous initialization
- * path.
- */
-add_task(function* test_load_string_malformed_sync()
-{
- let store = new JSONFile({
- path: getTempFile(TEST_STORE_FILE_NAME).path,
- });
-
- let string = "{\"number\":123,\"string\":\"test\",\"object\":{\"prop1\":1,";
-
- yield OS.File.writeAtomic(store.path, new TextEncoder().encode(string),
- { tmpPath: store.path + ".tmp" });
-
- store.ensureDataReady();
-
- // A backup file should have been created.
- do_check_true(yield OS.File.exists(store.path + ".corrupt"));
- yield OS.File.remove(store.path + ".corrupt");
-
- // The store should be ready to accept new data.
- do_check_true(store.dataReady);
- do_check_matches(store.data, {});
-});
diff --git a/toolkit/modules/tests/xpcshell/test_Log.js b/toolkit/modules/tests/xpcshell/test_Log.js
deleted file mode 100644
index 6aee99c93..000000000
--- a/toolkit/modules/tests/xpcshell/test_Log.js
+++ /dev/null
@@ -1,592 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/* eslint-disable block-spacing */
-
-var {utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/NetUtil.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-
-Cu.import("resource://gre/modules/Promise.jsm")
-Cu.import("resource://gre/modules/Log.jsm");
-
-var testFormatter = {
- format: function format(message) {
- return message.loggerName + "\t" +
- message.levelDesc + "\t" +
- message.message;
- }
-};
-
-function MockAppender(formatter) {
- Log.Appender.call(this, formatter);
- this.messages = [];
-}
-MockAppender.prototype = {
- __proto__: Log.Appender.prototype,
-
- doAppend: function DApp_doAppend(message) {
- this.messages.push(message);
- }
-};
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function test_Logger() {
- let log = Log.repository.getLogger("test.logger");
- let appender = new MockAppender(new Log.BasicFormatter());
-
- log.level = Log.Level.Debug;
- appender.level = Log.Level.Info;
- log.addAppender(appender);
- log.info("info test");
- log.debug("this should be logged but not appended.");
-
- do_check_eq(appender.messages.length, 1);
-
- let msgRe = /\d+\ttest.logger\t\INFO\tinfo test/;
- do_check_true(msgRe.test(appender.messages[0]));
-});
-
-add_task(function test_Logger_parent() {
- // Check whether parenting is correct
- let grandparentLog = Log.repository.getLogger("grandparent");
- let childLog = Log.repository.getLogger("grandparent.parent.child");
- do_check_eq(childLog.parent.name, "grandparent");
-
- let parentLog = Log.repository.getLogger("grandparent.parent");
- do_check_eq(childLog.parent.name, "grandparent.parent");
-
- // Check that appends are exactly in scope
- let gpAppender = new MockAppender(new Log.BasicFormatter());
- gpAppender.level = Log.Level.Info;
- grandparentLog.addAppender(gpAppender);
- childLog.info("child info test");
- Log.repository.rootLogger.info("this shouldn't show up in gpAppender");
-
- do_check_eq(gpAppender.messages.length, 1);
- do_check_true(gpAppender.messages[0].indexOf("child info test") > 0);
-});
-
-add_test(function test_LoggerWithMessagePrefix() {
- let log = Log.repository.getLogger("test.logger.prefix");
- let appender = new MockAppender(new Log.MessageOnlyFormatter());
- log.addAppender(appender);
-
- let prefixed = Log.repository.getLoggerWithMessagePrefix(
- "test.logger.prefix", "prefix: ");
-
- log.warn("no prefix");
- prefixed.warn("with prefix");
-
- Assert.equal(appender.messages.length, 2, "2 messages were logged.");
- Assert.deepEqual(appender.messages, [
- "no prefix",
- "prefix: with prefix",
- ], "Prefix logger works.");
-
- run_next_test();
-});
-
-/*
- * A utility method for checking object equivalence.
- * Fields with a reqular expression value in expected will be tested
- * against the corresponding value in actual. Otherwise objects
- * are expected to have the same keys and equal values.
- */
-function checkObjects(expected, actual) {
- do_check_true(expected instanceof Object);
- do_check_true(actual instanceof Object);
- for (let key in expected) {
- do_check_neq(actual[key], undefined);
- if (expected[key] instanceof RegExp) {
- do_check_true(expected[key].test(actual[key].toString()));
- } else if (expected[key] instanceof Object) {
- checkObjects(expected[key], actual[key]);
- } else {
- do_check_eq(expected[key], actual[key]);
- }
- }
-
- for (let key in actual) {
- do_check_neq(expected[key], undefined);
- }
-}
-
-add_task(function test_StructuredLogCommands() {
- let appender = new MockAppender(new Log.StructuredFormatter());
- let logger = Log.repository.getLogger("test.StructuredOutput");
- logger.addAppender(appender);
- logger.level = Log.Level.Info;
-
- logger.logStructured("test_message", {_message: "message string one"});
- logger.logStructured("test_message", {_message: "message string two",
- _level: "ERROR",
- source_file: "test_Log.js"});
- logger.logStructured("test_message");
- logger.logStructured("test_message", {source_file: "test_Log.js",
- message_position: 4});
-
- let messageOne = {"_time": /\d+/,
- "_namespace": "test.StructuredOutput",
- "_level": "INFO",
- "_message": "message string one",
- "action": "test_message"};
-
- let messageTwo = {"_time": /\d+/,
- "_namespace": "test.StructuredOutput",
- "_level": "ERROR",
- "_message": "message string two",
- "action": "test_message",
- "source_file": "test_Log.js"};
-
- let messageThree = {"_time": /\d+/,
- "_namespace": "test.StructuredOutput",
- "_level": "INFO",
- "action": "test_message"};
-
- let messageFour = {"_time": /\d+/,
- "_namespace": "test.StructuredOutput",
- "_level": "INFO",
- "action": "test_message",
- "source_file": "test_Log.js",
- "message_position": 4};
-
- checkObjects(messageOne, JSON.parse(appender.messages[0]));
- checkObjects(messageTwo, JSON.parse(appender.messages[1]));
- checkObjects(messageThree, JSON.parse(appender.messages[2]));
- checkObjects(messageFour, JSON.parse(appender.messages[3]));
-
- let errored = false;
- try {
- logger.logStructured("", {_message: "invalid message"});
- } catch (e) {
- errored = true;
- do_check_eq(e, "An action is required when logging a structured message.");
- } finally {
- do_check_true(errored);
- }
-
- errored = false;
- try {
- logger.logStructured("message_action", "invalid params");
- } catch (e) {
- errored = true;
- do_check_eq(e, "The params argument is required to be an object.");
- } finally {
- do_check_true(errored);
- }
-
- // Logging with unstructured interface should produce the same messages
- // as the structured interface for these cases.
- appender = new MockAppender(new Log.StructuredFormatter());
- logger = Log.repository.getLogger("test.StructuredOutput1");
- messageOne._namespace = "test.StructuredOutput1";
- messageTwo._namespace = "test.StructuredOutput1";
- logger.addAppender(appender);
- logger.level = Log.Level.All;
- logger.info("message string one", {action: "test_message"});
- logger.error("message string two", {action: "test_message",
- source_file: "test_Log.js"});
-
- checkObjects(messageOne, JSON.parse(appender.messages[0]));
- checkObjects(messageTwo, JSON.parse(appender.messages[1]));
-});
-
-add_task(function test_StorageStreamAppender() {
- let appender = new Log.StorageStreamAppender(testFormatter);
- do_check_eq(appender.getInputStream(), null);
-
- // Log to the storage stream and verify the log was written and can be
- // read back.
- let logger = Log.repository.getLogger("test.StorageStreamAppender");
- logger.addAppender(appender);
- logger.info("OHAI");
- let inputStream = appender.getInputStream();
- let data = NetUtil.readInputStreamToString(inputStream,
- inputStream.available());
- do_check_eq(data, "test.StorageStreamAppender\tINFO\tOHAI\n");
-
- // We can read it again even.
- let sndInputStream = appender.getInputStream();
- let sameData = NetUtil.readInputStreamToString(sndInputStream,
- sndInputStream.available());
- do_check_eq(data, sameData);
-
- // Reset the appender and log some more.
- appender.reset();
- do_check_eq(appender.getInputStream(), null);
- logger.debug("wut?!?");
- inputStream = appender.getInputStream();
- data = NetUtil.readInputStreamToString(inputStream,
- inputStream.available());
- do_check_eq(data, "test.StorageStreamAppender\tDEBUG\twut?!?\n");
-});
-
-function fileContents(path) {
- let decoder = new TextDecoder();
- return OS.File.read(path).then(array => {
- return decoder.decode(array);
- });
-}
-
-add_task(function* test_FileAppender() {
- // This directory does not exist yet
- let dir = OS.Path.join(do_get_profile().path, "test_Log");
- do_check_false(yield OS.File.exists(dir));
- let path = OS.Path.join(dir, "test_FileAppender");
- let appender = new Log.FileAppender(path, testFormatter);
- let logger = Log.repository.getLogger("test.FileAppender");
- logger.addAppender(appender);
-
- // Logging to a file that can't be created won't do harm.
- do_check_false(yield OS.File.exists(path));
- logger.info("OHAI!");
-
- yield OS.File.makeDir(dir);
- logger.info("OHAI");
- yield appender._lastWritePromise;
-
- do_check_eq((yield fileContents(path)),
- "test.FileAppender\tINFO\tOHAI\n");
-
- logger.info("OHAI");
- yield appender._lastWritePromise;
-
- do_check_eq((yield fileContents(path)),
- "test.FileAppender\tINFO\tOHAI\n" +
- "test.FileAppender\tINFO\tOHAI\n");
-
- // Reset the appender and log some more.
- yield appender.reset();
- do_check_false(yield OS.File.exists(path));
-
- logger.debug("O RLY?!?");
- yield appender._lastWritePromise;
- do_check_eq((yield fileContents(path)),
- "test.FileAppender\tDEBUG\tO RLY?!?\n");
-
- yield appender.reset();
- logger.debug("1");
- logger.info("2");
- logger.info("3");
- logger.info("4");
- logger.info("5");
- // Waiting on only the last promise should account for all of these.
- yield appender._lastWritePromise;
-
- // Messages ought to be logged in order.
- do_check_eq((yield fileContents(path)),
- "test.FileAppender\tDEBUG\t1\n" +
- "test.FileAppender\tINFO\t2\n" +
- "test.FileAppender\tINFO\t3\n" +
- "test.FileAppender\tINFO\t4\n" +
- "test.FileAppender\tINFO\t5\n");
-});
-
-add_task(function* test_BoundedFileAppender() {
- let dir = OS.Path.join(do_get_profile().path, "test_Log");
-
- if (!(yield OS.File.exists(dir))) {
- yield OS.File.makeDir(dir);
- }
-
- let path = OS.Path.join(dir, "test_BoundedFileAppender");
- // This appender will hold about two lines at a time.
- let appender = new Log.BoundedFileAppender(path, testFormatter, 40);
- let logger = Log.repository.getLogger("test.BoundedFileAppender");
- logger.addAppender(appender);
-
- logger.info("ONE");
- logger.info("TWO");
- yield appender._lastWritePromise;
-
- do_check_eq((yield fileContents(path)),
- "test.BoundedFileAppender\tINFO\tONE\n" +
- "test.BoundedFileAppender\tINFO\tTWO\n");
-
- logger.info("THREE");
- logger.info("FOUR");
-
- do_check_neq(appender._removeFilePromise, undefined);
- yield appender._removeFilePromise;
- yield appender._lastWritePromise;
-
- do_check_eq((yield fileContents(path)),
- "test.BoundedFileAppender\tINFO\tTHREE\n" +
- "test.BoundedFileAppender\tINFO\tFOUR\n");
-
- yield appender.reset();
- logger.info("ONE");
- logger.info("TWO");
- logger.info("THREE");
- logger.info("FOUR");
-
- do_check_neq(appender._removeFilePromise, undefined);
- yield appender._removeFilePromise;
- yield appender._lastWritePromise;
-
- do_check_eq((yield fileContents(path)),
- "test.BoundedFileAppender\tINFO\tTHREE\n" +
- "test.BoundedFileAppender\tINFO\tFOUR\n");
-
-});
-
-/*
- * Test parameter formatting.
- */
-add_task(function* log_message_with_params() {
- let formatter = new Log.BasicFormatter();
-
- function formatMessage(text, params) {
- let full = formatter.format(new Log.LogMessage("test.logger", Log.Level.Warn, text, params));
- return full.split("\t")[3];
- }
-
- // Strings are substituted directly.
- do_check_eq(formatMessage("String is ${foo}", {foo: "bar"}),
- "String is bar");
-
- // Numbers are substituted.
- do_check_eq(formatMessage("Number is ${number}", {number: 47}),
- "Number is 47")
-
- // The entire params object is JSON-formatted and substituted.
- do_check_eq(formatMessage("Object is ${}", {foo: "bar"}),
- 'Object is {"foo":"bar"}');
-
- // An object nested inside params is JSON-formatted and substituted.
- do_check_eq(formatMessage("Sub object is ${sub}", {sub: {foo: "bar"}}),
- 'Sub object is {"foo":"bar"}');
-
- // The substitution field is missing from params. Leave the placeholder behind
- // to make the mistake obvious.
- do_check_eq(formatMessage("Missing object is ${missing}", {}),
- 'Missing object is ${missing}');
-
- // Make sure we don't treat the parameter name 'false' as a falsey value.
- do_check_eq(formatMessage("False is ${false}", {false: true}),
- 'False is true');
-
- // If an object has a .toJSON method, the formatter uses it.
- let ob = function() {};
- ob.toJSON = function() {return {sneaky: "value"}};
- do_check_eq(formatMessage("JSON is ${sub}", {sub: ob}),
- 'JSON is {"sneaky":"value"}');
-
- // Fall back to .toSource() if JSON.stringify() fails on an object.
- ob = function() {};
- ob.toJSON = function() {throw "oh noes JSON"};
- do_check_eq(formatMessage("Fail is ${sub}", {sub: ob}),
- 'Fail is (function() {})');
-
- // Fall back to .toString if both .toJSON and .toSource fail.
- ob.toSource = function() {throw "oh noes SOURCE"};
- do_check_eq(formatMessage("Fail is ${sub}", {sub: ob}),
- 'Fail is function() {}');
-
- // Fall back to '[object]' if .toJSON, .toSource and .toString fail.
- ob.toString = function() {throw "oh noes STRING"};
- do_check_eq(formatMessage("Fail is ${sub}", {sub: ob}),
- 'Fail is [object]');
-
- // If params are passed but there are no substitution in the text
- // we JSON format and append the entire parameters object.
- do_check_eq(formatMessage("Text with no subs", {a: "b", c: "d"}),
- 'Text with no subs: {"a":"b","c":"d"}');
-
- // If we substitute one parameter but not the other,
- // we ignore any params that aren't substituted.
- do_check_eq(formatMessage("Text with partial sub ${a}", {a: "b", c: "d"}),
- 'Text with partial sub b');
-
- // We don't format internal fields stored in params.
- do_check_eq(formatMessage("Params with _ ${}", {a: "b", _c: "d", _level:20, _message:"froo",
- _time:123456, _namespace:"here.there"}),
- 'Params with _ {"a":"b","_c":"d"}');
-
- // Don't print an empty params holder if all params are internal.
- do_check_eq(formatMessage("All params internal", {_level:20, _message:"froo",
- _time:123456, _namespace:"here.there"}),
- 'All params internal');
-
- // Format params with null and undefined values.
- do_check_eq(formatMessage("Null ${n} undefined ${u}", {n: null, u: undefined}),
- 'Null null undefined undefined');
-
- // Format params with number, bool, and Object/String type.
- do_check_eq(formatMessage("number ${n} boolean ${b} boxed Boolean ${bx} String ${s}",
- {n: 45, b: false, bx: new Boolean(true), s: new String("whatevs")}),
- 'number 45 boolean false boxed Boolean true String whatevs');
-
- /*
- * Check that errors get special formatting if they're formatted directly as
- * a named param or they're the only param, but not if they're a field in a
- * larger structure.
- */
- let err = Components.Exception("test exception", Components.results.NS_ERROR_FAILURE);
- let str = formatMessage("Exception is ${}", err);
- do_check_true(str.includes('Exception is [Exception... "test exception"'));
- do_check_true(str.includes("(NS_ERROR_FAILURE)"));
- str = formatMessage("Exception is", err);
- do_check_true(str.includes('Exception is: [Exception... "test exception"'));
- str = formatMessage("Exception is ${error}", {error: err});
- do_check_true(str.includes('Exception is [Exception... "test exception"'));
- str = formatMessage("Exception is", {_error: err});
- do_print(str);
- // Exceptions buried inside objects are formatted badly.
- do_check_true(str.includes('Exception is: {"_error":{}'));
- // If the message text is null, the message contains only the formatted params object.
- str = formatMessage(null, err);
- do_check_true(str.startsWith('[Exception... "test exception"'));
- // If the text is null and 'params' is a String object, the message is exactly that string.
- str = formatMessage(null, new String("String in place of params"));
- do_check_eq(str, "String in place of params");
-
- // We use object.valueOf() internally; make sure a broken valueOf() method
- // doesn't cause the logger to fail.
- let vOf = {a: 1, valueOf: function() {throw "oh noes valueOf"}};
- do_check_eq(formatMessage("Broken valueOf ${}", vOf),
- 'Broken valueOf ({a:1, valueOf:(function() {throw "oh noes valueOf"})})');
-
- // Test edge cases of bad data to formatter:
- // If 'params' is not an object, format it as a basic type.
- do_check_eq(formatMessage("non-object no subst", 1),
- 'non-object no subst: 1');
- do_check_eq(formatMessage("non-object all subst ${}", 2),
- 'non-object all subst 2');
- do_check_eq(formatMessage("false no subst", false),
- 'false no subst: false');
- do_check_eq(formatMessage("null no subst", null),
- 'null no subst: null');
- // If 'params' is undefined and there are no substitutions expected,
- // the message should still be output.
- do_check_eq(formatMessage("undefined no subst", undefined),
- 'undefined no subst');
- // If 'params' is not an object, no named substitutions can succeed;
- // therefore we leave the placeholder and append the formatted params.
- do_check_eq(formatMessage("non-object named subst ${junk} space", 3),
- 'non-object named subst ${junk} space: 3');
- // If there are no params, we leave behind the placeholders in the text.
- do_check_eq(formatMessage("no params ${missing}", undefined),
- 'no params ${missing}');
- // If params doesn't contain any of the tags requested in the text,
- // we leave them all behind and append the formatted params.
- do_check_eq(formatMessage("object missing tag ${missing} space", {mising: "not here"}),
- 'object missing tag ${missing} space: {"mising":"not here"}');
- // If we are given null text and no params, the resulting formatted message is empty.
- do_check_eq(formatMessage(null), '');
-});
-
-/*
- * If we call a log function with a non-string object in place of the text
- * argument, and no parameters, treat that the same as logging empty text
- * with the object argument as parameters. This makes the log useful when the
- * caller does "catch(err) {logger.error(err)}"
- */
-add_task(function* test_log_err_only() {
- let log = Log.repository.getLogger("error.only");
- let mockFormatter = { format: msg => msg };
- let appender = new MockAppender(mockFormatter);
- log.addAppender(appender);
-
- /*
- * Check that log.error(err) is treated the same as
- * log.error(null, err) by the logMessage constructor; the formatMessage()
- * tests above ensure that the combination of null text and an error object
- * is formatted correctly.
- */
- try {
- eval("javascript syntax error");
- }
- catch (e) {
- log.error(e);
- msg = appender.messages.pop();
- do_check_eq(msg.message, null);
- do_check_eq(msg.params, e);
- }
-});
-
-/*
- * Test logStructured() messages through basic formatter.
- */
-add_task(function* test_structured_basic() {
- let log = Log.repository.getLogger("test.logger");
- let appender = new MockAppender(new Log.BasicFormatter());
-
- log.level = Log.Level.Info;
- appender.level = Log.Level.Info;
- log.addAppender(appender);
-
- // A structured entry with no _message is treated the same as log./level/(null, params)
- // except the 'action' field is added to the object.
- log.logStructured("action", {data: "structure"});
- do_check_eq(appender.messages.length, 1);
- do_check_true(appender.messages[0].includes('{"data":"structure","action":"action"}'));
-
- // A structured entry with _message and substitution is treated the same as
- // log./level/(null, params).
- log.logStructured("action", {_message: "Structured sub ${data}", data: "structure"});
- do_check_eq(appender.messages.length, 2);
- do_print(appender.messages[1]);
- do_check_true(appender.messages[1].includes('Structured sub structure'));
-});
-
-/*
- * Test that all the basic logger methods pass the message and params through to the appender.
- */
-add_task(function* log_message_with_params() {
- let log = Log.repository.getLogger("error.logger");
- let mockFormatter = { format: msg => msg };
- let appender = new MockAppender(mockFormatter);
- log.addAppender(appender);
-
- let testParams = {a:1, b:2};
- log.fatal("Test fatal", testParams);
- log.error("Test error", testParams);
- log.warn("Test warn", testParams);
- log.info("Test info", testParams);
- log.config("Test config", testParams);
- log.debug("Test debug", testParams);
- log.trace("Test trace", testParams);
- do_check_eq(appender.messages.length, 7);
- for (let msg of appender.messages) {
- do_check_true(msg.params === testParams);
- do_check_true(msg.message.startsWith("Test "));
- }
-});
-
-/*
- * Check that we format JS Errors reasonably.
- */
-add_task(function* format_errors() {
- let pFormat = new Log.ParameterFormatter();
-
- // Test that subclasses of Error are recognized as errors.
- err = new ReferenceError("Ref Error", "ERROR_FILE", 28);
- str = pFormat.format(err);
- do_check_true(str.includes("ReferenceError"));
- do_check_true(str.includes("ERROR_FILE:28"));
- do_check_true(str.includes("Ref Error"));
-
- // Test that JS-generated Errors are recognized and formatted.
- try {
- yield Promise.resolve(); // Scrambles the stack
- eval("javascript syntax error");
- }
- catch (e) {
- str = pFormat.format(e);
- do_check_true(str.includes("SyntaxError: missing ;"));
- // Make sure we identified it as an Error and formatted the error location as
- // lineNumber:columnNumber.
- do_check_true(str.includes(":1:11)"));
- // Make sure that we use human-readable stack traces
- // Check that the error doesn't contain any reference to "Promise.jsm" or "Task.jsm"
- do_check_false(str.includes("Promise.jsm"));
- do_check_false(str.includes("Task.jsm"));
- do_check_true(str.includes("format_errors"));
- }
-});
diff --git a/toolkit/modules/tests/xpcshell/test_Log_stackTrace.js b/toolkit/modules/tests/xpcshell/test_Log_stackTrace.js
deleted file mode 100644
index 6e53db058..000000000
--- a/toolkit/modules/tests/xpcshell/test_Log_stackTrace.js
+++ /dev/null
@@ -1,30 +0,0 @@
-print("Define some functions in well defined line positions for the test");
-function foo(v) { return bar(v + 1); } // line 2
-function bar(v) { return baz(v + 1); } // line 3
-function baz(v) { throw new Error(v + 1); } // line 4
-
-print("Make sure lazy constructor calling/assignment works");
-Components.utils.import("resource://gre/modules/Log.jsm");
-
-function run_test() {
- print("Make sure functions, arguments, files are pretty printed in the trace");
- let trace = "";
- try {
- foo(0);
- }
- catch (ex) {
- trace = Log.stackTrace(ex);
- }
- print(`Got trace: ${trace}`);
- do_check_neq(trace, "");
-
- let bazPos = trace.indexOf("baz@test_Log_stackTrace.js:4");
- let barPos = trace.indexOf("bar@test_Log_stackTrace.js:3");
- let fooPos = trace.indexOf("foo@test_Log_stackTrace.js:2");
- print(`String positions: ${bazPos} ${barPos} ${fooPos}`);
-
- print("Make sure the desired messages show up");
- do_check_true(bazPos >= 0);
- do_check_true(barPos > bazPos);
- do_check_true(fooPos > barPos);
-}
diff --git a/toolkit/modules/tests/xpcshell/test_MatchGlobs.js b/toolkit/modules/tests/xpcshell/test_MatchGlobs.js
deleted file mode 100644
index 5dcfd19cb..000000000
--- a/toolkit/modules/tests/xpcshell/test_MatchGlobs.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/MatchPattern.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-function test(url, pattern) {
- let uri = Services.io.newURI(url, null, null);
- let m = new MatchGlobs(pattern);
- return m.matches(uri.spec);
-}
-
-function pass({url, pattern}) {
- ok(test(url, pattern), `Expected match: ${JSON.stringify(pattern)}, ${url}`);
-}
-
-function fail({url, pattern}) {
- ok(!test(url, pattern), `Expected no match: ${JSON.stringify(pattern)}, ${url}`);
-}
-
-function run_test() {
- let moz = "http://mozilla.org";
-
- pass({url: moz, pattern: ["*"]});
- pass({url: moz, pattern: ["http://*"]}),
- pass({url: moz, pattern: ["*mozilla*"]});
- pass({url: moz, pattern: ["*example*", "*mozilla*"]});
-
- pass({url: moz, pattern: ["*://*"]});
- pass({url: "https://mozilla.org", pattern: ["*://*"]});
-
- // Documentation example
- pass({url: "http://www.example.com/foo/bar", pattern: ["http://???.example.com/foo/*"]});
- pass({url: "http://the.example.com/foo/", pattern: ["http://???.example.com/foo/*"]});
- fail({url: "http://my.example.com/foo/bar", pattern: ["http://???.example.com/foo/*"]});
- fail({url: "http://example.com/foo/", pattern: ["http://???.example.com/foo/*"]});
- fail({url: "http://www.example.com/foo", pattern: ["http://???.example.com/foo/*"]});
-
- // Matches path
- let path = moz + "/abc/def";
- pass({url: path, pattern: ["*def"]});
- pass({url: path, pattern: ["*c/d*"]});
- pass({url: path, pattern: ["*org/abc*"]});
- fail({url: path + "/", pattern: ["*def"]});
-
- // Trailing slash
- pass({url: moz, pattern: ["*.org/"]});
- fail({url: moz, pattern: ["*.org"]});
-
- // Wrong TLD
- fail({url: moz, pattern: ["www*.m*.com/"]});
- // Case sensitive
- fail({url: moz, pattern: ["*.ORG/"]});
-
- fail({url: moz, pattern: []});
-}
diff --git a/toolkit/modules/tests/xpcshell/test_MatchPattern.js b/toolkit/modules/tests/xpcshell/test_MatchPattern.js
deleted file mode 100644
index 583038361..000000000
--- a/toolkit/modules/tests/xpcshell/test_MatchPattern.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/MatchPattern.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-function test(url, pattern)
-{
- let uri = Services.io.newURI(url, null, null);
- let m = new MatchPattern(pattern);
- return m.matches(uri);
-}
-
-function pass({url, pattern})
-{
- do_check_true(test(url, pattern), `Expected match: ${JSON.stringify(pattern)}, ${url}`);
-}
-
-function fail({url, pattern})
-{
- do_check_false(test(url, pattern), `Expected no match: ${JSON.stringify(pattern)}, ${url}`);
-}
-
-function run_test()
-{
- // Invalid pattern.
- fail({url: "http://mozilla.org", pattern: ""});
-
- // Pattern must include trailing slash.
- fail({url: "http://mozilla.org", pattern: "http://mozilla.org"});
-
- // Protocol not allowed.
- fail({url: "http://mozilla.org", pattern: "gopher://wuarchive.wustl.edu/"});
-
- pass({url: "http://mozilla.org", pattern: "http://mozilla.org/"});
- pass({url: "http://mozilla.org/", pattern: "http://mozilla.org/"});
-
- pass({url: "http://mozilla.org/", pattern: "*://mozilla.org/"});
- pass({url: "https://mozilla.org/", pattern: "*://mozilla.org/"});
- fail({url: "file://mozilla.org/", pattern: "*://mozilla.org/"});
- fail({url: "ftp://mozilla.org/", pattern: "*://mozilla.org/"});
-
- fail({url: "http://mozilla.com", pattern: "http://*mozilla.com*/"});
- fail({url: "http://mozilla.com", pattern: "http://mozilla.*/"});
- fail({url: "http://mozilla.com", pattern: "http:/mozilla.com/"});
-
- pass({url: "http://google.com", pattern: "http://*.google.com/"});
- pass({url: "http://docs.google.com", pattern: "http://*.google.com/"});
-
- pass({url: "http://mozilla.org:8080", pattern: "http://mozilla.org/"});
- pass({url: "http://mozilla.org:8080", pattern: "*://mozilla.org/"});
- fail({url: "http://mozilla.org:8080", pattern: "http://mozilla.org:8080/"});
-
- // Now try with * in the path.
- pass({url: "http://mozilla.org", pattern: "http://mozilla.org/*"});
- pass({url: "http://mozilla.org/", pattern: "http://mozilla.org/*"});
-
- pass({url: "http://mozilla.org/", pattern: "*://mozilla.org/*"});
- pass({url: "https://mozilla.org/", pattern: "*://mozilla.org/*"});
- fail({url: "file://mozilla.org/", pattern: "*://mozilla.org/*"});
- fail({url: "http://mozilla.com", pattern: "http://mozilla.*/*"});
-
- pass({url: "http://google.com", pattern: "http://*.google.com/*"});
- pass({url: "http://docs.google.com", pattern: "http://*.google.com/*"});
-
- // Check path stuff.
- fail({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/"});
- pass({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/*"});
- pass({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/a*f"});
- pass({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/a*"});
- pass({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/*f"});
- fail({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/*e"});
- fail({url: "http://mozilla.com/abc/def", pattern: "http://mozilla.com/*c"});
-
- fail({url: "http:///a.html", pattern: "http:///a.html"});
- pass({url: "file:///foo", pattern: "file:///foo*"});
- pass({url: "file:///foo/bar.html", pattern: "file:///foo*"});
-
- pass({url: "http://mozilla.org/a", pattern: "<all_urls>"});
- pass({url: "https://mozilla.org/a", pattern: "<all_urls>"});
- pass({url: "ftp://mozilla.org/a", pattern: "<all_urls>"});
- pass({url: "file:///a", pattern: "<all_urls>"});
- fail({url: "gopher://wuarchive.wustl.edu/a", pattern: "<all_urls>"});
-
- // Multiple patterns.
- pass({url: "http://mozilla.org", pattern: ["http://mozilla.org/"]});
- pass({url: "http://mozilla.org", pattern: ["http://mozilla.org/", "http://mozilla.com/"]});
- pass({url: "http://mozilla.com", pattern: ["http://mozilla.org/", "http://mozilla.com/"]});
- fail({url: "http://mozilla.biz", pattern: ["http://mozilla.org/", "http://mozilla.com/"]});
-
- // Match url with fragments.
- pass({url: "http://mozilla.org/base#some-fragment", pattern: "http://mozilla.org/base"});
-}
diff --git a/toolkit/modules/tests/xpcshell/test_MatchURLFilters.js b/toolkit/modules/tests/xpcshell/test_MatchURLFilters.js
deleted file mode 100644
index 52e03a6cc..000000000
--- a/toolkit/modules/tests/xpcshell/test_MatchURLFilters.js
+++ /dev/null
@@ -1,396 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/MatchPattern.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-function createTestFilter({url, filters}) {
- let m = new MatchURLFilters(filters);
- return m.matches(url);
-}
-
-function expectPass({url, filters}) {
- ok(createTestFilter({url, filters}),
- `Expected match: ${JSON.stringify(filters)}, ${url}`);
-}
-
-function expectFail({url, filters}) {
- ok(!createTestFilter({url, filters}),
- `Expected no match: ${JSON.stringify(filters)}, ${url}`);
-}
-
-function expectThrow({url, filters, exceptionMessageContains}) {
- let logData = {filters, url};
-
- Assert.throws(
- () => {
- createTestFilter({url, filters});
- },
- exceptionMessageContains,
- `Check received exception for expected message: ${JSON.stringify(logData)}`
- );
-}
-
-add_task(function* test_match_url_filters() {
- const shouldPass = true;
- const shouldFail = true;
- const shouldThrow = true;
-
- var testCases = [
- // Empty, undefined and null filters.
- {shouldThrow, exceptionMessageContains: "filters array should not be empty",
- filters: [], url: "http://mozilla.org", },
- {shouldThrow, exceptionMessageContains: "filters should be an array",
- filters: undefined, url: "http://mozilla.org"},
- {shouldThrow, exceptionMessageContains: "filters should be an array",
- filters: null, url: "http://mozilla.org"},
-
- // Wrong formats (in a real webextension this will be blocked by the schema validation).
- {shouldThrow, exceptionMessageContains: "filters should be an array", filters: {},
- url: "http://mozilla.org"},
- {shouldThrow, exceptionMessageContains: "filters should be an array",
- filters: {nonExistentCriteria: true}, url: "http://mozilla.org", },
- {shouldPass, filters: [{nonExistentCriteria: true}], url: "http://mozilla.org"},
-
- // Schemes filter over various url schemes.
- {shouldPass, filters: [{schemes: ["http"]}], url: "http://mozilla.org"},
- {shouldPass, filters: [{schemes: ["https"]}], url: "https://mozilla.org"},
- {shouldPass, filters: [{schemes: ["ftp"]}], url: "ftp://fake/ftp/url"},
- {shouldPass, filters: [{schemes: ["about"]}], url: "about:blank"},
- {shouldPass, filters: [{schemes: ["data"]}], url: "data:,testDataURL"},
- {shouldFail, filters: [{schemes: ["http"]}], url: "ftp://fake/ftp/url"},
-
- // Multiple schemes: pass when at least one scheme matches.
- {shouldPass, filters: [{schemes: ["https", "about"]}], url: "https://mozilla.org"},
- {shouldPass, filters: [{schemes: ["about", "https"]}], url: "https://mozilla.org"},
- {shouldFail, filters: [{schemes: ["about", "http"]}], url: "https://mozilla.org"},
-
- // Port filter: standard (implicit) ports.
- {shouldPass, filters: [{ports: [443]}], url: "https://mozilla.org"},
- {shouldPass, filters: [{ports: [80]}], url: "http://mozilla.org"},
- {shouldPass, filters: [{ports: [21]}], url: "ftp://ftp.mozilla.org"},
-
- // Port filter: schemes without a default port.
- {shouldFail, filters: [{ports: [-1]}], url: "about:blank"},
- {shouldFail, filters: [{ports: [-1]}], url: "data:,testDataURL"},
-
- {shouldFail, filters: [{ports: [[1, 65535]]}], url: "about:blank"},
- {shouldFail, filters: [{ports: [[1, 65535]]}], url: "data:,testDataURL"},
-
- // Host filters (hostEquals, hostContains, hostPrefix, hostSuffix): schemes with an host.
- {shouldFail, filters: [{hostEquals: ""}], url: "https://mozilla.org"},
- {shouldPass, filters: [{hostEquals: null}], url: "https://mozilla.org"},
- {shouldPass, filters: [{hostEquals: "mozilla.org"}], url: "https://mozilla.org"},
- {shouldFail, filters: [{hostEquals: "mozilla.com"}], url: "https://mozilla.org"},
- // NOTE: trying at least once another valid protocol.
- {shouldPass, filters: [{hostEquals: "mozilla.org"}], url: "ftp://mozilla.org"},
- {shouldFail, filters: [{hostEquals: "mozilla.com"}], url: "ftp://mozilla.org"},
- {shouldPass, filters: [{hostEquals: "mozilla.org"}], url: "https://mozilla.org:8888"},
-
- {shouldPass, filters: [{hostContains: "moz"}], url: "https://mozilla.org"},
- // NOTE: an implicit '.' char is inserted into the host.
- {shouldPass, filters: [{hostContains: ".moz"}], url: "https://mozilla.org"},
- {shouldFail, filters: [{hostContains: "com"}], url: "https://mozilla.org"},
- {shouldPass, filters: [{hostContains: ""}], url: "https://mozilla.org"},
- {shouldPass, filters: [{hostContains: null}], url: "https://mozilla.org"},
-
- {shouldPass, filters: [{hostPrefix: "moz"}], url: "https://mozilla.org"},
- {shouldFail, filters: [{hostPrefix: "org"}], url: "https://mozilla.org"},
- {shouldPass, filters: [{hostPrefix: ""}], url: "https://mozilla.org"},
- {shouldPass, filters: [{hostPrefix: null}], url: "https://mozilla.org"},
-
- {shouldPass, filters: [{hostSuffix: ".org"}], url: "https://mozilla.org"},
- {shouldFail, filters: [{hostSuffix: "moz"}], url: "https://mozilla.org"},
- {shouldPass, filters: [{hostSuffix: ""}], url: "https://mozilla.org"},
- {shouldPass, filters: [{hostSuffix: null}], url: "https://mozilla.org"},
- {shouldPass, filters: [{hostSuffix: "lla.org"}], url: "https://mozilla.org:8888"},
-
- // hostEquals: urls without an host.
- // TODO: should we explicitly cover hostContains, hostPrefix, hostSuffix for
- // these sub-cases?
- {shouldFail, filters: [{hostEquals: "blank"}], url: "about:blank"},
- {shouldFail, filters: [{hostEquals: "blank"}], url: "about://blank"},
- {shouldFail, filters: [{hostEquals: "testDataURL"}], url: "data:,testDataURL"},
- {shouldPass, filters: [{hostEquals: ""}], url: "about:blank"},
- {shouldPass, filters: [{hostEquals: ""}], url: "about://blank"},
- {shouldPass, filters: [{hostEquals: ""}], url: "data:,testDataURL"},
-
- // Path filters (pathEquals, pathContains, pathPrefix, pathSuffix).
- {shouldFail, filters: [{pathEquals: ""}], url: "https://mozilla.org/test/path"},
- {shouldPass, filters: [{pathEquals: null}], url: "https://mozilla.org/test/path"},
- {shouldPass, filters: [{pathEquals: "/test/path"}], url: "https://mozilla.org/test/path"},
- {shouldFail, filters: [{pathEquals: "/wrong/path"}], url: "https://mozilla.org/test/path"},
- {shouldPass, filters: [{pathEquals: "/test/path"}], url: "https://mozilla.org:8888/test/path"},
- // NOTE: trying at least once another valid protocol
- {shouldPass, filters: [{pathEquals: "/test/path"}], url: "ftp://mozilla.org/test/path"},
- {shouldFail, filters: [{pathEquals: "/wrong/path"}], url: "ftp://mozilla.org/test/path"},
-
- {shouldPass, filters: [{pathContains: "st/"}], url: "https://mozilla.org/test/path"},
- {shouldPass, filters: [{pathContains: "/test"}], url: "https://mozilla.org/test/path"},
- {shouldFail, filters: [{pathContains: "org"}], url: "https://mozilla.org/test/path"},
- {shouldPass, filters: [{pathContains: ""}], url: "https://mozilla.org/test/path"},
- {shouldPass, filters: [{pathContains: null}], url: "https://mozilla.org/test/path"},
- {shouldFail, filters: [{pathContains: "param"}], url: "https://mozilla.org:8888/test/path?param=1"},
- {shouldFail, filters: [{pathContains: "ref"}], url: "https://mozilla.org:8888/test/path#ref"},
- {shouldPass, filters: [{pathContains: "st/pa"}], url: "https://mozilla.org:8888/test/path"},
-
- {shouldPass, filters: [{pathPrefix: "/te"}], url: "https://mozilla.org/test/path"},
- {shouldFail, filters: [{pathPrefix: "org/"}], url: "https://mozilla.org/test/path"},
- {shouldPass, filters: [{pathPrefix: ""}], url: "https://mozilla.org/test/path"},
- {shouldPass, filters: [{pathPrefix: null}], url: "https://mozilla.org/test/path"},
-
- {shouldPass, filters: [{pathSuffix: "/path"}], url: "https://mozilla.org/test/path"},
- {shouldFail, filters: [{pathSuffix: "th/"}], url: "https://mozilla.org/test/path"},
- {shouldPass, filters: [{pathSuffix: ""}], url: "https://mozilla.org/test/path"},
- {shouldPass, filters: [{pathSuffix: null}], url: "https://mozilla.org/test/path"},
- {shouldFail, filters: [{pathSuffix: "p=1"}], url: "https://mozilla.org:8888/test/path?p=1"},
- {shouldFail, filters: [{pathSuffix: "ref"}], url: "https://mozilla.org:8888/test/path#ref"},
-
- // Query filters (queryEquals, queryContains, queryPrefix, querySuffix).
- {shouldFail, filters: [{queryEquals: ""}], url: "https://mozilla.org/?param=val"},
- {shouldPass, filters: [{queryEquals: null}], url: "https://mozilla.org/?param=val"},
- {shouldPass, filters: [{queryEquals: "param=val"}], url: "https://mozilla.org/?param=val"},
- {shouldFail, filters: [{queryEquals: "?param=val"}], url: "https://mozilla.org/?param=val"},
- {shouldFail, filters: [{queryEquals: "/path?param=val"}], url: "https://mozilla.org/path?param=val"},
-
- // NOTE: about scheme urls cannot be matched by query.
- {shouldFail, filters: [{queryEquals: "param=val"}], url: "about:blank?param=val"},
- {shouldFail, filters: [{queryEquals: "param"}], url: "ftp://mozilla.org?param=val"},
-
- {shouldPass, filters: [{queryContains: "ram"}], url: "https://mozilla.org/?param=val"},
- {shouldPass, filters: [{queryContains: "=val"}], url: "https://mozilla.org/?param=val"},
- {shouldFail, filters: [{queryContains: "?param"}], url: "https://mozilla.org/?param=val"},
- {shouldFail, filters: [{queryContains: "path"}], url: "https://mozilla.org/path/?p=v#ref"},
- {shouldPass, filters: [{queryContains: ""}], url: "https://mozilla.org/?param=val"},
- {shouldPass, filters: [{queryContains: null}], url: "https://mozilla.org/?param=val"},
-
- {shouldPass, filters: [{queryPrefix: "param"}], url: "https://mozilla.org/?param=val"},
- {shouldFail, filters: [{queryPrefix: "p="}], url: "https://mozilla.org/?param=val"},
- {shouldFail, filters: [{queryPrefix: "path"}], url: "https://mozilla.org/path?param=val"},
- {shouldPass, filters: [{queryPrefix: ""}], url: "https://mozilla.org/?param=val"},
- {shouldPass, filters: [{queryPrefix: null}], url: "https://mozilla.org/?param=val"},
-
- {shouldPass, filters: [{querySuffix: "=val"}], url: "https://mozilla.org/?param=val"},
- {shouldFail, filters: [{querySuffix: "=wrong"}], url: "https://mozilla.org/?param=val"},
- {shouldPass, filters: [{querySuffix: ""}], url: "https://mozilla.org/?param=val"},
- {shouldPass, filters: [{querySuffix: null}], url: "https://mozilla.org/?param=val"},
-
- // URL filters (urlEquals, urlContains, urlPrefix, urlSuffix).
- {shouldFail, filters: [{urlEquals: ""}], url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{urlEquals: null}], url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{urlEquals: "https://mozilla.org/?p=v#ref"}],
- url: "https://mozilla.org/?p=v#ref"},
- {shouldFail, filters: [{urlEquals: "https://mozilla.org/?p=v#ref2"}],
- url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{urlEquals: "about:blank?p=v#ref"}], url: "about:blank?p=v#ref"},
- {shouldPass, filters: [{urlEquals: "ftp://mozilla.org?p=v#ref"}],
- url: "ftp://mozilla.org?p=v#ref"},
-
- {shouldPass, filters: [{urlContains: "org/?p"}], url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{urlContains: "=v#ref"}], url: "https://mozilla.org/?p=v#ref"},
- {shouldFail, filters: [{urlContains: "ftp"}], url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{urlContains: ""}], url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{urlContains: null}], url: "https://mozilla.org/?p=v#ref"},
-
- {shouldPass, filters: [{urlPrefix: "http"}], url: "https://mozilla.org/?p=v#ref"},
- {shouldFail, filters: [{urlPrefix: "moz"}], url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{urlPrefix: ""}], url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{urlPrefix: null}], url: "https://mozilla.org/?p=v#ref"},
-
- {shouldPass, filters: [{urlSuffix: "#ref"}], url: "https://mozilla.org/?p=v#ref"},
- {shouldFail, filters: [{urlSuffix: "=wrong"}], url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{urlSuffix: ""}], url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{urlSuffix: null}], url: "https://mozilla.org/?p=v#ref"},
-
- // More url filters: urlMatches.
- {shouldPass, filters: [{urlMatches: ".*://mozilla"}], url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{urlMatches: ".*://mozilla"}], url: "ftp://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{urlMatches: ".*://.*/\?p"}], url: "ftp://mozilla.org/?p=v#ref"},
- // NOTE: urlMatches should not match the url without the ref.
- {shouldFail, filters: [{urlMatches: "v#ref$"}], url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{urlMatches: "^ftp"}], url: "ftp://mozilla.org/?p=v#ref"},
-
- // More url filters: originAndPathMatches.
- {shouldPass, filters: [{originAndPathMatches: ".*://mozilla"}],
- url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{originAndPathMatches: ".*://mozilla"}],
- url: "ftp://mozilla.org/?p=v#ref"},
- // NOTE: urlMatches should not match the url without the query and the ref.
- {shouldFail, filters: [{originAndPathMatches: ".*://.*/\?p"}],
- url: "ftp://mozilla.org/?p=v#ref"},
- {shouldFail, filters: [{originAndPathMatches: "v#ref$"}],
- url: "https://mozilla.org/?p=v#ref"},
- {shouldPass, filters: [{originAndPathMatches: "^ftp"}],
- url: "ftp://mozilla.org/?p=v#ref"},
-
- // Filter with all criteria: all matches, none matches, some matches.
-
- // All matches.
- {shouldPass, filters: [
- {
- schemes: ["https", "http"],
- ports: [443, 80],
- hostEquals: "www.mozilla.org",
- hostContains: ".moz",
- hostPrefix: "www",
- hostSuffix: "org",
- pathEquals: "/sub/path",
- pathContains: "b/p",
- pathPrefix: "/sub",
- pathSuffix: "/path",
- queryEquals: "p=v",
- queryContains: "1=",
- queryPrefix: "p1",
- querySuffix: "=v",
- urlEquals: "https://www.mozilla.org/sub/path?p1=v#ref",
- urlContains: "org/sub",
- urlPrefix: "https://moz",
- urlSuffix: "#ref",
- urlMatches: "v#ref$",
- originAndPathMatches: ".*://moz.*/"
- },
- ], url: "https://www.mozilla.org/sub/path?p1=v#ref"},
- // None matches.
- {shouldFail, filters: [
- {
- schemes: ["http"],
- ports: [80],
- hostEquals: "mozilla.com",
- hostContains: "www.moz",
- hostPrefix: "www",
- hostSuffix: "com",
- pathEquals: "/wrong/path",
- pathContains: "g/p",
- pathPrefix: "/wrong",
- pathSuffix: "/wrong",
- queryEquals: "p2=v",
- queryContains: "2=",
- queryPrefix: "p2",
- querySuffix: "=value",
- urlEquals: "http://mozilla.com/sub/path?p1=v#ref",
- urlContains: "com/sub",
- urlPrefix: "http://moz",
- urlSuffix: "#ref2",
- urlMatches: "value#ref2$",
- originAndPathMatches: ".*://moz.*com/"
- },
- ], url: "https://mozilla.org/sub/path?p1=v#ref"},
- // Some matches
- {shouldFail, filters: [
- {
- schemes: ["https"],
- ports: [80],
- hostEquals: "mozilla.com",
- hostContains: "www.moz",
- hostPrefix: "www",
- hostSuffix: "com",
- pathEquals: "/wrong/path",
- pathContains: "g/p",
- pathPrefix: "/wrong",
- pathSuffix: "/wrong",
- queryEquals: "p2=v",
- queryContains: "2=",
- queryPrefix: "p2",
- querySuffix: "=value",
- urlEquals: "http://mozilla.com/sub/path?p1=v#ref",
- urlContains: "com/sub",
- urlPrefix: "http://moz",
- urlSuffix: "#ref2",
- urlMatches: "value#ref2$",
- originAndPathMatches: ".*://moz.*com/"
- },
- ], url: "https://mozilla.org/sub/path?p1=v#ref"},
-
- // Filter with multiple filters: all matches, some matches, none matches.
-
- // All matches.
- {shouldPass, filters: [
- {schemes: ["https", "http"]},
- {ports: [443, 80]},
- {hostEquals: "www.mozilla.org"},
- {hostContains: ".moz"},
- {hostPrefix: "www"},
- {hostSuffix: "org"},
- {pathEquals: "/sub/path"},
- {pathContains: "b/p"},
- {pathPrefix: "/sub"},
- {pathSuffix: "/path"},
- {queryEquals: "p=v"},
- {queryContains: "1="},
- {queryPrefix: "p1"},
- {querySuffix: "=v"},
- {urlEquals: "https://www.mozilla.org/sub/path?p1=v#ref"},
- {urlContains: "org/sub"},
- {urlPrefix: "https://moz"},
- {urlSuffix: "#ref"},
- {urlMatches: "v#ref$"},
- {originAndPathMatches: ".*://moz.*/"},
- ], url: "https://www.mozilla.org/sub/path?p1=v#ref"},
-
- // None matches.
- {shouldFail, filters: [
- {schemes: ["http"]},
- {ports: [80]},
- {hostEquals: "mozilla.com"},
- {hostContains: "www.moz"},
- {hostPrefix: "www"},
- {hostSuffix: "com"},
- {pathEquals: "/wrong/path"},
- {pathContains: "g/p"},
- {pathPrefix: "/wrong"},
- {pathSuffix: "/wrong"},
- {queryEquals: "p2=v"},
- {queryContains: "2="},
- {queryPrefix: "p2"},
- {querySuffix: "=value"},
- {urlEquals: "http://mozilla.com/sub/path?p1=v#ref"},
- {urlContains: "com/sub"},
- {urlPrefix: "http://moz"},
- {urlSuffix: "#ref2"},
- {urlMatches: "value#ref2$"},
- {originAndPathMatches: ".*://moz.*com/"},
- ], url: "https://mozilla.org/sub/path?p1=v#ref"},
-
- // Some matches.
- {shouldPass, filters: [
- {schemes: ["https"]},
- {ports: [80]},
- {hostEquals: "mozilla.com"},
- {hostContains: "www.moz"},
- {hostPrefix: "www"},
- {hostSuffix: "com"},
- {pathEquals: "/wrong/path"},
- {pathContains: "g/p"},
- {pathPrefix: "/wrong"},
- {pathSuffix: "/wrong"},
- {queryEquals: "p2=v"},
- {queryContains: "2="},
- {queryPrefix: "p2"},
- {querySuffix: "=value"},
- {urlEquals: "http://mozilla.com/sub/path?p1=v#ref"},
- {urlContains: "com/sub"},
- {urlPrefix: "http://moz"},
- {urlSuffix: "#ref2"},
- {urlMatches: "value#ref2$"},
- {originAndPathMatches: ".*://moz.*com/"},
- ], url: "https://mozilla.org/sub/path?p1=v#ref"},
- ];
-
- // Run all the the testCases defined above.
- for (let currentTest of testCases) {
- let {
- exceptionMessageContains,
- url, filters,
- } = currentTest;
-
- if (currentTest.shouldThrow) {
- expectThrow({url, filters, exceptionMessageContains})
- } else if (currentTest.shouldFail) {
- expectFail({url, filters});
- } else {
- expectPass({url, filters});
- }
- }
-});
diff --git a/toolkit/modules/tests/xpcshell/test_NewTabUtils.js b/toolkit/modules/tests/xpcshell/test_NewTabUtils.js
deleted file mode 100644
index 8cdb63550..000000000
--- a/toolkit/modules/tests/xpcshell/test_NewTabUtils.js
+++ /dev/null
@@ -1,378 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-// See also browser/base/content/test/newtab/.
-
-var { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components;
-Cu.import("resource://gre/modules/NewTabUtils.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-const PREF_NEWTAB_ENHANCED = "browser.newtabpage.enhanced";
-
-function run_test() {
- Services.prefs.setBoolPref(PREF_NEWTAB_ENHANCED, true);
- run_next_test();
-}
-
-add_task(function* validCacheMidPopulation() {
- let expectedLinks = makeLinks(0, 3, 1);
-
- let provider = new TestProvider(done => done(expectedLinks));
- provider.maxNumLinks = expectedLinks.length;
-
- NewTabUtils.initWithoutProviders();
- NewTabUtils.links.addProvider(provider);
- let promise = new Promise(resolve => NewTabUtils.links.populateCache(resolve));
-
- // isTopSiteGivenProvider() and getProviderLinks() should still return results
- // even when cache is empty or being populated.
- do_check_false(NewTabUtils.isTopSiteGivenProvider("example1.com", provider));
- do_check_links(NewTabUtils.getProviderLinks(provider), []);
-
- yield promise;
-
- // Once the cache is populated, we get the expected results
- do_check_true(NewTabUtils.isTopSiteGivenProvider("example1.com", provider));
- do_check_links(NewTabUtils.getProviderLinks(provider), expectedLinks);
- NewTabUtils.links.removeProvider(provider);
-});
-
-add_task(function* notifyLinkDelete() {
- let expectedLinks = makeLinks(0, 3, 1);
-
- let provider = new TestProvider(done => done(expectedLinks));
- provider.maxNumLinks = expectedLinks.length;
-
- NewTabUtils.initWithoutProviders();
- NewTabUtils.links.addProvider(provider);
- yield new Promise(resolve => NewTabUtils.links.populateCache(resolve));
-
- do_check_links(NewTabUtils.links.getLinks(), expectedLinks);
-
- // Remove a link.
- let removedLink = expectedLinks[2];
- provider.notifyLinkChanged(removedLink, 2, true);
- let links = NewTabUtils.links._providers.get(provider);
-
- // Check that sortedLinks is correctly updated.
- do_check_links(NewTabUtils.links.getLinks(), expectedLinks.slice(0, 2));
-
- // Check that linkMap is accurately updated.
- do_check_eq(links.linkMap.size, 2);
- do_check_true(links.linkMap.get(expectedLinks[0].url));
- do_check_true(links.linkMap.get(expectedLinks[1].url));
- do_check_false(links.linkMap.get(removedLink.url));
-
- // Check that siteMap is correctly updated.
- do_check_eq(links.siteMap.size, 2);
- do_check_true(links.siteMap.has(NewTabUtils.extractSite(expectedLinks[0].url)));
- do_check_true(links.siteMap.has(NewTabUtils.extractSite(expectedLinks[1].url)));
- do_check_false(links.siteMap.has(NewTabUtils.extractSite(removedLink.url)));
-
- NewTabUtils.links.removeProvider(provider);
-});
-
-add_task(function* populatePromise() {
- let count = 0;
- let expectedLinks = makeLinks(0, 10, 2);
-
- let getLinksFcn = Task.async(function* (callback) {
- // Should not be calling getLinksFcn twice
- count++;
- do_check_eq(count, 1);
- yield Promise.resolve();
- callback(expectedLinks);
- });
-
- let provider = new TestProvider(getLinksFcn);
-
- NewTabUtils.initWithoutProviders();
- NewTabUtils.links.addProvider(provider);
-
- NewTabUtils.links.populateProviderCache(provider, () => {});
- NewTabUtils.links.populateProviderCache(provider, () => {
- do_check_links(NewTabUtils.links.getLinks(), expectedLinks);
- NewTabUtils.links.removeProvider(provider);
- });
-});
-
-add_task(function* isTopSiteGivenProvider() {
- let expectedLinks = makeLinks(0, 10, 2);
-
- // The lowest 2 frecencies have the same base domain.
- expectedLinks[expectedLinks.length - 2].url = expectedLinks[expectedLinks.length - 1].url + "Test";
-
- let provider = new TestProvider(done => done(expectedLinks));
- provider.maxNumLinks = expectedLinks.length;
-
- NewTabUtils.initWithoutProviders();
- NewTabUtils.links.addProvider(provider);
- yield new Promise(resolve => NewTabUtils.links.populateCache(resolve));
-
- do_check_eq(NewTabUtils.isTopSiteGivenProvider("example2.com", provider), true);
- do_check_eq(NewTabUtils.isTopSiteGivenProvider("example1.com", provider), false);
-
- // Push out frecency 2 because the maxNumLinks is reached when adding frecency 3
- let newLink = makeLink(3);
- provider.notifyLinkChanged(newLink);
-
- // There is still a frecent url with example2 domain, so it's still frecent.
- do_check_eq(NewTabUtils.isTopSiteGivenProvider("example3.com", provider), true);
- do_check_eq(NewTabUtils.isTopSiteGivenProvider("example2.com", provider), true);
-
- // Push out frecency 3
- newLink = makeLink(5);
- provider.notifyLinkChanged(newLink);
-
- // Push out frecency 4
- newLink = makeLink(9);
- provider.notifyLinkChanged(newLink);
-
- // Our count reached 0 for the example2.com domain so it's no longer a frecent site.
- do_check_eq(NewTabUtils.isTopSiteGivenProvider("example5.com", provider), true);
- do_check_eq(NewTabUtils.isTopSiteGivenProvider("example2.com", provider), false);
-
- NewTabUtils.links.removeProvider(provider);
-});
-
-add_task(function* multipleProviders() {
- // Make each provider generate NewTabUtils.links.maxNumLinks links to check
- // that no more than maxNumLinks are actually returned in the merged list.
- let evenLinks = makeLinks(0, 2 * NewTabUtils.links.maxNumLinks, 2);
- let evenProvider = new TestProvider(done => done(evenLinks));
- let oddLinks = makeLinks(0, 2 * NewTabUtils.links.maxNumLinks - 1, 2);
- let oddProvider = new TestProvider(done => done(oddLinks));
-
- NewTabUtils.initWithoutProviders();
- NewTabUtils.links.addProvider(evenProvider);
- NewTabUtils.links.addProvider(oddProvider);
-
- yield new Promise(resolve => NewTabUtils.links.populateCache(resolve));
-
- let links = NewTabUtils.links.getLinks();
- let expectedLinks = makeLinks(NewTabUtils.links.maxNumLinks,
- 2 * NewTabUtils.links.maxNumLinks,
- 1);
- do_check_eq(links.length, NewTabUtils.links.maxNumLinks);
- do_check_links(links, expectedLinks);
-
- NewTabUtils.links.removeProvider(evenProvider);
- NewTabUtils.links.removeProvider(oddProvider);
-});
-
-add_task(function* changeLinks() {
- let expectedLinks = makeLinks(0, 20, 2);
- let provider = new TestProvider(done => done(expectedLinks));
-
- NewTabUtils.initWithoutProviders();
- NewTabUtils.links.addProvider(provider);
-
- yield new Promise(resolve => NewTabUtils.links.populateCache(resolve));
-
- do_check_links(NewTabUtils.links.getLinks(), expectedLinks);
-
- // Notify of a new link.
- let newLink = makeLink(19);
- expectedLinks.splice(1, 0, newLink);
- provider.notifyLinkChanged(newLink);
- do_check_links(NewTabUtils.links.getLinks(), expectedLinks);
-
- // Notify of a link that's changed sort criteria.
- newLink.frecency = 17;
- expectedLinks.splice(1, 1);
- expectedLinks.splice(2, 0, newLink);
- provider.notifyLinkChanged({
- url: newLink.url,
- frecency: 17,
- });
- do_check_links(NewTabUtils.links.getLinks(), expectedLinks);
-
- // Notify of a link that's changed title.
- newLink.title = "My frecency is now 17";
- provider.notifyLinkChanged({
- url: newLink.url,
- title: newLink.title,
- });
- do_check_links(NewTabUtils.links.getLinks(), expectedLinks);
-
- // Notify of a new link again, but this time make it overflow maxNumLinks.
- provider.maxNumLinks = expectedLinks.length;
- newLink = makeLink(21);
- expectedLinks.unshift(newLink);
- expectedLinks.pop();
- do_check_eq(expectedLinks.length, provider.maxNumLinks); // Sanity check.
- provider.notifyLinkChanged(newLink);
- do_check_links(NewTabUtils.links.getLinks(), expectedLinks);
-
- // Notify of many links changed.
- expectedLinks = makeLinks(0, 3, 1);
- provider.notifyManyLinksChanged();
-
- // Since _populateProviderCache() is async, we must wait until the provider's
- // populate promise has been resolved.
- yield NewTabUtils.links._providers.get(provider).populatePromise;
-
- // NewTabUtils.links will now repopulate its cache
- do_check_links(NewTabUtils.links.getLinks(), expectedLinks);
-
- NewTabUtils.links.removeProvider(provider);
-});
-
-add_task(function* oneProviderAlreadyCached() {
- let links1 = makeLinks(0, 10, 1);
- let provider1 = new TestProvider(done => done(links1));
-
- NewTabUtils.initWithoutProviders();
- NewTabUtils.links.addProvider(provider1);
-
- yield new Promise(resolve => NewTabUtils.links.populateCache(resolve));
- do_check_links(NewTabUtils.links.getLinks(), links1);
-
- let links2 = makeLinks(10, 20, 1);
- let provider2 = new TestProvider(done => done(links2));
- NewTabUtils.links.addProvider(provider2);
-
- yield new Promise(resolve => NewTabUtils.links.populateCache(resolve));
- do_check_links(NewTabUtils.links.getLinks(), links2.concat(links1));
-
- NewTabUtils.links.removeProvider(provider1);
- NewTabUtils.links.removeProvider(provider2);
-});
-
-add_task(function* newLowRankedLink() {
- // Init a provider with 10 links and make its maximum number also 10.
- let links = makeLinks(0, 10, 1);
- let provider = new TestProvider(done => done(links));
- provider.maxNumLinks = links.length;
-
- NewTabUtils.initWithoutProviders();
- NewTabUtils.links.addProvider(provider);
-
- yield new Promise(resolve => NewTabUtils.links.populateCache(resolve));
- do_check_links(NewTabUtils.links.getLinks(), links);
-
- // Notify of a new link that's low-ranked enough not to make the list.
- let newLink = makeLink(0);
- provider.notifyLinkChanged(newLink);
- do_check_links(NewTabUtils.links.getLinks(), links);
-
- // Notify about the new link's title change.
- provider.notifyLinkChanged({
- url: newLink.url,
- title: "a new title",
- });
- do_check_links(NewTabUtils.links.getLinks(), links);
-
- NewTabUtils.links.removeProvider(provider);
-});
-
-add_task(function* extractSite() {
- // All these should extract to the same site
- [ "mozilla.org",
- "m.mozilla.org",
- "mobile.mozilla.org",
- "www.mozilla.org",
- "www3.mozilla.org",
- ].forEach(host => {
- let url = "http://" + host;
- do_check_eq(NewTabUtils.extractSite(url), "mozilla.org", "extracted same " + host);
- });
-
- // All these should extract to the same subdomain
- [ "bugzilla.mozilla.org",
- "www.bugzilla.mozilla.org",
- ].forEach(host => {
- let url = "http://" + host;
- do_check_eq(NewTabUtils.extractSite(url), "bugzilla.mozilla.org", "extracted eTLD+2 " + host);
- });
-
- // All these should not extract to the same site
- [ "bugzilla.mozilla.org",
- "bug123.bugzilla.mozilla.org",
- "too.many.levels.bugzilla.mozilla.org",
- "m2.mozilla.org",
- "mobile30.mozilla.org",
- "ww.mozilla.org",
- "ww2.mozilla.org",
- "wwwww.mozilla.org",
- "wwwww50.mozilla.org",
- "wwws.mozilla.org",
- "secure.mozilla.org",
- "secure10.mozilla.org",
- "many.levels.deep.mozilla.org",
- "just.check.in",
- "192.168.0.1",
- "localhost",
- ].forEach(host => {
- let url = "http://" + host;
- do_check_neq(NewTabUtils.extractSite(url), "mozilla.org", "extracted diff " + host);
- });
-
- // All these should not extract to the same site
- [ "about:blank",
- "file:///Users/user/file",
- "chrome://browser/something",
- "ftp://ftp.mozilla.org/",
- ].forEach(url => {
- do_check_neq(NewTabUtils.extractSite(url), "mozilla.org", "extracted diff url " + url);
- });
-});
-
-function TestProvider(getLinksFn) {
- this.getLinks = getLinksFn;
- this._observers = new Set();
-}
-
-TestProvider.prototype = {
- addObserver: function (observer) {
- this._observers.add(observer);
- },
- notifyLinkChanged: function (link, index=-1, deleted=false) {
- this._notifyObservers("onLinkChanged", link, index, deleted);
- },
- notifyManyLinksChanged: function () {
- this._notifyObservers("onManyLinksChanged");
- },
- _notifyObservers: function () {
- let observerMethodName = arguments[0];
- let args = Array.prototype.slice.call(arguments, 1);
- args.unshift(this);
- for (let obs of this._observers) {
- if (obs[observerMethodName])
- obs[observerMethodName].apply(NewTabUtils.links, args);
- }
- },
-};
-
-function do_check_links(actualLinks, expectedLinks) {
- do_check_true(Array.isArray(actualLinks));
- do_check_eq(actualLinks.length, expectedLinks.length);
- for (let i = 0; i < expectedLinks.length; i++) {
- let expected = expectedLinks[i];
- let actual = actualLinks[i];
- do_check_eq(actual.url, expected.url);
- do_check_eq(actual.title, expected.title);
- do_check_eq(actual.frecency, expected.frecency);
- do_check_eq(actual.lastVisitDate, expected.lastVisitDate);
- }
-}
-
-function makeLinks(frecRangeStart, frecRangeEnd, step) {
- let links = [];
- // Remember, links are ordered by frecency descending.
- for (let i = frecRangeEnd; i > frecRangeStart; i -= step) {
- links.push(makeLink(i));
- }
- return links;
-}
-
-function makeLink(frecency) {
- return {
- url: "http://example" + frecency + ".com/",
- title: "My frecency is " + frecency,
- frecency: frecency,
- lastVisitDate: 0,
- };
-}
diff --git a/toolkit/modules/tests/xpcshell/test_ObjectUtils.js b/toolkit/modules/tests/xpcshell/test_ObjectUtils.js
deleted file mode 100644
index 9aef3e907..000000000
--- a/toolkit/modules/tests/xpcshell/test_ObjectUtils.js
+++ /dev/null
@@ -1,96 +0,0 @@
-Components.utils.import("resource://gre/modules/ObjectUtils.jsm");
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_deepEqual() {
- let deepEqual = ObjectUtils.deepEqual.bind(ObjectUtils);
- // CommonJS 7.2
- Assert.ok(deepEqual(new Date(2000, 3, 14), new Date(2000, 3, 14)), "deepEqual date");
- Assert.ok(deepEqual(new Date(NaN), new Date(NaN)), "deepEqual invalid dates");
-
- Assert.ok(!deepEqual(new Date(), new Date(2000, 3, 14)), "deepEqual date");
-
- // 7.3
- Assert.ok(deepEqual(/a/, /a/));
- Assert.ok(deepEqual(/a/g, /a/g));
- Assert.ok(deepEqual(/a/i, /a/i));
- Assert.ok(deepEqual(/a/m, /a/m));
- Assert.ok(deepEqual(/a/igm, /a/igm));
- Assert.ok(!deepEqual(/ab/, /a/));
- Assert.ok(!deepEqual(/a/g, /a/));
- Assert.ok(!deepEqual(/a/i, /a/));
- Assert.ok(!deepEqual(/a/m, /a/));
- Assert.ok(!deepEqual(/a/igm, /a/im));
-
- let re1 = /a/;
- re1.lastIndex = 3;
- Assert.ok(!deepEqual(re1, /a/));
-
- // 7.4
- Assert.ok(deepEqual(4, "4"), "deepEqual == check");
- Assert.ok(deepEqual(true, 1), "deepEqual == check");
- Assert.ok(!deepEqual(4, "5"), "deepEqual == check");
-
- // 7.5
- // having the same number of owned properties && the same set of keys
- Assert.ok(deepEqual({a: 4}, {a: 4}));
- Assert.ok(deepEqual({a: 4, b: "2"}, {a: 4, b: "2"}));
- Assert.ok(deepEqual([4], ["4"]));
- Assert.ok(!deepEqual({a: 4}, {a: 4, b: true}));
- Assert.ok(deepEqual(["a"], {0: "a"}));
-
- let a1 = [1, 2, 3];
- let a2 = [1, 2, 3];
- a1.a = "test";
- a1.b = true;
- a2.b = true;
- a2.a = "test";
- Assert.ok(!deepEqual(Object.keys(a1), Object.keys(a2)));
- Assert.ok(deepEqual(a1, a2));
-
- let nbRoot = {
- toString: function() { return this.first + " " + this.last; }
- };
-
- function nameBuilder(first, last) {
- this.first = first;
- this.last = last;
- return this;
- }
- nameBuilder.prototype = nbRoot;
-
- function nameBuilder2(first, last) {
- this.first = first;
- this.last = last;
- return this;
- }
- nameBuilder2.prototype = nbRoot;
-
- let nb1 = new nameBuilder("Ryan", "Dahl");
- let nb2 = new nameBuilder2("Ryan", "Dahl");
-
- Assert.ok(deepEqual(nb1, nb2));
-
- nameBuilder2.prototype = Object;
- nb2 = new nameBuilder2("Ryan", "Dahl");
- Assert.ok(!deepEqual(nb1, nb2));
-
- // String literal + object
- Assert.ok(!deepEqual("a", {}));
-
- // Make sure deepEqual doesn't loop forever on circular refs
-
- let b = {};
- b.b = b;
-
- let c = {};
- c.b = c;
-
- try {
- Assert.ok(!deepEqual(b, c));
- } catch (e) {
- Assert.ok(true, "Didn't recurse infinitely.");
- }
-});
diff --git a/toolkit/modules/tests/xpcshell/test_ObjectUtils_strict.js b/toolkit/modules/tests/xpcshell/test_ObjectUtils_strict.js
deleted file mode 100644
index 44572e600..000000000
--- a/toolkit/modules/tests/xpcshell/test_ObjectUtils_strict.js
+++ /dev/null
@@ -1,29 +0,0 @@
-"use strict";
-
-var {ObjectUtils} = Components.utils.import("resource://gre/modules/ObjectUtils.jsm", {});
-var {PromiseTestUtils} = Components.utils.import("resource://testing-common/PromiseTestUtils.jsm", {});
-
-add_task(function* test_strict() {
- let loose = { a: 1 };
- let strict = ObjectUtils.strict(loose);
-
- loose.a; // Should not throw.
- loose.b || undefined; // Should not throw.
-
- strict.a; // Should not throw.
- PromiseTestUtils.expectUncaughtRejection(/No such property: "b"/);
- Assert.throws(() => strict.b, /No such property: "b"/);
- "b" in strict; // Should not throw.
- strict.b = 2;
- strict.b; // Should not throw.
-
- PromiseTestUtils.expectUncaughtRejection(/No such property: "c"/);
- Assert.throws(() => strict.c, /No such property: "c"/);
- "c" in strict; // Should not throw.
- loose.c = 3;
- strict.c; // Should not throw.
-});
-
-function run_test() {
- run_next_test();
-}
diff --git a/toolkit/modules/tests/xpcshell/test_PermissionsUtils.js b/toolkit/modules/tests/xpcshell/test_PermissionsUtils.js
deleted file mode 100644
index 3982ce015..000000000
--- a/toolkit/modules/tests/xpcshell/test_PermissionsUtils.js
+++ /dev/null
@@ -1,85 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-// Tests that PerrmissionsUtils.jsm works as expected, including:
-// * PermissionsUtils.importfromPrefs()
-// <ROOT>.[whitelist|blacklist].add preferences are emptied when
-// converted into permissions on startup.
-
-
-const PREF_ROOT = "testpermissions.";
-const TEST_PERM = "test-permission";
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/PermissionsUtils.jsm");
-
-function run_test() {
- test_importfromPrefs();
-}
-
-
-function test_importfromPrefs() {
- // Create own preferences to test
- Services.prefs.setCharPref(PREF_ROOT + "whitelist.add.EMPTY", "");
- Services.prefs.setCharPref(PREF_ROOT + "whitelist.add.EMPTY2", ",");
- Services.prefs.setCharPref(PREF_ROOT + "whitelist.add.TEST", "http://whitelist.example.com");
- Services.prefs.setCharPref(PREF_ROOT + "whitelist.add.TEST2", "https://whitelist2-1.example.com,http://whitelist2-2.example.com:8080,about:home");
- Services.prefs.setCharPref(PREF_ROOT + "whitelist.add.TEST3", "whitelist3-1.example.com,about:config"); // legacy style - host only
- Services.prefs.setCharPref(PREF_ROOT + "blacklist.add.EMPTY", "");
- Services.prefs.setCharPref(PREF_ROOT + "blacklist.add.TEST", "http://blacklist.example.com,");
- Services.prefs.setCharPref(PREF_ROOT + "blacklist.add.TEST2", ",https://blacklist2-1.example.com,http://blacklist2-2.example.com:8080,about:mozilla");
- Services.prefs.setCharPref(PREF_ROOT + "blacklist.add.TEST3", "blacklist3-1.example.com,about:preferences"); // legacy style - host only
-
- // Check they are unknown in the permission manager prior to importing.
- let whitelisted = ["http://whitelist.example.com",
- "https://whitelist2-1.example.com",
- "http://whitelist2-2.example.com:8080",
- "http://whitelist3-1.example.com",
- "https://whitelist3-1.example.com",
- "about:config",
- "about:home"];
- let blacklisted = ["http://blacklist.example.com",
- "https://blacklist2-1.example.com",
- "http://blacklist2-2.example.com:8080",
- "http://blacklist3-1.example.com",
- "https://blacklist3-1.example.com",
- "about:preferences",
- "about:mozilla"];
- let untouched = ["https://whitelist.example.com",
- "https://blacklist.example.com",
- "http://whitelist2-1.example.com",
- "http://blacklist2-1.example.com",
- "https://whitelist2-2.example.com:8080",
- "https://blacklist2-2.example.com:8080"];
- let unknown = whitelisted.concat(blacklisted).concat(untouched);
- for (let url of unknown) {
- let uri = Services.io.newURI(url, null, null);
- do_check_eq(Services.perms.testPermission(uri, TEST_PERM), Services.perms.UNKNOWN_ACTION);
- }
-
- // Import them
- PermissionsUtils.importFromPrefs(PREF_ROOT, TEST_PERM);
-
- // Get list of preferences to check
- let preferences = Services.prefs.getChildList(PREF_ROOT, {});
-
- // Check preferences were emptied
- for (let pref of preferences) {
- do_check_eq(Services.prefs.getCharPref(pref), "");
- }
-
- // Check they were imported into the permissions manager
- for (let url of whitelisted) {
- let uri = Services.io.newURI(url, null, null);
- do_check_eq(Services.perms.testPermission(uri, TEST_PERM), Services.perms.ALLOW_ACTION);
- }
- for (let url of blacklisted) {
- let uri = Services.io.newURI(url, null, null);
- do_check_eq(Services.perms.testPermission(uri, TEST_PERM), Services.perms.DENY_ACTION);
- }
- for (let url of untouched) {
- let uri = Services.io.newURI(url, null, null);
- do_check_eq(Services.perms.testPermission(uri, TEST_PERM), Services.perms.UNKNOWN_ACTION);
- }
-}
diff --git a/toolkit/modules/tests/xpcshell/test_Preferences.js b/toolkit/modules/tests/xpcshell/test_Preferences.js
deleted file mode 100644
index ef430909f..000000000
--- a/toolkit/modules/tests/xpcshell/test_Preferences.js
+++ /dev/null
@@ -1,378 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu, manager: Cm} = Components;
-
-Cu.import("resource://gre/modules/Preferences.jsm");
-
-function run_test() {
- run_next_test();
-}
-
-add_test(function test_set_get_pref() {
- Preferences.set("test_set_get_pref.integer", 1);
- do_check_eq(Preferences.get("test_set_get_pref.integer"), 1);
-
- Preferences.set("test_set_get_pref.string", "foo");
- do_check_eq(Preferences.get("test_set_get_pref.string"), "foo");
-
- Preferences.set("test_set_get_pref.boolean", true);
- do_check_eq(Preferences.get("test_set_get_pref.boolean"), true);
-
- // Clean up.
- Preferences.resetBranch("test_set_get_pref.");
-
- run_next_test();
-});
-
-add_test(function test_set_get_branch_pref() {
- let prefs = new Preferences("test_set_get_branch_pref.");
-
- prefs.set("something", 1);
- do_check_eq(prefs.get("something"), 1);
- do_check_false(Preferences.has("something"));
-
- // Clean up.
- prefs.reset("something");
-
- run_next_test();
-});
-
-add_test(function test_set_get_multiple_prefs() {
- Preferences.set({ "test_set_get_multiple_prefs.integer": 1,
- "test_set_get_multiple_prefs.string": "foo",
- "test_set_get_multiple_prefs.boolean": true });
-
- let [i, s, b] = Preferences.get(["test_set_get_multiple_prefs.integer",
- "test_set_get_multiple_prefs.string",
- "test_set_get_multiple_prefs.boolean"]);
-
- do_check_eq(i, 1);
- do_check_eq(s, "foo");
- do_check_eq(b, true);
-
- // Clean up.
- Preferences.resetBranch("test_set_get_multiple_prefs.");
-
- run_next_test();
-});
-
-add_test(function test_get_multiple_prefs_with_default_value() {
- Preferences.set({ "test_get_multiple_prefs_with_default_value.a": 1,
- "test_get_multiple_prefs_with_default_value.b": 2 });
-
- let [a, b, c] = Preferences.get(["test_get_multiple_prefs_with_default_value.a",
- "test_get_multiple_prefs_with_default_value.b",
- "test_get_multiple_prefs_with_default_value.c"],
- 0);
-
- do_check_eq(a, 1);
- do_check_eq(b, 2);
- do_check_eq(c, 0);
-
- // Clean up.
- Preferences.resetBranch("test_get_multiple_prefs_with_default_value.");
-
- run_next_test();
-});
-
-add_test(function test_set_get_unicode_pref() {
- Preferences.set("test_set_get_unicode_pref", String.fromCharCode(960));
- do_check_eq(Preferences.get("test_set_get_unicode_pref"), String.fromCharCode(960));
-
- // Clean up.
- Preferences.reset("test_set_get_unicode_pref");
-
- run_next_test();
-});
-
-add_test(function test_set_null_pref() {
- try {
- Preferences.set("test_set_null_pref", null);
- // We expect this to throw, so the test is designed to fail if it doesn't.
- do_check_true(false);
- }
- catch (ex) {}
-
- run_next_test();
-});
-
-add_test(function test_set_undefined_pref() {
- try {
- Preferences.set("test_set_undefined_pref");
- // We expect this to throw, so the test is designed to fail if it doesn't.
- do_check_true(false);
- }
- catch (ex) {}
-
- run_next_test();
-});
-
-add_test(function test_set_unsupported_pref() {
- try {
- Preferences.set("test_set_unsupported_pref", new Array());
- // We expect this to throw, so the test is designed to fail if it doesn't.
- do_check_true(false);
- }
- catch (ex) {}
-
- run_next_test();
-});
-
-// Make sure that we can get a string pref that we didn't set ourselves
-// (i.e. that the way we get a string pref using getComplexValue doesn't
-// hork us getting a string pref that wasn't set using setComplexValue).
-add_test(function test_get_string_pref() {
- let svc = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefService).
- getBranch("");
- svc.setCharPref("test_get_string_pref", "a normal string");
- do_check_eq(Preferences.get("test_get_string_pref"), "a normal string");
-
- // Clean up.
- Preferences.reset("test_get_string_pref");
-
- run_next_test();
-});
-
-add_test(function test_get_localized_string_pref() {
- let svc = Cc["@mozilla.org/preferences-service;1"].
- getService(Ci.nsIPrefService).
- getBranch("");
- let prefName = "test_get_localized_string_pref";
- let localizedString = Cc["@mozilla.org/pref-localizedstring;1"]
- .createInstance(Ci.nsIPrefLocalizedString);
- localizedString.data = "a localized string";
- svc.setComplexValue(prefName, Ci.nsIPrefLocalizedString, localizedString);
- do_check_eq(Preferences.get(prefName, null, Ci.nsIPrefLocalizedString),
- "a localized string");
-
- // Clean up.
- Preferences.reset(prefName);
-
- run_next_test();
-});
-
-add_test(function test_set_get_number_pref() {
- Preferences.set("test_set_get_number_pref", 5);
- do_check_eq(Preferences.get("test_set_get_number_pref"), 5);
-
- // Non-integer values get converted to integers.
- Preferences.set("test_set_get_number_pref", 3.14159);
- do_check_eq(Preferences.get("test_set_get_number_pref"), 3);
-
- // Values outside the range -(2^31-1) to 2^31-1 overflow.
- try {
- Preferences.set("test_set_get_number_pref", Math.pow(2, 31));
- // We expect this to throw, so the test is designed to fail if it doesn't.
- do_check_true(false);
- }
- catch (ex) {}
-
- // Clean up.
- Preferences.reset("test_set_get_number_pref");
-
- run_next_test();
-});
-
-add_test(function test_reset_pref() {
- Preferences.set("test_reset_pref", 1);
- Preferences.reset("test_reset_pref");
- do_check_eq(Preferences.get("test_reset_pref"), undefined);
-
- run_next_test();
-});
-
-add_test(function test_reset_pref_branch() {
- Preferences.set("test_reset_pref_branch.foo", 1);
- Preferences.set("test_reset_pref_branch.bar", 2);
- Preferences.resetBranch("test_reset_pref_branch.");
- do_check_eq(Preferences.get("test_reset_pref_branch.foo"), undefined);
- do_check_eq(Preferences.get("test_reset_pref_branch.bar"), undefined);
-
- run_next_test();
-});
-
-// Make sure the module doesn't throw an exception when asked to reset
-// a nonexistent pref.
-add_test(function test_reset_nonexistent_pref() {
- Preferences.reset("test_reset_nonexistent_pref");
-
- run_next_test();
-});
-
-// Make sure the module doesn't throw an exception when asked to reset
-// a nonexistent pref branch.
-add_test(function test_reset_nonexistent_pref_branch() {
- Preferences.resetBranch("test_reset_nonexistent_pref_branch.");
-
- run_next_test();
-});
-
-add_test(function test_observe_prefs_function() {
- let observed = false;
- let observer = function() { observed = !observed };
-
- Preferences.observe("test_observe_prefs_function", observer);
- Preferences.set("test_observe_prefs_function", "something");
- do_check_true(observed);
-
- Preferences.ignore("test_observe_prefs_function", observer);
- Preferences.set("test_observe_prefs_function", "something else");
- do_check_true(observed);
-
- // Clean up.
- Preferences.reset("test_observe_prefs_function");
-
- run_next_test();
-});
-
-add_test(function test_observe_prefs_object() {
- let observer = {
- observed: false,
- observe: function() {
- this.observed = !this.observed;
- }
- };
-
- Preferences.observe("test_observe_prefs_object", observer.observe, observer);
- Preferences.set("test_observe_prefs_object", "something");
- do_check_true(observer.observed);
-
- Preferences.ignore("test_observe_prefs_object", observer.observe, observer);
- Preferences.set("test_observe_prefs_object", "something else");
- do_check_true(observer.observed);
-
- // Clean up.
- Preferences.reset("test_observe_prefs_object");
-
- run_next_test();
-});
-
-add_test(function test_observe_prefs_nsIObserver() {
- let observer = {
- observed: false,
- observe: function(subject, topic, data) {
- this.observed = !this.observed;
- do_check_true(subject instanceof Ci.nsIPrefBranch);
- do_check_eq(topic, "nsPref:changed");
- do_check_eq(data, "test_observe_prefs_nsIObserver");
- }
- };
-
- Preferences.observe("test_observe_prefs_nsIObserver", observer);
- Preferences.set("test_observe_prefs_nsIObserver", "something");
- do_check_true(observer.observed);
-
- Preferences.ignore("test_observe_prefs_nsIObserver", observer);
- Preferences.set("test_observe_prefs_nsIObserver", "something else");
- do_check_true(observer.observed);
-
- // Clean up.
- Preferences.reset("test_observe_prefs_nsIObserver");
-
- run_next_test();
-});
-
-/*
-add_test(function test_observe_exact_pref() {
- let observed = false;
- let observer = function() { observed = !observed };
-
- Preferences.observe("test_observe_exact_pref", observer);
- Preferences.set("test_observe_exact_pref.sub-pref", "something");
- do_check_false(observed);
-
- // Clean up.
- Preferences.ignore("test_observe_exact_pref", observer);
- Preferences.reset("test_observe_exact_pref.sub-pref");
-
- run_next_test();
-});
-*/
-
-add_test(function test_observe_value_of_set_pref() {
- let observer = function(newVal) { do_check_eq(newVal, "something") };
-
- Preferences.observe("test_observe_value_of_set_pref", observer);
- Preferences.set("test_observe_value_of_set_pref", "something");
-
- // Clean up.
- Preferences.ignore("test_observe_value_of_set_pref", observer);
- Preferences.reset("test_observe_value_of_set_pref");
-
- run_next_test();
-});
-
-add_test(function test_observe_value_of_reset_pref() {
- let observer = function(newVal) { do_check_true(typeof newVal == "undefined") };
-
- Preferences.set("test_observe_value_of_reset_pref", "something");
- Preferences.observe("test_observe_value_of_reset_pref", observer);
- Preferences.reset("test_observe_value_of_reset_pref");
-
- // Clean up.
- Preferences.ignore("test_observe_value_of_reset_pref", observer);
-
- run_next_test();
-});
-
-add_test(function test_has_pref() {
- do_check_false(Preferences.has("test_has_pref"));
- Preferences.set("test_has_pref", "foo");
- do_check_true(Preferences.has("test_has_pref"));
-
- Preferences.set("test_has_pref.foo", "foo");
- Preferences.set("test_has_pref.bar", "bar");
- let [hasFoo, hasBar, hasBaz] = Preferences.has(["test_has_pref.foo",
- "test_has_pref.bar",
- "test_has_pref.baz"]);
- do_check_true(hasFoo);
- do_check_true(hasBar);
- do_check_false(hasBaz);
-
- // Clean up.
- Preferences.resetBranch("test_has_pref");
-
- run_next_test();
-});
-
-add_test(function test_isSet_pref() {
- // Use a pref that we know has a default value but no user-set value.
- // This feels dangerous; perhaps we should create some other default prefs
- // that we can use for testing.
- do_check_false(Preferences.isSet("toolkit.defaultChromeURI"));
- Preferences.set("toolkit.defaultChromeURI", "foo");
- do_check_true(Preferences.isSet("toolkit.defaultChromeURI"));
-
- // Clean up.
- Preferences.reset("toolkit.defaultChromeURI");
-
- run_next_test();
-});
-
-/*
-add_test(function test_lock_prefs() {
- // Use a pref that we know has a default value.
- // This feels dangerous; perhaps we should create some other default prefs
- // that we can use for testing.
- do_check_false(Preferences.locked("toolkit.defaultChromeURI"));
- Preferences.lock("toolkit.defaultChromeURI");
- do_check_true(Preferences.locked("toolkit.defaultChromeURI"));
- Preferences.unlock("toolkit.defaultChromeURI");
- do_check_false(Preferences.locked("toolkit.defaultChromeURI"));
-
- let val = Preferences.get("toolkit.defaultChromeURI");
- Preferences.set("toolkit.defaultChromeURI", "test_lock_prefs");
- do_check_eq(Preferences.get("toolkit.defaultChromeURI"), "test_lock_prefs");
- Preferences.lock("toolkit.defaultChromeURI");
- do_check_eq(Preferences.get("toolkit.defaultChromeURI"), val);
- Preferences.unlock("toolkit.defaultChromeURI");
- do_check_eq(Preferences.get("toolkit.defaultChromeURI"), "test_lock_prefs");
-
- // Clean up.
- Preferences.reset("toolkit.defaultChromeURI");
-
- run_next_test();
-});
-*/
diff --git a/toolkit/modules/tests/xpcshell/test_Promise.js b/toolkit/modules/tests/xpcshell/test_Promise.js
deleted file mode 100644
index 6c7220692..000000000
--- a/toolkit/modules/tests/xpcshell/test_Promise.js
+++ /dev/null
@@ -1,1105 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-"use strict";
-
-Components.utils.import("resource://gre/modules/Promise.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/Task.jsm");
-Components.utils.import("resource://testing-common/PromiseTestUtils.jsm");
-
-// Prevent test failures due to the unhandled rejections in this test file.
-PromiseTestUtils.disableUncaughtRejectionObserverForSelfTest();
-
-// Test runner
-
-var run_promise_tests = function run_promise_tests(tests, cb) {
- let loop = function loop(index) {
- if (index >= tests.length) {
- if (cb) {
- cb.call();
- }
- return;
- }
- do_print("Launching test " + (index + 1) + "/" + tests.length);
- let test = tests[index];
- // Execute from an empty stack
- let next = function next() {
- do_print("Test " + (index + 1) + "/" + tests.length + " complete");
- do_execute_soon(function() {
- loop(index + 1);
- });
- };
- let result = test();
- result.then(next, next);
- };
- return loop(0);
-};
-
-var make_promise_test = function(test) {
- return function runtest() {
- do_print("Test starting: " + test.name);
- try {
- let result = test();
- if (result && "promise" in result) {
- result = result.promise;
- }
- if (!result || !("then" in result)) {
- let exn;
- try {
- do_throw("Test " + test.name + " did not return a promise: " + result);
- } catch (x) {
- exn = x;
- }
- return Promise.reject(exn);
- }
- // The test returns a promise
- result = result.then(
- // Test complete
- function onResolve() {
- do_print("Test complete: " + test.name);
- },
- // The test failed with an unexpected error
- function onReject(err) {
- let detail;
- if (err && typeof err == "object" && "stack" in err) {
- detail = err.stack;
- } else {
- detail = "(no stack)";
- }
- do_throw("Test " + test.name + " rejected with the following reason: "
- + err + detail);
- });
- return result;
- } catch (x) {
- // The test failed because of an error outside of a promise
- do_throw("Error in body of test " + test.name + ": " + x + " at " + x.stack);
- return Promise.reject();
- }
- };
-};
-
-// Tests
-
-var tests = [];
-
-// Utility function to observe an failures in a promise
-// This function is useful if the promise itself is
-// not returned.
-var observe_failures = function observe_failures(promise) {
- promise.catch(function onReject(reason) {
- test.do_throw("Observed failure in test " + test + ": " + reason);
- });
-};
-
-// Test that all observers are notified
-tests.push(make_promise_test(
- function notification(test) {
- // The size of the test
- const SIZE = 10;
- const RESULT = "this is an arbitrary value";
-
- // Number of observers that yet need to be notified
- let expected = SIZE;
-
- // |true| once an observer has been notified
- let notified = [];
-
- // The promise observed
- let source = Promise.defer();
- let result = Promise.defer();
-
- let install_observer = function install_observer(i) {
- observe_failures(source.promise.then(
- function onSuccess(value) {
- do_check_true(!notified[i], "Ensuring that observer is notified at most once");
- notified[i] = true;
-
- do_check_eq(value, RESULT, "Ensuring that the observed value is correct");
- if (--expected == 0) {
- result.resolve();
- }
- }));
- };
-
- // Install a number of observers before resolving
- let i;
- for (i = 0; i < SIZE/2; ++i) {
- install_observer(i);
- }
-
- source.resolve(RESULT);
-
- // Install remaining observers
- for (;i < SIZE; ++i) {
- install_observer(i);
- }
-
- return result;
- }));
-
-// Test that observers get the correct "this" value in strict mode.
-tests.push(
- make_promise_test(function handlers_this_value(test) {
- return Promise.resolve().then(
- function onResolve() {
- // Since this file is in strict mode, the correct value is "undefined".
- do_check_eq(this, undefined);
- throw "reject";
- }
- ).then(
- null,
- function onReject() {
- // Since this file is in strict mode, the correct value is "undefined".
- do_check_eq(this, undefined);
- }
- );
- }));
-
-// Test that observers registered on a pending promise are notified in order.
-tests.push(
- make_promise_test(function then_returns_before_callbacks(test) {
- let deferred = Promise.defer();
- let promise = deferred.promise;
-
- let order = 0;
-
- promise.then(
- function onResolve() {
- do_check_eq(order, 0);
- order++;
- }
- );
-
- promise.then(
- function onResolve() {
- do_check_eq(order, 1);
- order++;
- }
- );
-
- let newPromise = promise.then(
- function onResolve() {
- do_check_eq(order, 2);
- }
- );
-
- deferred.resolve();
-
- // This test finishes after the last handler succeeds.
- return newPromise;
- }));
-
-// Test that observers registered on a resolved promise are notified in order.
-tests.push(
- make_promise_test(function then_returns_before_callbacks(test) {
- let promise = Promise.resolve();
-
- let order = 0;
-
- promise.then(
- function onResolve() {
- do_check_eq(order, 0);
- order++;
- }
- );
-
- promise.then(
- function onResolve() {
- do_check_eq(order, 1);
- order++;
- }
- );
-
- // This test finishes after the last handler succeeds.
- return promise.then(
- function onResolve() {
- do_check_eq(order, 2);
- }
- );
- }));
-
-// Test that all observers are notified at most once, even if source
-// is resolved/rejected several times
-tests.push(make_promise_test(
- function notification_once(test) {
- // The size of the test
- const SIZE = 10;
- const RESULT = "this is an arbitrary value";
-
- // Number of observers that yet need to be notified
- let expected = SIZE;
-
- // |true| once an observer has been notified
- let notified = [];
-
- // The promise observed
- let observed = Promise.defer();
- let result = Promise.defer();
-
- let install_observer = function install_observer(i) {
- observe_failures(observed.promise.then(
- function onSuccess(value) {
- do_check_true(!notified[i], "Ensuring that observer is notified at most once");
- notified[i] = true;
-
- do_check_eq(value, RESULT, "Ensuring that the observed value is correct");
- if (--expected == 0) {
- result.resolve();
- }
- }));
- };
-
- // Install a number of observers before resolving
- let i;
- for (i = 0; i < SIZE/2; ++i) {
- install_observer(i);
- }
-
- observed.resolve(RESULT);
-
- // Install remaining observers
- for (;i < SIZE; ++i) {
- install_observer(i);
- }
-
- // Resolve some more
- for (i = 0; i < 10; ++i) {
- observed.resolve(RESULT);
- observed.reject();
- }
-
- return result;
- }));
-
-// Test that throwing an exception from a onResolve listener
-// does not prevent other observers from receiving the notification
-// of success.
-tests.push(
- make_promise_test(function exceptions_do_not_stop_notifications(test) {
- let source = Promise.defer();
-
- let exception_thrown = false;
- let exception_content = new Error("Boom!");
-
- let observer_1 = source.promise.then(
- function onResolve() {
- exception_thrown = true;
- throw exception_content;
- });
-
- let observer_2 = source.promise.then(
- function onResolve() {
- do_check_true(exception_thrown, "Second observer called after first observer has thrown");
- }
- );
-
- let result = observer_1.then(
- function onResolve() {
- do_throw("observer_1 should not have resolved");
- },
- function onReject(reason) {
- do_check_true(reason == exception_content, "Obtained correct rejection");
- }
- );
-
- source.resolve();
- return result;
- }
-));
-
-// Test that, once a promise is resolved, further resolve/reject
-// are ignored.
-tests.push(
- make_promise_test(function subsequent_resolves_are_ignored(test) {
- let deferred = Promise.defer();
- deferred.resolve(1);
- deferred.resolve(2);
- deferred.reject(3);
-
- let result = deferred.promise.then(
- function onResolve(value) {
- do_check_eq(value, 1, "Resolution chose the first value");
- },
- function onReject(reason) {
- do_throw("Obtained a rejection while the promise was already resolved");
- }
- );
-
- return result;
- }));
-
-// Test that, once a promise is rejected, further resolve/reject
-// are ignored.
-tests.push(
- make_promise_test(function subsequent_rejects_are_ignored(test) {
- let deferred = Promise.defer();
- deferred.reject(1);
- deferred.reject(2);
- deferred.resolve(3);
-
- let result = deferred.promise.then(
- function onResolve() {
- do_throw("Obtained a resolution while the promise was already rejected");
- },
- function onReject(reason) {
- do_check_eq(reason, 1, "Rejection chose the first value");
- }
- );
-
- return result;
- }));
-
-// Test that returning normally from a rejection recovers from the error
-// and that listeners are informed of a success.
-tests.push(
- make_promise_test(function recovery(test) {
- let boom = new Error("Boom!");
- let deferred = Promise.defer();
- const RESULT = "An arbitrary value";
-
- let promise = deferred.promise.then(
- function onResolve() {
- do_throw("A rejected promise should not resolve");
- },
- function onReject(reason) {
- do_check_true(reason == boom, "Promise was rejected with the correct error");
- return RESULT;
- }
- );
-
- promise = promise.then(
- function onResolve(value) {
- do_check_eq(value, RESULT, "Promise was recovered with the correct value");
- }
- );
-
- deferred.reject(boom);
- return promise;
- }));
-
-// Test that returning a resolved promise from a onReject causes a resolution
-// (recovering from the error) and that returning a rejected promise
-// from a onResolve listener causes a rejection (raising an error).
-tests.push(
- make_promise_test(function recovery_with_promise(test) {
- let boom = new Error("Arbitrary error");
- let deferred = Promise.defer();
- const RESULT = "An arbitrary value";
- const boom2 = new Error("Another arbitrary error");
-
- // return a resolved promise from a onReject listener
- let promise = deferred.promise.then(
- function onResolve() {
- do_throw("A rejected promise should not resolve");
- },
- function onReject(reason) {
- do_check_true(reason == boom, "Promise was rejected with the correct error");
- return Promise.resolve(RESULT);
- }
- );
-
- // return a rejected promise from a onResolve listener
- promise = promise.then(
- function onResolve(value) {
- do_check_eq(value, RESULT, "Promise was recovered with the correct value");
- return Promise.reject(boom2);
- }
- );
-
- promise = promise.catch(
- function onReject(reason) {
- do_check_eq(reason, boom2, "Rejection was propagated with the correct " +
- "reason, through a promise");
- }
- );
-
- deferred.reject(boom);
- return promise;
- }));
-
-// Test that we can resolve with promises of promises
-tests.push(
- make_promise_test(function test_propagation(test) {
- const RESULT = "Yet another arbitrary value";
- let d1 = Promise.defer();
- let d2 = Promise.defer();
- let d3 = Promise.defer();
-
- d3.resolve(d2.promise);
- d2.resolve(d1.promise);
- d1.resolve(RESULT);
-
- return d3.promise.then(
- function onSuccess(value) {
- do_check_eq(value, RESULT, "Resolution with a promise eventually yielded "
- + " the correct result");
- }
- );
- }));
-
-// Test sequences of |then| and |catch|
-tests.push(
- make_promise_test(function test_chaining(test) {
- let error_1 = new Error("Error 1");
- let error_2 = new Error("Error 2");
- let result_1 = "First result";
- let result_2 = "Second result";
- let result_3 = "Third result";
-
- let source = Promise.defer();
-
- let promise = source.promise.then().then();
-
- source.resolve(result_1);
-
- // Check that result_1 is correctly propagated
- promise = promise.then(
- function onSuccess(result) {
- do_check_eq(result, result_1, "Result was propagated correctly through " +
- " several applications of |then|");
- return result_2;
- }
- );
-
- // Check that returning from the promise produces a resolution
- promise = promise.catch(
- function onReject() {
- do_throw("Incorrect rejection");
- }
- );
-
- // ... and that the check did not alter the value
- promise = promise.then(
- function onResolve(value) {
- do_check_eq(value, result_2, "Result was propagated correctly once again");
- }
- );
-
- // Now the same kind of tests for rejections
- promise = promise.then(
- function onResolve() {
- throw error_1;
- }
- );
-
- promise = promise.then(
- function onResolve() {
- do_throw("Incorrect resolution: the exception should have caused a rejection");
- }
- );
-
- promise = promise.catch(
- function onReject(reason) {
- do_check_true(reason == error_1, "Reason was propagated correctly");
- throw error_2;
- }
- );
-
- promise = promise.catch(
- function onReject(reason) {
- do_check_true(reason == error_2, "Throwing an error altered the reason " +
- "as expected");
- return result_3;
- }
- );
-
- promise = promise.then(
- function onResolve(result) {
- do_check_eq(result, result_3, "Error was correctly recovered");
- }
- );
-
- return promise;
- }));
-
-// Test that resolving with a rejected promise actually rejects
-tests.push(
- make_promise_test(function resolve_to_rejected(test) {
- let source = Promise.defer();
- let error = new Error("Boom");
-
- let promise = source.promise.then(
- function onResolve() {
- do_throw("Incorrect call to onResolve listener");
- },
- function onReject(reason) {
- do_check_eq(reason, error, "Rejection lead to the expected reason");
- }
- );
-
- source.resolve(Promise.reject(error));
-
- return promise;
- }));
-
-// Test that Promise.resolve resolves as expected
-tests.push(
- make_promise_test(function test_resolve(test) {
- const RESULT = "arbitrary value";
- let p1 = Promise.resolve(RESULT);
- let p2 = Promise.resolve(p1);
- do_check_eq(p1, p2, "Promise.resolve used on a promise just returns the promise");
-
- return p1.then(
- function onResolve(result) {
- do_check_eq(result, RESULT, "Promise.resolve propagated the correct result");
- }
- );
- }));
-
-// Test that Promise.resolve throws when its argument is an async function.
-tests.push(
- make_promise_test(function test_promise_resolve_throws_with_async_function(test) {
- Assert.throws(() => Promise.resolve(Task.async(function* () {})),
- /Cannot resolve a promise with an async function/);
- return Promise.resolve();
- }));
-
-// Test that the code after "then" is always executed before the callbacks
-tests.push(
- make_promise_test(function then_returns_before_callbacks(test) {
- let promise = Promise.resolve();
-
- let thenExecuted = false;
-
- promise = promise.then(
- function onResolve() {
- thenExecuted = true;
- }
- );
-
- do_check_false(thenExecuted);
-
- return promise;
- }));
-
-// Test that chaining promises does not generate long stack traces
-tests.push(
- make_promise_test(function chaining_short_stack(test) {
- let source = Promise.defer();
- let promise = source.promise;
-
- const NUM_ITERATIONS = 100;
-
- for (let i = 0; i < NUM_ITERATIONS; i++) {
- promise = promise.then(
- function onResolve(result) {
- return result + ".";
- }
- );
- }
-
- promise = promise.then(
- function onResolve(result) {
- // Check that the execution went as expected.
- let expectedString = new Array(1 + NUM_ITERATIONS).join(".");
- do_check_true(result == expectedString);
-
- // Check that we didn't generate one or more stack frames per iteration.
- let stackFrameCount = 0;
- let stackFrame = Components.stack;
- while (stackFrame) {
- stackFrameCount++;
- stackFrame = stackFrame.caller;
- }
-
- do_check_true(stackFrameCount < NUM_ITERATIONS);
- }
- );
-
- source.resolve("");
-
- return promise;
- }));
-
-// Test that the values of the promise return by Promise.all() are kept in the
-// given order even if the given promises are resolved in arbitrary order
-tests.push(
- make_promise_test(function all_resolve(test) {
- let d1 = Promise.defer();
- let d2 = Promise.defer();
- let d3 = Promise.defer();
-
- d3.resolve(4);
- d2.resolve(2);
- do_execute_soon(() => d1.resolve(1));
-
- let promises = [d1.promise, d2.promise, 3, d3.promise];
-
- return Promise.all(promises).then(
- function onResolve([val1, val2, val3, val4]) {
- do_check_eq(val1, 1);
- do_check_eq(val2, 2);
- do_check_eq(val3, 3);
- do_check_eq(val4, 4);
- }
- );
- }));
-
-// Test that rejecting one of the promises passed to Promise.all()
-// rejects the promise return by Promise.all()
-tests.push(
- make_promise_test(function all_reject(test) {
- let error = new Error("Boom");
-
- let d1 = Promise.defer();
- let d2 = Promise.defer();
- let d3 = Promise.defer();
-
- d3.resolve(3);
- d2.resolve(2);
- do_execute_soon(() => d1.reject(error));
-
- let promises = [d1.promise, d2.promise, d3.promise];
-
- return Promise.all(promises).then(
- function onResolve() {
- do_throw("Incorrect call to onResolve listener");
- },
- function onReject(reason) {
- do_check_eq(reason, error, "Rejection lead to the expected reason");
- }
- );
- }));
-
-// Test that passing only values (not promises) to Promise.all()
-// forwards them all as resolution values.
-tests.push(
- make_promise_test(function all_resolve_no_promises(test) {
- try {
- Promise.all(null);
- do_check_true(false, "all() should only accept iterables");
- } catch (e) {
- do_check_true(true, "all() fails when first the arg is not an iterable");
- }
-
- let p1 = Promise.all([]).then(
- function onResolve(val) {
- do_check_true(Array.isArray(val) && val.length == 0);
- }
- );
-
- let p2 = Promise.all([1, 2, 3]).then(
- function onResolve([val1, val2, val3]) {
- do_check_eq(val1, 1);
- do_check_eq(val2, 2);
- do_check_eq(val3, 3);
- }
- );
-
- return Promise.all([p1, p2]);
- }));
-
-// Test that Promise.all() handles non-array iterables
-tests.push(
- make_promise_test(function all_iterable(test) {
- function* iterable() {
- yield 1;
- yield 2;
- yield 3;
- }
-
- return Promise.all(iterable()).then(
- function onResolve([val1, val2, val3]) {
- do_check_eq(val1, 1);
- do_check_eq(val2, 2);
- do_check_eq(val3, 3);
- },
- function onReject() {
- do_throw("all() unexpectedly rejected");
- }
- );
- }));
-
-// Test that throwing from the iterable passed to Promise.all() rejects the
-// promise returned by Promise.all()
-tests.push(
- make_promise_test(function all_iterable_throws(test) {
- function* iterable() {
- throw 1;
- }
-
- return Promise.all(iterable()).then(
- function onResolve() {
- do_throw("all() unexpectedly resolved");
- },
- function onReject(reason) {
- do_check_eq(reason, 1, "all() rejects when the iterator throws");
- }
- );
- }));
-
-// Test that Promise.race() resolves with the first available resolution value
-tests.push(
- make_promise_test(function race_resolve(test) {
- let p1 = Promise.resolve(1);
- let p2 = Promise.resolve().then(() => 2);
-
- return Promise.race([p1, p2]).then(
- function onResolve(value) {
- do_check_eq(value, 1);
- }
- );
- }));
-
-// Test that passing only values (not promises) to Promise.race() works
-tests.push(
- make_promise_test(function race_resolve_no_promises(test) {
- try {
- Promise.race(null);
- do_check_true(false, "race() should only accept iterables");
- } catch (e) {
- do_check_true(true, "race() fails when first the arg is not an iterable");
- }
-
- return Promise.race([1, 2, 3]).then(
- function onResolve(value) {
- do_check_eq(value, 1);
- }
- );
- }));
-
-// Test that Promise.race() never resolves when passed an empty iterable
-tests.push(
- make_promise_test(function race_resolve_never(test) {
- return new Promise(resolve => {
- Promise.race([]).then(
- function onResolve() {
- do_throw("race() unexpectedly resolved");
- },
- function onReject() {
- do_throw("race() unexpectedly rejected");
- }
- );
-
- // Approximate "never" so we don't have to solve the halting problem.
- do_timeout(200, resolve);
- });
- }));
-
-// Test that Promise.race() handles non-array iterables.
-tests.push(
- make_promise_test(function race_iterable(test) {
- function* iterable() {
- yield 1;
- yield 2;
- yield 3;
- }
-
- return Promise.race(iterable()).then(
- function onResolve(value) {
- do_check_eq(value, 1);
- },
- function onReject() {
- do_throw("race() unexpectedly rejected");
- }
- );
- }));
-
-// Test that throwing from the iterable passed to Promise.race() rejects the
-// promise returned by Promise.race()
-tests.push(
- make_promise_test(function race_iterable_throws(test) {
- function* iterable() {
- throw 1;
- }
-
- return Promise.race(iterable()).then(
- function onResolve() {
- do_throw("race() unexpectedly resolved");
- },
- function onReject(reason) {
- do_check_eq(reason, 1, "race() rejects when the iterator throws");
- }
- );
- }));
-
-// Test that rejecting one of the promises passed to Promise.race() rejects the
-// promise returned by Promise.race()
-tests.push(
- make_promise_test(function race_reject(test) {
- let p1 = Promise.reject(1);
- let p2 = Promise.resolve(2);
- let p3 = Promise.resolve(3);
-
- return Promise.race([p1, p2, p3]).then(
- function onResolve() {
- do_throw("race() unexpectedly resolved");
- },
- function onReject(reason) {
- do_check_eq(reason, 1, "race() rejects when given a rejected promise");
- }
- );
- }));
-
-// Test behavior of the Promise constructor.
-tests.push(
- make_promise_test(function test_constructor(test) {
- try {
- new Promise(null);
- do_check_true(false, "Constructor should fail when not passed a function");
- } catch (e) {
- do_check_true(true, "Constructor fails when not passed a function");
- }
-
- let executorRan = false;
- let promise = new Promise(
- function executor(resolve, reject) {
- executorRan = true;
- do_check_eq(this, undefined);
- do_check_eq(typeof resolve, "function",
- "resolve function should be passed to the executor");
- do_check_eq(typeof reject, "function",
- "reject function should be passed to the executor");
- }
- );
- do_check_instanceof(promise, Promise);
- do_check_true(executorRan, "Executor should execute synchronously");
-
- // resolve a promise from the executor
- let resolvePromise = new Promise(
- function executor(resolve) {
- resolve(1);
- }
- ).then(
- function onResolve(value) {
- do_check_eq(value, 1, "Executor resolved with correct value");
- },
- function onReject() {
- do_throw("Executor unexpectedly rejected");
- }
- );
-
- // reject a promise from the executor
- let rejectPromise = new Promise(
- function executor(_, reject) {
- reject(1);
- }
- ).then(
- function onResolve() {
- do_throw("Executor unexpectedly resolved");
- },
- function onReject(reason) {
- do_check_eq(reason, 1, "Executor rejected with correct value");
- }
- );
-
- // throw from the executor, causing a rejection
- let throwPromise = new Promise(
- function executor() {
- throw 1;
- }
- ).then(
- function onResolve() {
- do_throw("Throwing inside an executor should not resolve the promise");
- },
- function onReject(reason) {
- do_check_eq(reason, 1, "Executor rejected with correct value");
- }
- );
-
- return Promise.all([resolvePromise, rejectPromise, throwPromise]);
- }));
-
-// Test deadlock in Promise.jsm with nested event loops
-// The scenario being tested is:
-// promise_1.then({
-// do some work that will asynchronously signal done
-// start an event loop waiting for the done signal
-// }
-// where the async work uses resolution of a second promise to
-// trigger the "done" signal. While this would likely work in a
-// naive implementation, our constant-stack implementation needs
-// a special case to avoid deadlock. Note that this test is
-// sensitive to the implementation-dependent order in which then()
-// clauses for two different promises are executed, so it is
-// possible for other implementations to pass this test and still
-// have similar deadlocks.
-tests.push(
- make_promise_test(function promise_nested_eventloop_deadlock(test) {
- // Set up a (long enough to be noticeable) timeout to
- // exit the nested event loop and throw if the test run is hung
- let shouldExitNestedEventLoop = false;
-
- function event_loop() {
- let thr = Services.tm.mainThread;
- while (!shouldExitNestedEventLoop) {
- thr.processNextEvent(true);
- }
- }
-
- // I wish there was a way to cancel xpcshell do_timeout()s
- do_timeout(2000, () => {
- if (!shouldExitNestedEventLoop) {
- shouldExitNestedEventLoop = true;
- do_throw("Test timed out");
- }
- });
-
- let promise1 = Promise.resolve(1);
- let promise2 = Promise.resolve(2);
-
- do_print("Setting wait for first promise");
- promise1.then(value => {
- do_print("Starting event loop");
- event_loop();
- }, null);
-
- do_print("Setting wait for second promise");
- return promise2.catch(error => { return 3; })
- .then(
- count => {
- shouldExitNestedEventLoop = true;
- });
- }));
-
-function wait_for_uncaught(aMustAppear, aTimeout = undefined) {
- let remaining = new Set();
- for (let k of aMustAppear) {
- remaining.add(k);
- }
- let deferred = Promise.defer();
- let print = do_print;
- let execute_soon = do_execute_soon;
- let observer = function({message, stack}) {
- let data = message + stack;
- print("Observing " + message + ", looking for " + aMustAppear.join(", "));
- for (let expected of remaining) {
- if (data.indexOf(expected) != -1) {
- print("I found " + expected);
- remaining.delete(expected);
- }
- if (remaining.size == 0 && observer) {
- Promise.Debugging.removeUncaughtErrorObserver(observer);
- observer = null;
- deferred.resolve();
- }
- }
- };
- Promise.Debugging.addUncaughtErrorObserver(observer);
- if (aTimeout) {
- do_timeout(aTimeout, function timeout() {
- if (observer) {
- Promise.Debugging.removeUncaughtErrorObserver(observer);
- observer = null;
- }
- deferred.reject(new Error("Timeout"));
- });
- }
- return deferred.promise;
-}
-
-// Test that uncaught errors are reported as uncaught
-(function() {
- let make_string_rejection = function make_string_rejection() {
- let salt = (Math.random() * ( Math.pow(2, 24) - 1 ));
- let string = "This is an uncaught rejection " + salt;
- // Our error is not Error-like nor an nsIException, so the stack will
- // include the closure doing the actual rejection.
- return {mustFind: ["test_rejection_closure", string], error: string};
- };
- let make_num_rejection = function make_num_rejection() {
- let salt = (Math.random() * ( Math.pow(2, 24) - 1 ));
- // Our error is not Error-like nor an nsIException, so the stack will
- // include the closure doing the actual rejection.
- return {mustFind: ["test_rejection_closure", salt], error: salt};
- };
- let make_undefined_rejection = function make_undefined_rejection() {
- // Our error is not Error-like nor an nsIException, so the stack will
- // include the closure doing the actual rejection.
- return {mustFind: ["test_rejection_closure"], error: undefined};
- };
- let make_error_rejection = function make_error_rejection() {
- let salt = (Math.random() * ( Math.pow(2, 24) - 1 ));
- let error = new Error("This is an uncaught error " + salt);
- return {
- mustFind: [error.message, error.fileName, error.lineNumber, error.stack],
- error: error
- };
- };
- let make_exception_rejection = function make_exception_rejection() {
- let salt = (Math.random() * ( Math.pow(2, 24) - 1 ));
- let exn = new Components.Exception("This is an uncaught exception " + salt,
- Components.results.NS_ERROR_NOT_AVAILABLE);
- return {
- mustFind: [exn.message, exn.filename, exn.lineNumber, exn.location.toString()],
- error: exn
- };
- };
- for (let make_rejection of [make_string_rejection,
- make_num_rejection,
- make_undefined_rejection,
- make_error_rejection,
- make_exception_rejection]) {
- let {mustFind, error} = make_rejection();
- let name = make_rejection.name;
- tests.push(make_promise_test(function test_uncaught_is_reported() {
- do_print("Testing with rejection " + name);
- let promise = wait_for_uncaught(mustFind);
- (function test_rejection_closure() {
- // For the moment, we cannot be absolutely certain that a value is
- // garbage-collected, even if it is not referenced anymore, due to
- // the conservative stack-scanning algorithm.
- //
- // To be _almost_ certain that a value will be garbage-collected, we
- // 1. isolate that value in an anonymous closure;
- // 2. allocate 100 values instead of 1 (gc-ing a single value from
- // these is sufficient for the test);
- // 3. place everything in a loop, as the JIT typically reuses memory;
- // 4. call all the GC methods we can.
- //
- // Unfortunately, we might still have intermittent failures,
- // materialized as timeouts.
- //
- for (let i = 0; i < 100; ++i) {
- Promise.reject(error);
- }
- })();
- do_print("Posted all rejections");
- Components.utils.forceGC();
- Components.utils.forceCC();
- Components.utils.forceShrinkingGC();
- return promise;
- }));
- }
-})();
-
-
-// Test that caught errors are not reported as uncaught
-tests.push(
-make_promise_test(function test_caught_is_not_reported() {
- let salt = (Math.random() * ( Math.pow(2, 24) - 1 ));
- let promise = wait_for_uncaught([salt], 500);
- (function() {
- let uncaught = Promise.reject("This error, on the other hand, is caught " + salt);
- uncaught.catch(function() { /* ignore rejection */ });
- uncaught = null;
- })();
- // Isolate this in a function to increase likelihood that the gc will
- // realise that |uncaught| has remained uncaught.
- Components.utils.forceGC();
-
- return promise.then(function onSuccess() {
- throw new Error("This error was caught and should not have been reported");
- }, function onError() {
- do_print("The caught error was not reported, all is fine");
- }
- );
-}));
-
-// Bug 1033406 - Make sure Promise works even after freezing.
-tests.push(
- make_promise_test(function test_freezing_promise(test) {
- var p = new Promise(function executor(resolve) {
- do_execute_soon(resolve);
- });
- Object.freeze(p);
- return p;
- })
-);
-
-function run_test()
-{
- do_test_pending();
- run_promise_tests(tests, do_test_finished);
-}
diff --git a/toolkit/modules/tests/xpcshell/test_PromiseUtils.js b/toolkit/modules/tests/xpcshell/test_PromiseUtils.js
deleted file mode 100644
index c3ab839e4..000000000
--- a/toolkit/modules/tests/xpcshell/test_PromiseUtils.js
+++ /dev/null
@@ -1,105 +0,0 @@
- /* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Components.utils.import("resource://gre/modules/PromiseUtils.jsm");
-Components.utils.import("resource://gre/modules/Timer.jsm");
-Components.utils.import("resource://testing-common/PromiseTestUtils.jsm");
-
-// Tests for PromiseUtils.jsm
-function run_test() {
- run_next_test();
-}
-
-// Tests for PromiseUtils.defer()
-
-/* Tests for checking the resolve method of the Deferred object
- * returned by PromiseUtils.defer() */
-add_task(function* test_resolve_string() {
- let def = PromiseUtils.defer();
- let expected = "The promise is resolved " + Math.random();
- def.resolve(expected);
- let result = yield def.promise;
- Assert.equal(result, expected, "def.resolve() resolves the promise");
-});
-
-/* Test for the case when undefined is passed to the resolve method
- * of the Deferred object */
-add_task(function* test_resolve_undefined() {
- let def = PromiseUtils.defer();
- def.resolve();
- let result = yield def.promise;
- Assert.equal(result, undefined, "resolve works with undefined as well");
-});
-
-/* Test when a pending promise is passed to the resolve method
- * of the Deferred object */
-add_task(function* test_resolve_pending_promise() {
- let def = PromiseUtils.defer();
- let expected = 100 + Math.random();
- let p = new Promise((resolve, reject) => {
- setTimeout(() => resolve(expected), 100);
- });
- def.resolve(p);
- let result = yield def.promise;
- Assert.equal(result, expected, "def.promise assumed the state of the passed promise");
-});
-
-/* Test when a resovled promise is passed
- * to the resolve method of the Deferred object */
-add_task(function* test_resolve_resolved_promise() {
- let def = PromiseUtils.defer();
- let expected = "Yeah resolved" + Math.random();
- let p = new Promise((resolve, reject) => resolve(expected));
- def.resolve(p);
- let result = yield def.promise;
- Assert.equal(result, expected, "Resolved promise is passed to the resolve method");
-});
-
-/* Test for the case when a rejected promise is
- * passed to the resolve method */
-add_task(function* test_resolve_rejected_promise() {
- let def = PromiseUtils.defer();
- let p = new Promise((resolve, reject) => reject(new Error("There its an rejection")));
- def.resolve(p);
- yield Assert.rejects(def.promise, /There its an rejection/, "Settled rejection promise passed to the resolve method");
-});
-
-/* Test for the checking the reject method of
- * the Deferred object returned by PromiseUtils.defer() */
-add_task(function* test_reject_Error() {
- let def = PromiseUtils.defer();
- def.reject(new Error("This one rejects"));
- yield Assert.rejects(def.promise, /This one rejects/, "reject method with Error for rejection");
-});
-
-/* Test for the case when a pending Promise is passed to
- * the reject method of Deferred object */
-add_task(function* test_reject_pending_promise() {
- let def = PromiseUtils.defer();
- let p = new Promise((resolve, reject) => {
- setTimeout(() => resolve(100), 100);
- });
- def.reject(p);
- yield Assert.rejects(def.promise, Promise, "Rejection with a pending promise uses the passed promise itself as the reason of rejection");
-});
-
-/* Test for the case when a resolved Promise
- * is passed to the reject method */
-add_task(function* test_reject_resolved_promise() {
- let def = PromiseUtils.defer();
- let p = new Promise((resolve, reject) => resolve("This resolved"));
- def.reject(p);
- yield Assert.rejects(def.promise, Promise, "Rejection with a resolved promise uses the passed promise itself as the reason of rejection");
-});
-
-/* Test for the case when a rejected Promise is
- * passed to the reject method */
-add_task(function* test_reject_resolved_promise() {
- PromiseTestUtils.expectUncaughtRejection(/This one rejects/);
- let def = PromiseUtils.defer();
- let p = new Promise((resolve, reject) => reject(new Error("This one rejects")));
- def.reject(p);
- yield Assert.rejects(def.promise, Promise, "Rejection with a rejected promise uses the passed promise itself as the reason of rejection");
-});
diff --git a/toolkit/modules/tests/xpcshell/test_Services.js b/toolkit/modules/tests/xpcshell/test_Services.js
deleted file mode 100644
index a50ecca3d..000000000
--- a/toolkit/modules/tests/xpcshell/test_Services.js
+++ /dev/null
@@ -1,90 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests the Services.jsm module.
- */
-
-// Globals
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-
-function checkService(service, interface) {
- do_print("Checking that Services." + service + " is an " + interface);
- do_check_true(service in Services);
- do_check_true(Services[service] instanceof interface);
-}
-
-// Tests
-
-function run_test()
-{
- do_get_profile();
-
- checkService("appShell", Ci.nsIAppShellService);
- checkService("appinfo", Ci.nsIXULRuntime);
- checkService("blocklist", Ci.nsIBlocklistService);
- checkService("cache", Ci.nsICacheService);
- checkService("cache2", Ci.nsICacheStorageService);
- checkService("clipboard", Ci.nsIClipboard);
- checkService("console", Ci.nsIConsoleService);
- checkService("contentPrefs", Ci.nsIContentPrefService);
- checkService("cookies", Ci.nsICookieManager2);
- checkService("dirsvc", Ci.nsIDirectoryService);
- checkService("dirsvc", Ci.nsIProperties);
- checkService("DOMRequest", Ci.nsIDOMRequestService);
- checkService("domStorageManager", Ci.nsIDOMStorageManager);
- checkService("downloads", Ci.nsIDownloadManager);
- checkService("droppedLinkHandler", Ci.nsIDroppedLinkHandler);
- checkService("eTLD", Ci.nsIEffectiveTLDService);
- checkService("focus", Ci.nsIFocusManager);
- checkService("io", Ci.nsIIOService);
- checkService("io", Ci.nsIIOService2);
- checkService("locale", Ci.nsILocaleService);
- checkService("logins", Ci.nsILoginManager);
- checkService("obs", Ci.nsIObserverService);
- checkService("perms", Ci.nsIPermissionManager);
- checkService("prefs", Ci.nsIPrefBranch);
- checkService("prefs", Ci.nsIPrefService);
- checkService("prompt", Ci.nsIPromptService);
- checkService("scriptSecurityManager", Ci.nsIScriptSecurityManager);
- checkService("scriptloader", Ci.mozIJSSubScriptLoader);
- checkService("startup", Ci.nsIAppStartup);
- checkService("storage", Ci.mozIStorageService);
- checkService("strings", Ci.nsIStringBundleService);
- checkService("sysinfo", Ci.nsIPropertyBag2);
- checkService("telemetry", Ci.nsITelemetry);
- checkService("tm", Ci.nsIThreadManager);
- checkService("uriFixup", Ci.nsIURIFixup);
- checkService("urlFormatter", Ci.nsIURLFormatter);
- checkService("vc", Ci.nsIVersionComparator);
- checkService("wm", Ci.nsIWindowMediator);
- checkService("ww", Ci.nsIWindowWatcher);
- if ("nsIBrowserSearchService" in Ci) {
- checkService("search", Ci.nsIBrowserSearchService);
- }
- if ("nsIAndroidBridge" in Ci) {
- checkService("androidBridge", Ci.nsIAndroidBridge);
- }
-
- // In xpcshell tests, the "@mozilla.org/xre/app-info;1" component implements
- // only the nsIXULRuntime interface, but not nsIXULAppInfo. To test the
- // service getter for the latter interface, load mock app-info.
- let tmp = {};
- Cu.import("resource://testing-common/AppInfo.jsm", tmp);
- tmp.updateAppInfo();
-
- // We need to reload the module to update the lazy getter.
- Cu.unload("resource://gre/modules/Services.jsm");
- Cu.import("resource://gre/modules/Services.jsm");
-
- checkService("appinfo", Ci.nsIXULAppInfo);
-
- Cu.unload("resource://gre/modules/Services.jsm");
-}
diff --git a/toolkit/modules/tests/xpcshell/test_UpdateUtils_updatechannel.js b/toolkit/modules/tests/xpcshell/test_UpdateUtils_updatechannel.js
deleted file mode 100644
index 75d7a1992..000000000
--- a/toolkit/modules/tests/xpcshell/test_UpdateUtils_updatechannel.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var { utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/Preferences.jsm");
-Cu.import("resource://gre/modules/UpdateUtils.jsm");
-
-const PREF_APP_UPDATE_CHANNEL = "app.update.channel";
-const TEST_CHANNEL = "TestChannel";
-const PREF_PARTNER_A = "app.partner.test_partner_a";
-const TEST_PARTNER_A = "TestPartnerA";
-const PREF_PARTNER_B = "app.partner.test_partner_b";
-const TEST_PARTNER_B = "TestPartnerB";
-
-add_task(function* test_updatechannel() {
- let defaultPrefs = new Preferences({ defaultBranch: true });
- let currentChannel = defaultPrefs.get(PREF_APP_UPDATE_CHANNEL);
-
- do_check_eq(UpdateUtils.UpdateChannel, currentChannel);
- do_check_eq(UpdateUtils.getUpdateChannel(true), currentChannel);
- do_check_eq(UpdateUtils.getUpdateChannel(false), currentChannel);
-
- defaultPrefs.set(PREF_APP_UPDATE_CHANNEL, TEST_CHANNEL);
- do_check_eq(UpdateUtils.UpdateChannel, TEST_CHANNEL);
- do_check_eq(UpdateUtils.getUpdateChannel(true), TEST_CHANNEL);
- do_check_eq(UpdateUtils.getUpdateChannel(false), TEST_CHANNEL);
-
- defaultPrefs.set(PREF_PARTNER_A, TEST_PARTNER_A);
- defaultPrefs.set(PREF_PARTNER_B, TEST_PARTNER_B);
- do_check_eq(UpdateUtils.UpdateChannel,
- TEST_CHANNEL + "-cck-" + TEST_PARTNER_A + "-" + TEST_PARTNER_B);
- do_check_eq(UpdateUtils.getUpdateChannel(true),
- TEST_CHANNEL + "-cck-" + TEST_PARTNER_A + "-" + TEST_PARTNER_B);
- do_check_eq(UpdateUtils.getUpdateChannel(false), TEST_CHANNEL);
-});
diff --git a/toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js b/toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js
deleted file mode 100644
index da5d868e3..000000000
--- a/toolkit/modules/tests/xpcshell/test_UpdateUtils_url.js
+++ /dev/null
@@ -1,292 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/UpdateUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
-Cu.import("resource://testing-common/AppInfo.jsm");
-Cu.import("resource://gre/modules/ctypes.jsm");
-
-const PREF_APP_UPDATE_CHANNEL = "app.update.channel";
-const PREF_APP_PARTNER_BRANCH = "app.partner.";
-const PREF_DISTRIBUTION_ID = "distribution.id";
-const PREF_DISTRIBUTION_VERSION = "distribution.version";
-
-const URL_PREFIX = "http://localhost/";
-
-const MSG_SHOULD_EQUAL = " should equal the expected value";
-
-updateAppInfo();
-const gAppInfo = getAppInfo();
-const gDefaultPrefBranch = Services.prefs.getDefaultBranch(null);
-
-function setUpdateChannel(aChannel) {
- gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_CHANNEL, aChannel);
-}
-
-function getServicePack() {
- // NOTE: This function is a helper function and not a test. Thus,
- // it uses throw() instead of do_throw(). Any tests that use this function
- // should catch exceptions thrown in this function and deal with them
- // appropriately (usually by calling do_throw).
- const BYTE = ctypes.uint8_t;
- const WORD = ctypes.uint16_t;
- const DWORD = ctypes.uint32_t;
- const WCHAR = ctypes.char16_t;
- const BOOL = ctypes.int;
-
- // This structure is described at:
- // http://msdn.microsoft.com/en-us/library/ms724833%28v=vs.85%29.aspx
- const SZCSDVERSIONLENGTH = 128;
- const OSVERSIONINFOEXW = new ctypes.StructType('OSVERSIONINFOEXW',
- [
- {dwOSVersionInfoSize: DWORD},
- {dwMajorVersion: DWORD},
- {dwMinorVersion: DWORD},
- {dwBuildNumber: DWORD},
- {dwPlatformId: DWORD},
- {szCSDVersion: ctypes.ArrayType(WCHAR, SZCSDVERSIONLENGTH)},
- {wServicePackMajor: WORD},
- {wServicePackMinor: WORD},
- {wSuiteMask: WORD},
- {wProductType: BYTE},
- {wReserved: BYTE}
- ]);
-
- let kernel32 = ctypes.open("kernel32");
- try {
- let GetVersionEx = kernel32.declare("GetVersionExW",
- ctypes.default_abi,
- BOOL,
- OSVERSIONINFOEXW.ptr);
- let winVer = OSVERSIONINFOEXW();
- winVer.dwOSVersionInfoSize = OSVERSIONINFOEXW.size;
-
- if (0 === GetVersionEx(winVer.address())) {
- // Using "throw" instead of "do_throw" (see NOTE above)
- throw ("Failure in GetVersionEx (returned 0)");
- }
-
- return winVer.wServicePackMajor + "." + winVer.wServicePackMinor;
- } finally {
- kernel32.close();
- }
-}
-
-function getProcArchitecture() {
- // NOTE: This function is a helper function and not a test. Thus,
- // it uses throw() instead of do_throw(). Any tests that use this function
- // should catch exceptions thrown in this function and deal with them
- // appropriately (usually by calling do_throw).
- const WORD = ctypes.uint16_t;
- const DWORD = ctypes.uint32_t;
-
- // This structure is described at:
- // http://msdn.microsoft.com/en-us/library/ms724958%28v=vs.85%29.aspx
- const SYSTEM_INFO = new ctypes.StructType('SYSTEM_INFO',
- [
- {wProcessorArchitecture: WORD},
- {wReserved: WORD},
- {dwPageSize: DWORD},
- {lpMinimumApplicationAddress: ctypes.voidptr_t},
- {lpMaximumApplicationAddress: ctypes.voidptr_t},
- {dwActiveProcessorMask: DWORD.ptr},
- {dwNumberOfProcessors: DWORD},
- {dwProcessorType: DWORD},
- {dwAllocationGranularity: DWORD},
- {wProcessorLevel: WORD},
- {wProcessorRevision: WORD}
- ]);
-
- let kernel32 = ctypes.open("kernel32");
- try {
- let GetNativeSystemInfo = kernel32.declare("GetNativeSystemInfo",
- ctypes.default_abi,
- ctypes.void_t,
- SYSTEM_INFO.ptr);
- let sysInfo = SYSTEM_INFO();
- // Default to unknown
- sysInfo.wProcessorArchitecture = 0xffff;
-
- GetNativeSystemInfo(sysInfo.address());
- switch (sysInfo.wProcessorArchitecture) {
- case 9:
- return "x64";
- case 6:
- return "IA64";
- case 0:
- return "x86";
- default:
- // Using "throw" instead of "do_throw" (see NOTE above)
- throw ("Unknown architecture returned from GetNativeSystemInfo: " + sysInfo.wProcessorArchitecture);
- }
- } finally {
- kernel32.close();
- }
-}
-
-// Helper function for formatting a url and getting the result we're
-// interested in
-function getResult(url) {
- url = UpdateUtils.formatUpdateURL(url);
- return url.substr(URL_PREFIX.length).split("/")[0];
-}
-
-// url constructed with %PRODUCT%
-add_task(function* test_product() {
- let url = URL_PREFIX + "%PRODUCT%/";
- Assert.equal(getResult(url), gAppInfo.name,
- "the url param for %PRODUCT%" + MSG_SHOULD_EQUAL);
-});
-
-// url constructed with %VERSION%
-add_task(function* test_version() {
- let url = URL_PREFIX + "%VERSION%/";
- Assert.equal(getResult(url), gAppInfo.version,
- "the url param for %VERSION%" + MSG_SHOULD_EQUAL);
-});
-
-// url constructed with %BUILD_ID%
-add_task(function* test_build_id() {
- let url = URL_PREFIX + "%BUILD_ID%/";
- Assert.equal(getResult(url), gAppInfo.appBuildID,
- "the url param for %BUILD_ID%" + MSG_SHOULD_EQUAL);
-});
-
-// url constructed with %BUILD_TARGET%
-// XXX TODO - it might be nice if we tested the actual ABI
-add_task(function* test_build_target() {
- let url = URL_PREFIX + "%BUILD_TARGET%/";
-
- let abi;
- try {
- abi = gAppInfo.XPCOMABI;
- } catch (e) {
- do_throw("nsIXULAppInfo:XPCOMABI not defined\n");
- }
-
- if (AppConstants.platform == "macosx") {
- // Mac universal build should report a different ABI than either macppc
- // or mactel. This is necessary since nsUpdateService.js will set the ABI to
- // Universal-gcc3 for Mac universal builds.
- let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].
- getService(Ci.nsIMacUtils);
-
- if (macutils.isUniversalBinary) {
- abi += "-u-" + macutils.architecturesInBinary;
- }
- } else if (AppConstants.platform == "win") {
- // Windows build should report the CPU architecture that it's running on.
- abi += "-" + getProcArchitecture();
- }
-
- Assert.equal(getResult(url), gAppInfo.OS + "_" + abi,
- "the url param for %BUILD_TARGET%" + MSG_SHOULD_EQUAL);
-});
-
-// url constructed with %LOCALE%
-// Bug 488936 added the update.locale file that stores the update locale
-add_task(function* test_locale() {
- // The code that gets the locale accesses the profile which is only available
- // after calling do_get_profile in xpcshell tests. This prevents an error from
- // being logged.
- do_get_profile();
-
- let url = URL_PREFIX + "%LOCALE%/";
- Assert.equal(getResult(url), AppConstants.INSTALL_LOCALE,
- "the url param for %LOCALE%" + MSG_SHOULD_EQUAL);
-});
-
-// url constructed with %CHANNEL%
-add_task(function* test_channel() {
- let url = URL_PREFIX + "%CHANNEL%/";
- setUpdateChannel("test_channel");
- Assert.equal(getResult(url), "test_channel",
- "the url param for %CHANNEL%" + MSG_SHOULD_EQUAL);
-});
-
-// url constructed with %CHANNEL% with distribution partners
-add_task(function* test_channel_distribution() {
- let url = URL_PREFIX + "%CHANNEL%/";
- gDefaultPrefBranch.setCharPref(PREF_APP_PARTNER_BRANCH + "test_partner1",
- "test_partner1");
- gDefaultPrefBranch.setCharPref(PREF_APP_PARTNER_BRANCH + "test_partner2",
- "test_partner2");
- Assert.equal(getResult(url),
- "test_channel-cck-test_partner1-test_partner2",
- "the url param for %CHANNEL%" + MSG_SHOULD_EQUAL);
-});
-
-// url constructed with %PLATFORM_VERSION%
-add_task(function* test_platform_version() {
- let url = URL_PREFIX + "%PLATFORM_VERSION%/";
- Assert.equal(getResult(url), gAppInfo.platformVersion,
- "the url param for %PLATFORM_VERSION%" + MSG_SHOULD_EQUAL);
-});
-
-// url constructed with %OS_VERSION%
-add_task(function* test_os_version() {
- let url = URL_PREFIX + "%OS_VERSION%/";
- let osVersion;
- let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
- osVersion = sysInfo.getProperty("name") + " " + sysInfo.getProperty("version");
-
- if (AppConstants.platform == "win") {
- try {
- let servicePack = getServicePack();
- osVersion += "." + servicePack;
- } catch (e) {
- do_throw("Failure obtaining service pack: " + e);
- }
-
- if ("5.0" === sysInfo.getProperty("version")) { // Win2K
- osVersion += " (unknown)";
- } else {
- try {
- osVersion += " (" + getProcArchitecture() + ")";
- } catch (e) {
- do_throw("Failed to obtain processor architecture: " + e);
- }
- }
- }
-
- if (osVersion) {
- try {
- osVersion += " (" + sysInfo.getProperty("secondaryLibrary") + ")";
- } catch (e) {
- // Not all platforms have a secondary widget library, so an error is
- // nothing to worry about.
- }
- osVersion = encodeURIComponent(osVersion);
- }
-
- Assert.equal(getResult(url), osVersion,
- "the url param for %OS_VERSION%" + MSG_SHOULD_EQUAL);
-});
-
-// url constructed with %DISTRIBUTION%
-add_task(function* test_distribution() {
- let url = URL_PREFIX + "%DISTRIBUTION%/";
- gDefaultPrefBranch.setCharPref(PREF_DISTRIBUTION_ID, "test_distro");
- Assert.equal(getResult(url), "test_distro",
- "the url param for %DISTRIBUTION%" + MSG_SHOULD_EQUAL);
-});
-
-// url constructed with %DISTRIBUTION_VERSION%
-add_task(function* test_distribution_version() {
- let url = URL_PREFIX + "%DISTRIBUTION_VERSION%/";
- gDefaultPrefBranch.setCharPref(PREF_DISTRIBUTION_VERSION, "test_distro_version");
- Assert.equal(getResult(url), "test_distro_version",
- "the url param for %DISTRIBUTION_VERSION%" + MSG_SHOULD_EQUAL);
-});
-
-add_task(function* test_custom() {
- Services.prefs.setCharPref("app.update.custom", "custom");
- let url = URL_PREFIX + "%CUSTOM%/";
- Assert.equal(getResult(url), "custom",
- "the url query string for %CUSTOM%" + MSG_SHOULD_EQUAL);
-});
diff --git a/toolkit/modules/tests/xpcshell/test_ZipUtils.js b/toolkit/modules/tests/xpcshell/test_ZipUtils.js
deleted file mode 100644
index 71c6884d4..000000000
--- a/toolkit/modules/tests/xpcshell/test_ZipUtils.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-const ARCHIVE = "zips/zen.zip";
-const SUBDIR = "zen";
-const SYMLINK = "beyond_link";
-const ENTRIES = ["beyond.txt", SYMLINK, "waterwood.txt"];
-
-Components.utils.import("resource://gre/modules/ZipUtils.jsm");
-Components.utils.import("resource://gre/modules/FileUtils.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-const archive = do_get_file(ARCHIVE, false);
-const dir = do_get_profile().clone();
-dir.append("test_ZipUtils");
-
-function run_test() {
- run_next_test();
-}
-
-function ensureExtracted(target) {
- target.append(SUBDIR);
- do_check_true(target.exists());
-
- for (let i = 0; i < ENTRIES.length; i++) {
- let entry = target.clone();
- entry.append(ENTRIES[i]);
- do_print("ENTRY " + entry.path);
- do_check_true(entry.exists());
- }
-}
-
-function ensureHasSymlink(target) {
- // Just bail out if running on Windows, since symlinks do not exists there.
- if (Services.appinfo.OS === "WINNT") {
- return;
- }
-
- let entry = target.clone();
- entry.append(SYMLINK);
-
- do_print("ENTRY " + entry.path);
- do_check_true(entry.exists());
- do_check_true(entry.isSymlink());
-}
-
-add_task(function test_extractFiles() {
- let target = dir.clone();
- target.append("test_extractFiles");
-
- try {
- ZipUtils.extractFiles(archive, target);
- } catch (e) {
- do_throw("Failed to extract synchronously!");
- }
-
- ensureExtracted(target);
- ensureHasSymlink(target);
-});
-
-add_task(function* test_extractFilesAsync() {
- let target = dir.clone();
- target.append("test_extractFilesAsync");
- target.create(Components.interfaces.nsIFile.DIRECTORY_TYPE,
- FileUtils.PERMS_DIRECTORY);
-
- yield ZipUtils.extractFilesAsync(archive, target).then(
- function success() {
- do_print("SUCCESS");
- ensureExtracted(target);
- },
- function failure() {
- do_print("FAILURE");
- do_throw("Failed to extract asynchronously!");
- }
- );
-});
diff --git a/toolkit/modules/tests/xpcshell/test_client_id.js b/toolkit/modules/tests/xpcshell/test_client_id.js
deleted file mode 100644
index 10ef2a3ea..000000000
--- a/toolkit/modules/tests/xpcshell/test_client_id.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/ClientID.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://services-common/utils.js");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/Preferences.jsm");
-
-function run_test() {
- do_get_profile();
- run_next_test();
-}
-
-add_task(function* () {
- const drsPath = OS.Path.join(OS.Constants.Path.profileDir, "datareporting", "state.json");
- const fhrDir = OS.Path.join(OS.Constants.Path.profileDir, "healthreport");
- const fhrPath = OS.Path.join(fhrDir, "state.json");
- const uuidRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
- const invalidIDs = [-1, 0.5, "INVALID-UUID", true, "", "3d1e1560-682a-4043-8cf2-aaaaaaaaaaaZ"];
- const PREF_CACHED_CLIENTID = "toolkit.telemetry.cachedClientID";
-
- yield OS.File.makeDir(fhrDir);
-
- // Check that we are importing the FHR client ID.
- let clientID = CommonUtils.generateUUID();
- yield CommonUtils.writeJSON({clientID: clientID}, fhrPath);
- Assert.equal(clientID, yield ClientID.getClientID());
-
- // We should persist the ID in DRS now and not pick up a differing ID from FHR.
- yield ClientID._reset();
- yield CommonUtils.writeJSON({clientID: CommonUtils.generateUUID()}, fhrPath);
- Assert.equal(clientID, yield ClientID.getClientID());
-
- // We should be guarded against broken FHR data.
- for (let invalidID of invalidIDs) {
- yield ClientID._reset();
- yield OS.File.remove(drsPath);
- yield CommonUtils.writeJSON({clientID: invalidID}, fhrPath);
- clientID = yield ClientID.getClientID();
- Assert.equal(typeof(clientID), 'string');
- Assert.ok(uuidRegex.test(clientID));
- }
-
- // We should be guarded against invalid FHR json.
- yield ClientID._reset();
- yield OS.File.remove(drsPath);
- yield OS.File.writeAtomic(fhrPath, "abcd", {encoding: "utf-8", tmpPath: fhrPath + ".tmp"});
- clientID = yield ClientID.getClientID();
- Assert.equal(typeof(clientID), 'string');
- Assert.ok(uuidRegex.test(clientID));
-
- // We should be guarded against broken DRS data too and fall back to loading
- // the FHR ID.
- for (let invalidID of invalidIDs) {
- yield ClientID._reset();
- clientID = CommonUtils.generateUUID();
- yield CommonUtils.writeJSON({clientID: clientID}, fhrPath);
- yield CommonUtils.writeJSON({clientID: invalidID}, drsPath);
- Assert.equal(clientID, yield ClientID.getClientID());
- }
-
- // We should be guarded against invalid DRS json too.
- yield ClientID._reset();
- yield OS.File.remove(fhrPath);
- yield OS.File.writeAtomic(drsPath, "abcd", {encoding: "utf-8", tmpPath: drsPath + ".tmp"});
- clientID = yield ClientID.getClientID();
- Assert.equal(typeof(clientID), 'string');
- Assert.ok(uuidRegex.test(clientID));
-
- // If both the FHR and DSR data are broken, we should end up with a new client ID.
- for (let invalidID of invalidIDs) {
- yield ClientID._reset();
- yield CommonUtils.writeJSON({clientID: invalidID}, fhrPath);
- yield CommonUtils.writeJSON({clientID: invalidID}, drsPath);
- clientID = yield ClientID.getClientID();
- Assert.equal(typeof(clientID), 'string');
- Assert.ok(uuidRegex.test(clientID));
- }
-
- // Assure that cached IDs are being checked for validity.
- for (let invalidID of invalidIDs) {
- yield ClientID._reset();
- Preferences.set(PREF_CACHED_CLIENTID, invalidID);
- let cachedID = ClientID.getCachedClientID();
- Assert.strictEqual(cachedID, null, "ClientID should ignore invalid cached IDs");
- let prefID = Preferences.get(PREF_CACHED_CLIENTID, null);
- Assert.strictEqual(prefID, null, "ClientID should reset invalid cached IDs");
- }
-});
diff --git a/toolkit/modules/tests/xpcshell/test_jsesc.js b/toolkit/modules/tests/xpcshell/test_jsesc.js
deleted file mode 100644
index 0c6cbba69..000000000
--- a/toolkit/modules/tests/xpcshell/test_jsesc.js
+++ /dev/null
@@ -1,9 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Components.utils.import("resource://gre/modules/third_party/jsesc/jsesc.js");
-
-function run_test() {
- do_check_eq(jsesc("teééést", {lowercaseHex: true}), "te\\xe9\\xe9\\xe9st");
- do_check_eq(jsesc("teééést", {lowercaseHex: false}), "te\\xE9\\xE9\\xE9st");
-}
diff --git a/toolkit/modules/tests/xpcshell/test_propertyListsUtils.js b/toolkit/modules/tests/xpcshell/test_propertyListsUtils.js
deleted file mode 100644
index 9ccf50b73..000000000
--- a/toolkit/modules/tests/xpcshell/test_propertyListsUtils.js
+++ /dev/null
@@ -1,106 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-"use strict";
-
-Components.utils.import("resource://gre/modules/PropertyListUtils.jsm");
-
-function checkValue(aPropertyListObject, aType, aValue) {
- do_check_eq(PropertyListUtils.getObjectType(aPropertyListObject), aType);
- if (aValue !== undefined) {
- // Perform strict equality checks until Bug 714467 is fixed.
- let strictEqualityCheck = function(a, b) {
- do_check_eq(typeof(a), typeof(b));
- do_check_eq(a, b);
- };
-
- if (typeof(aPropertyListObject) == "object")
- strictEqualityCheck(aPropertyListObject.valueOf(), aValue.valueOf());
- else
- strictEqualityCheck(aPropertyListObject, aValue);
- }
-}
-
-function checkLazyGetterValue(aObject, aPropertyName, aType, aValue) {
- let descriptor = Object.getOwnPropertyDescriptor(aObject, aPropertyName);
- do_check_eq(typeof(descriptor.get), "function");
- do_check_eq(typeof(descriptor.value), "undefined");
- checkValue(aObject[aPropertyName], aType, aValue);
- descriptor = Object.getOwnPropertyDescriptor(aObject, aPropertyName);
- do_check_eq(typeof(descriptor.get), "undefined");
- do_check_neq(typeof(descriptor.value), "undefined");
-}
-
-function checkMainPropertyList(aPropertyListRoot) {
- const PRIMITIVE = PropertyListUtils.TYPE_PRIMITIVE;
-
- checkValue(aPropertyListRoot, PropertyListUtils.TYPE_DICTIONARY);
-
- // Check .has()
- Assert.ok(aPropertyListRoot.has("Boolean"));
- Assert.ok(!aPropertyListRoot.has("Nonexistent"));
-
- checkValue(aPropertyListRoot.get("Boolean"), PRIMITIVE, false);
-
- let array = aPropertyListRoot.get("Array");
- checkValue(array, PropertyListUtils.TYPE_ARRAY);
- do_check_eq(array.length, 8);
-
- // Test both long and short values, since binary property lists store
- // long values a little bit differently (see readDataLengthAndOffset).
-
- // Short ASCII string
- checkLazyGetterValue(array, 0, PRIMITIVE, "abc");
- // Long ASCII string
- checkLazyGetterValue(array, 1, PRIMITIVE, new Array(1001).join("a"));
- // Short unicode string
- checkLazyGetterValue(array, 2, PRIMITIVE, "\u05D0\u05D0\u05D0");
- // Long unicode string
- checkLazyGetterValue(array, 3, PRIMITIVE, new Array(1001).join("\u05D0"));
- // Unicode surrogate pair
- checkLazyGetterValue(array, 4, PRIMITIVE,
- "\uD800\uDC00\uD800\uDC00\uD800\uDC00");
-
- // Date
- checkLazyGetterValue(array, 5, PropertyListUtils.TYPE_DATE,
- new Date("2011-12-31T11:15:23Z"));
-
- // Data
- checkLazyGetterValue(array, 6, PropertyListUtils.TYPE_UINT8_ARRAY);
- let dataAsString = Array.from(array[6]).map(b => String.fromCharCode(b)).join("");
- do_check_eq(dataAsString, "2011-12-31T11:15:33Z");
-
- // Dict
- let dict = array[7];
- checkValue(dict, PropertyListUtils.TYPE_DICTIONARY);
- checkValue(dict.get("Negative Number"), PRIMITIVE, -400);
- checkValue(dict.get("Real Number"), PRIMITIVE, 2.71828183);
- checkValue(dict.get("Big Int"),
- PropertyListUtils.TYPE_INT64,
- "9007199254740993");
- checkValue(dict.get("Negative Big Int"),
- PropertyListUtils.TYPE_INT64,
- "-9007199254740993");
-}
-
-function readPropertyList(aFile, aCallback) {
- PropertyListUtils.read(aFile, function(aPropertyListRoot) {
- // Null root indicates failure to read property list.
- // Note: It is important not to run do_check_n/eq directly on Dict and array
- // objects, because it cases their toString to get invoked, doing away with
- // all the lazy getter we'd like to test later.
- do_check_true(aPropertyListRoot !== null);
- aCallback(aPropertyListRoot);
- run_next_test();
- });
-}
-
-function run_test() {
- add_test(readPropertyList.bind(this,
- do_get_file("propertyLists/bug710259_propertyListBinary.plist", false),
- checkMainPropertyList));
- add_test(readPropertyList.bind(this,
- do_get_file("propertyLists/bug710259_propertyListXML.plist", false),
- checkMainPropertyList));
- run_next_test();
-}
diff --git a/toolkit/modules/tests/xpcshell/test_readCertPrefs.js b/toolkit/modules/tests/xpcshell/test_readCertPrefs.js
deleted file mode 100644
index 837a9912a..000000000
--- a/toolkit/modules/tests/xpcshell/test_readCertPrefs.js
+++ /dev/null
@@ -1,97 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/CertUtils.jsm");
-
-const PREF_PREFIX = "certutils.certs.";
-
-function run_test() {
- run_next_test();
-}
-
-function resetPrefs() {
- var prefs = Services.prefs.getChildList(PREF_PREFIX);
- prefs.forEach(Services.prefs.clearUserPref);
-}
-
-function attributes_match(aCert, aExpected) {
- if (Object.keys(aCert).length != Object.keys(aExpected).length)
- return false;
-
- for (var attribute in aCert) {
- if (!(attribute in aExpected))
- return false;
- if (aCert[attribute] != aExpected[attribute])
- return false;
- }
-
- return true;
-}
-
-function test_results(aCerts, aExpected) {
- do_check_eq(aCerts.length, aExpected.length);
-
- for (var i = 0; i < aCerts.length; i++) {
- if (!attributes_match(aCerts[i], aExpected[i])) {
- dump("Attributes for certificate " + (i + 1) + " did not match expected attributes\n");
- dump("Saw: " + aCerts[i].toSource() + "\n");
- dump("Expected: " + aExpected[i].toSource() + "\n");
- do_check_true(false);
- }
- }
-}
-
-add_test(function test_singleCert() {
- Services.prefs.setCharPref(PREF_PREFIX + "1.attribute1", "foo");
- Services.prefs.setCharPref(PREF_PREFIX + "1.attribute2", "bar");
-
- var certs = readCertPrefs(PREF_PREFIX);
- test_results(certs, [{
- attribute1: "foo",
- attribute2: "bar"
- }]);
-
- resetPrefs();
- run_next_test();
-});
-
-add_test(function test_multipleCert() {
- Services.prefs.setCharPref(PREF_PREFIX + "1.md5Fingerprint", "cf84a9a2a804e021f27cb5128fe151f4");
- Services.prefs.setCharPref(PREF_PREFIX + "1.nickname", "1st cert");
- Services.prefs.setCharPref(PREF_PREFIX + "2.md5Fingerprint", "9441051b7eb50e5ca2226095af710c1a");
- Services.prefs.setCharPref(PREF_PREFIX + "2.nickname", "2nd cert");
-
- var certs = readCertPrefs(PREF_PREFIX);
- test_results(certs, [{
- md5Fingerprint: "cf84a9a2a804e021f27cb5128fe151f4",
- nickname: "1st cert"
- }, {
- md5Fingerprint: "9441051b7eb50e5ca2226095af710c1a",
- nickname: "2nd cert"
- }]);
-
- resetPrefs();
- run_next_test();
-});
-
-add_test(function test_skippedCert() {
- Services.prefs.setCharPref(PREF_PREFIX + "1.issuerName", "Mozilla");
- Services.prefs.setCharPref(PREF_PREFIX + "1.nickname", "1st cert");
- Services.prefs.setCharPref(PREF_PREFIX + "2.issuerName", "Top CA");
- Services.prefs.setCharPref(PREF_PREFIX + "2.nickname", "2nd cert");
- Services.prefs.setCharPref(PREF_PREFIX + "4.issuerName", "Unknown CA");
- Services.prefs.setCharPref(PREF_PREFIX + "4.nickname", "Ignored cert");
-
- var certs = readCertPrefs(PREF_PREFIX);
- test_results(certs, [{
- issuerName: "Mozilla",
- nickname: "1st cert"
- }, {
- issuerName: "Top CA",
- nickname: "2nd cert"
- }]);
-
- resetPrefs();
- run_next_test();
-});
diff --git a/toolkit/modules/tests/xpcshell/test_servicerequest_xhr.js b/toolkit/modules/tests/xpcshell/test_servicerequest_xhr.js
deleted file mode 100644
index b3c8a443e..000000000
--- a/toolkit/modules/tests/xpcshell/test_servicerequest_xhr.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/ServiceRequest.jsm");
-
-add_task(function* test_tls_conservative() {
- const request = new ServiceRequest();
- request.open("GET", "http://example.com", false);
-
- const sr_channel = request.channel.QueryInterface(Ci.nsIHttpChannelInternal);
- ok(("beConservative" in sr_channel), "TLS setting is present in SR channel");
- ok(sr_channel.beConservative, "TLS setting in request channel is set to conservative for SR");
-
- const xhr = new XMLHttpRequest();
- xhr.open("GET", "http://example.com", false);
-
- const xhr_channel = xhr.channel.QueryInterface(Ci.nsIHttpChannelInternal);
- ok(("beConservative" in xhr_channel), "TLS setting is present in XHR channel");
- ok(!xhr_channel.beConservative, "TLS setting in request channel is not set to conservative for XHR");
-
-});
diff --git a/toolkit/modules/tests/xpcshell/test_session_recorder.js b/toolkit/modules/tests/xpcshell/test_session_recorder.js
deleted file mode 100644
index dd9159c6e..000000000
--- a/toolkit/modules/tests/xpcshell/test_session_recorder.js
+++ /dev/null
@@ -1,306 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var {utils: Cu} = Components;
-
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/SessionRecorder.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://services-common/utils.js");
-
-
-function run_test() {
- run_next_test();
-}
-
-function monkeypatchStartupInfo(recorder, start=new Date(), offset=500) {
- Object.defineProperty(recorder, "_getStartupInfo", {
- value: function _getStartupInfo() {
- return {
- process: start,
- main: new Date(start.getTime() + offset),
- firstPaint: new Date(start.getTime() + 2 * offset),
- sessionRestored: new Date(start.getTime() + 3 * offset),
- };
- }
- });
-}
-
-function sleep(wait) {
- let deferred = Promise.defer();
-
- let timer = CommonUtils.namedTimer(function onTimer() {
- deferred.resolve();
- }, wait, deferred.promise, "_sleepTimer");
-
- return deferred.promise;
-}
-
-function getRecorder(name, start, offset) {
- let recorder = new SessionRecorder("testing." + name + ".");
- monkeypatchStartupInfo(recorder, start, offset);
-
- return recorder;
-}
-
-add_test(function test_basic() {
- let recorder = getRecorder("basic");
- recorder.onStartup();
- recorder.onShutdown();
-
- run_next_test();
-});
-
-add_task(function* test_current_properties() {
- let now = new Date();
- let recorder = getRecorder("current_properties", now);
- yield sleep(25);
- recorder.onStartup();
-
- do_check_eq(recorder.startDate.getTime(), now.getTime());
- do_check_eq(recorder.activeTicks, 0);
- do_check_true(recorder.fineTotalTime > 0);
- do_check_eq(recorder.main, 500);
- do_check_eq(recorder.firstPaint, 1000);
- do_check_eq(recorder.sessionRestored, 1500);
-
- recorder.incrementActiveTicks();
- do_check_eq(recorder.activeTicks, 1);
-
- recorder._startDate = new Date(Date.now() - 1000);
- recorder.updateTotalTime();
- do_check_eq(recorder.totalTime, 1);
-
- recorder.onShutdown();
-});
-
-// If startup info isn't present yet, we should install a timer and get
-// it eventually.
-add_task(function* test_current_availability() {
- let recorder = new SessionRecorder("testing.current_availability.");
- let now = new Date();
-
- Object.defineProperty(recorder, "_getStartupInfo", {
- value: function _getStartupInfo() {
- return {
- process: now,
- main: new Date(now.getTime() + 500),
- firstPaint: new Date(now.getTime() + 1000),
- };
- },
- writable: true,
- });
-
- Object.defineProperty(recorder, "STARTUP_RETRY_INTERVAL_MS", {
- value: 100,
- });
-
- let oldRecord = recorder.recordStartupFields;
- let recordCount = 0;
-
- Object.defineProperty(recorder, "recordStartupFields", {
- value: function () {
- recordCount++;
- return oldRecord.call(recorder);
- }
- });
-
- do_check_null(recorder._timer);
- recorder.onStartup();
- do_check_eq(recordCount, 1);
- do_check_eq(recorder.sessionRestored, -1);
- do_check_neq(recorder._timer, null);
-
- yield sleep(125);
- do_check_eq(recordCount, 2);
- yield sleep(100);
- do_check_eq(recordCount, 3);
- do_check_eq(recorder.sessionRestored, -1);
-
- monkeypatchStartupInfo(recorder, now);
- yield sleep(100);
- do_check_eq(recordCount, 4);
- do_check_eq(recorder.sessionRestored, 1500);
-
- // The timer should be removed and we should not fire again.
- do_check_null(recorder._timer);
- yield sleep(100);
- do_check_eq(recordCount, 4);
-
- recorder.onShutdown();
-});
-
-add_test(function test_timer_clear_on_shutdown() {
- let recorder = new SessionRecorder("testing.timer_clear_on_shutdown.");
- let now = new Date();
-
- Object.defineProperty(recorder, "_getStartupInfo", {
- value: function _getStartupInfo() {
- return {
- process: now,
- main: new Date(now.getTime() + 500),
- firstPaint: new Date(now.getTime() + 1000),
- };
- },
- });
-
- do_check_null(recorder._timer);
- recorder.onStartup();
- do_check_neq(recorder._timer, null);
-
- recorder.onShutdown();
- do_check_null(recorder._timer);
-
- run_next_test();
-});
-
-add_task(function* test_previous_clean() {
- let now = new Date();
- let recorder = getRecorder("previous_clean", now);
- yield sleep(25);
- recorder.onStartup();
-
- recorder.incrementActiveTicks();
- recorder.incrementActiveTicks();
-
- yield sleep(25);
- recorder.onShutdown();
-
- let total = recorder.totalTime;
-
- yield sleep(25);
- let now2 = new Date();
- let recorder2 = getRecorder("previous_clean", now2, 100);
- yield sleep(25);
- recorder2.onStartup();
-
- do_check_eq(recorder2.startDate.getTime(), now2.getTime());
- do_check_eq(recorder2.main, 100);
- do_check_eq(recorder2.firstPaint, 200);
- do_check_eq(recorder2.sessionRestored, 300);
-
- let sessions = recorder2.getPreviousSessions();
- do_check_eq(Object.keys(sessions).length, 1);
- do_check_true(0 in sessions);
- let session = sessions[0];
- do_check_true(session.clean);
- do_check_eq(session.startDate.getTime(), now.getTime());
- do_check_eq(session.main, 500);
- do_check_eq(session.firstPaint, 1000);
- do_check_eq(session.sessionRestored, 1500);
- do_check_eq(session.totalTime, total);
- do_check_eq(session.activeTicks, 2);
-
- recorder2.onShutdown();
-});
-
-add_task(function* test_previous_abort() {
- let now = new Date();
- let recorder = getRecorder("previous_abort", now);
- yield sleep(25);
- recorder.onStartup();
- recorder.incrementActiveTicks();
- yield sleep(25);
- let total = recorder.totalTime;
- yield sleep(25);
-
- let now2 = new Date();
- let recorder2 = getRecorder("previous_abort", now2);
- yield sleep(25);
- recorder2.onStartup();
-
- let sessions = recorder2.getPreviousSessions();
- do_check_eq(Object.keys(sessions).length, 1);
- do_check_true(0 in sessions);
- let session = sessions[0];
- do_check_false(session.clean);
- do_check_eq(session.totalTime, total);
-
- recorder.onShutdown();
- recorder2.onShutdown();
-});
-
-add_task(function* test_multiple_sessions() {
- for (let i = 0; i < 10; i++) {
- let recorder = getRecorder("multiple_sessions");
- yield sleep(25);
- recorder.onStartup();
- for (let j = 0; j < i; j++) {
- recorder.incrementActiveTicks();
- }
- yield sleep(25);
- recorder.onShutdown();
- yield sleep(25);
- }
-
- let recorder = getRecorder("multiple_sessions");
- recorder.onStartup();
-
- let sessions = recorder.getPreviousSessions();
- do_check_eq(Object.keys(sessions).length, 10);
-
- for (let [i, session] of Object.entries(sessions)) {
- do_check_eq(session.activeTicks, i);
-
- if (i > 0) {
- do_check_true(session.startDate.getTime() > sessions[i-1].startDate.getTime());
- }
- }
-
- // #6 is preserved since >=.
- let threshold = sessions[6].startDate;
- recorder.pruneOldSessions(threshold);
-
- sessions = recorder.getPreviousSessions();
- do_check_eq(Object.keys(sessions).length, 4);
-
- recorder.pruneOldSessions(threshold);
- sessions = recorder.getPreviousSessions();
- do_check_eq(Object.keys(sessions).length, 4);
- do_check_eq(recorder._prunedIndex, 5);
-
- recorder.onShutdown();
-});
-
-add_task(function* test_record_activity() {
- let recorder = getRecorder("record_activity");
- yield sleep(25);
- recorder.onStartup();
- let total = recorder.totalTime;
- yield sleep(25);
-
- for (let i = 0; i < 3; i++) {
- Services.obs.notifyObservers(null, "user-interaction-active", null);
- yield sleep(25);
- do_check_true(recorder.fineTotalTime > total);
- total = recorder.fineTotalTime;
- }
-
- do_check_eq(recorder.activeTicks, 3);
-
- // Now send inactive. We should increment total time but not active.
- Services.obs.notifyObservers(null, "user-interaction-inactive", null);
- do_check_eq(recorder.activeTicks, 3);
- do_check_true(recorder.fineTotalTime > total);
- total = recorder.fineTotalTime;
- yield sleep(25);
-
- // If we send active again, this should be counted as inactive.
- Services.obs.notifyObservers(null, "user-interaction-active", null);
- do_check_eq(recorder.activeTicks, 3);
- do_check_true(recorder.fineTotalTime > total);
- total = recorder.fineTotalTime;
- yield sleep(25);
-
- // If we send active again, this should be counted as active.
- Services.obs.notifyObservers(null, "user-interaction-active", null);
- do_check_eq(recorder.activeTicks, 4);
-
- Services.obs.notifyObservers(null, "user-interaction-active", null);
- do_check_eq(recorder.activeTicks, 5);
-
- recorder.onShutdown();
-});
-
diff --git a/toolkit/modules/tests/xpcshell/test_sqlite.js b/toolkit/modules/tests/xpcshell/test_sqlite.js
deleted file mode 100644
index edd39d977..000000000
--- a/toolkit/modules/tests/xpcshell/test_sqlite.js
+++ /dev/null
@@ -1,1094 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-do_get_profile();
-
-Cu.import("resource://gre/modules/Promise.jsm");
-Cu.import("resource://gre/modules/PromiseUtils.jsm");
-Cu.import("resource://gre/modules/osfile.jsm");
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/Sqlite.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-// To spin the event loop in test.
-Cu.import("resource://services-common/async.js");
-
-function sleep(ms) {
- let deferred = Promise.defer();
-
- let timer = Cc["@mozilla.org/timer;1"]
- .createInstance(Ci.nsITimer);
-
- timer.initWithCallback({
- notify: function () {
- deferred.resolve();
- },
- }, ms, timer.TYPE_ONE_SHOT);
-
- return deferred.promise;
-}
-
-// When testing finalization, use this to tell Sqlite.jsm to not throw
-// an uncatchable `Promise.reject`
-function failTestsOnAutoClose(enabled) {
- Cu.getGlobalForObject(Sqlite).Debugging.failTestsOnAutoClose = enabled;
-}
-
-function getConnection(dbName, extraOptions={}) {
- let path = dbName + ".sqlite";
- let options = {path: path};
- for (let [k, v] of Object.entries(extraOptions)) {
- options[k] = v;
- }
-
- return Sqlite.openConnection(options);
-}
-
-function* getDummyDatabase(name, extraOptions={}) {
- const TABLES = {
- dirs: "id INTEGER PRIMARY KEY AUTOINCREMENT, path TEXT",
- files: "id INTEGER PRIMARY KEY AUTOINCREMENT, dir_id INTEGER, path TEXT",
- };
-
- let c = yield getConnection(name, extraOptions);
- c._initialStatementCount = 0;
-
- for (let [k, v] of Object.entries(TABLES)) {
- yield c.execute("CREATE TABLE " + k + "(" + v + ")");
- c._initialStatementCount++;
- }
-
- return c;
-}
-
-function* getDummyTempDatabase(name, extraOptions={}) {
- const TABLES = {
- dirs: "id INTEGER PRIMARY KEY AUTOINCREMENT, path TEXT",
- files: "id INTEGER PRIMARY KEY AUTOINCREMENT, dir_id INTEGER, path TEXT",
- };
-
- let c = yield getConnection(name, extraOptions);
- c._initialStatementCount = 0;
-
- for (let [k, v] of Object.entries(TABLES)) {
- yield c.execute("CREATE TEMP TABLE " + k + "(" + v + ")");
- c._initialStatementCount++;
- }
-
- return c;
-}
-
-function run_test() {
- Cu.import("resource://testing-common/services/common/logging.js");
- initTestLogging("Trace");
-
- run_next_test();
-}
-
-add_task(function* test_open_normal() {
- let c = yield Sqlite.openConnection({path: "test_open_normal.sqlite"});
- yield c.close();
-});
-
-add_task(function* test_open_unshared() {
- let path = OS.Path.join(OS.Constants.Path.profileDir, "test_open_unshared.sqlite");
-
- let c = yield Sqlite.openConnection({path: path, sharedMemoryCache: false});
- yield c.close();
-});
-
-add_task(function* test_get_dummy_database() {
- let db = yield getDummyDatabase("get_dummy_database");
-
- do_check_eq(typeof(db), "object");
- yield db.close();
-});
-
-add_task(function* test_schema_version() {
- let db = yield getDummyDatabase("schema_version");
-
- let version = yield db.getSchemaVersion();
- do_check_eq(version, 0);
-
- db.setSchemaVersion(14);
- version = yield db.getSchemaVersion();
- do_check_eq(version, 14);
-
- for (let v of [0.5, "foobar", NaN]) {
- let success;
- try {
- yield db.setSchemaVersion(v);
- do_print("Schema version " + v + " should have been rejected");
- success = false;
- } catch (ex) {
- if (!ex.message.startsWith("Schema version must be an integer."))
- throw ex;
- success = true;
- }
- do_check_true(success);
-
- version = yield db.getSchemaVersion();
- do_check_eq(version, 14);
- }
-
- yield db.close();
-});
-
-add_task(function* test_simple_insert() {
- let c = yield getDummyDatabase("simple_insert");
-
- let result = yield c.execute("INSERT INTO dirs VALUES (NULL, 'foo')");
- do_check_true(Array.isArray(result));
- do_check_eq(result.length, 0);
- yield c.close();
-});
-
-add_task(function* test_simple_bound_array() {
- let c = yield getDummyDatabase("simple_bound_array");
-
- let result = yield c.execute("INSERT INTO dirs VALUES (?, ?)", [1, "foo"]);
- do_check_eq(result.length, 0);
- yield c.close();
-});
-
-add_task(function* test_simple_bound_object() {
- let c = yield getDummyDatabase("simple_bound_object");
- let result = yield c.execute("INSERT INTO dirs VALUES (:id, :path)",
- {id: 1, path: "foo"});
- do_check_eq(result.length, 0);
- result = yield c.execute("SELECT id, path FROM dirs");
- do_check_eq(result.length, 1);
- do_check_eq(result[0].getResultByName("id"), 1);
- do_check_eq(result[0].getResultByName("path"), "foo");
- yield c.close();
-});
-
-// This is mostly a sanity test to ensure simple executions work.
-add_task(function* test_simple_insert_then_select() {
- let c = yield getDummyDatabase("simple_insert_then_select");
-
- yield c.execute("INSERT INTO dirs VALUES (NULL, 'foo')");
- yield c.execute("INSERT INTO dirs (path) VALUES (?)", ["bar"]);
-
- let result = yield c.execute("SELECT * FROM dirs");
- do_check_eq(result.length, 2);
-
- let i = 0;
- for (let row of result) {
- i++;
-
- do_check_eq(row.numEntries, 2);
- do_check_eq(row.getResultByIndex(0), i);
-
- let expected = {1: "foo", 2: "bar"}[i];
- do_check_eq(row.getResultByName("path"), expected);
- }
-
- yield c.close();
-});
-
-add_task(function* test_repeat_execution() {
- let c = yield getDummyDatabase("repeat_execution");
-
- let sql = "INSERT INTO dirs (path) VALUES (:path)";
- yield c.executeCached(sql, {path: "foo"});
- yield c.executeCached(sql);
-
- let result = yield c.execute("SELECT * FROM dirs");
-
- do_check_eq(result.length, 2);
-
- yield c.close();
-});
-
-add_task(function* test_table_exists() {
- let c = yield getDummyDatabase("table_exists");
-
- do_check_false(yield c.tableExists("does_not_exist"));
- do_check_true(yield c.tableExists("dirs"));
- do_check_true(yield c.tableExists("files"));
-
- yield c.close();
-});
-
-add_task(function* test_index_exists() {
- let c = yield getDummyDatabase("index_exists");
-
- do_check_false(yield c.indexExists("does_not_exist"));
-
- yield c.execute("CREATE INDEX my_index ON dirs (path)");
- do_check_true(yield c.indexExists("my_index"));
-
- yield c.close();
-});
-
-add_task(function* test_temp_table_exists() {
- let c = yield getDummyTempDatabase("temp_table_exists");
-
- do_check_false(yield c.tableExists("temp_does_not_exist"));
- do_check_true(yield c.tableExists("dirs"));
- do_check_true(yield c.tableExists("files"));
-
- yield c.close();
-});
-
-add_task(function* test_temp_index_exists() {
- let c = yield getDummyTempDatabase("temp_index_exists");
-
- do_check_false(yield c.indexExists("temp_does_not_exist"));
-
- yield c.execute("CREATE INDEX my_index ON dirs (path)");
- do_check_true(yield c.indexExists("my_index"));
-
- yield c.close();
-});
-
-add_task(function* test_close_cached() {
- let c = yield getDummyDatabase("close_cached");
-
- yield c.executeCached("SELECT * FROM dirs");
- yield c.executeCached("SELECT * FROM files");
-
- yield c.close();
-});
-
-add_task(function* test_execute_invalid_statement() {
- let c = yield getDummyDatabase("invalid_statement");
-
- let deferred = Promise.defer();
-
- do_check_eq(c._connectionData._anonymousStatements.size, 0);
-
- c.execute("SELECT invalid FROM unknown").then(do_throw, function onError(error) {
- deferred.resolve();
- });
-
- yield deferred.promise;
-
- // Ensure we don't leak the statement instance.
- do_check_eq(c._connectionData._anonymousStatements.size, 0);
-
- yield c.close();
-});
-
-add_task(function* test_incorrect_like_bindings() {
- let c = yield getDummyDatabase("incorrect_like_bindings");
-
- let sql = "select * from dirs where path LIKE 'non%'";
- Assert.throws(() => c.execute(sql), /Please enter a LIKE clause/);
- Assert.throws(() => c.executeCached(sql), /Please enter a LIKE clause/);
-
- yield c.close();
-});
-add_task(function* test_on_row_exception_ignored() {
- let c = yield getDummyDatabase("on_row_exception_ignored");
-
- let sql = "INSERT INTO dirs (path) VALUES (?)";
- for (let i = 0; i < 10; i++) {
- yield c.executeCached(sql, ["dir" + i]);
- }
-
- let i = 0;
- let hasResult = yield c.execute("SELECT * FROM DIRS", null, function onRow(row) {
- i++;
-
- throw new Error("Some silly error.");
- });
-
- do_check_eq(hasResult, true);
- do_check_eq(i, 10);
-
- yield c.close();
-});
-
-// Ensure StopIteration during onRow causes processing to stop.
-add_task(function* test_on_row_stop_iteration() {
- let c = yield getDummyDatabase("on_row_stop_iteration");
-
- let sql = "INSERT INTO dirs (path) VALUES (?)";
- for (let i = 0; i < 10; i++) {
- yield c.executeCached(sql, ["dir" + i]);
- }
-
- let i = 0;
- let hasResult = yield c.execute("SELECT * FROM dirs", null, function onRow(row) {
- i++;
-
- if (i == 5) {
- throw StopIteration;
- }
- });
-
- do_check_eq(hasResult, true);
- do_check_eq(i, 5);
-
- yield c.close();
-});
-
-// Ensure execute resolves to false when no rows are selected.
-add_task(function* test_on_row_stop_iteration() {
- let c = yield getDummyDatabase("no_on_row");
-
- let i = 0;
- let hasResult = yield c.execute(`SELECT * FROM dirs WHERE path="nonexistent"`, null, function onRow(row) {
- i++;
- });
-
- do_check_eq(hasResult, false);
- do_check_eq(i, 0);
-
- yield c.close();
-});
-
-add_task(function* test_invalid_transaction_type() {
- let c = yield getDummyDatabase("invalid_transaction_type");
-
- Assert.throws(() => c.executeTransaction(function* () {}, "foobar"),
- /Unknown transaction type/,
- "Unknown transaction type should throw");
-
- yield c.close();
-});
-
-add_task(function* test_execute_transaction_success() {
- let c = yield getDummyDatabase("execute_transaction_success");
-
- do_check_false(c.transactionInProgress);
-
- yield c.executeTransaction(function* transaction(conn) {
- do_check_eq(c, conn);
- do_check_true(conn.transactionInProgress);
-
- yield conn.execute("INSERT INTO dirs (path) VALUES ('foo')");
- });
-
- do_check_false(c.transactionInProgress);
- let rows = yield c.execute("SELECT * FROM dirs");
- do_check_true(Array.isArray(rows));
- do_check_eq(rows.length, 1);
-
- yield c.close();
-});
-
-add_task(function* test_execute_transaction_rollback() {
- let c = yield getDummyDatabase("execute_transaction_rollback");
-
- let deferred = Promise.defer();
-
- c.executeTransaction(function* transaction(conn) {
- yield conn.execute("INSERT INTO dirs (path) VALUES ('foo')");
- print("Expecting error with next statement.");
- yield conn.execute("INSERT INTO invalid VALUES ('foo')");
-
- // We should never get here.
- do_throw();
- }).then(do_throw, function onError(error) {
- deferred.resolve();
- });
-
- yield deferred.promise;
-
- let rows = yield c.execute("SELECT * FROM dirs");
- do_check_eq(rows.length, 0);
-
- yield c.close();
-});
-
-add_task(function* test_close_during_transaction() {
- let c = yield getDummyDatabase("close_during_transaction");
-
- yield c.execute("INSERT INTO dirs (path) VALUES ('foo')");
-
- let promise = c.executeTransaction(function* transaction(conn) {
- yield c.execute("INSERT INTO dirs (path) VALUES ('bar')");
- });
- yield c.close();
-
- yield Assert.rejects(promise,
- /Transaction canceled due to a closed connection/,
- "closing a connection in the middle of a transaction should reject it");
-
- let c2 = yield getConnection("close_during_transaction");
- let rows = yield c2.execute("SELECT * FROM dirs");
- do_check_eq(rows.length, 1);
-
- yield c2.close();
-});
-
-// Verify that we support concurrent transactions.
-add_task(function* test_multiple_transactions() {
- let c = yield getDummyDatabase("detect_multiple_transactions");
-
- for (let i = 0; i < 10; ++i) {
- // We don't wait for these transactions.
- c.executeTransaction(function* () {
- yield c.execute("INSERT INTO dirs (path) VALUES (:path)",
- { path: `foo${i}` });
- yield c.execute("SELECT * FROM dirs");
- });
- }
- for (let i = 0; i < 10; ++i) {
- yield c.executeTransaction(function* () {
- yield c.execute("INSERT INTO dirs (path) VALUES (:path)",
- { path: `bar${i}` });
- yield c.execute("SELECT * FROM dirs");
- });
- }
-
- let rows = yield c.execute("SELECT * FROM dirs");
- do_check_eq(rows.length, 20);
-
- yield c.close();
-});
-
-// Verify that wrapped transactions ignore a BEGIN TRANSACTION failure, when
-// an externally opened transaction exists.
-add_task(function* test_wrapped_connection_transaction() {
- let file = new FileUtils.File(OS.Path.join(OS.Constants.Path.profileDir,
- "test_wrapStorageConnection.sqlite"));
- let c = yield new Promise((resolve, reject) => {
- Services.storage.openAsyncDatabase(file, null, (status, db) => {
- if (Components.isSuccessCode(status)) {
- resolve(db.QueryInterface(Ci.mozIStorageAsyncConnection));
- } else {
- reject(new Error(status));
- }
- });
- });
-
- let wrapper = yield Sqlite.wrapStorageConnection({ connection: c });
- // Start a transaction on the raw connection.
- yield c.executeSimpleSQLAsync("BEGIN");
- // Now use executeTransaction, it will be executed, but not in a transaction.
- yield wrapper.executeTransaction(function* () {
- yield wrapper.execute("CREATE TABLE test (id INTEGER PRIMARY KEY AUTOINCREMENT)");
- });
- // This should not fail cause the internal transaction has not been created.
- yield c.executeSimpleSQLAsync("COMMIT");
-
- yield wrapper.execute("SELECT * FROM test");
-
- // Closing the wrapper should just finalize statements but not close the
- // database.
- yield wrapper.close();
- yield c.asyncClose();
-});
-
-add_task(function* test_shrink_memory() {
- let c = yield getDummyDatabase("shrink_memory");
-
- // It's just a simple sanity test. We have no way of measuring whether this
- // actually does anything.
-
- yield c.shrinkMemory();
- yield c.close();
-});
-
-add_task(function* test_no_shrink_on_init() {
- let c = yield getConnection("no_shrink_on_init",
- {shrinkMemoryOnConnectionIdleMS: 200});
-
- let oldShrink = c._connectionData.shrinkMemory;
- let count = 0;
- Object.defineProperty(c._connectionData, "shrinkMemory", {
- value: function () {
- count++;
- },
- });
-
- // We should not shrink until a statement has been executed.
- yield sleep(220);
- do_check_eq(count, 0);
-
- yield c.execute("SELECT 1");
- yield sleep(220);
- do_check_eq(count, 1);
-
- yield c.close();
-});
-
-add_task(function* test_idle_shrink_fires() {
- let c = yield getDummyDatabase("idle_shrink_fires",
- {shrinkMemoryOnConnectionIdleMS: 200});
- c._connectionData._clearIdleShrinkTimer();
-
- let oldShrink = c._connectionData.shrinkMemory;
- let shrinkPromises = [];
-
- let count = 0;
- Object.defineProperty(c._connectionData, "shrinkMemory", {
- value: function () {
- count++;
- let promise = oldShrink.call(c._connectionData);
- shrinkPromises.push(promise);
- return promise;
- },
- });
-
- // We reset the idle shrink timer after monkeypatching because otherwise the
- // installed timer callback will reference the non-monkeypatched function.
- c._connectionData._startIdleShrinkTimer();
-
- yield sleep(220);
- do_check_eq(count, 1);
- do_check_eq(shrinkPromises.length, 1);
- yield shrinkPromises[0];
- shrinkPromises.shift();
-
- // We shouldn't shrink again unless a statement was executed.
- yield sleep(300);
- do_check_eq(count, 1);
-
- yield c.execute("SELECT 1");
- yield sleep(300);
-
- do_check_eq(count, 2);
- do_check_eq(shrinkPromises.length, 1);
- yield shrinkPromises[0];
-
- yield c.close();
-});
-
-add_task(function* test_idle_shrink_reset_on_operation() {
- const INTERVAL = 500;
- let c = yield getDummyDatabase("idle_shrink_reset_on_operation",
- {shrinkMemoryOnConnectionIdleMS: INTERVAL});
-
- c._connectionData._clearIdleShrinkTimer();
-
- let oldShrink = c._connectionData.shrinkMemory;
- let shrinkPromises = [];
- let count = 0;
-
- Object.defineProperty(c._connectionData, "shrinkMemory", {
- value: function () {
- count++;
- let promise = oldShrink.call(c._connectionData);
- shrinkPromises.push(promise);
- return promise;
- },
- });
-
- let now = new Date();
- c._connectionData._startIdleShrinkTimer();
-
- let initialIdle = new Date(now.getTime() + INTERVAL);
-
- // Perform database operations until initial scheduled time has been passed.
- let i = 0;
- while (new Date() < initialIdle) {
- yield c.execute("INSERT INTO dirs (path) VALUES (?)", ["" + i]);
- i++;
- }
-
- do_check_true(i > 0);
-
- // We should not have performed an idle while doing operations.
- do_check_eq(count, 0);
-
- // Wait for idle timer.
- yield sleep(INTERVAL);
-
- // Ensure we fired.
- do_check_eq(count, 1);
- do_check_eq(shrinkPromises.length, 1);
- yield shrinkPromises[0];
-
- yield c.close();
-});
-
-add_task(function* test_in_progress_counts() {
- let c = yield getDummyDatabase("in_progress_counts");
- do_check_eq(c._connectionData._statementCounter, c._initialStatementCount);
- do_check_eq(c._connectionData._pendingStatements.size, 0);
- yield c.executeCached("INSERT INTO dirs (path) VALUES ('foo')");
- do_check_eq(c._connectionData._statementCounter, c._initialStatementCount + 1);
- do_check_eq(c._connectionData._pendingStatements.size, 0);
-
- let expectOne;
- let expectTwo;
-
- // Please forgive me.
- let inner = Async.makeSpinningCallback();
- let outer = Async.makeSpinningCallback();
-
- // We want to make sure that two queries executing simultaneously
- // result in `_pendingStatements.size` reaching 2, then dropping back to 0.
- //
- // To do so, we kick off a second statement within the row handler
- // of the first, then wait for both to finish.
-
- yield c.executeCached("SELECT * from dirs", null, function onRow() {
- // In the onRow handler, we're still an outstanding query.
- // Expect a single in-progress entry.
- expectOne = c._connectionData._pendingStatements.size;
-
- // Start another query, checking that after its statement has been created
- // there are two statements in progress.
- let p = c.executeCached("SELECT 10, path from dirs");
- expectTwo = c._connectionData._pendingStatements.size;
-
- // Now wait for it to be done before we return from the row handler …
- p.then(function onInner() {
- inner();
- });
- }).then(function onOuter() {
- // … and wait for the inner to be done before we finish …
- inner.wait();
- outer();
- });
-
- // … and wait for both queries to have finished before we go on and
- // test postconditions.
- outer.wait();
-
- do_check_eq(expectOne, 1);
- do_check_eq(expectTwo, 2);
- do_check_eq(c._connectionData._statementCounter, c._initialStatementCount + 3);
- do_check_eq(c._connectionData._pendingStatements.size, 0);
-
- yield c.close();
-});
-
-add_task(function* test_discard_while_active() {
- let c = yield getDummyDatabase("discard_while_active");
-
- yield c.executeCached("INSERT INTO dirs (path) VALUES ('foo')");
- yield c.executeCached("INSERT INTO dirs (path) VALUES ('bar')");
-
- let discarded = -1;
- let first = true;
- let sql = "SELECT * FROM dirs";
- yield c.executeCached(sql, null, function onRow(row) {
- if (!first) {
- return;
- }
- first = false;
- discarded = c.discardCachedStatements();
- });
-
- // We discarded everything, because the SELECT had already started to run.
- do_check_eq(3, discarded);
-
- // And again is safe.
- do_check_eq(0, c.discardCachedStatements());
-
- yield c.close();
-});
-
-add_task(function* test_discard_cached() {
- let c = yield getDummyDatabase("discard_cached");
-
- yield c.executeCached("SELECT * from dirs");
- do_check_eq(1, c._connectionData._cachedStatements.size);
-
- yield c.executeCached("SELECT * from files");
- do_check_eq(2, c._connectionData._cachedStatements.size);
-
- yield c.executeCached("SELECT * from dirs");
- do_check_eq(2, c._connectionData._cachedStatements.size);
-
- c.discardCachedStatements();
- do_check_eq(0, c._connectionData._cachedStatements.size);
-
- yield c.close();
-});
-
-add_task(function* test_programmatic_binding() {
- let c = yield getDummyDatabase("programmatic_binding");
-
- let bindings = [
- {id: 1, path: "foobar"},
- {id: null, path: "baznoo"},
- {id: 5, path: "toofoo"},
- ];
-
- let sql = "INSERT INTO dirs VALUES (:id, :path)";
- let result = yield c.execute(sql, bindings);
- do_check_eq(result.length, 0);
-
- let rows = yield c.executeCached("SELECT * from dirs");
- do_check_eq(rows.length, 3);
- yield c.close();
-});
-
-add_task(function* test_programmatic_binding_transaction() {
- let c = yield getDummyDatabase("programmatic_binding_transaction");
-
- let bindings = [
- {id: 1, path: "foobar"},
- {id: null, path: "baznoo"},
- {id: 5, path: "toofoo"},
- ];
-
- let sql = "INSERT INTO dirs VALUES (:id, :path)";
- yield c.executeTransaction(function* transaction() {
- let result = yield c.execute(sql, bindings);
- do_check_eq(result.length, 0);
-
- let rows = yield c.executeCached("SELECT * from dirs");
- do_check_eq(rows.length, 3);
- });
-
- // Transaction committed.
- let rows = yield c.executeCached("SELECT * from dirs");
- do_check_eq(rows.length, 3);
- yield c.close();
-});
-
-add_task(function* test_programmatic_binding_transaction_partial_rollback() {
- let c = yield getDummyDatabase("programmatic_binding_transaction_partial_rollback");
-
- let bindings = [
- {id: 2, path: "foobar"},
- {id: 3, path: "toofoo"},
- ];
-
- let sql = "INSERT INTO dirs VALUES (:id, :path)";
-
- // Add some data in an implicit transaction before beginning the batch insert.
- yield c.execute(sql, {id: 1, path: "works"});
-
- let secondSucceeded = false;
- try {
- yield c.executeTransaction(function* transaction() {
- // Insert one row. This won't implicitly start a transaction.
- let result = yield c.execute(sql, bindings[0]);
-
- // Insert multiple rows. mozStorage will want to start a transaction.
- // One of the inserts will fail, so the transaction should be rolled back.
- result = yield c.execute(sql, bindings);
- secondSucceeded = true;
- });
- } catch (ex) {
- print("Caught expected exception: " + ex);
- }
-
- // We did not get to the end of our in-transaction block.
- do_check_false(secondSucceeded);
-
- // Everything that happened in *our* transaction, not mozStorage's, got
- // rolled back, but the first row still exists.
- let rows = yield c.executeCached("SELECT * from dirs");
- do_check_eq(rows.length, 1);
- do_check_eq(rows[0].getResultByName("path"), "works");
- yield c.close();
-});
-
-// Just like the previous test, but relying on the implicit
-// transaction established by mozStorage.
-add_task(function* test_programmatic_binding_implicit_transaction() {
- let c = yield getDummyDatabase("programmatic_binding_implicit_transaction");
-
- let bindings = [
- {id: 2, path: "foobar"},
- {id: 1, path: "toofoo"},
- ];
-
- let sql = "INSERT INTO dirs VALUES (:id, :path)";
- let secondSucceeded = false;
- yield c.execute(sql, {id: 1, path: "works"});
- try {
- let result = yield c.execute(sql, bindings);
- secondSucceeded = true;
- } catch (ex) {
- print("Caught expected exception: " + ex);
- }
-
- do_check_false(secondSucceeded);
-
- // The entire batch failed.
- let rows = yield c.executeCached("SELECT * from dirs");
- do_check_eq(rows.length, 1);
- do_check_eq(rows[0].getResultByName("path"), "works");
- yield c.close();
-});
-
-// Test that direct binding of params and execution through mozStorage doesn't
-// error when we manually create a transaction. See Bug 856925.
-add_task(function* test_direct() {
- let file = FileUtils.getFile("TmpD", ["test_direct.sqlite"]);
- file.createUnique(Ci.nsIFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE);
- print("Opening " + file.path);
-
- let db = Services.storage.openDatabase(file);
- print("Opened " + db);
-
- db.executeSimpleSQL("CREATE TABLE types (id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, UNIQUE (name))");
- print("Executed setup.");
-
- let statement = db.createAsyncStatement("INSERT INTO types (name) VALUES (:name)");
- let params = statement.newBindingParamsArray();
- let one = params.newBindingParams();
- one.bindByName("name", null);
- params.addParams(one);
- let two = params.newBindingParams();
- two.bindByName("name", "bar");
- params.addParams(two);
-
- print("Beginning transaction.");
- let begin = db.createAsyncStatement("BEGIN DEFERRED TRANSACTION");
- let end = db.createAsyncStatement("COMMIT TRANSACTION");
-
- let deferred = Promise.defer();
- begin.executeAsync({
- handleCompletion: function (reason) {
- deferred.resolve();
- }
- });
- yield deferred.promise;
-
- statement.bindParameters(params);
-
- deferred = Promise.defer();
- print("Executing async.");
- statement.executeAsync({
- handleResult: function (resultSet) {
- },
-
- handleError: function (error) {
- print("Error when executing SQL (" + error.result + "): " +
- error.message);
- print("Original error: " + error.error);
- errors.push(error);
- deferred.reject();
- },
-
- handleCompletion: function (reason) {
- print("Completed.");
- deferred.resolve();
- }
- });
-
- yield deferred.promise;
-
- deferred = Promise.defer();
- end.executeAsync({
- handleCompletion: function (reason) {
- deferred.resolve();
- }
- });
- yield deferred.promise;
-
- statement.finalize();
- begin.finalize();
- end.finalize();
-
- deferred = Promise.defer();
- db.asyncClose(function () {
- deferred.resolve()
- });
- yield deferred.promise;
-});
-
-// Test Sqlite.cloneStorageConnection.
-add_task(function* test_cloneStorageConnection() {
- let file = new FileUtils.File(OS.Path.join(OS.Constants.Path.profileDir,
- "test_cloneStorageConnection.sqlite"));
- let c = yield new Promise((resolve, reject) => {
- Services.storage.openAsyncDatabase(file, null, (status, db) => {
- if (Components.isSuccessCode(status)) {
- resolve(db.QueryInterface(Ci.mozIStorageAsyncConnection));
- } else {
- reject(new Error(status));
- }
- });
- });
-
- let clone = yield Sqlite.cloneStorageConnection({ connection: c, readOnly: true });
- // Just check that it works.
- yield clone.execute("SELECT 1");
-
- let clone2 = yield Sqlite.cloneStorageConnection({ connection: c, readOnly: false });
- // Just check that it works.
- yield clone2.execute("CREATE TABLE test (id INTEGER PRIMARY KEY)");
-
- // Closing order should not matter.
- yield c.asyncClose();
- yield clone2.close();
- yield clone.close();
-});
-
-// Test Sqlite.cloneStorageConnection invalid argument.
-add_task(function* test_cloneStorageConnection() {
- try {
- let clone = yield Sqlite.cloneStorageConnection({ connection: null });
- do_throw(new Error("Should throw on invalid connection"));
- } catch (ex) {
- if (ex.name != "TypeError") {
- throw ex;
- }
- }
-});
-
-// Test clone() method.
-add_task(function* test_clone() {
- let c = yield getDummyDatabase("clone");
-
- let clone = yield c.clone();
- // Just check that it works.
- yield clone.execute("SELECT 1");
- // Closing order should not matter.
- yield c.close();
- yield clone.close();
-});
-
-// Test clone(readOnly) method.
-add_task(function* test_readOnly_clone() {
- let path = OS.Path.join(OS.Constants.Path.profileDir, "test_readOnly_clone.sqlite");
- let c = yield Sqlite.openConnection({path: path, sharedMemoryCache: false});
-
- let clone = yield c.clone(true);
- // Just check that it works.
- yield clone.execute("SELECT 1");
- // But should not be able to write.
-
- yield Assert.rejects(clone.execute("CREATE TABLE test (id INTEGER PRIMARY KEY)"),
- /readonly/);
- // Closing order should not matter.
- yield c.close();
- yield clone.close();
-});
-
-// Test Sqlite.wrapStorageConnection.
-add_task(function* test_wrapStorageConnection() {
- let file = new FileUtils.File(OS.Path.join(OS.Constants.Path.profileDir,
- "test_wrapStorageConnection.sqlite"));
- let c = yield new Promise((resolve, reject) => {
- Services.storage.openAsyncDatabase(file, null, (status, db) => {
- if (Components.isSuccessCode(status)) {
- resolve(db.QueryInterface(Ci.mozIStorageAsyncConnection));
- } else {
- reject(new Error(status));
- }
- });
- });
-
- let wrapper = yield Sqlite.wrapStorageConnection({ connection: c });
- // Just check that it works.
- yield wrapper.execute("SELECT 1");
- yield wrapper.executeCached("SELECT 1");
-
- // Closing the wrapper should just finalize statements but not close the
- // database.
- yield wrapper.close();
- yield c.asyncClose();
-});
-
-// Test finalization
-add_task(function* test_closed_by_witness() {
- failTestsOnAutoClose(false);
- let c = yield getDummyDatabase("closed_by_witness");
-
- Services.obs.notifyObservers(null, "sqlite-finalization-witness",
- c._connectionData._identifier);
- // Since we triggered finalization ourselves, tell the witness to
- // forget the connection so it does not trigger a finalization again
- c._witness.forget();
- yield c._connectionData._deferredClose.promise;
- do_check_false(c._connectionData._open);
- failTestsOnAutoClose(true);
-});
-
-add_task(function* test_warning_message_on_finalization() {
- failTestsOnAutoClose(false);
- let c = yield getDummyDatabase("warning_message_on_finalization");
- let identifier = c._connectionData._identifier;
- let deferred = Promise.defer();
-
- let listener = {
- observe: function(msg) {
- let messageText = msg.message;
- // Make sure the message starts with a warning containing the
- // connection identifier
- if (messageText.indexOf("Warning: Sqlite connection '" + identifier + "'") !== -1) {
- deferred.resolve();
- }
- }
- };
- Services.console.registerListener(listener);
-
- Services.obs.notifyObservers(null, "sqlite-finalization-witness", identifier);
- // Since we triggered finalization ourselves, tell the witness to
- // forget the connection so it does not trigger a finalization again
- c._witness.forget();
-
- yield deferred.promise;
- Services.console.unregisterListener(listener);
- failTestsOnAutoClose(true);
-});
-
-add_task(function* test_error_message_on_unknown_finalization() {
- failTestsOnAutoClose(false);
- let deferred = Promise.defer();
-
- let listener = {
- observe: function(msg) {
- let messageText = msg.message;
- if (messageText.indexOf("Error: Attempt to finalize unknown " +
- "Sqlite connection: foo") !== -1) {
- deferred.resolve();
- }
- }
- };
- Services.console.registerListener(listener);
- Services.obs.notifyObservers(null, "sqlite-finalization-witness", "foo");
-
- yield deferred.promise;
- Services.console.unregisterListener(listener);
- failTestsOnAutoClose(true);
-});
-
-add_task(function* test_forget_witness_on_close() {
- let c = yield getDummyDatabase("forget_witness_on_close");
-
- let forgetCalled = false;
- let oldWitness = c._witness;
- c._witness = {
- forget: function () {
- forgetCalled = true;
- oldWitness.forget();
- },
- };
-
- yield c.close();
- // After close, witness should have forgotten the connection
- do_check_true(forgetCalled);
-});
-
-add_task(function* test_close_database_on_gc() {
- failTestsOnAutoClose(false);
- let finalPromise;
-
- {
- let collectedPromises = [];
- for (let i = 0; i < 100; ++i) {
- let deferred = PromiseUtils.defer();
- let c = yield getDummyDatabase("gc_" + i);
- c._connectionData._deferredClose.promise.then(deferred.resolve);
- collectedPromises.push(deferred.promise);
- }
- finalPromise = Promise.all(collectedPromises);
- }
-
- // Call getDummyDatabase once more to clear any remaining
- // references. This is needed at the moment, otherwise
- // garbage-collection takes place after the shutdown barrier and the
- // test will timeout. Once that is fixed, we can remove this line
- // and be fine as long as the connections are garbage-collected.
- let last = yield getDummyDatabase("gc_last");
- yield last.close();
-
- Components.utils.forceGC();
- Components.utils.forceCC();
- Components.utils.forceShrinkingGC();
-
- yield finalPromise;
- failTestsOnAutoClose(true);
-});
diff --git a/toolkit/modules/tests/xpcshell/test_sqlite_shutdown.js b/toolkit/modules/tests/xpcshell/test_sqlite_shutdown.js
deleted file mode 100644
index b97fd8558..000000000
--- a/toolkit/modules/tests/xpcshell/test_sqlite_shutdown.js
+++ /dev/null
@@ -1,122 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
-
-do_get_profile();
-
-Cu.import("resource://gre/modules/osfile.jsm");
- // OS.File doesn't like to be first imported during shutdown
-Cu.import("resource://gre/modules/Sqlite.jsm");
-Cu.import("resource://gre/modules/Task.jsm");
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AsyncShutdown.jsm");
-Cu.import("resource://gre/modules/Promise.jsm");
-
-function getConnection(dbName, extraOptions={}) {
- let path = dbName + ".sqlite";
- let options = {path: path};
- for (let [k, v] of Object.entries(extraOptions)) {
- options[k] = v;
- }
-
- return Sqlite.openConnection(options);
-}
-
-function* getDummyDatabase(name, extraOptions={}) {
- const TABLES = {
- dirs: "id INTEGER PRIMARY KEY AUTOINCREMENT, path TEXT",
- files: "id INTEGER PRIMARY KEY AUTOINCREMENT, dir_id INTEGER, path TEXT",
- };
-
- let c = yield getConnection(name, extraOptions);
- c._initialStatementCount = 0;
-
- for (let [k, v] of Object.entries(TABLES)) {
- yield c.execute("CREATE TABLE " + k + "(" + v + ")");
- c._initialStatementCount++;
- }
-
- return c;
-}
-
-function sleep(ms) {
- let deferred = Promise.defer();
-
- let timer = Cc["@mozilla.org/timer;1"]
- .createInstance(Ci.nsITimer);
-
- timer.initWithCallback({
- notify: function () {
- deferred.resolve();
- },
- }, ms, timer.TYPE_ONE_SHOT);
-
- return deferred.promise;
-}
-
-function run_test() {
- run_next_test();
-}
-
-
-//
-// ----------- Don't add a test after this one, as it shuts down Sqlite.jsm
-//
-add_task(function* test_shutdown_clients() {
- do_print("Ensuring that Sqlite.jsm doesn't shutdown before its clients");
-
- let assertions = [];
-
- let sleepStarted = false;
- let sleepComplete = false;
- Sqlite.shutdown.addBlocker("test_sqlite.js shutdown blocker (sleep)",
- Task.async(function*() {
- sleepStarted = true;
- yield sleep(100);
- sleepComplete = true;
- }));
- assertions.push({name: "sleepStarted", value: () => sleepStarted});
- assertions.push({name: "sleepComplete", value: () => sleepComplete});
-
- Sqlite.shutdown.addBlocker("test_sqlite.js shutdown blocker (immediate)",
- true);
-
- let dbOpened = false;
- let dbClosed = false;
-
- Sqlite.shutdown.addBlocker("test_sqlite.js shutdown blocker (open a connection during shutdown)",
- Task.async(function*() {
- let db = yield getDummyDatabase("opened during shutdown");
- dbOpened = true;
- db.close().then(
- () => dbClosed = true
- ); // Don't wait for this task to complete, Sqlite.jsm must wait automatically
- }));
-
- assertions.push({name: "dbOpened", value: () => dbOpened});
- assertions.push({name: "dbClosed", value: () => dbClosed});
-
- do_print("Now shutdown Sqlite.jsm synchronously");
- Services.prefs.setBoolPref("toolkit.asyncshutdown.testing", true);
- AsyncShutdown.profileBeforeChange._trigger();
- Services.prefs.clearUserPref("toolkit.asyncshutdown.testing");
-
-
- for (let {name, value} of assertions) {
- do_print("Checking: " + name);
- do_check_true(value());
- }
-
- do_print("Ensure that we cannot open databases anymore");
- let exn;
- try {
- yield getDummyDatabase("opened after shutdown");
- } catch (ex) {
- exn = ex;
- }
- do_check_true(!!exn);
- do_check_true(exn.message.indexOf("Sqlite.jsm has been shutdown") != -1);
-});
diff --git a/toolkit/modules/tests/xpcshell/test_task.js b/toolkit/modules/tests/xpcshell/test_task.js
deleted file mode 100644
index fdcd56514..000000000
--- a/toolkit/modules/tests/xpcshell/test_task.js
+++ /dev/null
@@ -1,642 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
-/**
- * This file tests the Task.jsm module.
- */
-
-////////////////////////////////////////////////////////////////////////////////
-/// Globals
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
- "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Services",
- "resource://gre/modules/Services.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
- "resource://gre/modules/Task.jsm");
-
-/**
- * Returns a promise that will be resolved with the given value, when an event
- * posted on the event loop of the main thread is processed.
- */
-function promiseResolvedLater(aValue) {
- let deferred = Promise.defer();
- Services.tm.mainThread.dispatch(() => deferred.resolve(aValue),
- Ci.nsIThread.DISPATCH_NORMAL);
- return deferred.promise;
-}
-
-////////////////////////////////////////////////////////////////////////////////
-/// Tests
-
-function run_test()
-{
- run_next_test();
-}
-
-add_test(function test_normal()
-{
- Task.spawn(function () {
- let result = yield Promise.resolve("Value");
- for (let i = 0; i < 3; i++) {
- result += yield promiseResolvedLater("!");
- }
- throw new Task.Result("Task result: " + result);
- }).then(function (result) {
- do_check_eq("Task result: Value!!!", result);
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_exceptions()
-{
- Task.spawn(function () {
- try {
- yield Promise.reject("Rejection result by promise.");
- do_throw("Exception expected because the promise was rejected.");
- } catch (ex) {
- // We catch this exception now, we will throw a different one later.
- do_check_eq("Rejection result by promise.", ex);
- }
- throw new Error("Exception uncaught by task.");
- }).then(function (result) {
- do_throw("Unexpected success!");
- }, function (ex) {
- do_check_eq("Exception uncaught by task.", ex.message);
- run_next_test();
- });
-});
-
-add_test(function test_recursion()
-{
- function task_fibonacci(n) {
- throw new Task.Result(n < 2 ? n : (yield task_fibonacci(n - 1)) +
- (yield task_fibonacci(n - 2)));
- };
-
- Task.spawn(task_fibonacci(6)).then(function (result) {
- do_check_eq(8, result);
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_spawn_primitive()
-{
- function fibonacci(n) {
- return n < 2 ? n : fibonacci(n - 1) + fibonacci(n - 2);
- };
-
- // Polymorphism between task and non-task functions (see "test_recursion").
- Task.spawn(fibonacci(6)).then(function (result) {
- do_check_eq(8, result);
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_spawn_function()
-{
- Task.spawn(function () {
- return "This is not a generator.";
- }).then(function (result) {
- do_check_eq("This is not a generator.", result);
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_spawn_function_this()
-{
- Task.spawn(function () {
- return this;
- }).then(function (result) {
- // Since the task function wasn't defined in strict mode, its "this" object
- // should be the same as the "this" object in this function, i.e. the global
- // object.
- do_check_eq(result, this);
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_spawn_function_this_strict()
-{
- "use strict";
- Task.spawn(function () {
- return this;
- }).then(function (result) {
- // Since the task function was defined in strict mode, its "this" object
- // should be undefined.
- do_check_eq(typeof(result), "undefined");
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_spawn_function_returning_promise()
-{
- Task.spawn(function () {
- return promiseResolvedLater("Resolution value.");
- }).then(function (result) {
- do_check_eq("Resolution value.", result);
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_spawn_function_exceptions()
-{
- Task.spawn(function () {
- throw new Error("Exception uncaught by task.");
- }).then(function (result) {
- do_throw("Unexpected success!");
- }, function (ex) {
- do_check_eq("Exception uncaught by task.", ex.message);
- run_next_test();
- });
-});
-
-add_test(function test_spawn_function_taskresult()
-{
- Task.spawn(function () {
- throw new Task.Result("Task result");
- }).then(function (result) {
- do_check_eq("Task result", result);
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_yielded_undefined()
-{
- Task.spawn(function () {
- yield;
- throw new Task.Result("We continued correctly.");
- }).then(function (result) {
- do_check_eq("We continued correctly.", result);
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_yielded_primitive()
-{
- Task.spawn(function () {
- throw new Task.Result("Primitive " + (yield "value."));
- }).then(function (result) {
- do_check_eq("Primitive value.", result);
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_star_normal()
-{
- Task.spawn(function* () {
- let result = yield Promise.resolve("Value");
- for (let i = 0; i < 3; i++) {
- result += yield promiseResolvedLater("!");
- }
- return "Task result: " + result;
- }).then(function (result) {
- do_check_eq("Task result: Value!!!", result);
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_star_exceptions()
-{
- Task.spawn(function* () {
- try {
- yield Promise.reject("Rejection result by promise.");
- do_throw("Exception expected because the promise was rejected.");
- } catch (ex) {
- // We catch this exception now, we will throw a different one later.
- do_check_eq("Rejection result by promise.", ex);
- }
- throw new Error("Exception uncaught by task.");
- }).then(function (result) {
- do_throw("Unexpected success!");
- }, function (ex) {
- do_check_eq("Exception uncaught by task.", ex.message);
- run_next_test();
- });
-});
-
-add_test(function test_star_recursion()
-{
- function* task_fibonacci(n) {
- return n < 2 ? n : (yield task_fibonacci(n - 1)) +
- (yield task_fibonacci(n - 2));
- };
-
- Task.spawn(task_fibonacci(6)).then(function (result) {
- do_check_eq(8, result);
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_mixed_legacy_and_star()
-{
- Task.spawn(function* () {
- return yield (function() {
- throw new Task.Result(yield 5);
- })();
- }).then(function (result) {
- do_check_eq(5, result);
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_async_function_from_generator()
-{
- Task.spawn(function* () {
- let object = {
- asyncFunction: Task.async(function* (param) {
- do_check_eq(this, object);
- return param;
- })
- };
-
- // Ensure the async function returns a promise that resolves as expected.
- do_check_eq((yield object.asyncFunction(1)), 1);
-
- // Ensure a second call to the async function also returns such a promise.
- do_check_eq((yield object.asyncFunction(3)), 3);
- }).then(function () {
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_async_function_from_function()
-{
- Task.spawn(function* () {
- return Task.spawn(function* () {
- let object = {
- asyncFunction: Task.async(function (param) {
- do_check_eq(this, object);
- return param;
- })
- };
-
- // Ensure the async function returns a promise that resolves as expected.
- do_check_eq((yield object.asyncFunction(5)), 5);
-
- // Ensure a second call to the async function also returns such a promise.
- do_check_eq((yield object.asyncFunction(7)), 7);
- });
- }).then(function () {
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_async_function_that_throws_rejects_promise()
-{
- Task.spawn(function* () {
- let object = {
- asyncFunction: Task.async(function* () {
- throw "Rejected!";
- })
- };
-
- yield object.asyncFunction();
- }).then(function () {
- do_throw("unexpected success calling async function that throws error");
- }, function (ex) {
- do_check_eq(ex, "Rejected!");
- run_next_test();
- });
-});
-
-add_test(function test_async_return_function()
-{
- Task.spawn(function* () {
- // Ensure an async function that returns a function resolves to the function
- // itself instead of calling the function and resolving to its return value.
- return Task.spawn(function* () {
- let returnValue = function () {
- return "These aren't the droids you're looking for.";
- };
-
- let asyncFunction = Task.async(function () {
- return returnValue;
- });
-
- do_check_eq((yield asyncFunction()), returnValue);
- });
- }).then(function () {
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_async_throw_argument_not_function()
-{
- Task.spawn(function* () {
- // Ensure Task.async throws if its aTask argument is not a function.
- Assert.throws(() => Task.async("not a function"),
- /aTask argument must be a function/);
- }).then(function () {
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-add_test(function test_async_throw_on_function_in_place_of_promise()
-{
- Task.spawn(function* () {
- // Ensure Task.spawn throws if passed an async function.
- Assert.throws(() => Task.spawn(Task.async(function* () {})),
- /Cannot use an async function in place of a promise/);
- }).then(function () {
- run_next_test();
- }, function (ex) {
- do_throw("Unexpected error: " + ex);
- });
-});
-
-
-////////////////// Test rewriting of stack traces
-
-// Backup Task.Debuggin.maintainStack.
-// Will be restored by `exit_stack_tests`.
-var maintainStack;
-add_test(function enter_stack_tests() {
- maintainStack = Task.Debugging.maintainStack;
- Task.Debugging.maintainStack = true;
- run_next_test();
-});
-
-
-/**
- * Ensure that a list of frames appear in a stack, in the right order
- */
-function do_check_rewritten_stack(frames, ex) {
- do_print("Checking that the expected frames appear in the right order");
- do_print(frames.join(", "));
- let stack = ex.stack;
- do_print(stack);
-
- let framesFound = 0;
- let lineNumber = 0;
- let reLine = /([^\r\n])+/g;
- let match;
- while (framesFound < frames.length && (match = reLine.exec(stack))) {
- let line = match[0];
- let frame = frames[framesFound];
- do_print("Searching for " + frame + " in line " + line);
- if (line.indexOf(frame) != -1) {
- do_print("Found " + frame);
- ++framesFound;
- } else {
- do_print("Didn't find " + frame);
- }
- }
-
- if (framesFound >= frames.length) {
- return;
- }
- do_throw("Did not find: " + frames.slice(framesFound).join(", ") +
- " in " + stack.substr(reLine.lastIndex));
-
- do_print("Ensuring that we have removed Task.jsm, Promise.jsm");
- do_check_true(stack.indexOf("Task.jsm") == -1);
- do_check_true(stack.indexOf("Promise.jsm") == -1);
- do_check_true(stack.indexOf("Promise-backend.js") == -1);
-}
-
-
-// Test that we get an acceptable rewritten stack when we launch
-// an error in a Task.spawn.
-add_test(function test_spawn_throw_stack() {
- Task.spawn(function* task_spawn_throw_stack() {
- for (let i = 0; i < 5; ++i) {
- yield Promise.resolve(); // Without stack rewrite, this would lose valuable information
- }
- throw new Error("BOOM");
- }).then(do_throw, function(ex) {
- do_check_rewritten_stack(["task_spawn_throw_stack",
- "test_spawn_throw_stack"],
- ex);
- run_next_test();
- });
-});
-
-// Test that we get an acceptable rewritten stack when we yield
-// a rejection in a Task.spawn.
-add_test(function test_spawn_yield_reject_stack() {
- Task.spawn(function* task_spawn_yield_reject_stack() {
- for (let i = 0; i < 5; ++i) {
- yield Promise.resolve(); // Without stack rewrite, this would lose valuable information
- }
- yield Promise.reject(new Error("BOOM"));
- }).then(do_throw, function(ex) {
- do_check_rewritten_stack(["task_spawn_yield_reject_stack",
- "test_spawn_yield_reject_stack"],
- ex);
- run_next_test();
- });
-});
-
-// Test that we get an acceptable rewritten stack when we launch
-// an error in a Task.async function.
-add_test(function test_async_function_throw_stack() {
- let task_async_function_throw_stack = Task.async(function*() {
- for (let i = 0; i < 5; ++i) {
- yield Promise.resolve(); // Without stack rewrite, this would lose valuable information
- }
- throw new Error("BOOM");
- })().then(do_throw, function(ex) {
- do_check_rewritten_stack(["task_async_function_throw_stack",
- "test_async_function_throw_stack"],
- ex);
- run_next_test();
- });
-});
-
-// Test that we get an acceptable rewritten stack when we launch
-// an error in a Task.async function.
-add_test(function test_async_function_yield_reject_stack() {
- let task_async_function_yield_reject_stack = Task.async(function*() {
- for (let i = 0; i < 5; ++i) {
- yield Promise.resolve(); // Without stack rewrite, this would lose valuable information
- }
- yield Promise.reject(new Error("BOOM"));
- })().then(do_throw, function(ex) {
- do_check_rewritten_stack(["task_async_function_yield_reject_stack",
- "test_async_function_yield_reject_stack"],
- ex);
- run_next_test();
- });
-});
-
-// Test that we get an acceptable rewritten stack when we launch
-// an error in a Task.async function.
-add_test(function test_async_method_throw_stack() {
- let object = {
- task_async_method_throw_stack: Task.async(function*() {
- for (let i = 0; i < 5; ++i) {
- yield Promise.resolve(); // Without stack rewrite, this would lose valuable information
- }
- throw new Error("BOOM");
- })
- };
- object.task_async_method_throw_stack().then(do_throw, function(ex) {
- do_check_rewritten_stack(["task_async_method_throw_stack",
- "test_async_method_throw_stack"],
- ex);
- run_next_test();
- });
-});
-
-// Test that we get an acceptable rewritten stack when we launch
-// an error in a Task.async function.
-add_test(function test_async_method_yield_reject_stack() {
- let object = {
- task_async_method_yield_reject_stack: Task.async(function*() {
- for (let i = 0; i < 5; ++i) {
- yield Promise.resolve(); // Without stack rewrite, this would lose valuable information
- }
- yield Promise.reject(new Error("BOOM"));
- })
- };
- object.task_async_method_yield_reject_stack().then(do_throw, function(ex) {
- do_check_rewritten_stack(["task_async_method_yield_reject_stack",
- "test_async_method_yield_reject_stack"],
- ex);
- run_next_test();
- });
-});
-
-// Test that two tasks whose execution takes place interleaved do not capture each other's stack.
-add_test(function test_throw_stack_do_not_capture_the_wrong_task() {
- for (let iter_a of [3, 4, 5]) { // Vary the interleaving
- for (let iter_b of [3, 4, 5]) {
- Task.spawn(function* task_a() {
- for (let i = 0; i < iter_a; ++i) {
- yield Promise.resolve();
- }
- throw new Error("BOOM");
- }).then(do_throw, function(ex) {
- do_check_rewritten_stack(["task_a",
- "test_throw_stack_do_not_capture_the_wrong_task"],
- ex);
- do_check_true(!ex.stack.includes("task_b"));
- run_next_test();
- });
- Task.spawn(function* task_b() {
- for (let i = 0; i < iter_b; ++i) {
- yield Promise.resolve();
- }
- });
- }
- }
-});
-
-// Put things together
-add_test(function test_throw_complex_stack()
-{
- // Setup the following stack:
- // inner_method()
- // task_3()
- // task_2()
- // task_1()
- // function_3()
- // function_2()
- // function_1()
- // test_throw_complex_stack()
- (function function_1() {
- return (function function_2() {
- return (function function_3() {
- return Task.spawn(function* task_1() {
- yield Promise.resolve();
- try {
- yield Task.spawn(function* task_2() {
- yield Promise.resolve();
- yield Task.spawn(function* task_3() {
- yield Promise.resolve();
- let inner_object = {
- inner_method: Task.async(function*() {
- throw new Error("BOOM");
- })
- };
- yield Promise.resolve();
- yield inner_object.inner_method();
- });
- });
- } catch (ex) {
- yield Promise.resolve();
- throw ex;
- }
- });
- })();
- })();
- })().then(
- () => do_throw("Shouldn't have succeeded"),
- (ex) => {
- let expect = ["inner_method",
- "task_3",
- "task_2",
- "task_1",
- "function_3",
- "function_2",
- "function_1",
- "test_throw_complex_stack"];
- do_check_rewritten_stack(expect, ex);
-
- run_next_test();
- });
-});
-
-add_test(function test_without_maintainStack() {
- do_print("Calling generateReadableStack without a Task");
- Task.Debugging.generateReadableStack(new Error("Not a real error"));
-
- Task.Debugging.maintainStack = false;
-
- do_print("Calling generateReadableStack with neither a Task nor maintainStack");
- Task.Debugging.generateReadableStack(new Error("Not a real error"));
-
- do_print("Calling generateReadableStack without maintainStack");
- Task.spawn(function*() {
- Task.Debugging.generateReadableStack(new Error("Not a real error"));
- run_next_test();
- });
-});
-
-add_test(function exit_stack_tests() {
- Task.Debugging.maintainStack = maintainStack;
- run_next_test();
-});
-
diff --git a/toolkit/modules/tests/xpcshell/test_timer.js b/toolkit/modules/tests/xpcshell/test_timer.js
deleted file mode 100644
index 57e300663..000000000
--- a/toolkit/modules/tests/xpcshell/test_timer.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-// Tests exports from Timer.jsm
-
-var imported = {};
-Components.utils.import("resource://gre/modules/Timer.jsm", imported);
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function* test_setTimeout() {
- let timeout1 = imported.setTimeout(() => do_throw("Should not be called"), 100);
- do_check_eq(typeof timeout1, "number", "setTimeout returns a number");
- do_check_true(timeout1 > 0, "setTimeout returns a positive number");
-
- imported.clearTimeout(timeout1);
-
- yield new Promise((resolve) => {
- let timeout2 = imported.setTimeout((param1, param2) => {
- do_check_true(true, "Should be called");
- do_check_eq(param1, 5, "first parameter is correct");
- do_check_eq(param2, "test", "second parameter is correct");
- resolve();
- }, 100, 5, "test");
-
- do_check_eq(typeof timeout2, "number", "setTimeout returns a number");
- do_check_true(timeout2 > 0, "setTimeout returns a positive number");
- do_check_neq(timeout1, timeout2, "Calling setTimeout again returns a different value");
- });
-});
-
-add_task(function* test_setInterval() {
- let interval1 = imported.setInterval(() => do_throw("Should not be called!"), 100);
- do_check_eq(typeof interval1, "number", "setInterval returns a number");
- do_check_true(interval1 > 0, "setTimeout returns a positive number");
-
- imported.clearInterval(interval1);
-
- const EXPECTED_CALLS = 5;
- let calls = 0;
-
- yield new Promise((resolve) => {
- let interval2 = imported.setInterval((param1, param2) => {
- do_check_true(true, "Should be called");
- do_check_eq(param1, 15, "first parameter is correct");
- do_check_eq(param2, "hola", "second parameter is correct");
- if (calls >= EXPECTED_CALLS) {
- resolve();
- }
- calls++;
- }, 100, 15, "hola");
- });
-});
diff --git a/toolkit/modules/tests/xpcshell/test_web_channel.js b/toolkit/modules/tests/xpcshell/test_web_channel.js
deleted file mode 100644
index 05f1bc03d..000000000
--- a/toolkit/modules/tests/xpcshell/test_web_channel.js
+++ /dev/null
@@ -1,149 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/WebChannel.jsm");
-
-const ERROR_ID_ORIGIN_REQUIRED = "WebChannel id and originOrPermission are required.";
-const VALID_WEB_CHANNEL_ID = "id";
-const URL_STRING = "http://example.com";
-const VALID_WEB_CHANNEL_ORIGIN = Services.io.newURI(URL_STRING, null, null);
-const TEST_PERMISSION_NAME = "test-webchannel-permissions";
-
-var MockWebChannelBroker = {
- _channelMap: new Map(),
- registerChannel: function(channel) {
- if (!this._channelMap.has(channel)) {
- this._channelMap.set(channel);
- }
- },
- unregisterChannel: function (channelToRemove) {
- this._channelMap.delete(channelToRemove)
- }
-};
-
-function run_test() {
- run_next_test();
-}
-
-/**
- * Web channel tests
- */
-
-/**
- * Test channel listening with originOrPermission being an nsIURI.
- */
-add_task(function test_web_channel_listen() {
- return new Promise((resolve, reject) => {
- let channel = new WebChannel(VALID_WEB_CHANNEL_ID, VALID_WEB_CHANNEL_ORIGIN, {
- broker: MockWebChannelBroker
- });
- let delivered = 0;
- do_check_eq(channel.id, VALID_WEB_CHANNEL_ID);
- do_check_eq(channel._originOrPermission.spec, VALID_WEB_CHANNEL_ORIGIN.spec);
- do_check_eq(channel._deliverCallback, null);
-
- channel.listen(function(id, message, target) {
- do_check_eq(id, VALID_WEB_CHANNEL_ID);
- do_check_true(message);
- do_check_true(message.command);
- do_check_true(target.sender);
- delivered++;
- // 2 messages should be delivered
- if (delivered === 2) {
- channel.stopListening();
- do_check_eq(channel._deliverCallback, null);
- resolve();
- }
- });
-
- // send two messages
- channel.deliver({
- id: VALID_WEB_CHANNEL_ID,
- message: {
- command: "one"
- }
- }, { sender: true });
-
- channel.deliver({
- id: VALID_WEB_CHANNEL_ID,
- message: {
- command: "two"
- }
- }, { sender: true });
- });
-});
-
-/**
- * Test channel listening with originOrPermission being a permission string.
- */
-add_task(function test_web_channel_listen_permission() {
- return new Promise((resolve, reject) => {
- // add a new permission
- Services.perms.add(VALID_WEB_CHANNEL_ORIGIN, TEST_PERMISSION_NAME, Services.perms.ALLOW_ACTION);
- do_register_cleanup(() => Services.perms.remove(VALID_WEB_CHANNEL_ORIGIN, TEST_PERMISSION_NAME));
- let channel = new WebChannel(VALID_WEB_CHANNEL_ID, TEST_PERMISSION_NAME, {
- broker: MockWebChannelBroker
- });
- let delivered = 0;
- do_check_eq(channel.id, VALID_WEB_CHANNEL_ID);
- do_check_eq(channel._originOrPermission, TEST_PERMISSION_NAME);
- do_check_eq(channel._deliverCallback, null);
-
- channel.listen(function(id, message, target) {
- do_check_eq(id, VALID_WEB_CHANNEL_ID);
- do_check_true(message);
- do_check_true(message.command);
- do_check_true(target.sender);
- delivered++;
- // 2 messages should be delivered
- if (delivered === 2) {
- channel.stopListening();
- do_check_eq(channel._deliverCallback, null);
- resolve();
- }
- });
-
- // send two messages
- channel.deliver({
- id: VALID_WEB_CHANNEL_ID,
- message: {
- command: "one"
- }
- }, { sender: true });
-
- channel.deliver({
- id: VALID_WEB_CHANNEL_ID,
- message: {
- command: "two"
- }
- }, { sender: true });
- });
-});
-
-
-/**
- * Test constructor
- */
-add_test(function test_web_channel_constructor() {
- do_check_eq(constructorTester(), ERROR_ID_ORIGIN_REQUIRED);
- do_check_eq(constructorTester(undefined), ERROR_ID_ORIGIN_REQUIRED);
- do_check_eq(constructorTester(undefined, VALID_WEB_CHANNEL_ORIGIN), ERROR_ID_ORIGIN_REQUIRED);
- do_check_eq(constructorTester(VALID_WEB_CHANNEL_ID, undefined), ERROR_ID_ORIGIN_REQUIRED);
- do_check_false(constructorTester(VALID_WEB_CHANNEL_ID, VALID_WEB_CHANNEL_ORIGIN));
-
- run_next_test();
-});
-
-function constructorTester(id, origin) {
- try {
- new WebChannel(id, origin);
- } catch (e) {
- return e.message;
- }
- return false;
-}
diff --git a/toolkit/modules/tests/xpcshell/test_web_channel_broker.js b/toolkit/modules/tests/xpcshell/test_web_channel_broker.js
deleted file mode 100644
index 132597c20..000000000
--- a/toolkit/modules/tests/xpcshell/test_web_channel_broker.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-var Cu = Components.utils;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/WebChannel.jsm");
-
-const VALID_WEB_CHANNEL_ID = "id";
-const URL_STRING = "http://example.com";
-const VALID_WEB_CHANNEL_ORIGIN = Services.io.newURI(URL_STRING, null, null);
-
-function run_test() {
- run_next_test();
-}
-
-/**
- * Test WebChannelBroker channel map
- */
-add_test(function test_web_channel_broker_channel_map() {
- let channel = {};
- let channel2 = {};
-
- do_check_eq(WebChannelBroker._channelMap.size, 0);
- do_check_false(WebChannelBroker._messageListenerAttached);
-
- // make sure _channelMap works correctly
- WebChannelBroker.registerChannel(channel);
- do_check_eq(WebChannelBroker._channelMap.size, 1);
- do_check_true(WebChannelBroker._messageListenerAttached);
-
- WebChannelBroker.registerChannel(channel2);
- do_check_eq(WebChannelBroker._channelMap.size, 2);
-
- WebChannelBroker.unregisterChannel(channel);
- do_check_eq(WebChannelBroker._channelMap.size, 1);
-
- // make sure the correct channel is unregistered
- do_check_false(WebChannelBroker._channelMap.has(channel));
- do_check_true(WebChannelBroker._channelMap.has(channel2));
-
- WebChannelBroker.unregisterChannel(channel2);
- do_check_eq(WebChannelBroker._channelMap.size, 0);
-
- run_next_test();
-});
-
-
-/**
- * Test WebChannelBroker _listener test
- */
-add_task(function test_web_channel_broker_listener() {
- return new Promise((resolve, reject) => {
- var channel = {
- id: VALID_WEB_CHANNEL_ID,
- _originCheckCallback: requestPrincipal => {
- return VALID_WEB_CHANNEL_ORIGIN.prePath === requestPrincipal.origin;
- },
- deliver: function(data, sender) {
- do_check_eq(data.id, VALID_WEB_CHANNEL_ID);
- do_check_eq(data.message.command, "hello");
- do_check_neq(sender, undefined);
- WebChannelBroker.unregisterChannel(channel);
- resolve();
- }
- };
-
- WebChannelBroker.registerChannel(channel);
-
- var mockEvent = {
- data: {
- id: VALID_WEB_CHANNEL_ID,
- message: {
- command: "hello"
- }
- },
- principal: {
- origin: URL_STRING
- },
- objects: {
- },
- };
-
- WebChannelBroker._listener(mockEvent);
- });
-});
diff --git a/toolkit/modules/tests/xpcshell/xpcshell.ini b/toolkit/modules/tests/xpcshell/xpcshell.ini
deleted file mode 100644
index 65d7c45e9..000000000
--- a/toolkit/modules/tests/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,75 +0,0 @@
-[DEFAULT]
-head =
-tail =
-support-files =
- propertyLists/bug710259_propertyListBinary.plist
- propertyLists/bug710259_propertyListXML.plist
- chromeappsstore.sqlite
- zips/zen.zip
-
-[test_BinarySearch.js]
-skip-if = toolkit == 'android'
-[test_CanonicalJSON.js]
-[test_client_id.js]
-skip-if = toolkit == 'android'
-[test_Color.js]
-[test_DeferredTask.js]
-skip-if = toolkit == 'android'
-[test_FileUtils.js]
-skip-if = toolkit == 'android'
-[test_FinderIterator.js]
-[test_GMPInstallManager.js]
-skip-if = toolkit == 'android'
-[test_Http.js]
-skip-if = toolkit == 'android'
-[test_Integration.js]
-[test_jsesc.js]
-skip-if = toolkit == 'android'
-[test_JSONFile.js]
-skip-if = toolkit == 'android'
-[test_Log.js]
-skip-if = toolkit == 'android'
-[test_MatchPattern.js]
-skip-if = toolkit == 'android'
-[test_MatchGlobs.js]
-skip-if = toolkit == 'android'
-[test_MatchURLFilters.js]
-skip-if = toolkit == 'android'
-[test_NewTabUtils.js]
-skip-if = toolkit == 'android'
-[test_ObjectUtils.js]
-skip-if = toolkit == 'android'
-[test_ObjectUtils_strict.js]
-skip-if = toolkit == 'android'
-[test_PermissionsUtils.js]
-skip-if = toolkit == 'android'
-[test_Preferences.js]
-skip-if = toolkit == 'android'
-[test_Promise.js]
-skip-if = toolkit == 'android'
-[test_PromiseUtils.js]
-skip-if = toolkit == 'android'
-[test_propertyListsUtils.js]
-skip-if = toolkit == 'android'
-[test_readCertPrefs.js]
-skip-if = toolkit == 'android'
-[test_Services.js]
-skip-if = toolkit == 'android'
-[test_session_recorder.js]
-skip-if = toolkit == 'android'
-[test_sqlite.js]
-skip-if = toolkit == 'android'
-[test_sqlite_shutdown.js]
-skip-if = toolkit == 'android'
-[test_task.js]
-skip-if = toolkit == 'android'
-[test_timer.js]
-skip-if = toolkit == 'android'
-[test_UpdateUtils_url.js]
-[test_UpdateUtils_updatechannel.js]
-[test_web_channel.js]
-[test_web_channel_broker.js]
-[test_ZipUtils.js]
-skip-if = toolkit == 'android'
-[test_Log_stackTrace.js]
-[test_servicerequest_xhr.js]
diff --git a/toolkit/modules/tests/xpcshell/zips/zen.zip b/toolkit/modules/tests/xpcshell/zips/zen.zip
deleted file mode 100644
index 475624793..000000000
--- a/toolkit/modules/tests/xpcshell/zips/zen.zip
+++ /dev/null
Binary files differ
diff --git a/toolkit/moz.build b/toolkit/moz.build
index b02d122cd..9c5102a01 100644
--- a/toolkit/moz.build
+++ b/toolkit/moz.build
@@ -27,16 +27,15 @@ if CONFIG['MOZ_JETPACK']:
DIRS += ['mozapps/extensions']
-if CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
+if CONFIG['MOZ_UPDATER']:
DIRS += ['mozapps/update']
-
-if CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
-# Including mozapps/update/common-standalone allows the maintenance service
-# to be built so the maintenance service can be used for things other than
-# updating applications.
- DIRS += [
- 'mozapps/update/common-standalone',
- ]
+ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
+ # Including mozapps/update/common-standalone allows the maintenance service
+ # to be built so the maintenance service can be used for things other than
+ # updating applications.
+ DIRS += [
+ 'mozapps/update/common-standalone',
+ ]
DIRS += ['xre']
@@ -46,14 +45,3 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
DIRS += ['system/osxproxy']
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
DIRS += ['system/windowsproxy']
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- DIRS += ['system/androidproxy']
-
-with Files('mozapps/installer/windows/*'):
- BUG_COMPONENT = ('Toolkit', 'NSIS Installer')
-
-with Files('pluginproblem/*'):
- BUG_COMPONENT = ('Core', 'Plug-ins')
-
-with Files('mozapps/preferences/*'):
- BUG_COMPONENT = ('Toolkit', 'Preferences')
diff --git a/toolkit/moz.configure b/toolkit/moz.configure
index 792fb113d..128402257 100644
--- a/toolkit/moz.configure
+++ b/toolkit/moz.configure
@@ -14,9 +14,6 @@ option('--enable-systrace', env='MOZ_USE_SYSTRACE',
@depends('--enable-systrace', target)
def systrace(value, target):
- if value and target.os != 'Android':
- die('--enable-systrace cannot be used when targeting %s',
- target.os)
if value:
return True
@@ -66,7 +63,7 @@ set_config('L10NBASEDIR', l10n_base)
# reason.
option('--enable-default-toolkit', nargs=1,
choices=('cairo-windows', 'cairo-gtk2', 'cairo-gtk2-x11', 'cairo-gtk3',
- 'cairo-cocoa', 'cairo-uikit', 'cairo-android'),
+ 'cairo-cocoa', 'cairo-uikit'),
help='Select default toolkit')
@depends('--enable-default-toolkit', target)
@@ -80,13 +77,6 @@ def toolkit(value, target):
platform_choices = ('cairo-cocoa',)
elif target.os == 'iOS':
platform_choices = ('cairo-uikit',)
- elif target.os == 'Android':
- if value.origin == 'implied':
- # Trust values coming from imply_option() (used in
- # b2g/moz.configure).
- platform_choices = tuple(value)
- else:
- platform_choices = ('cairo-android',)
else:
platform_choices = ('cairo-gtk3', 'cairo-gtk2', 'cairo-gtk2-x11')
@@ -185,7 +175,7 @@ set_define(gl_provider_define, True)
# ==============================================================
@depends(toolkit)
def pdf_printing(toolkit):
- if toolkit in ('windows', 'gtk2', 'gtk3', 'android'):
+ if toolkit in ('windows', 'gtk2', 'gtk3'):
return True
@depends(pdf_printing)
@@ -207,8 +197,7 @@ option(env='MOZ_INSTRUMENT_EVENT_LOOP',
@depends('MOZ_INSTRUMENT_EVENT_LOOP', toolkit)
def instrument_event_loop(value, toolkit):
- if value or (toolkit in ('windows', 'gtk2', 'gtk3', 'cocoa',
- 'android') and value.origin == 'default'):
+ if value or (toolkit in ('windows', 'gtk2', 'gtk3', 'cocoa') and value.origin == 'default'):
return True
set_config('MOZ_INSTRUMENT_EVENT_LOOP', instrument_event_loop)
@@ -266,8 +255,7 @@ add_old_configure_assignment('_HAVE_FREETYPE2',
# ==============================================================
@depends(target)
def tree_freetype(target):
- if target.os == 'Android':
- return True
+ return None
set_define('MOZ_TREE_FREETYPE', tree_freetype)
set_config('MOZ_TREE_FREETYPE', tree_freetype)
@@ -332,7 +320,7 @@ option('--disable-ffmpeg',
def ffmpeg(value, target):
enabled = bool(value)
if value.origin == 'default':
- enabled = target.os not in ('Android', 'WINNT')
+ enabled = target.os not in ('WINNT')
if enabled:
return True
@@ -349,8 +337,7 @@ option('--disable-fmp4', env='MOZ_FMP4',
def fmp4(value, target, wmf, applemedia):
enabled = bool(value)
if value.origin == 'default':
- # target.os == 'Android' includes all B2G versions
- enabled = wmf or applemedia or target.os == 'Android'
+ enabled = wmf or applemedia
if enabled:
return True
@@ -390,7 +377,7 @@ set_config('MOZ_PACKAGER_FORMAT', packager_format)
def jar_maker_format(host, build_project):
# Multilocales for mobile/android use the same mergedirs for all locales,
# so we can't use symlinks for those builds.
- if host.os == 'WINNT' or build_project == 'mobile/android':
+ if host.os == 'WINNT':
return 'flat'
return 'symlink'
@@ -398,23 +385,10 @@ set_config('MOZ_JAR_MAKER_FILE_FORMAT', jar_maker_format)
@depends(toolkit)
def omnijar_name(toolkit):
- # Fennec's static resources live in the assets/ folder of the
- # APK. Adding a path to the name here works because we only
- # have one omnijar file in the final package (which is not the
- # case on desktop), and necessitates some contortions during
- # packaging so that the resources in the omnijar are considered
- # as rooted at / and not as rooted at assets/ (which again is
- # not the case on desktop: there are omnijars rooted at webrtc/,
- # etc). packager.mk handles changing the rooting of the single
- # omnijar.
- return 'assets/omni.ja' if toolkit == 'android' else 'omni.ja'
+ return 'omni.ja'
set_config('OMNIJAR_NAME', omnijar_name)
-project_flag('MOZ_ANDROID_HISTORY',
- help='Enable Android History instead of Places',
- set_as_define=True)
-
# Permissions system
# ==============================================================
option(name='--disable-permissions',
@@ -585,8 +559,6 @@ option('--enable-ipdl-tests', help='Enable expensive IPDL tests')
set_config('MOZ_IPDL_TESTS',
depends_if('--enable-ipdl-tests')(lambda _: True))
-include('nss.configure')
-
# Network protocol support
# ==============================================================
@depends(check_build_environment, '--help')
@@ -667,13 +639,6 @@ set_config('MOZ_ENABLE_SKIA', skia)
set_define('MOZ_ENABLE_SKIA', skia)
set_define('USE_SKIA', skia)
-@depends(skia, target)
-def skia_android(skia, target):
- if skia and target.os == 'Android':
- return True
-
-set_define('SK_BUILD_FOR_ANDROID_NDK', skia_android)
-
option('--disable-skia-gpu', help='Disable use of Skia-GPU')
@depends('--disable-skia-gpu', skia, target)
diff --git a/toolkit/mozapps/downloads/DownloadTaskbarProgress.jsm b/toolkit/mozapps/downloads/DownloadTaskbarProgress.jsm
index bccbeda56..e015ded2a 100644
--- a/toolkit/mozapps/downloads/DownloadTaskbarProgress.jsm
+++ b/toolkit/mozapps/downloads/DownloadTaskbarProgress.jsm
@@ -16,7 +16,6 @@ const Cu = Components.utils;
const Cr = Components.results;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Services",
"resource://gre/modules/Services.jsm");
@@ -177,33 +176,33 @@ var DownloadTaskbarProgressUpdater =
*/
_setActiveWindow: function DTPU_setActiveWindow(aWindow, aIsDownloadWindow)
{
- if (AppConstants.platform == "win") {
- // Clear out the taskbar for the old active window. (If there was no active
- // window, this is a no-op.)
- this._clearTaskbar();
-
- this._activeWindowIsDownloadWindow = aIsDownloadWindow;
- if (aWindow) {
- // Get the taskbar progress for this window
- let docShell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).
- getInterface(Ci.nsIWebNavigation).
- QueryInterface(Ci.nsIDocShellTreeItem).treeOwner.
- QueryInterface(Ci.nsIInterfaceRequestor).
- getInterface(Ci.nsIXULWindow).docShell;
- let taskbarProgress = this._taskbar.getTaskbarProgress(docShell);
- this._activeTaskbarProgress = taskbarProgress;
-
- this._updateTaskbar();
- // _onActiveWindowUnload is idempotent, so we don't need to check whether
- // we've already set this before or not.
- aWindow.addEventListener("unload", function () {
- DownloadTaskbarProgressUpdater._onActiveWindowUnload(taskbarProgress);
- }, false);
- }
- else {
- this._activeTaskbarProgress = null;
- }
+#ifdef XP_WIN
+ // Clear out the taskbar for the old active window. (If there was no active
+ // window, this is a no-op.)
+ this._clearTaskbar();
+
+ this._activeWindowIsDownloadWindow = aIsDownloadWindow;
+ if (aWindow) {
+ // Get the taskbar progress for this window
+ let docShell = aWindow.QueryInterface(Ci.nsIInterfaceRequestor).
+ getInterface(Ci.nsIWebNavigation).
+ QueryInterface(Ci.nsIDocShellTreeItem).treeOwner.
+ QueryInterface(Ci.nsIInterfaceRequestor).
+ getInterface(Ci.nsIXULWindow).docShell;
+ let taskbarProgress = this._taskbar.getTaskbarProgress(docShell);
+ this._activeTaskbarProgress = taskbarProgress;
+
+ this._updateTaskbar();
+ // _onActiveWindowUnload is idempotent, so we don't need to check whether
+ // we've already set this before or not.
+ aWindow.addEventListener("unload", function () {
+ DownloadTaskbarProgressUpdater._onActiveWindowUnload(taskbarProgress);
+ }, false);
+ }
+ else {
+ this._activeTaskbarProgress = null;
}
+#endif
},
// / Current state displayed on the active window's taskbar item
@@ -213,14 +212,15 @@ var DownloadTaskbarProgressUpdater =
_shouldSetState: function DTPU_shouldSetState()
{
- if (AppConstants.platform == "win") {
- // If the active window is not the download manager window, set the state
- // only if it is normal or indeterminate.
- return this._activeWindowIsDownloadWindow ||
- (this._taskbarState == Ci.nsITaskbarProgress.STATE_NORMAL ||
- this._taskbarState == Ci.nsITaskbarProgress.STATE_INDETERMINATE);
- }
+#ifdef XP_WIN
+ // If the active window is not the download manager window, set the state
+ // only if it is normal or indeterminate.
+ return this._activeWindowIsDownloadWindow ||
+ (this._taskbarState == Ci.nsITaskbarProgress.STATE_NORMAL ||
+ this._taskbarState == Ci.nsITaskbarProgress.STATE_INDETERMINATE);
+#else
return true;
+#endif
},
/**
diff --git a/toolkit/mozapps/downloads/content/downloads.js b/toolkit/mozapps/downloads/content/downloads.js
index 2fdb19a74..66230592f 100644
--- a/toolkit/mozapps/downloads/content/downloads.js
+++ b/toolkit/mozapps/downloads/content/downloads.js
@@ -19,7 +19,6 @@ var Cu = Components.utils;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/DownloadUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
@@ -253,18 +252,18 @@ function openDownload(aDownload)
dontAsk = !pref.getBoolPref(PREF_BDM_CONFIRMOPENEXE);
} catch (e) { }
- if (AppConstants.platform == "win") {
- // On Vista and above, we rely on native security prompting for
- // downloaded content unless it's disabled.
- try {
- var sysInfo = Cc["@mozilla.org/system-info;1"].
- getService(Ci.nsIPropertyBag2);
- if (parseFloat(sysInfo.getProperty("version")) >= 6 &&
- pref.getBoolPref(PREF_BDM_SCANWHENDONE)) {
- dontAsk = true;
- }
- } catch (ex) { }
- }
+#ifdef XP_WIN
+ // On Vista and above, we rely on native security prompting for
+ // downloaded content unless it's disabled.
+ try {
+ var sysInfo = Cc["@mozilla.org/system-info;1"].
+ getService(Ci.nsIPropertyBag2);
+ if (parseFloat(sysInfo.getProperty("version")) >= 6 &&
+ pref.getBoolPref(PREF_BDM_SCANWHENDONE)) {
+ dontAsk = true;
+ }
+ } catch (ex) { }
+#endif
if (!dontAsk) {
var strings = document.getElementById("downloadStrings");
@@ -478,10 +477,11 @@ var gDownloadObserver = {
removeFromView(dl);
break;
case "browser-lastwindow-close-granted":
- if (AppConstants.platform != "macosx" &&
- gDownloadManager.activeDownloadCount == 0) {
+#ifndef XP_MACOSX
+ if (gDownloadManager.activeDownloadCount == 0) {
setTimeout(gCloseDownloadManager, 0);
}
+#endif
break;
}
}
diff --git a/toolkit/mozapps/downloads/jar.mn b/toolkit/mozapps/downloads/jar.mn
index eb761b0d9..29a3d0ee2 100644
--- a/toolkit/mozapps/downloads/jar.mn
+++ b/toolkit/mozapps/downloads/jar.mn
@@ -6,7 +6,7 @@ toolkit.jar:
% content mozapps %content/mozapps/
* content/mozapps/downloads/unknownContentType.xul (content/unknownContentType.xul)
* content/mozapps/downloads/downloads.xul (content/downloads.xul)
- content/mozapps/downloads/downloads.js (content/downloads.js)
+* content/mozapps/downloads/downloads.js (content/downloads.js)
content/mozapps/downloads/DownloadProgressListener.js (content/DownloadProgressListener.js)
content/mozapps/downloads/downloads.css (content/downloads.css)
content/mozapps/downloads/download.xml (content/download.xml)
diff --git a/toolkit/mozapps/downloads/moz.build b/toolkit/mozapps/downloads/moz.build
index 1850ea7de..48741710a 100644
--- a/toolkit/mozapps/downloads/moz.build
+++ b/toolkit/mozapps/downloads/moz.build
@@ -4,21 +4,16 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-TEST_DIRS += ['tests']
+EXTRA_COMPONENTS += ['nsHelperAppDlg.manifest']
-EXTRA_COMPONENTS += [
- 'nsHelperAppDlg.manifest',
-]
-
-EXTRA_PP_COMPONENTS += [
- 'nsHelperAppDlg.js',
-]
+EXTRA_PP_COMPONENTS += ['nsHelperAppDlg.js']
EXTRA_JS_MODULES += [
'DownloadLastDir.jsm',
'DownloadPaths.jsm',
- 'DownloadTaskbarProgress.jsm',
'DownloadUtils.jsm',
]
+EXTRA_PP_JS_MODULES += ['DownloadTaskbarProgress.jsm']
+
JAR_MANIFESTS += ['jar.mn'] \ No newline at end of file
diff --git a/toolkit/mozapps/downloads/nsHelperAppDlg.js b/toolkit/mozapps/downloads/nsHelperAppDlg.js
index 27c0fede0..90d38c90b 100644
--- a/toolkit/mozapps/downloads/nsHelperAppDlg.js
+++ b/toolkit/mozapps/downloads/nsHelperAppDlg.js
@@ -4,7 +4,6 @@
const {utils: Cu, interfaces: Ci, classes: Cc, results: Cr} = Components;
Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "EnableDelayHelper",
"resource://gre/modules/SharedPromptUtils.jsm");
@@ -408,22 +407,22 @@ nsUnknownContentTypeDialog.prototype = {
// is now caught properly in the caller of validateLeafName.
var createdFile = DownloadPaths.createNiceUniqueFile(aLocalFolder);
- if (AppConstants.platform == "win") {
- let ext;
- try {
- // We can fail here if there's no primary extension set
- ext = "." + this.mLauncher.MIMEInfo.primaryExtension;
- } catch (e) { }
-
- // Append a file extension if it's an executable that doesn't have one
- // but make sure we actually have an extension to add
- let leaf = createdFile.leafName;
- if (ext && leaf.slice(-ext.length) != ext && createdFile.isExecutable()) {
- createdFile.remove(false);
- aLocalFolder.leafName = leaf + ext;
- createdFile = DownloadPaths.createNiceUniqueFile(aLocalFolder);
- }
+#ifdef XP_WIN
+ let ext;
+ try {
+ // We can fail here if there's no primary extension set
+ ext = "." + this.mLauncher.MIMEInfo.primaryExtension;
+ } catch (e) { }
+
+ // Append a file extension if it's an executable that doesn't have one
+ // but make sure we actually have an extension to add
+ let leaf = createdFile.leafName;
+ if (ext && leaf.slice(-ext.length) != ext && createdFile.isExecutable()) {
+ createdFile.remove(false);
+ aLocalFolder.leafName = leaf + ext;
+ createdFile = DownloadPaths.createNiceUniqueFile(aLocalFolder);
}
+#endif
return createdFile;
},
@@ -640,21 +639,22 @@ nsUnknownContentTypeDialog.prototype = {
// Returns true if opening the default application makes sense.
openWithDefaultOK: function() {
// The checking is different on Windows...
- if (AppConstants.platform == "win") {
- // Windows presents some special cases.
- // We need to prevent use of "system default" when the file is
- // executable (so the user doesn't launch nasty programs downloaded
- // from the web), and, enable use of "system default" if it isn't
- // executable (because we will prompt the user for the default app
- // in that case).
-
- // Default is Ok if the file isn't executable (and vice-versa).
- return !this.mLauncher.targetFileIsExecutable;
- }
+#ifdef XP_WIN
+ // Windows presents some special cases.
+ // We need to prevent use of "system default" when the file is
+ // executable (so the user doesn't launch nasty programs downloaded
+ // from the web), and, enable use of "system default" if it isn't
+ // executable (because we will prompt the user for the default app
+ // in that case).
+
+ // Default is Ok if the file isn't executable (and vice-versa).
+ return !this.mLauncher.targetFileIsExecutable;
+#else
// On other platforms, default is Ok if there is a default app.
// Note that nsIMIMEInfo providers need to ensure that this holds true
// on each platform.
return this.mLauncher.MIMEInfo.hasDefaultHandler;
+#endif
},
// Set "default" application description field.
@@ -675,10 +675,11 @@ nsUnknownContentTypeDialog.prototype = {
// getPath:
getPath: function (aFile) {
- if (AppConstants.platform == "macosx") {
+#ifdef XP_MACOSX
return aFile.leafName || aFile.path;
- }
+#else
return aFile.path;
+#endif
},
// initAppAndSaveToDiskValues:
@@ -980,19 +981,20 @@ nsUnknownContentTypeDialog.prototype = {
// Retrieve the pretty description from the file
getFileDisplayName: function getFileDisplayName(file)
{
- if (AppConstants.platform == "win") {
- if (file instanceof Components.interfaces.nsILocalFileWin) {
- try {
- return file.getVersionInfoField("FileDescription");
- } catch (e) {}
- }
- } else if (AppConstants.platform == "macosx") {
- if (file instanceof Components.interfaces.nsILocalFileMac) {
- try {
- return file.bundleDisplayName;
- } catch (e) {}
- }
+#ifdef XP_WIN
+ if (file instanceof Components.interfaces.nsILocalFileWin) {
+ try {
+ return file.getVersionInfoField("FileDescription");
+ } catch (e) {}
+ }
+#elifdef XP_MACOSX
+ if (file instanceof Components.interfaces.nsILocalFileMac) {
+ try {
+ return file.bundleDisplayName;
+ } catch (e) {}
}
+#endif
+
return file.leafName;
},
@@ -1006,10 +1008,13 @@ nsUnknownContentTypeDialog.prototype = {
var otherHandler = this.dialogElement("otherHandler");
otherHandler.removeAttribute("hidden");
otherHandler.setAttribute("path", this.getPath(this.chosenApp.executable));
- if (AppConstants.platform == "win")
- otherHandler.label = this.getFileDisplayName(this.chosenApp.executable);
- else
- otherHandler.label = this.chosenApp.name;
+
+#ifdef XP_WIN
+ otherHandler.label = this.getFileDisplayName(this.chosenApp.executable);
+#else
+ otherHandler.label = this.chosenApp.name;
+#endif
+
this.dialogElement("openHandler").selectedIndex = 1;
this.dialogElement("openHandler").setAttribute("lastSelectedItemID", "otherHandler");
@@ -1025,85 +1030,84 @@ nsUnknownContentTypeDialog.prototype = {
},
// chooseApp: Open file picker and prompt user for application.
chooseApp: function() {
- if (AppConstants.platform == "win") {
- // Protect against the lack of an extension
- var fileExtension = "";
- try {
- fileExtension = this.mLauncher.MIMEInfo.primaryExtension;
- } catch(ex) {
- }
+#ifdef XP_WIN
+ // Protect against the lack of an extension
+ var fileExtension = "";
+ try {
+ fileExtension = this.mLauncher.MIMEInfo.primaryExtension;
+ } catch(ex) {
+ }
- // Try to use the pretty description of the type, if one is available.
- var typeString = this.mLauncher.MIMEInfo.description;
-
- if (!typeString) {
- // If there is none, use the extension to
- // identify the file, e.g. "ZIP file"
- if (fileExtension) {
- typeString =
- this.dialogElement("strings").
- getFormattedString("fileType", [fileExtension.toUpperCase()]);
- } else {
- // If we can't even do that, just give up and show the MIME type.
- typeString = this.mLauncher.MIMEInfo.MIMEType;
- }
+ // Try to use the pretty description of the type, if one is available.
+ var typeString = this.mLauncher.MIMEInfo.description;
+
+ if (!typeString) {
+ // If there is none, use the extension to
+ // identify the file, e.g. "ZIP file"
+ if (fileExtension) {
+ typeString =
+ this.dialogElement("strings").
+ getFormattedString("fileType", [fileExtension.toUpperCase()]);
+ } else {
+ // If we can't even do that, just give up and show the MIME type.
+ typeString = this.mLauncher.MIMEInfo.MIMEType;
}
+ }
- var params = {};
- params.title =
- this.dialogElement("strings").getString("chooseAppFilePickerTitle");
- params.description = typeString;
- params.filename = this.mLauncher.suggestedFileName;
- params.mimeInfo = this.mLauncher.MIMEInfo;
- params.handlerApp = null;
-
- this.mDialog.openDialog("chrome://global/content/appPicker.xul", null,
- "chrome,modal,centerscreen,titlebar,dialog=yes",
- params);
-
- if (params.handlerApp &&
- params.handlerApp.executable &&
- params.handlerApp.executable.isFile()) {
- // Remember the file they chose to run.
- this.chosenApp = params.handlerApp;
- }
+ var params = {};
+ params.title =
+ this.dialogElement("strings").getString("chooseAppFilePickerTitle");
+ params.description = typeString;
+ params.filename = this.mLauncher.suggestedFileName;
+ params.mimeInfo = this.mLauncher.MIMEInfo;
+ params.handlerApp = null;
+
+ this.mDialog.openDialog("chrome://global/content/appPicker.xul", null,
+ "chrome,modal,centerscreen,titlebar,dialog=yes",
+ params);
+
+ if (params.handlerApp &&
+ params.handlerApp.executable &&
+ params.handlerApp.executable.isFile()) {
+ // Remember the file they chose to run.
+ this.chosenApp = params.handlerApp;
}
- else {
+#else // XP_WIN
#if MOZ_WIDGET_GTK == 3
- var nsIApplicationChooser = Components.interfaces.nsIApplicationChooser;
- var appChooser = Components.classes["@mozilla.org/applicationchooser;1"]
- .createInstance(nsIApplicationChooser);
- appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle"));
- var contentTypeDialogObj = this;
- let appChooserCallback = function appChooserCallback_done(aResult) {
- if (aResult) {
- contentTypeDialogObj.chosenApp = aResult.QueryInterface(Components.interfaces.nsILocalHandlerApp);
- }
- contentTypeDialogObj.finishChooseApp();
- };
- appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
- // The finishChooseApp is called from appChooserCallback
- return;
-#else
- var nsIFilePicker = Components.interfaces.nsIFilePicker;
- var fp = Components.classes["@mozilla.org/filepicker;1"]
- .createInstance(nsIFilePicker);
- fp.init(this.mDialog,
- this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
- nsIFilePicker.modeOpen);
-
- fp.appendFilters(nsIFilePicker.filterApps);
-
- if (fp.show() == nsIFilePicker.returnOK && fp.file) {
- // Remember the file they chose to run.
- var localHandlerApp =
- Components.classes["@mozilla.org/uriloader/local-handler-app;1"].
- createInstance(Components.interfaces.nsILocalHandlerApp);
- localHandlerApp.executable = fp.file;
- this.chosenApp = localHandlerApp;
+ var nsIApplicationChooser = Components.interfaces.nsIApplicationChooser;
+ var appChooser = Components.classes["@mozilla.org/applicationchooser;1"]
+ .createInstance(nsIApplicationChooser);
+ appChooser.init(this.mDialog, this.dialogElement("strings").getString("chooseAppFilePickerTitle"));
+ var contentTypeDialogObj = this;
+ let appChooserCallback = function appChooserCallback_done(aResult) {
+ if (aResult) {
+ contentTypeDialogObj.chosenApp = aResult.QueryInterface(Components.interfaces.nsILocalHandlerApp);
}
-#endif // MOZ_WIDGET_GTK == 3
+ contentTypeDialogObj.finishChooseApp();
+ };
+ appChooser.open(this.mLauncher.MIMEInfo.MIMEType, appChooserCallback);
+ // The finishChooseApp is called from appChooserCallback
+ return;
+#else // MOZ_WIDGET_GTK == 3
+ var nsIFilePicker = Components.interfaces.nsIFilePicker;
+ var fp = Components.classes["@mozilla.org/filepicker;1"]
+ .createInstance(nsIFilePicker);
+ fp.init(this.mDialog,
+ this.dialogElement("strings").getString("chooseAppFilePickerTitle"),
+ nsIFilePicker.modeOpen);
+
+ fp.appendFilters(nsIFilePicker.filterApps);
+
+ if (fp.show() == nsIFilePicker.returnOK && fp.file) {
+ // Remember the file they chose to run.
+ var localHandlerApp =
+ Components.classes["@mozilla.org/uriloader/local-handler-app;1"].
+ createInstance(Components.interfaces.nsILocalHandlerApp);
+ localHandlerApp.executable = fp.file;
+ this.chosenApp = localHandlerApp;
}
+#endif // MOZ_WIDGET_GTK == 3
+#endif // XP_WIN
this.finishChooseApp();
},
diff --git a/toolkit/mozapps/downloads/tests/chrome/.eslintrc.js b/toolkit/mozapps/downloads/tests/chrome/.eslintrc.js
deleted file mode 100644
index 8c0f4f574..000000000
--- a/toolkit/mozapps/downloads/tests/chrome/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/mozapps/downloads/tests/chrome/chrome.ini b/toolkit/mozapps/downloads/tests/chrome/chrome.ini
deleted file mode 100644
index b5a29cb45..000000000
--- a/toolkit/mozapps/downloads/tests/chrome/chrome.ini
+++ /dev/null
@@ -1,10 +0,0 @@
-[DEFAULT]
-skip-if = os == 'android'
-support-files =
- unknownContentType_dialog_layout_data.pif
- unknownContentType_dialog_layout_data.pif^headers^
- unknownContentType_dialog_layout_data.txt
- unknownContentType_dialog_layout_data.txt^headers^
-
-[test_unknownContentType_delayedbutton.xul]
-[test_unknownContentType_dialog_layout.xul]
diff --git a/toolkit/mozapps/downloads/tests/chrome/test_unknownContentType_delayedbutton.xul b/toolkit/mozapps/downloads/tests/chrome/test_unknownContentType_delayedbutton.xul
deleted file mode 100644
index 9bbec0f92..000000000
--- a/toolkit/mozapps/downloads/tests/chrome/test_unknownContentType_delayedbutton.xul
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<!--
- * The unknownContentType popup can have two different layouts depending on
- * whether a helper application can be selected or not.
- * This tests that both layouts have correct collapsed elements.
--->
-
-<window title="Unknown Content Type Dialog Test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="doTest()">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <script type="application/javascript"><![CDATA[
- const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
- Cu.import("resource://gre/modules/Services.jsm");
- Cu.import("resource://gre/modules/Task.jsm");
- Cu.import("resource://gre/modules/Promise.jsm");
-
- const UCT_URI = "chrome://mozapps/content/downloads/unknownContentType.xul";
- const LOAD_URI = "http://mochi.test:8888/chrome/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.txt";
-
- const DIALOG_DELAY = Services.prefs.getIntPref("security.dialog_enable_delay") + 200;
-
- let UCTObserver = {
- opened: Promise.defer(),
- closed: Promise.defer(),
-
- observe: function(aSubject, aTopic, aData) {
- let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
-
- switch (aTopic) {
- case "domwindowopened":
- win.addEventListener("load", function onLoad(event) {
- win.removeEventListener("load", onLoad, false);
-
- // Let the dialog initialize
- SimpleTest.executeSoon(function() {
- UCTObserver.opened.resolve(win);
- });
- }, false);
- break;
-
- case "domwindowclosed":
- if (win.location == UCT_URI) {
- this.closed.resolve();
- }
- break;
- }
- }
- };
-
- Services.ww.registerNotification(UCTObserver);
- SimpleTest.waitForExplicitFinish();
- SimpleTest.requestFlakyTimeout("This test is testing a timing-based feature, so it really needs to wait a certain amount of time to verify that the feature worked.");
-
- function waitDelay(delay) {
- return new Promise((resolve, reject) => {
- window.setTimeout(resolve, delay);
- });
- }
-
- function doTest() {
- Task.spawn(function test_aboutCrashed() {
- let frame = document.getElementById("testframe");
- frame.setAttribute("src", LOAD_URI);
-
- let uctWindow = yield UCTObserver.opened.promise;
- let ok = uctWindow.document.documentElement.getButton("accept");
-
- SimpleTest.is(ok.disabled, true, "button started disabled");
-
- yield waitDelay(DIALOG_DELAY);
-
- SimpleTest.is(ok.disabled, false, "button was enabled");
-
- focusOutOfDialog = SimpleTest.promiseFocus(window);
- window.focus();
- yield focusOutOfDialog;
-
- SimpleTest.is(ok.disabled, true, "button was disabled");
-
- focusOnDialog = SimpleTest.promiseFocus(uctWindow);
- uctWindow.focus();
- yield focusOnDialog;
-
- SimpleTest.is(ok.disabled, true, "button remained disabled");
-
- yield waitDelay(DIALOG_DELAY);
- SimpleTest.is(ok.disabled, false, "button re-enabled after delay");
-
- uctWindow.document.documentElement.cancelDialog();
- yield UCTObserver.closed.promise;
-
- Services.ww.unregisterNotification(UCTObserver);
- uctWindow = null;
- UCTObserver = null;
- SimpleTest.finish();
- });
- }
- ]]></script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display:none;"></div>
- <pre id="test"></pre>
- </body>
-
- <iframe xmlns="http://www.w3.org/1999/xhtml"
- id="testframe">
- </iframe>
-</window>
diff --git a/toolkit/mozapps/downloads/tests/chrome/test_unknownContentType_dialog_layout.xul b/toolkit/mozapps/downloads/tests/chrome/test_unknownContentType_dialog_layout.xul
deleted file mode 100644
index 1210b908d..000000000
--- a/toolkit/mozapps/downloads/tests/chrome/test_unknownContentType_dialog_layout.xul
+++ /dev/null
@@ -1,108 +0,0 @@
-<?xml version="1.0"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<!--
- * The unknownContentType popup can have two different layouts depending on
- * whether a helper application can be selected or not.
- * This tests that both layouts have correct collapsed elements.
--->
-
-<window title="Unknown Content Type Dialog Test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="init()">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <script type="application/javascript">
- <![CDATA[
-const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
-
-const UCT_URI = "chrome://mozapps/content/downloads/unknownContentType.xul";
-
-let testIndex = -1;
-let tests = [
- { // This URL will trigger the simple UI, where only the Save an Cancel buttons are available
- url: "http://mochi.test:8888/chrome/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.pif",
- elements: {
- basicBox: { collapsed: false },
- normalBox: { collapsed: true }
- }
- },
- { // This URL will trigger the full UI
- url: "http://mochi.test:8888/chrome/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.txt",
- elements: {
- basicBox: { collapsed: true },
- normalBox: { collapsed: false }
- }
- }
-];
-
-let ww = Cc["@mozilla.org/embedcomp/window-watcher;1"].
- getService(Ci.nsIWindowWatcher);
-
-SimpleTest.waitForExplicitFinish();
-
-let windowObserver = {
- observe: function(aSubject, aTopic, aData) {
- let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
-
- if (aTopic == "domwindowclosed") {
- if (win.location == UCT_URI)
- loadNextTest();
- return;
- }
-
- // domwindowopened
- win.addEventListener("load", function onLoad(event) {
- win.removeEventListener("load", onLoad, false);
-
- // Let the dialog initialize
- SimpleTest.executeSoon(function() {
- checkWindow(win);
- });
- }, false);
- }
-};
-
-function init() {
- ww.registerNotification(windowObserver);
- loadNextTest();
-}
-
-function loadNextTest() {
- if (!tests[++testIndex]) {
- ww.unregisterNotification(windowObserver);
- SimpleTest.finish();
- return;
- }
- let frame = document.getElementById("testframe");
- frame.setAttribute("src", tests[testIndex].url);
-}
-
-function checkWindow(win) {
- for (let [id, props] of Object.entries(tests[testIndex].elements)) {
- let elem = win.dialog.dialogElement(id);
- for (let [prop, value] of Object.entries(props)) {
- is(elem[prop], value,
- "Element with id " + id + " has property " +
- prop + " set to " + value);
- }
- }
- win.document.documentElement.cancelDialog();
-}
-
- ]]>
- </script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display:none;"></div>
- <pre id="test"></pre>
- </body>
-
- <iframe xmlns="http://www.w3.org/1999/xhtml"
- id="testframe">
- </iframe>
-</window>
diff --git a/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.pif b/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.pif
deleted file mode 100644
index 9353d1312..000000000
--- a/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.pif
+++ /dev/null
@@ -1 +0,0 @@
-Dummy content for unknownContentType_dialog_layout_data.pif
diff --git a/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.pif^headers^ b/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.pif^headers^
deleted file mode 100644
index 09b22facc..000000000
--- a/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.pif^headers^
+++ /dev/null
@@ -1 +0,0 @@
-Content-Type: application/octet-stream
diff --git a/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.txt b/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.txt
deleted file mode 100644
index 77e719559..000000000
--- a/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.txt
+++ /dev/null
@@ -1 +0,0 @@
-Dummy content for unknownContentType_dialog_layout_data.txt
diff --git a/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.txt^headers^ b/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.txt^headers^
deleted file mode 100644
index 2a3c472e2..000000000
--- a/toolkit/mozapps/downloads/tests/chrome/unknownContentType_dialog_layout_data.txt^headers^
+++ /dev/null
@@ -1,2 +0,0 @@
-Content-Type: text/plain
-Content-Disposition: attachment
diff --git a/toolkit/mozapps/downloads/tests/moz.build b/toolkit/mozapps/downloads/tests/moz.build
deleted file mode 100644
index a4b1efb9a..000000000
--- a/toolkit/mozapps/downloads/tests/moz.build
+++ /dev/null
@@ -1,8 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
-MOCHITEST_CHROME_MANIFESTS += ['chrome/chrome.ini']
diff --git a/toolkit/mozapps/downloads/tests/unit/.eslintrc.js b/toolkit/mozapps/downloads/tests/unit/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/mozapps/downloads/tests/unit/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/mozapps/downloads/tests/unit/head_downloads.js b/toolkit/mozapps/downloads/tests/unit/head_downloads.js
deleted file mode 100644
index 4f199e5cf..000000000
--- a/toolkit/mozapps/downloads/tests/unit/head_downloads.js
+++ /dev/null
@@ -1,5 +0,0 @@
-Components.utils.import("resource://gre/modules/Services.jsm");
-
-do_register_cleanup(function() {
- Services.obs.notifyObservers(null, "quit-application", null);
-});
diff --git a/toolkit/mozapps/downloads/tests/unit/test_DownloadPaths.js b/toolkit/mozapps/downloads/tests/unit/test_DownloadPaths.js
deleted file mode 100644
index 77249169d..000000000
--- a/toolkit/mozapps/downloads/tests/unit/test_DownloadPaths.js
+++ /dev/null
@@ -1,131 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80 filetype=javascript: */
-/* ***** BEGIN LICENSE BLOCK *****
- *
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- *
- * ***** END LICENSE BLOCK ***** */
-
-/**
- * Tests for the "DownloadPaths.jsm" JavaScript module.
- */
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/DownloadPaths.jsm");
-
-/**
- * Provides a temporary save directory.
- *
- * @returns nsIFile pointing to the new or existing directory.
- */
-function createTemporarySaveDirectory()
-{
- var saveDir = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties).get("TmpD", Ci.nsIFile);
- saveDir.append("testsavedir");
- if (!saveDir.exists()) {
- saveDir.create(Ci.nsIFile.DIRECTORY_TYPE, 0o755);
- }
- return saveDir;
-}
-
-function testSplitBaseNameAndExtension(aLeafName, [aBase, aExt])
-{
- var [base, ext] = DownloadPaths.splitBaseNameAndExtension(aLeafName);
- do_check_eq(base, aBase);
- do_check_eq(ext, aExt);
-
- // If we modify the base name and concatenate it with the extension again,
- // another roundtrip through the function should give a consistent result.
- // The only exception is when we introduce an extension in a file name that
- // didn't have one or that ended with one of the special cases like ".gz". If
- // we avoid using a dot and we introduce at least another special character,
- // the results are always consistent.
- [base, ext] = DownloadPaths.splitBaseNameAndExtension("(" + base + ")" + ext);
- do_check_eq(base, "(" + aBase + ")");
- do_check_eq(ext, aExt);
-}
-
-function testCreateNiceUniqueFile(aTempFile, aExpectedLeafName)
-{
- var createdFile = DownloadPaths.createNiceUniqueFile(aTempFile);
- do_check_eq(createdFile.leafName, aExpectedLeafName);
-}
-
-function run_test()
-{
- // Usual file names.
- testSplitBaseNameAndExtension("base", ["base", ""]);
- testSplitBaseNameAndExtension("base.ext", ["base", ".ext"]);
- testSplitBaseNameAndExtension("base.application", ["base", ".application"]);
- testSplitBaseNameAndExtension("base.x.Z", ["base", ".x.Z"]);
- testSplitBaseNameAndExtension("base.ext.Z", ["base", ".ext.Z"]);
- testSplitBaseNameAndExtension("base.ext.gz", ["base", ".ext.gz"]);
- testSplitBaseNameAndExtension("base.ext.Bz2", ["base", ".ext.Bz2"]);
- testSplitBaseNameAndExtension("base..ext", ["base.", ".ext"]);
- testSplitBaseNameAndExtension("base..Z", ["base.", ".Z"]);
- testSplitBaseNameAndExtension("base. .Z", ["base. ", ".Z"]);
- testSplitBaseNameAndExtension("base.base.Bz2", ["base.base", ".Bz2"]);
- testSplitBaseNameAndExtension("base .ext", ["base ", ".ext"]);
-
- // Corner cases. A name ending with a dot technically has no extension, but
- // we consider the ending dot separately from the base name so that modifying
- // the latter never results in an extension being introduced accidentally.
- // Names beginning with a dot are hidden files on Unix-like platforms and if
- // their name doesn't contain another dot they should have no extension, but
- // on Windows the whole name is considered as an extension.
- testSplitBaseNameAndExtension("base.", ["base", "."]);
- testSplitBaseNameAndExtension(".ext", ["", ".ext"]);
-
- // Unusual file names (not recommended as input to the function).
- testSplitBaseNameAndExtension("base. ", ["base", ". "]);
- testSplitBaseNameAndExtension("base ", ["base ", ""]);
- testSplitBaseNameAndExtension("", ["", ""]);
- testSplitBaseNameAndExtension(" ", [" ", ""]);
- testSplitBaseNameAndExtension(" . ", [" ", ". "]);
- testSplitBaseNameAndExtension(" .. ", [" .", ". "]);
- testSplitBaseNameAndExtension(" .ext", [" ", ".ext"]);
- testSplitBaseNameAndExtension(" .ext. ", [" .ext", ". "]);
- testSplitBaseNameAndExtension(" .ext.gz ", [" .ext", ".gz "]);
-
- var destDir = createTemporarySaveDirectory();
- try {
- // Single extension.
- var tempFile = destDir.clone();
- tempFile.append("test.txt");
- testCreateNiceUniqueFile(tempFile, "test.txt");
- testCreateNiceUniqueFile(tempFile, "test(1).txt");
- testCreateNiceUniqueFile(tempFile, "test(2).txt");
-
- // Double extension.
- tempFile.leafName = "test.tar.gz";
- testCreateNiceUniqueFile(tempFile, "test.tar.gz");
- testCreateNiceUniqueFile(tempFile, "test(1).tar.gz");
- testCreateNiceUniqueFile(tempFile, "test(2).tar.gz");
-
- // Test automatic shortening of long file names. We don't know exactly how
- // many characters are removed, because it depends on the name of the folder
- // where the file is located.
- tempFile.leafName = new Array(256).join("T") + ".txt";
- var newFile = DownloadPaths.createNiceUniqueFile(tempFile);
- do_check_true(newFile.leafName.length < tempFile.leafName.length);
- do_check_eq(newFile.leafName.slice(-4), ".txt");
-
- // Creating a valid file name from an invalid one is not always possible.
- tempFile.append("file-under-long-directory.txt");
- try {
- DownloadPaths.createNiceUniqueFile(tempFile);
- do_throw("Exception expected with a long parent directory name.")
- } catch (e) {
- // An exception is expected, but we don't know which one exactly.
- }
- } finally {
- // Clean up the temporary directory.
- destDir.remove(true);
- }
-}
diff --git a/toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js b/toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js
deleted file mode 100644
index 11e7776a7..000000000
--- a/toolkit/mozapps/downloads/tests/unit/test_DownloadUtils.js
+++ /dev/null
@@ -1,237 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-var Cu = Components.utils;
-Cu.import("resource://gre/modules/DownloadUtils.jsm");
-
-const gDecimalSymbol = Number(5.4).toLocaleString().match(/\D/);
-function _(str) {
- return str.replace(/\./g, gDecimalSymbol);
-}
-
-function testConvertByteUnits(aBytes, aValue, aUnit)
-{
- let [value, unit] = DownloadUtils.convertByteUnits(aBytes);
- do_check_eq(value, aValue);
- do_check_eq(unit, aUnit);
-}
-
-function testTransferTotal(aCurrBytes, aMaxBytes, aTransfer)
-{
- let transfer = DownloadUtils.getTransferTotal(aCurrBytes, aMaxBytes);
- do_check_eq(transfer, aTransfer);
-}
-
-// Get the em-dash character because typing it directly here doesn't work :(
-var gDash = DownloadUtils.getDownloadStatus(0)[0].match(/remaining (.) 0 bytes/)[1];
-
-var gVals = [0, 100, 2345, 55555, 982341, 23194134, 1482, 58, 9921949201, 13498132, Infinity];
-
-function testStatus(aFunc, aCurr, aMore, aRate, aTest)
-{
- dump("Status Test: " + [aCurr, aMore, aRate, aTest] + "\n");
- let curr = gVals[aCurr];
- let max = curr + gVals[aMore];
- let speed = gVals[aRate];
-
- let [status, last] = aFunc(curr, max, speed);
-
- if (0) {
- dump("testStatus(" + aCurr + ", " + aMore + ", " + aRate + ", [\"" +
- status.replace(gDash, "--") + "\", " + last.toFixed(3) + "]);\n");
- }
-
- // Make sure the status text matches
- do_check_eq(status, _(aTest[0].replace(/--/, gDash)));
-
- // Make sure the lastSeconds matches
- if (last == Infinity)
- do_check_eq(last, aTest[1]);
- else
- do_check_true(Math.abs(last - aTest[1]) < .1);
-}
-
-function testURI(aURI, aDisp, aHost)
-{
- dump("URI Test: " + [aURI, aDisp, aHost] + "\n");
-
- let [disp, host] = DownloadUtils.getURIHost(aURI);
-
- // Make sure we have the right display host and full host
- do_check_eq(disp, aDisp);
- do_check_eq(host, aHost);
-}
-
-
-function testGetReadableDates(aDate, aCompactValue)
-{
- const now = new Date(2000, 11, 31, 11, 59, 59);
-
- let [dateCompact] = DownloadUtils.getReadableDates(aDate, now);
- do_check_eq(dateCompact, aCompactValue);
-}
-
-function testAllGetReadableDates()
-{
- // This test cannot depend on the current date and time, or the date format.
- // It depends on being run with the English localization, however.
- const today_11_30 = new Date(2000, 11, 31, 11, 30, 15);
- const today_12_30 = new Date(2000, 11, 31, 12, 30, 15);
- const yesterday_11_30 = new Date(2000, 11, 30, 11, 30, 15);
- const yesterday_12_30 = new Date(2000, 11, 30, 12, 30, 15);
- const twodaysago = new Date(2000, 11, 29, 11, 30, 15);
- const sixdaysago = new Date(2000, 11, 25, 11, 30, 15);
- const sevendaysago = new Date(2000, 11, 24, 11, 30, 15);
-
- // TODO: Remove Intl fallback when bug 1215247 is fixed.
- const locale = typeof Intl === "undefined"
- ? undefined
- : Components.classes["@mozilla.org/chrome/chrome-registry;1"]
- .getService(Components.interfaces.nsIXULChromeRegistry)
- .getSelectedLocale("global", true);
-
- let dts = Components.classes["@mozilla.org/intl/scriptabledateformat;1"].
- getService(Components.interfaces.nsIScriptableDateFormat);
-
- testGetReadableDates(today_11_30, dts.FormatTime("", dts.timeFormatNoSeconds,
- 11, 30, 0));
- testGetReadableDates(today_12_30, dts.FormatTime("", dts.timeFormatNoSeconds,
- 12, 30, 0));
- testGetReadableDates(yesterday_11_30, "Yesterday");
- testGetReadableDates(yesterday_12_30, "Yesterday");
- testGetReadableDates(twodaysago,
- typeof Intl === "undefined"
- ? twodaysago.toLocaleFormat("%A")
- : twodaysago.toLocaleDateString(locale, { weekday: "long" }));
- testGetReadableDates(sixdaysago,
- typeof Intl === "undefined"
- ? sixdaysago.toLocaleFormat("%A")
- : sixdaysago.toLocaleDateString(locale, { weekday: "long" }));
- testGetReadableDates(sevendaysago,
- (typeof Intl === "undefined"
- ? sevendaysago.toLocaleFormat("%B")
- : sevendaysago.toLocaleDateString(locale, { month: "long" })) + " " +
- sevendaysago.getDate().toString().padStart(2, "0"));
-
- let [, dateTimeFull] = DownloadUtils.getReadableDates(today_11_30);
- do_check_eq(dateTimeFull, dts.FormatDateTime("", dts.dateFormatLong,
- dts.timeFormatNoSeconds,
- 2000, 12, 31, 11, 30, 0));
-}
-
-function run_test()
-{
- testConvertByteUnits(-1, "-1", "bytes");
- testConvertByteUnits(1, _("1"), "bytes");
- testConvertByteUnits(42, _("42"), "bytes");
- testConvertByteUnits(123, _("123"), "bytes");
- testConvertByteUnits(1024, _("1.0"), "KB");
- testConvertByteUnits(8888, _("8.7"), "KB");
- testConvertByteUnits(59283, _("57.9"), "KB");
- testConvertByteUnits(640000, _("625"), "KB");
- testConvertByteUnits(1048576, _("1.0"), "MB");
- testConvertByteUnits(307232768, _("293"), "MB");
- testConvertByteUnits(1073741824, _("1.0"), "GB");
-
- testTransferTotal(1, 1, _("1 of 1 bytes"));
- testTransferTotal(234, 4924, _("234 bytes of 4.8 KB"));
- testTransferTotal(94923, 233923, _("92.7 of 228 KB"));
- testTransferTotal(4924, 94923, _("4.8 of 92.7 KB"));
- testTransferTotal(2342, 294960345, _("2.3 KB of 281 MB"));
- testTransferTotal(234, undefined, _("234 bytes"));
- testTransferTotal(4889023, undefined, _("4.7 MB"));
-
- if (0) {
- // Help find some interesting test cases
- let r = () => Math.floor(Math.random() * 10);
- for (let i = 0; i < 100; i++) {
- testStatus(r(), r(), r());
- }
- }
-
- // First, test with rates, via getDownloadStatus...
- let statusFunc = DownloadUtils.getDownloadStatus.bind(DownloadUtils);
-
- testStatus(statusFunc, 2, 1, 7, ["A few seconds remaining -- 2.3 of 2.4 KB (58 bytes/sec)", 1.724]);
- testStatus(statusFunc, 1, 2, 6, ["A few seconds remaining -- 100 bytes of 2.4 KB (1.4 KB/sec)", 1.582]);
- testStatus(statusFunc, 4, 3, 9, ["A few seconds remaining -- 959 KB of 1.0 MB (12.9 MB/sec)", 0.004]);
- testStatus(statusFunc, 2, 3, 8, ["A few seconds remaining -- 2.3 of 56.5 KB (9.2 GB/sec)", 0.000]);
-
- testStatus(statusFunc, 8, 4, 3, ["17 seconds remaining -- 9.2 of 9.2 GB (54.3 KB/sec)", 17.682]);
- testStatus(statusFunc, 1, 3, 2, ["23 seconds remaining -- 100 bytes of 54.4 KB (2.3 KB/sec)", 23.691]);
- testStatus(statusFunc, 9, 3, 2, ["23 seconds remaining -- 12.9 of 12.9 MB (2.3 KB/sec)", 23.691]);
- testStatus(statusFunc, 5, 6, 7, ["25 seconds remaining -- 22.1 of 22.1 MB (58 bytes/sec)", 25.552]);
-
- testStatus(statusFunc, 3, 9, 3, ["4 minutes remaining -- 54.3 KB of 12.9 MB (54.3 KB/sec)", 242.969]);
- testStatus(statusFunc, 2, 3, 1, ["9 minutes remaining -- 2.3 of 56.5 KB (100 bytes/sec)", 555.550]);
- testStatus(statusFunc, 4, 3, 7, ["15 minutes remaining -- 959 KB of 1.0 MB (58 bytes/sec)", 957.845]);
- testStatus(statusFunc, 5, 3, 7, ["15 minutes remaining -- 22.1 of 22.2 MB (58 bytes/sec)", 957.845]);
-
- testStatus(statusFunc, 1, 9, 2, ["1 hour, 35 minutes remaining -- 100 bytes of 12.9 MB (2.3 KB/sec)", 5756.133]);
- testStatus(statusFunc, 2, 9, 6, ["2 hours, 31 minutes remaining -- 2.3 KB of 12.9 MB (1.4 KB/sec)", 9108.051]);
- testStatus(statusFunc, 2, 4, 1, ["2 hours, 43 minutes remaining -- 2.3 of 962 KB (100 bytes/sec)", 9823.410]);
- testStatus(statusFunc, 6, 4, 7, ["4 hours, 42 minutes remaining -- 1.4 of 961 KB (58 bytes/sec)", 16936.914]);
-
- testStatus(statusFunc, 6, 9, 1, ["1 day, 13 hours remaining -- 1.4 KB of 12.9 MB (100 bytes/sec)", 134981.320]);
- testStatus(statusFunc, 3, 8, 3, ["2 days, 1 hour remaining -- 54.3 KB of 9.2 GB (54.3 KB/sec)", 178596.872]);
- testStatus(statusFunc, 1, 8, 6, ["77 days, 11 hours remaining -- 100 bytes of 9.2 GB (1.4 KB/sec)", 6694972.470]);
- testStatus(statusFunc, 6, 8, 7, ["1979 days, 22 hours remaining -- 1.4 KB of 9.2 GB (58 bytes/sec)", 171068089.672]);
-
- testStatus(statusFunc, 0, 0, 5, ["Unknown time remaining -- 0 of 0 bytes (22.1 MB/sec)", Infinity]);
- testStatus(statusFunc, 0, 6, 0, ["Unknown time remaining -- 0 bytes of 1.4 KB (0 bytes/sec)", Infinity]);
- testStatus(statusFunc, 6, 6, 0, ["Unknown time remaining -- 1.4 of 2.9 KB (0 bytes/sec)", Infinity]);
- testStatus(statusFunc, 8, 5, 0, ["Unknown time remaining -- 9.2 of 9.3 GB (0 bytes/sec)", Infinity]);
-
- // With rate equal to Infinity
- testStatus(statusFunc, 0, 0, 10, ["Unknown time remaining -- 0 of 0 bytes (Really fast)", Infinity]);
- testStatus(statusFunc, 1, 2, 10, ["A few seconds remaining -- 100 bytes of 2.4 KB (Really fast)", 0]);
-
- // Now test without rates, via getDownloadStatusNoRate.
- statusFunc = DownloadUtils.getDownloadStatusNoRate.bind(DownloadUtils);
-
- testStatus(statusFunc, 2, 1, 7, ["A few seconds remaining -- 2.3 of 2.4 KB", 1.724]);
- testStatus(statusFunc, 1, 2, 6, ["A few seconds remaining -- 100 bytes of 2.4 KB", 1.582]);
- testStatus(statusFunc, 4, 3, 9, ["A few seconds remaining -- 959 KB of 1.0 MB", 0.004]);
- testStatus(statusFunc, 2, 3, 8, ["A few seconds remaining -- 2.3 of 56.5 KB", 0.000]);
-
- testStatus(statusFunc, 8, 4, 3, ["17 seconds remaining -- 9.2 of 9.2 GB", 17.682]);
- testStatus(statusFunc, 1, 3, 2, ["23 seconds remaining -- 100 bytes of 54.4 KB", 23.691]);
- testStatus(statusFunc, 9, 3, 2, ["23 seconds remaining -- 12.9 of 12.9 MB", 23.691]);
- testStatus(statusFunc, 5, 6, 7, ["25 seconds remaining -- 22.1 of 22.1 MB", 25.552]);
-
- testStatus(statusFunc, 3, 9, 3, ["4 minutes remaining -- 54.3 KB of 12.9 MB", 242.969]);
- testStatus(statusFunc, 2, 3, 1, ["9 minutes remaining -- 2.3 of 56.5 KB", 555.550]);
- testStatus(statusFunc, 4, 3, 7, ["15 minutes remaining -- 959 KB of 1.0 MB", 957.845]);
- testStatus(statusFunc, 5, 3, 7, ["15 minutes remaining -- 22.1 of 22.2 MB", 957.845]);
-
- testStatus(statusFunc, 1, 9, 2, ["1 hour, 35 minutes remaining -- 100 bytes of 12.9 MB", 5756.133]);
- testStatus(statusFunc, 2, 9, 6, ["2 hours, 31 minutes remaining -- 2.3 KB of 12.9 MB", 9108.051]);
- testStatus(statusFunc, 2, 4, 1, ["2 hours, 43 minutes remaining -- 2.3 of 962 KB", 9823.410]);
- testStatus(statusFunc, 6, 4, 7, ["4 hours, 42 minutes remaining -- 1.4 of 961 KB", 16936.914]);
-
- testStatus(statusFunc, 6, 9, 1, ["1 day, 13 hours remaining -- 1.4 KB of 12.9 MB", 134981.320]);
- testStatus(statusFunc, 3, 8, 3, ["2 days, 1 hour remaining -- 54.3 KB of 9.2 GB", 178596.872]);
- testStatus(statusFunc, 1, 8, 6, ["77 days, 11 hours remaining -- 100 bytes of 9.2 GB", 6694972.470]);
- testStatus(statusFunc, 6, 8, 7, ["1979 days, 22 hours remaining -- 1.4 KB of 9.2 GB", 171068089.672]);
-
- testStatus(statusFunc, 0, 0, 5, ["Unknown time remaining -- 0 of 0 bytes", Infinity]);
- testStatus(statusFunc, 0, 6, 0, ["Unknown time remaining -- 0 bytes of 1.4 KB", Infinity]);
- testStatus(statusFunc, 6, 6, 0, ["Unknown time remaining -- 1.4 of 2.9 KB", Infinity]);
- testStatus(statusFunc, 8, 5, 0, ["Unknown time remaining -- 9.2 of 9.3 GB", Infinity]);
-
- testURI("http://www.mozilla.org/", "mozilla.org", "www.mozilla.org");
- testURI("http://www.city.mikasa.hokkaido.jp/", "city.mikasa.hokkaido.jp", "www.city.mikasa.hokkaido.jp");
- testURI("data:text/html,Hello World", "data resource", "data resource");
- testURI("jar:http://www.mozilla.com/file!/magic", "mozilla.com", "www.mozilla.com");
- testURI("file:///C:/Cool/Stuff/", "local file", "local file");
- // Don't test for moz-icon if we don't have a protocol handler for it (e.g. b2g):
- if ("@mozilla.org/network/protocol;1?name=moz-icon" in Components.classes) {
- testURI("moz-icon:file:///test.extension", "local file", "local file");
- testURI("moz-icon://.extension", "moz-icon resource", "moz-icon resource");
- }
- testURI("about:config", "about resource", "about resource");
- testURI("invalid.uri", "", "");
-
- testAllGetReadableDates();
-}
diff --git a/toolkit/mozapps/downloads/tests/unit/test_lowMinutes.js b/toolkit/mozapps/downloads/tests/unit/test_lowMinutes.js
deleted file mode 100644
index 75eff3370..000000000
--- a/toolkit/mozapps/downloads/tests/unit/test_lowMinutes.js
+++ /dev/null
@@ -1,55 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
-* License, v. 2.0. If a copy of the MPL was not distributed with this
-* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test bug 448344 to make sure when we're in low minutes, we show both minutes
- * and seconds; but continue to show only minutes when we have plenty.
- */
-
-Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
-
-/**
- * Print some debug message to the console. All arguments will be printed,
- * separated by spaces.
- *
- * @param [arg0, arg1, arg2, ...]
- * Any number of arguments to print out
- * @usage _("Hello World") -> prints "Hello World"
- * @usage _(1, 2, 3) -> prints "1 2 3"
- */
-var _ = function(some, debug, text, to) {
- print(Array.slice(arguments).join(" "));
-};
-
-_("Make an array of time lefts and expected string to be shown for that time");
-var expectedTimes = [
- [1.1, "A few seconds remaining", "under 4sec -> few"],
- [2.5, "A few seconds remaining", "under 4sec -> few"],
- [3.9, "A few seconds remaining", "under 4sec -> few"],
- [5.3, "5 seconds remaining", "truncate seconds"],
- [1.1 * 60, "1 minute, 6 seconds remaining", "under 4min -> show sec"],
- [2.5 * 60, "2 minutes, 30 seconds remaining", "under 4min -> show sec"],
- [3.9 * 60, "3 minutes, 54 seconds remaining", "under 4min -> show sec"],
- [5.3 * 60, "5 minutes remaining", "over 4min -> only show min"],
- [1.1 * 3600, "1 hour, 6 minutes remaining", "over 1hr -> show min/sec"],
- [2.5 * 3600, "2 hours, 30 minutes remaining", "over 1hr -> show min/sec"],
- [3.9 * 3600, "3 hours, 54 minutes remaining", "over 1hr -> show min/sec"],
- [5.3 * 3600, "5 hours, 18 minutes remaining", "over 1hr -> show min/sec"],
-];
-_(expectedTimes.join("\n"));
-
-function run_test()
-{
- expectedTimes.forEach(function([time, expectStatus, comment]) {
- _("Running test with time", time);
- _("Test comment:", comment);
- let [status, last] = DownloadUtils.getTimeLeft(time);
-
- _("Got status:", status, "last:", last);
- _("Expecting..", expectStatus);
- do_check_eq(status, expectStatus);
-
- _();
- });
-}
diff --git a/toolkit/mozapps/downloads/tests/unit/test_syncedDownloadUtils.js b/toolkit/mozapps/downloads/tests/unit/test_syncedDownloadUtils.js
deleted file mode 100644
index 86d810a9b..000000000
--- a/toolkit/mozapps/downloads/tests/unit/test_syncedDownloadUtils.js
+++ /dev/null
@@ -1,26 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test bug 420482 by making sure multiple consumers of DownloadUtils gets the
- * same time remaining time if they provide the same time left but a different
- * "last time".
- */
-
-var Cu = Components.utils;
-Cu.import("resource://gre/modules/DownloadUtils.jsm");
-
-function run_test()
-{
- // Simulate having multiple downloads requesting time left
- let downloadTimes = {};
- for (let time of [1, 30, 60, 3456, 9999])
- downloadTimes[time] = DownloadUtils.getTimeLeft(time)[0];
-
- // Pretend we're a download status bar also asking for a time left, but we're
- // using a different "last sec". We need to make sure we get the same time.
- let lastSec = 314;
- for (let [time, text] of Object.entries(downloadTimes))
- do_check_eq(DownloadUtils.getTimeLeft(time, lastSec)[0], text);
-}
diff --git a/toolkit/mozapps/downloads/tests/unit/test_unspecified_arguments.js b/toolkit/mozapps/downloads/tests/unit/test_unspecified_arguments.js
deleted file mode 100644
index 02e27c92c..000000000
--- a/toolkit/mozapps/downloads/tests/unit/test_unspecified_arguments.js
+++ /dev/null
@@ -1,25 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Make sure passing null and nothing to various variable-arg DownloadUtils
- * methods provide the same result.
- */
-
-var Cu = Components.utils;
-Cu.import("resource://gre/modules/DownloadUtils.jsm");
-
-function run_test()
-{
- do_check_eq(DownloadUtils.getDownloadStatus(1000, null, null, null) + "",
- DownloadUtils.getDownloadStatus(1000) + "");
- do_check_eq(DownloadUtils.getDownloadStatus(1000, null, null) + "",
- DownloadUtils.getDownloadStatus(1000, null) + "");
-
- do_check_eq(DownloadUtils.getTransferTotal(1000, null) + "",
- DownloadUtils.getTransferTotal(1000) + "");
-
- do_check_eq(DownloadUtils.getTimeLeft(1000, null) + "",
- DownloadUtils.getTimeLeft(1000) + "");
-}
diff --git a/toolkit/mozapps/downloads/tests/unit/xpcshell.ini b/toolkit/mozapps/downloads/tests/unit/xpcshell.ini
deleted file mode 100644
index 877816ef6..000000000
--- a/toolkit/mozapps/downloads/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,10 +0,0 @@
-[DEFAULT]
-head = head_downloads.js
-tail =
-skip-if = toolkit == 'android'
-
-[test_DownloadPaths.js]
-[test_DownloadUtils.js]
-[test_lowMinutes.js]
-[test_syncedDownloadUtils.js]
-[test_unspecified_arguments.js]
diff --git a/toolkit/mozapps/extensions/GMPUtils.jsm b/toolkit/mozapps/extensions/GMPUtils.jsm
index 814ae4914..3c691610d 100644
--- a/toolkit/mozapps/extensions/GMPUtils.jsm
+++ b/toolkit/mozapps/extensions/GMPUtils.jsm
@@ -15,7 +15,6 @@ this.EXPORTED_SYMBOLS = [ "GMP_PLUGIN_IDS",
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/AppConstants.jsm");
// GMP IDs
const OPEN_H264_ID = "gmp-gmpopenh264";
@@ -71,21 +70,25 @@ this.GMPUtils = {
return true;
}
if (aPlugin.id == WIDEVINE_ID) {
+
+#if defined(XP_WIN) || defined(XP_LINUX) || defined(XP_MACOSX)
// The Widevine plugin is available for Windows versions Vista and later,
// Mac OSX, and Linux.
- return AppConstants.isPlatformAndVersionAtLeast("win", "6") ||
- AppConstants.platform == "macosx" ||
- AppConstants.platform == "linux";
+ return true;
+#else
+ return false;
+#endif
}
return true;
},
_is32bitModeMacOS: function() {
- if (AppConstants.platform != "macosx") {
- return false;
- }
+#ifdef XP_MACOSX
return Services.appinfo.XPCOMABI.split("-")[0] == "x86";
+#else
+ return false;
+#endif
},
/**
diff --git a/toolkit/mozapps/extensions/content/extensions.css b/toolkit/mozapps/extensions/content/extensions.css
index 41c140565..51828d544 100644
--- a/toolkit/mozapps/extensions/content/extensions.css
+++ b/toolkit/mozapps/extensions/content/extensions.css
@@ -152,8 +152,6 @@ setting[type="menulist"] {
.addon:not([notification="info"]) .info,
.addon:not([pending]) .pending,
.addon:not([upgrade="true"]) .update-postfix,
-.addon:not([native="true"]) .nativeAddon,
-.addon:not([native="false"]) .compatAddon,
.addon[active="true"] .disabled-postfix,
.addon[pending="install"] .update-postfix,
.addon[pending="install"] .disabled-postfix,
@@ -266,21 +264,6 @@ richlistitem:not([selected]) * {
display: none;
}
-/* Indicator style for extension target application */
-.addon[native] .nativeIndicator {
- margin-left: 5pt;
- padding-bottom: 1pt;
-}
-.addon[native][active="false"] .nativeIndicator {
- opacity: 0.4;
-}
-.addon[native] .nativeAddon {
- color: #3366FF;
-}
-.addon[native] .compatAddon {
- color: #FF6600;
-}
-
/* Translators for Language Pack details */
.translators > label {
-moz-margin-start: 0px;
diff --git a/toolkit/mozapps/extensions/content/extensions.js b/toolkit/mozapps/extensions/content/extensions.js
index 9576e9a3b..3c3b5894b 100644
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -3059,6 +3059,19 @@ var gDetailView = {
warning.textContent =
gStrings.ext.formatStringFromName("details.notification.gmpPending",
[this._addon.name], 1);
+#ifdef MOZ_PHOENIX_EXTENSIONS
+ } else if (this._addon.native == false) {
+ this.node.setAttribute("notification", "warning");
+ this.node.setAttribute("native", "false");
+ document.getElementById("detail-warning").textContent = gStrings.ext.formatStringFromName(
+ "details.notification.compatibility",
+ [this._addon.name, gStrings.brandShortName], 2
+ );
+ var warningLink = document.getElementById("detail-warning-link");
+ warningLink.value = gStrings.ext.GetStringFromName("details.notification.compatibility.link");
+ warningLink.href = Services.urlFormatter.formatURLPref("extensions.compatibility.url");
+ warningLink.hidden = false;
+#endif
} else {
this.node.removeAttribute("notification");
}
diff --git a/toolkit/mozapps/extensions/content/extensions.xml b/toolkit/mozapps/extensions/content/extensions.xml
index 9c8fda8ed..e2eef852a 100644
--- a/toolkit/mozapps/extensions/content/extensions.xml
+++ b/toolkit/mozapps/extensions/content/extensions.xml
@@ -857,10 +857,6 @@
<xul:label anonid="name" class="name" crop="end" flex="1"
xbl:inherits="value=name,tooltiptext=name"/>
<xul:label anonid="version" class="version"/>
-#ifdef MOZ_PHOENIX_EXTENSIONS
- <xul:label class="nativeIndicator nativeAddon" value="â—" tooltiptext="&addon.nativeAddon;"/>
- <xul:label class="nativeIndicator compatAddon" value="â—" tooltiptext="&addon.compatAddon;"/>
-#endif
<xul:label class="disabled-postfix" value="&addon.disabled.postfix;"/>
<xul:label class="update-postfix" value="&addon.update.postfix;"/>
<xul:spacer flex="5000"/> <!-- Necessary to make the name crop -->
@@ -1359,8 +1355,20 @@
} else {
this.removeAttribute("notification");
#ifdef MOZ_PHOENIX_EXTENSIONS
- if (this.mAddon.type == "extension")
+ if (this.mAddon.type == "extension") {
this.setAttribute("native", this.mAddon.native);
+ if (this.mAddon.native == false) {
+ this.setAttribute("notification", "warning");
+ this._warning.textContent = gStrings.ext.formatStringFromName(
+ "notification.compatibility",
+ [this.mAddon.name, gStrings.brandShortName], 2
+ );
+ this._warningLink.value = gStrings.ext.GetStringFromName("notification.compatibility.link");
+ this._warningLink.href = Services.urlFormatter.formatURLPref("extensions.compatibility.url");
+ this._warningLink.hidden = false;
+ this._warningBtn.hidden = true;
+ }
+ }
#endif
}
}
diff --git a/toolkit/mozapps/extensions/extensions.manifest b/toolkit/mozapps/extensions/extensions.manifest
index 7efb74a9d..b56152e10 100644
--- a/toolkit/mozapps/extensions/extensions.manifest
+++ b/toolkit/mozapps/extensions/extensions.manifest
@@ -1,14 +1,16 @@
component {4399533d-08d1-458c-a87a-235f74451cfa} addonManager.js
contract @mozilla.org/addons/integration;1 {4399533d-08d1-458c-a87a-235f74451cfa}
category update-timer addonManager @mozilla.org/addons/integration;1,getService,addon-background-update-timer,extensions.update.interval,86400
+
component {7beb3ba8-6ec3-41b4-b67c-da89b8518922} amContentHandler.js
contract @mozilla.org/uriloader/content-handler;1?type=application/x-xpinstall {7beb3ba8-6ec3-41b4-b67c-da89b8518922}
+
component {0f38e086-89a3-40a5-8ffc-9b694de1d04a} amWebInstallListener.js
contract @mozilla.org/addons/web-install-listener;1 {0f38e086-89a3-40a5-8ffc-9b694de1d04a}
+
component {9df8ef2b-94da-45c9-ab9f-132eb55fddf1} amInstallTrigger.js
contract @mozilla.org/addons/installtrigger;1 {9df8ef2b-94da-45c9-ab9f-132eb55fddf1}
category JavaScript-global-property InstallTrigger @mozilla.org/addons/installtrigger;1
-#ifndef MOZ_WIDGET_ANDROID
+
category addon-provider-module PluginProvider resource://gre/modules/addons/PluginProvider.jsm
-#endif
category addon-provider-module GMPProvider resource://gre/modules/addons/GMPProvider.jsm
diff --git a/toolkit/mozapps/extensions/internal/XPIProvider.jsm b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
index 600ec2ff5..d12e1de59 100644
--- a/toolkit/mozapps/extensions/internal/XPIProvider.jsm
+++ b/toolkit/mozapps/extensions/internal/XPIProvider.jsm
@@ -6472,8 +6472,8 @@ AddonInternal.prototype = {
}
else if (app.id == FIREFOX_ID) {
version = FIREFOX_APPCOMPATVERSION;
- if (this.type == "locale")
- //Never allow language packs in Firefox compatibility mode
+ if (this.type != "extension")
+ //Only allow extensions in Firefox compatibility mode
return false;
#endif
}
@@ -6528,12 +6528,15 @@ AddonInternal.prototype = {
app = targetApp;
}
#ifdef MOZ_PHOENIX_EXTENSIONS
- //Special case: check for Firefox TargetApps. this has to be done AFTER
- //the initial check to make sure appinfo.ID is preferred, even if
- //Firefox is listed before it in the install manifest.
- for (let targetApp of this.targetApplications) {
- if (targetApp.id == FIREFOX_ID) //Firefox GUID
- return targetApp;
+ // Special case: check for Firefox TargetApps. this has to be done AFTER
+ // the initial check to make sure appinfo.ID is preferred, even if
+ // Firefox is listed before it in the install manifest.
+ // Only do this for extensions. Other types should not be allowed.
+ if (this.type == "extension") {
+ for (let targetApp of this.targetApplications) {
+ if (targetApp.id == FIREFOX_ID) //Firefox GUID
+ return targetApp;
+ }
}
#endif
// Return toolkit ID if toolkit.
diff --git a/toolkit/mozapps/extensions/internal/moz.build b/toolkit/mozapps/extensions/internal/moz.build
index 337df3104..12e95fb5a 100644
--- a/toolkit/mozapps/extensions/internal/moz.build
+++ b/toolkit/mozapps/extensions/internal/moz.build
@@ -10,16 +10,11 @@ EXTRA_JS_MODULES.addons += [
'Content.js',
'GMPProvider.jsm',
'LightweightThemeImageOptimizer.jsm',
+ 'PluginProvider.jsm',
'ProductAddonChecker.jsm',
'SpellCheckDictionaryBootstrap.js',
]
-# Don't ship unused providers on Android
-if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
- EXTRA_JS_MODULES.addons += [
- 'PluginProvider.jsm',
- ]
-
EXTRA_PP_JS_MODULES.addons += [
'AddonRepository.jsm',
'AddonUpdateChecker.jsm',
diff --git a/toolkit/mozapps/extensions/moz.build b/toolkit/mozapps/extensions/moz.build
index 104e8d734..cb1e83063 100644
--- a/toolkit/mozapps/extensions/moz.build
+++ b/toolkit/mozapps/extensions/moz.build
@@ -20,22 +20,19 @@ EXTRA_COMPONENTS += [
'amContentHandler.js',
'amInstallTrigger.js',
'amWebInstallListener.js',
-]
-
-EXTRA_PP_COMPONENTS += [
'extensions.manifest',
]
EXTRA_JS_MODULES += [
'ChromeManifestParser.jsm',
'DeferredSave.jsm',
- 'GMPUtils.jsm',
'LightweightThemeManager.jsm',
]
EXTRA_PP_JS_MODULES += [
'AddonManager.jsm',
'GMPInstallManager.jsm',
+ 'GMPUtils.jsm',
]
# Additional debugging info is exposed in debug builds
diff --git a/toolkit/mozapps/installer/l10n-repack.py b/toolkit/mozapps/installer/l10n-repack.py
index 783c00b71..fcf3e773c 100644
--- a/toolkit/mozapps/installer/l10n-repack.py
+++ b/toolkit/mozapps/installer/l10n-repack.py
@@ -20,7 +20,6 @@ NON_CHROME = set([
'hyphenation',
'defaults/profile',
'defaults/pref*/*-l10n.js',
- 'update.locale',
'updater.ini',
'extensions/langpack-*@*',
'distribution/extensions/langpack-*@*',
diff --git a/toolkit/mozapps/installer/packager-uxp.mk b/toolkit/mozapps/installer/packager-uxp.mk
index 3125c04f1..8d7cb4e62 100644
--- a/toolkit/mozapps/installer/packager-uxp.mk
+++ b/toolkit/mozapps/installer/packager-uxp.mk
@@ -18,10 +18,6 @@ else
ifeq (WINNT,$(OS_ARCH))
cd $(DIST); $(CYGWIN_WRAPPER) 7z a -t7z -m0=lzma2 -mx=9 -aoa -bb3 $(PKG_BASENAME).7z $(MOZ_PKG_DIR)
else
- # Other platforms such as Linux need the Package routine to spawn a pre-complete file
- # Windows does not require this because it is dependent on generating the NSIS
- # Installer which has its own call to generate the precomplete file
- cd $(DIST)/$(MOZ_PKG_DIR); $(CREATE_PRECOMPLETE_CMD)
cd $(DIST); XZ_OPT=-9e $(TAR) cfJv $(PKG_BASENAME).tar.xz $(MOZ_PKG_DIR)
endif
endif
diff --git a/toolkit/mozapps/installer/packager.mk b/toolkit/mozapps/installer/packager.mk
index dc9324597..e700b5162 100644
--- a/toolkit/mozapps/installer/packager.mk
+++ b/toolkit/mozapps/installer/packager.mk
@@ -55,6 +55,7 @@ stage-package: $(MOZ_PKG_MANIFEST) $(MOZ_PKG_MANIFEST_DEPS)
$(MOZ_PKG_MANIFEST) '$(DIST)' '$(DIST)'/$(STAGEPATH)$(MOZ_PKG_DIR)$(if $(MOZ_PKG_MANIFEST),,$(_BINPATH)) \
$(if $(filter omni,$(MOZ_PACKAGER_FORMAT)),$(if $(NON_OMNIJAR_FILES),--non-resource $(NON_OMNIJAR_FILES)))
$(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/find-dupes.py $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)
+ @(cd $(DIST)/$(MOZ_PKG_DIR) && $(CREATE_PRECOMPLETE_CMD))
ifdef MOZ_PACKAGE_JSSHELL
# Package JavaScript Shell
@echo 'Packaging JavaScript Shell...'
diff --git a/toolkit/mozapps/installer/upload-files.mk b/toolkit/mozapps/installer/upload-files.mk
index 40af34a59..82b550fb4 100644
--- a/toolkit/mozapps/installer/upload-files.mk
+++ b/toolkit/mozapps/installer/upload-files.mk
@@ -63,17 +63,15 @@ JSSHELL_BINS = \
$(DLL_PREFIX)mozglue$(DLL_SUFFIX) \
$(NULL)
-ifndef MOZ_SYSTEM_NSPR
- ifdef MOZ_FOLD_LIBS
- JSSHELL_BINS += $(DLL_PREFIX)nss3$(DLL_SUFFIX)
- else
- JSSHELL_BINS += \
- $(DLL_PREFIX)nspr4$(DLL_SUFFIX) \
- $(DLL_PREFIX)plds4$(DLL_SUFFIX) \
- $(DLL_PREFIX)plc4$(DLL_SUFFIX) \
- $(NULL)
- endif # MOZ_FOLD_LIBS
-endif # MOZ_SYSTEM_NSPR
+ifdef MOZ_FOLD_LIBS
+ JSSHELL_BINS += $(DLL_PREFIX)nss3$(DLL_SUFFIX)
+else
+ JSSHELL_BINS += \
+ $(DLL_PREFIX)nspr4$(DLL_SUFFIX) \
+ $(DLL_PREFIX)plds4$(DLL_SUFFIX) \
+ $(DLL_PREFIX)plc4$(DLL_SUFFIX) \
+ $(NULL)
+endif # MOZ_FOLD_LIBS
ifdef MSVC_C_RUNTIME_DLL
JSSHELL_BINS += $(MSVC_C_RUNTIME_DLL)
diff --git a/toolkit/mozapps/update/moz.build b/toolkit/mozapps/update/moz.build
index 5f1d56764..c40f2fdd5 100644
--- a/toolkit/mozapps/update/moz.build
+++ b/toolkit/mozapps/update/moz.build
@@ -11,19 +11,13 @@ DIRS += [
'updater',
]
-XPIDL_SOURCES += [
- 'nsIUpdateService.idl',
-]
-
-TEST_DIRS += ['tests']
+XPIDL_SOURCES += ['nsIUpdateService.idl']
EXTRA_COMPONENTS += [
- 'nsUpdateService.js',
'nsUpdateService.manifest',
'nsUpdateServiceStub.js',
]
-JAR_MANIFESTS += ['jar.mn']
+EXTRA_PP_COMPONENTS += ['nsUpdateService.js']
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Application Update')
+JAR_MANIFESTS += ['jar.mn']
diff --git a/toolkit/mozapps/update/nsUpdateService.js b/toolkit/mozapps/update/nsUpdateService.js
index dca0a007e..84c92c6f4 100644
--- a/toolkit/mozapps/update/nsUpdateService.js
+++ b/toolkit/mozapps/update/nsUpdateService.js
@@ -12,7 +12,6 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm", this);
Cu.import("resource://gre/modules/FileUtils.jsm", this);
Cu.import("resource://gre/modules/Services.jsm", this);
Cu.import("resource://gre/modules/ctypes.jsm", this);
-Cu.import("resource://gre/modules/AppConstants.jsm", this);
Cu.importGlobalProperties(["XMLHttpRequest"]);
const UPDATESERVICE_CID = Components.ID("{B3C290A6-3943-4B89-8BBE-C01EB7B3B311}");
@@ -219,10 +218,7 @@ function closeHandle(handle) {
* @return The Win32 handle to the mutex.
*/
function createMutex(aName, aAllowExisting = true) {
- if (AppConstants.platform != "win") {
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- }
-
+#ifdef XP_WIN
const INITIAL_OWN = 1;
const ERROR_ALREADY_EXISTS = 0xB7;
let lib = ctypes.open("kernel32.dll");
@@ -246,6 +242,9 @@ function createMutex(aName, aAllowExisting = true) {
}
return handle;
+#else
+ throw Cr.NS_ERROR_NOT_IMPLEMENTED;
+#endif
}
/**
@@ -257,10 +256,7 @@ function createMutex(aName, aAllowExisting = true) {
* @return Global mutex path
*/
function getPerInstallationMutexName(aGlobal = true) {
- if (AppConstants.platform != "win") {
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- }
-
+#ifdef XP_WIN
let hasher = Cc["@mozilla.org/security/hash;1"].
createInstance(Ci.nsICryptoHash);
hasher.init(hasher.SHA1);
@@ -274,6 +270,9 @@ function getPerInstallationMutexName(aGlobal = true) {
hasher.update(data, data.length);
return (aGlobal ? "Global\\" : "") + "MozillaUpdateMutex-" + hasher.finish(true);
+#else
+ throw Cr.NS_ERROR_NOT_IMPLEMENTED;
+#endif
}
/**
@@ -285,13 +284,14 @@ function getPerInstallationMutexName(aGlobal = true) {
* @return true if this instance holds the update mutex
*/
function hasUpdateMutex() {
- if (AppConstants.platform != "win") {
- return true;
- }
+#ifdef XP_WIN
if (!gUpdateMutexHandle) {
gUpdateMutexHandle = createMutex(getPerInstallationMutexName(true), false);
}
return !!gUpdateMutexHandle;
+#else
+ return true;
+#endif
}
/**
@@ -322,10 +322,7 @@ function areDirectoryEntriesWriteable(aDir) {
* @return true if elevation is required, false otherwise
*/
function getElevationRequired() {
- if (AppConstants.platform != "macosx") {
- return false;
- }
-
+#ifdef XP_MACOSX
try {
// Recursively check that the application bundle (and its descendants) can
// be written to.
@@ -344,6 +341,7 @@ function getElevationRequired() {
}
LOG("getElevationRequired - able to write to application bundle, elevation " +
"not required");
+#endif
return false;
}
@@ -355,85 +353,86 @@ function getElevationRequired() {
* @return true if an update can be applied, false otherwise
*/
function getCanApplyUpdates() {
- if (AppConstants.platform != "macosx") {
- try {
- let updateTestFile = getUpdateFile([FILE_UPDATE_TEST]);
- LOG("getCanApplyUpdates - testing write access " + updateTestFile.path);
- testWriteAccess(updateTestFile, false);
- if (AppConstants.platform == "win") {
- // Example windowsVersion: Windows XP == 5.1
- let windowsVersion = Services.sysinfo.getProperty("version");
- LOG("getCanApplyUpdates - windowsVersion = " + windowsVersion);
-
- /**
- * For Vista, updates can be performed to a location requiring admin
- * privileges by requesting elevation via the UAC prompt when launching
- * updater.exe if the appDir is under the Program Files directory
- * (e.g. C:\Program Files\) and UAC is turned on and we can elevate
- * (e.g. user has a split token).
- *
- * Note: this does note attempt to handle the case where UAC is turned on
- * and the installation directory is in a restricted location that
- * requires admin privileges to update other than Program Files.
- */
- let userCanElevate = false;
-
- if (parseFloat(windowsVersion) >= 6) {
- try {
- // KEY_UPDROOT will fail and throw an exception if
- // appDir is not under the Program Files, so we rely on that
- let dir = Services.dirsvc.get(KEY_UPDROOT, Ci.nsIFile);
- // appDir is under Program Files, so check if the user can elevate
- userCanElevate = Services.appinfo.QueryInterface(Ci.nsIWinAppHelper).
- userCanElevate;
- LOG("getCanApplyUpdates - on Vista, userCanElevate: " + userCanElevate);
- }
- catch (ex) {
- // When the installation directory is not under Program Files,
- // fall through to checking if write access to the
- // installation directory is available.
- LOG("getCanApplyUpdates - on Vista, appDir is not under Program Files");
- }
- }
+#ifndef XP_MACOSX
+ try {
+ let updateTestFile = getUpdateFile([FILE_UPDATE_TEST]);
+ LOG("getCanApplyUpdates - testing write access " + updateTestFile.path);
+ testWriteAccess(updateTestFile, false);
- /**
- * On Windows, we no longer store the update under the app dir.
- *
- * If we are on Windows (including Vista, if we can't elevate) we need to
- * to check that we can create and remove files from the actual app
- * directory (like C:\Program Files\Mozilla Firefox). If we can't
- * (because this user is not an adminstrator, for example) canUpdate()
- * should return false.
- *
- * For Vista, we perform this check to enable updating the application
- * when the user has write access to the installation directory under the
- * following scenarios:
- * 1) the installation directory is not under Program Files
- * (e.g. C:\Program Files)
- * 2) UAC is turned off
- * 3) UAC is turned on and the user is not an admin
- * (e.g. the user does not have a split token)
- * 4) UAC is turned on and the user is already elevated, so they can't be
- * elevated again
- */
- if (!userCanElevate) {
- // if we're unable to create the test file this will throw an exception.
- let appDirTestFile = getAppBaseDir();
- appDirTestFile.append(FILE_UPDATE_TEST);
- LOG("getCanApplyUpdates - testing write access " + appDirTestFile.path);
- if (appDirTestFile.exists()) {
- appDirTestFile.remove(false);
- }
- appDirTestFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE);
- appDirTestFile.remove(false);
- }
+#ifdef XP_WIN
+ // Example windowsVersion: Windows XP == 5.1
+ let windowsVersion = Services.sysinfo.getProperty("version");
+ LOG("getCanApplyUpdates - windowsVersion = " + windowsVersion);
+
+ /**
+ * For Vista, updates can be performed to a location requiring admin
+ * privileges by requesting elevation via the UAC prompt when launching
+ * updater.exe if the appDir is under the Program Files directory
+ * (e.g. C:\Program Files\) and UAC is turned on and we can elevate
+ * (e.g. user has a split token).
+ *
+ * Note: this does note attempt to handle the case where UAC is turned on
+ * and the installation directory is in a restricted location that
+ * requires admin privileges to update other than Program Files.
+ */
+ let userCanElevate = false;
+
+ if (parseFloat(windowsVersion) >= 6) {
+ try {
+ // KEY_UPDROOT will fail and throw an exception if
+ // appDir is not under the Program Files, so we rely on that
+ let dir = Services.dirsvc.get(KEY_UPDROOT, Ci.nsIFile);
+ // appDir is under Program Files, so check if the user can elevate
+ userCanElevate = Services.appinfo.QueryInterface(Ci.nsIWinAppHelper).
+ userCanElevate;
+ LOG("getCanApplyUpdates - on Vista, userCanElevate: " + userCanElevate);
+ }
+ catch (ex) {
+ // When the installation directory is not under Program Files,
+ // fall through to checking if write access to the
+ // installation directory is available.
+ LOG("getCanApplyUpdates - on Vista, appDir is not under Program Files");
}
- } catch (e) {
- LOG("getCanApplyUpdates - unable to apply updates. Exception: " + e);
- // No write privileges to install directory
- return false;
}
- }
+
+ /**
+ * On Windows, we no longer store the update under the app dir.
+ *
+ * If we are on Windows (including Vista, if we can't elevate) we need to
+ * to check that we can create and remove files from the actual app
+ * directory (like C:\Program Files\Mozilla Firefox). If we can't
+ * (because this user is not an adminstrator, for example) canUpdate()
+ * should return false.
+ *
+ * For Vista, we perform this check to enable updating the application
+ * when the user has write access to the installation directory under the
+ * following scenarios:
+ * 1) the installation directory is not under Program Files
+ * (e.g. C:\Program Files)
+ * 2) UAC is turned off
+ * 3) UAC is turned on and the user is not an admin
+ * (e.g. the user does not have a split token)
+ * 4) UAC is turned on and the user is already elevated, so they can't be
+ * elevated again
+ */
+ if (!userCanElevate) {
+ // if we're unable to create the test file this will throw an exception.
+ let appDirTestFile = getAppBaseDir();
+ appDirTestFile.append(FILE_UPDATE_TEST);
+ LOG("getCanApplyUpdates - testing write access " + appDirTestFile.path);
+ if (appDirTestFile.exists()) {
+ appDirTestFile.remove(false);
+ }
+ appDirTestFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, FileUtils.PERMS_FILE);
+ appDirTestFile.remove(false);
+ }
+#endif // XP_WIN
+ } catch (e) {
+ LOG("getCanApplyUpdates - unable to apply updates. Exception: " + e);
+ // No write privileges to install directory
+ return false;
+ }
+#endif // !XP_MACOSX
LOG("getCanApplyUpdates - able to apply updates");
return true;
@@ -454,27 +453,29 @@ XPCOMUtils.defineLazyGetter(this, "gCanStageUpdatesSession", function aus_gCSUS(
try {
let updateTestFile;
- if (AppConstants.platform == "macosx") {
- updateTestFile = getUpdateFile([FILE_UPDATE_TEST]);
- } else {
- updateTestFile = getInstallDirRoot();
- updateTestFile.append(FILE_UPDATE_TEST);
- }
+#ifdef XP_MACOSX
+ updateTestFile = getUpdateFile([FILE_UPDATE_TEST]);
+#else
+ updateTestFile = getInstallDirRoot();
+ updateTestFile.append(FILE_UPDATE_TEST);
+#endif
+
LOG("gCanStageUpdatesSession - testing write access " +
updateTestFile.path);
testWriteAccess(updateTestFile, true);
- if (AppConstants.platform != "macosx") {
- // On all platforms except Mac, we need to test the parent directory as
- // well, as we need to be able to move files in that directory during the
- // replacing step.
- updateTestFile = getInstallDirRoot().parent;
- updateTestFile.append(FILE_UPDATE_TEST);
- LOG("gCanStageUpdatesSession - testing write access " +
- updateTestFile.path);
- updateTestFile.createUnique(Ci.nsILocalFile.DIRECTORY_TYPE,
- FileUtils.PERMS_DIRECTORY);
- updateTestFile.remove(false);
- }
+
+#ifndef XP_MACOSX
+ // On all platforms except Mac, we need to test the parent directory as
+ // well, as we need to be able to move files in that directory during the
+ // replacing step.
+ updateTestFile = getInstallDirRoot().parent;
+ updateTestFile.append(FILE_UPDATE_TEST);
+ LOG("gCanStageUpdatesSession - testing write access " +
+ updateTestFile.path);
+ updateTestFile.createUnique(Ci.nsILocalFile.DIRECTORY_TYPE,
+ FileUtils.PERMS_DIRECTORY);
+ updateTestFile.remove(false);
+#endif // !XP_MACOSX
} catch (e) {
LOG("gCanStageUpdatesSession - unable to stage updates. Exception: " +
e);
@@ -593,10 +594,10 @@ function getAppBaseDir() {
*/
function getInstallDirRoot() {
let dir = getAppBaseDir();
- if (AppConstants.platform == "macosx") {
- // On Mac, we store the Updated.app directory inside the bundle directory.
- dir = dir.parent.parent;
- }
+#ifdef XP_MACOSX
+ // On Mac, we store the Updated.app directory inside the bundle directory.
+ dir = dir.parent.parent;
+#endif
return dir;
}
@@ -879,31 +880,33 @@ function handleUpdateFailure(update, errorCode) {
let cancelations = Services.prefs.getIntPref(PREF_APP_UPDATE_CANCELATIONS, 0);
cancelations++;
Services.prefs.setIntPref(PREF_APP_UPDATE_CANCELATIONS, cancelations);
- if (AppConstants.platform == "macosx") {
- let osxCancelations = Services.prefs.getIntPref(PREF_APP_UPDATE_CANCELATIONS_OSX, 0);
- osxCancelations++;
- Services.prefs.setIntPref(PREF_APP_UPDATE_CANCELATIONS_OSX,
- osxCancelations);
- let maxCancels = Services.prefs.getIntPref(
- PREF_APP_UPDATE_CANCELATIONS_OSX_MAX,
- DEFAULT_CANCELATIONS_OSX_MAX);
- // Prevent the preference from setting a value greater than 5.
- maxCancels = Math.min(maxCancels, 5);
- if (osxCancelations >= maxCancels) {
- cleanupActiveUpdate();
- } else {
- writeStatusFile(getUpdatesDir(),
- update.state = STATE_PENDING_ELEVATE);
- }
- update.statusText = gUpdateBundle.GetStringFromName("elevationFailure");
- update.QueryInterface(Ci.nsIWritablePropertyBag);
- update.setProperty("patchingFailed", "elevationFailure");
- let prompter = Cc["@mozilla.org/updates/update-prompt;1"].
- createInstance(Ci.nsIUpdatePrompt);
- prompter.showUpdateError(update);
+
+#ifdef XP_MACOSX
+ let osxCancelations = Services.prefs.getIntPref(PREF_APP_UPDATE_CANCELATIONS_OSX, 0);
+ osxCancelations++;
+ Services.prefs.setIntPref(PREF_APP_UPDATE_CANCELATIONS_OSX,
+ osxCancelations);
+ let maxCancels = Services.prefs.getIntPref(
+ PREF_APP_UPDATE_CANCELATIONS_OSX_MAX,
+ DEFAULT_CANCELATIONS_OSX_MAX);
+ // Prevent the preference from setting a value greater than 5.
+ maxCancels = Math.min(maxCancels, 5);
+ if (osxCancelations >= maxCancels) {
+ cleanupActiveUpdate();
} else {
- writeStatusFile(getUpdatesDir(), update.state = STATE_PENDING);
+ writeStatusFile(getUpdatesDir(),
+ update.state = STATE_PENDING_ELEVATE);
}
+ update.statusText = gUpdateBundle.GetStringFromName("elevationFailure");
+ update.QueryInterface(Ci.nsIWritablePropertyBag);
+ update.setProperty("patchingFailed", "elevationFailure");
+ let prompter = Cc["@mozilla.org/updates/update-prompt;1"].
+ createInstance(Ci.nsIUpdatePrompt);
+ prompter.showUpdateError(update);
+#else
+ writeStatusFile(getUpdatesDir(), update.state = STATE_PENDING);
+#endif
+
return true;
}
@@ -1483,12 +1486,15 @@ UpdateService.prototype = {
Services.obs.removeObserver(this, topic);
Services.prefs.removeObserver(PREF_APP_UPDATE_LOG, this);
- if (AppConstants.platform == "win" && gUpdateMutexHandle) {
+#ifdef XP_WIN
+ if (gUpdateMutexHandle) {
// If we hold the update mutex, let it go!
// The OS would clean this up sometime after shutdown,
// but that would have no guarantee on timing.
closeHandle(gUpdateMutexHandle);
}
+#endif
+
if (this._retryTimer) {
this._retryTimer.cancel();
}
@@ -1845,7 +1851,8 @@ UpdateService.prototype = {
});
let update = minorUpdate || majorUpdate;
- if (AppConstants.platform == "macosx" && update) {
+#ifdef XP_MACOSX
+ if (update) {
if (getElevationRequired()) {
let installAttemptVersion = Services.prefs.getCharPref(
PREF_APP_UPDATE_ELEVATE_VERSION,
@@ -1895,6 +1902,7 @@ UpdateService.prototype = {
}
}
}
+#endif
return update;
},
@@ -2890,11 +2898,11 @@ Downloader.prototype = {
LOG("Downloader:_verifyDownload downloaded size == expected size.");
+#ifdef MOZ_VERIFY_MAR_SIGNATURE
// The hash check is not necessary when mar signatures are used to verify
// the downloaded mar file.
- if (AppConstants.MOZ_VERIFY_MAR_SIGNATURE) {
- return true;
- }
+ return true;
+#endif
let fileStream = Cc["@mozilla.org/network/file-input-stream;1"].
createInstance(Ci.nsIFileInputStream);
diff --git a/toolkit/mozapps/update/tests/Makefile.in b/toolkit/mozapps/update/tests/Makefile.in
deleted file mode 100644
index 0b8d19aa2..000000000
--- a/toolkit/mozapps/update/tests/Makefile.in
+++ /dev/null
@@ -1,39 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPCSHELLTESTROOT = $(topobjdir)/_tests/xpcshell/$(relativesrcdir)
-
-pp_const_file = $(srcdir)/data/xpcshellConstantsPP.js
-
-PP_TARGETS += aus-test-const
-aus-test-const := $(pp_const_file)
-aus-test-const_PATH := $(XPCSHELLTESTROOT)/data
-aus-test-const_FLAGS := -Fsubstitution $(DEFINES) $(ACDEFINES)
-aus-test-const_TARGET := misc
-
-INI_TEST_FILES = \
- TestAUSReadStrings1.ini \
- TestAUSReadStrings2.ini \
- TestAUSReadStrings3.ini \
- $(NULL)
-
-MOZ_WINCONSOLE = 1
-
-include $(topsrcdir)/config/rules.mk
-
-# TestAUSReadStrings runs during check in the following directory with a Unicode
-# char in order to test bug 473417 on Windows.
-ifeq ($(OS_ARCH),WINNT)
-bug473417dir = test_bug473417-ó
-else
-bug473417dir = test_bug473417
-endif
-
-check::
- $(RM) -rf $(DEPTH)/_tests/updater/ && $(NSINSTALL) -D $(DEPTH)/_tests/updater/$(bug473417dir)/
- for i in $(INI_TEST_FILES); do \
- $(INSTALL) $(srcdir)/$$i $(DEPTH)/_tests/updater/$(bug473417dir)/; \
- done
- $(INSTALL) $(FINAL_TARGET)/TestAUSReadStrings$(BIN_SUFFIX) $(DEPTH)/_tests/updater/$(bug473417dir)/
- @$(RUN_TEST_PROGRAM) $(DEPTH)/_tests/updater/$(bug473417dir)/TestAUSReadStrings$(BIN_SUFFIX)
diff --git a/toolkit/mozapps/update/tests/TestAUSHelper.cpp b/toolkit/mozapps/update/tests/TestAUSHelper.cpp
deleted file mode 100644
index a20c4a79a..000000000
--- a/toolkit/mozapps/update/tests/TestAUSHelper.cpp
+++ /dev/null
@@ -1,415 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-#ifdef XP_WIN
-# include <windows.h>
-# include <wintrust.h>
-# include <tlhelp32.h>
-# include <softpub.h>
-# include <direct.h>
-# include <io.h>
- typedef WCHAR NS_tchar;
-# define NS_main wmain
-# ifndef F_OK
-# define F_OK 00
-# endif
-# ifndef W_OK
-# define W_OK 02
-# endif
-# ifndef R_OK
-# define R_OK 04
-# endif
-# if defined(_MSC_VER) && _MSC_VER < 1900
-# define stat _stat
-# endif
-# define NS_T(str) L ## str
-# define NS_tsnprintf(dest, count, fmt, ...) \
- { \
- int _count = count - 1; \
- _snwprintf(dest, _count, fmt, ##__VA_ARGS__); \
- dest[_count] = L'\0'; \
- }
-# define NS_taccess _waccess
-# define NS_tchdir _wchdir
-# define NS_tfopen _wfopen
-# define NS_tstrcmp wcscmp
-# define NS_ttoi _wtoi
-# define NS_tstat _wstat
-# define NS_tgetcwd _wgetcwd
-# define LOG_S "%S"
-
-#include "../common/updatehelper.h"
-#include "../common/certificatecheck.h"
-
-#else
-# include <unistd.h>
-# define NS_main main
- typedef char NS_tchar;
-# define NS_T(str) str
-# define NS_tsnprintf snprintf
-# define NS_taccess access
-# define NS_tchdir chdir
-# define NS_tfopen fopen
-# define NS_tstrcmp strcmp
-# define NS_ttoi atoi
-# define NS_tstat stat
-# define NS_tgetcwd getcwd
-# define NS_tfputs fputs
-# define LOG_S "%s"
-#endif
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-
-#ifndef MAXPATHLEN
-# ifdef PATH_MAX
-# define MAXPATHLEN PATH_MAX
-# elif defined(MAX_PATH)
-# define MAXPATHLEN MAX_PATH
-# elif defined(_MAX_PATH)
-# define MAXPATHLEN _MAX_PATH
-# elif defined(CCHMAXPATH)
-# define MAXPATHLEN CCHMAXPATH
-# else
-# define MAXPATHLEN 1024
-# endif
-#endif
-
-static void
-WriteMsg(const NS_tchar *path, const char *status)
-{
- FILE* outFP = NS_tfopen(path, NS_T("wb"));
- if (!outFP) {
- return;
- }
-
- fprintf(outFP, "%s\n", status);
- fclose(outFP);
- outFP = nullptr;
-}
-
-static bool
-CheckMsg(const NS_tchar *path, const char *expected)
-{
- if (NS_taccess(path, F_OK)) {
- return false;
- }
-
- FILE *inFP = NS_tfopen(path, NS_T("rb"));
- if (!inFP) {
- return false;
- }
-
- struct stat ms;
- if (fstat(fileno(inFP), &ms)) {
- fclose(inFP);
- inFP = nullptr;
- return false;
- }
-
- char *mbuf = (char *) malloc(ms.st_size + 1);
- if (!mbuf) {
- fclose(inFP);
- inFP = nullptr;
- return false;
- }
-
- size_t r = ms.st_size;
- char *rb = mbuf;
- size_t c = fread(rb, sizeof(char), 50, inFP);
- r -= c;
- rb += c;
- if (c == 0 && r) {
- free(mbuf);
- fclose(inFP);
- inFP = nullptr;
- return false;
- }
- mbuf[ms.st_size] = '\0';
- rb = mbuf;
-
- bool isMatch = strcmp(rb, expected) == 0;
- free(mbuf);
- fclose(inFP);
- inFP = nullptr;
- return isMatch;
-}
-
-int NS_main(int argc, NS_tchar **argv)
-{
- if (argc == 2) {
- if (!NS_tstrcmp(argv[1], NS_T("post-update-async")) ||
- !NS_tstrcmp(argv[1], NS_T("post-update-sync"))) {
- NS_tchar exePath[MAXPATHLEN];
-#ifdef XP_WIN
- if (!::GetModuleFileNameW(0, exePath, MAXPATHLEN)) {
- return 1;
- }
-#else
- strcpy(exePath, argv[0]);
-#endif
- NS_tchar runFilePath[MAXPATHLEN];
- NS_tsnprintf(runFilePath, sizeof(runFilePath)/sizeof(runFilePath[0]),
- NS_T("%s.running"), exePath);
-#ifdef XP_WIN
- if (!NS_taccess(runFilePath, F_OK)) {
- // This makes it possible to check if the post update process was
- // launched twice which happens when the service performs an update.
- NS_tchar runFilePathBak[MAXPATHLEN];
- NS_tsnprintf(runFilePathBak, sizeof(runFilePathBak)/sizeof(runFilePathBak[0]),
- NS_T("%s.bak"), runFilePath);
- MoveFileExW(runFilePath, runFilePathBak, MOVEFILE_REPLACE_EXISTING);
- }
-#endif
- WriteMsg(runFilePath, "running");
-
- if (!NS_tstrcmp(argv[1], NS_T("post-update-sync"))) {
-#ifdef XP_WIN
- Sleep(2000);
-#else
- sleep(2);
-#endif
- }
-
- NS_tchar logFilePath[MAXPATHLEN];
- NS_tsnprintf(logFilePath, sizeof(logFilePath)/sizeof(logFilePath[0]),
- NS_T("%s.log"), exePath);
- WriteMsg(logFilePath, "post-update");
- return 0;
- }
- }
-
- if (argc < 3) {
- fprintf(stderr, \
- "\n" \
- "Application Update Service Test Helper\n" \
- "\n" \
- "Usage: WORKINGDIR INFILE OUTFILE -s SECONDS [FILETOLOCK]\n" \
- " or: WORKINGDIR LOGFILE [ARG2 ARG3...]\n" \
- " or: signature-check filepath\n" \
- " or: setup-symlink dir1 dir2 file symlink\n" \
- " or: remove-symlink dir1 dir2 file symlink\n" \
- " or: check-symlink symlink\n" \
- " or: post-update\n" \
- "\n" \
- " WORKINGDIR \tThe relative path to the working directory to use.\n" \
- " INFILE \tThe relative path from the working directory for the file to\n" \
- " \tread actions to perform such as finish.\n" \
- " OUTFILE \tThe relative path from the working directory for the file to\n" \
- " \twrite status information.\n" \
- " SECONDS \tThe number of seconds to sleep.\n" \
- " FILETOLOCK \tThe relative path from the working directory to an existing\n" \
- " \tfile to open exlusively.\n" \
- " \tOnly available on Windows platforms and silently ignored on\n" \
- " \tother platforms.\n" \
- " LOGFILE \tThe relative path from the working directory to log the\n" \
- " \tcommand line arguments.\n" \
- " ARG2 ARG3...\tArguments to write to the LOGFILE after the preceding command\n" \
- " \tline arguments.\n" \
- "\n" \
- "Note: All paths must be relative.\n" \
- "\n");
- return 1;
- }
-
- if (!NS_tstrcmp(argv[1], NS_T("check-signature"))) {
- // Not implemented
- return 1;
- }
-
- if (!NS_tstrcmp(argv[1], NS_T("setup-symlink"))) {
-#ifdef XP_UNIX
- NS_tchar path[MAXPATHLEN];
- NS_tsnprintf(path, sizeof(path)/sizeof(path[0]),
- NS_T("%s/%s"), NS_T("/tmp"), argv[2]);
- mkdir(path, 0755);
- NS_tsnprintf(path, sizeof(path)/sizeof(path[0]),
- NS_T("%s/%s/%s"), NS_T("/tmp"), argv[2], argv[3]);
- mkdir(path, 0755);
- NS_tsnprintf(path, sizeof(path)/sizeof(path[0]),
- NS_T("%s/%s/%s/%s"), NS_T("/tmp"), argv[2], argv[3], argv[4]);
- FILE * file = NS_tfopen(path, NS_T("w"));
- if (file) {
- NS_tfputs(NS_T("test"), file);
- fclose(file);
- }
- if (symlink(path, argv[5]) != 0) {
- return 1;
- }
- NS_tsnprintf(path, sizeof(path)/sizeof(path[0]),
- NS_T("%s/%s"), NS_T("/tmp"), argv[2]);
- if (argc > 6 && !NS_tstrcmp(argv[6], NS_T("change-perm"))) {
- chmod(path, 0644);
- }
- return 0;
-#else
- // Not implemented on non-Unix platforms
- return 1;
-#endif
- }
-
- if (!NS_tstrcmp(argv[1], NS_T("remove-symlink"))) {
-#ifdef XP_UNIX
- NS_tchar path[MAXPATHLEN];
- NS_tsnprintf(path, sizeof(path)/sizeof(path[0]),
- NS_T("%s/%s"), NS_T("/tmp"), argv[2]);
- chmod(path, 0755);
- NS_tsnprintf(path, sizeof(path)/sizeof(path[0]),
- NS_T("%s/%s/%s/%s"), NS_T("/tmp"), argv[2], argv[3], argv[4]);
- unlink(path);
- NS_tsnprintf(path, sizeof(path)/sizeof(path[0]),
- NS_T("%s/%s/%s"), NS_T("/tmp"), argv[2], argv[3]);
- rmdir(path);
- NS_tsnprintf(path, sizeof(path)/sizeof(path[0]),
- NS_T("%s/%s"), NS_T("/tmp"), argv[2]);
- rmdir(path);
- return 0;
-#else
- // Not implemented on non-Unix platforms
- return 1;
-#endif
- }
-
- if (!NS_tstrcmp(argv[1], NS_T("check-symlink"))) {
-#ifdef XP_UNIX
- struct stat ss;
- lstat(argv[2], &ss);
- return S_ISLNK(ss.st_mode) ? 0 : 1;
-#else
- // Not implemented on non-Unix platforms
- return 1;
-#endif
- }
-
- if (!NS_tstrcmp(argv[1], NS_T("wait-for-service-stop"))) {
-#ifdef XP_WIN
- const int maxWaitSeconds = NS_ttoi(argv[3]);
- LPCWSTR serviceName = argv[2];
- DWORD serviceState = WaitForServiceStop(serviceName, maxWaitSeconds);
- if (SERVICE_STOPPED == serviceState) {
- return 0;
- } else {
- return serviceState;
- }
-#else
- // Not implemented on non-Windows platforms
- return 1;
-#endif
- }
-
- if (!NS_tstrcmp(argv[1], NS_T("wait-for-application-exit"))) {
-#ifdef XP_WIN
- const int maxWaitSeconds = NS_ttoi(argv[3]);
- LPCWSTR application = argv[2];
- DWORD ret = WaitForProcessExit(application, maxWaitSeconds);
- if (ERROR_SUCCESS == ret) {
- return 0;
- } else if (WAIT_TIMEOUT == ret) {
- return 1;
- } else {
- return 2;
- }
-#else
- // Not implemented on non-Windows platforms
- return 1;
-#endif
- }
-
- if (!NS_tstrcmp(argv[1], NS_T("is-process-running"))) {
-#ifdef XP_WIN
- LPCWSTR application = argv[2];
- return (ERROR_NOT_FOUND == IsProcessRunning(application)) ? 0 : 1;
-#else
- // Not implemented on non-Windows platforms
- return 1;
-#endif
- }
-
- if (!NS_tstrcmp(argv[1], NS_T("launch-service"))) {
-#ifdef XP_WIN
- DWORD ret = LaunchServiceSoftwareUpdateCommand(argc - 2, (LPCWSTR *)argv + 2);
- if (ret != ERROR_SUCCESS) {
- // 192 is used to avoid reusing a possible return value from the call to
- // WaitForServiceStop
- return 0x000000C0;
- }
- // Wait a maximum of 120 seconds.
- DWORD lastState = WaitForServiceStop(SVC_NAME, 120);
- if (SERVICE_STOPPED == lastState) {
- return 0;
- }
- return lastState;
-#else
- // Not implemented on non-Windows platforms
- return 1;
-#endif
- }
-
- if (NS_tchdir(argv[1]) != 0) {
- return 1;
- }
-
- // File in use test helper section
- if (!NS_tstrcmp(argv[4], NS_T("-s"))) {
- NS_tchar *cwd = NS_tgetcwd(nullptr, 0);
- NS_tchar inFilePath[MAXPATHLEN];
- NS_tsnprintf(inFilePath, sizeof(inFilePath)/sizeof(inFilePath[0]),
- NS_T("%s/%s"), cwd, argv[2]);
- NS_tchar outFilePath[MAXPATHLEN];
- NS_tsnprintf(outFilePath, sizeof(outFilePath)/sizeof(outFilePath[0]),
- NS_T("%s/%s"), cwd, argv[3]);
-
- int seconds = NS_ttoi(argv[5]);
-#ifdef XP_WIN
- HANDLE hFile = INVALID_HANDLE_VALUE;
- if (argc == 7) {
- hFile = CreateFileW(argv[6],
- DELETE | GENERIC_WRITE, 0,
- nullptr, OPEN_EXISTING, 0, nullptr);
- if (hFile == INVALID_HANDLE_VALUE) {
- WriteMsg(outFilePath, "error_locking");
- return 1;
- }
- }
-
- WriteMsg(outFilePath, "sleeping");
- int i = 0;
- while (!CheckMsg(inFilePath, "finish\n") && i++ <= seconds) {
- Sleep(1000);
- }
-
- if (argc == 7) {
- CloseHandle(hFile);
- }
-#else
- WriteMsg(outFilePath, "sleeping");
- int i = 0;
- while (!CheckMsg(inFilePath, "finish\n") && i++ <= seconds) {
- sleep(1);
- }
-#endif
- WriteMsg(outFilePath, "finished");
- return 0;
- }
-
- {
- // Command line argument test helper section
- NS_tchar logFilePath[MAXPATHLEN];
- NS_tsnprintf(logFilePath, sizeof(logFilePath)/sizeof(logFilePath[0]),
- NS_T("%s"), argv[2]);
-
- FILE* logFP = NS_tfopen(logFilePath, NS_T("wb"));
- for (int i = 1; i < argc; ++i) {
- fprintf(logFP, LOG_S "\n", argv[i]);
- }
-
- fclose(logFP);
- logFP = nullptr;
- }
-
- return 0;
-}
diff --git a/toolkit/mozapps/update/tests/TestAUSReadStrings.cpp b/toolkit/mozapps/update/tests/TestAUSReadStrings.cpp
deleted file mode 100644
index c1de44f8e..000000000
--- a/toolkit/mozapps/update/tests/TestAUSReadStrings.cpp
+++ /dev/null
@@ -1,172 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * This binary tests the updater's ReadStrings ini parser and should run in a
- * directory with a Unicode character to test bug 473417.
- */
-#ifdef XP_WIN
- #include <windows.h>
- #define NS_main wmain
- #define NS_tstrrchr wcsrchr
- #define NS_T(str) L ## str
- #define PATH_SEPARATOR_CHAR L'\\'
- // On Windows, argv[0] can also have forward slashes instead
- #define ALT_PATH_SEPARATOR_CHAR L'/'
-#else
- #include <unistd.h>
- #define NS_main main
- #define NS_tstrrchr strrchr
- #define NS_T(str) str
- #define PATH_SEPARATOR_CHAR '/'
-#endif
-
-#include <stdio.h>
-#include <stdarg.h>
-#include <string.h>
-
-#include "updater/resource.h"
-#include "updater/progressui.h"
-#include "common/readstrings.h"
-#include "common/errors.h"
-#include "mozilla/ArrayUtils.h"
-
-#ifndef MAXPATHLEN
-# ifdef PATH_MAX
-# define MAXPATHLEN PATH_MAX
-# elif defined(MAX_PATH)
-# define MAXPATHLEN MAX_PATH
-# elif defined(_MAX_PATH)
-# define MAXPATHLEN _MAX_PATH
-# elif defined(CCHMAXPATH)
-# define MAXPATHLEN CCHMAXPATH
-# else
-# define MAXPATHLEN 1024
-# endif
-#endif
-
-#define TEST_NAME "Updater ReadStrings"
-
-using namespace mozilla;
-
-static int gFailCount = 0;
-
-/**
- * Prints the given failure message and arguments using printf, prepending
- * "TEST-UNEXPECTED-FAIL " for the benefit of the test harness and
- * appending "\n" to eliminate having to type it at each call site.
- */
-void fail(const char* msg, ...)
-{
- va_list ap;
-
- printf("TEST-UNEXPECTED-FAIL | ");
-
- va_start(ap, msg);
- vprintf(msg, ap);
- va_end(ap);
-
- putchar('\n');
- ++gFailCount;
-}
-
-int NS_main(int argc, NS_tchar **argv)
-{
- printf("Running TestAUSReadStrings tests\n");
-
- int rv = 0;
- int retval;
- NS_tchar inifile[MAXPATHLEN];
- StringTable testStrings;
-
- NS_tchar *slash = NS_tstrrchr(argv[0], PATH_SEPARATOR_CHAR);
-#ifdef ALT_PATH_SEPARATOR_CHAR
- NS_tchar *altslash = NS_tstrrchr(argv[0], ALT_PATH_SEPARATOR_CHAR);
- slash = (slash > altslash) ? slash : altslash;
-#endif // ALT_PATH_SEPARATOR_CHAR
-
- if (!slash) {
- fail("%s | unable to find platform specific path separator (check 1)", TEST_NAME);
- return 20;
- }
-
- *(++slash) = '\0';
- // Test success when the ini file exists with both Title and Info in the
- // Strings section and the values for Title and Info.
- NS_tsnprintf(inifile, ArrayLength(inifile), NS_T("%sTestAUSReadStrings1.ini"), argv[0]);
- retval = ReadStrings(inifile, &testStrings);
- if (retval == OK) {
- if (strcmp(testStrings.title, "Title Test - \xD0\x98\xD1\x81\xD0\xBF\xD1\x8B" \
- "\xD1\x82\xD0\xB0\xD0\xBD\xD0\xB8\xD0\xB5 " \
- "\xCE\x94\xCE\xBF\xCE\xBA\xCE\xB9\xCE\xBC\xCE\xAE " \
- "\xE3\x83\x86\xE3\x82\xB9\xE3\x83\x88 " \
- "\xE6\xB8\xAC\xE8\xA9\xA6 " \
- "\xE6\xB5\x8B\xE8\xAF\x95") != 0) {
- rv = 21;
- fail("%s | Title ini value incorrect (check 3)", TEST_NAME);
- }
-
- if (strcmp(testStrings.info, "Info Test - \xD0\x98\xD1\x81\xD0\xBF\xD1\x8B" \
- "\xD1\x82\xD0\xB0\xD0\xBD\xD0\xB8\xD0\xB5 " \
- "\xCE\x94\xCE\xBF\xCE\xBA\xCE\xB9\xCE\xBC\xCE\xAE " \
- "\xE3\x83\x86\xE3\x82\xB9\xE3\x83\x88 " \
- "\xE6\xB8\xAC\xE8\xA9\xA6 " \
- "\xE6\xB5\x8B\xE8\xAF\x95\xE2\x80\xA6") != 0) {
- rv = 22;
- fail("%s | Info ini value incorrect (check 4)", TEST_NAME);
- }
- } else {
- fail("%s | ReadStrings returned %i (check 2)", TEST_NAME, retval);
- rv = 23;
- }
-
- // Test failure when the ini file exists without Title and with Info in the
- // Strings section.
- NS_tsnprintf(inifile, ArrayLength(inifile), NS_T("%sTestAUSReadStrings2.ini"), argv[0]);
- retval = ReadStrings(inifile, &testStrings);
- if (retval != PARSE_ERROR) {
- rv = 24;
- fail("%s | ReadStrings returned %i (check 5)", TEST_NAME, retval);
- }
-
- // Test failure when the ini file exists with Title and without Info in the
- // Strings section.
- NS_tsnprintf(inifile, ArrayLength(inifile), NS_T("%sTestAUSReadStrings3.ini"), argv[0]);
- retval = ReadStrings(inifile, &testStrings);
- if (retval != PARSE_ERROR) {
- rv = 25;
- fail("%s | ReadStrings returned %i (check 6)", TEST_NAME, retval);
- }
-
- // Test failure when the ini file doesn't exist
- NS_tsnprintf(inifile, ArrayLength(inifile), NS_T("%sTestAUSReadStringsBogus.ini"), argv[0]);
- retval = ReadStrings(inifile, &testStrings);
- if (retval != READ_ERROR) {
- rv = 26;
- fail("%s | ini file doesn't exist (check 7)", TEST_NAME);
- }
-
- // Test reading a non-default section name
- NS_tsnprintf(inifile, ArrayLength(inifile), NS_T("%sTestAUSReadStrings3.ini"), argv[0]);
- retval = ReadStrings(inifile, "Title\0", 1, &testStrings.title, "BogusSection2");
- if (retval == OK) {
- if (strcmp(testStrings.title, "Bogus Title") != 0) {
- rv = 27;
- fail("%s | Title ini value incorrect (check 9)", TEST_NAME);
- }
- } else {
- fail("%s | ReadStrings returned %i (check 8)", TEST_NAME, retval);
- rv = 28;
- }
-
-
- if (rv == 0) {
- printf("TEST-PASS | %s | all checks passed\n", TEST_NAME);
- } else {
- fail("%s | %i out of 9 checks failed", TEST_NAME, gFailCount);
- }
-
- return rv;
-}
diff --git a/toolkit/mozapps/update/tests/TestAUSReadStrings1.ini b/toolkit/mozapps/update/tests/TestAUSReadStrings1.ini
deleted file mode 100644
index 5ab13c185..000000000
--- a/toolkit/mozapps/update/tests/TestAUSReadStrings1.ini
+++ /dev/null
@@ -1,47 +0,0 @@
-; This file is in the UTF-8 encoding
-
-[BogusSection1]
-
-; Comment
-
-Title=Bogus Title
-
-; Comment
-
-Info=Bogus Info
-
-; Comment
-
-[Strings]
-
-Bogus1=Bogus1
-
-; Comment
-
-Title=Title Test - ИÑпытание Δοκιμή テスト 測試 测试
-
-; Comment
-
-Bogus2=Bogus2
-
-; Comment
-
-Info=Info Test - ИÑпытание Δοκιμή テスト 測試 测试…
-
-; Comment
-
-Bogus3=Bogus3
-
-; Comment
-
-[BogusSection2]
-
-; Comment
-
-Title=Bogus Title
-
-; Comment
-
-Info=Bogus Info
-
-; Comment
diff --git a/toolkit/mozapps/update/tests/TestAUSReadStrings2.ini b/toolkit/mozapps/update/tests/TestAUSReadStrings2.ini
deleted file mode 100644
index 8291a7c94..000000000
--- a/toolkit/mozapps/update/tests/TestAUSReadStrings2.ini
+++ /dev/null
@@ -1,39 +0,0 @@
-; This file is in the UTF-8 encoding
-
-[BogusSection1]
-
-; Comment
-
-Title=Bogus Title
-
-; Comment
-
-Info=Bogus Info
-
-; Comment
-
-[Strings]
-
-Bogus1=Bogus1
-
-; Comment
-
-Info=Info
-
-; Comment
-
-Bogus2=Bogus2
-
-; Comment
-
-[BogusSection2]
-
-; Comment
-
-Title=Bogus Title
-
-; Comment
-
-Info=Bogus Info
-
-; Comment
diff --git a/toolkit/mozapps/update/tests/TestAUSReadStrings3.ini b/toolkit/mozapps/update/tests/TestAUSReadStrings3.ini
deleted file mode 100644
index a64d1232e..000000000
--- a/toolkit/mozapps/update/tests/TestAUSReadStrings3.ini
+++ /dev/null
@@ -1,39 +0,0 @@
-; This file is in the UTF-8 encoding
-
-[BogusSection1]
-
-; Comment
-
-Title=Bogus Title
-
-; Comment
-
-Info=Bogus Info
-
-; Comment
-
-[Strings]
-
-Bogus1=Bogus1
-
-; Comment
-
-Title=Title
-
-; Comment
-
-Bogus2=Bogus2
-
-; Comment
-
-[BogusSection2]
-
-; Comment
-
-Title=Bogus Title
-
-; Comment
-
-Info=Bogus Info
-
-; Comment
diff --git a/toolkit/mozapps/update/tests/chrome/.eslintrc.js b/toolkit/mozapps/update/tests/chrome/.eslintrc.js
deleted file mode 100644
index 8c0f4f574..000000000
--- a/toolkit/mozapps/update/tests/chrome/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/mozapps/update/tests/chrome/chrome.ini b/toolkit/mozapps/update/tests/chrome/chrome.ini
deleted file mode 100644
index 88e3dd4e8..000000000
--- a/toolkit/mozapps/update/tests/chrome/chrome.ini
+++ /dev/null
@@ -1,64 +0,0 @@
-; This Source Code Form is subject to the terms of the Mozilla Public
-; License, v. 2.0. If a copy of the MPL was not distributed with this
-; file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-[DEFAULT]
-tags = appupdate
-support-files =
- utils.js
- update.sjs
-
-; mochitest-chrome tests must start with "test_" and are executed in sorted
-; order and not in the order specified in the manifest.
-[test_0010_background_basic.xul]
-[test_0011_check_basic.xul]
-[test_0012_check_basic_staging.xul]
-skip-if = asan
-reason = Bug 1168003
-[test_0013_check_no_updates.xul]
-[test_0014_check_error_xml_malformed.xul]
-[test_0061_check_verifyFailPartial_noComplete.xul]
-[test_0062_check_verifyFailComplete_noPartial.xul]
-[test_0063_check_verifyFailPartialComplete.xul]
-[test_0064_check_verifyFailPartial_successComplete.xul]
-[test_0071_notify_verifyFailPartial_noComplete.xul]
-[test_0072_notify_verifyFailComplete_noPartial.xul]
-[test_0073_notify_verifyFailPartialComplete.xul]
-[test_0074_notify_verifyFailPartial_successComplete.xul]
-[test_0081_error_patchApplyFailure_partial_only.xul]
-[test_0082_error_patchApplyFailure_complete_only.xul]
-[test_0083_error_patchApplyFailure_partial_complete.xul]
-[test_0084_error_patchApplyFailure_verify_failed.xul]
-[test_0085_error_patchApplyFailure_partial_complete_staging.xul]
-skip-if = asan
-reason = Bug 1168003
-[test_0092_finishedBackground.xul]
-[test_0093_restartNotification.xul]
-[test_0094_restartNotification_remote.xul]
-[test_0095_restartNotification_remoteInvalidNumber.xul]
-[test_0096_restartNotification_stagedBackground.xul]
-skip-if = asan
-reason = Bug 1168003
-[test_0097_restartNotification_stagedServiceBackground.xul]
-skip-if = os != 'win'
-reason = only Windows has the maintenance service.
-[test_0101_background_restartNotification.xul]
-[test_0102_background_restartNotification_staging.xul]
-skip-if = asan
-reason = Bug 1168003
-[test_0103_background_restartNotification_stagingService.xul]
-skip-if = os != 'win'
-reason = only Windows has the maintenance service.
-[test_0111_neverButton_basic.xul]
-[test_0113_showNeverForVersionRemovedWithPref.xul]
-[test_0151_notify_backgroundCheckError.xul]
-[test_0152_notify_backgroundCheckOfflineRetry.xul]
-[test_0161_check_unsupported.xul]
-[test_0162_notify_unsupported.xul]
-[test_0171_check_noPerms_manual.xul]
-skip-if = os != 'win'
-reason = test must be able to prevent file deletion.
-[test_0172_notify_noPerms_manual.xul]
-skip-if = os != 'win'
-reason = test must be able to prevent file deletion.
-[test_9999_cleanup.xul]
diff --git a/toolkit/mozapps/update/tests/chrome/test_0010_background_basic.xul b/toolkit/mozapps/update/tests/chrome/test_0010_background_basic.xul
deleted file mode 100644
index 8d088cc8a..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0010_background_basic.xul
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: basic, download, and finished"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_FOUND_BASIC,
- buttonClick: "next"
-}, {
- pageid: PAGEID_DOWNLOADING
-}, {
- pageid: PAGEID_FINISHED,
- buttonClick: "extra1"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1&showPrompt=1" +
- getVersionParams();
- setUpdateURL(url);
-
- gAUS.checkForBackgroundUpdates();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0011_check_basic.xul b/toolkit/mozapps/update/tests/chrome/test_0011_check_basic.xul
deleted file mode 100644
index 12b5302a4..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0011_check_basic.xul
+++ /dev/null
@@ -1,51 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: update check, basic, download, and finished"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_CHECKING
-}, {
- pageid: PAGEID_FOUND_BASIC,
- buttonClick: "next"
-}, {
- pageid: PAGEID_DOWNLOADING
-}, {
- pageid: PAGEID_FINISHED,
- buttonClick: "extra1"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1" + getVersionParams();
- setUpdateURL(url);
-
- gUP.checkForUpdates();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0012_check_basic_staging.xul b/toolkit/mozapps/update/tests/chrome/test_0012_check_basic_staging.xul
deleted file mode 100644
index d910adc08..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0012_check_basic_staging.xul
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: update check, basic, download with staging, and finished"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_CHECKING
-}, {
- pageid: PAGEID_FOUND_BASIC,
- buttonClick: "next"
-}, {
- pageid: PAGEID_DOWNLOADING
-}, {
- pageid: PAGEID_FINISHED,
- buttonClick: "extra1"
-} ];
-
-gUseTestUpdater = true;
-
-function runTest() {
- debugDump("entering");
-
- Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, true);
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1" + getVersionParams();
- setUpdateURL(url);
-
- gUP.checkForUpdates();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0013_check_no_updates.xul b/toolkit/mozapps/update/tests/chrome/test_0013_check_no_updates.xul
deleted file mode 100644
index c3f024c73..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0013_check_no_updates.xul
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: update check and no updates found"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_CHECKING
-}, {
- pageid: PAGEID_NO_UPDATES_FOUND,
- buttonClick: "finish"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let url = URL_HTTP_UPDATE_XML + "?noUpdates=1";
- setUpdateURL(url);
-
- gUP.checkForUpdates();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0014_check_error_xml_malformed.xul b/toolkit/mozapps/update/tests/chrome/test_0014_check_error_xml_malformed.xul
deleted file mode 100644
index f399a0096..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0014_check_error_xml_malformed.xul
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: update check and error (xml malformed)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_CHECKING
-}, {
- pageid: PAGEID_ERRORS,
- buttonClick: "finish"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let url = URL_HTTP_UPDATE_XML + "?xmlMalformed=1";
- setUpdateURL(url);
-
- gUP.checkForUpdates();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0061_check_verifyFailPartial_noComplete.xul b/toolkit/mozapps/update/tests/chrome/test_0061_check_verifyFailPartial_noComplete.xul
deleted file mode 100644
index 1040c19e3..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0061_check_verifyFailPartial_noComplete.xul
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: update check, basic, download, and errors (partial patch with an invalid size)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_CHECKING
-}, {
- pageid: PAGEID_FOUND_BASIC,
- buttonClick: "next"
-}, {
- pageid: PAGEID_DOWNLOADING
-}, {
- pageid: PAGEID_ERRORS,
- buttonClick: "finish"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1&partialPatchOnly=1" +
- "&invalidPartialSize=1" + getVersionParams();
- setUpdateURL(url);
-
- gUP.checkForUpdates();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0062_check_verifyFailComplete_noPartial.xul b/toolkit/mozapps/update/tests/chrome/test_0062_check_verifyFailComplete_noPartial.xul
deleted file mode 100644
index 9221a4b98..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0062_check_verifyFailComplete_noPartial.xul
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: update check, basic, download, and errors (complete patch with an invalid size)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_CHECKING
-}, {
- pageid: PAGEID_FOUND_BASIC,
- buttonClick: "next"
-}, {
- pageid: PAGEID_DOWNLOADING
-}, {
- pageid: PAGEID_ERRORS,
- buttonClick: "finish"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1&completePatchOnly=1" +
- "&invalidCompleteSize=1" + getVersionParams();
- setUpdateURL(url);
-
- gUP.checkForUpdates();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0063_check_verifyFailPartialComplete.xul b/toolkit/mozapps/update/tests/chrome/test_0063_check_verifyFailPartialComplete.xul
deleted file mode 100644
index 8da5c7e97..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0063_check_verifyFailPartialComplete.xul
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: update check, basic, download, and errors (partial and complete patches with invalid sizes)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_CHECKING
-}, {
- pageid: PAGEID_FOUND_BASIC,
- buttonClick: "next"
-}, {
- pageid: PAGEID_DOWNLOADING
-}, {
- pageid: PAGEID_ERRORS,
- buttonClick: "finish"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1&invalidPartialSize=1" +
- "&invalidCompleteSize=1" + getVersionParams();
- setUpdateURL(url);
-
- gUP.checkForUpdates();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0064_check_verifyFailPartial_successComplete.xul b/toolkit/mozapps/update/tests/chrome/test_0064_check_verifyFailPartial_successComplete.xul
deleted file mode 100644
index db0f33d2f..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0064_check_verifyFailPartial_successComplete.xul
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: update check, basic, download, and finished (partial patch with an invalid size and successful complete patch)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_CHECKING
-}, {
- pageid: PAGEID_FOUND_BASIC,
- buttonClick: "next"
-}, {
- pageid: PAGEID_DOWNLOADING
-}, {
- pageid: PAGEID_FINISHED,
- buttonClick: "extra1"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1&invalidPartialSize=1" +
- getVersionParams();
- setUpdateURL(url);
-
- gUP.checkForUpdates();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0071_notify_verifyFailPartial_noComplete.xul b/toolkit/mozapps/update/tests/chrome/test_0071_notify_verifyFailPartial_noComplete.xul
deleted file mode 100644
index 736df13a3..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0071_notify_verifyFailPartial_noComplete.xul
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: errors (partial patch with an invalid size)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_ERRORS,
- buttonClick: "finish"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let patches = getLocalPatchString("partial", null, null, null, "1234", null,
- STATE_DOWNLOADING);
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version,
- Services.appinfo.platformVersion);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_DOWNLOADING);
- reloadUpdateManagerData();
-
- testPostUpdateProcessing();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0072_notify_verifyFailComplete_noPartial.xul b/toolkit/mozapps/update/tests/chrome/test_0072_notify_verifyFailComplete_noPartial.xul
deleted file mode 100644
index cafab4d27..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0072_notify_verifyFailComplete_noPartial.xul
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: errors (complete patch with an invalid size)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_ERRORS,
- buttonClick: "finish"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let patches = getLocalPatchString("complete", null, null, null, "1234", null,
- STATE_DOWNLOADING);
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_DOWNLOADING);
- reloadUpdateManagerData();
-
- testPostUpdateProcessing();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0073_notify_verifyFailPartialComplete.xul b/toolkit/mozapps/update/tests/chrome/test_0073_notify_verifyFailPartialComplete.xul
deleted file mode 100644
index c1db983a3..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0073_notify_verifyFailPartialComplete.xul
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: errors (partial and complete patches with invalid sizes)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_ERRORS,
- buttonClick: "finish"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let patches = getLocalPatchString("partial", null, null, null, "1234", null,
- STATE_DOWNLOADING) +
- getLocalPatchString("complete", null, null, null, "1234",
- "false");
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version, null,
- null, null, null, null, "false");
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_DOWNLOADING);
- reloadUpdateManagerData();
-
- testPostUpdateProcessing();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0074_notify_verifyFailPartial_successComplete.xul b/toolkit/mozapps/update/tests/chrome/test_0074_notify_verifyFailPartial_successComplete.xul
deleted file mode 100644
index 2c28da768..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0074_notify_verifyFailPartial_successComplete.xul
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: finishedBackground (partial patch with an invalid size and successful complete patch)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_FINISHED_BKGRD,
- buttonClick: "extra1"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let patches = getLocalPatchString("partial", null, null, null, "1234", null,
- STATE_DOWNLOADING) +
- getLocalPatchString("complete", null, null, null, null,
- "false");
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version, null,
- null, null, null, null, "false");
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_DOWNLOADING);
- reloadUpdateManagerData();
-
- testPostUpdateProcessing();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0081_error_patchApplyFailure_partial_only.xul b/toolkit/mozapps/update/tests/chrome/test_0081_error_patchApplyFailure_partial_only.xul
deleted file mode 100644
index 10c34f63b..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0081_error_patchApplyFailure_partial_only.xul
+++ /dev/null
@@ -1,53 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: errors (partial only patch apply failure)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_ERRORS,
- buttonClick: "finish"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let patches = getLocalPatchString("partial", null, null, null, null, null,
- STATE_PENDING);
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version, null,
- null, null, null, null, "false");
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_FAILED_CRC_ERROR);
- reloadUpdateManagerData();
-
- testPostUpdateProcessing();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0082_error_patchApplyFailure_complete_only.xul b/toolkit/mozapps/update/tests/chrome/test_0082_error_patchApplyFailure_complete_only.xul
deleted file mode 100644
index 2c4b389f4..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0082_error_patchApplyFailure_complete_only.xul
+++ /dev/null
@@ -1,52 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: errors (complete only patch apply failure)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_ERRORS,
- buttonClick: "finish"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let patches = getLocalPatchString("complete", null, null, null, null, null,
- STATE_PENDING);
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_FAILED_CRC_ERROR);
- reloadUpdateManagerData();
-
- testPostUpdateProcessing();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0083_error_patchApplyFailure_partial_complete.xul b/toolkit/mozapps/update/tests/chrome/test_0083_error_patchApplyFailure_partial_complete.xul
deleted file mode 100644
index 01adb1c3d..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0083_error_patchApplyFailure_partial_complete.xul
+++ /dev/null
@@ -1,67 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: error patching, download, and finished (partial failed and download complete)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_ERROR_PATCHING,
- buttonClick: "next"
-}, {
- pageid: PAGEID_DOWNLOADING,
- extraStartFunction: createContinueFile
-}, {
- pageid: PAGEID_FINISHED,
- buttonClick: "extra1",
- extraStartFunction: removeContinueFile
-} ];
-
-function runTest() {
- debugDump("entering");
-
- removeContinueFile();
-
- // Specify the url to update.sjs with a slowDownloadMar param so the ui can
- // load before the download completes.
- let slowDownloadURL = URL_HTTP_UPDATE_XML + "?slowDownloadMar=1";
- let patches = getLocalPatchString("partial", null, null, null, null, null,
- STATE_PENDING) +
- getLocalPatchString("complete", slowDownloadURL, null, null,
- null, "false");
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version, null,
- null, null, null, null, "false");
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_FAILED_CRC_ERROR);
- reloadUpdateManagerData();
-
- testPostUpdateProcessing();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0084_error_patchApplyFailure_verify_failed.xul b/toolkit/mozapps/update/tests/chrome/test_0084_error_patchApplyFailure_verify_failed.xul
deleted file mode 100644
index 2e0c2b41e..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0084_error_patchApplyFailure_verify_failed.xul
+++ /dev/null
@@ -1,68 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: error patching, download, and errors (partial failed and download complete verification failure)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_ERROR_PATCHING,
- buttonClick: "next"
-}, {
- pageid: PAGEID_DOWNLOADING,
- extraStartFunction: createContinueFile
-}, {
- pageid: PAGEID_ERRORS,
- buttonClick: "finish",
- extraStartFunction: removeContinueFile
-} ];
-
-function runTest() {
- debugDump("entering");
-
- removeContinueFile();
-
- // Specify the url to update.sjs with a slowDownloadMar param so the ui can
- // load before the download completes.
- let slowDownloadURL = URL_HTTP_UPDATE_XML + "?slowDownloadMar=1";
- let patches = getLocalPatchString("partial", null, null, null, null, null,
- STATE_PENDING) +
- getLocalPatchString("complete", slowDownloadURL, "MD5",
- null, "1234",
- "false");
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version, null,
- null, null, null, null, "false");
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_FAILED_CRC_ERROR);
- reloadUpdateManagerData();
-
- testPostUpdateProcessing();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0085_error_patchApplyFailure_partial_complete_staging.xul b/toolkit/mozapps/update/tests/chrome/test_0085_error_patchApplyFailure_partial_complete_staging.xul
deleted file mode 100644
index fc83505f9..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0085_error_patchApplyFailure_partial_complete_staging.xul
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: error patching, download with staging, and finished (partial failed and download complete), with fast MAR download"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-// This test forces the download to complete before the "next" button on the
-// errorpatching wizard page is clicked. This is done by creating the continue
-// file when the wizard loads to start the download, then clicking the "next"
-// button in the download's onStopRequest event listener.
-
-const testDownloadListener = {
- onStartRequest(aRequest, aContext) { },
-
- onProgress(aRequest, aContext, aProgress, aMaxProgress) { },
-
- onStatus(aRequest, aContext, aStatus, aStatusText) { },
-
- onStopRequest(aRequest, aContext, aStatus) {
- debugDump("clicking errorpatching page next button");
- gDocElem.getButton("next").click();
- gAUS.removeDownloadListener(this);
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIRequestObserver,
- Ci.nsIProgressEventSink])
-};
-
-let TESTS = [ {
- pageid: PAGEID_ERROR_PATCHING,
- extraCheckFunction: createContinueFile
-}, {
- pageid: PAGEID_DOWNLOADING
-}, {
- pageid: PAGEID_FINISHED,
- buttonClick: "extra1",
- extraStartFunction: removeContinueFile
-} ];
-
-gUseTestUpdater = true;
-
-function runTest() {
- debugDump("entering");
-
- removeContinueFile();
-
- // Specify the url to update.sjs with a slowDownloadMar param so the ui can
- // load before the download completes.
- let slowDownloadURL = URL_HTTP_UPDATE_XML + "?slowDownloadMar=1";
- let patches = getLocalPatchString("partial", null, null, null, null, null,
- STATE_PENDING) +
- getLocalPatchString("complete", slowDownloadURL, null, null,
- null, "false");
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version, null,
- null, null, null, null, "false");
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_FAILED_READ_ERROR);
-
- Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, true);
-
- reloadUpdateManagerData();
-
- testPostUpdateProcessing();
-
- gAUS.addDownloadListener(testDownloadListener);
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0092_finishedBackground.xul b/toolkit/mozapps/update/tests/chrome/test_0092_finishedBackground.xul
deleted file mode 100644
index a0b29ddea..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0092_finishedBackground.xul
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: finished background"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_FINISHED_BKGRD,
- buttonClick: "extra1"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let patches = getLocalPatchString("complete", null, null, null, null, null,
- STATE_PENDING);
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version,
- Services.appinfo.platformVersion);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_SUCCEEDED);
-
- reloadUpdateManagerData();
-
- is(gUpdateManager.activeUpdate.state, "pending",
- "The active update should have a state of pending");
-
- gUP.showUpdateDownloaded(gUpdateManager.activeUpdate);
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0093_restartNotification.xul b/toolkit/mozapps/update/tests/chrome/test_0093_restartNotification.xul
deleted file mode 100644
index 6db5b9897..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0093_restartNotification.xul
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: restart notification pref promptWaitTime"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_FINISHED_BKGRD,
- buttonClick: "extra1"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let patches = getLocalPatchString("complete", null, null, null, null, null,
- STATE_PENDING);
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_SUCCEEDED);
-
- Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 1);
-
- reloadUpdateManagerData();
-
- is(gUpdateManager.activeUpdate.state, STATE_PENDING,
- "The active update should have a state of " + STATE_PENDING);
-
- ok(gUpdateManager.activeUpdate.promptWaitTime == 1, "Checking that the " +
- "update's promptWaitTime attribute value was set from the " +
- PREF_APP_UPDATE_PROMPTWAITTIME + " preference");
-
- gUP.showUpdateDownloaded(gUpdateManager.activeUpdate, true);
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0094_restartNotification_remote.xul b/toolkit/mozapps/update/tests/chrome/test_0094_restartNotification_remote.xul
deleted file mode 100644
index 6e72a42c1..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0094_restartNotification_remote.xul
+++ /dev/null
@@ -1,60 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: restart notification xml promptWaitTime"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_FINISHED_BKGRD,
- buttonClick: "extra1"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let patches = getLocalPatchString("complete", null, null, null, null, null,
- STATE_PENDING);
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version, null,
- null, null, null, null, false,
- null, false, false, false, 1);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_SUCCEEDED);
-
- reloadUpdateManagerData();
-
- is(gUpdateManager.activeUpdate.state, STATE_PENDING,
- "The active update should have a state of " + STATE_PENDING);
-
- ok(gUpdateManager.activeUpdate.promptWaitTime == 1, "Checking that the " +
- "update's promptWaitTime attribute value was set by the XML");
-
- gUP.showUpdateDownloaded(gUpdateManager.activeUpdate, true);
-
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0095_restartNotification_remoteInvalidNumber.xul b/toolkit/mozapps/update/tests/chrome/test_0095_restartNotification_remoteInvalidNumber.xul
deleted file mode 100644
index 5b1b826a5..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0095_restartNotification_remoteInvalidNumber.xul
+++ /dev/null
@@ -1,66 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: restart notification xml promptWaitTime with invalid number"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_FINISHED_BKGRD,
- buttonClick: "extra1"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let patches = getLocalPatchString("complete", null, null, null, null, null,
- STATE_PENDING);
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version,
- null, null,
- null, null, null,
- null, false, null,
- false, false,
- false, "invalidNumber");
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_SUCCEEDED);
-
- Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 1);
-
- reloadUpdateManagerData();
-
- is(gUpdateManager.activeUpdate.state, STATE_PENDING,
- "The active update should have a state of " + STATE_PENDING);
-
- ok(gUpdateManager.activeUpdate.promptWaitTime == 1, "Checking that the " +
- "update's promptWaitTime attribute value was set from the " +
- PREF_APP_UPDATE_PROMPTWAITTIME + " preference");
-
- gUP.showUpdateDownloaded(gUpdateManager.activeUpdate, true);
-
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0096_restartNotification_stagedBackground.xul b/toolkit/mozapps/update/tests/chrome/test_0096_restartNotification_stagedBackground.xul
deleted file mode 100644
index b86861012..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0096_restartNotification_stagedBackground.xul
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: restart notification staged w/o service"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_FINISHED_BKGRD,
- buttonClick: "extra1"
-} ];
-
-gUseTestUpdater = true;
-
-function runTest() {
- debugDump("entering");
-
- let patches = getLocalPatchString("complete", null, null, null, null, null,
- STATE_APPLIED);
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version,
- Services.appinfo.platformVersion);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_APPLIED);
-
- Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 1);
- Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, true);
- Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, false);
-
- reloadUpdateManagerData();
-
- is(gUpdateManager.activeUpdate.state, STATE_APPLIED,
- "The active update should have a state of " + STATE_APPLIED);
-
- ok(gUpdateManager.activeUpdate.promptWaitTime == 1, "Checking that the " +
- "update's promptWaitTime attribute value was set from the " +
- PREF_APP_UPDATE_PROMPTWAITTIME + " preference");
-
- gUpdateManager.refreshUpdateStatus();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0097_restartNotification_stagedServiceBackground.xul b/toolkit/mozapps/update/tests/chrome/test_0097_restartNotification_stagedServiceBackground.xul
deleted file mode 100644
index 9f7a602c4..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0097_restartNotification_stagedServiceBackground.xul
+++ /dev/null
@@ -1,65 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: restart notification staged with service"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_FINISHED_BKGRD,
- buttonClick: "extra1"
-} ];
-
-gUseTestUpdater = true;
-
-function runTest() {
- debugDump("entering");
-
- let patches = getLocalPatchString("complete", null, null, null, null, null,
- STATE_APPLIED_SVC);
- let updates = getLocalUpdateString(patches, null, null, null,
- Services.appinfo.version,
- Services.appinfo.platformVersion);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- writeStatusFile(STATE_APPLIED_SVC);
-
- Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 1);
- Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, true);
- Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, true);
-
- reloadUpdateManagerData();
-
- is(gUpdateManager.activeUpdate.state, STATE_APPLIED_SVC,
- "The active update should have a state of " + STATE_APPLIED_SVC);
-
- ok(gUpdateManager.activeUpdate.promptWaitTime == 1, "Checking that the " +
- "update's promptWaitTime attribute value was set from the " +
- PREF_APP_UPDATE_PROMPTWAITTIME + " preference");
-
- gUpdateManager.refreshUpdateStatus();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0101_background_restartNotification.xul b/toolkit/mozapps/update/tests/chrome/test_0101_background_restartNotification.xul
deleted file mode 100644
index faa60c08b..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0101_background_restartNotification.xul
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: background finish with a background download"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_FINISHED_BKGRD,
- buttonClick: "extra1"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 1);
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1" + getVersionParams();
- setUpdateURL(url);
-
- gAUS.notify(null);
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0102_background_restartNotification_staging.xul b/toolkit/mozapps/update/tests/chrome/test_0102_background_restartNotification_staging.xul
deleted file mode 100644
index 3e6f0fec8..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0102_background_restartNotification_staging.xul
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: background finish with a background download and update staging"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_FINISHED_BKGRD,
- buttonClick: "extra1"
-} ];
-
-gUseTestUpdater = true;
-
-function runTest() {
- debugDump("entering");
-
- Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, true);
- Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 1);
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1" + getVersionParams();
- setUpdateURL(url);
-
- gAUS.notify(null);
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0103_background_restartNotification_stagingService.xul b/toolkit/mozapps/update/tests/chrome/test_0103_background_restartNotification_stagingService.xul
deleted file mode 100644
index c60a9fe49..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0103_background_restartNotification_stagingService.xul
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: background finish with a background download and update staging and servicefs"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_FINISHED_BKGRD,
- buttonClick: "extra1"
-} ];
-
-gUseTestUpdater = true;
-
-function runTest() {
- debugDump("entering");
-
- Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, true);
- Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, true);
- Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 1);
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1" + getVersionParams();
- setUpdateURL(url);
-
- gAUS.notify(null);
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0111_neverButton_basic.xul b/toolkit/mozapps/update/tests/chrome/test_0111_neverButton_basic.xul
deleted file mode 100644
index adca621d9..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0111_neverButton_basic.xul
+++ /dev/null
@@ -1,61 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: update check and basic (never button test)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-gPrefToCheck = PREFBRANCH_APP_UPDATE_NEVER + Services.appinfo.version;
-
-const TESTS = [ {
- pageid: PAGEID_CHECKING
-}, {
- pageid: PAGEID_FOUND_BASIC,
- extraDelayedCheckFunction: checkPrefHasUserValue,
- prefHasUserValue: false,
- neverButton: true,
- buttonClick: "extra2"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let url = URL_HTTP_UPDATE_XML + "?showNever=1&showDetails=1" +
- getVersionParams();
- setUpdateURL(url);
-
- // add the never preference for this version to verify that checking for
- // updates clears the preference.
- Services.prefs.setBoolPref(gPrefToCheck, true)
-
- gUP.checkForUpdates();
-}
-
-function finishTest() {
- checkPrefHasUserValue(true);
- finishTestDefault();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0113_showNeverForVersionRemovedWithPref.xul b/toolkit/mozapps/update/tests/chrome/test_0113_showNeverForVersionRemovedWithPref.xul
deleted file mode 100644
index 89dd55ea1..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0113_showNeverForVersionRemovedWithPref.xul
+++ /dev/null
@@ -1,58 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: update available with never pref and without showNeverForVersion"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-gPrefToCheck = PREFBRANCH_APP_UPDATE_NEVER + Services.appinfo.version;
-
-const TESTS = [ {
- pageid: PAGEID_FOUND_BASIC,
- extraDelayedCheckFunction: checkPrefHasUserValue,
- prefHasUserValue: true,
- buttonClick: "extra1"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1&showPrompt=1" +
- getVersionParams();
- setUpdateURL(url);
-
- // add the never preference for this version to verify that checking for
- // updates clears the preference.
- Services.prefs.setBoolPref(gPrefToCheck, true)
-
- gAUS.notify(null);
-}
-
-function finishTest() {
- Services.prefs.clearUserPref(gPrefToCheck)
- finishTestDefault();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0151_notify_backgroundCheckError.xul b/toolkit/mozapps/update/tests/chrome/test_0151_notify_backgroundCheckError.xul
deleted file mode 100644
index 13798e5c9..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0151_notify_backgroundCheckError.xul
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Test notification when multiple background check errors occur (bug 595455)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_ERROR_EXTRA,
- extraDelayedCheckFunction: checkErrorExtraPage,
- shouldBeHidden: false,
- displayedTextElem: "bgErrorLabel",
- buttonClick: "finish"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let url = URL_HTTP_UPDATE_XML + "?xmlMalformed=1";
- setUpdateURL(url);
-
- errorsPrefObserver.init(PREF_APP_UPDATE_BACKGROUNDERRORS,
- PREF_APP_UPDATE_BACKGROUNDMAXERRORS);
-
- gAUS.notify(null);
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0152_notify_backgroundCheckOfflineRetry.xul b/toolkit/mozapps/update/tests/chrome/test_0152_notify_backgroundCheckOfflineRetry.xul
deleted file mode 100644
index 04e613418..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0152_notify_backgroundCheckOfflineRetry.xul
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Test that an update check that fails due to being offline is performed after going online"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_FOUND_BASIC,
- buttonClick: "extra1"
-} ];
-
-const NETWORK_ERROR_OFFLINE = 111;
-var gProxyPrefValue;
-
-function runTest() {
- debugDump("entering");
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1" + getVersionParams();
- setUpdateURL(url);
-
- Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, true);
- Services.prefs.setBoolPref(PREF_APP_UPDATE_AUTO, false);
-
- Services.io.offline = true;
- gProxyPrefValue = Services.prefs.getIntPref("network.proxy.type");
- Services.prefs.setIntPref("network.proxy.type", 0);
-
- gUpdateChecker.checkForUpdates(updateCheckListener, true);
-}
-
-function resetOffline() {
- Services.prefs.setIntPref("network.proxy.type", gProxyPrefValue);
- Services.io.offline = false;
-}
-
-/* Update check listener */
-const updateCheckListener = {
- onProgress: function UCL_onProgress(aRequest, aPosition, aTotalSize) {
- },
-
- onCheckComplete: function UCL_onCheckComplete(aRequest, aUpdates, aUpdateCount) {
- let status = aRequest.status;
- if (status == 0) {
- status = aRequest.channel.QueryInterface(Ci.nsIRequest).status;
- }
- debugDump("url = " + aRequest.channel.originalURI.spec + ", " +
- "request.status = " + status + ", " +
- "updateCount = " + aUpdateCount);
- ok(false, "Unexpected updateCheckListener::onCheckComplete called");
- },
-
- onError: function UCL_onError(aRequest, aUpdate) {
- let status = aRequest.status;
- if (status == 0) {
- status = aRequest.channel.QueryInterface(Ci.nsIRequest).status;
- }
- is(status, Cr.NS_ERROR_OFFLINE,
- "checking the request status value");
- is(aUpdate.errorCode, NETWORK_ERROR_OFFLINE,
- "checking the update error code");
- debugDump("url = " + aRequest.channel.originalURI.spec + ", " +
- "request.status = " + status + ", " +
- "update.statusText = " +
- (aUpdate.statusText ? aUpdate.statusText : "null"));
- gAUS.onError(aRequest, aUpdate);
- // Use a timeout to allow the XHR to complete
- SimpleTest.executeSoon(resetOffline);
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIUpdateCheckListener])
-};
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0161_check_unsupported.xul b/toolkit/mozapps/update/tests/chrome/test_0161_check_unsupported.xul
deleted file mode 100644
index c8e8d837b..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0161_check_unsupported.xul
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Test checking for updates when system is no longer supported (bug 843497)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_CHECKING
-}, {
- pageid: PAGEID_UNSUPPORTED,
- buttonClick: "finish"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- // When checking manually the unsupported page should still be shown even if
- // it was shown previously.
- Services.prefs.setBoolPref(PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED, true);
-
- let url = URL_HTTP_UPDATE_XML + "?unsupported=1";
- setUpdateURL(url);
-
- gUP.checkForUpdates();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0162_notify_unsupported.xul b/toolkit/mozapps/update/tests/chrome/test_0162_notify_unsupported.xul
deleted file mode 100644
index d88d2092d..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0162_notify_unsupported.xul
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Test notification of updates when system is no longer supported (bug 843497)"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_UNSUPPORTED,
- buttonClick: "finish"
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let url = URL_HTTP_UPDATE_XML + "?unsupported=1";
- setUpdateURL(url);
-
- gAUS.notify(null);
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0171_check_noPerms_manual.xul b/toolkit/mozapps/update/tests/chrome/test_0171_check_noPerms_manual.xul
deleted file mode 100644
index 142c02baa..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0171_check_noPerms_manual.xul
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: manual"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_CHECKING
-}, {
- pageid: PAGEID_MANUAL_UPDATE,
- buttonClick: "finish",
- extraCheckFunction: getWriteTestFile
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let file = getWriteTestFile();
- file.create(file.NORMAL_FILE_TYPE, 0o444);
- file.fileAttributesWin |= file.WFA_READONLY;
- file.fileAttributesWin &= ~file.WFA_READWRITE;
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1" + getVersionParams();
- setUpdateURL(url);
-
- gUP.checkForUpdates();
-}
-
-function getWriteTestFile() {
- let file = getAppBaseDir();
- file.append(FILE_UPDATE_TEST);
- file.QueryInterface(Ci.nsILocalFileWin);
- if (file.exists()) {
- file.fileAttributesWin |= file.WFA_READWRITE;
- file.fileAttributesWin &= ~file.WFA_READONLY;
- file.remove(true);
- }
- return file;
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_0172_notify_noPerms_manual.xul b/toolkit/mozapps/update/tests/chrome/test_0172_notify_noPerms_manual.xul
deleted file mode 100644
index 6784b9c90..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_0172_notify_noPerms_manual.xul
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Update Wizard pages: manual"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTestDefault();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-const TESTS = [ {
- pageid: PAGEID_MANUAL_UPDATE,
- buttonClick: "finish",
- extraCheckFunction: getWriteTestFile
-} ];
-
-function runTest() {
- debugDump("entering");
-
- let file = getWriteTestFile();
- file.create(file.NORMAL_FILE_TYPE, 0o444);
- file.fileAttributesWin |= file.WFA_READONLY;
- file.fileAttributesWin &= ~file.WFA_READWRITE;
-
- let url = URL_HTTP_UPDATE_XML + "?showDetails=1&showPrompt=1" +
- getVersionParams();
- setUpdateURL(url);
-
- gAUS.checkForBackgroundUpdates();
-}
-
-function getWriteTestFile() {
- let file = getAppBaseDir();
- file.append(FILE_UPDATE_TEST);
- file.QueryInterface(Ci.nsILocalFileWin);
- if (file.exists()) {
- file.fileAttributesWin |= file.WFA_READWRITE;
- file.fileAttributesWin &= ~file.WFA_READONLY;
- file.remove(true);
- }
- return file;
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/test_9999_cleanup.xul b/toolkit/mozapps/update/tests/chrome/test_9999_cleanup.xul
deleted file mode 100644
index a55263eb2..000000000
--- a/toolkit/mozapps/update/tests/chrome/test_9999_cleanup.xul
+++ /dev/null
@@ -1,112 +0,0 @@
-<?xml version="1.0"?>
-<!--
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Removes files and preferences for previous application update tests in case
- * any of them had a fatal error. The test name ensures that it will run after
- * all other tests as long as the test naming uses the same format as the
- * existing tests.
- */
--->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window title="Application Update test cleanup"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="runTest();">
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-<script type="application/javascript"
- src="utils.js"/>
-
-<script type="application/javascript">
-<![CDATA[
-
-/**
- * If the application update tests left behind any of the files it uses it could
- * be a very bad thing. The purpose of this test is to prevent that from
- * happening.
- */
-function runTest() {
- debugDump("entering");
-
- SimpleTest.waitForExplicitFinish();
-
- if (DEBUG_AUS_TEST) {
- Services.prefs.setBoolPref(PREF_APP_UPDATE_LOG, true);
- }
-
- closeUpdateWindow();
-
- // Always leave the app.update.enabled and app.update.staging.enabled
- // preferences set to false when cleaning up.
- Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, false);
- Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, false);
-
- resetFiles();
- removeUpdateDirsAndFiles();
- reloadUpdateManagerData();
-
- let file = getUpdatesXMLFile(true);
- ok(!file.exists(), file.path + " should not exist");
-
- file = getUpdatesXMLFile(false);
- ok(!file.exists(), file.path + " should not exist");
-
- let dir = getUpdatesDir();
-
- file = dir.clone();
- file.append(FILE_UPDATE_STATUS);
- ok(!file.exists(), file.path + " should not exist");
-
- file = dir.clone();
- file.append(FILE_UPDATE_MAR);
- ok(!file.exists(), file.path + " should not exist");
-
- cleanupRestoreUpdaterBackup();
-}
-
-/**
- * After all tests finish this will repeatedly attempt to restore the real
- * updater if it exists and then call finishTest after the restore is
- * successful.
- */
-function cleanupRestoreUpdaterBackup() {
- debugDump("entering");
-
- try {
- // Windows debug builds keep the updater file in use for a short period of
- // time after the updater process exits.
- restoreUpdaterBackup();
- } catch (e) {
- logTestInfo("Attempt to restore the backed up updater failed... " +
- "will try again, Exception: " + e);
- SimpleTest.executeSoon(cleanupRestoreUpdaterBackup);
- return;
- }
-
- SimpleTest.executeSoon(finishTest);
-}
-
-function finishTest() {
- debugDump("entering");
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_LOG)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_LOG);
- }
- SimpleTest.finish();
-}
-
-]]>
-</script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
-</body>
-</window>
diff --git a/toolkit/mozapps/update/tests/chrome/update.sjs b/toolkit/mozapps/update/tests/chrome/update.sjs
deleted file mode 100644
index 78bb1b93f..000000000
--- a/toolkit/mozapps/update/tests/chrome/update.sjs
+++ /dev/null
@@ -1,194 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Server side http server script for application update tests.
- */
-
-const { classes: Cc, interfaces: Ci } = Components;
-
-const REL_PATH_DATA = "chrome/toolkit/mozapps/update/tests/data/";
-
-function getTestDataFile(aFilename) {
- let file = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties).get("CurWorkD", Ci.nsILocalFile);
- let pathParts = REL_PATH_DATA.split("/");
- for (let i = 0; i < pathParts.length; ++i) {
- file.append(pathParts[i]);
- }
- if (aFilename) {
- file.append(aFilename);
- }
- return file;
-}
-
-function loadHelperScript() {
- let scriptFile = getTestDataFile("sharedUpdateXML.js");
- let io = Cc["@mozilla.org/network/io-service;1"].getService(Ci.nsIIOService2);
- let scriptSpec = io.newFileURI(scriptFile).spec;
- let scriptloader = Cc["@mozilla.org/moz/jssubscript-loader;1"].
- getService(Ci.mozIJSSubScriptLoader);
- scriptloader.loadSubScript(scriptSpec, this);
-}
-loadHelperScript();
-
-const URL_HOST = "http://example.com";
-const URL_PATH_UPDATE_XML = "/chrome/toolkit/mozapps/update/tests/chrome/update.sjs";
-const URL_HTTP_UPDATE_SJS = URL_HOST + URL_PATH_UPDATE_XML;
-const SERVICE_URL = URL_HOST + "/" + REL_PATH_DATA + FILE_SIMPLE_MAR;
-
-const SLOW_MAR_DOWNLOAD_INTERVAL = 100;
-var gTimer;
-
-function handleRequest(aRequest, aResponse) {
- let params = { };
- if (aRequest.queryString) {
- params = parseQueryString(aRequest.queryString);
- }
-
- let statusCode = params.statusCode ? parseInt(params.statusCode) : 200;
- let statusReason = params.statusReason ? params.statusReason : "OK";
- aResponse.setStatusLine(aRequest.httpVersion, statusCode, statusReason);
- aResponse.setHeader("Cache-Control", "no-cache", false);
-
- // When a mar download is started by the update service it can finish
- // downloading before the ui has loaded. By specifying a serviceURL for the
- // update patch that points to this file and has a slowDownloadMar param the
- // mar will be downloaded asynchronously which will allow the ui to load
- // before the download completes.
- if (params.slowDownloadMar) {
- aResponse.processAsync();
- aResponse.setHeader("Content-Type", "binary/octet-stream");
- aResponse.setHeader("Content-Length", SIZE_SIMPLE_MAR);
- var continueFile = getTestDataFile("continue");
- var contents = readFileBytes(getTestDataFile(FILE_SIMPLE_MAR));
- gTimer = Cc["@mozilla.org/timer;1"].
- createInstance(Ci.nsITimer);
- gTimer.initWithCallback(function(aTimer) {
- if (continueFile.exists()) {
- gTimer.cancel();
- aResponse.write(contents);
- aResponse.finish();
- }
- }, SLOW_MAR_DOWNLOAD_INTERVAL, Ci.nsITimer.TYPE_REPEATING_SLACK);
- return;
- }
-
- if (params.uiURL) {
- let remoteType = "";
- if (!params.remoteNoTypeAttr && params.uiURL == "BILLBOARD") {
- remoteType = " " + params.uiURL.toLowerCase() + "=\"1\"";
- }
- aResponse.write("<html><head><meta http-equiv=\"content-type\" content=" +
- "\"text/html; charset=utf-8\"></head><body" +
- remoteType + ">" + params.uiURL +
- "<br><br>this is a test mar that will not affect your " +
- "build.</body></html>");
- return;
- }
-
- if (params.xmlMalformed) {
- aResponse.write("xml error");
- return;
- }
-
- if (params.noUpdates) {
- aResponse.write(getRemoteUpdatesXMLString(""));
- return;
- }
-
- if (params.unsupported) {
- aResponse.write(getRemoteUpdatesXMLString(" <update type=\"major\" " +
- "unsupported=\"true\" " +
- "detailsURL=\"" + URL_HOST +
- "\"></update>\n"));
- return;
- }
-
- let size;
- let patches = "";
- if (!params.partialPatchOnly) {
- size = SIZE_SIMPLE_MAR + (params.invalidCompleteSize ? "1" : "");
- patches += getRemotePatchString("complete", SERVICE_URL, "SHA512",
- SHA512_HASH_SIMPLE_MAR, size);
- }
-
- if (!params.completePatchOnly) {
- size = SIZE_SIMPLE_MAR + (params.invalidPartialSize ? "1" : "");
- patches += getRemotePatchString("partial", SERVICE_URL, "SHA512",
- SHA512_HASH_SIMPLE_MAR, size);
- }
-
- let type = params.type ? params.type : "major";
- let name = params.name ? params.name : "App Update Test";
- let appVersion = params.appVersion ? params.appVersion : "999999.9";
- let displayVersion = params.displayVersion ? params.displayVersion
- : "version " + appVersion;
- let buildID = params.buildID ? params.buildID : "01234567890123";
- // XXXrstrong - not specifying a detailsURL will cause a leak due to bug 470244
-// let detailsURL = params.showDetails ? URL_HTTP_UPDATE_SJS + "?uiURL=DETAILS" : null;
- let detailsURL = URL_HTTP_UPDATE_SJS + "?uiURL=DETAILS";
- let showPrompt = params.showPrompt ? "true" : null;
- let showNever = params.showNever ? "true" : null;
- let promptWaitTime = params.promptWaitTime ? params.promptWaitTime : null;
-
- let updates = getRemoteUpdateString(patches, type, "App Update Test",
- displayVersion, appVersion, buildID,
- detailsURL, showPrompt, showNever,
- promptWaitTime);
- aResponse.write(getRemoteUpdatesXMLString(updates));
-}
-
-/**
- * Helper function to create a JS object representing the url parameters from
- * the request's queryString.
- *
- * @param aQueryString
- * The request's query string.
- * @return A JS object representing the url parameters from the request's
- * queryString.
- */
-function parseQueryString(aQueryString) {
- let paramArray = aQueryString.split("&");
- let regex = /^([^=]+)=(.*)$/;
- let params = {};
- for (let i = 0, sz = paramArray.length; i < sz; i++) {
- let match = regex.exec(paramArray[i]);
- if (!match) {
- throw "Bad parameter in queryString! '" + paramArray[i] + "'";
- }
- params[decodeURIComponent(match[1])] = decodeURIComponent(match[2]);
- }
-
- return params;
-}
-
-/**
- * Reads the binary contents of a file and returns it as a string.
- *
- * @param aFile
- * The file to read from.
- * @return The contents of the file as a string.
- */
-function readFileBytes(aFile) {
- let fis = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- fis.init(aFile, -1, -1, false);
- let bis = Cc["@mozilla.org/binaryinputstream;1"].
- createInstance(Ci.nsIBinaryInputStream);
- bis.setInputStream(fis);
- let data = [];
- let count = fis.available();
- while (count > 0) {
- let bytes = bis.readByteArray(Math.min(65535, count));
- data.push(String.fromCharCode.apply(null, bytes));
- count -= bytes.length;
- if (bytes.length == 0) {
- throw "Nothing read from input stream!";
- }
- }
- data.join('');
- fis.close();
- return data.toString();
-}
diff --git a/toolkit/mozapps/update/tests/chrome/utils.js b/toolkit/mozapps/update/tests/chrome/utils.js
deleted file mode 100644
index 31d0d2e5a..000000000
--- a/toolkit/mozapps/update/tests/chrome/utils.js
+++ /dev/null
@@ -1,1011 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Test Definition
- *
- * Most tests can use an array named TESTS that will perform most if not all of
- * the necessary checks. Each element in the array must be an object with the
- * following possible properties. Additional properties besides the ones listed
- * below can be added as needed.
- *
- * overrideCallback (optional)
- * The function to call for the next test. This is typically called when the
- * wizard page changes but can also be called for other events by the previous
- * test. If this property isn't defined then the defaultCallback function will
- * be called. If this property is defined then all other properties are
- * optional.
- *
- * pageid (required unless overrideCallback is specified)
- * The expected pageid for the wizard. This property is required unless the
- * overrideCallback property is defined.
- *
- * extraStartFunction (optional)
- * The function to call at the beginning of the defaultCallback function. If
- * the function returns true the defaultCallback function will return early
- * which allows waiting for a specific condition to be evaluated in the
- * function specified in the extraStartFunction property before continuing
- * with the test.
- *
- * extraCheckFunction (optional)
- * The function to call to perform extra checks in the defaultCallback
- * function.
- *
- * extraDelayedCheckFunction (optional)
- * The function to call to perform extra checks in the delayedDefaultCallback
- * function.
- *
- * buttonStates (optional)
- * A javascript object representing the expected hidden and disabled attribute
- * values for the buttons of the current wizard page. The values are checked
- * in the delayedDefaultCallback function. For information about the structure
- * of this object refer to the getExpectedButtonStates and checkButtonStates
- * functions.
- *
- * buttonClick (optional)
- * The current wizard page button to click at the end of the
- * delayedDefaultCallback function. If the buttonClick property is defined
- * then the extraDelayedFinishFunction property can't be specified due to race
- * conditions in some of the tests and if both of them are specified the test
- * will intentionally throw.
- *
- * extraDelayedFinishFunction (optional)
- * The function to call at the end of the delayedDefaultCallback function.
- * If the extraDelayedFinishFunction property is defined then the buttonClick
- * property can't be specified due to race conditions in some of the tests and
- * if both of them are specified the test will intentionally throw.
- *
- * ranTest (should not be specified)
- * When delayedDefaultCallback is called a property named ranTest is added to
- * the current test so it is possible to verify that each test in the TESTS
- * array has ran.
- *
- * prefHasUserValue (optional)
- * For comparing the expected value defined by this property with the return
- * value of prefHasUserValue using gPrefToCheck for the preference name in the
- * checkPrefHasUserValue function.
- */
-
-'use strict';
-
-/* globals TESTS, runTest, finishTest */
-
-const { classes: Cc, interfaces: Ci, manager: Cm, results: Cr,
- utils: Cu } = Components;
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-
-const IS_MACOSX = ("nsILocalFileMac" in Ci);
-const IS_WIN = ("@mozilla.org/windows-registry-key;1" in Cc);
-
-// The tests have to use the pageid instead of the pageIndex due to the
-// app update wizard's access method being random.
-const PAGEID_DUMMY = "dummy"; // Done
-const PAGEID_CHECKING = "checking"; // Done
-const PAGEID_NO_UPDATES_FOUND = "noupdatesfound"; // Done
-const PAGEID_MANUAL_UPDATE = "manualUpdate"; // Done
-const PAGEID_UNSUPPORTED = "unsupported"; // Done
-const PAGEID_FOUND_BASIC = "updatesfoundbasic"; // Done
-const PAGEID_DOWNLOADING = "downloading"; // Done
-const PAGEID_ERRORS = "errors"; // Done
-const PAGEID_ERROR_EXTRA = "errorextra"; // Done
-const PAGEID_ERROR_PATCHING = "errorpatching"; // Done
-const PAGEID_FINISHED = "finished"; // Done
-const PAGEID_FINISHED_BKGRD = "finishedBackground"; // Done
-
-const UPDATE_WINDOW_NAME = "Update:Wizard";
-
-const URL_HOST = "http://example.com";
-const URL_PATH_UPDATE_XML = "/chrome/toolkit/mozapps/update/tests/chrome/update.sjs";
-const REL_PATH_DATA = "chrome/toolkit/mozapps/update/tests/data";
-
-// These two URLs must not contain parameters since tests add their own
-// test specific parameters.
-const URL_HTTP_UPDATE_XML = URL_HOST + URL_PATH_UPDATE_XML;
-const URL_HTTPS_UPDATE_XML = "https://example.com" + URL_PATH_UPDATE_XML;
-
-const URI_UPDATE_PROMPT_DIALOG = "chrome://mozapps/content/update/updates.xul";
-
-const PREF_APP_UPDATE_INTERVAL = "app.update.interval";
-const PREF_APP_UPDATE_LASTUPDATETIME = "app.update.lastUpdateTime.background-update-timer";
-
-const LOG_FUNCTION = info;
-
-const BIN_SUFFIX = (IS_WIN ? ".exe" : "");
-const FILE_UPDATER_BIN = "updater" + (IS_MACOSX ? ".app" : BIN_SUFFIX);
-const FILE_UPDATER_BIN_BAK = FILE_UPDATER_BIN + ".bak";
-
-var gURLData = URL_HOST + "/" + REL_PATH_DATA + "/";
-
-var gTestTimeout = 240000; // 4 minutes
-var gTimeoutTimer;
-
-// The number of SimpleTest.executeSoon calls to perform when waiting on an
-// update window to close before giving up.
-const CLOSE_WINDOW_TIMEOUT_MAXCOUNT = 10;
-// Counter for the SimpleTest.executeSoon when waiting on an update window to
-// close before giving up.
-var gCloseWindowTimeoutCounter = 0;
-
-// The following vars are for restoring previous preference values (if present)
-// when the test finishes.
-var gAppUpdateEnabled; // app.update.enabled
-var gAppUpdateServiceEnabled; // app.update.service.enabled
-var gAppUpdateStagingEnabled; // app.update.staging.enabled
-var gAppUpdateURLDefault; // app.update.url (default prefbranch)
-
-var gTestCounter = -1;
-var gWin;
-var gDocElem;
-var gPrefToCheck;
-var gUseTestUpdater = false;
-
-// Set to true to log additional information for debugging. To log additional
-// information for an individual test set DEBUG_AUS_TEST to true in the test's
-// onload function.
-var DEBUG_AUS_TEST = true;
-
-const DATA_URI_SPEC = "chrome://mochitests/content/chrome/toolkit/mozapps/update/tests/data/";
-/* import-globals-from ../data/shared.js */
-Services.scriptloader.loadSubScript(DATA_URI_SPEC + "shared.js", this);
-
-/**
- * The current test in TESTS array.
- */
-this.__defineGetter__("gTest", function() {
- return TESTS[gTestCounter];
-});
-
-/**
- * The current test's callback. This will either return the callback defined in
- * the test's overrideCallback property or defaultCallback if the
- * overrideCallback property is undefined.
- */
-this.__defineGetter__("gCallback", function() {
- return gTest.overrideCallback ? gTest.overrideCallback
- : defaultCallback;
-});
-
-/**
- * nsIObserver for receiving window open and close notifications.
- */
-const gWindowObserver = {
- observe: function WO_observe(aSubject, aTopic, aData) {
- let win = aSubject.QueryInterface(Ci.nsIDOMEventTarget);
-
- if (aTopic == "domwindowclosed") {
- if (win.location != URI_UPDATE_PROMPT_DIALOG) {
- debugDump("domwindowclosed event for window not being tested - " +
- "location: " + win.location + "... returning early");
- return;
- }
- // Allow tests the ability to provide their own function (it must be
- // named finishTest) for finishing the test.
- try {
- finishTest();
- }
- catch (e) {
- finishTestDefault();
- }
- return;
- }
-
- win.addEventListener("load", function WO_observe_onLoad() {
- win.removeEventListener("load", WO_observe_onLoad, false);
- // Ignore windows other than the update UI window.
- if (win.location != URI_UPDATE_PROMPT_DIALOG) {
- debugDump("load event for window not being tested - location: " +
- win.location + "... returning early");
- return;
- }
-
- // The first wizard page should always be the dummy page.
- let pageid = win.document.documentElement.currentPage.pageid;
- if (pageid != PAGEID_DUMMY) {
- // This should never happen but if it does this will provide a clue
- // for diagnosing the cause.
- ok(false, "Unexpected load event - pageid got: " + pageid +
- ", expected: " + PAGEID_DUMMY + "... returning early");
- return;
- }
-
- gWin = win;
- gDocElem = gWin.document.documentElement;
- gDocElem.addEventListener("pageshow", onPageShowDefault, false);
- }, false);
- }
-};
-
-/**
- * Default test run function that can be used by most tests. This function uses
- * protective measures to prevent the test from failing provided by
- * |runTestDefaultWaitForWindowClosed| helper functions to prevent failure due
- * to a previous test failure.
- */
-function runTestDefault() {
- debugDump("entering");
-
- if (!("@mozilla.org/zipwriter;1" in Cc)) {
- ok(false, "nsIZipWriter is required to run these tests");
- return;
- }
-
- SimpleTest.waitForExplicitFinish();
-
- runTestDefaultWaitForWindowClosed();
-}
-
-/**
- * If an update window is found SimpleTest.executeSoon can callback before the
- * update window is fully closed especially with debug builds. If an update
- * window is found this function will call itself using SimpleTest.executeSoon
- * up to the amount declared in CLOSE_WINDOW_TIMEOUT_MAXCOUNT until the update
- * window has closed before continuing the test.
- */
-function runTestDefaultWaitForWindowClosed() {
- gCloseWindowTimeoutCounter++;
- if (gCloseWindowTimeoutCounter > CLOSE_WINDOW_TIMEOUT_MAXCOUNT) {
- try {
- finishTest();
- }
- catch (e) {
- finishTestDefault();
- }
- return;
- }
-
- // The update window should not be open at this time. If it is the call to
- // |closeUpdateWindow| will close it and cause the test to fail.
- if (closeUpdateWindow()) {
- SimpleTest.executeSoon(runTestDefaultWaitForWindowClosed);
- } else {
- Services.ww.registerNotification(gWindowObserver);
-
- gCloseWindowTimeoutCounter = 0;
-
- setupFiles();
- setupPrefs();
- gEnv.set("MOZ_TEST_SKIP_UPDATE_STAGE", "1");
- removeUpdateDirsAndFiles();
- reloadUpdateManagerData();
- setupTimer(gTestTimeout);
- SimpleTest.executeSoon(setupTestUpdater);
- }
-}
-
-/**
- * Default test finish function that can be used by most tests. This function
- * uses protective measures to prevent the next test from failing provided by
- * |finishTestDefaultWaitForWindowClosed| helper functions to prevent failure
- * due to an update window being left open.
- */
-function finishTestDefault() {
- debugDump("entering");
- if (gTimeoutTimer) {
- gTimeoutTimer.cancel();
- gTimeoutTimer = null;
- }
-
- if (gChannel) {
- debugDump("channel = " + gChannel);
- gChannel = null;
- gPrefRoot.removeObserver(PREF_APP_UPDATE_CHANNEL, observer);
- }
-
- verifyTestsRan();
-
- resetPrefs();
- gEnv.set("MOZ_TEST_SKIP_UPDATE_STAGE", "");
- resetFiles();
- removeUpdateDirsAndFiles();
- reloadUpdateManagerData();
-
- Services.ww.unregisterNotification(gWindowObserver);
- if (gDocElem) {
- gDocElem.removeEventListener("pageshow", onPageShowDefault, false);
- }
-
- finishTestRestoreUpdaterBackup();
-}
-
-/**
- * nsITimerCallback for the timeout timer to cleanly finish a test if the Update
- * Window doesn't close for a test. This allows the next test to run properly if
- * a previous test fails.
- *
- * @param aTimer
- * The nsITimer that fired.
- */
-function finishTestTimeout(aTimer) {
- ok(false, "Test timed out. Maximum time allowed is " + (gTestTimeout / 1000) +
- " seconds");
-
- try {
- finishTest();
- }
- catch (e) {
- finishTestDefault();
- }
-}
-
-/**
- * When a test finishes this will repeatedly attempt to restore the real updater
- * for tests that use the test updater and then call
- * finishTestDefaultWaitForWindowClosed after the restore is successful.
- */
-function finishTestRestoreUpdaterBackup() {
- if (gUseTestUpdater) {
- try {
- // Windows debug builds keep the updater file in use for a short period of
- // time after the updater process exits.
- restoreUpdaterBackup();
- } catch (e) {
- logTestInfo("Attempt to restore the backed up updater failed... " +
- "will try again, Exception: " + e);
- SimpleTest.executeSoon(finishTestRestoreUpdaterBackup);
- return;
- }
- }
-
- finishTestDefaultWaitForWindowClosed();
-}
-
-/**
- * If an update window is found SimpleTest.executeSoon can callback before the
- * update window is fully closed especially with debug builds. If an update
- * window is found this function will call itself using SimpleTest.executeSoon
- * up to the amount declared in CLOSE_WINDOW_TIMEOUT_MAXCOUNT until the update
- * window has closed before finishing the test.
- */
-function finishTestDefaultWaitForWindowClosed() {
- gCloseWindowTimeoutCounter++;
- if (gCloseWindowTimeoutCounter > CLOSE_WINDOW_TIMEOUT_MAXCOUNT) {
- SimpleTest.requestCompleteLog();
- SimpleTest.finish();
- return;
- }
-
- // The update window should not be open at this time. If it is the call to
- // |closeUpdateWindow| will close it and cause the test to fail.
- if (closeUpdateWindow()) {
- SimpleTest.executeSoon(finishTestDefaultWaitForWindowClosed);
- } else {
- SimpleTest.finish();
- }
-}
-
-/**
- * Default callback for the wizard's documentElement pageshow listener. This
- * will return early for event's where the originalTarget's nodeName is not
- * wizardpage.
- */
-function onPageShowDefault(aEvent) {
- if (!gTimeoutTimer) {
- debugDump("gTimeoutTimer is null... returning early");
- return;
- }
-
- // Return early if the event's original target isn't for a wizardpage element.
- // This check is necessary due to the remotecontent element firing pageshow.
- if (aEvent.originalTarget.nodeName != "wizardpage") {
- debugDump("only handles events with an originalTarget nodeName of " +
- "|wizardpage|. aEvent.originalTarget.nodeName = " +
- aEvent.originalTarget.nodeName + "... returning early");
- return;
- }
-
- gTestCounter++;
- gCallback(aEvent);
-}
-
-/**
- * Default callback that can be used by most tests.
- */
-function defaultCallback(aEvent) {
- if (!gTimeoutTimer) {
- debugDump("gTimeoutTimer is null... returning early");
- return;
- }
-
- debugDump("entering - TESTS[" + gTestCounter + "], pageid: " + gTest.pageid +
- ", aEvent.originalTarget.nodeName: " +
- aEvent.originalTarget.nodeName);
-
- if (gTest && gTest.extraStartFunction) {
- debugDump("calling extraStartFunction " + gTest.extraStartFunction.name);
- if (gTest.extraStartFunction(aEvent)) {
- debugDump("extraStartFunction early return");
- return;
- }
- }
-
- is(gDocElem.currentPage.pageid, gTest.pageid,
- "Checking currentPage.pageid equals " + gTest.pageid + " in pageshow");
-
- // Perform extra checks if specified by the test
- if (gTest.extraCheckFunction) {
- debugDump("calling extraCheckFunction " + gTest.extraCheckFunction.name);
- gTest.extraCheckFunction();
- }
-
- // The wizard page buttons' disabled and hidden attributes are set after the
- // pageshow event so use executeSoon to allow them to be set so their disabled
- // and hidden attribute values can be checked.
- SimpleTest.executeSoon(delayedDefaultCallback);
-}
-
-/**
- * Delayed default callback called using executeSoon in defaultCallback which
- * allows the wizard page buttons' disabled and hidden attributes to be set
- * before checking their values.
- */
-function delayedDefaultCallback() {
- if (!gTimeoutTimer) {
- debugDump("gTimeoutTimer is null... returning early");
- return;
- }
-
- if (!gTest) {
- debugDump("gTest is null... returning early");
- return;
- }
-
- debugDump("entering - TESTS[" + gTestCounter + "], pageid: " + gTest.pageid);
-
- // Verify the pageid hasn't changed after executeSoon was called.
- is(gDocElem.currentPage.pageid, gTest.pageid,
- "Checking currentPage.pageid equals " + gTest.pageid + " after " +
- "executeSoon");
-
- checkButtonStates();
-
- // Perform delayed extra checks if specified by the test
- if (gTest.extraDelayedCheckFunction) {
- debugDump("calling extraDelayedCheckFunction " +
- gTest.extraDelayedCheckFunction.name);
- gTest.extraDelayedCheckFunction();
- }
-
- // Used to verify that this test has been performed
- gTest.ranTest = true;
-
- if (gTest.buttonClick) {
- debugDump("clicking " + gTest.buttonClick + " button");
- if (gTest.extraDelayedFinishFunction) {
- throw ("Tests cannot have a buttonClick and an extraDelayedFinishFunction property");
- }
- gDocElem.getButton(gTest.buttonClick).click();
- } else if (gTest.extraDelayedFinishFunction) {
- debugDump("calling extraDelayedFinishFunction " +
- gTest.extraDelayedFinishFunction.name);
- gTest.extraDelayedFinishFunction();
- }
-}
-
-/**
- * Gets the continue file used to signal the mock http server to continue
- * downloading for slow download mar file tests without creating it.
- *
- * @return nsILocalFile for the continue file.
- */
-function getContinueFile() {
- let continueFile = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties).
- get("CurWorkD", Ci.nsILocalFile);
- let continuePath = REL_PATH_DATA + "/continue";
- let continuePathParts = continuePath.split("/");
- for (let i = 0; i < continuePathParts.length; ++i) {
- continueFile.append(continuePathParts[i]);
- }
- return continueFile;
-}
-
-/**
- * Creates the continue file used to signal the mock http server to continue
- * downloading for slow download mar file tests.
- */
-function createContinueFile() {
- debugDump("creating 'continue' file for slow mar downloads");
- writeFile(getContinueFile(), "");
-}
-
-/**
- * Removes the continue file used to signal the mock http server to continue
- * downloading for slow download mar file tests.
- */
-function removeContinueFile() {
- let continueFile = getContinueFile();
- if (continueFile.exists()) {
- debugDump("removing 'continue' file for slow mar downloads");
- continueFile.remove(false);
- }
-}
-
-/**
- * Checks the wizard page buttons' disabled and hidden attributes values are
- * correct. If an expected button id is not specified then the expected disabled
- * and hidden attribute value is true.
- */
-function checkButtonStates() {
- debugDump("entering - TESTS[" + gTestCounter + "], pageid: " + gTest.pageid);
-
- const buttonNames = ["extra1", "extra2", "back", "next", "finish", "cancel"];
- let buttonStates = getExpectedButtonStates();
- buttonNames.forEach(function(aButtonName) {
- let button = gDocElem.getButton(aButtonName);
- let hasHidden = aButtonName in buttonStates &&
- "hidden" in buttonStates[aButtonName];
- let hidden = hasHidden ? buttonStates[aButtonName].hidden : true;
- let hasDisabled = aButtonName in buttonStates &&
- "disabled" in buttonStates[aButtonName];
- let disabled = hasDisabled ? buttonStates[aButtonName].disabled : true;
- is(button.hidden, hidden, "Checking " + aButtonName + " button " +
- "hidden attribute value equals " + (hidden ? "true" : "false"));
- is(button.disabled, disabled, "Checking " + aButtonName + " button " +
- "disabled attribute value equals " + (disabled ? "true" : "false"));
- });
-}
-
-/**
- * Returns the expected disabled and hidden attribute values for the buttons of
- * the current wizard page.
- */
-function getExpectedButtonStates() {
- // Allow individual tests to override the expected button states.
- if (gTest.buttonStates) {
- return gTest.buttonStates;
- }
-
- switch (gTest.pageid) {
- case PAGEID_CHECKING:
- return {cancel: {disabled: false, hidden: false}};
- case PAGEID_FOUND_BASIC:
- if (gTest.neverButton) {
- return {extra1: {disabled: false, hidden: false},
- extra2: {disabled: false, hidden: false},
- next: {disabled: false, hidden: false}};
- }
- return {extra1: {disabled: false, hidden: false},
- next: {disabled: false, hidden: false}};
- case PAGEID_DOWNLOADING:
- return {extra1: {disabled: false, hidden: false}};
- case PAGEID_NO_UPDATES_FOUND:
- case PAGEID_MANUAL_UPDATE:
- case PAGEID_UNSUPPORTED:
- case PAGEID_ERRORS:
- case PAGEID_ERROR_EXTRA:
- return {finish: {disabled: false, hidden: false}};
- case PAGEID_ERROR_PATCHING:
- return {next: { disabled: false, hidden: false}};
- case PAGEID_FINISHED:
- case PAGEID_FINISHED_BKGRD:
- return {extra1: { disabled: false, hidden: false},
- finish: { disabled: false, hidden: false}};
- }
- return null;
-}
-
-/**
- * Compares the return value of prefHasUserValue for the preference specified in
- * gPrefToCheck with the value passed in the aPrefHasValue parameter or the
- * value specified in the current test's prefHasUserValue property if
- * aPrefHasValue is undefined.
- *
- * @param aPrefHasValue (optional)
- * The expected value returned from prefHasUserValue for the preference
- * specified in gPrefToCheck. If aPrefHasValue is undefined the value
- * of the current test's prefHasUserValue property will be used.
- */
-function checkPrefHasUserValue(aPrefHasValue) {
- let prefHasUserValue = aPrefHasValue === undefined ? gTest.prefHasUserValue
- : aPrefHasValue;
- is(Services.prefs.prefHasUserValue(gPrefToCheck), prefHasUserValue,
- "Checking prefHasUserValue for preference " + gPrefToCheck + " equals " +
- (prefHasUserValue ? "true" : "false"));
-}
-
-/**
- * Checks whether the link is hidden for a general background update check error
- * or not on the errorextra page and that the app.update.backgroundErrors
- * preference does not have a user value.
- *
- * @param aShouldBeHidden (optional)
- * The expected value for the label's hidden attribute for the link. If
- * aShouldBeHidden is undefined the value of the current test's
- * shouldBeHidden property will be used.
- */
-function checkErrorExtraPage(aShouldBeHidden) {
- let shouldBeHidden = aShouldBeHidden === undefined ? gTest.shouldBeHidden
- : aShouldBeHidden;
- is(gWin.document.getElementById("errorExtraLinkLabel").hidden, shouldBeHidden,
- "Checking errorExtraLinkLabel hidden attribute equals " +
- (shouldBeHidden ? "true" : "false"));
-
- is(gWin.document.getElementById(gTest.displayedTextElem).hidden, false,
- "Checking " + gTest.displayedTextElem + " should not be hidden");
-
- ok(!Services.prefs.prefHasUserValue(PREF_APP_UPDATE_BACKGROUNDERRORS),
- "Preference " + PREF_APP_UPDATE_BACKGROUNDERRORS + " should not have a " +
- "user value");
-}
-
-/**
- * Gets the update version info for the update url parameters to send to
- * update.sjs.
- *
- * @param aAppVersion (optional)
- * The application version for the update snippet. If not specified the
- * current application version will be used.
- * @return The url parameters for the application and platform version to send
- * to update.sjs.
- */
-function getVersionParams(aAppVersion) {
- let appInfo = Services.appinfo;
- return "&appVersion=" + (aAppVersion ? aAppVersion : appInfo.version);
-}
-
-/**
- * Verifies that all tests ran.
- */
-function verifyTestsRan() {
- debugDump("entering");
-
- // Return early if there are no tests defined.
- if (!TESTS) {
- return;
- }
-
- gTestCounter = -1;
- for (let i = 0; i < TESTS.length; ++i) {
- gTestCounter++;
- let test = TESTS[i];
- let msg = "Checking if TESTS[" + i + "] test was performed... " +
- "callback function name = " + gCallback.name + ", " +
- "pageid = " + test.pageid;
- ok(test.ranTest, msg);
- }
-}
-
-/**
- * Creates a backup of files the tests need to modify so they can be restored to
- * the original file when the test has finished and then modifies the files.
- */
-function setupFiles() {
- // Backup the updater-settings.ini file if it exists by moving it.
- let baseAppDir = getGREDir();
- let updateSettingsIni = baseAppDir.clone();
- updateSettingsIni.append(FILE_UPDATE_SETTINGS_INI);
- if (updateSettingsIni.exists()) {
- updateSettingsIni.moveTo(baseAppDir, FILE_UPDATE_SETTINGS_INI_BAK);
- }
- updateSettingsIni = baseAppDir.clone();
- updateSettingsIni.append(FILE_UPDATE_SETTINGS_INI);
- writeFile(updateSettingsIni, UPDATE_SETTINGS_CONTENTS);
-}
-
-/**
- * For tests that use the test updater restores the backed up real updater if
- * it exists and tries again on failure since Windows debug builds at times
- * leave the file in use. After success moveRealUpdater is called to continue
- * the setup of the test updater. For tests that don't use the test updater
- * runTest will be called.
- */
-function setupTestUpdater() {
- if (!gUseTestUpdater) {
- runTest();
- return;
- }
-
- try {
- restoreUpdaterBackup();
- } catch (e) {
- logTestInfo("Attempt to restore the backed up updater failed... " +
- "will try again, Exception: " + e);
- SimpleTest.executeSoon(setupTestUpdater);
- return;
- }
- moveRealUpdater();
-}
-
-/**
- * Backs up the real updater and tries again on failure since Windows debug
- * builds at times leave the file in use. After success it will call
- * copyTestUpdater to continue the setup of the test updater.
- */
-function moveRealUpdater() {
- try {
- // Move away the real updater
- let baseAppDir = getAppBaseDir();
- let updater = baseAppDir.clone();
- updater.append(FILE_UPDATER_BIN);
- updater.moveTo(baseAppDir, FILE_UPDATER_BIN_BAK);
- } catch (e) {
- logTestInfo("Attempt to move the real updater out of the way failed... " +
- "will try again, Exception: " + e);
- SimpleTest.executeSoon(moveRealUpdater);
- return;
- }
-
- copyTestUpdater();
-}
-
-/**
- * Copies the test updater so it can be used by tests and tries again on failure
- * since Windows debug builds at times leave the file in use. After success it
- * will call runTest to continue the test.
- */
-function copyTestUpdater() {
- try {
- // Copy the test updater
- let baseAppDir = getAppBaseDir();
- let testUpdaterDir = Services.dirsvc.get("CurWorkD", Ci.nsILocalFile);
- let relPath = REL_PATH_DATA;
- let pathParts = relPath.split("/");
- for (let i = 0; i < pathParts.length; ++i) {
- testUpdaterDir.append(pathParts[i]);
- }
-
- let testUpdater = testUpdaterDir.clone();
- testUpdater.append(FILE_UPDATER_BIN);
- testUpdater.copyToFollowingLinks(baseAppDir, FILE_UPDATER_BIN);
- } catch (e) {
- logTestInfo("Attempt to copy the test updater failed... " +
- "will try again, Exception: " + e);
- SimpleTest.executeSoon(copyTestUpdater);
- return;
- }
-
- runTest();
-}
-
-/**
- * Restores the updater that was backed up. This is called in setupTestUpdater
- * before the backup of the real updater is done in case the previous test
- * failed to restore the updater, in finishTestDefaultWaitForWindowClosed when
- * the test has finished, and in test_9999_cleanup.xul after all tests have
- * finished.
- */
-function restoreUpdaterBackup() {
- let baseAppDir = getAppBaseDir();
- let updater = baseAppDir.clone();
- let updaterBackup = baseAppDir.clone();
- updater.append(FILE_UPDATER_BIN);
- updaterBackup.append(FILE_UPDATER_BIN_BAK);
- if (updaterBackup.exists()) {
- if (updater.exists()) {
- updater.remove(true);
- }
- updaterBackup.moveTo(baseAppDir, FILE_UPDATER_BIN);
- }
-}
-
-/**
- * Sets the most common preferences used by tests to values used by the majority
- * of the tests and when necessary saves the preference's original values if
- * present so they can be set back to the original values when the test has
- * finished.
- */
-function setupPrefs() {
- if (DEBUG_AUS_TEST) {
- Services.prefs.setBoolPref(PREF_APP_UPDATE_LOG, true);
- }
-
- // Prevent nsIUpdateTimerManager from notifying nsIApplicationUpdateService
- // to check for updates by setting the app update last update time to the
- // current time minus one minute in seconds and the interval time to 12 hours
- // in seconds.
- let now = Math.round(Date.now() / 1000) - 60;
- Services.prefs.setIntPref(PREF_APP_UPDATE_LASTUPDATETIME, now);
- Services.prefs.setIntPref(PREF_APP_UPDATE_INTERVAL, 43200);
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_ENABLED)) {
- gAppUpdateEnabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_ENABLED);
- }
- Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, true);
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_SERVICE_ENABLED)) {
- gAppUpdateServiceEnabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED);
- }
- Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, false);
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_STAGING_ENABLED)) {
- gAppUpdateStagingEnabled = Services.prefs.getBoolPref(PREF_APP_UPDATE_STAGING_ENABLED);
- }
- Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, false);
-
- Services.prefs.setIntPref(PREF_APP_UPDATE_IDLETIME, 0);
- Services.prefs.setIntPref(PREF_APP_UPDATE_PROMPTWAITTIME, 0);
- Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, false);
- Services.prefs.setIntPref(PREF_APP_UPDATE_DOWNLOADBACKGROUNDINTERVAL, 0);
-}
-
-/**
- * Restores files that were backed up for the tests and general file cleanup.
- */
-function resetFiles() {
- // Restore the backed up updater-settings.ini if it exists.
- let baseAppDir = getGREDir();
- let updateSettingsIni = baseAppDir.clone();
- updateSettingsIni.append(FILE_UPDATE_SETTINGS_INI_BAK);
- if (updateSettingsIni.exists()) {
- updateSettingsIni.moveTo(baseAppDir, FILE_UPDATE_SETTINGS_INI);
- }
-
- // Not being able to remove the "updated" directory will not adversely affect
- // subsequent tests so wrap it in a try block and don't test whether its
- // removal was successful.
- let updatedDir;
- if (IS_MACOSX) {
- updatedDir = getUpdatesDir();
- updatedDir.append(DIR_PATCH);
- } else {
- updatedDir = getAppBaseDir();
- }
- updatedDir.append(DIR_UPDATED);
- if (updatedDir.exists()) {
- try {
- removeDirRecursive(updatedDir);
- }
- catch (e) {
- logTestInfo("Unable to remove directory. Path: " + updatedDir.path +
- ", Exception: " + e);
- }
- }
-}
-
-/**
- * Resets the most common preferences used by tests to their original values.
- */
-function resetPrefs() {
- if (gAppUpdateURLDefault) {
- gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_URL, gAppUpdateURLDefault);
- }
-
- if (gAppUpdateEnabled !== undefined) {
- Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, gAppUpdateEnabled);
- } else if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_ENABLED)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_ENABLED);
- }
-
- if (gAppUpdateServiceEnabled !== undefined) {
- Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED, gAppUpdateServiceEnabled);
- } else if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_SERVICE_ENABLED)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_SERVICE_ENABLED);
- }
-
- if (gAppUpdateStagingEnabled !== undefined) {
- Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, gAppUpdateStagingEnabled);
- } else if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_STAGING_ENABLED)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_STAGING_ENABLED);
- }
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_IDLETIME)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_IDLETIME);
- }
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_PROMPTWAITTIME)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_PROMPTWAITTIME);
- }
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_URL_DETAILS)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_URL_DETAILS);
- }
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED);
- }
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_LOG)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_LOG);
- }
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_SILENT)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_SILENT);
- }
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_BACKGROUNDERRORS)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_BACKGROUNDERRORS);
- }
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_BACKGROUNDMAXERRORS)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_BACKGROUNDMAXERRORS);
- }
-
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_DOWNLOADBACKGROUNDINTERVAL)) {
- Services.prefs.clearUserPref(PREF_APP_UPDATE_DOWNLOADBACKGROUNDINTERVAL);
- }
-
- try {
- Services.prefs.deleteBranch(PREFBRANCH_APP_UPDATE_NEVER);
- }
- catch (e) {
- }
-}
-
-function setupTimer(aTestTimeout) {
- gTestTimeout = aTestTimeout;
- if (gTimeoutTimer) {
- gTimeoutTimer.cancel();
- gTimeoutTimer = null;
- }
- gTimeoutTimer = Cc["@mozilla.org/timer;1"].
- createInstance(Ci.nsITimer);
- gTimeoutTimer.initWithCallback(finishTestTimeout, gTestTimeout,
- Ci.nsITimer.TYPE_ONE_SHOT);
-}
-
-/**
- * Closes the update window if it is open and causes the test to fail if an
- * update window is found.
- *
- * @return true if an update window was found, otherwise false.
- */
-function closeUpdateWindow() {
- let updateWindow = getUpdateWindow();
- if (!updateWindow) {
- return false;
- }
-
- ok(false, "Found an existing Update Window from the current or a previous " +
- "test... attempting to close it.");
- updateWindow.close();
- return true;
-}
-
-/**
- * Gets the update window.
- *
- * @return The nsIDOMWindow for the Update Window if it is open and null
- * if it isn't.
- */
-function getUpdateWindow() {
- return Services.wm.getMostRecentWindow(UPDATE_WINDOW_NAME);
-}
-
-/**
- * Helper for background check errors.
- */
-const errorsPrefObserver = {
- observedPref: null,
- maxErrorPref: null,
-
- /**
- * Sets up a preference observer and sets the associated maximum errors
- * preference used for background notification.
- *
- * @param aObservePref
- * The preference to observe.
- * @param aMaxErrorPref
- * The maximum errors preference.
- * @param aMaxErrorCount
- * The value to set the maximum errors preference to.
- */
- init: function(aObservePref, aMaxErrorPref, aMaxErrorCount) {
- this.observedPref = aObservePref;
- this.maxErrorPref = aMaxErrorPref;
-
- let maxErrors = aMaxErrorCount ? aMaxErrorCount : 2;
- Services.prefs.setIntPref(aMaxErrorPref, maxErrors);
- Services.prefs.addObserver(aObservePref, this, false);
- },
-
- /**
- * Preference observer for the preference specified in |this.observedPref|.
- */
- observe: function XPI_observe(aSubject, aTopic, aData) {
- if (aData == this.observedPref) {
- let errCount = Services.prefs.getIntPref(this.observedPref);
- let errMax = Services.prefs.getIntPref(this.maxErrorPref);
- if (errCount >= errMax) {
- debugDump("removing pref observer");
- Services.prefs.removeObserver(this.observedPref, this);
- } else {
- debugDump("notifying AUS");
- SimpleTest.executeSoon(function() {
- gAUS.notify(null);
- });
- }
- }
- }
-};
diff --git a/toolkit/mozapps/update/tests/data/complete.exe b/toolkit/mozapps/update/tests/data/complete.exe
deleted file mode 100644
index da9cdf0cc..000000000
--- a/toolkit/mozapps/update/tests/data/complete.exe
+++ /dev/null
Binary files differ
diff --git a/toolkit/mozapps/update/tests/data/complete.mar b/toolkit/mozapps/update/tests/data/complete.mar
deleted file mode 100644
index 52306e0a2..000000000
--- a/toolkit/mozapps/update/tests/data/complete.mar
+++ /dev/null
Binary files differ
diff --git a/toolkit/mozapps/update/tests/data/complete.png b/toolkit/mozapps/update/tests/data/complete.png
deleted file mode 100644
index 2990a539f..000000000
--- a/toolkit/mozapps/update/tests/data/complete.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/mozapps/update/tests/data/complete_log_success_mac b/toolkit/mozapps/update/tests/data/complete_log_success_mac
deleted file mode 100644
index 4f992a137..000000000
--- a/toolkit/mozapps/update/tests/data/complete_log_success_mac
+++ /dev/null
@@ -1,332 +0,0 @@
-UPDATE TYPE complete
-PREPARE REMOVEFILE Contents/Resources/searchplugins/searchpluginstext0
-PREPARE REMOVEFILE Contents/Resources/searchplugins/searchpluginspng0.png
-PREPARE REMOVEFILE Contents/Resources/removed-files
-PREPARE REMOVEFILE Contents/Resources/precomplete
-PREPARE REMOVEFILE Contents/Resources/2/20/20text0
-PREPARE REMOVEFILE Contents/Resources/2/20/20png0.png
-PREPARE REMOVEFILE Contents/Resources/0/0exe0.exe
-PREPARE REMOVEFILE Contents/Resources/0/00/00text0
-PREPARE REMOVEFILE Contents/MacOS/exe0.exe
-PREPARE REMOVEDIR Contents/Resources/searchplugins/
-PREPARE REMOVEDIR Contents/Resources/defaults/pref/
-PREPARE REMOVEDIR Contents/Resources/defaults/
-PREPARE REMOVEDIR Contents/Resources/2/20/
-PREPARE REMOVEDIR Contents/Resources/2/
-PREPARE REMOVEDIR Contents/Resources/0/00/
-PREPARE REMOVEDIR Contents/Resources/0/
-PREPARE REMOVEDIR Contents/Resources/
-PREPARE REMOVEDIR Contents/MacOS/
-PREPARE REMOVEDIR Contents/
-PREPARE ADD Contents/Resources/searchplugins/searchpluginstext0
-PREPARE ADD Contents/Resources/searchplugins/searchpluginspng1.png
-PREPARE ADD Contents/Resources/searchplugins/searchpluginspng0.png
-PREPARE ADD Contents/Resources/removed-files
-PREPARE ADD Contents/Resources/precomplete
-PREPARE ADD Contents/Resources/distribution/extensions/extensions1/extensions1text0
-PREPARE ADD Contents/Resources/distribution/extensions/extensions1/extensions1png1.png
-PREPARE ADD Contents/Resources/distribution/extensions/extensions1/extensions1png0.png
-PREPARE ADD Contents/Resources/distribution/extensions/extensions0/extensions0text0
-PREPARE ADD Contents/Resources/distribution/extensions/extensions0/extensions0png1.png
-PREPARE ADD Contents/Resources/distribution/extensions/extensions0/extensions0png0.png
-PREPARE ADD Contents/Resources/1/10/10text0
-PREPARE ADD Contents/Resources/0/0exe0.exe
-PREPARE ADD Contents/Resources/0/00/00text1
-PREPARE ADD Contents/Resources/0/00/00text0
-PREPARE ADD Contents/Resources/0/00/00png0.png
-PREPARE ADD Contents/MacOS/exe0.exe
-PREPARE REMOVEDIR Contents/Resources/9/99/
-PREPARE REMOVEDIR Contents/Resources/9/99/
-PREPARE REMOVEDIR Contents/Resources/9/98/
-PREPARE REMOVEFILE Contents/Resources/9/97/970/97xtext0
-PREPARE REMOVEFILE Contents/Resources/9/97/970/97xtext1
-PREPARE REMOVEDIR Contents/Resources/9/97/970/
-PREPARE REMOVEFILE Contents/Resources/9/97/971/97xtext0
-PREPARE REMOVEFILE Contents/Resources/9/97/971/97xtext1
-PREPARE REMOVEDIR Contents/Resources/9/97/971/
-PREPARE REMOVEDIR Contents/Resources/9/97/
-PREPARE REMOVEFILE Contents/Resources/9/96/96text0
-PREPARE REMOVEFILE Contents/Resources/9/96/96text1
-PREPARE REMOVEDIR Contents/Resources/9/96/
-PREPARE REMOVEDIR Contents/Resources/9/95/
-PREPARE REMOVEDIR Contents/Resources/9/95/
-PREPARE REMOVEDIR Contents/Resources/9/94/
-PREPARE REMOVEDIR Contents/Resources/9/94/
-PREPARE REMOVEDIR Contents/Resources/9/93/
-PREPARE REMOVEDIR Contents/Resources/9/92/
-PREPARE REMOVEDIR Contents/Resources/9/91/
-PREPARE REMOVEDIR Contents/Resources/9/90/
-PREPARE REMOVEDIR Contents/Resources/9/90/
-PREPARE REMOVEDIR Contents/Resources/8/89/
-PREPARE REMOVEDIR Contents/Resources/8/89/
-PREPARE REMOVEDIR Contents/Resources/8/88/
-PREPARE REMOVEFILE Contents/Resources/8/87/870/87xtext0
-PREPARE REMOVEFILE Contents/Resources/8/87/870/87xtext1
-PREPARE REMOVEDIR Contents/Resources/8/87/870/
-PREPARE REMOVEFILE Contents/Resources/8/87/871/87xtext0
-PREPARE REMOVEFILE Contents/Resources/8/87/871/87xtext1
-PREPARE REMOVEDIR Contents/Resources/8/87/871/
-PREPARE REMOVEDIR Contents/Resources/8/87/
-PREPARE REMOVEFILE Contents/Resources/8/86/86text0
-PREPARE REMOVEFILE Contents/Resources/8/86/86text1
-PREPARE REMOVEDIR Contents/Resources/8/86/
-PREPARE REMOVEDIR Contents/Resources/8/85/
-PREPARE REMOVEDIR Contents/Resources/8/85/
-PREPARE REMOVEDIR Contents/Resources/8/84/
-PREPARE REMOVEDIR Contents/Resources/8/84/
-PREPARE REMOVEDIR Contents/Resources/8/83/
-PREPARE REMOVEDIR Contents/Resources/8/82/
-PREPARE REMOVEDIR Contents/Resources/8/81/
-PREPARE REMOVEDIR Contents/Resources/8/80/
-PREPARE REMOVEDIR Contents/Resources/8/80/
-PREPARE REMOVEFILE Contents/Resources/7/70/7xtest.exe
-PREPARE REMOVEFILE Contents/Resources/7/70/7xtext0
-PREPARE REMOVEFILE Contents/Resources/7/70/7xtext1
-PREPARE REMOVEDIR Contents/Resources/7/70/
-PREPARE REMOVEFILE Contents/Resources/7/71/7xtest.exe
-PREPARE REMOVEFILE Contents/Resources/7/71/7xtext0
-PREPARE REMOVEFILE Contents/Resources/7/71/7xtext1
-PREPARE REMOVEDIR Contents/Resources/7/71/
-PREPARE REMOVEFILE Contents/Resources/7/7text0
-PREPARE REMOVEFILE Contents/Resources/7/7text1
-PREPARE REMOVEDIR Contents/Resources/7/
-PREPARE REMOVEDIR Contents/Resources/6/
-PREPARE REMOVEFILE Contents/Resources/5/5text1
-PREPARE REMOVEFILE Contents/Resources/5/5text0
-PREPARE REMOVEFILE Contents/Resources/5/5test.exe
-PREPARE REMOVEFILE Contents/Resources/5/5text0
-PREPARE REMOVEFILE Contents/Resources/5/5text1
-PREPARE REMOVEDIR Contents/Resources/5/
-PREPARE REMOVEFILE Contents/Resources/4/4text1
-PREPARE REMOVEFILE Contents/Resources/4/4text0
-PREPARE REMOVEDIR Contents/Resources/4/
-PREPARE REMOVEFILE Contents/Resources/3/3text1
-PREPARE REMOVEFILE Contents/Resources/3/3text0
-EXECUTE REMOVEFILE Contents/Resources/searchplugins/searchpluginstext0
-EXECUTE REMOVEFILE Contents/Resources/searchplugins/searchpluginspng0.png
-EXECUTE REMOVEFILE Contents/Resources/removed-files
-EXECUTE REMOVEFILE Contents/Resources/precomplete
-EXECUTE REMOVEFILE Contents/Resources/2/20/20text0
-EXECUTE REMOVEFILE Contents/Resources/2/20/20png0.png
-EXECUTE REMOVEFILE Contents/Resources/0/0exe0.exe
-EXECUTE REMOVEFILE Contents/Resources/0/00/00text0
-EXECUTE REMOVEFILE Contents/MacOS/exe0.exe
-EXECUTE REMOVEDIR Contents/Resources/searchplugins/
-EXECUTE REMOVEDIR Contents/Resources/defaults/pref/
-EXECUTE REMOVEDIR Contents/Resources/defaults/
-EXECUTE REMOVEDIR Contents/Resources/2/20/
-EXECUTE REMOVEDIR Contents/Resources/2/
-EXECUTE REMOVEDIR Contents/Resources/0/00/
-EXECUTE REMOVEDIR Contents/Resources/0/
-EXECUTE REMOVEDIR Contents/Resources/
-EXECUTE REMOVEDIR Contents/MacOS/
-EXECUTE REMOVEDIR Contents/
-EXECUTE ADD Contents/Resources/searchplugins/searchpluginstext0
-EXECUTE ADD Contents/Resources/searchplugins/searchpluginspng1.png
-EXECUTE ADD Contents/Resources/searchplugins/searchpluginspng0.png
-EXECUTE ADD Contents/Resources/removed-files
-EXECUTE ADD Contents/Resources/precomplete
-EXECUTE ADD Contents/Resources/distribution/extensions/extensions1/extensions1text0
-EXECUTE ADD Contents/Resources/distribution/extensions/extensions1/extensions1png1.png
-EXECUTE ADD Contents/Resources/distribution/extensions/extensions1/extensions1png0.png
-EXECUTE ADD Contents/Resources/distribution/extensions/extensions0/extensions0text0
-EXECUTE ADD Contents/Resources/distribution/extensions/extensions0/extensions0png1.png
-EXECUTE ADD Contents/Resources/distribution/extensions/extensions0/extensions0png0.png
-EXECUTE ADD Contents/Resources/1/10/10text0
-EXECUTE ADD Contents/Resources/0/0exe0.exe
-EXECUTE ADD Contents/Resources/0/00/00text1
-EXECUTE ADD Contents/Resources/0/00/00text0
-EXECUTE ADD Contents/Resources/0/00/00png0.png
-EXECUTE ADD Contents/MacOS/exe0.exe
-EXECUTE REMOVEDIR Contents/Resources/9/99/
-EXECUTE REMOVEDIR Contents/Resources/9/99/
-EXECUTE REMOVEDIR Contents/Resources/9/98/
-EXECUTE REMOVEFILE Contents/Resources/9/97/970/97xtext0
-EXECUTE REMOVEFILE Contents/Resources/9/97/970/97xtext1
-EXECUTE REMOVEDIR Contents/Resources/9/97/970/
-EXECUTE REMOVEFILE Contents/Resources/9/97/971/97xtext0
-EXECUTE REMOVEFILE Contents/Resources/9/97/971/97xtext1
-EXECUTE REMOVEDIR Contents/Resources/9/97/971/
-EXECUTE REMOVEDIR Contents/Resources/9/97/
-EXECUTE REMOVEFILE Contents/Resources/9/96/96text0
-EXECUTE REMOVEFILE Contents/Resources/9/96/96text1
-EXECUTE REMOVEDIR Contents/Resources/9/96/
-EXECUTE REMOVEDIR Contents/Resources/9/95/
-EXECUTE REMOVEDIR Contents/Resources/9/95/
-EXECUTE REMOVEDIR Contents/Resources/9/94/
-EXECUTE REMOVEDIR Contents/Resources/9/94/
-EXECUTE REMOVEDIR Contents/Resources/9/93/
-EXECUTE REMOVEDIR Contents/Resources/9/92/
-EXECUTE REMOVEDIR Contents/Resources/9/91/
-EXECUTE REMOVEDIR Contents/Resources/9/90/
-EXECUTE REMOVEDIR Contents/Resources/9/90/
-EXECUTE REMOVEDIR Contents/Resources/8/89/
-EXECUTE REMOVEDIR Contents/Resources/8/89/
-EXECUTE REMOVEDIR Contents/Resources/8/88/
-EXECUTE REMOVEFILE Contents/Resources/8/87/870/87xtext0
-EXECUTE REMOVEFILE Contents/Resources/8/87/870/87xtext1
-EXECUTE REMOVEDIR Contents/Resources/8/87/870/
-EXECUTE REMOVEFILE Contents/Resources/8/87/871/87xtext0
-EXECUTE REMOVEFILE Contents/Resources/8/87/871/87xtext1
-EXECUTE REMOVEDIR Contents/Resources/8/87/871/
-EXECUTE REMOVEDIR Contents/Resources/8/87/
-EXECUTE REMOVEFILE Contents/Resources/8/86/86text0
-EXECUTE REMOVEFILE Contents/Resources/8/86/86text1
-EXECUTE REMOVEDIR Contents/Resources/8/86/
-EXECUTE REMOVEDIR Contents/Resources/8/85/
-EXECUTE REMOVEDIR Contents/Resources/8/85/
-EXECUTE REMOVEDIR Contents/Resources/8/84/
-EXECUTE REMOVEDIR Contents/Resources/8/84/
-EXECUTE REMOVEDIR Contents/Resources/8/83/
-EXECUTE REMOVEDIR Contents/Resources/8/82/
-EXECUTE REMOVEDIR Contents/Resources/8/81/
-EXECUTE REMOVEDIR Contents/Resources/8/80/
-EXECUTE REMOVEDIR Contents/Resources/8/80/
-EXECUTE REMOVEFILE Contents/Resources/7/70/7xtest.exe
-EXECUTE REMOVEFILE Contents/Resources/7/70/7xtext0
-EXECUTE REMOVEFILE Contents/Resources/7/70/7xtext1
-EXECUTE REMOVEDIR Contents/Resources/7/70/
-EXECUTE REMOVEFILE Contents/Resources/7/71/7xtest.exe
-EXECUTE REMOVEFILE Contents/Resources/7/71/7xtext0
-EXECUTE REMOVEFILE Contents/Resources/7/71/7xtext1
-EXECUTE REMOVEDIR Contents/Resources/7/71/
-EXECUTE REMOVEFILE Contents/Resources/7/7text0
-EXECUTE REMOVEFILE Contents/Resources/7/7text1
-EXECUTE REMOVEDIR Contents/Resources/7/
-EXECUTE REMOVEDIR Contents/Resources/6/
-EXECUTE REMOVEFILE Contents/Resources/5/5text1
-EXECUTE REMOVEFILE Contents/Resources/5/5text0
-EXECUTE REMOVEFILE Contents/Resources/5/5test.exe
-EXECUTE REMOVEFILE Contents/Resources/5/5text0
-file cannot be removed because it does not exist; skipping
-EXECUTE REMOVEFILE Contents/Resources/5/5text1
-file cannot be removed because it does not exist; skipping
-EXECUTE REMOVEDIR Contents/Resources/5/
-EXECUTE REMOVEFILE Contents/Resources/4/4text1
-EXECUTE REMOVEFILE Contents/Resources/4/4text0
-EXECUTE REMOVEDIR Contents/Resources/4/
-EXECUTE REMOVEFILE Contents/Resources/3/3text1
-EXECUTE REMOVEFILE Contents/Resources/3/3text0
-FINISH REMOVEFILE Contents/Resources/searchplugins/searchpluginstext0
-FINISH REMOVEFILE Contents/Resources/searchplugins/searchpluginspng0.png
-FINISH REMOVEFILE Contents/Resources/removed-files
-FINISH REMOVEFILE Contents/Resources/precomplete
-FINISH REMOVEFILE Contents/Resources/2/20/20text0
-FINISH REMOVEFILE Contents/Resources/2/20/20png0.png
-FINISH REMOVEFILE Contents/Resources/0/0exe0.exe
-FINISH REMOVEFILE Contents/Resources/0/00/00text0
-FINISH REMOVEFILE Contents/MacOS/exe0.exe
-FINISH REMOVEDIR Contents/Resources/searchplugins/
-removing directory: Contents/Resources/searchplugins/, rv: 0
-FINISH REMOVEDIR Contents/Resources/defaults/pref/
-removing directory: Contents/Resources/defaults/pref/, rv: 0
-FINISH REMOVEDIR Contents/Resources/defaults/
-removing directory: Contents/Resources/defaults/, rv: 0
-FINISH REMOVEDIR Contents/Resources/2/20/
-FINISH REMOVEDIR Contents/Resources/2/
-FINISH REMOVEDIR Contents/Resources/0/00/
-removing directory: Contents/Resources/0/00/, rv: 0
-FINISH REMOVEDIR Contents/Resources/0/
-removing directory: Contents/Resources/0/, rv: 0
-FINISH REMOVEDIR Contents/Resources/
-removing directory: Contents/Resources/, rv: 0
-FINISH REMOVEDIR Contents/MacOS/
-removing directory: Contents/MacOS/, rv: 0
-FINISH REMOVEDIR Contents/
-removing directory: Contents/, rv: 0
-FINISH ADD Contents/Resources/searchplugins/searchpluginstext0
-FINISH ADD Contents/Resources/searchplugins/searchpluginspng1.png
-FINISH ADD Contents/Resources/searchplugins/searchpluginspng0.png
-FINISH ADD Contents/Resources/removed-files
-FINISH ADD Contents/Resources/precomplete
-FINISH ADD Contents/Resources/distribution/extensions/extensions1/extensions1text0
-FINISH ADD Contents/Resources/distribution/extensions/extensions1/extensions1png1.png
-FINISH ADD Contents/Resources/distribution/extensions/extensions1/extensions1png0.png
-FINISH ADD Contents/Resources/distribution/extensions/extensions0/extensions0text0
-FINISH ADD Contents/Resources/distribution/extensions/extensions0/extensions0png1.png
-FINISH ADD Contents/Resources/distribution/extensions/extensions0/extensions0png0.png
-FINISH ADD Contents/Resources/1/10/10text0
-FINISH ADD Contents/Resources/0/0exe0.exe
-FINISH ADD Contents/Resources/0/00/00text1
-FINISH ADD Contents/Resources/0/00/00text0
-FINISH ADD Contents/Resources/0/00/00png0.png
-FINISH ADD Contents/MacOS/exe0.exe
-FINISH REMOVEDIR Contents/Resources/9/99/
-FINISH REMOVEDIR Contents/Resources/9/99/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/9/98/
-FINISH REMOVEFILE Contents/Resources/9/97/970/97xtext0
-FINISH REMOVEFILE Contents/Resources/9/97/970/97xtext1
-FINISH REMOVEDIR Contents/Resources/9/97/970/
-FINISH REMOVEFILE Contents/Resources/9/97/971/97xtext0
-FINISH REMOVEFILE Contents/Resources/9/97/971/97xtext1
-FINISH REMOVEDIR Contents/Resources/9/97/971/
-FINISH REMOVEDIR Contents/Resources/9/97/
-FINISH REMOVEFILE Contents/Resources/9/96/96text0
-FINISH REMOVEFILE Contents/Resources/9/96/96text1
-FINISH REMOVEDIR Contents/Resources/9/96/
-FINISH REMOVEDIR Contents/Resources/9/95/
-FINISH REMOVEDIR Contents/Resources/9/95/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/9/94/
-FINISH REMOVEDIR Contents/Resources/9/94/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/9/93/
-FINISH REMOVEDIR Contents/Resources/9/92/
-removing directory: Contents/Resources/9/92/, rv: 0
-FINISH REMOVEDIR Contents/Resources/9/91/
-removing directory: Contents/Resources/9/91/, rv: 0
-FINISH REMOVEDIR Contents/Resources/9/90/
-FINISH REMOVEDIR Contents/Resources/9/90/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/8/89/
-FINISH REMOVEDIR Contents/Resources/8/89/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/8/88/
-FINISH REMOVEFILE Contents/Resources/8/87/870/87xtext0
-FINISH REMOVEFILE Contents/Resources/8/87/870/87xtext1
-FINISH REMOVEDIR Contents/Resources/8/87/870/
-FINISH REMOVEFILE Contents/Resources/8/87/871/87xtext0
-FINISH REMOVEFILE Contents/Resources/8/87/871/87xtext1
-FINISH REMOVEDIR Contents/Resources/8/87/871/
-FINISH REMOVEDIR Contents/Resources/8/87/
-FINISH REMOVEFILE Contents/Resources/8/86/86text0
-FINISH REMOVEFILE Contents/Resources/8/86/86text1
-FINISH REMOVEDIR Contents/Resources/8/86/
-FINISH REMOVEDIR Contents/Resources/8/85/
-FINISH REMOVEDIR Contents/Resources/8/85/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/8/84/
-FINISH REMOVEDIR Contents/Resources/8/84/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/8/83/
-FINISH REMOVEDIR Contents/Resources/8/82/
-removing directory: Contents/Resources/8/82/, rv: 0
-FINISH REMOVEDIR Contents/Resources/8/81/
-removing directory: Contents/Resources/8/81/, rv: 0
-FINISH REMOVEDIR Contents/Resources/8/80/
-FINISH REMOVEDIR Contents/Resources/8/80/
-directory no longer exists; skipping
-FINISH REMOVEFILE Contents/Resources/7/70/7xtest.exe
-FINISH REMOVEFILE Contents/Resources/7/70/7xtext0
-FINISH REMOVEFILE Contents/Resources/7/70/7xtext1
-FINISH REMOVEDIR Contents/Resources/7/70/
-FINISH REMOVEFILE Contents/Resources/7/71/7xtest.exe
-FINISH REMOVEFILE Contents/Resources/7/71/7xtext0
-FINISH REMOVEFILE Contents/Resources/7/71/7xtext1
-FINISH REMOVEDIR Contents/Resources/7/71/
-FINISH REMOVEFILE Contents/Resources/7/7text0
-FINISH REMOVEFILE Contents/Resources/7/7text1
-FINISH REMOVEDIR Contents/Resources/7/
-FINISH REMOVEDIR Contents/Resources/6/
-FINISH REMOVEFILE Contents/Resources/5/5text1
-FINISH REMOVEFILE Contents/Resources/5/5text0
-FINISH REMOVEFILE Contents/Resources/5/5test.exe
-FINISH REMOVEDIR Contents/Resources/5/
-FINISH REMOVEFILE Contents/Resources/4/4text1
-FINISH REMOVEFILE Contents/Resources/4/4text0
-FINISH REMOVEDIR Contents/Resources/4/
-FINISH REMOVEFILE Contents/Resources/3/3text1
-FINISH REMOVEFILE Contents/Resources/3/3text0
-succeeded
-calling QuitProgressUI
diff --git a/toolkit/mozapps/update/tests/data/complete_log_success_win b/toolkit/mozapps/update/tests/data/complete_log_success_win
deleted file mode 100644
index c5a03dc9d..000000000
--- a/toolkit/mozapps/update/tests/data/complete_log_success_win
+++ /dev/null
@@ -1,320 +0,0 @@
-UPDATE TYPE complete
-PREPARE REMOVEFILE searchplugins/searchpluginstext0
-PREPARE REMOVEFILE searchplugins/searchpluginspng0.png
-PREPARE REMOVEFILE removed-files
-PREPARE REMOVEFILE precomplete
-PREPARE REMOVEFILE exe0.exe
-PREPARE REMOVEFILE 2/20/20text0
-PREPARE REMOVEFILE 2/20/20png0.png
-PREPARE REMOVEFILE 0/0exe0.exe
-PREPARE REMOVEFILE 0/00/00text0
-PREPARE REMOVEDIR searchplugins/
-PREPARE REMOVEDIR defaults/pref/
-PREPARE REMOVEDIR defaults/
-PREPARE REMOVEDIR 2/20/
-PREPARE REMOVEDIR 2/
-PREPARE REMOVEDIR 0/00/
-PREPARE REMOVEDIR 0/
-PREPARE ADD searchplugins/searchpluginstext0
-PREPARE ADD searchplugins/searchpluginspng1.png
-PREPARE ADD searchplugins/searchpluginspng0.png
-PREPARE ADD removed-files
-PREPARE ADD precomplete
-PREPARE ADD exe0.exe
-PREPARE ADD distribution/extensions/extensions1/extensions1text0
-PREPARE ADD distribution/extensions/extensions1/extensions1png1.png
-PREPARE ADD distribution/extensions/extensions1/extensions1png0.png
-PREPARE ADD distribution/extensions/extensions0/extensions0text0
-PREPARE ADD distribution/extensions/extensions0/extensions0png1.png
-PREPARE ADD distribution/extensions/extensions0/extensions0png0.png
-PREPARE ADD 1/10/10text0
-PREPARE ADD 0/0exe0.exe
-PREPARE ADD 0/00/00text1
-PREPARE ADD 0/00/00text0
-PREPARE ADD 0/00/00png0.png
-PREPARE REMOVEDIR 9/99/
-PREPARE REMOVEDIR 9/99/
-PREPARE REMOVEDIR 9/98/
-PREPARE REMOVEFILE 9/97/970/97xtext0
-PREPARE REMOVEFILE 9/97/970/97xtext1
-PREPARE REMOVEDIR 9/97/970/
-PREPARE REMOVEFILE 9/97/971/97xtext0
-PREPARE REMOVEFILE 9/97/971/97xtext1
-PREPARE REMOVEDIR 9/97/971/
-PREPARE REMOVEDIR 9/97/
-PREPARE REMOVEFILE 9/96/96text0
-PREPARE REMOVEFILE 9/96/96text1
-PREPARE REMOVEDIR 9/96/
-PREPARE REMOVEDIR 9/95/
-PREPARE REMOVEDIR 9/95/
-PREPARE REMOVEDIR 9/94/
-PREPARE REMOVEDIR 9/94/
-PREPARE REMOVEDIR 9/93/
-PREPARE REMOVEDIR 9/92/
-PREPARE REMOVEDIR 9/91/
-PREPARE REMOVEDIR 9/90/
-PREPARE REMOVEDIR 9/90/
-PREPARE REMOVEDIR 8/89/
-PREPARE REMOVEDIR 8/89/
-PREPARE REMOVEDIR 8/88/
-PREPARE REMOVEFILE 8/87/870/87xtext0
-PREPARE REMOVEFILE 8/87/870/87xtext1
-PREPARE REMOVEDIR 8/87/870/
-PREPARE REMOVEFILE 8/87/871/87xtext0
-PREPARE REMOVEFILE 8/87/871/87xtext1
-PREPARE REMOVEDIR 8/87/871/
-PREPARE REMOVEDIR 8/87/
-PREPARE REMOVEFILE 8/86/86text0
-PREPARE REMOVEFILE 8/86/86text1
-PREPARE REMOVEDIR 8/86/
-PREPARE REMOVEDIR 8/85/
-PREPARE REMOVEDIR 8/85/
-PREPARE REMOVEDIR 8/84/
-PREPARE REMOVEDIR 8/84/
-PREPARE REMOVEDIR 8/83/
-PREPARE REMOVEDIR 8/82/
-PREPARE REMOVEDIR 8/81/
-PREPARE REMOVEDIR 8/80/
-PREPARE REMOVEDIR 8/80/
-PREPARE REMOVEFILE 7/70/7xtest.exe
-PREPARE REMOVEFILE 7/70/7xtext0
-PREPARE REMOVEFILE 7/70/7xtext1
-PREPARE REMOVEDIR 7/70/
-PREPARE REMOVEFILE 7/71/7xtest.exe
-PREPARE REMOVEFILE 7/71/7xtext0
-PREPARE REMOVEFILE 7/71/7xtext1
-PREPARE REMOVEDIR 7/71/
-PREPARE REMOVEFILE 7/7text0
-PREPARE REMOVEFILE 7/7text1
-PREPARE REMOVEDIR 7/
-PREPARE REMOVEDIR 6/
-PREPARE REMOVEFILE 5/5text1
-PREPARE REMOVEFILE 5/5text0
-PREPARE REMOVEFILE 5/5test.exe
-PREPARE REMOVEFILE 5/5text0
-PREPARE REMOVEFILE 5/5text1
-PREPARE REMOVEDIR 5/
-PREPARE REMOVEFILE 4/4text1
-PREPARE REMOVEFILE 4/4text0
-PREPARE REMOVEDIR 4/
-PREPARE REMOVEFILE 3/3text1
-PREPARE REMOVEFILE 3/3text0
-EXECUTE REMOVEFILE searchplugins/searchpluginstext0
-EXECUTE REMOVEFILE searchplugins/searchpluginspng0.png
-EXECUTE REMOVEFILE removed-files
-EXECUTE REMOVEFILE precomplete
-EXECUTE REMOVEFILE exe0.exe
-EXECUTE REMOVEFILE 2/20/20text0
-EXECUTE REMOVEFILE 2/20/20png0.png
-EXECUTE REMOVEFILE 0/0exe0.exe
-EXECUTE REMOVEFILE 0/00/00text0
-EXECUTE REMOVEDIR searchplugins/
-EXECUTE REMOVEDIR defaults/pref/
-EXECUTE REMOVEDIR defaults/
-EXECUTE REMOVEDIR 2/20/
-EXECUTE REMOVEDIR 2/
-EXECUTE REMOVEDIR 0/00/
-EXECUTE REMOVEDIR 0/
-EXECUTE ADD searchplugins/searchpluginstext0
-EXECUTE ADD searchplugins/searchpluginspng1.png
-EXECUTE ADD searchplugins/searchpluginspng0.png
-EXECUTE ADD removed-files
-EXECUTE ADD precomplete
-EXECUTE ADD exe0.exe
-EXECUTE ADD distribution/extensions/extensions1/extensions1text0
-EXECUTE ADD distribution/extensions/extensions1/extensions1png1.png
-EXECUTE ADD distribution/extensions/extensions1/extensions1png0.png
-EXECUTE ADD distribution/extensions/extensions0/extensions0text0
-EXECUTE ADD distribution/extensions/extensions0/extensions0png1.png
-EXECUTE ADD distribution/extensions/extensions0/extensions0png0.png
-EXECUTE ADD 1/10/10text0
-EXECUTE ADD 0/0exe0.exe
-EXECUTE ADD 0/00/00text1
-EXECUTE ADD 0/00/00text0
-EXECUTE ADD 0/00/00png0.png
-EXECUTE REMOVEDIR 9/99/
-EXECUTE REMOVEDIR 9/99/
-EXECUTE REMOVEDIR 9/98/
-EXECUTE REMOVEFILE 9/97/970/97xtext0
-EXECUTE REMOVEFILE 9/97/970/97xtext1
-EXECUTE REMOVEDIR 9/97/970/
-EXECUTE REMOVEFILE 9/97/971/97xtext0
-EXECUTE REMOVEFILE 9/97/971/97xtext1
-EXECUTE REMOVEDIR 9/97/971/
-EXECUTE REMOVEDIR 9/97/
-EXECUTE REMOVEFILE 9/96/96text0
-EXECUTE REMOVEFILE 9/96/96text1
-EXECUTE REMOVEDIR 9/96/
-EXECUTE REMOVEDIR 9/95/
-EXECUTE REMOVEDIR 9/95/
-EXECUTE REMOVEDIR 9/94/
-EXECUTE REMOVEDIR 9/94/
-EXECUTE REMOVEDIR 9/93/
-EXECUTE REMOVEDIR 9/92/
-EXECUTE REMOVEDIR 9/91/
-EXECUTE REMOVEDIR 9/90/
-EXECUTE REMOVEDIR 9/90/
-EXECUTE REMOVEDIR 8/89/
-EXECUTE REMOVEDIR 8/89/
-EXECUTE REMOVEDIR 8/88/
-EXECUTE REMOVEFILE 8/87/870/87xtext0
-EXECUTE REMOVEFILE 8/87/870/87xtext1
-EXECUTE REMOVEDIR 8/87/870/
-EXECUTE REMOVEFILE 8/87/871/87xtext0
-EXECUTE REMOVEFILE 8/87/871/87xtext1
-EXECUTE REMOVEDIR 8/87/871/
-EXECUTE REMOVEDIR 8/87/
-EXECUTE REMOVEFILE 8/86/86text0
-EXECUTE REMOVEFILE 8/86/86text1
-EXECUTE REMOVEDIR 8/86/
-EXECUTE REMOVEDIR 8/85/
-EXECUTE REMOVEDIR 8/85/
-EXECUTE REMOVEDIR 8/84/
-EXECUTE REMOVEDIR 8/84/
-EXECUTE REMOVEDIR 8/83/
-EXECUTE REMOVEDIR 8/82/
-EXECUTE REMOVEDIR 8/81/
-EXECUTE REMOVEDIR 8/80/
-EXECUTE REMOVEDIR 8/80/
-EXECUTE REMOVEFILE 7/70/7xtest.exe
-EXECUTE REMOVEFILE 7/70/7xtext0
-EXECUTE REMOVEFILE 7/70/7xtext1
-EXECUTE REMOVEDIR 7/70/
-EXECUTE REMOVEFILE 7/71/7xtest.exe
-EXECUTE REMOVEFILE 7/71/7xtext0
-EXECUTE REMOVEFILE 7/71/7xtext1
-EXECUTE REMOVEDIR 7/71/
-EXECUTE REMOVEFILE 7/7text0
-EXECUTE REMOVEFILE 7/7text1
-EXECUTE REMOVEDIR 7/
-EXECUTE REMOVEDIR 6/
-EXECUTE REMOVEFILE 5/5text1
-EXECUTE REMOVEFILE 5/5text0
-EXECUTE REMOVEFILE 5/5test.exe
-EXECUTE REMOVEFILE 5/5text0
-file cannot be removed because it does not exist; skipping
-EXECUTE REMOVEFILE 5/5text1
-file cannot be removed because it does not exist; skipping
-EXECUTE REMOVEDIR 5/
-EXECUTE REMOVEFILE 4/4text1
-EXECUTE REMOVEFILE 4/4text0
-EXECUTE REMOVEDIR 4/
-EXECUTE REMOVEFILE 3/3text1
-EXECUTE REMOVEFILE 3/3text0
-FINISH REMOVEFILE searchplugins/searchpluginstext0
-FINISH REMOVEFILE searchplugins/searchpluginspng0.png
-FINISH REMOVEFILE removed-files
-FINISH REMOVEFILE precomplete
-FINISH REMOVEFILE exe0.exe
-FINISH REMOVEFILE 2/20/20text0
-FINISH REMOVEFILE 2/20/20png0.png
-FINISH REMOVEFILE 0/0exe0.exe
-FINISH REMOVEFILE 0/00/00text0
-FINISH REMOVEDIR searchplugins/
-removing directory: searchplugins/, rv: 0
-FINISH REMOVEDIR defaults/pref/
-removing directory: defaults/pref/, rv: 0
-FINISH REMOVEDIR defaults/
-removing directory: defaults/, rv: 0
-FINISH REMOVEDIR 2/20/
-FINISH REMOVEDIR 2/
-FINISH REMOVEDIR 0/00/
-removing directory: 0/00/, rv: 0
-FINISH REMOVEDIR 0/
-removing directory: 0/, rv: 0
-FINISH ADD searchplugins/searchpluginstext0
-FINISH ADD searchplugins/searchpluginspng1.png
-FINISH ADD searchplugins/searchpluginspng0.png
-FINISH ADD removed-files
-FINISH ADD precomplete
-FINISH ADD exe0.exe
-FINISH ADD distribution/extensions/extensions1/extensions1text0
-FINISH ADD distribution/extensions/extensions1/extensions1png1.png
-FINISH ADD distribution/extensions/extensions1/extensions1png0.png
-FINISH ADD distribution/extensions/extensions0/extensions0text0
-FINISH ADD distribution/extensions/extensions0/extensions0png1.png
-FINISH ADD distribution/extensions/extensions0/extensions0png0.png
-FINISH ADD 1/10/10text0
-FINISH ADD 0/0exe0.exe
-FINISH ADD 0/00/00text1
-FINISH ADD 0/00/00text0
-FINISH ADD 0/00/00png0.png
-FINISH REMOVEDIR 9/99/
-FINISH REMOVEDIR 9/99/
-directory no longer exists; skipping
-FINISH REMOVEDIR 9/98/
-FINISH REMOVEFILE 9/97/970/97xtext0
-FINISH REMOVEFILE 9/97/970/97xtext1
-FINISH REMOVEDIR 9/97/970/
-FINISH REMOVEFILE 9/97/971/97xtext0
-FINISH REMOVEFILE 9/97/971/97xtext1
-FINISH REMOVEDIR 9/97/971/
-FINISH REMOVEDIR 9/97/
-FINISH REMOVEFILE 9/96/96text0
-FINISH REMOVEFILE 9/96/96text1
-FINISH REMOVEDIR 9/96/
-FINISH REMOVEDIR 9/95/
-FINISH REMOVEDIR 9/95/
-directory no longer exists; skipping
-FINISH REMOVEDIR 9/94/
-FINISH REMOVEDIR 9/94/
-directory no longer exists; skipping
-FINISH REMOVEDIR 9/93/
-FINISH REMOVEDIR 9/92/
-removing directory: 9/92/, rv: 0
-FINISH REMOVEDIR 9/91/
-removing directory: 9/91/, rv: 0
-FINISH REMOVEDIR 9/90/
-FINISH REMOVEDIR 9/90/
-directory no longer exists; skipping
-FINISH REMOVEDIR 8/89/
-FINISH REMOVEDIR 8/89/
-directory no longer exists; skipping
-FINISH REMOVEDIR 8/88/
-FINISH REMOVEFILE 8/87/870/87xtext0
-FINISH REMOVEFILE 8/87/870/87xtext1
-FINISH REMOVEDIR 8/87/870/
-FINISH REMOVEFILE 8/87/871/87xtext0
-FINISH REMOVEFILE 8/87/871/87xtext1
-FINISH REMOVEDIR 8/87/871/
-FINISH REMOVEDIR 8/87/
-FINISH REMOVEFILE 8/86/86text0
-FINISH REMOVEFILE 8/86/86text1
-FINISH REMOVEDIR 8/86/
-FINISH REMOVEDIR 8/85/
-FINISH REMOVEDIR 8/85/
-directory no longer exists; skipping
-FINISH REMOVEDIR 8/84/
-FINISH REMOVEDIR 8/84/
-directory no longer exists; skipping
-FINISH REMOVEDIR 8/83/
-FINISH REMOVEDIR 8/82/
-removing directory: 8/82/, rv: 0
-FINISH REMOVEDIR 8/81/
-removing directory: 8/81/, rv: 0
-FINISH REMOVEDIR 8/80/
-FINISH REMOVEDIR 8/80/
-directory no longer exists; skipping
-FINISH REMOVEFILE 7/70/7xtest.exe
-FINISH REMOVEFILE 7/70/7xtext0
-FINISH REMOVEFILE 7/70/7xtext1
-FINISH REMOVEDIR 7/70/
-FINISH REMOVEFILE 7/71/7xtest.exe
-FINISH REMOVEFILE 7/71/7xtext0
-FINISH REMOVEFILE 7/71/7xtext1
-FINISH REMOVEDIR 7/71/
-FINISH REMOVEFILE 7/7text0
-FINISH REMOVEFILE 7/7text1
-FINISH REMOVEDIR 7/
-FINISH REMOVEDIR 6/
-FINISH REMOVEFILE 5/5text1
-FINISH REMOVEFILE 5/5text0
-FINISH REMOVEFILE 5/5test.exe
-FINISH REMOVEDIR 5/
-FINISH REMOVEFILE 4/4text1
-FINISH REMOVEFILE 4/4text0
-FINISH REMOVEDIR 4/
-FINISH REMOVEFILE 3/3text1
-FINISH REMOVEFILE 3/3text0
-succeeded
-calling QuitProgressUI
diff --git a/toolkit/mozapps/update/tests/data/complete_mac.mar b/toolkit/mozapps/update/tests/data/complete_mac.mar
deleted file mode 100644
index ca1497f4f..000000000
--- a/toolkit/mozapps/update/tests/data/complete_mac.mar
+++ /dev/null
Binary files differ
diff --git a/toolkit/mozapps/update/tests/data/complete_precomplete b/toolkit/mozapps/update/tests/data/complete_precomplete
deleted file mode 100644
index ae7a0013f..000000000
--- a/toolkit/mozapps/update/tests/data/complete_precomplete
+++ /dev/null
@@ -1,18 +0,0 @@
-remove "searchplugins/searchpluginstext0"
-remove "searchplugins/searchpluginspng1.png"
-remove "searchplugins/searchpluginspng0.png"
-remove "removed-files"
-remove "precomplete"
-remove "exe0.exe"
-remove "1/10/10text0"
-remove "0/0exe0.exe"
-remove "0/00/00text1"
-remove "0/00/00text0"
-remove "0/00/00png0.png"
-rmdir "searchplugins/"
-rmdir "defaults/pref/"
-rmdir "defaults/"
-rmdir "1/10/"
-rmdir "1/"
-rmdir "0/00/"
-rmdir "0/"
diff --git a/toolkit/mozapps/update/tests/data/complete_precomplete_mac b/toolkit/mozapps/update/tests/data/complete_precomplete_mac
deleted file mode 100644
index 8d81a36d6..000000000
--- a/toolkit/mozapps/update/tests/data/complete_precomplete_mac
+++ /dev/null
@@ -1,21 +0,0 @@
-remove "Contents/Resources/searchplugins/searchpluginstext0"
-remove "Contents/Resources/searchplugins/searchpluginspng1.png"
-remove "Contents/Resources/searchplugins/searchpluginspng0.png"
-remove "Contents/Resources/removed-files"
-remove "Contents/Resources/precomplete"
-remove "Contents/Resources/1/10/10text0"
-remove "Contents/Resources/0/0exe0.exe"
-remove "Contents/Resources/0/00/00text1"
-remove "Contents/Resources/0/00/00text0"
-remove "Contents/Resources/0/00/00png0.png"
-remove "Contents/MacOS/exe0.exe"
-rmdir "Contents/Resources/searchplugins/"
-rmdir "Contents/Resources/defaults/pref/"
-rmdir "Contents/Resources/defaults/"
-rmdir "Contents/Resources/1/10/"
-rmdir "Contents/Resources/1/"
-rmdir "Contents/Resources/0/00/"
-rmdir "Contents/Resources/0/"
-rmdir "Contents/Resources/"
-rmdir "Contents/MacOS/"
-rmdir "Contents/"
diff --git a/toolkit/mozapps/update/tests/data/complete_removed-files b/toolkit/mozapps/update/tests/data/complete_removed-files
deleted file mode 100644
index e45c43c1f..000000000
--- a/toolkit/mozapps/update/tests/data/complete_removed-files
+++ /dev/null
@@ -1,41 +0,0 @@
-text0
-text1
-3/3text0
-3/3text1
-4/exe0.exe
-4/4text0
-4/4text1
-4/
-5/5text0
-5/5text1
-5/*
-6/
-7/*
-8/80/
-8/81/
-8/82/
-8/83/
-8/84/
-8/85/*
-8/86/*
-8/87/*
-8/88/*
-8/89/*
-8/80/
-8/84/*
-8/85/*
-8/89/
-9/90/
-9/91/
-9/92/
-9/93/
-9/94/
-9/95/*
-9/96/*
-9/97/*
-9/98/*
-9/99/*
-9/90/
-9/94/*
-9/95/*
-9/99/
diff --git a/toolkit/mozapps/update/tests/data/complete_removed-files_mac b/toolkit/mozapps/update/tests/data/complete_removed-files_mac
deleted file mode 100644
index 955dc5b34..000000000
--- a/toolkit/mozapps/update/tests/data/complete_removed-files_mac
+++ /dev/null
@@ -1,41 +0,0 @@
-Contents/Resources/text0
-Contents/Resources/text1
-Contents/Resources/3/3text0
-Contents/Resources/3/3text1
-Contents/Resources/4/exe0.exe
-Contents/Resources/4/4text0
-Contents/Resources/4/4text1
-Contents/Resources/4/
-Contents/Resources/5/5text0
-Contents/Resources/5/5text1
-Contents/Resources/5/*
-Contents/Resources/6/
-Contents/Resources/7/*
-Contents/Resources/8/80/
-Contents/Resources/8/81/
-Contents/Resources/8/82/
-Contents/Resources/8/83/
-Contents/Resources/8/84/
-Contents/Resources/8/85/*
-Contents/Resources/8/86/*
-Contents/Resources/8/87/*
-Contents/Resources/8/88/*
-Contents/Resources/8/89/*
-Contents/Resources/8/80/
-Contents/Resources/8/84/*
-Contents/Resources/8/85/*
-Contents/Resources/8/89/
-Contents/Resources/9/90/
-Contents/Resources/9/91/
-Contents/Resources/9/92/
-Contents/Resources/9/93/
-Contents/Resources/9/94/
-Contents/Resources/9/95/*
-Contents/Resources/9/96/*
-Contents/Resources/9/97/*
-Contents/Resources/9/98/*
-Contents/Resources/9/99/*
-Contents/Resources/9/90/
-Contents/Resources/9/94/*
-Contents/Resources/9/95/*
-Contents/Resources/9/99/
diff --git a/toolkit/mozapps/update/tests/data/complete_update_manifest b/toolkit/mozapps/update/tests/data/complete_update_manifest
deleted file mode 100644
index 383a324f6..000000000
--- a/toolkit/mozapps/update/tests/data/complete_update_manifest
+++ /dev/null
@@ -1,59 +0,0 @@
-type "complete"
-add "precomplete"
-add "searchplugins/searchpluginstext0"
-add "searchplugins/searchpluginspng1.png"
-add "searchplugins/searchpluginspng0.png"
-add "removed-files"
-add-if "extensions/extensions1" "extensions/extensions1/extensions1text0"
-add-if "extensions/extensions1" "extensions/extensions1/extensions1png1.png"
-add-if "extensions/extensions1" "extensions/extensions1/extensions1png0.png"
-add-if "extensions/extensions0" "extensions/extensions0/extensions0text0"
-add-if "extensions/extensions0" "extensions/extensions0/extensions0png1.png"
-add-if "extensions/extensions0" "extensions/extensions0/extensions0png0.png"
-add "exe0.exe"
-add "1/10/10text0"
-add "0/0exe0.exe"
-add "0/00/00text1"
-add "0/00/00text0"
-add "0/00/00png0.png"
-remove "text1"
-remove "text0"
-rmrfdir "9/99/"
-rmdir "9/99/"
-rmrfdir "9/98/"
-rmrfdir "9/97/"
-rmrfdir "9/96/"
-rmrfdir "9/95/"
-rmrfdir "9/95/"
-rmrfdir "9/94/"
-rmdir "9/94/"
-rmdir "9/93/"
-rmdir "9/92/"
-rmdir "9/91/"
-rmdir "9/90/"
-rmdir "9/90/"
-rmrfdir "8/89/"
-rmdir "8/89/"
-rmrfdir "8/88/"
-rmrfdir "8/87/"
-rmrfdir "8/86/"
-rmrfdir "8/85/"
-rmrfdir "8/85/"
-rmrfdir "8/84/"
-rmdir "8/84/"
-rmdir "8/83/"
-rmdir "8/82/"
-rmdir "8/81/"
-rmdir "8/80/"
-rmdir "8/80/"
-rmrfdir "7/"
-rmdir "6/"
-remove "5/5text1"
-remove "5/5text0"
-rmrfdir "5/"
-remove "4/exe0.exe"
-remove "4/4text1"
-remove "4/4text0"
-rmdir "4/"
-remove "3/3text1"
-remove "3/3text0"
diff --git a/toolkit/mozapps/update/tests/data/old_version.mar b/toolkit/mozapps/update/tests/data/old_version.mar
deleted file mode 100644
index 31550698a..000000000
--- a/toolkit/mozapps/update/tests/data/old_version.mar
+++ /dev/null
Binary files differ
diff --git a/toolkit/mozapps/update/tests/data/partial.exe b/toolkit/mozapps/update/tests/data/partial.exe
deleted file mode 100644
index 3949fd2a0..000000000
--- a/toolkit/mozapps/update/tests/data/partial.exe
+++ /dev/null
Binary files differ
diff --git a/toolkit/mozapps/update/tests/data/partial.mar b/toolkit/mozapps/update/tests/data/partial.mar
deleted file mode 100644
index 789d3d98d..000000000
--- a/toolkit/mozapps/update/tests/data/partial.mar
+++ /dev/null
Binary files differ
diff --git a/toolkit/mozapps/update/tests/data/partial.png b/toolkit/mozapps/update/tests/data/partial.png
deleted file mode 100644
index 9246f586c..000000000
--- a/toolkit/mozapps/update/tests/data/partial.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/mozapps/update/tests/data/partial_log_failure_mac b/toolkit/mozapps/update/tests/data/partial_log_failure_mac
deleted file mode 100644
index 3b2933ebd..000000000
--- a/toolkit/mozapps/update/tests/data/partial_log_failure_mac
+++ /dev/null
@@ -1,192 +0,0 @@
-UPDATE TYPE partial
-PREPARE ADD Contents/Resources/searchplugins/searchpluginstext0
-PREPARE PATCH Contents/Resources/searchplugins/searchpluginspng1.png
-PREPARE PATCH Contents/Resources/searchplugins/searchpluginspng0.png
-PREPARE ADD Contents/Resources/precomplete
-PREPARE ADD Contents/Resources/distribution/extensions/extensions1/extensions1text0
-PREPARE PATCH Contents/Resources/distribution/extensions/extensions1/extensions1png1.png
-PREPARE PATCH Contents/Resources/distribution/extensions/extensions1/extensions1png0.png
-PREPARE ADD Contents/Resources/distribution/extensions/extensions0/extensions0text0
-PREPARE PATCH Contents/Resources/distribution/extensions/extensions0/extensions0png1.png
-PREPARE PATCH Contents/Resources/distribution/extensions/extensions0/extensions0png0.png
-PREPARE PATCH Contents/Resources/0/0exe0.exe
-PREPARE ADD Contents/Resources/0/00/00text0
-PREPARE PATCH Contents/Resources/0/00/00png0.png
-PREPARE PATCH Contents/MacOS/exe0.exe
-PREPARE ADD Contents/Resources/2/20/20text0
-PREPARE ADD Contents/Resources/2/20/20png0.png
-PREPARE ADD Contents/Resources/0/00/00text2
-PREPARE REMOVEFILE Contents/Resources/1/10/10text0
-PREPARE REMOVEFILE Contents/Resources/0/00/00text1
-PREPARE REMOVEDIR Contents/Resources/9/99/
-PREPARE REMOVEDIR Contents/Resources/9/99/
-PREPARE REMOVEDIR Contents/Resources/9/98/
-PREPARE REMOVEFILE Contents/Resources/9/97/970/97xtext0
-PREPARE REMOVEFILE Contents/Resources/9/97/970/97xtext1
-PREPARE REMOVEDIR Contents/Resources/9/97/970/
-PREPARE REMOVEFILE Contents/Resources/9/97/971/97xtext0
-PREPARE REMOVEFILE Contents/Resources/9/97/971/97xtext1
-PREPARE REMOVEDIR Contents/Resources/9/97/971/
-PREPARE REMOVEDIR Contents/Resources/9/97/
-PREPARE REMOVEFILE Contents/Resources/9/96/96text0
-PREPARE REMOVEFILE Contents/Resources/9/96/96text1
-PREPARE REMOVEDIR Contents/Resources/9/96/
-PREPARE REMOVEDIR Contents/Resources/9/95/
-PREPARE REMOVEDIR Contents/Resources/9/95/
-PREPARE REMOVEDIR Contents/Resources/9/94/
-PREPARE REMOVEDIR Contents/Resources/9/94/
-PREPARE REMOVEDIR Contents/Resources/9/93/
-PREPARE REMOVEDIR Contents/Resources/9/92/
-PREPARE REMOVEDIR Contents/Resources/9/91/
-PREPARE REMOVEDIR Contents/Resources/9/90/
-PREPARE REMOVEDIR Contents/Resources/9/90/
-PREPARE REMOVEDIR Contents/Resources/8/89/
-PREPARE REMOVEDIR Contents/Resources/8/89/
-PREPARE REMOVEDIR Contents/Resources/8/88/
-PREPARE REMOVEFILE Contents/Resources/8/87/870/87xtext0
-PREPARE REMOVEFILE Contents/Resources/8/87/870/87xtext1
-PREPARE REMOVEDIR Contents/Resources/8/87/870/
-PREPARE REMOVEFILE Contents/Resources/8/87/871/87xtext0
-PREPARE REMOVEFILE Contents/Resources/8/87/871/87xtext1
-PREPARE REMOVEDIR Contents/Resources/8/87/871/
-PREPARE REMOVEDIR Contents/Resources/8/87/
-PREPARE REMOVEFILE Contents/Resources/8/86/86text0
-PREPARE REMOVEFILE Contents/Resources/8/86/86text1
-PREPARE REMOVEDIR Contents/Resources/8/86/
-PREPARE REMOVEDIR Contents/Resources/8/85/
-PREPARE REMOVEDIR Contents/Resources/8/85/
-PREPARE REMOVEDIR Contents/Resources/8/84/
-PREPARE REMOVEDIR Contents/Resources/8/84/
-PREPARE REMOVEDIR Contents/Resources/8/83/
-PREPARE REMOVEDIR Contents/Resources/8/82/
-PREPARE REMOVEDIR Contents/Resources/8/81/
-PREPARE REMOVEDIR Contents/Resources/8/80/
-PREPARE REMOVEDIR Contents/Resources/8/80/
-PREPARE REMOVEFILE Contents/Resources/7/70/7xtest.exe
-PREPARE REMOVEFILE Contents/Resources/7/70/7xtext0
-PREPARE REMOVEFILE Contents/Resources/7/70/7xtext1
-PREPARE REMOVEDIR Contents/Resources/7/70/
-PREPARE REMOVEFILE Contents/Resources/7/71/7xtest.exe
-PREPARE REMOVEFILE Contents/Resources/7/71/7xtext0
-PREPARE REMOVEFILE Contents/Resources/7/71/7xtext1
-PREPARE REMOVEDIR Contents/Resources/7/71/
-PREPARE REMOVEFILE Contents/Resources/7/7text0
-PREPARE REMOVEFILE Contents/Resources/7/7text1
-PREPARE REMOVEDIR Contents/Resources/7/
-PREPARE REMOVEDIR Contents/Resources/6/
-PREPARE REMOVEFILE Contents/Resources/5/5text1
-PREPARE REMOVEFILE Contents/Resources/5/5text0
-PREPARE REMOVEFILE Contents/Resources/5/5test.exe
-PREPARE REMOVEFILE Contents/Resources/5/5text0
-PREPARE REMOVEFILE Contents/Resources/5/5text1
-PREPARE REMOVEDIR Contents/Resources/5/
-PREPARE REMOVEFILE Contents/Resources/4/4text1
-PREPARE REMOVEFILE Contents/Resources/4/4text0
-PREPARE REMOVEDIR Contents/Resources/4/
-PREPARE REMOVEFILE Contents/Resources/3/3text1
-PREPARE REMOVEFILE Contents/Resources/3/3text0
-PREPARE REMOVEDIR Contents/Resources/1/10/
-PREPARE REMOVEDIR Contents/Resources/1/
-EXECUTE ADD Contents/Resources/searchplugins/searchpluginstext0
-EXECUTE PATCH Contents/Resources/searchplugins/searchpluginspng1.png
-EXECUTE PATCH Contents/Resources/searchplugins/searchpluginspng0.png
-EXECUTE ADD Contents/Resources/precomplete
-EXECUTE ADD Contents/Resources/distribution/extensions/extensions1/extensions1text0
-EXECUTE PATCH Contents/Resources/distribution/extensions/extensions1/extensions1png1.png
-EXECUTE PATCH Contents/Resources/distribution/extensions/extensions1/extensions1png0.png
-EXECUTE ADD Contents/Resources/distribution/extensions/extensions0/extensions0text0
-EXECUTE PATCH Contents/Resources/distribution/extensions/extensions0/extensions0png1.png
-EXECUTE PATCH Contents/Resources/distribution/extensions/extensions0/extensions0png0.png
-EXECUTE PATCH Contents/Resources/0/0exe0.exe
-LoadSourceFile: destination file size 776 does not match expected size 79872
-LoadSourceFile failed
-### execution failed
-FINISH ADD Contents/Resources/searchplugins/searchpluginstext0
-FINISH PATCH Contents/Resources/searchplugins/searchpluginspng1.png
-FINISH PATCH Contents/Resources/searchplugins/searchpluginspng0.png
-FINISH ADD Contents/Resources/precomplete
-FINISH ADD Contents/Resources/distribution/extensions/extensions1/extensions1text0
-backup_restore: backup file doesn't exist: Contents/Resources/distribution/extensions/extensions1/extensions1text0.moz-backup
-FINISH PATCH Contents/Resources/distribution/extensions/extensions1/extensions1png1.png
-FINISH PATCH Contents/Resources/distribution/extensions/extensions1/extensions1png0.png
-FINISH ADD Contents/Resources/distribution/extensions/extensions0/extensions0text0
-FINISH PATCH Contents/Resources/distribution/extensions/extensions0/extensions0png1.png
-FINISH PATCH Contents/Resources/distribution/extensions/extensions0/extensions0png0.png
-FINISH PATCH Contents/Resources/0/0exe0.exe
-backup_restore: backup file doesn't exist: Contents/Resources/0/0exe0.exe.moz-backup
-FINISH ADD Contents/Resources/0/00/00text0
-backup_restore: backup file doesn't exist: Contents/Resources/0/00/00text0.moz-backup
-FINISH PATCH Contents/Resources/0/00/00png0.png
-backup_restore: backup file doesn't exist: Contents/Resources/0/00/00png0.png.moz-backup
-FINISH PATCH Contents/MacOS/exe0.exe
-backup_restore: backup file doesn't exist: Contents/MacOS/exe0.exe.moz-backup
-FINISH ADD Contents/Resources/2/20/20text0
-backup_restore: backup file doesn't exist: Contents/Resources/2/20/20text0.moz-backup
-FINISH ADD Contents/Resources/2/20/20png0.png
-backup_restore: backup file doesn't exist: Contents/Resources/2/20/20png0.png.moz-backup
-FINISH ADD Contents/Resources/0/00/00text2
-backup_restore: backup file doesn't exist: Contents/Resources/0/00/00text2.moz-backup
-FINISH REMOVEFILE Contents/Resources/1/10/10text0
-backup_restore: backup file doesn't exist: Contents/Resources/1/10/10text0.moz-backup
-FINISH REMOVEFILE Contents/Resources/0/00/00text1
-backup_restore: backup file doesn't exist: Contents/Resources/0/00/00text1.moz-backup
-FINISH REMOVEFILE Contents/Resources/9/97/970/97xtext0
-backup_restore: backup file doesn't exist: Contents/Resources/9/97/970/97xtext0.moz-backup
-FINISH REMOVEFILE Contents/Resources/9/97/970/97xtext1
-backup_restore: backup file doesn't exist: Contents/Resources/9/97/970/97xtext1.moz-backup
-FINISH REMOVEFILE Contents/Resources/9/97/971/97xtext0
-backup_restore: backup file doesn't exist: Contents/Resources/9/97/971/97xtext0.moz-backup
-FINISH REMOVEFILE Contents/Resources/9/97/971/97xtext1
-backup_restore: backup file doesn't exist: Contents/Resources/9/97/971/97xtext1.moz-backup
-FINISH REMOVEFILE Contents/Resources/9/96/96text0
-backup_restore: backup file doesn't exist: Contents/Resources/9/96/96text0.moz-backup
-FINISH REMOVEFILE Contents/Resources/9/96/96text1
-backup_restore: backup file doesn't exist: Contents/Resources/9/96/96text1.moz-backup
-FINISH REMOVEFILE Contents/Resources/8/87/870/87xtext0
-backup_restore: backup file doesn't exist: Contents/Resources/8/87/870/87xtext0.moz-backup
-FINISH REMOVEFILE Contents/Resources/8/87/870/87xtext1
-backup_restore: backup file doesn't exist: Contents/Resources/8/87/870/87xtext1.moz-backup
-FINISH REMOVEFILE Contents/Resources/8/87/871/87xtext0
-backup_restore: backup file doesn't exist: Contents/Resources/8/87/871/87xtext0.moz-backup
-FINISH REMOVEFILE Contents/Resources/8/87/871/87xtext1
-backup_restore: backup file doesn't exist: Contents/Resources/8/87/871/87xtext1.moz-backup
-FINISH REMOVEFILE Contents/Resources/8/86/86text0
-backup_restore: backup file doesn't exist: Contents/Resources/8/86/86text0.moz-backup
-FINISH REMOVEFILE Contents/Resources/8/86/86text1
-backup_restore: backup file doesn't exist: Contents/Resources/8/86/86text1.moz-backup
-FINISH REMOVEFILE Contents/Resources/7/70/7xtest.exe
-backup_restore: backup file doesn't exist: Contents/Resources/7/70/7xtest.exe.moz-backup
-FINISH REMOVEFILE Contents/Resources/7/70/7xtext0
-backup_restore: backup file doesn't exist: Contents/Resources/7/70/7xtext0.moz-backup
-FINISH REMOVEFILE Contents/Resources/7/70/7xtext1
-backup_restore: backup file doesn't exist: Contents/Resources/7/70/7xtext1.moz-backup
-FINISH REMOVEFILE Contents/Resources/7/71/7xtest.exe
-backup_restore: backup file doesn't exist: Contents/Resources/7/71/7xtest.exe.moz-backup
-FINISH REMOVEFILE Contents/Resources/7/71/7xtext0
-backup_restore: backup file doesn't exist: Contents/Resources/7/71/7xtext0.moz-backup
-FINISH REMOVEFILE Contents/Resources/7/71/7xtext1
-backup_restore: backup file doesn't exist: Contents/Resources/7/71/7xtext1.moz-backup
-FINISH REMOVEFILE Contents/Resources/7/7text0
-backup_restore: backup file doesn't exist: Contents/Resources/7/7text0.moz-backup
-FINISH REMOVEFILE Contents/Resources/7/7text1
-backup_restore: backup file doesn't exist: Contents/Resources/7/7text1.moz-backup
-FINISH REMOVEFILE Contents/Resources/5/5text1
-backup_restore: backup file doesn't exist: Contents/Resources/5/5text1.moz-backup
-FINISH REMOVEFILE Contents/Resources/5/5text0
-backup_restore: backup file doesn't exist: Contents/Resources/5/5text0.moz-backup
-FINISH REMOVEFILE Contents/Resources/5/5test.exe
-backup_restore: backup file doesn't exist: Contents/Resources/5/5test.exe.moz-backup
-FINISH REMOVEFILE Contents/Resources/5/5text0
-backup_restore: backup file doesn't exist: Contents/Resources/5/5text0.moz-backup
-FINISH REMOVEFILE Contents/Resources/5/5text1
-backup_restore: backup file doesn't exist: Contents/Resources/5/5text1.moz-backup
-FINISH REMOVEFILE Contents/Resources/4/4text1
-backup_restore: backup file doesn't exist: Contents/Resources/4/4text1.moz-backup
-FINISH REMOVEFILE Contents/Resources/4/4text0
-backup_restore: backup file doesn't exist: Contents/Resources/4/4text0.moz-backup
-FINISH REMOVEFILE Contents/Resources/3/3text1
-backup_restore: backup file doesn't exist: Contents/Resources/3/3text1.moz-backup
-FINISH REMOVEFILE Contents/Resources/3/3text0
-backup_restore: backup file doesn't exist: Contents/Resources/3/3text0.moz-backup
-failed: 2
-calling QuitProgressUI
diff --git a/toolkit/mozapps/update/tests/data/partial_log_failure_win b/toolkit/mozapps/update/tests/data/partial_log_failure_win
deleted file mode 100644
index e3d683dc1..000000000
--- a/toolkit/mozapps/update/tests/data/partial_log_failure_win
+++ /dev/null
@@ -1,192 +0,0 @@
-UPDATE TYPE partial
-PREPARE ADD searchplugins/searchpluginstext0
-PREPARE PATCH searchplugins/searchpluginspng1.png
-PREPARE PATCH searchplugins/searchpluginspng0.png
-PREPARE ADD precomplete
-PREPARE PATCH exe0.exe
-PREPARE ADD distribution/extensions/extensions1/extensions1text0
-PREPARE PATCH distribution/extensions/extensions1/extensions1png1.png
-PREPARE PATCH distribution/extensions/extensions1/extensions1png0.png
-PREPARE ADD distribution/extensions/extensions0/extensions0text0
-PREPARE PATCH distribution/extensions/extensions0/extensions0png1.png
-PREPARE PATCH distribution/extensions/extensions0/extensions0png0.png
-PREPARE PATCH 0/0exe0.exe
-PREPARE ADD 0/00/00text0
-PREPARE PATCH 0/00/00png0.png
-PREPARE ADD 2/20/20text0
-PREPARE ADD 2/20/20png0.png
-PREPARE ADD 0/00/00text2
-PREPARE REMOVEFILE 1/10/10text0
-PREPARE REMOVEFILE 0/00/00text1
-PREPARE REMOVEDIR 9/99/
-PREPARE REMOVEDIR 9/99/
-PREPARE REMOVEDIR 9/98/
-PREPARE REMOVEFILE 9/97/970/97xtext0
-PREPARE REMOVEFILE 9/97/970/97xtext1
-PREPARE REMOVEDIR 9/97/970/
-PREPARE REMOVEFILE 9/97/971/97xtext0
-PREPARE REMOVEFILE 9/97/971/97xtext1
-PREPARE REMOVEDIR 9/97/971/
-PREPARE REMOVEDIR 9/97/
-PREPARE REMOVEFILE 9/96/96text0
-PREPARE REMOVEFILE 9/96/96text1
-PREPARE REMOVEDIR 9/96/
-PREPARE REMOVEDIR 9/95/
-PREPARE REMOVEDIR 9/95/
-PREPARE REMOVEDIR 9/94/
-PREPARE REMOVEDIR 9/94/
-PREPARE REMOVEDIR 9/93/
-PREPARE REMOVEDIR 9/92/
-PREPARE REMOVEDIR 9/91/
-PREPARE REMOVEDIR 9/90/
-PREPARE REMOVEDIR 9/90/
-PREPARE REMOVEDIR 8/89/
-PREPARE REMOVEDIR 8/89/
-PREPARE REMOVEDIR 8/88/
-PREPARE REMOVEFILE 8/87/870/87xtext0
-PREPARE REMOVEFILE 8/87/870/87xtext1
-PREPARE REMOVEDIR 8/87/870/
-PREPARE REMOVEFILE 8/87/871/87xtext0
-PREPARE REMOVEFILE 8/87/871/87xtext1
-PREPARE REMOVEDIR 8/87/871/
-PREPARE REMOVEDIR 8/87/
-PREPARE REMOVEFILE 8/86/86text0
-PREPARE REMOVEFILE 8/86/86text1
-PREPARE REMOVEDIR 8/86/
-PREPARE REMOVEDIR 8/85/
-PREPARE REMOVEDIR 8/85/
-PREPARE REMOVEDIR 8/84/
-PREPARE REMOVEDIR 8/84/
-PREPARE REMOVEDIR 8/83/
-PREPARE REMOVEDIR 8/82/
-PREPARE REMOVEDIR 8/81/
-PREPARE REMOVEDIR 8/80/
-PREPARE REMOVEDIR 8/80/
-PREPARE REMOVEFILE 7/70/7xtest.exe
-PREPARE REMOVEFILE 7/70/7xtext0
-PREPARE REMOVEFILE 7/70/7xtext1
-PREPARE REMOVEDIR 7/70/
-PREPARE REMOVEFILE 7/71/7xtest.exe
-PREPARE REMOVEFILE 7/71/7xtext0
-PREPARE REMOVEFILE 7/71/7xtext1
-PREPARE REMOVEDIR 7/71/
-PREPARE REMOVEFILE 7/7text0
-PREPARE REMOVEFILE 7/7text1
-PREPARE REMOVEDIR 7/
-PREPARE REMOVEDIR 6/
-PREPARE REMOVEFILE 5/5text1
-PREPARE REMOVEFILE 5/5text0
-PREPARE REMOVEFILE 5/5test.exe
-PREPARE REMOVEFILE 5/5text0
-PREPARE REMOVEFILE 5/5text1
-PREPARE REMOVEDIR 5/
-PREPARE REMOVEFILE 4/4text1
-PREPARE REMOVEFILE 4/4text0
-PREPARE REMOVEDIR 4/
-PREPARE REMOVEFILE 3/3text1
-PREPARE REMOVEFILE 3/3text0
-PREPARE REMOVEDIR 1/10/
-PREPARE REMOVEDIR 1/
-EXECUTE ADD searchplugins/searchpluginstext0
-EXECUTE PATCH searchplugins/searchpluginspng1.png
-EXECUTE PATCH searchplugins/searchpluginspng0.png
-EXECUTE ADD precomplete
-EXECUTE PATCH exe0.exe
-EXECUTE ADD distribution/extensions/extensions1/extensions1text0
-EXECUTE PATCH distribution/extensions/extensions1/extensions1png1.png
-EXECUTE PATCH distribution/extensions/extensions1/extensions1png0.png
-EXECUTE ADD distribution/extensions/extensions0/extensions0text0
-EXECUTE PATCH distribution/extensions/extensions0/extensions0png1.png
-EXECUTE PATCH distribution/extensions/extensions0/extensions0png0.png
-EXECUTE PATCH 0/0exe0.exe
-LoadSourceFile: destination file size 776 does not match expected size 79872
-LoadSourceFile failed
-### execution failed
-FINISH ADD searchplugins/searchpluginstext0
-FINISH PATCH searchplugins/searchpluginspng1.png
-FINISH PATCH searchplugins/searchpluginspng0.png
-FINISH ADD precomplete
-FINISH PATCH exe0.exe
-FINISH ADD distribution/extensions/extensions1/extensions1text0
-backup_restore: backup file doesn't exist: distribution/extensions/extensions1/extensions1text0.moz-backup
-FINISH PATCH distribution/extensions/extensions1/extensions1png1.png
-FINISH PATCH distribution/extensions/extensions1/extensions1png0.png
-FINISH ADD distribution/extensions/extensions0/extensions0text0
-FINISH PATCH distribution/extensions/extensions0/extensions0png1.png
-FINISH PATCH distribution/extensions/extensions0/extensions0png0.png
-FINISH PATCH 0/0exe0.exe
-backup_restore: backup file doesn't exist: 0/0exe0.exe.moz-backup
-FINISH ADD 0/00/00text0
-backup_restore: backup file doesn't exist: 0/00/00text0.moz-backup
-FINISH PATCH 0/00/00png0.png
-backup_restore: backup file doesn't exist: 0/00/00png0.png.moz-backup
-FINISH ADD 2/20/20text0
-backup_restore: backup file doesn't exist: 2/20/20text0.moz-backup
-FINISH ADD 2/20/20png0.png
-backup_restore: backup file doesn't exist: 2/20/20png0.png.moz-backup
-FINISH ADD 0/00/00text2
-backup_restore: backup file doesn't exist: 0/00/00text2.moz-backup
-FINISH REMOVEFILE 1/10/10text0
-backup_restore: backup file doesn't exist: 1/10/10text0.moz-backup
-FINISH REMOVEFILE 0/00/00text1
-backup_restore: backup file doesn't exist: 0/00/00text1.moz-backup
-FINISH REMOVEFILE 9/97/970/97xtext0
-backup_restore: backup file doesn't exist: 9/97/970/97xtext0.moz-backup
-FINISH REMOVEFILE 9/97/970/97xtext1
-backup_restore: backup file doesn't exist: 9/97/970/97xtext1.moz-backup
-FINISH REMOVEFILE 9/97/971/97xtext0
-backup_restore: backup file doesn't exist: 9/97/971/97xtext0.moz-backup
-FINISH REMOVEFILE 9/97/971/97xtext1
-backup_restore: backup file doesn't exist: 9/97/971/97xtext1.moz-backup
-FINISH REMOVEFILE 9/96/96text0
-backup_restore: backup file doesn't exist: 9/96/96text0.moz-backup
-FINISH REMOVEFILE 9/96/96text1
-backup_restore: backup file doesn't exist: 9/96/96text1.moz-backup
-FINISH REMOVEFILE 8/87/870/87xtext0
-backup_restore: backup file doesn't exist: 8/87/870/87xtext0.moz-backup
-FINISH REMOVEFILE 8/87/870/87xtext1
-backup_restore: backup file doesn't exist: 8/87/870/87xtext1.moz-backup
-FINISH REMOVEFILE 8/87/871/87xtext0
-backup_restore: backup file doesn't exist: 8/87/871/87xtext0.moz-backup
-FINISH REMOVEFILE 8/87/871/87xtext1
-backup_restore: backup file doesn't exist: 8/87/871/87xtext1.moz-backup
-FINISH REMOVEFILE 8/86/86text0
-backup_restore: backup file doesn't exist: 8/86/86text0.moz-backup
-FINISH REMOVEFILE 8/86/86text1
-backup_restore: backup file doesn't exist: 8/86/86text1.moz-backup
-FINISH REMOVEFILE 7/70/7xtest.exe
-backup_restore: backup file doesn't exist: 7/70/7xtest.exe.moz-backup
-FINISH REMOVEFILE 7/70/7xtext0
-backup_restore: backup file doesn't exist: 7/70/7xtext0.moz-backup
-FINISH REMOVEFILE 7/70/7xtext1
-backup_restore: backup file doesn't exist: 7/70/7xtext1.moz-backup
-FINISH REMOVEFILE 7/71/7xtest.exe
-backup_restore: backup file doesn't exist: 7/71/7xtest.exe.moz-backup
-FINISH REMOVEFILE 7/71/7xtext0
-backup_restore: backup file doesn't exist: 7/71/7xtext0.moz-backup
-FINISH REMOVEFILE 7/71/7xtext1
-backup_restore: backup file doesn't exist: 7/71/7xtext1.moz-backup
-FINISH REMOVEFILE 7/7text0
-backup_restore: backup file doesn't exist: 7/7text0.moz-backup
-FINISH REMOVEFILE 7/7text1
-backup_restore: backup file doesn't exist: 7/7text1.moz-backup
-FINISH REMOVEFILE 5/5text1
-backup_restore: backup file doesn't exist: 5/5text1.moz-backup
-FINISH REMOVEFILE 5/5text0
-backup_restore: backup file doesn't exist: 5/5text0.moz-backup
-FINISH REMOVEFILE 5/5test.exe
-backup_restore: backup file doesn't exist: 5/5test.exe.moz-backup
-FINISH REMOVEFILE 5/5text0
-backup_restore: backup file doesn't exist: 5/5text0.moz-backup
-FINISH REMOVEFILE 5/5text1
-backup_restore: backup file doesn't exist: 5/5text1.moz-backup
-FINISH REMOVEFILE 4/4text1
-backup_restore: backup file doesn't exist: 4/4text1.moz-backup
-FINISH REMOVEFILE 4/4text0
-backup_restore: backup file doesn't exist: 4/4text0.moz-backup
-FINISH REMOVEFILE 3/3text1
-backup_restore: backup file doesn't exist: 3/3text1.moz-backup
-FINISH REMOVEFILE 3/3text0
-backup_restore: backup file doesn't exist: 3/3text0.moz-backup
-failed: 2
-calling QuitProgressUI
diff --git a/toolkit/mozapps/update/tests/data/partial_log_success_mac b/toolkit/mozapps/update/tests/data/partial_log_success_mac
deleted file mode 100644
index fb5272ad2..000000000
--- a/toolkit/mozapps/update/tests/data/partial_log_success_mac
+++ /dev/null
@@ -1,279 +0,0 @@
-UPDATE TYPE partial
-PREPARE ADD Contents/Resources/searchplugins/searchpluginstext0
-PREPARE PATCH Contents/Resources/searchplugins/searchpluginspng1.png
-PREPARE PATCH Contents/Resources/searchplugins/searchpluginspng0.png
-PREPARE ADD Contents/Resources/precomplete
-PREPARE ADD Contents/Resources/distribution/extensions/extensions1/extensions1text0
-PREPARE PATCH Contents/Resources/distribution/extensions/extensions1/extensions1png1.png
-PREPARE PATCH Contents/Resources/distribution/extensions/extensions1/extensions1png0.png
-PREPARE ADD Contents/Resources/distribution/extensions/extensions0/extensions0text0
-PREPARE PATCH Contents/Resources/distribution/extensions/extensions0/extensions0png1.png
-PREPARE PATCH Contents/Resources/distribution/extensions/extensions0/extensions0png0.png
-PREPARE PATCH Contents/Resources/0/0exe0.exe
-PREPARE ADD Contents/Resources/0/00/00text0
-PREPARE PATCH Contents/Resources/0/00/00png0.png
-PREPARE PATCH Contents/MacOS/exe0.exe
-PREPARE ADD Contents/Resources/2/20/20text0
-PREPARE ADD Contents/Resources/2/20/20png0.png
-PREPARE ADD Contents/Resources/0/00/00text2
-PREPARE REMOVEFILE Contents/Resources/1/10/10text0
-PREPARE REMOVEFILE Contents/Resources/0/00/00text1
-PREPARE REMOVEDIR Contents/Resources/9/99/
-PREPARE REMOVEDIR Contents/Resources/9/99/
-PREPARE REMOVEDIR Contents/Resources/9/98/
-PREPARE REMOVEFILE Contents/Resources/9/97/970/97xtext0
-PREPARE REMOVEFILE Contents/Resources/9/97/970/97xtext1
-PREPARE REMOVEDIR Contents/Resources/9/97/970/
-PREPARE REMOVEFILE Contents/Resources/9/97/971/97xtext0
-PREPARE REMOVEFILE Contents/Resources/9/97/971/97xtext1
-PREPARE REMOVEDIR Contents/Resources/9/97/971/
-PREPARE REMOVEDIR Contents/Resources/9/97/
-PREPARE REMOVEFILE Contents/Resources/9/96/96text0
-PREPARE REMOVEFILE Contents/Resources/9/96/96text1
-PREPARE REMOVEDIR Contents/Resources/9/96/
-PREPARE REMOVEDIR Contents/Resources/9/95/
-PREPARE REMOVEDIR Contents/Resources/9/95/
-PREPARE REMOVEDIR Contents/Resources/9/94/
-PREPARE REMOVEDIR Contents/Resources/9/94/
-PREPARE REMOVEDIR Contents/Resources/9/93/
-PREPARE REMOVEDIR Contents/Resources/9/92/
-PREPARE REMOVEDIR Contents/Resources/9/91/
-PREPARE REMOVEDIR Contents/Resources/9/90/
-PREPARE REMOVEDIR Contents/Resources/9/90/
-PREPARE REMOVEDIR Contents/Resources/8/89/
-PREPARE REMOVEDIR Contents/Resources/8/89/
-PREPARE REMOVEDIR Contents/Resources/8/88/
-PREPARE REMOVEFILE Contents/Resources/8/87/870/87xtext0
-PREPARE REMOVEFILE Contents/Resources/8/87/870/87xtext1
-PREPARE REMOVEDIR Contents/Resources/8/87/870/
-PREPARE REMOVEFILE Contents/Resources/8/87/871/87xtext0
-PREPARE REMOVEFILE Contents/Resources/8/87/871/87xtext1
-PREPARE REMOVEDIR Contents/Resources/8/87/871/
-PREPARE REMOVEDIR Contents/Resources/8/87/
-PREPARE REMOVEFILE Contents/Resources/8/86/86text0
-PREPARE REMOVEFILE Contents/Resources/8/86/86text1
-PREPARE REMOVEDIR Contents/Resources/8/86/
-PREPARE REMOVEDIR Contents/Resources/8/85/
-PREPARE REMOVEDIR Contents/Resources/8/85/
-PREPARE REMOVEDIR Contents/Resources/8/84/
-PREPARE REMOVEDIR Contents/Resources/8/84/
-PREPARE REMOVEDIR Contents/Resources/8/83/
-PREPARE REMOVEDIR Contents/Resources/8/82/
-PREPARE REMOVEDIR Contents/Resources/8/81/
-PREPARE REMOVEDIR Contents/Resources/8/80/
-PREPARE REMOVEDIR Contents/Resources/8/80/
-PREPARE REMOVEFILE Contents/Resources/7/70/7xtest.exe
-PREPARE REMOVEFILE Contents/Resources/7/70/7xtext0
-PREPARE REMOVEFILE Contents/Resources/7/70/7xtext1
-PREPARE REMOVEDIR Contents/Resources/7/70/
-PREPARE REMOVEFILE Contents/Resources/7/71/7xtest.exe
-PREPARE REMOVEFILE Contents/Resources/7/71/7xtext0
-PREPARE REMOVEFILE Contents/Resources/7/71/7xtext1
-PREPARE REMOVEDIR Contents/Resources/7/71/
-PREPARE REMOVEFILE Contents/Resources/7/7text0
-PREPARE REMOVEFILE Contents/Resources/7/7text1
-PREPARE REMOVEDIR Contents/Resources/7/
-PREPARE REMOVEDIR Contents/Resources/6/
-PREPARE REMOVEFILE Contents/Resources/5/5text1
-PREPARE REMOVEFILE Contents/Resources/5/5text0
-PREPARE REMOVEFILE Contents/Resources/5/5test.exe
-PREPARE REMOVEFILE Contents/Resources/5/5text0
-PREPARE REMOVEFILE Contents/Resources/5/5text1
-PREPARE REMOVEDIR Contents/Resources/5/
-PREPARE REMOVEFILE Contents/Resources/4/4text1
-PREPARE REMOVEFILE Contents/Resources/4/4text0
-PREPARE REMOVEDIR Contents/Resources/4/
-PREPARE REMOVEFILE Contents/Resources/3/3text1
-PREPARE REMOVEFILE Contents/Resources/3/3text0
-PREPARE REMOVEDIR Contents/Resources/1/10/
-PREPARE REMOVEDIR Contents/Resources/1/
-EXECUTE ADD Contents/Resources/searchplugins/searchpluginstext0
-EXECUTE PATCH Contents/Resources/searchplugins/searchpluginspng1.png
-EXECUTE PATCH Contents/Resources/searchplugins/searchpluginspng0.png
-EXECUTE ADD Contents/Resources/precomplete
-EXECUTE ADD Contents/Resources/distribution/extensions/extensions1/extensions1text0
-EXECUTE PATCH Contents/Resources/distribution/extensions/extensions1/extensions1png1.png
-EXECUTE PATCH Contents/Resources/distribution/extensions/extensions1/extensions1png0.png
-EXECUTE ADD Contents/Resources/distribution/extensions/extensions0/extensions0text0
-EXECUTE PATCH Contents/Resources/distribution/extensions/extensions0/extensions0png1.png
-EXECUTE PATCH Contents/Resources/distribution/extensions/extensions0/extensions0png0.png
-EXECUTE PATCH Contents/Resources/0/0exe0.exe
-EXECUTE ADD Contents/Resources/0/00/00text0
-EXECUTE PATCH Contents/Resources/0/00/00png0.png
-EXECUTE PATCH Contents/MacOS/exe0.exe
-EXECUTE ADD Contents/Resources/2/20/20text0
-EXECUTE ADD Contents/Resources/2/20/20png0.png
-EXECUTE ADD Contents/Resources/0/00/00text2
-EXECUTE REMOVEFILE Contents/Resources/1/10/10text0
-EXECUTE REMOVEFILE Contents/Resources/0/00/00text1
-EXECUTE REMOVEDIR Contents/Resources/9/99/
-EXECUTE REMOVEDIR Contents/Resources/9/99/
-EXECUTE REMOVEDIR Contents/Resources/9/98/
-EXECUTE REMOVEFILE Contents/Resources/9/97/970/97xtext0
-EXECUTE REMOVEFILE Contents/Resources/9/97/970/97xtext1
-EXECUTE REMOVEDIR Contents/Resources/9/97/970/
-EXECUTE REMOVEFILE Contents/Resources/9/97/971/97xtext0
-EXECUTE REMOVEFILE Contents/Resources/9/97/971/97xtext1
-EXECUTE REMOVEDIR Contents/Resources/9/97/971/
-EXECUTE REMOVEDIR Contents/Resources/9/97/
-EXECUTE REMOVEFILE Contents/Resources/9/96/96text0
-EXECUTE REMOVEFILE Contents/Resources/9/96/96text1
-EXECUTE REMOVEDIR Contents/Resources/9/96/
-EXECUTE REMOVEDIR Contents/Resources/9/95/
-EXECUTE REMOVEDIR Contents/Resources/9/95/
-EXECUTE REMOVEDIR Contents/Resources/9/94/
-EXECUTE REMOVEDIR Contents/Resources/9/94/
-EXECUTE REMOVEDIR Contents/Resources/9/93/
-EXECUTE REMOVEDIR Contents/Resources/9/92/
-EXECUTE REMOVEDIR Contents/Resources/9/91/
-EXECUTE REMOVEDIR Contents/Resources/9/90/
-EXECUTE REMOVEDIR Contents/Resources/9/90/
-EXECUTE REMOVEDIR Contents/Resources/8/89/
-EXECUTE REMOVEDIR Contents/Resources/8/89/
-EXECUTE REMOVEDIR Contents/Resources/8/88/
-EXECUTE REMOVEFILE Contents/Resources/8/87/870/87xtext0
-EXECUTE REMOVEFILE Contents/Resources/8/87/870/87xtext1
-EXECUTE REMOVEDIR Contents/Resources/8/87/870/
-EXECUTE REMOVEFILE Contents/Resources/8/87/871/87xtext0
-EXECUTE REMOVEFILE Contents/Resources/8/87/871/87xtext1
-EXECUTE REMOVEDIR Contents/Resources/8/87/871/
-EXECUTE REMOVEDIR Contents/Resources/8/87/
-EXECUTE REMOVEFILE Contents/Resources/8/86/86text0
-EXECUTE REMOVEFILE Contents/Resources/8/86/86text1
-EXECUTE REMOVEDIR Contents/Resources/8/86/
-EXECUTE REMOVEDIR Contents/Resources/8/85/
-EXECUTE REMOVEDIR Contents/Resources/8/85/
-EXECUTE REMOVEDIR Contents/Resources/8/84/
-EXECUTE REMOVEDIR Contents/Resources/8/84/
-EXECUTE REMOVEDIR Contents/Resources/8/83/
-EXECUTE REMOVEDIR Contents/Resources/8/82/
-EXECUTE REMOVEDIR Contents/Resources/8/81/
-EXECUTE REMOVEDIR Contents/Resources/8/80/
-EXECUTE REMOVEDIR Contents/Resources/8/80/
-EXECUTE REMOVEFILE Contents/Resources/7/70/7xtest.exe
-EXECUTE REMOVEFILE Contents/Resources/7/70/7xtext0
-EXECUTE REMOVEFILE Contents/Resources/7/70/7xtext1
-EXECUTE REMOVEDIR Contents/Resources/7/70/
-EXECUTE REMOVEFILE Contents/Resources/7/71/7xtest.exe
-EXECUTE REMOVEFILE Contents/Resources/7/71/7xtext0
-EXECUTE REMOVEFILE Contents/Resources/7/71/7xtext1
-EXECUTE REMOVEDIR Contents/Resources/7/71/
-EXECUTE REMOVEFILE Contents/Resources/7/7text0
-EXECUTE REMOVEFILE Contents/Resources/7/7text1
-EXECUTE REMOVEDIR Contents/Resources/7/
-EXECUTE REMOVEDIR Contents/Resources/6/
-EXECUTE REMOVEFILE Contents/Resources/5/5text1
-EXECUTE REMOVEFILE Contents/Resources/5/5text0
-EXECUTE REMOVEFILE Contents/Resources/5/5test.exe
-EXECUTE REMOVEFILE Contents/Resources/5/5text0
-file cannot be removed because it does not exist; skipping
-EXECUTE REMOVEFILE Contents/Resources/5/5text1
-file cannot be removed because it does not exist; skipping
-EXECUTE REMOVEDIR Contents/Resources/5/
-EXECUTE REMOVEFILE Contents/Resources/4/4text1
-EXECUTE REMOVEFILE Contents/Resources/4/4text0
-EXECUTE REMOVEDIR Contents/Resources/4/
-EXECUTE REMOVEFILE Contents/Resources/3/3text1
-EXECUTE REMOVEFILE Contents/Resources/3/3text0
-EXECUTE REMOVEDIR Contents/Resources/1/10/
-EXECUTE REMOVEDIR Contents/Resources/1/
-FINISH ADD Contents/Resources/searchplugins/searchpluginstext0
-FINISH PATCH Contents/Resources/searchplugins/searchpluginspng1.png
-FINISH PATCH Contents/Resources/searchplugins/searchpluginspng0.png
-FINISH ADD Contents/Resources/precomplete
-FINISH ADD Contents/Resources/distribution/extensions/extensions1/extensions1text0
-FINISH PATCH Contents/Resources/distribution/extensions/extensions1/extensions1png1.png
-FINISH PATCH Contents/Resources/distribution/extensions/extensions1/extensions1png0.png
-FINISH ADD Contents/Resources/distribution/extensions/extensions0/extensions0text0
-FINISH PATCH Contents/Resources/distribution/extensions/extensions0/extensions0png1.png
-FINISH PATCH Contents/Resources/distribution/extensions/extensions0/extensions0png0.png
-FINISH PATCH Contents/Resources/0/0exe0.exe
-FINISH ADD Contents/Resources/0/00/00text0
-FINISH PATCH Contents/Resources/0/00/00png0.png
-FINISH PATCH Contents/MacOS/exe0.exe
-FINISH ADD Contents/Resources/2/20/20text0
-FINISH ADD Contents/Resources/2/20/20png0.png
-FINISH ADD Contents/Resources/0/00/00text2
-FINISH REMOVEFILE Contents/Resources/1/10/10text0
-FINISH REMOVEFILE Contents/Resources/0/00/00text1
-FINISH REMOVEDIR Contents/Resources/9/99/
-FINISH REMOVEDIR Contents/Resources/9/99/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/9/98/
-FINISH REMOVEFILE Contents/Resources/9/97/970/97xtext0
-FINISH REMOVEFILE Contents/Resources/9/97/970/97xtext1
-FINISH REMOVEDIR Contents/Resources/9/97/970/
-FINISH REMOVEFILE Contents/Resources/9/97/971/97xtext0
-FINISH REMOVEFILE Contents/Resources/9/97/971/97xtext1
-FINISH REMOVEDIR Contents/Resources/9/97/971/
-FINISH REMOVEDIR Contents/Resources/9/97/
-FINISH REMOVEFILE Contents/Resources/9/96/96text0
-FINISH REMOVEFILE Contents/Resources/9/96/96text1
-FINISH REMOVEDIR Contents/Resources/9/96/
-FINISH REMOVEDIR Contents/Resources/9/95/
-FINISH REMOVEDIR Contents/Resources/9/95/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/9/94/
-FINISH REMOVEDIR Contents/Resources/9/94/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/9/93/
-FINISH REMOVEDIR Contents/Resources/9/92/
-removing directory: Contents/Resources/9/92/, rv: 0
-FINISH REMOVEDIR Contents/Resources/9/91/
-removing directory: Contents/Resources/9/91/, rv: 0
-FINISH REMOVEDIR Contents/Resources/9/90/
-FINISH REMOVEDIR Contents/Resources/9/90/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/8/89/
-FINISH REMOVEDIR Contents/Resources/8/89/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/8/88/
-FINISH REMOVEFILE Contents/Resources/8/87/870/87xtext0
-FINISH REMOVEFILE Contents/Resources/8/87/870/87xtext1
-FINISH REMOVEDIR Contents/Resources/8/87/870/
-FINISH REMOVEFILE Contents/Resources/8/87/871/87xtext0
-FINISH REMOVEFILE Contents/Resources/8/87/871/87xtext1
-FINISH REMOVEDIR Contents/Resources/8/87/871/
-FINISH REMOVEDIR Contents/Resources/8/87/
-FINISH REMOVEFILE Contents/Resources/8/86/86text0
-FINISH REMOVEFILE Contents/Resources/8/86/86text1
-FINISH REMOVEDIR Contents/Resources/8/86/
-FINISH REMOVEDIR Contents/Resources/8/85/
-FINISH REMOVEDIR Contents/Resources/8/85/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/8/84/
-FINISH REMOVEDIR Contents/Resources/8/84/
-directory no longer exists; skipping
-FINISH REMOVEDIR Contents/Resources/8/83/
-FINISH REMOVEDIR Contents/Resources/8/82/
-removing directory: Contents/Resources/8/82/, rv: 0
-FINISH REMOVEDIR Contents/Resources/8/81/
-removing directory: Contents/Resources/8/81/, rv: 0
-FINISH REMOVEDIR Contents/Resources/8/80/
-FINISH REMOVEDIR Contents/Resources/8/80/
-directory no longer exists; skipping
-FINISH REMOVEFILE Contents/Resources/7/70/7xtest.exe
-FINISH REMOVEFILE Contents/Resources/7/70/7xtext0
-FINISH REMOVEFILE Contents/Resources/7/70/7xtext1
-FINISH REMOVEDIR Contents/Resources/7/70/
-FINISH REMOVEFILE Contents/Resources/7/71/7xtest.exe
-FINISH REMOVEFILE Contents/Resources/7/71/7xtext0
-FINISH REMOVEFILE Contents/Resources/7/71/7xtext1
-FINISH REMOVEDIR Contents/Resources/7/71/
-FINISH REMOVEFILE Contents/Resources/7/7text0
-FINISH REMOVEFILE Contents/Resources/7/7text1
-FINISH REMOVEDIR Contents/Resources/7/
-FINISH REMOVEDIR Contents/Resources/6/
-FINISH REMOVEFILE Contents/Resources/5/5text1
-FINISH REMOVEFILE Contents/Resources/5/5text0
-FINISH REMOVEFILE Contents/Resources/5/5test.exe
-FINISH REMOVEDIR Contents/Resources/5/
-FINISH REMOVEFILE Contents/Resources/4/4text1
-FINISH REMOVEFILE Contents/Resources/4/4text0
-FINISH REMOVEDIR Contents/Resources/4/
-FINISH REMOVEFILE Contents/Resources/3/3text1
-FINISH REMOVEFILE Contents/Resources/3/3text0
-FINISH REMOVEDIR Contents/Resources/1/10/
-FINISH REMOVEDIR Contents/Resources/1/
-succeeded
-calling QuitProgressUI
diff --git a/toolkit/mozapps/update/tests/data/partial_log_success_win b/toolkit/mozapps/update/tests/data/partial_log_success_win
deleted file mode 100644
index 1f5c4b3b4..000000000
--- a/toolkit/mozapps/update/tests/data/partial_log_success_win
+++ /dev/null
@@ -1,279 +0,0 @@
-UPDATE TYPE partial
-PREPARE ADD searchplugins/searchpluginstext0
-PREPARE PATCH searchplugins/searchpluginspng1.png
-PREPARE PATCH searchplugins/searchpluginspng0.png
-PREPARE ADD precomplete
-PREPARE PATCH exe0.exe
-PREPARE ADD distribution/extensions/extensions1/extensions1text0
-PREPARE PATCH distribution/extensions/extensions1/extensions1png1.png
-PREPARE PATCH distribution/extensions/extensions1/extensions1png0.png
-PREPARE ADD distribution/extensions/extensions0/extensions0text0
-PREPARE PATCH distribution/extensions/extensions0/extensions0png1.png
-PREPARE PATCH distribution/extensions/extensions0/extensions0png0.png
-PREPARE PATCH 0/0exe0.exe
-PREPARE ADD 0/00/00text0
-PREPARE PATCH 0/00/00png0.png
-PREPARE ADD 2/20/20text0
-PREPARE ADD 2/20/20png0.png
-PREPARE ADD 0/00/00text2
-PREPARE REMOVEFILE 1/10/10text0
-PREPARE REMOVEFILE 0/00/00text1
-PREPARE REMOVEDIR 9/99/
-PREPARE REMOVEDIR 9/99/
-PREPARE REMOVEDIR 9/98/
-PREPARE REMOVEFILE 9/97/970/97xtext0
-PREPARE REMOVEFILE 9/97/970/97xtext1
-PREPARE REMOVEDIR 9/97/970/
-PREPARE REMOVEFILE 9/97/971/97xtext0
-PREPARE REMOVEFILE 9/97/971/97xtext1
-PREPARE REMOVEDIR 9/97/971/
-PREPARE REMOVEDIR 9/97/
-PREPARE REMOVEFILE 9/96/96text0
-PREPARE REMOVEFILE 9/96/96text1
-PREPARE REMOVEDIR 9/96/
-PREPARE REMOVEDIR 9/95/
-PREPARE REMOVEDIR 9/95/
-PREPARE REMOVEDIR 9/94/
-PREPARE REMOVEDIR 9/94/
-PREPARE REMOVEDIR 9/93/
-PREPARE REMOVEDIR 9/92/
-PREPARE REMOVEDIR 9/91/
-PREPARE REMOVEDIR 9/90/
-PREPARE REMOVEDIR 9/90/
-PREPARE REMOVEDIR 8/89/
-PREPARE REMOVEDIR 8/89/
-PREPARE REMOVEDIR 8/88/
-PREPARE REMOVEFILE 8/87/870/87xtext0
-PREPARE REMOVEFILE 8/87/870/87xtext1
-PREPARE REMOVEDIR 8/87/870/
-PREPARE REMOVEFILE 8/87/871/87xtext0
-PREPARE REMOVEFILE 8/87/871/87xtext1
-PREPARE REMOVEDIR 8/87/871/
-PREPARE REMOVEDIR 8/87/
-PREPARE REMOVEFILE 8/86/86text0
-PREPARE REMOVEFILE 8/86/86text1
-PREPARE REMOVEDIR 8/86/
-PREPARE REMOVEDIR 8/85/
-PREPARE REMOVEDIR 8/85/
-PREPARE REMOVEDIR 8/84/
-PREPARE REMOVEDIR 8/84/
-PREPARE REMOVEDIR 8/83/
-PREPARE REMOVEDIR 8/82/
-PREPARE REMOVEDIR 8/81/
-PREPARE REMOVEDIR 8/80/
-PREPARE REMOVEDIR 8/80/
-PREPARE REMOVEFILE 7/70/7xtest.exe
-PREPARE REMOVEFILE 7/70/7xtext0
-PREPARE REMOVEFILE 7/70/7xtext1
-PREPARE REMOVEDIR 7/70/
-PREPARE REMOVEFILE 7/71/7xtest.exe
-PREPARE REMOVEFILE 7/71/7xtext0
-PREPARE REMOVEFILE 7/71/7xtext1
-PREPARE REMOVEDIR 7/71/
-PREPARE REMOVEFILE 7/7text0
-PREPARE REMOVEFILE 7/7text1
-PREPARE REMOVEDIR 7/
-PREPARE REMOVEDIR 6/
-PREPARE REMOVEFILE 5/5text1
-PREPARE REMOVEFILE 5/5text0
-PREPARE REMOVEFILE 5/5test.exe
-PREPARE REMOVEFILE 5/5text0
-PREPARE REMOVEFILE 5/5text1
-PREPARE REMOVEDIR 5/
-PREPARE REMOVEFILE 4/4text1
-PREPARE REMOVEFILE 4/4text0
-PREPARE REMOVEDIR 4/
-PREPARE REMOVEFILE 3/3text1
-PREPARE REMOVEFILE 3/3text0
-PREPARE REMOVEDIR 1/10/
-PREPARE REMOVEDIR 1/
-EXECUTE ADD searchplugins/searchpluginstext0
-EXECUTE PATCH searchplugins/searchpluginspng1.png
-EXECUTE PATCH searchplugins/searchpluginspng0.png
-EXECUTE ADD precomplete
-EXECUTE PATCH exe0.exe
-EXECUTE ADD distribution/extensions/extensions1/extensions1text0
-EXECUTE PATCH distribution/extensions/extensions1/extensions1png1.png
-EXECUTE PATCH distribution/extensions/extensions1/extensions1png0.png
-EXECUTE ADD distribution/extensions/extensions0/extensions0text0
-EXECUTE PATCH distribution/extensions/extensions0/extensions0png1.png
-EXECUTE PATCH distribution/extensions/extensions0/extensions0png0.png
-EXECUTE PATCH 0/0exe0.exe
-EXECUTE ADD 0/00/00text0
-EXECUTE PATCH 0/00/00png0.png
-EXECUTE ADD 2/20/20text0
-EXECUTE ADD 2/20/20png0.png
-EXECUTE ADD 0/00/00text2
-EXECUTE REMOVEFILE 1/10/10text0
-EXECUTE REMOVEFILE 0/00/00text1
-EXECUTE REMOVEDIR 9/99/
-EXECUTE REMOVEDIR 9/99/
-EXECUTE REMOVEDIR 9/98/
-EXECUTE REMOVEFILE 9/97/970/97xtext0
-EXECUTE REMOVEFILE 9/97/970/97xtext1
-EXECUTE REMOVEDIR 9/97/970/
-EXECUTE REMOVEFILE 9/97/971/97xtext0
-EXECUTE REMOVEFILE 9/97/971/97xtext1
-EXECUTE REMOVEDIR 9/97/971/
-EXECUTE REMOVEDIR 9/97/
-EXECUTE REMOVEFILE 9/96/96text0
-EXECUTE REMOVEFILE 9/96/96text1
-EXECUTE REMOVEDIR 9/96/
-EXECUTE REMOVEDIR 9/95/
-EXECUTE REMOVEDIR 9/95/
-EXECUTE REMOVEDIR 9/94/
-EXECUTE REMOVEDIR 9/94/
-EXECUTE REMOVEDIR 9/93/
-EXECUTE REMOVEDIR 9/92/
-EXECUTE REMOVEDIR 9/91/
-EXECUTE REMOVEDIR 9/90/
-EXECUTE REMOVEDIR 9/90/
-EXECUTE REMOVEDIR 8/89/
-EXECUTE REMOVEDIR 8/89/
-EXECUTE REMOVEDIR 8/88/
-EXECUTE REMOVEFILE 8/87/870/87xtext0
-EXECUTE REMOVEFILE 8/87/870/87xtext1
-EXECUTE REMOVEDIR 8/87/870/
-EXECUTE REMOVEFILE 8/87/871/87xtext0
-EXECUTE REMOVEFILE 8/87/871/87xtext1
-EXECUTE REMOVEDIR 8/87/871/
-EXECUTE REMOVEDIR 8/87/
-EXECUTE REMOVEFILE 8/86/86text0
-EXECUTE REMOVEFILE 8/86/86text1
-EXECUTE REMOVEDIR 8/86/
-EXECUTE REMOVEDIR 8/85/
-EXECUTE REMOVEDIR 8/85/
-EXECUTE REMOVEDIR 8/84/
-EXECUTE REMOVEDIR 8/84/
-EXECUTE REMOVEDIR 8/83/
-EXECUTE REMOVEDIR 8/82/
-EXECUTE REMOVEDIR 8/81/
-EXECUTE REMOVEDIR 8/80/
-EXECUTE REMOVEDIR 8/80/
-EXECUTE REMOVEFILE 7/70/7xtest.exe
-EXECUTE REMOVEFILE 7/70/7xtext0
-EXECUTE REMOVEFILE 7/70/7xtext1
-EXECUTE REMOVEDIR 7/70/
-EXECUTE REMOVEFILE 7/71/7xtest.exe
-EXECUTE REMOVEFILE 7/71/7xtext0
-EXECUTE REMOVEFILE 7/71/7xtext1
-EXECUTE REMOVEDIR 7/71/
-EXECUTE REMOVEFILE 7/7text0
-EXECUTE REMOVEFILE 7/7text1
-EXECUTE REMOVEDIR 7/
-EXECUTE REMOVEDIR 6/
-EXECUTE REMOVEFILE 5/5text1
-EXECUTE REMOVEFILE 5/5text0
-EXECUTE REMOVEFILE 5/5test.exe
-EXECUTE REMOVEFILE 5/5text0
-file cannot be removed because it does not exist; skipping
-EXECUTE REMOVEFILE 5/5text1
-file cannot be removed because it does not exist; skipping
-EXECUTE REMOVEDIR 5/
-EXECUTE REMOVEFILE 4/4text1
-EXECUTE REMOVEFILE 4/4text0
-EXECUTE REMOVEDIR 4/
-EXECUTE REMOVEFILE 3/3text1
-EXECUTE REMOVEFILE 3/3text0
-EXECUTE REMOVEDIR 1/10/
-EXECUTE REMOVEDIR 1/
-FINISH ADD searchplugins/searchpluginstext0
-FINISH PATCH searchplugins/searchpluginspng1.png
-FINISH PATCH searchplugins/searchpluginspng0.png
-FINISH ADD precomplete
-FINISH PATCH exe0.exe
-FINISH ADD distribution/extensions/extensions1/extensions1text0
-FINISH PATCH distribution/extensions/extensions1/extensions1png1.png
-FINISH PATCH distribution/extensions/extensions1/extensions1png0.png
-FINISH ADD distribution/extensions/extensions0/extensions0text0
-FINISH PATCH distribution/extensions/extensions0/extensions0png1.png
-FINISH PATCH distribution/extensions/extensions0/extensions0png0.png
-FINISH PATCH 0/0exe0.exe
-FINISH ADD 0/00/00text0
-FINISH PATCH 0/00/00png0.png
-FINISH ADD 2/20/20text0
-FINISH ADD 2/20/20png0.png
-FINISH ADD 0/00/00text2
-FINISH REMOVEFILE 1/10/10text0
-FINISH REMOVEFILE 0/00/00text1
-FINISH REMOVEDIR 9/99/
-FINISH REMOVEDIR 9/99/
-directory no longer exists; skipping
-FINISH REMOVEDIR 9/98/
-FINISH REMOVEFILE 9/97/970/97xtext0
-FINISH REMOVEFILE 9/97/970/97xtext1
-FINISH REMOVEDIR 9/97/970/
-FINISH REMOVEFILE 9/97/971/97xtext0
-FINISH REMOVEFILE 9/97/971/97xtext1
-FINISH REMOVEDIR 9/97/971/
-FINISH REMOVEDIR 9/97/
-FINISH REMOVEFILE 9/96/96text0
-FINISH REMOVEFILE 9/96/96text1
-FINISH REMOVEDIR 9/96/
-FINISH REMOVEDIR 9/95/
-FINISH REMOVEDIR 9/95/
-directory no longer exists; skipping
-FINISH REMOVEDIR 9/94/
-FINISH REMOVEDIR 9/94/
-directory no longer exists; skipping
-FINISH REMOVEDIR 9/93/
-FINISH REMOVEDIR 9/92/
-removing directory: 9/92/, rv: 0
-FINISH REMOVEDIR 9/91/
-removing directory: 9/91/, rv: 0
-FINISH REMOVEDIR 9/90/
-FINISH REMOVEDIR 9/90/
-directory no longer exists; skipping
-FINISH REMOVEDIR 8/89/
-FINISH REMOVEDIR 8/89/
-directory no longer exists; skipping
-FINISH REMOVEDIR 8/88/
-FINISH REMOVEFILE 8/87/870/87xtext0
-FINISH REMOVEFILE 8/87/870/87xtext1
-FINISH REMOVEDIR 8/87/870/
-FINISH REMOVEFILE 8/87/871/87xtext0
-FINISH REMOVEFILE 8/87/871/87xtext1
-FINISH REMOVEDIR 8/87/871/
-FINISH REMOVEDIR 8/87/
-FINISH REMOVEFILE 8/86/86text0
-FINISH REMOVEFILE 8/86/86text1
-FINISH REMOVEDIR 8/86/
-FINISH REMOVEDIR 8/85/
-FINISH REMOVEDIR 8/85/
-directory no longer exists; skipping
-FINISH REMOVEDIR 8/84/
-FINISH REMOVEDIR 8/84/
-directory no longer exists; skipping
-FINISH REMOVEDIR 8/83/
-FINISH REMOVEDIR 8/82/
-removing directory: 8/82/, rv: 0
-FINISH REMOVEDIR 8/81/
-removing directory: 8/81/, rv: 0
-FINISH REMOVEDIR 8/80/
-FINISH REMOVEDIR 8/80/
-directory no longer exists; skipping
-FINISH REMOVEFILE 7/70/7xtest.exe
-FINISH REMOVEFILE 7/70/7xtext0
-FINISH REMOVEFILE 7/70/7xtext1
-FINISH REMOVEDIR 7/70/
-FINISH REMOVEFILE 7/71/7xtest.exe
-FINISH REMOVEFILE 7/71/7xtext0
-FINISH REMOVEFILE 7/71/7xtext1
-FINISH REMOVEDIR 7/71/
-FINISH REMOVEFILE 7/7text0
-FINISH REMOVEFILE 7/7text1
-FINISH REMOVEDIR 7/
-FINISH REMOVEDIR 6/
-FINISH REMOVEFILE 5/5text1
-FINISH REMOVEFILE 5/5text0
-FINISH REMOVEFILE 5/5test.exe
-FINISH REMOVEDIR 5/
-FINISH REMOVEFILE 4/4text1
-FINISH REMOVEFILE 4/4text0
-FINISH REMOVEDIR 4/
-FINISH REMOVEFILE 3/3text1
-FINISH REMOVEFILE 3/3text0
-FINISH REMOVEDIR 1/10/
-FINISH REMOVEDIR 1/
-succeeded
-calling QuitProgressUI
diff --git a/toolkit/mozapps/update/tests/data/partial_mac.mar b/toolkit/mozapps/update/tests/data/partial_mac.mar
deleted file mode 100644
index 5a702ed4a..000000000
--- a/toolkit/mozapps/update/tests/data/partial_mac.mar
+++ /dev/null
Binary files differ
diff --git a/toolkit/mozapps/update/tests/data/partial_precomplete b/toolkit/mozapps/update/tests/data/partial_precomplete
deleted file mode 100644
index 3ec201463..000000000
--- a/toolkit/mozapps/update/tests/data/partial_precomplete
+++ /dev/null
@@ -1,19 +0,0 @@
-remove "searchplugins/searchpluginstext0"
-remove "searchplugins/searchpluginspng1.png"
-remove "searchplugins/searchpluginspng0.png"
-remove "removed-files"
-remove "precomplete"
-remove "exe0.exe"
-remove "2/20/20text0"
-remove "2/20/20png0.png"
-remove "0/0exe0.exe"
-remove "0/00/00text2"
-remove "0/00/00text0"
-remove "0/00/00png0.png"
-rmdir "searchplugins/"
-rmdir "defaults/pref/"
-rmdir "defaults/"
-rmdir "2/20/"
-rmdir "2/"
-rmdir "0/00/"
-rmdir "0/"
diff --git a/toolkit/mozapps/update/tests/data/partial_precomplete_mac b/toolkit/mozapps/update/tests/data/partial_precomplete_mac
deleted file mode 100644
index c65b6e4e3..000000000
--- a/toolkit/mozapps/update/tests/data/partial_precomplete_mac
+++ /dev/null
@@ -1,22 +0,0 @@
-remove "Contents/Resources/searchplugins/searchpluginstext0"
-remove "Contents/Resources/searchplugins/searchpluginspng1.png"
-remove "Contents/Resources/searchplugins/searchpluginspng0.png"
-remove "Contents/Resources/removed-files"
-remove "Contents/Resources/precomplete"
-remove "Contents/Resources/2/20/20text0"
-remove "Contents/Resources/2/20/20png0.png"
-remove "Contents/Resources/0/0exe0.exe"
-remove "Contents/Resources/0/00/00text2"
-remove "Contents/Resources/0/00/00text0"
-remove "Contents/Resources/0/00/00png0.png"
-remove "Contents/MacOS/exe0.exe"
-rmdir "Contents/Resources/searchplugins/"
-rmdir "Contents/Resources/defaults/pref/"
-rmdir "Contents/Resources/defaults/"
-rmdir "Contents/Resources/2/20/"
-rmdir "Contents/Resources/2/"
-rmdir "Contents/Resources/0/00/"
-rmdir "Contents/Resources/0/"
-rmdir "Contents/Resources/"
-rmdir "Contents/MacOS/"
-rmdir "Contents/"
diff --git a/toolkit/mozapps/update/tests/data/partial_removed-files b/toolkit/mozapps/update/tests/data/partial_removed-files
deleted file mode 100644
index 881311b82..000000000
--- a/toolkit/mozapps/update/tests/data/partial_removed-files
+++ /dev/null
@@ -1,41 +0,0 @@
-a/b/text0
-a/b/text1
-a/b/3/3text0
-a/b/3/3text1
-a/b/4/4exe0.exe
-a/b/4/4text0
-a/b/4/4text1
-a/b/4/
-a/b/5/5text0
-a/b/5/5text1
-a/b/5/*
-a/b/6/
-a/b/7/*
-a/b/8/80/
-a/b/8/81/
-a/b/8/82/
-a/b/8/83/
-a/b/8/84/
-a/b/8/85/*
-a/b/8/86/*
-a/b/8/87/*
-a/b/8/88/*
-a/b/8/89/*
-a/b/8/80/
-a/b/8/84/*
-a/b/8/85/*
-a/b/8/89/
-a/b/9/90/
-a/b/9/91/
-a/b/9/92/
-a/b/9/93/
-a/b/9/94/
-a/b/9/95/*
-a/b/9/96/*
-a/b/9/97/*
-a/b/9/98/*
-a/b/9/99/*
-a/b/9/90/
-a/b/9/94/*
-a/b/9/95/*
-a/b/9/99/
diff --git a/toolkit/mozapps/update/tests/data/partial_removed-files_mac b/toolkit/mozapps/update/tests/data/partial_removed-files_mac
deleted file mode 100644
index 955dc5b34..000000000
--- a/toolkit/mozapps/update/tests/data/partial_removed-files_mac
+++ /dev/null
@@ -1,41 +0,0 @@
-Contents/Resources/text0
-Contents/Resources/text1
-Contents/Resources/3/3text0
-Contents/Resources/3/3text1
-Contents/Resources/4/exe0.exe
-Contents/Resources/4/4text0
-Contents/Resources/4/4text1
-Contents/Resources/4/
-Contents/Resources/5/5text0
-Contents/Resources/5/5text1
-Contents/Resources/5/*
-Contents/Resources/6/
-Contents/Resources/7/*
-Contents/Resources/8/80/
-Contents/Resources/8/81/
-Contents/Resources/8/82/
-Contents/Resources/8/83/
-Contents/Resources/8/84/
-Contents/Resources/8/85/*
-Contents/Resources/8/86/*
-Contents/Resources/8/87/*
-Contents/Resources/8/88/*
-Contents/Resources/8/89/*
-Contents/Resources/8/80/
-Contents/Resources/8/84/*
-Contents/Resources/8/85/*
-Contents/Resources/8/89/
-Contents/Resources/9/90/
-Contents/Resources/9/91/
-Contents/Resources/9/92/
-Contents/Resources/9/93/
-Contents/Resources/9/94/
-Contents/Resources/9/95/*
-Contents/Resources/9/96/*
-Contents/Resources/9/97/*
-Contents/Resources/9/98/*
-Contents/Resources/9/99/*
-Contents/Resources/9/90/
-Contents/Resources/9/94/*
-Contents/Resources/9/95/*
-Contents/Resources/9/99/
diff --git a/toolkit/mozapps/update/tests/data/partial_update_manifest b/toolkit/mozapps/update/tests/data/partial_update_manifest
deleted file mode 100644
index 8d4e60ed2..000000000
--- a/toolkit/mozapps/update/tests/data/partial_update_manifest
+++ /dev/null
@@ -1,63 +0,0 @@
-type "partial"
-add "precomplete"
-add "a/b/searchplugins/searchpluginstext0"
-patch-if "a/b/searchplugins/searchpluginspng1.png" "a/b/searchplugins/searchpluginspng1.png.patch" "a/b/searchplugins/searchpluginspng1.png"
-patch-if "a/b/searchplugins/searchpluginspng0.png" "a/b/searchplugins/searchpluginspng0.png.patch" "a/b/searchplugins/searchpluginspng0.png"
-add-if "a/b/extensions/extensions1" "a/b/extensions/extensions1/extensions1text0"
-patch-if "a/b/extensions/extensions1" "a/b/extensions/extensions1/extensions1png1.png.patch" "a/b/extensions/extensions1/extensions1png1.png"
-patch-if "a/b/extensions/extensions1" "a/b/extensions/extensions1/extensions1png0.png.patch" "a/b/extensions/extensions1/extensions1png0.png"
-add-if "a/b/extensions/extensions0" "a/b/extensions/extensions0/extensions0text0"
-patch-if "a/b/extensions/extensions0" "a/b/extensions/extensions0/extensions0png1.png.patch" "a/b/extensions/extensions0/extensions0png1.png"
-patch-if "a/b/extensions/extensions0" "a/b/extensions/extensions0/extensions0png0.png.patch" "a/b/extensions/extensions0/extensions0png0.png"
-patch "a/b/exe0.exe.patch" "a/b/exe0.exe"
-patch "a/b/0/0exe0.exe.patch" "a/b/0/0exe0.exe"
-add "a/b/0/00/00text0"
-patch "a/b/0/00/00png0.png.patch" "a/b/0/00/00png0.png"
-add "a/b/2/20/20text0"
-add "a/b/2/20/20png0.png"
-add "a/b/0/00/00text2"
-remove "a/b/1/10/10text0"
-remove "a/b/0/00/00text1"
-remove "a/b/text1"
-remove "a/b/text0"
-rmrfdir "a/b/9/99/"
-rmdir "a/b/9/99/"
-rmrfdir "a/b/9/98/"
-rmrfdir "a/b/9/97/"
-rmrfdir "a/b/9/96/"
-rmrfdir "a/b/9/95/"
-rmrfdir "a/b/9/95/"
-rmrfdir "a/b/9/94/"
-rmdir "a/b/9/94/"
-rmdir "a/b/9/93/"
-rmdir "a/b/9/92/"
-rmdir "a/b/9/91/"
-rmdir "a/b/9/90/"
-rmdir "a/b/9/90/"
-rmrfdir "a/b/8/89/"
-rmdir "a/b/8/89/"
-rmrfdir "a/b/8/88/"
-rmrfdir "a/b/8/87/"
-rmrfdir "a/b/8/86/"
-rmrfdir "a/b/8/85/"
-rmrfdir "a/b/8/85/"
-rmrfdir "a/b/8/84/"
-rmdir "a/b/8/84/"
-rmdir "a/b/8/83/"
-rmdir "a/b/8/82/"
-rmdir "a/b/8/81/"
-rmdir "a/b/8/80/"
-rmdir "a/b/8/80/"
-rmrfdir "a/b/7/"
-rmdir "a/b/6/"
-remove "a/b/5/5text1"
-remove "a/b/5/5text0"
-rmrfdir "a/b/5/"
-remove "a/b/4/4text1"
-remove "a/b/4/4text0"
-remove "a/b/4/4exe0.exe"
-rmdir "a/b/4/"
-remove "a/b/3/3text1"
-remove "a/b/3/3text0"
-rmdir "a/b/1/10/"
-rmdir "a/b/1/"
diff --git a/toolkit/mozapps/update/tests/data/replace_log_success b/toolkit/mozapps/update/tests/data/replace_log_success
deleted file mode 100644
index 323f1db41..000000000
--- a/toolkit/mozapps/update/tests/data/replace_log_success
+++ /dev/null
@@ -1,6 +0,0 @@
-Performing a replace request
-rename_file: proceeding to rename the directory
-rename_file: proceeding to rename the directory
-Now, remove the tmpDir
-succeeded
-calling QuitProgressUI
diff --git a/toolkit/mozapps/update/tests/data/shared.js b/toolkit/mozapps/update/tests/data/shared.js
deleted file mode 100644
index e9a10da06..000000000
--- a/toolkit/mozapps/update/tests/data/shared.js
+++ /dev/null
@@ -1,632 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Shared code for xpcshell and mochitests-chrome */
-/* eslint-disable no-undef */
-
-Cu.import("resource://gre/modules/FileUtils.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-const PREF_APP_UPDATE_AUTO = "app.update.auto";
-const PREF_APP_UPDATE_BACKGROUNDERRORS = "app.update.backgroundErrors";
-const PREF_APP_UPDATE_BACKGROUNDMAXERRORS = "app.update.backgroundMaxErrors";
-const PREF_APP_UPDATE_CHANNEL = "app.update.channel";
-const PREF_APP_UPDATE_DOWNLOADBACKGROUNDINTERVAL = "app.update.download.backgroundInterval";
-const PREF_APP_UPDATE_ENABLED = "app.update.enabled";
-const PREF_APP_UPDATE_IDLETIME = "app.update.idletime";
-const PREF_APP_UPDATE_LOG = "app.update.log";
-const PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED = "app.update.notifiedUnsupported";
-const PREF_APP_UPDATE_PROMPTWAITTIME = "app.update.promptWaitTime";
-const PREF_APP_UPDATE_RETRYTIMEOUT = "app.update.socket.retryTimeout";
-const PREF_APP_UPDATE_SERVICE_ENABLED = "app.update.service.enabled";
-const PREF_APP_UPDATE_SILENT = "app.update.silent";
-const PREF_APP_UPDATE_SOCKET_MAXERRORS = "app.update.socket.maxErrors";
-const PREF_APP_UPDATE_STAGING_ENABLED = "app.update.staging.enabled";
-const PREF_APP_UPDATE_URL = "app.update.url";
-const PREF_APP_UPDATE_URL_DETAILS = "app.update.url.details";
-
-const PREFBRANCH_APP_UPDATE_NEVER = "app.update.never.";
-
-const PREFBRANCH_APP_PARTNER = "app.partner.";
-const PREF_DISTRIBUTION_ID = "distribution.id";
-const PREF_DISTRIBUTION_VERSION = "distribution.version";
-const PREF_TOOLKIT_TELEMETRY_ENABLED = "toolkit.telemetry.enabled";
-
-const NS_APP_PROFILE_DIR_STARTUP = "ProfDS";
-const NS_APP_USER_PROFILE_50_DIR = "ProfD";
-const NS_GRE_DIR = "GreD";
-const NS_GRE_BIN_DIR = "GreBinD";
-const NS_XPCOM_CURRENT_PROCESS_DIR = "XCurProcD";
-const XRE_EXECUTABLE_FILE = "XREExeF";
-const XRE_UPDATE_ROOT_DIR = "UpdRootD";
-
-const DIR_PATCH = "0";
-const DIR_TOBEDELETED = "tobedeleted";
-const DIR_UPDATES = "updates";
-const DIR_UPDATED = IS_MACOSX ? "Updated.app" : "updated";
-
-const FILE_ACTIVE_UPDATE_XML = "active-update.xml";
-const FILE_APPLICATION_INI = "application.ini";
-const FILE_BACKUP_UPDATE_LOG = "backup-update.log";
-const FILE_LAST_UPDATE_LOG = "last-update.log";
-const FILE_UPDATE_SETTINGS_INI = "update-settings.ini";
-const FILE_UPDATE_SETTINGS_INI_BAK = "update-settings.ini.bak";
-const FILE_UPDATER_INI = "updater.ini";
-const FILE_UPDATES_XML = "updates.xml";
-const FILE_UPDATE_LOG = "update.log";
-const FILE_UPDATE_MAR = "update.mar";
-const FILE_UPDATE_STATUS = "update.status";
-const FILE_UPDATE_TEST = "update.test";
-const FILE_UPDATE_VERSION = "update.version";
-
-const UPDATE_SETTINGS_CONTENTS = "[Settings]\n" +
- "ACCEPTED_MAR_CHANNEL_IDS=xpcshell-test\n";
-
-const PR_RDWR = 0x04;
-const PR_CREATE_FILE = 0x08;
-const PR_TRUNCATE = 0x20;
-
-const DEFAULT_UPDATE_VERSION = "999999.0";
-
-var gChannel;
-
-/* import-globals-from ../data/sharedUpdateXML.js */
-Services.scriptloader.loadSubScript(DATA_URI_SPEC + "sharedUpdateXML.js", this);
-
-const PERMS_FILE = FileUtils.PERMS_FILE;
-const PERMS_DIRECTORY = FileUtils.PERMS_DIRECTORY;
-
-const MODE_WRONLY = FileUtils.MODE_WRONLY;
-const MODE_CREATE = FileUtils.MODE_CREATE;
-const MODE_APPEND = FileUtils.MODE_APPEND;
-const MODE_TRUNCATE = FileUtils.MODE_TRUNCATE;
-
-const URI_UPDATES_PROPERTIES = "chrome://mozapps/locale/update/updates.properties";
-const gUpdateBundle = Services.strings.createBundle(URI_UPDATES_PROPERTIES);
-
-XPCOMUtils.defineLazyGetter(this, "gAUS", function test_gAUS() {
- return Cc["@mozilla.org/updates/update-service;1"].
- getService(Ci.nsIApplicationUpdateService).
- QueryInterface(Ci.nsITimerCallback).
- QueryInterface(Ci.nsIObserver).
- QueryInterface(Ci.nsIUpdateCheckListener);
-});
-
-XPCOMUtils.defineLazyServiceGetter(this, "gUpdateManager",
- "@mozilla.org/updates/update-manager;1",
- "nsIUpdateManager");
-
-XPCOMUtils.defineLazyGetter(this, "gUpdateChecker", function test_gUC() {
- return Cc["@mozilla.org/updates/update-checker;1"].
- createInstance(Ci.nsIUpdateChecker);
-});
-
-XPCOMUtils.defineLazyGetter(this, "gUP", function test_gUP() {
- return Cc["@mozilla.org/updates/update-prompt;1"].
- createInstance(Ci.nsIUpdatePrompt);
-});
-
-XPCOMUtils.defineLazyGetter(this, "gDefaultPrefBranch", function test_gDPB() {
- return Services.prefs.getDefaultBranch(null);
-});
-
-XPCOMUtils.defineLazyGetter(this, "gPrefRoot", function test_gPR() {
- return Services.prefs.getBranch(null);
-});
-
-XPCOMUtils.defineLazyServiceGetter(this, "gEnv",
- "@mozilla.org/process/environment;1",
- "nsIEnvironment");
-
-XPCOMUtils.defineLazyGetter(this, "gZipW", function test_gZipW() {
- return Cc["@mozilla.org/zipwriter;1"].
- createInstance(Ci.nsIZipWriter);
-});
-
-/* Triggers post-update processing */
-function testPostUpdateProcessing() {
- gAUS.observe(null, "test-post-update-processing", "");
-}
-
-/* Initializes the update service stub */
-function initUpdateServiceStub() {
- Cc["@mozilla.org/updates/update-service-stub;1"].
- createInstance(Ci.nsISupports);
-}
-
-/* Reloads the update metadata from disk */
-function reloadUpdateManagerData() {
- gUpdateManager.QueryInterface(Ci.nsIObserver).
- observe(null, "um-reload-update-data", "");
-}
-
-const observer = {
- observe: function(aSubject, aTopic, aData) {
- if (aTopic == "nsPref:changed" && aData == PREF_APP_UPDATE_CHANNEL) {
- let channel = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
- if (channel != gChannel) {
- debugDump("Changing channel from " + channel + " to " + gChannel);
- gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_CHANNEL, gChannel);
- }
- }
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver])
-};
-
-/**
- * Sets the app.update.channel preference.
- *
- * @param aChannel
- * The update channel.
- */
-function setUpdateChannel(aChannel) {
- gChannel = aChannel;
- debugDump("setting default pref " + PREF_APP_UPDATE_CHANNEL + " to " + gChannel);
- gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_CHANNEL, gChannel);
- gPrefRoot.addObserver(PREF_APP_UPDATE_CHANNEL, observer, false);
-}
-
-/**
- * Sets the app.update.url default preference.
- *
- * @param aURL
- * The update url. If not specified 'URL_HOST + "/update.xml"' will be
- * used.
- */
-function setUpdateURL(aURL) {
- let url = aURL ? aURL : URL_HOST + "/update.xml";
- debugDump("setting " + PREF_APP_UPDATE_URL + " to " + url);
- gDefaultPrefBranch.setCharPref(PREF_APP_UPDATE_URL, url);
-}
-
-/**
- * Returns either the active or regular update database XML file.
- *
- * @param isActiveUpdate
- * If true this will return the active-update.xml otherwise it will
- * return the updates.xml file.
- */
-function getUpdatesXMLFile(aIsActiveUpdate) {
- let file = getUpdatesRootDir();
- file.append(aIsActiveUpdate ? FILE_ACTIVE_UPDATE_XML : FILE_UPDATES_XML);
- return file;
-}
-
-/**
- * Writes the updates specified to either the active-update.xml or the
- * updates.xml.
- *
- * @param aContent
- * The updates represented as a string to write to the XML file.
- * @param isActiveUpdate
- * If true this will write to the active-update.xml otherwise it will
- * write to the updates.xml file.
- */
-function writeUpdatesToXMLFile(aContent, aIsActiveUpdate) {
- writeFile(getUpdatesXMLFile(aIsActiveUpdate), aContent);
-}
-
-/**
- * Writes the current update operation/state to a file in the patch
- * directory, indicating to the patching system that operations need
- * to be performed.
- *
- * @param aStatus
- * The status value to write.
- */
-function writeStatusFile(aStatus) {
- let file = getUpdatesPatchDir();
- file.append(FILE_UPDATE_STATUS);
- writeFile(file, aStatus + "\n");
-}
-
-/**
- * Writes the current update version to a file in the patch directory,
- * indicating to the patching system the version of the update.
- *
- * @param aVersion
- * The version value to write.
- */
-function writeVersionFile(aVersion) {
- let file = getUpdatesPatchDir();
- file.append(FILE_UPDATE_VERSION);
- writeFile(file, aVersion + "\n");
-}
-
-/**
- * Gets the root directory for the updates directory.
- *
- * @return nsIFile for the updates root directory.
- */
-function getUpdatesRootDir() {
- return Services.dirsvc.get(XRE_UPDATE_ROOT_DIR, Ci.nsIFile);
-}
-
-/**
- * Gets the updates directory.
- *
- * @return nsIFile for the updates directory.
- */
-function getUpdatesDir() {
- let dir = getUpdatesRootDir();
- dir.append(DIR_UPDATES);
- return dir;
-}
-
-/**
- * Gets the directory for update patches.
- *
- * @return nsIFile for the updates directory.
- */
-function getUpdatesPatchDir() {
- let dir = getUpdatesDir();
- dir.append(DIR_PATCH);
- return dir;
-}
-
-/**
- * Writes text to a file. This will replace existing text if the file exists
- * and create the file if it doesn't exist.
- *
- * @param aFile
- * The file to write to. Will be created if it doesn't exist.
- * @param aText
- * The text to write to the file. If there is existing text it will be
- * replaced.
- */
-function writeFile(aFile, aText) {
- let fos = Cc["@mozilla.org/network/file-output-stream;1"].
- createInstance(Ci.nsIFileOutputStream);
- if (!aFile.exists()) {
- aFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, PERMS_FILE);
- }
- fos.init(aFile, MODE_WRONLY | MODE_CREATE | MODE_TRUNCATE, PERMS_FILE, 0);
- fos.write(aText, aText.length);
- fos.close();
-}
-
-/**
- * Reads the current update operation/state in the status file in the patch
- * directory including the error code if it is present.
- *
- * @return The status value.
- */
-function readStatusFile() {
- let file = getUpdatesPatchDir();
- file.append(FILE_UPDATE_STATUS);
-
- if (!file.exists()) {
- debugDump("update status file does not exists! Path: " + file.path);
- return STATE_NONE;
- }
-
- return readFile(file).split("\n")[0];
-}
-
-/**
- * Reads the current update operation/state in the status file in the patch
- * directory without the error code if it is present.
- *
- * @return The state value.
- */
-function readStatusState() {
- return readStatusFile().split(": ")[0];
-}
-
-/**
- * Reads the current update operation/state in the status file in the patch
- * directory with the error code.
- *
- * @return The state value.
- */
-function readStatusFailedCode() {
- return readStatusFile().split(": ")[1];
-}
-
-/**
- * Reads text from a file and returns the string.
- *
- * @param aFile
- * The file to read from.
- * @return The string of text read from the file.
- */
-function readFile(aFile) {
- let fis = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- if (!aFile.exists()) {
- return null;
- }
- // Specifying -1 for ioFlags will open the file with the default of PR_RDONLY.
- // Specifying -1 for perm will open the file with the default of 0.
- fis.init(aFile, -1, -1, Ci.nsIFileInputStream.CLOSE_ON_EOF);
- let sis = Cc["@mozilla.org/scriptableinputstream;1"].
- createInstance(Ci.nsIScriptableInputStream);
- sis.init(fis);
- let text = sis.read(sis.available());
- sis.close();
- return text;
-}
-
-/**
- * Reads the binary contents of a file and returns it as a string.
- *
- * @param aFile
- * The file to read from.
- * @return The contents of the file as a string.
- */
-function readFileBytes(aFile) {
- debugDump("attempting to read file, path: " + aFile.path);
- let fis = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- // Specifying -1 for ioFlags will open the file with the default of PR_RDONLY.
- // Specifying -1 for perm will open the file with the default of 0.
- fis.init(aFile, -1, -1, Ci.nsIFileInputStream.CLOSE_ON_EOF);
- let bis = Cc["@mozilla.org/binaryinputstream;1"].
- createInstance(Ci.nsIBinaryInputStream);
- bis.setInputStream(fis);
- let data = [];
- let count = fis.available();
- while (count > 0) {
- let bytes = bis.readByteArray(Math.min(65535, count));
- data.push(String.fromCharCode.apply(null, bytes));
- count -= bytes.length;
- if (bytes.length == 0) {
- throw "Nothing read from input stream!";
- }
- }
- data.join('');
- fis.close();
- return data.toString();
-}
-
-/* Returns human readable status text from the updates.properties bundle */
-function getStatusText(aErrCode) {
- return getString("check_error-" + aErrCode);
-}
-
-/* Returns a string from the updates.properties bundle */
-function getString(aName) {
- try {
- return gUpdateBundle.GetStringFromName(aName);
- } catch (e) {
- }
- return null;
-}
-
-/**
- * Gets the file extension for an nsIFile.
- *
- * @param aFile
- * The file to get the file extension for.
- * @return The file extension.
- */
-function getFileExtension(aFile) {
- return Services.io.newFileURI(aFile).QueryInterface(Ci.nsIURL).
- fileExtension;
-}
-
-/**
- * Removes the updates.xml file, active-update.xml file, and all files and
- * sub-directories in the updates directory except for the "0" sub-directory.
- * This prevents some tests from failing due to files being left behind when the
- * tests are interrupted.
- */
-function removeUpdateDirsAndFiles() {
- let file = getUpdatesXMLFile(true);
- try {
- if (file.exists()) {
- file.remove(false);
- }
- } catch (e) {
- logTestInfo("Unable to remove file. Path: " + file.path +
- ", Exception: " + e);
- }
-
- file = getUpdatesXMLFile(false);
- try {
- if (file.exists()) {
- file.remove(false);
- }
- } catch (e) {
- logTestInfo("Unable to remove file. Path: " + file.path +
- ", Exception: " + e);
- }
-
- // This fails sporadically on Mac OS X so wrap it in a try catch
- let updatesDir = getUpdatesDir();
- try {
- cleanUpdatesDir(updatesDir);
- } catch (e) {
- logTestInfo("Unable to remove files / directories from directory. Path: " +
- updatesDir.path + ", Exception: " + e);
- }
-}
-
-/**
- * Removes all files and sub-directories in the updates directory except for
- * the "0" sub-directory.
- *
- * @param aDir
- * nsIFile for the directory to be deleted.
- */
-function cleanUpdatesDir(aDir) {
- if (!aDir.exists()) {
- return;
- }
-
- let dirEntries = aDir.directoryEntries;
- while (dirEntries.hasMoreElements()) {
- let entry = dirEntries.getNext().QueryInterface(Ci.nsIFile);
-
- if (entry.isDirectory()) {
- if (entry.leafName == DIR_PATCH && entry.parent.leafName == DIR_UPDATES) {
- cleanUpdatesDir(entry);
- entry.permissions = PERMS_DIRECTORY;
- } else {
- try {
- entry.remove(true);
- return;
- } catch (e) {
- }
- cleanUpdatesDir(entry);
- entry.permissions = PERMS_DIRECTORY;
- try {
- entry.remove(true);
- } catch (e) {
- logTestInfo("cleanUpdatesDir: unable to remove directory. Path: " +
- entry.path + ", Exception: " + e);
- throw (e);
- }
- }
- } else {
- entry.permissions = PERMS_FILE;
- try {
- entry.remove(false);
- } catch (e) {
- logTestInfo("cleanUpdatesDir: unable to remove file. Path: " +
- entry.path + ", Exception: " + e);
- throw (e);
- }
- }
- }
-}
-
-/**
- * Deletes a directory and its children. First it tries nsIFile::Remove(true).
- * If that fails it will fall back to recursing, setting the appropriate
- * permissions, and deleting the current entry.
- *
- * @param aDir
- * nsIFile for the directory to be deleted.
- */
-function removeDirRecursive(aDir) {
- if (!aDir.exists()) {
- return;
- }
-
- try {
- debugDump("attempting to remove directory. Path: " + aDir.path);
- aDir.remove(true);
- return;
- } catch (e) {
- logTestInfo("non-fatal error removing directory. Exception: " + e);
- }
-
- let dirEntries = aDir.directoryEntries;
- while (dirEntries.hasMoreElements()) {
- let entry = dirEntries.getNext().QueryInterface(Ci.nsIFile);
-
- if (entry.isDirectory()) {
- removeDirRecursive(entry);
- } else {
- entry.permissions = PERMS_FILE;
- try {
- debugDump("attempting to remove file. Path: " + entry.path);
- entry.remove(false);
- } catch (e) {
- logTestInfo("error removing file. Exception: " + e);
- throw (e);
- }
- }
- }
-
- aDir.permissions = PERMS_DIRECTORY;
- try {
- debugDump("attempting to remove directory. Path: " + aDir.path);
- aDir.remove(true);
- } catch (e) {
- logTestInfo("error removing directory. Exception: " + e);
- throw (e);
- }
-}
-
-/**
- * Returns the directory for the currently running process. This is used to
- * clean up after the tests and to locate the active-update.xml and updates.xml
- * files.
- *
- * @return nsIFile for the current process directory.
- */
-function getCurrentProcessDir() {
- return Services.dirsvc.get(NS_XPCOM_CURRENT_PROCESS_DIR, Ci.nsIFile);
-}
-
-/**
- * Gets the application base directory.
- *
- * @return nsIFile object for the application base directory.
- */
-function getAppBaseDir() {
- return Services.dirsvc.get(XRE_EXECUTABLE_FILE, Ci.nsIFile).parent;
-}
-
-/**
- * Returns the Gecko Runtime Engine directory where files other than executable
- * binaries are located. On Mac OS X this will be <bundle>/Contents/Resources/
- * and the installation directory on all other platforms.
- *
- * @return nsIFile for the Gecko Runtime Engine directory.
- */
-function getGREDir() {
- return Services.dirsvc.get(NS_GRE_DIR, Ci.nsIFile);
-}
-
-/**
- * Returns the Gecko Runtime Engine Binary directory where the executable
- * binaries are located such as the updater binary (Windows and Linux) or
- * updater package (Mac OS X). On Mac OS X this will be
- * <bundle>/Contents/MacOS/ and the installation directory on all other
- * platforms.
- *
- * @return nsIFile for the Gecko Runtime Engine Binary directory.
- */
-function getGREBinDir() {
- return Services.dirsvc.get(NS_GRE_BIN_DIR, Ci.nsIFile);
-}
-
-/**
- * Logs TEST-INFO messages.
- *
- * @param aText
- * The text to log.
- * @param aCaller (optional)
- * An optional Components.stack.caller. If not specified
- * Components.stack.caller will be used.
- */
-function logTestInfo(aText, aCaller) {
- let caller = aCaller ? aCaller : Components.stack.caller;
- let now = new Date();
- let hh = now.getHours();
- let mm = now.getMinutes();
- let ss = now.getSeconds();
- let ms = now.getMilliseconds();
- let time = (hh < 10 ? "0" + hh : hh) + ":" +
- (mm < 10 ? "0" + mm : mm) + ":" +
- (ss < 10 ? "0" + ss : ss) + ":";
- if (ms < 10) {
- time += "00";
- } else if (ms < 100) {
- time += "0";
- }
- time += ms;
- let msg = time + " | TEST-INFO | " + caller.filename + " | [" + caller.name +
- " : " + caller.lineNumber + "] " + aText;
- LOG_FUNCTION(msg);
-}
-
-/**
- * Logs TEST-INFO messages when DEBUG_AUS_TEST evaluates to true.
- *
- * @param aText
- * The text to log.
- * @param aCaller (optional)
- * An optional Components.stack.caller. If not specified
- * Components.stack.caller will be used.
- */
-function debugDump(aText, aCaller) {
- if (DEBUG_AUS_TEST) {
- let caller = aCaller ? aCaller : Components.stack.caller;
- logTestInfo(aText, caller);
- }
-}
diff --git a/toolkit/mozapps/update/tests/data/sharedUpdateXML.js b/toolkit/mozapps/update/tests/data/sharedUpdateXML.js
deleted file mode 100644
index 3aa01eff4..000000000
--- a/toolkit/mozapps/update/tests/data/sharedUpdateXML.js
+++ /dev/null
@@ -1,364 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Helper functions for creating xml strings used by application update tests.
- *
- * !IMPORTANT - This file contains everything needed (along with dependencies)
- * by the updates.sjs file used by the mochitest-chrome tests. Since xpcshell
- * used by the http server is launched with -v 170 this file must not use
- * features greater than JavaScript 1.7.
- */
-
-/* eslint-disable no-undef */
-
-const FILE_SIMPLE_MAR = "simple.mar";
-const SIZE_SIMPLE_MAR = "1031";
-const MD5_HASH_SIMPLE_MAR = "1f8c038577bb6845d94ccec4999113ee";
-const SHA1_HASH_SIMPLE_MAR = "5d49a672c87f10f31d7e326349564a11272a028b";
-const SHA256_HASH_SIMPLE_MAR = "1aabbed5b1dd6e16e139afc5b43d479e254e0c26" +
- "3c8fb9249c0a1bb93071c5fb";
-const SHA384_HASH_SIMPLE_MAR = "26615014ea034af32ef5651492d5f493f5a7a1a48522e" +
- "d24c366442a5ec21d5ef02e23fb58d79729b8ca2f9541" +
- "99dd53";
-const SHA512_HASH_SIMPLE_MAR = "922e5ae22081795f6e8d65a3c508715c9a314054179a8" +
- "bbfe5f50dc23919ad89888291bc0a07586ab17dd0304a" +
- "b5347473601127571c66f61f5080348e05c36b";
-
-const STATE_NONE = "null";
-const STATE_DOWNLOADING = "downloading";
-const STATE_PENDING = "pending";
-const STATE_PENDING_SVC = "pending-service";
-const STATE_APPLYING = "applying";
-const STATE_APPLIED = "applied";
-const STATE_APPLIED_SVC = "applied-service";
-const STATE_SUCCEEDED = "succeeded";
-const STATE_DOWNLOAD_FAILED = "download-failed";
-const STATE_FAILED = "failed";
-
-const LOADSOURCE_ERROR_WRONG_SIZE = 2;
-const CRC_ERROR = 4;
-const READ_ERROR = 6;
-const WRITE_ERROR = 7;
-const MAR_CHANNEL_MISMATCH_ERROR = 22;
-const VERSION_DOWNGRADE_ERROR = 23;
-const SERVICE_COULD_NOT_COPY_UPDATER = 49;
-const SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR = 52;
-const SERVICE_INVALID_APPLYTO_DIR_ERROR = 54;
-const SERVICE_INVALID_INSTALL_DIR_PATH_ERROR = 55;
-const SERVICE_INVALID_WORKING_DIR_PATH_ERROR = 56;
-const INVALID_APPLYTO_DIR_STAGED_ERROR = 72;
-const INVALID_APPLYTO_DIR_ERROR = 74;
-const INVALID_INSTALL_DIR_PATH_ERROR = 75;
-const INVALID_WORKING_DIR_PATH_ERROR = 76;
-const INVALID_CALLBACK_PATH_ERROR = 77;
-const INVALID_CALLBACK_DIR_ERROR = 78;
-
-const STATE_FAILED_DELIMETER = ": ";
-
-const STATE_FAILED_LOADSOURCE_ERROR_WRONG_SIZE =
- STATE_FAILED + STATE_FAILED_DELIMETER + LOADSOURCE_ERROR_WRONG_SIZE;
-const STATE_FAILED_CRC_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + CRC_ERROR;
-const STATE_FAILED_READ_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + READ_ERROR;
-const STATE_FAILED_WRITE_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + WRITE_ERROR;
-const STATE_FAILED_MAR_CHANNEL_MISMATCH_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + MAR_CHANNEL_MISMATCH_ERROR;
-const STATE_FAILED_VERSION_DOWNGRADE_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + VERSION_DOWNGRADE_ERROR;
-const STATE_FAILED_SERVICE_COULD_NOT_COPY_UPDATER =
- STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_COULD_NOT_COPY_UPDATER
-const STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR;
-const STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_INVALID_APPLYTO_DIR_ERROR;
-const STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_INVALID_INSTALL_DIR_PATH_ERROR;
-const STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + SERVICE_INVALID_WORKING_DIR_PATH_ERROR;
-const STATE_FAILED_INVALID_APPLYTO_DIR_STAGED_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_APPLYTO_DIR_STAGED_ERROR;
-const STATE_FAILED_INVALID_APPLYTO_DIR_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_APPLYTO_DIR_ERROR;
-const STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_INSTALL_DIR_PATH_ERROR;
-const STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_WORKING_DIR_PATH_ERROR;
-const STATE_FAILED_INVALID_CALLBACK_PATH_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_CALLBACK_PATH_ERROR;
-const STATE_FAILED_INVALID_CALLBACK_DIR_ERROR =
- STATE_FAILED + STATE_FAILED_DELIMETER + INVALID_CALLBACK_DIR_ERROR;
-
-/**
- * Constructs a string representing a remote update xml file.
- *
- * @param aUpdates
- * The string representing the update elements.
- * @return The string representing a remote update xml file.
- */
-function getRemoteUpdatesXMLString(aUpdates) {
- return "<?xml version=\"1.0\"?>\n" +
- "<updates>\n" +
- aUpdates +
- "</updates>\n";
-}
-
-/**
- * Constructs a string representing an update element for a remote update xml
- * file. See getUpdateString for parameter information not provided below.
- *
- * @param aPatches
- * String representing the application update patches.
- * @return The string representing an update element for an update xml file.
- */
-function getRemoteUpdateString(aPatches, aType, aName, aDisplayVersion,
- aAppVersion, aBuildID, aDetailsURL, aShowPrompt,
- aShowNeverForVersion, aPromptWaitTime,
- aBackgroundInterval, aCustom1, aCustom2) {
- return getUpdateString(aType, aName, aDisplayVersion, aAppVersion,
- aBuildID, aDetailsURL, aShowPrompt,
- aShowNeverForVersion, aPromptWaitTime,
- aBackgroundInterval, aCustom1, aCustom2) + ">\n" +
- aPatches +
- " </update>\n";
-}
-
-/**
- * Constructs a string representing a patch element for a remote update xml
- * file. See getPatchString for parameter information not provided below.
- *
- * @return The string representing a patch element for a remote update xml file.
- */
-function getRemotePatchString(aType, aURL, aHashFunction, aHashValue, aSize) {
- return getPatchString(aType, aURL, aHashFunction, aHashValue, aSize) +
- "/>\n";
-}
-
-/**
- * Constructs a string representing a local update xml file.
- *
- * @param aUpdates
- * The string representing the update elements.
- * @return The string representing a local update xml file.
- */
-function getLocalUpdatesXMLString(aUpdates) {
- if (!aUpdates || aUpdates == "") {
- return "<updates xmlns=\"http://www.mozilla.org/2005/app-update\"/>";
- }
- return ("<updates xmlns=\"http://www.mozilla.org/2005/app-update\">" +
- aUpdates +
- "</updates>").replace(/>\s+\n*</g, '><');
-}
-
-/**
- * Constructs a string representing an update element for a local update xml
- * file. See getUpdateString for parameter information not provided below.
- *
- * @param aPatches
- * String representing the application update patches.
- * @param aServiceURL (optional)
- * The update's xml url.
- * If not specified it will default to 'http://test_service/'.
- * @param aIsCompleteUpdate (optional)
- * The string 'true' if this update was a complete update or the string
- * 'false' if this update was a partial update.
- * If not specified it will default to 'true'.
- * @param aChannel (optional)
- * The update channel name.
- * If not specified it will default to the default preference value of
- * app.update.channel.
- * @param aForegroundDownload (optional)
- * The string 'true' if this update was manually downloaded or the
- * string 'false' if this update was automatically downloaded.
- * If not specified it will default to 'true'.
- * @param aPreviousAppVersion (optional)
- * The application version prior to applying the update.
- * If not specified it will not be present.
- * @return The string representing an update element for an update xml file.
- */
-function getLocalUpdateString(aPatches, aType, aName, aDisplayVersion,
- aAppVersion, aBuildID, aDetailsURL, aServiceURL,
- aInstallDate, aStatusText, aIsCompleteUpdate,
- aChannel, aForegroundDownload, aShowPrompt,
- aShowNeverForVersion, aPromptWaitTime,
- aBackgroundInterval, aPreviousAppVersion,
- aCustom1, aCustom2) {
- let serviceURL = aServiceURL ? aServiceURL : "http://test_service/";
- let installDate = aInstallDate ? aInstallDate : "1238441400314";
- let statusText = aStatusText ? aStatusText : "Install Pending";
- let isCompleteUpdate =
- typeof aIsCompleteUpdate == "string" ? aIsCompleteUpdate : "true";
- let channel = aChannel ? aChannel
- : gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
- let foregroundDownload =
- typeof aForegroundDownload == "string" ? aForegroundDownload : "true";
- let previousAppVersion = aPreviousAppVersion ? "previousAppVersion=\"" +
- aPreviousAppVersion + "\" "
- : "";
- return getUpdateString(aType, aName, aDisplayVersion, aAppVersion, aBuildID,
- aDetailsURL, aShowPrompt, aShowNeverForVersion,
- aPromptWaitTime, aBackgroundInterval, aCustom1, aCustom2) +
- " " +
- previousAppVersion +
- "serviceURL=\"" + serviceURL + "\" " +
- "installDate=\"" + installDate + "\" " +
- "statusText=\"" + statusText + "\" " +
- "isCompleteUpdate=\"" + isCompleteUpdate + "\" " +
- "channel=\"" + channel + "\" " +
- "foregroundDownload=\"" + foregroundDownload + "\">" +
- aPatches +
- " </update>";
-}
-
-/**
- * Constructs a string representing a patch element for a local update xml file.
- * See getPatchString for parameter information not provided below.
- *
- * @param aSelected (optional)
- * Whether this patch is selected represented or not. The string 'true'
- * denotes selected and the string 'false' denotes not selected.
- * If not specified it will default to the string 'true'.
- * @param aState (optional)
- * The patch's state.
- * If not specified it will default to STATE_SUCCEEDED.
- * @return The string representing a patch element for a local update xml file.
- */
-function getLocalPatchString(aType, aURL, aHashFunction, aHashValue, aSize,
- aSelected, aState) {
- let selected = typeof aSelected == "string" ? aSelected : "true";
- let state = aState ? aState : STATE_SUCCEEDED;
- return getPatchString(aType, aURL, aHashFunction, aHashValue, aSize) + " " +
- "selected=\"" + selected + "\" " +
- "state=\"" + state + "\"/>\n";
-}
-
-/**
- * Constructs a string representing an update element for a remote update xml
- * file.
- *
- * @param aType (optional)
- * The update's type which should be major or minor. If not specified it
- * will default to 'major'.
- * @param aName (optional)
- * The update's name.
- * If not specified it will default to 'App Update Test'.
- * @param aDisplayVersion (optional)
- * The update's display version.
- * If not specified it will default to 'version #' where # is the value
- * of DEFAULT_UPDATE_VERSION.
- * @param aAppVersion (optional)
- * The update's application version.
- * If not specified it will default to the value of
- * DEFAULT_UPDATE_VERSION.
- * @param aBuildID (optional)
- * The update's build id.
- * If not specified it will default to '20080811053724'.
- * @param aDetailsURL (optional)
- * The update's details url.
- * If not specified it will default to 'http://test_details/' due to due
- * to bug 470244.
- * @param aShowPrompt (optional)
- * Whether to show the prompt for the update when auto update is
- * enabled.
- * If not specified it will not be present and the update service will
- * default to false.
- * @param aShowNeverForVersion (optional)
- * Whether to show the 'No Thanks' button in the update prompt.
- * If not specified it will not be present and the update service will
- * default to false.
- * @param aPromptWaitTime (optional)
- * Override for the app.update.promptWaitTime preference.
- * @param aBackgroundInterval (optional)
- * Override for the app.update.download.backgroundInterval preference.
- * @param aCustom1 (optional)
- * A custom attribute name and attribute value to add to the xml.
- * Example: custom1_attribute="custom1 value"
- * If not specified it will not be present.
- * @param aCustom2 (optional)
- * A custom attribute name and attribute value to add to the xml.
- * Example: custom2_attribute="custom2 value"
- * If not specified it will not be present.
- * @return The string representing an update element for an update xml file.
- */
-function getUpdateString(aType, aName, aDisplayVersion, aAppVersion, aBuildID,
- aDetailsURL, aShowPrompt, aShowNeverForVersion,
- aPromptWaitTime, aBackgroundInterval, aCustom1,
- aCustom2) {
- let type = aType ? aType : "major";
- let name = aName ? aName : "App Update Test";
- let displayVersion = aDisplayVersion ? "displayVersion=\"" +
- aDisplayVersion + "\" "
- : "";
- let appVersion = "appVersion=\"" +
- (aAppVersion ? aAppVersion : DEFAULT_UPDATE_VERSION) +
- "\" ";
- let buildID = aBuildID ? aBuildID : "20080811053724";
- // XXXrstrong - not specifying a detailsURL will cause a leak due to bug 470244
-// let detailsURL = aDetailsURL ? "detailsURL=\"" + aDetailsURL + "\" " : "";
- let detailsURL = "detailsURL=\"" +
- (aDetailsURL ? aDetailsURL
- : "http://test_details/") + "\" ";
- let showPrompt = aShowPrompt ? "showPrompt=\"" + aShowPrompt + "\" " : "";
- let showNeverForVersion = aShowNeverForVersion ? "showNeverForVersion=\"" +
- aShowNeverForVersion + "\" "
- : "";
- let promptWaitTime = aPromptWaitTime ? "promptWaitTime=\"" + aPromptWaitTime +
- "\" "
- : "";
- let backgroundInterval = aBackgroundInterval ? "backgroundInterval=\"" +
- aBackgroundInterval + "\" "
- : "";
- let custom1 = aCustom1 ? aCustom1 + " " : "";
- let custom2 = aCustom2 ? aCustom2 + " " : "";
- return " <update type=\"" + type + "\" " +
- "name=\"" + name + "\" " +
- displayVersion +
- appVersion +
- detailsURL +
- showPrompt +
- showNeverForVersion +
- promptWaitTime +
- backgroundInterval +
- custom1 +
- custom2 +
- "buildID=\"" + buildID + "\"";
-}
-
-/**
- * Constructs a string representing a patch element for an update xml file.
- *
- * @param aType (optional)
- * The patch's type which should be complete or partial.
- * If not specified it will default to 'complete'.
- * @param aURL (optional)
- * The patch's url to the mar file.
- * If not specified it will default to the value of:
- * gURLData + FILE_SIMPLE_MAR
- * @param aHashFunction (optional)
- * The patch's hash function used to verify the mar file.
- * If not specified it will default to 'MD5'.
- * @param aHashValue (optional)
- * The patch's hash value used to verify the mar file.
- * If not specified it will default to the value of MD5_HASH_SIMPLE_MAR
- * which is the MD5 hash value for the file specified by FILE_SIMPLE_MAR.
- * @param aSize (optional)
- * The patch's file size for the mar file.
- * If not specified it will default to the file size for FILE_SIMPLE_MAR
- * specified by SIZE_SIMPLE_MAR.
- * @return The string representing a patch element for an update xml file.
- */
-function getPatchString(aType, aURL, aHashFunction, aHashValue, aSize) {
- let type = aType ? aType : "complete";
- let url = aURL ? aURL : gURLData + FILE_SIMPLE_MAR;
- let hashFunction = aHashFunction ? aHashFunction : "MD5";
- let hashValue = aHashValue ? aHashValue : MD5_HASH_SIMPLE_MAR;
- let size = aSize ? aSize : SIZE_SIMPLE_MAR;
- return " <patch type=\"" + type + "\" " +
- "URL=\"" + url + "\" " +
- "hashFunction=\"" + hashFunction + "\" " +
- "hashValue=\"" + hashValue + "\" " +
- "size=\"" + size + "\"";
-}
diff --git a/toolkit/mozapps/update/tests/data/simple.mar b/toolkit/mozapps/update/tests/data/simple.mar
deleted file mode 100644
index b2ccbd8d2..000000000
--- a/toolkit/mozapps/update/tests/data/simple.mar
+++ /dev/null
Binary files differ
diff --git a/toolkit/mozapps/update/tests/data/wrong_product_channel.mar b/toolkit/mozapps/update/tests/data/wrong_product_channel.mar
deleted file mode 100644
index 1e39cc214..000000000
--- a/toolkit/mozapps/update/tests/data/wrong_product_channel.mar
+++ /dev/null
Binary files differ
diff --git a/toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js b/toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js
deleted file mode 100644
index e5f0fce58..000000000
--- a/toolkit/mozapps/update/tests/data/xpcshellConstantsPP.js
+++ /dev/null
@@ -1,53 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* Preprocessed constants used by xpcshell tests */
-
-const INSTALL_LOCALE = "@AB_CD@";
-const MOZ_APP_NAME = "@MOZ_APP_NAME@";
-const BIN_SUFFIX = "@BIN_SUFFIX@";
-
-// MOZ_APP_VENDOR is optional.
-#ifdef MOZ_APP_VENDOR
-const MOZ_APP_VENDOR = "@MOZ_APP_VENDOR@";
-#else
-const MOZ_APP_VENDOR = "";
-#endif
-
-// MOZ_APP_BASENAME is not optional for tests.
-const MOZ_APP_BASENAME = "@MOZ_APP_BASENAME@";
-const APP_BIN_SUFFIX = "@BIN_SUFFIX@";
-
-const APP_INFO_NAME = "XPCShell";
-const APP_INFO_VENDOR = "Mozilla";
-
-#ifdef XP_WIN
-const IS_WIN = true;
-#else
-const IS_WIN = false;
-#endif
-
-#ifdef XP_MACOSX
-const IS_MACOSX = true;
-#else
-const IS_MACOSX = false;
-#endif
-
-#ifdef XP_UNIX
-const IS_UNIX = true;
-#else
-const IS_UNIX = false;
-#endif
-
-#ifdef MOZ_VERIFY_MAR_SIGNATURE
-const MOZ_VERIFY_MAR_SIGNATURE = true;
-#else
-const MOZ_VERIFY_MAR_SIGNATURE = false;
-#endif
-
-#ifdef DISABLE_UPDATER_AUTHENTICODE_CHECK
- const IS_AUTHENTICODE_CHECK_ENABLED = false;
-#else
- const IS_AUTHENTICODE_CHECK_ENABLED = true;
-#endif
diff --git a/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js b/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
deleted file mode 100644
index 9a9610dda..000000000
--- a/toolkit/mozapps/update/tests/data/xpcshellUtilsAUS.js
+++ /dev/null
@@ -1,4047 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/**
- * Test log warnings that happen before the test has started
- * "Couldn't get the user appdata directory. Crash events may not be produced."
- * in nsExceptionHandler.cpp (possibly bug 619104)
- *
- * Test log warnings that happen after the test has finished
- * "OOPDeinit() without successful OOPInit()" in nsExceptionHandler.cpp
- * (bug 619104)
- * "XPCOM objects created/destroyed from static ctor/dtor" in nsTraceRefcnt.cpp
- * (possibly bug 457479)
- *
- * Other warnings printed to the test logs
- * "site security information will not be persisted" in
- * nsSiteSecurityService.cpp and the error in nsSystemInfo.cpp preceding this
- * error are due to not having a profile when running some of the xpcshell
- * tests. Since most xpcshell tests also log these errors these tests don't
- * call do_get_profile unless necessary for the test.
- * The "This method is lossy. Use GetCanonicalPath !" warning on Windows in
- * nsLocalFileWin.cpp is from the call to GetNSSProfilePath in
- * nsNSSComponent.cpp due to it using GetNativeCanonicalPath.
- * "!mMainThread" in nsThreadManager.cpp are due to using timers and it might be
- * possible to fix some or all of these in the test itself.
- * "NS_FAILED(rv)" in nsThreadUtils.cpp are due to using timers and it might be
- * possible to fix some or all of these in the test itself.
- */
-
-'use strict';
-/* eslint-disable no-undef */
-
-const { classes: Cc, interfaces: Ci, manager: Cm, results: Cr,
- utils: Cu } = Components;
-
-/* global INSTALL_LOCALE, MOZ_APP_NAME, BIN_SUFFIX, MOZ_APP_VENDOR */
-/* global MOZ_APP_BASENAME, APP_BIN_SUFFIX, APP_INFO_NAME, APP_INFO_VENDOR */
-/* global IS_WIN, IS_MACOSX, IS_UNIX, MOZ_VERIFY_MAR_SIGNATURE */
-/* global IS_AUTHENTICODE_CHECK_ENABLED */
-load("../data/xpcshellConstantsPP.js");
-
-function getLogSuffix() {
- if (IS_WIN) {
- return "_win";
- }
- if (IS_MACOSX) {
- return "_mac";
- }
- return "_linux";
-}
-
-Cu.import("resource://gre/modules/Services.jsm", this);
-Cu.import("resource://gre/modules/ctypes.jsm", this);
-
-const DIR_MACOS = IS_MACOSX ? "Contents/MacOS/" : "";
-const DIR_RESOURCES = IS_MACOSX ? "Contents/Resources/" : "";
-const TEST_FILE_SUFFIX = IS_MACOSX ? "_mac" : "";
-const FILE_COMPLETE_MAR = "complete" + TEST_FILE_SUFFIX + ".mar";
-const FILE_PARTIAL_MAR = "partial" + TEST_FILE_SUFFIX + ".mar";
-const FILE_COMPLETE_PRECOMPLETE = "complete_precomplete" + TEST_FILE_SUFFIX;
-const FILE_PARTIAL_PRECOMPLETE = "partial_precomplete" + TEST_FILE_SUFFIX;
-const FILE_COMPLETE_REMOVEDFILES = "complete_removed-files" + TEST_FILE_SUFFIX;
-const FILE_PARTIAL_REMOVEDFILES = "partial_removed-files" + TEST_FILE_SUFFIX;
-const FILE_UPDATE_IN_PROGRESS_LOCK = "updated.update_in_progress.lock";
-const COMPARE_LOG_SUFFIX = getLogSuffix();
-const LOG_COMPLETE_SUCCESS = "complete_log_success" + COMPARE_LOG_SUFFIX;
-const LOG_PARTIAL_SUCCESS = "partial_log_success" + COMPARE_LOG_SUFFIX;
-const LOG_PARTIAL_FAILURE = "partial_log_failure" + COMPARE_LOG_SUFFIX;
-const LOG_REPLACE_SUCCESS = "replace_log_success";
-
-const USE_EXECV = IS_UNIX && !IS_MACOSX;
-
-const URL_HOST = "http://localhost";
-
-const FILE_APP_BIN = MOZ_APP_NAME + APP_BIN_SUFFIX;
-const FILE_COMPLETE_EXE = "complete.exe";
-const FILE_HELPER_BIN = "TestAUSHelper" + BIN_SUFFIX;
-const FILE_MAINTENANCE_SERVICE_BIN = "maintenanceservice.exe";
-const FILE_MAINTENANCE_SERVICE_INSTALLER_BIN = "maintenanceservice_installer.exe";
-const FILE_OLD_VERSION_MAR = "old_version.mar";
-const FILE_PARTIAL_EXE = "partial.exe";
-const FILE_UPDATER_BIN = "updater" + BIN_SUFFIX;
-const FILE_WRONG_CHANNEL_MAR = "wrong_product_channel.mar";
-
-const PERFORMING_STAGED_UPDATE = "Performing a staged update";
-const CALL_QUIT = "calling QuitProgressUI";
-const REMOVE_OLD_DIST_DIR = "removing old distribution directory";
-const MOVE_OLD_DIST_DIR = "Moving old distribution directory to new location";
-const ERR_UPDATE_IN_PROGRESS = "Update already in progress! Exiting";
-const ERR_RENAME_FILE = "rename_file: failed to rename file";
-const ERR_ENSURE_COPY = "ensure_copy: failed to copy the file";
-const ERR_UNABLE_OPEN_DEST = "unable to open destination file";
-const ERR_BACKUP_DISCARD = "backup_discard: unable to remove";
-const ERR_MOVE_DESTDIR_7 = "Moving destDir to tmpDir failed, err: 7";
-const ERR_BACKUP_CREATE_7 = "backup_create failed: 7";
-const ERR_LOADSOURCEFILE_FAILED = "LoadSourceFile failed";
-
-const LOG_SVC_SUCCESSFUL_LAUNCH = "Process was started... waiting on result.";
-
-// Typical end of a message when calling assert
-const MSG_SHOULD_EQUAL = " should equal the expected value";
-const MSG_SHOULD_EXIST = "the file or directory should exist";
-const MSG_SHOULD_NOT_EXIST = "the file or directory should not exist";
-
-// All we care about is that the last modified time has changed so that Mac OS
-// X Launch Services invalidates its cache so the test allows up to one minute
-// difference in the last modified time.
-const MAC_MAX_TIME_DIFFERENCE = 60000;
-
-// How many of do_execute_soon calls to wait before the test is aborted.
-const MAX_TIMEOUT_RUNS = 20000;
-
-// Time in seconds the helper application should sleep before exiting. The
-// helper can also be made to exit by writing |finish| to its input file.
-const HELPER_SLEEP_TIMEOUT = 180;
-
-// Maximum number of milliseconds the process that is launched can run before
-// the test will try to kill it.
-const APP_TIMER_TIMEOUT = 120000;
-
-// How many of do_timeout calls using FILE_IN_USE_TIMEOUT_MS to wait before the
-// test is aborted.
-const FILE_IN_USE_MAX_TIMEOUT_RUNS = 60;
-const FILE_IN_USE_TIMEOUT_MS = 1000;
-
-const PIPE_TO_NULL = IS_WIN ? ">nul" : "> /dev/null 2>&1";
-
-const LOG_FUNCTION = do_print;
-
-const gHTTPHandlerPath = "updates.xml";
-
-// This default value will be overridden when using the http server.
-var gURLData = URL_HOST + "/";
-
-var gTestID;
-
-var gTestserver;
-
-var gRegisteredServiceCleanup;
-
-var gCheckFunc;
-var gResponseBody;
-var gResponseStatusCode = 200;
-var gRequestURL;
-var gUpdateCount;
-var gUpdates;
-var gStatusCode;
-var gStatusText;
-var gStatusResult;
-
-var gProcess;
-var gAppTimer;
-var gHandle;
-
-var gGREDirOrig;
-var gGREBinDirOrig;
-var gAppDirOrig;
-
-// Variables are used instead of contants so tests can override these values if
-// necessary.
-var gCallbackBinFile = "callback_app" + BIN_SUFFIX;
-var gCallbackArgs = ["./", "callback.log", "Test Arg 2", "Test Arg 3"];
-var gPostUpdateBinFile = "postup_app" + BIN_SUFFIX;
-var gSvcOriginalLogContents;
-var gUseTestAppDir = true;
-// Some update staging failures can remove the update. This allows tests to
-// specify that the status file and the active update should not be checked
-// after an update is staged.
-var gStagingRemovedUpdate = false;
-
-var gTimeoutRuns = 0;
-var gFileInUseTimeoutRuns = 0;
-
-// Environment related globals
-var gShouldResetEnv = undefined;
-var gAddedEnvXRENoWindowsCrashDialog = false;
-var gEnvXPCOMDebugBreak;
-var gEnvXPCOMMemLeakLog;
-var gEnvDyldLibraryPath;
-var gEnvLdLibraryPath;
-var gASanOptions;
-
-// Set to true to log additional information for debugging. To log additional
-// information for an individual test set DEBUG_AUS_TEST to true in the test's
-// run_test function.
-var DEBUG_AUS_TEST = true;
-
-const DATA_URI_SPEC = Services.io.newFileURI(do_get_file("../data", false)).spec;
-/* import-globals-from ../data/shared.js */
-Services.scriptloader.loadSubScript(DATA_URI_SPEC + "shared.js", this);
-
-var gTestFiles = [];
-var gTestDirs = [];
-
-// Common files for both successful and failed updates.
-var gTestFilesCommon = [
- {
- description: "Should never change",
- fileName: FILE_UPDATE_SETTINGS_INI,
- relPathDir: DIR_RESOURCES,
- originalContents: UPDATE_SETTINGS_CONTENTS,
- compareContents: UPDATE_SETTINGS_CONTENTS,
- originalFile: null,
- compareFile: null,
- originalPerms: 0o767,
- comparePerms: 0o767
- }, {
- description: "Should never change",
- fileName: "channel-prefs.js",
- relPathDir: DIR_RESOURCES + "defaults/pref/",
- originalContents: "ShouldNotBeReplaced\n",
- compareContents: "ShouldNotBeReplaced\n",
- originalFile: null,
- compareFile: null,
- originalPerms: 0o767,
- comparePerms: 0o767
- }];
-
- // Files for a complete successful update. This can be used for a complete
- // failed update by calling setTestFilesAndDirsForFailure.
-var gTestFilesCompleteSuccess = [
- {
- description: "Added by update.manifest (add)",
- fileName: "precomplete",
- relPathDir: DIR_RESOURCES,
- originalContents: null,
- compareContents: null,
- originalFile: FILE_PARTIAL_PRECOMPLETE,
- compareFile: FILE_COMPLETE_PRECOMPLETE,
- originalPerms: 0o666,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest (add)",
- fileName: "searchpluginstext0",
- relPathDir: DIR_RESOURCES + "searchplugins/",
- originalContents: "ToBeReplacedWithFromComplete\n",
- compareContents: "FromComplete\n",
- originalFile: null,
- compareFile: null,
- originalPerms: 0o775,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest (add)",
- fileName: "searchpluginspng1.png",
- relPathDir: DIR_RESOURCES + "searchplugins/",
- originalContents: null,
- compareContents: null,
- originalFile: null,
- compareFile: "complete.png",
- originalPerms: null,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest (add)",
- fileName: "searchpluginspng0.png",
- relPathDir: DIR_RESOURCES + "searchplugins/",
- originalContents: null,
- compareContents: null,
- originalFile: "partial.png",
- compareFile: "complete.png",
- originalPerms: 0o666,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest (add)",
- fileName: "removed-files",
- relPathDir: DIR_RESOURCES,
- originalContents: null,
- compareContents: null,
- originalFile: FILE_PARTIAL_REMOVEDFILES,
- compareFile: FILE_COMPLETE_REMOVEDFILES,
- originalPerms: 0o666,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest if the parent directory exists (add-if)",
- fileName: "extensions1text0",
- relPathDir: DIR_RESOURCES + "distribution/extensions/extensions1/",
- originalContents: null,
- compareContents: "FromComplete\n",
- originalFile: null,
- compareFile: null,
- originalPerms: null,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest if the parent directory exists (add-if)",
- fileName: "extensions1png1.png",
- relPathDir: DIR_RESOURCES + "distribution/extensions/extensions1/",
- originalContents: null,
- compareContents: null,
- originalFile: "partial.png",
- compareFile: "complete.png",
- originalPerms: 0o666,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest if the parent directory exists (add-if)",
- fileName: "extensions1png0.png",
- relPathDir: DIR_RESOURCES + "distribution/extensions/extensions1/",
- originalContents: null,
- compareContents: null,
- originalFile: null,
- compareFile: "complete.png",
- originalPerms: null,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest if the parent directory exists (add-if)",
- fileName: "extensions0text0",
- relPathDir: DIR_RESOURCES + "distribution/extensions/extensions0/",
- originalContents: "ToBeReplacedWithFromComplete\n",
- compareContents: "FromComplete\n",
- originalFile: null,
- compareFile: null,
- originalPerms: null,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest if the parent directory exists (add-if)",
- fileName: "extensions0png1.png",
- relPathDir: DIR_RESOURCES + "distribution/extensions/extensions0/",
- originalContents: null,
- compareContents: null,
- originalFile: null,
- compareFile: "complete.png",
- originalPerms: null,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest if the parent directory exists (add-if)",
- fileName: "extensions0png0.png",
- relPathDir: DIR_RESOURCES + "distribution/extensions/extensions0/",
- originalContents: null,
- compareContents: null,
- originalFile: null,
- compareFile: "complete.png",
- originalPerms: null,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest (add)",
- fileName: "exe0.exe",
- relPathDir: DIR_MACOS,
- originalContents: null,
- compareContents: null,
- originalFile: FILE_HELPER_BIN,
- compareFile: FILE_COMPLETE_EXE,
- originalPerms: 0o777,
- comparePerms: 0o755
- }, {
- description: "Added by update.manifest (add)",
- fileName: "10text0",
- relPathDir: DIR_RESOURCES + "1/10/",
- originalContents: "ToBeReplacedWithFromComplete\n",
- compareContents: "FromComplete\n",
- originalFile: null,
- compareFile: null,
- originalPerms: 0o767,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest (add)",
- fileName: "0exe0.exe",
- relPathDir: DIR_RESOURCES + "0/",
- originalContents: null,
- compareContents: null,
- originalFile: FILE_HELPER_BIN,
- compareFile: FILE_COMPLETE_EXE,
- originalPerms: 0o777,
- comparePerms: 0o755
- }, {
- description: "Added by update.manifest (add)",
- fileName: "00text1",
- relPathDir: DIR_RESOURCES + "0/00/",
- originalContents: "ToBeReplacedWithFromComplete\n",
- compareContents: "FromComplete\n",
- originalFile: null,
- compareFile: null,
- originalPerms: 0o677,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest (add)",
- fileName: "00text0",
- relPathDir: DIR_RESOURCES + "0/00/",
- originalContents: "ToBeReplacedWithFromComplete\n",
- compareContents: "FromComplete\n",
- originalFile: null,
- compareFile: null,
- originalPerms: 0o775,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest (add)",
- fileName: "00png0.png",
- relPathDir: DIR_RESOURCES + "0/00/",
- originalContents: null,
- compareContents: null,
- originalFile: null,
- compareFile: "complete.png",
- originalPerms: 0o776,
- comparePerms: 0o644
- }, {
- description: "Removed by precomplete (remove)",
- fileName: "20text0",
- relPathDir: DIR_RESOURCES + "2/20/",
- originalContents: "ToBeDeleted\n",
- compareContents: null,
- originalFile: null,
- compareFile: null,
- originalPerms: null,
- comparePerms: null
- }, {
- description: "Removed by precomplete (remove)",
- fileName: "20png0.png",
- relPathDir: DIR_RESOURCES + "2/20/",
- originalContents: "ToBeDeleted\n",
- compareContents: null,
- originalFile: null,
- compareFile: null,
- originalPerms: null,
- comparePerms: null
- }];
-
-// Concatenate the common files to the end of the array.
-gTestFilesCompleteSuccess = gTestFilesCompleteSuccess.concat(gTestFilesCommon);
-
-// Files for a partial successful update. This can be used for a partial failed
-// update by calling setTestFilesAndDirsForFailure.
-var gTestFilesPartialSuccess = [
- {
- description: "Added by update.manifest (add)",
- fileName: "precomplete",
- relPathDir: DIR_RESOURCES,
- originalContents: null,
- compareContents: null,
- originalFile: FILE_COMPLETE_PRECOMPLETE,
- compareFile: FILE_PARTIAL_PRECOMPLETE,
- originalPerms: 0o666,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest (add)",
- fileName: "searchpluginstext0",
- relPathDir: DIR_RESOURCES + "searchplugins/",
- originalContents: "ToBeReplacedWithFromPartial\n",
- compareContents: "FromPartial\n",
- originalFile: null,
- compareFile: null,
- originalPerms: 0o775,
- comparePerms: 0o644
- }, {
- description: "Patched by update.manifest if the file exists (patch-if)",
- fileName: "searchpluginspng1.png",
- relPathDir: DIR_RESOURCES + "searchplugins/",
- originalContents: null,
- compareContents: null,
- originalFile: "complete.png",
- compareFile: "partial.png",
- originalPerms: 0o666,
- comparePerms: 0o666
- }, {
- description: "Patched by update.manifest if the file exists (patch-if)",
- fileName: "searchpluginspng0.png",
- relPathDir: DIR_RESOURCES + "searchplugins/",
- originalContents: null,
- compareContents: null,
- originalFile: "complete.png",
- compareFile: "partial.png",
- originalPerms: 0o666,
- comparePerms: 0o666
- }, {
- description: "Added by update.manifest if the parent directory exists (add-if)",
- fileName: "extensions1text0",
- relPathDir: DIR_RESOURCES + "distribution/extensions/extensions1/",
- originalContents: null,
- compareContents: "FromPartial\n",
- originalFile: null,
- compareFile: null,
- originalPerms: null,
- comparePerms: 0o644
- }, {
- description: "Patched by update.manifest if the parent directory exists (patch-if)",
- fileName: "extensions1png1.png",
- relPathDir: DIR_RESOURCES + "distribution/extensions/extensions1/",
- originalContents: null,
- compareContents: null,
- originalFile: "complete.png",
- compareFile: "partial.png",
- originalPerms: 0o666,
- comparePerms: 0o666
- }, {
- description: "Patched by update.manifest if the parent directory exists (patch-if)",
- fileName: "extensions1png0.png",
- relPathDir: DIR_RESOURCES + "distribution/extensions/extensions1/",
- originalContents: null,
- compareContents: null,
- originalFile: "complete.png",
- compareFile: "partial.png",
- originalPerms: 0o666,
- comparePerms: 0o666
- }, {
- description: "Added by update.manifest if the parent directory exists (add-if)",
- fileName: "extensions0text0",
- relPathDir: DIR_RESOURCES + "distribution/extensions/extensions0/",
- originalContents: "ToBeReplacedWithFromPartial\n",
- compareContents: "FromPartial\n",
- originalFile: null,
- compareFile: null,
- originalPerms: 0o644,
- comparePerms: 0o644
- }, {
- description: "Patched by update.manifest if the parent directory exists (patch-if)",
- fileName: "extensions0png1.png",
- relPathDir: DIR_RESOURCES + "distribution/extensions/extensions0/",
- originalContents: null,
- compareContents: null,
- originalFile: "complete.png",
- compareFile: "partial.png",
- originalPerms: 0o644,
- comparePerms: 0o644
- }, {
- description: "Patched by update.manifest if the parent directory exists (patch-if)",
- fileName: "extensions0png0.png",
- relPathDir: DIR_RESOURCES + "distribution/extensions/extensions0/",
- originalContents: null,
- compareContents: null,
- originalFile: "complete.png",
- compareFile: "partial.png",
- originalPerms: 0o644,
- comparePerms: 0o644
- }, {
- description: "Patched by update.manifest (patch)",
- fileName: "exe0.exe",
- relPathDir: DIR_MACOS,
- originalContents: null,
- compareContents: null,
- originalFile: FILE_COMPLETE_EXE,
- compareFile: FILE_PARTIAL_EXE,
- originalPerms: 0o755,
- comparePerms: 0o755
- }, {
- description: "Patched by update.manifest (patch)",
- fileName: "0exe0.exe",
- relPathDir: DIR_RESOURCES + "0/",
- originalContents: null,
- compareContents: null,
- originalFile: FILE_COMPLETE_EXE,
- compareFile: FILE_PARTIAL_EXE,
- originalPerms: 0o755,
- comparePerms: 0o755
- }, {
- description: "Added by update.manifest (add)",
- fileName: "00text0",
- relPathDir: DIR_RESOURCES + "0/00/",
- originalContents: "ToBeReplacedWithFromPartial\n",
- compareContents: "FromPartial\n",
- originalFile: null,
- compareFile: null,
- originalPerms: 0o644,
- comparePerms: 0o644
- }, {
- description: "Patched by update.manifest (patch)",
- fileName: "00png0.png",
- relPathDir: DIR_RESOURCES + "0/00/",
- originalContents: null,
- compareContents: null,
- originalFile: "complete.png",
- compareFile: "partial.png",
- originalPerms: 0o666,
- comparePerms: 0o666
- }, {
- description: "Added by update.manifest (add)",
- fileName: "20text0",
- relPathDir: DIR_RESOURCES + "2/20/",
- originalContents: null,
- compareContents: "FromPartial\n",
- originalFile: null,
- compareFile: null,
- originalPerms: null,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest (add)",
- fileName: "20png0.png",
- relPathDir: DIR_RESOURCES + "2/20/",
- originalContents: null,
- compareContents: null,
- originalFile: null,
- compareFile: "partial.png",
- originalPerms: null,
- comparePerms: 0o644
- }, {
- description: "Added by update.manifest (add)",
- fileName: "00text2",
- relPathDir: DIR_RESOURCES + "0/00/",
- originalContents: null,
- compareContents: "FromPartial\n",
- originalFile: null,
- compareFile: null,
- originalPerms: null,
- comparePerms: 0o644
- }, {
- description: "Removed by update.manifest (remove)",
- fileName: "10text0",
- relPathDir: DIR_RESOURCES + "1/10/",
- originalContents: "ToBeDeleted\n",
- compareContents: null,
- originalFile: null,
- compareFile: null,
- originalPerms: null,
- comparePerms: null
- }, {
- description: "Removed by update.manifest (remove)",
- fileName: "00text1",
- relPathDir: DIR_RESOURCES + "0/00/",
- originalContents: "ToBeDeleted\n",
- compareContents: null,
- originalFile: null,
- compareFile: null,
- originalPerms: null,
- comparePerms: null
- }];
-
-// Concatenate the common files to the end of the array.
-gTestFilesPartialSuccess = gTestFilesPartialSuccess.concat(gTestFilesCommon);
-
-var gTestDirsCommon = [
- {
- relPathDir: DIR_RESOURCES + "3/",
- dirRemoved: false,
- files: ["3text0", "3text1"],
- filesRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "4/",
- dirRemoved: true,
- files: ["4text0", "4text1"],
- filesRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "5/",
- dirRemoved: true,
- files: ["5test.exe", "5text0", "5text1"],
- filesRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "6/",
- dirRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "7/",
- dirRemoved: true,
- files: ["7text0", "7text1"],
- subDirs: ["70/", "71/"],
- subDirFiles: ["7xtest.exe", "7xtext0", "7xtext1"]
- }, {
- relPathDir: DIR_RESOURCES + "8/",
- dirRemoved: false
- }, {
- relPathDir: DIR_RESOURCES + "8/80/",
- dirRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "8/81/",
- dirRemoved: false,
- files: ["81text0", "81text1"]
- }, {
- relPathDir: DIR_RESOURCES + "8/82/",
- dirRemoved: false,
- subDirs: ["820/", "821/"]
- }, {
- relPathDir: DIR_RESOURCES + "8/83/",
- dirRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "8/84/",
- dirRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "8/85/",
- dirRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "8/86/",
- dirRemoved: true,
- files: ["86text0", "86text1"]
- }, {
- relPathDir: DIR_RESOURCES + "8/87/",
- dirRemoved: true,
- subDirs: ["870/", "871/"],
- subDirFiles: ["87xtext0", "87xtext1"]
- }, {
- relPathDir: DIR_RESOURCES + "8/88/",
- dirRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "8/89/",
- dirRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "9/90/",
- dirRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "9/91/",
- dirRemoved: false,
- files: ["91text0", "91text1"]
- }, {
- relPathDir: DIR_RESOURCES + "9/92/",
- dirRemoved: false,
- subDirs: ["920/", "921/"]
- }, {
- relPathDir: DIR_RESOURCES + "9/93/",
- dirRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "9/94/",
- dirRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "9/95/",
- dirRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "9/96/",
- dirRemoved: true,
- files: ["96text0", "96text1"]
- }, {
- relPathDir: DIR_RESOURCES + "9/97/",
- dirRemoved: true,
- subDirs: ["970/", "971/"],
- subDirFiles: ["97xtext0", "97xtext1"]
- }, {
- relPathDir: DIR_RESOURCES + "9/98/",
- dirRemoved: true
- }, {
- relPathDir: DIR_RESOURCES + "9/99/",
- dirRemoved: true
- }];
-
-// Directories for a complete successful update. This array can be used for a
-// complete failed update by calling setTestFilesAndDirsForFailure.
-var gTestDirsCompleteSuccess = [
- {
- description: "Removed by precomplete (rmdir)",
- relPathDir: DIR_RESOURCES + "2/20/",
- dirRemoved: true
- }, {
- description: "Removed by precomplete (rmdir)",
- relPathDir: DIR_RESOURCES + "2/",
- dirRemoved: true
- }];
-
-// Concatenate the common files to the beginning of the array.
-gTestDirsCompleteSuccess = gTestDirsCommon.concat(gTestDirsCompleteSuccess);
-
-// Directories for a partial successful update. This array can be used for a
-// partial failed update by calling setTestFilesAndDirsForFailure.
-var gTestDirsPartialSuccess = [
- {
- description: "Removed by update.manifest (rmdir)",
- relPathDir: DIR_RESOURCES + "1/10/",
- dirRemoved: true
- }, {
- description: "Removed by update.manifest (rmdir)",
- relPathDir: DIR_RESOURCES + "1/",
- dirRemoved: true
- }];
-
-// Concatenate the common files to the beginning of the array.
-gTestDirsPartialSuccess = gTestDirsCommon.concat(gTestDirsPartialSuccess);
-
-// This makes it possible to run most tests on xulrunner where the update
-// channel default preference is not set.
-if (MOZ_APP_NAME == "xulrunner") {
- try {
- gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
- } catch (e) {
- setUpdateChannel("test_channel");
- }
-}
-
-/**
- * Helper function for setting up the test environment.
- */
-function setupTestCommon() {
- debugDump("start - general test setup");
-
- Assert.strictEqual(gTestID, undefined,
- "gTestID should be 'undefined' (setupTestCommon should " +
- "only be called once)");
-
- let caller = Components.stack.caller;
- gTestID = caller.filename.toString().split("/").pop().split(".")[0];
-
- // Tests that don't work with XULRunner.
- const XUL_RUNNER_INCOMPATIBLE = ["marAppApplyUpdateAppBinInUseStageSuccess_win",
- "marAppApplyUpdateStageSuccess",
- "marAppApplyUpdateSuccess",
- "marAppApplyUpdateAppBinInUseStageSuccessSvc_win",
- "marAppApplyUpdateStageSuccessSvc",
- "marAppApplyUpdateSuccessSvc"];
- // Replace with Array.prototype.includes when it has stabilized.
- if (MOZ_APP_NAME == "xulrunner" &&
- XUL_RUNNER_INCOMPATIBLE.indexOf(gTestID) != -1) {
- logTestInfo("Unable to run this test on xulrunner");
- return false;
- }
-
- if (IS_SERVICE_TEST && !shouldRunServiceTest()) {
- return false;
- }
-
- do_test_pending();
-
- setDefaultPrefs();
-
- // Don't attempt to show a prompt when an update finishes.
- Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, true);
-
- gGREDirOrig = getGREDir();
- gGREBinDirOrig = getGREBinDir();
- gAppDirOrig = getAppBaseDir();
-
- let applyDir = getApplyDirFile(null, true).parent;
-
- // Try to remove the directory used to apply updates and the updates directory
- // on platforms other than Windows. Since the test hasn't ran yet and the
- // directory shouldn't exist finished this is non-fatal for the test.
- if (applyDir.exists()) {
- debugDump("attempting to remove directory. Path: " + applyDir.path);
- try {
- removeDirRecursive(applyDir);
- } catch (e) {
- logTestInfo("non-fatal error removing directory. Path: " +
- applyDir.path + ", Exception: " + e);
- // When the application doesn't exit properly it can cause the test to
- // fail again on the second run with an NS_ERROR_FILE_ACCESS_DENIED error
- // along with no useful information in the test log. To prevent this use
- // a different directory for the test when it isn't possible to remove the
- // existing test directory (bug 1294196).
- gTestID += "_new";
- logTestInfo("using a new directory for the test by changing gTestID " +
- "since there is an existing test directory that can't be " +
- "removed, gTestID: " + gTestID);
- }
- }
-
- if (IS_WIN) {
- Services.prefs.setBoolPref(PREF_APP_UPDATE_SERVICE_ENABLED,
- IS_SERVICE_TEST ? true : false);
- }
-
- // adjustGeneralPaths registers a cleanup function that calls end_test when
- // it is defined as a function.
- adjustGeneralPaths();
- // Logged once here instead of in the mock directory provider to lessen test
- // log spam.
- debugDump("Updates Directory (UpdRootD) Path: " + getMockUpdRootD().path);
-
- // This prevents a warning about not being able to find the greprefs.js file
- // from being logged.
- let grePrefsFile = getGREDir();
- if (!grePrefsFile.exists()) {
- grePrefsFile.create(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
- }
- grePrefsFile.append("goanna.js");
- if (!grePrefsFile.exists()) {
- grePrefsFile.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, PERMS_FILE);
- }
-
- // Remove the updates directory on Windows and Mac OS X which is located
- // outside of the application directory after the call to adjustGeneralPaths
- // has set it up. Since the test hasn't ran yet and the directory shouldn't
- // exist this is non-fatal for the test.
- if (IS_WIN || IS_MACOSX) {
- let updatesDir = getMockUpdRootD();
- if (updatesDir.exists()) {
- debugDump("attempting to remove directory. Path: " + updatesDir.path);
- try {
- removeDirRecursive(updatesDir);
- } catch (e) {
- logTestInfo("non-fatal error removing directory. Path: " +
- updatesDir.path + ", Exception: " + e);
- }
- }
- }
-
- debugDump("finish - general test setup");
- return true;
-}
-
-/**
- * Nulls out the most commonly used global vars used by tests to prevent leaks
- * as needed and attempts to restore the system to its original state.
- */
-function cleanupTestCommon() {
- debugDump("start - general test cleanup");
-
- // Force the update manager to reload the update data to prevent it from
- // writing the old data to the files that have just been removed.
- reloadUpdateManagerData();
-
- if (gChannel) {
- gPrefRoot.removeObserver(PREF_APP_UPDATE_CHANNEL, observer);
- }
-
- // Call app update's observe method passing xpcom-shutdown to test that the
- // shutdown of app update runs without throwing or leaking. The observer
- // method is used directly instead of calling notifyObservers so components
- // outside of the scope of this test don't assert and thereby cause app update
- // tests to fail.
- gAUS.observe(null, "xpcom-shutdown", "");
-
- gTestserver = null;
-
- if (IS_UNIX) {
- // This will delete the launch script if it exists.
- getLaunchScript();
- }
-
- if (IS_WIN && MOZ_APP_BASENAME) {
- let appDir = getApplyDirFile(null, true);
- let vendor = MOZ_APP_VENDOR ? MOZ_APP_VENDOR : "Mozilla";
- const REG_PATH = "SOFTWARE\\" + vendor + "\\" + MOZ_APP_BASENAME +
- "\\TaskBarIDs";
- let key = Cc["@mozilla.org/windows-registry-key;1"].
- createInstance(Ci.nsIWindowsRegKey);
- try {
- key.open(Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE, REG_PATH,
- Ci.nsIWindowsRegKey.ACCESS_ALL);
- if (key.hasValue(appDir.path)) {
- key.removeValue(appDir.path);
- }
- } catch (e) {
- }
- try {
- key.open(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, REG_PATH,
- Ci.nsIWindowsRegKey.ACCESS_ALL);
- if (key.hasValue(appDir.path)) {
- key.removeValue(appDir.path);
- }
- } catch (e) {
- }
- }
-
- // The updates directory is located outside of the application directory and
- // needs to be removed on Windows and Mac OS X.
- if (IS_WIN || IS_MACOSX) {
- let updatesDir = getMockUpdRootD();
- // Try to remove the directory used to apply updates. Since the test has
- // already finished this is non-fatal for the test.
- if (updatesDir.exists()) {
- debugDump("attempting to remove directory. Path: " + updatesDir.path);
- try {
- removeDirRecursive(updatesDir);
- } catch (e) {
- logTestInfo("non-fatal error removing directory. Path: " +
- updatesDir.path + ", Exception: " + e);
- }
- if (IS_MACOSX) {
- let updatesRootDir = gUpdatesRootDir.clone();
- while (updatesRootDir.path != updatesDir.path) {
- if (updatesDir.exists()) {
- debugDump("attempting to remove directory. Path: " +
- updatesDir.path);
- try {
- // Try to remove the directory without the recursive flag set
- // since the top level directory has already had its contents
- // removed and the parent directory might still be used by a
- // different test.
- updatesDir.remove(false);
- } catch (e) {
- logTestInfo("non-fatal error removing directory. Path: " +
- updatesDir.path + ", Exception: " + e);
- if (e == Cr.NS_ERROR_FILE_DIR_NOT_EMPTY) {
- break;
- }
- }
- }
- updatesDir = updatesDir.parent;
- }
- }
- }
- }
-
- let applyDir = getApplyDirFile(null, true).parent;
-
- // Try to remove the directory used to apply updates. Since the test has
- // already finished this is non-fatal for the test.
- if (applyDir.exists()) {
- debugDump("attempting to remove directory. Path: " + applyDir.path);
- try {
- removeDirRecursive(applyDir);
- } catch (e) {
- logTestInfo("non-fatal error removing directory. Path: " +
- applyDir.path + ", Exception: " + e);
- }
- }
-
- resetEnvironment();
-
- debugDump("finish - general test cleanup");
-}
-
-/**
- * Helper function that calls do_test_finished that tracks whether a parallel
- * run of a test passed when it runs synchronously so the log output can be
- * inspected.
- */
-function doTestFinish() {
- if (DEBUG_AUS_TEST) {
- // This prevents do_print errors from being printed by the xpcshell test
- // harness due to nsUpdateService.js logging to the console when the
- // app.update.log preference is true.
- Services.prefs.setBoolPref(PREF_APP_UPDATE_LOG, false);
- gAUS.observe(null, "nsPref:changed", PREF_APP_UPDATE_LOG);
- }
- do_execute_soon(do_test_finished);
-}
-
-/**
- * Sets the most commonly used preferences used by tests
- */
-function setDefaultPrefs() {
- Services.prefs.setBoolPref(PREF_APP_UPDATE_ENABLED, true);
- if (DEBUG_AUS_TEST) {
- // Enable Update logging
- Services.prefs.setBoolPref(PREF_APP_UPDATE_LOG, true);
- } else {
- // Some apps set this preference to true by default
- Services.prefs.setBoolPref(PREF_APP_UPDATE_LOG, false);
- }
- // In case telemetry is enabled for xpcshell tests.
- Services.prefs.setBoolPref(PREF_TOOLKIT_TELEMETRY_ENABLED, false);
-}
-
-/**
- * Helper function for updater binary tests that sets the appropriate values
- * to check for update failures.
- */
-function setTestFilesAndDirsForFailure() {
- gTestFiles.forEach(function STFADFF_Files(aTestFile) {
- aTestFile.compareContents = aTestFile.originalContents;
- aTestFile.compareFile = aTestFile.originalFile;
- aTestFile.comparePerms = aTestFile.originalPerms;
- });
-
- gTestDirs.forEach(function STFADFF_Dirs(aTestDir) {
- aTestDir.dirRemoved = false;
- if (aTestDir.filesRemoved) {
- aTestDir.filesRemoved = false;
- }
- });
-}
-
-/**
- * Helper function for updater binary tests that prevents the distribution
- * directory files from being created.
- */
-function preventDistributionFiles() {
- gTestFiles = gTestFiles.filter(function(aTestFile) {
- return aTestFile.relPathDir.indexOf("distribution/") == -1;
- });
-
- gTestDirs = gTestDirs.filter(function(aTestDir) {
- return aTestDir.relPathDir.indexOf("distribution/") == -1;
- });
-}
-
-/**
- * On Mac OS X this sets the last modified time for the app bundle directory to
- * a date in the past to test that the last modified time is updated when an
- * update has been successfully applied (bug 600098).
- */
-function setAppBundleModTime() {
- if (!IS_MACOSX) {
- return;
- }
- let now = Date.now();
- let yesterday = now - (1000 * 60 * 60 * 24);
- let applyToDir = getApplyDirFile();
- applyToDir.lastModifiedTime = yesterday;
-}
-
-/**
- * On Mac OS X this checks that the last modified time for the app bundle
- * directory has been updated when an update has been successfully applied
- * (bug 600098).
- */
-function checkAppBundleModTime() {
- if (!IS_MACOSX) {
- return;
- }
- let now = Date.now();
- let applyToDir = getApplyDirFile();
- let timeDiff = Math.abs(applyToDir.lastModifiedTime - now);
- Assert.ok(timeDiff < MAC_MAX_TIME_DIFFERENCE,
- "the last modified time on the apply to directory should " +
- "change after a successful update");
-}
-
-/**
- * On Mac OS X and Windows this checks if the post update '.running' file exists
- * to determine if the post update binary was launched.
- *
- * @param aShouldExist
- * Whether the post update '.running' file should exist.
- */
-function checkPostUpdateRunningFile(aShouldExist) {
- if (!IS_WIN && !IS_MACOSX) {
- return;
- }
- let postUpdateRunningFile = getPostUpdateFile(".running");
- if (aShouldExist) {
- Assert.ok(postUpdateRunningFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(postUpdateRunningFile.path));
- } else {
- Assert.ok(!postUpdateRunningFile.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(postUpdateRunningFile.path));
- }
-}
-
-/**
- * Initializes the most commonly used settings and creates an instance of the
- * update service stub.
- */
-function standardInit() {
- createAppInfo("xpcshell@tests.mozilla.org", APP_INFO_NAME, "1.0", "2.0");
- // Initialize the update service stub component
- initUpdateServiceStub();
-}
-
-/**
- * Helper function for getting the application version from the application.ini
- * file. This will look in both the GRE and the application directories for the
- * application.ini file.
- *
- * @return The version string from the application.ini file.
- */
-function getAppVersion() {
- // Read the application.ini and use its application version.
- let iniFile = gGREDirOrig.clone();
- iniFile.append(FILE_APPLICATION_INI);
- if (!iniFile.exists()) {
- iniFile = gGREBinDirOrig.clone();
- iniFile.append(FILE_APPLICATION_INI);
- }
- Assert.ok(iniFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(iniFile.path));
- let iniParser = Cc["@mozilla.org/xpcom/ini-parser-factory;1"].
- getService(Ci.nsIINIParserFactory).
- createINIParser(iniFile);
- return iniParser.getString("App", "Version");
-}
-
-/**
- * Helper function for getting the relative path to the directory where the
- * application binary is located (e.g. <test_file_leafname>/dir.app/).
- *
- * Note: The dir.app subdirectory under <test_file_leafname> is needed for
- * platforms other than Mac OS X so the tests can run in parallel due to
- * update staging creating a lock file named moz_update_in_progress.lock in
- * the parent directory of the installation directory.
- *
- * @return The relative path to the directory where application binary is
- * located.
- */
-function getApplyDirPath() {
- return gTestID + "/dir.app/";
-}
-
-/**
- * Helper function for getting the nsIFile for a file in the directory where the
- * update will be applied.
- *
- * The files for the update are located two directories below the apply to
- * directory since Mac OS X sets the last modified time for the root directory
- * to the current time and if the update changes any files in the root directory
- * then it wouldn't be possible to test (bug 600098).
- *
- * @param aRelPath (optional)
- * The relative path to the file or directory to get from the root of
- * the test's directory. If not specified the test's directory will be
- * returned.
- * @param aAllowNonexistent (optional)
- * Whether the file must exist. If false or not specified the file must
- * exist or the function will throw.
- * @return The nsIFile for the file in the directory where the update will be
- * applied.
- * @throws If aAllowNonexistent is not specified or is false and the file or
- * directory does not exist.
- */
-function getApplyDirFile(aRelPath, aAllowNonexistent) {
- let relpath = getApplyDirPath() + (aRelPath ? aRelPath : "");
- return do_get_file(relpath, aAllowNonexistent);
-}
-
-/**
- * Helper function for getting the nsIFile for a file in the directory where the
- * update will be staged.
- *
- * The files for the update are located two directories below the stage
- * directory since Mac OS X sets the last modified time for the root directory
- * to the current time and if the update changes any files in the root directory
- * then it wouldn't be possible to test (bug 600098).
- *
- * @param aRelPath (optional)
- * The relative path to the file or directory to get from the root of
- * the stage directory. If not specified the stage directory will be
- * returned.
- * @param aAllowNonexistent (optional)
- * Whether the file must exist. If false or not specified the file must
- * exist or the function will throw.
- * @return The nsIFile for the file in the directory where the update will be
- * staged.
- * @throws If aAllowNonexistent is not specified or is false and the file or
- * directory does not exist.
- */
-function getStageDirFile(aRelPath, aAllowNonexistent) {
- if (IS_MACOSX) {
- let file = getMockUpdRootD();
- file.append(DIR_UPDATES);
- file.append(DIR_PATCH);
- file.append(DIR_UPDATED);
- if (aRelPath) {
- let pathParts = aRelPath.split("/");
- for (let i = 0; i < pathParts.length; i++) {
- if (pathParts[i]) {
- file.append(pathParts[i]);
- }
- }
- }
- if (!aAllowNonexistent) {
- Assert.ok(file.exists(),
- MSG_SHOULD_EXIST + getMsgPath(file.path));
- }
- return file;
- }
-
- let relpath = getApplyDirPath() + DIR_UPDATED + "/" + (aRelPath ? aRelPath : "");
- return do_get_file(relpath, aAllowNonexistent);
-}
-
-/**
- * Helper function for getting the relative path to the directory where the
- * test data files are located.
- *
- * @return The relative path to the directory where the test data files are
- * located.
- */
-function getTestDirPath() {
- return "../data/";
-}
-
-/**
- * Helper function for getting the nsIFile for a file in the test data
- * directory.
- *
- * @param aRelPath (optional)
- * The relative path to the file or directory to get from the root of
- * the test's data directory. If not specified the test's data
- * directory will be returned.
- * @param aAllowNonExists (optional)
- * Whether or not to throw an error if the path exists.
- * If not specified, then false is used.
- * @return The nsIFile for the file in the test data directory.
- * @throws If the file or directory does not exist.
- */
-function getTestDirFile(aRelPath, aAllowNonExists) {
- let relpath = getTestDirPath() + (aRelPath ? aRelPath : "");
- return do_get_file(relpath, !!aAllowNonExists);
-}
-
-/**
- * Helper function for getting the nsIFile for the maintenance service
- * directory on Windows.
- *
- * @return The nsIFile for the maintenance service directory.
- */
-function getMaintSvcDir() {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- const CSIDL_PROGRAM_FILES = 0x26;
- const CSIDL_PROGRAM_FILESX86 = 0x2A;
- // This will return an empty string on our Win XP build systems.
- let maintSvcDir = getSpecialFolderDir(CSIDL_PROGRAM_FILESX86);
- if (maintSvcDir) {
- maintSvcDir.append("Mozilla Maintenance Service");
- debugDump("using CSIDL_PROGRAM_FILESX86 - maintenance service install " +
- "directory path: " + maintSvcDir.path);
- }
- if (!maintSvcDir || !maintSvcDir.exists()) {
- maintSvcDir = getSpecialFolderDir(CSIDL_PROGRAM_FILES);
- if (maintSvcDir) {
- maintSvcDir.append("Mozilla Maintenance Service");
- debugDump("using CSIDL_PROGRAM_FILES - maintenance service install " +
- "directory path: " + maintSvcDir.path);
- }
- }
- if (!maintSvcDir) {
- do_throw("Unable to find the maintenance service install directory");
- }
-
- return maintSvcDir;
-}
-
-/**
- * Get the nsILocalFile for a Windows special folder determined by the CSIDL
- * passed.
- *
- * @param aCSIDL
- * The CSIDL for the Windows special folder.
- * @return The nsILocalFile for the Windows special folder.
- * @throws If called from a platform other than Windows.
- */
-function getSpecialFolderDir(aCSIDL) {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- let lib = ctypes.open("shell32");
- let SHGetSpecialFolderPath = lib.declare("SHGetSpecialFolderPathW",
- ctypes.winapi_abi,
- ctypes.bool, /* bool(return) */
- ctypes.int32_t, /* HWND hwndOwner */
- ctypes.char16_t.ptr, /* LPTSTR lpszPath */
- ctypes.int32_t, /* int csidl */
- ctypes.bool /* BOOL fCreate */);
-
- let aryPath = ctypes.char16_t.array()(260);
- let rv = SHGetSpecialFolderPath(0, aryPath, aCSIDL, false);
- lib.close();
-
- let path = aryPath.readString(); // Convert the c-string to js-string
- if (!path) {
- return null;
- }
- debugDump("SHGetSpecialFolderPath returned path: " + path);
- let dir = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
- dir.initWithPath(path);
- return dir;
-}
-
-XPCOMUtils.defineLazyGetter(this, "gInstallDirPathHash", function test_gIDPH() {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- // Figure out where we should check for a cached hash value
- if (!MOZ_APP_BASENAME) {
- return null;
- }
-
- let vendor = MOZ_APP_VENDOR ? MOZ_APP_VENDOR : "Mozilla";
- let appDir = getApplyDirFile(null, true);
-
- const REG_PATH = "SOFTWARE\\" + vendor + "\\" + MOZ_APP_BASENAME +
- "\\TaskBarIDs";
- let regKey = Cc["@mozilla.org/windows-registry-key;1"].
- createInstance(Ci.nsIWindowsRegKey);
- try {
- regKey.open(Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE, REG_PATH,
- Ci.nsIWindowsRegKey.ACCESS_ALL);
- regKey.writeStringValue(appDir.path, gTestID);
- return gTestID;
- } catch (e) {
- }
-
- try {
- regKey.create(Ci.nsIWindowsRegKey.ROOT_KEY_CURRENT_USER, REG_PATH,
- Ci.nsIWindowsRegKey.ACCESS_ALL);
- regKey.writeStringValue(appDir.path, gTestID);
- return gTestID;
- } catch (e) {
- logTestInfo("failed to create registry key. Registry Path: " + REG_PATH +
- ", Key Name: " + appDir.path + ", Key Value: " + gTestID +
- ", Exception " + e);
- }
- return null;
-});
-
-XPCOMUtils.defineLazyGetter(this, "gLocalAppDataDir", function test_gLADD() {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- const CSIDL_LOCAL_APPDATA = 0x1c;
- return getSpecialFolderDir(CSIDL_LOCAL_APPDATA);
-});
-
-XPCOMUtils.defineLazyGetter(this, "gProgFilesDir", function test_gPFD() {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- const CSIDL_PROGRAM_FILES = 0x26;
- return getSpecialFolderDir(CSIDL_PROGRAM_FILES);
-});
-
-/**
- * Helper function for getting the update root directory used by the tests. This
- * returns the same directory as returned by nsXREDirProvider::GetUpdateRootDir
- * in nsXREDirProvider.cpp so an application will be able to find the update
- * when running a test that launches the application.
- */
-function getMockUpdRootD() {
- if (IS_WIN) {
- return getMockUpdRootDWin();
- }
-
- if (IS_MACOSX) {
- return getMockUpdRootDMac();
- }
-
- return getApplyDirFile(DIR_MACOS, true);
-}
-
-/**
- * Helper function for getting the update root directory used by the tests. This
- * returns the same directory as returned by nsXREDirProvider::GetUpdateRootDir
- * in nsXREDirProvider.cpp so an application will be able to find the update
- * when running a test that launches the application.
- */
-function getMockUpdRootDWin() {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- let localAppDataDir = gLocalAppDataDir.clone();
- let progFilesDir = gProgFilesDir.clone();
- let appDir = Services.dirsvc.get(XRE_EXECUTABLE_FILE, Ci.nsIFile).parent;
-
- let appDirPath = appDir.path;
- let relPathUpdates = "";
- if (gInstallDirPathHash && (MOZ_APP_VENDOR || MOZ_APP_BASENAME)) {
- relPathUpdates += (MOZ_APP_VENDOR ? MOZ_APP_VENDOR : MOZ_APP_BASENAME) +
- "\\" + DIR_UPDATES + "\\" + gInstallDirPathHash;
- }
-
- if (!relPathUpdates && progFilesDir) {
- if (appDirPath.length > progFilesDir.path.length) {
- if (appDirPath.substr(0, progFilesDir.path.length) == progFilesDir.path) {
- if (MOZ_APP_VENDOR && MOZ_APP_BASENAME) {
- relPathUpdates += MOZ_APP_VENDOR + "\\" + MOZ_APP_BASENAME;
- } else {
- relPathUpdates += MOZ_APP_BASENAME;
- }
- relPathUpdates += appDirPath.substr(progFilesDir.path.length);
- }
- }
- }
-
- if (!relPathUpdates) {
- if (MOZ_APP_VENDOR && MOZ_APP_BASENAME) {
- relPathUpdates += MOZ_APP_VENDOR + "\\" + MOZ_APP_BASENAME;
- } else {
- relPathUpdates += MOZ_APP_BASENAME;
- }
- relPathUpdates += "\\" + MOZ_APP_NAME;
- }
-
- let updatesDir = Cc["@mozilla.org/file/local;1"].
- createInstance(Ci.nsILocalFile);
- updatesDir.initWithPath(localAppDataDir.path + "\\" + relPathUpdates);
- return updatesDir;
-}
-
-XPCOMUtils.defineLazyGetter(this, "gUpdatesRootDir", function test_gURD() {
- if (!IS_MACOSX) {
- do_throw("Mac OS X only function called by a different platform!");
- }
-
- let dir = Services.dirsvc.get("ULibDir", Ci.nsILocalFile);
- dir.append("Caches");
- if (MOZ_APP_VENDOR || MOZ_APP_BASENAME) {
- dir.append(MOZ_APP_VENDOR ? MOZ_APP_VENDOR : MOZ_APP_BASENAME);
- } else {
- dir.append("Mozilla");
- }
- dir.append(DIR_UPDATES);
- return dir;
-});
-
-/**
- * Helper function for getting the update root directory used by the tests. This
- * returns the same directory as returned by nsXREDirProvider::GetUpdateRootDir
- * in nsXREDirProvider.cpp so an application will be able to find the update
- * when running a test that launches the application.
- */
-function getMockUpdRootDMac() {
- if (!IS_MACOSX) {
- do_throw("Mac OS X only function called by a different platform!");
- }
-
- let appDir = Services.dirsvc.get(XRE_EXECUTABLE_FILE, Ci.nsIFile).
- parent.parent.parent;
- let appDirPath = appDir.path;
- appDirPath = appDirPath.substr(0, appDirPath.length - 4);
-
- let pathUpdates = gUpdatesRootDir.path + appDirPath;
- let updatesDir = Cc["@mozilla.org/file/local;1"].
- createInstance(Ci.nsILocalFile);
- updatesDir.initWithPath(pathUpdates);
- return updatesDir;
-}
-
-/**
- * Creates an update in progress lock file in the specified directory on
- * Windows.
- *
- * @param aDir
- * The nsIFile for the directory where the lock file should be created.
- */
-function createUpdateInProgressLockFile(aDir) {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- let file = aDir.clone();
- file.append(FILE_UPDATE_IN_PROGRESS_LOCK);
- file.create(file.NORMAL_FILE_TYPE, 0o444);
- file.QueryInterface(Ci.nsILocalFileWin);
- file.fileAttributesWin |= file.WFA_READONLY;
- file.fileAttributesWin &= ~file.WFA_READWRITE;
- Assert.ok(file.exists(),
- MSG_SHOULD_EXIST + getMsgPath(file.path));
- Assert.ok(!file.isWritable(),
- "the lock file should not be writeable");
-}
-
-/**
- * Removes an update in progress lock file in the specified directory on
- * Windows.
- *
- * @param aDir
- * The nsIFile for the directory where the lock file is located.
- */
-function removeUpdateInProgressLockFile(aDir) {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- let file = aDir.clone();
- file.append(FILE_UPDATE_IN_PROGRESS_LOCK);
- file.QueryInterface(Ci.nsILocalFileWin);
- file.fileAttributesWin |= file.WFA_READWRITE;
- file.fileAttributesWin &= ~file.WFA_READONLY;
- file.remove(false);
- Assert.ok(!file.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(file.path));
-}
-
-/**
- * Gets the test updater from the test data direcory.
- *
- * @return nsIFIle for the test updater.
- */
-function getTestUpdater() {
- let updater = getTestDirFile("updater.app", true);
- if (!updater.exists()) {
- updater = getTestDirFile(FILE_UPDATER_BIN);
- if (!updater.exists()) {
- do_throw("Unable to find the updater binary!");
- }
- }
- Assert.ok(updater.exists(),
- MSG_SHOULD_EXIST + getMsgPath(updater.path));
- return updater;
-}
-
-/**
- * Copies the test updater to the GRE binary directory and returns the nsIFile
- * for the copied test updater.
- *
- * @return nsIFIle for the copied test updater.
- */
-function copyTestUpdaterToBinDir() {
- let testUpdater = getTestUpdater();
- let updater = getGREBinDir();
- updater.append(testUpdater.leafName);
- if (!updater.exists()) {
- testUpdater.copyToFollowingLinks(updater.parent, updater.leafName);
- }
- return updater;
-}
-
-/**
- * Copies the test updater to the location where it will be launched to apply an
- * update and returns the nsIFile for the copied test updater.
- *
- * @return nsIFIle for the copied test updater.
- */
-function copyTestUpdaterForRunUsingUpdater() {
- if (IS_WIN) {
- return copyTestUpdaterToBinDir();
- }
-
- let testUpdater = getTestUpdater();
- let updater = getUpdatesPatchDir();
- updater.append(testUpdater.leafName);
- if (!updater.exists()) {
- testUpdater.copyToFollowingLinks(updater.parent, updater.leafName);
- }
-
- if (IS_MACOSX) {
- updater.append("Contents");
- updater.append("MacOS");
- updater.append("org.mozilla.updater");
- }
- return updater;
-}
-
-/**
- * Logs the contents of an update log and for maintenance service tests this
- * will log the contents of the latest maintenanceservice.log.
- *
- * @param aLogLeafName
- * The leaf name of the update log.
- */
-function logUpdateLog(aLogLeafName) {
- let updateLog = getUpdateLog(aLogLeafName);
- if (updateLog.exists()) {
- // xpcshell tests won't display the entire contents so log each line.
- let updateLogContents = readFileBytes(updateLog).replace(/\r\n/g, "\n");
- updateLogContents = replaceLogPaths(updateLogContents);
- let aryLogContents = updateLogContents.split("\n");
- logTestInfo("contents of " + updateLog.path + ":");
- aryLogContents.forEach(function RU_LC_FE(aLine) {
- logTestInfo(aLine);
- });
- } else {
- logTestInfo("update log doesn't exist, path: " + updateLog.path);
- }
-
- if (IS_SERVICE_TEST) {
- let serviceLog = getMaintSvcDir();
- serviceLog.append("logs");
- serviceLog.append("maintenanceservice.log");
- if (serviceLog.exists()) {
- // xpcshell tests won't display the entire contents so log each line.
- let serviceLogContents = readFileBytes(serviceLog).replace(/\r\n/g, "\n");
- serviceLogContents = replaceLogPaths(serviceLogContents);
- let aryLogContents = serviceLogContents.split("\n");
- logTestInfo("contents of " + serviceLog.path + ":");
- aryLogContents.forEach(function RU_LC_FE(aLine) {
- logTestInfo(aLine);
- });
- } else {
- logTestInfo("maintenance service log doesn't exist, path: " +
- serviceLog.path);
- }
- }
-}
-
-/**
- * Gets the maintenance service log contents.
- */
-function readServiceLogFile() {
- let file = getMaintSvcDir();
- file.append("logs");
- file.append("maintenanceservice.log");
- return readFile(file);
-}
-
-/**
- * Launches the updater binary to apply an update for updater tests.
- *
- * @param aExpectedStatus
- * The expected value of update.status when the test finishes. For
- * service tests passing STATE_PENDING or STATE_APPLIED will change the
- * value to STATE_PENDING_SVC and STATE_APPLIED_SVC respectively.
- * @param aSwitchApp
- * If true the update should switch the application with an updated
- * staged application and if false the update should be applied to the
- * installed application.
- * @param aExpectedExitValue
- * The expected exit value from the updater binary for non-service
- * tests.
- * @param aCheckSvcLog
- * Whether the service log should be checked for service tests.
- * @param aPatchDirPath (optional)
- * When specified the patch directory path to use for invalid argument
- * tests otherwise the normal path will be used.
- * @param aInstallDirPath (optional)
- * When specified the install directory path to use for invalid
- * argument tests otherwise the normal path will be used.
- * @param aApplyToDirPath (optional)
- * When specified the apply to / working directory path to use for
- * invalid argument tests otherwise the normal path will be used.
- * @param aCallbackPath (optional)
- * When specified the callback path to use for invalid argument tests
- * otherwise the normal path will be used.
- */
-function runUpdate(aExpectedStatus, aSwitchApp, aExpectedExitValue, aCheckSvcLog,
- aPatchDirPath, aInstallDirPath, aApplyToDirPath,
- aCallbackPath) {
- let isInvalidArgTest = !!aPatchDirPath || !!aInstallDirPath ||
- !!aApplyToDirPath || aCallbackPath;
-
- let svcOriginalLog;
- if (IS_SERVICE_TEST) {
- copyFileToTestAppDir(FILE_MAINTENANCE_SERVICE_BIN, false);
- copyFileToTestAppDir(FILE_MAINTENANCE_SERVICE_INSTALLER_BIN, false);
- if (aCheckSvcLog) {
- svcOriginalLog = readServiceLogFile();
- }
- }
-
- // Copy the updater binary to the directory where it will apply updates.
- let updateBin = copyTestUpdaterForRunUsingUpdater();
- Assert.ok(updateBin.exists(),
- MSG_SHOULD_EXIST + getMsgPath(updateBin.path));
-
- let updatesDirPath = aPatchDirPath || getUpdatesPatchDir().path;
- let installDirPath = aInstallDirPath || getApplyDirFile(null, true).path;
- let applyToDirPath = aApplyToDirPath || getApplyDirFile(null, true).path;
- let stageDirPath = aApplyToDirPath || getStageDirFile(null, true).path;
-
- let callbackApp = getApplyDirFile(DIR_RESOURCES + gCallbackBinFile);
- callbackApp.permissions = PERMS_DIRECTORY;
-
- setAppBundleModTime();
-
- let args = [updatesDirPath, installDirPath];
- if (aSwitchApp) {
- args[2] = stageDirPath;
- args[3] = "0/replace";
- } else {
- args[2] = applyToDirPath;
- args[3] = "0";
- }
-
- let launchBin = IS_SERVICE_TEST && isInvalidArgTest ? callbackApp : updateBin;
-
- if (!isInvalidArgTest) {
- args = args.concat([callbackApp.parent.path, callbackApp.path]);
- args = args.concat(gCallbackArgs);
- } else if (IS_SERVICE_TEST) {
- args = ["launch-service", updateBin.path].concat(args);
- } else if (aCallbackPath) {
- args = args.concat([callbackApp.parent.path, aCallbackPath]);
- }
-
- debugDump("launching the program: " + launchBin.path + " " + args.join(" "));
-
- if (aSwitchApp && !isInvalidArgTest) {
- // We want to set the env vars again
- gShouldResetEnv = undefined;
- }
-
- setEnvironment();
-
- let process = Cc["@mozilla.org/process/util;1"].
- createInstance(Ci.nsIProcess);
- process.init(launchBin);
- process.run(true, args, args.length);
-
- resetEnvironment();
-
- let status = readStatusFile();
- if ((!IS_SERVICE_TEST && process.exitValue != aExpectedExitValue) ||
- status != aExpectedStatus) {
- if (process.exitValue != aExpectedExitValue) {
- logTestInfo("updater exited with unexpected value! Got: " +
- process.exitValue + ", Expected: " + aExpectedExitValue);
- }
- if (status != aExpectedStatus) {
- logTestInfo("update status is not the expected status! Got: " + status +
- ", Expected: " + aExpectedStatus);
- }
- logUpdateLog(FILE_LAST_UPDATE_LOG);
- }
-
- if (!IS_SERVICE_TEST) {
- Assert.equal(process.exitValue, aExpectedExitValue,
- "the process exit value" + MSG_SHOULD_EQUAL);
- }
- Assert.equal(status, aExpectedStatus,
- "the update status" + MSG_SHOULD_EQUAL);
-
- if (IS_SERVICE_TEST && aCheckSvcLog) {
- let contents = readServiceLogFile();
- Assert.notEqual(contents, svcOriginalLog,
- "the contents of the maintenanceservice.log should not " +
- "be the same as the original contents");
- if (!isInvalidArgTest) {
- Assert.notEqual(contents.indexOf(LOG_SVC_SUCCESSFUL_LAUNCH), -1,
- "the contents of the maintenanceservice.log should " +
- "contain the successful launch string");
- }
- }
-
- do_execute_soon(runUpdateFinished);
-}
-
-/**
- * Launches the helper binary synchronously with the specified arguments for
- * updater tests.
- *
- * @param aArgs
- * The arguments to pass to the helper binary.
- * @return the process exit value returned by the helper binary.
- */
-function runTestHelperSync(aArgs) {
- let helperBin = getTestDirFile(FILE_HELPER_BIN);
- let process = Cc["@mozilla.org/process/util;1"].
- createInstance(Ci.nsIProcess);
- process.init(helperBin);
- debugDump("Running " + helperBin.path + " " + aArgs.join(" "));
- process.run(true, aArgs, aArgs.length);
- return process.exitValue;
-}
-
-/**
- * Creates a symlink for updater tests.
- */
-function createSymlink() {
- let args = ["setup-symlink", "moz-foo", "moz-bar", "target",
- getApplyDirFile().path + "/" + DIR_RESOURCES + "link"];
- let exitValue = runTestHelperSync(args);
- Assert.equal(exitValue, 0,
- "the helper process exit value should be 0");
- getApplyDirFile(DIR_RESOURCES + "link", false).permissions = 0o666;
- args = ["setup-symlink", "moz-foo2", "moz-bar2", "target2",
- getApplyDirFile().path + "/" + DIR_RESOURCES + "link2", "change-perm"];
- exitValue = runTestHelperSync(args);
- Assert.equal(exitValue, 0,
- "the helper process exit value should be 0");
-}
-
-/**
- * Removes a symlink for updater tests.
- */
-function removeSymlink() {
- let args = ["remove-symlink", "moz-foo", "moz-bar", "target",
- getApplyDirFile().path + "/" + DIR_RESOURCES + "link"];
- let exitValue = runTestHelperSync(args);
- Assert.equal(exitValue, 0,
- "the helper process exit value should be 0");
- args = ["remove-symlink", "moz-foo2", "moz-bar2", "target2",
- getApplyDirFile().path + "/" + DIR_RESOURCES + "link2"];
- exitValue = runTestHelperSync(args);
- Assert.equal(exitValue, 0,
- "the helper process exit value should be 0");
-}
-
-/**
- * Checks a symlink for updater tests.
- */
-function checkSymlink() {
- let args = ["check-symlink",
- getApplyDirFile().path + "/" + DIR_RESOURCES + "link"];
- let exitValue = runTestHelperSync(args);
- Assert.equal(exitValue, 0,
- "the helper process exit value should be 0");
-}
-
-/**
- * Sets the active update and related information for updater tests.
- */
-function setupActiveUpdate() {
- let state = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
- let channel = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
- let patches = getLocalPatchString(null, null, null, null, null, "true",
- state);
- let updates = getLocalUpdateString(patches, null, null, null, null, null,
- null, null, null, null, "true", channel);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeVersionFile(DEFAULT_UPDATE_VERSION);
- writeStatusFile(state);
- reloadUpdateManagerData();
- Assert.ok(!!gUpdateManager.activeUpdate,
- "the active update should be defined");
-}
-
-/**
- * Gets the specified update log.
- *
- * @param aLogLeafName
- * The leaf name of the log to get.
- * @return nsIFile for the update log.
- */
-function getUpdateLog(aLogLeafName) {
- let updateLog = getUpdatesDir();
- if (aLogLeafName == FILE_UPDATE_LOG) {
- updateLog.append(DIR_PATCH);
- }
- updateLog.append(aLogLeafName);
- return updateLog;
-}
-
-/**
- * The update-staged observer for the call to nsIUpdateProcessor:processUpdate.
- */
-const gUpdateStagedObserver = {
- observe: function(aSubject, aTopic, aData) {
- debugDump("observe called with topic: " + aTopic + ", data: " + aData);
- if (aTopic == "update-staged") {
- Services.obs.removeObserver(gUpdateStagedObserver, "update-staged");
- // The environment is reset after the update-staged observer topic because
- // processUpdate in nsIUpdateProcessor uses a new thread and clearing the
- // environment immediately after calling processUpdate can clear the
- // environment before the updater is launched.
- resetEnvironment();
- // Use do_execute_soon to prevent any failures from propagating to the
- // update service.
- do_execute_soon(checkUpdateStagedState.bind(null, aData));
- }
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver])
-};
-
-/**
- * Stages an update using nsIUpdateProcessor:processUpdate for updater tests.
- *
- * @param aCheckSvcLog
- * Whether the service log should be checked for service tests.
- */
-function stageUpdate(aCheckSvcLog) {
- debugDump("start - attempting to stage update");
-
- if (IS_SERVICE_TEST && aCheckSvcLog) {
- gSvcOriginalLogContents = readServiceLogFile();
- }
-
- Services.obs.addObserver(gUpdateStagedObserver, "update-staged", false);
-
- setAppBundleModTime();
- setEnvironment();
- // Stage the update.
- Cc["@mozilla.org/updates/update-processor;1"].
- createInstance(Ci.nsIUpdateProcessor).
- processUpdate(gUpdateManager.activeUpdate);
-
- // The environment is not reset here because processUpdate in
- // nsIUpdateProcessor uses a new thread and clearing the environment
- // immediately after calling processUpdate can clear the environment before
- // the updater is launched. Instead it is reset after the update-staged
- // observer topic.
-
- debugDump("finish - attempting to stage update");
-}
-
-/**
- * Checks that the update state is correct as well as the expected files are
- * present after staging and update for updater tests and then calls
- * stageUpdateFinished.
- *
- * @param aUpdateState
- * The update state received by the observer notification.
- */
-function checkUpdateStagedState(aUpdateState) {
- if (IS_WIN) {
- if (IS_SERVICE_TEST) {
- waitForServiceStop(false);
- } else {
- let updater = getApplyDirFile(FILE_UPDATER_BIN, true);
- if (isFileInUse(updater)) {
- do_timeout(FILE_IN_USE_TIMEOUT_MS,
- checkUpdateStagedState.bind(null, aUpdateState));
- return;
- }
- }
- }
-
- Assert.equal(aUpdateState, STATE_AFTER_STAGE,
- "the notified state" + MSG_SHOULD_EQUAL);
-
- if (!gStagingRemovedUpdate) {
- Assert.equal(readStatusState(), STATE_AFTER_STAGE,
- "the status file state" + MSG_SHOULD_EQUAL);
-
- Assert.equal(gUpdateManager.activeUpdate.state, STATE_AFTER_STAGE,
- "the update state" + MSG_SHOULD_EQUAL);
- }
-
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_STAGE,
- "the update state" + MSG_SHOULD_EQUAL);
-
- let log = getUpdateLog(FILE_LAST_UPDATE_LOG);
- Assert.ok(log.exists(),
- MSG_SHOULD_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_UPDATE_LOG);
- Assert.ok(!log.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_BACKUP_UPDATE_LOG);
- Assert.ok(!log.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
-
- let stageDir = getStageDirFile(null, true);
- if (STATE_AFTER_STAGE == STATE_APPLIED ||
- STATE_AFTER_STAGE == STATE_APPLIED_SVC) {
- Assert.ok(stageDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(stageDir.path));
- } else {
- Assert.ok(!stageDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(stageDir.path));
- }
-
- if (IS_SERVICE_TEST && gSvcOriginalLogContents !== undefined) {
- let contents = readServiceLogFile();
- Assert.notEqual(contents, gSvcOriginalLogContents,
- "the contents of the maintenanceservice.log should not " +
- "be the same as the original contents");
- Assert.notEqual(contents.indexOf(LOG_SVC_SUCCESSFUL_LAUNCH), -1,
- "the contents of the maintenanceservice.log should " +
- "contain the successful launch string");
- }
-
- do_execute_soon(stageUpdateFinished);
-}
-
-/**
- * Helper function to check whether the maintenance service updater tests should
- * run. See bug 711660 for more details.
- *
- * @return true if the test should run and false if it shouldn't.
- */
-function shouldRunServiceTest() {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- let binDir = getGREBinDir();
- let updaterBin = binDir.clone();
- updaterBin.append(FILE_UPDATER_BIN);
- Assert.ok(updaterBin.exists(),
- MSG_SHOULD_EXIST + ", leafName: " + updaterBin.leafName);
-
- let updaterBinPath = updaterBin.path;
- if (/ /.test(updaterBinPath)) {
- updaterBinPath = '"' + updaterBinPath + '"';
- }
-
- let isBinSigned = isBinarySigned(updaterBinPath);
-
- const REG_PATH = "SOFTWARE\\Mozilla\\MaintenanceService\\" +
- "3932ecacee736d366d6436db0f55bce4";
- let key = Cc["@mozilla.org/windows-registry-key;1"].
- createInstance(Ci.nsIWindowsRegKey);
- try {
- key.open(Ci.nsIWindowsRegKey.ROOT_KEY_LOCAL_MACHINE, REG_PATH,
- Ci.nsIWindowsRegKey.ACCESS_READ | key.WOW64_64);
- } catch (e) {
- // The build system could sign the files and not have the test registry key
- // in which case we should fail the test if the updater binary is signed so
- // the build system can be fixed by adding the registry key.
- if (IS_AUTHENTICODE_CHECK_ENABLED) {
- Assert.ok(!isBinSigned,
- "the updater.exe binary should not be signed when the test " +
- "registry key doesn't exist (if it is, build system " +
- "configuration bug?)");
- }
-
- logTestInfo("this test can only run on the buildbot build system at this " +
- "time");
- return false;
- }
-
- // Check to make sure the service is installed
- let args = ["wait-for-service-stop", "MozillaMaintenance", "10"];
- let exitValue = runTestHelperSync(args);
- Assert.notEqual(exitValue, 0xEE, "the maintenance service should be " +
- "installed (if not, build system configuration bug?)");
-
- if (IS_AUTHENTICODE_CHECK_ENABLED) {
- // The test registry key exists and IS_AUTHENTICODE_CHECK_ENABLED is true
- // so the binaries should be signed. To run the test locally
- // DISABLE_UPDATER_AUTHENTICODE_CHECK can be defined.
- Assert.ok(isBinSigned,
- "the updater.exe binary should be signed (if not, build system " +
- "configuration bug?)");
- }
-
- // In case the machine is running an old maintenance service or if it
- // is not installed, and permissions exist to install it. Then install
- // the newer bin that we have since all of the other checks passed.
- return attemptServiceInstall();
-}
-
-/**
- * Helper function to check whether the a binary is signed.
- *
- * @param aBinPath
- * The path to the file to check if it is signed.
- * @return true if the file is signed and false if it isn't.
- */
-function isBinarySigned(aBinPath) {
- let args = ["check-signature", aBinPath];
- let exitValue = runTestHelperSync(args);
- if (exitValue != 0) {
- logTestInfo("binary is not signed. " + FILE_HELPER_BIN + " returned " +
- exitValue + " for file " + aBinPath);
- return false;
- }
- return true;
-}
-
-/**
- * Helper function for asynchronously setting up the application files required
- * to launch the application for the updater tests by either copying or creating
- * symlinks for the files. This is needed for Windows debug builds which can
- * lock a file that is being copied so that the tests can run in parallel. After
- * the files have been copied the setupUpdaterTestFinished function will be
- * called.
- */
-function setupAppFilesAsync() {
- gTimeoutRuns++;
- try {
- setupAppFiles();
- } catch (e) {
- if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
- do_throw("Exceeded MAX_TIMEOUT_RUNS while trying to setup application " +
- "files! Exception: " + e);
- }
- do_execute_soon(setupAppFilesAsync);
- return;
- }
-
- do_execute_soon(setupUpdaterTestFinished);
-}
-
-/**
- * Helper function for setting up the application files required to launch the
- * application for the updater tests by either copying or creating symlinks to
- * the files.
- */
-function setupAppFiles() {
- debugDump("start - copying or creating symlinks to application files " +
- "for the test");
-
- let destDir = getApplyDirFile(null, true);
- if (!destDir.exists()) {
- try {
- destDir.create(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
- } catch (e) {
- logTestInfo("unable to create directory! Path: " + destDir.path +
- ", Exception: " + e);
- do_throw(e);
- }
- }
-
- // Required files for the application or the test that aren't listed in the
- // dependentlibs.list file.
- let appFiles = [{relPath: FILE_APP_BIN,
- inGreDir: false},
- {relPath: FILE_APPLICATION_INI,
- inGreDir: true},
- {relPath: "dependentlibs.list",
- inGreDir: true}];
-
- // On Linux the updater.png must also be copied
- if (IS_UNIX && !IS_MACOSX) {
- appFiles.push({relPath: "icons/updater.png",
- inGreDir: true});
- }
-
- // Read the dependent libs file leafnames from the dependentlibs.list file
- // into the array.
- let deplibsFile = gGREDirOrig.clone();
- deplibsFile.append("dependentlibs.list");
- let fis = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- fis.init(deplibsFile, 0x01, 0o444, Ci.nsIFileInputStream.CLOSE_ON_EOF);
- fis.QueryInterface(Ci.nsILineInputStream);
-
- let hasMore;
- let line = {};
- do {
- hasMore = fis.readLine(line);
- appFiles.push({relPath: line.value,
- inGreDir: false});
- } while (hasMore);
-
- fis.close();
-
- appFiles.forEach(function CMAF_FLN_FE(aAppFile) {
- copyFileToTestAppDir(aAppFile.relPath, aAppFile.inGreDir);
- });
-
- copyTestUpdaterToBinDir();
-
- debugDump("finish - copying or creating symlinks to application files " +
- "for the test");
-}
-
-/**
- * Copies the specified files from the dist/bin directory into the test's
- * application directory.
- *
- * @param aFileRelPath
- * The relative path to the source and the destination of the file to
- * copy.
- * @param aInGreDir
- * Whether the file is located in the GRE directory which is
- * <bundle>/Contents/Resources on Mac OS X and is the installation
- * directory on all other platforms. If false the file must be in the
- * GRE Binary directory which is <bundle>/Contents/MacOS on Mac OS X
- * and is the installation directory on on all other platforms.
- */
-function copyFileToTestAppDir(aFileRelPath, aInGreDir) {
- // gGREDirOrig and gGREBinDirOrig must always be cloned when changing its
- // properties
- let srcFile = aInGreDir ? gGREDirOrig.clone() : gGREBinDirOrig.clone();
- let destFile = aInGreDir ? getGREDir() : getGREBinDir();
- let fileRelPath = aFileRelPath;
- let pathParts = fileRelPath.split("/");
- for (let i = 0; i < pathParts.length; i++) {
- if (pathParts[i]) {
- srcFile.append(pathParts[i]);
- destFile.append(pathParts[i]);
- }
- }
-
- if (IS_MACOSX && !srcFile.exists()) {
- debugDump("unable to copy file since it doesn't exist! Checking if " +
- fileRelPath + ".app exists. Path: " + srcFile.path);
- // gGREDirOrig and gGREBinDirOrig must always be cloned when changing its
- // properties
- srcFile = aInGreDir ? gGREDirOrig.clone() : gGREBinDirOrig.clone();
- destFile = aInGreDir ? getGREDir() : getGREBinDir();
- for (let i = 0; i < pathParts.length; i++) {
- if (pathParts[i]) {
- srcFile.append(pathParts[i] + (pathParts.length - 1 == i ? ".app" : ""));
- destFile.append(pathParts[i] + (pathParts.length - 1 == i ? ".app" : ""));
- }
- }
- fileRelPath = fileRelPath + ".app";
- }
- Assert.ok(srcFile.exists(),
- MSG_SHOULD_EXIST + ", leafName: " + srcFile.leafName);
-
- // Symlink libraries. Note that the XUL library on Mac OS X doesn't have a
- // file extension and shouldSymlink will always be false on Windows.
- let shouldSymlink = (pathParts[pathParts.length - 1] == "XUL" ||
- fileRelPath.substr(fileRelPath.length - 3) == ".so" ||
- fileRelPath.substr(fileRelPath.length - 6) == ".dylib");
- if (!shouldSymlink) {
- if (!destFile.exists()) {
- try {
- srcFile.copyToFollowingLinks(destFile.parent, destFile.leafName);
- } catch (e) {
- // Just in case it is partially copied
- if (destFile.exists()) {
- try {
- destFile.remove(true);
- } catch (ex) {
- logTestInfo("unable to remove file that failed to copy! Path: " +
- destFile.path);
- }
- }
- do_throw("Unable to copy file! Path: " + srcFile.path +
- ", Exception: " + ex);
- }
- }
- } else {
- try {
- if (destFile.exists()) {
- destFile.remove(false);
- }
- let ln = Cc["@mozilla.org/file/local;1"].createInstance(Ci.nsILocalFile);
- ln.initWithPath("/bin/ln");
- let process = Cc["@mozilla.org/process/util;1"].createInstance(Ci.nsIProcess);
- process.init(ln);
- let args = ["-s", srcFile.path, destFile.path];
- process.run(true, args, args.length);
- Assert.ok(destFile.isSymlink(),
- destFile.leafName + " should be a symlink");
- } catch (e) {
- do_throw("Unable to create symlink for file! Path: " + srcFile.path +
- ", Exception: " + e);
- }
- }
-}
-
-/**
- * Attempts to upgrade the maintenance service if permissions are allowed.
- * This is useful for XP where we have permission to upgrade in case an
- * older service installer exists. Also if the user manually installed into
- * a unprivileged location.
- *
- * @return true if the installed service is from this build. If the installed
- * service is not from this build the test will fail instead of
- * returning false.
- */
-function attemptServiceInstall() {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- let maintSvcDir = getMaintSvcDir();
- Assert.ok(maintSvcDir.exists(),
- MSG_SHOULD_EXIST + ", leafName: " + maintSvcDir.leafName);
- let oldMaintSvcBin = maintSvcDir.clone();
- oldMaintSvcBin.append(FILE_MAINTENANCE_SERVICE_BIN);
- Assert.ok(oldMaintSvcBin.exists(),
- MSG_SHOULD_EXIST + ", leafName: " + oldMaintSvcBin.leafName);
- let buildMaintSvcBin = getGREBinDir();
- buildMaintSvcBin.append(FILE_MAINTENANCE_SERVICE_BIN);
- if (readFileBytes(oldMaintSvcBin) == readFileBytes(buildMaintSvcBin)) {
- debugDump("installed maintenance service binary is the same as the " +
- "build's maintenance service binary");
- return true;
- }
- let backupMaintSvcBin = maintSvcDir.clone();
- backupMaintSvcBin.append(FILE_MAINTENANCE_SERVICE_BIN + ".backup");
- try {
- if (backupMaintSvcBin.exists()) {
- backupMaintSvcBin.remove(false);
- }
- oldMaintSvcBin.moveTo(maintSvcDir, FILE_MAINTENANCE_SERVICE_BIN + ".backup");
- buildMaintSvcBin.copyTo(maintSvcDir, FILE_MAINTENANCE_SERVICE_BIN);
- backupMaintSvcBin.remove(false);
- } catch (e) {
- // Restore the original file in case the moveTo was successful.
- if (backupMaintSvcBin.exists()) {
- oldMaintSvcBin = maintSvcDir.clone();
- oldMaintSvcBin.append(FILE_MAINTENANCE_SERVICE_BIN);
- if (!oldMaintSvcBin.exists()) {
- backupMaintSvcBin.moveTo(maintSvcDir, FILE_MAINTENANCE_SERVICE_BIN);
- }
- }
- Assert.ok(false, "should be able copy the test maintenance service to " +
- "the maintenance service directory (if not, build system " +
- "configuration bug?), path: " + maintSvcDir.path);
- }
-
- return true;
-}
-
-/**
- * Waits for the applications that are launched by the maintenance service to
- * stop.
- */
-function waitServiceApps() {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- // maintenanceservice_installer.exe is started async during updates.
- waitForApplicationStop("maintenanceservice_installer.exe");
- // maintenanceservice_tmp.exe is started async from the service installer.
- waitForApplicationStop("maintenanceservice_tmp.exe");
- // In case the SCM thinks the service is stopped, but process still exists.
- waitForApplicationStop("maintenanceservice.exe");
-}
-
-/**
- * Waits for the maintenance service to stop.
- */
-function waitForServiceStop(aFailTest) {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- waitServiceApps();
- debugDump("waiting for the maintenance service to stop if necessary");
- // Use the helper bin to ensure the service is stopped. If not stopped, then
- // wait for the service to stop (at most 120 seconds).
- let args = ["wait-for-service-stop", "MozillaMaintenance", "120"];
- let exitValue = runTestHelperSync(args);
- Assert.notEqual(exitValue, 0xEE,
- "the maintenance service should exist");
- if (exitValue != 0) {
- if (aFailTest) {
- Assert.ok(false, "the maintenance service should stop, process exit " +
- "value: " + exitValue);
- }
- logTestInfo("maintenance service did not stop which may cause test " +
- "failures later, process exit value: " + exitValue);
- } else {
- debugDump("service stopped");
- }
- waitServiceApps();
-}
-
-/**
- * Waits for the specified application to stop.
- *
- * @param aApplication
- * The application binary name to wait until it has stopped.
- */
-function waitForApplicationStop(aApplication) {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- debugDump("waiting for " + aApplication + " to stop if necessary");
- // Use the helper bin to ensure the application is stopped. If not stopped,
- // then wait for it to stop (at most 120 seconds).
- let args = ["wait-for-application-exit", aApplication, "120"];
- let exitValue = runTestHelperSync(args);
- Assert.equal(exitValue, 0,
- "the process should have stopped, process name: " +
- aApplication);
-}
-
-
-/**
- * Gets the platform specific shell binary that is launched using nsIProcess and
- * in turn launches a binary used for the test (e.g. application, updater,
- * etc.). A shell is used so debug console output can be redirected to a file so
- * it doesn't end up in the test log.
- *
- * @return nsIFile for the shell binary to launch using nsIProcess.
- */
-function getLaunchBin() {
- let launchBin;
- if (IS_WIN) {
- launchBin = Services.dirsvc.get("WinD", Ci.nsIFile);
- launchBin.append("System32");
- launchBin.append("cmd.exe");
- } else {
- launchBin = Cc["@mozilla.org/file/local;1"].
- createInstance(Ci.nsILocalFile);
- launchBin.initWithPath("/bin/sh");
- }
- Assert.ok(launchBin.exists(),
- MSG_SHOULD_EXIST + getMsgPath(launchBin.path));
-
- return launchBin;
-}
-
-
-/**
- * Locks a Windows directory.
- *
- * @param aDirPath
- * The test file object that describes the file to make in use.
- */
-function lockDirectory(aDirPath) {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- debugDump("start - locking installation directory");
- const LPCWSTR = ctypes.char16_t.ptr;
- const DWORD = ctypes.uint32_t;
- const LPVOID = ctypes.voidptr_t;
- const GENERIC_READ = 0x80000000;
- const FILE_SHARE_READ = 1;
- const FILE_SHARE_WRITE = 2;
- const OPEN_EXISTING = 3;
- const FILE_FLAG_BACKUP_SEMANTICS = 0x02000000;
- const INVALID_HANDLE_VALUE = LPVOID(0xffffffff);
- let kernel32 = ctypes.open("kernel32");
- let CreateFile = kernel32.declare("CreateFileW", ctypes.default_abi,
- LPVOID, LPCWSTR, DWORD, DWORD,
- LPVOID, DWORD, DWORD, LPVOID);
- gHandle = CreateFile(aDirPath, GENERIC_READ,
- FILE_SHARE_READ | FILE_SHARE_WRITE, LPVOID(0),
- OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, LPVOID(0));
- Assert.notEqual(gHandle.toString(), INVALID_HANDLE_VALUE.toString(),
- "the handle should not equal INVALID_HANDLE_VALUE");
- kernel32.close();
- debugDump("finish - locking installation directory");
-}
-
-/**
- * Launches the test helper binary to make it in use for updater tests and then
- * calls waitForHelperSleep.
- *
- * @param aTestFile
- * The test file object that describes the file to make in use.
- */
-function runHelperFileInUse(aRelPath, aCopyTestHelper) {
- logTestInfo("aRelPath: " + aRelPath);
- // Launch an existing file so it is in use during the update.
- let helperBin = getTestDirFile(FILE_HELPER_BIN);
- let fileInUseBin = getApplyDirFile(aRelPath);
- if (aCopyTestHelper) {
- fileInUseBin.remove(false);
- helperBin.copyTo(fileInUseBin.parent, fileInUseBin.leafName);
- }
- fileInUseBin.permissions = PERMS_DIRECTORY;
- let args = [getApplyDirPath() + DIR_RESOURCES, "input", "output", "-s",
- HELPER_SLEEP_TIMEOUT];
- let fileInUseProcess = Cc["@mozilla.org/process/util;1"].
- createInstance(Ci.nsIProcess);
- fileInUseProcess.init(fileInUseBin);
- fileInUseProcess.run(false, args, args.length);
-
- do_execute_soon(waitForHelperSleep);
-}
-
-/**
- * Launches the test helper binary and locks a file specified on the command
- * line for updater tests and then calls waitForHelperSleep.
- *
- * @param aTestFile
- * The test file object that describes the file to lock.
- */
-function runHelperLockFile(aTestFile) {
- // Exclusively lock an existing file so it is in use during the update.
- let helperBin = getTestDirFile(FILE_HELPER_BIN);
- let helperDestDir = getApplyDirFile(DIR_RESOURCES);
- helperBin.copyTo(helperDestDir, FILE_HELPER_BIN);
- helperBin = getApplyDirFile(DIR_RESOURCES + FILE_HELPER_BIN);
- // Strip off the first two directories so the path has to be from the helper's
- // working directory.
- let lockFileRelPath = aTestFile.relPathDir.split("/");
- if (IS_MACOSX) {
- lockFileRelPath = lockFileRelPath.slice(2);
- }
- lockFileRelPath = lockFileRelPath.join("/") + "/" + aTestFile.fileName;
- let args = [getApplyDirPath() + DIR_RESOURCES, "input", "output", "-s",
- HELPER_SLEEP_TIMEOUT, lockFileRelPath];
- let helperProcess = Cc["@mozilla.org/process/util;1"].
- createInstance(Ci.nsIProcess);
- helperProcess.init(helperBin);
- helperProcess.run(false, args, args.length);
-
- do_execute_soon(waitForHelperSleep);
-}
-
-/**
- * Helper function that waits until the helper has completed its operations and
- * calls waitForHelperSleepFinished when it is finished.
- */
-function waitForHelperSleep() {
- gTimeoutRuns++;
- // Give the lock file process time to lock the file before updating otherwise
- // this test can fail intermittently on Windows debug builds.
- let output = getApplyDirFile(DIR_RESOURCES + "output", true);
- if (readFile(output) != "sleeping\n") {
- if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
- do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the helper to " +
- "finish its operation. Path: " + output.path);
- }
- // Uses do_timeout instead of do_execute_soon to lessen log spew.
- do_timeout(FILE_IN_USE_TIMEOUT_MS, waitForHelperSleep);
- return;
- }
- try {
- output.remove(false);
- } catch (e) {
- if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
- do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the helper " +
- "message file to no longer be in use. Path: " + output.path);
- }
- debugDump("failed to remove file. Path: " + output.path);
- // Uses do_timeout instead of do_execute_soon to lessen log spew.
- do_timeout(FILE_IN_USE_TIMEOUT_MS, waitForHelperSleep);
- return;
- }
- waitForHelperSleepFinished();
-}
-
-/**
- * Helper function that waits until the helper has finished its operations
- * before calling waitForHelperFinishFileUnlock to verify that the helper's
- * input and output directories are no longer in use.
- */
-function waitForHelperFinished() {
- // Give the lock file process time to lock the file before updating otherwise
- // this test can fail intermittently on Windows debug builds.
- let output = getApplyDirFile(DIR_RESOURCES + "output", true);
- if (readFile(output) != "finished\n") {
- // Uses do_timeout instead of do_execute_soon to lessen log spew.
- do_timeout(FILE_IN_USE_TIMEOUT_MS, waitForHelperFinished);
- return;
- }
- // Give the lock file process time to unlock the file before deleting the
- // input and output files.
- waitForHelperFinishFileUnlock();
-}
-
-/**
- * Helper function that waits until the helper's input and output files are no
- * longer in use before calling waitForHelperExitFinished.
- */
-function waitForHelperFinishFileUnlock() {
- try {
- let output = getApplyDirFile(DIR_RESOURCES + "output", true);
- if (output.exists()) {
- output.remove(false);
- }
- let input = getApplyDirFile(DIR_RESOURCES + "input", true);
- if (input.exists()) {
- input.remove(false);
- }
- } catch (e) {
- // Give the lock file process time to unlock the file before deleting the
- // input and output files.
- do_execute_soon(waitForHelperFinishFileUnlock);
- return;
- }
- do_execute_soon(waitForHelperExitFinished);
-}
-
-/**
- * Helper function to tell the helper to finish and exit its sleep state.
- */
-function waitForHelperExit() {
- let input = getApplyDirFile(DIR_RESOURCES + "input", true);
- writeFile(input, "finish\n");
- waitForHelperFinished();
-}
-
-/**
- * Helper function for updater binary tests that creates the files and
- * directories used by the test.
- *
- * @param aMarFile
- * The mar file for the update test.
- * @param aPostUpdateAsync
- * When null the updater.ini is not created otherwise this parameter
- * is passed to createUpdaterINI.
- * @param aPostUpdateExeRelPathPrefix
- * When aPostUpdateAsync null this value is ignored otherwise it is
- * passed to createUpdaterINI.
- */
-function setupUpdaterTest(aMarFile, aPostUpdateAsync,
- aPostUpdateExeRelPathPrefix = "") {
- let updatesPatchDir = getUpdatesPatchDir();
- if (!updatesPatchDir.exists()) {
- updatesPatchDir.create(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
- }
- // Copy the mar that will be applied
- let mar = getTestDirFile(aMarFile);
- mar.copyToFollowingLinks(updatesPatchDir, FILE_UPDATE_MAR);
-
- let helperBin = getTestDirFile(FILE_HELPER_BIN);
- helperBin.permissions = PERMS_DIRECTORY;
- let afterApplyBinDir = getApplyDirFile(DIR_RESOURCES, true);
- helperBin.copyToFollowingLinks(afterApplyBinDir, gCallbackBinFile);
- helperBin.copyToFollowingLinks(afterApplyBinDir, gPostUpdateBinFile);
-
- gTestFiles.forEach(function SUT_TF_FE(aTestFile) {
- if (aTestFile.originalFile || aTestFile.originalContents) {
- let testDir = getApplyDirFile(aTestFile.relPathDir, true);
- if (!testDir.exists()) {
- testDir.create(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
- }
-
- let testFile;
- if (aTestFile.originalFile) {
- testFile = getTestDirFile(aTestFile.originalFile);
- testFile.copyToFollowingLinks(testDir, aTestFile.fileName);
- testFile = getApplyDirFile(aTestFile.relPathDir + aTestFile.fileName);
- } else {
- testFile = getApplyDirFile(aTestFile.relPathDir + aTestFile.fileName,
- true);
- writeFile(testFile, aTestFile.originalContents);
- }
-
- // Skip these tests on Windows since chmod doesn't really set permissions
- // on Windows.
- if (!IS_WIN && aTestFile.originalPerms) {
- testFile.permissions = aTestFile.originalPerms;
- // Store the actual permissions on the file for reference later after
- // setting the permissions.
- if (!aTestFile.comparePerms) {
- aTestFile.comparePerms = testFile.permissions;
- }
- }
- }
- });
-
- // Add the test directory that will be updated for a successful update or left
- // in the initial state for a failed update.
- gTestDirs.forEach(function SUT_TD_FE(aTestDir) {
- let testDir = getApplyDirFile(aTestDir.relPathDir, true);
- if (!testDir.exists()) {
- testDir.create(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
- }
-
- if (aTestDir.files) {
- aTestDir.files.forEach(function SUT_TD_F_FE(aTestFile) {
- let testFile = getApplyDirFile(aTestDir.relPathDir + aTestFile, true);
- if (!testFile.exists()) {
- testFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, PERMS_FILE);
- }
- });
- }
-
- if (aTestDir.subDirs) {
- aTestDir.subDirs.forEach(function SUT_TD_SD_FE(aSubDir) {
- let testSubDir = getApplyDirFile(aTestDir.relPathDir + aSubDir, true);
- if (!testSubDir.exists()) {
- testSubDir.create(Ci.nsIFile.DIRECTORY_TYPE, PERMS_DIRECTORY);
- }
-
- if (aTestDir.subDirFiles) {
- aTestDir.subDirFiles.forEach(function SUT_TD_SDF_FE(aTestFile) {
- let testFile = getApplyDirFile(aTestDir.relPathDir + aSubDir + aTestFile, true);
- if (!testFile.exists()) {
- testFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, PERMS_FILE);
- }
- });
- }
- });
- }
- });
-
- setupActiveUpdate();
-
- if (aPostUpdateAsync !== null) {
- createUpdaterINI(aPostUpdateAsync, aPostUpdateExeRelPathPrefix);
- }
-
- setupAppFilesAsync();
-}
-
-/**
- * Helper function for updater binary tests that creates the update-settings.ini
- * file.
- */
-function createUpdateSettingsINI() {
- let ini = getApplyDirFile(DIR_RESOURCES + FILE_UPDATE_SETTINGS_INI, true);
- writeFile(ini, UPDATE_SETTINGS_CONTENTS);
-}
-
-/**
- * Helper function for updater binary tests that creates the updater.ini
- * file.
- *
- * @param aIsExeAsync
- * True or undefined if the post update process should be async. If
- * undefined ExeAsync will not be added to the updater.ini file in
- * order to test the default launch behavior which is async.
- * @param aExeRelPathPrefix
- * A string to prefix the ExeRelPath values in the updater.ini.
- */
-function createUpdaterINI(aIsExeAsync, aExeRelPathPrefix) {
- let exeArg = "ExeArg=post-update-async\n";
- let exeAsync = "";
- if (aIsExeAsync !== undefined) {
- if (aIsExeAsync) {
- exeAsync = "ExeAsync=true\n";
- } else {
- exeArg = "ExeArg=post-update-sync\n";
- exeAsync = "ExeAsync=false\n";
- }
- }
-
- if (aExeRelPathPrefix && IS_WIN) {
- aExeRelPathPrefix = aExeRelPathPrefix.replace("/", "\\");
- }
-
- let exeRelPathMac = "ExeRelPath=" + aExeRelPathPrefix + DIR_RESOURCES +
- gPostUpdateBinFile + "\n";
- let exeRelPathWin = "ExeRelPath=" + aExeRelPathPrefix + gPostUpdateBinFile + "\n";
- let updaterIniContents = "[Strings]\n" +
- "Title=Update Test\n" +
- "Info=Running update test " + gTestID + "\n\n" +
- "[PostUpdateMac]\n" +
- exeRelPathMac +
- exeArg +
- exeAsync +
- "\n" +
- "[PostUpdateWin]\n" +
- exeRelPathWin +
- exeArg +
- exeAsync;
- let updaterIni = getApplyDirFile(DIR_RESOURCES + FILE_UPDATER_INI, true);
- writeFile(updaterIni, updaterIniContents);
-}
-
-/**
- * Gets the message log path used for assert checks to lessen the length printed
- * to the log file.
- *
- * @param aPath
- * The path to shorten for the log file.
- * @return the message including the shortened path for the log file.
- */
-function getMsgPath(aPath) {
- return ", path: " + replaceLogPaths(aPath);
-}
-
-/**
- * Helper function that replaces the common part of paths in the update log's
- * contents with <test_dir_path> for paths to the the test directory and
- * <update_dir_path> for paths to the update directory. This is needed since
- * Assert.equal will truncate what it prints to the xpcshell log file.
- *
- * @param aLogContents
- * The update log file's contents.
- * @return the log contents with the paths replaced.
- */
-function replaceLogPaths(aLogContents) {
- let logContents = aLogContents;
- // Remove the majority of the path up to the test directory. This is needed
- // since Assert.equal won't print long strings to the test logs.
- let testDirPath = do_get_file(gTestID, false).path;
- if (IS_WIN) {
- // Replace \\ with \\\\ so the regexp works.
- testDirPath = testDirPath.replace(/\\/g, "\\\\");
- }
- logContents = logContents.replace(new RegExp(testDirPath, "g"),
- "<test_dir_path>/" + gTestID);
- let updatesDirPath = getMockUpdRootD().path;
- if (IS_WIN) {
- // Replace \\ with \\\\ so the regexp works.
- updatesDirPath = updatesDirPath.replace(/\\/g, "\\\\");
- }
- logContents = logContents.replace(new RegExp(updatesDirPath, "g"),
- "<update_dir_path>/" + gTestID);
- if (IS_WIN) {
- // Replace \ with /
- logContents = logContents.replace(/\\/g, "/");
- }
- return logContents;
-}
-
-/**
- * Helper function for updater binary tests for verifying the contents of the
- * update log after a successful update.
- *
- * @param aCompareLogFile
- * The log file to compare the update log with.
- * @param aStaged
- * If the update log file is for a staged update.
- * @param aReplace
- * If the update log file is for a replace update.
- * @param aExcludeDistDir
- * Removes lines containing the distribution directory from the log
- * file to compare the update log with.
- */
-function checkUpdateLogContents(aCompareLogFile, aStaged = false,
- aReplace = false, aExcludeDistDir = false) {
- if (IS_UNIX && !IS_MACOSX) {
- // The order that files are returned when enumerating the file system on
- // Linux is not deterministic so skip checking the logs.
- return;
- }
-
- let updateLog = getUpdateLog(FILE_LAST_UPDATE_LOG);
- let updateLogContents = readFileBytes(updateLog);
-
- // The channel-prefs.js is defined in gTestFilesCommon which will always be
- // located to the end of gTestFiles when it is present.
- if (gTestFiles.length > 1 &&
- gTestFiles[gTestFiles.length - 1].fileName == "channel-prefs.js" &&
- !gTestFiles[gTestFiles.length - 1].originalContents) {
- updateLogContents = updateLogContents.replace(/.*defaults\/.*/g, "");
- }
-
- if (gTestFiles.length > 2 &&
- gTestFiles[gTestFiles.length - 2].fileName == FILE_UPDATE_SETTINGS_INI &&
- !gTestFiles[gTestFiles.length - 2].originalContents) {
- updateLogContents = updateLogContents.replace(/.*update-settings.ini.*/g, "");
- }
-
- // Skip the source/destination lines since they contain absolute paths.
- // These could be changed to relative paths using <test_dir_path> and
- // <update_dir_path>
- updateLogContents = updateLogContents.replace(/PATCH DIRECTORY.*/g, "");
- updateLogContents = updateLogContents.replace(/INSTALLATION DIRECTORY.*/g, "");
- updateLogContents = updateLogContents.replace(/WORKING DIRECTORY.*/g, "");
- // Skip lines that log failed attempts to open the callback executable.
- updateLogContents = updateLogContents.replace(/NS_main: callback app file .*/g, "");
-
- if (IS_MACOSX) {
- // Skip lines that log moving the distribution directory for Mac v2 signing.
- updateLogContents = updateLogContents.replace(/Moving old [^\n]*\nrename_file: .*/g, "");
- updateLogContents = updateLogContents.replace(/New distribution directory .*/g, "");
- }
-
- if (IS_WIN) {
- // The FindFile results when enumerating the filesystem on Windows is not
- // determistic so the results matching the following need to be fixed.
- let re = new RegExp("([^\n]* 7\/7text1[^\n]*)\n" +
- "([^\n]* 7\/7text0[^\n]*)\n", "g");
- updateLogContents = updateLogContents.replace(re, "$2\n$1\n");
- }
-
- if (aReplace) {
- // Remove the lines which contain absolute paths
- updateLogContents = updateLogContents.replace(/^Begin moving.*$/mg, "");
- updateLogContents = updateLogContents.replace(/^ensure_remove: failed to remove file: .*$/mg, "");
- updateLogContents = updateLogContents.replace(/^ensure_remove_recursive: unable to remove directory: .*$/mg, "");
- updateLogContents = updateLogContents.replace(/^Removing tmpDir failed, err: -1$/mg, "");
- updateLogContents = updateLogContents.replace(/^remove_recursive_on_reboot: .*$/mg, "");
- }
-
- // Remove carriage returns.
- updateLogContents = updateLogContents.replace(/\r/g, "");
- // Replace error codes since they are different on each platform.
- updateLogContents = updateLogContents.replace(/, err:.*\n/g, "\n");
- // Replace to make the log parsing happy.
- updateLogContents = updateLogContents.replace(/non-fatal error /g, "");
- // Remove consecutive newlines
- updateLogContents = updateLogContents.replace(/\n+/g, "\n");
- // Remove leading and trailing newlines
- updateLogContents = updateLogContents.replace(/^\n|\n$/g, "");
- // Replace the log paths with <test_dir_path> and <update_dir_path>
- updateLogContents = replaceLogPaths(updateLogContents);
-
- let compareLogContents = "";
- if (aCompareLogFile) {
- compareLogContents = readFileBytes(getTestDirFile(aCompareLogFile));
- }
-
- if (aStaged) {
- compareLogContents = PERFORMING_STAGED_UPDATE + "\n" + compareLogContents;
- }
-
- // The channel-prefs.js is defined in gTestFilesCommon which will always be
- // located to the end of gTestFiles.
- if (gTestFiles.length > 1 &&
- gTestFiles[gTestFiles.length - 1].fileName == "channel-prefs.js" &&
- !gTestFiles[gTestFiles.length - 1].originalContents) {
- compareLogContents = compareLogContents.replace(/.*defaults\/.*/g, "");
- }
-
- if (gTestFiles.length > 2 &&
- gTestFiles[gTestFiles.length - 2].fileName == FILE_UPDATE_SETTINGS_INI &&
- !gTestFiles[gTestFiles.length - 2].originalContents) {
- compareLogContents = compareLogContents.replace(/.*update-settings.ini.*/g, "");
- }
-
- if (aExcludeDistDir) {
- compareLogContents = compareLogContents.replace(/.*distribution\/.*/g, "");
- }
-
- // Remove leading and trailing newlines
- compareLogContents = compareLogContents.replace(/\n+/g, "\n");
- // Remove leading and trailing newlines
- compareLogContents = compareLogContents.replace(/^\n|\n$/g, "");
-
- // Don't write the contents of the file to the log to reduce log spam
- // unless there is a failure.
- if (compareLogContents == updateLogContents) {
- Assert.ok(true, "the update log contents" + MSG_SHOULD_EQUAL);
- } else {
- logTestInfo("the update log contents are not correct");
- logUpdateLog(FILE_LAST_UPDATE_LOG);
- let aryLog = updateLogContents.split("\n");
- let aryCompare = compareLogContents.split("\n");
- // Pushing an empty string to both arrays makes it so either array's length
- // can be used in the for loop below without going out of bounds.
- aryLog.push("");
- aryCompare.push("");
- // xpcshell tests won't display the entire contents so log the first
- // incorrect line.
- for (let i = 0; i < aryLog.length; ++i) {
- if (aryLog[i] != aryCompare[i]) {
- logTestInfo("the first incorrect line in the update log is: " +
- aryLog[i]);
- Assert.equal(aryLog[i], aryCompare[i],
- "the update log contents" + MSG_SHOULD_EQUAL);
- }
- }
- // This should never happen!
- do_throw("Unable to find incorrect update log contents!");
- }
-}
-
-/**
- * Helper function to check if the update log contains a string.
- *
- * @param aCheckString
- * The string to check if the update log contains.
- */
-function checkUpdateLogContains(aCheckString) {
- let updateLog = getUpdateLog(FILE_LAST_UPDATE_LOG);
- let updateLogContents = readFileBytes(updateLog).replace(/\r\n/g, "\n");
- updateLogContents = replaceLogPaths(updateLogContents);
- Assert.notEqual(updateLogContents.indexOf(aCheckString), -1,
- "the update log contents should contain value: " +
- aCheckString);
-}
-
-/**
- * Helper function for updater binary tests for verifying the state of files and
- * directories after a successful update.
- *
- * @param aGetFileFunc
- * The function used to get the files in the directory to be checked.
- * @param aStageDirExists
- * If true the staging directory will be tested for existence and if
- * false the staging directory will be tested for non-existence.
- * @param aToBeDeletedDirExists
- * On Windows, if true the tobedeleted directory will be tested for
- * existence and if false the tobedeleted directory will be tested for
- * non-existence. On all othere platforms it will be tested for
- * non-existence.
- */
-function checkFilesAfterUpdateSuccess(aGetFileFunc, aStageDirExists = false,
- aToBeDeletedDirExists = false) {
- debugDump("testing contents of files after a successful update");
- gTestFiles.forEach(function CFAUS_TF_FE(aTestFile) {
- let testFile = aGetFileFunc(aTestFile.relPathDir + aTestFile.fileName, true);
- debugDump("testing file: " + testFile.path);
- if (aTestFile.compareFile || aTestFile.compareContents) {
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
-
- // Skip these tests on Windows since chmod doesn't really set permissions
- // on Windows.
- if (!IS_WIN && aTestFile.comparePerms) {
- // Check if the permssions as set in the complete mar file are correct.
- Assert.equal(testFile.permissions & 0xfff,
- aTestFile.comparePerms & 0xfff,
- "the file permissions" + MSG_SHOULD_EQUAL);
- }
-
- let fileContents1 = readFileBytes(testFile);
- let fileContents2 = aTestFile.compareFile ?
- readFileBytes(getTestDirFile(aTestFile.compareFile)) :
- aTestFile.compareContents;
- // Don't write the contents of the file to the log to reduce log spam
- // unless there is a failure.
- if (fileContents1 == fileContents2) {
- Assert.ok(true, "the file contents" + MSG_SHOULD_EQUAL);
- } else {
- Assert.equal(fileContents1, fileContents2,
- "the file contents" + MSG_SHOULD_EQUAL);
- }
- } else {
- Assert.ok(!testFile.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(testFile.path));
- }
- });
-
- debugDump("testing operations specified in removed-files were performed " +
- "after a successful update");
- gTestDirs.forEach(function CFAUS_TD_FE(aTestDir) {
- let testDir = aGetFileFunc(aTestDir.relPathDir, true);
- debugDump("testing directory: " + testDir.path);
- if (aTestDir.dirRemoved) {
- Assert.ok(!testDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(testDir.path));
- } else {
- Assert.ok(testDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testDir.path));
-
- if (aTestDir.files) {
- aTestDir.files.forEach(function CFAUS_TD_F_FE(aTestFile) {
- let testFile = aGetFileFunc(aTestDir.relPathDir + aTestFile, true);
- if (aTestDir.filesRemoved) {
- Assert.ok(!testFile.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(testFile.path));
- } else {
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
- }
- });
- }
-
- if (aTestDir.subDirs) {
- aTestDir.subDirs.forEach(function CFAUS_TD_SD_FE(aSubDir) {
- let testSubDir = aGetFileFunc(aTestDir.relPathDir + aSubDir, true);
- Assert.ok(testSubDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testSubDir.path));
- if (aTestDir.subDirFiles) {
- aTestDir.subDirFiles.forEach(function CFAUS_TD_SDF_FE(aTestFile) {
- let testFile = aGetFileFunc(aTestDir.relPathDir +
- aSubDir + aTestFile, true);
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
- });
- }
- });
- }
- }
- });
-
- checkFilesAfterUpdateCommon(aGetFileFunc, aStageDirExists,
- aToBeDeletedDirExists);
-}
-
-/**
- * Helper function for updater binary tests for verifying the state of files and
- * directories after a failed update.
- *
- * @param aGetFileFunc
- * The function used to get the files in the directory to be checked.
- * @param aStageDirExists
- * If true the staging directory will be tested for existence and if
- * false the staging directory will be tested for non-existence.
- * @param aToBeDeletedDirExists
- * On Windows, if true the tobedeleted directory will be tested for
- * existence and if false the tobedeleted directory will be tested for
- * non-existence. On all othere platforms it will be tested for
- * non-existence.
- */
-function checkFilesAfterUpdateFailure(aGetFileFunc, aStageDirExists = false,
- aToBeDeletedDirExists = false) {
- debugDump("testing contents of files after a failed update");
- gTestFiles.forEach(function CFAUF_TF_FE(aTestFile) {
- let testFile = aGetFileFunc(aTestFile.relPathDir + aTestFile.fileName, true);
- debugDump("testing file: " + testFile.path);
- if (aTestFile.compareFile || aTestFile.compareContents) {
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
-
- // Skip these tests on Windows since chmod doesn't really set permissions
- // on Windows.
- if (!IS_WIN && aTestFile.comparePerms) {
- // Check the original permssions are retained on the file.
- Assert.equal(testFile.permissions & 0xfff,
- aTestFile.comparePerms & 0xfff,
- "the file permissions" + MSG_SHOULD_EQUAL);
- }
-
- let fileContents1 = readFileBytes(testFile);
- let fileContents2 = aTestFile.compareFile ?
- readFileBytes(getTestDirFile(aTestFile.compareFile)) :
- aTestFile.compareContents;
- // Don't write the contents of the file to the log to reduce log spam
- // unless there is a failure.
- if (fileContents1 == fileContents2) {
- Assert.ok(true, "the file contents" + MSG_SHOULD_EQUAL);
- } else {
- Assert.equal(fileContents1, fileContents2,
- "the file contents" + MSG_SHOULD_EQUAL);
- }
- } else {
- Assert.ok(!testFile.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(testFile.path));
- }
- });
-
- debugDump("testing operations specified in removed-files were not " +
- "performed after a failed update");
- gTestDirs.forEach(function CFAUF_TD_FE(aTestDir) {
- let testDir = aGetFileFunc(aTestDir.relPathDir, true);
- Assert.ok(testDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testDir.path));
-
- if (aTestDir.files) {
- aTestDir.files.forEach(function CFAUS_TD_F_FE(aTestFile) {
- let testFile = aGetFileFunc(aTestDir.relPathDir + aTestFile, true);
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
- });
- }
-
- if (aTestDir.subDirs) {
- aTestDir.subDirs.forEach(function CFAUS_TD_SD_FE(aSubDir) {
- let testSubDir = aGetFileFunc(aTestDir.relPathDir + aSubDir, true);
- Assert.ok(testSubDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testSubDir.path));
- if (aTestDir.subDirFiles) {
- aTestDir.subDirFiles.forEach(function CFAUS_TD_SDF_FE(aTestFile) {
- let testFile = aGetFileFunc(aTestDir.relPathDir +
- aSubDir + aTestFile, true);
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
- });
- }
- });
- }
- });
-
- checkFilesAfterUpdateCommon(aGetFileFunc, aStageDirExists,
- aToBeDeletedDirExists);
-}
-
-/**
- * Helper function for updater binary tests for verifying the state of common
- * files and directories after a successful or failed update.
- *
- * @param aGetFileFunc
- * the function used to get the files in the directory to be checked.
- * @param aStageDirExists
- * If true the staging directory will be tested for existence and if
- * false the staging directory will be tested for non-existence.
- * @param aToBeDeletedDirExists
- * On Windows, if true the tobedeleted directory will be tested for
- * existence and if false the tobedeleted directory will be tested for
- * non-existence. On all othere platforms it will be tested for
- * non-existence.
- */
-function checkFilesAfterUpdateCommon(aGetFileFunc, aStageDirExists,
- aToBeDeletedDirExists) {
- debugDump("testing extra directories");
- let stageDir = getStageDirFile(null, true);
- if (aStageDirExists) {
- Assert.ok(stageDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(stageDir.path));
- } else {
- Assert.ok(!stageDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(stageDir.path));
- }
-
- let toBeDeletedDirExists = IS_WIN ? aToBeDeletedDirExists : false;
- let toBeDeletedDir = getApplyDirFile(DIR_TOBEDELETED, true);
- if (toBeDeletedDirExists) {
- Assert.ok(toBeDeletedDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(toBeDeletedDir.path));
- } else {
- Assert.ok(!toBeDeletedDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(toBeDeletedDir.path));
- }
-
- let updatingDir = getApplyDirFile("updating", true);
- Assert.ok(!updatingDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(updatingDir.path));
-
- if (stageDir.exists()) {
- updatingDir = stageDir.clone();
- updatingDir.append("updating");
- Assert.ok(!updatingDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(updatingDir.path));
- }
-
- debugDump("testing backup files should not be left behind in the " +
- "application directory");
- let applyToDir = getApplyDirFile(null, true);
- checkFilesInDirRecursive(applyToDir, checkForBackupFiles);
-
- if (stageDir.exists()) {
- debugDump("testing backup files should not be left behind in the " +
- "staging directory");
- applyToDir = getApplyDirFile(null, true);
- checkFilesInDirRecursive(stageDir, checkForBackupFiles);
- }
-}
-
-/**
- * Helper function for updater binary tests for verifying the contents of the
- * updater callback application log which should contain the arguments passed to
- * the callback application.
- */
-function checkCallbackLog() {
- let appLaunchLog = getApplyDirFile(DIR_RESOURCES + gCallbackArgs[1], true);
- if (!appLaunchLog.exists()) {
- // Uses do_timeout instead of do_execute_soon to lessen log spew.
- do_timeout(FILE_IN_USE_TIMEOUT_MS, checkCallbackLog);
- return;
- }
-
- let expectedLogContents = gCallbackArgs.join("\n") + "\n";
- let logContents = readFile(appLaunchLog);
- // It is possible for the log file contents check to occur before the log file
- // contents are completely written so wait until the contents are the expected
- // value. If the contents are never the expected value then the test will
- // fail by timing out after gTimeoutRuns is greater than MAX_TIMEOUT_RUNS or
- // the test harness times out the test.
- if (logContents != expectedLogContents) {
- gTimeoutRuns++;
- if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
- logTestInfo("callback log contents are not correct");
- // This file doesn't contain full paths so there is no need to call
- // replaceLogPaths.
- let aryLog = logContents.split("\n");
- let aryCompare = expectedLogContents.split("\n");
- // Pushing an empty string to both arrays makes it so either array's length
- // can be used in the for loop below without going out of bounds.
- aryLog.push("");
- aryCompare.push("");
- // xpcshell tests won't display the entire contents so log the incorrect
- // line.
- for (let i = 0; i < aryLog.length; ++i) {
- if (aryLog[i] != aryCompare[i]) {
- logTestInfo("the first incorrect line in the callback log is: " +
- aryLog[i]);
- Assert.equal(aryLog[i], aryCompare[i],
- "the callback log contents" + MSG_SHOULD_EQUAL);
- }
- }
- // This should never happen!
- do_throw("Unable to find incorrect callback log contents!");
- }
- // Uses do_timeout instead of do_execute_soon to lessen log spew.
- do_timeout(FILE_IN_USE_TIMEOUT_MS, checkCallbackLog);
- return;
- }
- Assert.ok(true, "the callback log contents" + MSG_SHOULD_EQUAL);
-
- waitForFilesInUse();
-}
-
-/**
- * Helper function for updater binary tests for getting the log and running
- * files created by the test helper binary file when called with the post-update
- * command line argument.
- *
- * @param aSuffix
- * The string to append to the post update test helper binary path.
- */
-function getPostUpdateFile(aSuffix) {
- return getApplyDirFile(DIR_RESOURCES + gPostUpdateBinFile + aSuffix, true);
-}
-
-/**
- * Checks the contents of the updater post update binary log. When completed
- * checkPostUpdateAppLogFinished will be called.
- */
-function checkPostUpdateAppLog() {
- // Only Mac OS X and Windows support post update.
- if (IS_MACOSX || IS_WIN) {
- gTimeoutRuns++;
- let postUpdateLog = getPostUpdateFile(".log");
- if (!postUpdateLog.exists()) {
- debugDump("postUpdateLog does not exist. Path: " + postUpdateLog.path);
- if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
- do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the post update " +
- "process to create the post update log. Path: " +
- postUpdateLog.path);
- }
- do_execute_soon(checkPostUpdateAppLog);
- return;
- }
-
- let logContents = readFile(postUpdateLog);
- // It is possible for the log file contents check to occur before the log file
- // contents are completely written so wait until the contents are the expected
- // value. If the contents are never the expected value then the test will
- // fail by timing out after gTimeoutRuns is greater than MAX_TIMEOUT_RUNS or
- // the test harness times out the test.
- if (logContents != "post-update\n") {
- if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
- do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the post update " +
- "process to create the expected contents in the post update log. Path: " +
- postUpdateLog.path);
- }
- do_execute_soon(checkPostUpdateAppLog);
- return;
- }
- Assert.ok(true, "the post update log contents" + MSG_SHOULD_EQUAL);
- }
-
- do_execute_soon(checkPostUpdateAppLogFinished);
-}
-
-/**
- * Helper function to check if a file is in use on Windows by making a copy of
- * a file and attempting to delete the original file. If the deletion is
- * successful the copy of the original file is renamed to the original file's
- * name and if the deletion is not successful the copy of the original file is
- * deleted.
- *
- * @param aFile
- * An nsIFile for the file to be checked if it is in use.
- * @return true if the file can't be deleted and false otherwise.
- */
-function isFileInUse(aFile) {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- if (!aFile.exists()) {
- debugDump("file does not exist, path: " + aFile.path);
- return false;
- }
-
- let fileBak = aFile.parent;
- fileBak.append(aFile.leafName + ".bak");
- try {
- if (fileBak.exists()) {
- fileBak.remove(false);
- }
- aFile.copyTo(aFile.parent, fileBak.leafName);
- aFile.remove(false);
- fileBak.moveTo(aFile.parent, aFile.leafName);
- debugDump("file is not in use, path: " + aFile.path);
- return false;
- } catch (e) {
- debugDump("file in use, path: " + aFile.path + ", exception: " + e);
- try {
- if (fileBak.exists()) {
- fileBak.remove(false);
- }
- } catch (ex) {
- logTestInfo("unable to remove backup file, path: " +
- fileBak.path + ", exception: " + ex);
- }
- }
- return true;
-}
-
-/**
- * Waits until files that are in use that break tests are no longer in use and
- * then calls doTestFinish to end the test.
- */
-function waitForFilesInUse() {
- if (IS_WIN) {
- let fileNames = [FILE_APP_BIN, FILE_UPDATER_BIN,
- FILE_MAINTENANCE_SERVICE_INSTALLER_BIN];
- for (let i = 0; i < fileNames.length; ++i) {
- let file = getApplyDirFile(fileNames[i], true);
- if (isFileInUse(file)) {
- do_timeout(FILE_IN_USE_TIMEOUT_MS, waitForFilesInUse);
- return;
- }
- }
- }
-
- debugDump("calling doTestFinish");
- doTestFinish();
-}
-
-/**
- * Helper function for updater binary tests for verifying there are no update
- * backup files left behind after an update.
- *
- * @param aFile
- * An nsIFile to check if it has moz-backup for its extension.
- */
-function checkForBackupFiles(aFile) {
- Assert.notEqual(getFileExtension(aFile), "moz-backup",
- "the file's extension should not equal moz-backup" +
- getMsgPath(aFile.path));
-}
-
-/**
- * Helper function for updater binary tests for recursively enumerating a
- * directory and calling a callback function with the file as a parameter for
- * each file found.
- *
- * @param aDir
- * A nsIFile for the directory to be deleted
- * @param aCallback
- * A callback function that will be called with the file as a
- * parameter for each file found.
- */
-function checkFilesInDirRecursive(aDir, aCallback) {
- if (!aDir.exists()) {
- do_throw("Directory must exist!");
- }
-
- let dirEntries = aDir.directoryEntries;
- while (dirEntries.hasMoreElements()) {
- let entry = dirEntries.getNext().QueryInterface(Ci.nsIFile);
-
- if (entry.exists()) {
- if (entry.isDirectory()) {
- checkFilesInDirRecursive(entry, aCallback);
- } else {
- aCallback(entry);
- }
- }
- }
-}
-
-
-/**
- * Helper function to override the update prompt component to verify whether it
- * is called or not.
- *
- * @param aCallback
- * The callback to call if the update prompt component is called.
- */
-function overrideUpdatePrompt(aCallback) {
- Cu.import("resource://testing-common/MockRegistrar.jsm");
- MockRegistrar.register("@mozilla.org/updates/update-prompt;1", UpdatePrompt, [aCallback]);
-}
-
-function UpdatePrompt(aCallback) {
- this._callback = aCallback;
-
- let fns = ["checkForUpdates", "showUpdateAvailable", "showUpdateDownloaded",
- "showUpdateError", "showUpdateHistory", "showUpdateInstalled"];
-
- fns.forEach(function UP_fns(aPromptFn) {
- UpdatePrompt.prototype[aPromptFn] = function() {
- if (!this._callback) {
- return;
- }
-
- let callback = this._callback[aPromptFn];
- if (!callback) {
- return;
- }
-
- callback.apply(this._callback,
- Array.prototype.slice.call(arguments));
- };
- });
-}
-
-UpdatePrompt.prototype = {
- flags: Ci.nsIClassInfo.SINGLETON,
- getScriptableHelper: () => null,
- getInterfaces: function(aCount) {
- let interfaces = [Ci.nsISupports, Ci.nsIUpdatePrompt];
- aCount.value = interfaces.length;
- return interfaces;
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIClassInfo, Ci.nsIUpdatePrompt])
-};
-
-/* Update check listener */
-const updateCheckListener = {
- onProgress: function UCL_onProgress(aRequest, aPosition, aTotalSize) {
- },
-
- onCheckComplete: function UCL_onCheckComplete(aRequest, aUpdates, aUpdateCount) {
- gRequestURL = aRequest.channel.originalURI.spec;
- gUpdateCount = aUpdateCount;
- gUpdates = aUpdates;
- debugDump("url = " + gRequestURL + ", " +
- "request.status = " + aRequest.status + ", " +
- "updateCount = " + aUpdateCount);
- // Use a timeout to allow the XHR to complete
- do_execute_soon(gCheckFunc);
- },
-
- onError: function UCL_onError(aRequest, aUpdate) {
- gRequestURL = aRequest.channel.originalURI.spec;
- gStatusCode = aRequest.status;
- if (gStatusCode == 0) {
- gStatusCode = aRequest.channel.QueryInterface(Ci.nsIRequest).status;
- }
- gStatusText = aUpdate.statusText ? aUpdate.statusText : null;
- debugDump("url = " + gRequestURL + ", " +
- "request.status = " + gStatusCode + ", " +
- "update.statusText = " + gStatusText);
- // Use a timeout to allow the XHR to complete
- do_execute_soon(gCheckFunc.bind(null, aRequest, aUpdate));
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIUpdateCheckListener])
-};
-
-/* Update download listener - nsIRequestObserver */
-const downloadListener = {
- onStartRequest: function DL_onStartRequest(aRequest, aContext) {
- },
-
- onProgress: function DL_onProgress(aRequest, aContext, aProgress, aMaxProgress) {
- },
-
- onStatus: function DL_onStatus(aRequest, aContext, aStatus, aStatusText) {
- },
-
- onStopRequest: function DL_onStopRequest(aRequest, aContext, aStatus) {
- gStatusResult = aStatus;
- // Use a timeout to allow the request to complete
- do_execute_soon(gCheckFunc);
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIRequestObserver,
- Ci.nsIProgressEventSink])
-};
-
-/**
- * Helper for starting the http server used by the tests
- */
-function start_httpserver() {
- let dir = getTestDirFile();
- debugDump("http server directory path: " + dir.path);
-
- if (!dir.isDirectory()) {
- do_throw("A file instead of a directory was specified for HttpServer " +
- "registerDirectory! Path: " + dir.path);
- }
-
- let { HttpServer } = Cu.import("resource://testing-common/httpd.js", {});
- gTestserver = new HttpServer();
- gTestserver.registerDirectory("/", dir);
- gTestserver.registerPathHandler("/" + gHTTPHandlerPath, pathHandler);
- gTestserver.start(-1);
- let testserverPort = gTestserver.identity.primaryPort;
- gURLData = URL_HOST + ":" + testserverPort + "/";
- debugDump("http server port = " + testserverPort);
-}
-
-/**
- * Custom path handler for the http server
- *
- * @param aMetadata
- * The http metadata for the request.
- * @param aResponse
- * The http response for the request.
- */
-function pathHandler(aMetadata, aResponse) {
- aResponse.setHeader("Content-Type", "text/xml", false);
- aResponse.setStatusLine(aMetadata.httpVersion, gResponseStatusCode, "OK");
- aResponse.bodyOutputStream.write(gResponseBody, gResponseBody.length);
-}
-
-/**
- * Helper for stopping the http server used by the tests
- *
- * @param aCallback
- * The callback to call after stopping the http server.
- */
-function stop_httpserver(aCallback) {
- Assert.ok(!!aCallback, "the aCallback parameter should be defined");
- gTestserver.stop(aCallback);
-}
-
-/**
- * Creates an nsIXULAppInfo
- *
- * @param aID
- * The ID of the test application
- * @param aName
- * A name for the test application
- * @param aVersion
- * The version of the application
- * @param aPlatformVersion
- * The gecko version of the application
- */
-function createAppInfo(aID, aName, aVersion, aPlatformVersion) {
- const XULAPPINFO_CONTRACTID = "@mozilla.org/xre/app-info;1";
- const XULAPPINFO_CID = Components.ID("{c763b610-9d49-455a-bbd2-ede71682a1ac}");
- let ifaces = [Ci.nsIXULAppInfo, Ci.nsIXULRuntime];
- if (IS_WIN) {
- ifaces.push(Ci.nsIWinAppHelper);
- }
- const XULAppInfo = {
- vendor: APP_INFO_VENDOR,
- name: aName,
- ID: aID,
- version: aVersion,
- appBuildID: "2007010101",
- platformVersion: aPlatformVersion,
- platformBuildID: "2007010101",
- inSafeMode: false,
- logConsoleErrors: true,
- OS: "XPCShell",
- XPCOMABI: "noarch-spidermonkey",
-
- QueryInterface: XPCOMUtils.generateQI(ifaces)
- };
-
- const XULAppInfoFactory = {
- createInstance: function(aOuter, aIID) {
- if (aOuter == null) {
- return XULAppInfo.QueryInterface(aIID);
- }
- throw Cr.NS_ERROR_NO_AGGREGATION;
- }
- };
-
- let registrar = Cm.QueryInterface(Ci.nsIComponentRegistrar);
- registrar.registerFactory(XULAPPINFO_CID, "XULAppInfo",
- XULAPPINFO_CONTRACTID, XULAppInfoFactory);
-}
-
-/**
- * Returns the platform specific arguments used by nsIProcess when launching
- * the application.
- *
- * @param aExtraArgs (optional)
- * An array of extra arguments to append to the default arguments.
- * @return an array of arguments to be passed to nsIProcess.
- *
- * Note: a shell is necessary to pipe the application's console output which
- * would otherwise pollute the xpcshell log.
- *
- * Command line arguments used when launching the application:
- * -no-remote prevents shell integration from being affected by an existing
- * application process.
- * -test-process-updates makes the application exit after being relaunched by
- * the updater.
- * the platform specific string defined by PIPE_TO_NULL to output both stdout
- * and stderr to null. This is needed to prevent output from the application
- * from ending up in the xpchsell log.
- */
-function getProcessArgs(aExtraArgs) {
- if (!aExtraArgs) {
- aExtraArgs = [];
- }
-
- let appBinPath = getApplyDirFile(DIR_MACOS + FILE_APP_BIN, false).path;
- if (/ /.test(appBinPath)) {
- appBinPath = '"' + appBinPath + '"';
- }
-
- let args;
- if (IS_UNIX) {
- let launchScript = getLaunchScript();
- // Precreate the script with executable permissions
- launchScript.create(Ci.nsILocalFile.NORMAL_FILE_TYPE, PERMS_DIRECTORY);
-
- let scriptContents = "#! /bin/sh\n";
- scriptContents += appBinPath + " -no-remote -test-process-updates " +
- aExtraArgs.join(" ") + " " + PIPE_TO_NULL;
- writeFile(launchScript, scriptContents);
- debugDump("created " + launchScript.path + " containing:\n" +
- scriptContents);
- args = [launchScript.path];
- } else {
- args = ["/D", "/Q", "/C", appBinPath, "-no-remote", "-test-process-updates"].
- concat(aExtraArgs).concat([PIPE_TO_NULL]);
- }
- return args;
-}
-
-/**
- * Gets a file path for the application to dump its arguments into. This is used
- * to verify that a callback application is launched.
- *
- * @return the file for the application to dump its arguments into.
- */
-function getAppArgsLogPath() {
- let appArgsLog = do_get_file("/" + gTestID + "_app_args_log", true);
- if (appArgsLog.exists()) {
- appArgsLog.remove(false);
- }
- let appArgsLogPath = appArgsLog.path;
- if (/ /.test(appArgsLogPath)) {
- appArgsLogPath = '"' + appArgsLogPath + '"';
- }
- return appArgsLogPath;
-}
-
-/**
- * Gets the nsIFile reference for the shell script to launch the application. If
- * the file exists it will be removed by this function.
- *
- * @return the nsIFile for the shell script to launch the application.
- */
-function getLaunchScript() {
- let launchScript = do_get_file("/" + gTestID + "_launch.sh", true);
- if (launchScript.exists()) {
- launchScript.remove(false);
- }
- return launchScript;
-}
-
-/**
- * Makes GreD, XREExeF, and UpdRootD point to unique file system locations so
- * xpcshell tests can run in parallel and to keep the environment clean.
- */
-function adjustGeneralPaths() {
- let dirProvider = {
- getFile: function AGP_DP_getFile(aProp, aPersistent) {
- aPersistent.value = true;
- switch (aProp) {
- case NS_GRE_DIR:
- if (gUseTestAppDir) {
- return getApplyDirFile(DIR_RESOURCES, true);
- }
- break;
- case NS_GRE_BIN_DIR:
- if (gUseTestAppDir) {
- return getApplyDirFile(DIR_MACOS, true);
- }
- break;
- case XRE_EXECUTABLE_FILE:
- if (gUseTestAppDir) {
- return getApplyDirFile(DIR_MACOS + FILE_APP_BIN, true);
- }
- break;
- case XRE_UPDATE_ROOT_DIR:
- return getMockUpdRootD();
- }
- return null;
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIDirectoryServiceProvider])
- };
- let ds = Services.dirsvc.QueryInterface(Ci.nsIDirectoryService);
- ds.QueryInterface(Ci.nsIProperties).undefine(NS_GRE_DIR);
- ds.QueryInterface(Ci.nsIProperties).undefine(NS_GRE_BIN_DIR);
- ds.QueryInterface(Ci.nsIProperties).undefine(XRE_EXECUTABLE_FILE);
- ds.registerProvider(dirProvider);
- do_register_cleanup(function AGP_cleanup() {
- debugDump("start - unregistering directory provider");
-
- if (gAppTimer) {
- debugDump("start - cancel app timer");
- gAppTimer.cancel();
- gAppTimer = null;
- debugDump("finish - cancel app timer");
- }
-
- if (gProcess && gProcess.isRunning) {
- debugDump("start - kill process");
- try {
- gProcess.kill();
- } catch (e) {
- debugDump("kill process failed. Exception: " + e);
- }
- gProcess = null;
- debugDump("finish - kill process");
- }
-
- if (gHandle) {
- try {
- debugDump("start - closing handle");
- let kernel32 = ctypes.open("kernel32");
- let CloseHandle = kernel32.declare("CloseHandle", ctypes.default_abi,
- ctypes.bool, /* return*/
- ctypes.voidptr_t /* handle*/);
- if (!CloseHandle(gHandle)) {
- debugDump("call to CloseHandle failed");
- }
- kernel32.close();
- gHandle = null;
- debugDump("finish - closing handle");
- } catch (e) {
- debugDump("call to CloseHandle failed. Exception: " + e);
- }
- }
-
- // Call end_test first before the directory provider is unregistered
- if (typeof end_test == typeof Function) {
- debugDump("calling end_test");
- end_test();
- }
-
- ds.unregisterProvider(dirProvider);
- cleanupTestCommon();
-
- debugDump("finish - unregistering directory provider");
- });
-}
-
-/**
- * The timer callback to kill the process if it takes too long.
- */
-const gAppTimerCallback = {
- notify: function TC_notify(aTimer) {
- gAppTimer = null;
- if (gProcess.isRunning) {
- logTestInfo("attempting to kill process");
- gProcess.kill();
- }
- Assert.ok(false, "launch application timer expired");
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsITimerCallback])
-};
-
-/**
- * Launches an application to apply an update.
- */
-function runUpdateUsingApp(aExpectedStatus) {
- /**
- * The observer for the call to nsIProcess:runAsync. When completed
- * runUpdateFinished will be called.
- */
- const processObserver = {
- observe: function PO_observe(aSubject, aTopic, aData) {
- debugDump("topic: " + aTopic + ", process exitValue: " +
- gProcess.exitValue);
- resetEnvironment();
- if (gAppTimer) {
- gAppTimer.cancel();
- gAppTimer = null;
- }
- Assert.equal(gProcess.exitValue, 0,
- "the application process exit value should be 0");
- Assert.equal(aTopic, "process-finished",
- "the application process observer topic should be " +
- "process-finished");
-
- if (IS_SERVICE_TEST) {
- waitForServiceStop(false);
- }
-
- do_execute_soon(afterAppExits);
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver])
- };
-
- function afterAppExits() {
- gTimeoutRuns++;
-
- if (IS_WIN) {
- waitForApplicationStop(FILE_UPDATER_BIN);
- }
-
- let status;
- try {
- status = readStatusFile();
- } catch (e) {
- logTestInfo("error reading status file, exception: " + e);
- }
- // Don't proceed until the update's status is the expected value.
- if (status != aExpectedStatus) {
- if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
- logUpdateLog(FILE_UPDATE_LOG);
- do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the update " +
- "status to equal: " +
- aExpectedStatus +
- ", current status: " + status);
- } else {
- do_timeout(FILE_IN_USE_TIMEOUT_MS, afterAppExits);
- }
- return;
- }
-
- // Don't check for an update log when the code in nsUpdateDriver.cpp skips
- // updating.
- if (aExpectedStatus != STATE_PENDING &&
- aExpectedStatus != STATE_PENDING_SVC &&
- aExpectedStatus != STATE_APPLIED &&
- aExpectedStatus != STATE_APPLIED_SVC) {
- // Don't proceed until the update log has been created.
- let log = getUpdateLog(FILE_UPDATE_LOG);
- if (!log.exists()) {
- if (gTimeoutRuns > MAX_TIMEOUT_RUNS) {
- do_throw("Exceeded MAX_TIMEOUT_RUNS while waiting for the update " +
- "log to be created. Path: " + log.path);
- }
- do_timeout(FILE_IN_USE_TIMEOUT_MS, afterAppExits);
- return;
- }
- }
-
- do_execute_soon(runUpdateFinished);
- }
-
- debugDump("start - launching application to apply update");
-
- let appBin = getApplyDirFile(DIR_MACOS + FILE_APP_BIN, false);
-
- let launchBin = getLaunchBin();
- let args = getProcessArgs();
- debugDump("launching " + launchBin.path + " " + args.join(" "));
-
- gProcess = Cc["@mozilla.org/process/util;1"].
- createInstance(Ci.nsIProcess);
- gProcess.init(launchBin);
-
- gAppTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
- gAppTimer.initWithCallback(gAppTimerCallback, APP_TIMER_TIMEOUT,
- Ci.nsITimer.TYPE_ONE_SHOT);
-
- setEnvironment();
- debugDump("launching application");
- gProcess.runAsync(args, args.length, processObserver);
-
- debugDump("finish - launching application to apply update");
-}
-
-/**
- * Sets the environment that will be used by the application process when it is
- * launched.
- */
-function setEnvironment() {
- // Prevent setting the environment more than once.
- if (gShouldResetEnv !== undefined) {
- return;
- }
-
- gShouldResetEnv = true;
-
- // See bug 1279108.
- if (gEnv.exists("ASAN_OPTIONS")) {
- gASanOptions = gEnv.get("ASAN_OPTIONS");
- gEnv.set("ASAN_OPTIONS", gASanOptions + ":detect_leaks=0");
- } else {
- gEnv.set("ASAN_OPTIONS", "detect_leaks=0");
- }
-
- if (IS_WIN && !gEnv.exists("XRE_NO_WINDOWS_CRASH_DIALOG")) {
- gAddedEnvXRENoWindowsCrashDialog = true;
- debugDump("setting the XRE_NO_WINDOWS_CRASH_DIALOG environment " +
- "variable to 1... previously it didn't exist");
- gEnv.set("XRE_NO_WINDOWS_CRASH_DIALOG", "1");
- }
-
- if (IS_UNIX) {
- let appGreBinDir = gGREBinDirOrig.clone();
- let envGreBinDir = Cc["@mozilla.org/file/local;1"].
- createInstance(Ci.nsILocalFile);
- let shouldSetEnv = true;
- if (IS_MACOSX) {
- if (gEnv.exists("DYLD_LIBRARY_PATH")) {
- gEnvDyldLibraryPath = gEnv.get("DYLD_LIBRARY_PATH");
- envGreBinDir.initWithPath(gEnvDyldLibraryPath);
- if (envGreBinDir.path == appGreBinDir.path) {
- gEnvDyldLibraryPath = null;
- shouldSetEnv = false;
- }
- }
-
- if (shouldSetEnv) {
- debugDump("setting DYLD_LIBRARY_PATH environment variable value to " +
- appGreBinDir.path);
- gEnv.set("DYLD_LIBRARY_PATH", appGreBinDir.path);
- }
- } else {
- if (gEnv.exists("LD_LIBRARY_PATH")) {
- gEnvLdLibraryPath = gEnv.get("LD_LIBRARY_PATH");
- envGreBinDir.initWithPath(gEnvLdLibraryPath);
- if (envGreBinDir.path == appGreBinDir.path) {
- gEnvLdLibraryPath = null;
- shouldSetEnv = false;
- }
- }
-
- if (shouldSetEnv) {
- debugDump("setting LD_LIBRARY_PATH environment variable value to " +
- appGreBinDir.path);
- gEnv.set("LD_LIBRARY_PATH", appGreBinDir.path);
- }
- }
- }
-
- if (gEnv.exists("XPCOM_MEM_LEAK_LOG")) {
- gEnvXPCOMMemLeakLog = gEnv.get("XPCOM_MEM_LEAK_LOG");
- debugDump("removing the XPCOM_MEM_LEAK_LOG environment variable... " +
- "previous value " + gEnvXPCOMMemLeakLog);
- gEnv.set("XPCOM_MEM_LEAK_LOG", "");
- }
-
- if (gEnv.exists("XPCOM_DEBUG_BREAK")) {
- gEnvXPCOMDebugBreak = gEnv.get("XPCOM_DEBUG_BREAK");
- debugDump("setting the XPCOM_DEBUG_BREAK environment variable to " +
- "warn... previous value " + gEnvXPCOMDebugBreak);
- } else {
- debugDump("setting the XPCOM_DEBUG_BREAK environment variable to " +
- "warn... previously it didn't exist");
- }
-
- gEnv.set("XPCOM_DEBUG_BREAK", "warn");
-
- if (IS_SERVICE_TEST) {
- debugDump("setting MOZ_NO_SERVICE_FALLBACK environment variable to 1");
- gEnv.set("MOZ_NO_SERVICE_FALLBACK", "1");
- }
-}
-
-/**
- * Sets the environment back to the original values after launching the
- * application.
- */
-function resetEnvironment() {
- // Prevent resetting the environment more than once.
- if (gShouldResetEnv !== true) {
- return;
- }
-
- gShouldResetEnv = false;
-
- // Restore previous ASAN_OPTIONS if there were any.
- gEnv.set("ASAN_OPTIONS", gASanOptions ? gASanOptions : "");
-
- if (gEnvXPCOMMemLeakLog) {
- debugDump("setting the XPCOM_MEM_LEAK_LOG environment variable back to " +
- gEnvXPCOMMemLeakLog);
- gEnv.set("XPCOM_MEM_LEAK_LOG", gEnvXPCOMMemLeakLog);
- }
-
- if (gEnvXPCOMDebugBreak) {
- debugDump("setting the XPCOM_DEBUG_BREAK environment variable back to " +
- gEnvXPCOMDebugBreak);
- gEnv.set("XPCOM_DEBUG_BREAK", gEnvXPCOMDebugBreak);
- } else if (gEnv.exists("XPCOM_DEBUG_BREAK")) {
- debugDump("clearing the XPCOM_DEBUG_BREAK environment variable");
- gEnv.set("XPCOM_DEBUG_BREAK", "");
- }
-
- if (IS_UNIX) {
- if (IS_MACOSX) {
- if (gEnvDyldLibraryPath) {
- debugDump("setting DYLD_LIBRARY_PATH environment variable value " +
- "back to " + gEnvDyldLibraryPath);
- gEnv.set("DYLD_LIBRARY_PATH", gEnvDyldLibraryPath);
- } else if (gEnvDyldLibraryPath !== null) {
- debugDump("removing DYLD_LIBRARY_PATH environment variable");
- gEnv.set("DYLD_LIBRARY_PATH", "");
- }
- } else if (gEnvLdLibraryPath) {
- debugDump("setting LD_LIBRARY_PATH environment variable value back " +
- "to " + gEnvLdLibraryPath);
- gEnv.set("LD_LIBRARY_PATH", gEnvLdLibraryPath);
- } else if (gEnvLdLibraryPath !== null) {
- debugDump("removing LD_LIBRARY_PATH environment variable");
- gEnv.set("LD_LIBRARY_PATH", "");
- }
- }
-
- if (IS_WIN && gAddedEnvXRENoWindowsCrashDialog) {
- debugDump("removing the XRE_NO_WINDOWS_CRASH_DIALOG environment " +
- "variable");
- gEnv.set("XRE_NO_WINDOWS_CRASH_DIALOG", "");
- }
-
- if (IS_SERVICE_TEST) {
- debugDump("removing MOZ_NO_SERVICE_FALLBACK environment variable");
- gEnv.set("MOZ_NO_SERVICE_FALLBACK", "");
- }
-}
diff --git a/toolkit/mozapps/update/tests/moz.build b/toolkit/mozapps/update/tests/moz.build
deleted file mode 100644
index 94949b17f..000000000
--- a/toolkit/mozapps/update/tests/moz.build
+++ /dev/null
@@ -1,95 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-HAS_MISC_RULE = True
-
-FINAL_TARGET = '_tests/xpcshell/toolkit/mozapps/update/tests/data'
-
-MOCHITEST_CHROME_MANIFESTS += ['chrome/chrome.ini']
-
-XPCSHELL_TESTS_MANIFESTS += [
- 'unit_aus_update/xpcshell.ini',
- 'unit_base_updater/xpcshell.ini'
-]
-
-SimplePrograms([
- 'TestAUSHelper',
- 'TestAUSReadStrings',
-])
-
-LOCAL_INCLUDES += [
- '/toolkit/mozapps/update',
- '/toolkit/mozapps/update/common',
-]
-
-if CONFIG['OS_ARCH'] == 'WINNT':
- USE_LIBS += [
- 'updatecommon-standalone',
- ]
-
- OS_LIBS += [
- 'shlwapi',
- ]
-else:
- USE_LIBS += [
- 'updatecommon',
- ]
-
-for var in ('MOZ_APP_NAME', 'MOZ_APP_BASENAME', 'MOZ_APP_DISPLAYNAME',
- 'MOZ_APP_VENDOR', 'BIN_SUFFIX', 'MOZ_DEBUG'):
- DEFINES[var] = CONFIG[var]
-
-DEFINES['NS_NO_XPCOM'] = True
-
-# For debugging purposes only
-#DEFINES['DISABLE_UPDATER_AUTHENTICODE_CHECK'] = True
-
-if CONFIG['OS_ARCH'] == 'WINNT':
- DEFINES['UNICODE'] = True
- DEFINES['_UNICODE'] = True
- USE_STATIC_LIBS = True
- if CONFIG['GNU_CC']:
- WIN32_EXE_LDFLAGS += ['-municode']
-
-TEST_HARNESS_FILES.testing.mochitest.chrome.toolkit.mozapps.update.tests.data += [
- 'data/shared.js',
- 'data/sharedUpdateXML.js',
- 'data/simple.mar',
-]
-
-FINAL_TARGET_FILES += [
- 'data/complete.exe',
- 'data/complete.mar',
- 'data/complete.png',
- 'data/complete_log_success_mac',
- 'data/complete_log_success_win',
- 'data/complete_mac.mar',
- 'data/complete_precomplete',
- 'data/complete_precomplete_mac',
- 'data/complete_removed-files',
- 'data/complete_removed-files_mac',
- 'data/complete_update_manifest',
- 'data/old_version.mar',
- 'data/partial.exe',
- 'data/partial.mar',
- 'data/partial.png',
- 'data/partial_log_failure_mac',
- 'data/partial_log_failure_win',
- 'data/partial_log_success_mac',
- 'data/partial_log_success_win',
- 'data/partial_mac.mar',
- 'data/partial_precomplete',
- 'data/partial_precomplete_mac',
- 'data/partial_removed-files',
- 'data/partial_removed-files_mac',
- 'data/partial_update_manifest',
- 'data/replace_log_success',
- 'data/shared.js',
- 'data/sharedUpdateXML.js',
- 'data/simple.mar',
- 'data/wrong_product_channel.mar',
- 'data/xpcshellUtilsAUS.js',
-]
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/.eslintrc.js b/toolkit/mozapps/update/tests/unit_aus_update/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/canCheckForAndCanApplyUpdates.js b/toolkit/mozapps/update/tests/unit_aus_update/canCheckForAndCanApplyUpdates.js
deleted file mode 100644
index 1985df959..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/canCheckForAndCanApplyUpdates.js
+++ /dev/null
@@ -1,138 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-function run_test() {
- setupTestCommon();
-
- // Verify write access to the custom app dir
- debugDump("testing write access to the application directory");
- let testFile = getCurrentProcessDir();
- testFile.append("update_write_access_test");
- testFile.create(Ci.nsIFile.NORMAL_FILE_TYPE, PERMS_FILE);
- Assert.ok(testFile.exists(), MSG_SHOULD_EXIST);
- testFile.remove(false);
- Assert.ok(!testFile.exists(), MSG_SHOULD_NOT_EXIST);
-
- standardInit();
-
- if (IS_WIN) {
- // Create a mutex to prevent being able to check for or apply updates.
- debugDump("attempting to create mutex");
- let handle = createMutex(getPerInstallationMutexName());
- Assert.ok(!!handle, "the update mutex should have been created");
-
- // Check if available updates cannot be checked for when there is a mutex
- // for this installation.
- Assert.ok(!gAUS.canCheckForUpdates, "should not be able to check for " +
- "updates when there is an update mutex");
-
- // Check if updates cannot be applied when there is a mutex for this
- // installation.
- Assert.ok(!gAUS.canApplyUpdates, "should not be able to apply updates " +
- "when there is an update mutex");
-
- debugDump("destroying mutex");
- closeHandle(handle);
- }
-
- // Check if available updates can be checked for
- Assert.ok(gAUS.canCheckForUpdates, "should be able to check for updates");
- // Check if updates can be applied
- Assert.ok(gAUS.canApplyUpdates, "should be able to apply updates");
-
- if (IS_WIN) {
- // Attempt to create a mutex when application update has already created one
- // with the same name.
- debugDump("attempting to create mutex");
- let handle = createMutex(getPerInstallationMutexName());
-
- Assert.ok(!handle, "should not be able to create the update mutex when " +
- "the application has created the update mutex");
- }
-
- doTestFinish();
-}
-
-/**
- * Determines a unique mutex name for the installation.
- *
- * @return Global mutex path.
- */
-function getPerInstallationMutexName() {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- let hasher = Cc["@mozilla.org/security/hash;1"].
- createInstance(Ci.nsICryptoHash);
- hasher.init(hasher.SHA1);
-
- let exeFile = Services.dirsvc.get(XRE_EXECUTABLE_FILE, Ci.nsILocalFile);
-
- let converter = Cc["@mozilla.org/intl/scriptableunicodeconverter"].
- createInstance(Ci.nsIScriptableUnicodeConverter);
- converter.charset = "UTF-8";
- let data = converter.convertToByteArray(exeFile.path.toLowerCase());
-
- hasher.update(data, data.length);
- return "Global\\MozillaUpdateMutex-" + hasher.finish(true);
-}
-
-/**
- * Closes a Win32 handle.
- *
- * @param aHandle
- * The handle to close.
- */
-function closeHandle(aHandle) {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- let lib = ctypes.open("kernel32.dll");
- let CloseHandle = lib.declare("CloseHandle",
- ctypes.winapi_abi,
- ctypes.int32_t, /* success */
- ctypes.void_t.ptr); /* handle */
- CloseHandle(aHandle);
- lib.close();
-}
-
-/**
- * Creates a mutex.
- *
- * @param aName
- * The name for the mutex.
- * @return The Win32 handle to the mutex.
- */
-function createMutex(aName) {
- if (!IS_WIN) {
- do_throw("Windows only function called by a different platform!");
- }
-
- const INITIAL_OWN = 1;
- const ERROR_ALREADY_EXISTS = 0xB7;
- let lib = ctypes.open("kernel32.dll");
- let CreateMutexW = lib.declare("CreateMutexW",
- ctypes.winapi_abi,
- ctypes.void_t.ptr, /* return handle */
- ctypes.void_t.ptr, /* security attributes */
- ctypes.int32_t, /* initial owner */
- ctypes.char16_t.ptr); /* name */
-
- let handle = CreateMutexW(null, INITIAL_OWN, aName);
- lib.close();
- let alreadyExists = ctypes.winLastError == ERROR_ALREADY_EXISTS;
- if (handle && !handle.isNull() && alreadyExists) {
- closeHandle(handle);
- handle = null;
- }
-
- if (handle && handle.isNull()) {
- handle = null;
- }
-
- return handle;
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForDifferentChannel.js b/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForDifferentChannel.js
deleted file mode 100644
index a0a95af1b..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForDifferentChannel.js
+++ /dev/null
@@ -1,46 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Update Manager Tests */
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing removal of an active update for a channel that is not" +
- "valid due to switching channels (Bug 486275).");
-
- let patches = getLocalPatchString(null, null, null, null, null, null,
- STATE_DOWNLOADING);
- let updates = getLocalUpdateString(patches, null, null, "version 1.0", "1.0");
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeStatusFile(STATE_DOWNLOADING);
-
- patches = getLocalPatchString(null, null, null, null, null, null,
- STATE_FAILED);
- updates = getLocalUpdateString(patches, null, "Existing", "version 3.0",
- "3.0", "3.0", null, null, null, null,
- getString("patchApplyFailure"));
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), false);
-
- setUpdateChannel("original_channel");
-
- standardInit();
-
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager update count" + MSG_SHOULD_EQUAL);
- let update = gUpdateManager.getUpdateAt(0);
- Assert.equal(update.name, "Existing",
- "the update's name" + MSG_SHOULD_EQUAL);
-
- Assert.ok(!gUpdateManager.activeUpdate,
- "there should not be an active update");
- // Verify that the active-update.xml file has had the update from the old
- // channel removed.
- let file = getUpdatesXMLFile(true);
- Assert.equal(readFile(file), getLocalUpdatesXMLString(""),
- "the contents of active-update.xml" + MSG_SHOULD_EQUAL);
-
- doTestFinish();
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForOlderAppVersion.js b/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForOlderAppVersion.js
deleted file mode 100644
index fc4f09787..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForOlderAppVersion.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing cleanup of an update download in progress for an " +
- "older version of the application on startup (Bug 485624)");
-
- let patches = getLocalPatchString(null, null, null, null, null, null,
- STATE_DOWNLOADING);
- let updates = getLocalUpdateString(patches, null, null, "version 0.9", "0.9");
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeStatusFile(STATE_DOWNLOADING);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
-
- standardInit();
-
- Assert.ok(!gUpdateManager.activeUpdate,
- "there should not be an active update");
- Assert.equal(gUpdateManager.updateCount, 0,
- "the update manager update count" + MSG_SHOULD_EQUAL);
-
- doTestFinish();
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForSameVersionAndBuildID.js b/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForSameVersionAndBuildID.js
deleted file mode 100644
index b2d8ecbc6..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingForSameVersionAndBuildID.js
+++ /dev/null
@@ -1,30 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing removal of an update download in progress for the " +
- "same version of the application with the same application " +
- "build id on startup (Bug 536547)");
-
- let patches = getLocalPatchString(null, null, null, null, null, null,
- STATE_DOWNLOADING);
- let updates = getLocalUpdateString(patches, null, null, "version 1.0", "1.0",
- "2007010101");
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeStatusFile(STATE_DOWNLOADING);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
-
- standardInit();
-
- Assert.ok(!gUpdateManager.activeUpdate,
- "there should not be an active update");
- Assert.equal(gUpdateManager.updateCount, 0,
- "the update manager update count" + MSG_SHOULD_EQUAL);
-
- doTestFinish();
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingIncorrectStatus.js b/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingIncorrectStatus.js
deleted file mode 100644
index 13e4aeaf6..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/cleanupDownloadingIncorrectStatus.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing update cleanup when reading the status file returns " +
- "STATUS_NONE and the update xml has an update with " +
- "STATE_DOWNLOADING (Bug 539717).");
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- let patches = getLocalPatchString(null, null, null, null, null, null,
- STATE_DOWNLOADING);
- let updates = getLocalUpdateString(patches);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeStatusFile(STATE_NONE);
-
- standardInit();
-
- let dir = getUpdatesDir();
- dir.append(DIR_PATCH);
- Assert.ok(dir.exists(), MSG_SHOULD_EXIST);
-
- let statusFile = dir.clone();
- statusFile.append(FILE_UPDATE_STATUS);
- Assert.ok(!statusFile.exists(), MSG_SHOULD_NOT_EXIST);
-
- Assert.ok(!gUpdateManager.activeUpdate,
- "there should not be an active update");
- Assert.equal(gUpdateManager.updateCount, 0,
- "the update manager update count" + MSG_SHOULD_EQUAL);
-
- doTestFinish();
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/cleanupPendingVersionFileIncorrectStatus.js b/toolkit/mozapps/update/tests/unit_aus_update/cleanupPendingVersionFileIncorrectStatus.js
deleted file mode 100644
index 7661da82d..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/cleanupPendingVersionFileIncorrectStatus.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing update cleanup when reading the status file returns " +
- "STATUS_NONE, the version file is for a newer version, and the " +
- "update xml has an update with STATE_PENDING (Bug 601701).");
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- let patches = getLocalPatchString(null, null, null, null, null, null,
- STATE_PENDING);
- let updates = getLocalUpdateString(patches);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeVersionFile("99.9");
-
- standardInit();
-
- // Check that there is no activeUpdate first so the updates directory is
- // cleaned up by the UpdateManager before the remaining tests.
- Assert.ok(!gUpdateManager.activeUpdate,
- "there should not be an active update");
- Assert.equal(gUpdateManager.updateCount, 0,
- "the update manager update count" + MSG_SHOULD_EQUAL);
-
- let dir = getUpdatesDir();
- dir.append(DIR_PATCH);
- Assert.ok(dir.exists(), MSG_SHOULD_EXIST);
-
- let versionFile = dir.clone();
- versionFile.append(FILE_UPDATE_VERSION);
- Assert.ok(!versionFile.exists(), MSG_SHOULD_NOT_EXIST);
-
- doTestFinish();
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogMove.js b/toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogMove.js
deleted file mode 100644
index d683b9931..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogMove.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing that the update.log is moved after a successful update");
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- let patches = getLocalPatchString(null, null, null, null, null, null,
- STATE_PENDING);
- let updates = getLocalUpdateString(patches);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeStatusFile(STATE_SUCCEEDED);
-
- let log = getUpdateLog(FILE_UPDATE_LOG);
- writeFile(log, "Last Update Log");
-
- standardInit();
-
- Assert.ok(!log.exists(), MSG_SHOULD_NOT_EXIST);
-
- log = getUpdateLog(FILE_LAST_UPDATE_LOG);
- Assert.ok(log.exists(), MSG_SHOULD_EXIST);
- Assert.equal(readFile(log), "Last Update Log",
- "the last update log contents" + MSG_SHOULD_EQUAL);
-
- log = getUpdateLog(FILE_BACKUP_UPDATE_LOG);
- Assert.ok(!log.exists(), MSG_SHOULD_NOT_EXIST);
-
- let dir = getUpdatesPatchDir();
- Assert.ok(dir.exists(), MSG_SHOULD_EXIST);
-
- doTestFinish();
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogsFIFO.js b/toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogsFIFO.js
deleted file mode 100644
index 8be93d0ff..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/cleanupSuccessLogsFIFO.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing update logs are first in first out deleted");
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- let patches = getLocalPatchString(null, null, null, null, null, null,
- STATE_PENDING);
- let updates = getLocalUpdateString(patches);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeStatusFile(STATE_SUCCEEDED);
-
- let log = getUpdateLog(FILE_LAST_UPDATE_LOG);
- writeFile(log, "Backup Update Log");
-
- log = getUpdateLog(FILE_BACKUP_UPDATE_LOG);
- writeFile(log, "To Be Deleted Backup Update Log");
-
- log = getUpdateLog(FILE_UPDATE_LOG);
- writeFile(log, "Last Update Log");
-
- standardInit();
-
- Assert.ok(!log.exists(), MSG_SHOULD_NOT_EXIST);
-
- log = getUpdateLog(FILE_LAST_UPDATE_LOG);
- Assert.ok(log.exists(), MSG_SHOULD_EXIST);
- Assert.equal(readFile(log), "Last Update Log",
- "the last update log contents" + MSG_SHOULD_EQUAL);
-
- log = getUpdateLog(FILE_BACKUP_UPDATE_LOG);
- Assert.ok(log.exists(), MSG_SHOULD_EXIST);
- Assert.equal(readFile(log), "Backup Update Log",
- "the backup update log contents" + MSG_SHOULD_EQUAL);
-
- let dir = getUpdatesPatchDir();
- Assert.ok(dir.exists(), MSG_SHOULD_EXIST);
-
- doTestFinish();
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/downloadAndHashCheckMar.js b/toolkit/mozapps/update/tests/unit_aus_update/downloadAndHashCheckMar.js
deleted file mode 100644
index b715fb56e..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/downloadAndHashCheckMar.js
+++ /dev/null
@@ -1,161 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-var gNextRunFunc;
-var gExpectedStatusResult;
-
-function run_test() {
- // The network code that downloads the mar file accesses the profile to cache
- // the download, but the profile is only available after calling
- // do_get_profile in xpcshell tests. This prevents an error from being logged.
- do_get_profile();
-
- setupTestCommon();
-
- debugDump("testing mar download and mar hash verification");
-
- Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, false);
- start_httpserver();
- setUpdateURL(gURLData + gHTTPHandlerPath);
- standardInit();
- // Only perform the non hash check tests when mar signing is enabled since the
- // update service doesn't perform hash checks when mar signing is enabled.
- if (MOZ_VERIFY_MAR_SIGNATURE) {
- do_execute_soon(run_test_pt11);
- } else {
- do_execute_soon(run_test_pt1);
- }
-}
-
-// The HttpServer must be stopped before calling do_test_finished
-function finish_test() {
- stop_httpserver(doTestFinish);
-}
-
-// Helper function for testing mar downloads that have the correct size
-// specified in the update xml.
-function run_test_helper_pt1(aMsg, aExpectedStatusResult, aNextRunFunc) {
- gUpdates = null;
- gUpdateCount = null;
- gStatusResult = null;
- gCheckFunc = check_test_helper_pt1_1;
- gNextRunFunc = aNextRunFunc;
- gExpectedStatusResult = aExpectedStatusResult;
- debugDump(aMsg, Components.stack.caller);
- gUpdateChecker.checkForUpdates(updateCheckListener, true);
-}
-
-function check_test_helper_pt1_1() {
- Assert.equal(gUpdateCount, 1,
- "the update count" + MSG_SHOULD_EQUAL);
- gCheckFunc = check_test_helper_pt1_2;
- let bestUpdate = gAUS.selectUpdate(gUpdates, gUpdateCount);
- let state = gAUS.downloadUpdate(bestUpdate, false);
- if (state == STATE_NONE || state == STATE_FAILED) {
- do_throw("nsIApplicationUpdateService:downloadUpdate returned " + state);
- }
- gAUS.addDownloadListener(downloadListener);
-}
-
-function check_test_helper_pt1_2() {
- Assert.equal(gStatusResult, gExpectedStatusResult,
- "the download status result" + MSG_SHOULD_EQUAL);
- gAUS.removeDownloadListener(downloadListener);
- gNextRunFunc();
-}
-
-function setResponseBody(aHashFunction, aHashValue, aSize) {
- let patches = getRemotePatchString(null, null,
- aHashFunction, aHashValue, aSize);
- let updates = getRemoteUpdateString(patches);
- gResponseBody = getRemoteUpdatesXMLString(updates);
-}
-
-// mar download with a valid MD5 hash
-function run_test_pt1() {
- setResponseBody("MD5", MD5_HASH_SIMPLE_MAR);
- run_test_helper_pt1("mar download with a valid MD5 hash",
- Cr.NS_OK, run_test_pt2);
-}
-
-// mar download with an invalid MD5 hash
-function run_test_pt2() {
- setResponseBody("MD5", MD5_HASH_SIMPLE_MAR + "0");
- run_test_helper_pt1("mar download with an invalid MD5 hash",
- Cr.NS_ERROR_CORRUPTED_CONTENT, run_test_pt3);
-}
-
-// mar download with a valid SHA1 hash
-function run_test_pt3() {
- setResponseBody("SHA1", SHA1_HASH_SIMPLE_MAR);
- run_test_helper_pt1("mar download with a valid SHA1 hash",
- Cr.NS_OK, run_test_pt4);
-}
-
-// mar download with an invalid SHA1 hash
-function run_test_pt4() {
- setResponseBody("SHA1", SHA1_HASH_SIMPLE_MAR + "0");
- run_test_helper_pt1("mar download with an invalid SHA1 hash",
- Cr.NS_ERROR_CORRUPTED_CONTENT, run_test_pt5);
-}
-
-// mar download with a valid SHA256 hash
-function run_test_pt5() {
- setResponseBody("SHA256", SHA256_HASH_SIMPLE_MAR);
- run_test_helper_pt1("mar download with a valid SHA256 hash",
- Cr.NS_OK, run_test_pt6);
-}
-
-// mar download with an invalid SHA256 hash
-function run_test_pt6() {
- setResponseBody("SHA256", SHA256_HASH_SIMPLE_MAR + "0");
- run_test_helper_pt1("mar download with an invalid SHA256 hash",
- Cr.NS_ERROR_CORRUPTED_CONTENT, run_test_pt7);
-}
-
-// mar download with a valid SHA384 hash
-function run_test_pt7() {
- setResponseBody("SHA384", SHA384_HASH_SIMPLE_MAR);
- run_test_helper_pt1("mar download with a valid SHA384 hash",
- Cr.NS_OK, run_test_pt8);
-}
-
-// mar download with an invalid SHA384 hash
-function run_test_pt8() {
- setResponseBody("SHA384", SHA384_HASH_SIMPLE_MAR + "0");
- run_test_helper_pt1("mar download with an invalid SHA384 hash",
- Cr.NS_ERROR_CORRUPTED_CONTENT, run_test_pt9);
-}
-
-// mar download with a valid SHA512 hash
-function run_test_pt9() {
- setResponseBody("SHA512", SHA512_HASH_SIMPLE_MAR);
- run_test_helper_pt1("mar download with a valid SHA512 hash",
- Cr.NS_OK, run_test_pt10);
-}
-
-// mar download with an invalid SHA512 hash
-function run_test_pt10() {
- setResponseBody("SHA512", SHA512_HASH_SIMPLE_MAR + "0");
- run_test_helper_pt1("mar download with an invalid SHA512 hash",
- Cr.NS_ERROR_CORRUPTED_CONTENT, run_test_pt11);
-}
-
-// mar download with the mar not found
-function run_test_pt11() {
- let patches = getRemotePatchString(null, gURLData + "missing.mar");
- let updates = getRemoteUpdateString(patches);
- gResponseBody = getRemoteUpdatesXMLString(updates);
- run_test_helper_pt1("mar download with the mar not found",
- Cr.NS_ERROR_UNEXPECTED, run_test_pt12);
-}
-
-// mar download with a valid MD5 hash but invalid file size
-function run_test_pt12() {
- const arbitraryFileSize = 1024000;
- setResponseBody("MD5", MD5_HASH_SIMPLE_MAR, arbitraryFileSize);
- run_test_helper_pt1("mar download with a valid MD5 hash but invalid file size",
- Cr.NS_ERROR_UNEXPECTED, finish_test);
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/downloadCompleteAfterPartialFailure.js b/toolkit/mozapps/update/tests/unit_aus_update/downloadCompleteAfterPartialFailure.js
deleted file mode 100644
index 159033792..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/downloadCompleteAfterPartialFailure.js
+++ /dev/null
@@ -1,66 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-Components.utils.import("resource://testing-common/MockRegistrar.jsm");
-
-const WindowWatcher = {
- getNewPrompter: function WW_getNewPrompter(aParent) {
- Assert.ok(!aParent,
- "the aParent parameter should not be defined");
- return {
- alert: function WW_GNP_alert(aTitle, aText) {
- let title = getString("updaterIOErrorTitle");
- Assert.equal(aTitle, title,
- "the ui string for title" + MSG_SHOULD_EQUAL);
- let text = gUpdateBundle.formatStringFromName("updaterIOErrorMsg",
- [Services.appinfo.name,
- Services.appinfo.name], 2);
- Assert.equal(aText, text,
- "the ui string for message" + MSG_SHOULD_EQUAL);
-
- doTestFinish();
- }
- };
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIWindowWatcher])
-};
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing download a complete on partial failure. Calling " +
- "nsIUpdatePrompt::showUpdateError should call getNewPrompter " +
- "and alert on the object returned by getNewPrompter when the " +
- "update.state == " + STATE_FAILED + " and the update.errorCode " +
- "== " + WRITE_ERROR + " (Bug 595059).");
-
- Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, false);
-
- let windowWatcherCID =
- MockRegistrar.register("@mozilla.org/embedcomp/window-watcher;1",
- WindowWatcher);
- do_register_cleanup(() => {
- MockRegistrar.unregister(windowWatcherCID);
- });
-
- standardInit();
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- let url = URL_HOST + "/" + FILE_COMPLETE_MAR;
- let patches = getLocalPatchString("complete", url, null, null, null, null,
- STATE_FAILED);
- let updates = getLocalUpdateString(patches, null, null, "version 1.0", "1.0",
- null, null, null, null, url);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeStatusFile(STATE_FAILED);
-
- reloadUpdateManagerData();
-
- let update = gUpdateManager.activeUpdate;
- update.errorCode = WRITE_ERROR;
- let prompter = Cc["@mozilla.org/updates/update-prompt;1"].
- createInstance(Ci.nsIUpdatePrompt);
- prompter.showUpdateError(update);
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/downloadInterruptedRecovery.js b/toolkit/mozapps/update/tests/unit_aus_update/downloadInterruptedRecovery.js
deleted file mode 100644
index ef2da26af..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/downloadInterruptedRecovery.js
+++ /dev/null
@@ -1,225 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General MAR File Download Tests */
-
-Components.utils.import("resource://testing-common/MockRegistrar.jsm");
-const INC_CONTRACT_ID = "@mozilla.org/network/incremental-download;1";
-
-// gIncrementalDownloadErrorType is used to loop through each of the connection
-// error types in the Mock incremental downloader.
-var gIncrementalDownloadErrorType = 0;
-
-var gNextRunFunc;
-var gExpectedStatusResult;
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing mar downloads, mar hash verification, and " +
- "mar download interrupted recovery");
-
- Services.prefs.setBoolPref(PREF_APP_UPDATE_STAGING_ENABLED, false);
- start_httpserver();
- setUpdateURL(gURLData + gHTTPHandlerPath);
- standardInit();
- do_execute_soon(run_test_pt1);
-}
-
-// The HttpServer must be stopped before calling do_test_finished
-function finish_test() {
- stop_httpserver(doTestFinish);
-}
-
-// Helper function for testing mar downloads that have the correct size
-// specified in the update xml.
-function run_test_helper_pt1(aMsg, aExpectedStatusResult, aNextRunFunc) {
- gUpdates = null;
- gUpdateCount = null;
- gStatusResult = null;
- gCheckFunc = check_test_helper_pt1_1;
- gNextRunFunc = aNextRunFunc;
- gExpectedStatusResult = aExpectedStatusResult;
- debugDump(aMsg, Components.stack.caller);
- gUpdateChecker.checkForUpdates(updateCheckListener, true);
-}
-
-function check_test_helper_pt1_1() {
- Assert.equal(gUpdateCount, 1,
- "the update count" + MSG_SHOULD_EQUAL);
- gCheckFunc = check_test_helper_pt1_2;
- let bestUpdate = gAUS.selectUpdate(gUpdates, gUpdateCount);
- let state = gAUS.downloadUpdate(bestUpdate, false);
- if (state == STATE_NONE || state == STATE_FAILED) {
- do_throw("nsIApplicationUpdateService:downloadUpdate returned " + state);
- }
- gAUS.addDownloadListener(downloadListener);
-}
-
-function check_test_helper_pt1_2() {
- Assert.equal(gStatusResult, gExpectedStatusResult,
- "the download status result" + MSG_SHOULD_EQUAL);
- gAUS.removeDownloadListener(downloadListener);
- gNextRunFunc();
-}
-
-function setResponseBody(aHashFunction, aHashValue, aSize) {
- let patches = getRemotePatchString(null, null,
- aHashFunction, aHashValue, aSize);
- let updates = getRemoteUpdateString(patches);
- gResponseBody = getRemoteUpdatesXMLString(updates);
-}
-
-function initMockIncrementalDownload() {
- let incrementalDownloadCID =
- MockRegistrar.register(INC_CONTRACT_ID, IncrementalDownload);
- do_register_cleanup(() => {
- MockRegistrar.unregister(incrementalDownloadCID);
- });
-}
-
-/* This Mock incremental downloader is used to verify that connection
- * interrupts work correctly in updater code. The implementation of
- * the mock incremental downloader is very simple, it simply copies
- * the file to the destination location.
- */
-
-function IncrementalDownload() {
- this.wrappedJSObject = this;
-}
-
-IncrementalDownload.prototype = {
- /* nsIIncrementalDownload */
- init: function(uri, file, chunkSize, intervalInSeconds) {
- this._destination = file;
- this._URI = uri;
- this._finalURI = uri;
- },
-
- start: function(observer, ctxt) {
- let tm = Cc["@mozilla.org/thread-manager;1"].
- getService(Ci.nsIThreadManager);
- // Do the actual operation async to give a chance for observers
- // to add themselves.
- tm.mainThread.dispatch(function() {
- this._observer = observer.QueryInterface(Ci.nsIRequestObserver);
- this._ctxt = ctxt;
- this._observer.onStartRequest(this, this._ctxt);
- let mar = getTestDirFile(FILE_SIMPLE_MAR);
- mar.copyTo(this._destination.parent, this._destination.leafName);
- let status = Cr.NS_OK;
- switch (gIncrementalDownloadErrorType++) {
- case 0:
- status = Cr.NS_ERROR_NET_RESET;
- break;
- case 1:
- status = Cr.NS_ERROR_CONNECTION_REFUSED;
- break;
- case 2:
- status = Cr.NS_ERROR_NET_RESET;
- break;
- case 3:
- status = Cr.NS_OK;
- break;
- case 4:
- status = Cr.NS_ERROR_OFFLINE;
- // After we report offline, we want to eventually show offline
- // status being changed to online.
- let tm2 = Cc["@mozilla.org/thread-manager;1"].
- getService(Ci.nsIThreadManager);
- tm2.mainThread.dispatch(function() {
- Services.obs.notifyObservers(gAUS,
- "network:offline-status-changed",
- "online");
- }, Ci.nsIThread.DISPATCH_NORMAL);
- break;
- }
- this._observer.onStopRequest(this, this._ctxt, status);
- }.bind(this), Ci.nsIThread.DISPATCH_NORMAL);
- },
-
- get URI() {
- return this._URI;
- },
-
- get currentSize() {
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
-
- get destination() {
- return this._destination;
- },
-
- get finalURI() {
- return this._finalURI;
- },
-
- get totalSize() {
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
-
- /* nsIRequest */
- cancel: function(aStatus) {
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
- suspend: function() {
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
- isPending: function() {
- throw Cr.NS_ERROR_NOT_IMPLEMENTED;
- },
- _loadFlags: 0,
- get loadFlags() {
- return this._loadFlags;
- },
- set loadFlags(val) {
- this._loadFlags = val;
- },
-
- _loadGroup: null,
- get loadGroup() {
- return this._loadGroup;
- },
- set loadGroup(val) {
- this._loadGroup = val;
- },
-
- _name: "",
- get name() {
- return this._name;
- },
-
- _status: 0,
- get status() {
- return this._status;
- },
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIIncrementalDownload])
-};
-
-// Test disconnecting during an update
-function run_test_pt1() {
- initMockIncrementalDownload();
- setResponseBody("MD5", MD5_HASH_SIMPLE_MAR);
- run_test_helper_pt1("mar download with connection interruption",
- Cr.NS_OK, run_test_pt2);
-}
-
-// Test disconnecting during an update
-function run_test_pt2() {
- gIncrementalDownloadErrorType = 0;
- Services.prefs.setIntPref(PREF_APP_UPDATE_SOCKET_MAXERRORS, 2);
- Services.prefs.setIntPref(PREF_APP_UPDATE_RETRYTIMEOUT, 0);
- setResponseBody("MD5", MD5_HASH_SIMPLE_MAR);
- run_test_helper_pt1("mar download with connection interruption without recovery",
- Cr.NS_ERROR_NET_RESET, run_test_pt3);
-}
-
-// Test entering offline mode while downloading
-function run_test_pt3() {
- gIncrementalDownloadErrorType = 4;
- setResponseBody("MD5", MD5_HASH_SIMPLE_MAR);
- run_test_helper_pt1("mar download with offline mode",
- Cr.NS_OK, finish_test);
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/downloadResumeForSameAppVersion.js b/toolkit/mozapps/update/tests/unit_aus_update/downloadResumeForSameAppVersion.js
deleted file mode 100644
index ca065f573..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/downloadResumeForSameAppVersion.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing resuming an update download in progress for the same " +
- "version of the application on startup (Bug 485624)");
-
- let patches = getLocalPatchString(null, null, null, null, null, null,
- STATE_DOWNLOADING);
- let updates = getLocalUpdateString(patches, null, null, "1.0", "1.0");
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeStatusFile(STATE_DOWNLOADING);
-
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
-
- standardInit();
-
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.activeUpdate.state, STATE_DOWNLOADING,
- "the update manager activeUpdate state attribute" +
- MSG_SHOULD_EQUAL);
-
- // Pause the download and reload the Update Manager with an empty update so
- // the Application Update Service doesn't write the update xml files during
- // xpcom-shutdown which will leave behind the test directory.
- gAUS.pauseDownload();
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), true);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- reloadUpdateManagerData();
-
- do_execute_soon(doTestFinish);
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/head_update.js b/toolkit/mozapps/update/tests/unit_aus_update/head_update.js
deleted file mode 100644
index 9715c5828..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/head_update.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-const IS_SERVICE_TEST = false;
-
-/* import-globals-from ../data/xpcshellUtilsAUS.js */
-load("../data/xpcshellUtilsAUS.js");
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/remoteUpdateXML.js b/toolkit/mozapps/update/tests/unit_aus_update/remoteUpdateXML.js
deleted file mode 100644
index 831c87257..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/remoteUpdateXML.js
+++ /dev/null
@@ -1,285 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-var gNextRunFunc;
-var gExpectedCount;
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing remote update xml attributes");
-
- start_httpserver();
- setUpdateURL(gURLData + gHTTPHandlerPath);
- setUpdateChannel("test_channel");
-
- // This test expects that the app.update.download.backgroundInterval
- // preference doesn't already exist.
- Services.prefs.deleteBranch("app.update.download.backgroundInterval");
-
- standardInit();
- do_execute_soon(run_test_pt01);
-}
-
-// Helper function for testing update counts returned from an update xml
-function run_test_helper_pt1(aMsg, aExpectedCount, aNextRunFunc) {
- gUpdates = null;
- gUpdateCount = null;
- gCheckFunc = check_test_helper_pt1;
- gNextRunFunc = aNextRunFunc;
- gExpectedCount = aExpectedCount;
- debugDump(aMsg, Components.stack.caller);
- gUpdateChecker.checkForUpdates(updateCheckListener, true);
-}
-
-function check_test_helper_pt1() {
- Assert.equal(gUpdateCount, gExpectedCount,
- "the update count" + MSG_SHOULD_EQUAL);
- gNextRunFunc();
-}
-
-// update xml not found
-function run_test_pt01() {
- run_test_helper_pt1("testing update xml not available",
- null, run_test_pt02);
-}
-
-// one update available and the update's property values
-function run_test_pt02() {
- debugDump("testing one update available and the update's property values");
- gUpdates = null;
- gUpdateCount = null;
- gCheckFunc = check_test_pt02;
- let patches = getRemotePatchString("complete", "http://complete/", "SHA1",
- "98db9dad8e1d80eda7e1170d0187d6f53e477059",
- "9856459");
- patches += getRemotePatchString("partial", "http://partial/", "SHA1",
- "e6678ca40ae7582316acdeddf3c133c9c8577de4",
- "1316138");
- let updates = getRemoteUpdateString(patches, "minor", "Minor Test",
- "version 2.1a1pre", "2.1a1pre",
- "20080811053724",
- "http://details/",
- "true",
- "true", "345600", "1200",
- "custom1_attr=\"custom1 value\"",
- "custom2_attr=\"custom2 value\"");
- gResponseBody = getRemoteUpdatesXMLString(updates);
- gUpdateChecker.checkForUpdates(updateCheckListener, true);
-}
-
-function check_test_pt02() {
- // XXXrstrong - not specifying a detailsURL will cause a leak due to bug 470244
- // and until this is fixed this will not test the value for detailsURL when it
- // isn't specified in the update xml.
-// let defaultDetailsURL;
-// try {
- // Try using a default details URL supplied by the distribution
- // if the update XML does not supply one.
-// let formatter = Cc["@mozilla.org/toolkit/URLFormatterService;1"].
-// getService(Ci.nsIURLFormatter);
-// defaultDetailsURL = formatter.formatURLPref(PREF_APP_UPDATE_URL_DETAILS);
-// } catch (e) {
-// defaultDetailsURL = "";
-// }
-
- Assert.equal(gUpdateCount, 1,
- "the update count" + MSG_SHOULD_EQUAL);
- let bestUpdate = gAUS.selectUpdate(gUpdates, gUpdateCount).QueryInterface(Ci.nsIPropertyBag);
- Assert.equal(bestUpdate.type, "minor",
- "the update type attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(bestUpdate.name, "Minor Test",
- "the update name attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(bestUpdate.displayVersion, "version 2.1a1pre",
- "the update displayVersion attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(bestUpdate.appVersion, "2.1a1pre",
- "the update appVersion attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(bestUpdate.buildID, "20080811053724",
- "the update buildID attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(bestUpdate.detailsURL, "http://details/",
- "the update detailsURL attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(bestUpdate.showPrompt,
- "the update showPrompt attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(bestUpdate.showNeverForVersion,
- "the update showNeverForVersion attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(bestUpdate.promptWaitTime, "345600",
- "the update promptWaitTime attribute" + MSG_SHOULD_EQUAL);
- // The default and maximum value for backgroundInterval is 600
- Assert.equal(bestUpdate.getProperty("backgroundInterval"), "600",
- "the update backgroundInterval attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(bestUpdate.serviceURL, gURLData + gHTTPHandlerPath + "?force=1",
- "the update serviceURL attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(bestUpdate.channel, "test_channel",
- "the update channel attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(!bestUpdate.isCompleteUpdate,
- "the update isCompleteUpdate attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(!bestUpdate.isSecurityUpdate,
- "the update isSecurityUpdate attribute" + MSG_SHOULD_EQUAL);
- // Check that installDate is within 10 seconds of the current date.
- Assert.ok((Date.now() - bestUpdate.installDate) < 10000,
- "the update installDate attribute should be within 10 seconds of " +
- "the current time");
- Assert.ok(!bestUpdate.statusText,
- "the update statusText attribute" + MSG_SHOULD_EQUAL);
- // nsIUpdate:state returns an empty string when no action has been performed
- // on an available update
- Assert.equal(bestUpdate.state, "",
- "the update state attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(bestUpdate.errorCode, 0,
- "the update errorCode attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(bestUpdate.patchCount, 2,
- "the update patchCount attribute" + MSG_SHOULD_EQUAL);
- // XXX TODO - test nsIUpdate:serialize
-
- Assert.equal(bestUpdate.getProperty("custom1_attr"), "custom1 value",
- "the update custom1_attr property" + MSG_SHOULD_EQUAL);
- Assert.equal(bestUpdate.getProperty("custom2_attr"), "custom2 value",
- "the update custom2_attr property" + MSG_SHOULD_EQUAL);
-
- let patch = bestUpdate.getPatchAt(0);
- Assert.equal(patch.type, "complete",
- "the update patch type attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.URL, "http://complete/",
- "the update patch URL attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.hashFunction, "SHA1",
- "the update patch hashFunction attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.hashValue, "98db9dad8e1d80eda7e1170d0187d6f53e477059",
- "the update patch hashValue attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.size, 9856459,
- "the update patch size attribute" + MSG_SHOULD_EQUAL);
- // The value for patch.state can be the string 'null' as a valid value. This
- // is confusing if it returns null which is an invalid value since the test
- // failure output will show a failure for null == null. To lessen the
- // confusion first check that the typeof for patch.state is string.
- Assert.equal(typeof patch.state, "string",
- "the update patch state typeof value should equal |string|");
- Assert.equal(patch.state, STATE_NONE,
- "the update patch state attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(!patch.selected,
- "the update patch selected attribute" + MSG_SHOULD_EQUAL);
- // XXX TODO - test nsIUpdatePatch:serialize
-
- patch = bestUpdate.getPatchAt(1);
- Assert.equal(patch.type, "partial",
- "the update patch type attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.URL, "http://partial/",
- "the update patch URL attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.hashFunction, "SHA1",
- "the update patch hashFunction attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.hashValue, "e6678ca40ae7582316acdeddf3c133c9c8577de4",
- "the update patch hashValue attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.size, 1316138,
- "the update patch size attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.state, STATE_NONE,
- "the update patch state attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(!patch.selected,
- "the update patch selected attribute" + MSG_SHOULD_EQUAL);
- // XXX TODO - test nsIUpdatePatch:serialize
-
- run_test_pt03();
-}
-
-// Empty update xml (an empty xml file returns a root node name of parsererror)
-function run_test_pt03() {
- gResponseBody = "<parsererror/>";
- run_test_helper_pt1("testing empty update xml",
- null, run_test_pt04);
-}
-
-// no updates available
-function run_test_pt04() {
- gResponseBody = getRemoteUpdatesXMLString("");
- run_test_helper_pt1("testing no updates available",
- 0, run_test_pt05);
-}
-
-// one update available with two patches
-function run_test_pt05() {
- let patches = getRemotePatchString("complete");
- patches += getRemotePatchString("partial");
- let updates = getRemoteUpdateString(patches);
- gResponseBody = getRemoteUpdatesXMLString(updates);
- run_test_helper_pt1("testing one update available",
- 1, run_test_pt06);
-}
-
-// three updates available each with two patches
-function run_test_pt06() {
- let patches = getRemotePatchString("complete");
- patches += getRemotePatchString("partial");
- let updates = getRemoteUpdateString(patches);
- updates += getRemoteUpdateString(patches);
- updates += getRemoteUpdateString(patches);
- gResponseBody = getRemoteUpdatesXMLString(updates);
- run_test_helper_pt1("testing three updates available",
- 3, run_test_pt07);
-}
-
-// one update with complete and partial patches with size 0 specified in the
-// update xml
-function run_test_pt07() {
- let patches = getRemotePatchString("complete", null, null, null, "0");
- patches += getRemotePatchString("partial", null, null, null, "0");
- let updates = getRemoteUpdateString(patches);
- gResponseBody = getRemoteUpdatesXMLString(updates);
- run_test_helper_pt1("testing one update with complete and partial " +
- "patches with size 0", 0, run_test_pt08);
-}
-
-// one update with complete patch with size 0 specified in the update xml
-function run_test_pt08() {
- let patches = getRemotePatchString("complete", null, null, null, "0");
- let updates = getRemoteUpdateString(patches);
- gResponseBody = getRemoteUpdatesXMLString(updates);
- run_test_helper_pt1("testing one update with complete patch with size 0",
- 0, run_test_pt9);
-}
-
-// one update with partial patch with size 0 specified in the update xml
-function run_test_pt9() {
- let patches = getRemotePatchString("partial", null, null, null, "0");
- let updates = getRemoteUpdateString(patches);
- gResponseBody = getRemoteUpdatesXMLString(updates);
- run_test_helper_pt1("testing one update with partial patch with size 0",
- 0, run_test_pt10);
-}
-
-// check that updates for older versions of the application aren't selected
-function run_test_pt10() {
- let patches = getRemotePatchString("complete");
- patches += getRemotePatchString("partial");
- let updates = getRemoteUpdateString(patches, "minor", null, null, "1.0pre");
- updates += getRemoteUpdateString(patches, "minor", null, null, "1.0a");
- gResponseBody = getRemoteUpdatesXMLString(updates);
- run_test_helper_pt1("testing two updates older than the current version",
- 2, check_test_pt10);
-}
-
-function check_test_pt10() {
- let bestUpdate = gAUS.selectUpdate(gUpdates, gUpdateCount);
- Assert.ok(!bestUpdate,
- "there should be no update available");
- run_test_pt11();
-}
-
-// check that updates for the current version of the application are selected
-function run_test_pt11() {
- let patches = getRemotePatchString("complete");
- patches += getRemotePatchString("partial");
- let updates = getRemoteUpdateString(patches, "minor", null, "version 1.0");
- gResponseBody = getRemoteUpdatesXMLString(updates);
- run_test_helper_pt1("testing one update equal to the current version",
- 1, check_test_pt11);
-}
-
-function check_test_pt11() {
- let bestUpdate = gAUS.selectUpdate(gUpdates, gUpdateCount);
- Assert.ok(!!bestUpdate,
- "there should be one update available");
- Assert.equal(bestUpdate.displayVersion, "version 1.0",
- "the update displayVersion attribute" + MSG_SHOULD_EQUAL);
-
- doTestFinish();
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/uiAutoPref.js b/toolkit/mozapps/update/tests/unit_aus_update/uiAutoPref.js
deleted file mode 100644
index ee1c40bfd..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/uiAutoPref.js
+++ /dev/null
@@ -1,75 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-Components.utils.import("resource://testing-common/MockRegistrar.jsm");
-
-const WindowWatcher = {
- openWindow: function(aParent, aUrl, aName, aFeatures, aArgs) {
- gCheckFunc();
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIWindowWatcher])
-};
-
-const WindowMediator = {
- getMostRecentWindow: function(aWindowType) {
- do_execute_soon(check_status);
- return { getInterface: XPCOMUtils.generateQI([Ci.nsIDOMWindow]) };
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIWindowMediator])
-};
-
-function run_test() {
- setupTestCommon();
- // Calling do_get_profile prevents an error from being logged
- do_get_profile();
-
- debugDump("testing that an update download doesn't start when the " +
- PREF_APP_UPDATE_AUTO + " preference is false");
-
- Services.prefs.setBoolPref(PREF_APP_UPDATE_AUTO, false);
- Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, false);
-
- start_httpserver();
- setUpdateURL(gURLData + gHTTPHandlerPath);
- standardInit();
-
- let windowWatcherCID =
- MockRegistrar.register("@mozilla.org/embedcomp/window-watcher;1",
- WindowWatcher);
- let windowMediatorCID =
- MockRegistrar.register("@mozilla.org/appshell/window-mediator;1",
- WindowMediator);
- do_register_cleanup(() => {
- MockRegistrar.unregister(windowWatcherCID);
- MockRegistrar.unregister(windowMediatorCID);
- });
-
- gCheckFunc = check_showUpdateAvailable;
- let patches = getRemotePatchString("complete");
- let updates = getRemoteUpdateString(patches, "minor", null, null, "1.0");
- gResponseBody = getRemoteUpdatesXMLString(updates);
- gAUS.notify(null);
-}
-
-function check_status() {
- let status = readStatusFile();
- Assert.notEqual(status, STATE_DOWNLOADING,
- "the update state" + MSG_SHOULD_EQUAL);
-
- // Pause the download and reload the Update Manager with an empty update so
- // the Application Update Service doesn't write the update xml files during
- // xpcom-shutdown which will leave behind the test directory.
- gAUS.pauseDownload();
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), true);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- reloadUpdateManagerData();
-
- do_execute_soon(doTestFinish);
-}
-
-function check_showUpdateAvailable() {
- do_throw("showUpdateAvailable should not have called openWindow!");
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js b/toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js
deleted file mode 100644
index 25110be8c..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/uiSilentPref.js
+++ /dev/null
@@ -1,76 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-Components.utils.import("resource://testing-common/MockRegistrar.jsm");
-
-/**
- * Test that nsIUpdatePrompt doesn't display UI for showUpdateAvailable and
- * showUpdateError when the app.update.silent preference is true.
- */
-
-const WindowWatcher = {
- openWindow: function(aParent, aUrl, aName, aFeatures, aArgs) {
- gCheckFunc();
- },
-
- getNewPrompter: function(aParent) {
- gCheckFunc();
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIWindowWatcher])
-};
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing nsIUpdatePrompt notifications should not be seen " +
- "when the " + PREF_APP_UPDATE_SILENT + " preference is true");
-
- Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, true);
-
- let windowWatcherCID =
- MockRegistrar.register("@mozilla.org/embedcomp/window-watcher;1",
- WindowWatcher);
- do_register_cleanup(() => {
- MockRegistrar.unregister(windowWatcherCID);
- });
-
- standardInit();
-
- debugDump("testing showUpdateAvailable should not call openWindow");
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(""), false);
- let patches = getLocalPatchString(null, null, null, null, null, null,
- STATE_FAILED);
- let updates = getLocalUpdateString(patches);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeStatusFile(STATE_FAILED);
- reloadUpdateManagerData();
-
- gCheckFunc = check_showUpdateAvailable;
- let update = gUpdateManager.activeUpdate;
- gUP.showUpdateAvailable(update);
- // Report a successful check after the call to showUpdateAvailable since it
- // didn't throw and otherwise it would report no tests run.
- Assert.ok(true,
- "calling showUpdateAvailable should not attempt to open a window");
-
- debugDump("testing showUpdateError should not call getNewPrompter");
- gCheckFunc = check_showUpdateError;
- update.errorCode = WRITE_ERROR;
- gUP.showUpdateError(update);
- // Report a successful check after the call to showUpdateError since it
- // didn't throw and otherwise it would report no tests run.
- Assert.ok(true,
- "calling showUpdateError should not attempt to open a window");
-
- doTestFinish();
-}
-
-function check_showUpdateAvailable() {
- do_throw("showUpdateAvailable should not have called openWindow!");
-}
-
-function check_showUpdateError() {
- do_throw("showUpdateError should not have seen getNewPrompter!");
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/uiUnsupportedAlreadyNotified.js b/toolkit/mozapps/update/tests/unit_aus_update/uiUnsupportedAlreadyNotified.js
deleted file mode 100644
index 5b694ed30..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/uiUnsupportedAlreadyNotified.js
+++ /dev/null
@@ -1,74 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-Cu.import("resource://testing-common/MockRegistrar.jsm");
-
-const WindowWatcher = {
- openWindow: function(aParent, aUrl, aName, aFeatures, aArgs) {
- check_showUpdateAvailable();
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIWindowWatcher])
-};
-
-const WindowMediator = {
- getMostRecentWindow: function(aWindowType) {
- return null;
- },
-
- QueryInterface: XPCOMUtils.generateQI([Ci.nsIWindowMediator])
-};
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing nsIUpdatePrompt notifications should not be displayed " +
- "when showUpdateAvailable is called for an unsupported system " +
- "update when the unsupported notification has already been " +
- "shown (bug 843497)");
-
- start_httpserver();
- setUpdateURL(gURLData + gHTTPHandlerPath);
- standardInit();
-
- let windowWatcherCID =
- MockRegistrar.register("@mozilla.org/embedcomp/window-watcher;1",
- WindowWatcher);
- let windowMediatorCID =
- MockRegistrar.register("@mozilla.org/appshell/window-mediator;1",
- WindowMediator);
- do_register_cleanup(() => {
- MockRegistrar.unregister(windowWatcherCID);
- MockRegistrar.unregister(windowMediatorCID);
- });
-
- Services.prefs.setBoolPref(PREF_APP_UPDATE_SILENT, false);
- Services.prefs.setBoolPref(PREF_APP_UPDATE_NOTIFIEDUNSUPPORTED, true);
- // This preference is used to determine when the background update check has
- // completed since a successful check will clear the preference.
- Services.prefs.setIntPref(PREF_APP_UPDATE_BACKGROUNDERRORS, 1);
-
- gResponseBody = getRemoteUpdatesXMLString(" <update type=\"major\" " +
- "name=\"Unsupported Update\" " +
- "unsupported=\"true\" " +
- "detailsURL=\"" + URL_HOST +
- "\"></update>\n");
- gAUS.notify(null);
- do_execute_soon(check_test);
-}
-
-function check_test() {
- if (Services.prefs.prefHasUserValue(PREF_APP_UPDATE_BACKGROUNDERRORS)) {
- do_execute_soon(check_test);
- return;
- }
- Assert.ok(true,
- PREF_APP_UPDATE_BACKGROUNDERRORS + " preference should not exist");
-
- stop_httpserver(doTestFinish);
-}
-
-function check_showUpdateAvailable() {
- do_throw("showUpdateAvailable should not have called openWindow!");
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/updateManagerXML.js b/toolkit/mozapps/update/tests/unit_aus_update/updateManagerXML.js
deleted file mode 100644
index e46469455..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/updateManagerXML.js
+++ /dev/null
@@ -1,177 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-function run_test() {
- setupTestCommon();
-
- debugDump("testing addition of a successful update to " + FILE_UPDATES_XML +
- " and verification of update properties including the format " +
- "prior to bug 530872");
-
- setUpdateChannel("test_channel");
-
- // This test expects that the app.update.download.backgroundInterval
- // preference doesn't already exist.
- Services.prefs.deleteBranch("app.update.download.backgroundInterval");
-
- // XXXrstrong - not specifying a detailsURL will cause a leak due to bug 470244
- // and until bug 470244 is fixed this will not test the value for detailsURL
- // when it isn't specified in the update xml.
- let patches = getLocalPatchString("partial", "http://partial/", "SHA256",
- "cd43", "86", "true", STATE_PENDING);
- let updates = getLocalUpdateString(patches, "major", "New", "version 4",
- "4.0", "20070811053724",
- "http://details1/",
- "http://service1/", "1238441300314",
- "test status text", "false",
- "test_channel", "true", "true", "true",
- "345600", "300", "3.0",
- "custom1_attr=\"custom1 value\"",
- "custom2_attr=\"custom2 value\"");
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- writeStatusFile(STATE_SUCCEEDED);
-
- patches = getLocalPatchString("complete", "http://complete/", "SHA1", "6232",
- "75", "true", STATE_FAILED);
- updates = getLocalUpdateString(patches, "major", "Existing", null, "3.0",
- null,
- "http://details2/",
- "http://service2/", null,
- getString("patchApplyFailure"), "true",
- "test_channel", "false", null, null, "691200",
- null, null,
- "custom3_attr=\"custom3 value\"",
- "custom4_attr=\"custom4 value\"");
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), false);
-
- standardInit();
-
- Assert.ok(!gUpdateManager.activeUpdate,
- "the update manager activeUpdate attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.updateCount, 2,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
-
- debugDump("checking the activeUpdate properties");
- let update = gUpdateManager.getUpdateAt(0).QueryInterface(Ci.nsIPropertyBag);
- Assert.equal(update.state, STATE_SUCCEEDED,
- "the update state attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.type, "major",
- "the update type attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.name, "New",
- "the update name attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.displayVersion, "version 4",
- "the update displayVersion attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.appVersion, "4.0",
- "the update appVersion attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.buildID, "20070811053724",
- "the update buildID attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.detailsURL, "http://details1/",
- "the update detailsURL attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.serviceURL, "http://service1/",
- "the update serviceURL attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.installDate, "1238441300314",
- "the update installDate attribute" + MSG_SHOULD_EQUAL);
- // statusText is updated
- Assert.equal(update.statusText, getString("installSuccess"),
- "the update statusText attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(!update.isCompleteUpdate,
- "the update isCompleteUpdate attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.channel, "test_channel",
- "the update channel attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(!!update.showPrompt,
- "the update showPrompt attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(!!update.showNeverForVersion,
- "the update showNeverForVersion attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.promptWaitTime, "345600",
- "the update promptWaitTime attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.getProperty("backgroundInterval"), "300",
- "the update backgroundInterval attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.previousAppVersion, "3.0",
- "the update previousAppVersion attribute" + MSG_SHOULD_EQUAL);
- // Custom attributes
- Assert.equal(update.getProperty("custom1_attr"), "custom1 value",
- "the update custom1_attr property" + MSG_SHOULD_EQUAL);
- Assert.equal(update.getProperty("custom2_attr"), "custom2 value",
- "the update custom2_attr property" + MSG_SHOULD_EQUAL);
-
- debugDump("checking the activeUpdate patch properties");
- let patch = update.selectedPatch;
- Assert.equal(patch.type, "partial",
- "the update patch type attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.URL, "http://partial/",
- "the update patch URL attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.hashFunction, "SHA256",
- "the update patch hashFunction attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.hashValue, "cd43",
- "the update patch hashValue attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.size, "86",
- "the update patch size attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(!!patch.selected,
- "the update patch selected attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.state, STATE_SUCCEEDED,
- "the update patch state attribute" + MSG_SHOULD_EQUAL);
-
- debugDump("checking the first update properties");
- update = gUpdateManager.getUpdateAt(1).QueryInterface(Ci.nsIPropertyBag);
- Assert.equal(update.state, STATE_FAILED,
- "the update state attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.name, "Existing",
- "the update name attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.type, "major",
- "the update type attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.displayVersion, "3.0",
- "the update displayVersion attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.appVersion, "3.0",
- "the update appVersion attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.detailsURL, "http://details2/",
- "the update detailsURL attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.serviceURL, "http://service2/",
- "the update serviceURL attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.installDate, "1238441400314",
- "the update installDate attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.statusText, getString("patchApplyFailure"),
- "the update statusText attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.buildID, "20080811053724",
- "the update buildID attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(!!update.isCompleteUpdate,
- "the update isCompleteUpdate attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.channel, "test_channel",
- "the update channel attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(!update.showPrompt,
- "the update showPrompt attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(!update.showNeverForVersion,
- "the update showNeverForVersion attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.promptWaitTime, "691200",
- "the update promptWaitTime attribute" + MSG_SHOULD_EQUAL);
- // The default and maximum value for backgroundInterval is 600
- Assert.equal(update.getProperty("backgroundInterval"), "600",
- "the update backgroundInterval attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(update.previousAppVersion, null,
- "the update previousAppVersion attribute" + MSG_SHOULD_EQUAL);
- // Custom attributes
- Assert.equal(update.getProperty("custom3_attr"), "custom3 value",
- "the update custom3_attr property" + MSG_SHOULD_EQUAL);
- Assert.equal(update.getProperty("custom4_attr"), "custom4 value",
- "the update custom4_attr property" + MSG_SHOULD_EQUAL);
-
- debugDump("checking the first update patch properties");
- patch = update.selectedPatch;
- Assert.equal(patch.type, "complete",
- "the update patch type attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.URL, "http://complete/",
- "the update patch URL attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.hashFunction, "SHA1",
- "the update patch hashFunction attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.hashValue, "6232",
- "the update patch hashValue attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.size, "75",
- "the update patch size attribute" + MSG_SHOULD_EQUAL);
- Assert.ok(!!patch.selected,
- "the update patch selected attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(patch.state, STATE_FAILED,
- "the update patch state attribute" + MSG_SHOULD_EQUAL);
-
- doTestFinish();
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/urlConstruction.js b/toolkit/mozapps/update/tests/unit_aus_update/urlConstruction.js
deleted file mode 100644
index db7d90094..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/urlConstruction.js
+++ /dev/null
@@ -1,305 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General URL Construction Tests */
-
-const URL_PREFIX = URL_HOST + "/";
-
-var gAppInfo;
-
-// Since gUpdateChecker.checkForUpdates uses XMLHttpRequest and XMLHttpRequest
-// can be slow it combines the checks whenever possible.
-function run_test() {
- // This test needs access to omni.ja to read the update.locale file so don't
- // use a custom directory for the application directory.
- gUseTestAppDir = false;
- setupTestCommon();
-
- standardInit();
- gAppInfo = Cc["@mozilla.org/xre/app-info;1"].
- getService(Ci.nsIXULAppInfo).
- QueryInterface(Ci.nsIXULRuntime);
- do_execute_soon(run_test_pt1);
-}
-
-
-// url constructed with:
-// %PRODUCT%
-// %VERSION%
-// %BUILD_ID%
-// %BUILD_TARGET%
-// %LOCALE%
-// %CHANNEL%
-// %PLATFORM_VERSION%
-// %OS_VERSION%
-// %SYSTEM_CAPABILITIES%
-// %DISTRIBUTION%
-// %DISTRIBUTION_VERSION%
-function run_test_pt1() {
- gCheckFunc = check_test_pt1;
- // The code that gets the locale accesses the profile which is only available
- // after calling do_get_profile in xpcshell tests. This prevents an error from
- // being logged.
- do_get_profile();
-
- setUpdateChannel("test_channel");
- gDefaultPrefBranch.setCharPref(PREF_DISTRIBUTION_ID, "test_distro");
- gDefaultPrefBranch.setCharPref(PREF_DISTRIBUTION_VERSION, "test_distro_version");
-
- let url = URL_PREFIX + "%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/" +
- "%LOCALE%/%CHANNEL%/%PLATFORM_VERSION%/%OS_VERSION%/" +
- "%SYSTEM_CAPABILITIES%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/" +
- "updates.xml";
- debugDump("testing url construction - url: " + url);
- setUpdateURL(url);
- try {
- gUpdateChecker.checkForUpdates(updateCheckListener, true);
- } catch (e) {
- debugDump("The following error is most likely due to a missing " +
- "update.locale file");
- do_throw(e);
- }
-}
-
-function check_test_pt1() {
- let url = URL_PREFIX + gAppInfo.name + "/" + gAppInfo.version + "/" +
- gAppInfo.appBuildID + "/" + gAppInfo.OS + "_" + getABI() + "/" +
- INSTALL_LOCALE + "/test_channel/" + gAppInfo.platformVersion + "/" +
- getOSVersion() + "/" + getSystemCapabilities() +
- "/test_distro/test_distro_version/updates.xml?force=1";
- // Log the urls since Assert.equal won't print the entire urls to the log.
- if (gRequestURL != url) {
- logTestInfo("expected url: " + url);
- logTestInfo("returned url: " + gRequestURL);
- }
- Assert.equal(gRequestURL, url,
- "the url" + MSG_SHOULD_EQUAL);
- run_test_pt2();
-}
-
-// url constructed with:
-// %CHANNEL% with distribution partners
-// %CUSTOM% parameter
-// force param when there already is a param - bug 454357
-function run_test_pt2() {
- gCheckFunc = check_test_pt2;
- let url = URL_PREFIX + "%CHANNEL%/updates.xml?custom=%CUSTOM%";
- debugDump("testing url constructed with %CHANNEL% - " + url);
- setUpdateURL(url);
- gDefaultPrefBranch.setCharPref(PREFBRANCH_APP_PARTNER + "test_partner1",
- "test_partner1");
- gDefaultPrefBranch.setCharPref(PREFBRANCH_APP_PARTNER + "test_partner2",
- "test_partner2");
- Services.prefs.setCharPref("app.update.custom", "custom");
- gUpdateChecker.checkForUpdates(updateCheckListener, true);
-}
-
-function check_test_pt2() {
- let url = URL_PREFIX + "test_channel-cck-test_partner1-test_partner2/" +
- "updates.xml?custom=custom&force=1";
- Assert.equal(gRequestURL, url,
- "the url" + MSG_SHOULD_EQUAL);
- doTestFinish();
-}
-
-function getABI() {
- let abi;
- try {
- abi = gAppInfo.XPCOMABI;
- } catch (e) {
- do_throw("nsIXULAppInfo:XPCOMABI not defined\n");
- }
-
- if (IS_MACOSX) {
- // Mac universal build should report a different ABI than either macppc
- // or mactel. This is necessary since nsUpdateService.js will set the ABI to
- // Universal-gcc3 for Mac universal builds.
- let macutils = Cc["@mozilla.org/xpcom/mac-utils;1"].
- getService(Ci.nsIMacUtils);
-
- if (macutils.isUniversalBinary) {
- abi += "-u-" + macutils.architecturesInBinary;
- }
- } else if (IS_WIN) {
- // Windows build should report the CPU architecture that it's running on.
- abi += "-" + getProcArchitecture();
- }
- return abi;
-}
-
-function getOSVersion() {
- let sysInfo = Cc["@mozilla.org/system-info;1"].getService(Ci.nsIPropertyBag2);
- let osVersion = sysInfo.getProperty("name") + " " + sysInfo.getProperty("version");
-
- if (IS_WIN) {
- try {
- let servicePack = getServicePack();
- osVersion += "." + servicePack;
- } catch (e) {
- do_throw("Failure obtaining service pack: " + e);
- }
-
- if ("5.0" === sysInfo.getProperty("version")) { // Win2K
- osVersion += " (unknown)";
- } else {
- try {
- osVersion += " (" + getProcArchitecture() + ")";
- } catch (e) {
- do_throw("Failed to obtain processor architecture: " + e);
- }
- }
- }
-
- if (osVersion) {
- try {
- osVersion += " (" + sysInfo.getProperty("secondaryLibrary") + ")";
- } catch (e) {
- // Not all platforms have a secondary widget library, so an error is
- // nothing to worry about.
- }
- osVersion = encodeURIComponent(osVersion);
- }
- return osVersion;
-}
-
-function getServicePack() {
- // NOTE: This function is a helper function and not a test. Thus,
- // it uses throw() instead of do_throw(). Any tests that use this function
- // should catch exceptions thrown in this function and deal with them
- // appropriately (usually by calling do_throw).
- const BYTE = ctypes.uint8_t;
- const WORD = ctypes.uint16_t;
- const DWORD = ctypes.uint32_t;
- const WCHAR = ctypes.char16_t;
- const BOOL = ctypes.int;
-
- // This structure is described at:
- // http://msdn.microsoft.com/en-us/library/ms724833%28v=vs.85%29.aspx
- const SZCSDVERSIONLENGTH = 128;
- const OSVERSIONINFOEXW = new ctypes.StructType('OSVERSIONINFOEXW',
- [
- {dwOSVersionInfoSize: DWORD},
- {dwMajorVersion: DWORD},
- {dwMinorVersion: DWORD},
- {dwBuildNumber: DWORD},
- {dwPlatformId: DWORD},
- {szCSDVersion: ctypes.ArrayType(WCHAR, SZCSDVERSIONLENGTH)},
- {wServicePackMajor: WORD},
- {wServicePackMinor: WORD},
- {wSuiteMask: WORD},
- {wProductType: BYTE},
- {wReserved: BYTE}
- ]);
-
- let kernel32 = ctypes.open("kernel32");
- try {
- let GetVersionEx = kernel32.declare("GetVersionExW",
- ctypes.default_abi,
- BOOL,
- OSVERSIONINFOEXW.ptr);
- let winVer = OSVERSIONINFOEXW();
- winVer.dwOSVersionInfoSize = OSVERSIONINFOEXW.size;
-
- if (0 === GetVersionEx(winVer.address())) {
- // Using "throw" instead of "do_throw" (see NOTE above)
- throw ("Failure in GetVersionEx (returned 0)");
- }
-
- return winVer.wServicePackMajor + "." + winVer.wServicePackMinor;
- } finally {
- kernel32.close();
- }
-}
-
-function getProcArchitecture() {
- // NOTE: This function is a helper function and not a test. Thus,
- // it uses throw() instead of do_throw(). Any tests that use this function
- // should catch exceptions thrown in this function and deal with them
- // appropriately (usually by calling do_throw).
- const WORD = ctypes.uint16_t;
- const DWORD = ctypes.uint32_t;
-
- // This structure is described at:
- // http://msdn.microsoft.com/en-us/library/ms724958%28v=vs.85%29.aspx
- const SYSTEM_INFO = new ctypes.StructType('SYSTEM_INFO',
- [
- {wProcessorArchitecture: WORD},
- {wReserved: WORD},
- {dwPageSize: DWORD},
- {lpMinimumApplicationAddress: ctypes.voidptr_t},
- {lpMaximumApplicationAddress: ctypes.voidptr_t},
- {dwActiveProcessorMask: DWORD.ptr},
- {dwNumberOfProcessors: DWORD},
- {dwProcessorType: DWORD},
- {dwAllocationGranularity: DWORD},
- {wProcessorLevel: WORD},
- {wProcessorRevision: WORD}
- ]);
-
- let kernel32 = ctypes.open("kernel32");
- try {
- let GetNativeSystemInfo = kernel32.declare("GetNativeSystemInfo",
- ctypes.default_abi,
- ctypes.void_t,
- SYSTEM_INFO.ptr);
- let sysInfo = SYSTEM_INFO();
- // Default to unknown
- sysInfo.wProcessorArchitecture = 0xffff;
-
- GetNativeSystemInfo(sysInfo.address());
- switch (sysInfo.wProcessorArchitecture) {
- case 9:
- return "x64";
- case 6:
- return "IA64";
- case 0:
- return "x86";
- default:
- // Using "throw" instead of "do_throw" (see NOTE above)
- throw ("Unknown architecture returned from GetNativeSystemInfo: " + sysInfo.wProcessorArchitecture);
- }
- } finally {
- kernel32.close();
- }
-}
-
-/**
- * Provides system capability information for application update though it may
- * be used by other consumers.
- */
-function getSystemCapabilities() {
- if (IS_WIN) {
- const PF_MMX_INSTRUCTIONS_AVAILABLE = 3; // MMX
- const PF_XMMI_INSTRUCTIONS_AVAILABLE = 6; // SSE
- const PF_XMMI64_INSTRUCTIONS_AVAILABLE = 10; // SSE2
- const PF_SSE3_INSTRUCTIONS_AVAILABLE = 13; // SSE3
-
- let lib = ctypes.open("kernel32.dll");
- let IsProcessorFeaturePresent = lib.declare("IsProcessorFeaturePresent",
- ctypes.winapi_abi,
- ctypes.int32_t, /* success */
- ctypes.uint32_t); /* DWORD */
- let instructionSet = "unknown";
- try {
- if (IsProcessorFeaturePresent(PF_SSE3_INSTRUCTIONS_AVAILABLE)) {
- instructionSet = "SSE3";
- } else if (IsProcessorFeaturePresent(PF_XMMI64_INSTRUCTIONS_AVAILABLE)) {
- instructionSet = "SSE2";
- } else if (IsProcessorFeaturePresent(PF_XMMI_INSTRUCTIONS_AVAILABLE)) {
- instructionSet = "SSE";
- } else if (IsProcessorFeaturePresent(PF_MMX_INSTRUCTIONS_AVAILABLE)) {
- instructionSet = "MMX";
- }
- } catch (e) {
- Cu.reportError("Error getting processor instruction set. " +
- "Exception: " + e);
- }
-
- lib.close();
- return instructionSet;
- }
-
- return "NA";
-}
diff --git a/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini b/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
deleted file mode 100644
index 0d2205046..000000000
--- a/toolkit/mozapps/update/tests/unit_aus_update/xpcshell.ini
+++ /dev/null
@@ -1,27 +0,0 @@
-; This Source Code Form is subject to the terms of the Mozilla Public
-; License, v. 2.0. If a copy of the MPL was not distributed with this
-; file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-[DEFAULT]
-tags = appupdate
-head = head_update.js
-tail =
-
-[canCheckForAndCanApplyUpdates.js]
-[urlConstruction.js]
-[updateManagerXML.js]
-[remoteUpdateXML.js]
-[downloadAndHashCheckMar.js]
-[cleanupDownloadingForOlderAppVersion.js]
-[cleanupDownloadingForDifferentChannel.js]
-[cleanupDownloadingForSameVersionAndBuildID.js]
-[cleanupDownloadingIncorrectStatus.js]
-[cleanupPendingVersionFileIncorrectStatus.js]
-[cleanupSuccessLogMove.js]
-[cleanupSuccessLogsFIFO.js]
-[downloadInterruptedRecovery.js]
-[downloadResumeForSameAppVersion.js]
-[downloadCompleteAfterPartialFailure.js]
-[uiSilentPref.js]
-[uiUnsupportedAlreadyNotified.js]
-[uiAutoPref.js]
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/.eslintrc.js b/toolkit/mozapps/update/tests/unit_base_updater/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/head_update.js b/toolkit/mozapps/update/tests/unit_base_updater/head_update.js
deleted file mode 100644
index 9715c5828..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/head_update.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-const IS_SERVICE_TEST = false;
-
-/* import-globals-from ../data/xpcshellUtilsAUS.js */
-load("../data/xpcshellUtilsAUS.js");
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgCallbackFileNotInInstallDirFailure.js b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgCallbackFileNotInInstallDirFailure.js
deleted file mode 100644
index f3f767394..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgCallbackFileNotInInstallDirFailure.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Callback file not in install directory or a sub-directory of the install
- directory failure */
-
-const STATE_AFTER_RUNUPDATE = STATE_FAILED_INVALID_CALLBACK_DIR_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = getTestDirFile(FILE_HELPER_BIN).path;
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, null, path);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgCallbackFilePathTooLongFailure.js b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgCallbackFilePathTooLongFailure.js
deleted file mode 100644
index 969f84f9d..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgCallbackFilePathTooLongFailure.js
+++ /dev/null
@@ -1,45 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Too long callback file path failure test */
-
-const STATE_AFTER_RUNUPDATE = STATE_FAILED_INVALID_CALLBACK_PATH_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = "123456789";
- if (IS_WIN) {
- path = "\\" + path;
- path = path.repeat(30); // 300 characters
- path = "C:" + path;
- } else {
- path = "/" + path;
- path = path.repeat(1000); // 10000 characters
- }
-
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, null, path);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTooLongFailure.js b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTooLongFailure.js
deleted file mode 100644
index 70e03646a..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTooLongFailure.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Too long install directory path failure test */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
- : STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = "123456789";
- if (IS_WIN) {
- path = "\\" + path;
- path = path.repeat(30); // 300 characters
- path = "C:" + path;
- } else {
- path = "/" + path;
- path = path.repeat(1000); // 10000 characters
- }
-
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null, null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTraversalFailure.js b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTraversalFailure.js
deleted file mode 100644
index 330578de6..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallDirPathTraversalFailure.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Install directory path traversal failure test */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
- : STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = "123456789";
- if (IS_WIN) {
- path = "C:\\" + path + "\\..\\" + path;
- } else {
- path = "/" + path + "/../" + path;
- }
-
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null, null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallWorkingDirPathNotSameFailure_win.js b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallWorkingDirPathNotSameFailure_win.js
deleted file mode 100644
index 8ddb34af0..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgInstallWorkingDirPathNotSameFailure_win.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Different install and working directories for a regular update failure */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_ERROR
- : STATE_FAILED_INVALID_APPLYTO_DIR_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = getApplyDirFile("..", false).path;
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path, null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgPatchDirPathTraversalFailure.js b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgPatchDirPathTraversalFailure.js
deleted file mode 100644
index c8ae3f0c6..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgPatchDirPathTraversalFailure.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Patch directory path traversal failure test */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = getUpdatesPatchDir();
- if (IS_WIN) {
- path = path + "\\..\\";
- } else {
- path = path + "/../";
- }
-
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, path, null, null, null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgStageDirNotInInstallDirFailure_win.js b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgStageDirNotInInstallDirFailure_win.js
deleted file mode 100644
index e9b227657..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgStageDirNotInInstallDirFailure_win.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Different install and working directories for a regular update failure */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR
- : STATE_FAILED_INVALID_APPLYTO_DIR_STAGED_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = getApplyDirFile("..", false).path;
- runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true, null, null, path, null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathLocalUNCFailure_win.js b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathLocalUNCFailure_win.js
deleted file mode 100644
index 87bbad4aa..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathLocalUNCFailure_win.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Working directory path local UNC failure test */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR
- : STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = "\\\\.\\" + getApplyDirFile(null, false).path;
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path, null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathRelativeFailure.js b/toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathRelativeFailure.js
deleted file mode 100644
index a550909b2..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/invalidArgWorkingDirPathRelativeFailure.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Relative working directory path failure test */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR
- : STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, "test", null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyDirLockedStageFailure_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyDirLockedStageFailure_win.js
deleted file mode 100644
index b9f793236..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyDirLockedStageFailure_win.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Test applying an update by staging an update and launching an application to
- * apply it.
- */
-
-const STATE_AFTER_STAGE = STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
-
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- createUpdateInProgressLockFile(getAppBaseDir());
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(false);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- removeUpdateInProgressLockFile(getAppBaseDir());
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(PERFORMING_STAGED_UPDATE);
- checkUpdateLogContains(ERR_UPDATE_IN_PROGRESS);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateAppBinInUseStageSuccess_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateAppBinInUseStageSuccess_win.js
deleted file mode 100644
index a606720b7..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateAppBinInUseStageSuccess_win.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Test applying an update by staging an update and launching an application to
- * apply it.
- */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
-
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, undefined);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true, false);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- lockDirectory(getAppBaseDir().path);
- // Switch the application to the staged application that was updated.
- runUpdateUsingApp(STATE_SUCCEEDED);
-}
-
-/**
- * Called after the call to runUpdateUsingApp finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS);
-
- let updatesDir = getUpdatesPatchDir();
- Assert.ok(updatesDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(updatesDir.path));
-
- let log = getUpdateLog(FILE_UPDATE_LOG);
- Assert.ok(!log.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_LAST_UPDATE_LOG);
- Assert.ok(log.exists(),
- MSG_SHOULD_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_BACKUP_UPDATE_LOG);
- Assert.ok(log.exists(),
- MSG_SHOULD_EXIST + getMsgPath(log.path));
-
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageOldVersionFailure.js b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageOldVersionFailure.js
deleted file mode 100644
index 00b38adc7..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageOldVersionFailure.js
+++ /dev/null
@@ -1,88 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Test a replace request for a staged update with a version file that specifies
- * an older version failure. The same check is used in nsUpdateDriver.cpp for
- * all update types which is why there aren't tests for the maintenance service
- * as well as for other update types.
- */
-
-const STATE_AFTER_STAGE = STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
-
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(false);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Change the active update to an older version to simulate installing a new
- // version of the application while there is an update that has been staged.
- let channel = gDefaultPrefBranch.getCharPref(PREF_APP_UPDATE_CHANNEL);
- let patches = getLocalPatchString(null, null, null, null, null, "true",
- STATE_AFTER_STAGE);
- let updates = getLocalUpdateString(patches, null, null, null, "1.0", null,
- null, null, null, null, "true", channel);
- writeUpdatesToXMLFile(getLocalUpdatesXMLString(updates), true);
- // Change the version file to an older version to simulate installing a new
- // version of the application while there is an update that has been staged.
- writeVersionFile("1.0");
- reloadUpdateManagerData();
- // Try to switch the application to the staged application that was updated.
- runUpdateUsingApp(STATE_AFTER_STAGE);
-}
-
-/**
- * Called after the call to runUpdateUsingApp finishes.
- */
-function runUpdateFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_STAGE,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- setTestFilesAndDirsForFailure();
- checkFilesAfterUpdateFailure(getApplyDirFile, IS_MACOSX ? false : true, false);
-
- let updatesDir = getUpdatesPatchDir();
- Assert.ok(updatesDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(updatesDir.path));
-
- let log = getUpdateLog(FILE_UPDATE_LOG);
- Assert.ok(!log.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_LAST_UPDATE_LOG);
- Assert.ok(log.exists(),
- MSG_SHOULD_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_BACKUP_UPDATE_LOG);
- Assert.ok(!log.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
-
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js
deleted file mode 100644
index 5b9b08156..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateStageSuccess.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Test applying an update by staging an update and launching an application to
- * apply it.
- */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
-
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, true);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdateUsingApp(STATE_SUCCEEDED);
-}
-
-/**
- * Called after the call to runUpdateUsingApp finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);
-
- let updatesDir = getUpdatesPatchDir();
- Assert.ok(updatesDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(updatesDir.path));
-
- let log = getUpdateLog(FILE_UPDATE_LOG);
- Assert.ok(!log.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_LAST_UPDATE_LOG);
- Assert.ok(log.exists(),
- MSG_SHOULD_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_BACKUP_UPDATE_LOG);
- Assert.ok(log.exists(),
- MSG_SHOULD_EXIST + getMsgPath(log.path));
-
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js b/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js
deleted file mode 100644
index e76233fe6..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppApplyUpdateSuccess.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Test applying an update by staging an update and launching an application to
- * apply it.
- */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
-
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- // The third parameter will test that a full path to the post update binary
- // doesn't execute.
- setupUpdaterTest(FILE_COMPLETE_MAR, undefined,
- getApplyDirFile(null, true).path + "/");
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runUpdateUsingApp(STATE_SUCCEEDED);
-}
-
-/**
- * Called after the call to runUpdateUsingApp finishes.
- */
-function runUpdateFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS);
-
- let updatesDir = getUpdatesPatchDir();
- Assert.ok(updatesDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(updatesDir.path));
-
- let log = getUpdateLog(FILE_UPDATE_LOG);
- Assert.ok(!log.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_LAST_UPDATE_LOG);
- Assert.ok(log.exists(),
- MSG_SHOULD_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_BACKUP_UPDATE_LOG);
- Assert.ok(!log.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
-
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js
deleted file mode 100644
index b1505d58e..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageFailureComplete_win.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Application in use complete MAR file staged patch apply failure test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(DIR_RESOURCES + gCallbackBinFile, false);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- setTestFilesAndDirsForFailure();
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_MOVE_DESTDIR_7 + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageSuccessComplete_unix.js b/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageSuccessComplete_unix.js
deleted file mode 100644
index a1cc7d043..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseStageSuccessComplete_unix.js
+++ /dev/null
@@ -1,113 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Application in use complete MAR file staged patch apply success test */
-
-const START_STATE = STATE_PENDING;
-const STATE_AFTER_STAGE = STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestFiles[gTestFiles.length - 1].originalContents = null;
- gTestFiles[gTestFiles.length - 1].compareContents = "FromComplete\n";
- gTestFiles[gTestFiles.length - 1].comparePerms = 0o644;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, true);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- setupSymLinks();
- runHelperFileInUse(DIR_RESOURCES + gCallbackBinFile, false);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_SUCCEEDED, true, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- checkAppBundleModTime();
- checkSymLinks();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);
- checkCallbackLog();
-}
-
-/**
- * Setup symlinks for the test.
- */
-function setupSymLinks() {
- if (IS_UNIX) {
- removeSymlink();
- createSymlink();
- do_register_cleanup(removeSymlink);
- gTestFiles.splice(gTestFiles.length - 3, 0,
- {
- description: "Readable symlink",
- fileName: "link",
- relPathDir: DIR_RESOURCES,
- originalContents: "test",
- compareContents: "test",
- originalFile: null,
- compareFile: null,
- originalPerms: 0o666,
- comparePerms: 0o666
- });
- }
-}
-
-/**
- * Checks the state of the symlinks for the test.
- */
-function checkSymLinks() {
- if (IS_UNIX) {
- checkSymlink();
- }
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseSuccessComplete.js b/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseSuccessComplete.js
deleted file mode 100644
index 93333cade..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marAppInUseSuccessComplete.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Application in use complete MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(DIR_RESOURCES + gCallbackBinFile, false);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessComplete_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessComplete_win.js
deleted file mode 100644
index 79e54c182..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessComplete_win.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Replace app binary complete MAR file staged patch apply success test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- gCallbackBinFile = "exe0.exe";
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_SUCCEEDED, true, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessPartial_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessPartial_win.js
deleted file mode 100644
index b1f84715f..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppStageSuccessPartial_win.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Patch app binary partial MAR file staged patch apply success test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- gCallbackBinFile = "exe0.exe";
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_PARTIAL_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_SUCCEEDED, true, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppSuccessComplete_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppSuccessComplete_win.js
deleted file mode 100644
index 85e92d290..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppSuccessComplete_win.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Replace app binary complete MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- gCallbackBinFile = "exe0.exe";
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppSuccessPartial_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppSuccessPartial_win.js
deleted file mode 100644
index 1212c9ba2..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marCallbackAppSuccessPartial_win.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Patch app binary partial MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- gCallbackBinFile = "exe0.exe";
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_PARTIAL_SUCCESS);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marFailurePartial.js b/toolkit/mozapps/update/tests/unit_base_updater/marFailurePartial.js
deleted file mode 100644
index 960c96f7b..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFailurePartial.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Partial MAR File Patch Apply Failure Test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestFiles[11].originalFile = "partial.png";
- gTestDirs = gTestDirsPartialSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- // If execv is used the updater process will turn into the callback process
- // and the updater's return code will be that of the callback process.
- runUpdate(STATE_FAILED_LOADSOURCE_ERROR_WRONG_SIZE, false, (USE_EXECV ? 0 : 1),
- true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusFile(), STATE_NONE,
- "the status file failure code" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
- "the update state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, LOADSOURCE_ERROR_WRONG_SIZE,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContents(LOG_PARTIAL_FAILURE);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailureComplete_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailureComplete_win.js
deleted file mode 100644
index b39595f92..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailureComplete_win.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use complete MAR file staged patch apply failure test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestFiles[13].relPathDir + gTestFiles[13].fileName,
- false);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- setTestFilesAndDirsForFailure();
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_MOVE_DESTDIR_7 + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailurePartial_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailurePartial_win.js
deleted file mode 100644
index 06d386ad6..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseStageFailurePartial_win.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use partial MAR file staged patch apply failure test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestFiles[11].relPathDir + gTestFiles[11].fileName,
- false);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_PARTIAL_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- setTestFilesAndDirsForFailure();
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_MOVE_DESTDIR_7 + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessComplete_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessComplete_win.js
deleted file mode 100644
index 89a2fff5e..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessComplete_win.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use complete MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestFiles[13].relPathDir + gTestFiles[13].fileName,
- false);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContains(ERR_BACKUP_DISCARD);
- checkUpdateLogContains(STATE_SUCCEEDED + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessPartial_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessPartial_win.js
deleted file mode 100644
index ea85ddccc..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileInUseSuccessPartial_win.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use partial MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestFiles[11].relPathDir + gTestFiles[11].fileName,
- false);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContains(ERR_BACKUP_DISCARD);
- checkUpdateLogContains(STATE_SUCCEEDED + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailureComplete_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailureComplete_win.js
deleted file mode 100644
index c5efaa8c0..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailureComplete_win.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File locked complete MAR file patch apply failure test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperLockFile(gTestFiles[3]);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_FAILED_WRITE_ERROR, false, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusFile(), STATE_PENDING,
- "the status file failure code" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_PENDING,
- "the update state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, WRITE_ERROR,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_BACKUP_CREATE_7);
- checkUpdateLogContains(STATE_FAILED_WRITE_ERROR + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailurePartial_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailurePartial_win.js
deleted file mode 100644
index 4fdbadb5b..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedFailurePartial_win.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File locked partial MAR file patch apply failure test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperLockFile(gTestFiles[2]);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_FAILED_READ_ERROR, false, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusFile(), STATE_NONE,
- "the status file failure code" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
- "the update state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, READ_ERROR,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_UNABLE_OPEN_DEST);
- checkUpdateLogContains(STATE_FAILED_READ_ERROR + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailureComplete_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailureComplete_win.js
deleted file mode 100644
index 4d12f4e42..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailureComplete_win.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File locked complete MAR file staged patch apply failure test */
-
-const STATE_AFTER_STAGE = STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperLockFile(gTestFiles[3]);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- // Files aren't checked after staging since this test locks a file which
- // prevents reading the file.
- checkUpdateLogContains(ERR_ENSURE_COPY);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_FAILED_WRITE_ERROR, false, 1, false);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusFile(), STATE_PENDING,
- "the status file failure code" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.updateCount, 2,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_PENDING,
- "the update state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, WRITE_ERROR,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_BACKUP_CREATE_7);
- checkUpdateLogContains(STATE_FAILED_WRITE_ERROR + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailurePartial_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailurePartial_win.js
deleted file mode 100644
index 5f64df34c..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marFileLockedStageFailurePartial_win.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File locked partial MAR file staged patch apply failure test */
-
-const STATE_AFTER_STAGE = STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperLockFile(gTestFiles[2]);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- // Files aren't checked after staging since this test locks a file which
- // prevents reading the file.
- checkUpdateLogContains(ERR_ENSURE_COPY);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_FAILED_READ_ERROR, false, 1, false);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusFile(), STATE_NONE,
- "the status file failure code" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.updateCount, 2,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
- "the update state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, READ_ERROR,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_UNABLE_OPEN_DEST);
- checkUpdateLogContains(STATE_FAILED_READ_ERROR + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailureComplete_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailureComplete_win.js
deleted file mode 100644
index b83bafccc..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailureComplete_win.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use inside removed dir complete MAR file staged patch apply failure
- test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestDirs[4].relPathDir + gTestDirs[4].subDirs[0] +
- gTestDirs[4].subDirFiles[0], true);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- setTestFilesAndDirsForFailure();
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_MOVE_DESTDIR_7 + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailurePartial_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailurePartial_win.js
deleted file mode 100644
index 39ea485cd..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseStageFailurePartial_win.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use inside removed dir partial MAR file staged patch apply failure
- test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestDirs[2].relPathDir + gTestDirs[2].files[0], true);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_PARTIAL_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- setTestFilesAndDirsForFailure();
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_MOVE_DESTDIR_7 + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessComplete_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessComplete_win.js
deleted file mode 100644
index a71bb8d49..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessComplete_win.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use inside removed dir complete MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestDirs[4].relPathDir + gTestDirs[4].subDirs[0] +
- gTestDirs[4].subDirFiles[0], true);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContains(ERR_BACKUP_DISCARD);
- checkUpdateLogContains(STATE_SUCCEEDED + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessPartial_win.js b/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessPartial_win.js
deleted file mode 100644
index 2cbe70ed8..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marRMRFDirFileInUseSuccessPartial_win.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use inside removed dir partial MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestDirs[2].relPathDir + gTestDirs[2].files[0], true);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContains(ERR_BACKUP_DISCARD);
- checkUpdateLogContains(STATE_SUCCEEDED + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marStageFailurePartial.js b/toolkit/mozapps/update/tests/unit_base_updater/marStageFailurePartial.js
deleted file mode 100644
index a9ce23420..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marStageFailurePartial.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Partial MAR File Staged Patch Apply Failure Test */
-
-const STATE_AFTER_STAGE = STATE_FAILED;
-gStagingRemovedUpdate = true;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestFiles[11].originalFile = "partial.png";
- gTestDirs = gTestDirsPartialSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, LOADSOURCE_ERROR_WRONG_SIZE,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_LOADSOURCEFILE_FAILED);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessComplete.js b/toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessComplete.js
deleted file mode 100644
index f7745f68f..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessComplete.js
+++ /dev/null
@@ -1,132 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Complete MAR File Staged Patch Apply Test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestFiles[gTestFiles.length - 1].originalContents = null;
- gTestFiles[gTestFiles.length - 1].compareContents = "FromComplete\n";
- gTestFiles[gTestFiles.length - 1].comparePerms = 0o644;
- gTestDirs = gTestDirsCompleteSuccess;
- setupDistributionDir();
- setupSymLinks();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_SUCCEEDED, true, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- checkAppBundleModTime();
- checkSymLinks();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);
- checkDistributionDir();
- checkCallbackLog();
-}
-
-/**
- * Setup the state of the distribution directory for the test.
- */
-function setupDistributionDir() {
- if (IS_MACOSX) {
- // Create files in the old distribution directory location to verify that
- // the directory and its contents are removed when there is a distribution
- // directory in the new location.
- let testFile = getApplyDirFile(DIR_MACOS + "distribution/testFile", true);
- writeFile(testFile, "test\n");
- testFile = getApplyDirFile(DIR_MACOS + "distribution/test1/testFile", true);
- writeFile(testFile, "test\n");
- }
-}
-
-/**
- * Checks the state of the distribution directory for the test.
- */
-function checkDistributionDir() {
- if (IS_MACOSX) {
- let distributionDir = getApplyDirFile(DIR_MACOS + "distribution", true);
- Assert.ok(!distributionDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(distributionDir.path));
- checkUpdateLogContains(REMOVE_OLD_DIST_DIR);
- }
-}
-
-/**
- * Setup symlinks for the test.
- */
-function setupSymLinks() {
- // Don't test symlinks on Mac OS X in this test since it tends to timeout.
- // It is tested on Mac OS X in marAppInUseStageSuccessComplete_unix.js
- if (IS_UNIX && !IS_MACOSX) {
- removeSymlink();
- createSymlink();
- do_register_cleanup(removeSymlink);
- gTestFiles.splice(gTestFiles.length - 3, 0,
- {
- description: "Readable symlink",
- fileName: "link",
- relPathDir: DIR_RESOURCES,
- originalContents: "test",
- compareContents: "test",
- originalFile: null,
- compareFile: null,
- originalPerms: 0o666,
- comparePerms: 0o666
- });
- }
-}
-
-/**
- * Checks the state of the symlinks for the test.
- */
-function checkSymLinks() {
- // Don't test symlinks on Mac OS X in this test since it tends to timeout.
- // It is tested on Mac OS X in marAppInUseStageSuccessComplete_unix.js
- if (IS_UNIX && !IS_MACOSX) {
- checkSymlink();
- }
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessPartial.js b/toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessPartial.js
deleted file mode 100644
index ef15326de..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marStageSuccessPartial.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Partial MAR File Staged Patch Apply Test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestFiles[gTestFiles.length - 2].originalContents = null;
- gTestFiles[gTestFiles.length - 2].compareContents = "FromPartial\n";
- gTestFiles[gTestFiles.length - 2].comparePerms = 0o644;
- gTestDirs = gTestDirsPartialSuccess;
- preventDistributionFiles();
- setupDistributionDir();
- setupUpdaterTest(FILE_PARTIAL_MAR, true);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_PARTIAL_SUCCESS, true, false, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_SUCCEEDED, true, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true, true);
- checkDistributionDir();
- checkCallbackLog();
-}
-
-/**
- * Setup the state of the distribution directory for the test.
- */
-function setupDistributionDir() {
- if (IS_MACOSX) {
- // Create files in the old distribution directory location to verify that
- // the directory and its contents are moved to the new location on update.
- let testFile = getApplyDirFile(DIR_MACOS + "distribution/testFile", true);
- writeFile(testFile, "test\n");
- testFile = getApplyDirFile(DIR_MACOS + "distribution/test/testFile", true);
- writeFile(testFile, "test\n");
- }
-}
-
-/**
- * Checks the state of the distribution directory.
- */
-function checkDistributionDir() {
- let distributionDir = getApplyDirFile(DIR_RESOURCES + "distribution", true);
- if (IS_MACOSX) {
- Assert.ok(distributionDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(distributionDir.path));
-
- let testFile = getApplyDirFile(DIR_RESOURCES + "distribution/testFile", true);
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
-
- testFile = getApplyDirFile(DIR_RESOURCES + "distribution/test/testFile", true);
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
-
- distributionDir = getApplyDirFile(DIR_MACOS + "distribution", true);
- Assert.ok(!distributionDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(distributionDir.path));
-
- checkUpdateLogContains(MOVE_OLD_DIST_DIR);
- } else {
- debugDump("testing that files aren't added with an add-if instruction " +
- "when the file's destination directory doesn't exist");
- Assert.ok(!distributionDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(distributionDir.path));
- }
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marSuccessComplete.js b/toolkit/mozapps/update/tests/unit_base_updater/marSuccessComplete.js
deleted file mode 100644
index 1008e867f..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marSuccessComplete.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Complete MAR File Patch Apply Test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- preventDistributionFiles();
- setupDistributionDir();
- setupUpdaterTest(FILE_COMPLETE_MAR, true);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, false, false, true);
- checkDistributionDir();
- checkCallbackLog();
-}
-
-/**
- * Setup the state of the distribution directory for the test.
- */
-function setupDistributionDir() {
- if (IS_MACOSX) {
- // Create files in the old distribution directory location to verify that
- // the directory and its contents are moved to the new location on update.
- let testFile = getApplyDirFile(DIR_MACOS + "distribution/testFile", true);
- writeFile(testFile, "test\n");
- testFile = getApplyDirFile(DIR_MACOS + "distribution/test/testFile", true);
- writeFile(testFile, "test\n");
- }
-}
-
-/**
- * Checks the state of the distribution directory.
- */
-function checkDistributionDir() {
- let distributionDir = getApplyDirFile(DIR_RESOURCES + "distribution", true);
- if (IS_MACOSX) {
- Assert.ok(distributionDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(distributionDir.path));
-
- let testFile = getApplyDirFile(DIR_RESOURCES + "distribution/testFile", true);
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
-
- testFile = getApplyDirFile(DIR_RESOURCES + "distribution/test/testFile", true);
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
-
- distributionDir = getApplyDirFile(DIR_MACOS + "distribution", true);
- Assert.ok(!distributionDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(distributionDir.path));
-
- checkUpdateLogContains(MOVE_OLD_DIST_DIR);
- } else {
- debugDump("testing that files aren't added with an add-if instruction " +
- "when the file's destination directory doesn't exist");
- Assert.ok(!distributionDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(distributionDir.path));
- }
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marSuccessPartial.js b/toolkit/mozapps/update/tests/unit_base_updater/marSuccessPartial.js
deleted file mode 100644
index 616390f55..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marSuccessPartial.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Partial MAR File Patch Apply Test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestFiles[gTestFiles.length - 1].originalContents = null;
- gTestFiles[gTestFiles.length - 1].compareContents = "FromPartial\n";
- gTestFiles[gTestFiles.length - 1].comparePerms = 0o644;
- gTestFiles[gTestFiles.length - 2].originalContents = null;
- gTestFiles[gTestFiles.length - 2].compareContents = "FromPartial\n";
- gTestFiles[gTestFiles.length - 2].comparePerms = 0o644;
- gTestDirs = gTestDirsPartialSuccess;
- setupDistributionDir();
- // The third parameter will test that a relative path that contains a
- // directory traversal to the post update binary doesn't execute.
- setupUpdaterTest(FILE_PARTIAL_MAR, false, "test/../");
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_PARTIAL_SUCCESS);
- checkDistributionDir();
- checkCallbackLog();
-}
-
-/**
- * Setup the state of the distribution directory for the test.
- */
-function setupDistributionDir() {
- if (IS_MACOSX) {
- // Create files in the old distribution directory location to verify that
- // the directory and its contents are removed when there is a distribution
- // directory in the new location.
- let testFile = getApplyDirFile(DIR_MACOS + "distribution/testFile", true);
- writeFile(testFile, "test\n");
- testFile = getApplyDirFile(DIR_MACOS + "distribution/test/testFile", true);
- writeFile(testFile, "test\n");
- }
-}
-
-/**
- * Checks the state of the distribution directory.
- */
-function checkDistributionDir() {
- if (IS_MACOSX) {
- let distributionDir = getApplyDirFile(DIR_MACOS + "distribution", true);
- Assert.ok(!distributionDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(distributionDir.path));
- checkUpdateLogContains(REMOVE_OLD_DIST_DIR);
- }
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marVersionDowngrade.js b/toolkit/mozapps/update/tests/unit_base_updater/marVersionDowngrade.js
deleted file mode 100644
index 86a2eb821..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marVersionDowngrade.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Test version downgrade MAR security check */
-
-function run_test() {
- if (!MOZ_VERIFY_MAR_SIGNATURE) {
- return;
- }
-
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_OLD_VERSION_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- // If execv is used the updater process will turn into the callback process
- // and the updater's return code will be that of the callback process.
- runUpdate(STATE_FAILED_VERSION_DOWNGRADE_ERROR, false, (USE_EXECV ? 0 : 1),
- false);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
- "the update state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, VERSION_DOWNGRADE_ERROR,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(STATE_FAILED_VERSION_DOWNGRADE_ERROR);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/marWrongChannel.js b/toolkit/mozapps/update/tests/unit_base_updater/marWrongChannel.js
deleted file mode 100644
index 6db906fbc..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/marWrongChannel.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Test product/channel MAR security check */
-
-function run_test() {
- if (!MOZ_VERIFY_MAR_SIGNATURE) {
- return;
- }
-
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_WRONG_CHANNEL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- // If execv is used the updater process will turn into the callback process
- // and the updater's return code will be that of the callback process.
- runUpdate(STATE_FAILED_MAR_CHANNEL_MISMATCH_ERROR, false, (USE_EXECV ? 0 : 1),
- false);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
- "the update state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, MAR_CHANNEL_MISMATCH_ERROR,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(STATE_FAILED_MAR_CHANNEL_MISMATCH_ERROR);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_base_updater/xpcshell.ini b/toolkit/mozapps/update/tests/unit_base_updater/xpcshell.ini
deleted file mode 100644
index 2b77bee7a..000000000
--- a/toolkit/mozapps/update/tests/unit_base_updater/xpcshell.ini
+++ /dev/null
@@ -1,136 +0,0 @@
-; This Source Code Form is subject to the terms of the Mozilla Public
-; License, v. 2.0. If a copy of the MPL was not distributed with this
-; file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-; Tests that require the updater binary. These tests should never run on Android
-; which doesn't use the updater binary as other applications do and are excluded
-; from running the tests in the moz.build file.
-
-[DEFAULT]
-tags = appupdate
-head = head_update.js
-tail =
-
-[invalidArgCallbackFileNotInInstallDirFailure.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[invalidArgCallbackFilePathTooLongFailure.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[invalidArgInstallDirPathTooLongFailure.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[invalidArgInstallDirPathTraversalFailure.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[invalidArgInstallWorkingDirPathNotSameFailure_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[invalidArgPatchDirPathTraversalFailure.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[invalidArgStageDirNotInInstallDirFailure_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[invalidArgWorkingDirPathLocalUNCFailure_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[invalidArgWorkingDirPathRelativeFailure.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[marSuccessComplete.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[marSuccessPartial.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[marFailurePartial.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[marStageSuccessComplete.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[marStageSuccessPartial.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[marVersionDowngrade.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985 and mar signing
-[marWrongChannel.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985 and mar signing
-[marStageFailurePartial.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[marCallbackAppSuccessComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marCallbackAppSuccessPartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marCallbackAppStageSuccessComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marCallbackAppStageSuccessPartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marAppInUseSuccessComplete.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[marAppInUseStageSuccessComplete_unix.js]
-skip-if = os == 'win'
-reason = not a Windows test
-[marAppInUseStageFailureComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marFileLockedFailureComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marFileLockedFailurePartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marFileLockedStageFailureComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marFileLockedStageFailurePartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marFileInUseSuccessComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marFileInUseSuccessPartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marRMRFDirFileInUseSuccessComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marRMRFDirFileInUseSuccessPartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marFileInUseStageFailureComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marFileInUseStageFailurePartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marRMRFDirFileInUseStageFailureComplete_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marRMRFDirFileInUseStageFailurePartial_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marAppApplyDirLockedStageFailure_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marAppApplyUpdateAppBinInUseStageSuccess_win.js]
-skip-if = os != 'win' || debug && (os_version == '5.1' || os_version == '5.2')
-reason = Windows only test and bug 1291985
-[marAppApplyUpdateSuccess.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[marAppApplyUpdateStageSuccess.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-[marAppApplyUpdateStageOldVersionFailure.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/.eslintrc.js b/toolkit/mozapps/update/tests/unit_service_updater/.eslintrc.js
deleted file mode 100644
index d35787cd2..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../../../testing/xpcshell/xpcshell.eslintrc.js"
- ]
-};
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/bootstrapSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/bootstrapSvc.js
deleted file mode 100644
index 015fbd0cb..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/bootstrapSvc.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Bootstrap the tests using the service by installing our own version of the service */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- // We don't actually care if the MAR has any data, we only care about the
- // application return code and update.status result.
- gTestFiles = gTestFilesCommon;
- gTestDirs = [];
- setupUpdaterTest(FILE_COMPLETE_MAR, null);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdateUsingService finishes.
- */
-function runUpdateFinished() {
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, false);
-
- // We need to check the service log even though this is a bootstrap
- // because the app bin could be in use by this test by the time the next
- // test runs.
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/checkUpdaterSigSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/checkUpdaterSigSvc.js
deleted file mode 100644
index bf765ee78..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/checkUpdaterSigSvc.js
+++ /dev/null
@@ -1,39 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * We skip authenticode cert checks from the service udpates
- * so that we can use updater-xpcshell with the wrong certs for testing.
- * This tests that code path. */
-
-function run_test() {
- if (!IS_AUTHENTICODE_CHECK_ENABLED) {
- return;
- }
-
- let binDir = getGREBinDir();
- let maintenanceServiceBin = binDir.clone();
- maintenanceServiceBin.append(FILE_MAINTENANCE_SERVICE_BIN);
-
- let updaterBin = binDir.clone();
- updaterBin.append(FILE_UPDATER_BIN);
-
- debugDump("Launching maintenance service bin: " +
- maintenanceServiceBin.path + " to check updater: " +
- updaterBin.path + " signature.");
-
- // Bypass the manifest and run as invoker
- gEnv.set("__COMPAT_LAYER", "RunAsInvoker");
-
- let dummyInstallPath = "---";
- let maintenanceServiceBinArgs = ["check-cert", dummyInstallPath,
- updaterBin.path];
- let maintenanceServiceBinProcess = Cc["@mozilla.org/process/util;1"].
- createInstance(Ci.nsIProcess);
- maintenanceServiceBinProcess.init(maintenanceServiceBin);
- maintenanceServiceBinProcess.run(true, maintenanceServiceBinArgs,
- maintenanceServiceBinArgs.length);
- Assert.equal(maintenanceServiceBinProcess.exitValue, 0,
- "the maintenance service exit value should be 0");
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/head_update.js b/toolkit/mozapps/update/tests/unit_service_updater/head_update.js
deleted file mode 100644
index 38be4ee39..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/head_update.js
+++ /dev/null
@@ -1,8 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-const IS_SERVICE_TEST = true;
-
-/* import-globals-from ../data/xpcshellUtilsAUS.js */
-load("../data/xpcshellUtilsAUS.js");
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTooLongFailureSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTooLongFailureSvc.js
deleted file mode 100644
index 70e03646a..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTooLongFailureSvc.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Too long install directory path failure test */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
- : STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = "123456789";
- if (IS_WIN) {
- path = "\\" + path;
- path = path.repeat(30); // 300 characters
- path = "C:" + path;
- } else {
- path = "/" + path;
- path = path.repeat(1000); // 10000 characters
- }
-
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null, null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTraversalFailureSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTraversalFailureSvc.js
deleted file mode 100644
index 330578de6..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallDirPathTraversalFailureSvc.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Install directory path traversal failure test */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_INSTALL_DIR_PATH_ERROR
- : STATE_FAILED_INVALID_INSTALL_DIR_PATH_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = "123456789";
- if (IS_WIN) {
- path = "C:\\" + path + "\\..\\" + path;
- } else {
- path = "/" + path + "/../" + path;
- }
-
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, path, null, null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallWorkingDirPathNotSameFailureSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallWorkingDirPathNotSameFailureSvc_win.js
deleted file mode 100644
index 8ddb34af0..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgInstallWorkingDirPathNotSameFailureSvc_win.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Different install and working directories for a regular update failure */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_ERROR
- : STATE_FAILED_INVALID_APPLYTO_DIR_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = getApplyDirFile("..", false).path;
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path, null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgPatchDirPathTraversalFailureSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgPatchDirPathTraversalFailureSvc.js
deleted file mode 100644
index c8ae3f0c6..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgPatchDirPathTraversalFailureSvc.js
+++ /dev/null
@@ -1,43 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Patch directory path traversal failure test */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = getUpdatesPatchDir();
- if (IS_WIN) {
- path = path + "\\..\\";
- } else {
- path = path + "/../";
- }
-
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, path, null, null, null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgStageDirNotInInstallDirFailureSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgStageDirNotInInstallDirFailureSvc_win.js
deleted file mode 100644
index e9b227657..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgStageDirNotInInstallDirFailureSvc_win.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Different install and working directories for a regular update failure */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_APPLYTO_DIR_STAGED_ERROR
- : STATE_FAILED_INVALID_APPLYTO_DIR_STAGED_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = getApplyDirFile("..", false).path;
- runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true, null, null, path, null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathLocalUNCFailureSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathLocalUNCFailureSvc_win.js
deleted file mode 100644
index 87bbad4aa..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathLocalUNCFailureSvc_win.js
+++ /dev/null
@@ -1,38 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Working directory path local UNC failure test */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR
- : STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- let path = "\\\\.\\" + getApplyDirFile(null, false).path;
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, path, null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathRelativeFailureSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathRelativeFailureSvc.js
deleted file mode 100644
index a550909b2..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/invalidArgWorkingDirPathRelativeFailureSvc.js
+++ /dev/null
@@ -1,37 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* Relative working directory path failure test */
-
-const STATE_AFTER_RUNUPDATE =
- IS_SERVICE_TEST ? STATE_FAILED_SERVICE_INVALID_WORKING_DIR_PATH_ERROR
- : STATE_FAILED_INVALID_WORKING_DIR_PATH_ERROR;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runUpdate(STATE_AFTER_RUNUPDATE, false, 1, true, null, null, "test", null);
-}
-
-/**
- * Called after the call to runUpdateUsingUpdater finishes.
- */
-function runUpdateFinished() {
- standardInit();
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyDirLockedStageFailureSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyDirLockedStageFailureSvc_win.js
deleted file mode 100644
index b9f793236..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyDirLockedStageFailureSvc_win.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Test applying an update by staging an update and launching an application to
- * apply it.
- */
-
-const STATE_AFTER_STAGE = STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
-
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- createUpdateInProgressLockFile(getAppBaseDir());
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(false);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- removeUpdateInProgressLockFile(getAppBaseDir());
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(PERFORMING_STAGED_UPDATE);
- checkUpdateLogContains(ERR_UPDATE_IN_PROGRESS);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateAppBinInUseStageSuccessSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateAppBinInUseStageSuccessSvc_win.js
deleted file mode 100644
index a606720b7..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateAppBinInUseStageSuccessSvc_win.js
+++ /dev/null
@@ -1,83 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Test applying an update by staging an update and launching an application to
- * apply it.
- */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
-
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, undefined);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true, false);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- lockDirectory(getAppBaseDir().path);
- // Switch the application to the staged application that was updated.
- runUpdateUsingApp(STATE_SUCCEEDED);
-}
-
-/**
- * Called after the call to runUpdateUsingApp finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS);
-
- let updatesDir = getUpdatesPatchDir();
- Assert.ok(updatesDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(updatesDir.path));
-
- let log = getUpdateLog(FILE_UPDATE_LOG);
- Assert.ok(!log.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_LAST_UPDATE_LOG);
- Assert.ok(log.exists(),
- MSG_SHOULD_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_BACKUP_UPDATE_LOG);
- Assert.ok(log.exists(),
- MSG_SHOULD_EXIST + getMsgPath(log.path));
-
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js
deleted file mode 100644
index 5b9b08156..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateStageSuccessSvc.js
+++ /dev/null
@@ -1,82 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Test applying an update by staging an update and launching an application to
- * apply it.
- */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
-
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, true);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdateUsingApp(STATE_SUCCEEDED);
-}
-
-/**
- * Called after the call to runUpdateUsingApp finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);
-
- let updatesDir = getUpdatesPatchDir();
- Assert.ok(updatesDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(updatesDir.path));
-
- let log = getUpdateLog(FILE_UPDATE_LOG);
- Assert.ok(!log.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_LAST_UPDATE_LOG);
- Assert.ok(log.exists(),
- MSG_SHOULD_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_BACKUP_UPDATE_LOG);
- Assert.ok(log.exists(),
- MSG_SHOULD_EXIST + getMsgPath(log.path));
-
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js
deleted file mode 100644
index e76233fe6..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppApplyUpdateSuccessSvc.js
+++ /dev/null
@@ -1,65 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/**
- * Test applying an update by staging an update and launching an application to
- * apply it.
- */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
-
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- // The third parameter will test that a full path to the post update binary
- // doesn't execute.
- setupUpdaterTest(FILE_COMPLETE_MAR, undefined,
- getApplyDirFile(null, true).path + "/");
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runUpdateUsingApp(STATE_SUCCEEDED);
-}
-
-/**
- * Called after the call to runUpdateUsingApp finishes.
- */
-function runUpdateFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS);
-
- let updatesDir = getUpdatesPatchDir();
- Assert.ok(updatesDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(updatesDir.path));
-
- let log = getUpdateLog(FILE_UPDATE_LOG);
- Assert.ok(!log.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_LAST_UPDATE_LOG);
- Assert.ok(log.exists(),
- MSG_SHOULD_EXIST + getMsgPath(log.path));
-
- log = getUpdateLog(FILE_BACKUP_UPDATE_LOG);
- Assert.ok(!log.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(log.path));
-
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseStageFailureCompleteSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseStageFailureCompleteSvc_win.js
deleted file mode 100644
index b1505d58e..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseStageFailureCompleteSvc_win.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Application in use complete MAR file staged patch apply failure test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(DIR_RESOURCES + gCallbackBinFile, false);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- setTestFilesAndDirsForFailure();
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_MOVE_DESTDIR_7 + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseSuccessCompleteSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseSuccessCompleteSvc.js
deleted file mode 100644
index 93333cade..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marAppInUseSuccessCompleteSvc.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Application in use complete MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(DIR_RESOURCES + gCallbackBinFile, false);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppStageSuccessCompleteSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppStageSuccessCompleteSvc_win.js
deleted file mode 100644
index 79e54c182..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppStageSuccessCompleteSvc_win.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Replace app binary complete MAR file staged patch apply success test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- gCallbackBinFile = "exe0.exe";
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_SUCCEEDED, true, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppStageSuccessPartialSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppStageSuccessPartialSvc_win.js
deleted file mode 100644
index b1f84715f..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppStageSuccessPartialSvc_win.js
+++ /dev/null
@@ -1,61 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Patch app binary partial MAR file staged patch apply success test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- gCallbackBinFile = "exe0.exe";
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_PARTIAL_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_SUCCEEDED, true, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppSuccessCompleteSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppSuccessCompleteSvc_win.js
deleted file mode 100644
index 85e92d290..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppSuccessCompleteSvc_win.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Replace app binary complete MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- gCallbackBinFile = "exe0.exe";
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppSuccessPartialSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppSuccessPartialSvc_win.js
deleted file mode 100644
index 1212c9ba2..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marCallbackAppSuccessPartialSvc_win.js
+++ /dev/null
@@ -1,48 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* Patch app binary partial MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- gCallbackBinFile = "exe0.exe";
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_PARTIAL_SUCCESS);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFailurePartialSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marFailurePartialSvc.js
deleted file mode 100644
index 960c96f7b..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFailurePartialSvc.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Partial MAR File Patch Apply Failure Test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestFiles[11].originalFile = "partial.png";
- gTestDirs = gTestDirsPartialSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- // If execv is used the updater process will turn into the callback process
- // and the updater's return code will be that of the callback process.
- runUpdate(STATE_FAILED_LOADSOURCE_ERROR_WRONG_SIZE, false, (USE_EXECV ? 0 : 1),
- true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusFile(), STATE_NONE,
- "the status file failure code" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
- "the update state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, LOADSOURCE_ERROR_WRONG_SIZE,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContents(LOG_PARTIAL_FAILURE);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailureCompleteSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailureCompleteSvc_win.js
deleted file mode 100644
index b39595f92..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailureCompleteSvc_win.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use complete MAR file staged patch apply failure test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestFiles[13].relPathDir + gTestFiles[13].fileName,
- false);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- setTestFilesAndDirsForFailure();
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_MOVE_DESTDIR_7 + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailurePartialSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailurePartialSvc_win.js
deleted file mode 100644
index 06d386ad6..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseStageFailurePartialSvc_win.js
+++ /dev/null
@@ -1,67 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use partial MAR file staged patch apply failure test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestFiles[11].relPathDir + gTestFiles[11].fileName,
- false);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_PARTIAL_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- setTestFilesAndDirsForFailure();
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_MOVE_DESTDIR_7 + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessCompleteSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessCompleteSvc_win.js
deleted file mode 100644
index 89a2fff5e..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessCompleteSvc_win.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use complete MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestFiles[13].relPathDir + gTestFiles[13].fileName,
- false);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContains(ERR_BACKUP_DISCARD);
- checkUpdateLogContains(STATE_SUCCEEDED + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessPartialSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessPartialSvc_win.js
deleted file mode 100644
index ea85ddccc..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileInUseSuccessPartialSvc_win.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use partial MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestFiles[11].relPathDir + gTestFiles[11].fileName,
- false);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContains(ERR_BACKUP_DISCARD);
- checkUpdateLogContains(STATE_SUCCEEDED + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailureCompleteSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailureCompleteSvc_win.js
deleted file mode 100644
index c5efaa8c0..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailureCompleteSvc_win.js
+++ /dev/null
@@ -1,57 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File locked complete MAR file patch apply failure test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperLockFile(gTestFiles[3]);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_FAILED_WRITE_ERROR, false, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusFile(), STATE_PENDING,
- "the status file failure code" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_PENDING,
- "the update state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, WRITE_ERROR,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_BACKUP_CREATE_7);
- checkUpdateLogContains(STATE_FAILED_WRITE_ERROR + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailurePartialSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailurePartialSvc_win.js
deleted file mode 100644
index 4fdbadb5b..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedFailurePartialSvc_win.js
+++ /dev/null
@@ -1,56 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File locked partial MAR file patch apply failure test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperLockFile(gTestFiles[2]);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_FAILED_READ_ERROR, false, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusFile(), STATE_NONE,
- "the status file failure code" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
- "the update state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, READ_ERROR,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_UNABLE_OPEN_DEST);
- checkUpdateLogContains(STATE_FAILED_READ_ERROR + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailureCompleteSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailureCompleteSvc_win.js
deleted file mode 100644
index 4d12f4e42..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailureCompleteSvc_win.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File locked complete MAR file staged patch apply failure test */
-
-const STATE_AFTER_STAGE = STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperLockFile(gTestFiles[3]);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- // Files aren't checked after staging since this test locks a file which
- // prevents reading the file.
- checkUpdateLogContains(ERR_ENSURE_COPY);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_FAILED_WRITE_ERROR, false, 1, false);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusFile(), STATE_PENDING,
- "the status file failure code" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.updateCount, 2,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_PENDING,
- "the update state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, WRITE_ERROR,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_BACKUP_CREATE_7);
- checkUpdateLogContains(STATE_FAILED_WRITE_ERROR + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailurePartialSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailurePartialSvc_win.js
deleted file mode 100644
index 5f64df34c..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marFileLockedStageFailurePartialSvc_win.js
+++ /dev/null
@@ -1,70 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File locked partial MAR file staged patch apply failure test */
-
-const STATE_AFTER_STAGE = STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperLockFile(gTestFiles[2]);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- // Files aren't checked after staging since this test locks a file which
- // prevents reading the file.
- checkUpdateLogContains(ERR_ENSURE_COPY);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_FAILED_READ_ERROR, false, 1, false);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusFile(), STATE_NONE,
- "the status file failure code" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.updateCount, 2,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_FAILED,
- "the update state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, READ_ERROR,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_UNABLE_OPEN_DEST);
- checkUpdateLogContains(STATE_FAILED_READ_ERROR + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailureCompleteSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailureCompleteSvc_win.js
deleted file mode 100644
index b83bafccc..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailureCompleteSvc_win.js
+++ /dev/null
@@ -1,72 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use inside removed dir complete MAR file staged patch apply failure
- test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestDirs[4].relPathDir + gTestDirs[4].subDirs[0] +
- gTestDirs[4].subDirFiles[0], true);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- setTestFilesAndDirsForFailure();
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_MOVE_DESTDIR_7 + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailurePartialSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailurePartialSvc_win.js
deleted file mode 100644
index 39ea485cd..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseStageFailurePartialSvc_win.js
+++ /dev/null
@@ -1,71 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use inside removed dir partial MAR file staged patch apply failure
- test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-const STATE_AFTER_RUNUPDATE = IS_SERVICE_TEST ? STATE_PENDING_SVC : STATE_PENDING;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestDirs[2].relPathDir + gTestDirs[2].files[0], true);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_PARTIAL_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_AFTER_RUNUPDATE, true, 1, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_AFTER_RUNUPDATE,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- setTestFilesAndDirsForFailure();
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_RENAME_FILE);
- checkUpdateLogContains(ERR_MOVE_DESTDIR_7 + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessCompleteSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessCompleteSvc_win.js
deleted file mode 100644
index a71bb8d49..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessCompleteSvc_win.js
+++ /dev/null
@@ -1,63 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use inside removed dir complete MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestDirs[4].relPathDir + gTestDirs[4].subDirs[0] +
- gTestDirs[4].subDirFiles[0], true);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContains(ERR_BACKUP_DISCARD);
- checkUpdateLogContains(STATE_SUCCEEDED + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessPartialSvc_win.js b/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessPartialSvc_win.js
deleted file mode 100644
index 2cbe70ed8..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marRMRFDirFileInUseSuccessPartialSvc_win.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-/* File in use inside removed dir partial MAR file patch apply success test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestDirs = gTestDirsPartialSuccess;
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runHelperFileInUse(gTestDirs[2].relPathDir + gTestDirs[2].files[0], true);
-}
-
-/**
- * Called after the call to waitForHelperSleep finishes.
- */
-function waitForHelperSleepFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- waitForHelperExit();
-}
-
-/**
- * Called after the call to waitForHelperExit finishes.
- */
-function waitForHelperExitFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContains(ERR_BACKUP_DISCARD);
- checkUpdateLogContains(STATE_SUCCEEDED + "\n" + CALL_QUIT);
- checkCallbackLog();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marStageFailurePartialSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marStageFailurePartialSvc.js
deleted file mode 100644
index a9ce23420..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marStageFailurePartialSvc.js
+++ /dev/null
@@ -1,41 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Partial MAR File Staged Patch Apply Failure Test */
-
-const STATE_AFTER_STAGE = STATE_FAILED;
-gStagingRemovedUpdate = true;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestFiles[11].originalFile = "partial.png";
- gTestDirs = gTestDirsPartialSuccess;
- setTestFilesAndDirsForFailure();
- setupUpdaterTest(FILE_PARTIAL_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).errorCode, LOADSOURCE_ERROR_WRONG_SIZE,
- "the update errorCode" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateFailure(getApplyDirFile);
- checkUpdateLogContains(ERR_LOADSOURCEFILE_FAILED);
- waitForFilesInUse();
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessCompleteSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessCompleteSvc.js
deleted file mode 100644
index f7745f68f..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessCompleteSvc.js
+++ /dev/null
@@ -1,132 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Complete MAR File Staged Patch Apply Test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestFiles[gTestFiles.length - 1].originalContents = null;
- gTestFiles[gTestFiles.length - 1].compareContents = "FromComplete\n";
- gTestFiles[gTestFiles.length - 1].comparePerms = 0o644;
- gTestDirs = gTestDirsCompleteSuccess;
- setupDistributionDir();
- setupSymLinks();
- setupUpdaterTest(FILE_COMPLETE_MAR, false);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_SUCCEEDED, true, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- checkAppBundleModTime();
- checkSymLinks();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true);
- checkDistributionDir();
- checkCallbackLog();
-}
-
-/**
- * Setup the state of the distribution directory for the test.
- */
-function setupDistributionDir() {
- if (IS_MACOSX) {
- // Create files in the old distribution directory location to verify that
- // the directory and its contents are removed when there is a distribution
- // directory in the new location.
- let testFile = getApplyDirFile(DIR_MACOS + "distribution/testFile", true);
- writeFile(testFile, "test\n");
- testFile = getApplyDirFile(DIR_MACOS + "distribution/test1/testFile", true);
- writeFile(testFile, "test\n");
- }
-}
-
-/**
- * Checks the state of the distribution directory for the test.
- */
-function checkDistributionDir() {
- if (IS_MACOSX) {
- let distributionDir = getApplyDirFile(DIR_MACOS + "distribution", true);
- Assert.ok(!distributionDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(distributionDir.path));
- checkUpdateLogContains(REMOVE_OLD_DIST_DIR);
- }
-}
-
-/**
- * Setup symlinks for the test.
- */
-function setupSymLinks() {
- // Don't test symlinks on Mac OS X in this test since it tends to timeout.
- // It is tested on Mac OS X in marAppInUseStageSuccessComplete_unix.js
- if (IS_UNIX && !IS_MACOSX) {
- removeSymlink();
- createSymlink();
- do_register_cleanup(removeSymlink);
- gTestFiles.splice(gTestFiles.length - 3, 0,
- {
- description: "Readable symlink",
- fileName: "link",
- relPathDir: DIR_RESOURCES,
- originalContents: "test",
- compareContents: "test",
- originalFile: null,
- compareFile: null,
- originalPerms: 0o666,
- comparePerms: 0o666
- });
- }
-}
-
-/**
- * Checks the state of the symlinks for the test.
- */
-function checkSymLinks() {
- // Don't test symlinks on Mac OS X in this test since it tends to timeout.
- // It is tested on Mac OS X in marAppInUseStageSuccessComplete_unix.js
- if (IS_UNIX && !IS_MACOSX) {
- checkSymlink();
- }
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessPartialSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessPartialSvc.js
deleted file mode 100644
index ef15326de..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marStageSuccessPartialSvc.js
+++ /dev/null
@@ -1,112 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Partial MAR File Staged Patch Apply Test */
-
-const STATE_AFTER_STAGE = IS_SERVICE_TEST ? STATE_APPLIED_SVC : STATE_APPLIED;
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestFiles[gTestFiles.length - 2].originalContents = null;
- gTestFiles[gTestFiles.length - 2].compareContents = "FromPartial\n";
- gTestFiles[gTestFiles.length - 2].comparePerms = 0o644;
- gTestDirs = gTestDirsPartialSuccess;
- preventDistributionFiles();
- setupDistributionDir();
- setupUpdaterTest(FILE_PARTIAL_MAR, true);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- stageUpdate(true);
-}
-
-/**
- * Called after the call to stageUpdate finishes.
- */
-function stageUpdateFinished() {
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getStageDirFile, true);
- checkUpdateLogContents(LOG_PARTIAL_SUCCESS, true, false, true);
- // Switch the application to the staged application that was updated.
- runUpdate(STATE_SUCCEEDED, true, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile, false, true);
- checkUpdateLogContents(LOG_REPLACE_SUCCESS, false, true, true);
- checkDistributionDir();
- checkCallbackLog();
-}
-
-/**
- * Setup the state of the distribution directory for the test.
- */
-function setupDistributionDir() {
- if (IS_MACOSX) {
- // Create files in the old distribution directory location to verify that
- // the directory and its contents are moved to the new location on update.
- let testFile = getApplyDirFile(DIR_MACOS + "distribution/testFile", true);
- writeFile(testFile, "test\n");
- testFile = getApplyDirFile(DIR_MACOS + "distribution/test/testFile", true);
- writeFile(testFile, "test\n");
- }
-}
-
-/**
- * Checks the state of the distribution directory.
- */
-function checkDistributionDir() {
- let distributionDir = getApplyDirFile(DIR_RESOURCES + "distribution", true);
- if (IS_MACOSX) {
- Assert.ok(distributionDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(distributionDir.path));
-
- let testFile = getApplyDirFile(DIR_RESOURCES + "distribution/testFile", true);
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
-
- testFile = getApplyDirFile(DIR_RESOURCES + "distribution/test/testFile", true);
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
-
- distributionDir = getApplyDirFile(DIR_MACOS + "distribution", true);
- Assert.ok(!distributionDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(distributionDir.path));
-
- checkUpdateLogContains(MOVE_OLD_DIST_DIR);
- } else {
- debugDump("testing that files aren't added with an add-if instruction " +
- "when the file's destination directory doesn't exist");
- Assert.ok(!distributionDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(distributionDir.path));
- }
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marSuccessCompleteSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marSuccessCompleteSvc.js
deleted file mode 100644
index 1008e867f..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marSuccessCompleteSvc.js
+++ /dev/null
@@ -1,96 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Complete MAR File Patch Apply Test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesCompleteSuccess;
- gTestDirs = gTestDirsCompleteSuccess;
- preventDistributionFiles();
- setupDistributionDir();
- setupUpdaterTest(FILE_COMPLETE_MAR, true);
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkPostUpdateAppLog();
-}
-
-/**
- * Called after the call to checkPostUpdateAppLog finishes.
- */
-function checkPostUpdateAppLogFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(true);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_COMPLETE_SUCCESS, false, false, true);
- checkDistributionDir();
- checkCallbackLog();
-}
-
-/**
- * Setup the state of the distribution directory for the test.
- */
-function setupDistributionDir() {
- if (IS_MACOSX) {
- // Create files in the old distribution directory location to verify that
- // the directory and its contents are moved to the new location on update.
- let testFile = getApplyDirFile(DIR_MACOS + "distribution/testFile", true);
- writeFile(testFile, "test\n");
- testFile = getApplyDirFile(DIR_MACOS + "distribution/test/testFile", true);
- writeFile(testFile, "test\n");
- }
-}
-
-/**
- * Checks the state of the distribution directory.
- */
-function checkDistributionDir() {
- let distributionDir = getApplyDirFile(DIR_RESOURCES + "distribution", true);
- if (IS_MACOSX) {
- Assert.ok(distributionDir.exists(),
- MSG_SHOULD_EXIST + getMsgPath(distributionDir.path));
-
- let testFile = getApplyDirFile(DIR_RESOURCES + "distribution/testFile", true);
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
-
- testFile = getApplyDirFile(DIR_RESOURCES + "distribution/test/testFile", true);
- Assert.ok(testFile.exists(),
- MSG_SHOULD_EXIST + getMsgPath(testFile.path));
-
- distributionDir = getApplyDirFile(DIR_MACOS + "distribution", true);
- Assert.ok(!distributionDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(distributionDir.path));
-
- checkUpdateLogContains(MOVE_OLD_DIST_DIR);
- } else {
- debugDump("testing that files aren't added with an add-if instruction " +
- "when the file's destination directory doesn't exist");
- Assert.ok(!distributionDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(distributionDir.path));
- }
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/marSuccessPartialSvc.js b/toolkit/mozapps/update/tests/unit_service_updater/marSuccessPartialSvc.js
deleted file mode 100644
index 616390f55..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/marSuccessPartialSvc.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-/* General Partial MAR File Patch Apply Test */
-
-function run_test() {
- if (!setupTestCommon()) {
- return;
- }
- gTestFiles = gTestFilesPartialSuccess;
- gTestFiles[gTestFiles.length - 1].originalContents = null;
- gTestFiles[gTestFiles.length - 1].compareContents = "FromPartial\n";
- gTestFiles[gTestFiles.length - 1].comparePerms = 0o644;
- gTestFiles[gTestFiles.length - 2].originalContents = null;
- gTestFiles[gTestFiles.length - 2].compareContents = "FromPartial\n";
- gTestFiles[gTestFiles.length - 2].comparePerms = 0o644;
- gTestDirs = gTestDirsPartialSuccess;
- setupDistributionDir();
- // The third parameter will test that a relative path that contains a
- // directory traversal to the post update binary doesn't execute.
- setupUpdaterTest(FILE_PARTIAL_MAR, false, "test/../");
-}
-
-/**
- * Called after the call to setupUpdaterTest finishes.
- */
-function setupUpdaterTestFinished() {
- runUpdate(STATE_SUCCEEDED, false, 0, true);
-}
-
-/**
- * Called after the call to runUpdate finishes.
- */
-function runUpdateFinished() {
- checkAppBundleModTime();
- standardInit();
- Assert.equal(readStatusState(), STATE_NONE,
- "the status file state" + MSG_SHOULD_EQUAL);
- Assert.ok(!gUpdateManager.activeUpdate,
- "the active update should not be defined");
- Assert.equal(gUpdateManager.updateCount, 1,
- "the update manager updateCount attribute" + MSG_SHOULD_EQUAL);
- Assert.equal(gUpdateManager.getUpdateAt(0).state, STATE_SUCCEEDED,
- "the update state" + MSG_SHOULD_EQUAL);
- checkPostUpdateRunningFile(false);
- checkFilesAfterUpdateSuccess(getApplyDirFile);
- checkUpdateLogContents(LOG_PARTIAL_SUCCESS);
- checkDistributionDir();
- checkCallbackLog();
-}
-
-/**
- * Setup the state of the distribution directory for the test.
- */
-function setupDistributionDir() {
- if (IS_MACOSX) {
- // Create files in the old distribution directory location to verify that
- // the directory and its contents are removed when there is a distribution
- // directory in the new location.
- let testFile = getApplyDirFile(DIR_MACOS + "distribution/testFile", true);
- writeFile(testFile, "test\n");
- testFile = getApplyDirFile(DIR_MACOS + "distribution/test/testFile", true);
- writeFile(testFile, "test\n");
- }
-}
-
-/**
- * Checks the state of the distribution directory.
- */
-function checkDistributionDir() {
- if (IS_MACOSX) {
- let distributionDir = getApplyDirFile(DIR_MACOS + "distribution", true);
- Assert.ok(!distributionDir.exists(),
- MSG_SHOULD_NOT_EXIST + getMsgPath(distributionDir.path));
- checkUpdateLogContains(REMOVE_OLD_DIST_DIR);
- }
-}
diff --git a/toolkit/mozapps/update/tests/unit_service_updater/xpcshell.ini b/toolkit/mozapps/update/tests/unit_service_updater/xpcshell.ini
deleted file mode 100644
index 1d63f8583..000000000
--- a/toolkit/mozapps/update/tests/unit_service_updater/xpcshell.ini
+++ /dev/null
@@ -1,156 +0,0 @@
-; This Source Code Form is subject to the terms of the Mozilla Public
-; License, v. 2.0. If a copy of the MPL was not distributed with this
-; file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-; Tests that require the updater binary and the maintenance service.
-
-[DEFAULT]
-tags = appupdate
-head = head_update.js
-tail =
-
-[bootstrapSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[invalidArgInstallDirPathTooLongFailureSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[invalidArgInstallDirPathTraversalFailureSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[invalidArgInstallWorkingDirPathNotSameFailureSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[invalidArgPatchDirPathTraversalFailureSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[invalidArgStageDirNotInInstallDirFailureSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[invalidArgWorkingDirPathLocalUNCFailureSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[invalidArgWorkingDirPathRelativeFailureSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marSuccessCompleteSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marSuccessPartialSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marFailurePartialSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marStageSuccessCompleteSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marStageSuccessPartialSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marStageFailurePartialSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marCallbackAppSuccessCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marCallbackAppSuccessPartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marCallbackAppStageSuccessCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marCallbackAppStageSuccessPartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marAppInUseSuccessCompleteSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marAppInUseStageFailureCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marFileLockedFailureCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marFileLockedFailurePartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marFileLockedStageFailureCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marFileLockedStageFailurePartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marFileInUseSuccessCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marFileInUseSuccessPartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marRMRFDirFileInUseSuccessCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marRMRFDirFileInUseSuccessPartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marFileInUseStageFailureCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marFileInUseStageFailurePartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marRMRFDirFileInUseStageFailureCompleteSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marRMRFDirFileInUseStageFailurePartialSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marAppApplyDirLockedStageFailureSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marAppApplyUpdateAppBinInUseStageSuccessSvc_win.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marAppApplyUpdateSuccessSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[marAppApplyUpdateStageSuccessSvc.js]
-skip-if = os == 'win' && debug && (os_version == '5.1' || os_version == '5.2')
-reason = bug 1291985
-run-sequentially = Uses the Mozilla Maintenance Service.
-[checkUpdaterSigSvc.js]
diff --git a/toolkit/nss.configure b/toolkit/nss.configure
deleted file mode 100644
index 734f4f029..000000000
--- a/toolkit/nss.configure
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-
-# DBM support in NSS
-# ==============================================================
-@depends(build_project, '--help')
-def dbm_default(build_project, _):
- return build_project not in ('mobile/android', 'b2g', 'b2g/graphene')
-
-option('--enable-dbm', default=dbm_default, help='Enable building DBM')
-
-set_config('NSS_DISABLE_DBM', depends('--enable-dbm')(lambda x: not x))
diff --git a/toolkit/profile/content/createProfileWizard.js b/toolkit/profile/content/createProfileWizard.js
index 14d006b31..aa87eacd7 100644
--- a/toolkit/profile/content/createProfileWizard.js
+++ b/toolkit/profile/content/createProfileWizard.js
@@ -5,8 +5,6 @@
const C = Components.classes;
const I = Components.interfaces;
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
-
const ToolkitProfileService = "@mozilla.org/toolkit/profile-service;1";
var gProfileService;
@@ -118,12 +116,11 @@ function checkCurrentInput(currentInput)
if (!errorMessage) {
finishText.className = "";
- if (AppConstants.platform == "macosx") {
- finishText.firstChild.data = gProfileManagerBundle.getString("profileFinishTextMac");
- }
- else {
- finishText.firstChild.data = gProfileManagerBundle.getString("profileFinishText");
- }
+#ifdef XP_MACOSX
+ finishText.firstChild.data = gProfileManagerBundle.getString("profileFinishTextMac");
+#else
+ finishText.firstChild.data = gProfileManagerBundle.getString("profileFinishText");
+#endif
canAdvance = true;
}
else {
diff --git a/toolkit/profile/content/profileSelection.js b/toolkit/profile/content/profileSelection.js
index 02b9d6873..05ef6f5ed 100644
--- a/toolkit/profile/content/profileSelection.js
+++ b/toolkit/profile/content/profileSelection.js
@@ -4,7 +4,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-Components.utils.import("resource://gre/modules/AppConstants.jsm");
Components.utils.import("resource://gre/modules/Services.jsm");
const C = Components.classes;
@@ -135,8 +134,9 @@ function onProfilesKey(aEvent)
switch ( aEvent.keyCode )
{
case KeyEvent.DOM_VK_BACK_SPACE:
- if (AppConstants.platform != "macosx")
- break;
+#ifndef XP_MACOSX
+ break;
+#endif
case KeyEvent.DOM_VK_DELETE:
ConfirmDelete();
break;
diff --git a/toolkit/profile/gtest/TestProfileLock.cpp b/toolkit/profile/gtest/TestProfileLock.cpp
deleted file mode 100644
index ac5117d74..000000000
--- a/toolkit/profile/gtest/TestProfileLock.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "gtest/gtest.h"
-
-#include <sys/eventfd.h>
-#include <sched.h>
-
-#include "nsCOMPtr.h"
-#include "nsIFile.h"
-#include "nsProfileLock.h"
-#include "nsString.h"
-
-static void CleanParentLock(const char *tmpdir)
-{
- // nsProfileLock doesn't clean up all its files
- char permanent_lockfile[] = "/.parentlock";
-
- char * parentlock_name;
- size_t parentlock_name_size = strlen(tmpdir) + strlen(permanent_lockfile) + 1;
- parentlock_name = (char*)malloc(parentlock_name_size);
-
- strcpy(parentlock_name, tmpdir);
- strcat(parentlock_name, permanent_lockfile);
-
- EXPECT_EQ(0, unlink(parentlock_name));
- EXPECT_EQ(0, rmdir(tmpdir));
- free(parentlock_name);
-}
-
-TEST(ProfileLock, BasicLock)
-{
- char templ[] = "/tmp/profilelocktest.XXXXXX";
- char * tmpdir = mkdtemp(templ);
- ASSERT_NE(tmpdir, nullptr);
-
- // This scope exits so the nsProfileLock destructor
- // can clean up the files it leaves in tmpdir.
- {
- nsProfileLock myLock;
- nsresult rv;
- nsCOMPtr<nsIFile> dir(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
- ASSERT_EQ(NS_SUCCEEDED(rv), true);
-
- rv = dir->InitWithNativePath(nsCString(tmpdir));
- ASSERT_EQ(NS_SUCCEEDED(rv), true);
-
- rv = myLock.Lock(dir, nullptr);
- EXPECT_EQ(NS_SUCCEEDED(rv), true);
- }
-
- CleanParentLock(tmpdir);
-}
-
-TEST(ProfileLock, RetryLock)
-{
- char templ[] = "/tmp/profilelocktest.XXXXXX";
- char * tmpdir = mkdtemp(templ);
- ASSERT_NE(tmpdir, nullptr);
-
- {
- nsProfileLock myLock;
- nsProfileLock myLock2;
- nsresult rv;
- nsCOMPtr<nsIFile> dir(do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv));
- ASSERT_EQ(NS_SUCCEEDED(rv), true);
-
- rv = dir->InitWithNativePath(nsCString(tmpdir));
- ASSERT_EQ(NS_SUCCEEDED(rv), true);
-
- int eventfd_fd = eventfd(0, 0);
- ASSERT_GE(eventfd_fd, 0);
-
- // fcntl advisory locks are per process, so it's hard
- // to avoid using fork here.
- pid_t childpid = fork();
-
- if (childpid) {
- // parent
-
- // blocking read causing us to lose the race
- eventfd_t value;
- EXPECT_EQ(0, eventfd_read(eventfd_fd, &value));
-
- rv = myLock2.Lock(dir, nullptr);
- EXPECT_EQ(NS_ERROR_FILE_ACCESS_DENIED, rv);
-
- // kill the child
- EXPECT_EQ(0, kill(childpid, SIGTERM));
-
- // reap zombie (required to collect the lock)
- int status;
- EXPECT_EQ(childpid, waitpid(childpid, &status, 0));
-
- rv = myLock2.Lock(dir, nullptr);
- EXPECT_EQ(NS_SUCCEEDED(rv), true);
- } else {
- // child
- rv = myLock.Lock(dir, nullptr);
- ASSERT_EQ(NS_SUCCEEDED(rv), true);
-
- // unblock parent
- EXPECT_EQ(0, eventfd_write(eventfd_fd, 1));
-
- // parent will kill us
- for (;;)
- sleep(1);
- }
-
- close(eventfd_fd);
- }
-
- CleanParentLock(tmpdir);
-}
diff --git a/toolkit/profile/gtest/moz.build b/toolkit/profile/gtest/moz.build
deleted file mode 100644
index 51b420e19..000000000
--- a/toolkit/profile/gtest/moz.build
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-LOCAL_INCLUDES += [
- '..',
-]
-
-if CONFIG['OS_ARCH'] == 'Linux':
- UNIFIED_SOURCES += [
- 'TestProfileLock.cpp',
- ]
-
-FINAL_LIBRARY = 'xul-gtest'
diff --git a/toolkit/profile/jar.mn b/toolkit/profile/jar.mn
index 9b7c22266..1c4afac4c 100644
--- a/toolkit/profile/jar.mn
+++ b/toolkit/profile/jar.mn
@@ -3,7 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
toolkit.jar:
- content/mozapps/profile/createProfileWizard.js (content/createProfileWizard.js)
+* content/mozapps/profile/createProfileWizard.js (content/createProfileWizard.js)
* content/mozapps/profile/createProfileWizard.xul (content/createProfileWizard.xul)
- content/mozapps/profile/profileSelection.js (content/profileSelection.js)
+* content/mozapps/profile/profileSelection.js (content/profileSelection.js)
content/mozapps/profile/profileSelection.xul (content/profileSelection.xul)
diff --git a/toolkit/profile/moz.build b/toolkit/profile/moz.build
index b2383a871..0a84b8c69 100644
--- a/toolkit/profile/moz.build
+++ b/toolkit/profile/moz.build
@@ -4,11 +4,6 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
-
-if CONFIG['ENABLE_TESTS']:
- DIRS += ['gtest']
-
XPIDL_SOURCES += [
'nsIProfileMigrator.idl',
'nsIProfileUnlocker.idl',
@@ -18,26 +13,15 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'toolkitprofile'
-UNIFIED_SOURCES += [
- 'nsProfileLock.cpp'
-]
+UNIFIED_SOURCES += ['nsProfileLock.cpp']
if CONFIG['OS_ARCH'] == 'WINNT':
- UNIFIED_SOURCES += [
- 'ProfileUnlockerWin.cpp'
- ]
+ UNIFIED_SOURCES += ['ProfileUnlockerWin.cpp']
-UNIFIED_SOURCES += [
- 'nsToolkitProfileService.cpp'
-]
+UNIFIED_SOURCES += ['nsToolkitProfileService.cpp']
-LOCAL_INCLUDES += [
- '../xre',
-]
+LOCAL_INCLUDES += ['../xre']
FINAL_LIBRARY = 'xul'
JAR_MANIFESTS += ['jar.mn']
-
-with Files('**'):
- BUG_COMPONENT = ('Toolkit', 'Startup and Profile System')
diff --git a/toolkit/profile/nsToolkitProfileService.cpp b/toolkit/profile/nsToolkitProfileService.cpp
index e818d27e6..2fe51b285 100644
--- a/toolkit/profile/nsToolkitProfileService.cpp
+++ b/toolkit/profile/nsToolkitProfileService.cpp
@@ -811,10 +811,10 @@ nsToolkitProfileService::CreateProfileInternal(nsIFile* aRootDir,
rv = rootDir->Create(nsIFile::DIRECTORY_TYPE, 0700);
NS_ENSURE_SUCCESS(rv, rv);
rv = rootDir->SetPermissions(0700);
-#ifndef ANDROID
+
// If the profile is on the sdcard, this will fail but its non-fatal
NS_ENSURE_SUCCESS(rv, rv);
-#endif
+
}
rv = localDir->Exists(&exists);
diff --git a/toolkit/profile/test/.eslintrc.js b/toolkit/profile/test/.eslintrc.js
deleted file mode 100644
index 4e6d4bcf0..000000000
--- a/toolkit/profile/test/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../testing/mochitest/chrome.eslintrc.js"
- ]
-};
diff --git a/toolkit/profile/test/chrome.ini b/toolkit/profile/test/chrome.ini
deleted file mode 100644
index e21c1022e..000000000
--- a/toolkit/profile/test/chrome.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[DEFAULT]
-
-[test_create_profile.xul]
diff --git a/toolkit/profile/test/test_create_profile.xul b/toolkit/profile/test/test_create_profile.xul
deleted file mode 100644
index 040b1256b..000000000
--- a/toolkit/profile/test/test_create_profile.xul
+++ /dev/null
@@ -1,134 +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"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=543854
--->
-<window title="Mozilla Bug 543854"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=543854"
- target="_blank">Mozilla Bug 543854</a>
- </body>
-
- <!-- test code goes here -->
- <script type="application/javascript">
- <![CDATA[
-
- /** Test for Bug 543854 **/
-
- SimpleTest.waitForExplicitFinish();
-
- const Cc = Components.classes;
- const Ci = Components.interfaces;
-
- const ASCIIName = "myprofile";
- const UnicodeName = "\u09A0\u09BE\u0995\u09C1\u09B0"; // A Bengali name
-
- var gDirService;
- var gIOService;
- var gProfileService;
-
- var gDefaultLocalProfileParent;
-
- gDirService = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties);
-
- gIOService = Cc["@mozilla.org/network/io-service;1"].
- getService(Ci.nsIIOService);
-
- gProfileService = Cc["@mozilla.org/toolkit/profile-service;1"].
- getService(Ci.nsIToolkitProfileService);
-
- gDefaultLocalProfileParent = gDirService.get("DefProfLRt", Ci.nsIFile);
-
- createProfile(ASCIIName);
- createProfile(UnicodeName);
- SimpleTest.finish();
-
-/**
- * Read the contents of an nsIFile. Throws on error.
-
- * @param file an nsIFile instance.
- * @return string contents.
- */
-function readFile(file) {
- let fstream = Cc["@mozilla.org/network/file-input-stream;1"].
- createInstance(Ci.nsIFileInputStream);
- let sstream = Cc["@mozilla.org/scriptableinputstream;1"].
- createInstance(Components.interfaces.nsIScriptableInputStream);
-
- const RO = 0x01;
- const READ_OTHERS = 4;
-
- fstream.init(file, RO, READ_OTHERS, 0);
- sstream.init(fstream);
- let out = sstream.read(sstream.available());
- sstream.close();
- fstream.close();
- return out;
-}
-
-function checkBounds(lowerBound, value, upperBound) {
- ok(lowerBound <= value, "value " + value +
- " is above lower bound " + lowerBound);
- ok(upperBound >= value, "value " + value +
- " is within upper bound " + upperBound);
-}
-
-function createProfile(profileName) {
- // Filesystem precision is lower than Date precision.
- let lowerBound = Date.now() - 1000;
-
- let profile = gProfileService.createProfile(null, profileName);
-
- // check that the directory was created
- isnot(profile, null, "Profile " + profileName + " created");
-
- let profileDir = profile.rootDir;
-
- ok(profileDir.exists(), "Profile dir created");
- ok(profileDir.isDirectory(), "Profile dir is a directory");
-
- let profileDirPath = profileDir.path;
-
- is(profileDirPath.substr(profileDirPath.length - profileName.length),
- profileName, "Profile dir has expected name");
-
- // Ensure that our timestamp file was created.
- let jsonFile = profileDir.clone();
- jsonFile.append("times.json");
- ok(jsonFile.path, "Path is " + jsonFile.path);
- ok(jsonFile.exists(), "Times file was created");
- ok(jsonFile.isFile(), "Times file is a file");
- let json = JSON.parse(readFile(jsonFile));
-
- let upperBound = Date.now() + 1000;
-
- let created = json.created;
- ok(created, "created is set");
-
- // Check against real clock time.
- checkBounds(lowerBound, created, upperBound);
-
- // Clean up the profile before local profile test.
- profile.remove(true);
-
- // Create with non-null aRootDir
- profile = gProfileService.createProfile(profileDir, profileName);
-
- let localProfileDir = profile.localDir;
- ok(gDefaultLocalProfileParent.contains(localProfileDir, false),
- "Local profile dir created in DefProfLRt");
-
- // Clean up the profile.
- profile.remove(true);
-}
-
- ]]>
- </script>
-</window>
diff --git a/toolkit/system/androidproxy/moz.build b/toolkit/system/androidproxy/moz.build
deleted file mode 100644
index 5c6b0c105..000000000
--- a/toolkit/system/androidproxy/moz.build
+++ /dev/null
@@ -1,11 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SOURCES += [
- 'nsAndroidSystemProxySettings.cpp',
-]
-
-FINAL_LIBRARY = 'xul'
diff --git a/toolkit/system/androidproxy/nsAndroidSystemProxySettings.cpp b/toolkit/system/androidproxy/nsAndroidSystemProxySettings.cpp
deleted file mode 100644
index 71e12bb77..000000000
--- a/toolkit/system/androidproxy/nsAndroidSystemProxySettings.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsIURI.h"
-
-#include "nsISystemProxySettings.h"
-#include "nsIServiceManager.h"
-#include "mozilla/ModuleUtils.h"
-#include "nsPrintfCString.h"
-#include "nsNetCID.h"
-#include "nsISupportsPrimitives.h"
-#include "nsIURI.h"
-
-#include "AndroidBridge.h"
-
-class nsAndroidSystemProxySettings : public nsISystemProxySettings
-{
-public:
- NS_DECL_THREADSAFE_ISUPPORTS
- NS_DECL_NSISYSTEMPROXYSETTINGS
-
- nsAndroidSystemProxySettings() {};
- nsresult Init();
-
-private:
- virtual ~nsAndroidSystemProxySettings() {}
-};
-
-NS_IMPL_ISUPPORTS(nsAndroidSystemProxySettings, nsISystemProxySettings)
-
-NS_IMETHODIMP
-nsAndroidSystemProxySettings::GetMainThreadOnly(bool *aMainThreadOnly)
-{
- *aMainThreadOnly = true;
- return NS_OK;
-}
-
-
-nsresult
-nsAndroidSystemProxySettings::Init()
-{
- return NS_OK;
-}
-
-nsresult
-nsAndroidSystemProxySettings::GetPACURI(nsACString& aResult)
-{
- return NS_OK;
-}
-
-nsresult
-nsAndroidSystemProxySettings::GetProxyForURI(const nsACString & aSpec,
- const nsACString & aScheme,
- const nsACString & aHost,
- const int32_t aPort,
- nsACString & aResult)
-{
- return mozilla::AndroidBridge::Bridge()->GetProxyForURI(aSpec, aScheme, aHost, aPort, aResult);
-}
-
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsAndroidSystemProxySettings, Init)
-
-#define NS_ANDROIDSYSTEMPROXYSERVICE_CID \
- {0xf01f0060, 0x3708, 0x478e, \
- {0xb9, 0x35, 0x3e, 0xce, 0x8b, 0xe2, 0x94, 0xb8}}
-
-NS_DEFINE_NAMED_CID(NS_ANDROIDSYSTEMPROXYSERVICE_CID);
-
-void test() {};
-
-static const mozilla::Module::CIDEntry kSysProxyCIDs[] = {
- { &kNS_ANDROIDSYSTEMPROXYSERVICE_CID, false, nullptr, nsAndroidSystemProxySettingsConstructor },
- { nullptr }
-};
-
-static const mozilla::Module::ContractIDEntry kSysProxyContracts[] = {
- { NS_SYSTEMPROXYSETTINGS_CONTRACTID, &kNS_ANDROIDSYSTEMPROXYSERVICE_CID },
- { nullptr }
-};
-
-static const mozilla::Module kSysProxyModule = {
- mozilla::Module::kVersion,
- kSysProxyCIDs,
- kSysProxyContracts
-};
-
-NSMODULE_DEFN(nsAndroidProxyModule) = &kSysProxyModule;
diff --git a/toolkit/themes/linux/mozapps/extensions/extensions.css b/toolkit/themes/linux/mozapps/extensions/extensions.css
index 5c642fbbf..b21a65520 100644
--- a/toolkit/themes/linux/mozapps/extensions/extensions.css
+++ b/toolkit/themes/linux/mozapps/extensions/extensions.css
@@ -517,6 +517,13 @@
background-repeat: repeat-x;
}
+.addon-view[notification="warning"][native="false"] {
+ background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"),
+ linear-gradient(rgba(255, 128, 0, 0.04),
+ rgba(255, 128, 0, 0));
+ background-repeat: repeat-x;
+}
+
.addon-view[notification="error"] {
background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"),
linear-gradient(rgba(255, 0, 0, 0.04),
diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-compatibility.png b/toolkit/themes/linux/mozapps/extensions/stripes-compatibility.png
new file mode 100644
index 000000000..dee75516b
--- /dev/null
+++ b/toolkit/themes/linux/mozapps/extensions/stripes-compatibility.png
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-error.png b/toolkit/themes/linux/mozapps/extensions/stripes-error.png
new file mode 100644
index 000000000..1dc2d8504
--- /dev/null
+++ b/toolkit/themes/linux/mozapps/extensions/stripes-error.png
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-info-negative.png b/toolkit/themes/linux/mozapps/extensions/stripes-info-negative.png
new file mode 100644
index 000000000..901ab1ec2
--- /dev/null
+++ b/toolkit/themes/linux/mozapps/extensions/stripes-info-negative.png
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-info-positive.png b/toolkit/themes/linux/mozapps/extensions/stripes-info-positive.png
new file mode 100644
index 000000000..370ceec0f
--- /dev/null
+++ b/toolkit/themes/linux/mozapps/extensions/stripes-info-positive.png
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/extensions/stripes-warning.png b/toolkit/themes/linux/mozapps/extensions/stripes-warning.png
new file mode 100644
index 000000000..69463fb1a
--- /dev/null
+++ b/toolkit/themes/linux/mozapps/extensions/stripes-warning.png
Binary files differ
diff --git a/toolkit/themes/linux/mozapps/jar.mn b/toolkit/themes/linux/mozapps/jar.mn
index 0931d1823..27b647308 100644
--- a/toolkit/themes/linux/mozapps/jar.mn
+++ b/toolkit/themes/linux/mozapps/jar.mn
@@ -26,6 +26,11 @@ toolkit.jar:
skin/classic/mozapps/extensions/themeGeneric.png (extensions/themeGeneric.png)
skin/classic/mozapps/extensions/themeGeneric-16.png (extensions/themeGeneric-16.png)
skin/classic/mozapps/extensions/localeGeneric.png (extensions/localeGeneric.png)
+ skin/classic/mozapps/extensions/stripes-warning.png (extensions/stripes-warning.png)
+ skin/classic/mozapps/extensions/stripes-compatibility.png (extensions/stripes-compatibility.png)
+ skin/classic/mozapps/extensions/stripes-error.png (extensions/stripes-error.png)
+ skin/classic/mozapps/extensions/stripes-info-positive.png (extensions/stripes-info-positive.png)
+ skin/classic/mozapps/extensions/stripes-info-negative.png (extensions/stripes-info-negative.png)
skin/classic/mozapps/extensions/newaddon.css (extensions/newaddon.css)
skin/classic/mozapps/extensions/selectAddons.css (extensions/selectAddons.css)
skin/classic/mozapps/xpinstall/xpinstallItemGeneric.png (extensions/extensionGeneric.png)
diff --git a/toolkit/themes/mobile/global/empty.css b/toolkit/themes/mobile/global/empty.css
deleted file mode 100644
index d615bf886..000000000
--- a/toolkit/themes/mobile/global/empty.css
+++ /dev/null
@@ -1,7 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/*
- * Empty stub for theme CSS
- */
diff --git a/toolkit/themes/mobile/global/icons/Error.png b/toolkit/themes/mobile/global/icons/Error.png
deleted file mode 100644
index bd4064f49..000000000
--- a/toolkit/themes/mobile/global/icons/Error.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/mobile/global/media/TopLevelImageDocument.css b/toolkit/themes/mobile/global/media/TopLevelImageDocument.css
deleted file mode 100644
index 524217516..000000000
--- a/toolkit/themes/mobile/global/media/TopLevelImageDocument.css
+++ /dev/null
@@ -1,17 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-@media not print {
- /* N.B.: Remember to update ImageDocument.css in the tree or reftests may fail! */
-
- body {
- color: #eee;
- background-image: url("chrome://global/skin/media/imagedoc-darknoise.png");
- }
-
- img.transparent {
- background: hsl(0,0%,90%) url("chrome://global/skin/media/imagedoc-lightnoise.png");
- color: #222;
- }
-}
diff --git a/toolkit/themes/mobile/global/media/TopLevelVideoDocument.css b/toolkit/themes/mobile/global/media/TopLevelVideoDocument.css
deleted file mode 100644
index 760cdcd53..000000000
--- a/toolkit/themes/mobile/global/media/TopLevelVideoDocument.css
+++ /dev/null
@@ -1,12 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this file,
- * You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-body {
- background-image: url("chrome://global/skin/media/imagedoc-darknoise.png");
- background-color: rgb(33,33,33); /* Average color of that ^ image. */
-}
-
-video {
- box-shadow: 0 0 15px #000;
-}
diff --git a/toolkit/themes/mobile/global/media/clicktoplay-bgtexture.png b/toolkit/themes/mobile/global/media/clicktoplay-bgtexture.png
deleted file mode 100644
index 0d3cacd11..000000000
--- a/toolkit/themes/mobile/global/media/clicktoplay-bgtexture.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/mobile/global/media/error.png b/toolkit/themes/mobile/global/media/error.png
deleted file mode 100644
index 58e37283a..000000000
--- a/toolkit/themes/mobile/global/media/error.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/mobile/global/media/imagedoc-darknoise.png b/toolkit/themes/mobile/global/media/imagedoc-darknoise.png
deleted file mode 100644
index 5c33e24d4..000000000
--- a/toolkit/themes/mobile/global/media/imagedoc-darknoise.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/mobile/global/media/imagedoc-lightnoise.png b/toolkit/themes/mobile/global/media/imagedoc-lightnoise.png
deleted file mode 100644
index 3467cf4d4..000000000
--- a/toolkit/themes/mobile/global/media/imagedoc-lightnoise.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/mobile/global/media/throbber.png b/toolkit/themes/mobile/global/media/throbber.png
deleted file mode 100644
index 8e49fe5b2..000000000
--- a/toolkit/themes/mobile/global/media/throbber.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/mobile/global/media/videoClickToPlayButton.svg b/toolkit/themes/mobile/global/media/videoClickToPlayButton.svg
deleted file mode 100644
index f7ca6b653..000000000
--- a/toolkit/themes/mobile/global/media/videoClickToPlayButton.svg
+++ /dev/null
@@ -1,30 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" preserveAspectRatio="xMinYMin meet" viewBox="0 0 64 64">
- <defs>
- <linearGradient id="whiteGradientStops">
- <stop style="stop-color:#fff;stop-opacity:.95" offset="0"/>
- <stop style="stop-color:#fff;stop-opacity:.75" offset=".45"/>
- <stop style="stop-color:#fff;stop-opacity:.72" offset=".55"/>
- <stop style="stop-color:#fff;stop-opacity:.65" offset="1"/>
- </linearGradient>
- <linearGradient x1="32" y1="0" x2="32" y2="62" id="whiteGradient" xlink:href="#whiteGradientStops" gradientUnits="userSpaceOnUse"/>
- <linearGradient id="arrowGradientStops">
- <stop style="stop-color:#333;stop-opacity:.5" offset="0"/>
- <stop style="stop-color:#666;stop-opacity:.5" offset="1"/>
- </linearGradient>
- <linearGradient x1="32" y1="16" x2="32" y2="48" id="arrowGradient" xlink:href="#arrowGradientStops" gradientUnits="userSpaceOnUse"/>
- <filter x="-0.15" y="-0.15" width="1.25" height="1.25" color-interpolation-filters="sRGB" id="dropShadow">
- <feDropShadow dx="0" dy="1" flood-opacity="0.5"/>
- </filter>
- <mask id="dropShadowMask">
- <path style="fill:#fff;" d="M47.285,30.991L23.75,17.24c-0.357-0.208-0.692-0.278-0.969-0.221 C22.32,17.115,22,17.555,22,18.252v27.499c0,1.112,0.797,1.568,1.75,1.011l23.535-13.748C48.238,32.458,48.238,31.547,47.285,30.991 z M0,0v64h64V0H0z M32,60C16.536,60,4,47.464,4,32S16.536,4,32,4s28,12.536,28,28S47.464,60,32,60z"/>
- </mask>
- </defs>
- <path mask="url(#dropShadowMask)" id="playButtonShadow" style="filter:url(#dropShadow);" d="M32,4C16.536,4,4,16.536,4,32s12.536,28,28,28s28-12.536,28-28S47.464,4,32,4z M47.285,33.014 L23.75,46.762C22.797,47.319,22,46.863,22,45.751v-27.5c0-0.697,0.32-1.137,0.781-1.232c0.277-0.058,0.612,0.012,0.969,0.221 l23.535,13.751C48.238,31.546,48.238,32.458,47.285,33.014z"/>
- <path id="playButtonArrow" style="fill:url(#arrowGradient);" d="M22.781,17.019C22.32,17.114,22,17.555,22,18.251v27.5c0,1.112,0.797,1.568,1.75,1.011 l23.535-13.748c0.953-0.556,0.953-1.467,0-2.023L23.75,17.24C23.393,17.031,23.058,16.961,22.781,17.019z"/>
- <path id="playButton" style="fill:url(#whiteGradient);" d="M32,4C16.536,4,4,16.536,4,32s12.536,28,28,28s28-12.536,28-28S47.464,4,32,4z M47.285,33.014 L23.75,46.762C22.797,47.319,22,46.863,22,45.751v-27.5c0-0.697,0.32-1.137,0.781-1.232c0.277-0.058,0.612,0.012,0.969,0.221 l23.535,13.751C48.238,31.546,48.238,32.458,47.285,33.014z"/>
- <path id="playButtonEdgeHighlights" style="fill:white;fill-opacity:.3;" d="M32,4C16.536,4,4,16.536,4,32s12.536,28,28,28s28-12.536,28-28S47.464,4,32,4z M32,59C17.112,59,5,46.888,5,32S17.112,5,32,5s27,12.112,27,27S46.888,59,32,59z M47.789,30.127l-23.534-13.75 C23.826,16.126,23.396,16,22.976,16c-0.135,0-0.27,0.014-0.398,0.041C21.62,16.238,21,17.106,21,18.251v27.5 C21,47.075,21.812,48,22.977,48c0.423,0,0.854-0.126,1.279-0.375L47.79,33.877c0.769-0.449,1.21-1.132,1.21-1.875 S48.559,30.576,47.789,30.127z M47.285,33.014L23.75,46.762C23.474,46.924,23.211,47,22.977,47C22.402,47,22,46.541,22,45.751v-27.5 c0-0.697,0.32-1.137,0.781-1.232L22.976,17c0.233,0,0.498,0.079,0.775,0.24l23.535,13.751 C48.238,31.546,48.238,32.458,47.285,33.014z"/>
- <path id="playButtonTopEdgeHighlights" style="fill:white;fill-opacity:.8;" d="M32,4C16.536,4,4,16.536,4,32c0,0.167,0.01,0.333,0.013,0.5 C4.28,17.268,16.704,5,32,5c15.296,0,27.72,12.268,27.987,27.5C59.99,32.333,60,32.167,60,32C60,16.536,47.464,4,32,4z M47.285,33.014L23.75,46.762C22.797,47.319,22,46.863,22,45.751v1c0,1.112,0.797,1.568,1.75,1.011l23.535-13.748 c0.697-0.406,0.879-1.003,0.556-1.512C47.723,32.688,47.541,32.864,47.285,33.014z"/>
-</svg>
diff --git a/toolkit/themes/mobile/jar.mn b/toolkit/themes/mobile/jar.mn
deleted file mode 100644
index 62f889349..000000000
--- a/toolkit/themes/mobile/jar.mn
+++ /dev/null
@@ -1,55 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-toolkit.jar:
-% skin global classic/1.0 %skin/classic/global/
-# These are the CSS files that must exist
- skin/classic/global/autocomplete.css (global/empty.css)
- skin/classic/global/button.css (global/empty.css)
- skin/classic/global/checkbox.css (global/empty.css)
- skin/classic/global/dialog.css (global/empty.css)
- skin/classic/global/dropmarker.css (global/empty.css)
- skin/classic/global/global.css (global/empty.css)
- skin/classic/global/groupbox.css (global/empty.css)
- skin/classic/global/listbox.css (global/empty.css)
- skin/classic/global/menu.css (global/empty.css)
- skin/classic/global/menulist.css (global/empty.css)
- skin/classic/global/numberbox.css (global/empty.css)
- skin/classic/global/popup.css (global/empty.css)
- skin/classic/global/preferences.css (global/empty.css)
- skin/classic/global/progressmeter.css (global/empty.css)
- skin/classic/global/radio.css (global/empty.css)
- skin/classic/global/resizer.css (global/empty.css)
- skin/classic/global/richlistbox.css (global/empty.css)
- skin/classic/global/scale.css (global/empty.css)
- skin/classic/global/scrollbox.css (global/empty.css)
- skin/classic/global/spinbuttons.css (global/empty.css)
- skin/classic/global/splitter.css (global/empty.css)
- skin/classic/global/tabbox.css (global/empty.css)
- skin/classic/global/textbox.css (global/empty.css)
- skin/classic/global/toolbar.css (global/empty.css)
- skin/classic/global/toolbarbutton.css (global/empty.css)
- skin/classic/global/tree.css (global/empty.css)
- skin/classic/global/wizard.css (global/empty.css)
- skin/classic/global/scrollbars.css (global/empty.css)
-
- skin/classic/global/media/clicktoplay-bgtexture.png (global/media/clicktoplay-bgtexture.png)
- skin/classic/global/media/error.png (global/media/error.png)
- skin/classic/global/media/throbber.png (global/media/throbber.png)
- skin/classic/global/media/videoClickToPlayButton.svg (global/media/videoClickToPlayButton.svg)
- skin/classic/global/media/TopLevelImageDocument.css (global/media/TopLevelImageDocument.css)
- skin/classic/global/media/TopLevelVideoDocument.css (global/media/TopLevelVideoDocument.css)
- skin/classic/global/media/imagedoc-lightnoise.png (global/media/imagedoc-lightnoise.png)
- skin/classic/global/media/imagedoc-darknoise.png (global/media/imagedoc-darknoise.png)
-
- skin/classic/global/icons/Error.png (global/icons/Error.png)
-
-% skin mozapps classic/1.0 %skin/classic/mozapps/
- skin/classic/mozapps/plugins/pluginProblem.css (mozapps/plugins/pluginProblem.css)
-
- skin/classic/mozapps/plugins/contentPluginActivate.png (mozapps/plugins/contentPluginActivate.png)
- skin/classic/mozapps/plugins/contentPluginBlocked.png (mozapps/plugins/contentPluginBlocked.png)
- skin/classic/mozapps/plugins/contentPluginClose.png (mozapps/plugins/contentPluginClose.png)
- skin/classic/mozapps/plugins/contentPluginCrashed.png (mozapps/plugins/contentPluginCrashed.png)
- skin/classic/mozapps/plugins/contentPluginStripe.png (mozapps/plugins/contentPluginStripe.png)
diff --git a/toolkit/themes/mobile/mozapps/plugins/contentPluginActivate.png b/toolkit/themes/mobile/mozapps/plugins/contentPluginActivate.png
deleted file mode 100644
index 31351dc3b..000000000
--- a/toolkit/themes/mobile/mozapps/plugins/contentPluginActivate.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/mobile/mozapps/plugins/contentPluginBlocked.png b/toolkit/themes/mobile/mozapps/plugins/contentPluginBlocked.png
deleted file mode 100644
index 1e092bf18..000000000
--- a/toolkit/themes/mobile/mozapps/plugins/contentPluginBlocked.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/mobile/mozapps/plugins/contentPluginClose.png b/toolkit/themes/mobile/mozapps/plugins/contentPluginClose.png
deleted file mode 100644
index 61eb55828..000000000
--- a/toolkit/themes/mobile/mozapps/plugins/contentPluginClose.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/mobile/mozapps/plugins/contentPluginCrashed.png b/toolkit/themes/mobile/mozapps/plugins/contentPluginCrashed.png
deleted file mode 100644
index 89d3e91a9..000000000
--- a/toolkit/themes/mobile/mozapps/plugins/contentPluginCrashed.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/mobile/mozapps/plugins/contentPluginDisabled.png b/toolkit/themes/mobile/mozapps/plugins/contentPluginDisabled.png
deleted file mode 100644
index b8b6a1020..000000000
--- a/toolkit/themes/mobile/mozapps/plugins/contentPluginDisabled.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/mobile/mozapps/plugins/contentPluginStripe.png b/toolkit/themes/mobile/mozapps/plugins/contentPluginStripe.png
deleted file mode 100644
index 6035ee121..000000000
--- a/toolkit/themes/mobile/mozapps/plugins/contentPluginStripe.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/mobile/mozapps/plugins/pluginProblem.css b/toolkit/themes/mobile/mozapps/plugins/pluginProblem.css
deleted file mode 100644
index e436b96cf..000000000
--- a/toolkit/themes/mobile/mozapps/plugins/pluginProblem.css
+++ /dev/null
@@ -1,196 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-@namespace html url(http://www.w3.org/1999/xhtml);
-
-/* These styles affect only the bound element, not other page content. */
-/* Keep any changes to these styles in sync with plugin-doorhanger.inc.css */
-.mainBox {
- font: message-box;
- font-size: 12px;
- text-align: center;
- display: table;
- width: 100%;
- height: 100%;
- background-color: rgb(72,72,72);
- color: white;
- -moz-user-select: none;
-}
-
-.hoverBox {
- display: table-cell;
- box-sizing: border-box;
- padding: 5px;
- vertical-align: middle;
- width: 100%;
- height: 100%;
-}
-:-moz-handler-vulnerable-updatable .hoverBox:active,
-:-moz-handler-vulnerable-no-update .hoverBox:active,
-:-moz-handler-clicktoplay .hoverBox:active {
- background-color: rgb(65, 65, 65);
-}
-
-:-moz-handler-clicktoplay .hoverBox:active .msgTapToPlay,
-:-moz-handler-clicktoplay .hoverBox:active .msgClickToPlay,
-:-moz-handler-vulnerable-updatable .hoverBox:active .msgTapToPlay,
-:-moz-handler-vulnerable-updatable .hoverBox:active .msgClickToPlay,
-:-moz-handler-vulnerable-no-update .hoverBox:active .msgTapToPlay,
-:-moz-handler-vulnerable-no-update .hoverBox:active .msgClickToPlay {
- color: red;
-}
-
-:-moz-handler-vulnerable-updatable .hoverBox,
-:-moz-handler-vulnerable-no-update .hoverBox,
-:-moz-handler-blocked .hoverBox,
-:-moz-handler-crashed .hoverBox {
- background-image: url(chrome://mozapps/skin/plugins/contentPluginStripe.png);
-}
-
-html|a {
- color: white;
-}
-
-.icon {
- width: 48px;
- height: 48px;
- background-position: center;
- background-repeat: no-repeat;
- border: none;
- background-color: transparent;
- -moz-user-focus: ignore;
- margin-bottom: 6px;
-}
-
-:-moz-handler-vulnerable-updatable .icon,
-:-moz-handler-vulnerable-no-update .icon {
- background-image: url(chrome://mozapps/skin/plugins/contentPluginBlocked.png);
- -moz-user-focus: normal;
-}
-:-moz-handler-blocked .icon {
- background-image: url(chrome://mozapps/skin/plugins/contentPluginBlocked.png);
-}
-:-moz-handler-clicktoplay .icon {
- background-image: url(chrome://mozapps/skin/plugins/contentPluginActivate.png);
- -moz-user-focus: normal;
-}
-:-moz-handler-crashed .icon {
- background-image: url(chrome://mozapps/skin/plugins/contentPluginCrashed.png);
-}
-
-.throbber {
- padding-left: 16px; /* width of the background image */
- background: url(chrome://global/skin/icons/loading.png) no-repeat;
- margin-left: 5px;
-}
-
-.msgTapToPlay,
-.msgClickToPlay {
- text-decoration: underline;
-}
-
-@media not all and (-moz-touch-enabled) {
- :-moz-handler-clicktoplay .msgTapToPlay {
- display: none;
- }
-}
-
-@media (-moz-touch-enabled) {
- :-moz-handler-clicktoplay .msgClickToPlay {
- display: none;
- }
-}
-
-.submitStatus div {
- min-height: 19px; /* height of biggest line (with throbber) */
-}
-
-.submitComment {
- width: 340px;
- height: 70px;
- padding: 5px;
- border: none;
- border-radius: 5px;
- resize: none;
- font-family: inherit;
- font-size: inherit;
-}
-
-.submitURLOptInBox {
- text-align: start;
-}
-
-.submitURLOptIn {
- margin-left: -1px;
-}
-
-.mainBox[chromedir="rtl"] .submitURLOptIn {
- margin-left: 0;
- margin-right: -1px;
-}
-
-.submitButtonBox {
- margin-top: 7px;
-}
-
-.submitButton {
- float: right;
-}
-
-.mainBox[chromedir="rtl"] .submitButton {
- float: left;
-}
-
-.helpIcon {
- display: inline-block;
- min-width: 16px;
- min-height: 16px;
- background: url(chrome://mozapps/skin/plugins/pluginHelp-16.png) no-repeat;
- cursor: pointer;
- float: left;
-}
-
-.mainBox[chromedir="rtl"] .helpIcon {
- float: right;
-}
-
-.closeIcon {
- display: block;
- width: 16px;
- height: 16px;
- margin-top: 4px;
- margin-inline-start: -20px;
- margin-inline-end: 4px;
- border: none;
- background-color: transparent;
- background-image: url("chrome://mozapps/skin/plugins/contentPluginClose.png");
- background-repeat: no-repeat;
-}
-
-.closeIcon:hover {
- background-position: -16px 0;
-}
-
-.closeIcon:hover:active {
- background-position: -32px 0;
-}
-
-.action-link {
- display: inline-block;
- border-radius: 10px;
- background-color: rgb(35, 35, 35);
- padding: 2px 8px;
- margin-top: 7px;
- text-decoration: none;
-}
-.action-link:active {
- background-color: rgb(20, 20, 20);
-}
-
-:-moz-handler-vulnerable-updatable .action-link {
- background-color: #a81b0c;
-}
-:-moz-handler-vulnerable-updatable .action-link:active {
- background-color: #801409;
-}
diff --git a/toolkit/themes/moz.build b/toolkit/themes/moz.build
index 4031f36b8..d06395953 100644
--- a/toolkit/themes/moz.build
+++ b/toolkit/themes/moz.build
@@ -14,7 +14,6 @@
# GNOME/Linux linux (toolkit/themes/linux)
# non-mac (toolkit/themes/shared/non-mac)
# faststripe windows + faststripe (no native theme components)
-# mobile native UIs that do not use XUL for UI
toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
if CONFIG['MOZ_PHOENIX']:
@@ -27,8 +26,6 @@ if toolkit == 'cocoa':
DIRS += ['osx']
elif toolkit in ('gtk2', 'gtk3'):
DIRS += ['linux']
-elif app == 'mobile/android':
- DIRS += ['mobile']
else:
DIRS += ['windows']
diff --git a/toolkit/themes/osx/mozapps/extensions/extensions.css b/toolkit/themes/osx/mozapps/extensions/extensions.css
index 9614967a4..474cb12d1 100644
--- a/toolkit/themes/osx/mozapps/extensions/extensions.css
+++ b/toolkit/themes/osx/mozapps/extensions/extensions.css
@@ -659,6 +659,13 @@
background-repeat: repeat-x;
}
+.addon-view[notification="warning"][native="false"] {
+ background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"),
+ linear-gradient(rgba(255, 128, 0, 0.04),
+ rgba(255, 128, 0, 0));
+ background-repeat: repeat-x;
+}
+
.addon-view[notification="error"] {
background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"),
linear-gradient(rgba(255, 0, 0, 0.04),
diff --git a/toolkit/themes/osx/mozapps/extensions/stripes-compatibility.png b/toolkit/themes/osx/mozapps/extensions/stripes-compatibility.png
new file mode 100644
index 000000000..dee75516b
--- /dev/null
+++ b/toolkit/themes/osx/mozapps/extensions/stripes-compatibility.png
Binary files differ
diff --git a/toolkit/themes/shared/mozapps.inc.mn b/toolkit/themes/shared/mozapps.inc.mn
index fadd203b0..db744c705 100644
--- a/toolkit/themes/shared/mozapps.inc.mn
+++ b/toolkit/themes/shared/mozapps.inc.mn
@@ -7,21 +7,10 @@
# be specified once. As a result, the source file paths are relative
# to the location of the actual manifest.
-#ifdef MOZ_WEBEXTENSIONS
- skin/classic/mozapps/extensions/extensionGeneric.svg (../../shared/webextensions/extensionGeneric.svg)
- skin/classic/mozapps/extensions/utilities.svg (../../shared/webextensions/utilities.svg)
- skin/classic/mozapps/extensions/navigation.png (../../shared/webextensions/navigation.png)
- skin/classic/mozapps/extensions/alerticon-warning.svg (../../shared/webextensions/alerticon-warning.svg)
- skin/classic/mozapps/extensions/alerticon-error.svg (../../shared/webextensions/alerticon-error.svg)
- skin/classic/mozapps/extensions/alerticon-info-positive.svg (../../shared/webextensions/alerticon-info-positive.svg)
- skin/classic/mozapps/extensions/alerticon-info-negative.svg (../../shared/webextensions/alerticon-info-negative.svg)
-#endif
skin/classic/mozapps/formautofill/requestAutocomplete.css (../../shared/formautofill/requestAutocomplete.css)
skin/classic/mozapps/plugins/pluginProblem.css (../../shared/plugins/pluginProblem.css)
skin/classic/mozapps/aboutNetworking.css (../../shared/aboutNetworking.css)
-#ifndef ANDROID
skin/classic/mozapps/aboutProfiles.css (../../shared/aboutProfiles.css)
-#endif
skin/classic/mozapps/aboutServiceWorkers.css (../../shared/aboutServiceWorkers.css)
skin/classic/mozapps/plugins/contentPluginActivate.png (../../shared/plugins/contentPluginActivate.png)
skin/classic/mozapps/plugins/contentPluginBlocked.png (../../shared/plugins/contentPluginBlocked.png)
diff --git a/toolkit/themes/shared/webextensions/alerticon-error.svg b/toolkit/themes/shared/webextensions/alerticon-error.svg
deleted file mode 100644
index cb883e16e..000000000
--- a/toolkit/themes/shared/webextensions/alerticon-error.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 18 18">
- <path fill="#e62117" d="M10.124,1.324l7.705,14.127c0.234,0.421,0.228,0.843-0.019,1.264c-0.114,0.193-0.271,0.347-0.467,0.461c-0.198,0.114-0.41,0.171-0.638,0.171H1.294c-0.228,0-0.44-0.057-0.636-0.171c-0.198-0.114-0.353-0.268-0.467-0.461c-0.247-0.421-0.254-0.843-0.02-1.264L7.876,1.324C7.99,1.117,8.147,0.953,8.348,0.833C8.548,0.712,8.766,0.652,9,0.652c0.234,0,0.451,0.06,0.652,0.181C9.853,0.953,10.009,1.117,10.124,1.324z M10.264,10.695l0.181-4.605c0-0.08-0.034-0.143-0.1-0.191c-0.087-0.073-0.168-0.11-0.241-0.11H7.896c-0.073,0-0.154,0.037-0.241,0.11c-0.067,0.048-0.1,0.118-0.1,0.211l0.17,4.586c0,0.067,0.034,0.122,0.1,0.165c0.067,0.044,0.147,0.065,0.241,0.065h1.856c0.094,0,0.172-0.021,0.236-0.065C10.222,10.818,10.258,10.762,10.264,10.695z M10.284,14.448v-1.907c0-0.094-0.031-0.172-0.095-0.236c-0.064-0.064-0.139-0.095-0.225-0.095H8.036c-0.087,0-0.162,0.031-0.225,0.095c-0.064,0.064-0.095,0.142-0.095,0.236v1.907c0,0.094,0.031,0.173,0.095,0.236c0.064,0.064,0.138,0.095,0.225,0.095h1.927c0.086,0,0.162-0.031,0.225-0.095C10.252,14.621,10.284,14.542,10.284,14.448z"/>
-</svg>
diff --git a/toolkit/themes/shared/webextensions/alerticon-info-negative.svg b/toolkit/themes/shared/webextensions/alerticon-info-negative.svg
deleted file mode 100644
index 733f8571a..000000000
--- a/toolkit/themes/shared/webextensions/alerticon-info-negative.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 18 18">
- <path fill="#828282" d="M10.124,1.324l7.705,14.127c0.234,0.421,0.228,0.843-0.019,1.264c-0.114,0.193-0.271,0.347-0.467,0.461c-0.198,0.114-0.41,0.171-0.638,0.171H1.294c-0.228,0-0.44-0.057-0.636-0.171c-0.198-0.114-0.353-0.268-0.467-0.461c-0.247-0.421-0.254-0.843-0.02-1.264L7.876,1.324C7.99,1.117,8.147,0.953,8.348,0.833C8.548,0.712,8.766,0.652,9,0.652c0.234,0,0.451,0.06,0.652,0.181C9.853,0.953,10.009,1.117,10.124,1.324z M10.264,10.695l0.181-4.605c0-0.08-0.034-0.143-0.1-0.191c-0.087-0.073-0.168-0.11-0.241-0.11H7.896c-0.073,0-0.154,0.037-0.241,0.11c-0.067,0.048-0.1,0.118-0.1,0.211l0.17,4.586c0,0.067,0.034,0.122,0.1,0.165c0.067,0.044,0.147,0.065,0.241,0.065h1.856c0.094,0,0.172-0.021,0.236-0.065C10.222,10.818,10.258,10.762,10.264,10.695z M10.284,14.448v-1.907c0-0.094-0.031-0.172-0.095-0.236c-0.064-0.064-0.139-0.095-0.225-0.095H8.036c-0.087,0-0.162,0.031-0.225,0.095c-0.064,0.064-0.095,0.142-0.095,0.236v1.907c0,0.094,0.031,0.173,0.095,0.236c0.064,0.064,0.138,0.095,0.225,0.095h1.927c0.086,0,0.162-0.031,0.225-0.095C10.252,14.621,10.284,14.542,10.284,14.448z"/>
-</svg>
diff --git a/toolkit/themes/shared/webextensions/alerticon-info-positive.svg b/toolkit/themes/shared/webextensions/alerticon-info-positive.svg
deleted file mode 100644
index 031190bce..000000000
--- a/toolkit/themes/shared/webextensions/alerticon-info-positive.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 18 18">
- <path fill="#62c44e" d="M18,4.796c0,0.31-0.109,0.573-0.325,0.79l-8.408,8.406l-1.579,1.58c-0.217,0.217-0.48,0.325-0.789,0.325c-0.31,0-0.573-0.108-0.79-0.325l-1.579-1.58L0.325,9.79C0.108,9.573,0,9.31,0,9s0.108-0.573,0.325-0.79l1.58-1.579c0.216-0.217,0.479-0.325,0.789-0.325s0.573,0.108,0.79,0.325l3.414,3.426l7.617-7.63c0.217-0.216,0.48-0.325,0.79-0.325c0.309,0,0.572,0.109,0.789,0.325l1.58,1.58C17.891,4.224,18,4.487,18,4.796z"/>
-</svg>
diff --git a/toolkit/themes/shared/webextensions/alerticon-warning.svg b/toolkit/themes/shared/webextensions/alerticon-warning.svg
deleted file mode 100644
index 2b403220e..000000000
--- a/toolkit/themes/shared/webextensions/alerticon-warning.svg
+++ /dev/null
@@ -1,6 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 18 18">
- <path fill="#f0cd2f" d="M10.124,1.324l7.705,14.127c0.234,0.421,0.228,0.843-0.019,1.264c-0.114,0.193-0.271,0.347-0.467,0.461c-0.198,0.114-0.41,0.171-0.638,0.171H1.294c-0.228,0-0.44-0.057-0.636-0.171c-0.198-0.114-0.353-0.268-0.467-0.461c-0.247-0.421-0.254-0.843-0.02-1.264L7.876,1.324C7.99,1.117,8.147,0.953,8.348,0.833C8.548,0.712,8.766,0.652,9,0.652c0.234,0,0.451,0.06,0.652,0.181C9.853,0.953,10.009,1.117,10.124,1.324z M10.264,10.695l0.181-4.605c0-0.08-0.034-0.143-0.1-0.191c-0.087-0.073-0.168-0.11-0.241-0.11H7.896c-0.073,0-0.154,0.037-0.241,0.11c-0.067,0.048-0.1,0.118-0.1,0.211l0.17,4.586c0,0.067,0.034,0.122,0.1,0.165c0.067,0.044,0.147,0.065,0.241,0.065h1.856c0.094,0,0.172-0.021,0.236-0.065C10.222,10.818,10.258,10.762,10.264,10.695z M10.284,14.448v-1.907c0-0.094-0.031-0.172-0.095-0.236c-0.064-0.064-0.139-0.095-0.225-0.095H8.036c-0.087,0-0.162,0.031-0.225,0.095c-0.064,0.064-0.095,0.142-0.095,0.236v1.907c0,0.094,0.031,0.173,0.095,0.236c0.064,0.064,0.138,0.095,0.225,0.095h1.927c0.086,0,0.162-0.031,0.225-0.095C10.252,14.621,10.284,14.542,10.284,14.448z"/>
-</svg>
diff --git a/toolkit/themes/shared/webextensions/extensionGeneric.svg b/toolkit/themes/shared/webextensions/extensionGeneric.svg
deleted file mode 100644
index 28c2f7ba3..000000000
--- a/toolkit/themes/shared/webextensions/extensionGeneric.svg
+++ /dev/null
@@ -1,12 +0,0 @@
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 64 64">
- <defs>
- <linearGradient id="gradient-linear-puzzle-piece" x1="0%" y1="0%" x2="0%" y2="100%">
- <stop offset="0%" stop-color="#66cc52" stop-opacity="1"/>
- <stop offset="100%" stop-color="#60bf4c" stop-opacity="1"/>
- </linearGradient>
- </defs>
- <path fill="url('#gradient-linear-puzzle-piece')" d="M42,62c2.2,0,4-1.8,4-4l0-14.2c0,0,0.4-3.7,2.8-3.7c2.4,0,2.2,3.9,6.7,3.9c2.3,0,6.2-1.2,6.2-8.2 c0-7-3.9-7.9-6.2-7.9c-4.5,0-4.3,3.7-6.7,3.7c-2.4,0-2.8-3.8-2.8-3.8V22c0-2.2-1.8-4-4-4H31.5c0,0-3.4-0.6-3.4-3 c0-2.4,3.8-2.6,3.8-7.1c0-2.3-1.3-5.9-8.3-5.9s-8,3.6-8,5.9c0,4.5,3.4,4.7,3.4,7.1c0,2.4-3.4,3-3.4,3H6c-2.2,0-4,1.8-4,4l0,7.8 c0,0-0.4,6,4.4,6c3.1,0,3.2-4.1,7.3-4.1c2,0,4,1.9,4,6c0,4.2-2,6.3-4,6.3c-4,0-4.2-4.1-7.3-4.1c-4.8,0-4.4,5.8-4.4,5.8L2,58 c0,2.2,1.8,4,4,4H19c0,0,6.3,0.4,6.3-4.4c0-3.1-4-3.6-4-7.7c0-2,2.2-4.5,6.4-4.5c4.2,0,6.6,2.5,6.6,4.5c0,4-3.9,4.6-3.9,7.7 c0,4.9,6.3,4.4,6.3,4.4H42z"/>
-</svg>
diff --git a/toolkit/themes/shared/webextensions/extensions.inc.css b/toolkit/themes/shared/webextensions/extensions.inc.css
deleted file mode 100644
index c4523bbe6..000000000
--- a/toolkit/themes/shared/webextensions/extensions.inc.css
+++ /dev/null
@@ -1,1082 +0,0 @@
-%if 0
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-%endif
-@import url("chrome://global/skin/in-content/common.css");
-
-.main-content {
- padding: 0;
-}
-
-#nav-header {
- min-height: 39px;
- background-color: #424f5a;
-}
-
-.view-pane > .list > scrollbox {
- padding-right: 48px;
- padding-left: 48px;
-}
-
-
-/*** global warnings ***/
-
-.global-warning-container {
- overflow-x: hidden;
-}
-
-.global-warning {
- -moz-box-align: center;
- padding: 0 8px;
- color: #c8a91e;
- font-weight: bold;
-}
-
-#addons-page[warning] .global-warning-container {
- background-image: linear-gradient(transparent, rgba(255, 255, 0, 0.1));
-}
-
-#detail-view .global-warning {
- padding: 4px 12px;
- border-bottom: 1px solid #c1c1c1;
-}
-
-@media (max-width: 600px) {
- .global-warning-text {
- display: none;
- }
-
- .global-warning .warning-icon {
- background-color: #fff;
- box-shadow: 0 0 2px 5px #fff;
- border-radius: 10px;
- }
-}
-
-/*** global informations ***/
-
-/* Plugins aren't yet disabled by safemode (bug 342333),
- so don't show that warning when viewing plugins. */
-#addons-page[warning="safemode"] .view-pane[type="plugin"] .global-warning-container,
-#addons-page[warning="safemode"] #detail-view[loading="true"] .global-warning-container {
- background-color: inherit;
- background-image: none;
-}
-
-
-/*** notification icons ***/
-
-.warning-icon,
-.error-icon,
-.pending-icon,
-.info-icon {
- width: 16px;
- height: 16px;
- margin: 3px 0;
-}
-
-.warning-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/alerticon-warning.svg");
-}
-
-.error-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/alerticon-error.svg");
-}
-
-.pending-icon,
-.info-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/alerticon-info-positive.svg");
-}
-
-.addon-view[pending="disable"] .pending-icon,
-.addon-view[pending="uninstall"] .pending-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/alerticon-info-negative.svg");
-}
-
-/*** view alert boxes ***/
-
-.alert-container {
- -moz-box-align: center;
- margin-right: 48px;
- margin-left: 48px;
-}
-
-.alert-spacer-before {
- -moz-box-flex: 1;
-}
-
-.alert-spacer-after {
- -moz-box-flex: 3;
-}
-
-.alert {
- -moz-box-align: center;
- padding: 10px;
- color: #333;
- border: 1px solid #c1c1c1;
- border-radius: 2px;
- background-color: #ebebeb;
-}
-
-.alert .alert-title {
- font-weight: bold;
- font-size: 200%;
- margin-bottom: 15px;
-}
-
-.alert button {
- margin: 1em 2em;
-}
-
-.loading {
- list-style-image: url("chrome://global/skin/icons/loading.png");
- padding-left: 20px;
- padding-right: 20px;
-}
-
-@media (min-resolution: 1.1dppx) {
- .loading > image {
- width: 16px;
- list-style-image: url("chrome://global/skin/icons/loading@2x.png");
- }
-}
-
-button.warning {
- list-style-image: url("chrome://mozapps/skin/extensions/alerticon-warning.svg");
-}
-
-
-/*** category selector ***/
-
-#categories {
- padding-top: 0;
-}
-
-.category[selected="true"]:hover {
- background-color:#1A2533;
-}
-
-.category[disabled] {
- overflow: hidden;
- height: 0;
- min-height: 0;
- opacity: 0;
- transition-property: min-height, opacity;
- transition-duration: 1s, 0.8s;
-}
-
-.category:not([disabled]) {
- min-height: 40px;
- transition-property: min-height, opacity;
- transition-duration: 1s, 0.8s;
-}
-
-/* Maximize the size of the viewport when the window is small */
-@media (max-width: 800px) {
- .category-name {
- display: none;
- }
-}
-
-.category-badge {
- background-color: #55D4FF;
- padding: 2px 8px;
- margin: 6px 0;
- margin-inline-start: 6px;
- border-radius: 100%;
- color: #FFF;
- font-weight: bold;
- text-align: center;
-}
-
-.category-badge[value="0"] {
- display: none;
-}
-
-#category-search > .category-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/category-search.png");
-}
-#category-discover > .category-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/category-discover.png");
-}
-#category-locale > .category-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/category-languages.png");
-}
-#category-extension > .category-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/category-extensions.svg");
-}
-#category-service > .category-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/category-service.png");
-}
-#category-theme > .category-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/category-themes.png");
-}
-#category-plugin > .category-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/category-plugins.png");
-}
-#category-dictionary > .category-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/category-dictionaries.png");
-}
-#category-experiment > .category-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/category-experiments.png");
-}
-#category-availableUpdates > .category-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/category-available.png");
-}
-#category-recentUpdates > .category-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/category-recent.png");
-}
-
-
-/*** header ***/
-
-#header {
- margin-top: 20px;
- margin-bottom: 20px;
- margin-right: 48px;
- margin-left: 48px;
-}
-
-@media (max-width: 600px) {
- #header-search {
- width: 12em;
- }
-}
-
-.view-header {
- margin: 0 48px;
- border-bottom: 1px solid #c1c1c1;
-}
-
-#header-utils-btn {
- height: 30px;
- line-height: 20px;
- border-color: #c1c1c1;
- background-color: #fbfbfb;
- padding-right: 10px;
- padding-left: 10px;
-}
-
-#header-utils-btn:not([disabled="true"]):active:hover,
-#header-utils-btn[open="true"] {
- background-color: #dadada;
-}
-
-.header-button {
- -moz-appearance: none;
- border: 1px solid;
- border-radius: 2px;
-}
-
-.header-button[disabled="true"] > .toolbarbutton-icon {
- opacity: 0.4;
-}
-
-.header-button:not([disabled="true"]):hover,
-#header-utils-btn:not([disabled="true"]):hover {
- background-color: #ebebeb;
- cursor: pointer;
-}
-
-.header-button > .toolbarbutton-text {
- display: none;
-}
-
-.nav-button {
- list-style-image: url(chrome://mozapps/skin/extensions/navigation.png);
- margin-top: 15px;
- margin-bottom: 15px;
- border-color: transparent;
-}
-
-.nav-button:not([disabled="true"]):hover {
- border-color: #ebebeb;
-}
-
-#back-btn:-moz-locale-dir(ltr),
-#forward-btn:-moz-locale-dir(rtl) {
- -moz-image-region: rect(0, 18px, 18px, 0);
-}
-
-#back-btn:-moz-locale-dir(rtl),
-#forward-btn:-moz-locale-dir(ltr) {
- -moz-image-region: rect(0, 36px, 18px, 18px);
-}
-
-
-/*** sorters ***/
-
-.sort-controls {
- -moz-appearance: none;
-}
-
-.sorter {
- height: 35px;
- border: none;
- border-radius: 0;
- background-color: transparent;
- color: #536680;
- margin: 0;
- min-width: 12px !important;
- -moz-box-direction: reverse;
-}
-
-.sorter .button-box {
- padding-top: 0;
- padding-bottom: 0;
-}
-
-.sorter[checkState="1"],
-.sorter[checkState="2"] {
- background-color: #ebebeb;
- box-shadow: 0 -4px 0 0 #ff9500 inset;
-}
-
-.sorter .button-icon {
- margin-inline-start: 6px;
-}
-
-
-/*** discover view ***/
-
-.discover-spacer-before,
-.discover-spacer-after {
- -moz-box-flex: 1;
-}
-
-#discover-error .alert {
- max-width: 45em;
- -moz-box-flex: 1;
-}
-
-.discover-logo {
- list-style-image: url("chrome://mozapps/skin/extensions/discover-logo.png");
- margin-inline-end: 15px;
-}
-
-.discover-title {
- font-weight: bold;
- font-size: 24px;
- font-family: MetaWebPro-Book, "Trebuchet MS", sans-serif;
- margin: 0 0 15px 0;
-}
-
-.discover-description {
- text-align: justify;
- margin: 0 0 15px 0;
-}
-
-.discover-footer {
- text-align: justify;
-}
-
-
-/*** list ***/
-
-.list {
- -moz-appearance: none;
- margin: 0;
- border-width: 0 !important;
- background-color: transparent;
-}
-
-.list > scrollbox > .scrollbox-innerbox {
- border: 1px dotted transparent;
-}
-
-.list:-moz-focusring > scrollbox > .scrollbox-innerbox {
- border-color: #0095dd;
-}
-
-.addon {
- color: #444;
- border-bottom: 1px solid #c1c1c1;
- padding: 5px;
- background-origin: border-box;
-}
-
-.addon:not(:only-child):last-child {
- border-bottom-width: 0;
-}
-
-.details {
- cursor: pointer;
- margin: 0;
- margin-inline-start: 10px;
-}
-
-.icon-container {
- width: 48px;
- height: 48px;
- margin: 3px 7px;
- -moz-box-align: center;
- -moz-box-pack: center;
-}
-
-.icon {
- list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.svg");
- max-width: 32px;
- max-height: 32px;
-}
-
-.content-inner-container {
- margin-inline-end: 5px;
-}
-
-.addon[active="false"] .icon {
- filter: grayscale(1);
-}
-
-.addon-view[type="theme"] .icon {
- list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png");
-}
-
-.addon-view[type="locale"] .icon {
- list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png");
-}
-
-.addon-view[type="plugin"] .icon {
- list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png");
-}
-
-.addon-view[type="dictionary"] .icon {
- list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.png");
-}
-
-.addon-view[type="experiment"] .icon {
- list-style-image: url("chrome://mozapps/skin/extensions/experimentGeneric.png");
-}
-
-.name-container {
- font-size: 1.3rem;
- font-weight: bold;
- -moz-box-align: end;
- -moz-box-flex: 1;
-}
-
-.creator {
- font-weight: bold;
-}
-
-.description-container {
- margin-inline-start: 6px;
- -moz-box-align: center;
- font-size: 1.25rem;
-}
-
-.description {
- margin: 0;
-}
-
-.warning,
-.pending,
-.error {
- margin-inline-start: 48px;
- font-weight: bold;
- -moz-box-align: center;
-}
-
-.content-container,
-.basicinfo-container {
- -moz-box-align: start;
-}
-
-.addon[status="installing"] > .content-container {
- -moz-box-align: stretch;
-}
-
-.update-info-container {
- -moz-box-align: center;
-}
-
-.update-available {
- -moz-box-align: end;
-}
-
-.install-status-container {
- -moz-box-pack: end;
- -moz-box-align: end;
-}
-
-.name-outer-container {
- -moz-box-pack: center;
-}
-
-.relnotes-toggle-container,
-.icon-outer-container {
- -moz-box-pack: start;
-}
-
-.status-container,
-.control-container {
- -moz-box-pack: end;
-}
-
-.addon-view .warning {
- color: #d8b826;
-}
-
-.addon-view .error {
- color: #e62117;
-}
-
-.addon-view .pending {
- color: #62c44e;
-}
-
-.addon-view[pending="disable"] .pending,
-.addon-view[pending="uninstall"] .pending {
- color: #898989;
-}
-
-.addon .relnotes-container {
- -moz-box-align: start;
- margin-inline-start: 6px;
- height: 0;
- overflow: hidden;
- opacity: 0;
- transition-property: height, opacity;
- transition-duration: 0.5s, 0.5s;
-}
-
-.addon[show-relnotes] .relnotes-container {
- opacity: 1;
- transition-property: height, opacity;
- transition-duration: 0.5s, 0.5s;
-}
-
-.addon .relnotes-header {
- font-weight: bold;
- margin: 10px 0;
-}
-
-.addon .relnotes-toggle {
- -moz-appearance: none;
- border: none;
- background: transparent;
- font-weight: bold;
- cursor: pointer;
-}
-
-.addon .relnotes-toggle > .button-box > .button-icon {
- padding-inline-start: 4px;
-}
-
-.addon-view[notification],
-.addon-view[pending] {
- --view-highlight-color: transparent;
- background-image: radial-gradient(at 50% 0%,
- var(--view-highlight-color) 0%,
- transparent 75%);
-}
-.addon-view[notification="warning"] {
- --view-highlight-color: #F9F5E5;
-}
-
-.addon-view[notification="error"] {
- --view-highlight-color: #FFE8E9;
-}
-
-.addon-view[pending="enable"],
-.addon-view[pending="upgrade"],
-.addon-view[pending="install"] {
- --view-highlight-color: #EFFAF2;
-}
-
-.addon-view[pending="disable"],
-.addon-view[pending="uninstall"] {
- --view-highlight-color: #F2F2F2;
-}
-
-.addon[selected] {
- background-color: #fafafa;
- color: #333;
- padding-inline-start: 1px; /* compensate the 4px border */
- border-inline-start: solid 4px #ff9500;
-}
-
-.addon[active="false"] > .content-container > .content-inner-container {
- color: #999;
-}
-
-.addon[active="false"][selected] > .content-container > .content-inner-container {
- color: #777;
-}
-
-
-/*** item - uninstalled ***/
-
-.addon[status="uninstalled"] {
- border: none;
-}
-
-.addon[status="uninstalled"] > .container {
- -moz-box-align: center;
- padding: 4px 20px;
- background-color: #FDFFA8;
- border-radius: 8px;
- font-size: 120%;
-}
-
-.addon[status="uninstalled"][selected] {
- background-color: transparent;
-}
-
-
-/*** search view ***/
-
-#search-filter {
- padding: 5px 20px;
- margin-right: 48px;
- margin-left: 48px;
- font-size: 120%;
- border-bottom: 1px solid #c1c1c1;
- overflow-x: hidden;
-}
-
-#search-filter-label {
- font-weight: bold;
- color: grey;
- margin-inline-end: 10px;
-}
-
-#search-allresults-link {
- margin-top: 1em;
- margin-bottom: 2em;
-}
-
-
-/*** detail view ***/
-
-#detail-view > .box-inherit {
- margin-right: 48px;
- margin-left: 48px;
-}
-
-#detail-view .loading {
- opacity: 0;
-}
-
-#detail-view[loading-extended] .loading {
- opacity: 1;
- transition-property: opacity;
- transition-duration: 1s;
-}
-
-.detail-view-container {
- padding-inline-end: 2em;
- padding-bottom: 2em;
- font-size: 1.25rem;
- color: #333;
-}
-
-#detail-notifications {
- margin-top: 1em;
- margin-bottom: 2em;
-}
-
-#detail-notifications .warning,
-#detail-notifications .pending,
-#detail-notifications .error {
- margin-inline-start: 0;
-}
-
-#detail-icon-container {
- width: 64px;
- margin-inline-end: 10px;
- margin-top: 6px;
-}
-
-#detail-icon {
- max-width: 64px;
- max-height: 64px;
-}
-
-#detail-summary {
- margin-bottom: 2em;
-}
-
-#detail-name-container {
- font-size: 2.5rem;
- font-weight: normal;
-}
-
-#detail-screenshot-box {
- margin-inline-end: 2em;
- background-image: linear-gradient(rgba(255,255,255,.5), transparent);
- background-color: white;
- box-shadow: 0 1px 2px #666;
- border-radius: 2px;
-}
-
-#detail-screenshot {
- max-width: 300px;
- max-height: 300px;
-}
-
-#detail-screenshot[loading] {
- background-image: url("chrome://global/skin/icons/loading.png");
- background-position: 50% 50%;
- background-repeat: no-repeat;
-}
-
-@media (min-resolution: 1.1dppx) {
- #detail-screenshot[loading] {
- background-image: url("chrome://global/skin/icons/loading@2x.png");
- background-size: 16px;
- }
-}
-
-#detail-screenshot[loading="error"] {
- background-image: url("chrome://global/skin/media/error.png");
-}
-
-#detail-desc-container {
- margin-bottom: 2em;
-}
-
-#detail-desc, #detail-fulldesc {
- margin-inline-start: 6px;
- /* This is necessary to fix layout issues with multi-line descriptions, see
- bug 592712*/
- outline: solid transparent;
- white-space: pre-wrap;
- min-width: 10em;
-}
-
-#detail-fulldesc {
- margin-top: 1em;
-}
-
-#detail-contributions {
- border-radius: 2px;
- border: 1px solid #D2DBE8;
- margin-bottom: 2em;
- padding: 1em;
- background-color: #F3F7FB;
-}
-
-#detail-contrib-description {
- font-style: italic;
- margin-bottom: 1em;
- color: #373D48;
-}
-
-#detail-contrib-suggested {
- color: grey;
- font-weight: bold;
-}
-
-#detail-contrib-btn {
- color: #FFF;
- text-shadow: none;
- border: 1px solid #0095dd;
- list-style-image: url("chrome://mozapps/skin/extensions/heart.png");
- background-color: #0095dd;
-}
-
-#detail-contrib-btn .button-icon {
- margin-inline-end: 5px;
-}
-
-#detail-contrib-btn:not(:active):hover {
- border-color: #008acb;
- background-color: #008acb;
-}
-
-#detail-contrib-btn:active:hover {
- background-color: #006b9d;
- border-color: #006b9d;
-}
-
-#detail-grid {
- margin-bottom: 2em;
-}
-
-#detail-grid > columns > column:first-child {
- min-width: 15em;
- max-width: 25em;
-}
-
-.detail-row[first-row="true"],
-.detail-row-complex[first-row="true"],
-setting[first-row="true"] {
- border-top: none;
-}
-
-.detail-row,
-.detail-row-complex,
-setting {
- border-top: 1px solid #c1c1c1;
- -moz-box-align: center;
- min-height: 35px;
- line-height: 20px;
- text-shadow: 0 1px 1px #fefffe;
-}
-
-#detail-controls {
- margin-bottom: 1em;
-}
-
-.inline-options-browser,
-setting[first-row="true"] {
- margin-top: 2em;
-}
-
-setting {
- -moz-box-align: start;
-}
-
-.preferences-alignment {
- min-height: 30px;
- -moz-box-align: center;
-}
-
-.preferences-description {
- font-size: 90.9%;
- color: graytext;
- margin-top: -2px;
- margin-inline-start: 2em;
- white-space: pre-wrap;
-}
-
-.preferences-description:empty {
- display: none;
-}
-
-setting[type="radio"] > radiogroup {
- -moz-box-orient: horizontal;
-}
-
-
-/*** creator ***/
-
-.creator > label {
- margin-inline-start: 0;
- margin-inline-end: 0;
-}
-
-.creator > .text-link {
- margin-top: 1px;
- margin-bottom: 1px;
-}
-
-
-/*** rating ***/
-
-.meta-rating {
- margin-inline-end: 0;
- padding-top: 2px;
-}
-
-
-/*** download progress ***/
-
-.download-progress {
- border: 1px solid #c1c1c1;
- border-radius: 2px;
- background-color: #fbfbfb;
- width: 200px;
- height: 30px;
- margin: 2px 4px;
-}
-
-.download-progress[mode="undetermined"] {
- border-color: #0095dd;
-}
-
-.download-progress .start-cap,
-.download-progress[complete] .end-cap,
-.download-progress[mode="undetermined"] .end-cap,
-.download-progress .progress .progress-bar {
- -moz-appearance: none;
- background-color: #0095dd;
-}
-
-.download-progress .progress .progress-bar {
- min-height: 28px;
-}
-
-.download-progress .progress {
- -moz-appearance: none;
- background-color: transparent;
- padding: 0;
- margin: 0;
- border: none;
-}
-
-.download-progress .start-cap,
-.download-progress .end-cap {
- width: 4px;
-}
-
-.download-progress .start-cap:-moz-locale-dir(ltr),
-.download-progress .end-cap:-moz-locale-dir(rtl) {
- border-radius: 1px 0 0 1px;
-}
-
-.download-progress .end-cap:-moz-locale-dir(ltr),
-.download-progress .start-cap:-moz-locale-dir(rtl) {
- border-radius: 0 1px 1px 0;
-}
-
-.download-progress .cancel {
- -moz-appearance: none;
- padding: 3px;
- min-width: 0;
- width: 20px;
- height: 20px;
- margin: 3px;
-}
-
-.download-progress .cancel .button-box {
- /* override in-content/common.css !important rule */
- padding: 0 !important;
- border: none;
-}
-
-.download-progress .cancel .button-text {
- display: none;
-}
-
-.download-progress .cancel .button-icon {
- margin: 0;
-}
-
-.download-progress .cancel {
- list-style-image: url('chrome://mozapps/skin/extensions/cancel.png');
-}
-
-.download-progress .status-container {
- -moz-box-align: center;
-}
-
-.download-progress .status {
- color: #333;
- text-shadow: #fff 0 0 2px;
-}
-
-
-/*** install status ***/
-
-.install-status {
- -moz-box-align: center;
-}
-
-
-/*** check for updates ***/
-
-#updates-container {
- -moz-box-align: center;
-}
-
-#updates-container .button-link {
- font-weight: bold;
-}
-
-#updates-installed,
-#updates-downloaded {
- color: #00BB00;
- font-weight: bold;
-}
-
-#update-selected {
- margin: 12px;
-}
-
-
-/*** buttons ***/
-
-.addon-control[disabled="true"]:not(.no-auto-hide) {
- display: none;
-}
-
-.no-auto-hide .addon-control {
- display: block !important;
-}
-
-button.button-link {
- -moz-appearance: none;
- background: transparent;
- border: none;
- box-shadow: none;
- color: #0095dd;
- cursor: pointer;
- min-width: 0;
- min-height: 20px;
- margin: 0 6px;
-}
-
-button.button-link:not(:-moz-focusring) > .button-box {
- border-width: 0;
- margin: 1px;
-}
-
-button.button-link:hover {
- background-color: transparent;
- color: #178ce5;
- text-decoration: underline;
-}
-
-/* Needed to override normal button style from inContent.css */
-button.button-link:not([disabled="true"]):active:hover {
- background-color: transparent;
- color: #ff9500;
- text-decoration: none;
-}
-
-
-/*** telemetry experiments ***/
-
-#detail-experiment-container {
- font-size: 80%;
- margin-bottom: 1em;
-}
-
-#detail-experiment-bullet-container,
-#detail-experiment-state,
-#detail-experiment-time,
-.experiment-bullet-container,
-.experiment-state,
-.experiment-time {
- vertical-align: middle;
- display: inline-block;
-}
-
-.addon .experiment-bullet,
-#detail-experiment-bullet {
- fill: rgb(158, 158, 158);
-}
-
-.addon[active="true"] .experiment-bullet,
-#detail-view[active="true"] #detail-experiment-bullet {
- fill: rgb(106, 201, 20);
-}
-
-/*** info UI for add-ons that have been disabled for being unsigned ***/
-
-#show-disabled-unsigned-extensions:not(:hover) {
- background-color: #fcf8ed;
-}
-
-#disabled-unsigned-addons-info {
- margin-bottom: 2em;
- margin-right: 48px;
- margin-left: 48px;
-}
-
-#disabled-unsigned-addons-heading {
- font-size: 1.4em;
- font-weight: bold;
- margin-bottom: .5em;
-}
-
-#signing-dev-info {
- font-style: italic;
-}
-
-#detail-findUpdates-btn[hidden] {
- display: -moz-box;
- visibility: hidden;
-}
diff --git a/toolkit/themes/shared/webextensions/navigation.png b/toolkit/themes/shared/webextensions/navigation.png
deleted file mode 100644
index 67ff3d9a7..000000000
--- a/toolkit/themes/shared/webextensions/navigation.png
+++ /dev/null
Binary files differ
diff --git a/toolkit/themes/shared/webextensions/newaddon.inc.css b/toolkit/themes/shared/webextensions/newaddon.inc.css
deleted file mode 100644
index 52352ccd2..000000000
--- a/toolkit/themes/shared/webextensions/newaddon.inc.css
+++ /dev/null
@@ -1,114 +0,0 @@
-%if 0
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-%endif
-@import url("chrome://global/skin/in-content/common.css");
-
-#addon-page {
- font-size: 1.1em;
-}
-
-#addon-scrollbox {
- overflow: auto;
- -moz-box-orient: vertical;
- -moz-box-flex: 1;
-}
-
-#spacer-start {
- -moz-box-flex: 1;
-}
-
-#spacer-end {
- -moz-box-flex: 3;
-}
-
-#addon-container {
- overflow: visible;
- max-width: 800px;
- margin: 20px;
- padding: 30px 90px;
-}
-
-#addon-info {
- -moz-box-align: start;
- margin: 25px 10px;
-}
-
-#icon {
- margin-top: 8px;
- margin-inline-end: 10px;
- max-width: 64px;
- max-height: 64px;
- list-style-image: url("chrome://mozapps/skin/extensions/extensionGeneric.svg");
-}
-
-.addon-info[type="theme"] #icon {
- list-style-image: url("chrome://mozapps/skin/extensions/themeGeneric.png");
-}
-
-.addon-info[type="locale"] #icon {
- list-style-image: url("chrome://mozapps/skin/extensions/localeGeneric.png");
-}
-
-.addon-info[type="plugin"] #icon {
- list-style-image: url("chrome://mozapps/skin/plugins/pluginGeneric.png");
-}
-
-.addon-info[type="dictionary"] #icon {
- list-style-image: url("chrome://mozapps/skin/extensions/dictionaryGeneric.png");
-}
-
-#name {
- font-size: 130%;
-}
-
-#author {
- color: GrayText;
-}
-
-#location {
- color: GrayText;
-}
-
-#warning {
- margin-bottom: 25px;
- -moz-box-align: start;
-}
-
-#warning-icon {
- list-style-image: url("chrome://mozapps/skin/extensions/alerticon-warning.svg");
- width: 16px;
- height: 16px;
- margin-top: 5px;
- margin-inline-end: 5px;
-}
-
-#allow {
- margin-inline-start: 84px;
- margin-bottom: 20px;
-}
-
-#buttonDeck {
- margin-top: 25px;
- -moz-box-align: stretch;
-}
-
-#continuePanel {
- -moz-box-pack: end;
- -moz-box-align: end;
-}
-
-#restartPanel {
- -moz-box-pack: end;
- -moz-box-align: stretch;
-}
-
-#restartPanelButtons {
- margin-top: 25px;
- -moz-box-pack: end;
-}
-
-#later {
- color: GrayText;
-}
diff --git a/toolkit/themes/shared/webextensions/utilities.svg b/toolkit/themes/shared/webextensions/utilities.svg
deleted file mode 100644
index 8bf24458c..000000000
--- a/toolkit/themes/shared/webextensions/utilities.svg
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="16" height="16" viewBox="0 0 16 16">
- <style>
- use:not(:target) {
- display: none;
- }
- use {
- fill: #424f5a;
- }
- use[id$="-native"] {
- fill: GrayText;
- }
- use[id$="-grayscale"] {
- fill: #4d4d4d;
- }
- use[id$="-inverted"] {
- fill: #ddd;
- }
- </style>
- <defs>
- <path id="utilities-shape" d="m11.5,13.9l-.6-1.5c.3-.2 .5-.4 .8-.6 .2-.2 .4-.5 .6-.7l1.5,.6c.3,.1 .6,0 .7-.3l.4-1c.1-.3 0-.6-.3-.7l-1.5-.6c.1-.6 .1-1.3 0-2l1.5-.6c.3-.1 .4-.4 .3-.7l-.4-1c-.1-.3-.4-.4-.7-.3l-1.5,.6c-.2-.3-.4-.5-.6-.8-.2-.1-.5-.3-.7-.5l.6-1.5c.1-.3 0-.6-.3-.7l-.9-.4c-.3-.1-.6,0-.7,.3l-.6,1.5c-.6-.1-1.3-.1-2,0l-.6-1.5c-.1-.3-.4-.4-.7-.3l-1,.4c-.2,.1-.3,.4-.2,.6l.6,1.5c-.3,.3-.5,.5-.8,.7-.2,.3-.4,.5-.6,.8l-1.5-.7c-.3-.1-.6,0-.7,.3l-.4,.9c-.1,.3 0,.6 .3,.7l1.5,.7c-.1,.6-.1,1.3 0,1.9l-1.5,.6c-.3,.1-.4,.4-.3,.7l.4,1c.1,.3 .4,.4 .7,.3l1.5-.6c.2,.3 .4,.5 .6,.8 .2,.2 .5,.4 .7,.6l-.6,1.5c-.1,.3 0,.6 .3,.7l1,.4c.3,.1 .6,0 .7-.3l.6-1.5c.6,.1 1.3,.1 2,0l.6,1.5c.1,.3 .4,.4 .7,.3l1-.4c.1-.1 .3-.4 .1-.7zm-5.1-4.2c-.9-.9-.9-2.4 0-3.3 .9-.9 2.4-.9 3.3,0 .9,.9 .9,2.4 0,3.3-.9,.9-2.4,.9-3.3,0z"/>
- </defs>
- <use id="utilities" xlink:href="#utilities-shape"/>
- <use id="utilities-native" xlink:href="#utilities-shape"/>
- <use id="utilities-grayscale" xlink:href="#utilities-shape"/>
- <use id="utilities-inverted" xlink:href="#utilities-shape"/>
-</svg>
diff --git a/toolkit/themes/windows/mozapps/extensions/extensions.css b/toolkit/themes/windows/mozapps/extensions/extensions.css
index f350f7ca6..96ea1b46c 100644
--- a/toolkit/themes/windows/mozapps/extensions/extensions.css
+++ b/toolkit/themes/windows/mozapps/extensions/extensions.css
@@ -648,6 +648,13 @@
background-repeat: repeat-x;
}
+.addon-view[notification="warning"][native="false"] {
+ background-image: url("chrome://mozapps/skin/extensions/stripes-compatibility.png"),
+ linear-gradient(rgba(255, 128, 0, 0.04),
+ rgba(255, 128, 0, 0));
+ background-repeat: repeat-x;
+}
+
.addon-view[notification="error"] {
background-image: url("chrome://mozapps/skin/extensions/stripes-error.png"),
linear-gradient(rgba(255, 0, 0, 0.04),
diff --git a/toolkit/themes/windows/mozapps/extensions/stripes-compatibility.png b/toolkit/themes/windows/mozapps/extensions/stripes-compatibility.png
new file mode 100644
index 000000000..dee75516b
--- /dev/null
+++ b/toolkit/themes/windows/mozapps/extensions/stripes-compatibility.png
Binary files differ
diff --git a/toolkit/themes/windows/mozapps/jar.mn b/toolkit/themes/windows/mozapps/jar.mn
index 9f7562995..5ca886051 100644
--- a/toolkit/themes/windows/mozapps/jar.mn
+++ b/toolkit/themes/windows/mozapps/jar.mn
@@ -39,6 +39,7 @@ toolkit.jar:
skin/classic/mozapps/extensions/heart.png (extensions/heart.png)
skin/classic/mozapps/extensions/navigation.png (extensions/navigation.png)
skin/classic/mozapps/extensions/stripes-warning.png (extensions/stripes-warning.png)
+ skin/classic/mozapps/extensions/stripes-compatibility.png (extensions/stripes-compatibility.png)
skin/classic/mozapps/extensions/stripes-error.png (extensions/stripes-error.png)
skin/classic/mozapps/extensions/stripes-info-positive.png (extensions/stripes-info-positive.png)
skin/classic/mozapps/extensions/stripes-info-negative.png (extensions/stripes-info-negative.png)
diff --git a/toolkit/toolkit.mozbuild b/toolkit/toolkit.mozbuild
index 6a745e51e..b5679ca50 100644
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -85,12 +85,6 @@ DIRS += [
'/xpfe/appshell'
]
-# This needs to be built after the gfx/ directory
-# to ensure all dependencies for skia (e.g. mozalloc, xpcom)
-# have been built
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- DIRS += ['/other-licenses/skia-npapi']
-
if CONFIG['MOZ_UNIVERSALCHARDET']:
DIRS += ['/extensions/universalchardet']
@@ -122,12 +116,13 @@ DIRS += [
if CONFIG['MOZ_PREF_EXTENSIONS']:
DIRS += ['/extensions/pref']
-DIRS += ['/devtools']
+if CONFIG['MOZ_DEVTOOLS_SERVER']:
+ DIRS += ['/devtools']
DIRS += [
'/services',
'/startupcache',
- '/js/ductwork/debugger',
+ '/js/ductwork',
'/other-licenses/snappy',
]
@@ -142,7 +137,7 @@ DIRS += [
if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
DIRS += ['/toolkit/system/gnome']
-if CONFIG['ENABLE_MARIONETTE'] or CONFIG['MOZ_WIDGET_TOOLKIT'] not in ('android'):
+if CONFIG['ENABLE_MARIONETTE'] or True:
DIRS += [
'/testing/firefox-ui',
'/testing/marionette',
diff --git a/toolkit/xre/moz.build b/toolkit/xre/moz.build
index 072bd9ff9..4ad9926a8 100644
--- a/toolkit/xre/moz.build
+++ b/toolkit/xre/moz.build
@@ -4,15 +4,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-if CONFIG['OS_ARCH'] == 'WINNT':
- TEST_DIRS += ['test/win']
-
-MOCHITEST_MANIFESTS += ['test/mochitest.ini']
-BROWSER_CHROME_MANIFESTS += ['test/browser.ini']
-
-XPIDL_SOURCES += [
- 'nsINativeAppSupport.idl',
-]
+XPIDL_SOURCES += ['nsINativeAppSupport.idl']
if CONFIG['OS_ARCH'] == 'WINNT':
XPIDL_SOURCES += [
@@ -27,9 +19,7 @@ if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']:
EXPORTS += ['EventTracer.h']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
- UNIFIED_SOURCES += [
- 'nsNativeAppSupportWin.cpp',
- ]
+ UNIFIED_SOURCES += ['nsNativeAppSupportWin.cpp']
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
UNIFIED_SOURCES += [
'MacApplicationDelegate.mm',
@@ -45,29 +35,16 @@ elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
'UIKitDirProvider.mm',
]
elif 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
- UNIFIED_SOURCES += [
- 'nsNativeAppSupportUnix.cpp',
- ]
+ UNIFIED_SOURCES += ['nsNativeAppSupportUnix.cpp']
else:
- UNIFIED_SOURCES += [
- 'nsNativeAppSupportDefault.cpp',
- ]
+ UNIFIED_SOURCES += ['nsNativeAppSupportDefault.cpp']
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gtk3':
- UNIFIED_SOURCES += [
- 'nsGDKErrorHandler.cpp',
- ]
+ UNIFIED_SOURCES += ['nsGDKErrorHandler.cpp']
if CONFIG['MOZ_X11']:
EXPORTS += ['nsX11ErrorHandler.h']
- UNIFIED_SOURCES += [
- 'nsX11ErrorHandler.cpp',
- ]
-
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- UNIFIED_SOURCES += [
- 'nsAndroidStartup.cpp',
- ]
+ UNIFIED_SOURCES += ['nsX11ErrorHandler.cpp']
UNIFIED_SOURCES += [
'CreateAppData.cpp',
@@ -97,10 +74,10 @@ if CONFIG['MOZ_INSTRUMENT_EVENT_LOOP']:
]
if CONFIG['MOZ_UPDATER']:
- if CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
- UNIFIED_SOURCES += [
- 'nsUpdateDriver.cpp',
- ]
+ DEFINES['MOZ_UPDATER'] = True
+ UNIFIED_SOURCES += [
+ 'nsUpdateDriver.cpp',
+ ]
include('/ipc/chromium/chromium-config.mozbuild')
@@ -109,21 +86,18 @@ FINAL_LIBRARY = 'xul'
if CONFIG['MOZ_GL_DEFAULT_PROVIDER'] == 'GLX':
DEFINES['USE_GLX_TEST'] = True
-for var in ('MOZ_APP_NAME', 'MOZ_APP_BASENAME', 'MOZ_APP_VERSION', 'OS_TARGET',
+for var in ('MOZ_APP_NAME',
+ 'MOZ_APP_BASENAME',
+ 'MOZ_APP_VERSION',
+ 'OS_TARGET',
'MOZ_WIDGET_TOOLKIT'):
DEFINES[var] = '"%s"' % CONFIG[var]
-if CONFIG['MOZ_UPDATER'] and CONFIG['MOZ_WIDGET_TOOLKIT'] != 'android':
- DEFINES['MOZ_UPDATER'] = True
-
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
DEFINES['WIN32_LEAN_AND_MEAN'] = True
DEFINES['UNICODE'] = True
DEFINES['_UNICODE'] = True
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- DEFINES['ANDROID_PACKAGE_NAME'] = '"%s"' % CONFIG['ANDROID_PACKAGE_NAME']
-
if CONFIG['TARGET_XPCOM_ABI']:
DEFINES['TARGET_OS_ABI'] = '"%s_%s"' % (CONFIG['OS_TARGET'],
CONFIG['TARGET_XPCOM_ABI'])
@@ -167,9 +141,7 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
CXXFLAGS += CONFIG['MOZ_PANGO_CFLAGS']
DEFINES['TOPOBJDIR'] = TOPOBJDIR
-FINAL_TARGET_PP_FILES += [
- 'platform.ini'
-]
+FINAL_TARGET_PP_FILES += ['platform.ini']
if CONFIG['GNU_CXX']:
CXXFLAGS += ['-Wno-error=shadow']
diff --git a/toolkit/xre/nsAndroidStartup.cpp b/toolkit/xre/nsAndroidStartup.cpp
deleted file mode 100644
index 68ad75c01..000000000
--- a/toolkit/xre/nsAndroidStartup.cpp
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <android/log.h>
-
-#include <jni.h>
-
-#include <stdlib.h>
-#include <string.h>
-#include <pthread.h>
-
-#include "mozilla/jni/Utils.h"
-#include "nsTArray.h"
-#include "nsString.h"
-#include "nsIFile.h"
-#include "nsAppRunner.h"
-#include "APKOpen.h"
-
-#define LOG(args...) __android_log_print(ANDROID_LOG_INFO, MOZ_APP_NAME, args)
-
-extern "C" NS_EXPORT void
-GeckoStart(JNIEnv* env, char* data, const nsXREAppData* appData)
-{
- mozilla::jni::SetGeckoThreadEnv(env);
-
- if (!data) {
- LOG("Failed to get arguments for GeckoStart\n");
- return;
- }
-
- nsTArray<char *> targs;
- char *arg = strtok(data, " ");
- while (arg) {
- targs.AppendElement(arg);
- arg = strtok(nullptr, " ");
- }
- targs.AppendElement(static_cast<char *>(nullptr));
-
- int result = XRE_main(targs.Length() - 1, targs.Elements(), appData, 0);
-
- if (result)
- LOG("XRE_main returned %d", result);
-}
diff --git a/toolkit/xre/nsAppRunner.cpp b/toolkit/xre/nsAppRunner.cpp
index b27e46697..55072c474 100644
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -23,7 +23,7 @@
#include "nsAppRunner.h"
#include "mozilla/AppData.h"
-#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
+#ifdef MOZ_UPDATER
#include "nsUpdateDriver.h"
#endif
#include "ProfileReset.h"
@@ -186,10 +186,6 @@
#include "base/command_line.h"
#include "GTestRunner.h"
-#ifdef MOZ_WIDGET_ANDROID
-#include "GeneratedJNIWrappers.h"
-#endif
-
extern uint32_t gRestartMode;
extern void InstallSignalHandlers(const char *ProgramName);
@@ -1517,9 +1513,6 @@ static nsresult LaunchChild(nsINativeAppSupport* aNative,
SaveToEnv("MOZ_LAUNCHED_CHILD=1");
-#if defined(MOZ_WIDGET_ANDROID)
- java::GeckoAppShell::ScheduleRestart();
-#else
#if defined(XP_MACOSX)
CommandLineServiceMac::SetupMacCommandLine(gRestartArgc, gRestartArgv, true);
LaunchChildMac(gRestartArgc, gRestartArgv);
@@ -1559,7 +1552,6 @@ static nsresult LaunchChild(nsINativeAppSupport* aNative,
#endif // XP_UNIX
#endif // WP_WIN
#endif // WP_MACOSX
-#endif // MOZ_WIDGET_ANDROID
return NS_ERROR_LAUNCHED_CHILD_PROCESS;
}
@@ -1653,10 +1645,7 @@ ProfileLockedDialog(nsIFile* aProfileDir, nsIFile* aProfileLocalDir,
if (aUnlocker) {
int32_t button;
-#ifdef MOZ_WIDGET_ANDROID
- java::GeckoAppShell::KillAnyZombies();
- button = 0;
-#else
+
const uint32_t flags =
(nsIPromptService::BUTTON_TITLE_IS_STRING *
nsIPromptService::BUTTON_POS_0) +
@@ -1668,7 +1657,6 @@ ProfileLockedDialog(nsIFile* aProfileDir, nsIFile* aProfileLocalDir,
killTitle, nullptr, nullptr, nullptr,
&checkState, &button);
NS_ENSURE_SUCCESS_LOG(rv, rv);
-#endif
if (button == 0) {
rv = aUnlocker->Unlock(nsIProfileUnlocker::FORCE_QUIT);
@@ -1682,15 +1670,8 @@ ProfileLockedDialog(nsIFile* aProfileDir, nsIFile* aProfileLocalDir,
return LaunchChild(aNative);
}
} else {
-#ifdef MOZ_WIDGET_ANDROID
- if (java::GeckoAppShell::UnlockProfile()) {
- return NS_LockProfilePath(aProfileDir, aProfileLocalDir,
- nullptr, aResult);
- }
-#else
rv = ps->Alert(nullptr, killTitle, killMessage);
NS_ENSURE_SUCCESS_LOG(rv, rv);
-#endif
}
return NS_ERROR_ABORT;
@@ -2800,19 +2781,26 @@ XREMain::XRE_mainInit(bool* aExitFlag)
#endif
SetupErrorHandling(gArgv[0]);
-
- // Set up environment for NSS DBM database
+ // Set up environment for NSS database choice
+#ifndef NSS_DISABLE_DBM
// Allow iteration counts in DBM mode
SaveToEnv("NSS_ALLOW_LEGACY_DBM_ITERATION_COUNT=1");
- // Set default Master Password rounds to a sane value for DBM which is slower
- // than SQL for PBKDF. The NSS hard-coded default of 10,000 is too much.
- // See also Bug 1606992 for perf issues.
+#endif
+
#ifdef DEBUG
+ // Reduce the number of rounds for debug builds for perf/test reasons.
SaveToEnv("NSS_MAX_MP_PBE_ITERATION_COUNT=15");
#else
+#ifdef MOZ_SECURITY_SQLSTORE
+ // We're using SQL; NSS's defaults for rounds are fine.
+#else
+ // Set default Master Password rounds to a sane value for DBM which is slower
+ // than SQL for PBKDF. The NSS hard-coded default of 10,000 is too much.
+ // See also Bug 1606992 for perf issues.
SaveToEnv("NSS_MAX_MP_PBE_ITERATION_COUNT=500");
#endif
+#endif
#ifdef CAIRO_HAS_DWRITE_FONT
{
@@ -3409,7 +3397,7 @@ XREMain::XRE_mainStartup(bool* aExitFlag)
}
#endif
-#if defined(MOZ_UPDATER) && !defined(MOZ_WIDGET_ANDROID)
+#ifdef MOZ_UPDATER
// Check for and process any available updates
nsCOMPtr<nsIFile> updRoot;
bool persistent;
@@ -4131,45 +4119,49 @@ XRE_InitCommandLine(int aArgc, char* aArgv[])
delete[] canonArgs;
#endif
- const char *path = nullptr;
- ArgResult ar = CheckArg("greomni", true, &path);
- if (ar == ARG_BAD) {
- PR_fprintf(PR_STDERR,
- "Error: argument --greomni requires a path argument or the "
- "--osint argument was specified with the --greomni argument "
- "which is invalid.\n");
- return NS_ERROR_FAILURE;
- }
+ if (PR_GetEnv("UXP_CUSTOM_OMNI")) {
+ // Process CLI parameters for specifying custom omnijars
+ const char *path = nullptr;
+ ArgResult ar = CheckArg("greomni", true, &path);
+ if (ar == ARG_BAD) {
+ PR_fprintf(PR_STDERR,
+ "Error: argument --greomni requires a path argument or the "
+ "--osint argument was specified with the --greomni argument "
+ "which is invalid.\n");
+ return NS_ERROR_FAILURE;
+ }
- if (!path)
- return rv;
+ if (!path)
+ return rv;
- nsCOMPtr<nsIFile> greOmni;
- rv = XRE_GetFileFromPath(path, getter_AddRefs(greOmni));
- if (NS_FAILED(rv)) {
- PR_fprintf(PR_STDERR, "Error: argument --greomni requires a valid path\n");
- return rv;
- }
+ nsCOMPtr<nsIFile> greOmni;
+ rv = XRE_GetFileFromPath(path, getter_AddRefs(greOmni));
+ if (NS_FAILED(rv)) {
+ PR_fprintf(PR_STDERR, "Error: argument --greomni requires a valid path\n");
+ return rv;
+ }
- ar = CheckArg("appomni", true, &path);
- if (ar == ARG_BAD) {
- PR_fprintf(PR_STDERR,
- "Error: argument --appomni requires a path argument or the "
- "--osint argument was specified with the --appomni argument "
- "which is invalid.\n");
- return NS_ERROR_FAILURE;
- }
+ ar = CheckArg("appomni", true, &path);
+ if (ar == ARG_BAD) {
+ PR_fprintf(PR_STDERR,
+ "Error: argument --appomni requires a path argument or the "
+ "--osint argument was specified with the --appomni argument "
+ "which is invalid.\n");
+ return NS_ERROR_FAILURE;
+ }
- nsCOMPtr<nsIFile> appOmni;
- if (path) {
- rv = XRE_GetFileFromPath(path, getter_AddRefs(appOmni));
- if (NS_FAILED(rv)) {
- PR_fprintf(PR_STDERR, "Error: argument --appomni requires a valid path\n");
- return rv;
- }
- }
+ nsCOMPtr<nsIFile> appOmni;
+ if (path) {
+ rv = XRE_GetFileFromPath(path, getter_AddRefs(appOmni));
+ if (NS_FAILED(rv)) {
+ PR_fprintf(PR_STDERR, "Error: argument --appomni requires a valid path\n");
+ return rv;
+ }
+ }
+
+ mozilla::Omnijar::Init(greOmni, appOmni);
+ } // UXP_CUSTOM_OMNI
- mozilla::Omnijar::Init(greOmni, appOmni);
return rv;
}
diff --git a/toolkit/xre/nsEmbedFunctions.cpp b/toolkit/xre/nsEmbedFunctions.cpp
index 52b443770..f0a8d9cab 100644
--- a/toolkit/xre/nsEmbedFunctions.cpp
+++ b/toolkit/xre/nsEmbedFunctions.cpp
@@ -246,17 +246,9 @@ XRE_InitChildProcess(int aArgc,
NS_ENSURE_ARG_POINTER(aArgv[0]);
MOZ_ASSERT(aChildData);
-#if !defined(MOZ_WIDGET_ANDROID)
// On non-Fennec Gecko, the GMPLoader code resides in plugin-container,
// and we must forward it through to the GMP code here.
GMPProcessChild::SetGMPLoader(aChildData->gmpLoader.get());
-#else
- // On Fennec, the GMPLoader's code resides inside XUL (because for the time
- // being GMPLoader relies upon NSPR, which we can't use in plugin-container
- // on Android), so we create it here inside XUL and pass it to the GMP code.
- UniquePtr<GMPLoader> loader = CreateGMPLoader(nullptr);
- GMPProcessChild::SetGMPLoader(loader.get());
-#endif
#if defined(XP_WIN)
// From the --attach-console support in nsNativeAppSupportWin.cpp, but
diff --git a/toolkit/xre/nsSigHandlers.cpp b/toolkit/xre/nsSigHandlers.cpp
index 660af4522..11648e45a 100644
--- a/toolkit/xre/nsSigHandlers.cpp
+++ b/toolkit/xre/nsSigHandlers.cpp
@@ -27,9 +27,7 @@
#include <unistd.h>
#include <stdlib.h> // atoi
#include <sys/prctl.h>
-#ifndef ANDROID // no Android impl
-# include <ucontext.h>
-#endif
+#include <ucontext.h>
#endif
#ifdef XP_SOLARIS
@@ -172,7 +170,7 @@ static void fpehandler(int signum, siginfo_t *si, void *context)
*mxcsr &= ~SSE_STATUS_FLAGS; /* clear all pending SSE exceptions */
#endif
#endif
-#if defined(LINUX) && !defined(ANDROID)
+#if defined(LINUX)
ucontext_t *uc = (ucontext_t *)context;
#if defined(__i386__)
diff --git a/toolkit/xre/nsUpdateDriver.cpp b/toolkit/xre/nsUpdateDriver.cpp
index be11fb158..499445885 100644
--- a/toolkit/xre/nsUpdateDriver.cpp
+++ b/toolkit/xre/nsUpdateDriver.cpp
@@ -333,7 +333,7 @@ CopyUpdaterIntoUpdateDir(nsIFile *greDir, nsIFile *appDir, nsIFile *updateDir,
return false;
CopyFileIntoUpdateDir(appDir, NS_LITERAL_CSTRING(UPDATER_INI), updateDir);
#endif
-#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(ANDROID)
+#if defined(XP_UNIX) && !defined(XP_MACOSX)
nsCOMPtr<nsIFile> iconDir;
appDir->Clone(getter_AddRefs(iconDir));
iconDir->AppendNative(NS_LITERAL_CSTRING("icons"));
diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
index 265652477..151eb34e5 100644
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -1340,10 +1340,6 @@ nsXREDirProvider::GetUserDataDirectoryHome(nsIFile** aFile, bool aLocal)
if (!homeDir || !*homeDir)
return NS_ERROR_FAILURE;
-#ifdef ANDROID /* We want (ProfD == ProfLD) on Android. */
- aLocal = false;
-#endif
-
if (aLocal) {
// If $XDG_CACHE_HOME is defined use it, otherwise use $HOME/.cache.
const char* cacheHome = getenv("XDG_CACHE_HOME");
@@ -1550,15 +1546,6 @@ nsXREDirProvider::AppendProfilePath(nsIFile* aFile,
}
NS_ENSURE_SUCCESS(rv, rv);
-#elif defined(ANDROID)
- // The directory used for storing profiles
- // The parent of this directory is set in GetUserDataDirectoryHome
- // XXX: handle gAppData->profile properly
- // XXXsmaug ...and the rest of the profile creation!
- MOZ_ASSERT(!aAppName,
- "Profile creation for external applications is not implemented!");
- rv = aFile->AppendNative(nsDependentCString("mozilla"));
- NS_ENSURE_SUCCESS(rv, rv);
#elif defined(XP_UNIX)
nsAutoCString folder;
// Make it hidden (by starting with "."), except when local (the
diff --git a/toolkit/xre/test/.eslintrc.js b/toolkit/xre/test/.eslintrc.js
deleted file mode 100644
index e3134a291..000000000
--- a/toolkit/xre/test/.eslintrc.js
+++ /dev/null
@@ -1,7 +0,0 @@
-"use strict";
-
-module.exports = {
- "extends": [
- "../../../testing/mochitest/mochitest.eslintrc.js"
- ]
-};
diff --git a/toolkit/xre/test/browser.ini b/toolkit/xre/test/browser.ini
deleted file mode 100644
index deadebc46..000000000
--- a/toolkit/xre/test/browser.ini
+++ /dev/null
@@ -1,4 +0,0 @@
-[DEFAULT]
-
-[browser_checkdllblockliststate.js]
-skip-if = os != "win"
diff --git a/toolkit/xre/test/browser_checkdllblockliststate.js b/toolkit/xre/test/browser_checkdllblockliststate.js
deleted file mode 100644
index 6b989c370..000000000
--- a/toolkit/xre/test/browser_checkdllblockliststate.js
+++ /dev/null
@@ -1,16 +0,0 @@
-// Any copyright is dedicated to the Public Domain.
-// http://creativecommons.org/publicdomain/zero/1.0/
-
-// Tests that the dll blocklist initializes correctly during test runs.
-add_task(function* test() {
- yield BrowserTestUtils.withNewTab({gBrowser, url: "about:blank" }, function* (browser) {
- ok(Components.classes["@mozilla.org/xre/app-info;1"]
- .getService(Ci.nsIXULRuntime)
- .windowsDLLBlocklistStatus,
- "Windows dll blocklist status should be true, indicating it is " +
- "running properly. A failure in this test is considered a " +
- "release blocker.");
- });
-});
-
-
diff --git a/toolkit/xre/test/mochitest.ini b/toolkit/xre/test/mochitest.ini
deleted file mode 100644
index ccbb08ed9..000000000
--- a/toolkit/xre/test/mochitest.ini
+++ /dev/null
@@ -1,3 +0,0 @@
-[DEFAULT]
-
-[test_fpuhandler.html]
diff --git a/toolkit/xre/test/test_fpuhandler.html b/toolkit/xre/test/test_fpuhandler.html
deleted file mode 100644
index afe70ee64..000000000
--- a/toolkit/xre/test/test_fpuhandler.html
+++ /dev/null
@@ -1,38 +0,0 @@
-<head>
- <title>Floating-point exception handler test</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
-
-<body onload="runTest()">
- <embed id="plugin1" type="application/x-test" width="400" height="400"></embed>
-
- <script class="testbody" type="application/javascript">
- SimpleTest.waitForExplicitFinish();
-
- function doDiv(x, y) {
- var z;
- z = x / y;
-
- for (i = 0 + x; i < 1000; ++i)
- z = y / x;
-
- z = x / y;
- return z;
- }
-
- function runTest()
- {
- ok(isNaN(doDiv(0.0, 0.0)), "Undefined division-by-zero doesn't crash");
-
- try {
- document.getElementById('plugin1').enableFPExceptions();
- }
- catch (e) {
- ok(true, "No special code to set the FPU bit in the testplugin.");
- SimpleTest.finish();
- return;
- }
-
- ok(isNaN(doDiv(0.0, 0.0)), "Undefined division-by-zero doesn't crash again.");
- SimpleTest.finish();
- }
- </script>
diff --git a/toolkit/xre/test/win/Makefile.in b/toolkit/xre/test/win/Makefile.in
deleted file mode 100644
index 331a8a4fd..000000000
--- a/toolkit/xre/test/win/Makefile.in
+++ /dev/null
@@ -1,14 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-MOZ_WINCONSOLE = 1
-
-include $(topsrcdir)/config/rules.mk
-
-libs:: TestXREMakeCommandLineWin.ini
- $(INSTALL) $^ $(FINAL_TARGET)/
-
-check::
- @echo 'Running TestXREMakeCommandLineWin tests'
- @$(RUN_TEST_PROGRAM) $(FINAL_TARGET)/TestXREMakeCommandLineWin.exe
diff --git a/toolkit/xre/test/win/TestDllInterceptor.cpp b/toolkit/xre/test/win/TestDllInterceptor.cpp
deleted file mode 100644
index 57d68ea77..000000000
--- a/toolkit/xre/test/win/TestDllInterceptor.cpp
+++ /dev/null
@@ -1,232 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <shlobj.h>
-#include <stdio.h>
-
-#include "mozilla/WindowsVersion.h"
-#include "nsWindowsDllInterceptor.h"
-#include "nsWindowsHelpers.h"
-
-using namespace mozilla;
-
-struct payload {
- UINT64 a;
- UINT64 b;
- UINT64 c;
-
- bool operator==(const payload &other) const {
- return (a == other.a &&
- b == other.b &&
- c == other.c);
- }
-};
-
-extern "C" __declspec(dllexport) __declspec(noinline) payload rotatePayload(payload p) {
- UINT64 tmp = p.a;
- p.a = p.b;
- p.b = p.c;
- p.c = tmp;
- return p;
-}
-
-static bool patched_func_called = false;
-
-static payload (*orig_rotatePayload)(payload);
-
-static payload
-patched_rotatePayload(payload p)
-{
- patched_func_called = true;
- return orig_rotatePayload(p);
-}
-
-bool TestHook(const char *dll, const char *func)
-{
- void *orig_func;
- bool successful = false;
- {
- WindowsDllInterceptor TestIntercept;
- TestIntercept.Init(dll);
- successful = TestIntercept.AddHook(func, 0, &orig_func);
- }
-
- if (successful) {
- printf("TEST-PASS | WindowsDllInterceptor | Could hook %s from %s\n", func, dll);
- return true;
- } else {
- printf("TEST-UNEXPECTED-FAIL | WindowsDllInterceptor | Failed to hook %s from %s\n", func, dll);
- return false;
- }
-}
-
-bool TestDetour(const char *dll, const char *func)
-{
- void *orig_func;
- bool successful = false;
- {
- WindowsDllInterceptor TestIntercept;
- TestIntercept.Init(dll);
- successful = TestIntercept.AddDetour(func, 0, &orig_func);
- }
-
- if (successful) {
- printf("TEST-PASS | WindowsDllInterceptor | Could detour %s from %s\n", func, dll);
- return true;
- } else {
- printf("TEST-UNEXPECTED-FAIL | WindowsDllInterceptor | Failed to detour %s from %s\n", func, dll);
- return false;
- }
-}
-
-bool MaybeTestHook(const bool cond, const char* dll, const char* func)
-{
- if (!cond) {
- return true;
- }
-
- return TestHook(dll, func);
-}
-
-bool ShouldTestTipTsf()
-{
-#if defined(_M_X64)
- return false;
-#else
- if (!IsWin8OrLater()) {
- return false;
- }
-
- nsModuleHandle shell32(LoadLibraryW(L"shell32.dll"));
- if (!shell32) {
- return true;
- }
-
- auto pSHGetKnownFolderPath = reinterpret_cast<decltype(&SHGetKnownFolderPath)>(GetProcAddress(shell32, "SHGetKnownFolderPath"));
- if (!pSHGetKnownFolderPath) {
- return true;
- }
-
- PWSTR commonFilesPath = nullptr;
- if (FAILED(pSHGetKnownFolderPath(FOLDERID_ProgramFilesCommon, 0, nullptr,
- &commonFilesPath))) {
- return true;
- }
-
- wchar_t fullPath[MAX_PATH + 1] = {};
- wcscpy(fullPath, commonFilesPath);
- wcscat(fullPath, L"\\Microsoft Shared\\Ink\\tiptsf.dll");
- CoTaskMemFree(commonFilesPath);
-
- if (!LoadLibraryW(fullPath)) {
- return false;
- }
-
- // Leak the module so that it's loaded for the interceptor test
- return true;
-#endif
-}
-
-int main()
-{
- payload initial = { 0x12345678, 0xfc4e9d31, 0x87654321 };
- payload p0, p1;
- ZeroMemory(&p0, sizeof(p0));
- ZeroMemory(&p1, sizeof(p1));
-
- p0 = rotatePayload(initial);
-
- {
- WindowsDllInterceptor ExeIntercept;
- ExeIntercept.Init("TestDllInterceptor.exe");
- if (ExeIntercept.AddHook("rotatePayload", reinterpret_cast<intptr_t>(patched_rotatePayload), (void**) &orig_rotatePayload)) {
- printf("TEST-PASS | WindowsDllInterceptor | Hook added\n");
- } else {
- printf("TEST-UNEXPECTED-FAIL | WindowsDllInterceptor | Failed to add hook\n");
- return 1;
- }
-
- p1 = rotatePayload(initial);
-
- if (patched_func_called) {
- printf("TEST-PASS | WindowsDllInterceptor | Hook called\n");
- } else {
- printf("TEST-UNEXPECTED-FAIL | WindowsDllInterceptor | Hook was not called\n");
- return 1;
- }
-
- if (p0 == p1) {
- printf("TEST-PASS | WindowsDllInterceptor | Hook works properly\n");
- } else {
- printf("TEST-UNEXPECTED-FAIL | WindowsDllInterceptor | Hook didn't return the right information\n");
- return 1;
- }
- }
-
- patched_func_called = false;
- ZeroMemory(&p1, sizeof(p1));
-
- p1 = rotatePayload(initial);
-
- if (!patched_func_called) {
- printf("TEST-PASS | WindowsDllInterceptor | Hook was not called after unregistration\n");
- } else {
- printf("TEST-UNEXPECTED-FAIL | WindowsDllInterceptor | Hook was still called after unregistration\n");
- return 1;
- }
-
- if (p0 == p1) {
- printf("TEST-PASS | WindowsDllInterceptor | Original function worked properly\n");
- } else {
- printf("TEST-UNEXPECTED-FAIL | WindowsDllInterceptor | Original function didn't return the right information\n");
- return 1;
- }
-
- if (TestHook("user32.dll", "GetWindowInfo") &&
-#ifdef _WIN64
- TestHook("user32.dll", "SetWindowLongPtrA") &&
- TestHook("user32.dll", "SetWindowLongPtrW") &&
-#else
- TestHook("user32.dll", "SetWindowLongA") &&
- TestHook("user32.dll", "SetWindowLongW") &&
-#endif
- TestHook("user32.dll", "TrackPopupMenu") &&
-#ifdef _M_IX86
- // We keep this test to hook complex code on x86. (Bug 850957)
- TestHook("ntdll.dll", "NtFlushBuffersFile") &&
-#endif
- TestHook("ntdll.dll", "NtCreateFile") &&
- TestHook("ntdll.dll", "NtReadFile") &&
- TestHook("ntdll.dll", "NtReadFileScatter") &&
- TestHook("ntdll.dll", "NtWriteFile") &&
- TestHook("ntdll.dll", "NtWriteFileGather") &&
- TestHook("ntdll.dll", "NtQueryFullAttributesFile") &&
- // Bug 733892: toolkit/crashreporter/nsExceptionHandler.cpp
- TestHook("kernel32.dll", "SetUnhandledExceptionFilter") &&
-#ifdef _M_IX86
- // Bug 670967: xpcom/base/AvailableMemoryTracker.cpp
- TestHook("kernel32.dll", "VirtualAlloc") &&
- TestHook("kernel32.dll", "MapViewOfFile") &&
- TestHook("gdi32.dll", "CreateDIBSection") &&
- TestHook("kernel32.dll", "CreateFileW") &&
-#endif
- TestDetour("user32.dll", "CreateWindowExW") &&
- TestHook("user32.dll", "InSendMessageEx") &&
- TestHook("imm32.dll", "ImmGetContext") &&
- TestHook("imm32.dll", "ImmGetCompositionStringW") &&
- TestHook("imm32.dll", "ImmSetCandidateWindow") &&
-#ifdef _M_X64
- TestHook("user32.dll", "GetKeyState") &&
-#endif
- MaybeTestHook(ShouldTestTipTsf(), "tiptsf.dll", "ProcessCaretEvents") &&
-#ifdef _M_IX86
- TestHook("user32.dll", "SendMessageTimeoutW") &&
-#endif
- TestDetour("ntdll.dll", "LdrLoadDll")) {
- printf("TEST-PASS | WindowsDllInterceptor | all checks passed\n");
- return 0;
- }
-
- return 1;
-}
diff --git a/toolkit/xre/test/win/TestXREMakeCommandLineWin.cpp b/toolkit/xre/test/win/TestXREMakeCommandLineWin.cpp
deleted file mode 100644
index 00d786aa2..000000000
--- a/toolkit/xre/test/win/TestXREMakeCommandLineWin.cpp
+++ /dev/null
@@ -1,265 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <windows.h>
-// Support for _setmode
-#include <fcntl.h>
-#include <io.h>
-
-#include "nsWindowsRestart.cpp"
-
-// CommandLineToArgvW may return different values for argv[0] since it contains
-// the path to the binary that was executed so we prepend an argument that is
-// quoted with a space to prevent argv[1] being appended to argv[0].
-#define DUMMY_ARG1 L"\"arg 1\" "
-
-#ifndef MAXPATHLEN
-# ifdef PATH_MAX
-# define MAXPATHLEN PATH_MAX
-# elif defined(MAX_PATH)
-# define MAXPATHLEN MAX_PATH
-# elif defined(_MAX_PATH)
-# define MAXPATHLEN _MAX_PATH
-# elif defined(CCHMAXPATH)
-# define MAXPATHLEN CCHMAXPATH
-# else
-# define MAXPATHLEN 1024
-# endif
-#endif
-
-#define TEST_NAME L"XRE MakeCommandLine"
-#define MAX_TESTS 100
-
-// Verbose output can be enabled by defining VERBOSE 1
-#define VERBOSE 0
-
-// Compares compareCmdLine with the output of MakeCommandLine. This is
-// accomplished by converting inCmdLine to an argument list with
-// CommandLineToArgvW and converting it back to a command line with
-// MakeCommandLine.
-static int
-verifyCmdLineCreation(wchar_t *inCmdLine,
- wchar_t *compareCmdLine,
- bool passes, int testNum)
-{
- int rv = 0;
- int i;
- int inArgc;
- int outArgc;
- bool isEqual;
-
- // When debugging with command lines containing Unicode characters greater
- // than 255 you can set the mode for stdout to Unicode so the console will
- // receive the correct characters though it won't display them properly unless
- // the console's font has been set to one that can display the characters. You
- // can also redirect the console output to a file that has been saved as Unicode
- // to view the characters.
-// _setmode(_fileno(stdout), _O_WTEXT);
-
- // Prepend an additional argument to the command line. CommandLineToArgvW
- // handles argv[0] differently than other arguments since argv[0] is the path
- // to the binary being executed and MakeCommandLine only handles argv[1] and
- // larger.
- wchar_t *inCmdLineNew = (wchar_t *) malloc((wcslen(DUMMY_ARG1) + wcslen(inCmdLine) + 1) * sizeof(wchar_t));
- wcscpy(inCmdLineNew, DUMMY_ARG1);
- wcscat(inCmdLineNew, inCmdLine);
- LPWSTR *inArgv = CommandLineToArgvW(inCmdLineNew, &inArgc);
-
- wchar_t *outCmdLine = MakeCommandLine(inArgc - 1, inArgv + 1);
- wchar_t *outCmdLineNew = (wchar_t *) malloc((wcslen(DUMMY_ARG1) + wcslen(outCmdLine) + 1) * sizeof(wchar_t));
- wcscpy(outCmdLineNew, DUMMY_ARG1);
- wcscat(outCmdLineNew, outCmdLine);
- LPWSTR *outArgv = CommandLineToArgvW(outCmdLineNew, &outArgc);
-
- if (VERBOSE) {
- wprintf(L"\n");
- wprintf(L"Verbose Output\n");
- wprintf(L"--------------\n");
- wprintf(L"Input command line : >%s<\n", inCmdLine);
- wprintf(L"MakeComandLine output: >%s<\n", outCmdLine);
- wprintf(L"Expected command line: >%s<\n", compareCmdLine);
-
- wprintf(L"input argc : %d\n", inArgc - 1);
- wprintf(L"output argc: %d\n", outArgc - 1);
-
- for (i = 1; i < inArgc; ++i) {
- wprintf(L"input argv[%d] : >%s<\n", i - 1, inArgv[i]);
- }
-
- for (i = 1; i < outArgc; ++i) {
- wprintf(L"output argv[%d]: >%s<\n", i - 1, outArgv[i]);
- }
- wprintf(L"\n");
- }
-
- isEqual = (inArgc == outArgc);
- if (!isEqual) {
- wprintf(L"TEST-%s-FAIL | %s | ARGC Comparison (check %2d)\n",
- passes ? L"UNEXPECTED" : L"KNOWN", TEST_NAME, testNum);
- if (passes) {
- rv = 1;
- }
- LocalFree(inArgv);
- LocalFree(outArgv);
- free(inCmdLineNew);
- free(outCmdLineNew);
- free(outCmdLine);
- return rv;
- }
-
- for (i = 1; i < inArgc; ++i) {
- isEqual = (wcscmp(inArgv[i], outArgv[i]) == 0);
- if (!isEqual) {
- wprintf(L"TEST-%s-FAIL | %s | ARGV Comparison (check %2d)\n",
- passes ? L"UNEXPECTED" : L"KNOWN", TEST_NAME, testNum);
- if (passes) {
- rv = 1;
- }
- LocalFree(inArgv);
- LocalFree(outArgv);
- free(inCmdLineNew);
- free(outCmdLineNew);
- free(outCmdLine);
- return rv;
- }
- }
-
- isEqual = (wcscmp(outCmdLine, compareCmdLine) == 0);
- if (!isEqual) {
- wprintf(L"TEST-%s-FAIL | %s | Command Line Comparison (check %2d)\n",
- passes ? L"UNEXPECTED" : L"KNOWN", TEST_NAME, testNum);
- if (passes) {
- rv = 1;
- }
- LocalFree(inArgv);
- LocalFree(outArgv);
- free(inCmdLineNew);
- free(outCmdLineNew);
- free(outCmdLine);
- return rv;
- }
-
- if (rv == 0) {
- if (passes) {
- wprintf(L"TEST-PASS | %s | check %2d\n", TEST_NAME, testNum);
- } else {
- wprintf(L"TEST-UNEXPECTED-PASS | %s | check %2d\n", TEST_NAME, testNum);
- rv = 1;
- }
- }
-
- LocalFree(inArgv);
- LocalFree(outArgv);
- free(inCmdLineNew);
- free(outCmdLineNew);
- free(outCmdLine);
- return rv;
-}
-
-int wmain(int argc, wchar_t *argv[])
-{
- int i;
- int rv = 0;
-
- if (argc > 1 && (_wcsicmp(argv[1], L"-check-one") != 0 || argc != 3)) {
- fwprintf(stderr, L"Displays and validates output from MakeCommandLine.\n\n");
- fwprintf(stderr, L"Usage: %s -check-one <test number>\n\n", argv[0]);
- fwprintf(stderr, L" <test number>\tSpecifies the test number to run from the\n");
- fwprintf(stderr, L"\t\tTestXREMakeCommandLineWin.ini file.\n");
- return 255;
- }
-
- wchar_t inifile[MAXPATHLEN];
- if (!::GetModuleFileNameW(0, inifile, MAXPATHLEN)) {
- wprintf(L"TEST-UNEXPECTED-FAIL | %s | GetModuleFileNameW\n", TEST_NAME);
- return 2;
- }
-
- WCHAR *slash = wcsrchr(inifile, '\\');
- if (!slash) {
- wprintf(L"TEST-UNEXPECTED-FAIL | %s | wcsrchr\n", TEST_NAME);
- return 3;
- }
-
- wcscpy(slash + 1, L"TestXREMakeCommandLineWin.ini\0");
-
- for (i = 0; i < MAX_TESTS; ++i) {
- wchar_t sInputVal[MAXPATHLEN];
- wchar_t sOutputVal[MAXPATHLEN];
- wchar_t sPassesVal[MAXPATHLEN];
- wchar_t sInputKey[MAXPATHLEN];
- wchar_t sOutputKey[MAXPATHLEN];
- wchar_t sPassesKey[MAXPATHLEN];
-
- if (argc > 2 && _wcsicmp(argv[1], L"-check-one") == 0 && argc == 3) {
- i = _wtoi(argv[2]);
- }
-
- _snwprintf(sInputKey, MAXPATHLEN, L"input_%d", i);
- _snwprintf(sOutputKey, MAXPATHLEN, L"output_%d", i);
- _snwprintf(sPassesKey, MAXPATHLEN, L"passes_%d", i);
-
- if (!GetPrivateProfileStringW(L"MakeCommandLineTests", sInputKey, nullptr,
- sInputVal, MAXPATHLEN, inifile)) {
- if (i == 0 || (argc > 2 && _wcsicmp(argv[1], L"-check-one") == 0)) {
- wprintf(L"TEST-UNEXPECTED-FAIL | %s | see following explanation:\n", TEST_NAME);
- wprintf(L"ERROR: Either the TestXREMakeCommandLineWin.ini file doesn't exist\n");
- if (argc > 1 && _wcsicmp(argv[1], L"-check-one") == 0 && argc == 3) {
- wprintf(L"ERROR: or the test is not defined in the MakeCommandLineTests section.\n");
- } else {
- wprintf(L"ERROR: or it has no tests defined in the MakeCommandLineTests section.\n");
- }
- wprintf(L"ERROR: File: %s\n", inifile);
- return 4;
- }
- break;
- }
-
- GetPrivateProfileStringW(L"MakeCommandLineTests", sOutputKey, nullptr,
- sOutputVal, MAXPATHLEN, inifile);
- GetPrivateProfileStringW(L"MakeCommandLineTests", sPassesKey, nullptr,
- sPassesVal, MAXPATHLEN, inifile);
-
- rv |= verifyCmdLineCreation(sInputVal, sOutputVal,
- (_wcsicmp(sPassesVal, L"false") == 0) ? FALSE : TRUE,
- i);
-
- if (argc > 2 && _wcsicmp(argv[1], L"-check-one") == 0) {
- break;
- }
- }
-
- if (rv == 0) {
- wprintf(L"TEST-PASS | %s | all checks passed\n", TEST_NAME);
- } else {
- wprintf(L"TEST-UNEXPECTED-FAIL | %s | some checks failed\n", TEST_NAME);
- }
-
- return rv;
-}
-
-#ifdef __MINGW32__
-
-/* MingW currently does not implement a wide version of the
- startup routines. Workaround is to implement something like
- it ourselves. See bug 411826 */
-
-#include <shellapi.h>
-
-int main(int argc, char **argv)
-{
- LPWSTR commandLine = GetCommandLineW();
- int argcw = 0;
- LPWSTR *argvw = CommandLineToArgvW(commandLine, &argcw);
- if (!argvw)
- return 127;
-
- int result = wmain(argcw, argvw);
- LocalFree(argvw);
- return result;
-}
-#endif /* __MINGW32__ */
diff --git a/toolkit/xre/test/win/TestXREMakeCommandLineWin.ini b/toolkit/xre/test/win/TestXREMakeCommandLineWin.ini
deleted file mode 100644
index dbb529d1b..000000000
--- a/toolkit/xre/test/win/TestXREMakeCommandLineWin.ini
+++ /dev/null
@@ -1,94 +0,0 @@
-; A typical MakeCommandLine test will contain an input and an output name value
-; pair. The value for input_xx is the input command line and the value for
-; output_xx is the expected output command line.
-;
-; A test that is known to fail can be added as follows. If the passes_xx name
-; value pair doesn't exist it defaults to true.
-; input_99=yabadaba
-; output_99=doo
-; passes_99=false
-;
-; If a value starts and ends with single or double quotation marks then it must
-; be enclosed in single or double quotation marks due to GetPrivateProfileString
-; discarding the outmost quotation marks. See GetPrivateProfileString on MSDN
-; for more information.
-; http://msdn.microsoft.com/en-us/library/ms724353.aspx
-
-[MakeCommandLineTests]
-input_0=a:\
-output_0=a:\
-
-input_1=""a:\""
-output_1=a:\"
-
-input_2=""a:\b c""
-output_2=""a:\b c""
-
-input_3=""a:\b c\""
-output_3=""a:\b c\"""
-
-input_4=""a:\b c\d e""
-output_4=""a:\b c\d e""
-
-input_5=""a:\b c\d e\""
-output_5=""a:\b c\d e\"""
-
-input_6=""a:\\""
-output_6=a:\
-
-input_7="a:\" "b:\c d"
-output_7=a:\" "b:\c d"
-
-input_8="a "b:\" "c:\d e""
-output_8="a "b:\" c:\d" e"
-
-input_9="abc" d e
-output_9=abc d e
-
-input_10="a b c" d e
-output_10="a b c" d e
-
-input_11=a\\\b d"e f"g h
-output_11=a\\\b "de fg" h
-
-input_12=a b
-output_12=a b
-
-input_13=""a b""
-output_13=""a b""
-
-input_14=a\\\"b c d
-output_14=a\\\"b c d
-
-input_15=a\\\"b c"
-output_15=a\\\"b c
-
-input_16=""a\\\b c"
-output_16=""a\\\b c""
-
-input_17=\"a
-output_17=\"a
-
-input_18=\\"a
-output_18=\a
-
-input_19=\\"\\\\"a
-output_19=\\\a
-
-input_20=\\"\\\\\"a
-output_20=\\\\\\\"a
-
-input_21="a\\\"b c\" d e
-output_21=""a\\\"b c\" d e""
-
-input_22=a\\\\\"b c" d e"
-output_22=a\\\\\"b "c d e"
-
-input_23=a:\b c\アルファ オメガ\d
-output_23=a:\b c\アルファ オメガ\d
-
-input_24=a:\b "c\アルファ オメガ\d"
-output_24=a:\b "c\アルファ オメガ\d"
-
-input_25=アルファ オメガ
-output_25=アルファ オメガ
diff --git a/toolkit/xre/test/win/moz.build b/toolkit/xre/test/win/moz.build
deleted file mode 100644
index 51ad0bcb3..000000000
--- a/toolkit/xre/test/win/moz.build
+++ /dev/null
@@ -1,30 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-SimplePrograms([
- 'TestXREMakeCommandLineWin',
-])
-
-CppUnitTests([
- 'TestDllInterceptor',
-])
-
-DEFINES['NS_NO_XPCOM'] = True
-
-LOCAL_INCLUDES += [
- '/config',
- '/toolkit/xre',
-]
-
-DISABLE_STL_WRAPPING = True
-USE_STATIC_LIBS = True
-
-OS_LIBS += [
- 'comctl32',
- 'ole32',
- 'shell32',
- 'ws2_32',
-]
diff --git a/tools/update-packaging/Makefile.in b/tools/update-packaging/Makefile.in
index 7c55958b6..4788a5575 100644
--- a/tools/update-packaging/Makefile.in
+++ b/tools/update-packaging/Makefile.in
@@ -34,8 +34,6 @@ OVERRIDE_DEFAULT_GOAL := full-update
full-update:: complete-patch
ifeq ($(OS_TARGET), WINNT)
-MOZ_PKG_FORMAT := SFX7Z
-UNPACKAGE = '$(subst $(DIST),$(ABS_DIST),$(INSTALLER_PACKAGE))'
ifdef AB_CD
UNPACKAGE = '$(PACKAGE_BASE_DIR)/$(PACKAGE)'
endif
@@ -54,11 +52,6 @@ endif
dir-stage := $(call mkdir_deps,$(STAGE_DIR))
complete-patch:: $(dir-stage)
-ifeq ($(OS_TARGET), WINNT)
- test -f $(UNPACKAGE)
- $(RM) -rf '$(PACKAGE_DIR)'
- cd $(PACKAGE_BASE_DIR) && $(INNER_UNMAKE_PACKAGE)
-endif
MAR=$(MAR_BIN) \
$(srcdir)/make_full_update.sh \
'$(DIST)/$(COMPLETE_MAR)' \
diff --git a/uriloader/exthandler/android/nsAndroidHandlerApp.cpp b/uriloader/exthandler/android/nsAndroidHandlerApp.cpp
deleted file mode 100644
index 4c7ffff48..000000000
--- a/uriloader/exthandler/android/nsAndroidHandlerApp.cpp
+++ /dev/null
@@ -1,91 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsAndroidHandlerApp.h"
-#include "GeneratedJNIWrappers.h"
-
-using namespace mozilla;
-
-
-NS_IMPL_ISUPPORTS(nsAndroidHandlerApp, nsIHandlerApp, nsISharingHandlerApp)
-
-nsAndroidHandlerApp::nsAndroidHandlerApp(const nsAString& aName,
- const nsAString& aDescription,
- const nsAString& aPackageName,
- const nsAString& aClassName,
- const nsACString& aMimeType,
- const nsAString& aAction) :
-mName(aName), mDescription(aDescription), mPackageName(aPackageName),
- mClassName(aClassName), mMimeType(aMimeType), mAction(aAction)
-{
-}
-
-nsAndroidHandlerApp::~nsAndroidHandlerApp()
-{
-}
-
-NS_IMETHODIMP
-nsAndroidHandlerApp::GetName(nsAString & aName)
-{
- aName.Assign(mName);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAndroidHandlerApp::SetName(const nsAString & aName)
-{
- mName.Assign(aName);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAndroidHandlerApp::GetDetailedDescription(nsAString & aDescription)
-{
- aDescription.Assign(mDescription);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAndroidHandlerApp::SetDetailedDescription(const nsAString & aDescription)
-{
- mDescription.Assign(aDescription);
-
- return NS_OK;
-}
-
-// XXX Workaround for bug 986975 to maintain the existing broken semantics
-template<>
-struct nsISharingHandlerApp::COMTypeInfo<nsAndroidHandlerApp, void> {
- static const nsIID kIID;
-};
-const nsIID nsISharingHandlerApp::COMTypeInfo<nsAndroidHandlerApp, void>::kIID = NS_IHANDLERAPP_IID;
-
-NS_IMETHODIMP
-nsAndroidHandlerApp::Equals(nsIHandlerApp *aHandlerApp, bool *aRetval)
-{
- nsCOMPtr<nsAndroidHandlerApp> aApp = do_QueryInterface(aHandlerApp);
- *aRetval = aApp && aApp->mName.Equals(mName) &&
- aApp->mDescription.Equals(mDescription);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAndroidHandlerApp::LaunchWithURI(nsIURI *aURI, nsIInterfaceRequestor *aWindowContext)
-{
- nsCString uriSpec;
- aURI->GetSpec(uriSpec);
- return java::GeckoAppShell::OpenUriExternal(
- uriSpec, mMimeType, mPackageName, mClassName,
- mAction, EmptyString()) ? NS_OK : NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-nsAndroidHandlerApp::Share(const nsAString & data, const nsAString & title)
-{
- return java::GeckoAppShell::OpenUriExternal(
- data, mMimeType, mPackageName, mClassName,
- mAction, EmptyString()) ? NS_OK : NS_ERROR_FAILURE;
-}
-
diff --git a/uriloader/exthandler/android/nsAndroidHandlerApp.h b/uriloader/exthandler/android/nsAndroidHandlerApp.h
deleted file mode 100644
index bb3872463..000000000
--- a/uriloader/exthandler/android/nsAndroidHandlerApp.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsAndroidHandlerApp_h
-#define nsAndroidHandlerApp_h
-
-#include "nsMIMEInfoImpl.h"
-#include "nsIExternalSharingAppService.h"
-
-class nsAndroidHandlerApp : public nsISharingHandlerApp {
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIHANDLERAPP
- NS_DECL_NSISHARINGHANDLERAPP
-
- nsAndroidHandlerApp(const nsAString& aName, const nsAString& aDescription,
- const nsAString& aPackageName,
- const nsAString& aClassName,
- const nsACString& aMimeType, const nsAString& aAction);
-
-private:
- virtual ~nsAndroidHandlerApp();
-
- nsString mName;
- nsString mDescription;
- nsString mPackageName;
- nsString mClassName;
- nsCString mMimeType;
- nsString mAction;
-};
-#endif
diff --git a/uriloader/exthandler/android/nsExternalSharingAppService.cpp b/uriloader/exthandler/android/nsExternalSharingAppService.cpp
deleted file mode 100644
index f4f8a7013..000000000
--- a/uriloader/exthandler/android/nsExternalSharingAppService.cpp
+++ /dev/null
@@ -1,61 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsExternalSharingAppService.h"
-
-#include "mozilla/ModuleUtils.h"
-#include "nsIClassInfoImpl.h"
-
-#include "AndroidBridge.h"
-#include "nsArrayUtils.h"
-#include "nsISupportsUtils.h"
-#include "nsComponentManagerUtils.h"
-
-using namespace mozilla;
-
-NS_IMPL_ISUPPORTS(nsExternalSharingAppService, nsIExternalSharingAppService)
-
-nsExternalSharingAppService::nsExternalSharingAppService()
-{
-}
-
-nsExternalSharingAppService::~nsExternalSharingAppService()
-{
-}
-
-NS_IMETHODIMP
-nsExternalSharingAppService::ShareWithDefault(const nsAString & data,
- const nsAString & mime,
- const nsAString & title)
-{
- NS_NAMED_LITERAL_STRING(sendAction, "android.intent.action.SEND");
- const nsString emptyString = EmptyString();
- return java::GeckoAppShell::OpenUriExternal(data,
- mime, emptyString, emptyString, sendAction, title) ? NS_OK : NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-nsExternalSharingAppService::GetSharingApps(const nsAString & aMIMEType,
- uint32_t *aLen,
- nsISharingHandlerApp ***aHandlers)
-{
- nsresult rv;
- NS_NAMED_LITERAL_STRING(sendAction, "android.intent.action.SEND");
- nsCOMPtr<nsIMutableArray> array = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
- if (!AndroidBridge::Bridge())
- return NS_OK;
- AndroidBridge::Bridge()->GetHandlersForMimeType(aMIMEType, array,
- nullptr, sendAction);
- array->GetLength(aLen);
- *aHandlers =
- static_cast<nsISharingHandlerApp**>(moz_xmalloc(sizeof(nsISharingHandlerApp*)
- * *aLen));
- for (uint32_t i = 0; i < *aLen; i++) {
- rv = array->QueryElementAt(i, NS_GET_IID(nsISharingHandlerApp),
- (void**)(*aHandlers + i));
- NS_ENSURE_SUCCESS(rv, rv);
- }
- return NS_OK;
-}
diff --git a/uriloader/exthandler/android/nsExternalSharingAppService.h b/uriloader/exthandler/android/nsExternalSharingAppService.h
deleted file mode 100644
index a1e2e4363..000000000
--- a/uriloader/exthandler/android/nsExternalSharingAppService.h
+++ /dev/null
@@ -1,28 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef NS_EXTERNAL_SHARING_APP_SERVICE_H
-#define NS_EXTERNAL_SHARING_APP_SERVICE_H
-#include "nsIExternalSharingAppService.h"
-
-
-#define NS_EXTERNALSHARINGAPPSERVICE_CID \
- {0x93e2c46e, 0x0011, 0x434b, \
- {0x81, 0x2e, 0xb6, 0xf3, 0xa8, 0x1e, 0x2a, 0x58}}
-
-class nsExternalSharingAppService final
- : public nsIExternalSharingAppService
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIEXTERNALSHARINGAPPSERVICE
-
- nsExternalSharingAppService();
-
-private:
- ~nsExternalSharingAppService();
-
-};
-
-#endif /*NS_EXTERNAL_SHARING_APP_SERVICE_H */
diff --git a/uriloader/exthandler/android/nsExternalURLHandlerService.cpp b/uriloader/exthandler/android/nsExternalURLHandlerService.cpp
deleted file mode 100644
index f417b5b9f..000000000
--- a/uriloader/exthandler/android/nsExternalURLHandlerService.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsExternalURLHandlerService.h"
-#include "nsMIMEInfoAndroid.h"
-
-NS_IMPL_ISUPPORTS(nsExternalURLHandlerService, nsIExternalURLHandlerService)
-
-nsExternalURLHandlerService::nsExternalURLHandlerService()
-{
-}
-
-nsExternalURLHandlerService::~nsExternalURLHandlerService()
-{
-}
-
-NS_IMETHODIMP
-nsExternalURLHandlerService::GetURLHandlerInfoFromOS(nsIURI *aURL,
- bool *found,
- nsIHandlerInfo **info)
-{
- nsCString uriSpec;
- aURL->GetSpec(uriSpec);
- return nsMIMEInfoAndroid::GetMimeInfoForURL(uriSpec, found, info);
-}
diff --git a/uriloader/exthandler/android/nsExternalURLHandlerService.h b/uriloader/exthandler/android/nsExternalURLHandlerService.h
deleted file mode 100644
index f2618c7e6..000000000
--- a/uriloader/exthandler/android/nsExternalURLHandlerService.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef NSEXTERNALURLHANDLERSERVICE_H
-#define NSEXTERNALURLHANDLERSERVICE_H
-
-#include "nsIExternalURLHandlerService.h"
-
-// {4BF1F8EF-D947-4BA3-9CD3-8C9A54A63A1C}
-#define NS_EXTERNALURLHANDLERSERVICE_CID \
- {0x4bf1f8ef, 0xd947, 0x4ba3, {0x9c, 0xd3, 0x8c, 0x9a, 0x54, 0xa6, 0x3a, 0x1c}}
-
-class nsExternalURLHandlerService final
- : public nsIExternalURLHandlerService
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIEXTERNALURLHANDLERSERVICE
-
- nsExternalURLHandlerService();
-private:
- ~nsExternalURLHandlerService();
-};
-
-#endif // NSEXTERNALURLHANDLERSERVICE_H
diff --git a/uriloader/exthandler/android/nsMIMEInfoAndroid.cpp b/uriloader/exthandler/android/nsMIMEInfoAndroid.cpp
deleted file mode 100644
index ee9bc8570..000000000
--- a/uriloader/exthandler/android/nsMIMEInfoAndroid.cpp
+++ /dev/null
@@ -1,427 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#include "nsMIMEInfoAndroid.h"
-#include "AndroidBridge.h"
-#include "nsAndroidHandlerApp.h"
-#include "nsArrayUtils.h"
-#include "nsISupportsUtils.h"
-#include "nsStringEnumerator.h"
-#include "nsNetUtil.h"
-
-using namespace mozilla;
-
-NS_IMPL_ISUPPORTS(nsMIMEInfoAndroid, nsIMIMEInfo, nsIHandlerInfo)
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::LaunchDefaultWithFile(nsIFile* aFile)
-{
- return LaunchWithFile(aFile);
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::LoadUriInternal(nsIURI * aURI)
-{
- nsCString uriSpec;
- aURI->GetSpec(uriSpec);
-
- nsCString uriScheme;
- aURI->GetScheme(uriScheme);
-
- nsAutoString mimeType;
- if (mType.Equals(uriScheme) || mType.Equals(uriSpec)) {
- mimeType = EmptyString();
- } else {
- mimeType = NS_ConvertUTF8toUTF16(mType);
- }
-
- if (java::GeckoAppShell::OpenUriExternal(
- NS_ConvertUTF8toUTF16(uriSpec), mimeType, EmptyString(),
- EmptyString(), EmptyString(), EmptyString())) {
- return NS_OK;
- }
- return NS_ERROR_FAILURE;
-}
-
-bool
-nsMIMEInfoAndroid::GetMimeInfoForMimeType(const nsACString& aMimeType,
- nsMIMEInfoAndroid** aMimeInfo)
-{
- RefPtr<nsMIMEInfoAndroid> info = new nsMIMEInfoAndroid(aMimeType);
- mozilla::AndroidBridge* bridge = mozilla::AndroidBridge::Bridge();
- // we don't have access to the bridge, so just assume we can handle
- // the mime type for now and let the system deal with it
- if (!bridge){
- info.forget(aMimeInfo);
- return false;
- }
-
- nsIHandlerApp* systemDefault = nullptr;
-
- if (!IsUTF8(aMimeType, true))
- return false;
-
- NS_ConvertUTF8toUTF16 mimeType(aMimeType);
-
- bridge->GetHandlersForMimeType(mimeType,
- info->mHandlerApps, &systemDefault);
-
- if (systemDefault)
- info->mPrefApp = systemDefault;
-
- nsAutoCString fileExt;
- bridge->GetExtensionFromMimeType(aMimeType, fileExt);
- info->SetPrimaryExtension(fileExt);
-
- uint32_t len;
- info->mHandlerApps->GetLength(&len);
- if (len == 1) {
- info.forget(aMimeInfo);
- return false;
- }
-
- info.forget(aMimeInfo);
- return true;
-}
-
-bool
-nsMIMEInfoAndroid::GetMimeInfoForFileExt(const nsACString& aFileExt,
- nsMIMEInfoAndroid **aMimeInfo)
-{
- nsCString mimeType;
- if (mozilla::AndroidBridge::Bridge())
- mozilla::AndroidBridge::Bridge()->
- GetMimeTypeFromExtensions(aFileExt, mimeType);
-
- // "*/*" means that the bridge didn't know.
- if (mimeType.Equals(nsDependentCString("*/*"), nsCaseInsensitiveCStringComparator()))
- return false;
-
- bool found = GetMimeInfoForMimeType(mimeType, aMimeInfo);
- (*aMimeInfo)->SetPrimaryExtension(aFileExt);
- return found;
-}
-
-/**
- * Returns MIME info for the aURL, which may contain the whole URL or only a protocol
- */
-nsresult
-nsMIMEInfoAndroid::GetMimeInfoForURL(const nsACString &aURL,
- bool *found,
- nsIHandlerInfo **info)
-{
- nsMIMEInfoAndroid *mimeinfo = new nsMIMEInfoAndroid(aURL);
- NS_ADDREF(*info = mimeinfo);
- *found = true;
-
- mozilla::AndroidBridge* bridge = mozilla::AndroidBridge::Bridge();
- if (!bridge) {
- // we don't have access to the bridge, so just assume we can handle
- // the protocol for now and let the system deal with it
- return NS_OK;
- }
-
- nsIHandlerApp* systemDefault = nullptr;
- bridge->GetHandlersForURL(NS_ConvertUTF8toUTF16(aURL),
- mimeinfo->mHandlerApps, &systemDefault);
-
- if (systemDefault)
- mimeinfo->mPrefApp = systemDefault;
-
-
- nsAutoCString fileExt;
- nsAutoCString mimeType;
- mimeinfo->GetType(mimeType);
- bridge->GetExtensionFromMimeType(mimeType, fileExt);
- mimeinfo->SetPrimaryExtension(fileExt);
-
- uint32_t len;
- mimeinfo->mHandlerApps->GetLength(&len);
- if (len == 1) {
- // Code that calls this requires an object regardless if the OS has
- // something for us, so we return the empty object.
- *found = false;
- return NS_OK;
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::GetType(nsACString& aType)
-{
- aType.Assign(mType);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::GetDescription(nsAString& aDesc)
-{
- aDesc.Assign(mDescription);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::SetDescription(const nsAString& aDesc)
-{
- mDescription.Assign(aDesc);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::GetPreferredApplicationHandler(nsIHandlerApp** aApp)
-{
- *aApp = mPrefApp;
- NS_IF_ADDREF(*aApp);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::SetPreferredApplicationHandler(nsIHandlerApp* aApp)
-{
- mPrefApp = aApp;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::GetPossibleApplicationHandlers(nsIMutableArray **aHandlerApps)
-{
- if (!mHandlerApps)
- mHandlerApps = do_CreateInstance(NS_ARRAY_CONTRACTID);
-
- if (!mHandlerApps)
- return NS_ERROR_OUT_OF_MEMORY;
-
- *aHandlerApps = mHandlerApps;
- NS_IF_ADDREF(*aHandlerApps);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::GetHasDefaultHandler(bool* aHasDefault)
-{
- uint32_t len;
- *aHasDefault = false;
- if (!mHandlerApps)
- return NS_OK;
-
- if (NS_FAILED(mHandlerApps->GetLength(&len)))
- return NS_OK;
-
- if (len == 0)
- return NS_OK;
-
- *aHasDefault = true;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::GetDefaultDescription(nsAString& aDesc)
-{
- aDesc.Assign(EmptyString());
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::LaunchWithURI(nsIURI* aURI, nsIInterfaceRequestor* req)
-{
- return mPrefApp->LaunchWithURI(aURI, req);
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::GetPreferredAction(nsHandlerInfoAction* aPrefAction)
-{
- *aPrefAction = mPrefAction;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::SetPreferredAction(nsHandlerInfoAction aPrefAction)
-{
- mPrefAction = aPrefAction;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::GetAlwaysAskBeforeHandling(bool* aAlwaysAsk)
-{
- *aAlwaysAsk = mAlwaysAsk;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::SetAlwaysAskBeforeHandling(bool aAlwaysAsk)
-{
- mAlwaysAsk = aAlwaysAsk;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::GetFileExtensions(nsIUTF8StringEnumerator** aResult)
-{
- return NS_NewUTF8StringEnumerator(aResult, &mExtensions, this);
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::SetFileExtensions(const nsACString & aExtensions)
-{
- mExtensions.Clear();
- nsCString extList(aExtensions);
-
- int32_t breakLocation = -1;
- while ( (breakLocation = extList.FindChar(',')) != -1)
- {
- mExtensions.AppendElement(Substring(extList.get(), extList.get() + breakLocation));
- extList.Cut(0, breakLocation + 1);
- }
- if (!extList.IsEmpty())
- mExtensions.AppendElement(extList);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::ExtensionExists(const nsACString & aExtension, bool *aRetVal)
-{
- NS_ASSERTION(!aExtension.IsEmpty(), "no extension");
-
- nsCString mimeType;
- if (mozilla::AndroidBridge::Bridge()) {
- mozilla::AndroidBridge::Bridge()->
- GetMimeTypeFromExtensions(aExtension, mimeType);
- }
-
- // "*/*" means the bridge didn't find anything (i.e., extension doesn't exist).
- *aRetVal = !mimeType.Equals(nsDependentCString("*/*"), nsCaseInsensitiveCStringComparator());
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::AppendExtension(const nsACString & aExtension)
-{
- mExtensions.AppendElement(aExtension);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::GetPrimaryExtension(nsACString & aPrimaryExtension)
-{
- if (!mExtensions.Length())
- return NS_ERROR_NOT_INITIALIZED;
-
- aPrimaryExtension = mExtensions[0];
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::SetPrimaryExtension(const nsACString & aExtension)
-{
- uint32_t extCount = mExtensions.Length();
- uint8_t i;
- bool found = false;
- for (i=0; i < extCount; i++) {
- const nsCString& ext = mExtensions[i];
- if (ext.Equals(aExtension, nsCaseInsensitiveCStringComparator())) {
- found = true;
- break;
- }
- }
- if (found) {
- mExtensions.RemoveElementAt(i);
- }
-
- mExtensions.InsertElementAt(0, aExtension);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::GetMIMEType(nsACString & aMIMEType)
-{
- aMIMEType.Assign(mType);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::Equals(nsIMIMEInfo *aMIMEInfo, bool *aRetVal)
-{
- if (!aMIMEInfo) return NS_ERROR_NULL_POINTER;
-
- nsAutoCString type;
- nsresult rv = aMIMEInfo->GetMIMEType(type);
- if (NS_FAILED(rv)) return rv;
-
- *aRetVal = mType.Equals(type);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::GetPossibleLocalHandlers(nsIArray * *aPossibleLocalHandlers)
-{
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-nsMIMEInfoAndroid::LaunchWithFile(nsIFile *aFile)
-{
- nsCOMPtr<nsIURI> uri;
- NS_NewFileURI(getter_AddRefs(uri), aFile);
- return LoadUriInternal(uri);
-}
-
-nsMIMEInfoAndroid::nsMIMEInfoAndroid(const nsACString& aMIMEType) :
- mType(aMIMEType), mAlwaysAsk(true),
- mPrefAction(nsIMIMEInfo::useHelperApp)
-{
- mPrefApp = new nsMIMEInfoAndroid::SystemChooser(this);
- nsresult rv;
- mHandlerApps = do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
- mHandlerApps->AppendElement(mPrefApp, false);
-}
-
-NS_IMPL_ISUPPORTS(nsMIMEInfoAndroid::SystemChooser, nsIHandlerApp)
-
-
-nsresult nsMIMEInfoAndroid::SystemChooser::GetName(nsAString & aName) {
- aName.AssignLiteral(u"Android chooser");
- return NS_OK;
-}
-
-nsresult
-nsMIMEInfoAndroid::SystemChooser::SetName(const nsAString&) {
- return NS_OK;
-}
-
-nsresult
-nsMIMEInfoAndroid::SystemChooser::GetDetailedDescription(nsAString & aDesc) {
- aDesc.AssignLiteral(u"Android's default handler application chooser");
- return NS_OK;
-}
-
-nsresult
-nsMIMEInfoAndroid::SystemChooser::SetDetailedDescription(const nsAString&) {
- return NS_OK;
-}
-
-// XXX Workaround for bug 986975 to maintain the existing broken semantics
-template<>
-struct nsIHandlerApp::COMTypeInfo<nsMIMEInfoAndroid::SystemChooser, void> {
- static const nsIID kIID;
-};
-const nsIID nsIHandlerApp::COMTypeInfo<nsMIMEInfoAndroid::SystemChooser, void>::kIID = NS_IHANDLERAPP_IID;
-
-nsresult
-nsMIMEInfoAndroid::SystemChooser::Equals(nsIHandlerApp *aHandlerApp, bool *aRetVal) {
- nsCOMPtr<nsMIMEInfoAndroid::SystemChooser> info = do_QueryInterface(aHandlerApp);
- if (info)
- return mOuter->Equals(info->mOuter, aRetVal);
- *aRetVal = false;
- return NS_OK;
-}
-
-nsresult
-nsMIMEInfoAndroid::SystemChooser::LaunchWithURI(nsIURI* aURI, nsIInterfaceRequestor*)
-{
- return mOuter->LoadUriInternal(aURI);
-}
diff --git a/uriloader/exthandler/android/nsMIMEInfoAndroid.h b/uriloader/exthandler/android/nsMIMEInfoAndroid.h
deleted file mode 100644
index 569d715bd..000000000
--- a/uriloader/exthandler/android/nsMIMEInfoAndroid.h
+++ /dev/null
@@ -1,60 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 2; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsMIMEInfoAndroid_h
-#define nsMIMEInfoAndroid_h
-
-#include "nsMIMEInfoImpl.h"
-#include "nsIMutableArray.h"
-#include "nsAndroidHandlerApp.h"
-
-class nsMIMEInfoAndroid final : public nsIMIMEInfo
-{
-public:
- static MOZ_MUST_USE bool
- GetMimeInfoForMimeType(const nsACString& aMimeType,
- nsMIMEInfoAndroid** aMimeInfo);
- static MOZ_MUST_USE bool
- GetMimeInfoForFileExt(const nsACString& aFileExt,
- nsMIMEInfoAndroid** aMimeInfo);
-
- static MOZ_MUST_USE nsresult
- GetMimeInfoForURL(const nsACString &aURL, bool *found,
- nsIHandlerInfo **info);
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSIMIMEINFO
- NS_DECL_NSIHANDLERINFO
-
- nsMIMEInfoAndroid(const nsACString& aMIMEType);
-
-private:
- ~nsMIMEInfoAndroid() {}
-
- virtual MOZ_MUST_USE nsresult LaunchDefaultWithFile(nsIFile* aFile);
- virtual MOZ_MUST_USE nsresult LoadUriInternal(nsIURI *aURI);
- nsCOMPtr<nsIMutableArray> mHandlerApps;
- nsCString mType;
- nsTArray<nsCString> mExtensions;
- bool mAlwaysAsk;
- nsHandlerInfoAction mPrefAction;
- nsString mDescription;
- nsCOMPtr<nsIHandlerApp> mPrefApp;
-
-public:
- class SystemChooser final : public nsIHandlerApp {
- public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIHANDLERAPP
- SystemChooser(nsMIMEInfoAndroid* aOuter): mOuter(aOuter) {}
-
- private:
- ~SystemChooser() {}
-
- nsMIMEInfoAndroid* mOuter;
- };
-};
-
-#endif /* nsMIMEInfoAndroid_h */
diff --git a/uriloader/exthandler/android/nsOSHelperAppService.cpp b/uriloader/exthandler/android/nsOSHelperAppService.cpp
deleted file mode 100644
index 3a170dcf6..000000000
--- a/uriloader/exthandler/android/nsOSHelperAppService.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsOSHelperAppService.h"
-#include "nsMIMEInfoAndroid.h"
-#include "AndroidBridge.h"
-
-nsOSHelperAppService::nsOSHelperAppService() : nsExternalHelperAppService()
-{
-}
-
-nsOSHelperAppService::~nsOSHelperAppService()
-{
-}
-
-already_AddRefed<nsIMIMEInfo>
-nsOSHelperAppService::GetMIMEInfoFromOS(const nsACString& aMIMEType,
- const nsACString& aFileExt,
- bool* aFound)
-{
- RefPtr<nsMIMEInfoAndroid> mimeInfo;
- *aFound = false;
- if (!aMIMEType.IsEmpty())
- *aFound =
- nsMIMEInfoAndroid::GetMimeInfoForMimeType(aMIMEType,
- getter_AddRefs(mimeInfo));
- if (!*aFound)
- *aFound =
- nsMIMEInfoAndroid::GetMimeInfoForFileExt(aFileExt,
- getter_AddRefs(mimeInfo));
-
- // Code that calls this requires an object regardless if the OS has
- // something for us, so we return the empty object.
- if (!*aFound)
- mimeInfo = new nsMIMEInfoAndroid(aMIMEType);
-
- return mimeInfo.forget();
-}
-
-nsresult
-nsOSHelperAppService::OSProtocolHandlerExists(const char* aScheme,
- bool* aExists)
-{
- *aExists = mozilla::AndroidBridge::Bridge()->GetHandlersForURL(NS_ConvertUTF8toUTF16(aScheme));
- return NS_OK;
-}
-
-nsresult nsOSHelperAppService::GetProtocolHandlerInfoFromOS(const nsACString &aScheme,
- bool *found,
- nsIHandlerInfo **info)
-{
- return nsMIMEInfoAndroid::GetMimeInfoForURL(aScheme, found, info);
-}
-
-nsIHandlerApp*
-nsOSHelperAppService::CreateAndroidHandlerApp(const nsAString& aName,
- const nsAString& aDescription,
- const nsAString& aPackageName,
- const nsAString& aClassName,
- const nsACString& aMimeType,
- const nsAString& aAction)
-{
- return new nsAndroidHandlerApp(aName, aDescription, aPackageName,
- aClassName, aMimeType, aAction);
-}
diff --git a/uriloader/exthandler/android/nsOSHelperAppService.h b/uriloader/exthandler/android/nsOSHelperAppService.h
deleted file mode 100644
index 4f3623894..000000000
--- a/uriloader/exthandler/android/nsOSHelperAppService.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsOSHelperAppService_h
-#define nsOSHelperAppService_h
-
-#include "nsCExternalHandlerService.h"
-#include "nsExternalHelperAppService.h"
-
-class nsOSHelperAppService : public nsExternalHelperAppService
-{
-public:
- nsOSHelperAppService();
- virtual ~nsOSHelperAppService();
-
- virtual already_AddRefed<nsIMIMEInfo>
- GetMIMEInfoFromOS(const nsACString& aMIMEType,
- const nsACString& aFileExt,
- bool* aFound);
-
- virtual MOZ_MUST_USE nsresult
- OSProtocolHandlerExists(const char* aScheme,
- bool* aExists);
-
- NS_IMETHOD GetProtocolHandlerInfoFromOS(const nsACString &aScheme,
- bool *found,
- nsIHandlerInfo **_retval);
-
- static nsIHandlerApp*
- CreateAndroidHandlerApp(const nsAString& aName,
- const nsAString& aDescription,
- const nsAString& aPackageName,
- const nsAString& aClassName,
- const nsACString& aMimeType,
- const nsAString& aAction = EmptyString());
-};
-
-#endif /* nsOSHelperAppService_h */
diff --git a/uriloader/exthandler/moz.build b/uriloader/exthandler/moz.build
index 714b275f1..0cd2340a9 100644
--- a/uriloader/exthandler/moz.build
+++ b/uriloader/exthandler/moz.build
@@ -24,8 +24,8 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
LOCAL_INCLUDES += ['win']
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
osdir = 'mac'
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'uikit'):
- osdir = CONFIG['MOZ_WIDGET_TOOLKIT']
+elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'uikit':
+ osdir = 'uikit'
else:
osdir = 'unix'
@@ -38,12 +38,6 @@ EXPORTS += [
'nsExternalHelperAppService.h',
]
-if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- EXPORTS += [ '%s/%s' % (osdir, f) for f in [
- 'nsExternalSharingAppService.h',
- 'nsExternalURLHandlerService.h',
- ]]
-
EXPORTS.mozilla.dom += [
'ExternalHelperAppChild.h',
'ExternalHelperAppParent.h',
@@ -85,13 +79,6 @@ if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
'unix/nsGNOMERegistry.cpp',
'unix/nsMIMEInfoUnix.cpp',
]
-elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
- UNIFIED_SOURCES += [
- 'android/nsAndroidHandlerApp.cpp',
- 'android/nsExternalSharingAppService.cpp',
- 'android/nsExternalURLHandlerService.cpp',
- 'android/nsMIMEInfoAndroid.cpp',
- ]
elif CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
UNIFIED_SOURCES += [
'win/nsMIMEInfoWin.cpp',
diff --git a/uriloader/exthandler/nsExternalHelperAppService.cpp b/uriloader/exthandler/nsExternalHelperAppService.cpp
index 455ac457a..49a54ea5f 100644
--- a/uriloader/exthandler/nsExternalHelperAppService.cpp
+++ b/uriloader/exthandler/nsExternalHelperAppService.cpp
@@ -99,10 +99,6 @@
#include "nsWindowsHelpers.h"
#endif
-#ifdef MOZ_WIDGET_ANDROID
-#include "FennecJNIWrappers.h"
-#endif
-
#include "mozilla/Preferences.h"
#include "mozilla/ipc/URIUtils.h"
@@ -322,36 +318,6 @@ static nsresult GetDownloadDirectory(nsIFile **_directory,
getter_AddRefs(dir));
NS_ENSURE_SUCCESS(rv, rv);
}
-#elif defined(ANDROID)
- // We ask Java for the temporary download directory. The directory will be
- // different depending on whether we have the permission to write to the
- // public download directory or not.
- // In the case where we do not have the permission we will start the
- // download to the app cache directory and later move it to the final
- // destination after prompting for the permission.
- jni::String::LocalRef downloadDir;
- if (jni::IsFennec()) {
- downloadDir = java::DownloadsIntegration::GetTemporaryDownloadDirectory();
- }
-
- nsresult rv;
- if (downloadDir) {
- nsCOMPtr<nsIFile> ldir;
- rv = NS_NewNativeLocalFile(downloadDir->ToCString(),
- true, getter_AddRefs(ldir));
-
- NS_ENSURE_SUCCESS(rv, rv);
- dir = do_QueryInterface(ldir);
-
- // If we're not checking for availability we're done.
- if (aSkipChecks) {
- dir.forget(_directory);
- return NS_OK;
- }
- }
- else {
- return NS_ERROR_FAILURE;
- }
#else
// On all other platforms, we default to the systems temporary directory.
nsresult rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(dir));
@@ -523,9 +489,6 @@ static const nsExtraMimeTypeEntry extraMimeEntries[] =
{ APPLICATION_POSTSCRIPT, "ps,eps,ai", "Postscript File" },
{ APPLICATION_XJAVASCRIPT, "js", "Javascript Source File" },
{ APPLICATION_XJAVASCRIPT, "jsm", "Javascript Module Source File" },
-#ifdef MOZ_WIDGET_ANDROID
- { "application/vnd.android.package-archive", "apk", "Android Package" },
-#endif
{ IMAGE_ART, "art", "ART Image" },
{ IMAGE_BMP, "bmp", "BMP Image" },
{ IMAGE_GIF, "gif", "GIF Image" },
@@ -1795,13 +1758,7 @@ void nsExternalAppHandler::SendStatusChange(ErrorType type, nsresult rv, nsIRequ
case NS_ERROR_FILE_ACCESS_DENIED:
if (type == kWriteError) {
// Attempt to write without sufficient permissions.
-#if defined(ANDROID)
- // On Android (and Gonk), this means the SD card is present but
- // unavailable (read-only).
- msgId.AssignLiteral("SDAccessErrorCardReadOnly");
-#else
msgId.AssignLiteral("accessError");
-#endif
} else {
msgId.AssignLiteral("launchError");
}
@@ -1815,14 +1772,6 @@ void nsExternalAppHandler::SendStatusChange(ErrorType type, nsresult rv, nsIRequ
msgId.AssignLiteral("helperAppNotFound");
break;
}
-#if defined(ANDROID)
- else if (type == kWriteError) {
- // On Android (and Gonk), this means the SD card is missing (not in
- // SD slot).
- msgId.AssignLiteral("SDAccessErrorCardMissing");
- break;
- }
-#endif
MOZ_FALLTHROUGH;
default:
diff --git a/widget/CompositorWidget.h b/widget/CompositorWidget.h
index 93269eac6..eb657ba7f 100644
--- a/widget/CompositorWidget.h
+++ b/widget/CompositorWidget.h
@@ -30,7 +30,6 @@ namespace widget {
class WinCompositorWidget;
class X11CompositorWidget;
-class AndroidCompositorWidget;
class CompositorWidgetInitData;
// Gecko widgets usually need to communicate with the CompositorWidget with
@@ -56,12 +55,9 @@ class CompositorWidgetChild;
class WidgetRenderingContext
{
public:
-#if defined(XP_MACOSX)
+#ifdef XP_MACOSX
WidgetRenderingContext() : mLayerManager(nullptr) {}
layers::LayerManagerComposite* mLayerManager;
-#elif defined(MOZ_WIDGET_ANDROID)
- WidgetRenderingContext() : mCompositor(nullptr) {}
- layers::Compositor* mCompositor;
#endif
};
@@ -262,9 +258,6 @@ public:
virtual X11CompositorWidget* AsX11() {
return nullptr;
}
- virtual AndroidCompositorWidget* AsAndroid() {
- return nullptr;
- }
/**
* Return the platform-specific delegate for the widget, if any.
diff --git a/widget/EventMessageList.h b/widget/EventMessageList.h
index 890a26dcd..7ff16c484 100644
--- a/widget/EventMessageList.h
+++ b/widget/EventMessageList.h
@@ -379,9 +379,6 @@ NS_EVENT_MESSAGE(eDeviceMotion)
NS_EVENT_MESSAGE(eDeviceProximity)
NS_EVENT_MESSAGE(eUserProximity)
NS_EVENT_MESSAGE(eDeviceLight)
-#if defined(MOZ_WIDGET_ANDROID)
-NS_EVENT_MESSAGE(eOrientationChange)
-#endif
// WebVR events
NS_EVENT_MESSAGE(eVRDisplayConnect)
diff --git a/widget/GfxDriverInfo.h b/widget/GfxDriverInfo.h
index 99d560b81..256142c87 100644
--- a/widget/GfxDriverInfo.h
+++ b/widget/GfxDriverInfo.h
@@ -58,7 +58,6 @@ enum class OperatingSystem {
OSX10_10,
OSX10_11,
OSX10_12,
- Android,
Ios
};
@@ -283,12 +282,6 @@ ParseDriverVersion(const nsAString& aVersion, uint64_t *aNumericVersion)
*aNumericVersion = GFX_DRIVER_VERSION(a, b, c, d);
MOZ_ASSERT(*aNumericVersion != GfxDriverInfo::allDriverVersions);
return true;
-#elif defined(ANDROID)
- // Can't use aVersion.ToInteger() because that's not compiled into our code
- // unless we have XPCOM_GLUE_AVOID_NSPR disabled.
- *aNumericVersion = atoi(NS_LossyConvertUTF16toASCII(aVersion).get());
- MOZ_ASSERT(*aNumericVersion != GfxDriverInfo::allDriverVersions);
- return true;
#else
return false;
#endif
diff --git a/widget/GfxInfoBase.cpp b/widget/GfxInfoBase.cpp
index e20de8277..4c2d83018 100644
--- a/widget/GfxInfoBase.cpp
+++ b/widget/GfxInfoBase.cpp
@@ -274,8 +274,6 @@ BlacklistOSToOperatingSystem(const nsAString& os)
return OperatingSystem::OSX10_11;
else if (os.EqualsLiteral("Darwin 16"))
return OperatingSystem::OSX10_12;
- else if (os.EqualsLiteral("Android"))
- return OperatingSystem::Android;
// For historical reasons, "All" in blocklist means "All Windows"
else if (os.EqualsLiteral("All"))
return OperatingSystem::Windows;
@@ -691,7 +689,7 @@ GfxInfoBase::FindBlocklistedDeviceInList(const nsTArray<GfxDriverInfo>& info,
}
}
-#if defined(XP_WIN) || defined(ANDROID)
+#ifdef XP_WIN
uint64_t driverVersion;
ParseDriverVersion(adapterDriverVersionString, &driverVersion);
#endif
@@ -730,7 +728,7 @@ GfxInfoBase::FindBlocklistedDeviceInList(const nsTArray<GfxDriverInfo>& info,
continue;
}
-#if defined(XP_WIN) || defined(ANDROID)
+#ifdef XP_WIN
switch (info[i].mComparisonOp) {
case DRIVER_LESS_THAN:
match = driverVersion < info[i].mDriverVersion;
diff --git a/widget/InProcessCompositorWidget.cpp b/widget/InProcessCompositorWidget.cpp
index 9b301fc48..df7250d9f 100644
--- a/widget/InProcessCompositorWidget.cpp
+++ b/widget/InProcessCompositorWidget.cpp
@@ -5,10 +5,6 @@
#include "InProcessCompositorWidget.h"
#include "nsBaseWidget.h"
-#if defined(MOZ_WIDGET_ANDROID) && !defined(MOZ_WIDGET_SUPPORTS_OOP_COMPOSITING)
-#include "mozilla/widget/AndroidCompositorWidget.h"
-#endif
-
namespace mozilla {
namespace widget {
@@ -19,11 +15,7 @@ namespace widget {
CompositorWidget::CreateLocal(const CompositorWidgetInitData& aInitData, nsIWidget* aWidget)
{
MOZ_ASSERT(aWidget);
-#ifdef MOZ_WIDGET_ANDROID
- return new AndroidCompositorWidget(static_cast<nsBaseWidget*>(aWidget));
-#else
return new InProcessCompositorWidget(static_cast<nsBaseWidget*>(aWidget));
-#endif
}
#endif
diff --git a/widget/NativeKeyToDOMCodeName.h b/widget/NativeKeyToDOMCodeName.h
index cd326a0d8..159b0773c 100644
--- a/widget/NativeKeyToDOMCodeName.h
+++ b/widget/NativeKeyToDOMCodeName.h
@@ -21,8 +21,6 @@
#define CODE_MAP_MAC(aCPPCodeName, aNativeKey)
// GTK and Qt on Linux
#define CODE_MAP_X11(aCPPCodeName, aNativeKey)
-// Android and Gonk
-#define CODE_MAP_ANDROID(aCPPCodeName, aNativeKey)
#if defined(XP_WIN)
#undef CODE_MAP_WIN
@@ -42,780 +40,613 @@
#define CODE_MAP_X11(aCPPCodeName, aNativeKey) \
NS_NATIVE_KEY_TO_DOM_CODE_NAME_INDEX(aNativeKey, \
CODE_NAME_INDEX_##aCPPCodeName)
-#elif defined(ANDROID)
-#undef CODE_MAP_ANDROID
-// aNativeKey is scan code
-#define CODE_MAP_ANDROID(aCPPCodeName, aNativeKey) \
- NS_NATIVE_KEY_TO_DOM_CODE_NAME_INDEX(aNativeKey, \
- CODE_NAME_INDEX_##aCPPCodeName)
#endif
// Writing system keys
CODE_MAP_WIN(Backquote, 0x0029)
CODE_MAP_MAC(Backquote, kVK_ANSI_Grave)
CODE_MAP_X11(Backquote, 0x0031)
-CODE_MAP_ANDROID(Backquote, 0x0029)
CODE_MAP_WIN(Backslash, 0x002B)
CODE_MAP_MAC(Backslash, kVK_ANSI_Backslash)
CODE_MAP_X11(Backslash, 0x0033)
-CODE_MAP_ANDROID(Backslash, 0x002B)
CODE_MAP_WIN(Backspace, 0x000E)
CODE_MAP_MAC(Backspace, kVK_Delete)
CODE_MAP_X11(Backspace, 0x0016)
-CODE_MAP_ANDROID(Backspace, 0x000E)
CODE_MAP_WIN(BracketLeft, 0x001A)
CODE_MAP_MAC(BracketLeft, kVK_ANSI_LeftBracket)
CODE_MAP_X11(BracketLeft, 0x0022)
-CODE_MAP_ANDROID(BracketLeft, 0x001A)
CODE_MAP_WIN(BracketRight, 0x001B)
CODE_MAP_MAC(BracketRight, kVK_ANSI_RightBracket)
CODE_MAP_X11(BracketRight, 0x0023)
-CODE_MAP_ANDROID(BracketRight, 0x001B)
CODE_MAP_WIN(Comma, 0x0033)
CODE_MAP_MAC(Comma, kVK_ANSI_Comma)
CODE_MAP_X11(Comma, 0x003B)
-CODE_MAP_ANDROID(Comma, 0x00033)
CODE_MAP_WIN(Digit0, 0x000B)
CODE_MAP_MAC(Digit0, kVK_ANSI_0)
CODE_MAP_X11(Digit0, 0x0013)
-CODE_MAP_ANDROID(Digit0, 0x000B)
CODE_MAP_WIN(Digit1, 0x0002)
CODE_MAP_MAC(Digit1, kVK_ANSI_1)
CODE_MAP_X11(Digit1, 0x000A)
-CODE_MAP_ANDROID(Digit1, 0x0002)
CODE_MAP_WIN(Digit2, 0x0003)
CODE_MAP_MAC(Digit2, kVK_ANSI_2)
CODE_MAP_X11(Digit2, 0x000B)
-CODE_MAP_ANDROID(Digit2, 0x0003)
CODE_MAP_WIN(Digit3, 0x0004)
CODE_MAP_MAC(Digit3, kVK_ANSI_3)
CODE_MAP_X11(Digit3, 0x000C)
-CODE_MAP_ANDROID(Digit3, 0x0004)
CODE_MAP_WIN(Digit4, 0x0005)
CODE_MAP_MAC(Digit4, kVK_ANSI_4)
CODE_MAP_X11(Digit4, 0x000D)
-CODE_MAP_ANDROID(Digit4, 0x0005)
CODE_MAP_WIN(Digit5, 0x0006)
CODE_MAP_MAC(Digit5, kVK_ANSI_5)
CODE_MAP_X11(Digit5, 0x000E)
-CODE_MAP_ANDROID(Digit5, 0x0006)
CODE_MAP_WIN(Digit6, 0x0007)
CODE_MAP_MAC(Digit6, kVK_ANSI_6)
CODE_MAP_X11(Digit6, 0x000F)
-CODE_MAP_ANDROID(Digit6, 0x0007)
CODE_MAP_WIN(Digit7, 0x0008)
CODE_MAP_MAC(Digit7, kVK_ANSI_7)
CODE_MAP_X11(Digit7, 0x0010)
-CODE_MAP_ANDROID(Digit7, 0x0008)
CODE_MAP_WIN(Digit8, 0x0009)
CODE_MAP_MAC(Digit8, kVK_ANSI_8)
CODE_MAP_X11(Digit8, 0x0011)
-CODE_MAP_ANDROID(Digit8, 0x0009)
CODE_MAP_WIN(Digit9, 0x000A)
CODE_MAP_MAC(Digit9, kVK_ANSI_9)
CODE_MAP_X11(Digit9, 0x0012)
-CODE_MAP_ANDROID(Digit9, 0x000A)
CODE_MAP_WIN(Equal, 0x000D)
CODE_MAP_MAC(Equal, kVK_ANSI_Equal)
CODE_MAP_X11(Equal, 0x0015)
-CODE_MAP_ANDROID(Equal, 0x000D)
CODE_MAP_WIN(IntlBackslash, 0x0056)
CODE_MAP_MAC(IntlBackslash, kVK_ISO_Section)
CODE_MAP_X11(IntlBackslash, 0x005E)
-CODE_MAP_ANDROID(IntlBackslash, 0x0056)
// Win: IntlHash's scan code is shared with "Backslash" key.
// Mac: IntlHash's virtual key code is shared with "Backslash" key.
// X11: IntlHash's scan code is shared with "Backslash" key.
-// Android: IntlHash's scan code is shared with "Backslash" key.
CODE_MAP_WIN(IntlRo, 0x0073)
CODE_MAP_MAC(IntlRo, kVK_JIS_Underscore)
CODE_MAP_X11(IntlRo, 0x0061)
-CODE_MAP_ANDROID(IntlRo, 0x0059)
CODE_MAP_WIN(IntlYen, 0x007D)
CODE_MAP_MAC(IntlYen, kVK_JIS_Yen)
CODE_MAP_X11(IntlYen, 0x0084)
-CODE_MAP_ANDROID(IntlYen, 0x007C)
CODE_MAP_WIN(KeyA, 0x001E)
CODE_MAP_MAC(KeyA, kVK_ANSI_A)
CODE_MAP_X11(KeyA, 0x0026)
-CODE_MAP_ANDROID(KeyA, 0x001E)
CODE_MAP_WIN(KeyB, 0x0030)
CODE_MAP_MAC(KeyB, kVK_ANSI_B)
CODE_MAP_X11(KeyB, 0x0038)
-CODE_MAP_ANDROID(KeyB, 0x0030)
CODE_MAP_WIN(KeyC, 0x002E)
CODE_MAP_MAC(KeyC, kVK_ANSI_C)
CODE_MAP_X11(KeyC, 0x0036)
-CODE_MAP_ANDROID(KeyC, 0x002E)
CODE_MAP_WIN(KeyD, 0x0020)
CODE_MAP_MAC(KeyD, kVK_ANSI_D)
CODE_MAP_X11(KeyD, 0x0028)
-CODE_MAP_ANDROID(KeyD, 0x0020)
CODE_MAP_WIN(KeyE, 0x0012)
CODE_MAP_MAC(KeyE, kVK_ANSI_E)
CODE_MAP_X11(KeyE, 0x001A)
-CODE_MAP_ANDROID(KeyE, 0x0012)
CODE_MAP_WIN(KeyF, 0x0021)
CODE_MAP_MAC(KeyF, kVK_ANSI_F)
CODE_MAP_X11(KeyF, 0x0029)
-CODE_MAP_ANDROID(KeyF, 0x0021)
CODE_MAP_WIN(KeyG, 0x0022)
CODE_MAP_MAC(KeyG, kVK_ANSI_G)
CODE_MAP_X11(KeyG, 0x002A)
-CODE_MAP_ANDROID(KeyG, 0x0022)
CODE_MAP_WIN(KeyH, 0x0023)
CODE_MAP_MAC(KeyH, kVK_ANSI_H)
CODE_MAP_X11(KeyH, 0x002B)
-CODE_MAP_ANDROID(KeyH, 0x0023)
CODE_MAP_WIN(KeyI, 0x0017)
CODE_MAP_MAC(KeyI, kVK_ANSI_I)
CODE_MAP_X11(KeyI, 0x001F)
-CODE_MAP_ANDROID(KeyI, 0x0017)
CODE_MAP_WIN(KeyJ, 0x0024)
CODE_MAP_MAC(KeyJ, kVK_ANSI_J)
CODE_MAP_X11(KeyJ, 0x002C)
-CODE_MAP_ANDROID(KeyJ, 0x0024)
CODE_MAP_WIN(KeyK, 0x0025)
CODE_MAP_MAC(KeyK, kVK_ANSI_K)
CODE_MAP_X11(KeyK, 0x002D)
-CODE_MAP_ANDROID(KeyK, 0x0025)
CODE_MAP_WIN(KeyL, 0x0026)
CODE_MAP_MAC(KeyL, kVK_ANSI_L)
CODE_MAP_X11(KeyL, 0x002E)
-CODE_MAP_ANDROID(KeyL, 0x0026)
CODE_MAP_WIN(KeyM, 0x0032)
CODE_MAP_MAC(KeyM, kVK_ANSI_M)
CODE_MAP_X11(KeyM, 0x003A)
-CODE_MAP_ANDROID(KeyM, 0x0032)
CODE_MAP_WIN(KeyN, 0x0031)
CODE_MAP_MAC(KeyN, kVK_ANSI_N)
CODE_MAP_X11(KeyN, 0x0039)
-CODE_MAP_ANDROID(KeyN, 0x0031)
CODE_MAP_WIN(KeyO, 0x0018)
CODE_MAP_MAC(KeyO, kVK_ANSI_O)
CODE_MAP_X11(KeyO, 0x0020)
-CODE_MAP_ANDROID(KeyO, 0x0018)
CODE_MAP_WIN(KeyP, 0x0019)
CODE_MAP_MAC(KeyP, kVK_ANSI_P)
CODE_MAP_X11(KeyP, 0x0021)
-CODE_MAP_ANDROID(KeyP, 0x0019)
CODE_MAP_WIN(KeyQ, 0x0010)
CODE_MAP_MAC(KeyQ, kVK_ANSI_Q)
CODE_MAP_X11(KeyQ, 0x0018)
-CODE_MAP_ANDROID(KeyQ, 0x0010)
CODE_MAP_WIN(KeyR, 0x0013)
CODE_MAP_MAC(KeyR, kVK_ANSI_R)
CODE_MAP_X11(KeyR, 0x001B)
-CODE_MAP_ANDROID(KeyR, 0x0013)
CODE_MAP_WIN(KeyS, 0x001F)
CODE_MAP_MAC(KeyS, kVK_ANSI_S)
CODE_MAP_X11(KeyS, 0x0027)
-CODE_MAP_ANDROID(KeyS, 0x001F)
CODE_MAP_WIN(KeyT, 0x0014)
CODE_MAP_MAC(KeyT, kVK_ANSI_T)
CODE_MAP_X11(KeyT, 0x001C)
-CODE_MAP_ANDROID(KeyT, 0x0014)
CODE_MAP_WIN(KeyU, 0x0016)
CODE_MAP_MAC(KeyU, kVK_ANSI_U)
CODE_MAP_X11(KeyU, 0x001E)
-CODE_MAP_ANDROID(KeyU, 0x0016)
CODE_MAP_WIN(KeyV, 0x002F)
CODE_MAP_MAC(KeyV, kVK_ANSI_V)
CODE_MAP_X11(KeyV, 0x0037)
-CODE_MAP_ANDROID(KeyV, 0x002F)
CODE_MAP_WIN(KeyW, 0x0011)
CODE_MAP_MAC(KeyW, kVK_ANSI_W)
CODE_MAP_X11(KeyW, 0x0019)
-CODE_MAP_ANDROID(KeyW, 0x0011)
CODE_MAP_WIN(KeyX, 0x002D)
CODE_MAP_MAC(KeyX, kVK_ANSI_X)
CODE_MAP_X11(KeyX, 0x0035)
-CODE_MAP_ANDROID(KeyX, 0x002D)
CODE_MAP_WIN(KeyY, 0x0015)
CODE_MAP_MAC(KeyY, kVK_ANSI_Y)
CODE_MAP_X11(KeyY, 0x001D)
-CODE_MAP_ANDROID(KeyY, 0x0015)
CODE_MAP_WIN(KeyZ, 0x002C)
CODE_MAP_MAC(KeyZ, kVK_ANSI_Z)
CODE_MAP_X11(KeyZ, 0x0034)
-CODE_MAP_ANDROID(KeyZ, 0x002C)
CODE_MAP_WIN(Minus, 0x000C)
CODE_MAP_MAC(Minus, kVK_ANSI_Minus)
CODE_MAP_X11(Minus, 0x0014)
-CODE_MAP_ANDROID(Minus, 0x000C)
CODE_MAP_WIN(Period, 0x0034)
CODE_MAP_MAC(Period, kVK_ANSI_Period)
CODE_MAP_X11(Period, 0x003C)
-CODE_MAP_ANDROID(Period, 0x0034)
CODE_MAP_WIN(Quote, 0x0028)
CODE_MAP_MAC(Quote, kVK_ANSI_Quote)
CODE_MAP_X11(Quote, 0x0030)
-CODE_MAP_ANDROID(Quote, 0x0028)
CODE_MAP_WIN(Semicolon, 0x0027)
CODE_MAP_MAC(Semicolon, kVK_ANSI_Semicolon)
CODE_MAP_X11(Semicolon, 0x002F)
-CODE_MAP_ANDROID(Semicolon, 0x0027)
CODE_MAP_WIN(Slash, 0x0035)
CODE_MAP_MAC(Slash, kVK_ANSI_Slash)
CODE_MAP_X11(Slash, 0x003D)
-CODE_MAP_ANDROID(Slash, 0x0035)
// Functional keys
CODE_MAP_WIN(AltLeft, 0x0038)
CODE_MAP_MAC(AltLeft, kVK_Option)
CODE_MAP_X11(AltLeft, 0x0040)
-CODE_MAP_ANDROID(AltLeft, 0x0038)
CODE_MAP_WIN(AltRight, 0xE038)
CODE_MAP_MAC(AltRight, kVK_RightOption)
CODE_MAP_X11(AltRight, 0x006C)
-CODE_MAP_ANDROID(AltRight, 0x0064)
CODE_MAP_WIN(CapsLock, 0x003A)
CODE_MAP_MAC(CapsLock, kVK_CapsLock)
CODE_MAP_X11(CapsLock, 0x0042)
-CODE_MAP_ANDROID(CapsLock, 0x003A)
CODE_MAP_WIN(ContextMenu, 0xE05D)
CODE_MAP_MAC(ContextMenu, kVK_PC_ContextMenu)
CODE_MAP_X11(ContextMenu, 0x0087)
-CODE_MAP_ANDROID(ContextMenu, 0x007F)
CODE_MAP_WIN(ControlLeft, 0x001D)
CODE_MAP_MAC(ControlLeft, kVK_Control)
CODE_MAP_X11(ControlLeft, 0x0025)
-CODE_MAP_ANDROID(ControlLeft, 0x001D)
CODE_MAP_WIN(ControlRight, 0xE01D)
CODE_MAP_MAC(ControlRight, kVK_RightControl)
CODE_MAP_X11(ControlRight, 0x0069)
-CODE_MAP_ANDROID(ControlRight, 0x0061)
CODE_MAP_WIN(Enter, 0x001C)
CODE_MAP_MAC(Enter, kVK_Return)
CODE_MAP_X11(Enter, 0x0024)
-CODE_MAP_ANDROID(Enter, 0x001C)
CODE_MAP_WIN(OSLeft, 0xE05B)
CODE_MAP_MAC(OSLeft, kVK_Command)
CODE_MAP_X11(OSLeft, 0x0085)
-CODE_MAP_ANDROID(OSLeft, 0x007D)
CODE_MAP_WIN(OSRight, 0xE05C)
CODE_MAP_MAC(OSRight, kVK_RightCommand)
CODE_MAP_X11(OSRight, 0x0086)
-CODE_MAP_ANDROID(OSRight, 0x007E)
CODE_MAP_WIN(ShiftLeft, 0x002A)
CODE_MAP_MAC(ShiftLeft, kVK_Shift)
CODE_MAP_X11(ShiftLeft, 0x0032)
-CODE_MAP_ANDROID(ShiftLeft, 0x002A)
CODE_MAP_WIN(ShiftRight, 0x0036)
CODE_MAP_MAC(ShiftRight, kVK_RightShift)
CODE_MAP_X11(ShiftRight, 0x003E)
-CODE_MAP_ANDROID(ShiftRight, 0x0036)
CODE_MAP_WIN(Space, 0x0039)
CODE_MAP_MAC(Space, kVK_Space)
CODE_MAP_X11(Space, 0x0041)
-CODE_MAP_ANDROID(Space, 0x0039)
CODE_MAP_WIN(Tab, 0x000F)
CODE_MAP_MAC(Tab, kVK_Tab)
CODE_MAP_X11(Tab, 0x0017)
-CODE_MAP_ANDROID(Tab, 0x000F)
// IME keys
CODE_MAP_WIN(Convert, 0x0079)
CODE_MAP_X11(Convert, 0x0064)
-CODE_MAP_ANDROID(Convert, 0x005C)
CODE_MAP_WIN(Lang1, 0x0072) // for non-Korean layout
CODE_MAP_WIN(Lang1, 0xE0F2) // for Korean layout
CODE_MAP_MAC(Lang1, kVK_JIS_Kana)
CODE_MAP_X11(Lang1, 0x0082)
-CODE_MAP_ANDROID(Lang1, 0x007A)
CODE_MAP_WIN(Lang2, 0x0071) // for non-Korean layout
CODE_MAP_WIN(Lang2, 0xE0F1) // for Korean layout
CODE_MAP_MAC(Lang2, kVK_JIS_Eisu)
CODE_MAP_X11(Lang2, 0x0083)
-CODE_MAP_ANDROID(Lang2, 0x007B)
CODE_MAP_WIN(KanaMode, 0x0070)
CODE_MAP_X11(KanaMode, 0x0065)
-CODE_MAP_ANDROID(KanaMode, 0x005D)
CODE_MAP_WIN(NonConvert, 0x007B)
CODE_MAP_X11(NonConvert, 0x0066)
-CODE_MAP_ANDROID(NonConvert, 0x005E)
// Control pad section
CODE_MAP_WIN(Delete, 0xE053)
CODE_MAP_MAC(Delete, kVK_ForwardDelete)
CODE_MAP_X11(Delete, 0x0077)
-CODE_MAP_ANDROID(Delete, 0x006F)
CODE_MAP_WIN(End, 0xE04F)
CODE_MAP_MAC(End, kVK_End)
CODE_MAP_X11(End, 0x0073)
-CODE_MAP_ANDROID(End, 0x006B)
CODE_MAP_MAC(Help, kVK_Help) // Insert key on PC keyboard
CODE_MAP_X11(Help, 0x0092) // Help key on Sun keyboard
-CODE_MAP_ANDROID(Help, 0x008A) // Help key on Sun keyboard
CODE_MAP_WIN(Home, 0xE047)
CODE_MAP_MAC(Home, kVK_Home)
CODE_MAP_X11(Home, 0x006E)
-CODE_MAP_ANDROID(Home, 0x0066)
CODE_MAP_WIN(Insert, 0xE052)
CODE_MAP_X11(Insert, 0x0076)
-CODE_MAP_ANDROID(Insert, 0x006E)
CODE_MAP_WIN(PageDown, 0xE051)
CODE_MAP_MAC(PageDown, kVK_PageDown)
CODE_MAP_X11(PageDown, 0x0075)
-CODE_MAP_ANDROID(PageDown, 0x006D)
CODE_MAP_WIN(PageUp, 0xE049)
CODE_MAP_MAC(PageUp, kVK_PageUp)
CODE_MAP_X11(PageUp, 0x0070)
-CODE_MAP_ANDROID(PageUp, 0x0068)
// Arrow pad section
CODE_MAP_WIN(ArrowDown, 0xE050)
CODE_MAP_MAC(ArrowDown, kVK_DownArrow)
CODE_MAP_X11(ArrowDown, 0x0074)
-CODE_MAP_ANDROID(ArrowDown, 0x006C)
CODE_MAP_WIN(ArrowLeft, 0xE04B)
CODE_MAP_MAC(ArrowLeft, kVK_LeftArrow)
CODE_MAP_X11(ArrowLeft, 0x0071)
-CODE_MAP_ANDROID(ArrowLeft, 0x0069)
CODE_MAP_WIN(ArrowRight, 0xE04D)
CODE_MAP_MAC(ArrowRight, kVK_RightArrow)
CODE_MAP_X11(ArrowRight, 0x0072)
-CODE_MAP_ANDROID(ArrowRight, 0x006A)
CODE_MAP_WIN(ArrowUp, 0xE048)
CODE_MAP_MAC(ArrowUp, kVK_UpArrow)
CODE_MAP_X11(ArrowUp, 0x006F)
-CODE_MAP_ANDROID(ArrowUp, 0x0067)
// Numpad section
CODE_MAP_WIN(NumLock, 0xE045) // MSDN says 0x0045, though...
CODE_MAP_MAC(NumLock, kVK_ANSI_KeypadClear)
CODE_MAP_X11(NumLock, 0x004D)
-CODE_MAP_ANDROID(NumLock, 0x0045)
CODE_MAP_WIN(Numpad0, 0x0052)
CODE_MAP_MAC(Numpad0, kVK_ANSI_Keypad0)
CODE_MAP_X11(Numpad0, 0x005A)
-CODE_MAP_ANDROID(Numpad0, 0x0052)
CODE_MAP_WIN(Numpad1, 0x004F)
CODE_MAP_MAC(Numpad1, kVK_ANSI_Keypad1)
CODE_MAP_X11(Numpad1, 0x0057)
-CODE_MAP_ANDROID(Numpad1, 0x004F)
CODE_MAP_WIN(Numpad2, 0x0050)
CODE_MAP_MAC(Numpad2, kVK_ANSI_Keypad2)
CODE_MAP_X11(Numpad2, 0x0058)
-CODE_MAP_ANDROID(Numpad2, 0x0050)
CODE_MAP_WIN(Numpad3, 0x0051)
CODE_MAP_MAC(Numpad3, kVK_ANSI_Keypad3)
CODE_MAP_X11(Numpad3, 0x0059)
-CODE_MAP_ANDROID(Numpad3, 0x0051)
CODE_MAP_WIN(Numpad4, 0x004B)
CODE_MAP_MAC(Numpad4, kVK_ANSI_Keypad4)
CODE_MAP_X11(Numpad4, 0x0053)
-CODE_MAP_ANDROID(Numpad4, 0x004B)
CODE_MAP_WIN(Numpad5, 0x004C)
CODE_MAP_MAC(Numpad5, kVK_ANSI_Keypad5)
CODE_MAP_X11(Numpad5, 0x0054)
-CODE_MAP_ANDROID(Numpad5, 0x004C)
CODE_MAP_WIN(Numpad6, 0x004D)
CODE_MAP_MAC(Numpad6, kVK_ANSI_Keypad6)
CODE_MAP_X11(Numpad6, 0x0055)
-CODE_MAP_ANDROID(Numpad6, 0x004D)
CODE_MAP_WIN(Numpad7, 0x0047)
CODE_MAP_MAC(Numpad7, kVK_ANSI_Keypad7)
CODE_MAP_X11(Numpad7, 0x004F)
-CODE_MAP_ANDROID(Numpad7, 0x0047)
CODE_MAP_WIN(Numpad8, 0x0048)
CODE_MAP_MAC(Numpad8, kVK_ANSI_Keypad8)
CODE_MAP_X11(Numpad8, 0x0050)
-CODE_MAP_ANDROID(Numpad8, 0x0048)
CODE_MAP_WIN(Numpad9, 0x0049)
CODE_MAP_MAC(Numpad9, kVK_ANSI_Keypad9)
CODE_MAP_X11(Numpad9, 0x0051)
-CODE_MAP_ANDROID(Numpad9, 0x0049)
CODE_MAP_WIN(NumpadAdd, 0x004E)
CODE_MAP_MAC(NumpadAdd, kVK_ANSI_KeypadPlus)
CODE_MAP_X11(NumpadAdd, 0x0056)
-CODE_MAP_ANDROID(NumpadAdd, 0x004E)
CODE_MAP_WIN(NumpadComma, 0x007E)
CODE_MAP_MAC(NumpadComma, kVK_JIS_KeypadComma)
CODE_MAP_X11(NumpadComma, 0x0081)
-CODE_MAP_ANDROID(NumpadComma, 0x0079)
CODE_MAP_WIN(NumpadDecimal, 0x0053)
CODE_MAP_MAC(NumpadDecimal, kVK_ANSI_KeypadDecimal)
CODE_MAP_X11(NumpadDecimal, 0x005B)
-CODE_MAP_ANDROID(NumpadDecimal, 0x0053)
CODE_MAP_WIN(NumpadDivide, 0xE035)
CODE_MAP_MAC(NumpadDivide, kVK_ANSI_KeypadDivide)
CODE_MAP_X11(NumpadDivide, 0x006A)
-CODE_MAP_ANDROID(NumpadDivide, 0x0062)
CODE_MAP_WIN(NumpadEnter, 0xE01C)
CODE_MAP_MAC(NumpadEnter, kVK_ANSI_KeypadEnter)
CODE_MAP_MAC(NumpadEnter, kVK_Powerbook_KeypadEnter)
CODE_MAP_X11(NumpadEnter, 0x0068)
-CODE_MAP_ANDROID(NumpadEnter, 0x0060)
CODE_MAP_WIN(NumpadEqual, 0x0059)
CODE_MAP_MAC(NumpadEqual, kVK_ANSI_KeypadEquals)
CODE_MAP_X11(NumpadEqual, 0x007D)
-CODE_MAP_ANDROID(NumpadEqual, 0x0075)
CODE_MAP_WIN(NumpadMultiply, 0x0037)
CODE_MAP_MAC(NumpadMultiply, kVK_ANSI_KeypadMultiply)
CODE_MAP_X11(NumpadMultiply, 0x003F)
-CODE_MAP_ANDROID(NumpadMultiply, 0x0037)
CODE_MAP_WIN(NumpadSubtract, 0x004A)
CODE_MAP_MAC(NumpadSubtract, kVK_ANSI_KeypadMinus)
CODE_MAP_X11(NumpadSubtract, 0x0052)
-CODE_MAP_ANDROID(NumpadSubtract, 0x004A)
// Function section
CODE_MAP_WIN(Escape, 0x0001)
CODE_MAP_MAC(Escape, kVK_Escape)
CODE_MAP_X11(Escape, 0x0009)
-CODE_MAP_ANDROID(Escape, 0x0001)
CODE_MAP_WIN(F1, 0x003B)
CODE_MAP_MAC(F1, kVK_F1)
CODE_MAP_X11(F1, 0x0043)
-CODE_MAP_ANDROID(F1, 0x003B)
CODE_MAP_WIN(F2, 0x003C)
CODE_MAP_MAC(F2, kVK_F2)
CODE_MAP_X11(F2, 0x0044)
-CODE_MAP_ANDROID(F2, 0x003C)
CODE_MAP_WIN(F3, 0x003D)
CODE_MAP_MAC(F3, kVK_F3)
CODE_MAP_X11(F3, 0x0045)
-CODE_MAP_ANDROID(F3, 0x003D)
CODE_MAP_WIN(F4, 0x003E)
CODE_MAP_MAC(F4, kVK_F4)
CODE_MAP_X11(F4, 0x0046)
-CODE_MAP_ANDROID(F4, 0x003E)
CODE_MAP_WIN(F5, 0x003F)
CODE_MAP_MAC(F5, kVK_F5)
CODE_MAP_X11(F5, 0x0047)
-CODE_MAP_ANDROID(F5, 0x003F)
CODE_MAP_WIN(F6, 0x0040)
CODE_MAP_MAC(F6, kVK_F6)
CODE_MAP_X11(F6, 0x0048)
-CODE_MAP_ANDROID(F6, 0x0040)
CODE_MAP_WIN(F7, 0x0041)
CODE_MAP_MAC(F7, kVK_F7)
CODE_MAP_X11(F7, 0x0049)
-CODE_MAP_ANDROID(F7, 0x0041)
CODE_MAP_WIN(F8, 0x0042)
CODE_MAP_MAC(F8, kVK_F8)
CODE_MAP_X11(F8, 0x004A)
-CODE_MAP_ANDROID(F8, 0x0042)
CODE_MAP_WIN(F9, 0x0043)
CODE_MAP_MAC(F9, kVK_F9)
CODE_MAP_X11(F9, 0x004B)
-CODE_MAP_ANDROID(F9, 0x0043)
CODE_MAP_WIN(F10, 0x0044)
CODE_MAP_MAC(F10, kVK_F10)
CODE_MAP_X11(F10, 0x004C)
-CODE_MAP_ANDROID(F10, 0x0044)
CODE_MAP_WIN(F11, 0x0057)
CODE_MAP_MAC(F11, kVK_F11)
CODE_MAP_X11(F11, 0x005F)
-CODE_MAP_ANDROID(F11, 0x0057)
CODE_MAP_WIN(F12, 0x0058)
CODE_MAP_MAC(F12, kVK_F12)
CODE_MAP_X11(F12, 0x0060)
-CODE_MAP_ANDROID(F12, 0x0058)
CODE_MAP_WIN(F13, 0x0064)
CODE_MAP_MAC(F13, kVK_F13) // PrintScreen on PC keyboard
CODE_MAP_X11(F13, 0x00BF)
-CODE_MAP_ANDROID(F13, 0x00B7)
CODE_MAP_WIN(F14, 0x0065)
CODE_MAP_MAC(F14, kVK_F14) // ScrollLock on PC keyboard
CODE_MAP_X11(F14, 0x00C0)
-CODE_MAP_ANDROID(F14, 0x00B8)
CODE_MAP_WIN(F15, 0x0066)
CODE_MAP_MAC(F15, kVK_F15) // Pause on PC keyboard
CODE_MAP_X11(F15, 0x00C1)
-CODE_MAP_ANDROID(F15, 0x00B9)
CODE_MAP_WIN(F16, 0x0067)
CODE_MAP_MAC(F16, kVK_F16)
CODE_MAP_X11(F16, 0x00C2)
-CODE_MAP_ANDROID(F16, 0x00BA)
CODE_MAP_WIN(F17, 0x0068)
CODE_MAP_MAC(F17, kVK_F17)
CODE_MAP_X11(F17, 0x00C3)
-CODE_MAP_ANDROID(F17, 0x00BB)
CODE_MAP_WIN(F18, 0x0069)
CODE_MAP_MAC(F18, kVK_F18)
CODE_MAP_X11(F18, 0x00C4)
-CODE_MAP_ANDROID(F18, 0x00BC)
CODE_MAP_WIN(F19, 0x006A)
CODE_MAP_MAC(F19, kVK_F19)
CODE_MAP_X11(F19, 0x00C5)
-CODE_MAP_ANDROID(F19, 0x00BD)
CODE_MAP_WIN(F20, 0x006B)
CODE_MAP_MAC(F20, kVK_F20)
CODE_MAP_X11(F20, 0x00C6)
-CODE_MAP_ANDROID(F20, 0x00BE)
CODE_MAP_WIN(F21, 0x006C)
CODE_MAP_X11(F21, 0x00C7)
-CODE_MAP_ANDROID(F21, 0x00BF)
CODE_MAP_WIN(F22, 0x006D)
CODE_MAP_X11(F22, 0x00C8)
-CODE_MAP_ANDROID(F22, 0x00C0)
CODE_MAP_WIN(F23, 0x006E)
CODE_MAP_X11(F23, 0x00C9)
-CODE_MAP_ANDROID(F23, 0x00C1)
CODE_MAP_WIN(F24, 0x0076)
CODE_MAP_X11(F24, 0x00CA)
-CODE_MAP_ANDROID(F24, 0x00C2)
CODE_MAP_MAC(Fn, kVK_Function) // not available?
-CODE_MAP_ANDROID(Fn, 0x01D0)
CODE_MAP_WIN(PrintScreen, 0xE037)
CODE_MAP_WIN(PrintScreen, 0x0054) // Alt + PrintScreen
CODE_MAP_X11(PrintScreen, 0x006B)
-CODE_MAP_ANDROID(PrintScreen, 0x0063)
CODE_MAP_WIN(ScrollLock, 0x0046)
CODE_MAP_X11(ScrollLock, 0x004E)
-CODE_MAP_ANDROID(ScrollLock, 0x0046)
CODE_MAP_WIN(Pause, 0x0045)
CODE_MAP_WIN(Pause, 0xE046) // Ctrl + Pause
CODE_MAP_X11(Pause, 0x007F)
-CODE_MAP_ANDROID(Pause, 0x0077)
// Media keys
CODE_MAP_WIN(BrowserBack, 0xE06A)
CODE_MAP_X11(BrowserBack, 0x00A6)
-CODE_MAP_ANDROID(BrowserBack, 0x009E)
CODE_MAP_WIN(BrowserFavorites, 0xE066)
CODE_MAP_X11(BrowserFavorites, 0x00A4)
-CODE_MAP_ANDROID(BrowserFavorites, 0x009C)
CODE_MAP_WIN(BrowserForward, 0xE069)
CODE_MAP_X11(BrowserForward, 0x00A7)
-CODE_MAP_ANDROID(BrowserForward, 0x009F)
CODE_MAP_WIN(BrowserHome, 0xE032)
CODE_MAP_X11(BrowserHome, 0x00B4)
-// CODE_MAP_ANDROID(BrowserHome) // not available? works as Home key.
CODE_MAP_WIN(BrowserRefresh, 0xE067)
CODE_MAP_X11(BrowserRefresh, 0x00B5)
-CODE_MAP_ANDROID(BrowserRefresh, 0x00AD)
CODE_MAP_WIN(BrowserSearch, 0xE065)
CODE_MAP_X11(BrowserSearch, 0x00E1)
-CODE_MAP_ANDROID(BrowserSearch, 0x00D9)
CODE_MAP_WIN(BrowserStop, 0xE068)
CODE_MAP_X11(BrowserStop, 0x0088)
-CODE_MAP_ANDROID(BrowserStop, 0x0080)
// CODE_MAP_WIN(Eject) // not available?
// CODE_MAP_MAC(Eject) // not available?
CODE_MAP_X11(Eject, 0x00A9)
-CODE_MAP_ANDROID(Eject, 0x00A1)
CODE_MAP_WIN(LaunchApp1, 0xE06B)
CODE_MAP_X11(LaunchApp1, 0x0098)
-CODE_MAP_ANDROID(LaunchApp1, 0x0090)
CODE_MAP_WIN(LaunchApp2, 0xE021)
CODE_MAP_X11(LaunchApp2, 0x0094)
-// CODE_MAP_ANDROID(LaunchApp2) // not available?
CODE_MAP_WIN(LaunchMail, 0xE06C)
CODE_MAP_X11(LaunchMail, 0x00A3)
-// CODE_MAP_ANDROID(LaunchMail) // not available?
CODE_MAP_WIN(MediaPlayPause, 0xE022)
CODE_MAP_X11(MediaPlayPause, 0x00AC)
-CODE_MAP_ANDROID(MediaPlayPause, 0x00A4)
CODE_MAP_WIN(MediaSelect, 0xE06D)
CODE_MAP_X11(MediaSelect, 0x00B3)
-// CODE_MAP_ANDROID(MediaSelect) // not available?
CODE_MAP_WIN(MediaStop, 0xE024)
CODE_MAP_X11(MediaStop, 0x00AE)
-CODE_MAP_ANDROID(MediaStop, 0x00A6)
CODE_MAP_WIN(MediaTrackNext, 0xE019)
CODE_MAP_X11(MediaTrackNext, 0x00AB)
-CODE_MAP_ANDROID(MediaTrackNext, 0x00A3)
CODE_MAP_WIN(MediaTrackPrevious, 0xE010)
CODE_MAP_X11(MediaTrackPrevious, 0x00AD)
-CODE_MAP_ANDROID(MediaTrackPrevious, 0x00A5)
CODE_MAP_WIN(Power, 0xE05E)
CODE_MAP_MAC(Power, 0x007F) // On 10.7 and 10.8 only
// CODE_MAP_X11(Power) // not available?
-CODE_MAP_ANDROID(Power, 0x0074)
// CODE_MAP_WIN(Sleep) // not available?
// CODE_MAP_X11(Sleep) // not available?
-CODE_MAP_ANDROID(Sleep, 0x008E)
CODE_MAP_WIN(VolumeDown, 0xE02E)
CODE_MAP_MAC(VolumeDown, kVK_VolumeDown) // not available?
CODE_MAP_X11(VolumeDown, 0x007A)
-CODE_MAP_ANDROID(VolumeDown, 0x0072)
CODE_MAP_WIN(VolumeMute, 0xE020)
CODE_MAP_MAC(VolumeMute, kVK_Mute) // not available?
CODE_MAP_X11(VolumeMute, 0x0079)
-CODE_MAP_ANDROID(VolumeMute, 0x0071)
CODE_MAP_WIN(VolumeUp, 0xE030)
CODE_MAP_MAC(VolumeUp, kVK_VolumeUp) // not available?
CODE_MAP_X11(VolumeUp, 0x007B)
-CODE_MAP_ANDROID(VolumeUp, 0x0073) // side of body, not on keyboard
// CODE_MAP_WIN(WakeUp) // not available?
CODE_MAP_X11(WakeUp, 0x0097)
-CODE_MAP_ANDROID(WakeUp, 0x008F)
// Legacy editing keys
CODE_MAP_X11(Again, 0x0089) // Again key on Sun keyboard
-CODE_MAP_ANDROID(Again, 0x0081) // Again key on Sun keyboard
CODE_MAP_X11(Copy, 0x008D) // Copy key on Sun keyboard
-CODE_MAP_ANDROID(Copy, 0x0085) // Copy key on Sun keyboard
CODE_MAP_X11(Cut, 0x0091) // Cut key on Sun keyboard
-CODE_MAP_ANDROID(Cut, 0x0089) // Cut key on Sun keyboard
CODE_MAP_X11(Find, 0x0090) // Find key on Sun keyboard
-CODE_MAP_ANDROID(Find, 0x0088) // Find key on Sun keyboard
CODE_MAP_X11(Open, 0x008E) // Open key on Sun keyboard
-CODE_MAP_ANDROID(Open, 0x0086) // Open key on Sun keyboard
CODE_MAP_X11(Paste, 0x008F) // Paste key on Sun keyboard
-CODE_MAP_ANDROID(Paste, 0x0087) // Paste key on Sun keyboard
CODE_MAP_X11(Props, 0x008A) // Props key on Sun keyboard
-CODE_MAP_ANDROID(Props, 0x0082) // Props key on Sun keyboard
CODE_MAP_X11(Select, 0x008C) // Front key on Sun keyboard
-CODE_MAP_ANDROID(Select, 0x0084) // Front key on Sun keyboard
CODE_MAP_X11(Undo, 0x008B) // Undo key on Sun keyboard
-CODE_MAP_ANDROID(Undo, 0x0083) // Undo key on Sun keyboard
#undef CODE_MAP_WIN
#undef CODE_MAP_MAC
#undef CODE_MAP_X11
-#undef CODE_MAP_ANDROID
diff --git a/widget/NativeKeyToDOMKeyName.h b/widget/NativeKeyToDOMKeyName.h
index a818108db..ce1e3c3a4 100644
--- a/widget/NativeKeyToDOMKeyName.h
+++ b/widget/NativeKeyToDOMKeyName.h
@@ -25,7 +25,6 @@
#define KEY_MAP_COCOA(aCPPKeyName, aNativeKey)
// GTK
#define KEY_MAP_GTK(aCPPKeyName, aNativeKey)
-#define KEY_MAP_ANDROID(aCPPKeyName, aNativeKey)
#if defined(XP_WIN)
#if defined(NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX)
@@ -71,10 +70,6 @@
#undef KEY_MAP_GTK
#define KEY_MAP_GTK(aCPPKeyName, aNativeKey) \
NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, KEY_NAME_INDEX_##aCPPKeyName)
-#elif defined(ANDROID)
-#undef KEY_MAP_ANDROID
-#define KEY_MAP_ANDROID(aCPPKeyName, aNativeKey) \
- NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, KEY_NAME_INDEX_##aCPPKeyName)
#endif
/******************************************************************************
@@ -88,8 +83,6 @@ KEY_MAP_COCOA (Alt, kVK_Option)
KEY_MAP_COCOA (Alt, kVK_RightOption)
KEY_MAP_GTK (Alt, GDK_Alt_L)
KEY_MAP_GTK (Alt, GDK_Alt_R)
-KEY_MAP_ANDROID (Alt, AKEYCODE_ALT_LEFT)
-KEY_MAP_ANDROID (Alt, AKEYCODE_ALT_RIGHT)
// AltGraph
KEY_MAP_GTK (AltGraph, GDK_Mode_switch /* same as GDK_kana_switch,
@@ -109,7 +102,6 @@ KEY_MAP_GTK (AltGraph, GDK_ISO_Level5_Lock)
KEY_MAP_WIN (CapsLock, VK_CAPITAL)
KEY_MAP_COCOA (CapsLock, kVK_CapsLock)
KEY_MAP_GTK (CapsLock, GDK_Caps_Lock)
-KEY_MAP_ANDROID (CapsLock, AKEYCODE_CAPS_LOCK)
// Control
KEY_MAP_WIN (Control, VK_CONTROL)
@@ -119,25 +111,19 @@ KEY_MAP_COCOA (Control, kVK_Control)
KEY_MAP_COCOA (Control, kVK_RightControl)
KEY_MAP_GTK (Control, GDK_Control_L)
KEY_MAP_GTK (Control, GDK_Control_R)
-KEY_MAP_ANDROID (Control, AKEYCODE_CTRL_LEFT)
-KEY_MAP_ANDROID (Control, AKEYCODE_CTRL_RIGHT)
// Fn
KEY_MAP_COCOA (Fn, kVK_Function)
-KEY_MAP_ANDROID (Fn, AKEYCODE_FUNCTION)
// Meta
KEY_MAP_COCOA (Meta, kVK_Command)
KEY_MAP_COCOA (Meta, kVK_RightCommand)
KEY_MAP_GTK (Meta, GDK_Meta_L)
KEY_MAP_GTK (Meta, GDK_Meta_R)
-KEY_MAP_ANDROID (Meta, AKEYCODE_META_LEFT)
-KEY_MAP_ANDROID (Meta, AKEYCODE_META_RIGHT)
// NumLock
KEY_MAP_WIN (NumLock, VK_NUMLOCK)
KEY_MAP_GTK (NumLock, GDK_Num_Lock)
-KEY_MAP_ANDROID (NumLock, AKEYCODE_NUM_LOCK)
// OS
KEY_MAP_WIN (OS, VK_LWIN)
@@ -150,7 +136,6 @@ KEY_MAP_GTK (OS, GDK_Hyper_R)
// ScrollLock
KEY_MAP_WIN (ScrollLock, VK_SCROLL)
KEY_MAP_GTK (ScrollLock, GDK_Scroll_Lock)
-KEY_MAP_ANDROID (ScrollLock, AKEYCODE_SCROLL_LOCK)
// Shift
KEY_MAP_WIN (Shift, VK_SHIFT)
@@ -161,11 +146,8 @@ KEY_MAP_COCOA (Shift, kVK_RightShift)
KEY_MAP_GTK (Shift, GDK_Shift_L)
KEY_MAP_GTK (Shift, GDK_Shift_R)
KEY_MAP_GTK (Shift, GDK_Shift_Lock) // Let's treat as Shift key (bug 769159)
-KEY_MAP_ANDROID (Shift, AKEYCODE_SHIFT_LEFT)
-KEY_MAP_ANDROID (Shift, AKEYCODE_SHIFT_RIGHT)
// Symbol
-KEY_MAP_ANDROID (Symbol, AKEYCODE_SYM)
/******************************************************************************
* Whitespace Keys
@@ -179,8 +161,6 @@ KEY_MAP_GTK (Enter, GDK_Return)
KEY_MAP_GTK (Enter, GDK_KP_Enter)
KEY_MAP_GTK (Enter, GDK_ISO_Enter)
KEY_MAP_GTK (Enter, GDK_3270_Enter)
-KEY_MAP_ANDROID (Enter, AKEYCODE_ENTER)
-KEY_MAP_ANDROID (Enter, AKEYCODE_NUMPAD_ENTER)
// Tab
KEY_MAP_WIN (Tab, VK_TAB)
@@ -188,7 +168,6 @@ KEY_MAP_COCOA (Tab, kVK_Tab)
KEY_MAP_GTK (Tab, GDK_Tab)
KEY_MAP_GTK (Tab, GDK_ISO_Left_Tab) // Shift+Tab
KEY_MAP_GTK (Tab, GDK_KP_Tab)
-KEY_MAP_ANDROID (Tab, AKEYCODE_TAB)
/******************************************************************************
* Navigation Keys
@@ -198,56 +177,48 @@ KEY_MAP_WIN (ArrowDown, VK_DOWN)
KEY_MAP_COCOA (ArrowDown, kVK_DownArrow)
KEY_MAP_GTK (ArrowDown, GDK_Down)
KEY_MAP_GTK (ArrowDown, GDK_KP_Down)
-KEY_MAP_ANDROID (ArrowDown, AKEYCODE_DPAD_DOWN)
// ArrowLeft
KEY_MAP_WIN (ArrowLeft, VK_LEFT)
KEY_MAP_COCOA (ArrowLeft, kVK_LeftArrow)
KEY_MAP_GTK (ArrowLeft, GDK_Left)
KEY_MAP_GTK (ArrowLeft, GDK_KP_Left)
-KEY_MAP_ANDROID (ArrowLeft, AKEYCODE_DPAD_LEFT)
// ArrowRight
KEY_MAP_WIN (ArrowRight, VK_RIGHT)
KEY_MAP_COCOA (ArrowRight, kVK_RightArrow)
KEY_MAP_GTK (ArrowRight, GDK_Right)
KEY_MAP_GTK (ArrowRight, GDK_KP_Right)
-KEY_MAP_ANDROID (ArrowRight, AKEYCODE_DPAD_RIGHT)
// ArrowUp
KEY_MAP_WIN (ArrowUp, VK_UP)
KEY_MAP_COCOA (ArrowUp, kVK_UpArrow)
KEY_MAP_GTK (ArrowUp, GDK_Up)
KEY_MAP_GTK (ArrowUp, GDK_KP_Up)
-KEY_MAP_ANDROID (ArrowUp, AKEYCODE_DPAD_UP)
// End
KEY_MAP_WIN (End, VK_END)
KEY_MAP_COCOA (End, kVK_End)
KEY_MAP_GTK (End, GDK_End)
KEY_MAP_GTK (End, GDK_KP_End)
-KEY_MAP_ANDROID (End, AKEYCODE_MOVE_END)
// Home
KEY_MAP_WIN (Home, VK_HOME)
KEY_MAP_COCOA (Home, kVK_Home)
KEY_MAP_GTK (Home, GDK_Home)
KEY_MAP_GTK (Home, GDK_KP_Home)
-KEY_MAP_ANDROID (Home, AKEYCODE_MOVE_HOME)
// PageDown
KEY_MAP_WIN (PageDown, VK_NEXT)
KEY_MAP_COCOA (PageDown, kVK_PageDown)
KEY_MAP_GTK (PageDown, GDK_Page_Down /* same as GDK_Next */)
KEY_MAP_GTK (PageDown, GDK_KP_Page_Down /* same as GDK_KP_Next */)
-KEY_MAP_ANDROID (PageDown, AKEYCODE_PAGE_DOWN)
// PageUp
KEY_MAP_WIN (PageUp, VK_PRIOR)
KEY_MAP_COCOA (PageUp, kVK_PageUp)
KEY_MAP_GTK (PageUp, GDK_Page_Up /* same as GDK_Prior */)
KEY_MAP_GTK (PageUp, GDK_KP_Page_Up /* same as GDK_KP_Prior */)
-KEY_MAP_ANDROID (PageUp, AKEYCODE_PAGE_UP)
/******************************************************************************
* Editing Keys
@@ -256,14 +227,12 @@ KEY_MAP_ANDROID (PageUp, AKEYCODE_PAGE_UP)
KEY_MAP_WIN (Backspace, VK_BACK)
KEY_MAP_COCOA (Backspace, kVK_PC_Backspace)
KEY_MAP_GTK (Backspace, GDK_BackSpace)
-KEY_MAP_ANDROID (Backspace, AKEYCODE_DEL)
// Clear
KEY_MAP_WIN (Clear, VK_CLEAR)
KEY_MAP_WIN (Clear, VK_OEM_CLEAR)
KEY_MAP_COCOA (Clear, kVK_ANSI_KeypadClear)
KEY_MAP_GTK (Clear, GDK_Clear)
-KEY_MAP_ANDROID (Clear, AKEYCODE_CLEAR)
// Copy
KEY_MAP_WIN_CMD (Copy, APPCOMMAND_COPY)
@@ -282,7 +251,6 @@ KEY_MAP_WIN (Delete, VK_DELETE)
KEY_MAP_COCOA (Delete, kVK_PC_Delete)
KEY_MAP_GTK (Delete, GDK_Delete)
KEY_MAP_GTK (Delete, GDK_KP_Delete)
-KEY_MAP_ANDROID (Delete, AKEYCODE_FORWARD_DEL)
// EraseEof
KEY_MAP_WIN (EraseEof, VK_EREOF)
@@ -296,7 +264,6 @@ KEY_MAP_GTK (ExSel, GDK_3270_ExSelect) // legacy IBM keyboard layout
KEY_MAP_WIN (Insert, VK_INSERT)
KEY_MAP_GTK (Insert, GDK_Insert)
KEY_MAP_GTK (Insert, GDK_KP_Insert)
-KEY_MAP_ANDROID (Insert, AKEYCODE_INSERT)
// Paste
KEY_MAP_WIN_CMD (Paste, APPCOMMAND_PASTE)
@@ -315,7 +282,6 @@ KEY_MAP_GTK (Undo, GDK_Undo)
******************************************************************************/
// Accept
KEY_MAP_WIN (Accept, VK_ACCEPT)
-KEY_MAP_ANDROID (Accept, AKEYCODE_DPAD_CENTER)
// Attn
KEY_MAP_WIN_OTH (Attn, VK_ATTN) // not valid with Japanese keyboard layout
@@ -329,13 +295,11 @@ KEY_MAP_GTK (Cancel, GDK_Cancel)
KEY_MAP_WIN (ContextMenu, VK_APPS)
KEY_MAP_COCOA (ContextMenu, kVK_PC_ContextMenu)
KEY_MAP_GTK (ContextMenu, GDK_Menu)
-KEY_MAP_ANDROID (ContextMenu, AKEYCODE_MENU)
// Escape
KEY_MAP_WIN (Escape, VK_ESCAPE)
KEY_MAP_COCOA (Escape, kVK_Escape)
KEY_MAP_GTK (Escape, GDK_Escape)
-KEY_MAP_ANDROID (Escape, AKEYCODE_ESCAPE)
// Execute
KEY_MAP_WIN (Execute, VK_EXECUTE)
@@ -350,14 +314,12 @@ KEY_MAP_WIN (Help, VK_HELP)
KEY_MAP_WIN_CMD (Help, APPCOMMAND_HELP)
KEY_MAP_COCOA (Help, kVK_Help)
KEY_MAP_GTK (Help, GDK_Help)
-KEY_MAP_ANDROID (Help, AKEYCODE_ASSIST)
// Pause
KEY_MAP_WIN (Pause, VK_PAUSE)
KEY_MAP_GTK (Pause, GDK_Pause)
// Break is typically mapped to Alt+Pause or Ctrl+Pause on GTK.
KEY_MAP_GTK (Pause, GDK_Break)
-KEY_MAP_ANDROID (Pause, AKEYCODE_BREAK)
// Play
KEY_MAP_WIN (Play, VK_PLAY)
@@ -369,11 +331,9 @@ KEY_MAP_GTK (Select, GDK_Select)
// ZoomIn
KEY_MAP_GTK (ZoomIn, GDK_ZoomIn)
-KEY_MAP_ANDROID (ZoomIn, AKEYCODE_ZOOM_IN)
// ZoomOut
KEY_MAP_GTK (ZoomOut, GDK_ZoomOut)
-KEY_MAP_ANDROID (ZoomOut, AKEYCODE_ZOOM_OUT)
/******************************************************************************
* Device Keys
@@ -386,13 +346,11 @@ KEY_MAP_GTK (BrightnessUp, GDK_MonBrightnessUp)
// Eject
KEY_MAP_GTK (Eject, GDK_Eject)
-KEY_MAP_ANDROID (Eject, AKEYCODE_MEDIA_EJECT)
// LogOff
KEY_MAP_GTK (LogOff, GDK_LogOff)
// Power
-KEY_MAP_ANDROID (Power, AKEYCODE_POWER)
// PowerOff
KEY_MAP_GTK (PowerOff, GDK_PowerDown)
@@ -403,7 +361,6 @@ KEY_MAP_WIN (PrintScreen, VK_SNAPSHOT)
KEY_MAP_GTK (PrintScreen, GDK_3270_PrintScreen)
KEY_MAP_GTK (PrintScreen, GDK_Print)
KEY_MAP_GTK (PrintScreen, GDK_Sys_Req)
-KEY_MAP_ANDROID (PrintScreen, AKEYCODE_SYSRQ)
// Hibernate
KEY_MAP_GTK (Hibernate, GDK_Hibernate)
@@ -437,7 +394,6 @@ KEY_MAP_GTK (Compose, GDK_Multi_key) // "Multi Key" is "Compose key" on X
// Convert
KEY_MAP_WIN (Convert, VK_CONVERT)
KEY_MAP_GTK (Convert, GDK_Henkan)
-KEY_MAP_ANDROID (Convert, AKEYCODE_HENKAN)
// Dead
KEY_MAP_GTK (Dead, GDK_dead_grave)
@@ -497,19 +453,16 @@ KEY_MAP_GTK (GroupLast, GDK_ISO_Last_Group)
// GroupNext
KEY_MAP_GTK (GroupNext, GDK_ISO_Next_Group)
-KEY_MAP_ANDROID (GroupNext, AKEYCODE_LANGUAGE_SWITCH)
// GroupPrevious
KEY_MAP_GTK (GroupPrevious, GDK_ISO_Prev_Group)
// ModeChange
KEY_MAP_WIN (ModeChange, VK_MODECHANGE)
-KEY_MAP_ANDROID (ModeChange, AKEYCODE_SWITCH_CHARSET)
// NonConvert
KEY_MAP_WIN (NonConvert, VK_NONCONVERT)
KEY_MAP_GTK (NonConvert, GDK_Muhenkan)
-KEY_MAP_ANDROID (NonConvert, AKEYCODE_MUHENKAN)
// PreviousCandidate
KEY_MAP_GTK (PreviousCandidate, GDK_PreviousCandidate) // OADG 109, Mae Koho
@@ -534,7 +487,6 @@ KEY_MAP_WIN (JunjaMode, VK_JUNJA)
******************************************************************************/
// Eisu
KEY_MAP_COCOA (Eisu, kVK_JIS_Eisu)
-KEY_MAP_ANDROID (Eisu, AKEYCODE_EISU)
// Hankaku
KEY_MAP_WIN_JPN (Hankaku, VK_OEM_AUTO)
@@ -546,7 +498,6 @@ KEY_MAP_GTK (Hiragana, GDK_Hiragana)
// HiraganaKatakana
KEY_MAP_GTK (HiraganaKatakana, GDK_Hiragana_Katakana)
-KEY_MAP_ANDROID (HiraganaKatakana, AKEYCODE_KATAKANA_HIRAGANA)
// KanaMode
// VK_KANA is never used with modern Japanese keyboard, however, IE maps it to
@@ -560,8 +511,6 @@ KEY_MAP_GTK (KanaMode, GDK_Kana_Shift)
KEY_MAP_WIN_JPN (KanjiMode, VK_KANJI /* same as VK_HANJA */)
KEY_MAP_COCOA (KanjiMode, kVK_JIS_Kana) // Kana key opens IME
KEY_MAP_GTK (KanjiMode, GDK_Kanji) // Typically, Alt + Hankaku/Zenkaku key
-// Assuming that KANA key of Android is the Kana key on Mac keyboard.
-KEY_MAP_ANDROID (KanjiMode, AKEYCODE_KANA)
// Katakana
KEY_MAP_WIN_JPN (Katakana, VK_OEM_FINISH)
@@ -577,7 +526,6 @@ KEY_MAP_GTK (Zenkaku, GDK_Zenkaku)
// ZenkakuHankaku
KEY_MAP_GTK (ZenkakuHankaku, GDK_Zenkaku_Hankaku)
-KEY_MAP_ANDROID (ZenkakuHankaku, AKEYCODE_ZENKAKU_HANKAKU)
/******************************************************************************
* General-Purpose Function Keys
@@ -587,76 +535,64 @@ KEY_MAP_WIN (F1, VK_F1)
KEY_MAP_COCOA (F1, kVK_F1)
KEY_MAP_GTK (F1, GDK_F1)
KEY_MAP_GTK (F1, GDK_KP_F1)
-KEY_MAP_ANDROID (F1, AKEYCODE_F1)
// F2
KEY_MAP_WIN (F2, VK_F2)
KEY_MAP_COCOA (F2, kVK_F2)
KEY_MAP_GTK (F2, GDK_F2)
KEY_MAP_GTK (F2, GDK_KP_F2)
-KEY_MAP_ANDROID (F2, AKEYCODE_F2)
// F3
KEY_MAP_WIN (F3, VK_F3)
KEY_MAP_COCOA (F3, kVK_F3)
KEY_MAP_GTK (F3, GDK_F3)
KEY_MAP_GTK (F3, GDK_KP_F3)
-KEY_MAP_ANDROID (F3, AKEYCODE_F3)
// F4
KEY_MAP_WIN (F4, VK_F4)
KEY_MAP_COCOA (F4, kVK_F4)
KEY_MAP_GTK (F4, GDK_F4)
KEY_MAP_GTK (F4, GDK_KP_F4)
-KEY_MAP_ANDROID (F4, AKEYCODE_F4)
// F5
KEY_MAP_WIN (F5, VK_F5)
KEY_MAP_COCOA (F5, kVK_F5)
KEY_MAP_GTK (F5, GDK_F5)
-KEY_MAP_ANDROID (F5, AKEYCODE_F5)
// F6
KEY_MAP_WIN (F6, VK_F6)
KEY_MAP_COCOA (F6, kVK_F6)
KEY_MAP_GTK (F6, GDK_F6)
-KEY_MAP_ANDROID (F6, AKEYCODE_F6)
// F7
KEY_MAP_WIN (F7, VK_F7)
KEY_MAP_COCOA (F7, kVK_F7)
KEY_MAP_GTK (F7, GDK_F7)
-KEY_MAP_ANDROID (F7, AKEYCODE_F7)
// F8
KEY_MAP_WIN (F8, VK_F8)
KEY_MAP_COCOA (F8, kVK_F8)
KEY_MAP_GTK (F8, GDK_F8)
-KEY_MAP_ANDROID (F8, AKEYCODE_F8)
// F9
KEY_MAP_WIN (F9, VK_F9)
KEY_MAP_COCOA (F9, kVK_F9)
KEY_MAP_GTK (F9, GDK_F9)
-KEY_MAP_ANDROID (F9, AKEYCODE_F9)
// F10
KEY_MAP_WIN (F10, VK_F10)
KEY_MAP_COCOA (F10, kVK_F10)
KEY_MAP_GTK (F10, GDK_F10)
-KEY_MAP_ANDROID (F10, AKEYCODE_F10)
// F11
KEY_MAP_WIN (F11, VK_F11)
KEY_MAP_COCOA (F11, kVK_F11)
KEY_MAP_GTK (F11, GDK_F11 /* same as GDK_L1 */)
-KEY_MAP_ANDROID (F11, AKEYCODE_F11)
// F12
KEY_MAP_WIN (F12, VK_F12)
KEY_MAP_COCOA (F12, kVK_F12)
KEY_MAP_GTK (F12, GDK_F12 /* same as GDK_L2 */)
-KEY_MAP_ANDROID (F12, AKEYCODE_F12)
// F13
KEY_MAP_WIN (F13, VK_F13)
@@ -751,11 +687,9 @@ KEY_MAP_GTK (F35, GDK_F35 /* same as GDK_R15 */)
******************************************************************************/
// ChannelDown
KEY_MAP_WIN_CMD (ChannelDown, APPCOMMAND_MEDIA_CHANNEL_DOWN)
-KEY_MAP_ANDROID (ChannelDown, AKEYCODE_CHANNEL_DOWN)
// ChannelUp
KEY_MAP_WIN_CMD (ChannelUp, APPCOMMAND_MEDIA_CHANNEL_UP)
-KEY_MAP_ANDROID (ChannelUp, AKEYCODE_CHANNEL_UP)
// Close
// NOTE: This is not a key to close disk tray, this is a key to close document
@@ -778,45 +712,37 @@ KEY_MAP_GTK (MailSend, GDK_Send)
// MediaPause
KEY_MAP_WIN_CMD (MediaPause, APPCOMMAND_MEDIA_PAUSE)
KEY_MAP_GTK (MediaPause, GDK_AudioPause)
-KEY_MAP_ANDROID (MediaPause, AKEYCODE_MEDIA_PAUSE)
// MediaPlay
KEY_MAP_WIN_CMD (MediaPlay, APPCOMMAND_MEDIA_PLAY)
KEY_MAP_GTK (MediaPlay, GDK_AudioPlay)
-KEY_MAP_ANDROID (MediaPlay, AKEYCODE_MEDIA_PLAY)
// MediaPlayPause
KEY_MAP_WIN (MediaPlayPause, VK_MEDIA_PLAY_PAUSE)
KEY_MAP_WIN_CMD (MediaPlayPause, APPCOMMAND_MEDIA_PLAY_PAUSE)
-KEY_MAP_ANDROID (MediaPlayPause, AKEYCODE_MEDIA_PLAY_PAUSE)
// MediaRecord
KEY_MAP_WIN_CMD (MediaRecord, APPCOMMAND_MEDIA_RECORD)
KEY_MAP_GTK (MediaRecord, GDK_AudioRecord)
-KEY_MAP_ANDROID (MediaRecord, AKEYCODE_MEDIA_RECORD)
// MediaRewind
KEY_MAP_WIN_CMD (MediaRewind, APPCOMMAND_MEDIA_REWIND)
KEY_MAP_GTK (MediaRewind, GDK_AudioRewind)
-KEY_MAP_ANDROID (MediaRewind, AKEYCODE_MEDIA_REWIND)
// MediaStop
KEY_MAP_WIN (MediaStop, VK_MEDIA_STOP)
KEY_MAP_WIN_CMD (MediaStop, APPCOMMAND_MEDIA_STOP)
KEY_MAP_GTK (MediaStop, GDK_AudioStop)
-KEY_MAP_ANDROID (MediaStop, AKEYCODE_MEDIA_STOP)
// MediaTrackNext
KEY_MAP_WIN (MediaTrackNext, VK_MEDIA_NEXT_TRACK)
KEY_MAP_WIN_CMD (MediaTrackNext, APPCOMMAND_MEDIA_NEXTTRACK)
KEY_MAP_GTK (MediaTrackNext, GDK_AudioNext)
-KEY_MAP_ANDROID (MediaTrackNext, AKEYCODE_MEDIA_NEXT)
// MediaTrackPrevious
KEY_MAP_WIN (MediaTrackPrevious, VK_MEDIA_PREV_TRACK)
KEY_MAP_WIN_CMD (MediaTrackPrevious, APPCOMMAND_MEDIA_PREVIOUSTRACK)
KEY_MAP_GTK (MediaTrackPrevious, GDK_AudioPrev)
-KEY_MAP_ANDROID (MediaTrackPrevious, AKEYCODE_MEDIA_PREVIOUS)
// New
KEY_MAP_WIN_CMD (New, APPCOMMAND_NEW)
@@ -851,38 +777,32 @@ KEY_MAP_WIN (AudioVolumeDown, VK_VOLUME_DOWN)
KEY_MAP_WIN_CMD (AudioVolumeDown, APPCOMMAND_VOLUME_DOWN)
KEY_MAP_COCOA (AudioVolumeDown, kVK_VolumeDown)
KEY_MAP_GTK (AudioVolumeDown, GDK_AudioLowerVolume)
-KEY_MAP_ANDROID (AudioVolumeDown, AKEYCODE_VOLUME_DOWN)
// AudioVolumeUp
KEY_MAP_WIN (AudioVolumeUp, VK_VOLUME_UP)
KEY_MAP_WIN_CMD (AudioVolumeUp, APPCOMMAND_VOLUME_UP)
KEY_MAP_COCOA (AudioVolumeUp, kVK_VolumeUp)
KEY_MAP_GTK (AudioVolumeUp, GDK_AudioRaiseVolume)
-KEY_MAP_ANDROID (AudioVolumeUp, AKEYCODE_VOLUME_UP)
// AudioVolumeMute
KEY_MAP_WIN (AudioVolumeMute, VK_VOLUME_MUTE)
KEY_MAP_WIN_CMD (AudioVolumeMute, APPCOMMAND_VOLUME_MUTE)
KEY_MAP_COCOA (AudioVolumeMute, kVK_Mute)
KEY_MAP_GTK (AudioVolumeMute, GDK_AudioMute)
-KEY_MAP_ANDROID (AudioVolumeMute, AKEYCODE_VOLUME_MUTE)
/******************************************************************************
* Application Keys
******************************************************************************/
// LaunchCalculator
KEY_MAP_GTK (LaunchCalculator, GDK_Calculator)
-KEY_MAP_ANDROID (LaunchCalculator, AKEYCODE_CALCULATOR)
// LaunchCalendar
KEY_MAP_GTK (LaunchCalendar, GDK_Calendar)
-KEY_MAP_ANDROID (LaunchCalendar, AKEYCODE_CALENDAR)
// LaunchMail
KEY_MAP_WIN (LaunchMail, VK_LAUNCH_MAIL)
KEY_MAP_WIN_CMD (LaunchMail, APPCOMMAND_LAUNCH_MAIL)
KEY_MAP_GTK (LaunchMail, GDK_Mail)
-KEY_MAP_ANDROID (LaunchMail, AKEYCODE_ENVELOPE)
// LaunchMediaPlayer
KEY_MAP_WIN (LaunchMediaPlayer, VK_LAUNCH_MEDIA_SELECT)
@@ -895,7 +815,6 @@ KEY_MAP_GTK (LaunchMediaPlayer, GDK_AudioMedia)
// LaunchMusicPlayer
KEY_MAP_GTK (LaunchMusicPlayer, GDK_Music)
-KEY_MAP_ANDROID (LaunchMusicPlayer, AKEYCODE_MUSIC)
// LaunchMyComputer
KEY_MAP_GTK (LaunchMyComputer, GDK_MyComputer)
@@ -909,7 +828,6 @@ KEY_MAP_GTK (LaunchSpreadsheet, GDK_Excel)
// LaunchWebBrowser
KEY_MAP_GTK (LaunchWebBrowser, GDK_WWW)
-KEY_MAP_ANDROID (LaunchWebBrowser, AKEYCODE_EXPLORER)
// LaunchWebCam
KEY_MAP_GTK (LaunchWebCam, GDK_WebCam)
@@ -980,18 +898,15 @@ KEY_MAP_GTK (LaunchApplication16, GDK_LaunchF)
KEY_MAP_WIN (BrowserBack, VK_BROWSER_BACK)
KEY_MAP_WIN_CMD (BrowserBack, APPCOMMAND_BROWSER_BACKWARD)
KEY_MAP_GTK (BrowserBack, GDK_Back)
-KEY_MAP_ANDROID (BrowserBack, AKEYCODE_BACK)
// BrowserFavorites
KEY_MAP_WIN (BrowserFavorites, VK_BROWSER_FAVORITES)
KEY_MAP_WIN_CMD (BrowserFavorites, APPCOMMAND_BROWSER_FAVORITES)
-KEY_MAP_ANDROID (BrowserFavorites, AKEYCODE_BOOKMARK)
// BrowserForward
KEY_MAP_WIN (BrowserForward, VK_BROWSER_FORWARD)
KEY_MAP_WIN_CMD (BrowserForward, APPCOMMAND_BROWSER_FORWARD)
KEY_MAP_GTK (BrowserForward, GDK_Forward)
-KEY_MAP_ANDROID (BrowserForward, AKEYCODE_FORWARD)
// BrowserHome
KEY_MAP_WIN (BrowserHome, VK_BROWSER_HOME)
@@ -1008,7 +923,6 @@ KEY_MAP_GTK (BrowserRefresh, GDK_Reload)
KEY_MAP_WIN (BrowserSearch, VK_BROWSER_SEARCH)
KEY_MAP_WIN_CMD (BrowserSearch, APPCOMMAND_BROWSER_SEARCH)
KEY_MAP_GTK (BrowserSearch, GDK_Search)
-KEY_MAP_ANDROID (BrowserSearch, AKEYCODE_SEARCH)
// BrowserStop
KEY_MAP_WIN (BrowserStop, VK_BROWSER_STOP)
@@ -1019,88 +933,67 @@ KEY_MAP_GTK (BrowserStop, GDK_Stop)
* Mobile Phone Keys
******************************************************************************/
// Call
-KEY_MAP_ANDROID (Call, AKEYCODE_CALL)
// Camera
-KEY_MAP_ANDROID (Camera, AKEYCODE_CAMERA)
// CameraFocus
-KEY_MAP_ANDROID (CameraFocus, AKEYCODE_FOCUS)
// GoHome
-KEY_MAP_ANDROID (GoHome, AKEYCODE_HOME)
/******************************************************************************
* TV Keys
******************************************************************************/
// TV
-KEY_MAP_ANDROID (TV, AKEYCODE_TV)
// TVInput
-KEY_MAP_ANDROID (TVInput, AKEYCODE_TV_INPUT)
// TVPower
-KEY_MAP_ANDROID (TVPower, AKEYCODE_TV_POWER)
/******************************************************************************
* Media Controller Keys
******************************************************************************/
// AVRInput
-KEY_MAP_ANDROID (AVRInput, AKEYCODE_AVR_INPUT)
// AVRPower
-KEY_MAP_ANDROID (AVRPower, AKEYCODE_AVR_POWER)
// ColorF0Red
KEY_MAP_GTK (ColorF0Red, GDK_Red)
-KEY_MAP_ANDROID (ColorF0Red, AKEYCODE_PROG_RED)
// ColorF1Green
KEY_MAP_GTK (ColorF1Green, GDK_Green)
-KEY_MAP_ANDROID (ColorF1Green, AKEYCODE_PROG_GREEN)
// ColorF2Yellow
KEY_MAP_GTK (ColorF2Yellow, GDK_Yellow)
-KEY_MAP_ANDROID (ColorF2Yellow, AKEYCODE_PROG_YELLOW)
// ColorF3Blue
KEY_MAP_GTK (ColorF3Blue, GDK_Blue)
-KEY_MAP_ANDROID (ColorF3Blue, AKEYCODE_PROG_BLUE)
// Dimmer
KEY_MAP_GTK (Dimmer, GDK_BrightnessAdjust)
// Guide
-KEY_MAP_ANDROID (Guide, AKEYCODE_GUIDE)
// Info
-KEY_MAP_ANDROID (Info, AKEYCODE_INFO)
// MediaFastForward
KEY_MAP_WIN_CMD (MediaFastForward, APPCOMMAND_MEDIA_FAST_FORWARD)
KEY_MAP_GTK (MediaFastForward, GDK_AudioForward)
-KEY_MAP_ANDROID (MediaFastForward, AKEYCODE_MEDIA_FAST_FORWARD)
// MediaLast
// PinPToggle
-KEY_MAP_ANDROID (PinPToggle, AKEYCODE_WINDOW)
// RandomToggle
KEY_MAP_GTK (RandomToggle, GDK_AudioRandomPlay)
// Settings
-KEY_MAP_ANDROID (Settings, AKEYCODE_SETTINGS)
// STBInput
-KEY_MAP_ANDROID (STBInput, AKEYCODE_STB_INPUT)
// STBPower
-KEY_MAP_ANDROID (STBPower, AKEYCODE_STB_POWER)
// Subtitle
KEY_MAP_GTK (Subtitle, GDK_Subtitle)
-KEY_MAP_ANDROID (Subtitle, AKEYCODE_CAPTIONS)
// VideoModeNext
KEY_MAP_GTK (VideoModeNext, GDK_Next_VMode)
@@ -1112,10 +1005,8 @@ KEY_MAP_WIN (ZoomToggle, VK_ZOOM)
* Keys not defined by any standards
******************************************************************************/
// SoftLeft
-KEY_MAP_ANDROID (SoftLeft, AKEYCODE_SOFT_LEFT)
// SoftRight
-KEY_MAP_ANDROID (SoftRight, AKEYCODE_SOFT_RIGHT)
#undef KEY_MAP_WIN
#undef KEY_MAP_WIN_JPN
@@ -1124,4 +1015,3 @@ KEY_MAP_ANDROID (SoftRight, AKEYCODE_SOFT_RIGHT)
#undef KEY_MAP_WIN_CMD
#undef KEY_MAP_COCOA
#undef KEY_MAP_GTK
-#undef KEY_MAP_ANDROID
diff --git a/widget/android/ANRReporter.cpp b/widget/android/ANRReporter.cpp
deleted file mode 100644
index 30d9b3d76..000000000
--- a/widget/android/ANRReporter.cpp
+++ /dev/null
@@ -1,89 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "ANRReporter.h"
-#include "GeckoProfiler.h"
-
-#include <unistd.h>
-
-namespace mozilla {
-
-bool
-ANRReporter::RequestNativeStack(bool aUnwind)
-{
- if (profiler_is_active()) {
- // Don't proceed if profiler is already running
- return false;
- }
- // WARNING: we are on the ANR reporter thread at this point and it is
- // generally unsafe to use the profiler from off the main thread. However,
- // the risk here is limited because for most users, the profiler is not run
- // elsewhere. See the discussion in Bug 863777, comment 13
- const char *NATIVE_STACK_FEATURES[] =
- {"leaf", "threads", "privacy"};
- const char *NATIVE_STACK_UNWIND_FEATURES[] =
- {"leaf", "threads", "privacy", "stackwalk"};
-
- const char **features = NATIVE_STACK_FEATURES;
- size_t features_size = sizeof(NATIVE_STACK_FEATURES);
- if (aUnwind) {
- features = NATIVE_STACK_UNWIND_FEATURES;
- features_size = sizeof(NATIVE_STACK_UNWIND_FEATURES);
- // We want the new unwinder if the unwind mode has not been set yet
- putenv("MOZ_PROFILER_NEW=1");
- }
-
- const char *NATIVE_STACK_THREADS[] =
- {"GeckoMain", "Compositor"};
- // Buffer one sample and let the profiler wait a long time
- profiler_start(100, 10000, features, features_size / sizeof(char*),
- NATIVE_STACK_THREADS, sizeof(NATIVE_STACK_THREADS) / sizeof(char*));
- return true;
-}
-
-jni::String::LocalRef
-ANRReporter::GetNativeStack()
-{
- if (!profiler_is_active()) {
- // Maybe profiler support is disabled?
- return nullptr;
- }
-
- // Timeout if we don't get a profiler sample after 5 seconds.
- const PRIntervalTime timeout = PR_SecondsToInterval(5);
- const PRIntervalTime startTime = PR_IntervalNow();
-
- // Pointer to a profile JSON string
- typedef mozilla::UniquePtr<char[]> ProfilePtr;
-
- ProfilePtr profile(profiler_get_profile());
-
- while (profile && !strstr(profile.get(), "\"samples\":[{")) {
- // no sample yet?
- if (PR_IntervalNow() - startTime >= timeout) {
- return nullptr;
- }
- usleep(100000ul); // Sleep for 100ms
- profile = ProfilePtr(profiler_get_profile());
- }
-
- if (profile) {
- return jni::String::Param(profile.get());
- }
- return nullptr;
-}
-
-void
-ANRReporter::ReleaseNativeStack()
-{
- if (!profiler_is_active()) {
- // Maybe profiler support is disabled?
- return;
- }
- profiler_stop();
-}
-
-} // namespace
-
diff --git a/widget/android/ANRReporter.h b/widget/android/ANRReporter.h
deleted file mode 100644
index d3e5cc7e8..000000000
--- a/widget/android/ANRReporter.h
+++ /dev/null
@@ -1,26 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef ANRReporter_h__
-#define ANRReporter_h__
-
-#include "FennecJNINatives.h"
-
-namespace mozilla {
-
-class ANRReporter : public java::ANRReporter::Natives<ANRReporter>
-{
-private:
- ANRReporter();
-
-public:
- static bool RequestNativeStack(bool aUnwind);
- static jni::String::LocalRef GetNativeStack();
- static void ReleaseNativeStack();
-};
-
-} // namespace
-
-#endif // ANRReporter_h__
diff --git a/widget/android/AndroidAlerts.cpp b/widget/android/AndroidAlerts.cpp
deleted file mode 100644
index 8d5074672..000000000
--- a/widget/android/AndroidAlerts.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/* -*- Mode: c++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "AndroidAlerts.h"
-#include "GeneratedJNIWrappers.h"
-#include "nsAlertsUtils.h"
-
-namespace mozilla {
-namespace widget {
-
-NS_IMPL_ISUPPORTS(AndroidAlerts, nsIAlertsService)
-
-StaticAutoPtr<AndroidAlerts::ListenerMap> AndroidAlerts::sListenerMap;
-
-NS_IMETHODIMP
-AndroidAlerts::ShowAlertNotification(const nsAString & aImageUrl,
- const nsAString & aAlertTitle,
- const nsAString & aAlertText,
- bool aAlertTextClickable,
- const nsAString & aAlertCookie,
- nsIObserver * aAlertListener,
- const nsAString & aAlertName,
- const nsAString & aBidi,
- const nsAString & aLang,
- const nsAString & aData,
- nsIPrincipal * aPrincipal,
- bool aInPrivateBrowsing,
- bool aRequireInteraction)
-{
- MOZ_ASSERT_UNREACHABLE("Should be implemented by nsAlertsService.");
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP
-AndroidAlerts::ShowAlert(nsIAlertNotification* aAlert,
- nsIObserver* aAlertListener)
-{
- return ShowPersistentNotification(EmptyString(), aAlert, aAlertListener);
-}
-
-NS_IMETHODIMP
-AndroidAlerts::ShowPersistentNotification(const nsAString& aPersistentData,
- nsIAlertNotification* aAlert,
- nsIObserver* aAlertListener)
-{
- // nsAlertsService disables our alerts backend if we ever return failure
- // here. To keep the backend enabled, we always return NS_OK even if we
- // encounter an error here.
- nsresult rv;
-
- nsAutoString imageUrl;
- rv = aAlert->GetImageURL(imageUrl);
- NS_ENSURE_SUCCESS(rv, NS_OK);
-
- nsAutoString title;
- rv = aAlert->GetTitle(title);
- NS_ENSURE_SUCCESS(rv, NS_OK);
-
- nsAutoString text;
- rv = aAlert->GetText(text);
- NS_ENSURE_SUCCESS(rv, NS_OK);
-
- nsAutoString cookie;
- rv = aAlert->GetCookie(cookie);
- NS_ENSURE_SUCCESS(rv, NS_OK);
-
- nsAutoString name;
- rv = aAlert->GetName(name);
- NS_ENSURE_SUCCESS(rv, NS_OK);
-
- nsCOMPtr<nsIPrincipal> principal;
- rv = aAlert->GetPrincipal(getter_AddRefs(principal));
- NS_ENSURE_SUCCESS(rv, NS_OK);
-
- nsAutoString host;
- nsAlertsUtils::GetSourceHostPort(principal, host);
-
- if (aPersistentData.IsEmpty() && aAlertListener) {
- if (!sListenerMap) {
- sListenerMap = new ListenerMap();
- }
- // This will remove any observers already registered for this name.
- sListenerMap->Put(name, aAlertListener);
- }
-
- java::GeckoAppShell::ShowNotification(
- name, cookie, title, text, host, imageUrl,
- !aPersistentData.IsEmpty() ? jni::StringParam(aPersistentData)
- : jni::StringParam(nullptr));
- return NS_OK;
-}
-
-NS_IMETHODIMP
-AndroidAlerts::CloseAlert(const nsAString& aAlertName,
- nsIPrincipal* aPrincipal)
-{
- // We delete the entry in sListenerMap later, when CloseNotification calls
- // NotifyListener.
- java::GeckoAppShell::CloseNotification(aAlertName);
- return NS_OK;
-}
-
-void
-AndroidAlerts::NotifyListener(const nsAString& aName, const char* aTopic,
- const char16_t* aCookie)
-{
- if (!sListenerMap) {
- return;
- }
-
- nsCOMPtr<nsIObserver> listener = sListenerMap->Get(aName);
- if (!listener) {
- return;
- }
-
- listener->Observe(nullptr, aTopic, aCookie);
-
- if (NS_LITERAL_CSTRING("alertfinished").Equals(aTopic)) {
- sListenerMap->Remove(aName);
- }
-}
-
-} // namespace widget
-} // namespace mozilla
diff --git a/widget/android/AndroidAlerts.h b/widget/android/AndroidAlerts.h
deleted file mode 100644
index 16af15ce0..000000000
--- a/widget/android/AndroidAlerts.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: c++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_widget_AndroidAlerts_h__
-#define mozilla_widget_AndroidAlerts_h__
-
-#include "nsInterfaceHashtable.h"
-#include "nsCOMPtr.h"
-#include "nsHashKeys.h"
-#include "nsIAlertsService.h"
-#include "nsIObserver.h"
-
-#include "mozilla/StaticPtr.h"
-
-namespace mozilla {
-namespace widget {
-
-class AndroidAlerts : public nsIAlertsService
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIALERTSSERVICE
-
- AndroidAlerts() {}
-
- static void NotifyListener(const nsAString& aName, const char* aTopic,
- const char16_t* aCookie);
-
-protected:
- virtual ~AndroidAlerts()
- {
- sListenerMap = nullptr;
- }
-
- using ListenerMap = nsInterfaceHashtable<nsStringHashKey, nsIObserver>;
- static StaticAutoPtr<ListenerMap> sListenerMap;
-};
-
-} // namespace widget
-} // namespace mozilla
-
-#endif // nsAndroidAlerts_h__
diff --git a/widget/android/AndroidBridge.cpp b/widget/android/AndroidBridge.cpp
deleted file mode 100644
index dd2cce39a..000000000
--- a/widget/android/AndroidBridge.cpp
+++ /dev/null
@@ -1,1126 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <android/log.h>
-#include <dlfcn.h>
-#include <math.h>
-#include <GLES2/gl2.h>
-
-#include "mozilla/layers/CompositorBridgeChild.h"
-#include "mozilla/layers/CompositorBridgeParent.h"
-
-#include "mozilla/Hal.h"
-#include "nsXULAppAPI.h"
-#include <prthread.h>
-#include "nsXPCOMStrings.h"
-#include "AndroidBridge.h"
-#include "AndroidJNIWrapper.h"
-#include "AndroidBridgeUtilities.h"
-#include "nsAlertsUtils.h"
-#include "nsAppShell.h"
-#include "nsOSHelperAppService.h"
-#include "nsWindow.h"
-#include "mozilla/Preferences.h"
-#include "nsThreadUtils.h"
-#include "nsIThreadManager.h"
-#include "gfxPlatform.h"
-#include "gfxContext.h"
-#include "mozilla/gfx/2D.h"
-#include "gfxUtils.h"
-#include "nsPresContext.h"
-#include "nsIDocShell.h"
-#include "nsPIDOMWindow.h"
-#include "mozilla/dom/ScreenOrientation.h"
-#include "nsIDOMWindowUtils.h"
-#include "nsIDOMClientRect.h"
-#include "mozilla/ClearOnShutdown.h"
-#include "nsPrintfCString.h"
-#include "NativeJSContainer.h"
-#include "nsContentUtils.h"
-#include "nsIScriptError.h"
-#include "nsIHttpChannel.h"
-
-#include "MediaCodec.h"
-#include "SurfaceTexture.h"
-#include "GLContextProvider.h"
-
-#include "mozilla/TimeStamp.h"
-#include "mozilla/UniquePtr.h"
-#include "mozilla/dom/ContentChild.h"
-#include "nsIObserverService.h"
-#include "nsISupportsPrimitives.h"
-#include "MediaPrefs.h"
-#include "WidgetUtils.h"
-
-#include "FennecJNIWrappers.h"
-
-using namespace mozilla;
-using namespace mozilla::gfx;
-using namespace mozilla::jni;
-using namespace mozilla::java;
-
-AndroidBridge* AndroidBridge::sBridge = nullptr;
-static jobject sGlobalContext = nullptr;
-nsDataHashtable<nsStringHashKey, nsString> AndroidBridge::sStoragePaths;
-
-jmethodID AndroidBridge::GetMethodID(JNIEnv* env, jclass jClass,
- const char* methodName, const char* methodType)
-{
- jmethodID methodID = env->GetMethodID(jClass, methodName, methodType);
- if (!methodID) {
- ALOG(">>> FATAL JNI ERROR! GetMethodID(methodName=\"%s\", "
- "methodType=\"%s\") failed. Did ProGuard optimize away something it shouldn't have?",
- methodName, methodType);
- env->ExceptionDescribe();
- MOZ_CRASH();
- }
- return methodID;
-}
-
-jmethodID AndroidBridge::GetStaticMethodID(JNIEnv* env, jclass jClass,
- const char* methodName, const char* methodType)
-{
- jmethodID methodID = env->GetStaticMethodID(jClass, methodName, methodType);
- if (!methodID) {
- ALOG(">>> FATAL JNI ERROR! GetStaticMethodID(methodName=\"%s\", "
- "methodType=\"%s\") failed. Did ProGuard optimize away something it shouldn't have?",
- methodName, methodType);
- env->ExceptionDescribe();
- MOZ_CRASH();
- }
- return methodID;
-}
-
-jfieldID AndroidBridge::GetFieldID(JNIEnv* env, jclass jClass,
- const char* fieldName, const char* fieldType)
-{
- jfieldID fieldID = env->GetFieldID(jClass, fieldName, fieldType);
- if (!fieldID) {
- ALOG(">>> FATAL JNI ERROR! GetFieldID(fieldName=\"%s\", "
- "fieldType=\"%s\") failed. Did ProGuard optimize away something it shouldn't have?",
- fieldName, fieldType);
- env->ExceptionDescribe();
- MOZ_CRASH();
- }
- return fieldID;
-}
-
-jfieldID AndroidBridge::GetStaticFieldID(JNIEnv* env, jclass jClass,
- const char* fieldName, const char* fieldType)
-{
- jfieldID fieldID = env->GetStaticFieldID(jClass, fieldName, fieldType);
- if (!fieldID) {
- ALOG(">>> FATAL JNI ERROR! GetStaticFieldID(fieldName=\"%s\", "
- "fieldType=\"%s\") failed. Did ProGuard optimize away something it shouldn't have?",
- fieldName, fieldType);
- env->ExceptionDescribe();
- MOZ_CRASH();
- }
- return fieldID;
-}
-
-void
-AndroidBridge::ConstructBridge()
-{
- /* NSS hack -- bionic doesn't handle recursive unloads correctly,
- * because library finalizer functions are called with the dynamic
- * linker lock still held. This results in a deadlock when trying
- * to call dlclose() while we're already inside dlclose().
- * Conveniently, NSS has an env var that can prevent it from unloading.
- */
- putenv("NSS_DISABLE_UNLOAD=1");
-
- MOZ_ASSERT(!sBridge);
- sBridge = new AndroidBridge();
-
- MediaPrefs::GetSingleton();
-}
-
-void
-AndroidBridge::DeconstructBridge()
-{
- if (sBridge) {
- delete sBridge;
- // AndroidBridge destruction requires sBridge to still be valid,
- // so we set sBridge to nullptr after deleting it.
- sBridge = nullptr;
- }
-}
-
-AndroidBridge::~AndroidBridge()
-{
-}
-
-AndroidBridge::AndroidBridge()
- : mUiTaskQueueLock("UiTaskQueue")
-{
- ALOG_BRIDGE("AndroidBridge::Init");
-
- JNIEnv* const jEnv = jni::GetGeckoThreadEnv();
- AutoLocalJNIFrame jniFrame(jEnv);
-
- mMessageQueue = java::GeckoThread::MsgQueue();
- auto msgQueueClass = Class::LocalRef::Adopt(
- jEnv, jEnv->GetObjectClass(mMessageQueue.Get()));
- // mMessageQueueNext must not be null
- mMessageQueueNext = GetMethodID(
- jEnv, msgQueueClass.Get(), "next", "()Landroid/os/Message;");
- // mMessageQueueMessages may be null (e.g. due to proguard optimization)
- mMessageQueueMessages = jEnv->GetFieldID(
- msgQueueClass.Get(), "mMessages", "Landroid/os/Message;");
-
- AutoJNIClass string(jEnv, "java/lang/String");
- jStringClass = string.getGlobalRef();
-
- if (!GetStaticIntField("android/os/Build$VERSION", "SDK_INT", &mAPIVersion, jEnv)) {
- ALOG_BRIDGE("Failed to find API version");
- }
-
- AutoJNIClass channels(jEnv, "java/nio/channels/Channels");
- jChannels = channels.getGlobalRef();
- jChannelCreate = channels.getStaticMethod("newChannel", "(Ljava/io/InputStream;)Ljava/nio/channels/ReadableByteChannel;");
-
- AutoJNIClass readableByteChannel(jEnv, "java/nio/channels/ReadableByteChannel");
- jReadableByteChannel = readableByteChannel.getGlobalRef();
- jByteBufferRead = readableByteChannel.getMethod("read", "(Ljava/nio/ByteBuffer;)I");
-
- AutoJNIClass inputStream(jEnv, "java/io/InputStream");
- jInputStream = inputStream.getGlobalRef();
- jClose = inputStream.getMethod("close", "()V");
- jAvailable = inputStream.getMethod("available", "()I");
-}
-
-// Raw JNIEnv variants.
-jstring AndroidBridge::NewJavaString(JNIEnv* env, const char16_t* string, uint32_t len) {
- jstring ret = env->NewString(reinterpret_cast<const jchar*>(string), len);
- if (env->ExceptionCheck()) {
- ALOG_BRIDGE("Exceptional exit of: %s", __PRETTY_FUNCTION__);
- env->ExceptionDescribe();
- env->ExceptionClear();
- return nullptr;
- }
- return ret;
-}
-
-jstring AndroidBridge::NewJavaString(JNIEnv* env, const nsAString& string) {
- return NewJavaString(env, string.BeginReading(), string.Length());
-}
-
-jstring AndroidBridge::NewJavaString(JNIEnv* env, const char* string) {
- return NewJavaString(env, NS_ConvertUTF8toUTF16(string));
-}
-
-jstring AndroidBridge::NewJavaString(JNIEnv* env, const nsACString& string) {
- return NewJavaString(env, NS_ConvertUTF8toUTF16(string));
-}
-
-// AutoLocalJNIFrame variants..
-jstring AndroidBridge::NewJavaString(AutoLocalJNIFrame* frame, const char16_t* string, uint32_t len) {
- return NewJavaString(frame->GetEnv(), string, len);
-}
-
-jstring AndroidBridge::NewJavaString(AutoLocalJNIFrame* frame, const nsAString& string) {
- return NewJavaString(frame, string.BeginReading(), string.Length());
-}
-
-jstring AndroidBridge::NewJavaString(AutoLocalJNIFrame* frame, const char* string) {
- return NewJavaString(frame, NS_ConvertUTF8toUTF16(string));
-}
-
-jstring AndroidBridge::NewJavaString(AutoLocalJNIFrame* frame, const nsACString& string) {
- return NewJavaString(frame, NS_ConvertUTF8toUTF16(string));
-}
-
-static void
-getHandlersFromStringArray(JNIEnv *aJNIEnv, jobjectArray jArr, jsize aLen,
- nsIMutableArray *aHandlersArray,
- nsIHandlerApp **aDefaultApp,
- const nsAString& aAction = EmptyString(),
- const nsACString& aMimeType = EmptyCString())
-{
- nsString empty = EmptyString();
- for (jsize i = 0; i < aLen; i+=4) {
-
- AutoLocalJNIFrame jniFrame(aJNIEnv, 4);
- nsJNIString name(
- static_cast<jstring>(aJNIEnv->GetObjectArrayElement(jArr, i)), aJNIEnv);
- nsJNIString isDefault(
- static_cast<jstring>(aJNIEnv->GetObjectArrayElement(jArr, i + 1)), aJNIEnv);
- nsJNIString packageName(
- static_cast<jstring>(aJNIEnv->GetObjectArrayElement(jArr, i + 2)), aJNIEnv);
- nsJNIString className(
- static_cast<jstring>(aJNIEnv->GetObjectArrayElement(jArr, i + 3)), aJNIEnv);
- nsIHandlerApp* app = nsOSHelperAppService::
- CreateAndroidHandlerApp(name, className, packageName,
- className, aMimeType, aAction);
-
- aHandlersArray->AppendElement(app, false);
- if (aDefaultApp && isDefault.Length() > 0)
- *aDefaultApp = app;
- }
-}
-
-bool
-AndroidBridge::GetHandlersForMimeType(const nsAString& aMimeType,
- nsIMutableArray *aHandlersArray,
- nsIHandlerApp **aDefaultApp,
- const nsAString& aAction)
-{
- ALOG_BRIDGE("AndroidBridge::GetHandlersForMimeType");
-
- auto arr = GeckoAppShell::GetHandlersForMimeType(aMimeType, aAction);
- if (!arr)
- return false;
-
- JNIEnv* const env = arr.Env();
- jsize len = env->GetArrayLength(arr.Get());
-
- if (!aHandlersArray)
- return len > 0;
-
- getHandlersFromStringArray(env, arr.Get(), len, aHandlersArray,
- aDefaultApp, aAction,
- NS_ConvertUTF16toUTF8(aMimeType));
- return true;
-}
-
-bool
-AndroidBridge::GetHWEncoderCapability()
-{
- ALOG_BRIDGE("AndroidBridge::GetHWEncoderCapability");
-
- bool value = GeckoAppShell::GetHWEncoderCapability();
-
- return value;
-}
-
-
-bool
-AndroidBridge::GetHWDecoderCapability()
-{
- ALOG_BRIDGE("AndroidBridge::GetHWDecoderCapability");
-
- bool value = GeckoAppShell::GetHWDecoderCapability();
-
- return value;
-}
-
-bool
-AndroidBridge::GetHandlersForURL(const nsAString& aURL,
- nsIMutableArray* aHandlersArray,
- nsIHandlerApp **aDefaultApp,
- const nsAString& aAction)
-{
- ALOG_BRIDGE("AndroidBridge::GetHandlersForURL");
-
- auto arr = GeckoAppShell::GetHandlersForURL(aURL, aAction);
- if (!arr)
- return false;
-
- JNIEnv* const env = arr.Env();
- jsize len = env->GetArrayLength(arr.Get());
-
- if (!aHandlersArray)
- return len > 0;
-
- getHandlersFromStringArray(env, arr.Get(), len, aHandlersArray,
- aDefaultApp, aAction);
- return true;
-}
-
-void
-AndroidBridge::GetMimeTypeFromExtensions(const nsACString& aFileExt, nsCString& aMimeType)
-{
- ALOG_BRIDGE("AndroidBridge::GetMimeTypeFromExtensions");
-
- auto jstrType = GeckoAppShell::GetMimeTypeFromExtensions(aFileExt);
-
- if (jstrType) {
- aMimeType = jstrType->ToCString();
- }
-}
-
-void
-AndroidBridge::GetExtensionFromMimeType(const nsACString& aMimeType, nsACString& aFileExt)
-{
- ALOG_BRIDGE("AndroidBridge::GetExtensionFromMimeType");
-
- auto jstrExt = GeckoAppShell::GetExtensionFromMimeType(aMimeType);
-
- if (jstrExt) {
- aFileExt = jstrExt->ToCString();
- }
-}
-
-bool
-AndroidBridge::GetClipboardText(nsAString& aText)
-{
- ALOG_BRIDGE("AndroidBridge::GetClipboardText");
-
- auto text = Clipboard::GetText();
-
- if (text) {
- aText = text->ToString();
- }
- return !!text;
-}
-
-int
-AndroidBridge::GetDPI()
-{
- static int sDPI = 0;
- if (sDPI)
- return sDPI;
-
- const int DEFAULT_DPI = 160;
-
- sDPI = GeckoAppShell::GetDpi();
- if (!sDPI) {
- return DEFAULT_DPI;
- }
-
- return sDPI;
-}
-
-int
-AndroidBridge::GetScreenDepth()
-{
- ALOG_BRIDGE("%s", __PRETTY_FUNCTION__);
-
- static int sDepth = 0;
- if (sDepth)
- return sDepth;
-
- const int DEFAULT_DEPTH = 16;
-
- if (jni::IsAvailable()) {
- sDepth = GeckoAppShell::GetScreenDepth();
- }
- if (!sDepth)
- return DEFAULT_DEPTH;
-
- return sDepth;
-}
-void
-AndroidBridge::Vibrate(const nsTArray<uint32_t>& aPattern)
-{
- ALOG_BRIDGE("%s", __PRETTY_FUNCTION__);
-
- uint32_t len = aPattern.Length();
- if (!len) {
- ALOG_BRIDGE(" invalid 0-length array");
- return;
- }
-
- // It's clear if this worth special-casing, but it creates less
- // java junk, so dodges the GC.
- if (len == 1) {
- jlong d = aPattern[0];
- if (d < 0) {
- ALOG_BRIDGE(" invalid vibration duration < 0");
- return;
- }
- GeckoAppShell::Vibrate(d);
- return;
- }
-
- // First element of the array vibrate() expects is how long to wait
- // *before* vibrating. For us, this is always 0.
-
- JNIEnv* const env = jni::GetGeckoThreadEnv();
- AutoLocalJNIFrame jniFrame(env, 1);
-
- jlongArray array = env->NewLongArray(len + 1);
- if (!array) {
- ALOG_BRIDGE(" failed to allocate array");
- return;
- }
-
- jlong* elts = env->GetLongArrayElements(array, nullptr);
- elts[0] = 0;
- for (uint32_t i = 0; i < aPattern.Length(); ++i) {
- jlong d = aPattern[i];
- if (d < 0) {
- ALOG_BRIDGE(" invalid vibration duration < 0");
- env->ReleaseLongArrayElements(array, elts, JNI_ABORT);
- return;
- }
- elts[i + 1] = d;
- }
- env->ReleaseLongArrayElements(array, elts, 0);
-
- GeckoAppShell::Vibrate(LongArray::Ref::From(array), -1 /* don't repeat */);
-}
-
-void
-AndroidBridge::GetSystemColors(AndroidSystemColors *aColors)
-{
-
- NS_ASSERTION(aColors != nullptr, "AndroidBridge::GetSystemColors: aColors is null!");
- if (!aColors)
- return;
-
- auto arr = GeckoAppShell::GetSystemColors();
- if (!arr)
- return;
-
- JNIEnv* const env = arr.Env();
- uint32_t len = static_cast<uint32_t>(env->GetArrayLength(arr.Get()));
- jint *elements = env->GetIntArrayElements(arr.Get(), 0);
-
- uint32_t colorsCount = sizeof(AndroidSystemColors) / sizeof(nscolor);
- if (len < colorsCount)
- colorsCount = len;
-
- // Convert Android colors to nscolor by switching R and B in the ARGB 32 bit value
- nscolor *colors = (nscolor*)aColors;
-
- for (uint32_t i = 0; i < colorsCount; i++) {
- uint32_t androidColor = static_cast<uint32_t>(elements[i]);
- uint8_t r = (androidColor & 0x00ff0000) >> 16;
- uint8_t b = (androidColor & 0x000000ff);
- colors[i] = (androidColor & 0xff00ff00) | (b << 16) | r;
- }
-
- env->ReleaseIntArrayElements(arr.Get(), elements, 0);
-}
-
-void
-AndroidBridge::GetIconForExtension(const nsACString& aFileExt, uint32_t aIconSize, uint8_t * const aBuf)
-{
- ALOG_BRIDGE("AndroidBridge::GetIconForExtension");
- NS_ASSERTION(aBuf != nullptr, "AndroidBridge::GetIconForExtension: aBuf is null!");
- if (!aBuf)
- return;
-
- auto arr = GeckoAppShell::GetIconForExtension(NS_ConvertUTF8toUTF16(aFileExt), aIconSize);
-
- NS_ASSERTION(arr != nullptr, "AndroidBridge::GetIconForExtension: Returned pixels array is null!");
- if (!arr)
- return;
-
- JNIEnv* const env = arr.Env();
- uint32_t len = static_cast<uint32_t>(env->GetArrayLength(arr.Get()));
- jbyte *elements = env->GetByteArrayElements(arr.Get(), 0);
-
- uint32_t bufSize = aIconSize * aIconSize * 4;
- NS_ASSERTION(len == bufSize, "AndroidBridge::GetIconForExtension: Pixels array is incomplete!");
- if (len == bufSize)
- memcpy(aBuf, elements, bufSize);
-
- env->ReleaseByteArrayElements(arr.Get(), elements, 0);
-}
-
-bool
-AndroidBridge::GetStaticIntField(const char *className, const char *fieldName, int32_t* aInt, JNIEnv* jEnv /* = nullptr */)
-{
- ALOG_BRIDGE("AndroidBridge::GetStaticIntField %s", fieldName);
-
- if (!jEnv) {
- if (!jni::IsAvailable()) {
- return false;
- }
- jEnv = jni::GetGeckoThreadEnv();
- }
-
- AutoJNIClass cls(jEnv, className);
- jfieldID field = cls.getStaticField(fieldName, "I");
-
- if (!field) {
- return false;
- }
-
- *aInt = static_cast<int32_t>(jEnv->GetStaticIntField(cls.getRawRef(), field));
- return true;
-}
-
-bool
-AndroidBridge::GetStaticStringField(const char *className, const char *fieldName, nsAString &result, JNIEnv* jEnv /* = nullptr */)
-{
- ALOG_BRIDGE("AndroidBridge::GetStaticStringField %s", fieldName);
-
- if (!jEnv) {
- if (!jni::IsAvailable()) {
- return false;
- }
- jEnv = jni::GetGeckoThreadEnv();
- }
-
- AutoLocalJNIFrame jniFrame(jEnv, 1);
- AutoJNIClass cls(jEnv, className);
- jfieldID field = cls.getStaticField(fieldName, "Ljava/lang/String;");
-
- if (!field) {
- return false;
- }
-
- jstring jstr = (jstring) jEnv->GetStaticObjectField(cls.getRawRef(), field);
- if (!jstr)
- return false;
-
- result.Assign(nsJNIString(jstr, jEnv));
- return true;
-}
-
-namespace mozilla {
- class TracerRunnable : public Runnable{
- public:
- TracerRunnable() {
- mTracerLock = new Mutex("TracerRunnable");
- mTracerCondVar = new CondVar(*mTracerLock, "TracerRunnable");
- mMainThread = do_GetMainThread();
-
- }
- ~TracerRunnable() {
- delete mTracerCondVar;
- delete mTracerLock;
- mTracerLock = nullptr;
- mTracerCondVar = nullptr;
- }
-
- virtual nsresult Run() {
- MutexAutoLock lock(*mTracerLock);
- if (!AndroidBridge::Bridge())
- return NS_OK;
-
- mHasRun = true;
- mTracerCondVar->Notify();
- return NS_OK;
- }
-
- bool Fire() {
- if (!mTracerLock || !mTracerCondVar)
- return false;
- MutexAutoLock lock(*mTracerLock);
- mHasRun = false;
- mMainThread->Dispatch(this, NS_DISPATCH_NORMAL);
- while (!mHasRun)
- mTracerCondVar->Wait();
- return true;
- }
-
- void Signal() {
- MutexAutoLock lock(*mTracerLock);
- mHasRun = true;
- mTracerCondVar->Notify();
- }
- private:
- Mutex* mTracerLock;
- CondVar* mTracerCondVar;
- bool mHasRun;
- nsCOMPtr<nsIThread> mMainThread;
-
- };
- StaticRefPtr<TracerRunnable> sTracerRunnable;
-
- bool InitWidgetTracing() {
- if (!sTracerRunnable)
- sTracerRunnable = new TracerRunnable();
- return true;
- }
-
- void CleanUpWidgetTracing() {
- sTracerRunnable = nullptr;
- }
-
- bool FireAndWaitForTracerEvent() {
- if (sTracerRunnable)
- return sTracerRunnable->Fire();
- return false;
- }
-
- void SignalTracerThread()
- {
- if (sTracerRunnable)
- return sTracerRunnable->Signal();
- }
-
-}
-
-
-void
-AndroidBridge::GetCurrentBatteryInformation(hal::BatteryInformation* aBatteryInfo)
-{
- ALOG_BRIDGE("AndroidBridge::GetCurrentBatteryInformation");
-
- // To prevent calling too many methods through JNI, the Java method returns
- // an array of double even if we actually want a double and a boolean.
- auto arr = GeckoAppShell::GetCurrentBatteryInformation();
-
- JNIEnv* const env = arr.Env();
- if (!arr || env->GetArrayLength(arr.Get()) != 3) {
- return;
- }
-
- jdouble* info = env->GetDoubleArrayElements(arr.Get(), 0);
-
- aBatteryInfo->level() = info[0];
- aBatteryInfo->charging() = info[1] == 1.0f;
- aBatteryInfo->remainingTime() = info[2];
-
- env->ReleaseDoubleArrayElements(arr.Get(), info, 0);
-}
-
-void
-AndroidBridge::HandleGeckoMessage(JSContext* cx, JS::HandleObject object)
-{
- ALOG_BRIDGE("%s", __PRETTY_FUNCTION__);
-
- auto message = widget::CreateNativeJSContainer(cx, object);
- GeckoAppShell::HandleGeckoMessage(message);
-}
-
-void
-AndroidBridge::GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInfo)
-{
- ALOG_BRIDGE("AndroidBridge::GetCurrentNetworkInformation");
-
- // To prevent calling too many methods through JNI, the Java method returns
- // an array of double even if we actually want an integer, a boolean, and an integer.
-
- auto arr = GeckoAppShell::GetCurrentNetworkInformation();
-
- JNIEnv* const env = arr.Env();
- if (!arr || env->GetArrayLength(arr.Get()) != 3) {
- return;
- }
-
- jdouble* info = env->GetDoubleArrayElements(arr.Get(), 0);
-
- aNetworkInfo->type() = info[0];
- aNetworkInfo->isWifi() = info[1] == 1.0f;
- aNetworkInfo->dhcpGateway() = info[2];
-
- env->ReleaseDoubleArrayElements(arr.Get(), info, 0);
-}
-
-jobject
-AndroidBridge::GetGlobalContextRef() {
- if (sGlobalContext) {
- return sGlobalContext;
- }
-
- JNIEnv* const env = GetEnvForThread();
- AutoLocalJNIFrame jniFrame(env, 4);
-
- auto context = GeckoAppShell::GetContext();
- if (!context) {
- ALOG_BRIDGE("%s: Could not GetContext()", __FUNCTION__);
- return 0;
- }
- jclass contextClass = env->FindClass("android/content/Context");
- if (!contextClass) {
- ALOG_BRIDGE("%s: Could not find Context class.", __FUNCTION__);
- return 0;
- }
- jmethodID mid = env->GetMethodID(contextClass, "getApplicationContext",
- "()Landroid/content/Context;");
- if (!mid) {
- ALOG_BRIDGE("%s: Could not find getApplicationContext.", __FUNCTION__);
- return 0;
- }
- jobject appContext = env->CallObjectMethod(context.Get(), mid);
- if (!appContext) {
- ALOG_BRIDGE("%s: getApplicationContext failed.", __FUNCTION__);
- return 0;
- }
-
- sGlobalContext = env->NewGlobalRef(appContext);
- MOZ_ASSERT(sGlobalContext);
- return sGlobalContext;
-}
-
-/* Implementation file */
-NS_IMPL_ISUPPORTS(nsAndroidBridge, nsIAndroidBridge)
-
-nsAndroidBridge::nsAndroidBridge()
-{
- AddObservers();
-}
-
-nsAndroidBridge::~nsAndroidBridge()
-{
- RemoveObservers();
-}
-
-NS_IMETHODIMP nsAndroidBridge::HandleGeckoMessage(JS::HandleValue val,
- JSContext *cx)
-{
- if (val.isObject()) {
- JS::RootedObject object(cx, &val.toObject());
- AndroidBridge::Bridge()->HandleGeckoMessage(cx, object);
- return NS_OK;
- }
-
- // Now handle legacy JSON messages.
- if (!val.isString()) {
- return NS_ERROR_INVALID_ARG;
- }
- JS::RootedString jsonStr(cx, val.toString());
-
- JS::RootedValue jsonVal(cx);
- if (!JS_ParseJSON(cx, jsonStr, &jsonVal) || !jsonVal.isObject()) {
- return NS_ERROR_INVALID_ARG;
- }
-
- // Spit out a warning before sending the message.
- nsContentUtils::ReportToConsoleNonLocalized(
- NS_LITERAL_STRING("Use of JSON is deprecated. "
- "Please pass Javascript objects directly to handleGeckoMessage."),
- nsIScriptError::warningFlag,
- NS_LITERAL_CSTRING("nsIAndroidBridge"),
- nullptr);
-
- JS::RootedObject object(cx, &jsonVal.toObject());
- AndroidBridge::Bridge()->HandleGeckoMessage(cx, object);
- return NS_OK;
-}
-
-NS_IMETHODIMP nsAndroidBridge::ContentDocumentChanged(mozIDOMWindowProxy* aWindow)
-{
- AndroidBridge::Bridge()->ContentDocumentChanged(aWindow);
- return NS_OK;
-}
-
-NS_IMETHODIMP nsAndroidBridge::IsContentDocumentDisplayed(mozIDOMWindowProxy* aWindow,
- bool *aRet)
-{
- *aRet = AndroidBridge::Bridge()->IsContentDocumentDisplayed(aWindow);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAndroidBridge::Observe(nsISupports* aSubject, const char* aTopic,
- const char16_t* aData)
-{
- if (!strcmp(aTopic, "xpcom-shutdown")) {
- RemoveObservers();
- } else if (!strcmp(aTopic, "media-playback")) {
- ALOG_BRIDGE("nsAndroidBridge::Observe, get media-playback event.");
-
- nsCOMPtr<nsISupportsPRUint64> wrapper = do_QueryInterface(aSubject);
- if (!wrapper) {
- return NS_OK;
- }
-
- uint64_t windowId = 0;
- nsresult rv = wrapper->GetData(&windowId);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- nsAutoString activeStr(aData);
- bool isPlaying = activeStr.EqualsLiteral("active");
- UpdateAudioPlayingWindows(windowId, isPlaying);
- }
- return NS_OK;
-}
-
-void
-nsAndroidBridge::UpdateAudioPlayingWindows(uint64_t aWindowId,
- bool aPlaying)
-{
- // Request audio focus for the first audio playing window and abandon focus
- // for the last audio playing window.
- if (aPlaying && !mAudioPlayingWindows.Contains(aWindowId)) {
- mAudioPlayingWindows.AppendElement(aWindowId);
- if (mAudioPlayingWindows.Length() == 1) {
- ALOG_BRIDGE("nsAndroidBridge, request audio focus.");
- AudioFocusAgent::NotifyStartedPlaying();
- }
- } else if (!aPlaying && mAudioPlayingWindows.Contains(aWindowId)) {
- mAudioPlayingWindows.RemoveElement(aWindowId);
- if (mAudioPlayingWindows.Length() == 0) {
- ALOG_BRIDGE("nsAndroidBridge, abandon audio focus.");
- AudioFocusAgent::NotifyStoppedPlaying();
- }
- }
-}
-
-void
-nsAndroidBridge::AddObservers()
-{
- nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
- if (obs) {
- obs->AddObserver(this, "xpcom-shutdown", false);
- if (jni::IsFennec()) { // No AudioFocusAgent in non-Fennec environment.
- obs->AddObserver(this, "media-playback", false);
- }
- }
-}
-
-void
-nsAndroidBridge::RemoveObservers()
-{
- nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
- if (obs) {
- obs->RemoveObserver(this, "xpcom-shutdown");
- if (jni::IsFennec()) { // No AudioFocusAgent in non-Fennec environment.
- obs->RemoveObserver(this, "media-playback");
- }
- }
-}
-
-uint32_t
-AndroidBridge::GetScreenOrientation()
-{
- ALOG_BRIDGE("AndroidBridge::GetScreenOrientation");
-
- int16_t orientation = GeckoAppShell::GetScreenOrientation();
-
- if (!orientation)
- return dom::eScreenOrientation_None;
-
- return static_cast<dom::ScreenOrientationInternal>(orientation);
-}
-
-uint16_t
-AndroidBridge::GetScreenAngle()
-{
- return GeckoAppShell::GetScreenAngle();
-}
-
-nsresult
-AndroidBridge::GetProxyForURI(const nsACString & aSpec,
- const nsACString & aScheme,
- const nsACString & aHost,
- const int32_t aPort,
- nsACString & aResult)
-{
- if (!jni::IsAvailable()) {
- return NS_ERROR_FAILURE;
- }
-
- auto jstrRet = GeckoAppShell::GetProxyForURI(aSpec, aScheme, aHost, aPort);
-
- if (!jstrRet)
- return NS_ERROR_FAILURE;
-
- aResult = jstrRet->ToCString();
- return NS_OK;
-}
-
-bool
-AndroidBridge::PumpMessageLoop()
-{
- JNIEnv* const env = jni::GetGeckoThreadEnv();
-
- if (mMessageQueueMessages) {
- auto msg = Object::LocalRef::Adopt(env,
- env->GetObjectField(mMessageQueue.Get(),
- mMessageQueueMessages));
- // if queue.mMessages is null, queue.next() will block, which we don't
- // want. It turns out to be an order of magnitude more performant to do
- // this extra check here and block less vs. one fewer checks here and
- // more blocking.
- if (!msg) {
- return false;
- }
- }
-
- auto msg = Object::LocalRef::Adopt(
- env, env->CallObjectMethod(mMessageQueue.Get(), mMessageQueueNext));
- if (!msg) {
- return false;
- }
-
- return GeckoThread::PumpMessageLoop(msg);
-}
-
-NS_IMETHODIMP nsAndroidBridge::GetBrowserApp(nsIAndroidBrowserApp * *aBrowserApp)
-{
- nsAppShell* const appShell = nsAppShell::Get();
- if (appShell)
- NS_IF_ADDREF(*aBrowserApp = appShell->GetBrowserApp());
- return NS_OK;
-}
-
-NS_IMETHODIMP nsAndroidBridge::SetBrowserApp(nsIAndroidBrowserApp *aBrowserApp)
-{
- nsAppShell* const appShell = nsAppShell::Get();
- if (appShell)
- appShell->SetBrowserApp(aBrowserApp);
- return NS_OK;
-}
-
-extern "C"
-__attribute__ ((visibility("default")))
-jobject JNICALL
-Java_org_mozilla_gecko_GeckoAppShell_allocateDirectBuffer(JNIEnv *env, jclass, jlong size);
-
-static jni::DependentRef<java::GeckoLayerClient>
-GetJavaLayerClient(mozIDOMWindowProxy* aWindow)
-{
- MOZ_ASSERT(aWindow);
-
- nsCOMPtr<nsPIDOMWindowOuter> domWindow = nsPIDOMWindowOuter::From(aWindow);
- nsCOMPtr<nsIWidget> widget =
- widget::WidgetUtils::DOMWindowToWidget(domWindow);
- MOZ_ASSERT(widget);
-
- return static_cast<nsWindow*>(widget.get())->GetLayerClient();
-}
-
-void
-AndroidBridge::ContentDocumentChanged(mozIDOMWindowProxy* aWindow)
-{
- auto layerClient = GetJavaLayerClient(aWindow);
- if (!layerClient) {
- return;
- }
- layerClient->ContentDocumentChanged();
-}
-
-bool
-AndroidBridge::IsContentDocumentDisplayed(mozIDOMWindowProxy* aWindow)
-{
- auto layerClient = GetJavaLayerClient(aWindow);
- if (!layerClient) {
- return false;
- }
- return layerClient->IsContentDocumentDisplayed();
-}
-
-class AndroidBridge::DelayedTask
-{
- using TimeStamp = mozilla::TimeStamp;
- using TimeDuration = mozilla::TimeDuration;
-
-public:
- DelayedTask(already_AddRefed<Runnable> aTask)
- : mTask(aTask)
- , mRunTime() // Null timestamp representing no delay.
- {}
-
- DelayedTask(already_AddRefed<Runnable> aTask, int aDelayMs)
- : mTask(aTask)
- , mRunTime(TimeStamp::Now() + TimeDuration::FromMilliseconds(aDelayMs))
- {}
-
- bool IsEarlierThan(const DelayedTask& aOther) const
- {
- if (mRunTime) {
- return aOther.mRunTime ? mRunTime < aOther.mRunTime : false;
- }
- // In the case of no delay, we're earlier if aOther has a delay.
- // Otherwise, we're not earlier, to maintain task order.
- return !!aOther.mRunTime;
- }
-
- int64_t MillisecondsToRunTime() const
- {
- if (mRunTime) {
- return int64_t((mRunTime - TimeStamp::Now()).ToMilliseconds());
- }
- return 0;
- }
-
- already_AddRefed<Runnable> TakeTask()
- {
- return mTask.forget();
- }
-
-private:
- RefPtr<Runnable> mTask;
- const TimeStamp mRunTime;
-};
-
-
-void
-AndroidBridge::PostTaskToUiThread(already_AddRefed<Runnable> aTask, int aDelayMs)
-{
- // add the new task into the mUiTaskQueue, sorted with
- // the earliest task first in the queue
- size_t i;
- DelayedTask newTask(aDelayMs ? DelayedTask(mozilla::Move(aTask), aDelayMs)
- : DelayedTask(mozilla::Move(aTask)));
-
- {
- MutexAutoLock lock(mUiTaskQueueLock);
-
- for (i = 0; i < mUiTaskQueue.Length(); i++) {
- if (newTask.IsEarlierThan(mUiTaskQueue[i])) {
- mUiTaskQueue.InsertElementAt(i, mozilla::Move(newTask));
- break;
- }
- }
-
- if (i == mUiTaskQueue.Length()) {
- // We didn't insert the task, which means we should append it.
- mUiTaskQueue.AppendElement(mozilla::Move(newTask));
- }
- }
-
- if (i == 0) {
- // if we're inserting it at the head of the queue, notify Java because
- // we need to get a callback at an earlier time than the last scheduled
- // callback
- GeckoThread::RequestUiThreadCallback(int64_t(aDelayMs));
- }
-}
-
-int64_t
-AndroidBridge::RunDelayedUiThreadTasks()
-{
- MutexAutoLock lock(mUiTaskQueueLock);
-
- while (!mUiTaskQueue.IsEmpty()) {
- const int64_t timeLeft = mUiTaskQueue[0].MillisecondsToRunTime();
- if (timeLeft > 0) {
- // this task (and therefore all remaining tasks)
- // have not yet reached their runtime. return the
- // time left until we should be called again
- return timeLeft;
- }
-
- // Retrieve task before unlocking/running.
- RefPtr<Runnable> nextTask(mUiTaskQueue[0].TakeTask());
- mUiTaskQueue.RemoveElementAt(0);
-
- // Unlock to allow posting new tasks reentrantly.
- MutexAutoUnlock unlock(mUiTaskQueueLock);
- nextTask->Run();
- }
- return -1;
-}
-
-Object::LocalRef AndroidBridge::ChannelCreate(Object::Param stream) {
- JNIEnv* const env = GetEnvForThread();
- auto rv = Object::LocalRef::Adopt(env, env->CallStaticObjectMethod(
- sBridge->jChannels, sBridge->jChannelCreate, stream.Get()));
- MOZ_CATCH_JNI_EXCEPTION(env);
- return rv;
-}
-
-void AndroidBridge::InputStreamClose(Object::Param obj) {
- JNIEnv* const env = GetEnvForThread();
- env->CallVoidMethod(obj.Get(), sBridge->jClose);
- MOZ_CATCH_JNI_EXCEPTION(env);
-}
-
-uint32_t AndroidBridge::InputStreamAvailable(Object::Param obj) {
- JNIEnv* const env = GetEnvForThread();
- auto rv = env->CallIntMethod(obj.Get(), sBridge->jAvailable);
- MOZ_CATCH_JNI_EXCEPTION(env);
- return rv;
-}
-
-nsresult AndroidBridge::InputStreamRead(Object::Param obj, char *aBuf, uint32_t aCount, uint32_t *aRead) {
- JNIEnv* const env = GetEnvForThread();
- auto arr = ByteBuffer::New(aBuf, aCount);
- jint read = env->CallIntMethod(obj.Get(), sBridge->jByteBufferRead, arr.Get());
-
- if (env->ExceptionCheck()) {
- env->ExceptionClear();
- return NS_ERROR_FAILURE;
- }
-
- if (read <= 0) {
- *aRead = 0;
- return NS_OK;
- }
- *aRead = read;
- return NS_OK;
-}
diff --git a/widget/android/AndroidBridge.h b/widget/android/AndroidBridge.h
deleted file mode 100644
index 73dc1b5ff..000000000
--- a/widget/android/AndroidBridge.h
+++ /dev/null
@@ -1,419 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef AndroidBridge_h__
-#define AndroidBridge_h__
-
-#include <jni.h>
-#include <android/log.h>
-#include <cstdlib>
-#include <pthread.h>
-
-#include "APKOpen.h"
-
-#include "nsCOMPtr.h"
-#include "nsCOMArray.h"
-
-#include "GeneratedJNIWrappers.h"
-
-#include "nsIMutableArray.h"
-#include "nsIMIMEInfo.h"
-#include "nsColor.h"
-#include "gfxRect.h"
-
-#include "nsIAndroidBridge.h"
-#include "nsIDOMDOMCursor.h"
-
-#include "mozilla/Likely.h"
-#include "mozilla/Mutex.h"
-#include "mozilla/Types.h"
-#include "mozilla/gfx/Point.h"
-#include "mozilla/jni/Utils.h"
-#include "nsIObserver.h"
-#include "nsDataHashtable.h"
-
-#include "Units.h"
-
-// Some debug #defines
-// #define DEBUG_ANDROID_EVENTS
-// #define DEBUG_ANDROID_WIDGET
-
-class nsPIDOMWindowOuter;
-
-namespace base {
-class Thread;
-} // end namespace base
-
-typedef void* EGLSurface;
-
-namespace mozilla {
-
-class AutoLocalJNIFrame;
-class Runnable;
-
-namespace hal {
-class BatteryInformation;
-class NetworkInformation;
-} // namespace hal
-
-// The order and number of the members in this structure must correspond
-// to the attrsAppearance array in GeckoAppShell.getSystemColors()
-typedef struct AndroidSystemColors {
- nscolor textColorPrimary;
- nscolor textColorPrimaryInverse;
- nscolor textColorSecondary;
- nscolor textColorSecondaryInverse;
- nscolor textColorTertiary;
- nscolor textColorTertiaryInverse;
- nscolor textColorHighlight;
- nscolor colorForeground;
- nscolor colorBackground;
- nscolor panelColorForeground;
- nscolor panelColorBackground;
-} AndroidSystemColors;
-
-class MessageCursorContinueCallback : public nsICursorContinueCallback
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSICURSORCONTINUECALLBACK
-
- MessageCursorContinueCallback(int aRequestId)
- : mRequestId(aRequestId)
- {
- }
-private:
- virtual ~MessageCursorContinueCallback()
- {
- }
-
- int mRequestId;
-};
-
-class AndroidBridge final
-{
-public:
- enum {
- // Values for NotifyIME, in addition to values from the Gecko
- // IMEMessage enum; use negative values here to prevent conflict
- NOTIFY_IME_OPEN_VKB = -2,
- NOTIFY_IME_REPLY_EVENT = -1,
- };
-
- enum {
- LAYER_CLIENT_TYPE_NONE = 0,
- LAYER_CLIENT_TYPE_GL = 2 // AndroidGeckoGLLayerClient
- };
-
- static bool IsJavaUiThread() {
- return pthread_equal(pthread_self(), ::getJavaUiThread());
- }
-
- static void ConstructBridge();
- static void DeconstructBridge();
-
- static AndroidBridge *Bridge() {
- return sBridge;
- }
-
- void ContentDocumentChanged(mozIDOMWindowProxy* aDOMWindow);
- bool IsContentDocumentDisplayed(mozIDOMWindowProxy* aDOMWindow);
-
- bool GetHandlersForURL(const nsAString& aURL,
- nsIMutableArray* handlersArray = nullptr,
- nsIHandlerApp **aDefaultApp = nullptr,
- const nsAString& aAction = EmptyString());
-
- bool GetHandlersForMimeType(const nsAString& aMimeType,
- nsIMutableArray* handlersArray = nullptr,
- nsIHandlerApp **aDefaultApp = nullptr,
- const nsAString& aAction = EmptyString());
-
- bool GetHWEncoderCapability();
- bool GetHWDecoderCapability();
-
- void GetMimeTypeFromExtensions(const nsACString& aFileExt, nsCString& aMimeType);
- void GetExtensionFromMimeType(const nsACString& aMimeType, nsACString& aFileExt);
-
- bool GetClipboardText(nsAString& aText);
-
- int GetDPI();
- int GetScreenDepth();
-
- void Vibrate(const nsTArray<uint32_t>& aPattern);
-
- void GetSystemColors(AndroidSystemColors *aColors);
-
- void GetIconForExtension(const nsACString& aFileExt, uint32_t aIconSize, uint8_t * const aBuf);
-
- bool GetStaticStringField(const char *classID, const char *field, nsAString &result, JNIEnv* env = nullptr);
-
- bool GetStaticIntField(const char *className, const char *fieldName, int32_t* aInt, JNIEnv* env = nullptr);
-
- // Returns a global reference to the Context for Fennec's Activity. The
- // caller is responsible for ensuring this doesn't leak by calling
- // DeleteGlobalRef() when the context is no longer needed.
- jobject GetGlobalContextRef(void);
-
- void HandleGeckoMessage(JSContext* cx, JS::HandleObject message);
-
- void GetCurrentBatteryInformation(hal::BatteryInformation* aBatteryInfo);
-
- void GetCurrentNetworkInformation(hal::NetworkInformation* aNetworkInfo);
-
- // These methods don't use a ScreenOrientation because it's an
- // enum and that would require including the header which requires
- // include IPC headers which requires including basictypes.h which
- // requires a lot of changes...
- uint32_t GetScreenOrientation();
- uint16_t GetScreenAngle();
-
- int GetAPIVersion() { return mAPIVersion; }
-
- nsresult GetProxyForURI(const nsACString & aSpec,
- const nsACString & aScheme,
- const nsACString & aHost,
- const int32_t aPort,
- nsACString & aResult);
-
- bool PumpMessageLoop();
-
- // Utility methods.
- static jstring NewJavaString(JNIEnv* env, const char16_t* string, uint32_t len);
- static jstring NewJavaString(JNIEnv* env, const nsAString& string);
- static jstring NewJavaString(JNIEnv* env, const char* string);
- static jstring NewJavaString(JNIEnv* env, const nsACString& string);
-
- static jstring NewJavaString(AutoLocalJNIFrame* frame, const char16_t* string, uint32_t len);
- static jstring NewJavaString(AutoLocalJNIFrame* frame, const nsAString& string);
- static jstring NewJavaString(AutoLocalJNIFrame* frame, const char* string);
- static jstring NewJavaString(AutoLocalJNIFrame* frame, const nsACString& string);
-
- static jfieldID GetFieldID(JNIEnv* env, jclass jClass, const char* fieldName, const char* fieldType);
- static jfieldID GetStaticFieldID(JNIEnv* env, jclass jClass, const char* fieldName, const char* fieldType);
- static jmethodID GetMethodID(JNIEnv* env, jclass jClass, const char* methodName, const char* methodType);
- static jmethodID GetStaticMethodID(JNIEnv* env, jclass jClass, const char* methodName, const char* methodType);
-
- static jni::Object::LocalRef ChannelCreate(jni::Object::Param);
-
- static void InputStreamClose(jni::Object::Param obj);
- static uint32_t InputStreamAvailable(jni::Object::Param obj);
- static nsresult InputStreamRead(jni::Object::Param obj, char *aBuf, uint32_t aCount, uint32_t *aRead);
-
-protected:
- static nsDataHashtable<nsStringHashKey, nsString> sStoragePaths;
-
- static AndroidBridge* sBridge;
-
- AndroidBridge();
- ~AndroidBridge();
-
- int mAPIVersion;
-
- // intput stream
- jclass jReadableByteChannel;
- jclass jChannels;
- jmethodID jChannelCreate;
- jmethodID jByteBufferRead;
-
- jclass jInputStream;
- jmethodID jClose;
- jmethodID jAvailable;
-
- jmethodID jCalculateLength;
-
- // some convinient types to have around
- jclass jStringClass;
-
- jni::Object::GlobalRef mMessageQueue;
- jfieldID mMessageQueueMessages;
- jmethodID mMessageQueueNext;
-
-private:
- class DelayedTask;
- nsTArray<DelayedTask> mUiTaskQueue;
- mozilla::Mutex mUiTaskQueueLock;
-
-public:
- void PostTaskToUiThread(already_AddRefed<Runnable> aTask, int aDelayMs);
- int64_t RunDelayedUiThreadTasks();
-};
-
-class AutoJNIClass {
-private:
- JNIEnv* const mEnv;
- const jclass mClass;
-
-public:
- AutoJNIClass(JNIEnv* jEnv, const char* name)
- : mEnv(jEnv)
- , mClass(jni::GetClassRef(jEnv, name))
- {}
-
- ~AutoJNIClass() {
- mEnv->DeleteLocalRef(mClass);
- }
-
- jclass getRawRef() const {
- return mClass;
- }
-
- jclass getGlobalRef() const {
- return static_cast<jclass>(mEnv->NewGlobalRef(mClass));
- }
-
- jfieldID getField(const char* name, const char* type) const {
- return AndroidBridge::GetFieldID(mEnv, mClass, name, type);
- }
-
- jfieldID getStaticField(const char* name, const char* type) const {
- return AndroidBridge::GetStaticFieldID(mEnv, mClass, name, type);
- }
-
- jmethodID getMethod(const char* name, const char* type) const {
- return AndroidBridge::GetMethodID(mEnv, mClass, name, type);
- }
-
- jmethodID getStaticMethod(const char* name, const char* type) const {
- return AndroidBridge::GetStaticMethodID(mEnv, mClass, name, type);
- }
-};
-
-class AutoJObject {
-public:
- AutoJObject(JNIEnv* aJNIEnv = nullptr) : mObject(nullptr)
- {
- mJNIEnv = aJNIEnv ? aJNIEnv : jni::GetGeckoThreadEnv();
- }
-
- AutoJObject(JNIEnv* aJNIEnv, jobject aObject)
- {
- mJNIEnv = aJNIEnv ? aJNIEnv : jni::GetGeckoThreadEnv();
- mObject = aObject;
- }
-
- ~AutoJObject() {
- if (mObject)
- mJNIEnv->DeleteLocalRef(mObject);
- }
-
- jobject operator=(jobject aObject)
- {
- if (mObject) {
- mJNIEnv->DeleteLocalRef(mObject);
- }
- return mObject = aObject;
- }
-
- operator jobject() {
- return mObject;
- }
-private:
- JNIEnv* mJNIEnv;
- jobject mObject;
-};
-
-class AutoLocalJNIFrame {
-public:
- AutoLocalJNIFrame(int nEntries = 15)
- : mEntries(nEntries)
- , mJNIEnv(jni::GetGeckoThreadEnv())
- , mHasFrameBeenPushed(false)
- {
- MOZ_ASSERT(mJNIEnv);
- Push();
- }
-
- AutoLocalJNIFrame(JNIEnv* aJNIEnv, int nEntries = 15)
- : mEntries(nEntries)
- , mJNIEnv(aJNIEnv ? aJNIEnv : jni::GetGeckoThreadEnv())
- , mHasFrameBeenPushed(false)
- {
- MOZ_ASSERT(mJNIEnv);
- Push();
- }
-
- ~AutoLocalJNIFrame() {
- if (mHasFrameBeenPushed) {
- Pop();
- }
- }
-
- JNIEnv* GetEnv() {
- return mJNIEnv;
- }
-
- bool CheckForException() {
- if (mJNIEnv->ExceptionCheck()) {
- MOZ_CATCH_JNI_EXCEPTION(mJNIEnv);
- return true;
- }
- return false;
- }
-
- // Note! Calling Purge makes all previous local refs created in
- // the AutoLocalJNIFrame's scope INVALID; be sure that you locked down
- // any local refs that you need to keep around in global refs!
- void Purge() {
- Pop();
- Push();
- }
-
- template <typename ReturnType = jobject>
- ReturnType Pop(ReturnType aResult = nullptr) {
- MOZ_ASSERT(mHasFrameBeenPushed);
- mHasFrameBeenPushed = false;
- return static_cast<ReturnType>(
- mJNIEnv->PopLocalFrame(static_cast<jobject>(aResult)));
- }
-
-private:
- void Push() {
- MOZ_ASSERT(!mHasFrameBeenPushed);
- // Make sure there is enough space to store a local ref to the
- // exception. I am not completely sure this is needed, but does
- // not hurt.
- if (mJNIEnv->PushLocalFrame(mEntries + 1) != 0) {
- CheckForException();
- return;
- }
- mHasFrameBeenPushed = true;
- }
-
- const int mEntries;
- JNIEnv* const mJNIEnv;
- bool mHasFrameBeenPushed;
-};
-
-}
-
-#define NS_ANDROIDBRIDGE_CID \
-{ 0x0FE2321D, 0xEBD9, 0x467D, \
- { 0xA7, 0x43, 0x03, 0xA6, 0x8D, 0x40, 0x59, 0x9E } }
-
-class nsAndroidBridge final : public nsIAndroidBridge,
- public nsIObserver
-{
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSIANDROIDBRIDGE
- NS_DECL_NSIOBSERVER
-
- nsAndroidBridge();
-
-private:
- ~nsAndroidBridge();
-
- void AddObservers();
- void RemoveObservers();
-
- void UpdateAudioPlayingWindows(uint64_t aWindowId, bool aPlaying);
-
- nsTArray<uint64_t> mAudioPlayingWindows;
-
-protected:
-};
-
-#endif /* AndroidBridge_h__ */
diff --git a/widget/android/AndroidBridgeUtilities.h b/widget/android/AndroidBridgeUtilities.h
deleted file mode 100644
index ca8326281..000000000
--- a/widget/android/AndroidBridgeUtilities.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef ALOG
-#if defined(DEBUG) || defined(FORCE_ALOG)
-#define ALOG(args...) __android_log_print(ANDROID_LOG_INFO, "Gecko" , ## args)
-#else
-#define ALOG(args...) ((void)0)
-#endif
-#endif
-
-#ifdef DEBUG
-#define ALOG_BRIDGE(args...) ALOG(args)
-#else
-#define ALOG_BRIDGE(args...) ((void)0)
-#endif
diff --git a/widget/android/AndroidCompositorWidget.cpp b/widget/android/AndroidCompositorWidget.cpp
deleted file mode 100644
index 91cc08531..000000000
--- a/widget/android/AndroidCompositorWidget.cpp
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set sw=2 ts=2 et tw=80 : */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "AndroidCompositorWidget.h"
-#include "nsWindow.h"
-
-namespace mozilla {
-namespace widget {
-
-void
-AndroidCompositorWidget::SetFirstPaintViewport(const LayerIntPoint& aOffset,
- const CSSToLayerScale& aZoom,
- const CSSRect& aCssPageRect)
-{
- auto layerClient = static_cast<nsWindow*>(RealWidget())->GetLayerClient();
- if (!layerClient) {
- return;
- }
-
- layerClient->SetFirstPaintViewport(
- float(aOffset.x), float(aOffset.y), aZoom.scale, aCssPageRect.x,
- aCssPageRect.y, aCssPageRect.XMost(), aCssPageRect.YMost());
-}
-
-void
-AndroidCompositorWidget::SyncFrameMetrics(const ParentLayerPoint& aScrollOffset,
- const CSSToParentLayerScale& aZoom,
- const CSSRect& aCssPageRect,
- const CSSRect& aDisplayPort,
- const CSSToLayerScale& aPaintedResolution,
- bool aLayersUpdated,
- int32_t aPaintSyncId,
- ScreenMargin& aFixedLayerMargins)
-{
- auto layerClient = static_cast<nsWindow*>(RealWidget())->GetLayerClient();
- if (!layerClient) {
- return;
- }
-
- // convert the displayport rect from document-relative CSS pixels to
- // document-relative device pixels
- LayerIntRect dp = gfx::RoundedToInt(aDisplayPort * aPaintedResolution);
-
- java::ViewTransform::LocalRef viewTransform = layerClient->SyncFrameMetrics(
- aScrollOffset.x, aScrollOffset.y, aZoom.scale,
- aCssPageRect.x, aCssPageRect.y,
- aCssPageRect.XMost(), aCssPageRect.YMost(),
- dp.x, dp.y, dp.width, dp.height,
- aPaintedResolution.scale, aLayersUpdated, aPaintSyncId);
-
- MOZ_ASSERT(viewTransform, "No view transform object!");
-
- aFixedLayerMargins.top = viewTransform->FixedLayerMarginTop();
- aFixedLayerMargins.right = viewTransform->FixedLayerMarginRight();
- aFixedLayerMargins.bottom = viewTransform->FixedLayerMarginBottom();
- aFixedLayerMargins.left = viewTransform->FixedLayerMarginLeft();
-}
-
-} // namespace widget
-} // namespace mozilla
diff --git a/widget/android/AndroidCompositorWidget.h b/widget/android/AndroidCompositorWidget.h
deleted file mode 100644
index 23076e30d..000000000
--- a/widget/android/AndroidCompositorWidget.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_widget_AndroidCompositorWidget_h
-#define mozilla_widget_AndroidCompositorWidget_h
-
-#include "mozilla/widget/InProcessCompositorWidget.h"
-
-namespace mozilla {
-namespace widget {
-
-/**
- * AndroidCompositorWidget inherits from InProcessCompositorWidget because
- * Android does not support OOP compositing yet. Once it does,
- * AndroidCompositorWidget will be made to inherit from CompositorWidget
- * instead.
- */
-class AndroidCompositorWidget final : public InProcessCompositorWidget
-{
-public:
- using InProcessCompositorWidget::InProcessCompositorWidget;
-
- AndroidCompositorWidget* AsAndroid() override { return this; }
-
- void SetFirstPaintViewport(const LayerIntPoint& aOffset,
- const CSSToLayerScale& aZoom,
- const CSSRect& aCssPageRect);
-
- void SyncFrameMetrics(const ParentLayerPoint& aScrollOffset,
- const CSSToParentLayerScale& aZoom,
- const CSSRect& aCssPageRect,
- const CSSRect& aDisplayPort,
- const CSSToLayerScale& aPaintedResolution,
- bool aLayersUpdated,
- int32_t aPaintSyncId,
- ScreenMargin& aFixedLayerMargins);
-};
-
-} // namespace widget
-} // namespace mozilla
-
-#endif // mozilla_widget_AndroidCompositorWidget_h
diff --git a/widget/android/AndroidContentController.cpp b/widget/android/AndroidContentController.cpp
deleted file mode 100644
index 1df053afb..000000000
--- a/widget/android/AndroidContentController.cpp
+++ /dev/null
@@ -1,157 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "AndroidContentController.h"
-
-#include "AndroidBridge.h"
-#include "base/message_loop.h"
-#include "mozilla/layers/APZCCallbackHelper.h"
-#include "mozilla/layers/IAPZCTreeManager.h"
-#include "nsIObserverService.h"
-#include "nsLayoutUtils.h"
-#include "nsWindow.h"
-
-using mozilla::layers::IAPZCTreeManager;
-
-namespace mozilla {
-namespace widget {
-
-void
-AndroidContentController::Destroy()
-{
- mAndroidWindow = nullptr;
- ChromeProcessController::Destroy();
-}
-
-void
-AndroidContentController::NotifyDefaultPrevented(IAPZCTreeManager* aManager,
- uint64_t aInputBlockId,
- bool aDefaultPrevented)
-{
- if (!AndroidBridge::IsJavaUiThread()) {
- // The notification must reach the APZ on the Java UI thread (aka the
- // APZ "controller" thread) but we get it from the Gecko thread, so we
- // have to throw it onto the other thread.
- AndroidBridge::Bridge()->PostTaskToUiThread(NewRunnableMethod<uint64_t, bool>(
- aManager, &IAPZCTreeManager::ContentReceivedInputBlock,
- aInputBlockId, aDefaultPrevented), 0);
- return;
- }
-
- aManager->ContentReceivedInputBlock(aInputBlockId, aDefaultPrevented);
-}
-
-void
-AndroidContentController::DispatchSingleTapToObservers(const LayoutDevicePoint& aPoint,
- const ScrollableLayerGuid& aGuid) const
-{
- nsIContent* content = nsLayoutUtils::FindContentFor(aGuid.mScrollId);
- nsPresContext* context = content
- ? mozilla::layers::APZCCallbackHelper::GetPresContextForContent(content)
- : nullptr;
-
- if (!context) {
- return;
- }
-
- CSSPoint point = mozilla::layers::APZCCallbackHelper::ApplyCallbackTransform(
- aPoint / context->CSSToDevPixelScale(), aGuid);
-
- nsPresContext* rcdContext = context->GetToplevelContentDocumentPresContext();
- if (rcdContext && rcdContext->PresShell()->ScaleToResolution()) {
- // We need to convert from the root document to the root content document,
- // by unapplying the resolution that's on the content document.
- const float resolution = rcdContext->PresShell()->GetResolution();
- point.x /= resolution;
- point.y /= resolution;
- }
-
- CSSIntPoint rounded = RoundedToInt(point);
- nsAppShell::PostEvent([rounded] {
- nsCOMPtr<nsIObserverService> obsServ =
- mozilla::services::GetObserverService();
- if (!obsServ) {
- return;
- }
-
- nsPrintfCString data("{\"x\":%d,\"y\":%d}", rounded.x, rounded.y);
- obsServ->NotifyObservers(nullptr, "Gesture:SingleTap",
- NS_ConvertASCIItoUTF16(data).get());
- });
-}
-
-void
-AndroidContentController::HandleTap(TapType aType, const LayoutDevicePoint& aPoint,
- Modifiers aModifiers,
- const ScrollableLayerGuid& aGuid,
- uint64_t aInputBlockId)
-{
- // This function will get invoked first on the Java UI thread, and then
- // again on the main thread (because of the code in ChromeProcessController::
- // HandleTap). We want to post the SingleTap message once; it can be
- // done from either thread but we need access to the callback transform
- // so we do it from the main thread.
- if (NS_IsMainThread() &&
- (aType == TapType::eSingleTap || aType == TapType::eSecondTap)) {
- DispatchSingleTapToObservers(aPoint, aGuid);
- }
-
- ChromeProcessController::HandleTap(aType, aPoint, aModifiers, aGuid, aInputBlockId);
-}
-
-void
-AndroidContentController::PostDelayedTask(already_AddRefed<Runnable> aTask, int aDelayMs)
-{
- AndroidBridge::Bridge()->PostTaskToUiThread(Move(aTask), aDelayMs);
-}
-void
-AndroidContentController::UpdateOverscrollVelocity(const float aX, const float aY, const bool aIsRootContent)
-{
- if (aIsRootContent && mAndroidWindow) {
- mAndroidWindow->UpdateOverscrollVelocity(aX, aY);
- }
-}
-
-void
-AndroidContentController::UpdateOverscrollOffset(const float aX, const float aY, const bool aIsRootContent)
-{
- if (aIsRootContent && mAndroidWindow) {
- mAndroidWindow->UpdateOverscrollOffset(aX, aY);
- }
-}
-
-void
-AndroidContentController::SetScrollingRootContent(const bool isRootContent)
-{
- if (mAndroidWindow) {
- mAndroidWindow->SetScrollingRootContent(isRootContent);
- }
-}
-
-void
-AndroidContentController::NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
- APZStateChange aChange,
- int aArg)
-{
- // This function may get invoked twice, if the first invocation is not on
- // the main thread then the ChromeProcessController version of this function
- // will redispatch to the main thread. We want to make sure that our handling
- // only happens on the main thread.
- ChromeProcessController::NotifyAPZStateChange(aGuid, aChange, aArg);
- if (NS_IsMainThread()) {
- nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
- if (aChange == layers::GeckoContentController::APZStateChange::eTransformEnd) {
- // This is used by tests to determine when the APZ is done doing whatever
- // it's doing. XXX generify this as needed when writing additional tests.
- observerService->NotifyObservers(nullptr, "APZ:TransformEnd", nullptr);
- observerService->NotifyObservers(nullptr, "PanZoom:StateChange", u"NOTHING");
- } else if (aChange == layers::GeckoContentController::APZStateChange::eTransformBegin) {
- observerService->NotifyObservers(nullptr, "PanZoom:StateChange", u"PANNING");
- }
- }
-}
-
-} // namespace widget
-} // namespace mozilla
diff --git a/widget/android/AndroidContentController.h b/widget/android/AndroidContentController.h
deleted file mode 100644
index 39674c939..000000000
--- a/widget/android/AndroidContentController.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef AndroidContentController_h__
-#define AndroidContentController_h__
-
-#include "mozilla/layers/ChromeProcessController.h"
-#include "mozilla/EventForwards.h" // for Modifiers
-#include "mozilla/StaticPtr.h"
-#include "mozilla/TimeStamp.h"
-#include "nsIDOMWindowUtils.h"
-#include "nsTArray.h"
-#include "nsWindow.h"
-
-namespace mozilla {
-namespace layers {
-class APZEventState;
-class IAPZCTreeManager;
-}
-namespace widget {
-
-class AndroidContentController final
- : public mozilla::layers::ChromeProcessController
-{
-public:
- AndroidContentController(nsWindow* aWindow,
- mozilla::layers::APZEventState* aAPZEventState,
- mozilla::layers::IAPZCTreeManager* aAPZCTreeManager)
- : mozilla::layers::ChromeProcessController(aWindow, aAPZEventState, aAPZCTreeManager)
- , mAndroidWindow(aWindow)
- {}
-
- // ChromeProcessController methods
- virtual void Destroy() override;
- void HandleTap(TapType aType, const LayoutDevicePoint& aPoint, Modifiers aModifiers,
- const ScrollableLayerGuid& aGuid, uint64_t aInputBlockId) override;
- void PostDelayedTask(already_AddRefed<Runnable> aTask, int aDelayMs) override;
- void UpdateOverscrollVelocity(const float aX, const float aY, const bool aIsRootContent) override;
- void UpdateOverscrollOffset(const float aX, const float aY, const bool aIsRootContent) override;
- void SetScrollingRootContent(const bool isRootContent) override;
- void NotifyAPZStateChange(const ScrollableLayerGuid& aGuid,
- APZStateChange aChange,
- int aArg) override;
-
- static void NotifyDefaultPrevented(mozilla::layers::IAPZCTreeManager* aManager,
- uint64_t aInputBlockId, bool aDefaultPrevented);
-private:
- nsWindow* mAndroidWindow;
-
- void DispatchSingleTapToObservers(const LayoutDevicePoint& aPoint,
- const ScrollableLayerGuid& aGuid) const;
-};
-
-} // namespace widget
-} // namespace mozilla
-
-#endif
diff --git a/widget/android/AndroidDirectTexture.h b/widget/android/AndroidDirectTexture.h
deleted file mode 100644
index 8582b8582..000000000
--- a/widget/android/AndroidDirectTexture.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef AndroidDirectTexture_h_
-#define AndroidDirectTexture_h_
-
-#include "gfxTypes.h"
-#include "mozilla/Mutex.h"
-#include "AndroidGraphicBuffer.h"
-#include "nsRect.h"
-
-namespace mozilla {
-
-/**
- * This is a thread safe wrapper around AndroidGraphicBuffer that handles
- * double buffering. Each call to Bind() flips the buffer when necessary.
- *
- * You need to be careful when destroying an instance of this class. If either
- * buffer is locked by the application of the driver/hardware, bad things will
- * happen. Be sure that the OpenGL texture is no longer on the screen.
- */
-class AndroidDirectTexture
-{
-public:
- AndroidDirectTexture(uint32_t width, uint32_t height, uint32_t usage, gfxImageFormat format);
- virtual ~AndroidDirectTexture();
-
- bool Lock(uint32_t usage, unsigned char **bits);
- bool Lock(uint32_t usage, const nsIntRect& rect, unsigned char **bits);
- bool Unlock(bool aFlip = true);
-
- bool Reallocate(uint32_t aWidth, uint32_t aHeight);
- bool Reallocate(uint32_t aWidth, uint32_t aHeight, gfxImageFormat aFormat);
-
- uint32_t Width() { return mWidth; }
- uint32_t Height() { return mHeight; }
-
- bool Bind();
-
-private:
- mozilla::Mutex mLock;
- bool mNeedFlip;
-
- uint32_t mWidth;
- uint32_t mHeight;
- gfxImageFormat mFormat;
-
- AndroidGraphicBuffer* mFrontBuffer;
- AndroidGraphicBuffer* mBackBuffer;
-
- AndroidGraphicBuffer* mPendingReallocBuffer;
- void ReallocPendingBuffer();
-};
-
-} /* mozilla */
-#endif /* AndroidDirectTexture_h_ */
diff --git a/widget/android/AndroidGraphicBuffer.h b/widget/android/AndroidGraphicBuffer.h
deleted file mode 100644
index 269f8680a..000000000
--- a/widget/android/AndroidGraphicBuffer.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef AndroidGraphicBuffer_h_
-#define AndroidGraphicBuffer_h_
-
-#include "gfxTypes.h"
-#include "nsRect.h"
-
-typedef void* EGLImageKHR;
-typedef void* EGLClientBuffer;
-
-namespace mozilla {
-
-/**
- * This class allows access to Android's direct texturing mechanism. Locking
- * the buffer gives you a pointer you can read/write to directly. It is fully
- * threadsafe, but you probably really want to use the AndroidDirectTexture
- * class which will handle double buffering.
- *
- * In order to use the buffer in OpenGL, just call Bind() and it will attach
- * to whatever texture is bound to GL_TEXTURE_2D.
- */
-class AndroidGraphicBuffer
-{
-public:
- enum {
- UsageSoftwareRead = 1,
- UsageSoftwareWrite = 1 << 1,
- UsageTexture = 1 << 2,
- UsageTarget = 1 << 3,
- Usage2D = 1 << 4
- };
-
- AndroidGraphicBuffer(uint32_t width, uint32_t height, uint32_t usage, gfxImageFormat format);
- virtual ~AndroidGraphicBuffer();
-
- int Lock(uint32_t usage, unsigned char **bits);
- int Lock(uint32_t usage, const nsIntRect& rect, unsigned char **bits);
- int Unlock();
- bool Reallocate(uint32_t aWidth, uint32_t aHeight, gfxImageFormat aFormat);
-
- uint32_t Width() { return mWidth; }
- uint32_t Height() { return mHeight; }
-
- bool Bind();
-
- static bool IsBlacklisted();
-
-private:
- uint32_t mWidth;
- uint32_t mHeight;
- uint32_t mUsage;
- gfxImageFormat mFormat;
-
- bool EnsureInitialized();
- bool EnsureEGLImage();
-
- void DestroyBuffer();
- bool EnsureBufferCreated();
-
- uint32_t GetAndroidUsage(uint32_t aUsage);
- uint32_t GetAndroidFormat(gfxImageFormat aFormat);
-
- void *mHandle;
- void *mEGLImage;
-};
-
-} /* mozilla */
-#endif /* AndroidGraphicBuffer_h_ */
diff --git a/widget/android/AndroidJNI.cpp b/widget/android/AndroidJNI.cpp
deleted file mode 100644
index 3e27d253b..000000000
--- a/widget/android/AndroidJNI.cpp
+++ /dev/null
@@ -1,47 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/Hal.h"
-#include "nsIFile.h"
-#include "nsString.h"
-
-#include "AndroidBridge.h"
-#include "AndroidContentController.h"
-#include "AndroidGraphicBuffer.h"
-
-#include <jni.h>
-#include <pthread.h>
-#include <dlfcn.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#include "nsAppShell.h"
-#include "nsWindow.h"
-#include <android/log.h>
-#include "nsIObserverService.h"
-#include "mozilla/Services.h"
-#include "nsThreadUtils.h"
-
-#include "mozilla/Unused.h"
-#include "mozilla/MathAlgorithms.h"
-#include "mozilla/UniquePtr.h"
-
-#include "mozilla/layers/APZCTreeManager.h"
-#include "nsPluginInstanceOwner.h"
-#include "AndroidSurfaceTexture.h"
-
-using namespace mozilla;
-using namespace mozilla::dom;
-using namespace mozilla::layers;
-using namespace mozilla::widget;
-
-/* Forward declare all the JNI methods as extern "C" */
-
-extern "C" {
-/*
- * Incoming JNI methods
- */
-
-}
diff --git a/widget/android/AndroidJNIWrapper.cpp b/widget/android/AndroidJNIWrapper.cpp
deleted file mode 100644
index e549c6fc7..000000000
--- a/widget/android/AndroidJNIWrapper.cpp
+++ /dev/null
@@ -1,140 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <android/log.h>
-#include <dlfcn.h>
-#include <prthread.h>
-
-#include "mozilla/DebugOnly.h"
-#include "mozilla/Assertions.h"
-#include "mozilla/SyncRunnable.h"
-#include "nsThreadUtils.h"
-#include "AndroidBridge.h"
-
-extern "C" {
- jclass __jsjni_GetGlobalClassRef(const char *className);
-}
-
-class GetGlobalClassRefRunnable : public mozilla::Runnable {
- public:
- GetGlobalClassRefRunnable(const char *className, jclass *foundClass) :
- mClassName(className), mResult(foundClass) {}
- NS_IMETHOD Run() override {
- *mResult = __jsjni_GetGlobalClassRef(mClassName);
- return NS_OK;
- }
- private:
- const char *mClassName;
- jclass *mResult;
-};
-
-extern "C" {
- __attribute__ ((visibility("default")))
- jclass
- jsjni_FindClass(const char *className) {
- // FindClass outside the main thread will run into problems due
- // to missing the classpath
- MOZ_ASSERT(NS_IsMainThread());
- JNIEnv *env = mozilla::jni::GetGeckoThreadEnv();
- return env->FindClass(className);
- }
-
- jclass
- __jsjni_GetGlobalClassRef(const char *className) {
- // root class globally
- JNIEnv *env = mozilla::jni::GetGeckoThreadEnv();
- jclass globalRef = static_cast<jclass>(env->NewGlobalRef(env->FindClass(className)));
- if (!globalRef)
- return nullptr;
-
- // return the newly create global reference
- return globalRef;
- }
-
- __attribute__ ((visibility("default")))
- jclass
- jsjni_GetGlobalClassRef(const char *className) {
- if (NS_IsMainThread()) {
- return __jsjni_GetGlobalClassRef(className);
- }
-
- nsCOMPtr<nsIThread> mainThread;
- mozilla::DebugOnly<nsresult> rv = NS_GetMainThread(getter_AddRefs(mainThread));
- MOZ_ASSERT(NS_SUCCEEDED(rv));
-
- jclass foundClass;
- nsCOMPtr<nsIRunnable> runnable_ref(new GetGlobalClassRefRunnable(className,
- &foundClass));
- RefPtr<mozilla::SyncRunnable> sr = new mozilla::SyncRunnable(runnable_ref);
- sr->DispatchToThread(mainThread);
- if (!foundClass)
- return nullptr;
-
- return foundClass;
- }
-
- __attribute__ ((visibility("default")))
- jmethodID
- jsjni_GetStaticMethodID(jclass methodClass,
- const char *methodName,
- const char *signature) {
- JNIEnv *env = mozilla::jni::GetGeckoThreadEnv();
- return env->GetStaticMethodID(methodClass, methodName, signature);
- }
-
- __attribute__ ((visibility("default")))
- bool
- jsjni_ExceptionCheck() {
- JNIEnv *env = mozilla::jni::GetGeckoThreadEnv();
- return env->ExceptionCheck();
- }
-
- __attribute__ ((visibility("default")))
- void
- jsjni_CallStaticVoidMethodA(jclass cls,
- jmethodID method,
- jvalue *values) {
- JNIEnv *env = mozilla::jni::GetGeckoThreadEnv();
-
- mozilla::AutoLocalJNIFrame jniFrame(env);
- env->CallStaticVoidMethodA(cls, method, values);
- }
-
- __attribute__ ((visibility("default")))
- int
- jsjni_CallStaticIntMethodA(jclass cls,
- jmethodID method,
- jvalue *values) {
- JNIEnv *env = mozilla::jni::GetGeckoThreadEnv();
-
- mozilla::AutoLocalJNIFrame jniFrame(env);
- return env->CallStaticIntMethodA(cls, method, values);
- }
-
- __attribute__ ((visibility("default")))
- jobject jsjni_GetGlobalContextRef() {
- return mozilla::AndroidBridge::Bridge()->GetGlobalContextRef();
- }
-
- __attribute__ ((visibility("default")))
- JavaVM* jsjni_GetVM() {
- JavaVM* jvm;
- JNIEnv* const env = mozilla::jni::GetGeckoThreadEnv();
- MOZ_ALWAYS_TRUE(!env->GetJavaVM(&jvm));
- return jvm;
- }
-
- __attribute__ ((visibility("default")))
- JNIEnv* jsjni_GetJNIForThread() {
- return mozilla::jni::GetEnvForThread();
- }
-
- // For compatibility with JNI.jsm; some addons bundle their own JNI.jsm,
- // so we cannot just change the function name used in JNI.jsm.
- __attribute__ ((visibility("default")))
- JNIEnv* GetJNIForThread() {
- return mozilla::jni::GetEnvForThread();
- }
-}
diff --git a/widget/android/AndroidJNIWrapper.h b/widget/android/AndroidJNIWrapper.h
deleted file mode 100644
index 90bca2693..000000000
--- a/widget/android/AndroidJNIWrapper.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef AndroidJNIWrapper_h__
-#define AndroidJNIWrapper_h__
-
-#include "mozilla/Types.h"
-#include <jni.h>
-#include <android/log.h>
-
-extern "C" MOZ_EXPORT jclass jsjni_FindClass(const char *className);
-
-/**
- * JNIEnv::FindClass alternative.
- * Callable from any thread, including code
- * invoked via the JNI that doesn't have MOZILLA_INTERNAL_API defined.
- * The caller is responsible for ensuring that the class is not leaked by
- * calling DeleteGlobalRef at an appropriate time.
- */
-extern "C" MOZ_EXPORT jclass jsjni_GetGlobalClassRef(const char *className);
-
-extern "C" MOZ_EXPORT jmethodID jsjni_GetStaticMethodID(jclass methodClass,
- const char *methodName,
- const char *signature);
-extern "C" MOZ_EXPORT bool jsjni_ExceptionCheck();
-extern "C" MOZ_EXPORT void jsjni_CallStaticVoidMethodA(jclass cls, jmethodID method, jvalue *values);
-extern "C" MOZ_EXPORT int jsjni_CallStaticIntMethodA(jclass cls, jmethodID method, jvalue *values);
-extern "C" MOZ_EXPORT jobject jsjni_GetGlobalContextRef();
-extern "C" MOZ_EXPORT JavaVM* jsjni_GetVM();
-extern "C" MOZ_EXPORT JNIEnv* jsjni_GetJNIForThread();
-
-#endif /* AndroidJNIWrapper_h__ */
diff --git a/widget/android/AndroidJavaWrappers.cpp b/widget/android/AndroidJavaWrappers.cpp
deleted file mode 100644
index eb657a9c4..000000000
--- a/widget/android/AndroidJavaWrappers.cpp
+++ /dev/null
@@ -1,62 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "AndroidJavaWrappers.h"
-
-using namespace mozilla;
-
-nsJNIString::nsJNIString(jstring jstr, JNIEnv *jenv)
-{
- if (!jstr) {
- SetIsVoid(true);
- return;
- }
- JNIEnv *jni = jenv;
- if (!jni) {
- jni = jni::GetGeckoThreadEnv();
- }
- const jchar* jCharPtr = jni->GetStringChars(jstr, nullptr);
-
- if (!jCharPtr) {
- SetIsVoid(true);
- return;
- }
-
- jsize len = jni->GetStringLength(jstr);
-
- if (len <= 0) {
- SetIsVoid(true);
- } else {
- Assign(reinterpret_cast<const char16_t*>(jCharPtr), len);
- }
- jni->ReleaseStringChars(jstr, jCharPtr);
-}
-
-nsJNICString::nsJNICString(jstring jstr, JNIEnv *jenv)
-{
- if (!jstr) {
- SetIsVoid(true);
- return;
- }
- JNIEnv *jni = jenv;
- if (!jni) {
- jni = jni::GetGeckoThreadEnv();
- }
- const char* jCharPtr = jni->GetStringUTFChars(jstr, nullptr);
-
- if (!jCharPtr) {
- SetIsVoid(true);
- return;
- }
-
- jsize len = jni->GetStringUTFLength(jstr);
-
- if (len <= 0) {
- SetIsVoid(true);
- } else {
- Assign(jCharPtr, len);
- }
- jni->ReleaseStringUTFChars(jstr, jCharPtr);
-}
diff --git a/widget/android/AndroidJavaWrappers.h b/widget/android/AndroidJavaWrappers.h
deleted file mode 100644
index fadf97353..000000000
--- a/widget/android/AndroidJavaWrappers.h
+++ /dev/null
@@ -1,218 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef AndroidJavaWrappers_h__
-#define AndroidJavaWrappers_h__
-
-#include <jni.h>
-#include <android/input.h>
-#include <android/log.h>
-#include <android/api-level.h>
-
-#include "nsRect.h"
-#include "nsString.h"
-#include "nsTArray.h"
-#include "nsIAndroidBridge.h"
-#include "mozilla/gfx/Rect.h"
-#include "mozilla/dom/Touch.h"
-#include "mozilla/EventForwards.h"
-#include "InputData.h"
-#include "Units.h"
-#include "FrameMetrics.h"
-
-//#define FORCE_ALOG 1
-
-class nsIAndroidDisplayport;
-class nsIWidget;
-
-namespace mozilla {
-
-enum {
- // These keycode masks are not defined in android/keycodes.h:
-#if __ANDROID_API__ < 13
- AKEYCODE_ESCAPE = 111,
- AKEYCODE_FORWARD_DEL = 112,
- AKEYCODE_CTRL_LEFT = 113,
- AKEYCODE_CTRL_RIGHT = 114,
- AKEYCODE_CAPS_LOCK = 115,
- AKEYCODE_SCROLL_LOCK = 116,
- AKEYCODE_META_LEFT = 117,
- AKEYCODE_META_RIGHT = 118,
- AKEYCODE_FUNCTION = 119,
- AKEYCODE_SYSRQ = 120,
- AKEYCODE_BREAK = 121,
- AKEYCODE_MOVE_HOME = 122,
- AKEYCODE_MOVE_END = 123,
- AKEYCODE_INSERT = 124,
- AKEYCODE_FORWARD = 125,
- AKEYCODE_MEDIA_PLAY = 126,
- AKEYCODE_MEDIA_PAUSE = 127,
- AKEYCODE_MEDIA_CLOSE = 128,
- AKEYCODE_MEDIA_EJECT = 129,
- AKEYCODE_MEDIA_RECORD = 130,
- AKEYCODE_F1 = 131,
- AKEYCODE_F2 = 132,
- AKEYCODE_F3 = 133,
- AKEYCODE_F4 = 134,
- AKEYCODE_F5 = 135,
- AKEYCODE_F6 = 136,
- AKEYCODE_F7 = 137,
- AKEYCODE_F8 = 138,
- AKEYCODE_F9 = 139,
- AKEYCODE_F10 = 140,
- AKEYCODE_F11 = 141,
- AKEYCODE_F12 = 142,
- AKEYCODE_NUM_LOCK = 143,
- AKEYCODE_NUMPAD_0 = 144,
- AKEYCODE_NUMPAD_1 = 145,
- AKEYCODE_NUMPAD_2 = 146,
- AKEYCODE_NUMPAD_3 = 147,
- AKEYCODE_NUMPAD_4 = 148,
- AKEYCODE_NUMPAD_5 = 149,
- AKEYCODE_NUMPAD_6 = 150,
- AKEYCODE_NUMPAD_7 = 151,
- AKEYCODE_NUMPAD_8 = 152,
- AKEYCODE_NUMPAD_9 = 153,
- AKEYCODE_NUMPAD_DIVIDE = 154,
- AKEYCODE_NUMPAD_MULTIPLY = 155,
- AKEYCODE_NUMPAD_SUBTRACT = 156,
- AKEYCODE_NUMPAD_ADD = 157,
- AKEYCODE_NUMPAD_DOT = 158,
- AKEYCODE_NUMPAD_COMMA = 159,
- AKEYCODE_NUMPAD_ENTER = 160,
- AKEYCODE_NUMPAD_EQUALS = 161,
- AKEYCODE_NUMPAD_LEFT_PAREN = 162,
- AKEYCODE_NUMPAD_RIGHT_PAREN = 163,
- AKEYCODE_VOLUME_MUTE = 164,
- AKEYCODE_INFO = 165,
- AKEYCODE_CHANNEL_UP = 166,
- AKEYCODE_CHANNEL_DOWN = 167,
- AKEYCODE_ZOOM_IN = 168,
- AKEYCODE_ZOOM_OUT = 169,
- AKEYCODE_TV = 170,
- AKEYCODE_WINDOW = 171,
- AKEYCODE_GUIDE = 172,
- AKEYCODE_DVR = 173,
- AKEYCODE_BOOKMARK = 174,
- AKEYCODE_CAPTIONS = 175,
- AKEYCODE_SETTINGS = 176,
- AKEYCODE_TV_POWER = 177,
- AKEYCODE_TV_INPUT = 178,
- AKEYCODE_STB_POWER = 179,
- AKEYCODE_STB_INPUT = 180,
- AKEYCODE_AVR_POWER = 181,
- AKEYCODE_AVR_INPUT = 182,
- AKEYCODE_PROG_RED = 183,
- AKEYCODE_PROG_GREEN = 184,
- AKEYCODE_PROG_YELLOW = 185,
- AKEYCODE_PROG_BLUE = 186,
- AKEYCODE_APP_SWITCH = 187,
- AKEYCODE_BUTTON_1 = 188,
- AKEYCODE_BUTTON_2 = 189,
- AKEYCODE_BUTTON_3 = 190,
- AKEYCODE_BUTTON_4 = 191,
- AKEYCODE_BUTTON_5 = 192,
- AKEYCODE_BUTTON_6 = 193,
- AKEYCODE_BUTTON_7 = 194,
- AKEYCODE_BUTTON_8 = 195,
- AKEYCODE_BUTTON_9 = 196,
- AKEYCODE_BUTTON_10 = 197,
- AKEYCODE_BUTTON_11 = 198,
- AKEYCODE_BUTTON_12 = 199,
- AKEYCODE_BUTTON_13 = 200,
- AKEYCODE_BUTTON_14 = 201,
- AKEYCODE_BUTTON_15 = 202,
- AKEYCODE_BUTTON_16 = 203,
-#endif
-#if __ANDROID_API__ < 14
- AKEYCODE_LANGUAGE_SWITCH = 204,
- AKEYCODE_MANNER_MODE = 205,
- AKEYCODE_3D_MODE = 206,
-#endif
-#if __ANDROID_API__ < 15
- AKEYCODE_CONTACTS = 207,
- AKEYCODE_CALENDAR = 208,
- AKEYCODE_MUSIC = 209,
- AKEYCODE_CALCULATOR = 210,
-#endif
-#if __ANDROID_API__ < 16
- AKEYCODE_ZENKAKU_HANKAKU = 211,
- AKEYCODE_EISU = 212,
- AKEYCODE_MUHENKAN = 213,
- AKEYCODE_HENKAN = 214,
- AKEYCODE_KATAKANA_HIRAGANA = 215,
- AKEYCODE_YEN = 216,
- AKEYCODE_RO = 217,
- AKEYCODE_KANA = 218,
- AKEYCODE_ASSIST = 219,
-#endif
-
- AMETA_FUNCTION_ON = 0x00000008,
- AMETA_CTRL_ON = 0x00001000,
- AMETA_CTRL_LEFT_ON = 0x00002000,
- AMETA_CTRL_RIGHT_ON = 0x00004000,
- AMETA_META_ON = 0x00010000,
- AMETA_META_LEFT_ON = 0x00020000,
- AMETA_META_RIGHT_ON = 0x00040000,
- AMETA_CAPS_LOCK_ON = 0x00100000,
- AMETA_NUM_LOCK_ON = 0x00200000,
- AMETA_SCROLL_LOCK_ON = 0x00400000,
-
- AMETA_ALT_MASK = AMETA_ALT_LEFT_ON | AMETA_ALT_RIGHT_ON | AMETA_ALT_ON,
- AMETA_CTRL_MASK = AMETA_CTRL_LEFT_ON | AMETA_CTRL_RIGHT_ON | AMETA_CTRL_ON,
- AMETA_META_MASK = AMETA_META_LEFT_ON | AMETA_META_RIGHT_ON | AMETA_META_ON,
- AMETA_SHIFT_MASK = AMETA_SHIFT_LEFT_ON | AMETA_SHIFT_RIGHT_ON | AMETA_SHIFT_ON,
-};
-
-class AndroidMotionEvent
-{
-public:
- enum {
- ACTION_DOWN = 0,
- ACTION_UP = 1,
- ACTION_MOVE = 2,
- ACTION_CANCEL = 3,
- ACTION_OUTSIDE = 4,
- ACTION_POINTER_DOWN = 5,
- ACTION_POINTER_UP = 6,
- ACTION_HOVER_MOVE = 7,
- ACTION_HOVER_ENTER = 9,
- ACTION_HOVER_EXIT = 10,
- ACTION_MAGNIFY_START = 11,
- ACTION_MAGNIFY = 12,
- ACTION_MAGNIFY_END = 13,
- EDGE_TOP = 0x00000001,
- EDGE_BOTTOM = 0x00000002,
- EDGE_LEFT = 0x00000004,
- EDGE_RIGHT = 0x00000008,
- SAMPLE_X = 0,
- SAMPLE_Y = 1,
- SAMPLE_PRESSURE = 2,
- SAMPLE_SIZE = 3,
- NUM_SAMPLE_DATA = 4,
- TOOL_TYPE_UNKNOWN = 0,
- TOOL_TYPE_FINGER = 1,
- TOOL_TYPE_STYLUS = 2,
- TOOL_TYPE_MOUSE = 3,
- TOOL_TYPE_ERASER = 4,
- dummy_java_enum_list_end
- };
-};
-
-class nsJNIString : public nsString
-{
-public:
- nsJNIString(jstring jstr, JNIEnv *jenv);
-};
-
-class nsJNICString : public nsCString
-{
-public:
- nsJNICString(jstring jstr, JNIEnv *jenv);
-};
-
-}
-
-#endif
diff --git a/widget/android/GeckoBatteryManager.h b/widget/android/GeckoBatteryManager.h
deleted file mode 100644
index a09e83efd..000000000
--- a/widget/android/GeckoBatteryManager.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef GeckoBatteryManager_h
-#define GeckoBatteryManager_h
-
-#include "GeneratedJNINatives.h"
-#include "nsAppShell.h"
-
-#include "mozilla/Hal.h"
-
-namespace mozilla {
-
-class GeckoBatteryManager final
- : public java::GeckoBatteryManager::Natives<GeckoBatteryManager>
-{
-public:
- static void
- OnBatteryChange(double aLevel, bool aCharging, double aRemainingTime)
- {
- hal::NotifyBatteryChange(
- hal::BatteryInformation(aLevel, aCharging, aRemainingTime));
- }
-};
-
-} // namespace mozilla
-
-#endif // GeckoBatteryManager_h
diff --git a/widget/android/GeckoNetworkManager.h b/widget/android/GeckoNetworkManager.h
deleted file mode 100644
index 63cbb9c79..000000000
--- a/widget/android/GeckoNetworkManager.h
+++ /dev/null
@@ -1,53 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef GeckoNetworkManager_h
-#define GeckoNetworkManager_h
-
-#include "GeneratedJNINatives.h"
-#include "nsAppShell.h"
-#include "nsCOMPtr.h"
-#include "nsINetworkLinkService.h"
-
-#include "mozilla/Services.h"
-
-namespace mozilla {
-
-class GeckoNetworkManager final
- : public java::GeckoNetworkManager::Natives<GeckoNetworkManager>
-{
- GeckoNetworkManager() = delete;
-
-public:
- static void
- OnConnectionChanged(int32_t aType, jni::String::Param aSubType,
- bool aIsWifi, int32_t aGateway)
- {
- hal::NotifyNetworkChange(hal::NetworkInformation(
- aType, aIsWifi, aGateway));
-
- nsCOMPtr<nsIObserverService> os = services::GetObserverService();
- if (os) {
- os->NotifyObservers(nullptr,
- NS_NETWORK_LINK_TYPE_TOPIC,
- aSubType->ToString().get());
- }
- }
-
- static void
- OnStatusChanged(jni::String::Param aStatus)
- {
- nsCOMPtr<nsIObserverService> os = mozilla::services::GetObserverService();
- if (os) {
- os->NotifyObservers(nullptr,
- NS_NETWORK_LINK_TOPIC,
- aStatus->ToString().get());
- }
- }
-};
-
-} // namespace mozilla
-
-#endif // GeckoNetworkManager_h
diff --git a/widget/android/GeckoScreenOrientation.h b/widget/android/GeckoScreenOrientation.h
deleted file mode 100644
index c6e5861be..000000000
--- a/widget/android/GeckoScreenOrientation.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef GeckoScreenOrientation_h
-#define GeckoScreenOrientation_h
-
-#include "GeneratedJNINatives.h"
-#include "nsAppShell.h"
-#include "nsCOMPtr.h"
-#include "nsIScreenManager.h"
-
-#include "mozilla/Hal.h"
-#include "mozilla/dom/ScreenOrientation.h"
-
-namespace mozilla {
-
-class GeckoScreenOrientation final
- : public java::GeckoScreenOrientation::Natives<GeckoScreenOrientation>
-{
- GeckoScreenOrientation() = delete;
-
-public:
- static void
- OnOrientationChange(int16_t aOrientation, int16_t aAngle)
- {
- nsCOMPtr<nsIScreenManager> screenMgr =
- do_GetService("@mozilla.org/gfx/screenmanager;1");
- nsCOMPtr<nsIScreen> screen;
-
- if (!screenMgr || NS_FAILED(screenMgr->GetPrimaryScreen(
- getter_AddRefs(screen))) || !screen) {
- return;
- }
-
- nsIntRect rect;
- int32_t colorDepth, pixelDepth;
-
- if (NS_FAILED(screen->GetRect(&rect.x, &rect.y,
- &rect.width, &rect.height)) ||
- NS_FAILED(screen->GetColorDepth(&colorDepth)) ||
- NS_FAILED(screen->GetPixelDepth(&pixelDepth))) {
- return;
- }
-
- hal::NotifyScreenConfigurationChange(hal::ScreenConfiguration(
- rect, static_cast<dom::ScreenOrientationInternal>(aOrientation),
- aAngle, colorDepth, pixelDepth));
- }
-};
-
-} // namespace mozilla
-
-#endif // GeckoScreenOrientation_h
diff --git a/widget/android/GeneratedJNINatives.h b/widget/android/GeneratedJNINatives.h
deleted file mode 100644
index bce88ce65..000000000
--- a/widget/android/GeneratedJNINatives.h
+++ /dev/null
@@ -1,526 +0,0 @@
-// GENERATED CODE
-// Generated by the Java program at /build/annotationProcessors at compile time
-// from annotations on Java methods. To update, change the annotations on the
-// corresponding Java methods and rerun the build. Manually updating this file
-// will cause your build to fail.
-
-#ifndef GeneratedJNINatives_h
-#define GeneratedJNINatives_h
-
-#include "GeneratedJNIWrappers.h"
-#include "mozilla/jni/Natives.h"
-
-namespace mozilla {
-namespace java {
-
-template<class Impl>
-class AlarmReceiver::Natives : public mozilla::jni::NativeImpl<AlarmReceiver, Impl>
-{
-public:
- static const JNINativeMethod methods[1];
-};
-
-template<class Impl>
-const JNINativeMethod AlarmReceiver::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<AlarmReceiver::NotifyAlarmFired_t>(
- mozilla::jni::NativeStub<AlarmReceiver::NotifyAlarmFired_t, Impl>
- ::template Wrap<&Impl::NotifyAlarmFired>)
-};
-
-template<class Impl>
-class AndroidGamepadManager::Natives : public mozilla::jni::NativeImpl<AndroidGamepadManager, Impl>
-{
-public:
- static const JNINativeMethod methods[3];
-};
-
-template<class Impl>
-const JNINativeMethod AndroidGamepadManager::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<AndroidGamepadManager::OnAxisChange_t>(
- mozilla::jni::NativeStub<AndroidGamepadManager::OnAxisChange_t, Impl>
- ::template Wrap<&Impl::OnAxisChange>),
-
- mozilla::jni::MakeNativeMethod<AndroidGamepadManager::OnButtonChange_t>(
- mozilla::jni::NativeStub<AndroidGamepadManager::OnButtonChange_t, Impl>
- ::template Wrap<&Impl::OnButtonChange>),
-
- mozilla::jni::MakeNativeMethod<AndroidGamepadManager::OnGamepadChange_t>(
- mozilla::jni::NativeStub<AndroidGamepadManager::OnGamepadChange_t, Impl>
- ::template Wrap<&Impl::OnGamepadChange>)
-};
-
-template<class Impl>
-class GeckoAppShell::Natives : public mozilla::jni::NativeImpl<GeckoAppShell, Impl>
-{
-public:
- static const JNINativeMethod methods[8];
-};
-
-template<class Impl>
-const JNINativeMethod GeckoAppShell::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<GeckoAppShell::NotifyObservers_t>(
- mozilla::jni::NativeStub<GeckoAppShell::NotifyObservers_t, Impl>
- ::template Wrap<&Impl::NotifyObservers>),
-
- mozilla::jni::MakeNativeMethod<GeckoAppShell::NotifyAlertListener_t>(
- mozilla::jni::NativeStub<GeckoAppShell::NotifyAlertListener_t, Impl>
- ::template Wrap<&Impl::NotifyAlertListener>),
-
- mozilla::jni::MakeNativeMethod<GeckoAppShell::NotifyUriVisited_t>(
- mozilla::jni::NativeStub<GeckoAppShell::NotifyUriVisited_t, Impl>
- ::template Wrap<&Impl::NotifyUriVisited>),
-
- mozilla::jni::MakeNativeMethod<GeckoAppShell::OnFullScreenPluginHidden_t>(
- mozilla::jni::NativeStub<GeckoAppShell::OnFullScreenPluginHidden_t, Impl>
- ::template Wrap<&Impl::OnFullScreenPluginHidden>),
-
- mozilla::jni::MakeNativeMethod<GeckoAppShell::OnLocationChanged_t>(
- mozilla::jni::NativeStub<GeckoAppShell::OnLocationChanged_t, Impl>
- ::template Wrap<&Impl::OnLocationChanged>),
-
- mozilla::jni::MakeNativeMethod<GeckoAppShell::OnSensorChanged_t>(
- mozilla::jni::NativeStub<GeckoAppShell::OnSensorChanged_t, Impl>
- ::template Wrap<&Impl::OnSensorChanged>),
-
- mozilla::jni::MakeNativeMethod<GeckoAppShell::ReportJavaCrash_t>(
- mozilla::jni::NativeStub<GeckoAppShell::ReportJavaCrash_t, Impl>
- ::template Wrap<&Impl::ReportJavaCrash>),
-
- mozilla::jni::MakeNativeMethod<GeckoAppShell::SyncNotifyObservers_t>(
- mozilla::jni::NativeStub<GeckoAppShell::SyncNotifyObservers_t, Impl>
- ::template Wrap<&Impl::SyncNotifyObservers>)
-};
-
-template<class Impl>
-class GeckoAppShell::CameraCallback::Natives : public mozilla::jni::NativeImpl<CameraCallback, Impl>
-{
-public:
- static const JNINativeMethod methods[1];
-};
-
-template<class Impl>
-const JNINativeMethod GeckoAppShell::CameraCallback::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<GeckoAppShell::CameraCallback::OnFrameData_t>(
- mozilla::jni::NativeStub<GeckoAppShell::CameraCallback::OnFrameData_t, Impl>
- ::template Wrap<&Impl::OnFrameData>)
-};
-
-template<class Impl>
-class GeckoBatteryManager::Natives : public mozilla::jni::NativeImpl<GeckoBatteryManager, Impl>
-{
-public:
- static const JNINativeMethod methods[1];
-};
-
-template<class Impl>
-const JNINativeMethod GeckoBatteryManager::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<GeckoBatteryManager::OnBatteryChange_t>(
- mozilla::jni::NativeStub<GeckoBatteryManager::OnBatteryChange_t, Impl>
- ::template Wrap<&Impl::OnBatteryChange>)
-};
-
-template<class Impl>
-class GeckoEditable::Natives : public mozilla::jni::NativeImpl<GeckoEditable, Impl>
-{
-public:
- static const JNINativeMethod methods[7];
-};
-
-template<class Impl>
-const JNINativeMethod GeckoEditable::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<GeckoEditable::DisposeNative_t>(
- mozilla::jni::NativeStub<GeckoEditable::DisposeNative_t, Impl>
- ::template Wrap<&Impl::DisposeNative>),
-
- mozilla::jni::MakeNativeMethod<GeckoEditable::OnImeAddCompositionRange_t>(
- mozilla::jni::NativeStub<GeckoEditable::OnImeAddCompositionRange_t, Impl>
- ::template Wrap<&Impl::OnImeAddCompositionRange>),
-
- mozilla::jni::MakeNativeMethod<GeckoEditable::OnImeReplaceText_t>(
- mozilla::jni::NativeStub<GeckoEditable::OnImeReplaceText_t, Impl>
- ::template Wrap<&Impl::OnImeReplaceText>),
-
- mozilla::jni::MakeNativeMethod<GeckoEditable::OnImeRequestCursorUpdates_t>(
- mozilla::jni::NativeStub<GeckoEditable::OnImeRequestCursorUpdates_t, Impl>
- ::template Wrap<&Impl::OnImeRequestCursorUpdates>),
-
- mozilla::jni::MakeNativeMethod<GeckoEditable::OnImeSynchronize_t>(
- mozilla::jni::NativeStub<GeckoEditable::OnImeSynchronize_t, Impl>
- ::template Wrap<&Impl::OnImeSynchronize>),
-
- mozilla::jni::MakeNativeMethod<GeckoEditable::OnImeUpdateComposition_t>(
- mozilla::jni::NativeStub<GeckoEditable::OnImeUpdateComposition_t, Impl>
- ::template Wrap<&Impl::OnImeUpdateComposition>),
-
- mozilla::jni::MakeNativeMethod<GeckoEditable::OnKeyEvent_t>(
- mozilla::jni::NativeStub<GeckoEditable::OnKeyEvent_t, Impl>
- ::template Wrap<&Impl::OnKeyEvent>)
-};
-
-template<class Impl>
-class GeckoNetworkManager::Natives : public mozilla::jni::NativeImpl<GeckoNetworkManager, Impl>
-{
-public:
- static const JNINativeMethod methods[2];
-};
-
-template<class Impl>
-const JNINativeMethod GeckoNetworkManager::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<GeckoNetworkManager::OnConnectionChanged_t>(
- mozilla::jni::NativeStub<GeckoNetworkManager::OnConnectionChanged_t, Impl>
- ::template Wrap<&Impl::OnConnectionChanged>),
-
- mozilla::jni::MakeNativeMethod<GeckoNetworkManager::OnStatusChanged_t>(
- mozilla::jni::NativeStub<GeckoNetworkManager::OnStatusChanged_t, Impl>
- ::template Wrap<&Impl::OnStatusChanged>)
-};
-
-template<class Impl>
-class GeckoScreenOrientation::Natives : public mozilla::jni::NativeImpl<GeckoScreenOrientation, Impl>
-{
-public:
- static const JNINativeMethod methods[1];
-};
-
-template<class Impl>
-const JNINativeMethod GeckoScreenOrientation::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<GeckoScreenOrientation::OnOrientationChange_t>(
- mozilla::jni::NativeStub<GeckoScreenOrientation::OnOrientationChange_t, Impl>
- ::template Wrap<&Impl::OnOrientationChange>)
-};
-
-template<class Impl>
-class GeckoThread::Natives : public mozilla::jni::NativeImpl<GeckoThread, Impl>
-{
-public:
- static const JNINativeMethod methods[6];
-};
-
-template<class Impl>
-const JNINativeMethod GeckoThread::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<GeckoThread::CreateServices_t>(
- mozilla::jni::NativeStub<GeckoThread::CreateServices_t, Impl>
- ::template Wrap<&Impl::CreateServices>),
-
- mozilla::jni::MakeNativeMethod<GeckoThread::OnPause_t>(
- mozilla::jni::NativeStub<GeckoThread::OnPause_t, Impl>
- ::template Wrap<&Impl::OnPause>),
-
- mozilla::jni::MakeNativeMethod<GeckoThread::OnResume_t>(
- mozilla::jni::NativeStub<GeckoThread::OnResume_t, Impl>
- ::template Wrap<&Impl::OnResume>),
-
- mozilla::jni::MakeNativeMethod<GeckoThread::RunUiThreadCallback_t>(
- mozilla::jni::NativeStub<GeckoThread::RunUiThreadCallback_t, Impl>
- ::template Wrap<&Impl::RunUiThreadCallback>),
-
- mozilla::jni::MakeNativeMethod<GeckoThread::SpeculativeConnect_t>(
- mozilla::jni::NativeStub<GeckoThread::SpeculativeConnect_t, Impl>
- ::template Wrap<&Impl::SpeculativeConnect>),
-
- mozilla::jni::MakeNativeMethod<GeckoThread::WaitOnGecko_t>(
- mozilla::jni::NativeStub<GeckoThread::WaitOnGecko_t, Impl>
- ::template Wrap<&Impl::WaitOnGecko>)
-};
-
-template<class Impl>
-class GeckoView::Window::Natives : public mozilla::jni::NativeImpl<Window, Impl>
-{
-public:
- static const JNINativeMethod methods[5];
-};
-
-template<class Impl>
-const JNINativeMethod GeckoView::Window::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<GeckoView::Window::Close_t>(
- mozilla::jni::NativeStub<GeckoView::Window::Close_t, Impl>
- ::template Wrap<&Impl::Close>),
-
- mozilla::jni::MakeNativeMethod<GeckoView::Window::DisposeNative_t>(
- mozilla::jni::NativeStub<GeckoView::Window::DisposeNative_t, Impl>
- ::template Wrap<&Impl::DisposeNative>),
-
- mozilla::jni::MakeNativeMethod<GeckoView::Window::LoadUri_t>(
- mozilla::jni::NativeStub<GeckoView::Window::LoadUri_t, Impl>
- ::template Wrap<&Impl::LoadUri>),
-
- mozilla::jni::MakeNativeMethod<GeckoView::Window::Open_t>(
- mozilla::jni::NativeStub<GeckoView::Window::Open_t, Impl>
- ::template Wrap<&Impl::Open>),
-
- mozilla::jni::MakeNativeMethod<GeckoView::Window::Reattach_t>(
- mozilla::jni::NativeStub<GeckoView::Window::Reattach_t, Impl>
- ::template Wrap<&Impl::Reattach>)
-};
-
-template<class Impl>
-class PrefsHelper::Natives : public mozilla::jni::NativeImpl<PrefsHelper, Impl>
-{
-public:
- static const JNINativeMethod methods[4];
-};
-
-template<class Impl>
-const JNINativeMethod PrefsHelper::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<PrefsHelper::AddObserver_t>(
- mozilla::jni::NativeStub<PrefsHelper::AddObserver_t, Impl>
- ::template Wrap<&Impl::AddObserver>),
-
- mozilla::jni::MakeNativeMethod<PrefsHelper::GetPrefs_t>(
- mozilla::jni::NativeStub<PrefsHelper::GetPrefs_t, Impl>
- ::template Wrap<&Impl::GetPrefs>),
-
- mozilla::jni::MakeNativeMethod<PrefsHelper::RemoveObserver_t>(
- mozilla::jni::NativeStub<PrefsHelper::RemoveObserver_t, Impl>
- ::template Wrap<&Impl::RemoveObserver>),
-
- mozilla::jni::MakeNativeMethod<PrefsHelper::SetPref_t>(
- mozilla::jni::NativeStub<PrefsHelper::SetPref_t, Impl>
- ::template Wrap<&Impl::SetPref>)
-};
-
-template<class Impl>
-class SurfaceTextureListener::Natives : public mozilla::jni::NativeImpl<SurfaceTextureListener, Impl>
-{
-public:
- static const JNINativeMethod methods[1];
-};
-
-template<class Impl>
-const JNINativeMethod SurfaceTextureListener::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<SurfaceTextureListener::OnFrameAvailable_t>(
- mozilla::jni::NativeStub<SurfaceTextureListener::OnFrameAvailable_t, Impl>
- ::template Wrap<&Impl::OnFrameAvailable>)
-};
-
-template<class Impl>
-class LayerView::Compositor::Natives : public mozilla::jni::NativeImpl<Compositor, Impl>
-{
-public:
- static const JNINativeMethod methods[7];
-};
-
-template<class Impl>
-const JNINativeMethod LayerView::Compositor::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<LayerView::Compositor::AttachToJava_t>(
- mozilla::jni::NativeStub<LayerView::Compositor::AttachToJava_t, Impl>
- ::template Wrap<&Impl::AttachToJava>),
-
- mozilla::jni::MakeNativeMethod<LayerView::Compositor::CreateCompositor_t>(
- mozilla::jni::NativeStub<LayerView::Compositor::CreateCompositor_t, Impl>
- ::template Wrap<&Impl::CreateCompositor>),
-
- mozilla::jni::MakeNativeMethod<LayerView::Compositor::DisposeNative_t>(
- mozilla::jni::NativeStub<LayerView::Compositor::DisposeNative_t, Impl>
- ::template Wrap<&Impl::DisposeNative>),
-
- mozilla::jni::MakeNativeMethod<LayerView::Compositor::OnSizeChanged_t>(
- mozilla::jni::NativeStub<LayerView::Compositor::OnSizeChanged_t, Impl>
- ::template Wrap<&Impl::OnSizeChanged>),
-
- mozilla::jni::MakeNativeMethod<LayerView::Compositor::SyncInvalidateAndScheduleComposite_t>(
- mozilla::jni::NativeStub<LayerView::Compositor::SyncInvalidateAndScheduleComposite_t, Impl>
- ::template Wrap<&Impl::SyncInvalidateAndScheduleComposite>),
-
- mozilla::jni::MakeNativeMethod<LayerView::Compositor::SyncPauseCompositor_t>(
- mozilla::jni::NativeStub<LayerView::Compositor::SyncPauseCompositor_t, Impl>
- ::template Wrap<&Impl::SyncPauseCompositor>),
-
- mozilla::jni::MakeNativeMethod<LayerView::Compositor::SyncResumeResizeCompositor_t>(
- mozilla::jni::NativeStub<LayerView::Compositor::SyncResumeResizeCompositor_t, Impl>
- ::template Wrap<&Impl::SyncResumeResizeCompositor>)
-};
-
-template<class Impl>
-class NativePanZoomController::Natives : public mozilla::jni::NativeImpl<NativePanZoomController, Impl>
-{
-public:
- static const JNINativeMethod methods[7];
-};
-
-template<class Impl>
-const JNINativeMethod NativePanZoomController::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<NativePanZoomController::AdjustScrollForSurfaceShift_t>(
- mozilla::jni::NativeStub<NativePanZoomController::AdjustScrollForSurfaceShift_t, Impl>
- ::template Wrap<&Impl::AdjustScrollForSurfaceShift>),
-
- mozilla::jni::MakeNativeMethod<NativePanZoomController::DisposeNative_t>(
- mozilla::jni::NativeStub<NativePanZoomController::DisposeNative_t, Impl>
- ::template Wrap<&Impl::DisposeNative>),
-
- mozilla::jni::MakeNativeMethod<NativePanZoomController::HandleMotionEvent_t>(
- mozilla::jni::NativeStub<NativePanZoomController::HandleMotionEvent_t, Impl>
- ::template Wrap<&Impl::HandleMotionEvent>),
-
- mozilla::jni::MakeNativeMethod<NativePanZoomController::HandleMotionEventVelocity_t>(
- mozilla::jni::NativeStub<NativePanZoomController::HandleMotionEventVelocity_t, Impl>
- ::template Wrap<&Impl::HandleMotionEventVelocity>),
-
- mozilla::jni::MakeNativeMethod<NativePanZoomController::HandleMouseEvent_t>(
- mozilla::jni::NativeStub<NativePanZoomController::HandleMouseEvent_t, Impl>
- ::template Wrap<&Impl::HandleMouseEvent>),
-
- mozilla::jni::MakeNativeMethod<NativePanZoomController::HandleScrollEvent_t>(
- mozilla::jni::NativeStub<NativePanZoomController::HandleScrollEvent_t, Impl>
- ::template Wrap<&Impl::HandleScrollEvent>),
-
- mozilla::jni::MakeNativeMethod<NativePanZoomController::SetIsLongpressEnabled_t>(
- mozilla::jni::NativeStub<NativePanZoomController::SetIsLongpressEnabled_t, Impl>
- ::template Wrap<&Impl::SetIsLongpressEnabled>)
-};
-
-template<class Impl>
-class NativeJSContainer::Natives : public mozilla::jni::NativeImpl<NativeJSContainer, Impl>
-{
-public:
- static const JNINativeMethod methods[2];
-};
-
-template<class Impl>
-const JNINativeMethod NativeJSContainer::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<NativeJSContainer::Clone2_t>(
- mozilla::jni::NativeStub<NativeJSContainer::Clone2_t, Impl>
- ::template Wrap<&Impl::Clone>),
-
- mozilla::jni::MakeNativeMethod<NativeJSContainer::DisposeNative_t>(
- mozilla::jni::NativeStub<NativeJSContainer::DisposeNative_t, Impl>
- ::template Wrap<&Impl::DisposeNative>)
-};
-
-template<class Impl>
-class NativeJSObject::Natives : public mozilla::jni::NativeImpl<NativeJSObject, Impl>
-{
-public:
- static const JNINativeMethod methods[27];
-};
-
-template<class Impl>
-const JNINativeMethod NativeJSObject::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::GetBoolean_t>(
- mozilla::jni::NativeStub<NativeJSObject::GetBoolean_t, Impl>
- ::template Wrap<&Impl::GetBoolean>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::GetBooleanArray_t>(
- mozilla::jni::NativeStub<NativeJSObject::GetBooleanArray_t, Impl>
- ::template Wrap<&Impl::GetBooleanArray>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::GetBundle_t>(
- mozilla::jni::NativeStub<NativeJSObject::GetBundle_t, Impl>
- ::template Wrap<&Impl::GetBundle>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::GetBundleArray_t>(
- mozilla::jni::NativeStub<NativeJSObject::GetBundleArray_t, Impl>
- ::template Wrap<&Impl::GetBundleArray>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::GetDouble_t>(
- mozilla::jni::NativeStub<NativeJSObject::GetDouble_t, Impl>
- ::template Wrap<&Impl::GetDouble>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::GetDoubleArray_t>(
- mozilla::jni::NativeStub<NativeJSObject::GetDoubleArray_t, Impl>
- ::template Wrap<&Impl::GetDoubleArray>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::GetInt_t>(
- mozilla::jni::NativeStub<NativeJSObject::GetInt_t, Impl>
- ::template Wrap<&Impl::GetInt>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::GetIntArray_t>(
- mozilla::jni::NativeStub<NativeJSObject::GetIntArray_t, Impl>
- ::template Wrap<&Impl::GetIntArray>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::GetObject_t>(
- mozilla::jni::NativeStub<NativeJSObject::GetObject_t, Impl>
- ::template Wrap<&Impl::GetObject>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::GetObjectArray_t>(
- mozilla::jni::NativeStub<NativeJSObject::GetObjectArray_t, Impl>
- ::template Wrap<&Impl::GetObjectArray>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::GetString_t>(
- mozilla::jni::NativeStub<NativeJSObject::GetString_t, Impl>
- ::template Wrap<&Impl::GetString>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::GetStringArray_t>(
- mozilla::jni::NativeStub<NativeJSObject::GetStringArray_t, Impl>
- ::template Wrap<&Impl::GetStringArray>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::Has_t>(
- mozilla::jni::NativeStub<NativeJSObject::Has_t, Impl>
- ::template Wrap<&Impl::Has>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::OptBoolean_t>(
- mozilla::jni::NativeStub<NativeJSObject::OptBoolean_t, Impl>
- ::template Wrap<&Impl::OptBoolean>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::OptBooleanArray_t>(
- mozilla::jni::NativeStub<NativeJSObject::OptBooleanArray_t, Impl>
- ::template Wrap<&Impl::OptBooleanArray>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::OptBundle_t>(
- mozilla::jni::NativeStub<NativeJSObject::OptBundle_t, Impl>
- ::template Wrap<&Impl::OptBundle>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::OptBundleArray_t>(
- mozilla::jni::NativeStub<NativeJSObject::OptBundleArray_t, Impl>
- ::template Wrap<&Impl::OptBundleArray>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::OptDouble_t>(
- mozilla::jni::NativeStub<NativeJSObject::OptDouble_t, Impl>
- ::template Wrap<&Impl::OptDouble>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::OptDoubleArray_t>(
- mozilla::jni::NativeStub<NativeJSObject::OptDoubleArray_t, Impl>
- ::template Wrap<&Impl::OptDoubleArray>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::OptInt_t>(
- mozilla::jni::NativeStub<NativeJSObject::OptInt_t, Impl>
- ::template Wrap<&Impl::OptInt>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::OptIntArray_t>(
- mozilla::jni::NativeStub<NativeJSObject::OptIntArray_t, Impl>
- ::template Wrap<&Impl::OptIntArray>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::OptObject_t>(
- mozilla::jni::NativeStub<NativeJSObject::OptObject_t, Impl>
- ::template Wrap<&Impl::OptObject>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::OptObjectArray_t>(
- mozilla::jni::NativeStub<NativeJSObject::OptObjectArray_t, Impl>
- ::template Wrap<&Impl::OptObjectArray>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::OptString_t>(
- mozilla::jni::NativeStub<NativeJSObject::OptString_t, Impl>
- ::template Wrap<&Impl::OptString>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::OptStringArray_t>(
- mozilla::jni::NativeStub<NativeJSObject::OptStringArray_t, Impl>
- ::template Wrap<&Impl::OptStringArray>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::ToBundle_t>(
- mozilla::jni::NativeStub<NativeJSObject::ToBundle_t, Impl>
- ::template Wrap<&Impl::ToBundle>),
-
- mozilla::jni::MakeNativeMethod<NativeJSObject::ToString_t>(
- mozilla::jni::NativeStub<NativeJSObject::ToString_t, Impl>
- ::template Wrap<&Impl::ToString>)
-};
-
-} /* java */
-} /* mozilla */
-#endif // GeneratedJNINatives_h
diff --git a/widget/android/GeneratedJNIWrappers.cpp b/widget/android/GeneratedJNIWrappers.cpp
deleted file mode 100644
index 37564ba24..000000000
--- a/widget/android/GeneratedJNIWrappers.cpp
+++ /dev/null
@@ -1,1874 +0,0 @@
-// GENERATED CODE
-// Generated by the Java program at /build/annotationProcessors at compile time
-// from annotations on Java methods. To update, change the annotations on the
-// corresponding Java methods and rerun the build. Manually updating this file
-// will cause your build to fail.
-
-#include "GeneratedJNIWrappers.h"
-#include "mozilla/jni/Accessors.h"
-
-namespace mozilla {
-namespace java {
-
-const char AlarmReceiver::name[] =
- "org/mozilla/gecko/AlarmReceiver";
-
-constexpr char AlarmReceiver::NotifyAlarmFired_t::name[];
-constexpr char AlarmReceiver::NotifyAlarmFired_t::signature[];
-
-const char AndroidGamepadManager::name[] =
- "org/mozilla/gecko/AndroidGamepadManager";
-
-constexpr char AndroidGamepadManager::OnAxisChange_t::name[];
-constexpr char AndroidGamepadManager::OnAxisChange_t::signature[];
-
-constexpr char AndroidGamepadManager::OnButtonChange_t::name[];
-constexpr char AndroidGamepadManager::OnButtonChange_t::signature[];
-
-constexpr char AndroidGamepadManager::OnGamepadAdded_t::name[];
-constexpr char AndroidGamepadManager::OnGamepadAdded_t::signature[];
-
-auto AndroidGamepadManager::OnGamepadAdded(int32_t a0, int32_t a1) -> void
-{
- return mozilla::jni::Method<OnGamepadAdded_t>::Call(AndroidGamepadManager::Context(), nullptr, a0, a1);
-}
-
-constexpr char AndroidGamepadManager::OnGamepadChange_t::name[];
-constexpr char AndroidGamepadManager::OnGamepadChange_t::signature[];
-
-constexpr char AndroidGamepadManager::Start_t::name[];
-constexpr char AndroidGamepadManager::Start_t::signature[];
-
-auto AndroidGamepadManager::Start() -> void
-{
- return mozilla::jni::Method<Start_t>::Call(AndroidGamepadManager::Context(), nullptr);
-}
-
-constexpr char AndroidGamepadManager::Stop_t::name[];
-constexpr char AndroidGamepadManager::Stop_t::signature[];
-
-auto AndroidGamepadManager::Stop() -> void
-{
- return mozilla::jni::Method<Stop_t>::Call(AndroidGamepadManager::Context(), nullptr);
-}
-
-const char GeckoAppShell::name[] =
- "org/mozilla/gecko/GeckoAppShell";
-
-constexpr char GeckoAppShell::AddFullScreenPluginView_t::name[];
-constexpr char GeckoAppShell::AddFullScreenPluginView_t::signature[];
-
-auto GeckoAppShell::AddFullScreenPluginView(mozilla::jni::Object::Param a0) -> void
-{
- return mozilla::jni::Method<AddFullScreenPluginView_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::CancelVibrate_t::name[];
-constexpr char GeckoAppShell::CancelVibrate_t::signature[];
-
-auto GeckoAppShell::CancelVibrate() -> void
-{
- return mozilla::jni::Method<CancelVibrate_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::CheckURIVisited_t::name[];
-constexpr char GeckoAppShell::CheckURIVisited_t::signature[];
-
-auto GeckoAppShell::CheckURIVisited(mozilla::jni::String::Param a0) -> void
-{
- return mozilla::jni::Method<CheckURIVisited_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::CloseCamera_t::name[];
-constexpr char GeckoAppShell::CloseCamera_t::signature[];
-
-auto GeckoAppShell::CloseCamera() -> void
-{
- return mozilla::jni::Method<CloseCamera_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::CloseNotification_t::name[];
-constexpr char GeckoAppShell::CloseNotification_t::signature[];
-
-auto GeckoAppShell::CloseNotification(mozilla::jni::String::Param a0) -> void
-{
- return mozilla::jni::Method<CloseNotification_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::ConnectionGetMimeType_t::name[];
-constexpr char GeckoAppShell::ConnectionGetMimeType_t::signature[];
-
-auto GeckoAppShell::ConnectionGetMimeType(mozilla::jni::Object::Param a0) -> mozilla::jni::String::LocalRef
-{
- return mozilla::jni::Method<ConnectionGetMimeType_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::CreateInputStream_t::name[];
-constexpr char GeckoAppShell::CreateInputStream_t::signature[];
-
-auto GeckoAppShell::CreateInputStream(mozilla::jni::Object::Param a0) -> mozilla::jni::Object::LocalRef
-{
- return mozilla::jni::Method<CreateInputStream_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::CreateShortcut_t::name[];
-constexpr char GeckoAppShell::CreateShortcut_t::signature[];
-
-auto GeckoAppShell::CreateShortcut(mozilla::jni::String::Param a0, mozilla::jni::String::Param a1) -> void
-{
- return mozilla::jni::Method<CreateShortcut_t>::Call(GeckoAppShell::Context(), nullptr, a0, a1);
-}
-
-constexpr char GeckoAppShell::DisableAlarm_t::name[];
-constexpr char GeckoAppShell::DisableAlarm_t::signature[];
-
-auto GeckoAppShell::DisableAlarm() -> void
-{
- return mozilla::jni::Method<DisableAlarm_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::DisableBatteryNotifications_t::name[];
-constexpr char GeckoAppShell::DisableBatteryNotifications_t::signature[];
-
-auto GeckoAppShell::DisableBatteryNotifications() -> void
-{
- return mozilla::jni::Method<DisableBatteryNotifications_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::DisableNetworkNotifications_t::name[];
-constexpr char GeckoAppShell::DisableNetworkNotifications_t::signature[];
-
-auto GeckoAppShell::DisableNetworkNotifications() -> void
-{
- return mozilla::jni::Method<DisableNetworkNotifications_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::DisableScreenOrientationNotifications_t::name[];
-constexpr char GeckoAppShell::DisableScreenOrientationNotifications_t::signature[];
-
-auto GeckoAppShell::DisableScreenOrientationNotifications() -> void
-{
- return mozilla::jni::Method<DisableScreenOrientationNotifications_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::DisableSensor_t::name[];
-constexpr char GeckoAppShell::DisableSensor_t::signature[];
-
-auto GeckoAppShell::DisableSensor(int32_t a0) -> void
-{
- return mozilla::jni::Method<DisableSensor_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::EnableBatteryNotifications_t::name[];
-constexpr char GeckoAppShell::EnableBatteryNotifications_t::signature[];
-
-auto GeckoAppShell::EnableBatteryNotifications() -> void
-{
- return mozilla::jni::Method<EnableBatteryNotifications_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::EnableLocation_t::name[];
-constexpr char GeckoAppShell::EnableLocation_t::signature[];
-
-auto GeckoAppShell::EnableLocation(bool a0) -> void
-{
- return mozilla::jni::Method<EnableLocation_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::EnableLocationHighAccuracy_t::name[];
-constexpr char GeckoAppShell::EnableLocationHighAccuracy_t::signature[];
-
-auto GeckoAppShell::EnableLocationHighAccuracy(bool a0) -> void
-{
- return mozilla::jni::Method<EnableLocationHighAccuracy_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::EnableNetworkNotifications_t::name[];
-constexpr char GeckoAppShell::EnableNetworkNotifications_t::signature[];
-
-auto GeckoAppShell::EnableNetworkNotifications() -> void
-{
- return mozilla::jni::Method<EnableNetworkNotifications_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::EnableScreenOrientationNotifications_t::name[];
-constexpr char GeckoAppShell::EnableScreenOrientationNotifications_t::signature[];
-
-auto GeckoAppShell::EnableScreenOrientationNotifications() -> void
-{
- return mozilla::jni::Method<EnableScreenOrientationNotifications_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::EnableSensor_t::name[];
-constexpr char GeckoAppShell::EnableSensor_t::signature[];
-
-auto GeckoAppShell::EnableSensor(int32_t a0) -> void
-{
- return mozilla::jni::Method<EnableSensor_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::GetApplicationContext_t::name[];
-constexpr char GeckoAppShell::GetApplicationContext_t::signature[];
-
-auto GeckoAppShell::GetApplicationContext() -> mozilla::jni::Object::LocalRef
-{
- return mozilla::jni::Method<GetApplicationContext_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetConnection_t::name[];
-constexpr char GeckoAppShell::GetConnection_t::signature[];
-
-auto GeckoAppShell::GetConnection(mozilla::jni::String::Param a0) -> mozilla::jni::Object::LocalRef
-{
- return mozilla::jni::Method<GetConnection_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::GetContext_t::name[];
-constexpr char GeckoAppShell::GetContext_t::signature[];
-
-auto GeckoAppShell::GetContext() -> mozilla::jni::Object::LocalRef
-{
- return mozilla::jni::Method<GetContext_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetCurrentBatteryInformation_t::name[];
-constexpr char GeckoAppShell::GetCurrentBatteryInformation_t::signature[];
-
-auto GeckoAppShell::GetCurrentBatteryInformation() -> mozilla::jni::DoubleArray::LocalRef
-{
- return mozilla::jni::Method<GetCurrentBatteryInformation_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetCurrentNetworkInformation_t::name[];
-constexpr char GeckoAppShell::GetCurrentNetworkInformation_t::signature[];
-
-auto GeckoAppShell::GetCurrentNetworkInformation() -> mozilla::jni::DoubleArray::LocalRef
-{
- return mozilla::jni::Method<GetCurrentNetworkInformation_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetDensity_t::name[];
-constexpr char GeckoAppShell::GetDensity_t::signature[];
-
-auto GeckoAppShell::GetDensity() -> float
-{
- return mozilla::jni::Method<GetDensity_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetDpi_t::name[];
-constexpr char GeckoAppShell::GetDpi_t::signature[];
-
-auto GeckoAppShell::GetDpi() -> int32_t
-{
- return mozilla::jni::Method<GetDpi_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetExceptionStackTrace_t::name[];
-constexpr char GeckoAppShell::GetExceptionStackTrace_t::signature[];
-
-auto GeckoAppShell::GetExceptionStackTrace(mozilla::jni::Throwable::Param a0) -> mozilla::jni::String::LocalRef
-{
- return mozilla::jni::Method<GetExceptionStackTrace_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::GetExtensionFromMimeType_t::name[];
-constexpr char GeckoAppShell::GetExtensionFromMimeType_t::signature[];
-
-auto GeckoAppShell::GetExtensionFromMimeType(mozilla::jni::String::Param a0) -> mozilla::jni::String::LocalRef
-{
- return mozilla::jni::Method<GetExtensionFromMimeType_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::GetHWDecoderCapability_t::name[];
-constexpr char GeckoAppShell::GetHWDecoderCapability_t::signature[];
-
-auto GeckoAppShell::GetHWDecoderCapability() -> bool
-{
- return mozilla::jni::Method<GetHWDecoderCapability_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetHWEncoderCapability_t::name[];
-constexpr char GeckoAppShell::GetHWEncoderCapability_t::signature[];
-
-auto GeckoAppShell::GetHWEncoderCapability() -> bool
-{
- return mozilla::jni::Method<GetHWEncoderCapability_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetHandlersForMimeType_t::name[];
-constexpr char GeckoAppShell::GetHandlersForMimeType_t::signature[];
-
-auto GeckoAppShell::GetHandlersForMimeType(mozilla::jni::String::Param a0, mozilla::jni::String::Param a1) -> mozilla::jni::ObjectArray::LocalRef
-{
- return mozilla::jni::Method<GetHandlersForMimeType_t>::Call(GeckoAppShell::Context(), nullptr, a0, a1);
-}
-
-constexpr char GeckoAppShell::GetHandlersForURL_t::name[];
-constexpr char GeckoAppShell::GetHandlersForURL_t::signature[];
-
-auto GeckoAppShell::GetHandlersForURL(mozilla::jni::String::Param a0, mozilla::jni::String::Param a1) -> mozilla::jni::ObjectArray::LocalRef
-{
- return mozilla::jni::Method<GetHandlersForURL_t>::Call(GeckoAppShell::Context(), nullptr, a0, a1);
-}
-
-constexpr char GeckoAppShell::GetIconForExtension_t::name[];
-constexpr char GeckoAppShell::GetIconForExtension_t::signature[];
-
-auto GeckoAppShell::GetIconForExtension(mozilla::jni::String::Param a0, int32_t a1) -> mozilla::jni::ByteArray::LocalRef
-{
- return mozilla::jni::Method<GetIconForExtension_t>::Call(GeckoAppShell::Context(), nullptr, a0, a1);
-}
-
-constexpr char GeckoAppShell::GetMaxTouchPoints_t::name[];
-constexpr char GeckoAppShell::GetMaxTouchPoints_t::signature[];
-
-auto GeckoAppShell::GetMaxTouchPoints() -> int32_t
-{
- return mozilla::jni::Method<GetMaxTouchPoints_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetMimeTypeFromExtensions_t::name[];
-constexpr char GeckoAppShell::GetMimeTypeFromExtensions_t::signature[];
-
-auto GeckoAppShell::GetMimeTypeFromExtensions(mozilla::jni::String::Param a0) -> mozilla::jni::String::LocalRef
-{
- return mozilla::jni::Method<GetMimeTypeFromExtensions_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::GetNetworkLinkType_t::name[];
-constexpr char GeckoAppShell::GetNetworkLinkType_t::signature[];
-
-auto GeckoAppShell::GetNetworkLinkType() -> int32_t
-{
- return mozilla::jni::Method<GetNetworkLinkType_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetProxyForURI_t::name[];
-constexpr char GeckoAppShell::GetProxyForURI_t::signature[];
-
-auto GeckoAppShell::GetProxyForURI(mozilla::jni::String::Param a0, mozilla::jni::String::Param a1, mozilla::jni::String::Param a2, int32_t a3) -> mozilla::jni::String::LocalRef
-{
- return mozilla::jni::Method<GetProxyForURI_t>::Call(GeckoAppShell::Context(), nullptr, a0, a1, a2, a3);
-}
-
-constexpr char GeckoAppShell::GetScreenAngle_t::name[];
-constexpr char GeckoAppShell::GetScreenAngle_t::signature[];
-
-auto GeckoAppShell::GetScreenAngle() -> int32_t
-{
- return mozilla::jni::Method<GetScreenAngle_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetScreenDepth_t::name[];
-constexpr char GeckoAppShell::GetScreenDepth_t::signature[];
-
-auto GeckoAppShell::GetScreenDepth() -> int32_t
-{
- return mozilla::jni::Method<GetScreenDepth_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetScreenOrientation_t::name[];
-constexpr char GeckoAppShell::GetScreenOrientation_t::signature[];
-
-auto GeckoAppShell::GetScreenOrientation() -> int16_t
-{
- return mozilla::jni::Method<GetScreenOrientation_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetScreenSize_t::name[];
-constexpr char GeckoAppShell::GetScreenSize_t::signature[];
-
-auto GeckoAppShell::GetScreenSize() -> mozilla::jni::Object::LocalRef
-{
- return mozilla::jni::Method<GetScreenSize_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetShowPasswordSetting_t::name[];
-constexpr char GeckoAppShell::GetShowPasswordSetting_t::signature[];
-
-auto GeckoAppShell::GetShowPasswordSetting() -> bool
-{
- return mozilla::jni::Method<GetShowPasswordSetting_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::GetSystemColors_t::name[];
-constexpr char GeckoAppShell::GetSystemColors_t::signature[];
-
-auto GeckoAppShell::GetSystemColors() -> mozilla::jni::IntArray::LocalRef
-{
- return mozilla::jni::Method<GetSystemColors_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::HandleGeckoMessage_t::name[];
-constexpr char GeckoAppShell::HandleGeckoMessage_t::signature[];
-
-auto GeckoAppShell::HandleGeckoMessage(mozilla::jni::Object::Param a0) -> void
-{
- return mozilla::jni::Method<HandleGeckoMessage_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::HandleUncaughtException_t::name[];
-constexpr char GeckoAppShell::HandleUncaughtException_t::signature[];
-
-auto GeckoAppShell::HandleUncaughtException(mozilla::jni::Throwable::Param a0) -> void
-{
- return mozilla::jni::Method<HandleUncaughtException_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::HideProgressDialog_t::name[];
-constexpr char GeckoAppShell::HideProgressDialog_t::signature[];
-
-auto GeckoAppShell::HideProgressDialog() -> void
-{
- return mozilla::jni::Method<HideProgressDialog_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::InitCamera_t::name[];
-constexpr char GeckoAppShell::InitCamera_t::signature[];
-
-auto GeckoAppShell::InitCamera(mozilla::jni::String::Param a0, int32_t a1, int32_t a2, int32_t a3) -> mozilla::jni::IntArray::LocalRef
-{
- return mozilla::jni::Method<InitCamera_t>::Call(GeckoAppShell::Context(), nullptr, a0, a1, a2, a3);
-}
-
-constexpr char GeckoAppShell::IsNetworkLinkKnown_t::name[];
-constexpr char GeckoAppShell::IsNetworkLinkKnown_t::signature[];
-
-auto GeckoAppShell::IsNetworkLinkKnown() -> bool
-{
- return mozilla::jni::Method<IsNetworkLinkKnown_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::IsNetworkLinkUp_t::name[];
-constexpr char GeckoAppShell::IsNetworkLinkUp_t::signature[];
-
-auto GeckoAppShell::IsNetworkLinkUp() -> bool
-{
- return mozilla::jni::Method<IsNetworkLinkUp_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::IsTablet_t::name[];
-constexpr char GeckoAppShell::IsTablet_t::signature[];
-
-auto GeckoAppShell::IsTablet() -> bool
-{
- return mozilla::jni::Method<IsTablet_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::KillAnyZombies_t::name[];
-constexpr char GeckoAppShell::KillAnyZombies_t::signature[];
-
-auto GeckoAppShell::KillAnyZombies() -> void
-{
- return mozilla::jni::Method<KillAnyZombies_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::LoadPluginClass_t::name[];
-constexpr char GeckoAppShell::LoadPluginClass_t::signature[];
-
-auto GeckoAppShell::LoadPluginClass(mozilla::jni::String::Param a0, mozilla::jni::String::Param a1) -> mozilla::jni::Class::LocalRef
-{
- return mozilla::jni::Method<LoadPluginClass_t>::Call(GeckoAppShell::Context(), nullptr, a0, a1);
-}
-
-constexpr char GeckoAppShell::LockScreenOrientation_t::name[];
-constexpr char GeckoAppShell::LockScreenOrientation_t::signature[];
-
-auto GeckoAppShell::LockScreenOrientation(int32_t a0) -> void
-{
- return mozilla::jni::Method<LockScreenOrientation_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::MarkURIVisited_t::name[];
-constexpr char GeckoAppShell::MarkURIVisited_t::signature[];
-
-auto GeckoAppShell::MarkURIVisited(mozilla::jni::String::Param a0) -> void
-{
- return mozilla::jni::Method<MarkURIVisited_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::MoveTaskToBack_t::name[];
-constexpr char GeckoAppShell::MoveTaskToBack_t::signature[];
-
-auto GeckoAppShell::MoveTaskToBack() -> void
-{
- return mozilla::jni::Method<MoveTaskToBack_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::NotifyObservers_t::name[];
-constexpr char GeckoAppShell::NotifyObservers_t::signature[];
-
-constexpr char GeckoAppShell::NotifyAlertListener_t::name[];
-constexpr char GeckoAppShell::NotifyAlertListener_t::signature[];
-
-constexpr char GeckoAppShell::NotifyUriVisited_t::name[];
-constexpr char GeckoAppShell::NotifyUriVisited_t::signature[];
-
-constexpr char GeckoAppShell::NotifyWakeLockChanged_t::name[];
-constexpr char GeckoAppShell::NotifyWakeLockChanged_t::signature[];
-
-auto GeckoAppShell::NotifyWakeLockChanged(mozilla::jni::String::Param a0, mozilla::jni::String::Param a1) -> void
-{
- return mozilla::jni::Method<NotifyWakeLockChanged_t>::Call(GeckoAppShell::Context(), nullptr, a0, a1);
-}
-
-constexpr char GeckoAppShell::OnFullScreenPluginHidden_t::name[];
-constexpr char GeckoAppShell::OnFullScreenPluginHidden_t::signature[];
-
-constexpr char GeckoAppShell::OnLocationChanged_t::name[];
-constexpr char GeckoAppShell::OnLocationChanged_t::signature[];
-
-constexpr char GeckoAppShell::OnSensorChanged_t::name[];
-constexpr char GeckoAppShell::OnSensorChanged_t::signature[];
-
-constexpr char GeckoAppShell::OpenUriExternal_t::name[];
-constexpr char GeckoAppShell::OpenUriExternal_t::signature[];
-
-auto GeckoAppShell::OpenUriExternal(mozilla::jni::String::Param a0, mozilla::jni::String::Param a1, mozilla::jni::String::Param a2, mozilla::jni::String::Param a3, mozilla::jni::String::Param a4, mozilla::jni::String::Param a5) -> bool
-{
- return mozilla::jni::Method<OpenUriExternal_t>::Call(GeckoAppShell::Context(), nullptr, a0, a1, a2, a3, a4, a5);
-}
-
-constexpr char GeckoAppShell::OpenWindowForNotification_t::name[];
-constexpr char GeckoAppShell::OpenWindowForNotification_t::signature[];
-
-auto GeckoAppShell::OpenWindowForNotification() -> void
-{
- return mozilla::jni::Method<OpenWindowForNotification_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::PerformHapticFeedback_t::name[];
-constexpr char GeckoAppShell::PerformHapticFeedback_t::signature[];
-
-auto GeckoAppShell::PerformHapticFeedback(bool a0) -> void
-{
- return mozilla::jni::Method<PerformHapticFeedback_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::RemoveFullScreenPluginView_t::name[];
-constexpr char GeckoAppShell::RemoveFullScreenPluginView_t::signature[];
-
-auto GeckoAppShell::RemoveFullScreenPluginView(mozilla::jni::Object::Param a0) -> void
-{
- return mozilla::jni::Method<RemoveFullScreenPluginView_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::ReportJavaCrash_t::name[];
-constexpr char GeckoAppShell::ReportJavaCrash_t::signature[];
-
-constexpr char GeckoAppShell::ScheduleRestart_t::name[];
-constexpr char GeckoAppShell::ScheduleRestart_t::signature[];
-
-auto GeckoAppShell::ScheduleRestart() -> void
-{
- return mozilla::jni::Method<ScheduleRestart_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::SetAlarm_t::name[];
-constexpr char GeckoAppShell::SetAlarm_t::signature[];
-
-auto GeckoAppShell::SetAlarm(int32_t a0, int32_t a1) -> bool
-{
- return mozilla::jni::Method<SetAlarm_t>::Call(GeckoAppShell::Context(), nullptr, a0, a1);
-}
-
-constexpr char GeckoAppShell::SetFullScreen_t::name[];
-constexpr char GeckoAppShell::SetFullScreen_t::signature[];
-
-auto GeckoAppShell::SetFullScreen(bool a0) -> void
-{
- return mozilla::jni::Method<SetFullScreen_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::SetKeepScreenOn_t::name[];
-constexpr char GeckoAppShell::SetKeepScreenOn_t::signature[];
-
-auto GeckoAppShell::SetKeepScreenOn(bool a0) -> void
-{
- return mozilla::jni::Method<SetKeepScreenOn_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::SetScreenDepthOverride_t::name[];
-constexpr char GeckoAppShell::SetScreenDepthOverride_t::signature[];
-
-auto GeckoAppShell::SetScreenDepthOverride(int32_t a0) -> void
-{
- return mozilla::jni::Method<SetScreenDepthOverride_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::SetURITitle_t::name[];
-constexpr char GeckoAppShell::SetURITitle_t::signature[];
-
-auto GeckoAppShell::SetURITitle(mozilla::jni::String::Param a0, mozilla::jni::String::Param a1) -> void
-{
- return mozilla::jni::Method<SetURITitle_t>::Call(GeckoAppShell::Context(), nullptr, a0, a1);
-}
-
-constexpr char GeckoAppShell::ShowNotification_t::name[];
-constexpr char GeckoAppShell::ShowNotification_t::signature[];
-
-auto GeckoAppShell::ShowNotification(mozilla::jni::String::Param a0, mozilla::jni::String::Param a1, mozilla::jni::String::Param a2, mozilla::jni::String::Param a3, mozilla::jni::String::Param a4, mozilla::jni::String::Param a5, mozilla::jni::String::Param a6) -> void
-{
- return mozilla::jni::Method<ShowNotification_t>::Call(GeckoAppShell::Context(), nullptr, a0, a1, a2, a3, a4, a5, a6);
-}
-
-constexpr char GeckoAppShell::SyncNotifyObservers_t::name[];
-constexpr char GeckoAppShell::SyncNotifyObservers_t::signature[];
-
-constexpr char GeckoAppShell::UnlockProfile_t::name[];
-constexpr char GeckoAppShell::UnlockProfile_t::signature[];
-
-auto GeckoAppShell::UnlockProfile() -> bool
-{
- return mozilla::jni::Method<UnlockProfile_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::UnlockScreenOrientation_t::name[];
-constexpr char GeckoAppShell::UnlockScreenOrientation_t::signature[];
-
-auto GeckoAppShell::UnlockScreenOrientation() -> void
-{
- return mozilla::jni::Method<UnlockScreenOrientation_t>::Call(GeckoAppShell::Context(), nullptr);
-}
-
-constexpr char GeckoAppShell::Vibrate_t::name[];
-constexpr char GeckoAppShell::Vibrate_t::signature[];
-
-auto GeckoAppShell::Vibrate(int64_t a0) -> void
-{
- return mozilla::jni::Method<Vibrate_t>::Call(GeckoAppShell::Context(), nullptr, a0);
-}
-
-constexpr char GeckoAppShell::Vibrate2_t::name[];
-constexpr char GeckoAppShell::Vibrate2_t::signature[];
-
-auto GeckoAppShell::Vibrate(mozilla::jni::LongArray::Param a0, int32_t a1) -> void
-{
- return mozilla::jni::Method<Vibrate2_t>::Call(GeckoAppShell::Context(), nullptr, a0, a1);
-}
-
-const char GeckoAppShell::CameraCallback::name[] =
- "org/mozilla/gecko/GeckoAppShell$CameraCallback";
-
-constexpr char GeckoAppShell::CameraCallback::OnFrameData_t::name[];
-constexpr char GeckoAppShell::CameraCallback::OnFrameData_t::signature[];
-
-const char GeckoBatteryManager::name[] =
- "org/mozilla/gecko/GeckoBatteryManager";
-
-constexpr char GeckoBatteryManager::OnBatteryChange_t::name[];
-constexpr char GeckoBatteryManager::OnBatteryChange_t::signature[];
-
-const char GeckoEditable::name[] =
- "org/mozilla/gecko/GeckoEditable";
-
-constexpr char GeckoEditable::New_t::name[];
-constexpr char GeckoEditable::New_t::signature[];
-
-auto GeckoEditable::New(mozilla::jni::Object::Param a0) -> GeckoEditable::LocalRef
-{
- return mozilla::jni::Constructor<New_t>::Call(GeckoEditable::Context(), nullptr, a0);
-}
-
-constexpr char GeckoEditable::DisposeNative_t::name[];
-constexpr char GeckoEditable::DisposeNative_t::signature[];
-
-constexpr char GeckoEditable::NotifyIME_t::name[];
-constexpr char GeckoEditable::NotifyIME_t::signature[];
-
-auto GeckoEditable::NotifyIME(int32_t a0) const -> void
-{
- return mozilla::jni::Method<NotifyIME_t>::Call(GeckoEditable::mCtx, nullptr, a0);
-}
-
-constexpr char GeckoEditable::NotifyIMEContext_t::name[];
-constexpr char GeckoEditable::NotifyIMEContext_t::signature[];
-
-auto GeckoEditable::NotifyIMEContext(int32_t a0, mozilla::jni::String::Param a1, mozilla::jni::String::Param a2, mozilla::jni::String::Param a3) const -> void
-{
- return mozilla::jni::Method<NotifyIMEContext_t>::Call(GeckoEditable::mCtx, nullptr, a0, a1, a2, a3);
-}
-
-constexpr char GeckoEditable::OnDefaultKeyEvent_t::name[];
-constexpr char GeckoEditable::OnDefaultKeyEvent_t::signature[];
-
-auto GeckoEditable::OnDefaultKeyEvent(mozilla::jni::Object::Param a0) const -> void
-{
- return mozilla::jni::Method<OnDefaultKeyEvent_t>::Call(GeckoEditable::mCtx, nullptr, a0);
-}
-
-constexpr char GeckoEditable::OnImeAddCompositionRange_t::name[];
-constexpr char GeckoEditable::OnImeAddCompositionRange_t::signature[];
-
-constexpr char GeckoEditable::OnImeReplaceText_t::name[];
-constexpr char GeckoEditable::OnImeReplaceText_t::signature[];
-
-constexpr char GeckoEditable::OnImeRequestCursorUpdates_t::name[];
-constexpr char GeckoEditable::OnImeRequestCursorUpdates_t::signature[];
-
-constexpr char GeckoEditable::OnImeSynchronize_t::name[];
-constexpr char GeckoEditable::OnImeSynchronize_t::signature[];
-
-constexpr char GeckoEditable::OnImeUpdateComposition_t::name[];
-constexpr char GeckoEditable::OnImeUpdateComposition_t::signature[];
-
-constexpr char GeckoEditable::OnKeyEvent_t::name[];
-constexpr char GeckoEditable::OnKeyEvent_t::signature[];
-
-constexpr char GeckoEditable::OnSelectionChange_t::name[];
-constexpr char GeckoEditable::OnSelectionChange_t::signature[];
-
-auto GeckoEditable::OnSelectionChange(int32_t a0, int32_t a1) const -> void
-{
- return mozilla::jni::Method<OnSelectionChange_t>::Call(GeckoEditable::mCtx, nullptr, a0, a1);
-}
-
-constexpr char GeckoEditable::OnTextChange_t::name[];
-constexpr char GeckoEditable::OnTextChange_t::signature[];
-
-auto GeckoEditable::OnTextChange(mozilla::jni::String::Param a0, int32_t a1, int32_t a2, int32_t a3) const -> void
-{
- return mozilla::jni::Method<OnTextChange_t>::Call(GeckoEditable::mCtx, nullptr, a0, a1, a2, a3);
-}
-
-constexpr char GeckoEditable::OnViewChange_t::name[];
-constexpr char GeckoEditable::OnViewChange_t::signature[];
-
-auto GeckoEditable::OnViewChange(mozilla::jni::Object::Param a0) const -> void
-{
- return mozilla::jni::Method<OnViewChange_t>::Call(GeckoEditable::mCtx, nullptr, a0);
-}
-
-constexpr char GeckoEditable::UpdateCompositionRects_t::name[];
-constexpr char GeckoEditable::UpdateCompositionRects_t::signature[];
-
-auto GeckoEditable::UpdateCompositionRects(mozilla::jni::ObjectArray::Param a0) const -> void
-{
- return mozilla::jni::Method<UpdateCompositionRects_t>::Call(GeckoEditable::mCtx, nullptr, a0);
-}
-
-const char GeckoEditableListener::name[] =
- "org/mozilla/gecko/GeckoEditableListener";
-
-const char GeckoNetworkManager::name[] =
- "org/mozilla/gecko/GeckoNetworkManager";
-
-constexpr char GeckoNetworkManager::OnConnectionChanged_t::name[];
-constexpr char GeckoNetworkManager::OnConnectionChanged_t::signature[];
-
-constexpr char GeckoNetworkManager::OnStatusChanged_t::name[];
-constexpr char GeckoNetworkManager::OnStatusChanged_t::signature[];
-
-const char GeckoScreenOrientation::name[] =
- "org/mozilla/gecko/GeckoScreenOrientation";
-
-constexpr char GeckoScreenOrientation::OnOrientationChange_t::name[];
-constexpr char GeckoScreenOrientation::OnOrientationChange_t::signature[];
-
-const char GeckoThread::name[] =
- "org/mozilla/gecko/GeckoThread";
-
-constexpr char GeckoThread::CheckAndSetState_t::name[];
-constexpr char GeckoThread::CheckAndSetState_t::signature[];
-
-auto GeckoThread::CheckAndSetState(mozilla::jni::Object::Param a0, mozilla::jni::Object::Param a1) -> bool
-{
- return mozilla::jni::Method<CheckAndSetState_t>::Call(GeckoThread::Context(), nullptr, a0, a1);
-}
-
-constexpr char GeckoThread::CreateServices_t::name[];
-constexpr char GeckoThread::CreateServices_t::signature[];
-
-constexpr char GeckoThread::OnPause_t::name[];
-constexpr char GeckoThread::OnPause_t::signature[];
-
-constexpr char GeckoThread::OnResume_t::name[];
-constexpr char GeckoThread::OnResume_t::signature[];
-
-constexpr char GeckoThread::PumpMessageLoop_t::name[];
-constexpr char GeckoThread::PumpMessageLoop_t::signature[];
-
-auto GeckoThread::PumpMessageLoop(mozilla::jni::Object::Param a0) -> bool
-{
- return mozilla::jni::Method<PumpMessageLoop_t>::Call(GeckoThread::Context(), nullptr, a0);
-}
-
-constexpr char GeckoThread::RequestUiThreadCallback_t::name[];
-constexpr char GeckoThread::RequestUiThreadCallback_t::signature[];
-
-auto GeckoThread::RequestUiThreadCallback(int64_t a0) -> void
-{
- return mozilla::jni::Method<RequestUiThreadCallback_t>::Call(GeckoThread::Context(), nullptr, a0);
-}
-
-constexpr char GeckoThread::RunUiThreadCallback_t::name[];
-constexpr char GeckoThread::RunUiThreadCallback_t::signature[];
-
-constexpr char GeckoThread::SetState_t::name[];
-constexpr char GeckoThread::SetState_t::signature[];
-
-auto GeckoThread::SetState(mozilla::jni::Object::Param a0) -> void
-{
- return mozilla::jni::Method<SetState_t>::Call(GeckoThread::Context(), nullptr, a0);
-}
-
-constexpr char GeckoThread::SpeculativeConnect_t::name[];
-constexpr char GeckoThread::SpeculativeConnect_t::signature[];
-
-constexpr char GeckoThread::WaitOnGecko_t::name[];
-constexpr char GeckoThread::WaitOnGecko_t::signature[];
-
-constexpr char GeckoThread::ClsLoader_t::name[];
-constexpr char GeckoThread::ClsLoader_t::signature[];
-
-auto GeckoThread::ClsLoader() -> mozilla::jni::Object::LocalRef
-{
- return mozilla::jni::Field<ClsLoader_t>::Get(GeckoThread::Context(), nullptr);
-}
-
-constexpr char GeckoThread::MsgQueue_t::name[];
-constexpr char GeckoThread::MsgQueue_t::signature[];
-
-auto GeckoThread::MsgQueue() -> mozilla::jni::Object::LocalRef
-{
- return mozilla::jni::Field<MsgQueue_t>::Get(GeckoThread::Context(), nullptr);
-}
-
-auto GeckoThread::MsgQueue(mozilla::jni::Object::Param a0) -> void
-{
- return mozilla::jni::Field<MsgQueue_t>::Set(GeckoThread::Context(), nullptr, a0);
-}
-
-const char GeckoThread::State::name[] =
- "org/mozilla/gecko/GeckoThread$State";
-
-constexpr char GeckoThread::State::EXITED_t::name[];
-constexpr char GeckoThread::State::EXITED_t::signature[];
-
-auto GeckoThread::State::EXITED() -> State::LocalRef
-{
- return mozilla::jni::Field<EXITED_t>::Get(State::Context(), nullptr);
-}
-
-constexpr char GeckoThread::State::EXITING_t::name[];
-constexpr char GeckoThread::State::EXITING_t::signature[];
-
-auto GeckoThread::State::EXITING() -> State::LocalRef
-{
- return mozilla::jni::Field<EXITING_t>::Get(State::Context(), nullptr);
-}
-
-constexpr char GeckoThread::State::INITIAL_t::name[];
-constexpr char GeckoThread::State::INITIAL_t::signature[];
-
-auto GeckoThread::State::INITIAL() -> State::LocalRef
-{
- return mozilla::jni::Field<INITIAL_t>::Get(State::Context(), nullptr);
-}
-
-constexpr char GeckoThread::State::JNI_READY_t::name[];
-constexpr char GeckoThread::State::JNI_READY_t::signature[];
-
-auto GeckoThread::State::JNI_READY() -> State::LocalRef
-{
- return mozilla::jni::Field<JNI_READY_t>::Get(State::Context(), nullptr);
-}
-
-constexpr char GeckoThread::State::LAUNCHED_t::name[];
-constexpr char GeckoThread::State::LAUNCHED_t::signature[];
-
-auto GeckoThread::State::LAUNCHED() -> State::LocalRef
-{
- return mozilla::jni::Field<LAUNCHED_t>::Get(State::Context(), nullptr);
-}
-
-constexpr char GeckoThread::State::LIBS_READY_t::name[];
-constexpr char GeckoThread::State::LIBS_READY_t::signature[];
-
-auto GeckoThread::State::LIBS_READY() -> State::LocalRef
-{
- return mozilla::jni::Field<LIBS_READY_t>::Get(State::Context(), nullptr);
-}
-
-constexpr char GeckoThread::State::MOZGLUE_READY_t::name[];
-constexpr char GeckoThread::State::MOZGLUE_READY_t::signature[];
-
-auto GeckoThread::State::MOZGLUE_READY() -> State::LocalRef
-{
- return mozilla::jni::Field<MOZGLUE_READY_t>::Get(State::Context(), nullptr);
-}
-
-constexpr char GeckoThread::State::PROFILE_READY_t::name[];
-constexpr char GeckoThread::State::PROFILE_READY_t::signature[];
-
-auto GeckoThread::State::PROFILE_READY() -> State::LocalRef
-{
- return mozilla::jni::Field<PROFILE_READY_t>::Get(State::Context(), nullptr);
-}
-
-constexpr char GeckoThread::State::RUNNING_t::name[];
-constexpr char GeckoThread::State::RUNNING_t::signature[];
-
-auto GeckoThread::State::RUNNING() -> State::LocalRef
-{
- return mozilla::jni::Field<RUNNING_t>::Get(State::Context(), nullptr);
-}
-
-const char GeckoView::name[] =
- "org/mozilla/gecko/GeckoView";
-
-const char GeckoView::Window::name[] =
- "org/mozilla/gecko/GeckoView$Window";
-
-constexpr char GeckoView::Window::Close_t::name[];
-constexpr char GeckoView::Window::Close_t::signature[];
-
-constexpr char GeckoView::Window::DisposeNative_t::name[];
-constexpr char GeckoView::Window::DisposeNative_t::signature[];
-
-constexpr char GeckoView::Window::LoadUri_t::name[];
-constexpr char GeckoView::Window::LoadUri_t::signature[];
-
-constexpr char GeckoView::Window::Open_t::name[];
-constexpr char GeckoView::Window::Open_t::signature[];
-
-constexpr char GeckoView::Window::Reattach_t::name[];
-constexpr char GeckoView::Window::Reattach_t::signature[];
-
-const char PrefsHelper::name[] =
- "org/mozilla/gecko/PrefsHelper";
-
-constexpr char PrefsHelper::CallPrefHandler_t::name[];
-constexpr char PrefsHelper::CallPrefHandler_t::signature[];
-
-auto PrefsHelper::CallPrefHandler(mozilla::jni::Object::Param a0, int32_t a1, mozilla::jni::String::Param a2, bool a3, int32_t a4, mozilla::jni::String::Param a5) -> void
-{
- return mozilla::jni::Method<CallPrefHandler_t>::Call(PrefsHelper::Context(), nullptr, a0, a1, a2, a3, a4, a5);
-}
-
-constexpr char PrefsHelper::AddObserver_t::name[];
-constexpr char PrefsHelper::AddObserver_t::signature[];
-
-constexpr char PrefsHelper::GetPrefs_t::name[];
-constexpr char PrefsHelper::GetPrefs_t::signature[];
-
-constexpr char PrefsHelper::RemoveObserver_t::name[];
-constexpr char PrefsHelper::RemoveObserver_t::signature[];
-
-constexpr char PrefsHelper::SetPref_t::name[];
-constexpr char PrefsHelper::SetPref_t::signature[];
-
-constexpr char PrefsHelper::OnPrefChange_t::name[];
-constexpr char PrefsHelper::OnPrefChange_t::signature[];
-
-auto PrefsHelper::OnPrefChange(mozilla::jni::String::Param a0, int32_t a1, bool a2, int32_t a3, mozilla::jni::String::Param a4) -> void
-{
- return mozilla::jni::Method<OnPrefChange_t>::Call(PrefsHelper::Context(), nullptr, a0, a1, a2, a3, a4);
-}
-
-const char SurfaceTextureListener::name[] =
- "org/mozilla/gecko/SurfaceTextureListener";
-
-constexpr char SurfaceTextureListener::New_t::name[];
-constexpr char SurfaceTextureListener::New_t::signature[];
-
-auto SurfaceTextureListener::New() -> SurfaceTextureListener::LocalRef
-{
- return mozilla::jni::Constructor<New_t>::Call(SurfaceTextureListener::Context(), nullptr);
-}
-
-constexpr char SurfaceTextureListener::OnFrameAvailable_t::name[];
-constexpr char SurfaceTextureListener::OnFrameAvailable_t::signature[];
-
-const char GeckoLayerClient::name[] =
- "org/mozilla/gecko/gfx/GeckoLayerClient";
-
-constexpr char GeckoLayerClient::ContentDocumentChanged_t::name[];
-constexpr char GeckoLayerClient::ContentDocumentChanged_t::signature[];
-
-auto GeckoLayerClient::ContentDocumentChanged() const -> void
-{
- return mozilla::jni::Method<ContentDocumentChanged_t>::Call(GeckoLayerClient::mCtx, nullptr);
-}
-
-constexpr char GeckoLayerClient::CreateFrame_t::name[];
-constexpr char GeckoLayerClient::CreateFrame_t::signature[];
-
-auto GeckoLayerClient::CreateFrame() const -> mozilla::jni::Object::LocalRef
-{
- return mozilla::jni::Method<CreateFrame_t>::Call(GeckoLayerClient::mCtx, nullptr);
-}
-
-constexpr char GeckoLayerClient::IsContentDocumentDisplayed_t::name[];
-constexpr char GeckoLayerClient::IsContentDocumentDisplayed_t::signature[];
-
-auto GeckoLayerClient::IsContentDocumentDisplayed() const -> bool
-{
- return mozilla::jni::Method<IsContentDocumentDisplayed_t>::Call(GeckoLayerClient::mCtx, nullptr);
-}
-
-constexpr char GeckoLayerClient::OnGeckoReady_t::name[];
-constexpr char GeckoLayerClient::OnGeckoReady_t::signature[];
-
-auto GeckoLayerClient::OnGeckoReady() const -> void
-{
- return mozilla::jni::Method<OnGeckoReady_t>::Call(GeckoLayerClient::mCtx, nullptr);
-}
-
-constexpr char GeckoLayerClient::SetFirstPaintViewport_t::name[];
-constexpr char GeckoLayerClient::SetFirstPaintViewport_t::signature[];
-
-auto GeckoLayerClient::SetFirstPaintViewport(float a0, float a1, float a2, float a3, float a4, float a5, float a6) const -> void
-{
- return mozilla::jni::Method<SetFirstPaintViewport_t>::Call(GeckoLayerClient::mCtx, nullptr, a0, a1, a2, a3, a4, a5, a6);
-}
-
-constexpr char GeckoLayerClient::SyncFrameMetrics_t::name[];
-constexpr char GeckoLayerClient::SyncFrameMetrics_t::signature[];
-
-auto GeckoLayerClient::SyncFrameMetrics(float a0, float a1, float a2, float a3, float a4, float a5, float a6, int32_t a7, int32_t a8, int32_t a9, int32_t a10, float a11, bool a12, int32_t a13) const -> mozilla::jni::Object::LocalRef
-{
- return mozilla::jni::Method<SyncFrameMetrics_t>::Call(GeckoLayerClient::mCtx, nullptr, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13);
-}
-
-constexpr char GeckoLayerClient::SynthesizeNativeMouseEvent_t::name[];
-constexpr char GeckoLayerClient::SynthesizeNativeMouseEvent_t::signature[];
-
-auto GeckoLayerClient::SynthesizeNativeMouseEvent(int32_t a0, int32_t a1, int32_t a2) const -> void
-{
- return mozilla::jni::Method<SynthesizeNativeMouseEvent_t>::Call(GeckoLayerClient::mCtx, nullptr, a0, a1, a2);
-}
-
-constexpr char GeckoLayerClient::SynthesizeNativeTouchPoint_t::name[];
-constexpr char GeckoLayerClient::SynthesizeNativeTouchPoint_t::signature[];
-
-auto GeckoLayerClient::SynthesizeNativeTouchPoint(int32_t a0, int32_t a1, int32_t a2, int32_t a3, double a4, int32_t a5) const -> void
-{
- return mozilla::jni::Method<SynthesizeNativeTouchPoint_t>::Call(GeckoLayerClient::mCtx, nullptr, a0, a1, a2, a3, a4, a5);
-}
-
-constexpr char GeckoLayerClient::ClearColor_t::name[];
-constexpr char GeckoLayerClient::ClearColor_t::signature[];
-
-auto GeckoLayerClient::ClearColor() const -> int32_t
-{
- return mozilla::jni::Field<ClearColor_t>::Get(GeckoLayerClient::mCtx, nullptr);
-}
-
-auto GeckoLayerClient::ClearColor(int32_t a0) const -> void
-{
- return mozilla::jni::Field<ClearColor_t>::Set(GeckoLayerClient::mCtx, nullptr, a0);
-}
-
-const char ImmutableViewportMetrics::name[] =
- "org/mozilla/gecko/gfx/ImmutableViewportMetrics";
-
-constexpr char ImmutableViewportMetrics::New_t::name[];
-constexpr char ImmutableViewportMetrics::New_t::signature[];
-
-auto ImmutableViewportMetrics::New(float a0, float a1, float a2, float a3, float a4, float a5, float a6, float a7, float a8, float a9, int32_t a10, int32_t a11, float a12) -> ImmutableViewportMetrics::LocalRef
-{
- return mozilla::jni::Constructor<New_t>::Call(ImmutableViewportMetrics::Context(), nullptr, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12);
-}
-
-const char LayerRenderer::name[] =
- "org/mozilla/gecko/gfx/LayerRenderer";
-
-const char LayerRenderer::Frame::name[] =
- "org/mozilla/gecko/gfx/LayerRenderer$Frame";
-
-constexpr char LayerRenderer::Frame::BeginDrawing_t::name[];
-constexpr char LayerRenderer::Frame::BeginDrawing_t::signature[];
-
-auto LayerRenderer::Frame::BeginDrawing() const -> void
-{
- return mozilla::jni::Method<BeginDrawing_t>::Call(Frame::mCtx, nullptr);
-}
-
-constexpr char LayerRenderer::Frame::EndDrawing_t::name[];
-constexpr char LayerRenderer::Frame::EndDrawing_t::signature[];
-
-auto LayerRenderer::Frame::EndDrawing() const -> void
-{
- return mozilla::jni::Method<EndDrawing_t>::Call(Frame::mCtx, nullptr);
-}
-
-const char LayerView::name[] =
- "org/mozilla/gecko/gfx/LayerView";
-
-constexpr char LayerView::GetCompositor_t::name[];
-constexpr char LayerView::GetCompositor_t::signature[];
-
-auto LayerView::GetCompositor() const -> mozilla::jni::Object::LocalRef
-{
- return mozilla::jni::Method<GetCompositor_t>::Call(LayerView::mCtx, nullptr);
-}
-
-constexpr char LayerView::UpdateZoomedView_t::name[];
-constexpr char LayerView::UpdateZoomedView_t::signature[];
-
-auto LayerView::UpdateZoomedView(mozilla::jni::ByteBuffer::Param a0) -> void
-{
- return mozilla::jni::Method<UpdateZoomedView_t>::Call(LayerView::Context(), nullptr, a0);
-}
-
-constexpr char LayerView::CompositorCreated_t::name[];
-constexpr char LayerView::CompositorCreated_t::signature[];
-
-auto LayerView::CompositorCreated() const -> bool
-{
- return mozilla::jni::Field<CompositorCreated_t>::Get(LayerView::mCtx, nullptr);
-}
-
-auto LayerView::CompositorCreated(bool a0) const -> void
-{
- return mozilla::jni::Field<CompositorCreated_t>::Set(LayerView::mCtx, nullptr, a0);
-}
-
-const char LayerView::Compositor::name[] =
- "org/mozilla/gecko/gfx/LayerView$Compositor";
-
-constexpr char LayerView::Compositor::AttachToJava_t::name[];
-constexpr char LayerView::Compositor::AttachToJava_t::signature[];
-
-constexpr char LayerView::Compositor::CreateCompositor_t::name[];
-constexpr char LayerView::Compositor::CreateCompositor_t::signature[];
-
-constexpr char LayerView::Compositor::Destroy_t::name[];
-constexpr char LayerView::Compositor::Destroy_t::signature[];
-
-auto LayerView::Compositor::Destroy() const -> void
-{
- return mozilla::jni::Method<Destroy_t>::Call(Compositor::mCtx, nullptr);
-}
-
-constexpr char LayerView::Compositor::DisposeNative_t::name[];
-constexpr char LayerView::Compositor::DisposeNative_t::signature[];
-
-constexpr char LayerView::Compositor::OnSizeChanged_t::name[];
-constexpr char LayerView::Compositor::OnSizeChanged_t::signature[];
-
-constexpr char LayerView::Compositor::Reattach_t::name[];
-constexpr char LayerView::Compositor::Reattach_t::signature[];
-
-auto LayerView::Compositor::Reattach() const -> void
-{
- return mozilla::jni::Method<Reattach_t>::Call(Compositor::mCtx, nullptr);
-}
-
-constexpr char LayerView::Compositor::SyncInvalidateAndScheduleComposite_t::name[];
-constexpr char LayerView::Compositor::SyncInvalidateAndScheduleComposite_t::signature[];
-
-constexpr char LayerView::Compositor::SyncPauseCompositor_t::name[];
-constexpr char LayerView::Compositor::SyncPauseCompositor_t::signature[];
-
-constexpr char LayerView::Compositor::SyncResumeResizeCompositor_t::name[];
-constexpr char LayerView::Compositor::SyncResumeResizeCompositor_t::signature[];
-
-const char NativePanZoomController::name[] =
- "org/mozilla/gecko/gfx/NativePanZoomController";
-
-constexpr char NativePanZoomController::AdjustScrollForSurfaceShift_t::name[];
-constexpr char NativePanZoomController::AdjustScrollForSurfaceShift_t::signature[];
-
-constexpr char NativePanZoomController::Destroy_t::name[];
-constexpr char NativePanZoomController::Destroy_t::signature[];
-
-auto NativePanZoomController::Destroy() const -> void
-{
- return mozilla::jni::Method<Destroy_t>::Call(NativePanZoomController::mCtx, nullptr);
-}
-
-constexpr char NativePanZoomController::DisposeNative_t::name[];
-constexpr char NativePanZoomController::DisposeNative_t::signature[];
-
-constexpr char NativePanZoomController::HandleMotionEvent_t::name[];
-constexpr char NativePanZoomController::HandleMotionEvent_t::signature[];
-
-constexpr char NativePanZoomController::HandleMotionEventVelocity_t::name[];
-constexpr char NativePanZoomController::HandleMotionEventVelocity_t::signature[];
-
-constexpr char NativePanZoomController::HandleMouseEvent_t::name[];
-constexpr char NativePanZoomController::HandleMouseEvent_t::signature[];
-
-constexpr char NativePanZoomController::HandleScrollEvent_t::name[];
-constexpr char NativePanZoomController::HandleScrollEvent_t::signature[];
-
-constexpr char NativePanZoomController::SetIsLongpressEnabled_t::name[];
-constexpr char NativePanZoomController::SetIsLongpressEnabled_t::signature[];
-
-constexpr char NativePanZoomController::OnSelectionDragState_t::name[];
-constexpr char NativePanZoomController::OnSelectionDragState_t::signature[];
-
-auto NativePanZoomController::OnSelectionDragState(bool a0) const -> void
-{
- return mozilla::jni::Method<OnSelectionDragState_t>::Call(NativePanZoomController::mCtx, nullptr, a0);
-}
-
-constexpr char NativePanZoomController::SetScrollingRootContent_t::name[];
-constexpr char NativePanZoomController::SetScrollingRootContent_t::signature[];
-
-auto NativePanZoomController::SetScrollingRootContent(bool a0) const -> void
-{
- return mozilla::jni::Method<SetScrollingRootContent_t>::Call(NativePanZoomController::mCtx, nullptr, a0);
-}
-
-constexpr char NativePanZoomController::UpdateOverscrollOffset_t::name[];
-constexpr char NativePanZoomController::UpdateOverscrollOffset_t::signature[];
-
-auto NativePanZoomController::UpdateOverscrollOffset(float a0, float a1) const -> void
-{
- return mozilla::jni::Method<UpdateOverscrollOffset_t>::Call(NativePanZoomController::mCtx, nullptr, a0, a1);
-}
-
-constexpr char NativePanZoomController::UpdateOverscrollVelocity_t::name[];
-constexpr char NativePanZoomController::UpdateOverscrollVelocity_t::signature[];
-
-auto NativePanZoomController::UpdateOverscrollVelocity(float a0, float a1) const -> void
-{
- return mozilla::jni::Method<UpdateOverscrollVelocity_t>::Call(NativePanZoomController::mCtx, nullptr, a0, a1);
-}
-
-const char ProgressiveUpdateData::name[] =
- "org/mozilla/gecko/gfx/ProgressiveUpdateData";
-
-constexpr char ProgressiveUpdateData::New_t::name[];
-constexpr char ProgressiveUpdateData::New_t::signature[];
-
-auto ProgressiveUpdateData::New() -> ProgressiveUpdateData::LocalRef
-{
- return mozilla::jni::Constructor<New_t>::Call(ProgressiveUpdateData::Context(), nullptr);
-}
-
-constexpr char ProgressiveUpdateData::SetViewport_t::name[];
-constexpr char ProgressiveUpdateData::SetViewport_t::signature[];
-
-auto ProgressiveUpdateData::SetViewport(mozilla::jni::Object::Param a0) const -> void
-{
- return mozilla::jni::Method<SetViewport_t>::Call(ProgressiveUpdateData::mCtx, nullptr, a0);
-}
-
-constexpr char ProgressiveUpdateData::Abort_t::name[];
-constexpr char ProgressiveUpdateData::Abort_t::signature[];
-
-auto ProgressiveUpdateData::Abort() const -> bool
-{
- return mozilla::jni::Field<Abort_t>::Get(ProgressiveUpdateData::mCtx, nullptr);
-}
-
-auto ProgressiveUpdateData::Abort(bool a0) const -> void
-{
- return mozilla::jni::Field<Abort_t>::Set(ProgressiveUpdateData::mCtx, nullptr, a0);
-}
-
-constexpr char ProgressiveUpdateData::Scale_t::name[];
-constexpr char ProgressiveUpdateData::Scale_t::signature[];
-
-auto ProgressiveUpdateData::Scale() const -> float
-{
- return mozilla::jni::Field<Scale_t>::Get(ProgressiveUpdateData::mCtx, nullptr);
-}
-
-auto ProgressiveUpdateData::Scale(float a0) const -> void
-{
- return mozilla::jni::Field<Scale_t>::Set(ProgressiveUpdateData::mCtx, nullptr, a0);
-}
-
-constexpr char ProgressiveUpdateData::X_t::name[];
-constexpr char ProgressiveUpdateData::X_t::signature[];
-
-auto ProgressiveUpdateData::X() const -> float
-{
- return mozilla::jni::Field<X_t>::Get(ProgressiveUpdateData::mCtx, nullptr);
-}
-
-auto ProgressiveUpdateData::X(float a0) const -> void
-{
- return mozilla::jni::Field<X_t>::Set(ProgressiveUpdateData::mCtx, nullptr, a0);
-}
-
-constexpr char ProgressiveUpdateData::Y_t::name[];
-constexpr char ProgressiveUpdateData::Y_t::signature[];
-
-auto ProgressiveUpdateData::Y() const -> float
-{
- return mozilla::jni::Field<Y_t>::Get(ProgressiveUpdateData::mCtx, nullptr);
-}
-
-auto ProgressiveUpdateData::Y(float a0) const -> void
-{
- return mozilla::jni::Field<Y_t>::Set(ProgressiveUpdateData::mCtx, nullptr, a0);
-}
-
-const char StackScroller::name[] =
- "org/mozilla/gecko/gfx/StackScroller";
-
-constexpr char StackScroller::New_t::name[];
-constexpr char StackScroller::New_t::signature[];
-
-auto StackScroller::New(mozilla::jni::Object::Param a0, StackScroller::LocalRef* a1) -> nsresult
-{
- MOZ_ASSERT(a1);
- nsresult rv = NS_OK;
- *a1 = mozilla::jni::Constructor<New_t>::Call(StackScroller::Context(), &rv, a0);
- return rv;
-}
-
-constexpr char StackScroller::AbortAnimation_t::name[];
-constexpr char StackScroller::AbortAnimation_t::signature[];
-
-auto StackScroller::AbortAnimation() const -> nsresult
-{
- nsresult rv = NS_OK;
- mozilla::jni::Method<AbortAnimation_t>::Call(StackScroller::mCtx, &rv);
- return rv;
-}
-
-constexpr char StackScroller::ComputeScrollOffset_t::name[];
-constexpr char StackScroller::ComputeScrollOffset_t::signature[];
-
-auto StackScroller::ComputeScrollOffset(int64_t a0, bool* a1) const -> nsresult
-{
- MOZ_ASSERT(a1);
- nsresult rv = NS_OK;
- *a1 = mozilla::jni::Method<ComputeScrollOffset_t>::Call(StackScroller::mCtx, &rv, a0);
- return rv;
-}
-
-constexpr char StackScroller::Fling_t::name[];
-constexpr char StackScroller::Fling_t::signature[];
-
-auto StackScroller::Fling(int32_t a0, int32_t a1, int32_t a2, int32_t a3, int32_t a4, int32_t a5, int32_t a6, int32_t a7, int32_t a8, int32_t a9, int64_t a10) const -> nsresult
-{
- nsresult rv = NS_OK;
- mozilla::jni::Method<Fling_t>::Call(StackScroller::mCtx, &rv, a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10);
- return rv;
-}
-
-constexpr char StackScroller::ForceFinished_t::name[];
-constexpr char StackScroller::ForceFinished_t::signature[];
-
-auto StackScroller::ForceFinished(bool a0) const -> nsresult
-{
- nsresult rv = NS_OK;
- mozilla::jni::Method<ForceFinished_t>::Call(StackScroller::mCtx, &rv, a0);
- return rv;
-}
-
-constexpr char StackScroller::GetCurrSpeedX_t::name[];
-constexpr char StackScroller::GetCurrSpeedX_t::signature[];
-
-auto StackScroller::GetCurrSpeedX(float* a0) const -> nsresult
-{
- MOZ_ASSERT(a0);
- nsresult rv = NS_OK;
- *a0 = mozilla::jni::Method<GetCurrSpeedX_t>::Call(StackScroller::mCtx, &rv);
- return rv;
-}
-
-constexpr char StackScroller::GetCurrSpeedY_t::name[];
-constexpr char StackScroller::GetCurrSpeedY_t::signature[];
-
-auto StackScroller::GetCurrSpeedY(float* a0) const -> nsresult
-{
- MOZ_ASSERT(a0);
- nsresult rv = NS_OK;
- *a0 = mozilla::jni::Method<GetCurrSpeedY_t>::Call(StackScroller::mCtx, &rv);
- return rv;
-}
-
-constexpr char StackScroller::GetCurrX_t::name[];
-constexpr char StackScroller::GetCurrX_t::signature[];
-
-auto StackScroller::GetCurrX(int32_t* a0) const -> nsresult
-{
- MOZ_ASSERT(a0);
- nsresult rv = NS_OK;
- *a0 = mozilla::jni::Method<GetCurrX_t>::Call(StackScroller::mCtx, &rv);
- return rv;
-}
-
-constexpr char StackScroller::GetCurrY_t::name[];
-constexpr char StackScroller::GetCurrY_t::signature[];
-
-auto StackScroller::GetCurrY(int32_t* a0) const -> nsresult
-{
- MOZ_ASSERT(a0);
- nsresult rv = NS_OK;
- *a0 = mozilla::jni::Method<GetCurrY_t>::Call(StackScroller::mCtx, &rv);
- return rv;
-}
-
-constexpr char StackScroller::GetFinalX_t::name[];
-constexpr char StackScroller::GetFinalX_t::signature[];
-
-auto StackScroller::GetFinalX(int32_t* a0) const -> nsresult
-{
- MOZ_ASSERT(a0);
- nsresult rv = NS_OK;
- *a0 = mozilla::jni::Method<GetFinalX_t>::Call(StackScroller::mCtx, &rv);
- return rv;
-}
-
-constexpr char StackScroller::GetFinalY_t::name[];
-constexpr char StackScroller::GetFinalY_t::signature[];
-
-auto StackScroller::GetFinalY(int32_t* a0) const -> nsresult
-{
- MOZ_ASSERT(a0);
- nsresult rv = NS_OK;
- *a0 = mozilla::jni::Method<GetFinalY_t>::Call(StackScroller::mCtx, &rv);
- return rv;
-}
-
-constexpr char StackScroller::InitContants_t::name[];
-constexpr char StackScroller::InitContants_t::signature[];
-
-auto StackScroller::InitContants() -> nsresult
-{
- nsresult rv = NS_OK;
- mozilla::jni::Method<InitContants_t>::Call(StackScroller::Context(), &rv);
- return rv;
-}
-
-constexpr char StackScroller::IsFinished_t::name[];
-constexpr char StackScroller::IsFinished_t::signature[];
-
-auto StackScroller::IsFinished(bool* a0) const -> nsresult
-{
- MOZ_ASSERT(a0);
- nsresult rv = NS_OK;
- *a0 = mozilla::jni::Method<IsFinished_t>::Call(StackScroller::mCtx, &rv);
- return rv;
-}
-
-constexpr char StackScroller::SetFinalX_t::name[];
-constexpr char StackScroller::SetFinalX_t::signature[];
-
-auto StackScroller::SetFinalX(int32_t a0) const -> nsresult
-{
- nsresult rv = NS_OK;
- mozilla::jni::Method<SetFinalX_t>::Call(StackScroller::mCtx, &rv, a0);
- return rv;
-}
-
-constexpr char StackScroller::SpringBack_t::name[];
-constexpr char StackScroller::SpringBack_t::signature[];
-
-auto StackScroller::SpringBack(int32_t a0, int32_t a1, int32_t a2, int32_t a3, int32_t a4, int32_t a5, int64_t a6, bool* a7) const -> nsresult
-{
- MOZ_ASSERT(a7);
- nsresult rv = NS_OK;
- *a7 = mozilla::jni::Method<SpringBack_t>::Call(StackScroller::mCtx, &rv, a0, a1, a2, a3, a4, a5, a6);
- return rv;
-}
-
-constexpr char StackScroller::StartScroll_t::name[];
-constexpr char StackScroller::StartScroll_t::signature[];
-
-auto StackScroller::StartScroll(int32_t a0, int32_t a1, int32_t a2, int32_t a3, int64_t a4, int32_t a5) const -> nsresult
-{
- nsresult rv = NS_OK;
- mozilla::jni::Method<StartScroll_t>::Call(StackScroller::mCtx, &rv, a0, a1, a2, a3, a4, a5);
- return rv;
-}
-
-constexpr char StackScroller::ViscousFluid_t::name[];
-constexpr char StackScroller::ViscousFluid_t::signature[];
-
-auto StackScroller::ViscousFluid(float a0, float* a1) -> nsresult
-{
- MOZ_ASSERT(a1);
- nsresult rv = NS_OK;
- *a1 = mozilla::jni::Method<ViscousFluid_t>::Call(StackScroller::Context(), &rv, a0);
- return rv;
-}
-
-constexpr char StackScroller::MFlywheel_t::name[];
-constexpr char StackScroller::MFlywheel_t::signature[];
-
-auto StackScroller::MFlywheel(bool* a0) const -> nsresult
-{
- MOZ_ASSERT(a0);
- nsresult rv = NS_OK;
- *a0 = mozilla::jni::Field<MFlywheel_t>::Get(StackScroller::mCtx, &rv);
- return rv;
-}
-
-constexpr char StackScroller::MMode_t::name[];
-constexpr char StackScroller::MMode_t::signature[];
-
-auto StackScroller::MMode(int32_t* a0) const -> nsresult
-{
- MOZ_ASSERT(a0);
- nsresult rv = NS_OK;
- *a0 = mozilla::jni::Field<MMode_t>::Get(StackScroller::mCtx, &rv);
- return rv;
-}
-
-auto StackScroller::MMode(int32_t a0) const -> nsresult
-{
- nsresult rv = NS_OK;
- mozilla::jni::Field<MMode_t>::Set(StackScroller::mCtx, &rv, a0);
- return rv;
-}
-
-constexpr char StackScroller::MScrollerX_t::name[];
-constexpr char StackScroller::MScrollerX_t::signature[];
-
-auto StackScroller::MScrollerX(mozilla::jni::Object::LocalRef* a0) const -> nsresult
-{
- MOZ_ASSERT(a0);
- nsresult rv = NS_OK;
- *a0 = mozilla::jni::Field<MScrollerX_t>::Get(StackScroller::mCtx, &rv);
- return rv;
-}
-
-constexpr char StackScroller::MScrollerY_t::name[];
-constexpr char StackScroller::MScrollerY_t::signature[];
-
-auto StackScroller::MScrollerY(mozilla::jni::Object::LocalRef* a0) const -> nsresult
-{
- MOZ_ASSERT(a0);
- nsresult rv = NS_OK;
- *a0 = mozilla::jni::Field<MScrollerY_t>::Get(StackScroller::mCtx, &rv);
- return rv;
-}
-
-constexpr char StackScroller::SViscousFluidNormalize_t::name[];
-constexpr char StackScroller::SViscousFluidNormalize_t::signature[];
-
-auto StackScroller::SViscousFluidNormalize(float* a0) -> nsresult
-{
- MOZ_ASSERT(a0);
- nsresult rv = NS_OK;
- *a0 = mozilla::jni::Field<SViscousFluidNormalize_t>::Get(StackScroller::Context(), &rv);
- return rv;
-}
-
-auto StackScroller::SViscousFluidNormalize(float a0) -> nsresult
-{
- nsresult rv = NS_OK;
- mozilla::jni::Field<SViscousFluidNormalize_t>::Set(StackScroller::Context(), &rv, a0);
- return rv;
-}
-
-constexpr char StackScroller::SViscousFluidScale_t::name[];
-constexpr char StackScroller::SViscousFluidScale_t::signature[];
-
-auto StackScroller::SViscousFluidScale(float* a0) -> nsresult
-{
- MOZ_ASSERT(a0);
- nsresult rv = NS_OK;
- *a0 = mozilla::jni::Field<SViscousFluidScale_t>::Get(StackScroller::Context(), &rv);
- return rv;
-}
-
-auto StackScroller::SViscousFluidScale(float a0) -> nsresult
-{
- nsresult rv = NS_OK;
- mozilla::jni::Field<SViscousFluidScale_t>::Set(StackScroller::Context(), &rv, a0);
- return rv;
-}
-
-const char ViewTransform::name[] =
- "org/mozilla/gecko/gfx/ViewTransform";
-
-constexpr char ViewTransform::New_t::name[];
-constexpr char ViewTransform::New_t::signature[];
-
-auto ViewTransform::New(float a0, float a1, float a2) -> ViewTransform::LocalRef
-{
- return mozilla::jni::Constructor<New_t>::Call(ViewTransform::Context(), nullptr, a0, a1, a2);
-}
-
-constexpr char ViewTransform::FixedLayerMarginBottom_t::name[];
-constexpr char ViewTransform::FixedLayerMarginBottom_t::signature[];
-
-auto ViewTransform::FixedLayerMarginBottom() const -> float
-{
- return mozilla::jni::Field<FixedLayerMarginBottom_t>::Get(ViewTransform::mCtx, nullptr);
-}
-
-auto ViewTransform::FixedLayerMarginBottom(float a0) const -> void
-{
- return mozilla::jni::Field<FixedLayerMarginBottom_t>::Set(ViewTransform::mCtx, nullptr, a0);
-}
-
-constexpr char ViewTransform::FixedLayerMarginLeft_t::name[];
-constexpr char ViewTransform::FixedLayerMarginLeft_t::signature[];
-
-auto ViewTransform::FixedLayerMarginLeft() const -> float
-{
- return mozilla::jni::Field<FixedLayerMarginLeft_t>::Get(ViewTransform::mCtx, nullptr);
-}
-
-auto ViewTransform::FixedLayerMarginLeft(float a0) const -> void
-{
- return mozilla::jni::Field<FixedLayerMarginLeft_t>::Set(ViewTransform::mCtx, nullptr, a0);
-}
-
-constexpr char ViewTransform::FixedLayerMarginRight_t::name[];
-constexpr char ViewTransform::FixedLayerMarginRight_t::signature[];
-
-auto ViewTransform::FixedLayerMarginRight() const -> float
-{
- return mozilla::jni::Field<FixedLayerMarginRight_t>::Get(ViewTransform::mCtx, nullptr);
-}
-
-auto ViewTransform::FixedLayerMarginRight(float a0) const -> void
-{
- return mozilla::jni::Field<FixedLayerMarginRight_t>::Set(ViewTransform::mCtx, nullptr, a0);
-}
-
-constexpr char ViewTransform::FixedLayerMarginTop_t::name[];
-constexpr char ViewTransform::FixedLayerMarginTop_t::signature[];
-
-auto ViewTransform::FixedLayerMarginTop() const -> float
-{
- return mozilla::jni::Field<FixedLayerMarginTop_t>::Get(ViewTransform::mCtx, nullptr);
-}
-
-auto ViewTransform::FixedLayerMarginTop(float a0) const -> void
-{
- return mozilla::jni::Field<FixedLayerMarginTop_t>::Set(ViewTransform::mCtx, nullptr, a0);
-}
-
-constexpr char ViewTransform::Height_t::name[];
-constexpr char ViewTransform::Height_t::signature[];
-
-auto ViewTransform::Height() const -> float
-{
- return mozilla::jni::Field<Height_t>::Get(ViewTransform::mCtx, nullptr);
-}
-
-auto ViewTransform::Height(float a0) const -> void
-{
- return mozilla::jni::Field<Height_t>::Set(ViewTransform::mCtx, nullptr, a0);
-}
-
-constexpr char ViewTransform::Scale_t::name[];
-constexpr char ViewTransform::Scale_t::signature[];
-
-auto ViewTransform::Scale() const -> float
-{
- return mozilla::jni::Field<Scale_t>::Get(ViewTransform::mCtx, nullptr);
-}
-
-auto ViewTransform::Scale(float a0) const -> void
-{
- return mozilla::jni::Field<Scale_t>::Set(ViewTransform::mCtx, nullptr, a0);
-}
-
-constexpr char ViewTransform::Width_t::name[];
-constexpr char ViewTransform::Width_t::signature[];
-
-auto ViewTransform::Width() const -> float
-{
- return mozilla::jni::Field<Width_t>::Get(ViewTransform::mCtx, nullptr);
-}
-
-auto ViewTransform::Width(float a0) const -> void
-{
- return mozilla::jni::Field<Width_t>::Set(ViewTransform::mCtx, nullptr, a0);
-}
-
-constexpr char ViewTransform::X_t::name[];
-constexpr char ViewTransform::X_t::signature[];
-
-auto ViewTransform::X() const -> float
-{
- return mozilla::jni::Field<X_t>::Get(ViewTransform::mCtx, nullptr);
-}
-
-auto ViewTransform::X(float a0) const -> void
-{
- return mozilla::jni::Field<X_t>::Set(ViewTransform::mCtx, nullptr, a0);
-}
-
-constexpr char ViewTransform::Y_t::name[];
-constexpr char ViewTransform::Y_t::signature[];
-
-auto ViewTransform::Y() const -> float
-{
- return mozilla::jni::Field<Y_t>::Get(ViewTransform::mCtx, nullptr);
-}
-
-auto ViewTransform::Y(float a0) const -> void
-{
- return mozilla::jni::Field<Y_t>::Set(ViewTransform::mCtx, nullptr, a0);
-}
-
-const char Clipboard::name[] =
- "org/mozilla/gecko/util/Clipboard";
-
-constexpr char Clipboard::ClearText_t::name[];
-constexpr char Clipboard::ClearText_t::signature[];
-
-auto Clipboard::ClearText() -> void
-{
- return mozilla::jni::Method<ClearText_t>::Call(Clipboard::Context(), nullptr);
-}
-
-constexpr char Clipboard::GetText_t::name[];
-constexpr char Clipboard::GetText_t::signature[];
-
-auto Clipboard::GetText() -> mozilla::jni::String::LocalRef
-{
- return mozilla::jni::Method<GetText_t>::Call(Clipboard::Context(), nullptr);
-}
-
-constexpr char Clipboard::HasText_t::name[];
-constexpr char Clipboard::HasText_t::signature[];
-
-auto Clipboard::HasText() -> bool
-{
- return mozilla::jni::Method<HasText_t>::Call(Clipboard::Context(), nullptr);
-}
-
-constexpr char Clipboard::SetText_t::name[];
-constexpr char Clipboard::SetText_t::signature[];
-
-auto Clipboard::SetText(mozilla::jni::String::Param a0) -> void
-{
- return mozilla::jni::Method<SetText_t>::Call(Clipboard::Context(), nullptr, a0);
-}
-
-const char HardwareCodecCapabilityUtils::name[] =
- "org/mozilla/gecko/util/HardwareCodecCapabilityUtils";
-
-constexpr char HardwareCodecCapabilityUtils::HasHWVP9_t::name[];
-constexpr char HardwareCodecCapabilityUtils::HasHWVP9_t::signature[];
-
-auto HardwareCodecCapabilityUtils::HasHWVP9() -> bool
-{
- return mozilla::jni::Method<HasHWVP9_t>::Call(HardwareCodecCapabilityUtils::Context(), nullptr);
-}
-
-constexpr char HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType_t::name[];
-constexpr char HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType_t::signature[];
-
-auto HardwareCodecCapabilityUtils::FindDecoderCodecInfoForMimeType(mozilla::jni::String::Param a0) -> bool
-{
- return mozilla::jni::Method<FindDecoderCodecInfoForMimeType_t>::Call(HardwareCodecCapabilityUtils::Context(), nullptr, a0);
-}
-
-const char NativeJSContainer::name[] =
- "org/mozilla/gecko/util/NativeJSContainer";
-
-constexpr char NativeJSContainer::New_t::name[];
-constexpr char NativeJSContainer::New_t::signature[];
-
-auto NativeJSContainer::New() -> NativeJSContainer::LocalRef
-{
- return mozilla::jni::Constructor<New_t>::Call(NativeJSContainer::Context(), nullptr);
-}
-
-constexpr char NativeJSContainer::Clone2_t::name[];
-constexpr char NativeJSContainer::Clone2_t::signature[];
-
-constexpr char NativeJSContainer::DisposeNative_t::name[];
-constexpr char NativeJSContainer::DisposeNative_t::signature[];
-
-const char NativeJSObject::name[] =
- "org/mozilla/gecko/util/NativeJSObject";
-
-constexpr char NativeJSObject::New_t::name[];
-constexpr char NativeJSObject::New_t::signature[];
-
-auto NativeJSObject::New() -> NativeJSObject::LocalRef
-{
- return mozilla::jni::Constructor<New_t>::Call(NativeJSObject::Context(), nullptr);
-}
-
-constexpr char NativeJSObject::DisposeNative_t::name[];
-constexpr char NativeJSObject::DisposeNative_t::signature[];
-
-auto NativeJSObject::DisposeNative() const -> void
-{
- return mozilla::jni::Method<DisposeNative_t>::Call(NativeJSObject::mCtx, nullptr);
-}
-
-constexpr char NativeJSObject::GetBoolean_t::name[];
-constexpr char NativeJSObject::GetBoolean_t::signature[];
-
-constexpr char NativeJSObject::GetBooleanArray_t::name[];
-constexpr char NativeJSObject::GetBooleanArray_t::signature[];
-
-constexpr char NativeJSObject::GetBundle_t::name[];
-constexpr char NativeJSObject::GetBundle_t::signature[];
-
-constexpr char NativeJSObject::GetBundleArray_t::name[];
-constexpr char NativeJSObject::GetBundleArray_t::signature[];
-
-constexpr char NativeJSObject::GetDouble_t::name[];
-constexpr char NativeJSObject::GetDouble_t::signature[];
-
-constexpr char NativeJSObject::GetDoubleArray_t::name[];
-constexpr char NativeJSObject::GetDoubleArray_t::signature[];
-
-constexpr char NativeJSObject::GetInt_t::name[];
-constexpr char NativeJSObject::GetInt_t::signature[];
-
-constexpr char NativeJSObject::GetIntArray_t::name[];
-constexpr char NativeJSObject::GetIntArray_t::signature[];
-
-constexpr char NativeJSObject::GetObject_t::name[];
-constexpr char NativeJSObject::GetObject_t::signature[];
-
-constexpr char NativeJSObject::GetObjectArray_t::name[];
-constexpr char NativeJSObject::GetObjectArray_t::signature[];
-
-constexpr char NativeJSObject::GetString_t::name[];
-constexpr char NativeJSObject::GetString_t::signature[];
-
-constexpr char NativeJSObject::GetStringArray_t::name[];
-constexpr char NativeJSObject::GetStringArray_t::signature[];
-
-constexpr char NativeJSObject::Has_t::name[];
-constexpr char NativeJSObject::Has_t::signature[];
-
-constexpr char NativeJSObject::OptBoolean_t::name[];
-constexpr char NativeJSObject::OptBoolean_t::signature[];
-
-constexpr char NativeJSObject::OptBooleanArray_t::name[];
-constexpr char NativeJSObject::OptBooleanArray_t::signature[];
-
-constexpr char NativeJSObject::OptBundle_t::name[];
-constexpr char NativeJSObject::OptBundle_t::signature[];
-
-constexpr char NativeJSObject::OptBundleArray_t::name[];
-constexpr char NativeJSObject::OptBundleArray_t::signature[];
-
-constexpr char NativeJSObject::OptDouble_t::name[];
-constexpr char NativeJSObject::OptDouble_t::signature[];
-
-constexpr char NativeJSObject::OptDoubleArray_t::name[];
-constexpr char NativeJSObject::OptDoubleArray_t::signature[];
-
-constexpr char NativeJSObject::OptInt_t::name[];
-constexpr char NativeJSObject::OptInt_t::signature[];
-
-constexpr char NativeJSObject::OptIntArray_t::name[];
-constexpr char NativeJSObject::OptIntArray_t::signature[];
-
-constexpr char NativeJSObject::OptObject_t::name[];
-constexpr char NativeJSObject::OptObject_t::signature[];
-
-constexpr char NativeJSObject::OptObjectArray_t::name[];
-constexpr char NativeJSObject::OptObjectArray_t::signature[];
-
-constexpr char NativeJSObject::OptString_t::name[];
-constexpr char NativeJSObject::OptString_t::signature[];
-
-constexpr char NativeJSObject::OptStringArray_t::name[];
-constexpr char NativeJSObject::OptStringArray_t::signature[];
-
-constexpr char NativeJSObject::ToBundle_t::name[];
-constexpr char NativeJSObject::ToBundle_t::signature[];
-
-constexpr char NativeJSObject::ToString_t::name[];
-constexpr char NativeJSObject::ToString_t::signature[];
-
-} /* java */
-} /* mozilla */
diff --git a/widget/android/GeneratedJNIWrappers.h b/widget/android/GeneratedJNIWrappers.h
deleted file mode 100644
index 7d4777648..000000000
--- a/widget/android/GeneratedJNIWrappers.h
+++ /dev/null
@@ -1,5456 +0,0 @@
-// GENERATED CODE
-// Generated by the Java program at /build/annotationProcessors at compile time
-// from annotations on Java methods. To update, change the annotations on the
-// corresponding Java methods and rerun the build. Manually updating this file
-// will cause your build to fail.
-
-#ifndef GeneratedJNIWrappers_h
-#define GeneratedJNIWrappers_h
-
-#include "mozilla/jni/Refs.h"
-
-namespace mozilla {
-namespace java {
-
-class AlarmReceiver : public mozilla::jni::ObjectBase<AlarmReceiver>
-{
-public:
- static const char name[];
-
- explicit AlarmReceiver(const Context& ctx) : ObjectBase<AlarmReceiver>(ctx) {}
-
- struct NotifyAlarmFired_t {
- typedef AlarmReceiver Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "notifyAlarmFired";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
-
- template<class Impl> class Natives;
-};
-
-class AndroidGamepadManager : public mozilla::jni::ObjectBase<AndroidGamepadManager>
-{
-public:
- static const char name[];
-
- explicit AndroidGamepadManager(const Context& ctx) : ObjectBase<AndroidGamepadManager>(ctx) {}
-
- struct OnAxisChange_t {
- typedef AndroidGamepadManager Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- mozilla::jni::BooleanArray::Param,
- mozilla::jni::FloatArray::Param> Args;
- static constexpr char name[] = "onAxisChange";
- static constexpr char signature[] =
- "(I[Z[F)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnButtonChange_t {
- typedef AndroidGamepadManager Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- bool,
- float> Args;
- static constexpr char name[] = "onButtonChange";
- static constexpr char signature[] =
- "(IIZF)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnGamepadAdded_t {
- typedef AndroidGamepadManager Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t> Args;
- static constexpr char name[] = "onGamepadAdded";
- static constexpr char signature[] =
- "(II)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto OnGamepadAdded(int32_t, int32_t) -> void;
-
- struct OnGamepadChange_t {
- typedef AndroidGamepadManager Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- bool> Args;
- static constexpr char name[] = "onGamepadChange";
- static constexpr char signature[] =
- "(IZ)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct Start_t {
- typedef AndroidGamepadManager Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "start";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto Start() -> void;
-
- struct Stop_t {
- typedef AndroidGamepadManager Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "stop";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto Stop() -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class GeckoAppShell : public mozilla::jni::ObjectBase<GeckoAppShell>
-{
-public:
- static const char name[];
-
- explicit GeckoAppShell(const Context& ctx) : ObjectBase<GeckoAppShell>(ctx) {}
-
- class CameraCallback;
-
- struct AddFullScreenPluginView_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "addFullScreenPluginView";
- static constexpr char signature[] =
- "(Landroid/view/View;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto AddFullScreenPluginView(mozilla::jni::Object::Param) -> void;
-
- struct CancelVibrate_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "cancelVibrate";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto CancelVibrate() -> void;
-
- struct CheckURIVisited_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "checkUriVisited";
- static constexpr char signature[] =
- "(Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto CheckURIVisited(mozilla::jni::String::Param) -> void;
-
- struct CloseCamera_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "closeCamera";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto CloseCamera() -> void;
-
- struct CloseNotification_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "closeNotification";
- static constexpr char signature[] =
- "(Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto CloseNotification(mozilla::jni::String::Param) -> void;
-
- struct ConnectionGetMimeType_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::String::LocalRef ReturnType;
- typedef mozilla::jni::String::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "connectionGetMimeType";
- static constexpr char signature[] =
- "(Ljava/net/URLConnection;)Ljava/lang/String;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto ConnectionGetMimeType(mozilla::jni::Object::Param) -> mozilla::jni::String::LocalRef;
-
- struct CreateInputStream_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "createInputStream";
- static constexpr char signature[] =
- "(Ljava/net/URLConnection;)Ljava/io/InputStream;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto CreateInputStream(mozilla::jni::Object::Param) -> mozilla::jni::Object::LocalRef;
-
- struct CreateShortcut_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "createShortcut";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto CreateShortcut(mozilla::jni::String::Param, mozilla::jni::String::Param) -> void;
-
- struct DisableAlarm_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "disableAlarm";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto DisableAlarm() -> void;
-
- struct DisableBatteryNotifications_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "disableBatteryNotifications";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto DisableBatteryNotifications() -> void;
-
- struct DisableNetworkNotifications_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "disableNetworkNotifications";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto DisableNetworkNotifications() -> void;
-
- struct DisableScreenOrientationNotifications_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "disableScreenOrientationNotifications";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto DisableScreenOrientationNotifications() -> void;
-
- struct DisableSensor_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t> Args;
- static constexpr char name[] = "disableSensor";
- static constexpr char signature[] =
- "(I)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto DisableSensor(int32_t) -> void;
-
- struct EnableBatteryNotifications_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "enableBatteryNotifications";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto EnableBatteryNotifications() -> void;
-
- struct EnableLocation_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- bool> Args;
- static constexpr char name[] = "enableLocation";
- static constexpr char signature[] =
- "(Z)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto EnableLocation(bool) -> void;
-
- struct EnableLocationHighAccuracy_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- bool> Args;
- static constexpr char name[] = "enableLocationHighAccuracy";
- static constexpr char signature[] =
- "(Z)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto EnableLocationHighAccuracy(bool) -> void;
-
- struct EnableNetworkNotifications_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "enableNetworkNotifications";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto EnableNetworkNotifications() -> void;
-
- struct EnableScreenOrientationNotifications_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "enableScreenOrientationNotifications";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto EnableScreenOrientationNotifications() -> void;
-
- struct EnableSensor_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t> Args;
- static constexpr char name[] = "enableSensor";
- static constexpr char signature[] =
- "(I)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto EnableSensor(int32_t) -> void;
-
- struct GetApplicationContext_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getApplicationContext";
- static constexpr char signature[] =
- "()Landroid/content/Context;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetApplicationContext() -> mozilla::jni::Object::LocalRef;
-
- struct GetConnection_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getConnection";
- static constexpr char signature[] =
- "(Ljava/lang/String;)Ljava/net/URLConnection;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetConnection(mozilla::jni::String::Param) -> mozilla::jni::Object::LocalRef;
-
- struct GetContext_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getContext";
- static constexpr char signature[] =
- "()Landroid/content/Context;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetContext() -> mozilla::jni::Object::LocalRef;
-
- struct GetCurrentBatteryInformation_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::DoubleArray::LocalRef ReturnType;
- typedef mozilla::jni::DoubleArray::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getCurrentBatteryInformation";
- static constexpr char signature[] =
- "()[D";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetCurrentBatteryInformation() -> mozilla::jni::DoubleArray::LocalRef;
-
- struct GetCurrentNetworkInformation_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::DoubleArray::LocalRef ReturnType;
- typedef mozilla::jni::DoubleArray::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getCurrentNetworkInformation";
- static constexpr char signature[] =
- "()[D";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetCurrentNetworkInformation() -> mozilla::jni::DoubleArray::LocalRef;
-
- struct GetDensity_t {
- typedef GeckoAppShell Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getDensity";
- static constexpr char signature[] =
- "()F";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetDensity() -> float;
-
- struct GetDpi_t {
- typedef GeckoAppShell Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getDpi";
- static constexpr char signature[] =
- "()I";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetDpi() -> int32_t;
-
- struct GetExceptionStackTrace_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::String::LocalRef ReturnType;
- typedef mozilla::jni::String::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Throwable::Param> Args;
- static constexpr char name[] = "getExceptionStackTrace";
- static constexpr char signature[] =
- "(Ljava/lang/Throwable;)Ljava/lang/String;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::IGNORE;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetExceptionStackTrace(mozilla::jni::Throwable::Param) -> mozilla::jni::String::LocalRef;
-
- struct GetExtensionFromMimeType_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::String::LocalRef ReturnType;
- typedef mozilla::jni::String::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getExtensionFromMimeType";
- static constexpr char signature[] =
- "(Ljava/lang/String;)Ljava/lang/String;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetExtensionFromMimeType(mozilla::jni::String::Param) -> mozilla::jni::String::LocalRef;
-
- struct GetHWDecoderCapability_t {
- typedef GeckoAppShell Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getHWDecoderCapability";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetHWDecoderCapability() -> bool;
-
- struct GetHWEncoderCapability_t {
- typedef GeckoAppShell Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getHWEncoderCapability";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetHWEncoderCapability() -> bool;
-
- struct GetHandlersForMimeType_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::ObjectArray::LocalRef ReturnType;
- typedef mozilla::jni::ObjectArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getHandlersForMimeType";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetHandlersForMimeType(mozilla::jni::String::Param, mozilla::jni::String::Param) -> mozilla::jni::ObjectArray::LocalRef;
-
- struct GetHandlersForURL_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::ObjectArray::LocalRef ReturnType;
- typedef mozilla::jni::ObjectArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getHandlersForURL";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;)[Ljava/lang/String;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetHandlersForURL(mozilla::jni::String::Param, mozilla::jni::String::Param) -> mozilla::jni::ObjectArray::LocalRef;
-
- struct GetIconForExtension_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::ByteArray::LocalRef ReturnType;
- typedef mozilla::jni::ByteArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- int32_t> Args;
- static constexpr char name[] = "getIconForExtension";
- static constexpr char signature[] =
- "(Ljava/lang/String;I)[B";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetIconForExtension(mozilla::jni::String::Param, int32_t) -> mozilla::jni::ByteArray::LocalRef;
-
- struct GetMaxTouchPoints_t {
- typedef GeckoAppShell Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getMaxTouchPoints";
- static constexpr char signature[] =
- "()I";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetMaxTouchPoints() -> int32_t;
-
- struct GetMimeTypeFromExtensions_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::String::LocalRef ReturnType;
- typedef mozilla::jni::String::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getMimeTypeFromExtensions";
- static constexpr char signature[] =
- "(Ljava/lang/String;)Ljava/lang/String;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetMimeTypeFromExtensions(mozilla::jni::String::Param) -> mozilla::jni::String::LocalRef;
-
- struct GetNetworkLinkType_t {
- typedef GeckoAppShell Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getNetworkLinkType";
- static constexpr char signature[] =
- "()I";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetNetworkLinkType() -> int32_t;
-
- struct GetProxyForURI_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::String::LocalRef ReturnType;
- typedef mozilla::jni::String::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- int32_t> Args;
- static constexpr char name[] = "getProxyForURI";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;I)Ljava/lang/String;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetProxyForURI(mozilla::jni::String::Param, mozilla::jni::String::Param, mozilla::jni::String::Param, int32_t) -> mozilla::jni::String::LocalRef;
-
- struct GetScreenAngle_t {
- typedef GeckoAppShell Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getScreenAngle";
- static constexpr char signature[] =
- "()I";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetScreenAngle() -> int32_t;
-
- struct GetScreenDepth_t {
- typedef GeckoAppShell Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getScreenDepth";
- static constexpr char signature[] =
- "()I";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetScreenDepth() -> int32_t;
-
- struct GetScreenOrientation_t {
- typedef GeckoAppShell Owner;
- typedef int16_t ReturnType;
- typedef int16_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getScreenOrientation";
- static constexpr char signature[] =
- "()S";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetScreenOrientation() -> int16_t;
-
- struct GetScreenSize_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getScreenSize";
- static constexpr char signature[] =
- "()Landroid/graphics/Rect;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetScreenSize() -> mozilla::jni::Object::LocalRef;
-
- struct GetShowPasswordSetting_t {
- typedef GeckoAppShell Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getShowPasswordSetting";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetShowPasswordSetting() -> bool;
-
- struct GetSystemColors_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::IntArray::LocalRef ReturnType;
- typedef mozilla::jni::IntArray::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getSystemColors";
- static constexpr char signature[] =
- "()[I";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetSystemColors() -> mozilla::jni::IntArray::LocalRef;
-
- struct HandleGeckoMessage_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "handleGeckoMessage";
- static constexpr char signature[] =
- "(Lorg/mozilla/gecko/util/NativeJSContainer;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto HandleGeckoMessage(mozilla::jni::Object::Param) -> void;
-
- struct HandleUncaughtException_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Throwable::Param> Args;
- static constexpr char name[] = "handleUncaughtException";
- static constexpr char signature[] =
- "(Ljava/lang/Throwable;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::IGNORE;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto HandleUncaughtException(mozilla::jni::Throwable::Param) -> void;
-
- struct HideProgressDialog_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "hideProgressDialog";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto HideProgressDialog() -> void;
-
- struct InitCamera_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::IntArray::LocalRef ReturnType;
- typedef mozilla::jni::IntArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- int32_t,
- int32_t,
- int32_t> Args;
- static constexpr char name[] = "initCamera";
- static constexpr char signature[] =
- "(Ljava/lang/String;III)[I";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto InitCamera(mozilla::jni::String::Param, int32_t, int32_t, int32_t) -> mozilla::jni::IntArray::LocalRef;
-
- struct IsNetworkLinkKnown_t {
- typedef GeckoAppShell Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "isNetworkLinkKnown";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto IsNetworkLinkKnown() -> bool;
-
- struct IsNetworkLinkUp_t {
- typedef GeckoAppShell Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "isNetworkLinkUp";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto IsNetworkLinkUp() -> bool;
-
- struct IsTablet_t {
- typedef GeckoAppShell Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "isTablet";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto IsTablet() -> bool;
-
- struct KillAnyZombies_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "killAnyZombies";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto KillAnyZombies() -> void;
-
- struct LoadPluginClass_t {
- typedef GeckoAppShell Owner;
- typedef mozilla::jni::Class::LocalRef ReturnType;
- typedef mozilla::jni::Class::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "loadPluginClass";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/Class;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto LoadPluginClass(mozilla::jni::String::Param, mozilla::jni::String::Param) -> mozilla::jni::Class::LocalRef;
-
- struct LockScreenOrientation_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t> Args;
- static constexpr char name[] = "lockScreenOrientation";
- static constexpr char signature[] =
- "(I)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto LockScreenOrientation(int32_t) -> void;
-
- struct MarkURIVisited_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "markUriVisited";
- static constexpr char signature[] =
- "(Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto MarkURIVisited(mozilla::jni::String::Param) -> void;
-
- struct MoveTaskToBack_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "moveTaskToBack";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto MoveTaskToBack() -> void;
-
- struct NotifyObservers_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "nativeNotifyObservers";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct NotifyAlertListener_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "notifyAlertListener";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct NotifyUriVisited_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "notifyUriVisited";
- static constexpr char signature[] =
- "(Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct NotifyWakeLockChanged_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "notifyWakeLockChanged";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto NotifyWakeLockChanged(mozilla::jni::String::Param, mozilla::jni::String::Param) -> void;
-
- struct OnFullScreenPluginHidden_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "onFullScreenPluginHidden";
- static constexpr char signature[] =
- "(Landroid/view/View;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnLocationChanged_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- double,
- double,
- double,
- float,
- float,
- float,
- int64_t> Args;
- static constexpr char name[] = "onLocationChanged";
- static constexpr char signature[] =
- "(DDDFFFJ)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnSensorChanged_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- float,
- float,
- float,
- float,
- int32_t,
- int64_t> Args;
- static constexpr char name[] = "onSensorChanged";
- static constexpr char signature[] =
- "(IFFFFIJ)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OpenUriExternal_t {
- typedef GeckoAppShell Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "openUriExternal";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto OpenUriExternal(mozilla::jni::String::Param, mozilla::jni::String::Param, mozilla::jni::String::Param, mozilla::jni::String::Param, mozilla::jni::String::Param, mozilla::jni::String::Param) -> bool;
-
- struct OpenWindowForNotification_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "openWindowForNotification";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto OpenWindowForNotification() -> void;
-
- struct PerformHapticFeedback_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- bool> Args;
- static constexpr char name[] = "performHapticFeedback";
- static constexpr char signature[] =
- "(Z)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto PerformHapticFeedback(bool) -> void;
-
- struct RemoveFullScreenPluginView_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "removeFullScreenPluginView";
- static constexpr char signature[] =
- "(Landroid/view/View;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto RemoveFullScreenPluginView(mozilla::jni::Object::Param) -> void;
-
- struct ReportJavaCrash_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Throwable::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "reportJavaCrash";
- static constexpr char signature[] =
- "(Ljava/lang/Throwable;Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct ScheduleRestart_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "scheduleRestart";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto ScheduleRestart() -> void;
-
- struct SetAlarm_t {
- typedef GeckoAppShell Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t> Args;
- static constexpr char name[] = "setAlarm";
- static constexpr char signature[] =
- "(II)Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto SetAlarm(int32_t, int32_t) -> bool;
-
- struct SetFullScreen_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- bool> Args;
- static constexpr char name[] = "setFullScreen";
- static constexpr char signature[] =
- "(Z)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto SetFullScreen(bool) -> void;
-
- struct SetKeepScreenOn_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- bool> Args;
- static constexpr char name[] = "setKeepScreenOn";
- static constexpr char signature[] =
- "(Z)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto SetKeepScreenOn(bool) -> void;
-
- struct SetScreenDepthOverride_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t> Args;
- static constexpr char name[] = "setScreenDepthOverride";
- static constexpr char signature[] =
- "(I)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto SetScreenDepthOverride(int32_t) -> void;
-
- struct SetURITitle_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "setUriTitle";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto SetURITitle(mozilla::jni::String::Param, mozilla::jni::String::Param) -> void;
-
- struct ShowNotification_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "showNotification";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto ShowNotification(mozilla::jni::String::Param, mozilla::jni::String::Param, mozilla::jni::String::Param, mozilla::jni::String::Param, mozilla::jni::String::Param, mozilla::jni::String::Param, mozilla::jni::String::Param) -> void;
-
- struct SyncNotifyObservers_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "syncNotifyObservers";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct UnlockProfile_t {
- typedef GeckoAppShell Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "unlockProfile";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto UnlockProfile() -> bool;
-
- struct UnlockScreenOrientation_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "unlockScreenOrientation";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto UnlockScreenOrientation() -> void;
-
- struct Vibrate_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int64_t> Args;
- static constexpr char name[] = "vibrate";
- static constexpr char signature[] =
- "(J)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto Vibrate(int64_t) -> void;
-
- struct Vibrate2_t {
- typedef GeckoAppShell Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::LongArray::Param,
- int32_t> Args;
- static constexpr char name[] = "vibrate";
- static constexpr char signature[] =
- "([JI)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto Vibrate(mozilla::jni::LongArray::Param, int32_t) -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class GeckoAppShell::CameraCallback : public mozilla::jni::ObjectBase<CameraCallback>
-{
-public:
- static const char name[];
-
- explicit CameraCallback(const Context& ctx) : ObjectBase<CameraCallback>(ctx) {}
-
- struct OnFrameData_t {
- typedef CameraCallback Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- mozilla::jni::ByteArray::Param> Args;
- static constexpr char name[] = "onFrameData";
- static constexpr char signature[] =
- "(I[B)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
-
- template<class Impl> class Natives;
-};
-
-class GeckoBatteryManager : public mozilla::jni::ObjectBase<GeckoBatteryManager>
-{
-public:
- static const char name[];
-
- explicit GeckoBatteryManager(const Context& ctx) : ObjectBase<GeckoBatteryManager>(ctx) {}
-
- struct OnBatteryChange_t {
- typedef GeckoBatteryManager Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- double,
- bool,
- double> Args;
- static constexpr char name[] = "onBatteryChange";
- static constexpr char signature[] =
- "(DZD)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
-
- template<class Impl> class Natives;
-};
-
-class GeckoEditable : public mozilla::jni::ObjectBase<GeckoEditable>
-{
-public:
- static const char name[];
-
- explicit GeckoEditable(const Context& ctx) : ObjectBase<GeckoEditable>(ctx) {}
-
- struct New_t {
- typedef GeckoEditable Owner;
- typedef GeckoEditable::LocalRef ReturnType;
- typedef GeckoEditable::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "<init>";
- static constexpr char signature[] =
- "(Lorg/mozilla/gecko/GeckoView;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto New(mozilla::jni::Object::Param) -> GeckoEditable::LocalRef;
-
- struct DisposeNative_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "disposeNative";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- struct NotifyIME_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t> Args;
- static constexpr char name[] = "notifyIME";
- static constexpr char signature[] =
- "(I)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto NotifyIME(int32_t) const -> void;
-
- struct NotifyIMEContext_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "notifyIMEContext";
- static constexpr char signature[] =
- "(ILjava/lang/String;Ljava/lang/String;Ljava/lang/String;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto NotifyIMEContext(int32_t, mozilla::jni::String::Param, mozilla::jni::String::Param, mozilla::jni::String::Param) const -> void;
-
- struct OnDefaultKeyEvent_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "onDefaultKeyEvent";
- static constexpr char signature[] =
- "(Landroid/view/KeyEvent;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto OnDefaultKeyEvent(mozilla::jni::Object::Param) const -> void;
-
- struct OnImeAddCompositionRange_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- bool,
- int32_t,
- int32_t,
- int32_t> Args;
- static constexpr char name[] = "onImeAddCompositionRange";
- static constexpr char signature[] =
- "(IIIIIZIII)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- struct OnImeReplaceText_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "onImeReplaceText";
- static constexpr char signature[] =
- "(IILjava/lang/String;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- struct OnImeRequestCursorUpdates_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t> Args;
- static constexpr char name[] = "onImeRequestCursorUpdates";
- static constexpr char signature[] =
- "(I)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- struct OnImeSynchronize_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "onImeSynchronize";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- struct OnImeUpdateComposition_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t> Args;
- static constexpr char name[] = "onImeUpdateComposition";
- static constexpr char signature[] =
- "(II)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- struct OnKeyEvent_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int64_t,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- bool,
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "onKeyEvent";
- static constexpr char signature[] =
- "(IIIIJIIIIIZLandroid/view/KeyEvent;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- struct OnSelectionChange_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t> Args;
- static constexpr char name[] = "onSelectionChange";
- static constexpr char signature[] =
- "(II)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::IGNORE;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto OnSelectionChange(int32_t, int32_t) const -> void;
-
- struct OnTextChange_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- int32_t,
- int32_t,
- int32_t> Args;
- static constexpr char name[] = "onTextChange";
- static constexpr char signature[] =
- "(Ljava/lang/CharSequence;III)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::IGNORE;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto OnTextChange(mozilla::jni::String::Param, int32_t, int32_t, int32_t) const -> void;
-
- struct OnViewChange_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "onViewChange";
- static constexpr char signature[] =
- "(Lorg/mozilla/gecko/GeckoView;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto OnViewChange(mozilla::jni::Object::Param) const -> void;
-
- struct UpdateCompositionRects_t {
- typedef GeckoEditable Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ObjectArray::Param> Args;
- static constexpr char name[] = "updateCompositionRects";
- static constexpr char signature[] =
- "([Landroid/graphics/RectF;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto UpdateCompositionRects(mozilla::jni::ObjectArray::Param) const -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class GeckoEditableListener : public mozilla::jni::ObjectBase<GeckoEditableListener>
-{
-public:
- static const char name[];
-
- explicit GeckoEditableListener(const Context& ctx) : ObjectBase<GeckoEditableListener>(ctx) {}
-
- static const int32_t NOTIFY_IME_OF_BLUR = 2;
-
- static const int32_t NOTIFY_IME_OF_FOCUS = 1;
-
- static const int32_t NOTIFY_IME_OPEN_VKB = -2;
-
- static const int32_t NOTIFY_IME_REPLY_EVENT = -1;
-
- static const int32_t NOTIFY_IME_TO_CANCEL_COMPOSITION = 9;
-
- static const int32_t NOTIFY_IME_TO_COMMIT_COMPOSITION = 8;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class GeckoNetworkManager : public mozilla::jni::ObjectBase<GeckoNetworkManager>
-{
-public:
- static const char name[];
-
- explicit GeckoNetworkManager(const Context& ctx) : ObjectBase<GeckoNetworkManager>(ctx) {}
-
- struct OnConnectionChanged_t {
- typedef GeckoNetworkManager Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- mozilla::jni::String::Param,
- bool,
- int32_t> Args;
- static constexpr char name[] = "onConnectionChanged";
- static constexpr char signature[] =
- "(ILjava/lang/String;ZI)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnStatusChanged_t {
- typedef GeckoNetworkManager Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "onStatusChanged";
- static constexpr char signature[] =
- "(Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class GeckoScreenOrientation : public mozilla::jni::ObjectBase<GeckoScreenOrientation>
-{
-public:
- static const char name[];
-
- explicit GeckoScreenOrientation(const Context& ctx) : ObjectBase<GeckoScreenOrientation>(ctx) {}
-
- struct OnOrientationChange_t {
- typedef GeckoScreenOrientation Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int16_t,
- int16_t> Args;
- static constexpr char name[] = "onOrientationChange";
- static constexpr char signature[] =
- "(SS)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class GeckoThread : public mozilla::jni::ObjectBase<GeckoThread>
-{
-public:
- static const char name[];
-
- explicit GeckoThread(const Context& ctx) : ObjectBase<GeckoThread>(ctx) {}
-
- class State;
-
- struct CheckAndSetState_t {
- typedef GeckoThread Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param,
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "checkAndSetState";
- static constexpr char signature[] =
- "(Lorg/mozilla/gecko/GeckoThread$State;Lorg/mozilla/gecko/GeckoThread$State;)Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto CheckAndSetState(mozilla::jni::Object::Param, mozilla::jni::Object::Param) -> bool;
-
- struct CreateServices_t {
- typedef GeckoThread Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "nativeCreateServices";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnPause_t {
- typedef GeckoThread Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "nativeOnPause";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnResume_t {
- typedef GeckoThread Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "nativeOnResume";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct PumpMessageLoop_t {
- typedef GeckoThread Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "pumpMessageLoop";
- static constexpr char signature[] =
- "(Landroid/os/Message;)Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto PumpMessageLoop(mozilla::jni::Object::Param) -> bool;
-
- struct RequestUiThreadCallback_t {
- typedef GeckoThread Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int64_t> Args;
- static constexpr char name[] = "requestUiThreadCallback";
- static constexpr char signature[] =
- "(J)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto RequestUiThreadCallback(int64_t) -> void;
-
- struct RunUiThreadCallback_t {
- typedef GeckoThread Owner;
- typedef int64_t ReturnType;
- typedef int64_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "runUiThreadCallback";
- static constexpr char signature[] =
- "()J";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct SetState_t {
- typedef GeckoThread Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "setState";
- static constexpr char signature[] =
- "(Lorg/mozilla/gecko/GeckoThread$State;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto SetState(mozilla::jni::Object::Param) -> void;
-
- struct SpeculativeConnect_t {
- typedef GeckoThread Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "speculativeConnectNative";
- static constexpr char signature[] =
- "(Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct WaitOnGecko_t {
- typedef GeckoThread Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "waitOnGecko";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct ClsLoader_t {
- typedef GeckoThread Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "clsLoader";
- static constexpr char signature[] =
- "Ljava/lang/ClassLoader;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto ClsLoader() -> mozilla::jni::Object::LocalRef;
-
- struct MsgQueue_t {
- typedef GeckoThread Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "msgQueue";
- static constexpr char signature[] =
- "Landroid/os/MessageQueue;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto MsgQueue() -> mozilla::jni::Object::LocalRef;
-
- static auto MsgQueue(mozilla::jni::Object::Param) -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class GeckoThread::State : public mozilla::jni::ObjectBase<State>
-{
-public:
- static const char name[];
-
- explicit State(const Context& ctx) : ObjectBase<State>(ctx) {}
-
- struct EXITED_t {
- typedef State Owner;
- typedef State::LocalRef ReturnType;
- typedef State::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "EXITED";
- static constexpr char signature[] =
- "Lorg/mozilla/gecko/GeckoThread$State;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto EXITED() -> State::LocalRef;
-
- struct EXITING_t {
- typedef State Owner;
- typedef State::LocalRef ReturnType;
- typedef State::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "EXITING";
- static constexpr char signature[] =
- "Lorg/mozilla/gecko/GeckoThread$State;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto EXITING() -> State::LocalRef;
-
- struct INITIAL_t {
- typedef State Owner;
- typedef State::LocalRef ReturnType;
- typedef State::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "INITIAL";
- static constexpr char signature[] =
- "Lorg/mozilla/gecko/GeckoThread$State;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto INITIAL() -> State::LocalRef;
-
- struct JNI_READY_t {
- typedef State Owner;
- typedef State::LocalRef ReturnType;
- typedef State::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "JNI_READY";
- static constexpr char signature[] =
- "Lorg/mozilla/gecko/GeckoThread$State;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto JNI_READY() -> State::LocalRef;
-
- struct LAUNCHED_t {
- typedef State Owner;
- typedef State::LocalRef ReturnType;
- typedef State::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "LAUNCHED";
- static constexpr char signature[] =
- "Lorg/mozilla/gecko/GeckoThread$State;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto LAUNCHED() -> State::LocalRef;
-
- struct LIBS_READY_t {
- typedef State Owner;
- typedef State::LocalRef ReturnType;
- typedef State::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "LIBS_READY";
- static constexpr char signature[] =
- "Lorg/mozilla/gecko/GeckoThread$State;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto LIBS_READY() -> State::LocalRef;
-
- struct MOZGLUE_READY_t {
- typedef State Owner;
- typedef State::LocalRef ReturnType;
- typedef State::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "MOZGLUE_READY";
- static constexpr char signature[] =
- "Lorg/mozilla/gecko/GeckoThread$State;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto MOZGLUE_READY() -> State::LocalRef;
-
- struct PROFILE_READY_t {
- typedef State Owner;
- typedef State::LocalRef ReturnType;
- typedef State::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "PROFILE_READY";
- static constexpr char signature[] =
- "Lorg/mozilla/gecko/GeckoThread$State;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto PROFILE_READY() -> State::LocalRef;
-
- struct RUNNING_t {
- typedef State Owner;
- typedef State::LocalRef ReturnType;
- typedef State::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "RUNNING";
- static constexpr char signature[] =
- "Lorg/mozilla/gecko/GeckoThread$State;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto RUNNING() -> State::LocalRef;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class GeckoView : public mozilla::jni::ObjectBase<GeckoView>
-{
-public:
- static const char name[];
-
- explicit GeckoView(const Context& ctx) : ObjectBase<GeckoView>(ctx) {}
-
- class Window;
-
- static const int32_t LOAD_DEFAULT = 0;
-
- static const int32_t LOAD_NEW_TAB = 1;
-
- static const int32_t LOAD_SWITCH_TAB = 2;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class GeckoView::Window : public mozilla::jni::ObjectBase<Window>
-{
-public:
- static const char name[];
-
- explicit Window(const Context& ctx) : ObjectBase<Window>(ctx) {}
-
- struct Close_t {
- typedef Window Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "close";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- struct DisposeNative_t {
- typedef Window Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "disposeNative";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- struct LoadUri_t {
- typedef Window Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- int32_t> Args;
- static constexpr char name[] = "loadUri";
- static constexpr char signature[] =
- "(Ljava/lang/String;I)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- struct Open_t {
- typedef Window Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- Window::Param,
- GeckoView::Param,
- mozilla::jni::Object::Param,
- mozilla::jni::String::Param,
- int32_t> Args;
- static constexpr char name[] = "open";
- static constexpr char signature[] =
- "(Lorg/mozilla/gecko/GeckoView$Window;Lorg/mozilla/gecko/GeckoView;Ljava/lang/Object;Ljava/lang/String;I)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- struct Reattach_t {
- typedef Window Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- GeckoView::Param,
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "reattach";
- static constexpr char signature[] =
- "(Lorg/mozilla/gecko/GeckoView;Ljava/lang/Object;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class PrefsHelper : public mozilla::jni::ObjectBase<PrefsHelper>
-{
-public:
- static const char name[];
-
- explicit PrefsHelper(const Context& ctx) : ObjectBase<PrefsHelper>(ctx) {}
-
- struct CallPrefHandler_t {
- typedef PrefsHelper Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param,
- int32_t,
- mozilla::jni::String::Param,
- bool,
- int32_t,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "callPrefHandler";
- static constexpr char signature[] =
- "(Lorg/mozilla/gecko/PrefsHelper$PrefHandler;ILjava/lang/String;ZILjava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto CallPrefHandler(mozilla::jni::Object::Param, int32_t, mozilla::jni::String::Param, bool, int32_t, mozilla::jni::String::Param) -> void;
-
- struct AddObserver_t {
- typedef PrefsHelper Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ObjectArray::Param,
- mozilla::jni::Object::Param,
- mozilla::jni::ObjectArray::Param> Args;
- static constexpr char name[] = "nativeAddObserver";
- static constexpr char signature[] =
- "([Ljava/lang/String;Lorg/mozilla/gecko/PrefsHelper$PrefHandler;[Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct GetPrefs_t {
- typedef PrefsHelper Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ObjectArray::Param,
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "nativeGetPrefs";
- static constexpr char signature[] =
- "([Ljava/lang/String;Lorg/mozilla/gecko/PrefsHelper$PrefHandler;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct RemoveObserver_t {
- typedef PrefsHelper Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ObjectArray::Param> Args;
- static constexpr char name[] = "nativeRemoveObserver";
- static constexpr char signature[] =
- "([Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct SetPref_t {
- typedef PrefsHelper Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- bool,
- int32_t,
- bool,
- int32_t,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "nativeSetPref";
- static constexpr char signature[] =
- "(Ljava/lang/String;ZIZILjava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnPrefChange_t {
- typedef PrefsHelper Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- int32_t,
- bool,
- int32_t,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "onPrefChange";
- static constexpr char signature[] =
- "(Ljava/lang/String;IZILjava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto OnPrefChange(mozilla::jni::String::Param, int32_t, bool, int32_t, mozilla::jni::String::Param) -> void;
-
- static const int32_t PREF_BOOL = 1;
-
- static const int32_t PREF_FINISH = 0;
-
- static const int32_t PREF_INT = 2;
-
- static const int32_t PREF_INVALID = -1;
-
- static const int32_t PREF_STRING = 3;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class SurfaceTextureListener : public mozilla::jni::ObjectBase<SurfaceTextureListener>
-{
-public:
- static const char name[];
-
- explicit SurfaceTextureListener(const Context& ctx) : ObjectBase<SurfaceTextureListener>(ctx) {}
-
- struct New_t {
- typedef SurfaceTextureListener Owner;
- typedef SurfaceTextureListener::LocalRef ReturnType;
- typedef SurfaceTextureListener::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "<init>";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto New() -> SurfaceTextureListener::LocalRef;
-
- struct OnFrameAvailable_t {
- typedef SurfaceTextureListener Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "nativeOnFrameAvailable";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class GeckoLayerClient : public mozilla::jni::ObjectBase<GeckoLayerClient>
-{
-public:
- static const char name[];
-
- explicit GeckoLayerClient(const Context& ctx) : ObjectBase<GeckoLayerClient>(ctx) {}
-
- struct ContentDocumentChanged_t {
- typedef GeckoLayerClient Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "contentDocumentChanged";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto ContentDocumentChanged() const -> void;
-
- struct CreateFrame_t {
- typedef GeckoLayerClient Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "createFrame";
- static constexpr char signature[] =
- "()Lorg/mozilla/gecko/gfx/LayerRenderer$Frame;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto CreateFrame() const -> mozilla::jni::Object::LocalRef;
-
- struct IsContentDocumentDisplayed_t {
- typedef GeckoLayerClient Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "isContentDocumentDisplayed";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto IsContentDocumentDisplayed() const -> bool;
-
- struct OnGeckoReady_t {
- typedef GeckoLayerClient Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "onGeckoReady";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto OnGeckoReady() const -> void;
-
- struct SetFirstPaintViewport_t {
- typedef GeckoLayerClient Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- float,
- float,
- float,
- float,
- float,
- float,
- float> Args;
- static constexpr char name[] = "setFirstPaintViewport";
- static constexpr char signature[] =
- "(FFFFFFF)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto SetFirstPaintViewport(float, float, float, float, float, float, float) const -> void;
-
- struct SyncFrameMetrics_t {
- typedef GeckoLayerClient Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<
- float,
- float,
- float,
- float,
- float,
- float,
- float,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- float,
- bool,
- int32_t> Args;
- static constexpr char name[] = "syncFrameMetrics";
- static constexpr char signature[] =
- "(FFFFFFFIIIIFZI)Lorg/mozilla/gecko/gfx/ViewTransform;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto SyncFrameMetrics(float, float, float, float, float, float, float, int32_t, int32_t, int32_t, int32_t, float, bool, int32_t) const -> mozilla::jni::Object::LocalRef;
-
- struct SynthesizeNativeMouseEvent_t {
- typedef GeckoLayerClient Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- int32_t> Args;
- static constexpr char name[] = "synthesizeNativeMouseEvent";
- static constexpr char signature[] =
- "(III)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto SynthesizeNativeMouseEvent(int32_t, int32_t, int32_t) const -> void;
-
- struct SynthesizeNativeTouchPoint_t {
- typedef GeckoLayerClient Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- double,
- int32_t> Args;
- static constexpr char name[] = "synthesizeNativeTouchPoint";
- static constexpr char signature[] =
- "(IIIIDI)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto SynthesizeNativeTouchPoint(int32_t, int32_t, int32_t, int32_t, double, int32_t) const -> void;
-
- struct ClearColor_t {
- typedef GeckoLayerClient Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "mClearColor";
- static constexpr char signature[] =
- "I";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto ClearColor() const -> int32_t;
-
- auto ClearColor(int32_t) const -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class ImmutableViewportMetrics : public mozilla::jni::ObjectBase<ImmutableViewportMetrics>
-{
-public:
- static const char name[];
-
- explicit ImmutableViewportMetrics(const Context& ctx) : ObjectBase<ImmutableViewportMetrics>(ctx) {}
-
- struct New_t {
- typedef ImmutableViewportMetrics Owner;
- typedef ImmutableViewportMetrics::LocalRef ReturnType;
- typedef ImmutableViewportMetrics::Param SetterType;
- typedef mozilla::jni::Args<
- float,
- float,
- float,
- float,
- float,
- float,
- float,
- float,
- float,
- float,
- int32_t,
- int32_t,
- float> Args;
- static constexpr char name[] = "<init>";
- static constexpr char signature[] =
- "(FFFFFFFFFFIIF)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto New(float, float, float, float, float, float, float, float, float, float, int32_t, int32_t, float) -> ImmutableViewportMetrics::LocalRef;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
-
-};
-
-class LayerRenderer : public mozilla::jni::ObjectBase<LayerRenderer>
-{
-public:
- static const char name[];
-
- explicit LayerRenderer(const Context& ctx) : ObjectBase<LayerRenderer>(ctx) {}
-
- class Frame;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class LayerRenderer::Frame : public mozilla::jni::ObjectBase<Frame>
-{
-public:
- static const char name[];
-
- explicit Frame(const Context& ctx) : ObjectBase<Frame>(ctx) {}
-
- struct BeginDrawing_t {
- typedef Frame Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "beginDrawing";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto BeginDrawing() const -> void;
-
- struct EndDrawing_t {
- typedef Frame Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "endDrawing";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto EndDrawing() const -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class LayerView : public mozilla::jni::ObjectBase<LayerView>
-{
-public:
- static const char name[];
-
- explicit LayerView(const Context& ctx) : ObjectBase<LayerView>(ctx) {}
-
- class Compositor;
-
- struct GetCompositor_t {
- typedef LayerView Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getCompositor";
- static constexpr char signature[] =
- "()Ljava/lang/Object;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto GetCompositor() const -> mozilla::jni::Object::LocalRef;
-
- struct UpdateZoomedView_t {
- typedef LayerView Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ByteBuffer::Param> Args;
- static constexpr char name[] = "updateZoomedView";
- static constexpr char signature[] =
- "(Ljava/nio/ByteBuffer;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto UpdateZoomedView(mozilla::jni::ByteBuffer::Param) -> void;
-
- struct CompositorCreated_t {
- typedef LayerView Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "mCompositorCreated";
- static constexpr char signature[] =
- "Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto CompositorCreated() const -> bool;
-
- auto CompositorCreated(bool) const -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class LayerView::Compositor : public mozilla::jni::ObjectBase<Compositor>
-{
-public:
- static const char name[];
-
- explicit Compositor(const Context& ctx) : ObjectBase<Compositor>(ctx) {}
-
- struct AttachToJava_t {
- typedef Compositor Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param,
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "attachToJava";
- static constexpr char signature[] =
- "(Lorg/mozilla/gecko/gfx/GeckoLayerClient;Lorg/mozilla/gecko/gfx/NativePanZoomController;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct CreateCompositor_t {
- typedef Compositor Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "createCompositor";
- static constexpr char signature[] =
- "(IILjava/lang/Object;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- struct Destroy_t {
- typedef Compositor Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "destroy";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Destroy() const -> void;
-
- struct DisposeNative_t {
- typedef Compositor Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "disposeNative";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnSizeChanged_t {
- typedef Compositor Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- int32_t,
- int32_t> Args;
- static constexpr char name[] = "onSizeChanged";
- static constexpr char signature[] =
- "(IIII)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct Reattach_t {
- typedef Compositor Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "reattach";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Reattach() const -> void;
-
- struct SyncInvalidateAndScheduleComposite_t {
- typedef Compositor Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "syncInvalidateAndScheduleComposite";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct SyncPauseCompositor_t {
- typedef Compositor Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "syncPauseCompositor";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct SyncResumeResizeCompositor_t {
- typedef Compositor Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "syncResumeResizeCompositor";
- static constexpr char signature[] =
- "(IILjava/lang/Object;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class NativePanZoomController : public mozilla::jni::ObjectBase<NativePanZoomController>
-{
-public:
- static const char name[];
-
- explicit NativePanZoomController(const Context& ctx) : ObjectBase<NativePanZoomController>(ctx) {}
-
- struct AdjustScrollForSurfaceShift_t {
- typedef NativePanZoomController Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- float,
- float> Args;
- static constexpr char name[] = "adjustScrollForSurfaceShift";
- static constexpr char signature[] =
- "(FF)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct Destroy_t {
- typedef NativePanZoomController Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "destroy";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Destroy() const -> void;
-
- struct DisposeNative_t {
- typedef NativePanZoomController Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "disposeNative";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct HandleMotionEvent_t {
- typedef NativePanZoomController Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- int64_t,
- int32_t,
- mozilla::jni::IntArray::Param,
- mozilla::jni::FloatArray::Param,
- mozilla::jni::FloatArray::Param,
- mozilla::jni::FloatArray::Param,
- mozilla::jni::FloatArray::Param,
- mozilla::jni::FloatArray::Param,
- mozilla::jni::FloatArray::Param> Args;
- static constexpr char name[] = "handleMotionEvent";
- static constexpr char signature[] =
- "(IIJI[I[F[F[F[F[F[F)Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct HandleMotionEventVelocity_t {
- typedef NativePanZoomController Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int64_t,
- float> Args;
- static constexpr char name[] = "handleMotionEventVelocity";
- static constexpr char signature[] =
- "(JF)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct HandleMouseEvent_t {
- typedef NativePanZoomController Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int64_t,
- int32_t,
- float,
- float,
- int32_t> Args;
- static constexpr char name[] = "handleMouseEvent";
- static constexpr char signature[] =
- "(IJIFFI)Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct HandleScrollEvent_t {
- typedef NativePanZoomController Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- int64_t,
- int32_t,
- float,
- float,
- float,
- float> Args;
- static constexpr char name[] = "handleScrollEvent";
- static constexpr char signature[] =
- "(JIFFFF)Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct SetIsLongpressEnabled_t {
- typedef NativePanZoomController Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- bool> Args;
- static constexpr char name[] = "nativeSetIsLongpressEnabled";
- static constexpr char signature[] =
- "(Z)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OnSelectionDragState_t {
- typedef NativePanZoomController Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- bool> Args;
- static constexpr char name[] = "onSelectionDragState";
- static constexpr char signature[] =
- "(Z)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto OnSelectionDragState(bool) const -> void;
-
- struct SetScrollingRootContent_t {
- typedef NativePanZoomController Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- bool> Args;
- static constexpr char name[] = "setScrollingRootContent";
- static constexpr char signature[] =
- "(Z)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto SetScrollingRootContent(bool) const -> void;
-
- struct UpdateOverscrollOffset_t {
- typedef NativePanZoomController Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- float,
- float> Args;
- static constexpr char name[] = "updateOverscrollOffset";
- static constexpr char signature[] =
- "(FF)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto UpdateOverscrollOffset(float, float) const -> void;
-
- struct UpdateOverscrollVelocity_t {
- typedef NativePanZoomController Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- float,
- float> Args;
- static constexpr char name[] = "updateOverscrollVelocity";
- static constexpr char signature[] =
- "(FF)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto UpdateOverscrollVelocity(float, float) const -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class ProgressiveUpdateData : public mozilla::jni::ObjectBase<ProgressiveUpdateData>
-{
-public:
- static const char name[];
-
- explicit ProgressiveUpdateData(const Context& ctx) : ObjectBase<ProgressiveUpdateData>(ctx) {}
-
- struct New_t {
- typedef ProgressiveUpdateData Owner;
- typedef ProgressiveUpdateData::LocalRef ReturnType;
- typedef ProgressiveUpdateData::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "<init>";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto New() -> ProgressiveUpdateData::LocalRef;
-
- struct SetViewport_t {
- typedef ProgressiveUpdateData Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "setViewport";
- static constexpr char signature[] =
- "(Lorg/mozilla/gecko/gfx/ImmutableViewportMetrics;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto SetViewport(mozilla::jni::Object::Param) const -> void;
-
- struct Abort_t {
- typedef ProgressiveUpdateData Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "abort";
- static constexpr char signature[] =
- "Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Abort() const -> bool;
-
- auto Abort(bool) const -> void;
-
- struct Scale_t {
- typedef ProgressiveUpdateData Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "scale";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Scale() const -> float;
-
- auto Scale(float) const -> void;
-
- struct X_t {
- typedef ProgressiveUpdateData Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "x";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto X() const -> float;
-
- auto X(float) const -> void;
-
- struct Y_t {
- typedef ProgressiveUpdateData Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "y";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Y() const -> float;
-
- auto Y(float) const -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class StackScroller : public mozilla::jni::ObjectBase<StackScroller>
-{
-public:
- static const char name[];
-
- explicit StackScroller(const Context& ctx) : ObjectBase<StackScroller>(ctx) {}
-
- struct New_t {
- typedef StackScroller Owner;
- typedef StackScroller::LocalRef ReturnType;
- typedef StackScroller::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "<init>";
- static constexpr char signature[] =
- "(Landroid/content/Context;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto New(mozilla::jni::Object::Param, StackScroller::LocalRef*) -> nsresult;
-
- struct AbortAnimation_t {
- typedef StackScroller Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "abortAnimation";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto AbortAnimation() const -> nsresult;
-
- struct ComputeScrollOffset_t {
- typedef StackScroller Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- int64_t> Args;
- static constexpr char name[] = "computeScrollOffset";
- static constexpr char signature[] =
- "(J)Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto ComputeScrollOffset(int64_t, bool*) const -> nsresult;
-
- struct Fling_t {
- typedef StackScroller Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int64_t> Args;
- static constexpr char name[] = "fling";
- static constexpr char signature[] =
- "(IIIIIIIIIIJ)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Fling(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int64_t) const -> nsresult;
-
- struct ForceFinished_t {
- typedef StackScroller Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- bool> Args;
- static constexpr char name[] = "forceFinished";
- static constexpr char signature[] =
- "(Z)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto ForceFinished(bool) const -> nsresult;
-
- struct GetCurrSpeedX_t {
- typedef StackScroller Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getCurrSpeedX";
- static constexpr char signature[] =
- "()F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto GetCurrSpeedX(float*) const -> nsresult;
-
- struct GetCurrSpeedY_t {
- typedef StackScroller Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getCurrSpeedY";
- static constexpr char signature[] =
- "()F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto GetCurrSpeedY(float*) const -> nsresult;
-
- struct GetCurrX_t {
- typedef StackScroller Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getCurrX";
- static constexpr char signature[] =
- "()I";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto GetCurrX(int32_t*) const -> nsresult;
-
- struct GetCurrY_t {
- typedef StackScroller Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getCurrY";
- static constexpr char signature[] =
- "()I";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto GetCurrY(int32_t*) const -> nsresult;
-
- struct GetFinalX_t {
- typedef StackScroller Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getFinalX";
- static constexpr char signature[] =
- "()I";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto GetFinalX(int32_t*) const -> nsresult;
-
- struct GetFinalY_t {
- typedef StackScroller Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getFinalY";
- static constexpr char signature[] =
- "()I";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto GetFinalY(int32_t*) const -> nsresult;
-
- struct InitContants_t {
- typedef StackScroller Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "initContants";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto InitContants() -> nsresult;
-
- struct IsFinished_t {
- typedef StackScroller Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "isFinished";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto IsFinished(bool*) const -> nsresult;
-
- struct SetFinalX_t {
- typedef StackScroller Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t> Args;
- static constexpr char name[] = "setFinalX";
- static constexpr char signature[] =
- "(I)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto SetFinalX(int32_t) const -> nsresult;
-
- struct SpringBack_t {
- typedef StackScroller Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int64_t> Args;
- static constexpr char name[] = "springBack";
- static constexpr char signature[] =
- "(IIIIIIJ)Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto SpringBack(int32_t, int32_t, int32_t, int32_t, int32_t, int32_t, int64_t, bool*) const -> nsresult;
-
- struct StartScroll_t {
- typedef StackScroller Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int64_t,
- int32_t> Args;
- static constexpr char name[] = "startScroll";
- static constexpr char signature[] =
- "(IIIIJI)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto StartScroll(int32_t, int32_t, int32_t, int32_t, int64_t, int32_t) const -> nsresult;
-
- struct ViscousFluid_t {
- typedef StackScroller Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<
- float> Args;
- static constexpr char name[] = "viscousFluid";
- static constexpr char signature[] =
- "(F)F";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto ViscousFluid(float, float*) -> nsresult;
-
- static const int32_t FLING_MODE = 1;
-
- static const int32_t SCROLL_MODE = 0;
-
- struct MFlywheel_t {
- typedef StackScroller Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "mFlywheel";
- static constexpr char signature[] =
- "Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto MFlywheel(bool*) const -> nsresult;
-
- struct MMode_t {
- typedef StackScroller Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "mMode";
- static constexpr char signature[] =
- "I";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto MMode(int32_t*) const -> nsresult;
-
- auto MMode(int32_t) const -> nsresult;
-
- struct MScrollerX_t {
- typedef StackScroller Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "mScrollerX";
- static constexpr char signature[] =
- "Lorg/mozilla/gecko/gfx/StackScroller$SplineStackScroller;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto MScrollerX(mozilla::jni::Object::LocalRef*) const -> nsresult;
-
- struct MScrollerY_t {
- typedef StackScroller Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "mScrollerY";
- static constexpr char signature[] =
- "Lorg/mozilla/gecko/gfx/StackScroller$SplineStackScroller;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto MScrollerY(mozilla::jni::Object::LocalRef*) const -> nsresult;
-
- struct SViscousFluidNormalize_t {
- typedef StackScroller Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "sViscousFluidNormalize";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto SViscousFluidNormalize(float*) -> nsresult;
-
- static auto SViscousFluidNormalize(float) -> nsresult;
-
- struct SViscousFluidScale_t {
- typedef StackScroller Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "sViscousFluidScale";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::NSRESULT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto SViscousFluidScale(float*) -> nsresult;
-
- static auto SViscousFluidScale(float) -> nsresult;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class ViewTransform : public mozilla::jni::ObjectBase<ViewTransform>
-{
-public:
- static const char name[];
-
- explicit ViewTransform(const Context& ctx) : ObjectBase<ViewTransform>(ctx) {}
-
- struct New_t {
- typedef ViewTransform Owner;
- typedef ViewTransform::LocalRef ReturnType;
- typedef ViewTransform::Param SetterType;
- typedef mozilla::jni::Args<
- float,
- float,
- float> Args;
- static constexpr char name[] = "<init>";
- static constexpr char signature[] =
- "(FFF)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto New(float, float, float) -> ViewTransform::LocalRef;
-
- struct FixedLayerMarginBottom_t {
- typedef ViewTransform Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "fixedLayerMarginBottom";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto FixedLayerMarginBottom() const -> float;
-
- auto FixedLayerMarginBottom(float) const -> void;
-
- struct FixedLayerMarginLeft_t {
- typedef ViewTransform Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "fixedLayerMarginLeft";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto FixedLayerMarginLeft() const -> float;
-
- auto FixedLayerMarginLeft(float) const -> void;
-
- struct FixedLayerMarginRight_t {
- typedef ViewTransform Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "fixedLayerMarginRight";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto FixedLayerMarginRight() const -> float;
-
- auto FixedLayerMarginRight(float) const -> void;
-
- struct FixedLayerMarginTop_t {
- typedef ViewTransform Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "fixedLayerMarginTop";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto FixedLayerMarginTop() const -> float;
-
- auto FixedLayerMarginTop(float) const -> void;
-
- struct Height_t {
- typedef ViewTransform Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "height";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Height() const -> float;
-
- auto Height(float) const -> void;
-
- struct Scale_t {
- typedef ViewTransform Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "scale";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Scale() const -> float;
-
- auto Scale(float) const -> void;
-
- struct Width_t {
- typedef ViewTransform Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "width";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Width() const -> float;
-
- auto Width(float) const -> void;
-
- struct X_t {
- typedef ViewTransform Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "x";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto X() const -> float;
-
- auto X(float) const -> void;
-
- struct Y_t {
- typedef ViewTransform Owner;
- typedef float ReturnType;
- typedef float SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "y";
- static constexpr char signature[] =
- "F";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Y() const -> float;
-
- auto Y(float) const -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class Clipboard : public mozilla::jni::ObjectBase<Clipboard>
-{
-public:
- static const char name[];
-
- explicit Clipboard(const Context& ctx) : ObjectBase<Clipboard>(ctx) {}
-
- struct ClearText_t {
- typedef Clipboard Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "clearText";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto ClearText() -> void;
-
- struct GetText_t {
- typedef Clipboard Owner;
- typedef mozilla::jni::String::LocalRef ReturnType;
- typedef mozilla::jni::String::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getText";
- static constexpr char signature[] =
- "()Ljava/lang/String;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetText() -> mozilla::jni::String::LocalRef;
-
- struct HasText_t {
- typedef Clipboard Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "hasText";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto HasText() -> bool;
-
- struct SetText_t {
- typedef Clipboard Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "setText";
- static constexpr char signature[] =
- "(Ljava/lang/CharSequence;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto SetText(mozilla::jni::String::Param) -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
-
-};
-
-class HardwareCodecCapabilityUtils : public mozilla::jni::ObjectBase<HardwareCodecCapabilityUtils>
-{
-public:
- static const char name[];
-
- explicit HardwareCodecCapabilityUtils(const Context& ctx) : ObjectBase<HardwareCodecCapabilityUtils>(ctx) {}
-
- struct HasHWVP9_t {
- typedef HardwareCodecCapabilityUtils Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "HasHWVP9";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto HasHWVP9() -> bool;
-
- struct FindDecoderCodecInfoForMimeType_t {
- typedef HardwareCodecCapabilityUtils Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "findDecoderCodecInfoForMimeType";
- static constexpr char signature[] =
- "(Ljava/lang/String;)Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto FindDecoderCodecInfoForMimeType(mozilla::jni::String::Param) -> bool;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class NativeJSContainer : public mozilla::jni::ObjectBase<NativeJSContainer>
-{
-public:
- static const char name[];
-
- explicit NativeJSContainer(const Context& ctx) : ObjectBase<NativeJSContainer>(ctx) {}
-
- struct New_t {
- typedef NativeJSContainer Owner;
- typedef NativeJSContainer::LocalRef ReturnType;
- typedef NativeJSContainer::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "<init>";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto New() -> NativeJSContainer::LocalRef;
-
- struct Clone2_t {
- typedef NativeJSContainer Owner;
- typedef NativeJSContainer::LocalRef ReturnType;
- typedef NativeJSContainer::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "clone";
- static constexpr char signature[] =
- "()Lorg/mozilla/gecko/util/NativeJSContainer;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct DisposeNative_t {
- typedef NativeJSContainer Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "disposeNative";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
-
- template<class Impl> class Natives;
-};
-
-class NativeJSObject : public mozilla::jni::ObjectBase<NativeJSObject>
-{
-public:
- static const char name[];
-
- explicit NativeJSObject(const Context& ctx) : ObjectBase<NativeJSObject>(ctx) {}
-
- struct New_t {
- typedef NativeJSObject Owner;
- typedef NativeJSObject::LocalRef ReturnType;
- typedef NativeJSObject::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "<init>";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto New() -> NativeJSObject::LocalRef;
-
- struct DisposeNative_t {
- typedef NativeJSObject Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "disposeNative";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto DisposeNative() const -> void;
-
- struct GetBoolean_t {
- typedef NativeJSObject Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getBoolean";
- static constexpr char signature[] =
- "(Ljava/lang/String;)Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct GetBooleanArray_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::BooleanArray::LocalRef ReturnType;
- typedef mozilla::jni::BooleanArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getBooleanArray";
- static constexpr char signature[] =
- "(Ljava/lang/String;)[Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct GetBundle_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getBundle";
- static constexpr char signature[] =
- "(Ljava/lang/String;)Landroid/os/Bundle;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct GetBundleArray_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::ObjectArray::LocalRef ReturnType;
- typedef mozilla::jni::ObjectArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getBundleArray";
- static constexpr char signature[] =
- "(Ljava/lang/String;)[Landroid/os/Bundle;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct GetDouble_t {
- typedef NativeJSObject Owner;
- typedef double ReturnType;
- typedef double SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getDouble";
- static constexpr char signature[] =
- "(Ljava/lang/String;)D";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct GetDoubleArray_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::DoubleArray::LocalRef ReturnType;
- typedef mozilla::jni::DoubleArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getDoubleArray";
- static constexpr char signature[] =
- "(Ljava/lang/String;)[D";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct GetInt_t {
- typedef NativeJSObject Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getInt";
- static constexpr char signature[] =
- "(Ljava/lang/String;)I";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct GetIntArray_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::IntArray::LocalRef ReturnType;
- typedef mozilla::jni::IntArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getIntArray";
- static constexpr char signature[] =
- "(Ljava/lang/String;)[I";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct GetObject_t {
- typedef NativeJSObject Owner;
- typedef NativeJSObject::LocalRef ReturnType;
- typedef NativeJSObject::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getObject";
- static constexpr char signature[] =
- "(Ljava/lang/String;)Lorg/mozilla/gecko/util/NativeJSObject;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct GetObjectArray_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::ObjectArray::LocalRef ReturnType;
- typedef mozilla::jni::ObjectArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getObjectArray";
- static constexpr char signature[] =
- "(Ljava/lang/String;)[Lorg/mozilla/gecko/util/NativeJSObject;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct GetString_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::String::LocalRef ReturnType;
- typedef mozilla::jni::String::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getString";
- static constexpr char signature[] =
- "(Ljava/lang/String;)Ljava/lang/String;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct GetStringArray_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::ObjectArray::LocalRef ReturnType;
- typedef mozilla::jni::ObjectArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "getStringArray";
- static constexpr char signature[] =
- "(Ljava/lang/String;)[Ljava/lang/String;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct Has_t {
- typedef NativeJSObject Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "has";
- static constexpr char signature[] =
- "(Ljava/lang/String;)Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OptBoolean_t {
- typedef NativeJSObject Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- bool> Args;
- static constexpr char name[] = "optBoolean";
- static constexpr char signature[] =
- "(Ljava/lang/String;Z)Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OptBooleanArray_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::BooleanArray::LocalRef ReturnType;
- typedef mozilla::jni::BooleanArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::BooleanArray::Param> Args;
- static constexpr char name[] = "optBooleanArray";
- static constexpr char signature[] =
- "(Ljava/lang/String;[Z)[Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OptBundle_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "optBundle";
- static constexpr char signature[] =
- "(Ljava/lang/String;Landroid/os/Bundle;)Landroid/os/Bundle;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OptBundleArray_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::ObjectArray::LocalRef ReturnType;
- typedef mozilla::jni::ObjectArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::ObjectArray::Param> Args;
- static constexpr char name[] = "optBundleArray";
- static constexpr char signature[] =
- "(Ljava/lang/String;[Landroid/os/Bundle;)[Landroid/os/Bundle;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OptDouble_t {
- typedef NativeJSObject Owner;
- typedef double ReturnType;
- typedef double SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- double> Args;
- static constexpr char name[] = "optDouble";
- static constexpr char signature[] =
- "(Ljava/lang/String;D)D";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OptDoubleArray_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::DoubleArray::LocalRef ReturnType;
- typedef mozilla::jni::DoubleArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::DoubleArray::Param> Args;
- static constexpr char name[] = "optDoubleArray";
- static constexpr char signature[] =
- "(Ljava/lang/String;[D)[D";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OptInt_t {
- typedef NativeJSObject Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- int32_t> Args;
- static constexpr char name[] = "optInt";
- static constexpr char signature[] =
- "(Ljava/lang/String;I)I";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OptIntArray_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::IntArray::LocalRef ReturnType;
- typedef mozilla::jni::IntArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::IntArray::Param> Args;
- static constexpr char name[] = "optIntArray";
- static constexpr char signature[] =
- "(Ljava/lang/String;[I)[I";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OptObject_t {
- typedef NativeJSObject Owner;
- typedef NativeJSObject::LocalRef ReturnType;
- typedef NativeJSObject::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- NativeJSObject::Param> Args;
- static constexpr char name[] = "optObject";
- static constexpr char signature[] =
- "(Ljava/lang/String;Lorg/mozilla/gecko/util/NativeJSObject;)Lorg/mozilla/gecko/util/NativeJSObject;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OptObjectArray_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::ObjectArray::LocalRef ReturnType;
- typedef mozilla::jni::ObjectArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::ObjectArray::Param> Args;
- static constexpr char name[] = "optObjectArray";
- static constexpr char signature[] =
- "(Ljava/lang/String;[Lorg/mozilla/gecko/util/NativeJSObject;)[Lorg/mozilla/gecko/util/NativeJSObject;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OptString_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::String::LocalRef ReturnType;
- typedef mozilla::jni::String::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "optString";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OptStringArray_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::ObjectArray::LocalRef ReturnType;
- typedef mozilla::jni::ObjectArray::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::ObjectArray::Param> Args;
- static constexpr char name[] = "optStringArray";
- static constexpr char signature[] =
- "(Ljava/lang/String;[Ljava/lang/String;)[Ljava/lang/String;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct ToBundle_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "toBundle";
- static constexpr char signature[] =
- "()Landroid/os/Bundle;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct ToString_t {
- typedef NativeJSObject Owner;
- typedef mozilla::jni::String::LocalRef ReturnType;
- typedef mozilla::jni::String::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "toString";
- static constexpr char signature[] =
- "()Ljava/lang/String;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
-
- template<class Impl> class Natives;
-};
-
-} /* java */
-} /* mozilla */
-#endif // GeneratedJNIWrappers_h
diff --git a/widget/android/GfxInfo.cpp b/widget/android/GfxInfo.cpp
deleted file mode 100644
index d92cdb526..000000000
--- a/widget/android/GfxInfo.cpp
+++ /dev/null
@@ -1,605 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "GfxInfo.h"
-#include "GLContext.h"
-#include "GLContextProvider.h"
-#include "nsUnicharUtils.h"
-#include "prenv.h"
-#include "prprf.h"
-#include "nsHashKeys.h"
-#include "nsVersionComparator.h"
-#include "AndroidBridge.h"
-#include "nsIWindowWatcher.h"
-#include "nsServiceManagerUtils.h"
-
-namespace mozilla {
-namespace widget {
-
-class GfxInfo::GLStrings
-{
- nsCString mVendor;
- nsCString mRenderer;
- nsCString mVersion;
- bool mReady;
-
-public:
- GLStrings()
- : mReady(false)
- {}
-
- const nsCString& Vendor() {
- EnsureInitialized();
- return mVendor;
- }
-
- // This spoofed value wins, even if the environment variable
- // MOZ_GFX_SPOOF_GL_VENDOR was set.
- void SpoofVendor(const nsCString& s) {
- mVendor = s;
- }
-
- const nsCString& Renderer() {
- EnsureInitialized();
- return mRenderer;
- }
-
- // This spoofed value wins, even if the environment variable
- // MOZ_GFX_SPOOF_GL_RENDERER was set.
- void SpoofRenderer(const nsCString& s) {
- mRenderer = s;
- }
-
- const nsCString& Version() {
- EnsureInitialized();
- return mVersion;
- }
-
- // This spoofed value wins, even if the environment variable
- // MOZ_GFX_SPOOF_GL_VERSION was set.
- void SpoofVersion(const nsCString& s) {
- mVersion = s;
- }
-
- void EnsureInitialized() {
- if (mReady) {
- return;
- }
-
- RefPtr<gl::GLContext> gl;
- nsCString discardFailureId;
- gl = gl::GLContextProvider::CreateHeadless(gl::CreateContextFlags::REQUIRE_COMPAT_PROFILE,
- &discardFailureId);
-
- if (!gl) {
- // Setting mReady to true here means that we won't retry. Everything will
- // remain blacklisted forever. Ideally, we would like to update that once
- // any GLContext is successfully created, like the compositor's GLContext.
- mReady = true;
- return;
- }
-
- gl->MakeCurrent();
-
- if (mVendor.IsEmpty()) {
- const char *spoofedVendor = PR_GetEnv("MOZ_GFX_SPOOF_GL_VENDOR");
- if (spoofedVendor) {
- mVendor.Assign(spoofedVendor);
- } else {
- mVendor.Assign((const char*)gl->fGetString(LOCAL_GL_VENDOR));
- }
- }
-
- if (mRenderer.IsEmpty()) {
- const char *spoofedRenderer = PR_GetEnv("MOZ_GFX_SPOOF_GL_RENDERER");
- if (spoofedRenderer) {
- mRenderer.Assign(spoofedRenderer);
- } else {
- mRenderer.Assign((const char*)gl->fGetString(LOCAL_GL_RENDERER));
- }
- }
-
- if (mVersion.IsEmpty()) {
- const char *spoofedVersion = PR_GetEnv("MOZ_GFX_SPOOF_GL_VERSION");
- if (spoofedVersion) {
- mVersion.Assign(spoofedVersion);
- } else {
- mVersion.Assign((const char*)gl->fGetString(LOCAL_GL_VERSION));
- }
- }
-
- mReady = true;
- }
-};
-
-#ifdef DEBUG
-NS_IMPL_ISUPPORTS_INHERITED(GfxInfo, GfxInfoBase, nsIGfxInfoDebug)
-#endif
-
-GfxInfo::GfxInfo()
- : mInitialized(false)
- , mGLStrings(new GLStrings)
- , mOSVersionInteger(0)
- , mSDKVersion(0)
-{
-}
-
-GfxInfo::~GfxInfo()
-{
-}
-
-/* GetD2DEnabled and GetDwriteEnabled shouldn't be called until after gfxPlatform initialization
- * has occurred because they depend on it for information. (See bug 591561) */
-nsresult
-GfxInfo::GetD2DEnabled(bool *aEnabled)
-{
- return NS_ERROR_FAILURE;
-}
-
-nsresult
-GfxInfo::GetDWriteEnabled(bool *aEnabled)
-{
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetDWriteVersion(nsAString & aDwriteVersion)
-{
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetCleartypeParameters(nsAString & aCleartypeParams)
-{
- return NS_ERROR_FAILURE;
-}
-
-void
-GfxInfo::EnsureInitialized()
-{
- if (mInitialized)
- return;
-
- if (!mozilla::AndroidBridge::Bridge()) {
- gfxWarning() << "AndroidBridge missing during initialization";
- return;
- }
-
- if (mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "MODEL", mModel)) {
- mAdapterDescription.AppendPrintf("Model: %s", NS_LossyConvertUTF16toASCII(mModel).get());
- }
-
- if (mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "PRODUCT", mProduct)) {
- mAdapterDescription.AppendPrintf(", Product: %s", NS_LossyConvertUTF16toASCII(mProduct).get());
- }
-
- if (mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "MANUFACTURER", mManufacturer)) {
- mAdapterDescription.AppendPrintf(", Manufacturer: %s", NS_LossyConvertUTF16toASCII(mManufacturer).get());
- }
-
- if (mozilla::AndroidBridge::Bridge()->GetStaticIntField("android/os/Build$VERSION", "SDK_INT", &mSDKVersion)) {
- // the HARDWARE field isn't available on Android SDK < 8, but we require 9+ anyway.
- MOZ_ASSERT(mSDKVersion >= 8);
- if (mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build", "HARDWARE", mHardware)) {
- mAdapterDescription.AppendPrintf(", Hardware: %s", NS_LossyConvertUTF16toASCII(mHardware).get());
- }
- } else {
- mSDKVersion = 0;
- }
-
- nsString release;
- mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION", "RELEASE", release);
- mOSVersion = NS_LossyConvertUTF16toASCII(release);
-
- mOSVersionInteger = 0;
- char a[5], b[5], c[5], d[5];
- SplitDriverVersion(mOSVersion.get(), a, b, c, d);
- uint8_t na = atoi(a);
- uint8_t nb = atoi(b);
- uint8_t nc = atoi(c);
- uint8_t nd = atoi(d);
-
- mOSVersionInteger = (uint32_t(na) << 24) |
- (uint32_t(nb) << 16) |
- (uint32_t(nc) << 8) |
- uint32_t(nd);
-
- mAdapterDescription.AppendPrintf(", OpenGL: %s -- %s -- %s",
- mGLStrings->Vendor().get(),
- mGLStrings->Renderer().get(),
- mGLStrings->Version().get());
-
- AddCrashReportAnnotations();
-
- mInitialized = true;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterDescription(nsAString & aAdapterDescription)
-{
- EnsureInitialized();
- aAdapterDescription = NS_ConvertASCIItoUTF16(mAdapterDescription);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterDescription2(nsAString & aAdapterDescription)
-{
- EnsureInitialized();
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterRAM(nsAString & aAdapterRAM)
-{
- EnsureInitialized();
- aAdapterRAM.Truncate();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterRAM2(nsAString & aAdapterRAM)
-{
- EnsureInitialized();
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriver(nsAString & aAdapterDriver)
-{
- EnsureInitialized();
- aAdapterDriver.Truncate();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriver2(nsAString & aAdapterDriver)
-{
- EnsureInitialized();
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriverVersion(nsAString & aAdapterDriverVersion)
-{
- EnsureInitialized();
- aAdapterDriverVersion = NS_ConvertASCIItoUTF16(mGLStrings->Version());
- return NS_OK;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion)
-{
- EnsureInitialized();
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriverDate(nsAString & aAdapterDriverDate)
-{
- EnsureInitialized();
- aAdapterDriverDate.Truncate();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterDriverDate2(nsAString & aAdapterDriverDate)
-{
- EnsureInitialized();
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterVendorID(nsAString & aAdapterVendorID)
-{
- EnsureInitialized();
- aAdapterVendorID = NS_ConvertASCIItoUTF16(mGLStrings->Vendor());
- return NS_OK;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterVendorID2(nsAString & aAdapterVendorID)
-{
- EnsureInitialized();
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterDeviceID(nsAString & aAdapterDeviceID)
-{
- EnsureInitialized();
- aAdapterDeviceID = NS_ConvertASCIItoUTF16(mGLStrings->Renderer());
- return NS_OK;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterDeviceID2(nsAString & aAdapterDeviceID)
-{
- EnsureInitialized();
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterSubsysID(nsAString & aAdapterSubsysID)
-{
- EnsureInitialized();
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetAdapterSubsysID2(nsAString & aAdapterSubsysID)
-{
- EnsureInitialized();
- return NS_ERROR_FAILURE;
-}
-
-NS_IMETHODIMP
-GfxInfo::GetIsGPU2Active(bool* aIsGPU2Active)
-{
- EnsureInitialized();
- return NS_ERROR_FAILURE;
-}
-
-void
-GfxInfo::AddCrashReportAnnotations()
-{
- /*** STUB ***/
-}
-
-const nsTArray<GfxDriverInfo>&
-GfxInfo::GetGfxDriverInfo()
-{
- if (mDriverInfo->IsEmpty()) {
- APPEND_TO_DRIVER_BLOCKLIST2(OperatingSystem::Android,
- (nsAString&) GfxDriverInfo::GetDeviceVendor(VendorAll), GfxDriverInfo::allDevices,
- nsIGfxInfo::FEATURE_OPENGL_LAYERS, nsIGfxInfo::FEATURE_STATUS_OK,
- DRIVER_COMPARISON_IGNORED, GfxDriverInfo::allDriverVersions,
- "FEATURE_OK_FORCE_OPENGL" );
- }
-
- return *mDriverInfo;
-}
-
-nsresult
-GfxInfo::GetFeatureStatusImpl(int32_t aFeature,
- int32_t *aStatus,
- nsAString &aSuggestedDriverVersion,
- const nsTArray<GfxDriverInfo>& aDriverInfo,
- nsACString &aFailureId,
- OperatingSystem* aOS /* = nullptr */)
-{
- NS_ENSURE_ARG_POINTER(aStatus);
- aSuggestedDriverVersion.SetIsVoid(true);
- *aStatus = nsIGfxInfo::FEATURE_STATUS_UNKNOWN;
- OperatingSystem os = mOS;
- if (aOS)
- *aOS = os;
-
- if (mShutdownOccurred) {
- return NS_OK;
- }
-
- // OpenGL layers are never blacklisted on Android.
- // This early return is so we avoid potentially slow
- // GLStrings initialization on startup when we initialize GL layers.
- if (aFeature == nsIGfxInfo::FEATURE_OPENGL_LAYERS) {
- *aStatus = nsIGfxInfo::FEATURE_STATUS_OK;
- return NS_OK;
- }
-
- EnsureInitialized();
-
- if (mGLStrings->Vendor().IsEmpty() || mGLStrings->Renderer().IsEmpty()) {
- *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
- return NS_OK;
- }
-
- // Don't evaluate special cases when evaluating the downloaded blocklist.
- if (aDriverInfo.IsEmpty()) {
- if (aFeature == nsIGfxInfo::FEATURE_CANVAS2D_ACCELERATION) {
- if (mSDKVersion < 11) {
- // It's slower than software due to not having a compositing fast path
- *aStatus = nsIGfxInfo::FEATURE_BLOCKED_OS_VERSION;
- aFailureId = "FEATURE_FAILURE_CANVAS_2D_SDK";
- } else if (mGLStrings->Renderer().Find("Vivante GC1000") != -1) {
- // Blocklist Vivante GC1000. See bug 1248183.
- *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
- aFailureId = "FEATURE_FAILED_CANVAS_2D_HW";
- } else {
- *aStatus = nsIGfxInfo::FEATURE_STATUS_OK;
- }
- return NS_OK;
- }
-
- if (aFeature == FEATURE_WEBGL_OPENGL) {
- if (mGLStrings->Renderer().Find("Adreno 200") != -1 ||
- mGLStrings->Renderer().Find("Adreno 205") != -1)
- {
- *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
- aFailureId = "FEATURE_FAILURE_ADRENO_20x";
- return NS_OK;
- }
-
- if (mHardware.EqualsLiteral("ville")) {
- *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
- aFailureId = "FEATURE_FAILURE_VILLE";
- return NS_OK;
- }
- }
-
- if (aFeature == FEATURE_STAGEFRIGHT) {
- NS_LossyConvertUTF16toASCII cManufacturer(mManufacturer);
- NS_LossyConvertUTF16toASCII cModel(mModel);
- NS_LossyConvertUTF16toASCII cHardware(mHardware);
-
- if (cHardware.EqualsLiteral("antares") ||
- cHardware.EqualsLiteral("harmony") ||
- cHardware.EqualsLiteral("picasso") ||
- cHardware.EqualsLiteral("picasso_e") ||
- cHardware.EqualsLiteral("ventana") ||
- cHardware.EqualsLiteral("rk30board"))
- {
- *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
- aFailureId = "FEATURE_FAILURE_STAGE_HW";
- return NS_OK;
- }
-
- if (CompareVersions(mOSVersion.get(), "4.1.0") < 0)
- {
- // Whitelist:
- // All Samsung ICS devices, except for:
- // Samsung SGH-I717 (Bug 845729)
- // Samsung SGH-I727 (Bug 845729)
- // Samsung SGH-I757 (Bug 845729)
- // All Galaxy nexus ICS devices
- // Sony Xperia Ion (LT28) ICS devices
- bool isWhitelisted =
- cModel.Equals("LT28h", nsCaseInsensitiveCStringComparator()) ||
- cManufacturer.Equals("samsung", nsCaseInsensitiveCStringComparator()) ||
- cModel.Equals("galaxy nexus", nsCaseInsensitiveCStringComparator()); // some Galaxy Nexus have manufacturer=amazon
-
- if (cModel.Find("SGH-I717", true) != -1 ||
- cModel.Find("SGH-I727", true) != -1 ||
- cModel.Find("SGH-I757", true) != -1)
- {
- isWhitelisted = false;
- }
-
- if (!isWhitelisted) {
- *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
- aFailureId = "FEATURE_FAILURE_4_1_HW";
- return NS_OK;
- }
- }
- else if (CompareVersions(mOSVersion.get(), "4.2.0") < 0)
- {
- // Whitelist:
- // All JB phones except for those in blocklist below
- // Blocklist:
- // Samsung devices from bug 812881 and 853522.
- // Motorola XT890 from bug 882342.
- bool isBlocklisted =
- cModel.Find("GT-P3100", true) != -1 ||
- cModel.Find("GT-P3110", true) != -1 ||
- cModel.Find("GT-P3113", true) != -1 ||
- cModel.Find("GT-P5100", true) != -1 ||
- cModel.Find("GT-P5110", true) != -1 ||
- cModel.Find("GT-P5113", true) != -1 ||
- cModel.Find("XT890", true) != -1;
-
- if (isBlocklisted) {
- *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
- aFailureId = "FEATURE_FAILURE_4_2_HW";
- return NS_OK;
- }
- }
- else if (CompareVersions(mOSVersion.get(), "4.3.0") < 0)
- {
- // Blocklist all Sony devices
- if (cManufacturer.Find("Sony", true) != -1) {
- *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
- aFailureId = "FEATURE_FAILURE_4_3_SONY";
- return NS_OK;
- }
- }
- }
-
- if (aFeature == FEATURE_WEBRTC_HW_ACCELERATION_ENCODE) {
- if (mozilla::AndroidBridge::Bridge()) {
- *aStatus = mozilla::AndroidBridge::Bridge()->GetHWEncoderCapability() ? nsIGfxInfo::FEATURE_STATUS_OK : nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
- aFailureId = "FEATURE_FAILURE_WEBRTC_ENCODE";
- return NS_OK;
- }
- }
- if (aFeature == FEATURE_WEBRTC_HW_ACCELERATION_DECODE) {
- if (mozilla::AndroidBridge::Bridge()) {
- *aStatus = mozilla::AndroidBridge::Bridge()->GetHWDecoderCapability() ? nsIGfxInfo::FEATURE_STATUS_OK : nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
- aFailureId = "FEATURE_FAILURE_WEBRTC_DECODE";
- return NS_OK;
- }
- }
-
- if (aFeature == FEATURE_VP8_HW_DECODE || aFeature == FEATURE_VP9_HW_DECODE) {
- NS_LossyConvertUTF16toASCII model(mModel);
- bool isBlocked =
- // GIFV crash, see bug 1232911.
- model.Equals("GT-N8013", nsCaseInsensitiveCStringComparator());
-
- if (isBlocked) {
- *aStatus = nsIGfxInfo::FEATURE_BLOCKED_DEVICE;
- aFailureId = "FEATURE_FAILURE_VPx";
- } else {
- *aStatus = nsIGfxInfo::FEATURE_STATUS_OK;
- }
- return NS_OK;
- }
- }
-
- return GfxInfoBase::GetFeatureStatusImpl(aFeature, aStatus, aSuggestedDriverVersion, aDriverInfo, aFailureId, &os);
-}
-
-#ifdef DEBUG
-
-// Implement nsIGfxInfoDebug
-
-NS_IMETHODIMP GfxInfo::SpoofVendorID(const nsAString & aVendorID)
-{
- mGLStrings->SpoofVendor(NS_LossyConvertUTF16toASCII(aVendorID));
- return NS_OK;
-}
-
-NS_IMETHODIMP GfxInfo::SpoofDeviceID(const nsAString & aDeviceID)
-{
- mGLStrings->SpoofRenderer(NS_LossyConvertUTF16toASCII(aDeviceID));
- return NS_OK;
-}
-
-NS_IMETHODIMP GfxInfo::SpoofDriverVersion(const nsAString & aDriverVersion)
-{
- mGLStrings->SpoofVersion(NS_LossyConvertUTF16toASCII(aDriverVersion));
- return NS_OK;
-}
-
-NS_IMETHODIMP GfxInfo::SpoofOSVersion(uint32_t aVersion)
-{
- EnsureInitialized();
- mOSVersion = aVersion;
- return NS_OK;
-}
-
-#endif
-
-nsString GfxInfo::Model()
-{
- EnsureInitialized();
- return mModel;
-}
-
-nsString GfxInfo::Hardware()
-{
- EnsureInitialized();
- return mHardware;
-}
-
-nsString GfxInfo::Product()
-{
- EnsureInitialized();
- return mProduct;
-}
-
-nsString GfxInfo::Manufacturer()
-{
- EnsureInitialized();
- return mManufacturer;
-}
-
-uint32_t GfxInfo::OperatingSystemVersion()
-{
- EnsureInitialized();
- return mOSVersionInteger;
-}
-
-}
-}
diff --git a/widget/android/GfxInfo.h b/widget/android/GfxInfo.h
deleted file mode 100644
index a3b06099b..000000000
--- a/widget/android/GfxInfo.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/* vim: se cin sw=2 ts=2 et : */
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef __mozilla_widget_GfxInfo_h__
-#define __mozilla_widget_GfxInfo_h__
-
-#include "GfxInfoBase.h"
-#include "GfxDriverInfo.h"
-
-#include "nsString.h"
-#include "mozilla/UniquePtr.h"
-
-namespace mozilla {
-
-namespace widget {
-
-class GfxInfo : public GfxInfoBase
-{
-private:
- ~GfxInfo();
-
-public:
- GfxInfo();
-
- // We only declare the subset of nsIGfxInfo that we actually implement. The
- // rest is brought forward from GfxInfoBase.
- NS_IMETHOD GetD2DEnabled(bool *aD2DEnabled) override;
- NS_IMETHOD GetDWriteEnabled(bool *aDWriteEnabled) override;
- NS_IMETHOD GetDWriteVersion(nsAString & aDwriteVersion) override;
- NS_IMETHOD GetCleartypeParameters(nsAString & aCleartypeParams) override;
- NS_IMETHOD GetAdapterDescription(nsAString & aAdapterDescription) override;
- NS_IMETHOD GetAdapterDriver(nsAString & aAdapterDriver) override;
- NS_IMETHOD GetAdapterVendorID(nsAString & aAdapterVendorID) override;
- NS_IMETHOD GetAdapterDeviceID(nsAString & aAdapterDeviceID) override;
- NS_IMETHOD GetAdapterSubsysID(nsAString & aAdapterSubsysID) override;
- NS_IMETHOD GetAdapterRAM(nsAString & aAdapterRAM) override;
- NS_IMETHOD GetAdapterDriverVersion(nsAString & aAdapterDriverVersion) override;
- NS_IMETHOD GetAdapterDriverDate(nsAString & aAdapterDriverDate) override;
- NS_IMETHOD GetAdapterDescription2(nsAString & aAdapterDescription) override;
- NS_IMETHOD GetAdapterDriver2(nsAString & aAdapterDriver) override;
- NS_IMETHOD GetAdapterVendorID2(nsAString & aAdapterVendorID) override;
- NS_IMETHOD GetAdapterDeviceID2(nsAString & aAdapterDeviceID) override;
- NS_IMETHOD GetAdapterSubsysID2(nsAString & aAdapterSubsysID) override;
- NS_IMETHOD GetAdapterRAM2(nsAString & aAdapterRAM) override;
- NS_IMETHOD GetAdapterDriverVersion2(nsAString & aAdapterDriverVersion) override;
- NS_IMETHOD GetAdapterDriverDate2(nsAString & aAdapterDriverDate) override;
- NS_IMETHOD GetIsGPU2Active(bool *aIsGPU2Active) override;
- using GfxInfoBase::GetFeatureStatus;
- using GfxInfoBase::GetFeatureSuggestedDriverVersion;
- using GfxInfoBase::GetWebGLParameter;
-
- void EnsureInitialized();
-
- virtual nsString Model() override;
- virtual nsString Hardware() override;
- virtual nsString Product() override;
- virtual nsString Manufacturer() override;
-
-#ifdef DEBUG
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_NSIGFXINFODEBUG
-#endif
-
- virtual uint32_t OperatingSystemVersion() override;
-
-protected:
-
- virtual nsresult GetFeatureStatusImpl(int32_t aFeature,
- int32_t *aStatus,
- nsAString & aSuggestedDriverVersion,
- const nsTArray<GfxDriverInfo>& aDriverInfo,
- nsACString &aFailureId,
- OperatingSystem* aOS = nullptr) override;
- virtual const nsTArray<GfxDriverInfo>& GetGfxDriverInfo() override;
-
-private:
-
- void AddCrashReportAnnotations();
-
- bool mInitialized;
-
- class GLStrings;
- UniquePtr<GLStrings> mGLStrings;
-
- nsCString mAdapterDescription;
-
- OperatingSystem mOS;
-
- nsString mModel, mHardware, mManufacturer, mProduct;
- nsCString mOSVersion;
- uint32_t mOSVersionInteger;
- int32_t mSDKVersion;
-};
-
-} // namespace widget
-} // namespace mozilla
-
-#endif /* __mozilla_widget_GfxInfo_h__ */
diff --git a/widget/android/NativeJSContainer.cpp b/widget/android/NativeJSContainer.cpp
deleted file mode 100644
index b8c434656..000000000
--- a/widget/android/NativeJSContainer.cpp
+++ /dev/null
@@ -1,881 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "NativeJSContainer.h"
-
-#include <jni.h>
-
-#include "Bundle.h"
-#include "GeneratedJNINatives.h"
-#include "MainThreadUtils.h"
-#include "jsapi.h"
-#include "nsJSUtils.h"
-
-#include <mozilla/Vector.h>
-#include <mozilla/jni/Accessors.h>
-#include <mozilla/jni/Refs.h>
-#include <mozilla/jni/Utils.h>
-
-/**
- * NativeJSContainer.cpp implements the native methods in both
- * NativeJSContainer and NativeJSObject, using JSAPI to retrieve values from a
- * JSObject and using JNI to return those values to Java code.
- */
-
-namespace mozilla {
-namespace widget {
-
-namespace {
-
-bool CheckThread()
-{
- if (!NS_IsMainThread()) {
- jni::ThrowException("java/lang/IllegalThreadStateException",
- "Not on Gecko thread");
- return false;
- }
- return true;
-}
-
-template<class C, typename T> bool
-CheckJNIArgument(const jni::Ref<C, T>& arg)
-{
- if (!arg) {
- jni::ThrowException("java/lang/IllegalArgumentException",
- "Null argument");
- }
- return !!arg;
-}
-
-nsresult
-CheckSDKCall(nsresult rv)
-{
- if (NS_FAILED(rv)) {
- jni::ThrowException("java/lang/UnsupportedOperationException",
- "SDK JNI call failed");
- }
- return rv;
-}
-
-// Convert a JNI string to a char16_t string that JSAPI expects.
-class JSJNIString final
-{
- JNIEnv* const mEnv;
- jni::String::Param mJNIString;
- const char16_t* const mJSString;
-
-public:
- JSJNIString(JNIEnv* env, jni::String::Param str)
- : mEnv(env)
- , mJNIString(str)
- , mJSString(!str ? nullptr : reinterpret_cast<const char16_t*>(
- mEnv->GetStringChars(str.Get(), nullptr)))
- {}
-
- ~JSJNIString() {
- if (mJNIString) {
- mEnv->ReleaseStringChars(mJNIString.Get(),
- reinterpret_cast<const jchar*>(mJSString));
- }
- }
-
- operator const char16_t*() const {
- return mJSString;
- }
-
- size_t Length() const {
- return static_cast<size_t>(mEnv->GetStringLength(mJNIString.Get()));
- }
-};
-
-} // namepsace
-
-class NativeJSContainerImpl final
- : public NativeJSObject::Natives<NativeJSContainerImpl>
- , public NativeJSContainer::Natives<NativeJSContainerImpl>
-{
- typedef NativeJSContainerImpl Self;
- typedef NativeJSContainer::Natives<NativeJSContainerImpl> ContainerBase;
- typedef NativeJSObject::Natives<NativeJSContainerImpl> ObjectBase;
-
- typedef JS::PersistentRooted<JSObject*> PersistentObject;
-
- JNIEnv* const mEnv;
- // Context that the object is valid in
- JSContext* const mJSContext;
- // Root JS object
- PersistentObject mJSObject;
- // Children objects
- Vector<NativeJSObject::GlobalRef, 0> mChildren;
-
- bool CheckObject() const
- {
- if (!mJSObject) {
- jni::ThrowException("java/lang/NullPointerException",
- "Null JSObject");
- }
- return !!mJSObject;
- }
-
- bool CheckJSCall(bool result) const
- {
- if (!result) {
- JS_ClearPendingException(mJSContext);
- jni::ThrowException("java/lang/UnsupportedOperationException",
- "JSAPI call failed");
- }
- return result;
- }
-
- // Check that a JS Value contains a particular property type as indicaed by
- // the property's InValue method (e.g. StringProperty::InValue).
- bool CheckProperty(bool (Self::*InValue)(JS::HandleValue) const,
- JS::HandleValue val) const
- {
- if (!(this->*InValue)(val)) {
- // XXX this can happen when converting a double array inside a
- // Bundle, because double arrays can be misidentified as an int
- // array. The workaround is to add a dummy first element to the
- // array that is a floating point value, i.e. [0.5, ...].
- jni::ThrowException(
- "org/mozilla/gecko/util/NativeJSObject$InvalidPropertyException",
- "Property type mismatch");
- return false;
- }
- return true;
- }
-
- // Primitive properties
-
- template<bool (JS::Value::*IsType)() const> bool
- PrimitiveInValue(JS::HandleValue val) const
- {
- return (static_cast<const JS::Value&>(val).*IsType)();
- }
-
- template<typename U, U (JS::Value::*ToType)() const> U
- PrimitiveFromValue(JS::HandleValue val) const
- {
- return (static_cast<const JS::Value&>(val).*ToType)();
- }
-
- template<class Prop> typename Prop::NativeArray
- PrimitiveNewArray(JS::HandleObject array, size_t length) const
- {
- typedef typename Prop::JNIType JNIType;
-
- // Fill up a temporary buffer for our array, then use
- // JNIEnv::Set*ArrayRegion to fill out array in one go.
-
- UniquePtr<JNIType[]> buffer = MakeUnique<JNIType[]>(length);
- for (size_t i = 0; i < length; i++) {
- JS::RootedValue elem(mJSContext);
- if (!CheckJSCall(JS_GetElement(mJSContext, array, i, &elem)) ||
- !CheckProperty(Prop::InValue, elem)) {
- return nullptr;
- }
- buffer[i] = JNIType((this->*Prop::FromValue)(elem));
- }
- auto jarray = Prop::NativeArray::Adopt(
- mEnv, (mEnv->*Prop::NewJNIArray)(length));
- if (!jarray) {
- return nullptr;
- }
- (mEnv->*Prop::SetJNIArrayRegion)(
- jarray.Get(), 0, length, buffer.get());
- if (mEnv->ExceptionCheck()) {
- return nullptr;
- }
- return jarray;
- }
-
- template<typename U, typename UA, typename V, typename VA,
- bool (JS::Value::*IsType)() const,
- U (JS::Value::*ToType)() const,
- VA (JNIEnv::*NewArray_)(jsize),
- void (JNIEnv::*SetArrayRegion_)(VA, jsize, jsize, const V*)>
- struct PrimitiveProperty
- {
- // C++ type for a primitive property (e.g. bool)
- typedef U NativeType;
- // C++ type for the fallback value used in opt* methods
- typedef U NativeFallback;
- // Type for an array of the primitive type (e.g. BooleanArray::LocalRef)
- typedef typename UA::LocalRef NativeArray;
- // Type for the fallback value used in opt*Array methods
- typedef const typename UA::Ref ArrayFallback;
- // JNI type (e.g. jboolean)
- typedef V JNIType;
-
- // JNIEnv function to create a new JNI array of the primiive type
- typedef decltype(NewArray_) NewJNIArray_t;
- static constexpr NewJNIArray_t NewJNIArray = NewArray_;
-
- // JNIEnv function to fill a JNI array of the primiive type
- typedef decltype(SetArrayRegion_) SetJNIArrayRegion_t;
- static constexpr SetJNIArrayRegion_t SetJNIArrayRegion = SetArrayRegion_;
-
- // Function to determine if a JS Value contains the primitive type
- typedef decltype(&Self::PrimitiveInValue<IsType>) InValue_t;
- static constexpr InValue_t InValue = &Self::PrimitiveInValue<IsType>;
-
- // Function to convert a JS Value to the primitive type
- typedef decltype(&Self::PrimitiveFromValue<U, ToType>) FromValue_t;
- static constexpr FromValue_t FromValue
- = &Self::PrimitiveFromValue<U, ToType>;
-
- // Function to convert a JS array to a JNI array
- typedef decltype(&Self::PrimitiveNewArray<PrimitiveProperty>) NewArray_t;
- static constexpr NewArray_t NewArray
- = &Self::PrimitiveNewArray<PrimitiveProperty>;
- };
-
- // String properties
-
- bool StringInValue(JS::HandleValue val) const
- {
- return val.isString();
- }
-
- jni::String::LocalRef
- StringFromValue(const JS::HandleString str) const
- {
- nsAutoJSString autoStr;
- if (!CheckJSCall(autoStr.init(mJSContext, str))) {
- return nullptr;
- }
- // StringParam can automatically convert a nsString to jstring.
- return jni::StringParam(autoStr, mEnv);
- }
-
- jni::String::LocalRef
- StringFromValue(JS::HandleValue val)
- {
- const JS::RootedString str(mJSContext, val.toString());
- return StringFromValue(str);
- }
-
- // Bundle properties
-
- sdk::Bundle::LocalRef
- BundleFromValue(const JS::HandleObject obj)
- {
- JS::Rooted<JS::IdVector> ids(mJSContext, JS::IdVector(mJSContext));
- if (!CheckJSCall(JS_Enumerate(mJSContext, obj, &ids))) {
- return nullptr;
- }
-
- const size_t length = ids.length();
- sdk::Bundle::LocalRef newBundle(mEnv);
- NS_ENSURE_SUCCESS(CheckSDKCall(
- sdk::Bundle::New(length, &newBundle)), nullptr);
-
- // Iterate through each property of the JS object. For each property,
- // determine its type from a list of supported types, and convert that
- // proeprty to the supported type.
-
- for (size_t i = 0; i < ids.length(); i++) {
- const JS::RootedId id(mJSContext, ids[i]);
- JS::RootedValue idVal(mJSContext);
- if (!CheckJSCall(JS_IdToValue(mJSContext, id, &idVal))) {
- return nullptr;
- }
-
- const JS::RootedString idStr(mJSContext,
- JS::ToString(mJSContext, idVal));
- if (!CheckJSCall(!!idStr)) {
- return nullptr;
- }
-
- jni::String::LocalRef name = StringFromValue(idStr);
- JS::RootedValue val(mJSContext);
- if (!name ||
- !CheckJSCall(JS_GetPropertyById(mJSContext, obj, id, &val))) {
- return nullptr;
- }
-
-#define PUT_IN_BUNDLE_IF_TYPE_IS(TYPE) \
- if ((this->*TYPE##Property::InValue)(val)) { \
- auto jval = (this->*TYPE##Property::FromValue)(val); \
- if (mEnv->ExceptionCheck()) { \
- return nullptr; \
- } \
- NS_ENSURE_SUCCESS(CheckSDKCall( \
- newBundle->Put##TYPE(name, jval)), nullptr); \
- continue; \
- } \
- ((void) 0) // Accommodate trailing semicolon.
-
- // Scalar values are faster to check, so check them first.
- PUT_IN_BUNDLE_IF_TYPE_IS(Boolean);
- // Int can be casted to double, so check int first.
- PUT_IN_BUNDLE_IF_TYPE_IS(Int);
- PUT_IN_BUNDLE_IF_TYPE_IS(Double);
- PUT_IN_BUNDLE_IF_TYPE_IS(String);
- // There's no "putObject", so don't check ObjectProperty
-
- // Check for array types if scalar checks all failed.
- // XXX empty arrays are treated as boolean arrays. Workaround is
- // to always have a dummy element to create a non-empty array.
- PUT_IN_BUNDLE_IF_TYPE_IS(BooleanArray);
- // XXX because we only check the first element of an array,
- // a double array can potentially be seen as an int array.
- // When that happens, the Bundle conversion will fail.
- PUT_IN_BUNDLE_IF_TYPE_IS(IntArray);
- PUT_IN_BUNDLE_IF_TYPE_IS(DoubleArray);
- PUT_IN_BUNDLE_IF_TYPE_IS(StringArray);
- // There's no "putObjectArray", so don't check ObjectArrayProperty
- // There's no "putBundleArray", so don't check BundleArrayProperty
-
- // Use Bundle as the default catch-all for objects
- PUT_IN_BUNDLE_IF_TYPE_IS(Bundle);
-
-#undef PUT_IN_BUNDLE_IF_TYPE_IS
-
- // We tried all supported types; just bail.
- jni::ThrowException("java/lang/UnsupportedOperationException",
- "Unsupported property type");
- return nullptr;
- }
- return jni::Object::LocalRef::Adopt(newBundle.Env(),
- newBundle.Forget());
- }
-
- sdk::Bundle::LocalRef
- BundleFromValue(JS::HandleValue val)
- {
- if (val.isNull()) {
- return nullptr;
- }
- JS::RootedObject object(mJSContext, &val.toObject());
- return BundleFromValue(object);
- }
-
- // Object properties
-
- bool ObjectInValue(JS::HandleValue val) const
- {
- return val.isObjectOrNull();
- }
-
- NativeJSObject::LocalRef
- ObjectFromValue(JS::HandleValue val)
- {
- if (val.isNull()) {
- return nullptr;
- }
- JS::RootedObject object(mJSContext, &val.toObject());
- return CreateChild(object);
- }
-
- template<class Prop> typename Prop::NativeArray
- ObjectNewArray(JS::HandleObject array, size_t length)
- {
- auto jarray = Prop::NativeArray::Adopt(mEnv, mEnv->NewObjectArray(
- length, typename Prop::ClassType::Context().ClassRef(),
- nullptr));
- if (!jarray) {
- return nullptr;
- }
-
- // For object arrays, we have to set each element separately.
- for (size_t i = 0; i < length; i++) {
- JS::RootedValue elem(mJSContext);
- if (!CheckJSCall(JS_GetElement(mJSContext, array, i, &elem)) ||
- !CheckProperty(Prop::InValue, elem)) {
- return nullptr;
- }
- mEnv->SetObjectArrayElement(
- jarray.Get(), i, (this->*Prop::FromValue)(elem).Get());
- if (mEnv->ExceptionCheck()) {
- return nullptr;
- }
- }
- return jarray;
- }
-
- template<class Class,
- bool (Self::*InValue_)(JS::HandleValue) const,
- typename Class::LocalRef (Self::*FromValue_)(JS::HandleValue)>
- struct BaseObjectProperty
- {
- // JNI class for the object type (e.g. jni::String)
- typedef Class ClassType;
-
- // See comments in PrimitiveProperty.
- typedef typename ClassType::LocalRef NativeType;
- typedef const typename ClassType::Ref NativeFallback;
- typedef typename jni::ObjectArray::LocalRef NativeArray;
- typedef const jni::ObjectArray::Ref ArrayFallback;
-
- typedef decltype(InValue_) InValue_t;
- static constexpr InValue_t InValue = InValue_;
-
- typedef decltype(FromValue_) FromValue_t;
- static constexpr FromValue_t FromValue = FromValue_;
-
- typedef decltype(&Self::ObjectNewArray<BaseObjectProperty>) NewArray_t;
- static constexpr NewArray_t NewArray
- = &Self::ObjectNewArray<BaseObjectProperty>;
- };
-
- // Array properties
-
- template<class Prop> bool
- ArrayInValue(JS::HandleValue val) const
- {
- if (!val.isObject()) {
- return false;
- }
- JS::RootedObject obj(mJSContext, &val.toObject());
- bool isArray;
- uint32_t length = 0;
- if (!JS_IsArrayObject(mJSContext, obj, &isArray) ||
- !isArray ||
- !JS_GetArrayLength(mJSContext, obj, &length)) {
- JS_ClearPendingException(mJSContext);
- return false;
- }
- if (!length) {
- // Empty arrays are always okay.
- return true;
- }
- // We only check to see the first element is the target type. If the
- // array has mixed types, we'll throw an error during actual conversion.
- JS::RootedValue element(mJSContext);
- if (!JS_GetElement(mJSContext, obj, 0, &element)) {
- JS_ClearPendingException(mJSContext);
- return false;
- }
- return (this->*Prop::InValue)(element);
- }
-
- template<class Prop> typename Prop::NativeArray
- ArrayFromValue(JS::HandleValue val)
- {
- JS::RootedObject obj(mJSContext, &val.toObject());
- uint32_t length = 0;
- if (!CheckJSCall(JS_GetArrayLength(mJSContext, obj, &length))) {
- return nullptr;
- }
- return (this->*Prop::NewArray)(obj, length);
- }
-
- template<class Prop>
- struct ArrayProperty
- {
- // See comments in PrimitiveProperty.
- typedef typename Prop::NativeArray NativeType;
- typedef typename Prop::ArrayFallback NativeFallback;
-
- typedef decltype(&Self::ArrayInValue<Prop>) InValue_t;
- static constexpr InValue_t InValue
- = &Self::ArrayInValue<Prop>;
-
- typedef decltype(&Self::ArrayFromValue<Prop>) FromValue_t;
- static constexpr FromValue_t FromValue
- = &Self::ArrayFromValue<Prop>;
- };
-
- // "Has" property is a special property type that is used to implement
- // NativeJSObject.has, by returning true from InValue and FromValue for
- // every existing property, and having false as the fallback value for
- // when a property doesn't exist.
-
- bool HasValue(JS::HandleValue val) const
- {
- return true;
- }
-
- struct HasProperty
- {
- // See comments in PrimitiveProperty.
- typedef bool NativeType;
- typedef bool NativeFallback;
-
- typedef decltype(&Self::HasValue) HasValue_t;
- static constexpr HasValue_t InValue = &Self::HasValue;
- static constexpr HasValue_t FromValue = &Self::HasValue;
- };
-
- // Statically cast from bool to jboolean (unsigned char); it works
- // since false and JNI_FALSE have the same value (0), and true and
- // JNI_TRUE have the same value (1).
- typedef PrimitiveProperty<
- bool, jni::BooleanArray, jboolean, jbooleanArray,
- &JS::Value::isBoolean, &JS::Value::toBoolean,
- &JNIEnv::NewBooleanArray, &JNIEnv::SetBooleanArrayRegion>
- BooleanProperty;
-
- typedef PrimitiveProperty<
- double, jni::DoubleArray, jdouble, jdoubleArray,
- &JS::Value::isNumber, &JS::Value::toNumber,
- &JNIEnv::NewDoubleArray, &JNIEnv::SetDoubleArrayRegion>
- DoubleProperty;
-
- typedef PrimitiveProperty<
- int32_t, jni::IntArray, jint, jintArray,
- &JS::Value::isInt32, &JS::Value::toInt32,
- &JNIEnv::NewIntArray, &JNIEnv::SetIntArrayRegion>
- IntProperty;
-
- typedef BaseObjectProperty<
- jni::String, &Self::StringInValue, &Self::StringFromValue>
- StringProperty;
-
- typedef BaseObjectProperty<
- sdk::Bundle, &Self::ObjectInValue, &Self::BundleFromValue>
- BundleProperty;
-
- typedef BaseObjectProperty<
- NativeJSObject, &Self::ObjectInValue, &Self::ObjectFromValue>
- ObjectProperty;
-
- typedef ArrayProperty<BooleanProperty> BooleanArrayProperty;
- typedef ArrayProperty<DoubleProperty> DoubleArrayProperty;
- typedef ArrayProperty<IntProperty> IntArrayProperty;
- typedef ArrayProperty<StringProperty> StringArrayProperty;
- typedef ArrayProperty<BundleProperty> BundleArrayProperty;
- typedef ArrayProperty<ObjectProperty> ObjectArrayProperty;
-
- template<class Prop>
- typename Prop::NativeType
- GetProperty(jni::String::Param name,
- typename Prop::NativeFallback* fallback = nullptr)
- {
- if (!CheckThread() || !CheckObject()) {
- return typename Prop::NativeType();
- }
-
- const JSJNIString nameStr(mEnv, name);
- JS::RootedValue val(mJSContext);
-
- if (!CheckJNIArgument(name) ||
- !CheckJSCall(JS_GetUCProperty(
- mJSContext, mJSObject, nameStr, nameStr.Length(), &val))) {
- return typename Prop::NativeType();
- }
-
- // Strictly, null is different from undefined in JS. However, in
- // practice, null is often used to indicate a property doesn't exist in
- // the same manner as undefined. Therefore, we treat null in the same
- // way as undefined when checking property existence (bug 1014965).
- if (val.isUndefined() || val.isNull()) {
- if (fallback) {
- return mozilla::Move(*fallback);
- }
- jni::ThrowException(
- "org/mozilla/gecko/util/NativeJSObject$InvalidPropertyException",
- "Property does not exist");
- return typename Prop::NativeType();
- }
-
- if (!CheckProperty(Prop::InValue, val)) {
- return typename Prop::NativeType();
- }
- return (this->*Prop::FromValue)(val);
- }
-
- NativeJSObject::LocalRef CreateChild(JS::HandleObject object)
- {
- auto instance = NativeJSObject::New();
- mozilla::UniquePtr<NativeJSContainerImpl> impl(
- new NativeJSContainerImpl(instance.Env(), mJSContext, object));
-
- ObjectBase::AttachNative(instance, mozilla::Move(impl));
- if (!mChildren.append(NativeJSObject::GlobalRef(instance))) {
- MOZ_CRASH();
- }
- return instance;
- }
-
- NativeJSContainerImpl(JNIEnv* env, JSContext* cx, JS::HandleObject object)
- : mEnv(env)
- , mJSContext(cx)
- , mJSObject(cx, object)
- {}
-
-public:
- ~NativeJSContainerImpl()
- {
- // Dispose of all children on destruction. The children will in turn
- // dispose any of their children (i.e. our grandchildren) and so on.
- NativeJSObject::LocalRef child(mEnv);
- for (size_t i = 0; i < mChildren.length(); i++) {
- child = mChildren[i];
- ObjectBase::GetNative(child)->ObjectBase::DisposeNative(child);
- }
- }
-
- static NativeJSContainer::LocalRef
- CreateInstance(JSContext* cx, JS::HandleObject object)
- {
- auto instance = NativeJSContainer::New();
- mozilla::UniquePtr<NativeJSContainerImpl> impl(
- new NativeJSContainerImpl(instance.Env(), cx, object));
-
- ContainerBase::AttachNative(instance, mozilla::Move(impl));
- return instance;
- }
-
- // NativeJSContainer methods
-
- void DisposeNative(const NativeJSContainer::LocalRef& instance)
- {
- if (!CheckThread()) {
- return;
- }
- ContainerBase::DisposeNative(instance);
- }
-
- NativeJSContainer::LocalRef Clone()
- {
- if (!CheckThread()) {
- return nullptr;
- }
- return CreateInstance(mJSContext, mJSObject);
- }
-
- // NativeJSObject methods
-
- bool GetBoolean(jni::String::Param name)
- {
- return GetProperty<BooleanProperty>(name);
- }
-
- bool OptBoolean(jni::String::Param name, bool fallback)
- {
- return GetProperty<BooleanProperty>(name, &fallback);
- }
-
- jni::BooleanArray::LocalRef
- GetBooleanArray(jni::String::Param name)
- {
- return GetProperty<BooleanArrayProperty>(name);
- }
-
- jni::BooleanArray::LocalRef
- OptBooleanArray(jni::String::Param name, jni::BooleanArray::Param fallback)
- {
- return GetProperty<BooleanArrayProperty>(name, &fallback);
- }
-
- jni::Object::LocalRef
- GetBundle(jni::String::Param name)
- {
- return GetProperty<BundleProperty>(name);
- }
-
- jni::Object::LocalRef
- OptBundle(jni::String::Param name, jni::Object::Param fallback)
- {
- // Because the GetProperty expects a sdk::Bundle::Param,
- // we have to do conversions here from jni::Object::Param.
- const auto& fb = sdk::Bundle::Ref::From(fallback.Get());
- return GetProperty<BundleProperty>(name, &fb);
- }
-
- jni::ObjectArray::LocalRef
- GetBundleArray(jni::String::Param name)
- {
- return GetProperty<BundleArrayProperty>(name);
- }
-
- jni::ObjectArray::LocalRef
- OptBundleArray(jni::String::Param name, jni::ObjectArray::Param fallback)
- {
- return GetProperty<BundleArrayProperty>(name, &fallback);
- }
-
- double GetDouble(jni::String::Param name)
- {
- return GetProperty<DoubleProperty>(name);
- }
-
- double OptDouble(jni::String::Param name, double fallback)
- {
- return GetProperty<DoubleProperty>(name, &fallback);
- }
-
- jni::DoubleArray::LocalRef
- GetDoubleArray(jni::String::Param name)
- {
- return GetProperty<DoubleArrayProperty>(name);
- }
-
- jni::DoubleArray::LocalRef
- OptDoubleArray(jni::String::Param name, jni::DoubleArray::Param fallback)
- {
- jni::DoubleArray::LocalRef fb(fallback);
- return GetProperty<DoubleArrayProperty>(name, &fb);
- }
-
- int GetInt(jni::String::Param name)
- {
- return GetProperty<IntProperty>(name);
- }
-
- int OptInt(jni::String::Param name, int fallback)
- {
- return GetProperty<IntProperty>(name, &fallback);
- }
-
- jni::IntArray::LocalRef
- GetIntArray(jni::String::Param name)
- {
- return GetProperty<IntArrayProperty>(name);
- }
-
- jni::IntArray::LocalRef
- OptIntArray(jni::String::Param name, jni::IntArray::Param fallback)
- {
- jni::IntArray::LocalRef fb(fallback);
- return GetProperty<IntArrayProperty>(name, &fb);
- }
-
- NativeJSObject::LocalRef
- GetObject(jni::String::Param name)
- {
- return GetProperty<ObjectProperty>(name);
- }
-
- NativeJSObject::LocalRef
- OptObject(jni::String::Param name, NativeJSObject::Param fallback)
- {
- return GetProperty<ObjectProperty>(name, &fallback);
- }
-
- jni::ObjectArray::LocalRef
- GetObjectArray(jni::String::Param name)
- {
- return GetProperty<ObjectArrayProperty>(name);
- }
-
- jni::ObjectArray::LocalRef
- OptObjectArray(jni::String::Param name, jni::ObjectArray::Param fallback)
- {
- return GetProperty<ObjectArrayProperty>(name, &fallback);
- }
-
- jni::String::LocalRef
- GetString(jni::String::Param name)
- {
- return GetProperty<StringProperty>(name);
- }
-
- jni::String::LocalRef
- OptString(jni::String::Param name, jni::String::Param fallback)
- {
- return GetProperty<StringProperty>(name, &fallback);
- }
-
- jni::ObjectArray::LocalRef
- GetStringArray(jni::String::Param name)
- {
- return GetProperty<StringArrayProperty>(name);
- }
-
- jni::ObjectArray::LocalRef
- OptStringArray(jni::String::Param name, jni::ObjectArray::Param fallback)
- {
- return GetProperty<StringArrayProperty>(name, &fallback);
- }
-
- bool Has(jni::String::Param name)
- {
- bool no = false;
- // Fallback to false indicating no such property.
- return GetProperty<HasProperty>(name, &no);
- }
-
- jni::Object::LocalRef ToBundle()
- {
- if (!CheckThread() || !CheckObject()) {
- return nullptr;
- }
- return BundleFromValue(mJSObject);
- }
-
-private:
- static bool AppendJSON(const char16_t* buf, uint32_t len, void* data)
- {
- static_cast<nsAutoString*>(data)->Append(buf, len);
- return true;
- }
-
-public:
- jni::String::LocalRef ToString()
- {
- if (!CheckThread() || !CheckObject()) {
- return nullptr;
- }
-
- JS::RootedValue value(mJSContext, JS::ObjectValue(*mJSObject));
- nsAutoString json;
- if (!CheckJSCall(JS_Stringify(mJSContext, &value, nullptr,
- JS::NullHandleValue, AppendJSON, &json))) {
- return nullptr;
- }
- return jni::StringParam(json, mEnv);
- }
-};
-
-
-// Define the "static constexpr" members of our property types (e.g.
-// PrimitiveProperty<>::InValue). This is tricky because there are a lot of
-// template parameters, so we use macros to make it simpler.
-
-#define DEFINE_PRIMITIVE_PROPERTY_MEMBER(Name) \
- template<typename U, typename UA, typename V, typename VA, \
- bool (JS::Value::*I)() const, \
- U (JS::Value::*T)() const, \
- VA (JNIEnv::*N)(jsize), \
- void (JNIEnv::*S)(VA, jsize, jsize, const V*)> \
- constexpr typename NativeJSContainerImpl \
- ::PrimitiveProperty<U, UA, V, VA, I, T, N, S>::Name##_t \
- NativeJSContainerImpl::PrimitiveProperty<U, UA, V, VA, I, T, N, S>::Name
-
-DEFINE_PRIMITIVE_PROPERTY_MEMBER(NewJNIArray);
-DEFINE_PRIMITIVE_PROPERTY_MEMBER(SetJNIArrayRegion);
-DEFINE_PRIMITIVE_PROPERTY_MEMBER(InValue);
-DEFINE_PRIMITIVE_PROPERTY_MEMBER(FromValue);
-DEFINE_PRIMITIVE_PROPERTY_MEMBER(NewArray);
-
-#undef DEFINE_PRIMITIVE_PROPERTY_MEMBER
-
-#define DEFINE_OBJECT_PROPERTY_MEMBER(Name) \
- template<class C, \
- bool (NativeJSContainerImpl::*I)(JS::HandleValue) const, \
- typename C::LocalRef (NativeJSContainerImpl::*F)(JS::HandleValue)> \
- constexpr typename NativeJSContainerImpl \
- ::BaseObjectProperty<C, I, F>::Name##_t \
- NativeJSContainerImpl::BaseObjectProperty<C, I, F>::Name
-
-DEFINE_OBJECT_PROPERTY_MEMBER(InValue);
-DEFINE_OBJECT_PROPERTY_MEMBER(FromValue);
-DEFINE_OBJECT_PROPERTY_MEMBER(NewArray);
-
-#undef DEFINE_OBJECT_PROPERTY_MEMBER
-
-template<class P> constexpr typename NativeJSContainerImpl::ArrayProperty<P>
- ::InValue_t NativeJSContainerImpl::ArrayProperty<P>::InValue;
-template<class P> constexpr typename NativeJSContainerImpl::ArrayProperty<P>
- ::FromValue_t NativeJSContainerImpl::ArrayProperty<P>::FromValue;
-
-constexpr NativeJSContainerImpl::HasProperty::HasValue_t
- NativeJSContainerImpl::HasProperty::InValue;
-constexpr NativeJSContainerImpl::HasProperty::HasValue_t
- NativeJSContainerImpl::HasProperty::FromValue;
-
-
-NativeJSContainer::LocalRef
-CreateNativeJSContainer(JSContext* cx, JS::HandleObject object)
-{
- return NativeJSContainerImpl::CreateInstance(cx, object);
-}
-
-} // namespace widget
-} // namespace mozilla
-
diff --git a/widget/android/NativeJSContainer.h b/widget/android/NativeJSContainer.h
deleted file mode 100644
index bebf75f1b..000000000
--- a/widget/android/NativeJSContainer.h
+++ /dev/null
@@ -1,22 +0,0 @@
-/* -*- Mode: c++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef NativeJSObject_h__
-#define NativeJSObject_h__
-
-#include "GeneratedJNIWrappers.h"
-#include "jsapi.h"
-
-namespace mozilla {
-namespace widget {
-
-java::NativeJSContainer::LocalRef
-CreateNativeJSContainer(JSContext* cx, JS::HandleObject object);
-
-} // namespace widget
-} // namespace mozilla
-
-#endif // NativeJSObject_h__
-
diff --git a/widget/android/PrefsHelper.h b/widget/android/PrefsHelper.h
deleted file mode 100644
index b053c979a..000000000
--- a/widget/android/PrefsHelper.h
+++ /dev/null
@@ -1,324 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef PrefsHelper_h
-#define PrefsHelper_h
-
-#include "GeneratedJNINatives.h"
-#include "MainThreadUtils.h"
-#include "nsAppShell.h"
-#include "nsCOMPtr.h"
-#include "nsVariant.h"
-
-#include "mozilla/Preferences.h"
-#include "mozilla/Services.h"
-
-namespace mozilla {
-
-class PrefsHelper
- : public java::PrefsHelper::Natives<PrefsHelper>
-{
- PrefsHelper() = delete;
-
- static bool GetVariantPref(nsIObserverService* aObsServ,
- nsIWritableVariant* aVariant,
- jni::Object::Param aPrefHandler,
- const jni::String::LocalRef& aPrefName)
- {
- if (NS_FAILED(aObsServ->NotifyObservers(aVariant, "android-get-pref",
- aPrefName->ToString().get()))) {
- return false;
- }
-
- uint16_t varType = nsIDataType::VTYPE_EMPTY;
- if (NS_FAILED(aVariant->GetDataType(&varType))) {
- return false;
- }
-
- int32_t type = java::PrefsHelper::PREF_INVALID;
- bool boolVal = false;
- int32_t intVal = 0;
- nsAutoString strVal;
-
- switch (varType) {
- case nsIDataType::VTYPE_BOOL:
- type = java::PrefsHelper::PREF_BOOL;
- if (NS_FAILED(aVariant->GetAsBool(&boolVal))) {
- return false;
- }
- break;
- case nsIDataType::VTYPE_INT32:
- type = java::PrefsHelper::PREF_INT;
- if (NS_FAILED(aVariant->GetAsInt32(&intVal))) {
- return false;
- }
- break;
- case nsIDataType::VTYPE_ASTRING:
- type = java::PrefsHelper::PREF_STRING;
- if (NS_FAILED(aVariant->GetAsAString(strVal))) {
- return false;
- }
- break;
- default:
- return false;
- }
-
- jni::StringParam jstrVal(type == java::PrefsHelper::PREF_STRING ?
- jni::StringParam(strVal, aPrefName.Env()) :
- jni::StringParam(nullptr));
-
- if (aPrefHandler) {
- java::PrefsHelper::CallPrefHandler(
- aPrefHandler, type, aPrefName,
- boolVal, intVal, jstrVal);
- } else {
- java::PrefsHelper::OnPrefChange(
- aPrefName, type, boolVal, intVal, jstrVal);
- }
- return true;
- }
-
- static bool SetVariantPref(nsIObserverService* aObsServ,
- nsIWritableVariant* aVariant,
- jni::String::Param aPrefName,
- bool aFlush,
- int32_t aType,
- bool aBoolVal,
- int32_t aIntVal,
- jni::String::Param aStrVal)
- {
- nsresult rv = NS_ERROR_FAILURE;
-
- switch (aType) {
- case java::PrefsHelper::PREF_BOOL:
- rv = aVariant->SetAsBool(aBoolVal);
- break;
- case java::PrefsHelper::PREF_INT:
- rv = aVariant->SetAsInt32(aIntVal);
- break;
- case java::PrefsHelper::PREF_STRING:
- rv = aVariant->SetAsAString(aStrVal->ToString());
- break;
- }
-
- if (NS_SUCCEEDED(rv)) {
- rv = aObsServ->NotifyObservers(aVariant, "android-set-pref",
- aPrefName->ToString().get());
- }
-
- uint16_t varType = nsIDataType::VTYPE_EMPTY;
- if (NS_SUCCEEDED(rv)) {
- rv = aVariant->GetDataType(&varType);
- }
-
- // We use set-to-empty to signal the pref was handled.
- const bool handled = varType == nsIDataType::VTYPE_EMPTY;
-
- if (NS_SUCCEEDED(rv) && handled && aFlush) {
- rv = Preferences::GetService()->SavePrefFile(nullptr);
- }
-
- if (NS_SUCCEEDED(rv)) {
- return handled;
- }
-
- NS_WARNING(nsPrintfCString("Failed to set pref %s",
- aPrefName->ToCString().get()).get());
- // Pretend we handled the pref.
- return true;
- }
-
-public:
- static void GetPrefs(const jni::Class::LocalRef& aCls,
- jni::ObjectArray::Param aPrefNames,
- jni::Object::Param aPrefHandler)
- {
- nsTArray<jni::Object::LocalRef> nameRefArray(aPrefNames->GetElements());
- nsCOMPtr<nsIObserverService> obsServ;
- nsCOMPtr<nsIWritableVariant> value;
- nsAdoptingString strVal;
-
- for (jni::Object::LocalRef& nameRef : nameRefArray) {
- jni::String::LocalRef nameStr(mozilla::Move(nameRef));
- const nsCString& name = nameStr->ToCString();
-
- int32_t type = java::PrefsHelper::PREF_INVALID;
- bool boolVal = false;
- int32_t intVal = 0;
-
- switch (Preferences::GetType(name.get())) {
- case nsIPrefBranch::PREF_BOOL:
- type = java::PrefsHelper::PREF_BOOL;
- boolVal = Preferences::GetBool(name.get());
- break;
-
- case nsIPrefBranch::PREF_INT:
- type = java::PrefsHelper::PREF_INT;
- intVal = Preferences::GetInt(name.get());
- break;
-
- case nsIPrefBranch::PREF_STRING:
- type = java::PrefsHelper::PREF_STRING;
- strVal = Preferences::GetLocalizedString(name.get());
- if (!strVal) {
- strVal = Preferences::GetString(name.get());
- }
- break;
-
- default:
- // Pref not found; try to find it.
- if (!obsServ) {
- obsServ = services::GetObserverService();
- if (!obsServ) {
- continue;
- }
- }
- if (value) {
- value->SetAsEmpty();
- } else {
- value = new nsVariant();
- }
- if (!GetVariantPref(obsServ, value,
- aPrefHandler, nameStr)) {
- NS_WARNING(nsPrintfCString("Failed to get pref %s",
- name.get()).get());
- }
- continue;
- }
-
- java::PrefsHelper::CallPrefHandler(
- aPrefHandler, type, nameStr, boolVal, intVal,
- jni::StringParam(type == java::PrefsHelper::PREF_STRING ?
- jni::StringParam(strVal, aCls.Env()) :
- jni::StringParam(nullptr)));
- }
-
- java::PrefsHelper::CallPrefHandler(
- aPrefHandler, java::PrefsHelper::PREF_FINISH,
- nullptr, false, 0, nullptr);
- }
-
- static void SetPref(jni::String::Param aPrefName,
- bool aFlush,
- int32_t aType,
- bool aBoolVal,
- int32_t aIntVal,
- jni::String::Param aStrVal)
- {
- const nsCString& name = aPrefName->ToCString();
-
- if (Preferences::GetType(name.get()) == nsIPrefBranch::PREF_INVALID) {
- // No pref; try asking first.
- nsCOMPtr<nsIObserverService> obsServ =
- services::GetObserverService();
- nsCOMPtr<nsIWritableVariant> value = new nsVariant();
- if (obsServ && SetVariantPref(obsServ, value, aPrefName, aFlush,
- aType, aBoolVal, aIntVal, aStrVal)) {
- // The "pref" has changed; send a notification.
- GetVariantPref(obsServ, value, nullptr,
- jni::String::LocalRef(aPrefName));
- return;
- }
- }
-
- switch (aType) {
- case java::PrefsHelper::PREF_BOOL:
- Preferences::SetBool(name.get(), aBoolVal);
- break;
- case java::PrefsHelper::PREF_INT:
- Preferences::SetInt(name.get(), aIntVal);
- break;
- case java::PrefsHelper::PREF_STRING:
- Preferences::SetString(name.get(), aStrVal->ToString());
- break;
- default:
- MOZ_ASSERT(false, "Invalid pref type");
- }
-
- if (aFlush) {
- Preferences::GetService()->SavePrefFile(nullptr);
- }
- }
-
- static void AddObserver(const jni::Class::LocalRef& aCls,
- jni::ObjectArray::Param aPrefNames,
- jni::Object::Param aPrefHandler,
- jni::ObjectArray::Param aPrefsToObserve)
- {
- // Call observer immediately with existing pref values.
- GetPrefs(aCls, aPrefNames, aPrefHandler);
-
- if (!aPrefsToObserve) {
- return;
- }
-
- nsTArray<jni::Object::LocalRef> nameRefArray(
- aPrefsToObserve->GetElements());
- nsAppShell* const appShell = nsAppShell::Get();
- MOZ_ASSERT(appShell);
-
- for (jni::Object::LocalRef& nameRef : nameRefArray) {
- jni::String::LocalRef nameStr(mozilla::Move(nameRef));
- MOZ_ALWAYS_SUCCEEDS(Preferences::AddStrongObserver(
- appShell, nameStr->ToCString().get()));
- }
- }
-
- static void RemoveObserver(const jni::Class::LocalRef& aCls,
- jni::ObjectArray::Param aPrefsToUnobserve)
- {
- nsTArray<jni::Object::LocalRef> nameRefArray(
- aPrefsToUnobserve->GetElements());
- nsAppShell* const appShell = nsAppShell::Get();
- MOZ_ASSERT(appShell);
-
- for (jni::Object::LocalRef& nameRef : nameRefArray) {
- jni::String::LocalRef nameStr(mozilla::Move(nameRef));
- MOZ_ALWAYS_SUCCEEDS(Preferences::RemoveObserver(
- appShell, nameStr->ToCString().get()));
- }
- }
-
- static void OnPrefChange(const char16_t* aData)
- {
- const nsCString& name = NS_LossyConvertUTF16toASCII(aData);
-
- int32_t type = -1;
- bool boolVal = false;
- int32_t intVal = false;
- nsAdoptingString strVal;
-
- switch (Preferences::GetType(name.get())) {
- case nsIPrefBranch::PREF_BOOL:
- type = java::PrefsHelper::PREF_BOOL;
- boolVal = Preferences::GetBool(name.get());
- break;
- case nsIPrefBranch::PREF_INT:
- type = java::PrefsHelper::PREF_INT;
- intVal = Preferences::GetInt(name.get());
- break;
- case nsIPrefBranch::PREF_STRING:
- type = java::PrefsHelper::PREF_STRING;
- strVal = Preferences::GetLocalizedString(name.get());
- if (!strVal) {
- strVal = Preferences::GetString(name.get());
- }
- break;
- default:
- NS_WARNING(nsPrintfCString("Invalid pref %s",
- name.get()).get());
- return;
- }
-
- java::PrefsHelper::OnPrefChange(
- name, type, boolVal, intVal,
- jni::StringParam(type == java::PrefsHelper::PREF_STRING ?
- jni::StringParam(strVal) : jni::StringParam(nullptr)));
- }
-};
-
-} // namespace
-
-#endif // PrefsHelper_h
diff --git a/widget/android/bindings/AndroidRect-classes.txt b/widget/android/bindings/AndroidRect-classes.txt
deleted file mode 100644
index cbacca81e..000000000
--- a/widget/android/bindings/AndroidRect-classes.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-android.graphics.Rect
-android.graphics.RectF
diff --git a/widget/android/bindings/Bundle-classes.txt b/widget/android/bindings/Bundle-classes.txt
deleted file mode 100644
index 9f535cddb..000000000
--- a/widget/android/bindings/Bundle-classes.txt
+++ /dev/null
@@ -1 +0,0 @@
-android.os.Bundle
diff --git a/widget/android/bindings/KeyEvent-classes.txt b/widget/android/bindings/KeyEvent-classes.txt
deleted file mode 100644
index b73e621ef..000000000
--- a/widget/android/bindings/KeyEvent-classes.txt
+++ /dev/null
@@ -1 +0,0 @@
-android.view.KeyEvent
diff --git a/widget/android/bindings/Makefile.in b/widget/android/bindings/Makefile.in
deleted file mode 100644
index ea66e6022..000000000
--- a/widget/android/bindings/Makefile.in
+++ /dev/null
@@ -1,27 +0,0 @@
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# Bug 1099345 - The SDK's lint code (used by the code generator) does not enjoy
-# concurrent access to a cache that it generates.
-.NOTPARALLEL:
-
-annotation_processor_jar_files := \
- $(DEPTH)/build/annotationProcessors/annotationProcessors.jar \
- $(ANDROID_TOOLS)/lib/lint.jar \
- $(ANDROID_TOOLS)/lib/lint-checks.jar \
- $(NULL)
-
-sdk_processor := \
- $(JAVA) \
- -Dcom.android.tools.lint.bindir='$(ANDROID_TOOLS)' \
- -classpath $(subst $(NULL) ,:,$(strip $(annotation_processor_jar_files))) \
- org.mozilla.gecko.annotationProcessors.SDKProcessor
-
-# For the benefit of readers: the following pattern rule says that,
-# for example, MediaCodec.cpp and MediaCodec.h can be produced from
-# MediaCodec-classes.txt. This formulation invokes the SDK processor
-# at most once.
-
-%.cpp %.h: $(ANDROID_SDK)/android.jar %-classes.txt $(annotation_processor_jar_files)
- $(sdk_processor) $(ANDROID_SDK)/android.jar $(srcdir)/$*-classes.txt $(CURDIR) $* 16
diff --git a/widget/android/bindings/MediaCodec-classes.txt b/widget/android/bindings/MediaCodec-classes.txt
deleted file mode 100644
index ea26029af..000000000
--- a/widget/android/bindings/MediaCodec-classes.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-android.media.MediaCodec
-android.media.MediaCodec$BufferInfo
-android.media.MediaCodec$CryptoInfo
-android.media.MediaDrm$KeyStatus
-android.media.MediaFormat
diff --git a/widget/android/bindings/MotionEvent-classes.txt b/widget/android/bindings/MotionEvent-classes.txt
deleted file mode 100644
index dd38dc000..000000000
--- a/widget/android/bindings/MotionEvent-classes.txt
+++ /dev/null
@@ -1 +0,0 @@
-android.view.MotionEvent
diff --git a/widget/android/bindings/SurfaceTexture-classes.txt b/widget/android/bindings/SurfaceTexture-classes.txt
deleted file mode 100644
index 5c7ca8968..000000000
--- a/widget/android/bindings/SurfaceTexture-classes.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-android.graphics.SurfaceTexture
-android.view.Surface
diff --git a/widget/android/bindings/ViewConfiguration-classes.txt b/widget/android/bindings/ViewConfiguration-classes.txt
deleted file mode 100644
index e6601e65f..000000000
--- a/widget/android/bindings/ViewConfiguration-classes.txt
+++ /dev/null
@@ -1 +0,0 @@
-android.view.ViewConfiguration
diff --git a/widget/android/bindings/moz.build b/widget/android/bindings/moz.build
deleted file mode 100644
index 1bd71fa95..000000000
--- a/widget/android/bindings/moz.build
+++ /dev/null
@@ -1,41 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-# List of stems to generate .cpp and .h files for. To add a stem, add it to
-# this list and ensure that $(stem)-classes.txt exists in this directory.
-generated = [
- 'AndroidRect',
- 'Bundle',
- 'KeyEvent',
- 'MediaCodec',
- 'MotionEvent',
- 'SurfaceTexture',
- 'ViewConfiguration'
-]
-
-SOURCES += ['!%s.cpp' % stem for stem in generated]
-
-EXPORTS += ['!%s.h' % stem for stem in generated]
-
-# We'd like to add these to a future GENERATED_EXPORTS list, but for now we mark
-# them as generated here and manually install them in Makefile.in.
-GENERATED_FILES += [stem + '.h' for stem in generated]
-
-# There is an unfortunate race condition when using generated SOURCES and
-# pattern rules (see Makefile.in) that manifests itself as a VPATH resolution
-# conflict: MediaCodec.o looks for MediaCodec.cpp and $(CURDIR)/MediaCodec.cpp,
-# and the pattern rule is matched but doesn't resolve both sources, causing a
-# failure. Adding the SOURCES to GENERATED_FILES causes the sources
-# to be built at export time, which is before MediaCodec.o needs them; and by
-# the time MediaCodec.o is built, the source is in place and the VPATH
-# resolution works as expected.
-GENERATED_FILES += [f[1:] for f in SOURCES]
-
-FINAL_LIBRARY = 'xul'
-
-LOCAL_INCLUDES += [
- '/widget/android',
-]
diff --git a/widget/android/fennec/FennecJNINatives.h b/widget/android/fennec/FennecJNINatives.h
deleted file mode 100644
index 9d0cdd77c..000000000
--- a/widget/android/fennec/FennecJNINatives.h
+++ /dev/null
@@ -1,244 +0,0 @@
-// GENERATED CODE
-// Generated by the Java program at /build/annotationProcessors at compile time
-// from annotations on Java methods. To update, change the annotations on the
-// corresponding Java methods and rerun the build. Manually updating this file
-// will cause your build to fail.
-
-#ifndef FennecJNINatives_h
-#define FennecJNINatives_h
-
-#include "FennecJNIWrappers.h"
-#include "mozilla/jni/Natives.h"
-
-namespace mozilla {
-namespace java {
-
-template<class Impl>
-class ANRReporter::Natives : public mozilla::jni::NativeImpl<ANRReporter, Impl>
-{
-public:
- static const JNINativeMethod methods[3];
-};
-
-template<class Impl>
-const JNINativeMethod ANRReporter::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<ANRReporter::GetNativeStack_t>(
- mozilla::jni::NativeStub<ANRReporter::GetNativeStack_t, Impl>
- ::template Wrap<&Impl::GetNativeStack>),
-
- mozilla::jni::MakeNativeMethod<ANRReporter::ReleaseNativeStack_t>(
- mozilla::jni::NativeStub<ANRReporter::ReleaseNativeStack_t, Impl>
- ::template Wrap<&Impl::ReleaseNativeStack>),
-
- mozilla::jni::MakeNativeMethod<ANRReporter::RequestNativeStack_t>(
- mozilla::jni::NativeStub<ANRReporter::RequestNativeStack_t, Impl>
- ::template Wrap<&Impl::RequestNativeStack>)
-};
-
-template<class Impl>
-class GeckoJavaSampler::Natives : public mozilla::jni::NativeImpl<GeckoJavaSampler, Impl>
-{
-public:
- static const JNINativeMethod methods[1];
-};
-
-template<class Impl>
-const JNINativeMethod GeckoJavaSampler::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<GeckoJavaSampler::GetProfilerTime_t>(
- mozilla::jni::NativeStub<GeckoJavaSampler::GetProfilerTime_t, Impl>
- ::template Wrap<&Impl::GetProfilerTime>)
-};
-
-template<class Impl>
-class MemoryMonitor::Natives : public mozilla::jni::NativeImpl<MemoryMonitor, Impl>
-{
-public:
- static const JNINativeMethod methods[1];
-};
-
-template<class Impl>
-const JNINativeMethod MemoryMonitor::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<MemoryMonitor::DispatchMemoryPressure_t>(
- mozilla::jni::NativeStub<MemoryMonitor::DispatchMemoryPressure_t, Impl>
- ::template Wrap<&Impl::DispatchMemoryPressure>)
-};
-
-template<class Impl>
-class PresentationMediaPlayerManager::Natives : public mozilla::jni::NativeImpl<PresentationMediaPlayerManager, Impl>
-{
-public:
- static const JNINativeMethod methods[3];
-};
-
-template<class Impl>
-const JNINativeMethod PresentationMediaPlayerManager::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<PresentationMediaPlayerManager::AddPresentationSurface_t>(
- mozilla::jni::NativeStub<PresentationMediaPlayerManager::AddPresentationSurface_t, Impl>
- ::template Wrap<&Impl::AddPresentationSurface>),
-
- mozilla::jni::MakeNativeMethod<PresentationMediaPlayerManager::InvalidateAndScheduleComposite_t>(
- mozilla::jni::NativeStub<PresentationMediaPlayerManager::InvalidateAndScheduleComposite_t, Impl>
- ::template Wrap<&Impl::InvalidateAndScheduleComposite>),
-
- mozilla::jni::MakeNativeMethod<PresentationMediaPlayerManager::RemovePresentationSurface_t>(
- mozilla::jni::NativeStub<PresentationMediaPlayerManager::RemovePresentationSurface_t, Impl>
- ::template Wrap<&Impl::RemovePresentationSurface>)
-};
-
-template<class Impl>
-class ScreenManagerHelper::Natives : public mozilla::jni::NativeImpl<ScreenManagerHelper, Impl>
-{
-public:
- static const JNINativeMethod methods[2];
-};
-
-template<class Impl>
-const JNINativeMethod ScreenManagerHelper::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<ScreenManagerHelper::AddDisplay_t>(
- mozilla::jni::NativeStub<ScreenManagerHelper::AddDisplay_t, Impl>
- ::template Wrap<&Impl::AddDisplay>),
-
- mozilla::jni::MakeNativeMethod<ScreenManagerHelper::RemoveDisplay_t>(
- mozilla::jni::NativeStub<ScreenManagerHelper::RemoveDisplay_t, Impl>
- ::template Wrap<&Impl::RemoveDisplay>)
-};
-
-template<class Impl>
-class Telemetry::Natives : public mozilla::jni::NativeImpl<Telemetry, Impl>
-{
-public:
- static const JNINativeMethod methods[5];
-};
-
-template<class Impl>
-const JNINativeMethod Telemetry::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<Telemetry::AddHistogram_t>(
- mozilla::jni::NativeStub<Telemetry::AddHistogram_t, Impl>
- ::template Wrap<&Impl::AddHistogram>),
-
- mozilla::jni::MakeNativeMethod<Telemetry::AddKeyedHistogram_t>(
- mozilla::jni::NativeStub<Telemetry::AddKeyedHistogram_t, Impl>
- ::template Wrap<&Impl::AddKeyedHistogram>),
-
- mozilla::jni::MakeNativeMethod<Telemetry::AddUIEvent_t>(
- mozilla::jni::NativeStub<Telemetry::AddUIEvent_t, Impl>
- ::template Wrap<&Impl::AddUIEvent>),
-
- mozilla::jni::MakeNativeMethod<Telemetry::StartUISession_t>(
- mozilla::jni::NativeStub<Telemetry::StartUISession_t, Impl>
- ::template Wrap<&Impl::StartUISession>),
-
- mozilla::jni::MakeNativeMethod<Telemetry::StopUISession_t>(
- mozilla::jni::NativeStub<Telemetry::StopUISession_t, Impl>
- ::template Wrap<&Impl::StopUISession>)
-};
-
-template<class Impl>
-class ThumbnailHelper::Natives : public mozilla::jni::NativeImpl<ThumbnailHelper, Impl>
-{
-public:
- static const JNINativeMethod methods[1];
-};
-
-template<class Impl>
-const JNINativeMethod ThumbnailHelper::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<ThumbnailHelper::RequestThumbnail_t>(
- mozilla::jni::NativeStub<ThumbnailHelper::RequestThumbnail_t, Impl>
- ::template Wrap<&Impl::RequestThumbnail>)
-};
-
-template<class Impl>
-class ZoomedView::Natives : public mozilla::jni::NativeImpl<ZoomedView, Impl>
-{
-public:
- static const JNINativeMethod methods[1];
-};
-
-template<class Impl>
-const JNINativeMethod ZoomedView::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<ZoomedView::RequestZoomedViewData_t>(
- mozilla::jni::NativeStub<ZoomedView::RequestZoomedViewData_t, Impl>
- ::template Wrap<&Impl::RequestZoomedViewData>)
-};
-
-template<class Impl>
-class CodecProxy::NativeCallbacks::Natives : public mozilla::jni::NativeImpl<NativeCallbacks, Impl>
-{
-public:
- static const JNINativeMethod methods[5];
-};
-
-template<class Impl>
-const JNINativeMethod CodecProxy::NativeCallbacks::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<CodecProxy::NativeCallbacks::DisposeNative_t>(
- mozilla::jni::NativeStub<CodecProxy::NativeCallbacks::DisposeNative_t, Impl>
- ::template Wrap<&Impl::DisposeNative>),
-
- mozilla::jni::MakeNativeMethod<CodecProxy::NativeCallbacks::OnError_t>(
- mozilla::jni::NativeStub<CodecProxy::NativeCallbacks::OnError_t, Impl>
- ::template Wrap<&Impl::OnError>),
-
- mozilla::jni::MakeNativeMethod<CodecProxy::NativeCallbacks::OnInputExhausted_t>(
- mozilla::jni::NativeStub<CodecProxy::NativeCallbacks::OnInputExhausted_t, Impl>
- ::template Wrap<&Impl::OnInputExhausted>),
-
- mozilla::jni::MakeNativeMethod<CodecProxy::NativeCallbacks::OnOutput_t>(
- mozilla::jni::NativeStub<CodecProxy::NativeCallbacks::OnOutput_t, Impl>
- ::template Wrap<&Impl::OnOutput>),
-
- mozilla::jni::MakeNativeMethod<CodecProxy::NativeCallbacks::OnOutputFormatChanged_t>(
- mozilla::jni::NativeStub<CodecProxy::NativeCallbacks::OnOutputFormatChanged_t, Impl>
- ::template Wrap<&Impl::OnOutputFormatChanged>)
-};
-
-template<class Impl>
-class MediaDrmProxy::NativeMediaDrmProxyCallbacks::Natives : public mozilla::jni::NativeImpl<NativeMediaDrmProxyCallbacks, Impl>
-{
-public:
- static const JNINativeMethod methods[7];
-};
-
-template<class Impl>
-const JNINativeMethod MediaDrmProxy::NativeMediaDrmProxyCallbacks::Natives<Impl>::methods[] = {
-
- mozilla::jni::MakeNativeMethod<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnRejectPromise_t>(
- mozilla::jni::NativeStub<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnRejectPromise_t, Impl>
- ::template Wrap<&Impl::OnRejectPromise>),
-
- mozilla::jni::MakeNativeMethod<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionBatchedKeyChanged_t>(
- mozilla::jni::NativeStub<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionBatchedKeyChanged_t, Impl>
- ::template Wrap<&Impl::OnSessionBatchedKeyChanged>),
-
- mozilla::jni::MakeNativeMethod<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionClosed_t>(
- mozilla::jni::NativeStub<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionClosed_t, Impl>
- ::template Wrap<&Impl::OnSessionClosed>),
-
- mozilla::jni::MakeNativeMethod<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionCreated_t>(
- mozilla::jni::NativeStub<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionCreated_t, Impl>
- ::template Wrap<&Impl::OnSessionCreated>),
-
- mozilla::jni::MakeNativeMethod<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionError_t>(
- mozilla::jni::NativeStub<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionError_t, Impl>
- ::template Wrap<&Impl::OnSessionError>),
-
- mozilla::jni::MakeNativeMethod<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionMessage_t>(
- mozilla::jni::NativeStub<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionMessage_t, Impl>
- ::template Wrap<&Impl::OnSessionMessage>),
-
- mozilla::jni::MakeNativeMethod<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionUpdated_t>(
- mozilla::jni::NativeStub<MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionUpdated_t, Impl>
- ::template Wrap<&Impl::OnSessionUpdated>)
-};
-
-} /* java */
-} /* mozilla */
-#endif // FennecJNINatives_h
diff --git a/widget/android/fennec/FennecJNIWrappers.cpp b/widget/android/fennec/FennecJNIWrappers.cpp
deleted file mode 100644
index f8be6833b..000000000
--- a/widget/android/fennec/FennecJNIWrappers.cpp
+++ /dev/null
@@ -1,443 +0,0 @@
-// GENERATED CODE
-// Generated by the Java program at /build/annotationProcessors at compile time
-// from annotations on Java methods. To update, change the annotations on the
-// corresponding Java methods and rerun the build. Manually updating this file
-// will cause your build to fail.
-
-#include "FennecJNIWrappers.h"
-#include "mozilla/jni/Accessors.h"
-
-namespace mozilla {
-namespace java {
-
-const char ANRReporter::name[] =
- "org/mozilla/gecko/ANRReporter";
-
-constexpr char ANRReporter::GetNativeStack_t::name[];
-constexpr char ANRReporter::GetNativeStack_t::signature[];
-
-constexpr char ANRReporter::ReleaseNativeStack_t::name[];
-constexpr char ANRReporter::ReleaseNativeStack_t::signature[];
-
-constexpr char ANRReporter::RequestNativeStack_t::name[];
-constexpr char ANRReporter::RequestNativeStack_t::signature[];
-
-const char DownloadsIntegration::name[] =
- "org/mozilla/gecko/DownloadsIntegration";
-
-constexpr char DownloadsIntegration::GetTemporaryDownloadDirectory_t::name[];
-constexpr char DownloadsIntegration::GetTemporaryDownloadDirectory_t::signature[];
-
-auto DownloadsIntegration::GetTemporaryDownloadDirectory() -> mozilla::jni::String::LocalRef
-{
- return mozilla::jni::Method<GetTemporaryDownloadDirectory_t>::Call(DownloadsIntegration::Context(), nullptr);
-}
-
-constexpr char DownloadsIntegration::ScanMedia_t::name[];
-constexpr char DownloadsIntegration::ScanMedia_t::signature[];
-
-auto DownloadsIntegration::ScanMedia(mozilla::jni::String::Param a0, mozilla::jni::String::Param a1) -> void
-{
- return mozilla::jni::Method<ScanMedia_t>::Call(DownloadsIntegration::Context(), nullptr, a0, a1);
-}
-
-const char GeckoJavaSampler::name[] =
- "org/mozilla/gecko/GeckoJavaSampler";
-
-constexpr char GeckoJavaSampler::GetFrameName_t::name[];
-constexpr char GeckoJavaSampler::GetFrameName_t::signature[];
-
-auto GeckoJavaSampler::GetFrameName(int32_t a0, int32_t a1, int32_t a2) -> mozilla::jni::String::LocalRef
-{
- return mozilla::jni::Method<GetFrameName_t>::Call(GeckoJavaSampler::Context(), nullptr, a0, a1, a2);
-}
-
-constexpr char GeckoJavaSampler::GetProfilerTime_t::name[];
-constexpr char GeckoJavaSampler::GetProfilerTime_t::signature[];
-
-constexpr char GeckoJavaSampler::GetSampleTime_t::name[];
-constexpr char GeckoJavaSampler::GetSampleTime_t::signature[];
-
-auto GeckoJavaSampler::GetSampleTime(int32_t a0, int32_t a1) -> double
-{
- return mozilla::jni::Method<GetSampleTime_t>::Call(GeckoJavaSampler::Context(), nullptr, a0, a1);
-}
-
-constexpr char GeckoJavaSampler::GetThreadName_t::name[];
-constexpr char GeckoJavaSampler::GetThreadName_t::signature[];
-
-auto GeckoJavaSampler::GetThreadName(int32_t a0) -> mozilla::jni::String::LocalRef
-{
- return mozilla::jni::Method<GetThreadName_t>::Call(GeckoJavaSampler::Context(), nullptr, a0);
-}
-
-constexpr char GeckoJavaSampler::Pause_t::name[];
-constexpr char GeckoJavaSampler::Pause_t::signature[];
-
-auto GeckoJavaSampler::Pause() -> void
-{
- return mozilla::jni::Method<Pause_t>::Call(GeckoJavaSampler::Context(), nullptr);
-}
-
-constexpr char GeckoJavaSampler::Start_t::name[];
-constexpr char GeckoJavaSampler::Start_t::signature[];
-
-auto GeckoJavaSampler::Start(int32_t a0, int32_t a1) -> void
-{
- return mozilla::jni::Method<Start_t>::Call(GeckoJavaSampler::Context(), nullptr, a0, a1);
-}
-
-constexpr char GeckoJavaSampler::Stop_t::name[];
-constexpr char GeckoJavaSampler::Stop_t::signature[];
-
-auto GeckoJavaSampler::Stop() -> void
-{
- return mozilla::jni::Method<Stop_t>::Call(GeckoJavaSampler::Context(), nullptr);
-}
-
-constexpr char GeckoJavaSampler::Unpause_t::name[];
-constexpr char GeckoJavaSampler::Unpause_t::signature[];
-
-auto GeckoJavaSampler::Unpause() -> void
-{
- return mozilla::jni::Method<Unpause_t>::Call(GeckoJavaSampler::Context(), nullptr);
-}
-
-const char MemoryMonitor::name[] =
- "org/mozilla/gecko/MemoryMonitor";
-
-constexpr char MemoryMonitor::DispatchMemoryPressure_t::name[];
-constexpr char MemoryMonitor::DispatchMemoryPressure_t::signature[];
-
-const char PresentationMediaPlayerManager::name[] =
- "org/mozilla/gecko/PresentationMediaPlayerManager";
-
-constexpr char PresentationMediaPlayerManager::AddPresentationSurface_t::name[];
-constexpr char PresentationMediaPlayerManager::AddPresentationSurface_t::signature[];
-
-constexpr char PresentationMediaPlayerManager::InvalidateAndScheduleComposite_t::name[];
-constexpr char PresentationMediaPlayerManager::InvalidateAndScheduleComposite_t::signature[];
-
-constexpr char PresentationMediaPlayerManager::RemovePresentationSurface_t::name[];
-constexpr char PresentationMediaPlayerManager::RemovePresentationSurface_t::signature[];
-
-const char ScreenManagerHelper::name[] =
- "org/mozilla/gecko/ScreenManagerHelper";
-
-constexpr char ScreenManagerHelper::AddDisplay_t::name[];
-constexpr char ScreenManagerHelper::AddDisplay_t::signature[];
-
-constexpr char ScreenManagerHelper::RemoveDisplay_t::name[];
-constexpr char ScreenManagerHelper::RemoveDisplay_t::signature[];
-
-const char Telemetry::name[] =
- "org/mozilla/gecko/Telemetry";
-
-constexpr char Telemetry::AddHistogram_t::name[];
-constexpr char Telemetry::AddHistogram_t::signature[];
-
-constexpr char Telemetry::AddKeyedHistogram_t::name[];
-constexpr char Telemetry::AddKeyedHistogram_t::signature[];
-
-constexpr char Telemetry::AddUIEvent_t::name[];
-constexpr char Telemetry::AddUIEvent_t::signature[];
-
-constexpr char Telemetry::StartUISession_t::name[];
-constexpr char Telemetry::StartUISession_t::signature[];
-
-constexpr char Telemetry::StopUISession_t::name[];
-constexpr char Telemetry::StopUISession_t::signature[];
-
-const char ThumbnailHelper::name[] =
- "org/mozilla/gecko/ThumbnailHelper";
-
-constexpr char ThumbnailHelper::NotifyThumbnail_t::name[];
-constexpr char ThumbnailHelper::NotifyThumbnail_t::signature[];
-
-auto ThumbnailHelper::NotifyThumbnail(mozilla::jni::ByteBuffer::Param a0, mozilla::jni::Object::Param a1, bool a2, bool a3) -> void
-{
- return mozilla::jni::Method<NotifyThumbnail_t>::Call(ThumbnailHelper::Context(), nullptr, a0, a1, a2, a3);
-}
-
-constexpr char ThumbnailHelper::RequestThumbnail_t::name[];
-constexpr char ThumbnailHelper::RequestThumbnail_t::signature[];
-
-const char ZoomedView::name[] =
- "org/mozilla/gecko/ZoomedView";
-
-constexpr char ZoomedView::RequestZoomedViewData_t::name[];
-constexpr char ZoomedView::RequestZoomedViewData_t::signature[];
-
-const char AudioFocusAgent::name[] =
- "org/mozilla/gecko/media/AudioFocusAgent";
-
-constexpr char AudioFocusAgent::NotifyStartedPlaying_t::name[];
-constexpr char AudioFocusAgent::NotifyStartedPlaying_t::signature[];
-
-auto AudioFocusAgent::NotifyStartedPlaying() -> void
-{
- return mozilla::jni::Method<NotifyStartedPlaying_t>::Call(AudioFocusAgent::Context(), nullptr);
-}
-
-constexpr char AudioFocusAgent::NotifyStoppedPlaying_t::name[];
-constexpr char AudioFocusAgent::NotifyStoppedPlaying_t::signature[];
-
-auto AudioFocusAgent::NotifyStoppedPlaying() -> void
-{
- return mozilla::jni::Method<NotifyStoppedPlaying_t>::Call(AudioFocusAgent::Context(), nullptr);
-}
-
-const char CodecProxy::name[] =
- "org/mozilla/gecko/media/CodecProxy";
-
-constexpr char CodecProxy::Create_t::name[];
-constexpr char CodecProxy::Create_t::signature[];
-
-auto CodecProxy::Create(mozilla::jni::Object::Param a0, mozilla::jni::Object::Param a1, mozilla::jni::Object::Param a2) -> CodecProxy::LocalRef
-{
- return mozilla::jni::Method<Create_t>::Call(CodecProxy::Context(), nullptr, a0, a1, a2);
-}
-
-constexpr char CodecProxy::Flush_t::name[];
-constexpr char CodecProxy::Flush_t::signature[];
-
-auto CodecProxy::Flush() const -> bool
-{
- return mozilla::jni::Method<Flush_t>::Call(CodecProxy::mCtx, nullptr);
-}
-
-constexpr char CodecProxy::Input_t::name[];
-constexpr char CodecProxy::Input_t::signature[];
-
-auto CodecProxy::Input(mozilla::jni::ByteBuffer::Param a0, mozilla::jni::Object::Param a1, mozilla::jni::Object::Param a2) const -> bool
-{
- return mozilla::jni::Method<Input_t>::Call(CodecProxy::mCtx, nullptr, a0, a1, a2);
-}
-
-constexpr char CodecProxy::Release_t::name[];
-constexpr char CodecProxy::Release_t::signature[];
-
-auto CodecProxy::Release() const -> bool
-{
- return mozilla::jni::Method<Release_t>::Call(CodecProxy::mCtx, nullptr);
-}
-
-const char CodecProxy::NativeCallbacks::name[] =
- "org/mozilla/gecko/media/CodecProxy$NativeCallbacks";
-
-constexpr char CodecProxy::NativeCallbacks::New_t::name[];
-constexpr char CodecProxy::NativeCallbacks::New_t::signature[];
-
-auto CodecProxy::NativeCallbacks::New() -> NativeCallbacks::LocalRef
-{
- return mozilla::jni::Constructor<New_t>::Call(NativeCallbacks::Context(), nullptr);
-}
-
-constexpr char CodecProxy::NativeCallbacks::DisposeNative_t::name[];
-constexpr char CodecProxy::NativeCallbacks::DisposeNative_t::signature[];
-
-constexpr char CodecProxy::NativeCallbacks::OnError_t::name[];
-constexpr char CodecProxy::NativeCallbacks::OnError_t::signature[];
-
-constexpr char CodecProxy::NativeCallbacks::OnInputExhausted_t::name[];
-constexpr char CodecProxy::NativeCallbacks::OnInputExhausted_t::signature[];
-
-constexpr char CodecProxy::NativeCallbacks::OnOutput_t::name[];
-constexpr char CodecProxy::NativeCallbacks::OnOutput_t::signature[];
-
-constexpr char CodecProxy::NativeCallbacks::OnOutputFormatChanged_t::name[];
-constexpr char CodecProxy::NativeCallbacks::OnOutputFormatChanged_t::signature[];
-
-const char MediaDrmProxy::name[] =
- "org/mozilla/gecko/media/MediaDrmProxy";
-
-constexpr char MediaDrmProxy::CanDecode_t::name[];
-constexpr char MediaDrmProxy::CanDecode_t::signature[];
-
-auto MediaDrmProxy::CanDecode(mozilla::jni::String::Param a0) -> bool
-{
- return mozilla::jni::Method<CanDecode_t>::Call(MediaDrmProxy::Context(), nullptr, a0);
-}
-
-constexpr char MediaDrmProxy::IsCryptoSchemeSupported_t::name[];
-constexpr char MediaDrmProxy::IsCryptoSchemeSupported_t::signature[];
-
-auto MediaDrmProxy::IsCryptoSchemeSupported(mozilla::jni::String::Param a0, mozilla::jni::String::Param a1) -> bool
-{
- return mozilla::jni::Method<IsCryptoSchemeSupported_t>::Call(MediaDrmProxy::Context(), nullptr, a0, a1);
-}
-
-constexpr char MediaDrmProxy::CloseSession_t::name[];
-constexpr char MediaDrmProxy::CloseSession_t::signature[];
-
-auto MediaDrmProxy::CloseSession(int32_t a0, mozilla::jni::String::Param a1) const -> void
-{
- return mozilla::jni::Method<CloseSession_t>::Call(MediaDrmProxy::mCtx, nullptr, a0, a1);
-}
-
-constexpr char MediaDrmProxy::Create_t::name[];
-constexpr char MediaDrmProxy::Create_t::signature[];
-
-auto MediaDrmProxy::Create(mozilla::jni::String::Param a0, mozilla::jni::Object::Param a1, bool a2) -> MediaDrmProxy::LocalRef
-{
- return mozilla::jni::Method<Create_t>::Call(MediaDrmProxy::Context(), nullptr, a0, a1, a2);
-}
-
-constexpr char MediaDrmProxy::CreateSession_t::name[];
-constexpr char MediaDrmProxy::CreateSession_t::signature[];
-
-auto MediaDrmProxy::CreateSession(int32_t a0, int32_t a1, mozilla::jni::String::Param a2, mozilla::jni::ByteArray::Param a3) const -> void
-{
- return mozilla::jni::Method<CreateSession_t>::Call(MediaDrmProxy::mCtx, nullptr, a0, a1, a2, a3);
-}
-
-constexpr char MediaDrmProxy::Destroy_t::name[];
-constexpr char MediaDrmProxy::Destroy_t::signature[];
-
-auto MediaDrmProxy::Destroy() const -> void
-{
- return mozilla::jni::Method<Destroy_t>::Call(MediaDrmProxy::mCtx, nullptr);
-}
-
-constexpr char MediaDrmProxy::IsSchemeSupported_t::name[];
-constexpr char MediaDrmProxy::IsSchemeSupported_t::signature[];
-
-auto MediaDrmProxy::IsSchemeSupported(mozilla::jni::String::Param a0) -> bool
-{
- return mozilla::jni::Method<IsSchemeSupported_t>::Call(MediaDrmProxy::Context(), nullptr, a0);
-}
-
-constexpr char MediaDrmProxy::UpdateSession_t::name[];
-constexpr char MediaDrmProxy::UpdateSession_t::signature[];
-
-auto MediaDrmProxy::UpdateSession(int32_t a0, mozilla::jni::String::Param a1, mozilla::jni::ByteArray::Param a2) const -> void
-{
- return mozilla::jni::Method<UpdateSession_t>::Call(MediaDrmProxy::mCtx, nullptr, a0, a1, a2);
-}
-
-const char16_t MediaDrmProxy::AAC[] = u"audio/mp4a-latm";
-
-const char16_t MediaDrmProxy::AVC[] = u"video/avc";
-
-const char16_t MediaDrmProxy::OPUS[] = u"audio/opus";
-
-const char16_t MediaDrmProxy::VORBIS[] = u"audio/vorbis";
-
-const char16_t MediaDrmProxy::VP8[] = u"video/x-vnd.on2.vp8";
-
-const char16_t MediaDrmProxy::VP9[] = u"video/x-vnd.on2.vp9";
-
-const char MediaDrmProxy::NativeMediaDrmProxyCallbacks::name[] =
- "org/mozilla/gecko/media/MediaDrmProxy$NativeMediaDrmProxyCallbacks";
-
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::New_t::name[];
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::New_t::signature[];
-
-auto MediaDrmProxy::NativeMediaDrmProxyCallbacks::New() -> NativeMediaDrmProxyCallbacks::LocalRef
-{
- return mozilla::jni::Constructor<New_t>::Call(NativeMediaDrmProxyCallbacks::Context(), nullptr);
-}
-
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnRejectPromise_t::name[];
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnRejectPromise_t::signature[];
-
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionBatchedKeyChanged_t::name[];
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionBatchedKeyChanged_t::signature[];
-
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionClosed_t::name[];
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionClosed_t::signature[];
-
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionCreated_t::name[];
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionCreated_t::signature[];
-
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionError_t::name[];
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionError_t::signature[];
-
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionMessage_t::name[];
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionMessage_t::signature[];
-
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionUpdated_t::name[];
-constexpr char MediaDrmProxy::NativeMediaDrmProxyCallbacks::OnSessionUpdated_t::signature[];
-
-const char Sample::name[] =
- "org/mozilla/gecko/media/Sample";
-
-constexpr char Sample::WriteToByteBuffer_t::name[];
-constexpr char Sample::WriteToByteBuffer_t::signature[];
-
-auto Sample::WriteToByteBuffer(mozilla::jni::ByteBuffer::Param a0) const -> void
-{
- return mozilla::jni::Method<WriteToByteBuffer_t>::Call(Sample::mCtx, nullptr, a0);
-}
-
-constexpr char Sample::Info_t::name[];
-constexpr char Sample::Info_t::signature[];
-
-auto Sample::Info() const -> mozilla::jni::Object::LocalRef
-{
- return mozilla::jni::Field<Info_t>::Get(Sample::mCtx, nullptr);
-}
-
-auto Sample::Info(mozilla::jni::Object::Param a0) const -> void
-{
- return mozilla::jni::Field<Info_t>::Set(Sample::mCtx, nullptr, a0);
-}
-
-const char SessionKeyInfo::name[] =
- "org/mozilla/gecko/media/SessionKeyInfo";
-
-constexpr char SessionKeyInfo::New_t::name[];
-constexpr char SessionKeyInfo::New_t::signature[];
-
-auto SessionKeyInfo::New(mozilla::jni::ByteArray::Param a0, int32_t a1) -> SessionKeyInfo::LocalRef
-{
- return mozilla::jni::Constructor<New_t>::Call(SessionKeyInfo::Context(), nullptr, a0, a1);
-}
-
-constexpr char SessionKeyInfo::KeyId_t::name[];
-constexpr char SessionKeyInfo::KeyId_t::signature[];
-
-auto SessionKeyInfo::KeyId() const -> mozilla::jni::ByteArray::LocalRef
-{
- return mozilla::jni::Field<KeyId_t>::Get(SessionKeyInfo::mCtx, nullptr);
-}
-
-auto SessionKeyInfo::KeyId(mozilla::jni::ByteArray::Param a0) const -> void
-{
- return mozilla::jni::Field<KeyId_t>::Set(SessionKeyInfo::mCtx, nullptr, a0);
-}
-
-constexpr char SessionKeyInfo::Status_t::name[];
-constexpr char SessionKeyInfo::Status_t::signature[];
-
-auto SessionKeyInfo::Status() const -> int32_t
-{
- return mozilla::jni::Field<Status_t>::Get(SessionKeyInfo::mCtx, nullptr);
-}
-
-auto SessionKeyInfo::Status(int32_t a0) const -> void
-{
- return mozilla::jni::Field<Status_t>::Set(SessionKeyInfo::mCtx, nullptr, a0);
-}
-
-const char Restrictions::name[] =
- "org/mozilla/gecko/restrictions/Restrictions";
-
-constexpr char Restrictions::IsAllowed_t::name[];
-constexpr char Restrictions::IsAllowed_t::signature[];
-
-auto Restrictions::IsAllowed(int32_t a0, mozilla::jni::String::Param a1) -> bool
-{
- return mozilla::jni::Method<IsAllowed_t>::Call(Restrictions::Context(), nullptr, a0, a1);
-}
-
-constexpr char Restrictions::IsUserRestricted_t::name[];
-constexpr char Restrictions::IsUserRestricted_t::signature[];
-
-auto Restrictions::IsUserRestricted() -> bool
-{
- return mozilla::jni::Method<IsUserRestricted_t>::Call(Restrictions::Context(), nullptr);
-}
-
-} /* java */
-} /* mozilla */
diff --git a/widget/android/fennec/FennecJNIWrappers.h b/widget/android/fennec/FennecJNIWrappers.h
deleted file mode 100644
index bb94cd142..000000000
--- a/widget/android/fennec/FennecJNIWrappers.h
+++ /dev/null
@@ -1,1469 +0,0 @@
-// GENERATED CODE
-// Generated by the Java program at /build/annotationProcessors at compile time
-// from annotations on Java methods. To update, change the annotations on the
-// corresponding Java methods and rerun the build. Manually updating this file
-// will cause your build to fail.
-
-#ifndef FennecJNIWrappers_h
-#define FennecJNIWrappers_h
-
-#include "mozilla/jni/Refs.h"
-
-namespace mozilla {
-namespace java {
-
-class ANRReporter : public mozilla::jni::ObjectBase<ANRReporter>
-{
-public:
- static const char name[];
-
- explicit ANRReporter(const Context& ctx) : ObjectBase<ANRReporter>(ctx) {}
-
- struct GetNativeStack_t {
- typedef ANRReporter Owner;
- typedef mozilla::jni::String::LocalRef ReturnType;
- typedef mozilla::jni::String::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getNativeStack";
- static constexpr char signature[] =
- "()Ljava/lang/String;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct ReleaseNativeStack_t {
- typedef ANRReporter Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "releaseNativeStack";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct RequestNativeStack_t {
- typedef ANRReporter Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- bool> Args;
- static constexpr char name[] = "requestNativeStack";
- static constexpr char signature[] =
- "(Z)Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class DownloadsIntegration : public mozilla::jni::ObjectBase<DownloadsIntegration>
-{
-public:
- static const char name[];
-
- explicit DownloadsIntegration(const Context& ctx) : ObjectBase<DownloadsIntegration>(ctx) {}
-
- struct GetTemporaryDownloadDirectory_t {
- typedef DownloadsIntegration Owner;
- typedef mozilla::jni::String::LocalRef ReturnType;
- typedef mozilla::jni::String::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getTemporaryDownloadDirectory";
- static constexpr char signature[] =
- "()Ljava/lang/String;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetTemporaryDownloadDirectory() -> mozilla::jni::String::LocalRef;
-
- struct ScanMedia_t {
- typedef DownloadsIntegration Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "scanMedia";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto ScanMedia(mozilla::jni::String::Param, mozilla::jni::String::Param) -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
-
-};
-
-class GeckoJavaSampler : public mozilla::jni::ObjectBase<GeckoJavaSampler>
-{
-public:
- static const char name[];
-
- explicit GeckoJavaSampler(const Context& ctx) : ObjectBase<GeckoJavaSampler>(ctx) {}
-
- struct GetFrameName_t {
- typedef GeckoJavaSampler Owner;
- typedef mozilla::jni::String::LocalRef ReturnType;
- typedef mozilla::jni::String::Param SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- int32_t> Args;
- static constexpr char name[] = "getFrameName";
- static constexpr char signature[] =
- "(III)Ljava/lang/String;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetFrameName(int32_t, int32_t, int32_t) -> mozilla::jni::String::LocalRef;
-
- struct GetProfilerTime_t {
- typedef GeckoJavaSampler Owner;
- typedef double ReturnType;
- typedef double SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "getProfilerTime";
- static constexpr char signature[] =
- "()D";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct GetSampleTime_t {
- typedef GeckoJavaSampler Owner;
- typedef double ReturnType;
- typedef double SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t> Args;
- static constexpr char name[] = "getSampleTime";
- static constexpr char signature[] =
- "(II)D";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetSampleTime(int32_t, int32_t) -> double;
-
- struct GetThreadName_t {
- typedef GeckoJavaSampler Owner;
- typedef mozilla::jni::String::LocalRef ReturnType;
- typedef mozilla::jni::String::Param SetterType;
- typedef mozilla::jni::Args<
- int32_t> Args;
- static constexpr char name[] = "getThreadName";
- static constexpr char signature[] =
- "(I)Ljava/lang/String;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto GetThreadName(int32_t) -> mozilla::jni::String::LocalRef;
-
- struct Pause_t {
- typedef GeckoJavaSampler Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "pause";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto Pause() -> void;
-
- struct Start_t {
- typedef GeckoJavaSampler Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t> Args;
- static constexpr char name[] = "start";
- static constexpr char signature[] =
- "(II)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto Start(int32_t, int32_t) -> void;
-
- struct Stop_t {
- typedef GeckoJavaSampler Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "stop";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto Stop() -> void;
-
- struct Unpause_t {
- typedef GeckoJavaSampler Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "unpause";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto Unpause() -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class MemoryMonitor : public mozilla::jni::ObjectBase<MemoryMonitor>
-{
-public:
- static const char name[];
-
- explicit MemoryMonitor(const Context& ctx) : ObjectBase<MemoryMonitor>(ctx) {}
-
- struct DispatchMemoryPressure_t {
- typedef MemoryMonitor Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "dispatchMemoryPressure";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
-
- template<class Impl> class Natives;
-};
-
-class PresentationMediaPlayerManager : public mozilla::jni::ObjectBase<PresentationMediaPlayerManager>
-{
-public:
- static const char name[];
-
- explicit PresentationMediaPlayerManager(const Context& ctx) : ObjectBase<PresentationMediaPlayerManager>(ctx) {}
-
- struct AddPresentationSurface_t {
- typedef PresentationMediaPlayerManager Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param,
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "addPresentationSurface";
- static constexpr char signature[] =
- "(Lorg/mozilla/gecko/GeckoView;Landroid/view/Surface;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct InvalidateAndScheduleComposite_t {
- typedef PresentationMediaPlayerManager Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "invalidateAndScheduleComposite";
- static constexpr char signature[] =
- "(Lorg/mozilla/gecko/GeckoView;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct RemovePresentationSurface_t {
- typedef PresentationMediaPlayerManager Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "removePresentationSurface";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::UI;
-
- template<class Impl> class Natives;
-};
-
-class ScreenManagerHelper : public mozilla::jni::ObjectBase<ScreenManagerHelper>
-{
-public:
- static const char name[];
-
- explicit ScreenManagerHelper(const Context& ctx) : ObjectBase<ScreenManagerHelper>(ctx) {}
-
- struct AddDisplay_t {
- typedef ScreenManagerHelper Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- int32_t,
- float> Args;
- static constexpr char name[] = "addDisplay";
- static constexpr char signature[] =
- "(IIIF)I";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct RemoveDisplay_t {
- typedef ScreenManagerHelper Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t> Args;
- static constexpr char name[] = "removeDisplay";
- static constexpr char signature[] =
- "(I)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class Telemetry : public mozilla::jni::ObjectBase<Telemetry>
-{
-public:
- static const char name[];
-
- explicit Telemetry(const Context& ctx) : ObjectBase<Telemetry>(ctx) {}
-
- struct AddHistogram_t {
- typedef Telemetry Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- int32_t> Args;
- static constexpr char name[] = "nativeAddHistogram";
- static constexpr char signature[] =
- "(Ljava/lang/String;I)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct AddKeyedHistogram_t {
- typedef Telemetry Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- int32_t> Args;
- static constexpr char name[] = "nativeAddKeyedHistogram";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;I)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct AddUIEvent_t {
- typedef Telemetry Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- int64_t,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "nativeAddUiEvent";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;JLjava/lang/String;)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct StartUISession_t {
- typedef Telemetry Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- int64_t> Args;
- static constexpr char name[] = "nativeStartUiSession";
- static constexpr char signature[] =
- "(Ljava/lang/String;J)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct StopUISession_t {
- typedef Telemetry Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param,
- int64_t> Args;
- static constexpr char name[] = "nativeStopUiSession";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;J)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class ThumbnailHelper : public mozilla::jni::ObjectBase<ThumbnailHelper>
-{
-public:
- static const char name[];
-
- explicit ThumbnailHelper(const Context& ctx) : ObjectBase<ThumbnailHelper>(ctx) {}
-
- struct NotifyThumbnail_t {
- typedef ThumbnailHelper Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ByteBuffer::Param,
- mozilla::jni::Object::Param,
- bool,
- bool> Args;
- static constexpr char name[] = "notifyThumbnail";
- static constexpr char signature[] =
- "(Ljava/nio/ByteBuffer;Lorg/mozilla/gecko/Tab;ZZ)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto NotifyThumbnail(mozilla::jni::ByteBuffer::Param, mozilla::jni::Object::Param, bool, bool) -> void;
-
- struct RequestThumbnail_t {
- typedef ThumbnailHelper Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ByteBuffer::Param,
- mozilla::jni::Object::Param,
- int32_t,
- int32_t,
- int32_t> Args;
- static constexpr char name[] = "requestThumbnailLocked";
- static constexpr char signature[] =
- "(Ljava/nio/ByteBuffer;Lorg/mozilla/gecko/Tab;III)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::PROXY;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class ZoomedView : public mozilla::jni::ObjectBase<ZoomedView>
-{
-public:
- static const char name[];
-
- explicit ZoomedView(const Context& ctx) : ObjectBase<ZoomedView>(ctx) {}
-
- struct RequestZoomedViewData_t {
- typedef ZoomedView Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ByteBuffer::Param,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- int32_t,
- float> Args;
- static constexpr char name[] = "requestZoomedViewData";
- static constexpr char signature[] =
- "(Ljava/nio/ByteBuffer;IIIIIF)V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class AudioFocusAgent : public mozilla::jni::ObjectBase<AudioFocusAgent>
-{
-public:
- static const char name[];
-
- explicit AudioFocusAgent(const Context& ctx) : ObjectBase<AudioFocusAgent>(ctx) {}
-
- struct NotifyStartedPlaying_t {
- typedef AudioFocusAgent Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "notifyStartedPlaying";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto NotifyStartedPlaying() -> void;
-
- struct NotifyStoppedPlaying_t {
- typedef AudioFocusAgent Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "notifyStoppedPlaying";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto NotifyStoppedPlaying() -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
-
-};
-
-class CodecProxy : public mozilla::jni::ObjectBase<CodecProxy>
-{
-public:
- static const char name[];
-
- explicit CodecProxy(const Context& ctx) : ObjectBase<CodecProxy>(ctx) {}
-
- class NativeCallbacks;
-
- struct Create_t {
- typedef CodecProxy Owner;
- typedef CodecProxy::LocalRef ReturnType;
- typedef CodecProxy::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param,
- mozilla::jni::Object::Param,
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "create";
- static constexpr char signature[] =
- "(Landroid/media/MediaFormat;Landroid/view/Surface;Lorg/mozilla/gecko/media/CodecProxy$Callbacks;)Lorg/mozilla/gecko/media/CodecProxy;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto Create(mozilla::jni::Object::Param, mozilla::jni::Object::Param, mozilla::jni::Object::Param) -> CodecProxy::LocalRef;
-
- struct Flush_t {
- typedef CodecProxy Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "flush";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Flush() const -> bool;
-
- struct Input_t {
- typedef CodecProxy Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ByteBuffer::Param,
- mozilla::jni::Object::Param,
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "input";
- static constexpr char signature[] =
- "(Ljava/nio/ByteBuffer;Landroid/media/MediaCodec$BufferInfo;Landroid/media/MediaCodec$CryptoInfo;)Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Input(mozilla::jni::ByteBuffer::Param, mozilla::jni::Object::Param, mozilla::jni::Object::Param) const -> bool;
-
- struct Release_t {
- typedef CodecProxy Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "release";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Release() const -> bool;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class CodecProxy::NativeCallbacks : public mozilla::jni::ObjectBase<NativeCallbacks>
-{
-public:
- static const char name[];
-
- explicit NativeCallbacks(const Context& ctx) : ObjectBase<NativeCallbacks>(ctx) {}
-
- struct New_t {
- typedef NativeCallbacks Owner;
- typedef NativeCallbacks::LocalRef ReturnType;
- typedef NativeCallbacks::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "<init>";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto New() -> NativeCallbacks::LocalRef;
-
- struct DisposeNative_t {
- typedef NativeCallbacks Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "disposeNative";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OnError_t {
- typedef NativeCallbacks Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- bool> Args;
- static constexpr char name[] = "onError";
- static constexpr char signature[] =
- "(Z)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OnInputExhausted_t {
- typedef NativeCallbacks Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "onInputExhausted";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OnOutput_t {
- typedef NativeCallbacks Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "onOutput";
- static constexpr char signature[] =
- "(Lorg/mozilla/gecko/media/Sample;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- struct OnOutputFormatChanged_t {
- typedef NativeCallbacks Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::Object::Param> Args;
- static constexpr char name[] = "onOutputFormatChanged";
- static constexpr char signature[] =
- "(Landroid/media/MediaFormat;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class MediaDrmProxy : public mozilla::jni::ObjectBase<MediaDrmProxy>
-{
-public:
- static const char name[];
-
- explicit MediaDrmProxy(const Context& ctx) : ObjectBase<MediaDrmProxy>(ctx) {}
-
- class NativeMediaDrmProxyCallbacks;
-
- struct CanDecode_t {
- typedef MediaDrmProxy Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "CanDecode";
- static constexpr char signature[] =
- "(Ljava/lang/String;)Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto CanDecode(mozilla::jni::String::Param) -> bool;
-
- struct IsCryptoSchemeSupported_t {
- typedef MediaDrmProxy Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "IsCryptoSchemeSupported";
- static constexpr char signature[] =
- "(Ljava/lang/String;Ljava/lang/String;)Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto IsCryptoSchemeSupported(mozilla::jni::String::Param, mozilla::jni::String::Param) -> bool;
-
- struct CloseSession_t {
- typedef MediaDrmProxy Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "closeSession";
- static constexpr char signature[] =
- "(ILjava/lang/String;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto CloseSession(int32_t, mozilla::jni::String::Param) const -> void;
-
- struct Create_t {
- typedef MediaDrmProxy Owner;
- typedef MediaDrmProxy::LocalRef ReturnType;
- typedef MediaDrmProxy::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param,
- mozilla::jni::Object::Param,
- bool> Args;
- static constexpr char name[] = "create";
- static constexpr char signature[] =
- "(Ljava/lang/String;Lorg/mozilla/gecko/media/MediaDrmProxy$Callbacks;Z)Lorg/mozilla/gecko/media/MediaDrmProxy;";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto Create(mozilla::jni::String::Param, mozilla::jni::Object::Param, bool) -> MediaDrmProxy::LocalRef;
-
- struct CreateSession_t {
- typedef MediaDrmProxy Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- mozilla::jni::String::Param,
- mozilla::jni::ByteArray::Param> Args;
- static constexpr char name[] = "createSession";
- static constexpr char signature[] =
- "(IILjava/lang/String;[B)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto CreateSession(int32_t, int32_t, mozilla::jni::String::Param, mozilla::jni::ByteArray::Param) const -> void;
-
- struct Destroy_t {
- typedef MediaDrmProxy Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "destroy";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Destroy() const -> void;
-
- struct IsSchemeSupported_t {
- typedef MediaDrmProxy Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "isSchemeSupported";
- static constexpr char signature[] =
- "(Ljava/lang/String;)Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto IsSchemeSupported(mozilla::jni::String::Param) -> bool;
-
- struct UpdateSession_t {
- typedef MediaDrmProxy Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- mozilla::jni::String::Param,
- mozilla::jni::ByteArray::Param> Args;
- static constexpr char name[] = "updateSession";
- static constexpr char signature[] =
- "(ILjava/lang/String;[B)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto UpdateSession(int32_t, mozilla::jni::String::Param, mozilla::jni::ByteArray::Param) const -> void;
-
- static const char16_t AAC[];
-
- static const char16_t AVC[];
-
- static const char16_t OPUS[];
-
- static const char16_t VORBIS[];
-
- static const char16_t VP8[];
-
- static const char16_t VP9[];
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class MediaDrmProxy::NativeMediaDrmProxyCallbacks : public mozilla::jni::ObjectBase<NativeMediaDrmProxyCallbacks>
-{
-public:
- static const char name[];
-
- explicit NativeMediaDrmProxyCallbacks(const Context& ctx) : ObjectBase<NativeMediaDrmProxyCallbacks>(ctx) {}
-
- struct New_t {
- typedef NativeMediaDrmProxyCallbacks Owner;
- typedef NativeMediaDrmProxyCallbacks::LocalRef ReturnType;
- typedef NativeMediaDrmProxyCallbacks::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "<init>";
- static constexpr char signature[] =
- "()V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto New() -> NativeMediaDrmProxyCallbacks::LocalRef;
-
- struct OnRejectPromise_t {
- typedef NativeMediaDrmProxyCallbacks Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "onRejectPromise";
- static constexpr char signature[] =
- "(ILjava/lang/String;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnSessionBatchedKeyChanged_t {
- typedef NativeMediaDrmProxyCallbacks Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ByteArray::Param,
- mozilla::jni::ObjectArray::Param> Args;
- static constexpr char name[] = "onSessionBatchedKeyChanged";
- static constexpr char signature[] =
- "([B[Lorg/mozilla/gecko/media/SessionKeyInfo;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnSessionClosed_t {
- typedef NativeMediaDrmProxyCallbacks Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- mozilla::jni::ByteArray::Param> Args;
- static constexpr char name[] = "onSessionClosed";
- static constexpr char signature[] =
- "(I[B)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnSessionCreated_t {
- typedef NativeMediaDrmProxyCallbacks Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- int32_t,
- mozilla::jni::ByteArray::Param,
- mozilla::jni::ByteArray::Param> Args;
- static constexpr char name[] = "onSessionCreated";
- static constexpr char signature[] =
- "(II[B[B)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnSessionError_t {
- typedef NativeMediaDrmProxyCallbacks Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ByteArray::Param,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "onSessionError";
- static constexpr char signature[] =
- "([BLjava/lang/String;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnSessionMessage_t {
- typedef NativeMediaDrmProxyCallbacks Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ByteArray::Param,
- int32_t,
- mozilla::jni::ByteArray::Param> Args;
- static constexpr char name[] = "onSessionMessage";
- static constexpr char signature[] =
- "([BI[B)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- struct OnSessionUpdated_t {
- typedef NativeMediaDrmProxyCallbacks Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- mozilla::jni::ByteArray::Param> Args;
- static constexpr char name[] = "onSessionUpdated";
- static constexpr char signature[] =
- "(I[B)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::GECKO;
- };
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
- template<class Impl> class Natives;
-};
-
-class Sample : public mozilla::jni::ObjectBase<Sample>
-{
-public:
- static const char name[];
-
- explicit Sample(const Context& ctx) : ObjectBase<Sample>(ctx) {}
-
- struct WriteToByteBuffer_t {
- typedef Sample Owner;
- typedef void ReturnType;
- typedef void SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ByteBuffer::Param> Args;
- static constexpr char name[] = "writeToByteBuffer";
- static constexpr char signature[] =
- "(Ljava/nio/ByteBuffer;)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto WriteToByteBuffer(mozilla::jni::ByteBuffer::Param) const -> void;
-
- struct Info_t {
- typedef Sample Owner;
- typedef mozilla::jni::Object::LocalRef ReturnType;
- typedef mozilla::jni::Object::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "info";
- static constexpr char signature[] =
- "Landroid/media/MediaCodec$BufferInfo;";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Info() const -> mozilla::jni::Object::LocalRef;
-
- auto Info(mozilla::jni::Object::Param) const -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class SessionKeyInfo : public mozilla::jni::ObjectBase<SessionKeyInfo>
-{
-public:
- static const char name[];
-
- explicit SessionKeyInfo(const Context& ctx) : ObjectBase<SessionKeyInfo>(ctx) {}
-
- struct New_t {
- typedef SessionKeyInfo Owner;
- typedef SessionKeyInfo::LocalRef ReturnType;
- typedef SessionKeyInfo::Param SetterType;
- typedef mozilla::jni::Args<
- mozilla::jni::ByteArray::Param,
- int32_t> Args;
- static constexpr char name[] = "<init>";
- static constexpr char signature[] =
- "([BI)V";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto New(mozilla::jni::ByteArray::Param, int32_t) -> SessionKeyInfo::LocalRef;
-
- struct KeyId_t {
- typedef SessionKeyInfo Owner;
- typedef mozilla::jni::ByteArray::LocalRef ReturnType;
- typedef mozilla::jni::ByteArray::Param SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "keyId";
- static constexpr char signature[] =
- "[B";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto KeyId() const -> mozilla::jni::ByteArray::LocalRef;
-
- auto KeyId(mozilla::jni::ByteArray::Param) const -> void;
-
- struct Status_t {
- typedef SessionKeyInfo Owner;
- typedef int32_t ReturnType;
- typedef int32_t SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "status";
- static constexpr char signature[] =
- "I";
- static const bool isStatic = false;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- auto Status() const -> int32_t;
-
- auto Status(int32_t) const -> void;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::ANY;
-
-};
-
-class Restrictions : public mozilla::jni::ObjectBase<Restrictions>
-{
-public:
- static const char name[];
-
- explicit Restrictions(const Context& ctx) : ObjectBase<Restrictions>(ctx) {}
-
- struct IsAllowed_t {
- typedef Restrictions Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<
- int32_t,
- mozilla::jni::String::Param> Args;
- static constexpr char name[] = "isAllowed";
- static constexpr char signature[] =
- "(ILjava/lang/String;)Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto IsAllowed(int32_t, mozilla::jni::String::Param) -> bool;
-
- struct IsUserRestricted_t {
- typedef Restrictions Owner;
- typedef bool ReturnType;
- typedef bool SetterType;
- typedef mozilla::jni::Args<> Args;
- static constexpr char name[] = "isUserRestricted";
- static constexpr char signature[] =
- "()Z";
- static const bool isStatic = true;
- static const mozilla::jni::ExceptionMode exceptionMode =
- mozilla::jni::ExceptionMode::ABORT;
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
- static const mozilla::jni::DispatchTarget dispatchTarget =
- mozilla::jni::DispatchTarget::CURRENT;
- };
-
- static auto IsUserRestricted() -> bool;
-
- static const mozilla::jni::CallingThread callingThread =
- mozilla::jni::CallingThread::GECKO;
-
-};
-
-} /* java */
-} /* mozilla */
-#endif // FennecJNIWrappers_h
diff --git a/widget/android/fennec/MemoryMonitor.h b/widget/android/fennec/MemoryMonitor.h
deleted file mode 100644
index c87538424..000000000
--- a/widget/android/fennec/MemoryMonitor.h
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef MemoryMonitor_h
-#define MemoryMonitor_h
-
-#include "FennecJNINatives.h"
-#include "nsMemoryPressure.h"
-
-namespace mozilla {
-
-class MemoryMonitor final
- : public java::MemoryMonitor::Natives<MemoryMonitor>
-{
-public:
- static void
- DispatchMemoryPressure()
- {
- NS_DispatchMemoryPressure(MemoryPressureState::MemPressure_New);
- }
-};
-
-} // namespace mozilla
-
-#endif // MemoryMonitor_h
diff --git a/widget/android/fennec/Telemetry.h b/widget/android/fennec/Telemetry.h
deleted file mode 100644
index 458889ef0..000000000
--- a/widget/android/fennec/Telemetry.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef mozilla_widget_Telemetry_h__
-#define mozilla_widget_Telemetry_h__
-
-#include "FennecJNINatives.h"
-#include "nsAppShell.h"
-#include "nsIAndroidBridge.h"
-
-#include "mozilla/Telemetry.h"
-
-namespace mozilla {
-namespace widget {
-
-class Telemetry final
- : public java::Telemetry::Natives<Telemetry>
-{
- Telemetry() = delete;
-
- static already_AddRefed<nsIUITelemetryObserver>
- GetObserver()
- {
- nsAppShell* const appShell = nsAppShell::Get();
- if (!appShell) {
- return nullptr;
- }
-
- nsCOMPtr<nsIAndroidBrowserApp> browserApp = appShell->GetBrowserApp();
- nsCOMPtr<nsIUITelemetryObserver> obs;
-
- if (!browserApp || NS_FAILED(browserApp->GetUITelemetryObserver(
- getter_AddRefs(obs))) || !obs) {
- return nullptr;
- }
-
- return obs.forget();
- }
-
-public:
- static void
- AddHistogram(jni::String::Param aName, int32_t aValue)
- {
- MOZ_ASSERT(aName);
- }
-
- static void
- AddKeyedHistogram(jni::String::Param aName, jni::String::Param aKey,
- int32_t aValue)
- {
- MOZ_ASSERT(aName && aKey);
- }
-
- static void
- StartUISession(jni::String::Param aName, int64_t aTimestamp)
- {
- MOZ_ASSERT(aName);
- nsCOMPtr<nsIUITelemetryObserver> obs = GetObserver();
- if (obs) {
- obs->StartSession(aName->ToString().get(), aTimestamp);
- }
- }
-
- static void
- StopUISession(jni::String::Param aName, jni::String::Param aReason,
- int64_t aTimestamp)
- {
- MOZ_ASSERT(aName);
- nsCOMPtr<nsIUITelemetryObserver> obs = GetObserver();
- if (obs) {
- obs->StopSession(aName->ToString().get(),
- aReason ? aReason->ToString().get() : nullptr,
- aTimestamp);
- }
- }
-
- static void
- AddUIEvent(jni::String::Param aAction, jni::String::Param aMethod,
- int64_t aTimestamp, jni::String::Param aExtras)
- {
- MOZ_ASSERT(aAction);
- nsCOMPtr<nsIUITelemetryObserver> obs = GetObserver();
- if (obs) {
- obs->AddEvent(aAction->ToString().get(),
- aMethod ? aMethod->ToString().get() : nullptr,
- aTimestamp,
- aExtras ? aExtras->ToString().get() : nullptr);
- }
- }
-};
-
-} // namespace widget
-} // namespace mozilla
-
-#endif // mozilla_widget_Telemetry_h__
diff --git a/widget/android/fennec/ThumbnailHelper.h b/widget/android/fennec/ThumbnailHelper.h
deleted file mode 100644
index 08fae787e..000000000
--- a/widget/android/fennec/ThumbnailHelper.h
+++ /dev/null
@@ -1,302 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef ThumbnailHelper_h
-#define ThumbnailHelper_h
-
-#include "AndroidBridge.h"
-#include "FennecJNINatives.h"
-#include "gfxPlatform.h"
-#include "mozIDOMWindow.h"
-#include "nsAppShell.h"
-#include "nsCOMPtr.h"
-#include "nsIChannel.h"
-#include "nsIDOMWindowUtils.h"
-#include "nsIDOMClientRect.h"
-#include "nsIDocShell.h"
-#include "nsIHttpChannel.h"
-#include "nsIPresShell.h"
-#include "nsIURI.h"
-#include "nsPIDOMWindow.h"
-#include "nsPresContext.h"
-
-#include "mozilla/Preferences.h"
-
-namespace mozilla {
-
-class ThumbnailHelper final
- : public java::ThumbnailHelper::Natives<ThumbnailHelper>
- , public java::ZoomedView::Natives<ThumbnailHelper>
-{
- ThumbnailHelper() = delete;
-
- static already_AddRefed<mozIDOMWindowProxy>
- GetWindowForTab(int32_t aTabId)
- {
- nsAppShell* const appShell = nsAppShell::Get();
- if (!appShell) {
- return nullptr;
- }
-
- nsCOMPtr<nsIAndroidBrowserApp> browserApp = appShell->GetBrowserApp();
- if (!browserApp) {
- return nullptr;
- }
-
- nsCOMPtr<mozIDOMWindowProxy> window;
- nsCOMPtr<nsIBrowserTab> tab;
-
- if (NS_FAILED(browserApp->GetBrowserTab(aTabId, getter_AddRefs(tab))) ||
- !tab ||
- NS_FAILED(tab->GetWindow(getter_AddRefs(window))) ||
- !window) {
- return nullptr;
- }
-
- return window.forget();
- }
-
- // Decides if we should store thumbnails for a given docshell based on the
- // presence of a Cache-Control: no-store header and the
- // "browser.cache.disk_cache_ssl" pref.
- static bool
- ShouldStoreThumbnail(nsIDocShell* docShell)
- {
- nsCOMPtr<nsIChannel> channel;
- if (NS_FAILED(docShell->GetCurrentDocumentChannel(
- getter_AddRefs(channel))) || !channel) {
- return false;
- }
-
- nsCOMPtr<nsIHttpChannel> httpChannel = do_QueryInterface(channel);
- if (!httpChannel) {
- // Allow storing non-HTTP thumbnails.
- return true;
- }
-
- // Don't store thumbnails for sites that didn't load or have
- // Cache-Control: no-store.
- uint32_t responseStatus = 0;
- bool isNoStoreResponse = false;
-
- if (NS_FAILED(httpChannel->GetResponseStatus(&responseStatus)) ||
- (responseStatus / 100) != 2 ||
- NS_FAILED(httpChannel->IsNoStoreResponse(&isNoStoreResponse)) ||
- isNoStoreResponse) {
- return false;
- }
-
- // Deny storage if we're viewing a HTTPS page with a 'Cache-Control'
- // header having a value that is not 'public', unless enabled by user.
- nsCOMPtr<nsIURI> uri;
- bool isHttps = false;
-
- if (NS_FAILED(channel->GetURI(getter_AddRefs(uri))) ||
- !uri ||
- NS_FAILED(uri->SchemeIs("https", &isHttps))) {
- return false;
- }
-
- if (!isHttps ||
- Preferences::GetBool("browser.cache.disk_cache_ssl", false)) {
- // Allow storing non-HTTPS thumbnails, and HTTPS ones if enabled by
- // user.
- return true;
- }
-
- nsAutoCString cacheControl;
- if (NS_FAILED(httpChannel->GetResponseHeader(
- NS_LITERAL_CSTRING("Cache-Control"), cacheControl))) {
- return false;
- }
-
- if (cacheControl.IsEmpty() ||
- cacheControl.LowerCaseEqualsLiteral("public")) {
- // Allow no cache-control, or public cache-control.
- return true;
- }
- return false;
- }
-
- // Return a non-null nsIDocShell to indicate success.
- static already_AddRefed<nsIDocShell>
- GetThumbnailAndDocShell(mozIDOMWindowProxy* aWindow,
- jni::ByteBuffer::Param aData,
- int32_t aThumbWidth, int32_t aThumbHeight,
- const CSSRect& aPageRect, float aZoomFactor)
- {
- nsCOMPtr<nsPIDOMWindowOuter> win = nsPIDOMWindowOuter::From(aWindow);
- nsCOMPtr<nsIDocShell> docShell = win->GetDocShell();
- RefPtr<nsPresContext> presContext;
-
- if (!docShell || NS_FAILED(docShell->GetPresContext(
- getter_AddRefs(presContext))) || !presContext) {
- return nullptr;
- }
-
- uint8_t* const data = static_cast<uint8_t*>(aData->Address());
- if (!data) {
- return nullptr;
- }
-
- const bool is24bit = !AndroidBridge::Bridge() ||
- AndroidBridge::Bridge()->GetScreenDepth() == 24;
- const uint32_t stride = aThumbWidth * (is24bit ? 4 : 2);
-
- RefPtr<DrawTarget> dt = gfxPlatform::GetPlatform()->CreateDrawTargetForData(
- data,
- IntSize(aThumbWidth, aThumbHeight),
- stride,
- is24bit ? SurfaceFormat::B8G8R8A8
- : SurfaceFormat::R5G6B5_UINT16);
-
- if (!dt || !dt->IsValid()) {
- return nullptr;
- }
-
- nsCOMPtr<nsIPresShell> presShell = presContext->PresShell();
- RefPtr<gfxContext> context = gfxContext::CreateOrNull(dt);
- MOZ_ASSERT(context); // checked the draw target above
-
- context->SetMatrix(context->CurrentMatrix().Scale(
- aZoomFactor * float(aThumbWidth) / aPageRect.width,
- aZoomFactor * float(aThumbHeight) / aPageRect.height));
-
- const nsRect drawRect(
- nsPresContext::CSSPixelsToAppUnits(aPageRect.x),
- nsPresContext::CSSPixelsToAppUnits(aPageRect.y),
- nsPresContext::CSSPixelsToAppUnits(aPageRect.width),
- nsPresContext::CSSPixelsToAppUnits(aPageRect.height));
- const uint32_t renderDocFlags =
- nsIPresShell::RENDER_IGNORE_VIEWPORT_SCROLLING |
- nsIPresShell::RENDER_DOCUMENT_RELATIVE;
- const nscolor bgColor = NS_RGB(255, 255, 255);
-
- if (NS_FAILED(presShell->RenderDocument(
- drawRect, renderDocFlags, bgColor, context))) {
- return nullptr;
- }
-
- if (is24bit) {
- gfxUtils::ConvertBGRAtoRGBA(data, stride * aThumbHeight);
- }
-
- return docShell.forget();
- }
-
-public:
- static void Init()
- {
- java::ThumbnailHelper::Natives<ThumbnailHelper>::Init();
- java::ZoomedView::Natives<ThumbnailHelper>::Init();
- }
-
- template<class Functor>
- static void OnNativeCall(Functor&& aCall)
- {
- class IdleEvent : public nsAppShell::LambdaEvent<Functor>
- {
- using Base = nsAppShell::LambdaEvent<Functor>;
-
- public:
- IdleEvent(Functor&& aCall)
- : Base(Forward<Functor>(aCall))
- {}
-
- void Run() override
- {
- MessageLoop::current()->PostIdleTask(
- NS_NewRunnableFunction(Move(Base::lambda)));
- }
- };
-
- // Invoke RequestThumbnail on the main thread when the thread is idle.
- nsAppShell::PostEvent(MakeUnique<IdleEvent>(Forward<Functor>(aCall)));
- }
-
- static void
- RequestThumbnail(jni::ByteBuffer::Param aData, jni::Object::Param aTab,
- int32_t aTabId, int32_t aWidth, int32_t aHeight)
- {
- nsCOMPtr<mozIDOMWindowProxy> window = GetWindowForTab(aTabId);
- if (!window || !aData) {
- java::ThumbnailHelper::NotifyThumbnail(
- aData, aTab, /* success */ false, /* store */ false);
- return;
- }
-
- // take a screenshot, as wide as possible, proportional to the destination size
- nsCOMPtr<nsIDOMWindowUtils> utils = do_GetInterface(window);
- nsCOMPtr<nsIDOMClientRect> rect;
- float pageLeft = 0.0f, pageTop = 0.0f, pageWidth = 0.0f, pageHeight = 0.0f;
-
- if (!utils ||
- NS_FAILED(utils->GetRootBounds(getter_AddRefs(rect))) ||
- !rect ||
- NS_FAILED(rect->GetLeft(&pageLeft)) ||
- NS_FAILED(rect->GetTop(&pageTop)) ||
- NS_FAILED(rect->GetWidth(&pageWidth)) ||
- NS_FAILED(rect->GetHeight(&pageHeight)) ||
- int32_t(pageWidth) == 0 || int32_t(pageHeight) == 0) {
- java::ThumbnailHelper::NotifyThumbnail(
- aData, aTab, /* success */ false, /* store */ false);
- return;
- }
-
- const float aspectRatio = float(aWidth) / float(aHeight);
- if (pageWidth / aspectRatio < pageHeight) {
- pageHeight = pageWidth / aspectRatio;
- } else {
- pageWidth = pageHeight * aspectRatio;
- }
-
- nsCOMPtr<nsIDocShell> docShell = GetThumbnailAndDocShell(
- window, aData, aWidth, aHeight,
- CSSRect(pageLeft, pageTop, pageWidth, pageHeight),
- /* aZoomFactor */ 1.0f);
- const bool success = !!docShell;
- const bool store = success ? ShouldStoreThumbnail(docShell) : false;
-
- java::ThumbnailHelper::NotifyThumbnail(aData, aTab, success, store);
- }
-
- static void
- RequestZoomedViewData(jni::ByteBuffer::Param aData, int32_t aTabId,
- int32_t aX, int32_t aY,
- int32_t aWidth, int32_t aHeight, float aScale)
- {
- nsCOMPtr<mozIDOMWindowProxy> window = GetWindowForTab(aTabId);
- if (!window || !aData) {
- return;
- }
-
- nsCOMPtr<nsPIDOMWindowOuter> win = nsPIDOMWindowOuter::From(window);
- nsCOMPtr<nsIDocShell> docShell = win->GetDocShell();
- RefPtr<nsPresContext> presContext;
-
- if (!docShell || NS_FAILED(docShell->GetPresContext(
- getter_AddRefs(presContext))) || !presContext) {
- return;
- }
-
- nsCOMPtr<nsIPresShell> presShell = presContext->PresShell();
- LayoutDeviceRect rect = LayoutDeviceRect(aX, aY, aWidth, aHeight);
- const float resolution = presShell->GetCumulativeResolution();
- rect.Scale(1.0f / LayoutDeviceToLayerScale(resolution).scale);
-
- docShell = GetThumbnailAndDocShell(
- window, aData, aWidth, aHeight, CSSRect::FromAppUnits(
- rect.ToAppUnits(rect, presContext->AppUnitsPerDevPixel())),
- aScale);
-
- if (docShell) {
- java::LayerView::UpdateZoomedView(aData);
- }
- }
-};
-
-} // namespace mozilla
-
-#endif // ThumbnailHelper_h
diff --git a/widget/android/fennec/moz.build b/widget/android/fennec/moz.build
deleted file mode 100644
index 0d6a8e0cd..000000000
--- a/widget/android/fennec/moz.build
+++ /dev/null
@@ -1,21 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXPORTS += [
- 'FennecJNINatives.h',
- 'FennecJNIWrappers.h',
-]
-
-UNIFIED_SOURCES += [
- 'FennecJNIWrappers.cpp',
-]
-
-FINAL_LIBRARY = 'xul'
-
-LOCAL_INCLUDES += [
- '/widget',
- '/widget/android',
-]
diff --git a/widget/android/jni/Accessors.h b/widget/android/jni/Accessors.h
deleted file mode 100644
index fe2cbc9d4..000000000
--- a/widget/android/jni/Accessors.h
+++ /dev/null
@@ -1,274 +0,0 @@
-#ifndef mozilla_jni_Accessors_h__
-#define mozilla_jni_Accessors_h__
-
-#include <jni.h>
-
-#include "mozilla/jni/Refs.h"
-#include "mozilla/jni/Types.h"
-#include "mozilla/jni/Utils.h"
-#include "AndroidBridge.h"
-
-namespace mozilla {
-namespace jni {
-
-namespace detail {
-
-// Helper class to convert an arbitrary type to a jvalue, e.g. Value(123).val.
-struct Value
-{
- Value(jboolean z) { val.z = z; }
- Value(jbyte b) { val.b = b; }
- Value(jchar c) { val.c = c; }
- Value(jshort s) { val.s = s; }
- Value(jint i) { val.i = i; }
- Value(jlong j) { val.j = j; }
- Value(jfloat f) { val.f = f; }
- Value(jdouble d) { val.d = d; }
- Value(jobject l) { val.l = l; }
-
- jvalue val;
-};
-
-} // namespace detail
-
-using namespace detail;
-
-// Base class for Method<>, Field<>, and Constructor<>.
-class Accessor
-{
- static void GetNsresult(JNIEnv* env, nsresult* rv)
- {
- if (env->ExceptionCheck()) {
-#ifdef MOZ_CHECK_JNI
- env->ExceptionDescribe();
-#endif
- env->ExceptionClear();
- *rv = NS_ERROR_FAILURE;
- } else {
- *rv = NS_OK;
- }
- }
-
-protected:
- // Called after making a JNIEnv call.
- template<class Traits>
- static void EndAccess(const typename Traits::Owner::Context& ctx,
- nsresult* rv)
- {
- if (Traits::exceptionMode == ExceptionMode::ABORT) {
- MOZ_CATCH_JNI_EXCEPTION(ctx.Env());
-
- } else if (Traits::exceptionMode == ExceptionMode::NSRESULT) {
- GetNsresult(ctx.Env(), rv);
- }
- }
-};
-
-
-// Member<> is used to call a JNI method given a traits class.
-template<class Traits, typename ReturnType = typename Traits::ReturnType>
-class Method : public Accessor
-{
- typedef Accessor Base;
- typedef typename Traits::Owner::Context Context;
-
-protected:
- static jmethodID sID;
-
- static void BeginAccess(const Context& ctx)
- {
- MOZ_ASSERT_JNI_THREAD(Traits::callingThread);
- static_assert(Traits::dispatchTarget == DispatchTarget::CURRENT,
- "Dispatching not supported for method call");
-
- if (sID) {
- return;
- }
-
- if (Traits::isStatic) {
- MOZ_ALWAYS_TRUE(sID = AndroidBridge::GetStaticMethodID(
- ctx.Env(), ctx.ClassRef(), Traits::name, Traits::signature));
- } else {
- MOZ_ALWAYS_TRUE(sID = AndroidBridge::GetMethodID(
- ctx.Env(), ctx.ClassRef(), Traits::name, Traits::signature));
- }
- }
-
- static void EndAccess(const Context& ctx, nsresult* rv)
- {
- return Base::EndAccess<Traits>(ctx, rv);
- }
-
-public:
- template<typename... Args>
- static ReturnType Call(const Context& ctx, nsresult* rv, const Args&... args)
- {
- JNIEnv* const env = ctx.Env();
- BeginAccess(ctx);
-
- jvalue jargs[] = {
- Value(TypeAdapter<Args>::FromNative(env, args)).val ...
- };
-
- auto result = TypeAdapter<ReturnType>::ToNative(env,
- Traits::isStatic ?
- (env->*TypeAdapter<ReturnType>::StaticCall)(
- ctx.RawClassRef(), sID, jargs) :
- (env->*TypeAdapter<ReturnType>::Call)(
- ctx.Get(), sID, jargs));
-
- EndAccess(ctx, rv);
- return result;
- }
-};
-
-// Define sID member.
-template<class T, typename R> jmethodID Method<T, R>::sID;
-
-
-// Specialize void because C++ forbids us from
-// using a "void" temporary result variable.
-template<class Traits>
-class Method<Traits, void> : public Method<Traits, bool>
-{
- typedef Method<Traits, bool> Base;
- typedef typename Traits::Owner::Context Context;
-
-public:
- template<typename... Args>
- static void Call(const Context& ctx, nsresult* rv,
- const Args&... args)
- {
- JNIEnv* const env = ctx.Env();
- Base::BeginAccess(ctx);
-
- jvalue jargs[] = {
- Value(TypeAdapter<Args>::FromNative(env, args)).val ...
- };
-
- if (Traits::isStatic) {
- env->CallStaticVoidMethodA(ctx.RawClassRef(), Base::sID, jargs);
- } else {
- env->CallVoidMethodA(ctx.Get(), Base::sID, jargs);
- }
-
- Base::EndAccess(ctx, rv);
- }
-};
-
-
-// Constructor<> is used to construct a JNI instance given a traits class.
-template<class Traits>
-class Constructor : protected Method<Traits, typename Traits::ReturnType> {
- typedef typename Traits::Owner::Context Context;
- typedef typename Traits::ReturnType ReturnType;
- typedef Method<Traits, ReturnType> Base;
-
-public:
- template<typename... Args>
- static ReturnType Call(const Context& ctx, nsresult* rv,
- const Args&... args)
- {
- JNIEnv* const env = ctx.Env();
- Base::BeginAccess(ctx);
-
- jvalue jargs[] = {
- Value(TypeAdapter<Args>::FromNative(env, args)).val ...
- };
-
- auto result = TypeAdapter<ReturnType>::ToNative(
- env, env->NewObjectA(ctx.RawClassRef(), Base::sID, jargs));
-
- Base::EndAccess(ctx, rv);
- return result;
- }
-};
-
-
-// Field<> is used to access a JNI field given a traits class.
-template<class Traits>
-class Field : public Accessor
-{
- typedef Accessor Base;
- typedef typename Traits::Owner::Context Context;
- typedef typename Traits::ReturnType GetterType;
- typedef typename Traits::SetterType SetterType;
-
-private:
-
- static jfieldID sID;
-
- static void BeginAccess(const Context& ctx)
- {
- MOZ_ASSERT_JNI_THREAD(Traits::callingThread);
- static_assert(Traits::dispatchTarget == DispatchTarget::CURRENT,
- "Dispatching not supported for field access");
-
- if (sID) {
- return;
- }
-
- if (Traits::isStatic) {
- MOZ_ALWAYS_TRUE(sID = AndroidBridge::GetStaticFieldID(
- ctx.Env(), ctx.ClassRef(), Traits::name, Traits::signature));
- } else {
- MOZ_ALWAYS_TRUE(sID = AndroidBridge::GetFieldID(
- ctx.Env(), ctx.ClassRef(), Traits::name, Traits::signature));
- }
- }
-
- static void EndAccess(const Context& ctx, nsresult* rv)
- {
- return Base::EndAccess<Traits>(ctx, rv);
- }
-
-public:
- static GetterType Get(const Context& ctx, nsresult* rv)
- {
- JNIEnv* const env = ctx.Env();
- BeginAccess(ctx);
-
- auto result = TypeAdapter<GetterType>::ToNative(
- env, Traits::isStatic ?
-
- (env->*TypeAdapter<GetterType>::StaticGet)
- (ctx.RawClassRef(), sID) :
-
- (env->*TypeAdapter<GetterType>::Get)
- (ctx.Get(), sID));
-
- EndAccess(ctx, rv);
- return result;
- }
-
- static void Set(const Context& ctx, nsresult* rv, SetterType val)
- {
- JNIEnv* const env = ctx.Env();
- BeginAccess(ctx);
-
- if (Traits::isStatic) {
- (env->*TypeAdapter<SetterType>::StaticSet)(
- ctx.RawClassRef(), sID,
- TypeAdapter<SetterType>::FromNative(env, val));
- } else {
- (env->*TypeAdapter<SetterType>::Set)(
- ctx.Get(), sID,
- TypeAdapter<SetterType>::FromNative(env, val));
- }
-
- EndAccess(ctx, rv);
- }
-};
-
-// Define sID member.
-template<class T> jfieldID Field<T>::sID;
-
-
-// Define the sClassRef member declared in Refs.h and
-// used by Method and Field above.
-template<class C, typename T> jclass Context<C, T>::sClassRef;
-
-} // namespace jni
-} // namespace mozilla
-
-#endif // mozilla_jni_Accessors_h__
diff --git a/widget/android/jni/Natives.h b/widget/android/jni/Natives.h
deleted file mode 100644
index 511d96a87..000000000
--- a/widget/android/jni/Natives.h
+++ /dev/null
@@ -1,707 +0,0 @@
-#ifndef mozilla_jni_Natives_h__
-#define mozilla_jni_Natives_h__
-
-#include <jni.h>
-
-#include "mozilla/IndexSequence.h"
-#include "mozilla/Move.h"
-#include "mozilla/Tuple.h"
-#include "mozilla/TypeTraits.h"
-#include "mozilla/UniquePtr.h"
-#include "mozilla/WeakPtr.h"
-#include "mozilla/Unused.h"
-#include "mozilla/jni/Accessors.h"
-#include "mozilla/jni/Refs.h"
-#include "mozilla/jni/Types.h"
-#include "mozilla/jni/Utils.h"
-
-namespace mozilla {
-namespace jni {
-
-/**
- * C++ classes implementing instance (non-static) native methods can choose
- * from one of two ownership models, when associating a C++ object with a Java
- * instance.
- *
- * * If the C++ class inherits from mozilla::SupportsWeakPtr, weak pointers
- * will be used. The Java instance will store and own the pointer to a
- * WeakPtr object. The C++ class itself is otherwise not owned or directly
- * referenced. To attach a Java instance to a C++ instance, pass in a pointer
- * to the C++ class (i.e. MyClass*).
- *
- * class MyClass : public SupportsWeakPtr<MyClass>
- * , public MyJavaClass::Natives<MyClass>
- * {
- * // ...
- *
- * public:
- * MOZ_DECLARE_WEAKREFERENCE_TYPENAME(MyClass)
- * using MyJavaClass::Natives<MyClass>::Dispose;
- *
- * void AttachTo(const MyJavaClass::LocalRef& instance)
- * {
- * MyJavaClass::Natives<MyClass>::AttachInstance(instance, this);
- *
- * // "instance" does NOT own "this", so the C++ object
- * // lifetime is separate from the Java object lifetime.
- * }
- * };
- *
- * * If the C++ class doesn't inherit from mozilla::SupportsWeakPtr, the Java
- * instance will store and own a pointer to the C++ object itself. This
- * pointer must not be stored or deleted elsewhere. To attach a Java instance
- * to a C++ instance, pass in a reference to a UniquePtr of the C++ class
- * (i.e. UniquePtr<MyClass>).
- *
- * class MyClass : public MyJavaClass::Natives<MyClass>
- * {
- * // ...
- *
- * public:
- * using MyJavaClass::Natives<MyClass>::Dispose;
- *
- * static void AttachTo(const MyJavaClass::LocalRef& instance)
- * {
- * MyJavaClass::Natives<MyClass>::AttachInstance(
- * instance, mozilla::MakeUnique<MyClass>());
- *
- * // "instance" owns the newly created C++ object, so the C++
- * // object is destroyed as soon as instance.dispose() is called.
- * }
- * };
- */
-
-namespace detail {
-
-inline uintptr_t CheckNativeHandle(JNIEnv* env, uintptr_t handle)
-{
- if (!handle) {
- if (!env->ExceptionCheck()) {
- ThrowException(env, "java/lang/NullPointerException",
- "Null native pointer");
- }
- return 0;
- }
- return handle;
-}
-
-template<class Impl, bool UseWeakPtr = mozilla::IsBaseOf<
- SupportsWeakPtr<Impl>, Impl>::value /* = false */>
-struct NativePtr
-{
- static Impl* Get(JNIEnv* env, jobject instance)
- {
- return reinterpret_cast<Impl*>(CheckNativeHandle(
- env, GetNativeHandle(env, instance)));
- }
-
- template<class LocalRef>
- static Impl* Get(const LocalRef& instance)
- {
- return Get(instance.Env(), instance.Get());
- }
-
- template<class LocalRef>
- static void Set(const LocalRef& instance, UniquePtr<Impl>&& ptr)
- {
- Clear(instance);
- SetNativeHandle(instance.Env(), instance.Get(),
- reinterpret_cast<uintptr_t>(ptr.release()));
- MOZ_CATCH_JNI_EXCEPTION(instance.Env());
- }
-
- template<class LocalRef>
- static void Clear(const LocalRef& instance)
- {
- UniquePtr<Impl> ptr(reinterpret_cast<Impl*>(
- GetNativeHandle(instance.Env(), instance.Get())));
- MOZ_CATCH_JNI_EXCEPTION(instance.Env());
-
- if (ptr) {
- SetNativeHandle(instance.Env(), instance.Get(), 0);
- MOZ_CATCH_JNI_EXCEPTION(instance.Env());
- }
- }
-};
-
-template<class Impl>
-struct NativePtr<Impl, /* UseWeakPtr = */ true>
-{
- static Impl* Get(JNIEnv* env, jobject instance)
- {
- const auto ptr = reinterpret_cast<WeakPtr<Impl>*>(
- CheckNativeHandle(env, GetNativeHandle(env, instance)));
- if (!ptr) {
- return nullptr;
- }
-
- Impl* const impl = *ptr;
- if (!impl) {
- ThrowException(env, "java/lang/NullPointerException",
- "Native object already released");
- }
- return impl;
- }
-
- template<class LocalRef>
- static Impl* Get(const LocalRef& instance)
- {
- return Get(instance.Env(), instance.Get());
- }
-
- template<class LocalRef>
- static void Set(const LocalRef& instance, Impl* ptr)
- {
- Clear(instance);
- SetNativeHandle(instance.Env(), instance.Get(),
- reinterpret_cast<uintptr_t>(new WeakPtr<Impl>(ptr)));
- MOZ_CATCH_JNI_EXCEPTION(instance.Env());
- }
-
- template<class LocalRef>
- static void Clear(const LocalRef& instance)
- {
- const auto ptr = reinterpret_cast<WeakPtr<Impl>*>(
- GetNativeHandle(instance.Env(), instance.Get()));
- MOZ_CATCH_JNI_EXCEPTION(instance.Env());
-
- if (ptr) {
- SetNativeHandle(instance.Env(), instance.Get(), 0);
- MOZ_CATCH_JNI_EXCEPTION(instance.Env());
- delete ptr;
- }
- }
-};
-
-} // namespace detail
-
-using namespace detail;
-
-/**
- * For JNI native methods that are dispatched to a proxy, i.e. using
- * @WrapForJNI(dispatchTo = "proxy"), the implementing C++ class must provide a
- * OnNativeCall member. Subsequently, every native call is automatically
- * wrapped in a functor object, and the object is passed to OnNativeCall. The
- * OnNativeCall implementation can choose to invoke the call, save it, dispatch
- * it to a different thread, etc. Each copy of functor may only be invoked
- * once.
- *
- * class MyClass : public MyJavaClass::Natives<MyClass>
- * {
- * // ...
- *
- * template<class Functor>
- * class ProxyRunnable final : public Runnable
- * {
- * Functor mCall;
- * public:
- * ProxyRunnable(Functor&& call) : mCall(mozilla::Move(call)) {}
- * virtual void run() override { mCall(); }
- * };
- *
- * public:
- * template<class Functor>
- * static void OnNativeCall(Functor&& call)
- * {
- * RunOnAnotherThread(new ProxyRunnable(mozilla::Move(call)));
- * }
- * };
- */
-
-namespace detail {
-
-// ProxyArg is used to handle JNI ref arguments for proxies. Because a proxied
-// call may happen outside of the original JNI native call, we must save all
-// JNI ref arguments as global refs to avoid the arguments going out of scope.
-template<typename T>
-struct ProxyArg
-{
- static_assert(mozilla::IsPod<T>::value, "T must be primitive type");
-
- // Primitive types can be saved by value.
- typedef T Type;
- typedef typename TypeAdapter<T>::JNIType JNIType;
-
- static void Clear(JNIEnv* env, Type&) {}
-
- static Type From(JNIEnv* env, JNIType val)
- {
- return TypeAdapter<T>::ToNative(env, val);
- }
-};
-
-template<class C, typename T>
-struct ProxyArg<Ref<C, T>>
-{
- // Ref types need to be saved by global ref.
- typedef typename C::GlobalRef Type;
- typedef typename TypeAdapter<Ref<C, T>>::JNIType JNIType;
-
- static void Clear(JNIEnv* env, Type& ref) { ref.Clear(env); }
-
- static Type From(JNIEnv* env, JNIType val)
- {
- return Type(env, C::Ref::From(val));
- }
-};
-
-template<typename C> struct ProxyArg<const C&> : ProxyArg<C> {};
-template<> struct ProxyArg<StringParam> : ProxyArg<String::Ref> {};
-template<class C> struct ProxyArg<LocalRef<C>> : ProxyArg<typename C::Ref> {};
-
-// ProxyNativeCall implements the functor object that is passed to OnNativeCall
-template<class Impl, class Owner, bool IsStatic,
- bool HasThisArg /* has instance/class local ref in the call */,
- typename... Args>
-class ProxyNativeCall : public AbstractCall
-{
- // "this arg" refers to the Class::LocalRef (for static methods) or
- // Owner::LocalRef (for instance methods) that we optionally (as indicated
- // by HasThisArg) pass into the destination C++ function.
- typedef typename mozilla::Conditional<IsStatic,
- Class, Owner>::Type ThisArgClass;
- typedef typename mozilla::Conditional<IsStatic,
- jclass, jobject>::Type ThisArgJNIType;
-
- // Type signature of the destination C++ function, which matches the
- // Method template parameter in NativeStubImpl::Wrap.
- typedef typename mozilla::Conditional<IsStatic,
- typename mozilla::Conditional<HasThisArg,
- void (*) (const Class::LocalRef&, Args...),
- void (*) (Args...)>::Type,
- typename mozilla::Conditional<HasThisArg,
- void (Impl::*) (const typename Owner::LocalRef&, Args...),
- void (Impl::*) (Args...)>::Type>::Type NativeCallType;
-
- // Destination C++ function.
- NativeCallType mNativeCall;
- // Saved this arg.
- typename ThisArgClass::GlobalRef mThisArg;
- // Saved arguments.
- mozilla::Tuple<typename ProxyArg<Args>::Type...> mArgs;
-
- // We cannot use IsStatic and HasThisArg directly (without going through
- // extra hoops) because GCC complains about invalid overloads, so we use
- // another pair of template parameters, Static and ThisArg.
-
- template<bool Static, bool ThisArg, size_t... Indices>
- typename mozilla::EnableIf<Static && ThisArg, void>::Type
- Call(const Class::LocalRef& cls,
- mozilla::IndexSequence<Indices...>) const
- {
- (*mNativeCall)(cls, mozilla::Get<Indices>(mArgs)...);
- }
-
- template<bool Static, bool ThisArg, size_t... Indices>
- typename mozilla::EnableIf<Static && !ThisArg, void>::Type
- Call(const Class::LocalRef& cls,
- mozilla::IndexSequence<Indices...>) const
- {
- (*mNativeCall)(mozilla::Get<Indices>(mArgs)...);
- }
-
- template<bool Static, bool ThisArg, size_t... Indices>
- typename mozilla::EnableIf<!Static && ThisArg, void>::Type
- Call(const typename Owner::LocalRef& inst,
- mozilla::IndexSequence<Indices...>) const
- {
- Impl* const impl = NativePtr<Impl>::Get(inst);
- MOZ_CATCH_JNI_EXCEPTION(inst.Env());
- (impl->*mNativeCall)(inst, mozilla::Get<Indices>(mArgs)...);
- }
-
- template<bool Static, bool ThisArg, size_t... Indices>
- typename mozilla::EnableIf<!Static && !ThisArg, void>::Type
- Call(const typename Owner::LocalRef& inst,
- mozilla::IndexSequence<Indices...>) const
- {
- Impl* const impl = NativePtr<Impl>::Get(inst);
- MOZ_CATCH_JNI_EXCEPTION(inst.Env());
- (impl->*mNativeCall)(mozilla::Get<Indices>(mArgs)...);
- }
-
- template<size_t... Indices>
- void Clear(JNIEnv* env, mozilla::IndexSequence<Indices...>)
- {
- int dummy[] = {
- (ProxyArg<Args>::Clear(env, Get<Indices>(mArgs)), 0)...
- };
- mozilla::Unused << dummy;
- }
-
-public:
- // The class that implements the call target.
- typedef Impl TargetClass;
- typedef typename ThisArgClass::Param ThisArgType;
-
- static const bool isStatic = IsStatic;
-
- ProxyNativeCall(ThisArgJNIType thisArg,
- NativeCallType nativeCall,
- JNIEnv* env,
- typename ProxyArg<Args>::JNIType... args)
- : mNativeCall(nativeCall)
- , mThisArg(env, ThisArgClass::Ref::From(thisArg))
- , mArgs(ProxyArg<Args>::From(env, args)...)
- {}
-
- ProxyNativeCall(ProxyNativeCall&&) = default;
- ProxyNativeCall(const ProxyNativeCall&) = default;
-
- // Get class ref for static calls or object ref for instance calls.
- typename ThisArgClass::Param GetThisArg() const { return mThisArg; }
-
- // Return if target is the given function pointer / pointer-to-member.
- // Because we can only compare pointers of the same type, we use a
- // templated overload that is chosen only if given a different type of
- // pointer than our target pointer type.
- bool IsTarget(NativeCallType call) const { return call == mNativeCall; }
- template<typename T> bool IsTarget(T&&) const { return false; }
-
- // Redirect the call to another function / class member with the same
- // signature as the original target. Crash if given a wrong signature.
- void SetTarget(NativeCallType call) { mNativeCall = call; }
- template<typename T> void SetTarget(T&&) const { MOZ_CRASH(); }
-
- void operator()() override
- {
- JNIEnv* const env = GetEnvForThread();
- typename ThisArgClass::LocalRef thisArg(env, mThisArg);
- Call<IsStatic, HasThisArg>(
- thisArg, typename IndexSequenceFor<Args...>::Type());
-
- // Clear all saved global refs. We do this after the call is invoked,
- // and not inside the destructor because we already have a JNIEnv here,
- // so it's more efficient to clear out the saved args here. The
- // downside is that the call can only be invoked once.
- Clear(env, typename IndexSequenceFor<Args...>::Type());
- mThisArg.Clear(env);
- }
-};
-
-template<class Impl, bool HasThisArg, typename... Args>
-struct Dispatcher
-{
- template<class Traits, bool IsStatic = Traits::isStatic,
- typename... ProxyArgs>
- static typename EnableIf<
- Traits::dispatchTarget == DispatchTarget::PROXY, void>::Type
- Run(ProxyArgs&&... args)
- {
- Impl::OnNativeCall(ProxyNativeCall<
- Impl, typename Traits::Owner, IsStatic,
- HasThisArg, Args...>(Forward<ProxyArgs>(args)...));
- }
-
- template<class Traits, bool IsStatic = Traits::isStatic,
- typename ThisArg, typename... ProxyArgs>
- static typename EnableIf<
- Traits::dispatchTarget == DispatchTarget::GECKO, void>::Type
- Run(ThisArg thisArg, ProxyArgs&&... args)
- {
- // For a static method, do not forward the "this arg" (i.e. the class
- // local ref) if the implementation does not request it. This saves us
- // a pair of calls to add/delete global ref.
- DispatchToGeckoThread(MakeUnique<ProxyNativeCall<
- Impl, typename Traits::Owner, IsStatic, HasThisArg,
- Args...>>(HasThisArg || !IsStatic ? thisArg : nullptr,
- Forward<ProxyArgs>(args)...));
- }
-
- template<class Traits, bool IsStatic = false, typename... ProxyArgs>
- static typename EnableIf<
- Traits::dispatchTarget == DispatchTarget::CURRENT, void>::Type
- Run(ProxyArgs&&... args) {}
-};
-
-} // namespace detail
-
-// Wrapper methods that convert arguments from the JNI types to the native
-// types, e.g. from jobject to jni::Object::Ref. For instance methods, the
-// wrapper methods also convert calls to calls on objects.
-//
-// We need specialization for static/non-static because the two have different
-// signatures (jobject vs jclass and Impl::*Method vs *Method).
-// We need specialization for return type, because void return type requires
-// us to not deal with the return value.
-
-// Bug 1207642 - Work around Dalvik bug by realigning stack on JNI entry
-#ifdef __i386__
-#define MOZ_JNICALL JNICALL __attribute__((force_align_arg_pointer))
-#else
-#define MOZ_JNICALL JNICALL
-#endif
-
-template<class Traits, class Impl, class Args = typename Traits::Args>
-class NativeStub;
-
-template<class Traits, class Impl, typename... Args>
-class NativeStub<Traits, Impl, jni::Args<Args...>>
-{
- using Owner = typename Traits::Owner;
- using ReturnType = typename Traits::ReturnType;
-
- static constexpr bool isStatic = Traits::isStatic;
- static constexpr bool isVoid = mozilla::IsVoid<ReturnType>::value;
-
- struct VoidType { using JNIType = void; };
- using ReturnJNIType = typename Conditional<
- isVoid, VoidType, TypeAdapter<ReturnType>>::Type::JNIType;
-
- using ReturnTypeForNonVoidInstance = typename Conditional<
- !isStatic && !isVoid, ReturnType, VoidType>::Type;
- using ReturnTypeForVoidInstance = typename Conditional<
- !isStatic && isVoid, ReturnType, VoidType&>::Type;
- using ReturnTypeForNonVoidStatic = typename Conditional<
- isStatic && !isVoid, ReturnType, VoidType>::Type;
- using ReturnTypeForVoidStatic = typename Conditional<
- isStatic && isVoid, ReturnType, VoidType&>::Type;
-
- static_assert(Traits::dispatchTarget == DispatchTarget::CURRENT || isVoid,
- "Dispatched calls must have void return type");
-
-public:
- // Non-void instance method
- template<ReturnTypeForNonVoidInstance (Impl::*Method) (Args...)>
- static MOZ_JNICALL ReturnJNIType
- Wrap(JNIEnv* env, jobject instance,
- typename TypeAdapter<Args>::JNIType... args)
- {
- MOZ_ASSERT_JNI_THREAD(Traits::callingThread);
-
- Impl* const impl = NativePtr<Impl>::Get(env, instance);
- if (!impl) {
- // There is a pending JNI exception at this point.
- return ReturnJNIType();
- }
- return TypeAdapter<ReturnType>::FromNative(env,
- (impl->*Method)(TypeAdapter<Args>::ToNative(env, args)...));
- }
-
- // Non-void instance method with instance reference
- template<ReturnTypeForNonVoidInstance (Impl::*Method)
- (const typename Owner::LocalRef&, Args...)>
- static MOZ_JNICALL ReturnJNIType
- Wrap(JNIEnv* env, jobject instance,
- typename TypeAdapter<Args>::JNIType... args)
- {
- MOZ_ASSERT_JNI_THREAD(Traits::callingThread);
-
- Impl* const impl = NativePtr<Impl>::Get(env, instance);
- if (!impl) {
- // There is a pending JNI exception at this point.
- return ReturnJNIType();
- }
- auto self = Owner::LocalRef::Adopt(env, instance);
- const auto res = TypeAdapter<ReturnType>::FromNative(env,
- (impl->*Method)(self, TypeAdapter<Args>::ToNative(env, args)...));
- self.Forget();
- return res;
- }
-
- // Void instance method
- template<ReturnTypeForVoidInstance (Impl::*Method) (Args...)>
- static MOZ_JNICALL void
- Wrap(JNIEnv* env, jobject instance,
- typename TypeAdapter<Args>::JNIType... args)
- {
- MOZ_ASSERT_JNI_THREAD(Traits::callingThread);
-
- if (Traits::dispatchTarget != DispatchTarget::CURRENT) {
- Dispatcher<Impl, /* HasThisArg */ false, Args...>::
- template Run<Traits>(instance, Method, env, args...);
- return;
- }
-
- Impl* const impl = NativePtr<Impl>::Get(env, instance);
- if (!impl) {
- // There is a pending JNI exception at this point.
- return;
- }
- (impl->*Method)(TypeAdapter<Args>::ToNative(env, args)...);
- }
-
- // Void instance method with instance reference
- template<ReturnTypeForVoidInstance (Impl::*Method)
- (const typename Owner::LocalRef&, Args...)>
- static MOZ_JNICALL void
- Wrap(JNIEnv* env, jobject instance,
- typename TypeAdapter<Args>::JNIType... args)
- {
- MOZ_ASSERT_JNI_THREAD(Traits::callingThread);
-
- if (Traits::dispatchTarget != DispatchTarget::CURRENT) {
- Dispatcher<Impl, /* HasThisArg */ true, Args...>::
- template Run<Traits>(instance, Method, env, args...);
- return;
- }
-
- Impl* const impl = NativePtr<Impl>::Get(env, instance);
- if (!impl) {
- // There is a pending JNI exception at this point.
- return;
- }
- auto self = Owner::LocalRef::Adopt(env, instance);
- (impl->*Method)(self, TypeAdapter<Args>::ToNative(env, args)...);
- self.Forget();
- }
-
- // Overload for DisposeNative
- template<ReturnTypeForVoidInstance (*DisposeNative)
- (const typename Owner::LocalRef&)>
- static MOZ_JNICALL void
- Wrap(JNIEnv* env, jobject instance)
- {
- MOZ_ASSERT_JNI_THREAD(Traits::callingThread);
-
- if (Traits::dispatchTarget != DispatchTarget::CURRENT) {
- using LocalRef = typename Owner::LocalRef;
- Dispatcher<Impl, /* HasThisArg */ false, const LocalRef&>::
- template Run<Traits, /* IsStatic */ true>(
- /* ThisArg */ nullptr, DisposeNative, env, instance);
- return;
- }
-
- auto self = Owner::LocalRef::Adopt(env, instance);
- (Impl::DisposeNative)(self);
- self.Forget();
- }
-
- // Non-void static method
- template<ReturnTypeForNonVoidStatic (*Method) (Args...)>
- static MOZ_JNICALL ReturnJNIType
- Wrap(JNIEnv* env, jclass, typename TypeAdapter<Args>::JNIType... args)
- {
- MOZ_ASSERT_JNI_THREAD(Traits::callingThread);
-
- return TypeAdapter<ReturnType>::FromNative(env,
- (*Method)(TypeAdapter<Args>::ToNative(env, args)...));
- }
-
- // Non-void static method with class reference
- template<ReturnTypeForNonVoidStatic (*Method)
- (const Class::LocalRef&, Args...)>
- static MOZ_JNICALL ReturnJNIType
- Wrap(JNIEnv* env, jclass cls, typename TypeAdapter<Args>::JNIType... args)
- {
- MOZ_ASSERT_JNI_THREAD(Traits::callingThread);
-
- auto clazz = Class::LocalRef::Adopt(env, cls);
- const auto res = TypeAdapter<ReturnType>::FromNative(env,
- (*Method)(clazz, TypeAdapter<Args>::ToNative(env, args)...));
- clazz.Forget();
- return res;
- }
-
- // Void static method
- template<ReturnTypeForVoidStatic (*Method) (Args...)>
- static MOZ_JNICALL void
- Wrap(JNIEnv* env, jclass cls, typename TypeAdapter<Args>::JNIType... args)
- {
- MOZ_ASSERT_JNI_THREAD(Traits::callingThread);
-
- if (Traits::dispatchTarget != DispatchTarget::CURRENT) {
- Dispatcher<Impl, /* HasThisArg */ false, Args...>::
- template Run<Traits>(cls, Method, env, args...);
- return;
- }
-
- (*Method)(TypeAdapter<Args>::ToNative(env, args)...);
- }
-
- // Void static method with class reference
- template<ReturnTypeForVoidStatic (*Method)
- (const Class::LocalRef&, Args...)>
- static MOZ_JNICALL void
- Wrap(JNIEnv* env, jclass cls, typename TypeAdapter<Args>::JNIType... args)
- {
- MOZ_ASSERT_JNI_THREAD(Traits::callingThread);
-
- if (Traits::dispatchTarget != DispatchTarget::CURRENT) {
- Dispatcher<Impl, /* HasThisArg */ true, Args...>::
- template Run<Traits>(cls, Method, env, args...);
- return;
- }
-
- auto clazz = Class::LocalRef::Adopt(env, cls);
- (*Method)(clazz, TypeAdapter<Args>::ToNative(env, args)...);
- clazz.Forget();
- }
-};
-
-// Generate a JNINativeMethod from a native
-// method's traits class and a wrapped stub.
-template<class Traits, typename Ret, typename... Args>
-constexpr JNINativeMethod MakeNativeMethod(MOZ_JNICALL Ret (*stub)(JNIEnv*, Args...))
-{
- return {
- Traits::name,
- Traits::signature,
- reinterpret_cast<void*>(stub)
- };
-}
-
-// Class inherited by implementing class.
-template<class Cls, class Impl>
-class NativeImpl
-{
- typedef typename Cls::template Natives<Impl> Natives;
-
- static bool sInited;
-
-public:
- static void Init() {
- if (sInited) {
- return;
- }
- const auto& ctx = typename Cls::Context();
- ctx.Env()->RegisterNatives(
- ctx.ClassRef(), Natives::methods,
- sizeof(Natives::methods) / sizeof(Natives::methods[0]));
- MOZ_CATCH_JNI_EXCEPTION(ctx.Env());
- sInited = true;
- }
-
-protected:
-
- // Associate a C++ instance with a Java instance.
- static void AttachNative(const typename Cls::LocalRef& instance,
- SupportsWeakPtr<Impl>* ptr)
- {
- static_assert(mozilla::IsBaseOf<SupportsWeakPtr<Impl>, Impl>::value,
- "Attach with UniquePtr&& when not using WeakPtr");
- return NativePtr<Impl>::Set(instance, static_cast<Impl*>(ptr));
- }
-
- static void AttachNative(const typename Cls::LocalRef& instance,
- UniquePtr<Impl>&& ptr)
- {
- static_assert(!mozilla::IsBaseOf<SupportsWeakPtr<Impl>, Impl>::value,
- "Attach with SupportsWeakPtr* when using WeakPtr");
- return NativePtr<Impl>::Set(instance, mozilla::Move(ptr));
- }
-
- // Get the C++ instance associated with a Java instance.
- // There is always a pending exception if the return value is nullptr.
- static Impl* GetNative(const typename Cls::LocalRef& instance) {
- return NativePtr<Impl>::Get(instance);
- }
-
- static void DisposeNative(const typename Cls::LocalRef& instance) {
- NativePtr<Impl>::Clear(instance);
- }
-
- NativeImpl() {
- // Initialize on creation if not already initialized.
- Init();
- }
-};
-
-// Define static member.
-template<class C, class I>
-bool NativeImpl<C, I>::sInited;
-
-} // namespace jni
-} // namespace mozilla
-
-#endif // mozilla_jni_Natives_h__
diff --git a/widget/android/jni/Refs.h b/widget/android/jni/Refs.h
deleted file mode 100644
index 9f54ee5cd..000000000
--- a/widget/android/jni/Refs.h
+++ /dev/null
@@ -1,953 +0,0 @@
-#ifndef mozilla_jni_Refs_h__
-#define mozilla_jni_Refs_h__
-
-#include <jni.h>
-
-#include "mozilla/Move.h"
-#include "mozilla/jni/Utils.h"
-
-#include "nsError.h" // for nsresult
-#include "nsString.h"
-#include "nsTArray.h"
-
-namespace mozilla {
-namespace jni {
-
-// Wrapped object reference (e.g. jobject, jclass, etc...)
-template<class Cls, typename JNIType> class Ref;
-// Represents a calling context for JNI methods.
-template<class Cls, typename JNIType> class Context;
-// Wrapped local reference that inherits from Ref.
-template<class Cls> class LocalRef;
-// Wrapped global reference that inherits from Ref.
-template<class Cls> class GlobalRef;
-// Wrapped dangling reference that's owned by someone else.
-template<class Cls> class DependentRef;
-
-
-// Class to hold the native types of a method's arguments.
-// For example, if a method has signature (ILjava/lang/String;)V,
-// its arguments class would be jni::Args<int32_t, jni::String::Param>
-template<typename...>
-struct Args {};
-
-
-class Object;
-
-// Base class for Ref and its specializations.
-template<class Cls, typename Type>
-class Ref
-{
- template<class C, typename T> friend class Ref;
-
- using Self = Ref<Cls, Type>;
- using bool_type = void (Self::*)() const;
- void non_null_reference() const {}
-
- // A Cls-derivative that allows copying
- // (e.g. when acting as a return value).
- struct CopyableCtx : public Context<Cls, Type>
- {
- CopyableCtx(JNIEnv* env, Type instance)
- : Context<Cls, Type>(env, instance)
- {}
-
- CopyableCtx(const CopyableCtx& cls)
- : Context<Cls, Type>(cls.Env(), cls.Get())
- {}
- };
-
- // Private copy constructor so that there's no danger of assigning a
- // temporary LocalRef/GlobalRef to a Ref, and potentially use the Ref
- // after the source had been freed.
- Ref(const Ref&) = default;
-
-protected:
- static JNIEnv* FindEnv()
- {
- return Cls::callingThread == CallingThread::GECKO ?
- GetGeckoThreadEnv() : GetEnvForThread();
- }
-
- Type mInstance;
-
- // Protected jobject constructor because outside code should be using
- // Ref::From. Using Ref::From makes it very easy to see which code is using
- // raw JNI types for future refactoring.
- explicit Ref(Type instance) : mInstance(instance) {}
-
-public:
- using JNIType = Type;
-
- // Construct a Ref form a raw JNI reference.
- static Ref<Cls, Type> From(JNIType obj)
- {
- return Ref<Cls, Type>(obj);
- }
-
- // Construct a Ref form a generic object reference.
- static Ref<Cls, Type> From(const Ref<Object, jobject>& obj)
- {
- return Ref<Cls, Type>(JNIType(obj.Get()));
- }
-
- MOZ_IMPLICIT Ref(decltype(nullptr)) : mInstance(nullptr) {}
-
- // Get the raw JNI reference.
- JNIType Get() const
- {
- return mInstance;
- }
-
- bool operator==(const Ref& other) const
- {
- // Treat two references of the same object as being the same.
- return mInstance == other.mInstance || JNI_FALSE !=
- FindEnv()->IsSameObject(mInstance, other.mInstance);
- }
-
- bool operator!=(const Ref& other) const
- {
- return !operator==(other);
- }
-
- bool operator==(decltype(nullptr)) const
- {
- return !mInstance;
- }
-
- bool operator!=(decltype(nullptr)) const
- {
- return !!mInstance;
- }
-
- CopyableCtx operator->() const
- {
- return CopyableCtx(FindEnv(), mInstance);
- }
-
- // Any ref can be cast to an object ref.
- operator Ref<Object, jobject>() const
- {
- return Ref<Object, jobject>(mInstance);
- }
-
- // Null checking (e.g. !!ref) using the safe-bool idiom.
- operator bool_type() const
- {
- return mInstance ? &Self::non_null_reference : nullptr;
- }
-
- // We don't allow implicit conversion to jobject because that can lead
- // to easy mistakes such as assigning a temporary LocalRef to a jobject,
- // and using the jobject after the LocalRef has been freed.
-
- // We don't allow explicit conversion, to make outside code use Ref::Get.
- // Using Ref::Get makes it very easy to see which code is using raw JNI
- // types to make future refactoring easier.
-
- // operator JNIType() const = delete;
-};
-
-
-// Represents a calling context for JNI methods.
-template<class Cls, typename Type>
-class Context : public Ref<Cls, Type>
-{
- using Ref = jni::Ref<Cls, Type>;
-
- static jclass sClassRef; // global reference
-
-protected:
- JNIEnv* const mEnv;
-
-public:
- static jclass RawClassRef()
- {
- return sClassRef;
- }
-
- Context()
- : Ref(nullptr)
- , mEnv(Ref::FindEnv())
- {}
-
- Context(JNIEnv* env, Type instance)
- : Ref(instance)
- , mEnv(env)
- {}
-
- jclass ClassRef() const
- {
- if (!sClassRef) {
- const jclass cls = GetClassRef(mEnv, Cls::name);
- sClassRef = jclass(mEnv->NewGlobalRef(cls));
- mEnv->DeleteLocalRef(cls);
- }
- return sClassRef;
- }
-
- JNIEnv* Env() const
- {
- return mEnv;
- }
-
- bool operator==(const Ref& other) const
- {
- // Treat two references of the same object as being the same.
- return Ref::mInstance == other.mInstance || JNI_FALSE !=
- mEnv->IsSameObject(Ref::mInstance, other.mInstance);
- }
-
- bool operator!=(const Ref& other) const
- {
- return !operator==(other);
- }
-
- bool operator==(decltype(nullptr)) const
- {
- return !Ref::mInstance;
- }
-
- bool operator!=(decltype(nullptr)) const
- {
- return !!Ref::mInstance;
- }
-
- Cls operator->() const
- {
- MOZ_ASSERT(Ref::mInstance, "Null jobject");
- return Cls(*this);
- }
-};
-
-
-template<class Cls, typename Type = jobject>
-class ObjectBase
-{
-protected:
- const jni::Context<Cls, Type>& mCtx;
-
- jclass ClassRef() const { return mCtx.ClassRef(); }
- JNIEnv* Env() const { return mCtx.Env(); }
- Type Instance() const { return mCtx.Get(); }
-
-public:
- using Ref = jni::Ref<Cls, Type>;
- using Context = jni::Context<Cls, Type>;
- using LocalRef = jni::LocalRef<Cls>;
- using GlobalRef = jni::GlobalRef<Cls>;
- using Param = const Ref&;
-
- static const CallingThread callingThread = CallingThread::ANY;
- static const char name[];
-
- explicit ObjectBase(const Context& ctx) : mCtx(ctx) {}
-
- Cls* operator->()
- {
- return static_cast<Cls*>(this);
- }
-};
-
-// Binding for a plain jobject.
-class Object : public ObjectBase<Object, jobject>
-{
-public:
- explicit Object(const Context& ctx) : ObjectBase<Object, jobject>(ctx) {}
-};
-
-// Binding for a built-in object reference other than jobject.
-template<typename T>
-class TypedObject : public ObjectBase<TypedObject<T>, T>
-{
-public:
- explicit TypedObject(const Context<TypedObject<T>, T>& ctx)
- : ObjectBase<TypedObject<T>, T>(ctx)
- {}
-};
-
-
-// Define bindings for built-in types.
-using String = TypedObject<jstring>;
-using Class = TypedObject<jclass>;
-using Throwable = TypedObject<jthrowable>;
-
-using BooleanArray = TypedObject<jbooleanArray>;
-using ByteArray = TypedObject<jbyteArray>;
-using CharArray = TypedObject<jcharArray>;
-using ShortArray = TypedObject<jshortArray>;
-using IntArray = TypedObject<jintArray>;
-using LongArray = TypedObject<jlongArray>;
-using FloatArray = TypedObject<jfloatArray>;
-using DoubleArray = TypedObject<jdoubleArray>;
-using ObjectArray = TypedObject<jobjectArray>;
-
-
-namespace detail {
-
-// See explanation in LocalRef.
-template<class Cls> struct GenericObject { using Type = Object; };
-template<> struct GenericObject<Object>
-{
- struct Type {
- using Ref = jni::Ref<Type, jobject>;
- using Context = jni::Context<Type, jobject>;
- };
-};
-template<class Cls> struct GenericLocalRef
-{
- template<class C> struct Type : jni::Object {};
-};
-template<> struct GenericLocalRef<Object>
-{
- template<class C> using Type = jni::LocalRef<C>;
-};
-
-} // namespace
-
-template<class Cls>
-class LocalRef : public Cls::Context
-{
- template<class C> friend class LocalRef;
-
- using Ctx = typename Cls::Context;
- using Ref = typename Cls::Ref;
- using JNIType = typename Ref::JNIType;
-
- // In order to be able to convert LocalRef<Object> to LocalRef<Cls>, we
- // need constructors and copy assignment operators that take in a
- // LocalRef<Object> argument. However, if Cls *is* Object, we would have
- // duplicated constructors and operators with LocalRef<Object> arguments. To
- // avoid this conflict, we use GenericObject, which is defined as Object for
- // LocalRef<non-Object> and defined as a dummy class for LocalRef<Object>.
- using GenericObject = typename detail::GenericObject<Cls>::Type;
-
- // Similarly, GenericLocalRef is useed to convert LocalRef<Cls> to,
- // LocalRef<Object>. It's defined as LocalRef<C> for Cls == Object,
- // and defined as a dummy template class for Cls != Object.
- template<class C> using GenericLocalRef
- = typename detail::GenericLocalRef<Cls>::template Type<C>;
-
- static JNIType NewLocalRef(JNIEnv* env, JNIType obj)
- {
- return JNIType(obj ? env->NewLocalRef(obj) : nullptr);
- }
-
- LocalRef(JNIEnv* env, JNIType instance) : Ctx(env, instance) {}
-
- LocalRef& swap(LocalRef& other)
- {
- auto instance = other.mInstance;
- other.mInstance = Ctx::mInstance;
- Ctx::mInstance = instance;
- return *this;
- }
-
-public:
- // Construct a LocalRef from a raw JNI local reference. Unlike Ref::From,
- // LocalRef::Adopt returns a LocalRef that will delete the local reference
- // when going out of scope.
- static LocalRef Adopt(JNIType instance)
- {
- return LocalRef(Ref::FindEnv(), instance);
- }
-
- static LocalRef Adopt(JNIEnv* env, JNIType instance)
- {
- return LocalRef(env, instance);
- }
-
- // Copy constructor.
- LocalRef(const LocalRef<Cls>& ref)
- : Ctx(ref.mEnv, NewLocalRef(ref.mEnv, ref.mInstance))
- {}
-
- // Move constructor.
- LocalRef(LocalRef<Cls>&& ref)
- : Ctx(ref.mEnv, ref.mInstance)
- {
- ref.mInstance = nullptr;
- }
-
- explicit LocalRef(JNIEnv* env = Ref::FindEnv())
- : Ctx(env, nullptr)
- {}
-
- // Construct a LocalRef from any Ref,
- // which means creating a new local reference.
- MOZ_IMPLICIT LocalRef(const Ref& ref)
- : Ctx(Ref::FindEnv(), nullptr)
- {
- Ctx::mInstance = NewLocalRef(Ctx::mEnv, ref.Get());
- }
-
- LocalRef(JNIEnv* env, const Ref& ref)
- : Ctx(env, NewLocalRef(env, ref.Get()))
- {}
-
- // Move a LocalRef<Object> into a LocalRef<Cls> without
- // creating/deleting local references.
- MOZ_IMPLICIT LocalRef(LocalRef<GenericObject>&& ref)
- : Ctx(ref.mEnv, JNIType(ref.mInstance))
- {
- ref.mInstance = nullptr;
- }
-
- template<class C>
- MOZ_IMPLICIT LocalRef(GenericLocalRef<C>&& ref)
- : Ctx(ref.mEnv, ref.mInstance)
- {
- ref.mInstance = nullptr;
- }
-
- // Implicitly converts nullptr to LocalRef.
- MOZ_IMPLICIT LocalRef(decltype(nullptr))
- : Ctx(Ref::FindEnv(), nullptr)
- {}
-
- ~LocalRef()
- {
- if (Ctx::mInstance) {
- Ctx::mEnv->DeleteLocalRef(Ctx::mInstance);
- Ctx::mInstance = nullptr;
- }
- }
-
- // Get the raw JNI reference that can be used as a return value.
- // Returns the same JNI type (jobject, jstring, etc.) as the underlying Ref.
- typename Ref::JNIType Forget()
- {
- const auto obj = Ctx::Get();
- Ctx::mInstance = nullptr;
- return obj;
- }
-
- LocalRef<Cls>& operator=(LocalRef<Cls> ref)
- {
- return swap(ref);
- }
-
- LocalRef<Cls>& operator=(const Ref& ref)
- {
- LocalRef<Cls> newRef(Ctx::mEnv, ref);
- return swap(newRef);
- }
-
- LocalRef<Cls>& operator=(LocalRef<GenericObject>&& ref)
- {
- LocalRef<Cls> newRef(mozilla::Move(ref));
- return swap(newRef);
- }
-
- template<class C>
- LocalRef<Cls>& operator=(GenericLocalRef<C>&& ref)
- {
- LocalRef<Cls> newRef(mozilla::Move(ref));
- return swap(newRef);
- }
-
- LocalRef<Cls>& operator=(decltype(nullptr))
- {
- LocalRef<Cls> newRef(Ctx::mEnv, nullptr);
- return swap(newRef);
- }
-};
-
-
-template<class Cls>
-class GlobalRef : public Cls::Ref
-{
- using Ref = typename Cls::Ref;
- using JNIType = typename Ref::JNIType;
-
- static JNIType NewGlobalRef(JNIEnv* env, JNIType instance)
- {
- return JNIType(instance ? env->NewGlobalRef(instance) : nullptr);
- }
-
- GlobalRef& swap(GlobalRef& other)
- {
- auto instance = other.mInstance;
- other.mInstance = Ref::mInstance;
- Ref::mInstance = instance;
- return *this;
- }
-
-public:
- GlobalRef()
- : Ref(nullptr)
- {}
-
- // Copy constructor
- GlobalRef(const GlobalRef& ref)
- : Ref(NewGlobalRef(GetEnvForThread(), ref.mInstance))
- {}
-
- // Move constructor
- GlobalRef(GlobalRef&& ref)
- : Ref(ref.mInstance)
- {
- ref.mInstance = nullptr;
- }
-
- MOZ_IMPLICIT GlobalRef(const Ref& ref)
- : Ref(NewGlobalRef(GetEnvForThread(), ref.Get()))
- {}
-
- GlobalRef(JNIEnv* env, const Ref& ref)
- : Ref(NewGlobalRef(env, ref.Get()))
- {}
-
- MOZ_IMPLICIT GlobalRef(const LocalRef<Cls>& ref)
- : Ref(NewGlobalRef(ref.Env(), ref.Get()))
- {}
-
- // Implicitly converts nullptr to GlobalRef.
- MOZ_IMPLICIT GlobalRef(decltype(nullptr))
- : Ref(nullptr)
- {}
-
- ~GlobalRef()
- {
- if (Ref::mInstance) {
- Clear(GetEnvForThread());
- }
- }
-
- // Get the raw JNI reference that can be used as a return value.
- // Returns the same JNI type (jobject, jstring, etc.) as the underlying Ref.
- typename Ref::JNIType Forget()
- {
- const auto obj = Ref::Get();
- Ref::mInstance = nullptr;
- return obj;
- }
-
- void Clear(JNIEnv* env)
- {
- if (Ref::mInstance) {
- env->DeleteGlobalRef(Ref::mInstance);
- Ref::mInstance = nullptr;
- }
- }
-
- GlobalRef<Cls>& operator=(GlobalRef<Cls> ref)
- {
- return swap(ref);
- }
-
- GlobalRef<Cls>& operator=(const Ref& ref)
- {
- GlobalRef<Cls> newRef(ref);
- return swap(newRef);
- }
-
- GlobalRef<Cls>& operator=(const LocalRef<Cls>& ref)
- {
- GlobalRef<Cls> newRef(ref);
- return swap(newRef);
- }
-
- GlobalRef<Cls>& operator=(decltype(nullptr))
- {
- GlobalRef<Cls> newRef(nullptr);
- return swap(newRef);
- }
-};
-
-
-template<class Cls>
-class DependentRef : public Cls::Ref
-{
- using Ref = typename Cls::Ref;
-
-public:
- DependentRef(typename Ref::JNIType instance)
- : Ref(instance)
- {}
-
- DependentRef(const DependentRef& ref)
- : Ref(ref.Get())
- {}
-};
-
-
-class StringParam;
-
-template<>
-class TypedObject<jstring> : public ObjectBase<TypedObject<jstring>, jstring>
-{
- using Base = ObjectBase<TypedObject<jstring>, jstring>;
-
-public:
- using Param = const StringParam&;
-
- explicit TypedObject(const Context& ctx) : Base(ctx) {}
-
- size_t Length() const
- {
- const size_t ret = Base::Env()->GetStringLength(Base::Instance());
- MOZ_CATCH_JNI_EXCEPTION(Base::Env());
- return ret;
- }
-
- nsString ToString() const
- {
- const jchar* const str = Base::Env()->GetStringChars(
- Base::Instance(), nullptr);
- const jsize len = Base::Env()->GetStringLength(Base::Instance());
-
- nsString result(reinterpret_cast<const char16_t*>(str), len);
- Base::Env()->ReleaseStringChars(Base::Instance(), str);
- return result;
- }
-
- nsCString ToCString() const
- {
- return NS_ConvertUTF16toUTF8(ToString());
- }
-
- // Convert jstring to a nsString.
- operator nsString() const
- {
- return ToString();
- }
-
- // Convert jstring to a nsCString.
- operator nsCString() const
- {
- return ToCString();
- }
-};
-
-// Define a custom parameter type for String,
-// which accepts both String::Ref and nsAString/nsACString
-class StringParam : public String::Ref
-{
- using Ref = String::Ref;
-
-private:
- // Not null if we should delete ref on destruction.
- JNIEnv* const mEnv;
-
- static jstring GetString(JNIEnv* env, const nsAString& str)
- {
- const jstring result = env->NewString(
- reinterpret_cast<const jchar*>(str.BeginReading()),
- str.Length());
- MOZ_CATCH_JNI_EXCEPTION(env);
- return result;
- }
-
-public:
- MOZ_IMPLICIT StringParam(decltype(nullptr))
- : Ref(nullptr)
- , mEnv(nullptr)
- {}
-
- MOZ_IMPLICIT StringParam(const Ref& ref)
- : Ref(ref.Get())
- , mEnv(nullptr)
- {}
-
- MOZ_IMPLICIT StringParam(const nsAString& str, JNIEnv* env = Ref::FindEnv())
- : Ref(GetString(env, str))
- , mEnv(env)
- {}
-
- MOZ_IMPLICIT StringParam(const char16_t* str, JNIEnv* env = Ref::FindEnv())
- : Ref(GetString(env, nsDependentString(str)))
- , mEnv(env)
- {}
-
- MOZ_IMPLICIT StringParam(const nsACString& str, JNIEnv* env = Ref::FindEnv())
- : Ref(GetString(env, NS_ConvertUTF8toUTF16(str)))
- , mEnv(env)
- {}
-
- MOZ_IMPLICIT StringParam(const char* str, JNIEnv* env = Ref::FindEnv())
- : Ref(GetString(env, NS_ConvertUTF8toUTF16(str)))
- , mEnv(env)
- {}
-
- StringParam(StringParam&& other)
- : Ref(other.Get())
- , mEnv(other.mEnv)
- {
- other.mInstance = nullptr;
- }
-
- ~StringParam()
- {
- if (mEnv && Get()) {
- mEnv->DeleteLocalRef(Get());
- }
- }
-
- operator String::LocalRef() const
- {
- // We can't return our existing ref because the returned
- // LocalRef could be freed first, so we need a new local ref.
- return String::LocalRef(mEnv ? mEnv : Ref::FindEnv(), *this);
- }
-};
-
-
-namespace detail {
- template<typename T> struct TypeAdapter;
-}
-
-// Ref specialization for arrays.
-template<typename JNIType, class ElementType>
-class ArrayRefBase : public ObjectBase<TypedObject<JNIType>, JNIType>
-{
- using Base = ObjectBase<TypedObject<JNIType>, JNIType>;
-
-public:
- explicit ArrayRefBase(const Context<TypedObject<JNIType>, JNIType>& ctx)
- : Base(ctx)
- {}
-
- static typename Base::LocalRef New(const ElementType* data, size_t length) {
- using JNIElemType = typename detail::TypeAdapter<ElementType>::JNIType;
- static_assert(sizeof(ElementType) == sizeof(JNIElemType),
- "Size of native type must match size of JNI type");
- JNIEnv* const jenv = mozilla::jni::GetEnvForThread();
- auto result =
- (jenv->*detail::TypeAdapter<ElementType>::NewArray)(length);
- MOZ_CATCH_JNI_EXCEPTION(jenv);
- (jenv->*detail::TypeAdapter<ElementType>::SetArray)(
- result, jsize(0), length,
- reinterpret_cast<const JNIElemType*>(data));
- MOZ_CATCH_JNI_EXCEPTION(jenv);
- return Base::LocalRef::Adopt(jenv, result);
- }
-
- size_t Length() const
- {
- const size_t ret = Base::Env()->GetArrayLength(Base::Instance());
- MOZ_CATCH_JNI_EXCEPTION(Base::Env());
- return ret;
- }
-
- ElementType GetElement(size_t index) const
- {
- using JNIElemType = typename detail::TypeAdapter<ElementType>::JNIType;
- static_assert(sizeof(ElementType) == sizeof(JNIElemType),
- "Size of native type must match size of JNI type");
-
- ElementType ret;
- (Base::Env()->*detail::TypeAdapter<ElementType>::GetArray)(
- Base::Instance(), jsize(index), 1,
- reinterpret_cast<JNIElemType*>(&ret));
- MOZ_CATCH_JNI_EXCEPTION(Base::Env());
- return ret;
- }
-
- nsTArray<ElementType> GetElements() const
- {
- using JNIElemType = typename detail::TypeAdapter<ElementType>::JNIType;
- static_assert(sizeof(ElementType) == sizeof(JNIElemType),
- "Size of native type must match size of JNI type");
-
- const jsize len = size_t(Base::Env()->GetArrayLength(Base::Instance()));
-
- nsTArray<ElementType> array((size_t(len)));
- array.SetLength(size_t(len));
- (Base::Env()->*detail::TypeAdapter<ElementType>::GetArray)(
- Base::Instance(), 0, len,
- reinterpret_cast<JNIElemType*>(array.Elements()));
- return array;
- }
-
- ElementType operator[](size_t index) const
- {
- return GetElement(index);
- }
-
- operator nsTArray<ElementType>() const
- {
- return GetElements();
- }
-};
-
-#define DEFINE_PRIMITIVE_ARRAY_REF(JNIType, ElementType) \
- template<> \
- class TypedObject<JNIType> : public ArrayRefBase<JNIType, ElementType> \
- { \
- public: \
- explicit TypedObject(const Context& ctx) \
- : ArrayRefBase<JNIType, ElementType>(ctx) \
- {} \
- }
-
-DEFINE_PRIMITIVE_ARRAY_REF(jbooleanArray, bool);
-DEFINE_PRIMITIVE_ARRAY_REF(jbyteArray, int8_t);
-DEFINE_PRIMITIVE_ARRAY_REF(jcharArray, char16_t);
-DEFINE_PRIMITIVE_ARRAY_REF(jshortArray, int16_t);
-DEFINE_PRIMITIVE_ARRAY_REF(jintArray, int32_t);
-DEFINE_PRIMITIVE_ARRAY_REF(jlongArray, int64_t);
-DEFINE_PRIMITIVE_ARRAY_REF(jfloatArray, float);
-DEFINE_PRIMITIVE_ARRAY_REF(jdoubleArray, double);
-
-#undef DEFINE_PRIMITIVE_ARRAY_REF
-
-
-class ByteBuffer : public ObjectBase<ByteBuffer, jobject>
-{
-public:
- explicit ByteBuffer(const Context& ctx)
- : ObjectBase<ByteBuffer, jobject>(ctx)
- {}
-
- static LocalRef New(void* data, size_t capacity)
- {
- JNIEnv* const env = GetEnvForThread();
- const auto ret = LocalRef::Adopt(
- env, env->NewDirectByteBuffer(data, jlong(capacity)));
- MOZ_CATCH_JNI_EXCEPTION(env);
- return ret;
- }
-
- void* Address()
- {
- void* const ret = Env()->GetDirectBufferAddress(Instance());
- MOZ_CATCH_JNI_EXCEPTION(Env());
- return ret;
- }
-
- size_t Capacity()
- {
- const size_t ret = size_t(Env()->GetDirectBufferCapacity(Instance()));
- MOZ_CATCH_JNI_EXCEPTION(Env());
- return ret;
- }
-};
-
-
-template<>
-class TypedObject<jobjectArray>
- : public ObjectBase<TypedObject<jobjectArray>, jobjectArray>
-{
- using Base = ObjectBase<TypedObject<jobjectArray>, jobjectArray>;
-
-public:
- explicit TypedObject(const Context& ctx) : Base(ctx) {}
-
- size_t Length() const
- {
- const size_t ret = Base::Env()->GetArrayLength(Base::Instance());
- MOZ_CATCH_JNI_EXCEPTION(Base::Env());
- return ret;
- }
-
- Object::LocalRef GetElement(size_t index) const
- {
- auto ret = Object::LocalRef::Adopt(
- Base::Env(), Base::Env()->GetObjectArrayElement(
- Base::Instance(), jsize(index)));
- MOZ_CATCH_JNI_EXCEPTION(Base::Env());
- return ret;
- }
-
- nsTArray<Object::LocalRef> GetElements() const
- {
- const jsize len = size_t(Base::Env()->GetArrayLength(Base::Instance()));
-
- nsTArray<Object::LocalRef> array((size_t(len)));
- for (jsize i = 0; i < len; i++) {
- array.AppendElement(Object::LocalRef::Adopt(
- Base::Env(), Base::Env()->GetObjectArrayElement(
- Base::Instance(), i)));
- MOZ_CATCH_JNI_EXCEPTION(Base::Env());
- }
- return array;
- }
-
- Object::LocalRef operator[](size_t index) const
- {
- return GetElement(index);
- }
-
- operator nsTArray<Object::LocalRef>() const
- {
- return GetElements();
- }
-
- void SetElement(size_t index, Object::Param element) const
- {
- Base::Env()->SetObjectArrayElement(
- Base::Instance(), jsize(index), element.Get());
- MOZ_CATCH_JNI_EXCEPTION(Base::Env());
- }
-};
-
-
-// Support conversion from LocalRef<T>* to LocalRef<Object>*:
-// LocalRef<Foo> foo;
-// Foo::GetFoo(&foo); // error because parameter type is LocalRef<Object>*.
-// Foo::GetFoo(ReturnTo(&foo)); // OK because ReturnTo converts the argument.
-template<class Cls>
-class ReturnToLocal
-{
-private:
- LocalRef<Cls>* const localRef;
- LocalRef<Object> objRef;
-
-public:
- explicit ReturnToLocal(LocalRef<Cls>* ref) : localRef(ref) {}
- operator LocalRef<Object>*() { return &objRef; }
-
- ~ReturnToLocal()
- {
- if (objRef) {
- *localRef = mozilla::Move(objRef);
- }
- }
-};
-
-template<class Cls>
-ReturnToLocal<Cls> ReturnTo(LocalRef<Cls>* ref)
-{
- return ReturnToLocal<Cls>(ref);
-}
-
-
-// Support conversion from GlobalRef<T>* to LocalRef<Object/T>*:
-// GlobalRef<Foo> foo;
-// Foo::GetFoo(&foo); // error because parameter type is LocalRef<Foo>*.
-// Foo::GetFoo(ReturnTo(&foo)); // OK because ReturnTo converts the argument.
-template<class Cls>
-class ReturnToGlobal
-{
-private:
- GlobalRef<Cls>* const globalRef;
- LocalRef<Object> objRef;
- LocalRef<Cls> clsRef;
-
-public:
- explicit ReturnToGlobal(GlobalRef<Cls>* ref) : globalRef(ref) {}
- operator LocalRef<Object>*() { return &objRef; }
- operator LocalRef<Cls>*() { return &clsRef; }
-
- ~ReturnToGlobal()
- {
- if (objRef) {
- *globalRef = (clsRef = mozilla::Move(objRef));
- } else if (clsRef) {
- *globalRef = clsRef;
- }
- }
-};
-
-template<class Cls>
-ReturnToGlobal<Cls> ReturnTo(GlobalRef<Cls>* ref)
-{
- return ReturnToGlobal<Cls>(ref);
-}
-
-} // namespace jni
-} // namespace mozilla
-
-#endif // mozilla_jni_Refs_h__
diff --git a/widget/android/jni/Types.h b/widget/android/jni/Types.h
deleted file mode 100644
index a083d3e50..000000000
--- a/widget/android/jni/Types.h
+++ /dev/null
@@ -1,140 +0,0 @@
-#ifndef mozilla_jni_Types_h__
-#define mozilla_jni_Types_h__
-
-#include <jni.h>
-
-#include "mozilla/jni/Refs.h"
-
-namespace mozilla {
-namespace jni {
-namespace detail {
-
-// TypeAdapter specializations are the interfaces between native/C++ types such
-// as int32_t and JNI types such as jint. The template parameter T is the native
-// type, and each TypeAdapter specialization can have the following members:
-//
-// * Call: JNIEnv member pointer for making a method call that returns T.
-// * StaticCall: JNIEnv member pointer for making a static call that returns T.
-// * Get: JNIEnv member pointer for getting a field of type T.
-// * StaticGet: JNIEnv member pointer for getting a static field of type T.
-// * Set: JNIEnv member pointer for setting a field of type T.
-// * StaticGet: JNIEnv member pointer for setting a static field of type T.
-// * ToNative: static function that converts the JNI type to the native type.
-// * FromNative: static function that converts the native type to the JNI type.
-
-template<typename T> struct TypeAdapter;
-
-
-// TypeAdapter<LocalRef<Cls>> applies when jobject is a return value.
-template<class Cls> struct TypeAdapter<LocalRef<Cls>> {
- using JNIType = typename Cls::Ref::JNIType;
-
- static constexpr auto Call = &JNIEnv::CallObjectMethodA;
- static constexpr auto StaticCall = &JNIEnv::CallStaticObjectMethodA;
- static constexpr auto Get = &JNIEnv::GetObjectField;
- static constexpr auto StaticGet = &JNIEnv::GetStaticObjectField;
-
- // Declare instance as jobject because JNI methods return
- // jobject even if the return value is really jstring, etc.
- static LocalRef<Cls> ToNative(JNIEnv* env, jobject instance) {
- return LocalRef<Cls>::Adopt(env, JNIType(instance));
- }
-
- static JNIType FromNative(JNIEnv*, LocalRef<Cls>&& instance) {
- return instance.Forget();
- }
-};
-
-// clang is picky about function types, including attributes that modify the calling
-// convention, lining up. GCC appears to be somewhat less so.
-#ifdef __clang__
-#define MOZ_JNICALL_ABI JNICALL
-#else
-#define MOZ_JNICALL_ABI
-#endif
-
-template<class Cls> constexpr jobject
- (JNIEnv::*TypeAdapter<LocalRef<Cls>>::Call)(jobject, jmethodID, jvalue*) MOZ_JNICALL_ABI;
-template<class Cls> constexpr jobject
- (JNIEnv::*TypeAdapter<LocalRef<Cls>>::StaticCall)(jclass, jmethodID, jvalue*) MOZ_JNICALL_ABI;
-template<class Cls> constexpr jobject
- (JNIEnv::*TypeAdapter<LocalRef<Cls>>::Get)(jobject, jfieldID);
-template<class Cls> constexpr jobject
- (JNIEnv::*TypeAdapter<LocalRef<Cls>>::StaticGet)(jclass, jfieldID);
-
-
-// TypeAdapter<Ref<Cls>> applies when jobject is a parameter value.
-template<class Cls, typename T> struct TypeAdapter<Ref<Cls, T>> {
- using JNIType = typename Ref<Cls, T>::JNIType;
-
- static constexpr auto Set = &JNIEnv::SetObjectField;
- static constexpr auto StaticSet = &JNIEnv::SetStaticObjectField;
-
- static DependentRef<Cls> ToNative(JNIEnv* env, JNIType instance) {
- return DependentRef<Cls>(instance);
- }
-
- static JNIType FromNative(JNIEnv*, const Ref<Cls, T>& instance) {
- return instance.Get();
- }
-};
-
-template<class Cls, typename T> constexpr void
- (JNIEnv::*TypeAdapter<Ref<Cls, T>>::Set)(jobject, jfieldID, jobject);
-template<class Cls, typename T> constexpr void
- (JNIEnv::*TypeAdapter<Ref<Cls, T>>::StaticSet)(jclass, jfieldID, jobject);
-
-
-// jstring has its own Param type.
-template<> struct TypeAdapter<StringParam>
- : public TypeAdapter<String::Ref>
-{};
-
-template<class Cls> struct TypeAdapter<const Cls&>
- : public TypeAdapter<Cls>
-{};
-
-
-#define DEFINE_PRIMITIVE_TYPE_ADAPTER(NativeType, JNIType, JNIName) \
- \
- template<> struct TypeAdapter<NativeType> { \
- using JNI##Type = JNIType; \
- \
- static constexpr auto Call = &JNIEnv::Call ## JNIName ## MethodA; \
- static constexpr auto StaticCall = &JNIEnv::CallStatic ## JNIName ## MethodA; \
- static constexpr auto Get = &JNIEnv::Get ## JNIName ## Field; \
- static constexpr auto StaticGet = &JNIEnv::GetStatic ## JNIName ## Field; \
- static constexpr auto Set = &JNIEnv::Set ## JNIName ## Field; \
- static constexpr auto StaticSet = &JNIEnv::SetStatic ## JNIName ## Field; \
- static constexpr auto GetArray = &JNIEnv::Get ## JNIName ## ArrayRegion; \
- static constexpr auto SetArray = &JNIEnv::Set ## JNIName ## ArrayRegion; \
- static constexpr auto NewArray = &JNIEnv::New ## JNIName ## Array; \
- \
- static JNIType FromNative(JNIEnv*, NativeType val) { \
- return static_cast<JNIType>(val); \
- } \
- static NativeType ToNative(JNIEnv*, JNIType val) { \
- return static_cast<NativeType>(val); \
- } \
- }
-
-
-DEFINE_PRIMITIVE_TYPE_ADAPTER(bool, jboolean, Boolean);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(int8_t, jbyte, Byte);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(char16_t, jchar, Char);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(int16_t, jshort, Short);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(int32_t, jint, Int);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(int64_t, jlong, Long);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(float, jfloat, Float);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(double, jdouble, Double);
-
-#undef DEFINE_PRIMITIVE_TYPE_ADAPTER
-
-} // namespace detail
-
-using namespace detail;
-
-} // namespace jni
-} // namespace mozilla
-
-#endif // mozilla_jni_Types_h__
diff --git a/widget/android/jni/Utils.cpp b/widget/android/jni/Utils.cpp
deleted file mode 100644
index 919588851..000000000
--- a/widget/android/jni/Utils.cpp
+++ /dev/null
@@ -1,291 +0,0 @@
-#include "Utils.h"
-#include "Types.h"
-
-#include <android/log.h>
-#include <pthread.h>
-
-#include "mozilla/Assertions.h"
-
-#include "GeneratedJNIWrappers.h"
-#include "nsAppShell.h"
-
-namespace mozilla {
-namespace jni {
-
-namespace detail {
-
-#define DEFINE_PRIMITIVE_TYPE_ADAPTER(NativeType, JNIType, JNIName, ABIName) \
- \
- constexpr JNIType (JNIEnv::*TypeAdapter<NativeType>::Call) \
- (jobject, jmethodID, jvalue*) MOZ_JNICALL_ABI; \
- constexpr JNIType (JNIEnv::*TypeAdapter<NativeType>::StaticCall) \
- (jclass, jmethodID, jvalue*) MOZ_JNICALL_ABI; \
- constexpr JNIType (JNIEnv::*TypeAdapter<NativeType>::Get) \
- (jobject, jfieldID) ABIName; \
- constexpr JNIType (JNIEnv::*TypeAdapter<NativeType>::StaticGet) \
- (jclass, jfieldID) ABIName; \
- constexpr void (JNIEnv::*TypeAdapter<NativeType>::Set) \
- (jobject, jfieldID, JNIType) ABIName; \
- constexpr void (JNIEnv::*TypeAdapter<NativeType>::StaticSet) \
- (jclass, jfieldID, JNIType) ABIName; \
- constexpr void (JNIEnv::*TypeAdapter<NativeType>::GetArray) \
- (JNIType ## Array, jsize, jsize, JNIType*)
-
-DEFINE_PRIMITIVE_TYPE_ADAPTER(bool, jboolean, Boolean, /*nothing*/);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(int8_t, jbyte, Byte, /*nothing*/);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(char16_t, jchar, Char, /*nothing*/);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(int16_t, jshort, Short, /*nothing*/);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(int32_t, jint, Int, /*nothing*/);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(int64_t, jlong, Long, /*nothing*/);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(float, jfloat, Float, MOZ_JNICALL_ABI);
-DEFINE_PRIMITIVE_TYPE_ADAPTER(double, jdouble, Double, MOZ_JNICALL_ABI);
-
-#undef DEFINE_PRIMITIVE_TYPE_ADAPTER
-
-} // namespace detail
-
-template<> const char ObjectBase<Object, jobject>::name[] = "java/lang/Object";
-template<> const char ObjectBase<TypedObject<jstring>, jstring>::name[] = "java/lang/String";
-template<> const char ObjectBase<TypedObject<jclass>, jclass>::name[] = "java/lang/Class";
-template<> const char ObjectBase<TypedObject<jthrowable>, jthrowable>::name[] = "java/lang/Throwable";
-template<> const char ObjectBase<TypedObject<jbooleanArray>, jbooleanArray>::name[] = "[Z";
-template<> const char ObjectBase<TypedObject<jbyteArray>, jbyteArray>::name[] = "[B";
-template<> const char ObjectBase<TypedObject<jcharArray>, jcharArray>::name[] = "[C";
-template<> const char ObjectBase<TypedObject<jshortArray>, jshortArray>::name[] = "[S";
-template<> const char ObjectBase<TypedObject<jintArray>, jintArray>::name[] = "[I";
-template<> const char ObjectBase<TypedObject<jlongArray>, jlongArray>::name[] = "[J";
-template<> const char ObjectBase<TypedObject<jfloatArray>, jfloatArray>::name[] = "[F";
-template<> const char ObjectBase<TypedObject<jdoubleArray>, jdoubleArray>::name[] = "[D";
-template<> const char ObjectBase<TypedObject<jobjectArray>, jobjectArray>::name[] = "[Ljava/lang/Object;";
-template<> const char ObjectBase<ByteBuffer, jobject>::name[] = "java/nio/ByteBuffer";
-
-
-JNIEnv* sGeckoThreadEnv;
-
-namespace {
-
-JavaVM* sJavaVM;
-pthread_key_t sThreadEnvKey;
-jclass sOOMErrorClass;
-jobject sClassLoader;
-jmethodID sClassLoaderLoadClass;
-bool sIsFennec;
-
-void UnregisterThreadEnv(void* env)
-{
- if (!env) {
- // We were never attached.
- return;
- }
- // The thread may have already been detached. In that case, it's still
- // okay to call DetachCurrentThread(); it'll simply return an error.
- // However, we must not access | env | because it may be invalid.
- MOZ_ASSERT(sJavaVM);
- sJavaVM->DetachCurrentThread();
-}
-
-} // namespace
-
-void SetGeckoThreadEnv(JNIEnv* aEnv)
-{
- MOZ_ASSERT(aEnv);
- MOZ_ASSERT(!sGeckoThreadEnv || sGeckoThreadEnv == aEnv);
-
- if (!sGeckoThreadEnv
- && pthread_key_create(&sThreadEnvKey, UnregisterThreadEnv)) {
- MOZ_CRASH("Failed to initialize required TLS");
- }
-
- sGeckoThreadEnv = aEnv;
- MOZ_ALWAYS_TRUE(!pthread_setspecific(sThreadEnvKey, aEnv));
-
- MOZ_ALWAYS_TRUE(!aEnv->GetJavaVM(&sJavaVM));
- MOZ_ASSERT(sJavaVM);
-
- sOOMErrorClass = Class::GlobalRef(Class::LocalRef::Adopt(
- aEnv->FindClass("java/lang/OutOfMemoryError"))).Forget();
- aEnv->ExceptionClear();
-
- sClassLoader = Object::GlobalRef(java::GeckoThread::ClsLoader()).Forget();
- sClassLoaderLoadClass = aEnv->GetMethodID(
- Class::LocalRef::Adopt(aEnv->GetObjectClass(sClassLoader)).Get(),
- "loadClass", "(Ljava/lang/String;)Ljava/lang/Class;");
- MOZ_ASSERT(sClassLoader && sClassLoaderLoadClass);
-
- auto geckoAppClass = Class::LocalRef::Adopt(
- aEnv->FindClass("org/mozilla/gecko/GeckoApp"));
- aEnv->ExceptionClear();
- sIsFennec = !!geckoAppClass;
-}
-
-JNIEnv* GetEnvForThread()
-{
- MOZ_ASSERT(sGeckoThreadEnv);
-
- JNIEnv* env = static_cast<JNIEnv*>(pthread_getspecific(sThreadEnvKey));
- if (env) {
- return env;
- }
-
- // We don't have a saved JNIEnv, so try to get one.
- // AttachCurrentThread() does the same thing as GetEnv() when a thread is
- // already attached, so we don't have to call GetEnv() at all.
- if (!sJavaVM->AttachCurrentThread(&env, nullptr)) {
- MOZ_ASSERT(env);
- MOZ_ALWAYS_TRUE(!pthread_setspecific(sThreadEnvKey, env));
- return env;
- }
-
- MOZ_CRASH("Failed to get JNIEnv for thread");
- return nullptr; // unreachable
-}
-
-bool ThrowException(JNIEnv *aEnv, const char *aClass,
- const char *aMessage)
-{
- MOZ_ASSERT(aEnv, "Invalid thread JNI env");
-
- Class::LocalRef cls = Class::LocalRef::Adopt(aEnv->FindClass(aClass));
- MOZ_ASSERT(cls, "Cannot find exception class");
-
- return !aEnv->ThrowNew(cls.Get(), aMessage);
-}
-
-bool HandleUncaughtException(JNIEnv* aEnv)
-{
- MOZ_ASSERT(aEnv, "Invalid thread JNI env");
-
- if (!aEnv->ExceptionCheck()) {
- return false;
- }
-
-#ifdef MOZ_CHECK_JNI
- aEnv->ExceptionDescribe();
-#endif
-
- Throwable::LocalRef e =
- Throwable::LocalRef::Adopt(aEnv, aEnv->ExceptionOccurred());
- MOZ_ASSERT(e);
- aEnv->ExceptionClear();
-
- String::LocalRef stack = java::GeckoAppShell::GetExceptionStackTrace(e);
- if (stack && ReportException(aEnv, e.Get(), stack.Get())) {
- return true;
- }
-
- aEnv->ExceptionClear();
- java::GeckoAppShell::HandleUncaughtException(e);
-
- if (NS_WARN_IF(aEnv->ExceptionCheck())) {
- aEnv->ExceptionDescribe();
- aEnv->ExceptionClear();
- }
-
- return true;
-}
-
-bool ReportException(JNIEnv* aEnv, jthrowable aExc, jstring aStack)
-{
- bool result = true;
-
- if (sOOMErrorClass && aEnv->IsInstanceOf(aExc, sOOMErrorClass)) {
- NS_ABORT_OOM(0); // Unknown OOM size
- }
- return result;
-}
-
-namespace {
-
-jclass sJNIObjectClass;
-jfieldID sJNIObjectHandleField;
-
-bool EnsureJNIObject(JNIEnv* env, jobject instance) {
- if (!sJNIObjectClass) {
- sJNIObjectClass = Class::GlobalRef(Class::LocalRef::Adopt(GetClassRef(
- env, "org/mozilla/gecko/mozglue/JNIObject"))).Forget();
-
- sJNIObjectHandleField = env->GetFieldID(
- sJNIObjectClass, "mHandle", "J");
- }
-
- MOZ_ASSERT(env->IsInstanceOf(instance, sJNIObjectClass));
- return true;
-}
-
-} // namespace
-
-uintptr_t GetNativeHandle(JNIEnv* env, jobject instance)
-{
- if (!EnsureJNIObject(env, instance)) {
- return 0;
- }
-
- return static_cast<uintptr_t>(
- env->GetLongField(instance, sJNIObjectHandleField));
-}
-
-void SetNativeHandle(JNIEnv* env, jobject instance, uintptr_t handle)
-{
- if (!EnsureJNIObject(env, instance)) {
- return;
- }
-
- env->SetLongField(instance, sJNIObjectHandleField,
- static_cast<jlong>(handle));
-}
-
-jclass GetClassRef(JNIEnv* aEnv, const char* aClassName)
-{
- // First try the default class loader.
- auto classRef = Class::LocalRef::Adopt(aEnv, aEnv->FindClass(aClassName));
-
- if (!classRef && sClassLoader) {
- // If the default class loader failed but we have an app class loader, try that.
- // Clear the pending exception from failed FindClass call above.
- aEnv->ExceptionClear();
- classRef = Class::LocalRef::Adopt(aEnv, jclass(
- aEnv->CallObjectMethod(sClassLoader, sClassLoaderLoadClass,
- StringParam(aClassName, aEnv).Get())));
- }
-
- if (classRef) {
- return classRef.Forget();
- }
-
- __android_log_print(
- ANDROID_LOG_ERROR, "Gecko",
- ">>> FATAL JNI ERROR! FindClass(className=\"%s\") failed. "
- "Did ProGuard optimize away something it shouldn't have?",
- aClassName);
- aEnv->ExceptionDescribe();
- MOZ_CRASH("Cannot find JNI class");
- return nullptr;
-}
-
-void DispatchToGeckoThread(UniquePtr<AbstractCall>&& aCall)
-{
- class AbstractCallEvent : public nsAppShell::Event
- {
- UniquePtr<AbstractCall> mCall;
-
- public:
- AbstractCallEvent(UniquePtr<AbstractCall>&& aCall)
- : mCall(Move(aCall))
- {}
-
- void Run() override
- {
- (*mCall)();
- }
- };
-
- nsAppShell::PostEvent(MakeUnique<AbstractCallEvent>(Move(aCall)));
-}
-
-bool IsFennec()
-{
- return sIsFennec;
-}
-
-} // jni
-} // mozilla
diff --git a/widget/android/jni/Utils.h b/widget/android/jni/Utils.h
deleted file mode 100644
index 38e0b6b0c..000000000
--- a/widget/android/jni/Utils.h
+++ /dev/null
@@ -1,147 +0,0 @@
-#ifndef mozilla_jni_Utils_h__
-#define mozilla_jni_Utils_h__
-
-#include <jni.h>
-
-#include "mozilla/UniquePtr.h"
-
-#if defined(DEBUG) || !defined(RELEASE_OR_BETA)
-#define MOZ_CHECK_JNI
-#endif
-
-#ifdef MOZ_CHECK_JNI
-#include <pthread.h>
-#include "mozilla/Assertions.h"
-#include "APKOpen.h"
-#include "MainThreadUtils.h"
-#endif
-
-namespace mozilla {
-namespace jni {
-
-// How exception during a JNI call should be treated.
-enum class ExceptionMode
-{
- // Abort on unhandled excepion (default).
- ABORT,
- // Ignore the exception and return to caller.
- IGNORE,
- // Catch any exception and return a nsresult.
- NSRESULT,
-};
-
-// Thread that a particular JNI call is allowed on.
-enum class CallingThread
-{
- // Can be called from any thread (default).
- ANY,
- // Can be called from the Gecko thread.
- GECKO,
- // Can be called from the Java UI thread.
- UI,
-};
-
-// If and where a JNI call will be dispatched.
-enum class DispatchTarget
-{
- // Call happens synchronously on the calling thread (default).
- CURRENT,
- // Call happens synchronously on the calling thread, but the call is
- // wrapped in a function object and is passed thru UsesNativeCallProxy.
- // Method must return void.
- PROXY,
- // Call is dispatched asynchronously on the Gecko thread. Method must
- // return void.
- GECKO,
-};
-
-
-extern JNIEnv* sGeckoThreadEnv;
-
-inline bool IsAvailable()
-{
- return !!sGeckoThreadEnv;
-}
-
-inline JNIEnv* GetGeckoThreadEnv()
-{
-#ifdef MOZ_CHECK_JNI
- MOZ_RELEASE_ASSERT(NS_IsMainThread(), "Must be on Gecko thread");
- MOZ_RELEASE_ASSERT(sGeckoThreadEnv, "Must have a JNIEnv");
-#endif
- return sGeckoThreadEnv;
-}
-
-void SetGeckoThreadEnv(JNIEnv* aEnv);
-
-JNIEnv* GetEnvForThread();
-
-#ifdef MOZ_CHECK_JNI
-#define MOZ_ASSERT_JNI_THREAD(thread) \
- do { \
- if ((thread) == mozilla::jni::CallingThread::GECKO) { \
- MOZ_RELEASE_ASSERT(::NS_IsMainThread()); \
- } else if ((thread) == mozilla::jni::CallingThread::UI) { \
- const bool isOnUiThread = ::pthread_equal(::pthread_self(), \
- ::getJavaUiThread()); \
- MOZ_RELEASE_ASSERT(isOnUiThread); \
- } \
- } while (0)
-#else
-#define MOZ_ASSERT_JNI_THREAD(thread) do {} while (0)
-#endif
-
-bool ThrowException(JNIEnv *aEnv, const char *aClass,
- const char *aMessage);
-
-inline bool ThrowException(JNIEnv *aEnv, const char *aMessage)
-{
- return ThrowException(aEnv, "java/lang/Exception", aMessage);
-}
-
-inline bool ThrowException(const char *aClass, const char *aMessage)
-{
- return ThrowException(GetEnvForThread(), aClass, aMessage);
-}
-
-inline bool ThrowException(const char *aMessage)
-{
- return ThrowException(GetEnvForThread(), aMessage);
-}
-
-bool HandleUncaughtException(JNIEnv* aEnv);
-
-bool ReportException(JNIEnv* aEnv, jthrowable aExc, jstring aStack);
-
-#define MOZ_CATCH_JNI_EXCEPTION(env) \
- do { \
- if (mozilla::jni::HandleUncaughtException((env))) { \
- MOZ_CRASH("JNI exception"); \
- } \
- } while (0)
-
-
-uintptr_t GetNativeHandle(JNIEnv* env, jobject instance);
-
-void SetNativeHandle(JNIEnv* env, jobject instance, uintptr_t handle);
-
-jclass GetClassRef(JNIEnv* aEnv, const char* aClassName);
-
-struct AbstractCall
-{
- virtual ~AbstractCall() {}
- virtual void operator()() = 0;
-};
-
-void DispatchToGeckoThread(UniquePtr<AbstractCall>&& aCall);
-
-/**
- * Returns whether Gecko is running in a Fennec environment, as determined by
- * the presence of the GeckoApp class.
- */
-bool IsFennec();
-
-} // jni
-} // mozilla
-
-#endif // mozilla_jni_Utils_h__
diff --git a/widget/android/jni/moz.build b/widget/android/jni/moz.build
deleted file mode 100644
index 31d7d32e6..000000000
--- a/widget/android/jni/moz.build
+++ /dev/null
@@ -1,24 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-EXPORTS.mozilla.jni += [
- 'Accessors.h',
- 'Natives.h',
- 'Refs.h',
- 'Types.h',
- 'Utils.h',
-]
-
-UNIFIED_SOURCES += [
- 'Utils.cpp',
-]
-
-FINAL_LIBRARY = 'xul'
-
-LOCAL_INCLUDES += [
- '/widget',
- '/widget/android',
-]
diff --git a/widget/android/moz.build b/widget/android/moz.build
deleted file mode 100644
index e80ed01c1..000000000
--- a/widget/android/moz.build
+++ /dev/null
@@ -1,73 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-DIRS += [
- 'bindings',
- 'fennec',
- 'jni',
-]
-
-XPIDL_SOURCES += [
- 'nsIAndroidBridge.idl',
-]
-
-XPIDL_MODULE = 'widget_android'
-
-EXPORTS += [
- 'AndroidBridge.h',
- 'AndroidJavaWrappers.h',
- 'AndroidJNIWrapper.h',
- 'GeneratedJNINatives.h',
- 'GeneratedJNIWrappers.h',
-]
-
-EXPORTS.mozilla.widget += [
- 'AndroidCompositorWidget.h',
-]
-
-UNIFIED_SOURCES += [
- 'AndroidAlerts.cpp',
- 'AndroidBridge.cpp',
- 'AndroidCompositorWidget.cpp',
- 'AndroidContentController.cpp',
- 'AndroidJavaWrappers.cpp',
- 'AndroidJNI.cpp',
- 'AndroidJNIWrapper.cpp',
- 'ANRReporter.cpp',
- 'GeneratedJNIWrappers.cpp',
- 'GfxInfo.cpp',
- 'NativeJSContainer.cpp',
- 'nsAndroidProtocolHandler.cpp',
- 'nsAppShell.cpp',
- 'nsClipboard.cpp',
- 'nsDeviceContextAndroid.cpp',
- 'nsIdleServiceAndroid.cpp',
- 'nsLookAndFeel.cpp',
- 'nsPrintOptionsAndroid.cpp',
- 'nsScreenManagerAndroid.cpp',
- 'nsWidgetFactory.cpp',
- 'nsWindow.cpp',
-]
-
-include('/ipc/chromium/chromium-config.mozbuild')
-
-FINAL_LIBRARY = 'xul'
-
-LOCAL_INCLUDES += [
- '/docshell/base',
- '/dom/base',
- '/dom/system/android',
- '/netwerk/base',
- '/netwerk/cache',
- '/widget',
-]
-
-CXXFLAGS += ['-Wno-error=shadow']
-
-OS_LIBS += ['android']
-
-#DEFINES['DEBUG_WIDGETS'] = True
-
diff --git a/widget/android/nsAndroidProtocolHandler.cpp b/widget/android/nsAndroidProtocolHandler.cpp
deleted file mode 100644
index e59a5d5cf..000000000
--- a/widget/android/nsAndroidProtocolHandler.cpp
+++ /dev/null
@@ -1,183 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim:set ts=4 sw=4 sts=4 et cin: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsAndroidProtocolHandler.h"
-#include "nsCOMPtr.h"
-#include "nsIChannel.h"
-#include "nsIIOService.h"
-#include "nsIStandardURL.h"
-#include "nsIURL.h"
-#include "android/log.h"
-#include "nsBaseChannel.h"
-#include "AndroidBridge.h"
-#include "GeneratedJNIWrappers.h"
-
-using namespace mozilla;
-
-class AndroidInputStream : public nsIInputStream
-{
-public:
- AndroidInputStream(jni::Object::Param connection) {
- mBridgeInputStream = java::GeckoAppShell::CreateInputStream(connection);
- mBridgeChannel = AndroidBridge::ChannelCreate(mBridgeInputStream);
- }
-
-private:
- virtual ~AndroidInputStream() {
- }
-
-public:
- NS_DECL_THREADSAFE_ISUPPORTS
- NS_DECL_NSIINPUTSTREAM
-
-private:
- jni::Object::GlobalRef mBridgeInputStream;
- jni::Object::GlobalRef mBridgeChannel;
-};
-
-NS_IMPL_ISUPPORTS(AndroidInputStream, nsIInputStream)
-
-NS_IMETHODIMP AndroidInputStream::Close(void) {
- AndroidBridge::InputStreamClose(mBridgeInputStream);
- return NS_OK;
-}
-
-NS_IMETHODIMP AndroidInputStream::Available(uint64_t *_retval) {
- *_retval = AndroidBridge::InputStreamAvailable(mBridgeInputStream);
- return NS_OK;
-}
-
-NS_IMETHODIMP AndroidInputStream::Read(char *aBuf, uint32_t aCount, uint32_t *_retval) {
- return AndroidBridge::InputStreamRead(mBridgeChannel, aBuf, aCount, _retval);
-}
-
-NS_IMETHODIMP AndroidInputStream::ReadSegments(nsWriteSegmentFun aWriter, void *aClosure, uint32_t aCount, uint32_t *_retval) {
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP AndroidInputStream::IsNonBlocking(bool *_retval) {
- *_retval = false;
- return NS_OK;
-}
-
-
-class AndroidChannel : public nsBaseChannel
-{
-private:
- AndroidChannel(nsIURI *aURI, jni::Object::Param aConnection) {
- mConnection = aConnection;
- SetURI(aURI);
-
- auto type = java::GeckoAppShell::ConnectionGetMimeType(mConnection);
- if (type) {
- SetContentType(type->ToCString());
- }
- }
-
-public:
- static AndroidChannel* CreateChannel(nsIURI *aURI) {
- nsCString spec;
- aURI->GetSpec(spec);
-
- auto connection = java::GeckoAppShell::GetConnection(spec);
- return connection ? new AndroidChannel(aURI, connection) : nullptr;
- }
-
- virtual ~AndroidChannel() {
- }
-
- virtual nsresult OpenContentStream(bool async, nsIInputStream **result,
- nsIChannel** channel) {
- nsCOMPtr<nsIInputStream> stream = new AndroidInputStream(mConnection);
- NS_ADDREF(*result = stream);
- return NS_OK;
- }
-
-private:
- jni::Object::GlobalRef mConnection;
-};
-
-NS_IMPL_ISUPPORTS(nsAndroidProtocolHandler,
- nsIProtocolHandler,
- nsISupportsWeakReference)
-
-
-NS_IMETHODIMP
-nsAndroidProtocolHandler::GetScheme(nsACString &result)
-{
- result.AssignLiteral("android");
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAndroidProtocolHandler::GetDefaultPort(int32_t *result)
-{
- *result = -1; // no port for android: URLs
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAndroidProtocolHandler::AllowPort(int32_t port, const char *scheme, bool *_retval)
-{
- // don't override anything.
- *_retval = false;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAndroidProtocolHandler::GetProtocolFlags(uint32_t *result)
-{
- *result = URI_STD | URI_IS_UI_RESOURCE | URI_IS_LOCAL_RESOURCE | URI_NORELATIVE | URI_DANGEROUS_TO_LOAD;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAndroidProtocolHandler::NewURI(const nsACString &aSpec,
- const char *aCharset,
- nsIURI *aBaseURI,
- nsIURI **result)
-{
- nsresult rv;
-
- nsCOMPtr<nsIStandardURL> surl(do_CreateInstance(NS_STANDARDURL_CONTRACTID, &rv));
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = surl->Init(nsIStandardURL::URLTYPE_STANDARD, -1, aSpec, aCharset, aBaseURI);
- if (NS_FAILED(rv))
- return rv;
-
- nsCOMPtr<nsIURL> url(do_QueryInterface(surl, &rv));
- NS_ENSURE_SUCCESS(rv, rv);
-
- surl->SetMutable(false);
-
- NS_ADDREF(*result = url);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAndroidProtocolHandler::NewChannel2(nsIURI* aURI,
- nsILoadInfo* aLoadInfo,
- nsIChannel** aResult)
-{
- nsCOMPtr<nsIChannel> channel = AndroidChannel::CreateChannel(aURI);
- if (!channel)
- return NS_ERROR_FAILURE;
-
- // set the loadInfo on the new channel
- nsresult rv = channel->SetLoadInfo(aLoadInfo);
- NS_ENSURE_SUCCESS(rv, rv);
-
- NS_ADDREF(*aResult = channel);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsAndroidProtocolHandler::NewChannel(nsIURI* aURI,
- nsIChannel* *aResult)
-{
- return NewChannel2(aURI, nullptr, aResult);
-}
diff --git a/widget/android/nsAndroidProtocolHandler.h b/widget/android/nsAndroidProtocolHandler.h
deleted file mode 100644
index 11705dd0a..000000000
--- a/widget/android/nsAndroidProtocolHandler.h
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsAndroidProtocolHandler_h___
-#define nsAndroidProtocolHandler_h___
-
-#include "nsIProtocolHandler.h"
-#include "nsWeakReference.h"
-#include "mozilla/Attributes.h"
-
-#define NS_ANDROIDPROTOCOLHANDLER_CID \
-{ /* e9cd2b7f-8386-441b-aaf5-0b371846bfd0 */ \
- 0xe9cd2b7f, \
- 0x8386, \
- 0x441b, \
- {0x0b, 0x37, 0x18, 0x46, 0xbf, 0xd0} \
-}
-
-class nsAndroidProtocolHandler final : public nsIProtocolHandler,
- public nsSupportsWeakReference
-{
-public:
- NS_DECL_THREADSAFE_ISUPPORTS
-
- // nsIProtocolHandler methods:
- NS_DECL_NSIPROTOCOLHANDLER
-
- // nsAndroidProtocolHandler methods:
- nsAndroidProtocolHandler() {}
-
-private:
- ~nsAndroidProtocolHandler() {}
-};
-
-#endif /* nsAndroidProtocolHandler_h___ */
diff --git a/widget/android/nsAppShell.cpp b/widget/android/nsAppShell.cpp
deleted file mode 100644
index 09548c27b..000000000
--- a/widget/android/nsAppShell.cpp
+++ /dev/null
@@ -1,683 +0,0 @@
-/* -*- Mode: c++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsAppShell.h"
-
-#include "base/basictypes.h"
-#include "base/message_loop.h"
-#include "base/task.h"
-#include "mozilla/Hal.h"
-#include "nsIScreen.h"
-#include "nsIScreenManager.h"
-#include "nsWindow.h"
-#include "nsThreadUtils.h"
-#include "nsICommandLineRunner.h"
-#include "nsIObserverService.h"
-#include "nsIAppStartup.h"
-#include "nsIGeolocationProvider.h"
-#include "nsCacheService.h"
-#include "nsIDOMEventListener.h"
-#include "nsIDOMClientRectList.h"
-#include "nsIDOMClientRect.h"
-#include "nsIDOMWakeLockListener.h"
-#include "nsIPowerManagerService.h"
-#include "nsISpeculativeConnect.h"
-#include "nsIURIFixup.h"
-#include "nsCategoryManagerUtils.h"
-#include "nsCDefaultURIFixup.h"
-#include "nsToolkitCompsCID.h"
-#include "nsGeoPosition.h"
-
-#include "mozilla/Services.h"
-#include "mozilla/Preferences.h"
-#include "mozilla/Hal.h"
-#include "prenv.h"
-
-#include "AndroidBridge.h"
-#include "AndroidBridgeUtilities.h"
-#include "GeneratedJNINatives.h"
-#include <android/log.h>
-#include <pthread.h>
-#include <wchar.h>
-
-#include "GeckoProfiler.h"
-#ifdef MOZ_ANDROID_HISTORY
-#include "nsNetUtil.h"
-#include "nsIURI.h"
-#include "IHistory.h"
-#endif
-
-#ifdef MOZ_LOGGING
-#include "mozilla/Logging.h"
-#endif
-
-#include "AndroidAlerts.h"
-#include "ANRReporter.h"
-#include "GeckoBatteryManager.h"
-#include "GeckoNetworkManager.h"
-#include "GeckoScreenOrientation.h"
-#include "PrefsHelper.h"
-#include "fennec/MemoryMonitor.h"
-#include "fennec/Telemetry.h"
-#include "fennec/ThumbnailHelper.h"
-
-#ifdef DEBUG_ANDROID_EVENTS
-#define EVLOG(args...) ALOG(args)
-#else
-#define EVLOG(args...) do { } while (0)
-#endif
-
-using namespace mozilla;
-
-nsIGeolocationUpdate *gLocationCallback = nullptr;
-
-nsAppShell* nsAppShell::sAppShell;
-StaticAutoPtr<Mutex> nsAppShell::sAppShellLock;
-
-NS_IMPL_ISUPPORTS_INHERITED(nsAppShell, nsBaseAppShell, nsIObserver)
-
-class WakeLockListener final : public nsIDOMMozWakeLockListener {
-private:
- ~WakeLockListener() {}
-
-public:
- NS_DECL_ISUPPORTS;
-
- nsresult Callback(const nsAString& topic, const nsAString& state) override {
- java::GeckoAppShell::NotifyWakeLockChanged(topic, state);
- return NS_OK;
- }
-};
-
-NS_IMPL_ISUPPORTS(WakeLockListener, nsIDOMMozWakeLockListener)
-nsCOMPtr<nsIPowerManagerService> sPowerManagerService = nullptr;
-StaticRefPtr<WakeLockListener> sWakeLockListener;
-
-
-class GeckoThreadSupport final
- : public java::GeckoThread::Natives<GeckoThreadSupport>
-{
- // When this number goes above 0, the app is paused. When less than or
- // equal to zero, the app is resumed.
- static int32_t sPauseCount;
-
-public:
- static void SpeculativeConnect(jni::String::Param aUriStr)
- {
- if (!NS_IsMainThread()) {
- // We will be on the main thread if the call was queued on the Java
- // side during startup. Otherwise, the call was not queued, which
- // means Gecko is already sufficiently loaded, and we don't really
- // care about speculative connections at this point.
- return;
- }
-
- nsCOMPtr<nsIIOService> ioServ = do_GetIOService();
- nsCOMPtr<nsISpeculativeConnect> specConn = do_QueryInterface(ioServ);
- if (!specConn) {
- return;
- }
-
- nsCOMPtr<nsIURI> uri = nsAppShell::ResolveURI(aUriStr->ToCString());
- if (!uri) {
- return;
- }
- specConn->SpeculativeConnect(uri, nullptr);
- }
-
- static void WaitOnGecko()
- {
- struct NoOpEvent : nsAppShell::Event {
- void Run() override {}
- };
- nsAppShell::SyncRunEvent(NoOpEvent());
- }
-
- static void OnPause()
- {
- MOZ_ASSERT(NS_IsMainThread());
-
- sPauseCount++;
- // If sPauseCount is now 1, we just crossed the threshold from "resumed"
- // "paused". so we should notify observers and so on.
- if (sPauseCount != 1) {
- return;
- }
-
- nsCOMPtr<nsIObserverService> obsServ =
- mozilla::services::GetObserverService();
- obsServ->NotifyObservers(nullptr, "application-background", nullptr);
-
- NS_NAMED_LITERAL_STRING(minimize, "heap-minimize");
- obsServ->NotifyObservers(nullptr, "memory-pressure", minimize.get());
-
- // If we are OOM killed with the disk cache enabled, the entire
- // cache will be cleared (bug 105843), so shut down the cache here
- // and re-init on foregrounding
- if (nsCacheService::GlobalInstance()) {
- nsCacheService::GlobalInstance()->Shutdown();
- }
-
- // We really want to send a notification like profile-before-change,
- // but profile-before-change ends up shutting some things down instead
- // of flushing data
- nsIPrefService* prefs = Preferences::GetService();
- if (prefs) {
- prefs->SavePrefFile(nullptr);
- }
- }
-
- static void OnResume()
- {
- MOZ_ASSERT(NS_IsMainThread());
-
- sPauseCount--;
- // If sPauseCount is now 0, we just crossed the threshold from "paused"
- // to "resumed", so we should notify observers and so on.
- if (sPauseCount != 0) {
- return;
- }
-
- // If we are OOM killed with the disk cache enabled, the entire
- // cache will be cleared (bug 105843), so shut down cache on backgrounding
- // and re-init here
- if (nsCacheService::GlobalInstance()) {
- nsCacheService::GlobalInstance()->Init();
- }
-
- // We didn't return from one of our own activities, so restore
- // to foreground status
- nsCOMPtr<nsIObserverService> obsServ =
- mozilla::services::GetObserverService();
- obsServ->NotifyObservers(nullptr, "application-foreground", nullptr);
- }
-
- static void CreateServices(jni::String::Param aCategory, jni::String::Param aData)
- {
- MOZ_ASSERT(NS_IsMainThread());
-
- nsCString category(aCategory->ToCString());
-
- NS_CreateServicesFromCategory(
- category.get(),
- nullptr, // aOrigin
- category.get(),
- aData ? aData->ToString().get() : nullptr);
- }
-
- static int64_t RunUiThreadCallback()
- {
- if (!AndroidBridge::Bridge()) {
- return -1;
- }
-
- return AndroidBridge::Bridge()->RunDelayedUiThreadTasks();
- }
-};
-
-int32_t GeckoThreadSupport::sPauseCount;
-
-
-class GeckoAppShellSupport final
- : public java::GeckoAppShell::Natives<GeckoAppShellSupport>
-{
-public:
- static void ReportJavaCrash(const jni::Class::LocalRef& aCls,
- jni::Throwable::Param aException,
- jni::String::Param aStack)
- {
- if (!jni::ReportException(aCls.Env(), aException.Get(), aStack.Get())) {
- // Only crash below if crash reporter is initialized and annotation
- // succeeded. Otherwise try other means of reporting the crash in
- // Java.
- return;
- }
-
- MOZ_CRASH("Uncaught Java exception");
- }
-
- static void SyncNotifyObservers(jni::String::Param aTopic,
- jni::String::Param aData)
- {
- MOZ_RELEASE_ASSERT(NS_IsMainThread());
- NotifyObservers(aTopic, aData);
- }
-
- static void NotifyObservers(jni::String::Param aTopic,
- jni::String::Param aData)
- {
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(aTopic);
-
- nsCOMPtr<nsIObserverService> obsServ = services::GetObserverService();
- if (!obsServ) {
- return;
- }
-
- obsServ->NotifyObservers(nullptr, aTopic->ToCString().get(),
- aData ? aData->ToString().get() : nullptr);
- }
-
- static void OnSensorChanged(int32_t aType, float aX, float aY, float aZ,
- float aW, int32_t aAccuracy, int64_t aTime)
- {
- AutoTArray<float, 4> values;
-
- switch (aType) {
- // Bug 938035, transfer HAL data for orientation sensor to meet w3c
- // spec, ex: HAL report alpha=90 means East but alpha=90 means West
- // in w3c spec
- case hal::SENSOR_ORIENTATION:
- values.AppendElement(360.0f - aX);
- values.AppendElement(-aY);
- values.AppendElement(-aZ);
- break;
-
- case hal::SENSOR_LINEAR_ACCELERATION:
- case hal::SENSOR_ACCELERATION:
- case hal::SENSOR_GYROSCOPE:
- case hal::SENSOR_PROXIMITY:
- values.AppendElement(aX);
- values.AppendElement(aY);
- values.AppendElement(aZ);
- break;
-
- case hal::SENSOR_LIGHT:
- values.AppendElement(aX);
- break;
-
- case hal::SENSOR_ROTATION_VECTOR:
- case hal::SENSOR_GAME_ROTATION_VECTOR:
- values.AppendElement(aX);
- values.AppendElement(aY);
- values.AppendElement(aZ);
- values.AppendElement(aW);
- break;
-
- default:
- __android_log_print(ANDROID_LOG_ERROR, "Gecko",
- "Unknown sensor type %d", aType);
- }
-
- hal::SensorData sdata(hal::SensorType(aType), aTime, values,
- hal::SensorAccuracyType(aAccuracy));
- hal::NotifySensorChange(sdata);
- }
-
- static void OnLocationChanged(double aLatitude, double aLongitude,
- double aAltitude, float aAccuracy,
- float aBearing, float aSpeed, int64_t aTime)
- {
- if (!gLocationCallback) {
- return;
- }
-
- RefPtr<nsIDOMGeoPosition> geoPosition(
- new nsGeoPosition(aLatitude, aLongitude, aAltitude, aAccuracy,
- aAccuracy, aBearing, aSpeed, aTime));
- gLocationCallback->Update(geoPosition);
- }
-
- static void NotifyUriVisited(jni::String::Param aUri)
- {
-#ifdef MOZ_ANDROID_HISTORY
- nsCOMPtr<IHistory> history = services::GetHistoryService();
- nsCOMPtr<nsIURI> visitedURI;
- if (history &&
- NS_SUCCEEDED(NS_NewURI(getter_AddRefs(visitedURI),
- aUri->ToString()))) {
- history->NotifyVisited(visitedURI);
- }
-#endif
- }
-
- static void NotifyAlertListener(jni::String::Param aName,
- jni::String::Param aTopic,
- jni::String::Param aCookie)
- {
- if (!aName || !aTopic || !aCookie) {
- return;
- }
-
- AndroidAlerts::NotifyListener(
- aName->ToString(), aTopic->ToCString().get(),
- aCookie->ToString().get());
- }
-
- static void OnFullScreenPluginHidden(jni::Object::Param aView)
- {
- nsPluginInstanceOwner::ExitFullScreen(aView.Get());
- }
-};
-
-nsAppShell::nsAppShell()
- : mSyncRunFinished(*(sAppShellLock = new Mutex("nsAppShell")),
- "nsAppShell.SyncRun")
- , mSyncRunQuit(false)
-{
- {
- MutexAutoLock lock(*sAppShellLock);
- sAppShell = this;
- }
-
- if (!XRE_IsParentProcess()) {
- return;
- }
-
- if (jni::IsAvailable()) {
- // Initialize JNI and Set the corresponding state in GeckoThread.
- AndroidBridge::ConstructBridge();
- GeckoAppShellSupport::Init();
- GeckoThreadSupport::Init();
- mozilla::GeckoBatteryManager::Init();
- mozilla::GeckoNetworkManager::Init();
- mozilla::GeckoScreenOrientation::Init();
- mozilla::PrefsHelper::Init();
- nsWindow::InitNatives();
-
- if (jni::IsFennec()) {
- mozilla::ANRReporter::Init();
- mozilla::MemoryMonitor::Init();
- mozilla::widget::Telemetry::Init();
- mozilla::ThumbnailHelper::Init();
- }
-
- java::GeckoThread::SetState(java::GeckoThread::State::JNI_READY());
- }
-
- sPowerManagerService = do_GetService(POWERMANAGERSERVICE_CONTRACTID);
-
- if (sPowerManagerService) {
- sWakeLockListener = new WakeLockListener();
- } else {
- NS_WARNING("Failed to retrieve PowerManagerService, wakelocks will be broken!");
- }
-}
-
-nsAppShell::~nsAppShell()
-{
- {
- MutexAutoLock lock(*sAppShellLock);
- sAppShell = nullptr;
- }
-
- while (mEventQueue.Pop(/* mayWait */ false)) {
- NS_WARNING("Discarded event on shutdown");
- }
-
- if (sPowerManagerService) {
- sPowerManagerService->RemoveWakeLockListener(sWakeLockListener);
-
- sPowerManagerService = nullptr;
- sWakeLockListener = nullptr;
- }
-
- if (jni::IsAvailable()) {
- AndroidBridge::DeconstructBridge();
- }
-}
-
-void
-nsAppShell::NotifyNativeEvent()
-{
- mEventQueue.Signal();
-}
-
-#define PREFNAME_COALESCE_TOUCHES "dom.event.touch.coalescing.enabled"
-static const char* kObservedPrefs[] = {
- PREFNAME_COALESCE_TOUCHES,
- nullptr
-};
-
-nsresult
-nsAppShell::Init()
-{
- nsresult rv = nsBaseAppShell::Init();
- nsCOMPtr<nsIObserverService> obsServ =
- mozilla::services::GetObserverService();
- if (obsServ) {
- obsServ->AddObserver(this, "browser-delayed-startup-finished", false);
- obsServ->AddObserver(this, "profile-after-change", false);
- obsServ->AddObserver(this, "chrome-document-loaded", false);
- obsServ->AddObserver(this, "quit-application-granted", false);
- obsServ->AddObserver(this, "xpcom-shutdown", false);
- }
-
- if (sPowerManagerService)
- sPowerManagerService->AddWakeLockListener(sWakeLockListener);
-
- Preferences::AddStrongObservers(this, kObservedPrefs);
- mAllowCoalescingTouches = Preferences::GetBool(PREFNAME_COALESCE_TOUCHES, true);
- return rv;
-}
-
-NS_IMETHODIMP
-nsAppShell::Observe(nsISupports* aSubject,
- const char* aTopic,
- const char16_t* aData)
-{
- bool removeObserver = false;
-
- if (!strcmp(aTopic, "xpcom-shutdown")) {
- {
- // Release any thread waiting for a sync call to finish.
- mozilla::MutexAutoLock shellLock(*sAppShellLock);
- mSyncRunQuit = true;
- mSyncRunFinished.NotifyAll();
- }
- // We need to ensure no observers stick around after XPCOM shuts down
- // or we'll see crashes, as the app shell outlives XPConnect.
- mObserversHash.Clear();
- return nsBaseAppShell::Observe(aSubject, aTopic, aData);
-
- } else if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID) &&
- aData &&
- nsDependentString(aData).Equals(NS_LITERAL_STRING(PREFNAME_COALESCE_TOUCHES))) {
- mAllowCoalescingTouches = Preferences::GetBool(PREFNAME_COALESCE_TOUCHES, true);
- return NS_OK;
-
- } else if (!strcmp(aTopic, "browser-delayed-startup-finished")) {
- NS_CreateServicesFromCategory("browser-delayed-startup-finished", nullptr,
- "browser-delayed-startup-finished");
-
- } else if (!strcmp(aTopic, "profile-after-change")) {
- if (jni::IsAvailable()) {
- // See if we want to force 16-bit color before doing anything
- if (Preferences::GetBool("gfx.android.rgb16.force", false)) {
- java::GeckoAppShell::SetScreenDepthOverride(16);
- }
-
- java::GeckoThread::SetState(
- java::GeckoThread::State::PROFILE_READY());
-
- // Gecko on Android follows the Android app model where it never
- // stops until it is killed by the system or told explicitly to
- // quit. Therefore, we should *not* exit Gecko when there is no
- // window or the last window is closed. nsIAppStartup::Quit will
- // still force Gecko to exit.
- nsCOMPtr<nsIAppStartup> appStartup =
- do_GetService(NS_APPSTARTUP_CONTRACTID);
- if (appStartup) {
- appStartup->EnterLastWindowClosingSurvivalArea();
- }
- }
- removeObserver = true;
-
- } else if (!strcmp(aTopic, "chrome-document-loaded")) {
- if (jni::IsAvailable()) {
- // Our first window has loaded, assume any JS initialization has run.
- java::GeckoThread::CheckAndSetState(
- java::GeckoThread::State::PROFILE_READY(),
- java::GeckoThread::State::RUNNING());
- }
- removeObserver = true;
-
- } else if (!strcmp(aTopic, "quit-application-granted")) {
- if (jni::IsAvailable()) {
- java::GeckoThread::SetState(
- java::GeckoThread::State::EXITING());
-
- // We are told explicitly to quit, perhaps due to
- // nsIAppStartup::Quit being called. We should release our hold on
- // nsIAppStartup and let it continue to quit.
- nsCOMPtr<nsIAppStartup> appStartup =
- do_GetService(NS_APPSTARTUP_CONTRACTID);
- if (appStartup) {
- appStartup->ExitLastWindowClosingSurvivalArea();
- }
- }
- removeObserver = true;
-
- } else if (!strcmp(aTopic, "nsPref:changed")) {
- if (jni::IsAvailable()) {
- mozilla::PrefsHelper::OnPrefChange(aData);
- }
- }
-
- if (removeObserver) {
- nsCOMPtr<nsIObserverService> obsServ =
- mozilla::services::GetObserverService();
- if (obsServ) {
- obsServ->RemoveObserver(this, aTopic);
- }
- }
- return NS_OK;
-}
-
-bool
-nsAppShell::ProcessNextNativeEvent(bool mayWait)
-{
- EVLOG("nsAppShell::ProcessNextNativeEvent %d", mayWait);
-
- PROFILER_LABEL("nsAppShell", "ProcessNextNativeEvent",
- js::ProfileEntry::Category::EVENTS);
-
- mozilla::UniquePtr<Event> curEvent;
-
- {
- curEvent = mEventQueue.Pop(/* mayWait */ false);
-
- if (!curEvent && mayWait) {
- // This processes messages in the Android Looper. Note that we only
- // get here if the normal Gecko event loop has been awoken
- // (bug 750713). Looper messages effectively have the lowest
- // priority because we only process them before we're about to
- // wait for new events.
- if (jni::IsAvailable() &&
- AndroidBridge::Bridge()->PumpMessageLoop()) {
- return true;
- }
-
- PROFILER_LABEL("nsAppShell", "ProcessNextNativeEvent::Wait",
- js::ProfileEntry::Category::EVENTS);
- mozilla::HangMonitor::Suspend();
-
- curEvent = mEventQueue.Pop(/* mayWait */ true);
- }
- }
-
- if (!curEvent)
- return false;
-
- mozilla::HangMonitor::NotifyActivity(curEvent->ActivityType());
-
- curEvent->Run();
- return true;
-}
-
-void
-nsAppShell::SyncRunEvent(Event&& event,
- UniquePtr<Event>(*eventFactory)(UniquePtr<Event>&&))
-{
- // Perform the call on the Gecko thread in a separate lambda, and wait
- // on the monitor on the current thread.
- MOZ_ASSERT(!NS_IsMainThread());
-
- // This is the lock to check that app shell is still alive,
- // and to wait on for the sync call to complete.
- mozilla::MutexAutoLock shellLock(*sAppShellLock);
- nsAppShell* const appShell = sAppShell;
-
- if (MOZ_UNLIKELY(!appShell)) {
- // Post-shutdown.
- return;
- }
-
- bool finished = false;
- auto runAndNotify = [&event, &finished] {
- mozilla::MutexAutoLock shellLock(*sAppShellLock);
- nsAppShell* const appShell = sAppShell;
- if (MOZ_UNLIKELY(!appShell || appShell->mSyncRunQuit)) {
- return;
- }
- event.Run();
- finished = true;
- appShell->mSyncRunFinished.NotifyAll();
- };
-
- UniquePtr<Event> runAndNotifyEvent = mozilla::MakeUnique<
- LambdaEvent<decltype(runAndNotify)>>(mozilla::Move(runAndNotify));
-
- if (eventFactory) {
- runAndNotifyEvent = (*eventFactory)(mozilla::Move(runAndNotifyEvent));
- }
-
- appShell->mEventQueue.Post(mozilla::Move(runAndNotifyEvent));
-
- while (!finished && MOZ_LIKELY(sAppShell && !sAppShell->mSyncRunQuit)) {
- appShell->mSyncRunFinished.Wait();
- }
-}
-
-already_AddRefed<nsIURI>
-nsAppShell::ResolveURI(const nsCString& aUriStr)
-{
- nsCOMPtr<nsIIOService> ioServ = do_GetIOService();
- nsCOMPtr<nsIURI> uri;
-
- if (NS_SUCCEEDED(ioServ->NewURI(aUriStr, nullptr,
- nullptr, getter_AddRefs(uri)))) {
- return uri.forget();
- }
-
- nsCOMPtr<nsIURIFixup> fixup = do_GetService(NS_URIFIXUP_CONTRACTID);
- if (fixup && NS_SUCCEEDED(
- fixup->CreateFixupURI(aUriStr, 0, nullptr, getter_AddRefs(uri)))) {
- return uri.forget();
- }
- return nullptr;
-}
-
-nsresult
-nsAppShell::AddObserver(const nsAString &aObserverKey, nsIObserver *aObserver)
-{
- NS_ASSERTION(aObserver != nullptr, "nsAppShell::AddObserver: aObserver is null!");
- mObserversHash.Put(aObserverKey, aObserver);
- return NS_OK;
-}
-
-// Used by IPC code
-namespace mozilla {
-
-bool ProcessNextEvent()
-{
- nsAppShell* const appShell = nsAppShell::Get();
- if (!appShell) {
- return false;
- }
-
- return appShell->ProcessNextNativeEvent(true) ? true : false;
-}
-
-void NotifyEvent()
-{
- nsAppShell* const appShell = nsAppShell::Get();
- if (!appShell) {
- return;
- }
- appShell->NotifyNativeEvent();
-}
-
-}
diff --git a/widget/android/nsAppShell.h b/widget/android/nsAppShell.h
deleted file mode 100644
index 42453999d..000000000
--- a/widget/android/nsAppShell.h
+++ /dev/null
@@ -1,223 +0,0 @@
-/* -*- Mode: c++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4; -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsAppShell_h__
-#define nsAppShell_h__
-
-#include "mozilla/HangMonitor.h"
-#include "mozilla/LinkedList.h"
-#include "mozilla/Monitor.h"
-#include "mozilla/Move.h"
-#include "mozilla/StaticPtr.h"
-#include "mozilla/UniquePtr.h"
-#include "mozilla/Unused.h"
-#include "mozilla/jni/Natives.h"
-#include "nsBaseAppShell.h"
-#include "nsCOMPtr.h"
-#include "nsTArray.h"
-#include "nsInterfaceHashtable.h"
-#include "nsIAndroidBridge.h"
-
-namespace mozilla {
-bool ProcessNextEvent();
-void NotifyEvent();
-}
-
-class nsWindow;
-
-class nsAppShell :
- public nsBaseAppShell
-{
-public:
- struct Event : mozilla::LinkedListElement<Event>
- {
- typedef mozilla::HangMonitor::ActivityType Type;
-
- bool HasSameTypeAs(const Event* other) const
- {
- // Compare vtable addresses to determine same type.
- return *reinterpret_cast<const uintptr_t*>(this)
- == *reinterpret_cast<const uintptr_t*>(other);
- }
-
- virtual ~Event() {}
- virtual void Run() = 0;
-
- virtual void PostTo(mozilla::LinkedList<Event>& queue)
- {
- queue.insertBack(this);
- }
-
- virtual Type ActivityType() const
- {
- return Type::kGeneralActivity;
- }
- };
-
- template<typename T>
- class LambdaEvent : public Event
- {
- protected:
- T lambda;
-
- public:
- LambdaEvent(T&& l) : lambda(mozilla::Move(l)) {}
- void Run() override { return lambda(); }
- };
-
- class ProxyEvent : public Event
- {
- protected:
- mozilla::UniquePtr<Event> baseEvent;
-
- public:
- ProxyEvent(mozilla::UniquePtr<Event>&& event)
- : baseEvent(mozilla::Move(event))
- {}
-
- void PostTo(mozilla::LinkedList<Event>& queue) override
- {
- baseEvent->PostTo(queue);
- }
-
- void Run() override
- {
- baseEvent->Run();
- }
- };
-
- static nsAppShell* Get()
- {
- MOZ_ASSERT(NS_IsMainThread());
- return sAppShell;
- }
-
- nsAppShell();
-
- NS_DECL_ISUPPORTS_INHERITED
- NS_DECL_NSIOBSERVER
-
- nsresult Init();
-
- void NotifyNativeEvent();
- bool ProcessNextNativeEvent(bool mayWait) override;
-
- // Post a subclass of Event.
- // e.g. PostEvent(mozilla::MakeUnique<MyEvent>());
- template<typename T, typename D>
- static void PostEvent(mozilla::UniquePtr<T, D>&& event)
- {
- mozilla::MutexAutoLock lock(*sAppShellLock);
- if (!sAppShell) {
- return;
- }
- sAppShell->mEventQueue.Post(mozilla::Move(event));
- }
-
- // Post a event that will call a lambda
- // e.g. PostEvent([=] { /* do something */ });
- template<typename T>
- static void PostEvent(T&& lambda)
- {
- mozilla::MutexAutoLock lock(*sAppShellLock);
- if (!sAppShell) {
- return;
- }
- sAppShell->mEventQueue.Post(mozilla::MakeUnique<LambdaEvent<T>>(
- mozilla::Move(lambda)));
- }
-
- // Post a event and wait for it to finish running on the Gecko thread.
- static void SyncRunEvent(Event&& event,
- mozilla::UniquePtr<Event>(*eventFactory)(
- mozilla::UniquePtr<Event>&&) = nullptr);
-
- static already_AddRefed<nsIURI> ResolveURI(const nsCString& aUriStr);
-
- void SetBrowserApp(nsIAndroidBrowserApp* aBrowserApp) {
- mBrowserApp = aBrowserApp;
- }
-
- nsIAndroidBrowserApp* GetBrowserApp() {
- return mBrowserApp;
- }
-
-protected:
- static nsAppShell* sAppShell;
- static mozilla::StaticAutoPtr<mozilla::Mutex> sAppShellLock;
-
- virtual ~nsAppShell();
-
- nsresult AddObserver(const nsAString &aObserverKey, nsIObserver *aObserver);
-
- class NativeCallbackEvent : public Event
- {
- // Capturing the nsAppShell instance is safe because if the app
- // shell is detroyed, this lambda will not be called either.
- nsAppShell* const appShell;
-
- public:
- NativeCallbackEvent(nsAppShell* as) : appShell(as) {}
- void Run() override { appShell->NativeEventCallback(); }
- };
-
- void ScheduleNativeEventCallback() override
- {
- mEventQueue.Post(mozilla::MakeUnique<NativeCallbackEvent>(this));
- }
-
- class Queue
- {
- private:
- mozilla::Monitor mMonitor;
- mozilla::LinkedList<Event> mQueue;
-
- public:
- Queue() : mMonitor("nsAppShell.Queue")
- {}
-
- void Signal()
- {
- mozilla::MonitorAutoLock lock(mMonitor);
- lock.NotifyAll();
- }
-
- void Post(mozilla::UniquePtr<Event>&& event)
- {
- MOZ_ASSERT(event && !event->isInList());
-
- mozilla::MonitorAutoLock lock(mMonitor);
- event->PostTo(mQueue);
- if (event->isInList()) {
- // Ownership of event object transfers to the queue.
- mozilla::Unused << event.release();
- }
- lock.NotifyAll();
- }
-
- mozilla::UniquePtr<Event> Pop(bool mayWait)
- {
- mozilla::MonitorAutoLock lock(mMonitor);
-
- if (mayWait && mQueue.isEmpty()) {
- lock.Wait();
- }
- // Ownership of event object transfers to the return value.
- return mozilla::UniquePtr<Event>(mQueue.popFirst());
- }
-
- } mEventQueue;
-
- mozilla::CondVar mSyncRunFinished;
- bool mSyncRunQuit;
-
- bool mAllowCoalescingTouches;
-
- nsCOMPtr<nsIAndroidBrowserApp> mBrowserApp;
- nsInterfaceHashtable<nsStringHashKey, nsIObserver> mObserversHash;
-};
-
-#endif // nsAppShell_h__
-
diff --git a/widget/android/nsClipboard.cpp b/widget/android/nsClipboard.cpp
deleted file mode 100644
index 5d70ae16b..000000000
--- a/widget/android/nsClipboard.cpp
+++ /dev/null
@@ -1,123 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/ContentChild.h"
-#include "nsClipboard.h"
-#include "nsISupportsPrimitives.h"
-#include "AndroidBridge.h"
-#include "nsCOMPtr.h"
-#include "nsComponentManagerUtils.h"
-#include "nsXULAppAPI.h"
-
-using namespace mozilla;
-using mozilla::dom::ContentChild;
-
-NS_IMPL_ISUPPORTS(nsClipboard, nsIClipboard)
-
-/* The Android clipboard only supports text and doesn't support mime types
- * so we assume all clipboard data is text/unicode for now. Documentation
- * indicates that support for other data types is planned for future
- * releases.
- */
-
-nsClipboard::nsClipboard()
-{
-}
-
-NS_IMETHODIMP
-nsClipboard::SetData(nsITransferable *aTransferable,
- nsIClipboardOwner *anOwner, int32_t aWhichClipboard)
-{
- if (aWhichClipboard != kGlobalClipboard)
- return NS_ERROR_NOT_IMPLEMENTED;
-
- nsCOMPtr<nsISupports> tmp;
- uint32_t len;
- nsresult rv = aTransferable->GetTransferData(kUnicodeMime, getter_AddRefs(tmp),
- &len);
- NS_ENSURE_SUCCESS(rv, rv);
- nsCOMPtr<nsISupportsString> supportsString = do_QueryInterface(tmp);
- // No support for non-text data
- NS_ENSURE_TRUE(supportsString, NS_ERROR_NOT_IMPLEMENTED);
- nsAutoString buffer;
- supportsString->GetData(buffer);
-
- java::Clipboard::SetText(buffer);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsClipboard::GetData(nsITransferable *aTransferable, int32_t aWhichClipboard)
-{
- if (aWhichClipboard != kGlobalClipboard)
- return NS_ERROR_NOT_IMPLEMENTED;
-
- nsAutoString buffer;
- if (!AndroidBridge::Bridge())
- return NS_ERROR_NOT_IMPLEMENTED;
- if (!AndroidBridge::Bridge()->GetClipboardText(buffer))
- return NS_ERROR_UNEXPECTED;
-
- nsresult rv;
- nsCOMPtr<nsISupportsString> dataWrapper =
- do_CreateInstance(NS_SUPPORTS_STRING_CONTRACTID, &rv);
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = dataWrapper->SetData(buffer);
- NS_ENSURE_SUCCESS(rv, rv);
-
- // If our data flavor has already been added, this will fail. But we don't care
- aTransferable->AddDataFlavor(kUnicodeMime);
-
- nsCOMPtr<nsISupports> nsisupportsDataWrapper =
- do_QueryInterface(dataWrapper);
- rv = aTransferable->SetTransferData(kUnicodeMime, nsisupportsDataWrapper,
- buffer.Length() * sizeof(char16_t));
- NS_ENSURE_SUCCESS(rv, rv);
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsClipboard::EmptyClipboard(int32_t aWhichClipboard)
-{
- if (aWhichClipboard != kGlobalClipboard)
- return NS_ERROR_NOT_IMPLEMENTED;
- java::Clipboard::ClearText();
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsClipboard::HasDataMatchingFlavors(const char **aFlavorList,
- uint32_t aLength, int32_t aWhichClipboard,
- bool *aHasText)
-{
- *aHasText = false;
- if (aWhichClipboard != kGlobalClipboard)
- return NS_ERROR_NOT_IMPLEMENTED;
-
- for (uint32_t k = 0; k < aLength; k++) {
- if (strcmp(aFlavorList[k], kUnicodeMime) == 0) {
- *aHasText = java::Clipboard::HasText();
- break;
- }
- }
-
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsClipboard::SupportsSelectionClipboard(bool *aIsSupported)
-{
- *aIsSupported = false;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsClipboard::SupportsFindClipboard(bool* _retval)
-{
- *_retval = false;
- return NS_OK;
-}
diff --git a/widget/android/nsClipboard.h b/widget/android/nsClipboard.h
deleted file mode 100644
index 657a8dea8..000000000
--- a/widget/android/nsClipboard.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef NS_CLIPBOARD_H
-#define NS_CLIPBOARD_H
-
-#include "nsIClipboard.h"
-
-class nsClipboard final : public nsIClipboard
-{
-private:
- ~nsClipboard() {}
-
-public:
- NS_DECL_ISUPPORTS
- NS_DECL_NSICLIPBOARD
-
- nsClipboard();
-};
-
-#endif
diff --git a/widget/android/nsDeviceContextAndroid.cpp b/widget/android/nsDeviceContextAndroid.cpp
deleted file mode 100644
index 4c952957e..000000000
--- a/widget/android/nsDeviceContextAndroid.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsDeviceContextAndroid.h"
-
-#include "mozilla/gfx/PrintTargetPDF.h"
-#include "mozilla/RefPtr.h"
-#include "nsString.h"
-#include "nsIFile.h"
-#include "nsIFileStreams.h"
-#include "nsIPrintSettings.h"
-#include "nsDirectoryServiceDefs.h"
-
-using namespace mozilla;
-using namespace mozilla::gfx;
-
-NS_IMPL_ISUPPORTS(nsDeviceContextSpecAndroid, nsIDeviceContextSpec)
-
-already_AddRefed<PrintTarget>
-nsDeviceContextSpecAndroid::MakePrintTarget()
-{
- nsresult rv =
- NS_GetSpecialDirectory(NS_OS_TEMP_DIR, getter_AddRefs(mTempFile));
- NS_ENSURE_SUCCESS(rv, nullptr);
-
- nsAutoCString filename("tmp-printing.pdf");
- mTempFile->AppendNative(filename);
- rv = mTempFile->CreateUnique(nsIFile::NORMAL_FILE_TYPE, 0660);
- NS_ENSURE_SUCCESS(rv, nullptr);
-
- nsCOMPtr<nsIFileOutputStream> stream = do_CreateInstance("@mozilla.org/network/file-output-stream;1");
- rv = stream->Init(mTempFile, -1, -1, 0);
- NS_ENSURE_SUCCESS(rv, nullptr);
-
- // XXX: what should we do here for size? screen size?
- IntSize size(480, 800);
-
- return PrintTargetPDF::CreateOrNull(stream, size);
-}
-
-NS_IMETHODIMP
-nsDeviceContextSpecAndroid::Init(nsIWidget* aWidget,
- nsIPrintSettings* aPS,
- bool aIsPrintPreview)
-{
- mPrintSettings = aPS;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsDeviceContextSpecAndroid::BeginDocument(const nsAString& aTitle,
- const nsAString& aPrintToFileName,
- int32_t aStartPage,
- int32_t aEndPage)
-{
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsDeviceContextSpecAndroid::EndDocument()
-{
- nsXPIDLString targetPath;
- nsCOMPtr<nsIFile> destFile;
- mPrintSettings->GetToFileName(getter_Copies(targetPath));
-
- nsresult rv = NS_NewNativeLocalFile(NS_ConvertUTF16toUTF8(targetPath),
- false, getter_AddRefs(destFile));
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsAutoString destLeafName;
- rv = destFile->GetLeafName(destLeafName);
- NS_ENSURE_SUCCESS(rv, rv);
-
- nsCOMPtr<nsIFile> destDir;
- rv = destFile->GetParent(getter_AddRefs(destDir));
- NS_ENSURE_SUCCESS(rv, rv);
-
- rv = mTempFile->MoveTo(destDir, destLeafName);
- NS_ENSURE_SUCCESS(rv, rv);
-
- destFile->SetPermissions(0666);
- return NS_OK;
-}
diff --git a/widget/android/nsDeviceContextAndroid.h b/widget/android/nsDeviceContextAndroid.h
deleted file mode 100644
index 7abe38ca4..000000000
--- a/widget/android/nsDeviceContextAndroid.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#include "nsIDeviceContextSpec.h"
-#include "nsCOMPtr.h"
-
-class nsDeviceContextSpecAndroid final : public nsIDeviceContextSpec
-{
-private:
- ~nsDeviceContextSpecAndroid() {}
-
-public:
- NS_DECL_ISUPPORTS
-
- virtual already_AddRefed<PrintTarget> MakePrintTarget() final;
-
- NS_IMETHOD Init(nsIWidget* aWidget,
- nsIPrintSettings* aPS,
- bool aIsPrintPreview) override;
- NS_IMETHOD BeginDocument(const nsAString& aTitle,
- const nsAString& aPrintToFileName,
- int32_t aStartPage,
- int32_t aEndPage) override;
- NS_IMETHOD EndDocument() override;
- NS_IMETHOD BeginPage() override { return NS_OK; }
- NS_IMETHOD EndPage() override { return NS_OK; }
-
-private:
- nsCOMPtr<nsIPrintSettings> mPrintSettings;
- nsCOMPtr<nsIFile> mTempFile;
-};
diff --git a/widget/android/nsIAndroidBridge.idl b/widget/android/nsIAndroidBridge.idl
deleted file mode 100644
index 91b1a3d52..000000000
--- a/widget/android/nsIAndroidBridge.idl
+++ /dev/null
@@ -1,42 +0,0 @@
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsISupports.idl"
-
-interface mozIDOMWindowProxy;
-
-[scriptable, uuid(e8420a7b-659b-4325-968b-a114a6a067aa)]
-interface nsIBrowserTab : nsISupports {
- readonly attribute mozIDOMWindowProxy window;
- readonly attribute float scale;
-};
-
-[scriptable, uuid(08426a73-e70b-4680-9282-630932e2b2bb)]
-interface nsIUITelemetryObserver : nsISupports {
- void startSession(in wstring name,
- in long long timestamp);
- void stopSession(in wstring name,
- in wstring reason,
- in long long timestamp);
- void addEvent(in wstring action,
- in wstring method,
- in long long timestamp,
- in wstring extras);
-};
-
-[scriptable, uuid(0370450f-2e9c-4d16-b333-8ca6ce31a5ff)]
-interface nsIAndroidBrowserApp : nsISupports {
- readonly attribute nsIBrowserTab selectedTab;
- nsIBrowserTab getBrowserTab(in int32_t tabId);
- nsIUITelemetryObserver getUITelemetryObserver();
-};
-
-[scriptable, uuid(1beb70d3-70f3-4742-98cc-a3d301b26c0c)]
-interface nsIAndroidBridge : nsISupports
-{
- [implicit_jscontext] void handleGeckoMessage(in jsval message);
- attribute nsIAndroidBrowserApp browserApp;
- void contentDocumentChanged(in mozIDOMWindowProxy window);
- boolean isContentDocumentDisplayed(in mozIDOMWindowProxy window);
-};
diff --git a/widget/android/nsIdleServiceAndroid.cpp b/widget/android/nsIdleServiceAndroid.cpp
deleted file mode 100644
index 1992d8043..000000000
--- a/widget/android/nsIdleServiceAndroid.cpp
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim:expandtab:shiftwidth=4:tabstop=4:
- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "nsIdleServiceAndroid.h"
-#include "nsIServiceManager.h"
-
-NS_IMPL_ISUPPORTS_INHERITED0(nsIdleServiceAndroid, nsIdleService)
-
-bool
-nsIdleServiceAndroid::PollIdleTime(uint32_t *aIdleTime)
-{
- return false;
-}
-
-bool
-nsIdleServiceAndroid::UsePollMode()
-{
- return false;
-}
diff --git a/widget/android/nsIdleServiceAndroid.h b/widget/android/nsIdleServiceAndroid.h
deleted file mode 100644
index 28bca0553..000000000
--- a/widget/android/nsIdleServiceAndroid.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* vim:expandtab:shiftwidth=4:tabstop=4:
- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsIdleServiceAndroid_h__
-#define nsIdleServiceAndroid_h__
-
-#include "nsIdleService.h"
-
-class nsIdleServiceAndroid : public nsIdleService
-{
-public:
- NS_DECL_ISUPPORTS_INHERITED
-
- bool PollIdleTime(uint32_t* aIdleTime) override;
-
- static already_AddRefed<nsIdleServiceAndroid> GetInstance()
- {
- RefPtr<nsIdleService> idleService = nsIdleService::GetInstance();
- if (!idleService) {
- idleService = new nsIdleServiceAndroid();
- }
-
- return idleService.forget().downcast<nsIdleServiceAndroid>();
- }
-
-protected:
- nsIdleServiceAndroid() { }
- virtual ~nsIdleServiceAndroid() { }
- bool UsePollMode() override;
-};
-
-#endif // nsIdleServiceAndroid_h__
diff --git a/widget/android/nsLookAndFeel.cpp b/widget/android/nsLookAndFeel.cpp
deleted file mode 100644
index 770b52a24..000000000
--- a/widget/android/nsLookAndFeel.cpp
+++ /dev/null
@@ -1,500 +0,0 @@
-/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/dom/ContentChild.h"
-#include "nsStyleConsts.h"
-#include "nsXULAppAPI.h"
-#include "nsLookAndFeel.h"
-#include "gfxFont.h"
-#include "gfxFontConstants.h"
-#include "mozilla/gfx/2D.h"
-
-using namespace mozilla;
-using mozilla::dom::ContentChild;
-
-bool nsLookAndFeel::mInitializedSystemColors = false;
-AndroidSystemColors nsLookAndFeel::mSystemColors;
-
-bool nsLookAndFeel::mInitializedShowPassword = false;
-bool nsLookAndFeel::mShowPassword = true;
-
-static const char16_t UNICODE_BULLET = 0x2022;
-
-nsLookAndFeel::nsLookAndFeel()
- : nsXPLookAndFeel()
-{
-}
-
-nsLookAndFeel::~nsLookAndFeel()
-{
-}
-
-#define BG_PRELIGHT_COLOR NS_RGB(0xee,0xee,0xee)
-#define FG_PRELIGHT_COLOR NS_RGB(0x77,0x77,0x77)
-#define BLACK_COLOR NS_RGB(0x00,0x00,0x00)
-#define DARK_GRAY_COLOR NS_RGB(0x40,0x40,0x40)
-#define GRAY_COLOR NS_RGB(0x80,0x80,0x80)
-#define LIGHT_GRAY_COLOR NS_RGB(0xa0,0xa0,0xa0)
-#define RED_COLOR NS_RGB(0xff,0x00,0x00)
-
-nsresult
-nsLookAndFeel::GetSystemColors()
-{
- if (mInitializedSystemColors)
- return NS_OK;
-
- if (!AndroidBridge::Bridge())
- return NS_ERROR_FAILURE;
-
- AndroidBridge::Bridge()->GetSystemColors(&mSystemColors);
-
- mInitializedSystemColors = true;
-
- return NS_OK;
-}
-
-nsresult
-nsLookAndFeel::CallRemoteGetSystemColors()
-{
- // An array has to be used to get data from remote process
- InfallibleTArray<uint32_t> colors;
- uint32_t colorsCount = sizeof(AndroidSystemColors) / sizeof(nscolor);
-
- if (!ContentChild::GetSingleton()->SendGetSystemColors(colorsCount, &colors))
- return NS_ERROR_FAILURE;
-
- NS_ASSERTION(colors.Length() == colorsCount, "System colors array is incomplete");
- if (colors.Length() == 0)
- return NS_ERROR_FAILURE;
-
- if (colors.Length() < colorsCount)
- colorsCount = colors.Length();
-
- // Array elements correspond to the members of mSystemColors structure,
- // so just copy the memory block
- memcpy(&mSystemColors, colors.Elements(), sizeof(nscolor) * colorsCount);
-
- mInitializedSystemColors = true;
-
- return NS_OK;
-}
-
-nsresult
-nsLookAndFeel::NativeGetColor(ColorID aID, nscolor &aColor)
-{
- nsresult rv = NS_OK;
-
- if (!mInitializedSystemColors) {
- if (XRE_IsParentProcess())
- rv = GetSystemColors();
- else
- rv = CallRemoteGetSystemColors();
- NS_ENSURE_SUCCESS(rv, rv);
- }
-
- // XXX we'll want to use context.obtainStyledAttributes on the java side to
- // get all of these; see TextView.java for a good exmaple.
-
- switch (aID) {
- // These colors don't seem to be used for anything anymore in Mozilla
- // (except here at least TextSelectBackground and TextSelectForeground)
- // The CSS2 colors below are used.
- case eColorID_WindowBackground:
- aColor = NS_RGB(0xFF, 0xFF, 0xFF);
- break;
- case eColorID_WindowForeground:
- aColor = mSystemColors.textColorPrimary;
- break;
- case eColorID_WidgetBackground:
- aColor = mSystemColors.colorBackground;
- break;
- case eColorID_WidgetForeground:
- aColor = mSystemColors.colorForeground;
- break;
- case eColorID_WidgetSelectBackground:
- aColor = mSystemColors.textColorHighlight;
- break;
- case eColorID_WidgetSelectForeground:
- aColor = mSystemColors.textColorPrimaryInverse;
- break;
- case eColorID_Widget3DHighlight:
- aColor = LIGHT_GRAY_COLOR;
- break;
- case eColorID_Widget3DShadow:
- aColor = DARK_GRAY_COLOR;
- break;
- case eColorID_TextBackground:
- // not used?
- aColor = mSystemColors.colorBackground;
- break;
- case eColorID_TextForeground:
- // not used?
- aColor = mSystemColors.textColorPrimary;
- break;
- case eColorID_TextSelectBackground:
- case eColorID_IMESelectedRawTextBackground:
- case eColorID_IMESelectedConvertedTextBackground:
- // still used
- aColor = mSystemColors.textColorHighlight;
- break;
- case eColorID_TextSelectForeground:
- case eColorID_IMESelectedRawTextForeground:
- case eColorID_IMESelectedConvertedTextForeground:
- // still used
- aColor = mSystemColors.textColorPrimaryInverse;
- break;
- case eColorID_IMERawInputBackground:
- case eColorID_IMEConvertedTextBackground:
- aColor = NS_TRANSPARENT;
- break;
- case eColorID_IMERawInputForeground:
- case eColorID_IMEConvertedTextForeground:
- aColor = NS_SAME_AS_FOREGROUND_COLOR;
- break;
- case eColorID_IMERawInputUnderline:
- case eColorID_IMEConvertedTextUnderline:
- aColor = NS_SAME_AS_FOREGROUND_COLOR;
- break;
- case eColorID_IMESelectedRawTextUnderline:
- case eColorID_IMESelectedConvertedTextUnderline:
- aColor = NS_TRANSPARENT;
- break;
- case eColorID_SpellCheckerUnderline:
- aColor = RED_COLOR;
- break;
-
- // css2 http://www.w3.org/TR/REC-CSS2/ui.html#system-colors
- case eColorID_activeborder:
- // active window border
- aColor = mSystemColors.colorBackground;
- break;
- case eColorID_activecaption:
- // active window caption background
- aColor = mSystemColors.colorBackground;
- break;
- case eColorID_appworkspace:
- // MDI background color
- aColor = mSystemColors.colorBackground;
- break;
- case eColorID_background:
- // desktop background
- aColor = mSystemColors.colorBackground;
- break;
- case eColorID_captiontext:
- // text in active window caption, size box, and scrollbar arrow box (!)
- aColor = mSystemColors.colorForeground;
- break;
- case eColorID_graytext:
- // disabled text in windows, menus, etc.
- aColor = mSystemColors.textColorTertiary;
- break;
- case eColorID_highlight:
- // background of selected item
- aColor = mSystemColors.textColorHighlight;
- break;
- case eColorID_highlighttext:
- // text of selected item
- aColor = mSystemColors.textColorPrimaryInverse;
- break;
- case eColorID_inactiveborder:
- // inactive window border
- aColor = mSystemColors.colorBackground;
- break;
- case eColorID_inactivecaption:
- // inactive window caption
- aColor = mSystemColors.colorBackground;
- break;
- case eColorID_inactivecaptiontext:
- // text in inactive window caption
- aColor = mSystemColors.textColorTertiary;
- break;
- case eColorID_infobackground:
- // tooltip background color
- aColor = mSystemColors.colorBackground;
- break;
- case eColorID_infotext:
- // tooltip text color
- aColor = mSystemColors.colorForeground;
- break;
- case eColorID_menu:
- // menu background
- aColor = mSystemColors.colorBackground;
- break;
- case eColorID_menutext:
- // menu text
- aColor = mSystemColors.colorForeground;
- break;
- case eColorID_scrollbar:
- // scrollbar gray area
- aColor = mSystemColors.colorBackground;
- break;
-
- case eColorID_threedface:
- case eColorID_buttonface:
- // 3-D face color
- aColor = mSystemColors.colorBackground;
- break;
-
- case eColorID_buttontext:
- // text on push buttons
- aColor = mSystemColors.colorForeground;
- break;
-
- case eColorID_buttonhighlight:
- // 3-D highlighted edge color
- case eColorID_threedhighlight:
- // 3-D highlighted outer edge color
- aColor = LIGHT_GRAY_COLOR;
- break;
-
- case eColorID_threedlightshadow:
- // 3-D highlighted inner edge color
- aColor = mSystemColors.colorBackground;
- break;
-
- case eColorID_buttonshadow:
- // 3-D shadow edge color
- case eColorID_threedshadow:
- // 3-D shadow inner edge color
- aColor = GRAY_COLOR;
- break;
-
- case eColorID_threeddarkshadow:
- // 3-D shadow outer edge color
- aColor = BLACK_COLOR;
- break;
-
- case eColorID_window:
- case eColorID_windowframe:
- aColor = mSystemColors.colorBackground;
- break;
-
- case eColorID_windowtext:
- aColor = mSystemColors.textColorPrimary;
- break;
-
- case eColorID__moz_eventreerow:
- case eColorID__moz_field:
- aColor = mSystemColors.colorBackground;
- break;
- case eColorID__moz_fieldtext:
- aColor = mSystemColors.textColorPrimary;
- break;
- case eColorID__moz_dialog:
- aColor = mSystemColors.colorBackground;
- break;
- case eColorID__moz_dialogtext:
- aColor = mSystemColors.colorForeground;
- break;
- case eColorID__moz_dragtargetzone:
- aColor = mSystemColors.textColorHighlight;
- break;
- case eColorID__moz_buttondefault:
- // default button border color
- aColor = BLACK_COLOR;
- break;
- case eColorID__moz_buttonhoverface:
- aColor = BG_PRELIGHT_COLOR;
- break;
- case eColorID__moz_buttonhovertext:
- aColor = FG_PRELIGHT_COLOR;
- break;
- case eColorID__moz_cellhighlight:
- case eColorID__moz_html_cellhighlight:
- aColor = mSystemColors.textColorHighlight;
- break;
- case eColorID__moz_cellhighlighttext:
- case eColorID__moz_html_cellhighlighttext:
- aColor = mSystemColors.textColorPrimaryInverse;
- break;
- case eColorID__moz_menuhover:
- aColor = BG_PRELIGHT_COLOR;
- break;
- case eColorID__moz_menuhovertext:
- aColor = FG_PRELIGHT_COLOR;
- break;
- case eColorID__moz_oddtreerow:
- aColor = NS_TRANSPARENT;
- break;
- case eColorID__moz_nativehyperlinktext:
- aColor = NS_SAME_AS_FOREGROUND_COLOR;
- break;
- case eColorID__moz_comboboxtext:
- aColor = mSystemColors.colorForeground;
- break;
- case eColorID__moz_combobox:
- aColor = mSystemColors.colorBackground;
- break;
- case eColorID__moz_menubartext:
- aColor = mSystemColors.colorForeground;
- break;
- case eColorID__moz_menubarhovertext:
- aColor = FG_PRELIGHT_COLOR;
- break;
- default:
- /* default color is BLACK */
- aColor = 0;
- rv = NS_ERROR_FAILURE;
- break;
- }
-
- return rv;
-}
-
-
-nsresult
-nsLookAndFeel::GetIntImpl(IntID aID, int32_t &aResult)
-{
- nsresult rv = nsXPLookAndFeel::GetIntImpl(aID, aResult);
- if (NS_SUCCEEDED(rv))
- return rv;
-
- rv = NS_OK;
-
- switch (aID) {
- case eIntID_CaretBlinkTime:
- aResult = 500;
- break;
-
- case eIntID_CaretWidth:
- aResult = 1;
- break;
-
- case eIntID_ShowCaretDuringSelection:
- aResult = 0;
- break;
-
- case eIntID_SelectTextfieldsOnKeyFocus:
- // Select textfield content when focused by kbd
- // used by EventStateManager::sTextfieldSelectModel
- aResult = 1;
- break;
-
- case eIntID_SubmenuDelay:
- aResult = 200;
- break;
-
- case eIntID_TooltipDelay:
- aResult = 500;
- break;
-
- case eIntID_MenusCanOverlapOSBar:
- // we want XUL popups to be able to overlap the task bar.
- aResult = 1;
- break;
-
- case eIntID_ScrollArrowStyle:
- aResult = eScrollArrowStyle_Single;
- break;
-
- case eIntID_ScrollSliderStyle:
- aResult = eScrollThumbStyle_Proportional;
- break;
-
- case eIntID_TouchEnabled:
- aResult = 1;
- break;
-
- case eIntID_ColorPickerAvailable:
- aResult = 1;
- break;
-
- case eIntID_WindowsDefaultTheme:
- case eIntID_WindowsThemeIdentifier:
- case eIntID_OperatingSystemVersionIdentifier:
- aResult = 0;
- rv = NS_ERROR_NOT_IMPLEMENTED;
- break;
-
- case eIntID_SpellCheckerUnderlineStyle:
- aResult = NS_STYLE_TEXT_DECORATION_STYLE_WAVY;
- break;
-
- case eIntID_ScrollbarButtonAutoRepeatBehavior:
- aResult = 0;
- break;
-
- case eIntID_ContextMenuOffsetVertical:
- case eIntID_ContextMenuOffsetHorizontal:
- aResult = 2;
- break;
-
- default:
- aResult = 0;
- rv = NS_ERROR_FAILURE;
- }
-
- return rv;
-}
-
-nsresult
-nsLookAndFeel::GetFloatImpl(FloatID aID, float &aResult)
-{
- nsresult rv = nsXPLookAndFeel::GetFloatImpl(aID, aResult);
- if (NS_SUCCEEDED(rv))
- return rv;
- rv = NS_OK;
-
- switch (aID) {
- case eFloatID_IMEUnderlineRelativeSize:
- aResult = 1.0f;
- break;
-
- case eFloatID_SpellCheckerUnderlineRelativeSize:
- aResult = 1.0f;
- break;
-
- default:
- aResult = -1.0;
- rv = NS_ERROR_FAILURE;
- break;
- }
- return rv;
-}
-
-/*virtual*/
-bool
-nsLookAndFeel::GetFontImpl(FontID aID, nsString& aFontName,
- gfxFontStyle& aFontStyle,
- float aDevPixPerCSSPixel)
-{
- aFontName.AssignLiteral("\"Droid Sans\"");
- aFontStyle.style = NS_FONT_STYLE_NORMAL;
- aFontStyle.weight = NS_FONT_WEIGHT_NORMAL;
- aFontStyle.stretch = NS_FONT_STRETCH_NORMAL;
- aFontStyle.size = 9.0 * 96.0f / 72.0f * aDevPixPerCSSPixel;
- aFontStyle.systemFont = true;
- return true;
-}
-
-/*virtual*/
-bool
-nsLookAndFeel::GetEchoPasswordImpl()
-{
- if (!mInitializedShowPassword) {
- if (XRE_IsParentProcess()) {
- mShowPassword = java::GeckoAppShell::GetShowPasswordSetting();
- } else {
- ContentChild::GetSingleton()->SendGetShowPasswordSetting(&mShowPassword);
- }
- mInitializedShowPassword = true;
- }
- return mShowPassword;
-}
-
-uint32_t
-nsLookAndFeel::GetPasswordMaskDelayImpl()
-{
- // This value is hard-coded in Android OS's PasswordTransformationMethod.java
- return 1500;
-}
-
-/* virtual */
-char16_t
-nsLookAndFeel::GetPasswordCharacterImpl()
-{
- // This value is hard-coded in Android OS's PasswordTransformationMethod.java
- return UNICODE_BULLET;
-}
diff --git a/widget/android/nsLookAndFeel.h b/widget/android/nsLookAndFeel.h
deleted file mode 100644
index 9b33279a8..000000000
--- a/widget/android/nsLookAndFeel.h
+++ /dev/null
@@ -1,36 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifndef __nsLookAndFeel
-#define __nsLookAndFeel
-
-#include "nsXPLookAndFeel.h"
-#include "AndroidBridge.h"
-
-class nsLookAndFeel: public nsXPLookAndFeel
-{
-public:
- nsLookAndFeel();
- virtual ~nsLookAndFeel();
-
- virtual nsresult NativeGetColor(ColorID aID, nscolor &aResult);
- virtual nsresult GetIntImpl(IntID aID, int32_t &aResult);
- virtual nsresult GetFloatImpl(FloatID aID, float &aResult);
- virtual bool GetFontImpl(FontID aID, nsString& aName, gfxFontStyle& aStyle,
- float aDevPixPerCSSPixel);
- virtual bool GetEchoPasswordImpl();
- virtual uint32_t GetPasswordMaskDelayImpl();
- virtual char16_t GetPasswordCharacterImpl();
-
-protected:
- static bool mInitializedSystemColors;
- static mozilla::AndroidSystemColors mSystemColors;
- static bool mInitializedShowPassword;
- static bool mShowPassword;
-
- nsresult GetSystemColors();
- nsresult CallRemoteGetSystemColors();
-};
-
-#endif
diff --git a/widget/android/nsPrintOptionsAndroid.cpp b/widget/android/nsPrintOptionsAndroid.cpp
deleted file mode 100644
index 03afba827..000000000
--- a/widget/android/nsPrintOptionsAndroid.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#include "nsPrintOptionsAndroid.h"
-
-#include "nsPrintSettingsImpl.h"
-
-class nsPrintSettingsAndroid : public nsPrintSettings {
-public:
- nsPrintSettingsAndroid()
- {
- // The aim here is to set up the objects enough that silent printing works
- SetOutputFormat(nsIPrintSettings::kOutputFormatPDF);
- SetPrinterName(u"PDF printer");
-
- }
-};
-
-nsPrintOptionsAndroid::nsPrintOptionsAndroid()
-{
-}
-
-nsPrintOptionsAndroid::~nsPrintOptionsAndroid()
-{
-}
-
-nsresult
-nsPrintOptionsAndroid::_CreatePrintSettings(nsIPrintSettings** _retval)
-{
- nsPrintSettings * printSettings = new nsPrintSettingsAndroid();
- NS_ENSURE_TRUE(printSettings, NS_ERROR_OUT_OF_MEMORY);
- NS_ADDREF(*_retval = printSettings);
- (void)InitPrintSettingsFromPrefs(*_retval, false,
- nsIPrintSettings::kInitSaveAll);
- return NS_OK;
-}
diff --git a/widget/android/nsPrintOptionsAndroid.h b/widget/android/nsPrintOptionsAndroid.h
deleted file mode 100644
index 27c4cce83..000000000
--- a/widget/android/nsPrintOptionsAndroid.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-#ifndef nsPrintOptionsAndroid_h__
-#define nsPrintOptionsAndroid_h__
-
-#include "nsPrintOptionsImpl.h"
-#include "nsIPrintSettings.h"
-
-//*****************************************************************************
-//*** nsPrintOptions
-//*****************************************************************************
-class nsPrintOptionsAndroid : public nsPrintOptions
-{
-public:
- nsPrintOptionsAndroid();
- virtual ~nsPrintOptionsAndroid();
-
- nsresult _CreatePrintSettings(nsIPrintSettings** _retval) override;
-};
-
-#endif /* nsPrintOptionsAndroid_h__ */
diff --git a/widget/android/nsScreenManagerAndroid.cpp b/widget/android/nsScreenManagerAndroid.cpp
deleted file mode 100644
index 4a79b9dab..000000000
--- a/widget/android/nsScreenManagerAndroid.cpp
+++ /dev/null
@@ -1,264 +0,0 @@
-/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: set sw=4 ts=4 expandtab:
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#define MOZ_FATAL_ASSERTIONS_FOR_THREAD_SAFETY
-
-#include "mozilla/SyncRunnable.h"
-#include "nsScreenManagerAndroid.h"
-#include "nsServiceManagerUtils.h"
-#include "AndroidRect.h"
-#include "FennecJNINatives.h"
-#include "nsAppShell.h"
-#include "nsThreadUtils.h"
-
-#include <android/log.h>
-#include <mozilla/jni/Refs.h>
-
-#define ALOG(args...) __android_log_print(ANDROID_LOG_INFO, "nsScreenManagerAndroid", ## args)
-
-using namespace mozilla;
-using namespace mozilla::java;
-
-static uint32_t sScreenId = 0;
-const uint32_t PRIMARY_SCREEN_ID = 0;
-
-nsScreenAndroid::nsScreenAndroid(DisplayType aDisplayType, nsIntRect aRect)
- : mId(sScreenId++)
- , mDisplayType(aDisplayType)
- , mRect(aRect)
- , mDensity(0.0)
-{
- // ensure that the ID of the primary screen would be PRIMARY_SCREEN_ID.
- if (mDisplayType == DisplayType::DISPLAY_PRIMARY) {
- mId = PRIMARY_SCREEN_ID;
- }
-}
-
-nsScreenAndroid::~nsScreenAndroid()
-{
-}
-
-float
-nsScreenAndroid::GetDensity() {
- if (mDensity != 0.0) {
- return mDensity;
- }
- if (mDisplayType == DisplayType::DISPLAY_PRIMARY) {
- mDensity = mozilla::jni::IsAvailable() ? GeckoAppShell::GetDensity()
- : 1.0; // xpcshell most likely
- return mDensity;
- }
- return 1.0;
-}
-
-NS_IMETHODIMP
-nsScreenAndroid::GetId(uint32_t *outId)
-{
- *outId = mId;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsScreenAndroid::GetRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight)
-{
- if (mDisplayType != DisplayType::DISPLAY_PRIMARY) {
- *outLeft = mRect.x;
- *outTop = mRect.y;
- *outWidth = mRect.width;
- *outHeight = mRect.height;
-
- return NS_OK;
- }
-
- if (!mozilla::jni::IsAvailable()) {
- // xpcshell most likely
- *outLeft = *outTop = *outWidth = *outHeight = 0;
- return NS_ERROR_FAILURE;
- }
-
- java::sdk::Rect::LocalRef rect = java::GeckoAppShell::GetScreenSize();
- rect->Left(outLeft);
- rect->Top(outTop);
- rect->Width(outWidth);
- rect->Height(outHeight);
-
- return NS_OK;
-}
-
-
-NS_IMETHODIMP
-nsScreenAndroid::GetAvailRect(int32_t *outLeft, int32_t *outTop, int32_t *outWidth, int32_t *outHeight)
-{
- return GetRect(outLeft, outTop, outWidth, outHeight);
-}
-
-
-
-NS_IMETHODIMP
-nsScreenAndroid::GetPixelDepth(int32_t *aPixelDepth)
-{
- if (!mozilla::jni::IsAvailable()) {
- // xpcshell most likely
- *aPixelDepth = 16;
- return NS_ERROR_FAILURE;
- }
-
- *aPixelDepth = java::GeckoAppShell::GetScreenDepth();
- return NS_OK;
-}
-
-
-NS_IMETHODIMP
-nsScreenAndroid::GetColorDepth(int32_t *aColorDepth)
-{
- return GetPixelDepth(aColorDepth);
-}
-
-
-void
-nsScreenAndroid::ApplyMinimumBrightness(uint32_t aBrightness)
-{
- if (mDisplayType == DisplayType::DISPLAY_PRIMARY &&
- mozilla::jni::IsAvailable()) {
- java::GeckoAppShell::SetKeepScreenOn(aBrightness == BRIGHTNESS_FULL);
- }
-}
-
-class nsScreenManagerAndroid::ScreenManagerHelperSupport final
- : public ScreenManagerHelper::Natives<ScreenManagerHelperSupport>
-{
-public:
- typedef ScreenManagerHelper::Natives<ScreenManagerHelperSupport> Base;
-
- static int32_t AddDisplay(int32_t aDisplayType, int32_t aWidth, int32_t aHeight, float aDensity) {
- int32_t screenId = -1; // return value
- nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
- SyncRunnable::DispatchToThread(mainThread, NS_NewRunnableFunction(
- [&aDisplayType, &aWidth, &aHeight, &aDensity, &screenId] {
- MOZ_ASSERT(NS_IsMainThread());
- nsCOMPtr<nsIScreenManager> screenMgr =
- do_GetService("@mozilla.org/gfx/screenmanager;1");
- MOZ_ASSERT(screenMgr, "Failed to get nsIScreenManager");
-
- RefPtr<nsScreenManagerAndroid> screenMgrAndroid =
- (nsScreenManagerAndroid*) screenMgr.get();
- RefPtr<nsScreenAndroid> screen =
- screenMgrAndroid->AddScreen(static_cast<DisplayType>(aDisplayType),
- nsIntRect(0, 0, aWidth, aHeight));
- MOZ_ASSERT(screen);
- screen->SetDensity(aDensity);
- screenId = static_cast<int32_t>(screen->GetId());
- }).take());
- return screenId;
- }
-
- static void RemoveDisplay(int32_t aScreenId) {
- nsCOMPtr<nsIThread> mainThread = do_GetMainThread();
- SyncRunnable::DispatchToThread(mainThread, NS_NewRunnableFunction(
- [&aScreenId] {
- MOZ_ASSERT(NS_IsMainThread());
- nsCOMPtr<nsIScreenManager> screenMgr =
- do_GetService("@mozilla.org/gfx/screenmanager;1");
- MOZ_ASSERT(screenMgr, "Failed to get nsIScreenManager");
-
- RefPtr<nsScreenManagerAndroid> screenMgrAndroid =
- (nsScreenManagerAndroid*) screenMgr.get();
- screenMgrAndroid->RemoveScreen(aScreenId);
- }).take());
- }
-};
-
-NS_IMPL_ISUPPORTS(nsScreenManagerAndroid, nsIScreenManager)
-
-nsScreenManagerAndroid::nsScreenManagerAndroid()
-{
- if (mozilla::jni::IsAvailable()) {
- ScreenManagerHelperSupport::Base::Init();
- }
- nsCOMPtr<nsIScreen> screen = AddScreen(DisplayType::DISPLAY_PRIMARY);
- MOZ_ASSERT(screen);
-}
-
-nsScreenManagerAndroid::~nsScreenManagerAndroid()
-{
-}
-
-NS_IMETHODIMP
-nsScreenManagerAndroid::GetPrimaryScreen(nsIScreen **outScreen)
-{
- ScreenForId(PRIMARY_SCREEN_ID, outScreen);
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsScreenManagerAndroid::ScreenForId(uint32_t aId,
- nsIScreen **outScreen)
-{
- for (size_t i = 0; i < mScreens.Length(); ++i) {
- if (aId == mScreens[i]->GetId()) {
- nsCOMPtr<nsIScreen> screen = (nsIScreen*) mScreens[i];
- screen.forget(outScreen);
- return NS_OK;
- }
- }
-
- *outScreen = nullptr;
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsScreenManagerAndroid::ScreenForRect(int32_t inLeft,
- int32_t inTop,
- int32_t inWidth,
- int32_t inHeight,
- nsIScreen **outScreen)
-{
- // Not support to query non-primary screen with rect.
- return GetPrimaryScreen(outScreen);
-}
-
-NS_IMETHODIMP
-nsScreenManagerAndroid::ScreenForNativeWidget(void *aWidget, nsIScreen **outScreen)
-{
- // Not support to query non-primary screen with native widget.
- return GetPrimaryScreen(outScreen);
-}
-
-NS_IMETHODIMP
-nsScreenManagerAndroid::GetNumberOfScreens(uint32_t *aNumberOfScreens)
-{
- *aNumberOfScreens = mScreens.Length();
- return NS_OK;
-}
-
-NS_IMETHODIMP
-nsScreenManagerAndroid::GetSystemDefaultScale(float *aDefaultScale)
-{
- *aDefaultScale = 1.0f;
- return NS_OK;
-}
-
-already_AddRefed<nsScreenAndroid>
-nsScreenManagerAndroid::AddScreen(DisplayType aDisplayType, nsIntRect aRect)
-{
- ALOG("nsScreenManagerAndroid: add %s screen",
- (aDisplayType == DisplayType::DISPLAY_PRIMARY ? "PRIMARY" :
- (aDisplayType == DisplayType::DISPLAY_EXTERNAL ? "EXTERNAL" :
- "VIRTUAL")));
- RefPtr<nsScreenAndroid> screen = new nsScreenAndroid(aDisplayType, aRect);
- mScreens.AppendElement(screen);
- return screen.forget();
-}
-
-void
-nsScreenManagerAndroid::RemoveScreen(uint32_t aScreenId)
-{
- for (size_t i = 0; i < mScreens.Length(); i++) {
- if (aScreenId == mScreens[i]->GetId()) {
- mScreens.RemoveElementAt(i);
- }
- }
-}
diff --git a/widget/android/nsScreenManagerAndroid.h b/widget/android/nsScreenManagerAndroid.h
deleted file mode 100644
index cf8bfb245..000000000
--- a/widget/android/nsScreenManagerAndroid.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 40; indent-tabs-mode: nil; c-basic-offset: 4 -*-
- * vim: ts=4 sw=4 expandtab:
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef nsScreenManagerAndroid_h___
-#define nsScreenManagerAndroid_h___
-
-#include "nsCOMPtr.h"
-
-#include "nsBaseScreen.h"
-#include "nsIScreenManager.h"
-#include "nsRect.h"
-#include "mozilla/WidgetUtils.h"
-
-class nsScreenAndroid final : public nsBaseScreen
-{
-public:
- nsScreenAndroid(DisplayType aDisplayType, nsIntRect aRect);
- ~nsScreenAndroid();
-
- NS_IMETHOD GetId(uint32_t* aId) override;
- NS_IMETHOD GetRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight) override;
- NS_IMETHOD GetAvailRect(int32_t* aLeft, int32_t* aTop, int32_t* aWidth, int32_t* aHeight) override;
- NS_IMETHOD GetPixelDepth(int32_t* aPixelDepth) override;
- NS_IMETHOD GetColorDepth(int32_t* aColorDepth) override;
-
- uint32_t GetId() const { return mId; };
- DisplayType GetDisplayType() const { return mDisplayType; }
-
- void SetDensity(double aDensity) { mDensity = aDensity; }
- float GetDensity();
-
-protected:
- virtual void ApplyMinimumBrightness(uint32_t aBrightness) override;
-
-private:
- uint32_t mId;
- DisplayType mDisplayType;
- nsIntRect mRect;
- float mDensity;
-};
-
-class nsScreenManagerAndroid final : public nsIScreenManager
-{
-private:
- ~nsScreenManagerAndroid();
-
-public:
- class ScreenManagerHelperSupport;
-
- nsScreenManagerAndroid();
-
- NS_DECL_ISUPPORTS
- NS_DECL_NSISCREENMANAGER
-
- already_AddRefed<nsScreenAndroid> AddScreen(DisplayType aDisplayType,
- nsIntRect aRect = nsIntRect());
- void RemoveScreen(uint32_t aScreenId);
-
-protected:
- nsTArray<RefPtr<nsScreenAndroid>> mScreens;
-};
-
-#endif /* nsScreenManagerAndroid_h___ */
diff --git a/widget/android/nsWidgetFactory.cpp b/widget/android/nsWidgetFactory.cpp
deleted file mode 100644
index bd930e4a4..000000000
--- a/widget/android/nsWidgetFactory.cpp
+++ /dev/null
@@ -1,132 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "mozilla/ModuleUtils.h"
-#include "mozilla/WidgetUtils.h"
-
-#include "nsCOMPtr.h"
-#include "nsWidgetsCID.h"
-#include "nsAppShell.h"
-#include "AndroidBridge.h"
-
-#include "nsWindow.h"
-#include "nsLookAndFeel.h"
-#include "nsAppShellSingleton.h"
-#include "nsScreenManagerAndroid.h"
-
-#include "nsIdleServiceAndroid.h"
-#include "nsClipboard.h"
-#include "nsClipboardHelper.h"
-#include "nsTransferable.h"
-#include "nsPrintOptionsAndroid.h"
-#include "nsPrintSession.h"
-#include "nsDeviceContextAndroid.h"
-#include "nsHTMLFormatConverter.h"
-#include "nsXULAppAPI.h"
-#include "nsAndroidProtocolHandler.h"
-
-#include "nsToolkitCompsCID.h"
-#include "AndroidAlerts.h"
-
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindow)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsScreenManagerAndroid)
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIdleServiceAndroid, nsIdleServiceAndroid::GetInstance)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsTransferable)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboard)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsClipboardHelper)
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintOptionsAndroid, Init)
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintSession, Init)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsDeviceContextSpecAndroid)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsHTMLFormatConverter)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsAndroidBridge)
-NS_GENERIC_FACTORY_CONSTRUCTOR(nsAndroidProtocolHandler)
-
-#include "GfxInfo.h"
-namespace mozilla {
-namespace widget {
-// This constructor should really be shared with all platforms.
-NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(GfxInfo, Init)
-NS_GENERIC_FACTORY_CONSTRUCTOR(AndroidAlerts)
-}
-}
-
-NS_DEFINE_NAMED_CID(NS_APPSHELL_CID);
-NS_DEFINE_NAMED_CID(NS_WINDOW_CID);
-NS_DEFINE_NAMED_CID(NS_CHILD_CID);
-NS_DEFINE_NAMED_CID(NS_SCREENMANAGER_CID);
-NS_DEFINE_NAMED_CID(NS_IDLE_SERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_TRANSFERABLE_CID);
-NS_DEFINE_NAMED_CID(NS_CLIPBOARD_CID);
-NS_DEFINE_NAMED_CID(NS_CLIPBOARDHELPER_CID);
-NS_DEFINE_NAMED_CID(NS_PRINTSETTINGSSERVICE_CID);
-NS_DEFINE_NAMED_CID(NS_PRINTSESSION_CID);
-NS_DEFINE_NAMED_CID(NS_DEVICE_CONTEXT_SPEC_CID);
-NS_DEFINE_NAMED_CID(NS_HTMLFORMATCONVERTER_CID);
-NS_DEFINE_NAMED_CID(NS_GFXINFO_CID);
-NS_DEFINE_NAMED_CID(NS_ANDROIDBRIDGE_CID);
-NS_DEFINE_NAMED_CID(NS_ANDROIDPROTOCOLHANDLER_CID);
-NS_DEFINE_NAMED_CID(NS_SYSTEMALERTSSERVICE_CID);
-
-static const mozilla::Module::CIDEntry kWidgetCIDs[] = {
- { &kNS_WINDOW_CID, false, nullptr, nsWindowConstructor },
- { &kNS_CHILD_CID, false, nullptr, nsWindowConstructor },
- { &kNS_APPSHELL_CID, false, nullptr, nsAppShellConstructor },
- { &kNS_SCREENMANAGER_CID, false, nullptr, nsScreenManagerAndroidConstructor },
- { &kNS_IDLE_SERVICE_CID, false, nullptr, nsIdleServiceAndroidConstructor },
- { &kNS_TRANSFERABLE_CID, false, nullptr, nsTransferableConstructor },
- { &kNS_CLIPBOARD_CID, false, nullptr, nsClipboardConstructor },
- { &kNS_CLIPBOARDHELPER_CID, false, nullptr, nsClipboardHelperConstructor },
- { &kNS_PRINTSETTINGSSERVICE_CID, false, nullptr, nsPrintOptionsAndroidConstructor },
- { &kNS_PRINTSESSION_CID, false, nullptr, nsPrintSessionConstructor },
- { &kNS_DEVICE_CONTEXT_SPEC_CID, false, nullptr, nsDeviceContextSpecAndroidConstructor },
- { &kNS_HTMLFORMATCONVERTER_CID, false, nullptr, nsHTMLFormatConverterConstructor },
- { &kNS_GFXINFO_CID, false, nullptr, mozilla::widget::GfxInfoConstructor },
- { &kNS_ANDROIDBRIDGE_CID, false, nullptr, nsAndroidBridgeConstructor },
- { &kNS_ANDROIDPROTOCOLHANDLER_CID, false, nullptr, nsAndroidProtocolHandlerConstructor },
- { &kNS_SYSTEMALERTSSERVICE_CID, false, nullptr, mozilla::widget::AndroidAlertsConstructor },
- { nullptr }
-};
-
-static const mozilla::Module::ContractIDEntry kWidgetContracts[] = {
- { "@mozilla.org/widgets/window/android;1", &kNS_WINDOW_CID },
- { "@mozilla.org/widgets/child_window/android;1", &kNS_CHILD_CID },
- { "@mozilla.org/widget/appshell/android;1", &kNS_APPSHELL_CID },
- { "@mozilla.org/gfx/screenmanager;1", &kNS_SCREENMANAGER_CID },
- { "@mozilla.org/widget/idleservice;1", &kNS_IDLE_SERVICE_CID },
- { "@mozilla.org/widget/transferable;1", &kNS_TRANSFERABLE_CID },
- { "@mozilla.org/widget/clipboard;1", &kNS_CLIPBOARD_CID },
- { "@mozilla.org/widget/clipboardhelper;1", &kNS_CLIPBOARDHELPER_CID },
- { "@mozilla.org/gfx/printsettings-service;1", &kNS_PRINTSETTINGSSERVICE_CID },
- { "@mozilla.org/gfx/printsession;1", &kNS_PRINTSESSION_CID },
- { "@mozilla.org/gfx/devicecontextspec;1", &kNS_DEVICE_CONTEXT_SPEC_CID },
- { "@mozilla.org/widget/htmlformatconverter;1", &kNS_HTMLFORMATCONVERTER_CID },
- { "@mozilla.org/gfx/info;1", &kNS_GFXINFO_CID },
- { "@mozilla.org/android/bridge;1", &kNS_ANDROIDBRIDGE_CID },
- { NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX "android", &kNS_ANDROIDPROTOCOLHANDLER_CID },
- { NS_SYSTEMALERTSERVICE_CONTRACTID, &kNS_SYSTEMALERTSSERVICE_CID },
- { nullptr }
-};
-
-static void
-nsWidgetAndroidModuleDtor()
-{
- // Shutdown all XP level widget classes.
- mozilla::widget::WidgetUtils::Shutdown();
-
- nsLookAndFeel::Shutdown();
- nsAppShellShutdown();
-}
-
-static const mozilla::Module kWidgetModule = {
- mozilla::Module::kVersion,
- kWidgetCIDs,
- kWidgetContracts,
- nullptr,
- nullptr,
- nsAppShellInit,
- nsWidgetAndroidModuleDtor
-};
-
-NSMODULE_DEFN(nsWidgetAndroidModule) = &kWidgetModule;
diff --git a/widget/android/nsWindow.cpp b/widget/android/nsWindow.cpp
deleted file mode 100644
index 9423a4a26..000000000
--- a/widget/android/nsWindow.cpp
+++ /dev/null
@@ -1,3638 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 4; indent-tabs-mode: nil; -*-
- * vim: set sw=4 ts=4 expandtab:
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include <android/log.h>
-#include <android/native_window.h>
-#include <android/native_window_jni.h>
-#include <math.h>
-#include <unistd.h>
-
-#include "mozilla/IMEStateManager.h"
-#include "mozilla/MiscEvents.h"
-#include "mozilla/MouseEvents.h"
-#include "mozilla/TextComposition.h"
-#include "mozilla/TextEvents.h"
-#include "mozilla/TouchEvents.h"
-#include "mozilla/TypeTraits.h"
-#include "mozilla/WeakPtr.h"
-
-#include "mozilla/dom/ContentParent.h"
-#include "mozilla/dom/ContentChild.h"
-#include "mozilla/Unused.h"
-#include "mozilla/Preferences.h"
-#include "mozilla/layers/RenderTrace.h"
-#include <algorithm>
-
-using mozilla::dom::ContentParent;
-using mozilla::dom::ContentChild;
-using mozilla::Unused;
-
-#include "nsWindow.h"
-
-#include "nsIBaseWindow.h"
-#include "nsIDOMChromeWindow.h"
-#include "nsIObserverService.h"
-#include "nsISelection.h"
-#include "nsISupportsPrimitives.h"
-#include "nsIWidgetListener.h"
-#include "nsIWindowWatcher.h"
-#include "nsIXULWindow.h"
-
-#include "nsAppShell.h"
-#include "nsFocusManager.h"
-#include "nsIdleService.h"
-#include "nsLayoutUtils.h"
-#include "nsViewManager.h"
-
-#include "WidgetUtils.h"
-
-#include "nsIDOMSimpleGestureEvent.h"
-
-#include "nsGkAtoms.h"
-#include "nsWidgetsCID.h"
-#include "nsGfxCIID.h"
-
-#include "gfxContext.h"
-
-#include "Layers.h"
-#include "mozilla/layers/LayerManagerComposite.h"
-#include "mozilla/layers/AsyncCompositionManager.h"
-#include "mozilla/layers/APZEventState.h"
-#include "mozilla/layers/APZThreadUtils.h"
-#include "mozilla/layers/IAPZCTreeManager.h"
-#include "GLContext.h"
-#include "GLContextProvider.h"
-#include "ScopedGLHelpers.h"
-#include "mozilla/layers/CompositorOGL.h"
-#include "AndroidContentController.h"
-
-#include "nsTArray.h"
-
-#include "AndroidBridge.h"
-#include "AndroidBridgeUtilities.h"
-#include "android_npapi.h"
-#include "FennecJNINatives.h"
-#include "GeneratedJNINatives.h"
-#include "KeyEvent.h"
-#include "MotionEvent.h"
-
-#include "imgIEncoder.h"
-
-#include "nsString.h"
-#include "GeckoProfiler.h" // For PROFILER_LABEL
-#include "nsIXULRuntime.h"
-#include "nsPrintfCString.h"
-
-using namespace mozilla;
-using namespace mozilla::dom;
-using namespace mozilla::layers;
-using namespace mozilla::java;
-using namespace mozilla::widget;
-
-NS_IMPL_ISUPPORTS_INHERITED0(nsWindow, nsBaseWidget)
-
-#include "mozilla/layers/CompositorBridgeChild.h"
-#include "mozilla/layers/CompositorBridgeParent.h"
-#include "mozilla/layers/CompositorSession.h"
-#include "mozilla/layers/LayerTransactionParent.h"
-#include "mozilla/Services.h"
-#include "nsThreadUtils.h"
-
-// All the toplevel windows that have been created; these are in
-// stacking order, so the window at gTopLevelWindows[0] is the topmost
-// one.
-static nsTArray<nsWindow*> gTopLevelWindows;
-
-static bool sFailedToCreateGLContext = false;
-
-// Multitouch swipe thresholds in inches
-static const double SWIPE_MAX_PINCH_DELTA_INCHES = 0.4;
-static const double SWIPE_MIN_DISTANCE_INCHES = 0.6;
-
-// Sync with GeckoEditableView class
-static const int IME_MONITOR_CURSOR_ONE_SHOT = 1;
-static const int IME_MONITOR_CURSOR_START_MONITOR = 2;
-static const int IME_MONITOR_CURSOR_END_MONITOR = 3;
-
-static Modifiers GetModifiers(int32_t metaState);
-
-template<typename Lambda, bool IsStatic, typename InstanceType, class Impl>
-class nsWindow::WindowEvent : public nsAppShell::LambdaEvent<Lambda>
-{
- typedef nsAppShell::Event Event;
- typedef nsAppShell::LambdaEvent<Lambda> Base;
-
- bool IsStaleCall()
- {
- if (IsStatic) {
- // Static calls are never stale.
- return false;
- }
-
- JNIEnv* const env = mozilla::jni::GetEnvForThread();
-
- const auto natives = reinterpret_cast<mozilla::WeakPtr<Impl>*>(
- jni::GetNativeHandle(env, mInstance.Get()));
- MOZ_CATCH_JNI_EXCEPTION(env);
-
- // The call is stale if the nsWindow has been destroyed on the
- // Gecko side, but the Java object is still attached to it through
- // a weak pointer. Stale calls should be discarded. Note that it's
- // an error if natives is nullptr here; we return false but the
- // native call will throw an error.
- return natives && !natives->get();
- }
-
- const InstanceType mInstance;
- const Event::Type mEventType;
-
-public:
- WindowEvent(Lambda&& aLambda,
- InstanceType&& aInstance,
- Event::Type aEventType = Event::Type::kGeneralActivity)
- : Base(mozilla::Move(aLambda))
- , mInstance(mozilla::Move(aInstance))
- , mEventType(aEventType)
- {}
-
- WindowEvent(Lambda&& aLambda,
- Event::Type aEventType = Event::Type::kGeneralActivity)
- : Base(mozilla::Move(aLambda))
- , mInstance(Base::lambda.GetThisArg())
- , mEventType(aEventType)
- {}
-
- void Run() override
- {
- if (!IsStaleCall()) {
- return Base::Run();
- }
- }
-
- Event::Type ActivityType() const override
- {
- return mEventType;
- }
-};
-
-template<class Impl>
-template<class Instance, typename... Args> void
-nsWindow::NativePtr<Impl>::Attach(Instance aInstance, nsWindow* aWindow,
- Args&&... aArgs)
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(!mPtr && !mImpl);
-
- auto impl = mozilla::MakeUnique<Impl>(
- this, aWindow, mozilla::Forward<Args>(aArgs)...);
- mImpl = impl.get();
-
- Impl::AttachNative(aInstance, mozilla::Move(impl));
-}
-
-template<class Impl> void
-nsWindow::NativePtr<Impl>::Detach()
-{
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mPtr && mImpl);
-
- mImpl->OnDetach();
- {
- Locked implLock(*this);
- mImpl = nullptr;
- }
-
- typename WindowPtr<Impl>::Locked lock(*mPtr);
- mPtr->mWindow = nullptr;
- mPtr->mPtr = nullptr;
- mPtr = nullptr;
-}
-
-template<class Impl>
-class nsWindow::NativePtr<Impl>::Locked final : private MutexAutoLock
-{
- Impl* const mImpl;
-
-public:
- Locked(NativePtr<Impl>& aPtr)
- : MutexAutoLock(aPtr.mImplLock)
- , mImpl(aPtr.mImpl)
- {}
-
- operator Impl*() const { return mImpl; }
- Impl* operator->() const { return mImpl; }
-};
-
-template<class Impl>
-class nsWindow::WindowPtr final
-{
- friend NativePtr<Impl>;
-
- NativePtr<Impl>* mPtr;
- nsWindow* mWindow;
- Mutex mWindowLock;
-
-public:
- class Locked final : private MutexAutoLock
- {
- nsWindow* const mWindow;
-
- public:
- Locked(WindowPtr<Impl>& aPtr)
- : MutexAutoLock(aPtr.mWindowLock)
- , mWindow(aPtr.mWindow)
- {}
-
- operator nsWindow*() const { return mWindow; }
- nsWindow* operator->() const { return mWindow; }
- };
-
- WindowPtr(NativePtr<Impl>* aPtr, nsWindow* aWindow)
- : mPtr(aPtr)
- , mWindow(aWindow)
- , mWindowLock(NativePtr<Impl>::sName)
- {
- MOZ_ASSERT(NS_IsMainThread());
- mPtr->mPtr = this;
- }
-
- ~WindowPtr()
- {
- MOZ_ASSERT(NS_IsMainThread());
- if (!mPtr) {
- return;
- }
- mPtr->mPtr = nullptr;
- mPtr->mImpl = nullptr;
- }
-
- operator nsWindow*() const
- {
- MOZ_ASSERT(NS_IsMainThread());
- return mWindow;
- }
-
- nsWindow* operator->() const { return operator nsWindow*(); }
-};
-
-
-class nsWindow::GeckoViewSupport final
- : public GeckoView::Window::Natives<GeckoViewSupport>
- , public GeckoEditable::Natives<GeckoViewSupport>
- , public SupportsWeakPtr<GeckoViewSupport>
-{
- nsWindow& window;
-
-public:
- typedef GeckoView::Window::Natives<GeckoViewSupport> Base;
- typedef GeckoEditable::Natives<GeckoViewSupport> EditableBase;
-
- MOZ_DECLARE_WEAKREFERENCE_TYPENAME(GeckoViewSupport);
-
- template<typename Functor>
- static void OnNativeCall(Functor&& aCall)
- {
- if (aCall.IsTarget(&Open) && NS_IsMainThread()) {
- // Gecko state probably just switched to PROFILE_READY, and the
- // event loop is not running yet. Skip the event loop here so we
- // can get a head start on opening our window.
- return aCall();
- }
-
- const nsAppShell::Event::Type eventType =
- aCall.IsTarget(&GeckoViewSupport::OnKeyEvent) ||
- aCall.IsTarget(&GeckoViewSupport::OnImeReplaceText) ||
- aCall.IsTarget(&GeckoViewSupport::OnImeUpdateComposition) ?
- nsAppShell::Event::Type::kUIActivity :
- nsAppShell::Event::Type::kGeneralActivity;
-
- nsAppShell::PostEvent(mozilla::MakeUnique<WindowEvent<Functor>>(
- mozilla::Move(aCall), eventType));
- }
-
- GeckoViewSupport(nsWindow* aWindow,
- const GeckoView::Window::LocalRef& aInstance,
- GeckoView::Param aView)
- : window(*aWindow)
- , mEditable(GeckoEditable::New(aView))
- , mIMERanges(new TextRangeArray())
- , mIMEMaskEventsCount(1) // Mask IME events since there's no focus yet
- , mIMEUpdatingContext(false)
- , mIMESelectionChanged(false)
- , mIMETextChangedDuringFlush(false)
- , mIMEMonitorCursor(false)
- {
- Base::AttachNative(aInstance, this);
- EditableBase::AttachNative(mEditable, this);
- }
-
- ~GeckoViewSupport();
-
- using Base::DisposeNative;
- using EditableBase::DisposeNative;
-
- /**
- * GeckoView methods
- */
-private:
- nsCOMPtr<nsPIDOMWindowOuter> mDOMWindow;
-
-public:
- // Create and attach a window.
- static void Open(const jni::Class::LocalRef& aCls,
- GeckoView::Window::Param aWindow,
- GeckoView::Param aView, jni::Object::Param aCompositor,
- jni::String::Param aChromeURI,
- int32_t screenId);
-
- // Close and destroy the nsWindow.
- void Close();
-
- // Reattach this nsWindow to a new GeckoView.
- void Reattach(const GeckoView::Window::LocalRef& inst,
- GeckoView::Param aView, jni::Object::Param aCompositor);
-
- void LoadUri(jni::String::Param aUri, int32_t aFlags);
-
- /**
- * GeckoEditable methods
- */
-private:
- /*
- Rules for managing IME between Gecko and Java:
-
- * Gecko controls the text content, and Java shadows the Gecko text
- through text updates
- * Gecko and Java maintain separate selections, and synchronize when
- needed through selection updates and set-selection events
- * Java controls the composition, and Gecko shadows the Java
- composition through update composition events
- */
-
- struct IMETextChange final {
- int32_t mStart, mOldEnd, mNewEnd;
-
- IMETextChange() :
- mStart(-1), mOldEnd(-1), mNewEnd(-1) {}
-
- IMETextChange(const IMENotification& aIMENotification)
- : mStart(aIMENotification.mTextChangeData.mStartOffset)
- , mOldEnd(aIMENotification.mTextChangeData.mRemovedEndOffset)
- , mNewEnd(aIMENotification.mTextChangeData.mAddedEndOffset)
- {
- MOZ_ASSERT(aIMENotification.mMessage == NOTIFY_IME_OF_TEXT_CHANGE,
- "IMETextChange initialized with wrong notification");
- MOZ_ASSERT(aIMENotification.mTextChangeData.IsValid(),
- "The text change notification isn't initialized");
- MOZ_ASSERT(aIMENotification.mTextChangeData.IsInInt32Range(),
- "The text change notification is out of range");
- }
-
- bool IsEmpty() const { return mStart < 0; }
- };
-
- // GeckoEditable instance used by this nsWindow;
- java::GeckoEditable::GlobalRef mEditable;
- AutoTArray<mozilla::UniquePtr<mozilla::WidgetEvent>, 8> mIMEKeyEvents;
- AutoTArray<IMETextChange, 4> mIMETextChanges;
- InputContext mInputContext;
- RefPtr<mozilla::TextRangeArray> mIMERanges;
- int32_t mIMEMaskEventsCount; // Mask events when > 0.
- bool mIMEUpdatingContext;
- bool mIMESelectionChanged;
- bool mIMETextChangedDuringFlush;
- bool mIMEMonitorCursor;
-
- void SendIMEDummyKeyEvents();
- void AddIMETextChange(const IMETextChange& aChange);
-
- enum FlushChangesFlag {
- // Not retrying.
- FLUSH_FLAG_NONE,
- // Retrying due to IME text changes during flush.
- FLUSH_FLAG_RETRY,
- // Retrying due to IME sync exceptions during flush.
- FLUSH_FLAG_RECOVER
- };
- void PostFlushIMEChanges();
- void FlushIMEChanges(FlushChangesFlag aFlags = FLUSH_FLAG_NONE);
- void FlushIMEText(FlushChangesFlag aFlags = FLUSH_FLAG_NONE);
- void AsyncNotifyIME(int32_t aNotification);
- void UpdateCompositionRects();
-
-public:
- bool NotifyIME(const IMENotification& aIMENotification);
- void SetInputContext(const InputContext& aContext,
- const InputContextAction& aAction);
- InputContext GetInputContext();
-
- // RAII helper class that automatically sends an event reply through
- // OnImeSynchronize, as required by events like OnImeReplaceText.
- class AutoIMESynchronize {
- GeckoViewSupport* const mGVS;
- public:
- AutoIMESynchronize(GeckoViewSupport* gvs) : mGVS(gvs) {}
- ~AutoIMESynchronize() { mGVS->OnImeSynchronize(); }
- };
-
- // Handle an Android KeyEvent.
- void OnKeyEvent(int32_t aAction, int32_t aKeyCode, int32_t aScanCode,
- int32_t aMetaState, int64_t aTime, int32_t aUnicodeChar,
- int32_t aBaseUnicodeChar, int32_t aDomPrintableKeyValue,
- int32_t aRepeatCount, int32_t aFlags,
- bool aIsSynthesizedImeKey, jni::Object::Param originalEvent);
-
- // Synchronize Gecko thread with the InputConnection thread.
- void OnImeSynchronize();
-
- // Replace a range of text with new text.
- void OnImeReplaceText(int32_t aStart, int32_t aEnd,
- jni::String::Param aText);
-
- // Add styling for a range within the active composition.
- void OnImeAddCompositionRange(int32_t aStart, int32_t aEnd,
- int32_t aRangeType, int32_t aRangeStyle, int32_t aRangeLineStyle,
- bool aRangeBoldLine, int32_t aRangeForeColor,
- int32_t aRangeBackColor, int32_t aRangeLineColor);
-
- // Update styling for the active composition using previous-added ranges.
- void OnImeUpdateComposition(int32_t aStart, int32_t aEnd);
-
- // Set cursor mode whether IME requests
- void OnImeRequestCursorUpdates(int aRequestMode);
-};
-
-/**
- * NativePanZoomController handles its native calls on the UI thread, so make
- * it separate from GeckoViewSupport.
- */
-class nsWindow::NPZCSupport final
- : public NativePanZoomController::Natives<NPZCSupport>
-{
- using LockedWindowPtr = WindowPtr<NPZCSupport>::Locked;
-
- WindowPtr<NPZCSupport> mWindow;
- NativePanZoomController::GlobalRef mNPZC;
- int mPreviousButtons;
-
-public:
- typedef NativePanZoomController::Natives<NPZCSupport> Base;
-
- NPZCSupport(NativePtr<NPZCSupport>* aPtr, nsWindow* aWindow,
- const NativePanZoomController::LocalRef& aNPZC)
- : mWindow(aPtr, aWindow)
- , mNPZC(aNPZC)
- , mPreviousButtons(0)
- {}
-
- ~NPZCSupport()
- {}
-
- using Base::AttachNative;
- using Base::DisposeNative;
-
- void OnDetach()
- {
- // There are several considerations when shutting down NPZC. 1) The
- // Gecko thread may destroy NPZC at any time when nsWindow closes. 2)
- // There may be pending events on the Gecko thread when NPZC is
- // destroyed. 3) mWindow may not be available when the pending event
- // runs. 4) The UI thread may destroy NPZC at any time when GeckoView
- // is destroyed. 5) The UI thread may destroy NPZC at the same time as
- // Gecko thread trying to destroy NPZC. 6) There may be pending calls
- // on the UI thread when NPZC is destroyed. 7) mWindow may have been
- // cleared on the Gecko thread when the pending call happens on the UI
- // thread.
- //
- // 1) happens through OnDetach, which first notifies the UI
- // thread through Destroy; Destroy then calls DisposeNative, which
- // finally disposes the native instance back on the Gecko thread. Using
- // Destroy to indirectly call DisposeNative here also solves 5), by
- // making everything go through the UI thread, avoiding contention.
- //
- // 2) and 3) are solved by clearing mWindow, which signals to the
- // pending event that we had shut down. In that case the event bails
- // and does not touch mWindow.
- //
- // 4) happens through DisposeNative directly. OnDetach is not
- // called.
- //
- // 6) is solved by keeping a destroyed flag in the Java NPZC instance,
- // and only make a pending call if the destroyed flag is not set.
- //
- // 7) is solved by taking a lock whenever mWindow is modified on the
- // Gecko thread or accessed on the UI thread. That way, we don't
- // release mWindow until the UI thread is done using it, thus avoiding
- // the race condition.
-
- typedef NativePanZoomController::GlobalRef NPZCRef;
- auto callDestroy = [] (const NPZCRef& npzc) {
- npzc->Destroy();
- };
-
- NativePanZoomController::GlobalRef npzc = mNPZC;
- AndroidBridge::Bridge()->PostTaskToUiThread(NewRunnableFunction(
- static_cast<void(*)(const NPZCRef&)>(callDestroy),
- mozilla::Move(npzc)), 0);
- }
-
-public:
- void AdjustScrollForSurfaceShift(float aX, float aY)
- {
- MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
-
- RefPtr<IAPZCTreeManager> controller;
-
- if (LockedWindowPtr window{mWindow}) {
- controller = window->mAPZC;
- }
-
- if (controller) {
- controller->AdjustScrollForSurfaceShift(
- ScreenPoint(aX, aY));
- }
- }
-
- void SetIsLongpressEnabled(bool aIsLongpressEnabled)
- {
- MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
-
- RefPtr<IAPZCTreeManager> controller;
-
- if (LockedWindowPtr window{mWindow}) {
- controller = window->mAPZC;
- }
-
- if (controller) {
- controller->SetLongTapEnabled(aIsLongpressEnabled);
- }
- }
-
- bool HandleScrollEvent(int64_t aTime, int32_t aMetaState,
- float aX, float aY,
- float aHScroll, float aVScroll)
- {
- MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
-
- RefPtr<IAPZCTreeManager> controller;
-
- if (LockedWindowPtr window{mWindow}) {
- controller = window->mAPZC;
- }
-
- if (!controller) {
- return false;
- }
-
- ScreenPoint origin = ScreenPoint(aX, aY);
-
- ScrollWheelInput input(aTime, TimeStamp::Now(), GetModifiers(aMetaState),
- ScrollWheelInput::SCROLLMODE_SMOOTH,
- ScrollWheelInput::SCROLLDELTA_PIXEL,
- origin,
- aHScroll, aVScroll,
- false);
-
- ScrollableLayerGuid guid;
- uint64_t blockId;
- nsEventStatus status = controller->ReceiveInputEvent(input, &guid, &blockId);
-
- if (status == nsEventStatus_eConsumeNoDefault) {
- return true;
- }
-
- NativePanZoomController::GlobalRef npzc = mNPZC;
- nsAppShell::PostEvent([npzc, input, guid, blockId, status] {
- MOZ_ASSERT(NS_IsMainThread());
-
- JNIEnv* const env = jni::GetGeckoThreadEnv();
- NPZCSupport* npzcSupport = GetNative(
- NativePanZoomController::LocalRef(env, npzc));
-
- if (!npzcSupport || !npzcSupport->mWindow) {
- // We already shut down.
- env->ExceptionClear();
- return;
- }
-
- nsWindow* const window = npzcSupport->mWindow;
- window->UserActivity();
- WidgetWheelEvent wheelEvent = input.ToWidgetWheelEvent(window);
- window->ProcessUntransformedAPZEvent(&wheelEvent, guid,
- blockId, status);
- });
-
- return true;
- }
-
-private:
- static MouseInput::ButtonType GetButtonType(int button)
- {
- MouseInput::ButtonType result = MouseInput::NONE;
-
- switch (button) {
- case java::sdk::MotionEvent::BUTTON_PRIMARY:
- result = MouseInput::LEFT_BUTTON;
- break;
- case java::sdk::MotionEvent::BUTTON_SECONDARY:
- result = MouseInput::RIGHT_BUTTON;
- break;
- case java::sdk::MotionEvent::BUTTON_TERTIARY:
- result = MouseInput::MIDDLE_BUTTON;
- break;
- default:
- break;
- }
-
- return result;
- }
-
- static int16_t ConvertButtons(int buttons) {
- int16_t result = 0;
-
- if (buttons & java::sdk::MotionEvent::BUTTON_PRIMARY) {
- result |= WidgetMouseEventBase::eLeftButtonFlag;
- }
- if (buttons & java::sdk::MotionEvent::BUTTON_SECONDARY) {
- result |= WidgetMouseEventBase::eRightButtonFlag;
- }
- if (buttons & java::sdk::MotionEvent::BUTTON_TERTIARY) {
- result |= WidgetMouseEventBase::eMiddleButtonFlag;
- }
- if (buttons & java::sdk::MotionEvent::BUTTON_BACK) {
- result |= WidgetMouseEventBase::e4thButtonFlag;
- }
- if (buttons & java::sdk::MotionEvent::BUTTON_FORWARD) {
- result |= WidgetMouseEventBase::e5thButtonFlag;
- }
-
- return result;
- }
-
-public:
- bool HandleMouseEvent(int32_t aAction, int64_t aTime, int32_t aMetaState,
- float aX, float aY, int buttons)
- {
- MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
-
- RefPtr<IAPZCTreeManager> controller;
-
- if (LockedWindowPtr window{mWindow}) {
- controller = window->mAPZC;
- }
-
- if (!controller) {
- return false;
- }
-
- MouseInput::MouseType mouseType = MouseInput::MOUSE_NONE;
- MouseInput::ButtonType buttonType = MouseInput::NONE;
- switch (aAction) {
- case AndroidMotionEvent::ACTION_DOWN:
- mouseType = MouseInput::MOUSE_DOWN;
- buttonType = GetButtonType(buttons ^ mPreviousButtons);
- mPreviousButtons = buttons;
- break;
- case AndroidMotionEvent::ACTION_UP:
- mouseType = MouseInput::MOUSE_UP;
- buttonType = GetButtonType(buttons ^ mPreviousButtons);
- mPreviousButtons = buttons;
- break;
- case AndroidMotionEvent::ACTION_MOVE:
- mouseType = MouseInput::MOUSE_MOVE;
- break;
- case AndroidMotionEvent::ACTION_HOVER_MOVE:
- mouseType = MouseInput::MOUSE_MOVE;
- break;
- case AndroidMotionEvent::ACTION_HOVER_ENTER:
- mouseType = MouseInput::MOUSE_WIDGET_ENTER;
- break;
- case AndroidMotionEvent::ACTION_HOVER_EXIT:
- mouseType = MouseInput::MOUSE_WIDGET_EXIT;
- break;
- default:
- break;
- }
-
- if (mouseType == MouseInput::MOUSE_NONE) {
- return false;
- }
-
- ScreenPoint origin = ScreenPoint(aX, aY);
-
- MouseInput input(mouseType, buttonType, nsIDOMMouseEvent::MOZ_SOURCE_MOUSE, ConvertButtons(buttons), origin, aTime, TimeStamp(), GetModifiers(aMetaState));
-
- ScrollableLayerGuid guid;
- uint64_t blockId;
- nsEventStatus status = controller->ReceiveInputEvent(input, &guid, &blockId);
-
- if (status == nsEventStatus_eConsumeNoDefault) {
- return true;
- }
-
- NativePanZoomController::GlobalRef npzc = mNPZC;
- nsAppShell::PostEvent([npzc, input, guid, blockId, status] {
- MOZ_ASSERT(NS_IsMainThread());
-
- JNIEnv* const env = jni::GetGeckoThreadEnv();
- NPZCSupport* npzcSupport = GetNative(
- NativePanZoomController::LocalRef(env, npzc));
-
- if (!npzcSupport || !npzcSupport->mWindow) {
- // We already shut down.
- env->ExceptionClear();
- return;
- }
-
- nsWindow* const window = npzcSupport->mWindow;
- window->UserActivity();
- WidgetMouseEvent mouseEvent = input.ToWidgetMouseEvent(window);
- window->ProcessUntransformedAPZEvent(&mouseEvent, guid,
- blockId, status);
- });
-
- return true;
- }
-
- bool HandleMotionEvent(const NativePanZoomController::LocalRef& aInstance,
- int32_t aAction, int32_t aActionIndex,
- int64_t aTime, int32_t aMetaState,
- jni::IntArray::Param aPointerId,
- jni::FloatArray::Param aX,
- jni::FloatArray::Param aY,
- jni::FloatArray::Param aOrientation,
- jni::FloatArray::Param aPressure,
- jni::FloatArray::Param aToolMajor,
- jni::FloatArray::Param aToolMinor)
- {
- MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
-
- RefPtr<IAPZCTreeManager> controller;
-
- if (LockedWindowPtr window{mWindow}) {
- controller = window->mAPZC;
- }
-
- if (!controller) {
- return false;
- }
-
- nsTArray<int32_t> pointerId(aPointerId->GetElements());
- MultiTouchInput::MultiTouchType type;
- size_t startIndex = 0;
- size_t endIndex = pointerId.Length();
-
- switch (aAction) {
- case sdk::MotionEvent::ACTION_DOWN:
- case sdk::MotionEvent::ACTION_POINTER_DOWN:
- type = MultiTouchInput::MULTITOUCH_START;
- break;
- case sdk::MotionEvent::ACTION_MOVE:
- type = MultiTouchInput::MULTITOUCH_MOVE;
- break;
- case sdk::MotionEvent::ACTION_UP:
- case sdk::MotionEvent::ACTION_POINTER_UP:
- // for pointer-up events we only want the data from
- // the one pointer that went up
- type = MultiTouchInput::MULTITOUCH_END;
- startIndex = aActionIndex;
- endIndex = aActionIndex + 1;
- break;
- case sdk::MotionEvent::ACTION_OUTSIDE:
- case sdk::MotionEvent::ACTION_CANCEL:
- type = MultiTouchInput::MULTITOUCH_CANCEL;
- break;
- default:
- return false;
- }
-
- MultiTouchInput input(type, aTime, TimeStamp(), 0);
- input.modifiers = GetModifiers(aMetaState);
- input.mTouches.SetCapacity(endIndex - startIndex);
-
- nsTArray<float> x(aX->GetElements());
- nsTArray<float> y(aY->GetElements());
- nsTArray<float> orientation(aOrientation->GetElements());
- nsTArray<float> pressure(aPressure->GetElements());
- nsTArray<float> toolMajor(aToolMajor->GetElements());
- nsTArray<float> toolMinor(aToolMinor->GetElements());
-
- MOZ_ASSERT(pointerId.Length() == x.Length());
- MOZ_ASSERT(pointerId.Length() == y.Length());
- MOZ_ASSERT(pointerId.Length() == orientation.Length());
- MOZ_ASSERT(pointerId.Length() == pressure.Length());
- MOZ_ASSERT(pointerId.Length() == toolMajor.Length());
- MOZ_ASSERT(pointerId.Length() == toolMinor.Length());
-
- for (size_t i = startIndex; i < endIndex; i++) {
-
- float orien = orientation[i] * 180.0f / M_PI;
- // w3c touchevents spec does not allow orientations == 90
- // this shifts it to -90, which will be shifted to zero below
- if (orien >= 90.0) {
- orien -= 180.0f;
- }
-
- nsIntPoint point = nsIntPoint(int32_t(floorf(x[i])),
- int32_t(floorf(y[i])));
-
- // w3c touchevent radii are given with an orientation between 0 and
- // 90. The radii are found by removing the orientation and
- // measuring the x and y radii of the resulting ellipse. For
- // Android orientations >= 0 and < 90, use the y radius as the
- // major radius, and x as the minor radius. However, for an
- // orientation < 0, we have to shift the orientation by adding 90,
- // and reverse which radius is major and minor.
- gfx::Size radius;
- if (orien < 0.0f) {
- orien += 90.0f;
- radius = gfx::Size(int32_t(toolMajor[i] / 2.0f),
- int32_t(toolMinor[i] / 2.0f));
- } else {
- radius = gfx::Size(int32_t(toolMinor[i] / 2.0f),
- int32_t(toolMajor[i] / 2.0f));
- }
-
- input.mTouches.AppendElement(SingleTouchData(
- pointerId[i], ScreenIntPoint::FromUnknownPoint(point),
- ScreenSize::FromUnknownSize(radius), orien, pressure[i]));
- }
-
- ScrollableLayerGuid guid;
- uint64_t blockId;
- nsEventStatus status =
- controller->ReceiveInputEvent(input, &guid, &blockId);
-
- if (status == nsEventStatus_eConsumeNoDefault) {
- return true;
- }
-
- // Dispatch APZ input event on Gecko thread.
- NativePanZoomController::GlobalRef npzc = mNPZC;
- nsAppShell::PostEvent([npzc, input, guid, blockId, status] {
- MOZ_ASSERT(NS_IsMainThread());
-
- JNIEnv* const env = jni::GetGeckoThreadEnv();
- NPZCSupport* npzcSupport = GetNative(
- NativePanZoomController::LocalRef(env, npzc));
-
- if (!npzcSupport || !npzcSupport->mWindow) {
- // We already shut down.
- env->ExceptionClear();
- return;
- }
-
- nsWindow* const window = npzcSupport->mWindow;
- window->UserActivity();
- WidgetTouchEvent touchEvent = input.ToWidgetTouchEvent(window);
- window->ProcessUntransformedAPZEvent(&touchEvent, guid,
- blockId, status);
- window->DispatchHitTest(touchEvent);
- });
- return true;
- }
-
- void HandleMotionEventVelocity(int64_t aTime, float aSpeedY)
- {
- MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
-
- RefPtr<IAPZCTreeManager> controller;
-
- if (LockedWindowPtr window{mWindow}) {
- controller = window->mAPZC;
- }
-
- if (controller) {
- controller->ProcessTouchVelocity((uint32_t)aTime, aSpeedY);
- }
- }
-
- void UpdateOverscrollVelocity(const float x, const float y)
- {
- mNPZC->UpdateOverscrollVelocity(x, y);
- }
-
- void UpdateOverscrollOffset(const float x, const float y)
- {
- mNPZC->UpdateOverscrollOffset(x, y);
- }
-
- void SetScrollingRootContent(const bool isRootContent)
- {
- mNPZC->SetScrollingRootContent(isRootContent);
- }
-
- void SetSelectionDragState(const bool aState)
- {
- mNPZC->OnSelectionDragState(aState);
- }
-};
-
-template<> const char
-nsWindow::NativePtr<nsWindow::NPZCSupport>::sName[] = "NPZCSupport";
-
-/**
- * Compositor has some unique requirements for its native calls, so make it
- * separate from GeckoViewSupport.
- */
-class nsWindow::LayerViewSupport final
- : public LayerView::Compositor::Natives<LayerViewSupport>
-{
- using LockedWindowPtr = WindowPtr<LayerViewSupport>::Locked;
-
- WindowPtr<LayerViewSupport> mWindow;
- LayerView::Compositor::GlobalRef mCompositor;
- GeckoLayerClient::GlobalRef mLayerClient;
- Atomic<bool, ReleaseAcquire> mCompositorPaused;
- jni::Object::GlobalRef mSurface;
-
- // In order to use Event::HasSameTypeAs in PostTo(), we cannot make
- // LayerViewEvent a template because each template instantiation is
- // a different type. So implement LayerViewEvent as a ProxyEvent.
- class LayerViewEvent final : public nsAppShell::ProxyEvent
- {
- using Event = nsAppShell::Event;
-
- public:
- static UniquePtr<Event> MakeEvent(UniquePtr<Event>&& event)
- {
- return MakeUnique<LayerViewEvent>(mozilla::Move(event));
- }
-
- LayerViewEvent(UniquePtr<Event>&& event)
- : nsAppShell::ProxyEvent(mozilla::Move(event))
- {}
-
- void PostTo(LinkedList<Event>& queue) override
- {
- // Give priority to compositor events, but keep in order with
- // existing compositor events.
- nsAppShell::Event* event = queue.getFirst();
- while (event && event->HasSameTypeAs(this)) {
- event = event->getNext();
- }
- if (event) {
- event->setPrevious(this);
- } else {
- queue.insertBack(this);
- }
- }
- };
-
-public:
- typedef LayerView::Compositor::Natives<LayerViewSupport> Base;
-
- template<class Functor>
- static void OnNativeCall(Functor&& aCall)
- {
- if (aCall.IsTarget(&LayerViewSupport::CreateCompositor)) {
- // This call is blocking.
- nsAppShell::SyncRunEvent(nsAppShell::LambdaEvent<Functor>(
- mozilla::Move(aCall)), &LayerViewEvent::MakeEvent);
- return;
- }
- }
-
- static LayerViewSupport*
- FromNative(const LayerView::Compositor::LocalRef& instance)
- {
- return GetNative(instance);
- }
-
- LayerViewSupport(NativePtr<LayerViewSupport>* aPtr, nsWindow* aWindow,
- const LayerView::Compositor::LocalRef& aInstance)
- : mWindow(aPtr, aWindow)
- , mCompositor(aInstance)
- , mCompositorPaused(true)
- {}
-
- ~LayerViewSupport()
- {}
-
- using Base::AttachNative;
- using Base::DisposeNative;
-
- void OnDetach()
- {
- mCompositor->Destroy();
- }
-
- const GeckoLayerClient::Ref& GetLayerClient() const
- {
- return mLayerClient;
- }
-
- bool CompositorPaused() const
- {
- return mCompositorPaused;
- }
-
- jni::Object::Param GetSurface()
- {
- return mSurface;
- }
-
-private:
- void OnResumedCompositor()
- {
- MOZ_ASSERT(NS_IsMainThread());
-
- // When we receive this, the compositor has already been told to
- // resume. (It turns out that waiting till we reach here to tell
- // the compositor to resume takes too long, resulting in a black
- // flash.) This means it's now safe for layer updates to occur.
- // Since we might have prevented one or more draw events from
- // occurring while the compositor was paused, we need to schedule
- // a draw event now.
- if (!mCompositorPaused) {
- mWindow->RedrawAll();
- }
- }
-
- /**
- * Compositor methods
- */
-public:
- void AttachToJava(jni::Object::Param aClient, jni::Object::Param aNPZC)
- {
- MOZ_ASSERT(NS_IsMainThread());
- if (!mWindow) {
- return; // Already shut down.
- }
-
- const auto& layerClient = GeckoLayerClient::Ref::From(aClient);
-
- // If resetting is true, Android destroyed our GeckoApp activity and we
- // had to recreate it, but all the Gecko-side things were not
- // destroyed. We therefore need to link up the new java objects to
- // Gecko, and that's what we do here.
- const bool resetting = !!mLayerClient;
- mLayerClient = layerClient;
-
- MOZ_ASSERT(aNPZC);
- auto npzc = NativePanZoomController::LocalRef(
- jni::GetGeckoThreadEnv(),
- NativePanZoomController::Ref::From(aNPZC));
- mWindow->mNPZCSupport.Attach(npzc, mWindow, npzc);
-
- layerClient->OnGeckoReady();
-
- if (resetting) {
- // Since we are re-linking the new java objects to Gecko, we need
- // to get the viewport from the compositor (since the Java copy was
- // thrown away) and we do that by setting the first-paint flag.
- if (RefPtr<CompositorBridgeParent> bridge = mWindow->GetCompositorBridgeParent()) {
- bridge->ForceIsFirstPaint();
- }
- }
- }
-
- void OnSizeChanged(int32_t aWindowWidth, int32_t aWindowHeight,
- int32_t aScreenWidth, int32_t aScreenHeight)
- {
- MOZ_ASSERT(NS_IsMainThread());
- if (!mWindow) {
- return; // Already shut down.
- }
-
- if (aWindowWidth != mWindow->mBounds.width ||
- aWindowHeight != mWindow->mBounds.height) {
-
- mWindow->Resize(aWindowWidth, aWindowHeight, /* repaint */ false);
- }
- }
-
- void CreateCompositor(int32_t aWidth, int32_t aHeight,
- jni::Object::Param aSurface)
- {
- MOZ_ASSERT(NS_IsMainThread());
- MOZ_ASSERT(mWindow);
-
- mSurface = aSurface;
- mWindow->CreateLayerManager(aWidth, aHeight);
-
- mCompositorPaused = false;
- OnResumedCompositor();
- }
-
- void SyncPauseCompositor()
- {
- MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
-
- RefPtr<CompositorBridgeParent> bridge;
-
- if (LockedWindowPtr window{mWindow}) {
- bridge = window->GetCompositorBridgeParent();
- }
-
- if (bridge) {
- mCompositorPaused = true;
- bridge->SchedulePauseOnCompositorThread();
- }
- }
-
- void SyncResumeCompositor()
- {
- MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
-
- RefPtr<CompositorBridgeParent> bridge;
-
- if (LockedWindowPtr window{mWindow}) {
- bridge = window->GetCompositorBridgeParent();
- }
-
- if (bridge && bridge->ScheduleResumeOnCompositorThread()) {
- mCompositorPaused = false;
- }
- }
-
- void SyncResumeResizeCompositor(const LayerView::Compositor::LocalRef& aObj,
- int32_t aWidth, int32_t aHeight,
- jni::Object::Param aSurface)
- {
- MOZ_ASSERT(AndroidBridge::IsJavaUiThread());
-
- RefPtr<CompositorBridgeParent> bridge;
-
- if (LockedWindowPtr window{mWindow}) {
- bridge = window->GetCompositorBridgeParent();
- }
-
- mSurface = aSurface;
-
- if (!bridge || !bridge->ScheduleResumeOnCompositorThread(aWidth,
- aHeight)) {
- return;
- }
-
- mCompositorPaused = false;
-
- class OnResumedEvent : public nsAppShell::Event
- {
- LayerView::Compositor::GlobalRef mCompositor;
-
- public:
- OnResumedEvent(LayerView::Compositor::GlobalRef&& aCompositor)
- : mCompositor(mozilla::Move(aCompositor))
- {}
-
- void Run() override
- {
- MOZ_ASSERT(NS_IsMainThread());
-
- JNIEnv* const env = jni::GetGeckoThreadEnv();
- LayerViewSupport* const lvs = GetNative(
- LayerView::Compositor::LocalRef(env, mCompositor));
- MOZ_CATCH_JNI_EXCEPTION(env);
-
- lvs->OnResumedCompositor();
- }
- };
-
- nsAppShell::PostEvent(MakeUnique<LayerViewEvent>(
- MakeUnique<OnResumedEvent>(aObj)));
- }
-
- void SyncInvalidateAndScheduleComposite()
- {
- RefPtr<CompositorBridgeParent> bridge;
-
- if (LockedWindowPtr window{mWindow}) {
- bridge = window->GetCompositorBridgeParent();
- }
-
- if (bridge) {
- bridge->InvalidateOnCompositorThread();
- bridge->ScheduleRenderOnCompositorThread();
- }
- }
-};
-
-template<> const char
-nsWindow::NativePtr<nsWindow::LayerViewSupport>::sName[] = "LayerViewSupport";
-
-/* PresentationMediaPlayerManager native calls access inner nsWindow functionality so PMPMSupport is a child class of nsWindow */
-class nsWindow::PMPMSupport final
- : public PresentationMediaPlayerManager::Natives<PMPMSupport>
-{
- PMPMSupport() = delete;
-
- static LayerViewSupport* GetLayerViewSupport(jni::Object::Param aView)
- {
- const auto& layerView = LayerView::Ref::From(aView);
-
- LayerView::Compositor::LocalRef compositor = layerView->GetCompositor();
- if (!layerView->CompositorCreated() || !compositor) {
- return nullptr;
- }
-
- LayerViewSupport* const lvs = LayerViewSupport::FromNative(compositor);
- if (!lvs) {
- // There is a pending exception whenever FromNative returns nullptr.
- compositor.Env()->ExceptionClear();
- }
- return lvs;
- }
-
-public:
- static ANativeWindow* sWindow;
- static EGLSurface sSurface;
-
- static void InvalidateAndScheduleComposite(jni::Object::Param aView)
- {
- LayerViewSupport* const lvs = GetLayerViewSupport(aView);
- if (lvs) {
- lvs->SyncInvalidateAndScheduleComposite();
- }
- }
-
- static void AddPresentationSurface(const jni::Class::LocalRef& aCls,
- jni::Object::Param aView,
- jni::Object::Param aSurface)
- {
- RemovePresentationSurface();
-
- LayerViewSupport* const lvs = GetLayerViewSupport(aView);
- if (!lvs) {
- return;
- }
-
- ANativeWindow* const window = ANativeWindow_fromSurface(
- aCls.Env(), aSurface.Get());
- if (!window) {
- return;
- }
-
- sWindow = window;
-
- const bool wasAlreadyPaused = lvs->CompositorPaused();
- if (!wasAlreadyPaused) {
- lvs->SyncPauseCompositor();
- }
-
- if (sSurface) {
- // Destroy the EGL surface! The compositor is paused so it should
- // be okay to destroy the surface here.
- mozilla::gl::GLContextProvider::DestroyEGLSurface(sSurface);
- sSurface = nullptr;
- }
-
- if (!wasAlreadyPaused) {
- lvs->SyncResumeCompositor();
- }
-
- lvs->SyncInvalidateAndScheduleComposite();
- }
-
- static void RemovePresentationSurface()
- {
- if (sWindow) {
- ANativeWindow_release(sWindow);
- sWindow = nullptr;
- }
- }
-};
-
-ANativeWindow* nsWindow::PMPMSupport::sWindow;
-EGLSurface nsWindow::PMPMSupport::sSurface;
-
-
-nsWindow::GeckoViewSupport::~GeckoViewSupport()
-{
- // Disassociate our GeckoEditable instance with our native object.
- // OnDestroy will call disposeNative after any pending native calls have
- // been made.
- MOZ_ASSERT(mEditable);
- mEditable->OnViewChange(nullptr);
-
- if (window.mNPZCSupport) {
- window.mNPZCSupport.Detach();
- }
-
- if (window.mLayerViewSupport) {
- window.mLayerViewSupport.Detach();
- }
-}
-
-/* static */ void
-nsWindow::GeckoViewSupport::Open(const jni::Class::LocalRef& aCls,
- GeckoView::Window::Param aWindow,
- GeckoView::Param aView,
- jni::Object::Param aCompositor,
- jni::String::Param aChromeURI,
- int32_t aScreenId)
-{
- MOZ_ASSERT(NS_IsMainThread());
-
- PROFILER_LABEL("nsWindow", "GeckoViewSupport::Open",
- js::ProfileEntry::Category::OTHER);
-
- nsCOMPtr<nsIWindowWatcher> ww = do_GetService(NS_WINDOWWATCHER_CONTRACTID);
- MOZ_RELEASE_ASSERT(ww);
-
- nsAdoptingCString url;
- if (aChromeURI) {
- url = aChromeURI->ToCString();
- } else {
- url = Preferences::GetCString("toolkit.defaultChromeURI");
- if (!url) {
- url = NS_LITERAL_CSTRING("chrome://browser/content/browser.xul");
- }
- }
-
- nsCOMPtr<mozIDOMWindowProxy> domWindow;
- ww->OpenWindow(nullptr, url, nullptr, "chrome,dialog=0,resizable,scrollbars=yes",
- nullptr, getter_AddRefs(domWindow));
- MOZ_RELEASE_ASSERT(domWindow);
-
- nsCOMPtr<nsPIDOMWindowOuter> pdomWindow =
- nsPIDOMWindowOuter::From(domWindow);
- nsCOMPtr<nsIWidget> widget = WidgetUtils::DOMWindowToWidget(pdomWindow);
- MOZ_ASSERT(widget);
-
- const auto window = static_cast<nsWindow*>(widget.get());
- window->SetScreenId(aScreenId);
-
- // Attach a new GeckoView support object to the new window.
- window->mGeckoViewSupport = mozilla::MakeUnique<GeckoViewSupport>(
- window, GeckoView::Window::LocalRef(aCls.Env(), aWindow), aView);
-
- window->mGeckoViewSupport->mDOMWindow = pdomWindow;
-
- // Attach the Compositor to the new window.
- auto compositor = LayerView::Compositor::LocalRef(
- aCls.Env(), LayerView::Compositor::Ref::From(aCompositor));
- window->mLayerViewSupport.Attach(compositor, window, compositor);
-
- if (window->mWidgetListener) {
- nsCOMPtr<nsIXULWindow> xulWindow(
- window->mWidgetListener->GetXULWindow());
- if (xulWindow) {
- // Our window is not intrinsically sized, so tell nsXULWindow to
- // not set a size for us.
- xulWindow->SetIntrinsicallySized(false);
- }
- }
-}
-
-void
-nsWindow::GeckoViewSupport::Close()
-{
- if (!mDOMWindow) {
- return;
- }
-
- mDOMWindow->ForceClose();
- mDOMWindow = nullptr;
-}
-
-void
-nsWindow::GeckoViewSupport::Reattach(const GeckoView::Window::LocalRef& inst,
- GeckoView::Param aView,
- jni::Object::Param aCompositor)
-{
- // Associate our previous GeckoEditable with the new GeckoView.
- mEditable->OnViewChange(aView);
-
- // mNPZCSupport might have already been detached through the Java side calling
- // NativePanZoomController.destroy().
- if (window.mNPZCSupport) {
- window.mNPZCSupport.Detach();
- }
-
- MOZ_ASSERT(window.mLayerViewSupport);
- window.mLayerViewSupport.Detach();
-
- auto compositor = LayerView::Compositor::LocalRef(
- inst.Env(), LayerView::Compositor::Ref::From(aCompositor));
- window.mLayerViewSupport.Attach(compositor, &window, compositor);
- compositor->Reattach();
-}
-
-void
-nsWindow::GeckoViewSupport::LoadUri(jni::String::Param aUri, int32_t aFlags)
-{
- if (!mDOMWindow) {
- return;
- }
-
- nsCOMPtr<nsIURI> uri = nsAppShell::ResolveURI(aUri->ToCString());
- if (NS_WARN_IF(!uri)) {
- return;
- }
-
- nsCOMPtr<nsIDOMChromeWindow> chromeWin = do_QueryInterface(mDOMWindow);
- nsCOMPtr<nsIBrowserDOMWindow> browserWin;
-
- if (NS_WARN_IF(!chromeWin) || NS_WARN_IF(NS_FAILED(
- chromeWin->GetBrowserDOMWindow(getter_AddRefs(browserWin))))) {
- return;
- }
-
- const int flags = aFlags == GeckoView::LOAD_NEW_TAB ?
- nsIBrowserDOMWindow::OPEN_NEWTAB :
- aFlags == GeckoView::LOAD_SWITCH_TAB ?
- nsIBrowserDOMWindow::OPEN_SWITCHTAB :
- nsIBrowserDOMWindow::OPEN_CURRENTWINDOW;
- nsCOMPtr<mozIDOMWindowProxy> newWin;
-
- if (NS_FAILED(browserWin->OpenURI(
- uri, nullptr, flags, nsIBrowserDOMWindow::OPEN_EXTERNAL,
- getter_AddRefs(newWin)))) {
- NS_WARNING("Failed to open URI");
- }
-}
-
-void
-nsWindow::InitNatives()
-{
- nsWindow::GeckoViewSupport::Base::Init();
- nsWindow::GeckoViewSupport::EditableBase::Init();
- nsWindow::LayerViewSupport::Init();
- nsWindow::NPZCSupport::Init();
- if (jni::IsFennec()) {
- nsWindow::PMPMSupport::Init();
- }
-}
-
-nsWindow*
-nsWindow::TopWindow()
-{
- if (!gTopLevelWindows.IsEmpty())
- return gTopLevelWindows[0];
- return nullptr;
-}
-
-void
-nsWindow::LogWindow(nsWindow *win, int index, int indent)
-{
-#if defined(DEBUG) || defined(FORCE_ALOG)
- char spaces[] = " ";
- spaces[indent < 20 ? indent : 20] = 0;
- ALOG("%s [% 2d] 0x%08x [parent 0x%08x] [% 3d,% 3dx% 3d,% 3d] vis %d type %d",
- spaces, index, (intptr_t)win, (intptr_t)win->mParent,
- win->mBounds.x, win->mBounds.y,
- win->mBounds.width, win->mBounds.height,
- win->mIsVisible, win->mWindowType);
-#endif
-}
-
-void
-nsWindow::DumpWindows()
-{
- DumpWindows(gTopLevelWindows);
-}
-
-void
-nsWindow::DumpWindows(const nsTArray<nsWindow*>& wins, int indent)
-{
- for (uint32_t i = 0; i < wins.Length(); ++i) {
- nsWindow *w = wins[i];
- LogWindow(w, i, indent);
- DumpWindows(w->mChildren, indent+1);
- }
-}
-
-nsWindow::nsWindow() :
- mScreenId(0), // Use 0 (primary screen) as the default value.
- mIsVisible(false),
- mParent(nullptr),
- mAwaitingFullScreen(false),
- mIsFullScreen(false)
-{
-}
-
-nsWindow::~nsWindow()
-{
- gTopLevelWindows.RemoveElement(this);
- ALOG("nsWindow %p destructor", (void*)this);
-}
-
-bool
-nsWindow::IsTopLevel()
-{
- return mWindowType == eWindowType_toplevel ||
- mWindowType == eWindowType_dialog ||
- mWindowType == eWindowType_invisible;
-}
-
-nsresult
-nsWindow::Create(nsIWidget* aParent,
- nsNativeWidget aNativeParent,
- const LayoutDeviceIntRect& aRect,
- nsWidgetInitData* aInitData)
-{
- ALOG("nsWindow[%p]::Create %p [%d %d %d %d]", (void*)this, (void*)aParent,
- aRect.x, aRect.y, aRect.width, aRect.height);
-
- nsWindow *parent = (nsWindow*) aParent;
- if (aNativeParent) {
- if (parent) {
- ALOG("Ignoring native parent on Android window [%p], "
- "since parent was specified (%p %p)", (void*)this,
- (void*)aNativeParent, (void*)aParent);
- } else {
- parent = (nsWindow*) aNativeParent;
- }
- }
-
- mBounds = aRect;
-
- BaseCreate(nullptr, aInitData);
-
- NS_ASSERTION(IsTopLevel() || parent,
- "non-top-level window doesn't have a parent!");
-
- if (IsTopLevel()) {
- gTopLevelWindows.AppendElement(this);
-
- } else if (parent) {
- parent->mChildren.AppendElement(this);
- mParent = parent;
- }
-
-#ifdef DEBUG_ANDROID_WIDGET
- DumpWindows();
-#endif
-
- return NS_OK;
-}
-
-void
-nsWindow::Destroy()
-{
- nsBaseWidget::mOnDestroyCalled = true;
-
- if (mGeckoViewSupport) {
- // Disassociate our native object with GeckoView.
- mGeckoViewSupport = nullptr;
- }
-
- // Stuff below may release the last ref to this
- nsCOMPtr<nsIWidget> kungFuDeathGrip(this);
-
- while (mChildren.Length()) {
- // why do we still have children?
- ALOG("### Warning: Destroying window %p and reparenting child %p to null!", (void*)this, (void*)mChildren[0]);
- mChildren[0]->SetParent(nullptr);
- }
-
- nsBaseWidget::Destroy();
-
- if (IsTopLevel())
- gTopLevelWindows.RemoveElement(this);
-
- SetParent(nullptr);
-
- nsBaseWidget::OnDestroy();
-
-#ifdef DEBUG_ANDROID_WIDGET
- DumpWindows();
-#endif
-}
-
-NS_IMETHODIMP
-nsWindow::ConfigureChildren(const nsTArray<nsIWidget::Configuration>& config)
-{
- for (uint32_t i = 0; i < config.Length(); ++i) {
- nsWindow *childWin = (nsWindow*) config[i].mChild.get();
- childWin->Resize(config[i].mBounds.x,
- config[i].mBounds.y,
- config[i].mBounds.width,
- config[i].mBounds.height,
- false);
- }
-
- return NS_OK;
-}
-
-void
-nsWindow::RedrawAll()
-{
- if (mAttachedWidgetListener) {
- mAttachedWidgetListener->RequestRepaint();
- } else if (mWidgetListener) {
- mWidgetListener->RequestRepaint();
- }
-}
-
-NS_IMETHODIMP
-nsWindow::SetParent(nsIWidget *aNewParent)
-{
- if ((nsIWidget*)mParent == aNewParent)
- return NS_OK;
-
- // If we had a parent before, remove ourselves from its list of
- // children.
- if (mParent)
- mParent->mChildren.RemoveElement(this);
-
- mParent = (nsWindow*)aNewParent;
-
- if (mParent)
- mParent->mChildren.AppendElement(this);
-
- // if we are now in the toplevel window's hierarchy, schedule a redraw
- if (FindTopLevel() == nsWindow::TopWindow())
- RedrawAll();
-
- return NS_OK;
-}
-
-nsIWidget*
-nsWindow::GetParent()
-{
- return mParent;
-}
-
-float
-nsWindow::GetDPI()
-{
- if (AndroidBridge::Bridge())
- return AndroidBridge::Bridge()->GetDPI();
- return 160.0f;
-}
-
-double
-nsWindow::GetDefaultScaleInternal()
-{
-
- nsCOMPtr<nsIScreen> screen = GetWidgetScreen();
- MOZ_ASSERT(screen);
- RefPtr<nsScreenAndroid> screenAndroid = (nsScreenAndroid*) screen.get();
- return screenAndroid->GetDensity();
-}
-
-NS_IMETHODIMP
-nsWindow::Show(bool aState)
-{
- ALOG("nsWindow[%p]::Show %d", (void*)this, aState);
-
- if (mWindowType == eWindowType_invisible) {
- ALOG("trying to show invisible window! ignoring..");
- return NS_ERROR_FAILURE;
- }
-
- if (aState == mIsVisible)
- return NS_OK;
-
- mIsVisible = aState;
-
- if (IsTopLevel()) {
- // XXX should we bring this to the front when it's shown,
- // if it's a toplevel widget?
-
- // XXX we should synthesize a eMouseExitFromWidget (for old top
- // window)/eMouseEnterIntoWidget (for new top window) since we need
- // to pretend that the top window always has focus. Not sure
- // if Show() is the right place to do this, though.
-
- if (aState) {
- // It just became visible, so bring it to the front.
- BringToFront();
-
- } else if (nsWindow::TopWindow() == this) {
- // find the next visible window to show
- unsigned int i;
- for (i = 1; i < gTopLevelWindows.Length(); i++) {
- nsWindow *win = gTopLevelWindows[i];
- if (!win->mIsVisible)
- continue;
-
- win->BringToFront();
- break;
- }
- }
- } else if (FindTopLevel() == nsWindow::TopWindow()) {
- RedrawAll();
- }
-
-#ifdef DEBUG_ANDROID_WIDGET
- DumpWindows();
-#endif
-
- return NS_OK;
-}
-
-bool
-nsWindow::IsVisible() const
-{
- return mIsVisible;
-}
-
-void
-nsWindow::ConstrainPosition(bool aAllowSlop,
- int32_t *aX,
- int32_t *aY)
-{
- ALOG("nsWindow[%p]::ConstrainPosition %d [%d %d]", (void*)this, aAllowSlop, *aX, *aY);
-
- // constrain toplevel windows; children we don't care about
- if (IsTopLevel()) {
- *aX = 0;
- *aY = 0;
- }
-}
-
-NS_IMETHODIMP
-nsWindow::Move(double aX,
- double aY)
-{
- if (IsTopLevel())
- return NS_OK;
-
- return Resize(aX,
- aY,
- mBounds.width,
- mBounds.height,
- true);
-}
-
-NS_IMETHODIMP
-nsWindow::Resize(double aWidth,
- double aHeight,
- bool aRepaint)
-{
- return Resize(mBounds.x,
- mBounds.y,
- aWidth,
- aHeight,
- aRepaint);
-}
-
-NS_IMETHODIMP
-nsWindow::Resize(double aX,
- double aY,
- double aWidth,
- double aHeight,
- bool aRepaint)
-{
- ALOG("nsWindow[%p]::Resize [%f %f %f %f] (repaint %d)", (void*)this, aX, aY, aWidth, aHeight, aRepaint);
-
- bool needSizeDispatch = aWidth != mBounds.width || aHeight != mBounds.height;
-
- mBounds.x = NSToIntRound(aX);
- mBounds.y = NSToIntRound(aY);
- mBounds.width = NSToIntRound(aWidth);
- mBounds.height = NSToIntRound(aHeight);
-
- if (needSizeDispatch) {
- OnSizeChanged(gfx::IntSize::Truncate(aWidth, aHeight));
- }
-
- // Should we skip honoring aRepaint here?
- if (aRepaint && FindTopLevel() == nsWindow::TopWindow())
- RedrawAll();
-
- nsIWidgetListener* listener = GetWidgetListener();
- if (mAwaitingFullScreen && listener) {
- listener->FullscreenChanged(mIsFullScreen);
- mAwaitingFullScreen = false;
- }
-
- return NS_OK;
-}
-
-void
-nsWindow::SetZIndex(int32_t aZIndex)
-{
- ALOG("nsWindow[%p]::SetZIndex %d ignored", (void*)this, aZIndex);
-}
-
-void
-nsWindow::SetSizeMode(nsSizeMode aMode)
-{
- switch (aMode) {
- case nsSizeMode_Minimized:
- GeckoAppShell::MoveTaskToBack();
- break;
- case nsSizeMode_Fullscreen:
- MakeFullScreen(true);
- break;
- default:
- break;
- }
-}
-
-NS_IMETHODIMP
-nsWindow::Enable(bool aState)
-{
- ALOG("nsWindow[%p]::Enable %d ignored", (void*)this, aState);
- return NS_OK;
-}
-
-bool
-nsWindow::IsEnabled() const
-{
- return true;
-}
-
-NS_IMETHODIMP
-nsWindow::Invalidate(const LayoutDeviceIntRect& aRect)
-{
- return NS_OK;
-}
-
-nsWindow*
-nsWindow::FindTopLevel()
-{
- nsWindow *toplevel = this;
- while (toplevel) {
- if (toplevel->IsTopLevel())
- return toplevel;
-
- toplevel = toplevel->mParent;
- }
-
- ALOG("nsWindow::FindTopLevel(): couldn't find a toplevel or dialog window in this [%p] widget's hierarchy!", (void*)this);
- return this;
-}
-
-NS_IMETHODIMP
-nsWindow::SetFocus(bool aRaise)
-{
- nsWindow *top = FindTopLevel();
- top->BringToFront();
-
- return NS_OK;
-}
-
-void
-nsWindow::BringToFront()
-{
- // If the window to be raised is the same as the currently raised one,
- // do nothing. We need to check the focus manager as well, as the first
- // window that is created will be first in the window list but won't yet
- // be focused.
- nsCOMPtr<nsIFocusManager> fm = do_GetService(FOCUSMANAGER_CONTRACTID);
- nsCOMPtr<mozIDOMWindowProxy> existingTopWindow;
- fm->GetActiveWindow(getter_AddRefs(existingTopWindow));
- if (existingTopWindow && FindTopLevel() == nsWindow::TopWindow())
- return;
-
- if (!IsTopLevel()) {
- FindTopLevel()->BringToFront();
- return;
- }
-
- RefPtr<nsWindow> kungFuDeathGrip(this);
-
- nsWindow *oldTop = nullptr;
- if (!gTopLevelWindows.IsEmpty()) {
- oldTop = gTopLevelWindows[0];
- }
-
- gTopLevelWindows.RemoveElement(this);
- gTopLevelWindows.InsertElementAt(0, this);
-
- if (oldTop) {
- nsIWidgetListener* listener = oldTop->GetWidgetListener();
- if (listener) {
- listener->WindowDeactivated();
- }
- }
-
- if (mWidgetListener) {
- mWidgetListener->WindowActivated();
- }
-
- RedrawAll();
-}
-
-LayoutDeviceIntRect
-nsWindow::GetScreenBounds()
-{
- return LayoutDeviceIntRect(WidgetToScreenOffset(), mBounds.Size());
-}
-
-LayoutDeviceIntPoint
-nsWindow::WidgetToScreenOffset()
-{
- LayoutDeviceIntPoint p(0, 0);
- nsWindow *w = this;
-
- while (w && !w->IsTopLevel()) {
- p.x += w->mBounds.x;
- p.y += w->mBounds.y;
-
- w = w->mParent;
- }
-
- return p;
-}
-
-NS_IMETHODIMP
-nsWindow::DispatchEvent(WidgetGUIEvent* aEvent,
- nsEventStatus& aStatus)
-{
- aStatus = DispatchEvent(aEvent);
- return NS_OK;
-}
-
-nsEventStatus
-nsWindow::DispatchEvent(WidgetGUIEvent* aEvent)
-{
- if (mAttachedWidgetListener) {
- return mAttachedWidgetListener->HandleEvent(aEvent, mUseAttachedEvents);
- } else if (mWidgetListener) {
- return mWidgetListener->HandleEvent(aEvent, mUseAttachedEvents);
- }
- return nsEventStatus_eIgnore;
-}
-
-nsresult
-nsWindow::MakeFullScreen(bool aFullScreen, nsIScreen*)
-{
- mIsFullScreen = aFullScreen;
- mAwaitingFullScreen = true;
- GeckoAppShell::SetFullScreen(aFullScreen);
- return NS_OK;
-}
-
-mozilla::layers::LayerManager*
-nsWindow::GetLayerManager(PLayerTransactionChild*, LayersBackend, LayerManagerPersistence)
-{
- if (mLayerManager) {
- return mLayerManager;
- }
- return nullptr;
-}
-
-void
-nsWindow::CreateLayerManager(int aCompositorWidth, int aCompositorHeight)
-{
- if (mLayerManager) {
- return;
- }
-
- nsWindow *topLevelWindow = FindTopLevel();
- if (!topLevelWindow || topLevelWindow->mWindowType == eWindowType_invisible) {
- // don't create a layer manager for an invisible top-level window
- return;
- }
-
- // Ensure that gfxPlatform is initialized first.
- gfxPlatform::GetPlatform();
-
- if (ShouldUseOffMainThreadCompositing()) {
- CreateCompositor(aCompositorWidth, aCompositorHeight);
- if (mLayerManager) {
- return;
- }
-
- // If we get here, then off main thread compositing failed to initialize.
- sFailedToCreateGLContext = true;
- }
-
- if (!ComputeShouldAccelerate() || sFailedToCreateGLContext) {
- printf_stderr(" -- creating basic, not accelerated\n");
- mLayerManager = CreateBasicLayerManager();
- }
-}
-
-void
-nsWindow::OnSizeChanged(const gfx::IntSize& aSize)
-{
- ALOG("nsWindow: %p OnSizeChanged [%d %d]", (void*)this, aSize.width, aSize.height);
-
- mBounds.width = aSize.width;
- mBounds.height = aSize.height;
-
- if (mWidgetListener) {
- mWidgetListener->WindowResized(this, aSize.width, aSize.height);
- }
-
- if (mAttachedWidgetListener) {
- mAttachedWidgetListener->WindowResized(this, aSize.width, aSize.height);
- }
-}
-
-void
-nsWindow::InitEvent(WidgetGUIEvent& event, LayoutDeviceIntPoint* aPoint)
-{
- if (aPoint) {
- event.mRefPoint = *aPoint;
- } else {
- event.mRefPoint = LayoutDeviceIntPoint(0, 0);
- }
-
- event.mTime = PR_Now() / 1000;
-}
-
-void
-nsWindow::UpdateOverscrollVelocity(const float aX, const float aY)
-{
- if (NativePtr<NPZCSupport>::Locked npzcs{mNPZCSupport}) {
- npzcs->UpdateOverscrollVelocity(aX, aY);
- }
-}
-
-void
-nsWindow::UpdateOverscrollOffset(const float aX, const float aY)
-{
- if (NativePtr<NPZCSupport>::Locked npzcs{mNPZCSupport}) {
- npzcs->UpdateOverscrollOffset(aX, aY);
- }
-}
-
-void
-nsWindow::SetScrollingRootContent(const bool isRootContent)
-{
- // On Android, the Controller thread and UI thread are the same.
- MOZ_ASSERT(APZThreadUtils::IsControllerThread(), "nsWindow::SetScrollingRootContent must be called from the controller thread");
-
- if (NativePtr<NPZCSupport>::Locked npzcs{mNPZCSupport}) {
- npzcs->SetScrollingRootContent(isRootContent);
- }
-}
-
-void
-nsWindow::SetSelectionDragState(bool aState)
-{
- if (NativePtr<NPZCSupport>::Locked npzcs{mNPZCSupport}) {
- npzcs->SetSelectionDragState(aState);
- }
-}
-
-void *
-nsWindow::GetNativeData(uint32_t aDataType)
-{
- switch (aDataType) {
- // used by GLContextProviderEGL, nullptr is EGL_DEFAULT_DISPLAY
- case NS_NATIVE_DISPLAY:
- return nullptr;
-
- case NS_NATIVE_WIDGET:
- return (void *) this;
-
- case NS_RAW_NATIVE_IME_CONTEXT: {
- void* pseudoIMEContext = GetPseudoIMEContext();
- if (pseudoIMEContext) {
- return pseudoIMEContext;
- }
- // We assume that there is only one context per process on Android
- return NS_ONLY_ONE_NATIVE_IME_CONTEXT;
- }
-
- case NS_JAVA_SURFACE:
- if (NativePtr<LayerViewSupport>::Locked lvs{mLayerViewSupport}) {
- return lvs->GetSurface().Get();
- }
- return nullptr;
-
- case NS_PRESENTATION_WINDOW:
- return PMPMSupport::sWindow;
-
- case NS_PRESENTATION_SURFACE:
- return PMPMSupport::sSurface;
- }
-
- return nullptr;
-}
-
-void
-nsWindow::SetNativeData(uint32_t aDataType, uintptr_t aVal)
-{
- switch (aDataType) {
- case NS_PRESENTATION_SURFACE:
- PMPMSupport::sSurface = reinterpret_cast<EGLSurface>(aVal);
- break;
- }
-}
-
-void
-nsWindow::DispatchHitTest(const WidgetTouchEvent& aEvent)
-{
- if (aEvent.mMessage == eTouchStart && aEvent.mTouches.Length() == 1) {
- // Since touch events don't get retargeted by PositionedEventTargeting.cpp
- // code on Fennec, we dispatch a dummy mouse event that *does* get
- // retargeted. The Fennec browser.js code can use this to activate the
- // highlight element in case the this touchstart is the start of a tap.
- WidgetMouseEvent hittest(true, eMouseHitTest, this,
- WidgetMouseEvent::eReal);
- hittest.mRefPoint = aEvent.mTouches[0]->mRefPoint;
- hittest.mIgnoreRootScrollFrame = true;
- hittest.inputSource = nsIDOMMouseEvent::MOZ_SOURCE_TOUCH;
- nsEventStatus status;
- DispatchEvent(&hittest, status);
-
- if (mAPZEventState && hittest.hitCluster) {
- mAPZEventState->ProcessClusterHit();
- }
- }
-}
-
-static unsigned int ConvertAndroidKeyCodeToDOMKeyCode(int androidKeyCode)
-{
- // Special-case alphanumeric keycodes because they are most common.
- if (androidKeyCode >= AKEYCODE_A &&
- androidKeyCode <= AKEYCODE_Z) {
- return androidKeyCode - AKEYCODE_A + NS_VK_A;
- }
-
- if (androidKeyCode >= AKEYCODE_0 &&
- androidKeyCode <= AKEYCODE_9) {
- return androidKeyCode - AKEYCODE_0 + NS_VK_0;
- }
-
- switch (androidKeyCode) {
- // KEYCODE_UNKNOWN (0) ... KEYCODE_HOME (3)
- case AKEYCODE_BACK: return NS_VK_ESCAPE;
- // KEYCODE_CALL (5) ... KEYCODE_POUND (18)
- case AKEYCODE_DPAD_UP: return NS_VK_UP;
- case AKEYCODE_DPAD_DOWN: return NS_VK_DOWN;
- case AKEYCODE_DPAD_LEFT: return NS_VK_LEFT;
- case AKEYCODE_DPAD_RIGHT: return NS_VK_RIGHT;
- case AKEYCODE_DPAD_CENTER: return NS_VK_RETURN;
- case AKEYCODE_VOLUME_UP: return NS_VK_VOLUME_UP;
- case AKEYCODE_VOLUME_DOWN: return NS_VK_VOLUME_DOWN;
- // KEYCODE_VOLUME_POWER (26) ... KEYCODE_Z (54)
- case AKEYCODE_COMMA: return NS_VK_COMMA;
- case AKEYCODE_PERIOD: return NS_VK_PERIOD;
- case AKEYCODE_ALT_LEFT: return NS_VK_ALT;
- case AKEYCODE_ALT_RIGHT: return NS_VK_ALT;
- case AKEYCODE_SHIFT_LEFT: return NS_VK_SHIFT;
- case AKEYCODE_SHIFT_RIGHT: return NS_VK_SHIFT;
- case AKEYCODE_TAB: return NS_VK_TAB;
- case AKEYCODE_SPACE: return NS_VK_SPACE;
- // KEYCODE_SYM (63) ... KEYCODE_ENVELOPE (65)
- case AKEYCODE_ENTER: return NS_VK_RETURN;
- case AKEYCODE_DEL: return NS_VK_BACK; // Backspace
- case AKEYCODE_GRAVE: return NS_VK_BACK_QUOTE;
- // KEYCODE_MINUS (69)
- case AKEYCODE_EQUALS: return NS_VK_EQUALS;
- case AKEYCODE_LEFT_BRACKET: return NS_VK_OPEN_BRACKET;
- case AKEYCODE_RIGHT_BRACKET: return NS_VK_CLOSE_BRACKET;
- case AKEYCODE_BACKSLASH: return NS_VK_BACK_SLASH;
- case AKEYCODE_SEMICOLON: return NS_VK_SEMICOLON;
- // KEYCODE_APOSTROPHE (75)
- case AKEYCODE_SLASH: return NS_VK_SLASH;
- // KEYCODE_AT (77) ... KEYCODE_MEDIA_FAST_FORWARD (90)
- case AKEYCODE_MUTE: return NS_VK_VOLUME_MUTE;
- case AKEYCODE_PAGE_UP: return NS_VK_PAGE_UP;
- case AKEYCODE_PAGE_DOWN: return NS_VK_PAGE_DOWN;
- // KEYCODE_PICTSYMBOLS (94) ... KEYCODE_BUTTON_MODE (110)
- case AKEYCODE_ESCAPE: return NS_VK_ESCAPE;
- case AKEYCODE_FORWARD_DEL: return NS_VK_DELETE;
- case AKEYCODE_CTRL_LEFT: return NS_VK_CONTROL;
- case AKEYCODE_CTRL_RIGHT: return NS_VK_CONTROL;
- case AKEYCODE_CAPS_LOCK: return NS_VK_CAPS_LOCK;
- case AKEYCODE_SCROLL_LOCK: return NS_VK_SCROLL_LOCK;
- // KEYCODE_META_LEFT (117) ... KEYCODE_FUNCTION (119)
- case AKEYCODE_SYSRQ: return NS_VK_PRINTSCREEN;
- case AKEYCODE_BREAK: return NS_VK_PAUSE;
- case AKEYCODE_MOVE_HOME: return NS_VK_HOME;
- case AKEYCODE_MOVE_END: return NS_VK_END;
- case AKEYCODE_INSERT: return NS_VK_INSERT;
- // KEYCODE_FORWARD (125) ... KEYCODE_MEDIA_RECORD (130)
- case AKEYCODE_F1: return NS_VK_F1;
- case AKEYCODE_F2: return NS_VK_F2;
- case AKEYCODE_F3: return NS_VK_F3;
- case AKEYCODE_F4: return NS_VK_F4;
- case AKEYCODE_F5: return NS_VK_F5;
- case AKEYCODE_F6: return NS_VK_F6;
- case AKEYCODE_F7: return NS_VK_F7;
- case AKEYCODE_F8: return NS_VK_F8;
- case AKEYCODE_F9: return NS_VK_F9;
- case AKEYCODE_F10: return NS_VK_F10;
- case AKEYCODE_F11: return NS_VK_F11;
- case AKEYCODE_F12: return NS_VK_F12;
- case AKEYCODE_NUM_LOCK: return NS_VK_NUM_LOCK;
- case AKEYCODE_NUMPAD_0: return NS_VK_NUMPAD0;
- case AKEYCODE_NUMPAD_1: return NS_VK_NUMPAD1;
- case AKEYCODE_NUMPAD_2: return NS_VK_NUMPAD2;
- case AKEYCODE_NUMPAD_3: return NS_VK_NUMPAD3;
- case AKEYCODE_NUMPAD_4: return NS_VK_NUMPAD4;
- case AKEYCODE_NUMPAD_5: return NS_VK_NUMPAD5;
- case AKEYCODE_NUMPAD_6: return NS_VK_NUMPAD6;
- case AKEYCODE_NUMPAD_7: return NS_VK_NUMPAD7;
- case AKEYCODE_NUMPAD_8: return NS_VK_NUMPAD8;
- case AKEYCODE_NUMPAD_9: return NS_VK_NUMPAD9;
- case AKEYCODE_NUMPAD_DIVIDE: return NS_VK_DIVIDE;
- case AKEYCODE_NUMPAD_MULTIPLY: return NS_VK_MULTIPLY;
- case AKEYCODE_NUMPAD_SUBTRACT: return NS_VK_SUBTRACT;
- case AKEYCODE_NUMPAD_ADD: return NS_VK_ADD;
- case AKEYCODE_NUMPAD_DOT: return NS_VK_DECIMAL;
- case AKEYCODE_NUMPAD_COMMA: return NS_VK_SEPARATOR;
- case AKEYCODE_NUMPAD_ENTER: return NS_VK_RETURN;
- case AKEYCODE_NUMPAD_EQUALS: return NS_VK_EQUALS;
- // KEYCODE_NUMPAD_LEFT_PAREN (162) ... KEYCODE_CALCULATOR (210)
-
- // Needs to confirm the behavior. If the key switches the open state
- // of Japanese IME (or switches input character between Hiragana and
- // Roman numeric characters), then, it might be better to use
- // NS_VK_KANJI which is used for Alt+Zenkaku/Hankaku key on Windows.
- case AKEYCODE_ZENKAKU_HANKAKU: return 0;
- case AKEYCODE_EISU: return NS_VK_EISU;
- case AKEYCODE_MUHENKAN: return NS_VK_NONCONVERT;
- case AKEYCODE_HENKAN: return NS_VK_CONVERT;
- case AKEYCODE_KATAKANA_HIRAGANA: return 0;
- case AKEYCODE_YEN: return NS_VK_BACK_SLASH; // Same as other platforms.
- case AKEYCODE_RO: return NS_VK_BACK_SLASH; // Same as other platforms.
- case AKEYCODE_KANA: return NS_VK_KANA;
- case AKEYCODE_ASSIST: return NS_VK_HELP;
-
- // the A key is the action key for gamepad devices.
- case AKEYCODE_BUTTON_A: return NS_VK_RETURN;
-
- default:
- ALOG("ConvertAndroidKeyCodeToDOMKeyCode: "
- "No DOM keycode for Android keycode %d", androidKeyCode);
- return 0;
- }
-}
-
-static KeyNameIndex
-ConvertAndroidKeyCodeToKeyNameIndex(int keyCode, int action,
- int domPrintableKeyValue)
-{
- // Special-case alphanumeric keycodes because they are most common.
- if (keyCode >= AKEYCODE_A && keyCode <= AKEYCODE_Z) {
- return KEY_NAME_INDEX_USE_STRING;
- }
-
- if (keyCode >= AKEYCODE_0 && keyCode <= AKEYCODE_9) {
- return KEY_NAME_INDEX_USE_STRING;
- }
-
- switch (keyCode) {
-
-#define NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX(aNativeKey, aKeyNameIndex) \
- case aNativeKey: return aKeyNameIndex;
-
-#include "NativeKeyToDOMKeyName.h"
-
-#undef NS_NATIVE_KEY_TO_DOM_KEY_NAME_INDEX
-
- // KEYCODE_0 (7) ... KEYCODE_9 (16)
- case AKEYCODE_STAR: // '*' key
- case AKEYCODE_POUND: // '#' key
-
- // KEYCODE_A (29) ... KEYCODE_Z (54)
-
- case AKEYCODE_COMMA: // ',' key
- case AKEYCODE_PERIOD: // '.' key
- case AKEYCODE_SPACE:
- case AKEYCODE_GRAVE: // '`' key
- case AKEYCODE_MINUS: // '-' key
- case AKEYCODE_EQUALS: // '=' key
- case AKEYCODE_LEFT_BRACKET: // '[' key
- case AKEYCODE_RIGHT_BRACKET: // ']' key
- case AKEYCODE_BACKSLASH: // '\' key
- case AKEYCODE_SEMICOLON: // ';' key
- case AKEYCODE_APOSTROPHE: // ''' key
- case AKEYCODE_SLASH: // '/' key
- case AKEYCODE_AT: // '@' key
- case AKEYCODE_PLUS: // '+' key
-
- case AKEYCODE_NUMPAD_0:
- case AKEYCODE_NUMPAD_1:
- case AKEYCODE_NUMPAD_2:
- case AKEYCODE_NUMPAD_3:
- case AKEYCODE_NUMPAD_4:
- case AKEYCODE_NUMPAD_5:
- case AKEYCODE_NUMPAD_6:
- case AKEYCODE_NUMPAD_7:
- case AKEYCODE_NUMPAD_8:
- case AKEYCODE_NUMPAD_9:
- case AKEYCODE_NUMPAD_DIVIDE:
- case AKEYCODE_NUMPAD_MULTIPLY:
- case AKEYCODE_NUMPAD_SUBTRACT:
- case AKEYCODE_NUMPAD_ADD:
- case AKEYCODE_NUMPAD_DOT:
- case AKEYCODE_NUMPAD_COMMA:
- case AKEYCODE_NUMPAD_EQUALS:
- case AKEYCODE_NUMPAD_LEFT_PAREN:
- case AKEYCODE_NUMPAD_RIGHT_PAREN:
-
- case AKEYCODE_YEN: // yen sign key
- case AKEYCODE_RO: // Japanese Ro key
- return KEY_NAME_INDEX_USE_STRING;
-
- case AKEYCODE_ENDCALL:
- case AKEYCODE_NUM: // XXX Not sure
- case AKEYCODE_HEADSETHOOK:
- case AKEYCODE_NOTIFICATION: // XXX Not sure
- case AKEYCODE_PICTSYMBOLS:
-
- case AKEYCODE_BUTTON_A:
- case AKEYCODE_BUTTON_B:
- case AKEYCODE_BUTTON_C:
- case AKEYCODE_BUTTON_X:
- case AKEYCODE_BUTTON_Y:
- case AKEYCODE_BUTTON_Z:
- case AKEYCODE_BUTTON_L1:
- case AKEYCODE_BUTTON_R1:
- case AKEYCODE_BUTTON_L2:
- case AKEYCODE_BUTTON_R2:
- case AKEYCODE_BUTTON_THUMBL:
- case AKEYCODE_BUTTON_THUMBR:
- case AKEYCODE_BUTTON_START:
- case AKEYCODE_BUTTON_SELECT:
- case AKEYCODE_BUTTON_MODE:
-
- case AKEYCODE_MUTE: // mutes the microphone
- case AKEYCODE_MEDIA_CLOSE:
-
- case AKEYCODE_DVR:
-
- case AKEYCODE_BUTTON_1:
- case AKEYCODE_BUTTON_2:
- case AKEYCODE_BUTTON_3:
- case AKEYCODE_BUTTON_4:
- case AKEYCODE_BUTTON_5:
- case AKEYCODE_BUTTON_6:
- case AKEYCODE_BUTTON_7:
- case AKEYCODE_BUTTON_8:
- case AKEYCODE_BUTTON_9:
- case AKEYCODE_BUTTON_10:
- case AKEYCODE_BUTTON_11:
- case AKEYCODE_BUTTON_12:
- case AKEYCODE_BUTTON_13:
- case AKEYCODE_BUTTON_14:
- case AKEYCODE_BUTTON_15:
- case AKEYCODE_BUTTON_16:
-
- case AKEYCODE_MANNER_MODE:
- case AKEYCODE_3D_MODE:
- case AKEYCODE_CONTACTS:
- return KEY_NAME_INDEX_Unidentified;
-
- case AKEYCODE_UNKNOWN:
- MOZ_ASSERT(
- action != AKEY_EVENT_ACTION_MULTIPLE,
- "Don't call this when action is AKEY_EVENT_ACTION_MULTIPLE!");
- // It's actually an unknown key if the action isn't ACTION_MULTIPLE.
- // However, it might cause text input. So, let's check the value.
- return domPrintableKeyValue ?
- KEY_NAME_INDEX_USE_STRING : KEY_NAME_INDEX_Unidentified;
-
- default:
- ALOG("ConvertAndroidKeyCodeToKeyNameIndex: "
- "No DOM key name index for Android keycode %d", keyCode);
- return KEY_NAME_INDEX_Unidentified;
- }
-}
-
-static CodeNameIndex
-ConvertAndroidScanCodeToCodeNameIndex(int scanCode)
-{
- switch (scanCode) {
-
-#define NS_NATIVE_KEY_TO_DOM_CODE_NAME_INDEX(aNativeKey, aCodeNameIndex) \
- case aNativeKey: return aCodeNameIndex;
-
-#include "NativeKeyToDOMCodeName.h"
-
-#undef NS_NATIVE_KEY_TO_DOM_CODE_NAME_INDEX
-
- default:
- return CODE_NAME_INDEX_UNKNOWN;
- }
-}
-
-static bool
-IsModifierKey(int32_t keyCode)
-{
- using mozilla::java::sdk::KeyEvent;
- return keyCode == KeyEvent::KEYCODE_ALT_LEFT ||
- keyCode == KeyEvent::KEYCODE_ALT_RIGHT ||
- keyCode == KeyEvent::KEYCODE_SHIFT_LEFT ||
- keyCode == KeyEvent::KEYCODE_SHIFT_RIGHT ||
- keyCode == KeyEvent::KEYCODE_CTRL_LEFT ||
- keyCode == KeyEvent::KEYCODE_CTRL_RIGHT ||
- keyCode == KeyEvent::KEYCODE_META_LEFT ||
- keyCode == KeyEvent::KEYCODE_META_RIGHT;
-}
-
-static Modifiers
-GetModifiers(int32_t metaState)
-{
- using mozilla::java::sdk::KeyEvent;
- return (metaState & KeyEvent::META_ALT_MASK ? MODIFIER_ALT : 0)
- | (metaState & KeyEvent::META_SHIFT_MASK ? MODIFIER_SHIFT : 0)
- | (metaState & KeyEvent::META_CTRL_MASK ? MODIFIER_CONTROL : 0)
- | (metaState & KeyEvent::META_META_MASK ? MODIFIER_META : 0)
- | (metaState & KeyEvent::META_FUNCTION_ON ? MODIFIER_FN : 0)
- | (metaState & KeyEvent::META_CAPS_LOCK_ON ? MODIFIER_CAPSLOCK : 0)
- | (metaState & KeyEvent::META_NUM_LOCK_ON ? MODIFIER_NUMLOCK : 0)
- | (metaState & KeyEvent::META_SCROLL_LOCK_ON ? MODIFIER_SCROLLLOCK : 0);
-}
-
-static void
-InitKeyEvent(WidgetKeyboardEvent& event,
- int32_t action, int32_t keyCode, int32_t scanCode,
- int32_t metaState, int64_t time, int32_t unicodeChar,
- int32_t baseUnicodeChar, int32_t domPrintableKeyValue,
- int32_t repeatCount, int32_t flags)
-{
- const uint32_t domKeyCode = ConvertAndroidKeyCodeToDOMKeyCode(keyCode);
- const int32_t charCode = unicodeChar ? unicodeChar : baseUnicodeChar;
-
- event.mModifiers = GetModifiers(metaState);
-
- if (event.mMessage == eKeyPress) {
- // Android gives us \n, so filter out some control characters.
- event.mIsChar = (charCode >= ' ');
- event.mCharCode = event.mIsChar ? charCode : 0;
- event.mKeyCode = event.mIsChar ? 0 : domKeyCode;
- event.mPluginEvent.Clear();
-
- // For keypress, if the unicode char already has modifiers applied, we
- // don't specify extra modifiers. If UnicodeChar() != BaseUnicodeChar()
- // it means UnicodeChar() already has modifiers applied.
- // Note that on Android 4.x, Alt modifier isn't set when the key input
- // causes text input even while right Alt key is pressed. However,
- // this is necessary for Android 2.3 compatibility.
- if (unicodeChar && unicodeChar != baseUnicodeChar) {
- event.mModifiers &= ~(MODIFIER_ALT | MODIFIER_CONTROL
- | MODIFIER_META);
- }
-
- } else {
- event.mIsChar = false;
- event.mCharCode = 0;
- event.mKeyCode = domKeyCode;
-
- ANPEvent pluginEvent;
- pluginEvent.inSize = sizeof(pluginEvent);
- pluginEvent.eventType = kKey_ANPEventType;
- pluginEvent.data.key.action = event.mMessage == eKeyDown
- ? kDown_ANPKeyAction : kUp_ANPKeyAction;
- pluginEvent.data.key.nativeCode = keyCode;
- pluginEvent.data.key.virtualCode = domKeyCode;
- pluginEvent.data.key.unichar = charCode;
- pluginEvent.data.key.modifiers =
- (metaState & sdk::KeyEvent::META_SHIFT_MASK
- ? kShift_ANPKeyModifier : 0) |
- (metaState & sdk::KeyEvent::META_ALT_MASK
- ? kAlt_ANPKeyModifier : 0);
- pluginEvent.data.key.repeatCount = repeatCount;
- event.mPluginEvent.Copy(pluginEvent);
- }
-
- event.mIsRepeat =
- (event.mMessage == eKeyDown || event.mMessage == eKeyPress) &&
- ((flags & sdk::KeyEvent::FLAG_LONG_PRESS) || repeatCount);
-
- event.mKeyNameIndex = ConvertAndroidKeyCodeToKeyNameIndex(
- keyCode, action, domPrintableKeyValue);
- event.mCodeNameIndex = ConvertAndroidScanCodeToCodeNameIndex(scanCode);
-
- if (event.mKeyNameIndex == KEY_NAME_INDEX_USE_STRING &&
- domPrintableKeyValue) {
- event.mKeyValue = char16_t(domPrintableKeyValue);
- }
-
- event.mLocation =
- WidgetKeyboardEvent::ComputeLocationFromCodeValue(event.mCodeNameIndex);
- event.mTime = time;
-}
-
-void
-nsWindow::GeckoViewSupport::OnKeyEvent(int32_t aAction, int32_t aKeyCode,
- int32_t aScanCode, int32_t aMetaState, int64_t aTime,
- int32_t aUnicodeChar, int32_t aBaseUnicodeChar,
- int32_t aDomPrintableKeyValue, int32_t aRepeatCount, int32_t aFlags,
- bool aIsSynthesizedImeKey, jni::Object::Param originalEvent)
-{
- RefPtr<nsWindow> kungFuDeathGrip(&window);
- if (!aIsSynthesizedImeKey) {
- window.UserActivity();
- window.RemoveIMEComposition();
- }
-
- EventMessage msg;
- if (aAction == sdk::KeyEvent::ACTION_DOWN) {
- msg = eKeyDown;
- } else if (aAction == sdk::KeyEvent::ACTION_UP) {
- msg = eKeyUp;
- } else if (aAction == sdk::KeyEvent::ACTION_MULTIPLE) {
- // Keys with multiple action are handled in Java,
- // and we should never see one here
- MOZ_CRASH("Cannot handle key with multiple action");
- } else {
- ALOG("Unknown key action event!");
- return;
- }
-
- nsEventStatus status = nsEventStatus_eIgnore;
- WidgetKeyboardEvent event(true, msg, &window);
- window.InitEvent(event, nullptr);
- InitKeyEvent(event, aAction, aKeyCode, aScanCode, aMetaState, aTime,
- aUnicodeChar, aBaseUnicodeChar, aDomPrintableKeyValue,
- aRepeatCount, aFlags);
-
- if (aIsSynthesizedImeKey) {
- // Keys synthesized by Java IME code are saved in the mIMEKeyEvents
- // array until the next IME_REPLACE_TEXT event, at which point
- // these keys are dispatched in sequence.
- mIMEKeyEvents.AppendElement(
- mozilla::UniquePtr<WidgetEvent>(event.Duplicate()));
-
- } else {
- window.DispatchEvent(&event, status);
-
- if (window.Destroyed() || status == nsEventStatus_eConsumeNoDefault) {
- // Skip default processing.
- return;
- }
-
- mEditable->OnDefaultKeyEvent(originalEvent);
- }
-
- if (msg != eKeyDown || IsModifierKey(aKeyCode)) {
- // Skip sending key press event.
- return;
- }
-
- WidgetKeyboardEvent pressEvent(true, eKeyPress, &window);
- window.InitEvent(pressEvent, nullptr);
- InitKeyEvent(pressEvent, aAction, aKeyCode, aScanCode, aMetaState, aTime,
- aUnicodeChar, aBaseUnicodeChar, aDomPrintableKeyValue,
- aRepeatCount, aFlags);
-
- if (aIsSynthesizedImeKey) {
- mIMEKeyEvents.AppendElement(
- mozilla::UniquePtr<WidgetEvent>(pressEvent.Duplicate()));
- } else {
- window.DispatchEvent(&pressEvent, status);
- }
-}
-
-#ifdef DEBUG_ANDROID_IME
-#define ALOGIME(args...) ALOG(args)
-#else
-#define ALOGIME(args...) ((void)0)
-#endif
-
-static nscolor
-ConvertAndroidColor(uint32_t aArgb)
-{
- return NS_RGBA((aArgb & 0x00ff0000) >> 16,
- (aArgb & 0x0000ff00) >> 8,
- (aArgb & 0x000000ff),
- (aArgb & 0xff000000) >> 24);
-}
-
-/*
- * Get the current composition object, if any.
- */
-RefPtr<mozilla::TextComposition>
-nsWindow::GetIMEComposition()
-{
- MOZ_ASSERT(this == FindTopLevel());
- return mozilla::IMEStateManager::GetTextCompositionFor(this);
-}
-
-/*
- Remove the composition but leave the text content as-is
-*/
-void
-nsWindow::RemoveIMEComposition(RemoveIMECompositionFlag aFlag)
-{
- // Remove composition on Gecko side
- const RefPtr<mozilla::TextComposition> composition(GetIMEComposition());
- if (!composition) {
- return;
- }
-
- RefPtr<nsWindow> kungFuDeathGrip(this);
-
- WidgetCompositionEvent compositionCommitEvent(
- true, eCompositionCommit, this);
- if (aFlag == COMMIT_IME_COMPOSITION) {
- compositionCommitEvent.mMessage = eCompositionCommitAsIs;
- }
- InitEvent(compositionCommitEvent, nullptr);
- DispatchEvent(&compositionCommitEvent);
-}
-
-/*
- * Send dummy key events for pages that are unaware of input events,
- * to provide web compatibility for pages that depend on key events.
- * Our dummy key events have 0 as the keycode.
- */
-void
-nsWindow::GeckoViewSupport::SendIMEDummyKeyEvents()
-{
- WidgetKeyboardEvent downEvent(true, eKeyDown, &window);
- window.InitEvent(downEvent, nullptr);
- MOZ_ASSERT(downEvent.mKeyCode == 0);
- window.DispatchEvent(&downEvent);
-
- WidgetKeyboardEvent upEvent(true, eKeyUp, &window);
- window.InitEvent(upEvent, nullptr);
- MOZ_ASSERT(upEvent.mKeyCode == 0);
- window.DispatchEvent(&upEvent);
-}
-
-void
-nsWindow::GeckoViewSupport::AddIMETextChange(const IMETextChange& aChange)
-{
- mIMETextChanges.AppendElement(aChange);
-
- // We may not be in the middle of flushing,
- // in which case this flag is meaningless.
- mIMETextChangedDuringFlush = true;
-
- // Now that we added a new range we need to go back and
- // update all the ranges before that.
- // Ranges that have offsets which follow this new range
- // need to be updated to reflect new offsets
- const int32_t delta = aChange.mNewEnd - aChange.mOldEnd;
- for (int32_t i = mIMETextChanges.Length() - 2; i >= 0; i--) {
- IMETextChange& previousChange = mIMETextChanges[i];
- if (previousChange.mStart > aChange.mOldEnd) {
- previousChange.mStart += delta;
- previousChange.mOldEnd += delta;
- previousChange.mNewEnd += delta;
- }
- }
-
- // Now go through all ranges to merge any ranges that are connected
- // srcIndex is the index of the range to merge from
- // dstIndex is the index of the range to potentially merge into
- int32_t srcIndex = mIMETextChanges.Length() - 1;
- int32_t dstIndex = srcIndex;
-
- while (--dstIndex >= 0) {
- IMETextChange& src = mIMETextChanges[srcIndex];
- IMETextChange& dst = mIMETextChanges[dstIndex];
- // When merging a more recent change into an older
- // change, we need to compare recent change's (start, oldEnd)
- // range to the older change's (start, newEnd)
- if (src.mOldEnd < dst.mStart || dst.mNewEnd < src.mStart) {
- // No overlap between ranges
- continue;
- }
- // When merging two ranges, there are generally four posibilities:
- // [----(----]----), (----[----]----),
- // [----(----)----], (----[----)----]
- // where [----] is the first range and (----) is the second range
- // As seen above, the start of the merged range is always the lesser
- // of the two start offsets. OldEnd and NewEnd then need to be
- // adjusted separately depending on the case. In any case, the change
- // in text length of the merged range should be the sum of text length
- // changes of the two original ranges, i.e.,
- // newNewEnd - newOldEnd == newEnd1 - oldEnd1 + newEnd2 - oldEnd2
- dst.mStart = std::min(dst.mStart, src.mStart);
- if (src.mOldEnd < dst.mNewEnd) {
- // New range overlaps or is within previous range; merge
- dst.mNewEnd += src.mNewEnd - src.mOldEnd;
- } else { // src.mOldEnd >= dst.mNewEnd
- // New range overlaps previous range; merge
- dst.mOldEnd += src.mOldEnd - dst.mNewEnd;
- dst.mNewEnd = src.mNewEnd;
- }
- // src merged to dst; delete src.
- mIMETextChanges.RemoveElementAt(srcIndex);
- // Any ranges that we skip over between src and dst are not mergeable
- // so we can safely continue the merge starting at dst
- srcIndex = dstIndex;
- }
-}
-
-void
-nsWindow::GeckoViewSupport::PostFlushIMEChanges()
-{
- if (!mIMETextChanges.IsEmpty() || mIMESelectionChanged) {
- // Already posted
- return;
- }
-
- // Keep a strong reference to the window to keep 'this' alive.
- RefPtr<nsWindow> window(&this->window);
-
- nsAppShell::PostEvent([this, window] {
- if (!window->Destroyed()) {
- FlushIMEChanges();
- }
- });
-}
-
-void
-nsWindow::GeckoViewSupport::FlushIMEChanges(FlushChangesFlag aFlags)
-{
- // Only send change notifications if we are *not* masking events,
- // i.e. if we have a focused editor,
- NS_ENSURE_TRUE_VOID(!mIMEMaskEventsCount);
-
- nsCOMPtr<nsISelection> imeSelection;
- nsCOMPtr<nsIContent> imeRoot;
-
- // If we are receiving notifications, we must have selection/root content.
- MOZ_ALWAYS_SUCCEEDS(IMEStateManager::GetFocusSelectionAndRoot(
- getter_AddRefs(imeSelection), getter_AddRefs(imeRoot)));
-
- // Make sure we still have a valid selection/root. We can potentially get
- // a stale selection/root if the editor becomes hidden, for example.
- NS_ENSURE_TRUE_VOID(imeRoot->IsInComposedDoc());
-
- RefPtr<nsWindow> kungFuDeathGrip(&window);
- window.UserActivity();
-
- struct TextRecord {
- nsString text;
- int32_t start;
- int32_t oldEnd;
- int32_t newEnd;
- };
- AutoTArray<TextRecord, 4> textTransaction;
- if (mIMETextChanges.Length() > textTransaction.Capacity()) {
- textTransaction.SetCapacity(mIMETextChanges.Length());
- }
-
- mIMETextChangedDuringFlush = false;
-
- auto shouldAbort = [=] () -> bool {
- if (!mIMETextChangedDuringFlush) {
- return false;
- }
- // A query event could have triggered more text changes to come in, as
- // indicated by our flag. If that happens, try flushing IME changes
- // again.
- if (aFlags == FLUSH_FLAG_NONE) {
- FlushIMEChanges(FLUSH_FLAG_RETRY);
- } else {
- // Don't retry if already retrying, to avoid infinite loops.
- __android_log_print(ANDROID_LOG_WARN, "GeckoViewSupport",
- "Already retrying IME flush");
- }
- return true;
- };
-
- for (const IMETextChange &change : mIMETextChanges) {
- if (change.mStart == change.mOldEnd &&
- change.mStart == change.mNewEnd) {
- continue;
- }
-
- WidgetQueryContentEvent event(true, eQueryTextContent, &window);
-
- if (change.mNewEnd != change.mStart) {
- window.InitEvent(event, nullptr);
- event.InitForQueryTextContent(change.mStart,
- change.mNewEnd - change.mStart);
- window.DispatchEvent(&event);
- NS_ENSURE_TRUE_VOID(event.mSucceeded);
- NS_ENSURE_TRUE_VOID(event.mReply.mContentsRoot == imeRoot.get());
- }
-
- if (shouldAbort()) {
- return;
- }
-
- textTransaction.AppendElement(
- TextRecord{event.mReply.mString, change.mStart,
- change.mOldEnd, change.mNewEnd});
- }
-
- int32_t selStart = -1;
- int32_t selEnd = -1;
-
- if (mIMESelectionChanged) {
- WidgetQueryContentEvent event(true, eQuerySelectedText, &window);
- window.InitEvent(event, nullptr);
- window.DispatchEvent(&event);
-
- NS_ENSURE_TRUE_VOID(event.mSucceeded);
- NS_ENSURE_TRUE_VOID(event.mReply.mContentsRoot == imeRoot.get());
-
- if (shouldAbort()) {
- return;
- }
-
- selStart = int32_t(event.GetSelectionStart());
- selEnd = int32_t(event.GetSelectionEnd());
- }
-
- JNIEnv* const env = jni::GetGeckoThreadEnv();
- auto flushOnException = [=] () -> bool {
- if (!env->ExceptionCheck()) {
- return false;
- }
- if (aFlags != FLUSH_FLAG_RECOVER) {
- // First time seeing an exception; try flushing text.
- env->ExceptionClear();
- __android_log_print(ANDROID_LOG_WARN, "GeckoViewSupport",
- "Recovering from IME exception");
- FlushIMEText(FLUSH_FLAG_RECOVER);
- } else {
- // Give up because we've already tried.
- MOZ_CATCH_JNI_EXCEPTION(env);
- }
- return true;
- };
-
- // Commit the text change and selection change transaction.
- mIMETextChanges.Clear();
-
- for (const TextRecord& record : textTransaction) {
- mEditable->OnTextChange(record.text, record.start,
- record.oldEnd, record.newEnd);
- if (flushOnException()) {
- return;
- }
- }
-
- if (mIMESelectionChanged) {
- mIMESelectionChanged = false;
- mEditable->OnSelectionChange(selStart, selEnd);
- flushOnException();
- }
-}
-
-void
-nsWindow::GeckoViewSupport::FlushIMEText(FlushChangesFlag aFlags)
-{
- // Notify Java of the newly focused content
- mIMETextChanges.Clear();
- mIMESelectionChanged = true;
-
- // Use 'INT32_MAX / 2' here because subsequent text changes might combine
- // with this text change, and overflow might occur if we just use
- // INT32_MAX.
- IMENotification notification(NOTIFY_IME_OF_TEXT_CHANGE);
- notification.mTextChangeData.mStartOffset = 0;
- notification.mTextChangeData.mRemovedEndOffset = INT32_MAX / 2;
- notification.mTextChangeData.mAddedEndOffset = INT32_MAX / 2;
- NotifyIME(notification);
-
- FlushIMEChanges(aFlags);
-}
-
-static jni::ObjectArray::LocalRef
-ConvertRectArrayToJavaRectFArray(JNIEnv* aJNIEnv, const nsTArray<LayoutDeviceIntRect>& aRects, const LayoutDeviceIntPoint& aOffset, const CSSToLayoutDeviceScale aScale)
-{
- size_t length = aRects.Length();
- jobjectArray rects = aJNIEnv->NewObjectArray(length, sdk::RectF::Context().ClassRef(), nullptr);
- auto rectsRef = jni::ObjectArray::LocalRef::Adopt(aJNIEnv, rects);
- for (size_t i = 0; i < length; i++) {
- sdk::RectF::LocalRef rect(aJNIEnv);
- LayoutDeviceIntRect tmp = aRects[i] + aOffset;
- sdk::RectF::New(tmp.x / aScale.scale, tmp.y / aScale.scale,
- (tmp.x + tmp.width) / aScale.scale,
- (tmp.y + tmp.height) / aScale.scale,
- &rect);
- rectsRef->SetElement(i, rect);
- }
- return rectsRef;
-}
-
-void
-nsWindow::GeckoViewSupport::UpdateCompositionRects()
-{
- const auto composition(window.GetIMEComposition());
- if (NS_WARN_IF(!composition)) {
- return;
- }
-
- uint32_t offset = composition->NativeOffsetOfStartComposition();
- WidgetQueryContentEvent textRects(true, eQueryTextRectArray, &window);
- textRects.InitForQueryTextRectArray(offset, composition->String().Length());
- window.DispatchEvent(&textRects);
-
- auto rects =
- ConvertRectArrayToJavaRectFArray(jni::GetGeckoThreadEnv(),
- textRects.mReply.mRectArray,
- window.WidgetToScreenOffset(),
- window.GetDefaultScale());
-
- mEditable->UpdateCompositionRects(rects);
-}
-
-void
-nsWindow::GeckoViewSupport::AsyncNotifyIME(int32_t aNotification)
-{
- // Keep a strong reference to the window to keep 'this' alive.
- RefPtr<nsWindow> window(&this->window);
-
- nsAppShell::PostEvent([this, window, aNotification] {
- if (mIMEMaskEventsCount) {
- return;
- }
-
- mEditable->NotifyIME(aNotification);
- });
-}
-
-bool
-nsWindow::GeckoViewSupport::NotifyIME(const IMENotification& aIMENotification)
-{
- MOZ_ASSERT(mEditable);
-
- switch (aIMENotification.mMessage) {
- case REQUEST_TO_COMMIT_COMPOSITION: {
- ALOGIME("IME: REQUEST_TO_COMMIT_COMPOSITION");
-
- window.RemoveIMEComposition();
-
- AsyncNotifyIME(GeckoEditableListener::
- NOTIFY_IME_TO_COMMIT_COMPOSITION);
- return true;
- }
-
- case REQUEST_TO_CANCEL_COMPOSITION: {
- ALOGIME("IME: REQUEST_TO_CANCEL_COMPOSITION");
-
- window.RemoveIMEComposition(CANCEL_IME_COMPOSITION);
-
- AsyncNotifyIME(GeckoEditableListener::
- NOTIFY_IME_TO_CANCEL_COMPOSITION);
- return true;
- }
-
- case NOTIFY_IME_OF_FOCUS: {
- ALOGIME("IME: NOTIFY_IME_OF_FOCUS");
- // Keep a strong reference to the window to keep 'this' alive.
- RefPtr<nsWindow> window(&this->window);
-
- // Post an event because we have to flush the text before sending a
- // focus event, and we may not be able to flush text during the
- // NotifyIME call.
- nsAppShell::PostEvent([this, window] {
- --mIMEMaskEventsCount;
- if (mIMEMaskEventsCount || window->Destroyed()) {
- return;
- }
-
- FlushIMEText();
-
- // IME will call requestCursorUpdates after getting context.
- // So reset cursor update mode before getting context.
- mIMEMonitorCursor = false;
-
- MOZ_ASSERT(mEditable);
- mEditable->NotifyIME(GeckoEditableListener::NOTIFY_IME_OF_FOCUS);
- });
- return true;
- }
-
- case NOTIFY_IME_OF_BLUR: {
- ALOGIME("IME: NOTIFY_IME_OF_BLUR");
-
- if (!mIMEMaskEventsCount) {
- mEditable->NotifyIME(GeckoEditableListener::NOTIFY_IME_OF_BLUR);
- }
-
- // Mask events because we lost focus. Unmask on the next focus.
- mIMEMaskEventsCount++;
- return true;
- }
-
- case NOTIFY_IME_OF_SELECTION_CHANGE: {
- ALOGIME("IME: NOTIFY_IME_OF_SELECTION_CHANGE");
-
- PostFlushIMEChanges();
- mIMESelectionChanged = true;
- return true;
- }
-
- case NOTIFY_IME_OF_TEXT_CHANGE: {
- ALOGIME("IME: NotifyIMEOfTextChange: s=%d, oe=%d, ne=%d",
- aIMENotification.mTextChangeData.mStartOffset,
- aIMENotification.mTextChangeData.mRemovedEndOffset,
- aIMENotification.mTextChangeData.mAddedEndOffset);
-
- /* Make sure Java's selection is up-to-date */
- PostFlushIMEChanges();
- mIMESelectionChanged = true;
- AddIMETextChange(IMETextChange(aIMENotification));
- return true;
- }
-
- case NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED: {
- ALOGIME("IME: NOTIFY_IME_OF_COMPOSITION_EVENT_HANDLED");
-
- // Hardware keyboard support requires each string rect.
- if (AndroidBridge::Bridge() && AndroidBridge::Bridge()->GetAPIVersion() >= 21 && mIMEMonitorCursor) {
- UpdateCompositionRects();
- }
- return true;
- }
-
- default:
- return false;
- }
-}
-
-void
-nsWindow::GeckoViewSupport::SetInputContext(const InputContext& aContext,
- const InputContextAction& aAction)
-{
- MOZ_ASSERT(mEditable);
-
- ALOGIME("IME: SetInputContext: s=0x%X, 0x%X, action=0x%X, 0x%X",
- aContext.mIMEState.mEnabled, aContext.mIMEState.mOpen,
- aAction.mCause, aAction.mFocusChange);
-
- // Ensure that opening the virtual keyboard is allowed for this specific
- // InputContext depending on the content.ime.strict.policy pref
- if (aContext.mIMEState.mEnabled != IMEState::DISABLED &&
- aContext.mIMEState.mEnabled != IMEState::PLUGIN &&
- Preferences::GetBool("content.ime.strict_policy", false) &&
- !aAction.ContentGotFocusByTrustedCause() &&
- !aAction.UserMightRequestOpenVKB()) {
- return;
- }
-
- IMEState::Enabled enabled = aContext.mIMEState.mEnabled;
-
- // Only show the virtual keyboard for plugins if mOpen is set appropriately.
- // This avoids showing it whenever a plugin is focused. Bug 747492
- if (aContext.mIMEState.mEnabled == IMEState::PLUGIN &&
- aContext.mIMEState.mOpen != IMEState::OPEN) {
- enabled = IMEState::DISABLED;
- }
-
- mInputContext = aContext;
- mInputContext.mIMEState.mEnabled = enabled;
-
- if (enabled == IMEState::ENABLED && aAction.UserMightRequestOpenVKB()) {
- // Don't reset keyboard when we should simply open the vkb
- mEditable->NotifyIME(GeckoEditableListener::NOTIFY_IME_OPEN_VKB);
- return;
- }
-
- if (mIMEUpdatingContext) {
- return;
- }
-
- // Keep a strong reference to the window to keep 'this' alive.
- RefPtr<nsWindow> window(&this->window);
- mIMEUpdatingContext = true;
-
- nsAppShell::PostEvent([this, window] {
- mIMEUpdatingContext = false;
- if (window->Destroyed()) {
- return;
- }
- MOZ_ASSERT(mEditable);
- mEditable->NotifyIMEContext(mInputContext.mIMEState.mEnabled,
- mInputContext.mHTMLInputType,
- mInputContext.mHTMLInputInputmode,
- mInputContext.mActionHint);
- });
-}
-
-InputContext
-nsWindow::GeckoViewSupport::GetInputContext()
-{
- InputContext context = mInputContext;
- context.mIMEState.mOpen = IMEState::OPEN_STATE_NOT_SUPPORTED;
- return context;
-}
-
-void
-nsWindow::GeckoViewSupport::OnImeSynchronize()
-{
- if (!mIMEMaskEventsCount) {
- FlushIMEChanges();
- }
- mEditable->NotifyIME(GeckoEditableListener::NOTIFY_IME_REPLY_EVENT);
-}
-
-void
-nsWindow::GeckoViewSupport::OnImeReplaceText(int32_t aStart, int32_t aEnd,
- jni::String::Param aText)
-{
- AutoIMESynchronize as(this);
-
- if (mIMEMaskEventsCount > 0) {
- // Not focused; still reply to events, but don't do anything else.
- return;
- }
-
- /*
- Replace text in Gecko thread from aStart to aEnd with the string text.
- */
- RefPtr<nsWindow> kungFuDeathGrip(&window);
- nsString string(aText->ToString());
-
- const auto composition(window.GetIMEComposition());
- MOZ_ASSERT(!composition || !composition->IsEditorHandlingEvent());
-
- const bool composing = !mIMERanges->IsEmpty();
-
- if (!mIMEKeyEvents.IsEmpty() || !composition ||
- uint32_t(aStart) != composition->NativeOffsetOfStartComposition() ||
- uint32_t(aEnd) != composition->NativeOffsetOfStartComposition() +
- composition->String().Length())
- {
- // Only start a new composition if we have key events,
- // if we don't have an existing composition, or
- // the replaced text does not match our composition.
- window.RemoveIMEComposition();
-
- {
- // Use text selection to set target postion(s) for
- // insert, or replace, of text.
- WidgetSelectionEvent event(true, eSetSelection, &window);
- window.InitEvent(event, nullptr);
- event.mOffset = uint32_t(aStart);
- event.mLength = uint32_t(aEnd - aStart);
- event.mExpandToClusterBoundary = false;
- event.mReason = nsISelectionListener::IME_REASON;
- window.DispatchEvent(&event);
- }
-
- if (!mIMEKeyEvents.IsEmpty()) {
- nsEventStatus status;
- for (uint32_t i = 0; i < mIMEKeyEvents.Length(); i++) {
- const auto event = static_cast<WidgetGUIEvent*>(
- mIMEKeyEvents[i].get());
- if (event->mMessage == eKeyPress &&
- status == nsEventStatus_eConsumeNoDefault) {
- MOZ_ASSERT(i > 0 &&
- mIMEKeyEvents[i - 1]->mMessage == eKeyDown);
- // The previous key down event resulted in eConsumeNoDefault
- // so we should not dispatch the current key press event.
- continue;
- }
- // widget for duplicated events is initially nullptr.
- event->mWidget = &window;
- window.DispatchEvent(event, status);
- }
- mIMEKeyEvents.Clear();
- return;
- }
-
- if (aStart != aEnd) {
- // Perform a deletion first.
- WidgetContentCommandEvent event(
- true, eContentCommandDelete, &window);
- window.InitEvent(event, nullptr);
- window.DispatchEvent(&event);
- }
-
- // Start a composition if we're not just performing a deletion.
- if (composing || !string.IsEmpty()) {
- WidgetCompositionEvent event(true, eCompositionStart, &window);
- window.InitEvent(event, nullptr);
- window.DispatchEvent(&event);
- }
-
- } else if (composition->String().Equals(string)) {
- /* If the new text is the same as the existing composition text,
- * the NS_COMPOSITION_CHANGE event does not generate a text
- * change notification. However, the Java side still expects
- * one, so we manually generate a notification. */
- IMETextChange dummyChange;
- dummyChange.mStart = aStart;
- dummyChange.mOldEnd = dummyChange.mNewEnd = aEnd;
- AddIMETextChange(dummyChange);
- }
-
- // Check composition again because previous events may have destroyed our
- // composition; in which case we should just skip the next event.
- if (window.GetIMEComposition()) {
- WidgetCompositionEvent event(true, eCompositionChange, &window);
- window.InitEvent(event, nullptr);
- event.mData = string;
-
- if (composing) {
- event.mRanges = new TextRangeArray();
- mIMERanges.swap(event.mRanges);
- } else {
- event.mMessage = eCompositionCommit;
- }
-
- window.DispatchEvent(&event);
-
- } else if (composing) {
- // Ensure IME ranges are empty.
- mIMERanges->Clear();
- }
-
- if (mInputContext.mMayBeIMEUnaware) {
- SendIMEDummyKeyEvents();
- }
-}
-
-void
-nsWindow::GeckoViewSupport::OnImeAddCompositionRange(
- int32_t aStart, int32_t aEnd, int32_t aRangeType, int32_t aRangeStyle,
- int32_t aRangeLineStyle, bool aRangeBoldLine, int32_t aRangeForeColor,
- int32_t aRangeBackColor, int32_t aRangeLineColor)
-{
- if (mIMEMaskEventsCount > 0) {
- // Not focused.
- return;
- }
-
- TextRange range;
- range.mStartOffset = aStart;
- range.mEndOffset = aEnd;
- range.mRangeType = ToTextRangeType(aRangeType);
- range.mRangeStyle.mDefinedStyles = aRangeStyle;
- range.mRangeStyle.mLineStyle = aRangeLineStyle;
- range.mRangeStyle.mIsBoldLine = aRangeBoldLine;
- range.mRangeStyle.mForegroundColor =
- ConvertAndroidColor(uint32_t(aRangeForeColor));
- range.mRangeStyle.mBackgroundColor =
- ConvertAndroidColor(uint32_t(aRangeBackColor));
- range.mRangeStyle.mUnderlineColor =
- ConvertAndroidColor(uint32_t(aRangeLineColor));
- mIMERanges->AppendElement(range);
-}
-
-void
-nsWindow::GeckoViewSupport::OnImeUpdateComposition(int32_t aStart, int32_t aEnd)
-{
- if (mIMEMaskEventsCount > 0) {
- // Not focused.
- return;
- }
-
- RefPtr<nsWindow> kungFuDeathGrip(&window);
-
- // A composition with no ranges means we want to set the selection.
- if (mIMERanges->IsEmpty()) {
- MOZ_ASSERT(aStart >= 0 && aEnd >= 0);
- window.RemoveIMEComposition();
-
- WidgetSelectionEvent selEvent(true, eSetSelection, &window);
- window.InitEvent(selEvent, nullptr);
-
- selEvent.mOffset = std::min(aStart, aEnd);
- selEvent.mLength = std::max(aStart, aEnd) - selEvent.mOffset;
- selEvent.mReversed = aStart > aEnd;
- selEvent.mExpandToClusterBoundary = false;
-
- window.DispatchEvent(&selEvent);
- return;
- }
-
- /*
- Update the composition from aStart to aEnd using
- information from added ranges. This is only used for
- visual indication and does not affect the text content.
- Only the offsets are specified and not the text content
- to eliminate the possibility of this event altering the
- text content unintentionally.
- */
- const auto composition(window.GetIMEComposition());
- MOZ_ASSERT(!composition || !composition->IsEditorHandlingEvent());
-
- WidgetCompositionEvent event(true, eCompositionChange, &window);
- window.InitEvent(event, nullptr);
-
- event.mRanges = new TextRangeArray();
- mIMERanges.swap(event.mRanges);
-
- if (!composition ||
- uint32_t(aStart) != composition->NativeOffsetOfStartComposition() ||
- uint32_t(aEnd) != composition->NativeOffsetOfStartComposition() +
- composition->String().Length())
- {
- // Only start new composition if we don't have an existing one,
- // or if the existing composition doesn't match the new one.
- window.RemoveIMEComposition();
-
- {
- WidgetSelectionEvent event(true, eSetSelection, &window);
- window.InitEvent(event, nullptr);
- event.mOffset = uint32_t(aStart);
- event.mLength = uint32_t(aEnd - aStart);
- event.mExpandToClusterBoundary = false;
- event.mReason = nsISelectionListener::IME_REASON;
- window.DispatchEvent(&event);
- }
-
- {
- WidgetQueryContentEvent queryEvent(true, eQuerySelectedText,
- &window);
- window.InitEvent(queryEvent, nullptr);
- window.DispatchEvent(&queryEvent);
- MOZ_ASSERT(queryEvent.mSucceeded);
- event.mData = queryEvent.mReply.mString;
- }
-
- {
- WidgetCompositionEvent event(true, eCompositionStart, &window);
- window.InitEvent(event, nullptr);
- window.DispatchEvent(&event);
- }
-
- } else {
- // If the new composition matches the existing composition,
- // reuse the old composition.
- event.mData = composition->String();
- }
-
-#ifdef DEBUG_ANDROID_IME
- const NS_ConvertUTF16toUTF8 data(event.mData);
- const char* text = data.get();
- ALOGIME("IME: IME_SET_TEXT: text=\"%s\", length=%u, range=%u",
- text, event.mData.Length(), event.mRanges->Length());
-#endif // DEBUG_ANDROID_IME
-
- // Previous events may have destroyed our composition; bail in that case.
- if (window.GetIMEComposition()) {
- window.DispatchEvent(&event);
- }
-}
-
-void
-nsWindow::GeckoViewSupport::OnImeRequestCursorUpdates(int aRequestMode)
-{
- if (aRequestMode == IME_MONITOR_CURSOR_ONE_SHOT) {
- UpdateCompositionRects();
- return;
- }
-
- mIMEMonitorCursor = (aRequestMode == IME_MONITOR_CURSOR_START_MONITOR);
-}
-
-void
-nsWindow::UserActivity()
-{
- if (!mIdleService) {
- mIdleService = do_GetService("@mozilla.org/widget/idleservice;1");
- }
-
- if (mIdleService) {
- mIdleService->ResetIdleTimeOut(0);
- }
-}
-
-nsresult
-nsWindow::NotifyIMEInternal(const IMENotification& aIMENotification)
-{
- MOZ_ASSERT(this == FindTopLevel());
-
- if (!mGeckoViewSupport) {
- // Non-GeckoView windows don't support IME operations.
- return NS_ERROR_NOT_AVAILABLE;
- }
-
- if (mGeckoViewSupport->NotifyIME(aIMENotification)) {
- return NS_OK;
- }
- return NS_ERROR_NOT_IMPLEMENTED;
-}
-
-NS_IMETHODIMP_(void)
-nsWindow::SetInputContext(const InputContext& aContext,
- const InputContextAction& aAction)
-{
- nsWindow* top = FindTopLevel();
- MOZ_ASSERT(top);
-
- if (!top->mGeckoViewSupport) {
- // Non-GeckoView windows don't support IME operations.
- return;
- }
-
- // We are using an IME event later to notify Java, and the IME event
- // will be processed by the top window. Therefore, to ensure the
- // IME event uses the correct mInputContext, we need to let the top
- // window process SetInputContext
- top->mGeckoViewSupport->SetInputContext(aContext, aAction);
-}
-
-NS_IMETHODIMP_(InputContext)
-nsWindow::GetInputContext()
-{
- nsWindow* top = FindTopLevel();
- MOZ_ASSERT(top);
-
- if (!top->mGeckoViewSupport) {
- // Non-GeckoView windows don't support IME operations.
- return InputContext();
- }
-
- // We let the top window process SetInputContext,
- // so we should let it process GetInputContext as well.
- return top->mGeckoViewSupport->GetInputContext();
-}
-
-nsIMEUpdatePreference
-nsWindow::GetIMEUpdatePreference()
-{
- // While a plugin has focus, nsWindow for Android doesn't need any
- // notifications.
- if (GetInputContext().mIMEState.mEnabled == IMEState::PLUGIN) {
- return nsIMEUpdatePreference();
- }
- return nsIMEUpdatePreference(nsIMEUpdatePreference::NOTIFY_TEXT_CHANGE);
-}
-
-nsresult
-nsWindow::SynthesizeNativeTouchPoint(uint32_t aPointerId,
- TouchPointerState aPointerState,
- LayoutDeviceIntPoint aPoint,
- double aPointerPressure,
- uint32_t aPointerOrientation,
- nsIObserver* aObserver)
-{
- mozilla::widget::AutoObserverNotifier notifier(aObserver, "touchpoint");
-
- int eventType;
- switch (aPointerState) {
- case TOUCH_CONTACT:
- // This could be a ACTION_DOWN or ACTION_MOVE depending on the
- // existing state; it is mapped to the right thing in Java.
- eventType = sdk::MotionEvent::ACTION_POINTER_DOWN;
- break;
- case TOUCH_REMOVE:
- // This could be turned into a ACTION_UP in Java
- eventType = sdk::MotionEvent::ACTION_POINTER_UP;
- break;
- case TOUCH_CANCEL:
- eventType = sdk::MotionEvent::ACTION_CANCEL;
- break;
- case TOUCH_HOVER: // not supported for now
- default:
- return NS_ERROR_UNEXPECTED;
- }
-
- MOZ_ASSERT(mLayerViewSupport);
- GeckoLayerClient::LocalRef client = mLayerViewSupport->GetLayerClient();
- client->SynthesizeNativeTouchPoint(aPointerId, eventType,
- aPoint.x, aPoint.y, aPointerPressure, aPointerOrientation);
-
- return NS_OK;
-}
-
-nsresult
-nsWindow::SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
- uint32_t aNativeMessage,
- uint32_t aModifierFlags,
- nsIObserver* aObserver)
-{
- mozilla::widget::AutoObserverNotifier notifier(aObserver, "mouseevent");
-
- MOZ_ASSERT(mLayerViewSupport);
- GeckoLayerClient::LocalRef client = mLayerViewSupport->GetLayerClient();
- client->SynthesizeNativeMouseEvent(aNativeMessage, aPoint.x, aPoint.y);
-
- return NS_OK;
-}
-
-nsresult
-nsWindow::SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint,
- nsIObserver* aObserver)
-{
- mozilla::widget::AutoObserverNotifier notifier(aObserver, "mouseevent");
-
- MOZ_ASSERT(mLayerViewSupport);
- GeckoLayerClient::LocalRef client = mLayerViewSupport->GetLayerClient();
- client->SynthesizeNativeMouseEvent(sdk::MotionEvent::ACTION_HOVER_MOVE, aPoint.x, aPoint.y);
-
- return NS_OK;
-}
-
-bool
-nsWindow::PreRender(WidgetRenderingContext* aContext)
-{
- if (Destroyed()) {
- return true;
- }
-
- layers::Compositor* compositor = aContext->mCompositor;
-
- GeckoLayerClient::LocalRef client;
-
- if (NativePtr<LayerViewSupport>::Locked lvs{mLayerViewSupport}) {
- client = lvs->GetLayerClient();
- }
-
- if (compositor && client) {
- // Android Color is ARGB which is apparently unusual.
- compositor->SetDefaultClearColor(gfx::Color::UnusualFromARGB((uint32_t)client->ClearColor()));
- }
-
- return true;
-}
-void
-nsWindow::DrawWindowUnderlay(WidgetRenderingContext* aContext,
- LayoutDeviceIntRect aRect)
-{
- if (Destroyed()) {
- return;
- }
-
- GeckoLayerClient::LocalRef client;
-
- if (NativePtr<LayerViewSupport>::Locked lvs{mLayerViewSupport}) {
- client = lvs->GetLayerClient();
- }
-
- if (!client) {
- return;
- }
-
- LayerRenderer::Frame::LocalRef frame = client->CreateFrame();
- mLayerRendererFrame = frame;
- if (NS_WARN_IF(!mLayerRendererFrame)) {
- return;
- }
-
- if (!WidgetPaintsBackground()) {
- return;
- }
-
- frame->BeginDrawing();
-}
-
-void
-nsWindow::DrawWindowOverlay(WidgetRenderingContext* aContext,
- LayoutDeviceIntRect aRect)
-{
- PROFILER_LABEL("nsWindow", "DrawWindowOverlay",
- js::ProfileEntry::Category::GRAPHICS);
-
- if (Destroyed() || NS_WARN_IF(!mLayerRendererFrame)) {
- return;
- }
-
- mLayerRendererFrame->EndDrawing();
- mLayerRendererFrame = nullptr;
-}
-
-bool
-nsWindow::WidgetPaintsBackground()
-{
- static bool sWidgetPaintsBackground = true;
- static bool sWidgetPaintsBackgroundPrefCached = false;
-
- if (!sWidgetPaintsBackgroundPrefCached) {
- sWidgetPaintsBackgroundPrefCached = true;
- mozilla::Preferences::AddBoolVarCache(&sWidgetPaintsBackground,
- "android.widget_paints_background",
- true);
- }
-
- return sWidgetPaintsBackground;
-}
-
-bool
-nsWindow::NeedsPaint()
-{
- if (!mLayerViewSupport || mLayerViewSupport->CompositorPaused() ||
- // FindTopLevel() != nsWindow::TopWindow() ||
- !GetLayerManager(nullptr)) {
- return false;
- }
- return nsIWidget::NeedsPaint();
-}
-
-void
-nsWindow::ConfigureAPZControllerThread()
-{
- APZThreadUtils::SetControllerThread(nullptr);
-}
-
-already_AddRefed<GeckoContentController>
-nsWindow::CreateRootContentController()
-{
- RefPtr<GeckoContentController> controller = new AndroidContentController(this, mAPZEventState, mAPZC);
- return controller.forget();
-}
-
-uint32_t
-nsWindow::GetMaxTouchPoints() const
-{
- return GeckoAppShell::GetMaxTouchPoints();
-}
-
-void
-nsWindow::UpdateZoomConstraints(const uint32_t& aPresShellId,
- const FrameMetrics::ViewID& aViewId,
- const mozilla::Maybe<ZoomConstraints>& aConstraints)
-{
- nsBaseWidget::UpdateZoomConstraints(aPresShellId, aViewId, aConstraints);
-}
-
-CompositorBridgeParent*
-nsWindow::GetCompositorBridgeParent() const
-{
- return mCompositorSession ? mCompositorSession->GetInProcessBridge() : nullptr;
-}
-
-already_AddRefed<nsIScreen>
-nsWindow::GetWidgetScreen()
-{
- nsCOMPtr<nsIScreenManager> screenMgr =
- do_GetService("@mozilla.org/gfx/screenmanager;1");
- MOZ_ASSERT(screenMgr, "Failed to get nsIScreenManager");
-
- nsCOMPtr<nsIScreen> screen;
- screenMgr->ScreenForId(mScreenId, getter_AddRefs(screen));
-
- return screen.forget();
-}
-
-jni::DependentRef<java::GeckoLayerClient>
-nsWindow::GetLayerClient()
-{
- if (NativePtr<LayerViewSupport>::Locked lvs{mLayerViewSupport}) {
- return lvs->GetLayerClient().Get();
- }
- return nullptr;
-}
diff --git a/widget/android/nsWindow.h b/widget/android/nsWindow.h
deleted file mode 100644
index f3d7566f7..000000000
--- a/widget/android/nsWindow.h
+++ /dev/null
@@ -1,289 +0,0 @@
-/* -*- Mode: c++; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * vim: set sw=4 ts=4 expandtab:
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#ifndef NSWINDOW_H_
-#define NSWINDOW_H_
-
-#include "nsBaseWidget.h"
-#include "gfxPoint.h"
-#include "nsIIdleServiceInternal.h"
-#include "nsTArray.h"
-#include "AndroidJavaWrappers.h"
-#include "GeneratedJNIWrappers.h"
-#include "mozilla/EventForwards.h"
-#include "mozilla/Mutex.h"
-#include "mozilla/StaticPtr.h"
-#include "mozilla/TextRange.h"
-#include "mozilla/UniquePtr.h"
-
-struct ANPEvent;
-
-namespace mozilla {
- class TextComposition;
- class WidgetTouchEvent;
-
- namespace layers {
- class CompositorBridgeParent;
- class CompositorBridgeChild;
- class LayerManager;
- class APZCTreeManager;
- }
-}
-
-class nsWindow : public nsBaseWidget
-{
-private:
- virtual ~nsWindow();
-
-public:
- using nsBaseWidget::GetLayerManager;
-
- nsWindow();
-
- NS_DECL_ISUPPORTS_INHERITED
-
- static void InitNatives();
- void SetScreenId(uint32_t aScreenId) { mScreenId = aScreenId; }
-
-private:
- uint32_t mScreenId;
-
- // An Event subclass that guards against stale events.
- template<typename Lambda,
- bool IsStatic = Lambda::isStatic,
- typename InstanceType = typename Lambda::ThisArgType,
- class Impl = typename Lambda::TargetClass>
- class WindowEvent;
-
- // Smart pointer for holding a pointer back to the nsWindow inside a native
- // object class. The nsWindow pointer is automatically cleared when the
- // nsWindow is destroyed, and a WindowPtr<Impl>::Locked class is provided
- // for thread-safe access to the nsWindow pointer off of the Gecko thread.
- template<class Impl> class WindowPtr;
-
- // Smart pointer for holding a pointer to a native object class. The
- // pointer is automatically cleared when the object is destroyed.
- template<class Impl>
- class NativePtr final
- {
- friend WindowPtr<Impl>;
-
- static const char sName[];
-
- WindowPtr<Impl>* mPtr;
- Impl* mImpl;
- mozilla::Mutex mImplLock;
-
- public:
- class Locked;
-
- NativePtr() : mPtr(nullptr), mImpl(nullptr), mImplLock(sName) {}
- ~NativePtr() { MOZ_ASSERT(!mPtr); }
-
- operator Impl*() const
- {
- MOZ_ASSERT(NS_IsMainThread());
- return mImpl;
- }
-
- Impl* operator->() const { return operator Impl*(); }
-
- template<class Instance, typename... Args>
- void Attach(Instance aInstance, nsWindow* aWindow, Args&&... aArgs);
- void Detach();
- };
-
- class LayerViewSupport;
- // Object that implements native LayerView calls.
- // Owned by the Java LayerView instance.
- NativePtr<LayerViewSupport> mLayerViewSupport;
-
- class NPZCSupport;
- // Object that implements native NativePanZoomController calls.
- // Owned by the Java NativePanZoomController instance.
- NativePtr<NPZCSupport> mNPZCSupport;
-
- class GeckoViewSupport;
- // Object that implements native GeckoView calls and associated states.
- // nullptr for nsWindows that were not opened from GeckoView.
- // Because other objects get destroyed in the mGeckOViewSupport destructor,
- // keep it last in the list, so its destructor is called first.
- mozilla::UniquePtr<GeckoViewSupport> mGeckoViewSupport;
-
- // Class that implements native PresentationMediaPlayerManager calls.
- class PMPMSupport;
-
-public:
- static nsWindow* TopWindow();
-
- void OnSizeChanged(const mozilla::gfx::IntSize& aSize);
-
- void InitEvent(mozilla::WidgetGUIEvent& event,
- LayoutDeviceIntPoint* aPoint = 0);
-
- void UpdateOverscrollVelocity(const float aX, const float aY);
- void UpdateOverscrollOffset(const float aX, const float aY);
- void SetScrollingRootContent(const bool isRootContent);
-
- //
- // nsIWidget
- //
-
- using nsBaseWidget::Create; // for Create signature not overridden here
- virtual MOZ_MUST_USE nsresult Create(nsIWidget* aParent,
- nsNativeWidget aNativeParent,
- const LayoutDeviceIntRect& aRect,
- nsWidgetInitData* aInitData) override;
- virtual void Destroy() override;
- NS_IMETHOD ConfigureChildren(const nsTArray<nsIWidget::Configuration>&) override;
- NS_IMETHOD SetParent(nsIWidget* aNewParent) override;
- virtual nsIWidget *GetParent(void) override;
- virtual float GetDPI() override;
- virtual double GetDefaultScaleInternal() override;
- NS_IMETHOD Show(bool aState) override;
- virtual bool IsVisible() const override;
- virtual void ConstrainPosition(bool aAllowSlop,
- int32_t *aX,
- int32_t *aY) override;
- NS_IMETHOD Move(double aX,
- double aY) override;
- NS_IMETHOD Resize(double aWidth,
- double aHeight,
- bool aRepaint) override;
- NS_IMETHOD Resize(double aX,
- double aY,
- double aWidth,
- double aHeight,
- bool aRepaint) override;
- void SetZIndex(int32_t aZIndex) override;
- virtual void SetSizeMode(nsSizeMode aMode) override;
- NS_IMETHOD Enable(bool aState) override;
- virtual bool IsEnabled() const override;
- NS_IMETHOD Invalidate(const LayoutDeviceIntRect& aRect) override;
- NS_IMETHOD SetFocus(bool aRaise = false) override;
- virtual LayoutDeviceIntRect GetScreenBounds() override;
- virtual LayoutDeviceIntPoint WidgetToScreenOffset() override;
- NS_IMETHOD DispatchEvent(mozilla::WidgetGUIEvent* aEvent,
- nsEventStatus& aStatus) override;
- nsEventStatus DispatchEvent(mozilla::WidgetGUIEvent* aEvent);
- virtual already_AddRefed<nsIScreen> GetWidgetScreen() override;
- virtual nsresult MakeFullScreen(bool aFullScreen,
- nsIScreen* aTargetScreen = nullptr)
- override;
-
- NS_IMETHOD SetCursor(nsCursor aCursor) override { return NS_ERROR_NOT_IMPLEMENTED; }
- NS_IMETHOD SetCursor(imgIContainer* aCursor,
- uint32_t aHotspotX,
- uint32_t aHotspotY) override { return NS_ERROR_NOT_IMPLEMENTED; }
- NS_IMETHOD SetHasTransparentBackground(bool aTransparent) { return NS_OK; }
- NS_IMETHOD GetHasTransparentBackground(bool& aTransparent) { aTransparent = false; return NS_OK; }
- NS_IMETHOD HideWindowChrome(bool aShouldHide) override { return NS_ERROR_NOT_IMPLEMENTED; }
- void* GetNativeData(uint32_t aDataType) override;
- void SetNativeData(uint32_t aDataType, uintptr_t aVal) override;
- NS_IMETHOD SetTitle(const nsAString& aTitle) override { return NS_OK; }
- NS_IMETHOD SetIcon(const nsAString& aIconSpec) override { return NS_OK; }
- NS_IMETHOD GetAttention(int32_t aCycleCount) override { return NS_ERROR_NOT_IMPLEMENTED; }
- NS_IMETHOD BeginResizeDrag(mozilla::WidgetGUIEvent* aEvent,
- int32_t aHorizontal,
- int32_t aVertical) override
- {
- return NS_ERROR_NOT_IMPLEMENTED;
- }
-
- NS_IMETHOD_(void) SetInputContext(const InputContext& aContext,
- const InputContextAction& aAction) override;
- NS_IMETHOD_(InputContext) GetInputContext() override;
- virtual nsIMEUpdatePreference GetIMEUpdatePreference() override;
-
- void SetSelectionDragState(bool aState);
- LayerManager* GetLayerManager(PLayerTransactionChild* aShadowManager = nullptr,
- LayersBackend aBackendHint = mozilla::layers::LayersBackend::LAYERS_NONE,
- LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT) override;
-
- virtual bool NeedsPaint() override;
- virtual bool PreRender(mozilla::widget::WidgetRenderingContext* aContext) override;
- virtual void DrawWindowUnderlay(mozilla::widget::WidgetRenderingContext* aContext,
- LayoutDeviceIntRect aRect) override;
- virtual void DrawWindowOverlay(mozilla::widget::WidgetRenderingContext* aContext,
- LayoutDeviceIntRect aRect) override;
-
- virtual bool WidgetPaintsBackground() override;
-
- virtual uint32_t GetMaxTouchPoints() const override;
-
- void UpdateZoomConstraints(const uint32_t& aPresShellId,
- const FrameMetrics::ViewID& aViewId,
- const mozilla::Maybe<ZoomConstraints>& aConstraints) override;
-
- nsresult SynthesizeNativeTouchPoint(uint32_t aPointerId,
- TouchPointerState aPointerState,
- LayoutDeviceIntPoint aPoint,
- double aPointerPressure,
- uint32_t aPointerOrientation,
- nsIObserver* aObserver) override;
- nsresult SynthesizeNativeMouseEvent(LayoutDeviceIntPoint aPoint,
- uint32_t aNativeMessage,
- uint32_t aModifierFlags,
- nsIObserver* aObserver) override;
- nsresult SynthesizeNativeMouseMove(LayoutDeviceIntPoint aPoint,
- nsIObserver* aObserver) override;
-
- CompositorBridgeParent* GetCompositorBridgeParent() const;
-
- mozilla::jni::DependentRef<mozilla::java::GeckoLayerClient> GetLayerClient();
-
-protected:
- void BringToFront();
- nsWindow *FindTopLevel();
- bool IsTopLevel();
-
- RefPtr<mozilla::TextComposition> GetIMEComposition();
- enum RemoveIMECompositionFlag {
- CANCEL_IME_COMPOSITION,
- COMMIT_IME_COMPOSITION
- };
- void RemoveIMEComposition(RemoveIMECompositionFlag aFlag = COMMIT_IME_COMPOSITION);
-
- void ConfigureAPZControllerThread() override;
- void DispatchHitTest(const mozilla::WidgetTouchEvent& aEvent);
-
- already_AddRefed<GeckoContentController> CreateRootContentController() override;
-
- // Call this function when the users activity is the direct cause of an
- // event (like a keypress or mouse click).
- void UserActivity();
-
- bool mIsVisible;
- nsTArray<nsWindow*> mChildren;
- nsWindow* mParent;
-
- double mStartDist;
- double mLastDist;
-
- nsCOMPtr<nsIIdleServiceInternal> mIdleService;
-
- bool mAwaitingFullScreen;
- bool mIsFullScreen;
-
- virtual nsresult NotifyIMEInternal(
- const IMENotification& aIMENotification) override;
-
- bool UseExternalCompositingSurface() const override {
- return true;
- }
-
- static void DumpWindows();
- static void DumpWindows(const nsTArray<nsWindow*>& wins, int indent = 0);
- static void LogWindow(nsWindow *win, int index, int indent);
-
-private:
- void CreateLayerManager(int aCompositorWidth, int aCompositorHeight);
- void RedrawAll();
-
- mozilla::java::LayerRenderer::Frame::GlobalRef mLayerRendererFrame;
-};
-
-#endif /* NSWINDOW_H_ */
diff --git a/widget/cocoa/nsCocoaFeatures.h b/widget/cocoa/nsCocoaFeatures.h
index 597aff611..984dae80e 100644
--- a/widget/cocoa/nsCocoaFeatures.h
+++ b/widget/cocoa/nsCocoaFeatures.h
@@ -21,6 +21,9 @@ public:
static bool OnYosemiteOrLater();
static bool OnElCapitanOrLater();
static bool OnSierraOrLater();
+ static bool OnHighSierraOrLater();
+ static bool OnMojaveOrLater();
+ static bool OnCatalinaOrLater();
static bool IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix=0);
diff --git a/widget/cocoa/nsCocoaFeatures.mm b/widget/cocoa/nsCocoaFeatures.mm
index 5a5c16fa1..065260837 100644
--- a/widget/cocoa/nsCocoaFeatures.mm
+++ b/widget/cocoa/nsCocoaFeatures.mm
@@ -19,6 +19,9 @@
#define MAC_OS_X_VERSION_10_10_HEX 0x000010A0
#define MAC_OS_X_VERSION_10_11_HEX 0x000010B0
#define MAC_OS_X_VERSION_10_12_HEX 0x000010C0
+#define MAC_OS_X_VERSION_10_13_HEX 0x000010D0
+#define MAC_OS_X_VERSION_10_14_HEX 0x000010E0
+#define MAC_OS_X_VERSION_10_15_HEX 0x000010F0
#include "nsCocoaFeatures.h"
#include "nsCocoaUtils.h"
@@ -167,6 +170,24 @@ nsCocoaFeatures::OnSierraOrLater()
return (OSXVersion() >= MAC_OS_X_VERSION_10_12_HEX);
}
+/* static */ bool
+nsCocoaFeatures::OnHighSierraOrLater()
+{
+ return (OSXVersion() >= MAC_OS_X_VERSION_10_13_HEX);
+}
+
+/* static */ bool
+nsCocoaFeatures::OnMojaveOrLater()
+{
+ return (OSXVersion() >= MAC_OS_X_VERSION_10_14_HEX);
+}
+
+/* static */ bool
+nsCocoaFeatures::OnCatalinaOrLater()
+{
+ return (OSXVersion() >= MAC_OS_X_VERSION_10_15_HEX);
+}
+
/* static */ bool
nsCocoaFeatures::IsAtLeastVersion(int32_t aMajor, int32_t aMinor, int32_t aBugFix)
{
diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm
index db120fbdd..b6d94ea94 100644
--- a/widget/cocoa/nsCocoaWindow.mm
+++ b/widget/cocoa/nsCocoaWindow.mm
@@ -810,15 +810,17 @@ NS_IMETHODIMP nsCocoaWindow::Show(bool bState)
}
}
else if (mWindowType == eWindowType_popup) {
- // If a popup window is shown after being hidden, it needs to be "reset"
- // for it to receive any mouse events aside from mouse-moved events
- // (because it was removed from the "window cache" when it was hidden
- // -- see below). Setting the window number to -1 and then back to its
- // original value seems to accomplish this. The idea was "borrowed"
- // from the Java Embedding Plugin.
- NSInteger windowNumber = [mWindow windowNumber];
- [mWindow _setWindowNumber:-1];
- [mWindow _setWindowNumber:windowNumber];
+ if (!nsCocoaFeatures::OnMojaveOrLater()) {
+ // If a popup window is shown after being hidden, it needs to be "reset"
+ // for it to receive any mouse events aside from mouse-moved events
+ // (because it was removed from the "window cache" when it was hidden
+ // -- see below). Setting the window number to -1 and then back to its
+ // original value seems to accomplish this. The idea was "borrowed"
+ // from the Java Embedding Plugin. This is fixed on macOS 10.14+.
+ NSInteger windowNumber = [mWindow windowNumber];
+ [mWindow _setWindowNumber:-1];
+ [mWindow _setWindowNumber:windowNumber];
+ }
// For reasons that aren't yet clear, calls to [NSWindow orderFront:] or
// [NSWindow makeKeyAndOrderFront:] can sometimes trigger "Error (1000)
// creating CGSWindow", which in turn triggers an internal inconsistency
@@ -951,17 +953,22 @@ NS_IMETHODIMP nsCocoaWindow::Show(bool bState)
[nativeParentWindow removeChildWindow:mWindow];
[mWindow orderOut:nil];
- // Unless it's explicitly removed from NSApp's "window cache", a popup
- // window will keep receiving mouse-moved events even after it's been
- // "ordered out" (instead of the browser window that was underneath it,
- // until you click on that window). This is bmo bug 378645, but it's
- // surely an Apple bug. The "window cache" is an undocumented subsystem,
- // all of whose methods are included in the NSWindowCache category of
- // the NSApplication class (in header files generated using class-dump).
- // This workaround was "borrowed" from the Java Embedding Plugin (which
- // uses it for a different purpose).
- if (mWindowType == eWindowType_popup)
- [NSApp _removeWindowFromCache:mWindow];
+
+ if (!nsCocoaFeatures::OnMojaveOrLater()) {
+ // Unless it's explicitly removed from NSApp's "window cache", a popup
+ // window will keep receiving mouse-moved events even after it's been
+ // "ordered out" (instead of the browser window that was underneath it,
+ // until you click on that window). This is bmo bug 378645, but it's
+ // surely an Apple bug. The "window cache" is an undocumented
+ // subsystem, all of whose methods are included in the NSWindowCache
+ // category of the NSApplication class (in header files generated using
+ // class-dump). This workaround was "borrowed" from the Java Embedding
+ // Plugin (which uses it for a different purpose). This is fixed on
+ // macOS 10.14+.
+ if (mWindowType == eWindowType_popup) {
+ [NSApp _removeWindowFromCache:mWindow];
+ }
+ }
// If our popup window is a non-native context menu, tell the OS (and
// other programs) that a menu has closed.
diff --git a/widget/moz.build b/widget/moz.build
index b156346eb..3ca4c9785 100644
--- a/widget/moz.build
+++ b/widget/moz.build
@@ -6,9 +6,10 @@
toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
-if toolkit in ('cocoa', 'android', 'uikit'):
+if toolkit in ('cocoa', 'uikit'):
DIRS += [toolkit]
-if toolkit in ('android', 'gtk2', 'gtk3'):
+
+if toolkit in ('gtk2', 'gtk3'):
EXPORTS += ['nsIPrintDialogService.h']
if toolkit == 'windows':
@@ -41,8 +42,6 @@ elif toolkit == 'cocoa':
'nsIPrintDialogService.h',
]
-TEST_DIRS += ['tests']
-
# Don't build the DSO under the 'build' directory as windows does.
#
# The DSOs get built in the toolkit dir itself. Do this so that
@@ -221,20 +220,14 @@ if toolkit in ('cocoa', 'windows'):
'nsBaseClipboard.cpp',
]
-if toolkit in {'gtk2', 'gtk3', 'cocoa', 'windows',
- 'android', 'uikit'}:
- UNIFIED_SOURCES += [
- 'nsBaseFilePicker.cpp',
- ]
+if toolkit in {'gtk2', 'gtk3', 'cocoa', 'windows', 'uikit'}:
+ UNIFIED_SOURCES += ['nsBaseFilePicker.cpp']
if toolkit in ('gtk2', 'gtk3', 'windows', 'cocoa'):
- UNIFIED_SOURCES += [
- 'nsNativeTheme.cpp',
- ]
+ UNIFIED_SOURCES += ['nsNativeTheme.cpp']
+
if toolkit == 'gtk3':
- XPIDL_SOURCES += [
- 'nsIApplicationChooser.idl',
- ]
+ XPIDL_SOURCES += ['nsIApplicationChooser.idl']
DEFINES['MOZ_CROSS_PROCESS_IME'] = True
diff --git a/widget/nsIWidget.h b/widget/nsIWidget.h
index 2d14cc107..8e28c24da 100644
--- a/widget/nsIWidget.h
+++ b/widget/nsIWidget.h
@@ -134,11 +134,6 @@ typedef void* nsNativeWidget;
#define NS_NATIVE_COMPOSITOR_DISPLAY 105
#endif // MOZ_X11
#endif
-#ifdef MOZ_WIDGET_ANDROID
-#define NS_JAVA_SURFACE 100
-#define NS_PRESENTATION_WINDOW 101
-#define NS_PRESENTATION_SURFACE 102
-#endif
#define NS_IWIDGET_IID \
{ 0x06396bf6, 0x2dd8, 0x45e5, \
diff --git a/widget/nsIdleService.cpp b/widget/nsIdleService.cpp
index f9904d39c..5750a2754 100644
--- a/widget/nsIdleService.cpp
+++ b/widget/nsIdleService.cpp
@@ -21,10 +21,6 @@
#include "mozilla/Telemetry.h"
#include <algorithm>
-#ifdef MOZ_WIDGET_ANDROID
-#include <android/log.h>
-#endif
-
using namespace mozilla;
// interval in milliseconds between internal idle time requests.
@@ -53,7 +49,6 @@ using namespace mozilla;
static PRLogModuleInfo *sLog = nullptr;
#define LOG_TAG "GeckoIdleService"
-#define LOG_LEVEL ANDROID_LOG_DEBUG
// Use this to find previously added observers in our array:
class IdleListenerComparator
@@ -98,10 +93,6 @@ nsIdleServiceDaily::Observe(nsISupports *,
MOZ_LOG(sLog, LogLevel::Debug,
("nsIdleServiceDaily: Notifying idle-daily observers"));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "Notifying idle-daily observers");
-#endif
// Send the idle-daily observer event
nsCOMPtr<nsIObserverService> observerService =
@@ -134,10 +125,6 @@ nsIdleServiceDaily::Observe(nsISupports *,
MOZ_LOG(sLog, LogLevel::Debug,
("nsIdleServiceDaily: Storing last idle time as %d sec.", nowSec));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "Storing last idle time as %d", nowSec);
-#endif
// Note the moment we expect to get the next timer callback
mExpectedTriggerTime = PR_Now() + ((PRTime)SECONDS_PER_DAY *
@@ -202,10 +189,6 @@ nsIdleServiceDaily::Init()
} else {
MOZ_LOG(sLog, LogLevel::Debug,
("nsIdleServiceDaily: Setting timer a day from now"));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "Setting timer a day from now");
-#endif
// According to our last idle-daily pref, the last idle-daily was fired
// less then 24 hours ago. Set a wait for the amount of time remaining.
@@ -255,10 +238,7 @@ nsIdleServiceDaily::StageIdleDaily(bool aHasBeenLongWait)
MOZ_LOG(sLog, LogLevel::Debug,
("nsIdleServiceDaily: Registering Idle observer callback "
"(short wait requested? %d)", aHasBeenLongWait));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "Registering Idle observer callback");
-#endif
+
mIdleDailyTriggerWait = (aHasBeenLongWait ?
DAILY_SHORTENED_IDLE_SERVICE_SEC :
DAILY_SIGNIFICANT_IDLE_SERVICE_SEC);
@@ -271,15 +251,10 @@ nsIdleServiceDaily::DailyCallback(nsITimer* aTimer, void* aClosure)
{
MOZ_LOG(sLog, LogLevel::Debug,
("nsIdleServiceDaily: DailyCallback running"));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "DailyCallback running");
-#endif
nsIdleServiceDaily* self = static_cast<nsIdleServiceDaily*>(aClosure);
- // Check to be sure the timer didn't fire early. This currently only
- // happens on android.
+ // Check to be sure the timer didn't fire early.
PRTime now = PR_Now();
if (self->mExpectedTriggerTime && now < self->mExpectedTriggerTime) {
// Timer returned early, reschedule to the appropriate time.
@@ -290,11 +265,6 @@ nsIdleServiceDaily::DailyCallback(nsITimer* aTimer, void* aClosure)
MOZ_LOG(sLog, LogLevel::Debug, ("nsIdleServiceDaily: DailyCallback resetting timer to %lld msec",
delayTime / PR_USEC_PER_MSEC));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "DailyCallback resetting timer to %lld msec",
- delayTime / PR_USEC_PER_MSEC);
-#endif
(void)self->mTimer->InitWithFuncCallback(DailyCallback,
self,
@@ -438,11 +408,6 @@ nsIdleService::AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS)
MOZ_LOG(sLog, LogLevel::Debug,
("idleService: Register idle observer %p for %d seconds",
aObserver, aIdleTimeInS));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "Register idle observer %p for %d seconds",
- aObserver, aIdleTimeInS);
-#endif
// Put the time + observer in a struct we can keep:
IdleListener listener(aObserver, aIdleTimeInS);
@@ -466,11 +431,6 @@ nsIdleService::AddIdleObserver(nsIObserver* aObserver, uint32_t aIdleTimeInS)
MOZ_LOG(sLog, LogLevel::Debug,
("idleService: Register: adjusting next switch from %d to %d seconds",
mDeltaToNextIdleSwitchInS, aIdleTimeInS));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "Register: adjusting next switch from %d to %d seconds",
- mDeltaToNextIdleSwitchInS, aIdleTimeInS);
-#endif
mDeltaToNextIdleSwitchInS = aIdleTimeInS;
}
@@ -508,11 +468,7 @@ nsIdleService::RemoveIdleObserver(nsIObserver* aObserver, uint32_t aTimeInS)
MOZ_LOG(sLog, LogLevel::Debug,
("idleService: Remove observer %p (%d seconds), %d remain idle",
aObserver, aTimeInS, mIdleObserverCount));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "Remove observer %p (%d seconds), %d remain idle",
- aObserver, aTimeInS, mIdleObserverCount);
-#endif
+
return NS_OK;
}
@@ -520,11 +476,7 @@ nsIdleService::RemoveIdleObserver(nsIObserver* aObserver, uint32_t aTimeInS)
MOZ_LOG(sLog, LogLevel::Warning,
("idleService: Failed to remove idle observer %p (%d seconds)",
aObserver, aTimeInS));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "Failed to remove idle observer %p (%d seconds)",
- aObserver, aTimeInS);
-#endif
+
return NS_ERROR_FAILURE;
}
@@ -591,11 +543,7 @@ nsIdleService::ResetIdleTimeOut(uint32_t idleDeltaInMS)
MOZ_LOG(sLog, LogLevel::Debug,
("idleService: Reset idle timeout: tell observer %p user is back",
notifyList[numberOfPendingNotifications]));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "Reset idle timeout: tell observer %p user is back",
- notifyList[numberOfPendingNotifications]);
-#endif
+
notifyList[numberOfPendingNotifications]->Observe(this,
OBSERVER_TOPIC_ACTIVE,
timeStr.get());
@@ -627,11 +575,6 @@ nsIdleService::GetIdleTime(uint32_t* idleTime)
MOZ_LOG(sLog, LogLevel::Debug,
("idleService: Get idle time: time since reset %u msec",
timeSinceResetInMS));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "Get idle time: time since reset %u msec",
- timeSinceResetInMS);
-#endif
// If we did't get pulled data, return the time since last idle reset.
if (!polledIdleTimeIsValid) {
@@ -682,21 +625,13 @@ nsIdleService::IdleTimerCallback(void)
if (NS_FAILED(GetIdleTime(&currentIdleTimeInMS))) {
MOZ_LOG(sLog, LogLevel::Info,
("idleService: Idle timer callback: failed to get idle time"));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "Idle timer callback: failed to get idle time");
-#endif
+
return;
}
MOZ_LOG(sLog, LogLevel::Debug,
("idleService: Idle timer callback: current idle time %u msec",
currentIdleTimeInMS));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "Idle timer callback: current idle time %u msec",
- currentIdleTimeInMS);
-#endif
// Check if we have had some user interaction we didn't handle previously
// we do the calculation in ms to lessen the chance for rounding errors to
@@ -770,11 +705,7 @@ nsIdleService::IdleTimerCallback(void)
MOZ_LOG(sLog, LogLevel::Debug,
("idleService: **** Idle timer callback: tell observer %p user is idle",
notifyList[numberOfPendingNotifications]));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "Idle timer callback: tell observer %p user is idle",
- notifyList[numberOfPendingNotifications]);
-#endif
+
notifyList[numberOfPendingNotifications]->Observe(this,
OBSERVER_TOPIC_IDLE,
timeStr.get());
@@ -790,12 +721,6 @@ nsIdleService::SetTimerExpiryIfBefore(TimeStamp aNextTimeout)
("idleService: SetTimerExpiryIfBefore: next timeout %0.f msec from now",
nextTimeoutDuration.ToMilliseconds()));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "SetTimerExpiryIfBefore: next timeout %0.f msec from now",
- nextTimeoutDuration.ToMilliseconds());
-#endif
-
// Bail if we don't have a timer service.
if (!mTimer) {
return;
@@ -824,11 +749,6 @@ nsIdleService::SetTimerExpiryIfBefore(TimeStamp aNextTimeout)
MOZ_LOG(sLog, LogLevel::Debug,
("idleService: IdleService reset timer expiry to %0.f msec from now",
deltaTime.ToMilliseconds()));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "reset timer expiry to %0.f msec from now",
- deltaTime.ToMilliseconds());
-#endif
// Start the timer
mTimer->InitWithFuncCallback(StaticIdleTimerCallback,
@@ -848,10 +768,7 @@ nsIdleService::ReconfigureTimer(void)
// And bail out.
MOZ_LOG(sLog, LogLevel::Debug,
("idleService: ReconfigureTimer: no idle or waiting observers"));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "ReconfigureTimer: no idle or waiting observers");
-#endif
+
return;
}
@@ -870,12 +787,6 @@ nsIdleService::ReconfigureTimer(void)
("idleService: next timeout %0.f msec from now",
nextTimeoutDuration.ToMilliseconds()));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "next timeout %0.f msec from now",
- nextTimeoutDuration.ToMilliseconds());
-#endif
-
// Check if we should correct the timeout time because we should poll before.
if ((mIdleObserverCount > 0) && UsePollMode()) {
TimeStamp pollTimeout =
@@ -885,11 +796,7 @@ nsIdleService::ReconfigureTimer(void)
MOZ_LOG(sLog, LogLevel::Debug,
("idleService: idle observers, reducing timeout to %lu msec from now",
MIN_IDLE_POLL_INTERVAL_MSEC));
-#ifdef MOZ_WIDGET_ANDROID
- __android_log_print(LOG_LEVEL, LOG_TAG,
- "idle observers, reducing timeout to %lu msec from now",
- MIN_IDLE_POLL_INTERVAL_MSEC);
-#endif
+
nextTimeoutAt = pollTimeout;
}
}
diff --git a/widget/tests/TestAppShellSteadyState.cpp b/widget/tests/TestAppShellSteadyState.cpp
deleted file mode 100644
index 162343e38..000000000
--- a/widget/tests/TestAppShellSteadyState.cpp
+++ /dev/null
@@ -1,503 +0,0 @@
-/**
- * Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/
- */
-
-#include "TestHarness.h"
-
-#include "nsIAppShell.h"
-#include "nsIAppShellService.h"
-#include "nsIDocument.h"
-#include "nsIDOMEvent.h"
-#include "nsIDOMEventListener.h"
-#include "nsIDOMEventTarget.h"
-#include "nsIDOMWindow.h"
-#include "nsIDOMWindowUtils.h"
-#include "nsIInterfaceRequestor.h"
-#include "nsIRunnable.h"
-#include "nsIURI.h"
-#include "nsIWebBrowserChrome.h"
-#include "nsIXULWindow.h"
-
-#include "nsAppShellCID.h"
-#include "nsIInterfaceRequestorUtils.h"
-#include "nsNetUtil.h"
-#include "nsThreadUtils.h"
-#include "mozilla/Attributes.h"
-
-#ifdef XP_WIN
-#include <windows.h>
-#endif
-
-using namespace mozilla;
-
-typedef void (*TestFunc)(nsIAppShell*);
-
-bool gStableStateEventHasRun = false;
-
-class ExitAppShellRunnable : public Runnable
-{
- nsCOMPtr<nsIAppShell> mAppShell;
-
-public:
- explicit ExitAppShellRunnable(nsIAppShell* aAppShell)
- : mAppShell(aAppShell)
- { }
-
- NS_IMETHOD
- Run() override
- {
- return mAppShell->Exit();
- }
-};
-
-class StableStateRunnable : public Runnable
-{
-public:
- NS_IMETHOD
- Run() override
- {
- if (gStableStateEventHasRun) {
- fail("StableStateRunnable already ran");
- }
- gStableStateEventHasRun = true;
- return NS_OK;
- }
-};
-
-class CheckStableStateRunnable : public Runnable
-{
- bool mShouldHaveRun;
-
-public:
- explicit CheckStableStateRunnable(bool aShouldHaveRun)
- : mShouldHaveRun(aShouldHaveRun)
- { }
-
- NS_IMETHOD
- Run() override
- {
- if (mShouldHaveRun == gStableStateEventHasRun) {
- passed("StableStateRunnable state correct (%s)",
- mShouldHaveRun ? "true" : "false");
- } else {
- fail("StableStateRunnable ran at wrong time");
- }
- return NS_OK;
- }
-};
-
-class ScheduleStableStateRunnable : public CheckStableStateRunnable
-{
-protected:
- nsCOMPtr<nsIAppShell> mAppShell;
-
-public:
- explicit ScheduleStableStateRunnable(nsIAppShell* aAppShell)
- : CheckStableStateRunnable(false), mAppShell(aAppShell)
- { }
-
- NS_IMETHOD
- Run() override
- {
- CheckStableStateRunnable::Run();
-
- nsCOMPtr<nsIRunnable> runnable = new StableStateRunnable();
- nsresult rv = mAppShell->RunBeforeNextEvent(runnable);
- if (NS_FAILED(rv)) {
- fail("RunBeforeNextEvent returned failure code %u", rv);
- }
-
- return rv;
- }
-};
-
-class NextTestRunnable : public Runnable
-{
- nsCOMPtr<nsIAppShell> mAppShell;
-
-public:
- explicit NextTestRunnable(nsIAppShell* aAppShell)
- : mAppShell(aAppShell)
- { }
-
- NS_IMETHOD Run();
-};
-
-class ScheduleNestedStableStateRunnable : public ScheduleStableStateRunnable
-{
-public:
- explicit ScheduleNestedStableStateRunnable(nsIAppShell* aAppShell)
- : ScheduleStableStateRunnable(aAppShell)
- { }
-
- NS_IMETHOD
- Run() override
- {
- ScheduleStableStateRunnable::Run();
-
- nsCOMPtr<nsIRunnable> runnable = new CheckStableStateRunnable(false);
- if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
- fail("Failed to dispatch check runnable");
- }
-
- if (NS_FAILED(NS_ProcessPendingEvents(nullptr))) {
- fail("Failed to process all pending events");
- }
-
- runnable = new CheckStableStateRunnable(true);
- if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
- fail("Failed to dispatch check runnable");
- }
-
- runnable = new NextTestRunnable(mAppShell);
- if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
- fail("Failed to dispatch next test runnable");
- }
-
- return NS_OK;
- }
-};
-
-class EventListener final : public nsIDOMEventListener
-{
- nsCOMPtr<nsIAppShell> mAppShell;
-
- static nsIDOMWindowUtils* sWindowUtils;
- static nsIAppShell* sAppShell;
-
- ~EventListener() {}
-
-public:
- NS_DECL_ISUPPORTS
-
- explicit EventListener(nsIAppShell* aAppShell)
- : mAppShell(aAppShell)
- { }
-
- NS_IMETHOD
- HandleEvent(nsIDOMEvent* aEvent) override
- {
- nsString type;
- if (NS_FAILED(aEvent->GetType(type))) {
- fail("Failed to get event type");
- return NS_ERROR_FAILURE;
- }
-
- if (type.EqualsLiteral("load")) {
- passed("Got load event");
-
- nsCOMPtr<nsIDOMEventTarget> target;
- if (NS_FAILED(aEvent->GetTarget(getter_AddRefs(target)))) {
- fail("Failed to get event type");
- return NS_ERROR_FAILURE;
- }
-
- nsCOMPtr<nsIDocument> document = do_QueryInterface(target);
- if (!document) {
- fail("Failed to QI to nsIDocument!");
- return NS_ERROR_FAILURE;
- }
-
- nsCOMPtr<nsPIDOMWindow> window = document->GetWindow();
- if (!window) {
- fail("Failed to get window from document!");
- return NS_ERROR_FAILURE;
- }
-
- nsCOMPtr<nsIDOMWindowUtils> utils = do_GetInterface(window);
- if (!utils) {
- fail("Failed to get DOMWindowUtils!");
- return NS_ERROR_FAILURE;
- }
-
- if (!ScheduleTimer(utils)) {
- return NS_ERROR_FAILURE;
- }
-
- return NS_OK;
- }
-
- if (type.EqualsLiteral("keypress")) {
- passed("Got keypress event");
-
- nsCOMPtr<nsIRunnable> runnable = new StableStateRunnable();
- nsresult rv = mAppShell->RunBeforeNextEvent(runnable);
- if (NS_FAILED(rv)) {
- fail("RunBeforeNextEvent returned failure code %u", rv);
- return NS_ERROR_FAILURE;
- }
-
- return NS_OK;
- }
-
- fail("Got an unexpected event: %s", NS_ConvertUTF16toUTF8(type).get());
- return NS_OK;
- }
-
-#ifdef XP_WIN
- static VOID CALLBACK
- TimerCallback(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime)
- {
- if (sWindowUtils) {
- nsCOMPtr<nsIDOMWindowUtils> utils = dont_AddRef(sWindowUtils);
- sWindowUtils = nullptr;
-
- if (gStableStateEventHasRun) {
- fail("StableStateRunnable ran at wrong time");
- } else {
- passed("StableStateRunnable state correct (false)");
- }
-
- int32_t layout = 0x409; // US
- int32_t keyCode = 0x41; // VK_A
- NS_NAMED_LITERAL_STRING(a, "a");
-
- if (NS_FAILED(utils->SendNativeKeyEvent(layout, keyCode, 0, a, a, nullptr))) {
- fail("Failed to synthesize native event");
- }
-
- return;
- }
-
- KillTimer(nullptr, idEvent);
-
- nsCOMPtr<nsIAppShell> appShell = dont_AddRef(sAppShell);
-
- if (!gStableStateEventHasRun) {
- fail("StableStateRunnable didn't run yet");
- } else {
- passed("StableStateRunnable state correct (true)");
- }
-
- nsCOMPtr<nsIRunnable> runnable = new NextTestRunnable(appShell);
- if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
- fail("Failed to dispatch next test runnable");
- }
-
- }
-#endif
-
- bool
- ScheduleTimer(nsIDOMWindowUtils* aWindowUtils)
- {
-#ifdef XP_WIN
- UINT_PTR timerId = SetTimer(nullptr, 0, 1000, (TIMERPROC)TimerCallback);
- if (!timerId) {
- fail("SetTimer failed!");
- return false;
- }
-
- nsCOMPtr<nsIDOMWindowUtils> utils = aWindowUtils;
- utils.forget(&sWindowUtils);
-
- nsCOMPtr<nsIAppShell> appShell = mAppShell;
- appShell.forget(&sAppShell);
-
- return true;
-#else
- return false;
-#endif
- }
-};
-
-nsIDOMWindowUtils* EventListener::sWindowUtils = nullptr;
-nsIAppShell* EventListener::sAppShell = nullptr;
-
-NS_IMPL_ISUPPORTS(EventListener, nsIDOMEventListener)
-
-already_AddRefed<nsIAppShell>
-GetAppShell()
-{
- static const char* platforms[] = {
- "android", "mac", "gtk", "qt", "win"
- };
-
- NS_NAMED_LITERAL_CSTRING(contractPrefix, "@mozilla.org/widget/appshell/");
- NS_NAMED_LITERAL_CSTRING(contractSuffix, ";1");
-
- for (size_t index = 0; index < ArrayLength(platforms); index++) {
- nsAutoCString contractID(contractPrefix);
- contractID.AppendASCII(platforms[index]);
- contractID.Append(contractSuffix);
-
- nsCOMPtr<nsIAppShell> appShell = do_GetService(contractID.get());
- if (appShell) {
- return appShell.forget();
- }
- }
-
- return nullptr;
-}
-
-void
-Test1(nsIAppShell* aAppShell)
-{
- // Schedule stable state runnable to be run before next event.
-
- nsCOMPtr<nsIRunnable> runnable = new StableStateRunnable();
- if (NS_FAILED(aAppShell->RunBeforeNextEvent(runnable))) {
- fail("RunBeforeNextEvent failed");
- }
-
- runnable = new CheckStableStateRunnable(true);
- if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
- fail("Failed to dispatch check runnable");
- }
-
- runnable = new NextTestRunnable(aAppShell);
- if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
- fail("Failed to dispatch next test runnable");
- }
-}
-
-void
-Test2(nsIAppShell* aAppShell)
-{
- // Schedule stable state runnable to be run before next event from another
- // runnable.
-
- nsCOMPtr<nsIRunnable> runnable = new ScheduleStableStateRunnable(aAppShell);
- if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
- fail("Failed to dispatch schedule runnable");
- }
-
- runnable = new CheckStableStateRunnable(true);
- if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
- fail("Failed to dispatch check runnable");
- }
-
- runnable = new NextTestRunnable(aAppShell);
- if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
- fail("Failed to dispatch next test runnable");
- }
-}
-
-void
-Test3(nsIAppShell* aAppShell)
-{
- // Schedule steadystate runnable to be run before next event with nested loop.
-
- nsCOMPtr<nsIRunnable> runnable =
- new ScheduleNestedStableStateRunnable(aAppShell);
- if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
- fail("Failed to dispatch schedule runnable");
- }
-}
-
-bool
-Test4Internal(nsIAppShell* aAppShell)
-{
-#ifndef XP_WIN
- // Not sure how to test on other platforms.
- return false;
-#else
- nsCOMPtr<nsIAppShellService> appService =
- do_GetService(NS_APPSHELLSERVICE_CONTRACTID);
- if (!appService) {
- fail("Failed to get appshell service!");
- return false;
- }
-
- nsCOMPtr<nsIURI> uri;
- if (NS_FAILED(NS_NewURI(getter_AddRefs(uri), "about:", nullptr))) {
- fail("Failed to create new uri");
- return false;
- }
-
- uint32_t flags = nsIWebBrowserChrome::CHROME_DEFAULT;
-
- nsCOMPtr<nsIXULWindow> xulWindow;
- if (NS_FAILED(appService->CreateTopLevelWindow(nullptr, uri, flags, 100, 100, nullptr,
- getter_AddRefs(xulWindow)))) {
- fail("Failed to create new window");
- return false;
- }
-
- nsCOMPtr<nsIDOMWindow> window = do_GetInterface(xulWindow);
- if (!window) {
- fail("Can't get dom window!");
- return false;
- }
-
- nsCOMPtr<nsIDOMEventTarget> target = do_QueryInterface(window);
- if (!target) {
- fail("Can't QI to nsIDOMEventTarget!");
- return false;
- }
-
- nsCOMPtr<nsIDOMEventListener> listener = new EventListener(aAppShell);
- if (NS_FAILED(target->AddEventListener(NS_LITERAL_STRING("keypress"),
- listener, false, false)) ||
- NS_FAILED(target->AddEventListener(NS_LITERAL_STRING("load"), listener,
- false, false))) {
- fail("Can't add event listeners!");
- return false;
- }
-
- return true;
-#endif
-}
-
-void
-Test4(nsIAppShell* aAppShell)
-{
- if (!Test4Internal(aAppShell)) {
- nsCOMPtr<nsIRunnable> runnable = new NextTestRunnable(aAppShell);
- if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
- fail("Failed to dispatch next test runnable");
- }
- }
-}
-
-const TestFunc gTests[] = {
- Test1, Test2, Test3, Test4
-};
-
-size_t gTestIndex = 0;
-
-NS_IMETHODIMP
-NextTestRunnable::Run()
-{
- if (gTestIndex > 0) {
- passed("Finished test %u", gTestIndex);
- }
-
- gStableStateEventHasRun = false;
-
- if (gTestIndex < ArrayLength(gTests)) {
- gTests[gTestIndex++](mAppShell);
- }
- else {
- nsCOMPtr<nsIRunnable> exitRunnable = new ExitAppShellRunnable(mAppShell);
-
- nsresult rv = NS_DispatchToCurrentThread(exitRunnable);
- if (NS_FAILED(rv)) {
- fail("Failed to dispatch exit runnable!");
- }
- }
-
- return NS_OK;
-}
-
-int main(int argc, char** argv)
-{
- ScopedLogging log;
- ScopedXPCOM xpcom("TestAppShellSteadyState");
-
- if (!xpcom.failed()) {
- nsCOMPtr<nsIAppShell> appShell = GetAppShell();
- if (!appShell) {
- fail("Couldn't get appshell!");
- } else {
- nsCOMPtr<nsIRunnable> runnable = new NextTestRunnable(appShell);
- if (NS_FAILED(NS_DispatchToCurrentThread(runnable))) {
- fail("Failed to dispatch next test runnable");
- } else if (NS_FAILED(appShell->Run())) {
- fail("Failed to run appshell");
- }
- }
- }
-
- return gFailCount != 0;
-}
diff --git a/widget/tests/TestChromeMargin.cpp b/widget/tests/TestChromeMargin.cpp
deleted file mode 100644
index 22330f467..000000000
--- a/widget/tests/TestChromeMargin.cpp
+++ /dev/null
@@ -1,155 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-/* This tests the margin parsing functionality in nsAttrValue.cpp, which
- * is accessible via nsContentUtils, and is used in setting chromemargins
- * to widget windows. It's located here due to linking issues in the
- * content directory.
- */
-
-/* This test no longer compiles now that we've removed nsIContentUtils (bug
- * 647273). We need to be internal code in order to include nsContentUtils.h,
- * but defining MOZILLA_INTERNAL_API is not enough to make us internal.
- */
-
-#include "TestHarness.h"
-
-#ifndef MOZILLA_INTERNAL_API
-// some of the includes make use of internal string types
-#define nsAString_h___
-#define nsString_h___
-#define nsStringFwd_h___
-#define nsReadableUtils_h___
-class nsACString;
-class nsAString;
-class nsAFlatString;
-class nsAFlatCString;
-class nsAdoptingString;
-class nsAdoptingCString;
-class nsXPIDLString;
-template<class T> class nsReadingIterator;
-#endif
-
-#include "nscore.h"
-#include "nsContentUtils.h"
-
-#ifndef MOZILLA_INTERNAL_API
-#undef nsString_h___
-#undef nsAString_h___
-#undef nsReadableUtils_h___
-#endif
-
-struct DATA {
- bool shouldfail;
- const char* margins;
- int top;
- int right;
- int bottom;
- int left;
-};
-
-const bool SHOULD_FAIL = true;
-const int SHOULD_PASS = false;
-
-const DATA Data[] = {
- { SHOULD_FAIL, "", 1, 2, 3, 4 },
- { SHOULD_FAIL, "1,0,0,0", 1, 2, 3, 4 },
- { SHOULD_FAIL, "1,2,0,0", 1, 2, 3, 4 },
- { SHOULD_FAIL, "1,2,3,0", 1, 2, 3, 4 },
- { SHOULD_FAIL, "4,3,2,1", 1, 2, 3, 4 },
- { SHOULD_FAIL, "azsasdasd", 0, 0, 0, 0 },
- { SHOULD_FAIL, ",azsasdasd", 0, 0, 0, 0 },
- { SHOULD_FAIL, " ", 1, 2, 3, 4 },
- { SHOULD_FAIL, "azsdfsdfsdfsdfsdfsasdasd,asdasdasdasdasdasd,asdadasdasd,asdasdasdasd", 0, 0, 0, 0 },
- { SHOULD_FAIL, "as,as,as,as", 0, 0, 0, 0 },
- { SHOULD_FAIL, "0,0,0", 0, 0, 0, 0 },
- { SHOULD_FAIL, "0,0", 0, 0, 0, 0 },
- { SHOULD_FAIL, "4.6,1,1,1", 0, 0, 0, 0 },
- { SHOULD_FAIL, ",,,,", 0, 0, 0, 0 },
- { SHOULD_FAIL, "1, , , ,", 0, 0, 0, 0 },
- { SHOULD_FAIL, "1, , ,", 0, 0, 0, 0 },
- { SHOULD_FAIL, "@!@%^&^*()", 1, 2, 3, 4 },
- { SHOULD_PASS, "4,3,2,1", 4, 3, 2, 1 },
- { SHOULD_PASS, "-4,-3,-2,-1", -4, -3, -2, -1 },
- { SHOULD_PASS, "10000,3,2,1", 10000, 3, 2, 1 },
- { SHOULD_PASS, "4 , 3 , 2 , 1", 4, 3, 2, 1 },
- { SHOULD_PASS, "4, 3 ,2,1", 4, 3, 2, 1 },
- { SHOULD_FAIL, "4,3,2,10000000000000 --", 4, 3, 2, 10000000000000 },
- { SHOULD_PASS, "4,3,2,1000", 4, 3, 2, 1000 },
- { SHOULD_PASS, "2147483647,3,2,1000", 2147483647, 3, 2, 1000 },
- { SHOULD_PASS, "2147483647,2147483647,2147483647,2147483647", 2147483647, 2147483647, 2147483647, 2147483647 },
- { SHOULD_PASS, "-2147483647,3,2,1000", -2147483647, 3, 2, 1000 },
- { SHOULD_FAIL, "2147483648,3,2,1000", 1, 3, 2, 1000 },
- { 0, nullptr, 0, 0, 0, 0 }
-};
-
-void DoAttrValueTest()
-{
- int idx = -1;
- bool didFail = false;
- while (Data[++idx].margins) {
- nsAutoString str;
- str.AssignLiteral(Data[idx].margins);
- nsIntMargin values(99,99,99,99);
- bool result = nsContentUtils::ParseIntMarginValue(str, values);
-
- // if the parse fails
- if (!result) {
- if (Data[idx].shouldfail)
- continue;
- fail(Data[idx].margins);
- didFail = true;
- printf("*1\n");
- continue;
- }
-
- if (Data[idx].shouldfail) {
- if (Data[idx].top == values.top &&
- Data[idx].right == values.right &&
- Data[idx].bottom == values.bottom &&
- Data[idx].left == values.left) {
- // not likely
- fail(Data[idx].margins);
- didFail = true;
- printf("*2\n");
- continue;
- }
- // good failure, parse failed and that's what we expected.
- continue;
- }
-#if 0
- printf("%d==%d %d==%d %d==%d %d==%d\n",
- Data[idx].top, values.top,
- Data[idx].right, values.right,
- Data[idx].bottom, values.bottom,
- Data[idx].left, values.left);
-#endif
- if (Data[idx].top == values.top &&
- Data[idx].right == values.right &&
- Data[idx].bottom == values.bottom &&
- Data[idx].left == values.left) {
- // good parse results
- continue;
- }
- else {
- fail(Data[idx].margins);
- didFail = true;
- printf("*3\n");
- continue;
- }
- }
-
- if (!didFail)
- passed("nsAttrValue margin parsing tests passed.");
-}
-
-int main(int argc, char** argv)
-{
- ScopedXPCOM xpcom("");
- if (xpcom.failed())
- return 1;
- DoAttrValueTest();
- return 0;
-}
diff --git a/widget/tests/bug586713_window.xul b/widget/tests/bug586713_window.xul
deleted file mode 100644
index 78397afad..000000000
--- a/widget/tests/bug586713_window.xul
+++ /dev/null
@@ -1,50 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window id="bug586713_window"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="300"
- height="300"
- onload="onLoad();"
- title="Bug 586713 Test">
-
- <menubar id="nativemenubar">
- <menu id="foo" label="Foo">
- <menupopup>
- <menuitem label="FooItem0"/>
- </menupopup>
- </menu>
- </menubar>
-
- <script type="application/javascript"><![CDATA[
- function ok(condition, message) {
- window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
- }
-
- function onTestsFinished() {
- window.close();
- window.opener.wrappedJSObject.SimpleTest.finish();
- }
-
- var fooCallCount = 0;
- function foo() {
- fooCallCount++;
- let instruction = document.createProcessingInstruction("xml-stylesheet", 'href="chrome://foo.css" type="text/css"');
- document.insertBefore(instruction, document.documentElement);
- if (fooCallCount == 2) {
- ok(true, "If we got here we didn't crash, excellent.");
- onTestsFinished();
- }
- }
-
- function onLoad() {
- foo();
- setTimeout(() => foo(), 0);
- }
- ]]></script>
-</window>
diff --git a/widget/tests/chrome.ini b/widget/tests/chrome.ini
deleted file mode 100644
index 00d0d57a9..000000000
--- a/widget/tests/chrome.ini
+++ /dev/null
@@ -1,100 +0,0 @@
-[DEFAULT]
-skip-if = os == 'android'
-support-files =
- empty_window.xul
- utils.js
-
-[test_bug343416.xul]
-skip-if = debug
-[test_bug429954.xul]
-support-files = window_bug429954.xul
-[test_bug444800.xul]
-subsuite = clipboard
-[test_bug478536.xul]
-skip-if = true # Bug 561929
-support-files = window_bug478536.xul
-[test_bug517396.xul]
-[test_bug538242.xul]
-support-files = window_bug538242.xul
-[test_bug593307.xul]
-support-files = window_bug593307_offscreen.xul window_bug593307_centerscreen.xul
-[test_bug1151186.html]
-skip-if = os == 'linux' && debug #Bug 1176038
-[test_keycodes.xul]
-[test_wheeltransaction.xul]
-support-files = window_wheeltransaction.xul
-[test_imestate.html]
-support-files = window_imestate_iframes.html
-[test_plugin_scroll_consistency.html]
-[test_composition_text_querycontent.xul]
-support-files = window_composition_text_querycontent.xul
-[test_input_events_on_deactive_window.xul]
-[test_position_on_resize.xul]
-[test_sizemode_events.xul]
-[test_taskbar_progress.xul]
-skip-if = toolkit != "cocoa" && toolkit != "windows"
-[test_bug760802.xul]
-[test_clipboard.xul]
-subsuite = clipboard
-[test_panel_mouse_coords.xul]
-skip-if = toolkit == "windows" # bug 1009955
-
-# Cocoa
-[test_native_menus.xul]
-skip-if = toolkit != "cocoa"
-support-files = native_menus_window.xul
-[test_native_mouse_mac.xul]
-skip-if = toolkit != "cocoa" || os_version == '10.10' # 10.10: bug 1137575
-support-files = native_mouse_mac_window.xul
-[test_bug413277.html]
-skip-if = toolkit != "cocoa"
-[test_bug428405.xul]
-skip-if = toolkit != "cocoa"
-[test_bug466599.xul]
-subsuite = clipboard
-skip-if = toolkit != "cocoa"
-[test_bug485118.xul]
-skip-if = toolkit != "cocoa"
-[test_bug522217.xul]
-tags = fullscreen
-skip-if = toolkit != "cocoa"
-support-files = window_bug522217.xul
-[test_platform_colors.xul]
-#skip-if = toolkit != "cocoa"
-skip-if = true # Bug 1207190
-[test_standalone_native_menu.xul]
-skip-if = toolkit != "cocoa"
-support-files = standalone_native_menu_window.xul
-[test_bug586713.xul]
-skip-if = toolkit != "cocoa"
-support-files = bug586713_window.xul
-[test_key_event_counts.xul]
-skip-if = toolkit != "cocoa"
-[test_bug596600.xul]
-skip-if = toolkit != "cocoa"
-[test_bug673301.xul]
-subsuite = clipboard
-skip-if = toolkit != "cocoa"
-[test_secure_input.html]
-skip-if = toolkit != "cocoa"
-[test_native_key_bindings_mac.html]
-skip-if = toolkit != "cocoa"
-[test_system_status_bar.xul]
-skip-if = toolkit != "cocoa"
-
-# Windows
-# taskbar_previews.xul
-# window_state_windows.xul
-[test_chrome_context_menus_win.xul]
-skip-if = toolkit != "windows"
-support-files = chrome_context_menus_win.xul
-[test_plugin_input_event.html]
-skip-if = toolkit != "windows"
-[test_mouse_scroll.xul]
-skip-if = toolkit != "windows"
-support-files = window_mouse_scroll_win.html
-
-# Privacy relevant
-[test_bug1123480.xul]
-subsuite = clipboard
-
diff --git a/widget/tests/chrome_context_menus_win.xul b/widget/tests/chrome_context_menus_win.xul
deleted file mode 100644
index 9a4590747..000000000
--- a/widget/tests/chrome_context_menus_win.xul
+++ /dev/null
@@ -1,101 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window id="ChromeContextMenuTest"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="300"
- height="300"
- title="Chrome Context Menu Test w/Plugin Focus">
-
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-<script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-
-<popupset>
- <menupopup id="testmenu" onpopupshown="menuDisplayed()">
- <menuitem label="One"/>
- <menuitem label="Two"/>
- <menuitem label="Three"/>
- </menupopup>
-</popupset>
-
-<toolbox>
- <toolbar id="nav-toolbar" style="height:30px" context="testmenu">
- </toolbar>
-</toolbox>
-
-<script type="application/javascript"><![CDATA[
-
-function ok(condition, message) {
- window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
-}
-
-function onTestsFinished() {
- window.close();
- window.opener.wrappedJSObject.SimpleTest.finish();
-}
-
-function openContextMenuFor(element) {
-
- var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
-
- var tbX = (window.mozInnerScreenX + 10) * utils.screenPixelsPerCSSPixel;
- var tbY = (window.mozInnerScreenY + 10) * utils.screenPixelsPerCSSPixel;
-
- // See nsWidnow's SynthesizeNativeMouseEvent & SendInput on msdn
- var MOUSEEVENTF_RIGHTDOWN = 0x0008;
- var MOUSEEVENTF_RIGHTUP = 0x0010;
-
- utils.sendNativeMouseEvent(tbX, tbY,
- MOUSEEVENTF_RIGHTDOWN,
- 0, element);
- utils.sendNativeMouseEvent(tbX, tbY,
- MOUSEEVENTF_RIGHTUP,
- 0, element);
-}
-
-var tid = 0;
-
-function onFocus() {
- var _delayedOnLoad = function() {
- var plugin = document.getElementById("plugin");
- var toolbar = document.getElementById("nav-toolbar");
-
- plugin.focus();
-
- tid = setTimeout("menuTimeout()", 5000);
-
- openContextMenuFor(toolbar);
- }
- setTimeout(_delayedOnLoad, 3000);
-}
-
-function menuTimeout() {
- ok(false, "Right-click chrome menu did not display with focus on a plugin.");
- onTestsFinished();
-}
-
-function menuDisplayed() {
- clearTimeout(tid);
- ok(true, "Right-click chrome menu displayed despite plugin having focus.");
- onTestsFinished();
-}
-
-window.opener.wrappedJSObject.SimpleTest.waitForFocus(onFocus, window);
-
-
-]]></script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
- <br/>
- <embed id="plugin" type="application/x-test" width="50" height="50"></embed>
-</body>
-
-</window>
diff --git a/widget/tests/empty_window.xul b/widget/tests/empty_window.xul
deleted file mode 100644
index f0e01761d..000000000
--- a/widget/tests/empty_window.xul
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<window title="Empty window"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>
diff --git a/widget/tests/mochitest.ini b/widget/tests/mochitest.ini
deleted file mode 100644
index bf7bfe689..000000000
--- a/widget/tests/mochitest.ini
+++ /dev/null
@@ -1,12 +0,0 @@
-[DEFAULT]
-support-files = utils.js
-
-[test_assign_event_data.html]
-subsuite = clipboard
-skip-if = toolkit == "cocoa" # Mac: Bug 933303
-[test_bug565392.html]
-subsuite = clipboard
-skip-if = toolkit != "windows" || e10s # Bug 1267406
-[test_picker_no_crash.html]
-skip-if = toolkit != "windows" || e10s # Bug 1267491
-support-files = window_picker_no_crash_child.html
diff --git a/widget/tests/moz.build b/widget/tests/moz.build
deleted file mode 100644
index 750202b48..000000000
--- a/widget/tests/moz.build
+++ /dev/null
@@ -1,15 +0,0 @@
-# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
-# vim: set filetype=python:
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-XPCSHELL_TESTS_MANIFESTS += ['unit/xpcshell.ini']
-MOCHITEST_MANIFESTS += ['mochitest.ini']
-MOCHITEST_CHROME_MANIFESTS += ['chrome.ini']
-
-# if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
-#
-# Test disabled because it requires the internal API. Re-enabling this test
-# is bug 652123.
-# CPP_UNIT_TESTS += ['TestChromeMargin']
diff --git a/widget/tests/native_menus_window.xul b/widget/tests/native_menus_window.xul
deleted file mode 100644
index 6e614d017..000000000
--- a/widget/tests/native_menus_window.xul
+++ /dev/null
@@ -1,285 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window id="NativeMenuWindow"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="300"
- height="300"
- onload="onLoad();"
- title="Native Menu Test">
-
- <command id="cmd_FooItem0" oncommand="executedCommandID = 'cmd_FooItem0';"/>
- <command id="cmd_FooItem1" oncommand="executedCommandID = 'cmd_FooItem1';"/>
- <command id="cmd_BarItem0" oncommand="executedCommandID = 'cmd_BarItem0';"/>
- <command id="cmd_BarItem1" oncommand="executedCommandID = 'cmd_BarItem1';"/>
- <command id="cmd_NewItem0" oncommand="executedCommandID = 'cmd_NewItem0';"/>
- <command id="cmd_NewItem1" oncommand="executedCommandID = 'cmd_NewItem1';"/>
- <command id="cmd_NewItem2" oncommand="executedCommandID = 'cmd_NewItem2';"/>
- <command id="cmd_NewItem3" oncommand="executedCommandID = 'cmd_NewItem3';"/>
- <command id="cmd_NewItem4" oncommand="executedCommandID = 'cmd_NewItem4';"/>
- <command id="cmd_NewItem5" oncommand="executedCommandID = 'cmd_NewItem5';"/>
-
- <!-- We do not modify any menus or menu items defined here in testing. These
- serve as a baseline structure for us to test after other modifications.
- We add children to the menubar defined here and test by modifying those
- children. -->
- <menubar id="nativemenubar">
- <menu id="foo" label="Foo">
- <menupopup>
- <menuitem label="FooItem0" command="cmd_FooItem0"/>
- <menuitem label="FooItem1" command="cmd_FooItem1"/>
- <menuseparator/>
- <menu label="Bar">
- <menupopup>
- <menuitem label="BarItem0" command="cmd_BarItem0"/>
- <menuitem label="BarItem1" command="cmd_BarItem1"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- </menubar>
-
- <script type="application/javascript"><![CDATA[
-
- function ok(condition, message) {
- window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
- }
-
- function onTestsFinished() {
- window.close();
- window.opener.wrappedJSObject.SimpleTest.finish();
- }
-
- // Force a menu to update itself. All of the menus parents will be updated
- // as well. An empty string will force a complete menu system reload.
- function forceUpdateNativeMenuAt(location) {
- var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
- try {
- utils.forceUpdateNativeMenuAt(location);
- }
- catch (e) {
- dump(e + "\n");
- }
- }
-
- var executedCommandID = "";
-
- function testItem(location, targetID) {
- var utils = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
- var correctCommandHandler = false;
- try {
- utils.activateNativeMenuItemAt(location);
- correctCommandHandler = executedCommandID == targetID;
- }
- catch (e) {
- dump(e + "\n");
- }
- finally {
- executedCommandID = "";
- return correctCommandHandler;
- }
- }
-
- function createXULMenuPopup() {
- const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
- var item = document.createElementNS(XUL_NS, "menupopup");
- return item;
- }
-
- function createXULMenu(aLabel) {
- const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
- var item = document.createElementNS(XUL_NS, "menu");
- item.setAttribute("label", aLabel);
- return item;
- }
-
- function createXULMenuItem(aLabel, aCommandId) {
- const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
- var item = document.createElementNS(XUL_NS, "menuitem");
- item.setAttribute("label", aLabel);
- item.setAttribute("command", aCommandId);
- return item;
- }
-
- function runBaseMenuTests() {
- forceUpdateNativeMenuAt("0|3");
- return testItem("0|0", "cmd_FooItem0") &&
- testItem("0|1", "cmd_FooItem1") &&
- testItem("0|3|0", "cmd_BarItem0") &&
- testItem("0|3|1", "cmd_BarItem1");
- }
-
- function onLoad() {
- var _delayedOnLoad = function() {
- // First let's run the base menu tests.
- ok(runBaseMenuTests());
-
- // Set up some nodes that we'll use.
- var menubarNode = document.getElementById("nativemenubar");
- var newMenu0 = createXULMenu("NewMenu0");
- var newMenu1 = createXULMenu("NewMenu1");
- var newMenuPopup0 = createXULMenuPopup();
- var newMenuPopup1 = createXULMenuPopup();
- var newMenuItem0 = createXULMenuItem("NewMenuItem0", "cmd_NewItem0");
- var newMenuItem1 = createXULMenuItem("NewMenuItem1", "cmd_NewItem1");
- var newMenuItem2 = createXULMenuItem("NewMenuItem2", "cmd_NewItem2");
- var newMenuItem3 = createXULMenuItem("NewMenuItem3", "cmd_NewItem3");
- var newMenuItem4 = createXULMenuItem("NewMenuItem4", "cmd_NewItem4");
- var newMenuItem5 = createXULMenuItem("NewMenuItem5", "cmd_NewItem5");
-
- // Create another submenu with hierarchy via DOM manipulation.
- // ******************
- // * Foo * NewMenu0 * <- Menu bar
- // ******************
- // ****************
- // * NewMenuItem0 * <- NewMenu0 submenu
- // ****************
- // * NewMenuItem1 *
- // ****************
- // * NewMenuItem2 *
- // *******************************
- // * NewMenu1 > * NewMenuItem3 * <- NewMenu1 submenu
- // *******************************
- // * NewMenuItem4 *
- // ****************
- // * NewMenuItem5 *
- // ****************
- newMenu0.appendChild(newMenuPopup0);
- newMenuPopup0.appendChild(newMenuItem0);
- newMenuPopup0.appendChild(newMenuItem1);
- newMenuPopup0.appendChild(newMenuItem2);
- newMenuPopup0.appendChild(newMenu1);
- newMenu1.appendChild(newMenuPopup1);
- newMenuPopup1.appendChild(newMenuItem3);
- newMenuPopup1.appendChild(newMenuItem4);
- newMenuPopup1.appendChild(newMenuItem5);
- //XXX - we have to append the menu to the top-level of the menu bar
- // only after constructing it. If we append before construction, it is
- // invalid because it has no children and we don't validate it if we add
- // children later.
- menubarNode.appendChild(newMenu0);
- forceUpdateNativeMenuAt("1|3");
- // Run basic tests again.
- ok(runBaseMenuTests());
-
- // Error strings.
- var sa = "Command handler(s) should have activated";
- var sna = "Command handler(s) should not have activated";
-
- // Test middle items.
- ok(testItem("1|1", "cmd_NewItem1"), sa);
- ok(testItem("1|3|1", "cmd_NewItem4"), sa);
-
- // Hide newMenu0.
- newMenu0.setAttribute("hidden", "true");
- ok(runBaseMenuTests(), sa); // the base menu should still be unhidden
- ok(!testItem("1|0", ""), sna);
- ok(!testItem("1|1", ""), sna);
- ok(!testItem("1|2", ""), sna);
- ok(!testItem("1|3|0", ""), sna);
- ok(!testItem("1|3|1", ""), sna);
- ok(!testItem("1|3|2", ""), sna);
-
- // Show newMenu0.
- newMenu0.setAttribute("hidden", "false");
- forceUpdateNativeMenuAt("1|3");
- ok(runBaseMenuTests(), sa);
- ok(testItem("1|0", "cmd_NewItem0"), sa);
- ok(testItem("1|1", "cmd_NewItem1"), sa);
- ok(testItem("1|2", "cmd_NewItem2"), sa);
- ok(testItem("1|3|0", "cmd_NewItem3"), sa);
- ok(testItem("1|3|1", "cmd_NewItem4"), sa);
- ok(testItem("1|3|2", "cmd_NewItem5"), sa);
-
- // Hide items.
- newMenuItem1.setAttribute("hidden", "true");
- newMenuItem4.setAttribute("hidden", "true");
- forceUpdateNativeMenuAt("1|2");
- ok(runBaseMenuTests(), sa);
- ok(testItem("1|0", "cmd_NewItem0"), sa);
- ok(testItem("1|1", "cmd_NewItem2"), sa);
- ok(!testItem("1|2", ""), sna);
- ok(testItem("1|2|0", "cmd_NewItem3"), sa);
- ok(testItem("1|2|1", "cmd_NewItem5"), sa);
- ok(!testItem("1|2|2", ""), sna);
-
- // Show items.
- newMenuItem1.setAttribute("hidden", "false");
- newMenuItem4.setAttribute("hidden", "false");
- forceUpdateNativeMenuAt("1|3");
- ok(runBaseMenuTests(), sa);
- ok(testItem("1|0", "cmd_NewItem0"), sa);
- ok(testItem("1|1", "cmd_NewItem1"), sa);
- ok(testItem("1|2", "cmd_NewItem2"), sa);
- ok(testItem("1|3|0", "cmd_NewItem3"), sa);
- ok(testItem("1|3|1", "cmd_NewItem4"), sa);
- ok(testItem("1|3|2", "cmd_NewItem5"), sa);
-
- // At this point in the tests the state of the menus has been returned
- // to the originally diagramed state.
-
- // Test command disabling
- var cmd_NewItem0 = document.getElementById("cmd_NewItem0");
- ok(testItem("1|0", "cmd_NewItem0"), sa);
- cmd_NewItem0.setAttribute("disabled", "true");
- ok(!testItem("1|0", "cmd_NewItem0"), sna);
- cmd_NewItem0.removeAttribute("disabled");
- ok(testItem("1|0", "cmd_NewItem0"), sa);
-
- // Remove menu.
- menubarNode.removeChild(newMenu0);
- ok(runBaseMenuTests(), sa);
- ok(!testItem("1|0", ""), sna);
- ok(!testItem("1|1", ""), sna);
- ok(!testItem("1|2", ""), sna);
- ok(!testItem("1|3|0", ""), sna);
- ok(!testItem("1|3|1", ""), sna);
- ok(!testItem("1|3|2", ""), sna);
- // return state to original diagramed state
- menubarNode.appendChild(newMenu0);
-
- // Test for bug 447042, make sure that adding a menu node with no children
- // to the menu bar and then adding another menu node with children works.
- // Menus with no children don't get their native menu items shown and that
- // caused internal arrays to get out of sync and an append crashed.
- var tmpMenu0 = createXULMenu("tmpMenu0");
- menubarNode.removeChild(newMenu0);
- menubarNode.appendChild(tmpMenu0);
- menubarNode.appendChild(newMenu0);
- forceUpdateNativeMenuAt("1|3");
- ok(runBaseMenuTests());
- ok(testItem("1|0", "cmd_NewItem0"), sa);
- ok(testItem("1|1", "cmd_NewItem1"), sa);
- ok(testItem("1|2", "cmd_NewItem2"), sa);
- ok(testItem("1|3|0", "cmd_NewItem3"), sa);
- ok(testItem("1|3|1", "cmd_NewItem4"), sa);
- ok(testItem("1|3|2", "cmd_NewItem5"), sa);
- // return state to original diagramed state
- menubarNode.removeChild(tmpMenu0);
- delete tmpMenu0;
-
- // This test is basically a crash test for bug 433858.
- newMenuItem1.setAttribute("hidden", "true");
- newMenuItem2.setAttribute("hidden", "true");
- newMenu1.setAttribute("hidden", "true");
- forceUpdateNativeMenuAt("1");
- newMenuItem1.setAttribute("hidden", "false");
- newMenuItem2.setAttribute("hidden", "false");
- newMenu1.setAttribute("hidden", "false");
- forceUpdateNativeMenuAt("1");
-
- onTestsFinished();
- }
-
- setTimeout(_delayedOnLoad, 1000);
- }
-
- ]]></script>
-</window>
diff --git a/widget/tests/native_mouse_mac_window.xul b/widget/tests/native_mouse_mac_window.xul
deleted file mode 100644
index 8680c3b1a..000000000
--- a/widget/tests/native_mouse_mac_window.xul
+++ /dev/null
@@ -1,773 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window id="NativeMenuWindow"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- xmlns:html="http://www.w3.org/1999/xhtml"
- width="600"
- height="600"
- title="Native Mouse Event Test"
- orient="vertical">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
- <box height="200" id="box"/>
- <menupopup id="popup" width="250" height="50"/>
- <panel id="panel" width="250" height="50" noautohide="true"/>
-
- <script type="application/javascript"><![CDATA[
-
- function ok(condition, message) {
- window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
- }
-
- function is(a, b, message) {
- window.opener.wrappedJSObject.SimpleTest.is(a, b, message);
- }
-
- function todo(condition, message) {
- window.opener.wrappedJSObject.SimpleTest.todo(condition, message);
- }
-
- function todo_is(a, b, message) {
- window.opener.wrappedJSObject.SimpleTest.todo_is(a, b, message);
- }
-
- function onTestsFinished() {
- clearTimeout(gAfterLoopExecution);
- observe(window, eventMonitor, false);
- observe(gRightWindow, eventMonitor, false);
- observe(gPopup, eventMonitor, false);
- gRightWindow.close();
- var openerSimpleTest = window.opener.wrappedJSObject.SimpleTest;
- window.close();
- openerSimpleTest.finish();
- }
-
- const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
- const xulWin = 'data:application/vnd.mozilla.xul+xml,<?xml version="1.0"?><?xml-stylesheet href="chrome://global/skin" type="text/css"?><window xmlns="' + XUL_NS + '"/>';
-
- const NSLeftMouseDown = 1,
- NSLeftMouseUp = 2,
- NSRightMouseDown = 3,
- NSRightMouseUp = 4,
- NSMouseMoved = 5,
- NSLeftMouseDragged = 6,
- NSRightMouseDragged = 7,
- NSMouseEntered = 8,
- NSMouseExited = 9,
- NSKeyDown = 10,
- NSKeyUp = 11,
- NSFlagsChanged = 12,
- NSAppKitDefined = 13,
- NSSystemDefined = 14,
- NSApplicationDefined = 15,
- NSPeriodic = 16,
- NSCursorUpdate = 17,
- NSScrollWheel = 22,
- NSTabletPoint = 23,
- NSTabletProximity = 24,
- NSOtherMouseDown = 25,
- NSOtherMouseUp = 26,
- NSOtherMouseDragged = 27,
- NSEventTypeGesture = 29,
- NSEventTypeMagnify = 30,
- NSEventTypeSwipe = 31,
- NSEventTypeRotate = 18,
- NSEventTypeBeginGesture = 19,
- NSEventTypeEndGesture = 20;
-
- const NSAlphaShiftKeyMask = 1 << 16,
- NSShiftKeyMask = 1 << 17,
- NSControlKeyMask = 1 << 18,
- NSAlternateKeyMask = 1 << 19,
- NSCommandKeyMask = 1 << 20,
- NSNumericPadKeyMask = 1 << 21,
- NSHelpKeyMask = 1 << 22,
- NSFunctionKeyMask = 1 << 23;
-
- const gDebug = false;
-
- function printDebug(msg) { if (gDebug) dump(msg); }
-
- var gExpectedEvents = [];
- var gRightWindow = null, gPopup = null;
- var gCurrentMouseX = 0, gCurrentMouseY = 0;
- var gAfterLoopExecution = 0;
-
- function testMouse(x, y, msg, elem, win, exp, flags, callback) {
- clearExpectedEvents();
- var syntheticEvent = null;
- exp.forEach(function (expEv) {
- expEv.screenX = x;
- expEv.screenY = y;
- if (expEv.synthetic) {
- is(syntheticEvent, null,
- "Can't handle two synthetic events in a single testMouse call");
- syntheticEvent = expEv;
- }
- gExpectedEvents.push(expEv);
- });
- printDebug("sending event: " + x + ", " + y + " (" + msg + ")\n");
- gCurrentMouseX = x;
- gCurrentMouseY = y;
- var utils = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
- var callbackFunc = function() {
- clearExpectedEvents();
- callback();
- }
- if (syntheticEvent) {
- // Set up this listener before we sendNativeMouseEvent, just
- // in case that synchronously calls us.
- eventListenOnce(syntheticEvent.target, syntheticEvent.type,
- // Trigger callbackFunc async, so we're not assuming
- // anything about how our listener gets ordered with
- // others.
- function () { SimpleTest.executeSoon(callbackFunc) });
- }
- utils.sendNativeMouseEvent(x, y, msg, flags || 0, elem);
- if (!syntheticEvent) {
- gAfterLoopExecution = setTimeout(callbackFunc, 0);
- }
- }
-
- function eventListenOnce(elem, name, callback) {
- elem.addEventListener(name, function(e) {
- elem.removeEventListener(name, arguments.callee, false);
- callback(e);
- }, false);
- }
-
- function focusAndThen(win, callback) {
- eventListenOnce(win, "focus", callback);
- printDebug("focusing a window\n");
- win.focus();
- }
-
- function eventToString(e) {
- return JSON.stringify({
- type: e.type, target: e.target.nodeName, screenX: e.screenX, screenY: e.screenY
- });
- }
-
- function clearExpectedEvents() {
- while (gExpectedEvents.length > 0) {
- var expectedEvent = gExpectedEvents.shift();
- var errFun = expectedEvent.shouldFireButDoesnt ? todo : ok;
- errFun(false, "Didn't receive expected event: " + eventToString(expectedEvent));
- }
- }
-
- var gEventNum = 0;
-
- function eventMonitor(e) {
- printDebug("got event: " + eventToString(e) + "\n");
- processEvent(e);
- }
-
- function processEvent(e) {
- if (e.screenX != gCurrentMouseX || e.screenY != gCurrentMouseY) {
- todo(false, "Oh no! Received a stray event from a confused tracking area. Aborting test.");
- onTestsFinished();
- return;
- }
- var expectedEvent = gExpectedEvents.shift();
- if (!expectedEvent) {
- ok(false, "received event I didn't expect: " + eventToString(e));
- return;
- }
- if (e.type != expectedEvent.type) {
- // Didn't get expectedEvent.
- var errFun = expectedEvent.shouldFireButDoesnt ? todo : ok;
- errFun(false, "Didn't receive expected event: " + eventToString(expectedEvent));
- return processEvent(e);
- }
- gEventNum++;
- is(e.screenX, expectedEvent.screenX, gEventNum + " | wrong X coord for event " + eventToString(e));
- is(e.screenY, expectedEvent.screenY, gEventNum + " | wrong Y coord for event " + eventToString(e));
- is(e.target, expectedEvent.target, gEventNum + " | wrong target for event " + eventToString(e));
- if (expectedEvent.firesButShouldnt) {
- todo(false, gEventNum + " | Got an event that should not have fired: " + eventToString(e));
- }
- }
-
- function observe(elem, fun, add) {
- var addOrRemove = add ? "addEventListener" : "removeEventListener";
- elem[addOrRemove]("mousemove", fun, false);
- elem[addOrRemove]("mouseover", fun, false);
- elem[addOrRemove]("mouseout", fun, false);
- elem[addOrRemove]("mousedown", fun, false);
- elem[addOrRemove]("mouseup", fun, false);
- elem[addOrRemove]("click", fun, false);
- }
-
- function start() {
- window.resizeTo(200, 200);
- window.moveTo(50, 50);
- gRightWindow = open(xulWin, '', 'chrome,screenX=300,screenY=50,width=200,height=200');
- eventListenOnce(gRightWindow, "focus", function () {
- focusAndThen(window, runTests);
- });
- gPopup = document.getElementById("popup");
- }
-
- function runTests() {
- observe(window, eventMonitor, true);
- observe(gRightWindow, eventMonitor, true);
- var left = window, right = gRightWindow;
- var leftElem = document.getElementById("box");
- var rightElem = gRightWindow.document.documentElement;
- var panel = document.getElementById("panel");
- var tooltip = (function createTooltipInRightWindow() {
- var _tooltip = right.document.createElementNS(XUL_NS, "tooltip");
- _tooltip.setAttribute("id", "tip");
- _tooltip.setAttribute("width", "80");
- _tooltip.setAttribute("height", "20");
- right.document.documentElement.appendChild(_tooltip);
- return _tooltip;
- })();
- var tests = [
-
- // Part 1: Disallow click-through
-
- function blockClickThrough(callback) {
- document.documentElement.setAttribute("clickthrough", "never");
- gRightWindow.document.documentElement.setAttribute("clickthrough", "never");
- callback();
- },
- // Enter the left window, which is focused.
- [150, 150, NSMouseMoved, null, left, [
- { type: "mouseover", target: leftElem },
- { type: "mousemove", target: leftElem }
- ]],
- // Test that moving inside the window fires mousemove events.
- [170, 150, NSMouseMoved, null, left, [
- { type: "mousemove", target: leftElem },
- ]],
- // Leaving the window should fire a mouseout event...
- [170, 20, NSMouseMoved, null, left, [
- { type: "mouseout", target: leftElem },
- ]],
- // ... and entering a mouseover event.
- [170, 120, NSMouseMoved, null, left, [
- { type: "mouseover", target: leftElem },
- { type: "mousemove", target: leftElem },
- ]],
- // Move over the right window, which is inactive.
- // Inactive windows shouldn't respond to mousemove events when clickthrough="never",
- // so we should only get a mouseout event, no mouseover event.
- [400, 150, NSMouseMoved, null, right, [
- { type: "mouseout", target: leftElem },
- ]],
- // Left-clicking while holding Cmd and middle clicking should work even
- // on inactive windows, but without making them active.
- [400, 150, NSLeftMouseDown, null, right, [
- { type: "mousedown", target: rightElem },
- ], NSCommandKeyMask],
- [400, 150, NSLeftMouseUp, null, right, [
- { type: "mouseup", target: rightElem },
- { type: "click", target: rightElem },
- ], NSCommandKeyMask],
- [400, 150, NSOtherMouseDown, null, right, [
- { type: "mousedown", target: rightElem },
- ]],
- [400, 150, NSOtherMouseUp, null, right, [
- { type: "mouseup", target: rightElem },
- { type: "click", target: rightElem },
- ]],
- // Clicking an inactive window should make it active and fire a mouseover
- // event.
- [400, 150, NSLeftMouseDown, null, right, [
- { type: "mouseover", target: rightElem, synthetic: true },
- ]],
- [400, 150, NSLeftMouseUp, null, right, [
- ]],
- // Now it's focused, so we should get a mousedown event when clicking.
- [400, 150, NSLeftMouseDown, null, right, [
- { type: "mousedown", target: rightElem },
- ]],
- // Let's drag to the right without letting the button go.
- [410, 150, NSLeftMouseDragged, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- // Let go of the mouse.
- [410, 150, NSLeftMouseUp, null, right, [
- { type: "mouseup", target: rightElem },
- { type: "click", target: rightElem },
- ]],
- // Move the mouse back over the left window, which is inactive.
- [150, 170, NSMouseMoved, null, left, [
- { type: "mouseout", target: rightElem },
- ]],
- // Now we're being sneaky. The left window is inactive, but *right*-clicks to it
- // should still get through. Test that.
- // Ideally we'd be bracketing that event with over and out events, too, but it
- // probably doesn't matter too much.
- [150, 170, NSRightMouseDown, null, left, [
- { type: "mouseover", target: leftElem, shouldFireButDoesnt: true },
- { type: "mousedown", target: leftElem },
- { type: "mouseout", target: leftElem, shouldFireButDoesnt: true },
- ]],
- // Let go of the mouse.
- [150, 170, NSRightMouseUp, null, left, [
- { type: "mouseover", target: leftElem, shouldFireButDoesnt: true },
- { type: "mouseup", target: leftElem },
- { type: "click", target: leftElem },
- { type: "mouseout", target: leftElem, shouldFireButDoesnt: true },
- ]],
- // Right clicking hasn't focused it, so the window is still inactive.
- // Let's focus it; this time without the mouse, for variaton's sake.
- // Still, mouseout and mouseover events should fire.
- function raiseLeftWindow(callback) {
- clearExpectedEvents();
- gExpectedEvents.push({ screenX: 150, screenY: 170, type: "mouseover", target: leftElem });
- // We have to be a bit careful here. The synthetic mouse event may
- // not fire for a bit after we focus the left window.
- eventListenOnce(leftElem, "mouseover", function() {
- // Trigger callback async, so we're not assuming
- // anything about how our listener gets ordered with others.
- SimpleTest.executeSoon(callback);
- });
- printDebug("focusing left window");
- left.focus();
- },
- // It's active, so it should respond to mousemove events now.
- [150, 170, NSMouseMoved, null, left, [
- { type: "mousemove", target: leftElem },
- ]],
- // This was boring... let's introduce a popup. It will overlap both the left
- // and the right window.
- function openPopupInLeftWindow(callback) {
- eventListenOnce(gPopup, "popupshown", callback);
- gPopup.openPopupAtScreen(150, 50, true);
- },
- // Move the mouse over the popup.
- [200, 80, NSMouseMoved, gPopup, left, [
- { type: "mouseout", target: leftElem },
- { type: "mouseover", target: gPopup },
- { type: "mousemove", target: gPopup },
- ]],
- // Move the mouse back over the left window outside the popup.
- [160, 170, NSMouseMoved, null, left, [
- { type: "mouseout", target: gPopup },
- { type: "mouseover", target: leftElem },
- { type: "mousemove", target: leftElem },
- ]],
- // Back over the popup...
- [190, 80, NSMouseMoved, gPopup, left, [
- { type: "mouseout", target: leftElem },
- { type: "mouseover", target: gPopup },
- { type: "mousemove", target: gPopup },
- ]],
- // ...and over into the right window.
- // It's inactive, so it shouldn't get mouseover events yet.
- [400, 170, NSMouseMoved, null, right, [
- { type: "mouseout", target: gPopup },
- ]],
- // Again, no mouse events please, even though a popup is open. (bug 425556)
- [400, 180, NSMouseMoved, null, right, [
- ]],
- // Activate the right window with a click.
- // This will close the popup and make the mouse enter the right window.
- [400, 180, NSLeftMouseDown, null, right, [
- { type: "mouseover", target: rightElem, synthetic: true },
- ]],
- [400, 180, NSLeftMouseUp, null, right, [
- ]],
- function verifyPopupClosed2(callback) {
- is(gPopup.popupBoxObject.popupState, "closed", "popup should have closed when clicking");
- callback();
- },
- // Now the right window is active; click it again, just for fun.
- [400, 180, NSLeftMouseDown, null, right, [
- { type: "mousedown", target: rightElem },
- ]],
- [400, 180, NSLeftMouseUp, null, right, [
- { type: "mouseup", target: rightElem },
- { type: "click", target: rightElem },
- ]],
-
- // Time for our next trick: a tooltip!
- // Install the tooltip, but don't show it yet.
- function setTooltip(callback) {
- rightElem.setAttribute("tooltip", "tip");
- gExpectedEvents.push({ screenX: 410, screenY: 180, type: "mousemove", target: rightElem });
- eventListenOnce(rightElem, "popupshown", callback);
- gCurrentMouseX = 410;
- gCurrentMouseY = 180;
- var utils = right.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
- utils.sendNativeMouseEvent(410, 180, NSMouseMoved, 0, null);
- },
- // Now the tooltip is visible.
- // Move the mouse a little to the right.
- [411, 180, NSMouseMoved, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- // Move another pixel.
- [412, 180, NSMouseMoved, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- // Move up and click to make the tooltip go away.
- [412, 80, NSMouseMoved, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- [412, 80, NSLeftMouseDown, null, right, [
- { type: "mousedown", target: rightElem },
- ]],
- [412, 80, NSLeftMouseUp, null, right, [
- { type: "mouseup", target: rightElem },
- { type: "click", target: rightElem },
- ]],
- // OK, next round. Open a panel in the left window, which is inactive.
- function openPanel(callback) {
- eventListenOnce(panel, "popupshown", callback);
- panel.openPopupAtScreen(150, 150, false);
- },
- // The panel is parented, so it will be z-ordered over its parent but
- // under the active window.
- // Now we move the mouse over the part where the panel rect intersects the
- // right window's rect. Since the panel is under the window, all the events
- // should target the right window.
- [390, 170, NSMouseMoved, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- [390, 171, NSMouseMoved, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- [391, 171, NSMouseMoved, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- // Now move off the right window, so that the mouse is directly over the
- // panel.
- [260, 170, NSMouseMoved, panel, left, [
- { type: "mouseout", target: rightElem },
- ]],
- [260, 171, NSMouseMoved, panel, left, [
- ]],
- [261, 171, NSMouseMoved, panel, left, [
- ]],
- // Let's be evil and click it.
- [261, 171, NSLeftMouseDown, panel, left, [
- ]],
- [261, 171, NSLeftMouseUp, panel, left, [
- ]],
- // This didn't focus the window, unfortunately, so let's do it ourselves.
- function raiseLeftWindowTakeTwo(callback) {
- focusAndThen(left, callback);
- },
- // Now mouse events should get through to the panel (which is now over the
- // right window).
- [387, 170, NSMouseMoved, panel, left, [
- { type: "mouseover", target: panel },
- { type: "mousemove", target: panel },
- ]],
- [387, 171, NSMouseMoved, panel, left, [
- { type: "mousemove", target: panel },
- ]],
- [388, 171, NSMouseMoved, panel, left, [
- { type: "mousemove", target: panel },
- ]],
- // Click the panel.
- [388, 171, NSLeftMouseDown, panel, left, [
- { type: "mousedown", target: panel }
- ]],
- [388, 171, NSLeftMouseUp, panel, left, [
- { type: "mouseup", target: panel },
- { type: "click", target: panel },
- ]],
-
- // Last test for this part: Hit testing in the Canyon of Nowhere -
- // the pixel row directly south of the panel, over the left window.
- // Before bug 515003 we wrongly thought the mouse wasn't over any window.
- [173, 200, NSMouseMoved, null, left, [
- { type: "mouseout", target: panel },
- { type: "mouseover", target: leftElem },
- { type: "mousemove", target: leftElem },
- ]],
- [173, 201, NSMouseMoved, null, left, [
- { type: "mousemove", target: leftElem },
- ]],
-
- // Part 2: Allow click-through
-
- function hideThatPanel(callback) {
- eventListenOnce(panel, "popuphidden", callback);
- panel.hidePopup();
- },
- function unblockClickThrough(callback) {
- document.documentElement.removeAttribute("clickthrough");
- gRightWindow.document.documentElement.removeAttribute("clickthrough");
- callback();
- },
- // Enter the left window, which is focused.
- [150, 150, NSMouseMoved, null, left, [
- { type: "mousemove", target: leftElem }
- ]],
- // Test that moving inside the window fires mousemove events.
- [170, 150, NSMouseMoved, null, left, [
- { type: "mousemove", target: leftElem },
- ]],
- // Leaving the window should fire a mouseout event...
- [170, 20, NSMouseMoved, null, left, [
- { type: "mouseout", target: leftElem },
- ]],
- // ... and entering a mouseover event.
- [170, 120, NSMouseMoved, null, left, [
- { type: "mouseover", target: leftElem },
- { type: "mousemove", target: leftElem },
- ]],
- // Move over the right window, which is inactive but still accepts
- // mouse events.
- [400, 150, NSMouseMoved, null, right, [
- { type: "mouseout", target: leftElem },
- { type: "mouseover", target: rightElem },
- { type: "mousemove", target: rightElem },
- ]],
- // Left-clicking while holding Cmd and middle clicking should work
- // on inactive windows, but without making them active.
- [400, 150, NSLeftMouseDown, null, right, [
- { type: "mousedown", target: rightElem },
- ], NSCommandKeyMask],
- [400, 150, NSLeftMouseUp, null, right, [
- { type: "mouseup", target: rightElem },
- { type: "click", target: rightElem },
- ], NSCommandKeyMask],
- [400, 150, NSOtherMouseDown, null, right, [
- { type: "mousedown", target: rightElem },
- ]],
- [400, 150, NSOtherMouseUp, null, right, [
- { type: "mouseup", target: rightElem },
- { type: "click", target: rightElem },
- ]],
- // Clicking an inactive window should make it active
- [400, 150, NSLeftMouseDown, null, right, [
- { type: "mousedown", target: rightElem },
- ]],
- [400, 150, NSLeftMouseUp, null, right, [
- { type: "mouseup", target: rightElem },
- { type: "click", target: rightElem },
- ]],
- // Now it's focused.
- [401, 150, NSLeftMouseDown, null, right, [
- { type: "mousedown", target: rightElem },
- ]],
- // Let's drag to the right without letting the button go.
- [410, 150, NSLeftMouseDragged, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- // Let go of the mouse.
- [410, 150, NSLeftMouseUp, null, right, [
- { type: "mouseup", target: rightElem },
- { type: "click", target: rightElem },
- ]],
- // Move the mouse back over the left window, which is inactive.
- [150, 170, NSMouseMoved, null, left, [
- { type: "mouseout", target: rightElem },
- { type: "mouseover", target: leftElem },
- { type: "mousemove", target: leftElem },
- ]],
- // Right-click it.
- [150, 170, NSRightMouseDown, null, left, [
- { type: "mousedown", target: leftElem },
- ]],
- // Let go of the mouse.
- [150, 170, NSRightMouseUp, null, left, [
- { type: "mouseup", target: leftElem },
- { type: "click", target: leftElem },
- ]],
- // Right clicking hasn't focused it, so the window is still inactive.
- // Let's focus it; this time without the mouse, for variaton's sake.
- function raiseLeftWindow(callback) {
- clearExpectedEvents();
- focusAndThen(left, function () { SimpleTest.executeSoon(callback); });
- },
- // It's active and should still respond to mousemove events.
- [150, 170, NSMouseMoved, null, left, [
- { type: "mousemove", target: leftElem },
- ]],
-
- // This was boring... let's introduce a popup. It will overlap both the left
- // and the right window.
- function openPopupInLeftWindow(callback) {
- eventListenOnce(gPopup, "popupshown", callback);
- gPopup.openPopupAtScreen(150, 50, true);
- },
- // Move the mouse over the popup.
- [200, 80, NSMouseMoved, gPopup, left, [
- { type: "mouseout", target: leftElem },
- { type: "mouseover", target: gPopup },
- { type: "mousemove", target: gPopup },
- ]],
- // Move the mouse back over the left window outside the popup.
- [160, 170, NSMouseMoved, null, left, [
- { type: "mouseout", target: gPopup },
- { type: "mouseover", target: leftElem },
- { type: "mousemove", target: leftElem },
- ]],
- // Back over the popup...
- [190, 80, NSMouseMoved, gPopup, left, [
- { type: "mouseout", target: leftElem },
- { type: "mouseover", target: gPopup },
- { type: "mousemove", target: gPopup },
- ]],
- // ...and over into the right window.
- [400, 170, NSMouseMoved, null, right, [
- { type: "mouseout", target: gPopup },
- { type: "mouseover", target: rightElem },
- { type: "mousemove", target: rightElem },
- ]],
- [400, 180, NSMouseMoved, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- // Activate the right window with a click.
- [400, 180, NSLeftMouseDown, null, right, [
- { type: "mousedown", target: rightElem },
- ]],
- [400, 180, NSLeftMouseUp, null, right, [
- { type: "mouseup", target: rightElem },
- { type: "click", target: rightElem },
- ]],
- function verifyPopupClosed2(callback) {
- is(gPopup.popupBoxObject.popupState, "closed", "popup should have closed when clicking");
- callback();
- },
- // Now the right window is active; click it again, just for fun.
- [400, 180, NSLeftMouseDown, null, right, [
- { type: "mousedown", target: rightElem },
- ]],
- [400, 180, NSLeftMouseUp, null, right, [
- { type: "mouseup", target: rightElem },
- { type: "click", target: rightElem },
- ]],
-
- // Time for our next trick: a tooltip!
- // Install the tooltip, but don't show it yet.
- function setTooltip2(callback) {
- rightElem.setAttribute("tooltip", "tip");
- gExpectedEvents.push({ screenX: 410, screenY: 180, type: "mousemove", target: rightElem });
- eventListenOnce(rightElem, "popupshown", callback);
- gCurrentMouseX = 410;
- gCurrentMouseY = 180;
- var utils = right.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
- utils.sendNativeMouseEvent(410, 180, NSMouseMoved, 0, null);
- },
- // Now the tooltip is visible.
- // Move the mouse a little to the right.
- [411, 180, NSMouseMoved, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- // Move another pixel.
- [412, 180, NSMouseMoved, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- // Move up and click to make the tooltip go away.
- [412, 80, NSMouseMoved, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- [412, 80, NSLeftMouseDown, null, right, [
- { type: "mousedown", target: rightElem },
- ]],
- [412, 80, NSLeftMouseUp, null, right, [
- { type: "mouseup", target: rightElem },
- { type: "click", target: rightElem },
- ]],
- // OK, next round. Open a panel in the left window, which is inactive.
- function openPanel2(callback) {
- eventListenOnce(panel, "popupshown", callback);
- panel.openPopupAtScreen(150, 150, false);
- },
- // The panel is parented, so it will be z-ordered over its parent but
- // under the active window.
- // Now we move the mouse over the part where the panel rect intersects the
- // right window's rect. Since the panel is under the window, all the events
- // should target the right window.
- [390, 170, NSMouseMoved, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- [390, 171, NSMouseMoved, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- [391, 171, NSMouseMoved, null, right, [
- { type: "mousemove", target: rightElem },
- ]],
- // Now move off the right window, so that the mouse is directly over the
- // panel.
- [260, 170, NSMouseMoved, panel, left, [
- { type: "mouseout", target: rightElem },
- { type: "mouseover", target: panel },
- { type: "mousemove", target: panel },
- ]],
- [260, 171, NSMouseMoved, panel, left, [
- { type: "mousemove", target: panel },
- ]],
- [261, 171, NSMouseMoved, panel, left, [
- { type: "mousemove", target: panel },
- ]],
- // Let's be evil and click it.
- [261, 171, NSLeftMouseDown, panel, left, [
- { type: "mousedown", target: panel },
- ]],
- [261, 171, NSLeftMouseUp, panel, left, [
- { type: "mouseup", target: panel },
- { type: "click", target: panel },
- ]],
- // This didn't focus the window, unfortunately, so let's do it ourselves.
- function raiseLeftWindowTakeTwo(callback) {
- focusAndThen(left, callback);
- },
- [387, 170, NSMouseMoved, panel, left, [
- { type: "mousemove", target: panel },
- ]],
- [387, 171, NSMouseMoved, panel, left, [
- { type: "mousemove", target: panel },
- ]],
- [388, 171, NSMouseMoved, panel, left, [
- { type: "mousemove", target: panel },
- ]],
- // Click the panel.
- [388, 171, NSLeftMouseDown, panel, left, [
- { type: "mousedown", target: panel }
- ]],
- [388, 171, NSLeftMouseUp, panel, left, [
- { type: "mouseup", target: panel },
- { type: "click", target: panel },
- ]],
-
- // Last test for today: Hit testing in the Canyon of Nowhere -
- // the pixel row directly south of the panel, over the left window.
- // Before bug 515003 we wrongly thought the mouse wasn't over any window.
- [173, 200, NSMouseMoved, null, left, [
- { type: "mouseout", target: panel },
- { type: "mouseover", target: leftElem },
- { type: "mousemove", target: leftElem },
- ]],
- [173, 201, NSMouseMoved, null, left, [
- { type: "mousemove", target: leftElem },
- ]],
- ];
- function runNextTest() {
- if (!tests.length)
- return onTestsFinished();
-
- var test = tests.shift();
- if (typeof test == "function")
- return test(runNextTest);
-
- var [x, y, msg, elem, win, exp, flags] = test;
- testMouse(x, y, msg, elem, win, exp, flags, runNextTest);
- }
- runNextTest();
- }
-
- SimpleTest.waitForFocus(start);
-
- ]]></script>
-</window>
diff --git a/widget/tests/standalone_native_menu_window.xul b/widget/tests/standalone_native_menu_window.xul
deleted file mode 100644
index 6783a66e6..000000000
--- a/widget/tests/standalone_native_menu_window.xul
+++ /dev/null
@@ -1,334 +0,0 @@
-<?xml version="1.0"?>
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-
-<window id="StandaloneNativeMenuWindow"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="300"
- height="300"
- onload="onLoad();"
- title="nsIStandaloneNativeMenu Test">
-
- <command id="cmd_FooItem0" oncommand="executedCommandID = 'cmd_FooItem0';"/>
- <command id="cmd_FooItem1" oncommand="executedCommandID = 'cmd_FooItem1';"/>
- <command id="cmd_BarItem0" oncommand="executedCommandID = 'cmd_BarItem0';"/>
- <command id="cmd_BarItem1" oncommand="executedCommandID = 'cmd_BarItem1';"/>
- <command id="cmd_NewItem0" oncommand="executedCommandID = 'cmd_NewItem0';"/>
- <command id="cmd_NewItem1" oncommand="executedCommandID = 'cmd_NewItem1';"/>
- <command id="cmd_NewItem2" oncommand="executedCommandID = 'cmd_NewItem2';"/>
- <command id="cmd_NewItem3" oncommand="executedCommandID = 'cmd_NewItem3';"/>
- <command id="cmd_NewItem4" oncommand="executedCommandID = 'cmd_NewItem4';"/>
- <command id="cmd_NewItem5" oncommand="executedCommandID = 'cmd_NewItem5';"/>
-
- <!-- We do not modify any menus or menu items defined here in testing. These
- serve as a baseline structure for us to test after other modifications.
- We add children to the menubar defined here and test by modifying those
- children. -->
- <popupset>
- <menupopup id="standalonenativemenu">
- <menu id="foo" label="Foo">
- <menupopup>
- <menuitem label="FooItem0" command="cmd_FooItem0"/>
- <menuitem label="FooItem1" command="cmd_FooItem1"/>
- <menuseparator/>
- <menu label="Bar">
- <menupopup>
- <menuitem label="BarItem0" command="cmd_BarItem0"/>
- <menuitem label="BarItem1" command="cmd_BarItem1"/>
- </menupopup>
- </menu>
- </menupopup>
- </menu>
- </menupopup>
- </popupset>
-
- <script type="application/javascript"><![CDATA[
-
- function ok(condition, message) {
- window.opener.wrappedJSObject.SimpleTest.ok(condition, message);
- }
-
- function todo(condition, message) {
- window.opener.wrappedJSObject.SimpleTest.todo(condition, message);
- }
-
- function onTestsFinished() {
- window.close();
- window.opener.wrappedJSObject.SimpleTest.finish();
- }
-
- var executedCommandID = "";
-
- function testItem(menu, location, targetID) {
- var correctCommandHandler = false;
- try {
- menu.menuWillOpen();
- menu.activateNativeMenuItemAt(location);
- correctCommandHandler = executedCommandID == targetID;
- }
- catch (e) {
- dump(e + "\n");
- }
- finally {
- executedCommandID = "";
- return correctCommandHandler;
- }
- }
-
- var XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-
- function createXULMenuPopup() {
- return document.createElementNS(XUL_NS, "menupopup");
- }
-
- function createXULMenu(aLabel) {
- var item = document.createElementNS(XUL_NS, "menu");
- item.setAttribute("label", aLabel);
- return item;
- }
-
- function createXULMenuItem(aLabel, aCommandId) {
- var item = document.createElementNS(XUL_NS, "menuitem");
- item.setAttribute("label", aLabel);
- item.setAttribute("command", aCommandId);
- return item;
- }
-
- function runBaseMenuTests(menu) {
- menu.forceUpdateNativeMenuAt("0|3");
- return testItem(menu, "0|0", "cmd_FooItem0") &&
- testItem(menu, "0|1", "cmd_FooItem1") &&
- testItem(menu, "0|3|0", "cmd_BarItem0") &&
- testItem(menu, "0|3|1", "cmd_BarItem1");
- }
-
- function createStandaloneNativeMenu(menuNode) {
- try {
- let Cc = Components.classes;
- let Ci = Components.interfaces;
- let menu = Cc["@mozilla.org/widget/standalonenativemenu;1"].createInstance(Ci.nsIStandaloneNativeMenu);
- menu.init(menuNode);
- return menu;
- } catch (e) {
- ok(false, "Failed creating nsIStandaloneNativeMenu instance");
- throw e;
- }
- }
-
- function runDetachedMenuTests(addMenupopupBeforeCreatingSNM) {
- let menu = createXULMenu("Detached menu");
- menu.setAttribute("image", 'data:image/svg+xml,<svg%20xmlns="http://www.w3.org/2000/svg"%20width="32"%20height="32"><circle%20cx="16"%20cy="16"%20r="16"/></svg>');
- let menupopup = createXULMenuPopup();
-
- let popupShowingFired = false;
- let itemActivated = false;
-
- menupopup.addEventListener("popupshowing", function (e) {
- popupShowingFired = true;
-
- let menuitem = document.createElementNS(XUL_NS, "menuitem");
- menuitem.setAttribute("label", "detached menu item");
- menuitem.addEventListener("command", function (e) {
- itemActivated = true;
- })
- menupopup.appendChild(menuitem);
- })
-
- // It shouldn't make a difference whether the menupopup is added to the
- // menu element before or after we create the nsIStandaloneNativeMenu
- // instance with it. We test both orders by calling this function twice
- // with different values for addMenupopupBeforeCreatingSNM.
-
- var menuSNM = null; // the nsIStandaloneNativeMenu object for "menu"
- if (addMenupopupBeforeCreatingSNM) {
- menu.appendChild(menupopup);
- menuSNM = createStandaloneNativeMenu(menu);
- } else {
- menuSNM = createStandaloneNativeMenu(menu);
- menu.appendChild(menupopup);
- }
-
- try {
- ok(!popupShowingFired, "popupshowing shouldn't have fired before our call to menuWillOpen()");
- menuSNM.menuWillOpen();
- ok(popupShowingFired, "calling menuWillOpen() should have notified our popupshowing listener");
-
- ok(!itemActivated, "our dynamically-added menuitem shouldn't have been activated yet");
- menuSNM.activateNativeMenuItemAt("0");
- ok(itemActivated, "the new menu item should have been activated now");
- } catch (ex) {
- ok(false, "dynamic menu test failed: " + ex);
- }
- }
-
- function onLoad() {
- var _delayedOnLoad = function() {
- try {
-
- var menuNode = document.getElementById("standalonenativemenu");
- var menu = createStandaloneNativeMenu(menuNode);
-
- // First let's run the base menu tests.
- ok(runBaseMenuTests(menu), "base tests #1");
-
- // Set up some nodes that we'll use.
- var newMenu0 = createXULMenu("NewMenu0");
- var newMenu1 = createXULMenu("NewMenu1");
- var newMenuPopup0 = createXULMenuPopup();
- var newMenuPopup1 = createXULMenuPopup();
- var newMenuItem0 = createXULMenuItem("NewMenuItem0", "cmd_NewItem0");
- var newMenuItem1 = createXULMenuItem("NewMenuItem1", "cmd_NewItem1");
- var newMenuItem2 = createXULMenuItem("NewMenuItem2", "cmd_NewItem2");
- var newMenuItem3 = createXULMenuItem("NewMenuItem3", "cmd_NewItem3");
- var newMenuItem4 = createXULMenuItem("NewMenuItem4", "cmd_NewItem4");
- var newMenuItem5 = createXULMenuItem("NewMenuItem5", "cmd_NewItem5");
-
- // Create another submenu with hierarchy via DOM manipulation.
- // ******************
- // * Foo * NewMenu0 * <- Menu bar
- // ******************
- // ****************
- // * NewMenuItem0 * <- NewMenu0 submenu
- // ****************
- // * NewMenuItem1 *
- // ****************
- // * NewMenuItem2 *
- // *******************************
- // * NewMenu1 > * NewMenuItem3 * <- NewMenu1 submenu
- // *******************************
- // * NewMenuItem4 *
- // ****************
- // * NewMenuItem5 *
- // ****************
- newMenu0.appendChild(newMenuPopup0);
- newMenuPopup0.appendChild(newMenuItem0);
- newMenuPopup0.appendChild(newMenuItem1);
- newMenuPopup0.appendChild(newMenuItem2);
- newMenuPopup0.appendChild(newMenu1);
- newMenu1.appendChild(newMenuPopup1);
- newMenuPopup1.appendChild(newMenuItem3);
- newMenuPopup1.appendChild(newMenuItem4);
- newMenuPopup1.appendChild(newMenuItem5);
- //XXX - we have to append the menu to the top-level of the menu bar
- // only after constructing it. If we append before construction, it is
- // invalid because it has no children and we don't validate it if we add
- // children later.
- menuNode.appendChild(newMenu0);
- menu.forceUpdateNativeMenuAt("1|3");
- // Run basic tests again.
- ok(runBaseMenuTests(menu), "base tests #2");
-
- // Error strings.
- var sa = "Command handler(s) should have activated";
- var sna = "Command handler(s) should not have activated";
-
- // Test middle items.
- ok(testItem(menu, "1|1", "cmd_NewItem1"), "#1:" + sa);
- ok(testItem(menu, "1|3|1", "cmd_NewItem4"), "#2:" + sa);
-
- // Hide newMenu0.
- newMenu0.setAttribute("hidden", "true");
- ok(runBaseMenuTests(menu), "base tests #3: " + sa); // the base menu should still be unhidden
- ok(!testItem(menu, "1|0", ""), "#3:" + sna);
- ok(!testItem(menu, "1|1", ""), "#4:" + sna);
- ok(!testItem(menu, "1|2", ""), "#5:" + sna);
- ok(!testItem(menu, "1|3|0", ""), "#6:" + sna);
- ok(!testItem(menu, "1|3|1", ""), "#7:" + sna);
- ok(!testItem(menu, "1|3|2", ""), "#8:" + sna);
-
- // Show newMenu0.
- newMenu0.setAttribute("hidden", "false");
- menu.forceUpdateNativeMenuAt("1|3");
- ok(runBaseMenuTests(menu), "base tests #4:" + sa);
- ok(testItem(menu, "1|0", "cmd_NewItem0"), "#9:" + sa);
- ok(testItem(menu, "1|1", "cmd_NewItem1"), "#10:" + sa);
- ok(testItem(menu, "1|2", "cmd_NewItem2"), "#11:" + sa);
- ok(testItem(menu, "1|3|0", "cmd_NewItem3"), "#12:" + sa);
- ok(testItem(menu, "1|3|1", "cmd_NewItem4"), "#13:" + sa);
- ok(testItem(menu, "1|3|2", "cmd_NewItem5"), "#14:" + sa);
-
- // Hide items.
- newMenuItem1.setAttribute("hidden", "true");
- newMenuItem4.setAttribute("hidden", "true");
- menu.forceUpdateNativeMenuAt("1|2");
- ok(runBaseMenuTests(menu), "base tests #5:" + sa);
- ok(testItem(menu, "1|0", "cmd_NewItem0"), "#15:" + sa);
- ok(testItem(menu, "1|1", "cmd_NewItem2"), "#16:" + sa);
- ok(!testItem(menu, "1|2", ""), "#17:" + sna);
- ok(testItem(menu, "1|2|0", "cmd_NewItem3"), "#18:" + sa);
- ok(testItem(menu, "1|2|1", "cmd_NewItem5"), "#19:" + sa);
- ok(!testItem(menu, "1|2|2", ""), "#20:" + sna);
-
- // Show items.
- newMenuItem1.setAttribute("hidden", "false");
- newMenuItem4.setAttribute("hidden", "false");
- //forceUpdateNativeMenuAt("1|3");
- ok(runBaseMenuTests(menu), "base tests #6:" + sa);
- ok(testItem(menu, "1|0", "cmd_NewItem0"), "#21:" + sa);
- ok(testItem(menu, "1|1", "cmd_NewItem1"), "#22:" + sa);
- ok(testItem(menu, "1|2", "cmd_NewItem2"), "#23:" + sa);
- ok(testItem(menu, "1|3|0", "cmd_NewItem3"), "#24:" + sa);
- ok(testItem(menu, "1|3|1", "cmd_NewItem4"), "#25:" + sa);
- ok(testItem(menu, "1|3|2", "cmd_NewItem5"), "#26:" + sa);
-
- // At this point in the tests the state of the menus has been returned
- // to the originally diagramed state.
-
- // Remove menu.
- menuNode.removeChild(newMenu0);
- ok(runBaseMenuTests(menu), "base tests #7:" + sa);
- ok(!testItem(menu, "1|0", ""), "#27:" + sna);
- ok(!testItem(menu, "1|1", ""), "#28:" + sna);
- ok(!testItem(menu, "1|2", ""), "#29:" + sna);
- ok(!testItem(menu, "1|3|0", ""), "#30:" + sna);
- ok(!testItem(menu, "1|3|1", ""), "#31:" + sna);
- ok(!testItem(menu, "1|3|2", ""), "#32:" + sna);
- // return state to original diagramed state
- menuNode.appendChild(newMenu0);
-
- // Test for bug 447042, make sure that adding a menu node with no children
- // to the menu bar and then adding another menu node with children works.
- // Menus with no children don't get their native menu items shown and that
- // caused internal arrays to get out of sync and an append crashed.
- var tmpMenu0 = createXULMenu("tmpMenu0");
- menuNode.removeChild(newMenu0);
- menuNode.appendChild(tmpMenu0);
- menuNode.appendChild(newMenu0);
- menu.forceUpdateNativeMenuAt("1|3");
- //todo(runBaseMenuTests(menu), "base tests #8");
- todo(testItem(menu, "1|0", "cmd_NewItem0"), "#33:" +sa);
- todo(testItem(menu, "1|1", "cmd_NewItem1"), "#34:" +sa);
- todo(testItem(menu, "1|2", "cmd_NewItem2"), "#35:" +sa);
- todo(testItem(menu, "1|3|0", "cmd_NewItem3"), "#36:" +sa);
- todo(testItem(menu, "1|3|1", "cmd_NewItem4"), "#37:" +sa);
- todo(testItem(menu, "1|3|2", "cmd_NewItem5"), "#38:" +sa);
- // return state to original diagramed state
- menuNode.removeChild(tmpMenu0);
- delete tmpMenu0;
-
- // This test is basically a crash test for bug 433858.
- newMenuItem1.setAttribute("hidden", "true");
- newMenuItem2.setAttribute("hidden", "true");
- newMenu1.setAttribute("hidden", "true");
- menu.forceUpdateNativeMenuAt("1");
- newMenuItem1.setAttribute("hidden", "false");
- newMenuItem2.setAttribute("hidden", "false");
- newMenu1.setAttribute("hidden", "false");
- menu.forceUpdateNativeMenuAt("1");
-
- // Run tests where the menu nodes are not in the document's node tree.
- runDetachedMenuTests(false);
- runDetachedMenuTests(true);
-
- } catch (e) {
- ok(false, "Caught an exception: " + e);
- } finally {
- onTestsFinished();
- }
- }
-
- setTimeout(_delayedOnLoad, 1000);
- }
-
- ]]></script>
-</window>
diff --git a/widget/tests/taskbar_previews.xul b/widget/tests/taskbar_previews.xul
deleted file mode 100644
index 2f294d187..000000000
--- a/widget/tests/taskbar_previews.xul
+++ /dev/null
@@ -1,127 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Taskbar Previews Test"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="loaded();">
-
- <title>Previews - yeah!</title>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
- <script class="testbody" type="application/javascript">
- <![CDATA[
- let Cc = Components.classes;
- let Ci = Components.interfaces;
- let Cu = Components.utils;
- Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
- let taskbar = Cc["@mozilla.org/windows-taskbar;1"].getService(Ci.nsIWinTaskbar);
-
- function IsWin7OrHigher() {
- try {
- var sysInfo = Cc["@mozilla.org/system-info;1"].
- getService(Ci.nsIPropertyBag2);
- var ver = parseFloat(sysInfo.getProperty("version"));
- if (ver >= 6.1)
- return true;
- } catch (ex) { }
- return false;
- }
- isnot(taskbar, null, "Taskbar service is defined");
- is(taskbar.available, IsWin7OrHigher(), "Expected availability of taskbar");
-
- SimpleTest.waitForExplicitFinish();
-
- function stdPreviewSuite(p) {
- p.visible = !p.visible;
- p.visible = !p.visible;
- p.visible = true;
- p.invalidate();
- p.visible = false;
- }
-
- function loaded()
- {
- if (!taskbar.available)
- SimpleTest.finish();
- let controller = {
- width: 400,
- height: 400,
- thumbnailAspectRatio: 1.0,
- drawThumbnail: function () { return false; },
- drawPreview: function () { return false; },
- get wrappedJSObject() { return this; }
- }
- // HACK from mconnor:
- var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
- let win = wm.getMostRecentWindow("navigator:browser");
- let docShell = win.gBrowser.docShell;
-
- let winPreview = taskbar.getTaskbarWindowPreview(docShell);
- isnot(winPreview, null, "Window preview is not null");
- winPreview.controller = controller;
- let button = winPreview.getButton(0);
- isnot(button, null, "Could get button at valid index");
- try {
- winPreview.getButton(-1);
- ok(false, "Got button at negative index");
- } catch (ex) {}
- try {
- winPreview.getButton(Ci.nsITaskbarWindowPreview.NUM_TOOLBAR_BUTTONS);
- ok(false, "Got button at index that is too large");
- } catch (ex) {}
- button.image = null;
- stdPreviewSuite(winPreview);
- // Let's not perma-hide this window from the taskbar
- winPreview.visible = true;
-
- let tabP = taskbar.createTaskbarTabPreview(docShell, controller);
- isnot(tabP, null, "Tab preview is not null");
- is(tabP.controller.wrappedJSObject, controller, "Controllers match");
- is(tabP.icon, null, "Default icon is null (windows default)");
- tabP.icon = null;
- tabP.move(null);
- try {
- tabP.move(tabP);
- ok(false, "Moved a preview next to itself!");
- } catch (ex) {}
- stdPreviewSuite(tabP);
-
- let tabP2 = taskbar.createTaskbarTabPreview(docShell, controller);
- tabP.visible = true;
- tabP2.visible = true;
-
- isnot(tabP2, null, "2nd Tab preview is not null");
- isnot(tabP,tabP2, "Tab previews are different");
- tabP.active = true;
- ok(tabP.active && !tabP2.active, "Only one tab is active (part 1)");
- tabP2.active = true;
- ok(!tabP.active && tabP2.active, "Only one tab is active (part 2)");
- tabP.active = true;
- ok(tabP.active && !tabP2.active, "Only one tab is active (part 3)");
- tabP.active = false;
- ok(!tabP.active && !tabP2.active, "Neither tab is active");
- is(winPreview.active, false, "Window preview is not active");
- tabP.active = true;
- winPreview.active = true;
- ok(winPreview.active && !tabP.active, "Tab preview takes activation from window");
- tabP.active = true;
- ok(tabP.active && !winPreview.active, "Tab preview takes activation from window");
-
- tabP.visible = false;
- tabP2.visible = false;
-
- SimpleTest.finish();
- }
- ]]>
- </script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
- </body>
-
-</window>
diff --git a/widget/tests/test_assign_event_data.html b/widget/tests/test_assign_event_data.html
deleted file mode 100644
index 39f31cafe..000000000
--- a/widget/tests/test_assign_event_data.html
+++ /dev/null
@@ -1,748 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Testing ns*Event::Assign*EventData()</title>
- <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="/tests/SimpleTest/NativeKeyCodes.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css">
- <style>
- #a {
- background-color: transparent;
- transition: background-color 0.1s linear;
- }
- #a:focus {
- background-color: red;
- }
- .slidin {
- border: green 1px solid;
- width: 10px;
- height: 10px;
- animation-name: slidein;
- animation-duration: 1s;
- }
- @keyframes slidein {
- from {
- margin-left: 100%;
- }
- to {
- margin-left: 0;
- }
- }
- #pointer-target {
- border: 1px dashed red;
- background: yellow;
- margin: 0px 10px;
- padding: 0px 10px;
- }
- #scrollable-div {
- background: green;
- overflow: auto;
- width: 30px;
- height: 30px;
- }
- #scrolled-div {
- background: magenta;
- width: 10px;
- height: 10px;
- }
- #form {
- background: silver;
- padding: 0px 10px;
- }
- #animated-div {
- background: cyan;
- padding: 0px 10px;
- }
- </style>
-</head>
-<body>
-<div id="display">
- <input id="input-text">
- <button id="button">button</button>
- <a id="a" href="about:blank">hyper link</a>
- <span id="pointer-target">span</span>
- <div id="scrollable-div"><div id="scrolled-div"></div></div>
- <form id="form">form</form>
- <div id="animated-div">&nbsp;</div>
-</div>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-
-<script class="testbody" type="application/javascript">
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.expectAssertions(0, 34);
-
-const kIsMac = (navigator.platform.indexOf("Mac") == 0);
-const kIsWin = (navigator.platform.indexOf("Win") == 0);
-
-var gEvent = null;
-var gCopiedEvent = [];
-var gCallback = null;
-var gCallPreventDefault = false;
-
-function onEvent(aEvent)
-{
- if (gCallPreventDefault) {
- aEvent.preventDefault();
- }
- gEvent = aEvent;
- for (var attr in aEvent) {
- if (!attr.match(/^[A-Z0-9_]+$/) && // ignore const attributes
- attr != "multipleActionsPrevented" && // multipleActionsPrevented isn't defined in any DOM event specs.
- typeof(aEvent[attr]) != "function") {
- gCopiedEvent.push({ name: attr, value: aEvent[attr]});
- }
- }
- setTimeout(gCallback, 0);
-}
-
-const kTests = [
- { description: "InternalScrollPortEvent (overflow, vertical)",
- targetID: "scrollable-div", eventType: "overflow",
- dispatchEvent: function () {
- document.getElementById("scrolled-div").style.height = "500px";
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "InternalScrollPortEvent (overflow, horizontal)",
- targetID: "scrollable-div", eventType: "overflow",
- dispatchEvent: function () {
- document.getElementById("scrolled-div").style.width = "500px";
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "InternalScrollAreaEvent (MozScrolledAreaChanged, spreading)",
- target: function () { return document; }, eventType: "MozScrolledAreaChanged",
- dispatchEvent: function () {
- document.getElementById("scrollable-div").style.width = "50000px";
- document.getElementById("scrollable-div").style.height = "50000px";
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "InternalScrollAreaEvent (MozScrolledAreaChanged, shrinking)",
- target: function () { return document; }, eventType: "MozScrolledAreaChanged",
- dispatchEvent: function () {
- document.getElementById("scrollable-div").style.width = "30px";
- document.getElementById("scrollable-div").style.height = "30px";
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "WidgetKeyboardEvent (keydown of 'a' key without modifiers)",
- targetID: "input-text", eventType: "keydown",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- document.getElementById(this.targetID).focus();
- synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, kIsWin ? WIN_VK_A : MAC_VK_ANSI_A,
- {}, "a", "a");
- },
- canRun: function () {
- return (kIsMac || kIsWin);
- },
- todoMismatch: [],
- },
- { description: "WidgetKeyboardEvent (keyup of 'a' key without modifiers)",
- targetID: "input-text", eventType: "keydown",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- document.getElementById(this.targetID).focus();
- synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, kIsWin ? WIN_VK_A : MAC_VK_ANSI_A,
- {}, "a", "a");
- },
- canRun: function () {
- return (kIsMac || kIsWin);
- },
- todoMismatch: [],
- },
- { description: "WidgetKeyboardEvent (keypress of 'b' key with Shift)",
- targetID: "input-text", eventType: "keypress",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- document.getElementById(this.targetID).focus();
- synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, kIsWin ? WIN_VK_B : MAC_VK_ANSI_B,
- { shiftKey: true }, "B", "B");
- },
- canRun: function () {
- return (kIsMac || kIsWin);
- },
- todoMismatch: [],
- },
- { description: "WidgetKeyboardEvent (keypress of 'c' key with Accel)",
- targetID: "input-text", eventType: "keypress",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- document.getElementById(this.targetID).focus();
- synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, kIsWin ? WIN_VK_C : MAC_VK_ANSI_C,
- { accelKey: true }, kIsWin ? "\u0003" : "c", "c");
- },
- canRun: function () {
- return (kIsMac || kIsWin);
- },
- todoMismatch: [],
- },
- { description: "WidgetKeyboardEvent (keyup during composition)",
- targetID: "input-text", eventType: "keyup",
- dispatchEvent: function () {
- setAndObserveCompositionPref(true, () => {
- document.getElementById(this.targetID).value = "";
- document.getElementById(this.targetID).focus();
- synthesizeCompositionChange({ "composition":
- { "string": "\u306D",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 },
- "key": { key: "a", code: "KeyA", keyCode: KeyboardEvent.DOM_VK_A },
- });
- synthesizeComposition({ type: "compositioncommitasis" });
- setAndObserveCompositionPref(null, runNextTest);
- });
- return true;
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "WidgetKeyboardEvent (keydown during composition)",
- targetID: "input-text", eventType: "keydown",
- dispatchEvent: function () {
- setAndObserveCompositionPref(true, () => {
- document.getElementById(this.targetID).value = "";
- document.getElementById(this.targetID).focus();
- synthesizeCompositionChange({ "composition":
- { "string": "\u306D",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- synthesizeComposition({ type: "compositioncommitasis",
- key: { key: "KEY_Enter", code: "Enter" } });
- setAndObserveCompositionPref(null, runNextTest);
- });
- return true;
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "WidgetMouseEvent (mousedown of left button without modifier)",
- targetID: "button", eventType: "mousedown",
- dispatchEvent: function () {
- synthesizeMouseAtCenter(document.getElementById(this.targetID),
- { button: 0 });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "WidgetMouseEvent (click of middle button with Shift)",
- // XXX I'm not sure why middle click event isn't fired on button element.
- targetID: "input-text", eventType: "click",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- synthesizeMouseAtCenter(document.getElementById(this.targetID),
- { button: 1, shiftKey: true, pressure: 0.5 });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "WidgetMouseEvent (mouseup of right button with Alt)",
- targetID: "button", eventType: "mouseup",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- synthesizeMouseAtCenter(document.getElementById(this.targetID),
- { button: 2, altKey: true });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "WidgetDragEvent",
- targetID: "input-text", eventType: "dragstart",
- dispatchEvent: function () {
- return;
- },
- canRun: function () {
- todo(false, "WidgetDragEvent isn't tested");
- return false;
- },
- todoMismatch: [],
- },
- { description: "WidgetTextEvent (text)",
- targetID: "input-text", eventType: "text",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- document.getElementById(this.targetID).focus();
- synthesizeComposition({ type: "compositioncommit", data: "\u306D" });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "WidgetCompositionEvent (compositionupdate)",
- targetID: "input-text", eventType: "compositionupdate",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- document.getElementById(this.targetID).focus();
- synthesizeComposition({ type: "compositioncommit", data: "\u30E9\u30FC\u30E1\u30F3" });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "InternalEditorInputEvent (input at key input)",
- targetID: "input-text", eventType: "input",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- document.getElementById(this.targetID).focus();
- synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, kIsWin ? WIN_VK_B : MAC_VK_ANSI_B,
- { shiftKey: true }, "B", "B");
- },
- canRun: function () {
- return (kIsMac || kIsWin);
- },
- todoMismatch: [],
- },
- { description: "InternalEditorInputEvent (input at composing)",
- targetID: "input-text", eventType: "input",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- document.getElementById(this.targetID).focus();
- synthesizeCompositionChange({ "composition":
- { "string": "\u30E9\u30FC\u30E1\u30F3",
- "clauses":
- [
- { "length": 4, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 4, "length": 0 }
- });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "InternalEditorInputEvent (input at committing)",
- targetID: "input-text", eventType: "input",
- dispatchEvent: function () {
- synthesizeComposition({ type: "compositioncommitasis" });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "WidgetMouseScrollEvent (DOMMouseScroll, vertical)",
- targetID: "input-text", eventType: "DOMMouseScroll",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- synthesizeWheel(document.getElementById(this.targetID), 3, 4,
- { deltaY: 30, lineOrPageDeltaY: 2 });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "WidgetMouseScrollEvent (DOMMouseScroll, horizontal)",
- targetID: "input-text", eventType: "DOMMouseScroll",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- synthesizeWheel(document.getElementById(this.targetID), 4, 5,
- { deltaX: 30, lineOrPageDeltaX: 2, shiftKey: true });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "WidgetMouseScrollEvent (MozMousePixelScroll, vertical)",
- targetID: "input-text", eventType: "MozMousePixelScroll",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- synthesizeWheel(document.getElementById(this.targetID), 3, 4,
- { deltaY: 20, lineOrPageDeltaY: 1, altKey: true });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "WidgetMouseScrollEvent (MozMousePixelScroll, horizontal)",
- targetID: "input-text", eventType: "MozMousePixelScroll",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- synthesizeWheel(document.getElementById(this.targetID), 4, 5,
- { deltaX: 20, lineOrPageDeltaX: 1, ctrlKey: true });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "WidgetWheelEvent (wheel, vertical)",
- targetID: "input-text", eventType: "wheel",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- synthesizeWheel(document.getElementById(this.targetID), 3, 4,
- { deltaY: 20, lineOrPageDeltaY: 1, altKey: true });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "WidgetWheelEvent (wheel, horizontal)",
- targetID: "input-text", eventType: "wheel",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- synthesizeWheel(document.getElementById(this.targetID), 4, 5,
- { deltaX: 20, lineOrPageDeltaX: 1, ctrlKey: true });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "WidgetWheelEvent (wheel, both)",
- targetID: "input-text", eventType: "wheel",
- dispatchEvent: function () {
- document.getElementById(this.targetID).value = "";
- synthesizeWheel(document.getElementById(this.targetID), 4, 5,
- { deltaX: 20, deltaY: 10,
- lineOrPageDeltaX: 1, lineOrPageDeltaY: 1 });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "WidgetTouchEvent (touchstart)",
- target: function () { return document; }, eventType: "touchstart",
- dispatchEvent: function () {
- synthesizeTouchAtPoint(1, 2, { id: 10, rx: 4, ry: 3, angle: 0, force: 1, shiftKey: true});
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "WidgetTouchEvent (touchend)",
- target: function () { return document; }, eventType: "touchend",
- dispatchEvent: function () {
- synthesizeTouchAtPoint(4, 6, { id: 5, rx: 1, ry: 2, angle: 0.5, force: 0.8, ctrlKey: true});
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "InternalFormEvent (reset)",
- targetID: "form", eventType: "reset",
- dispatchEvent: function () {
- document.getElementById("form").reset();
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "WidgetCommandEvent",
- targetID: "input-text", eventType: "",
- dispatchEvent: function () {
- return;
- },
- canRun: function () {
- todo(false, "WidgetCommandEvent isn't tested");
- return false;
- },
- todoMismatch: [],
- },
- { description: "InternalClipboardEvent (copy)",
- targetID: "input-text", eventType: "copy",
- dispatchEvent: function () {
- document.getElementById("input-text").value = "go to clipboard!";
- document.getElementById("input-text").focus();
- document.getElementById("input-text").select();
- synthesizeKey("c", { accelKey: true });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [ ],
- },
- { description: "InternalUIEvent (DOMActivate)",
- targetID: "button", eventType: "DOMActivate",
- dispatchEvent: function () {
- synthesizeMouseAtCenter(document.getElementById(this.targetID),
- { button: 0, shiftKey: true });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "InternalFocusEvent (focus)",
- targetID: "input-text", eventType: "focus",
- dispatchEvent: function () {
- document.getElementById(this.targetID).focus();
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "InternalFocusEvent (blur)",
- targetID: "input-text", eventType: "blur",
- dispatchEvent: function () {
- document.getElementById(this.targetID).blur();
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "WidgetSimpleGestureEvent",
- targetID: "", eventType: "",
- dispatchEvent: function () {
- return;
- },
- canRun: function () {
- // Simple gesture event may be handled before it comes content.
- // So, we cannot test it in this test.
- todo(false, "WidgetSimpleGestureEvent isn't tested");
- return false;
- },
- todoMismatch: [],
- },
- { description: "InternalTransitionEvent (transitionend)",
- targetID: "a", eventType: "transitionend",
- dispatchEvent: function () {
- document.getElementById(this.targetID).focus();
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "InternalAnimationEvent (animationend)",
- targetID: "animated-div", eventType: "animationend",
- dispatchEvent: function () {
- document.getElementById(this.targetID).className = "slidin";
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "InternalMutationEvent (DOMAttrModified)",
- targetID: "animated-div", eventType: "DOMAttrModified",
- dispatchEvent: function () {
- document.getElementById(this.targetID).setAttribute("x-data", "foo");
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "InternalMutationEvent (DOMNodeInserted)",
- targetID: "animated-div", eventType: "DOMNodeInserted",
- dispatchEvent: function () {
- var div = document.createElement("div");
- div.id = "inserted-div";
- document.getElementById("animated-div").appendChild(div);
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "InternalMutationEvent (DOMNodeRemoved)",
- targetID: "animated-div", eventType: "DOMNodeRemoved",
- dispatchEvent: function () {
- document.getElementById("animated-div").removeChild(document.getElementById("inserted-div"));
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "PointerEvent (pointerdown)",
- targetID: "pointer-target", eventType: "pointerdown",
- dispatchEvent: function () {
- var elem = document.getElementById(this.targetID);
- var rect = elem.getBoundingClientRect();
- synthesizePointer(elem, rect.width/2, rect.height/2,
- { type: this.eventType, button: 1, clickCount: 1, inputSource: 2, pressure: 0.25, isPrimary: true });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
- { description: "PointerEvent (pointerup)",
- targetID: "pointer-target", eventType: "pointerup",
- dispatchEvent: function () {
- var elem = document.getElementById(this.targetID);
- var rect = elem.getBoundingClientRect();
- synthesizePointer(elem, rect.width/2, rect.height/2,
- { type: this.eventType, button: -1, ctrlKey: true, shiftKey: true, altKey: true, isSynthesized: false });
- },
- canRun: function () {
- return true;
- },
- todoMismatch: [],
- },
-];
-
-/**
- * Sets or clears dom.keyboardevent.dispatch_during_composition and calls the
- * given callback when the change is observed.
- *
- * @param aValue
- * Pass null to clear the pref. Otherwise pass a bool.
- * @param aCallback
- * Called when the pref change is observed.
- */
-function setAndObserveCompositionPref(aValue, aCallback) {
- let pref = "dom.keyboardevent.dispatch_during_composition";
- let branch = SpecialPowers.Cc["@mozilla.org/preferences-service;1"].
- getService(SpecialPowers.Ci.nsIPrefService).
- getBranch(pref);
- let obs = SpecialPowers.wrapCallback(function () {
- branch.removeObserver("", obs);
- // Make sure the code under test sees the change first, so executeSoon().
- SimpleTest.executeSoon(aCallback);
- });
- branch.addObserver("", obs, false);
- if (aValue === null) {
- SpecialPowers.clearUserPref(pref);
- } else {
- SpecialPowers.setBoolPref(pref, aValue);
- }
-}
-
-function doTest(aTest)
-{
- if (!aTest.canRun()) {
- SimpleTest.executeSoon(runNextTest);
- return;
- }
- gEvent = null;
- gCopiedEvent = [];
- var target = aTest.target ? aTest.target() : document.getElementById(aTest.targetID);
- target.addEventListener(aTest.eventType, onEvent, true);
- gCallback = function () {
- var description = aTest.description + " (gCallPreventDefault=" + gCallPreventDefault + ")";
- target.removeEventListener(aTest.eventType, onEvent, true);
- ok(gEvent !== null, description + ": failed to get duplicated event");
- ok(gCopiedEvent.length > 0, description + ": count of attribute of the event must be larger than 0");
- for (var i = 0; i < gCopiedEvent.length; ++i) {
- var name = gCopiedEvent[i].name;
- if (name == "rangeOffset") {
- todo(false, description + ": " + name + " attribute value is never reset (" + gEvent[name] + ")");
- } else if (name == "eventPhase") {
- is(gEvent[name], 0, description + ": mismatch with fixed value (" + name + ")");
- } else if (name == "rangeParent" || name == "currentTarget") {
- is(gEvent[name], null, description + ": mismatch with fixed value (" + name + ")");
- } else if (aTest.todoMismatch.indexOf(name) >= 0) {
- todo_is(gEvent[name], gCopiedEvent[i].value, description + ": mismatch (" + name + ")");
- } else if (name == "offsetX" || name == "offsetY") {
- // do nothing; these are defined to return different values during event dispatch
- // vs not during event dispatch
- } else {
- is(gEvent[name], gCopiedEvent[i].value, description + ": mismatch (" + name + ")");
- }
- }
- if (!testWillCallRunNextTest) {
- runNextTest();
- }
- };
- var testWillCallRunNextTest = aTest.dispatchEvent();
-}
-
-var gIndex = -1;
-function runNextTest()
-{
- if (++gIndex == kTests.length) {
- if (gCallPreventDefault) {
- finish();
- return;
- }
- // Test with a call of preventDefault() of the events.
- gCallPreventDefault = true;
- gIndex = -1;
- // Restoring the initial state of all elements.
- document.getElementById("scrollable-div").style.height = "30px";
- document.getElementById("scrollable-div").style.width = "30px";
- document.getElementById("scrolled-div").style.height = "10px";
- document.getElementById("scrolled-div").style.width = "10px";
- document.getElementById("input-text").value = "";
- document.getElementById("animated-div").className = "";
- document.getElementById("animated-div").removeAttribute("x-data");
- if (document.activeElement) {
- document.activeElement.blur();
- }
- window.requestAnimationFrame(function () {
- setTimeout(runNextTest, 0);
- });
- return;
- }
- doTest(kTests[gIndex]);
-}
-
-function init()
-{
- SpecialPowers.pushPrefEnv({"set":[["middlemouse.contentLoadURL", false],
- ["middlemouse.paste", false],
- ["general.autoScroll", false],
- ["mousewheel.default.action", 0],
- ["mousewheel.default.action.override_x", -1],
- ["mousewheel.with_shift.action", 0],
- ["mousewheel.with_shift.action.override_x", -1],
- ["mousewheel.with_control.action", 0],
- ["mousewheel.with_control.action.override_x", -1],
- ["mousewheel.with_alt.action", 0],
- ["mousewheel.with_alt.action.override_x", -1],
- ["mousewheel.with_meta.action", 0],
- ["mousewheel.with_meta.action.override_x", -1]]}, runNextTest);
-}
-
-function finish()
-{
- SimpleTest.finish();
-}
-
-SimpleTest.waitForFocus(init);
-
-</script>
-</body>
diff --git a/widget/tests/test_bug1123480.xul b/widget/tests/test_bug1123480.xul
deleted file mode 100644
index 56ce0ed10..000000000
--- a/widget/tests/test_bug1123480.xul
+++ /dev/null
@@ -1,79 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet type="text/css" href="/tests/SimpleTest/test.css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1123480
--->
-<window title="Mozilla Bug 1123480"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="RunTest();">
- <title>nsTransferable PBM Overflow Selection Test</title>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <script type="application/javascript">
- <![CDATA[
- // Boilerplate constructs
- var SmallDataset = 100000; // Hundred thousand bytes
-
- // Create 1 Mo of sample garbage text
- var Ipsum = ""; // Select text from this
- for (var Iter = 0; Iter < SmallDataset; Iter++) {
- Ipsum += Math.random().toString(36) + ' ';
- }
-
- function RunTest() {
- // Construct a nsIFile object for access to file methods
- Components.utils.import("resource://gre/modules/FileUtils.jsm");
- var clipboardFile = FileUtils.getFile("TmpD", ["clipboardcache"]);
-
- // Sanitize environment
- if (clipboardFile.exists()) {
- clipboardFile.remove(false);
- }
- ok(!clipboardFile.exists(), "failed to presanitize the environment");
-
- // Overflow a nsTransferable region by using the clipboard helper
- const gClipboardHelper = Components.classes["@mozilla.org/widget/clipboardhelper;1"].getService(Components.interfaces.nsIClipboardHelper);
- gClipboardHelper.copyString(Ipsum);
-
- // Disabled private browsing mode should cache large selections to disk
- ok(clipboardFile.exists(), "correctly saved memory by caching to disk");
-
- // Sanitize environment again
- if (clipboardFile.exists()) {
- clipboardFile.remove(false);
- }
- ok(!clipboardFile.exists(), "failed to postsanitize the environment");
-
- // Repeat procedure of plain text selection with private browsing enabled
- Components.utils.import("resource://gre/modules/PrivateBrowsingUtils.jsm");
- var Winpriv = window.open("about:blank", "_blank", "chrome, width=500, height=200, private");
- ok(Winpriv, "failed to open private window");
- ok(PrivateBrowsingUtils.isContentWindowPrivate(Winpriv), "correctly used a private window context");
-
- // Select plaintext in private channel
- Components.utils.import('resource://gre/modules/Services.jsm');
- const nsTransferable = Components.Constructor("@mozilla.org/widget/transferable;1", "nsITransferable");
- const nsSupportsString = Components.Constructor("@mozilla.org/supports-string;1", "nsISupportsString");
- var Loadctx = PrivateBrowsingUtils.privacyContextFromWindow(Winpriv);
- var Transfer = nsTransferable();
- var Suppstr = nsSupportsString();
- Suppstr.data = Ipsum;
- Transfer.init(Loadctx);
- Transfer.addDataFlavor("text/plain");
- Transfer.setTransferData("text/plain", Suppstr, Ipsum.length);
- Services.clipboard.setData(Transfer, null, Services.clipboard.kGlobalClipboard);
-
- // Enabled private browsing mode should not cache any selection to disk
- ok(!clipboardFile.exists(), "did not violate private browsing mode");
- }
- ]]>
- </script>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=1123480"
- target="_blank">Mozilla Bug 1123480</a>
- </body>
-</window>
diff --git a/widget/tests/test_bug1151186.html b/widget/tests/test_bug1151186.html
deleted file mode 100644
index 391e53d78..000000000
--- a/widget/tests/test_bug1151186.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=1151186
--->
-<head>
- <meta charset="utf-8">
- <title>Test for Bug 1151186</title>
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="chrome://global/skin"/>
- <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"/>
- <script type="application/javascript">
-
- /** Test for Bug 1151186 **/
- SimpleTest.waitForExplicitFinish();
-
- document.addEventListener("focus", () => {
- document.getElementById("editor").focus();
- SimpleTest.executeSoon(runTests);
- });
-
- function runTests()
- {
- is(document.activeElement, document.getElementById("editor"),
- "The div element should be focused");
- var utils = SpecialPowers.getDOMWindowUtils(window);
- is(utils.IMEStatus, utils.IME_STATUS_ENABLED,
- "IME should be enabled");
- SimpleTest.finish();
- }
- </script>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1151186">Mozilla Bug 1151186</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<div id="editor" contenteditable="true"></div>
-<pre id="test">
-</pre>
-</body>
-</html>
diff --git a/widget/tests/test_bug343416.xul b/widget/tests/test_bug343416.xul
deleted file mode 100644
index 1c31bdf54..000000000
--- a/widget/tests/test_bug343416.xul
+++ /dev/null
@@ -1,202 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=343416
--->
-<window title="Mozilla Bug 343416"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=343416">Mozilla Bug 343416</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-/** Test for Bug 343416 **/
-SimpleTest.waitForExplicitFinish();
-
-// Observer:
-var idleObserver =
-{
- QueryInterface: function _qi(iid)
- {
- if (iid.equals(Components.interfaces.nsISupports) ||
- iid.equals(Components.interfaces.nsIObserver))
- {
- return this;
- }
- throw Components.results.NS_ERROR_NO_INTERFACE;
- },
- observe: function _observe(subject, topic, data)
- {
- if (topic != "idle")
- return;
-
- var diff = Math.abs(data - newIdleSeconds * 1000);
-
-// ok (diff < 5000, "The idle time should have increased by roughly 6 seconds, " +
-// "as that's when we told this listener to fire.");
-// if (diff >= 5000)
-// alert(data + " " + newIdleSeconds);
-
- // Attempt to get to the nsIIdleService
- var subjectOK = false;
- try {
- var idleService = subject.QueryInterface(nsIIdleService);
- subjectOK = true;
- }
- catch (ex)
- {}
- ok(subjectOK, "The subject of the notification should be the " +
- "nsIIdleService.");
-
- // Attempt to remove ourselves.
- var removedObserver = false;
- try {
- idleService.removeIdleObserver(this, newIdleSeconds);
- removedObserver = true;
- }
- catch (ex)
- {}
- ok(removedObserver, "We should be able to remove our observer here.");
- finishedListenerOK = true;
- if (finishedTimeoutOK)
- {
- clearTimeout(testBailout);
- finishThisTest();
- }
- }
-};
-
-
-const nsIIdleService = Components.interfaces.nsIIdleService;
-const nsIISCID = "@mozilla.org/widget/idleservice;1";
-var idleService = null;
-try
-{
- idleService = Components.classes[nsIISCID].getService(nsIIdleService);
-}
-catch (ex)
-{}
-
-ok(idleService, "nsIIdleService should exist and be implemented on all tier 1 platforms.");
-
-var idleTime = null;
-var gotIdleTime = false;
-try
-{
- idleTime = idleService.idleTime;
- gotIdleTime = true;
-}
-catch (ex)
-{}
-
-ok (gotIdleTime, "Getting the idle time should not fail " +
- "in normal circumstances on any tier 1 platform.");
-
-// Now we set up a timeout to sanity-test the idleTime after 5 seconds
-setTimeout(testIdleTime, 5000);
-var startTimeStamp = Date.now();
-
-// Now we add the listener:
-var newIdleSeconds = Math.floor(idleTime / 1000) + 6;
-var addedObserver = false;
-try
-{
- idleService.addIdleObserver(idleObserver, newIdleSeconds);
- addedObserver = true;
-}
-catch (ex)
-{}
-
-ok(addedObserver, "The nsIIdleService should allow us to add an observer.");
-
-addedObserver = false;
-try
-{
- idleService.addIdleObserver(idleObserver, newIdleSeconds);
- addedObserver = true;
-}
-catch (ex)
-{}
-
-ok(addedObserver, "The nsIIdleService should allow us to add the same observer again.");
-
-var removedObserver = false;
-try
-{
- idleService.removeIdleObserver(idleObserver, newIdleSeconds);
- removedObserver = true;
-}
-catch (ex)
-{}
-
-ok(removedObserver, "The nsIIdleService should allow us to remove the observer just once.");
-
-function testIdleTime()
-{
- var gotIdleTime = false
- try
- {
- var newIdleTime = idleService.idleTime;
- gotIdleTime = true
- }
- catch (ex)
- {}
- ok(gotIdleTime, "Getting the idle time should not fail " +
- "in normal circumstances on any tier 1 platform.");
- // Get the time difference, remove the approx. 5 seconds that we've waited,
- // should be very close to 0 left.
- var timeDiff = Math.abs((newIdleTime - idleTime) -
- (Date.now() - startTimeStamp));
-
- var timePassed = Date.now() - startTimeStamp;
- var idleTimeDiff = newIdleTime - idleTime;
- // 1.5 second leniency.
- ok(timeDiff < 1500, "The idle time should have increased by roughly the " +
- "amount of time it took for the timeout to fire. " +
- "You didn't touch the mouse or keyboard during the " +
- "test did you?");
- finishedTimeoutOK = true;
-}
-
-// make sure we still exit when the listener and/or setTimeout don't fire:
-var testBailout = setTimeout(finishThisTest, 12000);
-var finishedTimeoutOK = false, finishedListenerOK = false;
-function finishThisTest()
-{
- ok(finishedTimeoutOK, "We set a timeout and it should have fired by now.");
- ok(finishedListenerOK, "We added a listener and it should have been called by now.");
- if (!finishedListenerOK)
- {
- var removedListener = false;
- try
- {
- idleService.removeIdleObserver(idleObserver, newIdleSeconds);
- removedListener = true;
- }
- catch (ex)
- {}
-
- ok(removedListener, "We added a listener and we should be able to remove it.");
- }
- // Done:
- SimpleTest.finish();
-}
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_bug413277.html b/widget/tests/test_bug413277.html
deleted file mode 100644
index dfb1ac8d4..000000000
--- a/widget/tests/test_bug413277.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=413277
--->
-<head>
- <title>Test for Bug 413277</title>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css"
- href="chrome://mochikit/content/tests/SimpleTest/test.css" />
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=413277">Mozilla Bug 413277</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-<script class="testbody" type="application/javascript">
- var atts='width=100, height=100, top=100, screenY=100';
- atts += ', left=100, screenX=100, toolbar=no';
- atts += ', location=no, directories=no, status=no';
- atts += ', menubar=no, scrollbars=no, resizable=no';
- var newWindow = window.open('_blank', 'win_name', atts);
-
- newWindow.resizeBy(1000000, 1000000);
- SimpleTest.is(newWindow.outerWidth, newWindow.screen.availWidth, true);
- SimpleTest.is(newWindow.outerHeight, newWindow.screen.availHeight, true);
- SimpleTest.is(newWindow.screenY, newWindow.screen.availTop, true);
- SimpleTest.is(newWindow.screenX, newWindow.screen.availLeft, true);
-
- newWindow.close();
-</script>
-</pre>
-</body>
diff --git a/widget/tests/test_bug428405.xul b/widget/tests/test_bug428405.xul
deleted file mode 100644
index 365480468..000000000
--- a/widget/tests/test_bug428405.xul
+++ /dev/null
@@ -1,167 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window id="window1" title="Test Bug 428405"
- onload="setGlobals(); loadFirstTab();"
- xmlns:html="http://www.w3.org/1999/xhtml"
- 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 type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/NativeKeyCodes.js"/>
-
- <tabbox id="tabbox" flex="100%">
- <tabs>
- <tab label="Tab 1"/>
- <tab label="Tab 2"/>
- </tabs>
- <tabpanels flex="100%">
- <browser onload="configureFirstTab();" id="tab1browser" flex="100%"/>
- <browser onload="configureSecondTab();" id="tab2browser" flex="100%"/>
- </tabpanels>
- </tabbox>
-
- <script type="application/javascript"><![CDATA[
-
- SimpleTest.waitForExplicitFinish();
-
- var gCmdOptYReceived = false;
-
- // Look for a cmd-opt-y event.
- function onKeyPress(aEvent) {
- gCmdOptYReceived = false;
- if (String.fromCharCode(aEvent.charCode) != 'y')
- return;
- if (aEvent.ctrlKey || aEvent.shiftKey || !aEvent.metaKey || !aEvent.altKey)
- return;
- gCmdOptYReceived = true;
- }
-
- function setGlobals() {
- var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
- getService(Components.interfaces.nsIWindowMediator);
- gChromeWindow = wm.getMostRecentWindow("navigator:browser");
- // For some reason, a global <key> element's oncommand handler only gets
- // invoked if the focus is outside both of the <browser> elements
- // (tab1browser and tab2browser). So, to make sure we can see a
- // cmd-opt-y event in window1 (if one is available), regardless of where
- // the focus is in this window, we need to add a "keypress" event
- // listener to gChromeWindow, and then check (in onKeyPress()) to see if
- // it's a cmd-opt-y event.
- gChromeWindow.addEventListener("keypress", onKeyPress, false);
- }
-
- // 1) Start loading first tab.
- // 6) Start reloading first tab.
- function loadFirstTab() {
- var browser = document.getElementById("tab1browser");
- browser.loadURI("data:text/html;charset=utf-8,<body><h2>First Tab</h2><p><input type='submit' value='Button' id='button1'/></body>", null, null);
- }
-
- function configureFirstTab() {
- try {
- var button = document.getElementById("tab1browser").contentDocument.getElementById("button1");
- button.addEventListener("click", onFirstTabButtonClicked, false);
- button.focus();
- if (document.getElementById("tabbox").selectedIndex == 0) {
- // 2) When first tab has finished loading (while first tab is
- // focused), hit Return to trigger the action of first tab's
- // button.
- synthesizeNativeReturnKey();
- } else {
- // 7) When first tab has finished reloading (while second tab is
- // focused), start loading second tab.
- loadSecondTab();
- }
- } catch(e) {
- }
- }
-
- // 8) Start loading second tab.
- function loadSecondTab() {
- var browser = document.getElementById("tab2browser");
- browser.loadURI("data:text/html;charset=utf-8,<body><h2>Second Tab</h2><p><input type='submit' value='Button' id='button1'/></body>", null, null);
- }
-
- function configureSecondTab() {
- try {
- var button = document.getElementById("tab2browser").contentDocument.getElementById("button1");
- button.addEventListener("click", onSecondTabButtonClicked, false);
- button.focus();
- if (document.getElementById("tabbox").selectedIndex == 1) {
- // 9) When second tab has finished loading (while second tab is
- // focused), hit Return to trigger action of second tab's
- // button.
- synthesizeNativeReturnKey();
- }
- } catch(e) {
- }
- }
-
- // 3) First tab's button clicked.
- function onFirstTabButtonClicked() {
- switchToSecondTabAndReloadFirst();
- }
-
- // 10) Second tab's button clicked.
- function onSecondTabButtonClicked() {
- switchToFirstTab();
- }
-
- function switchToSecondTabAndReloadFirst() {
- // 4) Switch to second tab.
- document.getElementById("tabbox").selectedIndex = 1;
- // 5) Start reloading first tab (while second tab is focused).
- loadFirstTab();
- }
-
- function switchToFirstTab() {
- // 11) Switch back to first tab.
- document.getElementById("tabbox").selectedIndex = 0;
- doCmdY();
- }
-
- function doCmdY() {
- // 12) Back in first tab, try cmd-y.
- gCmdOptYReceived = false;
- if (!synthesizeNativeCmdOptY(finishTest)) {
- ok(false, "Failed to synthesize native key");
- finishTest();
- }
- }
-
- function finishTest() {
- // 13) Check result.
- is(gCmdOptYReceived, true);
-
- SimpleTest.finish();
- }
-
- // synthesizeNativeReturnKey() and synthesizeNativeCmdOptY() are needed
- // because their synthesizeKey() counterparts don't work properly -- the
- // latter make this test succeed when it should fail.
-
- // The 'aNativeKeyCode', 'aCharacters' and 'aUnmodifiedCharacters'
- // parameters used below (in synthesizeNativeReturnKey() and
- // synthesizeNativeCmdOptY()) were confirmed accurate using the
- // DebugEventsPlugin v1.01 from bmo bug 441880.
-
- function synthesizeNativeReturnKey() {
- synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_Return, {}, "\u000a", "\u000a");
- }
-
- function synthesizeNativeCmdOptY(aCallback) {
- return synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_Y, {metaKey:1, altKey:1}, "y", "y", aCallback);
- }
-
- ]]></script>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
- </body>
-
-</window>
diff --git a/widget/tests/test_bug429954.xul b/widget/tests/test_bug429954.xul
deleted file mode 100644
index 9b617ed4d..000000000
--- a/widget/tests/test_bug429954.xul
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=429954
--->
-<window title="Mozilla Bug 429954"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-SimpleTest.waitForFocus(function () {
- var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
- getService(Components.interfaces.nsIWindowMediator);
- var win = wm.getMostRecentWindow("navigator:browser");
- win.maximize();
- var maxX = win.screenX, maxY = win.screenY;
- var maxWidth = win.outerWidth, maxHeight = win.outerHeight;
- win.restore();
-
- window.open("window_bug429954.xul", "_blank",
- "chrome,resizable,width=" + maxWidth + ",height=" + maxHeight +
- "screenX=" + maxX + "screenY=" + maxY);
-});
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_bug444800.xul b/widget/tests/test_bug444800.xul
deleted file mode 100644
index 14d572baa..000000000
--- a/widget/tests/test_bug444800.xul
+++ /dev/null
@@ -1,102 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin"
- type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=444800
--->
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- title="Mozilla Bug 444800" onload="initAndRunTests()">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=444800"
- target="_blank">Mozilla Bug 444800</a>
- <p/>
- <img id="bitmapImage" src="data:image/bmp;base64,Qk2KAwAAAAAAAIoAAAB8AAAADwAAABAAAAABABgAAAAAAAADAAASCwAAEgsAAAAAAAAAAAAAAAD%2FAAD%2FAAD%2FAAAAAAAA%2FwEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F0vf%2FAABc8tKY%2F%2F%2F%2FyNfq3Mi9%2F%2F%2F70vf%2FAABP8s2R%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2Fzff%2FAABB8s2R5f%2F%2FAAB5LgAA%2F%2B7Czff%2FAABB7s2R%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2Fzff%2FAABB99KRpdz%2FAAAAAAAA4Ktm0vv%2FAABB7s2R%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2Fzff%2FAABB7teYQZHNkS4AebfImAAA1%2FfyAABP7s2R%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2Fzff%2FAABByMiYAAB5159P0v%2F%2FAABBwtKrAABc7s2R%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2Fzff%2FAABPcIJwAAAA%2B%2BW3%2F%2F%2F%2FAHC3gnBBAABP7s2R%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2Fzff%2FAABcAAAAmE8A%2F%2F%2Fy%2F%2F%2F%2Fn9LyAAAAAAAA7s2Y%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FzfL%2FAABcAAAA4LFw%2F%2F%2F%2F%2F%2F%2F%2F4P%2F%2FAAB5AAAA7s2R%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F0vf%2FAABmXAAA%2F%2B7I%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FXJ%2FSAAAA8s2Y%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FAAAA%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2F%2FAAAA"/>
- <p/>
- <pre id="test">
- </pre>
- </body>
-
- <script class="testbody" type="application/javascript">
- <![CDATA[
-const knsIClipboard = Components.interfaces.nsIClipboard;
-
-function copyImageToClipboard()
-{
- var tmpNode = document.popupNode;
- document.popupNode = document.getElementById("bitmapImage");
-
- const kCmd = "cmd_copyImageContents";
- var controller = top.document.commandDispatcher
- .getControllerForCommand(kCmd);
- ok((controller && controller.isCommandEnabled(kCmd)), "have copy command");
- controller.doCommand(kCmd);
-
- document.popupNode = tmpNode;
-}
-
-function getLoadContext() {
- const Ci = Components.interfaces;
- return window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsILoadContext);
-}
-
-function runImageClipboardTests(aCBSvc, aImageType)
-{
- // Verify that hasDataMatchingFlavors() is working correctly.
- var typeArray = [ aImageType ];
- var hasImage = aCBSvc.hasDataMatchingFlavors(typeArray, typeArray.length,
- knsIClipboard.kGlobalClipboard);
- ok(hasImage, aImageType + " - hasDataMatchingFlavors()");
-
- // Verify that getData() is working correctly.
- var xfer = Components.classes["@mozilla.org/widget/transferable;1"]
- .createInstance(Components.interfaces.nsITransferable);
- xfer.init(getLoadContext());
- xfer.addDataFlavor(aImageType);
- aCBSvc.getData(xfer, knsIClipboard.kGlobalClipboard);
-
- var typeObj = {}, dataObj = {}, lenObj = {};
- xfer.getAnyTransferData(typeObj, dataObj, lenObj);
- var gotValue = (null != dataObj.value);
- ok(gotValue, aImageType + " - getData() returned a value");
- if (gotValue)
- {
- const knsIInputStream = Components.interfaces.nsIInputStream;
- var imgStream = dataObj.value.QueryInterface(knsIInputStream);
- ok((null != imgStream), aImageType + " - got an nsIInputStream");
- var bytesAvailable = imgStream.available();
- ok((bytesAvailable > 10), aImageType + " - got some data");
- }
-}
-
-function initAndRunTests()
-{
- SimpleTest.waitForExplicitFinish();
-
- copyImageToClipboard();
-
- var cbSvc = Components.classes["@mozilla.org/widget/clipboard;1"]
- .getService(knsIClipboard);
-
- // Work around a problem on Windows where clipboard is not ready after copy.
- setTimeout(function() { runTests(cbSvc); }, 0);
-}
-
-function runTests(aCBSvc)
-{
- runImageClipboardTests(aCBSvc, "image/png");
- runImageClipboardTests(aCBSvc, "image/jpg");
- runImageClipboardTests(aCBSvc, "image/jpeg");
-
- SimpleTest.finish();
-}
-
-]]>
-</script>
-</window>
diff --git a/widget/tests/test_bug466599.xul b/widget/tests/test_bug466599.xul
deleted file mode 100644
index a70f47add..000000000
--- a/widget/tests/test_bug466599.xul
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet type="text/css" href="/tests/SimpleTest/test.css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=466599
--->
-<window title="Mozilla Bug 466599"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="initAndRunTests()">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
- </body>
-
- <!-- test code goes here -->
- <script class="testbody" type="application/javascript">
- <![CDATA[
-
- /** Test for Bug 466599 **/
-
-function getLoadContext() {
- const Ci = Components.interfaces;
- return window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsILoadContext);
-}
-
-function copyToClipboard(txt)
-{
- var clipid = Components.interfaces.nsIClipboard;
- var clip =
- Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(clipid);
- if (!clip)
- return false;
- var trans =
- Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
- if (!trans)
- return false;
- trans.init(getLoadContext());
- trans.addDataFlavor('text/html');
- var str =
- Components.classes['@mozilla.org/supports-string;1'].createInstance(Components.interfaces.nsISupportsString);
- var copytext = txt;
- str.data = copytext;
- trans.setTransferData("text/html",str,copytext.length*2);
- if (!clip)
- return false;
- clip.setData(trans,null,clipid.kGlobalClipboard);
- return true;
-}
-
-function readFromClipboard()
-{
- var clipid = Components.interfaces.nsIClipboard;
- var clip =
- Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(clipid);
- if (!clip)
- return;
- var trans =
- Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
- if (!trans)
- return;
- trans.init(getLoadContext());
- trans.addDataFlavor('text/html');
- clip.getData(trans,clipid.kGlobalClipboard);
- var str = new Object();
- var strLength = new Object();
- trans.getTransferData("text/html",str,strLength);
- if (str)
- str = str.value.QueryInterface(Components.interfaces.nsISupportsString);
- if (str)
- pastetext = str.data.substring(0,strLength.value / 2);
- return pastetext;
-}
-
-function encodeHtmlEntities(s)
-{
- var result = '';
- for (var i = 0; i < s.length; i++) {
- var c = s.charAt(i);
- result += {'<':'&lt;', '>':'&gt;', '&':'&amp;', '"':'&quot;'}[c] || c;
- }
- return result;
-}
-
-function initAndRunTests()
-{
- var source = '<p>Lorem ipsum</p>';
- var expect = new RegExp('<html>.*charset=utf-8.*' + source + '.*</html>', 'im');
-
- var result = copyToClipboard(source);
- ok(result, "copied HTML data to system pasteboard");
-
- result = readFromClipboard();
- ok(expect.test(result), "data on system pasteboard is wrapped with charset metadata");
-
- $("display").innerHTML =
- '<em>source:</em> <pre>' + encodeHtmlEntities(source) + '</pre><br/>' +
- '<em>result:</em> <pre>' + encodeHtmlEntities(result) + '</pre>';
-}
-
- ]]>
- </script>
-</window>
diff --git a/widget/tests/test_bug478536.xul b/widget/tests/test_bug478536.xul
deleted file mode 100644
index e83ff6032..000000000
--- a/widget/tests/test_bug478536.xul
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=478536
--->
-<window title="Mozilla Bug 478536"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <title>Test for Bug 478536</title>
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-window.open("window_bug478536.xul", "_blank",
- "chrome,width=600,height=600");
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_bug485118.xul b/widget/tests/test_bug485118.xul
deleted file mode 100644
index bbd5daed9..000000000
--- a/widget/tests/test_bug485118.xul
+++ /dev/null
@@ -1,71 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=485118
--->
-<window title="Mozilla Bug 485118"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<hbox height="300">
- <vbox width="300">
- <scrollbar orient="horizontal"
- maxpos="10000"
- pageincrement="1"
- id="horizontal"/>
- <scrollbar orient="horizontal"
- maxpos="10000"
- pageincrement="1"
- style="-moz-appearance: scrollbar-small;"
- id="horizontalSmall"/>
- <hbox flex="1">
- <scrollbar orient="vertical"
- maxpos="10000"
- pageincrement="1"
- id="vertical"/>
- <scrollbar orient="vertical"
- maxpos="10000"
- pageincrement="1"
- style="-moz-appearance: scrollbar-small;"
- id="verticalSmall"/>
- <spacer flex="1"/>
- </hbox>
- </vbox>
-</hbox>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function runTest() {
- ["horizontal", "vertical"].forEach(function (orient) {
- ["", "Small"].forEach(function (size) {
- var elem = document.getElementById(orient + size);
- var thumbRect = document.getAnonymousElementByAttribute(elem, 'sbattr', 'scrollbar-thumb').getBoundingClientRect();
- var sizeToCheck = orient == "horizontal" ? "width" : "height";
- // var expectedSize = size == "Small" ? 19 : 26;
- var expectedSize = 26;
- is(thumbRect[sizeToCheck], expectedSize, size + " scrollbar has wrong minimum " + sizeToCheck);
- });
- });
- SimpleTest.finish();
-}
-window.addEventListener("load", runTest, false);
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_bug517396.xul b/widget/tests/test_bug517396.xul
deleted file mode 100644
index 18a1b8f59..000000000
--- a/widget/tests/test_bug517396.xul
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=517396
--->
-<window title="Mozilla Bug 517396"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-SimpleTest.waitForFocus(function () {
- // this test fails on Linux, bug 526236
- if (navigator.platform.indexOf("Lin") != -1) {
- ok(true, "disabled on Linux");
- SimpleTest.finish();
- return;
- }
-
- var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"].
- getService(Components.interfaces.nsIWindowMediator);
- var win = wm.getMostRecentWindow("navigator:browser");
- var oldWidth = win.outerWidth, oldHeight = win.outerHeight;
- win.maximize();
- var newWidth = win.outerWidth, newHeight = win.outerHeight;
- win.moveBy(10, 0);
- var sizeShouldHaveChanged = !navigator.platform.match(/Mac/);
- var compFunc = sizeShouldHaveChanged ? isnot : is;
- var not = sizeShouldHaveChanged ? "" : "not ";
- compFunc(win.outerWidth, newWidth, "moving a maximized window should " + not + "have changed its width");
- compFunc(win.outerHeight, newHeight, "moving a maximized window should " + not + "have changed its height");
- win.restore();
- is(win.outerWidth, oldWidth, "restored window has wrong width");
- is(win.outerHeight, oldHeight, "restored window has wrong height");
- SimpleTest.finish();
-});
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_bug522217.xul b/widget/tests/test_bug522217.xul
deleted file mode 100644
index 22aa1a061..000000000
--- a/widget/tests/test_bug522217.xul
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=522217
--->
-<window title="Mozilla Bug 522217"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-SimpleTest.waitForFocus(function () {
- window.open("window_bug522217.xul", "_blank",
- "chrome,resizable,width=400,height=300");
-});
-
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_bug538242.xul b/widget/tests/test_bug538242.xul
deleted file mode 100644
index 9ebab5259..000000000
--- a/widget/tests/test_bug538242.xul
+++ /dev/null
@@ -1,55 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=538242
--->
-<window title="Mozilla Bug 538242"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-if (navigator.platform.startsWith("Win")) {
- SimpleTest.expectAssertions(0, 1);
-}
-
-SimpleTest.waitForExplicitFinish();
-
-SimpleTest.waitForFocus(function () {
- if (navigator.platform.indexOf("Lin") != -1) {
- ok(true, "This test is disabled on Linux because it expects moving windows to be synchronous which is not guaranteed on Linux.");
- SimpleTest.finish();
- return;
- }
-
- var win = window.open("window_bug538242.xul", "_blank",
- "chrome=1,width=400,height=300,left=100,top=100");
- SimpleTest.waitForFocus(function () {
- is(win.screenX, 100, "window should open at 100, 100");
- is(win.screenY, 100, "window should open at 100, 100");
- var [oldX, oldY] = [win.screenX, win.screenY];
- win.moveTo(0, 0);
- isnot(win.screenX, oldX, "window should have moved to a point near 0, 0");
- isnot(win.screenY, oldY, "window should have moved to a point near 0, 0");
- win.close();
- SimpleTest.finish();
- }, win);
-});
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_bug565392.html b/widget/tests/test_bug565392.html
deleted file mode 100644
index da6999ec6..000000000
--- a/widget/tests/test_bug565392.html
+++ /dev/null
@@ -1,70 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=565392
--->
-<head>
- <title>Test for Bug 565392</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-<body>
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=565392">Mozilla Bug 565392</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-<script type="application/javascript">
-
-/** Test for Bug 565392 **/
-
- netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
- const Cc = SpecialPowers.Cc;
- const Ci = SpecialPowers.Ci;
- var ds = Cc["@mozilla.org/file/directory_service;1"]
- .getService(Ci.nsIProperties);
- var dir1 = ds.get("ProfD", Ci.nsIFile);
- var clipboard = Cc["@mozilla.org/widget/clipboard;1"]
- .getService(Ci.nsIClipboard);
-
- function getLoadContext() {
- return SpecialPowers.wrap(window).QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsILoadContext);
- }
-
- function getTransferableFile(file) {
- var transferable = Cc['@mozilla.org/widget/transferable;1']
- .createInstance(Ci.nsITransferable);
- transferable.init(getLoadContext());
- transferable.setTransferData("application/x-moz-file", file, 0);
- return transferable;
- }
-
- function setClipboardData(transferable) {
- clipboard.setData(transferable, null, 1);
- }
-
- function getClipboardData(mime) {
- var transferable = Cc['@mozilla.org/widget/transferable;1']
- .createInstance(Ci.nsITransferable);
- transferable.init(getLoadContext());
- transferable.addDataFlavor(mime);
- clipboard.getData(transferable, 1);
- var data = {};
- transferable.getTransferData(mime, data, {}) ;
- return data;
- }
-
-setClipboardData(getTransferableFile(dir1))
-is(clipboard.hasDataMatchingFlavors(["application/x-moz-file"], 1,1), true);
-var data = getClipboardData("application/x-moz-file");
-var file = data.value.QueryInterface(Ci.nsIFile);
-ok(file.isDirectory(), true);
-is(file.target, dir1.target, true);
-
-</script>
-</pre>
-</body>
-</html>
diff --git a/widget/tests/test_bug586713.xul b/widget/tests/test_bug586713.xul
deleted file mode 100644
index e91eb7931..000000000
--- a/widget/tests/test_bug586713.xul
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Native menu system tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-window.open("bug586713_window.xul", "bug586713_window",
- "chrome,width=600,height=600");
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_bug593307.xul b/widget/tests/test_bug593307.xul
deleted file mode 100644
index 0b6e4d4a1..000000000
--- a/widget/tests/test_bug593307.xul
+++ /dev/null
@@ -1,46 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=593307
--->
-<window title="Mozilla Bug 593307"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-
-function finish() {
- offscreenWindow.close();
- SimpleTest.finish();
-}
-
-var mainWindow = window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIWebNavigation)
- .QueryInterface(Components.interfaces.nsIDocShellTreeItem)
- .rootTreeItem
- .QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIDOMWindow);
-
-var offscreenWindow = mainWindow.openDialog("window_bug593307_offscreen.xul", "",
- "dialog=no,chrome,width=200,height=200,screenX=-3000,screenY=-3000",
- SimpleTest, finish);
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_bug596600.xul b/widget/tests/test_bug596600.xul
deleted file mode 100644
index 0468f7d4d..000000000
--- a/widget/tests/test_bug596600.xul
+++ /dev/null
@@ -1,177 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Native mouse event tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-const NSMouseMoved = 5;
-
-var gLeftWindow, gRightWindow, gIFrame;
-var gExpectedEvents = [];
-
-function moveMouseTo(x, y, andThen) {
- var utils = gLeftWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
- utils.sendNativeMouseEvent(x, y, NSMouseMoved, 0, gLeftWindow.documentElement);
- SimpleTest.executeSoon(andThen);
-}
-
-function openWindows() {
- gLeftWindow = open('empty_window.xul', '_blank', 'chrome,screenX=50,screenY=50,width=200,height=200');
- SimpleTest.waitForFocus(function () {
- gRightWindow = open('empty_window.xul', '', 'chrome,screenX=300,screenY=50,width=200,height=200');
- SimpleTest.waitForFocus(attachIFrameToRightWindow, gRightWindow);
- }, gLeftWindow);
-}
-
-function attachIFrameToRightWindow() {
- gIFrame = gLeftWindow.document.createElementNS(XUL_NS, "iframe");
- gIFrame.setAttribute("type", "content");
- gIFrame.setAttribute("clickthrough", "never");
- gIFrame.setAttribute("src", "data:text/html,<!DOCTYPE html>Content page");
- gIFrame.style.width = "100px";
- gIFrame.style.height = "100px";
- gIFrame.style.margin = "50px";
- gLeftWindow.document.documentElement.appendChild(gIFrame);
- gIFrame.contentWindow.addEventListener("load", function (e) {
- gIFrame.removeEventListener("load", arguments.callee, false);
- test1();
- }, false);
-}
-
-function test1() {
- // gRightWindow is active, gLeftWindow is inactive.
- moveMouseTo(0, 0, function () {
- var expectMouseOver = false, expectMouseOut = false;
- function mouseOverListener(e) {
- ok(expectMouseOver, "Got expected mouseover at " + e.screenX + ", " + e.screenY);
- expectMouseOver = false;
- }
- function mouseOutListener(e) {
- ok(expectMouseOut, "Got expected mouseout at " + e.screenX + ", " + e.screenY);
- expectMouseOut = false;
- }
- gLeftWindow.addEventListener("mouseover", mouseOverListener, false);
- gLeftWindow.addEventListener("mouseout", mouseOutListener, false);
-
- // Move into the left window
- expectMouseOver = true;
- moveMouseTo(80, 80, function () {
- ok(!expectMouseOver, "Should have got mouseover event");
-
- // Move over the iframe, which has clickthrough="never".
- expectMouseOut = true;
- moveMouseTo(150, 150, function () {
- ok (!expectMouseOut, "Should have got mouseout event");
- gLeftWindow.removeEventListener("mouseover", mouseOverListener, false);
- gLeftWindow.removeEventListener("mouseout", mouseOutListener, false);
- test2();
- });
- });
- });
-}
-
-function test2() {
- // Make the iframe cover the whole window.
- gIFrame.style.margin = "0";
- gIFrame.style.width = gIFrame.style.height = "200px";
-
- // Add a box to the iframe at the left edge.
- var doc = gIFrame.contentDocument;
- var box = doc.createElement("div");
- box.setAttribute("id", "box");
- box.style.position = "absolute";
- box.style.left = "0";
- box.style.top = "50px";
- box.style.width = "100px";
- box.style.height = "100px";
- box.style.backgroundColor = "green";
- doc.body.appendChild(box);
-
- ok(!box.matches(":hover"), "Box shouldn't be hovered (since the mouse isn't over it and since it's in a non-clickthrough iframe in a background window)");
-
- // A function to waitForFocus and then wait for synthetic mouse
- // events to happen. Note that those happen off the refresh driver,
- // and happen after animation frame requests.
- function changeFocusAndAwaitSyntheticMouse(callback, winToFocus,
- elementToWatchForMouseEventOn) {
- function mouseWatcher() {
- elementToWatchForMouseEventOn.removeEventListener("mouseover",
- mouseWatcher,
- false);
- elementToWatchForMouseEventOn.removeEventListener("mouseout",
- mouseWatcher,
- false);
- SimpleTest.executeSoon(callback);
- }
- elementToWatchForMouseEventOn.addEventListener("mouseover",
- mouseWatcher,
- false);
- elementToWatchForMouseEventOn.addEventListener("mouseout",
- mouseWatcher,
- false);
- // Just pass a dummy function to waitForFocus; the mouseout/over listener
- // will actually handle things for us.
- SimpleTest.waitForFocus(function() {}, winToFocus);
- }
-
- // Move the mouse over the box.
- moveMouseTo(100, 150, function () {
- ok(!box.matches(":hover"), "Box shouldn't be hovered (since it's in a non-clickthrough iframe in a background window)");
- // Activate the left window.
- changeFocusAndAwaitSyntheticMouse(function () {
- ok(gIFrame.matches(":hover"), "iframe should be hovered");
- ok(box.matches(":hover"), "Box should be hovered");
- // De-activate the window (by activating the right window).
- changeFocusAndAwaitSyntheticMouse(function () {
- ok(!gIFrame.matches(":hover"), "iframe shouldn't be hovered");
- ok(!box.matches(":hover"), "Box shouldn't be hovered");
- // Re-activate it.
- changeFocusAndAwaitSyntheticMouse(function () {
- ok(gIFrame.matches(":hover"), "iframe should be hovered");
- ok(box.matches(":hover"), "Box should be hovered");
- // Unhover box and iframe by moving the mouse outside the window.
- moveMouseTo(0, 150, function () {
- const isOSXSnowLeopard = navigator.userAgent.indexOf("Mac OS X 10.6") != -1;
- if (!isOSXSnowLeopard) {
- ok(!gIFrame.matches(":hover"), "iframe shouldn't be hovered");
- ok(!box.matches(":hover"), "box shouldn't be hovered");
- }
- finalize();
- });
- }, gLeftWindow, box);
- }, gRightWindow, box);
- }, gLeftWindow, box);
- });
-}
-
-function finalize() {
- gRightWindow.close();
- gLeftWindow.close();
- SimpleTest.finish();
-}
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.waitForFocus(openWindows);
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_bug673301.xul b/widget/tests/test_bug673301.xul
deleted file mode 100644
index a5736b86f..000000000
--- a/widget/tests/test_bug673301.xul
+++ /dev/null
@@ -1,40 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-
-<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
-<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"/>
-<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none"/>
-</body>
-
-<script type="application/javascript">
-function getLoadContext() {
- const Ci = Components.interfaces;
- return window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsILoadContext);
-}
-
-var clipboard = Components.classes["@mozilla.org/widget/clipboard;1"]
- .getService(Components.interfaces.nsIClipboard);
-
-var transferable = Components.classes['@mozilla.org/widget/transferable;1']
- .createInstance(Components.interfaces.nsITransferable);
-transferable.init(getLoadContext());
-
-transferable.addDataFlavor("text/unicode");
-transferable.setTransferData("text/unicode", document, 4);
-
-clipboard.setData(transferable, null, Components.interfaces.nsIClipboard.kGlobalClipboard);
-
-transferable.setTransferData("text/unicode", null, 0);
-
-SimpleTest.ok(true, "Didn't crash setting non-text data for text/unicode type");
-</script>
-</window>
diff --git a/widget/tests/test_bug760802.xul b/widget/tests/test_bug760802.xul
deleted file mode 100644
index c79be785e..000000000
--- a/widget/tests/test_bug760802.xul
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
-<?xml-stylesheet type="text/css" href="/tests/SimpleTest/test.css"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=760802
--->
-<window title="Mozilla Bug 760802"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=760802"
- target="_blank">Mozilla Bug 760802</a>
- <p id="display"></p>
- <div id="content" style="display: none"/>
- <iframe id="iframe_not_editable" width="300" height="150"
- src="data:text/html,&lt;html&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;"/><br/>
- </body>
-
- <!-- test code goes here -->
- <script type="application/javascript"><![CDATA[
-SimpleTest.waitForExplicitFinish();
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-
-function getBaseWindowInterface(win) {
- return win.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShellTreeItem)
- .treeOwner
- .QueryInterface(Ci.nsIInterfaceRequestor)
- .nsIBaseWindow;
-}
-
-function getBaseWindowInterfaceFromDocShell(win) {
- return win.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell)
- .QueryInterface(Ci.nsIBaseWindow);
-}
-
-function shouldThrowException(fun, exception) {
- try {
- fun.call();
- return false;
- } catch (e) {
- $("display").innerHTML += "<br/>OK thrown: "+e.message;
- return (e instanceof Components.Exception &&
- e.result === exception)
- }
-}
-function doesntThrowException(fun) {
- return !shouldThrowException(fun);
-}
-
-var baseWindow = getBaseWindowInterface(this);
-var nativeHandle = baseWindow.nativeHandle;
-$("display").innerHTML = "found nativeHandle for this window: "+nativeHandle;
-
-var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
-var win = wm.getMostRecentWindow("navigator:browser");
-var docShell = getBaseWindowInterfaceFromDocShell(win);
-
-ok(
- shouldThrowException(function(){docShell.nativeHandle;},
- Components.results.NS_ERROR_NOT_IMPLEMENTED),
- "nativeHandle should not be implemented for nsDocShell"
-);
-
-ok(typeof(nativeHandle) === "string", "nativeHandle should be a string");
-ok(nativeHandle.match(/^0x[0-9a-f]+$/), "nativeHandle should have a memory address format");
-
-var iWin = document.getElementById("iframe_not_editable").contentWindow;
-is(getBaseWindowInterface(iWin).nativeHandle, nativeHandle,
- "the nativeHandle of an iframe should be its parent's nativeHandle");
-
-var dialog = win.openDialog("data:text/plain,this is an active window.", "_blank",
- "chrome,dialog=yes,width=100,height=100");
-
-isnot(getBaseWindowInterface(dialog).nativeHandle, "",
- "the nativeHandle of a dialog should not be empty");
-
-dialog.close();
-
-todo(false, "the nativeHandle of a window without a mainWidget should be empty"); // how to build a window without a mainWidget ?
-
-SimpleTest.finish();
- ]]></script>
-</window>
diff --git a/widget/tests/test_chrome_context_menus_win.xul b/widget/tests/test_chrome_context_menus_win.xul
deleted file mode 100644
index 575e7743d..000000000
--- a/widget/tests/test_chrome_context_menus_win.xul
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-<window 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
-<script type="application/javascript" src="utils.js"></script>
-<script>
- setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
- SimpleTest.waitForExplicitFinish();
-
- var w = window.open('chrome_context_menus_win.xul', '_blank', 'chrome,resizable=yes,width=600,height=600');
-
- function done()
- {
- w.close();
- SimpleTest.finish();
- }
-</script>
-<body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;" />
-</window>
diff --git a/widget/tests/test_clipboard.xul b/widget/tests/test_clipboard.xul
deleted file mode 100644
index 19a55714d..000000000
--- a/widget/tests/test_clipboard.xul
+++ /dev/null
@@ -1,80 +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"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=948065
--->
-<window title="Mozilla Bug 948065"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="initAndRunTests()">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
- </body>
-
- <!-- test code goes here -->
- <script class="testbody" type="application/javascript">
- <![CDATA[
-
- /** Test for Bug 948065 **/
-
- const Cc = Components.classes;
- const Ci = Components.interfaces;
-
- const kIsMac = navigator.platform.indexOf("Mac") == 0;
-
- function getLoadContext() {
- return window.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsILoadContext);
- }
-
- // Get clipboard data to paste.
- function paste(clipboard) {
- let trans = Cc['@mozilla.org/widget/transferable;1']
- .createInstance(Ci.nsITransferable);
- trans.init(getLoadContext());
- trans.addDataFlavor("text/unicode");
- clipboard.getData(trans, Ci.nsIClipboard.kGlobalClipboard);
- let str = {};
- let length = {};
- try {
- trans.getTransferData('text/unicode', str, length);
- } catch (e) {
- str = '';
- }
- if (str) {
- str = str.value.QueryInterface(Ci.nsISupportsString);
- if (str) {
- str = str.data.substring(0, length.value / 2);
- }
- }
- return str;
- }
-
- function initAndRunTests() {
- let clipboard = Cc['@mozilla.org/widget/clipboard;1']
- .getService(Ci.nsIClipboard);
-
- // Test copy.
- const data = "random number: " + Math.random();
- let helper = Cc['@mozilla.org/widget/clipboardhelper;1']
- .getService(Ci.nsIClipboardHelper);
- helper.copyString(data);
- is(paste(clipboard), data, 'Data was successfully copied.');
-
- // Test emptyClipboard, disabled for OSX because bug 666254
- if (!kIsMac) {
- clipboard.emptyClipboard(Ci.nsIClipboard.kGlobalClipboard);
- is(paste(clipboard), '', 'Data was successfully cleared.');
- }
- }
-
- ]]>
- </script>
-</window>
diff --git a/widget/tests/test_composition_text_querycontent.xul b/widget/tests/test_composition_text_querycontent.xul
deleted file mode 100644
index e48a1b14a..000000000
--- a/widget/tests/test_composition_text_querycontent.xul
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Testing composition, text and query content events"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-// If setting selection with eSetSelection event whose range is larger than
-// the actual range, hits "Can only call this on frames that have been reflowed:
-// '!(GetStateBits() & NS_FRAME_FIRST_REFLOW) || (GetParent()->GetStateBits() &
-// NS_FRAME_TOO_DEEP_IN_FRAME_TREE)'" in nsTextFrame.cpp.
-// Strangely, this doesn't occur with RDP on Windows.
-SimpleTest.expectAssertions(0, 3);
-SimpleTest.waitForExplicitFinish();
-window.open("window_composition_text_querycontent.xul", "_blank",
- "chrome,width=600,height=600");
-
-]]>
-</script>
-</window>
diff --git a/widget/tests/test_imestate.html b/widget/tests/test_imestate.html
deleted file mode 100644
index fe5a3cce2..000000000
--- a/widget/tests/test_imestate.html
+++ /dev/null
@@ -1,1529 +0,0 @@
-<html style="ime-mode: disabled;">
-<head>
- <title>Test for IME state controling</title>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript" src="utils.js"></script>
- <link rel="stylesheet" type="text/css"
- href="chrome://mochikit/content/tests/SimpleTest/test.css" />
-</head>
-<body onload="setTimeout(runTests, 0);" style="ime-mode: disabled;">
-<script>
-setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
-</script>
-<div id="display" style="ime-mode: disabled;">
- <!-- input elements -->
- <input type="text" id="text"/><br/>
- <input type="text" id="text_readonly" readonly="readonly"/><br/>
- <input type="password" id="password"/><br/>
- <input type="password" id="password_readonly" readonly="readonly"/><br/>
- <input type="checkbox" id="checkbox"/><br/>
- <input type="radio" id="radio"/><br/>
- <input type="submit" id="submit"/><br/>
- <input type="reset" id="reset"/><br/>
- <input type="file" id="file"/><br/>
- <input type="button" id="ibutton"/><br/>
- <input type="image" id="image" alt="image"/><br/>
-
- <!-- html5 input elements -->
- <input type="url" id="url"/><br/>
- <input type="email" id="email"/><br/>
- <input type="search" id="search"/><br/>
- <input type="tel" id="tel"/><br/>
- <input type="number" id="number"/><br/>
-
- <!-- form controls -->
- <button id="button">button</button><br/>
- <textarea id="textarea">textarea</textarea><br/>
- <textarea id="textarea_readonly" readonly="readonly">textarea[readonly]</textarea><br/>
- <select id="select">
- <option value="option" selected="selected"/>
- </select><br/>
- <select id="select_multiple" multiple="multiple">
- <option value="option" selected="selected"/>
- </select><br/>
- <isindex id="isindex" prompt="isindex"/><br/>
-
- <!-- a element -->
- <a id="a_href" href="about:blank">a[href]</a><br/>
-
- <!-- ime-mode test -->
- <input type="text" id="ime_mode_auto" style="ime-mode: auto;"/><br/>
- <input type="text" id="ime_mode_normal" style="ime-mode: normal;"/><br/>
- <input type="text" id="ime_mode_active" style="ime-mode: active;"/><br/>
- <input type="text" id="ime_mode_inactive" style="ime-mode: inactive;"/><br/>
- <input type="text" id="ime_mode_disabled" style="ime-mode: disabled;"/><br/>
-
- <input type="text" id="ime_mode_auto_url" style="ime-mode: auto;"/><br/>
- <input type="text" id="ime_mode_normal_url" style="ime-mode: normal;"/><br/>
- <input type="text" id="ime_mode_active_url" style="ime-mode: active;"/><br/>
- <input type="text" id="ime_mode_inactive_url" style="ime-mode: inactive;"/><br/>
- <input type="text" id="ime_mode_disabled_url" style="ime-mode: disabled;"/><br/>
-
- <input type="text" id="ime_mode_auto_email" style="ime-mode: auto;"/><br/>
- <input type="text" id="ime_mode_normal_email" style="ime-mode: normal;"/><br/>
- <input type="text" id="ime_mode_active_email" style="ime-mode: active;"/><br/>
- <input type="text" id="ime_mode_inactive_email" style="ime-mode: inactive;"/><br/>
- <input type="text" id="ime_mode_disabled_email" style="ime-mode: disabled;"/><br/>
-
- <input type="text" id="ime_mode_auto_search" style="ime-mode: auto;"/><br/>
- <input type="text" id="ime_mode_normal_search" style="ime-mode: normal;"/><br/>
- <input type="text" id="ime_mode_active_search" style="ime-mode: active;"/><br/>
- <input type="text" id="ime_mode_inactive_search" style="ime-mode: inactive;"/><br/>
- <input type="text" id="ime_mode_disabled_search" style="ime-mode: disabled;"/><br/>
-
- <input type="text" id="ime_mode_auto_tel" style="ime-mode: auto;"/><br/>
- <input type="text" id="ime_mode_normal_tel" style="ime-mode: normal;"/><br/>
- <input type="text" id="ime_mode_active_tel" style="ime-mode: active;"/><br/>
- <input type="text" id="ime_mode_inactive_tel" style="ime-mode: inactive;"/><br/>
- <input type="text" id="ime_mode_disabled_tel" style="ime-mode: disabled;"/><br/>
-
- <input type="text" id="ime_mode_auto_number" style="ime-mode: auto;"/><br/>
- <input type="text" id="ime_mode_normal_number" style="ime-mode: normal;"/><br/>
- <input type="text" id="ime_mode_active_number" style="ime-mode: active;"/><br/>
- <input type="text" id="ime_mode_inactive_number" style="ime-mode: inactive;"/><br/>
- <input type="text" id="ime_mode_disabled_number" style="ime-mode: disabled;"/><br/>
-
- <input type="password" id="ime_mode_auto_p" style="ime-mode: auto;"/><br/>
- <input type="password" id="ime_mode_normal_p" style="ime-mode: normal;"/><br/>
- <input type="password" id="ime_mode_active_p" style="ime-mode: active;"/><br/>
- <input type="password" id="ime_mode_inactive_p" style="ime-mode: inactive;"/><br/>
- <input type="password" id="ime_mode_disabled_p" style="ime-mode: disabled;"/><br/>
- <textarea id="ime_mode_auto_t" style="ime-mode: auto;">textarea</textarea><br/>
- <textarea id="ime_mode_normal_t" style="ime-mode: normal;">textarea</textarea><br/>
- <textarea id="ime_mode_active_t" style="ime-mode: active;">textarea</textarea><br/>
- <textarea id="ime_mode_inactive_t" style="ime-mode: inactive;">textarea</textarea><br/>
- <textarea id="ime_mode_disabled_t" style="ime-mode: disabled;">textarea</textarea><br/>
-
- <!-- plugin -->
- <object type="application/x-test" id="plugin"></object><br/>
-
- <!-- contenteditable editor -->
- <div id="contenteditableEditor" contenteditable="true"></div>
-
- <!-- designMode editor -->
- <iframe id="designModeEditor"
- onload="document.getElementById('designModeEditor').contentDocument.designMode = 'on';"
- src="data:text/html,<html><body></body></html>"></iframe><br/>
-</div>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-
-<script class="testbody" type="application/javascript">
-
-SimpleTest.waitForExplicitFinish();
-
-function hitEventLoop(aFunc, aTimes)
-{
- if (--aTimes) {
- setTimeout(hitEventLoop, 0, aFunc, aTimes);
- } else {
- setTimeout(aFunc, 20);
- }
-}
-
-var gUtils = window.
- QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
-var gFM = Components.classes["@mozilla.org/focus-manager;1"].
- getService(Components.interfaces.nsIFocusManager);
-const kIMEEnabledSupported = navigator.platform.indexOf("Mac") == 0 ||
- navigator.platform.indexOf("Win") == 0 ||
- navigator.platform.indexOf("Linux") == 0;
-
-// We support to control IME open state on Windows and Mac actually. However,
-// we cannot test it on Mac if the current keyboard layout is not CJK. And also
-// we cannot test it on Win32 if the system didn't be installed IME. So,
-// currently we should not run the open state testing.
-const kIMEOpenSupported = false;
-
-function runBasicTest(aIsEditable, aInDesignMode, aDescription)
-{
- var onIMEFocusBlurHandler = null;
- var TIPCallback = function(aTIP, aNotification) {
- switch (aNotification.type) {
- case "request-to-commit":
- aTIP.commitComposition();
- break;
- case "request-to-cancel":
- aTIP.cancelComposition();
- break;
- case "notify-focus":
- case "notify-blur":
- if (onIMEFocusBlurHandler) {
- onIMEFocusBlurHandler(aNotification);
- }
- break;
- }
- return true;
- };
-
- var TIP = Components.classes["@mozilla.org/text-input-processor;1"]
- .createInstance(Components.interfaces.nsITextInputProcessor);
- if (!TIP.beginInputTransactionForTests(window, TIPCallback)) {
- ok(false, "runBasicTest(): failed to begin input transaction");
- return;
- }
-
- function test(aTest)
- {
- function moveFocus(aTest, aFocusEventHandler)
- {
- if (aInDesignMode) {
- if (document.activeElement) {
- document.activeElement.blur();
- }
- } else if (aIsEditable) {
- document.getElementById("display").focus();
- } else if (aTest.expectedEnabled == gUtils.IME_STATUS_ENABLED) {
- document.getElementById("password").focus();
- } else {
- document.getElementById("text").focus();
- }
- var previousFocusedElement = gFM.focusedElement;
- var element = document.getElementById(aTest.id);
- var focusEventTarget = element;
- var subDocument = null;
- if (element.contentDocument) {
- focusEventTarget = element.contentDocument;
- subDocument = element.contentDocument;
- element = element.contentDocument.documentElement;
- }
-
- focusEventTarget.addEventListener("focus", aFocusEventHandler, true);
- onIMEFocusBlurHandler = aFocusEventHandler;
-
- element.focus();
-
- focusEventTarget.removeEventListener("focus", aFocusEventHandler, true);
- onIMEFocusBlurHandler = null;
-
- var focusedElement = gFM.focusedElement;
- if (focusedElement) {
- var bindingParent = document.getBindingParent(focusedElement);
- if (bindingParent) {
- focusedElement = bindingParent;
- }
- }
- if (aTest.focusable) {
- is(focusedElement, element,
- aDescription + ": " + aTest.description + ", focus didn't move");
- return (element == focusedElement);
- }
- is(focusedElement, previousFocusedElement,
- aDescription + ": " + aTest.description + ", focus moved as unexpected");
- return (previousFocusedElement == focusedElement);
- }
-
- function testOpened(aTest, aOpened)
- {
- document.getElementById("text").focus();
- gUtils.IMEIsOpen = aOpened;
- if (!moveFocus(aTest)) {
- return;
- }
- var message = aDescription + ": " + aTest.description +
- ", wrong opened state";
- is(gUtils.IMEIsOpen,
- aTest.changeOpened ? aTest.expectedOpened : aOpened, message);
- }
-
- // IME Enabled state testing
- var enabled = gUtils.IME_STATUS_ENABLED;
- if (kIMEEnabledSupported) {
- var focusEventCount = 0;
- var IMEReceivesFocus = 0;
- var IMEReceivesBlur = 0;
- var IMEHasFocus = false;
-
- function onFocus(aEvent)
- {
- switch (aEvent.type) {
- case "focus":
- focusEventCount++;
- is(gUtils.IMEStatus, aTest.expectedEnabled,
- aDescription + ": " + aTest.description + ", wrong enabled state at focus event");
- break;
- case "notify-focus":
- IMEReceivesFocus++;
- IMEHasFocus = true;
- is(gUtils.IMEStatus, aTest.expectedEnabled,
- aDescription + ": " + aTest.description +
- ", IME should receive a focus notification after IME state is updated");
- break;
- case "notify-blur":
- IMEReceivesBlur++;
- IMEHasFocus = false;
- var changingStatus = !(aIsEditable && aTest.expectedEnabled == gUtils.IME_STATUS_ENABLED);
- if (aTest.toDesignModeEditor) {
- is(gUtils.IME_STATUS_ENABLED, aTest.expectedEnabled,
- aDescription + ": " + aTest.description +
- ", IME should receive a blur notification after IME state is updated");
- } else if (changingStatus) {
- isnot(gUtils.IMEStatus, aTest.expectedEnabled,
- aDescription + ": " + aTest.description +
- ", IME should receive a blur notification before IME state is updated");
- } else {
- is(gUtils.IMEStatus, aTest.expectedEnabled,
- aDescription + ": " + aTest.description +
- ", IME should receive a blur notification and its context has expected IME state if the state isn't being changed");
- }
- break;
- }
- }
-
- if (!moveFocus(aTest, onFocus)) {
- return;
- }
-
- if (aTest.focusable) {
- if (!aTest.focusEventNotFired) {
- ok(focusEventCount > 0,
- aDescription + ": " + aTest.description + ", focus event is never fired");
- if (aTest.expectedEnabled == gUtils.IME_STATUS_ENABLED || aTest.expectedEnabled == gUtils.IME_STATUS_PASSWORD) {
- ok(IMEReceivesFocus > 0,
- aDescription + ": " + aTest.description + ", IME should receive a focus notification");
- if (aInDesignMode && !aTest.toDesignModeEditor) {
- is(IMEReceivesBlur, 0,
- aDescription + ": " + aTest.description +
- ", IME shouldn't receive a blur notification in designMode since focus isn't moved from another editor");
- } else {
- ok(IMEReceivesBlur > 0,
- aDescription + ": " + aTest.description +
- ", IME should receive a blur notification for the previous focused editor");
- }
- ok(IMEHasFocus,
- aDescription + ": " + aTest.description +
- ", IME should have focus right now");
- } else {
- is(IMEReceivesFocus, 0,
- aDescription + ": " + aTest.description +
- ", IME shouldn't receive a focus notification");
- ok(IMEReceivesBlur > 0,
- aDescription + ": " + aTest.description +
- ", IME should receive a blur notification");
- ok(!IMEHasFocus,
- aDescription + ": " + aTest.description +
- ", IME shouldn't have focus right now");
- }
- } else {
- todo(focusEventCount > 0,
- aDescription + ": " + aTest.description + ", focus event should be fired");
- }
- } else {
- is(IMEReceivesFocus, 0,
- aDescription + ": " + aTest.description +
- ", IME shouldn't receive a focus notification at testing non-focusable element");
- is(IMEReceivesBlur, 0,
- aDescription + ": " + aTest.description +
- ", IME shouldn't receive a blur notification at testing non-focusable element");
- }
-
- enabled = gUtils.IMEStatus;
- inputtype = gUtils.focusedInputType;
- is(enabled, aTest.expectedEnabled,
- aDescription + ": " + aTest.description + ", wrong enabled state");
- if (aTest.expectedType && !aInDesignMode) {
- is(inputtype, aTest.expectedType,
- aDescription + ": " + aTest.description + ", wrong input type");
- } else if (aInDesignMode) {
- is(inputtype, "",
- aDescription + ": " + aTest.description + ", wrong input type")
- }
- }
-
- if (!kIMEOpenSupported || enabled != gUtils.IME_STATUS_ENABLED ||
- aTest.expectedEnabled != gUtils.IME_STATUS_ENABLED) {
- return;
- }
-
- // IME Open state testing
- testOpened(aTest, false);
- testOpened(aTest, true);
- }
-
- if (kIMEEnabledSupported) {
- // make sure there is an active element
- document.getElementById("text").focus();
- document.activeElement.blur();
- is(gUtils.IMEStatus,
- aInDesignMode ? gUtils.IME_STATUS_ENABLED : gUtils.IME_STATUS_DISABLED,
- aDescription + ": unexpected enabled state when no element has focus");
- }
-
- // Form controls except text editable elements are "disable" in normal
- // condition, however, if they are editable, they are "enabled".
- // XXX Probably there are some bugs: If the form controls editable, they
- // shouldn't be focusable.
- const kEnabledStateOnNonEditableElement =
- (aInDesignMode || aIsEditable) ? gUtils.IME_STATUS_ENABLED :
- gUtils.IME_STATUS_DISABLED;
- const kEnabledStateOnPasswordField =
- aInDesignMode ? gUtils.IME_STATUS_ENABLED : gUtils.IME_STATUS_PASSWORD;
- const kEnabledStateOnReadonlyField =
- aInDesignMode ? gUtils.IME_STATUS_ENABLED : gUtils.IME_STATUS_DISABLED;
- const kTests = [
- { id: "text",
- description: "input[type=text]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- expectedType: "text" },
- { id: "text_readonly",
- description: "input[type=text][readonly]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnReadonlyField },
- { id: "password",
- description: "input[type=password]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnPasswordField,
- expectedType: "password" },
- { id: "password_readonly",
- description: "input[type=password][readonly]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnReadonlyField },
- { id: "checkbox",
- description: "input[type=checkbox]",
- focusable: !aInDesignMode,
- focusEventNotFired: aIsEditable && !aInDesignMode,
- expectedEnabled: kEnabledStateOnNonEditableElement },
- { id: "radio",
- description: "input[type=radio]",
- focusable: !aInDesignMode,
- focusEventNotFired: aIsEditable && !aInDesignMode,
- expectedEnabled: kEnabledStateOnNonEditableElement },
- { id: "submit",
- description: "input[type=submit]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnNonEditableElement },
- { id: "reset",
- description: "input[type=reset]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnNonEditableElement },
- { id: "file",
- description: "input[type=file]",
- focusable: !aInDesignMode,
- focusEventNotFired: aIsEditable && !aInDesignMode,
- expectedEnabled: kEnabledStateOnNonEditableElement },
- { id: "button",
- description: "input[type=button]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnNonEditableElement },
- { id: "image",
- description: "input[type=image]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnNonEditableElement },
- { id: "url",
- description: "input[type=url]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- expectedType: "url" },
- { id: "email",
- description: "input[type=email]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- expectedType: "email" },
- { id: "search",
- description: "input[type=search]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- expectedType: "search" },
- { id: "tel",
- description: "input[type=tel]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- expectedType: "tel" },
- { id: "number",
- description: "input[type=number]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- expectedType: "number" },
-
- // form controls
- { id: "button",
- description: "button",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnNonEditableElement },
- { id: "textarea",
- description: "textarea",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "textarea_readonly",
- description: "textarea[readonly]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnReadonlyField },
- { id: "select",
- description: "select (dropdown list)",
- focusable: !aInDesignMode,
- focusEventNotFired: aIsEditable && !aInDesignMode,
- expectedEnabled: kEnabledStateOnNonEditableElement },
- { id: "select_multiple",
- description: "select (list box)",
- focusable: !aInDesignMode,
- focusEventNotFired: aIsEditable && !aInDesignMode,
- expectedEnabled: kEnabledStateOnNonEditableElement },
-
- // a element
- { id: "a_href",
- description: "a[href]",
- focusable: !aIsEditable && !aInDesignMode,
- expectedEnabled: kEnabledStateOnNonEditableElement },
-
- // ime-mode
- { id: "ime_mode_auto",
- description: "input[type=text][style=\"ime-mode: auto;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_normal",
- description: "input[type=text][style=\"ime-mode: normal;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_active",
- description: "input[type=text][style=\"ime-mode: active;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: true },
- { id: "ime_mode_inactive",
- description: "input[type=text][style=\"ime-mode: inactive;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: false },
- { id: "ime_mode_disabled",
- description: "input[type=text][style=\"ime-mode: disabled;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnPasswordField },
-
- { id: "ime_mode_auto_url",
- description: "input[type=url][style=\"ime-mode: auto;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_normal_url",
- description: "input[type=url][style=\"ime-mode: normal;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_active_url",
- description: "input[type=url][style=\"ime-mode: active;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: true },
- { id: "ime_mode_inactive_url",
- description: "input[type=url][style=\"ime-mode: inactive;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: false },
- { id: "ime_mode_disabled_url",
- description: "input[type=url][style=\"ime-mode: disabled;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnPasswordField },
-
- { id: "ime_mode_auto_email",
- description: "input[type=email][style=\"ime-mode: auto;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_normal_email",
- description: "input[type=email][style=\"ime-mode: normal;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_active_email",
- description: "input[type=email][style=\"ime-mode: active;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: true },
- { id: "ime_mode_inactive_email",
- description: "input[type=email][style=\"ime-mode: inactive;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: false },
- { id: "ime_mode_disabled_email",
- description: "input[type=email][style=\"ime-mode: disabled;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnPasswordField },
-
- { id: "ime_mode_auto_search",
- description: "input[type=search][style=\"ime-mode: auto;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_normal_search",
- description: "input[type=search][style=\"ime-mode: normal;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_active_search",
- description: "input[type=search][style=\"ime-mode: active;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: true },
- { id: "ime_mode_inactive_search",
- description: "input[type=search][style=\"ime-mode: inactive;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: false },
- { id: "ime_mode_disabled_search",
- description: "input[type=search][style=\"ime-mode: disabled;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnPasswordField },
-
- { id: "ime_mode_auto_tel",
- description: "input[type=tel][style=\"ime-mode: auto;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_normal_tel",
- description: "input[type=tel][style=\"ime-mode: normal;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_active_tel",
- description: "input[type=tel][style=\"ime-mode: active;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: true },
- { id: "ime_mode_inactive_tel",
- description: "input[type=tel][style=\"ime-mode: inactive;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: false },
- { id: "ime_mode_disabled_tel",
- description: "input[type=tel][style=\"ime-mode: disabled;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnPasswordField },
-
- { id: "ime_mode_auto_number",
- description: "input[type=number][style=\"ime-mode: auto;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_normal_number",
- description: "input[type=number][style=\"ime-mode: normal;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_active_number",
- description: "input[type=number][style=\"ime-mode: active;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: true },
- { id: "ime_mode_inactive_number",
- description: "input[type=number][style=\"ime-mode: inactive;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: false },
- { id: "ime_mode_disabled_number",
- description: "input[type=number][style=\"ime-mode: disabled;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnPasswordField },
-
- { id: "ime_mode_auto_p",
- description: "input[type=password][style=\"ime-mode: auto;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnPasswordField },
- { id: "ime_mode_normal_p",
- description: "input[type=password][style=\"ime-mode: normal;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_active_p",
- description: "input[type=password][style=\"ime-mode: active;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: true },
- { id: "ime_mode_inactive_p",
- description: "input[type=password][style=\"ime-mode: inactive;\"]",
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- focusable: !aInDesignMode,
- changeOpened: true, expectedOpened: false },
- { id: "ime_mode_disabled_p",
- description: "input[type=password][style=\"ime-mode: disabled;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnPasswordField },
- { id: "ime_mode_auto",
- description: "textarea[style=\"ime-mode: auto;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_normal",
- description: "textarea[style=\"ime-mode: normal;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "ime_mode_active",
- description: "textarea[style=\"ime-mode: active;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- changeOpened: true, expectedOpened: true },
- { id: "ime_mode_inactive",
- description: "textarea[style=\"ime-mode: inactive;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED,
- changeOpened: true, expectedOpened: false },
- { id: "ime_mode_disabled",
- description: "textarea[style=\"ime-mode: disabled;\"]",
- focusable: !aInDesignMode,
- expectedEnabled: kEnabledStateOnPasswordField },
-
- // HTML editors
- { id: "contenteditableEditor",
- description: "div[contenteditable=\"true\"]",
- focusable: !aIsEditable && !aInDesignMode,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- { id: "designModeEditor",
- description: "designMode editor",
- focusable: true,
- toDesignModeEditor: true,
- expectedEnabled: gUtils.IME_STATUS_ENABLED },
- ];
-
- for (var i = 0; i < kTests.length; i++) {
- test(kTests[i]);
- }
-}
-
-function runPluginTest()
-{
- if (!kIMEEnabledSupported) {
- return;
- }
-
- if (navigator.platform.indexOf("Mac") == 0) {
- // XXX on mac, currently, this test isn't passed because it doesn't return
- // IME_STATUS_PLUGIN by its bug.
- return;
- }
-
- var plugin = document.getElementById("plugin");
-
- document.activeElement.blur();
- is(gUtils.IMEStatus, gUtils.IME_STATUS_DISABLED,
- "runPluginTest: unexpected enabled state when no element has focus");
-
- plugin.focus();
- is(gUtils.IMEStatus, gUtils.IME_STATUS_PLUGIN,
- "runPluginTest: unexpected enabled state when plugin has focus");
-
- plugin.blur();
- is(gUtils.IMEStatus, gUtils.IME_STATUS_DISABLED,
- "runPluginTest: unexpected enabled state when plugin has focus");
-
- plugin.focus();
- is(gUtils.IMEStatus, gUtils.IME_STATUS_PLUGIN,
- "runPluginTest: unexpected enabled state when plugin has focus #2");
-
- var parent = plugin.parentNode;
- parent.removeChild(plugin);
- is(gUtils.IMEStatus, gUtils.IME_STATUS_DISABLED,
- "runPluginTest: unexpected enabled state when plugin is removed from tree");
-
- document.getElementById("text").focus();
- is(gUtils.IMEStatus, gUtils.IME_STATUS_ENABLED,
- "runPluginTest: unexpected enabled state when input[type=text] has focus");
-}
-
-function runTypeChangingTest()
-{
- if (!kIMEEnabledSupported)
- return;
-
- const kInputControls = [
- { id: "text",
- type: "text", expected: gUtils.IME_STATUS_ENABLED,
- description: "[type=\"text\"]" },
- { id: "text_readonly",
- type: "text", expected: gUtils.IME_STATUS_DISABLED, isReadonly: true,
- description: "[type=\"text\"][readonly]" },
- { id: "password",
- type: "password", expected: gUtils.IME_STATUS_PASSWORD,
- description: "[type=\"password\"]" },
- { id: "password_readonly",
- type: "password", expected: gUtils.IME_STATUS_DISABLED, isReadonly: true,
- description: "[type=\"password\"][readonly]" },
- { id: "checkbox",
- type: "checkbox", expected: gUtils.IME_STATUS_DISABLED,
- description: "[type=\"checkbox\"]" },
- { id: "radio",
- type: "radio", expected: gUtils.IME_STATUS_DISABLED,
- description: "[type=\"radio\"]" },
- { id: "submit",
- type: "submit", expected: gUtils.IME_STATUS_DISABLED,
- description: "[type=\"submit\"]" },
- { id: "reset",
- type: "reset", expected: gUtils.IME_STATUS_DISABLED,
- description: "[type=\"reset\"]" },
- { id: "file",
- type: "file", expected: gUtils.IME_STATUS_DISABLED,
- description: "[type=\"file\"]" },
- { id: "ibutton",
- type: "button", expected: gUtils.IME_STATUS_DISABLED,
- description: "[type=\"button\"]" },
- { id: "image",
- type: "image", expected: gUtils.IME_STATUS_DISABLED,
- description: "[type=\"image\"]" },
- { id: "url",
- type: "url", expected: gUtils.IME_STATUS_ENABLED,
- description: "[type=\"url\"]" },
- { id: "email",
- type: "email", expected: gUtils.IME_STATUS_ENABLED,
- description: "[type=\"email\"]" },
- { id: "search",
- type: "search", expected: gUtils.IME_STATUS_ENABLED,
- description: "[type=\"search\"]" },
- { id: "tel",
- type: "tel", expected: gUtils.IME_STATUS_ENABLED,
- description: "[type=\"tel\"]" },
- { id: "number",
- type: "number", expected: gUtils.IME_STATUS_ENABLED,
- description: "[type=\"number\"]" },
- { id: "ime_mode_auto",
- type: "text", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"text\"][ime-mode: auto;]" },
- { id: "ime_mode_normal",
- type: "text", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"text\"][ime-mode: normal;]" },
- { id: "ime_mode_active",
- type: "text", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"text\"][ime-mode: active;]" },
- { id: "ime_mode_inactive",
- type: "text", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"text\"][ime-mode: inactive;]" },
- { id: "ime_mode_disabled",
- type: "text", expected: gUtils.IME_STATUS_PASSWORD, imeMode: true,
- description: "[type=\"text\"][ime-mode: disabled;]" },
-
- { id: "ime_mode_auto_url",
- type: "url", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"url\"][ime-mode: auto;]" },
- { id: "ime_mode_normal_url",
- type: "url", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"url\"][ime-mode: normal;]" },
- { id: "ime_mode_active_url",
- type: "url", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"url\"][ime-mode: active;]" },
- { id: "ime_mode_inactive_url",
- type: "url", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"url\"][ime-mode: inactive;]" },
- { id: "ime_mode_disabled_url",
- type: "url", expected: gUtils.IME_STATUS_PASSWORD, imeMode: true,
- description: "[type=\"url\"][ime-mode: disabled;]" },
-
- { id: "ime_mode_auto_email",
- type: "email", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"email\"][ime-mode: auto;]" },
- { id: "ime_mode_normal_email",
- type: "email", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"email\"][ime-mode: normal;]" },
- { id: "ime_mode_active_email",
- type: "email", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"email\"][ime-mode: active;]" },
- { id: "ime_mode_inactive_email",
- type: "email", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"email\"][ime-mode: inactive;]" },
- { id: "ime_mode_disabled_email",
- type: "email", expected: gUtils.IME_STATUS_PASSWORD, imeMode: true,
- description: "[type=\"email\"][ime-mode: disabled;]" },
-
- { id: "ime_mode_auto_search",
- type: "search", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"search\"][ime-mode: auto;]" },
- { id: "ime_mode_normal_search",
- type: "search", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"search\"][ime-mode: normal;]" },
- { id: "ime_mode_active_search",
- type: "search", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"search\"][ime-mode: active;]" },
- { id: "ime_mode_inactive_search",
- type: "search", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"search\"][ime-mode: inactive;]" },
- { id: "ime_mode_disabled_search",
- type: "search", expected: gUtils.IME_STATUS_PASSWORD, imeMode: true,
- description: "[type=\"search\"][ime-mode: disabled;]" },
-
- { id: "ime_mode_auto_tel",
- type: "tel", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"tel\"][ime-mode: auto;]" },
- { id: "ime_mode_normal_tel",
- type: "tel", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"tel\"][ime-mode: normal;]" },
- { id: "ime_mode_active_tel",
- type: "tel", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"tel\"][ime-mode: active;]" },
- { id: "ime_mode_inactive_tel",
- type: "tel", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"tel\"][ime-mode: inactive;]" },
- { id: "ime_mode_disabled_tel",
- type: "tel", expected: gUtils.IME_STATUS_PASSWORD, imeMode: true,
- description: "[type=\"tel\"][ime-mode: disabled;]" },
-
- { id: "ime_mode_auto_number",
- type: "number", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"number\"][ime-mode: auto;]" },
- { id: "ime_mode_normal_number",
- type: "number", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"number\"][ime-mode: normal;]" },
- { id: "ime_mode_active_number",
- type: "number", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"number\"][ime-mode: active;]" },
- { id: "ime_mode_inactive_number",
- type: "number", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"number\"][ime-mode: inactive;]" },
- { id: "ime_mode_disabled_number",
- type: "number", expected: gUtils.IME_STATUS_PASSWORD, imeMode: true,
- description: "[type=\"number\"][ime-mode: disabled;]" },
-
- { id: "ime_mode_auto_p",
- type: "password", expected: gUtils.IME_STATUS_PASSWORD, imeMode: true,
- description: "[type=\"password\"][ime-mode: auto;]" },
- { id: "ime_mode_normal_p",
- type: "password", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"password\"][ime-mode: normal;]" },
- { id: "ime_mode_active_p",
- type: "password", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"password\"][ime-mode: active;]" },
- { id: "ime_mode_inactive_p",
- type: "password", expected: gUtils.IME_STATUS_ENABLED, imeMode: true,
- description: "[type=\"password\"][ime-mode: inactive;]" },
- { id: "ime_mode_disabled_p",
- type: "password", expected: gUtils.IME_STATUS_PASSWORD, imeMode: true,
- description: "[type=\"password\"][ime-mode: disabled;]" }
- ];
-
- const kInputTypes = [
- { type: "", expected: gUtils.IME_STATUS_ENABLED },
- { type: "text", expected: gUtils.IME_STATUS_ENABLED },
- { type: "password", expected: gUtils.IME_STATUS_PASSWORD },
- { type: "checkbox", expected: gUtils.IME_STATUS_DISABLED },
- { type: "radio", expected: gUtils.IME_STATUS_DISABLED },
- { type: "submit", expected: gUtils.IME_STATUS_DISABLED },
- { type: "reset", expected: gUtils.IME_STATUS_DISABLED },
- { type: "file", expected: gUtils.IME_STATUS_DISABLED },
- { type: "button", expected: gUtils.IME_STATUS_DISABLED },
- { type: "image", expected: gUtils.IME_STATUS_DISABLED },
- { type: "url", expected: gUtils.IME_STATUS_ENABLED },
- { type: "email", expected: gUtils.IME_STATUS_ENABLED },
- { type: "search", expected: gUtils.IME_STATUS_ENABLED },
- { type: "tel", expected: gUtils.IME_STATUS_ENABLED },
- { type: "number", expected: gUtils.IME_STATUS_ENABLED }
- ];
-
- function getExpectedIMEEnabled(aNewType, aInputControl)
- {
- if (aNewType.expected == gUtils.IME_STATUS_DISABLED ||
- aInputControl.isReadonly)
- return gUtils.IME_STATUS_DISABLED;
- return aInputControl.imeMode ? aInputControl.expected : aNewType.expected;
- }
-
- const kOpenedState = [ true, false ];
-
- for (var i = 0; i < kOpenedState.length; i++) {
- const kOpened = kOpenedState[i];
- for (var j = 0; j < kInputControls.length; j++) {
- const kInput = kInputControls[j];
- var e = document.getElementById(kInput.id);
- e.focus();
- for (var k = 0; k < kInputTypes.length; k++) {
- const kType = kInputTypes[k];
- var typeChangingDescription =
- "\"" + e.getAttribute("type") + "\" to \"" + kInput.type + "\"";
- e.setAttribute("type", kInput.type);
- is(gUtils.IMEStatus, kInput.expected,
- "type attr changing test (IMEStatus): " + typeChangingDescription +
- " (" + kInput.description + ")");
- is(gUtils.focusedInputType, kInput.type,
- "type attr changing test (type): " + typeChangingDescription +
- " (" + kInput.description + ")");
-
- const kTestOpenState = kIMEOpenSupported &&
- gUtils.IMEStatus == gUtils.IME_STATUS_ENABLED &&
- getExpectedIMEEnabled(kType, kInput) == gUtils.IME_STATUS_ENABLED;
- if (kTestOpenState) {
- gUtils.IMEIsOpen = kOpened;
- }
-
- typeChangingDescription =
- "\"" + e.getAttribute("type") + "\" to \"" + kType.type + "\"";
- if (kType.type != "")
- e.setAttribute("type", kType.type);
- else
- e.removeAttribute("type");
-
- is(gUtils.IMEStatus, getExpectedIMEEnabled(kType, kInput),
- "type attr changing test (IMEStatus): " + typeChangingDescription +
- " (" + kInput.description + ")");
- is(gUtils.focusedInputType, kType.type,
- "type attr changing test (type): " + typeChangingDescription +
- " (" + kInput.description + ")");
- if (kTestOpenState && gUtils.IMEStatus == gUtils.IME_STATUS_ENABLED) {
- is(gUtils.IMEIsOpen, kOpened,
- "type attr changing test (open state is changed): " +
- typeChangingDescription + " (" + kInput.description + ")");
- }
- }
- // reset the type to default
- e.setAttribute("type", kInput.type);
- }
- if (!kIMEOpenSupported)
- break;
- }
-}
-
-function runReadonlyChangingTest()
-{
- if (!kIMEEnabledSupported)
- return;
-
- const kInputControls = [
- { id: "text",
- type: "text", expected: gUtils.IME_STATUS_ENABLED },
- { id: "password",
- type: "password", expected: gUtils.IME_STATUS_PASSWORD },
- { id: "url",
- type: "url", expected: gUtils.IME_STATUS_ENABLED },
- { id: "email",
- type: "email", expected: gUtils.IME_STATUS_ENABLED },
- { id: "search",
- type: "search", expected: gUtils.IME_STATUS_ENABLED },
- { id: "tel",
- type: "tel", expected: gUtils.IME_STATUS_ENABLED },
- { id: "number",
- type: "number", expected: gUtils.IME_STATUS_ENABLED },
- { id: "textarea",
- type: "textarea", expected: gUtils.IME_STATUS_ENABLED }
- ];
- const kOpenedState = [ true, false ];
-
- for (var i = 0; i < kOpenedState.length; i++) {
- const kOpened = kOpenedState[i];
- for (var j = 0; j < kInputControls.length; j++) {
- const kInput = kInputControls[j];
- var e = document.getElementById(kInput.id);
- e.focus();
- if (kIMEOpenSupported && gUtils.IMEStatus == gUtils.IME_STATUS_ENABLED) {
- gUtils.IMEIsOpen = kOpened;
- }
- e.setAttribute("readonly", "readonly");
- is(gUtils.IMEStatus, gUtils.IME_STATUS_DISABLED,
- "readonly attr setting test: type=" + kInput.type);
- e.removeAttribute("readonly");
- is(gUtils.IMEStatus, kInput.expected,
- "readonly attr removing test: type=" + kInput.type);
- if (kIMEOpenSupported && gUtils.IMEStatus == gUtils.IME_STATUS_ENABLED) {
- is(gUtils.IMEIsOpen, kOpened,
- "readonly attr removing test (open state is changed): type=" +
- kInput.type);
- }
- }
- if (!kIMEOpenSupported)
- break;
- }
-}
-
-function runComplexContenteditableTests()
-{
- if (!kIMEEnabledSupported) {
- return;
- }
-
- var description = "runReadonlyChangingOnContenteditable: ";
-
- var container = document.getElementById("display");
- var button = document.getElementById("button");
-
- // the editor has focus directly.
- container.setAttribute("contenteditable", "true");
- container.focus();
-
- is(gFM.focusedElement, container,
- description + "The editor doesn't get focus");
- is(gUtils.IMEStatus, gUtils.IME_STATUS_ENABLED,
- description + "IME isn't enabled on HTML editor");
- const kReadonly =
- Components.interfaces.nsIPlaintextEditor.eEditorReadonlyMask;
- var editor =
- window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIWebNavigation).
- QueryInterface(Components.interfaces.nsIDocShell).editor;
- var flags = editor.flags;
- editor.flags = flags | kReadonly;
- is(gFM.focusedElement, container,
- description + "The editor loses focus by flag change");
- is(gUtils.IMEStatus, gUtils.IME_STATUS_DISABLED,
- description + "IME is still enabled on readonly HTML editor");
- editor.flags = flags;
- is(gFM.focusedElement, container,
- description + "The editor loses focus by flag change #2");
- is(gUtils.IMEStatus, gUtils.IME_STATUS_ENABLED,
- description + "IME is still disabled, the editor isn't readonly now");
- container.removeAttribute("contenteditable");
- todo_is(gFM.focusedElement, null,
- description + "The container still has focus, the editor has been no editable");
- todo_is(gUtils.IMEStatus, gUtils.IME_STATUS_DISABLED,
- description + "IME is still enabled on the editor, the editor has been no editable");
-
- // a button which is in the editor has focus
- button.focus();
- is(gFM.focusedElement, button,
- description + "The button doesn't get focus");
- is(gUtils.IMEStatus, gUtils.IME_STATUS_DISABLED,
- description + "IME is enabled on the button");
- container.setAttribute("contenteditable", "true");
- is(gFM.focusedElement, button,
- description + "The button loses focus, the container is editable now");
- todo_is(gUtils.IMEStatus, gUtils.IME_STATUS_ENABLED,
- description + "IME is still disabled on the button, the container is editable now");
- editor =
- window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIWebNavigation).
- QueryInterface(Components.interfaces.nsIDocShell).editor;
- flags = editor.flags;
- editor.flags = flags | kReadonly;
- is(gFM.focusedElement, button,
- description + "The button loses focus by changing editor flags");
- is(gUtils.IMEStatus, gUtils.IME_STATUS_DISABLED,
- description + "IME is still enabled on the button, the container is readonly now");
- editor.flags = flags;
- is(gFM.focusedElement, button,
- description + "The button loses focus by changing editor flags #2");
- is(gUtils.IMEStatus, gUtils.IME_STATUS_ENABLED,
- description + "IME is still disabled on the button, the container isn't readonly now");
- container.removeAttribute("contenteditable");
- is(gFM.focusedElement, button,
- description + "The button loses focus, the container has been no editable");
- todo_is(gUtils.IMEStatus, gUtils.IME_STATUS_DISABLED,
- description + "IME is still enabled on the button, the container has been no editable");
-
- description = "testOnIndependentEditor: ";
- function testOnIndependentEditor(aEditor, aEditorDescription)
- {
- var isReadonly = aEditor.readOnly;
- var expectedState =
- aEditor.readOnly ? gUtils.IME_STATUS_DISABLED : gUtils.IME_STATUS_ENABLED;
- var unexpectedStateDescription =
- expectedState != gUtils.IME_STATUS_ENABLED ? "enabled" : "disabled";
- aEditor.focus();
- is(gFM.focusedElement, aEditor,
- description + "The " + aEditorDescription + " doesn't get focus");
- is(gUtils.IMEStatus, expectedState,
- description + "IME is " + unexpectedStateDescription +
- " on the " + aEditorDescription);
- container.setAttribute("contenteditable", "true");
- is(gFM.focusedElement, aEditor,
- description + "The " + aEditorDescription +
- " loses focus, the container is editable now");
- is(gUtils.IMEStatus, expectedState,
- description + "IME becomes " + unexpectedStateDescription +
- " on the " + aEditorDescription + ", the container is editable now");
- editor =
- window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIWebNavigation).
- QueryInterface(Components.interfaces.nsIDocShell).editor;
- flags = editor.flags;
- editor.flags = flags | kReadonly;
- is(gFM.focusedElement, aEditor,
- description + "The " + aEditorDescription +
- " loses focus by changing editor flags");
- is(gUtils.IMEStatus, expectedState,
- description + "IME becomes " + unexpectedStateDescription + " on the " +
- aEditorDescription + ", the container is readonly now");
- editor.flags = flags;
- is(gFM.focusedElement, aEditor,
- description + "The " + aEditorDescription +
- " loses focus by changing editor flags #2");
- is(gUtils.IMEStatus, expectedState,
- description + "IME becomes " + unexpectedStateDescription + " on the " +
- aEditorDescription + ", the container isn't readonly now");
- container.removeAttribute("contenteditable");
- is(gFM.focusedElement, aEditor,
- description + "The " + aEditorDescription +
- " loses focus, the container has been no editable");
- is(gUtils.IMEStatus, expectedState,
- description + "IME becomes " + unexpectedStateDescription + " on the " +
- aEditorDescription + ", the container has been no editable");
- }
-
- // a textarea which is in the editor has focus
- testOnIndependentEditor(document.getElementById("textarea"),
- "textarea");
- // a readonly textarea which is in the editor has focus
- testOnIndependentEditor(document.getElementById("textarea_readonly"),
- "textarea[readonly]");
- // an input field which is in the editor has focus
- testOnIndependentEditor(document.getElementById("text"),
- "input[type=\"text\"]");
- // a readonly input field which is in the editor has focus
- testOnIndependentEditor(document.getElementById("text_readonly"),
- "input[type=\"text\"][readonly]");
-
- description = "testOnOutsideOfEditor: ";
- function testOnOutsideOfEditor(aFocusNode, aFocusNodeDescription, aEditor)
- {
- if (aFocusNode) {
- aFocusNode.focus();
- is(gFM.focusedElement, aFocusNode,
- description + "The " + aFocusNodeDescription + " doesn't get focus");
- } else {
- if (document.activeElement) {
- document.activeElement.blur();
- }
- is(gFM.focusedElement, null,
- description + "Unexpected element has focus");
- }
- var expectedState =
- aFocusNode ? gUtils.IMEStatus : gUtils.IME_STATUS_DISABLED;
- var unexpectedStateDescription =
- expectedState != gUtils.IME_STATUS_ENABLED ? "enabled" : "disabled";
-
- aEditor.setAttribute("contenteditable", "true");
- is(gFM.focusedElement, aFocusNode,
- description + "The " + aFocusNodeDescription +
- " loses focus, a HTML editor is editable now");
- is(gUtils.IMEStatus, expectedState,
- description + "IME becomes " + unexpectedStateDescription +
- " on the " + aFocusNodeDescription +
- ", the HTML editor is editable now");
- editor =
- window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIWebNavigation).
- QueryInterface(Components.interfaces.nsIDocShell).editor;
- flags = editor.flags;
- editor.flags = flags | kReadonly;
- is(gFM.focusedElement, aFocusNode,
- description + aFocusNodeDescription +
- " loses focus by changing HTML editor flags");
- is(gUtils.IMEStatus, expectedState,
- description + "IME becomes " + unexpectedStateDescription + " on " +
- aFocusNodeDescription + ", the HTML editor is readonly now");
- editor.flags = flags;
- is(gFM.focusedElement, aFocusNode,
- description + aFocusNodeDescription +
- " loses focus by changing HTML editor flags #2");
- is(gUtils.IMEStatus, expectedState,
- description + "IME becomes " + unexpectedStateDescription + " on " +
- aFocusNodeDescription + ", the HTML editor isn't readonly now");
- container.removeAttribute("contenteditable");
- is(gFM.focusedElement, aFocusNode,
- description + aFocusNodeDescription +
- " loses focus, the HTML editor has been no editable");
- is(gUtils.IMEStatus, expectedState,
- description + "IME becomes " + unexpectedStateDescription + " on " +
- aFocusNodeDescription + ", the HTML editor has been no editable");
- }
-
- var div = document.getElementById("contenteditableEditor");
- // a textarea which is outside of the editor has focus
- testOnOutsideOfEditor(document.getElementById("textarea"), "textarea", div);
- // a readonly textarea which is outside of the editor has focus
- testOnOutsideOfEditor(document.getElementById("textarea_readonly"),
- "textarea[readonly]", div);
- // an input field which is outside of the editor has focus
- testOnOutsideOfEditor(document.getElementById("text"),
- "input[type=\"text\"]", div);
- // a readonly input field which outside of the editor has focus
- testOnOutsideOfEditor(document.getElementById("text_readonly"),
- "input[type=\"text\"][readonly]", div);
- // a readonly input field which outside of the editor has focus
- testOnOutsideOfEditor(document.getElementById("button"), "button", div);
- // nobody has focus.
- testOnOutsideOfEditor(null, "nobody", div);
-}
-
-function runEditorFlagChangeTests()
-{
- if (!kIMEEnabledSupported) {
- return;
- }
-
- var description = "runEditorFlagChangeTests: ";
-
- var container = document.getElementById("display");
-
- // Reset selection from previous tests.
- window.getSelection().collapse(container, 0);
-
- // the editor has focus directly.
- container.setAttribute("contenteditable", "true");
- container.focus();
-
- is(gFM.focusedElement, container,
- description + "The editor doesn't get focus");
- is(gUtils.IMEStatus, gUtils.IME_STATUS_ENABLED,
- description + "IME isn't enabled on HTML editor");
- const kIMEStateChangeFlags =
- Components.interfaces.nsIPlaintextEditor.eEditorPasswordMask |
- Components.interfaces.nsIPlaintextEditor.eEditorReadonlyMask |
- Components.interfaces.nsIPlaintextEditor.eEditorDisabledMask;
- var editor =
- window.QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIWebNavigation).
- QueryInterface(Components.interfaces.nsIDocShell).editor;
- var editorIMESupport =
- editor.QueryInterface(Components.interfaces.nsIEditorIMESupport);
- var flags = editor.flags;
-
- // input characters
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3078\u3093\u3057\u3093",
- "clauses":
- [
- { "length": 4, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 4, "length": 0 }
- });
-
- editor.flags &= ~kIMEStateChangeFlags;
- ok(editorIMESupport.composing,
- description + "#1 IME composition was committed unexpectedly");
- is(gUtils.IMEStatus, gUtils.IME_STATUS_ENABLED,
- description + "#1 IME isn't enabled on HTML editor");
-
- editor.flags |= ~kIMEStateChangeFlags;
- ok(editorIMESupport.composing,
- description + "#2 IME composition was committed unexpectedly");
- is(gUtils.IMEStatus, gUtils.IME_STATUS_ENABLED,
- description + "#2 IME isn't enabled on HTML editor");
-
- editor.flags = flags;
- ok(editorIMESupport.composing,
- description + "#3 IME composition was committed unexpectedly");
- is(gUtils.IMEStatus, gUtils.IME_STATUS_ENABLED,
- description + "#3 IME isn't enabled on HTML editor");
-
- // cancel the composition
- synthesizeComposition({ type: "compositioncommit", data: "" });
-
- container.removeAttribute("contenteditable");
-}
-
-function runEditableSubframeTests()
-{
- window.open("window_imestate_iframes.html", "_blank",
- "width=600,height=600");
-}
-
-function runTestPasswordFieldOnDialog()
-{
- if (!kIMEEnabledSupported) {
- return;
- }
-
- if (document.activeElement) {
- document.activeElement.blur();
- }
-
- var dialog;
-
- function WindowObserver()
- {
- Components.classes["@mozilla.org/observer-service;1"].
- getService(Components.interfaces.nsIObserverService).
- addObserver(this, "domwindowopened", false);
- }
-
- WindowObserver.prototype = {
- QueryInterface: function (iid)
- {
- if (iid.equals(Components.interfaces.nsIObserver) ||
- iid.equals(Components.interfaces.nsISupports)) {
- return this;
- }
- },
-
- observe: function (subject, topic, data)
- {
- if (topic === "domwindowopened") {
- ok(true, "dialog window is created");
- dialog = subject.QueryInterface(Components.interfaces.nsIDOMWindow);
- dialog.addEventListener("load", onPasswordDialogLoad, false);
- }
- }
- };
-
- var observer = new WindowObserver();
- var arg1 = new Object(), arg2 = new Object();
- Components.classes["@mozilla.org/embedcomp/prompt-service;1"].
- getService(Components.interfaces.nsIPromptService).
- promptPassword(window, "title", "text", arg1, "msg", arg2);
-
- ok(true, "password dialog was closed");
-
- Components.classes["@mozilla.org/observer-service;1"].
- getService(Components.interfaces.nsIObserverService).
- removeObserver(observer, "domwindowopened");
-
- var passwordField;
-
- function onPasswordDialogLoad()
- {
- ok(true, "onPasswordDialogLoad is called");
- dialog.removeEventListener("load", onPasswordDialogLoad, false);
- passwordField = dialog.document.getElementById("password1Textbox");
- passwordField.addEventListener("focus", onPasswordFieldFocus, false);
- }
-
- function onPasswordFieldFocus()
- {
- ok(true, "onPasswordFieldFocus is called");
- passwordField.removeEventListener("focus", onPasswordFieldFocus, false);
- var utils = dialog.
- QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
- is(utils.IMEStatus, utils.IME_STATUS_PASSWORD,
- "IME isn't disabled on a password field of password dialog");
- synthesizeKey("VK_ESCAPE", { }, dialog);
- }
-}
-
-// Bug 580388 and bug 808287
-function runEditorReframeTests(aCallback)
-{
- if (document.activeElement) {
- document.activeElement.blur();
- }
-
- var IMEFocus = 0;
- var IMEBlur = 0;
- var IMEHasFocus = false;
- var TIPCallback = function(aTIP, aNotification) {
- switch (aNotification.type) {
- case "request-to-commit":
- aTIP.commitComposition();
- break;
- case "request-to-cancel":
- aTIP.cancelComposition();
- break;
- case "notify-focus":
- IMEFocus++;
- IMEHasFocus = true;
- break;
- case "notify-blur":
- IMEBlur++;
- IMEHasFocus = false;
- break;
- }
- return true;
- };
-
- var TIP = Components.classes["@mozilla.org/text-input-processor;1"]
- .createInstance(Components.interfaces.nsITextInputProcessor);
- if (!TIP.beginInputTransactionForTests(window, TIPCallback)) {
- ok(false, "runEditorReframeTests(): failed to begin input transaction");
- return;
- }
-
- var input = document.getElementById("text");
- input.focus();
-
- is(IMEFocus, 1, "runEditorReframeTests(): IME should receive a focus notification by a call of <input>.focus()");
- is(IMEBlur, 0, "runEditorReframeTests(): IME shouldn't receive a blur notification by a call of <input>.focus()");
- ok(IMEHasFocus, "runEditorReframeTests(): IME should have focus because <input>.focus() is called");
-
- IMEFocus = IMEBlur = 0;
-
- input.style.overflow = "visible";
-
- var onInput = function (aEvent) {
- aEvent.target.style.overflow = "hidden";
- }
- input.addEventListener("input", onInput, true);
-
- var AKey = new KeyboardEvent("", { key: "a", code: "KeyA", keyCode: KeyboardEvent.DOM_VK_A });
- TIP.keydown(AKey);
- TIP.keyup(AKey);
-
- hitEventLoop(function () {
- is(IMEFocus, 0, "runEditorReframeTests(): IME shouldn't receive a focus notification during reframing");
- is(IMEBlur, 0, "runEditorReframeTests(): IME shouldn't receive a blur notification during reframing");
- ok(IMEHasFocus, "runEditorReframeTests(): IME must have focus even after reframing");
-
- var onFocus = function(aEvent) {
- // Perform a style change and query during focus to trigger reframing
- input.style.overflow = "visible";
- synthesizeQuerySelectedText();
- };
- input.addEventListener("focus", onFocus);
- IMEFocus = IMEBlur = 0;
-
- input.blur();
- input.focus();
- TIP.keydown(AKey);
- TIP.keyup(AKey);
-
- hitEventLoop(function() {
- is(IMEFocus, 1, "runEditorReframeTests(): IME should receive a focus notification at focus but shouldn't receive it during reframing");
- is(IMEBlur, 1, "runEditorReframeTests(): IME should receive a blur notification at blur but shouldn't receive it during reframing");
- ok(IMEHasFocus, "runEditorReframeTests(): IME sould have focus after reframing during focus");
-
- input.removeEventListener("input", onInput, true);
- input.removeEventListener("focus", onFocus);
-
- input.style.overflow = "visible";
- input.value = "";
-
- TIP = null;
-
- hitEventLoop(aCallback, 20);
- }, 20);
- }, 20);
-}
-
-function runTests()
-{
- if (!kIMEEnabledSupported && !kIMEOpenSupported)
- return;
-
- // test for normal contents.
- runBasicTest(false, false, "Testing of normal contents");
-
- // test for plugin contents
- runPluginTest();
-
- var container = document.getElementById("display");
- // test for contentEditable="true"
- container.setAttribute("contenteditable", "true");
- runBasicTest(true, false, "Testing [contentEditable=\"true\"]");
-
- // test for contentEditable="false"
- container.setAttribute("contenteditable", "false");
- runBasicTest(false, false, "Testing [contentEditable=\"false\"]");
-
- // test for removing contentEditable
- container.setAttribute("contenteditable", "true");
- container.removeAttribute("contenteditable");
- runBasicTest(false, false, "Testing after contentEditable to be removed");
-
- // test designMode
- document.designMode = "on";
- runBasicTest(true, true, "Testing designMode=\"on\"");
- document.designMode = "off";
- document.getElementById("text").focus();
- runBasicTest(false, false, "Testing designMode=\"off\"");
-
- // changing input[type] values
- // XXX currently, type attribute changing doesn't work fine. bug 559728.
- // runTypeChangingTest();
-
- // changing readonly attribute
- runReadonlyChangingTest();
-
- // complex contenteditable editor's tests
- runComplexContenteditableTests();
-
- // test whether the IME state and composition are not changed unexpectedly
- runEditorFlagChangeTests();
-
- // test password field on dialog
- // XXX temporary disable against failure
- //runTestPasswordFieldOnDialog();
-
- // Asynchronous tests
- runEditorReframeTests(function () {
- // This will call onFinish(), so, this test must be the last.
- runEditableSubframeTests();
- });
-}
-
-function onFinish()
-{
- SimpleTest.finish();
-}
-
-</script>
-</body>
-
-</html>
diff --git a/widget/tests/test_input_events_on_deactive_window.xul b/widget/tests/test_input_events_on_deactive_window.xul
deleted file mode 100644
index a85646266..000000000
--- a/widget/tests/test_input_events_on_deactive_window.xul
+++ /dev/null
@@ -1,236 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Testing composition, text and query content events"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<div id="content" style="display: none">
-</div>
-<p id="display">
- <textarea id="textarea"></textarea>
-</p>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.waitForFocus(runTests, window);
-
-var fm = Components.classes["@mozilla.org/focus-manager;1"].
- getService(Components.interfaces.nsIFocusManager);
-var textarea = document.getElementById("textarea");
-var otherWindow;
-var timer;
-
-function runTests()
-{
- textarea.focus();
- is(fm.focusedElement, textarea, "we're deactive");
- if (fm.focusedElement != textarea) {
- SimpleTest.finish();
- return;
- }
-
- otherWindow =
- window.open("data:text/plain,this is an active window.", "_blank",
- "chrome,width=100,height=100");
- ok(otherWindow, "failed to open other window");
- if (!otherWindow) {
- SimpleTest.finish();
- return;
- }
-
- SimpleTest.waitForFocus(startTests, otherWindow);
- otherWindow.focus();
-}
-
-function startTests()
-{
- clearTimeout(timer);
- isnot(fm.focusedWindow, window, "we're not deactive");
- if (fm.focusedWindow == window) {
- otherWindow.close();
- SimpleTest.finish();
- return;
- }
-
- var keydownHandled, keypressHandled, keyupHandled, compositionstartHandled,
- compositionendHandled, compositionupdateHandled, inputHandled;
-
- function clear()
- {
- keydownHandled = false;
- keypressHandled = false;
- keyupHandled = false;
- compositionstartHandled = false;
- compositionendHandled = false;
- compositionupdateHandled = false;
- inputHandled = false;
- }
-
- function onEvent(aEvent)
- {
- if (aEvent.type == "keydown") {
- keydownHandled = true;
- } else if (aEvent.type == "keypress") {
- keypressHandled = true;
- } else if (aEvent.type == "keyup") {
- keyupHandled = true;
- } else if (aEvent.type == "compositionstart") {
- compositionstartHandled = true;
- } else if (aEvent.type == "compositionend") {
- compositionendHandled = true;
- } else if (aEvent.type == "compositionupdate") {
- compositionupdateHandled = true;
- } else if (aEvent.type == "input") {
- inputHandled = true;
- } else {
- ok(false, "handled unknown event: " + aEvent.type);
- }
- }
-
- textarea.addEventListener("keydown", onEvent, false);
- textarea.addEventListener("keypress", onEvent, false);
- textarea.addEventListener("keyup", onEvent, false);
- textarea.addEventListener("compositionstart", onEvent, false);
- textarea.addEventListener("compositionend", onEvent, false);
- textarea.addEventListener("compositionupdate", onEvent, false);
- textarea.addEventListener("input", onEvent, false);
-
- startTestsInternal();
-
- function startTestsInternal()
- {
- // key events
- function checkKeyEvents(aKeydown, aKeypress, aKeyup, aInput, aDescription)
- {
- is(keydownHandled, aKeydown,
- "keydown event is (not) handled: " + aDescription);
- is(keypressHandled, aKeypress,
- "keypress event is (not) handled: " + aDescription);
- is(keyupHandled, aKeyup,
- "keyup event is (not) handled: " + aDescription);
- is(inputHandled, aInput,
- "input event is (not) handled: " + aDescription);
- }
-
- function checkCompositionEvents(aStart, aEnd, aUpdate, aInput, aDescription)
- {
- is(compositionstartHandled, aStart,
- "compositionstart event is (not) handled: " + aDescription);
- is(compositionendHandled, aEnd,
- "compositionend event is (not) handled: " + aDescription);
- is(compositionupdateHandled, aUpdate,
- "compositionupdate event is (not) handled: " + aDescription);
- is(inputHandled, aInput,
- "input event is (not) handled: " + aDescription);
- }
-
- clear();
- synthesizeKey("a", { type: "keydown" });
- checkKeyEvents(true, true, false, true, "a keydown and a keypress");
- is(textarea.value, "a", "textarea value isn't 'a'");
- clear();
- synthesizeKey("a", { type: "keyup" });
- checkKeyEvents(false, false, true, false, "a keyup");
- clear();
- synthesizeKey("VK_BACK_SPACE", {});
- checkKeyEvents(true, true, true, true, "VK_BACK_SPACE key events");
- is(textarea.value, "", "textarea value isn't empty");
-
- // IME events
- clear();
- // input first character
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- checkCompositionEvents(true, false, true, true, "starting to compose");
- var queryText = synthesizeQueryTextContent(0, 100);
- ok(queryText, "query text event result is null");
- if (!queryText) {
- return;
- }
- ok(queryText.succeeded, "query text event failed");
- if (!queryText.succeeded) {
- return;
- }
- is(queryText.text, "\u3089", "composing text is incorrect");
- var querySelectedText = synthesizeQuerySelectedText();
- ok(querySelectedText, "query selected text event result is null");
- if (!querySelectedText) {
- return;
- }
- ok(querySelectedText.succeeded, "query selected text event failed");
- if (!querySelectedText.succeeded) {
- return;
- }
- is(querySelectedText.offset, 1,
- "query selected text event returns wrong offset");
- is(querySelectedText.text, "",
- "query selected text event returns wrong selected text");
- clear();
- // commit composition
- synthesizeComposition({ type: "compositioncommitasis" });
- checkCompositionEvents(false, true, false, true, "commit composition as is");
- queryText = synthesizeQueryTextContent(0, 100);
- ok(queryText, "query text event result is null after commit");
- if (!queryText) {
- return;
- }
- ok(queryText.succeeded, "query text event failed after commit");
- if (!queryText.succeeded) {
- return;
- }
- is(queryText.text, "\u3089", "composing text is incorrect after commit");
- querySelectedText = synthesizeQuerySelectedText();
- ok(querySelectedText,
- "query selected text event result is null after commit");
- if (!querySelectedText) {
- return;
- }
- ok(querySelectedText.succeeded,
- "query selected text event failed after commit");
- if (!querySelectedText.succeeded) {
- return;
- }
- is(querySelectedText.offset, 1,
- "query selected text event returns wrong offset after commit");
- is(querySelectedText.text, "",
- "query selected text event returns wrong selected text after commit");
- clear();
- }
-
- textarea.removeEventListener("keydown", onEvent, false);
- textarea.removeEventListener("keypress", onEvent, false);
- textarea.removeEventListener("keyup", onEvent, false);
- textarea.removeEventListener("compositionstart", onEvent, false);
- textarea.removeEventListener("compositionupdate", onEvent, false);
- textarea.removeEventListener("compositionend", onEvent, false);
- textarea.removeEventListener("input", onEvent, false);
-
- otherWindow.close();
-
- SimpleTest.finish();
-}
-
-
-]]>
-</script>
-</window>
diff --git a/widget/tests/test_key_event_counts.xul b/widget/tests/test_key_event_counts.xul
deleted file mode 100644
index 4dd4b83da..000000000
--- a/widget/tests/test_key_event_counts.xul
+++ /dev/null
@@ -1,90 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<!-- We've had issues on Mac OS X where native key events either don't get processed
- or they get processed twice. This test tests some of those scenarios. -->
-
-<window id="window1" title="Test Key Event Counts" onload="runTest()"
- xmlns:html="http://www.w3.org/1999/xhtml"
- 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 type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/NativeKeyCodes.js"/>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
- </body>
-
- <script type="application/javascript"><![CDATA[
- var gKeyPressEventCount = 0;
- var gKeyDownEventCound = 0;
-
- function onKeyDown(e)
- {
- gKeyDownEventCount++;
- }
-
- function onKeyPress(e)
- {
- gKeyPressEventCount++;
- e.preventDefault();
- }
-
- function* testBody()
- {
- window.addEventListener("keydown", onKeyDown, false);
- window.addEventListener("keypress", onKeyPress, false);
-
- // Test ctrl-tab
- gKeyDownEventCount = 0;
- gKeyPressEventCount = 0;
- yield synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_Tab, {ctrlKey:1}, "\t", "\t", continueTest);
- is(gKeyDownEventCount, 1);
- is(gKeyPressEventCount, 0, "ctrl-tab should be consumed by tabbox of tabbrowser at keydown");
-
- // Test cmd+shift+a
- gKeyDownEventCount = 0;
- gKeyPressEventCount = 0;
- yield synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_A, {metaKey:1, shiftKey:1}, "a", "A", continueTest);
- is(gKeyDownEventCount, 1);
- is(gKeyPressEventCount, 1);
-
- // Test cmd-;
- gKeyDownEventCount = 0;
- gKeyPressEventCount = 0;
- yield synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_Semicolon, {metaKey:1}, ";", ";", continueTest);
- is(gKeyDownEventCount, 1);
- is(gKeyPressEventCount, 1);
-
- window.removeEventListener("keydown", onKeyDown, false);
- window.removeEventListener("keypress", onKeyPress, false);
- }
-
- var gTestContinuation = null;
-
- function continueTest()
- {
- if (!gTestContinuation) {
- gTestContinuation = testBody();
- }
- var ret = gTestContinuation.next();
- if (ret.done) {
- SimpleTest.finish();
- } else {
- is(ret.value, true, "Key synthesized successfully");
- }
- }
-
- function runTest()
- {
- SimpleTest.waitForExplicitFinish();
- continueTest();
- }
- ]]></script>
-
-</window>
diff --git a/widget/tests/test_keycodes.xul b/widget/tests/test_keycodes.xul
deleted file mode 100644
index 3ec460ecb..000000000
--- a/widget/tests/test_keycodes.xul
+++ /dev/null
@@ -1,4361 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Key event tests"
- onload="runTest()"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/NativeKeyCodes.js" />
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
-
-<commandset>
- <command id="expectedCommand" oncommand="this.activeCount++" disabled="true"/>
- <command id="unexpectedCommand" oncommand="this.activeCount++" disabled="true"/>
- <command id="expectedReservedCommand" oncommand="this.activeCount++" reserved="true" disabled="true"/>
-</commandset>
-<keyset>
- <key id="unshiftedKey" key=";" modifiers="accel" command="unexpectedCommand"/>
- <key id="shiftedKey" key=":" modifiers="accel" command="unexpectedCommand"/>
- <key id="commandOptionF" key='f' modifiers="accel,alt" command="unexpectedCommand"/>
- <key id="question" key='?' modifiers="accel" command="unexpectedCommand"/>
- <key id="unshiftedX" key="x" modifiers="accel" command="unexpectedCommand"/>
- <key id="shiftedX" key="X" modifiers="accel,shift" command="unexpectedCommand"/>
- <key id="unshiftedPlus" key="+" modifiers="accel" command="unexpectedCommand"/>
- <key id="reservedUnshiftedKey" key="'" modifiers="accel" command="unexpectedCommand"/>
- <key id="reservedShiftedKey" key='"' modifiers="accel" command="unexpectedCommand"/>
-</keyset>
-
-<browser id="browser" type="content" src="data:text/html;charset=utf-8,&lt;button id='content_button'&gt;button&lt;/button&gt;" width="200" height="32"/>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
- <!-- for some reason, if we don't have 'accesskey' here, adding it dynamically later
- doesn't work! -->
- <button id="button" accesskey="z">Hello</button>
- <input type="text" id="textbox" value=""/>
-</p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-const IS_MAC = navigator.platform.indexOf("Mac") == 0;
-const IS_WIN = navigator.platform.indexOf("Win") == 0;
-const OS_VERSION =
- IS_WIN ? parseFloat(Components.classes["@mozilla.org/system-info;1"]
- .getService(Components.interfaces.nsIPropertyBag2)
- .getProperty("version")) : 0;
-const WIN7 = 6.1;
-const WIN8 = 6.2;
-
-function isModifierKeyEvent(aEvent)
-{
- switch (aEvent.key) {
- case "Alt":
- case "AltGraph":
- case "CapsLock":
- case "Control":
- case "Fn":
- case "FnLock":
- case "Hyper":
- case "Meta":
- case "NumLock":
- case "ScrollLock":
- case "Shift":
- case "Super":
- case "Symbol":
- case "SymbolLock":
- return true;
- default:
- return false;
- }
-}
-
-/**
- * Firefox infobar UI can have access keys which conflict with this test. Really
- * stupid workaround until we can move this test into its own chrome window.
- */
-function clearInfobars()
-{
- var Ci = Components.interfaces;
-
- var browser = window.top.QueryInterface(Ci.nsIInterfaceRequestor)
- .getInterface(Ci.nsIWebNavigation)
- .QueryInterface(Ci.nsIDocShell).chromeEventHandler;
- var chromeWin = browser.ownerDocument.defaultView;
- var nb = chromeWin.gBrowser.getNotificationBox(browser);
- for (let n of nb.allNotifications) {
- nb.removeNotification(n, true);
- }
-}
-
-function eventToString(aEvent)
-{
- var name = aEvent.layout.name + " keyCode=" +
- aEvent.keyCode + " (0x" + aEvent.keyCode.toString(16).toUpperCase() +
- ") chars='" + aEvent.chars + "'";
- if (typeof aEvent.unmodifiedChars === "string") {
- name += " unmodifiedChars='" + aEvent.unmodifiedChars + "'";
- }
- if (aEvent.modifiers.shiftKey) {
- name += " [Shift]";
- }
- if (aEvent.modifiers.shiftRightKey) {
- name += " [Right Shift]";
- }
- if (aEvent.modifiers.ctrlKey) {
- name += " [Ctrl]";
- }
- if (aEvent.modifiers.ctrlRightKey) {
- name += " [Right Ctrl]";
- }
- if (aEvent.modifiers.altKey) {
- name += " [Alt]";
- }
- if (aEvent.modifiers.altRightKey) {
- name += " [Right Alt]";
- }
- if (aEvent.modifiers.metaKey) {
- name += " [Command]";
- }
- if (aEvent.modifiers.metaRightKey) {
- name += " [Right Command]";
- }
-
- return name;
-}
-
-function getPhase(aDOMEvent)
-{
- switch (aDOMEvent.eventPhase) {
- case aDOMEvent.None:
- return "none";
- case aDOMEvent.CAPTURING_PHASE:
- return "capture";
- case aDOMEvent.AT_TARGET:
- return "target";
- case aDOMEvent.BUBBLING_PHASE:
- return "bubble";
- default:
- return "";
- }
-}
-
-function eventTargetToString(aEventTarget)
-{
- if (aEventTarget.navigator) {
- return "window";
- }
- switch (aEventTarget.nodeType) {
- case Node.ELEMENT_NODE:
- return "element (" + aEventTarget.tagName + ")";
- case Node.DOCUMENT_NODE:
- return "document";
- default:
- return "";
- }
-}
-
-function synthesizeKey(aEvent, aFocusElementId, aCallback)
-{
- if (aFocusElementId.startsWith("content_")) {
- var browser = document.getElementById("browser");
- browser.contentDocument.getElementById(aFocusElementId).focus();
- } else {
- document.getElementById(aFocusElementId).focus();
- }
-
- return synthesizeNativeKey(aEvent.layout, aEvent.keyCode,
- aEvent.modifiers,
- aEvent.chars, aEvent.unmodifiedChars,
- aCallback);
-}
-
-// Test the charcodes and modifiers being delivered to keypress handlers and
-// also keydown/keyup events too.
-function* runKeyEventTests()
-{
- const nsIDOMKeyEvent = Components.interfaces.nsIDOMKeyEvent;
- var eventList, keyDownFlags, keyUpFlags, testingEvent, expectedDOMKeyCode;
- const kShiftFlag = 0x1;
- const kCtrlFlag = 0x2;
- const kAltFlag = 0x4;
- const kMetaFlag = 0x8;
- const kNumLockFlag = 0x10;
- const kCapsLockFlag = 0x20;
-
- function onKeyEvent(e)
- {
- function removeFlag(e, aFlag)
- {
- if (e.type == "keydown") {
- var oldValue = keyDownFlags;
- keyDownFlags &= ~aFlag;
- return oldValue != keyDownFlags;
- } else if (e.type == "keyup") {
- var oldValue = keyUpFlags;
- keyUpFlags &= ~aFlag;
- return oldValue != keyUpFlags;
- }
- return false;
- }
-
- function isStateChangingModifierKeyEvent(e)
- {
- var flags = 0;
- if (e.type == "keydown") {
- flags = keyDownFlags ^ keyUpFlags;
- } else if (e.type == "keyup") {
- flags = keyUpFlags;
- }
- switch (e.keyCode) {
- case e.DOM_VK_SHIFT:
- is(e.ctrlKey, (flags & kCtrlFlag) != 0, name + ", Ctrl of Shift " + e.type + " event mismatch");
- is(e.metaKey, (flags & kMetaFlag) != 0, name + ", Command of Shift " + e.type + " event mismatch");
- is(e.altKey, (flags & kAltFlag) != 0, name + ", Alt of Shift " + e.type + " event mismatch");
- is(e.shiftKey, e.type == "keydown", name + ", Shift of Shift " + e.type + " event mismatch");
- return (testingEvent.modifiers.shiftKey || testingEvent.modifiers.shiftRightKey) &&
- removeFlag(e, kShiftFlag) && expectedDOMKeyCode != e.keyCode;
- case e.DOM_VK_CONTROL:
- is(e.ctrlKey, e.type == "keydown", name + ", Ctrl of Ctrl " + e.type + " event mismatch");
- is(e.metaKey, (flags & kMetaFlag) != 0, name + ", Command of Ctrl " + e.type + " event mismatch");
- is(e.altKey, (flags & kAltFlag) != 0, name + ", Alt of Ctrl " + e.type + " event mismatch");
- is(e.shiftKey, (flags & kShiftFlag) != 0, name + ", Shift of Ctrl " + e.type + " event mismatch");
- return (testingEvent.modifiers.ctrlKey || testingEvent.modifiers.ctrlRightKey || (IS_WIN && testingEvent.modifiers.altGrKey)) &&
- removeFlag(e, kCtrlFlag) && expectedDOMKeyCode != e.keyCode;
- case e.DOM_VK_ALT:
- is(e.ctrlKey, (flags & kCtrlFlag) != 0, name + ", Ctrl of Alt " + e.type + " event mismatch");
- is(e.metaKey, (flags & kMetaFlag) != 0, name + ", Command of Alt " + e.type + " event mismatch");
- is(e.altKey, e.type == "keydown", name + ", Alt of Alt " + e.type + " event mismatch");
- is(e.shiftKey, (flags & kShiftFlag) != 0, name + ", Shift of Alt " + e.type + " event mismatch");
- return (testingEvent.modifiers.altKey || testingEvent.modifiers.altRightKey || (IS_WIN && testingEvent.modifiers.altGrKey)) &&
- removeFlag(e, kAltFlag) && expectedDOMKeyCode != e.keyCode;
- case e.DOM_VK_META:
- is(e.ctrlKey, (flags & kCtrlFlag) != 0, name + ", Ctrl of Command " + e.type + " evnet mismatch");
- is(e.metaKey, e.type == "keydown", name + ", Command of Command " + e.type + " evnet mismatch");
- is(e.altKey, (flags & kAltFlag) != 0, name + ", Alt of Command " + e.type + " evnet mismatch");
- is(e.shiftKey, (flags & kShiftFlag) != 0, name + ", Shift of Command " + e.type + " evnet mismatch");
- return (testingEvent.modifiers.metaKey || testingEvent.modifiers.metaRightKey) &&
- removeFlag(e, kMetaFlag) && expectedDOMKeyCode != e.keyCode;
- case e.DOM_VK_NUM_LOCK:
- is(e.ctrlKey, (flags & kCtrlFlag) != 0, name + ", Ctrl of NumLock " + e.type + " event mismatch");
- is(e.metaKey, (flags & kMetaFlag) != 0, name + ", Command of NumLock " + e.type + " event mismatch");
- is(e.altKey, (flags & kAltFlag) != 0, name + ", Alt of NumLock " + e.type + " event mismatch");
- is(e.shiftKey, (flags & kShiftFlag) != 0, name + ", Shift of NumLock " + e.type + " event mismatch");
- return (testingEvent.modifiers.numLockKey || testingEvent.modifiers.numericKeyPadKey) &&
- removeFlag(e, kNumLockFlag) && expectedDOMKeyCode != e.keyCode;
- case e.DOM_VK_CAPS_LOCK:
- is(e.ctrlKey, (flags & kCtrlFlag) != 0, name + ", Ctrl of CapsLock " + e.type + " event mismatch");
- is(e.metaKey, (flags & kMetaFlag) != 0, name + ", Command of CapsLock " + e.type + " event mismatch");
- is(e.altKey, (flags & kAltFlag) != 0, name + ", Alt of CapsLock " + e.type + " event mismatch");
- is(e.shiftKey, (flags & kShiftFlag) != 0, name + ", Shift of CapsLock " + e.type + " event mismatch");
- return testingEvent.modifiers.capsLockKey &&
- removeFlag(e, kCapsLockFlag) && expectedDOMKeyCode != e.keyCode;
- }
- return false;
- }
-
- // Ignore the state changing key events which is fired by the testing event.
- if (!isStateChangingModifierKeyEvent(e))
- eventList.push(e);
- }
-
- function consumer(aEvent)
- {
- aEvent.preventDefault();
- }
-
- const SHOULD_DELIVER_NONE = 0x0;
- const SHOULD_DELIVER_KEYDOWN = 0x1;
- const SHOULD_DELIVER_KEYPRESS = 0x2;
- const SHOULD_DELIVER_KEYUP = 0x4;
- const SHOULD_DELIVER_ALL = SHOULD_DELIVER_KEYDOWN |
- SHOULD_DELIVER_KEYPRESS |
- SHOULD_DELIVER_KEYUP;
- const SHOULD_DELIVER_KEYDOWN_KEYUP = SHOULD_DELIVER_KEYDOWN |
- SHOULD_DELIVER_KEYUP;
- const SHOULD_DELIVER_KEYDOWN_KEYPRESS = SHOULD_DELIVER_KEYDOWN |
- SHOULD_DELIVER_KEYPRESS;
-
- // The first parameter is the complete input event. The second parameter is
- // what to test against. The third parameter is which key events should be
- // delived for the event.
- // @param aExpectedKeyValues Can be string or array of string.
- // If all keyboard events have same key value,
- // specify it as string. Otherwise, specify
- // each key value in array.
- function testKey(aEvent, aExpectedKeyValues, aExpectedCodeValue,
- aExpectedGeckoKeyCode, aExpectGeckoChar,
- aShouldDelivedEvent, aExpectLocation)
- {
- ok(aExpectedGeckoKeyCode != undefined, "keycode is undefined");
- eventList = [];
-
- // The modifier key events which are fired for state changing are har to
- // test. We should ignore them for now.
- keyDownFlags = keyUpFlags = 0;
- if (!IS_MAC) {
- // On Mac, nsChildView doesn't generate modifier keydown/keyup events for
- // state changing for synthesizeNativeKeyEvent.
- if (aEvent.modifiers.shiftKey || aEvent.modifiers.shiftRightKey) {
- keyDownFlags |= kShiftFlag;
- }
- if (aEvent.modifiers.ctrlKey || aEvent.modifiers.ctrlRightKey ||
- (IS_WIN && aEvent.modifiers.altGrKey)) {
- keyDownFlags |= kCtrlFlag;
- }
- if (aEvent.modifiers.altKey || aEvent.modifiers.altRightKey ||
- (IS_WIN && aEvent.modifiers.altGrKey)) {
- keyDownFlags |= kAltFlag;
- }
- if (aEvent.modifiers.metaKey || aEvent.modifiers.metaRightKey) {
- keyDownFlags |= kMetaFlag;
- }
- if (aEvent.modifiers.numLockKey || aEvent.modifiers.numericKeyPadKey) {
- keyDownFlags |= kNumLockFlag;
- }
- if (aEvent.modifiers.capsLockKey) {
- keyDownFlags |= kCapsLockFlag;
- }
- keyUpFlags = keyDownFlags;
- }
-
- testingEvent = aEvent;
- expectedDOMKeyCode = aExpectedGeckoKeyCode;
-
- var name = eventToString(aEvent);
- ok(true, "Starting: " + name);
-
- return synthesizeKey(aEvent, "button", function() {
-
- var expectEventTypeList = [];
- if (aShouldDelivedEvent & SHOULD_DELIVER_KEYDOWN)
- expectEventTypeList.push("keydown");
- if (aShouldDelivedEvent & SHOULD_DELIVER_KEYPRESS) {
- expectEventTypeList.push("keypress");
- for (var i = 1; i < aExpectGeckoChar.length; i++) {
- expectEventTypeList.push("keypress");
- }
- }
- if (aShouldDelivedEvent & SHOULD_DELIVER_KEYUP)
- expectEventTypeList.push("keyup");
- is(eventList.length, expectEventTypeList.length, name + ", wrong number of key events");
-
- var longerLength = Math.max(eventList.length, expectEventTypeList.length);
- var keypressCount = 0;
- for (var i = 0; i < longerLength; i++) {
- var firedEventType = i < eventList.length ? eventList[i].type : "";
- var expectEventType = i < expectEventTypeList.length ? expectEventTypeList[i] : "";
- if (firedEventType != "")
- is(firedEventType, expectEventType, name + ", " + expectEventType + " should be fired");
- else
- is(firedEventType, expectEventType, name + ", a needed event is not fired");
-
- if (firedEventType != "") {
- var e = eventList[i];
- if (e.type == "keypress") {
- var isCtrlExpected =
- !!(aEvent.modifiers.ctrlKey || aEvent.modifiers.ctrlRightKey) && !aEvent.isInputtingCharacters;
- var isAltExpected =
- !!(aEvent.modifiers.altKey || aEvent.modifiers.altRightKey) && !aEvent.isInputtingCharacters;
- if (IS_WIN && (aEvent.modifiers.altGrKey || isCtrlExpected && isAltExpected)) {
- isCtrlExpected = isAltExpected = (aEvent.chars == "");
- }
- is(e.ctrlKey, isCtrlExpected, name + ", Ctrl mismatch");
- is(e.metaKey, !!(aEvent.modifiers.metaKey || aEvent.modifiers.metaRightKey), name + ", Command mismatch");
- is(e.altKey, isAltExpected, name + ", Alt mismatch");
- is(e.shiftKey, !!(aEvent.modifiers.shiftKey || aEvent.modifiers.shiftRightKey), name + ", Shift mismatch");
- }
-
- var expectedKeyValue =
- typeof aExpectedKeyValues === "string" ? aExpectedKeyValues :
- i < aExpectedKeyValues.length ? aExpectedKeyValues[i] :
- undefined;
- is(e.key, expectedKeyValue, name + ", wrong key value");
- is(e.code, aExpectedCodeValue, name + ", wrong code value");
-
- if (aExpectGeckoChar.length > 0 && e.type == "keypress") {
- is(e.charCode, aExpectGeckoChar.charCodeAt(keypressCount++), name + ", charcode");
- if (aExpectedGeckoKeyCode >= 0) {
- if (aExpectGeckoChar) {
- is(e.keyCode, 0, name + ", wrong keycode");
- } else {
- is(e.keyCode, aExpectedGeckoKeyCode, name + ", wrong keycode");
- }
- }
- } else {
- is(e.charCode, 0, name + ", no charcode");
- if (aExpectedGeckoKeyCode >= 0) {
- is(e.keyCode, aExpectedGeckoKeyCode, name + ", wrong keycode");
- }
- }
- is(e.location, aExpectLocation, name + ", wrong location");
- }
- }
-
- continueTest();
- });
- }
-
- // These tests have to be per-plaform.
- document.addEventListener("keydown", onKeyEvent, false);
- document.addEventListener("keypress", onKeyEvent, false);
- document.addEventListener("keyup", onKeyEvent, false);
- // Prevent almost all shortcut key handlers.
- SpecialPowers.addSystemEventListener(document, "keypress", consumer, true);
-
- function cleanup()
- {
- document.removeEventListener("keydown", onKeyEvent, false);
- document.removeEventListener("keypress", onKeyEvent, false);
- document.removeEventListener("keyup", onKeyEvent, false);
- SpecialPowers.removeSystemEventListener(document, "keypress", consumer, true);
- }
-
- function testKeysOnMac()
- {
- // On Mac, you can produce event records for any desired keyboard input
- // by running with NSPR_LOG_MODULES=TextInputHandlerWidgets:5 and typing
- // into the browser. We will dump the key event fields to the console
- // (Find TextInputHandler::HandleKeyDownEvent or
- // TextInputHandler::HandleKeyUpEvent in the log). Use the International system
- // preferences widget to enable other keyboard layouts and select them from the
- // input menu to see what keyboard events they generate.
- // Note that it's possible to send bogus key events here, e.g.
- // {keyCode:0, chars:"z", unmodifiedChars:"P"} --- sendNativeKeyEvent
- // makes no attempt to verify that the keyCode matches the characters. So only
- // test key event records that you saw Cocoa send.
-
- // Ctrl keys
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"},
- "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"A"},
- "A", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Alt keys
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{altKey:1}, chars:"\u00e5", unmodifiedChars:"a"},
- "\u00e5", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00e5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{altKey:1, shiftKey:1}, chars:"\u00c5", unmodifiedChars:"A"},
- "\u00c5", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00c5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Command keys
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"a"},
- "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // Shift-cmd gives us the shifted character
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{metaKey:1, shiftKey:1}, chars:"a", unmodifiedChars:"A"},
- "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // Ctrl-cmd gives us the unshifted character
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{metaKey:1, ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"},
- "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // Alt-cmd gives us the shifted character
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{metaKey:1, altKey:1}, chars:"\u00e5", unmodifiedChars:"a"},
- "\u00e5", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00e5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u00c5", unmodifiedChars:"a"},
- "\u00c5", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00c5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Greek ctrl keys produce Latin charcodes
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"},
- "\u03b1", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"\u0391"},
- "\u0391", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Greek command keys
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
- modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"\u03b1"},
- "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // Shift-cmd gives us the shifted character
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
- modifiers:{metaKey:1, shiftKey:1}, chars:"a", unmodifiedChars:"\u0391"},
- "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Ctrl-cmd gives us the unshifted character
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
- modifiers:{metaKey:1, ctrlKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"},
- "\u03b1", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // Alt-cmd gives us the shifted character
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
- modifiers:{metaKey:1, altKey:1}, chars:"\u00a8", unmodifiedChars:"\u03b1"},
- "\u00a8", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00a8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
- modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u00b9", unmodifiedChars:"\u0391"},
- "\u00b9", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00b9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // German
- yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_A,
- modifiers: {}, chars:"a", unmodifiedChars:"a"},
- "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_LeftBracket,
- modifiers: {}, chars:"\u00fc", unmodifiedChars:"\u00fc"},
- "\u00fc", "BracketLeft", 0, "\u00fc", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus,
- modifiers: {}, chars:"\u00df", unmodifiedChars:"\u00df"},
- "\u00df", "Minus", nsIDOMKeyEvent.DOM_VK_QUESTION_MARK, "\u00df", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus,
- modifiers:{shiftKey:1}, chars:"?", unmodifiedChars:"?"},
- "?", "Minus", nsIDOMKeyEvent.DOM_VK_QUESTION_MARK, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // Note that Shift+SS is '?' but Cmd+Shift+SS is '/' on German layout.
- // Therefore, when Cmd key is pressed, the SS key's keycode is changed.
- yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus,
- modifiers:{metaKey:1}, chars:"\u00df", unmodifiedChars:"\u00df"},
- "\u00df", "Minus", nsIDOMKeyEvent.DOM_VK_SLASH, "\u00df", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_Minus,
- modifiers:{metaKey:1, shiftKey:1}, chars:"/", unmodifiedChars:"?"},
- "/", "Minus", nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Caps Lock key event
- // XXX keyup event of Caps Lock key is not fired.
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_CapsLock,
- modifiers:{capsLockKey:1}, chars:"", unmodifiedChars:""},
- "CapsLock", "CapsLock", nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_CapsLock,
- modifiers:{capsLockKey:0}, chars:"", unmodifiedChars:""},
- "CapsLock", "CapsLock", nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Shift/RightShift key event
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Shift,
- modifiers:{shiftKey:1}, chars:"", unmodifiedChars:""},
- "Shift", "ShiftLeft", nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Shift,
- modifiers:{shiftKey:0}, chars:"", unmodifiedChars:""},
- "Shift", "ShiftLeft", nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightShift,
- modifiers:{shiftRightKey:1}, chars:"", unmodifiedChars:""},
- "Shift", "ShiftRight", nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightShift,
- modifiers:{shiftRightKey:0}, chars:"", unmodifiedChars:""},
- "Shift", "ShiftRight", nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
-
- // Control/RightControl key event
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Control,
- modifiers:{ctrlKey:1}, chars:"", unmodifiedChars:""},
- "Control", "ControlLeft", nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Control,
- modifiers:{ctrlKey:0}, chars:"", unmodifiedChars:""},
- "Control", "ControlLeft", nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightControl,
- modifiers:{ctrlRightKey:1}, chars:"", unmodifiedChars:""},
- "Control", "ControlRight", nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightControl,
- modifiers:{ctrlRightKey:0}, chars:"", unmodifiedChars:""},
- "Control", "ControlRight", nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
-
- // Option/RightOption key event
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Option,
- modifiers:{altKey:1}, chars:"", unmodifiedChars:""},
- "Alt", "AltLeft", nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Option,
- modifiers:{altKey:0}, chars:"", unmodifiedChars:""},
- "Alt", "AltLeft", nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightOption,
- modifiers:{altRightKey:1}, chars:"", unmodifiedChars:""},
- "Alt", "AltRight", nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightOption,
- modifiers:{altRightKey:0}, chars:"", unmodifiedChars:""},
- "Alt", "AltRight", nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
-
- // Command/RightCommand key event
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Command,
- modifiers:{metaKey:1}, chars:"", unmodifiedChars:""},
- "Meta", "OSLeft", nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Command,
- modifiers:{metaKey:0}, chars:"", unmodifiedChars:""},
- "Meta", "OSLeft", nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightCommand,
- modifiers:{metaRightKey:1}, chars:"", unmodifiedChars:""},
- "Meta", "OSRight", nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYDOWN, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightCommand,
- modifiers:{metaRightKey:0}, chars:"", unmodifiedChars:""},
- "Meta", "OSRight", nsIDOMKeyEvent.DOM_VK_META, "", SHOULD_DELIVER_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
-
- // all keys on keyboard (keyCode test)
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Tab,
- modifiers: {}, chars:"\t", unmodifiedChars:"\t"},
- "Tab", "Tab", nsIDOMKeyEvent.DOM_VK_TAB, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadClear,
- modifiers: {}, chars:"\uF739", unmodifiedChars:"\uF739"},
- "Clear", "NumLock", nsIDOMKeyEvent.DOM_VK_CLEAR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Return,
- modifiers: {}, chars:"\u000D", unmodifiedChars:"\u000D"},
- "Enter", "Enter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_Pause,
- modifiers: {}, chars:"\uF712", unmodifiedChars:"\uF712"},
- "F15", "F15", nsIDOMKeyEvent.DOM_VK_PAUSE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Escape,
- modifiers: {}, chars:"\u001B", unmodifiedChars:"\u001B"},
- "Escape", "Escape", nsIDOMKeyEvent.DOM_VK_ESCAPE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Space,
- modifiers: {}, chars:" ", unmodifiedChars:" "},
- " ", "Space", nsIDOMKeyEvent.DOM_VK_SPACE, " ", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PageUp,
- modifiers: {}, chars:"\uF72C", unmodifiedChars:"\uF72C"},
- "PageUp", "PageUp", nsIDOMKeyEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PageDown,
- modifiers: {}, chars:"\uF72D", unmodifiedChars:"\uF72D"},
- "PageDown", "PageDown", nsIDOMKeyEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_End,
- modifiers: {}, chars:"\uF72B", unmodifiedChars:"\uF72B"},
- "End", "End", nsIDOMKeyEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_Home,
- modifiers: {}, chars:"\uF729", unmodifiedChars:"\uF729"},
- "Home", "Home", nsIDOMKeyEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_LeftArrow,
- modifiers: {}, chars:"\uF702", unmodifiedChars:"\uF702"},
- "ArrowLeft", "ArrowLeft", nsIDOMKeyEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_UpArrow,
- modifiers: {}, chars:"\uF700", unmodifiedChars:"\uF700"},
- "ArrowUp", "ArrowUp", nsIDOMKeyEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_RightArrow,
- modifiers: {}, chars:"\uF703", unmodifiedChars:"\uF703"},
- "ArrowRight", "ArrowRight", nsIDOMKeyEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_DownArrow,
- modifiers: {}, chars:"\uF701", unmodifiedChars:"\uF701"},
- "ArrowDown", "ArrowDown", nsIDOMKeyEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_PrintScreen,
- modifiers: {}, chars:"\uF710", unmodifiedChars:"\uF710"},
- "F13", "F13", nsIDOMKeyEvent.DOM_VK_PRINTSCREEN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_Delete,
- modifiers: {}, chars:"\uF728", unmodifiedChars:"\uF728"},
- "Delete", "Delete", nsIDOMKeyEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_ScrollLock,
- modifiers: {}, chars:"\uF711", unmodifiedChars:"\uF711"},
- "F14", "F14", nsIDOMKeyEvent.DOM_VK_SCROLL_LOCK, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_PC_ContextMenu,
- modifiers: {}, chars:"\u0010", unmodifiedChars:"\u0010"},
- "ContextMenu", "ContextMenu", nsIDOMKeyEvent.DOM_VK_CONTEXT_MENU, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F1,
- modifiers:{fnKey:1}, chars:"\uF704", unmodifiedChars:"\uF704"},
- "F1", "F1", nsIDOMKeyEvent.DOM_VK_F1, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F2,
- modifiers:{fnKey:1}, chars:"\uF705", unmodifiedChars:"\uF705"},
- "F2", "F2", nsIDOMKeyEvent.DOM_VK_F2, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F3,
- modifiers:{fnKey:1}, chars:"\uF706", unmodifiedChars:"\uF706"},
- "F3", "F3", nsIDOMKeyEvent.DOM_VK_F3, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F4,
- modifiers:{fnKey:1}, chars:"\uF707", unmodifiedChars:"\uF707"},
- "F4", "F4", nsIDOMKeyEvent.DOM_VK_F4, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F5,
- modifiers:{fnKey:1}, chars:"\uF708", unmodifiedChars:"\uF708"},
- "F5", "F5", nsIDOMKeyEvent.DOM_VK_F5, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F6,
- modifiers:{fnKey:1}, chars:"\uF709", unmodifiedChars:"\uF709"},
- "F6", "F6", nsIDOMKeyEvent.DOM_VK_F6, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F7,
- modifiers:{fnKey:1}, chars:"\uF70A", unmodifiedChars:"\uF70A"},
- "F7", "F7", nsIDOMKeyEvent.DOM_VK_F7, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F8,
- modifiers:{fnKey:1}, chars:"\uF70B", unmodifiedChars:"\uF70B"},
- "F8", "F8", nsIDOMKeyEvent.DOM_VK_F8, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F9,
- modifiers:{fnKey:1}, chars:"\uF70C", unmodifiedChars:"\uF70C"},
- "F9", "F9", nsIDOMKeyEvent.DOM_VK_F9, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F10,
- modifiers:{fnKey:1}, chars:"\uF70D", unmodifiedChars:"\uF70D"},
- "F10", "F10", nsIDOMKeyEvent.DOM_VK_F10, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F11,
- modifiers:{fnKey:1}, chars:"\uF70E", unmodifiedChars:"\uF70E"},
- "F11", "F11", nsIDOMKeyEvent.DOM_VK_F11, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F12,
- modifiers:{fnKey:1}, chars:"\uF70F", unmodifiedChars:"\uF70F"},
- "F12", "F12", nsIDOMKeyEvent.DOM_VK_F12, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F16,
- modifiers:{fnKey:1}, chars:"\uF713", unmodifiedChars:"\uF713"},
- "F16", "F16", nsIDOMKeyEvent.DOM_VK_F16, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F17,
- modifiers:{fnKey:1}, chars:"\uF714", unmodifiedChars:"\uF714"},
- "F17", "F17", nsIDOMKeyEvent.DOM_VK_F17, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F18,
- modifiers:{fnKey:1}, chars:"\uF715", unmodifiedChars:"\uF715"},
- "F18", "F18", nsIDOMKeyEvent.DOM_VK_F18, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_F19,
- modifiers:{fnKey:1}, chars:"\uF716", unmodifiedChars:"\uF716"},
- "F19", "F19", nsIDOMKeyEvent.DOM_VK_F19, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // US
- // Alphabet
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers: {}, chars:"a", unmodifiedChars:"a"},
- "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{shiftKey:1}, chars:"A", unmodifiedChars:"A"},
- "A", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"},
- "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{altKey:1}, chars:"\u00E5", unmodifiedChars:"a"},
- "\u00E5", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00E5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{metaKey:1}, chars:"a", unmodifiedChars:"a"},
- "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
- modifiers:{}, chars:"b", unmodifiedChars:"b"},
- "b", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
- modifiers:{shiftKey:1}, chars:"B", unmodifiedChars:"B"},
- "B", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
- modifiers:{ctrlKey:1}, chars:"\u0002", unmodifiedChars:"b"},
- "b", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
- modifiers:{altKey:1}, chars:"\u222B", unmodifiedChars:"b"},
- "\u222B", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "\u222B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_B,
- modifiers:{metaKey:1}, chars:"b", unmodifiedChars:"b"},
- "b", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
- modifiers:{}, chars:"c", unmodifiedChars:"c"},
- "c", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
- modifiers:{shiftKey:1}, chars:"C", unmodifiedChars:"C"},
- "C", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
- modifiers:{ctrlKey:1}, chars:"\u0003", unmodifiedChars:"c"},
- "c", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
- modifiers:{altKey:1}, chars:"\u00E7", unmodifiedChars:"c"},
- "\u00E7", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_C,
- modifiers:{metaKey:1}, chars:"c", unmodifiedChars:"c"},
- "c", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
- modifiers:{}, chars:"d", unmodifiedChars:"d"},
- "d", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
- modifiers:{shiftKey:1}, chars:"D", unmodifiedChars:"D"},
- "D", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
- modifiers:{ctrlKey:1}, chars:"\u0004", unmodifiedChars:"d"},
- "d", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
- modifiers:{altKey:1}, chars:"\u2202", unmodifiedChars:"d"},
- "\u2202", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "\u2202", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_D,
- modifiers:{metaKey:1}, chars:"d", unmodifiedChars:"d"},
- "d", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
- modifiers:{}, chars:"e", unmodifiedChars:"e"},
- "e", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
- modifiers:{shiftKey:1}, chars:"E", unmodifiedChars:"E"},
- "E", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
- modifiers:{ctrlKey:1}, chars:"\u0005", unmodifiedChars:"e"},
- "e", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
- modifiers:{altKey:1}, chars:"", unmodifiedChars:"e"},
- "Dead", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "\u00B4", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_E,
- modifiers:{metaKey:1}, chars:"e", unmodifiedChars:"e"},
- "e", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
- modifiers:{}, chars:"f", unmodifiedChars:"f"},
- "f", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
- modifiers:{shiftKey:1}, chars:"F", unmodifiedChars:"F"},
- "F", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
- modifiers:{ctrlKey:1}, chars:"\u0006", unmodifiedChars:"f"},
- "f", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
- modifiers:{altKey:1}, chars:"\u0192", unmodifiedChars:"f"},
- "\u0192", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "\u0192", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // XXX This test starts fullscreen mode.
- // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
- // modifiers:{metaKey:1}, chars:"f", unmodifiedChars:"f"},
- // "f", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
- modifiers:{}, chars:"g", unmodifiedChars:"g"},
- "g", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
- modifiers:{shiftKey:1}, chars:"G", unmodifiedChars:"G"},
- "G", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
- modifiers:{ctrlKey:1}, chars:"\u0007", unmodifiedChars:"g"},
- "g", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
- modifiers:{altKey:1}, chars:"\u00A9", unmodifiedChars:"g"},
- "\u00A9", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "\u00A9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_G,
- modifiers:{metaKey:1}, chars:"g", unmodifiedChars:"g"},
- "g", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
- modifiers:{}, chars:"h", unmodifiedChars:"h"},
- "h", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
- modifiers:{shiftKey:1}, chars:"H", unmodifiedChars:"H"},
- "H", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
- modifiers:{ctrlKey:1}, chars:"\u0008", unmodifiedChars:"h"},
- "h", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
- modifiers:{altKey:1}, chars:"\u02D9", unmodifiedChars:"h"},
- "\u02D9", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "\u02D9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_H,
- modifiers:{metaKey:1}, chars:"h", unmodifiedChars:"h"},
- "h", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I,
- modifiers:{}, chars:"i", unmodifiedChars:"i"},
- "i", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I,
- modifiers:{shiftKey:1}, chars:"I", unmodifiedChars:"I"},
- "I", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "I", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I,
- modifiers:{ctrlKey:1}, chars:"\u0009", unmodifiedChars:"i"},
- "i", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I,
- modifiers:{altKey:1}, chars:"", unmodifiedChars:"i"},
- "Dead", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "\u02C6", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key
- // XXX This test causes memory leak.
- // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_I,
- // modifiers:{metaKey:1}, chars:"i", unmodifiedChars:"i"},
- // "i", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J,
- modifiers:{}, chars:"j", unmodifiedChars:"j"},
- "j", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J,
- modifiers:{shiftKey:1}, chars:"J", unmodifiedChars:"J"},
- "J", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "J", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J,
- modifiers:{ctrlKey:1}, chars:"\u000A", unmodifiedChars:"j"},
- "j", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J,
- modifiers:{altKey:1}, chars:"\u2206", unmodifiedChars:"j"},
- "\u2206", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "\u2206", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_J,
- modifiers:{metaKey:1}, chars:"j", unmodifiedChars:"j"},
- "j", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K,
- modifiers:{}, chars:"k", unmodifiedChars:"k"},
- "k", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K,
- modifiers:{shiftKey:1}, chars:"K", unmodifiedChars:"K"},
- "K", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "K", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K,
- modifiers:{ctrlKey:1}, chars:"\u000B", unmodifiedChars:"k"},
- "k", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K,
- modifiers:{altKey:1}, chars:"\u02DA", unmodifiedChars:"k"},
- "\u02DA", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "\u02DA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_K,
- modifiers:{metaKey:1}, chars:"k", unmodifiedChars:"k"},
- "k", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L,
- modifiers:{}, chars:"l", unmodifiedChars:"l"},
- "l", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L,
- modifiers:{shiftKey:1}, chars:"L", unmodifiedChars:"L"},
- "L", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "L", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L,
- modifiers:{ctrlKey:1}, chars:"\u000C", unmodifiedChars:"l"},
- "l", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L,
- modifiers:{altKey:1}, chars:"\u00AC", unmodifiedChars:"l"},
- "\u00AC", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "\u00AC", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_L,
- modifiers:{metaKey:1}, chars:"l", unmodifiedChars:"l"},
- "l", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M,
- modifiers:{}, chars:"m", unmodifiedChars:"m"},
- "m", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M,
- modifiers:{shiftKey:1}, chars:"M", unmodifiedChars:"M"},
- "M", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "M", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M,
- modifiers:{ctrlKey:1}, chars:"\u000D", unmodifiedChars:"m"},
- "m", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M,
- modifiers:{altKey:1}, chars:"\u00B5", unmodifiedChars:"m"},
- "\u00B5", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_M,
- modifiers:{metaKey:1}, chars:"m", unmodifiedChars:"m"},
- "m", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N,
- modifiers:{}, chars:"n", unmodifiedChars:"n"},
- "n", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N,
- modifiers:{shiftKey:1}, chars:"N", unmodifiedChars:"N"},
- "N", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "N", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N,
- modifiers:{ctrlKey:1}, chars:"\u000E", unmodifiedChars:"n"},
- "n", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N,
- modifiers:{altKey:1}, chars:"", unmodifiedChars:"n"},
- "Dead", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "\u02DC", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_N,
- modifiers:{metaKey:1}, chars:"n", unmodifiedChars:"n"},
- "n", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O,
- modifiers:{}, chars:"o", unmodifiedChars:"o"},
- "o", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O,
- modifiers:{shiftKey:1}, chars:"O", unmodifiedChars:"O"},
- "O", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O,
- modifiers:{ctrlKey:1}, chars:"\u000F", unmodifiedChars:"o"},
- "o", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O,
- modifiers:{altKey:1}, chars:"\u00F8", unmodifiedChars:"o"},
- "\u00F8", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "\u00F8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_O,
- modifiers:{metaKey:1}, chars:"o", unmodifiedChars:"o"},
- "o", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P,
- modifiers:{}, chars:"p", unmodifiedChars:"p"},
- "p", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P,
- modifiers:{shiftKey:1}, chars:"P", unmodifiedChars:"P"},
- "P", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "P", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P,
- modifiers:{ctrlKey:1}, chars:"\u0010", unmodifiedChars:"p"},
- "p", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P,
- modifiers:{altKey:1}, chars:"\u03C0", unmodifiedChars:"p"},
- "\u03C0", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "\u03C0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // XXX This test starts private browsing mode (stopped at the confirmation dialog)
- // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_P,
- // modifiers:{metaKey:1}, chars:"p", unmodifiedChars:"p"},
- // "p", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q,
- modifiers:{}, chars:"q", unmodifiedChars:"q"},
- "q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q,
- modifiers:{shiftKey:1}, chars:"Q", unmodifiedChars:"Q"},
- "Q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q,
- modifiers:{ctrlKey:1}, chars:"\u0011", unmodifiedChars:"q"},
- "q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q,
- modifiers:{altKey:1}, chars:"\u0153", unmodifiedChars:"q"},
- "\u0153", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "\u0153", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Q,
- modifiers:{metaKey:1}, chars:"q", unmodifiedChars:"q"},
- "q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R,
- modifiers:{}, chars:"r", unmodifiedChars:"r"},
- "r", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R,
- modifiers:{shiftKey:1}, chars:"R", unmodifiedChars:"R"},
- "R", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "R", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R,
- modifiers:{ctrlKey:1}, chars:"\u0012", unmodifiedChars:"r"},
- "r", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R,
- modifiers:{altKey:1}, chars:"\u00AE", unmodifiedChars:"r"},
- "\u00AE", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "\u00AE", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // XXX This test makes some tabs and dialogs.
- // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_R,
- // modifiers:{metaKey:1}, chars:"r", unmodifiedChars:"r"},
- // "r", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S,
- modifiers:{}, chars:"s", unmodifiedChars:"s"},
- "s", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S,
- modifiers:{shiftKey:1}, chars:"S", unmodifiedChars:"S"},
- "S", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "S", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S,
- modifiers:{ctrlKey:1}, chars:"\u0013", unmodifiedChars:"s"},
- "s", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S,
- modifiers:{altKey:1}, chars:"\u00DF", unmodifiedChars:"s"},
- "\u00DF", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "\u00DF", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_S,
- modifiers:{metaKey:1}, chars:"s", unmodifiedChars:"s"},
- "s", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T,
- modifiers:{}, chars:"t", unmodifiedChars:"t"},
- "t", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T,
- modifiers:{shiftKey:1}, chars:"T", unmodifiedChars:"T"},
- "T", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "T", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T,
- modifiers:{ctrlKey:1}, chars:"\u0014", unmodifiedChars:"t"},
- "t", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T,
- modifiers:{altKey:1}, chars:"\u2020", unmodifiedChars:"t"},
- "\u2020", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "\u2020", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T,
- modifiers:{metaKey:1}, chars:"t", unmodifiedChars:"t"},
- "t", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U,
- modifiers:{}, chars:"u", unmodifiedChars:"u"},
- "u", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U,
- modifiers:{shiftKey:1}, chars:"U", unmodifiedChars:"U"},
- "U", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "U", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U,
- modifiers:{ctrlKey:1}, chars:"\u0015", unmodifiedChars:"u"},
- "u", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U,
- modifiers:{altKey:1}, chars:"", unmodifiedChars:"u"},
- "Dead", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "\u00A8", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_U,
- modifiers:{metaKey:1}, chars:"u", unmodifiedChars:"u"},
- "u", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V,
- modifiers:{}, chars:"v", unmodifiedChars:"v"},
- "v", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V,
- modifiers:{shiftKey:1}, chars:"V", unmodifiedChars:"V"},
- "V", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "V", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V,
- modifiers:{ctrlKey:1}, chars:"\u0016", unmodifiedChars:"v"},
- "v", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V,
- modifiers:{altKey:1}, chars:"\u221A", unmodifiedChars:"v"},
- "\u221A", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "\u221A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_V,
- modifiers:{metaKey:1}, chars:"v", unmodifiedChars:"v"},
- "v", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W,
- modifiers:{}, chars:"w", unmodifiedChars:"w"},
- "w", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W,
- modifiers:{shiftKey:1}, chars:"W", unmodifiedChars:"W"},
- "W", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "W", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W,
- modifiers:{ctrlKey:1}, chars:"\u0017", unmodifiedChars:"w"},
- "w", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W,
- modifiers:{altKey:1}, chars:"\u2211", unmodifiedChars:"w"},
- "\u2211", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "\u2211", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_W,
- modifiers:{metaKey:1}, chars:"w", unmodifiedChars:"w"},
- "w", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X,
- modifiers:{}, chars:"x", unmodifiedChars:"x"},
- "x", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X,
- modifiers:{shiftKey:1}, chars:"X", unmodifiedChars:"X"},
- "X", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "X", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X,
- modifiers:{ctrlKey:1}, chars:"\u0018", unmodifiedChars:"x"},
- "x", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X,
- modifiers:{altKey:1}, chars:"\u2248", unmodifiedChars:"x"},
- "\u2248", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "\u2248", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_X,
- modifiers:{metaKey:1}, chars:"x", unmodifiedChars:"x"},
- "x", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y,
- modifiers:{}, chars:"y", unmodifiedChars:"y"},
- "y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y,
- modifiers:{shiftKey:1}, chars:"Y", unmodifiedChars:"Y"},
- "Y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "Y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y,
- modifiers:{ctrlKey:1}, chars:"\u0019", unmodifiedChars:"y"},
- "y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y,
- modifiers:{altKey:1}, chars:"\u00A5", unmodifiedChars:"y"},
- "\u00A5", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "\u00A5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Y,
- modifiers:{metaKey:1}, chars:"y", unmodifiedChars:"y"},
- "y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z,
- modifiers:{}, chars:"z", unmodifiedChars:"z"},
- "z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z,
- modifiers:{shiftKey:1}, chars:"Z", unmodifiedChars:"Z"},
- "Z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "Z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z,
- modifiers:{ctrlKey:1}, chars:"\u001A", unmodifiedChars:"z"},
- "z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z,
- modifiers:{altKey:1}, chars:"\u03A9", unmodifiedChars:"z"},
- "\u03A9", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "\u03A9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Z,
- modifiers:{metaKey:1}, chars:"z", unmodifiedChars:"z"},
- "z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // numeric
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1,
- modifiers:{}, chars:"1", unmodifiedChars:"1"},
- "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1,
- modifiers:{shiftKey:1}, chars:"!", unmodifiedChars:"!"},
- "!", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1,
- modifiers:{ctrlKey:1}, chars:"1", unmodifiedChars:"1"},
- "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1,
- modifiers:{altKey:1}, chars:"\u00A1", unmodifiedChars:"1"},
- "\u00A1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "\u00A1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_1,
- modifiers:{metaKey:1}, chars:"1", unmodifiedChars:"1"},
- "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2,
- modifiers:{}, chars:"2", unmodifiedChars:"2"},
- "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2,
- modifiers:{shiftKey:1}, chars:"@", unmodifiedChars:"@"},
- "@", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2,
- modifiers:{ctrlKey:1}, chars:"2", unmodifiedChars:"2"},
- "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2,
- modifiers:{altKey:1}, chars:"\u00A1", unmodifiedChars:"2"},
- "\u00A1", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u00A1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_2,
- modifiers:{metaKey:1}, chars:"2", unmodifiedChars:"2"},
- "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3,
- modifiers:{}, chars:"3", unmodifiedChars:"3"},
- "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3,
- modifiers:{shiftKey:1}, chars:"#", unmodifiedChars:"#"},
- "#", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3,
- modifiers:{ctrlKey:1}, chars:"3", unmodifiedChars:"3"},
- "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3,
- modifiers:{altKey:1}, chars:"\u00A3", unmodifiedChars:"3"},
- "\u00A3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_3,
- modifiers:{metaKey:1}, chars:"3", unmodifiedChars:"3"},
- "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4,
- modifiers:{}, chars:"4", unmodifiedChars:"4"},
- "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4,
- modifiers:{shiftKey:1}, chars:"$", unmodifiedChars:"$"},
- "$", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4,
- modifiers:{ctrlKey:1}, chars:"4", unmodifiedChars:"4"},
- "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4,
- modifiers:{altKey:1}, chars:"\u00A2", unmodifiedChars:"4"},
- "\u00A2", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "\u00A2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_4,
- modifiers:{metaKey:1}, chars:"4", unmodifiedChars:"4"},
- "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5,
- modifiers:{}, chars:"5", unmodifiedChars:"5"},
- "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5,
- modifiers:{shiftKey:1}, chars:"%", unmodifiedChars:"%"},
- "%", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5,
- modifiers:{ctrlKey:1}, chars:"5", unmodifiedChars:"5"},
- "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5,
- modifiers:{altKey:1}, chars:"\u221E", unmodifiedChars:"5"},
- "\u221E", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "\u221E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_5,
- modifiers:{metaKey:1}, chars:"5", unmodifiedChars:"5"},
- "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6,
- modifiers:{}, chars:"6", unmodifiedChars:"6"},
- "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6,
- modifiers:{shiftKey:1}, chars:"^", unmodifiedChars:"^"},
- "^", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6,
- modifiers:{ctrlKey:1}, chars:"6", unmodifiedChars:"6"},
- "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6,
- modifiers:{altKey:1}, chars:"\u00A7", unmodifiedChars:"6"},
- "\u00A7", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_6,
- modifiers:{metaKey:1}, chars:"6", unmodifiedChars:"6"},
- "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7,
- modifiers:{}, chars:"7", unmodifiedChars:"7"},
- "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7,
- modifiers:{shiftKey:1}, chars:"&", unmodifiedChars:"&"},
- "&", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7,
- modifiers:{ctrlKey:1}, chars:"7", unmodifiedChars:"7"},
- "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7,
- modifiers:{altKey:1}, chars:"\u00B6", unmodifiedChars:"7"},
- "\u00B6", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "\u00B6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_7,
- modifiers:{metaKey:1}, chars:"7", unmodifiedChars:"7"},
- "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8,
- modifiers:{}, chars:"8", unmodifiedChars:"8"},
- "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8,
- modifiers:{shiftKey:1}, chars:"*", unmodifiedChars:"*"},
- "*", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8,
- modifiers:{ctrlKey:1}, chars:"8", unmodifiedChars:"8"},
- "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8,
- modifiers:{altKey:1}, chars:"\u2022", unmodifiedChars:"8"},
- "\u2022", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "\u2022", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_8,
- modifiers:{metaKey:1}, chars:"8", unmodifiedChars:"8"},
- "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9,
- modifiers:{}, chars:"9", unmodifiedChars:"9"},
- "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9,
- modifiers:{shiftKey:1}, chars:"(", unmodifiedChars:"("},
- "(", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9,
- modifiers:{ctrlKey:1}, chars:"9", unmodifiedChars:"9"},
- "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9,
- modifiers:{altKey:1}, chars:"\u00AA", unmodifiedChars:"9"},
- "\u00AA", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "\u00AA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_9,
- modifiers:{metaKey:1}, chars:"9", unmodifiedChars:"9"},
- "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0,
- modifiers:{}, chars:"0", unmodifiedChars:"0"},
- "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0,
- modifiers:{shiftKey:1}, chars:")", unmodifiedChars:")"},
- ")", "Digit0", nsIDOMKeyEvent.DOM_VK_0, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0,
- modifiers:{ctrlKey:1}, chars:"0", unmodifiedChars:"0"},
- "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0,
- modifiers:{altKey:1}, chars:"\u00BA", unmodifiedChars:"0"},
- "\u00BA", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "\u00BA", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_0,
- modifiers:{metaKey:1}, chars:"0", unmodifiedChars:"0"},
- "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // other chracters
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave,
- modifiers:{}, chars:"`", unmodifiedChars:"`"},
- "`", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave,
- modifiers:{shiftKey:1}, chars:"~", unmodifiedChars:"~"},
- "~", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "~", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave,
- modifiers:{ctrlKey:1}, chars:"`", unmodifiedChars:"`"},
- "`", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave,
- modifiers:{altKey:1}, chars:"", unmodifiedChars:"`"},
- "Dead", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Grave,
- modifiers:{metaKey:1}, chars:"`", unmodifiedChars:"`"},
- "`", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus,
- modifiers:{}, chars:"-", unmodifiedChars:"-"},
- "-", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus,
- modifiers:{shiftKey:1}, chars:"_", unmodifiedChars:"_"},
- "_", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // TODO:
- // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus,
- // modifiers:{ctrlKey:1}, chars:"\u001F", unmodifiedChars:"-"},
- // "-", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus,
- modifiers:{altKey:1}, chars:"\u2013", unmodifiedChars:"-"},
- "\u2013", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "\u2013", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Minus,
- modifiers:{metaKey:1}, chars:"-", unmodifiedChars:"-"},
- "-", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal,
- modifiers:{}, chars:"=", unmodifiedChars:"="},
- "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal,
- modifiers:{shiftKey:1}, chars:"+", unmodifiedChars:"+"},
- "+", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal,
- modifiers:{ctrlKey:1}, chars:"=", unmodifiedChars:"="},
- "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal,
- modifiers:{altKey:1}, chars:"\u2260", unmodifiedChars:"="},
- "\u2260", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "\u2260", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Equal,
- modifiers:{metaKey:1}, chars:"=", unmodifiedChars:"="},
- "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket,
- modifiers:{}, chars:"[", unmodifiedChars:"["},
- "[", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket,
- modifiers:{shiftKey:1}, chars:"{", unmodifiedChars:"{"},
- "{", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // TODO:
- // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket,
- // modifiers:{ctrlKey:1}, chars:"\u001B", unmodifiedChars:"["},
- // "[", "LeftBracket", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket,
- modifiers:{altKey:1}, chars:"\u201C", unmodifiedChars:"["},
- "\u201C", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "\u201C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_LeftBracket,
- modifiers:{metaKey:1}, chars:"[", unmodifiedChars:"["},
- "[", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket,
- modifiers:{}, chars:"]", unmodifiedChars:"]"},
- "]", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket,
- modifiers:{shiftKey:1}, chars:"}", unmodifiedChars:"}"},
- "}", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // TODO:
- // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket,
- // modifiers:{ctrlKey:1}, chars:"\u001D", unmodifiedChars:"]"},
- // "]", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket,
- modifiers:{altKey:1}, chars:"\u2018", unmodifiedChars:"]"},
- "\u2018", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "\u2018", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_RightBracket,
- modifiers:{metaKey:1}, chars:"]", unmodifiedChars:"]"},
- "]", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash,
- modifiers:{}, chars:"\\", unmodifiedChars:"\\"},
- "\\", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash,
- modifiers:{shiftKey:1}, chars:"|", unmodifiedChars:"|"},
- "|", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // TODO:
- // yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash,
- // modifiers:{ctrlKey:1}, chars:"\u001C", unmodifiedChars:"\\"},
- // "\\", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash,
- modifiers:{altKey:1}, chars:"\u00AB", unmodifiedChars:"\\"},
- "\u00AB", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\u00AB", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Backslash,
- modifiers:{metaKey:1}, chars:"\\", unmodifiedChars:"\\"},
- "\\", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon,
- modifiers:{}, chars:";", unmodifiedChars:";"},
- ";", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon,
- modifiers:{shiftKey:1}, chars:":", unmodifiedChars:":"},
- ":", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon,
- modifiers:{ctrlKey:1}, chars:";", unmodifiedChars:";"},
- ";", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon,
- modifiers:{altKey:1}, chars:"\u2026", unmodifiedChars:";"},
- "\u2026", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, "\u2026", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon,
- modifiers:{metaKey:1}, chars:";", unmodifiedChars:";"},
- ";", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote,
- modifiers:{}, chars:"'", unmodifiedChars:"'"},
- "'", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote,
- modifiers:{shiftKey:1}, chars:"\"", unmodifiedChars:"\""},
- "\"", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote,
- modifiers:{ctrlKey:1}, chars:"'", unmodifiedChars:"'"},
- "'", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote,
- modifiers:{altKey:1}, chars:"\u00E6", unmodifiedChars:"'"},
- "\u00E6", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "\u00E6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote,
- modifiers:{metaKey:1}, chars:"'", unmodifiedChars:"'"},
- "'", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma,
- modifiers:{}, chars:",", unmodifiedChars:","},
- ",", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma,
- modifiers:{shiftKey:1}, chars:"<", unmodifiedChars:"<"},
- "<", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma,
- modifiers:{ctrlKey:1}, chars:",", unmodifiedChars:","},
- ",", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma,
- modifiers:{altKey:1}, chars:"\u2264", unmodifiedChars:","},
- "\u2264", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, "\u2264", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Comma,
- modifiers:{metaKey:1}, chars:",", unmodifiedChars:","},
- ",", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period,
- modifiers:{}, chars:".", unmodifiedChars:"."},
- ".", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period,
- modifiers:{shiftKey:1}, chars:">", unmodifiedChars:">"},
- ">", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period,
- modifiers:{ctrlKey:1}, chars:".", unmodifiedChars:"."},
- ".", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period,
- modifiers:{altKey:1}, chars:"\u2265", unmodifiedChars:"."},
- "\u2265", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, "\u2265", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period,
- modifiers:{metaKey:1}, chars:".", unmodifiedChars:"."},
- ".", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash,
- modifiers:{}, chars:"/", unmodifiedChars:"/"},
- "/", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash,
- modifiers:{shiftKey:1}, chars:"?", unmodifiedChars:"?"},
- "?", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash,
- modifiers:{ctrlKey:1}, chars:"/", unmodifiedChars:"/"},
- "/", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash,
- modifiers:{altKey:1}, chars:"\u00F7", unmodifiedChars:"/"},
- "\u00F7", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "\u00F7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Slash,
- modifiers:{metaKey:1}, chars:"/", unmodifiedChars:"/"},
- "/", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // numpad
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1,
- modifiers:{numericKeyPadKey:1}, chars:"1", unmodifiedChars:"1"},
- "1", "Numpad1", nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"1", unmodifiedChars:"1"},
- "1", "Numpad1", nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"1", unmodifiedChars:"1"},
- "1", "Numpad1", nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"1", unmodifiedChars:"1"},
- "1", "Numpad1", nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad1,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"1", unmodifiedChars:"1"},
- "1", "Numpad1", nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2,
- modifiers:{numericKeyPadKey:1}, chars:"2", unmodifiedChars:"2"},
- "2", "Numpad2", nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"2", unmodifiedChars:"2"},
- "2", "Numpad2", nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"2", unmodifiedChars:"2"},
- "2", "Numpad2", nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"2", unmodifiedChars:"2"},
- "2", "Numpad2", nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad2,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"2", unmodifiedChars:"2"},
- "2", "Numpad2", nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3,
- modifiers:{numericKeyPadKey:1}, chars:"3", unmodifiedChars:"3"},
- "3", "Numpad3", nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"3", unmodifiedChars:"3"},
- "3", "Numpad3", nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"3", unmodifiedChars:"3"},
- "3", "Numpad3", nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"3", unmodifiedChars:"3"},
- "3", "Numpad3", nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad3,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"3", unmodifiedChars:"3"},
- "3", "Numpad3", nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4,
- modifiers:{numericKeyPadKey:1}, chars:"4", unmodifiedChars:"4"},
- "4", "Numpad4", nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"4", unmodifiedChars:"4"},
- "4", "Numpad4", nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"4", unmodifiedChars:"4"},
- "4", "Numpad4", nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"4", unmodifiedChars:"4"},
- "4", "Numpad4", nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad4,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"4", unmodifiedChars:"4"},
- "4", "Numpad4", nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5,
- modifiers:{numericKeyPadKey:1}, chars:"5", unmodifiedChars:"5"},
- "5", "Numpad5", nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"5", unmodifiedChars:"5"},
- "5", "Numpad5", nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"5", unmodifiedChars:"5"},
- "5", "Numpad5", nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"5", unmodifiedChars:"5"},
- "5", "Numpad5", nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad5,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"5", unmodifiedChars:"5"},
- "5", "Numpad5", nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6,
- modifiers:{numericKeyPadKey:1}, chars:"6", unmodifiedChars:"6"},
- "6", "Numpad6", nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"6", unmodifiedChars:"6"},
- "6", "Numpad6", nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"6", unmodifiedChars:"6"},
- "6", "Numpad6", nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"6", unmodifiedChars:"6"},
- "6", "Numpad6", nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad6,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"6", unmodifiedChars:"6"},
- "6", "Numpad6", nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7,
- modifiers:{numericKeyPadKey:1}, chars:"7", unmodifiedChars:"7"},
- "7", "Numpad7", nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"7", unmodifiedChars:"7"},
- "7", "Numpad7", nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"7", unmodifiedChars:"7"},
- "7", "Numpad7", nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"7", unmodifiedChars:"7"},
- "7", "Numpad7", nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad7,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"7", unmodifiedChars:"7"},
- "7", "Numpad7", nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8,
- modifiers:{numericKeyPadKey:1}, chars:"8", unmodifiedChars:"8"},
- "8", "Numpad8", nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"8", unmodifiedChars:"8"},
- "8", "Numpad8", nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"8", unmodifiedChars:"8"},
- "8", "Numpad8", nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"8", unmodifiedChars:"8"},
- "8", "Numpad8", nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad8,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"8", unmodifiedChars:"8"},
- "8", "Numpad8", nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9,
- modifiers:{numericKeyPadKey:1}, chars:"9", unmodifiedChars:"9"},
- "9", "Numpad9", nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"9", unmodifiedChars:"9"},
- "9", "Numpad9", nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"9", unmodifiedChars:"9"},
- "9", "Numpad9", nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"9", unmodifiedChars:"9"},
- "9", "Numpad9", nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad9,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"9", unmodifiedChars:"9"},
- "9", "Numpad9", nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0,
- modifiers:{numericKeyPadKey:1}, chars:"0", unmodifiedChars:"0"},
- "0", "Numpad0", nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"0", unmodifiedChars:"0"},
- "0", "Numpad0", nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"0", unmodifiedChars:"0"},
- "0", "Numpad0", nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"0", unmodifiedChars:"0"},
- "0", "Numpad0", nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Keypad0,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"0", unmodifiedChars:"0"},
- "0", "Numpad0", nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals,
- modifiers:{numericKeyPadKey:1}, chars:"=", unmodifiedChars:"="},
- "=", "NumpadEqual", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"=", unmodifiedChars:"="},
- "=", "NumpadEqual", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"=", unmodifiedChars:"="},
- "=", "NumpadEqual", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"=", unmodifiedChars:"="},
- "=", "NumpadEqual", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEquals,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"=", unmodifiedChars:"="},
- "=", "NumpadEqual", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide,
- modifiers:{numericKeyPadKey:1}, chars:"/", unmodifiedChars:"/"},
- "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"/", unmodifiedChars:"/"},
- "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"/", unmodifiedChars:"/"},
- "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"/", unmodifiedChars:"/"},
- "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadDivide,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"/", unmodifiedChars:"/"},
- "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply,
- modifiers:{numericKeyPadKey:1}, chars:"*", unmodifiedChars:"*"},
- "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"*", unmodifiedChars:"*"},
- "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"*", unmodifiedChars:"*"},
- "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"*", unmodifiedChars:"*"},
- "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMultiply,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"*", unmodifiedChars:"*"},
- "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus,
- modifiers:{numericKeyPadKey:1}, chars:"-", unmodifiedChars:"-"},
- "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"-", unmodifiedChars:"-"},
- "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"-", unmodifiedChars:"-"},
- "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"-", unmodifiedChars:"-"},
- "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadMinus,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"-", unmodifiedChars:"-"},
- "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus,
- modifiers:{numericKeyPadKey:1}, chars:"+", unmodifiedChars:"+"},
- "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"+", unmodifiedChars:"+"},
- "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"+", unmodifiedChars:"+"},
- "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"+", unmodifiedChars:"+"},
- "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadPlus,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"+", unmodifiedChars:"+"},
- "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter,
- modifiers:{numericKeyPadKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"},
- "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"},
- "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"},
- "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"},
- "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_KeypadEnter,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:"\u0003", unmodifiedChars:"\u0003"},
- "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma,
- modifiers:{numericKeyPadKey:1, shiftKey:1}, chars:",", unmodifiedChars:","},
- ",", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma,
- modifiers:{numericKeyPadKey:1, ctrlKey:1}, chars:",", unmodifiedChars:","},
- ",", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma,
- modifiers:{numericKeyPadKey:1, altKey:1}, chars:",", unmodifiedChars:","},
- ",", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_JIS_KeypadComma,
- modifiers:{numericKeyPadKey:1, metaKey:1}, chars:",", unmodifiedChars:","},
- ",", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, ",", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
-
- // French, numeric
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1,
- modifiers:{}, chars:"&", unmodifiedChars:"&"},
- "&", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1,
- modifiers:{shiftKey:1}, chars:"1", unmodifiedChars:"1"},
- "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1,
- modifiers:{ctrlKey:1}, chars:"1", unmodifiedChars:"&"},
- "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1,
- modifiers:{metaKey:1}, chars:"&", unmodifiedChars:"&"},
- "&", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_1,
- modifiers:{metaKey:1, shiftKey:1}, chars:"1", unmodifiedChars:"1"},
- "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2,
- modifiers:{}, chars:"\u00E9", unmodifiedChars:"\u00E9"},
- "\u00E9", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2,
- modifiers:{shiftKey:1}, chars:"2", unmodifiedChars:"2"},
- "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2,
- modifiers:{ctrlKey:1}, chars:"2", unmodifiedChars:"\u00E9"},
- "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2,
- modifiers:{metaKey:1}, chars:"\u00E9", unmodifiedChars:"\u00E9"},
- "\u00E9", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_2,
- modifiers:{metaKey:1, shiftKey:1}, chars:"2", unmodifiedChars:"2"},
- "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3,
- modifiers:{}, chars:"\"", unmodifiedChars:"\""},
- "\"", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3,
- modifiers:{shiftKey:1}, chars:"3", unmodifiedChars:"3"},
- "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3,
- modifiers:{ctrlKey:1}, chars:"3", unmodifiedChars:"\""},
- "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3,
- modifiers:{metaKey:1}, chars:"\"", unmodifiedChars:"\""},
- "\"", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // Cmd+Shift+3 is a shortcut key of taking a snapshot
- // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_3,
- // modifiers:{metaKey:1, shiftKey:1}, chars:"\"", unmodifiedChars:"\""},
- // "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4,
- modifiers:{}, chars:"'", unmodifiedChars:"'"},
- "'", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4,
- modifiers:{shiftKey:1}, chars:"4", unmodifiedChars:"4"},
- "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4,
- modifiers:{ctrlKey:1}, chars:"4", unmodifiedChars:"'"},
- "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4,
- modifiers:{metaKey:1}, chars:"'", unmodifiedChars:"'"},
- "'", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // Cmd+Shift+4 is a shortcut key of taking a snapshot in specific range
- // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_4,
- // modifiers:{metaKey:1, shiftKey:1}, chars:"4", unmodifiedChars:"4"},
- // "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5,
- modifiers:{}, chars:"(", unmodifiedChars:"("},
- "(", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5,
- modifiers:{shiftKey:1}, chars:"5", unmodifiedChars:"5"},
- "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5,
- modifiers:{ctrlKey:1}, chars:"5", unmodifiedChars:"("},
- "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5,
- modifiers:{metaKey:1}, chars:"(", unmodifiedChars:"("},
- "(", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_5,
- modifiers:{metaKey:1, shiftKey:1}, chars:"5", unmodifiedChars:"5"},
- "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6,
- modifiers:{}, chars:"\u00A7", unmodifiedChars:"\u00A7"},
- "\u00A7", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6,
- modifiers:{shiftKey:1}, chars:"6", unmodifiedChars:"6"},
- "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // TODO:
- // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6,
- // modifiers:{ctrlKey:1}, chars:"\u001D", unmodifiedChars:"\u00A7"},
- // "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl+6 sets strange char
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6,
- modifiers:{metaKey:1}, chars:"\u00A7", unmodifiedChars:"\u00A7"},
- "\u00A7", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "\u00A7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_6,
- modifiers:{metaKey:1, shiftKey:1}, chars:"6", unmodifiedChars:"6"},
- "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7,
- modifiers:{}, chars:"\u00E8", unmodifiedChars:"\u00E8"},
- "\u00E8", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7,
- modifiers:{shiftKey:1}, chars:"7", unmodifiedChars:"7"},
- "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7,
- modifiers:{ctrlKey:1}, chars:"7", unmodifiedChars:"\u00E8"},
- "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7,
- modifiers:{metaKey:1}, chars:"\u00E8", unmodifiedChars:"\u00E8"},
- "\u00E8", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_7,
- modifiers:{metaKey:1, shiftKey:1}, chars:"7", unmodifiedChars:"7"},
- "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8,
- modifiers:{}, chars:"!", unmodifiedChars:"!"},
- "!", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8,
- modifiers:{shiftKey:1}, chars:"8", unmodifiedChars:"8"},
- "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8,
- modifiers:{ctrlKey:1}, chars:"8", unmodifiedChars:"!"},
- "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8,
- modifiers:{metaKey:1}, chars:"!", unmodifiedChars:"!"},
- "!", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "!", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_8,
- modifiers:{metaKey:1, shiftKey:1}, chars:"8", unmodifiedChars:"8"},
- "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9,
- modifiers:{}, chars:"\u00E7", unmodifiedChars:"\u00E7"},
- "\u00E7", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9,
- modifiers:{shiftKey:1}, chars:"9", unmodifiedChars:"9"},
- "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // TODO:
- // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9,
- // modifiers:{ctrlKey:1}, chars:"\u001C", unmodifiedChars:"\u00E7"},
- // "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Ctrl+9 sets strange char
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9,
- modifiers:{metaKey:1}, chars:"\u00E7", unmodifiedChars:"\u00E7"},
- "\u00E7", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_9,
- modifiers:{metaKey:1, shiftKey:1}, chars:"9", unmodifiedChars:"9"},
- "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0,
- modifiers:{}, chars:"\u00E0", unmodifiedChars:"\u00E0"},
- "\u00E0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0,
- modifiers:{shiftKey:1}, chars:"0", unmodifiedChars:"0"},
- "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // XXX No events fired, not sure the reason.
- // yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0,
- // modifiers:{ctrlKey:1}, chars:"", unmodifiedChars:"\u00E0"},
- // "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0,
- modifiers:{metaKey:1}, chars:"\u00E0", unmodifiedChars:"\u00E0"},
- "\u00E0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:MAC_VK_ANSI_0,
- modifiers:{metaKey:1, shiftKey:1}, chars:"0", unmodifiedChars:"0"},
- "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Thai
- // keycode should be DOM_VK_[A-Z] of the key on the latest ASCII capable keyboard layout is for alphabet
- yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_A,
- modifiers:{}, chars:"\u0E1F", unmodifiedChars:"\u0E1F"},
- "\u0E1F", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u0E1F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // keycode should be shifted character if unshifted character isn't an ASCII character
- yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_Quote,
- modifiers:{}, chars:"\u0E07", unmodifiedChars:"\u0E07"},
- "\u0E07", "Quote", nsIDOMKeyEvent.DOM_VK_PERIOD, "\u0E07", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // keycode should be zero if the character of the key on the latest ASCII capable keyboard layout isn't for alphabet
- yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_Period,
- modifiers:{}, chars:"\u0E43", unmodifiedChars:"\u0E43"},
- "\u0E43", "Period", 0, "\u0E43", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // keycode should be DOM_VK_[0-9] if the key on the latest ASCII capable keyboard layout is for numeric
- yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_1,
- modifiers:{}, chars:"\u0E45", unmodifiedChars:"\u0E45"},
- "\u0E45", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "\u0E45", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_2,
- modifiers:{}, chars:"/", unmodifiedChars:"/"},
- "/", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_3,
- modifiers:{}, chars:"_", unmodifiedChars:"_"},
- "_", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_4,
- modifiers:{}, chars:"\u0E20", unmodifiedChars:"\u0E20"},
- "\u0E20", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "\u0E20", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_5,
- modifiers:{}, chars:"\u0E16", unmodifiedChars:"\u0E16"},
- "\u0E16", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "\u0E16", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_6,
- modifiers:{}, chars:"\u0E38", unmodifiedChars:"\u0E38"},
- "\u0E38", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "\u0E38", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_7,
- modifiers:{}, chars:"\u0E36", unmodifiedChars:"\u0E36"},
- "\u0E36", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "\u0E36", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_8,
- modifiers:{}, chars:"\u0E04", unmodifiedChars:"\u0E04"},
- "\u0E04", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "\u0E04", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_9,
- modifiers:{}, chars:"\u0E15", unmodifiedChars:"\u0E15"},
- "\u0E15", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "\u0E15", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_THAI, keyCode:MAC_VK_ANSI_0,
- modifiers:{}, chars:"\u0E08", unmodifiedChars:"\u0E08"},
- "\u0E08", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "\u0E08", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Dvorak-Qwerty, layout should be changed when Command key is pressed.
- yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S,
- modifiers:{}, chars:"o", unmodifiedChars:"o"},
- "o", "KeyS", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S,
- modifiers:{shiftKey:1}, chars:"O", unmodifiedChars:"O"},
- "O", "KeyS", nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S,
- modifiers:{ctrlKey:1}, chars:"\u000F", unmodifiedChars:"o"},
- "o", "KeyS", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S,
- modifiers:{altKey:1}, chars:"\u00F8", unmodifiedChars:"o"},
- "\u00F8", "KeyS", nsIDOMKeyEvent.DOM_VK_O, "\u00F8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_S,
- modifiers:{metaKey:1}, chars:"s", unmodifiedChars:"o"},
- "s", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D,
- modifiers:{}, chars:"e", unmodifiedChars:"e"},
- "e", "KeyD", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D,
- modifiers:{shiftKey:1}, chars:"E", unmodifiedChars:"E"},
- "E", "KeyD", nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D,
- modifiers:{ctrlKey:1}, chars:"\u0005", unmodifiedChars:"e"},
- "e", "KeyD", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D,
- modifiers:{altKey:1}, chars:"", unmodifiedChars:"e"},
- "Dead", "KeyD", nsIDOMKeyEvent.DOM_VK_E, "\u00B4", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // dead key
- yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_D,
- modifiers:{metaKey:1}, chars:"d", unmodifiedChars:"e"},
- "d", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_I,
- modifiers:{metaKey:1, altKey:1}, chars:"^", unmodifiedChars:"c"},
- "^", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "^", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_DVORAK_QWERTY, keyCode:MAC_VK_ANSI_I,
- modifiers:{metaKey:1, altKey:1, shiftKey:1}, chars:"\u02C6", unmodifiedChars:"C"},
- "\u02C6", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "\u02C6", SHOULD_DELIVER_KEYDOWN_KEYPRESS, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Arabic - PC keyboard layout inputs 2 or more characters with some key.
- yield testKey({layout:KEYBOARD_LAYOUT_ARABIC_PC, keyCode:MAC_VK_ANSI_G,
- modifiers:{shiftKey:1}, chars:"\u0644\u0623", unmodifiedChars:"\u0644\u0623"},
- ["\u0644\u0623", "\u0644", "\u0623", "\u0644\u0623"], "KeyG", nsIDOMKeyEvent.DOM_VK_G, "\u0644\u0623", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_ARABIC_PC, keyCode:MAC_VK_ANSI_T,
- modifiers:{shiftKey:1}, chars:"\u0644\u0625", unmodifiedChars:"\u0644\u0625"},
- ["\u0644\u0625", "\u0644", "\u0625", "\u0644\u0625"], "KeyT", nsIDOMKeyEvent.DOM_VK_T, "\u0644\u0625", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_ARABIC_PC, keyCode:MAC_VK_ANSI_B,
- modifiers:{shiftKey:1}, chars:"\u0644\u0622", unmodifiedChars:"\u0644\u0622"},
- ["\u0644\u0622", "\u0644", "\u0622", "\u0644\u0622"], "KeyB", nsIDOMKeyEvent.DOM_VK_B, "\u0644\u0622", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_ARABIC_PC, keyCode:MAC_VK_ANSI_B,
- modifiers:{}, chars:"\u0644\u0627", unmodifiedChars:"\u0644\u0627"},
- ["\u0644\u0627", "\u0644", "\u0627", "\u0644\u0627"], "KeyB", nsIDOMKeyEvent.DOM_VK_B, "\u0644\u0627", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- cleanup();
- }
-
- function testKeysOnWindows()
- {
- // On Windows, you can use Spy++ or Winspector (free) to watch window messages.
- // The keyCode is given by the wParam of the last WM_KEYDOWN message. The
- // chars string is given by the wParam of the WM_CHAR message. unmodifiedChars
- // is not needed on Windows.
-
- // Shift-ctrl-alt generates no WM_CHAR, but we still get a keypress
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{altKey:1, ctrlKey:1, shiftKey:1}, chars:""},
- "A", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Greek plain text
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A,
- modifiers:{}, chars:"\u03b1"},
- "\u03b1", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u03b1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1}, chars:"\u0391"},
- "\u0391", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u0391", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Greek ctrl keys produce Latin charcodes
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A,
- modifiers:{ctrlKey:1}, chars:"\u0001"},
- "\u03b1", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001"},
- "\u0391", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Caps Lock key event
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CAPITAL,
- modifiers:{capsLockKey:1}, chars:""},
- "CapsLock", "CapsLock", nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CAPITAL,
- modifiers:{capsLockKey:0}, chars:""},
- "CapsLock", "CapsLock", nsIDOMKeyEvent.DOM_VK_CAPS_LOCK, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Shift keys
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LSHIFT,
- modifiers:{shiftKey:1}, chars:""},
- "Shift", "ShiftLeft", nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RSHIFT,
- modifiers:{shiftRightKey:1}, chars:""},
- "Shift", "ShiftRight", nsIDOMKeyEvent.DOM_VK_SHIFT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
-
- // Ctrl keys
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LCONTROL,
- modifiers:{ctrlKey:1}, chars:""},
- "Control", "ControlLeft", nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RCONTROL,
- modifiers:{ctrlRightKey:1}, chars:""},
- "Control", "ControlRight", nsIDOMKeyEvent.DOM_VK_CONTROL, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
-
- // Alt keys
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LMENU,
- modifiers:{altKey:1}, chars:""},
- "Alt", "AltLeft", nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RMENU,
- modifiers:{altRightKey:1}, chars:""},
- "Alt", "AltRight", nsIDOMKeyEvent.DOM_VK_ALT, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
-
- // Win keys
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LWIN,
- modifiers:{}, chars:""},
- "OS" /* bug 1232918 */, "OSLeft", nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_LEFT);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RWIN,
- modifiers:{}, chars:""},
- "OS" /* bug 1232918 */, "OSRight", nsIDOMKeyEvent.DOM_VK_WIN, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_RIGHT);
-
- // all keys on keyboard (keyCode test)
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_BACK,
- modifiers:{}, chars:"\u0008"},
- "Backspace", "Backspace", nsIDOMKeyEvent.DOM_VK_BACK_SPACE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_TAB,
- modifiers:{}, chars:"\t"},
- "Tab", "Tab", nsIDOMKeyEvent.DOM_VK_TAB, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RETURN,
- modifiers:{}, chars:"\r"},
- "Enter", "Enter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PAUSE,
- modifiers:{}, chars:""},
- "Pause", "Pause", nsIDOMKeyEvent.DOM_VK_PAUSE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_KANA,
- modifiers:{}, chars:""},
- "Unidentified", "", nsIDOMKeyEvent.DOM_VK_KANA, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_JUNJA,
- modifiers:{}, chars:""},
- "JunjaMode", "", nsIDOMKeyEvent.DOM_VK_JUNJA, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_FINAL,
- modifiers:{}, chars:""},
- "FinalMode", "", nsIDOMKeyEvent.DOM_VK_FINAL, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_KANJI,
- modifiers:{}, chars:""},
- "Unidentified", "", nsIDOMKeyEvent.DOM_VK_KANJI, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ESCAPE,
- modifiers:{}, chars:""},
- "Escape", "Escape", nsIDOMKeyEvent.DOM_VK_ESCAPE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CONVERT,
- modifiers:{}, chars:""},
- "Convert", "", nsIDOMKeyEvent.DOM_VK_CONVERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NONCONVERT,
- modifiers:{}, chars:""},
- "NonConvert", "", nsIDOMKeyEvent.DOM_VK_NONCONVERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ACCEPT,
- modifiers:{}, chars:""},
- "Accept", "", nsIDOMKeyEvent.DOM_VK_ACCEPT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_MODECHANGE,
- modifiers:{}, chars:""},
- "ModeChange", "", nsIDOMKeyEvent.DOM_VK_MODECHANGE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SPACE,
- modifiers:{}, chars:" "},
- " ", "Space", nsIDOMKeyEvent.DOM_VK_SPACE, " ", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- // Ctrl+Space causes WM_CHAR with ' '. However, its keypress event's ctrlKey state shouldn't be false.
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SPACE,
- modifiers:{ctrlKey:1}, chars:" "},
- " ", "Space", nsIDOMKeyEvent.DOM_VK_SPACE, " ", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SELECT,
- modifiers:{}, chars:""},
- "Select", "", nsIDOMKeyEvent.DOM_VK_SELECT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PRINT,
- modifiers:{}, chars:""},
- "Unidentified", "", nsIDOMKeyEvent.DOM_VK_PRINT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_EXECUTE,
- modifiers:{}, chars:""},
- "Execute", "", nsIDOMKeyEvent.DOM_VK_EXECUTE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SNAPSHOT,
- modifiers:{}, chars:""},
- "PrintScreen", "PrintScreen", nsIDOMKeyEvent.DOM_VK_PRINTSCREEN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_HELP,
- modifiers:{}, chars:""},
- "Help", "", nsIDOMKeyEvent.DOM_VK_HELP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SLEEP,
- modifiers:{}, chars:""},
- "Standby", "", nsIDOMKeyEvent.DOM_VK_SLEEP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PRIOR,
- modifiers:{}, chars:""},
- "PageUp", "PageUp", nsIDOMKeyEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NEXT,
- modifiers:{}, chars:""},
- "PageDown", "PageDown", nsIDOMKeyEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_END,
- modifiers:{}, chars:""},
- "End", "End", nsIDOMKeyEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_HOME,
- modifiers:{}, chars:""},
- "Home", "Home", nsIDOMKeyEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_LEFT,
- modifiers:{}, chars:""},
- "ArrowLeft", "ArrowLeft", nsIDOMKeyEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_UP,
- modifiers:{}, chars:""},
- "ArrowUp", "ArrowUp", nsIDOMKeyEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RIGHT,
- modifiers:{}, chars:""},
- "ArrowRight", "ArrowRight", nsIDOMKeyEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DOWN,
- modifiers:{}, chars:""},
- "ArrowDown", "ArrowDown", nsIDOMKeyEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_INSERT,
- modifiers:{}, chars:""},
- "Insert", "Insert", nsIDOMKeyEvent.DOM_VK_INSERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DELETE,
- modifiers:{}, chars:""},
- "Delete", "Delete", nsIDOMKeyEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Backspace and Enter are handled with special path in mozilla::widget::NativeKey. So, let's test them with modifiers too.
- // Note that when both Ctrl and Alt are pressed, they don't cause WM_(SYS)CHAR message.
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_BACK,
- modifiers:{ctrlKey:1}, chars:"\u007F"},
- "Backspace", "Backspace", nsIDOMKeyEvent.DOM_VK_BACK_SPACE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_BACK,
- modifiers:{altKey:1}, chars:"\u0008"},
- "Backspace", "Backspace", nsIDOMKeyEvent.DOM_VK_BACK_SPACE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_BACK,
- modifiers:{ctrl:1, altKey:1}, chars:""},
- "Backspace", "Backspace", nsIDOMKeyEvent.DOM_VK_BACK_SPACE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RETURN,
- modifiers:{ctrlKey:1}, chars:"\n"},
- "Enter", "Enter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RETURN,
- modifiers:{altKey:1}, chars:"\r"},
- "Enter", "Enter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_RETURN,
- modifiers:{ctrl:1, altKey:1}, chars:""},
- "Enter", "Enter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Even non-printable key could be mapped as a printable key.
- // Only "keyup" event cannot know if it *did* cause inputting text.
- // Therefore, only "keydown" and "keypress" event's key value should be the character inputted by the key.
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F4,
- modifiers:{}, chars:"a"},
- ["a", "a", "F4"], "F4", nsIDOMKeyEvent.DOM_VK_F4, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Even if key message is processed by IME, when the key causes inputting text,
- // keypress event(s) should be fired.
- const WIN_VK_PROCESSKEY_WITH_SC_A = WIN_VK_PROCESSKEY | 0x001E0000;
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PROCESSKEY_WITH_SC_A,
- modifiers:{}, chars:"a"},
- ["a", "a", "Unidentified" /* TODO: Process */], "KeyA", 0 /* TODO: 0xE5 */, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_PROCESSKEY_WITH_SC_A,
- modifiers:{altKey:1}, chars:"a"},
- ["a", "a", "Unidentified" /* TODO: Process */], "KeyA", 0 /* TODO: 0xE5 */, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // US
- // Alphabet
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{}, chars:"a"},
- "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1}, chars:"A"},
- "A", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{ctrlKey:1}, chars:"\u0001"},
- "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001"},
- "A", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{altKey:1}, chars:"a"},
- "a", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "a", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{altKey:1, shiftKey:1}, chars:"A"},
- "A", "KeyA", nsIDOMKeyEvent.DOM_VK_A, "A", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B,
- modifiers:{}, chars:"b"},
- "b", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B,
- modifiers:{shiftKey:1}, chars:"B"},
- "B", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B,
- modifiers:{ctrlKey:1}, chars:"\u0002"},
- "b", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0002"},
- "B", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B,
- modifiers:{altKey:1}, chars:"b"},
- "b", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "b", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_B,
- modifiers:{altKey:1, shiftKey:1}, chars:"B"},
- "B", "KeyB", nsIDOMKeyEvent.DOM_VK_B, "B", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_C,
- modifiers:{}, chars:"c"},
- "c", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_C,
- modifiers:{shiftKey:1}, chars:"C"},
- "C", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_C,
- modifiers:{ctrlKey:1}, chars:"\u0003"},
- "c", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_C,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0003"},
- "C", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_C,
- modifiers:{altKey:1}, chars:"c"},
- "c", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "c", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_C,
- modifiers:{altKey:1, shiftKey:1}, chars:"C"},
- "C", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "C", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_D,
- modifiers:{}, chars:"d"},
- "d", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_D,
- modifiers:{shiftKey:1}, chars:"D"},
- "D", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_D,
- modifiers:{ctrlKey:1}, chars:"\u0004"},
- "d", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_D,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0004"},
- "D", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_D,
- modifiers:{altKey:1}, chars:"d"},
- "d", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "d", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_D,
- modifiers:{altKey:1, shiftKey:1}, chars:"D"},
- "D", "KeyD", nsIDOMKeyEvent.DOM_VK_D, "D", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_E,
- modifiers:{}, chars:"e"},
- "e", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_E,
- modifiers:{shiftKey:1}, chars:"E"},
- "E", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_E,
- modifiers:{ctrlKey:1}, chars:"\u0005"},
- "e", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_E,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0005"},
- "E", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_E,
- modifiers:{altKey:1}, chars:"e"},
- "e", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "e", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_E,
- modifiers:{altKey:1, shiftKey:1}, chars:"E"},
- "E", "KeyE", nsIDOMKeyEvent.DOM_VK_E, "E", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F,
- modifiers:{}, chars:"f"},
- "f", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F,
- modifiers:{shiftKey:1}, chars:"F"},
- "F", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F,
- modifiers:{ctrlKey:1}, chars:"\u0006"},
- "f", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0006"},
- "F", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F,
- modifiers:{altKey:1}, chars:"f"},
- "f", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "f", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F,
- modifiers:{altKey:1, shiftKey:1}, chars:"F"},
- "F", "KeyF", nsIDOMKeyEvent.DOM_VK_F, "F", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_G,
- modifiers:{}, chars:"g"},
- "g", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_G,
- modifiers:{shiftKey:1}, chars:"G"},
- "G", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_G,
- modifiers:{ctrlKey:1}, chars:"\u0007"},
- "g", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_G,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0007"},
- "G", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_G,
- modifiers:{altKey:1}, chars:"g"},
- "g", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "g", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_G,
- modifiers:{altKey:1, shiftKey:1}, chars:"G"},
- "G", "KeyG", nsIDOMKeyEvent.DOM_VK_G, "G", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_H,
- modifiers:{}, chars:"h"},
- "h", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_H,
- modifiers:{shiftKey:1}, chars:"H"},
- "H", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_H,
- modifiers:{ctrlKey:1}, chars:"\u0008"},
- "h", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_H,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0008"},
- "H", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_H,
- modifiers:{altKey:1}, chars:"h"},
- "h", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "h", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_H,
- modifiers:{altKey:1, shiftKey:1}, chars:"H"},
- "H", "KeyH", nsIDOMKeyEvent.DOM_VK_H, "H", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_I,
- modifiers:{}, chars:"i"},
- "i", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_I,
- modifiers:{shiftKey:1}, chars:"I"},
- "I", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "I", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_I,
- modifiers:{ctrlKey:1}, chars:"\u0009"},
- "i", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_I,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0009"},
- "I", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "I", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_I,
- modifiers:{altKey:1}, chars:"i"},
- "i", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "i", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_I,
- modifiers:{altKey:1, shiftKey:1}, chars:"I"},
- "I", "KeyI", nsIDOMKeyEvent.DOM_VK_I, "I", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_J,
- modifiers:{}, chars:"j"},
- "j", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_J,
- modifiers:{shiftKey:1}, chars:"J"},
- "J", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "J", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_J,
- modifiers:{ctrlKey:1}, chars:"\u000A"},
- "j", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_J,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u000A"},
- "J", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "J", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_J,
- modifiers:{altKey:1}, chars:"j"},
- "j", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "j", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_J,
- modifiers:{altKey:1, shiftKey:1}, chars:"J"},
- "J", "KeyJ", nsIDOMKeyEvent.DOM_VK_J, "J", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_K,
- modifiers:{}, chars:"k"},
- "k", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_K,
- modifiers:{shiftKey:1}, chars:"K"},
- "K", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "K", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_K,
- modifiers:{ctrlKey:1}, chars:"\u000B"},
- "k", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_K,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u000B"},
- "K", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "K", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_K,
- modifiers:{altKey:1}, chars:"k"},
- "k", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "k", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_K,
- modifiers:{altKey:1, shiftKey:1}, chars:"K"},
- "K", "KeyK", nsIDOMKeyEvent.DOM_VK_K, "K", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_L,
- modifiers:{}, chars:"l"},
- "l", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_L,
- modifiers:{shiftKey:1}, chars:"L"},
- "L", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "L", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_L,
- modifiers:{ctrlKey:1}, chars:"\u000C"},
- "l", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_L,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u000C"},
- "L", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "L", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_L,
- modifiers:{altKey:1}, chars:"l"},
- "l", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "l", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_L,
- modifiers:{altKey:1, shiftKey:1}, chars:"L"},
- "L", "KeyL", nsIDOMKeyEvent.DOM_VK_L, "L", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_M,
- modifiers:{}, chars:"m"},
- "m", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_M,
- modifiers:{shiftKey:1}, chars:"M"},
- "M", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "M", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_M,
- modifiers:{ctrlKey:1}, chars:"\u000D"},
- "m", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_M,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u000D"},
- "M", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "M", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_M,
- modifiers:{altKey:1}, chars:"m"},
- "m", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "m", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_M,
- modifiers:{altKey:1, shiftKey:1}, chars:"M"},
- "M", "KeyM", nsIDOMKeyEvent.DOM_VK_M, "M", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_N,
- modifiers:{}, chars:"n"},
- "n", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_N,
- modifiers:{shiftKey:1}, chars:"N"},
- "N", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "N", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_N,
- modifiers:{ctrlKey:1}, chars:"\u000E"},
- "n", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_N,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u000E"},
- "N", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "N", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_N,
- modifiers:{altKey:1}, chars:"n"},
- "n", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "n", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_N,
- modifiers:{altKey:1, shiftKey:1}, chars:"N"},
- "N", "KeyN", nsIDOMKeyEvent.DOM_VK_N, "N", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_O,
- modifiers:{}, chars:"o"},
- "o", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_O,
- modifiers:{shiftKey:1}, chars:"O"},
- "O", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_O,
- modifiers:{ctrlKey:1}, chars:"\u000F"},
- "o", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_O,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u000F"},
- "O", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_O,
- modifiers:{altKey:1}, chars:"o"},
- "o", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "o", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_O,
- modifiers:{altKey:1, shiftKey:1}, chars:"O"},
- "O", "KeyO", nsIDOMKeyEvent.DOM_VK_O, "O", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_P,
- modifiers:{}, chars:"p"},
- "p", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_P,
- modifiers:{shiftKey:1}, chars:"P"},
- "P", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "P", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_P,
- modifiers:{ctrlKey:1}, chars:"\u0010"},
- "p", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_P,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0010"},
- "P", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "P", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_P,
- modifiers:{altKey:1}, chars:"p"},
- "p", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "p", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_P,
- modifiers:{altKey:1, shiftKey:1}, chars:"P"},
- "P", "KeyP", nsIDOMKeyEvent.DOM_VK_P, "P", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Q,
- modifiers:{}, chars:"q"},
- "q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Q,
- modifiers:{shiftKey:1}, chars:"Q"},
- "Q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Q,
- modifiers:{ctrlKey:1}, chars:"\u0011"},
- "q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Q,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0011"},
- "Q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Q,
- modifiers:{altKey:1}, chars:"q"},
- "q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Q,
- modifiers:{altKey:1, shiftKey:1}, chars:"Q"},
- "Q", "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_R,
- modifiers:{}, chars:"r"},
- "r", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_R,
- modifiers:{shiftKey:1}, chars:"R"},
- "R", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "R", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_R,
- modifiers:{ctrlKey:1}, chars:"\u0012"},
- "r", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_R,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0012"},
- "R", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "R", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_R,
- modifiers:{altKey:1}, chars:"r"},
- "r", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "r", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_R,
- modifiers:{altKey:1, shiftKey:1}, chars:"R"},
- "R", "KeyR", nsIDOMKeyEvent.DOM_VK_R, "R", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_S,
- modifiers:{}, chars:"s"},
- "s", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_S,
- modifiers:{shiftKey:1}, chars:"S"},
- "S", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "S", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_S,
- modifiers:{ctrlKey:1}, chars:"\u0013"},
- "s", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_S,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0013"},
- "S", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "S", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_S,
- modifiers:{altKey:1}, chars:"s"},
- "s", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "s", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_S,
- modifiers:{altKey:1, shiftKey:1}, chars:"S"},
- "S", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "S", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T,
- modifiers:{}, chars:"t"},
- "t", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T,
- modifiers:{shiftKey:1}, chars:"T"},
- "T", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "T", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T,
- modifiers:{ctrlKey:1}, chars:"\u0014"},
- "t", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0014"},
- "T", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "T", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T,
- modifiers:{altKey:1}, chars:"t"},
- "t", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "t", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T,
- modifiers:{altKey:1, shiftKey:1}, chars:"T"},
- "T", "KeyT", nsIDOMKeyEvent.DOM_VK_T, "T", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_U,
- modifiers:{}, chars:"u"},
- "u", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_U,
- modifiers:{shiftKey:1}, chars:"U"},
- "U", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "U", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_U,
- modifiers:{ctrlKey:1}, chars:"\u0015"},
- "u", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_U,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0015"},
- "U", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "U", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_U,
- modifiers:{altKey:1}, chars:"u"},
- "u", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "u", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_U,
- modifiers:{altKey:1, shiftKey:1}, chars:"U"},
- "U", "KeyU", nsIDOMKeyEvent.DOM_VK_U, "U", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_V,
- modifiers:{}, chars:"v"},
- "v", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_V,
- modifiers:{shiftKey:1}, chars:"V"},
- "V", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "V", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_V,
- modifiers:{ctrlKey:1}, chars:"\u0016"},
- "v", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_V,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0016"},
- "V", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "V", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_V,
- modifiers:{altKey:1}, chars:"v"},
- "v", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "v", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_V,
- modifiers:{altKey:1, shiftKey:1}, chars:"V"},
- "V", "KeyV", nsIDOMKeyEvent.DOM_VK_V, "V", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_W,
- modifiers:{}, chars:"w"},
- "w", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_W,
- modifiers:{shiftKey:1}, chars:"W"},
- "W", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "W", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_W,
- modifiers:{ctrlKey:1}, chars:"\u0017"},
- "w", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_W,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0017"},
- "W", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "W", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_W,
- modifiers:{altKey:1}, chars:"w"},
- "w", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "w", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_W,
- modifiers:{altKey:1, shiftKey:1}, chars:"W"},
- "W", "KeyW", nsIDOMKeyEvent.DOM_VK_W, "W", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X,
- modifiers:{}, chars:"x"},
- "x", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X,
- modifiers:{shiftKey:1}, chars:"X"},
- "X", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "X", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X,
- modifiers:{ctrlKey:1}, chars:"\u0018"},
- "x", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"},
- "X", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "X", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X,
- modifiers:{altKey:1}, chars:"x"},
- "x", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "x", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X,
- modifiers:{altKey:1, shiftKey:1}, chars:"X"},
- "X", "KeyX", nsIDOMKeyEvent.DOM_VK_X, "X", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Y,
- modifiers:{}, chars:"y"},
- "y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Y,
- modifiers:{shiftKey:1}, chars:"Y"},
- "Y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "Y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Y,
- modifiers:{ctrlKey:1}, chars:"\u0019"},
- "y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Y,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0019"},
- "Y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "Y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Y,
- modifiers:{altKey:1}, chars:"y"},
- "y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Y,
- modifiers:{altKey:1, shiftKey:1}, chars:"Y"},
- "Y", "KeyY", nsIDOMKeyEvent.DOM_VK_Y, "Y", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Z,
- modifiers:{}, chars:"z"},
- "z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Z,
- modifiers:{shiftKey:1}, chars:"Z"},
- "Z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "Z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Z,
- modifiers:{ctrlKey:1}, chars:"\u001A"},
- "z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Z,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u001A"},
- "Z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "Z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Z,
- modifiers:{altKey:1}, chars:"z"},
- "z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_Z,
- modifiers:{altKey:1, shiftKey:1}, chars:"Z"},
- "Z", "KeyZ", nsIDOMKeyEvent.DOM_VK_Z, "Z", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Numeric
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_0,
- modifiers:{}, chars:"0"},
- "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_0,
- modifiers:{shiftKey:1}, chars:")"},
- ")", "Digit0", nsIDOMKeyEvent.DOM_VK_0, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_0,
- modifiers:{ctrlKey:1}, chars:""},
- "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_0,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- ")", "Digit0", nsIDOMKeyEvent.DOM_VK_0, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_0,
- modifiers:{altKey:1}, chars:"0"},
- "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_0,
- modifiers:{altKey:1, shiftKey:1}, chars:")"},
- ")", "Digit0", nsIDOMKeyEvent.DOM_VK_0, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_1,
- modifiers:{}, chars:"1"},
- "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_1,
- modifiers:{shiftKey:1}, chars:"!"},
- "!", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_1,
- modifiers:{ctrlKey:1}, chars:""},
- "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_1,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "!", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_1,
- modifiers:{altKey:1}, chars:"1"},
- "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_1,
- modifiers:{altKey:1, shiftKey:1}, chars:"!"},
- "!", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_2,
- modifiers:{}, chars:"2"},
- "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_2,
- modifiers:{shiftKey:1}, chars:"@"},
- "@", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_2,
- modifiers:{ctrlKey:1}, chars:""},
- "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_2,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "@", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_2,
- modifiers:{altKey:1}, chars:"2"},
- "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_2,
- modifiers:{altKey:1, shiftKey:1}, chars:"@"},
- "@", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_3,
- modifiers:{}, chars:"3"},
- "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_3,
- modifiers:{shiftKey:1}, chars:"#"},
- "#", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_3,
- modifiers:{ctrlKey:1}, chars:""},
- "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_3,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "#", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_3,
- modifiers:{altKey:1}, chars:"3"},
- "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_3,
- modifiers:{altKey:1, shiftKey:1}, chars:"#"},
- "#", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_4,
- modifiers:{}, chars:"4"},
- "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_4,
- modifiers:{shiftKey:1}, chars:"$"},
- "$", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_4,
- modifiers:{ctrlKey:1}, chars:""},
- "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_4,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "$", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_4,
- modifiers:{altKey:1}, chars:"4"},
- "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_4,
- modifiers:{altKey:1, shiftKey:1}, chars:"$"},
- "$", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_5,
- modifiers:{}, chars:"5"},
- "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_5,
- modifiers:{shiftKey:1}, chars:"%"},
- "%", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_5,
- modifiers:{ctrlKey:1}, chars:""},
- "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_5,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "%", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_5,
- modifiers:{altKey:1}, chars:"5"},
- "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_5,
- modifiers:{altKey:1, shiftKey:1}, chars:"%"},
- "%", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_6,
- modifiers:{}, chars:"6"},
- "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_6,
- modifiers:{shiftKey:1}, chars:"^"},
- "^", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_6,
- modifiers:{ctrlKey:1}, chars:""},
- "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_6,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u001E"},
- "^", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_6,
- modifiers:{altKey:1}, chars:"6"},
- "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_6,
- modifiers:{altKey:1, shiftKey:1}, chars:"^"},
- "^", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_7,
- modifiers:{}, chars:"7"},
- "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_7,
- modifiers:{shiftKey:1}, chars:"&"},
- "&", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_7,
- modifiers:{ctrlKey:1}, chars:""},
- "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_7,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "&", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_7,
- modifiers:{altKey:1}, chars:"7"},
- "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_7,
- modifiers:{altKey:1, shiftKey:1}, chars:"&"},
- "&", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_8,
- modifiers:{}, chars:"8"},
- "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_8,
- modifiers:{shiftKey:1}, chars:"*"},
- "*", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_8,
- modifiers:{ctrlKey:1, }, chars:""},
- "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_8,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "*", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_8,
- modifiers:{altKey:1}, chars:"8"},
- "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_8,
- modifiers:{altKey:1, shiftKey:1}, chars:"*"},
- "*", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_9,
- modifiers:{}, chars:"9"},
- "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_9,
- modifiers:{shiftKey:1}, chars:"("},
- "(", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_9,
- modifiers:{ctrlKey:1}, chars:""},
- "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_9,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "(", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_9,
- modifiers:{altKey:1}, chars:"9"},
- "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_9,
- modifiers:{altKey:1, shiftKey:1}, chars:"("},
- "(", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // OEM keys
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_MINUS,
- modifiers:{}, chars:"-"},
- "-", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_MINUS,
- modifiers:{shiftKey:1}, chars:"_"},
- "_", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_MINUS,
- modifiers:{ctrlKey:1}, chars:""},
- "-", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_MINUS,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u001F"},
- "_", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_MINUS,
- modifiers:{altKey:1}, chars:"-"},
- "-", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_MINUS,
- modifiers:{altKey:1, shiftKey:1}, chars:"_"},
- "_", "Minus", nsIDOMKeyEvent.DOM_VK_HYPHEN_MINUS, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{}, chars:"="},
- "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{shiftKey:1}, chars:"+"},
- "+", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{ctrlKey:1}, chars:""},
- "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "+", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{altKey:1}, chars:"="},
- "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{altKey:1, shiftKey:1}, chars:"+"},
- "+", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_4,
- modifiers:{}, chars:"["},
- "[", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_4,
- modifiers:{shiftKey:1}, chars:"{"},
- "{", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_4,
- modifiers:{ctrlKey:1}, chars:"\u001B"},
- "[", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_4,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "{", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_4,
- modifiers:{altKey:1}, chars:"["},
- "[", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_4,
- modifiers:{altKey:1, shiftKey:1}, chars:"{"},
- "{", "BracketLeft", nsIDOMKeyEvent.DOM_VK_OPEN_BRACKET, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_6,
- modifiers:{}, chars:"]"},
- "]", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_6,
- modifiers:{shiftKey:1}, chars:"}"},
- "}", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_6,
- modifiers:{ctrlKey:1}, chars:"\u001D"},
- "]", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_6,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "}", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_6,
- modifiers:{altKey:1}, chars:"]"},
- "]", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_6,
- modifiers:{altKey:1, shiftKey:1}, chars:"}"},
- "}", "BracketRight", nsIDOMKeyEvent.DOM_VK_CLOSE_BRACKET, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1,
- modifiers:{}, chars:";"},
- ";", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1,
- modifiers:{shiftKey:1}, chars:":"},
- ":", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1,
- modifiers:{ctrlKey:1}, chars:""},
- ";", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- ":", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1,
- modifiers:{altKey:1}, chars:";"},
- ";", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1,
- modifiers:{altKey:1, shiftKey:1}, chars:":"},
- ":", "Semicolon", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7,
- modifiers:{}, chars:"'"},
- "'", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7,
- modifiers:{shiftKey:1}, chars:"\""},
- "\"", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7,
- modifiers:{ctrlKey:1}, chars:""},
- "'", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "\"", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7,
- modifiers:{altKey:1}, chars:"'"},
- "'", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7,
- modifiers:{altKey:1, shiftKey:1}, chars:"\""},
- "\"", "Quote", nsIDOMKeyEvent.DOM_VK_QUOTE, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_5,
- modifiers:{}, chars:"\\"},
- "\\", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_5,
- modifiers:{shiftKey:1}, chars:"|"},
- "|", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_5,
- modifiers:{ctrlKey:1}, chars:"\u001C"},
- "\\", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_5,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "|", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_5,
- modifiers:{altKey:1}, chars:"\\"},
- "\\", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_5,
- modifiers:{altKey:1, shiftKey:1}, chars:"|"},
- "|", "Backslash", nsIDOMKeyEvent.DOM_VK_BACK_SLASH, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_COMMA,
- modifiers:{}, chars:","},
- ",", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_COMMA,
- modifiers:{shiftKey:1}, chars:"<"},
- "<", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_COMMA,
- modifiers:{ctrlKey:1}, chars:""},
- ",", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_COMMA,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "<", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_COMMA,
- modifiers:{altKey:1}, chars:","},
- ",", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_COMMA,
- modifiers:{altKey:1, shiftKey:1}, chars:"<"},
- "<", "Comma", nsIDOMKeyEvent.DOM_VK_COMMA, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD,
- modifiers:{}, chars:"."},
- ".", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD,
- modifiers:{shiftKey:1}, chars:">"},
- ">", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD,
- modifiers:{ctrlKey:1}, chars:""},
- ".", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- ">", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD,
- modifiers:{altKey:1}, chars:"."},
- ".", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD,
- modifiers:{altKey:1, shiftKey:1}, chars:">"},
- ">", "Period", nsIDOMKeyEvent.DOM_VK_PERIOD, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_2,
- modifiers:{}, chars:"/"},
- "/", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_2,
- modifiers:{shiftKey:1}, chars:"?"},
- "?", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_2,
- modifiers:{ctrlKey:1}, chars:""},
- "/", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_2,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "?", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_2,
- modifiers:{altKey:1}, chars:"/"},
- "/", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_2,
- modifiers:{altKey:1, shiftKey:1}, chars:"?"},
- "?", "Slash", nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_3,
- modifiers:{}, chars:"`"},
- "`", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_3,
- modifiers:{shiftKey:1}, chars:"~"},
- "~", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "~", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_3,
- modifiers:{ctrlKey:1}, chars:""},
- "`", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_3,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "~", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "~", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_3,
- modifiers:{altKey:1}, chars:"`"},
- "`", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "`", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_3,
- modifiers:{altKey:1, shiftKey:1}, chars:"~"},
- "~", "Backquote", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "~", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Numpad
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD0,
- modifiers:{numLockKey:1}, chars:"0"},
- "0", "Numpad0", nsIDOMKeyEvent.DOM_VK_NUMPAD0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD1,
- modifiers:{numLockKey:1}, chars:"1"},
- "1", "Numpad1", nsIDOMKeyEvent.DOM_VK_NUMPAD1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD2,
- modifiers:{numLockKey:1}, chars:"2"},
- "2", "Numpad2", nsIDOMKeyEvent.DOM_VK_NUMPAD2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD3,
- modifiers:{numLockKey:1}, chars:"3"},
- "3", "Numpad3", nsIDOMKeyEvent.DOM_VK_NUMPAD3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD4,
- modifiers:{numLockKey:1}, chars:"4"},
- "4", "Numpad4", nsIDOMKeyEvent.DOM_VK_NUMPAD4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD5,
- modifiers:{numLockKey:1}, chars:"5"},
- "5", "Numpad5", nsIDOMKeyEvent.DOM_VK_NUMPAD5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD6,
- modifiers:{numLockKey:1}, chars:"6"},
- "6", "Numpad6", nsIDOMKeyEvent.DOM_VK_NUMPAD6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD7,
- modifiers:{numLockKey:1}, chars:"7"},
- "7", "Numpad7", nsIDOMKeyEvent.DOM_VK_NUMPAD7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD8,
- modifiers:{numLockKey:1}, chars:"8"},
- "8", "Numpad8", nsIDOMKeyEvent.DOM_VK_NUMPAD8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD9,
- modifiers:{numLockKey:1}, chars:"9"},
- "9", "Numpad9", nsIDOMKeyEvent.DOM_VK_NUMPAD9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_MULTIPLY,
- modifiers:{numLockKey:1}, chars:"*"},
- "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_MULTIPLY,
- modifiers:{numLockKey:1, shiftKey:1}, chars:"*"},
- "*", "NumpadMultiply", nsIDOMKeyEvent.DOM_VK_MULTIPLY, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ADD,
- modifiers:{numLockKey:1}, chars:"+"},
- "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_ADD,
- modifiers:{numLockKey:1, shiftKey:1}, chars:"+"},
- "+", "NumpadAdd", nsIDOMKeyEvent.DOM_VK_ADD, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- // VK_SEPARATOR is keycode for NEC's PC-98 series whose keyboard layout was
- // different from current PC's keyboard layout and it cannot connect to
- // current PC. Note that even if we synthesize WM_KEYDOWN with
- // VK_SEPARATOR, it doesn't work on Win7.
- //yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SEPARATOR,
- // modifiers:{numLockKey:1}, chars:""},
- // "", "", nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- //yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SEPARATOR,
- // modifiers:{numLockKey:1, shiftKey:1}, chars:""},
- // "", "", nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SUBTRACT,
- modifiers:{numLockKey:1}, chars:"-"},
- "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_SUBTRACT,
- modifiers:{numLockKey:1, shiftKey:1}, chars:"-"},
- "-", "NumpadSubtract", nsIDOMKeyEvent.DOM_VK_SUBTRACT, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DECIMAL,
- modifiers:{numLockKey:1}, chars:"."},
- ".", "NumpadDecimal", nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DECIMAL,
- modifiers:{numLockKey:1, shiftKey:1}, chars:"."},
- ".", "NumpadDecimal", nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DIVIDE,
- modifiers:{numLockKey:1}, chars:"/"},
- "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_DIVIDE,
- modifiers:{numLockKey:1, shiftKey:1}, chars:"/"},
- "/", "NumpadDivide", nsIDOMKeyEvent.DOM_VK_DIVIDE, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_RETURN,
- modifiers:{numLockKey:1}, chars:"\r"},
- "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_RETURN,
- modifiers:{numLockKey:1, shiftKey:1}, chars:"\r"},
- "Enter", "NumpadEnter", nsIDOMKeyEvent.DOM_VK_RETURN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
-
- // Numpad without NumLock
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_PRIOR,
- modifiers:{}, chars:""},
- "PageUp", "Numpad9", nsIDOMKeyEvent.DOM_VK_PAGE_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_NEXT,
- modifiers:{}, chars:""},
- "PageDown", "Numpad3", nsIDOMKeyEvent.DOM_VK_PAGE_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_END,
- modifiers:{}, chars:""},
- "End", "Numpad1", nsIDOMKeyEvent.DOM_VK_END, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_HOME,
- modifiers:{}, chars:""},
- "Home", "Numpad7", nsIDOMKeyEvent.DOM_VK_HOME, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_LEFT,
- modifiers:{}, chars:""},
- "ArrowLeft", "Numpad4", nsIDOMKeyEvent.DOM_VK_LEFT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_UP,
- modifiers:{}, chars:""},
- "ArrowUp", "Numpad8", nsIDOMKeyEvent.DOM_VK_UP, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_RIGHT,
- modifiers:{}, chars:""},
- "ArrowRight", "Numpad6", nsIDOMKeyEvent.DOM_VK_RIGHT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_DOWN,
- modifiers:{}, chars:""},
- "ArrowDown", "Numpad2", nsIDOMKeyEvent.DOM_VK_DOWN, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_INSERT,
- modifiers:{}, chars:""},
- "Insert", "Numpad0", nsIDOMKeyEvent.DOM_VK_INSERT, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_NUMPAD_DELETE,
- modifiers:{}, chars:""},
- "Delete", "NumpadDecimal", nsIDOMKeyEvent.DOM_VK_DELETE, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_CLEAR,
- modifiers:{}, chars:""},
- "Clear", "Numpad5", nsIDOMKeyEvent.DOM_VK_CLEAR, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
-
- // Even if widget receives unknown keycode, it should dispatch key events
- // whose keycode is 0 rather than native keycode.
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:0x3A,
- modifiers:{numLockKey:1}, chars:""},
- "Unidentified", "", 0, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // French
- // Numeric
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0,
- modifiers:{}, chars:"\u00E0"},
- "\u00E0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0,
- modifiers:{shiftKey:1}, chars:"0"},
- "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1,
- modifiers:{}, chars:"&"},
- "&", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1,
- modifiers:{shiftKey:1}, chars:"1"},
- "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2,
- modifiers:{}, chars:"\u00E9"},
- "\u00E9", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2,
- modifiers:{shiftKey:1}, chars:"2"},
- "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3,
- modifiers:{}, chars:"\""},
- "\"", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3,
- modifiers:{shiftKey:1}, chars:"3"},
- "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4,
- modifiers:{}, chars:"'"},
- "'", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4,
- modifiers:{shiftKey:1}, chars:"4"},
- "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5,
- modifiers:{}, chars:"("},
- "(", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5,
- modifiers:{shiftKey:1}, chars:"5"},
- "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6,
- modifiers:{}, chars:"-"},
- "-", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6,
- modifiers:{shiftKey:1}, chars:"6"},
- "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7,
- modifiers:{}, chars:"\u00E8"},
- "\u00E8", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7,
- modifiers:{shiftKey:1}, chars:"7"},
- "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8,
- modifiers:{}, chars:"_"},
- "_", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8,
- modifiers:{shiftKey:1}, chars:"8"},
- "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9,
- modifiers:{}, chars:"\u00E7"},
- "\u00E7", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9,
- modifiers:{shiftKey:1}, chars:"9"},
- "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Numeric with ShiftLock
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0,
- modifiers:{capsLockKey:1}, chars:"0"},
- "0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E0"},
- "\u00E0", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1,
- modifiers:{capsLockKey:1}, chars:"1"},
- "1", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"&"},
- "&", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2,
- modifiers:{capsLockKey:1}, chars:"2"},
- "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E9"},
- "\u00E9", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u00E9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3,
- modifiers:{capsLockKey:1}, chars:"3"},
- "3", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"\""},
- "\"", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "\"", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4,
- modifiers:{capsLockKey:1}, chars:"4"},
- "4", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"'"},
- "'", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5,
- modifiers:{capsLockKey:1}, chars:"5"},
- "5", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"("},
- "(", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "(", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6,
- modifiers:{capsLockKey:1}, chars:"6"},
- "6", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "6", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"-"},
- "-", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "-", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7,
- modifiers:{capsLockKey:1}, chars:"7"},
- "7", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E8"},
- "\u00E8", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "\u00E8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8,
- modifiers:{capsLockKey:1}, chars:"8"},
- "8", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"_"},
- "_", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "_", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9,
- modifiers:{capsLockKey:1}, chars:"9"},
- "9", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00E7"},
- "\u00E7", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "\u00E7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // OEM keys
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7,
- modifiers:{}, chars:"\u00B2"},
- "\u00B2", "Backquote", 0, "\u00B2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7,
- modifiers:{shiftKey:1}, chars:""},
- "", "Backquote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4,
- modifiers:{}, chars:")"},
- ")", "Minus", nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4,
- modifiers:{shiftKey:1}, chars:"\u00B0"},
- "\u00B0", "Minus", nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "\u00B0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{}, chars:"="},
- "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{shiftKey:1}, chars:"+"},
- "+", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- // modifiers:{}, chars:""},
- // "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key
- //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- // modifiers:{shiftKey:1}, chars:""},
- // ["^^", "^", "^", "^"], "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1,
- modifiers:{}, chars:"$"},
- "$", "BracketRight", nsIDOMKeyEvent.DOM_VK_DOLLAR, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1,
- modifiers:{shiftKey:1}, chars:"\u00A3"},
- "\u00A3", "BracketRight", nsIDOMKeyEvent.DOM_VK_DOLLAR, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3,
- modifiers:{}, chars:"\u00F9"},
- "\u00F9", "Quote", nsIDOMKeyEvent.DOM_VK_PERCENT, "\u00F9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3,
- modifiers:{shiftKey:1}, chars:"%"},
- "%", "Quote", nsIDOMKeyEvent.DOM_VK_PERCENT, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5,
- modifiers:{}, chars:"*"},
- "*", "Backslash", nsIDOMKeyEvent.DOM_VK_ASTERISK, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5,
- modifiers:{shiftKey:1}, chars:"\u00B5"},
- "\u00B5", "Backslash", nsIDOMKeyEvent.DOM_VK_ASTERISK, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102,
- modifiers:{}, chars:"<"},
- "<", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_LESS_THAN, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102,
- modifiers:{shiftKey:1}, chars:">"},
- ">", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_LESS_THAN, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA,
- modifiers:{}, chars:","},
- ",", "KeyM", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA,
- modifiers:{shiftKey:1}, chars:"?"},
- "?", "KeyM", nsIDOMKeyEvent.DOM_VK_COMMA, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD,
- modifiers:{}, chars:";"},
- ";", "Comma", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD,
- modifiers:{shiftKey:1}, chars:"."},
- ".", "Comma", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2,
- modifiers:{}, chars:":"},
- ":", "Period", nsIDOMKeyEvent.DOM_VK_COLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2,
- modifiers:{shiftKey:1}, chars:"/"},
- "/", "Period", nsIDOMKeyEvent.DOM_VK_COLON, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8,
- modifiers:{}, chars:"!"},
- "!", "Slash", nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8,
- modifiers:{shiftKey:1}, chars:"\u00A7"},
- "\u00A7", "Slash", nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // OEM keys with ShiftLock
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7,
- modifiers:{capsLockKey:1}, chars:"\u00B2"},
- "\u00B2", "Backquote", 0, "\u00B2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_7,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:""},
- "", "Backquote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4,
- modifiers:{capsLockKey:1}, chars:"\u00B0"},
- "\u00B0", "Minus", nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "\u00B0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:")"},
- ")", "Minus", nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, ")", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{capsLockKey:1}, chars:"+"},
- "+", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "+", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"="},
- "=", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "=", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- // modifiers:{capsLockKey:1}, chars:""},
- // "Dead", "BracketLeft", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key
- //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- // modifiers:{capsLockKey:1, shiftKey:1}, chars:""},
- // ["\u00A8\u00A8", "\u00A8", "\u00A8", "\u00A8"], "BracketLeft", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1,
- modifiers:{capsLockKey:1}, chars:"\u00A3"},
- "\u00A3", "BracketRight", nsIDOMKeyEvent.DOM_VK_DOLLAR, "\u00A3", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_1,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"$"},
- "$", "BracketRight", nsIDOMKeyEvent.DOM_VK_DOLLAR, "$", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3,
- modifiers:{capsLockKey:1}, chars:"%"},
- "%", "Quote", nsIDOMKeyEvent.DOM_VK_PERCENT, "%", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_3,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"\u00F9"},
- "\u00F9", "Quote", nsIDOMKeyEvent.DOM_VK_PERCENT, "\u00F9", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5,
- modifiers:{capsLockKey:1}, chars:"\u00B5"},
- "\u00B5", "Backslash", nsIDOMKeyEvent.DOM_VK_ASTERISK, "\u00B5", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_5,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"*"},
- "*", "Backslash", nsIDOMKeyEvent.DOM_VK_ASTERISK, "*", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102,
- modifiers:{capsLockKey:1}, chars:"<"},
- "<", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_LESS_THAN, "<", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_102,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:">"},
- ">", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_LESS_THAN, ">", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA,
- modifiers:{capsLockKey:1}, chars:"?"},
- "?", "KeyM", nsIDOMKeyEvent.DOM_VK_COMMA, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_COMMA,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:","},
- ",", "KeyM", nsIDOMKeyEvent.DOM_VK_COMMA, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD,
- modifiers:{capsLockKey:1}, chars:"."},
- ".", "Comma", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PERIOD,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:";"},
- ";", "Comma", nsIDOMKeyEvent.DOM_VK_SEMICOLON, ";", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2,
- modifiers:{capsLockKey:1}, chars:"/"},
- "/", "Period", nsIDOMKeyEvent.DOM_VK_COLON, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_2,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:":"},
- ":", "Period", nsIDOMKeyEvent.DOM_VK_COLON, ":", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8,
- modifiers:{capsLockKey:1}, chars:"\u00A7"},
- "\u00A7", "Slash", nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_8,
- modifiers:{capsLockKey:1, shiftKey:1}, chars:"!"},
- "!", "Slash", nsIDOMKeyEvent.DOM_VK_EXCLAMATION, "!", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // AltGr
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_0,
- modifiers:{altGrKey:1}, chars:"@"},
- "@", "Digit0", nsIDOMKeyEvent.DOM_VK_0, "@", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_1,
- modifiers:{altGrKey:1}, chars:""},
- "&", "Digit1", nsIDOMKeyEvent.DOM_VK_1, "&", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_2,
- // modifiers:{altGrKey:1}, chars:""},
- // "Dead", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_3,
- modifiers:{altGrKey:1}, chars:"#"},
- "#", "Digit3", nsIDOMKeyEvent.DOM_VK_3, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_4,
- modifiers:{altGrKey:1}, chars:"{"},
- "{", "Digit4", nsIDOMKeyEvent.DOM_VK_4, "{", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_5,
- modifiers:{altGrKey:1}, chars:"["},
- "[", "Digit5", nsIDOMKeyEvent.DOM_VK_5, "[", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_6,
- modifiers:{altGrKey:1}, chars:"|"},
- "|", "Digit6", nsIDOMKeyEvent.DOM_VK_6, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- //yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_7,
- // modifiers:{altGrKey:1}, chars:""},
- // "Dead", "Digit7", nsIDOMKeyEvent.DOM_VK_7, "", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD); // Dead-key
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_8,
- modifiers:{altGrKey:1}, chars:"\\"},
- "\\", "Digit8", nsIDOMKeyEvent.DOM_VK_8, "\\", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_9,
- modifiers:{altGrKey:1}, chars:"^"},
- "^", "Digit9", nsIDOMKeyEvent.DOM_VK_9, "^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_4,
- modifiers:{altGrKey:1}, chars:"]"},
- "]", "Minus", nsIDOMKeyEvent.DOM_VK_CLOSE_PAREN, "]", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{altGrKey:1}, chars:"}"},
- "}", "Equal", nsIDOMKeyEvent.DOM_VK_EQUALS, "}", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // German
- yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:WIN_VK_OEM_2,
- modifiers:{}, chars:"#"},
- "#", "Backslash", nsIDOMKeyEvent.DOM_VK_HASH, "#", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:WIN_VK_OEM_2,
- modifiers:{shiftKey:1}, chars:"'"},
- "'", "Backslash", nsIDOMKeyEvent.DOM_VK_HASH, "'", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Khmer
- if (OS_VERSION >= WIN7) {
- yield testKey({layout:KEYBOARD_LAYOUT_KHMER, keyCode:WIN_VK_2,
- modifiers:{}, chars:"\u17E2"},
- "\u17E2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u17E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_KHMER, keyCode:WIN_VK_2,
- modifiers:{shiftKey:1}, chars:"\u17D7"},
- "\u17D7", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u17D7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_KHMER, keyCode:WIN_VK_2, // Ctrl+2 should cause inputting Euro sign.
- modifiers:{ctrlKey:1}, chars:"\u20AC", isInputtingCharacters:true},
- "\u20AC", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u20AC", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_KHMER, keyCode:WIN_VK_2, // Ctrl+Shift+2 shouldn't cause any input.
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "\u17D7", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u17D7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_KHMER, keyCode:WIN_VK_2,
- modifiers:{altKey:1}, chars:"\u17E2"},
- "\u17E2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u17E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_KHMER, keyCode:WIN_VK_2,
- modifiers:{altKey:1, shiftKey:1}, chars:"\u17D7"},
- "\u17D7", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u17D7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_KHMER, keyCode:WIN_VK_2,
- modifiers:{altGrKey:1}, chars:"2"},
- "2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_KHMER, keyCode:WIN_VK_2,
- modifiers:{altGrKey:1, shiftKey:1}, chars:"\u19E2"},
- "\u19E2", "Digit2", nsIDOMKeyEvent.DOM_VK_2, "\u19E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- }
-
- // Norwegian
- yield testKey({layout:KEYBOARD_LAYOUT_NORWEGIAN, keyCode:WIN_VK_OEM_5,
- modifiers:{}, chars:"|"},
- "|", "Backquote", nsIDOMKeyEvent.DOM_VK_PIPE, "|", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_NORWEGIAN, keyCode:WIN_VK_OEM_5,
- modifiers:{shiftKey:1}, chars:"\u00A7"},
- "\u00A7", "Backquote", nsIDOMKeyEvent.DOM_VK_PIPE, "\u00A7", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- // Brazilian ABNT
- yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C1,
- modifiers:{}, chars:"/"},
- "/", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_SLASH, "/", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C1,
- modifiers:{shiftKey:1}, chars:"?"},
- "?", "IntlBackslash", nsIDOMKeyEvent.DOM_VK_SLASH, "?", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_ABNT_C2,
- modifiers:{numLockKey:1}, chars:"."},
- ".", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_BRAZILIAN_ABNT, keyCode:WIN_VK_DECIMAL,
- modifiers:{numLockKey:1}, chars:","},
- ",", "NumpadDecimal", nsIDOMKeyEvent.DOM_VK_DECIMAL, ",", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
-
- // Mac JIS keyboard
- // The separator key on JIS keyboard for Mac doesn't cause any character even with Japanese keyboard layout.
- yield testKey({layout:KEYBOARD_LAYOUT_JAPANESE, keyCode:WIN_VK_ABNT_C2,
- modifiers:{numLockKey:1}, chars:""},
- "", "NumpadComma", nsIDOMKeyEvent.DOM_VK_SEPARATOR, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
- yield testKey({layout:KEYBOARD_LAYOUT_JAPANESE, keyCode:WIN_VK_DECIMAL,
- modifiers:{numLockKey:1}, chars:"."},
- ".", "NumpadDecimal", nsIDOMKeyEvent.DOM_VK_DECIMAL, ".", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_NUMPAD);
-
- // Dead keys on any layouts
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- modifiers:{}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- modifiers:{}, chars:"^^"},
- ["^^", "^", "^", "^"], "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "^^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- modifiers:{}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A,
- modifiers:{}, chars:"\u00E2"},
- ["\u00E2", "\u00E2", "a"], "KeyQ", nsIDOMKeyEvent.DOM_VK_A, "\u00E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- modifiers:{}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1}, chars:"\u00C2"},
- ["\u00C2", "\u00C2", "A"], "KeyQ", nsIDOMKeyEvent.DOM_VK_A, "\u00C2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- modifiers:{}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_Q,
- modifiers:{}, chars:"^q"},
- ["^q", "^", "q", "q"], "KeyA", nsIDOMKeyEvent.DOM_VK_Q, "^q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- modifiers:{shiftKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- modifiers:{shiftKey:1}, chars:"\u00A8\u00A8"},
- ["\u00A8\u00A8", "\u00A8", "\u00A8", "\u00A8"], "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "\u00A8\u00A8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- modifiers:{shiftKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1}, chars:"\u00C4"},
- ["\u00C4", "\u00C4", "A"], "KeyQ", nsIDOMKeyEvent.DOM_VK_A, "\u00C4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- modifiers:{shiftKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_A,
- modifiers:{}, chars:"\u00E4"},
- ["\u00E4", "\u00E4", "a"], "KeyQ", nsIDOMKeyEvent.DOM_VK_A, "\u00E4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_OEM_6,
- modifiers:{shiftKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_CIRCUMFLEX, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_FRENCH, keyCode:WIN_VK_Q,
- modifiers:{shiftKey:1}, chars:"\u00A8Q"},
- ["\u00A8Q", "\u00A8", "Q", "Q"], "KeyA", nsIDOMKeyEvent.DOM_VK_Q, "\u00A8Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{}, chars:"``"},
- ["``", "`", "`", "`"], "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "``", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A,
- modifiers:{}, chars:"\u00E0"},
- ["\u00E0", "\u00E0", "a"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1}, chars:"\u00C0"},
- ["\u00C0", "\u00C0", "A"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00C0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q,
- modifiers:{}, chars:"`q"},
- ["`q", "`", "q", "q"], "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "`q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{shiftKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{shiftKey:1}, chars:"^^"},
- ["^^", "^", "^", "^"], "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "^^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{shiftKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1}, chars:"\u00C2"},
- ["\u00C2", "\u00C2", "A"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00C2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{shiftKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A,
- modifiers:{}, chars:"\u00E2"},
- ["\u00E2", "\u00E2", "a"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{shiftKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q,
- modifiers:{shiftKey:1}, chars:"^Q"},
- ["^Q", "^", "Q", "Q"], "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "^Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7,
- modifiers:{}, chars:""},
- "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7,
- modifiers:{}, chars:"\u00B4\u00B4"},
- ["\u00B4\u00B4", "\u00B4", "\u00B4", "\u00B4"], "Quote", 0, "\u00B4\u00B4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7,
- modifiers:{}, chars:""},
- "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A,
- modifiers:{}, chars:"\u00E1"},
- ["\u00E1", "\u00E1", "a"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00E1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7,
- modifiers:{}, chars:""},
- "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1}, chars:"\u00C1"},
- ["\u00C1", "\u00C1", "A"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00C1", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7,
- modifiers:{}, chars:""},
- "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q,
- modifiers:{}, chars:"\u00B4q"},
- ["\u00B4q", "\u00B4", "q", "q"], "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "\u00B4q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7,
- modifiers:{shiftKey:1}, chars:""},
- "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7,
- modifiers:{shiftKey:1}, chars:"\u00A8\u00A8"},
- ["\u00A8\u00A8", "\u00A8", "\u00A8", "\u00A8"], "Quote", 0, "\u00A8\u00A8", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7,
- modifiers:{shiftKey:1}, chars:""},
- "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1}, chars:"\u00C4"},
- ["\u00C4", "\u00C4", "A"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00C4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7,
- modifiers:{shiftKey:1}, chars:""},
- "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A,
- modifiers:{}, chars:"\u00E4"},
- ["\u00E4", "\u00E4", "a"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00E4", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_7,
- modifiers:{shiftKey:1}, chars:""},
- "Dead", "Quote", 0, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q,
- modifiers:{shiftKey:1}, chars:"\u00A8Q"},
- ["\u00A8Q", "\u00A8", "Q", "Q"], "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "\u00A8Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- if (OS_VERSION >= WIN8) {
- // On Russian Mnemonic layout, both 'KeyS' and 'KeyC' are dead key. However, the sequence 'KeyS' -> 'KeyC' causes a composite character.
- yield testKey({layout:KEYBOARD_LAYOUT_RUSSIAN_MNEMONIC, keyCode:WIN_VK_S,
- modifiers:{}, chars:""},
- "Dead", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_RUSSIAN_MNEMONIC, keyCode:WIN_VK_S,
- modifiers:{}, chars:"\u0441\u0441"},
- ["\u0441\u0441", "\u0441", "\u0441", "\u0441"], "KeyS", nsIDOMKeyEvent.DOM_VK_S, "\u0441\u0441", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_RUSSIAN_MNEMONIC, keyCode:WIN_VK_C,
- modifiers:{}, chars:""},
- "Dead", "KeyC", nsIDOMKeyEvent.DOM_VK_C, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_RUSSIAN_MNEMONIC, keyCode:WIN_VK_C,
- modifiers:{}, chars:"\u0446\u0446"},
- ["\u0446\u0446", "\u0446", "\u0446", "\u0446"], "KeyC", nsIDOMKeyEvent.DOM_VK_C, "\u0446\u0446", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_RUSSIAN_MNEMONIC, keyCode:WIN_VK_S,
- modifiers:{}, chars:""},
- "Dead", "KeyS", nsIDOMKeyEvent.DOM_VK_S, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_RUSSIAN_MNEMONIC, keyCode:WIN_VK_C,
- modifiers:{}, chars:"\u0449"},
- ["\u0449", "\u0449", "\u0446"], "KeyC", nsIDOMKeyEvent.DOM_VK_C, "\u0449", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- }
-
- // When Alt key is pressed, dead key sequence is generated with WM_SYSKEYDOWN, WM_SYSDEADCHAR, WM_SYSCHAR and WM_SYSKEYUP.
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{altKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{altKey:1}, chars:"``"},
- ["``", "`", "`", "`"], "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "``", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{altKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A,
- modifiers:{altKey:1}, chars:"\u00E0"},
- ["\u00E0", "\u00E0", "a"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00E0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{altKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A,
- modifiers:{altKey:1, shiftKey:1}, chars:"\u00C0"},
- ["\u00C0", "\u00C0", "A"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00C0", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{altKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q,
- modifiers:{altKey:1}, chars:"`q"},
- ["`q", "`", "q", "q"], "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "`q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{altKey:1, shiftKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{altKey:1, shiftKey:1}, chars:"^^"},
- ["^^", "^", "^", "^"], "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "^^", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{altKey:1, shiftKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A,
- modifiers:{altKey:1, shiftKey:1}, chars:"\u00C2"},
- ["\u00C2", "\u00C2", "A"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00C2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{altKey:1, shiftKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_A,
- modifiers:{altKey:1}, chars:"\u00E2"},
- ["\u00E2", "\u00E2", "a"], "KeyA", nsIDOMKeyEvent.DOM_VK_A, "\u00E2", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_OEM_1,
- modifiers:{altKey:1, shiftKey:1}, chars:""},
- "Dead", "BracketLeft", nsIDOMKeyEvent.DOM_VK_BACK_QUOTE, "", SHOULD_DELIVER_KEYDOWN_KEYUP, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
- yield testKey({layout:KEYBOARD_LAYOUT_SPANISH, keyCode:WIN_VK_Q,
- modifiers:{altKey:1, shiftKey:1}, chars:"^Q"},
- ["^Q", "^", "Q", "Q"], "KeyQ", nsIDOMKeyEvent.DOM_VK_Q, "^Q", SHOULD_DELIVER_ALL, KeyboardEvent.DOM_KEY_LOCATION_STANDARD);
-
- cleanup();
- }
-
-
- if (IS_WIN) {
- yield* testKeysOnWindows();
- } else if (IS_MAC) {
- yield* testKeysOnMac();
- } else {
- cleanup();
- }
-}
-
-// Test the activation (or not) of an HTML accesskey
-function* runAccessKeyTests()
-{
- var button = document.getElementById("button");
- var activationCount;
-
- function onClick(e)
- {
- ++activationCount;
- }
-
- // The first parameter is the complete input event. The second and third parameters are
- // what to test against.
- function testKey(aEvent, aAccessKey, aShouldActivate)
- {
- activationCount = 0;
- button.setAttribute("accesskey", aAccessKey);
-
- return synthesizeKey(aEvent, "button", function() {
-
- var name = eventToString(aEvent);
-
- is(activationCount, aShouldActivate ? 1 : 0, name + ", activating '" + aAccessKey + "'");
-
- continueTest();
- });
- }
-
- button.addEventListener("click", onClick, false);
-
- // These tests have to be per-plaform.
- if (IS_MAC) {
- // Basic sanity checks
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{}, chars:"a", unmodifiedChars:"a"},
- "a", false);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"},
- "a", false);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1}, chars:"\u0001", unmodifiedChars:"a"},
- "A", false);
-
- // Shift-ctrl does not activate accesskeys
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"A"},
- "a", false);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0001", unmodifiedChars:"A"},
- "A", false);
- // Alt-ctrl activate accesskeys
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"a"},
- "a", true);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"a"},
- "A", true);
-
- // Greek layout can activate a Latin accesskey
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"},
- "a", true);
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"},
- "A", true);
- // ... and a Greek accesskey!
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"},
- "\u03b1", true);
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1, altKey:1}, chars:"\u0001", unmodifiedChars:"\u03b1"},
- "\u0391", true);
-
- // bug 359638
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Period,
- modifiers:{ctrlKey:1, altKey:1}, chars:".", unmodifiedChars:"."},
- ".", true);
-
- // German (KCHR/KeyTranslate case)
- yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1, altKey:1}, chars:"a", unmodifiedChars:"a"},
- "a", true);
- yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_A,
- modifiers:{ctrlKey:1, altKey:1}, chars:"a", unmodifiedChars:"a"},
- "A", true);
- yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_LeftBracket,
- modifiers:{ctrlKey:1, altKey:1}, chars:"\u00fc", unmodifiedChars:"\u00fc"},
- "\u00fc", true);
- yield testKey({layout:KEYBOARD_LAYOUT_GERMAN, keyCode:MAC_VK_ANSI_LeftBracket,
- modifiers:{ctrlKey:1, altKey:1}, chars:"\u00fc", unmodifiedChars:"\u00fc"},
- "\u00dc", true);
- }
- else if (IS_WIN) {
- // Basic sanity checks
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{}, chars:"a"},
- "a", false);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1, altKey:1}, chars:"A"},
- "a", true);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1, altKey:1}, chars:"A"},
- "A", true);
-
- // shift-alt-ctrl does not activate accesskeys
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{ctrlKey:1, shiftKey:1, altKey:1}, chars:""},
- "a", false);
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{ctrlKey:1, shiftKey:1, altKey:1}, chars:""},
- "A", false);
-
- // Greek layout can activate a Latin accesskey
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1, altKey:1}, chars:"\u0391"},
- "a", true);
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1, altKey:1}, chars:"\u0391"},
- "A", true);
- // ... and a Greek accesskey!
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1, altKey:1}, chars:"\u0391"},
- "\u03b1", true);
- yield testKey({layout:KEYBOARD_LAYOUT_GREEK, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1, altKey:1}, chars:"\u0391"},
- "\u0391", true);
-
- // bug 359638
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_PERIOD,
- modifiers:{shiftKey:1, altKey:1}, chars:".", unmodifiedChars:"."},
- ".", true);
- }
-
- button.removeEventListener("click", onClick, false);
-}
-
-function* runXULKeyTests()
-{
- var commandElements = {
- expectedCommand: document.getElementById("expectedCommand"),
- unexpectedCommand: document.getElementById("unexpectedCommand"),
- expectedReservedCommand: document.getElementById("expectedReservedCommand")
- };
- // Enable all command elements.
- for (var id in commandElements) {
- commandElements[id].removeAttribute("disabled");
- }
-
- var keyEvents = [];
-
- function onKeyInDefaultEventGroup(aDOMEvent)
- {
- if (isModifierKeyEvent(aDOMEvent)) {
- return;
- }
- keyEvents.push({ type: aDOMEvent.type, group: "default", phase: getPhase(aDOMEvent), currentTarget: eventTargetToString(aDOMEvent.currentTarget) });
- }
-
- function onKeyInSystemEventGroup(aDOMEvent)
- {
- if (isModifierKeyEvent(aDOMEvent)) {
- return;
- }
- keyEvents.push({ type: aDOMEvent.type, group: "system", phase: getPhase(aDOMEvent), currentTarget: eventTargetToString(aDOMEvent.currentTarget) });
- }
-
- var buttonParent = document.getElementById("button").parentNode;
- buttonParent.addEventListener("keydown", onKeyInDefaultEventGroup, true);
- buttonParent.addEventListener("keypress", onKeyInDefaultEventGroup, true);
- buttonParent.addEventListener("keydown", onKeyInDefaultEventGroup, false);
- buttonParent.addEventListener("keypress", onKeyInDefaultEventGroup, false);
- SpecialPowers.addSystemEventListener(buttonParent, "keydown", onKeyInSystemEventGroup, true);
- SpecialPowers.addSystemEventListener(buttonParent, "keypress", onKeyInSystemEventGroup, true);
- SpecialPowers.addSystemEventListener(buttonParent, "keydown", onKeyInSystemEventGroup, false);
- SpecialPowers.addSystemEventListener(buttonParent, "keypress", onKeyInSystemEventGroup, false);
-
- function finializeKeyElementTest()
- {
- buttonParent.removeEventListener("keydown", onKeyInDefaultEventGroup, true);
- buttonParent.removeEventListener("keypress", onKeyInDefaultEventGroup, true);
- buttonParent.removeEventListener("keydown", onKeyInDefaultEventGroup, false);
- buttonParent.removeEventListener("keypress", onKeyInDefaultEventGroup, false);
- SpecialPowers.removeSystemEventListener(buttonParent, "keydown", onKeyInSystemEventGroup, true);
- SpecialPowers.removeSystemEventListener(buttonParent, "keypress", onKeyInSystemEventGroup, true);
- SpecialPowers.removeSystemEventListener(buttonParent, "keydown", onKeyInSystemEventGroup, false);
- SpecialPowers.removeSystemEventListener(buttonParent, "keypress", onKeyInSystemEventGroup, false);
- }
-
- // If aKeyElement is empty string, this function tests if the event kicks
- // no key elements.
- function testKeyElement(aEvent, aKeyElementId)
- {
- var testName = "testKeyElement (with non-reserved command element): " + eventToString(aEvent) + " ";
- var keyElement = aKeyElementId == "" ? null : document.getElementById(aKeyElementId);
- if (keyElement) {
- keyElement.setAttribute("command", "expectedCommand");
- }
-
- for (var id in commandElements) {
- commandElements[id].activeCount = 0;
- }
-
- keyEvents = [];
- return synthesizeKey(aEvent, "button", function() {
- if (keyElement) {
- is(commandElements["expectedCommand"].activeCount, 1, testName + "the command element (id='expectedCommand') should be preformed");
- } else {
- is(commandElements["expectedCommand"].activeCount, 0, testName + "the command element (id='expectedCommand') shouldn't be preformed");
- }
- is(commandElements["unexpectedCommand"].activeCount, 0, testName + "the command element (id='unexpectedCommand') shouldn't be preformed");
- is(commandElements["expectedReservedCommand"].activeCount, 0, testName + "the command element (id='expectedReservedCommand') shouldn't be preformed");
-
- function checkFiredEvents()
- {
- is(keyEvents.length, 8, testName + "wrong number events fired");
- is(JSON.stringify(keyEvents[0]), JSON.stringify({ type: "keydown", group: "default", phase: "capture", currentTarget: eventTargetToString(buttonParent) }), testName + "keydown event should be fired on chrome in the default event group #0");
- is(JSON.stringify(keyEvents[1]), JSON.stringify({ type: "keydown", group: "default", phase: "bubble", currentTarget: eventTargetToString(buttonParent) }), testName + "keydown event should be fired on chrome in the default event group #1");
-
- is(JSON.stringify(keyEvents[2]), JSON.stringify({ type: "keydown", group: "system", phase: "capture", currentTarget: eventTargetToString(buttonParent) }), testName + "keydown event should be fired on chrome in the system event group #2");
- is(JSON.stringify(keyEvents[3]), JSON.stringify({ type: "keydown", group: "system", phase: "bubble", currentTarget: eventTargetToString(buttonParent) }), testName + "keydown event should be fired on chrome in the system event group #3");
-
- is(JSON.stringify(keyEvents[4]), JSON.stringify({ type: "keypress", group: "default", phase: "capture", currentTarget: eventTargetToString(buttonParent) }), testName + "keypress event should be fired on chrome in the default event group #4");
- is(JSON.stringify(keyEvents[5]), JSON.stringify({ type: "keypress", group: "default", phase: "bubble", currentTarget: eventTargetToString(buttonParent) }), testName + "keypress event should be fired on chrome in the default event group #5");
-
- is(JSON.stringify(keyEvents[6]), JSON.stringify({ type: "keypress", group: "system", phase: "capture", currentTarget: eventTargetToString(buttonParent) }), testName + "keypress event should be fired on chrome in the system event group #6");
- is(JSON.stringify(keyEvents[7]), JSON.stringify({ type: "keypress", group: "system", phase: "bubble", currentTarget: eventTargetToString(buttonParent) }), testName + "keypress event should be fired on chrome in the system event group #7");
- }
-
- checkFiredEvents();
-
- if (keyElement) {
- testName = "testKeyElement (with reserved command element): " + eventToString(aEvent) + " ";
- keyElement.setAttribute("command", "expectedReservedCommand");
-
- for (id in commandElements) {
- commandElements[id].activeCount = 0;
- }
- keyEvents = [];
- synthesizeKey(aEvent, "button", function() {
- is(commandElements["expectedCommand"].activeCount, 0, testName + "the command element (id='expectedCommand') shouldn't be preformed");
- is(commandElements["unexpectedCommand"].activeCount, 0, testName + "the command element (id='unexpectedCommand') shouldn't be preformed");
- is(commandElements["expectedReservedCommand"].activeCount, 1, testName + "the command element (id='expectedReservedCommand') should be preformed");
-
- checkFiredEvents();
-
- if (keyElement) {
- keyElement.setAttribute("command", "unexpectedCommand");
- }
- continueTest();
- });
- } else {
- if (keyElement) {
- keyElement.setAttribute("command", "unexpectedCommand");
- }
- continueTest();
- }
- });
- }
-
- if (IS_MAC) {
- yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon,
- modifiers:{metaKey:1}, chars:";", unmodifiedChars:";"},
- "unshiftedKey");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Semicolon,
- modifiers:{metaKey:1, shiftKey:1}, chars:";", unmodifiedChars:":"},
- "shiftedKey");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote,
- modifiers:{metaKey:1}, chars:"'", unmodifiedChars:"'"},
- "reservedUnshiftedKey");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_Quote,
- modifiers:{metaKey:1, shiftKey:1}, chars:"\"", unmodifiedChars:"'"},
- "reservedShiftedKey");
- }
- else if (IS_WIN) {
- yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1,
- modifiers:{ctrlKey:1}, chars:""},
- "unshiftedKey");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_1,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "shiftedKey");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7,
- modifiers:{ctrlKey:1}, chars:""},
- "reservedUnshiftedKey");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_OEM_7,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "reservedShiftedKey");
- }
-
- // 429160
- if (IS_MAC) {
- yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_F,
- modifiers:{metaKey:1, altKey:1}, chars:"\u0192", unmodifiedChars:"f"},
- "commandOptionF");
- }
- else if (IS_WIN) {
- yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_F,
- modifiers:{ctrlKey:1, altKey:1}, chars:"\u0006"},
- "commandOptionF");
- }
-
- // 432112
- if (IS_MAC) {
- yield testKeyElement({layout:KEYBOARD_LAYOUT_SWEDISH, keyCode:MAC_VK_ANSI_Minus,
- modifiers:{metaKey:1, shiftKey:1}, chars:"+", unmodifiedChars:"?"},
- "question");
- }
- else if (IS_WIN) {
- yield testKeyElement({layout:KEYBOARD_LAYOUT_SWEDISH, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "question");
- // For testing if Ctrl+? is kicked without Shift state, temporarily disable
- // Ctrl-+ key element.
- var unshiftedPlusKeyElement = document.getElementById("unshiftedPlus");
- unshiftedPlusKeyElement.setAttribute("disabled", "true");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_SWEDISH, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{ctrlKey:1}, chars:""},
- "");
- unshiftedPlusKeyElement.removeAttribute("disabled");
- }
-
- // bug 433192
- if (IS_WIN) {
- yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X,
- modifiers:{ctrlKey:1}, chars:"\u0018"},
- "unshiftedX");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_X,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"},
- "shiftedX");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_ARABIC, keyCode:WIN_VK_X,
- modifiers:{ctrlKey:1}, chars:"\u0018"},
- "unshiftedX");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_ARABIC, keyCode:WIN_VK_X,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"},
- "shiftedX");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_HEBREW, keyCode:WIN_VK_X,
- modifiers:{ctrlKey:1}, chars:"\u0018"},
- "unshiftedX");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_HEBREW, keyCode:WIN_VK_X,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:"\u0018"},
- "shiftedX");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_JAPANESE, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "unshiftedPlus");
- }
-
- // bug 759346
- if (IS_WIN) {
- yield testKeyElement({layout:KEYBOARD_LAYOUT_THAI, keyCode:WIN_VK_1,
- modifiers:{ctrlKey:1}, chars:""},
- "");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_THAI, keyCode:WIN_VK_1,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "unshiftedPlus");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_THAI, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{ctrlKey:1}, chars:""},
- "unshiftedPlus");
- yield testKeyElement({layout:KEYBOARD_LAYOUT_THAI, keyCode:WIN_VK_OEM_PLUS,
- modifiers:{ctrlKey:1, shiftKey:1}, chars:""},
- "");
- }
-
- for (id in commandElements) {
- commandElements[id].setAttribute("disabled", "true");
- }
- finializeKeyElementTest();
-}
-
-function* runReservedKeyTests()
-{
- var browser = document.getElementById("browser");
- var contents = [
- browser.contentWindow,
- browser.contentDocument,
- browser.contentDocument.documentElement,
- browser.contentDocument.body,
- browser.contentDocument.getElementById("content_button")
- ];
-
- for (var i = 0; i < contents.length; i++) {
- contents[i].addEventListener("keydown", onKeyInDefaultEventGroup, true);
- contents[i].addEventListener("keypress", onKeyInDefaultEventGroup, true);
- contents[i].addEventListener("keydown", onKeyInDefaultEventGroup, false);
- contents[i].addEventListener("keypress", onKeyInDefaultEventGroup, false);
- SpecialPowers.addSystemEventListener(contents[i], "keydown", onKeyInSystemEventGroup, true);
- SpecialPowers.addSystemEventListener(contents[i], "keypress", onKeyInSystemEventGroup, true);
- SpecialPowers.addSystemEventListener(contents[i], "keydown", onKeyInSystemEventGroup, false);
- SpecialPowers.addSystemEventListener(contents[i], "keypress", onKeyInSystemEventGroup, false);
- }
-
- var keyEvents = [];
-
- function onKeyInDefaultEventGroup(aDOMEvent)
- {
- if (isModifierKeyEvent(aDOMEvent)) {
- return;
- }
- keyEvents.push({ type: aDOMEvent.type, group: "default", phase: getPhase(aDOMEvent), currentTarget: eventTargetToString(aDOMEvent.currentTarget) });
- }
-
- function onKeyInSystemEventGroup(aDOMEvent)
- {
- if (isModifierKeyEvent(aDOMEvent)) {
- return;
- }
- keyEvents.push({ type: aDOMEvent.type, group: "system", phase: getPhase(aDOMEvent), currentTarget: eventTargetToString(aDOMEvent.currentTarget) });
- // prevents reserved default action
- if (aDOMEvent.type == "keypress" &&
- aDOMEvent.eventPhase == aDOMEvent.BUBBLING_PHASE &&
- aDOMEvent.currentTarget == browser.contentWindow) {
- aDOMEvent.preventDefault();
- }
- }
-
- function finializeKeyElementTest()
- {
- for (var i = 0; i < contents.length; i++) {
- contents[i].removeEventListener("keydown", onKeyInDefaultEventGroup, true);
- contents[i].removeEventListener("keypress", onKeyInDefaultEventGroup, true);
- contents[i].removeEventListener("keydown", onKeyInDefaultEventGroup, false);
- contents[i].removeEventListener("keypress", onKeyInDefaultEventGroup, false);
- SpecialPowers.removeSystemEventListener(contents[i], "keydown", onKeyInSystemEventGroup, true);
- SpecialPowers.removeSystemEventListener(contents[i], "keypress", onKeyInSystemEventGroup, true);
- SpecialPowers.removeSystemEventListener(contents[i], "keydown", onKeyInSystemEventGroup, false);
- SpecialPowers.removeSystemEventListener(contents[i], "keypress", onKeyInSystemEventGroup, false);
- }
- }
-
- function testReservedKey(aEvent)
- {
- keyEvents = [];
- return synthesizeKey(aEvent, "content_button", function() {
- testName = "testReservedKey: " + eventToString(aEvent) + " ";
- is(keyEvents.length, 20, testName + "wrong number events fired");
- is(JSON.stringify(keyEvents[0]), JSON.stringify({ type: "keydown", group: "system", phase: "capture", currentTarget: eventTargetToString(contents[0]) }), testName + "keydown event should be fired on content only in the system event group #0");
- is(JSON.stringify(keyEvents[1]), JSON.stringify({ type: "keydown", group: "system", phase: "capture", currentTarget: eventTargetToString(contents[1]) }), testName + "keydown event should be fired on content only in the system event group #1");
- is(JSON.stringify(keyEvents[2]), JSON.stringify({ type: "keydown", group: "system", phase: "capture", currentTarget: eventTargetToString(contents[2]) }), testName + "keydown event should be fired on content only in the system event group #2");
- is(JSON.stringify(keyEvents[3]), JSON.stringify({ type: "keydown", group: "system", phase: "capture", currentTarget: eventTargetToString(contents[3]) }), testName + "keydown event should be fired on content only in the system event group #3");
-
- is(JSON.stringify(keyEvents[4]), JSON.stringify({ type: "keydown", group: "system", phase: "target", currentTarget: eventTargetToString(contents[4]) }), testName + "keydown event should be fired on content only in the system event group #4");
- is(JSON.stringify(keyEvents[5]), JSON.stringify({ type: "keydown", group: "system", phase: "target", currentTarget: eventTargetToString(contents[4]) }), testName + "keydown event should be fired on content only in the system event group #5");
-
- is(JSON.stringify(keyEvents[6]), JSON.stringify({ type: "keydown", group: "system", phase: "bubble", currentTarget: eventTargetToString(contents[3]) }), testName + "keydown event should be fired on content only in the system event group #6");
- is(JSON.stringify(keyEvents[7]), JSON.stringify({ type: "keydown", group: "system", phase: "bubble", currentTarget: eventTargetToString(contents[2]) }), testName + "keydown event should be fired on content only in the system event group #7");
- is(JSON.stringify(keyEvents[8]), JSON.stringify({ type: "keydown", group: "system", phase: "bubble", currentTarget: eventTargetToString(contents[1]) }), testName + "keydown event should be fired on content only in the system event group #8");
- is(JSON.stringify(keyEvents[9]), JSON.stringify({ type: "keydown", group: "system", phase: "bubble", currentTarget: eventTargetToString(contents[0]) }), testName + "keydown event should be fired on content only in the system event group #9");
-
- is(JSON.stringify(keyEvents[10]), JSON.stringify({ type: "keypress", group: "system", phase: "capture", currentTarget: eventTargetToString(contents[0]) }), testName + "keypress event should be fired on content only in the system event group #10");
- is(JSON.stringify(keyEvents[11]), JSON.stringify({ type: "keypress", group: "system", phase: "capture", currentTarget: eventTargetToString(contents[1]) }), testName + "keypress event should be fired on content only in the system event group #11");
- is(JSON.stringify(keyEvents[12]), JSON.stringify({ type: "keypress", group: "system", phase: "capture", currentTarget: eventTargetToString(contents[2]) }), testName + "keypress event should be fired on content only in the system event group #12");
- is(JSON.stringify(keyEvents[13]), JSON.stringify({ type: "keypress", group: "system", phase: "capture", currentTarget: eventTargetToString(contents[3]) }), testName + "keypress event should be fired on content only in the system event group #13");
-
- is(JSON.stringify(keyEvents[14]), JSON.stringify({ type: "keypress", group: "system", phase: "target", currentTarget: eventTargetToString(contents[4]) }), testName + "keypress event should be fired on content only in the system event group #14");
- is(JSON.stringify(keyEvents[15]), JSON.stringify({ type: "keypress", group: "system", phase: "target", currentTarget: eventTargetToString(contents[4]) }), testName + "keypress event should be fired on content only in the system event group #15");
-
- is(JSON.stringify(keyEvents[16]), JSON.stringify({ type: "keypress", group: "system", phase: "bubble", currentTarget: eventTargetToString(contents[3]) }), testName + "keypress event should be fired on content only in the system event group #16");
- is(JSON.stringify(keyEvents[17]), JSON.stringify({ type: "keypress", group: "system", phase: "bubble", currentTarget: eventTargetToString(contents[2]) }), testName + "keypress event should be fired on content only in the system event group #17");
- is(JSON.stringify(keyEvents[18]), JSON.stringify({ type: "keypress", group: "system", phase: "bubble", currentTarget: eventTargetToString(contents[1]) }), testName + "keypress event should be fired on content only in the system event group #18");
- is(JSON.stringify(keyEvents[19]), JSON.stringify({ type: "keypress", group: "system", phase: "bubble", currentTarget: eventTargetToString(contents[0]) }), testName + "keypress event should be fired on content only in the system event group #19");
-
- continueTest();
- });
- }
-
- if (IS_MAC) {
- // Cmd+T is reserved for opening new tab.
- yield testReservedKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:MAC_VK_ANSI_T,
- modifiers:{metaKey:1}, chars:"t", unmodifiedChars:"t"});
- } else if (IS_WIN) {
- // Ctrl+T is reserved for opening new tab.
- yield testReservedKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_T,
- modifiers:{ctrlKey:1}, chars:"\u0014"});
- yield testReservedKey({layout:KEYBOARD_LAYOUT_ARABIC, keyCode:WIN_VK_T,
- modifiers:{ctrlKey:1}, chars:"\u0014"});
- }
-
- finializeKeyElementTest();
-}
-
-function* runTextInputTests()
-{
- var textbox = document.getElementById("textbox");
-
- function testKey(aEvent, aExpectText) {
- textbox.value = "";
- textbox.focus();
-
- var name = eventToString(aEvent);
-
- // Check if the text comes with keypress events rather than composition events.
- var keypress = 0;
- function onKeypress(aEvent) {
- keypress++;
- if (keypress == 1 && aExpectText == "") {
- if (!aEvent.ctrlKey && !aEvent.altKey) {
- is(aEvent.charCode, 0, name + ", the charCode value should be 0 when it shouldn't cause inputting text");
- }
- return;
- }
- if (keypress > aExpectText.length) {
- ok(false, name + " causes too many keypress events");
- return;
- }
- is(aEvent.key, aExpectText[keypress - 1],
- name + ", " + keypress + "th keypress event's key value should be '" + aExpectText[keypress - 1] + "'");
- is(aEvent.charCode, aExpectText.charCodeAt(keypress - 1),
- name + ", " + keypress + "th keypress event's charCode value should be 0x" + parseInt(aExpectText.charCodeAt(keypress - 1), 16));
- }
- textbox.addEventListener("keypress", onKeypress, true);
-
- return synthesizeKey(aEvent, "textbox", function() {
- textbox.removeEventListener("keypress", onKeypress, true);
- if (aExpectText == "") {
- is(keypress, 1, name + " should cause one keypress event because it doesn't cause inputting text");
- } else {
- is(keypress, aExpectText.length, name + " should cause " + aExpectText.length + " keypress events");
- is(textbox.value, aExpectText, name + " does not input correct text.");
- }
-
- continueTest();
- });
- }
-
- if (IS_MAC) {
- yield testKey({layout:KEYBOARD_LAYOUT_ARABIC_PC, keyCode:MAC_VK_ANSI_G,
- modifiers:{shiftKey:1}, chars:"\u0644\u0623", unmodifiedChars:"\u0644\u0623"},
- "\u0644\u0623");
- yield testKey({layout:KEYBOARD_LAYOUT_ARABIC_PC, keyCode:MAC_VK_ANSI_T,
- modifiers:{shiftKey:1}, chars:"\u0644\u0625", unmodifiedChars:"\u0644\u0625"},
- "\u0644\u0625");
- yield testKey({layout:KEYBOARD_LAYOUT_ARABIC_PC, keyCode:MAC_VK_ANSI_B,
- modifiers:{shiftKey:1}, chars:"\u0644\u0622", unmodifiedChars:"\u0644\u0622"},
- "\u0644\u0622");
- yield testKey({layout:KEYBOARD_LAYOUT_ARABIC_PC, keyCode:MAC_VK_ANSI_B,
- modifiers:{}, chars:"\u0644\u0627", unmodifiedChars:"\u0644\u0627"},
- "\u0644\u0627");
- } else if (IS_WIN) {
- // Basic sanity checks
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{}, chars:"a"},
- "a");
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{shiftKey:1}, chars:"A"},
- "A");
- // When Ctrl+Alt are pressed, any text should not be inputted.
- yield testKey({layout:KEYBOARD_LAYOUT_EN_US, keyCode:WIN_VK_A,
- modifiers:{ctrlKey:1, altKey:1}, chars:""},
- "");
-
- // Lithuanian AltGr should be consumed at 9/0 keys pressed
- yield testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_8,
- modifiers:{}, chars:"\u016B"},
- "\u016B");
- yield testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_9,
- modifiers:{}, chars:"9"},
- "9");
- yield testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_0,
- modifiers:{}, chars:"0"},
- "0");
- yield testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_8,
- modifiers:{ctrlKey:1, altKey:1}, chars:"8"},
- "8");
- yield testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_9,
- modifiers:{ctrlKey:1, altKey:1}, chars:"9"},
- "9");
- yield testKey({layout:KEYBOARD_LAYOUT_LITHUANIAN, keyCode:WIN_VK_0,
- modifiers:{ctrlKey:1, altKey:1}, chars:"0"},
- "0");
- }
-
- // XXX We need to move focus for canceling to search the autocomplete
- // result. If we don't do here, Fx will crash at end of this tests.
- document.getElementById("button").focus();
-}
-
-function* runAllTests() {
- yield* runKeyEventTests();
- yield* runAccessKeyTests();
- yield* runXULKeyTests();
- yield* runReservedKeyTests();
- yield* runTextInputTests();
-}
-
-var gTestContinuation = null;
-
-function continueTest()
-{
- if (!gTestContinuation) {
- gTestContinuation = runAllTests();
- }
- var ret = gTestContinuation.next();
- if (ret.done) {
- SimpleTest.finish();
- } else {
- is(ret.value, true, "Key synthesized successfully");
- }
-}
-
-function runTest()
-{
- if (!IS_MAC && !IS_WIN) {
- todo(false, "This test is supported on MacOSX and Windows only. (Bug 431503)");
- return;
- }
-
- if (IS_WIN && OS_VERSION >= WIN8) {
- // Switching keyboard layout to Russian - Mnemonic causes 2 assertions in KeyboardLayout::LoadLayout().
- SimpleTest.expectAssertions(2, 2);
- }
- SimpleTest.waitForExplicitFinish();
-
- clearInfobars();
-
- continueTest();
-}
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_mouse_scroll.xul b/widget/tests/test_mouse_scroll.xul
deleted file mode 100644
index 570b304ea..000000000
--- a/widget/tests/test_mouse_scroll.xul
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Testing composition, text and query content events"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-window.open("window_mouse_scroll_win.html", "_blank",
- "chrome,width=600,height=600");
-
-]]>
-</script>
-</window>
diff --git a/widget/tests/test_native_key_bindings_mac.html b/widget/tests/test_native_key_bindings_mac.html
deleted file mode 100644
index dc3872f02..000000000
--- a/widget/tests/test_native_key_bindings_mac.html
+++ /dev/null
@@ -1,343 +0,0 @@
-<!DOCTYPE HTML>
-<html>
- <head>
- <meta charset='utf-8'/>
- <title>Native Key Bindings for Cocoa Test</title>
- <!-- Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ -->
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/NativeKeyCodes.js"></script>
- </head>
- <body>
- <div id="editable" contenteditable>
- <p>Stretching attack nullam stuck in a tree zzz, suspendisse cras nec
- suspendisse lick suscipit. Nunc egestas amet litter box, nullam climb the
- curtains biting I don't like that food tristique biting sleep on your
- keyboard non. Lay down in your way cras nec tempus chase the red dot cras
- nec, pharetra pharetra eat the grass leap run orci turpis attack.
- Consectetur sleep in the sink eat I don't like that food, knock over the
- lamp catnip in viverra tail flick zzz meow etiam enim. Ac ac hiss shed
- everywhere kittens rhoncus, attack your ankles zzz iaculis kittens. Nullam
- pellentesque rip the couch iaculis rhoncus nibh, give me fish orci turpis
- purr sleep on your face quis nunc bibendum.</p>
-
- <p>Neque jump on the table bat iaculis, adipiscing sleep on your keyboard
- jump vel justo shed everywhere suspendisse lick. Zzz enim faucibus
- hairball faucibus, pharetra sunbathe biting bat leap rip the couch attack.
- Tortor nibh in viverra quis hairball nam, vulputate adipiscing sleep on
- your keyboard purr knock over the lamp orci turpis. Vestibulum I don't
- like that food et chase the red dot, adipiscing neque bibendum rutrum
- accumsan quis rhoncus claw. Leap accumsan vehicula enim biting sleep on
- your face, pharetra nam accumsan egestas kittens sunbathe. Pharetra chase
- the red dot sniff non eat the grass, vulputate fluffy fur aliquam puking
- judging you.</p>
-
- <p>Claw purr sollicitudin sollicitudin lay down in your way consectetur,
- pellentesque vehicula zzz orci turpis consectetur. I don't like that food
- rhoncus pellentesque sniff attack, rhoncus tortor attack your ankles
- iaculis scratched hiss vel. Tortor zzz tortor nullam rip the couch rutrum,
- bat enim ut leap hairball iaculis. Bibendum sunbathe elit suspendisse
- nibh, puking adipiscing sleep on your face sleep on your face zzz catnip.
- Judging you rutrum bat sunbathe sleep on your face, jump on the table leap
- tincidunt a faucibus sleep in the sink. Stuck in a tree tristique zzz hiss
- in viverra nullam, quis tortor pharetra attack.</p>
- </div>
-
- <textarea id="textarea" cols="80">
- Stretching attack nullam stuck in a tree zzz, suspendisse cras nec
- suspendisse lick suscipit. Nunc egestas amet litter box, nullam climb the
- curtains biting I don't like that food tristique biting sleep on your
- keyboard non. Lay down in your way cras nec tempus chase the red dot cras
- nec, pharetra pharetra eat the grass leap run orci turpis attack.
- Consectetur sleep in the sink eat I don't like that food, knock over the
- lamp catnip in viverra tail flick zzz meow etiam enim. Ac ac hiss shed
- everywhere kittens rhoncus, attack your ankles zzz iaculis kittens. Nullam
- pellentesque rip the couch iaculis rhoncus nibh, give me fish orci turpis
- purr sleep on your face quis nunc bibendum.
-
- Neque jump on the table bat iaculis, adipiscing sleep on your keyboard
- jump vel justo shed everywhere suspendisse lick. Zzz enim faucibus
- hairball faucibus, pharetra sunbathe biting bat leap rip the couch attack.
- Tortor nibh in viverra quis hairball nam, vulputate adipiscing sleep on
- your keyboard purr knock over the lamp orci turpis. Vestibulum I don't
- like that food et chase the red dot, adipiscing neque bibendum rutrum
- accumsan quis rhoncus claw. Leap accumsan vehicula enim biting sleep on
- your face, pharetra nam accumsan egestas kittens sunbathe. Pharetra chase
- the red dot sniff non eat the grass, vulputate fluffy fur aliquam puking
- judging you.
-
- Claw purr sollicitudin sollicitudin lay down in your way consectetur,
- pellentesque vehicula zzz orci turpis consectetur. I don't like that food
- rhoncus pellentesque sniff attack, rhoncus tortor attack your ankles
- iaculis scratched hiss vel. Tortor zzz tortor nullam rip the couch rutrum,
- bat enim ut leap hairball iaculis. Bibendum sunbathe elit suspendisse
- nibh, puking adipiscing sleep on your face sleep on your face zzz catnip.
- Judging you rutrum bat sunbathe sleep on your face, jump on the table leap
- tincidunt a faucibus sleep in the sink. Stuck in a tree tristique zzz hiss
- in viverra nullam, quis tortor pharetra attack.
- </textarea>
-
- <input id="input" type="text"
- value="Stretching attack nullam stuck in a tree zzz, suspendisse cras nec
- suspendisse lick suscipit. Nunc egestas amet litter box, nullam climb the
- curtains biting I don't like that food tristique biting sleep on your
- keyboard non. Lay down in your way cras nec tempus chase the red dot cras
- nec, pharetra pharetra eat the grass leap run orci turpis attack.
- Consectetur sleep in the sink eat I don't like that food, knock over the
- lamp catnip in viverra tail flick zzz meow etiam enim. Ac ac hiss shed
- everywhere kittens rhoncus, attack your ankles zzz iaculis kittens.
- Nullam pellentesque rip the couch iaculis rhoncus nibh, give me fish orci
- turpis purr sleep on your face quis nunc bibendum.">
-
- <script type="text/javascript;version=1.8">
- SimpleTest.waitForExplicitFinish();
-
- let synthesizedKeys = [];
- let expectations = [];
-
- // Move to beginning of line
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_LeftArrow,
- {ctrlKey: true}, "\uf702", "\uf702"]);
- expectations.push({
- editable: [0, 0],
- textarea: [0, 0],
- input: [0, 0]
- });
-
- // Move to end of line
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_RightArrow,
- {ctrlKey: true}, "\uf703", "\uf703"]);
- expectations.push({
- editable: [73, 73],
- textarea: [72, 72],
- input: [732, 732]
- });
-
- // Move down
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_N,
- {ctrlKey: true}, "\u000e", "n"]);
- expectations.push({
- editable: [140, 140],
- textarea: [145, 145],
- input: [732, 732]
- });
-
- // Move to beginning of line
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_LeftArrow,
- {ctrlKey: true}, "\uf702", "\uf702"]);
- expectations.push({
- editable: [73, 73],
- textarea: [73, 73],
- input: [0, 0]
- });
-
- // Move word right and modify selection
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_RightArrow,
- {altKey: true, shiftKey: true}, "\uf703", "\uf703"]);
- expectations.push({
- editable: [73, 84],
- textarea: [73, 90],
- input: [0, 10]
- });
-
- // Move word right
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_RightArrow,
- {altKey: true}, "\uf703", "\uf703"]);
- expectations.push({
- editable: [84, 84],
- textarea: [90, 90],
- input: [10, 10]
- });
-
- // Move word right
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_RightArrow,
- {altKey: true}, "\uf703", "\uf703"]);
- expectations.push({
- editable: [89, 89],
- textarea: [95, 95],
- input: [17, 17]
- });
-
- // Move down and modify selection
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_DownArrow,
- {shiftKey: true}, "\uf701", "\uf701"]);
- expectations.push({
- editable: [89, 171],
- textarea: [95, 175],
- input: [17, 732]
- });
-
- // Move backward and modify selection
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_B,
- {ctrlKey: true, shiftKey: true}, "\u0002", "B"]);
- expectations.push({
- editable: [89, 170],
- textarea: [95, 174],
- input: [17, 731]
- });
-
- // Delete forward
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_D,
- {ctrlKey: true}, "\u0004", "d"]);
- expectations.push({
- editable: [89, 89],
- textarea: [95, 95],
- input: [17, 17]
- });
-
- // Delete backward
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_H,
- {ctrlKey: true}, "\u0008", "h"]);
- expectations.push({
- editable: [88, 88],
- textarea: [94, 94],
- input: [16, 16]
- });
-
- // Move backward
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_B,
- {ctrlKey: true}, "\u0002", "b"]);
- expectations.push({
- editable: [87, 87],
- textarea: [93, 93],
- input: [15, 15]
- });
-
- // Move to beginning of paragraph (line for now)
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_A,
- {ctrlKey: true}, "\u0001", "a"]);
- expectations.push({
- editable: [73, 73],
- textarea: [73, 73],
- input: [0, 0]
- });
-
- // Move forward
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_F,
- {ctrlKey: true}, "\u0006", "f"]);
- expectations.push({
- editable: [74, 74],
- textarea: [74, 74],
- input: [1, 1]
- });
-
- // Move word right
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_RightArrow,
- {altKey: true}, "\uf703", "\uf703"]);
- expectations.push({
- editable: [84, 84],
- textarea: [90, 90],
- input: [10, 10]
- });
-
- // Move word right
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_RightArrow,
- {altKey: true}, "\uf703", "\uf703"]);
- expectations.push({
- editable: [88, 88],
- textarea: [94, 94],
- input: [17, 17]
- });
-
- // Delete to end of paragraph (line for now)
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_K,
- {ctrlKey: true}, "\u000b", "k"]);
- expectations.push({
- editable: [88, 88],
- textarea: [94, 94],
- input: [17, 17]
- });
-
- // Move backward and modify selection
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_B,
- {ctrlKey: true, shiftKey: true}, "\u0002", "B"]);
- expectations.push({
- editable: [88, 87],
- textarea: [93, 94],
- input: [16, 17]
- });
-
- // Move to end of paragraph (line for now)
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_E,
- {ctrlKey: true}, "\u0005", "e"]);
- expectations.push({
- editable: [139, 139],
- textarea: [94, 94],
- input: [17, 17]
- });
-
- // Move up
- synthesizedKeys.push([KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_P,
- {ctrlKey: true}, "\u0010", "p"]);
- expectations.push({
- editable: [73, 73],
- textarea: [21, 21],
- input: [0, 0]
- });
-
- function checkWindowSelection(aElement, aSelection)
- {
- let selection = window.getSelection();
-
- is(selection.anchorOffset, aSelection[aElement.id][0],
- aElement.id + ": Incorrect anchor offset");
- is(selection.focusOffset, aSelection[aElement.id][1],
- aElement.id + ": Incorrect focus offset");
- }
-
- function checkElementSelection(aElement, aSelection)
- {
- is(aElement.selectionStart, aSelection[aElement.id][0],
- aElement.id + ": Incorrect selection start");
- is(aElement.selectionEnd, aSelection[aElement.id][1],
- aElement.id + ": Incorrect selection end");
- }
-
- function* testRun(aElement, aSelectionCheck, aCallback)
- {
- if (document.activeElement) {
- document.activeElement.blur();
- }
-
- aElement.focus();
-
- for (let i = 0; i < synthesizedKeys.length; i++) {
- synthesizedKeys[i].push(function() {
- aSelectionCheck.call(null, aElement, expectations[i]);
- continueTest();
- });
- var synthOk = synthesizeNativeKey.apply(null, synthesizedKeys[i]);
- synthesizedKeys[i].pop();
- yield synthOk;
- }
- }
-
- function* doTest() {
- yield* testRun(document.getElementById("editable"), checkWindowSelection);
- yield* testRun(document.getElementById("textarea"), checkElementSelection);
- yield* testRun(document.getElementById("input"), checkElementSelection);
- }
-
- let gTestContinuation = null;
-
- function continueTest()
- {
- if (!gTestContinuation) {
- gTestContinuation = doTest();
- }
- var ret = gTestContinuation.next();
- if (ret.done) {
- SimpleTest.finish();
- } else {
- is(ret.value, true, "Successfully synthesized key");
- }
- }
-
- SimpleTest.waitForFocus(continueTest);
- </script>
- </body>
-</html>
diff --git a/widget/tests/test_native_menus.xul b/widget/tests/test_native_menus.xul
deleted file mode 100644
index cf9bcc881..000000000
--- a/widget/tests/test_native_menus.xul
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Native menu system tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-window.open("native_menus_window.xul", "NativeMenuWindow",
- "chrome,width=600,height=600");
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_native_mouse_mac.xul b/widget/tests/test_native_mouse_mac.xul
deleted file mode 100644
index 5d86864b2..000000000
--- a/widget/tests/test_native_mouse_mac.xul
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Native mouse event tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-window.open("native_mouse_mac_window.xul", "NativeMouseWindow",
- "chrome,width=600,height=600");
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_panel_mouse_coords.xul b/widget/tests/test_panel_mouse_coords.xul
deleted file mode 100644
index 41ef49044..000000000
--- a/widget/tests/test_panel_mouse_coords.xul
+++ /dev/null
@@ -1,83 +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"?>
-<!--
-https://bugzilla.mozilla.org/show_bug.cgi?id=835044
--->
-<window title="Mozilla Bug 835044"
- onload="startTest()"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
-
-<panel id="thepanel" level="parent"
- onpopupshown="sendMouseEvent();"
- onmousemove="checkCoords(event);"
- width="80" height="80">
-</panel>
-
- <!-- test results are displayed in the html:body -->
- <body xmlns="http://www.w3.org/1999/xhtml">
- <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=835044"
- id="anchor"
- target="_blank">Mozilla Bug 835044</a>
- </body>
-
- <!-- test code goes here -->
- <script type="application/javascript">
- <![CDATA[
-SimpleTest.waitForExplicitFinish();
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-let utils = window.QueryInterface(Ci.nsIInterfaceRequestor).
- getInterface(Ci.nsIDOMWindowUtils);
-let panel = document.getElementById('thepanel');
-let nativeMouseMove;
-let rect;
-
-function startTest() {
- let widgetToolkit = Cc["@mozilla.org/xre/app-info;1"].
- getService(Ci.nsIXULRuntime).widgetToolkit;
-
- if (widgetToolkit == "cocoa") {
- nativeMouseMove = 5; // NSMouseMoved
- } else if (widgetToolkit == "windows") {
- nativeMouseMove = 1; // MOUSEEVENTF_MOVE
- } else if (/^gtk/.test(widgetToolkit)) {
- nativeMouseMove = 3; // GDK_MOTION_NOTIFY
- } else {
- todo_is("widgetToolkit", widgetToolkit, "Platform not supported");
- done();
- }
-
- // This first event is to ensure that the next event will have different
- // coordinates to the previous mouse position, and so actually generates
- // mouse events. The mouse is not moved off the window, as that might
- // move focus to another application.
- utils.sendNativeMouseEvent(window.mozInnerScreenX, window.mozInnerScreenY,
- nativeMouseMove, 0, window.documentElement);
-
- panel.openPopup(document.getElementById("anchor"), "after_start");
-}
-
-function sendMouseEvent() {
- rect = panel.getBoundingClientRect();
- let x = window.mozInnerScreenX + rect.left + 1;
- let y = window.mozInnerScreenY + rect.top + 2;
- utils.sendNativeMouseEvent(x, y, nativeMouseMove, 0,
- window.documentElement);
-}
-
-function checkCoords(event) {
- is(event.clientX, rect.left + 1, "Motion x coordinate");
- is(event.clientY, rect.top + 2, "Motion y coordinate");
- done();
-}
-
-function done() {
- SimpleTest.finish();
-}
- ]]>
- </script>
-</window>
diff --git a/widget/tests/test_picker_no_crash.html b/widget/tests/test_picker_no_crash.html
deleted file mode 100644
index 08ba1db12..000000000
--- a/widget/tests/test_picker_no_crash.html
+++ /dev/null
@@ -1,36 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for crashes when the parent window of a file picker is closed via script</title>
- <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
- <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
-</head>
-
-<script type="application/javascript">
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.requestFlakyTimeout("untriaged");
-
-var childWindow;
-
-function testStepOne() {
- childWindow = window.open('window_picker_no_crash_child.html', 'childWindow', 'width=300,height=150');
- SimpleTest.waitForFocus(testStepTwo, childWindow);
-}
-
-function testStepTwo() {
- childWindow.document.form1.uploadbox.click();
- // This should not crash the browser
- childWindow.close();
- setTimeout("testStepThree();", 5000);
-}
-
-function testStepThree() {
- ok(true, "browser didn't crash");
- SimpleTest.finish();
-}
-
-SimpleTest.waitForFocus(testStepOne);
-</script>
-</body>
-</html>
diff --git a/widget/tests/test_platform_colors.xul b/widget/tests/test_platform_colors.xul
deleted file mode 100644
index b30b9837f..000000000
--- a/widget/tests/test_platform_colors.xul
+++ /dev/null
@@ -1,107 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Mac platform colors"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=518395">Mozilla Bug 518395</a>
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-<box id="colorbox"></box>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-var colors = {
- "activeborder": ["rgb(0, 0, 0)"],
- "activecaption": ["rgb(204, 204, 204)"],
- "appworkspace": ["rgb(255, 255, 255)"],
- "background": ["rgb(99, 99, 206)"],
- "buttonface": ["rgb(240, 240, 240)"],
- "buttonhighlight": ["rgb(255, 255, 255)"],
- "buttonshadow": ["rgb(220, 220, 220)"],
- "buttontext": ["rgb(0, 0, 0)"],
- "captiontext": ["rgb(0, 0, 0)"],
- "graytext": ["rgb(127, 127, 127)"],
- "highlight": ["rgb(115, 132, 153)", "rgb(127, 127, 127)", "rgb(56, 117, 215)", "rgb(255, 193, 31)", "rgb(243, 70, 72)", "rgb(255, 138, 34)", "rgb(102, 197, 71)", "rgb(140, 78, 184)"],
- "highlighttext": ["rgb(255, 255, 255)", "rgb(255, 254, 254)", "rgb(254, 255, 254)"],
- "inactiveborder": ["rgb(255, 255, 255)"],
- "inactivecaption": ["rgb(255, 255, 255)"],
- "inactivecaptiontext": ["rgb(69, 69, 69)"],
- "infobackground": ["rgb(255, 255, 199)"],
- "infotext": ["rgb(0, 0, 0)"],
- "menu": ["rgb(255, 255, 255)", "rgb(254, 255, 254)", "rgb(255, 254, 254)"],
- "menutext": ["rgb(0, 0, 0)"],
- "scrollbar": ["rgb(170, 170, 170)"],
- "threeddarkshadow": ["rgb(220, 220, 220)"],
- "threedface": ["rgb(240, 240, 240)"],
- "threedhighlight": ["rgb(255, 255, 255)"],
- "threedlightshadow": ["rgb(218, 218, 218)"],
- "threedshadow": ["rgb(224, 224, 224)"],
- "window": ["rgb(255, 255, 255)"],
- "windowframe": ["rgb(204, 204, 204)"],
- "windowtext": ["rgb(0, 0, 0)"],
- "-moz-activehyperlinktext": ["rgb(238, 0, 0)"],
- "-moz-buttondefault": ["rgb(220, 220, 220)"],
- "-moz-buttonhoverface": ["rgb(240, 240, 240)"],
- "-moz-buttonhovertext": ["rgb(0, 0, 0)"],
- "-moz-cellhighlight": ["rgb(212, 212, 212)", "rgb(220, 220, 220)"],
- "-moz-cellhighlighttext": ["rgb(0, 0, 0)"],
- "-moz-eventreerow": ["rgb(255, 255, 255)"],
- "-moz-field": ["rgb(255, 255, 255)"],
- "-moz-fieldtext": ["rgb(0, 0, 0)"],
- "-moz-dialog": ["rgb(232, 232, 232)"],
- "-moz-dialogtext": ["rgb(0, 0, 0)"],
- "-moz-dragtargetzone": ["rgb(199, 208, 218)", "rgb(198, 198, 198)", "rgb(180, 213, 255)", "rgb(250, 236, 115)", "rgb(255, 176, 139)", "rgb(255, 209, 129)", "rgb(194, 249, 144)", "rgb(232, 184, 255)"],
- "-moz-hyperlinktext": ["rgb(0, 0, 238)"],
- "-moz-html-cellhighlight": ["rgb(212, 212, 212)"],
- "-moz-html-cellhighlighttext": ["rgb(0, 0, 0)"],
- "-moz-mac-buttonactivetext": ["rgb(0, 0, 0)", "rgb(255, 255, 255)"],
- "-moz-mac-chrome-active": ["rgb(150, 150, 150)", "rgb(167, 167, 167)", "rgb(178, 178, 178)"],
- "-moz-mac-chrome-inactive": ["rgb(202, 202, 202)", "rgb(216, 216, 216)", "rgb(225, 225, 225)"],
- "-moz-mac-defaultbuttontext": ["rgb(0, 0, 0)", "rgb(255, 255, 255)"],
- //"-moz-mac-focusring": ["rgb(83, 144, 210)", "rgb(95, 112, 130)", "rgb(63, 152, 221)", "rgb(108, 126, 141)"],
- "-moz-mac-menuselect": ["rgb(115, 132, 153)", "rgb(127, 127, 127)", "rgb(56, 117, 215)", "rgb(255, 193, 31)", "rgb(243, 70, 72)", "rgb(255, 138, 34)", "rgb(102, 197, 71)", "rgb(140, 78, 184)"],
- "-moz-mac-menushadow": ["rgb(163, 163, 163)"],
- "-moz-mac-menutextdisable": ["rgb(152, 152, 152)"],
- "-moz-mac-menutextselect": ["rgb(255, 255, 255)"],
- "-moz-mac-disabledtoolbartext": ["rgb(127, 127, 127)"],
- "-moz-mac-secondaryhighlight": ["rgb(212, 212, 212)"],
- "-moz-menuhover": ["rgb(115, 132, 153)", "rgb(127, 127, 127)", "rgb(56, 117, 215)", "rgb(255, 193, 31)", "rgb(243, 70, 72)", "rgb(255, 138, 34)", "rgb(102, 197, 71)", "rgb(140, 78, 184)"],
- "-moz-menuhovertext": ["rgb(255, 255, 255)", "rgb(255, 254, 254)", "rgb(254, 255, 254)"],
- "-moz-menubartext": ["rgb(0, 0, 0)"],
- //"-moz-menubarhovertext": ["rgb(255, 255, 255)"],
- "-moz-oddtreerow": ["rgb(236, 242, 254)", "rgb(240, 240, 240)", "rgb(243, 245, 250)", "rgb(243, 246, 250)", "rgb(245, 245, 245)"],
- "-moz-visitedhyperlinktext": ["rgb(85, 26, 139)"],
- "currentcolor": ["rgb(0, 0, 0)"],
- //"-moz-win-mediatext": ["rgb(255, 255, 255)"],
- //"-moz-win-communicationstext": ["rgb(255, 255, 255)"],
- "-moz-nativehyperlinktext": ["rgb(20, 79, 174)"],
- "-moz-comboboxtext": ["rgb(0, 0, 0)"],
- "-moz-combobox": ["rgb(255, 255, 255)"]
-};
-
-var colorbox = document.getElementById('colorbox');
-
-for (var c in colors) {
- dump("testing color " + c + "\n");
- colorbox.style.backgroundColor = c;
- var rgb = document.defaultView.getComputedStyle(colorbox, null).getPropertyValue('background-color');
- ok(colors[c].indexOf(rgb) != -1 || colors[c].length == 8, 'platform color ' + c + ' is wrong: ' + rgb);
-}
-
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_plugin_input_event.html b/widget/tests/test_plugin_input_event.html
deleted file mode 100644
index 6ed2a14c4..000000000
--- a/widget/tests/test_plugin_input_event.html
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<head>
- <title>Test for plugin input event</title>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/NativeKeyCodes.js"></script>
- <script type="text/javascript" src="utils.js"></script>
- <link rel="stylesheet" type="text/css"
- href="chrome://mochikit/content/tests/SimpleTest/test.css" />
-</head>
-<body>
-<script type="application/javascript">
-setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
-</script>
-
-<p id="display">
- <embed id="plugin" type="application/x-test" wmode="opaque">
-</p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-
-<script type="application/javascript">
-SimpleTest.waitForExplicitFinish();
-
-var gPlugin = document.getElementById("plugin");
-
-var gUtils = window.
- QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIDOMWindowUtils);
-
-function* doTest() {
- gPlugin.focus();
-
- is(gUtils.IMEStatus, gUtils.IME_STATUS_PLUGIN,
- "Plugin failed to get focus");
-
- is(gPlugin.getLastKeyText(), "", "Must be empty before first key test");
-
- yield synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, WIN_VK_A, {}, "a", "a", continueTest);
- is(gPlugin.getLastKeyText(), "a", "Invalid character was inputted");
-
- yield synthesizeNativeKey(KEYBOARD_LAYOUT_GERMAN, WIN_VK_OEM_PLUS, {}, "+", "+", continueTest);
- is(gPlugin.getLastKeyText(), "+", "Invalid character was inputted");
-
- yield synthesizeNativeKey(KEYBOARD_LAYOUT_GERMAN, WIN_VK_OEM_PLUS, {altGrKey:1}, "~", "+", continueTest);
- is(gPlugin.getLastKeyText(), "~", "Invalid character was inputted");
-}
-
-var gTestContinuation = null;
-
-function continueTest() {
- if (!gTestContinuation) {
- gTestContinuation = doTest(continueTest);
- }
- var ret = gTestContinuation.next();
- if (ret.done) {
- SimpleTest.finish();
- } else {
- is(ret.value, true, "Key synthesized successfully");
- }
-}
-
-SimpleTest.waitForFocus(continueTest);
-
-</script>
-</body>
-</html>
diff --git a/widget/tests/test_plugin_scroll_consistency.html b/widget/tests/test_plugin_scroll_consistency.html
deleted file mode 100644
index 76d97f4ef..000000000
--- a/widget/tests/test_plugin_scroll_consistency.html
+++ /dev/null
@@ -1,61 +0,0 @@
-<html>
-<head>
- <title>Test for plugin child widgets not being messed up by scrolling</title>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript" src="utils.js"></script>
- <link rel="stylesheet" type="text/css"
- href="chrome://mochikit/content/tests/SimpleTest/test.css" />
-</head>
-<body onload="setTimeout(runTests, 0)">
-<script type="application/javascript">
-setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
-</script>
-
-<p id="display">
- <div style="overflow:hidden; height:100px;" id="scroll">
- <embed type="application/x-test" wmode="window" width="100" height="800" id="plugin"></object>
- <div style="height:1000px;"></div>
- </div>
-</p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-
-<script class="testbody" type="application/javascript">
-SimpleTest.waitForExplicitFinish();
-
-var plugin = document.getElementById("plugin");
-
-function consistencyCheck(state) {
- var s = plugin.doInternalConsistencyCheck();
- ok(s == "", "Consistency check: " + state + ": " + s);
-}
-
-function runTests()
-{
- consistencyCheck("Initial state");
-
- var scroll = document.getElementById("scroll");
- scroll.scrollTop = 10;
- consistencyCheck("Scrolled down a bit");
-
- setTimeout(function() {
- consistencyCheck("Before scrolling back to top");
- scroll.scrollTop = 0;
- consistencyCheck("Scrolled to top");
-
- setTimeout(function() {
- consistencyCheck("After scrolling to top");
-
- SimpleTest.finish();
- }, 0);
- }, 0);
-}
-
-</script>
-</body>
-
-</html>
diff --git a/widget/tests/test_position_on_resize.xul b/widget/tests/test_position_on_resize.xul
deleted file mode 100644
index e1adfc2b4..000000000
--- a/widget/tests/test_position_on_resize.xul
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-
-<window title="Window Position On Resize Test"
- onload="startTest()"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"/>
-
-<script class="testbody" type="application/javascript"><![CDATA[
- SimpleTest.waitForExplicitFinish();
- let win, x, y;
-
- function startTest() {
- win = window.openDialog("about:blank",
- null,
- "chrome,dialog=no,outerHeight=170,outerWidth=200");
- waitForSuccess(function() { return win.mozPaintCount },
- "No paint received", checkInitialSize);
- }
-
- function checkInitialSize() {
- let runtime = Components.classes["@mozilla.org/xre/app-info;1"]
- .getService(Components.interfaces.nsIXULRuntime);
- let test = runtime.widgetToolkit == "windows" ? todo_is : is; // bug 602745
- test(win.outerHeight,170, "initial outerHeight");
- test(win.outerWidth, 200, "initial outerWidth");
- x = win.screenX;
- y = win.screenY;
- shrink();
- }
- function shrink() {
- win.resizeTo(180, 160);
- waitForSuccess(function() { return win.outerHeight == 160 },
- "outerHeight did not change to 160", checkShrink);
- }
- function checkShrink() {
- is(win.outerWidth, 180, "resized outerWidth");
- is(win.screenY, y, "resized window top should not change");
- y = win.screenY;
- restore();
- }
- function restore() {
- win.resizeBy(20, 10);
- waitForSuccess(function() { return win.outerHeight == 170 },
- "outerHeight did not change to 170", checkRestore);
- }
- function checkRestore() {
- is(win.outerWidth, 200, "restored outerWidth");
- is(win.screenX, x, "restored window left should not change");
- is(win.screenY, y, "restored window top should not change");
- done();
- }
- function done() {
- win.close();
- SimpleTest.finish();
- }
-
- function waitForSuccess(testForSuccess, failureMsg, nextFunc) {
- var waitCount = 0;
-
- function repeatWait() {
- ++waitCount;
-
- if (testForSuccess()) {
- nextFunc();
- }
- else if (waitCount > 50) {
- ok(false, failureMsg);
- nextFunc();
- } else {
- setTimeout(repeatWait, 100);
- }
- }
-
- repeatWait();
- }
-]]></script>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-</p>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-</window>
diff --git a/widget/tests/test_secure_input.html b/widget/tests/test_secure_input.html
deleted file mode 100644
index 2c3ee38db..000000000
--- a/widget/tests/test_secure_input.html
+++ /dev/null
@@ -1,148 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Test for secure input mode</title>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/NativeKeyCodes.js"></script>
- <link rel="stylesheet" type="text/css"
- href="chrome://mochikit/content/tests/SimpleTest/test.css" />
-</head>
-<body>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-
-<p>
- <input id="input_text" type="text"><br>
- <input id="input_password" type="password"><br>
- <input id="input_text_readonly" type="text" readonly><br>
- <input id="input_text_ime_mode_disabled" type="text" style="ime-mode: disabled;"><br>
- <input id="input_change" type="text"><br>
- <textarea id="textarea"></textarea><br>
-</p>
-<div id="contenteditable" contenteditable style="min-height: 3em;"></div>
-
-<script class="testbody" type="application/javascript">
-
- SimpleTest.waitForExplicitFinish();
-
- function sendAKeyEvent()
- {
- synthesizeNativeKey(KEYBOARD_LAYOUT_EN_US, MAC_VK_ANSI_A, {}, "a", "a");
- }
-
- function isFocused(aElement)
- {
- return (SpecialPowers.focusManager.focusedElement == aElement);
- }
-
- function runTest()
- {
- sendAKeyEvent();
- ok(true, "Not crashed: input on the document");
- $("input_text").focus();
- sendAKeyEvent();
- ok(true, "Not crashed: input on <input type=\"text\">");
- $("input_password").focus();
- sendAKeyEvent();
- ok(true, "Not crashed: input on <input type=\"password\">");
- $("input_password").blur();
- sendAKeyEvent();
- ok(true, "Not crashed: input on the document after blur() of <input type=\"password\">");
- $("input_password").focus();
- $("input_text_readonly").focus();
- sendAKeyEvent();
- ok(true, "Not crashed: input on <input type=\"text\" readonly>");
- $("input_password").focus();
- $("input_text_ime_mode_disabled").focus();
- sendAKeyEvent();
- ok(true, "Not crashed: input on <input type=\"text\" style=\"ime-mode: disabled;\">");
- $("input_password").focus();
- $("textarea").focus();
- sendAKeyEvent();
- ok(true, "Not crashed: input on <textarea>");
- $("input_password").focus();
- $("contenteditable").focus();
- sendAKeyEvent();
- ok(true, "Not crashed: input on <div contenteditable>");
-
- $("input_change").focus();
- $("input_change").type = "password";
- sendAKeyEvent();
- ok(true, "Not crashed: input on <input type=\"password\"> changed from type=\"text\"");
- $("input_change").type = "text";
- sendAKeyEvent();
- ok(true, "Not crashed: input on <input type=\"text\"> changed from type=\"password\"");
-
- otherWindow =
- window.open("data:text/html,<input id=\"text\" type\"text\"><input id=\"password\" type\"password\">",
- "_blank", "chrome,width=100,height=100");
- ok(otherWindow, "failed to open other window");
- if (!otherWindow) {
- SimpleTest.finish();
- return;
- }
-
- $("input_text").focus();
- otherWindow.focus();
-
- SimpleTest.waitForFocus(function () {
- window.focus();
- sendAKeyEvent();
- ok(isFocused($("input_text")), "focused element isn't <input type=\"text\">");
- ok(true, "Not crashed: input on <input type=\"text\"> after the other document has focus");
-
- $("input_password").focus();
- otherWindow.focus();
- window.focus();
- sendAKeyEvent();
- ok(isFocused($("input_password")), "focused element isn't <input type=\"password\">");
- ok(true, "Not crashed: input on <input type=\"password\"> after the other document has focus");
-
- $("input_text").focus();
- otherWindow.focus();
- otherWindow.document.getElementById("text").focus();
- window.focus();
- sendAKeyEvent();
- ok(isFocused($("input_text")), "focused element isn't <input type=\"text\">");
- ok(true, "Not crashed: input on <input type=\"text\"> after the other document's <input type=\"text\"> has focus");
-
- $("input_password").focus();
- otherWindow.focus();
- otherWindow.document.getElementById("text").focus();
- window.focus();
- sendAKeyEvent();
- ok(isFocused($("input_password")), "focused element isn't <input type=\"password\">");
- ok(true, "Not crashed: input on <input type=\"password\"> after the other document's <input type=\"text\"> has focus");
-
- $("input_text").focus();
- otherWindow.focus();
- otherWindow.document.getElementById("password").focus();
- window.focus();
- sendAKeyEvent();
- ok(isFocused($("input_text")), "focused element isn't <input type=\"text\">");
- ok(true, "Not crashed: input on <input type=\"text\"> after the other document's <input type=\"password\"> has focus");
-
- $("input_password").focus();
- otherWindow.focus();
- otherWindow.document.getElementById("password").focus();
- window.focus();
- sendAKeyEvent();
- ok(isFocused($("input_password")), "focused element isn't <input type=\"password\">");
- ok(true, "Not crashed: input on <input type=\"password\"> after the other document's <input type=\"password\"> has focus");
-
- SimpleTest.finish();
-
- }, otherWindow);
- }
-
- SimpleTest.waitForFocus(runTest);
-</script>
-</body>
-</html>
diff --git a/widget/tests/test_sizemode_events.xul b/widget/tests/test_sizemode_events.xul
deleted file mode 100644
index e6ab940b2..000000000
--- a/widget/tests/test_sizemode_events.xul
+++ /dev/null
@@ -1,105 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Test for bug 715867"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-const XUL_NS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
-
-gWindow = null;
-
-gSizeModeDidChange = false;
-gSizeModeDidChangeTo = 0;
-
-function sizemodeChanged(e) {
- gSizeModeDidChange = true;
- gSizeModeDidChangeTo = gWindow.windowState;
-}
-
-function expectSizeModeChange(newMode, duringActionCallback) {
- gSizeModeDidChange = false;
-
- duringActionCallback();
-
- if (newMode == 0) {
- // No change should have taken place, no event should have fired.
- ok(!gSizeModeDidChange, "No sizemodechange event should have fired.");
- } else {
- // Size mode change event was expected to fire.
- ok(gSizeModeDidChange, "A sizemodechanged event should have fired.");
- is(gSizeModeDidChangeTo, newMode, "The new sizemode should have the expected value.");
- }
-}
-
-function startTest() {
- if (navigator.platform.indexOf("Lin") != -1) {
- ok(true, "This test is disabled on Linux because it expects window sizemode changes to be synchronous (which is not the case on Linux).");
- SimpleTest.finish();
- return;
- };
- openWindow();
-}
-
-function openWindow() {
- gWindow = open('empty_window.xul', '_blank', 'chrome,screenX=50,screenY=50,width=200,height=200,resizable');
- SimpleTest.waitForFocus(runTest, gWindow);
-}
-
-function runTest() {
- // Install event handler.
- gWindow.addEventListener("sizemodechange", sizemodeChanged, false);
-
- // Run tests.
- expectSizeModeChange(gWindow.STATE_MINIMIZED, function () {
- gWindow.minimize();
- });
-
- expectSizeModeChange(gWindow.STATE_NORMAL, function () {
- gWindow.restore();
- });
-
- expectSizeModeChange(gWindow.STATE_MAXIMIZED, function () {
- gWindow.maximize();
- });
-
- expectSizeModeChange(gWindow.STATE_NORMAL, function () {
- gWindow.restore();
- });
-
- // Normal window resizing shouldn't fire a sizemodechanged event, bug 715867.
- expectSizeModeChange(0, function () {
- gWindow.resizeTo(gWindow.outerWidth + 10, gWindow.outerHeight);
- });
-
- expectSizeModeChange(0, function () {
- gWindow.resizeTo(gWindow.outerWidth, gWindow.outerHeight + 10);
- });
-
- gWindow.removeEventListener("sizemodechange", sizemodeChanged, false);
- gWindow.close();
- SimpleTest.finish();
-}
-
-SimpleTest.waitForExplicitFinish();
-SimpleTest.waitForFocus(startTest);
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_standalone_native_menu.xul b/widget/tests/test_standalone_native_menu.xul
deleted file mode 100644
index bac7a352e..000000000
--- a/widget/tests/test_standalone_native_menu.xul
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Standalone Native Menu tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display"></p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-window.open("standalone_native_menu_window.xul", "StandaloneNativeMenuWindow",
- "chrome,width=600,height=600");
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/test_system_status_bar.xul b/widget/tests/test_system_status_bar.xul
deleted file mode 100644
index 784620fc8..000000000
--- a/widget/tests/test_system_status_bar.xul
+++ /dev/null
@@ -1,57 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Testing composition, text and query content events"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<menupopup id="menuContainer">
- <menu id="menu1" image="data:image/svg+xml,&lt;svg%20xmlns=&quot;http://www.w3.org/2000/svg&quot;%20width=&quot;32&quot;%20height=&quot;32&quot;>&lt;circle%20cx=&quot;16&quot;%20cy=&quot;16&quot;%20r=&quot;16&quot;/>&lt;/svg>">
- <menupopup>
- <menuitem label="Item 1 in menu 1"/>
- <menuitem label="Item 2 in menu 1"/>
- </menupopup>
- </menu>
- <menu id="menu2" image="data:image/svg+xml,&lt;svg%20xmlns=&quot;http://www.w3.org/2000/svg&quot;%20width=&quot;32&quot;%20height=&quot;32&quot;>&lt;path%20d=&quot;M0 16 L 16 0 L 32 16 L 16 32 Z&quot;/>&lt;/svg>">
- <menupopup>
- <menuitem label="Item 1 in menu 2"/>
- <menuitem label="Item 2 in menu 2"/>
- </menupopup>
- </menu>
-</menupopup>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
- let Cc = Components.classes;
- let Ci = Components.interfaces;
-
- let systemStatusBar = Cc["@mozilla.org/widget/macsystemstatusbar;1"].getService(Ci.nsISystemStatusBar);
- ok(systemStatusBar, "should have got an nsISystemStatusBar instance");
-
- let menu1 = document.getElementById("menu1");
- let menu2 = document.getElementById("menu2");
-
- // Add and remove the item, just to get basic leak testing coverage.
- systemStatusBar.addItem(menu1);
- systemStatusBar.removeItem(menu1);
-
- // Make sure that calling addItem twice with the same element doesn't leak.
- systemStatusBar.addItem(menu2);
- systemStatusBar.addItem(menu2);
- systemStatusBar.removeItem(menu2);
-
-]]>
-</script>
-</window>
diff --git a/widget/tests/test_taskbar_progress.xul b/widget/tests/test_taskbar_progress.xul
deleted file mode 100644
index e4ff533a0..000000000
--- a/widget/tests/test_taskbar_progress.xul
+++ /dev/null
@@ -1,126 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Taskbar Previews Test"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onload="loaded();">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
- <script class="testbody" type="application/javascript">
- <![CDATA[
- let Cc = Components.classes;
- let Ci = Components.interfaces;
- let Cu = Components.utils;
- Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
- let TP = Ci.nsITaskbarProgress;
-
- function IsWin7OrHigher() {
- try {
- var sysInfo = Cc["@mozilla.org/system-info;1"].
- getService(Ci.nsIPropertyBag2);
- var ver = parseFloat(sysInfo.getProperty("version"));
- if (ver >= 6.1)
- return true;
- } catch (ex) { }
- return false;
- }
-
- function winProgress() {
- let taskbar = Cc["@mozilla.org/windows-taskbar;1"];
- if (!taskbar) {
- ok(false, "Taskbar service is always available");
- return null;
- }
- taskbar = taskbar.getService(Ci.nsIWinTaskbar);
-
- is(taskbar.available, IsWin7OrHigher(), "Expected availability of taskbar");
- if (!taskbar.available)
- return null;
-
- // HACK from mconnor:
- var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
- let win = wm.getMostRecentWindow("navigator:browser");
- let docShell = win.document.docShell;
-
- let progress = taskbar.getTaskbarProgress(docShell);
- isnot(progress, null, "Progress is not null");
-
- try {
- taskbar.getTaskbarProgress(null);
- ok(false, "Got progress for null docshell");
- } catch (e) {
- ok(true, "Cannot get progress for null docshell");
- }
-
- return progress;
- }
-
- function macProgress() {
- let progress = Cc["@mozilla.org/widget/macdocksupport;1"];
- if (!progress) {
- ok(false, "Should have gotten Mac progress service.");
- return null;
- }
- return progress.getService(TP);
- }
-
- SimpleTest.waitForExplicitFinish();
-
- function loaded()
- {
- let isWin = /Win/.test(navigator.platform);
- let progress = isWin ? winProgress() : macProgress();
- if (!TP || !progress) {
- SimpleTest.finish();
- return;
- }
-
- function shouldThrow(s,c,m) {
- try {
- progress.setProgressState(s,c,m);
- return false;
- } catch (e) {
- return true;
- }
- }
-
- function doesntThrow(s,c,m) {
- return !shouldThrow(s,c,m);
- }
-
- ok(doesntThrow(TP.STATE_NO_PROGRESS, 0, 0), "No progress state can be set");
- ok(doesntThrow(TP.STATE_INDETERMINATE, 0, 0), "Indeterminate state can be set");
- ok(doesntThrow(TP.STATE_NORMAL, 0, 0), "Normal state can be set");
- ok(doesntThrow(TP.STATE_ERROR, 0, 0), "Error state can be set");
- ok(doesntThrow(TP.STATE_PAUSED, 0, 0), "Paused state can be set");
-
- ok(shouldThrow(TP.STATE_NO_PROGRESS, 1, 1), "Cannot set no progress with values");
- ok(shouldThrow(TP.STATE_INDETERMINATE, 1, 1), "Cannot set indeterminate with values");
-
- // Technically passes since unsigned(-1) > 10
- ok(shouldThrow(TP.STATE_NORMAL, -1, 10), "Cannot set negative progress");
- todo(shouldThrow(TP.STATE_NORMAL, 1, -1), "Cannot set negative progress");
- todo(shouldThrow(TP.STATE_NORMAL, -1, -1), "Cannot set negative progress");
- todo(shouldThrow(TP.STATE_NORMAL, -2, -1), "Cannot set negative progress");
-
- ok(shouldThrow(TP.STATE_NORMAL, 5, 3), "Cannot set progress greater than max");
-
- ok(doesntThrow(TP.STATE_NORMAL, 1, 5), "Normal state can be set with values");
- ok(doesntThrow(TP.STATE_ERROR, 3, 6), "Error state can be set with values");
- ok(doesntThrow(TP.STATE_PAUSED, 2, 9), "Paused state can be set with values");
-
- SimpleTest.finish();
- }
- ]]>
- </script>
-
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
- </body>
-
-</window>
diff --git a/widget/tests/test_wheeltransaction.xul b/widget/tests/test_wheeltransaction.xul
deleted file mode 100644
index dadd46629..000000000
--- a/widget/tests/test_wheeltransaction.xul
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Wheel scroll transaction tests"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-SimpleTest.waitForExplicitFinish();
-window.open("window_wheeltransaction.xul", "_blank",
- "chrome,width=600,height=600");
-
-]]>
-</script>
-</window>
diff --git a/widget/tests/unit/test_macwebapputils.js b/widget/tests/unit/test_macwebapputils.js
deleted file mode 100644
index 0701bedf0..000000000
--- a/widget/tests/unit/test_macwebapputils.js
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-//Basic tests to verify that MacWebAppUtils works
-
-var Ci = Components.interfaces;
-var Cc = Components.classes;
-var Cu = Components.utils;
-var Cr = Components.results;
-
-Cu.import("resource://gre/modules/Services.jsm");
-Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
-function test_find_app()
-{
- var mwaUtils = Cc["@mozilla.org/widget/mac-web-app-utils;1"].
- createInstance(Ci.nsIMacWebAppUtils);
- let sig = "com.apple.TextEdit";
-
- let path;
- path = mwaUtils.pathForAppWithIdentifier(sig);
- do_print("TextEdit path: " + path + "\n");
- do_check_neq(path, "");
-}
-
-function test_dont_find_fake_app()
-{
- var mwaUtils = Cc["@mozilla.org/widget/mac-web-app-utils;1"].
- createInstance(Ci.nsIMacWebAppUtils);
- let sig = "calliope.penitentiary.dramamine";
-
- let path;
- path = mwaUtils.pathForAppWithIdentifier(sig);
- do_check_eq(path, "");
-}
-
-
-function run_test()
-{
- test_find_app();
- test_dont_find_fake_app();
-}
diff --git a/widget/tests/unit/test_taskbar_jumplistitems.js b/widget/tests/unit/test_taskbar_jumplistitems.js
deleted file mode 100644
index d145683eb..000000000
--- a/widget/tests/unit/test_taskbar_jumplistitems.js
+++ /dev/null
@@ -1,261 +0,0 @@
-/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-// This tests taskbar jump list functionality available on win7 and up.
-
-var Cc = Components.classes;
-var Ci = Components.interfaces;
-
-function test_basics()
-{
- var item = Cc["@mozilla.org/windows-jumplistitem;1"].
- createInstance(Ci.nsIJumpListItem);
-
- var sep = Cc["@mozilla.org/windows-jumplistseparator;1"].
- createInstance(Ci.nsIJumpListSeparator);
-
- var shortcut = Cc["@mozilla.org/windows-jumplistshortcut;1"].
- createInstance(Ci.nsIJumpListShortcut);
-
- var link = Cc["@mozilla.org/windows-jumplistlink;1"].
- createInstance(Ci.nsIJumpListLink);
-
- do_check_false(item.equals(sep));
- do_check_false(item.equals(shortcut));
- do_check_false(item.equals(link));
-
- do_check_false(sep.equals(item));
- do_check_false(sep.equals(shortcut));
- do_check_false(sep.equals(link));
-
- do_check_false(shortcut.equals(item));
- do_check_false(shortcut.equals(sep));
- do_check_false(shortcut.equals(link));
-
- do_check_false(link.equals(item));
- do_check_false(link.equals(sep));
- do_check_false(link.equals(shortcut));
-
- do_check_true(item.equals(item));
- do_check_true(sep.equals(sep));
- do_check_true(link.equals(link));
- do_check_true(shortcut.equals(shortcut));
-}
-
-function test_separator()
-{
- // separators:
-
- var item = Cc["@mozilla.org/windows-jumplistseparator;1"].
- createInstance(Ci.nsIJumpListSeparator);
-
- do_check_true(item.type == Ci.nsIJumpListItem.JUMPLIST_ITEM_SEPARATOR);
-}
-
-function test_hashes()
-{
- var link = Cc["@mozilla.org/windows-jumplistlink;1"]
- .createInstance(Ci.nsIJumpListLink);
- var uri1 = Cc["@mozilla.org/network/simple-uri;1"]
- .createInstance(Ci.nsIURI);
- var uri2 = Cc["@mozilla.org/network/simple-uri;1"]
- .createInstance(Ci.nsIURI);
-
- uri1.spec = "http://www.123.com/";
- uri2.spec = "http://www.123.com/";
-
- link.uri = uri1;
-
- do_check_true(link.compareHash(uri2))
- uri2.spec = "http://www.456.com/";
- do_check_false(link.compareHash(uri2))
- uri2.spec = "http://www.123.com/";
- do_check_true(link.compareHash(uri2))
- uri2.spec = "https://www.123.com/";
- do_check_false(link.compareHash(uri2))
- uri2.spec = "http://www.123.com/test/";
- do_check_false(link.compareHash(uri2))
- uri1.spec = "http://www.123.com/test/";
- uri2.spec = "http://www.123.com/test/";
- do_check_true(link.compareHash(uri2))
- uri1.spec = "https://www.123.com/test/";
- uri2.spec = "https://www.123.com/test/";
- do_check_true(link.compareHash(uri2))
- uri2.spec = "ftp://www.123.com/test/";
- do_check_false(link.compareHash(uri2))
- uri2.spec = "http://123.com/test/";
- do_check_false(link.compareHash(uri2))
- uri1.spec = "https://www.123.com/test/";
- uri2.spec = "https://www.123.com/Test/";
- do_check_false(link.compareHash(uri2))
-
- uri1.spec = "http://www.123.com/";
- do_check_eq(link.uriHash, "QGLmWuwuTozr3tOfXSf5mg==");
- uri1.spec = "http://www.123.com/test/";
- do_check_eq(link.uriHash, "AG87Ls+GmaUYSUJFETRr3Q==");
- uri1.spec = "https://www.123.com/";
- do_check_eq(link.uriHash, "iSx6UH1a9enVPzUA9JZ42g==");
-
- var uri3 = Cc["@mozilla.org/network/simple-uri;1"]
- .createInstance(Ci.nsIURI);
- link.uri = uri3;
- do_check_eq(link.uriHash, "hTrpDwNRMkvXPqYV5kh1Fw==");
-}
-
-function test_links()
-{
- // links:
- var link1 = Cc["@mozilla.org/windows-jumplistlink;1"]
- .createInstance(Ci.nsIJumpListLink);
- var link2 = Cc["@mozilla.org/windows-jumplistlink;1"]
- .createInstance(Ci.nsIJumpListLink);
-
- var uri1 = Cc["@mozilla.org/network/simple-uri;1"]
- .createInstance(Ci.nsIURI);
- var uri2 = Cc["@mozilla.org/network/simple-uri;1"]
- .createInstance(Ci.nsIURI);
-
- uri1.spec = "http://www.test.com/";
- uri2.spec = "http://www.test.com/";
-
- link1.uri = uri1;
- link1.uriTitle = "Test";
- link2.uri = uri2;
- link2.uriTitle = "Test";
-
- do_check_true(link1.equals(link2));
-
- link2.uriTitle = "Testing";
-
- do_check_false(link1.equals(link2));
-
- link2.uriTitle = "Test";
- uri2.spec = "http://www.testing.com/";
-
- do_check_false(link1.equals(link2));
-}
-
-function test_shortcuts()
-{
- // shortcuts:
- var sc = Cc["@mozilla.org/windows-jumplistshortcut;1"]
- .createInstance(Ci.nsIJumpListShortcut);
-
- var handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"]
- .createInstance(Ci.nsILocalHandlerApp);
-
- handlerApp.name = "TestApp";
- handlerApp.detailedDescription = "TestApp detailed description.";
- handlerApp.appendParameter("-test");
-
- sc.iconIndex = 1;
- do_check_eq(sc.iconIndex, 1);
-
- var faviconPageUri = Cc["@mozilla.org/network/simple-uri;1"]
- .createInstance(Ci.nsIURI);
- faviconPageUri.spec = "http://www.123.com/";
- sc.faviconPageUri = faviconPageUri;
- do_check_eq(sc.faviconPageUri, faviconPageUri);
-
- var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties).
- QueryInterface(Ci.nsIDirectoryService);
- var notepad = dirSvc.get("WinD", Ci.nsIFile);
- notepad.append("notepad.exe");
- if (notepad.exists()) {
- handlerApp.executable = notepad;
- sc.app = handlerApp;
- do_check_eq(sc.app.detailedDescription, "TestApp detailed description.");
- do_check_eq(sc.app.name, "TestApp");
- do_check_true(sc.app.parameterExists("-test"));
- do_check_false(sc.app.parameterExists("-notset"));
- }
-}
-
-function test_jumplist()
-{
- // Jump lists can't register links unless the application is the default
- // protocol handler for the protocol of the link, so we skip off testing
- // those in these tests. We'll init the jump list for the xpc shell harness,
- // add a task item, and commit it.
-
- // not compiled in
- if (Ci.nsIWinTaskbar == null)
- return;
-
- var taskbar = Cc["@mozilla.org/windows-taskbar;1"]
- .getService(Ci.nsIWinTaskbar);
-
- var builder = taskbar.createJumpListBuilder();
-
- do_check_neq(builder, null);
-
- // Win7 and up only
- try {
- var sysInfo = Cc["@mozilla.org/system-info;1"].
- getService(Ci.nsIPropertyBag2);
- var ver = parseFloat(sysInfo.getProperty("version"));
- if (ver < 6.1) {
- do_check_false(builder.available, false);
- return;
- }
- } catch (ex) { }
-
- do_check_true(taskbar.available);
-
- builder.deleteActiveList();
-
- var items = Cc["@mozilla.org/array;1"]
- .createInstance(Ci.nsIMutableArray);
-
- var sc = Cc["@mozilla.org/windows-jumplistshortcut;1"]
- .createInstance(Ci.nsIJumpListShortcut);
-
- var handlerApp = Cc["@mozilla.org/uriloader/local-handler-app;1"]
- .createInstance(Ci.nsILocalHandlerApp);
-
- handlerApp.name = "Notepad";
- handlerApp.detailedDescription = "Testing detailed description.";
-
- var dirSvc = Cc["@mozilla.org/file/directory_service;1"].
- getService(Ci.nsIProperties).
- QueryInterface(Ci.nsIDirectoryService);
- var notepad = dirSvc.get("WinD", Ci.nsIFile);
- notepad.append("notepad.exe");
- if (notepad.exists()) {
- handlerApp.executable = notepad;
- sc.app = handlerApp;
- items.appendElement(sc, false);
-
- var removed = Cc["@mozilla.org/array;1"]
- .createInstance(Ci.nsIMutableArray);
- do_check_true(builder.initListBuild(removed));
- do_check_true(builder.addListToBuild(builder.JUMPLIST_CATEGORY_TASKS, items));
- do_check_true(builder.addListToBuild(builder.JUMPLIST_CATEGORY_RECENT));
- do_check_true(builder.addListToBuild(builder.JUMPLIST_CATEGORY_FREQUENT));
- do_check_true(builder.commitListBuild());
-
- builder.deleteActiveList();
-
- do_check_true(builder.initListBuild(removed));
- do_check_true(builder.addListToBuild(builder.JUMPLIST_CATEGORY_CUSTOM, items, "Custom List"));
- do_check_true(builder.commitListBuild());
-
- builder.deleteActiveList();
- }
-}
-
-function run_test()
-{
- if (mozinfo.os != "win") {
- return;
- }
- test_basics();
- test_separator();
- test_hashes();
- test_links();
- test_shortcuts();
- test_jumplist();
-}
diff --git a/widget/tests/unit/xpcshell.ini b/widget/tests/unit/xpcshell.ini
deleted file mode 100644
index d0e8f8701..000000000
--- a/widget/tests/unit/xpcshell.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[DEFAULT]
-head =
-tail =
-
-[test_taskbar_jumplistitems.js]
-[test_macwebapputils.js]
-skip-if = os != "mac"
diff --git a/widget/tests/utils.js b/widget/tests/utils.js
deleted file mode 100644
index 3796c7d2b..000000000
--- a/widget/tests/utils.js
+++ /dev/null
@@ -1,27 +0,0 @@
-
-function getTestPlugin(pluginName) {
- var ph = SpecialPowers.Cc["@mozilla.org/plugin/host;1"]
- .getService(SpecialPowers.Ci.nsIPluginHost);
- var tags = ph.getPluginTags();
- var name = pluginName || "Test Plug-in";
- for (var tag of tags) {
- if (tag.name == name) {
- return tag;
- }
- }
-
- ok(false, "Could not find plugin tag with plugin name '" + name + "'");
- return null;
-}
-
-// call this to set the test plugin(s) initially expected enabled state.
-// it will automatically be reset to it's previous value after the test
-// ends
-function setTestPluginEnabledState(newEnabledState, pluginName) {
- var plugin = getTestPlugin(pluginName);
- var oldEnabledState = plugin.enabledState;
- plugin.enabledState = newEnabledState;
- SimpleTest.registerCleanupFunction(function() {
- getTestPlugin(pluginName).enabledState = oldEnabledState;
- });
-}
diff --git a/widget/tests/window_bug429954.xul b/widget/tests/window_bug429954.xul
deleted file mode 100644
index 6604e91b4..000000000
--- a/widget/tests/window_bug429954.xul
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<window title="Mozilla Bug 478536"
- onload="start();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml" id="body">
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-function ok(aCondition, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.ok(aCondition, aMessage);
-}
-
-function is(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.is(aLeft, aRight, aMessage);
-}
-
-function isnot(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.isnot(aLeft, aRight, aMessage);
-}
-
-function start() {
- var oldWidth = window.outerWidth, oldHeight = window.outerHeight;
- window.maximize();
- window.restore();
- is(window.outerWidth, oldWidth, "wrong window width after maximize+restore");
- is(window.outerHeight, oldHeight, "wrong window height after maximize+restore");
- window.opener.wrappedJSObject.SimpleTest.finish();
- window.close();
-}
-
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/window_bug478536.xul b/widget/tests/window_bug478536.xul
deleted file mode 100644
index 0a07777b4..000000000
--- a/widget/tests/window_bug478536.xul
+++ /dev/null
@@ -1,215 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<window title="Mozilla Bug 478536"
- width="600" height="600"
- onload="onload();"
- onunload="onunload();"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/paint_listener.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml" id="body">
-<style type="text/css">
- #view {
- overflow: auto;
- width: 100px;
- height: 100px;
- border: 1px solid;
- margin: 0;
- }
-</style>
-<pre id="view" onscroll="onScrollView(event);">
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-function ok(aCondition, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.ok(aCondition, aMessage);
-}
-
-function is(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.is(aLeft, aRight, aMessage);
-}
-
-function isnot(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.isnot(aLeft, aRight, aMessage);
-}
-
-var gBody = document.getElementById("body");
-var gView = document.getElementById("view");
-
-/**
- * Description:
- *
- * First, lock the wheel scrolling target to "view" at first step.
- * Next, scroll back to top most of the "view" at second step.
- * Finally, scroll back again at third step. This fails to scroll the "view",
- * then, |onMouseScrollFailed| event should be fired. And at that time, we
- * can remove the "view". So, in post processing of the event firere, the
- * "view" should not be referred.
- *
- * For suppressing random test failure, all tests will be retried if we handle
- * unexpected timeout event.
- */
-
-var gTests = [
- { scrollToForward: true, shouldScroll: true },
- { scrollToForward: false, shouldScroll: true },
- { scrollToForward: false, shouldScroll: false }
-];
-var gCurrentTestIndex = -1;
-var gIgnoreScrollEvent = true;
-
-var gPrefSvc = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefBranch);
-const kPrefSmoothScroll = "general.smoothScroll";
-const kPrefNameTimeout = "mousewheel.transaction.timeout";
-const kDefaultTimeout = gPrefSvc.getIntPref(kPrefNameTimeout);
-
-gPrefSvc.setBoolPref(kPrefSmoothScroll, false);
-
-var gTimeout = kDefaultTimeout;
-
-gBody.addEventListener("MozMouseScrollFailed", onMouseScrollFailed, false);
-gBody.addEventListener("MozMouseScrollTransactionTimeout",
- onTransactionTimeout, false);
-
-function setTimeoutPrefs(aTimeout)
-{
- gPrefSvc.setIntPref(kPrefNameTimeout, aTimeout);
- gTimeout = aTimeout;
-}
-
-function resetTimeoutPrefs()
-{
- if (gTimeout == kDefaultTimeout)
- return;
- setTimeoutPrefs(kDefaultTimeout);
-}
-
-function growUpTimeoutPrefs()
-{
- if (gTimeout != kDefaultTimeout)
- return;
- setTimeoutPrefs(5000);
-}
-
-function onload()
-{
- disableNonTestMouseEvents(true);
- setTimeout(runNextTest, 0);
-}
-
-function onunload()
-{
- resetTimeoutPrefs();
- disableNonTestMouseEvents(false);
- gPrefSvc.clearUserPref(kPrefSmoothScroll);
- SpecialPowers.DOMWindowUtils.restoreNormalRefresh();
- window.opener.wrappedJSObject.SimpleTest.finish();
-}
-
-function finish()
-{
- window.close();
-}
-
-// testing code
-
-var gTimer;
-function clearTimer()
-{
- clearTimeout(gTimer);
- gTimer = 0;
-}
-
-function runNextTest()
-{
- clearTimer();
- if (++gCurrentTestIndex >= gTests.length) {
- ok(true, "didn't crash, succeeded");
- finish();
- return;
- }
- fireWheelScrollEvent(gTests[gCurrentTestIndex].scrollToForward);
-}
-
-var gRetryCount = 5;
-function retryAllTests()
-{
- clearTimer();
- if (--gRetryCount >= 0) {
- gView.scrollTop = 0;
- gView.scrollLeft = 0;
- gCurrentTestIndex = -1;
- growUpTimeoutPrefs();
- ok(true, "WARNING: retry current test-list...");
- gTimer = setTimeout(runNextTest, 0);
- } else {
- ok(false, "Failed by unexpected timeout");
- finish();
- }
-}
-
-function fireWheelScrollEvent(aForward)
-{
- gIgnoreScrollEvent = false;
- var event = { deltaY: aForward ? 4.0 : -4.0,
- deltaMode: WheelEvent.DOM_DELTA_LINE };
- sendWheelAndPaint(gView, 5, 5, event, function() {
- // No callback - we're just forcing the refresh driver to tick.
- }, window);
-}
-
-function onScrollView(aEvent)
-{
- if (gIgnoreScrollEvent)
- return;
- gIgnoreScrollEvent = true;
- clearTimer();
- ok(gTests[gCurrentTestIndex].shouldScroll, "The view is scrolled");
- gTimer = setTimeout(runNextTest, 0);
-}
-
-function onMouseScrollFailed(aEvent)
-{
- clearTimer();
- gIgnoreScrollEvent = true;
- ok(!gTests[gCurrentTestIndex].shouldScroll, "The view is not scrolled");
- if (!gTests[gCurrentTestIndex].shouldScroll)
- gBody.removeChild(gView);
- runNextTest();
-}
-
-function onTransactionTimeout(aEvent)
-{
- if (!gTimer)
- return;
- gIgnoreScrollEvent = true;
- retryAllTests();
-}
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/window_bug522217.xul b/widget/tests/window_bug522217.xul
deleted file mode 100644
index 8fbb21037..000000000
--- a/widget/tests/window_bug522217.xul
+++ /dev/null
@@ -1,72 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<window title="Mozilla Bug 522217"
- onload="start();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml" id="body">
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-function ok(aCondition, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.ok(aCondition, aMessage);
-}
-
-function is(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.is(aLeft, aRight, aMessage);
-}
-
-function isnot(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.isnot(aLeft, aRight, aMessage);
-}
-
-function executeSoon(aFct)
-{
- window.opener.wrappedJSObject.SimpleTest.executeSoon(aFct);
-}
-
-function start() {
- window.onfocus = function () {
- window.onfocus = null;
- var oldOuterWidth = window.outerWidth, oldOuterHeight = window.outerHeight;
- var oldInnerWidth = window.innerWidth, oldInnerHeight = window.innerHeight;
- document.documentElement.setAttribute("drawintitlebar", "true");
-
- executeSoon(function() {
- is(window.outerWidth, oldOuterWidth, "drawintitlebar shouldn't change the window's outerWidth");
- is(window.outerHeight, oldOuterHeight, "drawintitlebar shouldn't change the window's outerHeight");
- is(window.innerWidth, oldOuterWidth, "if drawintitlebar is set, innerWidth and outerWidth should be the same");
- is(window.innerHeight, oldOuterHeight, "if drawintitlebar is set, innerHeight and outerHeight should be the same");
- window.fullScreen = true;
- window.fullScreen = false;
- is(window.outerWidth, oldOuterWidth, "wrong outerWidth after fullscreen mode");
- is(window.outerHeight, oldOuterHeight, "wrong outerHeight after fullscreen mode");
- is(window.innerWidth, oldOuterWidth, "wrong innerWidth after fullscreen mode");
- is(window.innerHeight, oldOuterHeight, "wrong innerHeight after fullscreen mode");
- document.documentElement.removeAttribute("drawintitlebar");
-
- executeSoon(function() {
- is(window.outerWidth, oldOuterWidth, "wrong outerWidth after removing drawintitlebar");
- is(window.outerHeight, oldOuterHeight, "wrong outerHeight after removing drawintitlebar");
- is(window.innerWidth, oldInnerWidth, "wrong innerWidth after removing drawintitlebar");
- is(window.innerHeight, oldInnerHeight, "wrong innerHeight after removing drawintitlebar");
- window.opener.wrappedJSObject.SimpleTest.finish();
- window.close();
- });
- });
- }
-}
-
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/window_bug538242.xul b/widget/tests/window_bug538242.xul
deleted file mode 100644
index fb878b138..000000000
--- a/widget/tests/window_bug538242.xul
+++ /dev/null
@@ -1,3 +0,0 @@
-<?xml version="1.0"?>
-<window title="Window for Test for Mozilla Bug 538242"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/>
diff --git a/widget/tests/window_bug593307_centerscreen.xul b/widget/tests/window_bug593307_centerscreen.xul
deleted file mode 100644
index 24d708760..000000000
--- a/widget/tests/window_bug593307_centerscreen.xul
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<window title="Mozilla Bug 593307"
- width="100" height="100"
- onload="onload();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml" id="body">
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-function onload()
-{
- var SimpleTest = window.opener.SimpleTest;
- SimpleTest.ok(window.screenX >= 0, "centerscreen window should not start offscreen (X coordinate)");
- SimpleTest.ok(window.screenY >= 0, "centerscreen window should not start offscreen (Y coordinate)");
- window.opener.finished();
-}
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/window_bug593307_offscreen.xul b/widget/tests/window_bug593307_offscreen.xul
deleted file mode 100644
index 0857c73a6..000000000
--- a/widget/tests/window_bug593307_offscreen.xul
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<window title="Mozilla Bug 593307"
- width="100" height="100"
- onload="onLoad();"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml" id="body">
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-var centerscreen = null;
-var SimpleTest = window.arguments[0];
-var finish = window.arguments[1];
-
-function onLoad()
-{
- centerscreen = window.openDialog('window_bug593307_centerscreen.xul','', 'chrome,centerscreen,dependent,dialog=no');
-}
-
-function finished() {
- centerscreen.close();
- finish();
-}
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/window_composition_text_querycontent.xul b/widget/tests/window_composition_text_querycontent.xul
deleted file mode 100644
index a5b9e2655..000000000
--- a/widget/tests/window_composition_text_querycontent.xul
+++ /dev/null
@@ -1,6992 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
- type="text/css"?>
-<window title="Testing composition, text and query content events"
- xmlns:html="http://www.w3.org/1999/xhtml"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- onunload="onunload();">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
-
- <panel id="panel" hidden="true"
- orient="vertical"
- onpopupshown="onPanelShown(event);"
- onpopuphidden="onPanelHidden(event);">
- <vbox id="vbox">
- <textbox id="textbox" onfocus="onFocusPanelTextbox(event);"
- multiline="true" cols="20" rows="4" style="font-size: 36px;"/>
- </vbox>
- </panel>
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<p id="display">
-<div id="div" style="margin: 0; padding: 0; font-size: 36px;">Here is a text frame.</div>
-<textarea style="margin: 0;" id="textarea" cols="20" rows="4"></textarea><br/>
-<iframe id="iframe" width="300" height="150"
- src="data:text/html,&lt;textarea id='textarea' cols='20' rows='4'&gt;&lt;/textarea&gt;"></iframe><br/>
-<iframe id="iframe2" width="300" height="150"
- src="data:text/html,&lt;body onload='document.designMode=%22on%22'&gt;body content&lt;/body&gt;"></iframe><br/>
-<iframe id="iframe3" width="300" height="150"
- src="data:text/html,&lt;body onload='document.designMode=%22on%22'&gt;body content&lt;/body&gt;"></iframe><br/>
-<iframe id="iframe4" width="300" height="150"
- src="data:text/html,&lt;div contenteditable id='contenteditable'&gt;&lt;/div&gt;"></iframe><br/>
-<input id="input" type="text"/><br/>
-</p>
-<div id="content" style="display: none">
-
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-window.opener.wrappedJSObject.SimpleTest.waitForFocus(runTest, window);
-
-function ok(aCondition, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.ok(aCondition, aMessage);
-}
-
-function is(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.is(aLeft, aRight, aMessage);
-}
-
-function isnot(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.isnot(aLeft, aRight, aMessage);
-}
-
-function isSimilarTo(aLeft, aRight, aAllowedDifference, aMessage)
-{
- if (Math.abs(aLeft - aRight) <= aAllowedDifference) {
- ok(true, aMessage);
- } else {
- ok(false, aMessage + ", got=" + aLeft + ", expected=" + (aRight - aAllowedDifference) + "~" + (aRight + aAllowedDifference));
- }
-}
-
-function isGreaterThan(aLeft, aRight, aMessage)
-{
- ok(aLeft > aRight, aMessage + ", got=" + aLeft + ", expected minimum value=" + aRight);
-}
-
-function finish()
-{
- window.close();
-}
-
-function onunload()
-{
- window.opener.wrappedJSObject.SimpleTest.finish();
-}
-
-var div = document.getElementById("div");
-var textarea = document.getElementById("textarea");
-var panel = document.getElementById("panel");
-var textbox = document.getElementById("textbox");
-var iframe = document.getElementById("iframe");
-var iframe2 = document.getElementById("iframe2");
-var iframe3 = document.getElementById("iframe3");
-var contenteditable;
-var windowOfContenteditable;
-var input = document.getElementById("input");
-var textareaInFrame;
-
-const nsITextInputProcessorCallback = Components.interfaces.nsITextInputProcessorCallback;
-const nsIDOMNSEditableElement = Components.interfaces.nsIDOMNSEditableElement;
-const nsIEditorIMESupport = Components.interfaces.nsIEditorIMESupport;
-const nsIInterfaceRequestor = Components.interfaces.nsIInterfaceRequestor;
-const nsIWebNavigation = Components.interfaces.nsIWebNavigation;
-const nsIDocShell = Components.interfaces.nsIDocShell;
-
-function hitEventLoop(aFunc, aTimes)
-{
- if (--aTimes) {
- setTimeout(hitEventLoop, 0, aFunc, aTimes);
- } else {
- setTimeout(aFunc, 20);
- }
-}
-
-function getEditorIMESupport(aNode)
-{
- return aNode.QueryInterface(nsIDOMNSEditableElement).
- editor.
- QueryInterface(nsIEditorIMESupport);
-}
-
-function getHTMLEditorIMESupport(aWindow)
-{
- return aWindow.QueryInterface(nsIInterfaceRequestor).
- getInterface(nsIWebNavigation).
- QueryInterface(nsIDocShell).
- editor;
-}
-
-const kIsWin = (navigator.platform.indexOf("Win") == 0);
-const kIsMac = (navigator.platform.indexOf("Mac") == 0);
-
-const kLFLen = kIsWin ? 2 : 1;
-const kLF = kIsWin ? "\r\n" : "\n";
-
-function checkQueryContentResult(aResult, aMessage)
-{
- ok(aResult, aMessage + ": the result is null");
- if (!aResult) {
- return false;
- }
- ok(aResult.succeeded, aMessage + ": the query content failed");
- return aResult.succeeded;
-}
-
-function checkContent(aExpectedText, aMessage, aID)
-{
- if (!aID) {
- aID = "";
- }
- var textContent = synthesizeQueryTextContent(0, 100);
- if (!checkQueryContentResult(textContent, aMessage +
- ": synthesizeQueryTextContent " + aID)) {
- return false;
- }
- is(textContent.text, aExpectedText,
- aMessage + ": composition string is wrong " + aID);
- return textContent.text == aExpectedText;
-}
-
-function checkContentRelativeToSelection(aRelativeOffset, aLength, aExpectedOffset, aExpectedText, aMessage, aID)
-{
- if (!aID) {
- aID = "";
- }
- aMessage += " (aRelativeOffset=" + aRelativeOffset + "): "
- var textContent = synthesizeQueryTextContent(aRelativeOffset, aLength, true);
- if (!checkQueryContentResult(textContent, aMessage +
- "synthesizeQueryTextContent " + aID)) {
- return false;
- }
- is(textContent.offset, aExpectedOffset,
- aMessage + "offset is wrong " + aID);
- is(textContent.text, aExpectedText,
- aMessage + "text is wrong " + aID);
- return textContent.offset == aExpectedOffset &&
- textContent.text == aExpectedText;
-}
-
-function checkSelection(aExpectedOffset, aExpectedText, aMessage, aID)
-{
- if (!aID) {
- aID = "";
- }
- var selectedText = synthesizeQuerySelectedText();
- if (!checkQueryContentResult(selectedText, aMessage +
- ": synthesizeQuerySelectedText " + aID)) {
- return false;
- }
- is(selectedText.offset, aExpectedOffset,
- aMessage + ": selection offset is wrong " + aID);
- is(selectedText.text, aExpectedText,
- aMessage + ": selected text is wrong " + aID);
- return selectedText.offset == aExpectedOffset &&
- selectedText.text == aExpectedText;
-}
-
-function checkIMESelection(aSelectionType, aExpectedFound, aExpectedOffset, aExpectedText, aMessage, aID)
-{
- if (!aID) {
- aID = "";
- }
- aMessage += " (" + aSelectionType + ")";
- var selectionType = 0;
- switch (aSelectionType) {
- case "RawClause":
- selectionType = QUERY_CONTENT_FLAG_SELECTION_IME_RAWINPUT;
- break;
- case "SelectedRawClause":
- selectionType = QUERY_CONTENT_FLAG_SELECTION_IME_SELECTEDRAWTEXT;
- break;
- case "ConvertedClause":
- selectionType = QUERY_CONTENT_FLAG_SELECTION_IME_CONVERTEDTEXT;
- break;
- case "SelectedClause":
- selectionType = QUERY_CONTENT_FLAG_SELECTION_IME_SELECTEDCONVERTEDTEXT;
- break;
- default:
- ok(false, aMessage + ": invalid selection type, " + aSelectionType);
- }
- isnot(selectionType, 0, aMessage + ": wrong value");
- var selectedText = synthesizeQuerySelectedText(selectionType);
- if (!checkQueryContentResult(selectedText, aMessage +
- ": synthesizeQuerySelectedText " + aID)) {
- return false;
- }
- is(selectedText.notFound, !aExpectedFound,
- aMessage + ": selection should " + (aExpectedFound ? "" : "not") + " be found " + aID);
- if (selectedText.notFound) {
- return selectedText.notFound == !aExpectedFound;
- }
-
- is(selectedText.offset, aExpectedOffset,
- aMessage + ": selection offset is wrong " + aID);
- is(selectedText.text, aExpectedText,
- aMessage + ": selected text is wrong " + aID);
- return selectedText.offset == aExpectedOffset &&
- selectedText.text == aExpectedText;
-}
-
-function checkRect(aRect, aExpectedRect, aMessage)
-{
- is(aRect.left, aExpectedRect.left, aMessage + ": left is wrong");
- is(aRect.top, aExpectedRect.top, aMessage + " top is wrong");
- is(aRect.width, aExpectedRect.width, aMessage + ": width is wrong");
- is(aRect.height, aExpectedRect.height, aMessage + ": height is wrong");
- return aRect.left == aExpectedRect.left &&
- aRect.top == aExpectedRect.top &&
- aRect.width == aExpectedRect.width &&
- aRect.height == aExpectedRect.height;
-}
-
-function checkRectArray(aQueryTextRectArrayResult, aExpectedTextRectArray, aMessage)
-{
- for (var i = 1; i < aExpectedTextRectArray.length; ++i) {
- var rect = { left: {}, top: {}, width: {}, height: {} };
- try {
- aQueryTextRectArrayResult.getCharacterRect(i, rect.left, rect.top, rect.width, rect.height);
- } catch (e) {
- ok(false, aMessage + ": failed to retrieve " + i + "th rect (" + e + ")");
- return false;
- }
- function toRect(aRect)
- {
- return { left: aRect.left.value, top: aRect.top.value, width: aRect.width.value, height: aRect.height.value };
- }
- if (!checkRect(toRect(rect), aExpectedTextRectArray[i], aMessage + " " + i + "th rect")) {
- return false;
- }
- }
- return true;
-}
-
-function checkRectContainsRect(aRect, aContainer, aMessage)
-{
- var container = { left: Math.ceil(aContainer.left),
- top: Math.ceil(aContainer.top),
- width: Math.floor(aContainer.width),
- height: Math.floor(aContainer.height) };
-
- var ret = container.left <= aRect.left &&
- container.top <= aRect.top &&
- container.left + container.width >= aRect.left + aRect.width &&
- container.top + container.height >= aRect.top + aRect.height;
- ret = ret && aMessage;
- ok(ret, aMessage + " container={ left=" + container.left + ", top=" +
- container.top + ", width=" + container.width + ", height=" +
- container.height + " } rect={ left=" + aRect.left + ", top=" + aRect.top +
- ", width=" + aRect.width + ", height=" + aRect.height + " }");
- return ret;
-}
-
-function runUndoRedoTest()
-{
- textarea.value = "";
- textarea.focus();
-
- // input raw characters
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306D",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306D\u3053",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- // convert
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u732B",
- "clauses":
- [
- { "length": 1,
- "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- // commit
- synthesizeComposition({ type: "compositioncommitasis" });
-
- // input raw characters
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u307E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- // cancel the composition
- synthesizeComposition({ type: "compositioncommit", data: "" });
-
- // input raw characters
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3080",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3080\u3059",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3080\u3059\u3081",
- "clauses":
- [
- { "length": 3, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 3, "length": 0 }
- });
-
- // convert
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u5A18",
- "clauses":
- [
- { "length": 1,
- "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- // commit
- synthesizeComposition({ type: "compositioncommitasis" });
-
- synthesizeKey(" ", {});
- synthesizeKey("m", {});
- synthesizeKey("e", {});
- synthesizeKey("a", {});
- synthesizeKey("n", {});
- synthesizeKey("t", {});
- synthesizeKey("VK_BACK_SPACE", {});
- synthesizeKey("s", {});
- synthesizeKey(" ", {});
- synthesizeKey("\"", {});
- synthesizeKey("c", {});
- synthesizeKey("a", {});
- synthesizeKey("t", {});
- synthesizeKey("-", {});
- synthesizeKey("g", {});
- synthesizeKey("i", {});
- synthesizeKey("r", {});
- synthesizeKey("l", {});
- synthesizeKey("\"", {});
- synthesizeKey(".", {});
- synthesizeKey(" ", {});
- synthesizeKey("VK_SHIFT", { type: "keydown" });
- synthesizeKey("S", { shiftKey: true });
- synthesizeKey("VK_SHIFT", { type: "keyup" });
- synthesizeKey("h", {});
- synthesizeKey("e", {});
- synthesizeKey(" ", {});
- synthesizeKey("i", {});
- synthesizeKey("s", {});
- synthesizeKey(" ", {});
- synthesizeKey("a", {});
- synthesizeKey(" ", {});
-
- // input raw characters
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3088",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3088\u3046",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3088\u3046\u304b",
- "clauses":
- [
- { "length": 3, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 3, "length": 0 }
- });
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3088\u3046\u304b\u3044",
- "clauses":
- [
- { "length": 4, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 4, "length": 0 }
- });
-
- // convert
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u5996\u602a",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- // commit
- synthesizeComposition({ type: "compositioncommitasis" });
-
- synthesizeKey("VK_BACK_SPACE", {});
- synthesizeKey("VK_BACK_SPACE", {});
- synthesizeKey("VK_BACK_SPACE", {});
- synthesizeKey("VK_BACK_SPACE", {});
- synthesizeKey("VK_BACK_SPACE", {});
- synthesizeKey("VK_BACK_SPACE", {});
- synthesizeKey("VK_BACK_SPACE", {});
- synthesizeKey("VK_BACK_SPACE", {});
- synthesizeKey("VK_BACK_SPACE", {});
- synthesizeKey("VK_BACK_SPACE", {});
- synthesizeKey("VK_BACK_SPACE", {});
- synthesizeKey("VK_BACK_SPACE", {});
-
- var i = 0;
- if (!checkContent("\u732B\u5A18 means \"cat-girl\".",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(20, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true});
-
- if (!checkContent("\u732B\u5A18 means \"cat-girl\". She is a \u5996\u602A",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(32, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true});
-
- if (!checkContent("\u732B\u5A18 means \"cat-girl\". She is a ",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(30, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true});
-
- if (!checkContent("\u732B\u5A18 mean",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(7, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true});
-
- if (!checkContent("\u732B\u5A18 meant",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(8, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true});
-
- if (!checkContent("\u732B\u5A18",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(2, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true});
-
- if (!checkContent("\u732B",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(1, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true});
-
- // XXX this is unexpected behavior, see bug 258291
- if (!checkContent("\u732B",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(1, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true});
-
- if (!checkContent("",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(0, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true});
-
- if (!checkContent("",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(0, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true, shiftKey: true});
-
- if (!checkContent("\u732B",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(1, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true, shiftKey: true});
-
- // XXX this is unexpected behavior, see bug 258291
- if (!checkContent("\u732B",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(1, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true, shiftKey: true});
-
- if (!checkContent("\u732B\u5A18",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(2, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true, shiftKey: true});
-
- if (!checkContent("\u732B\u5A18 meant",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(8, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true, shiftKey: true});
-
- if (!checkContent("\u732B\u5A18 mean",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(7, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true, shiftKey: true});
-
- if (!checkContent("\u732B\u5A18 means \"cat-girl\". She is a ",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(30, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true, shiftKey: true});
-
- if (!checkContent("\u732B\u5A18 means \"cat-girl\". She is a \u5996\u602A",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(32, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true, shiftKey: true});
-
- if (!checkContent("\u732B\u5A18 means \"cat-girl\".",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(20, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-
- synthesizeKey("Z", {accelKey: true, shiftKey: true});
-
- if (!checkContent("\u732B\u5A18 means \"cat-girl\".",
- "runUndoRedoTest", "#" + ++i) ||
- !checkSelection(20, "", "runUndoRedoTest", "#" + i)) {
- return;
- }
-}
-
-function runCompositionCommitAsIsTest()
-{
- textarea.focus();
-
- var result = {};
- function clearResult()
- {
- result = { compositionupdate: false, compositionend: false, text: false, input: false }
- }
-
- function handler(aEvent)
- {
- result[aEvent.type] = true;
- }
-
- textarea.addEventListener("compositionupdate", handler, true);
- textarea.addEventListener("compositionend", handler, true);
- textarea.addEventListener("input", handler, true);
- textarea.addEventListener("text", handler, true);
-
- // compositioncommitasis with composing string.
- textarea.value = "";
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- is(textarea.value, "\u3042", "runCompositionCommitAsIsTest: textarea doesn't have composition string #1");
-
- clearResult();
- synthesizeComposition({ type: "compositioncommitasis" });
-
- is(result.compositionupdate, false, "runCompositionCommitAsIsTest: compositionupdate shouldn't be fired after dispatching compositioncommitasis #1");
- is(result.compositionend, true, "runCompositionCommitAsIsTest: compositionend should be fired after dispatching compositioncommitasis #1");
- is(result.text, true, "runCompositionCommitAsIsTest: text should be fired after dispatching compositioncommitasis because it's dispatched when there is composing string #1");
- is(result.input, true, "runCompositionCommitAsIsTest: input should be fired after dispatching compositioncommitasis #1");
- is(textarea.value, "\u3042", "runCompositionCommitAsIsTest: textarea doesn't have committed string #1");
-
- // compositioncommitasis with committed string.
- textarea.value = "";
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- is(textarea.value, "\u3042", "runCompositionCommitAsIsTest: textarea doesn't have composition string #2");
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- is(textarea.value, "\u3042", "runCompositionCommitAsIsTest: textarea doesn't have committed string #2");
-
- clearResult();
- synthesizeComposition({ type: "compositioncommitasis" });
-
- is(result.compositionupdate, false, "runCompositionCommitAsIsTest: compositionupdate shouldn't be fired after dispatching compositioncommitasis #2");
- is(result.compositionend, true, "runCompositionCommitAsIsTest: compositionend should be fired after dispatching compositioncommitasis #2");
- is(result.text, false, "runCompositionCommitAsIsTest: text shouldn't be fired after dispatching compositioncommitasis because it's dispatched when there is already committed string #2");
- is(result.input, true, "runCompositionCommitAsIsTest: input should be fired after dispatching compositioncommitasis #2");
- is(textarea.value, "\u3042", "runCompositionCommitAsIsTest: textarea doesn't have committed string #2");
-
- // compositioncommitasis with committed string.
- textarea.value = "";
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- is(textarea.value, "\u3042", "runCompositionCommitAsIsTest: textarea doesn't have composition string #3");
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 0, "length": 0 }
- });
- is(textarea.value, "", "runCompositionCommitAsIsTest: textarea has non-empty composition string #3");
-
- clearResult();
- synthesizeComposition({ type: "compositioncommitasis" });
-
- is(result.compositionupdate, false, "runCompositionCommitAsIsTest: compositionupdate shouldn't be fired after dispatching compositioncommitasis #3");
- is(result.compositionend, true, "runCompositionCommitAsIsTest: compositionend should be fired after dispatching compositioncommitasis #3");
- is(result.text, false, "runCompositionCommitAsIsTest: text shouldn't be fired after dispatching compositioncommitasis because it's dispatched when there is empty composition string #3");
- is(result.input, true, "runCompositionCommitAsIsTest: input should be fired after dispatching compositioncommitasis #3");
- is(textarea.value, "", "runCompositionCommitAsIsTest: textarea doesn't have committed string #3");
-
- textarea.removeEventListener("compositionupdate", handler, true);
- textarea.removeEventListener("compositionend", handler, true);
- textarea.removeEventListener("input", handler, true);
- textarea.removeEventListener("text", handler, true);
-}
-
-function runCompositionCommitTest()
-{
- textarea.focus();
-
- var result = {};
- function clearResult()
- {
- result = { compositionupdate: false, compositionend: false, text: false, input: false }
- }
-
- function handler(aEvent)
- {
- result[aEvent.type] = true;
- }
-
- textarea.addEventListener("compositionupdate", handler, true);
- textarea.addEventListener("compositionend", handler, true);
- textarea.addEventListener("input", handler, true);
- textarea.addEventListener("text", handler, true);
-
- // compositioncommit with different composing string.
- textarea.value = "";
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- is(textarea.value, "\u3042", "runCompositionCommitTest: textarea doesn't have composition string #1");
-
- clearResult();
- synthesizeComposition({ type: "compositioncommit", data: "\u3043" });
-
- is(result.compositionupdate, true, "runCompositionCommitTest: compositionupdate should be fired after dispatching compositioncommit #1");
- is(result.compositionend, true, "runCompositionCommitTest: compositionend should be fired after dispatching compositioncommit #1");
- is(result.text, true, "runCompositionCommitTest: text should be fired after dispatching compositioncommit because it's dispatched when there is compoing string #1");
- is(result.input, true, "runCompositionCommitTest: input should be fired after dispatching compositioncommit #1");
- is(textarea.value, "\u3043", "runCompositionCommitTest: textarea doesn't have committed string #1");
-
- // compositioncommit with different committed string when there is already committed string
- textarea.value = "";
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- is(textarea.value, "\u3042", "runCompositionCommitTest: textarea doesn't have composition string #2");
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- is(textarea.value, "\u3042", "runCompositionCommitTest: textarea doesn't have committed string #2");
-
- clearResult();
- synthesizeComposition({ type: "compositioncommit", data: "\u3043" });
-
- is(result.compositionupdate, true, "runCompositionCommitTest: compositionupdate should be fired after dispatching compositioncommit #2");
- is(result.compositionend, true, "runCompositionCommitTest: compositionend should be fired after dispatching compositioncommit #2");
- is(result.text, true, "runCompositionCommitTest: text should be fired after dispatching compositioncommit #2");
- is(result.input, true, "runCompositionCommitTest: input should be fired after dispatching compositioncommit #2");
- is(textarea.value, "\u3043", "runCompositionCommitTest: textarea doesn't have committed string #2");
-
- // compositioncommit with empty composition string.
- textarea.value = "";
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- is(textarea.value, "\u3042", "runCompositionCommitTest: textarea doesn't have composition string #3");
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 0, "length": 0 }
- });
- is(textarea.value, "", "runCompositionCommitTest: textarea has non-empty composition string #3");
-
- clearResult();
- synthesizeComposition({ type: "compositioncommit", data: "\u3043" });
-
- is(result.compositionupdate, true, "runCompositionCommitTest: compositionupdate should be fired after dispatching compositioncommit #3");
- is(result.compositionend, true, "runCompositionCommitTest: compositionend should be fired after dispatching compositioncommit #3");
- is(result.text, true, "runCompositionCommitTest: text should be fired after dispatching compositioncommit #3");
- is(result.input, true, "runCompositionCommitTest: input should be fired after dispatching compositioncommit #3");
- is(textarea.value, "\u3043", "runCompositionCommitTest: textarea doesn't have committed string #3");
-
- // compositioncommit with non-empty composition string.
- textarea.value = "";
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- is(textarea.value, "\u3042", "runCompositionCommitTest: textarea doesn't have composition string #4");
-
- clearResult();
- synthesizeComposition({ type: "compositioncommit", data: "" });
-
- is(result.compositionupdate, true, "runCompositionCommitTest: compositionupdate should be fired after dispatching compositioncommit #4");
- is(result.compositionend, true, "runCompositionCommitTest: compositionend should be fired after dispatching compositioncommit #4");
- is(result.text, true, "runCompositionCommitTest: text should be fired after dispatching compositioncommit #4");
- is(result.input, true, "runCompositionCommitTest: input should be fired after dispatching compositioncommit #4");
- is(textarea.value, "", "runCompositionCommitTest: textarea should be empty #4");
-
- // compositioncommit immediately without compositionstart
- textarea.value = "";
-
- clearResult();
- synthesizeComposition({ type: "compositioncommit", data: "\u3042" });
-
- is(result.compositionupdate, true, "runCompositionCommitTest: compositionupdate should be fired after dispatching compositioncommit #5");
- is(result.compositionend, true, "runCompositionCommitTest: compositionend should be fired after dispatching compositioncommit #5");
- is(result.text, true, "runCompositionCommitTest: text should be fired after dispatching compositioncommit #5");
- is(result.input, true, "runCompositionCommitTest: input should be fired after dispatching compositioncommit #5");
- is(textarea.value, "\u3042", "runCompositionCommitTest: textarea should be empty #5");
-
- // compositioncommit with same composition string.
- textarea.value = "";
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- is(textarea.value, "\u3042", "runCompositionCommitTest: textarea doesn't have composition string #5");
-
- clearResult();
- synthesizeComposition({ type: "compositioncommit", data: "\u3042" });
-
- is(result.compositionupdate, false, "runCompositionCommitTest: compositionupdate shouldn't be fired after dispatching compositioncommit #5");
- is(result.compositionend, true, "runCompositionCommitTest: compositionend should be fired after dispatching compositioncommit #5");
- is(result.text, true, "runCompositionCommitTest: text should be fired after dispatching compositioncommit because there was composition string #5");
- is(result.input, true, "runCompositionCommitTest: input should be fired after dispatching compositioncommit #5");
- is(textarea.value, "\u3042", "runCompositionCommitTest: textarea should have committed string #5");
-
- // compositioncommit with same composition string when there is committed string
- textarea.value = "";
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- is(textarea.value, "\u3042", "runCompositionCommitTest: textarea doesn't have composition string #6");
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- is(textarea.value, "\u3042", "runCompositionCommitTest: textarea doesn't have composition string #6");
-
- clearResult();
- synthesizeComposition({ type: "compositioncommit", data: "\u3042" });
-
- is(result.compositionupdate, false, "runCompositionCommitTest: compositionupdate shouldn't be fired after dispatching compositioncommit #6");
- is(result.compositionend, true, "runCompositionCommitTest: compositionend should be fired after dispatching compositioncommit #6");
- is(result.text, false, "runCompositionCommitTest: text shouldn't be fired after dispatching compositioncommit because there was already committed string #6");
- is(result.input, true, "runCompositionCommitTest: input should be fired after dispatching compositioncommit #6");
- is(textarea.value, "\u3042", "runCompositionCommitTest: textarea should have committed string #6");
-
- textarea.removeEventListener("compositionupdate", handler, true);
- textarea.removeEventListener("compositionend", handler, true);
- textarea.removeEventListener("input", handler, true);
- textarea.removeEventListener("text", handler, true);
-}
-
-function runCompositionTest()
-{
- textarea.value = "";
- textarea.focus();
- var caretRects = [];
-
- var caretRect = synthesizeQueryCaretRect(0);
- if (!checkQueryContentResult(caretRect,
- "runCompositionTest: synthesizeQueryCaretRect #0")) {
- return false;
- }
- caretRects[0] = caretRect;
-
- // input first character
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- if (!checkContent("\u3089", "runCompositionTest", "#1-1") ||
- !checkSelection(1, "", "runCompositionTest", "#1-1")) {
- return;
- }
-
- caretRect = synthesizeQueryCaretRect(1);
- if (!checkQueryContentResult(caretRect,
- "runCompositionTest: synthesizeQueryCaretRect #1-1")) {
- return false;
- }
- caretRects[1] = caretRect;
-
- // input second character
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC", "runCompositionTest", "#1-2") ||
- !checkSelection(2, "", "runCompositionTest", "#1-2")) {
- return;
- }
-
- caretRect = synthesizeQueryCaretRect(2);
- if (!checkQueryContentResult(caretRect,
- "runCompositionTest: synthesizeQueryCaretRect #1-2")) {
- return false;
- }
- caretRects[2] = caretRect;
-
- isnot(caretRects[2].left, caretRects[1].left,
- "runCompositionTest: caret isn't moved (#1-2)");
- is(caretRects[2].top, caretRects[1].top,
- "runCompositionTest: caret is moved to another line (#1-2)");
- is(caretRects[2].width, caretRects[1].width,
- "runCompositionTest: caret width is wrong (#1-2)");
- is(caretRects[2].height, caretRects[1].height,
- "runCompositionTest: caret width is wrong (#1-2)");
-
- // input third character
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081",
- "clauses":
- [
- { "length": 3, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 3, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081", "runCompositionTest", "#1-3") ||
- !checkSelection(3, "", "runCompositionTest", "#1-3")) {
- return;
- }
-
- caretRect = synthesizeQueryCaretRect(3);
- if (!checkQueryContentResult(caretRect,
- "runCompositionTest: synthesizeQueryCaretRect #1-3")) {
- return false;
- }
- caretRects[3] = caretRect;
-
- isnot(caretRects[3].left, caretRects[2].left,
- "runCompositionTest: caret isn't moved (#1-3)");
- is(caretRects[3].top, caretRects[2].top,
- "runCompositionTest: caret is moved to another line (#1-3)");
- is(caretRects[3].width, caretRects[2].width,
- "runCompositionTest: caret width is wrong (#1-3)");
- is(caretRects[3].height, caretRects[2].height,
- "runCompositionTest: caret height is wrong (#1-3)");
-
- // moves the caret left
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081",
- "clauses":
- [
- { "length": 3, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081", "runCompositionTest", "#1-3-1") ||
- !checkSelection(2, "", "runCompositionTest", "#1-3-1")) {
- return;
- }
-
-
- caretRect = synthesizeQueryCaretRect(2);
- if (!checkQueryContentResult(caretRect,
- "runCompositionTest: synthesizeQueryCaretRect #1-3-1")) {
- return false;
- }
-
- is(caretRect.left, caretRects[2].left,
- "runCompositionTest: caret rects are different (#1-3-1, left)");
- is(caretRect.top, caretRects[2].top,
- "runCompositionTest: caret rects are different (#1-3-1, top)");
- // by bug 335359, the caret width depends on the right side's character.
- is(caretRect.width, caretRects[2].width + 1,
- "runCompositionTest: caret rects are different (#1-3-1, width)");
- is(caretRect.height, caretRects[2].height,
- "runCompositionTest: caret rects are different (#1-3-1, height)");
-
- // moves the caret left
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081",
- "clauses":
- [
- { "length": 3, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081", "runCompositionTest", "#1-3-2") ||
- !checkSelection(1, "", "runCompositionTest", "#1-3-2")) {
- return;
- }
-
-
- caretRect = synthesizeQueryCaretRect(1);
- if (!checkQueryContentResult(caretRect,
- "runCompositionTest: synthesizeQueryCaretRect #1-3-2")) {
- return false;
- }
-
- is(caretRect.left, caretRects[1].left,
- "runCompositionTest: caret rects are different (#1-3-2, left)");
- is(caretRect.top, caretRects[1].top,
- "runCompositionTest: caret rects are different (#1-3-2, top)");
- // by bug 335359, the caret width depends on the right side's character.
- is(caretRect.width, caretRects[1].width + 1,
- "runCompositionTest: caret rects are different (#1-3-2, width)");
- is(caretRect.height, caretRects[1].height,
- "runCompositionTest: caret rects are different (#1-3-2, height)");
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081\u3093",
- "clauses":
- [
- { "length": 4, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 4, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081\u3093", "runCompositionTest", "#1-4") ||
- !checkSelection(4, "", "runCompositionTest", "#1-4")) {
- return;
- }
-
-
- // backspace
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081",
- "clauses":
- [
- { "length": 3, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 3, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081", "runCompositionTest", "#1-5") ||
- !checkSelection(3, "", "runCompositionTest", "#1-5")) {
- return;
- }
-
- // re-input
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081\u3093",
- "clauses":
- [
- { "length": 4, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 4, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081\u3093", "runCompositionTest", "#1-6") ||
- !checkSelection(4, "", "runCompositionTest", "#1-6")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081\u3093\u3055",
- "clauses":
- [
- { "length": 5, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 5, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081\u3093\u3055", "runCompositionTest", "#1-7") ||
- !checkSelection(5, "", "runCompositionTest", "#1-7")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081\u3093\u3055\u3044",
- "clauses":
- [
- { "length": 6, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 6, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044", "runCompositionTest", "#1-8") ||
- !checkSelection(6, "", "runCompositionTest", "#1-8")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081\u3093\u3055\u3044\u3053",
- "clauses":
- [
- { "length": 7, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 7, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044\u3053", "runCompositionTest", "#1-8") ||
- !checkSelection(7, "", "runCompositionTest", "#1-8")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081\u3093\u3055\u3044\u3053\u3046",
- "clauses":
- [
- { "length": 8, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 8, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044\u3053\u3046",
- "runCompositionTest", "#1-9") ||
- !checkSelection(8, "", "runCompositionTest", "#1-9")) {
- return;
- }
-
- // convert
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
- "clauses":
- [
- { "length": 4,
- "attr": COMPOSITION_ATTR_SELECTED_CLAUSE },
- { "length": 2,
- "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE }
- ]
- },
- "caret": { "start": 4, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
- "runCompositionTest", "#1-10") ||
- !checkSelection(4, "", "runCompositionTest", "#1-10")) {
- return;
- }
-
- // change the selected clause
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
- "clauses":
- [
- { "length": 4,
- "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE },
- { "length": 2,
- "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 6, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
- "runCompositionTest", "#1-11") ||
- !checkSelection(6, "", "runCompositionTest", "#1-11")) {
- return;
- }
-
- // reset clauses
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046",
- "clauses":
- [
- { "length": 5,
- "attr": COMPOSITION_ATTR_SELECTED_CLAUSE },
- { "length": 3,
- "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE }
- ]
- },
- "caret": { "start": 5, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046",
- "runCompositionTest", "#1-12") ||
- !checkSelection(5, "", "runCompositionTest", "#1-12")) {
- return;
- }
-
-
- var textRect1 = synthesizeQueryTextRect(0, 1);
- var textRect2 = synthesizeQueryTextRect(1, 1);
- if (!checkQueryContentResult(textRect1,
- "runCompositionTest: synthesizeQueryTextRect #1-12-1") ||
- !checkQueryContentResult(textRect2,
- "runCompositionTest: synthesizeQueryTextRect #1-12-2")) {
- return false;
- }
-
- // commit the composition string
- synthesizeComposition({ type: "compositioncommitasis" });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046",
- "runCompositionTest", "#1-13") ||
- !checkSelection(8, "", "runCompositionTest", "#1-13")) {
- return;
- }
-
- var textRect3 = synthesizeQueryTextRect(0, 1);
- var textRect4 = synthesizeQueryTextRect(1, 1);
-
- if (!checkQueryContentResult(textRect3,
- "runCompositionTest: synthesizeQueryTextRect #1-13-1") ||
- !checkQueryContentResult(textRect4,
- "runCompositionTest: synthesizeQueryTextRect #1-13-2")) {
- return false;
- }
-
- checkRect(textRect3, textRect1, "runCompositionTest: textRect #1-13-1");
- checkRect(textRect4, textRect2, "runCompositionTest: textRect #1-13-2");
-
- // restart composition and input characters
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3057",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046\u3057",
- "runCompositionTest", "#2-1") ||
- !checkSelection(8 + 1, "", "runCompositionTest", "#2-1")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3058",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046\u3058",
- "runCompositionTest", "#2-2") ||
- !checkSelection(8 + 1, "", "runCompositionTest", "#2-2")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3058\u3087",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046\u3058\u3087",
- "runCompositionTest", "#2-3") ||
- !checkSelection(8 + 2, "", "runCompositionTest", "#2-3")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3058\u3087\u3046",
- "clauses":
- [
- { "length": 3, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 3, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046\u3058\u3087\u3046",
- "runCompositionTest", "#2-4") ||
- !checkSelection(8 + 3, "", "runCompositionTest", "#2-4")) {
- return;
- }
-
- // commit the composition string
- synthesizeComposition({ type: "compositioncommitasis" });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3055\u884C\u3053\u3046\u3058\u3087\u3046",
- "runCompositionTest", "#2-4") ||
- !checkSelection(8 + 3, "", "runCompositionTest", "#2-4")) {
- return;
- }
-
- // set selection
- var selectionSetTest = synthesizeSelectionSet(4, 7, false);
- ok(selectionSetTest, "runCompositionTest: selectionSetTest failed");
-
- if (!checkSelection(4, "\u3055\u884C\u3053\u3046\u3058\u3087\u3046", "runCompositionTest", "#3-1")) {
- return;
- }
-
- // start composition with selection
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u304A",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u304A",
- "runCompositionTest", "#3-2") ||
- !checkSelection(4 + 1, "", "runCompositionTest", "#3-2")) {
- return;
- }
-
- // remove the composition string
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 0, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
- "runCompositionTest", "#3-3") ||
- !checkSelection(4, "", "runCompositionTest", "#3-3")) {
- return;
- }
-
- // re-input the composition string
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3046",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u3046",
- "runCompositionTest", "#3-4") ||
- !checkSelection(4 + 1, "", "runCompositionTest", "#3-4")) {
- return;
- }
-
- // cancel the composition
- synthesizeComposition({ type: "compositioncommit", data: "" });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
- "runCompositionTest", "#3-5") ||
- !checkSelection(4, "", "runCompositionTest", "#3-5")) {
- return;
- }
-
- // bug 271815, some Chinese IMEs for Linux make empty composition string
- // and compty clause information when it lists up Chinese characters on
- // its candidate window.
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 0, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
- "runCompositionTest", "#4-1") ||
- !checkSelection(4, "", "runCompositionTest", "#4-1")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 0, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
- "runCompositionTest", "#4-2") ||
- !checkSelection(4, "", "runCompositionTest", "#4-2")) {
- return;
- }
-
- synthesizeComposition({ type: "compositioncommit", data: "\u6700" });
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700",
- "runCompositionTest", "#4-3") ||
- !checkSelection(5, "", "runCompositionTest", "#4-3")) {
- return;
- }
-
- // testing the canceling case
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 0, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700",
- "runCompositionTest", "#4-5") ||
- !checkSelection(5, "", "runCompositionTest", "#4-5")) {
- return;
- }
-
- synthesizeComposition({ type: "compositioncommitasis" });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700",
- "runCompositionTest", "#4-6") ||
- !checkSelection(5, "", "runCompositionTest", "#4-6")) {
- return;
- }
-
- // testing whether the empty composition string deletes selected string.
- synthesizeKey("VK_LEFT", { shiftKey: true });
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 0, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
- "runCompositionTest", "#4-8") ||
- !checkSelection(4, "", "runCompositionTest", "#4-8")) {
- return;
- }
-
- synthesizeComposition({ type: "compositioncommit", data: "\u9AD8" });
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u9AD8",
- "runCompositionTest", "#4-9") ||
- !checkSelection(5, "", "runCompositionTest", "#4-9")) {
- return;
- }
-
- synthesizeKey("VK_BACK_SPACE", {});
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
- "runCompositionTest", "#4-11") ||
- !checkSelection(4, "", "runCompositionTest", "#4-11")) {
- return;
- }
-
- // bug 23558, ancient Japanese IMEs on Window may send empty text event
- // twice at canceling composition.
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u6700",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700",
- "runCompositionTest", "#5-1") ||
- !checkSelection(4 + 1, "", "runCompositionTest", "#5-1")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- "caret": { "start": 0, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
- "runCompositionTest", "#5-2") ||
- !checkSelection(4, "", "runCompositionTest", "#5-2")) {
- return;
- }
-
- synthesizeComposition({ type: "compositioncommitasis" });
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
- "runCompositionTest", "#5-3") ||
- !checkSelection(4, "", "runCompositionTest", "#5-3")) {
- return;
- }
-
- // Undo tests for the testcases for bug 23558 and bug 271815
- synthesizeKey("Z", { accelKey: true });
-
- // XXX this is unexpected behavior, see bug 258291
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
- "runCompositionTest", "#6-1") ||
- !checkSelection(4, "", "runCompositionTest", "#6-1")) {
- return;
- }
-
- synthesizeKey("Z", { accelKey: true });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u9AD8",
- "runCompositionTest", "#6-2") ||
- !checkSelection(5, "", "runCompositionTest", "#6-2")) {
- return;
- }
-
- synthesizeKey("Z", { accelKey: true });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700",
- "runCompositionTest", "#6-3") ||
- !checkSelection(4, "\u6700", "runCompositionTest", "#6-3")) {
- return;
- }
-
- synthesizeKey("Z", { accelKey: true });
-
- // XXX this is unexpected behavior, see bug 258291
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700",
- "runCompositionTest", "#6-4") ||
- !checkSelection(5, "", "runCompositionTest", "#6-4")) {
- return;
- }
-
- synthesizeKey("Z", { accelKey: true });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3",
- "runCompositionTest", "#6-5") ||
- !checkSelection(4, "", "runCompositionTest", "#6-5")) {
- return;
- }
-}
-
-function runCompositionEventTest()
-{
- const kDescription = "runCompositionEventTest: ";
- const kEvents = ["compositionstart", "compositionupdate", "compositionend",
- "input"];
-
- input.value = "";
- input.focus();
-
- var windowEventCounts = [], windowEventData = [], windowEventLocale = [];
- var inputEventCounts = [], inputEventData = [], inputEventLocale = [];
- var preventDefault = false;
- var stopPropagation = false;
-
- function initResults()
- {
- for (var i = 0; i < kEvents.length; i++) {
- windowEventCounts[kEvents[i]] = 0;
- windowEventData[kEvents[i]] = "";
- windowEventLocale[kEvents[i]] = "";
- inputEventCounts[kEvents[i]] = 0;
- inputEventData[kEvents[i]] = "";
- inputEventLocale[kEvents[i]] = "";
- }
- }
-
- function compositionEventHandlerForWindow(aEvent)
- {
- windowEventCounts[aEvent.type]++;
- windowEventData[aEvent.type] = aEvent.data;
- windowEventLocale[aEvent.type] = aEvent.locale;
- if (preventDefault) {
- aEvent.preventDefault();
- }
- if (stopPropagation) {
- aEvent.stopPropagation();
- }
- }
-
- function formEventHandlerForWindow(aEvent)
- {
- ok(aEvent.isTrusted, "input events must be trusted events");
- windowEventCounts[aEvent.type]++;
- windowEventData[aEvent.type] = input.value;
- }
-
- function compositionEventHandlerForInput(aEvent)
- {
- inputEventCounts[aEvent.type]++;
- inputEventData[aEvent.type] = aEvent.data;
- inputEventLocale[aEvent.type] = aEvent.locale;
- if (preventDefault) {
- aEvent.preventDefault();
- }
- if (stopPropagation) {
- aEvent.stopPropagation();
- }
- }
-
- function formEventHandlerForInput(aEvent)
- {
- inputEventCounts[aEvent.type]++;
- inputEventData[aEvent.type] = input.value;
- }
-
- window.addEventListener("compositionstart", compositionEventHandlerForWindow,
- true, true);
- window.addEventListener("compositionend", compositionEventHandlerForWindow,
- true, true);
- window.addEventListener("compositionupdate", compositionEventHandlerForWindow,
- true, true);
- window.addEventListener("input", formEventHandlerForWindow,
- true, true);
-
- input.addEventListener("compositionstart", compositionEventHandlerForInput,
- true, true);
- input.addEventListener("compositionend", compositionEventHandlerForInput,
- true, true);
- input.addEventListener("compositionupdate", compositionEventHandlerForInput,
- true, true);
- input.addEventListener("input", formEventHandlerForInput,
- true, true);
-
- // test for normal case
- initResults();
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- is(windowEventCounts["compositionstart"], 1,
- kDescription + "compositionstart hasn't been handled by window #1");
- is(windowEventData["compositionstart"], "",
- kDescription + "data of compositionstart isn't empty (window) #1");
- is(windowEventLocale["compositionstart"], "",
- kDescription + "locale of compositionstart isn't empty (window) #1");
- is(inputEventCounts["compositionstart"], 1,
- kDescription + "compositionstart hasn't been handled by input #1");
- is(inputEventData["compositionstart"], "",
- kDescription + "data of compositionstart isn't empty (input) #1");
- is(inputEventLocale["compositionstart"], "",
- kDescription + "locale of compositionstart isn't empty (input) #1");
-
- is(windowEventCounts["compositionupdate"], 1,
- kDescription + "compositionupdate hasn't been handled by window #1");
- is(windowEventData["compositionupdate"], "\u3089",
- kDescription + "data of compositionupdate doesn't match (window) #1");
- is(windowEventLocale["compositionupdate"], "",
- kDescription + "locale of compositionupdate isn't empty (window) #1");
- is(inputEventCounts["compositionupdate"], 1,
- kDescription + "compositionupdate hasn't been handled by input #1");
- is(inputEventData["compositionupdate"], "\u3089",
- kDescription + "data of compositionupdate doesn't match (input) #1");
- is(inputEventLocale["compositionupdate"], "",
- kDescription + "locale of compositionupdate isn't empty (input) #1");
-
- is(windowEventCounts["compositionend"], 0,
- kDescription + "compositionend has been handled by window #1");
- is(inputEventCounts["compositionend"], 0,
- kDescription + "compositionend has been handled by input #1");
-
- is(windowEventCounts["input"], 1,
- kDescription + "input hasn't been handled by window #1");
- is(windowEventData["input"], "\u3089",
- kDescription + "value of input element wasn't modified (window) #1");
- is(inputEventCounts["input"], 1,
- kDescription + "input hasn't been handled by input #1");
- is(inputEventData["input"], "\u3089",
- kDescription + "value of input element wasn't modified (input) #1");
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- is(windowEventCounts["compositionstart"], 1,
- kDescription + "compositionstart has been handled more than once by window #2");
- is(inputEventCounts["compositionstart"], 1,
- kDescription + "compositionstart has been handled more than once by input #2");
-
- is(windowEventCounts["compositionupdate"], 2,
- kDescription + "compositionupdate hasn't been handled by window #2");
- is(windowEventData["compositionupdate"], "\u3089\u30FC",
- kDescription + "data of compositionupdate doesn't match (window) #2");
- is(windowEventLocale["compositionupdate"], "",
- kDescription + "locale of compositionupdate isn't empty (window) #2");
- is(inputEventCounts["compositionupdate"], 2,
- kDescription + "compositionupdate hasn't been handled by input #2");
- is(inputEventData["compositionupdate"], "\u3089\u30FC",
- kDescription + "data of compositionupdate doesn't match (input) #2");
- is(inputEventLocale["compositionupdate"], "",
- kDescription + "locale of compositionupdate isn't empty (input) #2");
-
- is(windowEventCounts["compositionend"], 0,
- kDescription + "compositionend has been handled during composition by window #2");
- is(inputEventCounts["compositionend"], 0,
- kDescription + "compositionend has been handled during composition by input #2");
-
- is(windowEventCounts["input"], 2,
- kDescription + "input hasn't been handled by window #2");
- is(windowEventData["input"], "\u3089\u30FC",
- kDescription + "value of input element wasn't modified (window) #2");
- is(inputEventCounts["input"], 2,
- kDescription + "input hasn't been handled by input #2");
- is(inputEventData["input"], "\u3089\u30FC",
- kDescription + "value of input element wasn't modified (input) #2");
-
- // text event shouldn't cause composition update, e.g., at committing.
- synthesizeComposition({ type: "compositioncommitasis" });
-
- is(windowEventCounts["compositionstart"], 1,
- kDescription + "compositionstart has been handled more than once by window #3");
- is(inputEventCounts["compositionstart"], 1,
- kDescription + "compositionstart has been handled more than once by input #3");
-
- is(windowEventCounts["compositionupdate"], 2,
- kDescription + "compositionupdate has been fired unexpectedly on window #3");
- is(inputEventCounts["compositionupdate"], 2,
- kDescription + "compositionupdate has been fired unexpectedly on input #3");
-
- is(windowEventCounts["compositionend"], 1,
- kDescription + "compositionend hasn't been handled by window #3");
- is(windowEventData["compositionend"], "\u3089\u30FC",
- kDescription + "data of compositionend doesn't match (window) #3");
- is(windowEventLocale["compositionend"], "",
- kDescription + "locale of compositionend isn't empty (window) #3");
- is(inputEventCounts["compositionend"], 1,
- kDescription + "compositionend hasn't been handled by input #3");
- is(inputEventData["compositionend"], "\u3089\u30FC",
- kDescription + "data of compositionend doesn't match (input) #3");
- is(inputEventLocale["compositionend"], "",
- kDescription + "locale of compositionend isn't empty (input) #3");
-
- is(windowEventCounts["input"], 3,
- kDescription + "input hasn't been handled by window #3");
- is(windowEventData["input"], "\u3089\u30FC",
- kDescription + "value of input element wasn't modified (window) #3");
- is(inputEventCounts["input"], 3,
- kDescription + "input hasn't been handled by input #3");
- is(inputEventData["input"], "\u3089\u30FC",
- kDescription + "value of input element wasn't modified (input) #3");
-
- // select the second character, then, data of composition start should be
- // the selected character.
- initResults();
- synthesizeKey("VK_LEFT", { shiftKey: true });
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- synthesizeComposition({ type: "compositioncommitasis" });
-
- is(windowEventCounts["compositionstart"], 1,
- kDescription + "compositionstart hasn't been handled by window #4");
- is(windowEventData["compositionstart"], "\u30FC",
- kDescription + "data of compositionstart is empty (window) #4");
- is(windowEventLocale["compositionstart"], "",
- kDescription + "locale of compositionstart isn't empty (window) #4");
- is(inputEventCounts["compositionstart"], 1,
- kDescription + "compositionstart hasn't been handled by input #4");
- is(inputEventData["compositionstart"], "\u30FC",
- kDescription + "data of compositionstart is empty (input) #4");
- is(inputEventLocale["compositionstart"], "",
- kDescription + "locale of compositionstart isn't empty (input) #4");
-
- is(windowEventCounts["compositionupdate"], 1,
- kDescription + "compositionupdate hasn't been handled by window #4");
- is(windowEventData["compositionupdate"], "\u3089",
- kDescription + "data of compositionupdate doesn't match (window) #4");
- is(windowEventLocale["compositionupdate"], "",
- kDescription + "locale of compositionupdate isn't empty (window) #4");
- is(inputEventCounts["compositionupdate"], 1,
- kDescription + "compositionupdate hasn't been handled by input #4");
- is(inputEventData["compositionupdate"], "\u3089",
- kDescription + "data of compositionupdate doesn't match (input) #4");
- is(inputEventLocale["compositionupdate"], "",
- kDescription + "locale of compositionupdate isn't empty (input) #4");
-
- is(windowEventCounts["compositionend"], 1,
- kDescription + "compositionend hasn't been handled by window #4");
- is(windowEventData["compositionend"], "\u3089",
- kDescription + "data of compositionend doesn't match (window) #4");
- is(windowEventLocale["compositionend"], "",
- kDescription + "locale of compositionend isn't empty (window) #4");
- is(inputEventCounts["compositionend"], 1,
- kDescription + "compositionend hasn't been handled by input #4");
- is(inputEventData["compositionend"], "\u3089",
- kDescription + "data of compositionend doesn't match (input) #4");
- is(inputEventLocale["compositionend"], "",
- kDescription + "locale of compositionend isn't empty (input) #4");
-
- is(windowEventCounts["input"], 2,
- kDescription + "input hasn't been handled by window #4");
- is(windowEventData["input"], "\u3089\u3089",
- kDescription + "value of input element wasn't modified (window) #4");
- is(inputEventCounts["input"], 2,
- kDescription + "input hasn't been handled by input #4");
- is(inputEventData["input"], "\u3089\u3089",
- kDescription + "value of input element wasn't modified (input) #4");
-
- // preventDefault() should effect nothing.
- preventDefault = true;
-
- initResults();
- synthesizeKey("A", { accelKey: true }); // Select All
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306D",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- synthesizeComposition({ type: "compositioncommitasis" });
-
- is(windowEventCounts["compositionstart"], 1,
- kDescription + "compositionstart hasn't been handled by window #5");
- is(windowEventData["compositionstart"], "\u3089\u3089",
- kDescription + "data of compositionstart is empty (window) #5");
- is(windowEventLocale["compositionstart"], "",
- kDescription + "locale of compositionstart isn't empty (window) #5");
- is(inputEventCounts["compositionstart"], 1,
- kDescription + "compositionstart hasn't been handled by input #5");
- is(inputEventData["compositionstart"], "\u3089\u3089",
- kDescription + "data of compositionstart is empty (input) #5");
- is(inputEventLocale["compositionstart"], "",
- kDescription + "locale of compositionstart isn't empty (input) #5");
-
- is(windowEventCounts["compositionupdate"], 1,
- kDescription + "compositionupdate hasn't been handled by window #5");
- is(windowEventData["compositionupdate"], "\u306D",
- kDescription + "data of compositionupdate doesn't match (window) #5");
- is(windowEventLocale["compositionupdate"], "",
- kDescription + "locale of compositionupdate isn't empty (window) #5");
- is(inputEventCounts["compositionupdate"], 1,
- kDescription + "compositionupdate hasn't been handled by input #5");
- is(inputEventData["compositionupdate"], "\u306D",
- kDescription + "data of compositionupdate doesn't match (input) #5");
- is(inputEventLocale["compositionupdate"], "",
- kDescription + "locale of compositionupdate isn't empty (input) #5");
-
- is(windowEventCounts["compositionend"], 1,
- kDescription + "compositionend hasn't been handled by window #5");
- is(windowEventData["compositionend"], "\u306D",
- kDescription + "data of compositionend doesn't match (window) #5");
- is(windowEventLocale["compositionend"], "",
- kDescription + "locale of compositionend isn't empty (window) #5");
- is(inputEventCounts["compositionend"], 1,
- kDescription + "compositionend hasn't been handled by input #5");
- is(inputEventData["compositionend"], "\u306D",
- kDescription + "data of compositionend doesn't match (input) #5");
- is(inputEventLocale["compositionend"], "",
- kDescription + "locale of compositionend isn't empty (input) #5");
-
- is(windowEventCounts["input"], 2,
- kDescription + "input hasn't been handled by window #5");
- is(windowEventData["input"], "\u306D",
- kDescription + "value of input element wasn't modified (window) #5");
- is(inputEventCounts["input"], 2,
- kDescription + "input hasn't been handled by input #5");
- is(inputEventData["input"], "\u306D",
- kDescription + "value of input element wasn't modified (input) #5");
-
- prevnetDefault = false;
-
- // stopPropagation() should effect nothing (except event count)
- stopPropagation = true;
-
- initResults();
- synthesizeKey("A", { accelKey: true }); // Select All
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- synthesizeComposition({ type: "compositioncommitasis" });
-
- is(windowEventCounts["compositionstart"], 1,
- kDescription + "compositionstart hasn't been handled by window #6");
- is(windowEventData["compositionstart"], "\u306D",
- kDescription + "data of compositionstart is empty #6");
- is(windowEventLocale["compositionstart"], "",
- kDescription + "locale of compositionstart isn't empty #6");
- is(inputEventCounts["compositionstart"], 0,
- kDescription + "compositionstart has been handled by input #6");
-
- is(windowEventCounts["compositionupdate"], 1,
- kDescription + "compositionupdate hasn't been handled by window #6");
- is(windowEventData["compositionupdate"], "\u306E",
- kDescription + "data of compositionupdate doesn't match #6");
- is(windowEventLocale["compositionupdate"], "",
- kDescription + "locale of compositionupdate isn't empty #6");
- is(inputEventCounts["compositionupdate"], 0,
- kDescription + "compositionupdate has been handled by input #6");
-
- is(windowEventCounts["compositionend"], 1,
- kDescription + "compositionend hasn't been handled by window #6");
- is(windowEventData["compositionend"], "\u306E",
- kDescription + "data of compositionend doesn't match #6");
- is(windowEventLocale["compositionend"], "",
- kDescription + "locale of compositionend isn't empty #6");
- is(inputEventCounts["compositionend"], 0,
- kDescription + "compositionend has been handled by input #6");
-
- is(windowEventCounts["input"], 2,
- kDescription + "input hasn't been handled by window #6");
- is(windowEventData["input"], "\u306E",
- kDescription + "value of input element wasn't modified (window) #6");
- is(inputEventCounts["input"], 2,
- kDescription + "input hasn't been handled by input #6");
- is(inputEventData["input"], "\u306E",
- kDescription + "value of input element wasn't modified (input) #6");
-
- stopPropagation = false;
-
- // create event and dispatch it.
- initResults();
-
- input.value = "value of input";
- synthesizeKey("A", { accelKey: true }); // Select All
-
- var compositionstart = document.createEvent("CompositionEvent");
- compositionstart.initCompositionEvent("compositionstart",
- true, true, document.defaultView,
- "start data", "start locale");
- is(compositionstart.type, "compositionstart",
- kDescription + "type doesn't match #7");
- is(compositionstart.data, "start data",
- kDescription + "data doesn't match #7");
- is(compositionstart.locale, "start locale",
- kDescription + "locale doesn't match #7");
- is(compositionstart.detail, 0,
- kDescription + "detail isn't 0 #7");
-
- input.dispatchEvent(compositionstart);
-
- is(windowEventCounts["compositionstart"], 1,
- kDescription + "compositionstart hasn't been handled by window #7");
- is(windowEventData["compositionstart"], "start data",
- kDescription + "data of compositionstart was changed (window) #7");
- is(windowEventLocale["compositionstart"], "start locale",
- kDescription + "locale of compositionstart was changed (window) #7");
- is(inputEventCounts["compositionstart"], 1,
- kDescription + "compositionstart hasn't been handled by input #7");
- is(inputEventData["compositionstart"], "start data",
- kDescription + "data of compositionstart was changed (input) #7");
- is(inputEventLocale["compositionstart"], "start locale",
- kDescription + "locale of compositionstart was changed (input) #7");
-
- is(input.value, "value of input",
- kDescription + "input value was changed #7");
-
- var compositionupdate1 = document.createEvent("compositionevent");
- compositionupdate1.initCompositionEvent("compositionupdate",
- true, false, document.defaultView,
- "composing string", "composing locale");
- is(compositionupdate1.type, "compositionupdate",
- kDescription + "type doesn't match #8");
- is(compositionupdate1.data, "composing string",
- kDescription + "data doesn't match #8");
- is(compositionupdate1.locale, "composing locale",
- kDescription + "locale doesn't match #8");
- is(compositionupdate1.detail, 0,
- kDescription + "detail isn't 0 #8");
-
- input.dispatchEvent(compositionupdate1);
-
- is(windowEventCounts["compositionupdate"], 1,
- kDescription + "compositionupdate hasn't been handled by window #8");
- is(windowEventData["compositionupdate"], "composing string",
- kDescription + "data of compositionupdate was changed (window) #8");
- is(windowEventLocale["compositionupdate"], "composing locale",
- kDescription + "locale of compositionupdate was changed (window) #8");
- is(inputEventCounts["compositionupdate"], 1,
- kDescription + "compositionupdate hasn't been handled by input #8");
- is(inputEventData["compositionupdate"], "composing string",
- kDescription + "data of compositionupdate was changed (input) #8");
- is(inputEventLocale["compositionupdate"], "composing locale",
- kDescription + "locale of compositionupdate was changed (input) #8");
-
- is(input.value, "value of input",
- kDescription + "input value was changed #8");
-
- var compositionupdate2 = document.createEvent("compositionEvent");
- compositionupdate2.initCompositionEvent("compositionupdate",
- true, false, document.defaultView,
- "commit string", "commit locale");
- is(compositionupdate2.type, "compositionupdate",
- kDescription + "type doesn't match #9");
- is(compositionupdate2.data, "commit string",
- kDescription + "data doesn't match #9");
- is(compositionupdate2.locale, "commit locale",
- kDescription + "locale doesn't match #9");
- is(compositionupdate2.detail, 0,
- kDescription + "detail isn't 0 #9");
-
- input.dispatchEvent(compositionupdate2);
-
- is(windowEventCounts["compositionupdate"], 2,
- kDescription + "compositionupdate hasn't been handled by window #9");
- is(windowEventData["compositionupdate"], "commit string",
- kDescription + "data of compositionupdate was changed (window) #9");
- is(windowEventLocale["compositionupdate"], "commit locale",
- kDescription + "locale of compositionupdate was changed (window) #9");
- is(inputEventCounts["compositionupdate"], 2,
- kDescription + "compositionupdate hasn't been handled by input #9");
- is(inputEventData["compositionupdate"], "commit string",
- kDescription + "data of compositionupdate was changed (input) #9");
- is(inputEventLocale["compositionupdate"], "commit locale",
- kDescription + "locale of compositionupdate was changed (input) #9");
-
- is(input.value, "value of input",
- kDescription + "input value was changed #9");
-
- var compositionend = document.createEvent("Compositionevent");
- compositionend.initCompositionEvent("compositionend",
- true, false, document.defaultView,
- "end data", "end locale");
- is(compositionend.type, "compositionend",
- kDescription + "type doesn't match #10");
- is(compositionend.data, "end data",
- kDescription + "data doesn't match #10");
- is(compositionend.locale, "end locale",
- kDescription + "locale doesn't match #10");
- is(compositionend.detail, 0,
- kDescription + "detail isn't 0 #10");
-
- input.dispatchEvent(compositionend);
-
- is(windowEventCounts["compositionend"], 1,
- kDescription + "compositionend hasn't been handled by window #10");
- is(windowEventData["compositionend"], "end data",
- kDescription + "data of compositionend was changed (window) #10");
- is(windowEventLocale["compositionend"], "end locale",
- kDescription + "locale of compositionend was changed (window) #10");
- is(inputEventCounts["compositionend"], 1,
- kDescription + "compositionend hasn't been handled by input #10");
- is(inputEventData["compositionend"], "end data",
- kDescription + "data of compositionend was changed (input) #10");
- is(inputEventLocale["compositionend"], "end locale",
- kDescription + "locale of compositionend was changed (input) #10");
-
- is(input.value, "value of input",
- kDescription + "input value was changed #10");
-
- window.removeEventListener("compositionstart",
- compositionEventHandlerForWindow, true);
- window.removeEventListener("compositionend",
- compositionEventHandlerForWindow, true);
- window.removeEventListener("compositionupdate",
- compositionEventHandlerForWindow, true);
- window.removeEventListener("input",
- formEventHandlerForWindow, true);
-
- input.removeEventListener("compositionstart",
- compositionEventHandlerForInput, true);
- input.removeEventListener("compositionend",
- compositionEventHandlerForInput, true);
- input.removeEventListener("compositionupdate",
- compositionEventHandlerForInput, true);
- input.removeEventListener("input",
- formEventHandlerForInput, true);
-}
-
-function runQueryTextRectInContentEditableTest()
-{
- contenteditable.focus();
-
- contenteditable.innerHTML = "<p>abc</p><p>def</p>";
- // \n 0 123 4 567
- // \r\n 01 234 56 789
-
- var description = "runTextRectInContentEditableTest: \"" + contenteditable.innerHTML + "\", ";
-
- // "a"
- var a = synthesizeQueryTextRect(kLFLen, 1);
- if (!checkQueryContentResult(a, description + "rect for 'a'")) {
- return;
- }
-
- // "b"
- var b = synthesizeQueryTextRect(kLFLen + 1, 1);
- if (!checkQueryContentResult(b, description + "rect for 'b'")) {
- return;
- }
-
- is(b.top, a.top, description + "'a' and 'b' should be at same top");
- isSimilarTo(b.left, a.left + a.width, 2, description + "left of 'b' should be at similar to right of 'a'");
- is(b.height, a.height, description + "'a' and 'b' should be same height");
-
- // "c"
- var c = synthesizeQueryTextRect(kLFLen + 2, 1);
- if (!checkQueryContentResult(c, description + "rect for 'c'")) {
- return;
- }
-
- is(c.top, b.top, description + "'b' and 'c' should be at same top");
- isSimilarTo(c.left, b.left + b.width, 2, description + "left of 'c' should be at similar to right of 'b'");
- is(c.height, b.height, description + "'b' and 'c' should be same height");
-
- // "abc" as array
- var abcAsArray = synthesizeQueryTextRectArray(kLFLen, 3);
- if (!checkQueryContentResult(abcAsArray, description + "rect array for 'abc'") ||
- !checkRectArray(abcAsArray, [a, b, c], description + "query text rect array result of 'abc' should match with each query text rect result")) {
- return;
- }
-
- // 2nd <p> (can be computed with the rect of 'c')
- var p2 = synthesizeQueryTextRect(kLFLen + 3, 1);
- if (!checkQueryContentResult(p2, description + "rect for 2nd <p>")) {
- return;
- }
-
- is(p2.top, c.top, description + "'c' and a line breaker caused by 2nd <p> should be at same top");
- isSimilarTo(p2.left, c.left + c.width, 2, description + "left of a line breaker caused by 2nd <p> should be at similar to right of 'c'");
- is(p2.height, c.height, description + "'c' and a line breaker caused by 2nd <p> should be same height");
-
- // 2nd <p> as array
- var p2AsArray = synthesizeQueryTextRectArray(kLFLen + 3, 1);
- if (!checkQueryContentResult(p2AsArray, description + "2nd <p>'s line breaker as array") ||
- !checkRectArray(p2AsArray, [p2], description + "query text rect array result of 2nd <p> should match with each query text rect result")) {
- return;
- }
-
- if (kLFLen > 1) {
- // \n of \r\n
- var p2_2 = synthesizeQueryTextRect(kLFLen + 4, 1);
- if (!checkQueryContentResult(p2_2, description + "rect for \\n of \\r\\n caused by 2nd <p>")) {
- return;
- }
-
- is(p2_2.top, p2.top, description + "'\\r' and '\\n' should be at same top");
- is(p2_2.left, p2.left, description + "'\\r' and '\\n' should be at same top");
- is(p2_2.height, p2.height, description + "'\\r' and '\\n' should be same height");
- is(p2_2.width, p2.width, description + "'\\r' and '\\n' should be same width");
-
- // \n of \r\n as array
- var p2_2AsArray = synthesizeQueryTextRectArray(kLFLen + 4, 1);
- if (!checkQueryContentResult(p2_2AsArray, description + "rect array for \\n of \\r\\n caused by 2nd <p>") ||
- !checkRectArray(p2_2AsArray, [p2_2], description + "query text rect array result of \\n of \\r\\n caused by 2nd <p> should match with each query text rect result")) {
- return;
- }
- }
-
- // "d"
- var d = synthesizeQueryTextRect(kLFLen * 2 + 3, 1);
- if (!checkQueryContentResult(d, description + "rect for 'd'")) {
- return;
- }
-
- isGreaterThan(d.top, a.top + a.height, description + "top of 'd' should be greater than bottom of 'a'");
- is(d.left, a.left, description + "'a' and 'd' should be same at same left");
- is(d.height, a.height, description + "'a' and 'd' should be same height");
-
- // "e"
- var e = synthesizeQueryTextRect(kLFLen * 2 + 4, 1);
- if (!checkQueryContentResult(e, description + "rect for 'e'")) {
- return;
- }
-
- is(e.top, d.top, description + "'d' and 'd' should be at same top");
- isSimilarTo(e.left, d.left + d.width, 2, description + "left of 'e' should be at similar to right of 'd'");
- is(e.height, d.height, description + "'d' and 'e' should be same height");
-
- // "f"
- var f = synthesizeQueryTextRect(kLFLen * 2 + 5, 1);
- if (!checkQueryContentResult(f, description + "rect for 'f'")) {
- return;
- }
-
- is(f.top, e.top, description + "'e' and 'f' should be at same top");
- isSimilarTo(f.left, e.left + e.width, 2, description + "left of 'f' should be at similar to right of 'e'");
- is(f.height, e.height, description + "'e' and 'f' should be same height");
-
- // "def" as array
- var defAsArray = synthesizeQueryTextRectArray(kLFLen * 2 + 3, 3);
- if (!checkQueryContentResult(defAsArray, description + "rect array for 'def'") ||
- !checkRectArray(defAsArray, [d, e, f], description + "query text rect array result of 'def' should match with each query text rect result")) {
- return;
- }
-
- // next of "f" (can be computed with rect of 'f')
- var next_f = synthesizeQueryTextRect(kLFLen * 2 + 6, 1);
- if (!checkQueryContentResult(next_f, description + "rect for next of 'f'")) {
- return;
- }
-
- is(next_f.top, d.top, 2, description + "'f' and next of 'f' should be at same top");
- isSimilarTo(next_f.left, f.left + f.width, 2, description + "left of next of 'f' should be at similar to right of 'f'");
- is(next_f.height, d.height, description + "'f' and next of 'f' should be same height");
-
- // next of "f" as array
- var next_fAsArray = synthesizeQueryTextRectArray(kLFLen * 2 + 6, 1);
- if (!checkQueryContentResult(next_fAsArray, description + "rect array for next of 'f'") ||
- !checkRectArray(next_fAsArray, [next_f], description + "query text rect array result of next of 'f' should match with each query text rect result")) {
- return;
- }
-
- // too big offset for the editor
- var tooBigOffset = synthesizeQueryTextRect(kLFLen * 2 + 7, 1);
- if (!checkQueryContentResult(tooBigOffset, description + "rect for too big offset")) {
- return;
- }
-
- is(tooBigOffset.top, next_f.top, description + "too big offset and next of 'f' should be at same top");
- is(tooBigOffset.left, next_f.left, description + "too big offset and next of 'f' should be at same left");
- is(tooBigOffset.height, next_f.height, description + "too big offset and next of 'f' should be same height");
- is(tooBigOffset.width, next_f.width, description + "too big offset and next of 'f' should be same width");
-
- // too big offset for the editors as array
- var tooBigOffsetAsArray = synthesizeQueryTextRectArray(kLFLen * 2 + 7, 1);
- if (!checkQueryContentResult(tooBigOffsetAsArray, description + "rect array for too big offset") ||
- !checkRectArray(tooBigOffsetAsArray, [tooBigOffset], description + "query text rect array result with too big offset should match with each query text rect result")) {
- return;
- }
-
- contenteditable.innerHTML = "<p>abc</p><p>def</p><p><br></p>";
- // \n 0 123 4 567 8 9
- // \r\n 01 234 56 789 01 23
-
- description = "runTextRectInContentEditableTest: \"" + contenteditable.innerHTML + "\", ";
-
- // "f"
- f = synthesizeQueryTextRect(kLFLen * 2 + 5, 1);
- if (!checkQueryContentResult(f, description + "rect for 'f'")) {
- return;
- }
-
- is(f.top, e.top, description + "'e' and 'f' should be at same top");
- is(f.height, e.height, description + "'e' and 'f' should be same height");
- isSimilarTo(f.left, e.left + e.width, 2, description + "left of 'f' should be at similar to right of 'e'");
-
- // 3rd <p> (can be computed with rect of 'f')
- var p3 = synthesizeQueryTextRect(kLFLen * 2 + 6, 1);
- if (!checkQueryContentResult(p3, description + "rect for 3rd <p>")) {
- return;
- }
-
- is(p3.top, f.top, description + "'f' and a line breaker caused by 3rd <p> should be at same top");
- is(p3.height, f.height, description + "'f' and a line breaker caused by 3rd <p> should be same height");
- isSimilarTo(p3.left, f.left + f.width, 2, description + "left of a line breaker caused by 3rd <p> should be similar to right of 'f'");
-
- // 3rd <p> as array
- var p3AsArray = synthesizeQueryTextRectArray(kLFLen * 2 + 6, 1);
- if (!checkQueryContentResult(p3AsArray, description + "3rd <p>'s line breaker as array") ||
- !checkRectArray(p3AsArray, [p3], description + "query text rect array result of 3rd <p> should match with each query text rect result")) {
- return;
- }
-
- if (kLFLen > 1) {
- // \n of \r\n
- var p3_2 = synthesizeQueryTextRect(kLFLen * 2 + 7, 1);
- if (!checkQueryContentResult(p3_2, description + "rect for \\n of \\r\\n caused by 3rd <p>")) {
- return;
- }
-
- is(p3_2.top, p3.top, description + "'\\r' and '\\n' should be at same top");
- is(p3_2.left, p3.left, description + "'\\r' and '\\n' should be at same top");
- is(p3_2.height, p3.height, description + "'\\r' and '\\n' should be same height");
- is(p3_2.width, p3.width, description + "'\\r' and '\\n' should be same width");
-
- // \n of \r\n as array
- var p3_2AsArray = synthesizeQueryTextRectArray(kLFLen * 2 + 7, 1);
- if (!checkQueryContentResult(p3_2AsArray, description + "rect array for \\n of \\r\\n caused by 3rd <p>") ||
- !checkRectArray(p3_2AsArray, [p3_2], description + "query text rect array result of \\n of \\r\\n caused by 3rd <p> should match with each query text rect result")) {
- return;
- }
- }
-
- // <br> in 3rd <p>
- var br = synthesizeQueryTextRect(kLFLen * 3 + 6, 1);
- if (!checkQueryContentResult(br, description + "rect for <br> in 3rd <p>")) {
- return;
- }
-
- isGreaterThan(br.top, d.top + d.height, description + "a line breaker caused by <br> in 3rd <p> should be greater than bottom of 'd'");
- isSimilarTo(br.height, d.height, 2, description + "'d' and a line breaker caused by <br> in 3rd <p> should be similar height");
- is(br.left, d.left, description + "left of a line breaker caused by <br> in 3rd <p> should be same left of 'd'");
-
- // <br> in 3rd <p> as array
- var brAsArray = synthesizeQueryTextRectArray(kLFLen * 3 + 6, 1);
- if (!checkQueryContentResult(brAsArray, description + "<br> in 3rd <p> as array") ||
- !checkRectArray(brAsArray, [br], description + "query text rect array result of <br> in 3rd <p> should match with each query text rect result")) {
- return;
- }
-
- if (kLFLen > 1) {
- // \n of \r\n
- var br_2 = synthesizeQueryTextRect(kLFLen * 3 + 7, 1);
- if (!checkQueryContentResult(br_2, description + "rect for \\n of \\r\\n caused by <br> in 3rd <p>")) {
- return;
- }
-
- is(br_2.top, br.top, description + "'\\r' and '\\n' should be at same top");
- is(br_2.left, br.left, description + "'\\r' and '\\n' should be at same top");
- is(br_2.height, br.height, description + "'\\r' and '\\n' should be same height");
- is(br_2.width, br.width, description + "'\\r' and '\\n' should be same width");
-
- // \n of \r\n as array
- var br_2AsArray = synthesizeQueryTextRectArray(kLFLen * 3 + 7, 1);
- if (!checkQueryContentResult(br_2AsArray, description + "rect array for \\n of \\r\\n caused by <br> in 3rd <p>") ||
- !checkRectArray(br_2AsArray, [br_2], description + "query text rect array result of \\n of \\r\\n caused by <br> in 3rd <p> should match with each query text rect result")) {
- return;
- }
- }
-
- // next of <br> in 3rd <p>
- var next_br = synthesizeQueryTextRect(kLFLen * 4 + 6, 1);
- if (!checkQueryContentResult(next_br, description + "rect for next of <br> in 3rd <p>")) {
- return;
- }
-
- is(next_br.top, br.top, description + "next of <br> and <br> should be at same top");
- is(next_br.left, br.left, description + "next of <br> and <br> should be at same left");
- is(next_br.height, br.height, description + "next of <br> and <br> should be same height");
- is(next_br.width, br.width, description + "next of <br> and <br> should be same width");
-
- // next of <br> in 3rd <p> as array
- var next_brAsArray = synthesizeQueryTextRectArray(kLFLen * 4 + 6, 1);
- if (!checkQueryContentResult(next_brAsArray, description + "rect array for next of <br> in 3rd <p>") ||
- !checkRectArray(next_brAsArray, [next_br], description + "query text rect array result of next of <br> in 3rd <p> should match with each query text rect result")) {
- return;
- }
-
- // too big offset for the editor
- tooBigOffset = synthesizeQueryTextRect(kLFLen * 4 + 7, 1);
- if (!checkQueryContentResult(tooBigOffset, description + "rect for too big offset")) {
- return;
- }
-
- is(tooBigOffset.top, next_br.top, description + "too big offset and next of 3rd <p> should be at same top");
- is(tooBigOffset.left, next_br.left, description + "too big offset and next of 3rd <p> should be at same left");
- is(tooBigOffset.height, next_br.height, description + "too big offset and next of 3rd <p> should be same height");
- is(tooBigOffset.width, next_br.width, description + "too big offset and next of 3rd <p> should be same width");
-
- // too big offset for the editors as array
- tooBigOffsetAsArray = synthesizeQueryTextRectArray(kLFLen * 4 + 7, 1);
- if (!checkQueryContentResult(tooBigOffsetAsArray, description + "rect array for too big offset") ||
- !checkRectArray(tooBigOffsetAsArray, [tooBigOffset], description + "query text rect array result with too big offset should match with each query text rect result")) {
- return;
- }
-
- contenteditable.innerHTML = "<p>abc</p><p>def</p><p></p>";
- // \n 0 123 4 567 8
- // \r\n 01 234 56 789 0
-
- description = "runTextRectInContentEditableTest: \"" + contenteditable.innerHTML + "\", ";
-
- // "f"
- f = synthesizeQueryTextRect(kLFLen * 2 + 5, 1);
- if (!checkQueryContentResult(f, description + "rect for 'f'")) {
- return;
- }
-
- is(f.top, e.top, description + "'e' and 'f' should be at same top");
- isSimilarTo(f.left, e.left + e.width, 2, description + "left of 'f' should be at similar to right of 'e'");
- is(f.height, e.height, description + "'e' and 'f' should be same height");
-
- // 3rd <p> (can be computed with rect of 'f')
- p3 = synthesizeQueryTextRect(kLFLen * 2 + 6, 1);
- if (!checkQueryContentResult(p3, description + "rect for 3rd <p>")) {
- return;
- }
-
- is(p3.top, f.top, description + "'f' and a line breaker caused by 3rd <p> should be at same top");
- is(p3.height, f.height, description + "'f' and a line breaker caused by 3rd <p> should be same height");
- isSimilarTo(p3.left, f.left + f.width, 2, description + "left of a line breaker caused by 3rd <p> should be similar to right of 'f'");
-
- // 3rd <p> as array
- p3AsArray = synthesizeQueryTextRectArray(kLFLen * 2 + 6, 1);
- if (!checkQueryContentResult(p3AsArray, description + "3rd <p>'s line breaker as array") ||
- !checkRectArray(p3AsArray, [p3], description + "query text rect array result of 3rd <p> should match with each query text rect result")) {
- return;
- }
-
- if (kLFLen > 1) {
- // \n of \r\n
- p3_2 = synthesizeQueryTextRect(kLFLen * 2 + 7, 1);
- if (!checkQueryContentResult(p3_2, description + "rect for \\n of \\r\\n caused by 3rd <p>")) {
- return;
- }
-
- is(p3_2.top, p3.top, description + "'\\r' and '\\n' should be at same top");
- is(p3_2.left, p3.left, description + "'\\r' and '\\n' should be at same top");
- is(p3_2.height, p3.height, description + "'\\r' and '\\n' should be same height");
- is(p3_2.width, p3.width, description + "'\\r' and '\\n' should be same width");
-
- // \n of \r\n as array
- p3_2AsArray = synthesizeQueryTextRectArray(kLFLen * 2 + 7, 1);
- if (!checkQueryContentResult(p3_2AsArray, description + "rect array for \\n of \\r\\n caused by 3rd <p>") ||
- !checkRectArray(p3_2AsArray, [p3_2], description + "query text rect array result of \\n of \\r\\n caused by 3rd <p> should match with each query text rect result")) {
- return;
- }
- }
-
- // next of 3rd <p>
- var next_p3 = synthesizeQueryTextRect(kLFLen * 3 + 6, 1);
- if (!checkQueryContentResult(next_p3, description + "rect for next of 3rd <p>")) {
- return;
- }
-
- isGreaterThan(next_p3.top, d.top + d.height, description + "top of next of 3rd <p> should equal to or be bigger than bottom of 'd'");
- isSimilarTo(next_p3.left, d.left, 2, description + "left of next of 3rd <p> should be at similar to left of 'd'");
- isSimilarTo(next_p3.height, d.height, 2, description + "next of 3rd <p> and 'd' should be similar height");
-
- // next of 3rd <p> as array
- var next_p3AsArray = synthesizeQueryTextRectArray(kLFLen * 3 + 6, 1);
- if (!checkQueryContentResult(next_p3AsArray, description + "next of 3rd <p> as array") ||
- !checkRectArray(next_p3AsArray, [next_p3], description + "query text rect array result of next of 3rd <p> should match with each query text rect result")) {
- return;
- }
-
- // too big offset for the editor
- tooBigOffset = synthesizeQueryTextRect(kLFLen * 3 + 7, 1);
- if (!checkQueryContentResult(tooBigOffset, description + "rect for too big offset")) {
- return;
- }
-
- is(tooBigOffset.top, next_p3.top, description + "too big offset and next of 3rd <p> should be at same top");
- is(tooBigOffset.left, next_p3.left, description + "too big offset and next of 3rd <p> should be at same left");
- is(tooBigOffset.height, next_p3.height, description + "too big offset and next of 3rd <p> should be same height");
- is(tooBigOffset.width, next_p3.width, description + "too big offset and next of 3rd <p> should be same width");
-
- // too big offset for the editors as array
- tooBigOffsetAsArray = synthesizeQueryTextRectArray(kLFLen * 3 + 7, 1);
- if (!checkQueryContentResult(tooBigOffsetAsArray, description + "rect array for too big offset") ||
- !checkRectArray(tooBigOffsetAsArray, [tooBigOffset], description + "query text rect array result with too big offset should match with each query text rect result")) {
- return;
- }
-
- contenteditable.innerHTML = "abc<br>def";
- // \n 0123 456
- // \r\n 01234 567
-
- description = "runTextRectInContentEditableTest: \"" + contenteditable.innerHTML + "\", ";
-
- // "a"
- a = synthesizeQueryTextRect(0, 1);
- if (!checkQueryContentResult(a, description + "rect for 'a'")) {
- return;
- }
-
- // "b"
- b = synthesizeQueryTextRect(1, 1);
- if (!checkQueryContentResult(b, description + "rect for 'b'")) {
- return;
- }
-
- is(b.top, a.top, description + "'a' and 'b' should be at same top");
- isSimilarTo(b.left, a.left + a.width, 2, description + "left of 'b' should be at similar to right of 'a'");
- is(b.height, a.height, description + "'a' and 'b' should be same height");
-
- // "c"
- c = synthesizeQueryTextRect(2, 1);
- if (!checkQueryContentResult(c, description + "rect for 'c'")) {
- return;
- }
-
- is(c.top, b.top, description + "'b' and 'c' should be at same top");
- isSimilarTo(c.left, b.left + b.width, 2, description + "left of 'c' should be at similar to right of 'b'");
- is(c.height, b.height, description + "'b' and 'c' should be same height");
-
- // "abc" as array
- abcAsArray = synthesizeQueryTextRectArray(0, 3);
- if (!checkQueryContentResult(abcAsArray, description + "rect array for 'abc'") ||
- !checkRectArray(abcAsArray, [a, b, c], description + "query text rect array result of 'abc' should match with each query text rect result")) {
- return;
- }
-
- // <br> (can be computed with the rect of 'c')
- br = synthesizeQueryTextRect(3, 1);
- if (!checkQueryContentResult(br, description + "rect for <br>")) {
- return;
- }
-
- is(br.top, c.top, description + "'c' and a line breaker caused by <br> should be at same top");
- isSimilarTo(br.left, c.left + c.width, 2, description + "left of a line breaker caused by <br> should be at similar to right of 'c'");
- is(br.height, c.height, description + "'c' and a line breaker caused by <br> should be same height");
-
- // <br> as array
- brAsArray = synthesizeQueryTextRectArray(3, 1);
- if (!checkQueryContentResult(brAsArray, description + "<br>'s line breaker as array") ||
- !checkRectArray(brAsArray, [br], description + "query text rect array result of <br> should match with each query text rect result")) {
- return;
- }
-
- if (kLFLen > 1) {
- // \n of \r\n
- var br_2 = synthesizeQueryTextRect(4, 1);
- if (!checkQueryContentResult(br_2, description + "rect for \n of \r\n caused by <br>")) {
- return;
- }
-
- is(br_2.top, br.top, description + "'\\r' and '\\n' should be at same top");
- is(br_2.left, br.left, description + "'\\r' and '\\n' should be at same top");
- is(br_2.height, br.height, description + "'\\r' and '\\n' should be same height");
- is(br_2.width, br.width, description + "'\\r' and '\\n' should be same width");
-
- // \n of \r\n as array
- var br_2AsArray = synthesizeQueryTextRectArray(4, 1);
- if (!checkQueryContentResult(br_2AsArray, description + "rect array for \\n of \\r\\n caused by <br>") ||
- !checkRectArray(br_2AsArray, [br_2], description + "query text rect array result of \\n of \\r\\n caused by <br> should match with each query text rect result")) {
- return;
- }
- }
-
- // "d"
- d = synthesizeQueryTextRect(kLFLen + 3, 1);
- if (!checkQueryContentResult(d, description + "rect for 'd'")) {
- return;
- }
-
- isSimilarTo(d.top, a.top + a.height, 2, description + "top of 'd' should be at similar to bottom of 'a'");
- is(d.left, a.left, description + "'a' and 'd' should be same at same left");
- is(d.height, a.height, description + "'a' and 'd' should be same height");
-
- // "e"
- e = synthesizeQueryTextRect(kLFLen + 4, 1);
- if (!checkQueryContentResult(e, description + "rect for 'e'")) {
- return;
- }
-
- is(e.top, d.top, description + "'d' and 'd' should be at same top");
- isSimilarTo(e.left, d.left + d.width, 2, description + "left of 'e' should be at similar to right of 'd'");
- is(e.height, d.height, description + "'d' and 'e' should be same height");
-
- // "f"
- f = synthesizeQueryTextRect(kLFLen + 5, 1);
- if (!checkQueryContentResult(f, description + "rect for 'f'")) {
- return;
- }
-
- is(f.top, e.top, description + "'e' and 'f' should be at same top");
- isSimilarTo(f.left, e.left + e.width, 2, description + "left of 'f' should be at similar to right of 'e'");
- is(f.height, e.height, description + "'e' and 'f' should be same height");
-
- // "def" as array
- defAsArray = synthesizeQueryTextRectArray(kLFLen + 3, 3);
- if (!checkQueryContentResult(defAsArray, description + "rect array for 'def'") ||
- !checkRectArray(defAsArray, [d, e, f], description + "query text rect array result of 'def' should match with each query text rect result")) {
- return;
- }
-
- // next of "f" (can be computed with rect of 'f')
- next_f = synthesizeQueryTextRect(kLFLen + 6, 1);
- if (!checkQueryContentResult(next_f, description + "rect for next of 'f'")) {
- return;
- }
-
- is(next_f.top, d.top, 2, description + "'f' and next of 'f' should be at same top");
- isSimilarTo(next_f.left, f.left + f.width, 2, description + "left of next of 'f' should be at similar to right of 'f'");
- is(next_f.height, d.height, description + "'f' and next of 'f' should be same height");
-
- // next of "f" as array
- next_fAsArray = synthesizeQueryTextRectArray(kLFLen + 6, 1);
- if (!checkQueryContentResult(next_fAsArray, description + "rect array for next of 'f'") ||
- !checkRectArray(next_fAsArray, [next_f], description + "query text rect array result of next of 'f' should match with each query text rect result")) {
- return;
- }
-
- // too big offset for the editor
- tooBigOffset = synthesizeQueryTextRect(kLFLen + 7, 1);
- if (!checkQueryContentResult(tooBigOffset, description + "rect for too big offset")) {
- return;
- }
-
- is(tooBigOffset.top, next_f.top, description + "too big offset and next of 'f' should be at same top");
- is(tooBigOffset.left, next_f.left, description + "too big offset and next of 'f' should be at same left");
- is(tooBigOffset.height, next_f.height, description + "too big offset and next of 'f' should be same height");
- is(tooBigOffset.width, next_f.width, description + "too big offset and next of 'f' should be same width");
-
- // too big offset for the editors as array
- tooBigOffsetAsArray = synthesizeQueryTextRectArray(kLFLen + 7, 1);
- if (!checkQueryContentResult(tooBigOffsetAsArray, description + "rect array for too big offset") ||
- !checkRectArray(tooBigOffsetAsArray, [tooBigOffset], description + "query text rect array result with too big offset should match with each query text rect result")) {
- return;
- }
-
- // Note that this case does not have an empty line at the end.
- contenteditable.innerHTML = "abc<br>def<br>";
- // \n 0123 4567
- // \r\n 01234 56789
-
- description = "runTextRectInContentEditableTest: \"" + contenteditable.innerHTML + "\", ";
-
- // "f"
- f = synthesizeQueryTextRect(kLFLen + 5, 1);
- if (!checkQueryContentResult(f, description + "rect for 'f'")) {
- return;
- }
-
- is(f.top, e.top, description + "'e' and 'f' should be at same top");
- is(f.height, e.height, description + "'e' and 'f' should be same height");
- isSimilarTo(f.left, e.left + e.width, 2, description + "left of 'f' should be at similar to right of 'e'");
-
- // 2nd <br> (can be computed with rect of 'f')
- var br2 = synthesizeQueryTextRect(kLFLen + 6, 1);
- if (!checkQueryContentResult(br2, description + "rect for 2nd <br>")) {
- return;
- }
-
- is(br2.top, f.top, description + "'f' and a line breaker caused by 2nd <br> should be at same top");
- is(br2.height, f.height, description + "'f' and a line breaker caused by 2nd <br> should be same height");
- isSimilarTo(br2.left, f.left + f.width, 2, description + "left of a line breaker caused by 2nd <br> should be similar to right of 'f'");
-
- // 2nd <br> as array
- var br2AsArray = synthesizeQueryTextRectArray(kLFLen * 2 + 6, 1);
- if (!checkQueryContentResult(br2AsArray, description + "2nd <br>'s line breaker as array") ||
- !checkRectArray(br2AsArray, [br2], description + "query text rect array result of 2nd <br> should match with each query text rect result")) {
- return;
- }
-
- if (kLFLen > 1) {
- // \n of \r\n
- var br2_2 = synthesizeQueryTextRect(kLFLen + 7, 1);
- if (!checkQueryContentResult(br2_2, description + "rect for \\n of \\r\\n caused by 2nd <br>")) {
- return;
- }
-
- is(br2_2.top, br2.top, description + "'\\r' and '\\n' should be at same top");
- is(br2_2.left, br2.left, description + "'\\r' and '\\n' should be at same top");
- is(br2_2.height, br2.height, description + "'\\r' and '\\n' should be same height");
- is(br2_2.width, br2.width, description + "'\\r' and '\\n' should be same width");
-
- // \n of \r\n as array
- var br2_2AsArray = synthesizeQueryTextRectArray(kLFLen + 7, 1);
- if (!checkQueryContentResult(br2_2AsArray, description + "rect array for \\n of \\r\\n caused by 2nd <br>") ||
- !checkRectArray(br2_2AsArray, [br2_2], description + "query text rect array result of \\n of \\r\\n caused by 2nd <br> should match with each query text rect result")) {
- return;
- }
- }
-
- // next of 2nd <br>
- var next_br2 = synthesizeQueryTextRect(kLFLen * 2 + 6, 1);
- if (!checkQueryContentResult(next_br2, description + "rect for next of 2nd <br>")) {
- return;
- }
-
- is(next_br2.top, br2.top, description + "2nd <br> and next of 2nd <br> should be at same top");
- is(next_br2.left, br2.left, description + "2nd <br> and next of 2nd <br> should be at same top");
- is(next_br2.height, br2.height, description + "2nd <br> and next of 2nd <br> should be same height");
- is(next_br2.width, br2.width, description + "2nd <br> and next of 2nd <br> should be same width");
-
- // next of 2nd <br> as array
- var next_br2AsArray = synthesizeQueryTextRectArray(kLFLen * 2 + 6, 1);
- if (!checkQueryContentResult(next_br2AsArray, description + "rect array for next of 2nd <br>") ||
- !checkRectArray(next_br2AsArray, [next_br2], description + "query text rect array result of next of 2nd <br> should match with each query text rect result")) {
- return;
- }
-
- // too big offset for the editor
- tooBigOffset = synthesizeQueryTextRect(kLFLen * 2 + 7, 1);
- if (!checkQueryContentResult(tooBigOffset, description + "rect for too big offset")) {
- return;
- }
-
- is(tooBigOffset.top, next_br2.top, description + "too big offset and next of 2nd <br> should be at same top");
- is(tooBigOffset.left, next_br2.left, description + "too big offset and next of 2nd <br> should be at same left");
- is(tooBigOffset.height, next_br2.height, description + "too big offset and next of 2nd <br> should be same height");
- is(tooBigOffset.width, next_br2.width, description + "too big offset and next of 2nd <br> should be same width");
-
- // too big offset for the editors as array
- tooBigOffsetAsArray = synthesizeQueryTextRectArray(kLFLen * 2 + 7, 1);
- if (!checkQueryContentResult(tooBigOffsetAsArray, description + "rect array for too big offset") ||
- !checkRectArray(tooBigOffsetAsArray, [tooBigOffset], description + "query text rect array result with too big offset should match with each query text rect result")) {
- return;
- }
-
- contenteditable.innerHTML = "abc<br>def<br><br>";
- // \n 0123 4567 8
- // \r\n 01234 56789 01
-
- description = "runTextRectInContentEditableTest: \"" + contenteditable.innerHTML + "\", ";
-
- // "f"
- f = synthesizeQueryTextRect(kLFLen + 5, 1);
- if (!checkQueryContentResult(f, description + "rect for 'f'")) {
- return;
- }
-
- is(f.top, e.top, description + "'e' and 'f' should be at same top");
- isSimilarTo(f.left, e.left + e.width, 2, description + "left of 'f' should be at similar to right of 'e'");
- is(f.height, e.height, description + "'e' and 'f' should be same height");
-
- // 2nd <br>
- br2 = synthesizeQueryTextRect(kLFLen + 6, 1);
- if (!checkQueryContentResult(br2, description + "rect for 2nd <br>")) {
- return;
- }
-
- is(br2.top, f.top, description + "'f' and a line breaker caused by 2nd <br> should be at same top");
- is(br2.height, f.height, description + "'f' and a line breaker caused by 2nd <br> should be same height");
- ok(f.left < br2.left, description + "left of a line breaker caused by 2nd <br> should be bigger than left of 'f', f.left=" + f.left + ", br2.left=" + br2.left);
-
- // 2nd <br> as array
- br2AsArray = synthesizeQueryTextRectArray(kLFLen + 6, 1);
- if (!checkQueryContentResult(br2AsArray, description + "2nd <br>'s line breaker as array") ||
- !checkRectArray(br2AsArray, [br2], description + "query text rect array result of 2nd <br> should match with each query text rect result")) {
- return;
- }
-
- if (kLFLen > 1) {
- // \n of \r\n
- br2_2 = synthesizeQueryTextRect(kLFLen + 7, 1);
- if (!checkQueryContentResult(br2_2, description + "rect for \\n of \\r\\n caused by 2nd <br>")) {
- return;
- }
-
- is(br2_2.top, br2.top, description + "'\\r' and '\\n' should be at same top");
- is(br2_2.left, br2.left, description + "'\\r' and '\\n' should be at same top");
- is(br2_2.height, br2.height, description + "'\\r' and '\\n' should be same height");
- is(br2_2.width, br2.width, description + "'\\r' and '\\n' should be same width");
-
- // \n of \r\n as array
- var br2_2AsArray = synthesizeQueryTextRectArray(kLFLen + 7, 1);
- if (!checkQueryContentResult(br2_2AsArray, description + "rect array for \\n of \\r\\n caused by 2nd <br>") ||
- !checkRectArray(br2_2AsArray, [br2_2], description + "query text rect array result of \\n of \\r\\n caused by 2nd <br> should match with each query text rect result")) {
- return;
- }
- }
-
- // 3rd <br>
- var br3 = synthesizeQueryTextRect(kLFLen * 2 + 7, 1);
- if (!checkQueryContentResult(br3, description + "rect for next of 3rd <br>")) {
- return;
- }
-
- isSimilarTo(br3.top, d.top + d.height, 3, description + "top of next of 3rd <br> should at similar to bottom of 'd'");
- isSimilarTo(br3.left, d.left, 2, description + "left of next of 3rd <br> should be at similar to left of 'd'");
- isSimilarTo(br3.height, d.height, 2, description + "next of 3rd <br> and 'd' should be similar height");
-
- // 3rd <br> as array
- var br3AsArray = synthesizeQueryTextRectArray(kLFLen + 6, 1);
- if (!checkQueryContentResult(br3AsArray, description + "3rd <br>'s line breaker as array") ||
- !checkRectArray(br3AsArray, [br3], description + "query text rect array result of 3rd <br> should match with each query text rect result")) {
- return;
- }
-
- if (kLFLen > 1) {
- // \n of \r\n
- var br3_2 = synthesizeQueryTextRect(kLFLen * 2 + 7, 1);
- if (!checkQueryContentResult(br3_2, description + "rect for \\n of \\r\\n caused by 3rd <br>")) {
- return;
- }
-
- is(br3_2.top, br3.top, description + "'\\r' and '\\n' should be at same top");
- is(br3_2.left, br3.left, description + "'\\r' and '\\n' should be at same left");
- is(br3_2.height, br3.height, description + "'\\r' and '\\n' should be same height");
- is(br3_2.width, br3.width, description + "'\\r' and '\\n' should be same width");
-
- // \n of \r\n as array
- var br2_2AsArray = synthesizeQueryTextRectArray(kLFLen * 2 + 7, 1);
- if (!checkQueryContentResult(br2_2AsArray, description + "rect array for \\n of \\r\\n caused by 3rd <br>") ||
- !checkRectArray(br2_2AsArray, [br2_2], description + "query text rect array result of \\n of \\r\\n caused by 3rd <br> should match with each query text rect result")) {
- return;
- }
- }
-
- // next of 3rd <br>
- var next_br3 = synthesizeQueryTextRect(kLFLen * 3 + 6, 1);
- if (!checkQueryContentResult(next_br3, description + "rect for next of 3rd <br>")) {
- return;
- }
-
- is(next_br3.top, br3.top, description + "3rd <br> and next of 3rd <br> should be at same top");
- is(next_br3.left, br3.left, description + "3rd <br> and next of 3rd <br> should be at same left");
- is(next_br3.height, br3.height, description + "3rd <br> and next of 3rd <br> should be same height");
- is(next_br3.width, br3.width, description + "3rd <br> and next of 3rd <br> should be same width");
-
- // next of 3rd <br> as array
- var next_br3AsArray = synthesizeQueryTextRectArray(kLFLen * 3 + 6, 1);
- if (!checkQueryContentResult(next_br3AsArray, description + "rect array for next of 3rd <br>") ||
- !checkRectArray(next_br3AsArray, [next_br3], description + "query text rect array result of next of 3rd <br> should match with each query text rect result")) {
- return;
- }
-
- // too big offset for the editor
- tooBigOffset = synthesizeQueryTextRect(kLFLen * 3 + 7, 1);
- if (!checkQueryContentResult(tooBigOffset, description + "rect for too big offset")) {
- return;
- }
-
- is(tooBigOffset.top, next_br3.top, description + "too big offset and next of 3rd <br> should be at same top");
- is(tooBigOffset.left, next_br3.left, description + "too big offset and next of 3rd <br> should be at same left");
- is(tooBigOffset.height, next_br3.height, description + "too big offset and next of 3rd <br> should be same height");
- is(tooBigOffset.width, next_br3.width, description + "too big offset and next of 3rd <br> should be same width");
-
- // too big offset for the editors as array
- tooBigOffsetAsArray = synthesizeQueryTextRectArray(kLFLen * 2 + 7, 1);
- if (!checkQueryContentResult(tooBigOffsetAsArray, description + "rect array for too big offset") ||
- !checkRectArray(tooBigOffsetAsArray, [tooBigOffset], description + "query text rect array result with too big offset should match with each query text rect result")) {
- return;
- }
-}
-
-function runCharAtPointTest(aFocusedEditor, aTargetName)
-{
- aFocusedEditor.value = "This is a test of the\nContent Events";
- // 012345678901234567890 12345678901234
- // 0 1 2 3
-
- aFocusedEditor.focus();
-
- const kNone = -1;
- const kTestingOffset = [ 0, 10, 20, 21 + kLFLen, 34 + kLFLen];
- const kLeftSideOffset = [ kNone, 9, 19, kNone, 33 + kLFLen];
- const kRightSideOffset = [ 1, 11, kNone, 22 + kLFLen, kNone];
- const kLeftTentativeCaretOffset = [ 0, 10, 20, 21 + kLFLen, 34 + kLFLen];
- const kRightTentativeCaretOffset = [ 1, 11, 21, 22 + kLFLen, 35 + kLFLen];
-
- var editorRect = synthesizeQueryEditorRect();
- if (!checkQueryContentResult(editorRect,
- "runCharAtPointTest (" + aTargetName + "): editorRect")) {
- return;
- }
-
- for (var i = 0; i < kTestingOffset.length; i++) {
- var textRect = synthesizeQueryTextRect(kTestingOffset[i], 1);
- if (!checkQueryContentResult(textRect,
- "runCharAtPointTest (" + aTargetName + "): textRect: i=" + i)) {
- continue;
- }
-
- checkRectContainsRect(textRect, editorRect,
- "runCharAtPointTest (" + aTargetName +
- "): the text rect isn't in the editor");
-
- // Test #1, getting same character rect by the point near the top-left.
- var charAtPt1 = synthesizeCharAtPoint(textRect.left + 1,
- textRect.top + 1);
- if (checkQueryContentResult(charAtPt1,
- "runCharAtPointTest (" + aTargetName + "): charAtPt1: i=" + i)) {
- ok(!charAtPt1.notFound,
- "runCharAtPointTest (" + aTargetName + "): charAtPt1 isn't found: i=" + i);
- if (!charAtPt1.notFound) {
- is(charAtPt1.offset, kTestingOffset[i],
- "runCharAtPointTest (" + aTargetName + "): charAtPt1 offset is wrong: i=" + i);
- checkRect(charAtPt1, textRect, "runCharAtPointTest (" + aTargetName +
- "): charAtPt1 left is wrong: i=" + i);
- }
- ok(!charAtPt1.tentativeCaretOffsetNotFound,
- "runCharAtPointTest (" + aTargetName + "): tentative caret offset for charAtPt1 isn't found: i=" + i);
- if (!charAtPt1.tentativeCaretOffsetNotFound) {
- is(charAtPt1.tentativeCaretOffset, kLeftTentativeCaretOffset[i],
- "runCharAtPointTest (" + aTargetName + "): tentative caret offset for charAtPt1 is wrong: i=" + i);
- }
- }
-
- // Test #2, getting same character rect by the point near the bottom-right.
- var charAtPt2 = synthesizeCharAtPoint(textRect.left + textRect.width - 2,
- textRect.top + textRect.height - 2);
- if (checkQueryContentResult(charAtPt2,
- "runCharAtPointTest (" + aTargetName + "): charAtPt2: i=" + i)) {
- ok(!charAtPt2.notFound,
- "runCharAtPointTest (" + aTargetName + "): charAtPt2 isn't found: i=" + i);
- if (!charAtPt2.notFound) {
- is(charAtPt2.offset, kTestingOffset[i],
- "runCharAtPointTest (" + aTargetName + "): charAtPt2 offset is wrong: i=" + i);
- checkRect(charAtPt2, textRect, "runCharAtPointTest (" + aTargetName +
- "): charAtPt1 left is wrong: i=" + i);
- }
- ok(!charAtPt2.tentativeCaretOffsetNotFound,
- "runCharAtPointTest (" + aTargetName + "): tentative caret offset for charAtPt2 isn't found: i=" + i);
- if (!charAtPt2.tentativeCaretOffsetNotFound) {
- is(charAtPt2.tentativeCaretOffset, kRightTentativeCaretOffset[i],
- "runCharAtPointTest (" + aTargetName + "): tentative caret offset for charAtPt2 is wrong: i=" + i);
- }
- }
-
- // Test #3, getting left character offset.
- var charAtPt3 = synthesizeCharAtPoint(textRect.left - 2,
- textRect.top + 1);
- if (checkQueryContentResult(charAtPt3,
- "runCharAtPointTest (" + aTargetName + "): charAtPt3: i=" + i)) {
- is(charAtPt3.notFound, kLeftSideOffset[i] == kNone,
- kLeftSideOffset[i] == kNone ?
- "runCharAtPointTest (" + aTargetName + "): charAtPt3 is found: i=" + i :
- "runCharAtPointTest (" + aTargetName + "): charAtPt3 isn't found: i=" + i);
- if (!charAtPt3.notFound) {
- is(charAtPt3.offset, kLeftSideOffset[i],
- "runCharAtPointTest (" + aTargetName + "): charAtPt3 offset is wrong: i=" + i);
- }
- if (kLeftSideOffset[i] == kNone) {
- // There may be no enough padding-left (depends on platform)
- todo(false,
- "runCharAtPointTest (" + aTargetName + "): tentative caret offset for charAtPt3 isn't tested: i=" + i);
- } else {
- ok(!charAtPt3.tentativeCaretOffsetNotFound,
- "runCharAtPointTest (" + aTargetName + "): tentative caret offset for charAtPt3 isn't found: i=" + i);
- if (!charAtPt3.tentativeCaretOffsetNotFound) {
- is(charAtPt3.tentativeCaretOffset, kLeftTentativeCaretOffset[i],
- "runCharAtPointTest (" + aTargetName + "): tentative caret offset for charAtPt3 is wrong: i=" + i);
- }
- }
- }
-
- // Test #4, getting right character offset.
- var charAtPt4 = synthesizeCharAtPoint(textRect.left + textRect.width + 1,
- textRect.top + textRect.height - 2);
- if (checkQueryContentResult(charAtPt4,
- "runCharAtPointTest (" + aTargetName + "): charAtPt4: i=" + i)) {
- is(charAtPt4.notFound, kRightSideOffset[i] == kNone,
- kRightSideOffset[i] == kNone ?
- "runCharAtPointTest (" + aTargetName + "): charAtPt4 is found: i=" + i :
- "runCharAtPointTest (" + aTargetName + "): charAtPt4 isn't found: i=" + i);
- if (!charAtPt4.notFound) {
- is(charAtPt4.offset, kRightSideOffset[i],
- "runCharAtPointTest (" + aTargetName + "): charAtPt4 offset is wrong: i=" + i);
- }
- ok(!charAtPt4.tentativeCaretOffsetNotFound,
- "runCharAtPointTest (" + aTargetName + "): tentative caret offset for charAtPt4 isn't found: i=" + i);
- if (!charAtPt4.tentativeCaretOffsetNotFound) {
- is(charAtPt4.tentativeCaretOffset, kRightTentativeCaretOffset[i],
- "runCharAtPointTest (" + aTargetName + "): tentative caret offset for charAtPt4 is wrong: i=" + i);
- }
- }
- }
-}
-
-function runCharAtPointAtOutsideTest()
-{
- textarea.focus();
- textarea.value = "some text";
- var editorRect = synthesizeQueryEditorRect();
- if (!checkQueryContentResult(editorRect,
- "runCharAtPointAtOutsideTest: editorRect")) {
- return;
- }
- // Check on a text node which is at the outside of editor.
- var charAtPt = synthesizeCharAtPoint(editorRect.left + 20,
- editorRect.top - 10);
- if (checkQueryContentResult(charAtPt,
- "runCharAtPointAtOutsideTest: charAtPt")) {
- ok(charAtPt.notFound,
- "runCharAtPointAtOutsideTest: charAtPt is found on outside of editor");
- ok(charAtPt.tentativeCaretOffsetNotFound,
- "runCharAtPointAtOutsideTest: tentative caret offset for charAtPt is found on outside of editor");
- }
-}
-
-function runSetSelectionEventTest()
-{
- contenteditable.focus();
-
- var selection = windowOfContenteditable.getSelection();
-
- // #1
- contenteditable.innerHTML = "abc<br>def";
-
- synthesizeSelectionSet(0, 100);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #1 (0, 100), \"" + contenteditable.innerHTML + "\": selection anchor node should be the first text node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #1 (0, 100), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #1 (0, 100), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node of the editor");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #1 (0, 100), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of children");
- checkSelection(0, "abc" + kLF + "def", "runSetSelectionEventTest #1 (0, 100), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(2, 2 + kLFLen);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #1 (2, 2+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the first text node");
- is(selection.anchorOffset, 2,
- "runSetSelectionEventTest #1 (2, 2+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 2");
- is(selection.focusNode, contenteditable.lastChild,
- "runSetSelectionEventTest #1 (2, 2+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the last text node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #1 (2, 2+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(2, "c" + kLF + "d", "runSetSelectionEventTest #1 (2, 2+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(1, 2);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #1 (1, 2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the first text node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #1 (1, 2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #1 (1, 2), \"" + contenteditable.innerHTML + "\": selection focus node should be the first text node");
- is(selection.focusOffset, contenteditable.firstChild.wholeText.length,
- "runSetSelectionEventTest #1 (1, 2), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the text node");
- checkSelection(1, "bc", "runSetSelectionEventTest #1 (1, 2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(3, kLFLen);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #1 (3, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the first text node");
- is(selection.anchorOffset, contenteditable.firstChild.wholeText.length,
- "runSetSelectionEventTest #1 (3, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the first text node");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #1 (3, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, 2,
- "runSetSelectionEventTest #1 (3, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be the index of the last text node");
- checkSelection(3, kLF, "runSetSelectionEventTest #1 (3, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(6+kLFLen, 0);
- is(selection.anchorNode, contenteditable.lastChild,
- "runSetSelectionEventTest #1 (6+kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the last text node");
- is(selection.anchorOffset, contenteditable.lastChild.wholeText.length,
- "runSetSelectionEventTest #1 (6+kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the last text node");
- is(selection.focusNode, contenteditable.lastChild,
- "runSetSelectionEventTest #1 (6+kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the last text node");
- is(selection.anchorOffset, contenteditable.lastChild.wholeText.length,
- "runSetSelectionEventTest #1 (6+kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the last text node");
- checkSelection(6 + kLFLen, "", "runSetSelectionEventTest #1 (6+kLFLen, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(100, 0);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #1 (100, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node of the editor");
- is(selection.anchorOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #1 (100, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the count of children");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #1 (100, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node of the editor");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #1 (100, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of children");
- checkSelection(6 + kLFLen, "", "runSetSelectionEventTest #1 (100, 0), \"" + contenteditable.innerHTML + "\"");
-
- // #2
- contenteditable.innerHTML = "<p>a<b>b</b>c</p><p>def</p>";
-
- synthesizeSelectionSet(kLFLen, 4+kLFLen);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #2 (kLFLen, 4+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the first <p> node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #2 (kLFLen, 4+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the index of the first <p> node");
- is(selection.focusNode, contenteditable.lastChild.firstChild,
- "runSetSelectionEventTest #2 (kLFLen, 4+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node in the second <p> node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #2 (kLFLen, 4+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(kLFLen, "abc" + kLF + "d", "runSetSelectionEventTest #2 (kLFLen, 4+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen, 2);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #2 (kLFLen, 2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the first <p> node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #2 (kLFLen, 2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the index of the first <p> node");
- is(selection.focusNode, contenteditable.firstChild.childNodes.item(1).firstChild,
- "runSetSelectionEventTest #2 (kLFLen, 2), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node in the <b> node");
- is(selection.focusOffset, contenteditable.firstChild.childNodes.item(1).firstChild.wholeText.length,
- "runSetSelectionEventTest #2 (kLFLen, 2), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the text node in the <b> node");
- checkSelection(kLFLen, "ab", "runSetSelectionEventTest #2 (kLFLen, 2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(1+kLFLen, 2);
- is(selection.anchorNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #2 (1+kLFLen, 2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the first text node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #2 (1+kLFLen, 2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable.firstChild.lastChild,
- "runSetSelectionEventTest #2 (1+kLFLen, 2), \"" + contenteditable.innerHTML + "\": selection focus node should be the last text node in the first <p> node");
- is(selection.focusOffset, contenteditable.firstChild.lastChild.wholeText.length,
- "runSetSelectionEventTest #2 (1+kLFLen, 2), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the last text node in the first <p> node");
- checkSelection(1+kLFLen, "bc", "runSetSelectionEventTest #2 (1+kLFLen, 2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(2+kLFLen, 2+kLFLen);
- is(selection.anchorNode, contenteditable.firstChild.childNodes.item(1).firstChild,
- "runSetSelectionEventTest #2 (2+kLFLen, 2+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the text node in the <b> node");
- is(selection.anchorOffset, contenteditable.firstChild.childNodes.item(1).firstChild.wholeText.length,
- "runSetSelectionEventTest #2 (2+kLFLen, 2+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the text node in the <b> node");
- is(selection.focusNode, contenteditable.lastChild.firstChild,
- "runSetSelectionEventTest #2 (2+kLFLen, 2+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node in the last <p> node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #2 (2+kLFLen, 2+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(2+kLFLen, "c" + kLF + "d", "runSetSelectionEventTest #2 (2+kLFLen, 2+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(3+kLFLen*2, 1);
- is(selection.anchorNode, contenteditable.lastChild,
- "runSetSelectionEventTest #2 (3+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection anchor node should be the second <p> node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #2 (3+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the index of the second <p> node");
- is(selection.focusNode, contenteditable.lastChild.firstChild,
- "runSetSelectionEventTest #2 (3+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node in the second <p> node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #2 (3+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(3+kLFLen*2, "d", "runSetSelectionEventTest #2 (3+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, 0);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #2 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #2 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #2 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #2 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, "", "runSetSelectionEventTest #2 (0, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, kLFLen);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #2 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #2 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the index of the first <p> node");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #2 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the first <p> node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #2 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, kLF, "runSetSelectionEventTest #2 (0, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(2+kLFLen, 1+kLFLen);
- is(selection.anchorNode, contenteditable.firstChild.childNodes.item(1).firstChild,
- "runSetSelectionEventTest #2 (2+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the last text node of the <b> node");
- is(selection.anchorOffset, contenteditable.firstChild.childNodes.item(1).firstChild.wholeText.length,
- "runSetSelectionEventTest #2 (2+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the last text node of the first <b> node");
- is(selection.focusNode, contenteditable.lastChild,
- "runSetSelectionEventTest #2 (2+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the second <p> node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #2 (2+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(2+kLFLen, "c" + kLF, "runSetSelectionEventTest #2 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(3+kLFLen, kLFLen);
- is(selection.anchorNode, contenteditable.firstChild.lastChild,
- "runSetSelectionEventTest #2 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the last text node of the first <p> node");
- is(selection.anchorOffset, contenteditable.firstChild.lastChild.wholeText.length,
- "runSetSelectionEventTest #2 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the last text node of the first <p> node");
- is(selection.focusNode, contenteditable.lastChild,
- "runSetSelectionEventTest #2 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the second <p> node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #2 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(3+kLFLen, kLF, "runSetSelectionEventTest #2 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(3+kLFLen, 1+kLFLen);
- is(selection.anchorNode, contenteditable.firstChild.lastChild,
- "runSetSelectionEventTest #2 (3+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the last text node of the first <p> node");
- is(selection.anchorOffset, contenteditable.firstChild.lastChild.wholeText.length,
- "runSetSelectionEventTest #2 (3+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the last text node of the first <p> node");
- is(selection.focusNode, contenteditable.lastChild.firstChild,
- "runSetSelectionEventTest #2 (3+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node of the second <p> node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #2 (3+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(3+kLFLen, kLF + "d", "runSetSelectionEventTest #2 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- // #3
- contenteditable.innerHTML = "<div>abc<p>def</p></div>";
-
- synthesizeSelectionSet(1+kLFLen, 2);
- is(selection.anchorNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #3 (1+kLFLen, 2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the first text node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #3 (1+kLFLen, 2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #3 (1+kLFLen, 2), \"" + contenteditable.innerHTML + "\": selection focus node should be the first text node");
- is(selection.focusOffset, contenteditable.firstChild.firstChild.wholeText.length,
- "runSetSelectionEventTest #3 (1+kLFLen, 2), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the first text node");
- checkSelection(1+kLFLen, "bc", "runSetSelectionEventTest #3 (1+kLFLen, 2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(1+kLFLen, 3+kLFLen);
- is(selection.anchorNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #3 (1+kLFLen, 3+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the first text node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #3 (1+kLFLen, 3+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable.firstChild.lastChild.firstChild,
- "runSetSelectionEventTest #3 (1+kLFLen, 3+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node in the <p> node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #3 (1+kLFLen, 3+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(1+kLFLen, "bc" + kLF + "d", "runSetSelectionEventTest #3 (1+kLFLen, 3+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(3+kLFLen, 0);
- is(selection.anchorNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #3 (3+kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the first text node");
- is(selection.anchorOffset, contenteditable.firstChild.firstChild.wholeText.length,
- "runSetSelectionEventTest #3 (3+kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the first text node");
- is(selection.focusNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #3 (3+kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the first text node");
- is(selection.focusOffset, contenteditable.firstChild.firstChild.wholeText.length,
- "runSetSelectionEventTest #3 (3+kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the first text node");
- checkSelection(3+kLFLen, "", "runSetSelectionEventTest #3 (3+kLFLen, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, 6+kLFLen*2);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #3 (0, 6+kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #3 (0, 6+kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.firstChild.lastChild.firstChild,
- "runSetSelectionEventTest #3 (0, 6+kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus node should be the last text node");
- is(selection.focusOffset, contenteditable.firstChild.lastChild.firstChild.wholeText.length,
- "runSetSelectionEventTest #3 (0, 6+kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the last text node");
- checkSelection(0, kLF + "abc" + kLF + "def", "runSetSelectionEventTest #3 (0, 6+kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, 100);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #3 (0, 100), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #3 (0, 100), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #3 (0, 100), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #3 (0, 100), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(0, kLF + "abc" + kLF + "def", "runSetSelectionEventTest #3 (0, 100), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(4+kLFLen*2, 2);
- is(selection.anchorNode, contenteditable.firstChild.lastChild.firstChild,
- "runSetSelectionEventTest #3 (4+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the last text node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #3 (4+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable.firstChild.lastChild.firstChild,
- "runSetSelectionEventTest #3 (4+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\": selection focus node should be the last text node");
- is(selection.focusOffset, contenteditable.firstChild.lastChild.firstChild.wholeText.length,
- "runSetSelectionEventTest #3 (4+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the last text node");
- checkSelection(4+kLFLen*2, "ef", "runSetSelectionEventTest #3 (4+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(4+kLFLen*2, 100);
- is(selection.anchorNode, contenteditable.firstChild.lastChild.firstChild,
- "runSetSelectionEventTest #3 (4+kLFLen*2, 100), \"" + contenteditable.innerHTML + "\": selection anchor node should be the last text node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #3 (4+kLFLen*2, 100), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #3 (4+kLFLen*2, 100), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #3 (4+kLFLen*2, 100), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(4+kLFLen*2, "ef", "runSetSelectionEventTest #3 (4+kLFLen*2, 100), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(6+kLFLen*2, 0);
- is(selection.anchorNode, contenteditable.firstChild.lastChild.firstChild,
- "runSetSelectionEventTest #3 (6+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the last text node");
- is(selection.anchorOffset, contenteditable.firstChild.lastChild.firstChild.wholeText.length,
- "runSetSelectionEventTest #3 (6+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the last text node");
- is(selection.focusNode, contenteditable.firstChild.lastChild.firstChild,
- "runSetSelectionEventTest #3 (6+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the last text node");
- is(selection.focusOffset, contenteditable.firstChild.lastChild.firstChild.wholeText.length,
- "runSetSelectionEventTest #3 (6+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the last text node");
- checkSelection(6+kLFLen*2, "", "runSetSelectionEventTest #3 (6+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(6+kLFLen*2, 1);
- is(selection.anchorNode, contenteditable.firstChild.lastChild.firstChild,
- "runSetSelectionEventTest #3 (6+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection anchor node should be the last text node");
- is(selection.anchorOffset, contenteditable.firstChild.lastChild.firstChild.wholeText.length,
- "runSetSelectionEventTest #3 (6+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the last text node");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #3 (6+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #3 (6+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(6+kLFLen*2, "", "runSetSelectionEventTest #3 (6+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, kLFLen);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #3 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #3 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the index of the first text node");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #3 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the <div> node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #3 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, kLF, "runSetSelectionEventTest #3 (0, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, 1+kLFLen);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #3 (0, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #3 (0, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the index of the <div> node");
- is(selection.focusNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #3 (0, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the first text node of the <div> node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #3 (0, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(0, kLF + "a", "runSetSelectionEventTest #3 (0, 1+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(2+kLFLen, 1+kLFLen);
- is(selection.anchorNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #3 (2+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the text node of the <div> node");
- is(selection.anchorOffset, 2,
- "runSetSelectionEventTest #3 (2+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 2");
- is(selection.focusNode, contenteditable.firstChild.lastChild,
- "runSetSelectionEventTest #3 (2+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #3 (2+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(2+kLFLen, "c" + kLF, "runSetSelectionEventTest #3 (2+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(3+kLFLen, kLFLen);
- is(selection.anchorNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #3 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the text node of the <div> node");
- is(selection.anchorOffset, contenteditable.firstChild.firstChild.wholeText.length,
- "runSetSelectionEventTest #3 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the text node of the <div> node");
- is(selection.focusNode, contenteditable.firstChild.lastChild,
- "runSetSelectionEventTest #3 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #3 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(3+kLFLen, kLF, "runSetSelectionEventTest #3 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(3+kLFLen, 1+kLFLen);
- is(selection.anchorNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #3 (3+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the text node of the <div> node");
- is(selection.anchorOffset, contenteditable.firstChild.firstChild.wholeText.length,
- "runSetSelectionEventTest #3 (3+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the text node of the <div> node");
- is(selection.focusNode, contenteditable.firstChild.lastChild.firstChild,
- "runSetSelectionEventTest #3 (3+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node of the <p> node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #3 (3+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(3+kLFLen, kLF + "d", "runSetSelectionEventTest #3 (3+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- // #4
- contenteditable.innerHTML = "<div><p>abc</p>def</div>";
-
- synthesizeSelectionSet(1+kLFLen*2, 2);
- is(selection.anchorNode, contenteditable.firstChild.firstChild.firstChild,
- "runSetSelectionEventTest #4 (1+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the text node in the <p> node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #4 (1+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable.firstChild.firstChild.firstChild,
- "runSetSelectionEventTest #4 (1+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node in the <p> node");
- is(selection.focusOffset, contenteditable.firstChild.firstChild.firstChild.wholeText.length,
- "runSetSelectionEventTest #4 (1+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the text node in the <p> node");
- checkSelection(1+kLFLen*2, "bc", "runSetSelectionEventTest #4 (1+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(1+kLFLen*2, 3);
- is(selection.anchorNode, contenteditable.firstChild.firstChild.firstChild,
- "runSetSelectionEventTest #4 (1+kLFLen*2, 3), \"" + contenteditable.innerHTML + "\": selection anchor node should be the text node in the <p> node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #4 (1+kLFLen*2, 3), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable.firstChild.lastChild,
- "runSetSelectionEventTest #4 (1+kLFLen*2, 3), \"" + contenteditable.innerHTML + "\": selection focus node should be the last text node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #4 (1+kLFLen*2, 3), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(1+kLFLen*2, "bcd", "runSetSelectionEventTest #4 (1+kLFLen*2, 3), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(3+kLFLen*2, 0);
- is(selection.anchorNode, contenteditable.firstChild.firstChild.firstChild,
- "runSetSelectionEventTest #4 (3+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the text node in the <p> node");
- is(selection.anchorOffset, contenteditable.firstChild.firstChild.firstChild.wholeText.length,
- "runSetSelectionEventTest #4 (3+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the text node in the <p> node");
- is(selection.focusNode, contenteditable.firstChild.firstChild.firstChild,
- "runSetSelectionEventTest #4 (3+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node in the <p> node");
- is(selection.focusOffset, contenteditable.firstChild.firstChild.firstChild.wholeText.length,
- "runSetSelectionEventTest #4 (3+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the text node in the <p> node");
- checkSelection(3+kLFLen*2, "", "runSetSelectionEventTest #4 (3+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, 6+kLFLen*2);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #4 (0, 6+kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #4 (0, 6+kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.firstChild.lastChild,
- "runSetSelectionEventTest #4 (0, 6+kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus node should be the last text node");
- is(selection.focusOffset, contenteditable.firstChild.lastChild.wholeText.length,
- "runSetSelectionEventTest #4 (0, 6+kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the last text node");
- checkSelection(0, kLF + kLF + "abcdef", "runSetSelectionEventTest #4 (0, 6+kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, 100);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #4 (0, 100), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #4 (0, 100), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #4 (0, 100), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #4 (0, 100), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(0, kLF + kLF + "abcdef", "runSetSelectionEventTest #4 (0, 100), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(4+kLFLen*2, 2);
- is(selection.anchorNode, contenteditable.firstChild.lastChild,
- "runSetSelectionEventTest #4 (4+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the last text node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #4 (4+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable.firstChild.lastChild,
- "runSetSelectionEventTest #4 (4+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\": selection focus node should be the last text node");
- is(selection.focusOffset, contenteditable.firstChild.lastChild.wholeText.length,
- "runSetSelectionEventTest #4 (4+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the last text node");
- checkSelection(4+kLFLen*2, "ef", "runSetSelectionEventTest #4 (4+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(4+kLFLen*2, 100);
- is(selection.anchorNode, contenteditable.firstChild.lastChild,
- "runSetSelectionEventTest #4 (4+kLFLen*2, 100), \"" + contenteditable.innerHTML + "\": selection anchor node should be the last text node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #4 (4+kLFLen*2, 100), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #4 (4+kLFLen*2, 100), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #4 (4+kLFLen*2, 100), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(4+kLFLen*2, "ef", "runSetSelectionEventTest #4 (4+kLFLen*2, 100), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(6+kLFLen*2, 0);
- is(selection.anchorNode, contenteditable.firstChild.lastChild,
- "runSetSelectionEventTest #4 (6+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the last text node");
- is(selection.anchorOffset, contenteditable.firstChild.lastChild.wholeText.length,
- "runSetSelectionEventTest #4 (6+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the last text node");
- is(selection.focusNode, contenteditable.firstChild.lastChild,
- "runSetSelectionEventTest #4 (6+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the last text node");
- is(selection.focusOffset, contenteditable.firstChild.lastChild.wholeText.length,
- "runSetSelectionEventTest #4 (6+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the last text node");
- checkSelection(6+kLFLen*2, "", "runSetSelectionEventTest #4 (6+kLFLen*2, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(6+kLFLen*2, 1);
- is(selection.anchorNode, contenteditable.firstChild.lastChild,
- "runSetSelectionEventTest #4 (6+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection anchor node should be the last text node");
- is(selection.anchorOffset, contenteditable.firstChild.lastChild.wholeText.length,
- "runSetSelectionEventTest #4 (6+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the length of the last text node");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #4 (6+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #4 (6+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(6+kLFLen*2, "", "runSetSelectionEventTest #4 (6+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, kLFLen);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #4 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #4 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the index of the <div> node");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #4 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the <div> node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #4 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, kLF, "runSetSelectionEventTest #4 (0, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, kLFLen*2);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #4 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #4 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the index of the <div> node");
- is(selection.focusNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #4 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #4 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, kLF + kLF, "runSetSelectionEventTest #4 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, 1+kLFLen*2);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #4 (0, 1+kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #4 (0, 1+kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the index of the <div> node");
- is(selection.focusNode, contenteditable.firstChild.firstChild.firstChild,
- "runSetSelectionEventTest #4 (0, 1+kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node in the <p> node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #4 (0, 1+kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(0, kLF + kLF + "a", "runSetSelectionEventTest #4 (0, 1+kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen, 0);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #4 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the <div> node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #4 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #4 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the <div> node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #4 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(kLFLen, "", "runSetSelectionEventTest #4 (kLFLen, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen, kLFLen);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #4 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the <div> node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #4 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the index of the <p> node");
- is(selection.focusNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #4 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #4 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(kLFLen, kLF, "runSetSelectionEventTest #4 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen, 1+kLFLen);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #4 (kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the <div> node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #4 (kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the index of the <p> node");
- is(selection.focusNode, contenteditable.firstChild.firstChild.firstChild,
- "runSetSelectionEventTest #4 (kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node in the <p> node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #4 (kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(kLFLen, kLF +"a", "runSetSelectionEventTest #4 (kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- // #5
- contenteditable.innerHTML = "<br>";
-
- synthesizeSelectionSet(0, 0);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #5 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #5 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #5 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #5 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, "", "runSetSelectionEventTest #5 (0, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, kLFLen);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #5 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #5 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #5 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #5 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(0, kLF, "runSetSelectionEventTest #5 (0, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen, 0);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #5 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #5 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the count of the root's children");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #5 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #5 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(kLFLen, "", "runSetSelectionEventTest #5 (kLFLen, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen, 1);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #5 (kLFLen, 1), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #5 (kLFLen, 1), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the count of the root's children");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #5 (kLFLen, 1), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #5 (kLFLen, 1), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(kLFLen, "", "runSetSelectionEventTest #5 (kLFLen, 1), \"" + contenteditable.innerHTML + "\"");
-
- // #6
- contenteditable.innerHTML = "<p><br></p>";
-
- synthesizeSelectionSet(kLFLen, kLFLen);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #6 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the <p> node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #6 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #6 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
- "runSetSelectionEventTest #6 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the <p>'s children");
- checkSelection(kLFLen, kLF, "runSetSelectionEventTest #6 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen*2, 0);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #6 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the <p> node");
- is(selection.anchorOffset, contenteditable.firstChild.childNodes.length,
- "runSetSelectionEventTest #6 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the count of the <p>'s children");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #6 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
- "runSetSelectionEventTest #6 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the <p>'s children");
- checkSelection(kLFLen*2, "", "runSetSelectionEventTest #6 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen*2, 1);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #6 (kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection anchor node should be the <p> node");
- is(selection.anchorOffset, contenteditable.firstChild.childNodes.length,
- "runSetSelectionEventTest #6 (kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the count of the root's children");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #6 (kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #6 (kLFLen*2, 1), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(kLFLen*2, "", "runSetSelectionEventTest #6 (kLFLen*2, 1), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, kLFLen);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #6 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #6 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #6 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #6 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, kLF, "runSetSelectionEventTest #6 (0, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, kLFLen*2);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #6 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #6 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #6 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
- "runSetSelectionEventTest #6 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the <p>'s children");
- checkSelection(0, kLF + kLF, "runSetSelectionEventTest #6 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen, 0);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #6 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the <p> node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #6 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #6 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #6 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(kLFLen, "", "runSetSelectionEventTest #6 (kLFLen, 0), \"" + contenteditable.innerHTML + "\"");
-
- // #7
- contenteditable.innerHTML = "<br><br>";
-
- synthesizeSelectionSet(0, kLFLen);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #7 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #7 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #7 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #7 (0, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(0, kLF, "runSetSelectionEventTest #7 (0, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, kLFLen * 2);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #7 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #7 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #7 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #7 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(0, kLF + kLF, "runSetSelectionEventTest #7 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen, 0);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #7 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #7 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #7 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #7 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(kLFLen, "", "runSetSelectionEventTest #7 (kLFLen, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen, kLFLen);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #7 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #7 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #7 (kLFLen, kLFLen) selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #7 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(kLFLen, kLF, "runSetSelectionEventTest #7 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen * 2, 0);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #7 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #7 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the count of the root's children");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #7 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #7 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(kLFLen * 2, "", "runSetSelectionEventTest #7 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\"");
-
- // #8
- contenteditable.innerHTML = "<p><br><br></p>";
-
- synthesizeSelectionSet(kLFLen, kLFLen);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #8 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the <p> node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #8 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #8 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #8 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(kLFLen, kLF, "runSetSelectionEventTest #7 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen, kLFLen * 2);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #8 (kLFLen, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor node should be the <p> node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #8 (kLFLen, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #8 (kLFLen, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
- "runSetSelectionEventTest #8 (kLFLen, kLFLen*2), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the <p>'s children");
- checkSelection(kLFLen, kLF + kLF, "runSetSelectionEventTest #8 (kLFLen, kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen*2, 0);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #8 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the <p> node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #8 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #8 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #8 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be 1");
- checkSelection(kLFLen*2, "", "runSetSelectionEventTest #8 (kLFLen*2, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen*2, kLFLen);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #8 (kLFLen*2, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the <p> node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #8 (kLFLen*2, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #8 (kLFLen*2, kLFLen) selection focus node should be the <p> node");
- is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
- "runSetSelectionEventTest #8 (kLFLen*2, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the <p>'s children");
- checkSelection(kLFLen*2, kLF, "runSetSelectionEventTest #8 (kLFLen*2, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen*3, 0);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #8 (kLFLen*3, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the <p> node");
- is(selection.anchorOffset, contenteditable.firstChild.childNodes.length,
- "runSetSelectionEventTest #8 (kLFLen*3, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the count of the <p>'s children");
- is(selection.focusNode, contenteditable.firstChild,
- "runSetSelectionEventTest #8 (kLFLen*3, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, contenteditable.firstChild.childNodes.length,
- "runSetSelectionEventTest #8 (kLFLen*3, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the <p>'s children");
- checkSelection(kLFLen*3, "", "runSetSelectionEventTest #8 (kLFLen*3, 0), \"" + contenteditable.innerHTML + "\"");
-
- // #9 (ContentEventHandler cannot distinguish if <p> can have children, so, the result is same as case #5, "<br>")
- contenteditable.innerHTML = "<p></p>";
-
- synthesizeSelectionSet(kLFLen, 0);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #9 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #9 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the index of the <p> node + 1");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #9 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the <p> node");
- is(selection.focusOffset, 1,
- "runSetSelectionEventTest #9 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be the index of the <p> node + 1");
- checkSelection(kLFLen, "", "runSetSelectionEventTest #9 (kLFLen, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(kLFLen, 1);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #9 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #9 (kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be the index of the <p> node + 1");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #9 (kLFLen, 1), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #9 (kLFLen, 1), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(kLFLen, "", "runSetSelectionEventTest #9 (kLFLen, 0), \"" + contenteditable.innerHTML + "\"");
-
- // #10
- contenteditable.innerHTML = "";
-
- synthesizeSelectionSet(0, 0);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #10 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #10 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #10 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #10 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, "", "runSetSelectionEventTest #10 (0, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, 1);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #10 (0, 1), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #10 (0, 1), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #10 (0, 1), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #10 (0, 1), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, "", "runSetSelectionEventTest #10 (0, 1), \"" + contenteditable.innerHTML + "\"");
-
- // #11
- contenteditable.innerHTML = "<span></span><i><u></u></i>";
-
- synthesizeSelectionSet(0, 0);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #11 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #11 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #11 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #11 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, "", "runSetSelectionEventTest #11 (0, 0), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(0, 1);
- is(selection.anchorNode, contenteditable,
- "runSetSelectionEventTest #11 (0, 1), \"" + contenteditable.innerHTML + "\": selection anchor node should be the root node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #11 (0, 1), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable,
- "runSetSelectionEventTest #11 (0, 1), \"" + contenteditable.innerHTML + "\": selection focus node should be the root node");
- is(selection.focusOffset, contenteditable.childNodes.length,
- "runSetSelectionEventTest #11 (0, 1), \"" + contenteditable.innerHTML + "\": selection focus offset should be the count of the root's children");
- checkSelection(0, "", "runSetSelectionEventTest #11 (0, 1), \"" + contenteditable.innerHTML + "\"");
-
- // #12
- contenteditable.innerHTML = "<span>abc</span><i><u></u></i>";
-
- synthesizeSelectionSet(0, 0);
- is(selection.anchorNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #12 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the text node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #12 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.firstChild.firstChild,
- "runSetSelectionEventTest #12 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #12 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, "", "runSetSelectionEventTest #12 (0, 0), \"" + contenteditable.innerHTML + "\"");
-
- // #13
- contenteditable.innerHTML = "<span></span><i>abc<u></u></i>";
-
- synthesizeSelectionSet(0, 0);
- is(selection.anchorNode, contenteditable.childNodes.item(1).firstChild,
- "runSetSelectionEventTest #13 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the text node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #13 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.childNodes.item(1).firstChild,
- "runSetSelectionEventTest #13 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #13 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, "", "runSetSelectionEventTest #13 (0, 0), \"" + contenteditable.innerHTML + "\"");
-
- // #14
- contenteditable.innerHTML = "<span></span><i><u>abc</u></i>";
-
- synthesizeSelectionSet(0, 0);
- is(selection.anchorNode, contenteditable.childNodes.item(1).firstChild.firstChild,
- "runSetSelectionEventTest #14 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the text node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #14 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.childNodes.item(1).firstChild.firstChild,
- "runSetSelectionEventTest #14 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #14 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, "", "runSetSelectionEventTest #14 (0, 0), \"" + contenteditable.innerHTML + "\"");
-
- // #15
- contenteditable.innerHTML = "<span></span><i><u></u>abc</i>";
-
- synthesizeSelectionSet(0, 0);
- is(selection.anchorNode, contenteditable.childNodes.item(1).lastChild,
- "runSetSelectionEventTest #15 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the text node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #15 (0, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.childNodes.item(1).lastChild,
- "runSetSelectionEventTest #15 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the text node");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #15 (0, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(0, "", "runSetSelectionEventTest #15 (0, 0), \"" + contenteditable.innerHTML + "\"");
-
- // #16
- contenteditable.innerHTML = "a<blink>b</blink>c";
- synthesizeSelectionSet(0, 3);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #16 (0, 3), \"" + contenteditable.innerHTML + "\": selection anchor node should be the first text node");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #16 (0, 3), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.lastChild,
- "runSetSelectionEventTest #16 (0, 3), \"" + contenteditable.innerHTML + "\": selection focus node should be the last text node");
- is(selection.focusOffset, contenteditable.lastChild.wholeText.length,
- "runSetSelectionEventTest #16 (0, 3), \"" + contenteditable.innerHTML + "\": selection focus offset should be the length of the last text node");
- checkSelection(0, "abc", "runSetSelectionEventTest #16 (0, 3), \"" + contenteditable.innerHTML + "\"");
-
- // #17 (bug 1319660 - incorrect adjustment of content iterator last node)
- contenteditable.innerHTML = "<div>a</div><div><br></div>";
-
- synthesizeSelectionSet(kLFLen, 1+kLFLen);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #17 (kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the first <div> element");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #17 (kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.lastChild,
- "runSetSelectionEventTest #17 (kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the second <div> element");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #17 (kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(kLFLen, "a" + kLF, "runSetSelectionEventTest #17 (kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- synthesizeSelectionSet(1+2*kLFLen, 0);
- is(selection.anchorNode, contenteditable.lastChild,
- "runSetSelectionEventTest #17 (1+2*kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor node should be the second <div> element");
- is(selection.anchorOffset, 0,
- "runSetSelectionEventTest #17 (1+2*kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 0");
- is(selection.focusNode, contenteditable.lastChild,
- "runSetSelectionEventTest #17 (1+2*kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus node should be the second <div> element");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #17 (1+2*kLFLen, 0), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(1+2*kLFLen, "", "runSetSelectionEventTest #17 (1+2*kLFLen, 0), \"" + contenteditable.innerHTML + "\"");
-
- // #18 (bug 1319660 - content iterator start node regression)
- contenteditable.innerHTML = "<div><br></div><div><br></div>";
-
- synthesizeSelectionSet(2*kLFLen, kLFLen);
- is(selection.anchorNode, contenteditable.firstChild,
- "runSetSelectionEventTest #18 (2*kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor node should be the first <div> element");
- is(selection.anchorOffset, 1,
- "runSetSelectionEventTest #18 (2*kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection anchor offset should be 1");
- is(selection.focusNode, contenteditable.lastChild,
- "runSetSelectionEventTest #18 (2*kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus node should be the second <div> element");
- is(selection.focusOffset, 0,
- "runSetSelectionEventTest #18 (2*kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\": selection focus offset should be 0");
- checkSelection(2*kLFLen, kLF, "runSetSelectionEventTest #18 (2*kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-}
-
-function runQueryTextContentEventTest()
-{
- contenteditable.focus();
-
- var result;
-
- // #1
- contenteditable.innerHTML = "abc<br>def";
-
- result = synthesizeQueryTextContent(0, 6 + kLFLen);
- is(result.text, "abc" + kLF + "def", "runQueryTextContentEventTest #1 (0, 6+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, 100);
- is(result.text, "abc" + kLF + "def", "runQueryTextContentEventTest #1 (0, 100), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(2, 2 + kLFLen);
- is(result.text, "c" + kLF + "d", "runQueryTextContentEventTest #1 (2, 2+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(1, 2);
- is(result.text, "bc", "runQueryTextContentEventTest #1 (1, 2), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(3, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #1 (3, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(6 + kLFLen, 1);
- is(result.text, "", "runQueryTextContentEventTest #1 (6 + kLFLen, 0), \"" + contenteditable.innerHTML + "\"");
-
- // #2
- contenteditable.innerHTML = "<p>a<b>b</b>c</p><p>def</p>";
-
- result = synthesizeQueryTextContent(kLFLen, 4+kLFLen);
- is(result.text, "abc" + kLF + "d", "runQueryTextContentEventTest #2 (kLFLen, 4+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(kLFLen, 2);
- is(result.text, "ab", "runQueryTextContentEventTest #2 (kLFLen, 2), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(1+kLFLen, 2);
- is(result.text, "bc", "runQueryTextContentEventTest #2 (1+kLFLen, 2), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(2+kLFLen, 2+kLFLen);
- is(result.text, "c" + kLF + "d", "runQueryTextContentEventTest #2 (2+kLFLen, 2+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(3+kLFLen*2, 1);
- is(result.text, "d", "runQueryTextContentEventTest #2 (3+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #2 (0, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(2+kLFLen, 1+kLFLen);
- is(result.text, "c" + kLF, "runQueryTextContentEventTest #2 (2+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(3+kLFLen, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #2 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(3+kLFLen, 1+kLFLen);
- is(result.text, kLF + "d", "runQueryTextContentEventTest #2 (3+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- // #3
- contenteditable.innerHTML = "<div>abc<p>def</p></div>";
-
- result = synthesizeQueryTextContent(1+kLFLen, 2);
- is(result.text, "bc", "runQueryTextContentEventTest #3 (1+kLFLen, 2), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(1+kLFLen, 3+kLFLen);
- is(result.text, "bc" + kLF + "d", "runQueryTextContentEventTest #3 (1+kLFLen, 3+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(3+kLFLen*2, 1);
- is(result.text, "d", "runQueryTextContentEventTest #3 (3+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, 6+kLFLen*2);
- is(result.text, kLF + "abc" + kLF + "def", "runQueryTextContentEventTest #3 (0, 6+kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, 100);
- is(result.text, kLF + "abc" + kLF + "def", "runQueryTextContentEventTest #3 (0, 100), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(4+kLFLen*2, 2);
- is(result.text, "ef", "runQueryTextContentEventTest #3 (4+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(4+kLFLen*2, 100);
- is(result.text, "ef", "runQueryTextContentEventTest #3 (4+kLFLen*2, 100), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(6+kLFLen*2, 1);
- is(result.text, "", "runQueryTextContentEventTest #3 (6+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #3 (0, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, 1+kLFLen);
- is(result.text, kLF + "a", "runQueryTextContentEventTest #3 (0, 1+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(2+kLFLen, 1+kLFLen);
- is(result.text, "c" + kLF, "runQueryTextContentEventTest #3 (2+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(3+kLFLen, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #3 (3+kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(3+kLFLen, 1+kLFLen);
- is(result.text, kLF + "d", "runQueryTextContentEventTest #3 (3+kLFLen, 1+kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- // #4
- contenteditable.innerHTML = "<div><p>abc</p>def</div>";
-
- result = synthesizeQueryTextContent(1+kLFLen*2, 2);
- is(result.text, "bc", "runQueryTextContentEventTest #4 (1+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(1+kLFLen*2, 3);
- is(result.text, "bcd", "runQueryTextContentEventTest #4 (1+kLFLen*2, 3), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(3+kLFLen*2, 1);
- is(result.text, "d", "runQueryTextContentEventTest #4 (3+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, 6+kLFLen*2);
- is(result.text, kLF + kLF + "abcdef", "runQueryTextContentEventTest #4 (0, 6+kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, 100);
- is(result.text, kLF + kLF + "abcdef", "runQueryTextContentEventTest #4 (0, 100), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(4+kLFLen*2, 2);
- is(result.text, "ef", "runQueryTextContentEventTest #4 (4+kLFLen*2, 2), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(4+kLFLen*2, 100);
- is(result.text, "ef", "runQueryTextContentEventTest #4 (4+kLFLen*2, 100), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(6+kLFLen*2, 1);
- is(result.text, "", "runQueryTextContentEventTest #4 (6+kLFLen*2, 1), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #4 (0, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, kLFLen*2);
- is(result.text, kLF + kLF, "runQueryTextContentEventTest #4 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, 1+kLFLen*2);
- is(result.text, kLF + kLF + "a", "runQueryTextContentEventTest #4 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(kLFLen, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #4 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(kLFLen, 1+kLFLen);
- is(result.text, kLF + "a", "runQueryTextContentEventTest #4 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- // #5
- contenteditable.innerHTML = "<br>";
-
- result = synthesizeQueryTextContent(0, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #5 (0, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(kLFLen, 1);
- is(result.text, "", "runQueryTextContentEventTest #5 (kLFLen, 1), \"" + contenteditable.innerHTML + "\"");
-
- // #6
- contenteditable.innerHTML = "<p><br></p>";
-
- result = synthesizeQueryTextContent(kLFLen, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #6 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(kLFLen*2, 1);
- is(result.text, "", "runQueryTextContentEventTest #5 (kLFLen*2, 1), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #6 (0, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, kLFLen*2);
- is(result.text, kLF + kLF, "runQueryTextContentEventTest #6 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- // #7
- contenteditable.innerHTML = "<br><br>";
-
- result = synthesizeQueryTextContent(0, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #7 (0, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(0, kLFLen * 2);
- is(result.text, kLF + kLF, "runQueryTextContentEventTest #7 (0, kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(kLFLen, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #7 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(kLFLen * 2, 1);
- is(result.text, "", "runQueryTextContentEventTest #7 (kLFLen*2, 1), \"" + contenteditable.innerHTML + "\"");
-
- // #8
- contenteditable.innerHTML = "<p><br><br></p>";
-
- result = synthesizeQueryTextContent(kLFLen, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #8 (kLFLen, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(kLFLen, kLFLen * 2);
- is(result.text, kLF + kLF, "runQueryTextContentEventTest #8 (kLFLen, kLFLen*2), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(kLFLen*2, kLFLen);
- is(result.text, kLF, "runQueryTextContentEventTest #8 (kLFLen*2, kLFLen), \"" + contenteditable.innerHTML + "\"");
-
- result = synthesizeQueryTextContent(kLFLen*3, 1);
- is(result.text, "", "runQueryTextContentEventTest #8 (kLFLen*3, 1), \"" + contenteditable.innerHTML + "\"");
-
- // #16
- contenteditable.innerHTML = "a<blink>b</blink>c";
-
- result = synthesizeQueryTextContent(0, 3);
- is(result.text, "abc", "runQueryTextContentEventTest #16 (0, 3), \"" + contenteditable.innerHTML + "\"");
-}
-
-function runQueryIMESelectionTest()
-{
- textarea.focus();
- textarea.value = "before after";
- var startoffset = textarea.selectionStart = textarea.selectionEnd = "before ".length;
-
- if (!checkIMESelection("RawClause", false, 0, "", "runQueryIMESelectionTest: before starting composition") ||
- !checkIMESelection("SelectedRawClause", false, 0, "", "runQueryIMESelectionTest: before starting composition") ||
- !checkIMESelection("ConvertedClause", false, 0, "", "runQueryIMESelectionTest: before starting composition") ||
- !checkIMESelection("SelectedClause", false, 0, "", "runQueryIMESelectionTest: before starting composition")) {
- synthesizeComposition({ type: "compositioncommitasis" });
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "a",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- if (!checkIMESelection("RawClause", true, startoffset, "a", "runQueryIMESelectionTest: inputting raw text") ||
- !checkIMESelection("SelectedRawClause", false, 0, "", "runQueryIMESelectionTest: inputting raw text") ||
- !checkIMESelection("ConvertedClause", false, 0, "", "runQueryIMESelectionTest: inputting raw text") ||
- !checkIMESelection("SelectedClause", false, 0, "", "runQueryIMESelectionTest: inputting raw text")) {
- synthesizeComposition({ type: "compositioncommitasis" });
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "abcdefgh",
- "clauses":
- [
- { "length": 8, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 8, "length": 0 }
- });
-
- if (!checkIMESelection("RawClause", true, startoffset, "abcdefgh", "runQueryIMESelectionTest: updating raw text") ||
- !checkIMESelection("SelectedRawClause", false, 0, "", "runQueryIMESelectionTest: updating raw text") ||
- !checkIMESelection("ConvertedClause", false, 0, "", "runQueryIMESelectionTest: updating raw text") ||
- !checkIMESelection("SelectedClause", false, 0, "", "runQueryIMESelectionTest: updating raw text")) {
- synthesizeComposition({ type: "compositioncommitasis" });
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "ABCDEFGH",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE },
- { "length": 3, "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE },
- { "length": 3, "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE },
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- if (!checkIMESelection("RawClause", false, 0, "", "runQueryIMESelectionTest: starting to convert") ||
- !checkIMESelection("SelectedRawClause", false, 0, "", "runQueryIMESelectionTest: starting to convert") ||
- !checkIMESelection("ConvertedClause", true, startoffset + 2, "CDE", "runQueryIMESelectionTest: starting to convert") ||
- !checkIMESelection("SelectedClause", true, startoffset, "AB", "runQueryIMESelectionTest: starting to convert")) {
- synthesizeComposition({ type: "compositioncommitasis" });
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "ABCDEFGH",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE },
- { "length": 3, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE },
- { "length": 3, "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE },
- ]
- },
- "caret": { "start": 5, "length": 0 }
- });
-
- if (!checkIMESelection("RawClause", false, 0, "", "runQueryIMESelectionTest: changing selected clause") ||
- !checkIMESelection("SelectedRawClause", false, 0, "", "runQueryIMESelectionTest: changing selected clause") ||
- !checkIMESelection("ConvertedClause", true, startoffset, "AB", "runQueryIMESelectionTest: changing selected clause") ||
- !checkIMESelection("SelectedClause", true, startoffset + 2, "CDE", "runQueryIMESelectionTest: changing selected clause")) {
- synthesizeComposition({ type: "compositioncommitasis" });
- return;
- }
-
- synthesizeComposition({ type: "compositioncommitasis" });
-
- if (!checkIMESelection("RawClause", false, 0, "", "runQueryIMESelectionTest: after committing composition") ||
- !checkIMESelection("SelectedRawClause", false, 0, "", "runQueryIMESelectionTest: after committing composition") ||
- !checkIMESelection("ConvertedClause", false, 0, "", "runQueryIMESelectionTest: after committing composition") ||
- !checkIMESelection("SelectedClause", false, 0, "", "runQueryIMESelectionTest: after committing composition")) {
- return;
- }
-
- startoffset = textarea.selectionStart;
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "abcdefgh",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE },
- { "length": 1, "attr": COMPOSITION_ATTR_SELECTED_RAW_CLAUSE },
- { "length": 1, "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE },
- { "length": 1, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE },
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE },
- { "length": 1, "attr": COMPOSITION_ATTR_SELECTED_RAW_CLAUSE },
- { "length": 1, "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE },
- { "length": 1, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE },
- ]
- },
- "caret": { "start": 8, "length": 0 }
- });
-
- if (!checkIMESelection("RawClause", true, startoffset, "a", "runQueryIMESelectionTest: unrealistic testcase") ||
- !checkIMESelection("SelectedRawClause", true, startoffset + 1, "b", "runQueryIMESelectionTest: unrealistic testcase") ||
- !checkIMESelection("ConvertedClause", true, startoffset + 2, "c", "runQueryIMESelectionTest: unrealistic testcase") ||
- !checkIMESelection("SelectedClause", true, startoffset + 3, "d", "runQueryIMESelectionTest: unrealistic testcase")) {
- synthesizeComposition({ type: "compositioncommitasis" });
- return;
- }
-
- synthesizeComposition({ type: "compositioncommitasis" });
-}
-
-function runQueryContentEventRelativeToInsertionPoint()
-{
- textarea.focus();
- textarea.value = "0123456789";
-
- var startoffset = textarea.selectionStart = textarea.selectionEnd = 0;
-
- if (!checkContentRelativeToSelection(0, 1, 0, "0", "runQueryContentEventRelativeToInsertionPoint[0-0]", "#1") ||
- !checkContentRelativeToSelection(-1, 1, 0, "0", "runQueryContentEventRelativeToInsertionPoint[0-0]", "#2") ||
- !checkContentRelativeToSelection(1, 1, 1, "1", "runQueryContentEventRelativeToInsertionPoint[0-0]", "#3") ||
- !checkContentRelativeToSelection(5, 10, 5, "56789", "runQueryContentEventRelativeToInsertionPoint[0-0]", "#4") ||
- !checkContentRelativeToSelection(10, 1, 10, "", "runQueryContentEventRelativeToInsertionPoint[0-0]", "#5")) {
- return;
- }
-
- textarea.selectionEnd = 5;
-
- if (!checkContentRelativeToSelection(0, 1, 0, "0", "runQueryContentEventRelativeToInsertionPoint[0-5]", "#1") ||
- !checkContentRelativeToSelection(-1, 1, 0, "0", "runQueryContentEventRelativeToInsertionPoint[0-5]", "#2") ||
- !checkContentRelativeToSelection(1, 1, 1, "1", "runQueryContentEventRelativeToInsertionPoint[0-5]", "#3") ||
- !checkContentRelativeToSelection(5, 10, 5, "56789", "runQueryContentEventRelativeToInsertionPoint[0-5]", "#4") ||
- !checkContentRelativeToSelection(10, 1, 10, "", "runQueryContentEventRelativeToInsertionPoint[0-5]"), "#5") {
- return;
- }
-
- startoffset = textarea.selectionStart = textarea.selectionEnd = 4;
-
- if (!checkContentRelativeToSelection(0, 1, startOffset + 0, "4", "runQueryContentEventRelativeToInsertionPoint[4-4]", "#1") ||
- !checkContentRelativeToSelection(-1, 1, startOffset - 1, "3", "runQueryContentEventRelativeToInsertionPoint[4-4]", "#2") ||
- !checkContentRelativeToSelection(1, 1, startOffset + 1, "5", "runQueryContentEventRelativeToInsertionPoint[4-4]", "#3") ||
- !checkContentRelativeToSelection(5, 10, startOffset + 5, "9", "runQueryContentEventRelativeToInsertionPoint[4-4]", "#4") ||
- !checkContentRelativeToSelection(10, 1, 10, "", "runQueryContentEventRelativeToInsertionPoint[4-4]", "#5")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "a",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- if (!checkContentRelativeToSelection(0, 1, startOffset + 0, "a", "runQueryContentEventRelativeToInsertionPoint[composition at 4]", "#1") ||
- !checkContentRelativeToSelection(-1, 1, startOffset - 1, "3", "runQueryContentEventRelativeToInsertionPoint[composition at 4]", "#2") ||
- !checkContentRelativeToSelection(1, 1, startOffset + 1, "4", "runQueryContentEventRelativeToInsertionPoint[composition at 4]", "#3") ||
- !checkContentRelativeToSelection(5, 10, startOffset + 5, "89", "runQueryContentEventRelativeToInsertionPoint[composition at 4]", "#4") ||
- !checkContentRelativeToSelection(11, 1, 11, "", "runQueryContentEventRelativeToInsertionPoint[composition at 4]")) {
- synthesizeComposition({ type: "compositioncommitasis" });
- return;
- }
-
- synthesizeComposition({ type: "compositioncommitasis" });
-
- // Move start of composition at first compositionupdate event.
- function onCompositionUpdate(aEvent)
- {
- startoffset = textarea.selectionStart = textarea.selectionEnd = textarea.selectionStart - 1;
- textarea.removeEventListener("compositionupdate", onCompositionUpdate);
- }
- textarea.addEventListener("compositionupdate", onCompositionUpdate);
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "a",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- if (!checkContentRelativeToSelection(0, 1, startOffset + 0, "b", "runQueryContentEventRelativeToInsertionPoint[composition at 3]", "#1") ||
- !checkContentRelativeToSelection(-1, 1, startOffset - 1, "3", "runQueryContentEventRelativeToInsertionPoint[composition at 3]", "#2") ||
- !checkContentRelativeToSelection(1, 1, startOffset + 1, "a", "runQueryContentEventRelativeToInsertionPoint[composition at 3]", "#3") ||
- !checkContentRelativeToSelection(5, 10, startOffset + 5, "789", "runQueryContentEventRelativeToInsertionPoint[composition at 3]", "#4") ||
- !checkContentRelativeToSelection(12, 1, 12, "", "runQueryContentEventRelativeToInsertionPoint[composition at 3]", "#5")) {
- synthesizeComposition({ type: "compositioncommitasis" });
- return;
- }
-
- synthesizeComposition({ type: "compositioncommitasis" });
-}
-
-function runCSSTransformTest()
-{
- textarea.focus();
- textarea.value = "some text";
- textarea.selectionStart = textarea.selectionEnd = textarea.value.length;
- var editorRect = synthesizeQueryEditorRect();
- if (!checkQueryContentResult(editorRect,
- "runCSSTransformTest: editorRect")) {
- return;
- }
- var firstCharRect = synthesizeQueryTextRect(0, 1);
- if (!checkQueryContentResult(firstCharRect,
- "runCSSTransformTest: firstCharRect")) {
- return;
- }
- var lastCharRect = synthesizeQueryTextRect(textarea.value.length - 1, textarea.value.length);
- if (!checkQueryContentResult(lastCharRect,
- "runCSSTransformTest: lastCharRect")) {
- return;
- }
- var caretRect = synthesizeQueryCaretRect(textarea.selectionStart);
- if (!checkQueryContentResult(caretRect,
- "runCSSTransformTest: caretRect")) {
- return;
- }
- var caretRectBeforeFirstChar = synthesizeQueryCaretRect(0);
- if (!checkQueryContentResult(caretRectBeforeFirstChar,
- "runCSSTransformTest: caretRectBeforeFirstChar")) {
- return;
- }
-
- try {
- textarea.style.transform = "translate(10px, 15px)";
- function movedRect(aRect, aX, aY)
- {
- return { left: aRect.left + aX, top: aRect.top + aY, width: aRect.width, height: aRect.height }
- }
-
- var editorRectTranslated = synthesizeQueryEditorRect();
- if (!checkQueryContentResult(editorRectTranslated,
- "runCSSTransformTest: editorRectTranslated, " + textarea.style.transform) ||
- !checkRect(editorRectTranslated, movedRect(editorRect, 10, 15),
- "runCSSTransformTest: editorRectTranslated, " + textarea.style.transform)) {
- return;
- }
- var firstCharRectTranslated = synthesizeQueryTextRect(0, 1);
- if (!checkQueryContentResult(firstCharRectTranslated,
- "runCSSTransformTest: firstCharRectTranslated, " + textarea.style.transform) ||
- !checkRect(firstCharRectTranslated, movedRect(firstCharRect, 10, 15),
- "runCSSTransformTest: firstCharRectTranslated, " + textarea.style.transform)) {
- return;
- }
- var lastCharRectTranslated = synthesizeQueryTextRect(textarea.value.length - 1, textarea.value.length);
- if (!checkQueryContentResult(lastCharRectTranslated,
- "runCSSTransformTest: lastCharRectTranslated, " + textarea.style.transform) ||
- !checkRect(lastCharRectTranslated, movedRect(lastCharRect, 10, 15),
- "runCSSTransformTest: lastCharRectTranslated, " + textarea.style.transform)) {
- return;
- }
- var caretRectTranslated = synthesizeQueryCaretRect(textarea.selectionStart);
- if (!checkQueryContentResult(caretRectTranslated,
- "runCSSTransformTest: caretRectTranslated, " + textarea.style.transform) ||
- !checkRect(caretRectTranslated, movedRect(caretRect, 10, 15),
- "runCSSTransformTest: caretRectTranslated, " + textarea.style.transform)) {
- return;
- }
- var caretRectBeforeFirstCharTranslated = synthesizeQueryCaretRect(0);
- if (!checkQueryContentResult(caretRectBeforeFirstCharTranslated,
- "runCSSTransformTest: caretRectBeforeFirstCharTranslated, " + textarea.style.transform) ||
- !checkRect(caretRectBeforeFirstCharTranslated, movedRect(caretRectBeforeFirstChar, 10, 15),
- "runCSSTransformTest: caretRectBeforeFirstCharTranslated, " + textarea.style.transform)) {
- return;
- }
- var firstCharRectTranslatedAsArray = synthesizeQueryTextRectArray(0, 1);
- if (!checkQueryContentResult(firstCharRectTranslatedAsArray, "runCSSTransformTest: firstCharRectTranslatedAsArray, " + textarea.style.transform) ||
- !checkRectArray(firstCharRectTranslatedAsArray, [firstCharRectTranslated], "runCSSTransformTest: firstCharRectTranslatedAsArray, " + textarea.style.transform)) {
- return;
- }
- var lastCharRectTranslatedAsArray = synthesizeQueryTextRectArray(textarea.value.length - 1, textarea.value.length);
- if (!checkQueryContentResult(lastCharRectTranslatedAsArray, "runCSSTransformTest: lastCharRectTranslatedAsArray, " + textarea.style.transform) ||
- !checkRectArray(lastCharRectTranslatedAsArray, [lastCharRectTranslated], "runCSSTransformTest: lastCharRectTranslatedAsArray, " + textarea.style.transform)) {
- return;
- }
-
- // XXX It's too difficult to check the result with scale and rotate...
- // For now, let's check if query text rect and query text rect array returns same rect.
- textarea.style.transform = "scale(1.5)";
- firstCharRectTranslated = synthesizeQueryTextRect(0, 1);
- if (!checkQueryContentResult(firstCharRectTranslated,
- "runCSSTransformTest: firstCharRectTranslated, " + textarea.style.transform)) {
- return;
- }
- lastCharRectTranslated = synthesizeQueryTextRect(textarea.value.length - 1, textarea.value.length);
- if (!checkQueryContentResult(lastCharRectTranslated,
- "runCSSTransformTest: lastCharRectTranslated, " + textarea.style.transform)) {
- return;
- }
- firstCharRectTranslatedAsArray = synthesizeQueryTextRectArray(0, 1);
- if (!checkQueryContentResult(firstCharRectTranslatedAsArray, "runCSSTransformTest: firstCharRectTranslatedAsArray, " + textarea.style.transform) ||
- !checkRectArray(firstCharRectTranslatedAsArray, [firstCharRectTranslated], "runCSSTransformTest: firstCharRectTranslatedAsArray, " + textarea.style.transform)) {
- return;
- }
- lastCharRectTranslatedAsArray = synthesizeQueryTextRectArray(textarea.value.length - 1, textarea.value.length);
- if (!checkQueryContentResult(lastCharRectTranslatedAsArray, "runCSSTransformTest: lastCharRectTranslatedAsArray, " + textarea.style.transform) ||
- !checkRectArray(lastCharRectTranslatedAsArray, [lastCharRectTranslated], "runCSSTransformTest: lastCharRectTranslatedAsArray, " + textarea.style.transform)) {
- return;
- }
-
- textarea.style.transform = "rotate(30deg)";
- firstCharRectTranslated = synthesizeQueryTextRect(0, 1);
- if (!checkQueryContentResult(firstCharRectTranslated,
- "runCSSTransformTest: firstCharRectTranslated, " + textarea.style.transform)) {
- return;
- }
- lastCharRectTranslated = synthesizeQueryTextRect(textarea.value.length - 1, textarea.value.length);
- if (!checkQueryContentResult(lastCharRectTranslated,
- "runCSSTransformTest: lastCharRectTranslated, " + textarea.style.transform)) {
- return;
- }
- firstCharRectTranslatedAsArray = synthesizeQueryTextRectArray(0, 1);
- if (!checkQueryContentResult(firstCharRectTranslatedAsArray, "runCSSTransformTest: firstCharRectTranslatedAsArray, " + textarea.style.transform) ||
- !checkRectArray(firstCharRectTranslatedAsArray, [firstCharRectTranslated], "runCSSTransformTest: firstCharRectTranslatedAsArray, " + textarea.style.transform)) {
- return;
- }
- lastCharRectTranslatedAsArray = synthesizeQueryTextRectArray(textarea.value.length - 1, textarea.value.length);
- if (!checkQueryContentResult(lastCharRectTranslatedAsArray, "runCSSTransformTest: lastCharRectTranslatedAsArray, " + textarea.style.transform) ||
- !checkRectArray(lastCharRectTranslatedAsArray, [lastCharRectTranslated], "runCSSTransformTest: lastCharRectTranslatedAsArray, " + textarea.style.transform)) {
- return;
- }
- } finally {
- textarea.style.transform = "";
- }
-}
-
-function runBug722639Test()
-{
- textarea.focus();
- textarea.value = "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n";
- textarea.value += textarea.value;
- textarea.value += textarea.value; // 80 characters
-
- var firstLine = synthesizeQueryTextRect(0, 1);
- if (!checkQueryContentResult(firstLine,
- "runBug722639Test: firstLine")) {
- return;
- }
- ok(true, "runBug722639Test: 1st line, top=" + firstLine.top + ", left=" + firstLine.left);
- var firstLineAsArray = synthesizeQueryTextRectArray(0, 1);
- if (!checkQueryContentResult(firstLineAsArray, "runBug722639Test: 1st line as array") ||
- !checkRectArray(firstLineAsArray, [firstLine], "runBug722639Test: 1st line as array should match with text rect result")) {
- return;
- }
- if (kLFLen > 1) {
- var firstLineLF = synthesizeQueryTextRect(1, 1);
- if (!checkQueryContentResult(firstLineLF,
- "runBug722639Test: firstLineLF")) {
- return;
- }
- is(firstLineLF.top, firstLine.top, "runBug722639Test: 1st line's \\n rect should be same as 1st line's \\r rect");
- is(firstLineLF.left, firstLine.left, "runBug722639Test: 1st line's \\n rect should be same as 1st line's \\r rect");
- is(firstLineLF.height, firstLine.height, "runBug722639Test: 1st line's \\n rect should be same as 1st line's \\r rect");
- is(firstLineLF.width, firstLine.width, "runBug722639Test: 1st line's \\n rect should be same as 1st line's \\r rect");
- var firstLineLFAsArray = synthesizeQueryTextRectArray(1, 1);
- if (!checkQueryContentResult(firstLineLFAsArray, "runBug722639Test: 1st line's \\n rect as array") ||
- !checkRectArray(firstLineLFAsArray, [firstLineLF], "runBug722639Test: 1st line's rect as array should match with text rect result")) {
- return;
- }
- }
- var secondLine = synthesizeQueryTextRect(kLFLen, 1);
- if (!checkQueryContentResult(secondLine,
- "runBug722639Test: secondLine")) {
- return;
- }
- ok(true, "runBug722639Test: 2nd line, top=" + secondLine.top + ", left=" + secondLine.left);
- var secondLineAsArray = synthesizeQueryTextRectArray(kLFLen, 1);
- if (!checkQueryContentResult(secondLineAsArray, "runBug722639Test: 2nd line as array") ||
- !checkRectArray(secondLineAsArray, [secondLine], "runBug722639Test: 2nd line as array should match with text rect result")) {
- return;
- }
- if (kLFLen > 1) {
- var secondLineLF = synthesizeQueryTextRect(kLFLen + 1, 1);
- if (!checkQueryContentResult(secondLineLF,
- "runBug722639Test: secondLineLF")) {
- return;
- }
- is(secondLineLF.top, secondLine.top, "runBug722639Test: 2nd line's \\n rect should be same as 2nd line's \\r rect");
- is(secondLineLF.left, secondLine.left, "runBug722639Test: 2nd line's \\n rect should be same as 2nd line's \\r rect");
- is(secondLineLF.height, secondLine.height, "runBug722639Test: 2nd line's \\n rect should be same as 2nd line's \\r rect");
- is(secondLineLF.width, secondLine.width, "runBug722639Test: 2nd line's \\n rect should be same as 2nd line's \\r rect");
- var secondLineLFAsArray = synthesizeQueryTextRectArray(kLFLen + 1, 1);
- if (!checkQueryContentResult(secondLineLFAsArray, "runBug722639Test: 2nd line's \\n rect as array") ||
- !checkRectArray(secondLineLFAsArray, [secondLineLF], "runBug722639Test: 2nd line's rect as array should match with text rect result")) {
- return;
- }
- }
- var lineHeight = secondLine.top - firstLine.top;
- ok(lineHeight > 0,
- "runBug722639Test: lineHeight must be positive");
- is(secondLine.left, firstLine.left,
- "runBug722639Test: the left value must be always same value");
- is(secondLine.height, firstLine.height,
- "runBug722639Test: the height must be always same value");
- var previousTop = secondLine.top;
- for (var i = 3; i <= textarea.value.length + 1; i++) {
- var currentLine = synthesizeQueryTextRect(kLFLen * (i - 1), 1);
- if (!checkQueryContentResult(currentLine,
- "runBug722639Test: " + i + "th currentLine")) {
- return;
- }
- ok(true, "runBug722639Test: " + i + "th line, top=" + currentLine.top + ", left=" + currentLine.left);
- var currentLineAsArray = synthesizeQueryTextRectArray(kLFLen * (i - 1), 1);
- if (!checkQueryContentResult(currentLineAsArray, "runBug722639Test: " + i + "th line as array") ||
- !checkRectArray(currentLineAsArray, [currentLine], "runBug722639Test: " + i + "th line as array should match with text rect result")) {
- return;
- }
- // NOTE: the top position may be 1px larger or smaller than other lines
- // due to sub pixel positioning.
- if (Math.abs(currentLine.top - (previousTop + lineHeight)) <= 1) {
- ok(true, "runBug722639Test: " + i + "th line's top is expected");
- } else {
- is(currentLine.top, previousTop + lineHeight,
- "runBug722639Test: " + i + "th line's top is unexpected");
- }
- is(currentLine.left, firstLine.left,
- "runBug722639Test: " + i + "th line's left is unexpected");
- is(currentLine.height, firstLine.height,
- "runBug722639Test: " + i + "th line's height is unexpected");
- if (kLFLen > 1) {
- var currentLineLF = synthesizeQueryTextRect(kLFLen * (i - 1) + 1, 1);
- if (!checkQueryContentResult(currentLineLF,
- "runBug722639Test: " + i + "th currentLineLF")) {
- return;
- }
- is(currentLineLF.top, currentLine.top, "runBug722639Test: " + i + "th line's \\n rect should be same as same line's \\r rect");
- is(currentLineLF.left, currentLine.left, "runBug722639Test: " + i + "th line's \\n rect should be same as same line's \\r rect");
- is(currentLineLF.height, currentLine.height, "runBug722639Test: " + i + "th line's \\n rect should be same as same line's \\r rect");
- is(currentLineLF.width, currentLine.width, "runBug722639Test: " + i + "th line's \\n rect should be same as same line's \\r rect");
- var currentLineLFAsArray = synthesizeQueryTextRectArray(kLFLen * (i - 1) + 1, 1);
- if (!checkQueryContentResult(currentLineLFAsArray, "runBug722639Test: " + i + "th line's \\n rect as array") ||
- !checkRectArray(currentLineLFAsArray, [currentLineLF], "runBug722639Test: " + i + "th line's rect as array should match with text rect result")) {
- return;
- }
- }
- previousTop = currentLine.top;
- }
-}
-
-function runForceCommitTest()
-{
- var events;
- function eventHandler(aEvent)
- {
- events.push(aEvent);
- }
- window.addEventListener("compositionstart", eventHandler, true);
- window.addEventListener("compositionupdate", eventHandler, true);
- window.addEventListener("compositionend", eventHandler, true);
- window.addEventListener("input", eventHandler, true);
- window.addEventListener("text", eventHandler, true);
-
- // Make the composition in textarea commit by click in the textarea
- textarea.focus();
- textarea.value = "";
-
- events = [];
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- is(events.length, 4,
- "runForceCommitTest: wrong event count #1");
- is(events[0].type, "compositionstart",
- "runForceCommitTest: the 1st event must be compositionstart #1");
- is(events[1].type, "compositionupdate",
- "runForceCommitTest: the 2nd event must be compositionupdate #1");
- is(events[2].type, "text",
- "runForceCommitTest: the 3rd event must be text #1");
- is(events[3].type, "input",
- "runForceCommitTest: the 4th event must be input #1");
-
- events = [];
- synthesizeMouseAtCenter(textarea, {});
-
- is(events.length, 3,
- "runForceCommitTest: wrong event count #2");
- is(events[0].type, "text",
- "runForceCommitTest: the 1st event must be text #2");
- is(events[1].type, "compositionend",
- "runForceCommitTest: the 2nd event must be compositionend #2");
- is(events[2].type, "input",
- "runForceCommitTest: the 3rd event must be input #2");
- is(events[1].data, "\u306E",
- "runForceCommitTest: compositionend has wrong data #2");
- is(events[0].target, textarea,
- "runForceCommitTest: The 1st event was fired on wrong event target #2");
- is(events[1].target, textarea,
- "runForceCommitTest: The 2nd event was fired on wrong event target #2");
- is(events[2].target, textarea,
- "runForceCommitTest: The 3rd event was fired on wrong event target #2");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runForceCommitTest: the textarea still has composition #2");
- is(textarea.value, "\u306E",
- "runForceCommitTest: the textarea doesn't have the committed text #2");
-
- // Make the composition in textarea commit by click in another editor (input)
- textarea.focus();
- textarea.value = "";
- input.value = "";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- synthesizeMouseAtCenter(input, {});
-
- is(events.length, 3,
- "runForceCommitTest: wrong event count #3");
- is(events[0].type, "text",
- "runForceCommitTest: the 1st event must be text #3");
- is(events[1].type, "compositionend",
- "runForceCommitTest: the 2nd event must be compositionend #3");
- is(events[2].type, "input",
- "runForceCommitTest: the 3rd event must be input #3");
- is(events[1].data, "\u306E",
- "runForceCommitTest: compositionend has wrong data #3");
- is(events[0].target, textarea,
- "runForceCommitTest: The 1st event was fired on wrong event target #3");
- is(events[1].target, textarea,
- "runForceCommitTest: The 2nd event was fired on wrong event target #3");
- is(events[2].target, textarea,
- "runForceCommitTest: The 3rd event was fired on wrong event target #3");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runForceCommitTest: the textarea still has composition #3");
- ok(!getEditorIMESupport(input).isComposing,
- "runForceCommitTest: the input has composition #3");
- is(textarea.value, "\u306E",
- "runForceCommitTest: the textarea doesn't have the committed text #3");
- is(input.value, "",
- "runForceCommitTest: the input has the committed text? #3");
-
- // Make the composition in textarea commit by blur()
- textarea.focus();
- textarea.value = "";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- textarea.blur();
-
- is(events.length, 3,
- "runForceCommitTest: wrong event count #4");
- is(events[0].type, "text",
- "runForceCommitTest: the 1st event must be text #4");
- is(events[1].type, "compositionend",
- "runForceCommitTest: the 2nd event must be compositionend #4");
- is(events[2].type, "input",
- "runForceCommitTest: the 3rd event must be input #4");
- is(events[1].data, "\u306E",
- "runForceCommitTest: compositionend has wrong data #4");
- is(events[0].target, textarea,
- "runForceCommitTest: The 1st event was fired on wrong event target #4");
- is(events[1].target, textarea,
- "runForceCommitTest: The 2nd event was fired on wrong event target #4");
- is(events[2].target, textarea,
- "runForceCommitTest: The 3rd event was fired on wrong event target #4");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runForceCommitTest: the textarea still has composition #4");
- is(textarea.value, "\u306E",
- "runForceCommitTest: the textarea doesn't have the committed text #4");
-
- // Make the composition in textarea commit by input.focus()
- textarea.focus();
- textarea.value = "";
- input.value = "";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- input.focus();
-
- is(events.length, 3,
- "runForceCommitTest: wrong event count #5");
- is(events[0].type, "text",
- "runForceCommitTest: the 1st event must be text #5");
- is(events[1].type, "compositionend",
- "runForceCommitTest: the 2nd event must be compositionend #5");
- is(events[2].type, "input",
- "runForceCommitTest: the 3rd event must be input #5");
- is(events[1].data, "\u306E",
- "runForceCommitTest: compositionend has wrong data #5");
- is(events[0].target, textarea,
- "runForceCommitTest: The 1st event was fired on wrong event target #5");
- is(events[1].target, textarea,
- "runForceCommitTest: The 2nd event was fired on wrong event target #5");
- is(events[2].target, textarea,
- "runForceCommitTest: The 3rd event was fired on wrong event target #5");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runForceCommitTest: the textarea still has composition #5");
- ok(!getEditorIMESupport(input).isComposing,
- "runForceCommitTest: the input has composition #5");
- is(textarea.value, "\u306E",
- "runForceCommitTest: the textarea doesn't have the committed text #5");
- is(input.value, "",
- "runForceCommitTest: the input has the committed text? #5");
-
- // Make the composition in textarea commit by click in another document's editor
- textarea.focus();
- textarea.value = "";
- textareaInFrame.value = "";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- synthesizeMouseAtCenter(textareaInFrame, {}, iframe.contentWindow);
-
- is(events.length, 3,
- "runForceCommitTest: wrong event count #6");
- is(events[0].type, "text",
- "runForceCommitTest: the 1st event must be text #6");
- is(events[1].type, "compositionend",
- "runForceCommitTest: the 2nd event must be compositionend #6");
- is(events[2].type, "input",
- "runForceCommitTest: the 3rd event must be input #6");
- is(events[1].data, "\u306E",
- "runForceCommitTest: compositionend has wrong data #6");
- is(events[0].target, textarea,
- "runForceCommitTest: The 1st event was fired on wrong event target #6");
- is(events[1].target, textarea,
- "runForceCommitTest: The 2nd event was fired on wrong event target #6");
- is(events[2].target, textarea,
- "runForceCommitTest: The 3rd event was fired on wrong event target #6");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runForceCommitTest: the textarea still has composition #6");
- ok(!getEditorIMESupport(textareaInFrame).isComposing,
- "runForceCommitTest: the textarea in frame has composition #6");
- is(textarea.value, "\u306E",
- "runForceCommitTest: the textarea doesn't have the committed text #6");
- is(textareaInFrame.value, "",
- "runForceCommitTest: the textarea in frame has the committed text? #6");
-
- // Make the composition in textarea commit by another document's editor's focus()
- textarea.focus();
- textarea.value = "";
- textareaInFrame.value = "";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- textareaInFrame.focus();
-
- is(events.length, 3,
- "runForceCommitTest: wrong event count #7");
- is(events[0].type, "text",
- "runForceCommitTest: the 1st event must be text #7");
- is(events[1].type, "compositionend",
- "runForceCommitTest: the 2nd event must be compositionend #7");
- is(events[2].type, "input",
- "runForceCommitTest: the 3rd event must be input #7");
- is(events[1].data, "\u306E",
- "runForceCommitTest: compositionend has wrong data #7");
- is(events[0].target, textarea,
- "runForceCommitTest: The 1st event was fired on wrong event target #7");
- is(events[1].target, textarea,
- "runForceCommitTest: The 2nd event was fired on wrong event target #7");
- is(events[2].target, textarea,
- "runForceCommitTest: The 3rd event was fired on wrong event target #7");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runForceCommitTest: the textarea still has composition #7");
- ok(!getEditorIMESupport(textareaInFrame).isComposing,
- "runForceCommitTest: the textarea in frame has composition #7");
- is(textarea.value, "\u306E",
- "runForceCommitTest: the textarea doesn't have the committed text #7");
- is(textareaInFrame.value, "",
- "runForceCommitTest: the textarea in frame has the committed text? #7");
-
- // Make the composition in a textarea commit by click in another editable document
- textarea.focus();
- textarea.value = "";
- iframe2.contentDocument.body.innerHTML = "Text in the Body";
- var iframe2BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- synthesizeMouseAtCenter(iframe2.contentDocument.body, {}, iframe2.contentWindow);
-
- is(events.length, 3,
- "runForceCommitTest: wrong event count #8");
- is(events[0].type, "text",
- "runForceCommitTest: the 1st event must be text #8");
- is(events[1].type, "compositionend",
- "runForceCommitTest: the 2nd event must be compositionend #8");
- is(events[2].type, "input",
- "runForceCommitTest: the 3rd event must be input #8");
- is(events[1].data, "\u306E",
- "runForceCommitTest: compositionend has wrong data #8");
- is(events[0].target, textarea,
- "runForceCommitTest: The 1st event was fired on wrong event target #8");
- is(events[1].target, textarea,
- "runForceCommitTest: The 2nd event was fired on wrong event target #8");
- is(events[2].target, textarea,
- "runForceCommitTest: The 3rd event was fired on wrong event target #8");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runForceCommitTest: the textarea still has composition #8");
- ok(!getHTMLEditorIMESupport(iframe2.contentWindow).isComposing,
- "runForceCommitTest: the editable document has composition #8");
- is(textarea.value, "\u306E",
- "runForceCommitTest: the textarea doesn't have the committed text #8");
- is(iframe2.contentDocument.body.innerHTML, iframe2BodyInnerHTML,
- "runForceCommitTest: the editable document has the committed text? #8");
-
- // Make the composition in an editable document commit by click in it
- iframe2.contentWindow.focus();
- iframe2.contentDocument.body.innerHTML = "Text in the Body";
- iframe2BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- }, iframe2.contentWindow);
-
- events = [];
- synthesizeMouseAtCenter(iframe2.contentDocument.body, {}, iframe2.contentWindow);
-
- is(events.length, 3,
- "runForceCommitTest: wrong event count #9");
- is(events[0].type, "text",
- "runForceCommitTest: the 1st event must be text #9");
- is(events[1].type, "compositionend",
- "runForceCommitTest: the 2nd event must be compositionend #9");
- is(events[2].type, "input",
- "runForceCommitTest: the 3rd event must be input #9");
- is(events[1].data, "\u306E",
- "runForceCommitTest: compositionend has wrong data #9");
- is(events[0].target, iframe2.contentDocument.body,
- "runForceCommitTest: The 1st event was fired on wrong event target #9");
- is(events[1].target, iframe2.contentDocument.body,
- "runForceCommitTest: The 2nd event was fired on wrong event target #9");
- is(events[2].target, iframe2.contentDocument.body,
- "runForceCommitTest: The 3rd event was fired on wrong event target #9");
- ok(!getHTMLEditorIMESupport(iframe2.contentWindow).isComposing,
- "runForceCommitTest: the editable document still has composition #9");
- ok(iframe2.contentDocument.body.innerHTML != iframe2BodyInnerHTML &&
- iframe2.contentDocument.body.innerHTML.indexOf("\u306E") >= 0,
- "runForceCommitTest: the editable document doesn't have the committed text #9");
-
- // Make the composition in an editable document commit by click in another document's editor
- textarea.value = "";
- iframe2.contentWindow.focus();
- iframe2.contentDocument.body.innerHTML = "Text in the Body";
- iframe2BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- }, iframe2.contentWindow);
-
- events = [];
- synthesizeMouseAtCenter(textarea, {});
-
- is(events.length, 3,
- "runForceCommitTest: wrong event count #10");
- is(events[0].type, "text",
- "runForceCommitTest: the 1st event must be text #10");
- is(events[1].type, "compositionend",
- "runForceCommitTest: the 2nd event must be compositionend #10");
- is(events[2].type, "input",
- "runForceCommitTest: the 3rd event must be input #10");
- is(events[1].data, "\u306E",
- "runForceCommitTest: compositionend has wrong data #10");
- is(events[0].target, iframe2.contentDocument.body,
- "runForceCommitTest: The 1st event was fired on wrong event target #10");
- is(events[1].target, iframe2.contentDocument.body,
- "runForceCommitTest: The 2nd event was fired on wrong event target #10");
- is(events[2].target, iframe2.contentDocument.body,
- "runForceCommitTest: The 3rd event was fired on wrong event target #10");
- ok(!getHTMLEditorIMESupport(iframe2.contentWindow).isComposing,
- "runForceCommitTest: the editable document still has composition #10");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runForceCommitTest: the textarea has composition #10");
- ok(iframe2.contentDocument.body.innerHTML != iframe2BodyInnerHTML &&
- iframe2.contentDocument.body.innerHTML.indexOf("\u306E") >= 0,
- "runForceCommitTest: the editable document doesn't have the committed text #10");
- is(textarea.value, "",
- "runForceCommitTest: the textarea has the committed text? #10");
-
- // Make the composition in an editable document commit by click in the another editable document
- iframe2.contentWindow.focus();
- iframe2.contentDocument.body.innerHTML = "Text in the Body";
- iframe2BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
- iframe3.contentDocument.body.innerHTML = "Text in the Body";
- iframe3BodyInnerHTML = iframe2.contentDocument.body.innerHTML;
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- }, iframe2.contentWindow);
-
- events = [];
- synthesizeMouseAtCenter(iframe3.contentDocument.body, {}, iframe3.contentWindow);
-
- is(events.length, 3,
- "runForceCommitTest: wrong event count #11");
- is(events[0].type, "text",
- "runForceCommitTest: the 1st event must be text #11");
- is(events[1].type, "compositionend",
- "runForceCommitTest: the 2nd event must be compositionend #11");
- is(events[2].type, "input",
- "runForceCommitTest: the 3rd event must be input #11");
- is(events[1].data, "\u306E",
- "runForceCommitTest: compositionend has wrong data #11");
- is(events[0].target, iframe2.contentDocument.body,
- "runForceCommitTest: The 1st event was fired on wrong event target #11");
- is(events[1].target, iframe2.contentDocument.body,
- "runForceCommitTest: The 2nd event was fired on wrong event target #11");
- is(events[2].target, iframe2.contentDocument.body,
- "runForceCommitTest: The 3rd event was fired on wrong event target #11");
- ok(!getHTMLEditorIMESupport(iframe2.contentWindow).isComposing,
- "runForceCommitTest: the editable document still has composition #11");
- ok(!getHTMLEditorIMESupport(iframe3.contentWindow).isComposing,
- "runForceCommitTest: the other editable document has composition #11");
- ok(iframe2.contentDocument.body.innerHTML != iframe2BodyInnerHTML &&
- iframe2.contentDocument.body.innerHTML.indexOf("\u306E") >= 0,
- "runForceCommitTest: the editable document doesn't have the committed text #11");
- is(iframe3.contentDocument.body.innerHTML, iframe3BodyInnerHTML,
- "runForceCommitTest: the other editable document has the committed text? #11");
-
- input.focus();
- input.value = "";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- input.value = "set value";
-
- is(events.length, 3,
- "runForceCommitTest: wrong event count #12");
- is(events[0].type, "text",
- "runForceCommitTest: the 1st event must be text #12");
- is(events[1].type, "compositionend",
- "runForceCommitTest: the 2nd event must be compositionend #12");
- is(events[2].type, "input",
- "runForceCommitTest: the 3rd event must be input #12");
- is(events[1].data, "\u306E",
- "runForceCommitTest: compositionend has wrong data #12");
- is(events[0].target, input,
- "runForceCommitTest: The 1st event was fired on wrong event target #12");
- is(events[1].target, input,
- "runForceCommitTest: The 2nd event was fired on wrong event target #12");
- is(events[2].target, input,
- "runForceCommitTest: The 3rd event was fired on wrong event target #12");
- ok(!getEditorIMESupport(input).isComposing,
- "runForceCommitTest: the input still has composition #12");
- is(input.value, "set value",
- "runForceCommitTest: the input doesn't have the set text #12");
-
- textarea.focus();
- textarea.value = "";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- textarea.value = "set value";
-
- is(events.length, 3,
- "runForceCommitTest: wrong event count #13");
- is(events[0].type, "text",
- "runForceCommitTest: the 1st event must be text #13");
- is(events[1].type, "compositionend",
- "runForceCommitTest: the 2nd event must be compositionend #13");
- is(events[2].type, "input",
- "runForceCommitTest: the 3rd event must be input #13");
- is(events[1].data, "\u306E",
- "runForceCommitTest: compositionend has wrong data #13");
- is(events[0].target, textarea,
- "runForceCommitTest: The 1st event was fired on wrong event target #13");
- is(events[1].target, textarea,
- "runForceCommitTest: The 2nd event was fired on wrong event target #13");
- is(events[2].target, textarea,
- "runForceCommitTest: The 3rd event was fired on wrong event target #13");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runForceCommitTest: the textarea still has composition #13");
- is(textarea.value, "set value",
- "runForceCommitTest: the textarea doesn't have the set text #13");
-
- input.focus();
- input.value = "";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- input.value += " appended value";
-
- is(events.length, 3,
- "runForceCommitTest: wrong event count #14");
- is(events[0].type, "text",
- "runForceCommitTest: the 1st event must be text #14");
- is(events[1].type, "compositionend",
- "runForceCommitTest: the 2nd event must be compositionend #14");
- is(events[2].type, "input",
- "runForceCommitTest: the 3rd event must be input #14");
- is(events[1].data, "\u306E",
- "runForceCommitTest: compositionend has wrong data #14");
- is(events[0].target, input,
- "runForceCommitTest: The 1st event was fired on wrong event target #14");
- is(events[1].target, input,
- "runForceCommitTest: The 2nd event was fired on wrong event target #14");
- is(events[2].target, input,
- "runForceCommitTest: The 3rd event was fired on wrong event target #14");
- ok(!getEditorIMESupport(input).isComposing,
- "runForceCommitTest: the input still has composition #14");
- is(input.value, "\u306E appended value",
- "runForceCommitTest: the input should have both composed text and appended text #14");
-
- input.focus();
- input.value = "abcd";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- input.value = "abcd\u306E";
-
- is(events.length, 0,
- "runForceCommitTest: setting same value to input with composition shouldn't cause any events #15");
- is(input.value, "abcd\u306E",
- "runForceCommitTest: the input has unexpected value #15");
-
- input.blur(); // commit composition
-
- textarea.focus();
- textarea.value = "abcd";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- textarea.value = "abcd\u306E";
-
- is(events.length, 0,
- "runForceCommitTest: setting same value to textarea with composition shouldn't cause any events #16");
- is(textarea.value, "abcd\u306E",
- "runForceCommitTest: the input has unexpected value #16");
-
- textarea.blur(); // commit composition
-
- window.removeEventListener("compositionstart", eventHandler, true);
- window.removeEventListener("compositionupdate", eventHandler, true);
- window.removeEventListener("compositionend", eventHandler, true);
- window.removeEventListener("input", eventHandler, true);
- window.removeEventListener("text", eventHandler, true);
-}
-
-function runNestedSettingValue()
-{
- var isTesting = false;
- var events = [];
- function eventHandler(aEvent)
- {
- events.push(aEvent);
- if (isTesting) {
- aEvent.target.value += aEvent.type + ", ";
- }
- }
- window.addEventListener("compositionstart", eventHandler, true);
- window.addEventListener("compositionupdate", eventHandler, true);
- window.addEventListener("compositionend", eventHandler, true);
- window.addEventListener("input", eventHandler, true);
- window.addEventListener("text", eventHandler, true);
-
- textarea.focus();
- textarea.value = "";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- isTesting = true;
- textarea.value = "first setting value, ";
- isTesting = false;
-
- is(events.length, 3,
- "runNestedSettingValue: wrong event count #1");
- is(events[0].type, "text",
- "runNestedSettingValue: the 1st event must be text #1");
- is(events[1].type, "compositionend",
- "runNestedSettingValue: the 2nd event must be compositionend #1");
- is(events[2].type, "input",
- "runNestedSettingValue: the 3rd event must be input #1");
- is(events[1].data, "\u306E",
- "runNestedSettingValue: compositionend has wrong data #1");
- is(events[0].target, textarea,
- "runNestedSettingValue: The 1st event was fired on wrong event target #1");
- is(events[1].target, textarea,
- "runNestedSettingValue: The 2nd event was fired on wrong event target #1");
- is(events[2].target, textarea,
- "runNestedSettingValue: The 3rd event was fired on wrong event target #1");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runNestedSettingValue: the textarea still has composition #1");
- is(textarea.value, "first setting value, text, compositionend, input, ",
- "runNestedSettingValue: the textarea should have all string set to value attribute");
-
- input.focus();
- input.value = "";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- isTesting = true;
- input.value = "first setting value, ";
- isTesting = false;
-
- is(events.length, 3,
- "runNestedSettingValue: wrong event count #2");
- is(events[0].type, "text",
- "runNestedSettingValue: the 1st event must be text #2");
- is(events[1].type, "compositionend",
- "runNestedSettingValue: the 2nd event must be compositionend #2");
- is(events[2].type, "input",
- "runNestedSettingValue: the 3rd event must be input #2");
- is(events[1].data, "\u306E",
- "runNestedSettingValue: compositionend has wrong data #2");
- is(events[0].target, input,
- "runNestedSettingValue: The 1st event was fired on wrong event target #2");
- is(events[1].target, input,
- "runNestedSettingValue: The 2nd event was fired on wrong event target #2");
- is(events[2].target, input,
- "runNestedSettingValue: The 3rd event was fired on wrong event target #2");
- ok(!getEditorIMESupport(input).isComposing,
- "runNestedSettingValue: the input still has composition #2");
- is(textarea.value, "first setting value, text, compositionend, input, ",
- "runNestedSettingValue: the input should have all string set to value attribute #2");
-
- textarea.focus();
- textarea.value = "";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- isTesting = true;
- textarea.setRangeText("first setting value, ");
- isTesting = false;
-
- is(events.length, 3,
- "runNestedSettingValue: wrong event count #3");
- is(events[0].type, "text",
- "runNestedSettingValue: the 1st event must be text #3");
- is(events[1].type, "compositionend",
- "runNestedSettingValue: the 2nd event must be compositionend #3");
- is(events[2].type, "input",
- "runNestedSettingValue: the 3rd event must be input #3");
- is(events[1].data, "\u306E",
- "runNestedSettingValue: compositionend has wrong data #3");
- is(events[0].target, textarea,
- "runNestedSettingValue: The 1st event was fired on wrong event target #3");
- is(events[1].target, textarea,
- "runNestedSettingValue: The 2nd event was fired on wrong event target #3");
- is(events[2].target, textarea,
- "runNestedSettingValue: The 3rd event was fired on wrong event target #3");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runNestedSettingValue: the textarea still has composition #3");
- is(textarea.value, "\u306Efirst setting value, text, compositionend, input, ",
- "runNestedSettingValue: the textarea should have appended by setRangeText() and all string set to value attribute #3");
-
- input.focus();
- input.value = "";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- events = [];
- isTesting = true;
- input.setRangeText("first setting value, ");
- isTesting = false;
-
- is(events.length, 3,
- "runNestedSettingValue: wrong event count #4");
- is(events[0].type, "text",
- "runNestedSettingValue: the 1st event must be text #4");
- is(events[1].type, "compositionend",
- "runNestedSettingValue: the 2nd event must be compositionend #4");
- is(events[2].type, "input",
- "runNestedSettingValue: the 3rd event must be input #4");
- is(events[1].data, "\u306E",
- "runNestedSettingValue: compositionend has wrong data #4");
- is(events[0].target, input,
- "runNestedSettingValue: The 1st event was fired on wrong event target #4");
- is(events[1].target, input,
- "runNestedSettingValue: The 2nd event was fired on wrong event target #4");
- is(events[2].target, input,
- "runNestedSettingValue: The 3rd event was fired on wrong event target #4");
- ok(!getEditorIMESupport(input).isComposing,
- "runNestedSettingValue: the input still has composition #4");
- is(textarea.value, "\u306Efirst setting value, text, compositionend, input, ",
- "runNestedSettingValue: the input should have all string appended by setRangeText() and set to value attribute #4");
-
- window.removeEventListener("compositionstart", eventHandler, true);
- window.removeEventListener("compositionupdate", eventHandler, true);
- window.removeEventListener("compositionend", eventHandler, true);
- window.removeEventListener("input", eventHandler, true);
- window.removeEventListener("text", eventHandler, true);
-
-}
-
-function runAsyncForceCommitTest(aNextTest)
-{
- var events;
- function eventHandler(aEvent)
- {
- events.push(aEvent);
- };
-
- // If IME commits composition for a request, TextComposition commits
- // composition automatically because most web apps must expect that active
- // composition should be committed synchronously. Therefore, in this case,
- // a click during composition should cause committing composition
- // synchronously and delayed commit shouldn't cause composition events.
- var commitRequested = false;
- function callback(aTIP, aNotification)
- {
- ok(true, aNotification.type);
- if (aNotification.type != "request-to-commit") {
- return true;
- }
- commitRequested = true;
- setTimeout(function () {
- events = [];
- aTIP.commitComposition();
-
- is(events.length, 0,
- "runAsyncForceCommitTest: composition events shouldn't been fired by asynchronous call of nsITextInputProcessor.commitComposition()");
-
- window.removeEventListener("compositionstart", eventHandler, true);
- window.removeEventListener("compositionupdate", eventHandler, true);
- window.removeEventListener("compositionend", eventHandler, true);
- window.removeEventListener("input", eventHandler, true);
- window.removeEventListener("text", eventHandler, true);
-
- SimpleTest.executeSoon(aNextTest);
- }, 1);
- return true;
- };
-
- window.addEventListener("compositionstart", eventHandler, true);
- window.addEventListener("compositionupdate", eventHandler, true);
- window.addEventListener("compositionend", eventHandler, true);
- window.addEventListener("input", eventHandler, true);
- window.addEventListener("text", eventHandler, true);
-
- // Make the composition in textarea commit by click in the textarea
- textarea.focus();
- textarea.value = "";
-
- events = [];
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- }, window, callback);
-
- is(events.length, 4,
- "runAsyncForceCommitTest: wrong event count #1");
- is(events[0].type, "compositionstart",
- "runAsyncForceCommitTest: the 1st event must be compositionstart #1");
- is(events[1].type, "compositionupdate",
- "runAsyncForceCommitTest: the 2nd event must be compositionupdate #1");
- is(events[2].type, "text",
- "runAsyncForceCommitTest: the 3rd event must be text #1");
- is(events[3].type, "input",
- "runAsyncForceCommitTest: the 4th event must be input #1");
-
- events = [];
- commitRequested = false;
- synthesizeMouseAtCenter(textarea, {});
-
- ok(commitRequested,
- "runAsyncForceCommitTest: \"request-to-commit\" should've been notified");
- is(events.length, 3,
- "runAsyncForceCommitTest: wrong event count #2");
- is(events[0].type, "text",
- "runAsyncForceCommitTest: the 1st event must be text #2");
- is(events[1].type, "compositionend",
- "runAsyncForceCommitTest: the 2nd event must be compositionend #2");
- is(events[2].type, "input",
- "runAsyncForceCommitTest: the 3rd event must be input #2");
- is(events[1].data, "\u306E",
- "runAsyncForceCommitTest: compositionend has wrong data #2");
- is(events[0].target, textarea,
- "runAsyncForceCommitTest: The 1st event was fired on wrong event target #2");
- is(events[1].target, textarea,
- "runAsyncForceCommitTest: The 2nd event was fired on wrong event target #2");
- is(events[2].target, textarea,
- "runAsyncForceCommitTest: The 3rd event was fired on wrong event target #2");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runAsyncForceCommitTest: the textarea still has composition #2");
- is(textarea.value, "\u306E",
- "runAsyncForceCommitTest: the textarea doesn't have the committed text #2");
-}
-
-function runBug811755Test()
-{
- iframe2.contentDocument.body.innerHTML = "<div>content<br/></div>";
- iframe2.contentWindow.focus();
- // Query everything
- var textContent = synthesizeQueryTextContent(0, 10);
- if (!checkQueryContentResult(textContent, "runBug811755Test: synthesizeQueryTextContent #1")) {
- return false;
- }
- // Query everything but specify exact end offset, which should be immediately after the <br> node
- // If PreContentIterator is used, the next node after <br> is the node after </div>.
- // If ContentIterator is used, the next node is the <div> node itself. In this case, the end
- // node ends up being before the start node, and an empty string is returned.
- var queryContent = synthesizeQueryTextContent(0, textContent.text.length);
- if (!checkQueryContentResult(queryContent, "runBug811755Test: synthesizeQueryTextContent #2")) {
- return false;
- }
- is(queryContent.text, textContent.text, "runBug811755Test: two queried texts don't match");
- return queryContent.text == textContent.text;
-}
-
-function runIsComposingTest()
-{
- var expectedIsComposing = false;
- var descriptionBase = "runIsComposingTest: ";
- var description = "";
-
- function eventHandler(aEvent)
- {
- if (aEvent.type == "keydown" || aEvent.type == "keyup") {
- is(aEvent.isComposing, expectedIsComposing,
- "runIsComposingTest: " + description + " (type=" + aEvent.type + ", key=" + aEvent.key + ")");
- } else {
- is(aEvent.isComposing, expectedIsComposing,
- "runIsComposingTest: " + description + " (type=" + aEvent.type + ")");
- }
- }
-
- function onComposition(aEvent)
- {
- if (aEvent.type == "compositionstart") {
- expectedIsComposing = true;
- } else if (aEvent.type == "compositionend") {
- expectedIsComposing = false;
- }
- }
-
- textarea.addEventListener("keydown", eventHandler, true);
- textarea.addEventListener("keypress", eventHandler, true);
- textarea.addEventListener("keyup", eventHandler, true);
- textarea.addEventListener("input", eventHandler, true);
- textarea.addEventListener("compositionstart", onComposition, true);
- textarea.addEventListener("compositionend", onComposition, true);
-
- textarea.focus();
- textarea.value = "";
-
- // XXX These cases shouldn't occur in actual native key events because we
- // don't dispatch key events while composition (bug 354358).
- SpecialPowers.setBoolPref("dom.keyboardevent.dispatch_during_composition", true);
- description = "events before dispatching compositionstart";
- synthesizeKey("VK_LEFT", {});
-
- description = "events after dispatching compositionchange";
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 },
- "key": { key: "a", code: "KeyA", keyCode: KeyboardEvent.DOM_VK_A },
- });
-
- // Although, firing keypress event during composition is a bug.
- synthesizeKey("VK_INSERT", {});
-
- description = "events for committing composition string";
-
- synthesizeComposition({ type: "compositioncommitasis",
- key: { key: "KEY_Enter", code: "Enter", type: "keydown" } });
-
- // input event will be fired by synthesizing compositionend event.
- // Then, its isComposing should be false.
- description = "events after dispatching compositioncommitasis";
- synthesizeKey("VK_RETURN", { type: "keyup" });
-
- SpecialPowers.clearUserPref("dom.keyboardevent.dispatch_during_composition");
-
- textarea.removeEventListener("keydown", eventHandler, true);
- textarea.removeEventListener("keypress", eventHandler, true);
- textarea.removeEventListener("keyup", eventHandler, true);
- textarea.removeEventListener("input", eventHandler, true);
- textarea.removeEventListener("compositionstart", onComposition, true);
- textarea.removeEventListener("compositionend", onComposition, true);
-
- textarea.value = "";
-}
-
-function runRedundantChangeTest()
-{
- textarea.focus();
-
- var result = {};
- function clearResult()
- {
- result = { compositionupdate: false, compositionend: false, text: false, input: false, inputaftercompositionend: false };
- }
-
- function handler(aEvent)
- {
- if (aEvent.type == "input" && result.compositionend) {
- result.inputaftercompositionend = true;
- return;
- }
- result[aEvent.type] = true;
- }
-
- textarea.addEventListener("compositionupdate", handler, true);
- textarea.addEventListener("compositionend", handler, true);
- textarea.addEventListener("input", handler, true);
- textarea.addEventListener("text", handler, true);
-
- textarea.value = "";
-
- // synthesize change event
- clearResult();
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- is(result.compositionupdate, true, "runRedundantChangeTest: compositionupdate should be fired after synthesizing composition change #1");
- is(result.compositionend, false, "runRedundantChangeTest: compositionend shouldn't be fired after synthesizing composition change #1");
- is(result.text, true, "runRedundantChangeTest: text should be fired after synthesizing composition change because it's dispatched when there is composing string #1");
- is(result.input, true, "runRedundantChangeTest: input should be fired after synthesizing composition change #1");
- is(textarea.value, "\u3042", "runRedundantChangeTest: textarea has uncommitted string #1");
-
- // synthesize another change event
- clearResult();
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042\u3044",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- is(result.compositionupdate, true, "runRedundantChangeTest: compositionupdate should be fired after synthesizing composition change #2");
- is(result.compositionend, false, "runRedundantChangeTest: compositionend shouldn't be fired after synthesizing composition change #2");
- is(result.text, true, "runRedundantChangeTest: text should be fired after synthesizing composition change because it's dispatched when there is composing string #2");
- is(result.input, true, "runRedundantChangeTest: input should be fired after synthesizing composition change #2");
- is(textarea.value, "\u3042\u3044", "runRedundantChangeTest: textarea has uncommitted string #2");
-
- // synthesize same change event again
- clearResult();
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3042\u3044",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- is(result.compositionupdate, false, "runRedundantChangeTest: compositionupdate shouldn't be fired after synthesizing composition change again");
- is(result.compositionend, false, "runRedundantChangeTest: compositionend shouldn't be fired after synthesizing composition change again");
- is(result.text, false, "runRedundantChangeTest: text shouldn't be fired after synthesizing composition change again because it's dispatched when there is composing string");
- is(result.input, false, "runRedundantChangeTest: input shouldn't be fired after synthesizing composition change again");
- is(textarea.value, "\u3042\u3044", "runRedundantChangeTest: textarea has uncommitted string #3");
-
- // synthesize commit-as-is
- clearResult();
- synthesizeComposition({ type: "compositioncommitasis" });
- is(result.compositionupdate, false, "runRedundantChangeTest: compositionupdate shouldn't be fired after synthesizing composition commit-as-is");
- is(result.compositionend, true, "runRedundantChangeTest: compositionend should be fired after synthesizing composition commit-as-is");
- is(result.text, true, "runRedundantChangeTest: text shouldn't be fired after synthesizing composition commit-as-is for removing the ranges");
- is(result.input, false, "runRedundantChangeTest: input shouldn't be fired before compositionend at synthesizing commit-as-is");
- is(result.inputaftercompositionend, true, "runRedundantChangeTest: input should be fired after synthesizing composition commit-as-is after compositionend");
- is(textarea.value, "\u3042\u3044", "runRedundantChangeTest: textarea has the commit string");
-
- textarea.removeEventListener("compositionupdate", handler, true);
- textarea.removeEventListener("compositionend", handler, true);
- textarea.removeEventListener("input", handler, true);
- textarea.removeEventListener("text", handler, true);
-}
-
-function runNotRedundantChangeTest()
-{
- textarea.focus();
-
- var result = {};
- function clearResult()
- {
- result = { compositionupdate: false, compositionend: false, text: false, input: false, inputaftercompositionend: false };
- }
-
- function handler(aEvent)
- {
- if (aEvent.type == "input" && result.compositionend) {
- result.inputaftercompositionend = true;
- return;
- }
- result[aEvent.type] = true;
- }
-
- textarea.addEventListener("compositionupdate", handler, true);
- textarea.addEventListener("compositionend", handler, true);
- textarea.addEventListener("input", handler, true);
- textarea.addEventListener("text", handler, true);
-
- textarea.value = "abcde";
-
- // synthesize change event with non-null ranges
- clearResult();
- synthesizeCompositionChange(
- { "composition":
- { "string": "ABCDE",
- "clauses":
- [
- { "length": 5, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 5, "length": 0 }
- });
-
- is(result.compositionupdate, true, "runNotRedundantChangeTest: compositionupdate should be fired after synthesizing composition change with non-null ranges");
- is(result.compositionend, false, "runNotRedundantChangeTest: compositionend shouldn't be fired after synthesizing composition change with non-null ranges");
- is(result.text, true, "runNotRedundantChangeTest: text should be fired after synthesizing composition change because it's dispatched when there is composing string with non-null ranges");
- is(result.input, true, "runNotRedundantChangeTest: input should be fired after synthesizing composition change with non-null ranges");
- is(textarea.value, "abcdeABCDE", "runNotRedundantChangeTest: textarea has uncommitted string #1");
-
- // synthesize change event with null ranges
- clearResult();
- synthesizeCompositionChange(
- { "composition":
- { "string": "ABCDE",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- });
- is(result.compositionupdate, false, "runNotRedundantChangeTest: compositionupdate shouldn't be fired after synthesizing composition change with null ranges after non-null ranges");
- is(result.compositionend, false, "runNotRedundantChangeTest: compositionend shouldn't be fired after synthesizing composition change with null ranges after non-null ranges");
- is(result.text, true, "runNotRedundantChangeTest: text should be fired after synthesizing composition change because it's dispatched when there is composing string with null ranges after non-null ranges");
- is(result.input, true, "runNotRedundantChangeTest: input should be fired after synthesizing composition change with null ranges after non-null ranges");
- is(textarea.value, "abcdeABCDE", "runNotRedundantChangeTest: textarea has uncommitted string #2");
-
- // synthesize change event with non-null ranges
- clearResult();
- synthesizeCompositionChange(
- { "composition":
- { "string": "ABCDE",
- "clauses":
- [
- { "length": 5, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 5, "length": 0 }
- });
-
- is(result.compositionupdate, false, "runNotRedundantChangeTest: compositionupdate shouldn't be fired after synthesizing composition change with non-null ranges after null ranges");
- is(result.compositionend, false, "runNotRedundantChangeTest: compositionend shouldn't be fired after synthesizing composition change with non-null ranges after null ranges");
- is(result.text, true, "runNotRedundantChangeTest: text should be fired after synthesizing composition change because it's dispatched when there is composing string with non-null ranges after null ranges");
- is(result.input, true, "runNotRedundantChangeTest: input should be fired after synthesizing composition change with non-null ranges after null ranges");
- is(textarea.value, "abcdeABCDE", "runNotRedundantChangeTest: textarea has uncommitted string #3");
-
- // synthesize change event with empty data and null ranges
- clearResult();
- synthesizeCompositionChange(
- { "composition":
- { "string": "",
- "clauses":
- [
- { "length": 0, "attr": 0 }
- ]
- },
- });
- is(result.compositionupdate, true, "runNotRedundantChangeTest: compositionupdate should be fired after synthesizing composition change with empty data and null ranges after non-null ranges");
- is(result.compositionend, false, "runNotRedundantChangeTest: compositionend shouldn't be fired after synthesizing composition change with empty data and null ranges after non-null ranges");
- is(result.text, true, "runNotRedundantChangeTest: text should be fired after synthesizing composition change because it's dispatched when there is composing string with empty data and null ranges after non-null ranges");
- is(result.input, true, "runNotRedundantChangeTest: input should be fired after synthesizing composition change with empty data and null ranges after non-null ranges");
- is(textarea.value, "abcde", "runNotRedundantChangeTest: textarea doesn't have uncommitted string #1");
-
- // synthesize change event with non-null ranges
- clearResult();
- synthesizeCompositionChange(
- { "composition":
- { "string": "ABCDE",
- "clauses":
- [
- { "length": 5, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 5, "length": 0 }
- });
-
- is(result.compositionupdate, true, "runNotRedundantChangeTest: compositionupdate should be fired after synthesizing composition change with non-null ranges after empty data and null ranges");
- is(result.compositionend, false, "runNotRedundantChangeTest: compositionend shouldn't be fired after synthesizing composition change with non-null ranges after empty data and null ranges");
- is(result.text, true, "runNotRedundantChangeTest: text should be fired after synthesizing composition change because it's dispatched when there is composing string with non-null ranges after empty data and null ranges");
- is(result.input, true, "runNotRedundantChangeTest: input should be fired after synthesizing composition change with non-null ranges after empty data and null ranges");
- is(textarea.value, "abcdeABCDE", "runNotRedundantChangeTest: textarea has uncommitted string #4");
-
- clearResult();
- synthesizeComposition({ type: "compositioncommit", data: "" });
-
- is(result.compositionupdate, true, "runNotRedundantChangeTest: compositionupdate should be fired after synthesizing composition commit with empty data after non-empty data");
- is(result.compositionend, true, "runNotRedundantChangeTest: compositionend should be fired after synthesizing composition commit with empty data after non-empty data");
- is(result.text, true, "runNotRedundantChangeTest: text should be fired after synthesizing composition change because it's dispatched when there is composing string with empty data after non-empty data");
- is(result.input, false, "runNotRedundantChangeTest: input shouldn't be fired before compositionend after synthesizing composition change with empty data after non-empty data");
- is(result.inputaftercompositionend, true, "runNotRedundantChangeTest: input should be fired after compositionend after synthesizing composition change with empty data after non-empty data");
- is(textarea.value, "abcde", "runNotRedundantChangeTest: textarea doesn't have uncommitted string #2");
-
- textarea.removeEventListener("compositionupdate", handler, true);
- textarea.removeEventListener("compositionend", handler, true);
- textarea.removeEventListener("input", handler, true);
- textarea.removeEventListener("text", handler, true);
-}
-
-function runControlCharTest()
-{
- textarea.focus();
-
- var result = {};
- function clearResult()
- {
- result = { compositionupdate: null, compositionend: null };
- }
-
- function handler(aEvent)
- {
- result[aEvent.type] = aEvent.data;
- }
-
- textarea.addEventListener("compositionupdate", handler, true);
- textarea.addEventListener("compositionend", handler, true);
-
- textarea.value = "";
-
- var controlChars = String.fromCharCode.apply(null, Object.keys(Array.from({length:0x20}))) + "\x7F";
- var allowedChars = "\t";
-
- var data = "AB" + controlChars + "CD" + controlChars + "EF";
- var removedData = "AB" + allowedChars + "CD" + allowedChars + "EF";
-
- var DIndex = data.indexOf("D");
- var removedDIndex = removedData.indexOf("D");
-
- // input string contains control characters
- clearResult();
- synthesizeCompositionChange(
- { "composition":
- { "string": data,
- "clauses":
- [
- { "length": DIndex,
- "attr": COMPOSITION_ATTR_SELECTED_CLAUSE },
- { "length": data.length - DIndex,
- "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE }
- ]
- },
- "caret": { "start": DIndex, "length": 0 }
- });
-
- checkSelection(removedDIndex, "", "runControlCharTest", "#1")
-
- is(result.compositionupdate, removedData, "runControlCharTest: control characters in event.data should be removed in compositionupdate event #1");
- is(textarea.value, removedData, "runControlCharTest: control characters should not appear in textarea #1");
-
- synthesizeComposition({ type: "compositioncommit", data: data });
-
- is(result.compositionend, removedData, "runControlCharTest: control characters in event.data should be removed in compositionend event #2");
- is(textarea.value, removedData, "runControlCharTest: control characters should not appear in textarea #2");
-
- textarea.value = "";
-
- clearResult();
-
- SpecialPowers.setBoolPref("dom.compositionevent.allow_control_characters", true);
-
- // input string contains control characters, allowing control characters
- clearResult();
- synthesizeCompositionChange(
- { "composition":
- { "string": data,
- "clauses":
- [
- { "length": DIndex,
- "attr": COMPOSITION_ATTR_SELECTED_CLAUSE },
- { "length": data.length - DIndex,
- "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE }
- ]
- },
- "caret": { "start": DIndex, "length": 0 }
- });
-
- checkSelection(DIndex - 1 + kLFLen, "", "runControlCharTest", "#3")
-
- is(result.compositionupdate, data, "runControlCharTest: control characters in event.data should not be removed in compositionupdate event #3");
- is(textarea.value, data.replace(/\r/g, "\n"), "runControlCharTest: control characters should appear in textarea #3");
-
- synthesizeComposition({ type: "compositioncommit", data: data });
-
- is(result.compositionend, data, "runControlCharTest: control characters in event.data should not be removed in compositionend event #4");
- is(textarea.value, data.replace(/\r/g, "\n"), "runControlCharTest: control characters should appear in textarea #4");
-
- SpecialPowers.clearUserPref("dom.compositionevent.allow_control_characters");
-
- textarea.removeEventListener("compositionupdate", handler, true);
- textarea.removeEventListener("compositionend", handler, true);
-}
-
-function runRemoveContentTest(aCallback)
-{
- var events = [];
- function eventHandler(aEvent)
- {
- events.push(aEvent);
- }
- textarea.addEventListener("compositionstart", eventHandler, true);
- textarea.addEventListener("compositionupdate", eventHandler, true);
- textarea.addEventListener("compositionend", eventHandler, true);
- textarea.addEventListener("input", eventHandler, true);
- textarea.addEventListener("text", eventHandler, true);
-
- textarea.focus();
- textarea.value = "";
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u306E",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- var nextSibling = textarea.nextSibling;
- var parent = textarea.parentElement;
-
- events = [];
- parent.removeChild(textarea);
-
- hitEventLoop(function () {
- // XXX Currently, "input" event isn't fired on removed content.
- is(events.length, 3,
- "runRemoveContentTest: wrong event count #1");
- is(events[0].type, "compositionupdate",
- "runRemoveContentTest: the 1st event must be compositionupdate #1");
- is(events[1].type, "text",
- "runRemoveContentTest: the 2nd event must be text #1");
- is(events[2].type, "compositionend",
- "runRemoveContentTest: the 3rd event must be compositionend #1");
- is(events[0].data, "",
- "runRemoveContentTest: compositionupdate has wrong data #1");
- is(events[2].data, "",
- "runRemoveContentTest: compositionend has wrong data #1");
- is(events[0].target, textarea,
- "runRemoveContentTest: The 1st event was fired on wrong event target #1");
- is(events[1].target, textarea,
- "runRemoveContentTest: The 2nd event was fired on wrong event target #1");
- is(events[2].target, textarea,
- "runRemoveContentTest: The 3rd event was fired on wrong event target #1");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runRemoveContentTest: the textarea still has composition #1");
- todo_is(textarea.value, "",
- "runRemoveContentTest: the textarea has the committed text? #1");
-
- parent.insertBefore(textarea, nextSibling);
-
- textarea.focus();
- textarea.value = "";
-
- synthesizeComposition({ type: "compositionstart" });
-
- events = [];
- parent.removeChild(textarea);
-
- hitEventLoop(function () {
- // XXX Currently, "input" event isn't fired on removed content.
- is(events.length, 1,
- "runRemoveContentTest: wrong event count #2");
- is(events[0].type, "compositionend",
- "runRemoveContentTest: the 1st event must be compositionend #2");
- is(events[0].data, "",
- "runRemoveContentTest: compositionupdate has wrong data #2");
- is(events[0].target, textarea,
- "runRemoveContentTest: The 1st event was fired on wrong event target #2");
- ok(!getEditorIMESupport(textarea).isComposing,
- "runRemoveContentTest: the textarea still has composition #2");
- is(textarea.value, "",
- "runRemoveContentTest: the textarea has the committed text? #2");
-
- parent.insertBefore(textarea, nextSibling);
-
- textarea.removeEventListener("compositionstart", eventHandler, true);
- textarea.removeEventListener("compositionupdate", eventHandler, true);
- textarea.removeEventListener("compositionend", eventHandler, true);
- textarea.removeEventListener("input", eventHandler, true);
- textarea.removeEventListener("text", eventHandler, true);
-
- SimpleTest.executeSoon(aCallback);
- }, 50);
- }, 50);
-}
-
-function runTestOnAnotherContext(aPanelOrFrame, aFocusedEditor, aTestName)
-{
- aFocusedEditor.value = "";
-
- var editorRect = synthesizeQueryEditorRect();
- if (!checkQueryContentResult(editorRect, aTestName + ": editorRect")) {
- return;
- }
-
- var r = aPanelOrFrame.getBoundingClientRect();
- var parentRect = { "left": r.left, "top": r.top, "width": r.right - r.left,
- "height": r.bottom - r.top };
- checkRectContainsRect(editorRect, parentRect, aTestName +
- ": the editor rect coordinates are wrong");
-
- // input characters
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3078\u3093\u3057\u3093",
- "clauses":
- [
- { "length": 4, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 4, "length": 0 }
- });
-
- if (!checkContent("\u3078\u3093\u3057\u3093", aTestName, "#1-1") ||
- !checkSelection(4, "", aTestName, "#1-1")) {
- return;
- }
-
- // convert them #1
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u8FD4\u4FE1",
- "clauses":
- [
- { "length": 2,
- "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- if (!checkContent("\u8FD4\u4FE1", aTestName, "#1-2") ||
- !checkSelection(2, "", aTestName, "#1-2")) {
- return;
- }
-
- // convert them #2
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u5909\u8EAB",
- "clauses":
- [
- { "length": 2,
- "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- if (!checkContent("\u5909\u8EAB", aTestName, "#1-3") ||
- !checkSelection(2, "", aTestName, "#1-3")) {
- return;
- }
-
- // commit them
- synthesizeComposition({ type: "compositioncommitasis" });
- if (!checkContent("\u5909\u8EAB", aTestName, "#1-4") ||
- !checkSelection(2, "", aTestName, "#1-4")) {
- return;
- }
-
- is(aFocusedEditor.value, "\u5909\u8EAB",
- aTestName + ": composition isn't in the focused editor");
- if (aFocusedEditor.value != "\u5909\u8EAB") {
- return;
- }
-
- var textRect = synthesizeQueryTextRect(0, 1);
- var caretRect = synthesizeQueryCaretRect(2);
- if (!checkQueryContentResult(textRect,
- aTestName + ": synthesizeQueryTextRect") ||
- !checkQueryContentResult(caretRect,
- aTestName + ": synthesizeQueryCaretRect")) {
- return;
- }
- checkRectContainsRect(textRect, editorRect, aTestName + ":testRect");
- checkRectContainsRect(caretRect, editorRect, aTestName + ":caretRect");
-}
-
-function runFrameTest()
-{
- textareaInFrame.focus();
- runTestOnAnotherContext(iframe, textareaInFrame, "runFrameTest");
- runCharAtPointTest(textareaInFrame, "textarea in the iframe");
-}
-
-var gPanelShown = false;
-var gPanelFocused = false;
-function onPanelShown(aEvent)
-{
- gPanelShown = true;
- textbox.focus();
- setTimeout(doPanelTest, 0);
-}
-
-function onFocusPanelTextbox(aEvent)
-{
- gPanelFocused = true;
- setTimeout(doPanelTest, 0);
-}
-
-var gIsPanelHiding = false;
-var gIsRunPanelTestInternal = false;
-function doPanelTest()
-{
- if (!gPanelFocused || !gPanelShown) {
- return;
- }
- if (gIsRunPanelTestInternal) {
- return;
- }
- gIsRunPanelTestInternal = true;
- runTestOnAnotherContext(panel, textbox, "runPanelTest");
- runCharAtPointTest(textbox, "textbox in the panel");
- gIsPanelHiding = true;
- panel.hidePopup();
-}
-
-function onPanelHidden(aEvent)
-{
- panel.hidden = true;
- ok(gIsPanelHiding, "runPanelTest: the panel is hidden unexpectedly");
- finish();
-}
-
-function runPanelTest()
-{
- panel.hidden = false;
- panel.openPopupAtScreen(window.screenX + window.outerWidth, 0, false);
-}
-
-function runMaxLengthTest()
-{
- input.maxLength = 1;
- input.value = "";
- input.focus();
-
- var kDesc ="runMaxLengthTest";
-
- // input first character
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- if (!checkContent("\u3089", kDesc, "#1-1") ||
- !checkSelection(1, "", kDesc, "#1-1")) {
- return;
- }
-
- // input second character
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC", kDesc, "#1-2") ||
- !checkSelection(2, "", kDesc, "#1-2")) {
- return;
- }
-
- // input third character
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081",
- "clauses":
- [
- { "length": 3, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 3, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081", kDesc, "#1-3") ||
- !checkSelection(3, "", kDesc, "#1-3")) {
- return;
- }
-
- // input fourth character
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081\u3093",
- "clauses":
- [
- { "length": 4, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 4, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081\u3093", kDesc, "#1-4") ||
- !checkSelection(4, "", kDesc, "#1-4")) {
- return;
- }
-
-
- // backspace
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081",
- "clauses":
- [
- { "length": 3, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 3, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081", kDesc, "#1-5") ||
- !checkSelection(3, "", kDesc, "#1-5")) {
- return;
- }
-
- // re-input
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081\u3093",
- "clauses":
- [
- { "length": 4, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 4, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081\u3093", kDesc, "#1-6") ||
- !checkSelection(4, "", kDesc, "#1-6")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081\u3093\u3055",
- "clauses":
- [
- { "length": 5, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 5, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081\u3093\u3055", kDesc, "#1-7") ||
- !checkSelection(5, "", kDesc, "#1-7")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081\u3093\u3055\u3044",
- "clauses":
- [
- { "length": 6, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 6, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044", kDesc, "#1-8") ||
- !checkSelection(6, "", kDesc, "#1-8")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081\u3093\u3055\u3044\u3053",
- "clauses":
- [
- { "length": 7, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 7, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044\u3053",
- kDesc, "#1-8") ||
- !checkSelection(7, "", kDesc, "#1-8")) {
- return;
- }
-
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3089\u30FC\u3081\u3093\u3055\u3044\u3053\u3046",
- "clauses":
- [
- { "length": 8, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 8, "length": 0 }
- });
-
- if (!checkContent("\u3089\u30FC\u3081\u3093\u3055\u3044\u3053\u3046",
- kDesc, "#1-9") ||
- !checkSelection(8, "", kDesc, "#1-9")) {
- return;
- }
-
- // convert
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8",
- "clauses":
- [
- { "length": 4,
- "attr": COMPOSITION_ATTR_SELECTED_CLAUSE },
- { "length": 2,
- "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE }
- ]
- },
- "caret": { "start": 4, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u30FC\u30E1\u30F3\u6700\u9AD8", kDesc, "#1-10") ||
- !checkSelection(4, "", kDesc, "#1-10")) {
- return;
- }
-
- // commit the composition string
- synthesizeComposition({ type: "compositioncommitasis" });
- if (!checkContent("\u30E9", kDesc, "#1-11") ||
- !checkSelection(1, "", kDesc, "#1-11")) {
- return;
- }
-
- // input characters
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u3057",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- if (!checkContent("\u30E9\u3057", kDesc, "#2-1") ||
- !checkSelection(1 + 1, "", kDesc, "#2-1")) {
- return;
- }
-
- // commit the composition string
- synthesizeComposition({ type: "compositioncommit", data: "\u3058" });
- if (!checkContent("\u30E9", kDesc, "#2-2") ||
- !checkSelection(1 + 0, "", kDesc, "#2-2")) {
- return;
- }
-
- // Undo
- synthesizeKey("Z", {accelKey: true});
-
- // XXX this is unexpected behavior, see bug 258291
- if (!checkContent("\u30E9", kDesc, "#3-1") ||
- !checkSelection(1 + 0, "", kDesc, "#3-1")) {
- return;
- }
-
- // Undo
- synthesizeKey("Z", {accelKey: true});
- if (!checkContent("", kDesc, "#3-2") ||
- !checkSelection(0, "", kDesc, "#3-2")) {
- return;
- }
-
- // Redo
- synthesizeKey("Z", {accelKey: true, shiftKey: true});
- if (!checkContent("\u30E9", kDesc, "#3-3") ||
- !checkSelection(1, "", kDesc, "#3-3")) {
- return;
- }
-
- // Redo
- synthesizeKey("Z", {accelKey: true, shiftKey: true});
- if (!checkContent("\u30E9", kDesc, "#3-4") ||
- !checkSelection(1 + 0, "", kDesc, "#3-4")) {
- return;
- }
-
- // The input element whose content length is already maxlength and
- // the carest is at start of the content.
- input.value = "X";
- input.selectionStart = input.selectionEnd = 0;
-
- // input characters
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u9B54",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
-
- if (!checkContent("\u9B54X", kDesc, "#4-1") ||
- !checkSelection(1, "", kDesc, "#4-1")) {
- return;
- }
-
- // commit the composition string
- synthesizeComposition({ type: "compositioncommitasis" });
-
- // The input text must be discarded. Then, the caret position shouldn't be
- // updated from its position at compositionstart.
- if (!checkContent("X", kDesc, "#4-2") ||
- !checkSelection(0, "", kDesc, "#4-2")) {
- return;
- }
-
- // input characters
- synthesizeCompositionChange(
- { "composition":
- { "string": "\u9B54\u6CD5",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
-
- if (!checkContent("\u9B54\u6CD5X", kDesc, "#5-1") ||
- !checkSelection(2, "", kDesc, "#5-1")) {
- return;
- }
-
- // commit the composition string
- synthesizeComposition({ type: "compositioncommitasis" });
-
- if (!checkContent("X", kDesc, "#5-2") ||
- !checkSelection(0, "", kDesc, "#5-2")) {
- return;
- }
-}
-
-function runEditorReframeTests(aCallback)
-{
- function runEditorReframeTest(aEditor, aWindow, aEventType, aNextTest)
- {
- function getValue()
- {
- return aEditor == contenteditable ?
- aEditor.innerHTML.replace("<br>", "") : aEditor.value;
- }
-
- var description = "runEditorReframeTest(" + aEditor.id + ", \"" + aEventType + "\"): ";
-
- var tests = [
- { test: function () {
- synthesizeCompositionChange(
- { "composition":
- { "string": "a",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- },
- check: function () {
- is(getValue(aEditor), "a", description + "Typing 'a'");
- },
- },
- { test: function () {
- synthesizeCompositionChange(
- { "composition":
- { "string": "ab",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
- },
- check: function () {
- is(getValue(aEditor), "ab", description + "Typing 'b' next to 'a'");
- },
- },
- { test: function () {
- synthesizeCompositionChange(
- { "composition":
- { "string": "abc",
- "clauses":
- [
- { "length": 3, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 3, "length": 0 }
- });
- },
- check: function () {
- is(getValue(aEditor), "abc", description + "Typing 'c' next to 'ab'");
- },
- },
- { test: function () {
- synthesizeCompositionChange(
- { "composition":
- { "string": "abc",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE },
- { "length": 1, "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
- },
- check: function () {
- is(getValue(aEditor), "abc", description + "Starting to convert 'ab][c'");
- },
- },
- { test: function () {
- synthesizeCompositionChange(
- { "composition":
- { "string": "ABc",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE },
- { "length": 1, "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
- },
- check: function () {
- is(getValue(aEditor), "ABc", description + "Starting to convert 'AB][c'");
- },
- },
- { test: function () {
- synthesizeCompositionChange(
- { "composition":
- { "string": "ABC",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_CONVERTED_CLAUSE },
- { "length": 1, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 3, "length": 0 }
- });
- },
- check: function () {
- is(getValue(aEditor), "ABC", description + "Starting to convert 'AB][C'");
- },
- },
- { test: function () {
- // Commit composition
- synthesizeComposition({ type: "compositioncommitasis" });
- },
- check: function () {
- is(getValue(aEditor), "ABC", description + "Committed as 'ABC'");
- },
- },
- { test: function () {
- synthesizeCompositionChange(
- { "composition":
- { "string": "d",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- },
- check: function () {
- is(getValue(aEditor), "ABCd", description + "Typing 'd' next to ABC");
- },
- },
- { test: function () {
- synthesizeCompositionChange(
- { "composition":
- { "string": "de",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
- },
- check: function () {
- is(getValue(aEditor), "ABCde", description + "Typing 'e' next to ABCd");
- },
- },
- { test: function () {
- synthesizeCompositionChange(
- { "composition":
- { "string": "def",
- "clauses":
- [
- { "length": 3, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 3, "length": 0 }
- });
- },
- check: function () {
- is(getValue(aEditor), "ABCdef", description + "Typing 'f' next to ABCde");
- },
- },
- { test: function () {
- // Commit composition
- synthesizeComposition({ type: "compositioncommitasis" });
- },
- check: function () {
- is(getValue(aEditor), "ABCdef", description + "Commit 'def' without convert");
- },
- },
- { test: function () {
- // Select "Cd"
- synthesizeKey("KEY_ArrowLeft", { code: "ArrowLeft" });
- synthesizeKey("KEY_ArrowLeft", { code: "ArrowLeft" });
- synthesizeKey("KEY_Shift", { type: "keydown", code: "ShiftLeft", shiftKey: true });
- synthesizeKey("KEY_ArrowLeft", { code: "ArrowLeft", shiftKey: true });
- synthesizeKey("KEY_ArrowLeft", { code: "ArrowLeft", shiftKey: true });
- synthesizeKey("KEY_Shift", { type: "keyup", code: "ShiftLeft" });
- },
- check: function () {
- },
- },
- { test: function () {
- synthesizeCompositionChange(
- { "composition":
- { "string": "g",
- "clauses":
- [
- { "length": 1, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 1, "length": 0 }
- });
- },
- check: function () {
- is(getValue(aEditor), "ABgef", description + "Typing 'g' next to AB");
- },
- },
- { test: function () {
- synthesizeCompositionChange(
- { "composition":
- { "string": "gh",
- "clauses":
- [
- { "length": 2, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 2, "length": 0 }
- });
- },
- check: function () {
- is(getValue(aEditor), "ABghef", description + "Typing 'h' next to ABg");
- },
- },
- { test: function () {
- synthesizeCompositionChange(
- { "composition":
- { "string": "ghi",
- "clauses":
- [
- { "length": 3, "attr": COMPOSITION_ATTR_RAW_CLAUSE }
- ]
- },
- "caret": { "start": 3, "length": 0 }
- });
- },
- check: function () {
- is(getValue(aEditor), "ABghief", description + "Typing 'i' next to ABgh");
- },
- },
- { test: function () {
- synthesizeCompositionChange(
- { "composition":
- { "string": "GHI",
- "clauses":
- [
- { "length": 3, "attr": COMPOSITION_ATTR_SELECTED_CLAUSE }
- ]
- },
- "caret": { "start": 3, "length": 0 }
- });
- },
- check: function () {
- is(getValue(aEditor), "ABGHIef", description + "Convert 'ghi' to 'GHI'");
- },
- },
- { test: function () {
- // Commit composition
- synthesizeComposition({ type: "compositioncommitasis" });
- },
- check: function () {
- is(getValue(aEditor), "ABGHIef", description + "Commit 'GHI'");
- },
- },
- ];
-
- var index = 0;
- function doReframe(aEvent)
- {
- aEvent.target.style.overflow =
- aEvent.target.style.overflow != "hidden" ? "hidden" : "auto";
- }
- aEditor.focus();
- aEditor.addEventListener(aEventType, doReframe);
-
- function doNext()
- {
- if (tests.length <= index) {
- aEditor.style.overflow = "auto";
- aEditor.removeEventListener(aEventType, doReframe);
- requestAnimationFrame(function() { setTimeout(aNextTest); });
- return;
- }
- tests[index].test();
- hitEventLoop(function () {
- tests[index].check();
- index++;
- setTimeout(doNext, 0);
- }, 20);
- }
- doNext();
- }
-
- input.value = "";
- runEditorReframeTest(input, window, "input", function () {
- input.value = "";
- runEditorReframeTest(input, window, "compositionupdate", function () {
- textarea.value = "";
- runEditorReframeTest(textarea, window, "input", function () {
- textarea.value = "";
- runEditorReframeTest(textarea, window, "compositionupdate", function () {
- contenteditable.innerHTML = "";
- runEditorReframeTest(contenteditable, windowOfContenteditable, "input", function () {
- contenteditable.innerHTML = "";
- runEditorReframeTest(contenteditable, windowOfContenteditable, "compositionupdate", function () {
- aCallback();
- });
- });
- });
- });
- });
- });
-}
-
-function runTest()
-{
- contenteditable = document.getElementById("iframe4").contentDocument.getElementById("contenteditable");
- windowOfContenteditable = document.getElementById("iframe4").contentWindow;
- textareaInFrame = iframe.contentDocument.getElementById("textarea");
-
- runUndoRedoTest();
- runCompositionCommitAsIsTest();
- runCompositionCommitTest();
- runCompositionTest();
- runCompositionEventTest();
- runQueryTextRectInContentEditableTest();
- runCharAtPointTest(textarea, "textarea in the document");
- runCharAtPointAtOutsideTest();
- runSetSelectionEventTest();
- runQueryTextContentEventTest();
- runQueryIMESelectionTest();
- runQueryContentEventRelativeToInsertionPoint();
- runCSSTransformTest();
- runBug722639Test();
- runForceCommitTest();
- runNestedSettingValue();
- runBug811755Test();
- runIsComposingTest();
- runRedundantChangeTest();
- runNotRedundantChangeTest();
- runControlCharTest();
- runEditorReframeTests(function () {
- runAsyncForceCommitTest(function () {
- runRemoveContentTest(function () {
- runFrameTest();
- runPanelTest();
- runMaxLengthTest();
- });
- });
- });
-}
-
-]]>
-</script>
-
-</window>
diff --git a/widget/tests/window_imestate_iframes.html b/widget/tests/window_imestate_iframes.html
deleted file mode 100644
index 064cf19a5..000000000
--- a/widget/tests/window_imestate_iframes.html
+++ /dev/null
@@ -1,380 +0,0 @@
-<html>
-<head>
- <title>Test for IME state controling and focus moving for iframes</title>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <link rel="stylesheet" type="text/css"
- href="chrome://mochikit/content/tests/SimpleTest/test.css" />
- <style type="text/css">
- iframe {
- border: none;
- height: 100px;
- }
- </style>
-</head>
-<body onunload="onUnload();">
-<p id="display">
- <!-- Use input[readonly] because it isn't affected by the partial focus
- movement on Mac -->
- <input id="prev" readonly><br>
- <iframe id="iframe_not_editable"
- src="data:text/html,&lt;html&gt;&lt;body&gt;&lt;input id='editor'&gt;&lt;/body&gt;&lt;/html&gt;"></iframe><br>
-
- <!-- Testing IME state and focus movement, the anchor elements cannot get focus -->
- <iframe id="iframe_html"
- src="data:text/html,&lt;html id='editor' contenteditable='true'&gt;&lt;body&gt;&lt;a href='about:blank'&gt;about:blank;&lt;/a&gt;&lt;/body&gt;&lt;/html&gt;"></iframe><br>
- <iframe id="iframe_designMode"
- src="data:text/html,&lt;body id='editor' onload='document.designMode=&quot;on&quot;;'&gt;&lt;a href='about:blank'&gt;about:blank;&lt;/a&gt;&lt;/body&gt;"></iframe><br>
- <iframe id="iframe_body"
- src="data:text/html,&lt;body id='editor' contenteditable='true'&gt;&lt;a href='about:blank'&gt;about:blank;&lt;/a&gt;&lt;/body&gt;"></iframe><br>
- <iframe id="iframe_p"
- src="data:text/html,&lt;body&gt;&lt;p id='editor' contenteditable='true'&gt;&lt;a href='about:blank'&gt;about:blank;&lt;/a&gt;&lt;/p&gt;&lt;/body&gt;"></iframe><br>
-
- <input id="next" readonly><br>
-</p>
-<script class="testbody" type="application/javascript">
-
-window.opener.wrappedJSObject.SimpleTest.waitForFocus(runTests, window);
-
-function ok(aCondition, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.ok(aCondition, aMessage);
-}
-
-function is(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.is(aLeft, aRight, aMessage);
-}
-
-function onUnload()
-{
- window.opener.wrappedJSObject.onFinish();
-}
-
-var gFocusObservingElement = null;
-var gBlurObservingElement = null;
-
-function onFocus(aEvent)
-{
- if (aEvent.target != gFocusObservingElement) {
- return;
- }
- ok(gFocusObservingElement.willFocus,
- "focus event is fired on unexpected element");
- gFocusObservingElement.willFocus = false;
-}
-
-function onBlur(aEvent)
-{
- if (aEvent.target != gBlurObservingElement) {
- return;
- }
- ok(gBlurObservingElement.willBlur,
- "blur event is fired on unexpected element");
- gBlurObservingElement.willBlur = false;
-}
-
-function observeFocusBlur(aNextFocusedNode, aWillFireFocusEvent,
- aNextBlurredNode, aWillFireBlurEvent)
-{
- if (gFocusObservingElement) {
- if (gFocusObservingElement.willFocus) {
- ok(false, "focus event was never fired on " + gFocusObservingElement);
- }
- gFocusObservingElement.removeEventListener("focus", onFocus, true);
- gFocusObservingElement.willFocus = NaN;
- gFocusObservingElement = null;
- }
- if (gBlurObservingElement) {
- if (gBlurObservingElement.willBlur) {
- ok(false, "blur event was never fired on " + gBlurObservingElement);
- }
- gBlurObservingElement.removeEventListener("blur", onBlur, true);
- gBlurObservingElement.willBlur = NaN;
- gBlurObservingElement = null;
- }
- if (aNextFocusedNode) {
- gFocusObservingElement = aNextFocusedNode;
- gFocusObservingElement.willFocus = aWillFireFocusEvent;
- gFocusObservingElement.addEventListener("focus", onFocus, true);
- }
- if (aNextBlurredNode) {
- gBlurObservingElement = aNextBlurredNode;
- gBlurObservingElement.willBlur = aWillFireBlurEvent;
- gBlurObservingElement.addEventListener("blur", onBlur, true);
- }
-}
-
-function runTests()
-{
- var utils =
- window.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(Components.interfaces.nsIDOMWindowUtils);
- var fm =
- Components.classes["@mozilla.org/focus-manager;1"]
- .getService(Components.interfaces.nsIFocusManager);
-
- var iframe, editor, root, input;
- var prev = document.getElementById("prev");
- var next = document.getElementById("next");
- var html = document.documentElement;
-
- function resetFocusToInput(aDescription)
- {
- observeFocusBlur(null, false, null, false);
- prev.focus();
- is(fm.focusedElement, prev,
- "input#prev[readonly] element didn't get focus: " + aDescription);
- is(utils.IMEStatus, utils.IME_STATUS_DISABLED,
- "IME enabled on input#prev[readonly]: " + aDescription);
- }
-
- function resetFocusToParentHTML(aDescription)
- {
- observeFocusBlur(null, false, null, false);
- html.focus();
- is(fm.focusedElement, html,
- "Parent html element didn't get focus: " + aDescription);
- is(utils.IMEStatus, utils.IME_STATUS_DISABLED,
- "IME enabled on parent html element: " + aDescription);
- }
-
- function testTabKey(aForward,
- aNextFocusedNode, aWillFireFocusEvent,
- aNextBlurredNode, aWillFireBlurEvent,
- aIMEShouldBeEnabled, aTestingCaseDescription)
- {
- observeFocusBlur(aNextFocusedNode, aWillFireFocusEvent,
- aNextBlurredNode, aWillFireBlurEvent);
- synthesizeKey("VK_TAB", { shiftKey: !aForward });
- var description = "Tab key test: ";
- if (!aForward) {
- description = "Shift-" + description;
- }
- description += aTestingCaseDescription + ": ";
- is(fm.focusedElement, aNextFocusedNode,
- description + "didn't move focus as expected");
- is(utils.IMEStatus,
- aIMEShouldBeEnabled ?
- utils.IME_STATUS_ENABLED : utils.IME_STATUS_DISABLED,
- description + "didn't set IME state as expected");
- }
-
- function testMouseClick(aNextFocusedNode, aWillFireFocusEvent,
- aWillAllNodeLostFocus,
- aNextBlurredNode, aWillFireBlurEvent,
- aIMEShouldBeEnabled, aTestingCaseDescription)
- {
- observeFocusBlur(aNextFocusedNode, aWillFireFocusEvent,
- aNextBlurredNode, aWillFireBlurEvent);
- // We're relying on layout inside the iframe being up to date, so make it so
- iframe.contentDocument.documentElement.getBoundingClientRect();
- synthesizeMouse(iframe, 10, 80, { });
- var description = "Click test: " + aTestingCaseDescription + ": ";
- is(fm.focusedElement, !aWillAllNodeLostFocus ? aNextFocusedNode : null,
- description + "didn't move focus as expected");
- is(utils.IMEStatus,
- aIMEShouldBeEnabled ?
- utils.IME_STATUS_ENABLED : utils.IME_STATUS_DISABLED,
- description + "didn't set IME state as expected");
- }
-
- function testOnEditorFlagChange(aDescription, aIsInDesignMode)
- {
- const kReadonly =
- Components.interfaces.nsIPlaintextEditor.eEditorReadonlyMask;
- var description = "testOnEditorFlagChange: " + aDescription;
- resetFocusToParentHTML(description);
- var htmlEditor =
- iframe.contentWindow.
- QueryInterface(Components.interfaces.nsIInterfaceRequestor).
- getInterface(Components.interfaces.nsIWebNavigation).
- QueryInterface(Components.interfaces.nsIDocShell).editor;
- var e = aIsInDesignMode ? root : editor;
- e.focus();
- is(fm.focusedElement, e,
- description + ": focus() of editor didn't move focus as expected");
- is(utils.IMEStatus, utils.IME_STATUS_ENABLED,
- description + ": IME isn't enabled when the editor gets focus");
- var flags = htmlEditor.flags;
- htmlEditor.flags |= kReadonly;
- is(fm.focusedElement, e,
- description + ": when editor becomes readonly, focus moved unexpectedly");
- is(utils.IMEStatus, utils.IME_STATUS_DISABLED,
- description + ": when editor becomes readonly, IME is still enabled");
- htmlEditor.flags = flags;
- is(fm.focusedElement, e,
- description + ": when editor becomes read-write, focus moved unexpectedly");
- is(utils.IMEStatus, utils.IME_STATUS_ENABLED,
- description + ": when editor becomes read-write, IME is still disabled");
- }
-
- // hide all iframes
- document.getElementById("iframe_not_editable").style.display = "none";
- document.getElementById("iframe_html").style.display = "none";
- document.getElementById("iframe_designMode").style.display = "none";
- document.getElementById("iframe_body").style.display = "none";
- document.getElementById("iframe_p").style.display = "none";
-
- // non editable HTML element and input element can get focus.
- iframe = document.getElementById("iframe_not_editable");
- iframe.style.display = "inline";
- editor = iframe.contentDocument.getElementById("editor");
- root = iframe.contentDocument.documentElement;
- resetFocusToInput("initializing for iframe_not_editable");
-
- testTabKey(true, root, false, prev, true,
- false, "input#prev[readonly] -> html");
- testTabKey(true, editor, true, root, false,
- true, "html -> input in the subdoc");
- testTabKey(true, next, true, editor, true,
- false, "input in the subdoc -> input#next[readonly]");
- testTabKey(false, editor, true, next, true,
- true, "input#next[readonly] -> input in the subdoc");
- testTabKey(false, root, false, editor, true,
- false, "input in the subdoc -> html");
- testTabKey(false, prev, true, root, false,
- false, "html -> input#next[readonly]");
-
- iframe.style.display = "none";
-
- // HTML element (of course, it's root) must enables IME.
- iframe = document.getElementById("iframe_html");
- iframe.style.display = "inline";
- editor = iframe.contentDocument.getElementById("editor");
- root = iframe.contentDocument.documentElement;
- resetFocusToInput("initializing for iframe_html");
-
- testTabKey(true, editor, true, prev, true,
- true, "input#prev[readonly] -> html[contentediable=true]");
- testTabKey(true, next, true, editor, true,
- false, "html[contentediable=true] -> input#next[readonly]");
- testTabKey(false, editor, true, next, true,
- true, "input#next[readonly] -> html[contentediable=true]");
- testTabKey(false, prev, true, editor, true,
- false, "html[contenteditable=true] -> input[readonly]");
-
- prev.style.display = "none";
- resetFocusToParentHTML("testing iframe_html");
- testTabKey(true, editor, true, html, false,
- true, "html of parent -> html[contentediable=true]");
- testTabKey(false, html, false, editor, true,
- false, "html[contenteditable=true] -> html of parent");
- prev.style.display = "inline";
- resetFocusToInput("after parent html <-> html[contenteditable=true]");
-
- testMouseClick(editor, true, false, prev, true, true, "iframe_html");
-
- testOnEditorFlagChange("html[contentediable=true]", false);
-
- iframe.style.display = "none";
-
- // designMode should behave like <html contenteditable="true"></html>
- // but focus/blur events shouldn't be fired on its root element because
- // any elements shouldn't be focused state in designMode.
- iframe = document.getElementById("iframe_designMode");
- iframe.style.display = "inline";
- iframe.contentDocument.designMode = "on";
- editor = iframe.contentDocument.getElementById("editor");
- root = iframe.contentDocument.documentElement;
- resetFocusToInput("initializing for iframe_designMode");
-
- testTabKey(true, root, false, prev, true,
- true, "input#prev[readonly] -> html in designMode");
- testTabKey(true, next, true, root, false,
- false, "html in designMode -> input#next[readonly]");
- testTabKey(false, root, false, next, true,
- true, "input#next[readonly] -> html in designMode");
- testTabKey(false, prev, true, root, false,
- false, "html in designMode -> input#prev[readonly]");
-
- prev.style.display = "none";
- resetFocusToParentHTML("testing iframe_designMode");
- testTabKey(true, root, false, html, false,
- true, "html of parent -> html in designMode");
- testTabKey(false, html, false, root, false,
- false, "html in designMode -> html of parent");
- prev.style.display = "inline";
- resetFocusToInput("after parent html <-> html in designMode");
-
- testMouseClick(editor, false, true, prev, true, true, "iframe_designMode");
-
- testOnEditorFlagChange("html in designMode", true);
-
- iframe.style.display = "none";
-
- // When there is no HTML element but the BODY element is editable,
- // the body element should get focus and enables IME.
- iframe = document.getElementById("iframe_body");
- iframe.style.display = "inline";
- editor = iframe.contentDocument.getElementById("editor");
- root = iframe.contentDocument.documentElement;
- resetFocusToInput("initializing for iframe_body");
-
- testTabKey(true, editor, true, prev, true,
- true, "input#prev[readonly] -> body[contentediable=true]");
- testTabKey(true, next, true, editor, true,
- false, "body[contentediable=true] -> input#next[readonly]");
- testTabKey(false, editor, true, next, true,
- true, "input#next[readonly] -> body[contentediable=true]");
- testTabKey(false, prev, true, editor, true,
- false, "body[contenteditable=true] -> input#prev[readonly]");
-
- prev.style.display = "none";
- resetFocusToParentHTML("testing iframe_body");
- testTabKey(true, editor, true, html, false,
- true, "html of parent -> body[contentediable=true]");
- testTabKey(false, html, false, editor, true,
- false, "body[contenteditable=true] -> html of parent");
- prev.style.display = "inline";
- resetFocusToInput("after parent html <-> body[contenteditable=true]");
-
- testMouseClick(editor, true, false, prev, true, true, "iframe_body");
-
- testOnEditorFlagChange("body[contentediable=true]", false);
-
- iframe.style.display = "none";
-
- // When HTML/BODY elements are not editable, focus shouldn't be moved to
- // the editable content directly.
- iframe = document.getElementById("iframe_p");
- iframe.style.display = "inline";
- editor = iframe.contentDocument.getElementById("editor");
- root = iframe.contentDocument.documentElement;
- resetFocusToInput("initializing for iframe_p");
-
- testTabKey(true, root, false, prev, true,
- false, "input#prev[readonly] -> html (has p[contenteditable=true])");
- testTabKey(true, editor, true, root, false,
- true, "html (has p[contenteditable=true]) -> p[contentediable=true]");
- testTabKey(true, next, true, editor, true,
- false, "p[contentediable=true] -> input#next[readonly]");
- testTabKey(false, editor, true, next, true,
- true, "input#next[readonly] -> p[contentediable=true]");
- testTabKey(false, root, false, editor, true,
- false, "p[contenteditable=true] -> html (has p[contenteditable=true])");
- testTabKey(false, prev, true, root, false,
- false, "html (has p[contenteditable=true]) -> input#prev[readonly]");
- prev.style.display = "none";
-
- resetFocusToParentHTML("testing iframe_p");
- testTabKey(true, root, false, html, false,
- false, "html of parent -> html (has p[contentediable=true])");
- testTabKey(false, html, false, root, false,
- false, "html (has p[contentediable=true]) -> html of parent");
- prev.style.display = "inline";
- resetFocusToInput("after parent html <-> html (has p[contentediable=true])");
-
- testMouseClick(root, false, true, prev, true, false, "iframe_p");
-
- testOnEditorFlagChange("p[contenteditable=true]", false);
-
- iframe.style.display = "none";
-
- window.close();
-}
-
-</script>
-</body>
-
-</html>
diff --git a/widget/tests/window_mouse_scroll_win.html b/widget/tests/window_mouse_scroll_win.html
deleted file mode 100644
index 4a83e23ef..000000000
--- a/widget/tests/window_mouse_scroll_win.html
+++ /dev/null
@@ -1,1531 +0,0 @@
-<html lang="en-US"
- style="font-family: Arial; font-size: 10px; line-height: 16px;">
-<head>
- <title>Test for mouse scroll handling on Windows</title>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
- <script type="text/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js"></script>
- <link rel="stylesheet" type="text/css"
- href="chrome://mochikit/content/tests/SimpleTest/test.css" />
-</head>
-<body onunload="onUnload();">
-<div id="display" style="width: 5000px; height: 5000px;">
-<p id="p1" style="font-size: 16px; width: 100px; height: 100px;">1st &lt;p&gt;.</p>
-<p id="p2" style="font-size: 32px; width: 100px; height: 100px;">2nd &lt;p&gt;.</p>
-</div>
-<script class="testbody" type="application/javascript">
-
-window.opener.wrappedJSObject.SimpleTest.waitForFocus(prepareTests, window);
-
-const nsIDOMWindowUtils = Components.interfaces.nsIDOMWindowUtils;
-
-const WHEEL_PAGESCROLL = 4294967295;
-
-const WM_VSCROLL = 0x0115;
-const WM_HSCROLL = 0x0114;
-const WM_MOUSEWHEEL = 0x020A;
-const WM_MOUSEHWHEEL = 0x020E;
-
-const SB_LINEUP = 0;
-const SB_LINELEFT = 0;
-const SB_LINEDOWN = 1;
-const SB_LINERIGHT = 1;
-const SB_PAGEUP = 2;
-const SB_PAGELEFT = 2;
-const SB_PAGEDOWN = 3;
-const SB_PAGERIGHT = 3;
-
-const SHIFT_L = 0x0100;
-const SHIFT_R = 0x0200;
-const CTRL_L = 0x0400;
-const CTRL_R = 0x0800;
-const ALT_L = 0x1000;
-const ALT_R = 0x2000;
-
-const DOM_PAGE_SCROLL_DELTA = 32768;
-
-const kSystemScrollSpeedOverridePref = "mousewheel.system_scroll_override_on_root_content.enabled";
-
-const kAltKeyActionPref = "mousewheel.with_alt.action";
-const kCtrlKeyActionPref = "mousewheel.with_control.action";
-const kShiftKeyActionPref = "mousewheel.with_shift.action";
-const kWinKeyActionPref = "mousewheel.with_win.action";
-
-const kAltKeyDeltaMultiplierXPref = "mousewheel.with_alt.delta_multiplier_x";
-const kAltKeyDeltaMultiplierYPref = "mousewheel.with_alt.delta_multiplier_y";
-const kCtrlKeyDeltaMultiplierXPref = "mousewheel.with_control.delta_multiplier_x";
-const kCtrlKeyDeltaMultiplierYPref = "mousewheel.with_control.delta_multiplier_y";
-const kShiftKeyDeltaMultiplierXPref = "mousewheel.with_shift.delta_multiplier_x";
-const kShiftKeyDeltaMultiplierYPref = "mousewheel.with_shift.delta_multiplier_y";
-const kWinKeyDeltaMultiplierXPref = "mousewheel.with_win.delta_multiplier_x";
-const kWinKeyDeltaMultiplierYPref = "mousewheel.with_win.delta_multiplier_y";
-
-const kEmulateWheelByWMSCROLLPref = "mousewheel.emulate_at_wm_scroll";
-const kVAmountPref = "mousewheel.windows.vertical_amount_override";
-const kHAmountPref = "mousewheel.windows.horizontal_amount_override";
-const kTimeoutPref = "mousewheel.windows.transaction.timeout";
-
-const kMouseLineScrollEvent = "DOMMouseScroll";
-const kMousePixelScrollEvent = "MozMousePixelScroll";
-
-const kVAxis = Components.interfaces.nsIDOMMouseScrollEvent.VERTICAL_AXIS;
-const kHAxis = Components.interfaces.nsIDOMMouseScrollEvent.HORIZONTAL_AXIS;
-
-var gLineHeight = 0;
-var gCharWidth = 0;
-var gPageHeight = 0;
-var gPageWidth = 0;
-
-var gP1 = document.getElementById("p1");
-var gP2 = document.getElementById("p2");
-
-var gOtherWindow;
-
-function ok(aCondition, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.ok(aCondition, aMessage);
-}
-
-function is(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.is(aLeft, aRight, aMessage);
-}
-
-function isnot(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.isnot(aLeft, aRight, aMessage);
-}
-
-function todo_is(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.todo_is(aLeft, aRight, aMessage);
-}
-
-function onUnload()
-{
- SpecialPowers.clearUserPref(kAltKeyActionPref);
- SpecialPowers.clearUserPref(kCtrlKeyActionPref);
- SpecialPowers.clearUserPref(kShiftKeyActionPref);
- SpecialPowers.clearUserPref(kWinKeyActionPref);
-
- SpecialPowers.clearUserPref(kAltKeyDeltaMultiplierXPref);
- SpecialPowers.clearUserPref(kAltKeyDeltaMultiplierYPref);
- SpecialPowers.clearUserPref(kCtrlKeyDeltaMultiplierXPref);
- SpecialPowers.clearUserPref(kCtrlKeyDeltaMultiplierYPref);
- SpecialPowers.clearUserPref(kShiftKeyDeltaMultiplierXPref);
- SpecialPowers.clearUserPref(kShiftKeyDeltaMultiplierYPref);
- SpecialPowers.clearUserPref(kWinKeyDeltaMultiplierXPref);
- SpecialPowers.clearUserPref(kWinKeyDeltaMultiplierYPref);
-
- SpecialPowers.clearUserPref(kSystemScrollSpeedOverridePref);
- SpecialPowers.clearUserPref(kEmulateWheelByWMSCROLLPref);
- SpecialPowers.clearUserPref(kVAmountPref);
- SpecialPowers.clearUserPref(kHAmountPref);
- SpecialPowers.clearUserPref(kTimeoutPref);
- window.opener.wrappedJSObject.SimpleTest.finish();
-}
-
-function getWindowUtils(aWindow)
-{
- if (!aWindow) {
- aWindow = window;
- }
- return aWindow.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
- .getInterface(nsIDOMWindowUtils);
-}
-
-function getPointInScreen(aElement, aWindow)
-{
- if (!aWindow) {
- aWindow = window;
- }
- var bounds = aElement.getBoundingClientRect();
- return { x: bounds.left + aWindow.mozInnerScreenX,
- y: bounds.top + aWindow.mozInnerScreenY };
-}
-
-function cut(aNum)
-{
- return (aNum >= 0) ? Math.floor(aNum) : Math.ceil(aNum);
-}
-
-/**
- * Make each steps for the tests in following arrays in global scope. Each item
- * of the arrays will be executed after previous test is finished.
- *
- * description:
- * Set the description of the test. This will be used for the message of is()
- * or the others.
- *
- * message:
- * aNativeMessage of nsIDOMWindowUtils.sendNativeMouseScrollEvent().
- * Must be WM_MOUSEWHEEL, WM_MOUSEHWHEEL, WM_VSCROLL or WM_HSCROLL.
- *
- * delta:
- * The native delta value for WM_MOUSEWHEEL or WM_MOUSEHWHEEL.
- * Or one of the SB_* const value for WM_VSCROLL or WM_HSCROLL.
- *
- * target:
- * The target element, under the mouse cursor.
- *
- * window:
- * The window which is used for getting nsIDOMWindowUtils.
- *
- * modifiers:
- * Pressed modifier keys, 0 means no modifier key is pressed.
- * Otherwise, one or more values of SHIFT_L, SHIFT_R, CTRL_L, CTRL_R,
- * ALT_L or ALT_R.
- *
- * additionalFlags:
- * aAdditionalFlags of nsIDOMWindowUtils.sendNativeMouseScrollEvent().
- * See the document of nsIDOMWindowUtils for the detail of the values.
- *
- * onLineScrollEvent:
- * Must be a function or null.
- * If the value is a function, it will be called when DOMMouseScroll event
- * is received by the synthesized event.
- * If return true, the common checks are canceled.
- *
- * onPixelScrollEvent:
- * Must be a function or null.
- * If the value is a function, it will be called when MozMousePixelScroll
- * event is received by the synthesized event.
- * If return true, the common checks are canceled.
- *
- * expected:
- * Must not be null and this must have:
- * axis:
- * kVAxis if the synthesized event causes vertical scroll. Otherwise,
- * it causes horizontal scroll, kHAxis.
- * lines:
- * Integer value which is expected detail attribute value of
- * DOMMouseScroll. If the event shouldn't be fired, must be 0.
- * pixels:
- * Integer value or a function which returns double value. The value is
- * expected detail attribute value of MozMousePixelScroll.
- * If the event shouldn't be fired, must be 0.
- *
- * Note that if both lines and pixels are 0, the test framework waits
- * a few seconds. After that, go to next test.
- *
- * init:
- * Must be a function or null. If this value is a function, it's called
- * before synthesizing the native event.
- *
- * finish:
- * Must be a function or null. If this value is a function, it's called
- * after received all expected events or timeout if no events are expected.
- */
-
-// First, get the computed line height, char width, page height and page width.
-var gPreparingSteps = [
- { description: "Preparing gLineHeight",
- message: WM_MOUSEWHEEL, delta: -120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- onLineScrollEvent: function (aEvent) {
- return true;
- },
- onPixelScrollEvent: function (aEvent) {
- gLineHeight = aEvent.detail;
- return true;
- },
- expected: {
- axis: kVAxis, lines: 1, pixels: 1,
- },
- init: function () {
- SpecialPowers.setIntPref(kVAmountPref, 1);
- SpecialPowers.setIntPref(kHAmountPref, 1);
- },
- },
- { description: "Preparing gCharWidth",
- message: WM_MOUSEHWHEEL, delta: 120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- onLineScrollEvent: function (aEvent) {
- return true;
- },
- onPixelScrollEvent: function (aEvent) {
- gCharWidth = aEvent.detail;
- return true;
- },
- expected: {
- axis: kVAxis, lines: 1, pixels: 1,
- },
- },
- { description: "Preparing gPageHeight",
- message: WM_MOUSEWHEEL, delta: -120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- onLineScrollEvent: function (aEvent) {
- return true;
- },
- onPixelScrollEvent: function (aEvent) {
- gPageHeight = aEvent.detail;
- return true;
- },
- expected: {
- axis: kHAxis, lines: 1, pixels: 1,
- },
- init: function () {
- SpecialPowers.setIntPref(kVAmountPref, 0xFFFF);
- SpecialPowers.setIntPref(kHAmountPref, 0xFFFF);
- },
- },
- { description: "Preparing gPageWidth",
- message: WM_MOUSEHWHEEL, delta: 120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- onLineScrollEvent: function (aEvent) {
- return true;
- },
- onPixelScrollEvent: function (aEvent) {
- gPageWidth = aEvent.detail;
- return true;
- },
- expected: {
- axis: kHAxis, lines: 1, pixels: 1,
- },
- finish: function () {
- ok(gLineHeight > 0, "gLineHeight isn't positive got " + gLineHeight);
- ok(gCharWidth > 0, "gCharWidth isn't positive got " + gCharWidth);
- ok(gPageHeight > 0, "gPageHeight isn't positive got " + gPageHeight);
- ok(gPageWidth > 0, "gPageWidth isn't positive got " + gPageWidth);
-
- ok(gPageHeight > gLineHeight,
- "gPageHeight must be larger than gLineHeight");
- ok(gPageWidth > gCharWidth,
- "gPageWidth must be larger than gCharWidth");
- runNextTest(gBasicTests, 0)
- }
- },
-];
-
-var gBasicTests = [
- // Widget shouldn't dispatch a pixel event if the delta can be devided by
- // lines to be scrolled. However, pixel events should be fired by ESM.
- { description: "WM_MOUSEWHEEL, -120, 3 lines",
- message: WM_MOUSEWHEEL, delta: -120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 3, pixels: function () { return gLineHeight * 3; },
- },
- init: function () {
- SpecialPowers.setIntPref(kVAmountPref, 3);
- SpecialPowers.setIntPref(kHAmountPref, 3);
- },
- },
-
- { description: "WM_MOUSEWHEEL, 120, -3 lines",
- message: WM_MOUSEWHEEL, delta: 120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: -3, pixels: function () { return gLineHeight * -3; },
- },
- },
-
- { description: "WM_MOUSEHWHEEL, 120, 3 chars",
- message: WM_MOUSEHWHEEL, delta: 120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 3, pixels: function () { return gCharWidth * 3; },
- },
- },
-
- { description: "WM_MOUSEHWHEEL, -120, -3 chars",
- message: WM_MOUSEHWHEEL, delta: -120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: -3, pixels: function () { return gCharWidth * -3; },
- },
- },
-
- // Pixel scroll event should be fired always but line scroll event should be
- // fired only when accumulated delta value is over a line.
- { description: "WM_MOUSEWHEEL, -20, 0.5 lines",
- message: WM_MOUSEWHEEL, delta: -20,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 0, pixels: function () { return gLineHeight / 2; },
- },
- },
- { description: "WM_MOUSEWHEEL, -20, 0.5 lines (pending: 0.5 lines)",
- message: WM_MOUSEWHEEL, delta: -20,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight / 2; },
- },
- },
- { description: "WM_MOUSEWHEEL, -20, 0.5 lines",
- message: WM_MOUSEWHEEL, delta: -20,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 0, pixels: function () { return gLineHeight / 2; },
- },
- },
-
- { description: "WM_MOUSEWHEEL, 20, -0.5 lines (pending: 0.5 lines)",
- message: WM_MOUSEWHEEL, delta: 20,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 0, pixels: function () { return gLineHeight / -2; },
- },
- },
- { description: "WM_MOUSEWHEEL, 20, -0.5 lines (pending: -0.5 lines)",
- message: WM_MOUSEWHEEL, delta: 20,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: -1, pixels: function () { return -gLineHeight / 2; },
- },
- },
- { description: "WM_MOUSEWHEEL, 20, -0.5 lines",
- message: WM_MOUSEWHEEL, delta: 20,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 0, pixels: function () { return gLineHeight / -2; },
- },
- },
-
- { description: "WM_MOUSEHWHEEL, 20, 0.5 chars",
- message: WM_MOUSEHWHEEL, delta: 20,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 0, pixels: function () { return gCharWidth / 2; },
- },
- },
- { description: "WM_MOUSEHWHEEL, 20, 0.5 chars (pending: 0.5 chars)",
- message: WM_MOUSEHWHEEL, delta: 20,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth / 2; },
- },
- },
- { description: "WM_MOUSEHWHEEL, 20, 0.5 chars",
- message: WM_MOUSEHWHEEL, delta: 20,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 0, pixels: function () { return gCharWidth / 2; },
- },
- },
-
- { description: "WM_MOUSEHWHEEL, -20, -0.5 chars (pending: 0.5 chars)",
- message: WM_MOUSEHWHEEL, delta: -20,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 0, pixels: function () { return gCharWidth / -2; },
- },
- },
- { description: "WM_MOUSEHWHEEL, -20, -0.5 chars (pending: -0.5 chars)",
- message: WM_MOUSEHWHEEL, delta: -20,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: -1, pixels: function () { return -gCharWidth / 2; },
- },
- },
- { description: "WM_MOUSEHWHEEL, -20, -0.5 chars",
- message: WM_MOUSEHWHEEL, delta: -20,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 0, pixels: function () { return gCharWidth / -2; },
- },
- },
-
- // Even if the mouse cursor is an element whose font-size is different than
- // the scrollable element, the pixel scroll amount shouldn't be changed.
- // Widget shouldn't dispatch a pixel event if the delta can be devided by
- // lines to be scrolled. However, pixel events should be fired by ESM.
- { description: "WM_MOUSEWHEEL, -120, 3 lines, on the other div whose font-size is larger",
- message: WM_MOUSEWHEEL, delta: -120,
- target: gP2, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 3, pixels: function () { return gLineHeight * 3; },
- },
- },
-
- { description: "WM_MOUSEWHEEL, 120, -3 lines, on the other div whose font-size is larger",
- message: WM_MOUSEWHEEL, delta: 120,
- target: gP2, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: -3, pixels: function () { return gLineHeight * -3; },
- },
- },
-
- { description: "WM_MOUSEHWHEEL, 120, 3 chars, on the other div whose font-size is larger",
- message: WM_MOUSEHWHEEL, delta: 120,
- target: gP2, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 3, pixels: function () { return gCharWidth * 3; },
- },
- },
-
- { description: "WM_MOUSEHWHEEL, -120, -3 chars, on the other div whose font-size is larger",
- message: WM_MOUSEHWHEEL, delta: -120,
- target: gP2, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: -3, pixels: function () { return gCharWidth * -3; },
- },
- },
-
- // Modifier key tests
- { description: "WM_MOUSEWHEEL, -40, 1 line with left Shift",
- message: WM_MOUSEWHEEL, delta: -40,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: SHIFT_L,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
- { description: "WM_MOUSEWHEEL, -40, 1 line with right Shift",
- message: WM_MOUSEWHEEL, delta: -40,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: SHIFT_R,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
- { description: "WM_MOUSEWHEEL, -40, 1 line with left Ctrl",
- message: WM_MOUSEWHEEL, delta: -40,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: CTRL_L,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
- { description: "WM_MOUSEWHEEL, -40, 1 line with right Ctrl",
- message: WM_MOUSEWHEEL, delta: -40,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: CTRL_R,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
- { description: "WM_MOUSEWHEEL, -40, 1 line with left Alt",
- message: WM_MOUSEWHEEL, delta: -40,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: ALT_L,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
- { description: "WM_MOUSEWHEEL, -40, 1 line with right Alt",
- message: WM_MOUSEWHEEL, delta: -40,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: ALT_R,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
-
- { description: "WM_MOUSEHWHEEL, 40, 1 character with left Shift",
- message: WM_MOUSEHWHEEL, delta: 40,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: SHIFT_L,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
- { description: "WM_MOUSEHWHEEL, 40, 1 character with right Shift",
- message: WM_MOUSEHWHEEL, delta: 40,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: SHIFT_R,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
- { description: "WM_MOUSEHWHEEL, 40, 1 character with left Ctrl",
- message: WM_MOUSEHWHEEL, delta: 40,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: CTRL_L,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
- { description: "WM_MOUSEHWHEEL, 40, 1 character with right Ctrl",
- message: WM_MOUSEHWHEEL, delta: 40,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: CTRL_R,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
- { description: "WM_MOUSEHWHEEL, 40, 1 character with left Alt",
- message: WM_MOUSEHWHEEL, delta: 40,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: ALT_L,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
- { description: "WM_MOUSEHWHEEL, 40, 1 character with right Alt",
- message: WM_MOUSEHWHEEL, delta: 40,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: ALT_R,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
-
- finish: function () {
- runNextTest(gScrollMessageTests, 0);
- }
- },
-];
-
-var gPageScrllTests = [
- // Pixel scroll event should be fired always but line scroll event should be
- // fired only when accumulated delta value is over a line.
- { description: "WM_MOUSEWHEEL, -60, 0.5 pages",
- message: WM_MOUSEWHEEL, delta: -60,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 0, pixels: function () { return gPageHeight / 2; },
- },
- },
- { description: "WM_MOUSEWHEEL, -60, 0.5 pages (pending: 0.5 pages)",
- message: WM_MOUSEWHEEL, delta: -60,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: DOM_PAGE_SCROLL_DELTA,
- pixels: function () { return ((gPageHeight / 2) + (gPageHeight % 2)); },
- },
- },
- { description: "WM_MOUSEWHEEL, -60, 0.5 pages",
- message: WM_MOUSEWHEEL, delta: -60,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 0, pixels: function () { return gPageHeight / 2; },
- },
- },
-
- { description: "WM_MOUSEWHEEL, 60, -0.5 pages (pending: 0.5 pages)",
- message: WM_MOUSEWHEEL, delta: 60,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 0, pixels: function () { return gPageHeight / -2; },
- },
- },
- { description: "WM_MOUSEWHEEL, 60, -0.5 pages (pending: -0.5 pages)",
- message: WM_MOUSEWHEEL, delta: 60,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: -DOM_PAGE_SCROLL_DELTA,
- pixels: function () { return -((gPageHeight / 2) + (gPageHeight % 2)); },
- },
- },
- { description: "WM_MOUSEWHEEL, 60, -0.5 pages",
- message: WM_MOUSEWHEEL, delta: 60,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 0, pixels: function () { return gPageHeight / -2; },
- },
- },
-
- { description: "WM_MOUSEHWHEEL, 60, 0.5 pages",
- message: WM_MOUSEHWHEEL, delta: 60,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 0, pixels: function () { return gPageWidth / 2; },
- },
- },
- { description: "WM_MOUSEHWHEEL, 60, 0.5 pages (pending: 0.5 pages)",
- message: WM_MOUSEHWHEEL, delta: 60,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: DOM_PAGE_SCROLL_DELTA,
- pixels: function () { return ((gPageWidth / 2) + (gPageWidth % 2)); },
- },
- },
- { description: "WM_MOUSEHWHEEL, 60, 0.5 pages",
- message: WM_MOUSEHWHEEL, delta: 60,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 0, pixels: function () { return gPageWidth / 2; },
- },
- },
-
- { description: "WM_MOUSEHWHEEL, -60, -0.5 pages (pending: 0.5 pages)",
- message: WM_MOUSEHWHEEL, delta: -60,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 0, pixels: function () { return gCharWidth / -2; },
- },
- },
- { description: "WM_MOUSEHWHEEL, -60, -0.5 pages (pending: -0.5 pages)",
- message: WM_MOUSEHWHEEL, delta: -60,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: -DOM_PAGE_SCROLL_DELTA,
- pixels: function () { return -((gCharWidth / 2) + (gCharWidth % 2)); },
- },
- },
- { description: "WM_MOUSEHWHEEL, -60, -0.5 pages",
- message: WM_MOUSEHWHEEL, delta: -60,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 0, pixels: function () { return gCharWidth / -2; },
- },
- },
-];
-
-var gScrollMessageTests = [
- // Widget should dispatch neither line scroll event nor pixel scroll event if
- // the WM_*SCROLL's lParam is NULL and mouse wheel emulation is disabled.
- { description: "WM_VSCROLL, SB_LINEDOWN, lParam is NULL, emulation disabled",
- message: WM_VSCROLL, delta: SB_LINEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 0, pixels: 0,
- },
- init: function () {
- SpecialPowers.setIntPref(kVAmountPref, 3);
- SpecialPowers.setIntPref(kHAmountPref, 3);
- SpecialPowers.setBoolPref(kEmulateWheelByWMSCROLLPref, false);
- },
- },
-
- { description: "WM_VSCROLL, SB_LINEUP, lParam is NULL, emulation disabled",
- message: WM_VSCROLL, delta: SB_LINEUP,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 0, pixels: 0,
- },
- },
-
- { description: "WM_HSCROLL, SB_LINERIGHT, lParam is NULL, emulation disabled",
- message: WM_HSCROLL, delta: SB_LINERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 0, pixels: 0,
- },
- },
-
- { description: "WM_HSCROLL, SB_LINELEFT, lParam is NULL, emulation disabled",
- message: WM_HSCROLL, delta: SB_LINELEFT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 0, pixels: 0,
- },
- },
-
- // Widget should emulate mouse wheel behavior for WM_*SCROLL even if the
- // kEmulateWheelByWMSCROLLPref is disabled but the message's lParam is not
- // NULL. Then, widget doesn't dispatch a pixel event for WM_*SCROLL messages,
- // but ESM dispatches it instead.
- { description: "WM_VSCROLL, SB_LINEUP, lParam is not NULL, emulation disabled",
- message: WM_VSCROLL, delta: SB_LINEUP,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kVAxis, lines: -1, pixels: function () { return -gLineHeight; },
- },
- init: function () {
- SpecialPowers.setBoolPref(kEmulateWheelByWMSCROLLPref, false);
- },
- },
-
- { description: "WM_VSCROLL, SB_LINEDOWN, lParam is not NULL, emulation disabled",
- message: WM_VSCROLL, delta: SB_LINEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
-
- { description: "WM_HSCROLL, SB_LINELEFT, lParam is not NULL, emulation disabled",
- message: WM_HSCROLL, delta: SB_LINELEFT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kHAxis, lines: -1, pixels: function () { return -gCharWidth; },
- },
- },
-
- { description: "WM_HSCROLL, SB_LINERIGHT, lParam is not NULL, emulation disabled",
- message: WM_HSCROLL, delta: SB_LINERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
-
- { description: "WM_VSCROLL, SB_PAGEUP, lParam is not NULL, emulation disabled",
- message: WM_VSCROLL, delta: SB_PAGEUP,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kVAxis, lines: -DOM_PAGE_SCROLL_DELTA,
- pixels: function () { return -gPageHeight; },
- },
- },
-
- { description: "WM_VSCROLL, SB_PAGEDOWN, lParam is not NULL, emulation disabled",
- message: WM_VSCROLL, delta: SB_PAGEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kVAxis, lines: DOM_PAGE_SCROLL_DELTA,
- pixels: function () { return gPageHeight; },
- },
- },
-
- { description: "WM_HSCROLL, SB_PAGELEFT, lParam is not NULL, emulation disabled",
- message: WM_HSCROLL, delta: SB_PAGELEFT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kHAxis, lines: -DOM_PAGE_SCROLL_DELTA,
- pixels: function () { return -gPageWidth; },
- },
- },
-
- { description: "WM_HSCROLL, SB_PAGERIGHT, lParam is not NULL, emulation disabled",
- message: WM_HSCROLL, delta: SB_PAGERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kHAxis, lines: DOM_PAGE_SCROLL_DELTA,
- pixels: function () { return gPageWidth; },
- },
- },
-
- // Widget should emulate mouse wheel behavior for WM_*SCROLL when the
- // kEmulateWheelByWMSCROLLPref is enabled even if the message's lParam is
- // NULL. Then, widget doesn't dispatch a pixel event for WM_*SCROLL messages,
- // but ESM dispatches it instead.
- { description: "WM_VSCROLL, SB_LINEUP, lParam is NULL, emulation enabled",
- message: WM_VSCROLL, delta: SB_LINEUP,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: -1, pixels: function () { return -gLineHeight; },
- },
- init: function () {
- SpecialPowers.setBoolPref(kEmulateWheelByWMSCROLLPref, true);
- },
- },
-
- { description: "WM_VSCROLL, SB_LINEDOWN, lParam is NULL, emulation enabled",
- message: WM_VSCROLL, delta: SB_LINEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
-
- { description: "WM_HSCROLL, SB_LINELEFT, lParam is NULL, emulation enabled",
- message: WM_HSCROLL, delta: SB_LINELEFT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: -1, pixels: function () { return -gCharWidth; },
- },
- },
-
- { description: "WM_HSCROLL, SB_LINERIGHT, lParam is NULL, emulation enabled",
- message: WM_HSCROLL, delta: SB_LINERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
-
- { description: "WM_VSCROLL, SB_PAGEUP, lParam is NULL, emulation enabled",
- message: WM_VSCROLL, delta: SB_PAGEUP,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: -DOM_PAGE_SCROLL_DELTA,
- pixels: function () { return -gPageHeight; },
- },
- },
-
- { description: "WM_VSCROLL, SB_PAGEDOWN, lParam is NULL, emulation enabled",
- message: WM_VSCROLL, delta: SB_PAGEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: DOM_PAGE_SCROLL_DELTA,
- pixels: function () { return gPageHeight; },
- },
- },
-
- { description: "WM_HSCROLL, SB_PAGELEFT, lParam is NULL, emulation enabled",
- message: WM_HSCROLL, delta: SB_PAGELEFT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: -DOM_PAGE_SCROLL_DELTA,
- pixels: function () { return -gPageWidth; },
- },
- },
-
- { description: "WM_HSCROLL, SB_PAGERIGHT, lParam is NULL, emulation enabled",
- message: WM_HSCROLL, delta: SB_PAGERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: DOM_PAGE_SCROLL_DELTA,
- pixels: function () { return gPageWidth; },
- },
- },
-
- // Modifier key tests for WM_*SCROLL
- { description: "WM_VSCROLL, SB_LINEDOWN, lParam is not NULL, emulation disabled, with left Shift",
- message: WM_VSCROLL, delta: SB_LINEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: SHIFT_L,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- init: function () {
- SpecialPowers.setBoolPref(kEmulateWheelByWMSCROLLPref, false);
- },
- },
- { description: "WM_VSCROLL, SB_LINEDOWN, lParam is not NULL, emulation disabled, with right Shift",
- message: WM_VSCROLL, delta: SB_LINEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: SHIFT_R,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
- { description: "WM_VSCROLL, SB_LINEDOWN, lParam is not NULL, emulation disabled, with left Ctrl",
- message: WM_VSCROLL, delta: SB_LINEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: CTRL_L,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
- { description: "WM_VSCROLL, SB_LINEDOWN, lParam is not NULL, emulation disabled, with right Ctrl",
- message: WM_VSCROLL, delta: SB_LINEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: CTRL_L,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
- { description: "WM_VSCROLL, SB_LINEDOWN, lParam is not NULL, emulation disabled, with left Alt",
- message: WM_VSCROLL, delta: SB_LINEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: ALT_L,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
- { description: "WM_VSCROLL, SB_LINEDOWN, lParam is not NULL, emulation disabled, with right Alt",
- message: WM_VSCROLL, delta: SB_LINEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: ALT_R,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
-
- { description: "WM_HSCROLL, SB_LINERIGHT, lParam is not NULL, emulation disabled, with left Shift",
- message: WM_HSCROLL, delta: SB_LINERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: SHIFT_L,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
- { description: "WM_HSCROLL, SB_LINERIGHT, lParam is not NULL, emulation disabled, with right Shift",
- message: WM_HSCROLL, delta: SB_LINERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: SHIFT_R,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
- { description: "WM_HSCROLL, SB_LINERIGHT, lParam is not NULL, emulation disabled, with left Ctrl",
- message: WM_HSCROLL, delta: SB_LINERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: CTRL_L,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
- { description: "WM_HSCROLL, SB_LINERIGHT, lParam is not NULL, emulation disabled, with right Ctrl",
- message: WM_HSCROLL, delta: SB_LINERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: CTRL_L,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
- { description: "WM_HSCROLL, SB_LINERIGHT, lParam is not NULL, emulation disabled, with left Alt",
- message: WM_HSCROLL, delta: SB_LINERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: ALT_L,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
- { description: "WM_HSCROLL, SB_LINERIGHT, lParam is not NULL, emulation disabled, with right Alt",
- message: WM_HSCROLL, delta: SB_LINERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: ALT_R,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
-
- finish: function () {
- runDeactiveWindowTests();
- }
- },
-];
-
-var gDeactiveWindowTests = [
- // Typically, mouse drivers send wheel messages to focused window.
- // However, we prefer to scroll a scrollable element under the mouse cursor.
- { description: "WM_MOUSEWHEEL, -120, 3 lines, window is deactive",
- message: WM_MOUSEWHEEL, delta: -120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 3, pixels: function () { return gLineHeight * 3; },
- },
- init: function () {
- SpecialPowers.setIntPref(kVAmountPref, 3);
- SpecialPowers.setIntPref(kHAmountPref, 3);
- },
- onLineScrollEvent: function (aEvent) {
- var fm = Components.classes["@mozilla.org/focus-manager;1"].
- getService(Components.interfaces.nsIFocusManager);
- is(fm.activeWindow, gOtherWindow, "The other window isn't activated");
- },
- },
-
- { description: "WM_MOUSEWHEEL, 120, -3 lines, window is deactive",
- message: WM_MOUSEWHEEL, delta: 120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: -3, pixels: function () { return gLineHeight * -3; },
- },
- },
-
- { description: "WM_MOUSEHWHEEL, 120, 3 chars, window is deactive",
- message: WM_MOUSEHWHEEL, delta: 120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 3, pixels: function () { return gCharWidth * 3; },
- },
- },
-
- { description: "WM_MOUSEHWHEEL, -120, -3 chars, window is deactive",
- message: WM_MOUSEHWHEEL, delta: -120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: -3, pixels: function () { return gCharWidth * -3; },
- },
- },
-
- // Of course, even if some drivers prefer the cursor position, we don't need
- // to change anything.
- { description: "WM_MOUSEWHEEL, -120, 3 lines, window is deactive (receive the message directly)",
- message: WM_MOUSEWHEEL, delta: -120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_PREFER_WIDGET_AT_POINT,
- expected: {
- axis: kVAxis, lines: 3, pixels: function () { return gLineHeight * 3; },
- },
- },
-
- { description: "WM_MOUSEWHEEL, 120, -3 lines, window is deactive (receive the message directly)",
- message: WM_MOUSEWHEEL, delta: 120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_PREFER_WIDGET_AT_POINT,
- expected: {
- axis: kVAxis, lines: -3, pixels: function () { return gLineHeight * -3; },
- },
- },
-
- { description: "WM_MOUSEHWHEEL, 120, 3 chars, window is deactive (receive the message directly)",
- message: WM_MOUSEHWHEEL, delta: 120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_PREFER_WIDGET_AT_POINT,
- expected: {
- axis: kHAxis, lines: 3, pixels: function () { return gCharWidth * 3; },
- },
- },
-
- { description: "WM_MOUSEHWHEEL, -120, -3 chars, window is deactive (receive the message directly)",
- message: WM_MOUSEHWHEEL, delta: -120,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_PREFER_WIDGET_AT_POINT,
- expected: {
- axis: kHAxis, lines: -3, pixels: function () { return gCharWidth * -3; },
- },
- },
-
- // Same for WM_*SCROLL if lParam is not NULL
- { description: "WM_VSCROLL, SB_LINEUP, lParam is not NULL, emulation disabled, window is deactive",
- message: WM_VSCROLL, delta: SB_LINEUP,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kVAxis, lines: -1, pixels: function () { return -gLineHeight; },
- },
- init: function () {
- SpecialPowers.setBoolPref(kEmulateWheelByWMSCROLLPref, false);
- },
- },
-
- { description: "WM_VSCROLL, SB_LINEDOWN, lParam is not NULL, emulation disabled, window is deactive",
- message: WM_VSCROLL, delta: SB_LINEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
-
- { description: "WM_HSCROLL, SB_LINELEFT, lParam is not NULL, emulation disabled, window is deactive",
- message: WM_HSCROLL, delta: SB_LINELEFT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kHAxis, lines: -1, pixels: function () { return -gCharWidth; },
- },
- },
-
- { description: "WM_HSCROLL, SB_LINERIGHT, lParam is not NULL, emulation disabled, window is deactive",
- message: WM_HSCROLL, delta: SB_LINERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
-
- // Same for WM_*SCROLL if lParam is NULL but emulation is enabled
- { description: "WM_VSCROLL, SB_LINEUP, lParam is NULL, emulation enabled, window is deactive",
- message: WM_VSCROLL, delta: SB_LINEUP,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: -1, pixels: function () { return -gLineHeight; },
- },
- init: function () {
- SpecialPowers.setBoolPref(kEmulateWheelByWMSCROLLPref, true);
- },
- },
-
- { description: "WM_VSCROLL, SB_LINEDOWN, lParam is NULL, emulation enabled, window is deactive",
- message: WM_VSCROLL, delta: SB_LINEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
-
- { description: "WM_HSCROLL, SB_LINELEFT, lParam is NULL, emulation enabled, window is deactive",
- message: WM_HSCROLL, delta: SB_LINELEFT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: -1, pixels: function () { return -gCharWidth; },
- },
- },
-
- { description: "WM_HSCROLL, SB_LINERIGHT, lParam is NULL, emulation enabled, window is deactive",
- message: WM_HSCROLL, delta: SB_LINERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: 0,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
-
- // Same for WM_*SCROLL if lParam is not NULL and message sent to the deactive window directly
- { description: "WM_VSCROLL, SB_LINEUP, lParam is not NULL, emulation disabled, window is deactive (receive the message directly)",
- message: WM_VSCROLL, delta: SB_LINEUP,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL |
- nsIDOMWindowUtils.MOUSESCROLL_PREFER_WIDGET_AT_POINT,
- expected: {
- axis: kVAxis, lines: -1, pixels: function () { return -gLineHeight; },
- },
- init: function () {
- SpecialPowers.setBoolPref(kEmulateWheelByWMSCROLLPref, false);
- },
- },
-
- { description: "WM_VSCROLL, SB_LINEDOWN, lParam is not NULL, emulation disabled, window is deactive (receive the message directly)",
- message: WM_VSCROLL, delta: SB_LINEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL |
- nsIDOMWindowUtils.MOUSESCROLL_PREFER_WIDGET_AT_POINT,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
-
- { description: "WM_HSCROLL, SB_LINELEFT, lParam is not NULL, emulation disabled, window is deactive (receive the message directly)",
- message: WM_HSCROLL, delta: SB_LINELEFT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL |
- nsIDOMWindowUtils.MOUSESCROLL_PREFER_WIDGET_AT_POINT,
- expected: {
- axis: kHAxis, lines: -1, pixels: function () { return -gCharWidth; },
- },
- },
-
- { description: "WM_HSCROLL, SB_LINERIGHT, lParam is not NULL, emulation disabled, window is deactive (receive the message directly)",
- message: WM_HSCROLL, delta: SB_LINERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_WIN_SCROLL_LPARAM_NOT_NULL |
- nsIDOMWindowUtils.MOUSESCROLL_PREFER_WIDGET_AT_POINT,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
- },
-
- // Same for WM_*SCROLL if lParam is NULL but emulation is enabled, and message sent to the deactive window directly
- { description: "WM_VSCROLL, SB_LINEUP, lParam is NULL, emulation enabled, window is deactive (receive the message directly)",
- message: WM_VSCROLL, delta: SB_LINEUP,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_PREFER_WIDGET_AT_POINT,
- expected: {
- axis: kVAxis, lines: -1, pixels: function () { return -gLineHeight; },
- },
- init: function () {
- SpecialPowers.setBoolPref(kEmulateWheelByWMSCROLLPref, true);
- },
- },
-
- { description: "WM_VSCROLL, SB_LINEDOWN, lParam is NULL, emulation enabled, window is deactive (receive the message directly)",
- message: WM_VSCROLL, delta: SB_LINEDOWN,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_PREFER_WIDGET_AT_POINT,
- expected: {
- axis: kVAxis, lines: 1, pixels: function () { return gLineHeight; },
- },
- },
-
- { description: "WM_HSCROLL, SB_LINELEFT, lParam is NULL, emulation enabled, window is deactive (receive the message directly)",
- message: WM_HSCROLL, delta: SB_LINELEFT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_PREFER_WIDGET_AT_POINT,
- expected: {
- axis: kHAxis, lines: -1, pixels: function () { return -gCharWidth; },
- },
- },
-
- { description: "WM_HSCROLL, SB_LINERIGHT, lParam is NULL, emulation enabled, window is deactive (receive the message directly)",
- message: WM_HSCROLL, delta: SB_LINERIGHT,
- target: gP1, x: 10, y: 10, window: window,
- modifiers: 0,
- additionalFlags: nsIDOMWindowUtils.MOUSESCROLL_PREFER_WIDGET_AT_POINT,
- expected: {
- axis: kHAxis, lines: 1, pixels: function () { return gCharWidth; },
- },
-
- finish: function () {
- gOtherWindow.close();
- gOtherWindow = null;
- window.close();
- }
- },
-];
-
-function runDeactiveWindowTests()
-{
- gOtherWindow = window.open("data:text/html,", "_blank",
- "chrome,width=100,height=100,top=700,left=700");
-
- window.opener.wrappedJSObject.SimpleTest.waitForFocus(function () {
- runNextTest(gDeactiveWindowTests, 0);
- }, gOtherWindow);
-}
-
-function runNextTest(aTests, aIndex)
-{
- if (aIndex > 0 && aTests[aIndex - 1] && aTests[aIndex - 1].finish) {
- aTests[aIndex - 1].finish();
- }
-
- if (aTests.length == aIndex) {
- return;
- }
-
- var test = aTests[aIndex++];
- if (test.init) {
- test.init();
- }
- test.handled = { lines: false, pixels: false };
-
- switch (test.message) {
- case WM_MOUSEWHEEL:
- case WM_MOUSEHWHEEL:
- case WM_VSCROLL:
- case WM_HSCROLL:
- var expectedLines = test.expected.lines;
- var expectedPixels =
- cut((typeof test.expected.pixels == "function") ?
- test.expected.pixels() : test.expected.pixels);
- var handler = function (aEvent) {
- var doCommonTests = true;
-
- if (!aEvent) {
- ok(!test.handled.lines,
- test.description + ", line scroll event has been handled");
- ok(!test.handled.pixels,
- test.description + ", pixel scroll event has been handled");
- doCommonTests = false;
- } else if (aEvent.type == kMouseLineScrollEvent) {
- ok(!test.handled.lines,
- test.description + ":(" + aEvent.type + "), same event has already been handled");
- test.handled.lines = true;
- isnot(expectedLines, 0,
- test.description + ":(" + aEvent.type + "), event shouldn't be fired");
- if (test.onLineScrollEvent && test.onLineScrollEvent(aEvent)) {
- doCommonTests = false;
- }
- } else if (aEvent.type == kMousePixelScrollEvent) {
- ok(!test.handled.pixels,
- test.description + ":(" + aEvent.type + "), same event has already been handled");
- test.handled.pixels = true;
- isnot(expectedPixels, 0,
- test.description + ":(" + aEvent.type + "), event shouldn't be fired");
- if (test.onPixelScrollEvent && test.onPixelScrollEvent(aEvent)) {
- doCommonTests = false;
- }
- }
-
- if (doCommonTests) {
- var expectedDelta =
- (aEvent.type == kMouseLineScrollEvent) ?
- expectedLines : expectedPixels;
- is(aEvent.target.id, test.target.id,
- test.description + ":(" + aEvent.type + "), ID mismatch");
- is(aEvent.axis, test.expected.axis,
- test.description + ":(" + aEvent.type + "), axis mismatch");
- ok(aEvent.detail != 0,
- test.description + ":(" + aEvent.type + "), delta must not be 0");
- is(aEvent.detail, expectedDelta,
- test.description + ":(" + aEvent.type + "), delta mismatch");
- is(aEvent.shiftKey, (test.modifiers & (SHIFT_L | SHIFT_R)) != 0,
- test.description + ":(" + aEvent.type + "), shiftKey mismatch");
- is(aEvent.ctrlKey, (test.modifiers & (CTRL_L | CTRL_R)) != 0,
- test.description + ":(" + aEvent.type + "), ctrlKey mismatch");
- is(aEvent.altKey, (test.modifiers & (ALT_L | ALT_R)) != 0,
- test.description + ":(" + aEvent.type + "), altKey mismatch");
- }
-
- if (!aEvent || (test.handled.lines || expectedLines == 0) &&
- (test.handled.pixels || expectedPixels == 0)) {
- // Don't scroll actually.
- if (aEvent) {
- aEvent.preventDefault();
- }
- test.target.removeEventListener(kMouseLineScrollEvent, handler, true);
- test.target.removeEventListener(kMousePixelScrollEvent, handler, true);
- setTimeout(runNextTest, 0, aTests, aIndex);
- }
- };
-
- test.target.addEventListener(kMouseLineScrollEvent, handler, true);
- test.target.addEventListener(kMousePixelScrollEvent, handler, true);
-
- if (expectedLines == 0 && expectedPixels == 0) {
- // The timeout might not be enough if system is slow by other process,
- // so, the test might be passed unexpectedly. However, it must be able
- // to be detected by random orange.
- setTimeout(handler, 500);
- }
-
- var utils = getWindowUtils(test.window);
- var ptInScreen = getPointInScreen(test.target, test.window);
- var isVertical =
- ((test.message == WM_MOUSEWHEEL) || (test.message == WM_VSCROLL));
- var deltaX = !isVertical ? test.delta : 0;
- var deltaY = isVertical ? test.delta : 0;
- utils.sendNativeMouseScrollEvent(ptInScreen.x + test.x,
- ptInScreen.y + test.y,
- test.message, deltaX, deltaY, 0,
- test.modifiers,
- test.additionalFlags,
- test.target);
- break;
- default:
- ok(false, test.description + ": invalid message");
- // Let's timeout.
- }
-}
-
-function prepareTests()
-{
- // Disable special action with modifier key
- SpecialPowers.setIntPref(kAltKeyActionPref, 1);
- SpecialPowers.setIntPref(kCtrlKeyActionPref, 1);
- SpecialPowers.setIntPref(kShiftKeyActionPref, 1);
- SpecialPowers.setIntPref(kWinKeyActionPref, 1);
-
- SpecialPowers.setIntPref(kAltKeyDeltaMultiplierXPref, 100);
- SpecialPowers.setIntPref(kAltKeyDeltaMultiplierYPref, 100);
- SpecialPowers.setIntPref(kCtrlKeyDeltaMultiplierXPref, 100);
- SpecialPowers.setIntPref(kCtrlKeyDeltaMultiplierYPref, 100);
- SpecialPowers.setIntPref(kShiftKeyDeltaMultiplierXPref, 100);
- SpecialPowers.setIntPref(kShiftKeyDeltaMultiplierYPref, 100);
- SpecialPowers.setIntPref(kWinKeyDeltaMultiplierXPref, 100);
- SpecialPowers.setIntPref(kWinKeyDeltaMultiplierYPref, 100);
-
- SpecialPowers.setBoolPref(kSystemScrollSpeedOverridePref, false);
- SpecialPowers.setIntPref(kTimeoutPref, -1);
-
- runNextTest(gPreparingSteps, 0);
-}
-
-</script>
-</body>
-
-</html>
diff --git a/widget/tests/window_picker_no_crash_child.html b/widget/tests/window_picker_no_crash_child.html
deleted file mode 100644
index 51bf1b1e6..000000000
--- a/widget/tests/window_picker_no_crash_child.html
+++ /dev/null
@@ -1,10 +0,0 @@
-<html>
-<head>
- <title>Picker window</title>
-</head>
-<body>
-<form name="form1">
-<input type="file" name="uploadbox">
-</form>
-</body>
-</html>
diff --git a/widget/tests/window_state_windows.xul b/widget/tests/window_state_windows.xul
deleted file mode 100644
index 9643e1dad..000000000
--- a/widget/tests/window_state_windows.xul
+++ /dev/null
@@ -1,87 +0,0 @@
-<?xml version="1.0"?>
-
-<!-- This Source Code Form is subject to the terms of the Mozilla Public
- - License, v. 2.0. If a copy of the MPL was not distributed with this
- - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" type="text/css"?>
-
-<window id="NativeWindow"
- xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
- width="300"
- height="300"
- onload="onLoad();"
- title="Window State Tests">
-
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
- <script type="application/javascript">
- <![CDATA[
-
- let Cc = Components.classes;
- let Ci = Components.interfaces;
- let Cu = Components.utils;
- Cu.import("resource://gre/modules/XPCOMUtils.jsm");
-
- SimpleTest.waitForExplicitFinish();
-
- function onLoad() {
- var wm = Cc["@mozilla.org/appshell/window-mediator;1"].getService(Ci.nsIWindowMediator);
- var win = wm.getMostRecentWindow("navigator:browser");
-
- /*
- switch(win.windowState) {
- case win.STATE_FULLSCREEN:
- dump("STATE_FULLSCREEN \n");
- break;
- case win.STATE_MAXIMIZED:
- dump("STATE_MAXIMIZED \n");
- break;
- case win.STATE_MINIMIZED:
- dump("STATE_MINIMIZED \n");
- break;
- case win.STATE_NORMAL:
- dump("STATE_NORMAL \n");
- break;
- }
- */
-
- // Make sure size mode changes are reflected in the widget.
- win.restore();
- ok(win.windowState == win.STATE_NORMAL, "window state is restored.");
- win.minimize();
- ok(win.windowState == win.STATE_MINIMIZED, "window state is minimized.");
-
- // Windows resizes children to 0x0. Code in nsWindow filters these changes out. Without
- // this all sorts of screwy things can happen in child widgets.
- ok(document.height > 0, "document height should not be zero for a minimized window!");
- ok(document.width > 0, "document width should not be zero for a minimized window!");
-
- // Make sure size mode changes are reflected in the widget.
- win.restore();
- ok(win.windowState == win.STATE_NORMAL, "window state is restored.");
- win.maximize();
- ok(win.windowState == win.STATE_MAXIMIZED, "window state is maximized.");
- win.restore();
- ok(win.windowState == win.STATE_NORMAL, "window state is restored.");
-
- /*
- dump(win.screenX + "\n");
- win.minimize();
- dump(win.screenX + "\n");
- win.restore();
- dump(win.screenX + "\n");
- */
-
- SimpleTest.finish();
- }
-
- ]]>
- </script>
- <body xmlns="http://www.w3.org/1999/xhtml">
- <p id="display"></p>
- <div id="content" style="display: none"></div>
- <pre id="test"></pre>
- </body>
-</window>
diff --git a/widget/tests/window_wheeltransaction.xul b/widget/tests/window_wheeltransaction.xul
deleted file mode 100644
index 8573eb3a4..000000000
--- a/widget/tests/window_wheeltransaction.xul
+++ /dev/null
@@ -1,1560 +0,0 @@
-<?xml version="1.0"?>
-<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
-<window title="Wheel scroll tests"
- width="600" height="600"
- onload="onload();"
- onunload="onunload();"
- 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="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/EventUtils.js" />
- <script type="application/javascript"
- src="chrome://mochikit/content/tests/SimpleTest/paint_listener.js" />
-
-<body xmlns="http://www.w3.org/1999/xhtml">
-<style type="text/css">
- #rootview {
- overflow: auto;
- width: 400px;
- height: 400px;
- border: 1px solid;
- }
- #container {
- overflow: auto;
- width: 600px;
- height: 600px;
- }
- #rootview pre {
- margin: 20px 0 20px 20px;
- padding: 0;
- overflow: auto;
- display: block;
- width: 100px;
- height: 100.5px;
- font-size: 16px;
- }
-</style>
-<div id="rootview" onscroll="onScrollView(event);">
- <div id="container">
- <pre id="subview1" onscroll="onScrollView(event);">
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
- </pre>
- <pre id="subview2" onscroll="onScrollView(event);">
-Text.
-Text.
-Text.
-Text.
-Text.
-Text.
-Text.
-Text.
-Text.
-Text.
- </pre>
- <pre id="subview3" onscroll="onScrollView(event);">
-Text. Text. Text. Text. Text. Text. Text. Text. Text. Text. Text.
- </pre>
- </div>
-</div>
-<div id="content" style="display: none">
-</div>
-<pre id="test">
-</pre>
-</body>
-
-<script class="testbody" type="application/javascript">
-<![CDATA[
-
-function ok(aCondition, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.ok(aCondition, aMessage);
-}
-
-function is(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.is(aLeft, aRight, aMessage);
-}
-
-function isnot(aLeft, aRight, aMessage)
-{
- window.opener.wrappedJSObject.SimpleTest.isnot(aLeft, aRight, aMessage);
-}
-
-var gCurrentTestListStatus = { nextListIndex: 0 };
-var gCurrentTest;
-
-const kListenEvent_None = 0;
-const kListenEvent_OnScroll = 1;
-const kListenEvent_OnScrollFailed = 2;
-const kListenEvent_OnTransactionTimeout = 4;
-const kListenEvent_All = kListenEvent_OnScroll |
- kListenEvent_OnScrollFailed |
- kListenEvent_OnTransactionTimeout;
-var gLitesnEvents = kListenEvent_None;
-
-/**
- * At unexpected transaction timeout, we need to stop *all* timers. But it is
- * difficult and it can be create more complex testing code. So, we should use
- * only one timer at one time. For that, we must store the timer id to this
- * variable. And the functions which may be called via a timer must clear the
- * current timer by |_clearTimer| function.
- */
-var gTimer;
-
-var gPrefSvc = Components.classes["@mozilla.org/preferences-service;1"].
- getService(Components.interfaces.nsIPrefBranch);
-const kPrefSmoothScroll = "general.smoothScroll";
-const kPrefNameTimeout = "mousewheel.transaction.timeout";
-const kPrefNameIgnoreMoveDelay = "mousewheel.transaction.ignoremovedelay";
-const kPrefTestEventsAsyncEnabled = "test.events.async.enabled";
-
-const kDefaultTimeout = gPrefSvc.getIntPref(kPrefNameTimeout);
-const kDefaultIgnoreMoveDelay = gPrefSvc.getIntPref(kPrefNameIgnoreMoveDelay);
-
-gPrefSvc.setBoolPref(kPrefSmoothScroll, false);
-gPrefSvc.setBoolPref(kPrefTestEventsAsyncEnabled, true);
-
-var gTimeout, gIgnoreMoveDelay;
-var gEnoughForTimeout, gEnoughForIgnoreMoveDelay;
-
-function setTimeoutPrefs(aTimeout, aIgnoreMoveDelay)
-{
- gPrefSvc.setIntPref(kPrefNameTimeout, aTimeout);
- gPrefSvc.setIntPref(kPrefNameIgnoreMoveDelay, aIgnoreMoveDelay);
- gTimeout = aTimeout;
- gIgnoreMoveDelay = aIgnoreMoveDelay;
- gEnoughForTimeout = gTimeout * 2;
- gEnoughForIgnoreMoveDelay = gIgnoreMoveDelay * 1.2;
-}
-
-function resetTimeoutPrefs()
-{
- if (gTimeout == kDefaultTimeout)
- return;
- setTimeoutPrefs(kDefaultTimeout, kDefaultIgnoreMoveDelay);
- initTestList();
-}
-
-function growUpTimeoutPrefs()
-{
- if (gTimeout != kDefaultTimeout)
- return;
- setTimeoutPrefs(5000, 1000);
- initTestList();
-}
-
-// setting enough time for testing.
-gPrefSvc.setIntPref(kPrefNameTimeout, gTimeout);
-gPrefSvc.setIntPref(kPrefNameIgnoreMoveDelay, gIgnoreMoveDelay);
-
-var gRootView = document.getElementById("rootview");
-var gSubView1 = document.getElementById("subview1");
-var gSubView2 = document.getElementById("subview2");
-var gSubView3 = document.getElementById("subview3");
-
-gRootView.addEventListener("MozMouseScrollFailed", onMouseScrollFailed, false);
-gRootView.addEventListener("MozMouseScrollTransactionTimeout",
- onTransactionTimeout, false);
-
-function finish()
-{
- window.close();
-}
-
-function onload()
-{
- runNextTestList();
-}
-
-function onunload()
-{
- resetTimeoutPrefs();
- gPrefSvc.clearUserPref(kPrefSmoothScroll);
- gPrefSvc.clearUserPref(kPrefTestEventsAsyncEnabled);
- disableNonTestMouseEvents(false);
- SpecialPowers.DOMWindowUtils.restoreNormalRefresh();
- window.opener.wrappedJSObject.SimpleTest.finish();
-}
-
-const kSubView1Offset = { x: 20, y: 20 };
-const kSubView2Offset = { x: 20, y: 20 + 100 + 20 };
-const kSubView3Offset = { x: 20, y: 20 + (100 + 20) * 2 };
-
-function _getSubViewTestPtForV(aPt)
-{
- return { x: aPt.x + 10, y: aPt.y + 10 };
-}
-
-const kPtInRootViewForV = { x: kSubView1Offset.x + 10,
- y: kSubView1Offset.y - 10 };
-const kPtInSubView1ForV = _getSubViewTestPtForV(kSubView1Offset);
-const kPtInSubView2ForV = _getSubViewTestPtForV(kSubView2Offset);
-const kPtInSubView3ForV = _getSubViewTestPtForV(kSubView3Offset);
-
-function _convertTestPtForH(aPt)
-{
- return { x: aPt.y, y: aPt.x };
-}
-
-const kPtInRootViewForH = _convertTestPtForH(kPtInRootViewForV);
-const kPtInSubView1ForH = _convertTestPtForH(kPtInSubView1ForV);
-const kPtInSubView2ForH = _convertTestPtForH(kPtInSubView2ForV);
-const kPtInSubView3ForH = _convertTestPtForH(kPtInSubView3ForV);
-
-/**
- * Define the tests here:
- * Scrolls are processed async always. Therefore, we need to call all tests
- * by timer. gTestLists is array of testing lists. In other words, an item
- * of gTestList is a group of one or more testing. Each items has following
- * properties:
- *
- * - retryWhenTransactionTimeout
- * The testing of wheel transaction might be fialed randomly by
- * timeout. Then, automatically the failed test list will be retested
- * automatically only this number of times.
- *
- * - steps
- * This property is array of testing. Each steps must have following
- * properties at least.
- *
- * - func
- * This property means function which will be called via
- * |setTimeout|. The function cannot have params. If you need
- * some additional parameters, you can specify some original
- * properties for the test function. If you do so, you should
- * document it in the testing function.
- * - delay
- * This property means delay time until the function to be called.
- * I.e., the value used for the second param of |setTimeout|.
- *
- * And also you need one more property when you call a testing function.
- *
- * - description
- * This property is description of the test. This is used for
- * logging.
- *
- * At testing, you can access to current step via |gCurrentTest|.
- */
-
-var gTestLists;
-function initTestList()
-{
- gTestLists = [
- /**************************************************************************
- * Continuous scrolling test for |gRootView|
- * |gRootView| has both scrollbars and it has three children which are
- * |gSubView1|, |gSubView2| and |gSubView3|. They have scrollbars. If
- * the current transaction targets |gRootView|, other children should not
- * be scrolled even if the wheel events are fired on them.
- **************************************************************************/
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Vertical case
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Vertical wheel events should scroll |gRootView| even if the position
- // of wheel events in a child view which has scrollbar.
- { func: testContinuousScroll, delay: 0, offset: kPtInRootViewForV,
- isForward: true, isVertical: true, expectedView: gRootView,
- description: "Continuous scrolling test for root view (vertical/forward)" },
- { func: testContinuousScroll, delay: 0, offset: kPtInRootViewForV,
- isForward: false, isVertical: true, expectedView: gRootView,
- description: "Continuous scrolling test for root view (vertical/backward)" }
- ]
- },
-
-
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Horizontal case
- { func: initElements, delay: 0, forVertical: false,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Horizontal wheel events should scroll |gRootView| even if the
- // position of wheel events in a child view which has scrollbar.
- { func: testContinuousScroll, delay: 0, offset: kPtInRootViewForH,
- isForward: true, isVertical: false, expectedView: gRootView,
- description: "Continuous scrolling test for root view (horizontal/forward)" },
- { func: testContinuousScroll, delay: 0, offset: kPtInRootViewForH,
- isForward: false, isVertical: false, expectedView: gRootView,
- description: "Continuous scrolling test for root view (horizontal/backward)" }
- ]
- },
-
-
- /**************************************************************************
- * Continuous scrolling test for |gSubView1|
- * |gSubView1| has both scrollbars.
- **************************************************************************/
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Vertical case
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Vertical wheel events should scroll |gSubView1|.
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gSubView1,
- description: "Continuous scrolling test for sub view 1 (vertical/forward)" },
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: false, isVertical: true, expectedView: gSubView1,
- description: "Continuous scrolling test for sub view 1 (vertical/backward)" }
- ]
- },
-
-
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Horizontal case
- { func: initElements, delay: 0, forVertical: false,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Horitontal wheel events should scroll |gSubView1|.
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: true, isVertical: false, expectedView: gSubView1,
- description: "Continuous scrolling test for sub view 1 (horizontal/forward)" },
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: false, isVertical: false, expectedView: gSubView1,
- description: "Continuous scrolling test for sub view 1 (horizontal/backward)" }
- ]
- },
-
-
- /**************************************************************************
- * Continuous scrolling test for |gSubView2|
- * |gSubView2| has only vertical scrollbar.
- **************************************************************************/
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Vertical case
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Vertical wheel events should scroll |gSubView2|.
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView2ForV,
- isForward: true, isVertical: true, expectedView: gSubView2,
- description: "Continuous scrolling test for sub view 2 (vertical/forward)" },
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView2ForV,
- isForward: false, isVertical: true, expectedView: gSubView2,
- description: "Continuous scrolling test for sub view 2 (vertical/backward)" }
- ]
- },
-
-
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Horizontal case
- { func: initElements, delay: 0, forVertical: false,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Horizontal wheel events should scroll its nearest scrollable ancestor
- // view, i.e., it is |gRootView|.
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView2ForH,
- isForward: true, isVertical: false, expectedView: gRootView,
- description: "Continuous scrolling test for sub view 2 (horizontal/forward)" },
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView2ForH,
- isForward: false, isVertical: false, expectedView: gRootView,
- description: "Continuous scrolling test for sub view 2 (horizontal/backward)" }
- ]
- },
-
-
- /**************************************************************************
- * Continuous scrolling test for |gSubView3|
- * |gSubView3| has only horizontal scrollbar.
- **************************************************************************/
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Vertical case
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Vertical wheel events should scroll its nearest scrollable ancestor
- // view, i.e., it is |gRootView|.
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView3ForV,
- isForward: true, isVertical: true, expectedView: gRootView,
- description: "Continuous scrolling test for sub view 3 (vertical/forward)" },
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView3ForV,
- isForward: false, isVertical: true, expectedView: gRootView,
- description: "Continuous scrolling test for sub view 3 (vertical/backward)" }
- ]
- },
-
-
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Horizontal case
- { func: initElements, delay: 0, forVertical: false,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Horitontal wheel events should scroll |gSubView3|.
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView3ForH,
- isForward: true, isVertical: false, expectedView: gSubView3,
- description: "Continuous scrolling test for sub view 3 (horizontal/forward)" },
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView3ForH,
- isForward: false, isVertical: false, expectedView: gSubView3,
- description: "Continuous scrolling test for sub view 3 (horizontal/backward)" }
- ]
- },
-
-
- /**************************************************************************
- * Don't reset transaction by a different direction wheel event
- * Even if a wheel event doesn't same direction as last wheel event, the
- * current transaction should not be reset.
- **************************************************************************/
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Vertical -> Horizontal
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Create a transaction which targets |gRootView| by a vertical wheel
- // event.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForV,
- isForward: true, isVertical: true, expectedView: gRootView,
- description: "Don't reset transaction by a different direction wheel event (1-1)" },
- // Scroll back to top-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForV,
- isForward: false, isVertical: true, expectedView: gRootView,
- description: "Don't reset transaction by a different direction wheel event (1-2)" },
- // Send a horizontal wheel event over |gSubView1| but |gRootView| should
- // be scrolled.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: false, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Don't reset transaction by a different direction wheel event (1-3)" }
- ]
- },
-
-
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Horizontal -> Vertical
- { func: initElements, delay: 0, forVertical: false,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Create a transaction which targets |gRootView| by a horizontal wheel
- // event.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForH,
- isForward: true, isVertical: false, expectedView: gRootView,
- description: "Don't reset transaction by a different direction wheel event (2-1)" },
- // Scroll back to left-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForH,
- isForward: false, isVertical: false, expectedView: gRootView,
- description: "Don't reset transaction by a different direction wheel event (2-2)" },
- // Send a vertical wheel event over |gSubView1| but |gRootView| should
- // be scrolled.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: true, isVertical: true, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Don't reset transaction by a different direction wheel event (2-3)" }
- ]
- },
-
-
- /**************************************************************************
- * Don't reset transaction even if a wheel event cannot scroll
- * Even if a wheel event cannot scroll to specified direction in the
- * current target view, the transaction should not be reset. E.g., there
- * are some devices which can scroll obliquely. If so, probably, users
- * cannot input only intended direction.
- **************************************************************************/
- { retryWhenTransactionTimeout: 5,
- steps: [
- // A view only has vertical scrollbar case.
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Create a transaction which targets |gSubView2|.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView2ForV,
- isForward: true, isVertical: true, expectedView: gSubView2,
- description: "Don't reset transaction even if a wheel event cannot scroll (1-1)" },
- // |gSubView2| doesn't have horizontal scrollbar but should not scroll
- // any views.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView2ForV,
- isForward: true, isVertical: false, expectedView: null,
- description: "Don't reset transaction even if a wheel event cannot scroll (1-2)" }
- ]
- },
-
-
- { retryWhenTransactionTimeout: 5,
- steps: [
- // A view only has horizontal scrollbar case.
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Create a transaction which targets |gSubView3|.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView3ForV,
- isForward: true, isVertical: false, expectedView: gSubView3,
- description: "Don't reset transaction even if a wheel event cannot scroll (2-1)" },
- // |gSubView3| doesn't have vertical scrollbar but should not scroll any
- // views.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView3ForV,
- isForward: true, isVertical: true, expectedView: null,
- description: "Don't reset transaction even if a wheel event cannot scroll (2-2)" }
- ]
- },
-
-
- /**************************************************************************
- * Reset transaction by mouse down/mouse up events
- * Mouse down and mouse up events should cause resetting the current
- * transaction.
- **************************************************************************/
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Vertical case
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Create a transaction which targets |gRootView|.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForV,
- isForward: true, isVertical: true, expectedView: gRootView,
- description: "Reset transaction by mouse down/mouse up events (v-1)" },
- // Scroll back to top-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForV,
- isForward: false, isVertical: true, expectedView: gRootView,
- description: "Reset transaction by mouse down/mouse up events (v-2)" },
- // Send mouse button events which should reset the current transaction.
- // So, the next wheel event should scroll |gSubView1|.
- { func: sendMouseButtonEvents, delay: 0,
- description: "sendMouseButtonEvents" },
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gSubView1,
- description: "Reset transaction by mouse down/mouse up events (v-3)" }
- ]
- },
-
-
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Horizontal case
- { func: initElements, delay: 0, forVertical: false,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Create a transaction which targets |gRootView|.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForH,
- isForward: true, isVertical: false, expectedView: gRootView,
- description: "Reset transaction by mouse down/mouse up events (h-1)" },
- // Scroll back to left-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForH,
- isForward: false, isVertical: false, expectedView: gRootView,
- description: "Reset transaction by mouse down/mouse up events (h-2)" },
- // Send mouse button events which should reset the current transaction.
- // So, the next wheel event should scroll |gSubView1|.
- { func: sendMouseButtonEvents, delay: 0,
- description: "sendMouseButtonEvents" },
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: true, isVertical: false, expectedView: gSubView1,
- description: "Reset transaction by mouse down/mouse up events (h-3)" }
- ]
- },
-
-
- /**************************************************************************
- * Reset transaction by a key event
- * A key event should cause resetting the current transaction.
- **************************************************************************/
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Vertical case
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Create a transaction which targets |gRootView|.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForV,
- isForward: true, isVertical: true, expectedView: gRootView,
- description: "Reset transaction by a key event (v-1)" },
- // Scroll back to top-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForV,
- isForward: false, isVertical: true, expectedView: gRootView,
- description: "Reset transaction by a key event (v-2)" },
- // Send a key event which should reset the current transaction. So, the
- // next wheel event should scroll |gSubView1|.
- { func: sendKeyEvents, delay: 0, key: "a",
- description: "sendKeyEvents" },
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gSubView1,
- description: "Reset transaction by a key event (v-3)" }
- ]
- },
-
-
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Horizontal case
- { func: initElements, delay: 0, forVertical: false,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Create a transaction which targets |gRootView|.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForH,
- isForward: true, isVertical: false, expectedView: gRootView,
- description: "Reset transaction by a key event (h-1)" },
- // Scroll back to left-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForH,
- isForward: false, isVertical: false, expectedView: gRootView,
- description: "Reset transaction by a key event (h-2)" },
- // Send a key event which should reset the current transaction. So, the
- // next wheel event should scroll |gSubView1|.
- { func: sendKeyEvents, delay: 0, key: "a",
- description: "sendKeyEvents" },
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: true, isVertical: false, expectedView: gSubView1,
- description: "Reset transaction by a key event (h-3)" }
- ]
- },
-
-
- /**************************************************************************
- * Reset transaction by a mouse move event
- * A mouse move event can cause reseting the current transaction even if
- * mouse cursor is inside the target view of current transaction. Only
- * when a wheel event is fired after |gIgnoreMoveDelay| milliseconds since
- * the first mouse move event from last wheel event, the transaction
- * should be reset.
- **************************************************************************/
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Vertical case
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Create a transaction which targets |gRootView|.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForV,
- isForward: true, isVertical: true, expectedView: gRootView,
- description: "Reset transaction by a mouse move event (v-1)" },
- // Scroll back to top-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForV,
- isForward: false, isVertical: true, expectedView: gRootView,
- description: "Reset transaction by a mouse move event (v-2)" },
- // Send a mouse move event immediately after last wheel event, then,
- // current transaction should be kept.
- { func: sendMouseMoveEvent, delay: 0, offset: kPtInSubView1ForV,
- description: "sendMouseMoveEvent" },
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (v-3)" },
- // Scroll back to top-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: false, isVertical: true, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (v-4)" },
- // Send a mouse move event after |gIgnoreMoveDelay| milliseconds since
- // last wheel event, then, current transaction should be kept.
- { func: sendMouseMoveEvent, delay: gEnoughForIgnoreMoveDelay,
- offset: kPtInSubView1ForV,
- description: "sendMouseMoveEvent" },
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (v-5)" },
- // Scroll back to top-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: false, isVertical: true, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (v-6)" },
- // Send a wheel event after |gIgnoreMoveDelay| milliseconds since last
- // mouse move event but it is fired immediately after the last wheel
- // event, then, current transaction should be kept.
- { func: sendMouseMoveEvent, delay: 0, offset: kPtInSubView1ForV,
- description: "sendMouseMoveEvent" },
- { func: testOneTimeScroll, delay: gEnoughForIgnoreMoveDelay,
- offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (v-7)" },
- // Scroll back to top-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: false, isVertical: true, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (v-8)" },
- // Send a wheel event after |gIgnoreMoveDelay| milliseconds have passed
- // since last mouse move event which is fired after |gIgnoreMoveDelay|
- // milliseconds since last wheel event, then, current transaction should
- // be reset.
- { func: sendMouseMoveEvent, delay: gEnoughForIgnoreMoveDelay,
- offset: kPtInSubView1ForV,
- description: "sendMouseMoveEvent" },
- { func: testOneTimeScroll, delay: gEnoughForIgnoreMoveDelay,
- offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gSubView1,
- canFailRandomly: { possibleView: gRootView },
- description: "Reset transaction by a mouse move event (v-9)" }
- ]
- },
-
-
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Horizontal case
- { func: initElements, delay: 0, forVertical: false,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Create a transaction which targets |gRootView|.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForH,
- isForward: true, isVertical: false, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (h-1)" },
- // Scroll back to top-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForH,
- isForward: false, isVertical: false, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (h-2)" },
- // Send a mouse move event immediately after last wheel event, then,
- // current transaction should be kept.
- { func: sendMouseMoveEvent, delay: 0, offset: kPtInSubView1ForH,
- description: "sendMouseMoveEvent" },
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: true, isVertical: false, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (h-3)" },
- // Scroll back to top-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: false, isVertical: false, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (h-4)" },
- // Send a mouse move event after |gIgnoreMoveDelay| milliseconds since
- // last wheel event, then, current transaction should be kept.
- { func: sendMouseMoveEvent, delay: gEnoughForIgnoreMoveDelay,
- offset: kPtInSubView1ForH,
- description: "sendMouseMoveEvent" },
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: true, isVertical: false, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (h-5)" },
- // Scroll back to top-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: false, isVertical: false, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (h-6)" },
- // Send a wheel event after |gIgnoreMoveDelay| milliseconds since last
- // mouse move event but it is fired immediately after the last wheel
- // event, then, current transaction should be kept.
- { func: sendMouseMoveEvent, delay: 0, offset: kPtInSubView1ForH,
- description: "sendMouseMoveEvent" },
- { func: testOneTimeScroll, delay: gEnoughForIgnoreMoveDelay,
- offset: kPtInSubView1ForH,
- isForward: true, isVertical: false, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (h-7)" },
- // Scroll back to top-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: false, isVertical: false, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Reset transaction by a mouse move event (h-8)" },
- // Send a wheel event after |gIgnoreMoveDelay| milliseconds have passed
- // since last mouse move event which is fired after |gIgnoreMoveDelay|
- // milliseconds since last wheel event, then, current transaction should
- // be reset.
- { func: sendMouseMoveEvent, delay: gEnoughForIgnoreMoveDelay,
- offset: kPtInSubView1ForH,
- description: "sendMouseMoveEvent" },
- { func: testOneTimeScroll, delay: gEnoughForIgnoreMoveDelay,
- offset: kPtInSubView1ForH,
- isForward: true, isVertical: false, expectedView: gSubView1,
- canFailRandomly: { possibleView: gRootView },
- description: "Reset transaction by a mouse move event (h-9)" }
- ]
- },
-
-
- /**************************************************************************
- * Reset transaction by a mouse move event on outside of view
- * When mouse cursor is moved to outside of the current target view, the
- * transaction should be reset immediately.
- **************************************************************************/
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Vertical case
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Create a transaction which targets |gSubView1|.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gSubView1,
- description: "Reset transaction by a mouse move event on outside of view (v-1)" },
- // Send mouse move event over |gRootView|.
- { func: sendMouseMoveEvent, delay: 0, offset: kPtInRootViewForV,
- description: "sendMouseMoveEvent" },
- // Send Wheel event over |gRootView| which should be scrolled.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForV,
- isForward: true, isVertical: true, expectedView: gRootView,
- description: "Reset transaction by a mouse move event on outside of view (v-2)" }
- ]
- },
-
-
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Horizontal case
- { func: initElements, delay: 0, forVertical: false,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Create a transaction which targets |gSubView1|.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: true, isVertical: true, expectedView: gSubView1,
- description: "Reset transaction by a mouse move event on outside of view (h-1)" },
- // Send mouse move event over |gRootView|.
- { func: sendMouseMoveEvent, delay: 0, offset: kPtInRootViewForH,
- description: "sendMouseMoveEvent" },
- // Send Wheel event over |gRootView| which should be scrolled.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForH,
- isForward: true, isVertical: true, expectedView: gRootView,
- description: "Reset transaction by a mouse move event on outside of view (h-2)" }
- ]
- },
-
-
- /**************************************************************************
- * Timeout test
- * A view should not be scrolled during another to be transaction for
- * another view scrolling. However, a wheel event which is sent after
- * timeout, a view which is under the mouse cursor should be scrolled.
- **************************************************************************/
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Vertical case
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // First, create a transaction which should target the |gRootView|.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForV,
- isForward: true, isVertical: true, expectedView: gRootView,
- description: "Timeout test (v-1)" },
- // Scroll back to top-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForV,
- isForward: false, isVertical: true, expectedView: gRootView,
- description: "Timeout test (v-2)" },
- // A wheel event over |gSubView1| should not scroll it during current
- // transaction.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Timeout test (v-3)" },
- // Scroll back to top-most again.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: false, isVertical: true, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Timeout test (v-4)" },
- // A wheel event over |gSubView1| after timeout should scroll
- // |gSubView1|.
- { func: testOneTimeScroll, delay: gEnoughForTimeout,
- offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gSubView1,
- isTimeoutTesting: true,
- description: "Timeout test (v-5)" }
- ]
- },
-
-
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Horizontal case
- { func: initElements, delay: 0, forVertical: false,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // First, create a transaction which should target the |gRootView|.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForH,
- isForward: true, isVertical: false, expectedView: gRootView,
- description: "Timeout test (h-1)" },
- // Scroll back to left-most for easy cursor position specifying.
- { func: testOneTimeScroll, delay: 0, offset: kPtInRootViewForH,
- isForward: false, isVertical: false, expectedView: gRootView,
- description: "Timeout test (h-2)" },
- // A wheel event over |gSubView1| should not scroll it during current
- // transaction.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: true, isVertical: false, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Timeout test (h-3)" },
- // Scroll back to left-most again.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: false, isVertical: false, expectedView: gRootView,
- canFailRandomly: { possibleView: gSubView1 },
- description: "Timeout test (h-4)" },
- // A wheel event over |gSubView1| after timeout should scroll
- // |gSubView1|.
- { func: testOneTimeScroll, delay: gEnoughForTimeout,
- offset: kPtInSubView1ForH,
- isForward: true, isVertical: false, expectedView: gSubView1,
- isTimeoutTesting: true,
- description: "Timeout test (h-5)" }
- ]
- },
-
-
- /**************************************************************************
- * Timeout test even with many wheel events
- * This tests whether timeout is occurred event if wheel events are sent.
- * The transaction should not be updated by non-scrollable wheel events.
- **************************************************************************/
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Vertical case
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Scroll |gSubView1| to bottom-most.
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gSubView1,
- description: "Timeout test even with many wheel events (v-1)" },
- // Don't scroll any views before timeout.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: null,
- canFailRandomly: { possibleView: gRootView },
- description: "Timeout test even with many wheel events (v-2)" },
- // Recreate a transaction which is scrolling |gRootView| after time out.
- { func: testRestartScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gRootView,
- description: "Timeout test even with many wheel events (v-3)" }
- ]
- },
-
-
- { retryWhenTransactionTimeout: 5,
- steps: [
- // Horizontal case
- { func: initElements, delay: 0, forVertical: false,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- // Scroll |gSubView1| to right-most.
- { func: testContinuousScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: true, isVertical: false, expectedView: gSubView1,
- description: "Timeout test even with many wheel events (h-1)" },
- // Don't scroll any views before timeout.
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: true, isVertical: false, expectedView: null,
- canFailRandomly: { possibleView: gRootView },
- description: "Timeout test even with many wheel events (h-2)" },
- // Recreate a transaction which is scrolling |gRootView| after time out.
- { func: testRestartScroll, delay: 0, offset: kPtInSubView1ForH,
- isForward: true, isVertical: false, expectedView: gRootView,
- description: "Timeout test even with many wheel events (h-3)" }
- ]
- },
-
-
- /**************************************************************************
- * Very large scrolling wheel event
- * If the delta value is larger than the scrolling page size, it should be
- * scrolled only one page instead of the delta value.
- **************************************************************************/
- { retryWhenTransactionTimeout: 5,
- steps: [
- { func: initElements, delay: 0, forVertical: true,
- description: "initElements" },
- { func: clearWheelTransaction, delay: 0,
- description: "clearWheelTransaction" },
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gSubView1,
- delta: 5000,
- description: "Very large delta scrolling (v-1)" },
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: true, expectedView: gSubView1,
- delta: 5000,
- description: "Very large delta scrolling (v-2)" },
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: false, expectedView: gSubView1,
- delta: 5000,
- description: "Very large delta scrolling (h-1)" },
- { func: testOneTimeScroll, delay: 0, offset: kPtInSubView1ForV,
- isForward: true, isVertical: false, expectedView: gSubView1,
- delta: 5000,
- description: "Very large delta scrolling (h-2)" }
- ]
- }
- ];
-}
-
-/******************************************************************************
- * Actions for preparing tests
- ******************************************************************************/
-
-function initElements()
-{
- _clearTimer();
-
- function resetScrollPosition(aElement)
- {
- aElement.scrollTop = 0;
- aElement.scrollLeft = 0;
- }
-
- function initInRootView(aElement, aPt)
- {
- aElement.offset =
- gCurrentTest.forVertical ? aPt : { x: aPt.y, y: aPt.x };
- }
-
- const kDisplay = gCurrentTest.forVertical ? "block" : "inline-block";
- gSubView1.style.display = kDisplay;
- gSubView2.style.display = kDisplay;
- gSubView3.style.display = kDisplay;
-
- resetScrollPosition(gRootView);
- resetScrollPosition(gSubView1);
- resetScrollPosition(gSubView2);
- resetScrollPosition(gSubView3);
- _getDOMWindowUtils(window).advanceTimeAndRefresh(0);
-
- runNextTestStep();
-}
-
-function clearWheelTransaction()
-{
- _clearTimer();
- _clearTransaction();
- runNextTestStep();
-}
-
-function sendKeyEvents()
-{
- _clearTimer();
- synthesizeKey(gCurrentTest.key, {}, window);
- runNextTestStep();
-}
-
-function sendMouseButtonEvents()
-{
- _clearTimer();
- synthesizeMouse(gRootView, -1, -1, { type:"mousedown" }, window);
- synthesizeMouse(gRootView, -1, -1, { type:"mouseup" }, window);
- runNextTestStep();
-}
-
-function sendMouseMoveEvent()
-{
- _clearTimer();
- _fireMouseMoveEvent(gCurrentTest.offset);
- runNextTestStep();
-}
-
-/******************************************************************************
- * Utilities for testing functions
- ******************************************************************************/
-
-function _clearTransaction()
-{
- synthesizeMouse(gRootView, -1, -1, { type:"mousedown" }, window);
- synthesizeMouse(gRootView, -1, -1, { type:"mouseup" }, window);
-}
-
-function _saveScrollPositions()
-{
- function save(aElement)
- {
- aElement.prevTop = aElement.scrollTop;
- aElement.prevLeft = aElement.scrollLeft;
- }
- save(gRootView);
- save(gSubView1);
- save(gSubView2);
- save(gSubView3);
-}
-
-function _fireMouseMoveEvent(aOffset)
-{
- synthesizeMouse(gRootView, aOffset.x, aOffset.y, { type:"mousemove" }, window);
-}
-
-function _fireWheelScrollEvent(aOffset, aIsVertical, aForward, aDelta)
-{
- var event = { deltaMode: WheelEvent.DOM_DELTA_LINE };
- if (aIsVertical) {
- event.deltaY = aForward ? aDelta : -aDelta;
- } else {
- event.deltaX = aForward ? aDelta : -aDelta;
- }
- sendWheelAndPaint(gRootView, aOffset.x, aOffset.y, event, null, window);
-}
-
-function _canScroll(aElement, aIsVertical, aForward)
-{
- if (aIsVertical) {
- if (!aForward)
- return aElement.scrollTop > 0;
- return aElement.scrollHeight > aElement.scrollTop + aElement.clientHeight;
- }
- if (!aForward)
- return aElement.scrollLeft > 0;
- return aElement.scrollWidth > aElement.scrollLeft + aElement.clientWidth;
-}
-
-const kNotScrolled = 0;
-const kScrolledToTop = 1;
-const kScrolledToBottom = 2;
-const kScrolledToLeft = 4;
-const kScrolledToRight = 8;
-
-const kScrolledVertical = kScrolledToTop | kScrolledToBottom;
-const kScrolledHorizontal = kScrolledToLeft | kScrolledToRight;
-
-function _getScrolledState(aElement)
-{
- var ret = kNotScrolled;
- if (aElement.scrollTop != aElement.prevTop) {
- ret |= aElement.scrollTop < aElement.prevTop ? kScrolledToTop :
- kScrolledToBottom;
- }
- if (aElement.scrollLeft != aElement.prevLeft) {
- ret |= aElement.scrollLeft < aElement.prevLeft ? kScrolledToLeft :
- kScrolledToRight;
- }
- return ret;
-}
-
-function _getExpectedScrolledState()
-{
- return gCurrentTest.isVertical ?
- gCurrentTest.isForward ? kScrolledToBottom : kScrolledToTop :
- gCurrentTest.isForward ? kScrolledToRight : kScrolledToLeft;
-}
-
-function _getScrolledStateText(aScrolledState)
-{
- if (aScrolledState == kNotScrolled)
- return "Not scrolled";
-
- var s = "scrolled to ";
- if (aScrolledState & kScrolledVertical) {
- s += aScrolledState & kScrolledToTop ? "backward" : "forward";
- s += " (vertical)"
- if (aScrolledState & kScrolledHorizontal)
- s += " and to ";
- }
- if (aScrolledState & kScrolledHorizontal) {
- s += aScrolledState & kScrolledToLeft ? "backward" : "forward";
- s += " (horizontal)"
- }
- return s;
-}
-
-function _getCurrentTestList()
-{
- return gTestLists[gCurrentTestListStatus.nextListIndex - 1];
-}
-
-function _clearTimer()
-{
- clearTimeout(gTimer);
- gTimer = 0;
-}
-
-/******************************************************************************
- * Testing functions
- ******************************************************************************/
-
-/**
- * Note that testing functions must set following variables:
- *
- * gCurrentTest.repeatTest: See comment in |continueTest|.
- * gCurrentTest.autoRepeatDelay: See comment in |continueTest|.
- * gListenScrollEvent: When this is not true, the event handlers ignores the
- * events.
- */
-
-function testContinuousScroll()
-{
- /**
- * Testing continuous scrolling. This function synthesizes a wheel event. If
- * the test was success, this function will be recalled automatically.
- * And when a generating wheel event cannot scroll the expected view, this
- * function fires the wheel event only one time.
- *
- * @param gCurrentTest.offset
- * The cursor position of firing wheel event. The values are offset
- * from |gRootView|.
- * @param gCurrentTest.isVertical
- * Whether the wheel event is for virtical scrolling or horizontal.
- * @param gCurrentTest.isForward
- * Whether the wheel event is to forward or to backward.
- * @param gCurrentTest.expectedView
- * The expected view which will be scrolled by wheel event. This
- * value must not be null.
- */
-
- _clearTimer();
- _saveScrollPositions();
- if (!gCurrentTest.expectedView) {
- runNextTestStep();
- return;
- }
-
- gLitesnEvents = kListenEvent_All;
- gCurrentTest.repeatTest = true;
- gCurrentTest.autoRepeatDelay = 0;
-
- if (!_canScroll(gCurrentTest.expectedView,
- gCurrentTest.isVertical, gCurrentTest.isForward)) {
- gCurrentTest.expectedView = null;
- }
- var delta = gCurrentTest.delta ? gCurrentTest.delta : 4;
- _fireWheelScrollEvent(gCurrentTest.offset,
- gCurrentTest.isVertical, gCurrentTest.isForward, delta);
-}
-
-function testOneTimeScroll()
-{
- /**
- * Testing one wheel event. |runNextTestStep| will be called immediately
- * after this function by |onScrollView| or |onTimeout|.
- *
- * @param gCurrentTest.offset
- * The cursor position of firing wheel event. The values are offset
- * from |gRootView|.
- * @param gCurrentTest.isVertical
- * Whether the wheel event is for virtical scrolling or horizontal.
- * @param gCurrentTest.isForward
- * Whether the wheel event is to forward or to backward.
- * @param gCurrentTest.expectedView
- * The expected view which will be scrolled by wheel event. This
- * value can be null. It means any views should not be scrolled.
- */
-
- _clearTimer();
- _saveScrollPositions();
-
- gLitesnEvents = kListenEvent_All;
- gCurrentTest.repeatTest = false;
- gCurrentTest.autoRepeatDelay = 0;
-
- var delta = gCurrentTest.delta ? gCurrentTest.delta : 4;
- _fireWheelScrollEvent(gCurrentTest.offset,
- gCurrentTest.isVertical, gCurrentTest.isForward, delta);
-}
-
-function testRestartScroll()
-{
- /**
- * Testing restart to scroll in expected view after timeout from the current
- * transaction. This function recall this itself until to success this test
- * or timeout from this test.
- *
- * @param gCurrentTest.offset
- * The cursor position of firing wheel event. The values are offset
- * from |gRootView|.
- * @param gCurrentTest.isVertical
- * Whether the wheel event is for virtical scrolling or horizontal.
- * @param gCurrentTest.isForward
- * Whether the wheel event is to forward or to backward.
- * @param gCurrentTest.expectedView
- * The expected view which will be scrolled by wheel event. This
- * value must not be null.
- */
-
- _clearTimer();
- _saveScrollPositions();
-
- if (!gCurrentTest.wasTransactionTimeout) {
- gCurrentTest.repeatTest = true;
- gCurrentTest.autoRepeatDelay = gTimeout / 3;
- gLitesnEvents = kListenEvent_All;
- gCurrentTest.isTimeoutTesting = true;
- if (gCurrentTest.expectedView) {
- gCurrentTest.expectedViewAfterTimeout = gCurrentTest.expectedView;
- gCurrentTest.expectedView = null;
- }
- } else {
- gCurrentTest.repeatTest = false;
- gCurrentTest.autoRepeatDelay = 0;
- gLitesnEvents = kListenEvent_All;
- gCurrentTest.isTimeoutTesting = false;
- gCurrentTest.expectedView = gCurrentTest.expectedViewAfterTimeout;
- }
-
- var delta = gCurrentTest.delta ? gCurrentTest.delta : 4;
- _fireWheelScrollEvent(gCurrentTest.offset,
- gCurrentTest.isVertical, gCurrentTest.isForward, delta);
-}
-
-/******************************************************************************
- * Event handlers
- ******************************************************************************/
-
-function onScrollView(aEvent)
-{
- /**
- * Scroll event handler of |gRootView|, |gSubView1|, |gSubView2| and
- * |gSubView3|. If testing is failed, this function cancels all left tests.
- * For checking the event is expected, the event firer must call
- * |_saveScrollPositions|.
- *
- * @param gCurrentTest.expectedView
- * The expected view which should be scrolled by the wheel event.
- * This value can be null. It means any views should not be
- * scrolled.
- * @param gCurrentTest.isVertical
- * The expected view should be scrolled vertical or horizontal.
- * @param gCurrentTest.isForward
- * The expected view should be scrolled to forward or backward.
- * @param gCurrentTest.canFailRandomly
- * If this is not undefined, this test can fail by unexpected view
- * scrolling which is caused by unexpected timeout. If this is
- * defined, |gCurrentTest.possibleView| must be set. If the view is
- * same as the event target, the failure can be random. At this
- * time, we should retry the current test list.
- */
-
- if (!(gLitesnEvents & kListenEvent_OnScroll))
- return;
-
- // Now testing a timeout, but a view is scrolled before timeout.
- if (gCurrentTest.isTimeoutTesting && !gCurrentTest.wasTransactionTimeout) {
- is(aEvent.target.id, "",
- "The view scrolled before timeout (the expected view after timeout is " +
- gCurrentTest.expectedView ? gCurrentTest.expectedView.id : "null" +
- "): " + gCurrentTest.description);
- runNextTestList();
- return;
- }
-
- // Check whether the scrolled event should be fired or not.
- if (!gCurrentTest.expectedView) {
- is(aEvent.target.id, "",
- "no views should be scrolled (" +
- _getScrolledStateText(_getScrolledState(aEvent.target)) + "): " +
- gCurrentTest.description);
- runNextTestList();
- return;
- }
-
- // Check whether the scrolled view is expected or not.
- if (aEvent.target != gCurrentTest.expectedView) {
- // If current test can fail randomly and the possible view is same as the
- // event target, this failure may be caused by unexpected timeout.
- // At this time, we should retry the current tests with slower settings.
- if (gCurrentTest.canFailRandomly &&
- gCurrentTest.canFailRandomly.possibleView == aEvent.target &&
- gCurrentTestListStatus.retryWhenTransactionTimeout > 0) {
- gCurrentTestListStatus.retryWhenTransactionTimeout--;
- retryCurrentTestList();
- return;
- }
- is(aEvent.target.id, gCurrentTest.expectedView.id,
- "wrong view was scrolled: " + gCurrentTest.description);
- runNextTestList();
- return;
- }
-
- // Check whether the scrolling direction is expected or not.
- var expectedState = _getExpectedScrolledState();
- var currentState = _getScrolledState(aEvent.target);
- if (expectedState != currentState) {
- is(_getScrolledStateText(currentState),
- _getScrolledStateText(expectedState),
- "scrolled to wrong direction: " + gCurrentTest.description);
- runNextTestList();
- return;
- }
-
- ok(true, "passed: " + gCurrentTest.description);
- continueTest();
-}
-
-function onMouseScrollFailed()
-{
- /**
- * Scroll failed event handler. If testing is failed, this function cancels
- * all remains of current test-list, and go to next test-list.
- *
- * NOTE: This event is fired immediately after |_fireWheelScrollEvent|.
- *
- * @param gCurrentTest.expectedView
- * The expected view which should be scrolled by the wheel event.
- * This value can be null. It means any views should not be
- * scrolled. When this is not null, this event means the test may
- * be failed.
- */
-
- if (!(gLitesnEvents & kListenEvent_OnScrollFailed))
- return;
-
- ok(!gCurrentTest.expectedView,
- "failed to scroll on current target: " + gCurrentTest.description);
- if (gCurrentTest.expectedView) {
- runNextTestList();
- return;
- }
-
- continueTest();
-}
-
-function onTransactionTimeout()
-{
- /**
- * Scroll transaction timeout event handler. If the timeout is unexpected,
- * i.e., |gCurrentTest.isTimeoutTesting| is not true, this function retry
- * the current test-list. However, if the current test-list failed by timeout
- * |gCurrentTestListStatus.retryWhenTransactionTimeout| times already, marking
- * to failed the current test-list, and go to next test-list.
- *
- * @param gCurrentTest.expectedView
- * The expected view which should be scrolled by the wheel event.
- * This value can be null. It means any views should not be
- * scrolled. When this is not null, this event means the testing may
- * be failed.
- * @param gCurrentTest.isTimeoutTesting
- * If this value is true, the current testing have waited this
- * event. Otherwise, the testing may be failed.
- * @param gCurrentTestListStatus.retryWhenTransactionTimeout
- * If |gCurrentTest.isTimeoutTesting| is not true but this event is
- * fired, the failure may be randomly. Then, this event handler
- * retry to test the current test-list until this cound will be zero.
- */
-
- if (!gCurrentTest.isTimeoutTesting &&
- gCurrentTestListStatus.retryWhenTransactionTimeout > 0) {
- gCurrentTestListStatus.retryWhenTransactionTimeout--;
- // retry current test list
- retryCurrentTestList();
- return;
- }
-
- gCurrentTest.wasTransactionTimeout = true;
-
- if (!(gLitesnEvents & kListenEvent_OnTransactionTimeout))
- return;
-
- ok(gCurrentTest.isTimeoutTesting,
- "transaction timeout: " + gCurrentTest.description);
- if (!gCurrentTest.isTimeoutTesting) {
- runNextTestList();
- return;
- }
-
- continueTest();
-}
-
-/******************************************************************************
- * Main function for this tests
- ******************************************************************************/
-
-function runNextTestStep()
-{
- // When this is first time or the current test list is finised, load next
- // test-list.
- _clearTimer();
- if (!gCurrentTest)
- runNextTestList();
- else
- runTestStepAt(gCurrentTestListStatus.nextStepIndex);
-}
-
-function runNextTestList()
-{
- _clearTimer();
-
- gLitesnEvents = kListenEvent_None;
- _clearTransaction();
- resetTimeoutPrefs();
- if (gCurrentTestListStatus.nextListIndex >= gTestLists.length) {
- finish();
- return;
- }
-
- gCurrentTestListStatus.nextListIndex++;
- gCurrentTestListStatus.retryWhenTransactionTimeout =
- _getCurrentTestList().retryWhenTransactionTimeout;
- runTestStepAt(0);
-}
-
-function runTestStepAt(aStepIndex)
-{
- _clearTimer();
-
- disableNonTestMouseEvents(true);
-
- // load a step of testing.
- gCurrentTestListStatus.nextStepIndex = aStepIndex;
- gCurrentTest =
- _getCurrentTestList().steps[gCurrentTestListStatus.nextStepIndex++];
- if (gCurrentTest) {
- gCurrentTest.wasTransactionTimeout = false;
- gTimer = setTimeout(gCurrentTest.func, gCurrentTest.delay);
- } else {
- // If current test-list doesn't have more testing, go to next test-list
- // after cleaning up the current transaction.
- _clearTransaction();
- runNextTestList();
- }
-}
-
-function retryCurrentTestList()
-{
- _clearTimer();
-
- gLitesnEvents = kListenEvent_None;
- _clearTransaction();
- ok(true, "WARNING: retry current test-list...");
- growUpTimeoutPrefs(); // retry the test with longer timeout settings.
- runTestStepAt(0);
-}
-
-function continueTest()
-{
- /**
- * This function is called from an event handler when a test succeeded.
- *
- * @param gCurrentTest.repeatTest
- * When this is true, onScrollView calls |gCurrentTest.func|. So,
- * same test can repeat. Otherwise, this calls |runNextTestStep|.
- * @param gCurrentTest.autoRepeatDelay
- * The delay value in milliseconds, this is used to call
- * |gCurrentTest.func| via |setTimeout|.
- */
-
- _clearTimer();
- gLitesnEvents = kListenEvent_OnTransactionTimeout;
-
- // We should call each functions via setTimeout. Because sometimes this test
- // is broken by stack overflow.
- if (gCurrentTest.repeatTest) {
- gTimer = setTimeout(gCurrentTest.func, gCurrentTest.autoRepeatDelay);
- } else {
- gTimer = setTimeout(runNextTestStep, 0);
- }
-}
-
-]]>
-</script>
-
-</window>
diff --git a/xpcom/base/nsConsoleService.cpp b/xpcom/base/nsConsoleService.cpp
index 3862a02c4..fccb8370f 100644
--- a/xpcom/base/nsConsoleService.cpp
+++ b/xpcom/base/nsConsoleService.cpp
@@ -26,10 +26,6 @@
#include "mozilla/Preferences.h"
-#if defined(ANDROID)
-#include <android/log.h>
-#include "mozilla/dom/ContentChild.h"
-#endif
#ifdef XP_WIN
#include <windows.h>
#endif
@@ -51,9 +47,6 @@ NS_IMPL_CI_INTERFACE_GETTER(nsConsoleService, nsIConsoleService, nsIObserver)
static bool sLoggingEnabled = true;
static bool sLoggingBuffered = true;
-#if defined(ANDROID)
-static bool sLoggingLogcat = true;
-#endif // defined(ANDROID)
nsConsoleService::MessageElement::~MessageElement()
{
@@ -132,9 +125,6 @@ public:
{
Preferences::AddBoolVarCache(&sLoggingEnabled, "consoleservice.enabled", true);
Preferences::AddBoolVarCache(&sLoggingBuffered, "consoleservice.buffered", true);
-#if defined(ANDROID)
- Preferences::AddBoolVarCache(&sLoggingLogcat, "consoleservice.logcat", true);
-#endif // defined(ANDROID)
nsCOMPtr<nsIObserverService> obs = mozilla::services::GetObserverService();
MOZ_ASSERT(obs);
@@ -238,43 +228,6 @@ nsConsoleService::LogMessageWithMode(nsIConsoleMessage* aMessage,
{
MutexAutoLock lock(mLock);
-#if defined(ANDROID)
- if (sLoggingLogcat && aOutputMode == OutputToLog) {
- nsCString msg;
- aMessage->ToString(msg);
-
- /** Attempt to use the process name as the log tag. */
- mozilla::dom::ContentChild* child =
- mozilla::dom::ContentChild::GetSingleton();
- nsCString appName;
- if (child) {
- child->GetProcessName(appName);
- } else {
- appName = "GeckoConsole";
- }
-
- uint32_t logLevel = 0;
- aMessage->GetLogLevel(&logLevel);
-
- android_LogPriority logPriority = ANDROID_LOG_INFO;
- switch (logLevel) {
- case nsIConsoleMessage::debug:
- logPriority = ANDROID_LOG_DEBUG;
- break;
- case nsIConsoleMessage::info:
- logPriority = ANDROID_LOG_INFO;
- break;
- case nsIConsoleMessage::warn:
- logPriority = ANDROID_LOG_WARN;
- break;
- case nsIConsoleMessage::error:
- logPriority = ANDROID_LOG_ERROR;
- break;
- }
-
- __android_log_print(logPriority, appName.get(), "%s", msg.get());
- }
-#endif
#ifdef XP_WIN
if (IsDebuggerPresent()) {
nsString msg;
diff --git a/xpcom/base/nsConsoleService.h b/xpcom/base/nsConsoleService.h
index 089de8106..0aad5ccf4 100644
--- a/xpcom/base/nsConsoleService.h
+++ b/xpcom/base/nsConsoleService.h
@@ -45,8 +45,7 @@ public:
}
// This is a variant of LogMessage which allows the caller to determine
- // if the message should be output to an OS-specific log. This is used on
- // B2G to control whether the message is logged to the android log or not.
+ // if the message should be output to an OS-specific log.
enum OutputMode {
SuppressLog,
diff --git a/xpcom/base/nsDebugImpl.cpp b/xpcom/base/nsDebugImpl.cpp
index 84ba150db..313126e8a 100644
--- a/xpcom/base/nsDebugImpl.cpp
+++ b/xpcom/base/nsDebugImpl.cpp
@@ -19,10 +19,6 @@
#include "prerr.h"
#include "prenv.h"
-#ifdef ANDROID
-#include <android/log.h>
-#endif
-
#ifdef _WIN32
/* for getenv() */
#include <stdlib.h>
@@ -357,10 +353,6 @@ NS_DebugBreak(uint32_t aSeverity, const char* aStr, const char* aExpr,
}
#endif
-#ifdef ANDROID
- __android_log_print(ANDROID_LOG_INFO, "Gecko", "%s", buf.buffer);
-#endif
-
// Write the message to stderr unless it's a warning and MOZ_IGNORE_WARNINGS
// is set.
if (!(PR_GetEnv("MOZ_IGNORE_WARNINGS") && aSeverity == NS_DEBUG_WARNING)) {
diff --git a/xpcom/base/nsDumpUtils.cpp b/xpcom/base/nsDumpUtils.cpp
index c68862d08..bef5b6fda 100644
--- a/xpcom/base/nsDumpUtils.cpp
+++ b/xpcom/base/nsDumpUtils.cpp
@@ -343,12 +343,6 @@ FifoWatcher::OpenFd()
return -1;
}
-#ifdef ANDROID
- // Android runs with a umask, so we need to chmod our fifo to make it
- // world-writable.
- chmod(path.get(), 0666);
-#endif
-
int fd;
do {
// The fifo will block until someone else has written to it. In
@@ -428,23 +422,11 @@ FifoWatcher::OnFileCanReadWithoutBlocking(int aFd)
#endif // XP_UNIX }
-// In Android case, this function will open a file named aFilename under
-// /data/local/tmp/"aFoldername".
-// Otherwise, it will open a file named aFilename under "NS_OS_TEMP_DIR".
+// This will open a file named aFilename under "NS_OS_TEMP_DIR".
/* static */ nsresult
nsDumpUtils::OpenTempFile(const nsACString& aFilename, nsIFile** aFile,
const nsACString& aFoldername, Mode aMode)
{
-#ifdef ANDROID
- // For Android, first try the downloads directory which is world-readable
- // rather than the temp directory which is not.
- if (!*aFile) {
- char* env = PR_GetEnv("DOWNLOADS_DIRECTORY");
- if (env) {
- NS_NewNativeLocalFile(nsCString(env), /* followLinks = */ true, aFile);
- }
- }
-#endif
nsresult rv;
if (!*aFile) {
rv = NS_GetSpecialDirectory(NS_OS_TEMP_DIR, aFile);
@@ -453,32 +435,6 @@ nsDumpUtils::OpenTempFile(const nsACString& aFilename, nsIFile** aFile,
}
}
-#ifdef ANDROID
- // /data/local/tmp is a true tmp directory; anyone can create a file there,
- // but only the user which created the file can remove it. We want non-root
- // users to be able to remove these files, so we write them into a
- // subdirectory of the temp directory and chmod 777 that directory.
- if (aFoldername != EmptyCString()) {
- rv = (*aFile)->AppendNative(aFoldername);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- // It's OK if this fails; that probably just means that the directory
- // already exists.
- Unused << (*aFile)->Create(nsIFile::DIRECTORY_TYPE, 0777);
-
- nsAutoCString dirPath;
- rv = (*aFile)->GetNativePath(dirPath);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- while (chmod(dirPath.get(), 0777) == -1 && errno == EINTR) {
- }
- }
-#endif
-
nsCOMPtr<nsIFile> file(*aFile);
rv = file->AppendNative(aFilename);
@@ -495,19 +451,5 @@ nsDumpUtils::OpenTempFile(const nsACString& aFilename, nsIFile** aFile,
return rv;
}
-#ifdef ANDROID
- // Make this file world-read/writable; the permissions passed to the
- // CreateUnique call above are not sufficient on Android, which runs with a
- // umask.
- nsAutoCString path;
- rv = file->GetNativePath(path);
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-
- while (chmod(path.get(), 0666) == -1 && errno == EINTR) {
- }
-#endif
-
return NS_OK;
}
diff --git a/xpcom/base/nsDumpUtils.h b/xpcom/base/nsDumpUtils.h
index 12a99da18..9bca55927 100644
--- a/xpcom/base/nsDumpUtils.h
+++ b/xpcom/base/nsDumpUtils.h
@@ -19,12 +19,7 @@
#undef LOG
#endif
-#ifdef ANDROID
-#include "android/log.h"
-#define LOG(...) __android_log_print(ANDROID_LOG_INFO, "Gecko:DumpUtils", ## __VA_ARGS__)
-#else
#define LOG(...)
-#endif
#ifdef XP_UNIX // {
@@ -189,9 +184,8 @@ public:
/**
* This function creates a new unique file based on |aFilename| in a
- * world-readable temp directory. This is the system temp directory
- * or, in the case of Android, the downloads directory. If |aFile| is
- * non-null, it is assumed to point to a folder, and that folder is used
+ * world-readable temp directory. This is the system temp directory.
+ * If |aFile| is non-null, it is assumed to point to a folder, and that folder is used
* instead.
*/
static nsresult OpenTempFile(const nsACString& aFilename,
diff --git a/xpcom/base/nsMemoryImpl.cpp b/xpcom/base/nsMemoryImpl.cpp
index 1d1576fbd..b534e42f5 100644
--- a/xpcom/base/nsMemoryImpl.cpp
+++ b/xpcom/base/nsMemoryImpl.cpp
@@ -14,16 +14,6 @@
#include "nsCOMPtr.h"
#include "mozilla/Services.h"
-#ifdef ANDROID
-#include <stdio.h>
-
-// Minimum memory threshold for a device to be considered
-// a low memory platform. This value has be in sync with
-// Java's equivalent threshold, defined in
-// mobile/android/base/util/HardwareUtils.java
-#define LOW_MEMORY_THRESHOLD_KB (384 * 1024)
-#endif
-
static nsMemoryImpl sGlobalMemory;
NS_IMPL_QUERY_INTERFACE(nsMemoryImpl, nsIMemory)
@@ -37,31 +27,8 @@ nsMemoryImpl::HeapMinimize(bool aImmediate)
NS_IMETHODIMP
nsMemoryImpl::IsLowMemoryPlatform(bool* aResult)
{
-#ifdef ANDROID
- static int sLowMemory = -1; // initialize to unknown, lazily evaluate to 0 or 1
- if (sLowMemory == -1) {
- sLowMemory = 0; // assume "not low memory" in case file operations fail
- *aResult = false;
-
- // check if MemTotal from /proc/meminfo is less than LOW_MEMORY_THRESHOLD_KB
- FILE* fd = fopen("/proc/meminfo", "r");
- if (!fd) {
- return NS_OK;
- }
- uint64_t mem = 0;
- int rv = fscanf(fd, "MemTotal: %llu kB", &mem);
- if (fclose(fd)) {
- return NS_OK;
- }
- if (rv != 1) {
- return NS_OK;
- }
- sLowMemory = (mem < LOW_MEMORY_THRESHOLD_KB) ? 1 : 0;
- }
- *aResult = (sLowMemory == 1);
-#else
*aResult = false;
-#endif
+
return NS_OK;
}
diff --git a/xpcom/base/nsMemoryInfoDumper.cpp b/xpcom/base/nsMemoryInfoDumper.cpp
index afb18382d..c2371a1c0 100644
--- a/xpcom/base/nsMemoryInfoDumper.cpp
+++ b/xpcom/base/nsMemoryInfoDumper.cpp
@@ -576,13 +576,6 @@ public:
return rv;
}
- #ifdef ANDROID
- rv = reportsFinalFile->AppendNative(NS_LITERAL_CSTRING("memory-reports"));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
- #endif
-
rv = reportsFinalFile->AppendNative(mReportsFilename);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
@@ -748,9 +741,8 @@ nsMemoryInfoDumper::DumpMemoryInfoToTempDir(const nsAString& aIdentifier,
nsCOMPtr<nsIFile> reportsTmpFile;
nsresult rv;
- // In Android case, this function will open a file named aFilename under
- // specific folder (/data/local/tmp/memory-reports). Otherwise, it will
- // open a file named aFilename under "NS_OS_TEMP_DIR".
+
+ // This will open a file named aFilename under "NS_OS_TEMP_DIR".
rv = nsDumpUtils::OpenTempFile(NS_LITERAL_CSTRING("incomplete-") +
reportsFinalFilename,
getter_AddRefs(reportsTmpFile),
diff --git a/xpcom/base/nsStatusReporterManager.cpp b/xpcom/base/nsStatusReporterManager.cpp
index 491e7d458..42aa1f98b 100644
--- a/xpcom/base/nsStatusReporterManager.cpp
+++ b/xpcom/base/nsStatusReporterManager.cpp
@@ -226,13 +226,6 @@ nsStatusReporterManager::DumpReports()
return rv;
}
-#ifdef ANDROID
- rv = srFinalFile->AppendNative(NS_LITERAL_CSTRING("status-reports"));
- if (NS_WARN_IF(NS_FAILED(rv))) {
- return rv;
- }
-#endif
-
rv = srFinalFile->AppendNative(filename);
if (NS_WARN_IF(NS_FAILED(rv))) {
return rv;
diff --git a/xpcom/base/nsSystemInfo.cpp b/xpcom/base/nsSystemInfo.cpp
index 4a92a2eb4..f08346a85 100644
--- a/xpcom/base/nsSystemInfo.cpp
+++ b/xpcom/base/nsSystemInfo.cpp
@@ -35,7 +35,7 @@
#include <dlfcn.h>
#endif
-#if defined (XP_LINUX) && !defined (ANDROID)
+#if defined (XP_LINUX)
#include <unistd.h>
#include <fstream>
#include "mozilla/Tokenizer.h"
@@ -45,17 +45,6 @@
#include <string>
#endif
-#ifdef MOZ_WIDGET_ANDROID
-#include "AndroidBridge.h"
-#include "mozilla/dom/ContentChild.h"
-#endif
-
-#ifdef ANDROID
-extern "C" {
-NS_EXPORT int android_sdk_version;
-}
-#endif
-
#ifdef XP_MACOSX
#include <sys/sysctl.h>
#endif
@@ -67,7 +56,7 @@ NS_EXPORT int android_sdk_version;
// only happens well after that point.
uint32_t nsSystemInfo::gUserUmask = 0;
-#if defined (XP_LINUX) && !defined (ANDROID)
+#ifdef XP_LINUX
static void
SimpleParseKeyValuePairs(const std::string& aFilename,
std::map<nsCString, nsCString>& aKeyValuePairs)
@@ -491,7 +480,7 @@ nsSystemInfo::Init()
}
MOZ_ASSERT(sizeof(sysctlValue32) == len);
-#elif defined (XP_LINUX) && !defined (ANDROID)
+#elif defined(XP_LINUX)
// Get vendor, family, model, stepping, physical cores, L3 cache size
// from /proc/cpuinfo file
{
@@ -727,109 +716,9 @@ nsSystemInfo::Init()
}
#endif
-#ifdef MOZ_WIDGET_ANDROID
- AndroidSystemInfo info;
- if (XRE_IsContentProcess()) {
- dom::ContentChild* child = dom::ContentChild::GetSingleton();
- if (child) {
- child->SendGetAndroidSystemInfo(&info);
- SetupAndroidInfo(info);
- }
- } else {
- GetAndroidSystemInfo(&info);
- SetupAndroidInfo(info);
- }
-#endif
-
return NS_OK;
}
-#ifdef MOZ_WIDGET_ANDROID
-// Prerelease versions of Android use a letter instead of version numbers.
-// Unfortunately this breaks websites due to the user agent.
-// Chrome works around this by hardcoding an Android version when a
-// numeric version can't be obtained. We're doing the same.
-// This version will need to be updated whenever there is a new official
-// Android release.
-// See: https://cs.chromium.org/chromium/src/base/sys_info_android.cc?l=61
-#define DEFAULT_ANDROID_VERSION "6.0.99"
-
-/* static */
-void
-nsSystemInfo::GetAndroidSystemInfo(AndroidSystemInfo* aInfo)
-{
- MOZ_ASSERT(XRE_IsParentProcess());
-
- if (!mozilla::AndroidBridge::Bridge()) {
- aInfo->sdk_version() = 0;
- return;
- }
-
- nsAutoString str;
- if (mozilla::AndroidBridge::Bridge()->GetStaticStringField(
- "android/os/Build", "MODEL", str)) {
- aInfo->device() = str;
- }
- if (mozilla::AndroidBridge::Bridge()->GetStaticStringField(
- "android/os/Build", "MANUFACTURER", str)) {
- aInfo->manufacturer() = str;
- }
- if (mozilla::AndroidBridge::Bridge()->GetStaticStringField(
- "android/os/Build$VERSION", "RELEASE", str)) {
- int major_version;
- int minor_version;
- int bugfix_version;
- int num_read = sscanf(NS_ConvertUTF16toUTF8(str).get(), "%d.%d.%d", &major_version, &minor_version, &bugfix_version);
- if (num_read == 0) {
- aInfo->release_version() = NS_LITERAL_STRING(DEFAULT_ANDROID_VERSION);
- } else {
- aInfo->release_version() = str;
- }
- }
- if (mozilla::AndroidBridge::Bridge()->GetStaticStringField(
- "android/os/Build", "HARDWARE", str)) {
- aInfo->hardware() = str;
- }
- int32_t sdk_version;
- if (!mozilla::AndroidBridge::Bridge()->GetStaticIntField(
- "android/os/Build$VERSION", "SDK_INT", &sdk_version)) {
- sdk_version = 0;
- }
- aInfo->sdk_version() = sdk_version;
- aInfo->isTablet() = java::GeckoAppShell::IsTablet();
-}
-
-void
-nsSystemInfo::SetupAndroidInfo(const AndroidSystemInfo& aInfo)
-{
- if (!aInfo.device().IsEmpty()) {
- SetPropertyAsAString(NS_LITERAL_STRING("device"), aInfo.device());
- }
- if (!aInfo.manufacturer().IsEmpty()) {
- SetPropertyAsAString(NS_LITERAL_STRING("manufacturer"), aInfo.manufacturer());
- }
- if (!aInfo.release_version().IsEmpty()) {
- SetPropertyAsAString(NS_LITERAL_STRING("release_version"), aInfo.release_version());
- }
- SetPropertyAsBool(NS_LITERAL_STRING("tablet"), aInfo.isTablet());
- // NSPR "version" is the kernel version. For Android we want the Android version.
- // Rename SDK version to version and put the kernel version into kernel_version.
- nsAutoString str;
- nsresult rv = GetPropertyAsAString(NS_LITERAL_STRING("version"), str);
- if (NS_SUCCEEDED(rv)) {
- SetPropertyAsAString(NS_LITERAL_STRING("kernel_version"), str);
- }
- // When AndroidBridge is not available (eg. in xpcshell tests), sdk_version is 0.
- if (aInfo.sdk_version() != 0) {
- android_sdk_version = aInfo.sdk_version();
- if (android_sdk_version >= 8 && !aInfo.hardware().IsEmpty()) {
- SetPropertyAsAString(NS_LITERAL_STRING("hardware"), aInfo.hardware());
- }
- SetPropertyAsInt32(NS_LITERAL_STRING("version"), android_sdk_version);
- }
-}
-#endif // MOZ_WIDGET_ANDROID
-
void
nsSystemInfo::SetInt32Property(const nsAString& aPropertyName,
const int32_t aValue)
diff --git a/xpcom/base/nsSystemInfo.h b/xpcom/base/nsSystemInfo.h
index 5a7ef4424..8e9263d3a 100644
--- a/xpcom/base/nsSystemInfo.h
+++ b/xpcom/base/nsSystemInfo.h
@@ -12,10 +12,6 @@
#include "nsIObserver.h"
#endif // defined(XP_WIN)
-#ifdef MOZ_WIDGET_ANDROID
-#include "mozilla/dom/PContent.h"
-#endif // MOZ_WIDGET_ANDROID
-
class nsSystemInfo final
: public nsHashPropertyBag
#if defined(XP_WIN)
@@ -36,12 +32,6 @@ public:
// See comments above the variable definition and in NS_InitXPCOM2.
static uint32_t gUserUmask;
-#ifdef MOZ_WIDGET_ANDROID
- static void GetAndroidSystemInfo(mozilla::dom::AndroidSystemInfo* aInfo);
- protected:
- void SetupAndroidInfo(const mozilla::dom::AndroidSystemInfo&);
-#endif
-
protected:
void SetInt32Property(const nsAString& aPropertyName,
const int32_t aValue);
diff --git a/xpcom/base/nsUUIDGenerator.cpp b/xpcom/base/nsUUIDGenerator.cpp
index 254a01322..12fe4ec2e 100644
--- a/xpcom/base/nsUUIDGenerator.cpp
+++ b/xpcom/base/nsUUIDGenerator.cpp
@@ -16,10 +16,6 @@
#include "nsUUIDGenerator.h"
-#ifdef ANDROID
-extern "C" NS_EXPORT void arc4random_buf(void*, size_t);
-#endif
-
using namespace mozilla;
NS_IMPL_ISUPPORTS(nsUUIDGenerator, nsIUUIDGenerator)
diff --git a/xpcom/build/BinaryPath.h b/xpcom/build/BinaryPath.h
index 53034fcd8..a3ee5a517 100644
--- a/xpcom/build/BinaryPath.h
+++ b/xpcom/build/BinaryPath.h
@@ -84,22 +84,6 @@ private:
return rv;
}
-#elif defined(ANDROID)
- static nsresult Get(const char* argv0, char aResult[MAXPATHLEN])
- {
- // On Android, we use the GRE_HOME variable that is set by the Java
- // bootstrap code.
- const char* greHome = getenv("GRE_HOME");
-
- if (!greHome) {
- return NS_ERROR_FAILURE;
- }
-
- snprintf(aResult, MAXPATHLEN, "%s/%s", greHome, "dummy");
- aResult[MAXPATHLEN - 1] = '\0';
- return NS_OK;
- }
-
#elif defined(XP_UNIX)
static nsresult Get(const char* aArgv0, char aResult[MAXPATHLEN])
{
diff --git a/xpcom/build/XPCOMInit.cpp b/xpcom/build/XPCOMInit.cpp
index b89f51a98..bb639248c 100644
--- a/xpcom/build/XPCOMInit.cpp
+++ b/xpcom/build/XPCOMInit.cpp
@@ -569,13 +569,11 @@ NS_InitXPCOM2(nsIServiceManager** aResult,
return rv;
}
-#ifndef ANDROID
// If the locale hasn't already been setup by our embedder,
// get us out of the "C" locale and into the system
if (strcmp(setlocale(LC_ALL, nullptr), "C") == 0) {
setlocale(LC_ALL, "");
}
-#endif
#if defined(XP_UNIX)
NS_StartupNativeCharsetUtils();
diff --git a/xpcom/build/XREChildData.h b/xpcom/build/XREChildData.h
index c849131d6..7cda74d97 100644
--- a/xpcom/build/XREChildData.h
+++ b/xpcom/build/XREChildData.h
@@ -20,13 +20,10 @@ class GMPLoader;
*/
struct XREChildData
{
-#if !defined(MOZ_WIDGET_ANDROID)
/**
* Used to load the GMP binary.
*/
mozilla::UniquePtr<mozilla::gmp::GMPLoader> gmpLoader;
-#endif
-
};
#endif // XREChildData_h
diff --git a/xpcom/components/ManifestParser.cpp b/xpcom/components/ManifestParser.cpp
index 7188c0ec5..b69a204ba 100644
--- a/xpcom/components/ManifestParser.cpp
+++ b/xpcom/components/ManifestParser.cpp
@@ -21,10 +21,6 @@
#include <gtk/gtk.h>
#endif
-#ifdef MOZ_WIDGET_ANDROID
-#include "AndroidBridge.h"
-#endif
-
#include "mozilla/Services.h"
#include "nsCRT.h"
@@ -478,9 +474,6 @@ ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
NS_NAMED_LITERAL_STRING(kOsVersion, "osversion");
NS_NAMED_LITERAL_STRING(kABI, "abi");
NS_NAMED_LITERAL_STRING(kProcess, "process");
-#if defined(MOZ_WIDGET_ANDROID)
- NS_NAMED_LITERAL_STRING(kTablet, "tablet");
-#endif
NS_NAMED_LITERAL_STRING(kMain, "main");
NS_NAMED_LITERAL_STRING(kContent, "content");
@@ -557,14 +550,6 @@ ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
nsTextFormatter::ssprintf(osVersion, u"%ld.%ld",
gtk_major_version,
gtk_minor_version);
-#elif defined(MOZ_WIDGET_ANDROID)
- bool isTablet = false;
- if (mozilla::AndroidBridge::Bridge()) {
- mozilla::AndroidBridge::Bridge()->GetStaticStringField("android/os/Build$VERSION",
- "RELEASE",
- osVersion);
- isTablet = java::GeckoAppShell::IsTablet();
- }
#endif
if (XRE_IsContentProcess()) {
@@ -665,9 +650,7 @@ ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
TriState stOs = eUnspecified;
TriState stABI = eUnspecified;
TriState stProcess = eUnspecified;
-#if defined(MOZ_WIDGET_ANDROID)
- TriState stTablet = eUnspecified;
-#endif
+
int flags = 0;
while ((token = nsCRT::strtok(whitespace, kWhitespace, &whitespace)) &&
@@ -685,14 +668,6 @@ ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
continue;
}
-#if defined(MOZ_WIDGET_ANDROID)
- bool tablet = false;
- if (CheckFlag(kTablet, wtoken, tablet)) {
- stTablet = (tablet == isTablet) ? eOK : eBad;
- continue;
- }
-#endif
-
if (directive->contentflags) {
bool flag;
if (CheckFlag(kPlatform, wtoken, flag)) {
@@ -737,9 +712,6 @@ ParseManifest(NSLocationType aType, FileLocation& aFile, char* aBuf,
stGeckoVersion == eBad ||
stOs == eBad ||
stOsVersion == eBad ||
-#ifdef MOZ_WIDGET_ANDROID
- stTablet == eBad ||
-#endif
stABI == eBad ||
stProcess == eBad) {
continue;
diff --git a/xpcom/glue/FileUtils.cpp b/xpcom/glue/FileUtils.cpp
index 53fe68708..65a6c1e82 100644
--- a/xpcom/glue/FileUtils.cpp
+++ b/xpcom/glue/FileUtils.cpp
@@ -226,7 +226,7 @@ mozilla::ReadAheadLib(nsIFile* aFile)
return;
}
ReadAheadLib(path.get());
-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
+#elif defined(LINUX) || defined(XP_MACOSX)
nsAutoCString nativePath;
if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
return;
@@ -245,7 +245,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
return;
}
ReadAheadFile(path.get(), aOffset, aCount, aOutFd);
-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX)
+#elif defined(LINUX) || defined(XP_MACOSX)
nsAutoCString nativePath;
if (!aFile || NS_FAILED(aFile->GetNativePath(nativePath))) {
return;
@@ -256,7 +256,7 @@ mozilla::ReadAheadFile(nsIFile* aFile, const size_t aOffset,
#endif // !defined(XPCOM_GLUE)
-#if defined(LINUX) && !defined(ANDROID)
+#if defined(LINUX)
static const unsigned int bufsize = 4096;
@@ -382,7 +382,7 @@ mozilla::ReadAhead(mozilla::filedesc_t aFd, const size_t aOffset,
// Restore the file pointer
SetFilePointerEx(aFd, fpOriginal, nullptr, FILE_BEGIN);
-#elif defined(LINUX) && !defined(ANDROID)
+#elif defined(LINUX)
readahead(aFd, aOffset, aCount);
@@ -405,7 +405,7 @@ mozilla::ReadAheadLib(mozilla::pathstr_t aFilePath)
}
#if defined(XP_WIN)
ReadAheadFile(aFilePath);
-#elif defined(LINUX) && !defined(ANDROID)
+#elif defined(LINUX)
int fd = open(aFilePath, O_RDONLY);
if (fd < 0) {
return;
@@ -532,7 +532,7 @@ mozilla::ReadAheadFile(mozilla::pathstr_t aFilePath, const size_t aOffset,
if (!aOutFd) {
CloseHandle(fd);
}
-#elif defined(LINUX) && !defined(ANDROID) || defined(XP_MACOSX) || defined(XP_SOLARIS)
+#elif defined(LINUX) || defined(XP_MACOSX) || defined(XP_SOLARIS)
if (!aFilePath) {
if (aOutFd) {
*aOutFd = -1;
diff --git a/xpcom/glue/nsCRTGlue.cpp b/xpcom/glue/nsCRTGlue.cpp
index 03c77da2b..4cf68df2e 100644
--- a/xpcom/glue/nsCRTGlue.cpp
+++ b/xpcom/glue/nsCRTGlue.cpp
@@ -22,11 +22,6 @@
#include "mozilla/UniquePtr.h"
#endif
-#ifdef ANDROID
-#include <android/log.h>
-#include <unistd.h>
-#endif
-
using namespace mozilla;
const char*
@@ -365,20 +360,6 @@ vprintf_stderr(const char* aFmt, va_list aArgs)
fclose(fp);
}
-
-#elif defined(ANDROID)
-void
-vprintf_stderr(const char* aFmt, va_list aArgs)
-{
- if (sStderrCallback) {
- va_list argsCpy;
- VARARGS_ASSIGN(argsCpy, aArgs);
- sStderrCallback(aFmt, aArgs);
- va_end(argsCpy);
- }
-
- __android_log_vprint(ANDROID_LOG_INFO, "Gecko", aFmt, aArgs);
-}
#else
void
vprintf_stderr(const char* aFmt, va_list aArgs)
diff --git a/xpcom/glue/standalone/nsXPCOMGlue.cpp b/xpcom/glue/standalone/nsXPCOMGlue.cpp
index b657d7050..73cbc179e 100644
--- a/xpcom/glue/standalone/nsXPCOMGlue.cpp
+++ b/xpcom/glue/standalone/nsXPCOMGlue.cpp
@@ -80,7 +80,7 @@ CloseLibHandle(LibHandleType aLibHandle)
#else
#include <dlfcn.h>
-#if defined(MOZ_LINKER) && !defined(ANDROID)
+#ifdef MOZ_LINKER
extern "C" {
NS_HIDDEN __typeof(dlopen) __wrap_dlopen;
NS_HIDDEN __typeof(dlsym) __wrap_dlsym;
diff --git a/xpcom/io/SpecialSystemDirectory.cpp b/xpcom/io/SpecialSystemDirectory.cpp
index 158431088..c174b4ac7 100644
--- a/xpcom/io/SpecialSystemDirectory.cpp
+++ b/xpcom/io/SpecialSystemDirectory.cpp
@@ -187,13 +187,8 @@ GetRegWindowsAppDataFolder(bool aLocal, nsIFile** aFile)
static nsresult
GetUnixHomeDir(nsIFile** aFile)
{
-#if defined(ANDROID)
- // XXX no home dir on android; maybe we should return the sdcard if present?
- return NS_ERROR_FAILURE;
-#else
return NS_NewNativeLocalFile(nsDependentCString(PR_GetEnv("HOME")),
true, aFile);
-#endif
}
/*
diff --git a/xpcom/io/nsLocalFileUnix.cpp b/xpcom/io/nsLocalFileUnix.cpp
index 06706235d..48f2786a7 100644
--- a/xpcom/io/nsLocalFileUnix.cpp
+++ b/xpcom/io/nsLocalFileUnix.cpp
@@ -62,12 +62,6 @@
static nsresult MacErrorMapper(OSErr inErr);
#endif
-#ifdef MOZ_WIDGET_ANDROID
-#include "GeneratedJNIWrappers.h"
-#include "nsIMIMEService.h"
-#include <linux/magic.h>
-#endif
-
#ifdef MOZ_ENABLE_CONTENTACTION
#include <contentaction/contentaction.h>
#endif
@@ -1064,12 +1058,6 @@ nsLocalFile::Remove(bool aRecursive)
}
rv = file->Remove(aRecursive);
-#ifdef ANDROID
- // See bug 580434 - Bionic gives us just deleted files
- if (rv == NS_ERROR_FILE_TARGET_DOES_NOT_EXIST) {
- continue;
- }
-#endif
if (NS_FAILED(rv)) {
return rv;
}
@@ -1193,19 +1181,7 @@ nsLocalFile::SetPermissions(uint32_t aPermissions)
if (chmod(mPath.get(), aPermissions) >= 0) {
return NS_OK;
}
-#if defined(ANDROID) && defined(STATFS)
- // For the time being, this is restricted for use by Android, but we
- // will figure out what to do for all platforms in bug 638503
- struct STATFS sfs;
- if (STATFS(mPath.get(), &sfs) < 0) {
- return NSRESULT_FOR_ERRNO();
- }
- // if this is a FAT file system we can't set file permissions
- if (sfs.f_type == MSDOS_SUPER_MAGIC) {
- return NS_OK;
- }
-#endif
return NSRESULT_FOR_ERRNO();
}
@@ -1237,20 +1213,7 @@ nsLocalFile::SetFileSize(int64_t aFileSize)
{
CHECK_mPath();
-#if defined(ANDROID)
- /* no truncate on bionic */
- int fd = open(mPath.get(), O_WRONLY);
- if (fd == -1) {
- return NSRESULT_FOR_ERRNO();
- }
-
- int ret = ftruncate(fd, (off_t)aFileSize);
- close(fd);
-
- if (ret == -1) {
- return NSRESULT_FOR_ERRNO();
- }
-#elif defined(HAVE_TRUNCATE64)
+#if defined(HAVE_TRUNCATE64)
if (truncate64(mPath.get(), (off64_t)aFileSize) == -1) {
return NSRESULT_FOR_ERRNO();
}
@@ -2013,23 +1976,6 @@ nsLocalFile::Launch()
}
return NS_ERROR_FAILURE;
-#elif defined(MOZ_WIDGET_ANDROID)
- // Try to get a mimetype, if this fails just use the file uri alone
- nsresult rv;
- nsAutoCString type;
- nsCOMPtr<nsIMIMEService> mimeService(do_GetService("@mozilla.org/mime;1", &rv));
- if (NS_SUCCEEDED(rv)) {
- rv = mimeService->GetTypeFromFile(this, type);
- }
-
- nsAutoCString fileUri = NS_LITERAL_CSTRING("file://") + mPath;
- return java::GeckoAppShell::OpenUriExternal(
- NS_ConvertUTF8toUTF16(fileUri),
- NS_ConvertUTF8toUTF16(type),
- EmptyString(),
- EmptyString(),
- EmptyString(),
- EmptyString()) ? NS_OK : NS_ERROR_FAILURE;
#elif defined(MOZ_WIDGET_COCOA)
CFURLRef url;
if (NS_SUCCEEDED(GetCFURL(&url))) {
diff --git a/xpcom/io/nsNativeCharsetUtils.cpp b/xpcom/io/nsNativeCharsetUtils.cpp
index e53307af5..fcc208264 100644
--- a/xpcom/io/nsNativeCharsetUtils.cpp
+++ b/xpcom/io/nsNativeCharsetUtils.cpp
@@ -7,9 +7,9 @@
#include "xpcom-private.h"
//-----------------------------------------------------------------------------
-// XP_MACOSX or ANDROID
+// XP_MACOSX
//-----------------------------------------------------------------------------
-#if defined(XP_MACOSX) || defined(ANDROID)
+#if defined(XP_MACOSX)
#include "nsAString.h"
#include "nsReadableUtils.h"
diff --git a/xpcom/io/nsNativeCharsetUtils.h b/xpcom/io/nsNativeCharsetUtils.h
index 5c1e670d5..c3053a7df 100644
--- a/xpcom/io/nsNativeCharsetUtils.h
+++ b/xpcom/io/nsNativeCharsetUtils.h
@@ -39,13 +39,13 @@ nsresult NS_CopyUnicodeToNative(const nsAString& aInput, nsACString& aOutput);
* a real function. On Mac OS X it's always UTF-8 while on Windows
* and other platforms (e.g. OS2), it's never UTF-8.
*/
-#if defined(XP_UNIX) && !defined(XP_MACOSX) && !defined(ANDROID)
+#if defined(XP_UNIX) && !defined(XP_MACOSX)
bool NS_IsNativeUTF8();
#else
inline bool
NS_IsNativeUTF8()
{
-#if defined(XP_MACOSX) || defined(ANDROID)
+#if defined(XP_MACOSX)
return true;
#else
return false;
diff --git a/xpcom/reflect/xptcall/md/unix/moz.build b/xpcom/reflect/xptcall/md/unix/moz.build
index 8ee7b3181..c5d968608 100644
--- a/xpcom/reflect/xptcall/md/unix/moz.build
+++ b/xpcom/reflect/xptcall/md/unix/moz.build
@@ -177,7 +177,7 @@ if CONFIG['OS_ARCH'] == 'OpenBSD' and CONFIG['OS_TEST'] == 'powerpc':
'xptcstubs_ppc_openbsd.cpp',
]
-if CONFIG['OS_ARCH'] == 'Linux' and 'sparc' in CONFIG['OS_TEST']:
+if CONFIG['OS_ARCH'] == 'Linux' and CONFIG['OS_TEST'] == 'sparc':
SOURCES += [
'xptcinvoke_asm_sparc_linux_GCC3.s',
'xptcinvoke_sparc_solaris.cpp',
@@ -205,7 +205,7 @@ if CONFIG['OS_ARCH'] == 'OpenBSD' and CONFIG['OS_TEST'] == 'sparc':
# files for 64-bit SPARC with no ill effects, so basically the entire mess that
# was there before is no longer needed.
-if CONFIG['OS_ARCH'] in ('OpenBSD', 'FreeBSD', 'SunOS') and CONFIG['OS_TEST'] == 'sparc64':
+if CONFIG['OS_ARCH'] in ('OpenBSD', 'FreeBSD', 'SunOS', 'Linux') and CONFIG['OS_TEST'] == 'sparc64':
SOURCES += [
'xptcinvoke_asm_sparc64_openbsd.s',
'xptcinvoke_sparc64_openbsd.cpp',
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_arm.cpp b/xpcom/reflect/xptcall/md/unix/xptcinvoke_arm.cpp
index 4cd5eb47d..ef725e5e3 100644
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_arm.cpp
+++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_arm.cpp
@@ -9,7 +9,7 @@
#include "mozilla/Compiler.h"
-#if !defined(__arm__) && !(defined(LINUX) || defined(ANDROID) || defined(XP_IOS))
+#if !defined(__arm__) && !(defined(LINUX) || defined(XP_IOS))
#error "This code is for Linux/iOS ARM only. Check that it works on your system, too.\nBeware that this code is highly compiler dependent."
#endif
diff --git a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_mips.S b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_mips.S
index 32ff3b356..9fd99faa6 100644
--- a/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_mips.S
+++ b/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_mips.S
@@ -7,14 +7,8 @@
/* This code is for MIPS using the O32 ABI. */
-#ifdef ANDROID
-#include <asm/regdef.h>
-#include <asm/asm.h>
-#include <machine/asm.h>
-#else
#include <sys/regdef.h>
#include <sys/asm.h>
-#endif
# NARGSAVE is the argument space in the callers frame, including extra
# 'shadowed' space for the argument registers. The minimum of 4
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp b/xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp
index ef4f8514d..78664dfcf 100644
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp
+++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_arm.cpp
@@ -8,7 +8,7 @@
#include "xptcprivate.h"
#include "xptiprivate.h"
-#if !defined(__arm__) && !(defined(LINUX) || defined(ANDROID) || defined(XP_DARWIN))
+#if !defined(__arm__) && !(defined(LINUX) || defined(XP_DARWIN))
#error "This code is for Linux/iOS ARM only. Please check if it works for you, too.\nDepends strongly on gcc behaviour."
#endif
diff --git a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_mips.S b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_mips.S
index d17301634..ebfba775a 100644
--- a/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_mips.S
+++ b/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_mips.S
@@ -5,14 +5,8 @@
/* This code is for MIPS using the O32 ABI. */
-#ifdef ANDROID
-#include <asm/regdef.h>
-#include <asm/asm.h>
-#include <machine/asm.h>
-#else
#include <sys/regdef.h>
#include <sys/asm.h>
-#endif
# NARGSAVE is the argument space in the callers frame, including extra
# 'shadowed' space for the argument registers. The minimum of 4
diff --git a/xpcom/tests/gtest/TestTArray2.cpp b/xpcom/tests/gtest/TestTArray2.cpp
index 421927104..c932b8faa 100644
--- a/xpcom/tests/gtest/TestTArray2.cpp
+++ b/xpcom/tests/gtest/TestTArray2.cpp
@@ -871,8 +871,6 @@ TEST(TArray, test_swap) {
}
}
-// Bug 1171296: Disabled on andoid due to crashes.
-#if !defined(ANDROID)
TEST(TArray, test_fallible)
{
// Test that FallibleTArray works properly; that is, it never OOMs, but
@@ -909,7 +907,6 @@ TEST(TArray, test_fallible)
ASSERT_TRUE(oomed) << "Didn't OOM or crash? nsTArray::SetCapacity"
"must be lying.";
}
-#endif
TEST(TArray, test_conversion_operator) {
FallibleTArray<int> f;
diff --git a/xpcom/tests/gtest/moz.build b/xpcom/tests/gtest/moz.build
index ac98c2217..4ed242d03 100644
--- a/xpcom/tests/gtest/moz.build
+++ b/xpcom/tests/gtest/moz.build
@@ -48,9 +48,8 @@ UNIFIED_SOURCES += [
'TestXPIDLString.cpp',
]
-if CONFIG['MOZ_DEBUG'] and CONFIG['OS_ARCH'] not in ('WINNT') and CONFIG['OS_TARGET'] != 'Android':
+if CONFIG['MOZ_DEBUG'] and CONFIG['OS_ARCH'] not in ('WINNT'):
# FIXME bug 523392: TestDeadlockDetector doesn't like Windows
- # Bug 1054249: Doesn't work on Android
UNIFIED_SOURCES += [
'TestDeadlockDetector.cpp',
'TestDeadlockDetectorScalability.cpp',
diff --git a/xpcom/threads/ThreadStackHelper.cpp b/xpcom/threads/ThreadStackHelper.cpp
index 2c0e87986..88a0360ef 100644
--- a/xpcom/threads/ThreadStackHelper.cpp
+++ b/xpcom/threads/ThreadStackHelper.cpp
@@ -46,19 +46,6 @@
#include <pthread.h>
#endif
-#ifdef ANDROID
-#ifndef SYS_gettid
-#define SYS_gettid __NR_gettid
-#endif
-#if defined(__arm__) && !defined(__NR_rt_tgsigqueueinfo)
-// Some NDKs don't define this constant even though the kernel supports it.
-#define __NR_rt_tgsigqueueinfo (__NR_SYSCALL_BASE+363)
-#endif
-#ifndef SYS_rt_tgsigqueueinfo
-#define SYS_rt_tgsigqueueinfo __NR_rt_tgsigqueueinfo
-#endif
-#endif
-
namespace mozilla {
void
diff --git a/xpcom/threads/nsThread.cpp b/xpcom/threads/nsThread.cpp
index 19464f2f0..7a1fd6052 100644
--- a/xpcom/threads/nsThread.cpp
+++ b/xpcom/threads/nsThread.cpp
@@ -49,7 +49,7 @@
_XOPEN_SOURCE && _XOPEN_SOURCE_EXTENDED) && \
!(_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700)
-#if defined(XP_LINUX) && !defined(ANDROID) && defined(_GNU_SOURCE)
+#if defined(XP_LINUX) && defined(_GNU_SOURCE)
#define HAVE_SCHED_SETAFFINITY
#endif
diff --git a/xpcom/threads/nsThread.h b/xpcom/threads/nsThread.h
index 037ef1952..c1b3d2618 100644
--- a/xpcom/threads/nsThread.h
+++ b/xpcom/threads/nsThread.h
@@ -264,7 +264,7 @@ protected:
bool mCanInvokeJS;
};
-#if defined(XP_UNIX) && !defined(ANDROID) && !defined(DEBUG) && HAVE_UALARM \
+#if defined(XP_UNIX) && !defined(DEBUG) && HAVE_UALARM \
&& defined(_GNU_SOURCE)
# define MOZ_CANARY